From 96dbaacca69d23539e2007a461306bb2726caaba Mon Sep 17 00:00:00 2001 From: Gavin Joyce Date: Fri, 20 Jan 2017 20:49:01 +0000 Subject: [PATCH 1/3] 2.10.2-with-backtracking --- bower.json | 2 +- component.json | 2 +- composer.json | 2 +- ember-runtime.js | 5187 ++- ember-template-compiler.js | 425 +- ember-testing.js | 15 +- ember-tests.js | 82990 +++++++++++++++++++++++++++++++++++ ember-tests.prod.js | 82555 ++++++++++++++++++++++++++++++++++ ember.debug.js | 6430 ++- ember.js | 6430 ++- ember.min.js | 3649 +- ember.prod.js | 6398 ++- package.json | 2 +- 13 files changed, 181383 insertions(+), 12704 deletions(-) create mode 100644 ember-tests.js create mode 100644 ember-tests.prod.js diff --git a/bower.json b/bower.json index db32fd3c1..ccac6302d 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "ember", - "version": "2.11.0-beta.2", + "version": "2.10.2-with-backtracking", "license": "MIT", "homepage": "https://github.com/emberjs/ember.js", "main": [ diff --git a/component.json b/component.json index e1096c62e..1040acef9 100644 --- a/component.json +++ b/component.json @@ -1,7 +1,7 @@ { "name": "ember", "repo": "components/ember", - "version": "2.11.0-beta.2", + "version": "2.10.2-with-backtracking", "license": "MIT", "homepage": "https://github.com/emberjs/ember.js", "main": "ember.debug.js", diff --git a/composer.json b/composer.json index 73f8310a9..65c2e703f 100644 --- a/composer.json +++ b/composer.json @@ -25,5 +25,5 @@ } } }, - "version": "2.11.0-beta.2" + "version": "2.10.2-with-backtracking" } diff --git a/ember-runtime.js b/ember-runtime.js index 815220803..736bff9ce 100644 --- a/ember-runtime.js +++ b/ember-runtime.js @@ -6,10 +6,11 @@ * 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.11.0-beta.2 + * @version 2.10.2-with-backtracking */ var enifed, requireModule, Ember; +var mainContext = this; (function() { var isNode = typeof window === 'undefined' && @@ -111,6 +112,8 @@ var enifed, requireModule, Ember; } })(); +var babelHelpers; + function inherits(subClass, superClass) { subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { @@ -1458,7 +1461,7 @@ enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'e var factoryInjections = factoryInjectionsFor(container, fullName); var cacheable = !areInjectionsDynamic(injections) && !areInjectionsDynamic(factoryInjections); - factoryInjections[_emberUtils.NAME_KEY] = registry.makeToString(factory, fullName); + factoryInjections._toString = registry.makeToString(factory, fullName); var injectedFactory = factory.extend(injections); @@ -2785,6 +2788,8 @@ enifed('ember-metal/alias', ['exports', 'ember-utils', 'ember-metal/debug', 'emb exports.default = alias; exports.AliasedProperty = AliasedProperty; + var CONSUMED = {}; + function alias(altKey) { return new AliasedProperty(altKey); } @@ -2805,28 +2810,30 @@ enifed('ember-metal/alias', ['exports', 'ember-utils', 'ember-metal/debug', 'emb } }; - AliasedProperty.prototype._addDependentKeyIfMissing = function (obj, keyName) { + AliasedProperty.prototype.teardown = function (obj, keyName) { var meta = _emberMetalMeta.meta(obj); - if (!meta.peekDeps(this.altKey, keyName)) { - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); + if (meta.peekWatching(keyName)) { + _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); } }; - AliasedProperty.prototype._removeDependentKeyIfAdded = function (obj, keyName) { - var meta = _emberMetalMeta.meta(obj); - if (meta.peekDeps(this.altKey, keyName)) { - _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); - } + AliasedProperty.prototype.willWatch = function (obj, keyName) { + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); }; - AliasedProperty.prototype.willWatch = AliasedProperty.prototype._addDependentKeyIfMissing; - AliasedProperty.prototype.didUnwatch = AliasedProperty.prototype._removeDependentKeyIfAdded; - AliasedProperty.prototype.teardown = AliasedProperty.prototype._removeDependentKeyIfAdded; + AliasedProperty.prototype.didUnwatch = function (obj, keyName) { + _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); + }; AliasedProperty.prototype.get = function AliasedProperty_get(obj, keyName) { - this._addDependentKeyIfMissing(obj, keyName); - - return _emberMetalProperty_get.get(obj, this.altKey); + var ret = _emberMetalProperty_get.get(obj, this.altKey); + var meta = _emberMetalMeta.meta(obj); + var cache = meta.writableCache(); + if (cache[keyName] !== CONSUMED) { + cache[keyName] = CONSUMED; + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); + } + return ret; }; AliasedProperty.prototype.set = function AliasedProperty_set(obj, keyName, value) { @@ -5337,6 +5344,7 @@ enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-me exports.removeObserver = _emberMetalObserver.removeObserver; exports._addBeforeObserver = _emberMetalObserver._addBeforeObserver; exports._removeBeforeObserver = _emberMetalObserver._removeBeforeObserver; + exports.NAME_KEY = _emberMetalMixin.NAME_KEY; exports.Mixin = _emberMetalMixin.Mixin; exports.aliasMethod = _emberMetalMixin.aliasMethod; exports._immediateObserver = _emberMetalMixin._immediateObserver; @@ -7375,32 +7383,20 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb function applyConcatenatedProperties(obj, key, value, values) { var baseValue = values[key] || obj[key]; - var ret = undefined; if (baseValue) { if ('function' === typeof baseValue.concat) { if (value === null || value === undefined) { - ret = baseValue; + return baseValue; } else { - ret = baseValue.concat(value); + return baseValue.concat(value); } } else { - ret = _emberUtils.makeArray(baseValue).concat(value); + return _emberUtils.makeArray(baseValue).concat(value); } } else { - ret = _emberUtils.makeArray(value); + return _emberUtils.makeArray(value); } - - _emberMetalDebug.runInDebug(function () { - // it is possible to use concatenatedProperties with strings (which cannot be frozen) - // only freeze objects... - if (typeof ret === 'object' && ret !== null) { - // prevent mutating `concatenatedProperties` array after it is applied - Object.freeze(ret); - } - }); - - return ret; } function applyMergedProperties(obj, key, value, values) { @@ -7676,6 +7672,9 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb return obj; } + var NAME_KEY = _emberUtils.GUID_KEY + '_name'; + + exports.NAME_KEY = NAME_KEY; /** The `Ember.Mixin` class allows you to create mixins, whose properties can be added to other classes. For instance, @@ -7758,7 +7757,7 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb this.ownerConstructor = undefined; this._without = undefined; this[_emberUtils.GUID_KEY] = null; - this[_emberUtils.NAME_KEY] = null; + this[NAME_KEY] = null; _emberMetalDebug.debugSeal(this); } @@ -10145,7 +10144,7 @@ enifed('ember-metal/transaction', ['exports', 'ember-metal/meta', 'ember-metal/d label = 'the same value'; } - return 'You modified ' + label + ' twice on ' + object + ' in a single render. This was unreliable and slow in Ember 1.x and ' + implication; + return 'You modified ' + parts.join('.') + ' twice on ' + object + ' in a single render. This was unreliable and slow in Ember 1.x and ' + implication; })(), false); shouldReflush = true; @@ -13200,6 +13199,8 @@ enifed('ember-runtime/mixins/action_handler', ['exports', 'ember-metal'], functi args[_key - 1] = arguments[_key]; } + var target = undefined; + if (this.actions && this.actions[actionName]) { var shouldBubble = this.actions[actionName].apply(this, args) === true; if (!shouldBubble) { @@ -13207,10 +13208,11 @@ enifed('ember-runtime/mixins/action_handler', ['exports', 'ember-metal'], functi } } - var target = _emberMetal.get(this, 'target'); - if (target) { + if (target = _emberMetal.get(this, 'target')) { + var _target; + _emberMetal.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); } }, @@ -13631,7 +13633,7 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-utils', 'ember-metal', ' /** This returns the objects at the specified indexes, using `objectAt`. ```javascript - let arr = ['a', 'b', 'c', 'd']; + let arr = ['a', 'b', 'c', 'd']; arr.objectsAt([0, 1, 2]); // ['a', 'b', 'c'] arr.objectsAt([2, 3, 4]); // ['c', 'd', undefined] ``` @@ -14571,8 +14573,7 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-utils', 'ember-meta for (var idx = 0; idx < len && !found; idx++) { next = this.nextObject(idx, last, context); - found = callback.call(target, next, idx, this); - if (found) { + if (found = callback.call(target, next, idx, this)) { ret = next; } @@ -17365,7 +17366,7 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met // using ember-metal/lib/main here to ensure that ember-debug is setup // if present - var _Mixin$create, _ClassMixinProps; + var _Mixin$create; var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['.'], ['.']); @@ -17624,7 +17625,7 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met CoreObject.__super__ = null; - var ClassMixinProps = (_ClassMixinProps = { + var ClassMixinProps = { ClassMixin: _emberMetal.REQUIRED, @@ -17632,95 +17633,310 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met isClass: true, - isMethod: false - }, _ClassMixinProps[_emberUtils.NAME_KEY] = null, _ClassMixinProps[_emberUtils.GUID_KEY] = null, _ClassMixinProps.extend = function () { - var Class = makeCtor(); - var proto; - Class.ClassMixin = _emberMetal.Mixin.create(this.ClassMixin); - Class.PrototypeMixin = _emberMetal.Mixin.create(this.PrototypeMixin); + isMethod: false, + /** + Creates a new subclass. + ```javascript + const Person = Ember.Object.extend({ + say(thing) { + alert(thing); + } + }); + ``` + This defines a new subclass of Ember.Object: `Person`. It contains one method: `say()`. + You can also create a subclass from any existing class by calling its `extend()` method. + For example, you might want to create a subclass of Ember's built-in `Ember.Component` class: + ```javascript + const PersonComponent = Ember.Component.extend({ + tagName: 'li', + classNameBindings: ['isAdministrator'] + }); + ``` + When defining a subclass, you can override methods but still access the + implementation of your parent class by calling the special `_super()` method: + ```javascript + const Person = Ember.Object.extend({ + say(thing) { + var name = this.get('name'); + alert(`${name} says: ${thing}`); + } + }); + const Soldier = Person.extend({ + say(thing) { + this._super(`${thing}, sir!`); + }, + march(numberOfHours) { + alert(`${this.get('name')} marches for ${numberOfHours} hours.`); + } + }); + let yehuda = Soldier.create({ + name: "Yehuda Katz" + }); + yehuda.say("Yes"); // alerts "Yehuda Katz says: Yes, sir!" + ``` + The `create()` on line #17 creates an *instance* of the `Soldier` class. + The `extend()` on line #8 creates a *subclass* of `Person`. Any instance + of the `Person` class will *not* have the `march()` method. + You can also pass `Mixin` classes to add additional properties to the subclass. + ```javascript + const Person = Ember.Object.extend({ + say(thing) { + alert(`${this.get('name')} says: ${thing}`); + } + }); + const SingingMixin = Mixin.create({ + sing(thing){ + alert(`${this.get('name')} sings: la la la ${thing}`); + } + }); + const BroadwayStar = Person.extend(SingingMixin, { + dance() { + alert(`${this.get('name')} dances: tap tap tap tap `); + } + }); + ``` + The `BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`. + @method extend + @static + @param {Mixin} [mixins]* One or more Mixin classes + @param {Object} [arguments]* Object containing values to use within the new class + @public + */ + extend: function () { + var Class = makeCtor(); + var proto; + Class.ClassMixin = _emberMetal.Mixin.create(this.ClassMixin); + Class.PrototypeMixin = _emberMetal.Mixin.create(this.PrototypeMixin); - Class.ClassMixin.ownerConstructor = Class; - Class.PrototypeMixin.ownerConstructor = Class; + Class.ClassMixin.ownerConstructor = Class; + Class.PrototypeMixin.ownerConstructor = Class; - reopen.apply(Class.PrototypeMixin, arguments); + reopen.apply(Class.PrototypeMixin, arguments); - Class.superclass = this; - Class.__super__ = this.prototype; + Class.superclass = this; + Class.__super__ = this.prototype; - proto = Class.prototype = Object.create(this.prototype); - proto.constructor = Class; - _emberUtils.generateGuid(proto); - _emberMetal.meta(proto).proto = proto; // this will disable observers on prototype + proto = Class.prototype = Object.create(this.prototype); + proto.constructor = Class; + _emberUtils.generateGuid(proto); + _emberMetal.meta(proto).proto = proto; // this will disable observers on prototype - Class.ClassMixin.apply(Class); - return Class; - }, _ClassMixinProps.create = function () { - var C = this; + Class.ClassMixin.apply(Class); + return Class; + }, - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } + /** + Creates an instance of a class. Accepts either no arguments, or an object + containing values to initialize the newly instantiated object with. + ```javascript + const Person = Ember.Object.extend({ + helloWorld() { + alert(`Hi, my name is ${this.get('name')}`); + } + }); + let tom = Person.create({ + name: 'Tom Dale' + }); + tom.helloWorld(); // alerts "Hi, my name is Tom Dale". + ``` + `create` will call the `init` function if defined during + `Ember.AnyObject.extend` + If no arguments are passed to `create`, it will not set values to the new + instance during initialization: + ```javascript + let noName = Person.create(); + noName.helloWorld(); // alerts undefined + ``` + NOTE: For performance reasons, you cannot declare methods or computed + properties during `create`. You should instead declare methods and computed + properties when using `extend`. + @method create + @static + @param [arguments]* + @public + */ + create: function () { + var C = this; - if (args.length > 0) { - this._initProperties(args); - } - return new C(); - }, _ClassMixinProps.reopen = function () { - this.willReopen(); - reopen.apply(this.PrototypeMixin, arguments); - return this; - }, _ClassMixinProps.reopenClass = function () { - reopen.apply(this.ClassMixin, arguments); - applyMixin(this, arguments, false); - return this; - }, _ClassMixinProps.detect = function (obj) { - if ('function' !== typeof obj) { - return false; - } - while (obj) { - if (obj === this) { - return true; + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; } - obj = obj.superclass; - } - return false; - }, _ClassMixinProps.detectInstance = function (obj) { - return obj instanceof this; - }, _ClassMixinProps.metaForProperty = function (key) { - var proto = this.proto(); - var possibleDesc = proto[key]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - _emberMetal.assert('metaForProperty() could not find a computed property ' + 'with key \'' + key + '\'.', !!desc && desc instanceof _emberMetal.ComputedProperty); - return desc._meta || {}; - }, _ClassMixinProps._computedProperties = _emberMetal.computed(function () { - hasCachedComputedProperties = true; - var proto = this.proto(); - var property; - var properties = []; + if (args.length > 0) { + this._initProperties(args); + } + return new C(); + }, + + /** + Augments a constructor's prototype with additional + properties and functions: + ```javascript + const MyObject = Ember.Object.extend({ + name: 'an object' + }); + o = MyObject.create(); + o.get('name'); // 'an object' + MyObject.reopen({ + say(msg){ + console.log(msg); + } + }) + o2 = MyObject.create(); + o2.say("hello"); // logs "hello" + o.say("goodbye"); // logs "goodbye" + ``` + To add functions and properties to the constructor itself, + see `reopenClass` + @method reopen + @public + */ + reopen: function () { + this.willReopen(); + reopen.apply(this.PrototypeMixin, arguments); + return this; + }, - for (var name in proto) { - property = proto[name]; + /** + Augments a constructor's own properties and functions: + ```javascript + const MyObject = Ember.Object.extend({ + name: 'an object' + }); + MyObject.reopenClass({ + canBuild: false + }); + MyObject.canBuild; // false + o = MyObject.create(); + ``` + In other words, this creates static properties and functions for the class. + These are only available on the class and not on any instance of that class. + ```javascript + const Person = Ember.Object.extend({ + name: "", + sayHello() { + alert("Hello. My name is " + this.get('name')); + } + }); + Person.reopenClass({ + species: "Homo sapiens", + createPerson(newPersonsName){ + return Person.create({ + name:newPersonsName + }); + } + }); + let tom = Person.create({ + name: "Tom Dale" + }); + let yehuda = Person.createPerson("Yehuda Katz"); + tom.sayHello(); // "Hello. My name is Tom Dale" + yehuda.sayHello(); // "Hello. My name is Yehuda Katz" + alert(Person.species); // "Homo sapiens" + ``` + Note that `species` and `createPerson` are *not* valid on the `tom` and `yehuda` + variables. They are only valid on `Person`. + To add functions and properties to instances of + a constructor by extending the constructor's prototype + see `reopen` + @method reopenClass + @public + */ + reopenClass: function () { + reopen.apply(this.ClassMixin, arguments); + applyMixin(this, arguments, false); + return this; + }, - if (property && property.isDescriptor) { - properties.push({ - name: name, - meta: property._meta - }); + detect: function (obj) { + if ('function' !== typeof obj) { + return false; } - } - return properties; - }).readOnly(), _ClassMixinProps.eachComputedProperty = function (callback, binding) { - var property; - var empty = {}; + while (obj) { + if (obj === this) { + return true; + } + obj = obj.superclass; + } + return false; + }, - var properties = _emberMetal.get(this, '_computedProperties'); + detectInstance: function (obj) { + return obj instanceof this; + }, - for (var i = 0; i < properties.length; i++) { - property = properties[i]; - callback.call(binding || this, property.name, property.meta || empty); + /** + In some cases, you may want to annotate computed properties with additional + metadata about how they function or what values they operate on. For + example, computed property functions may close over variables that are then + no longer available for introspection. + You can pass a hash of these values to a computed property like this: + ```javascript + person: Ember.computed(function() { + var personId = this.get('personId'); + return Person.create({ id: personId }); + }).meta({ type: Person }) + ``` + Once you've done this, you can retrieve the values saved to the computed + property from your class like this: + ```javascript + MyClass.metaForProperty('person'); + ``` + This will return the original hash that was passed to `meta()`. + @static + @method metaForProperty + @param key {String} property name + @private + */ + metaForProperty: function (key) { + var proto = this.proto(); + var possibleDesc = proto[key]; + var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; + + _emberMetal.assert('metaForProperty() could not find a computed property ' + 'with key \'' + key + '\'.', !!desc && desc instanceof _emberMetal.ComputedProperty); + return desc._meta || {}; + }, + + _computedProperties: _emberMetal.computed(function () { + hasCachedComputedProperties = true; + var proto = this.proto(); + var property; + var properties = []; + + for (var name in proto) { + property = proto[name]; + + if (property && property.isDescriptor) { + properties.push({ + name: name, + meta: property._meta + }); + } + } + return properties; + }).readOnly(), + + /** + Iterate over each computed property for the class, passing its name + and any associated metadata (see `metaForProperty`) to the callback. + @static + @method eachComputedProperty + @param {Function} callback + @param {Object} binding + @private + */ + eachComputedProperty: function (callback, binding) { + var property; + var empty = {}; + + var properties = _emberMetal.get(this, '_computedProperties'); + + for (var i = 0; i < properties.length; i++) { + property = properties[i]; + callback.call(binding || this, property.name, property.meta || empty); + } } - }, _ClassMixinProps); + }; function injectedPropertyAssertion() { _emberMetal.assert('Injected properties are invalid', _emberRuntimeInject.validatePropertyInjections(this)); @@ -17978,210 +18194,6 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met @return {String} string representation @public */ - -/** - Creates a new subclass. - ```javascript - const Person = Ember.Object.extend({ - say(thing) { - alert(thing); - } - }); - ``` - This defines a new subclass of Ember.Object: `Person`. It contains one method: `say()`. - You can also create a subclass from any existing class by calling its `extend()` method. - For example, you might want to create a subclass of Ember's built-in `Ember.Component` class: - ```javascript - const PersonComponent = Ember.Component.extend({ - tagName: 'li', - classNameBindings: ['isAdministrator'] - }); - ``` - When defining a subclass, you can override methods but still access the - implementation of your parent class by calling the special `_super()` method: - ```javascript - const Person = Ember.Object.extend({ - say(thing) { - var name = this.get('name'); - alert(`${name} says: ${thing}`); - } - }); - const Soldier = Person.extend({ - say(thing) { - this._super(`${thing}, sir!`); - }, - march(numberOfHours) { - alert(`${this.get('name')} marches for ${numberOfHours} hours.`); - } - }); - let yehuda = Soldier.create({ - name: "Yehuda Katz" - }); - yehuda.say("Yes"); // alerts "Yehuda Katz says: Yes, sir!" - ``` - The `create()` on line #17 creates an *instance* of the `Soldier` class. - The `extend()` on line #8 creates a *subclass* of `Person`. Any instance - of the `Person` class will *not* have the `march()` method. - You can also pass `Mixin` classes to add additional properties to the subclass. - ```javascript - const Person = Ember.Object.extend({ - say(thing) { - alert(`${this.get('name')} says: ${thing}`); - } - }); - const SingingMixin = Mixin.create({ - sing(thing){ - alert(`${this.get('name')} sings: la la la ${thing}`); - } - }); - const BroadwayStar = Person.extend(SingingMixin, { - dance() { - alert(`${this.get('name')} dances: tap tap tap tap `); - } - }); - ``` - The `BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`. - @method extend - @static - @param {Mixin} [mixins]* One or more Mixin classes - @param {Object} [arguments]* Object containing values to use within the new class - @public -*/ - -/** - Creates an instance of a class. Accepts either no arguments, or an object - containing values to initialize the newly instantiated object with. - ```javascript - const Person = Ember.Object.extend({ - helloWorld() { - alert(`Hi, my name is ${this.get('name')}`); - } - }); - let tom = Person.create({ - name: 'Tom Dale' - }); - tom.helloWorld(); // alerts "Hi, my name is Tom Dale". - ``` - `create` will call the `init` function if defined during - `Ember.AnyObject.extend` - If no arguments are passed to `create`, it will not set values to the new - instance during initialization: - ```javascript - let noName = Person.create(); - noName.helloWorld(); // alerts undefined - ``` - NOTE: For performance reasons, you cannot declare methods or computed - properties during `create`. You should instead declare methods and computed - properties when using `extend`. - @method create - @static - @param [arguments]* - @public -*/ - -/** - Augments a constructor's prototype with additional - properties and functions: - ```javascript - const MyObject = Ember.Object.extend({ - name: 'an object' - }); - o = MyObject.create(); - o.get('name'); // 'an object' - MyObject.reopen({ - say(msg){ - console.log(msg); - } - }) - o2 = MyObject.create(); - o2.say("hello"); // logs "hello" - o.say("goodbye"); // logs "goodbye" - ``` - To add functions and properties to the constructor itself, - see `reopenClass` - @method reopen - @public -*/ - -/** - Augments a constructor's own properties and functions: - ```javascript - const MyObject = Ember.Object.extend({ - name: 'an object' - }); - MyObject.reopenClass({ - canBuild: false - }); - MyObject.canBuild; // false - o = MyObject.create(); - ``` - In other words, this creates static properties and functions for the class. - These are only available on the class and not on any instance of that class. - ```javascript - const Person = Ember.Object.extend({ - name: "", - sayHello() { - alert("Hello. My name is " + this.get('name')); - } - }); - Person.reopenClass({ - species: "Homo sapiens", - createPerson(newPersonsName){ - return Person.create({ - name:newPersonsName - }); - } - }); - let tom = Person.create({ - name: "Tom Dale" - }); - let yehuda = Person.createPerson("Yehuda Katz"); - tom.sayHello(); // "Hello. My name is Tom Dale" - yehuda.sayHello(); // "Hello. My name is Yehuda Katz" - alert(Person.species); // "Homo sapiens" - ``` - Note that `species` and `createPerson` are *not* valid on the `tom` and `yehuda` - variables. They are only valid on `Person`. - To add functions and properties to instances of - a constructor by extending the constructor's prototype - see `reopen` - @method reopenClass - @public -*/ - -/** - In some cases, you may want to annotate computed properties with additional - metadata about how they function or what values they operate on. For - example, computed property functions may close over variables that are then - no longer available for introspection. - You can pass a hash of these values to a computed property like this: - ```javascript - person: Ember.computed(function() { - var personId = this.get('personId'); - return Person.create({ id: personId }); - }).meta({ type: Person }) - ``` - Once you've done this, you can retrieve the values saved to the computed - property from your class like this: - ```javascript - MyClass.metaForProperty('person'); - ``` - This will return the original hash that was passed to `meta()`. - @static - @method metaForProperty - @param key {String} property name - @private -*/ - -/** - Iterate over each computed property for the class, passing its name - and any associated metadata (see `metaForProperty`) to the callback. - @static - @method eachComputedProperty - @param {Function} callback - @param {Object} binding - @private -*/ enifed('ember-runtime/system/each_proxy', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/mixins/array'], function (exports, _emberUtils, _emberMetal, _emberRuntimeMixinsArray) { 'use strict'; @@ -18434,7 +18446,7 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal } findNamespaces(); - return this[_emberUtils.NAME_KEY]; + return this[_emberMetal.NAME_KEY]; }, nameClasses: function () { @@ -18494,10 +18506,10 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal paths[idx] = key; // If we have found an unprocessed class - if (obj && obj.toString === classToString && !obj[_emberUtils.NAME_KEY]) { + if (obj && obj.toString === classToString && !obj[_emberMetal.NAME_KEY]) { // Replace the class' `toString` with the dot-separated path // and set its `NAME_KEY` - obj[_emberUtils.NAME_KEY] = paths.join('.'); + obj[_emberMetal.NAME_KEY] = paths.join('.'); // Support nested namespaces } else if (obj && obj.isNamespace) { @@ -18543,7 +18555,7 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal } var obj = tryIsNamespace(lookup, key); if (obj) { - obj[_emberUtils.NAME_KEY] = key; + obj[_emberMetal.NAME_KEY] = key; } } } @@ -18551,41 +18563,35 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal function superClassString(mixin) { var superclass = mixin.superclass; if (superclass) { - if (superclass[_emberUtils.NAME_KEY]) { - return superclass[_emberUtils.NAME_KEY]; + if (superclass[_emberMetal.NAME_KEY]) { + return superclass[_emberMetal.NAME_KEY]; } return superClassString(superclass); } } - function calculateToString(target) { - var str = undefined; - - if (!searchDisabled) { + function classToString() { + if (!searchDisabled && !this[_emberMetal.NAME_KEY]) { processAllNamespaces(); - // can also be set by processAllNamespaces - str = target[_emberUtils.NAME_KEY]; + } + + var ret = undefined; + + if (this[_emberMetal.NAME_KEY]) { + ret = this[_emberMetal.NAME_KEY]; + } else if (this._toString) { + ret = this._toString; + } else { + var str = superClassString(this); if (str) { - return str; + ret = '(subclass of ' + str + ')'; } else { - str = superClassString(target); - str = str ? '(subclass of ' + str + ')' : str; + ret = '(unknown mixin)'; } - } - if (str) { - return str; - } else { - return '(unknown mixin)'; - } - } - - function classToString() { - var name = this[_emberUtils.NAME_KEY]; - if (name) { - return name; + this.toString = makeToString(ret); } - return this[_emberUtils.NAME_KEY] = calculateToString(this); + return ret; } function processAllNamespaces() { @@ -18610,6 +18616,12 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal } } + function makeToString(ret) { + return function () { + return ret; + }; + } + _emberMetal.Mixin.prototype.toString = classToString; // ES6TODO: altering imported objects. SBB. exports.default = Namespace; @@ -19396,2540 +19408,2513 @@ enifed('ember-runtime/utils', ['exports', 'ember-runtime/mixins/array', 'ember-r enifed("ember/features", ["exports"], function (exports) { "use strict"; - exports.default = { "features-stripped-test": false, "ember-libraries-isregistered": false, "ember-runtime-computed-uniq-by": true, "ember-improved-instrumentation": false, "ember-runtime-enumerable-includes": true, "ember-string-ishtmlsafe": true, "ember-testing-check-waiters": true, "ember-metal-weakmap": false, "ember-glimmer-allow-backtracking-rerender": false, "ember-testing-resume-test": false, "mandatory-setter": true, "ember-glimmer-detect-backtracking-rerender": true }; + exports.default = { "features-stripped-test": false, "ember-libraries-isregistered": false, "ember-runtime-computed-uniq-by": true, "ember-improved-instrumentation": false, "ember-runtime-enumerable-includes": true, "ember-string-ishtmlsafe": true, "ember-testing-check-waiters": true, "ember-metal-weakmap": false, "ember-glimmer-allow-backtracking-rerender": true, "ember-testing-resume-test": false, "ember-glimmer-detect-backtracking-rerender": true, "mandatory-setter": true }; }); enifed("ember/version", ["exports"], function (exports) { "use strict"; - exports.default = "2.11.0-beta.2"; + exports.default = "2.10.2-with-backtracking"; }); -enifed('rsvp', ['exports'], function (exports) { - 'use strict'; - - var _rsvp; +/*! + * @overview RSVP - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/tildeio/rsvp.js/master/LICENSE + * @version 3.2.1 + */ - function indexOf(callbacks, callback) { - for (var i = 0, l = callbacks.length; i < l; i++) { - if (callbacks[i] === callback) { - return i; - } - } +enifed('rsvp', ['exports'], function (exports) { 'use strict'; - return -1; +function indexOf(callbacks, callback) { + for (var i=0, l=callbacks.length; i 1) { - throw new Error('Second argument not supported'); - } - if (typeof o !== 'object') { - throw new TypeError('Argument must be an object'); - } - F.prototype = o; - return new F(); - }; + object.trigger('stuff'); // callback1 and callback2 will be executed. - var queue = []; + object.off('stuff'); + object.trigger('stuff'); // callback1 and callback2 will not be executed! + ``` - function scheduleFlush() { - setTimeout(function () { - for (var i = 0; i < queue.length; i++) { - var entry = queue[i]; + @method off + @for RSVP.EventTarget + @private + @param {String} eventName event to stop listening to + @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) { + var allCallbacks = callbacksFor(this), callbacks, index; - var payload = entry.payload; + if (!callback) { + allCallbacks[eventName] = []; + return; + } - payload.guid = payload.key + payload.id; - payload.childGuid = payload.key + payload.childId; - if (payload.error) { - payload.stack = payload.error.stack; - } + callbacks = allCallbacks[eventName]; - config['trigger'](entry.name, entry.payload); - } - queue.length = 0; - }, 50); - } + index = indexOf(callbacks, callback); - function instrument(eventName, promise, child) { - if (1 === queue.push({ - name: eventName, - payload: { - key: promise._guidKey, - id: promise._id, - eventName: eventName, - detail: promise._result, - childId: child && child._id, - label: promise._label, - timeStamp: now(), - error: config["instrument-with-stack"] ? new Error(promise._label) : null - } })) { - scheduleFlush(); - } - } + if (index !== -1) { callbacks.splice(index, 1); } + }, /** - `RSVP.Promise.resolve` returns a promise that will become resolved with the - passed `value`. It is shorthand for the following: - + Use `trigger` to fire custom events. For example: + ```javascript - let promise = new RSVP.Promise(function(resolve, reject){ - resolve(1); - }); - - promise.then(function(value){ - // value === 1 + object.on('foo', function(){ + console.log('foo event happened!'); }); + object.trigger('foo'); + // 'foo event happened!' logged to the console ``` - - Instead of writing the above, your code now simply becomes the following: - + + You can also pass a value as a second argument to `trigger` that will be + passed as an argument to all event listeners for the event: + ```javascript - let promise = RSVP.Promise.resolve(1); - - promise.then(function(value){ - // value === 1 + object.on('foo', function(value){ + console.log(value.name); }); + + object.trigger('foo', { name: 'bar' }); + // 'bar' logged to the console ``` - - @method resolve - @static - @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` - */ - function resolve$1(object, label) { - /*jshint validthis:true */ - var Constructor = this; - if (object && typeof object === 'object' && object.constructor === Constructor) { - return object; - } + @method trigger + @for RSVP.EventTarget + @private + @param {String} eventName name of the event to be triggered + @param {*} options optional value to be passed to any event handlers for + the given `eventName` + */ + 'trigger': function(eventName, options, label) { + var allCallbacks = callbacksFor(this), callbacks, callback; - var promise = new Constructor(noop, label); - resolve(promise, object); - return promise; - } + if (callbacks = allCallbacks[eventName]) { + // Don't cache the callbacks.length since it may grow + for (var i=0; i 1) { + throw new Error('Second argument not supported'); } + if (typeof o !== 'object') { + throw new TypeError('Argument must be an object'); + } + F.prototype = o; + return new F(); +}); - function fulfill(promise, value) { - if (promise._state !== PENDING) { - return; - } +var queue = []; - promise._result = value; - promise._state = FULFILLED; +function scheduleFlush() { + setTimeout(function() { + var entry; + for (var i = 0; i < queue.length; i++) { + entry = queue[i]; - if (promise._subscribers.length === 0) { - if (config.instrument) { - instrument('fulfilled', promise); + var payload = entry.payload; + + payload.guid = payload.key + payload.id; + payload.childGuid = payload.key + payload.childId; + if (payload.error) { + payload.stack = payload.error.stack; } - } else { - config.async(publish, promise); + + config['trigger'](entry.name, entry.payload); } - } + queue.length = 0; + }, 50); +} - function reject(promise, reason) { - if (promise._state !== PENDING) { - return; +function instrument(eventName, promise, child) { + if (1 === queue.push({ + name: eventName, + payload: { + key: promise._guidKey, + id: promise._id, + eventName: eventName, + detail: promise._result, + childId: child && child._id, + label: promise._label, + timeStamp: now(), + error: config["instrument-with-stack"] ? new Error(promise._label) : null + }})) { + scheduleFlush(); } - promise._state = REJECTED; - promise._result = reason; - config.async(publishRejection, promise); } - function subscribe(parent, child, onFulfillment, onRejection) { - var subscribers = parent._subscribers; - var length = subscribers.length; +/** + `RSVP.Promise.resolve` returns a promise that will become resolved with the + passed `value`. It is shorthand for the following: - parent._onError = null; + ```javascript + var promise = new RSVP.Promise(function(resolve, reject){ + resolve(1); + }); - subscribers[length] = child; - subscribers[length + FULFILLED] = onFulfillment; - subscribers[length + REJECTED] = onRejection; + promise.then(function(value){ + // value === 1 + }); + ``` - if (length === 0 && parent._state) { - config.async(publish, parent); - } - } + Instead of writing the above, your code now simply becomes the following: - function publish(promise) { - var subscribers = promise._subscribers; - var settled = promise._state; + ```javascript + var promise = RSVP.Promise.resolve(1); - if (config.instrument) { - instrument(settled === FULFILLED ? 'fulfilled' : 'rejected', promise); - } + promise.then(function(value){ + // value === 1 + }); + ``` - if (subscribers.length === 0) { - return; - } + @method resolve + @static + @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` +*/ +function resolve$1(object, label) { + /*jshint validthis:true */ + var Constructor = this; - var child = undefined, - callback = undefined, - detail = promise._result; + if (object && typeof object === 'object' && object.constructor === Constructor) { + return object; + } - for (var i = 0; i < subscribers.length; i += 3) { - child = subscribers[i]; - callback = subscribers[i + settled]; + var promise = new Constructor(noop, label); + resolve(promise, object); + return promise; +} - if (child) { - invokeCallback(settled, child, callback, detail); - } else { - callback(detail); - } - } +function withOwnPromise() { + return new TypeError('A promises callback cannot return that same promise.'); +} - promise._subscribers.length = 0; - } +function noop() {} - function ErrorObject() { - this.error = null; - } +var PENDING = void 0; +var FULFILLED = 1; +var REJECTED = 2; - var TRY_CATCH_ERROR = new ErrorObject(); +var GET_THEN_ERROR = new ErrorObject(); - function tryCatch(callback, detail) { - try { - return callback(detail); - } catch (e) { - TRY_CATCH_ERROR.error = e; - return TRY_CATCH_ERROR; - } +function getThen(promise) { + try { + return promise.then; + } catch(error) { + GET_THEN_ERROR.error = error; + return GET_THEN_ERROR; } +} - function invokeCallback(settled, promise, callback, detail) { - var hasCallback = isFunction(callback), - value = undefined, - error = undefined, - succeeded = undefined, - failed = undefined; - - if (hasCallback) { - value = tryCatch(callback, detail); +function tryThen(then, value, fulfillmentHandler, rejectionHandler) { + try { + then.call(value, fulfillmentHandler, rejectionHandler); + } catch(e) { + return e; + } +} - if (value === TRY_CATCH_ERROR) { - failed = true; - error = value.error; - value = null; +function handleForeignThenable(promise, thenable, then) { + config.async(function(promise) { + var sealed = false; + var error = tryThen(then, thenable, function(value) { + if (sealed) { return; } + sealed = true; + if (thenable !== value) { + resolve(promise, value, undefined); } else { - succeeded = true; + fulfill(promise, value); } + }, function(reason) { + if (sealed) { return; } + sealed = true; - if (promise === value) { - reject(promise, withOwnPromise()); - return; - } - } else { - value = detail; - succeeded = true; + reject(promise, reason); + }, 'Settle: ' + (promise._label || ' unknown promise')); + + if (!sealed && error) { + sealed = true; + reject(promise, error); } + }, promise); +} - if (promise._state !== PENDING) { - // noop - } else if (hasCallback && succeeded) { - resolve(promise, value); - } else if (failed) { - reject(promise, error); - } else if (settled === FULFILLED) { +function handleOwnThenable(promise, thenable) { + if (thenable._state === FULFILLED) { + fulfill(promise, thenable._result); + } else if (thenable._state === REJECTED) { + thenable._onError = null; + reject(promise, thenable._result); + } else { + subscribe(thenable, undefined, function(value) { + if (thenable !== value) { + resolve(promise, value, undefined); + } else { fulfill(promise, value); - } else if (settled === REJECTED) { - reject(promise, value); } + }, function(reason) { + reject(promise, reason); + }); } +} - function initializePromise(promise, resolver) { - var resolved = false; - try { - resolver(function (value) { - if (resolved) { - return; - } - resolved = true; - resolve(promise, value); - }, function (reason) { - if (resolved) { - return; - } - resolved = true; - reject(promise, reason); - }); - } catch (e) { - reject(promise, e); +function handleMaybeThenable(promise, maybeThenable, then$$) { + if (maybeThenable.constructor === promise.constructor && + then$$ === then && + constructor.resolve === resolve$1) { + handleOwnThenable(promise, maybeThenable); + } else { + if (then$$ === GET_THEN_ERROR) { + reject(promise, GET_THEN_ERROR.error); + } else if (then$$ === undefined) { + fulfill(promise, maybeThenable); + } else if (isFunction(then$$)) { + handleForeignThenable(promise, maybeThenable, then$$); + } else { + fulfill(promise, maybeThenable); } } +} - function then(onFulfillment, onRejection, label) { - var _arguments = arguments; +function resolve(promise, value) { + if (promise === value) { + fulfill(promise, value); + } else if (objectOrFunction(value)) { + handleMaybeThenable(promise, value, getThen(value)); + } else { + fulfill(promise, value); + } +} - var parent = this; - var state = parent._state; +function publishRejection(promise) { + if (promise._onError) { + promise._onError(promise._result); + } + + publish(promise); +} + +function fulfill(promise, value) { + if (promise._state !== PENDING) { return; } - if (state === FULFILLED && !onFulfillment || state === REJECTED && !onRejection) { - config.instrument && instrument('chained', parent, parent); - return parent; + promise._result = value; + promise._state = FULFILLED; + + if (promise._subscribers.length === 0) { + if (config.instrument) { + instrument('fulfilled', promise); } + } else { + config.async(publish, promise); + } +} - parent._onError = null; +function reject(promise, reason) { + if (promise._state !== PENDING) { return; } + promise._state = REJECTED; + promise._result = reason; + config.async(publishRejection, promise); +} - var child = new parent.constructor(noop, label); - var result = parent._result; +function subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers; + var length = subscribers.length; - config.instrument && instrument('chained', parent, child); + parent._onError = null; - if (state) { - (function () { - var callback = _arguments[state - 1]; - config.async(function () { - return invokeCallback(state, child, callback, result); - }); - })(); - } else { - subscribe(parent, child, onFulfillment, onRejection); - } + subscribers[length] = child; + subscribers[length + FULFILLED] = onFulfillment; + subscribers[length + REJECTED] = onRejection; - return child; + if (length === 0 && parent._state) { + config.async(publish, parent); } +} - function makeSettledResult(state, position, value) { - if (state === FULFILLED) { - return { - state: 'fulfilled', - value: value - }; - } else { - return { - state: 'rejected', - reason: value - }; - } +function publish(promise) { + var subscribers = promise._subscribers; + var settled = promise._state; + + if (config.instrument) { + instrument(settled === FULFILLED ? 'fulfilled' : 'rejected', promise); } - function Enumerator(Constructor, input, abortOnReject, label) { - this._instanceConstructor = Constructor; - this.promise = new Constructor(noop, label); - this._abortOnReject = abortOnReject; + if (subscribers.length === 0) { return; } - if (this._validateInput(input)) { - this._input = input; - this.length = input.length; - this._remaining = input.length; + var child, callback, detail = promise._result; - this._init(); + for (var i = 0; i < subscribers.length; i += 3) { + child = subscribers[i]; + callback = subscribers[i + settled]; - if (this.length === 0) { - fulfill(this.promise, this._result); - } else { - this.length = this.length || 0; - this._enumerate(); - if (this._remaining === 0) { - fulfill(this.promise, this._result); - } - } + if (child) { + invokeCallback(settled, child, callback, detail); } else { - reject(this.promise, this._validationError()); + callback(detail); } } - Enumerator.prototype._validateInput = function (input) { - return isArray(input); - }; + promise._subscribers.length = 0; +} - Enumerator.prototype._validationError = function () { - return new Error('Array Methods must be provided an Array'); - }; +function ErrorObject() { + this.error = null; +} - Enumerator.prototype._init = function () { - this._result = new Array(this.length); - }; +var TRY_CATCH_ERROR = new ErrorObject(); + +function tryCatch(callback, detail) { + try { + return callback(detail); + } catch(e) { + TRY_CATCH_ERROR.error = e; + return TRY_CATCH_ERROR; + } +} - Enumerator.prototype._enumerate = function () { - var length = this.length; - var promise = this.promise; - var input = this._input; +function invokeCallback(settled, promise, callback, detail) { + var hasCallback = isFunction(callback), + value, error, succeeded, failed; - for (var i = 0; promise._state === PENDING && i < length; i++) { - this._eachEntry(input[i], i); - } - }; + if (hasCallback) { + value = tryCatch(callback, detail); - Enumerator.prototype._settleMaybeThenable = function (entry, i) { - var c = this._instanceConstructor; - var resolve = c.resolve; - - if (resolve === resolve$1) { - var then$$ = getThen(entry); - - if (then$$ === then && entry._state !== PENDING) { - entry._onError = null; - this._settledAt(entry._state, i, entry._result); - } else if (typeof then$$ !== 'function') { - this._remaining--; - this._result[i] = this._makeResult(FULFILLED, i, entry); - } else if (c === Promise) { - var promise = new c(noop); - handleMaybeThenable(promise, entry, then$$); - this._willSettleAt(promise, i); - } else { - this._willSettleAt(new c(function (resolve) { - return resolve(entry); - }), i); - } + if (value === TRY_CATCH_ERROR) { + failed = true; + error = value.error; + value = null; } else { - this._willSettleAt(resolve(entry), i); + succeeded = true; } - }; - Enumerator.prototype._eachEntry = function (entry, i) { - if (isMaybeThenable(entry)) { - this._settleMaybeThenable(entry, i); - } else { - this._remaining--; - this._result[i] = this._makeResult(FULFILLED, i, entry); + if (promise === value) { + reject(promise, withOwnPromise()); + return; } - }; - Enumerator.prototype._settledAt = function (state, i, value) { - var promise = this.promise; + } else { + value = detail; + succeeded = true; + } - if (promise._state === PENDING) { - this._remaining--; + 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); + } +} - if (this._abortOnReject && state === REJECTED) { - reject(promise, value); - } else { - this._result[i] = this._makeResult(state, i, 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); + } +} - if (this._remaining === 0) { - fulfill(promise, this._result); - } - }; +function then(onFulfillment, onRejection, label) { + var parent = this; + var state = parent._state; - Enumerator.prototype._makeResult = function (state, i, value) { - return value; - }; + if (state === FULFILLED && !onFulfillment || state === REJECTED && !onRejection) { + config.instrument && instrument('chained', parent, parent); + return parent; + } - Enumerator.prototype._willSettleAt = function (promise, i) { - var enumerator = this; + parent._onError = null; - subscribe(promise, undefined, function (value) { - return enumerator._settledAt(FULFILLED, i, value); - }, function (reason) { - return enumerator._settledAt(REJECTED, i, reason); - }); - }; + var child = new parent.constructor(noop, label); + var result = parent._result; - /** - `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 - rejected with the reason of the first passed promise to be rejected. It casts all - elements of the passed iterable to promises as it runs this algorithm. - - Example: - - ```javascript - let promise1 = RSVP.resolve(1); - let promise2 = RSVP.resolve(2); - let promise3 = RSVP.resolve(3); - let promises = [ promise1, promise2, promise3 ]; - - RSVP.Promise.all(promises).then(function(array){ - // The array here would be [ 1, 2, 3 ]; - }); - ``` - - If any of the `promises` given to `RSVP.all` are rejected, the first promise - that is rejected will be given as an argument to the returned promises's - rejection handler. For example: - - Example: - - ```javascript - let promise1 = RSVP.resolve(1); - let promise2 = RSVP.reject(new Error("2")); - let promise3 = RSVP.reject(new Error("3")); - let promises = [ promise1, promise2, promise3 ]; - - RSVP.Promise.all(promises).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(error) { - // error.message === "2" + config.instrument && instrument('chained', parent, child); + + if (state) { + var callback = arguments[state - 1]; + config.async(function(){ + invokeCallback(state, child, callback, result); }); - ``` - - @method all - @static - @param {Array} entries array of promises - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} promise that is fulfilled when all `promises` have been - fulfilled, or rejected if any of them become rejected. - @static - */ - function all(entries, label) { - return new Enumerator(this, entries, true, /* abort on reject */label).promise; + } else { + subscribe(parent, child, onFulfillment, onRejection); } - /** - `RSVP.Promise.race` returns a new promise which is settled in the same way as the - first passed promise to settle. - - Example: - - ```javascript - let promise1 = new RSVP.Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 1'); - }, 200); - }); - - let promise2 = new RSVP.Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 2'); - }, 100); - }); - - RSVP.Promise.race([promise1, promise2]).then(function(result){ - // result === 'promise 2' because it was resolved before promise1 - // was resolved. - }); - ``` - - `RSVP.Promise.race` is deterministic in that only the state of the first - settled promise matters. For example, even if other promises given to the - `promises` array argument are resolved, but the first settled promise has - become rejected before the other promises became fulfilled, the returned - promise will become rejected: - - ```javascript - let promise1 = new RSVP.Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 1'); - }, 200); - }); - - let promise2 = new RSVP.Promise(function(resolve, reject){ - setTimeout(function(){ - reject(new Error('promise 2')); - }, 100); - }); - - RSVP.Promise.race([promise1, promise2]).then(function(result){ - // Code here never runs - }, function(reason){ - // reason.message === 'promise 2' because promise 2 became rejected before - // promise 1 became fulfilled - }); - ``` - - An example real-world use case is implementing timeouts: - - ```javascript - RSVP.Promise.race([ajax('foo.json'), timeout(5000)]) - ``` - - @method race - @static - @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. - */ - function race(entries, label) { - /*jshint validthis:true */ - var Constructor = this; + return child; +} - var promise = new Constructor(noop, label); +function makeSettledResult(state, position, value) { + if (state === FULFILLED) { + return { + state: 'fulfilled', + value: value + }; + } else { + return { + state: 'rejected', + reason: value + }; + } +} - if (!isArray(entries)) { - reject(promise, new TypeError('You must pass an array to race.')); - return promise; - } +function Enumerator(Constructor, input, abortOnReject, label) { + this._instanceConstructor = Constructor; + this.promise = new Constructor(noop, label); + this._abortOnReject = abortOnReject; - for (var i = 0; promise._state === PENDING && i < entries.length; i++) { - subscribe(Constructor.resolve(entries[i]), undefined, function (value) { - return resolve(promise, value); - }, function (reason) { - return reject(promise, reason); - }); - } + if (this._validateInput(input)) { + this._input = input; + this.length = input.length; + this._remaining = input.length; - return promise; + this._init(); + + if (this.length === 0) { + fulfill(this.promise, this._result); + } else { + this.length = this.length || 0; + this._enumerate(); + if (this._remaining === 0) { + fulfill(this.promise, this._result); + } + } + } else { + reject(this.promise, this._validationError()); } +} - /** - `RSVP.Promise.reject` returns a promise rejected with the passed `reason`. - It is shorthand for the following: - - ```javascript - let promise = new RSVP.Promise(function(resolve, reject){ - reject(new Error('WHOOPS')); - }); - - promise.then(function(value){ - // Code here doesn't run because the promise is rejected! - }, function(reason){ - // reason.message === 'WHOOPS' - }); - ``` - - Instead of writing the above, your code now simply becomes the following: - - ```javascript - let promise = RSVP.Promise.reject(new Error('WHOOPS')); - - promise.then(function(value){ - // Code here doesn't run because the promise is rejected! - }, function(reason){ - // reason.message === 'WHOOPS' - }); - ``` - - @method reject - @static - @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$1(reason, label) { - /*jshint validthis:true */ - var Constructor = this; - var promise = new Constructor(noop, label); - reject(promise, reason); - return promise; +Enumerator.prototype._validateInput = function(input) { + return isArray(input); +}; + +Enumerator.prototype._validationError = function() { + return new Error('Array Methods must be provided an Array'); +}; + +Enumerator.prototype._init = function() { + this._result = new Array(this.length); +}; + +Enumerator.prototype._enumerate = function() { + var length = this.length; + var promise = this.promise; + var input = this._input; + + for (var i = 0; promise._state === PENDING && i < length; i++) { + this._eachEntry(input[i], i); } +}; + +Enumerator.prototype._settleMaybeThenable = function(entry, i) { + var c = this._instanceConstructor; + var resolve = c.resolve; - var guidKey = 'rsvp_' + now() + '-'; - var counter = 0; + if (resolve === resolve$1) { + var then$$ = getThen(entry); - function needsResolver() { - throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); + if (then$$ === then && + entry._state !== PENDING) { + entry._onError = null; + this._settledAt(entry._state, i, entry._result); + } else if (typeof then$$ !== 'function') { + this._remaining--; + this._result[i] = this._makeResult(FULFILLED, i, entry); + } else if (c === Promise) { + var promise = new c(noop); + handleMaybeThenable(promise, entry, then$$); + this._willSettleAt(promise, i); + } else { + this._willSettleAt(new c(function(resolve) { resolve(entry); }), i); + } + } else { + this._willSettleAt(resolve(entry), i); } +}; - function needsNew() { - throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); +Enumerator.prototype._eachEntry = function(entry, i) { + if (isMaybeThenable(entry)) { + this._settleMaybeThenable(entry, i); + } else { + this._remaining--; + this._result[i] = this._makeResult(FULFILLED, i, entry); } +}; - /** - 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 - why the promise cannot be fulfilled. - - Terminology - ----------- - - - `promise` is an object or function with a `then` method whose behavior conforms to this specification. - - `thenable` is an object or function that defines a `then` method. - - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). - - `exception` is a value that is thrown using the throw statement. - - `reason` is a value that indicates why a promise was rejected. - - `settled` the final resting state of a promise, fulfilled or rejected. - - A promise can be in one of three states: pending, fulfilled, or rejected. - - Promises that are fulfilled have a fulfillment value and are in the fulfilled - state. Promises that are rejected have a rejection reason and are in the - rejected state. A fulfillment value is never a thenable. - - Promises can also be said to *resolve* a value. If this value is also a - promise, then the original promise's settled state will match the value's - settled state. So a promise that *resolves* a promise that rejects will - itself reject, and a promise that *resolves* a promise that fulfills will - itself fulfill. - - - Basic Usage: - ------------ - - ```js - let promise = new Promise(function(resolve, reject) { - // on success - resolve(value); - - // on failure - reject(reason); - }); - - promise.then(function(value) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` - - Advanced Usage: - --------------- - - Promises shine when abstracting away asynchronous interactions such as - `XMLHttpRequest`s. - - ```js - function getJSON(url) { - return new Promise(function(resolve, reject){ - let xhr = new XMLHttpRequest(); - - xhr.open('GET', url); - xhr.onreadystatechange = handler; - xhr.responseType = 'json'; - xhr.setRequestHeader('Accept', 'application/json'); - xhr.send(); - - function handler() { - if (this.readyState === this.DONE) { - if (this.status === 200) { - resolve(this.response); - } else { - reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); - } - } - }; - }); - } - - getJSON('/posts.json').then(function(json) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` - - Unlike callbacks, promises are great composable primitives. - - ```js - Promise.all([ - getJSON('/posts'), - getJSON('/comments') - ]).then(function(values){ - values[0] // => postsJSON - values[1] // => commentsJSON - - return values; - }); - ``` - - @class RSVP.Promise - @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 = []; +Enumerator.prototype._settledAt = function(state, i, value) { + var promise = this.promise; - config.instrument && instrument('created', this); + if (promise._state === PENDING) { + this._remaining--; - if (noop !== resolver) { - typeof resolver !== 'function' && needsResolver(); - this instanceof Promise ? initializePromise(this, resolver) : needsNew(); + if (this._abortOnReject && state === REJECTED) { + reject(promise, value); + } else { + this._result[i] = this._makeResult(state, i, value); } } - Promise.cast = resolve$1; // deprecated - Promise.all = all; - Promise.race = race; - Promise.resolve = resolve$1; - Promise.reject = reject$1; + if (this._remaining === 0) { + fulfill(promise, this._result); + } +}; - Promise.prototype = { - constructor: Promise, +Enumerator.prototype._makeResult = function(state, i, value) { + return value; +}; - _guidKey: guidKey, +Enumerator.prototype._willSettleAt = function(promise, i) { + var enumerator = this; - _onError: function (reason) { - var promise = this; - config.after(function () { - if (promise._onError) { - config['trigger']('error', reason, promise._label); - } - }); - }, + subscribe(promise, undefined, function(value) { + enumerator._settledAt(FULFILLED, i, value); + }, function(reason) { + enumerator._settledAt(REJECTED, i, 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 - reason why the promise cannot be fulfilled. - - ```js - findUser().then(function(user){ - // user is available - }, function(reason){ - // user is unavailable, and you are given the reason why - }); - ``` - - Chaining - -------- - - The return value of `then` is itself a promise. This second, 'downstream' - promise is resolved with the return value of the first promise's fulfillment - or rejection handler, or rejected if the handler throws an exception. - - ```js - findUser().then(function (user) { - return user.name; - }, function (reason) { - return 'default name'; - }).then(function (userName) { - // If `findUser` fulfilled, `userName` will be the user's name, otherwise it - // will be `'default name'` - }); - - findUser().then(function (user) { - throw new Error('Found user, but still unhappy'); - }, function (reason) { - throw new Error('`findUser` rejected and we\'re unhappy'); - }).then(function (value) { - // never reached - }, function (reason) { - // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. - // If `findUser` rejected, `reason` will be '`findUser` rejected and we\'re unhappy'. - }); - ``` - If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. - - ```js - findUser().then(function (user) { - throw new PedagogicalException('Upstream error'); - }).then(function (value) { - // never reached - }).then(function (value) { - // never reached - }, function (reason) { - // The `PedgagocialException` is propagated all the way down to here - }); - ``` - - Assimilation - ------------ - - Sometimes the value you want to propagate to a downstream promise can only be - retrieved asynchronously. This can be achieved by returning a promise in the - fulfillment or rejection handler. The downstream promise will then be pending - until the returned promise is settled. This is called *assimilation*. - - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // The user's comments are now available - }); - ``` - - If the assimliated promise rejects, then the downstream promise will also reject. - - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // If `findCommentsByAuthor` fulfills, we'll have the value here - }, function (reason) { - // If `findCommentsByAuthor` rejects, we'll have the reason here - }); - ``` - - Simple Example - -------------- - - Synchronous Example - - ```javascript - let result; - - try { - result = findResult(); - // success - } catch(reason) { - // failure - } - ``` - - Errback Example - - ```js - findResult(function(result, err){ - if (err) { - // failure - } else { - // success - } - }); - ``` - - Promise Example; - - ```javascript - findResult().then(function(result){ - // success - }, function(reason){ - // failure - }); - ``` - - Advanced Example - -------------- - - Synchronous Example - - ```javascript - let author, books; - - try { - author = findAuthor(); - books = findBooksByAuthor(author); - // success - } catch(reason) { - // failure - } - ``` - - Errback Example - - ```js - - function foundBooks(books) { - - } - - function failure(reason) { - - } - - findAuthor(function(author, err){ - if (err) { - failure(err); - // failure - } else { - try { - findBoooksByAuthor(author, function(books, err) { - if (err) { - failure(err); - } else { - try { - foundBooks(books); - } catch(reason) { - failure(reason); - } - } - }); - } catch(error) { - failure(err); +/** + `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 + rejected with the reason of the first passed promise to be rejected. It casts all + elements of the passed iterable to promises as it runs this algorithm. + + Example: + + ```javascript + var promise1 = RSVP.resolve(1); + var promise2 = RSVP.resolve(2); + var promise3 = RSVP.resolve(3); + var promises = [ promise1, promise2, promise3 ]; + + RSVP.Promise.all(promises).then(function(array){ + // The array here would be [ 1, 2, 3 ]; + }); + ``` + + If any of the `promises` given to `RSVP.all` are rejected, the first promise + that is rejected will be given as an argument to the returned promises's + rejection handler. For example: + + Example: + + ```javascript + var promise1 = RSVP.resolve(1); + var promise2 = RSVP.reject(new Error("2")); + var promise3 = RSVP.reject(new Error("3")); + var promises = [ promise1, promise2, promise3 ]; + + RSVP.Promise.all(promises).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(error) { + // error.message === "2" + }); + ``` + + @method all + @static + @param {Array} entries array of promises + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} promise that is fulfilled when all `promises` have been + fulfilled, or rejected if any of them become rejected. + @static +*/ +function all(entries, label) { + return new Enumerator(this, entries, true /* abort on reject */, label).promise; +} + +/** + `RSVP.Promise.race` returns a new promise which is settled in the same way as the + first passed promise to settle. + + Example: + + ```javascript + var promise1 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 1'); + }, 200); + }); + + var promise2 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 2'); + }, 100); + }); + + RSVP.Promise.race([promise1, promise2]).then(function(result){ + // result === 'promise 2' because it was resolved before promise1 + // was resolved. + }); + ``` + + `RSVP.Promise.race` is deterministic in that only the state of the first + settled promise matters. For example, even if other promises given to the + `promises` array argument are resolved, but the first settled promise has + become rejected before the other promises became fulfilled, the returned + promise will become rejected: + + ```javascript + var promise1 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 1'); + }, 200); + }); + + var promise2 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + reject(new Error('promise 2')); + }, 100); + }); + + RSVP.Promise.race([promise1, promise2]).then(function(result){ + // Code here never runs + }, function(reason){ + // reason.message === 'promise 2' because promise 2 became rejected before + // promise 1 became fulfilled + }); + ``` + + An example real-world use case is implementing timeouts: + + ```javascript + RSVP.Promise.race([ajax('foo.json'), timeout(5000)]) + ``` + + @method race + @static + @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. +*/ +function race(entries, label) { + /*jshint validthis:true */ + var Constructor = this; + + var promise = new Constructor(noop, label); + + if (!isArray(entries)) { + reject(promise, new TypeError('You must pass an array to race.')); + return promise; + } + + var length = entries.length; + + function onFulfillment(value) { + resolve(promise, value); + } + + function onRejection(reason) { + reject(promise, reason); + } + + for (var i = 0; promise._state === PENDING && i < length; i++) { + subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection); + } + + return promise; +} + +/** + `RSVP.Promise.reject` returns a promise rejected with the passed `reason`. + It is shorthand for the following: + + ```javascript + var promise = new RSVP.Promise(function(resolve, reject){ + reject(new Error('WHOOPS')); + }); + + promise.then(function(value){ + // Code here doesn't run because the promise is rejected! + }, function(reason){ + // reason.message === 'WHOOPS' + }); + ``` + + Instead of writing the above, your code now simply becomes the following: + + ```javascript + var promise = RSVP.Promise.reject(new Error('WHOOPS')); + + promise.then(function(value){ + // Code here doesn't run because the promise is rejected! + }, function(reason){ + // reason.message === 'WHOOPS' + }); + ``` + + @method reject + @static + @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$1(reason, label) { + /*jshint validthis:true */ + var Constructor = this; + var promise = new Constructor(noop, label); + reject(promise, reason); + return promise; +} + +var guidKey = 'rsvp_' + 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."); +} + +/** + 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 + why the promise cannot be fulfilled. + + Terminology + ----------- + + - `promise` is an object or function with a `then` method whose behavior conforms to this specification. + - `thenable` is an object or function that defines a `then` method. + - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). + - `exception` is a value that is thrown using the throw statement. + - `reason` is a value that indicates why a promise was rejected. + - `settled` the final resting state of a promise, fulfilled or rejected. + + A promise can be in one of three states: pending, fulfilled, or rejected. + + Promises that are fulfilled have a fulfillment value and are in the fulfilled + state. Promises that are rejected have a rejection reason and are in the + rejected state. A fulfillment value is never a thenable. + + Promises can also be said to *resolve* a value. If this value is also a + promise, then the original promise's settled state will match the value's + settled state. So a promise that *resolves* a promise that rejects will + itself reject, and a promise that *resolves* a promise that fulfills will + itself fulfill. + + + Basic Usage: + ------------ + + ```js + var promise = new Promise(function(resolve, reject) { + // on success + resolve(value); + + // on failure + reject(reason); + }); + + promise.then(function(value) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Advanced Usage: + --------------- + + Promises shine when abstracting away asynchronous interactions such as + `XMLHttpRequest`s. + + ```js + function getJSON(url) { + return new Promise(function(resolve, reject){ + var xhr = new XMLHttpRequest(); + + xhr.open('GET', url); + xhr.onreadystatechange = handler; + xhr.responseType = 'json'; + xhr.setRequestHeader('Accept', 'application/json'); + xhr.send(); + + function handler() { + if (this.readyState === this.DONE) { + if (this.status === 200) { + resolve(this.response); + } else { + reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); } - // success } - }); - ``` - - Promise Example; - - ```javascript - findAuthor(). - then(findBooksByAuthor). - then(function(books){ - // found books - }).catch(function(reason){ - // something went wrong - }); - ``` - - @method then - @param {Function} onFulfillment - @param {Function} onRejection - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - */ - then: then, + }; + }); + } - /** - `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same - as the catch block of a try/catch statement. - - ```js - function findAuthor(){ - throw new Error('couldn\'t find that author'); + getJSON('/posts.json').then(function(json) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Unlike callbacks, promises are great composable primitives. + + ```js + Promise.all([ + getJSON('/posts'), + getJSON('/comments') + ]).then(function(values){ + values[0] // => postsJSON + values[1] // => commentsJSON + + return values; + }); + ``` + + @class RSVP.Promise + @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 = []; + + config.instrument && instrument('created', this); + + if (noop !== resolver) { + typeof resolver !== 'function' && needsResolver(); + this instanceof Promise ? initializePromise(this, resolver) : needsNew(); + } +} + +Promise.cast = resolve$1; // deprecated +Promise.all = all; +Promise.race = race; +Promise.resolve = resolve$1; +Promise.reject = reject$1; + +Promise.prototype = { + constructor: Promise, + + _guidKey: guidKey, + + _onError: function (reason) { + var promise = this; + config.after(function() { + if (promise._onError) { + config['trigger']('error', reason, promise._label); } - - // synchronous + }); + }, + +/** + 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 why the promise cannot be fulfilled. + + ```js + findUser().then(function(user){ + // user is available + }, function(reason){ + // user is unavailable, and you are given the reason why + }); + ``` + + Chaining + -------- + + The return value of `then` is itself a promise. This second, 'downstream' + promise is resolved with the return value of the first promise's fulfillment + or rejection handler, or rejected if the handler throws an exception. + + ```js + findUser().then(function (user) { + return user.name; + }, function (reason) { + return 'default name'; + }).then(function (userName) { + // If `findUser` fulfilled, `userName` will be the user's name, otherwise it + // will be `'default name'` + }); + + findUser().then(function (user) { + throw new Error('Found user, but still unhappy'); + }, function (reason) { + throw new Error('`findUser` rejected and we're unhappy'); + }).then(function (value) { + // never reached + }, function (reason) { + // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. + // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. + }); + ``` + If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. + + ```js + findUser().then(function (user) { + throw new PedagogicalException('Upstream error'); + }).then(function (value) { + // never reached + }).then(function (value) { + // never reached + }, function (reason) { + // The `PedgagocialException` is propagated all the way down to here + }); + ``` + + Assimilation + ------------ + + Sometimes the value you want to propagate to a downstream promise can only be + retrieved asynchronously. This can be achieved by returning a promise in the + fulfillment or rejection handler. The downstream promise will then be pending + until the returned promise is settled. This is called *assimilation*. + + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // The user's comments are now available + }); + ``` + + If the assimliated promise rejects, then the downstream promise will also reject. + + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // If `findCommentsByAuthor` fulfills, we'll have the value here + }, function (reason) { + // If `findCommentsByAuthor` rejects, we'll have the reason here + }); + ``` + + Simple Example + -------------- + + Synchronous Example + + ```javascript + var result; + + try { + result = findResult(); + // success + } catch(reason) { + // failure + } + ``` + + Errback Example + + ```js + findResult(function(result, err){ + if (err) { + // failure + } else { + // success + } + }); + ``` + + Promise Example; + + ```javascript + findResult().then(function(result){ + // success + }, function(reason){ + // failure + }); + ``` + + Advanced Example + -------------- + + Synchronous Example + + ```javascript + var author, books; + + try { + author = findAuthor(); + books = findBooksByAuthor(author); + // success + } catch(reason) { + // failure + } + ``` + + Errback Example + + ```js + + function foundBooks(books) { + + } + + function failure(reason) { + + } + + findAuthor(function(author, err){ + if (err) { + failure(err); + // failure + } else { try { - findAuthor(); - } catch(reason) { - // something went wrong + findBoooksByAuthor(author, function(books, err) { + if (err) { + failure(err); + } else { + try { + foundBooks(books); + } catch(reason) { + failure(reason); + } + } + }); + } catch(error) { + failure(err); } - - // async with promises - findAuthor().catch(function(reason){ - // something went wrong + // success + } + }); + ``` + + Promise Example; + + ```javascript + findAuthor(). + then(findBooksByAuthor). + then(function(books){ + // found books + }).catch(function(reason){ + // something went wrong + }); + ``` + + @method then + @param {Function} onFulfillment + @param {Function} onRejection + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} +*/ + then: then, + +/** + `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same + as the catch block of a try/catch statement. + + ```js + function findAuthor(){ + throw new Error('couldn't find that author'); + } + + // synchronous + try { + findAuthor(); + } catch(reason) { + // something went wrong + } + + // async with promises + findAuthor().catch(function(reason){ + // something went wrong + }); + ``` + + @method catch + @param {Function} onRejection + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} +*/ + 'catch': function(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 + + Synchronous example: + + ```js + findAuthor() { + if (Math.random() > 0.5) { + throw new Error(); + } + return new Author(); + } + + try { + return findAuthor(); // succeed or fail + } catch(error) { + return findOtherAuther(); + } finally { + // always runs + // doesn't affect the return value + } + ``` + + Asynchronous example: + + ```js + findAuthor().catch(function(reason){ + return findOtherAuther(); + }).finally(function(){ + // author was either found, or not + }); + ``` + + @method finally + @param {Function} callback + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} +*/ + 'finally': function(callback, label) { + var promise = this; + var constructor = promise.constructor; + + return promise.then(function(value) { + return constructor.resolve(callback()).then(function() { + return value; }); - ``` - - @method catch - @param {Function} onRejection - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - */ - catch: function (onRejection, label) { - return this.then(undefined, onRejection, label); - }, + }, function(reason) { + return constructor.resolve(callback()).then(function() { + return constructor.reject(reason); + }); + }, label); + } +}; - /** - `finally` will be invoked regardless of the promise's fate just as native - try/catch/finally behaves - - Synchronous example: - - ```js - findAuthor() { - if (Math.random() > 0.5) { - throw new Error(); +function Result() { + this.value = undefined; +} + +var ERROR = new Result(); +var GET_THEN_ERROR$1 = new Result(); + +function getThen$1(obj) { + try { + return obj.then; + } catch(error) { + ERROR.value= error; + return ERROR; + } +} + + +function tryApply(f, s, a) { + try { + f.apply(s, a); + } catch(error) { + ERROR.value = error; + return ERROR; + } +} + +function makeObject(_, argumentNames) { + var obj = {}; + var name; + var i; + var length = _.length; + var args = new Array(length); + + for (var x = 0; x < length; x++) { + args[x] = _[x]; + } + + for (i = 0; i < argumentNames.length; i++) { + name = argumentNames[i]; + obj[name] = args[i + 1]; + } + + return obj; +} + +function arrayResult(_) { + var length = _.length; + var args = new Array(length - 1); + + for (var i = 1; i < length; i++) { + args[i - 1] = _[i]; + } + + return args; +} + +function wrapThenable(then, promise) { + return { + then: function(onFulFillment, onRejection) { + return then.call(promise, onFulFillment, onRejection); + } + }; +} + +/** + `RSVP.denodeify` takes a 'node-style' function and returns a function that + will return an `RSVP.Promise`. You can use `denodeify` in Node.js or the + browser when you'd prefer to use promises over using callbacks. For example, + `denodeify` transforms the following: + + ```javascript + var fs = require('fs'); + + fs.readFile('myfile.txt', function(err, data){ + if (err) return handleError(err); + handleData(data); + }); + ``` + + into: + + ```javascript + var fs = require('fs'); + var readFile = RSVP.denodeify(fs.readFile); + + readFile('myfile.txt').then(handleData, handleError); + ``` + + If the node function has multiple success parameters, then `denodeify` + just returns the first one: + + ```javascript + var request = RSVP.denodeify(require('request')); + + request('http://example.com').then(function(res) { + // ... + }); + ``` + + However, if you need all success parameters, setting `denodeify`'s + second parameter to `true` causes it to return all success parameters + as an array: + + ```javascript + var request = RSVP.denodeify(require('request'), true); + + request('http://example.com').then(function(result) { + // result[0] -> res + // result[1] -> body + }); + ``` + + Or if you pass it an array with names it returns the parameters as a hash: + + ```javascript + var request = RSVP.denodeify(require('request'), ['res', 'body']); + + request('http://example.com').then(function(result) { + // result.res + // result.body + }); + ``` + + Sometimes you need to retain the `this`: + + ```javascript + var app = require('express')(); + var render = RSVP.denodeify(app.render.bind(app)); + ``` + + The denodified function inherits from the original function. It works in all + environments, except IE 10 and below. Consequently all properties of the original + function are available to you. However, any properties you change on the + denodeified function won't be changed on the original function. Example: + + ```javascript + var request = RSVP.denodeify(require('request')), + cookieJar = request.jar(); // <- Inheritance is used here + + request('http://example.com', {jar: cookieJar}).then(function(res) { + // cookieJar.cookies holds now the cookies returned by example.com + }); + ``` + + Using `denodeify` makes it easier to compose asynchronous operations instead + of using callbacks. For example, instead of: + + ```javascript + var fs = require('fs'); + + fs.readFile('myfile.txt', function(err, data){ + if (err) { ... } // Handle error + fs.writeFile('myfile2.txt', data, function(err){ + if (err) { ... } // Handle error + console.log('done') + }); + }); + ``` + + you can chain the operations together using `then` from the returned promise: + + ```javascript + var fs = require('fs'); + var readFile = RSVP.denodeify(fs.readFile); + var writeFile = RSVP.denodeify(fs.writeFile); + + readFile('myfile.txt').then(function(data){ + return writeFile('myfile2.txt', data); + }).then(function(){ + console.log('done') + }).catch(function(error){ + // Handle error + }); + ``` + + @method denodeify + @static + @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} [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. + @return {Function} a function that wraps `nodeFunc` to return an + `RSVP.Promise` + @static +*/ +function denodeify(nodeFunc, options) { + var fn = function() { + var self = this; + var l = arguments.length; + var args = new Array(l + 1); + var arg; + var promiseInput = false; + + for (var i = 0; i < l; ++i) { + arg = arguments[i]; + + if (!promiseInput) { + // TODO: clean this up + promiseInput = needsPromiseInput(arg); + if (promiseInput === GET_THEN_ERROR$1) { + var p = new Promise(noop); + reject(p, GET_THEN_ERROR$1.value); + return p; + } else if (promiseInput && promiseInput !== true) { + arg = wrapThenable(promiseInput, arg); } - return new Author(); - } - - try { - return findAuthor(); // succeed or fail - } catch(error) { - return findOtherAuther(); - } finally { - // always runs - // doesn't affect the return value } - ``` - - Asynchronous example: - - ```js - findAuthor().catch(function(reason){ - return findOtherAuther(); - }).finally(function(){ - // author was either found, or not - }); - ``` - - @method finally - @param {Function} callback - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - */ - finally: function (callback, label) { - var promise = this; - var constructor = promise.constructor; + args[i] = arg; + } - return promise.then(function (value) { - return constructor.resolve(callback()).then(function () { - return value; - }); - }, function (reason) { - return constructor.resolve(callback()).then(function () { - throw reason; - }); - }, label); + var promise = new Promise(noop); + + args[l] = function(err, val) { + if (err) + reject(promise, err); + else if (options === undefined) + resolve(promise, val); + else if (options === true) + resolve(promise, arrayResult(arguments)); + else if (isArray(options)) + resolve(promise, makeObject(arguments, options)); + else + resolve(promise, val); + }; + + if (promiseInput) { + return handlePromiseInput(promise, args, nodeFunc, self); + } else { + return handleValueInput(promise, args, nodeFunc, self); + } + }; + + fn.__proto__ = nodeFunc; + + return fn; +} + +function handleValueInput(promise, args, nodeFunc, self) { + var result = tryApply(nodeFunc, self, args); + if (result === ERROR) { + reject(promise, result.value); + } + return promise; +} + +function handlePromiseInput(promise, args, nodeFunc, self){ + return Promise.all(args).then(function(args){ + var result = tryApply(nodeFunc, self, args); + if (result === ERROR) { + reject(promise, result.value); + } + return promise; + }); +} + +function needsPromiseInput(arg) { + if (arg && typeof arg === 'object') { + if (arg.constructor === Promise) { + return true; + } else { + return getThen$1(arg); + } + } else { + return false; + } +} + +/** + This is a convenient alias for `RSVP.Promise.all`. + + @method all + @static + @for RSVP + @param {Array} array Array of promises. + @param {String} label An optional label. This is useful + for tooling. +*/ +function all$1(array, label) { + return Promise.all(array, label); +} + +function AllSettled(Constructor, entries, label) { + this._superConstructor(Constructor, entries, false /* don't abort on reject */, label); +} + +AllSettled.prototype = o_create(Enumerator.prototype); +AllSettled.prototype._superConstructor = Enumerator; +AllSettled.prototype._makeResult = makeSettledResult; +AllSettled.prototype._validationError = function() { + return new Error('allSettled must be called with an array'); +}; + +/** + `RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing + a fail-fast method, it waits until all the promises have returned and + shows you all the results. This is useful if you want to handle multiple + promises' failure states together as a set. + + Returns a promise that is fulfilled when all the given promises have been + settled. The return promise is fulfilled with an array of the states of + the promises passed into the `promises` array argument. + + Each state object will either indicate fulfillment or rejection, and + provide the corresponding value or reason. The states will take one of + the following formats: + + ```javascript + { state: 'fulfilled', value: value } + or + { state: 'rejected', reason: reason } + ``` + + Example: + + ```javascript + var promise1 = RSVP.Promise.resolve(1); + var promise2 = RSVP.Promise.reject(new Error('2')); + var promise3 = RSVP.Promise.reject(new Error('3')); + var promises = [ promise1, promise2, promise3 ]; + + RSVP.allSettled(promises).then(function(array){ + // array == [ + // { state: 'fulfilled', value: 1 }, + // { state: 'rejected', reason: Error }, + // { state: 'rejected', reason: Error } + // ] + // Note that for the second item, reason.message will be '2', and for the + // third item, reason.message will be '3'. + }, function(error) { + // Not run. (This block would only be called if allSettled had failed, + // for instance if passed an incorrect argument type.) + }); + ``` + + @method allSettled + @static + @for RSVP + @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. +*/ + +function allSettled(entries, label) { + return new AllSettled(Promise, entries, label).promise; +} + +/** + This is a convenient alias for `RSVP.Promise.race`. + + @method race + @static + @for RSVP + @param {Array} array Array of promises. + @param {String} label An optional label. This is useful + for tooling. + */ +function race$1(array, label) { + return Promise.race(array, label); +} + +function PromiseHash(Constructor, object, label) { + this._superConstructor(Constructor, object, true, label); +} + +PromiseHash.prototype = o_create(Enumerator.prototype); +PromiseHash.prototype._superConstructor = Enumerator; +PromiseHash.prototype._init = function() { + this._result = {}; +}; + +PromiseHash.prototype._validateInput = function(input) { + return input && typeof input === 'object'; +}; + +PromiseHash.prototype._validationError = function() { + return new Error('Promise.hash must be called with an object'); +}; + +PromiseHash.prototype._enumerate = function() { + var enumerator = this; + var promise = enumerator.promise; + var input = enumerator._input; + var results = []; + + for (var key in input) { + if (promise._state === PENDING && Object.prototype.hasOwnProperty.call(input, key)) { + results.push({ + position: key, + entry: input[key] + }); } + } + + var length = results.length; + enumerator._remaining = length; + var result; + + for (var i = 0; promise._state === PENDING && i < length; i++) { + result = results[i]; + enumerator._eachEntry(result.entry, result.position); + } +}; + +/** + `RSVP.hash` is similar to `RSVP.all`, but takes an object instead of an array + for its `promises` argument. + + Returns a promise that is fulfilled when all the given promises have been + fulfilled, or rejected if any of them become rejected. The returned promise + is fulfilled with a hash that has the same key names as the `promises` object + argument. If any of the values in the object are not promises, they will + simply be copied over to the fulfilled object. + + Example: + + ```javascript + var promises = { + myPromise: RSVP.resolve(1), + yourPromise: RSVP.resolve(2), + theirPromise: RSVP.resolve(3), + notAPromise: 4 + }; + + RSVP.hash(promises).then(function(hash){ + // hash here is an object that looks like: + // { + // myPromise: 1, + // yourPromise: 2, + // theirPromise: 3, + // notAPromise: 4 + // } + }); + ```` + + If any of the `promises` given to `RSVP.hash` are rejected, the first promise + that is rejected will be given as the reason to the rejection handler. + + Example: + + ```javascript + var promises = { + myPromise: RSVP.resolve(1), + rejectedPromise: RSVP.reject(new Error('rejectedPromise')), + anotherRejectedPromise: RSVP.reject(new Error('anotherRejectedPromise')), }; - function Result() { - this.value = undefined; - } + RSVP.hash(promises).then(function(hash){ + // Code here never runs because there are rejected promises! + }, function(reason) { + // reason.message === 'rejectedPromise' + }); + ``` - var ERROR = new Result(); - var GET_THEN_ERROR$1 = new Result(); + An important note: `RSVP.hash` is intended for plain JavaScript objects that + are just a set of keys and values. `RSVP.hash` will NOT preserve prototype + chains. - function getThen$1(obj) { - try { - return obj.then; - } catch (error) { - ERROR.value = error; - return ERROR; - } - } + Example: - function tryApply(f, s, a) { - try { - f.apply(s, a); - } catch (error) { - ERROR.value = error; - return ERROR; - } + ```javascript + function MyConstructor(){ + this.example = RSVP.resolve('Example'); } - function makeObject(_, argumentNames) { - var obj = {}; - var length = _.length; - var args = new Array(length); + MyConstructor.prototype = { + protoProperty: RSVP.resolve('Proto Property') + }; - for (var x = 0; x < length; x++) { - args[x] = _[x]; - } + var myObject = new MyConstructor(); - for (var i = 0; i < argumentNames.length; i++) { - var _name = argumentNames[i]; - obj[_name] = args[i + 1]; - } + RSVP.hash(myObject).then(function(hash){ + // protoProperty will not be present, instead you will just have an + // object that looks like: + // { + // example: 'Example' + // } + // + // hash.hasOwnProperty('protoProperty'); // false + // 'undefined' === typeof hash.protoProperty + }); + ``` - return obj; - } + @method hash + @static + @for RSVP + @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. +*/ +function hash(object, label) { + return new PromiseHash(Promise, object, label).promise; +} - function arrayResult(_) { - var length = _.length; - var args = new Array(length - 1); +function HashSettled(Constructor, object, label) { + this._superConstructor(Constructor, object, false, label); +} - for (var i = 1; i < length; i++) { - args[i - 1] = _[i]; - } +HashSettled.prototype = o_create(PromiseHash.prototype); +HashSettled.prototype._superConstructor = Enumerator; +HashSettled.prototype._makeResult = makeSettledResult; - return args; - } +HashSettled.prototype._validationError = function() { + return new Error('hashSettled must be called with an object'); +}; - function wrapThenable(then, promise) { - return { - then: function (onFulFillment, onRejection) { - return then.call(promise, onFulFillment, onRejection); - } - }; - } +/** + `RSVP.hashSettled` is similar to `RSVP.allSettled`, but takes an object + instead of an array for its `promises` argument. - /** - `RSVP.denodeify` takes a 'node-style' function and returns a function that - will return an `RSVP.Promise`. You can use `denodeify` in Node.js or the - browser when you'd prefer to use promises over using callbacks. For example, - `denodeify` transforms the following: - - ```javascript - let fs = require('fs'); - - fs.readFile('myfile.txt', function(err, data){ - if (err) return handleError(err); - handleData(data); - }); - ``` - - into: - - ```javascript - let fs = require('fs'); - let readFile = RSVP.denodeify(fs.readFile); - - readFile('myfile.txt').then(handleData, handleError); - ``` - - If the node function has multiple success parameters, then `denodeify` - just returns the first one: - - ```javascript - let request = RSVP.denodeify(require('request')); - - request('http://example.com').then(function(res) { - // ... - }); - ``` - - However, if you need all success parameters, setting `denodeify`'s - second parameter to `true` causes it to return all success parameters - as an array: - - ```javascript - let request = RSVP.denodeify(require('request'), true); - - request('http://example.com').then(function(result) { - // result[0] -> res - // result[1] -> body - }); - ``` - - Or if you pass it an array with names it returns the parameters as a hash: - - ```javascript - let request = RSVP.denodeify(require('request'), ['res', 'body']); - - request('http://example.com').then(function(result) { - // result.res - // result.body - }); - ``` - - Sometimes you need to retain the `this`: - - ```javascript - let app = require('express')(); - let render = RSVP.denodeify(app.render.bind(app)); - ``` - - The denodified function inherits from the original function. It works in all - environments, except IE 10 and below. Consequently all properties of the original - function are available to you. However, any properties you change on the - denodeified function won't be changed on the original function. Example: - - ```javascript - let request = RSVP.denodeify(require('request')), - cookieJar = request.jar(); // <- Inheritance is used here - - request('http://example.com', {jar: cookieJar}).then(function(res) { - // cookieJar.cookies holds now the cookies returned by example.com - }); - ``` - - Using `denodeify` makes it easier to compose asynchronous operations instead - of using callbacks. For example, instead of: - - ```javascript - let fs = require('fs'); - - fs.readFile('myfile.txt', function(err, data){ - if (err) { ... } // Handle error - fs.writeFile('myfile2.txt', data, function(err){ - if (err) { ... } // Handle error - console.log('done') - }); - }); - ``` - - you can chain the operations together using `then` from the returned promise: - - ```javascript - let fs = require('fs'); - let readFile = RSVP.denodeify(fs.readFile); - let writeFile = RSVP.denodeify(fs.writeFile); - - readFile('myfile.txt').then(function(data){ - return writeFile('myfile2.txt', data); - }).then(function(){ - console.log('done') - }).catch(function(error){ - // Handle error - }); - ``` - - @method denodeify - @static - @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} [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. - @return {Function} a function that wraps `nodeFunc` to return an - `RSVP.Promise` - @static - */ - function denodeify(nodeFunc, options) { - var fn = function () { - var self = this; - var l = arguments.length; - var args = new Array(l + 1); - var promiseInput = false; - - for (var i = 0; i < l; ++i) { - var arg = arguments[i]; - - if (!promiseInput) { - // TODO: clean this up - promiseInput = needsPromiseInput(arg); - if (promiseInput === GET_THEN_ERROR$1) { - var p = new Promise(noop); - reject(p, GET_THEN_ERROR$1.value); - return p; - } else if (promiseInput && promiseInput !== true) { - arg = wrapThenable(promiseInput, arg); - } - } - args[i] = arg; - } + Unlike `RSVP.all` or `RSVP.hash`, which implement a fail-fast method, + but like `RSVP.allSettled`, `hashSettled` waits until all the + constituent promises have returned and then shows you all the results + with their states and values/reasons. This is useful if you want to + handle multiple promises' failure states together as a set. - var promise = new Promise(noop); + Returns a promise that is fulfilled when all the given promises have been + settled, or rejected if the passed parameters are invalid. - args[l] = function (err, val) { - if (err) reject(promise, err);else if (options === undefined) resolve(promise, val);else if (options === true) resolve(promise, arrayResult(arguments));else if (isArray(options)) resolve(promise, makeObject(arguments, options));else resolve(promise, val); - }; + The returned promise is fulfilled with a hash that has the same key names as + the `promises` object argument. If any of the values in the object are not + promises, they will be copied over to the fulfilled object and marked with state + 'fulfilled'. - if (promiseInput) { - return handlePromiseInput(promise, args, nodeFunc, self); - } else { - return handleValueInput(promise, args, nodeFunc, self); - } - }; + Example: + + ```javascript + var promises = { + myPromise: RSVP.Promise.resolve(1), + yourPromise: RSVP.Promise.resolve(2), + theirPromise: RSVP.Promise.resolve(3), + notAPromise: 4 + }; - babelHelpers.defaults(fn, nodeFunc); + RSVP.hashSettled(promises).then(function(hash){ + // hash here is an object that looks like: + // { + // myPromise: { state: 'fulfilled', value: 1 }, + // yourPromise: { state: 'fulfilled', value: 2 }, + // theirPromise: { state: 'fulfilled', value: 3 }, + // notAPromise: { state: 'fulfilled', value: 4 } + // } + }); + ``` - return fn; - } + If any of the `promises` given to `RSVP.hash` are rejected, the state will + be set to 'rejected' and the reason for rejection provided. - function handleValueInput(promise, args, nodeFunc, self) { - var result = tryApply(nodeFunc, self, args); - if (result === ERROR) { - reject(promise, result.value); - } - return promise; - } + Example: - function handlePromiseInput(promise, args, nodeFunc, self) { - return Promise.all(args).then(function (args) { - var result = tryApply(nodeFunc, self, args); - if (result === ERROR) { - reject(promise, result.value); - } - return promise; - }); - } + ```javascript + var promises = { + myPromise: RSVP.Promise.resolve(1), + rejectedPromise: RSVP.Promise.reject(new Error('rejection')), + anotherRejectedPromise: RSVP.Promise.reject(new Error('more rejection')), + }; - function needsPromiseInput(arg) { - if (arg && typeof arg === 'object') { - if (arg.constructor === Promise) { - return true; - } else { - return getThen$1(arg); - } - } else { - return false; - } - } + RSVP.hashSettled(promises).then(function(hash){ + // hash here is an object that looks like: + // { + // myPromise: { state: 'fulfilled', value: 1 }, + // rejectedPromise: { state: 'rejected', reason: Error }, + // anotherRejectedPromise: { state: 'rejected', reason: Error }, + // } + // Note that for rejectedPromise, reason.message == 'rejection', + // and for anotherRejectedPromise, reason.message == 'more rejection'. + }); + ``` - /** - This is a convenient alias for `RSVP.Promise.all`. - - @method all - @static - @for RSVP - @param {Array} array Array of promises. - @param {String} label An optional label. This is useful - for tooling. - */ - function all$1(array, label) { - return Promise.all(array, label); - } + An important note: `RSVP.hashSettled` is intended for plain JavaScript objects that + are just a set of keys and values. `RSVP.hashSettled` will NOT preserve prototype + chains. + + Example: - function AllSettled(Constructor, entries, label) { - this._superConstructor(Constructor, entries, false, /* don't abort on reject */label); + ```javascript + function MyConstructor(){ + this.example = RSVP.Promise.resolve('Example'); } - AllSettled.prototype = o_create(Enumerator.prototype); - AllSettled.prototype._superConstructor = Enumerator; - AllSettled.prototype._makeResult = makeSettledResult; - AllSettled.prototype._validationError = function () { - return new Error('allSettled must be called with an array'); + MyConstructor.prototype = { + protoProperty: RSVP.Promise.resolve('Proto Property') }; - /** - `RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing - a fail-fast method, it waits until all the promises have returned and - shows you all the results. This is useful if you want to handle multiple - promises' failure states together as a set. - - Returns a promise that is fulfilled when all the given promises have been - settled. The return promise is fulfilled with an array of the states of - the promises passed into the `promises` array argument. - - Each state object will either indicate fulfillment or rejection, and - provide the corresponding value or reason. The states will take one of - the following formats: - - ```javascript - { state: 'fulfilled', value: value } - or - { state: 'rejected', reason: reason } - ``` - - Example: - - ```javascript - let promise1 = RSVP.Promise.resolve(1); - let promise2 = RSVP.Promise.reject(new Error('2')); - let promise3 = RSVP.Promise.reject(new Error('3')); - let promises = [ promise1, promise2, promise3 ]; - - RSVP.allSettled(promises).then(function(array){ - // array == [ - // { state: 'fulfilled', value: 1 }, - // { state: 'rejected', reason: Error }, - // { state: 'rejected', reason: Error } - // ] - // Note that for the second item, reason.message will be '2', and for the - // third item, reason.message will be '3'. - }, function(error) { - // Not run. (This block would only be called if allSettled had failed, - // for instance if passed an incorrect argument type.) - }); - ``` - - @method allSettled - @static - @for RSVP - @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. - */ + var myObject = new MyConstructor(); - function allSettled(entries, label) { - return new AllSettled(Promise, entries, label).promise; - } + RSVP.hashSettled(myObject).then(function(hash){ + // protoProperty will not be present, instead you will just have an + // object that looks like: + // { + // example: { state: 'fulfilled', value: 'Example' } + // } + // + // hash.hasOwnProperty('protoProperty'); // false + // 'undefined' === typeof hash.protoProperty + }); + ``` - /** - This is a convenient alias for `RSVP.Promise.race`. - - @method race - @static - @for RSVP - @param {Array} array Array of promises. - @param {String} label An optional label. This is useful - for tooling. - */ - function race$1(array, label) { - return Promise.race(array, label); - } + @method hashSettled + @for RSVP + @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 +*/ +function hashSettled(object, label) { + return new HashSettled(Promise, object, label).promise; +} - function PromiseHash(Constructor, object, label) { - this._superConstructor(Constructor, object, true, label); +/** + `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 + caught by the promises implementation and bubbled to the last handler. For + this reason, it is recommended that you always specify a second rejection + handler function to `then`. However, `RSVP.rethrow` will throw the exception + outside of the promise, so it bubbles up to your console if in the browser, + or domain/cause uncaught exception in Node. `rethrow` will also throw the + error again so the error can be handled by the promise per the spec. + + ```javascript + function throws(){ + throw new Error('Whoops!'); } - PromiseHash.prototype = o_create(Enumerator.prototype); - PromiseHash.prototype._superConstructor = Enumerator; - PromiseHash.prototype._init = function () { - this._result = {}; - }; + var promise = new RSVP.Promise(function(resolve, reject){ + throws(); + }); - PromiseHash.prototype._validateInput = function (input) { - return input && typeof input === 'object'; - }; + promise.catch(RSVP.rethrow).then(function(){ + // Code here doesn't run because the promise became rejected due to an + // error! + }, function (err){ + // handle the error here + }); + ``` - PromiseHash.prototype._validationError = function () { - return new Error('Promise.hash must be called with an object'); - }; + The 'Whoops' error will be thrown on the next turn of the event loop + and you can watch for it in your console. You can also handle it using a + rejection handler given to `.then` or `.catch` on the returned promise. - PromiseHash.prototype._enumerate = function () { - var enumerator = this; - var promise = enumerator.promise; - var input = enumerator._input; - var results = []; - - for (var key in input) { - if (promise._state === PENDING && Object.prototype.hasOwnProperty.call(input, key)) { - results.push({ - position: key, - entry: input[key] - }); - } - } + @method rethrow + @static + @for RSVP + @param {Error} reason reason the promise became rejected. + @throws Error + @static +*/ +function rethrow(reason) { + setTimeout(function() { + throw reason; + }); + throw reason; +} - var length = results.length; - enumerator._remaining = length; - var result = undefined; +/** + `RSVP.defer` returns an object similar to jQuery's `$.Deferred`. + `RSVP.defer` should be used when porting over code reliant on `$.Deferred`'s + interface. New code should use the `RSVP.Promise` constructor instead. - for (var i = 0; promise._state === PENDING && i < length; i++) { - result = results[i]; - enumerator._eachEntry(result.entry, result.position); - } - }; + The object returned from `RSVP.defer` is a plain object with three properties: - /** - `RSVP.hash` is similar to `RSVP.all`, but takes an object instead of an array - for its `promises` argument. - - Returns a promise that is fulfilled when all the given promises have been - fulfilled, or rejected if any of them become rejected. The returned promise - is fulfilled with a hash that has the same key names as the `promises` object - argument. If any of the values in the object are not promises, they will - simply be copied over to the fulfilled object. - - Example: - - ```javascript - let promises = { - myPromise: RSVP.resolve(1), - yourPromise: RSVP.resolve(2), - theirPromise: RSVP.resolve(3), - notAPromise: 4 - }; - - RSVP.hash(promises).then(function(hash){ - // hash here is an object that looks like: - // { - // myPromise: 1, - // yourPromise: 2, - // theirPromise: 3, - // notAPromise: 4 - // } - }); - ```` - - If any of the `promises` given to `RSVP.hash` are rejected, the first promise - that is rejected will be given as the reason to the rejection handler. - - Example: - - ```javascript - let promises = { - myPromise: RSVP.resolve(1), - rejectedPromise: RSVP.reject(new Error('rejectedPromise')), - anotherRejectedPromise: RSVP.reject(new Error('anotherRejectedPromise')), - }; - - RSVP.hash(promises).then(function(hash){ - // Code here never runs because there are rejected promises! - }, function(reason) { - // reason.message === 'rejectedPromise' - }); - ``` - - An important note: `RSVP.hash` is intended for plain JavaScript objects that - are just a set of keys and values. `RSVP.hash` will NOT preserve prototype - chains. - - Example: - - ```javascript - function MyConstructor(){ - this.example = RSVP.resolve('Example'); - } - - MyConstructor.prototype = { - protoProperty: RSVP.resolve('Proto Property') - }; - - let myObject = new MyConstructor(); - - RSVP.hash(myObject).then(function(hash){ - // protoProperty will not be present, instead you will just have an - // object that looks like: - // { - // example: 'Example' - // } - // - // hash.hasOwnProperty('protoProperty'); // false - // 'undefined' === typeof hash.protoProperty - }); - ``` - - @method hash - @static - @for RSVP - @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. - */ - function hash(object, label) { - return new PromiseHash(Promise, object, label).promise; - } + * promise - an `RSVP.Promise`. + * reject - a function that causes the `promise` property on this object to + become rejected + * resolve - a function that causes the `promise` property on this object to + become fulfilled. - function HashSettled(Constructor, object, label) { - this._superConstructor(Constructor, object, false, label); - } + Example: - HashSettled.prototype = o_create(PromiseHash.prototype); - HashSettled.prototype._superConstructor = Enumerator; - HashSettled.prototype._makeResult = makeSettledResult; + ```javascript + var deferred = RSVP.defer(); - HashSettled.prototype._validationError = function () { - return new Error('hashSettled must be called with an object'); - }; + deferred.resolve("Success!"); - /** - `RSVP.hashSettled` is similar to `RSVP.allSettled`, but takes an object - instead of an array for its `promises` argument. - - Unlike `RSVP.all` or `RSVP.hash`, which implement a fail-fast method, - but like `RSVP.allSettled`, `hashSettled` waits until all the - constituent promises have returned and then shows you all the results - with their states and values/reasons. This is useful if you want to - handle multiple promises' failure states together as a set. - - Returns a promise that is fulfilled when all the given promises have been - settled, or rejected if the passed parameters are invalid. - - The returned promise is fulfilled with a hash that has the same key names as - the `promises` object argument. If any of the values in the object are not - promises, they will be copied over to the fulfilled object and marked with state - 'fulfilled'. - - Example: - - ```javascript - let promises = { - myPromise: RSVP.Promise.resolve(1), - yourPromise: RSVP.Promise.resolve(2), - theirPromise: RSVP.Promise.resolve(3), - notAPromise: 4 - }; - - RSVP.hashSettled(promises).then(function(hash){ - // hash here is an object that looks like: - // { - // myPromise: { state: 'fulfilled', value: 1 }, - // yourPromise: { state: 'fulfilled', value: 2 }, - // theirPromise: { state: 'fulfilled', value: 3 }, - // notAPromise: { state: 'fulfilled', value: 4 } - // } - }); - ``` - - If any of the `promises` given to `RSVP.hash` are rejected, the state will - be set to 'rejected' and the reason for rejection provided. - - Example: - - ```javascript - let promises = { - myPromise: RSVP.Promise.resolve(1), - rejectedPromise: RSVP.Promise.reject(new Error('rejection')), - anotherRejectedPromise: RSVP.Promise.reject(new Error('more rejection')), - }; - - RSVP.hashSettled(promises).then(function(hash){ - // hash here is an object that looks like: - // { - // myPromise: { state: 'fulfilled', value: 1 }, - // rejectedPromise: { state: 'rejected', reason: Error }, - // anotherRejectedPromise: { state: 'rejected', reason: Error }, - // } - // Note that for rejectedPromise, reason.message == 'rejection', - // and for anotherRejectedPromise, reason.message == 'more rejection'. - }); - ``` - - An important note: `RSVP.hashSettled` is intended for plain JavaScript objects that - are just a set of keys and values. `RSVP.hashSettled` will NOT preserve prototype - chains. - - Example: - - ```javascript - function MyConstructor(){ - this.example = RSVP.Promise.resolve('Example'); + deferred.promise.then(function(value){ + // value here is "Success!" + }); + ``` + + @method defer + @static + @for RSVP + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Object} + */ + +function defer(label) { + var deferred = {}; + + deferred['promise'] = new Promise(function(resolve, reject) { + deferred['resolve'] = resolve; + deferred['reject'] = reject; + }, label); + + return deferred; +} + +/** + `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 + each item in given to `promises`. `RSVP.map` returns a promise that will + become fulfilled with the result of running `mapFn` on the values the promises + become fulfilled with. + + For example: + + ```javascript + + var promise1 = RSVP.resolve(1); + var promise2 = RSVP.resolve(2); + var promise3 = RSVP.resolve(3); + var promises = [ promise1, promise2, promise3 ]; + + var mapFn = function(item){ + return item + 1; + }; + + RSVP.map(promises, mapFn).then(function(result){ + // result is [ 2, 3, 4 ] + }); + ``` + + If any of the `promises` given to `RSVP.map` are rejected, the first promise + that is rejected will be given as an argument to the returned promise's + rejection handler. For example: + + ```javascript + var promise1 = RSVP.resolve(1); + var promise2 = RSVP.reject(new Error('2')); + var promise3 = RSVP.reject(new Error('3')); + var promises = [ promise1, promise2, promise3 ]; + + var mapFn = function(item){ + return item + 1; + }; + + RSVP.map(promises, mapFn).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(reason) { + // reason.message === '2' + }); + ``` + + `RSVP.map` will also wait if a promise is returned from `mapFn`. For example, + say you want to get all comments from a set of blog posts, but you need + the blog posts first because they contain a url to those comments. + + ```javscript + + var mapFn = function(blogPost){ + // getComments does some ajax and returns an RSVP.Promise that is fulfilled + // with some comments data + return getComments(blogPost.comments_url); + }; + + // getBlogPosts does some ajax and returns an RSVP.Promise that is fulfilled + // with some blog post data + RSVP.map(getBlogPosts(), mapFn).then(function(comments){ + // comments is the result of asking the server for the comments + // of all blog posts returned from getBlogPosts() + }); + ``` + + @method map + @static + @for RSVP + @param {Array} promises + @param {Function} mapFn function to be called on each fulfilled promise. + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} promise that is fulfilled with the result of calling + `mapFn` on each fulfilled promise or value when they become fulfilled. + The promise will be rejected if any of the given `promises` become rejected. + @static +*/ +function map(promises, mapFn, label) { + return Promise.all(promises, label).then(function(values) { + if (!isFunction(mapFn)) { + throw new TypeError("You must pass a function as map's second argument."); } - - MyConstructor.prototype = { - protoProperty: RSVP.Promise.resolve('Proto Property') - }; - - let myObject = new MyConstructor(); - - RSVP.hashSettled(myObject).then(function(hash){ - // protoProperty will not be present, instead you will just have an - // object that looks like: - // { - // example: { state: 'fulfilled', value: 'Example' } - // } - // - // hash.hasOwnProperty('protoProperty'); // false - // 'undefined' === typeof hash.protoProperty - }); - ``` - - @method hashSettled - @for RSVP - @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 - */ - function hashSettled(object, label) { - return new HashSettled(Promise, object, label).promise; - } - /** - `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 - caught by the promises implementation and bubbled to the last handler. For - this reason, it is recommended that you always specify a second rejection - handler function to `then`. However, `RSVP.rethrow` will throw the exception - outside of the promise, so it bubbles up to your console if in the browser, - or domain/cause uncaught exception in Node. `rethrow` will also throw the - error again so the error can be handled by the promise per the spec. - - ```javascript - function throws(){ - throw new Error('Whoops!'); + var length = values.length; + var results = new Array(length); + + for (var i = 0; i < length; i++) { + results[i] = mapFn(values[i]); } - - let promise = new RSVP.Promise(function(resolve, reject){ - throws(); - }); - - promise.catch(RSVP.rethrow).then(function(){ - // Code here doesn't run because the promise became rejected due to an - // error! - }, function (err){ - // handle the error here - }); - ``` - - The 'Whoops' error will be thrown on the next turn of the event loop - and you can watch for it in your console. You can also handle it using a - rejection handler given to `.then` or `.catch` on the returned promise. - - @method rethrow - @static - @for RSVP - @param {Error} reason reason the promise became rejected. - @throws Error - @static - */ - function rethrow(reason) { - setTimeout(function () { - throw reason; - }); - throw reason; - } - /** - `RSVP.defer` returns an object similar to jQuery's `$.Deferred`. - `RSVP.defer` should be used when porting over code reliant on `$.Deferred`'s - interface. New code should use the `RSVP.Promise` constructor instead. - - The object returned from `RSVP.defer` is a plain object with three properties: - - * promise - an `RSVP.Promise`. - * reject - a function that causes the `promise` property on this object to - become rejected - * resolve - a function that causes the `promise` property on this object to - become fulfilled. - - Example: - - ```javascript - let deferred = RSVP.defer(); - - deferred.resolve("Success!"); - - deferred.promise.then(function(value){ - // value here is "Success!" - }); - ``` - - @method defer - @static - @for RSVP - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Object} - */ + return Promise.all(results, label); + }); +} - function defer(label) { - var deferred = { resolve: undefined, reject: undefined }; +/** + This is a convenient alias for `RSVP.Promise.resolve`. - deferred.promise = new Promise(function (resolve, reject) { - deferred.resolve = resolve; - deferred.reject = reject; - }, label); + @method resolve + @static + @for RSVP + @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` +*/ +function resolve$2(value, label) { + return Promise.resolve(value, label); +} - return deferred; - } +/** + This is a convenient alias for `RSVP.Promise.reject`. - /** - `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 - each item in given to `promises`. `RSVP.map` returns a promise that will - become fulfilled with the result of running `mapFn` on the values the promises - become fulfilled with. - - For example: - - ```javascript - - let promise1 = RSVP.resolve(1); - let promise2 = RSVP.resolve(2); - let promise3 = RSVP.resolve(3); - let promises = [ promise1, promise2, promise3 ]; - - let mapFn = function(item){ - return item + 1; - }; - - RSVP.map(promises, mapFn).then(function(result){ - // result is [ 2, 3, 4 ] - }); - ``` - - If any of the `promises` given to `RSVP.map` are rejected, the first promise - that is rejected will be given as an argument to the returned promise's - rejection handler. For example: - - ```javascript - let promise1 = RSVP.resolve(1); - let promise2 = RSVP.reject(new Error('2')); - let promise3 = RSVP.reject(new Error('3')); - let promises = [ promise1, promise2, promise3 ]; - - let mapFn = function(item){ - return item + 1; - }; - - RSVP.map(promises, mapFn).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(reason) { - // reason.message === '2' - }); - ``` - - `RSVP.map` will also wait if a promise is returned from `mapFn`. For example, - say you want to get all comments from a set of blog posts, but you need - the blog posts first because they contain a url to those comments. - - ```javscript - - let mapFn = function(blogPost){ - // getComments does some ajax and returns an RSVP.Promise that is fulfilled - // with some comments data - return getComments(blogPost.comments_url); - }; - - // getBlogPosts does some ajax and returns an RSVP.Promise that is fulfilled - // with some blog post data - RSVP.map(getBlogPosts(), mapFn).then(function(comments){ - // comments is the result of asking the server for the comments - // of all blog posts returned from getBlogPosts() - }); - ``` - - @method map - @static - @for RSVP - @param {Array} promises - @param {Function} mapFn function to be called on each fulfilled promise. - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} promise that is fulfilled with the result of calling - `mapFn` on each fulfilled promise or value when they become fulfilled. - The promise will be rejected if any of the given `promises` become rejected. - @static - */ - function map(promises, mapFn, label) { - return Promise.all(promises, label).then(function (values) { - if (!isFunction(mapFn)) { - throw new TypeError("You must pass a function as map's second argument."); - } + @method reject + @static + @for RSVP + @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$2(reason, label) { + return Promise.reject(reason, label); +} - var length = values.length; - var results = new Array(length); +/** + `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 + each item in given to `promises`. `RSVP.filter` returns a promise that will + become fulfilled with the result of running `filterFn` on the values the + promises become fulfilled with. - for (var i = 0; i < length; i++) { - results[i] = mapFn(values[i]); - } + For example: - return Promise.all(results, label); - }); - } + ```javascript - /** - This is a convenient alias for `RSVP.Promise.resolve`. - - @method resolve - @static - @for RSVP - @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` - */ - function resolve$2(value, label) { - return Promise.resolve(value, label); - } + var promise1 = RSVP.resolve(1); + var promise2 = RSVP.resolve(2); + var promise3 = RSVP.resolve(3); - /** - This is a convenient alias for `RSVP.Promise.reject`. - - @method reject - @static - @for RSVP - @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$2(reason, label) { - return Promise.reject(reason, label); - } + var promises = [promise1, promise2, promise3]; - /** - `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 - each item in given to `promises`. `RSVP.filter` returns a promise that will - become fulfilled with the result of running `filterFn` on the values the - promises become fulfilled with. - - For example: - - ```javascript - - let promise1 = RSVP.resolve(1); - let promise2 = RSVP.resolve(2); - let promise3 = RSVP.resolve(3); - - let promises = [promise1, promise2, promise3]; - - let filterFn = function(item){ - return item > 1; - }; - - RSVP.filter(promises, filterFn).then(function(result){ - // result is [ 2, 3 ] - }); - ``` - - If any of the `promises` given to `RSVP.filter` are rejected, the first promise - that is rejected will be given as an argument to the returned promise's - rejection handler. For example: - - ```javascript - let promise1 = RSVP.resolve(1); - let promise2 = RSVP.reject(new Error('2')); - let promise3 = RSVP.reject(new Error('3')); - let promises = [ promise1, promise2, promise3 ]; - - let filterFn = function(item){ - return item > 1; - }; - - RSVP.filter(promises, filterFn).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(reason) { - // reason.message === '2' - }); - ``` - - `RSVP.filter` will also wait for any promises returned from `filterFn`. - For instance, you may want to fetch a list of users then return a subset - of those users based on some asynchronous operation: - - ```javascript - - let alice = { name: 'alice' }; - let bob = { name: 'bob' }; - let users = [ alice, bob ]; - - let promises = users.map(function(user){ - return RSVP.resolve(user); - }); - - let filterFn = function(user){ - // Here, Alice has permissions to create a blog post, but Bob does not. - return getPrivilegesForUser(user).then(function(privs){ - return privs.can_create_blog_post === true; - }); - }; - RSVP.filter(promises, filterFn).then(function(users){ - // true, because the server told us only Alice can create a blog post. - users.length === 1; - // false, because Alice is the only user present in `users` - users[0] === bob; - }); - ``` - - @method filter - @static - @for RSVP - @param {Array} promises - @param {Function} filterFn - function to be called on each resolved value to - filter the final results. - @param {String} label optional string describing the promise. Useful for - tooling. - @return {Promise} - */ + var filterFn = function(item){ + return item > 1; + }; - function resolveAll(promises, label) { - return Promise.all(promises, label); - } + RSVP.filter(promises, filterFn).then(function(result){ + // result is [ 2, 3 ] + }); + ``` - function resolveSingle(promise, label) { - return Promise.resolve(promise, label).then(function (promises) { - return resolveAll(promises, label); - }); - } + If any of the `promises` given to `RSVP.filter` are rejected, the first promise + that is rejected will be given as an argument to the returned promise's + rejection handler. For example: - function filter(promises, filterFn, label) { - var promise = isArray(promises) ? resolveAll(promises, label) : resolveSingle(promises, label); - return promise.then(function (values) { - if (!isFunction(filterFn)) { - throw new TypeError("You must pass a function as filter's second argument."); - } + ```javascript + var promise1 = RSVP.resolve(1); + var promise2 = RSVP.reject(new Error('2')); + var promise3 = RSVP.reject(new Error('3')); + var promises = [ promise1, promise2, promise3 ]; - var length = values.length; - var filtered = new Array(length); + var filterFn = function(item){ + return item > 1; + }; - for (var i = 0; i < length; i++) { - filtered[i] = filterFn(values[i]); - } + RSVP.filter(promises, filterFn).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(reason) { + // reason.message === '2' + }); + ``` - return resolveAll(filtered, label).then(function (filtered) { - var results = new Array(length); - var newLength = 0; + `RSVP.filter` will also wait for any promises returned from `filterFn`. + For instance, you may want to fetch a list of users then return a subset + of those users based on some asynchronous operation: - for (var i = 0; i < length; i++) { - if (filtered[i]) { - results[newLength] = values[i]; - newLength++; - } - } + ```javascript - results.length = newLength; + var alice = { name: 'alice' }; + var bob = { name: 'bob' }; + var users = [ alice, bob ]; - return results; - }); + var promises = users.map(function(user){ + return RSVP.resolve(user); + }); + + var filterFn = function(user){ + // Here, Alice has permissions to create a blog post, but Bob does not. + return getPrivilegesForUser(user).then(function(privs){ + return privs.can_create_blog_post === true; }); - } + }; + RSVP.filter(promises, filterFn).then(function(users){ + // true, because the server told us only Alice can create a blog post. + users.length === 1; + // false, because Alice is the only user present in `users` + users[0] === bob; + }); + ``` - var len = 0; - var vertxNext = undefined; - function asap(callback, arg) { - queue$1[len] = callback; - queue$1[len + 1] = arg; - len += 2; - if (len === 2) { - // If len is 1, that means that we need to schedule an async flush. - // If additional callbacks are queued before the queue is flushed, they - // will be processed by this flush that we are scheduling. - scheduleFlush$1(); + @method filter + @static + @for RSVP + @param {Array} promises + @param {Function} filterFn - function to be called on each resolved value to + filter the final results. + @param {String} label optional string describing the promise. Useful for + tooling. + @return {Promise} +*/ +function filter(promises, filterFn, label) { + return Promise.all(promises, label).then(function(values) { + if (!isFunction(filterFn)) { + throw new TypeError("You must pass a function as filter's second argument."); } - } - var browserWindow = typeof window !== 'undefined' ? window : undefined; - var browserGlobal = browserWindow || {}; - var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; - var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && ({}).toString.call(process) === '[object process]'; + var length = values.length; + var filtered = new Array(length); - // 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; + for (var i = 0; i < length; i++) { + filtered[i] = filterFn(values[i]); } - return function () { - return nextTick(flush); - }; - } - // vertx - function useVertxTimer() { - if (typeof vertxNext !== 'undefined') { - return function () { - vertxNext(flush); - }; - } - return useSetTimeout(); - } + return Promise.all(filtered, label).then(function(filtered) { + var results = new Array(length); + var newLength = 0; - function useMutationObserver() { - var iterations = 0; - var observer = new BrowserMutationObserver(flush); - var node = document.createTextNode(''); - observer.observe(node, { characterData: true }); + for (var i = 0; i < length; i++) { + if (filtered[i]) { + results[newLength] = values[i]; + newLength++; + } + } - return function () { - return node.data = iterations = ++iterations % 2; - }; - } + results.length = newLength; - // web worker - function useMessageChannel() { - var channel = new MessageChannel(); - channel.port1.onmessage = flush; - return function () { - return channel.port2.postMessage(0); - }; - } + return results; + }); + }); +} - function useSetTimeout() { - return function () { - return setTimeout(flush, 1); - }; +var len = 0; +var vertxNext; +function asap(callback, arg) { + queue$1[len] = callback; + queue$1[len + 1] = arg; + len += 2; + if (len === 2) { + // If len is 1, that means that we need to schedule an async flush. + // If additional callbacks are queued before the queue is flushed, they + // will be processed by this flush that we are scheduling. + scheduleFlush$1(); } +} - var queue$1 = new Array(1000); +var browserWindow = (typeof window !== 'undefined') ? window : undefined; +var browserGlobal = browserWindow || {}; +var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; +var isNode = typeof self === '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() { + nextTick(flush); + }; +} - function flush() { - for (var i = 0; i < len; i += 2) { - var callback = queue$1[i]; - var arg = queue$1[i + 1]; +// vertx +function useVertxTimer() { + return function() { + vertxNext(flush); + }; +} - callback(arg); +function useMutationObserver() { + var iterations = 0; + var observer = new BrowserMutationObserver(flush); + var node = document.createTextNode(''); + observer.observe(node, { characterData: true }); - queue$1[i] = undefined; - queue$1[i + 1] = undefined; - } + return function() { + node.data = (iterations = ++iterations % 2); + }; +} - len = 0; - } +// web worker +function useMessageChannel() { + var channel = new MessageChannel(); + channel.port1.onmessage = flush; + return function () { + channel.port2.postMessage(0); + }; +} - function attemptVertex() { - try { - var r = require; - var vertx = r('vertx'); - vertxNext = vertx.runOnLoop || vertx.runOnContext; - return useVertxTimer(); - } catch (e) { - return useSetTimeout(); - } +function useSetTimeout() { + return function() { + setTimeout(flush, 1); + }; +} + +var queue$1 = new Array(1000); +function flush() { + for (var i = 0; i < len; i+=2) { + var callback = queue$1[i]; + var arg = queue$1[i+1]; + + callback(arg); + + queue$1[i] = undefined; + queue$1[i+1] = undefined; } - var scheduleFlush$1 = undefined; - // Decide what async method to use to triggering processing of queued callbacks: - if (isNode) { - scheduleFlush$1 = useNextTick(); - } else if (BrowserMutationObserver) { - scheduleFlush$1 = useMutationObserver(); - } else if (isWorker) { - scheduleFlush$1 = useMessageChannel(); - } else if (browserWindow === undefined && typeof require === 'function') { - scheduleFlush$1 = attemptVertex(); - } else { - scheduleFlush$1 = useSetTimeout(); + len = 0; +} + +function attemptVertex() { + try { + var r = require; + var vertx = r('vertx'); + vertxNext = vertx.runOnLoop || vertx.runOnContext; + return useVertxTimer(); + } catch(e) { + return useSetTimeout(); } +} + +var scheduleFlush$1; +// Decide what async method to use to triggering processing of queued callbacks: +if (isNode) { + scheduleFlush$1 = useNextTick(); +} else if (BrowserMutationObserver) { + scheduleFlush$1 = useMutationObserver(); +} else if (isWorker) { + scheduleFlush$1 = useMessageChannel(); +} else if (browserWindow === undefined && typeof require === 'function') { + scheduleFlush$1 = attemptVertex(); +} else { + scheduleFlush$1 = useSetTimeout(); +} + +// defaults +config.async = asap; +config.after = function(cb) { + setTimeout(cb, 0); +}; +var cast = resolve$2; +function async(callback, arg) { + config.async(callback, arg); +} - var platform = undefined; +function on() { + config['on'].apply(config, arguments); +} - /* global self */ - if (typeof self === 'object') { - platform = self; +function off() { + config['off'].apply(config, arguments); +} - /* global global */ - } else if (typeof global === 'object') { - platform = global; - } else { - throw new Error('no global: `self` or `global` found'); +// Set up instrumentation through `window.__PROMISE_INTRUMENTATION__` +if (typeof window !== 'undefined' && typeof window['__PROMISE_INSTRUMENTATION__'] === 'object') { + var callbacks = window['__PROMISE_INSTRUMENTATION__']; + configure('instrument', true); + for (var eventName in callbacks) { + if (callbacks.hasOwnProperty(eventName)) { + on(eventName, callbacks[eventName]); } + } +} - // defaults - config.async = asap; - config.after = function (cb) { - return setTimeout(cb, 0); - }; - var cast = resolve$2; +exports.cast = cast; +exports.Promise = Promise; +exports.EventTarget = EventTarget; +exports.all = all$1; +exports.allSettled = allSettled; +exports.race = race$1; +exports.hash = hash; +exports.hashSettled = hashSettled; +exports.rethrow = rethrow; +exports.defer = defer; +exports.denodeify = denodeify; +exports.configure = configure; +exports.on = on; +exports.off = off; +exports.resolve = resolve$2; +exports.reject = reject$2; +exports.async = async; +exports.map = map; +exports.filter = filter; - var async = function (callback, arg) { - return config.async(callback, arg); - }; +Object.defineProperty(exports, '__esModule', { value: true }); - function on() { - config['on'].apply(config, arguments); - } - - function off() { - config['off'].apply(config, arguments); - } - - // Set up instrumentation through `window.__PROMISE_INTRUMENTATION__` - if (typeof window !== 'undefined' && typeof window['__PROMISE_INSTRUMENTATION__'] === 'object') { - var callbacks = window['__PROMISE_INSTRUMENTATION__']; - configure('instrument', true); - for (var eventName in callbacks) { - if (callbacks.hasOwnProperty(eventName)) { - on(eventName, callbacks[eventName]); - } - } - } - - // the default export here is for backwards compat: - // https://github.com/tildeio/rsvp.js/issues/434 - var rsvp = (_rsvp = { - cast: cast, - Promise: Promise, - EventTarget: EventTarget, - all: all$1, - allSettled: allSettled, - race: race$1, - hash: hash, - hashSettled: hashSettled, - rethrow: rethrow, - defer: defer, - denodeify: denodeify, - configure: configure, - on: on, - off: off, - resolve: resolve$2, - reject: reject$2, - map: map - }, _rsvp['async'] = async, _rsvp.filter = // babel seems to error if async isn't a computed prop here... - filter, _rsvp); - - exports.cast = cast; - exports.Promise = Promise; - exports.EventTarget = EventTarget; - exports.all = all$1; - exports.allSettled = allSettled; - exports.race = race$1; - exports.hash = hash; - exports.hashSettled = hashSettled; - exports.rethrow = rethrow; - exports.defer = defer; - exports.denodeify = denodeify; - exports.configure = configure; - exports.on = on; - exports.off = off; - exports.resolve = resolve$2; - exports.reject = reject$2; - exports.map = map; - exports.async = async; - exports.filter = filter; - exports.default = rsvp; }); (function (m) { if (typeof module === "object" && module.exports) { module.exports = m } }(requireModule("ember-runtime").default)); diff --git a/ember-template-compiler.js b/ember-template-compiler.js index 3692ca6b9..7390c8661 100644 --- a/ember-template-compiler.js +++ b/ember-template-compiler.js @@ -6,10 +6,11 @@ * 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.11.0-beta.2 + * @version 2.10.2-with-backtracking */ var enifed, requireModule, Ember; +var mainContext = this; (function() { var isNode = typeof window === 'undefined' && @@ -111,6 +112,8 @@ var enifed, requireModule, Ember; } })(); +var babelHelpers; + function classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); @@ -1454,6 +1457,7 @@ enifed('ember-debug/deprecate', ['exports', 'ember-metal', 'ember-console', 'emb emberjs.com website. @for Ember @public + @since 1.0.0 */ function deprecate(message, test, options) { @@ -1552,6 +1556,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'emb @param {Boolean} test Must be truthy for the assertion to pass. If falsy, an exception will be thrown. @public + @since 1.0.0 */ _emberMetal.setDebugFunction('assert', function assert(desc, test) { if (!test) { @@ -1874,6 +1879,7 @@ enifed('ember-debug/warn', ['exports', 'ember-console', 'ember-metal', 'ember-de The `id` should be namespaced by dots, e.g. "ember-debug.feature-flag-with-features-stripped" @for Ember @public + @since 1.0.0 */ function warn(message, test, options) { @@ -2075,6 +2081,8 @@ enifed('ember-metal/alias', ['exports', 'ember-utils', 'ember-metal/debug', 'emb exports.default = alias; exports.AliasedProperty = AliasedProperty; + var CONSUMED = {}; + function alias(altKey) { return new AliasedProperty(altKey); } @@ -2095,28 +2103,30 @@ enifed('ember-metal/alias', ['exports', 'ember-utils', 'ember-metal/debug', 'emb } }; - AliasedProperty.prototype._addDependentKeyIfMissing = function (obj, keyName) { + AliasedProperty.prototype.teardown = function (obj, keyName) { var meta = _emberMetalMeta.meta(obj); - if (!meta.peekDeps(this.altKey, keyName)) { - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); + if (meta.peekWatching(keyName)) { + _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); } }; - AliasedProperty.prototype._removeDependentKeyIfAdded = function (obj, keyName) { - var meta = _emberMetalMeta.meta(obj); - if (meta.peekDeps(this.altKey, keyName)) { - _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); - } + AliasedProperty.prototype.willWatch = function (obj, keyName) { + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); }; - AliasedProperty.prototype.willWatch = AliasedProperty.prototype._addDependentKeyIfMissing; - AliasedProperty.prototype.didUnwatch = AliasedProperty.prototype._removeDependentKeyIfAdded; - AliasedProperty.prototype.teardown = AliasedProperty.prototype._removeDependentKeyIfAdded; + AliasedProperty.prototype.didUnwatch = function (obj, keyName) { + _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); + }; AliasedProperty.prototype.get = function AliasedProperty_get(obj, keyName) { - this._addDependentKeyIfMissing(obj, keyName); - - return _emberMetalProperty_get.get(obj, this.altKey); + var ret = _emberMetalProperty_get.get(obj, this.altKey); + var meta = _emberMetalMeta.meta(obj); + var cache = meta.writableCache(); + if (cache[keyName] !== CONSUMED) { + cache[keyName] = CONSUMED; + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); + } + return ret; }; AliasedProperty.prototype.set = function AliasedProperty_set(obj, keyName, value) { @@ -4633,6 +4643,7 @@ enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-me exports.removeObserver = _emberMetalObserver.removeObserver; exports._addBeforeObserver = _emberMetalObserver._addBeforeObserver; exports._removeBeforeObserver = _emberMetalObserver._removeBeforeObserver; + exports.NAME_KEY = _emberMetalMixin.NAME_KEY; exports.Mixin = _emberMetalMixin.Mixin; exports.aliasMethod = _emberMetalMixin.aliasMethod; exports._immediateObserver = _emberMetalMixin._immediateObserver; @@ -5833,7 +5844,7 @@ enifed('ember-metal/meta', ['exports', 'ember-utils', 'ember-metal/features', 'e var META_DESTROYED = 1 << 3; var IS_PROXY = 1 << 4; - if (true || false) { + if (true || true) { members.lastRendered = ownMap; members.lastRenderedFrom = ownMap; // FIXME: not used in production, remove me from prod builds } @@ -5875,7 +5886,7 @@ enifed('ember-metal/meta', ['exports', 'ember-utils', 'ember-metal/features', 'e // inherited, and we can optimize it much better than JS runtimes. this.parent = parentMeta; - if (true || false) { + if (true || true) { this._lastRendered = undefined; this._lastRenderedFrom = undefined; // FIXME: not used in production, remove me from prod builds } @@ -6671,32 +6682,20 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb function applyConcatenatedProperties(obj, key, value, values) { var baseValue = values[key] || obj[key]; - var ret = undefined; if (baseValue) { if ('function' === typeof baseValue.concat) { if (value === null || value === undefined) { - ret = baseValue; + return baseValue; } else { - ret = baseValue.concat(value); + return baseValue.concat(value); } } else { - ret = _emberUtils.makeArray(baseValue).concat(value); + return _emberUtils.makeArray(baseValue).concat(value); } } else { - ret = _emberUtils.makeArray(value); + return _emberUtils.makeArray(value); } - - _emberMetalDebug.runInDebug(function () { - // it is possible to use concatenatedProperties with strings (which cannot be frozen) - // only freeze objects... - if (typeof ret === 'object' && ret !== null) { - // prevent mutating `concatenatedProperties` array after it is applied - Object.freeze(ret); - } - }); - - return ret; } function applyMergedProperties(obj, key, value, values) { @@ -6972,6 +6971,9 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb return obj; } + var NAME_KEY = _emberUtils.GUID_KEY + '_name'; + + exports.NAME_KEY = NAME_KEY; /** The `Ember.Mixin` class allows you to create mixins, whose properties can be added to other classes. For instance, @@ -7054,7 +7056,7 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb this.ownerConstructor = undefined; this._without = undefined; this[_emberUtils.GUID_KEY] = null; - this[_emberUtils.NAME_KEY] = null; + this[NAME_KEY] = null; _emberMetalDebug.debugSeal(this); } @@ -8047,7 +8049,7 @@ enifed('ember-metal/property_events', ['exports', 'ember-utils', 'ember-metal/me _emberMetalTags.markObjectAsDirty(meta, keyName); - if (true || false) { + if (true || true) { _emberMetalTransaction.assertNotRendered(obj, keyName, meta); } } @@ -9376,20 +9378,20 @@ enifed('ember-metal/transaction', ['exports', 'ember-metal/meta', 'ember-metal/d assertNotRendered = undefined; var raise = _emberMetalDebug.assert; - if (false) { + if (true) { raise = function (message, test) { _emberMetalDebug.deprecate(message, test, { id: 'ember-views.render-double-modify', until: '3.0.0' }); }; } var implication = undefined; - if (false) { + if (true) { implication = 'will be removed in Ember 3.0.'; } else if (true) { implication = 'is no longer supported. See https://github.com/emberjs/ember.js/issues/13948 for more details.'; } - if (true || false) { + if (true || true) { (function () { var counter = 0; var inTransaction = false; @@ -9441,7 +9443,7 @@ enifed('ember-metal/transaction', ['exports', 'ember-metal/meta', 'ember-metal/d label = 'the same value'; } - return 'You modified ' + label + ' twice on ' + object + ' in a single render. This was unreliable and slow in Ember 1.x and ' + implication; + return 'You modified ' + parts.join('.') + ' twice on ' + object + ' in a single render. This was unreliable and slow in Ember 1.x and ' + implication; })(), false); shouldReflush = true; @@ -9987,64 +9989,10 @@ enifed('ember-template-compiler/plugins/deprecate-render-model', ['exports', 'em return 'Please refactor `' + original + '` to a component and invoke via' + (' `' + preferred + '`. ' + sourceInformation); } }); -enifed('ember-template-compiler/plugins/deprecate-render', ['exports', 'ember-metal', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetal, _emberTemplateCompilerSystemCalculateLocationDisplay) { +enifed('ember-template-compiler/plugins/index', ['exports', 'ember-template-compiler/plugins/transform-old-binding-syntax', 'ember-template-compiler/plugins/transform-item-class', 'ember-template-compiler/plugins/transform-angle-bracket-components', 'ember-template-compiler/plugins/transform-input-on-to-onEvent', 'ember-template-compiler/plugins/transform-top-level-components', 'ember-template-compiler/plugins/transform-inline-link-to', 'ember-template-compiler/plugins/transform-old-class-binding-syntax', 'ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings', 'ember-template-compiler/plugins/deprecate-render-model', 'ember-template-compiler/plugins/assert-reserved-named-arguments', 'ember-template-compiler/plugins/transform-action-syntax', 'ember-template-compiler/plugins/transform-input-type-syntax', 'ember-template-compiler/plugins/transform-attrs-into-args', 'ember-template-compiler/plugins/transform-each-in-into-each', 'ember-template-compiler/plugins/transform-has-block-syntax'], function (exports, _emberTemplateCompilerPluginsTransformOldBindingSyntax, _emberTemplateCompilerPluginsTransformItemClass, _emberTemplateCompilerPluginsTransformAngleBracketComponents, _emberTemplateCompilerPluginsTransformInputOnToOnEvent, _emberTemplateCompilerPluginsTransformTopLevelComponents, _emberTemplateCompilerPluginsTransformInlineLinkTo, _emberTemplateCompilerPluginsTransformOldClassBindingSyntax, _emberTemplateCompilerPluginsTransformQuotedBindingsIntoJustBindings, _emberTemplateCompilerPluginsDeprecateRenderModel, _emberTemplateCompilerPluginsAssertReservedNamedArguments, _emberTemplateCompilerPluginsTransformActionSyntax, _emberTemplateCompilerPluginsTransformInputTypeSyntax, _emberTemplateCompilerPluginsTransformAttrsIntoArgs, _emberTemplateCompilerPluginsTransformEachInIntoEach, _emberTemplateCompilerPluginsTransformHasBlockSyntax) { 'use strict'; - exports.default = DeprecateRender; - - function DeprecateRender(options) { - this.syntax = null; - this.options = options; - } - - DeprecateRender.prototype.transform = function DeprecateRender_transform(ast) { - var moduleName = this.options.meta.moduleName; - var walker = new this.syntax.Walker(); - - walker.visit(ast, function (node) { - if (!validate(node)) { - return; - } - - each(node.params, function (param) { - if (param.type !== 'StringLiteral') { - return; - } - - _emberMetal.deprecate(deprecationMessage(moduleName, node), false, { - id: 'ember-template-compiler.deprecate-render', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x#toc_code-render-code-helper' - }); - }); - }); - - return ast; - }; - - function validate(node) { - return node.type === 'MustacheStatement' && node.path.original === 'render' && node.params.length === 1; - } - - function each(list, callback) { - for (var i = 0, l = list.length; i < l; i++) { - callback(list[i]); - } - } - - function deprecationMessage(moduleName, node) { - var sourceInformation = _emberTemplateCompilerSystemCalculateLocationDisplay.default(moduleName, node.loc); - var componentName = node.params[0].original; - var original = '{{render "' + componentName + '"}}'; - var preferred = '{{' + componentName + '}}'; - - return 'Please refactor `' + original + '` to a component and invoke via' + (' `' + preferred + '`. ' + sourceInformation); - } -}); -enifed('ember-template-compiler/plugins/index', ['exports', 'ember-template-compiler/plugins/transform-old-binding-syntax', 'ember-template-compiler/plugins/transform-item-class', 'ember-template-compiler/plugins/transform-angle-bracket-components', 'ember-template-compiler/plugins/transform-input-on-to-onEvent', 'ember-template-compiler/plugins/transform-top-level-components', 'ember-template-compiler/plugins/transform-inline-link-to', 'ember-template-compiler/plugins/transform-old-class-binding-syntax', 'ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings', 'ember-template-compiler/plugins/deprecate-render-model', 'ember-template-compiler/plugins/deprecate-render', 'ember-template-compiler/plugins/assert-reserved-named-arguments', 'ember-template-compiler/plugins/transform-action-syntax', 'ember-template-compiler/plugins/transform-input-type-syntax', 'ember-template-compiler/plugins/transform-attrs-into-args', 'ember-template-compiler/plugins/transform-each-in-into-each', 'ember-template-compiler/plugins/transform-has-block-syntax'], function (exports, _emberTemplateCompilerPluginsTransformOldBindingSyntax, _emberTemplateCompilerPluginsTransformItemClass, _emberTemplateCompilerPluginsTransformAngleBracketComponents, _emberTemplateCompilerPluginsTransformInputOnToOnEvent, _emberTemplateCompilerPluginsTransformTopLevelComponents, _emberTemplateCompilerPluginsTransformInlineLinkTo, _emberTemplateCompilerPluginsTransformOldClassBindingSyntax, _emberTemplateCompilerPluginsTransformQuotedBindingsIntoJustBindings, _emberTemplateCompilerPluginsDeprecateRenderModel, _emberTemplateCompilerPluginsDeprecateRender, _emberTemplateCompilerPluginsAssertReservedNamedArguments, _emberTemplateCompilerPluginsTransformActionSyntax, _emberTemplateCompilerPluginsTransformInputTypeSyntax, _emberTemplateCompilerPluginsTransformAttrsIntoArgs, _emberTemplateCompilerPluginsTransformEachInIntoEach, _emberTemplateCompilerPluginsTransformHasBlockSyntax) { - 'use strict'; - - exports.default = Object.freeze([_emberTemplateCompilerPluginsTransformOldBindingSyntax.default, _emberTemplateCompilerPluginsTransformItemClass.default, _emberTemplateCompilerPluginsTransformAngleBracketComponents.default, _emberTemplateCompilerPluginsTransformInputOnToOnEvent.default, _emberTemplateCompilerPluginsTransformTopLevelComponents.default, _emberTemplateCompilerPluginsTransformInlineLinkTo.default, _emberTemplateCompilerPluginsTransformOldClassBindingSyntax.default, _emberTemplateCompilerPluginsTransformQuotedBindingsIntoJustBindings.default, _emberTemplateCompilerPluginsDeprecateRenderModel.default, _emberTemplateCompilerPluginsDeprecateRender.default, _emberTemplateCompilerPluginsAssertReservedNamedArguments.default, _emberTemplateCompilerPluginsTransformActionSyntax.default, _emberTemplateCompilerPluginsTransformInputTypeSyntax.default, _emberTemplateCompilerPluginsTransformAttrsIntoArgs.default, _emberTemplateCompilerPluginsTransformEachInIntoEach.default, _emberTemplateCompilerPluginsTransformHasBlockSyntax.default]); + exports.default = Object.freeze([_emberTemplateCompilerPluginsTransformOldBindingSyntax.default, _emberTemplateCompilerPluginsTransformItemClass.default, _emberTemplateCompilerPluginsTransformAngleBracketComponents.default, _emberTemplateCompilerPluginsTransformInputOnToOnEvent.default, _emberTemplateCompilerPluginsTransformTopLevelComponents.default, _emberTemplateCompilerPluginsTransformInlineLinkTo.default, _emberTemplateCompilerPluginsTransformOldClassBindingSyntax.default, _emberTemplateCompilerPluginsTransformQuotedBindingsIntoJustBindings.default, _emberTemplateCompilerPluginsDeprecateRenderModel.default, _emberTemplateCompilerPluginsAssertReservedNamedArguments.default, _emberTemplateCompilerPluginsTransformActionSyntax.default, _emberTemplateCompilerPluginsTransformInputTypeSyntax.default, _emberTemplateCompilerPluginsTransformAttrsIntoArgs.default, _emberTemplateCompilerPluginsTransformEachInIntoEach.default, _emberTemplateCompilerPluginsTransformHasBlockSyntax.default]); }); enifed('ember-template-compiler/plugins/transform-action-syntax', ['exports'], function (exports) { /** @@ -10188,19 +10136,24 @@ enifed('ember-template-compiler/plugins/transform-attrs-into-args', ['exports'], this.syntax = null; } - function isAttrs(node) { - if (node.parts[0] === 'attrs') { - return true; + function isAttrs(node, symbols) { + var name = node.parts[0]; + + if (symbols.indexOf(name) !== -1) { + return false; } - var _this = node.parts[0]; - var attrs = node.parts[1]; + if (name === 'attrs') { + return true; + } - if (_this === null && attrs === 'attrs') { + if (name === null && node.parts[1] === 'attrs') { node.parts.shift(); node.original = node.original.slice(5); return true; } + + return false; } /** @@ -10213,9 +10166,21 @@ enifed('ember-template-compiler/plugins/transform-attrs-into-args', ['exports'], var traverse = _syntax.traverse; var b = _syntax.builders; + var stack = [[]]; + traverse(ast, { + Program: { + enter: function (node) { + var parent = stack[stack.length - 1]; + stack.push(parent.concat(node.blockParams)); + }, + exit: function (node) { + stack.pop(); + } + }, + PathExpression: function (node) { - if (isAttrs(node)) { + if (isAttrs(node, stack[stack.length - 1])) { var path = b.path(node.original.substr(6)); path.original = '@' + path.original; path.data = true; @@ -10942,6 +10907,7 @@ enifed('ember-template-compiler/plugins/transform-top-level-components', ['expor } var lastComponentNode = undefined; + var lastIndex = undefined; var nodeCount = 0; for (var i = 0; i < body.length; i++) { @@ -10959,6 +10925,7 @@ enifed('ember-template-compiler/plugins/transform-top-level-components', ['expor if (curr.type === 'ComponentNode' || curr.type === 'ElementNode') { lastComponentNode = curr; + lastIndex = i; } } @@ -11510,7 +11477,7 @@ enifed('ember-utils/guid', ['exports', 'ember-utils/intern'], function (exports, } } }); -enifed('ember-utils/index', ['exports', 'ember-utils/symbol', 'ember-utils/owner', 'ember-utils/assign', 'ember-utils/empty-object', 'ember-utils/dictionary', 'ember-utils/guid', 'ember-utils/intern', 'ember-utils/super', 'ember-utils/inspect', 'ember-utils/lookup-descriptor', 'ember-utils/invoke', 'ember-utils/make-array', 'ember-utils/apply-str', 'ember-utils/name', 'ember-utils/to-string'], function (exports, _emberUtilsSymbol, _emberUtilsOwner, _emberUtilsAssign, _emberUtilsEmptyObject, _emberUtilsDictionary, _emberUtilsGuid, _emberUtilsIntern, _emberUtilsSuper, _emberUtilsInspect, _emberUtilsLookupDescriptor, _emberUtilsInvoke, _emberUtilsMakeArray, _emberUtilsApplyStr, _emberUtilsName, _emberUtilsToString) { +enifed('ember-utils/index', ['exports', 'ember-utils/symbol', 'ember-utils/owner', 'ember-utils/assign', 'ember-utils/empty-object', 'ember-utils/dictionary', 'ember-utils/guid', 'ember-utils/intern', 'ember-utils/super', 'ember-utils/inspect', 'ember-utils/lookup-descriptor', 'ember-utils/invoke', 'ember-utils/make-array', 'ember-utils/apply-str', 'ember-utils/to-string'], function (exports, _emberUtilsSymbol, _emberUtilsOwner, _emberUtilsAssign, _emberUtilsEmptyObject, _emberUtilsDictionary, _emberUtilsGuid, _emberUtilsIntern, _emberUtilsSuper, _emberUtilsInspect, _emberUtilsLookupDescriptor, _emberUtilsInvoke, _emberUtilsMakeArray, _emberUtilsApplyStr, _emberUtilsToString) { /* This package will be eagerly parsed and should have no dependencies on external packages. @@ -11546,7 +11513,6 @@ enifed('ember-utils/index', ['exports', 'ember-utils/symbol', 'ember-utils/owner exports.tryInvoke = _emberUtilsInvoke.tryInvoke; exports.makeArray = _emberUtilsMakeArray.default; exports.applyStr = _emberUtilsApplyStr.default; - exports.NAME_KEY = _emberUtilsName.default; exports.toString = _emberUtilsToString.default; }); enifed('ember-utils/inspect', ['exports'], function (exports) { @@ -11779,11 +11745,6 @@ enifed("ember-utils/make-array", ["exports"], function (exports) { return Array.isArray(obj) ? obj : [obj]; } }); -enifed('ember-utils/name', ['exports', 'ember-utils/symbol'], function (exports, _emberUtilsSymbol) { - 'use strict'; - - exports.default = _emberUtilsSymbol.default('NAME_KEY'); -}); enifed('ember-utils/owner', ['exports', 'ember-utils/symbol'], function (exports, _emberUtilsSymbol) { /** @module ember @@ -11942,12 +11903,12 @@ enifed('ember-utils/symbol', ['exports', 'ember-utils/guid', 'ember-utils/intern // TODO: Investigate using platform symbols, but we do not // want to require non-enumerability for this API, which // would introduce a large cost. - - return _emberUtilsIntern.default(debugName + ' [id=' + _emberUtilsGuid.GUID_KEY + Math.floor(Math.random() * new Date()) + ']'); + var id = _emberUtilsGuid.GUID_KEY + Math.floor(Math.random() * new Date()); + return _emberUtilsIntern.default('__' + debugName + '__ [id=' + id + ']'); } }); -enifed('ember-utils/to-string', ['exports'], function (exports) { - 'use strict'; +enifed("ember-utils/to-string", ["exports"], function (exports) { + "use strict"; exports.default = toString; var objectToString = Object.prototype.toString; @@ -11958,7 +11919,7 @@ enifed('ember-utils/to-string', ['exports'], function (exports) { */ function toString(obj) { - if (obj && typeof obj.toString === 'function') { + if (obj && obj.toString) { return obj.toString(); } else { return objectToString.call(obj); @@ -11968,12 +11929,12 @@ enifed('ember-utils/to-string', ['exports'], function (exports) { enifed("ember/features", ["exports"], function (exports) { "use strict"; - exports.default = { "features-stripped-test": false, "ember-libraries-isregistered": false, "ember-runtime-computed-uniq-by": true, "ember-improved-instrumentation": false, "ember-runtime-enumerable-includes": true, "ember-string-ishtmlsafe": true, "ember-testing-check-waiters": true, "ember-metal-weakmap": false, "ember-glimmer-allow-backtracking-rerender": false, "ember-testing-resume-test": false, "mandatory-setter": true, "ember-glimmer-detect-backtracking-rerender": true }; + exports.default = { "features-stripped-test": false, "ember-libraries-isregistered": false, "ember-runtime-computed-uniq-by": true, "ember-improved-instrumentation": false, "ember-runtime-enumerable-includes": true, "ember-string-ishtmlsafe": true, "ember-testing-check-waiters": true, "ember-metal-weakmap": false, "ember-glimmer-allow-backtracking-rerender": true, "ember-testing-resume-test": false, "ember-glimmer-detect-backtracking-rerender": true, "mandatory-setter": true }; }); enifed("ember/version", ["exports"], function (exports) { "use strict"; - exports.default = "2.11.0-beta.2"; + exports.default = "2.10.2-with-backtracking"; }); enifed("glimmer-compiler/index", ["exports", "glimmer-compiler/lib/compiler", "glimmer-compiler/lib/template-visitor"], function (exports, _glimmerCompilerLibCompiler, _glimmerCompilerLibTemplateVisitor) { "use strict"; @@ -11984,7 +11945,7 @@ enifed("glimmer-compiler/index", ["exports", "glimmer-compiler/lib/compiler", "g // exported only for tests exports.TemplateVisitor = _glimmerCompilerLibTemplateVisitor.default; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItY29tcGlsZXIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1VBQ0UsVUFBVSwrQkFBVixVQUFVO1VBQUUsaUJBQWlCLCtCQUFqQixpQkFBaUI7OztVQUlYLGVBQWUsc0NBQTFCLE9BQU8iLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQge1xuICBwcmVjb21waWxlLCBQcmVjb21waWxlT3B0aW9uc1xufSBmcm9tIFwiLi9saWIvY29tcGlsZXJcIjtcblxuLy8gZXhwb3J0ZWQgb25seSBmb3IgdGVzdHNcbmV4cG9ydCB7IGRlZmF1bHQgYXMgVGVtcGxhdGVWaXNpdG9yIH0gZnJvbSAnLi9saWIvdGVtcGxhdGUtdmlzaXRvcic7XG4iXX0= + enifed("glimmer-compiler/lib/compiler", ["exports", "glimmer-syntax", "glimmer-compiler/lib/template-compiler"], function (exports, _glimmerSyntax, _glimmerCompilerLibTemplateCompiler) { "use strict"; @@ -12045,7 +12006,7 @@ enifed("glimmer-compiler/lib/compiler", ["exports", "glimmer-syntax", "glimmer-c return JSON.stringify(templateJSONObject); } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3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vbnM/OiBQcmVjb21waWxlT3B0aW9uczx7fT4pOiBUZW1wbGF0ZUphdmFzY3JpcHQge1xuICBsZXQgb3B0cyA9IG9wdGlvbnMgfHwge1xuICAgIGlkOiBkZWZhdWx0SWQoKSxcbiAgICBtZXRhOiB7fVxuICB9O1xuICBsZXQgYXN0ID0gcHJlcHJvY2VzcyhzdHJpbmcsIG9wdHMpO1xuICBsZXQgeyBibG9jaywgbWV0YSB9ID0gVGVtcGxhdGVDb21waWxlci5jb21waWxlKG9wdHMsIGFzdCk7XG4gIGxldCBpZEZuID0gb3B0cy5pZCB8fCBkZWZhdWx0SWQoKTtcbiAgbGV0IGJsb2NrSlNPTiA9IEpTT04uc3RyaW5naWZ5KGJsb2NrLnRvSlNPTigpKTtcbiAgbGV0IHRlbXBsYXRlSlNPTk9iamVjdDogU2VyaWFsaXplZFRlbXBsYXRlV2l0aExhenlCbG9jazx7fT4gPSB7XG4gICAgaWQ6IGlkRm4oSlNPTi5zdHJpbmdpZnkobWV0YSkgKyBibG9ja0pTT04pLFxuICAgIGJsb2NrOiBibG9ja0pTT04sXG4gICAgbWV0YVxuICB9O1xuXG4gIC8vIEpTT04gaXMgamF2YXNjcmlwdFxuICByZXR1cm4gSlNPTi5zdHJpbmdpZnkodGVtcGxhdGVKU09OT2JqZWN0KTtcbn1cbiJdfQ== + enifed("glimmer-compiler/lib/javascript-compiler", ["exports", "glimmer-util"], function (exports, _glimmerUtil) { "use strict"; @@ -12332,7 +12293,7 @@ enifed("glimmer-compiler/lib/javascript-compiler", ["exports", "glimmer-util"], exports.default = JavaScriptCompiler; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItY29tcGlsZXIvbGliL2phdmFzY3JpcHQtY29tcGlsZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBb0JBLEtBQUE7QUFBQSxpQkFBQSxLQUFBLEdBQUE7QUFDRSxnQkFBQSxDQ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BQYXJhbXMgfCBIYXNoPih2YWw6IFMpIHtcbiAgICB0aGlzLnZhbHVlcy5wdXNoKHZhbCk7XG4gIH1cblxuICBwb3BWYWx1ZTxUIGV4dGVuZHMgU3RhY2tWYWx1ZT4oKTogVCB7XG4gICAgYXNzZXJ0KHRoaXMudmFsdWVzLmxlbmd0aCwgXCJObyBleHByZXNzaW9uIGZvdW5kIG9uIHN0YWNrXCIpO1xuICAgIHJldHVybiB0aGlzLnZhbHVlcy5wb3AoKSBhcyBUO1xuICB9XG59XG4iXX0= + enifed("glimmer-compiler/lib/template-compiler", ["exports", "glimmer-compiler/lib/template-visitor", "glimmer-compiler/lib/javascript-compiler", "glimmer-util"], function (exports, _glimmerCompilerLibTemplateVisitor, _glimmerCompilerLibJavascriptCompiler, _glimmerUtil) { "use strict"; @@ -12784,7 +12745,7 @@ enifed("glimmer-compiler/lib/template-compiler", ["exports", "glimmer-compiler/l } } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItY29tcGlsZXIvbGliL3RlbXBsYXRlLWNvbXBpbGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQVVBLGFBQUEsY0FBQSxDQUF3QixLQUFLLEVBQUE7QUFDM0IsZUFBTyxLQUFLLENBQUMsT0FBTyxLQUFLLFNBQVMsSUFBSSxDQUFDLEtBQUssQ0FBQyxPQUFPLENBQUM7S0FDdEQ7O1FBRUQsZ0JBQUE7QUFpQkUsaUJBakJGLGdCQUFBLENBaUJjLE9BQTBCLEVBQUE7QUFOOUIsZ0JBQUEsQ0FBQSxVQUFVLEdBQUcsQ0FBQyxDQUFDO0FBQ2YsZ0JBQUEsQ0FBQSxXQUFXLEdBQWEsRUFBRSxDQUFDO0FBQzNCLGdCQUFBLENBQUEsT0FBTyxHQUFnQixJQUFJLENBQUM7QUFDNUIsZ0JBQUEsQ0FBQSxPQUFPLEdBQVUsRUFBRSxDQUFDO0FBQ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zZSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKGAke3R5cGV9IG9ubHkgdGFrZXMgYSBzaW5nbGUgcG9zaXRpb25hbCBhcmd1bWVudCAob24gbGluZSAke2xvYy5zdGFydC5saW5lfSlgKTtcbiAgfVxufVxuIl19 + enifed('glimmer-compiler/lib/template-visitor', ['exports'], function (exports) { 'use strict'; @@ -13016,7 +12977,7 @@ enifed('glimmer-compiler/lib/template-visitor', ['exports'], function (exports) return -1; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItY29tcGlsZXIvbGliL3RlbXBsYXRlLXZpc2l0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsUUFBSSxJQUFJLEdBQUcsS0FBSyxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUM7O1FBRWhDLEtBQUEsR0FBQSxTQUFBLEtBQUEsR0FBQTtBQUNTLFlBQUEsQ0FBQSxVQUFVLEdBQVcsSUFBSSxDQUFDO0FBQzFCLFlBQUEsQ0FBQSxRQUFRLEdBQVcsSUFBSSxDQUFDO0FBQ3hCLFlBQUEsQ0FBQSxVQUFVLEdBQVcsSUFBSSxDQUFDO0FBQzFCLFlBQUEsQ0FBQSxVQUFVLEdBQVcsSUFBSSxDQUFDO0FBQzFCLFlBQUEsQ0FBQSxrQkFBa0IsR0FBVyxDQUFDLENBQUM7QUFDL0IsWUFBQSxDQUFBLGFBQWEsR0FBVyxDQUFDLENBQUM7QUFDMUIsWUFBQSxDQUFBLE9BQU8sR0FBVSxFQUFFLENBQUM7QUFDcEIsWUFBQSxDQUFBLG1CQUFtQixHQUFhLElBQUksQ0FBQztBQUNyQyxZQUFBLENBQUEsT0FBTyxHQUFnQixJQUFJLENBQUM7S0FDcEM7O1FBRUQsV0FBQTtBQUNFLGlCQURGLFdBQUEsQ0FFWSxPQUFpQixFQUNTO2dCQUExQixNQUFNLHlEQUFnQixJQUFJOzt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mF5LCBza2lwcGluZ1xuLy8gb3ZlciBhbnkgbm9kZXMgd2hpY2ggZG8gbm90IHJlcHJlc2VudCBET00gbm9kZXMuXG5mdW5jdGlvbiBkb21JbmRleE9mKG5vZGVzLCBkb21Ob2RlKSB7XG4gIGxldCBpbmRleCA9IC0xO1xuXG4gIGZvciAobGV0IGkgPSAwOyBpIDwgbm9kZXMubGVuZ3RoOyBpKyspIHtcbiAgICBsZXQgbm9kZSA9IG5vZGVzW2ldO1xuXG4gICAgaWYgKG5vZGUudHlwZSAhPT0gJ1RleHROb2RlJyAmJiBub2RlLnR5cGUgIT09ICdFbGVtZW50Tm9kZScpIHtcbiAgICAgIGNvbnRpbnVlO1xuICAgIH0gZWxzZSB7XG4gICAgICBpbmRleCsrO1xuICAgIH1cblxuICAgIGlmIChub2RlID09PSBkb21Ob2RlKSB7XG4gICAgICByZXR1cm4gaW5kZXg7XG4gICAgfVxuICB9XG5cbiAgcmV0dXJuIC0xO1xufVxuIl19 + enifed("glimmer-compiler/lib/utils", ["exports"], function (exports) { "use strict"; @@ -13034,7 +12995,7 @@ enifed("glimmer-compiler/lib/utils", ["exports"], function (exports) { } } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItY29tcGlsZXIvbGliL3V0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsYUFBQSxjQUFBLENBQStCLFFBQVEsRUFBRSxPQUFPLEVBQUE7QUFDOUMsYUFBSyxJQUFJLENBQUMsR0FBQyxDQUFDLEVBQUUsQ0FBQyxHQUFDLE9BQU8sQ0FBQyxNQUFNLEVBQUUsQ0FBQyxHQUFDLENBQUMsRUFBRSxDQUFDLEVBQUUsRUFBRTtBQUN4QyxnQkFBSSxNQUFNLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQzNCLGdCQUFJLE1BQU0sR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDM0IsZ0JBQUksTUFBTSxFQUFFO0FBQ1Ysd0JBQVEsQ0FBQyxNQUFNLENBQUMsQ0FBQyxLQUFLLENBQUMsUUFBUSxFQUFFLE1BQU0sQ0FBQyxDQUFDO2FBQzFDLE1BQU07QUFDTCx3QkFBUSxDQUFDLE1BQU0sQ0FBQyxDQUFDLElBQUksQ0FBQyxRQUFRLENBQUMsQ0FBQzthQUNqQztTQUNGO0tBQ0YiLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZnVuY3Rpb24gcHJvY2Vzc09wY29kZXMoY29tcGlsZXIsIG9wY29kZXMpIHtcbiAgZm9yIChsZXQgaT0wLCBsPW9wY29kZXMubGVuZ3RoOyBpPGw7IGkrKykge1xuICAgIGxldCBtZXRob2QgPSBvcGNvZGVzW2ldWzBdO1xuICAgIGxldCBwYXJhbXMgPSBvcGNvZGVzW2ldWzFdO1xuICAgIGlmIChwYXJhbXMpIHtcbiAgICAgIGNvbXBpbGVyW21ldGhvZF0uYXBwbHkoY29tcGlsZXIsIHBhcmFtcyk7XG4gICAgfSBlbHNlIHtcbiAgICAgIGNvbXBpbGVyW21ldGhvZF0uY2FsbChjb21waWxlcik7XG4gICAgfVxuICB9XG59Il19 + enifed('glimmer-reference/index', ['exports', 'glimmer-reference/lib/reference', 'glimmer-reference/lib/const', 'glimmer-reference/lib/validators', 'glimmer-reference/lib/utils', 'glimmer-reference/lib/iterable'], function (exports, _glimmerReferenceLibReference, _glimmerReferenceLibConst, _glimmerReferenceLibValidators, _glimmerReferenceLibUtils, _glimmerReferenceLibIterable) { 'use strict'; @@ -13058,7 +13019,7 @@ enifed('glimmer-reference/index', ['exports', 'glimmer-reference/lib/reference', exports.IteratorSynchronizer = _glimmerReferenceLibIterable.IteratorSynchronizer; exports.IteratorSynchronizerDelegate = _glimmerReferenceLibIterable.I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GlkYXRvcnMnO1xuXG5leHBvcnQge1xuICBWZXJzaW9uZWRSZWZlcmVuY2UgYXMgUmVmZXJlbmNlLFxuICBWZXJzaW9uZWRQYXRoUmVmZXJlbmNlIGFzIFBhdGhSZWZlcmVuY2Vcbn0gZnJvbSAnLi9saWIvdmFsaWRhdG9ycyc7XG5cbmV4cG9ydCB7XG4gIHJlZmVyZW5jZUZyb21QYXJ0c1xufSBmcm9tICcuL2xpYi91dGlscyc7XG5cbmV4cG9ydCB7XG4gIEl0ZXJhdGlvbkl0ZW0sXG4gIEl0ZXJhdG9yLFxuICBJdGVyYWJsZSxcbiAgT3BhcXVlSXRlcmF0b3IsXG4gIE9wYXF1ZUl0ZXJhYmxlLFxuICBBYnN0cmFjdEl0ZXJhdG9yLFxuICBBYnN0cmFjdEl0ZXJhYmxlLFxuICBJdGVyYXRpb25BcnRpZmFjdHMsXG4gIFJlZmVyZW5jZUl0ZXJhdG9yLFxuICBJdGVyYXRvclN5bmNocm9uaXplcixcbiAgSXRlcmF0b3JTeW5jaHJvbml6ZXJEZWxlZ2F0ZVxufSBmcm9tICcuL2xpYi9pdGVyYWJsZSc7XG4iXX0= + enifed('glimmer-reference/lib/const', ['exports', 'glimmer-reference/lib/validators'], function (exports, _glimmerReferenceLibValidators) { 'use strict'; @@ -13083,7 +13044,7 @@ enifed('glimmer-reference/lib/const', ['exports', 'glimmer-reference/lib/validat return reference.tag === _glimmerReferenceLibValidators.CONSTANT_TAG; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2xpYi9jb25zdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztRQUdBLGNBQUE7QUFHRSxpQkFIRixjQUFBLENBR3dCLEtBQVEsRUFBQTtBQUFSLGdCQUFBLENBQUEsS0FBSyxHQUFMLEtBQUssQ0FBRztBQUZ2QixnQkFBQSxDQUFBLEdBQUcsa0NBSkgsWUFBWSxBQUltQixDQUFDO1NBRUo7O0FBSHJDLHNCQUFBLFdBS0UsS0FBSyxHQUFBLGlCQUFBO0FBQVEsbUJBQU8sSUFBSSxDQUFDLEtBQUssQ0FBQztTQUFFOztlQUxuQyxjQUFBOzs7OztBQVFBLGFBQUEsT0FBQSxDQUF3QixTQUFxQyxFQUFBO0FBQzNELGVBQU8sU0FBUyxDQUFDLEdBQUcsb0NBWmIsWUFBWSxBQVlrQixDQUFDO0tBQ3ZDIiwiZmlsZSI6ImNvbnN0LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQ09OU1RBTlRfVEFHLCBWZXJzaW9uZWRSZWZlcmVuY2UsIFJldmlzaW9uVGFnIH0gZnJvbSAnLi92YWxpZGF0b3JzJztcbmltcG9ydCB7IE9wYXF1ZSB9IGZyb20gJ2dsaW1tZXItdXRpbCc7XG5cbmV4cG9ydCBjbGFzcyBDb25zdFJlZmVyZW5jZTxUPiBpbXBsZW1lbnRzIFZlcnNpb25lZFJlZmVyZW5jZTxUPiB7XG4gIHB1YmxpYyB0YWc6IFJldmlzaW9uVGFnID0gQ09OU1RBTlRfVEFHO1xuXG4gIGNvbnN0cnVjdG9yKHByb3RlY3RlZCBpbm5lcjogVCkgeyB9XG5cbiAgdmFsdWUoKTogVCB7IHJldHVybiB0aGlzLmlubmVyOyB9XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBpc0NvbnN0KHJlZmVyZW5jZTogVmVyc2lvbmVkUmVmZXJlbmNlPE9wYXF1ZT4pOiBib29sZWFuIHtcbiAgcmV0dXJuIHJlZmVyZW5jZS50YWcgPT09IENPTlNUQU5UX1RBRztcbn1cbiJdfQ== + enifed("glimmer-reference/lib/iterable", ["exports", "glimmer-util"], function (exports, _glimmerUtil) { "use strict"; @@ -13359,11 +13320,11 @@ enifed("glimmer-reference/lib/iterable", ["exports", "glimmer-util"], function ( exports.IteratorSynchronizer = IteratorSynchronizer; }); -//# sourceMappingURL=data:application/json;base64,e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nQobm9kZS5rZXksIG5vZGUudmFsdWUsIG5vZGUubWVtbywgY3VycmVudCA/IGN1cnJlbnQua2V5IDogbnVsbCk7XG4gIH1cblxuICBwcml2YXRlIHN0YXJ0UHJ1bmUoKTogUGhhc2Uge1xuICAgIHRoaXMuY3VycmVudCA9IHRoaXMuYXJ0aWZhY3RzLmhlYWQoKTtcbiAgICByZXR1cm4gUGhhc2UuUHJ1bmU7XG4gIH1cblxuICBwcml2YXRlIG5leHRQcnVuZSgpOiBQaGFzZSB7XG4gICAgbGV0IHsgYXJ0aWZhY3RzLCB0YXJnZXQsIGN1cnJlbnQgfSA9IHRoaXM7XG5cbiAgICBpZiAoY3VycmVudCA9PT0gbnVsbCkge1xuICAgICAgcmV0dXJuIFBoYXNlLkRvbmU7XG4gICAgfVxuXG4gICAgbGV0IG5vZGUgPSBjdXJyZW50O1xuICAgIHRoaXMuY3VycmVudCA9IGFydGlmYWN0cy5uZXh0Tm9kZShub2RlKTtcblxuICAgIGlmIChub2RlLnNob3VsZFJlbW92ZSgpKSB7XG4gICAgICBhcnRpZmFjdHMucmVtb3ZlKG5vZGUpO1xuICAgICAgdGFyZ2V0LmRlbGV0ZShub2RlLmtleSk7XG4gICAgfSBlbHNlIHtcbiAgICAgIG5vZGUucmVzZXQoKTtcbiAgICB9XG5cbiAgICByZXR1cm4gUGhhc2UuUHJ1bmU7XG4gIH1cblxuICBwcml2YXRlIG5leHREb25lKCkge1xuICAgIHRoaXMudGFyZ2V0LmRvbmUoKTtcbiAgfVxufVxuIl19 + enifed("glimmer-reference/lib/reference", ["exports"], function (exports) { "use strict"; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2xpYi9yZWZlcmVuY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJyZWZlcmVuY2UuanMiLCJzb3VyY2VzQ29udGVudCI6W119 + enifed("glimmer-reference/lib/utils", ["exports"], function (exports) { "use strict"; @@ -13377,7 +13338,7 @@ enifed("glimmer-reference/lib/utils", ["exports"], function (exports) { return reference; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2xpYi91dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUdBLGFBQUEsa0JBQUEsQ0FBbUMsSUFBb0MsRUFBRSxLQUFlLEVBQUE7QUFDdEYsWUFBSSxTQUFTLEdBQUcsSUFBSSxDQUFDO0FBRXJCLGFBQUssSUFBSSxDQUFDLEdBQUMsQ0FBQyxFQUFFLENBQUMsR0FBQyxLQUFLLENBQUMsTUFBTSxFQUFFLENBQUMsRUFBRSxFQUFFO0FBQ2pDLHFCQUFTLEdBQUcsU0FBUyxDQUFDLEdBQUcsQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztTQUNyQztBQUVELGVBQU8sU0FBUyxDQUFDO0tBQ2xCIiwiZmlsZSI6InV0aWxzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgVmVyc2lvbmVkUGF0aFJlZmVyZW5jZSB9IGZyb20gJy4vdmFsaWRhdG9ycyc7XG5pbXBvcnQgeyBPcGFxdWUgfSBmcm9tICdnbGltbWVyLXV0aWwnO1xuXG5leHBvcnQgZnVuY3Rpb24gcmVmZXJlbmNlRnJvbVBhcnRzKHJvb3Q6IFZlcnNpb25lZFBhdGhSZWZlcmVuY2U8T3BhcXVlPiwgcGFydHM6IHN0cmluZ1tdKTogVmVyc2lvbmVkUGF0aFJlZmVyZW5jZTxPcGFxdWU+IHtcbiAgbGV0IHJlZmVyZW5jZSA9IHJvb3Q7XG5cbiAgZm9yIChsZXQgaT0wOyBpPHBhcnRzLmxlbmd0aDsgaSsrKSB7XG4gICAgcmVmZXJlbmNlID0gcmVmZXJlbmNlLmdldChwYXJ0c1tpXSk7XG4gIH1cblxuICByZXR1cm4gcmVmZXJlbmNlO1xufVxuIl19 + enifed("glimmer-reference/lib/validators", ["exports"], function (exports) { "use strict"; @@ -13722,7 +13683,7 @@ enifed("glimmer-reference/lib/validators", ["exports"], function (exports) { return value !== NOT_MODIFIED; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2xpYi92YWxpZGF0b3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O0FBa0JPLFFBQU0sUUFBUSxHQUFhLENBQUMsQ0FBQzs7QUFDN0IsUUFBTSxPQUFPLEdBQWMsQ0FBQyxDQUFDOztBQUM3QixRQUFNLFFBQVEsR0FBYSxHQUFHLENBQUM7OztRQUV0QyxXQUFBO2lCQUFBLFdBQUE7O0FBQUEsbUJBQUEsV0FHRSxRQUFRLEdBQUEsa0JBQUMsUUFBa0IsRUFBQTtBQUN6QixtQkFBTyxJQUFJLENBQUMsS0FBSyxFQUFFLEtBQUssUUFBUSxDQUFDO1NBQ2xDOztlQUxILFdBQUE7Ozs7O0FBUUEsUUFBSSxTQUFTLEdBQUcsT0FBTyxDQUFDOztRQUV4QixZQUFBOzhCQUFBLFlBQUE7O0FBR0UsaUJBSEYsWUFBQSxHQUdrQztnQkFBcEIsUUFBUSx5REFBRyxTQUFTOztBQUM5QixtQ0FBTyxDQUFDO0FBQ1IsZ0JBQUksQ0FBQyxRQUFRLEdBQUcsUUFBUSxDQUFDO1NBQzFCOztBQU5ILG9CQUFBLFdBUUUsS0FBSyxHQUFBLGlCQUFBO0FBQ0gsbUJBQU8sSUFBSSxDQUFDLFFBQVEsQ0FBQztTQUN0Qjs7QUFWSCxvQkFBQSxXQVlFLEtBQUssR0FBQSxpQkFBQTtBQUNILGdCQUFJLENBQUMsUUFBUSxHQUFHLEVBQUUsU0FBUyxDQUFDO1NBQzdCOztlQWRILFlBQUE7T0FBa0MsV0FB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NWMxNDVcIjtcblxuZXhwb3J0IGZ1bmN0aW9uIGlzTW9kaWZpZWQ8VD4odmFsdWU6IFZhbGlkYXRpb248VD4pOiB2YWx1ZSBpcyBUIHtcbiAgcmV0dXJuIHZhbHVlICE9PSBOT1RfTU9ESUZJRUQ7XG59XG4iXX0= + enifed('glimmer-runtime/index', ['exports', 'glimmer-runtime/lib/dom/interfaces', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/template', 'glimmer-runtime/lib/symbol-table', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/syntax/core', 'glimmer-runtime/lib/compiled/opcodes/builder', 'glimmer-runtime/lib/compiler', 'glimmer-runtime/lib/opcode-builder', 'glimmer-runtime/lib/compiled/blocks', 'glimmer-runtime/lib/dom/attribute-managers', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/compiled/expressions/function', 'glimmer-runtime/lib/helpers/get-dynamic-var', 'glimmer-runtime/lib/syntax/builtins/with-dynamic-vars', 'glimmer-runtime/lib/syntax/builtins/in-element', 'glimmer-runtime/lib/vm', 'glimmer-runtime/lib/upsert', 'glimmer-runtime/lib/environment', 'glimmer-runtime/lib/partial', 'glimmer-runtime/lib/component/interfaces', 'glimmer-runtime/lib/modifier/interfaces', 'glimmer-runtime/lib/dom/helper', 'glimmer-runtime/lib/builder', 'glimmer-runtime/lib/bounds'], function (exports, _glimmerRuntimeLibDomInterfaces, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibTemplate, _glimmerRuntimeLibSymbolTable, _glimmerRuntimeLibReferences, _glimmerRuntimeLibSyntaxCore, _glimmerRuntimeLibCompiledOpcodesBuilder, _glimmerRuntimeLibCompiler, _glimmerRuntimeLibOpcodeBuilder, _glimmerRuntimeLibCompiledBlocks, _glimmerRuntimeLibDomAttributeManagers, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerRuntimeLibCompiledExpressions, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibCompiledExpressionsFunction, _glimmerRuntimeLibHelpersGetDynamicVar, _glimmerRuntimeLibSyntaxBuiltinsWithDynamicVars, _glimmerRuntimeLibSyntaxBuiltinsInElement, _glimmerRuntimeLibVm, _glimmerRuntimeLibUpsert, _glimmerRuntimeLibEnvironment, _glimmerRuntimeLibPartial, _glimmerRuntimeLibComponentInterfaces, _glimmerRuntimeLibModifierInterfaces, _glimmerRuntimeLibDomHelper, _glimmerRuntimeLibBuilder, _glimmerRuntimeLibBounds) { 'use strict'; @@ -13823,7 +13784,7 @@ enifed('glimmer-runtime/index', ['exports', 'glimmer-runtime/lib/dom/interfaces' exports.Bounds = _glimmerRuntimeLibBounds.default; exports.ConcreteBounds = _glimmerRuntimeLibBounds.ConcreteBounds; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7VUFDZSxnQkFBZ0IsNEJBQTdCLFNBQVM7VUFDSSxlQUFlLDRCQUE1QixTQUFTO1VBQ0ssZ0JBQWdCLDRCQUE5QixVQUFVO1VBQ0csZUFBZSw0QkFBNUIsU0FBUztVQUNULDBCQUEwQiw0QkFBMUIsMEJBQTBCO1VBQzFCLFlBQVksNEJBQVosWUFBWTtVQUNaLFdBQVcsNEJBQVgsV0FBVztVQUNYLFdBQVcsNEJBQVgsV0FBVztVQUdPLGVBQWUsOEJBQTFCLE9BQU87VUFBcUIsZUFBZSw4QkFBZixlQUFlO1VBQUUsUUFBUSw4QkFBUixRQUFRO1VBRTFDLFdBQVcsaUNBQXRCLE9BQU87VUFFUCxjQUFjLGdDQUFkLGNBQWM7VUFBRSxtQkFBbUIsZ0NBQW5CLG1CQUFtQjtVQUFFLGtCQUFrQixnQ0FBbEIsa0JBQWtCO1VBQUUsb0JBQW9CLGdDQUFwQixvQkFBb0I7VU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O1xuXG5leHBvcnQge1xuICBNb2RpZmllck1hbmFnZXJcbn0gZnJvbSAnLi9saWIvbW9kaWZpZXIvaW50ZXJmYWNlcyc7XG5cbmV4cG9ydCB7IGRlZmF1bHQgYXMgRE9NQ2hhbmdlcywgRE9NQ2hhbmdlcyBhcyBJRE9NQ2hhbmdlcywgRE9NVHJlZUNvbnN0cnVjdGlvbiwgaXNXaGl0ZXNwYWNlLCBpbnNlcnRIVE1MQmVmb3JlIH0gZnJvbSAnLi9saWIvZG9tL2hlbHBlcic7XG5pbXBvcnQgICogYXMgU2ltcGxlIGZyb20gJy4vbGliL2RvbS9pbnRlcmZhY2VzJztcbmV4cG9ydCB7IFNpbXBsZSB9O1xuZXhwb3J0IHsgRWxlbWVudFN0YWNrLCBFbGVtZW50T3BlcmF0aW9ucyB9IGZyb20gJy4vbGliL2J1aWxkZXInO1xuZXhwb3J0IHsgZGVmYXVsdCBhcyBCb3VuZHMsIENvbmNyZXRlQm91bmRzIH0gZnJvbSAnLi9saWIvYm91bmRzJztcbiJdfQ== + enifed("glimmer-runtime/lib/bounds", ["exports"], function (exports) { "use strict"; @@ -13944,7 +13905,7 @@ enifed("glimmer-runtime/lib/bounds", ["exports"], function (exports) { return null; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvYm91bmRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O1FBVUEsTUFBQSxHQUNFLFNBREYsTUFBQSxDQUNxQixPQUF1QixFQUFTLFdBQXdCLEVBQUE7QUFBeEQsWUFBQSxDQUFBLE9BQU8sR0FBUCxPQUFPLENBQWdCO0FBQVMsWUFBQSxDQUFBLFdBQVcsR0FBWCxXQUFXLENBQWE7S0FBSTs7OztRQU9qRixhQUFBO0FBQ0UsaUJBREYsYUFBQSxDQUNzQixNQUFjLEVBQUE7QUFBZCxnQkFBQSxDQUFBLE1BQU0sR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ICBsZXQgcGFyZW50ID0gYm91bmRzLnBhcmVudEVsZW1lbnQoKTtcbiAgbGV0IGZpcnN0ID0gYm91bmRzLmZpcnN0Tm9kZSgpO1xuICBsZXQgbGFzdCA9IGJvdW5kcy5sYXN0Tm9kZSgpO1xuXG4gIGxldCBub2RlID0gZmlyc3Q7XG5cbiAgd2hpbGUgKG5vZGUpIHtcbiAgICBsZXQgbmV4dCA9IG5vZGUubmV4dFNpYmxpbmc7XG4gICAgcGFyZW50Lmluc2VydEJlZm9yZShub2RlLCByZWZlcmVuY2UpO1xuICAgIGlmIChub2RlID09PSBsYXN0KSByZXR1cm4gbmV4dDtcbiAgICBub2RlID0gbmV4dDtcbiAgfVxuXG4gIHJldHVybiBudWxsO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gY2xlYXIoYm91bmRzOiBCb3VuZHMpOiBTaW1wbGUuTm9kZSB7XG4gIGxldCBwYXJlbnQgPSBib3VuZHMucGFyZW50RWxlbWVudCgpO1xuICBsZXQgZmlyc3QgPSBib3VuZHMuZmlyc3ROb2RlKCk7XG4gIGxldCBsYXN0ID0gYm91bmRzLmxhc3ROb2RlKCk7XG5cbiAgbGV0IG5vZGUgPSBmaXJzdDtcblxuICB3aGlsZSAobm9kZSkge1xuICAgIGxldCBuZXh0ID0gbm9kZS5uZXh0U2libGluZztcbiAgICBwYXJlbnQucmVtb3ZlQ2hpbGQobm9kZSk7XG4gICAgaWYgKG5vZGUgPT09IGxhc3QpIHJldHVybiBuZXh0O1xuICAgIG5vZGUgPSBuZXh0O1xuICB9XG5cbiAgcmV0dXJuIG51bGw7XG59XG4iXX0= + enifed('glimmer-runtime/lib/builder', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-util', 'glimmer-runtime/lib/compiled/opcodes/dom'], function (exports, _glimmerRuntimeLibBounds, _glimmerUtil, _glimmerRuntimeLibCompiledOpcodesDom) { 'use strict'; @@ -14333,7 +14294,7 @@ enifed('glimmer-runtime/lib/builder', ['exports', 'glimmer-runtime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B0aGlzLmJvdW5kTGlzdC50YWlsKCkubGFzdE5vZGUoKTtcbiAgfVxuXG4gIG9wZW5FbGVtZW50KGVsZW1lbnQ6IEVsZW1lbnQpIHtcbiAgICBhc3NlcnQoZmFsc2UsICdDYW5ub3Qgb3BlbkVsZW1lbnQgZGlyZWN0bHkgaW5zaWRlIGEgYmxvY2sgbGlzdCcpO1xuICB9XG5cbiAgY2xvc2VFbGVtZW50KCkge1xuICAgIGFzc2VydChmYWxzZSwgJ0Nhbm5vdCBjbG9zZUVsZW1lbnQgZGlyZWN0bHkgaW5zaWRlIGEgYmxvY2sgbGlzdCcpO1xuICB9XG5cbiAgbmV3Tm9kZShub2RlOiBOb2RlKSB7XG4gICAgYXNzZXJ0KGZhbHNlLCAnQ2Fubm90IGNyZWF0ZSBhIG5ldyBub2RlIGRpcmVjdGx5IGluc2lkZSBhIGJsb2NrIGxpc3QnKTtcbiAgfVxuXG4gIG5ld0JvdW5kcyhib3VuZHM6IEJvdW5kcykge1xuICB9XG5cbiAgbmV3RGVzdHJveWFibGUoZDogRGVzdHJveWFibGUpIHtcbiAgfVxuXG4gIGZpbmFsaXplKHN0YWNrOiBFbGVtZW50U3RhY2spIHtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compat/inner-html-fix', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/dom/helper'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibDomHelper) { 'use strict'; @@ -14442,7 +14403,7 @@ enifed('glimmer-runtime/lib/compat/inner-html-fix', ['exports', 'glimmer-runtime return true; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGF0L2lubmVyLWh0bWwtZml4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQVNBLFFBQUksZ0JBQWdCLEdBQUc7QUFDckIsZ0JBQVEsRUFBRSxFQUFFLEt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kTm9kZXMubGVuZ3RoICE9PSAwKSB7XG4gICAgICAvLyBJdCB3b3JrZWQgYXMgZXhwZWN0ZWQsIG5vIGZpeCByZXF1aXJlZFxuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgfVxuXG4gIHJldHVybiB0cnVlO1xufVxuIl19 + enifed('glimmer-runtime/lib/compat/svg-inner-html-fix', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/dom/helper'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibDomHelper) { 'use strict'; @@ -14544,7 +14505,7 @@ enifed('glimmer-runtime/lib/compat/svg-inner-html-fix', ['exports', 'glimmer-run } } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGF0L3N2Zy1pbm5lci1odG1sLWZpeC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFHQSxRQUFNLGFBQWEsR0FBRyw0QkFBNEIsQ0FBQzs7Ozs7Ozs7Ozs7OztBQWFuRCxhQUFBLFVBQUEsQ0FBMkIsUUFBa0IsRUFBRSxlQUFrQyxFQUFFLFlBQW9CLEVBQUE7QUFDckcsWUFBSSxDQUFDLFFBQVEsRUFBRSxPQUFPLGVBQWUsQ0FBQztBQUV0QyxZQUFJLENBQUMsY0FBYyxDQUFDLFFBQVEsRUFBRSxZQUFZLENBQUMsRUFBRTtBQUMzQyxtQkFBTyxlQUFlLENBQUM7U0FDeEI7QUFFRCxZQUFJLEdBQUcsR0FBRyxRQUFRLENBQUMsYUFBYSxDQUFDLEtBQUssQ0FBQyxDQUFDO0FBRXhDO2tDQUFPLDZCQUFBOztxQkFBQSw2QkFBQTs7OztBQUFBLHlDQUFBLFdBQ0wsZ0JBQWdCLEdBQUEsMEJBQUMsTUFBbUIsRUFBRSxXQUFpQixFQUFFLElBQVksRUFBQTtBQUNuRSxvQkFBSSxJQUFJLEt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1bmN0aW9uIHNob3VsZEFwcGx5Rml4KGRvY3VtZW50LCBzdmdOYW1lc3BhY2UpIHtcbiAgbGV0IHN2ZyA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnROUyhzdmdOYW1lc3BhY2UsICdzdmcnKTtcblxuICB0cnkge1xuICAgIHN2Z1snaW5zZXJ0QWRqYWNlbnRIVE1MJ10oJ2JlZm9yZUVuZCcsICc8Y2lyY2xlPjwvY2lyY2xlPicpO1xuICB9IGNhdGNoIChlKSB7XG4gICAgLy8gSUUsIEVkZ2U6IFdpbGwgdGhyb3csIGluc2VydEFkamFjZW50SFRNTCBpcyB1bnN1cHBvcnRlZCBvbiBTVkdcbiAgICAvLyBTYWZhcmk6IFdpbGwgdGhyb3csIGluc2VydEFkamFjZW50SFRNTCBpcyBub3QgcHJlc2VudCBvbiBTVkdcbiAgfSBmaW5hbGx5IHtcbiAgICAvLyBGRjogT2xkIHZlcnNpb25zIHdpbGwgY3JlYXRlIGEgbm9kZSBpbiB0aGUgd3JvbmcgbmFtZXNwYWNlXG4gICAgaWYgKHN2Zy5jaGlsZE5vZGVzLmxlbmd0aCA9PT0gMSAmJiBzdmcuZmlyc3RDaGlsZC5uYW1lc3BhY2VVUkkgPT09IFNWR19OQU1FU1BBQ0UpIHtcbiAgICAgIC8vIFRoZSB0ZXN0IHdvcmtlZCBhcyBleHBlY3RlZCwgbm8gZml4IHJlcXVpcmVkXG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICAgIHN2ZyA9IG51bGw7XG5cbiAgICByZXR1cm4gdHJ1ZTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compat/text-node-merging-fix', ['exports'], function (exports) { // Patch: Adjacent text node merging fix // Browsers: IE, Edge, Firefox w/o inspector open @@ -14644,7 +14605,7 @@ enifed('glimmer-runtime/lib/compat/text-node-merging-fix', ['exports'], function return true; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpb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ICBwYXJlbnQucmVtb3ZlQ2hpbGQodGhpcy51c2VsZXNzQ29tbWVudCk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBib3VuZHM7XG4gICAgfVxuICB9O1xufVxuXG5mdW5jdGlvbiBzaG91bGRBcHBseUZpeChkb2N1bWVudCkge1xuICBsZXQgbWVyZ2luZ1RleHREaXYgPSA8SFRNTEVsZW1lbnQ+IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2RpdicpO1xuXG4gIG1lcmdpbmdUZXh0RGl2LmlubmVySFRNTCA9ICdmaXJzdCc7XG4gIG1lcmdpbmdUZXh0RGl2Lmluc2VydEFkamFjZW50SFRNTCgnYmVmb3JlRW5kJywgJ3NlY29uZCcpO1xuXG4gIGlmIChtZXJnaW5nVGV4dERpdi5jaGlsZE5vZGVzLmxlbmd0aCA9PT0gMikge1xuICAgIG1lcmdpbmdUZXh0RGl2ID0gbnVsbDtcbiAgICAvLyBJdCB3b3JrZWQgYXMgZXhwZWN0ZWQsIG5vIGZpeCByZXF1aXJlZFxuICAgIHJldHVybiBmYWxzZTtcbiAgfVxuXG4gIG1lcmdpbmdUZXh0RGl2ID0gbnVsbDtcblxuICByZXR1cm4gdHJ1ZTtcbn1cbiJdfQ== + enifed('glimmer-runtime/lib/compiled/blocks', ['exports', 'glimmer-runtime/lib/utils', 'glimmer-runtime/lib/compiler'], function (exports, _glimmerRuntimeLibUtils, _glimmerRuntimeLibCompiler) { 'use strict'; @@ -14750,7 +14711,7 @@ enifed('glimmer-runtime/lib/compiled/blocks', ['exports', 'glimmer-runtime/lib/u exports.Layout = Layout; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvYmxvY2tzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQVdBLGFBQUEsR0FJRSxTQUpGLGFBQUEsQ0FJYyxHQUFVLEVBQUUsT0FB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bGVkID0gdGhpcy5jb21waWxlZDtcbiAgICBpZiAoY29tcGlsZWQpIHJldHVybiBjb21waWxlZDtcblxuICAgIGxldCBvcHMgPSBuZXcgRW50cnlQb2ludENvbXBpbGVyKHRoaXMsIGVudikuY29tcGlsZSgpO1xuICAgIHJldHVybiB0aGlzLmNvbXBpbGVkID0gbmV3IENvbXBpbGVkQmxvY2sob3BzLCB0aGlzLnN5bWJvbFRhYmxlLnNpemUpO1xuICB9XG59XG5cbmV4cG9ydCBjbGFzcyBMYXlvdXQgZXh0ZW5kcyBUb3BMZXZlbFRlbXBsYXRlIHtcbiAgcHVibGljIGhhc05hbWVkUGFyYW1ldGVyczogYm9vbGVhbjtcbiAgcHVibGljIGhhc1lpZWxkczogYm9vbGVhbjtcbiAgY29uc3RydWN0b3IocHJvZ3JhbTogUHJvZ3JhbSwgc3ltYm9sVGFibGU6IFN5bWJvbFRhYmxlLCBwdWJsaWMgbmFtZWQ6IHN0cmluZ1tdLCBwdWJsaWMgeWllbGRzOiBzdHJpbmdbXSwgcHVibGljIGhhc1BhcnRpYWxzOiBib29sZWFuKSB7XG4gICAgc3VwZXIocHJvZ3JhbSwgc3ltYm9sVGFibGUpO1xuICAgIHRoaXMuaGFzTmFtZWRQYXJhbWV0ZXJzID0gISF0aGlzLm5hbWVkLmxlbmd0aDtcbiAgICB0aGlzLmhhc1lpZWxkcyA9ICEhdGhpcy55aWVsZHMubGVuZ3RoOztcbiAgfVxufVxuIl19 + enifed("glimmer-runtime/lib/compiled/expressions", ["exports"], function (exports) { "use strict"; @@ -14766,7 +14727,7 @@ enifed("glimmer-runtime/lib/compiled/expressions", ["exports"], function (export exports.CompiledExpression = CompiledExpression; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBR0Esa0JBQUE7aUJBQUEsa0JBQUE7O0FBQUEsMEJBQUEsV0FJRSxNQUFNLEdBQUEsa0JBQUE7QUFDSixnQ0FBa0IsSUFBSSxDQUFDLElBQUksQ0FBQyxXQUFXLEVBQUUsQ0FBRztTQUM3Qzs7ZUFOSCxrQkFBQSIsImZpbGUiOiJleHByZXNzaW9ucy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBWTSBmcm9tICcuLi92bS9hcHBlbmQnO1xuaW1wb3J0IHsgUGF0aFJlZmVyZW5jZSB9IGZyb20gJ2dsaW1tZXItcmVmZXJlbmNlJztcblxuZXhwb3J0IGFic3RyYWN0IGNsYXNzIENvbXBpbGVkRXhwcmVzc2lvbjxUPiB7XG4gIHR5cGU6IHN0cmluZztcbiAgYWJzdHJhY3QgZXZhbHVhdGUodm06IFZNKTogUGF0aFJlZmVyZW5jZTxUPjtcblxuICB0b0pTT04oKTogc3RyaW5nIHtcbiAgICByZXR1cm4gYFVOSU1QTDogJHt0aGlzLnR5cGUudG9VcHBlckNhc2UoKX1gO1xuICB9XG59XG4iXX0= + enifed('glimmer-runtime/lib/compiled/expressions/args', ['exports', 'glimmer-runtime/lib/compiled/expressions/positional-args', 'glimmer-runtime/lib/compiled/expressions/named-args', 'glimmer-runtime/lib/syntax/core', 'glimmer-reference'], function (exports, _glimmerRuntimeLibCompiledExpressionsPositionalArgs, _glimmerRuntimeLibCompiledExpressionsNamedArgs, _glimmerRuntimeLibSyntaxCore, _glimmerReference) { 'use strict'; @@ -14855,7 +14816,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/args', ['exports', 'glimmer-run exports.CompiledNamedArgs = _glimmerRuntimeLibCompiledExpressionsNamedArgs.CompiledNamedArgs; exports.EvaluatedNamedArgs = _glimmerRuntimeLibCompiledExpressionsNamedArgs.EvaluatedNamedArgs; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGls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JncywgRXZhbHVhdGVkTmFtZWRBcmdzIH07XG4iXX0= + enifed("glimmer-runtime/lib/compiled/expressions/concat", ["exports", "glimmer-reference"], function (exports, _glimmerReference) { "use strict"; @@ -14917,7 +14878,7 @@ enifed("glimmer-runtime/lib/compiled/expressions/concat", ["exports", "glimmer-r return String(value); } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvY29uY2F0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQU1BLGNBQUE7QUFHRSxpQkFIRixjQUFBLENBR3NCLEtBQW1DLEVBQUE7QUFBbkMsZ0JBQUEsQ0FBQSxLQUFLLEdBQUwsS0FBSyxDQUE4QjtBQUZoRCxnQkFBQSxDQUFBLElBQUksR0FBRyxRQUFRLENBQUM7U0FFb0M7O0FBSDdELHNCQUFBLFdBS0UsUUFBUSxHQUFBLGtCQUFDLEVBQU0sRUFBQTtBQUNiLGdCQUFJLEtBQUssR0FBNEIsSUFBSSxLQUFLLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQztBQUNsRSxpQkFBSyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUMsTUFBTSxFQUFFLENBQUMsRUFBRSxFQUFFO0FBQzFDLHFCQUFLLENBQUMsQ0FBQyxDQUFDLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxRQUFRLENBQUMsRUFBRSxDQUFDLENBQUM7YUFDdkM7QUFDRCxtQkFBTyxJQUFJLGVBQWUsQ0FBQyxLQUFLLENBQUMsQ0FBQztTQUNuQzs7QUFYSCxzQkFBQSxXQWFFLE1BQU0sR0FBQSxrQkFBQTtBQUNKLCtCQUFpQixJQUFJLENBQUMsS0FBSyxDQU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HtcbiAgICAgIHJldHVybiBwYXJ0cy5qb2luKCcnKTtcbiAgICB9XG5cbiAgICByZXR1cm4gbnVsbDtcbiAgfVxufVxuXG5mdW5jdGlvbiBjYXN0VG9TdHJpbmcodmFsdWUpIHtcbiAgaWYgKHR5cGVvZiB2YWx1ZVsndG9TdHJpbmcnXSAhPT0gJ2Z1bmN0aW9uJykge1xuICAgIHJldHVybiAnJztcbiAgfVxuXG4gIHJldHVybiBTdHJpbmcodmFsdWUpO1xufVxuIl19 + enifed('glimmer-runtime/lib/compiled/expressions/function', ['exports', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/compiled/expressions'], function (exports, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibCompiledExpressions) { 'use strict'; @@ -14974,7 +14935,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/function', ['exports', 'glimmer return CompiledFunctionExpression; })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvZnVuY3Rpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O3NCQVFBLElBQUE7O0FBQUEsYUFBQSxJQUFBLENBQWdDLElBQTJCLEVBQUE7QUFDekQsZUFBTyxJQUFJLHdCQUF3QixDQUFDLElBQUksQ0FBQyxDQUFDO0tBQzNDOztRQUVELHdCQUFBOzhCQUFBLHdCQUFBOztBQUlFLGlCQUpGLHdCQUFBLENBSWMsSUFBMkIsRUFBQTtBQUNyQyx3Q0FBTyxDQUFDO0FBSkgsZ0JBQUEsQ0FBQSxJQUFJLEdBQUcscUJBQXFCLENBQUM7QUFLbEMsZ0JBQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFDO1NBQ2xCOztBQVBILGdDQUFBLFdBU0UsT0FBTyxHQUFBLGlCQUFDLE1BQU0sRUFBRSxHQUF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dW5jdGlvbkV4cHJlc3Npb24odGhpcy5mdW5jLCBzeW1ib2xUYWJsZSk7XG4gIH1cbn1cblxuY2xhc3MgQ29tcGlsZWRGdW5jdGlvbkV4cHJlc3Npb248VD4gZXh0ZW5kcyBDb21waWxlZEV4cHJlc3Npb248VD4ge1xuICBwdWJsaWMgdHlwZSA9IFwiZnVuY3Rpb25cIjtcblxuICBjb25zdHJ1Y3Rvcihwcml2YXRlIGZ1bmM6IEZ1bmN0aW9uRXhwcmVzc2lvbjxUPiwgcHJpdmF0ZSBzeW1ib2xUYWJsZTogU3ltYm9sVGFibGUpIHtcbiAgICBzdXBlcigpO1xuICAgIHRoaXMuZnVuYyA9IGZ1bmM7XG4gIH1cblxuICBldmFsdWF0ZSh2bTogVk0pOiBQYXRoUmVmZXJlbmNlPFQ+IHtcbiAgICBsZXQgeyBmdW5jLCBzeW1ib2xUYWJsZSB9ID0gdGhpcztcbiAgICByZXR1cm4gZnVuYyh2bSwgc3ltYm9sVGFibGUpO1xuICB9XG5cbiAgdG9KU09OKCk6IHN0cmluZyB7XG4gICAgbGV0IHsgZnVuYyB9ID0gdGhpcztcblxuICAgIGlmIChmdW5jLm5hbWUpIHtcbiAgICAgIHJldHVybiBgXFxgJHtmdW5jLm5hbWV9KC4uLilcXGBgO1xuICAgIH0gZWxzZSB7XG4gICAgICByZXR1cm4gXCJgZnVuYyguLi4pYFwiO1xuICAgIH1cbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compiled/expressions/has-block', ['exports', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-runtime/lib/references'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerRuntimeLibReferences) { 'use strict'; @@ -15066,7 +15027,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/has-block', ['exports', 'glimme exports.CompiledInPartialGetBlock = CompiledInPartialGetBlock; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGlt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nN0cnVjdG9yKHByaXZhdGUgc3ltYm9sOiBudW1iZXIsIHByaXZhdGUgZGVidWc6IHN0cmluZykge1xuICB9XG5cbiAgZXZhbHVhdGUodm06IFZNKTogSW5saW5lQmxvY2sge1xuICAgIHJldHVybiB2bS5zY29wZSgpLmdldEJsb2NrKHRoaXMuc3ltYm9sKTtcbiAgfVxuXG4gIHRvSlNPTigpOiBzdHJpbmcge1xuICAgIHJldHVybiBgZ2V0LWJsb2NrKCQke3RoaXMuc3ltYm9sfSgke3RoaXMuZGVidWd9KSlgO1xuICB9XG59XG5cbmV4cG9ydCBjbGFzcyBDb21waWxlZEluUGFydGlhbEdldEJsb2NrIGltcGxlbWVudHMgQ29tcGlsZWRHZXRCbG9jayB7XG4gIGNvbnN0cnVjdG9yKHByaXZhdGUgc3ltYm9sOiBudW1iZXIsIHByaXZhdGUgbmFtZTogc3RyaW5nKSB7XG4gIH1cblxuICBldmFsdWF0ZSh2bTogVk0pOiBJbmxpbmVCbG9jayB7XG4gICAgbGV0IHsgc3ltYm9sLCBuYW1lIH0gPSB0aGlzO1xuICAgIGxldCBhcmdzID0gdm0uc2NvcGUoKS5nZXRQYXJ0aWFsQXJncyhzeW1ib2wpO1xuICAgIHJldHVybiBhcmdzLmJsb2Nrc1tuYW1lXTtcbiAgfVxuXG4gIHRvSlNPTigpOiBzdHJpbmcge1xuICAgIHJldHVybiBgZ2V0LWJsb2NrKCQke3RoaXMuc3ltYm9sfSgkQVJHUykuJHt0aGlzLm5hbWV9KSlgO1xuICB9XG59XG4iXX0= + enifed('glimmer-runtime/lib/compiled/expressions/helper', ['exports', 'glimmer-runtime/lib/compiled/expressions'], function (exports, _glimmerRuntimeLibCompiledExpressions) { 'use strict'; @@ -15097,7 +15058,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/helper', ['exports', 'glimmer-r exports.default = CompiledHelper; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnV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AnLi9hcmdzJztcbmltcG9ydCBWTSBmcm9tICcuLi8uLi92bS9hcHBlbmQnO1xuaW1wb3J0IHsgSGVscGVyIH0gZnJvbSAnLi4vLi4vZW52aXJvbm1lbnQnO1xuaW1wb3J0IFN5bWJvbFRhYmxlIGZyb20gJy4uLy4uL3N5bWJvbC10YWJsZSc7XG5pbXBvcnQgeyBQYXRoUmVmZXJlbmNlIH0gZnJvbSAnZ2xpbW1lci1yZWZlcmVuY2UnO1xuaW1wb3J0IHsgT3BhcXVlIH0gZnJvbSAnZ2xpbW1lci11dGlsJztcblxuZXhwb3J0IGRlZmF1bHQgY2xhc3MgQ29tcGlsZWRIZWxwZXIgZXh0ZW5kcyBDb21waWxlZEV4cHJlc3Npb248T3BhcXVlPiB7XG4gIHB1YmxpYyB0eXBlID0gXCJoZWxwZXJcIjtcblxuICBjb25zdHJ1Y3RvcihwdWJsaWMgbmFtZTogc3RyaW5nW10sIHB1YmxpYyBoZWxwZXI6IEhlbHBlciwgcHVibGljIGFyZ3M6IENvbXBpbGVkQXJncywgcHVibGljIHN5bWJvbFRhYmxlOiBTeW1ib2xUYWJsZSkge1xuICAgIHN1cGVyKCk7XG4gIH1cblxuICBldmFsdWF0ZSh2bTogVk0pOiBQYXRoUmVmZXJlbmNlPE9wYXF1ZT4ge1xuICAgIGxldCB7IGhlbHBlciB9ID0gdGhpcztcbiAgICByZXR1cm4gaGVscGVyKHZtLCB0aGlzLmFyZ3MuZXZhbHVhdGUodm0pLCB0aGlzLnN5bWJvbFRhYmxlKTtcbiAgfVxuXG4gIHRvSlNPTigpOiBzdHJpbmcge1xuICAgIHJldHVybiBgXFxgJHt0aGlzLm5hbWUuam9pbignLicpfSgkQVJHUylcXGBgO1xuICB9XG59XG4iXX0= + enifed('glimmer-runtime/lib/compiled/expressions/lookups', ['exports', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-reference'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerReference) { 'use strict'; @@ -15203,7 +15164,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/lookups', ['exports', 'glimmer- exports.CompiledInPartialName = CompiledInPartialName; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvbG9va3Vwcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFNQSxjQUFBOzhCQUFBLGNBQUE7O0FBV0UsaUJBWEYsY0FBQSxDQVlZLElBQWdDLEVBQ2hDLElBQWMsRUFBQTtBQUV0QiwwQ0FBTyxDQUFDO0FBSEEsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUE0QjtBQUNoQyxnQkFBQSxDQUFBLElBQUksR0FBSixJQUFJLENBQVU7QUFaakIsZ0JBQUEsQ0FBQSxJQUFJLEdBQUcsUUFBUSxDQUFDO1NBZXRCOztBQWhCSCxzQkFBQSxDQUdTLE1BQU0sR0FBQSxnQkFBQyxJQUFnQyxFQUFFLElBQWMsRUFBQTtBQUM1RCxnQkFBSSxJQUFJLENBQUMsTUFBTSxLQUFLLENBQUMsRUFBRTtBQUNyQix1QkFBTyxJQUFJLENBQUM7YUFDYixNQUFNO0FBQ0wsdUJBQU8sSUFBSSxJQUFJLENBQUMsSUFBSSxFQUFFLElBQUksQ0FBQyxDQUFDO2FBQzdCO1NBQ0Y7O0FBVEgsc0JBQUEsV0FrQkUsUUFBUSxHQUFBLGtCQUFDLEVBQU0sRUFBQTtnQkFDUCxJQUFJLEdBQVcsSUFBSSxDQUFuQixJQUFJO2dCQUFFLElBQUksR0FBSyxJQUFJLENBQWIsSUFBSTs7QUFDaEIsbUJBQU8sa0JBdEJGLGtCQUFrQixDQXNCRyxJQUFJLENBQUMsUUFBUSxDQUFDLEVBQUUsQ0FBQyxFQUFFLElBQUksQ0FBQyxDQUFDO1NBQ3BEOztBQXJCSCxzQkFBQSxXQXVCRSxNQUFNLEd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ime/lib/references', 'glimmer-runtime/lib/utils', 'glimmer-reference', 'glimmer-util'], function (exports, _glimmerRuntimeLibReferences, _glimmerRuntimeLibUtils, _glimmerReference, _glimmerUtil) { 'use strict'; @@ -15379,7 +15340,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/named-args', ['exports', 'glimm })(EvaluatedNamedArgs))(); exports.EVALUATED_EMPTY_NAMED_ARGS = EVALUATED_EMPTY_NAMED_ARGS; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvbmFtZWQtYXJncy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFPQSxpQkFBQTtBQXdCRSxpQkF4QkYsaUJBQUEsQ0F5QlcsSUFBYyxFQUNkLE1BQW9DLEVBQUE7QUFEcEMsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFVO0FBQ2QsZ0JBQUEsQ0FBQSxNQUFNLEdBQU4sTUFBTSxDQUE4QjtBQUUzQyxnQkFBSSxDQUFDLE1BQU0sR0FBRyxJQUFJLENBQUMsTUFBTSxDQUFDO0FBQzFCLHlCQS9CbUIsTUFBTSxDQStCbEIsSUFBSSxDQUFDLE1BQU0sS0FBSyxNQUFNLENBQUMsTUFBTSxFQUFFLDZDQUE2QyxDQUFDLENBQUM7U0FDdEY7O0FBOUJILHlCQUFBLENBQ1MsS0FBSyxHQUFBLGlCQUFBO0FBQ1YsbUJBQU8seUJBQXlCLENBQUM7U0FDbEM7O0FBSEgseUJBQUEsQ0FLUyxNQUFNLEdBQUEsZ0JBQUMsR0FBcUMsRUFBQTtBQUNqRCxnQkFBSSxJQUFJLEdBQUcsTUFBTSxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUM1QixnQkFBSSxNQUFNLEdBQUcsSUFBSSxDQUFDLE1BQU0sQ0FBQztBQUV6QixnQ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hcXVlPiB7XG4gICAgbGV0IHsga2V5cywgdmFsdWVzIH0gPSB0aGlzO1xuXG4gICAgbGV0IG91dCA9IGRpY3Q8T3BhcXVlPigpO1xuXG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICBsZXQga2V5ID0ga2V5c1tpXTtcbiAgICAgIGxldCByZWYgPSB2YWx1ZXNbaV07XG4gICAgICBvdXRba2V5XSA9IHJlZi52YWx1ZSgpO1xuICAgIH1cblxuICAgIHJldHVybiBvdXQ7XG4gIH1cbn1cblxuZXhwb3J0IGNvbnN0IEVWQUxVQVRFRF9FTVBUWV9OQU1FRF9BUkdTOiBFdmFsdWF0ZWROYW1lZEFyZ3MgPSBuZXcgKGNsYXNzIGV4dGVuZHMgRXZhbHVhdGVkTmFtZWRBcmdzIHtcbiAgY29uc3RydWN0b3IoKSB7XG4gICAgc3VwZXIoRU1QVFlfQVJSQVksIEVNUFRZX0FSUkFZLCBFTVBUWV9ESUNUKTtcbiAgfVxuXG4gIGdldCgpOiBQYXRoUmVmZXJlbmNlPE9wYXF1ZT4ge1xuICAgIHJldHVybiBVTkRFRklORURfUkVGRVJFTkNFO1xuICB9XG5cbiAgaGFzKGtleTogc3RyaW5nKTogYm9vbGVhbiB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG5cbiAgdmFsdWUoKTogRGljdDxPcGFxdWU+IHtcbiAgICByZXR1cm4gRU1QVFlfRElDVDtcbiAgfVxufSk7XG4iXX0= + enifed('glimmer-runtime/lib/compiled/expressions/positional-args', ['exports', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/utils', 'glimmer-reference'], function (exports, _glimmerRuntimeLibReferences, _glimmerRuntimeLibUtils, _glimmerReference) { 'use strict'; @@ -15497,7 +15458,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/positional-args', ['exports', ' })(EvaluatedPositionalArgs))(); exports.EVALUATED_EMPTY_POSITIONAL_ARGS = EVALUATED_E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aW9uYWxBcmdzID0gbmV3IChjbGFzcyBleHRlbmRzIEV2YWx1YXRlZFBvc2l0aW9uYWxBcmdzIHtcbiAgY29uc3RydWN0b3IoKSB7XG4gICAgc3VwZXIoRU1QVFlfQVJSQVkpO1xuICB9XG5cbiAgYXQoKTogUGF0aFJlZmVyZW5jZTxPcGFxdWU+IHtcbiAgICByZXR1cm4gVU5ERUZJTkVEX1JFRkVSRU5DRTtcbiAgfVxuXG4gIHZhbHVlKCk6IE9wYXF1ZVtdIHtcbiAgICByZXR1cm4gdGhpcy52YWx1ZXM7XG4gIH1cbn0pO1xuIl19 + enifed('glimmer-runtime/lib/compiled/expressions/value', ['exports', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-runtime/lib/references'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerRuntimeLibReferences) { 'use strict'; @@ -15523,7 +15484,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/value', ['exports', 'glimmer-ru exports.default = CompiledValue; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvdmFsdWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBSUEsYUFBQTs4QkFBQSxhQUFBOztBQUlFLGlCQUpGLGFBQUEsQ0FJYyxLQUFRLEVBQUE7QUFDbEIsMENBQU8sQ0FBQztBQUpILGdCQUFBLENBQUEsSUFBSSxHQUFHLE9BQU8sQ0FBQztBQUtwQixnQkFBSSxDQUFDLFNBQVMsR0FBRyw2QkFSRCxrQkFBa0IsQ0FRRSxNQUFNLENBQUMsS0FBWSxDQUFDLENBQUM7U0FDMUQ7O0FBUEgscUJBQUEsV0FTRSxRQUFRLEdBQUEsa0JBQUMsRUFBTSxFQUFBO0FBQ2IsbUJBQU8sSUFBSSxDQUFDLFNBQVMsQ0FBQztTQUN2Qjs7QUFYSCxxQkFBQSxXQWF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exports', 'glimmer-runtime/lib/compiled/opcodes/component', 'glimmer-runtime/lib/compiled/opcodes/partial', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-runtime/lib/compiled/opcodes/dom', 'glimmer-runtime/lib/compiled/opcodes/lists', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-util', 'glimmer-runtime/lib/utils'], function (exports, _glimmerRuntimeLibCompiledOpcodesComponent, _glimmerRuntimeLibCompiledOpcodesPartial, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerRuntimeLibCompiledOpcodesDom, _glimmerRuntimeLibCompiledOpcodesLists, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerUtil, _glimmerRuntimeLibUtils) { 'use strict'; @@ -15928,7 +15889,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/builder', ['exports', 'glimmer-runt exports.default = OpcodeBuilder; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy9idWlsZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQXlCQSwrQkFBQTtBQUVFLGlCQUZGLCtCQUFBLENBRXdCLEtBQWlDLEVBQUE7QUFBakMsZ0JBQUEsQ0FBQSxLQUFLLEdBQUwsS0FBSyxDQUE0QjtTQUFJOztBQUY3RCx1Q0FBQSxXQVFFLE9BQU8sR0FBQSxtQkFBQTtBQUNMLG1CQUFPLElBQUksQ0FBQyxLQUFLLENBQUMsT0FBTyxFQUFFLENBQUM7U0FDN0I7O0FBVkgsdUNBQUEsV0FZRSxNQUFNLEdBQUEsZ0JBQW1CLE1BQVMsRUFBQTtBQUNoQyxnQkFBSSxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUM7U0FDM0I7O0FBZEgsdUNBQUEsV0FnQkUsY0FBYyxHQUFBLHdCQUFDLElBQVksRUFBQTtBQUN6Qix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iAgICB0aGlzLnN0b3BMYWJlbHMoKTtcbiAgfVxufVxuXG5leHBvcnQgdHlwZSBCbG9ja0NhbGxiYWNrID0gKGRzbDogT3Bjb2RlQnVpbGRlciwgQkVHSU46IExhYmVsLCBFTkQ6IExhYmVsKSA9PiB2b2lkO1xuIl19 + enifed('glimmer-runtime/lib/compiled/opcodes/component', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-reference'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerReference) { 'use strict'; @@ -16206,7 +16167,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/component', ['exports', 'glimmer-ru exports.CloseComponentOpcode = CloseComponentOpcode; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy9jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBVUEsbUNBQUE7OEJBQUEsbUNBQUE7O0FBQUEsaUJBQUEsbUNBQUEsR0FBQTtBQUF5RCxnQ0FBQSxTQUFBLENBQUEsQ0FBTTtBQUN0RCxnQkFBQSxDQUFBLElBQUksR0FBRyxrQ0FBa0MsQ0FBQztTQXFCbEQ7O0FBdEJELDJDQUFBLFdBR0UsUUFBUSxHQUFBLGtCQUFDLEVBQU0sRUFBQTtBQUNiLGdCQUFJLFNBQVMsR0FBRyxFQUFFLENBQUMsS0FBSyxDQUFDLFVBQVUsRUFBa0MsQ0FBQztBQUN0RSxnQkFBSSxLQUFLLEdBQUcsa0JBUitDLE9BQU8sQ0FROUMsU0FBUyxDQUFDLEdBQUcsU0FBUyxHQUFHLHNCQVJYLGNBQWMsQ0FRZ0IsU0FBUyxDQUFDLENBQUM7QUFDM0UsZ0JBQUksVUFBVSxHQUFHLEtBQUssR0FBRyxLQUFLLENBQUMsSUF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ICAgIG1hbmFnZXIuZGlkVXBkYXRlTGF5b3V0KGNvbXBvbmVudCwgYm91bmRzKTtcblxuICAgIHZtLmVudi5kaWRVcGRhdGUoY29tcG9uZW50LCBtYW5hZ2VyKTtcbiAgfVxufVxuXG5leHBvcnQgY2xhc3MgQ2xvc2VDb21wb25lbnRPcGNvZGUgZXh0ZW5kcyBPcGNvZGUge1xuICBwdWJsaWMgdHlwZSA9IFwiY2xvc2UtY29tcG9uZW50XCI7XG5cbiAgZXZhbHVhdGUodm06IFZNKSB7XG4gICAgdm0ucG9wU2NvcGUoKTtcbiAgICB2bS5wb3BEeW5hbWljU2NvcGUoKTtcbiAgICB2bS5jb21taXRDYWNoZUdyb3VwKCk7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/compiled/opcodes/content', ['exports', 'glimmer-runtime/lib/upsert', 'glimmer-runtime/lib/component/interfaces', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/vm/update', 'glimmer-reference', 'glimmer-util', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/builder', 'glimmer-runtime/lib/compiler', 'glimmer-runtime/lib/compiled/opcodes/builder', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/syntax/core'], function (exports, _glimmerRuntimeLibUpsert, _glimmerRuntimeLibComponentInterfaces, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibVmUpdate, _glimmerReference, _glimmerUtil, _glimmerRuntimeLibBounds, _glimmerRuntimeLibBuilder, _glimmerRuntimeLibCompiler, _glimmerRuntimeLibCompiledOpcodesBuilder, _glimmerRuntimeLibReferences, _glimmerRuntimeLibSyntaxCore) { 'use strict'; @@ -16734,7 +16695,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/content', ['exports', 'glimmer-runt return GuardedTrustingUpdateOpcode; })(GuardedUpdateOpcode); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tc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ogVXBzZXJ0KTogVXBkYXRpbmdPcGNvZGUge1xuICAgIHJldHVybiBuZXcgR3VhcmRlZFRydXN0aW5nVXBkYXRlT3Bjb2RlKHJlZmVyZW5jZSwgY2FjaGUsIGJvdW5kcywgdXBzZXJ0LCB0aGlzLCB2bS5jYXB0dXJlKCkpO1xuICB9XG59XG5cbmNsYXNzIEd1YXJkZWRUcnVzdGluZ1VwZGF0ZU9wY29kZSBleHRlbmRzIEd1YXJkZWRVcGRhdGVPcGNvZGU8VHJ1c3RpbmdJbnNlcnRpb24+IHtcbiAgdHlwZSA9ICd0cnVzdGluZy11cGRhdGUnO1xuXG4gIHByb3RlY3RlZCBpbnNlcnQoZG9tOiBET01UcmVlQ29uc3RydWN0aW9uLCBjdXJzb3I6IEN1cnNvciwgdmFsdWU6IFRydXN0aW5nSW5zZXJ0aW9uKTogVXBzZXJ0IHtcbiAgICByZXR1cm4gdHJ1c3RpbmdJbnNlcnQoZG9tLCBjdXJzb3IsIHZhbHVlKTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compiled/opcodes/dom', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/compiled/opcodes/vm'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibReferences, _glimmerRuntimeLibCompiledOpcodesVm) { 'use strict'; @@ -17518,7 +17479,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/dom', ['exports', 'glimmer-runtime/ exports.CommentOpcode = CommentOpcode; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy9kb20udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBd0JBLFVBQUE7OEJBQUEsVUFBQTs7QUFHRSxpQkFIRixVQUFBLENBR3NCLElBQVksR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zcyBDb21tZW50T3Bjb2RlIGV4dGVuZHMgT3Bjb2RlIHtcbiAgcHVibGljIHR5cGUgPSBcImNvbW1lbnRcIjtcblxuICBjb25zdHJ1Y3RvcihwdWJsaWMgY29tbWVudDogc3RyaW5nKSB7XG4gICAgc3VwZXIoKTtcbiAgfVxuXG4gIGV2YWx1YXRlKHZtOiBWTSkge1xuICAgIHZtLnN0YWNrKCkuYXBwZW5kQ29tbWVudCh0aGlzLmNvbW1lbnQpO1xuICB9XG5cbiAgdG9KU09OKCk6IE9wY29kZUpTT04ge1xuICAgIHJldHVybiB7XG4gICAgICBndWlkOiB0aGlzLl9ndWlkLFxuICAgICAgdHlwZTogdGhpcy50eXBlLFxuICAgICAgYXJnczogW0pTT04uc3RyaW5naWZ5KHRoaXMuY29tbWVudCldXG4gICAgfTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compiled/opcodes/lists', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-util', 'glimmer-reference'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerUtil, _glimmerReference) { 'use strict'; @@ -17668,7 +17629,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/lists', ['exports', 'glimmer-runtim exports.NextIterOpcode = NextIterOpcode; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy9saXN0cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFPQSx5QkFBQTtBQUlFLGlCQUpGLHlCQUFBLENBSWMsU0FBNkIsRUFBQTtBQUN2QyxnQkFBSSxDQUFDLEdBQUcsR0FBRyxTQUFTLENBQUMsR0FBRyxDQUFDO0FBQ3pCLGdCQUFJLENBQUMsU0FBUyxHQUFHLFNBQVMsQ0FBQztTQUM1Qjs7QUFQSCx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b25hbChbaXRlbS52YWx1ZSwgaXRlbS5tZW1vXSkpO1xuICAgIH0gZWxzZSB7XG4gICAgICB2bS5mcmFtZS5zZXRDb25kaXRpb24oRkFMU0VfUkVGKTtcbiAgICAgIHZtLmdvdG8odGhpcy5lbmQpO1xuICAgIH1cbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compiled/opcodes/partial', ['exports', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/opcodes/vm'], function (exports, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledOpcodesVm) { 'use strict'; @@ -17775,7 +17736,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/partial', ['exports', 'glimmer-util exports.EvaluatePartialOpcode = EvaluatePartialOpcode; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy9wYXJ0aWFsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQVNBLGlDQUFBOzhCQUFBLGlDQUFBOztBQUdFLGlCQUhGLGlDQUFBLENBR3NCLFdBQXdCLEVBQUE7QUFDMUMsOEJBQU8sQ0FBQztBQURVLGdCQUFBLENBQUEsV0FBVyxHQUFYLFdBQVcsQ0FBYTtBQUZyQyxnQkFBQSxDQUFBLElBQUksR0FBRyxnQ0FBZ0MsQ0FBQztTQUk5Qzs7QUFMSCx5Q0FBQSxXQU9FLFFBQVEsR0FBQSxrQkFBQyxFQUFNLEVBQUE7QUFDYixnQkFBSSxHQUFHLEdBQUcsRUFBRSxDQUFDLEdBQUcsQ0FBQztnQkFDWCxXQUFXLEdBQUssSUFBSSxDQUFwQixXQUFXOztBQUVqQixxQkFBQSxhQUFBLENBQXVCLElBQVksRUFBQTtBQUNqQyxvQkFBSSxVQUFVLEdBQUcsTUFBTSxDQUFDLElBQUks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sb2NrPigpO1xuXG4gIGNvbnN0cnVjdG9yKHByaXZhdGUgc3ltYm9sVGFibGU6IFN5bWJvbFRhYmxlKSB7XG4gICAgc3VwZXIoKTtcbiAgfVxuXG4gIGV2YWx1YXRlKHZtOiBWTSkge1xuICAgIGxldCB7IHRlbXBsYXRlIH0gPSB2bS5mcmFtZS5nZXRJbW1lZGlhdGU8UGFydGlhbERlZmluaXRpb248T3BhcXVlPj4oKTtcblxuICAgIGxldCBibG9jayA9IHRoaXMuY2FjaGVbdGVtcGxhdGUuaWRdO1xuXG4gICAgaWYgKCFibG9jaykge1xuICAgICAgYmxvY2sgPSB0ZW1wbGF0ZS5hc1BhcnRpYWwodGhpcy5zeW1ib2xUYWJsZSk7XG4gICAgfVxuXG4gICAgdm0uaW52b2tlUGFydGlhbChibG9jayk7XG4gIH1cblxuICB0b0pTT04oKTogT3Bjb2RlSlNPTiB7XG4gICAgcmV0dXJuIHtcbiAgICAgIGd1aWQ6IHRoaXMuX2d1aWQsXG4gICAgICB0eXBlOiB0aGlzLnR5cGUsXG4gICAgICBhcmdzOiBbXCIkT1BFUkFORFwiXVxuICAgIH07XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/compiled/opcodes/vm', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/references', 'glimmer-reference', 'glimmer-util'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibReferences, _glimmerReference, _glimmerUtil) { 'use strict'; @@ -18437,7 +18398,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/vm', ['exports', 'glimmer-runtime/l exports.DidModifyOpcode = DidModifyOpcode; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy92bS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFXQSxvQkFBQTs4QkFBQSxvQkFBQTs7QUF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ICBzdXBlcigpO1xuICAgIHRoaXMudGFnID0gQ09OU1RBTlRfVEFHO1xuICB9XG5cbiAgZXZhbHVhdGUoKSB7XG4gICAgdGhpcy50YXJnZXQuZGlkTW9kaWZ5KCk7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/compiler', ['exports', 'glimmer-util', 'glimmer-runtime/lib/utils', 'glimmer-runtime/lib/syntax/core', 'glimmer-runtime/lib/compiled/blocks', 'glimmer-runtime/lib/compiled/expressions/function', 'glimmer-runtime/lib/compiled/opcodes/builder'], function (exports, _glimmerUtil, _glimmerRuntimeLibUtils, _glimmerRuntimeLibSyntaxCore, _glimmerRuntimeLibCompiledBlocks, _glimmerRuntimeLibCompiledExpressionsFunction, _glimmerRuntimeLibCompiledOpcodesBuilder) { 'use strict'; @@ -18869,7 +18830,7 @@ enifed('glimmer-runtime/lib/compiler', ['exports', 'glimmer-util', 'glimmer-runt exports.CompileIntoList = CompileIntoList; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7UUFrQ0EsUUFBQTtBQUlFLGlCQUpGLFFBQUEsQ0FJd0IsS0FBWSxFQUFTLEdBQWdCLEVBQUE7QUFBckMsZ0JBQUEsQ0FBQSxLQUFLLEdBQUwsS0FBSyxDQUFPO0FBQVMsZ0JBQUEsQ0FBQSxHQUFHLEdBQUgsR0FBRyxDQUFhO0FBQ3pELGdCQUFJLENBQUMsT0FBTyxHQUFHLEtBQUssQ0FBQyxPQUFPLENBQUMsSUFBSSxFQUFFLENBQUM7QUFDcEMsZ0JBQUksQ0FBQyxXQUFXLEdBQUcsS0FBSyxDQUFDLFdBQVcsQ0FBQztTQUN0Qzs7QUFQSCxnQkFBQSxXQVNZLGdCQUFnQixHQUFBLDBCQUFDLFNBQTBCLEVBQUUsR0FBcUIsRUFB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ed('glimmer-runtime/lib/component/interfaces', ['exports'], function (exports) { 'use strict'; @@ -18889,7 +18850,7 @@ enifed('glimmer-runtime/lib/component/interfaces', ['exports'], function (export exports.ComponentDefinition = ComponentDefinition; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcG9uZW50L2ludGVyZmFjZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQXFHQSxRQUFNLDBCQUEwQixHQUFHLGdFQUFnRSxDQUFDOztBQUVwRyxhQUFBLHFCQUFBLENBQXNDLEdBQVEsRUFBQTtBQUM1QyxlQUFPLE9BQU8sR0FBRyxLQUFLLFFBQVEsSUFBSSxHQUFHLElBQUksR0FBRyxDQUFDLDBCQUEwQixDQUFDLENBQUM7S0FDMUU7O1FBRUQsbUJBQUEsR0FPRSxTQVBGLG1CQUFBLENBT2MsSUFBWSxFQUFFLE9BQTRCLEVBQUUsY0FBOEIsRUFBQTtBQUY5RSxZQUFBLENBQUMsZ0VBQWdFLENBQUMsR0FBRyxJQUFJLENBQUM7QUFHaEYsWUFBSSxDQUFDLElBQUksR0FBRyxJQUFJLENBQUM7QUFDakIsWUFBSSxDQUFDLE9BQU8sR0FBRyxPQUFPLENBQUM7QUFDdkIsWUFBSSxDQUFDLGNBQWMsR0FBRyxjQUFjLENBQUM7S0FDdEMiLCJmaWxlIjoiaW50ZXJmYWNlcy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEV2YWx1YXRlZEFyZ3MgfSBmcm9tICcuLi9jb21waWxlZC9leHByZXNzaW9ucy9hcmdzJztcbmltcG9ydCB7IEZ1bmN0aW9uRXhwcmVzc2lvbiB9IGZyb20gJy4uL2NvbXBpbGVkL2V4cHJlc3Npb25zL2Z1bmN0aW9uJztcbmltcG9ydCB7IExheW91dCwgQ29tcGlsZWRCbG9jayB9IGZyb20gJy4uL2NvbXBpbGVkL2Jsb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MmMwYWM3MmJmY2Q0XSddID0gdHJ1ZTtcblxuICBjb25zdHJ1Y3RvcihuYW1lOiBzdHJpbmcsIG1hbmFnZXI6IENvbXBvbmVudE1hbmFnZXI8VD4sIENvbXBvbmVudENsYXNzOiBDb21wb25lbnRDbGFzcykge1xuICAgIHRoaXMubmFtZSA9IG5hbWU7XG4gICAgdGhpcy5tYW5hZ2VyID0gbWFuYWdlcjtcbiAgICB0aGlzLkNvbXBvbmVudENsYXNzID0gQ29tcG9uZW50Q2xhc3M7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/dom/attribute-managers', ['exports', 'glimmer-runtime/lib/dom/sanitized-values', 'glimmer-runtime/lib/dom/props', 'glimmer-runtime/lib/dom/helper', 'glimmer-runtime/lib/compiled/opcodes/content'], function (exports, _glimmerRuntimeLibDomSanitizedValues, _glimmerRuntimeLibDomProps, _glimmerRuntimeLibDomHelper, _glimmerRuntimeLibCompiledOpcodesContent) { 'use strict'; @@ -19145,7 +19106,7 @@ enifed('glimmer-runtime/lib/dom/attribute-managers', ['exports', 'glimmer-runtim return SafeAttributeManager; })(AttributeManager); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL2F0dHJpYnV0ZS1tYW5hZ2Vycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7OztBQVlBLGFBQUEsZUFBQSxDQUFnQyxPQUF1QixFQUFFLElBQVksRUFBRSxVQUFtQixFQUFFLFNBQWlCLEVBQUE7QUFDM0csWUFBSSxPQUFPLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQztBQUM5QixZQUFJLEtBQUssR0FBRyxPQUFPLENBQUMsWUFBWSxpQ0FOekIsYUFBYSxBQU04QixDQUFDO0FBRW5ELFlBQUksS0FBSyxFQUFFO0FBQ1QsbUJBQU8sd0JBQXdCLENBQUMsT0FBTyxFQUFFLElBQUksQ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uaXRpemVBdHRyaWJ1dGVWYWx1ZShlbnYsIGVsZW1lbnQsIHRoaXMuYXR0ciwgdmFsdWUpKTtcbiAgfVxuXG4gIHVwZGF0ZUF0dHJpYnV0ZShlbnY6IEVudmlyb25tZW50LCBlbGVtZW50OiBFbGVtZW50LCB2YWx1ZTogT3BhcXVlLCBuYW1lc3BhY2U/OiBET01OYW1lc3BhY2UpIHtcbiAgICBzdXBlci51cGRhdGVBdHRyaWJ1dGUoZW52LCBlbGVtZW50LCBzYW5pdGl6ZUF0dHJpYnV0ZVZhbHVlKGVudiwgZWxlbWVudCwgdGhpcy5hdHRyLCB2YWx1ZSkpO1xuICB9XG59XG4iXX0= + enifed('glimmer-runtime/lib/dom/helper', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/compat/inner-html-fix', 'glimmer-runtime/lib/compat/svg-inner-html-fix', 'glimmer-runtime/lib/compat/text-node-merging-fix', 'glimmer-runtime/lib/dom/interfaces'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibCompatInnerHtmlFix, _glimmerRuntimeLibCompatSvgInnerHtmlFix, _glimmerRuntimeLibCompatTextNodeMergingFix, _glimmerRuntimeLibDomInterfaces) { 'use strict'; @@ -19398,7 +19359,7 @@ enifed('glimmer-runtime/lib/dom/helper', ['exports', 'glimmer-runtime/lib/bounds exports.DOMTreeConstruction = DOMTreeConstruction; exports.DOMNamespace = _glimmerRuntimeLibDomInterfaces.Namespace; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL2hlbHBlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFlTyxRQUFNLGFBQWEsR0FBRyw0QkFBNEIsQ0FBQzs7O0FBRzFELFFBQU0sc0JBQXNCLEdBQUcsRUFBRSxhQUFhLEVBQUUsQ0FBQyxFQUFFLElBQUksRUFBRSxDQUFDLEVBQUUsS0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01UcmVlQ29uc3RydWN0aW9uID0gRE9NLkRPTVRyZWVDb25zdHJ1Y3Rpb247XG5leHBvcnQgdHlwZSBET01UcmVlQ29uc3RydWN0aW9uID0gRE9NLkRPTVRyZWVDb25zdHJ1Y3Rpb247XG5leHBvcnQgeyBOYW1lc3BhY2UgYXMgRE9NTmFtZXNwYWNlIH0gZnJvbSAnLi9pbnRlcmZhY2VzJztcbiJdfQ== + enifed("glimmer-runtime/lib/dom/interfaces", ["exports"], function (exports) { "use strict"; @@ -19419,7 +19380,7 @@ enifed("glimmer-runtime/lib/dom/interfaces", ["exports"], function (exports) { NodeType[NodeType["Notation"] = 11] = "Notation"; })(NodeType || (exports.NodeType = NodeType = {})); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL2ludGVyZmFjZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBV0EsUUFBWSxRQWFYLENBQUE7O0FBYkQsS0FBQSxVQUFZLFFBQVEsRUFBQTtBQUNsQixnQkFBQSxDQUFBLFFBQUEsQ0FBQSxTQUFBLENBQUEsR0FBQSxDQUFBLENBQUEsR0FBQSxTQUFPLENBQUE7QUFDUCxnQkFBQSxDQUFBLFFBQUEsQ0FBQSxXQUFBLENBQUEsR0FBQSxDQUFBLENBQUEsR0FBQSxXQUFTLENBQUE7QUFDVCxnQkFBQSxDQUFBLFFBQUEsQ0FBQSxNQUFBLENBQUEsR0FBQSxDQUFBLENBQUEsR0FBQSxNQUFJLENBQUE7QUFDSixnQkFBQSxDQUFBLFFBQUEsQ0FBQSxjQUFBLENBQUEsR0FBQSxDQUFBLENBQUEsR0FBQSxjQUFZLENBQUE7QUFDWixnQkFBQSxDQUFBLFFBQUEsQ0FBQSxpQkFBQSxDQUFBLEdBQUEsQ0FBQSxDQUFBLEdBQUEsaUJBQWUsQ0FBQTtBQUNmLGdCQUFBLENBQUEsUUFBQS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ZXJmYWNlIFNWR0VsZW1lbnQgZXh0ZW5kcyBFbGVtZW50IHt9XG5cbmV4cG9ydCBpbnRlcmZhY2UgSFRNTEVsZW1lbnQgZXh0ZW5kcyBFbGVtZW50IHt9XG4iXX0= + enifed('glimmer-runtime/lib/dom/props', ['exports'], function (exports) { /* * @method normalizeProperty @@ -19476,7 +19437,10 @@ enifed('glimmer-runtime/lib/dom/props', ['exports'], function (exports) { // Chrome 46.0.2464.0: 'autocorrect' in document.createElement('input') === false // Safari 8.0.7: 'autocorrect' in document.createElement('input') === false // Mobile Safari (iOS 8.4 simulator): 'autocorrect' in document.createElement('input') === true - autocorrect: true + autocorrect: true, + // Chrome 54.0.2840.98: 'list' in document.createElement('input') === true + // Safari 9.1.3: 'list' in document.createElement('input') === false + list: true }, // element.form is actually a legitimate readOnly property, that is to be // mutated, but must be mutated by setAttribute... @@ -19493,7 +19457,7 @@ enifed('glimmer-runtime/lib/dom/props', ['exports'], function (exports) { return tag && tag[propName.toLowerCase()] || false; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL3Byb3BzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztBQU1BLGFBQUEsaUJBQUEsQ0FBa0MsT0FBTyxFQUFFLFFBQVEsRUFBQTtBQUNqRCxZQUFJLElBQUksWUFBQTtZQUFFLFVBQVUsWUFBQSxDQUFDO0FBRXJCLFlBQUksUUFBUSxJQUFJLE9BQU8sRUFBRTtBQUN2QixzQkFBVSxHQUFHLFFBQVEsQ0FBQztBQUN0QixnQkFBSSxHQUFHLE1BQU0sQ0FBQztTQUNmLE1BQU07QUFDTCxnQkFBSSxLQUFLLEdBQUcsUUFBUSxDQUFDLFdBQVcsRUFBRSxDQUFDO0FBQ25DLGdCQUFJLEtBQUssSUFBSSxPQUFPLEVBQUU7QUFDcEIsb0JBQUksR0FBRyxN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YWxzZTtcbn1cbiJdfQ== + enifed('glimmer-runtime/lib/dom/sanitized-values', ['exports', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-runtime/lib/upsert'], function (exports, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerRuntimeLibUpsert) { 'use strict'; @@ -19545,7 +19509,7 @@ enifed('glimmer-runtime/lib/dom/sanitized-values', ['exports', 'glimmer-runtime/ return str; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL3Nhbml0aXplZC12YWx1ZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBTUEsUUFBTSxZQUFZLEdBQUcsQ0FDbkIsYUFBYSxFQUNiLFdBQVcsQ0FDWixDQUFDO0FBRUYsUUFBTSxPQUFPLEdBQUcsQ0FDZCxHQUFHLEVBQ0gsTUFBTSxFQUNOLE1BQU0sRUFDTixLQUFLLEVBQ0wsUUFBUSxFQUNSLE1BQU0sRUFDTixNQUFNLENBQ1AsQ0FBQztBQUVGLFFBQU0saUJBQWlCLEdBQUcsQ0FDeEIsT0FBTyxDQUNSLENBQUM7QUFFRixRQUFNLGFBQWEsR0FBRyxDQUNwQixNQUFNLEVBQ04sS0FBSyxFQUNMLFlBQVksRUFDWixRQUFRLENBQ1QsQ0FBQztBQUVGLFFBQU0sdUJBQXVCLEdBQUcsQ0FDOUIsS0FBSyxDQUNOLENBQUM7QUFFRixhQUFBLEdBQUEsQ0FBYSxLQUFvQixFQUFFLElBQVksRUFBQTtBQUM3QyxlQUFPLEtBQUssQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUM7S0FDbkM7QUFFRCxhQUFBLFFBQUEsQ0FBa0IsT0FBZSxFQUFFLFNBQWlCLEVBQUE7QUFDbEQsZUFBTyxDQUFDLE9BQU8sS0FBSyxJQUFJLElBQUksR0FBRyxDQ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gdmFsdWU6IE9wYXF1ZSk6IE9wYXF1ZSB7XG4gIGxldCB0YWdOYW1lO1xuXG4gIGlmICh2YWx1ZSA9PT0gbnVsbCB8fCB2YWx1ZSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgcmV0dXJuIHZhbHVlO1xuICB9XG5cbiAgaWYgKGlzU2FmZVN0cmluZyh2YWx1ZSkpIHtcbiAgICByZXR1cm4gdmFsdWUudG9IVE1MKCk7XG4gIH1cblxuICBpZiAoIWVsZW1lbnQpIHtcbiAgICB0YWdOYW1lID0gbnVsbDtcbiAgfSBlbHNlIHtcbiAgICB0YWdOYW1lID0gZWxlbWVudC50YWdOYW1lLnRvVXBwZXJDYXNlKCk7XG4gIH1cblxuICBsZXQgc3RyID0gbm9ybWFsaXplVGV4dFZhbHVlKHZhbHVlKTtcblxuICBpZiAoY2hlY2tVUkkodGFnTmFtZSwgYXR0cmlidXRlKSkge1xuICAgIGxldCBwcm90b2NvbCA9IGVudi5wcm90b2NvbEZvclVSTChzdHIpO1xuICAgIGlmIChoYXMoYmFkUHJvdG9jb2xzLCBwcm90b2NvbCkpIHtcbiAgICAgIHJldHVybiBgdW5zYWZlOiR7c3RyfWA7XG4gICAgfVxuICB9XG5cbiAgaWYgKGNoZWNrRGF0YVVSSSh0YWdOYW1lLCBhdHRyaWJ1dGUpKSB7XG4gICAgcmV0dXJuIGB1bnNhZmU6JHtzdHJ9YDtcbiAgfVxuXG4gIHJldHVybiBzdHI7XG59XG4iXX0= + enifed('glimmer-runtime/lib/environment', ['exports', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/dom/attribute-managers', 'glimmer-util', 'glimmer-runtime/lib/syntax/core', 'glimmer-runtime/lib/syntax/builtins/if', 'glimmer-runtime/lib/syntax/builtins/unless', 'glimmer-runtime/lib/syntax/builtins/with', 'glimmer-runtime/lib/syntax/builtins/each'], function (exports, _glimmerRuntimeLibReferences, _glimmerRuntimeLibDomAttributeManagers, _glimmerUtil, _glimmerRuntimeLibSyntaxCore, _glimmerRuntimeLibSyntaxBuiltinsIf, _glimmerRuntimeLibSyntaxBuiltinsUnless, _glimmerRuntimeLibSyntaxBuiltinsWith, _glimmerRuntimeLibSyntaxBuiltinsEach) { 'use strict'; @@ -19801,7 +19765,7 @@ enifed('glimmer-runtime/lib/environment', ['exports', 'glimmer-runtime/lib/refer }; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZW52aXJvbm1lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBMkRBLEtBQUE7QUFlRSxpQkFmRixLQUFBLENBZWMsVUFBdUIsRUFBMkI7Z0JBQXpCLFdBQVcseURBQVUsSUFBSTs7QUFGdEQsZ0JBQUEsQ0FBQSxXQUFXLEdBQVUsSUFBSSxDQUFDO0FBR2hDLGdCQUFJLENBQUMsS0FBSyxHQUFHLFVBQVUsQ0FBQztBQUN4QixnQkFBSSxDQUFDLFdBQVcsR0FBRyxXQUFXLENBQUM7U0FDaEM7O0FBbEJILGFBQUEsQ0FDUyxJQUFJLEdBQUEsY0FBQyxJQUEyQixFQUFVO2dCQUFSLElBQUkseURBQUcsQ0FBQzs7QUFDL0MsZ0JBQUksSUFBSSxHQUE0QixJQUFJLEtBQUssQ0FBQyxJQUFJLEdBQUcsQ0FBQyxDQUFDLENBQUM7QUFFeEQsaUJBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsSUFBSSxJQUFJLEVBQUUsQ0FBQyxFQUFFLEVBQUU7QUFDOUIsb0JBQUksQ0FBQyxDQUFDLENBQUMsZ0NBekRKLG1CQUFtQixBQXlETyxDQUFDO2FBQy9CO0FBRUQsbUJBQU8sSUFBSSxLQUFLLENBQUMsSUFBSSxDQUFDLENBQUMsSUFBSSxDQUFDLEVBQUUsSUFBSSxFQUFKLElBQUksRUFBRSxDQUFDLENBQUM7U0FDdkM7O0FBVEgsYUFBQS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YWx1ZS5yZWYucGFydHM7XG4gICAgfSBlbHNlIGlmIChhcHBlbmQgJiYgYXBwZW5kLnZhbHVlLnR5cGUgPT09ICdoZWxwZXInKSB7XG4gICAgICBsZXQgaGVscGVyID0gPFN5bnRheC5IZWxwZXI+YXBwZW5kLnZhbHVlO1xuICAgICAgYXJncyA9IGhlbHBlci5hcmdzO1xuICAgICAgcGF0aCA9IGhlbHBlci5yZWYucGFydHM7XG4gICAgfSBlbHNlIGlmIChtb2RpZmllcikge1xuICAgICAgcGF0aCA9IG1vZGlmaWVyLnBhdGg7XG4gICAgICBhcmdzID0gbW9kaWZpZXIuYXJncztcbiAgICB9XG5cbiAgICBsZXQga2V5OiBzdHJpbmcsIGlzU2ltcGxlOiBib29sZWFuO1xuXG4gICAgaWYgKHBhdGgpIHtcbiAgICAgIGlzU2ltcGxlID0gcGF0aC5sZW5ndGggPT09IDE7XG4gICAgICBrZXkgPSBwYXRoWzBdO1xuICAgIH1cblxuICAgIHJldHVybiB7XG4gICAgICBpc1NpbXBsZSxcbiAgICAgIHBhdGgsXG4gICAgICBrZXksXG4gICAgICBhcmdzLFxuICAgICAgYXBwZW5kVHlwZSxcbiAgICAgIG9yaWdpbmFsOiBzdGF0ZW1lbnQsXG4gICAgICBpc0lubGluZTogISFhcHBlbmQsXG4gICAgICBpc0Jsb2NrOiAhIWJsb2NrLFxuICAgICAgaXNNb2RpZmllcjogISFtb2RpZmllclxuICAgIH07XG59XG4iXX0= + enifed('glimmer-runtime/lib/helpers/get-dynamic-var', ['exports', 'glimmer-reference'], function (exports, _glimmerReference) { 'use strict'; @@ -19838,15 +19802,15 @@ enifed('glimmer-runtime/lib/helpers/get-dynamic-var', ['exports', 'glimmer-refer } exports.default = getDynamicVar; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvaGVscGVycy9nZXQtZHluYW1pYy12YXIudHMiXSwibmFtZXMiOltdLCJtY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+ enifed("glimmer-runtime/lib/modifier/interfaces", ["exports"], function (exports) { "use strict"; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvbW9kaWZpZXIvaW50ZXJmYWNlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwiZmlsZSI6ImludGVyZmFjZXMuanMiLCJzb3VyY2VzQ29udGVudCI6W119 + enifed("glimmer-runtime/lib/opcode-builder", ["exports"], function (exports) { "use strict"; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvb3Bjb2RlLWJ1aWxkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJvcGNvZGUtYnVpbGRlci5qcyIsInNvdXJjZXNDb250ZW50IjpbXX0= + enifed('glimmer-runtime/lib/opcodes', ['exports', 'glimmer-util'], function (exports, _glimmerUtil) { 'use strict'; @@ -19935,7 +19899,7 @@ enifed('glimmer-runtime/lib/opcodes', ['exports', 'glimmer-util'], function (exp } } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvb3Bjb2Rlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztRQWFBLGNBQUE7QUFPRSxpQkFQRixjQUFBLEdBT0U7QUFDRSx5QkFyQjhDLGNBQWMsQ0FxQjdDLElBQUksQ0FBQyxDQUFDO1NBQ3RCOztBQVRILHNCQUFBLFdBV0UsTUFBTSxHQUFBLGtCQUFBO0FBQ0osbUJBQU8sRUFBRSxJQUFJLEVBQUUsSUFBSSxDQUFDLEtBQUssRUFBRSxJQUFJLEVBQUUsSUFBSSxDQUFDLElBQUksRUFBRSxDQUFDO1NBQzlDOztlQWJILGNBQUE7Ozs7O1FBZ0JBLE1BQUE7OE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kge1xuICAgICAgICAgIGJ1ZmZlci5wdXNoKCcsICcpO1xuICAgICAgICB9XG5cbiAgICAgICAgYnVmZmVyLnB1c2goa2V5cy5tYXAoa2V5ID0+IGAke2tleX09JHtvcGNvZGUuZGV0YWlsc1trZXldfWApLmpvaW4oJywgJykpO1xuICAgICAgfVxuICAgIH1cblxuICAgIGJ1ZmZlci5wdXNoKCcpJyk7XG4gIH1cblxuICBidWZmZXIucHVzaCgnXFxuJyk7XG5cbiAgaWYgKG9wY29kZS5jaGlsZHJlbiAmJiBvcGNvZGUuY2hpbGRyZW4ubGVuZ3RoKSB7XG4gICAgZm9yIChsZXQgaT0wOyBpPG9wY29kZS5jaGlsZHJlbi5sZW5ndGg7IGkrKykge1xuICAgICAgX2luc3BlY3Qob3Bjb2RlLmNoaWxkcmVuW2ldLCBidWZmZXIsIGxldmVsKzEsIGkpO1xuICAgIH1cbiAgfVxufVxuIl19 + enifed("glimmer-runtime/lib/partial", ["exports"], function (exports) { "use strict"; @@ -19946,7 +19910,7 @@ enifed("glimmer-runtime/lib/partial", ["exports"], function (exports) { exports.PartialDefinition = PartialDefinition; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvcGFydGlhbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFFQSxpQkFBQSxHQUlFLFNBSkYsaUJBQUEsQ0FJYyxJQUFZLEVBQUUsUUFBcUIsRUFBQTtBQUM3QyxZQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQztBQUNqQixZQUFJLENBQUMsUUFBUSxHQUFHLFFBQVEsQ0FBQztLQUMxQiIsImZpbGUiOiJwYXJ0aWFsLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgVGVtcGxhdGUgfSBmcm9tICcuL3RlbXBsYXRlJztcblxuZXhwb3J0IGNsYXNzIFBhcnRpYWxEZWZpbml0aW9uPFQ+IHtcbiAgbmFtZTogc3RyaW5nOyAvLyBmb3IgZGVidWdnaW5nXG4gIHRlbXBsYXRlOiBUZW1wbGF0ZTxUPjtcblxuICBjb25zdHJ1Y3RvcihuYW1lOiBzdHJpbmcsIHRlbXBsYXRlOiBUZW1wbGF0ZTxUPikge1xuICAgIHRoaXMubmFtZSA9IG5hbWU7XG4gICAgdGhpcy50ZW1wbGF0ZSA9IHRlbXBsYXRlO1xuICB9XG59XG4iXX0= + enifed('glimmer-runtime/lib/references', ['exports', 'glimmer-reference'], function (exports, _glimmerReference) { 'use strict'; @@ -20042,7 +20006,7 @@ enifed('glimmer-runtime/lib/references', ['exports', 'glimmer-reference'], funct exports.ConditionalReference = ConditionalReference; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvcmVmZXJlbmNlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFLQSxrQkFBQTs4QkFBQSxrQkFBQTs7QUFzQkUsaUJBdEJGLGtCQUFBLENBc0J3QixLQUFRLEVBQUE7QUFDNUIsdUNBQU0sS0FBSyxDQUFDLENBQUM7U0FDZDs7QUF4QkgsMEJBQUEsQ0FNUyxNQUFNLEdBQUEsZ0JBQUMsS0FBZ0IsRUFBQTtBQUM1QixnQkFBSSxLQUFLLEtBQUssU0FBUyxFQUFFO0FBQ3ZCLHVCQUFPLG1CQUFtQixDQUFDO2FBQzVCLE1BQU0sSUFBSSxLQUFLLEtBQUssSUFBSSxFQUFFO0FBQ3pCLHVCQUFPLGNBQWMsQ0FBQzthQUN2QixNQUFNLElBQUksS0FBSyxLQUFLLElBQUksRUFBRTtBQUN6Qix1QkFBTyxjQUFjLENBQUM7YUFDdkIsTUFBTSxJQUFJLEtBQUssS0FBSyxLQUFLLEVBQUU7QUFDMUIsdUJBQU8sZUFBZSxDQUFDO2FBQ3hCLE1BQU0sSUFBSSxPQUFPLEtBQUssS0FBS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0dXJuICEhdmFsdWU7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/scanner', ['exports', 'glimmer-runtime/lib/syntax/statements', 'glimmer-runtime/lib/compiled/blocks', 'glimmer-util', 'glimmer-runtime/lib/symbol-table'], function (exports, _glimmerRuntimeLibSyntaxStatements, _glimmerRuntimeLibCompiledBlocks, _glimmerUtil, _glimmerRuntimeLibSymbolTable) { 'use strict'; @@ -20197,7 +20161,7 @@ enifed('glimmer-runtime/lib/scanner', ['exports', 'glimmer-runtime/lib/syntax/st return SyntaxReader; })(); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc2Nhbm5lci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFRQSxPQUFBO0FBQ0UsaUJBREYsT0FBQSxDQUNzQixLQUE4QixFQUFVLElBQWtCLEVBQVUsR0FBZ0IsRUFBQTtBQUFwRixnQkFBQSxDQUFBLEtBQUssR0FBTCxLQUFLLENBQXlCO0FBQVUsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFjO0FBQVUsZ0JBQUEsQ0FBQSxHQUFHLEdBQUgsR0FBRyxDQUFhO1NBQ3ZHOztBQUZILGVBQUEsV0FJRSxjQUFjLEdBQUEsMEJBQUE7Z0JBQ04sS0FBSyxHQUFXLElBQUksQ0FBcEIsS0FBSztnQkFBRSxJQUFJLEdBQUssSUFBSSxDQUFiLElBQUk7O0FBRWpCLGdCQUFJLFdBQVcsR0FBRyxzQ0FBWSxhQUFhLENBQUMsSUFBSSxDQUFDLENBQUM7QUFDbEQsZ0JBQUksT0FBTyxHQUFHLGVBQWUsQ0FBQyxLQUFLLEVBQUUsS0FBSyxDQUFDLE1BQU0sRUFBRSxXQUFXLEVBQUUsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDO0FBQzFFLG1CQUFPLHFDQWZGLFVBQVUsQ0FlTy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JpdmF0ZSBzeW1ib2xUYWJsZTogU3ltYm9sVGFibGUsIHByaXZhdGUgc2Nhbm5lcjogQmxvY2tTY2FubmVyKSB7fVxuXG4gIG5leHQoKTogU3RhdGVtZW50U3ludGF4IHtcbiAgICBsZXQgbGFzdCA9IHRoaXMubGFzdDtcbiAgICBpZiAobGFzdCkge1xuICAgICAgdGhpcy5sYXN0ID0gbnVsbDtcbiAgICAgIHJldHVybiBsYXN0O1xuICAgIH0gZWxzZSBpZiAodGhpcy5jdXJyZW50ID09PSB0aGlzLnN0YXRlbWVudHMubGVuZ3RoKSB7XG4gICAgICByZXR1cm4gbnVsbDtcbiAgICB9XG5cbiAgICBsZXQgc2V4cCA9IHRoaXMuc3RhdGVtZW50c1t0aGlzLmN1cnJlbnQrK107XG4gICAgcmV0dXJuIGJ1aWxkU3RhdGVtZW50KHNleHAsIHRoaXMuc3ltYm9sVGFibGUsIHRoaXMuc2Nhbm5lcik7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/symbol-table', ['exports', 'glimmer-util'], function (exports, _glimmerUtil) { 'use strict'; @@ -20331,7 +20295,7 @@ enifed('glimmer-runtime/lib/symbol-table', ['exports', 'glimmer-util'], function exports.default = SymbolTable; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ltYm9sLXRhYmxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQUdBLFdBQUE7QUFvQkUsaUJBcEJGLFdBQUEsQ0FvQnNCLE1BQW1CLEVBQW1DO2dCQUF6QixJQUFJLHlEQUFpQixJQUFJOztBQUF0RCxnQkFBQSxDQUFBLE1BQU0sR0FBTixNQUFNLENBQWE7QUFBVSxnQkFBQSxDQUFBLElBQUksR0FBSixJQUFJLENBQXFCO0FBTmxFLGdCQUFBLENBQUEsTUFBTSxHQUFHLGFBakJWLElBQUksRUFpQm9CLENBQUM7QUFDeEI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biAgICBsZXQgc3ltYm9sID0gbG9jYWxzW25hbWVdO1xuXG4gICAgaWYgKCFzeW1ib2wgJiYgcGFyZW50KSB7XG4gICAgICBzeW1ib2wgPSBwYXJlbnQuZ2V0TG9jYWwobmFtZSk7XG4gICAgfVxuXG4gICAgcmV0dXJuIHN5bWJvbDtcbiAgfVxuXG4gIGdldFBhcnRpYWxBcmdzKCk6IG51bWJlciB7XG4gICAgcmV0dXJuIHRoaXMudG9wLnBhcnRpYWxBcmdzO1xuICB9XG5cbiAgaXNUb3AoKTogYm9vbGVhbiB7XG4gICAgcmV0dXJuIHRoaXMudG9wID09PSB0aGlzO1xuICB9XG59XG4iXX0= + enifed("glimmer-runtime/lib/syntax", ["exports"], function (exports) { "use strict"; @@ -20408,7 +20372,7 @@ enifed("glimmer-runtime/lib/syntax", ["exports"], function (exports) { return value && value[ATTRIBUTE] === true; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O1FBbUJBLFNBQUE7QUFBQSxpQkFBQSxTQUFBLEdBQUE7QUFNUyxnQkFBQSxDQUFBLElBQUksR0FBYyxJQUFJLENBQUM7QUFDdkIsZ0JBQUEsQ0FBQSxJQUFJLEdBQWMsSUFBSSxDQUFDO1NBYS9COztBQXBCRCxpQkFBQSxDQUNTLFFBQVEsR0FBQSxrQkFBZ0MsSUFBTyxFQUFFLFdBQXdCLEVBQUUsT0FBc0IsRUFBQTtBQUN0RyxrQkFBTSxJQUFJLEtBQUssd0NBQXNDLElBQUksQ0FBRyxDQUFDO1NBQzlEOztBQUhILGlCQUFBLFdBU0UsS0FBSyxHQUFBLGlCQUFBOzs7QUFHSCxtQkFBTyxJQUF1QixJQUFJLENBQUMsV0FBWSxDQUFDLElBQUksQ0FBQyxDQUFDO1NBQ3ZEOztBQWJILGlCQUFBLFdBa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WJ1dGU8YW55PiB7XG4gIHJldHVybiB2YWx1ZSAmJiB2YWx1ZVtBVFRSSUJVVEVdID09PSB0cnVlO1xufVxuIl19 + enifed('glimmer-runtime/lib/syntax/builtins/each', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; @@ -20471,7 +20435,7 @@ enifed('glimmer-runtime/lib/syntax/builtins/each', ['exports', 'glimmer-runtime/ exports.default = EachSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL2VhY2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBVUEsVUFBQTs4QkFBQSxVQUFBOztBQUdFLGlCQUhGLFVBQUEsQ0FHcUIsSUFBaUIsRUFBQTtBQUNsQyx1Q0FBTyxDQUFDO0FBRFMsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFhO0FBRnBDLGdCQUFBLENBQUEsSUFBSSxHQUFHLGdCQUFnQixDQUFDO1NBSXZCOztBQUxILGtCQUFBLFdBT0UsT0FBTyxHQUFBLGlCQUFDLEdBQXFCLEVBQUUsR0FBZ0IsRUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O2dCQXlCdkMsSUFBSSxHQUF1QixJQUFJLENBQS9CLElBQUk7Z0JBQVUsTUFBTSxHQUFPLElBQUksQ0FBekIsSUFBSSxDQUFJLE1BQU07O0FBRTFCLGVBQUcsQ0FBQyxLQUFLLENBQUMsSUFBSSxFQUFFLFVBQUMsR0FBRyxFQUFFLEtBQUssRUFBRSxHQUFHLEVBQUE7QUFDOUIsbUJBQUcsQ0FBQyxXQUFXLEVBQUUsQ0FBQztBQUVsQixvQkFBSSxNQUFNLENBQUMsT0FBTyxFQUFFO0FBQ2xCLHVCQUFHLENBQUMsVUFBVSxDQUFDLE1BQU0sQ0FBQy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Y29uc3RydWN0b3IocHVibGljIGFyZ3M6IFN5bnRheC5BcmdzKSB7XG4gICAgc3VwZXIoKTtcbiAgfVxuXG4gIGNvbXBpbGUoZHNsOiBPcGNvZGVCdWlsZGVyRFNMLCBlbnY6IEVudmlyb25tZW50KSB7XG4gICAgLy8gICAgICAgICBFbnRlcihCRUdJTiwgRU5EKVxuICAgIC8vIEJFR0lOOiAgTm9vcFxuICAgIC8vICAgICAgICAgUHV0QXJnc1xuICAgIC8vICAgICAgICAgUHV0SXRlcmFibGVcbiAgICAvLyAgICAgICAgIEp1bXBVbmxlc3MoRUxTRSlcbiAgICAvLyAgICAgICAgIEVudGVyTGlzdChCRUdJTjIsIEVORDIpXG4gICAgLy8gSVRFUjogICBOb29wXG4gICAgLy8gICAgICAgICBOZXh0SXRlcihCUkVBSylcbiAgICAvLyAgICAgICAgIEVudGVyV2l0aEtleShCRUdJTjIsIEVORDIpXG4gICAgLy8gQkVHSU4yOiBOb29wXG4gICAgLy8gICAgICAgICBQdXNoQ2hpbGRTY29wZVxuICAgIC8vICAgICAgICAgRXZhbHVhdGUoZGVmYXVsdClcbiAgICAvLyAgICAgICAgIFBvcFNjb3BlXG4gICAgLy8gRU5EMjogICBOb29wXG4gICAgLy8gICAgICAgICBFeGl0XG4gICAgLy8gICAgICAgICBKdW1wKElURVIpXG4gICAgLy8gQlJFQUs6ICBOb29wXG4gICAgLy8gICAgICAgICBFeGl0TGlzdFxuICAgIC8vICAgICAgICAgSnVtcChFTkQpXG4gICAgLy8gRUxTRTogICBOb29wXG4gICAgLy8gICAgICAgICBFdmFsdWxhdGUoaW52ZXJzZSlcbiAgICAvLyBFTkQ6ICAgIE5vb3BcbiAgICAvLyAgICAgICAgIEV4aXRcblxuICAgIGxldCB7IGFyZ3MsIGFyZ3M6IHsgYmxvY2tzIH0gfSA9IHRoaXM7XG5cbiAgICBkc2wuYmxvY2soYXJncywgKGRzbCwgQkVHSU4sIEVORCkgPT4ge1xuICAgICAgZHNsLnB1dEl0ZXJhdG9yKCk7XG5cbiAgICAgIGlmIChibG9ja3MuaW52ZXJzZSkge1xuICAgICAgICBkc2wuanVtcFVubGVzcygnRUxTRScpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgZHNsLmp1bXBVbmxlc3MoRU5EKTtcbiAgICAgIH1cblxuICAgICAgZHNsLml0ZXIoKGRzbCwgQkVHSU4sIEVORCkgPT4ge1xuICAgICAgICBkc2wuZXZhbHVhdGUoJ2RlZmF1bHQnLCBibG9ja3MuZGVmYXVsdCk7XG4gICAgICB9KTtcblxuICAgICAgaWYgKGJsb2Nrcy5pbnZlcnNlKSB7XG4gICAgICAgIGRzbC5qdW1wKEVORCk7XG4gICAgICAgIGRzbC5sYWJlbCgnRUxTRScpO1xuICAgICAgICBkc2wuZXZhbHVhdGUoJ2ludmVyc2UnLCBibG9ja3MuaW52ZXJzZSk7XG4gICAgICB9XG4gICAgfSk7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/syntax/builtins/if', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; @@ -20520,7 +20484,7 @@ enifed('glimmer-runtime/lib/syntax/builtins/if', ['exports', 'glimmer-runtime/li exports.default = IfSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL2lmLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQVFBLFFBQUE7OEJBQUEsUUFBQTs7QUFHRSxpQkFIRixRQUFBLENBR3FCLElBQWlCLEVBQUE7QUFDbEMsdUNBQU8sQ0FBQztBQURTLGdCQUFBLENBQUEsSUFBSSxHQUFKLElBQUksQ0FBYTtBQUZwQyxnQkFBQSxDQUFBLElBQUksR0FBRyxjQUFjLENBQUM7U0FJckI7O0FBTEgsZ0JBQUEsV0FPRSxPQUFPLEdBQUEsaUJBQUMsR0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FJyk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgICAgZHNsLmp1bXAoRU5EKTtcbiAgICAgICAgZHNsLmxhYmVsKCdFTFNFJyk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnaW52ZXJzZScsIGJsb2Nrcy5pbnZlcnNlKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGRzbC5qdW1wVW5sZXNzKEVORCk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgIH1cbiAgICB9KTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/syntax/builtins/in-element', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; @@ -20552,7 +20516,7 @@ enifed('glimmer-runtime/lib/syntax/builtins/in-element', ['exports', 'glimmer-ru exports.default = InElementSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL2luLWVsZW1lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBUUEsZUFBQTs4QkFBQSxlQUFBOztBQUdFLGlCQUhGLGVBQUEsQ0FHc0IsSUFBaUIsRUFBQTtBQUNuQyx1Q0FBTyxDQUFDO0FBRFUsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFhO0FBRnJDLGdCQUFBLENBQUEsSUFBSSxHQUFHLHNCQUFzQixDQUFDO1NBSTdCOztBQUxILHVCQUFBLFdBT0UsT0FBTyxHQUFBLGlCQUFDLEdBQXFCLEVBQUUsR0FBZ0IsRUFBQTtnQkFDdkMsSUFBSSxHQUF1QixJQUFJLENBQS9CLElBQUk7Z0JBQVUsTUFBTSxHQUFPLElBQUksQ0FB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yZ3MpIHtcbiAgICBzdXBlcigpO1xuICB9XG5cbiAgY29tcGlsZShkc2w6IE9wY29kZUJ1aWxkZXJEU0wsIGVudjogRW52aXJvbm1lbnQpIHtcbiAgICBsZXQgeyBhcmdzLCBhcmdzOiB7IGJsb2NrcyB9IH0gPSB0aGlzO1xuXG4gICAgZHNsLnB1dEFyZ3MoYXJncyk7XG4gICAgZHNsLnRlc3QoJ3NpbXBsZScpO1xuXG4gICAgZHNsLmJsb2NrKG51bGwsIChkc2wsIEJFR0lOLCBFTkQpID0+IHtcbiAgICAgIGRzbC5qdW1wVW5sZXNzKEVORCk7XG4gICAgICBkc2wucHVzaFJlbW90ZUVsZW1lbnQoKTtcbiAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgIGRzbC5wb3BSZW1vdGVFbGVtZW50KCk7XG4gICAgfSk7XG4gIH1cbn1cbiJdfQ== + enifed("glimmer-runtime/lib/syntax/builtins/partial", ["exports", "glimmer-runtime/lib/syntax"], function (exports, _glimmerRuntimeLibSyntax) { "use strict"; @@ -20610,7 +20574,7 @@ enifed("glimmer-runtime/lib/syntax/builtins/partial", ["exports", "glimmer-runti exports.DynamicPartialSyntax = DynamicPartialSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL3BhcnRpYWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBY0EsbUJBQUE7OEJBQUEsbUJBQUE7O0FBR0UsaUJBSEYsbUJBQUEsQ0FHc0IsSUFBdUIsRUFBQTtBQUN6Qyx1Q0FBTyxDQUFDO0FBRFUsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFtQjtBQUZwQyxnQkFBQSxDQUFBLElBQUksR0FBRyxnQkFBZ0IsQ0FBQztTQUk5Qjs7QUF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4gICAgZHNsLmxhYmVsKCdCRUdJTicpO1xuICAgIGRzbC5qdW1wVW5sZXNzKCdFTkQnKTtcbiAgICBkc2wucHV0RHluYW1pY1BhcnRpYWxEZWZpbml0aW9uKCk7XG4gICAgZHNsLmV2YWx1YXRlUGFydGlhbCgpO1xuICAgIGRzbC5sYWJlbCgnRU5EJyk7XG4gICAgZHNsLmV4aXQoKTtcblxuICAgIGRzbC5zdG9wTGFiZWxzKCk7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/syntax/builtins/unless', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; @@ -20659,7 +20623,7 @@ enifed('glimmer-runtime/lib/syntax/builtins/unless', ['exports', 'glimmer-runtim exports.default = UnlessSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL3VubGVzcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFVQSxZQUFBOzhCQUFBLFlBQUE7O0FBR0UsaUJBSEYsWUFBQSxDQUdxQixJQUFpQixFQUFBO0FBQ2xDLHVDQUFPLENBQUM7QUFEUyxnQkFBQSxDQUFBLElBQUksR0FBSixJQUFJLENBQWE7QUFGcEMsZ0JBQUEsQ0FBQSxJQUFJLEdBQUcsa0JBQWtCLENBQUM7U0FJekI7O0FBTEgsb0JBQUEsV0FPRSxPQUFPLEdBQUEsaUJBQUMsR0FBcUIsRUFBRSxHQUFnQixFQUFBOzs7Ozs7Ozs7Ozs7Z0JBYXZDLElBQUksR0FBdUIsSUFBSSxDQUEvQixJQUFJO2dCQUFVLE1BQU0sR0FBTyxJQUFJLENBQXpCLElBQUksQ0FBSSxNQUFNOztBQUUxQixlQUFHLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQ2xCLGVBQUcsQ0FBQyxJQUFJLEN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JywgYmxvY2tzLmludmVyc2UpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgZHNsLmp1bXBJZignRU5EJyk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgIH1cbiAgICB9KTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/syntax/builtins/with-dynamic-vars', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; @@ -20690,7 +20654,7 @@ enifed('glimmer-runtime/lib/syntax/builtins/with-dynamic-vars', ['exports', 'gli exports.default = WithDynamicVarsSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL3dpdGgtZHluYW1pYy12YXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQVFBLHFCQUFBOzhCQUFBLHFCQUFBOztBQUdFLGlCQUhGLHFCQUFBLENBR3NCLElBQWlCLEVBQUE7QUFDbkMsdUNBQU8sQ0FBQztBQURVLGdCQUFBLENBQUEsSUFBSSxHQUFKLElBQUksQ0FBYTtBQUZyQyxnQkFBQSxDQUFBLElBQUksR0FBRyw2QkFBNkIsQ0FBQztTQUlwQzs7QUFMSCw2QkFBQSxXQU9FLE9BQU8sR0FBQSxpQkFBQyxHQUFxQixFQUFFLEdBQWdCLEVBQUE7Z0JBQ3ZDLElBQUksR0FBdUIsSUFBSSxDQUEvQixJQUFJO2dCQUFVLE1BQU0sR0FBTyxJQUFJLENBQXpCLElBQUksQ0FBSSxNQUFNOztBQUUxQixlQUFHLENBQUMsSUFBSSxDQUFDLFVBQUEsR0FBRyxFQUFBO0FBQ1YsbUJBQUcsQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUM7QUFDbEIsbUJBQUcsQ0FBQyxnQkFBZ0IsR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Z3MoYXJncyk7XG4gICAgICBkc2wucHVzaER5bmFtaWNTY29wZSgpO1xuICAgICAgZHNsLmJpbmREeW5hbWljU2NvcGUoYXJncy5uYW1lZC5rZXlzKTtcbiAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgIGRzbC5wb3BEeW5hbWljU2NvcGUoKTtcbiAgICB9KTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/syntax/builtins/with', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; @@ -20739,7 +20703,7 @@ enifed('glimmer-runtime/lib/syntax/builtins/with', ['exports', 'glimmer-runtime/ exports.default = WithSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL3dpdGgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBU0EsVUFBQTs4QkFBQSxVQUFBOztBQUdFLGlCQUhGLFVBQUEsQ0FHcUIsSUFBaUIsRUFBQTtBQUNsQyx1Q0FBTyxDQUFDO0FBRFMsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFhO0FBRnBDLGdCQUFBLENBQUEsSUFBSSxHQUFHLGdCQUFnQixDQUFDO1NBSXZCOztBQUxILGtCQUFBLFdBT0UsT0FBTyxHQUFBLGlCQUFDLEdBQXFCLEVBQUUsR0FBZ0IsRUFBQTs7Ozs7Ozs7Ozs7O2dCQWF2QyxJQUFJLEdBQXVCLElBQUksQ0FBL0IsSUFBSTtnQkFBVSxNQUFNLEdBQU8sSUFBSSxDQUF6QixJQUFJLENBQUksTUFBTTs7QUFFMUIsZUFBRyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQztBQUNsQixlQUFHLENBQUMsSUFBSSxDQUFDLGFBQWEsQ0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NFJyk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnaW52ZXJzZScsIGJsb2Nrcy5pbnZlcnNlKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGRzbC5qdW1wVW5sZXNzKEVORCk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgIH1cbiAgICB9KTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/syntax/core', ['exports', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/syntax/builtins/partial', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-runtime/lib/compiled/opcodes/component', 'glimmer-runtime/lib/compiled/opcodes/dom', 'glimmer-runtime/lib/syntax/expressions', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/compiled/expressions/value', 'glimmer-runtime/lib/compiled/expressions/lookups', 'glimmer-runtime/lib/compiled/expressions/has-block', 'glimmer-runtime/lib/compiled/expressions/helper', 'glimmer-runtime/lib/compiled/expressions/concat', 'glimmer-runtime/lib/utils', 'glimmer-runtime/lib/compiled/opcodes/content'], function (exports, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibSyntaxBuiltinsPartial, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerRuntimeLibCompiledOpcodesComponent, _glimmerRuntimeLibCompiledOpcodesDom, _glimmerRuntimeLibSyntaxExpressions, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibCompiledExpressionsValue, _glimmerRuntimeLibCompiledExpressionsLookups, _glimmerRuntimeLibCompiledExpressionsHasBlock, _glimmerRuntimeLibCompiledExpressionsHelper, _glimmerRuntimeLibCompiledExpressionsConcat, _glimmerRuntimeLibUtils, _glimmerRuntimeLibCompiledOpcodesContent) { 'use strict'; @@ -21998,9 +21962,11 @@ enifed('glimmer-runtime/lib/syntax/core', ['exports', 'glimmer-runtime/lib/synta var keys = this.keys; var values = this.values; - return new _glimmerRuntimeLibCompiledExpressionsArgs.CompiledNamedArgs(keys, values.map(function (value) { - return value.compile(compiler, env, symbolTable); - })); + var compiledValues = new Array(values.length); + for (var i = 0; i < compiledValues.length; i++) { + compiledValues[i] = values[i].compile(compiler, env, symbolTable); + } + return new _glimmerRuntimeLibCompiledExpressionsArgs.CompiledNamedArgs(keys, compiledValues); }; return NamedArgs; @@ -22043,7 +22009,7 @@ enifed('glimmer-runtime/lib/syntax/core', ['exports', 'glimmer-runtime/lib/synta return _class4; })(Args))(); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2NvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBMEdBLEtBQUE7OEJBQUEsS0FBQTs7QUFxQkUsaUJBckJGLEtBQUEsQ0FzQlcsSUFBYyxFQUNkLElBQVUsRUFBQTtBQUVqQix1Q0FBTyxDQUFDO0FBSEQsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFVO0FBQ2QsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFNO0FBdEJaLGdCQUFBLENBQUEsSUFBSSxHQUFHLE9BQU8sQ0FBQztTQXlCckI7O0FBMUJILGFBQUEsQ0FHUyxRQUFRLEdBQUEsa0JBQUMsSUFBZ0MsRUFBRSxXQUF3QixFQUFFLE9BQXFCLEVBQUE7Z0JBQ3hGLElBQUksR0FBeUMsSUFBSTtnQkFBM0MsTUFBTSxHQUFpQyxJQUFJO2dCQUFuQyxJQUFJLEdBQTJCLElBQUk7Z0JBQTdCLFVBQVUsR0FBZSxJQUFJO2dCQUFqQixTQUFTLEdBQUksSUFBSTs7QUFFeEQsZ0JBQUksUUFBUSxHQUFHLE9BQU8sQ0FBQyxRQUFRLENBQUMsV0FBVyxFQUFFLFVBQVUsQ0FBQ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a2V5cywgdmFsdWVzLm1hcCh2YWx1ZSA9PiB2YWx1ZS5jb21waWxlKGNvbXBpbGVyLCBlbnYsIHN5bWJvbFRhYmxlKSkpO1xuICB9XG59XG5cbmNvbnN0IEVNUFRZX05BTUVEX0FSR1MgPSBuZXcgKGNsYXNzIGV4dGVuZHMgTmFtZWRBcmdzIHtcbiAgY29uc3RydWN0b3IoKSB7XG4gICAgc3VwZXIoRU1QVFlfQVJSQVksIEVNUFRZX0FSUkFZKTtcbiAgfVxuXG4gIGF0KGtleTogc3RyaW5nKTogRXhwcmVzc2lvblN5bnRheDxPcGFxdWU+IHtcbiAgICByZXR1cm4gdW5kZWZpbmVkOyAvLyA/PyFcbiAgfVxuXG4gIGhhcyhrZXk6IHN0cmluZyk6IGJvb2xlYW4ge1xuICAgIHJldHVybiBmYWxzZTtcbiAgfVxuXG4gIGNvbXBpbGUoY29tcGlsZXI6IFN5bWJvbExvb2t1cCwgZW52OiBFbnZpcm9ubWVudCk6IENvbXBpbGVkTmFtZWRBcmdzIHtcbiAgICByZXR1cm4gQ29tcGlsZWROYW1lZEFyZ3MuZW1wdHkoKTtcbiAgfVxufSk7XG5cbmNvbnN0IEVNUFRZX0FSR1M6IEFyZ3MgPSBuZXcgKGNsYXNzIGV4dGVuZHMgQXJncyB7XG4gIGNvbnN0cnVjdG9yKCkge1xuICAgIHN1cGVyKEVNUFRZX1BPU0lUSU9OQUxfQVJHUywgRU1QVFlfTkFNRURfQVJHUywgRU1QVFlfQkxPQ0tTKTtcbiAgfVxuXG4gIGNvbXBpbGUoY29tcGlsZXI6IFN5bWJvbExvb2t1cCwgZW52OiBFbnZpcm9ubWVudCk6IENvbXBpbGVkQXJncyB7XG4gICAgcmV0dXJuIENvbXBpbGVkQXJncy5lbXB0eSgpO1xuICB9XG59KTtcbiJdfQ== + enifed('glimmer-runtime/lib/syntax/expressions', ['exports', 'glimmer-runtime/lib/syntax/core', 'glimmer-wire-format'], function (exports, _glimmerRuntimeLibSyntaxCore, _glimmerWireFormat) { 'use strict'; @@ -22072,7 +22038,7 @@ enifed('glimmer-runtime/lib/syntax/expressions', ['exports', 'glimmer-runtime/li ; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2V4cHJlc3Npb25zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQWlCRSxLQUFLLHNCQUxMLFdBQVcsQ0FLWCxLQUFLO1FBQ0wsUUFBUSxzQkFOUixXQUFXLENBTVgsUUFBUTtRQUNSLEtBQUssc0JBUEwsV0FBVyxDQU9YLEtBQUs7UUFDTCxVQUFVLHNCQVJWLFdBQVcsQ0FRWCxVQUFVO1FBQ1YsZ0JBQWdCLHNCQVRoQixXQUFXLENBU1gsZ0JBQWdCO1FBQ2hCLFFBQVEsc0JBVlIsV0FBVyxDQVVYLFFBQVE7UUFDUixTQUFTLHNCQVhULFdBQVcsQ0FXWCxTQUFTO1FBQ1QsZ0JBQWdCLHNCQVpoQixXQUFXLENBWVgsZ0JBQWdCO1FBQ2hCLFdBQVcsc0JBYlgsV0FBVyxDQWFYLFdBQVc7O3NCQUdiLFVBQXdCLElBQTBCLEVBQUE7QUFDaEQsWUFBSSxnQkFBZ0IsQ0FBQyxJQUFJLENBQUMsRUFBRSxPQUFPLDZCQTVCbkMsS0FBSyxDQTRCMEMsUUFBUSxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQzlELFlBQUksV0FBVyxDQUFDLElBQUksQ0FBQyxFQUFFLE9BQU8sNkJBN0I5QixLQUFLLENBNkJxQyxLQUFLLENBQUMsU0FBUyxDQUFDLENBQUM7QUFDM0QsWUFBSSxLQUFLLENBQUMsSUFBSSxDQUFDLEVBQUUsT0FBTyw2QkE3QnhCLFdBQVcsQ0E2QnVCLFFBQVEsQ0FBQyxJQUFJLENBQUMsQ0FBQztBQUNqRCxZQUFJLFFBQVEsQ0FBQyxJQUFJLENBQUMs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3ludGF4LmZyb21TcGVjKHNleHApO1xuICBpZiAoaXNIYXNCbG9jayhzZXhwKSkgcmV0dXJuIEhhc0Jsb2NrU3ludGF4LmZyb21TcGVjKHNleHApO1xuICBpZiAoaXNIYXNCbG9ja1BhcmFtcyhzZXhwKSkgcmV0dXJuIEhhc0Jsb2NrUGFyYW1zU3ludGF4LmZyb21TcGVjKHNleHApO1xuXG4gIHRocm93IG5ldyBFcnJvcihgVW5leHBlY3RlZCB3aXJlIGZvcm1hdDogJHtKU09OLnN0cmluZ2lmeShzZXhwKX1gKTtcbn07XG4iXX0= + enifed('glimmer-runtime/lib/syntax/statements', ['exports', 'glimmer-runtime/lib/syntax/core', 'glimmer-wire-format'], function (exports, _glimmerRuntimeLibSyntaxCore, _glimmerWireFormat) { 'use strict'; @@ -22112,7 +22078,7 @@ enifed('glimmer-runtime/lib/syntax/statements', ['exports', 'glimmer-runtime/lib ; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L3N0YXRlbWVudHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBMkJFLE9BQU8sc0JBTlAsVUFBVSxDQU1WLE9BQU87UUFDUCxPQUFPLHNCQVBQLFVBQVUsQ0FPVixPQUFPO1FBQ1AsU0FBUyxzQkFSVCxVQUFVLENBUVYsU0FBUztRQUNULFFBQVEsc0JBVFIsVUFBVSxDQVNWLFFBQVE7UUFDUixhQUFhLHNCQVZiLFVBQVUsQ0FVVixhQUFhO1FBQ2IsTUFBTSxzQkFYTixVQUFVLENBV1YsTUFBTTtRQUNOLFNBQVMsc0JBWlQsVUFBVSxDQVlWLFNBQVM7UUFDVCxhQUFhLHNCQWJiLFVBQVUsQ0FhVixhQUFhO1FBQ2IsY0FBYyxzQkFkZCxVQUFVLENBY1YsY0FBYztRQUNkLGNBQWMsc0JBZmQsVUFBVSxDQWVWLGNBQWM7UUFDZC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GVjKCk7XG4gIGlmIChpc1N0YXRpY0F0dHIoc2V4cCkpIHJldHVybiBTdGF0aWNBdHRyLmZyb21TcGVjKHNleHApO1xuICBpZiAoaXNTdGF0aWNBcmcoc2V4cCkpIHJldHVybiBTdGF0aWNBcmcuZnJvbVNwZWMoc2V4cCk7XG4gIGlmIChpc01vZGlmaWVyKHNleHApKSByZXR1cm4gTW9kaWZpZXIuZnJvbVNwZWMoc2V4cCk7XG59O1xuIl19 + enifed('glimmer-runtime/lib/template', ['exports', 'glimmer-util', 'glimmer-runtime/lib/builder', 'glimmer-runtime/lib/vm', 'glimmer-runtime/lib/scanner'], function (exports, _glimmerUtil, _glimmerRuntimeLibBuilder, _glimmerRuntimeLibVm, _glimmerRuntimeLibScanner) { 'use strict'; @@ -22163,7 +22129,7 @@ enifed('glimmer-runtime/lib/template', ['exports', 'glimmer-util', 'glimmer-runt return { id: id, meta: meta, _block: block, asEntryPoint: asEntryPoint, asLayout: asLayout, asPartial: asPartial, render: render }; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdGVtcGxhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O3NCQWtGQSxlQUFBOztBQVRBLFFBQUksUUFBUSxHQUFHLENBQUMsQ0FBQzs7QUFTakIsYUFBQSxlQUFBLENBQXdDLElBQXlELEVBQUE7WUFBdkQsRUFBRSxHQUFKLElBQXlELENBQXZELEVBQUU7WUFBRSxJQUFJLEdBQVYsSUFBeUQsQ0FBbkQsSUFBSTtZQUFFLEtBQUssR0FBakIsSUFBeUQsQ0FBN0MsS0FBSzs7QUFDdkQsWUFBSSxXQUFvQyxZQUFBLENBQUM7QUFDekMsWUFBSSxDQUFDLEVBQUUsRUFBRTtBQUNQLGNBQUUsZUFBYSxRQUFRLEVBQUcsQUFBRSxDQUFDO1NBQzlCO0FBQ0QsWUFBSSxNQUFNLEdBQUcsVUFB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4gIGxldCBhc1BhcnRpYWwgPSBzeW1ib2xzID0+IHNjYW5uZXIuc2NhblBhcnRpYWwoc3ltYm9scyk7XG4gIGxldCByZW5kZXIgPSAoc2VsZjogUGF0aFJlZmVyZW5jZTxhbnk+LCBhcHBlbmRUbzogU2ltcGxlLkVsZW1lbnQsIGR5bmFtaWNTY29wZTogRHluYW1pY1Njb3BlKSA9PiB7XG4gICAgbGV0IGVsZW1lbnRTdGFjayA9IEVsZW1lbnRTdGFjay5mb3JJbml0aWFsUmVuZGVyKGVudiwgYXBwZW5kVG8sIG51bGwpO1xuICAgIGxldCBjb21waWxlZCA9IGFzRW50cnlQb2ludCgpLmNvbXBpbGUoZW52KTtcbiAgICBsZXQgdm0gPSBWTS5pbml0aWFsKGVudiwgc2VsZiwgZHluYW1pY1Njb3BlLCBlbGVtZW50U3RhY2ssIGNvbXBpbGVkLnN5bWJvbHMpO1xuICAgIHJldHVybiB2bS5leGVjdXRlKGNvbXBpbGVkLm9wcyk7XG4gIH07XG4gIHJldHVybiB7IGlkLCBtZXRhLCBfYmxvY2s6IGJsb2NrLCBhc0VudHJ5UG9pbnQsIGFzTGF5b3V0LCBhc1BhcnRpYWwsIHJlbmRlciB9O1xufVxuIl19 + enifed('glimmer-runtime/lib/upsert', ['exports', 'glimmer-runtime/lib/bounds'], function (exports, _glimmerRuntimeLibBounds) { 'use strict'; @@ -22331,13 +22297,24 @@ enifed('glimmer-runtime/lib/upsert', ['exports', 'glimmer-runtime/lib/bounds'], return NodeUpsert; })(Upsert); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdXBzZXJ0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQVVBLGFBQUEsWUFBQSxDQUE2QixLQUFhLEVBQUE7QUFDeEMsZUFBTyxLQUFLLElBQUksT0FBTyxLQUFLLENBQUMsUUFBUSxDQUFDLEtB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ZhbHNlO1xuICAgIH1cbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/utils', ['exports', 'glimmer-util'], function (exports, _glimmerUtil) { 'use strict'; - var EMPTY_ARRAY = Object.freeze([]); + var HAS_NATIVE_WEAKMAP = (function () { + // detect if `WeakMap` is even present + var hasWeakMap = typeof WeakMap === 'function'; + if (!hasWeakMap) { + return false; + } + var instance = new WeakMap(); + // use `Object`'s `.toString` directly to prevent us from detecting + // polyfills as native weakmaps + return Object.prototype.toString.call(instance) === '[object WeakMap]'; + })(); + var EMPTY_ARRAY = HAS_NATIVE_WEAKMAP ? Object.freeze([]) : []; exports.EMPTY_ARRAY = EMPTY_ARRAY; - var EMPTY_DICT = Object.freeze(_glimmerUtil.dict()); + var EMPTY_DICT = HAS_NATIVE_WEAKMAP ? Object.freeze(_glimmerUtil.dict()) : _glimmerUtil.dict(); exports.EMPTY_DICT = EMPTY_DICT; var ListRange = (function () { @@ -22365,7 +22342,7 @@ enifed('glimmer-runtime/lib/utils', ['exports', 'glimmer-util'], function (expor exports.ListRange = ListRange; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBRU8sUUFBTSxXQUFXLEdBQUcsTUFBTSxDQUFDLE1BQU0sQ0FBQyxFQUFFLENBQUMsQ0FBQzs7QUFDdEMsUUFBTSxVQUFVLEdBQWMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxhQUhwQyxJQUFJLEVBRzJDLENBQUMsQ0FBQzs7O1FBb0JoRSxTQUFBO0FBT0UsaUJBUEYsU0FBQSxDQU9jLElBQVMsRUFBRSxLQUFhLEVBQUUsR0FBVyxFQUFBO0FBQy9DLGdCQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQztBQUNqQixnQkFBSSxDQUFDLEtBQUssR0FBRyxLQUFLLENBQUM7QUF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iZXI7XG4gIG1heCgpOiBudW1iZXI7XG4gIGF0KGluZGV4OiBudW1iZXIpOiBUO1xufVxuXG5leHBvcnQgY2xhc3MgTGlzdFJhbmdlPFQ+IGltcGxlbWVudHMgUmFuZ2U8VD4ge1xuICBwcml2YXRlIGxpc3Q6IFRbXTtcblxuICAvLyBbc3RhcnQsIGVuZF1cbiAgcHJpdmF0ZSBzdGFydDogbnVtYmVyO1xuICBwcml2YXRlIGVuZDogbnVtYmVyO1xuXG4gIGNvbnN0cnVjdG9yKGxpc3Q6IFRbXSwgc3RhcnQ6IG51bWJlciwgZW5kOiBudW1iZXIpIHtcbiAgICB0aGlzLmxpc3QgPSBsaXN0O1xuICAgIHRoaXMuc3RhcnQgPSBzdGFydDtcbiAgICB0aGlzLmVuZCA9IGVuZDtcbiAgfVxuXG4gIGF0KGluZGV4OiBudW1iZXIpOiBUIHtcbiAgICBpZiAoaW5kZXggPj0gdGhpcy5saXN0Lmxlbmd0aCkgcmV0dXJuIG51bGw7XG4gICAgcmV0dXJuIHRoaXMubGlzdFtpbmRleF07XG4gIH1cblxuICBtaW4oKTogbnVtYmVyIHtcbiAgICByZXR1cm4gdGhpcy5zdGFydDtcbiAgfVxuXG4gIG1heCgpOiBudW1iZXIge1xuICAgIHJldHVybiB0aGlzLmVuZDtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/vm', ['exports', 'glimmer-runtime/lib/vm/append', 'glimmer-runtime/lib/vm/update', 'glimmer-runtime/lib/vm/render-result'], function (exports, _glimmerRuntimeLibVmAppend, _glimmerRuntimeLibVmUpdate, _glimmerRuntimeLibVmRenderResult) { 'use strict'; @@ -22374,7 +22351,7 @@ enifed('glimmer-runtime/lib/vm', ['exports', 'glimmer-runtime/lib/vm/append', 'g exports.UpdatingVM = _glimmerRuntimeLibVmUpdate.default; exports.RenderResult = _glimmerRuntimeLibVmRenderResult.default; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1VBQW9CLEVBQUUsOEJBQWIsT0FBTztVQUFRLFFBQVEsOEJBQVIsUUFBUTtVQUNaLFVBQVUsOEJBQXJCLE9BQU87VUFDSSxZQUFZLG9DQUF2QixPQUFPIiwiZmlsZSI6InZtLmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgZGVmYXVsdCBhcyBWTSwgUHVibGljVk0gfSBmcm9tICcuL3ZtL2FwcGVuZCc7XG5leHBvcnQgeyBkZWZhdWx0IGFzIFVwZGF0aW5nVk0gfSBmcm9tICcuL3ZtL3VwZGF0ZSc7XG5leHBvcnQgeyBkZWZhdWx0IGFzIFJlbmRlclJlc3VsdCB9IGZyb20gJy4vdm0vcmVuZGVyLXJlc3VsdCc7XG4iXX0= + enifed('glimmer-runtime/lib/vm/append', ['exports', 'glimmer-runtime/lib/environment', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-runtime/lib/vm/update', 'glimmer-runtime/lib/vm/render-result', 'glimmer-runtime/lib/vm/frame'], function (exports, _glimmerRuntimeLibEnvironment, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerRuntimeLibVmUpdate, _glimmerRuntimeLibVmRenderResult, _glimmerRuntimeLibVmFrame) { 'use strict'; @@ -22679,7 +22656,7 @@ enifed('glimmer-runtime/lib/vm/append', ['exports', 'glimmer-runtime/lib/environ exports.default = VM; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0vYXBwZW5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQXlCQSxFQUFBO0FBbUJFLGlCQW5CRixFQUFBLENBb0JXLEdBQWdCLEVBQ3ZCLEtBQVksRUFDWixZQUEwQixFQUNsQixZQUEw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hbmRsZXIge1xuICBoYW5kbGVFeGNlcHRpb24oaW5pdGlhbGl6ZT86ICh2bTogVk0pID0+IHZvaWQpO1xufVxuXG5pbnRlcmZhY2UgUmV0dXJuSGFuZGxlciB7XG4gIHNldFJlbmRlclJlc3VsdChyZW5kZXJSZXN1bHQ6IFJlbmRlclJlc3VsdCk7XG59XG4iXX0= + enifed('glimmer-runtime/lib/vm/frame', ['exports'], function (exports) { 'use strict'; @@ -22873,7 +22850,7 @@ enifed('glimmer-runtime/lib/vm/frame', ['exports'], function (exports) { exports.FrameStack = FrameStack; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0vZnJhbWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBUUEsYUFBQSxHQUNFLFNBREYsYUFBQSxDQUVZLE9BQTJCLEVBQzNCLElBQW1CLEVBQ25CLFNBQTZCLEVBQUE7QUFGN0IsWUFBQSxDQUFBLE9BQU8sR0FBUCxPQUFPLENBQW9CO0FBQzNCLFlBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFlO0FBQ25CLFlBQUEsQ0FBQSxTQUFTLEdBQVQsU0FBUyxDQUFvQjtLQUNuQzs7OztRQUdOLEtBQUE7QUFZRSxpQkFaRixLQUFBLENBYUksR0FBVSxFQUdvQjtnQkFGdkIsU0FBUyx5REFBYyxJQUFJO2dCQUMzQixPQUFPLHlEQUFnQyxJQUFJO2dCQUMzQyxNQUFNLHlEQUFhLElBQUk7O0FBRnZCLGdCQUFBLENBQUEsU0FBUyxHQUFULFNBQVMsQ0FBa0I7QUFDM0IsZ0JBQUEsQ0FBQSxPQUFPLEdBQVAsT0FBTyxDQUFvQztBQUMzQyxnQkFBQSxDQUFBLE1BQU0sR0FBTixNQUFNLENBQWlCO0FBYmhDLGdCQUFBLENBQUEsT0FBTyxHQUF1QixJQUFJLENBQUM7QUFDbkMsZ0JBQ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ICAgIHJldHVybiBudWxsO1xuICAgIH1cbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/vm/render-result', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/vm/update'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibVmUpdate) { 'use strict'; @@ -22926,7 +22903,7 @@ enifed('glimmer-runtime/lib/vm/render-result', ['exports', 'glimmer-runtime/lib/ exports.default = RenderResult; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0vcmVuZGVyLXJlc3VsdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFPQSxZQUFBO0FBQ0UsaUJBREYsWUFBQSxDQUVZLEdBQWdCLEVBQ2hCLFFBQW9DLEVBQ3BDLE1BQXlCLEVBQUE7QUFGekIsZ0JBQUEsQ0FBQSxHQUFHLEdBQUgsR0FBRyxDQUFhO0FBQ2hCLGdCQUFBLENBQUEsUUFBUSxHQUFSLFFBQVEsQ0FBNEI7QUFDcEMsZ0JBQUEsQ0FBQSxNQUFNLEdBQU4sTUFBTSxDQUFtQjtTQUMvQjs7QUFMTixvQkFBQSxXQU9FLFFBQVEsR0FBQSxvQkFBMkQ7NkVBQTNCLEVBQUUsZ0JBQWdCLEVBQUUsS0FBSyxFQUFFOzs2Q0FBeEQsZ0JBQWdCO2dCQUFoQixnQkFBZ0IseUNBQUcsS0FBSztnQkFDM0IsR0FBRyxHQUFlLElBQUksQ0FBdEIsR0FBRztnQkFBRSxRQUFRLEdBQUssSUFBSSxDQUFqQixRQUFROztBQUNuQixnQkFBSSxFQUFFLEdBQUcsdUNBQWUsR0FBRyxFQUFFLEVBQUUsZ0JBQWdCLEVBQWhCLGdCQUFnQixFQUFFLENBQUMsQ0FBQztBQUNuRCxjQUFFLENBQUMsT0FBTyxDQUFDLFFBQVEsRUFBRSxJQUFJLENBQUMsQ0FBQztTQUM1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dGluZ09wY29kZT4ge1xuICAgIHJldHVybiB0aGlzLnVwZGF0aW5nO1xuICB9XG5cbiAgaGFuZGxlRXhjZXB0aW9uKCkge1xuICAgIHRocm93IFwidGhpcyBzaG91bGQgbmV2ZXIgaGFwcGVuXCI7XG4gIH1cblxuICBkZXN0cm95KCkge1xuICAgIHRoaXMuYm91bmRzLmRlc3Ryb3koKTtcbiAgICBjbGVhcih0aGlzLmJvdW5kcyk7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/vm/update', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/builder', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/vm/append'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibBuilder, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibVmAppend) { 'use strict'; @@ -23260,7 +23237,7 @@ enifed('glimmer-runtime/lib/vm/update', ['exports', 'glimmer-runtime/lib/bounds' return UpdatingVMFrame; })(); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0vdXBkYXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQTRCQSxVQUFBO0FBTUUsaUJBTkYsVUFBQSxDQU1jLEdBQWdCLEVBQUUsSUFBNEIsRUFBQTt3Q0FBNUIsSUFBNEIsQ0FBMUIsZ0JBQWdCO2dCQUFoQixnQkFBZ0IseUNBQUcsS0FBSzs7QUFGaEQsZ0JBQUEsQ0FBQSxVQUFVLEdBQTJCLGlCQTdCdEIsS0FBSyxFQTZCNkMsQ0FBQztBQUd4RSxnQkFBSSxDQUFDLEdBQUcsR0FBRyxHQUFHLENBQUM7QUFDZixnQkFBSSxDQUFDLEdBQUcsR0FBRyx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VudCA9IG9wcy5uZXh0Tm9kZShjdXJyZW50KTtcbiAgICByZXR1cm4gY3VycmVudDtcbiAgfVxuXG4gIGhhbmRsZUV4Y2VwdGlvbigpIHtcbiAgICB0aGlzLmV4Y2VwdGlvbkhhbmRsZXIuaGFuZGxlRXhjZXB0aW9uKCk7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-syntax/index', ['exports', 'glimmer-syntax/lib/parser', 'glimmer-syntax/lib/builders', 'glimmer-syntax/lib/traversal/traverse', 'glimmer-syntax/lib/traversal/walker', 'glimmer-syntax/lib/generation/print'], function (exports, _glimmerSyntaxLibParser, _glimmerSyntaxLibBuilders, _glimmerSyntaxLibTraversalTraverse, _glimmerSyntaxLibTraversalWalker, _glimmerSyntaxLibGenerationPrint) { // used by ember-compiler 'use strict'; @@ -23273,7 +23250,7 @@ enifed('glimmer-syntax/index', ['exports', 'glimmer-syntax/lib/parser', 'glimmer exports.Walker = _glimmerSyntaxLibTraversalWalker.default; exports.print = _glimmerSyntaxLibGenerationPrint.default; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItc3ludGF4L2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7VUFDUyxVQUFVLDJCQUFWLFVBQVU7OztVQUdDLFFBQVEsNkJBQW5CLE9BQU87VUFDSSxRQUFRLHNDQUFuQixPQUFPO1VBQ0ksTUFBTSxvQ0FBakIsT0FBTztVQUNJLEtBQUssb0NBQWhCLE9BQU8iLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyB1c2VkIGJ5IGVtYmVyLWNvbXBpbGVyXG5leHBvcnQgeyBwcmVwcm9jZXNzIH0gZnJvbSAnLi9saWIvcGFyc2VyJztcblxuLy8gbmVlZGVkIGZvciB0ZXN0cyBvbmx5XG5leHBvcnQgeyBkZWZhdWx0IGFzIGJ1aWxkZXJzIH0gZnJvbSAnLi9saWIvYnVpbGRlcnMnO1xuZXhwb3J0IHsgZGVmYXVsdCBhcyB0cmF2ZXJzZSB9IGZyb20gJy4vbGliL3RyYXZlcnNhbC90cmF2ZXJzZSc7XG5leHBvcnQgeyBkZWZhdWx0IGFzIFdhbGtlciB9IGZyb20gJy4vbGliL3RyYXZlcnNhbC93YWxrZXInO1xuZXhwb3J0IHsgZGVmYXVsdCBhcyBwcmludCB9IGZyb20gJy4vbGliL2dlbmVyYXRpb24vcHJpbnQnO1xuIl19 + enifed("glimmer-syntax/lib/builders", ["exports"], function (exports) { // Statements "use strict"; @@ -23515,7 +23492,7 @@ enifed("glimmer-syntax/lib/builders", ["exports"], function (exports) { pos: buildPosition }; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItc3ludGF4L2xpYi9idWlsZGVycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBRUEsYUFBQSxhQUFBLENBQXVCLElBQUksRUFBRSxNQUFPLEVBQUUsSUFBSyxFQUFFLEdBQUksRUFBRSxHQUFJLEVBQUE7QUFDckQsZUFBTztBQUNMLGdCQUFJLEVBQUUsbUJBQW1CO0FBQ3pCLGdCQUFJLEVBQUUsU0FBUyxDQUFDLElBQUksQ0FBQztBQUNyQixrQkFBTSxFQUFFLE1BQU0sSUFBSSxFQUFFO0FBQ3BCLGdCQUFJLEVBQUUsSUFBSSxJQUFJLFNBQVMsQ0FBQyxFQUFFLENBQUM7QUFDM0IsbUJBQU8sRUFBRSxDQUFDLEdBQUc7QUFDYixlQUFHLEVBQUUsUUFBUSxDQUFDLEdBQUcsQ0FBQztTQUNuQixDQUFDO0tBQ0g7QUFFRCxhQUFBLFVBQUEsQ0FBb0IsSUFBSSxFQUFFLE1BQU8sRUFBRSxJQUFLLEVBQUUsT0FBUSxFQUFFLE9BQVEsRUFBRSxHQUFJLEVBQUE7QUFDaEUsZUFBTztBQUNMLGdCQUFJLEVB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LFxuICBib29sZWFuOiBidWlsZEJvb2xlYW4sXG4gIG51bWJlcjogYnVpbGROdW1iZXIsXG4gIHVuZGVmaW5lZDogYnVpbGRVbmRlZmluZWQsXG4gIG51bGw6IGJ1aWxkTnVsbCxcbiAgY29uY2F0OiBidWlsZENvbmNhdCxcbiAgaGFzaDogYnVpbGRIYXNoLFxuICBwYWlyOiBidWlsZFBhaXIsXG4gIHByb2dyYW06IGJ1aWxkUHJvZ3JhbSxcbiAgbG9jOiBidWlsZExvYyxcbiAgcG9zOiBidWlsZFBvc2l0aW9uXG59O1xuIl19 + enifed('glimmer-syntax/lib/generation/print', ['exports'], function (exports) { 'use strict'; @@ -23707,7 +23684,7 @@ enifed('glimmer-syntax/lib/generation/print', ['exports'], function (exports) { return ['{{/', build(block.path), '}}'].join(''); } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItc3ludGF4L2xpYi9nZW5lcmF0aW9uL3ByaW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztzQkFBQSxLQUFBOztBQUFBLGFBQUEsS0FBQSxDQUE4QixHQUFHLEVBQUE7QUFDL0IsWUFBRyxDQUFDLEdBQUcsRUFBRTtBQUNQLG1CQUFPLEVBQUUsQ0FBQztTQUNYO0FBQ0QsWUFBTSxNQUFNLEdBQUcsRUFBRSxDQUFDO0FBRWxCLGdCQUFPLEdBQUcsQ0FBQyxJQUFJO0FBQ2IsaUJBQUssU0FBUztBQUFFO0FBQ2Qsd0JBQU0sVUFBVSxHQUFHLEdBQUcsQ0FBQyxPQUFPLElBQUksR0FBRyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUM5Qyx3QkFBRyxVQUFVLEVBQUU7QUFDYixrQ0FBVSxDQUFDLE9BQU8sR0FBRyxJQUFJLENBQUM7cUJBQzNCO0FBQ0Qsd0JBQU0sSUFBSSxHQUFHLFNBQVMsQ0FBQyxHQUFHL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oW25hbWUsIHBhdGgsIHBhcmFtcywgaGFzaF0sICcgJyk7XG59XG5cbmZ1bmN0aW9uIGNvbXBhY3RKb2luKGFycmF5LCBkZWxpbWl0ZXI/KSB7XG4gIHJldHVybiBjb21wYWN0KGFycmF5KS5qb2luKGRlbGltaXRlciB8fCAnJyk7XG59XG5cbmZ1bmN0aW9uIGJsb2NrUGFyYW1zKGJsb2NrKSB7XG4gIGNvbnN0IHBhcmFtcyA9IGJsb2NrLnByb2dyYW0uYmxvY2tQYXJhbXM7XG4gIGlmKHBhcmFtcy5sZW5ndGgpIHtcbiAgICByZXR1cm4gYCBhcyB8JHtwYXJhbXMuam9pbignLCcpfXxgO1xuICB9XG59XG5cbmZ1bmN0aW9uIG9wZW5CbG9jayhibG9jaykge1xuICByZXR1cm4gWyd7eyMnLCBwYXRoUGFyYW1zKGJsb2NrKSwgYmxvY2tQYXJhbXMoYmxvY2spLCAnfX0nXS5qb2luKCcnKTtcbn1cblxuZnVuY3Rpb24gY2xvc2VCbG9jayhibG9jaykge1xuICByZXR1cm4gWyd7ey8nLCBidWlsZChibG9jay5wYXRoKSwgJ319J10uam9pbignJyk7XG59XG4iXX0= + enifed("glimmer-syntax/lib/parser", ["exports", "handlebars/compiler/base", "glimmer-syntax/lib/builders", "glimmer-syntax/lib/generation/print", "glimmer-syntax/lib/traversal/traverse", "glimmer-syntax/lib/traversal/walker", "simple-html-tokenizer", "glimmer-syntax/lib/parser/handlebars-node-visitors", "glimmer-syntax/lib/parser/tokenizer-event-handlers"], function (exports, _handlebarsCompilerBase, _glimmerSyntaxLibBuilders, _glimmerSyntaxLibGenerationPrint, _glimmerSyntaxLibTraversalTraverse, _glimmerSyntaxLibTraversalWalker, _simpleHtmlTokenizer, _glimmerSyntaxLibParserHandlebarsNodeVisitors, _glimmerSyntaxLibParserTokenizerEventHandlers) { "use strict"; @@ -23789,7 +23766,7 @@ enifed("glimmer-syntax/lib/parser", ["exports", "handlebars/compiler/base", "gli return string.join('\n'); }; }); -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nB1c2gobGluZSk7XG4gICAgfVxuICB9XG5cbiAgcmV0dXJuIHN0cmluZy5qb2luKCdcXG4nKTtcbn07XG4iXX0= + enifed("glimmer-syntax/lib/parser/handlebars-node-visitors", ["exports", "glimmer-syntax/lib/builders", "glimmer-syntax/lib/utils"], function (exports, _glimmerSyntaxLibBuilders, _glimmerSyntaxLibUtils) { "use strict"; @@ -24027,7 +24004,7 @@ enifed("glimmer-syntax/lib/parser/handlebars-node-visitors", ["exports", "glimme attribute.parts.push(part); } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItc3ludGF4L2xpYi9wYXJzZXIvaGFuZGxlYmFycy1ub2RlLXZpc2l0b3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztzQkFHZTtBQUViLGVBQU8sRUFBRSxVQUFTLE9BQU8sRUFBQTtBQUN2QixnQkFBSSxJQUFJLEdBQUcsRUFBRSxDQUFDO0FBQ2QsZ0JBQUksSUFBSSxHQUFHLGtDQUFFLE9BQU8sQ0FBQyxJQUFJLEVBQUUsT0FBTyxDQUFDLFdBQVcsRUFBRSxPQUFPLENBQUMsR0FBRyxDQUFDLENBQUM7QUFDN0QsZ0JBQUksQ0FBQyxZQUFBO2dCQUFFLENBQUMsR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQztBQUUvQixnQkFBSSxDQUFDLFlBQVksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7QUFFN0IsZ0JBQUksQ0FBQyxLQUFLLENBQUMsRUFBRTtBQUFFLHVCQUFPLElBQUksQ0FBQyxZQUFZLENBQUMsR0FBRyxFQUFFLENBQUM7YUFBRTtBQUVoRCxpQkFBSyxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxFQUFFLEVBQUU7QUFDdEIsb0JBQUksQ0FBQyxVQUFVLENBQUMs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lvbiBhZGRFbGVtZW50TW9kaWZpZXIoZWxlbWVudCwgbXVzdGFjaGUpIHtcbiAgbGV0IHsgcGF0aCwgcGFyYW1zLCBoYXNoLCBsb2MgfSA9IG11c3RhY2hlO1xuICBsZXQgbW9kaWZpZXIgPSBiLmVsZW1lbnRNb2RpZmllcihwYXRoLCBwYXJhbXMsIGhhc2gsIGxvYyk7XG4gIGVsZW1lbnQubW9kaWZpZXJzLnB1c2gobW9kaWZpZXIpO1xufVxuXG5mdW5jdGlvbiBhcHBlbmREeW5hbWljQXR0cmlidXRlVmFsdWVQYXJ0KGF0dHJpYnV0ZSwgcGFydCkge1xuICBhdHRyaWJ1dGUuaXNEeW5hbWljID0gdHJ1ZTtcbiAgYXR0cmlidXRlLnBhcnRzLnB1c2gocGFydCk7XG59XG4iXX0= + enifed("glimmer-syntax/lib/parser/tokenizer-event-handlers", ["exports", "glimmer-syntax/lib/builders", "glimmer-syntax/lib/utils"], function (exports, _glimmerSyntaxLibBuilders, _glimmerSyntaxLibUtils) { "use strict"; @@ -24240,7 +24217,7 @@ enifed("glimmer-syntax/lib/parser/tokenizer-event-handlers", ["exports", "glimme return "`" + tag.name + "` (on line " + tag.loc.end.line + ")"; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItc3ludGF4L2xpYi9wYXJzZXIvdG9rZW5pemVyLWV2ZW50LWhhbmRsZXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUdBLFFBQU0sT0FBTyxHQUVULE1BQU0sQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLENBQUM7QUFFeEIsUUFBSSxZQUFZLEdBQUcscUZBQXFGLENBQUM7QUFDekcsZ0JBQVksQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUMsT0FBTyxDQUFDLFVBQUEsT0FBTyxFQUFBO0FBQ3JDLGVBQU8sQ0FBQyxPQUFPLENBQUMsR0FB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CIgd2l0aG91dCBhbiBvcGVuIHRhZy5cIjtcbiAgfSBlbHNlIGlmIChlbGVtZW50LnRhZyAhPT0gdGFnLm5hbWUpIHtcbiAgICBlcnJvciA9IFwiQ2xvc2luZyB0YWcgXCIgKyBmb3JtYXRFbmRUYWdJbmZvKHRhZykgKyBcIiBkaWQgbm90IG1hdGNoIGxhc3Qgb3BlbiB0YWcgYFwiICsgZWxlbWVudC50YWcgKyBcImAgKG9uIGxpbmUgXCIgK1xuICAgICAgICAgICAgZWxlbWVudC5sb2Muc3RhcnQubGluZSArIFwiKS5cIjtcbiAgfVxuXG4gIGlmIChlcnJvcikgeyB0aHJvdyBuZXcgRXJyb3IoZXJyb3IpOyB9XG59XG5cbmZ1bmN0aW9uIGZvcm1hdEVuZFRhZ0luZm8odGFnKSB7XG4gIHJldHVybiBcImBcIiArIHRhZy5uYW1lICsgXCJgIChvbiBsaW5lIFwiICsgdGFnLmxvYy5lbmQubGluZSArIFwiKVwiO1xufVxuIl19 + enifed("glimmer-syntax/lib/traversal/errors", ["exports"], function (exports) { "use strict"; @@ -24270,7 +24247,7 @@ enifed("glimmer-syntax/lib/traversal/errors", ["exports"], function (exports) { return new TraversalError("Replacing and removing in key handlers is not yet supported.", node, null, key); } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItc3ludGF4L2xpYi90cmF2ZXJzYWwvZXJyb3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUFBLGFBQUEsY0FBQSxDQUF3QixPQUFPLEVBQUUsSUFBSSxFQUFFLE1BQU0sRUFBRSxHQUFHLEVBQUE7QUFDaEQsWUFBSSxDQUFDLElBQUksR0FBRyxnQkFBZ0IsQ0FBQztBQUM3QixZQUFJLENBQUMsT0FBTyxHQUFHLE9BQU8sQ0FBQztBQUN2QixZQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQztBQUNqQixZQUFJLENBQ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-syntax/lib/traversal/errors'], function (exports, _glimmerSyntaxLibTypesVisitorKeys, _glimmerSyntaxLibTraversalErrors) { 'use strict'; @@ -24412,7 +24389,7 @@ enifed('glimmer-syntax/lib/traversal/traverse', ['exports', 'glimmer-syntax/lib/ return normalizedVisitor; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItc3ludGF4L2xpYi90cmF2ZXJzYWwvdHJhdmVyc2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O3NCQStHQSxRQUFBOzs7QUF4R0EsYUFBQSxTQUFBLENBQW1CLE9BQU8sRUFBRSxJQUFJLEVBQUE7QUFDOUIsWUFBSSxPQUFPLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsSUFBSSxPQUFPLENBQUMsR0FBRyxDQUFDO0FBQ2hELFlBQUksTUFBTSxZQUFBLENBQUM7QUFFWCxZQUFJLE9BQU8sSUFBSSxPQUFPLENBQUMsS0FBSyxFQUFFO0FBQzVCLGtCQUFNLEdBQUcsT0FBTyxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsSUFBSSxFQUFFLElBQUksQ0FBQyxDQUFDO1NBQ3pDO0FBRUQsWUFBSSxNQUFNLEtBQUssU0FBUyxJQUFJLE1BQU0sS0FBSyxJQUFJLEVBQUU7QUFDM0MsZ0JBQUksSUFBSSxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMsS0FBSyxJQUFJLENBQUMsU0FBUyxDQUFDLE1BQU0sQ0FBQyxFQUFFO0FBQ25ELHNCQUFNLEdBQUcsU0FBUyxDQUFDO2FBQ3BCLE1BQU0sSUFBSSxLQUFLLENBQUMsT0FBTyxDQUFDLE1BQU0sQ0FBQyxFQUFFO0FBQ2hDLHVCQUFPLFVBQVUsQ0FBQyxPQUFPLEVBQUUsTUFBTSxDQUFDLElBQUksTUFBTSxDQUFDO2FBQzlDLE1BQU07QUFDTC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V5cyA9IHt9O1xuXG4gICAgaWYgKHR5cGVvZiBoYW5kbGVyID09PSAnb2JqZWN0Jykge1xuICAgICAgbGV0IGtleXMgPSBoYW5kbGVyLmtleXM7XG4gICAgICBpZiAoa2V5cykge1xuICAgICAgICBmb3IgKGxldCBrZXkgaW4ga2V5cykge1xuICAgICAgICAgIGxldCBrZXlIYW5kbGVyID0ga2V5c1trZXldO1xuICAgICAgICAgIGlmICh0eXBlb2Yga2V5SGFuZGxlciA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgIG5vcm1hbGl6ZWRLZXlzW2tleV0gPSB7XG4gICAgICAgICAgICAgIGVudGVyOiAodHlwZW9mIGtleUhhbmRsZXIuZW50ZXIgPT09ICdmdW5jdGlvbicpID8ga2V5SGFuZGxlci5lbnRlciA6IG51bGwsXG4gICAgICAgICAgICAgIGV4aXQ6ICh0eXBlb2Yga2V5SGFuZGxlci5leGl0ID09PSAnZnVuY3Rpb24nKSA/IGtleUhhbmRsZXIuZXhpdCA6IG51bGxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2Yga2V5SGFuZGxlciA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgbm9ybWFsaXplZEtleXNba2V5XSA9IHtcbiAgICAgICAgICAgICAgZW50ZXI6IGtleUhhbmRsZXIsXG4gICAgICAgICAgICAgIGV4aXQ6IG51bGxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIG5vcm1hbGl6ZWRWaXNpdG9yW3R5cGVdID0ge1xuICAgICAgICBlbnRlcjogKHR5cGVvZiBoYW5kbGVyLmVudGVyID09PSAnZnVuY3Rpb24nKSA/IGhhbmRsZXIuZW50ZXIgOiBudWxsLFxuICAgICAgICBleGl0OiAodHlwZW9mIGhhbmRsZXIuZXhpdCA9PT0gJ2Z1bmN0aW9uJykgPyBoYW5kbGVyLmV4aXQgOiBudWxsLFxuICAgICAgICBrZXlzOiBub3JtYWxpemVkS2V5c1xuICAgICAgfTtcbiAgICB9IGVsc2UgaWYgKHR5cGVvZiBoYW5kbGVyID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICBub3JtYWxpemVkVmlzaXRvclt0eXBlXSA9IHtcbiAgICAgICAgZW50ZXI6IGhhbmRsZXIsXG4gICAgICAgIGV4aXQ6IG51bGwsXG4gICAgICAgIGtleXM6IG5vcm1hbGl6ZWRLZXlzXG4gICAgICB9O1xuICAgIH1cbiAgfVxuXG4gIHJldHVybiBub3JtYWxpemVkVmlzaXRvcjtcbn1cbiJdfQ== + enifed('glimmer-syntax/lib/traversal/walker', ['exports'], function (exports) { 'use strict'; @@ -24461,7 +24438,7 @@ enifed('glimmer-syntax/lib/traversal/walker', ['exports'], function (exports) { } }; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItc3ludGF4L2xpYi90cmF2ZXJzYWwvd2Fsa2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLGFBQUEsTUFBQSxHQUErQjtZQUFmLEtBQUsseURBQUMsU0FBUzs7QUFDN0IsWUFBSSxDQUFDLEtBQUssR0FBRyxLQUFLLENBQUM7QUFDbkIsWUFBSSxDQUFDLEtBQUssR0FBRyxFQUFFLENBQUM7S0FDakI7c0JBRWMsTUFBTTs7QUFFckIsVUFBTSxDQUFDLFNBQVMsQ0FBQyxLQUFLLEdBQUcsVUFBUyxJQUFJLEVBQUUsUUFBUSxFQUFBO0FBQzlDLFlBQUksQ0FBQyxJQUFJLEVBQUU7QUFDVCxtQkFBTztTQUNSO0FBRUQsWUFBSSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7QUFFdEIsWUFBSSxJQUFJLENBQUMsS0FBSyxLQUFLLE1BQU0sRUFBRTtBQUN6QixnQkFBSSxDQUFDLFFBQVEsQ0FBQyxJQ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mxldCB2aXNpdG9ycyA9IHtcbiAgUHJvZ3JhbTogZnVuY3Rpb24od2Fsa2VyLCBub2RlLCBjYWxsYmFjaykge1xuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbm9kZS5ib2R5Lmxlbmd0aDsgaSsrKSB7XG4gICAgICB3YWxrZXIudmlzaXQobm9kZS5ib2R5W2ldLCBjYWxsYmFjayk7XG4gICAgfVxuICB9LFxuXG4gIEVsZW1lbnROb2RlOiBmdW5jdGlvbih3YWxrZXIsIG5vZGUsIGNhbGxiYWNrKSB7XG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBub2RlLmNoaWxkcmVuLmxlbmd0aDsgaSsrKSB7XG4gICAgICB3YWxrZXIudmlzaXQobm9kZS5jaGlsZHJlbltpXSwgY2FsbGJhY2spO1xuICAgIH1cbiAgfSxcblxuICBCbG9ja1N0YXRlbWVudDogZnVuY3Rpb24od2Fsa2VyLCBub2RlLCBjYWxsYmFjaykge1xuICAgIHdhbGtlci52aXNpdChub2RlLnByb2dyYW0sIGNhbGxiYWNrKTtcbiAgICB3YWxrZXIudmlzaXQobm9kZS5pbnZlcnNlLCBjYWxsYmFjayk7XG4gIH1cbn07XG5cbldhbGtlci5wcm90b3R5cGUuY2hpbGRyZW4gPSBmdW5jdGlvbihub2RlLCBjYWxsYmFjaykge1xuICBsZXQgdmlzaXRvciA9IHZpc2l0b3JzW25vZGUudHlwZV07XG4gIGlmICh2aXNpdG9yKSB7XG4gICAgdmlzaXRvcih0aGlzLCBub2RlLCBjYWxsYmFjayk7XG4gIH1cbn07XG4iXX0= + enifed('glimmer-syntax/lib/types/visitor-keys', ['exports'], function (exports) { 'use strict'; @@ -24488,7 +24465,7 @@ enifed('glimmer-syntax/lib/types/visitor-keys', ['exports'], function (exports) HashPair: ['value'] }; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItc3ludGF4L2xpYi90eXBlcy92aXNpdG9yLWtle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sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IHtcbiAgUHJvZ3JhbTogICAgICAgICAgICAgICAgICBbJ2JvZHknXSxcblxuICBNdXN0YWNoZVN0YXRlbWVudDogICAgICAgIFsncGF0aCcsICdwYXJhbXMnLCAnaGFzaCddLFxuICBCbG9ja1N0YXRlbWVudDogICAgICAgICAgIFsncGF0aCcsICdwYXJhbXMnLCAnaGFzaCcsICdwcm9ncmFtJywgJ2ludmVyc2UnXSxcbiAgRWxlbWVudE1vZGlmaWVyU3RhdGVtZW50OiBbJ3BhdGgnLCAncGFyYW1zJywgJ2hhc2gnXSxcbiAgUGFydGlhbFN0YXRlbWVudDogICAgICAgICBbJ25hbWUnLCAncGFyYW1zJywgJ2hhc2gnXSxcbiAgQ29tbWVudFN0YXRlbWVudDogICAgICAgICBbXSxcbiAgTXVzdGFjaGVDb21tZW50U3RhdGVtZW50OiBbXSxcbiAgRWxlbWVudE5vZGU6ICAgICAgICAgICAgICBbJ2F0dHJpYnV0ZXMnLCAnbW9kaWZpZXJzJywgJ2NoaWxkcmVuJywgJ2NvbW1lbnRzJ10sXG4gIEF0dHJOb2RlOiAgICAgICAgICAgICAgICAgWyd2YWx1ZSddLFxuICBUZXh0Tm9kZTogICAgICAgICAgICAgICAgIFtdLFxuXG4gIENvbmNhdFN0YXRlbWVudDogICAgICAgICAgWydwYXJ0cyddLFxuICBTdWJFeHByZXNzaW9uOiAgICAgICAgICAgIFsncGF0aCcsICdwYXJhbXMnLCAnaGFzaCddLFxuICBQYXRoRXhwcmVzc2lvbjogICAgICAgICAgIFtdLFxuXG4gIFN0cmluZ0xpdGVyYWw6ICAgICAgICAgICAgW10sXG4gIEJvb2xlYW5MaXRlcmFsOiAgICAgICAgICAgW10sXG4gIE51bWJlckxpdGVyYWw6ICAgICAgICAgICAgW10sXG4gIE51bGxMaXRlcmFsOiAgICAgICAgICAgICAgW10sXG4gIFVuZGVmaW5lZExpdGVyYWw6ICAgICAgICAgW10sXG5cbiAgSGFzaDogICAgICAgICAgICAgICAgICAgICBbJ3BhaXJzJ10sXG4gIEhhc2hQYWlyOiAgICAgICAgICAgICAgICAgWyd2YWx1ZSddXG59O1xuIl19 + enifed('glimmer-syntax/lib/utils', ['exports'], function (exports) { // Regex to validate the identifier for block parameters. // Based on the ID validation regex in Handlebars. @@ -24551,7 +24528,7 @@ enifed('glimmer-syntax/lib/utils', ['exports'], function (exports) { childrenFor(parent).push(node); } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItc3ludGF4L2xpYi91dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7OztBQUdBLFFBQUksa0JBQWtCLEdBQUcsNEJBQTRCLENBQUM7Ozs7O0FBTXRELGFBQUEsdUJBQUEsQ0FBd0MsT0FBTyxFQUFBO0FBQzdDLFlBQUksTUFBTSxHQUFHLGdCQUFnQixDQUFDLE9BQU8sQ0FBQyxDQUFDO0FBQ3ZDLFlBQUksTUFBTSxFQUFFLE9BQU8sQ0FBQyxXQUFXLEdBQUcsTUFBTSxDQUFDO0tBQzFDOztBQUVELGFBQUEsZ0JBQUEsQ0FBMEIsT0FBTyxFQUFBO0FBQy9CLFlBQUksQ0FBQyxHQUFHLE9BQU8sQ0FBQyxVQUFVLENBQUMsTUFBTSxDQUFDO0FBQ2xDLFlBQUksU0FBUyxHQUFHLEVBQUUsQ0FBQztBQUVuQixhQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsRUFBRSxFQUFFO0FBQzFCLHFCQUFTLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLENBQUM7U0FDNUM7QUFFRCxZQUFJLE9BQU8sR0FBRyxTQUFTLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxDQ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Skge1xuICBpZiAobm9kZS50eXBlID09PSAnUHJvZ3JhbScpIHtcbiAgICByZXR1cm4gbm9kZS5ib2R5O1xuICB9XG4gIGlmIChub2RlLnR5cGUgPT09ICdFbGVtZW50Tm9kZScpIHtcbiAgICByZXR1cm4gbm9kZS5jaGlsZHJlbjtcbiAgfVxufVxuXG5leHBvcnQgZnVuY3Rpb24gYXBwZW5kQ2hpbGQocGFyZW50LCBub2RlKSB7XG4gIGNoaWxkcmVuRm9yKHBhcmVudCkucHVzaChub2RlKTtcbn1cbiJdfQ== + enifed('glimmer-util/index', ['exports', 'glimmer-util/lib/namespaces', 'glimmer-util/lib/platform-utils', 'glimmer-util/lib/assert', 'glimmer-util/lib/logger', 'glimmer-util/lib/object-utils', 'glimmer-util/lib/guid', 'glimmer-util/lib/collections', 'glimmer-util/lib/list-utils'], function (exports, _glimmerUtilLibNamespaces, _glimmerUtilLibPlatformUtils, _glimmerUtilLibAssert, _glimmerUtilLibLogger, _glimmerUtilLibObjectUtils, _glimmerUtilLibGuid, _glimmerUtilLibCollections, _glimmerUtilLibListUtils) { 'use strict'; @@ -24580,7 +24557,7 @@ enifed('glimmer-util/index', ['exports', 'glimmer-util/lib/namespaces', 'glimmer exports.ListSlice = _glimmerUtilLibListUtils.ListSlice; exports.Slice = _glimmerUtilLibListUtils.Slice; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7VUFJUyxnQkFBZ0IsNkJBQWhCLGdCQUFnQjtVQUNoQixNQUFNLGdDQUFOLE1BQU07VUFBRSxLQUFLLGdDQUFMLEtBQUs7VUFBRSxNQUFNLGdDQUFOLE1BQU07VUFDVixNQUFNLHlCQUFqQixPQUFPO1VBQ0ksTUFBTSx5QkFBakIsT0FBTztVQUFZLE1BQU0seUJBQU4sTUFBTTtVQUFFLFFBQVEseUJBQVIsU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blxuZXhwb3J0IHsgU3RhY2ssIERpY3QsIFNldCwgRGljdFNldCwgZGljdCB9IGZyb20gJy4vbGliL2NvbGxlY3Rpb25zJztcbmV4cG9ydCB7IEVNUFRZX1NMSUNFLCBMaW5rZWRMaXN0LCBMaW5rZWRMaXN0Tm9kZSwgTGlzdE5vZGUsIENsb25lYWJsZUxpc3ROb2RlLCBMaXN0U2xpY2UsIFNsaWNlIH0gZnJvbSAnLi9saWIvbGlzdC11dGlscyc7XG5cbmV4cG9ydCB0eXBlIEZJWE1FPFQsIHN0cmluZz4gPSBUO1xuIl19 + enifed("glimmer-util/lib/assert", ["exports"], function (exports) { // import Logger from './logger'; // let alreadyWarned = false; @@ -24603,7 +24580,7 @@ enifed("glimmer-util/lib/assert", ["exports"], function (exports) { exports.default = debugAssert; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvYXNzZXJ0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O0FBSUEsYUFBQSxXQUFBLENBQTRCLElBQUksRUFBRSxHQUFHLEVBQUE7Ozs7O0FBTW5DLFlBQUksQ0FBQyxJQUFJLEVBQUU7QUFDVCxrQkFBTSxJQUFJLEtBQUssQ0FBQyxHQUFHLElBQUksbUJBQW1CLENBQUMsQ0FBQztTQUM3QztLQUNGOztBQUVELGFBQUEsVUFBQSxHQUFBLEVBQStCOztzQkFFaEIsV0FBVyIsImZpbGUiOiJhc3NlcnQuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBpbXBvcnQgTG9nZ2VyIGZyb20gJy4vbG9nZ2VyJztcblxuLy8gbGV0IGFscmVhZHlXYXJuZWQgPSBmYWxzZTtcblxuZXhwb3J0IGZ1bmN0aW9uIGRlYnVnQXNzZXJ0KHRlc3QsIG1zZykge1xuICAvLyBpZiAoIWFscmVhZHlXYXJuZWQpIHtcbiAgLy8gICBhbHJlYWR5V2FybmVkID0gdHJ1ZTtcbiAgLy8gICBMb2dnZXIud2FybihcIkRvbid0IGxlYXZlIGRlYnVnIGFzc2VydGlvbnMgb24gaW4gcHVibGljIGJ1aWxkc1wiKTtcbiAgLy8gfVxuXG4gIGlmICghdGVzdCkge1xuICAgIHRocm93IG5ldyBFcnJvcihtc2cgfHwgXCJhc3NlcnRpb24gZmFpbHVyZVwiKTtcbiAgfVxufVxuXG5leHBvcnQgZnVuY3Rpb24gcHJvZEFzc2VydCgpIHt9XG5cbmV4cG9ydCBkZWZhdWx0IGRlYnVnQXNzZXJ0O1xuIl19 + enifed('glimmer-util/lib/collections', ['exports', 'glimmer-util/lib/guid'], function (exports, _glimmerUtilLibGuid) { 'use strict'; @@ -24687,7 +24664,7 @@ enifed('glimmer-util/lib/collections', ['exports', 'glimmer-util/lib/guid'], fun exports.Stack = Stack; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvY29sbGVjdGlvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFZQSxRQUFJLEtBQUssR0FBRyxNQUFNLENBQUMsTUFBTSxDQUFDLElBQUksRUFBRTs7O0FBRzlCLG1CQUFXLEVBQUU7QUFDWCxpQkFBSyxFQUFFLFNBQVM7QUFDaEIsc0JBQVUsRUFBRSxLQUFLO0FBQ2pCLG9CQUFRLEVBQUUsSUFBSTtTQUNmO0tBQ0YsQ0FBQyxDQUFDO0FBRUgsYUFBQSxXQUFBLEdBQUEsRUFBeUI7QUFDekIsZUFBVyxDQUFDLFNBQVMsR0FBRyxLQUFLLENBQUM7O0FBRTlCLGFBQUEsSUFBQSxHQUFBOzs7OztBQUtFLGVBQU8sSUFBSSxXQUFXLEVBQUUsQ0FBQztLQUMxQjs7UUFJRCxPQUFBO0FBR0UsaUJBSEYsT0FBQSxHQUdFO0FBQ0UsZ0JBQUksQ0FBQyxJQUFJLEdBQUcsSU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mxlbmd0aCA9PT0gMDtcbiAgfVxufVxuIl19 + enifed("glimmer-util/lib/guid", ["exports"], function (exports) { "use strict"; @@ -24703,7 +24680,7 @@ enifed("glimmer-util/lib/guid", ["exports"], function (exports) { return object._guid || initializeGuid(object); } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvZ3VpZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLFFBQUksSUFBSSxHQUFHLENBQUMsQ0FBQzs7QUFNYixhQUFBLGNBQUEsQ0FBK0IsTUFBZSxFQUFBO0FBQzVDLGVBQVEsTUFBTSxDQUFDLEtBQUssR0FBRyxFQUFFLElBQUksQ0FBRTtLQUNoQzs7QUFFRCxhQUFBLFVBQUEsQ0FBMkIsTUFBZSxFQUFBO0FBQ3hDLGVBQU8sTUFBTSxDQUFDLEtBQUssSUFBSSxjQUFjLENBQUMsTUFBTSxDQUFDLENBQUM7S0FDL0MiLCJmaWxlIjoiZ3VpZC5qcyIsInNvdXJjZXNDb250ZW50IjpbImxldCBHVUlEID0gMDtcblxuZXhwb3J0IGludGVyZmFjZSBIYXNHdWlkIHtcbiAgX2d1aWQ6IG51bWJlcjtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGluaXRpYWxpemVHdWlkKG9iamVjdDogSGFzR3VpZCk6IG51bWJlciB7XG4gIHJldHVybiAob2JqZWN0Ll9ndWlkID0gKytHVUlEKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGVuc3VyZUd1aWQob2JqZWN0OiBIYXNHdWlkKTogbnVtYmVyIHtcbiAgcmV0dXJuIG9iamVjdC5fZ3VpZCB8fCBpbml0aWFsaXplR3VpZChvYmplY3QpO1xufSJdfQ== + enifed("glimmer-util/lib/list-utils", ["exports"], function (exports) { "use strict"; @@ -24927,7 +24904,7 @@ enifed("glimmer-util/lib/list-utils", ["exports"], function (exports) { var EMPTY_SLIC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Q7XG4gIH1cblxuICBwcmV2Tm9kZShub2RlOiBUKTogVCB7XG4gICAgaWYgKG5vZGUgPT09IHRoaXMuX2hlYWQpIHJldHVybiBudWxsO1xuICAgIHJldHVybiA8VD5ub2RlLnByZXY7XG4gIH1cblxuICBpc0VtcHR5KCkge1xuICAgIHJldHVybiBmYWxzZTtcbiAgfVxufVxuXG5leHBvcnQgY29uc3QgRU1QVFlfU0xJQ0UgPSBuZXcgTGlzdFNsaWNlKG51bGwsIG51bGwpO1xuIl19 + enifed("glimmer-util/lib/logger", ["exports"], function (exports) { "use strict"; @@ -25017,7 +24994,7 @@ enifed("glimmer-util/lib/logger", ["exports"], function (exports) { var LOG_LEVEL = LogLevel.Warn; exports.default = new Logger({ console: _console, level: LOG_LEVEL }); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvbG9nZ2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLFFBQVksUUFLWCxDQUFBOztBQUxELEtBQUEsVUFBWSxRQUFRLEVBQUE7QUFDbEIsZ0JBQUEsQ0FBQSxRQUFBLENBQUEsT0FBQSxDQUFBLEdBQUEsQ0FBQSxDQUFBLEdBQUEsT0FBSyxDQUFBO0FBQ0wsZ0JBQUEsQ0FBQSxRQUFBLENBQUEsT0FBQSxDQUFBLEdBQUEsQ0FBQSxDQUFBLEdBQUEsT0FBSyxDQUFBO0FBQ0wsZ0JBQUEsQ0FBQSxRQUFBLENBQUEsTUFBQSxDQUFBLEdBQUEsQ0FBQSxDQUFBLEdBQUEsTUFBSSxDQUFBO0FBQ0osZ0JBQUEsQ0FBQSxRQUFBLENBQUEsT0FBQSxDQUFBLEdBQUEsQ0FBQSxDQUFBLEdBQUEsT0FBSyxDQUFBO0tBQ04sQ0FBQSxDQUxXLFFBQVEsYUFBUixRQUtYLEdBTFcsUUFBUSxHQUFBLEVBQUEsQ0FBQSxDQUF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oaXMuY29uc29sZS5lcnJvcihtZXNzYWdlKTtcbiAgfVxufVxuXG5sZXQgX2NvbnNvbGUgPSAodHlwZW9mIGNvbnNvbGUgPT09ICd1bmRlZmluZWQnKSA/IG5ldyBOdWxsQ29uc29sZSgpIDogY29uc29sZTtcblxuY29uc3QgQUxXQVlTID0gbmV3IExvZ2dlcih7IGNvbnNvbGU6IF9jb25zb2xlLCBsZXZlbDogTG9nTGV2ZWwuVHJhY2UgfSk7XG5jb25zdCBMT0dfTEVWRUwgPSBMb2dMZXZlbC5XYXJuO1xuXG5leHBvcnQgZGVmYXVsdCBuZXcgTG9nZ2VyKHsgY29uc29sZTogX2NvbnNvbGUsIGxldmVsOiBMT0dfTEVWRUwgfSk7XG4iXX0= + enifed('glimmer-util/lib/namespaces', ['exports'], function (exports) { // There is a small whitelist of namespaced attributes specially // enumerated in @@ -25057,7 +25034,7 @@ enifed('glimmer-util/lib/namespaces', ['exports'], function (exports) { return WHITELIST[attrName] || null; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvbmFtZXNwYWNlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7OztBQWNBLFFBQU0sS0FBSyxHQUFHLDhCQUE4QixDQUFDO0FBQzdDLFFBQU0sR0FBRyxHQUFHLHNDQUFzQyxDQUFDO0FBQ25ELFFBQU0sS0FBSyxHQUFHLCtCQUErQixDQUFDO0FBRTlDLFFBQU0sU0FBUyxHQUFHO0FBQ2hCLHVCQUFlLEVBQUUsS0FBSztBQUN0Qix1QkFBZSxFQUFFLEtBQUs7QUFDdEIsb0JBQVksRUFBRSxLQUFLO0FBQ25CLG9CQUFZLEVBQUUsS0FBSztBQUNuQixvQkFBWSxFQUFFLEtBQUs7QUFDbkIscUJBQWEsRUFBRSxLQUFLO0FBQ3BCLG9CQUFZLEVBQUUsS0FBSztBQUNuQixr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ZSBjYW4gYmUgZXhwcmVzc2VkIGluIHRoZSBIVE1MIHN5bnRheC5cblxuY29uc3QgWExJTksgPSAnaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayc7XG5jb25zdCBYTUwgPSAnaHR0cDovL3d3dy53My5vcmcvWE1MLzE5OTgvbmFtZXNwYWNlJztcbmNvbnN0IFhNTE5TID0gJ2h0dHA6Ly93d3cudzMub3JnLzIwMDAveG1sbnMvJztcblxuY29uc3QgV0hJVEVMSVNUID0ge1xuICAneGxpbms6YWN0dWF0ZSc6IFhMSU5LLFxuICAneGxpbms6YXJjcm9sZSc6IFhMSU5LLFxuICAneGxpbms6aHJlZic6IFhMSU5LLFxuICAneGxpbms6cm9sZSc6IFhMSU5LLFxuICAneGxpbms6c2hvdyc6IFhMSU5LLFxuICAneGxpbms6dGl0bGUnOiBYTElOSyxcbiAgJ3hsaW5rOnR5cGUnOiBYTElOSyxcbiAgJ3htbDpiYXNlJzogWE1MLFxuICAneG1sOmxhbmcnOiBYTUwsXG4gICd4bWw6c3BhY2UnOiBYTUwsXG4gICd4bWxucyc6IFhNTE5TLFxuICAneG1sbnM6eGxpbmsnOiBYTUxOU1xufTtcblxuZXhwb3J0IGZ1bmN0aW9uIGdldEF0dHJOYW1lc3BhY2UoYXR0ck5hbWUpIHtcbiAgcmV0dXJuIFdISVRFTElTVFthdHRyTmFtZV0gfHwgbnVsbDtcbn0iXX0= + enifed('glimmer-util/lib/object-utils', ['exports'], function (exports) { 'use strict'; @@ -25077,7 +25054,7 @@ enifed('glimmer-util/lib/object-utils', ['exports'], function (exports) { return obj; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvb2JqZWN0LXV0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7UUFBYyxPQUFPLEdBQUssTUFBTSxDQUF4QixJQUFJOztBQVNaLGFBQUEsTUFBQSxDQUF1Q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+KG9iajogVCwgYTogVSwgYjogViwgYzogVywgZDogWCk6IFQgJiBVICYgViAmIFcgJiBYO1xuZXhwb3J0IGZ1bmN0aW9uIGFzc2lnbjxULCBVLCBWLCBXLCBYLCBZPihvYmo6IFQsIGE6IFUsIGI6IFYsIGM6IFcsIGQ6IFgsIGU6IFkpOiBUICYgVSAmIFYgJiBXICYgWCAmIFk7XG5leHBvcnQgZnVuY3Rpb24gYXNzaWduPFQsIFUsIFYsIFcsIFgsIFksIFo+KG9iajogVCwgYTogVSwgYjogViwgYzogVywgZDogWCwgZTogWSwgZjogWik6IFQgJiBVICYgViAmIFcgJiBYICYgWSAmIFo7XG5leHBvcnQgZnVuY3Rpb24gYXNzaWduKHRhcmdldDogYW55LCAuLi5hcmdzOiBhbnlbXSk6IGFueTtcbmV4cG9ydCBmdW5jdGlvbiBhc3NpZ24ob2JqKSB7XG4gIGZvciAobGV0IGkgPSAxOyBpIDwgYXJndW1lbnRzLmxlbmd0aDsgaSsrKSB7XG4gICAgbGV0IGFzc2lnbm1lbnQgPSBhcmd1bWVudHNbaV07XG4gICAgaWYgKGFzc2lnbm1lbnQgPT09IG51bGwgfHwgdHlwZW9mIGFzc2lnbm1lbnQgIT09ICdvYmplY3QnKSBjb250aW51ZTtcbiAgICBsZXQga2V5cyA9IG9iaktleXMoYXNzaWdubWVudCk7XG4gICAgZm9yIChsZXQgaiA9IDA7IGogPCBrZXlzLmxlbmd0aDsgaisrKSB7XG4gICAgICBsZXQga2V5ID0ga2V5c1tqXTtcbiAgICAgIG9ialtrZXldID0gYXNzaWdubWVudFtrZXldO1xuICAgIH1cbiAgfVxuICByZXR1cm4gb2JqO1xufVxuIl19 + enifed("glimmer-util/lib/platform-utils", ["exports"], function (exports) { "use strict"; @@ -25088,7 +25065,7 @@ enifed("glimmer-util/lib/platform-utils", ["exports"], function (exports) { return val; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvcGxhdGZvcm0tdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFJQSxhQUFBLE1BQUEsQ0FBMEIsR0FBYSxFQUFBO0FBQ3JDLFlBQUksR0FBRyxLQUFLLElBQUksSUFBSSxHQUFHLEtBQUssU0FBUyxFQUFFLE1BQU0sSUFBSSxLQUFLLGdDQUFnQyxDQUFDO0FBQ3ZGLGVBQU8sR0FBRyxDQUFDO0tBQ1oiLCJmaWxlIjoicGxhdGZvcm0tdXRpbHMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgdHlwZSBPcGFxdWUgPSB7fSB8IHZvaWQ7XG5leHBvcnQgdHlwZSBPcHRpb248VD4gPSBUIHwgbnVsbDsgLy8gdHNsaW50OmRpc2FibGUtbGluZVxuZXhwb3J0IHR5cGUgTWF5YmU8VD4gPSBPcHRpb248VD4gfCB1bmRlZmluZWQ7IC8vIHRzbGludDpkaXNhYmxlLWxpbmVcblxuZXhwb3J0IGZ1bmN0aW9uIHVud3JhcDxUPih2YWw6IE1heWJlPFQ+KTogVCB7XG4gIGlmICh2YWwgPT09IG51bGwgfHwgdmFsID09PSB1bmRlZmluZWQpIHRocm93IG5ldyBFcnJvcihgRXhwZWN0ZWQgdmFsdWUgdG8gYmUgcHJlc2VudGApO1xuICByZXR1cm4gdmFsO1xufVxuIl19 + enifed("glimmer-util/lib/quoting", ["exports"], function (exports) { "use strict"; @@ -25124,7 +25101,7 @@ enifed("glimmer-util/lib/quoting", ["exports"], function (exports) { return str; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvcXVvdGluZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLGFBQUEsWUFBQSxDQUFzQixHQUFHLEVBQUE7QUFDdkIsV0FBRyxHQUFHLEdBQUcsQ0FBQyxPQUFPLENBQUMsS0FBSy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wbGFjZSgvXCIvZywgJ1xcXFxcIicpO1xuICBzdHIgPSBzdHIucmVwbGFjZSgvXFxuL2csIFwiXFxcXG5cIik7XG4gIHJldHVybiBzdHI7XG59XG5cbmV4cG9ydCB7IGVzY2FwZVN0cmluZyB9O1xuXG5mdW5jdGlvbiBzdHJpbmcoc3RyKSB7XG4gIHJldHVybiAnXCInICsgZXNjYXBlU3RyaW5nKHN0cikgKyAnXCInO1xufVxuXG5leHBvcnQgeyBzdHJpbmcgfTtcblxuZnVuY3Rpb24gYXJyYXkoYSkge1xuICByZXR1cm4gXCJbXCIgKyBhICsgXCJdXCI7XG59XG5cbmV4cG9ydCB7IGFycmF5IH07XG5cbmV4cG9ydCBmdW5jdGlvbiBoYXNoKHBhaXJzKSB7XG4gIHJldHVybiBcIntcIiArIHBhaXJzLmpvaW4oXCIsIFwiKSArIFwifVwiO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gcmVwZWF0KGNoYXJzLCB0aW1lcykge1xuICBsZXQgc3RyID0gXCJcIjtcbiAgd2hpbGUgKHRpbWVzLS0pIHtcbiAgICBzdHIgKz0gY2hhcnM7XG4gIH1cbiAgcmV0dXJuIHN0cjtcbn1cbiJdfQ== + enifed('glimmer-wire-format/index', ['exports'], function (exports) { 'use strict'; @@ -25172,7 +25149,7 @@ enifed('glimmer-wire-format/index', ['exports'], function (exports) { Statements.isTrustingAttr = is('trusting-attr'); })(Statements || (exports.Statements = Statements = {})); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItd2lyZS1mb3JtYXQvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBbUJBLGFBQUEsRUFBQSxDQUE2QixPQUFlLEVBQUE7QUFDMUMsZUFBTyxVQUFTLEtBQVksRUFBQTtBQUMxQixtQkFBTyxLQUFLLENBQUMsQ0FBQyxDQUFDLEtBQUssT0FBTyxDQUFDO1NBQzdCLENBQUM7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UZW1wbGF0ZUJsb2NrXG4gKiBAdHlwZWRlZiB7c3RyaW5nfSBTZXJpYWxpemVkVGVtcGxhdGVCbG9ja0pTT05cbiAqL1xuZXhwb3J0IHR5cGUgU2VyaWFsaXplZFRlbXBsYXRlQmxvY2tKU09OID0gc3RyaW5nO1xuXG4vKipcbiAqIEEgSlNPTiBvYmplY3QgY29udGFpbmluZyB0aGUgU2VyaWFsaXplZFRlbXBsYXRlQmxvY2sgYXMgSlNPTiBhbmQgVGVtcGxhdGVNZXRhLlxuICovXG5leHBvcnQgaW50ZXJmYWNlIFNlcmlhbGl6ZWRUZW1wbGF0ZVdpdGhMYXp5QmxvY2s8VCBleHRlbmRzIFRlbXBsYXRlTWV0YT4ge1xuICBpZD86IHN0cmluZztcbiAgYmxvY2s6IFNlcmlhbGl6ZWRUZW1wbGF0ZUJsb2NrSlNPTjtcbiAgbWV0YTogVDtcbn1cblxuLyoqXG4gKiBBIHN0cmluZyBvZiBKYXZhc2NyaXB0IGNvbnRhaW5pbmcgYSBTZXJpYWxpemVkVGVtcGxhdGVXaXRoTGF6eUJsb2NrIHRvIGJlXG4gKiBjb25jYXRlbmF0ZWQgaW50byBhIEphdmFzY3JpcHQgbW9kdWxlLlxuICogQHR5cGVkZWYge3N0cmluZ30gVGVtcGxhdGVKYXZhc2NyaXB0XG4gKi9cbmV4cG9ydCB0eXBlIFRlbXBsYXRlSmF2YXNjcmlwdCA9IHN0cmluZztcbiJdfQ== + enifed('handlebars/compiler/ast', ['exports'], function (exports) { 'use strict'; @@ -25326,7 +25303,7 @@ enifed('handlebars/compiler/ast', ['exports'], function (exports) { // must modify the object to operate properly. exports.default = AST; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImhhbmRsZWJhcnMvY29tcGlsZXIvYXN0LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLE1BQUksR0FBRyxHQUFHO0FBQ1IsV0FBTyxFQUFF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N0IG1vZGlmeSB0aGUgb2JqZWN0IHRvIG9wZXJhdGUgcHJvcGVybHkuXG5leHBvcnQgZGVmYXVsdCBBU1Q7XG4iXX0= + enifed('handlebars/compiler/base', ['exports', 'handlebars/compiler/parser', 'handlebars/compiler/ast', 'handlebars/compiler/whitespace-control', 'handlebars/compiler/helpers', 'handlebars/utils'], function (exports, _handlebarsCompilerParser, _handlebarsCompilerAst, _handlebarsCompilerWhitespaceControl, _handlebarsCompilerHelpers, _handlebarsUtils) { 'use strict'; @@ -25353,7 +25330,7 @@ enifed('handlebars/compiler/base', ['exports', 'handlebars/compiler/parser', 'ha return strip.accept(_handlebarsCompilerParser.default.parse(input)); } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImhhbmRsZWJhcnMvY29tcGlsZXIvYmFzZS5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O1VBTVMsTUFBTTs7QUFFZixNQUFJLEVBQUUsR0FBRyxFQUFFLENBQUM7QUFDWixtQkFMUyxNQUFNLENBS1IsRUFBRSw2REFBZSxDQUFDOztBQUVsQixXQUFTLEtBQUssQ0FBQyxLQUFLLEVBQUUsT0FBTyxFQUFFOztBQUVwQyxRQUFJLEtBQUssQ0FBQyxJQUFJLEtBQUssU0FBUyxFQUFFO0FBQUUsYUFBTyxLQUFLLENBQUM7S0FBRTs7QUFFL0Msc0NBQU8sRUFBRSxHQUFHLEVBQUUsQ0FBQzs7O0FBR2YsTUFBRSxDQUFDLE9BQU8sR0FBRyxVQUFTLE9BQU8sRUFBRTtBQUM3QixhQUFPLElBQUksRUFBRSxDQUFDLGNBQWMsQ0FBQyxPQUFPLElBQUksT0FBTyxDQUFDLE9BQU8sRUFBRSxPQUFPLENBQUMsQ0FBQztLQUNuRSxDQUFDOztBQUVGLFFBQUksS0FBSyxHQUFHLGtEQUF1QixDQUFDO0FBQ3BDLFdBQU8sS0FBSyxDQUFDLE1BQU0sQ0FBQyxr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1xufVxuIl19 + enifed('handlebars/compiler/helpers', ['exports', 'handlebars/exception'], function (exports, _handlebarsException) { 'use strict'; @@ -25480,7 +25457,7 @@ enifed('handlebars/compiler/helpers', ['exports', 'handlebars/exception'], funct return new this.BlockStatement(openBlock.path, openBlock.params, openBlock.hash, program, inverse, openBlock.strip, inverseStrip, close && close.strip, this.locInfo(locInfo)); } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImhhbmRsZWJhcnMvY29tcGlsZXIvaGVscGVycy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7QUFFTyxXQUFTLGNBQWMsQ0FBQyxNQUFNLEVBQUUsT0FBTyxFQUFFO0FBQzlDLFFBQUksQ0FBQyxNQUFNLEdBQUcsTUFBTSxDQUFDO0FBQ3JCLFFBQUksQ0FBQyxLQUFLLEdBQUc7QUFDWCxVQUFJLEVBQUUsT0FBTyxDQUFDLFVBQVU7QUFDeEIsWUFBTSxFQUFFLE9BQU8sQ0FBQyxZQUFZO0tBQzdCLENBQUM7QUFDRixRQUFJLENBQUMsR0FBRyxHQUFHO0FBQ1QsVUFBSSxFQUFFLE9BQU8sQ0FBQyxTQUFTO0FBQ3ZCLFlBQU0sRUFBRSxPQUFPLENBQUMsV0FBVztLQUM1QixDQUFDO0dBQ0g7O0FBRU0sV0FBUyxFQUFFLENBQUMsS0FBSyxFQUFFO0FBQ3hCLFFBQUksVUFBVSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsRUFBRTtBQUMxQixhQUFPLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQyxFQUFFLEtBQUssQ0FBQyxNQUFNLEdBQUcsQ0FBQyxDQUFDLENBQUM7S0FDMUMsTUFBTTtBQUNMLGFBQU8sS0FBSyxDQUFDO0tBQ2Q7R0FDRjs7QUFFTSxXQUFTLFVBQVUsQ0FBQyxJQUFJLEVBQUUsS0FBSyxFQUFFO0FB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ZiAoaW52ZXJzZUFuZFByb2dyYW0uY2hhaW4pIHtcbiAgICAgIGludmVyc2VBbmRQcm9ncmFtLnByb2dyYW0uYm9keVswXS5jbG9zZVN0cmlwID0gY2xvc2Uuc3RyaXA7XG4gICAgfVxuXG4gICAgaW52ZXJzZVN0cmlwID0gaW52ZXJzZUFuZFByb2dyYW0uc3RyaXA7XG4gICAgaW52ZXJzZSA9IGludmVyc2VBbmRQcm9ncmFtLnByb2dyYW07XG4gIH1cblxuICBpZiAoaW52ZXJ0ZWQpIHtcbiAgICBpbnZlcnRlZCA9IGludmVyc2U7XG4gICAgaW52ZXJzZSA9IHByb2dyYW07XG4gICAgcHJvZ3JhbSA9IGludmVydGVkO1xuICB9XG5cbiAgcmV0dXJuIG5ldyB0aGlzLkJsb2NrU3RhdGVtZW50KFxuICAgICAgb3BlbkJsb2NrLnBhdGgsIG9wZW5CbG9jay5wYXJhbXMsIG9wZW5CbG9jay5oYXNoLFxuICAgICAgcHJvZ3JhbSwgaW52ZXJzZSxcbiAgICAgIG9wZW5CbG9jay5zdHJpcCwgaW52ZXJzZVN0cmlwLCBjbG9zZSAmJiBjbG9zZS5zdHJpcCxcbiAgICAgIHRoaXMubG9jSW5mbyhsb2NJbmZvKSk7XG59XG4iXX0= + enifed("handlebars/compiler/parser", ["exports"], function (exports) { /* istanbul ignore next */ /* Jison generated parser */ @@ -26155,7 +26132,7 @@ enifed("handlebars/compiler/parser", ["exports"], function (exports) { return new Parser(); })();exports.default = handlebars; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImhhbmRsZWJhcnMvY29tcGlsZXIvcGFyc2VyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBRUEsUUFBSSxVQUFVLEdBQUcsQ0FBQyxZQUFVO0FBQzVCLFlBQUksTUFBTSxHQUFHLEVBQUMsS0FBSyxFQUFFLFNBQVMsS0FBSyxHQUFHLEVBQUc7QUFDekM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KSB7XG4gICAgICAgICAgICB2YXIgZXJyU3RyID0gXCJcIjtcbiAgICAgICAgICAgIGlmICghcmVjb3ZlcmluZykge1xuICAgICAgICAgICAgICAgIGV4cGVjdGVkID0gW107XG4gICAgICAgICAgICAgICAgZm9yIChwIGluIHRhYmxlW3N0YXRlXSlcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMudGVybWluYWxzX1twXSAmJiBwID4gMikge1xuICAgICAgICAgICAgICAgICAgICAgICAgZXhwZWN0ZWQucHVzaChcIidcIiArIHRoaXMudGVybWluYWxzX1twXSArIFwiJ1wiKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICh0aGlzLmxleGVyLnNob3dQb3NpdGlvbikge1xuICAgICAgICAgICAgICAgICAgICBlcnJTdHIgPSBcIlBhcnNlIGVycm9yIG9uIGxpbmUgXCIgKyAoeXlsaW5lbm8gKyAxKSArIFwiOlxcblwiICsgdGhpcy5sZXhlci5zaG93UG9zaXRpb24oKSArIFwiXFxuRXhwZWN0aW5nIFwiICsgZXhwZWN0ZWQuam9pbihcIiwgXCIpICsgXCIsIGdvdCAnXCIgKyAodGhpcy50ZXJtaW5hbHNfW3N5bWJvbF0gfHwgc3ltYm9sKSArIFwiJ1wiO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGVyclN0ciA9IFwiUGFyc2UgZXJyb3Igb24gbGluZSBcIiArICh5eWxpbmVubyArIDEpICsgXCI6IFVuZXhwZWN0ZWQgXCIgKyAoc3ltYm9sID09IDE/XCJlbmQgb2YgaW5wdXRcIjpcIidcIiArICh0aGlzLnRlcm1pbmFsc19bc3ltYm9sXSB8fCBzeW1ib2wpICsgXCInXCIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLnBhcnNlRXJyb3IoZXJyU3RyLCB7dGV4dDogdGhpcy5sZXhlci5tYXRjaCwgdG9rZW46IHRoaXMudGVybWluYWxzX1tzeW1ib2xdIHx8IHN5bWJvbCwgbGluZTogdGhpcy5sZXhlci55eWxpbmVubywgbG9jOiB5eWxvYywgZXhwZWN0ZWQ6IGV4cGVjdGVkfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGFjdGlvblswXSBpbnN0YW5jZW9mIEFycmF5ICYmIGFjdGlvbi5sZW5ndGggPiAxKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJQYXJzZSBFcnJvcjogbXVsdGlwbGUgYWN0aW9ucyBwb3NzaWJsZSBhdCBzdGF0ZTogXCIgKyBzdGF0ZSArIFwiLCB0b2tlbjogXCIgKyBzeW1ib2wpO1xuICAgICAgICB9XG4gICAgICAgIHN3aXRjaCAoYWN0aW9uWzBdKSB7XG4gICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgIHN0YWNrLnB1c2goc3ltYm9sKTtcbiAgICAgICAgICAgIHZzdGFjay5wdXNoKHRoaXMubGV4ZXIueXl0ZXh0KTtcbiAgICAgICAgICAgIGxzdGFjay5wdXNoKHRoaXMubGV4ZXIueXlsbG9jKTtcbiAgICAgICAgICAgIHN0YWNrLnB1c2goYWN0aW9uWzFdKTtcbiAgICAgICAgICAgIHN5bWJvbCA9IG51bGw7XG4gICAgICAgICAgICBpZiAoIXByZUVycm9yU3ltYm9sKSB7XG4gICAgICAgICAgICAgICAgeXlsZW5nID0gdGhpcy5sZXhlci55eWxlbmc7XG4gICAgICAgICAgICAgICAgeXl0ZXh0ID0gdGhpcy5sZXhlci55eXRleHQ7XG4gICAgICAgICAgICAgICAgeXlsaW5lbm8gPSB0aGlzLmxleGVyLnl5bGluZW5vO1xuICAgICAgICAgICAgICAgIHl5bG9jID0gdGhpcy5sZXhlci55eWxsb2M7XG4gICAgICAgICAgICAgICAgaWYgKHJlY292ZXJpbmcgPiAwKVxuICAgICAgICAgICAgICAgICAgICByZWNvdmVyaW5nLS07XG4gICAgICAgICAgICB9IGVsc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AgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobGVuKSB7XG4gICAgICAgICAgICAgICAgc3RhY2sgPSBzdGFjay5zbGljZSgwLCAtMSAqIGxlbiAqIDIpO1xuICAgICAgICAgICAgICAgIHZzdGFjayA9IHZzdGFjay5zbGljZSgwLCAtMSAqIGxlbik7XG4gICAgICAgICAgICAgICAgbHN0YWNrID0gbHN0YWNrLnNsaWNlKDAsIC0xICogbGVuKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHN0YWNrLnB1c2godGhpcy5wcm9kdWN0aW9uc19bYWN0aW9uWzFdXVswXSk7XG4gICAgICAgICAgICB2c3RhY2sucHVzaCh5eXZhbC4kKTtcbiAgICAgICAgICAgIGxzdGFjay5wdXNoKHl5dmFsLl8kKTtcbiAgICAgICAgICAgIG5ld1N0YXRlID0gdGFibGVbc3RhY2tbc3RhY2subGVuZ3RoIC0gMl1dW3N0YWNrW3N0YWNrLmxlbmd0aCAtIDFdXTtcbiAgICAgICAgICAgIHN0YWNrLnB1c2gobmV3U3RhdGUpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG4gICAgfVxuICAgIHJldHVybiB0cnVlO1xufVxufTtcbi8qIEppc29uIGdlbmVyYXRlZCBsZXhlciAqL1xudmFyIGxleGVyID0gKGZ1bmN0aW9uKCl7XG52YXIgbGV4ZXIgPSAoe0VPRjoxLFxucGFyc2VFcnJvcjpmdW5jdGlvbiBwYXJzZUVycm9yKHN0ciwgaGFzaCkge1xuICAgICAgICBpZiAodGhpcy55eS5wYXJzZXIpIHtcbiAgICAgICAgICAgIHRoaXMueXkucGFyc2VyLnBhcnNlRXJyb3Ioc3RyLCBoYXNoKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihzdHIpO1xuICAgICAgICB9XG4gICAgfSxcbnNldElucHV0OmZ1bmN0aW9uIChpbnB1dCkge1xuICAgICAgICB0aGlzLl9pbnB1dCA9IGlucHV0O1xuICAgICAgICB0aGlzLl9tb3JlID0gdGhpcy5fbGVzcyA9IHRoaXMuZG9uZSA9IGZhbHNlO1xuICAgICAgICB0aGlzLnl5bGluZW5vID0gdGhpcy55eWxlbmcgPSAwO1xuICAgICAgICB0aGlzLnl5dGV4dCA9IHRoaXMubWF0Y2hlZCA9IHRoaXMubWF0Y2ggPSAnJztcbiAgICAgICAgdGhpcy5jb25kaXRpb25TdGFjayA9IFsnSU5JVElBTCddO1xuICAgICAgICB0aGlzLnl5bGxvYyA9IHtmaXJzdF9saW5lOjEsZmlyc3RfY29sdW1uOjAsbGFzdF9saW5lOjEsbGFzdF9jb2x1bW46MH07XG4gICAgICAgIGlmICh0aGlzLm9wdGlvbnMucmFuZ2VzKSB0aGlzLnl5bGxvYy5yYW5nZSA9IFswLDBdO1xuICAgICAgICB0aGlzLm9mZnNldCA9IDA7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH0sXG5pbnB1dDpmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBjaCA9IHRoaXMuX2lucHV0WzBdO1xuICAgICAgICB0aGlzLnl5dGV4dCArPSBjaDtcbiAgICAgICAgdGhpcy55eWxlbmcrKztcbiAgICAgICAgdGhpcy5vZmZzZXQrKztcbiAgICAgICAgdGhpcy5tYXRjaCArPSBjaDtcbiAgICAgICAgdGhpcy5tYXRjaGVkICs9IGNoO1xuICAgICAgICB2YXIgbGluZXMgPSBjaC5tYXRjaCgvKD86XFxyXFxuP3xcXG4pLiovZyk7XG4gICAgICAgIGlmIChsaW5lcykge1xuICAgICAgICAgICAgdGhpcy55eWxpbmVubysrO1xuICAgICAgICAgICAgdGhpcy55eWxsb2MubGFzdF9saW5lKys7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLnl5bGxvYy5sYXN0X2NvbHVtbisrO1xuICAgICAgICB9XG4gICAgICAgIGlmIC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zLm1hdGNoO1xuICAgICAgICBpZiAobmV4dC5sZW5ndGggPCAyMCkge1xuICAgICAgICAgICAgbmV4dCArPSB0aGlzLl9pbnB1dC5zdWJzdHIoMCwgMjAtbmV4dC5sZW5ndGgpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiAobmV4dC5zdWJzdHIoMCwyMCkrKG5leHQubGVuZ3RoID4gMjAgPyAnLi4uJzonJykpLnJlcGxhY2UoL1xcbi9nLCBcIlwiKTtcbiAgICB9LFxuc2hvd1Bvc2l0aW9uOmZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIHByZSA9IHRoaXMucGFzdElucHV0KCk7XG4gICAgICAgIHZhciBjID0gbmV3IEFycmF5KHByZS5sZW5ndGggKyAxKS5qb2luKFwiLVwiKTtcbiAgICAgICAgcmV0dXJuIHByZSArIHRoaXMudXBjb21pbmdJbnB1dCgpICsgXCJcXG5cIiArIGMrXCJeXCI7XG4gICAgfSxcbm5leHQ6ZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAodGhpcy5kb25lKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5FT0Y7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCF0aGlzLl9pbnB1dCkgdGhpcy5kb25lID0gdHJ1ZTtcblxuICAgICAgICB2YXIgdG9rZW4sXG4gICAgICAgICAgICBtYXRjaCxcbiAgICAgICAgICAgIHRlbXBNYXRjaCxcbiAgICAgICAgICAgIGluZGV4LFxuICAgICAgICAgICAgY29sLFxuICAgICAgICAgICAgbGluZXM7XG4gICAgICAgIGlmICghdGhpcy5fbW9yZSkge1xuICAgICAgICAgICAgdGhpcy55eXRleHQgPSAnJztcbiAgICAgICAgICAgIHRoaXMubWF0Y2ggPSAnJztcbiAgICAgICAgfVxuICAgICAgICB2YXIgcnVsZXMgPSB0aGlzLl9jdXJyZW50UnVsZXMoKTtcbiAgICAgICAgZm9yICh2YXIgaT0wO2kgPCBydWxlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdGVtcE1hdGNoID0gdGhpcy5faW5wdXQubWF0Y2godGhpcy5ydWxlc1tydWxlc1tpXV0pO1xuICAgICAgICAgICAgaWYgKHRlbXBNYXRjaCAmJiAoIW1hdGNoIHx8IHRlbXBNYXRjaFswXS5sZW5ndGggPiBtYXRjaFswXS5sZW5ndGgpKSB7XG4gICAgICAgICAgICAgICAgbWF0Y2ggPSB0ZW1wTWF0Y2g7XG4gICAgICAgICAgICAgICAgaW5kZXggPSBpO1xuICAgICAgICAgICAgICAgIGlmICghdGhpcy5vcHRpb25zLmZsZXgpIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChtYXRjaCkge1xuICAgICAgICAgICAgbGluZXMgPSBtYXRjaFswXS5tYXRjaCgvKD86XFxyXFxuP3xcXG4pLiovZyk7XG4gICAgICAgICAgICBpZiAobGluZXMpIHRoaXMueXlsaW5lbm8gKz0gbGluZXMubGVuZ3RoO1xuICAgICAgICAgICAgdGhpcy55eWxsb2MgPSB7Zmlyc3RfbGluZTogdGhpcy55eWxsb2MubGFzdF9saW5lLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFzdF9saW5lOiB0aGlzLnl5bGluZW5vKzEsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICBmaXJzdF9jb2x1bW46IHRoaXMueXlsbG9jLmxhc3RfY29sdW1uLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFzdF9jb2x1bW46IGxpbmVzID8gbGluZXNbbGluZXMubGVuZ3RoLTFdLmxlbmd0aC1saW5lc1tsaW5lcy5sZW5ndGgtMV0ubWF0Y2goL1xccj9cXG4/LylbMF0ubGVuZ3RoIDogdGhpcy55eWxsb2MubGFzdF9jb2x1bW4gKyBtYXRjaFswXS5sZW5ndGh9O1xuICAgICAgICAgICAgdGhpcy55eXRleHQgKz0gbWF0Y2hbMF07XG4gICAgICAgICAgICB0aGlzLm1hdGNoICs9IG1hdGNoWzBdO1xuICAgIC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Z19uYW1lX2NvbGxpc2lvbnMsWVlfU1RBUlQpIHtcblxuXG5mdW5jdGlvbiBzdHJpcChzdGFydCwgZW5kKSB7XG4gIHJldHVybiB5eV8ueXl0ZXh0ID0geXlfLnl5dGV4dC5zdWJzdHIoc3RhcnQsIHl5Xy55eWxlbmctZW5kKTtcbn1cblxuXG52YXIgWVlTVEFURT1ZWV9TVEFSVFxuc3dpdGNoKCRhdm9pZGluZ19uYW1lX2NvbGxpc2lvbnMpIHtcbmNhc2UgMDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoeXlfLnl5dGV4dC5zbGljZSgtMikgPT09IFwiXFxcXFxcXFxcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmlwKDAsMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5iZWdpbihcIm11XCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYoeXlfLnl5dGV4dC5zbGljZSgtMSkgPT09IFwiXFxcXFwiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyaXAoMCwxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmJlZ2luKFwiZW11XCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuYmVnaW4oXCJtdVwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZih5eV8ueXl0ZXh0KSByZXR1cm4gMTQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcbmJyZWFrO1xuY2FzZSAxOnJldHVybiAxNDtcbmJyZWFrO1xuY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBvcFN0YXRlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAxNDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxuYnJlYWs7XG5jYXNlIDM6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeXlfLnl5dGV4dCA9IHl5Xy55eXRleHQuc3Vic3RyKDUsIHl5Xy55eWxlbmctOSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wb3BTdGF0ZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAxNjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxuYnJlYWs7XG5jYXNlIDQ6IHJldHVybiAxNDsgXG5icmVhaztcbmNhc2UgNTpcbiAgdGhpcy5wb3BTdGF0ZSgpO1xuICByZXR1cm4gMTM7XG5cbmJyZWFrO1xuY2FzZSA2OnJldHVybiA1OTtcbmJyZWFrO1xuY2FzZSA3OnJldHVybiA2MjtcbmJyZWFrO1xuY2FzZSA4OiByZXR1cm4gMTc7IFxuYnJlYWs7XG5jYXNlIDk6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wb3BTdGF0ZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuYmVnaW4oJ3JhdycpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAyMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxuYnJlYWs7XG5jYXNlIDEwOnJldHVybiA1MztcbmJyZWFrO1xuY2FzZSAxMTpyZXR1cm4gMjc7XG5icmVhaztcbmNhc2UgMTI6cmV0dXJuIDQ1O1xuYnJlYWs7XG5jYXNlIDEzOnRoaXMucG9wU3RhdGUoKTsgcmV0dXJuIDQyO1xuYnJlYWs7XG5jYXNlIDE0OnRoa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sXCJpbmNsdXNpdmVcIjpmYWxzZX0sXCJJTklUSUFMXCI6e1wicnVsZXNcIjpbMCwxLDQyXSxcImluY2x1c2l2ZVwiOnRydWV9fTtcbnJldHVybiBsZXhlcjt9KSgpXG5wYXJzZXIubGV4ZXIgPSBsZXhlcjtcbmZ1bmN0aW9uIFBhcnNlciAoKSB7IHRoaXMueXkgPSB7fTsgfVBhcnNlci5wcm90b3R5cGUgPSBwYXJzZXI7cGFyc2VyLlBhcnNlciA9IFBhcnNlcjtcbnJldHVybiBuZXcgUGFyc2VyO1xufSkoKTtleHBvcnQgZGVmYXVsdCBoYW5kbGViYXJzO1xuIl19 + enifed('handlebars/compiler/visitor', ['exports', 'handlebars/exception', 'handlebars/compiler/ast'], function (exports, _handlebarsException, _handlebarsCompilerAst) { 'use strict'; @@ -26276,7 +26253,7 @@ enifed('handlebars/compiler/visitor', ['exports', 'handlebars/exception', 'handl exports.default = Visitor; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImhhbmRsZWJhcnMvY29tcGlsZXIvdmlzaXRvci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFHQSxXQUFTLE9BQU8sR0FBRztBQUNqQixRQUFJLENBQUMsT0FBTyxHQUFHLEVBQUUsQ0FBQztHQUNuQjs7QUFFRCxTQUFPLENBQUMsU0FBUyxHQUFHO0FBQ2xCLGVBQVcsRUFBRSxPQUFPO0FBQ3BCLFlBQVEsRUFBRSxLQUFLOzs7QUFHZixhQUFTLEVBQUUsVUFBUyxJQUFJLEVBQUUsSUFBSSxFQUFFO0FBQzlCLFVBQUksS0FBSyxHQUFHLElBQUksQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUM7QUFDcEMsVUFBSSxJQUFJLENBQUMsUUFBUSxFQUFFOztBQUVqQixZQUFJLEtBQUssS0FBSyxDQUFDLEtBQUssQ0FBQyxJQUFJLElBQ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lcHRSZXF1aXJlZChwYWlyLCAndmFsdWUnKTtcbiAgfVxufTtcblxuZXhwb3J0IGRlZmF1bHQgVmlzaXRvcjtcbiJdfQ== + enifed('handlebars/compiler/whitespace-control', ['exports', 'handlebars/compiler/visitor'], function (exports, _handlebarsCompilerVisitor) { 'use strict'; @@ -26482,7 +26459,7 @@ enifed('handlebars/compiler/whitespace-control', ['exports', 'handlebars/compile exports.default = WhitespaceControl; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImhhbmRsZWJhcnMvY29tcGlsZXIvd2hpdGVzcGFjZS1jb250cm9sLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBLFdBQVMsaUJBQWlCLEdBQUcsRUFDNUI7QUFDRCxtQkFBaUIsQ0FBQyxTQUFTLEdBQUcsd0NBQWEsQ0FBQzs7QUFFNUMsbUJBQWlCLENBQUMsU0FBUyxDQUFDLE9BQU8sR0FBRyxVQUFTLE9BQU8sRUFBRTtBQUN0RCxRQUFJLE1BQU0sR0FBRyxDQUFDLElBQUksQ0FBQyxVQUFVLENBQUM7QUFDOUIsUUFBSSxDQUFDLFVBQVUsR0FBRyxJQUFJLENBQUM7O0FBRXZCLFFBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUM7QUFDeEIsU0FBSyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxHQUFHLElBQUksQ0FBQyxNQUFNLEVBQUUsQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEVBQUUsRUFBRTtBQUMzQyxVQUFJLE9BQU8sR0FBRyxJQUFJLENBQUMsQ0FBQyxDQUFDO1VBQ2pCLEtBQUssR0FBRyxJQUFJLENBQUMsTUFBTSxDQUFDLE9BQU8sQ0FBQyxDQUFDOztBQUVqQyxVQUFJLENBQUMsS0FBSyxFQUFFO0FBQ1YsaUJBQVM7T0FDVjs7QUFFRCxVQUFJLGlCQU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W4gdGhlIGxhc3QgY2hpbGQgd2lsbCBiZSBtYXJrZWQgYXMgc3VjaC5cbi8vXG4vLyBJZiBtdWxpdHBsZSBpcyB0cnV0aHkgdGhlbiBhbGwgd2hpdGVzcGFjZSB3aWxsIGJlIHN0cmlwcGVkIG91dCB1bnRpbCBub24td2hpdGVzcGFjZVxuLy8gY29udGVudCBpcyBtZXQuXG5mdW5jdGlvbiBvbWl0TGVmdChib2R5LCBpLCBtdWx0aXBsZSkge1xuICBsZXQgY3VycmVudCA9IGJvZHlbaSA9PSBudWxsID8gYm9keS5sZW5ndGggLSAxIDogaSAtIDFdO1xuICBpZiAoIWN1cnJlbnQgfHwgY3VycmVudC50eXBlICE9PSAnQ29udGVudFN0YXRlbWVudCcgfHwgKCFtdWx0aXBsZSAmJiBjdXJyZW50LmxlZnRTdHJpcHBlZCkpIHtcbiAgICByZXR1cm47XG4gIH1cblxuICAvLyBXZSBvbWl0IHRoZSBsYXN0IG5vZGUgaWYgaXQncyB3aGl0ZXNwYWNlIG9ubHkgYW5kIG5vdCBwcmVjZWVkZWQgYnkgYSBub24tY29udGVudCBub2RlLlxuICBsZXQgb3JpZ2luYWwgPSBjdXJyZW50LnZhbHVlO1xuICBjdXJyZW50LnZhbHVlID0gY3VycmVudC52YWx1ZS5yZXBsYWNlKG11bHRpcGxlID8gKC9cXHMrJC8pIDogKC9bIFxcdF0rJC8pLCAnJyk7XG4gIGN1cnJlbnQubGVmdFN0cmlwcGVkID0gY3VycmVudC52YWx1ZSAhPT0gb3JpZ2luYWw7XG4gIHJldHVybiBjdXJyZW50LmxlZnRTdHJpcHBlZDtcbn1cblxuZXhwb3J0IGRlZmF1bHQgV2hpdGVzcGFjZUNvbnRyb2w7XG4iXX0= + enifed('handlebars/exception', ['exports'], function (exports) { 'use strict'; @@ -26520,7 +26497,7 @@ enifed('handlebars/exception', ['exports'], function (exports) { exports.default = Exception; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2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WR4XV0gPSB0bXBbZXJyb3JQcm9wc1tpZHhdXTtcbiAgfVxuXG4gIGlmIChFcnJvci5jYXB0dXJlU3RhY2tUcmFjZSkge1xuICAgIEVycm9yLmNhcHR1cmVTdGFja1RyYWNlKHRoaXMsIEV4Y2VwdGlvbik7XG4gIH1cblxuICBpZiAobG9jKSB7XG4gICAgdGhpcy5saW5lTnVtYmVyID0gbGluZTtcbiAgICB0aGlzLmNvbHVtbiA9IGNvbHVtbjtcbiAgfVxufVxuXG5FeGNlcHRpb24ucHJvdG90eXBlID0gbmV3IEVycm9yKCk7XG5cbmV4cG9ydCBkZWZhdWx0IEV4Y2VwdGlvbjtcbiJdfQ== + enifed('handlebars/safe-string', ['exports'], function (exports) { // Build out our basic SafeString type 'use strict'; @@ -26535,7 +26512,7 @@ enifed('handlebars/safe-string', ['exports'], function (exports) { exports.default = SafeString; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImhhbmRsZWJhcnMvc2FmZS1zdHJpbmcuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUNBLFdBQVMsVUFBVSxDQUFDLE1BQU0sRUFBRTtBQUMxQixRQUFJLENBQUMsTUFBTSxHQUFHLE1BQU0sQ0FBQztHQUN0Qjs7QUFFRCxZQUFVLENBQUMsU0FBUyxDQUFDLFFBQVEsR0FBRyxVQUFVLENBQUMsU0FBUyxDQUFDLE1BQU0sR0FBRyxZQUFXO0FBQ3ZFLFdBQU8sRUFBRSxHQUFHLElBQUksQ0FBQyxNQUFNLENBQUM7R0FDekIsQ0FBQzs7b0JBRWEsVUFBVSIsImZpbGUiOiJoYW5kbGViYXJzL3NhZmUtc3RyaW5nLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8gQnVpbGQgb3V0IG91ciBiYXNpYyBTYWZlU3RyaW5nIHR5cGVcbmZ1bmN0aW9uIFNhZmVTdHJpbmcoc3RyaW5nKSB7XG4gIHRoaXMuc3RyaW5nID0gc3RyaW5nO1xufVxuXG5TYWZlU3RyaW5nLnByb3RvdHlwZS50b1N0cmluZyA9IFNhZmVTdHJpbmcucHJvdG90eXBlLnRvSFRNTCA9IGZ1bmN0aW9uKCkge1xuICByZXR1cm4gJycgKyB0aGlzLnN0cmluZztcbn07XG5cbmV4cG9ydCBkZWZhdWx0IFNhZmVTdHJpbmc7XG4iXX0= + enifed('handlebars/utils', ['exports'], function (exports) { 'use strict'; @@ -26652,7 +26629,7 @@ enifed('handlebars/utils', ['exports'], function (exports) { return (contextPath ? contextPath + '.' : '') + id; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImhhbmRsZWJhcnMvdXRpbHMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBQUEsTUFBTSxNQUFNLEdBQUc7QUFDYixPQUFHLEVBQUUsT0FBTztBQUNaLE9BQUcsRUFBRSxNQUFNO0FBQ1gsT0FBRyxFQUFFLE1BQU07QUFDWCxPQUFHLEVBQUUsUUFBUTtBQUNiLE9BQUcsRUFBRSxRQUFRO0FBQ2IsT0FBRyxFQUFFLFFBQVE7R0FDZCxDQUFDOztBQUVGLE1BQU0sUUFBUSxHQUFHLFdBQVc7TUFDdEIsUUFBUSxHQUFHLFVBQVUsQ0FBQzs7QUFFNUIsV0FBUyxVQUFVLENBQUMsR0FBRyxFQUFFO0FBQ3ZCLFdBQU8sTUFBTSxDQUFDLEdBQUcsQ0FBQyxDQUFDO0dBQ3BCOztBQUVNLFdBQVMsTUFBTSxDQUFDLEdBQUcsb0JBQW9CO0FBQzVDLFNBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsR0FBRyxTQUFTLENBQUMsTUFBTSxFQUFFLENBQUMsRUFBRSxFQUFFO0FBQ3pDLFdBQUssSUFBSSxHQUFHLElBQUksU0FBUyxDQUFDLENBQUMsQ0FBQyxFQUFFO0FBQzVCLFlB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ZyBoYXMgZXNjYXBlZCBjaGFyYWN0ZXJzIGluIGl0LlxuICAgIHN0cmluZyA9ICcnICsgc3RyaW5nO1xuICB9XG5cbiAgaWYgKCFwb3NzaWJsZS50ZXN0KHN0cmluZykpIHsgcmV0dXJuIHN0cmluZzsgfVxuICByZXR1cm4gc3RyaW5nLnJlcGxhY2UoYmFkQ2hhcnMsIGVzY2FwZUNoYXIpO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gaXNFbXB0eSh2YWx1ZSkge1xuICBpZiAoIXZhbHVlICYmIHZhbHVlICE9PSAwKSB7XG4gICAgcmV0dXJuIHRydWU7XG4gIH0gZWxzZSBpZiAoaXNBcnJheSh2YWx1ZSkgJiYgdmFsdWUubGVuZ3RoID09PSAwKSB7XG4gICAgcmV0dXJuIHRydWU7XG4gIH0gZWxzZSB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBibG9ja1BhcmFtcyhwYXJhbXMsIGlkcykge1xuICBwYXJhbXMucGF0aCA9IGlkcztcbiAgcmV0dXJuIHBhcmFtcztcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGFwcGVuZENvbnRleHRQYXRoKGNvbnRleHRQYXRoLCBpZCkge1xuICByZXR1cm4gKGNvbnRleHRQYXRoID8gY29udGV4dFBhdGggKyAnLicgOiAnJykgKyBpZDtcbn1cbiJdfQ== + enifed("simple-html-tokenizer/entity-parser", ["exports"], function (exports) { "use strict"; diff --git a/ember-testing.js b/ember-testing.js index f833d82e8..900da04bc 100644 --- a/ember-testing.js +++ b/ember-testing.js @@ -6,10 +6,11 @@ * 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.11.0-beta.2 + * @version 2.10.2-with-backtracking */ var enifed, requireModule, Ember; +var mainContext = this; (function() { var isNode = typeof window === 'undefined' && @@ -111,6 +112,8 @@ var enifed, requireModule, Ember; } })(); +var babelHelpers; + function classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); @@ -301,6 +304,7 @@ enifed('ember-debug/deprecate', ['exports', 'ember-metal', 'ember-console', 'emb emberjs.com website. @for Ember @public + @since 1.0.0 */ function deprecate(message, test, options) { @@ -399,6 +403,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'emb @param {Boolean} test Must be truthy for the assertion to pass. If falsy, an exception will be thrown. @public + @since 1.0.0 */ _emberMetal.setDebugFunction('assert', function assert(desc, test) { if (!test) { @@ -721,6 +726,7 @@ enifed('ember-debug/warn', ['exports', 'ember-console', 'ember-metal', 'ember-de The `id` should be namespaced by dots, e.g. "ember-debug.feature-flag-with-features-stripped" @for Ember @public + @since 1.0.0 */ function warn(message, test, options) { @@ -1681,6 +1687,7 @@ enifed('ember-testing/helpers/wait', ['exports', 'ember-testing/test/waiters', ' @param {Object} value The value to be returned. @return {RSVP.Promise} @public + @since 1.0.0 */ function wait(app, value) { @@ -1754,9 +1761,7 @@ enifed('ember-testing/initializers', ['exports', 'ember-runtime'], function (exp } }); }); -enifed('ember-testing/setup_for_testing', ['exports', 'ember-metal', 'ember-views', 'ember-testing/test/adapter', 'ember-testing/test/pending_requests', 'ember-testing/adapters/adapter', 'ember-testing/adapters/qunit'], function (exports, _emberMetal, _emberViews, _emberTestingTestAdapter, _emberTestingTestPending_requests, _emberTestingAdaptersAdapter, _emberTestingAdaptersQunit) { - /* global self */ - +enifed('ember-testing/setup_for_testing', ['exports', 'ember-metal', 'ember-views', 'ember-testing/test/adapter', 'ember-testing/test/pending_requests', 'ember-testing/adapters/qunit'], function (exports, _emberMetal, _emberViews, _emberTestingTestAdapter, _emberTestingTestPending_requests, _emberTestingAdaptersQunit) { 'use strict'; exports.default = setupForTesting; @@ -1780,7 +1785,7 @@ enifed('ember-testing/setup_for_testing', ['exports', 'ember-metal', 'ember-view var adapter = _emberTestingTestAdapter.getAdapter(); // if adapter is not manually set default to QUnit if (!adapter) { - _emberTestingTestAdapter.setAdapter(typeof self.QUnit === 'undefined' ? new _emberTestingAdaptersAdapter.default() : new _emberTestingAdaptersQunit.default()); + _emberTestingTestAdapter.setAdapter(new _emberTestingAdaptersQunit.default()); } _emberViews.jQuery(document).off('ajaxSend', _emberTestingTestPending_requests.incrementPendingRequests); diff --git a/ember-tests.js b/ember-tests.js new file mode 100644 index 000000000..dce565519 --- /dev/null +++ b/ember-tests.js @@ -0,0 +1,82990 @@ +;(function() { +/*! + * @overview Ember - JavaScript Application Framework + * @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.10.2-with-backtracking + */ + +var enifed, requireModule, Ember; +var mainContext = this; + +(function() { + var isNode = typeof window === 'undefined' && + typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; + + if (!isNode) { + Ember = this.Ember = this.Ember || {}; + } + + if (typeof Ember === 'undefined') { Ember = {}; } + + if (typeof Ember.__loader === 'undefined') { + var registry = {}; + var seen = {}; + + enifed = function(name, deps, callback) { + var value = { }; + + if (!callback) { + value.deps = []; + value.callback = deps; + } else { + value.deps = deps; + value.callback = callback; + } + + registry[name] = value; + }; + + requireModule = function(name) { + return internalRequire(name, null); + }; + + // setup `require` module + requireModule['default'] = requireModule; + + requireModule.has = function registryHas(moduleName) { + return !!registry[moduleName] || !!registry[moduleName + '/index']; + }; + + function missingModule(name, referrerName) { + if (referrerName) { + throw new Error('Could not find module ' + name + ' required by: ' + referrerName); + } else { + throw new Error('Could not find module ' + name); + } + } + + function internalRequire(_name, referrerName) { + var name = _name; + var mod = registry[name]; + + if (!mod) { + name = name + '/index'; + mod = registry[name]; + } + + var exports = seen[name]; + + if (exports !== undefined) { + return exports; + } + + exports = seen[name] = {}; + + if (!mod) { + missingModule(_name, referrerName); + } + + var deps = mod.deps; + var callback = mod.callback; + var reified = new Array(deps.length); + + for (var i = 0; i < deps.length; i++) { + if (deps[i] === 'exports') { + reified[i] = exports; + } else if (deps[i] === 'require') { + reified[i] = requireModule; + } else { + reified[i] = internalRequire(deps[i], name); + } + } + + callback.apply(this, reified); + + return exports; + } + + requireModule._eak_seen = registry; + + Ember.__loader = { + define: enifed, + require: requireModule, + registry: registry + }; + } else { + enifed = Ember.__loader.define; + requireModule = Ember.__loader.require; + } +})(); + +var babelHelpers; + +function classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } +} + +function inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : defaults(subClass, superClass); +} + +function taggedTemplateLiteralLoose(strings, raw) { + strings.raw = raw; + return strings; +} + +function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } +} + +function createClass(Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; +} + +function interopExportWildcard(obj, defaults) { + var newObj = defaults({}, obj); + delete newObj['default']; + return newObj; +} + +function defaults(obj, defaults) { + var keys = Object.getOwnPropertyNames(defaults); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = Object.getOwnPropertyDescriptor(defaults, key); + if (value && value.configurable && obj[key] === undefined) { + Object.defineProperty(obj, key, value); + } + } + return obj; +} + +babelHelpers = { + classCallCheck: classCallCheck, + inherits: inherits, + taggedTemplateLiteralLoose: taggedTemplateLiteralLoose, + slice: Array.prototype.slice, + createClass: createClass, + interopExportWildcard: interopExportWildcard, + defaults: defaults +}; + +enifed('container/container.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - container'); + test('container/container.js should pass jscs', function () { + ok(true, 'container/container.js should pass jscs.'); + }); +}); +enifed('container/container.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - container'); + QUnit.test('container/container.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'container/container.js should pass jshint.'); + }); +}); +enifed('container/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - container'); + test('container/index.js should pass jscs', function () { + ok(true, 'container/index.js should pass jscs.'); + }); +}); +enifed('container/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - container'); + QUnit.test('container/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'container/index.js should pass jshint.'); + }); +}); +enifed('container/registry.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - container'); + test('container/registry.js should pass jscs', function () { + ok(true, 'container/registry.js should pass jscs.'); + }); +}); +enifed('container/registry.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - container'); + QUnit.test('container/registry.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'container/registry.js should pass jshint.'); + }); +}); +enifed('container/tests/container_test', ['exports', 'ember-utils', 'ember-environment', 'ember-metal', 'container/index', 'internal-test-helpers'], function (exports, _emberUtils, _emberEnvironment, _emberMetal, _containerIndex, _internalTestHelpers) { + 'use strict'; + + var originalModelInjections = undefined; + + QUnit.module('Container', { + setup: function () { + originalModelInjections = _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS; + }, + teardown: function () { + _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS = originalModelInjections; + } + }); + + QUnit.test('A registered factory returns the same instance each time', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + + var postController = container.lookup('controller:post'); + + ok(postController instanceof PostController, 'The lookup is an instance of the factory'); + + equal(postController, container.lookup('controller:post')); + }); + + QUnit.test('A registered factory is returned from lookupFactory', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + + var PostControllerFactory = container.lookupFactory('controller:post'); + + ok(PostControllerFactory, 'factory is returned'); + ok(PostControllerFactory.create() instanceof PostController, 'The return of factory.create is an instance of PostController'); + }); + + QUnit.test('A registered factory is returned from lookupFactory is the same factory each time', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + + deepEqual(container.lookupFactory('controller:post'), container.lookupFactory('controller:post'), 'The return of lookupFactory is always the same'); + }); + + QUnit.test('A factory returned from lookupFactory has a debugkey', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + var PostFactory = container.lookupFactory('controller:post'); + equal(PostFactory._debugContainerKey, 'controller:post', 'factory instance receives _debugContainerKey'); + }); + + QUnit.test('fallback for to create time injections if factory has no extend', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var AppleController = _internalTestHelpers.factory(); + var PostController = _internalTestHelpers.factory(); + + PostController.extend = undefined; // remove extend + + registry.register('controller:apple', AppleController); + registry.register('controller:post', PostController); + registry.injection('controller:post', 'apple', 'controller:apple'); + + var postController = container.lookup('controller:post'); + + equal(postController._debugContainerKey, 'controller:post', 'instance receives _debugContainerKey'); + ok(postController.apple instanceof AppleController, 'instance receives an apple of instance AppleController'); + }); + + QUnit.test('The descendants of a factory returned from lookupFactory have a container and debugkey', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + var instance = undefined; + + registry.register('controller:post', PostController); + instance = container.lookupFactory('controller:post').create(); + + equal(instance._debugContainerKey, 'controller:post', 'factory instance receives _debugContainerKey'); + + ok(instance instanceof PostController, 'factory instance is instance of factory'); + }); + + QUnit.test('A registered factory returns a fresh instance if singleton: false is passed as an option', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + + var postController1 = container.lookup('controller:post'); + var postController2 = container.lookup('controller:post', { singleton: false }); + var postController3 = container.lookup('controller:post', { singleton: false }); + var postController4 = container.lookup('controller:post'); + + equal(postController1.toString(), postController4.toString(), 'Singleton factories looked up normally return the same value'); + notEqual(postController1.toString(), postController2.toString(), 'Singleton factories are not equal to factories looked up with singleton: false'); + notEqual(postController2.toString(), postController3.toString(), 'Two factories looked up with singleton: false are not equal'); + notEqual(postController3.toString(), postController4.toString(), 'A singleton factory looked up after a factory called with singleton: false is not equal'); + + ok(postController1 instanceof PostController, 'All instances are instances of the registered factory'); + ok(postController2 instanceof PostController, 'All instances are instances of the registered factory'); + ok(postController3 instanceof PostController, 'All instances are instances of the registered factory'); + ok(postController4 instanceof PostController, 'All instances are instances of the registered factory'); + }); + + QUnit.test('A factory type with a registered injection\'s instances receive that injection', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + var Store = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + registry.register('store:main', Store); + + registry.typeInjection('controller', 'store', 'store:main'); + + var postController = container.lookup('controller:post'); + var store = container.lookup('store:main'); + + equal(postController.store, store); + }); + + QUnit.test('An individual factory with a registered injection receives the injection', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + var Store = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + registry.register('store:main', Store); + + registry.injection('controller:post', 'store', 'store:main'); + + var postController = container.lookup('controller:post'); + var store = container.lookup('store:main'); + + equal(store._debugContainerKey, 'store:main'); + + equal(postController._debugContainerKey, 'controller:post'); + equal(postController.store, store, 'has the correct store injected'); + }); + + QUnit.test('A factory with both type and individual injections', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + var Store = _internalTestHelpers.factory(); + var Router = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + registry.register('store:main', Store); + registry.register('router:main', Router); + + registry.injection('controller:post', 'store', 'store:main'); + registry.typeInjection('controller', 'router', 'router:main'); + + var postController = container.lookup('controller:post'); + var store = container.lookup('store:main'); + var router = container.lookup('router:main'); + + equal(postController.store, store); + equal(postController.router, router); + }); + + QUnit.test('A factory with both type and individual factoryInjections', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + var Store = _internalTestHelpers.factory(); + var Router = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + registry.register('store:main', Store); + registry.register('router:main', Router); + + registry.factoryInjection('controller:post', 'store', 'store:main'); + registry.factoryTypeInjection('controller', 'router', 'router:main'); + + var PostControllerFactory = container.lookupFactory('controller:post'); + var store = container.lookup('store:main'); + var router = container.lookup('router:main'); + + equal(PostControllerFactory.store, store, 'PostControllerFactory has the instance of store'); + equal(PostControllerFactory.router, router, 'PostControllerFactory has the route instance'); + }); + + QUnit.test('A non-singleton instance is never cached', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostView = _internalTestHelpers.factory(); + + registry.register('view:post', PostView, { singleton: false }); + + var postView1 = container.lookup('view:post'); + var postView2 = container.lookup('view:post'); + + ok(postView1 !== postView2, 'Non-singletons are not cached'); + }); + + QUnit.test('A non-instantiated property is not instantiated', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + + var template = function () {}; + registry.register('template:foo', template, { instantiate: false }); + equal(container.lookup('template:foo'), template); + }); + + QUnit.test('A failed lookup returns undefined', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + + equal(container.lookup('doesnot:exist'), undefined); + }); + + QUnit.test('An invalid factory throws an error', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + + registry.register('controller:foo', {}); + + throws(function () { + container.lookup('controller:foo'); + }, /Failed to create an instance of \'controller:foo\'/); + }); + + QUnit.test('Injecting a failed lookup raises an error', function () { + _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS = true; + + var registry = new _containerIndex.Registry(); + var container = registry.container(); + + var fooInstance = {}; + var fooFactory = {}; + + var Foo = { + create: function (args) { + return fooInstance; + }, + extend: function (args) { + return fooFactory; + } + }; + + registry.register('model:foo', Foo); + registry.injection('model:foo', 'store', 'store:main'); + + throws(function () { + container.lookup('model:foo'); + }); + }); + + QUnit.test('Injecting a falsy value does not raise an error', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var ApplicationController = _internalTestHelpers.factory(); + + registry.register('controller:application', ApplicationController); + registry.register('user:current', null, { instantiate: false }); + registry.injection('controller:application', 'currentUser', 'user:current'); + + strictEqual(container.lookup('controller:application').currentUser, null); + }); + + QUnit.test('The container returns same value each time even if the value is falsy', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + + registry.register('falsy:value', null, { instantiate: false }); + + strictEqual(container.lookup('falsy:value'), container.lookup('falsy:value')); + }); + + QUnit.test('Destroying the container destroys any cached singletons', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + var PostView = _internalTestHelpers.factory(); + var template = function () {}; + + registry.register('controller:post', PostController); + registry.register('view:post', PostView, { singleton: false }); + registry.register('template:post', template, { instantiate: false }); + + registry.injection('controller:post', 'postView', 'view:post'); + + var postController = container.lookup('controller:post'); + var postView = postController.postView; + + ok(postView instanceof PostView, 'The non-singleton was injected'); + + container.destroy(); + + ok(postController.isDestroyed, 'Singletons are destroyed'); + ok(!postView.isDestroyed, 'Non-singletons are not destroyed'); + }); + + QUnit.test('The container can use a registry hook to resolve factories lazily', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + + registry.resolver = { + resolve: function (fullName) { + if (fullName === 'controller:post') { + return PostController; + } + } + }; + + var postController = container.lookup('controller:post'); + + ok(postController instanceof PostController, 'The correct factory was provided'); + }); + + QUnit.test('The container normalizes names before resolving', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + + registry.normalizeFullName = function (fullName) { + return 'controller:post'; + }; + + registry.register('controller:post', PostController); + var postController = container.lookup('controller:normalized'); + + ok(postController instanceof PostController, 'Normalizes the name before resolving'); + }); + + QUnit.test('The container normalizes names when looking factory up', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + + registry.normalizeFullName = function (fullName) { + return 'controller:post'; + }; + + registry.register('controller:post', PostController); + var fact = container.lookupFactory('controller:normalized'); + + equal(fact.toString() === PostController.extend().toString(), true, 'Normalizes the name when looking factory up'); + }); + + QUnit.test('Options can be registered that should be applied to a given factory', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostView = _internalTestHelpers.factory(); + + registry.resolver = { + resolve: function (fullName) { + if (fullName === 'view:post') { + return PostView; + } + } + }; + + registry.options('view:post', { instantiate: true, singleton: false }); + + var postView1 = container.lookup('view:post'); + var postView2 = container.lookup('view:post'); + + ok(postView1 instanceof PostView, 'The correct factory was provided'); + ok(postView2 instanceof PostView, 'The correct factory was provided'); + + ok(postView1 !== postView2, 'The two lookups are different'); + }); + + QUnit.test('Options can be registered that should be applied to all factories for a given type', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostView = _internalTestHelpers.factory(); + + registry.resolver = { + resolve: function (fullName) { + if (fullName === 'view:post') { + return PostView; + } + } + }; + + registry.optionsForType('view', { singleton: false }); + + var postView1 = container.lookup('view:post'); + var postView2 = container.lookup('view:post'); + + ok(postView1 instanceof PostView, 'The correct factory was provided'); + ok(postView2 instanceof PostView, 'The correct factory was provided'); + + ok(postView1 !== postView2, 'The two lookups are different'); + }); + + QUnit.test('An injected non-singleton instance is never cached', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostView = _internalTestHelpers.factory(); + var PostViewHelper = _internalTestHelpers.factory(); + + registry.register('view:post', PostView, { singleton: false }); + registry.register('view_helper:post', PostViewHelper, { singleton: false }); + registry.injection('view:post', 'viewHelper', 'view_helper:post'); + + var postView1 = container.lookup('view:post'); + var postView2 = container.lookup('view:post'); + + ok(postView1.viewHelper !== postView2.viewHelper, 'Injected non-singletons are not cached'); + }); + + QUnit.test('Factory resolves are cached', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + var resolveWasCalled = []; + registry.resolve = function (fullName) { + resolveWasCalled.push(fullName); + return PostController; + }; + + deepEqual(resolveWasCalled, []); + container.lookupFactory('controller:post'); + deepEqual(resolveWasCalled, ['controller:post']); + + container.lookupFactory('controller:post'); + deepEqual(resolveWasCalled, ['controller:post']); + }); + + QUnit.test('factory for non extendables (MODEL) resolves are cached', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + var resolveWasCalled = []; + registry.resolve = function (fullName) { + resolveWasCalled.push(fullName); + return PostController; + }; + + deepEqual(resolveWasCalled, []); + container.lookupFactory('model:post'); + deepEqual(resolveWasCalled, ['model:post']); + + container.lookupFactory('model:post'); + deepEqual(resolveWasCalled, ['model:post']); + }); + + QUnit.test('factory for non extendables resolves are cached', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = {}; + var resolveWasCalled = []; + + registry.resolve = function (fullName) { + resolveWasCalled.push(fullName); + return PostController; + }; + + deepEqual(resolveWasCalled, []); + container.lookupFactory('foo:post'); + deepEqual(resolveWasCalled, ['foo:post']); + + container.lookupFactory('foo:post'); + deepEqual(resolveWasCalled, ['foo:post']); + }); + + QUnit.test('The `_onLookup` hook is called on factories when looked up the first time', function () { + expect(2); + + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var Apple = _internalTestHelpers.factory(); + + Apple.reopenClass({ + _onLookup: function (fullName) { + equal(fullName, 'apple:main', 'calls lazy injection method with the lookup full name'); + equal(this, Apple, 'calls lazy injection method in the factory context'); + } + }); + + registry.register('apple:main', Apple); + + container.lookupFactory('apple:main'); + container.lookupFactory('apple:main'); + }); + + QUnit.test('A factory\'s lazy injections are validated when first instantiated', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var Apple = _internalTestHelpers.factory(); + var Orange = _internalTestHelpers.factory(); + + Apple.reopenClass({ + _lazyInjections: function () { + return ['orange:main', 'banana:main']; + } + }); + + registry.register('apple:main', Apple); + registry.register('orange:main', Orange); + + throws(function () { + container.lookup('apple:main'); + }, /Attempting to inject an unknown injection: 'banana:main'/); + }); + + QUnit.test('Lazy injection validations are cached', function () { + expect(1); + + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var Apple = _internalTestHelpers.factory(); + var Orange = _internalTestHelpers.factory(); + + Apple.reopenClass({ + _lazyInjections: function () { + ok(true, 'should call lazy injection method'); + return ['orange:main']; + } + }); + + registry.register('apple:main', Apple); + registry.register('orange:main', Orange); + + container.lookup('apple:main'); + container.lookup('apple:main'); + }); + + QUnit.test('An object with its owner pre-set should be returned from ownerInjection', function () { + var owner = {}; + var registry = new _containerIndex.Registry(); + var container = registry.container({ owner: owner }); + + var result = container.ownerInjection(); + + equal(result[_emberUtils.OWNER], owner, 'owner is properly included'); + }); + + QUnit.test('A deprecated `container` property is appended to every object instantiated from an extendable factory', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + registry.register('controller:post', PostController); + var postController = container.lookup('controller:post'); + + expectDeprecation(function () { + _emberMetal.get(postController, 'container'); + }, 'Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.'); + + expectDeprecation(function () { + var c = postController.container; + strictEqual(c, container); + }, 'Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.'); + }); + + QUnit.test('A deprecated `container` property is appended to every object instantiated from a non-extendable factory, and a fake container is available during instantiation.', function () { + expect(8); + + var owner = {}; + var registry = new _containerIndex.Registry(); + var container = registry.container({ owner: owner }); + + // Define a simple non-extendable factory + function PostController(options) { + this.container = options.container; + } + + PostController.create = function (options) { + ok(options.container, 'fake container has been injected and is available during `create`.'); + + expectDeprecation(function () { + options.container.lookup('abc:one'); + }, 'Using the injected `container` is deprecated. Please use the `getOwner` helper to access the owner of this object and then call `lookup` instead.'); + + expectDeprecation(function () { + options.container.lookupFactory('abc:two'); + }, 'Using the injected `container` is deprecated. Please use the `getOwner` helper to access the owner of this object and then call `_lookupFactory` instead.'); + + // non-deprecated usage of `lookup` and `_lookupFactory` + owner.lookup = function (fullName) { + equal(fullName, 'abc:one', 'lookup on owner called properly'); + }; + owner._lookupFactory = function (fullName) { + equal(fullName, 'abc:two', '_lookupFactory on owner called properly'); + }; + var foundOwner = _emberUtils.getOwner(options); + foundOwner.lookup('abc:one'); + foundOwner._lookupFactory('abc:two'); + + return new PostController(options); + }; + + registry.register('controller:post', PostController); + var postController = container.lookup('controller:post'); + + expectDeprecation(function () { + _emberMetal.get(postController, 'container'); + }, 'Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.'); + + expectDeprecation(function () { + var c = postController.container; + strictEqual(c, container, 'Injected container is now regular (not fake) container, but access is still deprecated.'); + }, 'Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.'); + }); + + QUnit.test('A deprecated `container` property is only set on a non-extendable factory instance if `container` is present and writable.', function () { + expect(2); + + var owner = {}; + var registry = new _containerIndex.Registry(); + var container = registry.container({ owner: owner }); + + // Define a non-extendable factory that is frozen after `create` + var PostController = function () {}; + PostController.create = function () { + var instance = new PostController(); + + Object.seal(instance); + + return instance; + }; + + registry.register('controller:post', PostController); + var postController = container.lookup('controller:post'); + + equal(postController.container, undefined, 'container was not added'); + + var OtherController = function () { + this.container = 'foo'; + }; + + OtherController.create = function () { + var instance = new OtherController(); + + Object.freeze(instance); + + return instance; + }; + + registry.register('controller:other', OtherController); + var otherController = container.lookup('controller:other'); + + equal(otherController.container, 'foo', 'container was not added'); + }); + + QUnit.test('An extendable factory can provide `container` upon create, with a deprecation', function (assert) { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + + registry.register('controller:post', _internalTestHelpers.factory()); + + var PostController = container.lookupFactory('controller:post'); + + var postController = undefined; + + expectDeprecation(function () { + postController = PostController.create({ + container: 'foo' + }); + }, /Providing the \`container\` property to .+ is deprecated. Please use \`Ember.setOwner\` or \`owner.ownerInjection\(\)\` instead to provide an owner to the instance being created/); + + expectDeprecation(function () { + var c = postController.container; + assert.equal(c, 'foo', 'the `container` provided to `.create`was used'); + }, 'Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.'); + }); + + QUnit.test('lookupFactory passes options through to expandlocallookup', function (assert) { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + + registry.expandLocalLookup = function (fullName, options) { + assert.ok(true, 'expandLocalLookup was called'); + assert.equal(fullName, 'foo:bar'); + assert.deepEqual(options, { source: 'baz:qux' }); + + return 'controller:post'; + }; + + var PostControllerFactory = container.lookupFactory('foo:bar', { source: 'baz:qux' }); + + assert.ok(PostControllerFactory.create() instanceof PostController, 'The return of factory.create is an instance of PostController'); + }); + + QUnit.test('lookup passes options through to expandlocallookup', function (assert) { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + + registry.expandLocalLookup = function (fullName, options) { + assert.ok(true, 'expandLocalLookup was called'); + assert.equal(fullName, 'foo:bar'); + assert.deepEqual(options, { source: 'baz:qux' }); + + return 'controller:post'; + }; + + var PostControllerLookupResult = container.lookup('foo:bar', { source: 'baz:qux' }); + + assert.ok(PostControllerLookupResult instanceof PostController); + }); +}); +enifed('container/tests/container_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - container/tests'); + test('container/tests/container_test.js should pass jscs', function () { + ok(true, 'container/tests/container_test.js should pass jscs.'); + }); +}); +enifed('container/tests/container_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - container/tests'); + QUnit.test('container/tests/container_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'container/tests/container_test.js should pass jshint.'); + }); +}); +enifed('container/tests/owner_test', ['exports', 'ember-utils'], function (exports, _emberUtils) { + 'use strict'; + + QUnit.module('Owner', {}); + + QUnit.test('An owner can be set with `setOwner` and retrieved with `getOwner`', function () { + var owner = {}; + var obj = {}; + + strictEqual(_emberUtils.getOwner(obj), undefined, 'owner has not been set'); + + _emberUtils.setOwner(obj, owner); + + strictEqual(_emberUtils.getOwner(obj), owner, 'owner has been set'); + + strictEqual(obj[_emberUtils.OWNER], owner, 'owner has been set to the OWNER symbol'); + }); +}); +enifed('container/tests/owner_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - container/tests'); + test('container/tests/owner_test.js should pass jscs', function () { + ok(true, 'container/tests/owner_test.js should pass jscs.'); + }); +}); +enifed('container/tests/owner_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - container/tests'); + QUnit.test('container/tests/owner_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'container/tests/owner_test.js should pass jshint.'); + }); +}); +enifed('container/tests/registry_test', ['exports', 'container/index', 'internal-test-helpers'], function (exports, _containerIndex, _internalTestHelpers) { + 'use strict'; + + QUnit.module('Registry'); + + QUnit.test('A registered factory is returned from resolve', function () { + var registry = new _containerIndex.Registry(); + var PostController = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + + var PostControllerFactory = registry.resolve('controller:post'); + + ok(PostControllerFactory, 'factory is returned'); + ok(PostControllerFactory.create() instanceof PostController, 'The return of factory.create is an instance of PostController'); + }); + + QUnit.test('The registered factory returned from resolve is the same factory each time', function () { + var registry = new _containerIndex.Registry(); + var PostController = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + + deepEqual(registry.resolve('controller:post'), registry.resolve('controller:post'), 'The return of resolve is always the same'); + }); + + QUnit.test('The registered value returned from resolve is the same value each time even if the value is falsy', function () { + var registry = new _containerIndex.Registry(); + + registry.register('falsy:value', null, { instantiate: false }); + + strictEqual(registry.resolve('falsy:value'), registry.resolve('falsy:value'), 'The return of resolve is always the same'); + }); + + QUnit.test('The value returned from resolver is the same value as the original value even if the value is falsy', function () { + var resolver = { + resolve: function (fullName) { + if (fullName === 'falsy:value') { + return null; + } + } + }; + var registry = new _containerIndex.Registry({ resolver: resolver }); + + strictEqual(registry.resolve('falsy:value'), null); + }); + + QUnit.test('A registered factory returns true for `has` if an item is registered', function () { + var registry = new _containerIndex.Registry(); + var PostController = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + + equal(registry.has('controller:post'), true, 'The `has` method returned true for registered factories'); + equal(registry.has('controller:posts'), false, 'The `has` method returned false for unregistered factories'); + }); + + QUnit.test('Throw exception when trying to inject `type:thing` on all type(s)', function () { + var registry = new _containerIndex.Registry(); + var PostController = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + + throws(function () { + registry.typeInjection('controller', 'injected', 'controller:post'); + }, /Cannot inject a 'controller:post' on other controller\(s\)\./); + }); + + QUnit.test('The registry can take a hook to resolve factories lazily', function () { + var PostController = _internalTestHelpers.factory(); + var resolver = { + resolve: function (fullName) { + if (fullName === 'controller:post') { + return PostController; + } + } + }; + var registry = new _containerIndex.Registry({ resolver: resolver }); + + strictEqual(registry.resolve('controller:post'), PostController, 'The correct factory was provided'); + }); + + QUnit.test('The registry respects the resolver hook for `has`', function () { + var PostController = _internalTestHelpers.factory(); + var resolver = { + resolve: function (fullName) { + if (fullName === 'controller:post') { + return PostController; + } + } + }; + var registry = new _containerIndex.Registry({ resolver: resolver }); + + ok(registry.has('controller:post'), 'the `has` method uses the resolver hook'); + }); + + QUnit.test('The registry normalizes names when resolving', function () { + var registry = new _containerIndex.Registry(); + var PostController = _internalTestHelpers.factory(); + + registry.normalizeFullName = function (fullName) { + return 'controller:post'; + }; + + registry.register('controller:post', PostController); + var type = registry.resolve('controller:normalized'); + + strictEqual(type, PostController, 'Normalizes the name when resolving'); + }); + + QUnit.test('The registry normalizes names when checking if the factory is registered', function () { + var registry = new _containerIndex.Registry(); + var PostController = _internalTestHelpers.factory(); + + registry.normalizeFullName = function (fullName) { + return fullName === 'controller:normalized' ? 'controller:post' : fullName; + }; + + registry.register('controller:post', PostController); + var isPresent = registry.has('controller:normalized'); + + equal(isPresent, true, 'Normalizes the name when checking if the factory or instance is present'); + }); + + QUnit.test('validateFullName throws an error if name is incorrect', function () { + expect(2); + + var registry = new _containerIndex.Registry(); + var PostController = _internalTestHelpers.factory(); + + registry.normalize = function (fullName) { + return 'controller:post'; + }; + + registry.register('controller:post', PostController); + throws(function () { + registry.validateFullName('post'); + }, /TypeError: Invalid Fullname, expected: 'type:name' got: post/); + + throws(function () { + registry.validateFullName('route:http://foo.bar.com/baz'); + }, /TypeError: Invalid Fullname, expected: 'type:name' got: route:http:\/\/foo.bar.com\/baz/); + }); + + QUnit.test('The registry normalizes names when injecting', function () { + var registry = new _containerIndex.Registry(); + var PostController = _internalTestHelpers.factory(); + var user = { name: 'Stef' }; + + registry.normalize = function (fullName) { + return 'controller:post'; + }; + + registry.register('controller:post', PostController); + registry.register('user:post', user, { instantiate: false }); + registry.injection('controller:post', 'user', 'controller:normalized'); + + deepEqual(registry.resolve('controller:post'), user, 'Normalizes the name when injecting'); + }); + + QUnit.test('cannot register an `undefined` factory', function () { + var registry = new _containerIndex.Registry(); + + throws(function () { + registry.register('controller:apple', undefined); + }, ''); + }); + + QUnit.test('can re-register a factory', function () { + var registry = new _containerIndex.Registry(); + var FirstApple = _internalTestHelpers.factory('first'); + var SecondApple = _internalTestHelpers.factory('second'); + + registry.register('controller:apple', FirstApple); + registry.register('controller:apple', SecondApple); + + ok(registry.resolve('controller:apple').create() instanceof SecondApple); + }); + + QUnit.test('cannot re-register a factory if it has been resolved', function () { + var registry = new _containerIndex.Registry(); + var FirstApple = _internalTestHelpers.factory('first'); + var SecondApple = _internalTestHelpers.factory('second'); + + registry.register('controller:apple', FirstApple); + strictEqual(registry.resolve('controller:apple'), FirstApple); + + throws(function () { + registry.register('controller:apple', SecondApple); + }, /Cannot re-register: 'controller:apple', as it has already been resolved\./); + + strictEqual(registry.resolve('controller:apple'), FirstApple); + }); + + QUnit.test('registry.has should not accidentally cause injections on that factory to be run. (Mitigate merely on observing)', function () { + expect(1); + + var registry = new _containerIndex.Registry(); + var FirstApple = _internalTestHelpers.factory('first'); + var SecondApple = _internalTestHelpers.factory('second'); + + SecondApple.extend = function (a, b, c) { + ok(false, 'should not extend or touch the injected model, merely to inspect existence of another'); + }; + + registry.register('controller:apple', FirstApple); + registry.register('controller:second-apple', SecondApple); + registry.injection('controller:apple', 'badApple', 'controller:second-apple'); + + ok(registry.has('controller:apple')); + }); + + QUnit.test('registry.has should not error for invalid fullNames)', function () { + expect(1); + + var registry = new _containerIndex.Registry(); + + ok(!registry.has('foo:bar:baz')); + }); + + QUnit.test('once resolved, always return the same result', function () { + expect(1); + + var registry = new _containerIndex.Registry(); + + registry.resolver = { + resolve: function () { + return 'bar'; + } + }; + + var Bar = registry.resolve('models:bar'); + + registry.resolver = { + resolve: function () { + return 'not bar'; + } + }; + + equal(registry.resolve('models:bar'), Bar); + }); + + QUnit.test('factory resolves are cached', function () { + var registry = new _containerIndex.Registry(); + var PostController = _internalTestHelpers.factory(); + var resolveWasCalled = []; + + registry.resolver = { + resolve: function (fullName) { + resolveWasCalled.push(fullName); + return PostController; + } + }; + + deepEqual(resolveWasCalled, []); + registry.resolve('controller:post'); + deepEqual(resolveWasCalled, ['controller:post']); + + registry.resolve('controller:post'); + deepEqual(resolveWasCalled, ['controller:post']); + }); + + QUnit.test('factory for non extendables (MODEL) resolves are cached', function () { + var registry = new _containerIndex.Registry(); + var PostController = _internalTestHelpers.factory(); + var resolveWasCalled = []; + + registry.resolver = { + resolve: function (fullName) { + resolveWasCalled.push(fullName); + return PostController; + } + }; + + deepEqual(resolveWasCalled, []); + registry.resolve('model:post'); + deepEqual(resolveWasCalled, ['model:post']); + + registry.resolve('model:post'); + deepEqual(resolveWasCalled, ['model:post']); + }); + + QUnit.test('factory for non extendables resolves are cached', function () { + var registry = new _containerIndex.Registry(); + var PostController = {}; + var resolveWasCalled = []; + + registry.resolver = { + resolve: function (fullName) { + resolveWasCalled.push(fullName); + return PostController; + } + }; + + deepEqual(resolveWasCalled, []); + registry.resolve('foo:post'); + deepEqual(resolveWasCalled, ['foo:post']); + + registry.resolve('foo:post'); + deepEqual(resolveWasCalled, ['foo:post']); + }); + + QUnit.test('registry.container creates a container', function () { + var registry = new _containerIndex.Registry(); + var PostController = _internalTestHelpers.factory(); + registry.register('controller:post', PostController); + + var container = registry.container(); + var postController = container.lookup('controller:post'); + + ok(postController instanceof PostController, 'The lookup is an instance of the registered factory'); + }); + + QUnit.test('`describe` will be handled by the resolver, then by the fallback registry, if available', function () { + var fallback = { + describe: function (fullName) { + return fullName + '-fallback'; + } + }; + + var resolver = { + lookupDescription: function (fullName) { + return fullName + '-resolver'; + } + }; + + var registry = new _containerIndex.Registry({ fallback: fallback, resolver: resolver }); + + equal(registry.describe('controller:post'), 'controller:post-resolver', '`describe` handled by the resolver first.'); + + registry.resolver = null; + + equal(registry.describe('controller:post'), 'controller:post-fallback', '`describe` handled by fallback registry next.'); + + registry.fallback = null; + + equal(registry.describe('controller:post'), 'controller:post', '`describe` by default returns argument.'); + }); + + QUnit.test('`normalizeFullName` will be handled by the resolver, then by the fallback registry, if available', function () { + var fallback = { + normalizeFullName: function (fullName) { + return fullName + '-fallback'; + } + }; + + var resolver = { + normalize: function (fullName) { + return fullName + '-resolver'; + } + }; + + var registry = new _containerIndex.Registry({ fallback: fallback, resolver: resolver }); + + equal(registry.normalizeFullName('controller:post'), 'controller:post-resolver', '`normalizeFullName` handled by the resolver first.'); + + registry.resolver = null; + + equal(registry.normalizeFullName('controller:post'), 'controller:post-fallback', '`normalizeFullName` handled by fallback registry next.'); + + registry.fallback = null; + + equal(registry.normalizeFullName('controller:post'), 'controller:post', '`normalizeFullName` by default returns argument.'); + }); + + QUnit.test('`makeToString` will be handled by the resolver, then by the fallback registry, if available', function () { + var fallback = { + makeToString: function (fullName) { + return fullName + '-fallback'; + } + }; + + var resolver = { + makeToString: function (fullName) { + return fullName + '-resolver'; + } + }; + + var registry = new _containerIndex.Registry({ fallback: fallback, resolver: resolver }); + + equal(registry.makeToString('controller:post'), 'controller:post-resolver', '`makeToString` handled by the resolver first.'); + + registry.resolver = null; + + equal(registry.makeToString('controller:post'), 'controller:post-fallback', '`makeToString` handled by fallback registry next.'); + + registry.fallback = null; + + equal(registry.makeToString('controller:post'), 'controller:post', '`makeToString` by default returns argument.'); + }); + + QUnit.test('`resolve` can be handled by a fallback registry', function () { + var fallback = new _containerIndex.Registry(); + + var registry = new _containerIndex.Registry({ fallback: fallback }); + var PostController = _internalTestHelpers.factory(); + + fallback.register('controller:post', PostController); + + var PostControllerFactory = registry.resolve('controller:post'); + + ok(PostControllerFactory, 'factory is returned'); + ok(PostControllerFactory.create() instanceof PostController, 'The return of factory.create is an instance of PostController'); + }); + + QUnit.test('`has` can be handled by a fallback registry', function () { + var fallback = new _containerIndex.Registry(); + + var registry = new _containerIndex.Registry({ fallback: fallback }); + var PostController = _internalTestHelpers.factory(); + + fallback.register('controller:post', PostController); + + equal(registry.has('controller:post'), true, 'Fallback registry is checked for registration'); + }); + + QUnit.test('`getInjections` includes injections from a fallback registry', function () { + var fallback = new _containerIndex.Registry(); + var registry = new _containerIndex.Registry({ fallback: fallback }); + + equal(registry.getInjections('model:user').length, 0, 'No injections in the primary registry'); + + fallback.injection('model:user', 'post', 'model:post'); + + equal(registry.getInjections('model:user').length, 1, 'Injections from the fallback registry are merged'); + }); + + QUnit.test('`getTypeInjections` includes type injections from a fallback registry', function () { + var fallback = new _containerIndex.Registry(); + var registry = new _containerIndex.Registry({ fallback: fallback }); + + equal(registry.getTypeInjections('model').length, 0, 'No injections in the primary registry'); + + fallback.injection('model', 'source', 'source:main'); + + equal(registry.getTypeInjections('model').length, 1, 'Injections from the fallback registry are merged'); + }); + + QUnit.test('`getFactoryInjections` includes factory injections from a fallback registry', function () { + var fallback = new _containerIndex.Registry(); + var registry = new _containerIndex.Registry({ fallback: fallback }); + + equal(registry.getFactoryInjections('model:user').length, 0, 'No factory injections in the primary registry'); + + fallback.factoryInjection('model:user', 'store', 'store:main'); + + equal(registry.getFactoryInjections('model:user').length, 1, 'Factory injections from the fallback registry are merged'); + }); + + QUnit.test('`getFactoryTypeInjections` includes factory type injections from a fallback registry', function () { + var fallback = new _containerIndex.Registry(); + var registry = new _containerIndex.Registry({ fallback: fallback }); + + equal(registry.getFactoryTypeInjections('model').length, 0, 'No factory type injections in the primary registry'); + + fallback.factoryInjection('model', 'store', 'store:main'); + + equal(registry.getFactoryTypeInjections('model').length, 1, 'Factory type injections from the fallback registry are merged'); + }); + + QUnit.test('`knownForType` contains keys for each item of a given type', function () { + var registry = new _containerIndex.Registry(); + + registry.register('foo:bar-baz', 'baz'); + registry.register('foo:qux-fez', 'fez'); + + var found = registry.knownForType('foo'); + + deepEqual(found, { + 'foo:bar-baz': true, + 'foo:qux-fez': true + }); + }); + + QUnit.test('`knownForType` includes fallback registry results', function () { + var fallback = new _containerIndex.Registry(); + var registry = new _containerIndex.Registry({ fallback: fallback }); + + registry.register('foo:bar-baz', 'baz'); + registry.register('foo:qux-fez', 'fez'); + fallback.register('foo:zurp-zorp', 'zorp'); + + var found = registry.knownForType('foo'); + + deepEqual(found, { + 'foo:bar-baz': true, + 'foo:qux-fez': true, + 'foo:zurp-zorp': true + }); + }); + + QUnit.test('`knownForType` is called on the resolver if present', function () { + expect(3); + + var resolver = { + knownForType: function (type) { + ok(true, 'knownForType called on the resolver'); + equal(type, 'foo', 'the type was passed through'); + + return { 'foo:yorp': true }; + } + }; + + var registry = new _containerIndex.Registry({ + resolver: resolver + }); + registry.register('foo:bar-baz', 'baz'); + + var found = registry.knownForType('foo'); + + deepEqual(found, { + 'foo:yorp': true, + 'foo:bar-baz': true + }); + }); + + QUnit.test('A registry can be created with a deprecated `resolver` function instead of an object', function () { + expect(2); + + var registry = undefined; + + expectDeprecation(function () { + registry = new _containerIndex.Registry({ + resolver: function (fullName) { + return fullName + '-resolved'; + } + }); + }, 'Passing a `resolver` function into a Registry is deprecated. Please pass in a Resolver object with a `resolve` method.'); + + equal(registry.resolve('foo:bar'), 'foo:bar-resolved', '`resolve` still calls the deprecated function'); + }); + + QUnit.test('resolver.expandLocalLookup is not required', function (assert) { + assert.expect(1); + + var registry = new _containerIndex.Registry({ + resolver: {} + }); + + var result = registry.expandLocalLookup('foo:bar', { + source: 'baz:qux' + }); + + assert.equal(result, null); + }); + + QUnit.test('expandLocalLookup is called on the resolver if present', function (assert) { + assert.expect(4); + + var resolver = { + expandLocalLookup: function (targetFullName, sourceFullName) { + assert.ok(true, 'expandLocalLookup is called on the resolver'); + assert.equal(targetFullName, 'foo:bar', 'the targetFullName was passed through'); + assert.equal(sourceFullName, 'baz:qux', 'the sourceFullName was passed through'); + + return 'foo:qux/bar'; + } + }; + + var registry = new _containerIndex.Registry({ + resolver: resolver + }); + + var result = registry.expandLocalLookup('foo:bar', { + source: 'baz:qux' + }); + + assert.equal(result, 'foo:qux/bar'); + }); + + QUnit.test('`expandLocalLookup` is handled by the resolver, then by the fallback registry, if available', function (assert) { + assert.expect(9); + + var fallbackResolver = { + expandLocalLookup: function (targetFullName, sourceFullName) { + assert.ok(true, 'expandLocalLookup is called on the fallback resolver'); + assert.equal(targetFullName, 'foo:bar', 'the targetFullName was passed through'); + assert.equal(sourceFullName, 'baz:qux', 'the sourceFullName was passed through'); + + return 'foo:qux/bar-fallback'; + } + }; + + var resolver = { + expandLocalLookup: function (targetFullName, sourceFullName) { + assert.ok(true, 'expandLocalLookup is called on the resolver'); + assert.equal(targetFullName, 'foo:bar', 'the targetFullName was passed through'); + assert.equal(sourceFullName, 'baz:qux', 'the sourceFullName was passed through'); + + return 'foo:qux/bar-resolver'; + } + }; + + var fallbackRegistry = new _containerIndex.Registry({ + resolver: fallbackResolver + }); + + var registry = new _containerIndex.Registry({ + fallback: fallbackRegistry, + resolver: resolver + }); + + var result = registry.expandLocalLookup('foo:bar', { + source: 'baz:qux' + }); + + assert.equal(result, 'foo:qux/bar-resolver', 'handled by the resolver'); + + registry.resolver = null; + + result = registry.expandLocalLookup('foo:bar', { + source: 'baz:qux' + }); + + assert.equal(result, 'foo:qux/bar-fallback', 'handled by the fallback registry'); + + registry.fallback = null; + + result = registry.expandLocalLookup('foo:bar', { + source: 'baz:qux' + }); + + assert.equal(result, null, 'null is returned by default when no resolver or fallback registry is present'); + }); + + QUnit.test('resolver.expandLocalLookup result is cached', function (assert) { + assert.expect(3); + var result = undefined; + + var resolver = { + expandLocalLookup: function (targetFullName, sourceFullName) { + assert.ok(true, 'expandLocalLookup is called on the resolver'); + + return 'foo:qux/bar'; + } + }; + + var registry = new _containerIndex.Registry({ + resolver: resolver + }); + + result = registry.expandLocalLookup('foo:bar', { + source: 'baz:qux' + }); + + assert.equal(result, 'foo:qux/bar'); + + result = registry.expandLocalLookup('foo:bar', { + source: 'baz:qux' + }); + + assert.equal(result, 'foo:qux/bar'); + }); + + QUnit.test('resolver.expandLocalLookup cache is busted when any unregister is called', function (assert) { + assert.expect(4); + var result = undefined; + + var resolver = { + expandLocalLookup: function (targetFullName, sourceFullName) { + assert.ok(true, 'expandLocalLookup is called on the resolver'); + + return 'foo:qux/bar'; + } + }; + + var registry = new _containerIndex.Registry({ + resolver: resolver + }); + + result = registry.expandLocalLookup('foo:bar', { + source: 'baz:qux' + }); + + assert.equal(result, 'foo:qux/bar'); + + registry.unregister('foo:bar'); + + result = registry.expandLocalLookup('foo:bar', { + source: 'baz:qux' + }); + + assert.equal(result, 'foo:qux/bar'); + }); + + QUnit.test('resolve calls expandLocallookup when it receives options.source', function (assert) { + assert.expect(3); + + var resolver = { + resolve: function () {}, + expandLocalLookup: function (targetFullName, sourceFullName) { + assert.ok(true, 'expandLocalLookup is called on the resolver'); + assert.equal(targetFullName, 'foo:bar', 'the targetFullName was passed through'); + assert.equal(sourceFullName, 'baz:qux', 'the sourceFullName was passed through'); + + return 'foo:qux/bar'; + } + }; + + var registry = new _containerIndex.Registry({ + resolver: resolver + }); + + registry.resolve('foo:bar', { + source: 'baz:qux' + }); + }); + + QUnit.test('has uses expandLocalLookup', function (assert) { + assert.expect(5); + var resolvedFullNames = []; + var result = undefined; + + var resolver = { + resolve: function (name) { + resolvedFullNames.push(name); + + return 'yippie!'; + }, + + expandLocalLookup: function (targetFullName, sourceFullName) { + assert.ok(true, 'expandLocalLookup is called on the resolver'); + + if (targetFullName === 'foo:bar') { + return 'foo:qux/bar'; + } else { + return null; + } + } + }; + + var registry = new _containerIndex.Registry({ + resolver: resolver + }); + + result = registry.has('foo:bar', { + source: 'baz:qux' + }); + + assert.ok(result, 'found foo:bar/qux'); + + result = registry.has('foo:baz', { + source: 'baz:qux' + }); + + assert.ok(!result, 'foo:baz/qux not found'); + + assert.deepEqual(['foo:qux/bar'], resolvedFullNames); + }); +}); +enifed('container/tests/registry_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - container/tests'); + test('container/tests/registry_test.js should pass jscs', function () { + ok(true, 'container/tests/registry_test.js should pass jscs.'); + }); +}); +enifed('container/tests/registry_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - container/tests'); + QUnit.test('container/tests/registry_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'container/tests/registry_test.js should pass jshint.'); + }); +}); +enifed('ember-application/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application'); + test('ember-application/index.js should pass jscs', function () { + ok(true, 'ember-application/index.js should pass jscs.'); + }); +}); +enifed('ember-application/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application'); + QUnit.test('ember-application/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/index.js should pass jshint.'); + }); +}); +enifed('ember-application/initializers/dom-templates.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/initializers'); + test('ember-application/initializers/dom-templates.js should pass jscs', function () { + ok(true, 'ember-application/initializers/dom-templates.js should pass jscs.'); + }); +}); +enifed('ember-application/initializers/dom-templates.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/initializers'); + QUnit.test('ember-application/initializers/dom-templates.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/initializers/dom-templates.js should pass jshint.'); + }); +}); +enifed('ember-application/system/application-instance.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/system'); + test('ember-application/system/application-instance.js should pass jscs', function () { + ok(true, 'ember-application/system/application-instance.js should pass jscs.'); + }); +}); +enifed('ember-application/system/application-instance.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/system'); + QUnit.test('ember-application/system/application-instance.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/system/application-instance.js should pass jshint.'); + }); +}); +enifed('ember-application/system/application.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/system'); + test('ember-application/system/application.js should pass jscs', function () { + ok(true, 'ember-application/system/application.js should pass jscs.'); + }); +}); +enifed('ember-application/system/application.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/system'); + QUnit.test('ember-application/system/application.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/system/application.js should pass jshint.'); + }); +}); +enifed('ember-application/system/engine-instance.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/system'); + test('ember-application/system/engine-instance.js should pass jscs', function () { + ok(true, 'ember-application/system/engine-instance.js should pass jscs.'); + }); +}); +enifed('ember-application/system/engine-instance.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/system'); + QUnit.test('ember-application/system/engine-instance.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/system/engine-instance.js should pass jshint.'); + }); +}); +enifed('ember-application/system/engine-parent.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/system'); + test('ember-application/system/engine-parent.js should pass jscs', function () { + ok(true, 'ember-application/system/engine-parent.js should pass jscs.'); + }); +}); +enifed('ember-application/system/engine-parent.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/system'); + QUnit.test('ember-application/system/engine-parent.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/system/engine-parent.js should pass jshint.'); + }); +}); +enifed('ember-application/system/engine.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/system'); + test('ember-application/system/engine.js should pass jscs', function () { + ok(true, 'ember-application/system/engine.js should pass jscs.'); + }); +}); +enifed('ember-application/system/engine.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/system'); + QUnit.test('ember-application/system/engine.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/system/engine.js should pass jshint.'); + }); +}); +enifed('ember-application/system/resolver.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/system'); + test('ember-application/system/resolver.js should pass jscs', function () { + ok(true, 'ember-application/system/resolver.js should pass jscs.'); + }); +}); +enifed('ember-application/system/resolver.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/system'); + QUnit.test('ember-application/system/resolver.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/system/resolver.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/application_instance_test', ['exports', 'ember-application/system/engine', 'ember-application/system/application', 'ember-application/system/application-instance', 'ember-metal', 'ember-views', 'container', 'internal-test-helpers', 'ember-runtime'], function (exports, _emberApplicationSystemEngine, _emberApplicationSystemApplication, _emberApplicationSystemApplicationInstance, _emberMetal, _emberViews, _container, _internalTestHelpers, _emberRuntime) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); + + var application = undefined, + appInstance = undefined; + + QUnit.module('Ember.ApplicationInstance', { + setup: function () { + _emberViews.jQuery('#qunit-fixture').html('
HI
HI
'); + application = _emberMetal.run(function () { + return _emberApplicationSystemApplication.default.create({ rootElement: '#one', router: null }); + }); + }, + + teardown: function () { + _emberViews.jQuery('#qunit-fixture').empty(); + + if (appInstance) { + _emberMetal.run(appInstance, 'destroy'); + } + + if (application) { + _emberMetal.run(application, 'destroy'); + } + } + }); + + QUnit.test('an application instance can be created based upon an application', function () { + appInstance = _emberMetal.run(function () { + return appInstance = _emberApplicationSystemApplicationInstance.default.create({ application: application }); + }); + + ok(appInstance, 'instance should be created'); + equal(appInstance.application, application, 'application should be set to parent'); + }); + + QUnit.test('properties (and aliases) are correctly assigned for accessing the container and registry', function () { + expect(9); + + appInstance = _emberMetal.run(function () { + return _emberApplicationSystemApplicationInstance.default.create({ application: application }); + }); + + ok(appInstance, 'instance should be created'); + ok(appInstance.__container__, '#__container__ is accessible'); + ok(appInstance.__registry__, '#__registry__ is accessible'); + + ok(typeof appInstance.container.lookup === 'function', '#container.lookup is available as a function'); + + // stub with a no-op to keep deprecation test simple + appInstance.__container__.lookup = function () { + ok(true, '#loookup alias is called correctly'); + }; + + expectDeprecation(function () { + appInstance.container.lookup(); + }, /Using `ApplicationInstance.container.lookup` is deprecated. Please use `ApplicationInstance.lookup` instead./); + + ok(typeof appInstance.registry.register === 'function', '#registry.register is available as a function'); + appInstance.__registry__.register = function () { + ok(true, '#register alias is called correctly'); + }; + + expectDeprecation(function () { + appInstance.registry.register(); + }, /Using `ApplicationInstance.registry.register` is deprecated. Please use `ApplicationInstance.register` instead./); + }); + + QUnit.test('customEvents added to the application before setupEventDispatcher', function (assert) { + assert.expect(1); + + appInstance = _emberMetal.run(function () { + return _emberApplicationSystemApplicationInstance.default.create({ application: application }); + }); + + application.customEvents = { + awesome: 'sauce' + }; + + var eventDispatcher = appInstance.lookup('event_dispatcher:main'); + eventDispatcher.setup = function (events) { + assert.equal(events.awesome, 'sauce'); + }; + + appInstance.setupEventDispatcher(); + }); + + QUnit.test('customEvents added to the application before setupEventDispatcher', function (assert) { + assert.expect(1); + + _emberMetal.run(function () { + return appInstance = _emberApplicationSystemApplicationInstance.default.create({ application: application }); + }); + + application.customEvents = { + awesome: 'sauce' + }; + + var eventDispatcher = appInstance.lookup('event_dispatcher:main'); + eventDispatcher.setup = function (events) { + assert.equal(events.awesome, 'sauce'); + }; + + appInstance.setupEventDispatcher(); + }); + + QUnit.test('customEvents added to the application instance before setupEventDispatcher', function (assert) { + assert.expect(1); + + appInstance = _emberMetal.run(function () { + return _emberApplicationSystemApplicationInstance.default.create({ application: application }); + }); + + appInstance.customEvents = { + awesome: 'sauce' + }; + + var eventDispatcher = appInstance.lookup('event_dispatcher:main'); + eventDispatcher.setup = function (events) { + assert.equal(events.awesome, 'sauce'); + }; + + appInstance.setupEventDispatcher(); + }); + + QUnit.test('unregistering a factory clears all cached instances of that factory', function (assert) { + assert.expect(3); + + appInstance = _emberMetal.run(function () { + return _emberApplicationSystemApplicationInstance.default.create({ application: application }); + }); + + var PostController = _internalTestHelpers.factory(); + + appInstance.register('controller:post', PostController); + + var postController1 = appInstance.lookup('controller:post'); + assert.ok(postController1, 'lookup creates instance'); + + appInstance.unregister('controller:post'); + appInstance.register('controller:post', PostController); + + var postController2 = appInstance.lookup('controller:post'); + assert.ok(postController2, 'lookup creates instance'); + + assert.notStrictEqual(postController1, postController2, 'lookup creates a brand new instance, because the previous one was reset'); + }); + + QUnit.test('can build and boot a registered engine', function (assert) { + assert.expect(10); + + var ChatEngine = _emberApplicationSystemEngine.default.extend(); + var chatEngineInstance = undefined; + + application.register('engine:chat', ChatEngine); + + _emberMetal.run(function () { + appInstance = _emberApplicationSystemApplicationInstance.default.create({ application: application }); + appInstance.setupRegistry(); + chatEngineInstance = appInstance.buildChildEngineInstance('chat'); + }); + + return chatEngineInstance.boot().then(function () { + assert.ok(true, 'boot successful'); + + var registrations = ['route:basic', 'event_dispatcher:main', 'service:-routing', 'service:-glimmer-environment']; + + registrations.forEach(function (key) { + assert.strictEqual(chatEngineInstance.resolveRegistration(key), appInstance.resolveRegistration(key), 'Engine and parent app share registrations for \'' + key + '\''); + }); + + var singletons = ['router:main', _container.privatize(_templateObject), '-view-registry:main', '-environment:main']; + + var env = appInstance.lookup('-environment:main'); + singletons.push(env.isInteractive ? 'renderer:-dom' : 'renderer:-inert'); + + singletons.forEach(function (key) { + assert.strictEqual(chatEngineInstance.lookup(key), appInstance.lookup(key), 'Engine and parent app share singleton \'' + key + '\''); + }); + }); + }); + + QUnit.test('can build a registry via Ember.ApplicationInstance.setupRegistry() -- simulates ember-test-helpers', function (assert) { + var namespace = _emberRuntime.Object.create({ + Resolver: { create: function () {} } + }); + + var registry = _emberApplicationSystemApplication.default.buildRegistry(namespace); + + _emberApplicationSystemApplicationInstance.default.setupRegistry(registry); + + assert.equal(registry.resolve('service:-document'), document); + }); +}); +enifed('ember-application/tests/system/application_instance_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/application_instance_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/application_instance_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/application_instance_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/application_instance_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/application_instance_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/application_test', ['exports', 'ember', 'ember-environment', 'ember-metal', 'ember-application/system/application', 'ember-application/system/resolver', 'ember-routing', 'ember-views', 'ember-runtime', 'ember-template-compiler', 'ember-glimmer', 'container', 'ember-application/tests/test-helpers/registry-check'], function (exports, _ember, _emberEnvironment, _emberMetal, _emberApplicationSystemApplication, _emberApplicationSystemResolver, _emberRouting, _emberViews, _emberRuntime, _emberTemplateCompiler, _emberGlimmer, _container, _emberApplicationTestsTestHelpersRegistryCheck) { + /*globals EmberDev */ + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['template:components/-default'], ['template:components/-default']); + + var trim = _emberViews.jQuery.trim; + + var app = undefined, + application = undefined, + originalLookup = undefined, + originalDebug = undefined, + originalWarn = undefined; + + QUnit.module('Ember.Application', { + setup: function () { + originalLookup = _emberEnvironment.context.lookup; + originalDebug = _emberMetal.getDebugFunction('debug'); + originalWarn = _emberMetal.getDebugFunction('warn'); + + _emberViews.jQuery('#qunit-fixture').html('
HI
HI
'); + application = _emberMetal.run(function () { + return _emberApplicationSystemApplication.default.create({ rootElement: '#one', router: null }); + }); + }, + + teardown: function () { + _emberViews.jQuery('#qunit-fixture').empty(); + _emberMetal.setDebugFunction('debug', originalDebug); + _emberMetal.setDebugFunction('warn', originalWarn); + + _emberEnvironment.context.lookup = originalLookup; + + if (application) { + _emberMetal.run(application, 'destroy'); + } + + if (app) { + _emberMetal.run(app, 'destroy'); + } + } + }); + + QUnit.test('you can make a new application in a non-overlapping element', function () { + app = _emberMetal.run(function () { + return _emberApplicationSystemApplication.default.create({ rootElement: '#two', router: null }); + }); + + _emberMetal.run(app, 'destroy'); + ok(true, 'should not raise'); + }); + + QUnit.test('you cannot make a new application that is a parent of an existing application', function () { + expectAssertion(function () { + _emberMetal.run(function () { + return _emberApplicationSystemApplication.default.create({ rootElement: '#qunit-fixture' }); + }); + }); + }); + + QUnit.test('you cannot make a new application that is a descendant of an existing application', function () { + expectAssertion(function () { + _emberMetal.run(function () { + return _emberApplicationSystemApplication.default.create({ rootElement: '#one-child' }); + }); + }); + }); + + QUnit.test('you cannot make a new application that is a duplicate of an existing application', function () { + expectAssertion(function () { + _emberMetal.run(function () { + return _emberApplicationSystemApplication.default.create({ rootElement: '#one' }); + }); + }); + }); + + QUnit.test('you cannot make two default applications without a rootElement error', function () { + expectAssertion(function () { + _emberMetal.run(function () { + return _emberApplicationSystemApplication.default.create({ router: false }); + }); + }); + }); + + QUnit.test('acts like a namespace', function () { + var lookup = _emberEnvironment.context.lookup = {}; + + app = _emberMetal.run(function () { + return lookup.TestApp = _emberApplicationSystemApplication.default.create({ rootElement: '#two', router: false }); + }); + + _emberRuntime.setNamespaceSearchDisabled(false); + app.Foo = _emberRuntime.Object.extend(); + equal(app.Foo.toString(), 'TestApp.Foo', 'Classes pick up their parent namespace'); + }); + + QUnit.test('includes deprecated access to `application.registry`', function () { + expect(3); + + ok(typeof application.registry.register === 'function', '#registry.register is available as a function'); + + application.__registry__.register = function () { + ok(true, '#register alias is called correctly'); + }; + + expectDeprecation(function () { + application.registry.register(); + }, /Using `Application.registry.register` is deprecated. Please use `Application.register` instead./); + }); + + QUnit.test('builds a registry', function () { + strictEqual(application.resolveRegistration('application:main'), application, 'application:main is registered'); + deepEqual(application.registeredOptionsForType('component'), { singleton: false }, 'optionsForType \'component\''); + deepEqual(application.registeredOptionsForType('view'), { singleton: false }, 'optionsForType \'view\''); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'controller:basic'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, '-view-registry:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'view', '_viewRegistry', '-view-registry:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'route', '_topLevelViewTemplate', 'template:-outlet'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'route:basic'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'event_dispatcher:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'router:main', 'namespace', 'application:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'view:-outlet', 'namespace', 'application:main'); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'location:auto'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'location:hash'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'location:history'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'location:none'); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'controller', 'target', 'router:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'controller', 'namespace', 'application:main'); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, _container.privatize(_templateObject)); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'router', '_bucketCache', _container.privatize(_templateObject)); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'route', '_bucketCache', _container.privatize(_templateObject)); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'route', 'router', 'router:main'); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'component:-text-field'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'component:-text-area'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'component:-checkbox'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'component:link-to'); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'service:-routing'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'service:-routing', 'router', 'router:main'); + + // DEBUGGING + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'resolver-for-debugging:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'container-debug-adapter:main', 'resolver', 'resolver-for-debugging:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'data-adapter:main', 'containerDebugAdapter', 'container-debug-adapter:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'container-debug-adapter:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'component-lookup:main'); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'service:-glimmer-environment'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'service:-dom-changes'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'service:-dom-tree-construction'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'service:-glimmer-environment', 'appendOperations', 'service:-dom-tree-construction'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'service:-glimmer-environment', 'updateOperations', 'service:-dom-changes'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'renderer', 'env', 'service:-glimmer-environment'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'view:-outlet'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'renderer:-dom'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'renderer:-inert'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, _container.privatize(_templateObject2)); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'template:-outlet'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'view:-outlet', 'template', 'template:-outlet'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'template', 'env', 'service:-glimmer-environment'); + deepEqual(application.registeredOptionsForType('helper'), { instantiate: false }, 'optionsForType \'helper\''); + }); + + var originalLogVersion = _emberEnvironment.ENV.LOG_VERSION; + + QUnit.module('Ember.Application initialization', { + teardown: function () { + if (app) { + _emberMetal.run(app, 'destroy'); + } + _emberGlimmer.setTemplates({}); + _emberEnvironment.ENV.LOG_VERSION = originalLogVersion; + } + }); + + QUnit.test('initialized application goes to initial route', function () { + _emberMetal.run(function () { + app = _emberApplicationSystemApplication.default.create({ + rootElement: '#qunit-fixture' + }); + + app.Router.reopen({ + location: 'none' + }); + + app.register('template:application', _emberTemplateCompiler.compile('{{outlet}}')); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

Hi from index

')); + }); + + equal(_emberViews.jQuery('#qunit-fixture h1').text(), 'Hi from index'); + }); + + QUnit.test('ready hook is called before routing begins', function () { + expect(2); + + _emberMetal.run(function () { + function registerRoute(application, name, callback) { + var route = _emberRouting.Route.extend({ + activate: callback + }); + + application.register('route:' + name, route); + } + + var MyApplication = _emberApplicationSystemApplication.default.extend({ + ready: function () { + registerRoute(this, 'index', function () { + ok(true, 'last-minute route is activated'); + }); + } + }); + + app = MyApplication.create({ + rootElement: '#qunit-fixture' + }); + + app.Router.reopen({ + location: 'none' + }); + + registerRoute(app, 'application', function () { + return ok(true, 'normal route is activated'); + }); + }); + }); + + QUnit.test('initialize application via initialize call', function () { + _emberMetal.run(function () { + app = _emberApplicationSystemApplication.default.create({ + rootElement: '#qunit-fixture' + }); + + app.Router.reopen({ + location: 'none' + }); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('

Hello!

')); + }); + + // This is not a public way to access the container; we just + // need to make some assertions about the created router + var router = app.__container__.lookup('router:main'); + equal(router instanceof _emberRouting.Router, true, 'Router was set from initialize call'); + equal(router.location instanceof _emberRouting.NoneLocation, true, 'Location was set from location implementation name'); + }); + + QUnit.test('initialize application with stateManager via initialize call from Router class', function () { + _emberMetal.run(function () { + app = _emberApplicationSystemApplication.default.create({ + rootElement: '#qunit-fixture' + }); + + app.Router.reopen({ + location: 'none' + }); + + app.register('template:application', _emberTemplateCompiler.compile('

Hello!

')); + }); + + var router = app.__container__.lookup('router:main'); + equal(router instanceof _emberRouting.Router, true, 'Router was set from initialize call'); + equal(_emberViews.jQuery('#qunit-fixture h1').text(), 'Hello!'); + }); + + QUnit.test('ApplicationView is inserted into the page', function () { + _emberMetal.run(function () { + app = _emberApplicationSystemApplication.default.create({ + rootElement: '#qunit-fixture' + }); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('

Hello!

')); + + app.ApplicationController = _emberRuntime.Controller.extend(); + + app.Router.reopen({ + location: 'none' + }); + }); + + equal(_emberViews.jQuery('#qunit-fixture h1').text(), 'Hello!'); + }); + + QUnit.test('Minimal Application initialized with just an application template', function () { + _emberViews.jQuery('#qunit-fixture').html(''); + app = _emberMetal.run(function () { + return _emberApplicationSystemApplication.default.create({ + rootElement: '#qunit-fixture' + }); + }); + + equal(trim(_emberViews.jQuery('#qunit-fixture').text()), 'Hello World'); + }); + + QUnit.test('enable log of libraries with an ENV var', function () { + if (EmberDev && EmberDev.runningProdBuild) { + ok(true, 'Logging does not occur in production builds'); + return; + } + + var messages = []; + + _emberEnvironment.ENV.LOG_VERSION = true; + + _emberMetal.setDebugFunction('debug', function (message) { + return messages.push(message); + }); + + _emberMetal.libraries.register('my-lib', '2.0.0a'); + + app = _emberMetal.run(function () { + return _emberApplicationSystemApplication.default.create({ + rootElement: '#qunit-fixture' + }); + }); + + equal(messages[1], 'Ember : ' + _ember.VERSION); + equal(messages[2], 'jQuery : ' + _emberViews.jQuery().jquery); + equal(messages[3], 'my-lib : ' + '2.0.0a'); + + _emberMetal.libraries.deRegister('my-lib'); + }); + + QUnit.test('disable log version of libraries with an ENV var', function () { + var logged = false; + + _emberEnvironment.ENV.LOG_VERSION = false; + + _emberMetal.setDebugFunction('debug', function () { + return logged = true; + }); + + _emberViews.jQuery('#qunit-fixture').empty(); + + _emberMetal.run(function () { + app = _emberApplicationSystemApplication.default.create({ + rootElement: '#qunit-fixture' + }); + + app.Router.reopen({ + location: 'none' + }); + }); + + ok(!logged, 'library version logging skipped'); + }); + + QUnit.test('can resolve custom router', function () { + var CustomRouter = _emberRouting.Router.extend(); + + var Resolver = _emberApplicationSystemResolver.default.extend({ + resolveMain: function (parsedName) { + if (parsedName.type === 'router') { + return CustomRouter; + } else { + return this._super(parsedName); + } + } + }); + + app = _emberMetal.run(function () { + return _emberApplicationSystemApplication.default.create({ + Resolver: Resolver + }); + }); + + ok(app.__container__.lookup('router:main') instanceof CustomRouter, 'application resolved the correct router'); + }); + + QUnit.test('can specify custom router', function () { + app = _emberMetal.run(function () { + return _emberApplicationSystemApplication.default.create({ + Router: _emberRouting.Router.extend() + }); + }); + + ok(app.__container__.lookup('router:main') instanceof _emberRouting.Router, 'application resolved the correct router'); + }); + + QUnit.test('does not leak itself in onLoad._loaded', function () { + equal(_emberRuntime._loaded.application, undefined); + var app = _emberMetal.run(_emberApplicationSystemApplication.default, 'create'); + equal(_emberRuntime._loaded.application, app); + _emberMetal.run(app, 'destroy'); + equal(_emberRuntime._loaded.application, undefined); + }); + + QUnit.test('can build a registry via Ember.Application.buildRegistry() --- simulates ember-test-helpers', function (assert) { + var namespace = _emberRuntime.Object.create({ + Resolver: { create: function () {} } + }); + + var registry = _emberApplicationSystemApplication.default.buildRegistry(namespace); + + assert.equal(registry.resolve('application:main'), namespace); + }); +}); +enifed('ember-application/tests/system/application_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/application_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/application_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/application_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/application_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/application_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/bootstrap-test', ['exports', 'ember-metal', 'ember-application/system/application', 'ember-routing', 'ember-views', 'ember-glimmer'], function (exports, _emberMetal, _emberApplicationSystemApplication, _emberRouting, _emberViews, _emberGlimmer) { + 'use strict'; + + var app = undefined; + + QUnit.module('Ember.Application', { + teardown: function () { + if (app) { + _emberMetal.run(app, 'destroy'); + } + + _emberGlimmer.setTemplates({}); + } + }); + + QUnit.test('templates in script tags are extracted at application creation', function (assert) { + _emberViews.jQuery('#qunit-fixture').html('\n
\n\n \n \n '); + + var application = _emberApplicationSystemApplication.default.extend(); + application.Router = _emberRouting.Router.extend({ + location: 'none' + }); + + app = _emberMetal.run(function () { + return application.create({ rootElement: '#app' }); + }); + + assert.equal(_emberViews.jQuery('#app').text(), 'Hello World!'); + }); +}); +enifed('ember-application/tests/system/bootstrap-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/bootstrap-test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/bootstrap-test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/bootstrap-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/bootstrap-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/bootstrap-test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/dependency_injection/custom_resolver_test', ['exports', 'ember-views', 'ember-metal', 'ember-application/system/application', 'ember-application/system/resolver', 'ember-template-compiler'], function (exports, _emberViews, _emberMetal, _emberApplicationSystemApplication, _emberApplicationSystemResolver, _emberTemplateCompiler) { + 'use strict'; + + var application = undefined; + + QUnit.module('Ember.Application Dependency Injection – customResolver', { + setup: function () { + var fallbackTemplate = _emberTemplateCompiler.compile('

Fallback

'); + + var Resolver = _emberApplicationSystemResolver.default.extend({ + resolveTemplate: function (resolvable) { + var resolvedTemplate = this._super(resolvable); + if (resolvedTemplate) { + return resolvedTemplate; + } + if (resolvable.fullNameWithoutType === 'application') { + return fallbackTemplate; + } else { + return; + } + } + }); + + application = _emberMetal.run(function () { + return _emberApplicationSystemApplication.default.create({ + Resolver: Resolver, + rootElement: '#qunit-fixture' + }); + }); + }, + + teardown: function () { + _emberMetal.run(application, 'destroy'); + } + }); + + QUnit.test('a resolver can be supplied to application', function () { + equal(_emberViews.jQuery('h1', application.rootElement).text(), 'Fallback'); + }); +}); +enifed('ember-application/tests/system/dependency_injection/custom_resolver_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system/dependency_injection'); + test('ember-application/tests/system/dependency_injection/custom_resolver_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/dependency_injection/custom_resolver_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/dependency_injection/custom_resolver_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system/dependency_injection'); + QUnit.test('ember-application/tests/system/dependency_injection/custom_resolver_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/dependency_injection/custom_resolver_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/dependency_injection/default_resolver_test', ['exports', 'ember-environment', 'ember-metal', 'ember-runtime', 'ember-routing', 'ember-application/system/application', 'ember-glimmer', 'ember-template-compiler'], function (exports, _emberEnvironment, _emberMetal, _emberRuntime, _emberRouting, _emberApplicationSystemApplication, _emberGlimmer, _emberTemplateCompiler) { + /* globals EmberDev */ + 'use strict'; + + var registry = undefined, + locator = undefined, + application = undefined, + originalLookup = undefined, + originalInfo = undefined; + + QUnit.module('Ember.Application Dependency Injection - default resolver', { + setup: function () { + originalLookup = _emberEnvironment.context.lookup; + application = _emberMetal.run(_emberApplicationSystemApplication.default, 'create'); + + registry = application.__registry__; + locator = application.__container__; + originalInfo = _emberMetal.getDebugFunction('info'); + }, + + teardown: function () { + _emberGlimmer.setTemplates({}); + _emberEnvironment.context.lookup = originalLookup; + _emberMetal.run(application, 'destroy'); + var UserInterfaceNamespace = _emberRuntime.Namespace.NAMESPACES_BY_ID['UserInterface']; + if (UserInterfaceNamespace) { + _emberMetal.run(UserInterfaceNamespace, 'destroy'); + } + + _emberMetal.setDebugFunction('info', originalInfo); + } + }); + + QUnit.test('the default resolver can look things up in other namespaces', function () { + var UserInterface = _emberEnvironment.context.lookup.UserInterface = _emberRuntime.Namespace.create(); + UserInterface.NavigationController = _emberRuntime.Controller.extend(); + + var nav = locator.lookup('controller:userInterface/navigation'); + + ok(nav instanceof UserInterface.NavigationController, 'the result should be an instance of the specified class'); + }); + + QUnit.test('the default resolver looks up templates in Ember.TEMPLATES', function () { + var fooTemplate = _emberTemplateCompiler.compile('foo template'); + var fooBarTemplate = _emberTemplateCompiler.compile('fooBar template'); + var fooBarBazTemplate = _emberTemplateCompiler.compile('fooBar/baz template'); + + _emberGlimmer.setTemplate('foo', fooTemplate); + _emberGlimmer.setTemplate('fooBar', fooBarTemplate); + _emberGlimmer.setTemplate('fooBar/baz', fooBarBazTemplate); + + equal(locator.lookupFactory('template:foo'), fooTemplate, 'resolves template:foo'); + equal(locator.lookupFactory('template:fooBar'), fooBarTemplate, 'resolves template:foo_bar'); + equal(locator.lookupFactory('template:fooBar.baz'), fooBarBazTemplate, 'resolves template:foo_bar.baz'); + }); + + QUnit.test('the default resolver looks up basic name as no prefix', function () { + ok(_emberRuntime.Controller.detect(locator.lookup('controller:basic')), 'locator looks up correct controller'); + }); + + function detectEqual(first, second, message) { + ok(first.detect(second), message); + } + + QUnit.test('the default resolver looks up arbitrary types on the namespace', function () { + application.FooManager = _emberRuntime.Object.extend({}); + + detectEqual(application.FooManager, registry.resolve('manager:foo'), 'looks up FooManager on application'); + }); + + QUnit.test('the default resolver resolves models on the namespace', function () { + application.Post = _emberRuntime.Object.extend({}); + + detectEqual(application.Post, locator.lookupFactory('model:post'), 'looks up Post model on application'); + }); + + QUnit.test('the default resolver resolves *:main on the namespace', function () { + application.FooBar = _emberRuntime.Object.extend({}); + + detectEqual(application.FooBar, locator.lookupFactory('foo-bar:main'), 'looks up FooBar type without name on application'); + }); + + QUnit.test('the default resolver resolves container-registered helpers', function () { + var shorthandHelper = _emberGlimmer.helper(function () {}); + var helper = _emberGlimmer.Helper.extend(); + + application.register('helper:shorthand', shorthandHelper); + application.register('helper:complete', helper); + + var lookedUpShorthandHelper = locator.lookupFactory('helper:shorthand'); + ok(lookedUpShorthandHelper.isHelperInstance, 'shorthand helper isHelper'); + + var lookedUpHelper = locator.lookupFactory('helper:complete'); + ok(lookedUpHelper.isHelperFactory, 'complete helper is factory'); + ok(helper.detect(lookedUpHelper), 'looked up complete helper'); + }); + + QUnit.test('the default resolver resolves helpers on the namespace', function () { + var ShorthandHelper = _emberGlimmer.helper(function () {}); + var CompleteHelper = _emberGlimmer.Helper.extend(); + var LegacyHTMLBarsBoundHelper = undefined; + + expectDeprecation(function () { + LegacyHTMLBarsBoundHelper = _emberGlimmer.makeBoundHelper(function () {}); + }, 'Using `Ember.HTMLBars.makeBoundHelper` is deprecated. Please refactor to use `Ember.Helper` or `Ember.Helper.helper`.'); + + application.ShorthandHelper = ShorthandHelper; + application.CompleteHelper = CompleteHelper; + application.LegacyHtmlBarsBoundHelper = LegacyHTMLBarsBoundHelper; // Must use lowered "tml" in "HTMLBars" for resolver to find this + + var resolvedShorthand = registry.resolve('helper:shorthand'); + var resolvedComplete = registry.resolve('helper:complete'); + var resolvedLegacyHTMLBars = registry.resolve('helper:legacy-html-bars-bound'); + + equal(resolvedShorthand, ShorthandHelper, 'resolve fetches the shorthand helper factory'); + equal(resolvedComplete, CompleteHelper, 'resolve fetches the complete helper factory'); + equal(resolvedLegacyHTMLBars, LegacyHTMLBarsBoundHelper, 'resolves legacy HTMLBars bound helper'); + }); + + QUnit.test('the default resolver resolves to the same instance, no matter the notation ', function () { + application.NestedPostController = _emberRuntime.Controller.extend({}); + + equal(locator.lookup('controller:nested-post'), locator.lookup('controller:nested_post'), 'looks up NestedPost controller on application'); + }); + + QUnit.test('the default resolver throws an error if the fullName to resolve is invalid', function () { + throws(function () { + registry.resolve(undefined); + }, TypeError, /Invalid fullName/); + throws(function () { + registry.resolve(null); + }, TypeError, /Invalid fullName/); + throws(function () { + registry.resolve(''); + }, TypeError, /Invalid fullName/); + throws(function () { + registry.resolve(''); + }, TypeError, /Invalid fullName/); + throws(function () { + registry.resolve(':'); + }, TypeError, /Invalid fullName/); + throws(function () { + registry.resolve('model'); + }, TypeError, /Invalid fullName/); + throws(function () { + registry.resolve('model:'); + }, TypeError, /Invalid fullName/); + throws(function () { + registry.resolve(':type'); + }, TypeError, /Invalid fullName/); + }); + + QUnit.test('the default resolver logs hits if `LOG_RESOLVER` is set', function () { + if (EmberDev && EmberDev.runningProdBuild) { + ok(true, 'Logging does not occur in production builds'); + return; + } + + expect(3); + + application.LOG_RESOLVER = true; + application.ScoobyDoo = _emberRuntime.Object.extend(); + application.toString = function () { + return 'App'; + }; + + _emberMetal.setDebugFunction('info', function (symbol, name, padding, lookupDescription) { + equal(symbol, '[✓]', 'proper symbol is printed when a module is found'); + equal(name, 'doo:scooby', 'proper lookup value is logged'); + equal(lookupDescription, 'App.ScoobyDoo'); + }); + + registry.resolve('doo:scooby'); + }); + + QUnit.test('the default resolver logs misses if `LOG_RESOLVER` is set', function () { + if (EmberDev && EmberDev.runningProdBuild) { + ok(true, 'Logging does not occur in production builds'); + return; + } + + expect(3); + + application.LOG_RESOLVER = true; + application.toString = function () { + return 'App'; + }; + + _emberMetal.setDebugFunction('info', function (symbol, name, padding, lookupDescription) { + equal(symbol, '[ ]', 'proper symbol is printed when a module is not found'); + equal(name, 'doo:scooby', 'proper lookup value is logged'); + equal(lookupDescription, 'App.ScoobyDoo'); + }); + + registry.resolve('doo:scooby'); + }); + + QUnit.test('doesn\'t log without LOG_RESOLVER', function () { + if (EmberDev && EmberDev.runningProdBuild) { + ok(true, 'Logging does not occur in production builds'); + return; + } + + var infoCount = 0; + + application.ScoobyDoo = _emberRuntime.Object.extend(); + + _emberMetal.setDebugFunction('info', function (symbol, name) { + return infoCount = infoCount + 1; + }); + + registry.resolve('doo:scooby'); + registry.resolve('doo:scrappy'); + equal(infoCount, 0, 'Logger.info should not be called if LOG_RESOLVER is not set'); + }); + + QUnit.test('lookup description', function () { + application.toString = function () { + return 'App'; + }; + + equal(registry.describe('controller:foo'), 'App.FooController', 'Type gets appended at the end'); + equal(registry.describe('controller:foo.bar'), 'App.FooBarController', 'dots are removed'); + equal(registry.describe('model:foo'), 'App.Foo', 'models don\'t get appended at the end'); + }); + + QUnit.test('assertion for routes without isRouteFactory property', function () { + application.FooRoute = _emberGlimmer.Component.extend(); + + expectAssertion(function () { + return registry.resolve('route:foo'); + }, /to resolve to an Ember.Route/, 'Should assert'); + }); + + QUnit.test('no assertion for routes that extend from Ember.Route', function () { + expect(0); + application.FooRoute = _emberRouting.Route.extend(); + registry.resolve('route:foo'); + }); + + QUnit.test('deprecation warning for service factories without isServiceFactory property', function () { + expectDeprecation(/service factories must have an `isServiceFactory` property/); + application.FooService = _emberRuntime.Object.extend(); + registry.resolve('service:foo'); + }); + + QUnit.test('no deprecation warning for service factories that extend from Ember.Service', function () { + expectNoDeprecation(); + application.FooService = _emberRuntime.Service.extend(); + registry.resolve('service:foo'); + }); + + QUnit.test('deprecation warning for component factories without isComponentFactory property', function () { + expectDeprecation(/component factories must have an `isComponentFactory` property/); + application.FooComponent = _emberRuntime.Object.extend(); + registry.resolve('component:foo'); + }); + + QUnit.test('no deprecation warning for component factories that extend from Ember.Component', function () { + expectNoDeprecation(); + application.FooView = _emberGlimmer.Component.extend(); + registry.resolve('component:foo'); + }); + + QUnit.test('knownForType returns each item for a given type found', function () { + application.FooBarHelper = 'foo'; + application.BazQuxHelper = 'bar'; + + var found = registry.resolver.knownForType('helper'); + + // using `Object.keys` and manually confirming values over using `deepEqual` + // due to an issue in QUnit (through at least 1.20.0) that are unable to properly compare + // objects with an `undefined` constructor (like ember-metal/empty_object) + var foundKeys = Object.keys(found); + + deepEqual(foundKeys, ['helper:foo-bar', 'helper:baz-qux']); + ok(found['helper:foo-bar']); + ok(found['helper:baz-qux']); + }); + + QUnit.test('knownForType is not required to be present on the resolver', function () { + delete registry.resolver.knownForType; + + registry.resolver.knownForType('helper', function () {}); + + ok(true, 'does not error'); + }); +}); +enifed('ember-application/tests/system/dependency_injection/default_resolver_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system/dependency_injection'); + test('ember-application/tests/system/dependency_injection/default_resolver_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/dependency_injection/default_resolver_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/dependency_injection/default_resolver_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system/dependency_injection'); + QUnit.test('ember-application/tests/system/dependency_injection/default_resolver_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/dependency_injection/default_resolver_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/dependency_injection/normalization_test', ['exports', 'ember-metal', 'ember-application/system/application'], function (exports, _emberMetal, _emberApplicationSystemApplication) { + 'use strict'; + + var application = undefined, + registry = undefined; + + QUnit.module('Ember.Application Dependency Injection – normalization', { + setup: function () { + application = _emberMetal.run(_emberApplicationSystemApplication.default, 'create'); + registry = application.__registry__; + }, + + teardown: function () { + _emberMetal.run(application, 'destroy'); + } + }); + + QUnit.test('normalization', function () { + ok(registry.normalize, 'registry#normalize is present'); + + equal(registry.normalize('foo:bar'), 'foo:bar'); + + equal(registry.normalize('controller:posts'), 'controller:posts'); + equal(registry.normalize('controller:posts_index'), 'controller:postsIndex'); + equal(registry.normalize('controller:posts.index'), 'controller:postsIndex'); + equal(registry.normalize('controller:posts-index'), 'controller:postsIndex'); + equal(registry.normalize('controller:posts.post.index'), 'controller:postsPostIndex'); + equal(registry.normalize('controller:posts_post.index'), 'controller:postsPostIndex'); + equal(registry.normalize('controller:posts.post_index'), 'controller:postsPostIndex'); + equal(registry.normalize('controller:posts.post-index'), 'controller:postsPostIndex'); + equal(registry.normalize('controller:postsIndex'), 'controller:postsIndex'); + equal(registry.normalize('controller:blogPosts.index'), 'controller:blogPostsIndex'); + equal(registry.normalize('controller:blog/posts.index'), 'controller:blog/postsIndex'); + equal(registry.normalize('controller:blog/posts-index'), 'controller:blog/postsIndex'); + equal(registry.normalize('controller:blog/posts.post.index'), 'controller:blog/postsPostIndex'); + equal(registry.normalize('controller:blog/posts_post.index'), 'controller:blog/postsPostIndex'); + equal(registry.normalize('controller:blog/posts_post-index'), 'controller:blog/postsPostIndex'); + + equal(registry.normalize('template:blog/posts_index'), 'template:blog/posts_index'); + }); + + QUnit.test('normalization is indempotent', function () { + var examples = ['controller:posts', 'controller:posts.post.index', 'controller:blog/posts.post_index', 'template:foo_bar']; + + examples.forEach(function (example) { + equal(registry.normalize(registry.normalize(example)), registry.normalize(example)); + }); + }); +}); +enifed('ember-application/tests/system/dependency_injection/normalization_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system/dependency_injection'); + test('ember-application/tests/system/dependency_injection/normalization_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/dependency_injection/normalization_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/dependency_injection/normalization_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system/dependency_injection'); + QUnit.test('ember-application/tests/system/dependency_injection/normalization_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/dependency_injection/normalization_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/dependency_injection/to_string_test', ['exports', 'ember-utils', 'ember-environment', 'ember-metal', 'ember-application/system/application', 'ember-runtime', 'ember-application/system/resolver'], function (exports, _emberUtils, _emberEnvironment, _emberMetal, _emberApplicationSystemApplication, _emberRuntime, _emberApplicationSystemResolver) { + 'use strict'; + + var originalLookup = undefined, + App = undefined, + originalModelInjections = undefined; + + QUnit.module('Ember.Application Dependency Injection – toString', { + setup: function () { + originalModelInjections = _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS; + _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS = true; + + originalLookup = _emberEnvironment.context.lookup; + + _emberMetal.run(function () { + App = _emberApplicationSystemApplication.default.create(); + _emberEnvironment.context.lookup = { + App: App + }; + }); + + App.Post = _emberRuntime.Object.extend(); + }, + + teardown: function () { + _emberEnvironment.context.lookup = originalLookup; + _emberMetal.run(App, 'destroy'); + _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS = originalModelInjections; + } + }); + + QUnit.test('factories', function () { + var PostFactory = App.__container__.lookupFactory('model:post'); + equal(PostFactory.toString(), 'App.Post', 'expecting the model to be post'); + }); + + QUnit.test('instances', function () { + var post = App.__container__.lookup('model:post'); + var guid = _emberUtils.guidFor(post); + + equal(post.toString(), '', 'expecting the model to be post'); + }); + + QUnit.test('with a custom resolver', function () { + _emberMetal.run(App, 'destroy'); + + _emberMetal.run(function () { + App = _emberApplicationSystemApplication.default.create({ + Resolver: _emberApplicationSystemResolver.default.extend({ + makeToString: function (factory, fullName) { + return fullName; + } + }) + }); + }); + + App.register('model:peter', _emberRuntime.Object.extend()); + + var peter = App.__container__.lookup('model:peter'); + var guid = _emberUtils.guidFor(peter); + + equal(peter.toString(), '', 'expecting the supermodel to be peter'); + }); +}); +// lookup, etc +enifed('ember-application/tests/system/dependency_injection/to_string_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system/dependency_injection'); + test('ember-application/tests/system/dependency_injection/to_string_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/dependency_injection/to_string_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/dependency_injection/to_string_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system/dependency_injection'); + QUnit.test('ember-application/tests/system/dependency_injection/to_string_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/dependency_injection/to_string_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/dependency_injection_test', ['exports', 'ember-environment', 'ember-metal', 'ember-runtime', 'ember-application/system/application'], function (exports, _emberEnvironment, _emberMetal, _emberRuntime, _emberApplicationSystemApplication) { + 'use strict'; + + var EmberApplication = _emberApplicationSystemApplication.default; + + var originalLookup = _emberEnvironment.context.lookup; + var registry = undefined, + locator = undefined, + lookup = undefined, + application = undefined, + originalModelInjections = undefined; + + QUnit.module('Ember.Application Dependency Injection', { + setup: function () { + originalModelInjections = _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS; + _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS = true; + + application = _emberMetal.run(EmberApplication, 'create'); + + application.Person = _emberRuntime.Object.extend({}); + application.Orange = _emberRuntime.Object.extend({}); + application.Email = _emberRuntime.Object.extend({}); + application.User = _emberRuntime.Object.extend({}); + application.PostIndexController = _emberRuntime.Object.extend({}); + + application.register('model:person', application.Person, { singleton: false }); + application.register('model:user', application.User, { singleton: false }); + application.register('fruit:favorite', application.Orange); + application.register('communication:main', application.Email, { singleton: false }); + application.register('controller:postIndex', application.PostIndexController, { singleton: true }); + + registry = application.__registry__; + locator = application.__container__; + + lookup = _emberEnvironment.context.lookup = {}; + }, + teardown: function () { + _emberMetal.run(application, 'destroy'); + application = locator = null; + _emberEnvironment.context.lookup = originalLookup; + _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS = originalModelInjections; + } + }); + + QUnit.test('container lookup is normalized', function () { + var dotNotationController = locator.lookup('controller:post.index'); + var camelCaseController = locator.lookup('controller:postIndex'); + + ok(dotNotationController instanceof application.PostIndexController); + ok(camelCaseController instanceof application.PostIndexController); + + equal(dotNotationController, camelCaseController); + }); + + QUnit.test('registered entities can be looked up later', function () { + equal(registry.resolve('model:person'), application.Person); + equal(registry.resolve('model:user'), application.User); + equal(registry.resolve('fruit:favorite'), application.Orange); + equal(registry.resolve('communication:main'), application.Email); + equal(registry.resolve('controller:postIndex'), application.PostIndexController); + + equal(locator.lookup('fruit:favorite'), locator.lookup('fruit:favorite'), 'singleton lookup worked'); + ok(locator.lookup('model:user') !== locator.lookup('model:user'), 'non-singleton lookup worked'); + }); + + QUnit.test('injections', function () { + application.inject('model', 'fruit', 'fruit:favorite'); + application.inject('model:user', 'communication', 'communication:main'); + + var user = locator.lookup('model:user'); + var person = locator.lookup('model:person'); + var fruit = locator.lookup('fruit:favorite'); + + equal(user.get('fruit'), fruit); + equal(person.get('fruit'), fruit); + + ok(application.Email.detectInstance(user.get('communication'))); + }); +}); +enifed('ember-application/tests/system/dependency_injection_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/dependency_injection_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/dependency_injection_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/dependency_injection_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/dependency_injection_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/dependency_injection_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/engine_initializers_test', ['exports', 'ember-metal', 'ember-application/system/engine'], function (exports, _emberMetal, _emberApplicationSystemEngine) { + 'use strict'; + + var MyEngine = undefined, + myEngine = undefined, + myEngineInstance = undefined; + + QUnit.module('Ember.Engine initializers', { + setup: function () {}, + + teardown: function () { + _emberMetal.run(function () { + if (myEngineInstance) { + myEngineInstance.destroy(); + } + + if (myEngine) { + myEngine.destroy(); + } + }); + } + }); + + QUnit.test('initializers require proper \'name\' and \'initialize\' properties', function () { + MyEngine = _emberApplicationSystemEngine.default.extend(); + + expectAssertion(function () { + _emberMetal.run(function () { + MyEngine.initializer({ name: 'initializer' }); + }); + }); + + expectAssertion(function () { + _emberMetal.run(function () { + MyEngine.initializer({ initialize: function () {} }); + }); + }); + }); + + QUnit.test('initializers are passed an Engine', function () { + MyEngine = _emberApplicationSystemEngine.default.extend(); + + MyEngine.initializer({ + name: 'initializer', + initialize: function (engine) { + ok(engine instanceof _emberApplicationSystemEngine.default, 'initialize is passed an Engine'); + } + }); + + myEngine = MyEngine.create(); + myEngineInstance = myEngine.buildInstance(); + }); + + QUnit.test('initializers can be registered in a specified order', function () { + var order = []; + + MyEngine = _emberApplicationSystemEngine.default.extend(); + MyEngine.initializer({ + name: 'fourth', + after: 'third', + initialize: function (engine) { + order.push('fourth'); + } + }); + + MyEngine.initializer({ + name: 'second', + after: 'first', + before: 'third', + initialize: function (engine) { + order.push('second'); + } + }); + + MyEngine.initializer({ + name: 'fifth', + after: 'fourth', + before: 'sixth', + initialize: function (engine) { + order.push('fifth'); + } + }); + + MyEngine.initializer({ + name: 'first', + before: 'second', + initialize: function (engine) { + order.push('first'); + } + }); + + MyEngine.initializer({ + name: 'third', + initialize: function (engine) { + order.push('third'); + } + }); + + MyEngine.initializer({ + name: 'sixth', + initialize: function (engine) { + order.push('sixth'); + } + }); + + myEngine = MyEngine.create(); + myEngineInstance = myEngine.buildInstance(); + + deepEqual(order, ['first', 'second', 'third', 'fourth', 'fifth', 'sixth']); + }); + + QUnit.test('initializers can be registered in a specified order as an array', function () { + var order = []; + + MyEngine = _emberApplicationSystemEngine.default.extend(); + + MyEngine.initializer({ + name: 'third', + initialize: function (engine) { + order.push('third'); + } + }); + + MyEngine.initializer({ + name: 'second', + after: 'first', + before: ['third', 'fourth'], + initialize: function (engine) { + order.push('second'); + } + }); + + MyEngine.initializer({ + name: 'fourth', + after: ['second', 'third'], + initialize: function (engine) { + order.push('fourth'); + } + }); + + MyEngine.initializer({ + name: 'fifth', + after: 'fourth', + before: 'sixth', + initialize: function (engine) { + order.push('fifth'); + } + }); + + MyEngine.initializer({ + name: 'first', + before: ['second'], + initialize: function (engine) { + order.push('first'); + } + }); + + MyEngine.initializer({ + name: 'sixth', + initialize: function (engine) { + order.push('sixth'); + } + }); + + myEngine = MyEngine.create(); + myEngineInstance = myEngine.buildInstance(); + + deepEqual(order, ['first', 'second', 'third', 'fourth', 'fifth', 'sixth']); + }); + + QUnit.test('initializers can have multiple dependencies', function () { + var order = []; + + MyEngine = _emberApplicationSystemEngine.default.extend(); + + var a = { + name: 'a', + before: 'b', + initialize: function (engine) { + order.push('a'); + } + }; + var b = { + name: 'b', + initialize: function (engine) { + order.push('b'); + } + }; + var c = { + name: 'c', + after: 'b', + initialize: function (engine) { + order.push('c'); + } + }; + var afterB = { + name: 'after b', + after: 'b', + initialize: function (engine) { + order.push('after b'); + } + }; + var afterC = { + name: 'after c', + after: 'c', + initialize: function (engine) { + order.push('after c'); + } + }; + + MyEngine.initializer(b); + MyEngine.initializer(a); + MyEngine.initializer(afterC); + MyEngine.initializer(afterB); + MyEngine.initializer(c); + + myEngine = MyEngine.create(); + myEngineInstance = myEngine.buildInstance(); + + ok(order.indexOf(a.name) < order.indexOf(b.name), 'a < b'); + ok(order.indexOf(b.name) < order.indexOf(c.name), 'b < c'); + ok(order.indexOf(b.name) < order.indexOf(afterB.name), 'b < afterB'); + ok(order.indexOf(c.name) < order.indexOf(afterC.name), 'c < afterC'); + }); + + QUnit.test('initializers set on Engine subclasses are not shared between engines', function () { + var firstInitializerRunCount = 0; + var secondInitializerRunCount = 0; + var FirstEngine = _emberApplicationSystemEngine.default.extend(); + + FirstEngine.initializer({ + name: 'first', + initialize: function (engine) { + firstInitializerRunCount++; + } + }); + + var SecondEngine = _emberApplicationSystemEngine.default.extend(); + + SecondEngine.initializer({ + name: 'second', + initialize: function (engine) { + secondInitializerRunCount++; + } + }); + + var firstEngine = FirstEngine.create(); + var firstEngineInstance = firstEngine.buildInstance(); + + equal(firstInitializerRunCount, 1, 'first initializer only was run'); + equal(secondInitializerRunCount, 0, 'first initializer only was run'); + + var secondEngine = SecondEngine.create(); + var secondEngineInstance = secondEngine.buildInstance(); + + equal(firstInitializerRunCount, 1, 'second initializer only was run'); + equal(secondInitializerRunCount, 1, 'second initializer only was run'); + + _emberMetal.run(function () { + firstEngineInstance.destroy(); + secondEngineInstance.destroy(); + + firstEngine.destroy(); + secondEngine.destroy(); + }); + }); + + QUnit.test('initializers are concatenated', function () { + var firstInitializerRunCount = 0; + var secondInitializerRunCount = 0; + var FirstEngine = _emberApplicationSystemEngine.default.extend(); + + FirstEngine.initializer({ + name: 'first', + initialize: function (engine) { + firstInitializerRunCount++; + } + }); + + var SecondEngine = FirstEngine.extend(); + + SecondEngine.initializer({ + name: 'second', + initialize: function (engine) { + secondInitializerRunCount++; + } + }); + + var firstEngine = FirstEngine.create(); + var firstEngineInstance = firstEngine.buildInstance(); + + equal(firstInitializerRunCount, 1, 'first initializer only was run when base class created'); + equal(secondInitializerRunCount, 0, 'second initializer was not run when first base class created'); + firstInitializerRunCount = 0; + + var secondEngine = SecondEngine.create(); + var secondEngineInstance = secondEngine.buildInstance(); + + equal(firstInitializerRunCount, 1, 'first initializer was run when subclass created'); + equal(secondInitializerRunCount, 1, 'second initializers was run when subclass created'); + + _emberMetal.run(function () { + firstEngineInstance.destroy(); + secondEngineInstance.destroy(); + + firstEngine.destroy(); + secondEngine.destroy(); + }); + }); + + QUnit.test('initializers are per-engine', function () { + expect(2); + + var FirstEngine = _emberApplicationSystemEngine.default.extend(); + + FirstEngine.initializer({ + name: 'abc', + initialize: function (engine) {} + }); + + expectAssertion(function () { + FirstEngine.initializer({ + name: 'abc', + initialize: function (engine) {} + }); + }); + + var SecondEngine = _emberApplicationSystemEngine.default.extend(); + SecondEngine.instanceInitializer({ + name: 'abc', + initialize: function (engine) {} + }); + + ok(true, 'Two engines can have initializers named the same.'); + }); + + QUnit.test('initializers are executed in their own context', function () { + expect(1); + + MyEngine = _emberApplicationSystemEngine.default.extend(); + + MyEngine.initializer({ + name: 'coolInitializer', + myProperty: 'cool', + initialize: function (engine) { + equal(this.myProperty, 'cool', 'should have access to its own context'); + } + }); + + myEngine = MyEngine.create(); + myEngineInstance = myEngine.buildInstance(); + }); +}); +enifed('ember-application/tests/system/engine_initializers_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/engine_initializers_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/engine_initializers_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/engine_initializers_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/engine_initializers_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/engine_initializers_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/engine_instance_initializers_test', ['exports', 'ember-metal', 'ember-application/system/engine', 'ember-application/system/engine-instance', 'ember-application/system/engine-parent'], function (exports, _emberMetal, _emberApplicationSystemEngine, _emberApplicationSystemEngineInstance, _emberApplicationSystemEngineParent) { + 'use strict'; + + var MyEngine = undefined, + myEngine = undefined, + myEngineInstance = undefined; + + function buildEngineInstance(EngineClass) { + var engineInstance = EngineClass.buildInstance(); + _emberApplicationSystemEngineParent.setEngineParent(engineInstance, { + lookup: function () { + return {}; + }, + resolveRegistration: function () { + return {}; + } + }); + return engineInstance; + } + + QUnit.module('Ember.Engine instance initializers', { + setup: function () {}, + + teardown: function () { + _emberMetal.run(function () { + if (myEngineInstance) { + myEngineInstance.destroy(); + } + + if (myEngine) { + myEngine.destroy(); + } + }); + } + }); + + QUnit.test('initializers require proper \'name\' and \'initialize\' properties', function () { + MyEngine = _emberApplicationSystemEngine.default.extend(); + + expectAssertion(function () { + _emberMetal.run(function () { + MyEngine.instanceInitializer({ name: 'initializer' }); + }); + }); + + expectAssertion(function () { + _emberMetal.run(function () { + MyEngine.instanceInitializer({ initialize: function () {} }); + }); + }); + }); + + QUnit.test('initializers are passed an engine instance', function () { + MyEngine = _emberApplicationSystemEngine.default.extend(); + + MyEngine.instanceInitializer({ + name: 'initializer', + initialize: function (instance) { + ok(instance instanceof _emberApplicationSystemEngineInstance.default, 'initialize is passed an engine instance'); + } + }); + + myEngine = MyEngine.create(); + myEngineInstance = buildEngineInstance(myEngine); + return myEngineInstance.boot(); + }); + + QUnit.test('initializers can be registered in a specified order', function () { + var order = []; + + MyEngine = _emberApplicationSystemEngine.default.extend(); + + MyEngine.instanceInitializer({ + name: 'fourth', + after: 'third', + initialize: function (engine) { + order.push('fourth'); + } + }); + + MyEngine.instanceInitializer({ + name: 'second', + after: 'first', + before: 'third', + initialize: function (engine) { + order.push('second'); + } + }); + + MyEngine.instanceInitializer({ + name: 'fifth', + after: 'fourth', + before: 'sixth', + initialize: function (engine) { + order.push('fifth'); + } + }); + + MyEngine.instanceInitializer({ + name: 'first', + before: 'second', + initialize: function (engine) { + order.push('first'); + } + }); + + MyEngine.instanceInitializer({ + name: 'third', + initialize: function (engine) { + order.push('third'); + } + }); + + MyEngine.instanceInitializer({ + name: 'sixth', + initialize: function (engine) { + order.push('sixth'); + } + }); + + myEngine = MyEngine.create(); + myEngineInstance = buildEngineInstance(myEngine); + + return myEngineInstance.boot().then(function () { + deepEqual(order, ['first', 'second', 'third', 'fourth', 'fifth', 'sixth']); + }); + }); + + QUnit.test('initializers can be registered in a specified order as an array', function () { + var order = []; + MyEngine = _emberApplicationSystemEngine.default.extend(); + + MyEngine.instanceInitializer({ + name: 'third', + initialize: function (engine) { + order.push('third'); + } + }); + + MyEngine.instanceInitializer({ + name: 'second', + after: 'first', + before: ['third', 'fourth'], + initialize: function (engine) { + order.push('second'); + } + }); + + MyEngine.instanceInitializer({ + name: 'fourth', + after: ['second', 'third'], + initialize: function (engine) { + order.push('fourth'); + } + }); + + MyEngine.instanceInitializer({ + name: 'fifth', + after: 'fourth', + before: 'sixth', + initialize: function (engine) { + order.push('fifth'); + } + }); + + MyEngine.instanceInitializer({ + name: 'first', + before: ['second'], + initialize: function (engine) { + order.push('first'); + } + }); + + MyEngine.instanceInitializer({ + name: 'sixth', + initialize: function (engine) { + order.push('sixth'); + } + }); + + myEngine = MyEngine.create(); + myEngineInstance = buildEngineInstance(myEngine); + + return myEngineInstance.boot().then(function () { + deepEqual(order, ['first', 'second', 'third', 'fourth', 'fifth', 'sixth']); + }); + }); + + QUnit.test('initializers can have multiple dependencies', function () { + var order = []; + + MyEngine = _emberApplicationSystemEngine.default.extend(); + + var a = { + name: 'a', + before: 'b', + initialize: function (engine) { + order.push('a'); + } + }; + var b = { + name: 'b', + initialize: function (engine) { + order.push('b'); + } + }; + var c = { + name: 'c', + after: 'b', + initialize: function (engine) { + order.push('c'); + } + }; + var afterB = { + name: 'after b', + after: 'b', + initialize: function (engine) { + order.push('after b'); + } + }; + var afterC = { + name: 'after c', + after: 'c', + initialize: function (engine) { + order.push('after c'); + } + }; + + MyEngine.instanceInitializer(b); + MyEngine.instanceInitializer(a); + MyEngine.instanceInitializer(afterC); + MyEngine.instanceInitializer(afterB); + MyEngine.instanceInitializer(c); + + myEngine = MyEngine.create(); + myEngineInstance = buildEngineInstance(myEngine); + + return myEngineInstance.boot().then(function () { + ok(order.indexOf(a.name) < order.indexOf(b.name), 'a < b'); + ok(order.indexOf(b.name) < order.indexOf(c.name), 'b < c'); + ok(order.indexOf(b.name) < order.indexOf(afterB.name), 'b < afterB'); + ok(order.indexOf(c.name) < order.indexOf(afterC.name), 'c < afterC'); + }); + }); + + QUnit.test('initializers set on Engine subclasses should not be shared between engines', function () { + var firstInitializerRunCount = 0; + var secondInitializerRunCount = 0; + var FirstEngine = _emberApplicationSystemEngine.default.extend(); + var firstEngine = undefined, + firstEngineInstance = undefined; + + FirstEngine.instanceInitializer({ + name: 'first', + initialize: function (engine) { + firstInitializerRunCount++; + } + }); + + var SecondEngine = _emberApplicationSystemEngine.default.extend(); + var secondEngine = undefined, + secondEngineInstance = undefined; + + SecondEngine.instanceInitializer({ + name: 'second', + initialize: function (engine) { + secondInitializerRunCount++; + } + }); + + firstEngine = FirstEngine.create(); + firstEngineInstance = buildEngineInstance(firstEngine); + + return firstEngineInstance.boot().then(function () { + equal(firstInitializerRunCount, 1, 'first initializer only was run'); + equal(secondInitializerRunCount, 0, 'first initializer only was run'); + + secondEngine = SecondEngine.create(); + secondEngineInstance = buildEngineInstance(secondEngine); + return secondEngineInstance.boot(); + }).then(function () { + equal(firstInitializerRunCount, 1, 'second initializer only was run'); + equal(secondInitializerRunCount, 1, 'second initializer only was run'); + + _emberMetal.run(function () { + firstEngineInstance.destroy(); + secondEngineInstance.destroy(); + + firstEngine.destroy(); + secondEngine.destroy(); + }); + }); + }); + + QUnit.test('initializers are concatenated', function () { + var firstInitializerRunCount = 0; + var secondInitializerRunCount = 0; + var FirstEngine = _emberApplicationSystemEngine.default.extend(); + + FirstEngine.instanceInitializer({ + name: 'first', + initialize: function (engine) { + firstInitializerRunCount++; + } + }); + + var SecondEngine = FirstEngine.extend(); + + SecondEngine.instanceInitializer({ + name: 'second', + initialize: function (engine) { + secondInitializerRunCount++; + } + }); + + var firstEngine = FirstEngine.create(); + var firstEngineInstance = buildEngineInstance(firstEngine); + + var secondEngine = undefined, + secondEngineInstance = undefined; + + return firstEngineInstance.boot().then(function () { + equal(firstInitializerRunCount, 1, 'first initializer only was run when base class created'); + equal(secondInitializerRunCount, 0, 'second initializer was not run when first base class created'); + firstInitializerRunCount = 0; + + secondEngine = SecondEngine.create(); + secondEngineInstance = buildEngineInstance(secondEngine); + return secondEngineInstance.boot(); + }).then(function () { + equal(firstInitializerRunCount, 1, 'first initializer was run when subclass created'); + equal(secondInitializerRunCount, 1, 'second initializers was run when subclass created'); + + _emberMetal.run(function () { + firstEngineInstance.destroy(); + secondEngineInstance.destroy(); + + firstEngine.destroy(); + secondEngine.destroy(); + }); + }); + }); + + QUnit.test('initializers are per-engine', function () { + expect(2); + + var FirstEngine = _emberApplicationSystemEngine.default.extend(); + + FirstEngine.instanceInitializer({ + name: 'abc', + initialize: function (engine) {} + }); + + expectAssertion(function () { + FirstEngine.instanceInitializer({ + name: 'abc', + initialize: function (engine) {} + }); + }); + + var SecondEngine = _emberApplicationSystemEngine.default.extend(); + SecondEngine.instanceInitializer({ + name: 'abc', + initialize: function (engine) {} + }); + + ok(true, 'Two engines can have initializers named the same.'); + }); + + QUnit.test('initializers are executed in their own context', function () { + expect(1); + + var MyEngine = _emberApplicationSystemEngine.default.extend(); + + MyEngine.instanceInitializer({ + name: 'coolInitializer', + myProperty: 'cool', + initialize: function (engine) { + equal(this.myProperty, 'cool', 'should have access to its own context'); + } + }); + + myEngine = MyEngine.create(); + myEngineInstance = buildEngineInstance(myEngine); + + return myEngineInstance.boot(); + }); +}); +enifed('ember-application/tests/system/engine_instance_initializers_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/engine_instance_initializers_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/engine_instance_initializers_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/engine_instance_initializers_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/engine_instance_initializers_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/engine_instance_initializers_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/engine_instance_test', ['exports', 'ember-application/system/engine', 'ember-application/system/engine-instance', 'ember-application/system/engine-parent', 'ember-metal', 'internal-test-helpers'], function (exports, _emberApplicationSystemEngine, _emberApplicationSystemEngineInstance, _emberApplicationSystemEngineParent, _emberMetal, _internalTestHelpers) { + 'use strict'; + + var engine = undefined, + engineInstance = undefined; + + QUnit.module('Ember.EngineInstance', { + setup: function () { + _emberMetal.run(function () { + engine = _emberApplicationSystemEngine.default.create({ router: null }); + }); + }, + + teardown: function () { + if (engineInstance) { + _emberMetal.run(engineInstance, 'destroy'); + } + + if (engine) { + _emberMetal.run(engine, 'destroy'); + } + } + }); + + QUnit.test('an engine instance can be created based upon a base engine', function () { + _emberMetal.run(function () { + engineInstance = _emberApplicationSystemEngineInstance.default.create({ base: engine }); + }); + + ok(engineInstance, 'instance should be created'); + equal(engineInstance.base, engine, 'base should be set to engine'); + }); + + QUnit.test('unregistering a factory clears all cached instances of that factory', function (assert) { + assert.expect(3); + + engineInstance = _emberMetal.run(function () { + return _emberApplicationSystemEngineInstance.default.create({ base: engine }); + }); + + var PostComponent = _internalTestHelpers.factory(); + + engineInstance.register('component:post', PostComponent); + + var postComponent1 = engineInstance.lookup('component:post'); + assert.ok(postComponent1, 'lookup creates instance'); + + engineInstance.unregister('component:post'); + engineInstance.register('component:post', PostComponent); + + var postComponent2 = engineInstance.lookup('component:post'); + assert.ok(postComponent2, 'lookup creates instance'); + + assert.notStrictEqual(postComponent1, postComponent2, 'lookup creates a brand new instance because previous one was reset'); + }); + + QUnit.test('can be booted when its parent has been set', function (assert) { + assert.expect(3); + + engineInstance = _emberMetal.run(function () { + return _emberApplicationSystemEngineInstance.default.create({ base: engine }); + }); + + expectAssertion(function () { + engineInstance._bootSync(); + }, 'An engine instance\'s parent must be set via `setEngineParent(engine, parent)` prior to calling `engine.boot()`.'); + + _emberApplicationSystemEngineParent.setEngineParent(engineInstance, {}); + + // Stub `cloneParentDependencies`, the internals of which are tested along + // with application instances. + engineInstance.cloneParentDependencies = function () { + assert.ok(true, 'parent dependencies are cloned'); + }; + + return engineInstance.boot().then(function () { + assert.ok(true, 'boot successful'); + }); + }); + + QUnit.test('can build a child instance of a registered engine', function (assert) { + var ChatEngine = _emberApplicationSystemEngine.default.extend(); + var chatEngineInstance = undefined; + + engine.register('engine:chat', ChatEngine); + + _emberMetal.run(function () { + engineInstance = _emberApplicationSystemEngineInstance.default.create({ base: engine }); + + // Try to build an unregistered engine. + throws(function () { + engineInstance.buildChildEngineInstance('fake'); + }, 'You attempted to mount the engine \'fake\', but it is not registered with its parent.'); + + // Build the `chat` engine, registered above. + chatEngineInstance = engineInstance.buildChildEngineInstance('chat'); + }); + + assert.ok(chatEngineInstance, 'child engine instance successfully created'); + + assert.strictEqual(_emberApplicationSystemEngineParent.getEngineParent(chatEngineInstance), engineInstance, 'child engine instance is assigned the correct parent'); + }); +}); +enifed('ember-application/tests/system/engine_instance_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/engine_instance_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/engine_instance_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/engine_instance_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/engine_instance_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/engine_instance_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/engine_parent_test', ['exports', 'ember-application/system/engine-parent'], function (exports, _emberApplicationSystemEngineParent) { + 'use strict'; + + QUnit.module('EngineParent', {}); + + QUnit.test('An engine\'s parent can be set with `setEngineParent` and retrieved with `getEngineParent`', function () { + var engine = {}; + var parent = {}; + + strictEqual(_emberApplicationSystemEngineParent.getEngineParent(engine), undefined, 'parent has not been set'); + + _emberApplicationSystemEngineParent.setEngineParent(engine, parent); + + strictEqual(_emberApplicationSystemEngineParent.getEngineParent(engine), parent, 'parent has been set'); + + strictEqual(engine[_emberApplicationSystemEngineParent.ENGINE_PARENT], parent, 'parent has been set to the ENGINE_PARENT symbol'); + }); +}); +enifed('ember-application/tests/system/engine_parent_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/engine_parent_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/engine_parent_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/engine_parent_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/engine_parent_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/engine_parent_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/engine_test', ['exports', 'ember-environment', 'ember-metal', 'ember-application/system/engine', 'ember-runtime', 'container', 'ember-application/tests/test-helpers/registry-check'], function (exports, _emberEnvironment, _emberMetal, _emberApplicationSystemEngine, _emberRuntime, _container, _emberApplicationTestsTestHelpersRegistryCheck) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['template:components/-default'], ['template:components/-default']); + + var engine = undefined; + var originalLookup = _emberEnvironment.context.lookup; + var lookup = undefined; + + QUnit.module('Ember.Engine', { + setup: function () { + lookup = _emberEnvironment.context.lookup = {}; + engine = _emberMetal.run(function () { + return _emberApplicationSystemEngine.default.create(); + }); + }, + + teardown: function () { + _emberEnvironment.context.lookup = originalLookup; + if (engine) { + _emberMetal.run(engine, 'destroy'); + } + } + }); + + QUnit.test('acts like a namespace', function () { + engine = _emberMetal.run(function () { + return lookup.TestEngine = _emberApplicationSystemEngine.default.create(); + }); + + engine.Foo = _emberRuntime.Object.extend(); + equal(engine.Foo.toString(), 'TestEngine.Foo', 'Classes pick up their parent namespace'); + }); + + QUnit.test('builds a registry', function () { + strictEqual(engine.resolveRegistration('application:main'), engine, 'application:main is registered'); + deepEqual(engine.registeredOptionsForType('component'), { singleton: false }, 'optionsForType \'component\''); + deepEqual(engine.registeredOptionsForType('view'), { singleton: false }, 'optionsForType \'view\''); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(engine, 'controller:basic'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'view', '_viewRegistry', '-view-registry:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'route', '_topLevelViewTemplate', 'template:-outlet'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'view:-outlet', 'namespace', 'application:main'); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'controller', 'target', 'router:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'controller', 'namespace', 'application:main'); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'router', '_bucketCache', _container.privatize(_templateObject)); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'route', '_bucketCache', _container.privatize(_templateObject)); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'route', 'router', 'router:main'); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(engine, 'component:-text-field'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(engine, 'component:-text-area'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(engine, 'component:-checkbox'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(engine, 'component:link-to'); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(engine, 'service:-routing'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'service:-routing', 'router', 'router:main'); + + // DEBUGGING + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(engine, 'resolver-for-debugging:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'container-debug-adapter:main', 'resolver', 'resolver-for-debugging:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'data-adapter:main', 'containerDebugAdapter', 'container-debug-adapter:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(engine, 'container-debug-adapter:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(engine, 'component-lookup:main'); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'service:-dom-changes', 'document', 'service:-document'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'service:-dom-tree-construction', 'document', 'service:-document'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(engine, 'view:-outlet'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(engine, _container.privatize(_templateObject2)); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(engine, 'template:-outlet'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'view:-outlet', 'template', 'template:-outlet'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'template', 'env', 'service:-glimmer-environment'); + deepEqual(engine.registeredOptionsForType('helper'), { instantiate: false }, 'optionsForType \'helper\''); + }); +}); +enifed('ember-application/tests/system/engine_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/engine_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/engine_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/engine_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/engine_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/engine_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/initializers_test', ['exports', 'ember-metal', 'ember-application/system/application', 'ember-views'], function (exports, _emberMetal, _emberApplicationSystemApplication, _emberViews) { + 'use strict'; + + var app = undefined; + + QUnit.module('Ember.Application initializers', { + teardown: function () { + if (app) { + _emberMetal.run(function () { + return app.destroy(); + }); + } + } + }); + + QUnit.test('initializers require proper \'name\' and \'initialize\' properties', function () { + var MyApplication = _emberApplicationSystemApplication.default.extend(); + + expectAssertion(function () { + _emberMetal.run(function () { + MyApplication.initializer({ name: 'initializer' }); + }); + }); + + expectAssertion(function () { + _emberMetal.run(function () { + MyApplication.initializer({ initialize: function () {} }); + }); + }); + }); + + QUnit.test('initializers that throw errors cause the boot promise to reject with the error', function () { + QUnit.expect(2); + QUnit.stop(); + + var MyApplication = _emberApplicationSystemApplication.default.extend(); + + MyApplication.initializer({ + name: 'initializer', + initialize: function () { + throw new Error('boot failure'); + } + }); + + app = MyApplication.create({ + autoboot: false + }); + + try { + app.boot().then(function (app) { + QUnit.start(); + ok(false, 'The boot promise should not resolve when there is a boot error'); + }, function (err) { + QUnit.start(); + ok(err instanceof Error, 'The boot promise should reject with an error'); + equal(err.message, 'boot failure'); + }); + } catch (e) { + QUnit.start(); + ok(false, 'The boot method should not throw'); + throw e; + } + }); + + QUnit.test('initializers are passed an App', function () { + var MyApplication = _emberApplicationSystemApplication.default.extend(); + + MyApplication.initializer({ + name: 'initializer', + initialize: function (App) { + ok(App instanceof _emberApplicationSystemApplication.default, 'initialize is passed an Application'); + } + }); + + _emberMetal.run(function () { + app = MyApplication.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + }); + + QUnit.test('initializers can be registered in a specified order', function () { + var order = []; + var MyApplication = _emberApplicationSystemApplication.default.extend(); + MyApplication.initializer({ + name: 'fourth', + after: 'third', + initialize: function (registry) { + order.push('fourth'); + } + }); + + MyApplication.initializer({ + name: 'second', + after: 'first', + before: 'third', + initialize: function (registry) { + order.push('second'); + } + }); + + MyApplication.initializer({ + name: 'fifth', + after: 'fourth', + before: 'sixth', + initialize: function (registry) { + order.push('fifth'); + } + }); + + MyApplication.initializer({ + name: 'first', + before: 'second', + initialize: function (registry) { + order.push('first'); + } + }); + + MyApplication.initializer({ + name: 'third', + initialize: function (registry) { + order.push('third'); + } + }); + + MyApplication.initializer({ + name: 'sixth', + initialize: function (registry) { + order.push('sixth'); + } + }); + + _emberMetal.run(function () { + app = MyApplication.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + + deepEqual(order, ['first', 'second', 'third', 'fourth', 'fifth', 'sixth']); + }); + + QUnit.test('initializers can be registered in a specified order as an array', function () { + var order = []; + var MyApplication = _emberApplicationSystemApplication.default.extend(); + + MyApplication.initializer({ + name: 'third', + initialize: function (registry) { + order.push('third'); + } + }); + + MyApplication.initializer({ + name: 'second', + after: 'first', + before: ['third', 'fourth'], + initialize: function (registry) { + order.push('second'); + } + }); + + MyApplication.initializer({ + name: 'fourth', + after: ['second', 'third'], + initialize: function (registry) { + order.push('fourth'); + } + }); + + MyApplication.initializer({ + name: 'fifth', + after: 'fourth', + before: 'sixth', + initialize: function (registry) { + order.push('fifth'); + } + }); + + MyApplication.initializer({ + name: 'first', + before: ['second'], + initialize: function (registry) { + order.push('first'); + } + }); + + MyApplication.initializer({ + name: 'sixth', + initialize: function (registry) { + order.push('sixth'); + } + }); + + _emberMetal.run(function () { + app = MyApplication.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + + deepEqual(order, ['first', 'second', 'third', 'fourth', 'fifth', 'sixth']); + }); + + QUnit.test('initializers can have multiple dependencies', function () { + var order = []; + var a = { + name: 'a', + before: 'b', + initialize: function (registry) { + order.push('a'); + } + }; + var b = { + name: 'b', + initialize: function (registry) { + order.push('b'); + } + }; + var c = { + name: 'c', + after: 'b', + initialize: function (registry) { + order.push('c'); + } + }; + var afterB = { + name: 'after b', + after: 'b', + initialize: function (registry) { + order.push('after b'); + } + }; + var afterC = { + name: 'after c', + after: 'c', + initialize: function (registry) { + order.push('after c'); + } + }; + + _emberApplicationSystemApplication.default.initializer(b); + _emberApplicationSystemApplication.default.initializer(a); + _emberApplicationSystemApplication.default.initializer(afterC); + _emberApplicationSystemApplication.default.initializer(afterB); + _emberApplicationSystemApplication.default.initializer(c); + + _emberMetal.run(function () { + app = _emberApplicationSystemApplication.default.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + + ok(order.indexOf(a.name) < order.indexOf(b.name), 'a < b'); + ok(order.indexOf(b.name) < order.indexOf(c.name), 'b < c'); + ok(order.indexOf(b.name) < order.indexOf(afterB.name), 'b < afterB'); + ok(order.indexOf(c.name) < order.indexOf(afterC.name), 'c < afterC'); + }); + + QUnit.test('initializers set on Application subclasses are not shared between apps', function () { + var firstInitializerRunCount = 0; + var secondInitializerRunCount = 0; + var FirstApp = _emberApplicationSystemApplication.default.extend(); + + FirstApp.initializer({ + name: 'first', + initialize: function (registry) { + firstInitializerRunCount++; + } + }); + + var SecondApp = _emberApplicationSystemApplication.default.extend(); + + SecondApp.initializer({ + name: 'second', + initialize: function (registry) { + secondInitializerRunCount++; + } + }); + + _emberViews.jQuery('#qunit-fixture').html('
'); + + var firstApp = _emberMetal.run(function () { + return FirstApp.create({ + router: false, + rootElement: '#qunit-fixture #first' + }); + }); + + equal(firstInitializerRunCount, 1, 'first initializer only was run'); + equal(secondInitializerRunCount, 0, 'first initializer only was run'); + + var secondApp = _emberMetal.run(function () { + return SecondApp.create({ + router: false, + rootElement: '#qunit-fixture #second' + }); + }); + + equal(firstInitializerRunCount, 1, 'second initializer only was run'); + equal(secondInitializerRunCount, 1, 'second initializer only was run'); + + _emberMetal.run(function () { + firstApp.destroy(); + secondApp.destroy(); + }); + }); + + QUnit.test('initializers are concatenated', function () { + var firstInitializerRunCount = 0; + var secondInitializerRunCount = 0; + var FirstApp = _emberApplicationSystemApplication.default.extend(); + + FirstApp.initializer({ + name: 'first', + initialize: function (registry) { + firstInitializerRunCount++; + } + }); + + var SecondApp = FirstApp.extend(); + SecondApp.initializer({ + name: 'second', + initialize: function (registry) { + secondInitializerRunCount++; + } + }); + + _emberViews.jQuery('#qunit-fixture').html('
'); + var firstApp = _emberMetal.run(function () { + return FirstApp.create({ + router: false, + rootElement: '#qunit-fixture #first' + }); + }); + equal(firstInitializerRunCount, 1, 'first initializer only was run when base class created'); + equal(secondInitializerRunCount, 0, 'first initializer only was run when base class created'); + firstInitializerRunCount = 0; + + var secondApp = _emberMetal.run(function () { + return SecondApp.create({ + router: false, + rootElement: '#qunit-fixture #second' + }); + }); + + equal(firstInitializerRunCount, 1, 'first initializer was run when subclass created'); + equal(secondInitializerRunCount, 1, 'second initializers was run when subclass created'); + _emberMetal.run(function () { + firstApp.destroy(); + secondApp.destroy(); + }); + }); + + QUnit.test('initializers are per-app', function () { + expect(2); + + var FirstApp = _emberApplicationSystemApplication.default.extend(); + + FirstApp.initializer({ + name: 'abc', + initialize: function (app) {} + }); + + expectAssertion(function () { + FirstApp.initializer({ + name: 'abc', + initialize: function (app) {} + }); + }); + + var SecondApp = _emberApplicationSystemApplication.default.extend(); + SecondApp.instanceInitializer({ + name: 'abc', + initialize: function (app) {} + }); + + ok(true, 'Two apps can have initializers named the same.'); + }); + + QUnit.test('initializers are executed in their own context', function () { + expect(1); + var MyApplication = _emberApplicationSystemApplication.default.extend(); + + MyApplication.initializer({ + name: 'coolInitializer', + myProperty: 'cool', + initialize: function (application) { + equal(this.myProperty, 'cool', 'should have access to its own context'); + } + }); + + _emberMetal.run(function () { + app = MyApplication.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + }); + + QUnit.test('initializers throw a deprecation warning when receiving a second argument', function () { + expect(1); + + var MyApplication = _emberApplicationSystemApplication.default.extend(); + + MyApplication.initializer({ + name: 'deprecated', + initialize: function (registry, application) {} + }); + + expectDeprecation(function () { + _emberMetal.run(function () { + app = MyApplication.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + }, /The `initialize` method for Application initializer 'deprecated' should take only one argument - `App`, an instance of an `Application`./); + }); +}); +enifed('ember-application/tests/system/initializers_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/initializers_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/initializers_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/initializers_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/initializers_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/initializers_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/instance_initializers_test', ['exports', 'ember-metal', 'ember-application/system/application', 'ember-application/system/application-instance', 'ember-views'], function (exports, _emberMetal, _emberApplicationSystemApplication, _emberApplicationSystemApplicationInstance, _emberViews) { + 'use strict'; + + var app = undefined; + + QUnit.module('Ember.Application instance initializers', { + teardown: function () { + if (app) { + _emberMetal.run(function () { + return app.destroy(); + }); + } + } + }); + + QUnit.test('initializers require proper \'name\' and \'initialize\' properties', function () { + var MyApplication = _emberApplicationSystemApplication.default.extend(); + + expectAssertion(function () { + _emberMetal.run(function () { + MyApplication.instanceInitializer({ name: 'initializer' }); + }); + }); + + expectAssertion(function () { + _emberMetal.run(function () { + MyApplication.instanceInitializer({ initialize: function () {} }); + }); + }); + }); + + QUnit.test('initializers are passed an app instance', function () { + var MyApplication = _emberApplicationSystemApplication.default.extend(); + + MyApplication.instanceInitializer({ + name: 'initializer', + initialize: function (instance) { + ok(instance instanceof _emberApplicationSystemApplicationInstance.default, 'initialize is passed an application instance'); + } + }); + + _emberMetal.run(function () { + app = MyApplication.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + }); + + QUnit.test('initializers can be registered in a specified order', function () { + var order = []; + var MyApplication = _emberApplicationSystemApplication.default.extend(); + MyApplication.instanceInitializer({ + name: 'fourth', + after: 'third', + initialize: function (registry) { + order.push('fourth'); + } + }); + + MyApplication.instanceInitializer({ + name: 'second', + after: 'first', + before: 'third', + initialize: function (registry) { + order.push('second'); + } + }); + + MyApplication.instanceInitializer({ + name: 'fifth', + after: 'fourth', + before: 'sixth', + initialize: function (registry) { + order.push('fifth'); + } + }); + + MyApplication.instanceInitializer({ + name: 'first', + before: 'second', + initialize: function (registry) { + order.push('first'); + } + }); + + MyApplication.instanceInitializer({ + name: 'third', + initialize: function (registry) { + order.push('third'); + } + }); + + MyApplication.instanceInitializer({ + name: 'sixth', + initialize: function (registry) { + order.push('sixth'); + } + }); + + _emberMetal.run(function () { + app = MyApplication.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + + deepEqual(order, ['first', 'second', 'third', 'fourth', 'fifth', 'sixth']); + }); + + QUnit.test('initializers can be registered in a specified order as an array', function () { + var order = []; + var MyApplication = _emberApplicationSystemApplication.default.extend(); + + MyApplication.instanceInitializer({ + name: 'third', + initialize: function (registry) { + order.push('third'); + } + }); + + MyApplication.instanceInitializer({ + name: 'second', + after: 'first', + before: ['third', 'fourth'], + initialize: function (registry) { + order.push('second'); + } + }); + + MyApplication.instanceInitializer({ + name: 'fourth', + after: ['second', 'third'], + initialize: function (registry) { + order.push('fourth'); + } + }); + + MyApplication.instanceInitializer({ + name: 'fifth', + after: 'fourth', + before: 'sixth', + initialize: function (registry) { + order.push('fifth'); + } + }); + + MyApplication.instanceInitializer({ + name: 'first', + before: ['second'], + initialize: function (registry) { + order.push('first'); + } + }); + + MyApplication.instanceInitializer({ + name: 'sixth', + initialize: function (registry) { + order.push('sixth'); + } + }); + + _emberMetal.run(function () { + app = MyApplication.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + + deepEqual(order, ['first', 'second', 'third', 'fourth', 'fifth', 'sixth']); + }); + + QUnit.test('initializers can have multiple dependencies', function () { + var order = []; + var a = { + name: 'a', + before: 'b', + initialize: function (registry) { + order.push('a'); + } + }; + var b = { + name: 'b', + initialize: function (registry) { + order.push('b'); + } + }; + var c = { + name: 'c', + after: 'b', + initialize: function (registry) { + order.push('c'); + } + }; + var afterB = { + name: 'after b', + after: 'b', + initialize: function (registry) { + order.push('after b'); + } + }; + var afterC = { + name: 'after c', + after: 'c', + initialize: function (registry) { + order.push('after c'); + } + }; + + _emberApplicationSystemApplication.default.instanceInitializer(b); + _emberApplicationSystemApplication.default.instanceInitializer(a); + _emberApplicationSystemApplication.default.instanceInitializer(afterC); + _emberApplicationSystemApplication.default.instanceInitializer(afterB); + _emberApplicationSystemApplication.default.instanceInitializer(c); + + _emberMetal.run(function () { + app = _emberApplicationSystemApplication.default.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + + ok(order.indexOf(a.name) < order.indexOf(b.name), 'a < b'); + ok(order.indexOf(b.name) < order.indexOf(c.name), 'b < c'); + ok(order.indexOf(b.name) < order.indexOf(afterB.name), 'b < afterB'); + ok(order.indexOf(c.name) < order.indexOf(afterC.name), 'c < afterC'); + }); + + QUnit.test('initializers set on Application subclasses should not be shared between apps', function () { + var firstInitializerRunCount = 0; + var secondInitializerRunCount = 0; + var FirstApp = _emberApplicationSystemApplication.default.extend(); + var firstApp = undefined, + secondApp = undefined; + + FirstApp.instanceInitializer({ + name: 'first', + initialize: function (registry) { + firstInitializerRunCount++; + } + }); + var SecondApp = _emberApplicationSystemApplication.default.extend(); + SecondApp.instanceInitializer({ + name: 'second', + initialize: function (registry) { + secondInitializerRunCount++; + } + }); + _emberViews.jQuery('#qunit-fixture').html('
'); + _emberMetal.run(function () { + firstApp = FirstApp.create({ + router: false, + rootElement: '#qunit-fixture #first' + }); + }); + equal(firstInitializerRunCount, 1, 'first initializer only was run'); + equal(secondInitializerRunCount, 0, 'first initializer only was run'); + _emberMetal.run(function () { + secondApp = SecondApp.create({ + router: false, + rootElement: '#qunit-fixture #second' + }); + }); + equal(firstInitializerRunCount, 1, 'second initializer only was run'); + equal(secondInitializerRunCount, 1, 'second initializer only was run'); + _emberMetal.run(function () { + firstApp.destroy(); + secondApp.destroy(); + }); + }); + + QUnit.test('initializers are concatenated', function () { + var firstInitializerRunCount = 0; + var secondInitializerRunCount = 0; + var FirstApp = _emberApplicationSystemApplication.default.extend(); + var firstApp = undefined, + secondApp = undefined; + + FirstApp.instanceInitializer({ + name: 'first', + initialize: function (registry) { + firstInitializerRunCount++; + } + }); + + var SecondApp = FirstApp.extend(); + SecondApp.instanceInitializer({ + name: 'second', + initialize: function (registry) { + secondInitializerRunCount++; + } + }); + + _emberViews.jQuery('#qunit-fixture').html('
'); + _emberMetal.run(function () { + firstApp = FirstApp.create({ + router: false, + rootElement: '#qunit-fixture #first' + }); + }); + equal(firstInitializerRunCount, 1, 'first initializer only was run when base class created'); + equal(secondInitializerRunCount, 0, 'first initializer only was run when base class created'); + firstInitializerRunCount = 0; + _emberMetal.run(function () { + secondApp = SecondApp.create({ + router: false, + rootElement: '#qunit-fixture #second' + }); + }); + equal(firstInitializerRunCount, 1, 'first initializer was run when subclass created'); + equal(secondInitializerRunCount, 1, 'second initializers was run when subclass created'); + _emberMetal.run(function () { + firstApp.destroy(); + secondApp.destroy(); + }); + }); + + QUnit.test('initializers are per-app', function () { + expect(2); + + var FirstApp = _emberApplicationSystemApplication.default.extend(); + + FirstApp.instanceInitializer({ + name: 'abc', + initialize: function (app) {} + }); + + expectAssertion(function () { + FirstApp.instanceInitializer({ + name: 'abc', + initialize: function (app) {} + }); + }); + + var SecondApp = _emberApplicationSystemApplication.default.extend(); + SecondApp.instanceInitializer({ + name: 'abc', + initialize: function (app) {} + }); + + ok(true, 'Two apps can have initializers named the same.'); + }); + + QUnit.test('initializers are run before ready hook', function () { + expect(2); + + var readyWasCalled = false; + + var MyApplication = _emberApplicationSystemApplication.default.extend({ + ready: function () { + ok(true, 'ready is called'); + readyWasCalled = true; + } + }); + + MyApplication.instanceInitializer({ + name: 'initializer', + initialize: function () { + ok(!readyWasCalled, 'ready is not yet called'); + } + }); + + _emberMetal.run(function () { + app = MyApplication.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + }); + + QUnit.test('initializers are executed in their own context', function () { + expect(1); + + var MyApplication = _emberApplicationSystemApplication.default.extend(); + + MyApplication.instanceInitializer({ + name: 'coolInitializer', + myProperty: 'cool', + initialize: function (registry, application) { + equal(this.myProperty, 'cool', 'should have access to its own context'); + } + }); + + _emberMetal.run(function () { + app = MyApplication.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + }); + + QUnit.test('initializers get an instance on app reset', function () { + expect(2); + + var MyApplication = _emberApplicationSystemApplication.default.extend(); + + MyApplication.instanceInitializer({ + name: 'giveMeAnInstance', + initialize: function (instance) { + ok(!!instance, 'Initializer got an instance'); + } + }); + + _emberMetal.run(function () { + app = MyApplication.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + + _emberMetal.run(app, 'reset'); + }); +}); +enifed('ember-application/tests/system/instance_initializers_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/instance_initializers_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/instance_initializers_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/instance_initializers_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/instance_initializers_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/instance_initializers_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/logging_test', ['exports', 'ember-console', 'ember-metal', 'ember-application/system/application', 'ember-runtime', 'ember-routing', 'ember-template-compiler'], function (exports, _emberConsole, _emberMetal, _emberApplicationSystemApplication, _emberRuntime, _emberRouting, _emberTemplateCompiler) { + /*globals EmberDev */ + + 'use strict'; + + var App = undefined, + logs = undefined, + originalLogger = undefined; + + QUnit.module('Ember.Application – logging of generated classes', { + setup: function () { + logs = {}; + + originalLogger = _emberConsole.default.info; + + _emberConsole.default.info = function () { + var fullName = arguments[1].fullName; + + logs[fullName] = logs[fullName] || 0; + logs[fullName]++; + }; + + _emberMetal.run(function () { + App = _emberApplicationSystemApplication.default.create({ + LOG_ACTIVE_GENERATION: true + }); + + App.Router.reopen({ + location: 'none' + }); + + App.Router.map(function () { + this.route('posts', { resetNamespace: true }); + }); + + App.deferReadiness(); + }); + }, + + teardown: function () { + _emberConsole.default.info = originalLogger; + + _emberMetal.run(App, 'destroy'); + + logs = App = null; + } + }); + + function visit(path) { + QUnit.stop(); + + var promise = _emberMetal.run(function () { + return new _emberRuntime.RSVP.Promise(function (resolve, reject) { + var router = App.__container__.lookup('router:main'); + + resolve(router.handleURL(path).then(function (value) { + QUnit.start(); + ok(true, 'visited: `' + path + '`'); + return value; + }, function (reason) { + QUnit.start(); + ok(false, 'failed to visit:`' + path + '` reason: `' + QUnit.jsDump.parse(reason)); + throw reason; + })); + }); + }); + + return { + then: function (resolve, reject) { + _emberMetal.run(promise, 'then', resolve, reject); + } + }; + } + + QUnit.test('log class generation if logging enabled', function () { + if (EmberDev && EmberDev.runningProdBuild) { + ok(true, 'Logging does not occur in production builds'); + return; + } + + _emberMetal.run(App, 'advanceReadiness'); + + visit('/posts').then(function () { + equal(Object.keys(logs).length, 6, 'expected logs'); + }); + }); + + QUnit.test('do NOT log class generation if logging disabled', function () { + App.reopen({ + LOG_ACTIVE_GENERATION: false + }); + + _emberMetal.run(App, 'advanceReadiness'); + + visit('/posts').then(function () { + equal(Object.keys(logs).length, 0, 'expected no logs'); + }); + }); + + QUnit.test('actively generated classes get logged', function () { + if (EmberDev && EmberDev.runningProdBuild) { + ok(true, 'Logging does not occur in production builds'); + return; + } + + _emberMetal.run(App, 'advanceReadiness'); + + visit('/posts').then(function () { + equal(logs['controller:application'], 1, 'expected: ApplicationController was generated'); + equal(logs['controller:posts'], 1, 'expected: PostsController was generated'); + + equal(logs['route:application'], 1, 'expected: ApplicationRoute was generated'); + equal(logs['route:posts'], 1, 'expected: PostsRoute was generated'); + }); + }); + + QUnit.test('predefined classes do not get logged', function () { + App.ApplicationController = _emberRuntime.Controller.extend(); + App.PostsController = _emberRuntime.Controller.extend(); + + App.ApplicationRoute = _emberRouting.Route.extend(); + App.PostsRoute = _emberRouting.Route.extend(); + + _emberMetal.run(App, 'advanceReadiness'); + + visit('/posts').then(function () { + ok(!logs['controller:application'], 'did not expect: ApplicationController was generated'); + ok(!logs['controller:posts'], 'did not expect: PostsController was generated'); + + ok(!logs['route:application'], 'did not expect: ApplicationRoute was generated'); + ok(!logs['route:posts'], 'did not expect: PostsRoute was generated'); + }); + }); + + QUnit.module('Ember.Application – logging of view lookups', { + setup: function () { + logs = {}; + + originalLogger = _emberConsole.default.info; + + _emberConsole.default.info = function () { + var fullName = arguments[1].fullName; + + logs[fullName] = logs[fullName] || 0; + logs[fullName]++; + }; + + _emberMetal.run(function () { + App = _emberApplicationSystemApplication.default.create({ + LOG_VIEW_LOOKUPS: true + }); + + App.Router.reopen({ + location: 'none' + }); + + App.Router.map(function () { + this.route('posts', { resetNamespace: true }); + }); + + App.deferReadiness(); + }); + }, + + teardown: function () { + _emberConsole.default.info = originalLogger; + + _emberMetal.run(App, 'destroy'); + + logs = App = null; + } + }); + + QUnit.test('log when template and view are missing when flag is active', function () { + if (EmberDev && EmberDev.runningProdBuild) { + ok(true, 'Logging does not occur in production builds'); + return; + } + + App.register('template:application', _emberTemplateCompiler.compile('{{outlet}}')); + _emberMetal.run(App, 'advanceReadiness'); + + visit('/posts').then(function () { + equal(logs['template:application'], undefined, 'expected: Should not log template:application since it exists.'); + equal(logs['template:index'], 1, 'expected: Could not find "index" template or view.'); + equal(logs['template:posts'], 1, 'expected: Could not find "posts" template or view.'); + }); + }); + + QUnit.test('do not log when template and view are missing when flag is not true', function () { + App.reopen({ + LOG_VIEW_LOOKUPS: false + }); + + _emberMetal.run(App, 'advanceReadiness'); + + visit('/posts').then(function () { + equal(Object.keys(logs).length, 0, 'expected no logs'); + }); + }); + + QUnit.test('do not log which views are used with templates when flag is not true', function () { + App.reopen({ + LOG_VIEW_LOOKUPS: false + }); + + _emberMetal.run(App, 'advanceReadiness'); + + visit('/posts').then(function () { + equal(Object.keys(logs).length, 0, 'expected no logs'); + }); + }); +}); +enifed('ember-application/tests/system/logging_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/logging_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/logging_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/logging_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/logging_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/logging_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/readiness_test', ['exports', 'ember-metal', 'ember-application/system/application'], function (exports, _emberMetal, _emberApplicationSystemApplication) { + 'use strict'; + + var jQuery = undefined, + application = undefined, + Application = undefined; + var readyWasCalled = undefined, + domReady = undefined, + readyCallbacks = undefined; + + // We are using a small mock of jQuery because jQuery is third-party code with + // very well-defined semantics, and we want to confirm that a jQuery stub run + // in a more minimal server environment that implements this behavior will be + // sufficient for Ember's requirements. + + QUnit.module('Application readiness', { + setup: function () { + readyWasCalled = 0; + readyCallbacks = []; + + var jQueryInstance = { + ready: function (callback) { + readyCallbacks.push(callback); + if (jQuery.isReady) { + domReady(); + } + } + }; + + jQuery = function () { + return jQueryInstance; + }; + jQuery.isReady = false; + + var domReadyCalled = 0; + domReady = function () { + if (domReadyCalled !== 0) { + return; + } + domReadyCalled++; + for (var i = 0; i < readyCallbacks.length; i++) { + readyCallbacks[i](); + } + }; + + Application = _emberApplicationSystemApplication.default.extend({ + $: jQuery, + + ready: function () { + readyWasCalled++; + } + }); + }, + + teardown: function () { + if (application) { + _emberMetal.run(function () { + return application.destroy(); + }); + } + } + }); + + // These tests are confirming that if the callbacks passed into jQuery's ready hook is called + // synchronously during the application's initialization, we get the same behavior as if + // it was triggered after initialization. + + QUnit.test('Ember.Application\'s ready event is called right away if jQuery is already ready', function () { + jQuery.isReady = true; + + _emberMetal.run(function () { + application = Application.create({ router: false }); + + equal(readyWasCalled, 0, 'ready is not called until later'); + }); + + equal(readyWasCalled, 1, 'ready was called'); + + domReady(); + + equal(readyWasCalled, 1, 'application\'s ready was not called again'); + }); + + QUnit.test('Ember.Application\'s ready event is called after the document becomes ready', function () { + _emberMetal.run(function () { + application = Application.create({ router: false }); + }); + + equal(readyWasCalled, 0, 'ready wasn\'t called yet'); + + domReady(); + + equal(readyWasCalled, 1, 'ready was called now that DOM is ready'); + }); + + QUnit.test('Ember.Application\'s ready event can be deferred by other components', function () { + _emberMetal.run(function () { + application = Application.create({ router: false }); + application.deferReadiness(); + }); + + equal(readyWasCalled, 0, 'ready wasn\'t called yet'); + + domReady(); + + equal(readyWasCalled, 0, 'ready wasn\'t called yet'); + + _emberMetal.run(function () { + application.advanceReadiness(); + equal(readyWasCalled, 0); + }); + + equal(readyWasCalled, 1, 'ready was called now all readiness deferrals are advanced'); + }); + + QUnit.test('Ember.Application\'s ready event can be deferred by other components', function () { + jQuery.isReady = false; + + _emberMetal.run(function () { + application = Application.create({ router: false }); + application.deferReadiness(); + equal(readyWasCalled, 0, 'ready wasn\'t called yet'); + }); + + domReady(); + + equal(readyWasCalled, 0, 'ready wasn\'t called yet'); + + _emberMetal.run(function () { + application.advanceReadiness(); + }); + + equal(readyWasCalled, 1, 'ready was called now all readiness deferrals are advanced'); + + expectAssertion(function () { + application.deferReadiness(); + }); + }); +}); +enifed('ember-application/tests/system/readiness_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/readiness_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/readiness_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/readiness_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/readiness_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/readiness_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/reset_test', ['exports', 'ember-metal', 'ember-application/system/application', 'ember-runtime', 'ember-routing', 'container'], function (exports, _emberMetal, _emberApplicationSystemApplication, _emberRuntime, _emberRouting, _container) { + 'use strict'; + + var application = undefined, + Application = undefined; + + QUnit.module('Ember.Application - resetting', { + setup: function () { + Application = _emberApplicationSystemApplication.default.extend({ + name: 'App', + rootElement: '#qunit-fixture' + }); + }, + teardown: function () { + Application = null; + if (application) { + _emberMetal.run(application, 'destroy'); + } + } + }); + + QUnit.test('Brings its own run-loop if not provided', function () { + application = _emberMetal.run(Application, 'create'); + application.ready = function () { + QUnit.start(); + ok(true, 'app booted'); + }; + + QUnit.stop(); + application.reset(); + }); + + QUnit.test('Does not bring its own run loop if one is already provided', function () { + expect(3); + + var didBecomeReady = false; + + application = _emberMetal.run(Application, 'create'); + + _emberMetal.run(function () { + application.ready = function () { + didBecomeReady = true; + }; + + application.reset(); + + application.deferReadiness(); + ok(!didBecomeReady, 'app is not ready'); + }); + + ok(!didBecomeReady, 'app is not ready'); + _emberMetal.run(application, 'advanceReadiness'); + ok(didBecomeReady, 'app is ready'); + }); + + QUnit.test('When an application is reset, new instances of controllers are generated', function () { + _emberMetal.run(function () { + application = Application.create(); + application.AcademicController = _emberRuntime.Controller.extend(); + }); + + var firstController = application.__container__.lookup('controller:academic'); + var secondController = application.__container__.lookup('controller:academic'); + + application.reset(); + + var thirdController = application.__container__.lookup('controller:academic'); + + strictEqual(firstController, secondController, 'controllers looked up in succession should be the same instance'); + + ok(firstController.isDestroying, 'controllers are destroyed when their application is reset'); + + notStrictEqual(firstController, thirdController, 'controllers looked up after the application is reset should not be the same instance'); + }); + + QUnit.test('When an application is reset, the eventDispatcher is destroyed and recreated', function () { + var eventDispatcherWasSetup = undefined, + eventDispatcherWasDestroyed = undefined; + + eventDispatcherWasSetup = 0; + eventDispatcherWasDestroyed = 0; + + var mock_event_dispatcher = { + create: function () { + return { + setup: function () { + eventDispatcherWasSetup++; + }, + destroy: function () { + eventDispatcherWasDestroyed++; + } + }; + } + }; + + // this is pretty awful. We should make this less Global-ly. + var originalRegister = _container.Registry.prototype.register; + _container.Registry.prototype.register = function (name, type, options) { + if (name === 'event_dispatcher:main') { + return mock_event_dispatcher; + } else { + return originalRegister.call(this, name, type, options); + } + }; + + try { + _emberMetal.run(function () { + application = Application.create(); + + equal(eventDispatcherWasSetup, 0); + equal(eventDispatcherWasDestroyed, 0); + }); + + equal(eventDispatcherWasSetup, 1); + equal(eventDispatcherWasDestroyed, 0); + + application.reset(); + + equal(eventDispatcherWasDestroyed, 1); + equal(eventDispatcherWasSetup, 2, 'setup called after reset'); + } catch (error) { + _container.Registry.prototype.register = originalRegister; + } + + _container.Registry.prototype.register = originalRegister; + }); + + QUnit.test('When an application is reset, the router URL is reset to `/`', function () { + var location = undefined, + router = undefined; + + _emberMetal.run(function () { + application = Application.create(); + application.Router = _emberRouting.Router.extend({ + location: 'none' + }); + + application.Router.map(function () { + this.route('one'); + this.route('two'); + }); + }); + + router = application.__container__.lookup('router:main'); + + location = router.get('location'); + + _emberMetal.run(function () { + location.handleURL('/one'); + }); + + application.reset(); + + var applicationController = application.__container__.lookup('controller:application'); + router = application.__container__.lookup('router:main'); + location = router.get('location'); + + equal(location.getURL(), ''); + + equal(_emberMetal.get(applicationController, 'currentPath'), 'index'); + + location = application.__container__.lookup('router:main').get('location'); + _emberMetal.run(function () { + location.handleURL('/one'); + }); + + equal(_emberMetal.get(applicationController, 'currentPath'), 'one'); + }); + + QUnit.test('When an application with advance/deferReadiness is reset, the app does correctly become ready after reset', function () { + var readyCallCount; + + readyCallCount = 0; + + _emberMetal.run(function () { + application = Application.create({ + ready: function () { + readyCallCount++; + } + }); + + application.deferReadiness(); + equal(readyCallCount, 0, 'ready has not yet been called'); + }); + + _emberMetal.run(function () { + application.advanceReadiness(); + }); + + equal(readyCallCount, 1, 'ready was called once'); + + application.reset(); + + equal(readyCallCount, 2, 'ready was called twice'); + }); + + QUnit.test('With ember-data like initializer and constant', function () { + var readyCallCount = undefined; + + readyCallCount = 0; + + var DS = { + Store: _emberRuntime.Object.extend({ + init: function () { + if (!_emberMetal.get(DS, 'defaultStore')) { + _emberMetal.set(DS, 'defaultStore', this); + } + + this._super.apply(this, arguments); + }, + willDestroy: function () { + if (_emberMetal.get(DS, 'defaultStore') === this) { + _emberMetal.set(DS, 'defaultStore', null); + } + } + }) + }; + + Application.initializer({ + name: 'store', + initialize: function (application) { + application.unregister('store:main'); + application.register('store:main', application.Store); + + application.__container__.lookup('store:main'); + } + }); + + _emberMetal.run(function () { + application = Application.create(); + application.Store = DS.Store; + }); + + ok(DS.defaultStore, 'has defaultStore'); + + application.reset(); + + ok(DS.defaultStore, 'still has defaultStore'); + ok(application.__container__.lookup('store:main'), 'store is still present'); + }); +}); +enifed('ember-application/tests/system/reset_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/reset_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/reset_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/reset_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/reset_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/reset_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/visit_test', ['exports', 'ember-runtime', 'ember-metal', 'ember-application/system/application', 'ember-application/system/application-instance', 'ember-application/system/engine', 'ember-routing', 'ember-glimmer', 'ember-template-compiler', 'ember-views'], function (exports, _emberRuntime, _emberMetal, _emberApplicationSystemApplication, _emberApplicationSystemApplicationInstance, _emberApplicationSystemEngine, _emberRouting, _emberGlimmer, _emberTemplateCompiler, _emberViews) { + 'use strict'; + + var App = null; + var instance = null; + var instances = []; + + function createApplication(integration) { + App = _emberApplicationSystemApplication.default.extend().create({ + autoboot: false, + rootElement: '#qunit-fixture', + LOG_TRANSITIONS: true, + LOG_TRANSITIONS_INTERNAL: true, + LOG_ACTIVE_GENERATION: true + }); + + App.Router = _emberRouting.Router.extend({ + location: 'none' + }); + + if (integration) { + App.instanceInitializer({ + name: 'auto-cleanup', + initialize: function (_instance) { + instances.push(_instance); + } + }); + } else { + App.instanceInitializer({ + name: 'auto-cleanup', + initialize: function (_instance) { + if (instance) { + _emberMetal.run(instance, 'destroy'); + } + + instance = _instance; + } + }); + } + + return App; + } + + function expectAsyncError() { + _emberRuntime.RSVP.off('error'); + } + + QUnit.module('Ember.Application - visit()', { + teardown: function () { + _emberRuntime.RSVP.on('error', _emberRuntime.onerrorDefault); + + if (instance) { + _emberMetal.run(instance, 'destroy'); + instance = null; + } + + if (App) { + _emberMetal.run(App, 'destroy'); + App = null; + } + } + }); + + // This tests whether the application is "autobooted" by registering an + // instance initializer and asserting it never gets run. Since this is + // inherently testing that async behavior *doesn't* happen, we set a + // 500ms timeout to verify that when autoboot is set to false, the + // instance initializer that would normally get called on DOM ready + // does not fire. + QUnit.test('Applications with autoboot set to false do not autoboot', function (assert) { + function delay(time) { + return new _emberRuntime.RSVP.Promise(function (resolve) { + return _emberMetal.run.later(resolve, time); + }); + } + + var appBooted = 0; + var instanceBooted = 0; + + _emberMetal.run(function () { + createApplication(); + + App.initializer({ + name: 'assert-no-autoboot', + initialize: function () { + appBooted++; + } + }); + + App.instanceInitializer({ + name: 'assert-no-autoboot', + initialize: function () { + instanceBooted++; + } + }); + }); + + // Continue after 500ms + return delay(500).then(function () { + assert.ok(appBooted === 0, '500ms elapsed without app being booted'); + assert.ok(instanceBooted === 0, '500ms elapsed without instances being booted'); + + return _emberMetal.run(App, 'boot'); + }).then(function () { + assert.ok(appBooted === 1, 'app should boot when manually calling `app.boot()`'); + assert.ok(instanceBooted === 0, 'no instances should be booted automatically when manually calling `app.boot()'); + }); + }); + + QUnit.test('calling visit() on an app without first calling boot() should boot the app', function (assert) { + var appBooted = 0; + var instanceBooted = 0; + + _emberMetal.run(function () { + createApplication(); + + App.initializer({ + name: 'assert-no-autoboot', + initialize: function () { + appBooted++; + } + }); + + App.instanceInitializer({ + name: 'assert-no-autoboot', + initialize: function () { + instanceBooted++; + } + }); + }); + + return _emberMetal.run(App, 'visit', '/').then(function () { + assert.ok(appBooted === 1, 'the app should be booted`'); + assert.ok(instanceBooted === 1, 'an instances should be booted'); + }); + }); + + QUnit.test('calling visit() on an already booted app should not boot it again', function (assert) { + var appBooted = 0; + var instanceBooted = 0; + + _emberMetal.run(function () { + createApplication(); + + App.initializer({ + name: 'assert-no-autoboot', + initialize: function () { + appBooted++; + } + }); + + App.instanceInitializer({ + name: 'assert-no-autoboot', + initialize: function () { + instanceBooted++; + } + }); + }); + + return _emberMetal.run(App, 'boot').then(function () { + assert.ok(appBooted === 1, 'the app should be booted'); + assert.ok(instanceBooted === 0, 'no instances should be booted'); + + return _emberMetal.run(App, 'visit', '/'); + }).then(function () { + assert.ok(appBooted === 1, 'the app should not be booted again'); + assert.ok(instanceBooted === 1, 'an instance should be booted'); + + return _emberMetal.run(App, 'visit', '/'); + }).then(function () { + assert.ok(appBooted === 1, 'the app should not be booted again'); + assert.ok(instanceBooted === 2, 'another instance should be booted'); + }); + }); + + QUnit.test('visit() rejects on application boot failure', function (assert) { + _emberMetal.run(function () { + createApplication(); + + App.initializer({ + name: 'error', + initialize: function () { + throw new Error('boot failure'); + } + }); + }); + + expectAsyncError(); + + return _emberMetal.run(App, 'visit', '/').then(function () { + assert.ok(false, 'It should not resolve the promise'); + }, function (error) { + assert.ok(error instanceof Error, 'It should reject the promise with the boot error'); + assert.equal(error.message, 'boot failure'); + }); + }); + + QUnit.test('visit() rejects on instance boot failure', function (assert) { + _emberMetal.run(function () { + createApplication(); + + App.instanceInitializer({ + name: 'error', + initialize: function () { + throw new Error('boot failure'); + } + }); + }); + + expectAsyncError(); + + return _emberMetal.run(App, 'visit', '/').then(function () { + assert.ok(false, 'It should not resolve the promise'); + }, function (error) { + assert.ok(error instanceof Error, 'It should reject the promise with the boot error'); + assert.equal(error.message, 'boot failure'); + }); + }); + + QUnit.test('visit() follows redirects', function (assert) { + _emberMetal.run(function () { + createApplication(); + + App.Router.map(function () { + this.route('a'); + this.route('b', { path: '/b/:b' }); + this.route('c', { path: '/c/:c' }); + }); + + App.register('route:a', _emberRouting.Route.extend({ + afterModel: function () { + this.replaceWith('b', 'zomg'); + } + })); + + App.register('route:b', _emberRouting.Route.extend({ + afterModel: function (params) { + this.transitionTo('c', params.b); + } + })); + }); + + return _emberMetal.run(App, 'visit', '/a').then(function (instance) { + assert.ok(instance instanceof _emberApplicationSystemApplicationInstance.default, 'promise is resolved with an ApplicationInstance'); + assert.equal(instance.getURL(), '/c/zomg', 'It should follow all redirects'); + }); + }); + + QUnit.test('visit() rejects if an error occured during a transition', function (assert) { + _emberMetal.run(function () { + createApplication(); + + App.Router.map(function () { + this.route('a'); + this.route('b', { path: '/b/:b' }); + this.route('c', { path: '/c/:c' }); + }); + + App.register('route:a', _emberRouting.Route.extend({ + afterModel: function () { + this.replaceWith('b', 'zomg'); + } + })); + + App.register('route:b', _emberRouting.Route.extend({ + afterModel: function (params) { + this.transitionTo('c', params.b); + } + })); + + App.register('route:c', _emberRouting.Route.extend({ + afterModel: function (params) { + throw new Error('transition failure'); + } + })); + }); + + expectAsyncError(); + + return _emberMetal.run(App, 'visit', '/a').then(function () { + assert.ok(false, 'It should not resolve the promise'); + }, function (error) { + assert.ok(error instanceof Error, 'It should reject the promise with the boot error'); + assert.equal(error.message, 'transition failure'); + }); + }); + + QUnit.test('visit() chain', function (assert) { + _emberMetal.run(function () { + createApplication(); + + App.Router.map(function () { + this.route('a'); + this.route('b'); + this.route('c'); + }); + }); + + return _emberMetal.run(App, 'visit', '/').then(function (instance) { + assert.ok(instance instanceof _emberApplicationSystemApplicationInstance.default, 'promise is resolved with an ApplicationInstance'); + assert.equal(instance.getURL(), '/'); + + return instance.visit('/a'); + }).then(function (instance) { + assert.ok(instance instanceof _emberApplicationSystemApplicationInstance.default, 'promise is resolved with an ApplicationInstance'); + assert.equal(instance.getURL(), '/a'); + + return instance.visit('/b'); + }).then(function (instance) { + assert.ok(instance instanceof _emberApplicationSystemApplicationInstance.default, 'promise is resolved with an ApplicationInstance'); + assert.equal(instance.getURL(), '/b'); + + return instance.visit('/c'); + }).then(function (instance) { + assert.ok(instance instanceof _emberApplicationSystemApplicationInstance.default, 'promise is resolved with an ApplicationInstance'); + assert.equal(instance.getURL(), '/c'); + }); + }); + + QUnit.test('visit() returns a promise that resolves when the view has rendered', function (assert) { + _emberMetal.run(function () { + createApplication(); + + App.register('template:application', _emberTemplateCompiler.compile('

Hello world

')); + }); + + assert.strictEqual(_emberViews.jQuery('#qunit-fixture').children().length, 0, 'there are no elements in the fixture element'); + + return _emberMetal.run(App, 'visit', '/').then(function (instance) { + assert.ok(instance instanceof _emberApplicationSystemApplicationInstance.default, 'promise is resolved with an ApplicationInstance'); + assert.equal(_emberViews.jQuery('#qunit-fixture > .ember-view h1').text(), 'Hello world', 'the application was rendered once the promise resolves'); + }); + }); + + QUnit.test('visit() returns a promise that resolves without rendering when shouldRender is set to false', function (assert) { + assert.expect(3); + + _emberMetal.run(function () { + createApplication(); + + App.register('template:application', _emberTemplateCompiler.compile('

Hello world

')); + }); + + assert.strictEqual(_emberViews.jQuery('#qunit-fixture').children().length, 0, 'there are no elements in the fixture element'); + + return _emberMetal.run(App, 'visit', '/', { shouldRender: false }).then(function (instance) { + assert.ok(instance instanceof _emberApplicationSystemApplicationInstance.default, 'promise is resolved with an ApplicationInstance'); + assert.strictEqual(_emberViews.jQuery('#qunit-fixture').children().length, 0, 'there are still no elements in the fixture element after visit'); + }); + }); + + QUnit.test('visit() renders a template when shouldRender is set to true', function (assert) { + assert.expect(3); + + _emberMetal.run(function () { + createApplication(); + + App.register('template:application', _emberTemplateCompiler.compile('

Hello world

')); + }); + + assert.strictEqual(_emberViews.jQuery('#qunit-fixture').children().length, 0, 'there are no elements in the fixture element'); + + return _emberMetal.run(App, 'visit', '/', { shouldRender: true }).then(function (instance) { + assert.ok(instance instanceof _emberApplicationSystemApplicationInstance.default, 'promise is resolved with an ApplicationInstance'); + assert.strictEqual(_emberViews.jQuery('#qunit-fixture').children().length, 1, 'there is 1 element in the fixture element after visit'); + }); + }); + + QUnit.test('visit() returns a promise that resolves without rendering when shouldRender is set to false with Engines', function (assert) { + assert.expect(3); + + _emberMetal.run(function () { + createApplication(); + + App.register('template:application', _emberTemplateCompiler.compile('

Hello world

')); + + // Register engine + var BlogEngine = _emberApplicationSystemEngine.default.extend(); + App.register('engine:blog', BlogEngine); + + // Register engine route map + var BlogMap = function () {}; + App.register('route-map:blog', BlogMap); + + App.Router.map(function () { + this.mount('blog'); + }); + }); + + assert.strictEqual(_emberViews.jQuery('#qunit-fixture').children().length, 0, 'there are no elements in the fixture element'); + + return _emberMetal.run(App, 'visit', '/blog', { shouldRender: false }).then(function (instance) { + assert.ok(instance instanceof _emberApplicationSystemApplicationInstance.default, 'promise is resolved with an ApplicationInstance'); + assert.strictEqual(_emberViews.jQuery('#qunit-fixture').children().length, 0, 'there are still no elements in the fixture element after visit'); + }); + }); + + QUnit.test('visit() on engine resolves engine component', function (assert) { + assert.expect(2); + + _emberMetal.run(function () { + createApplication(); + + // Register engine + var BlogEngine = _emberApplicationSystemEngine.default.extend({ + init: function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + this._super.apply(this, args); + this.register('template:application', _emberTemplateCompiler.compile('{{cache-money}}')); + this.register('template:components/cache-money', _emberTemplateCompiler.compile('\n

Dis cache money

\n ')); + this.register('component:cache-money', _emberGlimmer.Component.extend({})); + } + }); + App.register('engine:blog', BlogEngine); + + // Register engine route map + var BlogMap = function () {}; + App.register('route-map:blog', BlogMap); + + App.Router.map(function () { + this.mount('blog'); + }); + }); + + assert.strictEqual(_emberViews.jQuery('#qunit-fixture').children().length, 0, 'there are no elements in the fixture element'); + + return _emberMetal.run(App, 'visit', '/blog', { shouldRender: true }).then(function (instance) { + assert.strictEqual(_emberViews.jQuery('#qunit-fixture').find('p').text(), 'Dis cache money', 'Engine component is resolved'); + }); + }); + + QUnit.test('visit() on engine resolves engine helper', function (assert) { + assert.expect(2); + + _emberMetal.run(function () { + createApplication(); + + // Register engine + var BlogEngine = _emberApplicationSystemEngine.default.extend({ + init: function () { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + this._super.apply(this, args); + this.register('template:application', _emberTemplateCompiler.compile('{{swag}}')); + this.register('helper:swag', _emberGlimmer.helper(function () { + return 'turnt up'; + })); + } + }); + App.register('engine:blog', BlogEngine); + + // Register engine route map + var BlogMap = function () {}; + App.register('route-map:blog', BlogMap); + + App.Router.map(function () { + this.mount('blog'); + }); + }); + + assert.strictEqual(_emberViews.jQuery('#qunit-fixture').children().length, 0, 'there are no elements in the fixture element'); + + return _emberMetal.run(App, 'visit', '/blog', { shouldRender: true }).then(function (instance) { + assert.strictEqual(_emberViews.jQuery('#qunit-fixture').text(), 'turnt up', 'Engine component is resolved'); + }); + }); + + QUnit.module('Ember.Application - visit() Integration Tests', { + teardown: function () { + if (instances) { + _emberMetal.run(instances, 'forEach', function (i) { + return i.destroy(); + }); + instances = []; + } + + if (App) { + _emberMetal.run(App, 'destroy'); + App = null; + } + } + }); + + QUnit.test('Ember Islands-style setup', function (assert) { + var xFooInitCalled = false; + var xFooDidInsertElementCalled = false; + + var xBarInitCalled = false; + var xBarDidInsertElementCalled = false; + + _emberMetal.run(function () { + createApplication(true); + + App.Router.map(function () { + this.route('show', { path: '/:component_name' }); + }); + + App.register('route:show', _emberRouting.Route.extend({ + queryParams: { + data: { refreshModel: true } + }, + + model: function (params) { + return { + componentName: params.component_name, + componentData: params.data ? JSON.parse(params.data) : undefined + }; + } + })); + + var Counter = _emberRuntime.Object.extend({ + value: 0, + + increment: function () { + this.incrementProperty('value'); + } + }); + + App.register('service:isolated-counter', Counter); + App.register('service:shared-counter', Counter.create(), { instantiate: false }); + + App.register('template:show', _emberTemplateCompiler.compile('{{component model.componentName model=model.componentData}}')); + + App.register('template:components/x-foo', _emberTemplateCompiler.compile('\n

X-Foo

\n

Hello {{model.name}}, I have been clicked {{isolatedCounter.value}} times ({{sharedCounter.value}} times combined)!

\n ')); + + App.register('component:x-foo', _emberGlimmer.Component.extend({ + tagName: 'x-foo', + + isolatedCounter: _emberRuntime.inject.service(), + sharedCounter: _emberRuntime.inject.service(), + + init: function () { + this._super(); + xFooInitCalled = true; + }, + + didInsertElement: function () { + xFooDidInsertElementCalled = true; + }, + + click: function () { + this.get('isolatedCounter').increment(); + this.get('sharedCounter').increment(); + } + })); + + App.register('template:components/x-bar', _emberTemplateCompiler.compile('\n

X-Bar

\n \n ')); + + App.register('component:x-bar', _emberGlimmer.Component.extend({ + counter: _emberRuntime.inject.service('shared-counter'), + + actions: { + incrementCounter: function () { + this.get('counter').increment(); + } + }, + + init: function () { + this._super(); + xBarInitCalled = true; + }, + + didInsertElement: function () { + xBarDidInsertElementCalled = true; + } + })); + }); + + var $foo = _emberViews.jQuery('
').appendTo('#qunit-fixture'); + var $bar = _emberViews.jQuery('
').appendTo('#qunit-fixture'); + + var data = encodeURIComponent(JSON.stringify({ name: 'Godfrey' })); + + return _emberRuntime.RSVP.all([_emberMetal.run(App, 'visit', '/x-foo?data=' + data, { rootElement: $foo[0] }), _emberMetal.run(App, 'visit', '/x-bar', { rootElement: $bar[0] })]).then(function () { + assert.ok(xFooInitCalled); + assert.ok(xFooDidInsertElementCalled); + + assert.ok(xBarInitCalled); + assert.ok(xBarDidInsertElementCalled); + + assert.equal($foo.find('h1').text(), 'X-Foo'); + assert.equal($foo.find('p').text(), 'Hello Godfrey, I have been clicked 0 times (0 times combined)!'); + assert.ok($foo.text().indexOf('X-Bar') === -1); + + assert.equal($bar.find('h1').text(), 'X-Bar'); + assert.equal($bar.find('button').text(), 'Join 0 others in clicking me!'); + assert.ok($bar.text().indexOf('X-Foo') === -1); + + _emberMetal.run(function () { + return $foo.find('x-foo').click(); + }); + + assert.equal($foo.find('p').text(), 'Hello Godfrey, I have been clicked 1 times (1 times combined)!'); + assert.equal($bar.find('button').text(), 'Join 1 others in clicking me!'); + + _emberMetal.run(function () { + $bar.find('button').click(); + $bar.find('button').click(); + }); + + assert.equal($foo.find('p').text(), 'Hello Godfrey, I have been clicked 1 times (3 times combined)!'); + assert.equal($bar.find('button').text(), 'Join 3 others in clicking me!'); + }); + }); + + QUnit.skip('Test setup', function (assert) {}); + + QUnit.skip('iframe setup', function (assert) {}); +}); +enifed('ember-application/tests/system/visit_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/visit_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/visit_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/visit_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/visit_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/visit_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/test-helpers/registry-check', ['exports'], function (exports) { + 'use strict'; + + exports.verifyRegistration = verifyRegistration; + exports.verifyInjection = verifyInjection; + + function verifyRegistration(owner, fullName) { + ok(owner.resolveRegistration(fullName), 'has registration: ' + fullName); + } + + function verifyInjection(owner, fullName, property, injectionName) { + var registry = owner.__registry__; + var injections = undefined; + + if (fullName.indexOf(':') === -1) { + injections = registry.getTypeInjections(fullName); + } else { + injections = registry.getInjections(registry.normalize(fullName)); + } + + var normalizedName = registry.normalize(injectionName); + var hasInjection = false; + var injection = undefined; + + for (var i = 0, l = injections.length; i < l; i++) { + injection = injections[i]; + if (injection.property === property && injection.fullName === normalizedName) { + hasInjection = true; + break; + } + } + + ok(hasInjection, 'has injection: ' + fullName + '.' + property + ' = ' + injectionName); + } +}); +enifed('ember-application/tests/test-helpers/registry-check.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/test-helpers'); + test('ember-application/tests/test-helpers/registry-check.js should pass jscs', function () { + ok(true, 'ember-application/tests/test-helpers/registry-check.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/test-helpers/registry-check.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/test-helpers'); + QUnit.test('ember-application/tests/test-helpers/registry-check.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/test-helpers/registry-check.js should pass jshint.'); + }); +}); +enifed('ember-application/utils/validate-type.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/utils'); + test('ember-application/utils/validate-type.js should pass jscs', function () { + ok(true, 'ember-application/utils/validate-type.js should pass jscs.'); + }); +}); +enifed('ember-application/utils/validate-type.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/utils'); + QUnit.test('ember-application/utils/validate-type.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/utils/validate-type.js should pass jshint.'); + }); +}); +enifed('ember-debug/deprecate.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-debug'); + test('ember-debug/deprecate.js should pass jscs', function () { + ok(true, 'ember-debug/deprecate.js should pass jscs.'); + }); +}); +enifed('ember-debug/deprecate.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-debug'); + QUnit.test('ember-debug/deprecate.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-debug/deprecate.js should pass jshint.'); + }); +}); +enifed('ember-debug/handlers.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-debug'); + test('ember-debug/handlers.js should pass jscs', function () { + ok(true, 'ember-debug/handlers.js should pass jscs.'); + }); +}); +enifed('ember-debug/handlers.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-debug'); + QUnit.test('ember-debug/handlers.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-debug/handlers.js should pass jshint.'); + }); +}); +enifed('ember-debug/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-debug'); + test('ember-debug/index.js should pass jscs', function () { + ok(true, 'ember-debug/index.js should pass jscs.'); + }); +}); +enifed('ember-debug/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-debug'); + QUnit.test('ember-debug/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-debug/index.js should pass jshint.'); + }); +}); +enifed('ember-debug/tests/handlers-test', ['exports', 'ember-debug/handlers'], function (exports, _emberDebugHandlers) { + 'use strict'; + + QUnit.module('ember-debug/handlers', { + teardown: function () { + delete _emberDebugHandlers.HANDLERS.blarz; + } + }); + + QUnit.test('calls handler on `invoke` when `falsey`', function (assert) { + assert.expect(2); + + function handler(message) { + assert.ok(true, 'called handler'); + assert.equal(message, 'Foo bar'); + } + + _emberDebugHandlers.registerHandler('blarz', handler); + + _emberDebugHandlers.invoke('blarz', 'Foo bar', false); + }); + + QUnit.test('does not call handler on `invoke` when `truthy`', function (assert) { + assert.expect(0); + + function handler() { + assert.ok(false, 'called handler'); + } + + _emberDebugHandlers.registerHandler('blarz', handler); + + _emberDebugHandlers.invoke('blarz', 'Foo bar', true); + }); + + QUnit.test('calling `invoke` without handlers does not throw an error', function (assert) { + assert.expect(0); + + _emberDebugHandlers.invoke('blarz', 'Foo bar', false); + }); + + QUnit.test('invoking `next` argument calls the next handler', function (assert) { + assert.expect(2); + + function handler1(message, options, next) { + assert.ok(true, 'called handler1'); + } + + function handler2(message, options, next) { + assert.ok(true, 'called handler2'); + next(message, options); + } + + _emberDebugHandlers.registerHandler('blarz', handler1); + _emberDebugHandlers.registerHandler('blarz', handler2); + + _emberDebugHandlers.invoke('blarz', 'Foo', false); + }); + + QUnit.test('invoking `next` when no other handlers exists does not error', function (assert) { + assert.expect(1); + + function handler(message, options, next) { + assert.ok(true, 'called handler1'); + + next(message, options); + } + + _emberDebugHandlers.registerHandler('blarz', handler); + + _emberDebugHandlers.invoke('blarz', 'Foo', false); + }); + + QUnit.test('handlers are called in the proper order', function (assert) { + assert.expect(11); + + var expectedMessage = 'This is the message'; + var expectedOptions = { id: 'foo-bar' }; + var expected = ['first', 'second', 'third', 'fourth', 'fifth']; + var actualCalls = []; + + function generateHandler(item) { + return function (message, options, next) { + assert.equal(message, expectedMessage, 'message supplied to ' + item + ' handler is correct'); + assert.equal(options, expectedOptions, 'options supplied to ' + item + ' handler is correct'); + + actualCalls.push(item); + + next(message, options); + }; + } + + expected.forEach(function (item) { + return _emberDebugHandlers.registerHandler('blarz', generateHandler(item)); + }); + + _emberDebugHandlers.invoke('blarz', expectedMessage, false, expectedOptions); + + assert.deepEqual(actualCalls, expected.reverse(), 'handlers were called in proper order'); + }); + + QUnit.test('not invoking `next` prevents further handlers from being called', function (assert) { + assert.expect(1); + + function handler1(message, options, next) { + assert.ok(false, 'called handler1'); + } + + function handler2(message, options, next) { + assert.ok(true, 'called handler2'); + } + + _emberDebugHandlers.registerHandler('blarz', handler1); + _emberDebugHandlers.registerHandler('blarz', handler2); + + _emberDebugHandlers.invoke('blarz', 'Foo', false); + }); + + QUnit.test('handlers can call `next` with custom message and/or options', function (assert) { + assert.expect(4); + + var initialMessage = 'initial message'; + var initialOptions = { id: 'initial-options' }; + + var handler2Message = 'Handler2 Message'; + var handler2Options = { id: 'handler-2' }; + + function handler1(message, options, next) { + assert.equal(message, handler2Message, 'handler2 message provided to handler1'); + assert.equal(options, handler2Options, 'handler2 options provided to handler1'); + } + + function handler2(message, options, next) { + assert.equal(message, initialMessage, 'initial message provided to handler2'); + assert.equal(options, initialOptions, 'initial options proivided to handler2'); + + next(handler2Message, handler2Options); + } + + _emberDebugHandlers.registerHandler('blarz', handler1); + _emberDebugHandlers.registerHandler('blarz', handler2); + + _emberDebugHandlers.invoke('blarz', initialMessage, false, initialOptions); + }); +}); +enifed('ember-debug/tests/handlers-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-debug/tests'); + test('ember-debug/tests/handlers-test.js should pass jscs', function () { + ok(true, 'ember-debug/tests/handlers-test.js should pass jscs.'); + }); +}); +enifed('ember-debug/tests/handlers-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-debug/tests'); + QUnit.test('ember-debug/tests/handlers-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-debug/tests/handlers-test.js should pass jshint.'); + }); +}); +enifed('ember-debug/tests/main_test', ['exports', 'ember-environment', 'ember-runtime', 'ember-debug/handlers', 'ember-debug/deprecate', 'ember-debug/warn', 'ember-metal'], function (exports, _emberEnvironment, _emberRuntime, _emberDebugHandlers, _emberDebugDeprecate, _emberDebugWarn, _emberMetal) { + 'use strict'; + + var originalEnvValue = undefined; + var originalDeprecateHandler = undefined; + + QUnit.module('ember-debug', { + setup: function () { + originalEnvValue = _emberEnvironment.ENV.RAISE_ON_DEPRECATION; + originalDeprecateHandler = _emberDebugHandlers.HANDLERS.deprecate; + + _emberEnvironment.ENV.RAISE_ON_DEPRECATION = true; + }, + + teardown: function () { + _emberDebugHandlers.HANDLERS.deprecate = originalDeprecateHandler; + + _emberEnvironment.ENV.RAISE_ON_DEPRECATION = originalEnvValue; + } + }); + + QUnit.test('Ember.deprecate does not throw if RAISE_ON_DEPRECATION is false', function (assert) { + assert.expect(1); + + _emberEnvironment.ENV.RAISE_ON_DEPRECATION = false; + + try { + _emberMetal.deprecate('Should not throw', false, { id: 'test', until: 'forever' }); + assert.ok(true, 'Ember.deprecate did not throw'); + } catch (e) { + assert.ok(false, 'Expected deprecate not to throw but it did: ' + e.message); + } + }); + + QUnit.test('Ember.deprecate resets deprecation level to RAISE if ENV.RAISE_ON_DEPRECATION is set', function (assert) { + assert.expect(2); + + _emberEnvironment.ENV.RAISE_ON_DEPRECATION = false; + + try { + _emberMetal.deprecate('Should not throw', false, { id: 'test', until: 'forever' }); + assert.ok(true, 'Ember.deprecate did not throw'); + } catch (e) { + assert.ok(false, 'Expected deprecate not to throw but it did: ' + e.message); + } + + _emberEnvironment.ENV.RAISE_ON_DEPRECATION = true; + + assert.throws(function () { + _emberMetal.deprecate('Should throw', false, { id: 'test', until: 'forever' }); + }, /Should throw/); + }); + + QUnit.test('When ENV.RAISE_ON_DEPRECATION is true, it is still possible to silence a deprecation by id', function (assert) { + assert.expect(3); + + _emberEnvironment.ENV.RAISE_ON_DEPRECATION = true; + _emberDebugDeprecate.registerHandler(function (message, options, next) { + if (!options || options.id !== 'my-deprecation') { + next.apply(undefined, arguments); + } + }); + + try { + _emberMetal.deprecate('should be silenced with matching id', false, { id: 'my-deprecation', until: 'forever' }); + assert.ok(true, 'Did not throw when level is set by id'); + } catch (e) { + assert.ok(false, 'Expected deprecate not to throw but it did: ' + e.message); + } + + assert.throws(function () { + _emberMetal.deprecate('Should throw with no matching id', false, { id: 'test', until: 'forever' }); + }, /Should throw with no matching id/); + + assert.throws(function () { + _emberMetal.deprecate('Should throw with non-matching id', false, { id: 'other-id', until: 'forever' }); + }, /Should throw with non-matching id/); + }); + + QUnit.test('Ember.deprecate throws deprecation if second argument is falsy', function () { + expect(3); + + throws(function () { + return _emberMetal.deprecate('Deprecation is thrown', false, { id: 'test', until: 'forever' }); + }); + throws(function () { + return _emberMetal.deprecate('Deprecation is thrown', '', { id: 'test', until: 'forever' }); + }); + throws(function () { + return _emberMetal.deprecate('Deprecation is thrown', 0, { id: 'test', until: 'forever' }); + }); + }); + + QUnit.test('Ember.deprecate does not invoke a function as the second argument', function () { + expect(1); + + _emberMetal.deprecate('Deprecation is thrown', function () { + ok(false, 'this function should not be invoked'); + }, { id: 'test', until: 'forever' }); + + ok(true, 'deprecations were not thrown'); + }); + + QUnit.test('Ember.deprecate does not throw deprecations if second argument is truthy', function () { + expect(1); + + _emberMetal.deprecate('Deprecation is thrown', true, { id: 'test', until: 'forever' }); + _emberMetal.deprecate('Deprecation is thrown', '1', { id: 'test', until: 'forever' }); + _emberMetal.deprecate('Deprecation is thrown', 1, { id: 'test', until: 'forever' }); + + ok(true, 'deprecations were not thrown'); + }); + + QUnit.test('Ember.assert throws if second argument is falsy', function () { + expect(3); + + throws(function () { + return _emberMetal.assert('Assertion is thrown', false); + }); + throws(function () { + return _emberMetal.assert('Assertion is thrown', ''); + }); + throws(function () { + return _emberMetal.assert('Assertion is thrown', 0); + }); + }); + + QUnit.test('Ember.assert does not throw if second argument is a function', function (assert) { + assert.expect(1); + + _emberMetal.assert('Assertion is thrown', function () { + return true; + }); + + ok(true, 'assertions were not thrown'); + }); + + QUnit.test('Ember.assert does not throw if second argument is truthy', function () { + expect(1); + + _emberMetal.assert('Assertion is thrown', true); + _emberMetal.assert('Assertion is thrown', '1'); + _emberMetal.assert('Assertion is thrown', 1); + + ok(true, 'assertions were not thrown'); + }); + + QUnit.test('Ember.assert does not throw if second argument is an object', function () { + expect(1); + var Igor = _emberRuntime.Object.extend(); + + _emberMetal.assert('is truthy', Igor); + _emberMetal.assert('is truthy', Igor.create()); + + ok(true, 'assertions were not thrown'); + }); + + QUnit.test('Ember.deprecate does not throw a deprecation at log and silence levels', function () { + expect(4); + var id = 'ABC'; + var until = 'forever'; + var shouldThrow = false; + + _emberDebugDeprecate.registerHandler(function (message, options, next) { + if (options && options.id === id) { + if (shouldThrow) { + throw new Error(message); + } + } + }); + + try { + _emberMetal.deprecate('Deprecation for testing purposes', false, { id: id, until: until }); + ok(true, 'Deprecation did not throw'); + } catch (e) { + ok(false, 'Deprecation was thrown despite being added to blacklist'); + } + + try { + _emberMetal.deprecate('Deprecation for testing purposes', false, { id: id, until: until }); + ok(true, 'Deprecation did not throw'); + } catch (e) { + ok(false, 'Deprecation was thrown despite being added to blacklist'); + } + + shouldThrow = true; + + throws(function () { + _emberMetal.deprecate('Deprecation is thrown', false, { id: id, until: until }); + }); + + throws(function () { + _emberMetal.deprecate('Deprecation is thrown', false, { id: id, until: until }); + }); + }); + + QUnit.test('Ember.deprecate without options triggers a deprecation', function (assert) { + assert.expect(4); + + _emberDebugDeprecate.registerHandler(function (message) { + if (message === _emberDebugDeprecate.missingOptionsDeprecation) { + assert.ok(true, 'proper deprecation is triggered when options is missing'); + } else if (message === 'foo') { + assert.ok(true, 'original deprecation is still triggered'); + } + }); + + _emberMetal.deprecate('foo'); + _emberMetal.deprecate('foo', false, {}); + }); + + QUnit.test('Ember.deprecate without options.id triggers a deprecation', function (assert) { + assert.expect(2); + + _emberDebugDeprecate.registerHandler(function (message) { + if (message === _emberDebugDeprecate.missingOptionsIdDeprecation) { + assert.ok(true, 'proper deprecation is triggered when options.id is missing'); + } else if (message === 'foo') { + assert.ok(true, 'original deprecation is still triggered'); + } + }); + + _emberMetal.deprecate('foo', false, { until: 'forever' }); + }); + + QUnit.test('Ember.deprecate without options.until triggers a deprecation', function (assert) { + assert.expect(2); + + _emberDebugDeprecate.registerHandler(function (message) { + if (message === _emberDebugDeprecate.missingOptionsUntilDeprecation) { + assert.ok(true, 'proper deprecation is triggered when options.until is missing'); + } else if (message === 'foo') { + assert.ok(true, 'original deprecation is still triggered'); + } + }); + + _emberMetal.deprecate('foo', false, { id: 'test' }); + }); + + QUnit.test('warn without options triggers a deprecation', function (assert) { + assert.expect(2); + + _emberDebugDeprecate.registerHandler(function (message) { + assert.equal(message, _emberDebugWarn.missingOptionsDeprecation, 'deprecation is triggered when options is missing'); + }); + + _emberDebugWarn.registerHandler(function (message) { + assert.equal(message, 'foo', 'original warning is triggered'); + }); + + _emberMetal.warn('foo'); + }); + + QUnit.test('warn without options.id triggers a deprecation', function (assert) { + assert.expect(2); + + _emberDebugDeprecate.registerHandler(function (message) { + assert.equal(message, _emberDebugWarn.missingOptionsIdDeprecation, 'deprecation is triggered when options is missing'); + }); + + _emberDebugWarn.registerHandler(function (message) { + assert.equal(message, 'foo', 'original warning is triggered'); + }); + + _emberMetal.warn('foo', false, {}); + }); +}); +enifed('ember-debug/tests/main_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-debug/tests'); + test('ember-debug/tests/main_test.js should pass jscs', function () { + ok(true, 'ember-debug/tests/main_test.js should pass jscs.'); + }); +}); +enifed('ember-debug/tests/main_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-debug/tests'); + QUnit.test('ember-debug/tests/main_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-debug/tests/main_test.js should pass jshint.'); + }); +}); +enifed('ember-debug/tests/warn_if_using_stripped_feature_flags_test', ['exports', 'ember-environment', 'ember-metal', 'ember-debug/index'], function (exports, _emberEnvironment, _emberMetal, _emberDebugIndex) { + 'use strict'; + + var oldWarn = undefined, + oldRunInDebug = undefined, + origEnvFeatures = undefined, + origEnableOptional = undefined, + features = undefined, + knownFeatures = undefined; + + function confirmWarns(expectedMsg) { + var featuresWereStripped = true; + + _emberMetal.setDebugFunction('warn', function (msg, test) { + if (!test) { + equal(msg, expectedMsg); + } + }); + + _emberMetal.setDebugFunction('runInDebug', function (func) { + func(); + }); + + // Should trigger our 1 warning + _emberDebugIndex._warnIfUsingStrippedFeatureFlags(features, knownFeatures, featuresWereStripped); + + // Shouldn't trigger any warnings now that we're "in canary" + featuresWereStripped = false; + _emberDebugIndex._warnIfUsingStrippedFeatureFlags(features, knownFeatures, featuresWereStripped); + } + + QUnit.module('ember-debug - _warnIfUsingStrippedFeatureFlags', { + setup: function () { + oldWarn = _emberMetal.getDebugFunction('warn'); + oldRunInDebug = _emberMetal.getDebugFunction('runInDebug'); + origEnvFeatures = _emberEnvironment.ENV.FEATURES; + origEnableOptional = _emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES; + + knownFeatures = { + 'fred': null, + 'barney': null, + 'wilma': null + }; + }, + + teardown: function () { + _emberMetal.setDebugFunction('warn', oldWarn); + _emberMetal.setDebugFunction('runInDebug', oldRunInDebug); + _emberEnvironment.ENV.FEATURES = origEnvFeatures; + _emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES = origEnableOptional; + } + }); + + QUnit.test('Setting Ember.ENV.ENABLE_OPTIONAL_FEATURES truthy in non-canary, debug build causes a warning', function () { + expect(1); + + _emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES = true; + features = {}; + + confirmWarns('Ember.ENV.ENABLE_OPTIONAL_FEATURES is only available in canary builds.'); + }); + + QUnit.test('Enabling a known FEATURE flag in non-canary, debug build causes a warning', function () { + expect(1); + + _emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES = false; + features = { + 'fred': true, + 'barney': false, + 'wilma': null + }; + + confirmWarns('FEATURE["fred"] is set as enabled, but FEATURE flags are only available in canary builds.'); + }); + + QUnit.test('Enabling an unknown FEATURE flag in non-canary debug build does not cause a warning', function () { + expect(0); + + _emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES = false; + features = { + 'some-ember-data-feature-flag': true + }; + + confirmWarns('FEATURE["fred"] is set as enabled, but FEATURE flags are only available in canary builds.'); + }); + + QUnit.test('`ENV.FEATURES` being undefined does not cause an error', function () { + expect(0); + + _emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES = false; + features = undefined; + + confirmWarns(); + }); +}); +enifed('ember-debug/tests/warn_if_using_stripped_feature_flags_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-debug/tests'); + test('ember-debug/tests/warn_if_using_stripped_feature_flags_test.js should pass jscs', function () { + ok(true, 'ember-debug/tests/warn_if_using_stripped_feature_flags_test.js should pass jscs.'); + }); +}); +enifed('ember-debug/tests/warn_if_using_stripped_feature_flags_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-debug/tests'); + QUnit.test('ember-debug/tests/warn_if_using_stripped_feature_flags_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-debug/tests/warn_if_using_stripped_feature_flags_test.js should pass jshint.'); + }); +}); +enifed('ember-debug/warn.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-debug'); + test('ember-debug/warn.js should pass jscs', function () { + ok(true, 'ember-debug/warn.js should pass jscs.'); + }); +}); +enifed('ember-debug/warn.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-debug'); + QUnit.test('ember-debug/warn.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-debug/warn.js should pass jshint.'); + }); +}); +enifed('ember-dev/test-helper/assertion', ['exports', 'ember-dev/test-helper/utils'], function (exports, _emberDevTestHelperUtils) { + /* globals QUnit */ + + 'use strict'; + + exports.default = AssertionAssert; + + var BREAK = {}; + + /** + This assertion class is used to test assertions made using Ember.assert. + It injects two helpers onto `window`: + + - expectAssertion(func: Function, [expectedMessage: String | RegExp]) + + This function calls `func` and asserts that `Ember.assert` is invoked during + the execution. Moreover, it takes a String or a RegExp as a second optional + argument that can be used to test if a specific assertion message was + generated. + + - ignoreAssertion(func: Function) + + This function calls `func` and disables `Ember.assert` during the execution. + In particular, this prevents `Ember.assert` from throw errors that would + disrupt the control flow. + */ + + function AssertionAssert(env) { + this.env = env; + } + + AssertionAssert.prototype = { + reset: function () {}, + assert: function () {}, + + inject: function () { + var _this = this; + + var expectAssertion = function (func, expectedMessage) { + if (_this.env.runningProdBuild) { + QUnit.ok(true, 'Assertions disabled in production builds.'); + return; + } + + var sawCall = undefined; + var actualMessage = undefined; + + // The try-catch statement is used to "exit" `func` as soon as + // the first useful assertion has been produced. + try { + _emberDevTestHelperUtils.callWithStub(_this.env, 'assert', func, function (message, test) { + sawCall = true; + if (_emberDevTestHelperUtils.checkTest(test)) { + return; + } + actualMessage = message; + throw BREAK; + }); + } catch (e) { + if (e !== BREAK) { + throw e; + } + } + + assert(sawCall, actualMessage, expectedMessage); + }; + + var ignoreAssertion = function (func) { + _emberDevTestHelperUtils.callWithStub(_this.env, 'assert', func); + }; + + window.expectAssertion = expectAssertion; + window.ignoreAssertion = ignoreAssertion; + }, + + restore: function () { + window.expectAssertion = null; + window.ignoreAssertion = null; + } + }; + + function assert(sawCall, actualMessage, expectedMessage) { + // Run assertions in an order that is useful when debugging a test failure. + if (!sawCall) { + QUnit.ok(false, 'Expected Ember.assert to be called (Not called with any value).'); + } else if (!actualMessage) { + QUnit.ok(false, 'Expected a failing Ember.assert (Ember.assert called, but without a failing test).'); + } else { + if (expectedMessage) { + if (expectedMessage instanceof RegExp) { + QUnit.ok(expectedMessage.test(actualMessage), 'Expected failing Ember.assert: \'' + expectedMessage + '\', but got \'' + actualMessage + '\'.'); + } else { + QUnit.equal(actualMessage, expectedMessage, 'Expected failing Ember.assert: \'' + expectedMessage + '\', but got \'' + actualMessage + '\'.'); + } + } else { + // Positive assertion that assert was called + QUnit.ok(true, 'Expected a failing Ember.assert.'); + } + } + } +}); +enifed('ember-dev/test-helper/debug', ['exports', 'ember-dev/test-helper/method-call-tracker'], function (exports, _emberDevTestHelperMethodCallTracker) { + 'use strict'; + + var DebugAssert = (function () { + function DebugAssert(methodName, env) { + babelHelpers.classCallCheck(this, DebugAssert); + + this.methodName = methodName; + this.env = env; + } + + DebugAssert.prototype.inject = function inject() {}; + + DebugAssert.prototype.restore = function restore() { + this.reset(); + }; + + DebugAssert.prototype.reset = function reset() { + if (this.tracker) { + this.tracker.restoreMethod(); + } + + this.tracker = null; + }; + + DebugAssert.prototype.assert = function assert() { + if (this.tracker) { + this.tracker.assert(); + } + }; + + // Run an expectation callback within the context of a new tracker, optionally + // accepting a function to run, which asserts immediately + + DebugAssert.prototype.runExpectation = function runExpectation(func, callback) { + var originalTracker = undefined; + + // When helpers are passed a callback, they get a new tracker context + if (func) { + originalTracker = this.tracker; + this.tracker = null; + } + + if (!this.tracker) { + this.tracker = new _emberDevTestHelperMethodCallTracker.default(this.env, this.methodName); + } + + // Yield to caller with tracker instance + callback(this.tracker); + + // Once the given callback is invoked, the pending assertions should be + // flushed immediately + if (func) { + func(); + this.assert(); + this.reset(); + + this.tracker = originalTracker; + } + }; + + return DebugAssert; + })(); + + exports.default = DebugAssert; +}); +enifed('ember-dev/test-helper/deprecation', ['exports', 'ember-dev/test-helper/debug', 'ember-dev/test-helper/utils'], function (exports, _emberDevTestHelperDebug, _emberDevTestHelperUtils) { + 'use strict'; + + var DeprecationAssert = (function (_DebugAssert) { + babelHelpers.inherits(DeprecationAssert, _DebugAssert); + + function DeprecationAssert(env) { + babelHelpers.classCallCheck(this, DeprecationAssert); + + _DebugAssert.call(this, 'deprecate', env); + } + + DeprecationAssert.prototype.inject = function inject() { + var _this = this; + + // Expects no deprecation to happen within a function, or if no function is + // passed, from the time of calling until the end of the test. + // + // expectNoDeprecation(function() { + // fancyNewThing(); + // }); + // + // expectNoDeprecation(); + // Ember.deprecate("Old And Busted"); + // + var expectNoDeprecation = function (func) { + if (typeof func !== 'function') { + func = null; + } + + _this.runExpectation(func, function (tracker) { + if (tracker.isExpectingCalls()) { + throw new Error("expectNoDeprecation was called after expectDeprecation was called!"); + } + + tracker.expectNoCalls(); + }); + }; + + // Expect a deprecation to happen within a function, or if no function + // is pass, from the time of calling until the end of the test. Can be called + // multiple times to assert deprecations with different specific messages + // were fired. + // + // expectDeprecation(function() { + // Ember.deprecate("Old And Busted"); + // }, /* optionalStringOrRegex */); + // + // expectDeprecation(/* optionalStringOrRegex */); + // Ember.deprecate("Old And Busted"); + // + var expectDeprecation = function (func, message) { + if (typeof func !== 'function') { + message = func; + func = null; + } + + _this.runExpectation(func, function (tracker) { + if (tracker.isExpectingNoCalls()) { + throw new Error("expectDeprecation was called after expectNoDeprecation was called!"); + } + + tracker.expectCall(message); + }); + }; + + var ignoreDeprecation = function (func) { + _emberDevTestHelperUtils.callWithStub(_this.env, 'deprecate', func); + }; + + window.expectNoDeprecation = expectNoDeprecation; + window.expectDeprecation = expectDeprecation; + window.ignoreDeprecation = ignoreDeprecation; + }; + + DeprecationAssert.prototype.restore = function restore() { + _DebugAssert.prototype.restore.call(this); + window.expectDeprecation = null; + window.expectNoDeprecation = null; + window.ignoreDeprecation = null; + }; + + return DeprecationAssert; + })(_emberDevTestHelperDebug.default); + + exports.default = DeprecationAssert; +}); +enifed("ember-dev/test-helper/index", ["exports", "ember-dev/test-helper/deprecation", "ember-dev/test-helper/warning", "ember-dev/test-helper/remaining-view", "ember-dev/test-helper/remaining-template", "ember-dev/test-helper/assertion", "ember-dev/test-helper/run-loop", "ember-dev/test-helper/utils"], function (exports, _emberDevTestHelperDeprecation, _emberDevTestHelperWarning, _emberDevTestHelperRemainingView, _emberDevTestHelperRemainingTemplate, _emberDevTestHelperAssertion, _emberDevTestHelperRunLoop, _emberDevTestHelperUtils) { + "use strict"; + + var EmberDevTestHelperAssert = _emberDevTestHelperUtils.buildCompositeAssert([_emberDevTestHelperDeprecation.default, _emberDevTestHelperWarning.default, _emberDevTestHelperRemainingView.default, _emberDevTestHelperRemainingTemplate.default, _emberDevTestHelperAssertion.default, _emberDevTestHelperRunLoop.default]); + + exports.default = EmberDevTestHelperAssert; +}); +enifed('ember-dev/test-helper/method-call-tracker', ['exports', 'ember-dev/test-helper/utils'], function (exports, _emberDevTestHelperUtils) { + /* globals QUnit */ + + 'use strict'; + + var MethodCallTracker = function (env, methodName) { + this._env = env; + this._methodName = methodName; + this._isExpectingNoCalls = false; + this._expecteds = []; + this._actuals = []; + }; + + MethodCallTracker.prototype = { + stubMethod: function () { + var _this = this; + + if (this._originalMethod) { + // Method is already stubbed + return; + } + + var env = this._env; + var methodName = this._methodName; + + this._originalMethod = env.getDebugFunction(methodName); + + env.setDebugFunction(methodName, function (message, test) { + var resultOfTest = _emberDevTestHelperUtils.checkTest(test); + + _this._actuals.push([message, resultOfTest]); + }); + }, + + restoreMethod: function () { + if (this._originalMethod) { + this._env.setDebugFunction(this._methodName, this._originalMethod); + } + }, + + expectCall: function (message) { + this.stubMethod(); + this._expecteds.push(message || /.*/); + }, + + expectNoCalls: function () { + this.stubMethod(); + this._isExpectingNoCalls = true; + }, + + isExpectingNoCalls: function () { + return this._isExpectingNoCalls; + }, + + isExpectingCalls: function () { + return !this._isExpectingNoCalls && this._expecteds.length; + }, + + assert: function () { + var env = this._env; + var methodName = this._methodName; + var isExpectingNoCalls = this._isExpectingNoCalls; + var expecteds = this._expecteds; + var actuals = this._actuals; + var o = undefined, + i = undefined; + + if (!isExpectingNoCalls && expecteds.length === 0 && actuals.length === 0) { + return; + } + + if (env.runningProdBuild) { + QUnit.ok(true, 'calls to Ember.' + methodName + ' disabled in production builds.'); + return; + } + + if (isExpectingNoCalls) { + var actualMessages = []; + for (i = 0; i < actuals.length; i++) { + if (!actuals[i][1]) { + actualMessages.push(actuals[i][0]); + } + } + QUnit.ok(actualMessages.length === 0, 'Expected no Ember.' + methodName + ' calls, got ' + actuals.length + ': ' + actualMessages.join(', ')); + return; + } + + var expected = undefined, + actual = undefined, + match = undefined; + + for (o = 0; o < expecteds.length; o++) { + expected = expecteds[o]; + for (i = 0; i < actuals.length; i++) { + actual = actuals[i]; + if (!actual[1]) { + if (expected instanceof RegExp) { + if (expected.test(actual[0])) { + match = actual; + break; + } + } else { + if (expected === actual[0]) { + match = actual; + break; + } + } + } + } + + if (!actual) { + QUnit.ok(false, 'Recieved no Ember.' + methodName + ' calls at all, expecting: ' + expected); + } else if (match && !match[1]) { + QUnit.ok(true, 'Recieved failing Ember.' + methodName + ' call with message: ' + match[0]); + } else if (match && match[1]) { + QUnit.ok(false, 'Expected failing Ember.' + methodName + ' call, got succeeding with message: ' + match[0]); + } else if (actual[1]) { + QUnit.ok(false, 'Did not receive failing Ember.' + methodName + ' call matching \'' + expected + '\', last was success with \'' + actual[0] + '\''); + } else if (!actual[1]) { + QUnit.ok(false, 'Did not receive failing Ember.' + methodName + ' call matching \'' + expected + '\', last was failure with \'' + actual[0] + '\''); + } + } + } + }; + + exports.default = MethodCallTracker; +}); +enifed("ember-dev/test-helper/remaining-template", ["exports"], function (exports) { + /* globals QUnit */ + + "use strict"; + + var RemainingTemplateAssert = function (env) { + this.env = env; + }; + + RemainingTemplateAssert.prototype = { + reset: function () {}, + inject: function () {}, + assert: function () { + if (this.env.Ember && this.env.Ember.TEMPLATES) { + var templateNames = [], + name; + for (name in this.env.Ember.TEMPLATES) { + if (this.env.Ember.TEMPLATES[name] != null) { + templateNames.push(name); + } + } + + if (templateNames.length > 0) { + QUnit.deepEqual(templateNames, [], "Ember.TEMPLATES should be empty"); + this.env.Ember.TEMPLATES = {}; + } + } + }, + restore: function () {} + }; + + exports.default = RemainingTemplateAssert; +}); +enifed("ember-dev/test-helper/remaining-view", ["exports"], function (exports) { + /* globals QUnit */ + + "use strict"; + + var RemainingViewAssert = function (env) { + this.env = env; + }; + + RemainingViewAssert.prototype = { + reset: function () {}, + inject: function () {}, + assert: function () { + if (this.env.Ember && this.env.Ember.View) { + var viewIds = [], + id; + for (id in this.env.Ember.View.views) { + if (this.env.Ember.View.views[id] != null) { + viewIds.push(id); + } + } + + if (viewIds.length > 0) { + QUnit.deepEqual(viewIds, [], "Ember.View.views should be empty"); + this.env.Ember.View.views = []; + } + } + }, + restore: function () {} + }; + + exports.default = RemainingViewAssert; +}); +enifed("ember-dev/test-helper/run-loop", ["exports"], function (exports) { + /* globals QUnit */ + + "use strict"; + + function RunLoopAssertion(env) { + this.env = env; + } + + RunLoopAssertion.prototype = { + reset: function () {}, + inject: function () {}, + assert: function () { + var run = this.env.Ember.run; + + if (run.currentRunLoop) { + QUnit.ok(false, "Should not be in a run loop at end of test"); + while (run.currentRunLoop) { + run.end(); + } + } + + if (run.hasScheduledTimers()) { + QUnit.ok(false, "Ember run should not have scheduled timers at end of test"); + run.cancelTimers(); + } + }, + restore: function () {} + }; + + exports.default = RunLoopAssertion; +}); +enifed("ember-dev/test-helper/setup-qunit", ["exports"], function (exports) { + /* globals QUnit */ + + "use strict"; + + exports.default = setupQUnit; + + function setupQUnit(assertion, _qunitGlobal) { + var qunitGlobal = QUnit; + + if (_qunitGlobal) { + qunitGlobal = _qunitGlobal; + } + + var originalModule = qunitGlobal.module; + + qunitGlobal.module = function (name, _options) { + var options = _options || {}; + var originalSetup = options.setup || function () {}; + var originalTeardown = options.teardown || function () {}; + + options.setup = function () { + assertion.reset(); + assertion.inject(); + + originalSetup.call(this); + }; + + options.teardown = function () { + originalTeardown.call(this); + + assertion.assert(); + assertion.restore(); + }; + + return originalModule(name, options); + }; + } +}); +enifed('ember-dev/test-helper/utils', ['exports'], function (exports) { + 'use strict'; + + exports.buildCompositeAssert = buildCompositeAssert; + exports.callWithStub = callWithStub; + exports.checkTest = checkTest; + function callForEach(prop, func) { + return function () { + for (var i = 0, l = this[prop].length; i < l; i++) { + this[prop][i][func](); + } + }; + } + + function buildCompositeAssert(assertClasses) { + function Composite(env) { + this.asserts = assertClasses.map(function (Assert) { + return new Assert(env); + }); + } + + Composite.prototype = { + reset: callForEach('asserts', 'reset'), + inject: callForEach('asserts', 'inject'), + assert: callForEach('asserts', 'assert'), + restore: callForEach('asserts', 'restore') + }; + + return Composite; + } + + function noop() {} + + function callWithStub(env, name, func) { + var debugStub = arguments.length <= 3 || arguments[3] === undefined ? noop : arguments[3]; + + var originalFunc = env.getDebugFunction(name); + try { + env.setDebugFunction(name, debugStub); + func(); + } finally { + env.setDebugFunction(name, originalFunc); + } + } + + function checkTest(test) { + return typeof test === 'function' ? test() : test; + } +}); +enifed('ember-dev/test-helper/warning', ['exports', 'ember-dev/test-helper/debug', 'ember-dev/test-helper/utils'], function (exports, _emberDevTestHelperDebug, _emberDevTestHelperUtils) { + 'use strict'; + + var WarningAssert = (function (_DebugAssert) { + babelHelpers.inherits(WarningAssert, _DebugAssert); + + function WarningAssert(env) { + babelHelpers.classCallCheck(this, WarningAssert); + + _DebugAssert.call(this, 'warn', env); + } + + WarningAssert.prototype.inject = function inject() { + var _this = this; + + // Expects no warning to happen within a function, or if no function is + // passed, from the time of calling until the end of the test. + // + // expectNoWarning(function() { + // fancyNewThing(); + // }); + // + // expectNoWarning(); + // Ember.warn("Oh snap, didn't expect that"); + // + var expectNoWarning = function (func) { + if (typeof func !== 'function') { + func = null; + } + + _this.runExpectation(func, function (tracker) { + if (tracker.isExpectingCalls()) { + throw new Error("expectNoWarning was called after expectWarning was called!"); + } + + tracker.expectNoCalls(); + }); + }; + + // Expect a warning to happen within a function, or if no function is + // passed, from the time of calling until the end of the test. Can be called + // multiple times to assert warnings with different specific messages + // happened. + // + // expectWarning(function() { + // Ember.warn("Times they are a-changin'"); + // }, /* optionalStringOrRegex */); + // + // expectWarning(/* optionalStringOrRegex */); + // Ember.warn("Times definitely be changin'"); + // + var expectWarning = function (fn, message) { + if (typeof fn !== 'function') { + message = fn; + fn = null; + } + + _this.runExpectation(fn, function (tracker) { + if (tracker.isExpectingNoCalls()) { + throw new Error("expectWarning was called after expectNoWarning was called!"); + } + + tracker.expectCall(message); + }); + }; + + var ignoreWarning = function (func) { + _emberDevTestHelperUtils.callWithStub(_this.env, 'warn', func); + }; + + window.expectNoWarning = expectNoWarning; + window.expectWarning = expectWarning; + window.ignoreWarning = ignoreWarning; + }; + + WarningAssert.prototype.restore = function restore() { + _DebugAssert.prototype.restore.call(this); + window.expectWarning = null; + window.expectNoWarning = null; + window.ignoreWarning = null; + }; + + return WarningAssert; + })(_emberDevTestHelperDebug.default); + + exports.default = WarningAssert; +}); +enifed('ember-extension-support/container_debug_adapter.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-extension-support'); + test('ember-extension-support/container_debug_adapter.js should pass jscs', function () { + ok(true, 'ember-extension-support/container_debug_adapter.js should pass jscs.'); + }); +}); +enifed('ember-extension-support/container_debug_adapter.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-extension-support'); + QUnit.test('ember-extension-support/container_debug_adapter.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-extension-support/container_debug_adapter.js should pass jshint.'); + }); +}); +enifed('ember-extension-support/data_adapter.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-extension-support'); + test('ember-extension-support/data_adapter.js should pass jscs', function () { + ok(true, 'ember-extension-support/data_adapter.js should pass jscs.'); + }); +}); +enifed('ember-extension-support/data_adapter.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-extension-support'); + QUnit.test('ember-extension-support/data_adapter.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-extension-support/data_adapter.js should pass jshint.'); + }); +}); +enifed('ember-extension-support/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-extension-support'); + test('ember-extension-support/index.js should pass jscs', function () { + ok(true, 'ember-extension-support/index.js should pass jscs.'); + }); +}); +enifed('ember-extension-support/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-extension-support'); + QUnit.test('ember-extension-support/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-extension-support/index.js should pass jshint.'); + }); +}); +enifed('ember-extension-support/tests/container_debug_adapter_test', ['exports', 'ember-metal', 'ember-runtime', 'ember-extension-support/index', 'ember-application'], function (exports, _emberMetal, _emberRuntime, _emberExtensionSupportIndex, _emberApplication) { + 'use strict'; + + var adapter = undefined, + App = undefined, + appInstance = undefined; + + function boot() { + _emberMetal.run(App, 'advanceReadiness'); + } + + QUnit.module('Container Debug Adapter', { + setup: function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create(); // ES6TODO: this comes from the ember-application package NOT ember-runtime. + App.toString = function () { + return 'App'; + }; + App.deferReadiness(); + }); + boot(); + _emberMetal.run(function () { + appInstance = App.__deprecatedInstance__; + adapter = appInstance.lookup('container-debug-adapter:main'); + }); + }, + teardown: function () { + _emberMetal.run(function () { + adapter.destroy(); + appInstance.destroy(); + App.destroy(); + App = appInstance = adapter = null; + }); + } + }); + + QUnit.test('the default ContainerDebugAdapter cannot catalog certain entries by type', function () { + equal(adapter.canCatalogEntriesByType('model'), false, 'canCatalogEntriesByType should return false for model'); + equal(adapter.canCatalogEntriesByType('template'), false, 'canCatalogEntriesByType should return false for template'); + }); + + QUnit.test('the default ContainerDebugAdapter can catalog typical entries by type', function () { + equal(adapter.canCatalogEntriesByType('controller'), true, 'canCatalogEntriesByType should return true for controller'); + equal(adapter.canCatalogEntriesByType('route'), true, 'canCatalogEntriesByType should return true for route'); + equal(adapter.canCatalogEntriesByType('view'), true, 'canCatalogEntriesByType should return true for view'); + }); + + QUnit.test('the default ContainerDebugAdapter catalogs controller entries', function () { + App.PostController = _emberRuntime.Controller.extend(); + var controllerClasses = adapter.catalogEntriesByType('controller'); + + equal(controllerClasses.length, 1, 'found 1 class'); + equal(controllerClasses[0], 'post', 'found the right class'); + }); +}); +// Must be required to export Ember.ContainerDebugAdapter. +enifed('ember-extension-support/tests/container_debug_adapter_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-extension-support/tests'); + test('ember-extension-support/tests/container_debug_adapter_test.js should pass jscs', function () { + ok(true, 'ember-extension-support/tests/container_debug_adapter_test.js should pass jscs.'); + }); +}); +enifed('ember-extension-support/tests/container_debug_adapter_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-extension-support/tests'); + QUnit.test('ember-extension-support/tests/container_debug_adapter_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-extension-support/tests/container_debug_adapter_test.js should pass jshint.'); + }); +}); +enifed('ember-extension-support/tests/data_adapter_test', ['exports', 'ember-metal', 'ember-runtime', 'ember-extension-support/data_adapter', 'ember-application'], function (exports, _emberMetal, _emberRuntime, _emberExtensionSupportData_adapter, _emberApplication) { + 'use strict'; + + var adapter = undefined, + App = undefined; + var Model = _emberRuntime.Object.extend(); + + var DataAdapter = _emberExtensionSupportData_adapter.default.extend({ + detect: function (klass) { + return klass !== Model && Model.detect(klass); + } + }); + + QUnit.module('Data Adapter', { + setup: function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.toString = function () { + return 'App'; + }; + App.deferReadiness(); + App.register('data-adapter:main', DataAdapter); + }); + }, + teardown: function () { + _emberMetal.run(function () { + adapter.destroy(); + App.destroy(); + }); + } + }); + + QUnit.test('Model types added with DefaultResolver', function () { + App.Post = Model.extend(); + + adapter = App.__container__.lookup('data-adapter:main'); + adapter.reopen({ + getRecords: function () { + return _emberRuntime.A([1, 2, 3]); + }, + columnsForType: function () { + return [{ name: 'title', desc: 'Title' }]; + } + }); + + _emberMetal.run(App, 'advanceReadiness'); + + function modelTypesAdded(types) { + equal(types.length, 1); + var postType = types[0]; + equal(postType.name, 'post', 'Correctly sets the name'); + equal(postType.count, 3, 'Correctly sets the record count'); + strictEqual(postType.object, App.Post, 'Correctly sets the object'); + deepEqual(postType.columns, [{ name: 'title', desc: 'Title' }], 'Correctly sets the columns'); + } + + _emberMetal.run(adapter, 'watchModelTypes', modelTypesAdded); + }); + + QUnit.test('getRecords gets a model name as second argument', function () { + App.Post = Model.extend(); + + adapter = App.__container__.lookup('data-adapter:main'); + adapter.reopen({ + getRecords: function (klass, name) { + equal(name, 'post'); + return _emberRuntime.A(); + } + }); + + adapter.watchModelTypes(function () {}); + }); + + QUnit.test('Model types added with custom container-debug-adapter', function () { + var PostClass = Model.extend(); + var StubContainerDebugAdapter = _emberApplication.Resolver.extend({ + canCatalogEntriesByType: function (type) { + return true; + }, + catalogEntriesByType: function (type) { + return [PostClass]; + } + }); + App.register('container-debug-adapter:main', StubContainerDebugAdapter); + + adapter = App.__container__.lookup('data-adapter:main'); + adapter.reopen({ + getRecords: function () { + return _emberRuntime.A([1, 2, 3]); + }, + columnsForType: function () { + return [{ name: 'title', desc: 'Title' }]; + } + }); + + _emberMetal.run(App, 'advanceReadiness'); + + function modelTypesAdded(types) { + equal(types.length, 1); + var postType = types[0]; + + equal(postType.name, PostClass.toString(), 'Correctly sets the name'); + equal(postType.count, 3, 'Correctly sets the record count'); + strictEqual(postType.object, PostClass, 'Correctly sets the object'); + deepEqual(postType.columns, [{ name: 'title', desc: 'Title' }], 'Correctly sets the columns'); + } + + _emberMetal.run(adapter, 'watchModelTypes', modelTypesAdded); + }); + + QUnit.test('Model Types Updated', function () { + App.Post = Model.extend(); + + adapter = App.__container__.lookup('data-adapter:main'); + var records = _emberRuntime.A([1, 2, 3]); + adapter.reopen({ + getRecords: function () { + return records; + } + }); + + _emberMetal.run(App, 'advanceReadiness'); + + function modelTypesAdded() { + _emberMetal.run(function () { + records.pushObject(4); + }); + } + + function modelTypesUpdated(types) { + var postType = types[0]; + equal(postType.count, 4, 'Correctly updates the count'); + } + + _emberMetal.run(adapter, 'watchModelTypes', modelTypesAdded, modelTypesUpdated); + }); + + QUnit.test('Records Added', function () { + expect(8); + var countAdded = 1; + + App.Post = Model.extend(); + + var post = App.Post.create(); + var recordList = _emberRuntime.A([post]); + + adapter = App.__container__.lookup('data-adapter:main'); + adapter.reopen({ + getRecords: function () { + return recordList; + }, + getRecordColor: function () { + return 'blue'; + }, + getRecordColumnValues: function () { + return { title: 'Post ' + countAdded }; + }, + getRecordKeywords: function () { + return ['Post ' + countAdded]; + } + }); + + function recordsAdded(records) { + var record = records[0]; + equal(record.color, 'blue', 'Sets the color correctly'); + deepEqual(record.columnValues, { title: 'Post ' + countAdded }, 'Sets the column values correctly'); + deepEqual(record.searchKeywords, ['Post ' + countAdded], 'Sets search keywords correctly'); + strictEqual(record.object, post, 'Sets the object to the record instance'); + } + + adapter.watchRecords(App.Post, recordsAdded); + countAdded++; + post = App.Post.create(); + recordList.pushObject(post); + }); + + QUnit.test('Observes and releases a record correctly', function () { + var updatesCalled = 0; + App.Post = Model.extend(); + + var post = App.Post.create({ title: 'Post' }); + var recordList = _emberRuntime.A([post]); + + adapter = App.__container__.lookup('data-adapter:main'); + adapter.reopen({ + getRecords: function () { + return recordList; + }, + observeRecord: function (record, recordUpdated) { + var self = this; + function callback() { + recordUpdated(self.wrapRecord(record)); + } + _emberMetal.addObserver(record, 'title', callback); + return function () { + _emberMetal.removeObserver(record, 'title', callback); + }; + }, + getRecordColumnValues: function (record) { + return { title: _emberMetal.get(record, 'title') }; + } + }); + + function recordsAdded() { + _emberMetal.set(post, 'title', 'Post Modified'); + } + + function recordsUpdated(records) { + updatesCalled++; + equal(records[0].columnValues.title, 'Post Modified'); + } + + var release = adapter.watchRecords(App.Post, recordsAdded, recordsUpdated); + release(); + _emberMetal.set(post, 'title', 'New Title'); + equal(updatesCalled, 1, 'Release function removes observers'); + }); +}); +enifed('ember-extension-support/tests/data_adapter_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-extension-support/tests'); + test('ember-extension-support/tests/data_adapter_test.js should pass jscs', function () { + ok(true, 'ember-extension-support/tests/data_adapter_test.js should pass jscs.'); + }); +}); +enifed('ember-extension-support/tests/data_adapter_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-extension-support/tests'); + QUnit.test('ember-extension-support/tests/data_adapter_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-extension-support/tests/data_adapter_test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/component.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer'); + test('ember-glimmer/component.js should pass jscs', function () { + ok(true, 'ember-glimmer/component.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/component.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer'); + QUnit.test('ember-glimmer/component.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/component.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/components/checkbox.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/components'); + test('ember-glimmer/components/checkbox.js should pass jscs', function () { + ok(true, 'ember-glimmer/components/checkbox.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/components/checkbox.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/components'); + QUnit.test('ember-glimmer/components/checkbox.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/components/checkbox.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/components/link-to.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/components'); + test('ember-glimmer/components/link-to.js should pass jscs', function () { + ok(true, 'ember-glimmer/components/link-to.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/components/link-to.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/components'); + QUnit.test('ember-glimmer/components/link-to.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/components/link-to.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/components/text_area.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/components'); + test('ember-glimmer/components/text_area.js should pass jscs', function () { + ok(true, 'ember-glimmer/components/text_area.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/components/text_area.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/components'); + QUnit.test('ember-glimmer/components/text_area.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/components/text_area.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/components/text_field.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/components'); + test('ember-glimmer/components/text_field.js should pass jscs', function () { + ok(true, 'ember-glimmer/components/text_field.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/components/text_field.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/components'); + QUnit.test('ember-glimmer/components/text_field.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/components/text_field.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/dom.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer'); + test('ember-glimmer/dom.js should pass jscs', function () { + ok(true, 'ember-glimmer/dom.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/dom.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer'); + QUnit.test('ember-glimmer/dom.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/dom.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/environment.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer'); + test('ember-glimmer/environment.js should pass jscs', function () { + ok(true, 'ember-glimmer/environment.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/environment.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer'); + QUnit.test('ember-glimmer/environment.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/environment.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helper.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer'); + test('ember-glimmer/helper.js should pass jscs', function () { + ok(true, 'ember-glimmer/helper.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helper.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer'); + QUnit.test('ember-glimmer/helper.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helper.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/-class.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/-class.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/-class.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/-class.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/-class.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/-class.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/-html-safe.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/-html-safe.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/-html-safe.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/-html-safe.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/-html-safe.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/-html-safe.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/-input-type.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/-input-type.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/-input-type.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/-input-type.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/-input-type.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/-input-type.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/-normalize-class.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/-normalize-class.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/-normalize-class.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/-normalize-class.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/-normalize-class.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/-normalize-class.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/action.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/action.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/action.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/action.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/action.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/action.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/component.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/component.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/component.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/component.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/component.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/component.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/concat.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/concat.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/concat.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/concat.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/concat.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/concat.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/debugger.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/debugger.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/debugger.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/debugger.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/debugger.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/debugger.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/each-in.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/each-in.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/each-in.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/each-in.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/each-in.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/each-in.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/get.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/get.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/get.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/get.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/get.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/get.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/hash.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/hash.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/hash.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/hash.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/hash.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/hash.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/if-unless.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/if-unless.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/if-unless.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/if-unless.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/if-unless.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/if-unless.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/loc.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/loc.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/loc.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/loc.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/loc.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/loc.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/log.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/log.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/log.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/log.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/log.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/log.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/mut.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/mut.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/mut.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/mut.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/mut.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/mut.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/query-param.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/query-param.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/query-param.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/query-param.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/query-param.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/query-param.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/readonly.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/readonly.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/readonly.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/readonly.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/readonly.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/readonly.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/unbound.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/unbound.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/unbound.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/unbound.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/unbound.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/unbound.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer'); + test('ember-glimmer/index.js should pass jscs', function () { + ok(true, 'ember-glimmer/index.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer'); + QUnit.test('ember-glimmer/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/index.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/make-bound-helper.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer'); + test('ember-glimmer/make-bound-helper.js should pass jscs', function () { + ok(true, 'ember-glimmer/make-bound-helper.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/make-bound-helper.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer'); + QUnit.test('ember-glimmer/make-bound-helper.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/make-bound-helper.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/modifiers/action.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/modifiers'); + test('ember-glimmer/modifiers/action.js should pass jscs', function () { + ok(true, 'ember-glimmer/modifiers/action.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/modifiers/action.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/modifiers'); + QUnit.test('ember-glimmer/modifiers/action.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/modifiers/action.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/protocol-for-url.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer'); + test('ember-glimmer/protocol-for-url.js should pass jscs', function () { + ok(true, 'ember-glimmer/protocol-for-url.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/protocol-for-url.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer'); + QUnit.test('ember-glimmer/protocol-for-url.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/protocol-for-url.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/renderer.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer'); + test('ember-glimmer/renderer.js should pass jscs', function () { + ok(true, 'ember-glimmer/renderer.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/renderer.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer'); + QUnit.test('ember-glimmer/renderer.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/renderer.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/setup-registry.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer'); + test('ember-glimmer/setup-registry.js should pass jscs', function () { + ok(true, 'ember-glimmer/setup-registry.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/setup-registry.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer'); + QUnit.test('ember-glimmer/setup-registry.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/setup-registry.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/syntax.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer'); + test('ember-glimmer/syntax.js should pass jscs', function () { + ok(true, 'ember-glimmer/syntax.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/syntax.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer'); + QUnit.test('ember-glimmer/syntax.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/syntax.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/syntax/curly-component.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/syntax'); + test('ember-glimmer/syntax/curly-component.js should pass jscs', function () { + ok(true, 'ember-glimmer/syntax/curly-component.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/syntax/curly-component.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/syntax'); + QUnit.test('ember-glimmer/syntax/curly-component.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/syntax/curly-component.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/syntax/dynamic-component.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/syntax'); + test('ember-glimmer/syntax/dynamic-component.js should pass jscs', function () { + ok(true, 'ember-glimmer/syntax/dynamic-component.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/syntax/dynamic-component.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/syntax'); + QUnit.test('ember-glimmer/syntax/dynamic-component.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/syntax/dynamic-component.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/syntax/input.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/syntax'); + test('ember-glimmer/syntax/input.js should pass jscs', function () { + ok(true, 'ember-glimmer/syntax/input.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/syntax/input.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/syntax'); + QUnit.test('ember-glimmer/syntax/input.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/syntax/input.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/syntax/mount.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/syntax'); + test('ember-glimmer/syntax/mount.js should pass jscs', function () { + ok(true, 'ember-glimmer/syntax/mount.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/syntax/mount.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/syntax'); + QUnit.test('ember-glimmer/syntax/mount.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/syntax/mount.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/syntax/outlet.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/syntax'); + test('ember-glimmer/syntax/outlet.js should pass jscs', function () { + ok(true, 'ember-glimmer/syntax/outlet.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/syntax/outlet.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/syntax'); + QUnit.test('ember-glimmer/syntax/outlet.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/syntax/outlet.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/syntax/render.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/syntax'); + test('ember-glimmer/syntax/render.js should pass jscs', function () { + ok(true, 'ember-glimmer/syntax/render.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/syntax/render.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/syntax'); + QUnit.test('ember-glimmer/syntax/render.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/syntax/render.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/template.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer'); + test('ember-glimmer/template.js should pass jscs', function () { + ok(true, 'ember-glimmer/template.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/template.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer'); + QUnit.test('ember-glimmer/template.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/template.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/template_registry.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer'); + test('ember-glimmer/template_registry.js should pass jscs', function () { + ok(true, 'ember-glimmer/template_registry.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/template_registry.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer'); + QUnit.test('ember-glimmer/template_registry.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/template_registry.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/application/actions-test', ['exports', 'ember-runtime', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberRuntime, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Application test: actions', (function (_ApplicationTest) { + babelHelpers.inherits(_class, _ApplicationTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _ApplicationTest.apply(this, arguments); + } + + _class.prototype['@test actions in top level template application template target application controller'] = function testActionsInTopLevelTemplateApplicationTemplateTargetApplicationController(assert) { + var _this = this; + + assert.expect(1); + + this.registerController('application', _emberRuntime.Controller.extend({ + actions: { + handleIt: function (arg) { + assert.ok(true, 'controller received action properly'); + } + } + })); + + this.registerTemplate('application', ''); + + return this.visit('/').then(function () { + _this.runTask(function () { + return _this.$('#handle-it').click(); + }); + }); + }; + + _class.prototype['@test actions in nested outlet template target their controller'] = function testActionsInNestedOutletTemplateTargetTheirController(assert) { + var _this2 = this; + + assert.expect(1); + + this.registerController('application', _emberRuntime.Controller.extend({ + actions: { + handleIt: function (arg) { + assert.ok(false, 'application controller should not have received action!'); + } + } + })); + + this.registerController('index', _emberRuntime.Controller.extend({ + actions: { + handleIt: function (arg) { + assert.ok(true, 'controller received action properly'); + } + } + })); + + this.registerTemplate('index', ''); + + return this.visit('/').then(function () { + _this2.runTask(function () { + return _this2.$('#handle-it').click(); + }); + }); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.ApplicationTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Rendering test: non-interactive actions', (function (_RenderingTest) { + babelHelpers.inherits(_class2, _RenderingTest); + + function _class2() { + babelHelpers.classCallCheck(this, _class2); + + _RenderingTest.apply(this, arguments); + } + + _class2.prototype.getBootOptions = function getBootOptions() { + return { isInteractive: false }; + }; + + _class2.prototype['@test doesn\'t attatch actions'] = function testDoesnTAttatchActions(assert) { + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + fire: function () { + assert.ok(false); + } + } + }), + template: '' + }); + + this.render('{{foo-bar tagName=""}}'); + + this.assertHTML(''); + + this.$('button').click(); + }; + + return _class2; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/application/actions-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/application'); + test('ember-glimmer/tests/integration/application/actions-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/application/actions-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/application/actions-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/application'); + QUnit.test('ember-glimmer/tests/integration/application/actions-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/application/actions-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/application/engine-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/helpers', 'ember-runtime', 'ember-glimmer', 'ember-application', 'ember-routing'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsHelpers, _emberRuntime, _emberGlimmer, _emberApplication, _emberRouting) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n

{{contextType}}

\n {{ambiguous-curlies}}\n\n {{outlet}}\n '], ['\n

{{contextType}}

\n {{ambiguous-curlies}}\n\n {{outlet}}\n ']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n

Component!

\n '], ['\n

Component!

\n ']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['\n {{ambiguous-curlies}}\n '], ['\n {{ambiguous-curlies}}\n ']), + _templateObject4 = babelHelpers.taggedTemplateLiteralLoose(['\n

Application

\n {{my-component ambiguous-curlies="Local Data!"}}\n {{outlet}}\n '], ['\n

Application

\n {{my-component ambiguous-curlies="Local Data!"}}\n {{outlet}}\n ']), + _templateObject5 = babelHelpers.taggedTemplateLiteralLoose(['\n

Engine

\n {{my-component}}\n {{outlet}}\n '], ['\n

Engine

\n {{my-component}}\n {{outlet}}\n ']), + _templateObject6 = babelHelpers.taggedTemplateLiteralLoose(['\n

Component!

\n '], ['\n

Component!

\n ']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Application test: engine rendering', (function (_ApplicationTest) { +babelHelpers.inherits(_class, _ApplicationTest); + + function _class() { +babelHelpers.classCallCheck(this, _class); + + _ApplicationTest.apply(this, arguments); + } + + _class.prototype.setupAppAndRoutableEngine = function setupAppAndRoutableEngine() { + var hooks = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; + + var self = this; + + this.application.register('template:application', _emberGlimmerTestsUtilsHelpers.compile('Application{{outlet}}')); + + this.router.map(function () { + this.mount('blog'); + }); + this.application.register('route-map:blog', function () { + this.route('post', function () { + this.route('comments'); + this.route('likes'); + }); + }); + this.registerRoute('application', _emberRouting.Route.extend({ + model: function () { + hooks.push('application - application'); + } + })); + + this.registerEngine('blog', _emberApplication.Engine.extend({ + init: function () { + this._super.apply(this, arguments); + this.register('controller:application', _emberRuntime.Controller.extend({ + queryParams: ['lang'], + lang: '' + })); + this.register('template:application', _emberGlimmerTestsUtilsHelpers.compile('Engine{{lang}}{{outlet}}')); + this.register('route:application', _emberRouting.Route.extend({ + model: function () { + hooks.push('engine - application'); + } + })); + + if (self._additionalEngineRegistrations) { + self._additionalEngineRegistrations.call(this); + } + } + })); + }; + + _class.prototype.setupAppAndRoutelessEngine = function setupAppAndRoutelessEngine(hooks) { + this.setupRoutelessEngine(hooks); + + this.registerEngine('chat-engine', _emberApplication.Engine.extend({ + init: function () { + this._super.apply(this, arguments); + this.register('template:application', _emberGlimmerTestsUtilsHelpers.compile('Engine')); + this.register('controller:application', _emberRuntime.Controller.extend({ + init: function () { + this._super.apply(this, arguments); + hooks.push('engine - application'); + } + })); + } + })); + }; + + _class.prototype.setupAppAndRoutableEngineWithPartial = function setupAppAndRoutableEngineWithPartial(hooks) { + this.application.register('template:application', _emberGlimmerTestsUtilsHelpers.compile('Application{{outlet}}')); + + this.router.map(function () { + this.mount('blog'); + }); + this.application.register('route-map:blog', function () {}); + this.registerRoute('application', _emberRouting.Route.extend({ + model: function () { + hooks.push('application - application'); + } + })); + + this.registerEngine('blog', _emberApplication.Engine.extend({ + init: function () { + this._super.apply(this, arguments); + this.register('template:foo', _emberGlimmerTestsUtilsHelpers.compile('foo partial')); + this.register('template:application', _emberGlimmerTestsUtilsHelpers.compile('Engine{{outlet}} {{partial "foo"}}')); + this.register('route:application', _emberRouting.Route.extend({ + model: function () { + hooks.push('engine - application'); + } + })); + } + })); + }; + + _class.prototype.setupRoutelessEngine = function setupRoutelessEngine(hooks) { + this.application.register('template:application', _emberGlimmerTestsUtilsHelpers.compile('Application{{mount "chat-engine"}}')); + this.registerRoute('application', _emberRouting.Route.extend({ + model: function () { + hooks.push('application - application'); + } + })); + }; + + _class.prototype.setupAppAndRoutlessEngineWithPartial = function setupAppAndRoutlessEngineWithPartial(hooks) { + this.setupRoutelessEngine(hooks); + + this.registerEngine('chat-engine', _emberApplication.Engine.extend({ + init: function () { + this._super.apply(this, arguments); + this.register('template:foo', _emberGlimmerTestsUtilsHelpers.compile('foo partial')); + this.register('template:application', _emberGlimmerTestsUtilsHelpers.compile('Engine {{partial "foo"}}')); + this.register('controller:application', _emberRuntime.Controller.extend({ + init: function () { + this._super.apply(this, arguments); + hooks.push('engine - application'); + } + })); + } + })); + }; + + _class.prototype.additionalEngineRegistrations = function additionalEngineRegistrations(callback) { + this._additionalEngineRegistrations = callback; + }; + + _class.prototype.setupEngineWithAttrs = function setupEngineWithAttrs(hooks) { + this.application.register('template:application', _emberGlimmerTestsUtilsHelpers.compile('Application{{mount "chat-engine"}}')); + + this.registerEngine('chat-engine', _emberApplication.Engine.extend({ + init: function () { + this._super.apply(this, arguments); + this.register('template:components/foo-bar', _emberGlimmerTestsUtilsHelpers.compile('{{partial "troll"}}')); + this.register('template:troll', _emberGlimmerTestsUtilsHelpers.compile('{{attrs.wat}}')); + this.register('controller:application', _emberRuntime.Controller.extend({ + contextType: 'Engine' + })); + this.register('template:application', _emberGlimmerTestsUtilsHelpers.compile('Engine {{foo-bar wat=contextType}}')); + } + })); + }; + + _class.prototype['@test attrs in an engine'] = function testAttrsInAnEngine() { + var _this = this; + + this.setupEngineWithAttrs([]); + + return this.visit('/').then(function () { + _this.assertText('ApplicationEngine Engine'); + }); + }; + + _class.prototype['@test sharing a template between engine and application has separate refinements'] = function testSharingATemplateBetweenEngineAndApplicationHasSeparateRefinements() { + var _this2 = this; + + this.assert.expect(1); + + var sharedTemplate = _emberGlimmerTestsUtilsHelpers.compile(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject)); + + this.application.register('template:application', sharedTemplate); + this.registerController('application', _emberRuntime.Controller.extend({ + contextType: 'Application', + 'ambiguous-curlies': 'Controller Data!' + })); + + this.router.map(function () { + this.mount('blog'); + }); + this.application.register('route-map:blog', function () {}); + + this.registerEngine('blog', _emberApplication.Engine.extend({ + init: function () { + this._super.apply(this, arguments); + + this.register('controller:application', _emberRuntime.Controller.extend({ + contextType: 'Engine' + })); + this.register('template:application', sharedTemplate); + this.register('template:components/ambiguous-curlies', _emberGlimmerTestsUtilsHelpers.compile(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2))); + } + })); + + return this.visit('/blog').then(function () { + _this2.assertText('ApplicationController Data!EngineComponent!'); + }); + }; + + _class.prototype['@test sharing a layout between engine and application has separate refinements'] = function testSharingALayoutBetweenEngineAndApplicationHasSeparateRefinements() { + var _this3 = this; + + this.assert.expect(1); + + var sharedLayout = _emberGlimmerTestsUtilsHelpers.compile(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3)); + + var sharedComponent = _emberGlimmer.Component.extend({ + layout: sharedLayout + }); + + this.application.register('template:application', _emberGlimmerTestsUtilsHelpers.compile(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4))); + + this.application.register('component:my-component', sharedComponent); + + this.router.map(function () { + this.mount('blog'); + }); + this.application.register('route-map:blog', function () {}); + + this.registerEngine('blog', _emberApplication.Engine.extend({ + init: function () { + this._super.apply(this, arguments); + this.register('template:application', _emberGlimmerTestsUtilsHelpers.compile(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5))); + this.register('component:my-component', sharedComponent); + this.register('template:components/ambiguous-curlies', _emberGlimmerTestsUtilsHelpers.compile(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject6))); + } + })); + + return this.visit('/blog').then(function () { + _this3.assertText('ApplicationLocal Data!EngineComponent!'); + }); + }; + + _class.prototype['@test visit() with `shouldRender: true` returns a promise that resolves when application and engine templates have rendered'] = function testVisitWithShouldRenderTrueReturnsAPromiseThatResolvesWhenApplicationAndEngineTemplatesHaveRendered(assert) { + var _this4 = this; + + assert.expect(2); + + var hooks = []; + + this.setupAppAndRoutableEngine(hooks); + + return this.visit('/blog', { shouldRender: true }).then(function () { + _this4.assertText('ApplicationEngine'); + + _this4.assert.deepEqual(hooks, ['application - application', 'engine - application'], 'the expected model hooks were fired'); + }); + }; + + _class.prototype['@test visit() with `shouldRender: false` returns a promise that resolves without rendering'] = function testVisitWithShouldRenderFalseReturnsAPromiseThatResolvesWithoutRendering(assert) { + var _this5 = this; + + assert.expect(2); + + var hooks = []; + + this.setupAppAndRoutableEngine(hooks); + + return this.visit('/blog', { shouldRender: false }).then(function () { + _this5.assertText(''); + + _this5.assert.deepEqual(hooks, ['application - application', 'engine - application'], 'the expected model hooks were fired'); + }); + }; + + _class.prototype['@test visit() with `shouldRender: true` returns a promise that resolves when application and routeless engine templates have rendered'] = function testVisitWithShouldRenderTrueReturnsAPromiseThatResolvesWhenApplicationAndRoutelessEngineTemplatesHaveRendered(assert) { + var _this6 = this; + + assert.expect(2); + + var hooks = []; + + this.setupAppAndRoutelessEngine(hooks); + + return this.visit('/', { shouldRender: true }).then(function () { + _this6.assertText('ApplicationEngine'); + + _this6.assert.deepEqual(hooks, ['application - application', 'engine - application'], 'the expected hooks were fired'); + }); + }; + + _class.prototype['@test visit() with partials in routable engine'] = function testVisitWithPartialsInRoutableEngine(assert) { + var _this7 = this; + + assert.expect(2); + + var hooks = []; + + this.setupAppAndRoutableEngineWithPartial(hooks); + + return this.visit('/blog', { shouldRender: true }).then(function () { + _this7.assertText('ApplicationEngine foo partial'); + + _this7.assert.deepEqual(hooks, ['application - application', 'engine - application'], 'the expected hooks were fired'); + }); + }; + + _class.prototype['@test visit() with partials in non-routable engine'] = function testVisitWithPartialsInNonRoutableEngine(assert) { + var _this8 = this; + + assert.expect(2); + + var hooks = []; + + this.setupAppAndRoutlessEngineWithPartial(hooks); + + return this.visit('/', { shouldRender: true }).then(function () { + _this8.assertText('ApplicationEngine foo partial'); + + _this8.assert.deepEqual(hooks, ['application - application', 'engine - application'], 'the expected hooks were fired'); + }); + }; + + _class.prototype['@test deactivate should be called on Engine Routes before destruction'] = function testDeactivateShouldBeCalledOnEngineRoutesBeforeDestruction(assert) { + var _this9 = this; + + assert.expect(3); + + this.setupAppAndRoutableEngine(); + + this.registerEngine('blog', _emberApplication.Engine.extend({ + init: function () { + this._super.apply(this, arguments); + this.register('template:application', _emberGlimmerTestsUtilsHelpers.compile('Engine{{outlet}}')); + this.register('route:application', _emberRouting.Route.extend({ + deactivate: function () { + assert.notOk(this.isDestroyed, 'Route is not destroyed'); + assert.notOk(this.isDestroying, 'Route is not being destroyed'); + } + })); + } + })); + + return this.visit('/blog').then(function () { + _this9.assertText('ApplicationEngine'); + }); + }; + + _class.prototype['@test engine should lookup and use correct controller'] = function testEngineShouldLookupAndUseCorrectController(assert) { + var _this10 = this; + + this.setupAppAndRoutableEngine(); + + return this.visit('/blog?lang=English').then(function () { + _this10.assertText('ApplicationEngineEnglish'); + }); + }; + + _class.prototype['@test error substate route works for the application route of an Engine'] = function testErrorSubstateRouteWorksForTheApplicationRouteOfAnEngine(assert) { + var _this11 = this; + + assert.expect(2); + + this.setupAppAndRoutableEngine(); + this.application.__registry__.resolver.moduleBasedResolver = true; + this.additionalEngineRegistrations(function () { + this.register('template:application_error', _emberGlimmerTestsUtilsHelpers.compile('Error! {{model.message}}')); + this.register('route:post', _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.RSVP.reject(new Error('Oh, noes!')); + } + })); + }); + + return this.visit('/').then(function () { + _this11.assertText('Application'); + return _this11.transitionTo('blog.post'); + }).catch(function () { + _this11.assertText('ApplicationError! Oh, noes!'); + }); + }; + + _class.prototype['@test error route works for the application route of an Engine'] = function testErrorRouteWorksForTheApplicationRouteOfAnEngine(assert) { + var _this12 = this; + + assert.expect(2); + + this.setupAppAndRoutableEngine(); + this.application.__registry__.resolver.moduleBasedResolver = true; + this.additionalEngineRegistrations(function () { + this.register('template:error', _emberGlimmerTestsUtilsHelpers.compile('Error! {{model.message}}')); + this.register('route:post', _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.RSVP.reject(new Error('Oh, noes!')); + } + })); + }); + + return this.visit('/').then(function () { + _this12.assertText('Application'); + return _this12.transitionTo('blog.post'); + }).catch(function () { + _this12.assertText('ApplicationEngineError! Oh, noes!'); + }); + }; + + _class.prototype['@test error substate route works for a child route of an Engine'] = function testErrorSubstateRouteWorksForAChildRouteOfAnEngine(assert) { + var _this13 = this; + + assert.expect(2); + + this.setupAppAndRoutableEngine(); + this.application.__registry__.resolver.moduleBasedResolver = true; + this.additionalEngineRegistrations(function () { + this.register('template:post_error', _emberGlimmerTestsUtilsHelpers.compile('Error! {{model.message}}')); + this.register('route:post', _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.RSVP.reject(new Error('Oh, noes!')); + } + })); + }); + + return this.visit('/').then(function () { + _this13.assertText('Application'); + return _this13.transitionTo('blog.post'); + }).catch(function () { + _this13.assertText('ApplicationEngineError! Oh, noes!'); + }); + }; + + _class.prototype['@test error route works for a child route of an Engine'] = function testErrorRouteWorksForAChildRouteOfAnEngine(assert) { + var _this14 = this; + + assert.expect(2); + + this.setupAppAndRoutableEngine(); + this.application.__registry__.resolver.moduleBasedResolver = true; + this.additionalEngineRegistrations(function () { + this.register('template:post.error', _emberGlimmerTestsUtilsHelpers.compile('Error! {{model.message}}')); + this.register('route:post.comments', _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.RSVP.reject(new Error('Oh, noes!')); + } + })); + }); + + return this.visit('/').then(function () { + _this14.assertText('Application'); + return _this14.transitionTo('blog.post.comments'); + }).catch(function () { + _this14.assertText('ApplicationEngineError! Oh, noes!'); + }); + }; + + _class.prototype['@test loading substate route works for the application route of an Engine'] = function testLoadingSubstateRouteWorksForTheApplicationRouteOfAnEngine(assert) { + var _this15 = this; + + assert.expect(3); + + var resolveLoading = undefined; + + this.setupAppAndRoutableEngine(); + this.application.__registry__.resolver.moduleBasedResolver = true; + this.additionalEngineRegistrations(function () { + this.register('template:application_loading', _emberGlimmerTestsUtilsHelpers.compile('Loading')); + this.register('template:post', _emberGlimmerTestsUtilsHelpers.compile('Post')); + this.register('route:post', _emberRouting.Route.extend({ + model: function () { + return new _emberRuntime.RSVP.Promise(function (resolve) { + resolveLoading = resolve; + }); + } + })); + }); + + return this.visit('/').then(function () { + _this15.assertText('Application'); + var transition = _this15.transitionTo('blog.post'); + + _this15.runTaskNext(function () { + _this15.assertText('ApplicationLoading'); + resolveLoading(); + }); + + return transition.then(function () { + _this15.runTaskNext(function () { + return _this15.assertText('ApplicationEnginePost'); + }); + }); + }); + }; + + _class.prototype['@test loading route works for the application route of an Engine'] = function testLoadingRouteWorksForTheApplicationRouteOfAnEngine(assert) { + var _this16 = this; + + assert.expect(3); + + var resolveLoading = undefined; + + this.setupAppAndRoutableEngine(); + this.additionalEngineRegistrations(function () { + this.register('template:loading', _emberGlimmerTestsUtilsHelpers.compile('Loading')); + this.register('template:post', _emberGlimmerTestsUtilsHelpers.compile('Post')); + this.register('route:post', _emberRouting.Route.extend({ + model: function () { + return new _emberRuntime.RSVP.Promise(function (resolve) { + resolveLoading = resolve; + }); + } + })); + }); + + return this.visit('/').then(function () { + _this16.assertText('Application'); + var transition = _this16.transitionTo('blog.post'); + + _this16.runTaskNext(function () { + _this16.assertText('ApplicationEngineLoading'); + resolveLoading(); + }); + + return transition.then(function () { + _this16.runTaskNext(function () { + return _this16.assertText('ApplicationEnginePost'); + }); + }); + }); + }; + + _class.prototype['@test loading substate route works for a child route of an Engine'] = function testLoadingSubstateRouteWorksForAChildRouteOfAnEngine(assert) { + var _this17 = this; + + assert.expect(3); + + var resolveLoading = undefined; + + this.setupAppAndRoutableEngine(); + this.application.__registry__.resolver.moduleBasedResolver = true; + this.additionalEngineRegistrations(function () { + this.register('template:post', _emberGlimmerTestsUtilsHelpers.compile('{{outlet}}')); + this.register('template:post.comments', _emberGlimmerTestsUtilsHelpers.compile('Comments')); + this.register('template:post.likes_loading', _emberGlimmerTestsUtilsHelpers.compile('Loading')); + this.register('template:post.likes', _emberGlimmerTestsUtilsHelpers.compile('Likes')); + this.register('route:post.likes', _emberRouting.Route.extend({ + model: function () { + return new _emberRuntime.RSVP.Promise(function (resolve) { + resolveLoading = resolve; + }); + } + })); + }); + + return this.visit('/blog/post/comments').then(function () { + _this17.assertText('ApplicationEngineComments'); + var transition = _this17.transitionTo('blog.post.likes'); + + _this17.runTaskNext(function () { + _this17.assertText('ApplicationEngineLoading'); + resolveLoading(); + }); + + return transition.then(function () { + _this17.runTaskNext(function () { + return _this17.assertText('ApplicationEngineLikes'); + }); + }); + }); + }; + + _class.prototype['@test loading route works for a child route of an Engine'] = function testLoadingRouteWorksForAChildRouteOfAnEngine(assert) { + var _this18 = this; + + assert.expect(3); + + var resolveLoading = undefined; + + this.setupAppAndRoutableEngine(); + this.additionalEngineRegistrations(function () { + this.register('template:post', _emberGlimmerTestsUtilsHelpers.compile('{{outlet}}')); + this.register('template:post.comments', _emberGlimmerTestsUtilsHelpers.compile('Comments')); + this.register('template:post.loading', _emberGlimmerTestsUtilsHelpers.compile('Loading')); + this.register('template:post.likes', _emberGlimmerTestsUtilsHelpers.compile('Likes')); + this.register('route:post.likes', _emberRouting.Route.extend({ + model: function () { + return new _emberRuntime.RSVP.Promise(function (resolve) { + resolveLoading = resolve; + }); + } + })); + }); + + return this.visit('/blog/post/comments').then(function () { + _this18.assertText('ApplicationEngineComments'); + var transition = _this18.transitionTo('blog.post.likes'); + + _this18.runTaskNext(function () { + _this18.assertText('ApplicationEngineLoading'); + resolveLoading(); + }); + + return transition.then(function () { + _this18.runTaskNext(function () { + return _this18.assertText('ApplicationEngineLikes'); + }); + }); + }); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.ApplicationTest)); +}); +enifed('ember-glimmer/tests/integration/application/engine-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/application'); + test('ember-glimmer/tests/integration/application/engine-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/application/engine-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/application/engine-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/application'); + QUnit.test('ember-glimmer/tests/integration/application/engine-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/application/engine-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/application/rendering-test', ['exports', 'ember-runtime', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-routing'], function (exports, _emberRuntime, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberRouting) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n {{#each model as |item|}}\n
  • {{item}}
  • \n {{/each}}\n
\n '], ['\n
    \n {{#each model as |item|}}\n
  • {{item}}
  • \n {{/each}}\n
\n ']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n
  • red
  • \n
  • yellow
  • \n
  • blue
  • \n
\n '], ['\n
    \n
  • red
  • \n
  • yellow
  • \n
  • blue
  • \n
\n ']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['\n \n
{{outlet}}
\n '], ['\n \n
{{outlet}}
\n ']), + _templateObject4 = babelHelpers.taggedTemplateLiteralLoose(['\n Ember\n '], ['\n Ember\n ']), + _templateObject5 = babelHelpers.taggedTemplateLiteralLoose(['\n \n
\n
    \n
  • red
  • \n
  • yellow
  • \n
  • blue
  • \n
\n
\n '], ['\n \n
\n
    \n
  • red
  • \n
  • yellow
  • \n
  • blue
  • \n
\n
\n ']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Application test: rendering', (function (_ApplicationTest) { +babelHelpers.inherits(_class, _ApplicationTest); + + function _class() { +babelHelpers.classCallCheck(this, _class); + + _ApplicationTest.apply(this, arguments); + } + + _class.prototype['@test it can render the application template'] = function testItCanRenderTheApplicationTemplate(assert) { + var _this = this; + + this.registerTemplate('application', 'Hello world!'); + + return this.visit('/').then(function () { + _this.assertText('Hello world!'); + }); + }; + + _class.prototype['@test it can access the model provided by the route'] = function testItCanAccessTheModelProvidedByTheRoute(assert) { + var _this2 = this; + + this.registerRoute('application', _emberRouting.Route.extend({ + model: function () { + return ['red', 'yellow', 'blue']; + } + })); + + this.registerTemplate('application', _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject)); + + return this.visit('/').then(function () { + _this2.assertComponentElement(_this2.firstChild, { + content: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2) + }); + }); + }; + + _class.prototype['@test it can render a nested route'] = function testItCanRenderANestedRoute(assert) { + var _this3 = this; + + this.router.map(function () { + this.route('lists', function () { + this.route('colors', function () { + this.route('favorite'); + }); + }); + }); + + // The "favorite" route will inherit the model + this.registerRoute('lists.colors', _emberRouting.Route.extend({ + model: function () { + return ['red', 'yellow', 'blue']; + } + })); + + this.registerTemplate('lists.colors.favorite', _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject)); + + return this.visit('/lists/colors/favorite').then(function () { + _this3.assertComponentElement(_this3.firstChild, { + content: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2) + }); + }); + }; + + _class.prototype['@test it can render into named outlets'] = function testItCanRenderIntoNamedOutlets(assert) { + var _this4 = this; + + this.router.map(function () { + this.route('colors'); + }); + + this.registerTemplate('application', _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3)); + + this.registerTemplate('nav', _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4)); + + this.registerRoute('application', _emberRouting.Route.extend({ + renderTemplate: function () { + this.render(); + this.render('nav', { + into: 'application', + outlet: 'nav' + }); + } + })); + + this.registerRoute('colors', _emberRouting.Route.extend({ + model: function () { + return ['red', 'yellow', 'blue']; + } + })); + + this.registerTemplate('colors', _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject)); + + return this.visit('/colors').then(function () { + _this4.assertComponentElement(_this4.firstChild, { + content: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5) + }); + }); + }; + + _class.prototype['@test it can render into named outlets'] = function testItCanRenderIntoNamedOutlets(assert) { + var _this5 = this; + + this.router.map(function () { + this.route('colors'); + }); + + this.registerTemplate('application', _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3)); + + this.registerTemplate('nav', _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4)); + + this.registerRoute('application', _emberRouting.Route.extend({ + renderTemplate: function () { + this.render(); + this.render('nav', { + into: 'application', + outlet: 'nav' + }); + } + })); + + this.registerRoute('colors', _emberRouting.Route.extend({ + model: function () { + return ['red', 'yellow', 'blue']; + } + })); + + this.registerTemplate('colors', _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject)); + + return this.visit('/colors').then(function () { + _this5.assertComponentElement(_this5.firstChild, { + content: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5) + }); + }); + }; + + _class.prototype['@test it should update the outlets when switching between routes'] = function testItShouldUpdateTheOutletsWhenSwitchingBetweenRoutes(assert) { + var _this6 = this; + + this.router.map(function () { + this.route('a'); + this.route('b', function () { + this.route('c'); + this.route('d'); + }); + }); + + this.registerTemplate('a', 'A{{outlet}}'); + this.registerTemplate('b', 'B{{outlet}}'); + this.registerTemplate('b.c', 'C'); + this.registerTemplate('b.d', 'D'); + + return this.visit('/b/c').then(function () { + // this.assertComponentElement(this.firstChild, { content: 'BC' }); + _this6.assertText('BC'); + return _this6.visit('/a'); + }).then(function () { + // this.assertComponentElement(this.firstChild, { content: 'A' }); + _this6.assertText('A'); + return _this6.visit('/b/d'); + }).then(function () { + _this6.assertText('BD'); + // this.assertComponentElement(this.firstChild, { content: 'BD' }); + }); + }; + + _class.prototype['@test it should produce a stable DOM when the model changes'] = function testItShouldProduceAStableDOMWhenTheModelChanges(assert) { + var _this7 = this; + + this.router.map(function () { + this.route('color', { path: '/colors/:color' }); + }); + + this.registerRoute('color', _emberRouting.Route.extend({ + model: function (params) { + return params.color; + } + })); + + this.registerTemplate('color', 'color: {{model}}'); + + return this.visit('/colors/red').then(function () { + _this7.assertComponentElement(_this7.firstChild, { content: 'color: red' }); + _this7.takeSnapshot(); + return _this7.visit('/colors/green'); + }).then(function () { + _this7.assertComponentElement(_this7.firstChild, { content: 'color: green' }); + _this7.assertInvariants(); + }); + }; + + _class.prototype['@test it should have the right controller in scope for the route template'] = function testItShouldHaveTheRightControllerInScopeForTheRouteTemplate() { + var _this8 = this; + + this.router.map(function () { + this.route('a'); + this.route('b'); + }); + + this.registerController('a', _emberRuntime.Controller.extend({ + value: 'a' + })); + + this.registerController('b', _emberRuntime.Controller.extend({ + value: 'b' + })); + + this.registerTemplate('a', '{{value}}'); + this.registerTemplate('b', '{{value}}'); + + return this.visit('/a').then(function () { + _this8.assertText('a'); + return _this8.visit('/b'); + }).then(function () { + return _this8.assertText('b'); + }); + }; + + _class.prototype['@test it should update correctly when the controller changes'] = function testItShouldUpdateCorrectlyWhenTheControllerChanges(assert) { + var _this9 = this; + + this.router.map(function () { + this.route('color', { path: '/colors/:color' }); + }); + + this.registerRoute('color', _emberRouting.Route.extend({ + model: function (params) { + return { color: params.color }; + }, + + renderTemplate: function (controller, model) { + this.render({ controller: model.color, model: model }); + } + })); + + this.registerController('red', _emberRuntime.Controller.extend({ + color: 'red' + })); + + this.registerController('green', _emberRuntime.Controller.extend({ + color: 'green' + })); + + this.registerTemplate('color', 'model color: {{model.color}}, controller color: {{color}}'); + + return this.visit('/colors/red').then(function () { + _this9.assertComponentElement(_this9.firstChild, { content: 'model color: red, controller color: red' }); + _this9.takeSnapshot(); + return _this9.visit('/colors/green'); + }).then(function () { + _this9.assertComponentElement(_this9.firstChild, { content: 'model color: green, controller color: green' }); + _this9.assertInvariants(); + }); + }; + + _class.prototype['@test it should produce a stable DOM when two routes render the same template'] = function testItShouldProduceAStableDOMWhenTwoRoutesRenderTheSameTemplate(assert) { + var _this10 = this; + + this.router.map(function () { + this.route('a'); + this.route('b'); + }); + + this.registerRoute('a', _emberRouting.Route.extend({ + model: function () { + return 'A'; + }, + + renderTemplate: function (controller, model) { + this.render('common', { controller: 'common', model: model }); + } + })); + + this.registerRoute('b', _emberRouting.Route.extend({ + model: function () { + return 'B'; + }, + + renderTemplate: function (controller, model) { + this.render('common', { controller: 'common', model: model }); + } + })); + + this.registerController('common', _emberRuntime.Controller.extend({ + prefix: 'common' + })); + + this.registerTemplate('common', '{{prefix}} {{model}}'); + + return this.visit('/a').then(function () { + _this10.assertComponentElement(_this10.firstChild, { content: 'common A' }); + _this10.takeSnapshot(); + return _this10.visit('/b'); + }).then(function () { + _this10.assertComponentElement(_this10.firstChild, { content: 'common B' }); + _this10.assertInvariants(); + }); + }; + + // Regression test, glimmer child outlets tried to assume the first element. + // but the if put-args clobbered the args used by did-create-element. + // I wish there was a way to assert that the OutletComponentManager did not + // receive a didCreateElement. + + _class.prototype['@test a child outlet is always a fragment'] = function testAChildOutletIsAlwaysAFragment() { + var _this11 = this; + + this.registerTemplate('application', '{{outlet}}'); + this.registerTemplate('index', '{{#if true}}1{{/if}}
2
'); + return this.visit('/').then(function () { + _this11.assertComponentElement(_this11.firstChild, { content: '1
2
' }); + }); + }; + + _class.prototype['@test it allows a transition during route activate'] = function testItAllowsATransitionDuringRouteActivate(assert) { + var _this12 = this; + + this.router.map(function () { + this.route('a'); + }); + + this.registerRoute('index', _emberRouting.Route.extend({ + activate: function () { + this.transitionTo('a'); + } + })); + + this.registerTemplate('a', 'Hello from A!'); + + return this.visit('/').then(function () { + _this12.assertComponentElement(_this12.firstChild, { + content: 'Hello from A!' + }); + }); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.ApplicationTest)); +}); +enifed('ember-glimmer/tests/integration/application/rendering-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/application'); + test('ember-glimmer/tests/integration/application/rendering-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/application/rendering-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/application/rendering-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/application'); + QUnit.test('ember-glimmer/tests/integration/application/rendering-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/application/rendering-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/binding_integration_test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Binding integration tests', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test should accept bindings as a string or an Ember.binding'] = function testShouldAcceptBindingsAsAStringOrAnEmberBinding() { + var _this = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + twoWayTestBinding: _emberMetal.Binding.from('direction'), + stringTestBinding: 'direction', + twoWayObjectTestBinding: _emberMetal.Binding.from('displacement.distance'), + stringObjectTestBinding: 'displacement.distance' + }); + + this.registerComponent('foo-bar', { + ComponentClass: FooBarComponent, + template: 'two way: {{twoWayTest}}, string: {{stringTest}}, object: {{twoWayObjectTest}}, string object: {{stringObjectTest}}' + }); + + expectDeprecation(function () { + _this.render('{{foo-bar direction=direction displacement=displacement}}', { + direction: 'down', + displacement: { + distance: 10 + } + }); + }, /`Ember\.Binding` is deprecated/); + + this.assertText('two way: down, string: down, object: 10, string object: 10'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'direction', 'up'); + }); + + this.assertText('two way: up, string: up, object: 10, string object: 10'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'displacement.distance', 20); + }); + + this.assertText('two way: up, string: up, object: 20, string object: 20'); + + this.runTask(function () { + _emberMetal.set(_this.context, 'direction', 'right'); + _emberMetal.set(_this.context, 'displacement.distance', 30); + }); + + this.assertText('two way: right, string: right, object: 30, string object: 30'); + + this.runTask(function () { + _emberMetal.set(_this.context, 'direction', 'down'); + _emberMetal.set(_this.context, 'displacement', { distance: 10 }); + }); + + this.assertText('two way: down, string: down, object: 10, string object: 10'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/binding_integration_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration'); + test('ember-glimmer/tests/integration/binding_integration_test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/binding_integration_test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/binding_integration_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration'); + QUnit.test('ember-glimmer/tests/integration/binding_integration_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/binding_integration_test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/append-test', ['exports', 'ember-metal', 'ember-views', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberMetal, _emberViews, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsAbstractTestCase) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if showFooBar}}\n {{foo-bar}}\n {{else}}\n {{baz-qux}}\n {{/if}}\n '], ['\n {{#if showFooBar}}\n {{foo-bar}}\n {{else}}\n {{baz-qux}}\n {{/if}}\n ']); + + var AbstractAppendTest = (function (_RenderingTest) { +babelHelpers.inherits(AbstractAppendTest, _RenderingTest); + + function AbstractAppendTest() { +babelHelpers.classCallCheck(this, AbstractAppendTest); + + _RenderingTest.call(this); + + this.components = []; + this.ids = []; + } + + AbstractAppendTest.prototype.teardown = function teardown() { + var _this = this; + + this.component = null; + + this.components.forEach(function (component) { + _this.runTask(function () { + return component.destroy(); + }); + }); + + this.ids.forEach(function (id) { + var $element = _emberViews.jQuery(id).remove(); + _this.assert.strictEqual($element.length, 0, 'Should not leak element: #' + id); + }); + + _RenderingTest.prototype.teardown.call(this); + }; + + /* abstract append(component): Element; */ + + AbstractAppendTest.prototype.didAppend = function didAppend(component) { + this.components.push(component); + this.ids.push(component.elementId); + }; + + AbstractAppendTest.prototype['@test lifecycle hooks during component append'] = function testLifecycleHooksDuringComponentAppend(assert) { + var _this3 = this; + + var hooks = []; + + var oldRegisterComponent = this.registerComponent; + var componentsByName = {}; + + // TODO: refactor/combine with other life-cycle tests + this.registerComponent = function (name, _options) { + function pushHook(hookName) { + hooks.push([name, hookName]); + } + + var options = { + ComponentClass: _options.ComponentClass.extend({ + init: function () { + var _this2 = this, + _arguments = arguments; + + expectDeprecation(function () { + _this2._super.apply(_this2, _arguments); + }, /didInitAttrs called/); + if (name in componentsByName) { + throw new TypeError('Component named: ` ' + name + ' ` already registered'); + } + componentsByName[name] = this; + pushHook('init'); + this.on('init', function () { + return pushHook('on(init)'); + }); + }, + + didInitAttrs: function (options) { + pushHook('didInitAttrs', options); + }, + + didReceiveAttrs: function () { + pushHook('didReceiveAttrs'); + }, + + willInsertElement: function () { + pushHook('willInsertElement'); + }, + + willRender: function () { + pushHook('willRender'); + }, + + didInsertElement: function () { + pushHook('didInsertElement'); + }, + + didRender: function () { + pushHook('didRender'); + }, + + didUpdateAttrs: function () { + pushHook('didUpdateAttrs'); + }, + + willUpdate: function () { + pushHook('willUpdate'); + }, + + didUpdate: function () { + pushHook('didUpdate'); + }, + + willDestroyElement: function () { + pushHook('willDestroyElement'); + }, + + willClearRender: function () { + pushHook('willClearRender'); + }, + + didDestroyElement: function () { + pushHook('didDestroyElement'); + }, + + willDestroy: function () { + pushHook('willDestroy'); + this._super.apply(this, arguments); + } + }), + template: _options.template + }; + + oldRegisterComponent.call(this, name, options); + }; + + this.registerComponent('x-parent', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + layoutName: 'components/x-parent' + }), + + template: '[parent: {{foo}}]{{#x-child bar=foo}}[yielded: {{foo}}]{{/x-child}}' + }); + + this.registerComponent('x-child', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '' + }), + + template: '[child: {{bar}}]{{yield}}' + }); + + var XParent = this.owner._lookupFactory('component:x-parent'); + + this.component = XParent.create({ foo: 'zomg' }); + + assert.deepEqual(hooks, [['x-parent', 'init'], ['x-parent', 'didInitAttrs'], ['x-parent', 'didReceiveAttrs'], ['x-parent', 'on(init)']], 'creation of x-parent'); + + hooks.length = 0; + + this.element = this.append(this.component); + + assert.deepEqual(hooks, [['x-parent', 'willInsertElement'], ['x-child', 'init'], ['x-child', 'didInitAttrs'], ['x-child', 'didReceiveAttrs'], ['x-child', 'on(init)'], ['x-child', 'willRender'], ['x-child', 'willInsertElement'], ['x-child', 'didInsertElement'], ['x-child', 'didRender'], ['x-parent', 'didInsertElement'], ['x-parent', 'didRender']], 'appending of x-parent'); + + hooks.length = 0; + + this.runTask(function () { + return componentsByName['x-parent'].rerender(); + }); + + assert.deepEqual(hooks, [['x-parent', 'willUpdate'], ['x-parent', 'willRender'], ['x-parent', 'didUpdate'], ['x-parent', 'didRender']], 'rerender x-parent'); + + hooks.length = 0; + + this.runTask(function () { + return componentsByName['x-child'].rerender(); + }); + + assert.deepEqual(hooks, [['x-parent', 'willUpdate'], ['x-parent', 'willRender'], ['x-child', 'willUpdate'], ['x-child', 'willRender'], ['x-child', 'didUpdate'], ['x-child', 'didRender'], ['x-parent', 'didUpdate'], ['x-parent', 'didRender']], 'rerender x-child'); + + hooks.length = 0; + + this.runTask(function () { + return _emberMetal.set(_this3.component, 'foo', 'wow'); + }); + + assert.deepEqual(hooks, [['x-parent', 'willUpdate'], ['x-parent', 'willRender'], ['x-child', 'didUpdateAttrs'], ['x-child', 'didReceiveAttrs'], ['x-child', 'willUpdate'], ['x-child', 'willRender'], ['x-child', 'didUpdate'], ['x-child', 'didRender'], ['x-parent', 'didUpdate'], ['x-parent', 'didRender']], 'set foo = wow'); + + hooks.length = 0; + + this.runTask(function () { + return _emberMetal.set(_this3.component, 'foo', 'zomg'); + }); + + assert.deepEqual(hooks, [['x-parent', 'willUpdate'], ['x-parent', 'willRender'], ['x-child', 'didUpdateAttrs'], ['x-child', 'didReceiveAttrs'], ['x-child', 'willUpdate'], ['x-child', 'willRender'], ['x-child', 'didUpdate'], ['x-child', 'didRender'], ['x-parent', 'didUpdate'], ['x-parent', 'didRender']], 'set foo = zomg'); + + hooks.length = 0; + + this.runTask(function () { + return _this3.component.destroy(); + }); + + assert.deepEqual(hooks, [['x-parent', 'willDestroyElement'], ['x-parent', 'willClearRender'], ['x-child', 'willDestroyElement'], ['x-child', 'willClearRender'], ['x-child', 'didDestroyElement'], ['x-parent', 'didDestroyElement'], ['x-parent', 'willDestroy'], ['x-child', 'willDestroy']], 'destroy'); + }; + + AbstractAppendTest.prototype['@test appending, updating and destroying a single component'] = function testAppendingUpdatingAndDestroyingASingleComponent(assert) { + var _this4 = this; + + var willDestroyCalled = 0; + + this.registerComponent('x-parent', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + layoutName: 'components/x-parent', + willDestroyElement: function () { + willDestroyCalled++; + } + }), + + template: '[parent: {{foo}}]{{#x-child bar=foo}}[yielded: {{foo}}]{{/x-child}}' + }); + + this.registerComponent('x-child', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '' + }), + + template: '[child: {{bar}}]{{yield}}' + }); + + var XParent = this.owner._lookupFactory('component:x-parent'); + + this.component = XParent.create({ foo: 'zomg' }); + + assert.ok(!this.component.element, 'precond - should not have an element'); + + this.element = this.append(this.component); + + var componentElement = this.component.element; + + this.assertComponentElement(componentElement, { content: '[parent: zomg][child: zomg][yielded: zomg]' }); + + assert.equal(componentElement.parentElement, this.element, 'It should be attached to the target'); + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assertComponentElement(componentElement, { content: '[parent: zomg][child: zomg][yielded: zomg]' }); + + assert.equal(componentElement.parentElement, this.element, 'It should be attached to the target'); + + this.runTask(function () { + return _emberMetal.set(_this4.component, 'foo', 'wow'); + }); + + this.assertComponentElement(componentElement, { content: '[parent: wow][child: wow][yielded: wow]' }); + + assert.equal(componentElement.parentElement, this.element, 'It should be attached to the target'); + + this.runTask(function () { + return _emberMetal.set(_this4.component, 'foo', 'zomg'); + }); + + this.assertComponentElement(componentElement, { content: '[parent: zomg][child: zomg][yielded: zomg]' }); + + assert.equal(componentElement.parentElement, this.element, 'It should be attached to the target'); + + this.runTask(function () { + return _this4.component.destroy(); + }); + + if (this.isHTMLBars) { + // Bug in Glimmer – component should not have .element at this point + assert.ok(!this.component.element, 'It should not have an element'); + } + + assert.ok(!componentElement.parentElement, 'The component element should be detached'); + + this.assert.equal(willDestroyCalled, 1); + }; + + AbstractAppendTest.prototype['@test appending, updating and destroying multiple components'] = function testAppendingUpdatingAndDestroyingMultipleComponents(assert) { + var _this5 = this; + + var willDestroyCalled = 0; + + this.registerComponent('x-first', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + layoutName: 'components/x-first', + + willDestroyElement: function () { + willDestroyCalled++; + } + }), + + template: 'x-first {{foo}}!' + }); + + this.registerComponent('x-second', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + layoutName: 'components/x-second', + + willDestroyElement: function () { + willDestroyCalled++; + } + }), + + template: 'x-second {{bar}}!' + }); + + var First = this.owner._lookupFactory('component:x-first'); + var Second = this.owner._lookupFactory('component:x-second'); + + var first = First.create({ foo: 'foo' }); + var second = Second.create({ bar: 'bar' }); + + this.assert.ok(!first.element, 'precond - should not have an element'); + this.assert.ok(!second.element, 'precond - should not have an element'); + + var wrapper1 = undefined, + wrapper2 = undefined; + + this.runTask(function () { + return wrapper1 = _this5.append(first); + }); + this.runTask(function () { + return wrapper2 = _this5.append(second); + }); + + var componentElement1 = first.element; + var componentElement2 = second.element; + + this.assertComponentElement(componentElement1, { content: 'x-first foo!' }); + this.assertComponentElement(componentElement2, { content: 'x-second bar!' }); + + assert.equal(componentElement1.parentElement, wrapper1, 'The first component should be attached to the target'); + assert.equal(componentElement2.parentElement, wrapper2, 'The second component should be attached to the target'); + + this.runTask(function () { + return _emberMetal.set(first, 'foo', 'FOO'); + }); + + this.assertComponentElement(componentElement1, { content: 'x-first FOO!' }); + this.assertComponentElement(componentElement2, { content: 'x-second bar!' }); + + assert.equal(componentElement1.parentElement, wrapper1, 'The first component should be attached to the target'); + assert.equal(componentElement2.parentElement, wrapper2, 'The second component should be attached to the target'); + + this.runTask(function () { + return _emberMetal.set(second, 'bar', 'BAR'); + }); + + this.assertComponentElement(componentElement1, { content: 'x-first FOO!' }); + this.assertComponentElement(componentElement2, { content: 'x-second BAR!' }); + + assert.equal(componentElement1.parentElement, wrapper1, 'The first component should be attached to the target'); + assert.equal(componentElement2.parentElement, wrapper2, 'The second component should be attached to the target'); + + this.runTask(function () { + _emberMetal.set(first, 'foo', 'foo'); + _emberMetal.set(second, 'bar', 'bar'); + }); + + this.assertComponentElement(componentElement1, { content: 'x-first foo!' }); + this.assertComponentElement(componentElement2, { content: 'x-second bar!' }); + + assert.equal(componentElement1.parentElement, wrapper1, 'The first component should be attached to the target'); + assert.equal(componentElement2.parentElement, wrapper2, 'The second component should be attached to the target'); + + this.runTask(function () { + first.destroy(); + second.destroy(); + }); + + if (this.isHTMLBars) { + // Bug in Glimmer – component should not have .element at this point + assert.ok(!first.element, 'The first component should not have an element'); + assert.ok(!second.element, 'The second component should not have an element'); + } + + assert.ok(!componentElement1.parentElement, 'The first component element should be detached'); + assert.ok(!componentElement2.parentElement, 'The second component element should be detached'); + + this.assert.equal(willDestroyCalled, 2); + }; + + AbstractAppendTest.prototype['@test can appendTo while rendering'] = function testCanAppendToWhileRendering(assert) { + var _this6 = this; + + var owner = this.owner; + + var append = function (component) { + return _this6.append(component); + }; + + var wrapper1 = undefined, + wrapper2 = undefined, + element1 = undefined, + element2 = undefined; + this.registerComponent('first-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + layout: _emberGlimmerTestsUtilsHelpers.compile('component-one'), + + didInsertElement: function () { + element1 = this.element; + var SecondComponent = owner._lookupFactory('component:second-component'); + + wrapper2 = append(SecondComponent.create()); + } + }) + }); + + this.registerComponent('second-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + layout: _emberGlimmerTestsUtilsHelpers.compile('component-two'), + + didInsertElement: function () { + element2 = this.element; + } + }) + }); + + var FirstComponent = this.owner._lookupFactory('component:first-component'); + + this.runTask(function () { + return wrapper1 = append(FirstComponent.create()); + }); + + this.assertComponentElement(element1, { content: 'component-one' }); + this.assertComponentElement(element2, { content: 'component-two' }); + }; + + AbstractAppendTest.prototype['@test can appendTo and remove while rendering'] = function testCanAppendToAndRemoveWhileRendering(assert) { + var _this7 = this; + + var owner = this.owner; + + var append = function (component) { + return _this7.append(component); + }; + + var element1 = undefined, + element2 = undefined, + element3 = undefined, + element4 = undefined, + component1 = undefined, + component2 = undefined; + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + layout: _emberGlimmerTestsUtilsHelpers.compile('foo-bar'), + + init: function () { + this._super.apply(this, arguments); + component1 = this; + }, + + didInsertElement: function () { + element1 = this.element; + var OtherRoot = owner._lookupFactory('component:other-root'); + + this._instance = OtherRoot.create({ + didInsertElement: function () { + element2 = this.element; + } + }); + + append(this._instance); + }, + + willDestroy: function () { + this._instance.destroy(); + } + }) + }); + + this.registerComponent('baz-qux', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + layout: _emberGlimmerTestsUtilsHelpers.compile('baz-qux'), + + init: function () { + this._super.apply(this, arguments); + component2 = this; + }, + + didInsertElement: function () { + element3 = this.element; + var OtherRoot = owner._lookupFactory('component:other-root'); + + this._instance = OtherRoot.create({ + didInsertElement: function () { + element4 = this.element; + } + }); + + append(this._instance); + }, + + willDestroy: function () { + this._instance.destroy(); + } + }) + }); + + var instantiatedRoots = 0; + var destroyedRoots = 0; + this.registerComponent('other-root', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + layout: _emberGlimmerTestsUtilsHelpers.compile('fake-thing: {{counter}}'), + init: function () { + this._super.apply(this, arguments); + this.counter = instantiatedRoots++; + }, + willDestroy: function () { + destroyedRoots++; + this._super.apply(this, arguments); + } + }) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { showFooBar: true }); + + this.assertComponentElement(element1, {}); + this.assertComponentElement(element2, { content: 'fake-thing: 0' }); + assert.equal(instantiatedRoots, 1); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'showFooBar', false); + }); + + assert.equal(instantiatedRoots, 2); + assert.equal(destroyedRoots, 1); + + this.assertComponentElement(element3, {}); + this.assertComponentElement(element4, { content: 'fake-thing: 1' }); + + this.runTask(function () { + component1.destroy(); + component2.destroy(); + }); + + assert.equal(instantiatedRoots, 2); + assert.equal(destroyedRoots, 2); + }; + + return AbstractAppendTest; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest); + + _emberGlimmerTestsUtilsTestCase.moduleFor('append: no arguments (attaching to document.body)', (function (_AbstractAppendTest) { +babelHelpers.inherits(_class, _AbstractAppendTest); + + function _class() { +babelHelpers.classCallCheck(this, _class); + + _AbstractAppendTest.apply(this, arguments); + } + + _class.prototype.append = function append(component) { + this.runTask(function () { + return component.append(); + }); + this.didAppend(component); + return document.body; + }; + + return _class; + })(AbstractAppendTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('appendTo: a selector', (function (_AbstractAppendTest2) { +babelHelpers.inherits(_class2, _AbstractAppendTest2); + + function _class2() { +babelHelpers.classCallCheck(this, _class2); + + _AbstractAppendTest2.apply(this, arguments); + } + + _class2.prototype.append = function append(component) { + this.runTask(function () { + return component.appendTo('#qunit-fixture'); + }); + this.didAppend(component); + return _emberViews.jQuery('#qunit-fixture')[0]; + }; + + _class2.prototype['@test raises an assertion when the target does not exist in the DOM'] = function testRaisesAnAssertionWhenTheTargetDoesNotExistInTheDOM(assert) { + var _this8 = this; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + layoutName: 'components/foo-bar' + }), + template: 'FOO BAR!' + }); + + var FooBar = this.owner._lookupFactory('component:foo-bar'); + + this.component = FooBar.create(); + + assert.ok(!this.component.element, 'precond - should not have an element'); + + this.runTask(function () { + expectAssertion(function () { + _this8.component.appendTo('#does-not-exist-in-dom'); + }, /You tried to append to \(#does-not-exist-in-dom\) but that isn't in the DOM/); + }); + + assert.ok(!this.component.element, 'component should not have an element'); + }; + + return _class2; + })(AbstractAppendTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('appendTo: an element', (function (_AbstractAppendTest3) { +babelHelpers.inherits(_class3, _AbstractAppendTest3); + + function _class3() { +babelHelpers.classCallCheck(this, _class3); + + _AbstractAppendTest3.apply(this, arguments); + } + + _class3.prototype.append = function append(component) { + var element = _emberViews.jQuery('#qunit-fixture')[0]; + this.runTask(function () { + return component.appendTo(element); + }); + this.didAppend(component); + return element; + }; + + return _class3; + })(AbstractAppendTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('appendTo: with multiple components', (function (_AbstractAppendTest4) { +babelHelpers.inherits(_class4, _AbstractAppendTest4); + + function _class4() { +babelHelpers.classCallCheck(this, _class4); + + _AbstractAppendTest4.apply(this, arguments); + } + + _class4.prototype.append = function append(component) { + this.runTask(function () { + return component.appendTo('#qunit-fixture'); + }); + this.didAppend(component); + return _emberViews.jQuery('#qunit-fixture')[0]; + }; + + return _class4; + })(AbstractAppendTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('renderToElement: no arguments (defaults to a body context)', (function (_AbstractAppendTest5) { +babelHelpers.inherits(_class5, _AbstractAppendTest5); + + function _class5() { +babelHelpers.classCallCheck(this, _class5); + + _AbstractAppendTest5.apply(this, arguments); + } + + _class5.prototype.append = function append(component) { + var wrapper = undefined; + + this.runTask(function () { + return wrapper = component.renderToElement(); + }); + this.didAppend(component); + + this.assert.equal(wrapper.tagName, 'BODY', 'wrapper is a body element'); + this.assert.notEqual(wrapper, document.body, 'wrapper is not document.body'); + this.assert.ok(!wrapper.parentNode, 'wrapper is detached'); + + return wrapper; + }; + + return _class5; + })(AbstractAppendTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('renderToElement: a div', (function (_AbstractAppendTest6) { +babelHelpers.inherits(_class6, _AbstractAppendTest6); + + function _class6() { +babelHelpers.classCallCheck(this, _class6); + + _AbstractAppendTest6.apply(this, arguments); + } + + _class6.prototype.append = function append(component) { + var wrapper = undefined; + + this.runTask(function () { + return wrapper = component.renderToElement('div'); + }); + this.didAppend(component); + + this.assert.equal(wrapper.tagName, 'DIV', 'wrapper is a body element'); + this.assert.ok(!wrapper.parentNode, 'wrapper is detached'); + + return wrapper; + }; + + return _class6; + })(AbstractAppendTest)); +}); +enifed('ember-glimmer/tests/integration/components/append-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/append-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/append-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/append-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/append-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/append-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/attribute-bindings-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberMetal) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{foo-bar hasFoo=true foo=foo hasBar=false bar=bar}}\n {{foo-bar hasFoo=false foo=foo hasBar=true bar=bar}}\n {{foo-bar hasFoo=true foo=foo hasBar=true bar=bar}}\n {{foo-bar hasFoo=false foo=foo hasBar=false bar=bar}}\n '], ['\n {{foo-bar hasFoo=true foo=foo hasBar=false bar=bar}}\n {{foo-bar hasFoo=false foo=foo hasBar=true bar=bar}}\n {{foo-bar hasFoo=true foo=foo hasBar=true bar=bar}}\n {{foo-bar hasFoo=false foo=foo hasBar=false bar=bar}}\n ']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Attribute bindings integration', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { +babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test it can have attribute bindings'] = function testItCanHaveAttributeBindings() { + var _this = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['foo:data-foo', 'bar:data-bar'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar foo=foo bar=bar}}', { foo: 'foo', bar: 'bar' }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'data-foo': 'foo', 'data-bar': 'bar' }, content: 'hello' }); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'data-foo': 'foo', 'data-bar': 'bar' }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this.context, 'foo', 'FOO'); + _emberMetal.set(_this.context, 'bar', undefined); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'data-foo': 'FOO' }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this.context, 'foo', 'foo'); + _emberMetal.set(_this.context, 'bar', 'bar'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'data-foo': 'foo', 'data-bar': 'bar' }, content: 'hello' }); + }; + + _class.prototype['@test it can have attribute bindings with attrs'] = function testItCanHaveAttributeBindingsWithAttrs() { + var _this2 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['attrs.foo:data-foo', 'attrs.baz.bar:data-bar'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar foo=model.foo baz=model.baz}}', { + model: { foo: undefined, baz: { bar: 'bar' } } + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'data-bar': 'bar' } }); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'data-bar': 'bar' } }); + + this.runTask(function () { + _emberMetal.set(_this2.context, 'model.foo', 'foo'); + _emberMetal.set(_this2.context, 'model.baz.bar', undefined); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'data-foo': 'foo' }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'model', { + foo: undefined, baz: { bar: 'bar' } + }); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'data-bar': 'bar' } }); + }; + + _class.prototype['@test it can have attribute bindings with a nested path'] = function testItCanHaveAttributeBindingsWithANestedPath() { + var _this3 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['foo.bar:data-foo-bar'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar foo=foo}}', { foo: { bar: 'foo-bar' } }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'data-foo-bar': 'foo-bar' }, content: 'hello' }); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'data-foo-bar': 'foo-bar' }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'foo.bar', 'FOO-BAR'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'data-foo-bar': 'FOO-BAR' }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'foo.bar', undefined); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: {}, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'foo', undefined); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: {}, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'foo', { bar: 'foo-bar' }); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'data-foo-bar': 'foo-bar' }, content: 'hello' }); + }; + + _class.prototype['@test handles non-microsyntax attributeBindings'] = function testHandlesNonMicrosyntaxAttributeBindings() { + var _this4 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['type'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar type=submit}}', { + submit: 'submit' + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { type: 'submit' }, content: 'hello' }); + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { type: 'submit' }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'submit', 'password'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { type: 'password' }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'submit', null); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: {}, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'submit', 'submit'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { type: 'submit' }, content: 'hello' }); + }; + + _class.prototype['@test non-microsyntax attributeBindings cannot contain nested paths'] = function testNonMicrosyntaxAttributeBindingsCannotContainNestedPaths() { + var _this5 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['foo.bar'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + expectAssertion(function () { + _this5.render('{{foo-bar foo=foo}}', { foo: { bar: 'foo-bar' } }); + }, /Illegal attributeBinding: 'foo.bar' is not a valid attribute name./); + }; + + _class.prototype['@test normalizes attributeBindings for property names'] = function testNormalizesAttributeBindingsForPropertyNames() { + var _this6 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['tiTLe'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar tiTLe=name}}', { + name: 'qux' + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { title: 'qux' }, content: 'hello' }); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'name', null); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: {}, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'name', 'qux'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { title: 'qux' }, content: 'hello' }); + }; + + _class.prototype['@test normalizes attributeBindings for attribute names'] = function testNormalizesAttributeBindingsForAttributeNames() { + var _this7 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['foo:data-FOO'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar foo=foo}}', { + foo: 'qux' + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'data-foo': 'qux' }, content: 'hello' }); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'foo', null); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: {}, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'foo', 'qux'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'data-foo': 'qux' }, content: 'hello' }); + }; + + _class.prototype['@test attributeBindings handles null/undefined'] = function testAttributeBindingsHandlesNullUndefined() { + var _this8 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['fizz', 'bar'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar fizz=fizz bar=bar}}', { + fizz: null, + bar: undefined + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: {}, content: 'hello' }); + + this.runTask(function () { + return _this8.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: {}, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this8.context, 'fizz', 'fizz'); + _emberMetal.set(_this8.context, 'bar', 'bar'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { fizz: 'fizz', bar: 'bar' }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this8.context, 'fizz', null); + _emberMetal.set(_this8.context, 'bar', undefined); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: {}, content: 'hello' }); + }; + + _class.prototype['@test attributeBindings handles number value'] = function testAttributeBindingsHandlesNumberValue() { + var _this9 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['size'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar size=size}}', { + size: 21 + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { size: '21' }, content: 'hello' }); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { size: '21' }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'size', 0); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { size: '0' }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'size', 21); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { size: '21' }, content: 'hello' }); + }; + + _class.prototype['@test handles internal and external changes'] = function testHandlesInternalAndExternalChanges() { + var _this10 = this; + + var component = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['type'], + type: 'password', + init: function () { + this._super.apply(this, arguments); + component = this; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar}}'); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { type: 'password' }, content: 'hello' }); + + this.runTask(function () { + return _this10.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { type: 'password' }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(component, 'type', 'checkbox'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { type: 'checkbox' }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(component, 'type', 'password'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { type: 'password' }, content: 'hello' }); + }; + + _class.prototype['@test can set attributeBindings on component with a different tagName'] = function testCanSetAttributeBindingsOnComponentWithADifferentTagName() { + var _this11 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'input', + attributeBindings: ['type', 'isDisabled:disabled'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent }); + + this.render('{{foo-bar type=type isDisabled=disabled}}', { + type: 'password', + disabled: false + }); + + this.assertComponentElement(this.firstChild, { tagName: 'input', attrs: { type: 'password' } }); + + this.runTask(function () { + return _this11.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'input', attrs: { type: 'password' } }); + + this.runTask(function () { + _emberMetal.set(_this11.context, 'type', 'checkbox'); + _emberMetal.set(_this11.context, 'disabled', true); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'input', attrs: { type: 'checkbox', disabled: '' } }); + + this.runTask(function () { + _emberMetal.set(_this11.context, 'type', 'password'); + _emberMetal.set(_this11.context, 'disabled', false); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'input', attrs: { type: 'password' } }); + }; + + _class.prototype['@test should allow namespaced attributes in micro syntax'] = function testShouldAllowNamespacedAttributesInMicroSyntax() { + var _this12 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['xlinkHref:xlink:href'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent }); + + this.render('{{foo-bar type=type xlinkHref=xlinkHref}}', { + xlinkHref: '/foo.png' + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'xlink:href': '/foo.png' } }); + + this.runTask(function () { + return _this12.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'xlink:href': '/foo.png' } }); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'xlinkHref', '/lol.png'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'xlink:href': '/lol.png' } }); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'xlinkHref', '/foo.png'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'xlink:href': '/foo.png' } }); + }; + + // This comes into play when using the {{#each}} helper. If the + // passed array item is a String, it will be converted into a + // String object instead of a normal string. + + _class.prototype['@test should allow for String objects'] = function testShouldAllowForStringObjects() { + var _this13 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['foo'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent }); + + this.render('{{foo-bar foo=foo}}', { + foo: (function () { + return this; + }).call('bar') + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'foo': 'bar' } }); + + this.runTask(function () { + return _this13.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'foo': 'bar' } }); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'foo', (function () { + return this; + }).call('baz')); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'foo': 'baz' } }); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'foo', (function () { + return this; + }).call('bar')); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'foo': 'bar' } }); + }; + + _class.prototype['@test can set id initially via attributeBindings '] = function testCanSetIdInitiallyViaAttributeBindings() { + var _this14 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['specialSauce:id'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent }); + + this.render('{{foo-bar specialSauce=sauce}}', { + sauce: 'special-sauce' + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'id': 'special-sauce' } }); + + this.runTask(function () { + return _this14.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'id': 'special-sauce' } }); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'sauce', 'foo'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'id': 'special-sauce' } }); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'sauce', 'special-sauce'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'id': 'special-sauce' } }); + }; + + _class.prototype['@test attributeBindings are overwritten'] = function testAttributeBindingsAreOverwritten() { + var _this15 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['href'], + href: 'a href' + }); + + var FizzBarComponent = FooBarComponent.extend({ + attributeBindings: ['newHref:href'] + }); + + this.registerComponent('fizz-bar', { ComponentClass: FizzBarComponent }); + + this.render('{{fizz-bar newHref=href}}', { + href: 'dog.html' + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { href: 'dog.html' } }); + + this.runTask(function () { + return _this15.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { href: 'dog.html' } }); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'href', 'cat.html'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { href: 'cat.html' } }); + }; + + _class.prototype['@test it can set attribute bindings in the constructor'] = function testItCanSetAttributeBindingsInTheConstructor() { + var _this16 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + + var bindings = []; + + if (this.get('hasFoo')) { + bindings.push('foo:data-foo'); + } + + if (this.get('hasBar')) { + bindings.push('bar:data-bar'); + } + + this.attributeBindings = bindings; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { foo: 'foo', bar: 'bar' }); + + this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'data-foo': 'foo' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: { 'data-bar': 'bar' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'data-foo': 'foo', 'data-bar': 'bar' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(3), { tagName: 'div', attrs: {}, content: 'hello' }); + + this.runTask(function () { + return _this16.rerender(); + }); + + this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'data-foo': 'foo' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: { 'data-bar': 'bar' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'data-foo': 'foo', 'data-bar': 'bar' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(3), { tagName: 'div', attrs: {}, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this16.context, 'foo', 'FOO'); + _emberMetal.set(_this16.context, 'bar', undefined); + }); + + this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'data-foo': 'FOO' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: {}, content: 'hello' }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'data-foo': 'FOO' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(3), { tagName: 'div', attrs: {}, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this16.context, 'bar', 'BAR'); + }); + + this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'data-foo': 'FOO' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: { 'data-bar': 'BAR' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'data-foo': 'FOO', 'data-bar': 'BAR' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(3), { tagName: 'div', attrs: {}, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this16.context, 'foo', 'foo'); + _emberMetal.set(_this16.context, 'bar', 'bar'); + }); + + this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'data-foo': 'foo' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: { 'data-bar': 'bar' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'data-foo': 'foo', 'data-bar': 'bar' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(3), { tagName: 'div', attrs: {}, content: 'hello' }); + }; + + _class.prototype['@test it should not allow attributeBindings to be set'] = function testItShouldNotAllowAttributeBindingsToBeSet() { + var _this17 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + expectAssertion(function () { + _this17.render('{{foo-bar attributeBindings="one two"}}'); + }, /Setting 'attributeBindings' via template helpers is not allowed/); + }; + + _class.prototype['@test asserts if an attributeBinding is setup on class'] = function testAssertsIfAnAttributeBindingIsSetupOnClass() { + var _this18 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['class'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + expectAssertion(function () { + _this18.render('{{foo-bar}}'); + }, /You cannot use class as an attributeBinding, use classNameBindings instead./i); + }; + + _class.prototype['@test blacklists href bindings based on protocol'] = function testBlacklistsHrefBindingsBasedOnProtocol() { + /* jshint scripturl:true */ + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'a', + attributeBindings: ['href'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar href=xss}}', { + xss: 'javascript:alert(\'foo\')' + }); + + this.assertComponentElement(this.firstChild, { tagName: 'a', attrs: { href: 'unsafe:javascript:alert(\'foo\')' } }); + }; + + _class.prototype['@test it can bind the role attribute (issue #14007)'] = function testItCanBindTheRoleAttributeIssue14007() { + var _this19 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ attributeBindings: ['role'] }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar role=role}}', { role: 'button' }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { role: 'button' } }); + + this.runTask(function () { + return _this19.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { role: 'button' } }); + + this.runTask(function () { + return _emberMetal.set(_this19.context, 'role', 'combobox'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { role: 'combobox' } }); + + this.runTask(function () { + return _emberMetal.set(_this19.context, 'role', null); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div' }); + }; + + _class.prototype['@test component with an `id` attribute binding of undefined'] = function testComponentWithAnIdAttributeBindingOfUndefined() { + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['id'], + + id: undefined + }) + }); + + this.registerComponent('baz-qux', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['somethingUndefined:id'], + + somethingUndefined: undefined + }) + }); + this.render('{{foo-bar}}{{baz-qux}}'); + + this.assertComponentElement(this.nthChild(0), { content: '' }); + this.assertComponentElement(this.nthChild(1), { content: '' }); + + this.assert.ok(this.nthChild(0).id.match(/ember\d+/), 'a valid `id` was used'); + this.assert.ok(this.nthChild(1).id.match(/ember\d+/), 'a valid `id` was used'); + }; + + _class.prototype['@test component with an `id` attribute binding of null'] = function testComponentWithAnIdAttributeBindingOfNull() { + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['id'], + + id: null + }) + }); + + this.registerComponent('baz-qux', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['somethingNull:id'], + + somethingNull: null + }) + }); + this.render('{{foo-bar}}{{baz-qux}}'); + + this.assertComponentElement(this.nthChild(0), { content: '' }); + this.assertComponentElement(this.nthChild(1), { content: '' }); + + this.assert.ok(this.nthChild(0).id.match(/ember\d+/), 'a valid `id` was used'); + this.assert.ok(this.nthChild(1).id.match(/ember\d+/), 'a valid `id` was used'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/components/attribute-bindings-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/attribute-bindings-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/attribute-bindings-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/attribute-bindings-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/attribute-bindings-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/attribute-bindings-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/attrs-lookup-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal', 'ember-glimmer/tests/utils/test-helpers'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal, _emberGlimmerTestsUtilsTestHelpers) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: attrs lookup', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test it should be able to lookup attrs without `attrs.` - template access'] = function testItShouldBeAbleToLookupAttrsWithoutAttrsTemplateAccess() { + var _this = this; + + this.registerComponent('foo-bar', { template: '{{first}}' }); + + this.render('{{foo-bar first=firstAttr}}', { + firstAttr: 'first attr' + }); + + this.assertText('first attr'); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertText('first attr'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'firstAttr', 'second attr'); + }); + + this.assertText('second attr'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'firstAttr', 'first attr'); + }); + + this.assertText('first attr'); + }; + + _class.prototype['@test it should be able to lookup attrs without `attrs.` - component access'] = function testItShouldBeAbleToLookupAttrsWithoutAttrsComponentAccess(assert) { + var _this2 = this; + + var instance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + instance = this; + } + }); + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '{{first}}' }); + + this.render('{{foo-bar first=firstAttr}}', { + firstAttr: 'first attr' + }); + + assert.equal(instance.get('first'), 'first attr'); + + this.runTask(function () { + return _this2.rerender(); + }); + + assert.equal(instance.get('first'), 'first attr'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'firstAttr', 'second attr'); + }); + + assert.equal(instance.get('first'), 'second attr'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'firstAttr', 'first attr'); + }); + + this.assertText('first attr'); + }; + + _class.prototype['@test should be able to modify a provided attr into local state #11571 / #11559'] = function testShouldBeAbleToModifyAProvidedAttrIntoLocalState1157111559(assert) { + var _this3 = this; + + var instance = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + instance = this; + }, + + didReceiveAttrs: function () { + this.set('first', this.get('first').toUpperCase()); + } + }); + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '{{first}}' }); + + this.render('{{foo-bar first="first attr"}}'); + + assert.equal(instance.get('first'), 'FIRST ATTR', 'component lookup uses local state'); + this.assertText('FIRST ATTR'); + + this.runTask(function () { + return _this3.rerender(); + }); + + assert.equal(instance.get('first'), 'FIRST ATTR', 'component lookup uses local state during rerender'); + this.assertText('FIRST ATTR'); + + // This is testing that passing string literals for use as initial values, + // so there is no update step + }; + + _class.prototype['@test should be able to access unspecified attr #12035'] = function testShouldBeAbleToAccessUnspecifiedAttr12035(assert) { + var _this4 = this; + + var instance = undefined; + var wootVal = 'yes'; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + instance = this; + }, + + didReceiveAttrs: function () { + assert.equal(this.get('woot'), wootVal, 'found attr in didReceiveAttrs'); + } + }); + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent }); + + this.render('{{foo-bar woot=woot}}', { + woot: wootVal + }); + + assert.equal(instance.get('woot'), 'yes', 'component found attr'); + + this.runTask(function () { + return _this4.rerender(); + }); + + assert.equal(instance.get('woot'), 'yes', 'component found attr after rerender'); + + this.runTask(function () { + wootVal = 'nope'; + _emberMetal.set(_this4.context, 'woot', wootVal); + }); + + assert.equal(instance.get('woot'), 'nope', 'component found attr after attr change'); + + this.runTask(function () { + wootVal = 'yes'; + _emberMetal.set(_this4.context, 'woot', wootVal); + }); + + assert.equal(instance.get('woot'), 'yes', 'component found attr after reset'); + }; + + _class.prototype['@test getAttr() should return the same value as get()'] = function testGetAttrShouldReturnTheSameValueAsGet(assert) { + var _this5 = this; + + assert.expect(33); + + var instance = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + instance = this; + }, + + didReceiveAttrs: function () { + var rootFirstPositional = this.get('firstPositional'); + var rootFirst = this.get('first'); + var rootSecond = this.get('second'); + var attrFirstPositional = this.getAttr('firstPositional'); + var attrFirst = this.getAttr('first'); + var attrSecond = this.getAttr('second'); + + equal(rootFirstPositional, attrFirstPositional, 'root property matches attrs value'); + equal(rootFirst, attrFirst, 'root property matches attrs value'); + equal(rootSecond, attrSecond, 'root property matches attrs value'); + } + }); + + FooBarComponent.reopenClass({ + positionalParams: ['firstPositional'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent }); + + this.render('{{foo-bar firstPositional first=first second=second}}', { + firstPositional: 'firstPositional', + first: 'first', + second: 'second' + }); + + assert.equal(instance.get('firstPositional'), 'firstPositional', 'matches known value'); + assert.equal(instance.get('first'), 'first', 'matches known value'); + assert.equal(instance.get('second'), 'second', 'matches known value'); + + this.runTask(function () { + return _this5.rerender(); + }); + + assert.equal(instance.get('firstPositional'), 'firstPositional', 'matches known value'); + assert.equal(instance.get('first'), 'first', 'matches known value'); + assert.equal(instance.get('second'), 'second', 'matches known value'); + + this.runTask(function () { + _emberMetal.set(_this5.context, 'first', 'third'); + }); + + assert.equal(instance.get('firstPositional'), 'firstPositional', 'matches known value'); + assert.equal(instance.get('first'), 'third', 'matches known value'); + assert.equal(instance.get('second'), 'second', 'matches known value'); + + this.runTask(function () { + _emberMetal.set(_this5.context, 'second', 'fourth'); + }); + + assert.equal(instance.get('firstPositional'), 'firstPositional', 'matches known value'); + assert.equal(instance.get('first'), 'third', 'matches known value'); + assert.equal(instance.get('second'), 'fourth', 'matches known value'); + + this.runTask(function () { + _emberMetal.set(_this5.context, 'firstPositional', 'fifth'); + }); + + assert.equal(instance.get('firstPositional'), 'fifth', 'matches known value'); + assert.equal(instance.get('first'), 'third', 'matches known value'); + assert.equal(instance.get('second'), 'fourth', 'matches known value'); + + this.runTask(function () { + _emberMetal.set(_this5.context, 'firstPositional', 'firstPositional'); + _emberMetal.set(_this5.context, 'first', 'first'); + _emberMetal.set(_this5.context, 'second', 'second'); + }); + + assert.equal(instance.get('firstPositional'), 'firstPositional', 'matches known value'); + assert.equal(instance.get('first'), 'first', 'matches known value'); + assert.equal(instance.get('second'), 'second', 'matches known value'); + }; + + _class.prototype['@test bound computed properties can be overriden in extensions, set during init, and passed in as attrs'] = function testBoundComputedPropertiesCanBeOverridenInExtensionsSetDuringInitAndPassedInAsAttrs() { + var FooClass = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['style'], + style: _emberMetal.computed('height', 'color', function () { + var height = this.get('height'); + var color = this.get('color'); + return 'height: ' + height + 'px; background-color: ' + color + ';'; + }), + color: 'red', + height: 20 + }); + + var BarClass = FooClass.extend({ + init: function () { + this._super.apply(this, arguments); + this.height = 150; + }, + color: 'yellow' + }); + + this.registerComponent('x-foo', { ComponentClass: FooClass }); + this.registerComponent('x-bar', { ComponentClass: BarClass }); + + this.render('{{x-foo}}{{x-bar}}{{x-bar color="green"}}'); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { style: _emberGlimmerTestsUtilsTestHelpers.styles('height: 20px; background-color: red;') } }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: { style: _emberGlimmerTestsUtilsTestHelpers.styles('height: 150px; background-color: yellow;') } }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { style: _emberGlimmerTestsUtilsTestHelpers.styles('height: 150px; background-color: green;') } }); + + this.assertStableRerender(); + + // No U-R + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/components/attrs-lookup-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/attrs-lookup-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/attrs-lookup-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/attrs-lookup-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/attrs-lookup-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/attrs-lookup-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/class-bindings-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/test-helpers', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsTestHelpers, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{foo-bar foo=foo bindIsEnabled=true isEnabled=isEnabled bindIsHappy=false isHappy=isHappy}}\n {{foo-bar foo=foo bindIsEnabled=false isEnabled=isEnabled bindIsHappy=true isHappy=isHappy}}\n {{foo-bar foo=foo bindIsEnabled=true isEnabled=isEnabled bindIsHappy=true isHappy=isHappy}}\n {{foo-bar foo=foo bindIsEnabled=false isEnabled=isEnabled bindIsHappy=false isHappy=isHappy}}\n '], ['\n {{foo-bar foo=foo bindIsEnabled=true isEnabled=isEnabled bindIsHappy=false isHappy=isHappy}}\n {{foo-bar foo=foo bindIsEnabled=false isEnabled=isEnabled bindIsHappy=true isHappy=isHappy}}\n {{foo-bar foo=foo bindIsEnabled=true isEnabled=isEnabled bindIsHappy=true isHappy=isHappy}}\n {{foo-bar foo=foo bindIsEnabled=false isEnabled=isEnabled bindIsHappy=false isHappy=isHappy}}\n ']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('ClassNameBindings integration', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { +babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test it can have class name bindings on the class definition'] = function testItCanHaveClassNameBindingsOnTheClassDefinition() { + var _this = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNameBindings: ['foo', 'isEnabled:enabled', 'isHappy:happy:sad'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar foo=foo isEnabled=isEnabled isHappy=isHappy}}', { foo: 'foo', isEnabled: true, isHappy: false }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo enabled sad') }, content: 'hello' }); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo enabled sad') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this.context, 'foo', 'FOO'); + _emberMetal.set(_this.context, 'isEnabled', false); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view FOO sad') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this.context, 'foo', undefined); + _emberMetal.set(_this.context, 'isHappy', true); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view happy') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this.context, 'foo', 'foo'); + _emberMetal.set(_this.context, 'isEnabled', true); + _emberMetal.set(_this.context, 'isHappy', false); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo enabled sad') }, content: 'hello' }); + }; + + _class.prototype['@test attrs in classNameBindings'] = function testAttrsInClassNameBindings() { + var _this2 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNameBindings: ['attrs.joker:purple:green', 'attrs.batman.robin:black:red'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar joker=model.wat batman=model.super}}', { + model: { wat: false, super: { robin: true } } + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view green black') }, content: 'hello' }); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view green black') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this2.context, 'model.wat', true); + _emberMetal.set(_this2.context, 'model.super.robin', false); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view purple red') }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'model', { + wat: false, super: { robin: true } + }); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view green black') }, content: 'hello' }); + }; + + _class.prototype['@test it can have class name bindings in the template'] = function testItCanHaveClassNameBindingsInTheTemplate() { + var _this3 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar classNameBindings="model.someInitiallyTrueProperty model.someInitiallyFalseProperty model.someInitiallyUndefinedProperty :static model.isBig:big model.isOpen:open:closed model.isUp::down model.bar:isTruthy:isFalsy"}}', { + model: { + someInitiallyTrueProperty: true, + someInitiallyFalseProperty: false, + isBig: true, + isOpen: false, + isUp: true, + bar: true + } + }); + + this.assertComponentElement(this.firstChild, { + attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view some-initially-true-property static big closed isTruthy') }, + content: 'hello' + }); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertComponentElement(this.firstChild, { + attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view some-initially-true-property static big closed isTruthy') }, + content: 'hello' + }); + + this.runTask(function () { + _emberMetal.set(_this3.context, 'model.someInitiallyTrueProperty', false); + _emberMetal.set(_this3.context, 'model.someInitiallyFalseProperty', true); + _emberMetal.set(_this3.context, 'model.someInitiallyUndefinedProperty', true); + _emberMetal.set(_this3.context, 'model.isBig', false); + _emberMetal.set(_this3.context, 'model.isOpen', true); + _emberMetal.set(_this3.context, 'model.isUp', false); + _emberMetal.set(_this3.context, 'model.bar', false); + }); + + this.assertComponentElement(this.firstChild, { + attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view some-initially-false-property some-initially-undefined-property static open down isFalsy') }, + content: 'hello' + }); + + this.runTask(function () { + _emberMetal.set(_this3.context, 'model', { + someInitiallyTrueProperty: true, + someInitiallyFalseProperty: false, + someInitiallyUndefinedProperty: undefined, + isBig: true, + isOpen: false, + isUp: true, + bar: true + }); + }); + + this.assertComponentElement(this.firstChild, { + attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view some-initially-true-property static big closed isTruthy') }, + content: 'hello' + }); + }; + + _class.prototype['@test it can have class name bindings with nested paths'] = function testItCanHaveClassNameBindingsWithNestedPaths() { + var _this4 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNameBindings: ['foo.bar', 'is.enabled:enabled', 'is.happy:happy:sad'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar foo=foo is=is}}', { foo: { bar: 'foo-bar' }, is: { enabled: true, happy: false } }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar enabled sad') }, content: 'hello' }); + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar enabled sad') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this4.context, 'foo.bar', 'FOO-BAR'); + _emberMetal.set(_this4.context, 'is.enabled', false); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view FOO-BAR sad') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this4.context, 'foo.bar', null); + _emberMetal.set(_this4.context, 'is.happy', true); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view happy') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this4.context, 'foo', null); + _emberMetal.set(_this4.context, 'is', null); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view sad') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this4.context, 'foo', { bar: 'foo-bar' }); + _emberMetal.set(_this4.context, 'is', { enabled: true, happy: false }); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar enabled sad') }, content: 'hello' }); + }; + + _class.prototype['@test it should dasherize the path when the it resolves to true'] = function testItShouldDasherizeThePathWhenTheItResolvesToTrue() { + var _this5 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNameBindings: ['fooBar', 'nested.fooBarBaz'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar fooBar=fooBar nested=nested}}', { fooBar: true, nested: { fooBarBaz: false } }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar') }, content: 'hello' }); + + this.runTask(function () { + return _this5.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this5.context, 'fooBar', false); + _emberMetal.set(_this5.context, 'nested.fooBarBaz', true); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar-baz') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this5.context, 'fooBar', 'FOO-BAR'); + _emberMetal.set(_this5.context, 'nested.fooBarBaz', null); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view FOO-BAR') }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'nested', null); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view FOO-BAR') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this5.context, 'fooBar', true); + _emberMetal.set(_this5.context, 'nested', { fooBarBaz: false }); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar') }, content: 'hello' }); + }; + + _class.prototype['@test const bindings can be set as attrs'] = function testConstBindingsCanBeSetAsAttrs() { + var _this6 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + this.render('{{foo-bar classNameBindings="foo:enabled:disabled"}}', { + foo: true + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view enabled') }, content: 'hello' }); + + this.runTask(function () { + return _this6.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view enabled') }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'foo', false); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view disabled') }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'foo', true); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view enabled') }, content: 'hello' }); + }; + + _class.prototype['@test :: class name syntax works with an empty true class'] = function testClassNameSyntaxWorksWithAnEmptyTrueClass() { + var _this7 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNameBindings: ['isEnabled::not-enabled'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar isEnabled=enabled}}', { + enabled: false + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view not-enabled') }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'enabled', true); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'enabled', false); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view not-enabled') }, content: 'hello' }); + }; + + _class.prototype['@test uses all provided static class names (issue #11193)'] = function testUsesAllProvidedStaticClassNamesIssue11193() { + var _this8 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNameBindings: [':class-one', ':class-two'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar}}', { + enabled: false + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view class-one class-two') }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this8.context, 'enabled', true); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view class-one class-two') }, content: 'hello' }); + }; + + _class.prototype['@test Providing a binding with a space in it asserts'] = function testProvidingABindingWithASpaceInItAsserts() { + var _this9 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNameBindings: 'i:think:i am:so:clever' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + expectAssertion(function () { + _this9.render('{{foo-bar}}'); + }, /classNameBindings must not have spaces in them/i); + }; + + _class.prototype['@test it can set class name bindings in the constructor'] = function testItCanSetClassNameBindingsInTheConstructor() { + var _this10 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNameBindings: ['foo'], + + init: function () { + this._super(); + + var bindings = this.classNameBindings; + + if (this.get('bindIsEnabled')) { + bindings.push('isEnabled:enabled'); + } + + if (this.get('bindIsHappy')) { + bindings.push('isHappy:happy:sad'); + } + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { foo: 'foo', isEnabled: true, isHappy: false }); + + this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo enabled') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo sad') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo enabled sad') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(3), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo') }, content: 'hello' }); + + this.runTask(function () { + return _this10.rerender(); + }); + + this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo enabled') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo sad') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo enabled sad') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(3), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this10.context, 'foo', 'FOO'); + _emberMetal.set(_this10.context, 'isEnabled', false); + }); + + this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view FOO') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view FOO sad') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view FOO sad') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(3), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view FOO') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this10.context, 'foo', undefined); + _emberMetal.set(_this10.context, 'isHappy', true); + }); + + this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view happy') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view happy') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(3), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this10.context, 'foo', 'foo'); + _emberMetal.set(_this10.context, 'isEnabled', true); + _emberMetal.set(_this10.context, 'isHappy', false); + }); + + this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo enabled') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo sad') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo enabled sad') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(3), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo') }, content: 'hello' }); + }; + + _class.prototype['@test using a computed property for classNameBindings triggers an assertion'] = function testUsingAComputedPropertyForClassNameBindingsTriggersAnAssertion() { + var _this11 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNameBindings: _emberMetal.computed(function () { + return ['isHappy:happy:sad']; + }) + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + expectAssertion(function () { + _this11.render('{{foo-bar}}'); + }, /Only arrays are allowed/); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('ClassBinding integration', (function (_RenderingTest2) { +babelHelpers.inherits(_class2, _RenderingTest2); + + function _class2() { +babelHelpers.classCallCheck(this, _class2); + + _RenderingTest2.apply(this, arguments); + } + + _class2.prototype['@test it should apply classBinding without condition always'] = function testItShouldApplyClassBindingWithoutConditionAlways() { + var _this12 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar classBinding=":foo"}}'); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo ember-view') } }); + + this.runTask(function () { + return _this12.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo ember-view') } }); + }; + + _class2.prototype['@test it should merge classBinding with class'] = function testItShouldMergeClassBindingWithClass() { + var _this13 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar classBinding="birdman:respeck" class="myName"}}', { birdman: true }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('respeck myName ember-view') } }); + + this.runTask(function () { + return _this13.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('respeck myName ember-view') } }); + }; + + _class2.prototype['@test it should apply classBinding with only truthy condition'] = function testItShouldApplyClassBindingWithOnlyTruthyCondition() { + var _this14 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar classBinding="myName:respeck"}}', { myName: true }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('respeck ember-view') } }); + + this.runTask(function () { + return _this14.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('respeck ember-view') } }); + }; + + _class2.prototype['@test it should apply classBinding with only falsy condition'] = function testItShouldApplyClassBindingWithOnlyFalsyCondition() { + var _this15 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar classBinding="myName::shade"}}', { myName: false }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('shade ember-view') } }); + + this.runTask(function () { + return _this15.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('shade ember-view') } }); + }; + + _class2.prototype['@test it should apply nothing when classBinding is falsy but only supplies truthy class'] = function testItShouldApplyNothingWhenClassBindingIsFalsyButOnlySuppliesTruthyClass() { + var _this16 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar classBinding="myName:respeck"}}', { myName: false }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') } }); + + this.runTask(function () { + return _this16.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') } }); + }; + + _class2.prototype['@test it should apply nothing when classBinding is truthy but only supplies falsy class'] = function testItShouldApplyNothingWhenClassBindingIsTruthyButOnlySuppliesFalsyClass() { + var _this17 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar classBinding="myName::shade"}}', { myName: true }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') } }); + + this.runTask(function () { + return _this17.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') } }); + }; + + _class2.prototype['@test it should apply classBinding with falsy condition'] = function testItShouldApplyClassBindingWithFalsyCondition() { + var _this18 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar classBinding="swag:fresh:scrub"}}', { swag: false }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('scrub ember-view') } }); + + this.runTask(function () { + return _this18.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('scrub ember-view') } }); + }; + + _class2.prototype['@test it should apply classBinding with truthy condition'] = function testItShouldApplyClassBindingWithTruthyCondition() { + var _this19 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar classBinding="swag:fresh:scrub"}}', { swag: true }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('fresh ember-view') } }); + + this.runTask(function () { + return _this19.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('fresh ember-view') } }); + }; + + return _class2; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/components/class-bindings-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/class-bindings-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/class-bindings-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/class-bindings-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/class-bindings-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/class-bindings-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/closure-components-test', ['exports', 'ember-utils', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-metal'], function (exports, _emberUtils, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberMetal) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{component (component "-looked-up") "Hodari" greeting="Hodi"}}'], ['\n {{component (component "-looked-up") "Hodari" greeting="Hodi"}}']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n {{component (component "-looked-up" "Hodari" greeting="Hodi")\n greeting="Hola"}}'], ['\n {{component (component "-looked-up" "Hodari" greeting="Hodi")\n greeting="Hola"}}']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with (hash comp=(component "-looked-up" greeting=model.greeting)) as |my|}}\n {{#my.comp}}{{/my.comp}}\n {{/with}}'], ['\n {{#with (hash comp=(component "-looked-up" greeting=model.greeting)) as |my|}}\n {{#my.comp}}{{/my.comp}}\n {{/with}}']), + _templateObject4 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with (component "-looked-up" greeting="Hola" name="Dolores" age=33) as |first|}}\n {{#with (component first greeting="Hej" name="Sigmundur") as |second|}}\n {{component second greeting=model.greeting}}\n {{/with}}\n {{/with}}'], ['\n {{#with (component "-looked-up" greeting="Hola" name="Dolores" age=33) as |first|}}\n {{#with (component first greeting="Hej" name="Sigmundur") as |second|}}\n {{component second greeting=model.greeting}}\n {{/with}}\n {{/with}}']), + _templateObject5 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with (hash lookedup=(component "-looked-up")) as |object|}}\n {{object.lookedup}}\n {{/with}}'], ['\n {{#with (hash lookedup=(component "-looked-up")) as |object|}}\n {{object.lookedup}}\n {{/with}}']), + _templateObject6 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with (hash lookedup=(component "-looked-up")) as |object|}}\n {{object.lookedup expectedText=model.expectedText}}\n {{/with}}'], ['\n {{#with (hash lookedup=(component "-looked-up")) as |object|}}\n {{object.lookedup expectedText=model.expectedText}}\n {{/with}}']), + _templateObject7 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with (hash lookedup=(component "-looked-up" expectedText=model.expectedText)) as |object|}}\n {{object.lookedup}}\n {{/with}}'], ['\n {{#with (hash lookedup=(component "-looked-up" expectedText=model.expectedText)) as |object|}}\n {{object.lookedup}}\n {{/with}}']), + _templateObject8 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with (hash lookedup=(component "-looked-up")) as |object|}}\n {{object.lookedup model.expectedText "Hola"}}\n {{/with}}'], ['\n {{#with (hash lookedup=(component "-looked-up")) as |object|}}\n {{object.lookedup model.expectedText "Hola"}}\n {{/with}}']), + _templateObject9 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with (hash my-component=(component \'my-component\' first)) as |c|}}\n {{c.my-component}}\n {{/with}}'], ['\n {{#with (hash my-component=(component \'my-component\' first)) as |c|}}\n {{c.my-component}}\n {{/with}}']), + _templateObject10 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#my-component my-attr=myProp as |api|}}\n {{api.my-nested-component}}\n {{/my-component}}\n
\n '], ['\n {{#my-component my-attr=myProp as |api|}}\n {{api.my-nested-component}}\n {{/my-component}}\n
\n ']), + _templateObject11 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#select-box as |sb|}}\n {{sb.option label="Foo"}}\n {{sb.option}}\n {{/select-box}}'], ['\n {{#select-box as |sb|}}\n {{sb.option label="Foo"}}\n {{sb.option}}\n {{/select-box}}']), + _templateObject12 = babelHelpers.taggedTemplateLiteralLoose(['\n '], ['\n ']), + _templateObject13 = babelHelpers.taggedTemplateLiteralLoose(['\n {{component (component "change-button" model.val2)}}\n {{model.val2}}'], ['\n {{component (component "change-button" model.val2)}}\n {{model.val2}}']), + _templateObject14 = babelHelpers.taggedTemplateLiteralLoose(['\n message: {{message}}{{inner-component message=message}}\n '], ['\n ']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: closure components', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { +babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test renders with component helper'] = function testRendersWithComponentHelper() { + var _this = this; + + var expectedText = 'Hodi'; + + this.registerComponent('-looked-up', { + template: expectedText + }); + + this.render('{{component (component "-looked-up")}}'); + + this.assertText(expectedText); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertText(expectedText); + }; + + _class.prototype['@test renders with component helper with invocation params, hash'] = function testRendersWithComponentHelperWithInvocationParamsHash() { + var _this2 = this; + + this.registerComponent('-looked-up', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['name'] + }), + template: '{{greeting}} {{name}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject)); + + this.assertText('Hodi Hodari'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertText('Hodi Hodari'); + }; + + _class.prototype['@test GH#13742 keeps nested rest positional parameters if rendered with no positional parameters'] = function testGH13742KeepsNestedRestPositionalParametersIfRenderedWithNoPositionalParameters() { + var _this3 = this; + + this.registerComponent('-looked-up', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'params' + }), + template: '{{#each params as |p|}}{{p}}{{/each}}' + }); + + this.render('{{component (component "-looked-up" model.greeting model.name)}}', { + model: { + greeting: 'Gabon ', + name: 'Zack' + } + }); + + this.assertText('Gabon Zack'); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertText('Gabon Zack'); + + this.runTask(function () { + return _this3.context.set('model.greeting', 'Good morning '); + }); + + this.assertText('Good morning Zack'); + + this.runTask(function () { + return _this3.context.set('model.name', 'Matthew'); + }); + + this.assertText('Good morning Matthew'); + + this.runTask(function () { + return _this3.context.set('model', { greeting: 'Gabon ', name: 'Zack' }); + }); + + this.assertText('Gabon Zack'); + }; + + // Take a look at this one. Seems to pass even when currying isn't implemented. + + _class.prototype['@test overwrites nested rest positional parameters if rendered with positional parameters'] = function testOverwritesNestedRestPositionalParametersIfRenderedWithPositionalParameters() { + var _this4 = this; + + this.registerComponent('-looked-up', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'params' + }), + template: '{{#each params as |p|}}{{p}}{{/each}}' + }); + + this.render('{{component (component "-looked-up" model.greeting model.name) model.name model.greeting}}', { + model: { + greeting: 'Gabon ', + name: 'Zack' + } + }); + + this.assertText('ZackGabon '); + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assertText('ZackGabon '); + + this.runTask(function () { + return _this4.context.set('model.greeting', 'Good morning '); + }); + + this.assertText('ZackGood morning '); + + this.runTask(function () { + return _this4.context.set('model.name', 'Matthew'); + }); + + this.assertText('MatthewGood morning '); + + this.runTask(function () { + return _this4.context.set('model', { greeting: 'Gabon ', name: 'Zack' }); + }); + + this.assertText('ZackGabon '); + }; + + _class.prototype['@test GH#13742 keeps nested rest positional parameters if nested and rendered with no positional parameters'] = function testGH13742KeepsNestedRestPositionalParametersIfNestedAndRenderedWithNoPositionalParameters() { + var _this5 = this; + + this.registerComponent('-looked-up', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'params' + }), + template: '{{#each params as |p|}}{{p}}{{/each}}' + }); + + this.render('{{component (component (component "-looked-up" model.greeting model.name))}}', { + model: { + greeting: 'Gabon ', + name: 'Zack' + } + }); + + this.assertText('Gabon Zack'); + + this.runTask(function () { + return _this5.rerender(); + }); + + this.assertText('Gabon Zack'); + + this.runTask(function () { + return _this5.context.set('model.greeting', 'Good morning '); + }); + + this.assertText('Good morning Zack'); + + this.runTask(function () { + return _this5.context.set('model.name', 'Matthew'); + }); + + this.assertText('Good morning Matthew'); + + this.runTask(function () { + return _this5.context.set('model', { greeting: 'Gabon ', name: 'Zack' }); + }); + + this.assertText('Gabon Zack'); + }; + + _class.prototype['@test overwrites nested rest positional parameters if nested with new pos params and rendered with no positional parameters'] = function testOverwritesNestedRestPositionalParametersIfNestedWithNewPosParamsAndRenderedWithNoPositionalParameters() { + var _this6 = this; + + this.registerComponent('-looked-up', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'params' + }), + template: '{{#each params as |p|}}{{p}}{{/each}}' + }); + + this.render('{{component (component (component "-looked-up" model.greeting model.name) model.name model.greeting)}}', { + model: { + greeting: 'Gabon ', + name: 'Zack' + } + }); + + this.assertText('ZackGabon '); + + this.runTask(function () { + return _this6.rerender(); + }); + + this.assertText('ZackGabon '); + + this.runTask(function () { + return _this6.context.set('model.greeting', 'Good morning '); + }); + + this.assertText('ZackGood morning '); + + this.runTask(function () { + return _this6.context.set('model.name', 'Matthew'); + }); + + this.assertText('MatthewGood morning '); + + this.runTask(function () { + return _this6.context.set('model', { greeting: 'Gabon ', name: 'Zack' }); + }); + + this.assertText('ZackGabon '); + }; + + _class.prototype['@test renders with component helper with curried params, hash'] = function testRendersWithComponentHelperWithCurriedParamsHash() { + var _this7 = this; + + this.registerComponent('-looked-up', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['name'] + }), + template: '{{greeting}} {{name}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + + this.assertText('Hola Hodari'); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertText('Hola Hodari'); + }; + + _class.prototype['@test updates when component path is bound'] = function testUpdatesWhenComponentPathIsBound() { + var _this8 = this; + + this.registerComponent('-mandarin', { + template: 'ni hao' + }); + + this.registerComponent('-hindi', { + template: 'Namaste' + }); + + this.render('{{component (component model.lookupComponent)}}', { + model: { + lookupComponent: '-mandarin' + } + }); + + this.assertText('ni hao'); + + this.runTask(function () { + return _this8.rerender(); + }); + + this.assertText('ni hao'); + + this.runTask(function () { + return _this8.context.set('model.lookupComponent', '-hindi'); + }); + + this.assertText('Namaste'); + + this.runTask(function () { + return _this8.context.set('model', { lookupComponent: '-mandarin' }); + }); + + this.assertText('ni hao'); + }; + + _class.prototype['@test updates when curried hash argument is bound'] = function testUpdatesWhenCurriedHashArgumentIsBound() { + var _this9 = this; + + this.registerComponent('-looked-up', { + template: '{{greeting}}' + }); + + this.render('{{component (component "-looked-up" greeting=model.greeting)}}', { + model: { + greeting: 'Hodi' + } + }); + + this.assertText('Hodi'); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertText('Hodi'); + + this.runTask(function () { + return _this9.context.set('model.greeting', 'Hola'); + }); + + this.assertText('Hola'); + + this.runTask(function () { + return _this9.context.set('model', { greeting: 'Hodi' }); + }); + + this.assertText('Hodi'); + }; + + _class.prototype['@test updates when curried hash arguments is bound in block form'] = function testUpdatesWhenCurriedHashArgumentsIsBoundInBlockForm() { + var _this10 = this; + + this.registerComponent('-looked-up', { + template: '{{greeting}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3), { + model: { + greeting: 'Hodi' + } + }); + + this.assertText('Hodi'); + + this.runTask(function () { + return _this10.rerender(); + }); + + this.assertText('Hodi'); + + this.runTask(function () { + return _this10.context.set('model.greeting', 'Hola'); + }); + + this.assertText('Hola'); + + this.runTask(function () { + return _this10.context.set('model', { greeting: 'Hodi' }); + }); + + this.assertText('Hodi'); + }; + + _class.prototype['@test nested components overwrite named positional parameters'] = function testNestedComponentsOverwriteNamedPositionalParameters() { + var _this11 = this; + + this.registerComponent('-looked-up', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['name', 'age'] + }), + template: '{{name}} {{age}}' + }); + + this.render('{{component (component (component "-looked-up" "Sergio" 29) "Marvin" 21) "Hodari"}}'); + + this.assertText('Hodari 21'); + + this.runTask(function () { + return _this11.rerender(); + }); + + this.assertText('Hodari 21'); + }; + + _class.prototype['@test nested components overwrite hash parameters'] = function testNestedComponentsOverwriteHashParameters() { + var _this12 = this; + + this.registerComponent('-looked-up', { + template: '{{greeting}} {{name}} {{age}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4), { + model: { + greeting: 'Hodi' + } + }); + + this.assertText('Hodi Sigmundur 33'); + + this.runTask(function () { + return _this12.rerender(); + }); + + this.assertText('Hodi Sigmundur 33'); + + this.runTask(function () { + return _this12.context.set('model.greeting', 'Kaixo'); + }); + + this.assertText('Kaixo Sigmundur 33'); + + this.runTask(function () { + return _this12.context.set('model', { greeting: 'Hodi' }); + }); + + this.assertText('Hodi Sigmundur 33'); + }; + + _class.prototype['@test bound outer named parameters get updated in the right scope'] = function testBoundOuterNamedParametersGetUpdatedInTheRightScope() { + var _this13 = this; + + this.registerComponent('-inner-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['comp'] + }), + template: '{{component comp "Inner"}}' + }); + + this.registerComponent('-looked-up', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['name', 'age'] + }), + template: '{{name}} {{age}}' + }); + + this.render('{{component "-inner-component" (component "-looked-up" model.outerName model.outerAge)}}', { + model: { + outerName: 'Outer', + outerAge: 28 + } + }); + + this.assertText('Inner 28'); + + this.runTask(function () { + return _this13.rerender(); + }); + + this.assertText('Inner 28'); + + this.runTask(function () { + return _this13.context.set('model.outerAge', 29); + }); + + this.assertText('Inner 29'); + + this.runTask(function () { + return _this13.context.set('model.outerName', 'Not outer'); + }); + + this.assertText('Inner 29'); + + this.runTask(function () { + _this13.context.set('model', { + outerName: 'Outer', + outerAge: 28 + }); + }); + + this.assertText('Inner 28'); + }; + + _class.prototype['@test bound outer hash parameters get updated in the right scope'] = function testBoundOuterHashParametersGetUpdatedInTheRightScope() { + var _this14 = this; + + this.registerComponent('-inner-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['comp'] + }), + template: '{{component comp name="Inner"}}' + }); + + this.registerComponent('-looked-up', { + template: '{{name}} {{age}}' + }); + + this.render('{{component "-inner-component" (component "-looked-up" name=model.outerName age=model.outerAge)}}', { + model: { + outerName: 'Outer', + outerAge: 28 + } + }); + + this.assertText('Inner 28'); + + this.runTask(function () { + return _this14.rerender(); + }); + + this.assertText('Inner 28'); + + this.runTask(function () { + return _this14.context.set('model.outerAge', 29); + }); + + this.assertText('Inner 29'); + + this.runTask(function () { + return _this14.context.set('model.outerName', 'Not outer'); + }); + + this.assertText('Inner 29'); + + this.runTask(function () { + _this14.context.set('model', { + outerName: 'Outer', + outerAge: 28 + }); + }); + + this.assertText('Inner 28'); + }; + + _class.prototype['@test conflicting positional and hash parameters raise and assertion if in the same closure'] = function testConflictingPositionalAndHashParametersRaiseAndAssertionIfInTheSameClosure() { + var _this15 = this; + + this.registerComponent('-looked-up', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['name'] + }), + template: '{{greeting}} {{name}}' + }); + + expectAssertion(function () { + _this15.render('{{component (component "-looked-up" "Hodari" name="Sergio") "Hodari" greeting="Hodi"}}'); + }, 'You cannot specify both a positional param (at position 0) and the hash argument `name`.'); + }; + + _class.prototype['@test conflicting positional and hash parameters does not raise an assertion if rerendered'] = function testConflictingPositionalAndHashParametersDoesNotRaiseAnAssertionIfRerendered() { + var _this16 = this; + + // In some cases, rerendering with a positional param used to cause an + // assertion. This test checks it does not. + this.registerComponent('-looked-up', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['name'] + }), + template: '{{greeting}} {{name}}' + }); + + this.render('{{component (component "-looked-up" model.name greeting="Hodi")}}', { + model: { + name: 'Hodari' + } + }); + + this.assertText('Hodi Hodari'); + + this.runTask(function () { + return _this16.rerender(); + }); + + this.assertText('Hodi Hodari'); + + this.runTask(function () { + return _this16.context.set('model.name', 'Sergio'); + }); + + this.assertText('Hodi Sergio'); + + this.runTask(function () { + return _this16.context.set('model', { name: 'Hodari' }); + }); + + this.assertText('Hodi Hodari'); + }; + + _class.prototype['@test conflicting positional and hash parameters does not raise an assertion if in different closure'] = function testConflictingPositionalAndHashParametersDoesNotRaiseAnAssertionIfInDifferentClosure() { + var _this17 = this; + + this.registerComponent('-looked-up', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['name'] + }), + template: '{{greeting}} {{name}}' + }); + + this.render('{{component (component "-looked-up" "Hodari") name="Sergio" greeting="Hodi"}}'); + + this.assertText('Hodi Sergio'); + + this.runTask(function () { + return _this17.rerender(); + }); + + this.assertText('Hodi Sergio'); + }; + + _class.prototype['@test raises an asserton when component path is null'] = function testRaisesAnAssertonWhenComponentPathIsNull() { + var _this18 = this; + + expectAssertion(function () { + _this18.render('{{component (component lookupComponent)}}'); + }); + }; + + _class.prototype['@test raises an assertion when component path is not a component name (static)'] = function testRaisesAnAssertionWhenComponentPathIsNotAComponentNameStatic() { + var _this19 = this; + + expectAssertion(function () { + _this19.render('{{component (component "not-a-component")}}'); + }, 'The component helper cannot be used without a valid component name. You used "not-a-component" via (component "not-a-component")'); + }; + + _class.prototype['@test raises an assertion when component path is not a component name (dynamic)'] = function testRaisesAnAssertionWhenComponentPathIsNotAComponentNameDynamic() { + var _this20 = this; + + expectAssertion(function () { + _this20.render('{{component (component compName)}}', { + compName: 'not-a-component' + }); + }, /The component helper cannot be used without a valid component name. You used "not-a-component" via \(component .*\)/); + }; + + _class.prototype['@test renders with dot path'] = function testRendersWithDotPath() { + var _this21 = this; + + var expectedText = 'Hodi'; + this.registerComponent('-looked-up', { + template: expectedText + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5)); + + this.assertText(expectedText); + + this.runTask(function () { + return _this21.rerender(); + }); + + this.assertText(expectedText); + }; + + _class.prototype['@test renders with dot path and attr'] = function testRendersWithDotPathAndAttr() { + var _this22 = this; + + var expectedText = 'Hodi'; + this.registerComponent('-looked-up', { + template: '{{expectedText}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject6), { + model: { + expectedText: expectedText + } + }); + + this.assertText(expectedText); + + this.runTask(function () { + return _this22.rerender(); + }); + + this.assertText(expectedText); + + this.runTask(function () { + return _this22.context.set('model.expectedText', 'Hola'); + }); + + this.assertText('Hola'); + + this.runTask(function () { + return _this22.context.set('model', { expectedText: expectedText }); + }); + + this.assertText(expectedText); + }; + + _class.prototype['@test renders with dot path and curried over attr'] = function testRendersWithDotPathAndCurriedOverAttr() { + var _this23 = this; + + var expectedText = 'Hodi'; + this.registerComponent('-looked-up', { + template: '{{expectedText}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject7), { + model: { + expectedText: expectedText + } + }); + + this.assertText(expectedText); + + this.runTask(function () { + return _this23.rerender(); + }); + + this.assertText(expectedText); + + this.runTask(function () { + return _this23.context.set('model.expectedText', 'Hola'); + }); + + this.assertText('Hola'); + + this.runTask(function () { + return _this23.context.set('model', { expectedText: expectedText }); + }); + + this.assertText(expectedText); + }; + + _class.prototype['@test renders with dot path and with rest positional parameters'] = function testRendersWithDotPathAndWithRestPositionalParameters() { + var _this24 = this; + + this.registerComponent('-looked-up', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'params' + }), + template: '{{params}}' + }); + + var expectedText = 'Hodi'; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject8), { + model: { + expectedText: expectedText + } + }); + + this.assertText(expectedText + ',Hola'); + + this.runTask(function () { + return _this24.rerender(); + }); + + this.assertText(expectedText + ',Hola'); + + this.runTask(function () { + return _this24.context.set('model.expectedText', 'Kaixo'); + }); + + this.assertText('Kaixo,Hola'); + + this.runTask(function () { + return _this24.context.set('model', { expectedText: expectedText }); + }); + + this.assertText(expectedText + ',Hola'); + }; + + _class.prototype['@test renders with dot path and rest parameter does not leak'] = function testRendersWithDotPathAndRestParameterDoesNotLeak(assert) { + // In the original implementation, positional parameters were not handled + // correctly causing the first positional parameter to be the closure + // component itself. + var value = false; + + this.registerComponent('my-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didReceiveAttrs: function () { + value = this.getAttr('value'); + } + }).reopenClass({ + positionalParams: ['value'] + }) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject9), { first: 'first' }); + + assert.equal(value, 'first', 'value is the expected parameter'); + }; + + _class.prototype['@test renders with dot path and updates attributes'] = function testRendersWithDotPathAndUpdatesAttributes(assert) { + var _this25 = this; + + this.registerComponent('my-nested-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didReceiveAttrs: function () { + this.set('myProp', this.getAttr('my-parent-attr')); + } + }), + template: '{{myProp}}' + }); + + this.registerComponent('my-component', { + template: '{{yield (hash my-nested-component=(component "my-nested-component" my-parent-attr=my-attr))}}' + }); + + this.registerComponent('my-action-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + changeValue: function () { + this.incrementProperty('myProp'); + } + } + }), + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject10) + }); + + this.render('{{my-action-component myProp=model.myProp}}', { + model: { + myProp: 1 + } + }); + + assert.equal(this.$('#nested-prop').text(), '1'); + + this.runTask(function () { + return _this25.rerender(); + }); + + assert.equal(this.$('#nested-prop').text(), '1'); + + this.runTask(function () { + return _this25.$('button').click(); + }); + + assert.equal(this.$('#nested-prop').text(), '2'); + + this.runTask(function () { + return _this25.$('button').click(); + }); + + assert.equal(this.$('#nested-prop').text(), '3'); + + this.runTask(function () { + return _this25.context.set('model', { myProp: 1 }); + }); + + assert.equal(this.$('#nested-prop').text(), '1'); + }; + + _class.prototype['@test adding parameters to a closure component\'s instance does not add it to other instances'] = function testAddingParametersToAClosureComponentSInstanceDoesNotAddItToOtherInstances() { + var _this26 = this; + + // If parameters and attributes are not handled correctly, setting a value + // in an invokation can leak to others invocation. + this.registerComponent('select-box', { + template: '{{yield (hash option=(component "select-box-option"))}}' + }); + + this.registerComponent('select-box-option', { + template: '{{label}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject11)); + + this.assertText('Foo'); + + this.runTask(function () { + return _this26.rerender(); + }); + + this.assertText('Foo'); + }; + + _class.prototype['@test parameters in a closure are mutable when closure is a param'] = function testParametersInAClosureAreMutableWhenClosureIsAParam(assert) { + var _this27 = this; + + // This checks that a `(mut)` is added to parameters and attributes to + // contextual components when it is a param. + + this.registerComponent('change-button', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['val'] + }), + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject12) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject13), { + model: { + val2: 8 + } + }); + + assert.equal(this.$('.value').text(), '8'); + + this.runTask(function () { + return _this27.rerender(); + }); + + assert.equal(this.$('.value').text(), '8'); + + this.runTask(function () { + return _this27.$('.my-button').click(); + }); + + assert.equal(this.$('.value').text(), '10'); + + this.runTask(function () { + return _this27.context.set('model', { val2: 8 }); + }); + + assert.equal(this.$('.value').text(), '8'); + }; + + _class.prototype['@test tagless blockless components render'] = function testTaglessBlocklessComponentsRender(assert) { + var _this28 = this; + + this.registerComponent('my-comp', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ tagName: '' }) + }); + + this.render('{{my-comp}}'); + + this.runTask(function () { + return _this28.rerender(); + }); + + assert.equal(this.$().text(), ''); + }; + + _class.prototype['@test GH#13494 tagless blockless component with property binding'] = function testGH13494TaglessBlocklessComponentWithPropertyBinding(assert) { + var _this29 = this; + + this.registerComponent('outer-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + message: 'hello', + actions: { + change: function () { + this.set('message', 'goodbye'); + } + } + }), + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject14) + }); + + this.registerComponent('inner-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '' + }) + }); + + this.render('{{outer-component}}'); + + assert.equal(this.$().text(), 'message: hello'); + + this.runTask(function () { + return _this29.rerender(); + }); + + assert.equal(this.$().text(), 'message: hello'); + + this.runTask(function () { + return _this29.$('button').click(); + }); + + assert.equal(this.$().text(), 'message: goodbye'); + + this.runTask(function () { + return _this29.rerender(); + }); + + assert.equal(this.$().text(), 'message: goodbye'); + }; + + _class.prototype['@test GH#13982 contextual component ref is stable even when bound params change'] = function testGH13982ContextualComponentRefIsStableEvenWhenBoundParamsChange(assert) { + var _this30 = this; + + var instance = undefined, + previousInstance = undefined; + var initCount = 0; + + this.registerComponent('my-comp', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + previousInstance = instance; + instance = this; + initCount++; + }, + isOpen: undefined + }), + template: '{{if isOpen "open" "closed"}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject15), { + isOpen: true + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'a instance was created'); + assert.equal(previousInstance, undefined, 'no previous component exists'); + assert.equal(initCount, 1, 'the component was constructed exactly 1 time'); + assert.equal(this.$().text(), 'open', 'the componet text is "open"'); + + this.runTask(function () { + return _this30.rerender(); + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'the component instance exists'); + assert.equal(previousInstance, undefined, 'no previous component exists'); + assert.equal(initCount, 1, 'the component was constructed exactly 1 time'); + assert.equal(this.$().text(), 'open', 'the componet text is "open"'); + + this.runTask(function () { + return _this30.context.set('isOpen', false); + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'the component instance exists'); + assert.equal(previousInstance, undefined, 'no previous component exists'); + assert.equal(initCount, 1, 'the component was constructed exactly 1 time'); + assert.equal(this.$().text(), 'closed', 'the component text is "closed"'); + + this.runTask(function () { + return _this30.rerender(); + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'the component instance exists'); + assert.equal(previousInstance, undefined, 'no previous component exists'); + assert.equal(initCount, 1, 'the component was constructed exactly 1 time'); + assert.equal(this.$().text(), 'closed', 'the component text is "closed"'); + + this.runTask(function () { + return _this30.context.set('isOpen', true); + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'the component instance exists'); + assert.equal(previousInstance, undefined, 'no previous component exists'); + assert.equal(initCount, 1, 'the component was constructed exactly 1 time'); + assert.equal(this.$().text(), 'open', 'the componet text is "open"'); + }; + + _class.prototype['@test GH#13982 contextual component ref is stable even when bound params change (bound name param)'] = function testGH13982ContextualComponentRefIsStableEvenWhenBoundParamsChangeBoundNameParam(assert) { + var _this31 = this; + + var instance = undefined, + previousInstance = undefined; + var initCount = 0; + + this.registerComponent('my-comp', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + previousInstance = instance; + instance = this; + initCount++; + }, + isOpen: undefined + }), + template: '{{if isOpen "open" "closed"}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject16), { + compName: 'my-comp', + isOpen: true + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'a instance was created'); + assert.equal(previousInstance, undefined, 'no previous component exists'); + assert.equal(initCount, 1, 'the component was constructed exactly 1 time'); + assert.equal(this.$().text(), 'open', 'the componet text is "open"'); + + this.runTask(function () { + return _this31.rerender(); + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'the component instance exists'); + assert.equal(previousInstance, undefined, 'no previous component exists'); + assert.equal(initCount, 1, 'the component was constructed exactly 1 time'); + assert.equal(this.$().text(), 'open', 'the componet text is "open"'); + + this.runTask(function () { + return _this31.context.set('isOpen', false); + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'the component instance exists'); + assert.equal(previousInstance, undefined, 'no previous component exists'); + assert.equal(initCount, 1, 'the component was constructed exactly 1 time'); + assert.equal(this.$().text(), 'closed', 'the component text is "closed"'); + + this.runTask(function () { + return _this31.rerender(); + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'the component instance exists'); + assert.equal(previousInstance, undefined, 'no previous component exists'); + assert.equal(initCount, 1, 'the component was constructed exactly 1 time'); + assert.equal(this.$().text(), 'closed', 'the component text is "closed"'); + + this.runTask(function () { + return _this31.context.set('isOpen', true); + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'the component instance exists'); + assert.equal(previousInstance, undefined, 'no previous component exists'); + assert.equal(initCount, 1, 'the component was constructed exactly 1 time'); + assert.equal(this.$().text(), 'open', 'the componet text is "open"'); + }; + + _class.prototype['@test GH#13982 contextual component ref is recomputed when component name param changes'] = function testGH13982ContextualComponentRefIsRecomputedWhenComponentNameParamChanges(assert) { + var _this32 = this; + + var instance = undefined, + previousInstance = undefined; + var initCount = 0; + + this.registerComponent('my-comp', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + previousInstance = instance; + instance = this; + initCount++; + }, + isOpen: undefined + }), + template: 'my-comp: {{if isOpen "open" "closed"}}' + }); + + this.registerComponent('your-comp', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + previousInstance = instance; + instance = this; + initCount++; + }, + isOpen: undefined + }), + template: 'your-comp: {{if isOpen "open" "closed"}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject16), { + compName: 'my-comp', + isOpen: true + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'a instance was created'); + assert.equal(previousInstance, undefined, 'there is no previous instance'); + assert.equal(initCount, 1, 'the component was constructed exactly 1 time'); + assert.equal(this.$().text(), 'my-comp: open'); + + this.runTask(function () { + return _this32.rerender(); + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'a instance exists after rerender'); + assert.equal(previousInstance, undefined, 'there is no previous instance after rerender'); + assert.equal(initCount, 1, 'the component was constructed exactly 1 time'); + assert.equal(this.$().text(), 'my-comp: open'); + + this.runTask(function () { + return _this32.context.set('compName', 'your-comp'); + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'an instance was created after component name changed'); + assert.ok(!_emberMetal.isEmpty(previousInstance), 'a previous instance now exists'); + assert.notEqual(instance, previousInstance, 'the instance and previous instance are not the same object'); + assert.equal(initCount, 2, 'the component was constructed exactly 2 times'); + assert.equal(this.$().text(), 'your-comp: open'); + + this.runTask(function () { + return _this32.rerender(); + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'an instance was created after component name changed (rerender)'); + assert.ok(!_emberMetal.isEmpty(previousInstance), 'a previous instance now exists (rerender)'); + assert.notEqual(instance, previousInstance, 'the instance and previous instance are not the same object (rerender)'); + assert.equal(initCount, 2, 'the component was constructed exactly 2 times (rerender)'); + assert.equal(this.$().text(), 'your-comp: open'); + + this.runTask(function () { + return _this32.context.set('compName', 'my-comp'); + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'an instance was created after component name changed'); + assert.ok(!_emberMetal.isEmpty(previousInstance), 'a previous instance still exists'); + assert.notEqual(instance, previousInstance, 'the instance and previous instance are not the same object'); + assert.equal(initCount, 3, 'the component was constructed exactly 3 times (rerender)'); + assert.equal(this.$().text(), 'my-comp: open'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + var ClosureComponentMutableParamsTest = (function (_RenderingTest2) { +babelHelpers.inherits(ClosureComponentMutableParamsTest, _RenderingTest2); + + function ClosureComponentMutableParamsTest() { +babelHelpers.classCallCheck(this, ClosureComponentMutableParamsTest); + + _RenderingTest2.apply(this, arguments); + } + + ClosureComponentMutableParamsTest.prototype.render = function render(templateStr) { + var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + _RenderingTest2.prototype.render.call(this, templateStr + '{{model.val2}}', _emberUtils.assign(context, { model: { val2: 8 } })); + }; + + return ClosureComponentMutableParamsTest; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest); + + var MutableParamTestGenerator = (function () { + function MutableParamTestGenerator(cases) { +babelHelpers.classCallCheck(this, MutableParamTestGenerator); + + this.cases = cases; + } + + MutableParamTestGenerator.prototype.generate = function generate(_ref2) { + var _ref; + + var title = _ref2.title; + var setup = _ref2.setup; + + return _ref = {}, _ref['@test parameters in a closure are mutable when closure is a ' + title] = function (assert) { + var _this33 = this; + + this.registerComponent('change-button', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['val'] + }), + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject17) + }); + + setup.call(this, assert); + + assert.equal(this.$('.value').text(), '8'); + + this.runTask(function () { + return _this33.rerender(); + }); + + assert.equal(this.$('.value').text(), '8'); + + this.runTask(function () { + return _this33.$('.my-button').click(); + }); + + assert.equal(this.$('.value').text(), '10'); + + this.runTask(function () { + return _this33.context.set('model', { val2: 8 }); + }); + + assert.equal(this.$('.value').text(), '8'); + }, _ref; + }; + + return MutableParamTestGenerator; + })(); + + _emberGlimmerTestsUtilsAbstractTestCase.applyMixins(ClosureComponentMutableParamsTest, new MutableParamTestGenerator([{ + title: 'param', + setup: function () { + this.render('{{component (component "change-button" model.val2)}}'); + } + }, { + title: 'nested param', + setup: function () { + this.registerComponent('my-comp', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['components'] + }), + template: '{{component components.comp}}' + }); + + this.render('{{my-comp (hash comp=(component "change-button" model.val2))}}'); + } + }, { + title: 'hash value', + setup: function () { + this.registerComponent('my-comp', { + template: '{{component component}}' + }); + + this.render('{{my-comp component=(component "change-button" val=model.val2)}}'); + } + }, { + title: 'nested hash value', + setup: function () { + this.registerComponent('my-comp', { + template: '{{component components.button}}' + }); + + this.render('{{my-comp components=(hash button=(component "change-button" val=model.val2))}}'); + } + }])); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: closure components -- mutable params', ClosureComponentMutableParamsTest); +}); +enifed('ember-glimmer/tests/integration/components/closure-components-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/closure-components-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/closure-components-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/closure-components-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/closure-components-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/closure-components-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/curly-components-test', ['exports', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/test-helpers'], function (exports, _emberMetal, _emberRuntime, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsTestHelpers) { + /* globals EmberDev */ + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{foo-bar class="bar baz"}}\n {{foo-bar classNames="bar baz"}}\n {{foo-bar}}\n '], ['\n {{foo-bar class="bar baz"}}\n {{foo-bar classNames="bar baz"}}\n {{foo-bar}}\n ']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if cond1}}\n {{#foo-bar id=1}}\n {{#if cond2}}\n {{#foo-bar id=2}}{{/foo-bar}}\n {{#if cond3}}\n {{#foo-bar id=3}}\n {{#if cond4}}\n {{#foo-bar id=4}}\n {{#if cond5}}\n {{#foo-bar id=5}}{{/foo-bar}}\n {{#foo-bar id=6}}{{/foo-bar}}\n {{#foo-bar id=7}}{{/foo-bar}}\n {{/if}}\n {{#foo-bar id=8}}{{/foo-bar}}\n {{/foo-bar}}\n {{/if}}\n {{/foo-bar}}\n {{/if}}\n {{/if}}\n {{/foo-bar}}\n {{/if}}'], ['\n {{#if cond1}}\n {{#foo-bar id=1}}\n {{#if cond2}}\n {{#foo-bar id=2}}{{/foo-bar}}\n {{#if cond3}}\n {{#foo-bar id=3}}\n {{#if cond4}}\n {{#foo-bar id=4}}\n {{#if cond5}}\n {{#foo-bar id=5}}{{/foo-bar}}\n {{#foo-bar id=6}}{{/foo-bar}}\n {{#foo-bar id=7}}{{/foo-bar}}\n {{/if}}\n {{#foo-bar id=8}}{{/foo-bar}}\n {{/foo-bar}}\n {{/if}}\n {{/foo-bar}}\n {{/if}}\n {{/if}}\n {{/foo-bar}}\n {{/if}}']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if isStream}}\n true\n {{else}}\n false\n {{/if}}\n '], ['\n {{#if isStream}}\n true\n {{else}}\n false\n {{/if}}\n ']), + _templateObject4 = babelHelpers.taggedTemplateLiteralLoose(['\n Args: {{this.attrs.value}} | {{attrs.value}} | {{value}}\n {{#each this.attrs.items as |item|}}\n {{item}}\n {{/each}}\n {{#each attrs.items as |item|}}\n {{item}}\n {{/each}}\n {{#each items as |item|}}\n {{item}}\n {{/each}}\n '], ['\n Args: {{this.attrs.value}} | {{attrs.value}} | {{value}}\n {{#each this.attrs.items as |item|}}\n {{item}}\n {{/each}}\n {{#each attrs.items as |item|}}\n {{item}}\n {{/each}}\n {{#each items as |item|}}\n {{item}}\n {{/each}}\n ']), + _templateObject5 = babelHelpers.taggedTemplateLiteralLoose(['Args: lul | lul | lul111'], ['Args: lul | lul | lul111']), + _templateObject6 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with-block someProp=prop}}\n In template\n {{/with-block}}'], ['\n {{#with-block someProp=prop}}\n In template\n {{/with-block}}']), + _templateObject7 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each names as |name|}}\n {{name}}\n {{/each}}'], ['\n {{#each names as |name|}}\n {{name}}\n {{/each}}']), + _templateObject8 = babelHelpers.taggedTemplateLiteralLoose(['\n {{sample-component "Foo" 4 "Bar" elementId="args-3"}}\n {{sample-component "Foo" 4 "Bar" 5 "Baz" elementId="args-5"}}'], ['\n {{sample-component "Foo" 4 "Bar" elementId="args-3"}}\n {{sample-component "Foo" 4 "Bar" 5 "Baz" elementId="args-5"}}']), + _templateObject9 = babelHelpers.taggedTemplateLiteralLoose(['\n {{sample-component "one" "two" elementId="two-positional"}}\n {{sample-component "one" second="two" elementId="one-positional"}}\n {{sample-component first="one" second="two" elementId="no-positional"}}'], ['\n {{sample-component "one" "two" elementId="two-positional"}}\n {{sample-component "one" second="two" elementId="one-positional"}}\n {{sample-component first="one" second="two" elementId="no-positional"}}']), + _templateObject10 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each n as |name|}}\n {{name}}\n {{/each}}'], ['\n {{#each n as |name|}}\n {{name}}\n {{/each}}']), + _templateObject11 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with-template name="with-block"}}\n [In block - {{name}}]\n {{/with-template}}\n {{with-template name="without-block"}}'], ['\n {{#with-template name="with-block"}}\n [In block - {{name}}]\n {{/with-template}}\n {{with-template name="without-block"}}']), + _templateObject12 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if hasBlock}}\n {{yield}}\n {{else}}\n No Block!\n {{/if}}'], ['\n {{#if hasBlock}}\n {{yield}}\n {{else}}\n No Block!\n {{/if}}']), + _templateObject13 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with-block}}\n In template\n {{/with-block}}'], ['\n {{#with-block}}\n In template\n {{/with-block}}']), + _templateObject14 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if hasBlockParams}}\n {{yield this}} - In Component\n {{else}}\n {{yield}} No Block!\n {{/if}}'], ['\n {{#if hasBlockParams}}\n {{yield this}} - In Component\n {{else}}\n {{yield}} No Block!\n {{/if}}']), + _templateObject15 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with-block as |something|}}\n In template\n {{/with-block}}'], ['\n {{#with-block as |something|}}\n In template\n {{/with-block}}']), + _templateObject16 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if hasBlockParams}}\n {{yield this}}\n {{else}}\n {{yield}} No Block Param!\n {{/if}}'], ['\n {{#if hasBlockParams}}\n {{yield this}}\n {{else}}\n {{yield}} No Block Param!\n {{/if}}']), + _templateObject17 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with-block}}\n In block\n {{/with-block}}'], ['\n {{#with-block}}\n In block\n {{/with-block}}']), + _templateObject18 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if predicate}}\n Yes:{{yield someValue}}\n {{else}}\n No:{{yield to="inverse"}}\n {{/if}}'], ['\n {{#if predicate}}\n Yes:{{yield someValue}}\n {{else}}\n No:{{yield to="inverse"}}\n {{/if}}']), + _templateObject19 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#my-if predicate=activated someValue=42 as |result|}}\n Hello{{result}}\n {{else}}\n Goodbye\n {{/my-if}}'], ['\n {{#my-if predicate=activated someValue=42 as |result|}}\n Hello{{result}}\n {{else}}\n Goodbye\n {{/my-if}}']), + _templateObject20 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if (hasBlock "inverse")}}\n Yes\n {{else}}\n No\n {{/if}}'], ['\n {{#if (hasBlock "inverse")}}\n Yes\n {{else}}\n No\n {{/if}}']), + _templateObject21 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#check-inverse}}{{/check-inverse}}\n {{#check-inverse}}{{else}}{{/check-inverse}}'], ['\n {{#check-inverse}}{{/check-inverse}}\n {{#check-inverse}}{{else}}{{/check-inverse}}']), + _templateObject22 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if (hasBlock)}}\n Yes\n {{else}}\n No\n {{/if}}'], ['\n {{#if (hasBlock)}}\n Yes\n {{else}}\n No\n {{/if}}']), + _templateObject23 = babelHelpers.taggedTemplateLiteralLoose(['\n {{check-block}}\n {{#check-block}}{{/check-block}}'], ['\n {{check-block}}\n {{#check-block}}{{/check-block}}']), + _templateObject24 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if (hasBlockParams "inverse")}}\n Yes\n {{else}}\n No\n {{/if}}'], ['\n {{#if (hasBlockParams "inverse")}}\n Yes\n {{else}}\n No\n {{/if}}']), + _templateObject25 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#check-inverse}}{{/check-inverse}}\n {{#check-inverse as |something|}}{{/check-inverse}}'], ['\n {{#check-inverse}}{{/check-inverse}}\n {{#check-inverse as |something|}}{{/check-inverse}}']), + _templateObject26 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if (hasBlockParams)}}\n Yes\n {{else}}\n No\n {{/if}}'], ['\n {{#if (hasBlockParams)}}\n Yes\n {{else}}\n No\n {{/if}}']), + _templateObject27 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#check-block}}{{/check-block}}\n {{#check-block as |something|}}{{/check-block}}'], ['\n {{#check-block}}{{/check-block}}\n {{#check-block as |something|}}{{/check-block}}']), + _templateObject28 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if hasBlock}}\n Yes\n {{else}}\n No\n {{/if}}'], ['\n {{#if hasBlock}}\n Yes\n {{else}}\n No\n {{/if}}']), + _templateObject29 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#check-params}}{{/check-params}}\n {{#check-params as |foo|}}{{/check-params}}'], ['\n {{#check-params}}{{/check-params}}\n {{#check-params as |foo|}}{{/check-params}}']), + _templateObject30 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if hasBlockParams}}\n Yes\n {{else}}\n No\n {{/if}}'], ['\n {{#if hasBlockParams}}\n Yes\n {{else}}\n No\n {{/if}}']), + _templateObject31 = babelHelpers.taggedTemplateLiteralLoose(['\n {{check-attr}}\n {{#check-attr}}{{/check-attr}}'], ['\n {{check-attr}}\n {{#check-attr}}{{/check-attr}}']), + _templateObject32 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#check-attr}}{{/check-attr}}\n {{#check-attr}}{{else}}{{/check-attr}}'], ['\n {{#check-attr}}{{/check-attr}}\n {{#check-attr}}{{else}}{{/check-attr}}']), + _templateObject33 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#check-attr}}{{/check-attr}}\n {{#check-attr as |something|}}{{/check-attr}}'], ['\n {{#check-attr}}{{/check-attr}}\n {{#check-attr as |something|}}{{/check-attr}}']), + _templateObject34 = babelHelpers.taggedTemplateLiteralLoose(['\n {{check-helper}}\n {{#check-helper}}{{/check-helper}}'], ['\n {{check-helper}}\n {{#check-helper}}{{/check-helper}}']), + _templateObject35 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#check-helper}}{{/check-helper}}\n {{#check-helper}}{{else}}{{/check-helper}}'], ['\n {{#check-helper}}{{/check-helper}}\n {{#check-helper}}{{else}}{{/check-helper}}']), + _templateObject36 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#check-helper}}{{/check-helper}}\n {{#check-helper as |something|}}{{/check-helper}}'], ['\n {{#check-helper}}{{/check-helper}}\n {{#check-helper as |something|}}{{/check-helper}}']), + _templateObject37 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#x-outer}}\n {{#if showInner}}\n {{x-inner}}\n {{/if}}\n {{/x-outer}}'], ['\n {{#x-outer}}\n {{#if showInner}}\n {{x-inner}}\n {{/if}}\n {{/x-outer}}']), + _templateObject38 = babelHelpers.taggedTemplateLiteralLoose(['\n In layout. {{#each items as |item|}}\n [{{child-non-block item=item}}]\n {{/each}}'], ['\n In layout. {{#each items as |item|}}\n [{{child-non-block item=item}}]\n {{/each}}']), + _templateObject39 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#some-clicky-thing classNames="baz"}}\n Click Me\n {{/some-clicky-thing}}'], ['\n {{#some-clicky-thing classNames="baz"}}\n Click Me\n {{/some-clicky-thing}}']), + _templateObject40 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each blahzz as |p|}}\n {{p}}\n {{/each}}\n - {{yield}}'], ['\n {{#each blahzz as |p|}}\n {{p}}\n {{/each}}\n - {{yield}}']), + _templateObject41 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#some-clicky-thing blahzz="baz"}}\n Click Me\n {{/some-clicky-thing}}'], ['\n {{#some-clicky-thing blahzz="baz"}}\n Click Me\n {{/some-clicky-thing}}']), + _templateObject42 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#x-select value=value as |select|}}\n {{#x-option value="1" select=select}}1{{/x-option}}\n {{#x-option value="2" select=select}}2{{/x-option}}\n {{/x-select}}\n '], ['\n {{#x-select value=value as |select|}}\n {{#x-option value="1" select=select}}1{{/x-option}}\n {{#x-option value="2" select=select}}2{{/x-option}}\n {{/x-select}}\n ']), + _templateObject43 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#list-items items=items as |thing|}}\n |{{thing}}|\n\n {{#if editMode}}\n Remove {{thing}}\n {{/if}}\n {{/list-items}}\n '], ['\n {{#list-items items=items as |thing|}}\n |{{thing}}|\n\n {{#if editMode}}\n Remove {{thing}}\n {{/if}}\n {{/list-items}}\n ']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: curly components', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { +babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test it can render a basic component'] = function testItCanRenderABasicComponent() { + var _this = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar}}'); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + }; + + _class.prototype['@test it can render a template only component'] = function testItCanRenderATemplateOnlyComponent() { + var _this2 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar}}'); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + }; + + _class.prototype['@test it can have a custom id and it is not bound'] = function testItCanHaveACustomIdAndItIsNotBound() { + var _this3 = this; + + this.registerComponent('foo-bar', { template: '{{id}} {{elementId}}' }); + + this.render('{{foo-bar id=customId}}', { + customId: 'bizz' + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { id: 'bizz' }, content: 'bizz bizz' }); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { id: 'bizz' }, content: 'bizz bizz' }); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'customId', 'bar'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { id: 'bizz' }, content: 'bar bizz' }); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'customId', 'bizz'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { id: 'bizz' }, content: 'bizz bizz' }); + }; + + _class.prototype['@test elementId cannot change'] = function testElementIdCannotChange(assert) { + var component = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + elementId: 'blahzorz', + init: function () { + this._super.apply(this, arguments); + component = this; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '{{elementId}}' }); + + this.render('{{foo-bar}}'); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { id: 'blahzorz' }, content: 'blahzorz' }); + + if (EmberDev && !EmberDev.runningProdBuild) { + var willThrow = function () { + return _emberMetal.run(null, _emberMetal.set, component, 'elementId', 'herpyderpy'); + }; + + assert.throws(willThrow, /Changing a view's elementId after creation is not allowed/); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { id: 'blahzorz' }, content: 'blahzorz' }); + } + }; + + _class.prototype['@test can specify template with `layoutName` property'] = function testCanSpecifyTemplateWithLayoutNameProperty() { + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + elementId: 'blahzorz', + layoutName: 'fizz-bar', + init: function () { + this._super.apply(this, arguments); + this.local = 'hey'; + } + }); + + this.registerTemplate('fizz-bar', 'FIZZ BAR {{local}}'); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent }); + + this.render('{{foo-bar}}'); + + this.assertText('FIZZ BAR hey'); + }; + + _class.prototype['@test can specify template with `defaultLayout` property [DEPRECATED]'] = function testCanSpecifyTemplateWithDefaultLayoutPropertyDEPRECATED() { + expectDeprecation(/Specifying `defaultLayout` to .* is deprecated. Please use `layout` instead/); + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + elementId: 'blahzorz', + defaultLayout: _emberGlimmerTestsUtilsHelpers.compile('much wat {{lulz}}'), + init: function () { + this._super.apply(this, arguments); + this.lulz = 'hey'; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent }); + + this.render('{{foo-bar}}'); + + this.assertText('much wat hey'); + }; + + _class.prototype['@test layout takes precedence over defaultLayout'] = function testLayoutTakesPrecedenceOverDefaultLayout() { + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + elementId: 'blahzorz', + layout: _emberGlimmerTestsUtilsHelpers.compile('so much layout wat {{lulz}}'), + defaultLayout: _emberGlimmerTestsUtilsHelpers.compile('much wat {{lulz}}'), + init: function () { + this._super.apply(this, arguments); + this.lulz = 'hey'; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent }); + + this.render('{{foo-bar}}'); + + this.assertText('so much layout wat hey'); + }; + + _class.prototype['@test layout supports computed property'] = function testLayoutSupportsComputedProperty() { + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + elementId: 'blahzorz', + layout: _emberMetal.computed(function () { + return _emberGlimmerTestsUtilsHelpers.compile('so much layout wat {{lulz}}'); + }), + init: function () { + this._super.apply(this, arguments); + this.lulz = 'heyo'; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent }); + + this.render('{{foo-bar}}'); + + this.assertText('so much layout wat heyo'); + }; + + _class.prototype['@test passing undefined elementId results in a default elementId'] = function testPassingUndefinedElementIdResultsInADefaultElementId(assert) { + var _this4 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'h1' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'something' }); + + this.render('{{foo-bar id=somethingUndefined}}'); + + var foundId = this.$('h1').attr('id'); + assert.ok(/^ember/.test(foundId), 'Has a reasonable id attribute (found id=' + foundId + ').'); + + this.runTask(function () { + return _this4.rerender(); + }); + + var newFoundId = this.$('h1').attr('id'); + assert.ok(/^ember/.test(newFoundId), 'Has a reasonable id attribute (found id=' + newFoundId + ').'); + + assert.equal(foundId, newFoundId); + }; + + _class.prototype['@test id is an alias for elementId'] = function testIdIsAnAliasForElementId(assert) { + var _this5 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'h1' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'something' }); + + this.render('{{foo-bar id="custom-id"}}'); + + var foundId = this.$('h1').attr('id'); + assert.equal(foundId, 'custom-id'); + + this.runTask(function () { + return _this5.rerender(); + }); + + var newFoundId = this.$('h1').attr('id'); + assert.equal(newFoundId, 'custom-id'); + + assert.equal(foundId, newFoundId); + }; + + _class.prototype['@test cannot pass both id and elementId at the same time'] = function testCannotPassBothIdAndElementIdAtTheSameTime(assert) { + var _this6 = this; + + this.registerComponent('foo-bar', { template: '' }); + + expectAssertion(function () { + _this6.render('{{foo-bar id="zomg" elementId="lol"}}'); + }, /You cannot invoke a component with both 'id' and 'elementId' at the same time./); + }; + + _class.prototype['@test it can have a custom tagName'] = function testItCanHaveACustomTagName() { + var _this7 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'foo-bar' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar}}'); + + this.assertComponentElement(this.firstChild, { tagName: 'foo-bar', content: 'hello' }); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'foo-bar', content: 'hello' }); + }; + + _class.prototype['@test it can have a custom tagName set in the constructor'] = function testItCanHaveACustomTagNameSetInTheConstructor() { + var _this8 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + this.tagName = 'foo-bar'; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar}}'); + + this.assertComponentElement(this.firstChild, { tagName: 'foo-bar', content: 'hello' }); + + this.runTask(function () { + return _this8.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'foo-bar', content: 'hello' }); + }; + + _class.prototype['@test it can have a custom tagName from the invocation'] = function testItCanHaveACustomTagNameFromTheInvocation() { + var _this9 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar tagName="foo-bar"}}'); + + this.assertComponentElement(this.firstChild, { tagName: 'foo-bar', content: 'hello' }); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'foo-bar', content: 'hello' }); + }; + + _class.prototype['@test class is applied before didInsertElement'] = function testClassIsAppliedBeforeDidInsertElement(assert) { + var componentClass = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + componentClass = this.element.className; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar class="foo-bar"}}'); + + assert.equal(componentClass, 'foo-bar ember-view'); + }; + + _class.prototype['@test it can have custom classNames'] = function testItCanHaveCustomClassNames() { + var _this10 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNames: ['foo', 'bar'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar}}'); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar') }, content: 'hello' }); + + this.runTask(function () { + return _this10.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar') }, content: 'hello' }); + }; + + _class.prototype['@test should not apply falsy class name'] = function testShouldNotApplyFalsyClassName() { + var _this11 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar class=somethingFalsy}}', { + somethingFalsy: false + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: 'ember-view' }, content: 'hello' }); + + this.runTask(function () { + return _this11.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: 'ember-view' }, content: 'hello' }); + }; + + _class.prototype['@test should apply classes of the dasherized property name when bound property specified is true'] = function testShouldApplyClassesOfTheDasherizedPropertyNameWhenBoundPropertySpecifiedIsTrue() { + var _this12 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar class=model.someTruth}}', { + model: { someTruth: true } + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('ember-view some-truth') }, content: 'hello' }); + + this.runTask(function () { + return _this12.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('ember-view some-truth') }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'model.someTruth', false); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'model', { someTruth: true }); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('ember-view some-truth') }, content: 'hello' }); + }; + + _class.prototype['@test class property on components can be dynamic'] = function testClassPropertyOnComponentsCanBeDynamic() { + var _this13 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar class=(if fooBar "foo-bar")}}', { + fooBar: true + }); + + this.assertComponentElement(this.firstChild, { content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar') } }); + + this.runTask(function () { + return _this13.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar') } }); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'fooBar', false); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') } }); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'fooBar', true); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar') } }); + }; + + _class.prototype['@test it can have custom classNames from constructor'] = function testItCanHaveCustomClassNamesFromConstructor() { + var _this14 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + this.classNames.push('foo', 'bar', 'outside-' + this.get('extraClass')); + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar extraClass="baz"}}'); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar outside-baz') }, content: 'hello' }); + + this.runTask(function () { + return _this14.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar outside-baz') }, content: 'hello' }); + }; + + _class.prototype['@test it can set custom classNames from the invocation'] = function testItCanSetCustomClassNamesFromTheInvocation() { + var _this15 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNames: ['foo'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject)); + + this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar baz') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar baz') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo') }, content: 'hello' }); + + this.runTask(function () { + return _this15.rerender(); + }); + + this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar baz') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar baz') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo') }, content: 'hello' }); + }; + + _class.prototype['@test it has an element'] = function testItHasAnElement() { + var _this16 = this; + + var instance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + instance = this; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar}}'); + + var element1 = instance.element; + + this.assertComponentElement(element1, { content: 'hello' }); + + this.runTask(function () { + return _this16.rerender(); + }); + + var element2 = instance.element; + + this.assertComponentElement(element2, { content: 'hello' }); + + this.assertSameNode(element2, element1); + }; + + _class.prototype['@test it has a jQuery proxy to the element'] = function testItHasAJQueryProxyToTheElement(assert) { + var _this17 = this; + + var instance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + instance = this; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar}}'); + + var element1 = instance.$()[0]; + + this.assertComponentElement(element1, { content: 'hello' }); + + this.runTask(function () { + return _this17.rerender(); + }); + + var element2 = instance.$()[0]; + + this.assertComponentElement(element2, { content: 'hello' }); + + this.assertSameNode(element2, element1); + }; + + _class.prototype['@test it scopes the jQuery proxy to the component element'] = function testItScopesTheJQueryProxyToTheComponentElement(assert) { + var _this18 = this; + + var instance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + instance = this; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'inner' }); + + this.render('outer{{foo-bar}}'); + + var $span = instance.$('span'); + + assert.equal($span.length, 1); + assert.equal($span.attr('class'), 'inner'); + + this.runTask(function () { + return _this18.rerender(); + }); + + $span = instance.$('span'); + + assert.equal($span.length, 1); + assert.equal($span.attr('class'), 'inner'); + }; + + _class.prototype['@test an empty component does not have childNodes'] = function testAnEmptyComponentDoesNotHaveChildNodes(assert) { + var _this19 = this; + + var fooBarInstance = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'input', + init: function () { + this._super(); + fooBarInstance = this; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '' }); + + this.render('{{foo-bar}}'); + + this.assertComponentElement(this.firstChild, { tagName: 'input' }); + + assert.strictEqual(fooBarInstance.element.childNodes.length, 0); + + this.runTask(function () { + return _this19.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'input' }); + + assert.strictEqual(fooBarInstance.element.childNodes.length, 0); + }; + + _class.prototype['@test it has the right parentView and childViews'] = function testItHasTheRightParentViewAndChildViews(assert) { + var _this20 = this; + + var fooBarInstance = undefined, + fooBarBazInstance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + fooBarInstance = this; + } + }); + + var FooBarBazComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + fooBarBazInstance = this; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'foo-bar {{foo-bar-baz}}' }); + this.registerComponent('foo-bar-baz', { ComponentClass: FooBarBazComponent, template: 'foo-bar-baz' }); + + this.render('{{foo-bar}}'); + this.assertText('foo-bar foo-bar-baz'); + + assert.equal(fooBarInstance.parentView, this.component); + assert.equal(fooBarBazInstance.parentView, fooBarInstance); + + assert.deepEqual(this.component.childViews, [fooBarInstance]); + assert.deepEqual(fooBarInstance.childViews, [fooBarBazInstance]); + + this.runTask(function () { + return _this20.rerender(); + }); + this.assertText('foo-bar foo-bar-baz'); + + assert.equal(fooBarInstance.parentView, this.component); + assert.equal(fooBarBazInstance.parentView, fooBarInstance); + + assert.deepEqual(this.component.childViews, [fooBarInstance]); + assert.deepEqual(fooBarInstance.childViews, [fooBarBazInstance]); + }; + + _class.prototype['@test it renders passed named arguments'] = function testItRendersPassedNamedArguments() { + var _this21 = this; + + this.registerComponent('foo-bar', { + template: '{{foo}}' + }); + + this.render('{{foo-bar foo=model.bar}}', { + model: { + bar: 'Hola' + } + }); + + this.assertText('Hola'); + + this.runTask(function () { + return _this21.rerender(); + }); + + this.assertText('Hola'); + + this.runTask(function () { + return _this21.context.set('model.bar', 'Hello'); + }); + + this.assertText('Hello'); + + this.runTask(function () { + return _this21.context.set('model', { bar: 'Hola' }); + }); + + this.assertText('Hola'); + }; + + _class.prototype['@test it can render a basic component with a block'] = function testItCanRenderABasicComponentWithABlock() { + var _this22 = this; + + this.registerComponent('foo-bar', { template: '{{yield}} - In component' }); + + this.render('{{#foo-bar}}hello{{/foo-bar}}'); + + this.assertComponentElement(this.firstChild, { content: 'hello - In component' }); + + this.runTask(function () { + return _this22.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello - In component' }); + }; + + _class.prototype['@test it can render a basic component with a block when the yield is in a partial'] = function testItCanRenderABasicComponentWithABlockWhenTheYieldIsInAPartial() { + var _this23 = this; + + this.registerPartial('_partialWithYield', 'yielded: [{{yield}}]'); + + this.registerComponent('foo-bar', { template: '{{partial "partialWithYield"}} - In component' }); + + this.render('{{#foo-bar}}hello{{/foo-bar}}'); + + this.assertComponentElement(this.firstChild, { content: 'yielded: [hello] - In component' }); + + this.runTask(function () { + return _this23.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'yielded: [hello] - In component' }); + }; + + _class.prototype['@test it can render a basic component with a block param when the yield is in a partial'] = function testItCanRenderABasicComponentWithABlockParamWhenTheYieldIsInAPartial() { + var _this24 = this; + + this.registerPartial('_partialWithYield', 'yielded: [{{yield "hello"}}]'); + + this.registerComponent('foo-bar', { template: '{{partial "partialWithYield"}} - In component' }); + + this.render('{{#foo-bar as |value|}}{{value}}{{/foo-bar}}'); + + this.assertComponentElement(this.firstChild, { content: 'yielded: [hello] - In component' }); + + this.runTask(function () { + return _this24.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'yielded: [hello] - In component' }); + }; + + _class.prototype['@test it renders the layout with the component instance as the context'] = function testItRendersTheLayoutWithTheComponentInstanceAsTheContext() { + var _this25 = this; + + var instance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + instance = this; + this.set('message', 'hello'); + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '{{message}}' }); + + this.render('{{foo-bar}}'); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + + this.runTask(function () { + return _this25.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(instance, 'message', 'goodbye'); + }); + + this.assertComponentElement(this.firstChild, { content: 'goodbye' }); + + this.runTask(function () { + return _emberMetal.set(instance, 'message', 'hello'); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + }; + + _class.prototype['@test it preserves the outer context when yielding'] = function testItPreservesTheOuterContextWhenYielding() { + var _this26 = this; + + this.registerComponent('foo-bar', { template: '{{yield}}' }); + + this.render('{{#foo-bar}}{{message}}{{/foo-bar}}', { message: 'hello' }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + + this.runTask(function () { + return _this26.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this26.context, 'message', 'goodbye'); + }); + + this.assertComponentElement(this.firstChild, { content: 'goodbye' }); + + this.runTask(function () { + return _emberMetal.set(_this26.context, 'message', 'hello'); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + }; + + _class.prototype['@test it can yield a block param named for reserved words [GH#14096]'] = function testItCanYieldABlockParamNamedForReservedWordsGH14096() { + var instance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + instance = this; + }, + + name: 'foo-bar' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '{{yield this}}' }); + + this.render('{{#foo-bar as |component|}}{{component.name}}{{/foo-bar}}'); + + this.assertComponentElement(this.firstChild, { content: 'foo-bar' }); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(instance, 'name', 'derp-qux'); + }); + + this.assertComponentElement(this.firstChild, { content: 'derp-qux' }); + + this.runTask(function () { + return _emberMetal.set(instance, 'name', 'foo-bar'); + }); + + this.assertComponentElement(this.firstChild, { content: 'foo-bar' }); + }; + + _class.prototype['@test it can yield internal and external properties positionally'] = function testItCanYieldInternalAndExternalPropertiesPositionally() { + var _this27 = this; + + var instance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + instance = this; + }, + greeting: 'hello' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '{{yield greeting greetee.firstName}}' }); + + this.render('{{#foo-bar greetee=person as |greeting name|}}{{name}} {{person.lastName}}, {{greeting}}{{/foo-bar}}', { + person: { + firstName: 'Joel', + lastName: 'Kang' + } + }); + + this.assertComponentElement(this.firstChild, { content: 'Joel Kang, hello' }); + + this.runTask(function () { + return _this27.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'Joel Kang, hello' }); + + this.runTask(function () { + return _emberMetal.set(_this27.context, 'person', { firstName: 'Dora', lastName: 'the Explorer' }); + }); + + this.assertComponentElement(this.firstChild, { content: 'Dora the Explorer, hello' }); + + this.runTask(function () { + return _emberMetal.set(instance, 'greeting', 'hola'); + }); + + this.assertComponentElement(this.firstChild, { content: 'Dora the Explorer, hola' }); + + this.runTask(function () { + _emberMetal.set(instance, 'greeting', 'hello'); + _emberMetal.set(_this27.context, 'person', { + firstName: 'Joel', + lastName: 'Kang' + }); + }); + + this.assertComponentElement(this.firstChild, { content: 'Joel Kang, hello' }); + }; + + _class.prototype['@test #11519 - block param infinite loop'] = function test11519BlockParamInfiniteLoop() { + var _this28 = this; + + var instance = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + instance = this; + }, + danger: 0 + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '{{danger}}{{yield danger}}' }); + + // On initial render, create streams. The bug will not have manifested yet, but at this point + // we have created streams that create a circular invalidation. + this.render('{{#foo-bar as |dangerBlockParam|}}{{/foo-bar}}'); + + this.assertText('0'); + + // Trigger a non-revalidating re-render. The yielded block will not be dirtied + // nor will block param streams, and thus no infinite loop will occur. + this.runTask(function () { + return _this28.rerender(); + }); + + this.assertText('0'); + + // Trigger a revalidation, which will cause an infinite loop without the fix + // in place. Note that we do not see the infinite loop is in testing mode, + // because a deprecation warning about re-renders is issued, which Ember + // treats as an exception. + this.runTask(function () { + return _emberMetal.set(instance, 'danger', 1); + }); + + this.assertText('1'); + + this.runTask(function () { + return _emberMetal.set(instance, 'danger', 0); + }); + + this.assertText('0'); + }; + + _class.prototype['@test the component and its child components are destroyed'] = function testTheComponentAndItsChildComponentsAreDestroyed(assert) { + var _this29 = this; + + var destroyed = { 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0 }; + + this.registerComponent('foo-bar', { + template: '{{id}} {{yield}}', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + willDestroy: function () { + this._super(); + destroyed[this.get('id')]++; + } + }) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2), { + cond1: true, + cond2: true, + cond3: true, + cond4: true, + cond5: true + }); + + this.assertText('1 2 3 4 5 6 7 8 '); + + this.runTask(function () { + return _this29.rerender(); + }); + + assert.deepEqual(destroyed, { 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0 }); + + this.runTask(function () { + return _emberMetal.set(_this29.context, 'cond5', false); + }); + + this.assertText('1 2 3 4 8 '); + + assert.deepEqual(destroyed, { 1: 0, 2: 0, 3: 0, 4: 0, 5: 1, 6: 1, 7: 1, 8: 0 }); + + this.runTask(function () { + _emberMetal.set(_this29.context, 'cond3', false); + _emberMetal.set(_this29.context, 'cond5', true); + _emberMetal.set(_this29.context, 'cond4', false); + }); + + assert.deepEqual(destroyed, { 1: 0, 2: 0, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1 }); + + this.runTask(function () { + _emberMetal.set(_this29.context, 'cond2', false); + _emberMetal.set(_this29.context, 'cond1', false); + }); + + assert.deepEqual(destroyed, { 1: 1, 2: 1, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1 }); + }; + + _class.prototype['@test should escape HTML in normal mustaches'] = function testShouldEscapeHTMLInNormalMustaches() { + var _this30 = this; + + var component = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + output: 'you need to be more bold' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '{{output}}' }); + + this.render('{{foo-bar}}'); + + this.assertText('you need to be more bold'); + + this.runTask(function () { + return _this30.rerender(); + }); + + this.assertText('you need to be more bold'); + + this.runTask(function () { + return _emberMetal.set(component, 'output', 'you are so super'); + }); + + this.assertText('you are so super'); + + this.runTask(function () { + return _emberMetal.set(component, 'output', 'you need to be more bold'); + }); + }; + + _class.prototype['@test should not escape HTML in triple mustaches'] = function testShouldNotEscapeHTMLInTripleMustaches(assert) { + var _this31 = this; + + var expectedHtmlBold = 'you need to be more bold'; + var expectedHtmlItalic = 'you are so super'; + var component = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + output: expectedHtmlBold + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '{{{output}}}' }); + + this.render('{{foo-bar}}'); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.firstChild, expectedHtmlBold); + + this.runTask(function () { + return _this31.rerender(); + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.firstChild, expectedHtmlBold); + + this.runTask(function () { + return _emberMetal.set(component, 'output', expectedHtmlItalic); + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.firstChild, expectedHtmlItalic); + + this.runTask(function () { + return _emberMetal.set(component, 'output', expectedHtmlBold); + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.firstChild, expectedHtmlBold); + }; + + _class.prototype['@test should not escape HTML if string is a htmlSafe'] = function testShouldNotEscapeHTMLIfStringIsAHtmlSafe(assert) { + var _this32 = this; + + var expectedHtmlBold = 'you need to be more bold'; + var expectedHtmlItalic = 'you are so super'; + var component = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + output: _emberGlimmerTestsUtilsHelpers.htmlSafe(expectedHtmlBold) + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '{{output}}' }); + + this.render('{{foo-bar}}'); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.firstChild, expectedHtmlBold); + + this.runTask(function () { + return _this32.rerender(); + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.firstChild, expectedHtmlBold); + + this.runTask(function () { + return _emberMetal.set(component, 'output', _emberGlimmerTestsUtilsHelpers.htmlSafe(expectedHtmlItalic)); + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.firstChild, expectedHtmlItalic); + + this.runTask(function () { + return _emberMetal.set(component, 'output', _emberGlimmerTestsUtilsHelpers.htmlSafe(expectedHtmlBold)); + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.firstChild, expectedHtmlBold); + }; + + _class.prototype['@test late bound layouts return the same definition'] = function testLateBoundLayoutsReturnTheSameDefinition(assert) { + var templateIds = []; + var component = undefined; + + // This is testing the scenario where you import a template and + // set it to the layout property: + // + // import layout from './template'; + // + // export default Ember.Component.extend({ + // layout + // }); + var hello = _emberGlimmerTestsUtilsHelpers.compile('Hello'); + var bye = _emberGlimmerTestsUtilsHelpers.compile('Bye'); + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + this.layout = this.cond ? hello : bye; + component = this; + templateIds.push(this.layout.id); + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent }); + + this.render('{{foo-bar cond=true}}{{foo-bar cond=false}}{{foo-bar cond=true}}{{foo-bar cond=false}}'); + + var t1 = templateIds[0]; + var t2 = templateIds[1]; + var t3 = templateIds[2]; + var t4 = templateIds[3]; + + assert.equal(t1, t3); + assert.equal(t2, t4); + }; + + _class.prototype['@test can use isStream property without conflict (#13271)'] = function testCanUseIsStreamPropertyWithoutConflict13271() { + var _this33 = this; + + var component = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + isStream: true, + + init: function () { + this._super.apply(this, arguments); + component = this; + } + }); + + this.registerComponent('foo-bar', { + ComponentClass: FooBarComponent, + + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3) + }); + + this.render('{{foo-bar}}'); + + this.assertComponentElement(this.firstChild, { content: 'true' }); + + this.runTask(function () { + return _this33.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'true' }); + + this.runTask(function () { + return _emberMetal.set(component, 'isStream', false); + }); + + this.assertComponentElement(this.firstChild, { content: 'false' }); + + this.runTask(function () { + return _emberMetal.set(component, 'isStream', true); + }); + + this.assertComponentElement(this.firstChild, { content: 'true' }); + }; + + _class.prototype['@test lookup of component takes priority over property'] = function testLookupOfComponentTakesPriorityOverProperty() { + var _this34 = this; + + this.registerComponent('some-component', { + template: 'some-component' + }); + + this.render('{{some-prop}} {{some-component}}', { + 'some-component': 'not-some-component', + 'some-prop': 'some-prop' + }); + + this.assertText('some-prop some-component'); + + this.runTask(function () { + return _this34.rerender(); + }); + + this.assertText('some-prop some-component'); + }; + + _class.prototype['@test component without dash is not looked up'] = function testComponentWithoutDashIsNotLookedUp() { + var _this35 = this; + + this.registerComponent('somecomponent', { + template: 'somecomponent' + }); + + this.render('{{somecomponent}}', { + 'somecomponent': 'notsomecomponent' + }); + + this.assertText('notsomecomponent'); + + this.runTask(function () { + return _this35.rerender(); + }); + + this.assertText('notsomecomponent'); + + this.runTask(function () { + return _this35.context.set('somecomponent', 'not not notsomecomponent'); + }); + + this.assertText('not not notsomecomponent'); + + this.runTask(function () { + return _this35.context.set('somecomponent', 'notsomecomponent'); + }); + + this.assertText('notsomecomponent'); + }; + + _class.prototype['@test non-block with properties on attrs'] = function testNonBlockWithPropertiesOnAttrs() { + var _this36 = this; + + this.registerComponent('non-block', { + template: 'In layout - someProp: {{attrs.someProp}}' + }); + + this.render('{{non-block someProp=prop}}', { + prop: 'something here' + }); + + this.assertText('In layout - someProp: something here'); + + this.runTask(function () { + return _this36.rerender(); + }); + + this.assertText('In layout - someProp: something here'); + + this.runTask(function () { + return _this36.context.set('prop', 'other thing there'); + }); + + this.assertText('In layout - someProp: other thing there'); + + this.runTask(function () { + return _this36.context.set('prop', 'something here'); + }); + + this.assertText('In layout - someProp: something here'); + }; + + _class.prototype['@test non-block with properties overridden in init'] = function testNonBlockWithPropertiesOverriddenInInit() { + var _this37 = this; + + var instance = undefined; + this.registerComponent('non-block', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + instance = this; + this.someProp = 'value set in instance'; + } + }), + template: 'In layout - someProp: {{someProp}}' + }); + + this.render('{{non-block someProp=prop}}', { + prop: 'something passed when invoked' + }); + + this.assertText('In layout - someProp: value set in instance'); + + this.runTask(function () { + return _this37.rerender(); + }); + + this.assertText('In layout - someProp: value set in instance'); + + this.runTask(function () { + return _this37.context.set('prop', 'updated something passed when invoked'); + }); + + this.assertText('In layout - someProp: updated something passed when invoked'); + + this.runTask(function () { + return instance.set('someProp', 'update value set in instance'); + }); + + this.assertText('In layout - someProp: update value set in instance'); + + this.runTask(function () { + return _this37.context.set('prop', 'something passed when invoked'); + }); + this.runTask(function () { + return instance.set('someProp', 'value set in instance'); + }); + + this.assertText('In layout - someProp: value set in instance'); + }; + + _class.prototype['@test rerendering component with attrs from parent'] = function testRerenderingComponentWithAttrsFromParent(assert) { + var _this38 = this; + + var willUpdateCount = 0; + var didReceiveAttrsCount = 0; + + function expectHooks(_ref, callback) { + var willUpdate = _ref.willUpdate; + var didReceiveAttrs = _ref.didReceiveAttrs; + + willUpdateCount = 0; + didReceiveAttrsCount = 0; + + callback(); + + if (willUpdate) { + assert.strictEqual(willUpdateCount, 1, 'The willUpdate hook was fired'); + } else { + assert.strictEqual(willUpdateCount, 0, 'The willUpdate hook was not fired'); + } + + if (didReceiveAttrs) { + assert.strictEqual(didReceiveAttrsCount, 1, 'The didReceiveAttrs hook was fired'); + } else { + assert.strictEqual(didReceiveAttrsCount, 0, 'The didReceiveAttrs hook was not fired'); + } + } + + this.registerComponent('non-block', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didReceiveAttrs: function () { + didReceiveAttrsCount++; + }, + + willUpdate: function () { + willUpdateCount++; + } + }), + template: 'In layout - someProp: {{someProp}}' + }); + + expectHooks({ willUpdate: false, didReceiveAttrs: true }, function () { + _this38.render('{{non-block someProp=someProp}}', { + someProp: 'wycats' + }); + }); + + this.assertText('In layout - someProp: wycats'); + + // Note: Hooks are not fired in Glimmer for idempotent re-renders + expectHooks({ willUpdate: false, didReceiveAttrs: false }, function () { + _this38.runTask(function () { + return _this38.rerender(); + }); + }); + + this.assertText('In layout - someProp: wycats'); + + expectHooks({ willUpdate: true, didReceiveAttrs: true }, function () { + _this38.runTask(function () { + return _this38.context.set('someProp', 'tomdale'); + }); + }); + + this.assertText('In layout - someProp: tomdale'); + + // Note: Hooks are not fired in Glimmer for idempotent re-renders + expectHooks({ willUpdate: false, didReceiveAttrs: false }, function () { + _this38.runTask(function () { + return _this38.rerender(); + }); + }); + + this.assertText('In layout - someProp: tomdale'); + + expectHooks({ willUpdate: true, didReceiveAttrs: true }, function () { + _this38.runTask(function () { + return _this38.context.set('someProp', 'wycats'); + }); + }); + + this.assertText('In layout - someProp: wycats'); + }; + + _class.prototype['@test this.attrs.foo === attrs.foo === foo'] = function testThisAttrsFooAttrsFooFoo() { + var _this39 = this; + + this.registerComponent('foo-bar', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4) + }); + + this.render('{{foo-bar value=model.value items=model.items}}', { + model: { + value: 'wat', + items: [1, 2, 3] + } + }); + + this.assertStableRerender(); + + this.runTask(function () { + _this39.context.set('model.value', 'lul'); + _this39.context.set('model.items', [1]); + }); + + this.assertText(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5)); + + this.runTask(function () { + return _this39.context.set('model', { value: 'wat', items: [1, 2, 3] }); + }); + + this.assertText('Args: wat | wat | wat123123123'); + }; + + _class.prototype['@test non-block with properties on self'] = function testNonBlockWithPropertiesOnSelf() { + var _this40 = this; + + this.registerComponent('non-block', { + template: 'In layout - someProp: {{someProp}}' + }); + + this.render('{{non-block someProp=prop}}', { + prop: 'something here' + }); + + this.assertText('In layout - someProp: something here'); + + this.runTask(function () { + return _this40.rerender(); + }); + + this.assertText('In layout - someProp: something here'); + + this.runTask(function () { + return _this40.context.set('prop', 'something else'); + }); + + this.assertText('In layout - someProp: something else'); + + this.runTask(function () { + return _this40.context.set('prop', 'something here'); + }); + + this.assertText('In layout - someProp: something here'); + }; + + _class.prototype['@test block with properties on self'] = function testBlockWithPropertiesOnSelf() { + var _this41 = this; + + this.registerComponent('with-block', { + template: 'In layout - someProp: {{someProp}} - {{yield}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject6), { + prop: 'something here' + }); + + this.assertText('In layout - someProp: something here - In template'); + + this.runTask(function () { + return _this41.rerender(); + }); + + this.assertText('In layout - someProp: something here - In template'); + + this.runTask(function () { + return _this41.context.set('prop', 'something else'); + }); + + this.assertText('In layout - someProp: something else - In template'); + + this.runTask(function () { + return _this41.context.set('prop', 'something here'); + }); + + this.assertText('In layout - someProp: something here - In template'); + }; + + _class.prototype['@test block with properties on attrs'] = function testBlockWithPropertiesOnAttrs() { + var _this42 = this; + + this.registerComponent('with-block', { + template: 'In layout - someProp: {{attrs.someProp}} - {{yield}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject6), { + prop: 'something here' + }); + + this.assertText('In layout - someProp: something here - In template'); + + this.runTask(function () { + return _this42.rerender(); + }); + + this.assertText('In layout - someProp: something here - In template'); + + this.runTask(function () { + return _this42.context.set('prop', 'something else'); + }); + + this.assertText('In layout - someProp: something else - In template'); + + this.runTask(function () { + return _this42.context.set('prop', 'something here'); + }); + + this.assertText('In layout - someProp: something here - In template'); + }; + + _class.prototype['@test static arbitrary number of positional parameters'] = function testStaticArbitraryNumberOfPositionalParameters(assert) { + var _this43 = this; + + this.registerComponent('sample-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'names' + }), + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject7) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject8)); + + assert.equal(this.$('#args-3').text(), 'Foo4Bar'); + assert.equal(this.$('#args-5').text(), 'Foo4Bar5Baz'); + + this.runTask(function () { + return _this43.rerender(); + }); + + assert.equal(this.$('#args-3').text(), 'Foo4Bar'); + assert.equal(this.$('#args-5').text(), 'Foo4Bar5Baz'); + }; + + _class.prototype['@test arbitrary positional parameter conflict with hash parameter is reported'] = function testArbitraryPositionalParameterConflictWithHashParameterIsReported() { + var _this44 = this; + + this.registerComponent('sample-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'names' + }), + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject7) + }); + + expectAssertion(function () { + _this44.render('{{sample-component "Foo" 4 "Bar" names=numbers id="args-3"}}', { + numbers: [1, 2, 3] + }); + }, 'You cannot specify positional parameters and the hash argument `names`.'); + }; + + _class.prototype['@test can use hash parameter instead of arbitrary positional param [GH #12444]'] = function testCanUseHashParameterInsteadOfArbitraryPositionalParamGH12444(assert) { + var _this45 = this; + + this.registerComponent('sample-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'names' + }), + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject7) + }); + + this.render('{{sample-component names=things}}', { + things: _emberRuntime.A(['Foo', 4, 'Bar']) + }); + + this.assertText('Foo4Bar'); + + this.runTask(function () { + return _this45.rerender(); + }); + + this.assertText('Foo4Bar'); + + this.runTask(function () { + return _this45.context.get('things').pushObject(5); + }); + + this.assertText('Foo4Bar5'); + + this.runTask(function () { + return _this45.context.get('things').shiftObject(); + }); + + this.assertText('4Bar5'); + + this.runTask(function () { + return _this45.context.get('things').clear(); + }); + + this.assertText(''); + + this.runTask(function () { + return _this45.context.set('things', _emberRuntime.A(['Foo', 4, 'Bar'])); + }); + + this.assertText('Foo4Bar'); + }; + + _class.prototype['@test can use hash parameter instead of positional param'] = function testCanUseHashParameterInsteadOfPositionalParam(assert) { + var _this46 = this; + + this.registerComponent('sample-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['first', 'second'] + }), + template: '{{first}} - {{second}}' + }); + + // TODO: Fix when id is implemented + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject9)); + + assert.equal(this.$('#two-positional').text(), 'one - two'); + assert.equal(this.$('#one-positional').text(), 'one - two'); + assert.equal(this.$('#no-positional').text(), 'one - two'); + + this.runTask(function () { + return _this46.rerender(); + }); + + assert.equal(this.$('#two-positional').text(), 'one - two'); + assert.equal(this.$('#one-positional').text(), 'one - two'); + assert.equal(this.$('#no-positional').text(), 'one - two'); + }; + + _class.prototype['@test dynamic arbitrary number of positional parameters'] = function testDynamicArbitraryNumberOfPositionalParameters(assert) { + var _this47 = this; + + this.registerComponent('sample-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'n' + }), + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject10) + }); + + this.render('{{sample-component user1 user2}}', { + user1: 'Foo', + user2: 4 + }); + + this.assertText('Foo4'); + + this.runTask(function () { + return _this47.rerender(); + }); + + this.assertText('Foo4'); + + this.runTask(function () { + return _this47.context.set('user1', 'Bar'); + }); + + this.assertText('Bar4'); + + this.runTask(function () { + return _this47.context.set('user2', '5'); + }); + + this.assertText('Bar5'); + + this.runTask(function () { + _this47.context.set('user1', 'Foo'); + _this47.context.set('user2', 4); + }); + + this.assertText('Foo4'); + }; + + _class.prototype['@test with ariaRole specified'] = function testWithAriaRoleSpecified() { + var _this48 = this; + + this.registerComponent('aria-test', { + template: 'Here!' + }); + + this.render('{{aria-test ariaRole=role}}', { + role: 'main' + }); + + this.assertComponentElement(this.firstChild, { attrs: { role: 'main' } }); + + this.runTask(function () { + return _this48.rerender(); + }); + + this.assertComponentElement(this.firstChild, { attrs: { role: 'main' } }); + + this.runTask(function () { + return _this48.context.set('role', 'input'); + }); + + this.assertComponentElement(this.firstChild, { attrs: { role: 'input' } }); + + this.runTask(function () { + return _this48.context.set('role', 'main'); + }); + + this.assertComponentElement(this.firstChild, { attrs: { role: 'main' } }); + }; + + _class.prototype['@test `template` specified in component is overriden by block'] = function testTemplateSpecifiedInComponentIsOverridenByBlock() { + var _this49 = this; + + this.registerComponent('with-template', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + template: _emberGlimmerTestsUtilsHelpers.compile('Should not be used') + }), + template: '[In layout - {{name}}] {{yield}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject11), { + name: 'Whoop, whoop!' + }); + + this.assertText('[In layout - with-block] [In block - Whoop, whoop!][In layout - without-block] '); + + this.runTask(function () { + return _this49.rerender(); + }); + + this.assertText('[In layout - with-block] [In block - Whoop, whoop!][In layout - without-block] '); + + this.runTask(function () { + return _this49.context.set('name', 'Ole, ole'); + }); + + this.assertText('[In layout - with-block] [In block - Ole, ole][In layout - without-block] '); + + this.runTask(function () { + return _this49.context.set('name', 'Whoop, whoop!'); + }); + + this.assertText('[In layout - with-block] [In block - Whoop, whoop!][In layout - without-block] '); + }; + + _class.prototype['@test hasBlock is true when block supplied'] = function testHasBlockIsTrueWhenBlockSupplied() { + var _this50 = this; + + this.registerComponent('with-block', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject12) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject13)); + + this.assertText('In template'); + + this.runTask(function () { + return _this50.rerender(); + }); + + this.assertText('In template'); + }; + + _class.prototype['@test hasBlock is false when no block supplied'] = function testHasBlockIsFalseWhenNoBlockSupplied() { + var _this51 = this; + + this.registerComponent('with-block', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject12) + }); + + this.render('{{with-block}}'); + + this.assertText('No Block!'); + + this.runTask(function () { + return _this51.rerender(); + }); + + this.assertText('No Block!'); + }; + + _class.prototype['@test hasBlockParams is true when block param supplied'] = function testHasBlockParamsIsTrueWhenBlockParamSupplied() { + var _this52 = this; + + this.registerComponent('with-block', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject14) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject15)); + + this.assertText('In template - In Component'); + + this.runTask(function () { + return _this52.rerender(); + }); + + this.assertText('In template - In Component'); + }; + + _class.prototype['@test hasBlockParams is false when no block param supplied'] = function testHasBlockParamsIsFalseWhenNoBlockParamSupplied() { + var _this53 = this; + + this.registerComponent('with-block', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject16) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject17)); + + this.assertText('In block No Block Param!'); + + this.runTask(function () { + return _this53.rerender(); + }); + + this.assertText('In block No Block Param!'); + }; + + _class.prototype['@test static named positional parameters'] = function testStaticNamedPositionalParameters() { + var _this54 = this; + + this.registerComponent('sample-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['name', 'age'] + }), + template: '{{name}}{{age}}' + }); + + this.render('{{sample-component "Quint" 4}}'); + + this.assertText('Quint4'); + + this.runTask(function () { + return _this54.rerender(); + }); + + this.assertText('Quint4'); + }; + + _class.prototype['@test dynamic named positional parameters'] = function testDynamicNamedPositionalParameters() { + var _this55 = this; + + this.registerComponent('sample-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['name', 'age'] + }), + template: '{{name}}{{age}}' + }); + + this.render('{{sample-component myName myAge}}', { + myName: 'Quint', + myAge: 4 + }); + + this.assertText('Quint4'); + + this.runTask(function () { + return _this55.rerender(); + }); + + this.assertText('Quint4'); + + this.runTask(function () { + return _this55.context.set('myName', 'Sergio'); + }); + + this.assertText('Sergio4'); + + this.runTask(function () { + return _this55.context.set('myAge', 2); + }); + + this.assertText('Sergio2'); + + this.runTask(function () { + _this55.context.set('myName', 'Quint'); + _this55.context.set('myAge', 4); + }); + + this.assertText('Quint4'); + }; + + _class.prototype['@test if a value is passed as a non-positional parameter, it raises an assertion'] = function testIfAValueIsPassedAsANonPositionalParameterItRaisesAnAssertion() { + var _this56 = this; + + this.registerComponent('sample-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['name'] + }), + template: '{{name}}' + }); + + expectAssertion(function () { + _this56.render('{{sample-component notMyName name=myName}}', { + myName: 'Quint', + notMyName: 'Sergio' + }); + }, 'You cannot specify both a positional param (at position 0) and the hash argument `name`.'); + }; + + _class.prototype['@test yield to inverse'] = function testYieldToInverse() { + var _this57 = this; + + this.registerComponent('my-if', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject18) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject19), { + activated: true + }); + + this.assertText('Yes:Hello42'); + + this.runTask(function () { + return _this57.rerender(); + }); + + this.assertText('Yes:Hello42'); + + this.runTask(function () { + return _this57.context.set('activated', false); + }); + + this.assertText('No:Goodbye'); + + this.runTask(function () { + return _this57.context.set('activated', true); + }); + + this.assertText('Yes:Hello42'); + }; + + _class.prototype['@test expression hasBlock inverse'] = function testExpressionHasBlockInverse(assert) { + this.registerComponent('check-inverse', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject20) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject21)); + + this.assertComponentElement(this.firstChild, { content: 'No' }); + this.assertComponentElement(this.nthChild(1), { content: 'Yes' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test expression hasBlock default'] = function testExpressionHasBlockDefault(assert) { + this.registerComponent('check-block', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject22) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject23)); + + this.assertComponentElement(this.firstChild, { content: 'No' }); + this.assertComponentElement(this.nthChild(1), { content: 'Yes' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test expression hasBlockParams inverse'] = function testExpressionHasBlockParamsInverse(assert) { + this.registerComponent('check-inverse', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject24) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject25)); + + this.assertComponentElement(this.firstChild, { content: 'No' }); + this.assertComponentElement(this.nthChild(1), { content: 'No' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test expression hasBlockParams default'] = function testExpressionHasBlockParamsDefault(assert) { + this.registerComponent('check-block', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject26) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject27)); + + this.assertComponentElement(this.firstChild, { content: 'No' }); + this.assertComponentElement(this.nthChild(1), { content: 'Yes' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test non-expression hasBlock'] = function testNonExpressionHasBlock(assert) { + this.registerComponent('check-block', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject28) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject23)); + + this.assertComponentElement(this.firstChild, { content: 'No' }); + this.assertComponentElement(this.nthChild(1), { content: 'Yes' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test expression hasBlockParams'] = function testExpressionHasBlockParams(assert) { + this.registerComponent('check-params', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject26) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject29)); + + this.assertComponentElement(this.firstChild, { content: 'No' }); + this.assertComponentElement(this.nthChild(1), { content: 'Yes' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test non-expression hasBlockParams'] = function testNonExpressionHasBlockParams(assert) { + this.registerComponent('check-params', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject30) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject29)); + + this.assertComponentElement(this.firstChild, { content: 'No' }); + this.assertComponentElement(this.nthChild(1), { content: 'Yes' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test hasBlock expression in an attribute'] = function testHasBlockExpressionInAnAttribute(assert) { + this.registerComponent('check-attr', { + template: '' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject31)); + + _emberGlimmerTestsUtilsTestHelpers.equalsElement(this.$('button')[0], 'button', { name: 'false' }, ''); + _emberGlimmerTestsUtilsTestHelpers.equalsElement(this.$('button')[1], 'button', { name: 'true' }, ''); + + this.assertStableRerender(); + }; + + _class.prototype['@test hasBlock inverse expression in an attribute'] = function testHasBlockInverseExpressionInAnAttribute(assert) { + this.registerComponent('check-attr', { + template: '' + }, ''); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject32)); + + _emberGlimmerTestsUtilsTestHelpers.equalsElement(this.$('button')[0], 'button', { name: 'false' }, ''); + _emberGlimmerTestsUtilsTestHelpers.equalsElement(this.$('button')[1], 'button', { name: 'true' }, ''); + + this.assertStableRerender(); + }; + + _class.prototype['@test hasBlockParams expression in an attribute'] = function testHasBlockParamsExpressionInAnAttribute(assert) { + this.registerComponent('check-attr', { + template: '' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject33)); + + _emberGlimmerTestsUtilsTestHelpers.equalsElement(this.$('button')[0], 'button', { name: 'false' }, ''); + _emberGlimmerTestsUtilsTestHelpers.equalsElement(this.$('button')[1], 'button', { name: 'true' }, ''); + + this.assertStableRerender(); + }; + + _class.prototype['@test hasBlockParams inverse expression in an attribute'] = function testHasBlockParamsInverseExpressionInAnAttribute(assert) { + this.registerComponent('check-attr', { + template: '' + }, ''); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject33)); + + _emberGlimmerTestsUtilsTestHelpers.equalsElement(this.$('button')[0], 'button', { name: 'false' }, ''); + _emberGlimmerTestsUtilsTestHelpers.equalsElement(this.$('button')[1], 'button', { name: 'false' }, ''); + + this.assertStableRerender(); + }; + + _class.prototype['@test hasBlock as a param to a helper'] = function testHasBlockAsAParamToAHelper(assert) { + this.registerComponent('check-helper', { + template: '{{if hasBlock "true" "false"}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject34)); + + this.assertComponentElement(this.firstChild, { content: 'false' }); + this.assertComponentElement(this.nthChild(1), { content: 'true' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test hasBlock as an expression param to a helper'] = function testHasBlockAsAnExpressionParamToAHelper(assert) { + this.registerComponent('check-helper', { + template: '{{if (hasBlock) "true" "false"}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject34)); + + this.assertComponentElement(this.firstChild, { content: 'false' }); + this.assertComponentElement(this.nthChild(1), { content: 'true' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test hasBlock inverse as a param to a helper'] = function testHasBlockInverseAsAParamToAHelper(assert) { + this.registerComponent('check-helper', { + template: '{{if (hasBlock "inverse") "true" "false"}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject35)); + + this.assertComponentElement(this.firstChild, { content: 'false' }); + this.assertComponentElement(this.nthChild(1), { content: 'true' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test hasBlockParams as a param to a helper'] = function testHasBlockParamsAsAParamToAHelper(assert) { + this.registerComponent('check-helper', { + template: '{{if hasBlockParams "true" "false"}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject36)); + + this.assertComponentElement(this.firstChild, { content: 'false' }); + this.assertComponentElement(this.nthChild(1), { content: 'true' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test hasBlockParams as an expression param to a helper'] = function testHasBlockParamsAsAnExpressionParamToAHelper(assert) { + this.registerComponent('check-helper', { + template: '{{if (hasBlockParams) "true" "false"}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject36)); + + this.assertComponentElement(this.firstChild, { content: 'false' }); + this.assertComponentElement(this.nthChild(1), { content: 'true' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test hasBlockParams inverse as a param to a helper'] = function testHasBlockParamsInverseAsAParamToAHelper(assert) { + this.registerComponent('check-helper', { + template: '{{if (hasBlockParams "inverse") "true" "false"}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject36)); + + this.assertComponentElement(this.firstChild, { content: 'false' }); + this.assertComponentElement(this.nthChild(1), { content: 'false' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test component in template of a yielding component should have the proper parentView'] = function testComponentInTemplateOfAYieldingComponentShouldHaveTheProperParentView(assert) { + var _this58 = this; + + var outer = undefined, + innerTemplate = undefined, + innerLayout = undefined; + + this.registerComponent('x-outer', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + outer = this; + } + }), + template: '{{x-inner-in-layout}}{{yield}}' + }); + + this.registerComponent('x-inner-in-template', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerTemplate = this; + } + }) + }); + + this.registerComponent('x-inner-in-layout', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerLayout = this; + } + }) + }); + + this.render('{{#x-outer}}{{x-inner-in-template}}{{/x-outer}}'); + + assert.equal(innerTemplate.parentView, outer, 'receives the wrapping component as its parentView in template blocks'); + assert.equal(innerLayout.parentView, outer, 'receives the wrapping component as its parentView in layout'); + assert.equal(outer.parentView, this.context, 'x-outer receives the ambient scope as its parentView'); + + this.runTask(function () { + return _this58.rerender(); + }); + + assert.equal(innerTemplate.parentView, outer, 'receives the wrapping component as its parentView in template blocks'); + assert.equal(innerLayout.parentView, outer, 'receives the wrapping component as its parentView in layout'); + assert.equal(outer.parentView, this.context, 'x-outer receives the ambient scope as its parentView'); + }; + + _class.prototype['@test newly-added sub-components get correct parentView'] = function testNewlyAddedSubComponentsGetCorrectParentView(assert) { + var _this59 = this; + + var outer = undefined, + inner = undefined; + + this.registerComponent('x-outer', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + outer = this; + } + }) + }); + + this.registerComponent('x-inner', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + inner = this; + } + }) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject37), { + showInner: false + }); + + assert.equal(outer.parentView, this.context, 'x-outer receives the ambient scope as its parentView'); + + this.runTask(function () { + return _this59.rerender(); + }); + + assert.equal(outer.parentView, this.context, 'x-outer receives the ambient scope as its parentView (after rerender)'); + + this.runTask(function () { + return _this59.context.set('showInner', true); + }); + + assert.equal(outer.parentView, this.context, 'x-outer receives the ambient scope as its parentView'); + assert.equal(inner.parentView, outer, 'receives the wrapping component as its parentView in template blocks'); + + this.runTask(function () { + return _this59.context.set('showInner', false); + }); + + assert.equal(outer.parentView, this.context, 'x-outer receives the ambient scope as its parentView'); + }; + + _class.prototype['@test when a property is changed during children\'s rendering'] = function testWhenAPropertyIsChangedDuringChildrenSRendering(assert) { + var _this60 = this; + + if (true) { + expectDeprecation(/modified value twice on <\(.+> in a single render/); + } + + var outer = undefined, + middle = undefined; + + this.registerComponent('x-outer', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + outer = this; + }, + value: 1 + }), + template: '{{#x-middle}}{{x-inner value=value}}{{/x-middle}}' + }); + + this.registerComponent('x-middle', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + middle = this; + }, + value: null + }), + template: '
{{value}}
{{yield}}' + }); + + this.registerComponent('x-inner', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + value: null, + pushDataUp: _emberMetal.observer('value', function () { + middle.set('value', this.get('value')); + }) + }), + template: '
{{value}}
' + }); + + this.render('{{x-outer}}'); + + assert.equal(this.$('#inner-value').text(), '1', 'initial render of inner'); + assert.equal(this.$('#middle-value').text(), '', 'initial render of middle (observers do not run during init)'); + + this.runTask(function () { + return _this60.rerender(); + }); + + assert.equal(this.$('#inner-value').text(), '1', 'initial render of inner'); + assert.equal(this.$('#middle-value').text(), '', 'initial render of middle (observers do not run during init)'); + + if (!true) { + expectAssertion(function () { + _this60.runTask(function () { + return outer.set('value', 2); + }); + }, /modified value twice on <\(.+> in a single render/); + + return; + } else { + this.runTask(function () { + return outer.set('value', 2); + }); + } + + assert.equal(this.$('#inner-value').text(), '2', 'second render of inner'); + assert.equal(this.$('#middle-value').text(), '2', 'second render of middle'); + + this.runTask(function () { + return outer.set('value', 3); + }); + + assert.equal(this.$('#inner-value').text(), '3', 'third render of inner'); + assert.equal(this.$('#middle-value').text(), '3', 'third render of middle'); + + this.runTask(function () { + return outer.set('value', 1); + }); + + assert.equal(this.$('#inner-value').text(), '1', 'reset render of inner'); + assert.equal(this.$('#middle-value').text(), '1', 'reset render of middle'); + }; + + _class.prototype['@test when a shared dependency is changed during children\'s rendering'] = function testWhenASharedDependencyIsChangedDuringChildrenSRendering(assert) { + var _this61 = this; + + if (true) { + expectDeprecation(/modified wrapper.content twice on in a single render/); + } + + var outer = undefined, + middle = undefined; + + this.registerComponent('x-outer', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + outer = this; + }, + value: 1, + wrapper: _emberRuntime.Object.create({ content: null }) + }), + template: '
{{wrapper.content}}
{{x-inner value=value wrapper=wrapper}}' + }); + + this.registerComponent('x-inner', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + middle = this; + }, + didReceiveAttrs: function () { + this.get('wrapper').set('content', this.get('value')); + }, + value: null + }), + template: '
{{wrapper.content}}
' + }); + + if (!true) { + expectAssertion(function () { + _this61.render('{{x-outer}}'); + }, /modified wrapper.content twice on in a single render/); + + return; + } else { + this.render('{{x-outer}}'); + } + + assert.equal(this.$('#inner-value').text(), '1', 'initial render of inner'); + assert.equal(this.$('#outer-value').text(), '1', 'initial render of outer'); + + this.runTask(function () { + return _this61.rerender(); + }); + + assert.equal(this.$('#inner-value').text(), '1', 're-render of inner'); + assert.equal(this.$('#outer-value').text(), '1', 're-render of outer'); + + this.runTask(function () { + return outer.set('value', 2); + }); + + assert.equal(this.$('#inner-value').text(), '2', 'second render of inner'); + assert.equal(this.$('#outer-value').text(), '2', 'second render of outer'); + + this.runTask(function () { + return outer.set('value', 3); + }); + + assert.equal(this.$('#inner-value').text(), '3', 'third render of inner'); + assert.equal(this.$('#outer-value').text(), '3', 'third render of outer'); + + this.runTask(function () { + return outer.set('value', 1); + }); + + assert.equal(this.$('#inner-value').text(), '1', 'reset render of inner'); + assert.equal(this.$('#outer-value').text(), '1', 'reset render of outer'); + }; + + _class.prototype['@test non-block with each rendering child components'] = function testNonBlockWithEachRenderingChildComponents() { + var _this62 = this; + + this.registerComponent('non-block', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject38) + }); + + this.registerComponent('child-non-block', { + template: 'Child: {{item}}.' + }); + + var items = _emberRuntime.A(['Tom', 'Dick', 'Harry']); + + this.render('{{non-block items=items}}', { items: items }); + + this.assertText('In layout. [Child: Tom.][Child: Dick.][Child: Harry.]'); + + this.runTask(function () { + return _this62.rerender(); + }); + + this.assertText('In layout. [Child: Tom.][Child: Dick.][Child: Harry.]'); + + this.runTask(function () { + return _this62.context.get('items').pushObject('Sergio'); + }); + + this.assertText('In layout. [Child: Tom.][Child: Dick.][Child: Harry.][Child: Sergio.]'); + + this.runTask(function () { + return _this62.context.get('items').shiftObject(); + }); + + this.assertText('In layout. [Child: Dick.][Child: Harry.][Child: Sergio.]'); + + this.runTask(function () { + return _this62.context.set('items', _emberRuntime.A(['Tom', 'Dick', 'Harry'])); + }); + + this.assertText('In layout. [Child: Tom.][Child: Dick.][Child: Harry.]'); + }; + + _class.prototype['@test specifying classNames results in correct class'] = function testSpecifyingClassNamesResultsInCorrectClass(assert) { + var _this63 = this; + + var clickyThing = undefined; + + this.registerComponent('some-clicky-thing', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'button', + classNames: ['foo', 'bar'], + init: function () { + this._super.apply(this, arguments); + clickyThing = this; + } + }) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject39)); + + // TODO: ember-view is no longer viewable in the classNames array. Bug or + // feature? + var expectedClassNames = ['ember-view', 'foo', 'bar', 'baz']; + + assert.ok(this.$('button').is('.foo.bar.baz.ember-view'), 'the element has the correct classes: ' + this.$('button').attr('class')); + // `ember-view` is no longer in classNames. + // assert.deepEqual(clickyThing.get('classNames'), expectedClassNames, 'classNames are properly combined'); + this.assertComponentElement(this.firstChild, { tagName: 'button', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes(expectedClassNames.join(' ')) } }); + + this.runTask(function () { + return _this63.rerender(); + }); + + assert.ok(this.$('button').is('.foo.bar.baz.ember-view'), 'the element has the correct classes: ' + this.$('button').attr('class') + ' (rerender)'); + // `ember-view` is no longer in classNames. + // assert.deepEqual(clickyThing.get('classNames'), expectedClassNames, 'classNames are properly combined (rerender)'); + this.assertComponentElement(this.firstChild, { tagName: 'button', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes(expectedClassNames.join(' ')) } }); + }; + + _class.prototype['@test specifying custom concatenatedProperties avoids clobbering'] = function testSpecifyingCustomConcatenatedPropertiesAvoidsClobbering(assert) { + var _this64 = this; + + var clickyThing = undefined; + this.registerComponent('some-clicky-thing', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + concatenatedProperties: ['blahzz'], + blahzz: ['blark', 'pory'], + init: function () { + this._super.apply(this, arguments); + clickyThing = this; + } + }), + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject40) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject41)); + + this.assertText('blarkporybaz- Click Me'); + + this.runTask(function () { + return _this64.rerender(); + }); + + this.assertText('blarkporybaz- Click Me'); + }; + + _class.prototype['@test a two way binding flows upstream when consumed in the template'] = function testATwoWayBindingFlowsUpstreamWhenConsumedInTheTemplate() { + var _this65 = this; + + var component = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + } + }); + + this.registerComponent('foo-bar', { + ComponentClass: FooBarComponent, + + template: '{{bar}}' + }); + + this.render('{{localBar}} - {{foo-bar bar=localBar}}', { + localBar: 'initial value' + }); + + this.assertText('initial value - initial value'); + + this.runTask(function () { + return _this65.rerender(); + }); + + this.assertText('initial value - initial value'); + + if (true) { + expectAssertion(function () { + component.bar = 'foo-bar'; + }, /You must use Ember\.set\(\) to set the `bar` property \(of .+\) to `foo-bar`\./); + + this.assertText('initial value - initial value'); + } + + this.runTask(function () { + component.set('bar', 'updated value'); + }); + + this.assertText('updated value - updated value'); + + this.runTask(function () { + component.set('bar', undefined); + }); + + this.assertText(' - '); + + this.runTask(function () { + _this65.component.set('localBar', 'initial value'); + }); + + this.assertText('initial value - initial value'); + }; + + _class.prototype['@test a two way binding flows upstream through a CP when consumed in the template'] = function testATwoWayBindingFlowsUpstreamThroughACPWhenConsumedInTheTemplate() { + var _this66 = this; + + var component = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + + bar: _emberMetal.computed({ + get: function () { + return this._bar; + }, + + set: function (key, value) { + this._bar = value; + return this._bar; + } + }) + }); + + this.registerComponent('foo-bar', { + ComponentClass: FooBarComponent, + + template: '{{bar}}' + }); + + this.render('{{localBar}} - {{foo-bar bar=localBar}}', { + localBar: 'initial value' + }); + + this.assertText('initial value - initial value'); + + this.runTask(function () { + return _this66.rerender(); + }); + + this.assertText('initial value - initial value'); + + this.runTask(function () { + component.set('bar', 'updated value'); + }); + + this.assertText('updated value - updated value'); + + this.runTask(function () { + _this66.component.set('localBar', 'initial value'); + }); + + this.assertText('initial value - initial value'); + }; + + _class.prototype['@test a two way binding flows upstream through a CP without template consumption'] = function testATwoWayBindingFlowsUpstreamThroughACPWithoutTemplateConsumption() { + var _this67 = this; + + var component = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + + bar: _emberMetal.computed({ + get: function () { + return this._bar; + }, + + set: function (key, value) { + this._bar = value; + return this._bar; + } + }) + }); + + this.registerComponent('foo-bar', { + ComponentClass: FooBarComponent, + template: '' + }); + + this.render('{{localBar}}{{foo-bar bar=localBar}}', { + localBar: 'initial value' + }); + + this.assertText('initial value'); + + this.runTask(function () { + return _this67.rerender(); + }); + + this.assertText('initial value'); + + this.runTask(function () { + component.set('bar', 'updated value'); + }); + + this.assertText('updated value'); + + this.runTask(function () { + _this67.component.set('localBar', 'initial value'); + }); + + this.assertText('initial value'); + }; + + _class.prototype['@test services can be injected into components'] = function testServicesCanBeInjectedIntoComponents() { + var _this68 = this; + + var service = undefined; + this.registerService('name', _emberRuntime.Service.extend({ + init: function () { + this._super.apply(this, arguments); + service = this; + }, + last: 'Jackson' + })); + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + name: _emberRuntime.inject.service() + }), + template: '{{name.last}}' + }); + + this.render('{{foo-bar}}'); + + this.assertText('Jackson'); + + this.runTask(function () { + return _this68.rerender(); + }); + + this.assertText('Jackson'); + + this.runTask(function () { + service.set('last', 'McGuffey'); + }); + + this.assertText('McGuffey'); + + this.runTask(function () { + service.set('last', 'Jackson'); + }); + + this.assertText('Jackson'); + }; + + _class.prototype['@test can access `actions` hash via `_actions` [DEPRECATED]'] = function testCanAccessActionsHashVia_actionsDEPRECATED() { + var _this69 = this; + + var component = undefined; + + function derp() {} + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + + actions: { + derp: derp + } + }) + }); + + this.render('{{foo-bar}}'); + + this.assert.strictEqual(component.actions.derp, derp); + + expectDeprecation(function () { + _this69.assert.strictEqual(component._actions.derp, derp); + }, 'Usage of `_actions` is deprecated, use `actions` instead.'); + }; + + _class.prototype['@test throws if `this._super` is not called from `init`'] = function testThrowsIfThis_superIsNotCalledFromInit() { + var _this70 = this; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () {} + }) + }); + + expectAssertion(function () { + _this70.render('{{foo-bar}}'); + }, /You must call `this._super\(...arguments\);` when overriding `init` on a framework object. Please update .* to call `this._super\(...arguments\);` from `init`./); + }; + + _class.prototype['@test should toggle visibility with isVisible'] = function testShouldToggleVisibilityWithIsVisible(assert) { + var _this71 = this; + + var assertStyle = function (expected) { + var matcher = _emberGlimmerTestsUtilsTestHelpers.styles(expected); + var actual = _this71.firstChild.getAttribute('style'); + + assert.pushResult({ + result: matcher.match(actual), + message: matcher.message(), + actual: actual, + expected: expected + }); + }; + + this.registerComponent('foo-bar', { + template: '

foo

' + }); + + this.render('{{foo-bar id="foo-bar" isVisible=visible}}', { + visible: false + }); + + assertStyle('display: none;'); + + this.assertStableRerender(); + + this.runTask(function () { + _emberMetal.set(_this71.context, 'visible', true); + }); + assertStyle(''); + + this.runTask(function () { + _emberMetal.set(_this71.context, 'visible', false); + }); + assertStyle('display: none;'); + }; + + _class.prototype['@test isVisible does not overwrite component style'] = function testIsVisibleDoesNotOverwriteComponentStyle(assert) { + var _this72 = this; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['style'], + style: _emberGlimmerTestsUtilsHelpers.htmlSafe('color: blue;') + }), + + template: '

foo

' + }); + + this.render('{{foo-bar id="foo-bar" isVisible=visible}}', { + visible: false + }); + + this.assertComponentElement(this.firstChild, { + tagName: 'div', + attrs: { id: 'foo-bar', style: _emberGlimmerTestsUtilsTestHelpers.styles('color: blue; display: none;') } + }); + + this.assertStableRerender(); + + this.runTask(function () { + _emberMetal.set(_this72.context, 'visible', true); + }); + + this.assertComponentElement(this.firstChild, { + tagName: 'div', + attrs: { id: 'foo-bar', style: _emberGlimmerTestsUtilsTestHelpers.styles('color: blue;') } + }); + + this.runTask(function () { + _emberMetal.set(_this72.context, 'visible', false); + }); + + this.assertComponentElement(this.firstChild, { + tagName: 'div', + attrs: { id: 'foo-bar', style: _emberGlimmerTestsUtilsTestHelpers.styles('color: blue; display: none;') } + }); + }; + + _class.prototype['@test adds isVisible binding when style binding is missing and other bindings exist'] = function testAddsIsVisibleBindingWhenStyleBindingIsMissingAndOtherBindingsExist(assert) { + var _this73 = this; + + var assertStyle = function (expected) { + var matcher = _emberGlimmerTestsUtilsTestHelpers.styles(expected); + var actual = _this73.firstChild.getAttribute('style'); + + assert.pushResult({ + result: matcher.match(actual), + message: matcher.message(), + actual: actual, + expected: expected + }); + }; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['foo'], + foo: 'bar' + }), + template: '

foo

' + }); + + this.render('{{foo-bar id="foo-bar" foo=foo isVisible=visible}}', { + visible: false, + foo: 'baz' + }); + + assertStyle('display: none;'); + + this.assertStableRerender(); + + this.runTask(function () { + _emberMetal.set(_this73.context, 'visible', true); + }); + + assertStyle(''); + + this.runTask(function () { + _emberMetal.set(_this73.context, 'visible', false); + _emberMetal.set(_this73.context, 'foo', 'woo'); + }); + + assertStyle('display: none;'); + assert.equal(this.firstChild.getAttribute('foo'), 'woo'); + }; + + _class.prototype['@test it can use readDOMAttr to read input value'] = function testItCanUseReadDOMAttrToReadInputValue() { + var _this74 = this; + + var component = undefined; + var assertElement = function (expectedValue) { + // value is a property, not an attribute + _this74.assertHTML(''); + _this74.assert.equal(_this74.firstChild.value, expectedValue, 'value property is correct'); + _this74.assert.equal(_emberMetal.get(component, 'value'), expectedValue, 'component.get("value") is correct'); + }; + + this.registerComponent('one-way-input', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'input', + attributeBindings: ['value'], + + init: function () { + this._super.apply(this, arguments); + component = this; + }, + + change: function () { + var value = this.readDOMAttr('value'); + this.set('value', value); + } + }) + }); + + this.render('{{one-way-input value=value}}', { + value: 'foo' + }); + + assertElement('foo'); + + this.assertStableRerender(); + + this.runTask(function () { + _this74.firstChild.value = 'bar'; + _this74.$('input').trigger('change'); + }); + + assertElement('bar'); + + this.runTask(function () { + _this74.firstChild.value = 'foo'; + _this74.$('input').trigger('change'); + }); + + assertElement('foo'); + + this.runTask(function () { + _emberMetal.set(component, 'value', 'bar'); + }); + + assertElement('bar'); + + this.runTask(function () { + _this74.firstChild.value = 'foo'; + _this74.$('input').trigger('change'); + }); + + assertElement('foo'); + }; + + _class.prototype['@test child triggers revalidate during parent destruction (GH#13846)'] = function testChildTriggersRevalidateDuringParentDestructionGH13846() { + var select = undefined; + + this.registerComponent('x-select', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'select', + + init: function () { + this._super(); + this.options = _emberRuntime.A([]); + this.value = null; + + select = this; + }, + + updateValue: function () { + var newValue = this.get('options.lastObject.value'); + + this.set('value', newValue); + }, + + registerOption: function (option) { + this.get('options').addObject(option); + }, + + unregisterOption: function (option) { + this.get('options').removeObject(option); + + this.updateValue(); + } + }), + + template: '{{yield this}}' + }); + + this.registerComponent('x-option', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'option', + attributeBindings: ['selected'], + + didInsertElement: function () { + this._super.apply(this, arguments); + + this.get('select').registerOption(this); + }, + + selected: _emberMetal.computed('select.value', function () { + return this.get('value') === this.get('select.value'); + }), + + willDestroyElement: function () { + this._super.apply(this, arguments); + this.get('select').unregisterOption(this); + } + }) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject42)); + + this.teardown(); + + this.assert.ok(true, 'no errors during teardown'); + }; + + _class.prototype['@test setting a property in willDestroyElement does not assert (GH#14273)'] = function testSettingAPropertyInWillDestroyElementDoesNotAssertGH14273(assert) { + assert.expect(2); + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + this.showFoo = true; + }, + + willDestroyElement: function () { + this.set('showFoo', false); + assert.ok(true, 'willDestroyElement was fired'); + this._super.apply(this, arguments); + } + }), + + template: '{{#if showFoo}}things{{/if}}' + }); + + this.render('{{foo-bar}}'); + + this.assertText('things'); + }; + + _class.prototype['@test using didInitAttrs as an event is deprecated'] = function testUsingDidInitAttrsAsAnEventIsDeprecated(assert) { + var _this75 = this; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + foo: _emberMetal.on('didInitAttrs', function () { + assert.ok(true, 'should fire `didInitAttrs` event'); + }) + }) + }); + + expectDeprecation(function () { + _this75.render('{{foo-bar}}'); + }, /didInitAttrs called/); + }; + + // This test is a replication of the "component unit tests" scenario. When we deprecate + // and remove them, this test could be removed as well. This is not fully/intentionally + // supported, and it is unclear that this particular behavior is actually relied on. + // Since there is no real "invocation" here, it has other issues and inconsistencies, + // like there is no real "attrs" here, and there is no "update" pass. + + _class.prototype['@test did{Init,Receive}Attrs fires even if component is not rendered'] = function testDidInitReceiveAttrsFiresEvenIfComponentIsNotRendered(assert) { + var _this76 = this; + + expectDeprecation(/didInitAttrs called/); + + var didInitAttrsCount = 0; + var didReceiveAttrsCount = 0; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + this.didInit = true; + }, + + didInitAttrs: function () { + assert.ok(this.didInit, 'expected init to have run before didInitAttrs'); + didInitAttrsCount++; + }, + + didReceiveAttrs: function () { + assert.ok(this.didInit, 'expected init to have run before didReceiveAttrs'); + didReceiveAttrsCount++; + }, + + willRender: function () { + throw new Error('Unexpected render!'); + } + }) + }); + + assert.strictEqual(didInitAttrsCount, 0, 'precond: didInitAttrs is not fired'); + assert.strictEqual(didReceiveAttrsCount, 0, 'precond: didReceiveAttrs is not fired'); + + this.runTask(function () { + return _this76.component = _this76.owner.lookup('component:foo-bar'); + }); + + assert.strictEqual(didInitAttrsCount, 1, 'precond: didInitAttrs is fired'); + assert.strictEqual(didReceiveAttrsCount, 1, 'precond: didReceiveAttrs is fired'); + }; + + _class.prototype['@test did{Init,Receive}Attrs fires after .init() but before observers become active'] = function testDidInitReceiveAttrsFiresAfterInitButBeforeObserversBecomeActive(assert) { + var _this77 = this; + + expectDeprecation(/didInitAttrs called/); + + var fooCopyDidChangeCount = 0; + var barCopyDidChangeCount = 0; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + this.didInit = true; + }, + + didInitAttrs: function (_ref2) { + var attrs = _ref2.attrs; + + assert.ok(this.didInit, 'expected init to have run before didInitAttrs'); + this.set('fooCopy', attrs.foo.value + 1); + }, + + didReceiveAttrs: function (_ref3) { + var newAttrs = _ref3.newAttrs; + + assert.ok(this.didInit, 'expected init to have run before didReceiveAttrs'); + this.set('barCopy', newAttrs.bar.value + 1); + }, + + fooCopyDidChange: _emberMetal.observer('fooCopy', function () { + fooCopyDidChangeCount++; + }), + barCopyDidChange: _emberMetal.observer('barCopy', function () { + barCopyDidChangeCount++; + }) + }), + + template: '{{foo}}-{{fooCopy}}-{{bar}}-{{barCopy}}' + }); + + this.render('{{foo-bar foo=foo bar=bar}}', { foo: 1, bar: 3 }); + + this.assertText('1-2-3-4'); + + assert.strictEqual(fooCopyDidChangeCount, 0, 'expected NO observer firing for: fooCopy'); + assert.strictEqual(barCopyDidChangeCount, 0, 'expected NO observer firing for: barCopy'); + + this.runTask(function () { + return _emberMetal.set(_this77.context, 'foo', 5); + }); + + this.assertText('5-2-3-4'); + + assert.strictEqual(fooCopyDidChangeCount, 0, 'expected observer firing for: fooCopy'); + assert.strictEqual(barCopyDidChangeCount, 0, 'expected NO observer firing for: barCopy'); + + this.runTask(function () { + return _emberMetal.set(_this77.context, 'bar', 7); + }); + + this.assertText('5-2-7-8'); + + assert.strictEqual(fooCopyDidChangeCount, 0, 'expected observer firing for: fooCopy'); + assert.strictEqual(barCopyDidChangeCount, 1, 'expected observer firing for: barCopy'); + }; + + _class.prototype['@test returning `true` from an action does not bubble if `target` is not specified (GH#14275)'] = function testReturningTrueFromAnActionDoesNotBubbleIfTargetIsNotSpecifiedGH14275(assert) { + var _this78 = this; + + this.registerComponent('display-toggle', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + show: function () { + assert.ok(true, 'display-toggle show action was called'); + return true; + } + } + }), + + template: '' + }); + + this.render('{{display-toggle}}', { + send: function () { + assert.notOk(true, 'send should not be called when action is not "subscribed" to'); + } + }); + + this.assertText('Show'); + + this.runTask(function () { + return _this78.$('button').click(); + }); + }; + + _class.prototype['@test returning `true` from an action bubbles to the `target` if specified'] = function testReturningTrueFromAnActionBubblesToTheTargetIfSpecified(assert) { + var _this79 = this; + + assert.expect(4); + + this.registerComponent('display-toggle', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + show: function () { + assert.ok(true, 'display-toggle show action was called'); + return true; + } + } + }), + + template: '' + }); + + this.render('{{display-toggle target=this}}', { + send: function (actionName) { + assert.ok(true, 'send should be called when action is "subscribed" to'); + assert.equal(actionName, 'show'); + } + }); + + this.assertText('Show'); + + this.runTask(function () { + return _this79.$('button').click(); + }); + }; + + _class.prototype['@test component yielding in an {{#each}} has correct block values after rerendering (GH#14284)'] = function testComponentYieldingInAnEachHasCorrectBlockValuesAfterRerenderingGH14284() { + var _this80 = this; + + this.registerComponent('list-items', { + template: '{{#each items as |item|}}{{yield item}}{{/each}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject43), { + editMode: false, + items: ['foo', 'bar', 'qux', 'baz'] + }); + + this.assertText('|foo||bar||qux||baz|'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this80.context, 'editMode', true); + }); + + this.assertText('|foo|Remove foo|bar|Remove bar|qux|Remove qux|baz|Remove baz'); + + this.runTask(function () { + return _emberMetal.set(_this80.context, 'editMode', false); + }); + + this.assertText('|foo||bar||qux||baz|'); + }; + + _class.prototype['@test unimplimented positionalParams do not cause an error GH#14416'] = function testUnimplimentedPositionalParamsDoNotCauseAnErrorGH14416(assert) { + this.registerComponent('foo-bar', { + template: 'hello' + }); + + this.render('{{foo-bar wat}}'); + this.assertText('hello'); + }; + + _class.prototype['@test using attrs for positional params'] = function testUsingAttrsForPositionalParams(assert) { + var MyComponent = _emberGlimmerTestsUtilsHelpers.Component.extend(); + + this.registerComponent('foo-bar', { + ComponentClass: MyComponent.reopenClass({ + positionalParams: ['myVar'] + }), + template: 'MyVar1: {{attrs.myVar}} {{myVar}} MyVar2: {{myVar2}} {{attrs.myVar2}}' + }); + + this.render('{{foo-bar 1 myVar2=2}}'); + + this.assertText('MyVar1: 1 1 MyVar2: 2 2'); + }; + + _class.prototype['@test can use `{{this}}` to emit the component\'s toString value [GH#14581]'] = function testCanUseThisToEmitTheComponentSToStringValueGH14581(assert) { + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + toString: function () { + return 'special sauce goes here!'; + } + }), + template: '{{this}}' + }); + + this.render('{{foo-bar}}'); + + this.assertText('special sauce goes here!'); + }; + + _class.prototype['@test can use `{{this` to access paths on current context [GH#14581]'] = function testCanUseThisToAccessPathsOnCurrentContextGH14581(assert) { + var instance = undefined; + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + + instance = this; + }, + + foo: { + bar: { + baz: 'huzzah!' + } + } + }), + template: '{{this.foo.bar.baz}}' + }); + + this.render('{{foo-bar}}'); + + this.assertText('huzzah!'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(instance, 'foo.bar.baz', 'yippie!'); + }); + + this.assertText('yippie!'); + + this.runTask(function () { + return _emberMetal.set(instance, 'foo.bar.baz', 'huzzah!'); + }); + + this.assertText('huzzah!'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/components/curly-components-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/curly-components-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/curly-components-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/curly-components-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/curly-components-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/curly-components-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/dynamic-components-test', ['exports', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case'], function (exports, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if cond1}}\n {{#component "foo-bar" id=1}}\n {{#if cond2}}\n {{#component "foo-bar" id=2}}{{/component}}\n {{#if cond3}}\n {{#component "foo-bar" id=3}}\n {{#if cond4}}\n {{#component "foo-bar" id=4}}\n {{#if cond5}}\n {{#component "foo-bar" id=5}}{{/component}}\n {{#component "foo-bar" id=6}}{{/component}}\n {{#component "foo-bar" id=7}}{{/component}}\n {{/if}}\n {{#component "foo-bar" id=8}}{{/component}}\n {{/component}}\n {{/if}}\n {{/component}}\n {{/if}}\n {{/if}}\n {{/component}}\n {{/if}}'], ['\n {{#if cond1}}\n {{#component "foo-bar" id=1}}\n {{#if cond2}}\n {{#component "foo-bar" id=2}}{{/component}}\n {{#if cond3}}\n {{#component "foo-bar" id=3}}\n {{#if cond4}}\n {{#component "foo-bar" id=4}}\n {{#if cond5}}\n {{#component "foo-bar" id=5}}{{/component}}\n {{#component "foo-bar" id=6}}{{/component}}\n {{#component "foo-bar" id=7}}{{/component}}\n {{/if}}\n {{#component "foo-bar" id=8}}{{/component}}\n {{/component}}\n {{/if}}\n {{/component}}\n {{/if}}\n {{/if}}\n {{/component}}\n {{/if}}']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each names as |name|}}\n {{name}}\n {{/each}}'], ['\n {{#each names as |name|}}\n {{name}}\n {{/each}}']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each n as |name|}}\n {{name}}\n {{/each}}'], ['\n {{#each n as |name|}}\n {{name}}\n {{/each}}']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: dynamic components', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { +babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test it can render a basic component with a static component name argument'] = function testItCanRenderABasicComponentWithAStaticComponentNameArgument() { + var _this = this; + + this.registerComponent('foo-bar', { template: 'hello {{name}}' }); + + this.render('{{component "foo-bar" name=name}}', { name: 'Sarah' }); + + this.assertComponentElement(this.firstChild, { content: 'hello Sarah' }); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Sarah' }); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'name', 'Gavin'); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Gavin' }); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'name', 'Sarah'); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Sarah' }); + }; + + _class.prototype['@test it can render a basic component with a dynamic component name argument'] = function testItCanRenderABasicComponentWithADynamicComponentNameArgument() { + var _this2 = this; + + this.registerComponent('foo-bar', { template: 'hello {{name}} from foo-bar' }); + this.registerComponent('foo-bar-baz', { template: 'hello {{name}} from foo-bar-baz' }); + + this.render('{{component componentName name=name}}', { componentName: 'foo-bar', name: 'Alex' }); + + this.assertComponentElement(this.firstChild, { content: 'hello Alex from foo-bar' }); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Alex from foo-bar' }); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'name', 'Ben'); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Ben from foo-bar' }); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'componentName', 'foo-bar-baz'); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Ben from foo-bar-baz' }); + + this.runTask(function () { + _emberMetal.set(_this2.context, 'componentName', 'foo-bar'); + _emberMetal.set(_this2.context, 'name', 'Alex'); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Alex from foo-bar' }); + }; + + _class.prototype['@test it has an element'] = function testItHasAnElement() { + var _this3 = this; + + var instance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + instance = this; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{component "foo-bar"}}'); + + var element1 = instance.element; + + this.assertComponentElement(element1, { content: 'hello' }); + + this.runTask(function () { + return _this3.rerender(); + }); + + var element2 = instance.element; + + this.assertComponentElement(element2, { content: 'hello' }); + + this.assertSameNode(element2, element1); + }; + + _class.prototype['@test it has a jQuery proxy to the element'] = function testItHasAJQueryProxyToTheElement(assert) { + var _this4 = this; + + var instance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + instance = this; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{component "foo-bar"}}'); + + var element1 = instance.$()[0]; + + this.assertComponentElement(element1, { content: 'hello' }); + + this.runTask(function () { + return _this4.rerender(); + }); + + var element2 = instance.$()[0]; + + this.assertComponentElement(element2, { content: 'hello' }); + + this.assertSameNode(element2, element1); + }; + + _class.prototype['@test it scopes the jQuery proxy to the component element'] = function testItScopesTheJQueryProxyToTheComponentElement(assert) { + var _this5 = this; + + var instance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + instance = this; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'inner' }); + + this.render('outer{{component "foo-bar"}}'); + + var $span = instance.$('span'); + + assert.equal($span.length, 1); + assert.equal($span.attr('class'), 'inner'); + + this.runTask(function () { + return _this5.rerender(); + }); + + $span = instance.$('span'); + + assert.equal($span.length, 1); + assert.equal($span.attr('class'), 'inner'); + }; + + _class.prototype['@test it has the right parentView and childViews'] = function testItHasTheRightParentViewAndChildViews(assert) { + var _this6 = this; + + var fooBarInstance = undefined, + fooBarBazInstance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + fooBarInstance = this; + } + }); + + var FooBarBazComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + fooBarBazInstance = this; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'foo-bar {{foo-bar-baz}}' }); + this.registerComponent('foo-bar-baz', { ComponentClass: FooBarBazComponent, template: 'foo-bar-baz' }); + + this.render('{{component "foo-bar"}}'); + this.assertText('foo-bar foo-bar-baz'); + + assert.equal(fooBarInstance.parentView, this.component); + assert.equal(fooBarBazInstance.parentView, fooBarInstance); + + assert.deepEqual(this.component.childViews, [fooBarInstance]); + assert.deepEqual(fooBarInstance.childViews, [fooBarBazInstance]); + + this.runTask(function () { + return _this6.rerender(); + }); + this.assertText('foo-bar foo-bar-baz'); + + assert.equal(fooBarInstance.parentView, this.component); + assert.equal(fooBarBazInstance.parentView, fooBarInstance); + + assert.deepEqual(this.component.childViews, [fooBarInstance]); + assert.deepEqual(fooBarInstance.childViews, [fooBarBazInstance]); + }; + + _class.prototype['@test it can render a basic component with a block'] = function testItCanRenderABasicComponentWithABlock() { + var _this7 = this; + + this.registerComponent('foo-bar', { template: '{{yield}}' }); + + this.render('{{#component "foo-bar"}}hello{{/component}}'); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + }; + + _class.prototype['@test it renders the layout with the component instance as the context'] = function testItRendersTheLayoutWithTheComponentInstanceAsTheContext() { + var _this8 = this; + + var instance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + instance = this; + this.set('message', 'hello'); + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '{{message}}' }); + + this.render('{{component "foo-bar"}}'); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + + this.runTask(function () { + return _this8.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(instance, 'message', 'goodbye'); + }); + + this.assertComponentElement(this.firstChild, { content: 'goodbye' }); + + this.runTask(function () { + return _emberMetal.set(instance, 'message', 'hello'); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + }; + + _class.prototype['@test it preserves the outer context when yielding'] = function testItPreservesTheOuterContextWhenYielding() { + var _this9 = this; + + this.registerComponent('foo-bar', { template: '{{yield}}' }); + + this.render('{{#component "foo-bar"}}{{message}}{{/component}}', { message: 'hello' }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'message', 'goodbye'); + }); + + this.assertComponentElement(this.firstChild, { content: 'goodbye' }); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'message', 'hello'); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + }; + + _class.prototype['@test the component and its child components are destroyed'] = function testTheComponentAndItsChildComponentsAreDestroyed(assert) { + var _this10 = this; + + var destroyed = { 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0 }; + + this.registerComponent('foo-bar', { + template: '{{id}} {{yield}}', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + willDestroy: function () { + this._super(); + destroyed[this.get('id')]++; + } + }) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { + cond1: true, + cond2: true, + cond3: true, + cond4: true, + cond5: true + }); + + this.assertText('1 2 3 4 5 6 7 8 '); + + this.runTask(function () { + return _this10.rerender(); + }); + + assert.deepEqual(destroyed, { 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0 }); + + this.runTask(function () { + return _emberMetal.set(_this10.context, 'cond5', false); + }); + + this.assertText('1 2 3 4 8 '); + + assert.deepEqual(destroyed, { 1: 0, 2: 0, 3: 0, 4: 0, 5: 1, 6: 1, 7: 1, 8: 0 }); + + this.runTask(function () { + _emberMetal.set(_this10.context, 'cond3', false); + _emberMetal.set(_this10.context, 'cond5', true); + _emberMetal.set(_this10.context, 'cond4', false); + }); + + assert.deepEqual(destroyed, { 1: 0, 2: 0, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1 }); + + this.runTask(function () { + _emberMetal.set(_this10.context, 'cond2', false); + _emberMetal.set(_this10.context, 'cond1', false); + }); + + assert.deepEqual(destroyed, { 1: 1, 2: 1, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1 }); + }; + + _class.prototype['@test component helper destroys underlying component when it is swapped out'] = function testComponentHelperDestroysUnderlyingComponentWhenItIsSwappedOut(assert) { + var _this11 = this; + + var destroyed = { 'foo-bar': 0, 'foo-bar-baz': 0 }; + var testContext = this; + + this.registerComponent('foo-bar', { + template: 'hello from foo-bar', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + willDestroyElement: function () { + assert.equal(testContext.$('#' + this.elementId).length, 1, 'element is still attached to the document'); + }, + + willDestroy: function () { + this._super(); + destroyed['foo-bar']++; + } + }) + }); + + this.registerComponent('foo-bar-baz', { + template: 'hello from foo-bar-baz', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + willDestroy: function () { + this._super(); + destroyed['foo-bar-baz']++; + } + }) + }); + + this.render('{{component componentName name=name}}', { componentName: 'foo-bar' }); + + assert.deepEqual(destroyed, { 'foo-bar': 0, 'foo-bar-baz': 0 }); + + this.runTask(function () { + return _this11.rerender(); + }); + + assert.deepEqual(destroyed, { 'foo-bar': 0, 'foo-bar-baz': 0 }); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'componentName', 'foo-bar-baz'); + }); + + assert.deepEqual(destroyed, { 'foo-bar': 1, 'foo-bar-baz': 0 }); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'componentName', 'foo-bar'); + }); + + assert.deepEqual(destroyed, { 'foo-bar': 1, 'foo-bar-baz': 1 }); + }; + + _class.prototype['@test component helper with bound properties are updating correctly in init of component'] = function testComponentHelperWithBoundPropertiesAreUpdatingCorrectlyInInitOfComponent(assert) { + var _this12 = this; + + this.registerComponent('foo-bar', { + template: 'foo-bar {{location}} {{locationCopy}} {{yield}}', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + this.set('locationCopy', this.get('location')); + } + }) + }); + + this.registerComponent('foo-bar-baz', { + template: 'foo-bar-baz {{location}} {{locationCopy}} {{yield}}', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + this.set('locationCopy', this.get('location')); + } + }) + }); + + this.registerComponent('outer-component', { + template: '{{#component componentName location=location}}arepas!{{/component}}', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + componentName: _emberMetal.computed('location', function () { + if (this.get('location') === 'Caracas') { + return 'foo-bar'; + } else { + return 'foo-bar-baz'; + } + }) + }) + }); + + this.render('{{outer-component location=location}}', { location: 'Caracas' }); + + this.assertText('foo-bar Caracas Caracas arepas!'); + + this.runTask(function () { + return _this12.rerender(); + }); + + this.assertText('foo-bar Caracas Caracas arepas!'); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'location', 'Loisaida'); + }); + + this.assertText('foo-bar-baz Loisaida Loisaida arepas!'); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'location', 'Caracas'); + }); + + this.assertText('foo-bar Caracas Caracas arepas!'); + }; + + _class.prototype['@test component helper with actions'] = function testComponentHelperWithActions(assert) { + var _this14 = this; + + this.registerComponent('inner-component', { + template: 'inner-component {{yield}}', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNames: 'inner-component', + didInsertElement: function () { + var _this13 = this; + + // trigger action on click in absence of app's EventDispatcher + this.$().on('click', function () { + _this13.sendAction('somethingClicked'); + }); + }, + willDestroyElement: function () { + this.$().off('click'); + } + }) + }); + + var actionTriggered = 0; + this.registerComponent('outer-component', { + template: '{{#component componentName somethingClicked="mappedAction"}}arepas!{{/component}}', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNames: 'outer-component', + componentName: 'inner-component', + actions: { + mappedAction: function () { + actionTriggered++; + } + } + }) + }); + + this.render('{{outer-component}}'); + + assert.equal(actionTriggered, 0, 'action was not triggered'); + + this.runTask(function () { + _this14.$('.inner-component').trigger('click'); + }); + + assert.equal(actionTriggered, 1, 'action was triggered'); + }; + + _class.prototype['@test nested component helpers'] = function testNestedComponentHelpers(assert) { + var _this15 = this; + + this.registerComponent('foo-bar', { template: 'yippie! {{attrs.location}} {{yield}}' }); + this.registerComponent('baz-qux', { template: 'yummy {{attrs.location}} {{yield}}' }); + this.registerComponent('corge-grault', { template: 'delicious {{attrs.location}} {{yield}}' }); + + this.render('{{#component componentName1 location=location}}{{#component componentName2 location=location}}arepas!{{/component}}{{/component}}', { + componentName1: 'foo-bar', + componentName2: 'baz-qux', + location: 'Caracas' + }); + + this.assertText('yippie! Caracas yummy Caracas arepas!'); + + this.runTask(function () { + return _this15.rerender(); + }); + + this.assertText('yippie! Caracas yummy Caracas arepas!'); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'location', 'Loisaida'); + }); + + this.assertText('yippie! Loisaida yummy Loisaida arepas!'); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'componentName1', 'corge-grault'); + }); + + this.assertText('delicious Loisaida yummy Loisaida arepas!'); + + this.runTask(function () { + _emberMetal.set(_this15.context, 'componentName1', 'foo-bar'); + _emberMetal.set(_this15.context, 'location', 'Caracas'); + }); + + this.assertText('yippie! Caracas yummy Caracas arepas!'); + }; + + _class.prototype['@test component with dynamic name argument resolving to non-existent component'] = function testComponentWithDynamicNameArgumentResolvingToNonExistentComponent(assert) { + var _this16 = this; + + expectAssertion(function () { + _this16.render('{{component componentName}}', { componentName: 'does-not-exist' }); + }, /Could not find component named "does-not-exist"/); + }; + + _class.prototype['@test component with static name argument for non-existent component'] = function testComponentWithStaticNameArgumentForNonExistentComponent(assert) { + var _this17 = this; + + expectAssertion(function () { + _this17.render('{{component "does-not-exist"}}'); + }, /Could not find component named "does-not-exist"/); + }; + + _class.prototype['@test component with dynamic component name resolving to a component, then non-existent component'] = function testComponentWithDynamicComponentNameResolvingToAComponentThenNonExistentComponent(assert) { + var _this18 = this; + + this.registerComponent('foo-bar', { template: 'hello {{name}}' }); + + this.render('{{component componentName name=name}}', { componentName: 'foo-bar', name: 'Alex' }); + + this.assertText('hello Alex'); + + this.runTask(function () { + return _this18.rerender(); + }); + + this.assertText('hello Alex'); + + this.runTask(function () { + return _emberMetal.set(_this18.context, 'componentName', undefined); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this18.context, 'componentName', 'foo-bar'); + }); + + this.assertText('hello Alex'); + }; + + _class.prototype['@test component helper properly invalidates hash params inside an {{each}} invocation #11044'] = function testComponentHelperProperlyInvalidatesHashParamsInsideAnEachInvocation11044(assert) { + var _this19 = this; + + this.registerComponent('foo-bar', { + template: '[{{internalName}} - {{name}}]', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + willRender: function () { + // store internally available name to ensure that the name available in `this.attrs.name` + // matches the template lookup name + _emberMetal.set(this, 'internalName', this.get('name')); + } + }) + }); + + this.render('{{#each items as |item|}}{{component "foo-bar" name=item.name}}{{/each}}', { + items: [{ name: 'Robert' }, { name: 'Jacquie' }] + }); + + this.assertText('[Robert - Robert][Jacquie - Jacquie]'); + + this.runTask(function () { + return _this19.rerender(); + }); + + this.assertText('[Robert - Robert][Jacquie - Jacquie]'); + + this.runTask(function () { + return _emberMetal.set(_this19.context, 'items', [{ name: 'Max' }, { name: 'James' }]); + }); + + this.assertText('[Max - Max][James - James]'); + + this.runTask(function () { + return _emberMetal.set(_this19.context, 'items', [{ name: 'Robert' }, { name: 'Jacquie' }]); + }); + + this.assertText('[Robert - Robert][Jacquie - Jacquie]'); + }; + + _class.prototype['@test dashless components should not be found'] = function testDashlessComponentsShouldNotBeFound(assert) { + var _this20 = this; + + this.registerComponent('dashless2', { template: 'Do not render me!' }); + + expectAssertion(function () { + _this20.render('{{component "dashless"}}'); + }, /You cannot use 'dashless' as a component name. Component names must contain a hyphen./); + }; + + _class.prototype['@test positional parameters does not clash when rendering different components'] = function testPositionalParametersDoesNotClashWhenRenderingDifferentComponents(assert) { + var _this21 = this; + + this.registerComponent('foo-bar', { + template: 'hello {{name}} ({{age}}) from foo-bar', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['name', 'age'] + }) + }); + + this.registerComponent('foo-bar-baz', { + template: 'hello {{name}} ({{age}}) from foo-bar-baz', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['name', 'age'] + }) + }); + + this.render('{{component componentName name age}}', { + componentName: 'foo-bar', + name: 'Alex', + age: 29 + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Alex (29) from foo-bar' }); + + this.runTask(function () { + return _this21.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Alex (29) from foo-bar' }); + + this.runTask(function () { + return _emberMetal.set(_this21.context, 'name', 'Ben'); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Ben (29) from foo-bar' }); + + this.runTask(function () { + return _emberMetal.set(_this21.context, 'age', 22); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Ben (22) from foo-bar' }); + + this.runTask(function () { + return _emberMetal.set(_this21.context, 'componentName', 'foo-bar-baz'); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Ben (22) from foo-bar-baz' }); + + this.runTask(function () { + _emberMetal.set(_this21.context, 'componentName', 'foo-bar'); + _emberMetal.set(_this21.context, 'name', 'Alex'); + _emberMetal.set(_this21.context, 'age', 29); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Alex (29) from foo-bar' }); + }; + + _class.prototype['@test positional parameters does not pollute the attributes when changing components'] = function testPositionalParametersDoesNotPolluteTheAttributesWhenChangingComponents(assert) { + var _this22 = this; + + this.registerComponent('normal-message', { + template: 'Normal: {{something}}!', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['something'] + }) + }); + + this.registerComponent('alternative-message', { + template: 'Alternative: {{something}} {{somethingElse}}!', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + something: 'Another' + }).reopenClass({ + positionalParams: ['somethingElse'] + }) + }); + + this.render('{{component componentName message}}', { componentName: 'normal-message', message: 'Hello' }); + + this.assertComponentElement(this.firstChild, { content: 'Normal: Hello!' }); + + this.runTask(function () { + return _this22.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'Normal: Hello!' }); + + this.runTask(function () { + return _emberMetal.set(_this22.context, 'componentName', 'alternative-message'); + }); + + this.assertComponentElement(this.firstChild, { content: 'Alternative: Another Hello!' }); + + this.runTask(function () { + return _emberMetal.set(_this22.context, 'message', 'Hi'); + }); + + this.assertComponentElement(this.firstChild, { content: 'Alternative: Another Hi!' }); + + this.runTask(function () { + _emberMetal.set(_this22.context, 'componentName', 'normal-message'); + _emberMetal.set(_this22.context, 'message', 'Hello'); + }); + + this.assertComponentElement(this.firstChild, { content: 'Normal: Hello!' }); + }; + + _class.prototype['@test static arbitrary number of positional parameters'] = function testStaticArbitraryNumberOfPositionalParameters(assert) { + var _this23 = this; + + this.registerComponent('sample-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'names' + }), + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2) + }); + + this.render('{{component "sample-component" "Foo" 4 "Bar" 5 "Baz" elementId="helper"}}'); + + this.assertText('Foo4Bar5Baz'); + + this.runTask(function () { + return _this23.rerender(); + }); + + this.assertText('Foo4Bar5Baz'); + }; + + _class.prototype['@test dynamic arbitrary number of positional parameters'] = function testDynamicArbitraryNumberOfPositionalParameters(assert) { + var _this24 = this; + + this.registerComponent('sample-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'n' + }), + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3) + }); + + this.render('{{component "sample-component" user1 user2}}', { + user1: 'Foo', + user2: 4 + }); + + this.assertText('Foo4'); + + this.runTask(function () { + return _this24.rerender(); + }); + + this.assertText('Foo4'); + + this.runTask(function () { + return _this24.context.set('user1', 'Bar'); + }); + + this.assertText('Bar4'); + + this.runTask(function () { + return _this24.context.set('user2', '5'); + }); + + this.assertText('Bar5'); + + this.runTask(function () { + _this24.context.set('user1', 'Foo'); + _this24.context.set('user2', 4); + }); + + this.assertText('Foo4'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/components/dynamic-components-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/dynamic-components-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/dynamic-components-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/dynamic-components-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/dynamic-components-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/dynamic-components-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/fragment-components-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['
Hey
bar'], ['
Hey
bar']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['bar'], ['bar']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['bizz'], ['bizz']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: fragment components', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { +babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype.getCustomDispatcherEvents = function getCustomDispatcherEvents() { + return { + hitDem: 'folks' + }; + }; + + _class.prototype['@test fragments do not render an outer tag'] = function testFragmentsDoNotRenderAnOuterTag() { + var instance = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '', + init: function () { + this._super(); + instance = this; + this.foo = true; + this.bar = 'bar'; + } + }); + + var template = '{{#if foo}}
Hey
{{/if}}{{yield bar}}'; + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: template }); + + this.render('{{#foo-bar as |bar|}}{{bar}}{{/foo-bar}}'); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject)); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(instance, 'foo', false); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + + this.runTask(function () { + return _emberMetal.set(instance, 'bar', 'bizz'); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3)); + + this.runTask(function () { + _emberMetal.set(instance, 'bar', 'bar'); + _emberMetal.set(instance, 'foo', true); + }); + }; + + _class.prototype['@test throws an error if an event function is defined in a tagless component'] = function testThrowsAnErrorIfAnEventFunctionIsDefinedInATaglessComponent() { + var _this = this; + + var instance = undefined; + var template = 'hit dem folks'; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '', + init: function () { + this._super(); + instance = this; + }, + click: function () {} + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: template }); + + expectAssertion(function () { + _this.render('{{#foo-bar}}{{/foo-bar}}'); + }, /You can not define a function that handles DOM events in the .* tagless component since it doesn't have any DOM element./); + }; + + _class.prototype['@test throws an error if a custom defined event function is defined in a tagless component'] = function testThrowsAnErrorIfACustomDefinedEventFunctionIsDefinedInATaglessComponent() { + var _this2 = this; + + var instance = undefined; + var template = 'hit dem folks'; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '', + init: function () { + this._super(); + instance = this; + }, + folks: function () {} + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: template }); + + expectAssertion(function () { + _this2.render('{{#foo-bar}}{{/foo-bar}}'); + }, /You can not define a function that handles DOM events in the .* tagless component since it doesn't have any DOM element./); + }; + + _class.prototype['@test throws an error if `tagName` is an empty string and `classNameBindings` are specified'] = function testThrowsAnErrorIfTagNameIsAnEmptyStringAndClassNameBindingsAreSpecified() { + var _this3 = this; + + var instance = undefined; + var template = 'hit dem folks'; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '', + init: function () { + this._super(); + instance = this; + }, + foo: true, + classNameBindings: ['foo:is-foo:is-bar'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: template }); + + expectAssertion(function () { + _this3.render('{{#foo-bar}}{{/foo-bar}}'); + }, /You cannot use `classNameBindings` on a tag-less component/); + }; + + _class.prototype['@test throws an error if `tagName` is an empty string and `attributeBindings` are specified'] = function testThrowsAnErrorIfTagNameIsAnEmptyStringAndAttributeBindingsAreSpecified() { + var _this4 = this; + + var template = 'hit dem folks'; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '', + attributeBindings: ['href'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: template }); + expectAssertion(function () { + _this4.render('{{#foo-bar}}{{/foo-bar}}'); + }, /You cannot use `attributeBindings` on a tag-less component/); + }; + + _class.prototype['@test throws an error if `tagName` is an empty string and `elementId` is specified via JS'] = function testThrowsAnErrorIfTagNameIsAnEmptyStringAndElementIdIsSpecifiedViaJS() { + var _this5 = this; + + var template = 'hit dem folks'; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '', + elementId: 'turntUp' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: template }); + expectAssertion(function () { + _this5.render('{{#foo-bar}}{{/foo-bar}}'); + }, /You cannot use `elementId` on a tag-less component/); + }; + + _class.prototype['@test throws an error if `tagName` is an empty string and `elementId` is specified via template'] = function testThrowsAnErrorIfTagNameIsAnEmptyStringAndElementIdIsSpecifiedViaTemplate() { + var _this6 = this; + + var template = 'hit dem folks'; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: template }); + expectAssertion(function () { + _this6.render('{{#foo-bar elementId=\'turntUp\'}}{{/foo-bar}}'); + }, /You cannot use `elementId` on a tag-less component/); + }; + + _class.prototype['@test does not throw an error if `tagName` is an empty string and `id` is specified via JS'] = function testDoesNotThrowAnErrorIfTagNameIsAnEmptyStringAndIdIsSpecifiedViaJS() { + var template = '{{id}}'; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '', + id: 'baz' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: template }); + this.render('{{#foo-bar}}{{/foo-bar}}'); + this.assertText('baz'); + }; + + _class.prototype['@test does not throw an error if `tagName` is an empty string and `id` is specified via template'] = function testDoesNotThrowAnErrorIfTagNameIsAnEmptyStringAndIdIsSpecifiedViaTemplate() { + var template = '{{id}}'; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: template }); + this.render('{{#foo-bar id=\'baz\'}}{{/foo-bar}}'); + this.assertText('baz'); + }; + + _class.prototype['@test does not throw an error if `tagName` is an empty string and `id` is bound property specified via template'] = function testDoesNotThrowAnErrorIfTagNameIsAnEmptyStringAndIdIsBoundPropertySpecifiedViaTemplate() { + var _this7 = this; + + var template = '{{id}}'; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: template }); + + this.render('{{#foo-bar id=fooBarId}}{{/foo-bar}}', { fooBarId: 'baz' }); + + this.assertText('baz'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'fooBarId', 'qux'); + }); + + this.assertText('qux'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'fooBarId', 'baz'); + }); + + this.assertText('baz'); + }; + + _class.prototype['@test does not throw an error if `tagName` is an empty string and `id` is specified via template and passed to child component'] = function testDoesNotThrowAnErrorIfTagNameIsAnEmptyStringAndIdIsSpecifiedViaTemplateAndPassedToChildComponent() { + var fooBarTemplate = '{{#baz-child id=id}}{{/baz-child}}'; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '' + }); + var BazChildComponent = _emberGlimmerTestsUtilsHelpers.Component.extend(); + var bazChildTemplate = '{{id}}'; + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: fooBarTemplate }); + this.registerComponent('baz-child', { ComponentClass: BazChildComponent, template: bazChildTemplate }); + this.render('{{#foo-bar id=\'baz\'}}{{/foo-bar}}'); + this.assertText('baz'); + }; + + _class.prototype['@test throws an error if when $() is accessed on component where `tagName` is an empty string'] = function testThrowsAnErrorIfWhen$IsAccessedOnComponentWhereTagNameIsAnEmptyString() { + var _this8 = this; + + var template = 'hit dem folks'; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '', + init: function () { + this._super(); + this.$(); + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: template }); + + expectAssertion(function () { + _this8.render('{{#foo-bar}}{{/foo-bar}}'); + }, /You cannot access this.\$\(\) on a component with `tagName: \'\'` specified/); + }; + + _class.prototype['@test renders a contained view with omitted start tag and tagless parent view context'] = function testRendersAContainedViewWithOmittedStartTagAndTaglessParentViewContext() { + var _this9 = this; + + this.registerComponent('root-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'section' + }), + template: '{{frag-ment}}' + }); + + this.registerComponent('frag-ment', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '' + }), + template: '{{my-span}}' + }); + + this.registerComponent('my-span', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'span' + }), + template: 'dab' + }); + + this.render('{{root-component}}'); + + this.assertElement(this.firstChild, { tagName: 'section' }); + this.assertElement(this.firstChild.firstElementChild, { tagName: 'span' }); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'section' }); + this.assertElement(this.firstChild.firstElementChild, { tagName: 'span' }); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/components/fragment-components-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/fragment-components-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/fragment-components-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/fragment-components-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/fragment-components-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/fragment-components-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/instrumentation-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components instrumentation', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + var _this = this; + + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.call(this); + + this.resetEvents(); + + _emberMetal.instrumentationSubscribe('render.component', { + before: function (name, timestamp, payload) { + if (payload.view !== _this.component) { + _this.actual.before.push(payload); + } + }, + after: function (name, timestamp, payload) { + if (payload.view !== _this.component) { + _this.actual.after.push(payload); + } + } + }); + } + + _class.prototype.resetEvents = function resetEvents() { + this.expected = { + before: [], + after: [] + }; + + this.actual = { + before: [], + after: [] + }; + }; + + _class.prototype.teardown = function teardown() { + this.assert.deepEqual(this.actual.before, [], 'No unexpected events (before)'); + this.assert.deepEqual(this.actual.after, [], 'No unexpected events (after)'); + _RenderingTest.prototype.teardown.call(this); + _emberMetal.instrumentationReset(); + }; + + _class.prototype['@test zomg'] = function testZomg(assert) { + assert.ok(true); + }; + + _class.prototype['@test it should receive an instrumentation event for both initial render and updates'] = function testItShouldReceiveAnInstrumentationEventForBothInitialRenderAndUpdates(assert) { + var _this2 = this; + + var testCase = this; + + var BaseClass = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '', + + willRender: function () { + testCase.expected.before.push(this); + testCase.expected.after.unshift(this); + } + }); + + this.registerComponent('x-bar', { + template: '[x-bar: {{bar}}] {{yield}}', + ComponentClass: BaseClass.extend() + }); + + this.registerComponent('x-baz', { + template: '[x-baz: {{baz}}]', + ComponentClass: BaseClass.extend() + }); + + this.registerComponent('x-bat', { + template: '[x-bat: {{bat}}]', + ComponentClass: BaseClass.extend() + }); + + this.render('[-top-level: {{foo}}] {{#x-bar bar=bar}}{{x-baz baz=baz}}{{/x-bar}} {{x-bat bat=bat}}', { + foo: 'foo', bar: 'bar', baz: 'baz', bat: 'bat' + }); + + this.assertText('[-top-level: foo] [x-bar: bar] [x-baz: baz] [x-bat: bat]'); + + this.assertEvents('after initial render', true); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertEvents('after no-op rerender'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'foo', 'FOO'); + }); + + this.assertEvents('after updating top-level'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'baz', 'BAZ'); + }); + + this.assertEvents('after updating inner-most'); + + this.runTask(function () { + _emberMetal.set(_this2.context, 'bar', 'BAR'); + _emberMetal.set(_this2.context, 'bat', 'BAT'); + }); + + this.assertEvents('after updating the rest'); + + this.runTask(function () { + _emberMetal.set(_this2.context, 'foo', 'FOO'); + _emberMetal.set(_this2.context, 'bar', 'BAR'); + _emberMetal.set(_this2.context, 'baz', 'BAZ'); + _emberMetal.set(_this2.context, 'bat', 'BAT'); + }); + + this.assertEvents('after reset'); + }; + + _class.prototype.assertEvents = function assertEvents(label) { + var initialRender = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; + var actual = this.actual; + var expected = this.expected; + + this.assert.strictEqual(actual.before.length, actual.after.length, label + ': before and after callbacks should be balanced'); + + this._assertEvents(label + ' (before):', actual.before, expected.before, initialRender); + this._assertEvents(label + ' (after):', actual.before, expected.before, initialRender); + + this.resetEvents(); + }; + + _class.prototype._assertEvents = function _assertEvents(label, actual, expected, initialRender) { + var _this3 = this; + + this.assert.equal(actual.length, expected.length, label + ': expected ' + expected.length + ' and got ' + actual.length); + + actual.forEach(function (payload, i) { + return _this3.assertPayload(payload, expected[i], initialRender); + }); + }; + + _class.prototype.assertPayload = function assertPayload(payload, component, initialRender) { + this.assert.equal(payload.object, component.toString(), 'payload.object'); + this.assert.equal(payload.containerKey, component._debugContainerKey, 'payload.containerKey'); + this.assert.equal(payload.view, component, 'payload.view'); + this.assert.strictEqual(payload.initialRender, initialRender, 'payload.initialRender'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/components/instrumentation-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/instrumentation-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/instrumentation-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/instrumentation-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/instrumentation-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/instrumentation-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/life-cycle-test', ['exports', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-views', 'ember-glimmer/tests/utils/test-helpers', 'ember-utils', 'internal-test-helpers'], function (exports, _emberMetal, _emberRuntime, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberViews, _emberGlimmerTestsUtilsTestHelpers, _emberUtils, _internalTestHelpers) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n
\n Twitter: {{', '}}|\n ', '\n
'], ['\n
\n Twitter: {{', '}}|\n ', '\n
']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n
\n Name: {{', '}}|\n ', '\n
'], ['\n
\n Name: {{', '}}|\n ', '\n
']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['\n
\n Website: {{', '}}\n
'], ['\n
\n Website: {{', '}}\n
']), + _templateObject4 = babelHelpers.taggedTemplateLiteralLoose(['\n
\n ', '|\n ', '|\n ', '\n
'], ['\n
\n ', '|\n ', '|\n ', '\n
']), + _templateObject5 = babelHelpers.taggedTemplateLiteralLoose(['\n
\n Top: ', '\n
'], ['\n
\n Top: ', '\n
']), + _templateObject6 = babelHelpers.taggedTemplateLiteralLoose(['\n
\n Middle: ', '\n
'], ['\n
\n Middle: ', '\n
']), + _templateObject7 = babelHelpers.taggedTemplateLiteralLoose(['\n
\n Bottom: {{', '}}\n
'], ['\n
\n Bottom: {{', '}}\n
']), + _templateObject8 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#nested-item}}Item: {{count}}{{/nested-item}}\n '], ['\n {{#nested-item}}Item: {{count}}{{/nested-item}}\n ']), + _templateObject9 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#nested-item}}Nothing to see here{{/nested-item}}\n '], ['\n {{#nested-item}}Nothing to see here{{/nested-item}}\n ']), + _templateObject10 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each items as |item|}}\n ', '\n {{else}}\n ', '\n {{/each}}\n '], ['\n {{#each items as |item|}}\n ', '\n {{else}}\n ', '\n {{/each}}\n ']), + _templateObject11 = babelHelpers.taggedTemplateLiteralLoose(['\n {{yield}}\n
    \n {{#nested-component nestedId=(concat itemId \'-A\')}}A{{/nested-component}}\n {{#nested-component nestedId=(concat itemId \'-B\')}}B{{/nested-component}}\n
\n '], ['\n {{yield}}\n
    \n {{#nested-component nestedId=(concat itemId \'-A\')}}A{{/nested-component}}\n {{#nested-component nestedId=(concat itemId \'-B\')}}B{{/nested-component}}\n
\n ']), + _templateObject12 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each items as |item|}}\n {{#parent-component itemId=item.id}}{{item.id}}{{/parent-component}}\n {{/each}}\n {{#if model.shouldShow}}\n {{#parent-component itemId=6}}6{{/parent-component}}\n {{/if}}\n {{#if model.shouldShow}}\n {{#parent-component itemId=7}}7{{/parent-component}}\n {{/if}}\n '], ['\n {{#each items as |item|}}\n {{#parent-component itemId=item.id}}{{item.id}}{{/parent-component}}\n {{/each}}\n {{#if model.shouldShow}}\n {{#parent-component itemId=6}}6{{/parent-component}}\n {{/if}}\n {{#if model.shouldShow}}\n {{#parent-component itemId=7}}7{{/parent-component}}\n {{/if}}\n ']); + + var LifeCycleHooksTest = (function (_RenderingTest) { +babelHelpers.inherits(LifeCycleHooksTest, _RenderingTest); + + function LifeCycleHooksTest() { +babelHelpers.classCallCheck(this, LifeCycleHooksTest); + + _RenderingTest.call(this); + this.hooks = []; + this.components = {}; + this.componentRegistry = []; + this.teardownAssertions = []; + } + + LifeCycleHooksTest.prototype.teardown = function teardown() { + _RenderingTest.prototype.teardown.call(this); + + for (var i = 0; i < this.teardownAssertions.length; i++) { + this.teardownAssertions[i](); + } + }; + + LifeCycleHooksTest.prototype.getBootOptions = function getBootOptions() { + return { + isInteractive: this.isInteractive + }; + }; + + /* abstract */ + + /* abstract */ + + LifeCycleHooksTest.prototype.invocationFor = function invocationFor(name) { + var namedArgs = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + throw new Error('Not implemented: `invocationFor`'); + }; + + /* abstract */ + + LifeCycleHooksTest.prototype.attrFor = function attrFor(name) { + throw new Error('Not implemented: `attrFor`'); + }; + + LifeCycleHooksTest.prototype.assertRegisteredViews = function assertRegisteredViews(label) { + var viewRegistry = this.owner.lookup('-view-registry:main'); + var topLevelId = _emberViews.getViewId(this.component); + var actual = Object.keys(viewRegistry).sort().filter(function (id) { + return id !== topLevelId; + }); + + if (this.isInteractive) { + var expected = this.componentRegistry.sort(); + + this.assert.deepEqual(actual, expected, 'registered views - ' + label); + } else { + this.assert.deepEqual(actual, [], 'no views should be registered for non-interactive mode'); + } + }; + + LifeCycleHooksTest.prototype.registerComponent = function registerComponent(name, _ref) { + var _this = this; + + var _ref$template = _ref.template; + var template = _ref$template === undefined ? null : _ref$template; + + var pushComponent = function (instance) { + _this.components[name] = instance; + _this.componentRegistry.push(_emberViews.getViewId(instance)); + }; + + var removeComponent = function (instance) { + var index = _this.componentRegistry.indexOf(instance); + _this.componentRegistry.splice(index, 1); + + delete _this.components[name]; + }; + + var pushHook = function (hookName, args) { + _this.hooks.push(hook(name, hookName, args)); + }; + + var assertParentView = function (hookName, instance) { + _this.assert.ok(instance.parentView, 'parentView should be present in ' + hookName); + + if (hookName === 'willDestroyElement') { + _this.assert.ok(instance.parentView.childViews.indexOf(instance) !== -1, 'view is still connected to parentView in ' + hookName); + } + }; + + var assertElement = function (hookName, instance) { + var inDOM = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2]; + + if (instance.tagName === '') { + return; + } + + _this.assert.ok(_emberViews.getViewElement(instance), 'element should be present on ' + instance + ' during ' + hookName); + + if (_this.isInteractive) { + _this.assert.ok(instance.element, 'this.element should be present on ' + instance + ' during ' + hookName); + _this.assert.equal(document.body.contains(instance.element), inDOM, 'element for ' + instance + ' ' + (inDOM ? 'should' : 'should not') + ' be in the DOM during ' + hookName); + } else { + _this.assert.throws(function () { + return instance.element; + }, /Accessing `this.element` is not allowed in non-interactive environments/); + } + }; + + var assertNoElement = function (hookName, instance) { + _this.assert.strictEqual(_emberViews.getViewElement(instance), null, 'element should not be present in ' + hookName); + + if (_this.isInteractive) { + _this.assert.strictEqual(instance.element, null, 'this.element should not be present in ' + hookName); + } else { + _this.assert.throws(function () { + return instance.element; + }, /Accessing `this.element` is not allowed in non-interactive environments/); + } + }; + + var assertState = function (hookName, expectedState, instance) { + _this.assert.equal(instance._state, expectedState, 'within ' + hookName + ' the expected _state is ' + expectedState); + }; + + var isInteractive = this.isInteractive; + + var ComponentClass = this.ComponentClass.extend({ + init: function () { + var _this2 = this, + _arguments = arguments; + + expectDeprecation(function () { + _this2._super.apply(_this2, _arguments); + }, /didInitAttrs called/); + + this.isInitialRender = true; + this.componentName = name; + pushHook('init'); + pushComponent(this); + assertParentView('init', this); + assertNoElement('init', this); + assertState('init', 'preRender', this); + + this.on('init', function () { + return pushHook('on(init)'); + }); + + _emberMetal.run.scheduleOnce('afterRender', function () { + _this2.isInitialRender = false; + }); + }, + + didInitAttrs: function (options) { + pushHook('didInitAttrs', options); + assertParentView('didInitAttrs', this); + assertNoElement('didInitAttrs', this); + assertState('didInitAttrs', 'preRender', this); + }, + + didReceiveAttrs: function (options) { + pushHook('didReceiveAttrs', options); + assertParentView('didReceiveAttrs', this); + + if (this.isInitialRender) { + assertNoElement('didReceiveAttrs', this); + assertState('didReceiveAttrs', 'preRender', this); + } else { + assertElement('didReceiveAttrs', this); + + if (isInteractive) { + assertState('didReceiveAttrs', 'inDOM', this); + } else { + assertState('didReceiveAttrs', 'hasElement', this); + } + } + }, + + willInsertElement: function () { + pushHook('willInsertElement'); + assertParentView('willInsertElement', this); + assertElement('willInsertElement', this, false); + assertState('willInsertElement', 'hasElement', this); + }, + + willRender: function () { + pushHook('willRender'); + assertParentView('willRender', this); + + if (this.isInitialRender) { + assertNoElement('willRender', this, false); + assertState('willRender', 'preRender', this); + } else { + assertElement('willRender', this); + assertState('willRender', 'inDOM', this); + } + }, + + didInsertElement: function () { + pushHook('didInsertElement'); + assertParentView('didInsertElement', this); + assertElement('didInsertElement', this); + assertState('didInsertElement', 'inDOM', this); + }, + + didRender: function () { + pushHook('didRender'); + assertParentView('didRender', this); + assertElement('didRender', this); + assertState('didRender', 'inDOM', this); + }, + + didUpdateAttrs: function (options) { + pushHook('didUpdateAttrs', options); + assertParentView('didUpdateAttrs', this); + + if (isInteractive) { + assertState('didUpdateAttrs', 'inDOM', this); + } else { + assertState('didUpdateAttrs', 'hasElement', this); + } + }, + + willUpdate: function (options) { + pushHook('willUpdate', options); + assertParentView('willUpdate', this); + assertElement('willUpdate', this); + assertState('willUpdate', 'inDOM', this); + }, + + didUpdate: function (options) { + pushHook('didUpdate', options); + assertParentView('didUpdate', this); + assertElement('didUpdate', this); + assertState('didUpdate', 'inDOM', this); + }, + + willDestroyElement: function () { + pushHook('willDestroyElement'); + assertParentView('willDestroyElement', this); + assertElement('willDestroyElement', this); + assertState('willDestroyElement', 'inDOM', this); + }, + + willClearRender: function () { + pushHook('willClearRender'); + assertParentView('willClearRender', this); + assertElement('willClearRender', this); + assertState('willClearRender', 'inDOM', this); + }, + + didDestroyElement: function () { + pushHook('didDestroyElement'); + assertNoElement('didDestroyElement', this); + assertState('didDestroyElement', 'destroying', this); + }, + + willDestroy: function () { + pushHook('willDestroy'); + removeComponent(this); + + this._super.apply(this, arguments); + } + }); + + _RenderingTest.prototype.registerComponent.call(this, name, { ComponentClass: ComponentClass, template: template }); + }; + + LifeCycleHooksTest.prototype.assertHooks = function assertHooks(_ref2) { + var label = _ref2.label; + var interactive = _ref2.interactive; + var nonInteractive = _ref2.nonInteractive; + + var rawHooks = this.isInteractive ? interactive : nonInteractive; + var hooks = rawHooks.map(function (raw) { + return hook.apply(undefined, raw); + }); + this.assert.deepEqual(json(this.hooks), json(hooks), label); + this.hooks = []; + }; + + LifeCycleHooksTest.prototype['@test lifecycle hooks are invoked in a predictable order'] = function testLifecycleHooksAreInvokedInAPredictableOrder() { + var _this3 = this; + + var _boundHelpers = this.boundHelpers; + var attr = _boundHelpers.attr; + var invoke = _boundHelpers.invoke; + + this.registerComponent('the-top', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject, attr('twitter'), invoke('the-middle', { name: string('Tom Dale') })) + }); + + this.registerComponent('the-middle', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2, attr('name'), invoke('the-bottom', { website: string('tomdale.net') })) + }); + + this.registerComponent('the-bottom', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3, attr('website')) + }); + + this.render(invoke('the-top', { twitter: expr('twitter') }), { twitter: '@tomdale' }); + + this.assertText('Twitter: @tomdale|Name: Tom Dale|Website: tomdale.net'); + this.assertRegisteredViews('intial render'); + + var topAttrs = { twitter: '@tomdale' }; + var middleAttrs = { name: 'Tom Dale' }; + var bottomAttrs = { website: 'tomdale.net' }; + + this.assertHooks({ + label: 'after initial render', + + interactive: [ + // Sync hooks + + ['the-top', 'init'], ['the-top', 'didInitAttrs', { attrs: topAttrs }], ['the-top', 'didReceiveAttrs', { newAttrs: topAttrs }], ['the-top', 'on(init)'], ['the-top', 'willRender'], ['the-top', 'willInsertElement'], ['the-middle', 'init'], ['the-middle', 'didInitAttrs', { attrs: middleAttrs }], ['the-middle', 'didReceiveAttrs', { newAttrs: middleAttrs }], ['the-middle', 'on(init)'], ['the-middle', 'willRender'], ['the-middle', 'willInsertElement'], ['the-bottom', 'init'], ['the-bottom', 'didInitAttrs', { attrs: bottomAttrs }], ['the-bottom', 'didReceiveAttrs', { newAttrs: bottomAttrs }], ['the-bottom', 'on(init)'], ['the-bottom', 'willRender'], ['the-bottom', 'willInsertElement'], + + // Async hooks + + ['the-bottom', 'didInsertElement'], ['the-bottom', 'didRender'], ['the-middle', 'didInsertElement'], ['the-middle', 'didRender'], ['the-top', 'didInsertElement'], ['the-top', 'didRender']], + + nonInteractive: [ + // Sync hooks + ['the-top', 'init'], ['the-top', 'didInitAttrs', { attrs: topAttrs }], ['the-top', 'didReceiveAttrs', { newAttrs: topAttrs }], ['the-top', 'on(init)'], ['the-middle', 'init'], ['the-middle', 'didInitAttrs', { attrs: middleAttrs }], ['the-middle', 'didReceiveAttrs', { newAttrs: middleAttrs }], ['the-middle', 'on(init)'], ['the-bottom', 'init'], ['the-bottom', 'didInitAttrs', { attrs: bottomAttrs }], ['the-bottom', 'didReceiveAttrs', { newAttrs: bottomAttrs }], ['the-bottom', 'on(init)']] + }); + + this.runTask(function () { + return _this3.components['the-bottom'].rerender(); + }); + + this.assertText('Twitter: @tomdale|Name: Tom Dale|Website: tomdale.net'); + + this.assertHooks({ + label: 'after no-op rerender (bottom)', + + interactive: [ + // Sync hooks + ['the-top', 'willUpdate'], ['the-top', 'willRender'], ['the-middle', 'willUpdate'], ['the-middle', 'willRender'], ['the-bottom', 'willUpdate'], ['the-bottom', 'willRender'], + + // Async hooks + + ['the-bottom', 'didUpdate'], ['the-bottom', 'didRender'], ['the-middle', 'didUpdate'], ['the-middle', 'didRender'], ['the-top', 'didUpdate'], ['the-top', 'didRender']], + + nonInteractive: [] + }); + + this.runTask(function () { + return _this3.components['the-middle'].rerender(); + }); + + this.assertText('Twitter: @tomdale|Name: Tom Dale|Website: tomdale.net'); + + this.assertHooks({ + label: 'after no-op rerender (middle)', + + interactive: [ + // Sync hooks + + ['the-top', 'willUpdate'], ['the-top', 'willRender'], ['the-middle', 'willUpdate'], ['the-middle', 'willRender'], + + // Async hooks + + ['the-middle', 'didUpdate'], ['the-middle', 'didRender'], ['the-top', 'didUpdate'], ['the-top', 'didRender']], + + nonInteractive: [] + }); + + this.runTask(function () { + return _this3.components['the-top'].rerender(); + }); + + this.assertText('Twitter: @tomdale|Name: Tom Dale|Website: tomdale.net'); + + this.assertHooks({ + label: 'after no-op rerender (top)', + + interactive: [ + // Sync hooks + + ['the-top', 'willUpdate'], ['the-top', 'willRender'], + + // Async hooks + + ['the-top', 'didUpdate'], ['the-top', 'didRender']], + + nonInteractive: [] + }); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'twitter', '@horsetomdale'); + }); + + this.assertText('Twitter: @horsetomdale|Name: Tom Dale|Website: tomdale.net'); + + // Because the `twitter` attr is only used by the topmost component, + // and not passed down, we do not expect to see lifecycle hooks + // called for child components. If the `didReceiveAttrs` hook used + // the new attribute to rerender itself imperatively, that would result + // in lifecycle hooks being invoked for the child. + + topAttrs = { oldAttrs: { twitter: '@tomdale' }, newAttrs: { twitter: '@horsetomdale' } }; + + this.assertHooks({ + label: 'after update', + + interactive: [ + // Sync hooks + + ['the-top', 'didUpdateAttrs', topAttrs], ['the-top', 'didReceiveAttrs', topAttrs], ['the-top', 'willUpdate'], ['the-top', 'willRender'], + + // Async hooks + + ['the-top', 'didUpdate'], ['the-top', 'didRender']], + + nonInteractive: [ + // Sync hooks + ['the-top', 'didUpdateAttrs', topAttrs], ['the-top', 'didReceiveAttrs', topAttrs]] + }); + + this.teardownAssertions.push(function () { + _this3.assertHooks({ + label: 'destroy', + + interactive: [['the-top', 'willDestroyElement'], ['the-top', 'willClearRender'], ['the-middle', 'willDestroyElement'], ['the-middle', 'willClearRender'], ['the-bottom', 'willDestroyElement'], ['the-bottom', 'willClearRender'], ['the-top', 'didDestroyElement'], ['the-middle', 'didDestroyElement'], ['the-bottom', 'didDestroyElement'], ['the-top', 'willDestroy'], ['the-middle', 'willDestroy'], ['the-bottom', 'willDestroy']], + + nonInteractive: [['the-top', 'willDestroy'], ['the-middle', 'willDestroy'], ['the-bottom', 'willDestroy']] + }); + + _this3.assertRegisteredViews('after destroy'); + }); + }; + + LifeCycleHooksTest.prototype['@test lifecycle hooks are invoked in a correct sibling order'] = function testLifecycleHooksAreInvokedInACorrectSiblingOrder() { + var _this4 = this; + + var _boundHelpers2 = this.boundHelpers; + var attr = _boundHelpers2.attr; + var invoke = _boundHelpers2.invoke; + + this.registerComponent('the-parent', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4, invoke('the-first-child', { twitter: expr(attr('twitter')) }), invoke('the-second-child', { name: expr(attr('name')) }), invoke('the-last-child', { website: expr(attr('website')) })) + }); + + this.registerComponent('the-first-child', { template: 'Twitter: {{' + attr('twitter') + '}}' }); + + this.registerComponent('the-second-child', { template: 'Name: {{' + attr('name') + '}}' }); + + this.registerComponent('the-last-child', { template: 'Website: {{' + attr('website') + '}}' }); + + this.render(invoke('the-parent', { + twitter: expr('twitter'), + name: expr('name'), + website: expr('website') + }), { + twitter: '@tomdale', + name: 'Tom Dale', + website: 'tomdale.net' + }); + + this.assertText('Twitter: @tomdale|Name: Tom Dale|Website: tomdale.net'); + this.assertRegisteredViews('intial render'); + + var parentAttrs = { twitter: '@tomdale', name: 'Tom Dale', website: 'tomdale.net' }; + var firstAttrs = { twitter: '@tomdale' }; + var secondAttrs = { name: 'Tom Dale' }; + var lastAttrs = { website: 'tomdale.net' }; + + this.assertHooks({ + label: 'after initial render', + + interactive: [ + // Sync hooks + + ['the-parent', 'init'], ['the-parent', 'didInitAttrs', { attrs: parentAttrs }], ['the-parent', 'didReceiveAttrs', { newAttrs: parentAttrs }], ['the-parent', 'on(init)'], ['the-parent', 'willRender'], ['the-parent', 'willInsertElement'], ['the-first-child', 'init'], ['the-first-child', 'didInitAttrs', { attrs: firstAttrs }], ['the-first-child', 'didReceiveAttrs', { newAttrs: firstAttrs }], ['the-first-child', 'on(init)'], ['the-first-child', 'willRender'], ['the-first-child', 'willInsertElement'], ['the-second-child', 'init'], ['the-second-child', 'didInitAttrs', { attrs: secondAttrs }], ['the-second-child', 'didReceiveAttrs', { newAttrs: secondAttrs }], ['the-second-child', 'on(init)'], ['the-second-child', 'willRender'], ['the-second-child', 'willInsertElement'], ['the-last-child', 'init'], ['the-last-child', 'didInitAttrs', { attrs: lastAttrs }], ['the-last-child', 'didReceiveAttrs', { newAttrs: lastAttrs }], ['the-last-child', 'on(init)'], ['the-last-child', 'willRender'], ['the-last-child', 'willInsertElement'], + + // Async hooks + + ['the-first-child', 'didInsertElement'], ['the-first-child', 'didRender'], ['the-second-child', 'didInsertElement'], ['the-second-child', 'didRender'], ['the-last-child', 'didInsertElement'], ['the-last-child', 'didRender'], ['the-parent', 'didInsertElement'], ['the-parent', 'didRender']], + + nonInteractive: [ + // Sync hooks + + ['the-parent', 'init'], ['the-parent', 'didInitAttrs', { attrs: parentAttrs }], ['the-parent', 'didReceiveAttrs', { newAttrs: parentAttrs }], ['the-parent', 'on(init)'], ['the-first-child', 'init'], ['the-first-child', 'didInitAttrs', { attrs: firstAttrs }], ['the-first-child', 'didReceiveAttrs', { newAttrs: firstAttrs }], ['the-first-child', 'on(init)'], ['the-second-child', 'init'], ['the-second-child', 'didInitAttrs', { attrs: secondAttrs }], ['the-second-child', 'didReceiveAttrs', { newAttrs: secondAttrs }], ['the-second-child', 'on(init)'], ['the-last-child', 'init'], ['the-last-child', 'didInitAttrs', { attrs: lastAttrs }], ['the-last-child', 'didReceiveAttrs', { newAttrs: lastAttrs }], ['the-last-child', 'on(init)']] + }); + + this.runTask(function () { + return _this4.components['the-first-child'].rerender(); + }); + + this.assertText('Twitter: @tomdale|Name: Tom Dale|Website: tomdale.net'); + + this.assertHooks({ + label: 'after no-op rerender (first child)', + + interactive: [ + // Sync hooks + + ['the-parent', 'willUpdate'], ['the-parent', 'willRender'], ['the-first-child', 'willUpdate'], ['the-first-child', 'willRender'], + + // Async hooks + + ['the-first-child', 'didUpdate'], ['the-first-child', 'didRender'], ['the-parent', 'didUpdate'], ['the-parent', 'didRender']], + + nonInteractive: [] + }); + + this.runTask(function () { + return _this4.components['the-second-child'].rerender(); + }); + + this.assertText('Twitter: @tomdale|Name: Tom Dale|Website: tomdale.net'); + + this.assertHooks({ + label: 'after no-op rerender (second child)', + + interactive: [ + // Sync hooks + + ['the-parent', 'willUpdate'], ['the-parent', 'willRender'], ['the-second-child', 'willUpdate'], ['the-second-child', 'willRender'], + + // Async hooks + + ['the-second-child', 'didUpdate'], ['the-second-child', 'didRender'], ['the-parent', 'didUpdate'], ['the-parent', 'didRender']], + + nonInteractive: [] + }); + + this.runTask(function () { + return _this4.components['the-last-child'].rerender(); + }); + + this.assertText('Twitter: @tomdale|Name: Tom Dale|Website: tomdale.net'); + + this.assertHooks({ + label: 'after no-op rerender (last child)', + + interactive: [ + // Sync hooks + + ['the-parent', 'willUpdate'], ['the-parent', 'willRender'], ['the-last-child', 'willUpdate'], ['the-last-child', 'willRender'], + + // Async hooks + + ['the-last-child', 'didUpdate'], ['the-last-child', 'didRender'], ['the-parent', 'didUpdate'], ['the-parent', 'didRender']], + + nonInteractive: [] + }); + + this.runTask(function () { + return _this4.components['the-parent'].rerender(); + }); + + this.assertText('Twitter: @tomdale|Name: Tom Dale|Website: tomdale.net'); + + this.assertHooks({ + label: 'after no-op rerender (parent)', + + interactive: [ + // Sync hooks + + ['the-parent', 'willUpdate'], ['the-parent', 'willRender'], + + // Async hooks + + ['the-parent', 'didUpdate'], ['the-parent', 'didRender']], + + nonInteractive: [] + }); + + this.runTask(function () { + return _emberMetal.setProperties(_this4.context, { + twitter: '@horsetomdale', + name: 'Horse Tom Dale', + website: 'horsetomdale.net' + }); + }); + + this.assertText('Twitter: @horsetomdale|Name: Horse Tom Dale|Website: horsetomdale.net'); + + parentAttrs = { + oldAttrs: { twitter: '@tomdale', name: 'Tom Dale', website: 'tomdale.net' }, + newAttrs: { twitter: '@horsetomdale', name: 'Horse Tom Dale', website: 'horsetomdale.net' } + }; + firstAttrs = { oldAttrs: { twitter: '@tomdale' }, newAttrs: { twitter: '@horsetomdale' } }; + secondAttrs = { oldAttrs: { name: 'Tom Dale' }, newAttrs: { name: 'Horse Tom Dale' } }; + lastAttrs = { oldAttrs: { website: 'tomdale.net' }, newAttrs: { website: 'horsetomdale.net' } }; + + this.assertHooks({ + label: 'after update', + + interactive: [ + // Sync hooks + + ['the-parent', 'didUpdateAttrs', parentAttrs], ['the-parent', 'didReceiveAttrs', parentAttrs], ['the-parent', 'willUpdate'], ['the-parent', 'willRender'], ['the-first-child', 'didUpdateAttrs', firstAttrs], ['the-first-child', 'didReceiveAttrs', firstAttrs], ['the-first-child', 'willUpdate'], ['the-first-child', 'willRender'], ['the-second-child', 'didUpdateAttrs', secondAttrs], ['the-second-child', 'didReceiveAttrs', secondAttrs], ['the-second-child', 'willUpdate'], ['the-second-child', 'willRender'], ['the-last-child', 'didUpdateAttrs', lastAttrs], ['the-last-child', 'didReceiveAttrs', lastAttrs], ['the-last-child', 'willUpdate'], ['the-last-child', 'willRender'], + + // Async hooks + + ['the-first-child', 'didUpdate'], ['the-first-child', 'didRender'], ['the-second-child', 'didUpdate'], ['the-second-child', 'didRender'], ['the-last-child', 'didUpdate'], ['the-last-child', 'didRender'], ['the-parent', 'didUpdate'], ['the-parent', 'didRender']], + + nonInteractive: [ + // Sync hooks + + ['the-parent', 'didUpdateAttrs', parentAttrs], ['the-parent', 'didReceiveAttrs', parentAttrs], ['the-first-child', 'didUpdateAttrs', firstAttrs], ['the-first-child', 'didReceiveAttrs', firstAttrs], ['the-second-child', 'didUpdateAttrs', secondAttrs], ['the-second-child', 'didReceiveAttrs', secondAttrs], ['the-last-child', 'didUpdateAttrs', lastAttrs], ['the-last-child', 'didReceiveAttrs', lastAttrs]] + }); + + this.teardownAssertions.push(function () { + _this4.assertHooks({ + label: 'destroy', + + interactive: [['the-parent', 'willDestroyElement'], ['the-parent', 'willClearRender'], ['the-first-child', 'willDestroyElement'], ['the-first-child', 'willClearRender'], ['the-second-child', 'willDestroyElement'], ['the-second-child', 'willClearRender'], ['the-last-child', 'willDestroyElement'], ['the-last-child', 'willClearRender'], ['the-parent', 'didDestroyElement'], ['the-first-child', 'didDestroyElement'], ['the-second-child', 'didDestroyElement'], ['the-last-child', 'didDestroyElement'], ['the-parent', 'willDestroy'], ['the-first-child', 'willDestroy'], ['the-second-child', 'willDestroy'], ['the-last-child', 'willDestroy']], + + nonInteractive: [['the-parent', 'willDestroy'], ['the-first-child', 'willDestroy'], ['the-second-child', 'willDestroy'], ['the-last-child', 'willDestroy']] + }); + + _this4.assertRegisteredViews('after destroy'); + }); + }; + + LifeCycleHooksTest.prototype['@test passing values through attrs causes lifecycle hooks to fire if the attribute values have changed'] = function testPassingValuesThroughAttrsCausesLifecycleHooksToFireIfTheAttributeValuesHaveChanged() { + var _this5 = this; + + var _boundHelpers3 = this.boundHelpers; + var attr = _boundHelpers3.attr; + var invoke = _boundHelpers3.invoke; + + this.registerComponent('the-top', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5, invoke('the-middle', { twitterTop: expr(attr('twitter')) })) + }); + + this.registerComponent('the-middle', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject6, invoke('the-bottom', { twitterMiddle: expr(attr('twitterTop')) })) + }); + + this.registerComponent('the-bottom', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject7, attr('twitterMiddle')) + }); + + this.render(invoke('the-top', { twitter: expr('twitter') }), { twitter: '@tomdale' }); + + this.assertText('Top: Middle: Bottom: @tomdale'); + this.assertRegisteredViews('intial render'); + + var topAttrs = { twitter: '@tomdale' }; + var middleAttrs = { twitterTop: '@tomdale' }; + var bottomAttrs = { twitterMiddle: '@tomdale' }; + + this.assertHooks({ + label: 'after initial render', + + interactive: [ + // Sync hooks + + ['the-top', 'init'], ['the-top', 'didInitAttrs', { attrs: topAttrs }], ['the-top', 'didReceiveAttrs', { newAttrs: topAttrs }], ['the-top', 'on(init)'], ['the-top', 'willRender'], ['the-top', 'willInsertElement'], ['the-middle', 'init'], ['the-middle', 'didInitAttrs', { attrs: middleAttrs }], ['the-middle', 'didReceiveAttrs', { newAttrs: middleAttrs }], ['the-middle', 'on(init)'], ['the-middle', 'willRender'], ['the-middle', 'willInsertElement'], ['the-bottom', 'init'], ['the-bottom', 'didInitAttrs', { attrs: bottomAttrs }], ['the-bottom', 'didReceiveAttrs', { newAttrs: bottomAttrs }], ['the-bottom', 'on(init)'], ['the-bottom', 'willRender'], ['the-bottom', 'willInsertElement'], + + // Async hooks + + ['the-bottom', 'didInsertElement'], ['the-bottom', 'didRender'], ['the-middle', 'didInsertElement'], ['the-middle', 'didRender'], ['the-top', 'didInsertElement'], ['the-top', 'didRender']], + + nonInteractive: [ + // Sync hooks + + ['the-top', 'init'], ['the-top', 'didInitAttrs', { attrs: topAttrs }], ['the-top', 'didReceiveAttrs', { newAttrs: topAttrs }], ['the-top', 'on(init)'], ['the-middle', 'init'], ['the-middle', 'didInitAttrs', { attrs: middleAttrs }], ['the-middle', 'didReceiveAttrs', { newAttrs: middleAttrs }], ['the-middle', 'on(init)'], ['the-bottom', 'init'], ['the-bottom', 'didInitAttrs', { attrs: bottomAttrs }], ['the-bottom', 'didReceiveAttrs', { newAttrs: bottomAttrs }], ['the-bottom', 'on(init)']] + }); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'twitter', '@horsetomdale'); + }); + + this.assertText('Top: Middle: Bottom: @horsetomdale'); + + // Because the `twitter` attr is used by the all of the components, + // the lifecycle hooks are invoked for all components. + + topAttrs = { oldAttrs: { twitter: '@tomdale' }, newAttrs: { twitter: '@horsetomdale' } }; + middleAttrs = { oldAttrs: { twitterTop: '@tomdale' }, newAttrs: { twitterTop: '@horsetomdale' } }; + bottomAttrs = { oldAttrs: { twitterMiddle: '@tomdale' }, newAttrs: { twitterMiddle: '@horsetomdale' } }; + + this.assertHooks({ + label: 'after updating (root)', + + interactive: [ + // Sync hooks + + ['the-top', 'didUpdateAttrs', topAttrs], ['the-top', 'didReceiveAttrs', topAttrs], ['the-top', 'willUpdate'], ['the-top', 'willRender'], ['the-middle', 'didUpdateAttrs', middleAttrs], ['the-middle', 'didReceiveAttrs', middleAttrs], ['the-middle', 'willUpdate'], ['the-middle', 'willRender'], ['the-bottom', 'didUpdateAttrs', bottomAttrs], ['the-bottom', 'didReceiveAttrs', bottomAttrs], ['the-bottom', 'willUpdate'], ['the-bottom', 'willRender'], + + // Async hooks + + ['the-bottom', 'didUpdate'], ['the-bottom', 'didRender'], ['the-middle', 'didUpdate'], ['the-middle', 'didRender'], ['the-top', 'didUpdate'], ['the-top', 'didRender']], + + nonInteractive: [ + // Sync hooks + + ['the-top', 'didUpdateAttrs', topAttrs], ['the-top', 'didReceiveAttrs', topAttrs], ['the-middle', 'didUpdateAttrs', middleAttrs], ['the-middle', 'didReceiveAttrs', middleAttrs], ['the-bottom', 'didUpdateAttrs', bottomAttrs], ['the-bottom', 'didReceiveAttrs', bottomAttrs]] + }); + + this.runTask(function () { + return _this5.rerender(); + }); + + this.assertText('Top: Middle: Bottom: @horsetomdale'); + + // In this case, because the attrs are passed down, all child components are invoked. + + topAttrs = { oldAttrs: { twitter: '@horsetomdale' }, newAttrs: { twitter: '@horsetomdale' } }; + middleAttrs = { oldAttrs: { twitterTop: '@horsetomdale' }, newAttrs: { twitterTop: '@horsetomdale' } }; + bottomAttrs = { oldAttrs: { twitterMiddle: '@horsetomdale' }, newAttrs: { twitterMiddle: '@horsetomdale' } }; + + this.assertHooks({ + label: 'after no-op rernder (root)', + interactive: [], + nonInteractive: [] + }); + + this.teardownAssertions.push(function () { + _this5.assertHooks({ + label: 'destroy', + + interactive: [['the-top', 'willDestroyElement'], ['the-top', 'willClearRender'], ['the-middle', 'willDestroyElement'], ['the-middle', 'willClearRender'], ['the-bottom', 'willDestroyElement'], ['the-bottom', 'willClearRender'], ['the-top', 'didDestroyElement'], ['the-middle', 'didDestroyElement'], ['the-bottom', 'didDestroyElement'], ['the-top', 'willDestroy'], ['the-middle', 'willDestroy'], ['the-bottom', 'willDestroy']], + + nonInteractive: [['the-top', 'willDestroy'], ['the-middle', 'willDestroy'], ['the-bottom', 'willDestroy']] + }); + + _this5.assertRegisteredViews('after destroy'); + }); + }; + + LifeCycleHooksTest.prototype['@test components rendered from `{{each}}` have correct life-cycle hooks to be called'] = function testComponentsRenderedFromEachHaveCorrectLifeCycleHooksToBeCalled() { + var _this6 = this; + + var invoke = this.boundHelpers.invoke; + + this.registerComponent('nested-item', { template: '{{yield}}' }); + + this.registerComponent('an-item', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject8) }); + + this.registerComponent('no-items', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject9) }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject10, invoke('an-item', { count: expr('item') }), invoke('no-items')), { + items: [1, 2, 3, 4, 5] + }); + + this.assertText('Item: 1Item: 2Item: 3Item: 4Item: 5'); + this.assertRegisteredViews('intial render'); + + var initialHooks = function (count) { + var ret = [['an-item', 'init'], ['an-item', 'didInitAttrs', { attrs: { count: count } }], ['an-item', 'didReceiveAttrs', { newAttrs: { count: count } }], ['an-item', 'on(init)']]; + if (_this6.isInteractive) { + ret.push(['an-item', 'willRender'], ['an-item', 'willInsertElement']); + } + ret.push(['nested-item', 'init'], ['nested-item', 'didInitAttrs', { attrs: {} }], ['nested-item', 'didReceiveAttrs', { newAttrs: {} }], ['nested-item', 'on(init)']); + if (_this6.isInteractive) { + ret.push(['nested-item', 'willRender'], ['nested-item', 'willInsertElement']); + } + return ret; + }; + + var initialAfterRenderHooks = function (count) { + if (_this6.isInteractive) { + return [['nested-item', 'didInsertElement'], ['nested-item', 'didRender'], ['an-item', 'didInsertElement'], ['an-item', 'didRender']]; + } else { + return []; + } + }; + + this.assertHooks({ + label: 'after initial render', + + interactive: [].concat(initialHooks(1), initialHooks(2), initialHooks(3), initialHooks(4), initialHooks(5), initialAfterRenderHooks(5), initialAfterRenderHooks(4), initialAfterRenderHooks(3), initialAfterRenderHooks(2), initialAfterRenderHooks(1)), + + nonInteractive: [].concat(initialHooks(1), initialHooks(2), initialHooks(3), initialHooks(4), initialHooks(5), initialAfterRenderHooks(5), initialAfterRenderHooks(4), initialAfterRenderHooks(3), initialAfterRenderHooks(2), initialAfterRenderHooks(1)) + }); + + // TODO: Is this correct? Should childViews be populated in non-interactive mode? + if (this.isInteractive) { + this.assert.equal(this.component.childViews.length, 5, 'childViews precond'); + } + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'items', []); + }); + + // TODO: Is this correct? Should childViews be populated in non-interactive mode? + if (this.isInteractive) { + this.assert.equal(this.component.childViews.length, 1, 'childViews updated'); + } + + this.assertText('Nothing to see here'); + + this.assertHooks({ + label: 'reset to empty array', + + interactive: [['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['no-items', 'init'], ['no-items', 'didInitAttrs', { attrs: {} }], ['no-items', 'didReceiveAttrs', { newAttrs: {} }], ['no-items', 'on(init)'], ['no-items', 'willRender'], ['no-items', 'willInsertElement'], ['nested-item', 'init'], ['nested-item', 'didInitAttrs', { attrs: {} }], ['nested-item', 'didReceiveAttrs', { newAttrs: {} }], ['nested-item', 'on(init)'], ['nested-item', 'willRender'], ['nested-item', 'willInsertElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['nested-item', 'didInsertElement'], ['nested-item', 'didRender'], ['no-items', 'didInsertElement'], ['no-items', 'didRender'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy']], + + nonInteractive: [['no-items', 'init'], ['no-items', 'didInitAttrs', { attrs: {} }], ['no-items', 'didReceiveAttrs', { newAttrs: {} }], ['no-items', 'on(init)'], ['nested-item', 'init'], ['nested-item', 'didInitAttrs', { attrs: {} }], ['nested-item', 'didReceiveAttrs', { newAttrs: {} }], ['nested-item', 'on(init)'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy']] + }); + + this.teardownAssertions.push(function () { + _this6.assertHooks({ + label: 'destroy', + + interactive: [['no-items', 'willDestroyElement'], ['no-items', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['no-items', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['no-items', 'willDestroy'], ['nested-item', 'willDestroy']], + + nonInteractive: [['no-items', 'willDestroy'], ['nested-item', 'willDestroy']] + }); + + _this6.assertRegisteredViews('after destroy'); + }); + }; + +babelHelpers.createClass(LifeCycleHooksTest, [{ + key: 'isInteractive', + get: function () { + return true; + } + }, { + key: 'ComponentClass', + get: function () { + throw new Error('Not implemented: `ComponentClass`'); + } + }, { + key: 'boundHelpers', + get: function () { + return { + invoke: bind(this.invocationFor, this), + attr: bind(this.attrFor, this) + }; + } + }]); + return LifeCycleHooksTest; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest); + + var CurlyComponentsTest = (function (_LifeCycleHooksTest) { +babelHelpers.inherits(CurlyComponentsTest, _LifeCycleHooksTest); + + function CurlyComponentsTest() { +babelHelpers.classCallCheck(this, CurlyComponentsTest); + + _LifeCycleHooksTest.apply(this, arguments); + } + + CurlyComponentsTest.prototype.invocationFor = function invocationFor(name) { + var _this7 = this; + + var namedArgs = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + var attrs = Object.keys(namedArgs).map(function (k) { + return k + '=' + _this7.val(namedArgs[k]); + }).join(' '); + return '{{' + name + ' ' + attrs + '}}'; + }; + + CurlyComponentsTest.prototype.attrFor = function attrFor(name) { + return '' + name; + }; + + /* private */ + + CurlyComponentsTest.prototype.val = function val(value) { + if (value.isString) { + return JSON.stringify(value.value); + } else if (value.isExpr) { + return '(readonly ' + value.value + ')'; + } else { + throw new Error('Unknown value: ' + value); + } + }; + +babelHelpers.createClass(CurlyComponentsTest, [{ + key: 'ComponentClass', + get: function () { + return _emberGlimmerTestsUtilsHelpers.Component; + } + }]); + return CurlyComponentsTest; + })(LifeCycleHooksTest); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: interactive lifecycle hooks (curly components)', (function (_CurlyComponentsTest) { +babelHelpers.inherits(_class, _CurlyComponentsTest); + + function _class() { +babelHelpers.classCallCheck(this, _class); + + _CurlyComponentsTest.apply(this, arguments); + } + +babelHelpers.createClass(_class, [{ + key: 'isInteractive', + get: function () { + return true; + } + }]); + return _class; + })(CurlyComponentsTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: non-interactive lifecycle hooks (curly components)', (function (_CurlyComponentsTest2) { +babelHelpers.inherits(_class2, _CurlyComponentsTest2); + + function _class2() { +babelHelpers.classCallCheck(this, _class2); + + _CurlyComponentsTest2.apply(this, arguments); + } + +babelHelpers.createClass(_class2, [{ + key: 'isInteractive', + get: function () { + return false; + } + }]); + return _class2; + })(CurlyComponentsTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: interactive lifecycle hooks (tagless curly components)', (function (_CurlyComponentsTest3) { +babelHelpers.inherits(_class3, _CurlyComponentsTest3); + + function _class3() { +babelHelpers.classCallCheck(this, _class3); + + _CurlyComponentsTest3.apply(this, arguments); + } + +babelHelpers.createClass(_class3, [{ + key: 'ComponentClass', + get: function () { + return _emberGlimmerTestsUtilsHelpers.Component.extend({ tagName: '' }); + } + }, { + key: 'isInteractive', + get: function () { + return true; + } + }]); + return _class3; + })(CurlyComponentsTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: non-interactive lifecycle hooks (tagless curly components)', (function (_CurlyComponentsTest4) { +babelHelpers.inherits(_class4, _CurlyComponentsTest4); + + function _class4() { +babelHelpers.classCallCheck(this, _class4); + + _CurlyComponentsTest4.apply(this, arguments); + } + +babelHelpers.createClass(_class4, [{ + key: 'ComponentClass', + get: function () { + return _emberGlimmerTestsUtilsHelpers.Component.extend({ tagName: '' }); + } + }, { + key: 'isInteractive', + get: function () { + return false; + } + }]); + return _class4; + })(CurlyComponentsTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Run loop and lifecycle hooks', (function (_RenderingTest2) { +babelHelpers.inherits(_class5, _RenderingTest2); + + function _class5() { +babelHelpers.classCallCheck(this, _class5); + + _RenderingTest2.apply(this, arguments); + } + + _class5.prototype['@test afterRender set'] = function testAfterRenderSet() { + var _this9 = this; + + var ComponentClass = _emberGlimmerTestsUtilsHelpers.Component.extend({ + width: '5', + didInsertElement: function () { + var _this8 = this; + + _emberMetal.run.scheduleOnce('afterRender', function () { + _this8.set('width', '10'); + }); + } + }); + + var template = '{{width}}'; + this.registerComponent('foo-bar', { ComponentClass: ComponentClass, template: template }); + + this.render('{{foo-bar}}'); + + this.assertText('10'); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertText('10'); + }; + + _class5.prototype['@test afterRender set on parent'] = function testAfterRenderSetOnParent() { + var _this11 = this; + + var ComponentClass = _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + var _this10 = this; + + _emberMetal.run.scheduleOnce('afterRender', function () { + var parent = _this10.get('parent'); + parent.set('foo', 'wat'); + }); + } + }); + + var template = '{{foo}}'; + + this.registerComponent('foo-bar', { ComponentClass: ComponentClass, template: template }); + + this.render('{{foo-bar parent=this foo=foo}}'); + + this.assertText('wat'); + + this.runTask(function () { + return _this11.rerender(); + }); + + this.assertText('wat'); + }; + + _class5.prototype['@test `willRender` can set before render (GH#14458)'] = function testWillRenderCanSetBeforeRenderGH14458(assert) { + var ComponentClass = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'a', + customHref: 'http://google.com', + attributeBindings: ['customHref:href'], + willRender: function () { + this.set('customHref', 'http://willRender.com'); + } + }); + + var template = 'Hello World'; + + this.registerComponent('foo-bar', { ComponentClass: ComponentClass, template: template }); + + this.render('{{foo-bar id="foo"}}'); + + this.assertElement(this.firstChild, { + tagName: 'a', + attrs: { + id: 'foo', + href: 'http://willRender.com', + class: _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') + } + }); + }; + + _class5.prototype['@test that thing about destroying'] = function testThatThingAboutDestroying(assert) { + var _this12 = this; + + var ParentDestroyedElements = []; + var ChildDestroyedElements = []; + + var ParentComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + willDestroyElement: function () { + ParentDestroyedElements.push({ + id: this.itemId, + name: 'parent-component', + hasParent: !!this.element.parentNode, + nextSibling: !!this.element.nextSibling, + previousSibling: !!this.element.previousSibling + }); + } + }); + + var PartentTemplate = _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject11); + + var NestedComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + willDestroyElement: function () { + ChildDestroyedElements.push({ + id: this.nestedId, + name: 'nested-component', + hasParent: !!this.element.parentNode, + nextSibling: !!this.element.nextSibling, + previousSibling: !!this.element.previousSibling + }); + } + }); + + var NestedTemplate = '{{yield}}'; + + this.registerComponent('parent-component', { + ComponentClass: ParentComponent, + template: PartentTemplate + }); + + this.registerComponent('nested-component', { + ComponentClass: NestedComponent, + template: NestedTemplate + }); + + var array = _emberRuntime.A([{ id: 1 }, { id: 2 }, { id: 3 }, { id: 4 }, { id: 5 }]); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject12), { + items: array, + model: { shouldShow: true } + }); + + this.assertText('1AB2AB3AB4AB5AB6AB7AB'); + + this.runTask(function () { + array.removeAt(2); + array.removeAt(2); + _emberMetal.set(_this12.context, 'model.shouldShow', false); + }); + + this.assertText('1AB2AB5AB'); + + assertDestroyHooks(assert, [].concat(ParentDestroyedElements), [{ + id: 3, + hasParent: true, + nextSibling: true, + previousSibling: true + }, { + id: 4, + hasParent: true, + nextSibling: true, + previousSibling: true + }, { + id: 6, + hasParent: true, + nextSibling: true, + previousSibling: true + }, { + id: 7, + hasParent: true, + nextSibling: false, + previousSibling: true + }]); + + assertDestroyHooks(assert, [].concat(ChildDestroyedElements), [{ + id: '3-A', + hasParent: true, + nextSibling: true, + previousSibling: false + }, { + id: '3-B', + hasParent: true, + nextSibling: false, + previousSibling: true + }, { + id: '4-A', + hasParent: true, + nextSibling: true, + previousSibling: false + }, { + id: '4-B', + hasParent: true, + nextSibling: false, + previousSibling: true + }, { + id: '6-A', + hasParent: true, + nextSibling: true, + previousSibling: false + }, { + id: '6-B', + hasParent: true, + nextSibling: false, + previousSibling: true + }, { + id: '7-A', + hasParent: true, + nextSibling: true, + previousSibling: false + }, { + id: '7-B', + hasParent: true, + nextSibling: false, + previousSibling: true + }]); + }; + + _class5.prototype['@test lifecycle hooks have proper access to this.$()'] = function testLifecycleHooksHaveProperAccessToThis$(assert) { + assert.expect(6); + var component = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'div', + init: function () { + assert.notOk(this.$(), 'no access to element via this.$() on init() enter'); + this._super.apply(this, arguments); + assert.notOk(this.$(), 'no access to element via this.$() after init() finished'); + }, + willInsertElement: function () { + component = this; + assert.ok(this.$(), 'willInsertElement has access to element via this.$()'); + }, + didInsertElement: function () { + assert.ok(this.$(), 'didInsertElement has access to element via this.$()'); + }, + willDestroyElement: function () { + assert.ok(this.$(), 'willDestroyElement has access to element via this.$()'); + }, + didDestroyElement: function () { + assert.notOk(this.$(), 'didDestroyElement does not have access to element via this.$()'); + } + }); + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + var owner = this.owner; + + var comp = owner.lookup('component:foo-bar'); + _internalTestHelpers.runAppend(comp); + this.runTask(function () { + return _emberUtils.tryInvoke(component, 'destroy'); + }); + }; + + return _class5; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + function assertDestroyHooks(assert, _actual, _expected) { + _expected.forEach(function (expected, i) { + var name = expected.name; + assert.equal(expected.id, _actual[i].id, name + ' id is the same'); + assert.equal(expected.hasParent, _actual[i].hasParent, name + ' has parent node'); + assert.equal(expected.nextSibling, _actual[i].nextSibling, name + ' has next sibling node'); + assert.equal(expected.previousSibling, _actual[i].previousSibling, name + ' has previous sibling node'); + }); + } + + function bind(func, thisArg) { + return function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return func.apply(thisArg, args); + }; + } + + function string(value) { + return { isString: true, value: value }; + } + + function expr(value) { + return { isExpr: true, value: value }; + } + + function hook(name, hook, args) { + return { name: name, hook: hook, args: args }; + } + + function json(serializable) { + return JSON.parse(JSON.stringify(serializable)); + } +}); + +// Sync hooks + +// Async hooks + +// Sync hooks + +// Async hooks +enifed('ember-glimmer/tests/integration/components/life-cycle-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/life-cycle-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/life-cycle-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/life-cycle-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/life-cycle-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/life-cycle-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/link-to-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-runtime', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/test-helpers'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberRuntime, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsTestHelpers) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Link-to component', (function (_ApplicationTest) { + babelHelpers.inherits(_class, _ApplicationTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _ApplicationTest.apply(this, arguments); + } + + _class.prototype.visitWithDeprecation = function visitWithDeprecation(path, deprecation) { + var _this = this; + + var p = undefined; + + expectDeprecation(function () { + p = _this.visit(path); + }, deprecation); + + return p; + }; + + _class.prototype['@test accessing `currentWhen` triggers a deprecation'] = function testAccessingCurrentWhenTriggersADeprecation(assert) { + var component = undefined; + this.registerComponent('link-to', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.LinkComponent.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + } + }) + }); + + this.registerTemplate('application', '{{link-to \'Index\' \'index\'}}'); + + return this.visit('/').then(function () { + expectDeprecation(function () { + component.get('currentWhen'); + }, /Usage of `currentWhen` is deprecated, use `current-when` instead/); + }); + }; + + _class.prototype['@test should be able to be inserted in DOM when the router is not present'] = function testShouldBeAbleToBeInsertedInDOMWhenTheRouterIsNotPresent() { + var _this2 = this; + + this.registerTemplate('application', '{{#link-to \'index\'}}Go to Index{{/link-to}}'); + + return this.visit('/').then(function () { + _this2.assertText('Go to Index'); + }); + }; + + _class.prototype['@test re-renders when title changes'] = function testReRendersWhenTitleChanges() { + var _this3 = this; + + var controller = undefined; + + this.registerTemplate('application', '{{link-to title routeName}}'); + this.registerController('application', _emberRuntime.Controller.extend({ + init: function () { + this._super.apply(this, arguments); + controller = this; + }, + title: 'foo', + routeName: 'index' + })); + + return this.visit('/').then(function () { + _this3.assertText('foo'); + _this3.runTask(function () { + return _emberMetal.set(controller, 'title', 'bar'); + }); + _this3.assertText('bar'); + }); + }; + + _class.prototype['@test escaped inline form (double curlies) escapes link title'] = function testEscapedInlineFormDoubleCurliesEscapesLinkTitle() { + var _this4 = this; + + this.registerTemplate('application', '{{link-to title \'index\'}}'); + this.registerController('application', _emberRuntime.Controller.extend({ + title: 'blah' + })); + + return this.visit('/').then(function () { + _this4.assertText('blah'); + }); + }; + + _class.prototype['@test escaped inline form with (-html-safe) does not escape link title'] = function testEscapedInlineFormWithHtmlSafeDoesNotEscapeLinkTitle(assert) { + var _this5 = this; + + this.registerTemplate('application', '{{link-to (-html-safe title) \'index\'}}'); + this.registerController('application', _emberRuntime.Controller.extend({ + title: 'blah' + })); + + return this.visit('/').then(function () { + _this5.assertText('blah'); + assert.equal(_this5.$('b').length, 1); + }); + }; + + _class.prototype['@test unescaped inline form (triple curlies) does not escape link title'] = function testUnescapedInlineFormTripleCurliesDoesNotEscapeLinkTitle(assert) { + var _this6 = this; + + this.registerTemplate('application', '{{{link-to title \'index\'}}}'); + this.registerController('application', _emberRuntime.Controller.extend({ + title: 'blah' + })); + + return this.visit('/').then(function () { + _this6.assertText('blah'); + assert.equal(_this6.$('b').length, 1); + }); + }; + + _class.prototype['@test unwraps controllers'] = function testUnwrapsControllers() { + var _this7 = this; + + this.router.map(function () { + this.route('profile', { path: '/profile/:id' }); + }); + this.registerTemplate('application', '{{#link-to \'profile\' otherController}}Text{{/link-to}}'); + this.registerController('application', _emberRuntime.Controller.extend({ + otherController: _emberRuntime.Controller.create({ + model: 'foo' + }) + })); + + var deprecation = /Providing `{{link-to}}` with a param that is wrapped in a controller is deprecated./; + + return this.visitWithDeprecation('/', deprecation).then(function () { + _this7.assertText('Text'); + }); + }; + + _class.prototype['@test able to safely extend the built-in component and use the normal path'] = function testAbleToSafelyExtendTheBuiltInComponentAndUseTheNormalPath() { + var _this8 = this; + + this.registerComponent('custom-link-to', { ComponentClass: _emberGlimmerTestsUtilsHelpers.LinkComponent.extend() }); + this.registerTemplate('application', '{{#custom-link-to \'index\'}}{{title}}{{/custom-link-to}}'); + this.registerController('application', _emberRuntime.Controller.extend({ + title: 'Hello' + })); + + return this.visit('/').then(function () { + _this8.assertText('Hello'); + }); + }; + + _class.prototype['@test [GH#13432] able to safely extend the built-in component and invoke it inline'] = function testGH13432AbleToSafelyExtendTheBuiltInComponentAndInvokeItInline() { + var _this9 = this; + + this.registerComponent('custom-link-to', { ComponentClass: _emberGlimmerTestsUtilsHelpers.LinkComponent.extend() }); + this.registerTemplate('application', '{{custom-link-to title \'index\'}}'); + this.registerController('application', _emberRuntime.Controller.extend({ + title: 'Hello' + })); + + return this.visit('/').then(function () { + _this9.assertText('Hello'); + }); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.ApplicationTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Link-to component with query-params', (function (_ApplicationTest2) { + babelHelpers.inherits(_class2, _ApplicationTest2); + + function _class2() { + babelHelpers.classCallCheck(this, _class2); + + _ApplicationTest2.apply(this, arguments); + + this.registerController('index', _emberRuntime.Controller.extend({ + queryParams: ['foo'], + foo: '123', + bar: 'yes' + })); + } + + _class2.prototype['@test populates href with fully supplied query param values'] = function testPopulatesHrefWithFullySuppliedQueryParamValues(assert) { + var _this10 = this; + + this.registerTemplate('index', '{{#link-to \'index\' (query-params foo=\'456\' bar=\'NAW\')}}Index{{/link-to}}'); + + return this.visit('/').then(function () { + _this10.assertComponentElement(_this10.firstChild.firstElementChild, { + tagName: 'a', + attrs: { href: '/?bar=NAW&foo=456' }, + content: 'Index' + }); + }); + }; + + _class2.prototype['@test populates href with partially supplied query param values, but omits if value is default value'] = function testPopulatesHrefWithPartiallySuppliedQueryParamValuesButOmitsIfValueIsDefaultValue() { + var _this11 = this; + + this.registerTemplate('index', '{{#link-to \'index\' (query-params foo=\'123\')}}Index{{/link-to}}'); + + return this.visit('/').then(function () { + _this11.assertComponentElement(_this11.firstChild.firstElementChild, { + tagName: 'a', + attrs: { href: '/', class: _emberGlimmerTestsUtilsTestHelpers.classes('ember-view active') }, + content: 'Index' + }); + }); + }; + + return _class2; + })(_emberGlimmerTestsUtilsTestCase.ApplicationTest)); +}); +enifed('ember-glimmer/tests/integration/components/link-to-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/link-to-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/link-to-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/link-to-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/link-to-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/link-to-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/local-lookup-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers) { + 'use strict'; + + function buildResolver() { + var resolver = { + resolve: function () {}, + expandLocalLookup: function (fullName, sourceFullName) { + var _sourceFullName$split = sourceFullName.split(':'); + + var sourceType = _sourceFullName$split[0]; + var sourceName = _sourceFullName$split[1]; + + var _fullName$split = fullName.split(':'); + + var type = _fullName$split[0]; + var name = _fullName$split[1]; + + if (type !== 'template' && sourceType === 'template' && sourceName.slice(0, 11) === 'components/') { + sourceName = sourceName.slice(11); + } + + if (type === 'template' && sourceType === 'template' && name.slice(0, 11) === 'components/') { + name = name.slice(11); + } + + var result = type + ':' + sourceName + '/' + name; + + return result; + } + }; + + return resolver; + } + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: local lookup', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype.getResolver = function getResolver() { + return buildResolver(); + }; + + _class.prototype['@test it can lookup a local template'] = function testItCanLookupALocalTemplate() { + var _this = this; + + this.registerComponent('x-outer/x-inner', { template: 'Nested template says: {{yield}}' }); + this.registerComponent('x-outer', { template: '{{#x-inner}}Hi!{{/x-inner}}' }); + + this.render('{{x-outer}}'); + + this.assertText('Nested template says: Hi!', 'Initial render works'); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertText('Nested template says: Hi!', 'Re-render works'); + }; + + _class.prototype['@test tagless blockless component can lookup local template'] = function testTaglessBlocklessComponentCanLookupLocalTemplate() { + var _this2 = this; + + this.registerComponent('x-outer/x-inner', { template: 'Nested template says: {{yield}}' }); + this.registerTemplate('components/x-outer', '{{#x-inner}}Hi!{{/x-inner}}'); + this.registerComponent('x-outer', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ tagName: '' }) + }); + + this.render('{{x-outer}}'); + + this.assertText('Nested template says: Hi!', 'Re-render works'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertText('Nested template says: Hi!', 'Re-render works'); + }; + + _class.prototype['@test it can lookup a local component template'] = function testItCanLookupALocalComponentTemplate() { + var _this3 = this; + + this.registerTemplate('components/x-outer/x-inner', 'Nested template says: {{yield}}'); + this.registerTemplate('components/x-outer', '{{#x-inner}}Hi!{{/x-inner}}'); + + this.render('{{x-outer}}'); + + this.assertText('Nested template says: Hi!', 'Initial render works'); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertText('Nested template says: Hi!', 'Re-render works'); + }; + + _class.prototype['@test it can local lookup a dynamic component'] = function testItCanLocalLookupADynamicComponent() { + var _this4 = this; + + this.registerComponent('foo-bar', { template: 'yall finished {{component child}}' }); + this.registerComponent('foo-bar/biz-baz', { template: 'or yall done?' }); + + this.render('{{foo-bar child=child}}', { child: 'biz-baz' }); + + this.assertText('yall finished or yall done?'); + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assertText('yall finished or yall done?'); + }; + + _class.prototype['@test it can local lookup a dynamic component from a dynamic component'] = function testItCanLocalLookupADynamicComponentFromADynamicComponent() { + var _this5 = this; + + this.registerComponent('foo-bar', { template: 'yall finished {{component child}}' }); + this.registerComponent('foo-bar/biz-baz', { template: 'or yall done?' }); + + this.render('{{component componentName child=child}}', { componentName: 'foo-bar', child: 'biz-baz' }); + + this.assertText('yall finished or yall done?'); + + this.runTask(function () { + return _this5.rerender(); + }); + + this.assertText('yall finished or yall done?'); + }; + + _class.prototype['@test it can local lookup a dynamic component from a passed named argument'] = function testItCanLocalLookupADynamicComponentFromAPassedNamedArgument() { + var _this6 = this; + + this.registerComponent('parent-foo', { template: 'yall finished {{global-biz baz=(component \'local-bar\')}}' }); + this.registerComponent('global-biz', { template: 'or {{component baz}}' }); + this.registerComponent('parent-foo/local-bar', { template: 'yall done?' }); + + this.render('{{parent-foo}}'); + + this.assertText('yall finished or yall done?'); + + this.runTask(function () { + return _this6.rerender(); + }); + + this.assertText('yall finished or yall done?'); + }; + + _class.prototype['@test it can local lookup a re-wrapped dynamic component from a passed named argument'] = function testItCanLocalLookupAReWrappedDynamicComponentFromAPassedNamedArgument() { + var _this7 = this; + + this.registerComponent('parent-foo', { template: 'yall finished {{global-x comp=(component \'local-bar\')}}' }); + this.registerComponent('global-x', { template: 'or {{global-y comp=(component comp phrase=\'done\')}}' }); + this.registerComponent('global-y', { template: '{{component comp}}?' }); + this.registerComponent('parent-foo/local-bar', { template: 'yall {{phrase}}' }); + + this.render('{{parent-foo}}'); + + this.assertText('yall finished or yall done?'); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertText('yall finished or yall done?'); + }; + + _class.prototype['@test it can nest local lookups of dynamic components from a passed named argument'] = function testItCanNestLocalLookupsOfDynamicComponentsFromAPassedNamedArgument() { + var _this8 = this; + + this.registerComponent('parent-foo', { template: 'yall finished {{global-x comp=(component \'local-bar\')}}' }); + this.registerComponent('global-x', { template: 'or {{global-y comp=(component comp phrase=\'done\')}}' }); + this.registerComponent('global-y', { template: '{{component comp}}{{component \'local-bar\'}}' }); + this.registerComponent('parent-foo/local-bar', { template: 'yall {{phrase}}' }); + this.registerComponent('global-y/local-bar', { template: '?' }); + + this.render('{{parent-foo}}'); + + this.assertText('yall finished or yall done?'); + + this.runTask(function () { + return _this8.rerender(); + }); + + this.assertText('yall finished or yall done?'); + }; + + _class.prototype['@test it can switch from local to global lookups of dynamic components from a passed named argument'] = function testItCanSwitchFromLocalToGlobalLookupsOfDynamicComponentsFromAPassedNamedArgument() { + var _this9 = this; + + this.registerComponent('parent-foo', { template: 'yall finished {{global-x comp=(component bar)}}' }); + this.registerComponent('global-x', { template: 'or yall {{component comp}}' }); + this.registerComponent('parent-foo/local-bar', { template: 'done?' }); + this.registerComponent('global-bar', { template: 'ready?' }); + + this.render('{{parent-foo bar=bar}}', { bar: 'local-bar' }); + + this.assertText('yall finished or yall done?'); + + this.runTask(function () { + return _this9.context.set('bar', 'global-bar'); + }); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertText('yall finished or yall ready?'); + }; + + _class.prototype['@test it can lookup a local helper'] = function testItCanLookupALocalHelper() { + var _this10 = this; + + this.registerHelper('x-outer/x-helper', function () { + return 'Who dis?'; + }); + this.registerComponent('x-outer', { template: 'Who dat? {{x-helper}}' }); + + this.render('{{x-outer}}'); + + this.assertText('Who dat? Who dis?', 'Initial render works'); + + this.runTask(function () { + return _this10.rerender(); + }); + + this.assertText('Who dat? Who dis?', 'Re-render works'); + }; + + _class.prototype['@test it overrides global helper lookup'] = function testItOverridesGlobalHelperLookup() { + var _this11 = this; + + this.registerHelper('x-outer/x-helper', function () { + return 'Who dis?'; + }); + + this.registerHelper('x-helper', function () { + return 'I dunno'; + }); + + this.registerComponent('x-outer', { template: 'Who dat? {{x-helper}}' }); + + this.render('{{x-outer}} {{x-helper}}'); + + this.assertText('Who dat? Who dis? I dunno', 'Initial render works'); + + this.runTask(function () { + return _this11.rerender(); + }); + + this.assertText('Who dat? Who dis? I dunno', 'Re-render works'); + }; + + _class.prototype['@test lookup without match issues standard assertion (with local helper name)'] = function testLookupWithoutMatchIssuesStandardAssertionWithLocalHelperName() { + var _this12 = this; + + this.registerComponent('x-outer', { template: '{{#x-inner}}Hi!{{/x-inner}}' }); + + expectAssertion(function () { + _this12.render('{{x-outer}}'); + }, /A component or helper named "x-inner" could not be found/); + }; + + _class.prototype['@test overrides global lookup'] = function testOverridesGlobalLookup() { + var _this13 = this; + + this.registerComponent('x-outer', { template: '{{#x-inner}}Hi!{{/x-inner}}' }); + this.registerComponent('x-outer/x-inner', { template: 'Nested template says (from local): {{yield}}' }); + this.registerComponent('x-inner', { template: 'Nested template says (from global): {{yield}}' }); + + this.render('{{#x-inner}}Hi!{{/x-inner}} {{x-outer}} {{#x-outer/x-inner}}Hi!{{/x-outer/x-inner}}'); + + this.assertText('Nested template says (from global): Hi! Nested template says (from local): Hi! Nested template says (from local): Hi!'); + + this.runTask(function () { + return _this13.rerender(); + }); + + this.assertText('Nested template says (from global): Hi! Nested template says (from local): Hi! Nested template says (from local): Hi!'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/components/local-lookup-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/local-lookup-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/local-lookup-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/local-lookup-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/local-lookup-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/local-lookup-test.js should pass jshint.'); + }); +}); +enifed("ember-glimmer/tests/integration/components/render-to-element-test", ["exports"], function (exports) { + "use strict"; +}); +enifed('ember-glimmer/tests/integration/components/render-to-element-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/render-to-element-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/render-to-element-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/render-to-element-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/render-to-element-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/render-to-element-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/target-action-test', ['exports', 'ember-utils', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-runtime', 'ember-routing'], function (exports, _emberUtils, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberRuntime, _emberRouting) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{#component-a}}\n {{component-b bar="derp"}}\n {{/component-a}}\n '], ['\n {{#component-a}}\n {{component-b bar="derp"}}\n {{/component-a}}\n ']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: sendAction', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { +babelHelpers.classCallCheck(this, _class); + + _RenderingTest.call(this); + this.actionCounts = {}; + this.sendCount = 0; + this.actionArguments = null; + + var self = this; + + this.registerComponent('action-delegate', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + self.delegate = this; + this.name = 'action-delegate'; + } + }) + }); + } + + _class.prototype.renderDelegate = function renderDelegate() { + var template = arguments.length <= 0 || arguments[0] === undefined ? '{{action-delegate}}' : arguments[0]; + var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + var root = this; + context = _emberUtils.assign(context, { + send: function (actionName) { + root.sendCount++; + root.actionCounts[actionName] = root.actionCounts[actionName] || 0; + root.actionCounts[actionName]++; + + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + root.actionArguments = args; + } + }); + this.render(template, context); + }; + + _class.prototype.assertSendCount = function assertSendCount(count) { + this.assert.equal(this.sendCount, count, 'Send was called ' + count + ' time(s)'); + }; + + _class.prototype.assertNamedSendCount = function assertNamedSendCount(actionName, count) { + this.assert.equal(this.actionCounts[actionName], count, 'An action named \'' + actionName + '\' was sent ' + count + ' times'); + }; + + _class.prototype.assertSentWithArgs = function assertSentWithArgs(expected) { + var message = arguments.length <= 1 || arguments[1] === undefined ? 'arguments were sent with the action' : arguments[1]; + + this.assert.deepEqual(this.actionArguments, expected, message); + }; + + _class.prototype['@test Calling sendAction on a component without an action defined does nothing'] = function testCallingSendActionOnAComponentWithoutAnActionDefinedDoesNothing() { + var _this = this; + + this.renderDelegate(); + + this.runTask(function () { + return _this.delegate.sendAction(); + }); + + this.assertSendCount(0); + }; + + _class.prototype['@test Calling sendAction on a component with an action defined calls send on the controller'] = function testCallingSendActionOnAComponentWithAnActionDefinedCallsSendOnTheController() { + var _this2 = this; + + this.renderDelegate(); + + this.runTask(function () { + _emberMetal.set(_this2.delegate, 'action', 'addItem'); + _this2.delegate.sendAction(); + }); + + this.assertSendCount(1); + this.assertNamedSendCount('addItem', 1); + }; + + _class.prototype['@test Calling sendAction on a component with a function calls the function'] = function testCallingSendActionOnAComponentWithAFunctionCallsTheFunction() { + var _this3 = this; + + this.assert.expect(1); + + this.renderDelegate(); + + this.runTask(function () { + _emberMetal.set(_this3.delegate, 'action', function () { + return _this3.assert.ok(true, 'function is called'); + }); + _this3.delegate.sendAction(); + }); + }; + + _class.prototype['@test Calling sendAction on a component with a function calls the function with arguments'] = function testCallingSendActionOnAComponentWithAFunctionCallsTheFunctionWithArguments() { + var _this4 = this; + + this.assert.expect(1); + var argument = {}; + + this.renderDelegate(); + + this.runTask(function () { + _emberMetal.set(_this4.delegate, 'action', function (actualArgument) { + _this4.assert.deepEqual(argument, actualArgument, 'argument is passed'); + }); + _this4.delegate.sendAction('action', argument); + }); + }; + + // TODO consolidate these next 2 tests + + _class.prototype['@test Calling sendAction on a component with a reference attr calls the function with arguments'] = function testCallingSendActionOnAComponentWithAReferenceAttrCallsTheFunctionWithArguments() { + var _this5 = this; + + this.renderDelegate('{{action-delegate playing=playing}}', { + playing: null + }); + + this.runTask(function () { + return _this5.delegate.sendAction(); + }); + + this.assertSendCount(0); + + this.runTask(function () { + _emberMetal.set(_this5.context, 'playing', 'didStartPlaying'); + }); + + this.runTask(function () { + _this5.delegate.sendAction('playing'); + }); + + this.assertSendCount(1); + this.assertNamedSendCount('didStartPlaying', 1); + }; + + _class.prototype['@test Calling sendAction on a component with a {{mut}} attr calls the function with arguments'] = function testCallingSendActionOnAComponentWithAMutAttrCallsTheFunctionWithArguments() { + var _this6 = this; + + this.renderDelegate('{{action-delegate playing=(mut playing)}}', { + playing: null + }); + + this.runTask(function () { + return _this6.delegate.sendAction('playing'); + }); + + this.assertSendCount(0); + + this.runTask(function () { + return _this6.delegate.attrs.playing.update('didStartPlaying'); + }); + this.runTask(function () { + return _this6.delegate.sendAction('playing'); + }); + + this.assertSendCount(1); + this.assertNamedSendCount('didStartPlaying', 1); + }; + + _class.prototype['@test Calling sendAction with a named action uses the component\'s property as the action name'] = function testCallingSendActionWithANamedActionUsesTheComponentSPropertyAsTheActionName() { + var _this7 = this; + + this.renderDelegate(); + + var component = this.delegate; + + this.runTask(function () { + _emberMetal.set(_this7.delegate, 'playing', 'didStartPlaying'); + component.sendAction('playing'); + }); + + this.assertSendCount(1); + this.assertNamedSendCount('didStartPlaying', 1); + + this.runTask(function () { + return component.sendAction('playing'); + }); + + this.assertSendCount(2); + this.assertNamedSendCount('didStartPlaying', 2); + + this.runTask(function () { + _emberMetal.set(component, 'action', 'didDoSomeBusiness'); + component.sendAction(); + }); + + this.assertSendCount(3); + this.assertNamedSendCount('didDoSomeBusiness', 1); + }; + + _class.prototype['@test Calling sendAction when the action name is not a string raises an exception'] = function testCallingSendActionWhenTheActionNameIsNotAStringRaisesAnException() { + var _this8 = this; + + this.renderDelegate(); + + this.runTask(function () { + _emberMetal.set(_this8.delegate, 'action', {}); + _emberMetal.set(_this8.delegate, 'playing', {}); + }); + + expectAssertion(function () { + return _this8.delegate.sendAction(); + }); + expectAssertion(function () { + return _this8.delegate.sendAction('playing'); + }); + }; + + _class.prototype['@test Calling sendAction on a component with contexts'] = function testCallingSendActionOnAComponentWithContexts() { + var _this9 = this; + + this.renderDelegate(); + + var testContext = { song: 'She Broke My Ember' }; + var firstContext = { song: 'She Broke My Ember' }; + var secondContext = { song: 'My Achey Breaky Ember' }; + + this.runTask(function () { + _emberMetal.set(_this9.delegate, 'playing', 'didStartPlaying'); + _this9.delegate.sendAction('playing', testContext); + }); + + this.assertSendCount(1); + this.assertNamedSendCount('didStartPlaying', 1); + this.assertSentWithArgs([testContext], 'context was sent with the action'); + + this.runTask(function () { + _this9.delegate.sendAction('playing', firstContext, secondContext); + }); + + this.assertSendCount(2); + this.assertNamedSendCount('didStartPlaying', 2); + this.assertSentWithArgs([firstContext, secondContext], 'multiple contexts were sent to the action'); + }; + + _class.prototype['@test calling sendAction on a component within a block sends to the outer scope GH#14216'] = function testCallingSendActionOnAComponentWithinABlockSendsToTheOuterScopeGH14216(assert) { + var testContext = this; + // overrides default action-delegate so actions can be added + this.registerComponent('action-delegate', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + testContext.delegate = this; + this.name = 'action-delegate'; + }, + + actions: { + derp: function (arg1) { + assert.ok(true, 'action called on action-delgate'); + assert.equal(arg1, 'something special', 'argument passed through properly'); + } + } + }), + + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject) + }); + + this.registerComponent('component-a', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + this.name = 'component-a'; + }, + actions: { + derp: function () { + assert.ok(false, 'no! bad scoping!'); + } + } + }) + }); + + var innerChild = undefined; + this.registerComponent('component-b', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerChild = this; + this.name = 'component-b'; + } + }) + }); + + this.renderDelegate(); + + this.runTask(function () { + return innerChild.sendAction('bar', 'something special'); + }); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: sendAction to a controller', (function (_ApplicationTest) { +babelHelpers.inherits(_class2, _ApplicationTest); + + function _class2() { +babelHelpers.classCallCheck(this, _class2); + + _ApplicationTest.apply(this, arguments); + } + + _class2.prototype['@test sendAction should trigger an action on the parent component\'s controller if it exists'] = function testSendActionShouldTriggerAnActionOnTheParentComponentSControllerIfItExists(assert) { + var _this10 = this; + + assert.expect(15); + + var component = undefined; + + this.router.map(function () { + this.route('a'); + this.route('b'); + this.route('c', function () { + this.route('d'); + this.route('e'); + }); + }); + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + } + }), + template: '{{val}}' + }); + + this.registerController('a', _emberRuntime.Controller.extend({ + send: function (actionName, actionContext) { + assert.equal(actionName, 'poke', 'send() method was invoked from a top level controller'); + assert.equal(actionContext, 'top', 'action arguments were passed into the top level controller'); + } + })); + this.registerTemplate('a', '{{foo-bar val="a" poke="poke"}}'); + + this.registerRoute('b', _emberRouting.Route.extend({ + actions: { + poke: function (actionContext) { + assert.ok(true, 'Unhandled action sent to route'); + assert.equal(actionContext, 'top no controller'); + } + } + })); + this.registerTemplate('b', '{{foo-bar val="b" poke="poke"}}'); + + this.registerRoute('c', _emberRouting.Route.extend({ + actions: { + poke: function (actionContext) { + assert.ok(true, 'Unhandled action sent to route'); + assert.equal(actionContext, 'top with nested no controller'); + } + } + })); + this.registerTemplate('c', '{{foo-bar val="c" poke="poke"}}{{outlet}}'); + + this.registerRoute('c.d', _emberRouting.Route.extend({})); + + this.registerController('c.d', _emberRuntime.Controller.extend({ + send: function (actionName, actionContext) { + assert.equal(actionName, 'poke', 'send() method was invoked from a nested controller'); + assert.equal(actionContext, 'nested', 'action arguments were passed into the nested controller'); + } + })); + this.registerTemplate('c.d', '{{foo-bar val=".d" poke="poke"}}'); + + this.registerRoute('c.e', _emberRouting.Route.extend({ + actions: { + poke: function (actionContext) { + assert.ok(true, 'Unhandled action sent to route'); + assert.equal(actionContext, 'nested no controller'); + } + } + })); + this.registerTemplate('c.e', '{{foo-bar val=".e" poke="poke"}}'); + + return this.visit('/a').then(function () { + return component.sendAction('poke', 'top'); + }).then(function () { + _this10.assertText('a'); + return _this10.visit('/b'); + }).then(function () { + return component.sendAction('poke', 'top no controller'); + }).then(function () { + _this10.assertText('b'); + return _this10.visit('/c'); + }).then(function () { + return component.sendAction('poke', 'top with nested no controller'); + }).then(function () { + _this10.assertText('c'); + return _this10.visit('/c/d'); + }).then(function () { + return component.sendAction('poke', 'nested'); + }).then(function () { + _this10.assertText('c.d'); + return _this10.visit('/c/e'); + }).then(function () { + return component.sendAction('poke', 'nested no controller'); + }).then(function () { + return _this10.assertText('c.e'); + }); + }; + + _class2.prototype['@test sendAction should not trigger an action in an outlet\'s controller if a parent component handles it'] = function testSendActionShouldNotTriggerAnActionInAnOutletSControllerIfAParentComponentHandlesIt(assert) { + assert.expect(1); + + var component = undefined; + + this.registerComponent('x-parent', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + poke: function () { + assert.ok(true, 'parent component handled the aciton'); + } + } + }), + template: '{{x-child poke="poke"}}' + }); + + this.registerComponent('x-child', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + } + }) + }); + + this.registerTemplate('application', '{{x-parent}}'); + this.registerController('application', _emberRuntime.Controller.extend({ + send: function (actionName) { + throw new Error('controller action should not be called'); + } + })); + + return this.visit('/').then(function () { + return component.sendAction('poke'); + }); + }; + + return _class2; + })(_emberGlimmerTestsUtilsTestCase.ApplicationTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: sendAction of a closure action', (function (_RenderingTest2) { +babelHelpers.inherits(_class3, _RenderingTest2); + + function _class3() { +babelHelpers.classCallCheck(this, _class3); + + _RenderingTest2.apply(this, arguments); + } + + _class3.prototype['@test action should be called'] = function testActionShouldBeCalled(assert) { + assert.expect(1); + var component = undefined; + + this.registerComponent('inner-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + } + }), + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + outerSubmit: function () { + assert.ok(true, 'outerSubmit called'); + } + }), + template: '{{inner-component submitAction=(action outerSubmit)}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + return component.sendAction('submitAction'); + }); + }; + + _class3.prototype['@test contexts passed to sendAction are appended to the bound arguments on a closure action'] = function testContextsPassedToSendActionAreAppendedToTheBoundArgumentsOnAClosureAction() { + var first = 'mitch'; + var second = 'martin'; + var third = 'matt'; + var fourth = 'wacky wycats'; + + var innerComponent = undefined; + var actualArgs = undefined; + + this.registerComponent('inner-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + } + }), + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + third: third, + actions: { + outerSubmit: function () { + actualArgs = [].concat(babelHelpers.slice.call(arguments)); + } + } + }), + template: '{{inner-component innerSubmit=(action (action "outerSubmit" "' + first + '") "' + second + '" third)}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + return innerComponent.sendAction('innerSubmit', fourth); + }); + + this.assert.deepEqual(actualArgs, [first, second, third, fourth], 'action has the correct args'); + }; + + return _class3; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: send', (function (_RenderingTest3) { +babelHelpers.inherits(_class4, _RenderingTest3); + + function _class4() { +babelHelpers.classCallCheck(this, _class4); + + _RenderingTest3.apply(this, arguments); + } + + _class4.prototype['@test sending to undefined actions triggers an error'] = function testSendingToUndefinedActionsTriggersAnError(assert) { + assert.expect(2); + + var component = undefined; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + component = this; + }, + actions: { + foo: function (message) { + assert.equal('bar', message); + } + } + }) + }); + + this.render('{{foo-bar}}'); + + this.runTask(function () { + return component.send('foo', 'bar'); + }); + + expectAssertion(function () { + return component.send('baz', 'bar'); + }, /had no action handler for: baz/); + }; + + _class4.prototype['@test `send` will call send from a target if it is defined'] = function testSendWillCallSendFromATargetIfItIsDefined() { + var _this11 = this; + + var component = undefined; + var target = { + send: function (message, payload) { + _this11.assert.equal('foo', message); + _this11.assert.equal('baz', payload); + } + }; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + component = this; + }, + target: target + }) + }); + + this.render('{{foo-bar}}'); + + this.runTask(function () { + return component.send('foo', 'baz'); + }); + }; + + _class4.prototype['@test a handled action can be bubbled to the target for continued processing'] = function testAHandledActionCanBeBubbledToTheTargetForContinuedProcessing() { + var _this12 = this; + + this.assert.expect(2); + + var component = undefined; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + actions: { + poke: function () { + _this12.assert.ok(true, 'component action called'); + return true; + } + }, + target: _emberRuntime.Controller.extend({ + actions: { + poke: function () { + _this12.assert.ok(true, 'action bubbled to controller'); + } + } + }).create() + }) + }); + + this.render('{{foo-bar poke="poke"}}'); + + this.runTask(function () { + return component.send('poke'); + }); + }; + + _class4.prototype['@test action can be handled by a superclass\' actions object'] = function testActionCanBeHandledByASuperclassActionsObject(assert) { + this.assert.expect(4); + + var component = undefined; + + var SuperComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + foo: function () { + assert.ok(true, 'foo'); + }, + bar: function (msg) { + assert.equal(msg, 'HELLO'); + } + } + }); + + var BarViewMixin = _emberMetal.Mixin.create({ + actions: { + bar: function (msg) { + assert.equal(msg, 'HELLO'); + this._super(msg); + } + } + }); + + this.registerComponent('x-index', { + ComponentClass: SuperComponent.extend(BarViewMixin, { + init: function () { + this._super.apply(this, arguments); + component = this; + }, + actions: { + baz: function () { + assert.ok(true, 'baz'); + } + } + }) + }); + + this.render('{{x-index}}'); + + this.runTask(function () { + component.send('foo'); + component.send('bar', 'HELLO'); + component.send('baz'); + }); + }; + + _class4.prototype['@test actions cannot be provided at create time'] = function testActionsCannotBeProvidedAtCreateTime(assert) { + expectAssertion(function () { + return _emberGlimmerTestsUtilsHelpers.Component.create({ + actions: { + foo: function () { + assert.ok(true, 'foo'); + } + } + }); + }); + // but should be OK on an object that doesn't mix in Ember.ActionHandler + _emberRuntime.Object.create({ + actions: ['foo'] + }); + }; + + return _class4; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/components/target-action-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/target-action-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/target-action-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/target-action-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/target-action-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/target-action-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/utils-test', ['exports', 'ember-runtime', 'ember-views', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberRuntime, _emberViews, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('View tree tests', (function (_ApplicationTest) { + babelHelpers.inherits(_class, _ApplicationTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _ApplicationTest.call(this); + + this.registerComponent('x-tagless', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '' + }), + + template: '
[{{id}}] {{#if isShowing}}{{yield}}{{/if}}
' + }); + + this.registerComponent('x-toggle', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + isExpanded: true, + + click: function () { + this.toggleProperty('isExpanded'); + return false; + } + }), + + template: '[{{id}}] {{#if isExpanded}}{{yield}}{{/if}}' + }); + + var ToggleController = _emberRuntime.Controller.extend({ + isExpanded: true, + + actions: { + toggle: function () { + this.toggleProperty('isExpanded'); + } + } + }); + + this.registerController('application', ToggleController); + + this.registerTemplate('application', '\n {{x-tagless id="root-1"}}\n\n {{#x-toggle id="root-2"}}\n {{x-toggle id="inner-1"}}\n\n {{#x-toggle id="inner-2"}}\n {{x-toggle id="inner-3"}}\n {{/x-toggle}}\n {{/x-toggle}}\n\n \n\n {{#if isExpanded}}\n {{x-toggle id="root-3"}}\n {{/if}}\n\n {{outlet}}\n '); + + this.registerController('index', ToggleController.extend({ + isExpanded: false + })); + + this.registerTemplate('index', '\n {{x-tagless id="root-4"}}\n\n {{#x-toggle id="root-5" isExpanded=false}}\n {{x-toggle id="inner-4"}}\n\n {{#x-toggle id="inner-5"}}\n {{x-toggle id="inner-6"}}\n {{/x-toggle}}\n {{/x-toggle}}\n\n \n\n {{#if isExpanded}}\n {{x-toggle id="root-6"}}\n {{/if}}\n '); + + this.registerTemplate('zomg', '\n {{x-tagless id="root-7"}}\n\n {{#x-toggle id="root-8"}}\n {{x-toggle id="inner-7"}}\n\n {{#x-toggle id="inner-8"}}\n {{x-toggle id="inner-9"}}\n {{/x-toggle}}\n {{/x-toggle}}\n\n {{#x-toggle id="root-9"}}\n {{outlet}}\n {{/x-toggle}}\n '); + + this.registerTemplate('zomg.lol', '\n {{x-toggle id="inner-10"}}\n '); + + this.router.map(function () { + this.route('zomg', function () { + this.route('lol'); + }); + }); + } + + _class.prototype['@test getRootViews'] = function testGetRootViews(assert) { + var _this = this; + + return this.visit('/').then(function () { + _this.assertRootViews(['root-1', 'root-2', 'root-3', 'root-4', 'root-5']); + + _this.runTask(function () { + return _emberViews.jQuery('#toggle-application').click(); + }); + + _this.assertRootViews(['root-1', 'root-2', 'root-4', 'root-5']); + + _this.runTask(function () { + _emberViews.jQuery('#toggle-application').click(); + _emberViews.jQuery('#toggle-index').click(); + }); + + _this.assertRootViews(['root-1', 'root-2', 'root-3', 'root-4', 'root-5', 'root-6']); + + return _this.visit('/zomg/lol'); + }).then(function () { + _this.assertRootViews(['root-1', 'root-2', 'root-3', 'root-7', 'root-8', 'root-9']); + + return _this.visit('/'); + }).then(function () { + _this.assertRootViews(['root-1', 'root-2', 'root-3', 'root-4', 'root-5', 'root-6']); + }); + }; + + _class.prototype.assertRootViews = function assertRootViews(ids) { + var owner = this.applicationInstance; + + var actual = _emberViews.getRootViews(owner).map(function (view) { + return view.id; + }).sort(); + var expected = ids.sort(); + + this.assert.deepEqual(actual, expected, 'root views'); + }; + + _class.prototype['@test getChildViews'] = function testGetChildViews(assert) { + var _this2 = this; + + return this.visit('/').then(function () { + _this2.assertChildViews('root-2', ['inner-1', 'inner-2']); + _this2.assertChildViews('root-5', []); + _this2.assertChildViews('inner-2', ['inner-3']); + + _this2.runTask(function () { + return _emberViews.jQuery('#root-2').click(); + }); + + _this2.assertChildViews('root-2', []); + + _this2.runTask(function () { + return _emberViews.jQuery('#root-5').click(); + }); + + _this2.assertChildViews('root-5', ['inner-4', 'inner-5']); + _this2.assertChildViews('inner-5', ['inner-6']); + + return _this2.visit('/zomg'); + }).then(function () { + _this2.assertChildViews('root-2', []); + _this2.assertChildViews('root-8', ['inner-7', 'inner-8']); + _this2.assertChildViews('inner-8', ['inner-9']); + _this2.assertChildViews('root-9', []); + + _this2.runTask(function () { + return _emberViews.jQuery('#root-8').click(); + }); + + _this2.assertChildViews('root-8', []); + + return _this2.visit('/zomg/lol'); + }).then(function () { + _this2.assertChildViews('root-2', []); + _this2.assertChildViews('root-8', []); + _this2.assertChildViews('root-9', ['inner-10']); + + return _this2.visit('/'); + }).then(function () { + _this2.assertChildViews('root-2', []); + _this2.assertChildViews('root-5', []); + + _this2.runTask(function () { + return _emberViews.jQuery('#root-2').click(); + }); + _this2.runTask(function () { + return _emberViews.jQuery('#inner-2').click(); + }); + + _this2.assertChildViews('root-2', ['inner-1', 'inner-2']); + _this2.assertChildViews('inner-2', []); + }); + }; + + _class.prototype['@test getChildViews does not return duplicates'] = function testGetChildViewsDoesNotReturnDuplicates(assert) { + var _this3 = this; + + return this.visit('/').then(function () { + _this3.assertChildViews('root-2', ['inner-1', 'inner-2']); + + _this3.runTask(function () { + return _emberViews.jQuery('#root-2').click(); + }); + _this3.runTask(function () { + return _emberViews.jQuery('#root-2').click(); + }); + _this3.runTask(function () { + return _emberViews.jQuery('#root-2').click(); + }); + _this3.runTask(function () { + return _emberViews.jQuery('#root-2').click(); + }); + _this3.runTask(function () { + return _emberViews.jQuery('#root-2').click(); + }); + _this3.runTask(function () { + return _emberViews.jQuery('#root-2').click(); + }); + _this3.runTask(function () { + return _emberViews.jQuery('#root-2').click(); + }); + _this3.runTask(function () { + return _emberViews.jQuery('#root-2').click(); + }); + _this3.runTask(function () { + return _emberViews.jQuery('#root-2').click(); + }); + _this3.runTask(function () { + return _emberViews.jQuery('#root-2').click(); + }); + + _this3.assertChildViews('root-2', ['inner-1', 'inner-2']); + }); + }; + + _class.prototype.assertChildViews = function assertChildViews(parentId, childIds) { + var parentView = this.viewFor(parentId); + var childViews = _emberViews.getChildViews(parentView); + + var actual = childViews.map(function (view) { + return view.id; + }).sort(); + var expected = childIds.sort(); + + this.assert.deepEqual(actual, expected, 'child views for #' + parentId); + }; + + _class.prototype.viewFor = function viewFor(id) { + var owner = this.applicationInstance; + var registry = owner.lookup('-view-registry:main'); + return registry[id]; + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.ApplicationTest)); + + var hasGetClientRects = undefined, + hasGetBoundingClientRect = undefined; + var ClientRectListCtor = undefined, + ClientRectCtor = undefined; + + (function () { + if (document.createRange) { + var range = document.createRange(); + + if (range.getClientRects) { + var clientRectsList = range.getClientRects(); + hasGetClientRects = true; + ClientRectListCtor = clientRectsList && clientRectsList.constructor; + } + + if (range.getBoundingClientRect) { + var clientRect = range.getBoundingClientRect(); + hasGetBoundingClientRect = true; + ClientRectCtor = clientRect && clientRect.constructor; + } + } + })(); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Bounds tests', (function (_RenderingTest) { + babelHelpers.inherits(_class2, _RenderingTest); + + function _class2() { + babelHelpers.classCallCheck(this, _class2); + + _RenderingTest.apply(this, arguments); + } + + _class2.prototype['@test getViewBounds on a regular component'] = function testGetViewBoundsOnARegularComponent(assert) { + var component = undefined; + this.registerComponent('hi-mom', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + } + }), + template: '

Hi, mom!

' + }); + + this.render('{{hi-mom}}'); + + var _getViewBounds = _emberViews.getViewBounds(component); + + var parentElement = _getViewBounds.parentElement; + var firstNode = _getViewBounds.firstNode; + var lastNode = _getViewBounds.lastNode; + + assert.equal(parentElement, this.element, 'a regular component should have the right parentElement'); + assert.equal(firstNode, component.element, 'a regular component should have a single node that is its element'); + assert.equal(lastNode, component.element, 'a regular component should have a single node that is its element'); + }; + + _class2.prototype['@test getViewBounds on a tagless component'] = function testGetViewBoundsOnATaglessComponent(assert) { + var component = undefined; + this.registerComponent('hi-mom', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '', + init: function () { + this._super.apply(this, arguments); + component = this; + } + }), + template: 'Hi, mom!' + }); + + this.render('{{hi-mom}}'); + + var _getViewBounds2 = _emberViews.getViewBounds(component); + + var parentElement = _getViewBounds2.parentElement; + var firstNode = _getViewBounds2.firstNode; + var lastNode = _getViewBounds2.lastNode; + + assert.equal(parentElement, this.element, 'a tagless component should have the right parentElement'); + assert.equal(firstNode, this.$('#start-node')[0], 'a tagless component should have a range enclosing all of its nodes'); + assert.equal(lastNode, this.$('#before-end-node')[0].nextSibling, 'a tagless component should have a range enclosing all of its nodes'); + }; + + _class2.prototype['@test getViewClientRects'] = function testGetViewClientRects(assert) { + if (!hasGetClientRects || !ClientRectListCtor) { + assert.ok(true, 'The test environment does not support the DOM API required to run this test.'); + return; + } + + var component = undefined; + this.registerComponent('hi-mom', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + } + }), + template: '

Hi, mom!

' + }); + + this.render('{{hi-mom}}'); + + assert.ok(_emberViews.getViewClientRects(component) instanceof ClientRectListCtor); + }; + + _class2.prototype['@test getViewBoundingClientRect'] = function testGetViewBoundingClientRect(assert) { + if (!hasGetBoundingClientRect || !ClientRectCtor) { + assert.ok(true, 'The test environment does not support the DOM API required to run this test.'); + return; + } + + var component = undefined; + this.registerComponent('hi-mom', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + } + }), + template: '

Hi, mom!

' + }); + + this.render('{{hi-mom}}'); + + assert.ok(_emberViews.getViewBoundingClientRect(component) instanceof ClientRectCtor); + }; + + return _class2; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/components/utils-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/utils-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/utils-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/utils-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/utils-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/utils-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/web-component-fallback-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: web component fallback', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test custom elements are rendered'] = function testCustomElementsAreRendered() { + var template = 'hello'; + + this.render(template); + + this.assertHTML(template); + + this.assertStableRerender(); + }; + + _class.prototype['@test custom elements can have bound attributes'] = function testCustomElementsCanHaveBoundAttributes() { + var _this = this; + + var template = 'hello'; + + this.render(template, { name: 'Robert' }); + + this.assertHTML('hello'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'name', 'Kris'); + }); + + this.assertHTML('hello'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'name', 'Robert'); + }); + + this.assertHTML('hello'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/components/web-component-fallback-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/web-component-fallback-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/web-component-fallback-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/web-component-fallback-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/web-component-fallback-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/web-component-fallback-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/will-destroy-element-hook-test', ['exports', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/test-case'], function (exports, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsTestCase) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Component willDestroyElement hook', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test it calls willDestroyElement when removed by if'] = function testItCallsWillDestroyElementWhenRemovedByIf(assert) { + var _this = this; + + var didInsertElementCount = 0; + var willDestroyElementCount = 0; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + didInsertElementCount++; + assert.notEqual(this.element.parentNode, null, 'precond component is in DOM'); + }, + willDestroyElement: function () { + willDestroyElementCount++; + assert.notEqual(this.element.parentNode, null, 'has not been removed from DOM yet'); + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{#if switch}}{{foo-bar}}{{/if}}', { switch: true }); + + assert.equal(didInsertElementCount, 1, 'didInsertElement was called once'); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'switch', false); + }); + + assert.equal(willDestroyElementCount, 1, 'willDestroyElement was called once'); + + this.assertText(''); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/components/will-destroy-element-hook-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/will-destroy-element-hook-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/will-destroy-element-hook-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/will-destroy-element-hook-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/will-destroy-element-hook-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/will-destroy-element-hook-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/content-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/test-helpers', 'ember-views', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberMetal, _emberRuntime, _emberGlimmerTestsUtilsTestHelpers, _emberViews, _emberGlimmerTestsUtilsHelpers) { + /* globals EmberDev */ + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Static content tests', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test it can render a static text node'] = function testItCanRenderAStaticTextNode() { + var _this = this; + + this.render('hello'); + var text1 = this.assertTextNode(this.firstChild, 'hello'); + + this.runTask(function () { + return _this.rerender(); + }); + + var text2 = this.assertTextNode(this.firstChild, 'hello'); + + this.assertSameNode(text1, text2); + }; + + _class.prototype['@test it can render a static element'] = function testItCanRenderAStaticElement() { + var _this2 = this; + + this.render('

hello

'); + var p1 = this.assertElement(this.firstChild, { tagName: 'p' }); + var text1 = this.assertTextNode(this.firstChild.firstChild, 'hello'); + + this.runTask(function () { + return _this2.rerender(); + }); + + var p2 = this.assertElement(this.firstChild, { tagName: 'p' }); + var text2 = this.assertTextNode(this.firstChild.firstChild, 'hello'); + + this.assertSameNode(p1, p2); + this.assertSameNode(text1, text2); + }; + + _class.prototype['@test it can render a static template'] = function testItCanRenderAStaticTemplate() { + var _this3 = this; + + var template = '\n
\n

Welcome to Ember.js

\n
\n
\n

Why you should use Ember.js?

\n
    \n
  1. It\'s great
  2. \n
  3. It\'s awesome
  4. \n
  5. It\'s Ember.js
  6. \n
\n
\n \n '; + + this.render(template); + this.assertHTML(template); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertHTML(template); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + var DynamicContentTest = (function (_RenderingTest2) { + babelHelpers.inherits(DynamicContentTest, _RenderingTest2); + + function DynamicContentTest() { + babelHelpers.classCallCheck(this, DynamicContentTest); + + _RenderingTest2.apply(this, arguments); + } + + /* abstract */ + + DynamicContentTest.prototype.renderPath = function renderPath(path) { + var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + throw new Error('Not implemented: `renderValues`'); + }; + + DynamicContentTest.prototype.assertIsEmpty = function assertIsEmpty() { + this.assert.strictEqual(this.firstChild, null); + }; + + /* abstract */ + + DynamicContentTest.prototype.assertContent = function assertContent(content) { + throw new Error('Not implemented: `assertContent`'); + }; + + DynamicContentTest.prototype['@test it can render a dynamic path'] = function testItCanRenderADynamicPath() { + var _this4 = this; + + this.renderPath('message', { message: 'hello' }); + + this.assertContent('hello'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'message', 'goodbye'); + }); + + this.assertContent('goodbye'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'message', 'hello'); + }); + + this.assertContent('hello'); + this.assertInvariants(); + }; + + DynamicContentTest.prototype['@test resolves the string length properly'] = function testResolvesTheStringLengthProperly() { + var _this5 = this; + + this.render('

{{foo.length}}

', { foo: undefined }); + + this.assertHTML('

'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'foo', 'foo'); + }); + + this.assertHTML('

3

'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'foo', ''); + }); + + this.assertHTML('

0

'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'foo', undefined); + }); + + this.assertHTML('

'); + }; + + DynamicContentTest.prototype['@test resolves the array length properly'] = function testResolvesTheArrayLengthProperly() { + var _this6 = this; + + this.render('

{{foo.length}}

', { foo: undefined }); + + this.assertHTML('

'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'foo', [1, 2, 3]); + }); + + this.assertHTML('

3

'); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'foo', []); + }); + + this.assertHTML('

0

'); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'foo', undefined); + }); + + this.assertHTML('

'); + }; + + DynamicContentTest.prototype['@test it can render a capitalized path with no deprecation'] = function testItCanRenderACapitalizedPathWithNoDeprecation() { + var _this7 = this; + + expectNoDeprecation(); + + this.renderPath('CaptializedPath', { CaptializedPath: 'no deprecation' }); + + this.assertContent('no deprecation'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'CaptializedPath', 'still no deprecation'); + }); + + this.assertContent('still no deprecation'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'CaptializedPath', 'no deprecation'); + }); + + this.assertContent('no deprecation'); + this.assertInvariants(); + }; + + DynamicContentTest.prototype['@test it can render undefined dynamic paths'] = function testItCanRenderUndefinedDynamicPaths() { + var _this8 = this; + + this.renderPath('name', {}); + + this.assertIsEmpty(); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this8.context, 'name', 'foo-bar'); + }); + + this.assertContent('foo-bar'); + + this.runTask(function () { + return _emberMetal.set(_this8.context, 'name', undefined); + }); + + this.assertIsEmpty(); + }; + + DynamicContentTest.prototype['@test it can render a deeply nested dynamic path'] = function testItCanRenderADeeplyNestedDynamicPath() { + var _this9 = this; + + this.renderPath('a.b.c.d.e.f', { + a: { b: { c: { d: { e: { f: 'hello' } } } } } + }); + + this.assertContent('hello'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'a.b.c.d.e.f', 'goodbye'); + }); + + this.assertContent('goodbye'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'a.b.c.d', { e: { f: 'aloha' } }); + }); + + this.assertContent('aloha'); + this.assertInvariants(); + + this.runTask(function () { + _emberMetal.set(_this9.context, 'a', { b: { c: { d: { e: { f: 'hello' } } } } }); + }); + + this.assertContent('hello'); + this.assertInvariants(); + }; + + DynamicContentTest.prototype['@test it can render a computed property'] = function testItCanRenderAComputedProperty() { + var _this10 = this; + + var Formatter = _emberRuntime.Object.extend({ + formattedMessage: _emberMetal.computed('message', function () { + return this.get('message').toUpperCase(); + }) + }); + + var m = Formatter.create({ message: 'hello' }); + + this.renderPath('m.formattedMessage', { m: m }); + + this.assertContent('HELLO'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(m, 'message', 'goodbye'); + }); + + this.assertContent('GOODBYE'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this10.context, 'm', Formatter.create({ message: 'hello' })); + }); + + this.assertContent('HELLO'); + this.assertInvariants(); + }; + + DynamicContentTest.prototype['@test it can render a computed property with nested dependency'] = function testItCanRenderAComputedPropertyWithNestedDependency() { + var _this11 = this; + + var Formatter = _emberRuntime.Object.extend({ + formattedMessage: _emberMetal.computed('messenger.message', function () { + return this.get('messenger.message').toUpperCase(); + }) + }); + + var m = Formatter.create({ messenger: { message: 'hello' } }); + + this.renderPath('m.formattedMessage', { m: m }); + + this.assertContent('HELLO'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(m, 'messenger.message', 'goodbye'); + }); + + this.assertContent('GOODBYE'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'm', Formatter.create({ messenger: { message: 'hello' } })); + }); + + this.assertContent('HELLO'); + this.assertInvariants(); + }; + + DynamicContentTest.prototype['@test it can read from a proxy object'] = function testItCanReadFromAProxyObject() { + var _this12 = this; + + this.renderPath('proxy.name', { proxy: _emberRuntime.ObjectProxy.create({ content: { name: 'Tom Dale' } }) }); + + this.assertContent('Tom Dale'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'proxy.content.name', 'Yehuda Katz'); + }); + + this.assertContent('Yehuda Katz'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'proxy.content', { name: 'Godfrey Chan' }); + }); + + this.assertContent('Godfrey Chan'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'proxy.name', 'Stefan Penner'); + }); + + this.assertContent('Stefan Penner'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'proxy.content', null); + }); + + this.assertIsEmpty(); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'proxy', _emberRuntime.ObjectProxy.create({ content: { name: 'Tom Dale' } })); + }); + + this.assertContent('Tom Dale'); + this.assertInvariants(); + }; + + DynamicContentTest.prototype['@test it can read from a nested path in a proxy object'] = function testItCanReadFromANestedPathInAProxyObject() { + var _this13 = this; + + this.renderPath('proxy.name.last', { proxy: _emberRuntime.ObjectProxy.create({ content: { name: { first: 'Tom', last: 'Dale' } } }) }); + + this.assertContent('Dale'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'proxy.content.name.last', 'Cruise'); + }); + + this.assertContent('Cruise'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'proxy.content.name.first', 'Suri'); + }); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'proxy.content.name', { first: 'Yehuda', last: 'Katz' }); + }); + + this.assertContent('Katz'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'proxy.content', { name: { first: 'Godfrey', last: 'Chan' } }); + }); + + this.assertContent('Chan'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'proxy.name', { first: 'Stefan', last: 'Penner' }); + }); + + this.assertContent('Penner'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'proxy', null); + }); + + this.assertIsEmpty(); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'proxy', _emberRuntime.ObjectProxy.create({ content: { name: { first: 'Tom', last: 'Dale' } } })); + }); + + this.assertContent('Dale'); + this.assertInvariants(); + }; + + DynamicContentTest.prototype['@test it can read from a path flipping between a proxy and a real object'] = function testItCanReadFromAPathFlippingBetweenAProxyAndARealObject() { + var _this14 = this; + + this.renderPath('proxyOrObject.name.last', { proxyOrObject: _emberRuntime.ObjectProxy.create({ content: { name: { first: 'Tom', last: 'Dale' } } }) }); + + this.assertContent('Dale'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'proxyOrObject', { name: { first: 'Tom', last: 'Dale' } }); + }); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'proxyOrObject.name.last', 'Cruise'); + }); + + this.assertContent('Cruise'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'proxyOrObject.name.first', 'Suri'); + }); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'proxyOrObject', { name: { first: 'Yehuda', last: 'Katz' } }); + }); + + this.assertContent('Katz'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'proxyOrObject', _emberRuntime.ObjectProxy.create({ content: { name: { first: 'Godfrey', last: 'Chan' } } })); + }); + + this.assertContent('Chan'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'proxyOrObject.content.name', { first: 'Stefan', last: 'Penner' }); + }); + + this.assertContent('Penner'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'proxyOrObject', null); + }); + + this.assertIsEmpty(); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'proxyOrObject', _emberRuntime.ObjectProxy.create({ content: { name: { first: 'Tom', last: 'Dale' } } })); + }); + + this.assertContent('Dale'); + this.assertInvariants(); + }; + + DynamicContentTest.prototype['@test it can read from a path flipping between a real object and a proxy'] = function testItCanReadFromAPathFlippingBetweenARealObjectAndAProxy() { + var _this15 = this; + + this.renderPath('objectOrProxy.name.last', { objectOrProxy: { name: { first: 'Tom', last: 'Dale' } } }); + + this.assertContent('Dale'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'objectOrProxy', _emberRuntime.ObjectProxy.create({ content: { name: { first: 'Tom', last: 'Dale' } } })); + }); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'objectOrProxy.content.name.last', 'Cruise'); + }); + + this.assertContent('Cruise'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'objectOrProxy.content.name.first', 'Suri'); + }); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'objectOrProxy.content', { name: { first: 'Yehuda', last: 'Katz' } }); + }); + + this.assertContent('Katz'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'objectOrProxy', { name: { first: 'Godfrey', last: 'Chan' } }); + }); + + this.assertContent('Chan'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'objectOrProxy.name', { first: 'Stefan', last: 'Penner' }); + }); + + this.assertContent('Penner'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'objectOrProxy', null); + }); + + this.assertIsEmpty(); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'objectOrProxy', { name: { first: 'Tom', last: 'Dale' } }); + }); + + this.assertContent('Dale'); + this.assertInvariants(); + }; + + DynamicContentTest.prototype['@test it can read from a null object'] = function testItCanReadFromANullObject() { + var _this16 = this; + + var nullObject = Object.create(null); + nullObject['message'] = 'hello'; + + this.renderPath('nullObject.message', { nullObject: nullObject }); + + this.assertContent('hello'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(nullObject, 'message', 'goodbye'); + }); + + this.assertContent('goodbye'); + this.assertInvariants(); + + nullObject = Object.create(null); + nullObject['message'] = 'hello'; + + this.runTask(function () { + return _emberMetal.set(_this16.context, 'nullObject', nullObject); + }); + + this.assertContent('hello'); + this.assertInvariants(); + }; + + DynamicContentTest.prototype['@test it can render a readOnly property of a path'] = function testItCanRenderAReadOnlyPropertyOfAPath() { + var _this17 = this; + + var Messenger = _emberRuntime.Object.extend({ + message: _emberMetal.computed.readOnly('a.b.c') + }); + + var messenger = Messenger.create({ + a: { + b: { + c: 'hello' + } + } + }); + + this.renderPath('messenger.message', { messenger: messenger }); + + this.assertContent('hello'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(messenger, 'a.b.c', 'hi'); + }); + + this.assertContent('hi'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this17.context, 'messenger.a.b', { + c: 'goodbye' + }); + }); + + this.assertContent('goodbye'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this17.context, 'messenger', { + message: 'hello' + }); + }); + + this.assertContent('hello'); + this.assertInvariants(); + }; + + return DynamicContentTest; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest); + + var EMPTY = {}; + + var ContentTestGenerator = (function () { + function ContentTestGenerator(cases) { + var tag = arguments.length <= 1 || arguments[1] === undefined ? '@test' : arguments[1]; + babelHelpers.classCallCheck(this, ContentTestGenerator); + + this.cases = cases; + this.tag = tag; + } + + ContentTestGenerator.prototype.generate = function generate(_ref3) { + var value = _ref3[0]; + var expected = _ref3[1]; + var label = _ref3[2]; + + var tag = this.tag; + label = label || value; + + if (expected === EMPTY) { + var _ref; + + return _ref = {}, _ref[tag + ' rendering ' + label] = function () { + var _this18 = this; + + this.renderPath('value', { value: value }); + + this.assertIsEmpty(); + + this.runTask(function () { + return _emberMetal.set(_this18.context, 'value', 'hello'); + }); + + this.assertContent('hello'); + + this.runTask(function () { + return _emberMetal.set(_this18.context, 'value', value); + }); + + this.assertIsEmpty(); + }, _ref; + } else { + var _ref2; + + return _ref2 = {}, _ref2[tag + ' rendering ' + label] = function () { + var _this19 = this; + + this.renderPath('value', { value: value }); + + this.assertContent(expected); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this19.context, 'value', 'hello'); + }); + + this.assertContent('hello'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this19.context, 'value', value); + }); + + this.assertContent(expected); + this.assertInvariants(); + }, _ref2; + } + }; + + return ContentTestGenerator; + })(); + + var SharedContentTestCases = new ContentTestGenerator([['foo', 'foo'], [0, '0'], [-0, '0', '-0'], [1, '1'], [-1, '-1'], [0.0, '0', '0.0'], [0.5, '0.5'], [undefined, EMPTY], [null, EMPTY], [true, 'true'], [false, 'false'], [NaN, 'NaN'], [new Date(2000, 0, 1), String(new Date(2000, 0, 1)), 'a Date object'], [Infinity, 'Infinity'], [1 / -0, '-Infinity'], [{ foo: 'bar' }, '[object Object]', '{ foo: \'bar\' }'], [{ toString: function () { + return 'foo'; + } }, 'foo', 'an object with a custom toString function'], [{ valueOf: function () { + return 1; + } }, '[object Object]', 'an object with a custom valueOf function'], + + // Escaping tests + ['MaxJames', 'MaxJames']]); + + var GlimmerContentTestCases = new ContentTestGenerator([[Object.create(null), EMPTY, 'an object with no toString']]); + + if (typeof Symbol !== 'undefined') { + GlimmerContentTestCases.cases.push([Symbol('debug'), 'Symbol(debug)', 'a symbol']); + } + + _emberGlimmerTestsUtilsAbstractTestCase.applyMixins(DynamicContentTest, SharedContentTestCases, GlimmerContentTestCases); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Dynamic content tests (content position)', (function (_DynamicContentTest) { + babelHelpers.inherits(_class2, _DynamicContentTest); + + function _class2() { + babelHelpers.classCallCheck(this, _class2); + + _DynamicContentTest.apply(this, arguments); + } + + _class2.prototype.renderPath = function renderPath(path) { + var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + this.render('{{' + path + '}}', context); + }; + + _class2.prototype.assertContent = function assertContent(content) { + this.assert.strictEqual(this.nodesCount, 1, 'It should render exactly one text node'); + this.assertTextNode(this.firstChild, content); + }; + + return _class2; + })(DynamicContentTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Dynamic content tests (content concat)', (function (_DynamicContentTest2) { + babelHelpers.inherits(_class3, _DynamicContentTest2); + + function _class3() { + babelHelpers.classCallCheck(this, _class3); + + _DynamicContentTest2.apply(this, arguments); + } + + _class3.prototype.renderPath = function renderPath(path) { + var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + this.render('{{concat "" ' + path + ' ""}}', context); + }; + + _class3.prototype.assertContent = function assertContent(content) { + this.assert.strictEqual(this.nodesCount, 1, 'It should render exactly one text node'); + this.assertTextNode(this.firstChild, content); + }; + + return _class3; + })(DynamicContentTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Dynamic content tests (inside an element)', (function (_DynamicContentTest3) { + babelHelpers.inherits(_class4, _DynamicContentTest3); + + function _class4() { + babelHelpers.classCallCheck(this, _class4); + + _DynamicContentTest3.apply(this, arguments); + } + + _class4.prototype.renderPath = function renderPath(path) { + var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + this.render('

{{' + path + '}}

', context); + }; + + _class4.prototype.assertIsEmpty = function assertIsEmpty() { + this.assert.strictEqual(this.nodesCount, 1, 'It should render exactly one

tag'); + this.assertElement(this.firstChild, { tagName: 'p' }); + this.assertText(''); + }; + + _class4.prototype.assertContent = function assertContent(content) { + this.assert.strictEqual(this.nodesCount, 1, 'It should render exactly one

tag'); + this.assertElement(this.firstChild, { tagName: 'p' }); + this.assertText(content); + }; + + return _class4; + })(DynamicContentTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Dynamic content tests (attribute position)', (function (_DynamicContentTest4) { + babelHelpers.inherits(_class5, _DynamicContentTest4); + + function _class5() { + babelHelpers.classCallCheck(this, _class5); + + _DynamicContentTest4.apply(this, arguments); + } + + _class5.prototype.renderPath = function renderPath(path) { + var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + this.render('

', context); + }; + + _class5.prototype.assertIsEmpty = function assertIsEmpty() { + this.assert.strictEqual(this.nodesCount, 1, 'It should render exactly one
tag'); + this.assertElement(this.firstChild, { tagName: 'div', content: '' }); + }; + + _class5.prototype.assertContent = function assertContent(content) { + this.assert.strictEqual(this.nodesCount, 1, 'It should render exactly one
tag'); + this.assertElement(this.firstChild, { tagName: 'div', attrs: { 'data-foo': content }, content: '' }); + }; + + return _class5; + })(DynamicContentTest)); + + var TrustedContentTest = (function (_DynamicContentTest5) { + babelHelpers.inherits(TrustedContentTest, _DynamicContentTest5); + + function TrustedContentTest() { + babelHelpers.classCallCheck(this, TrustedContentTest); + + _DynamicContentTest5.apply(this, arguments); + } + + TrustedContentTest.prototype.assertIsEmpty = function assertIsEmpty() { + this.assert.strictEqual(this.firstChild, null); + }; + + TrustedContentTest.prototype.assertContent = function assertContent(content) { + this.assertHTML(content); + }; + + TrustedContentTest.prototype.assertStableRerender = function assertStableRerender() { + var _this20 = this; + + this.takeSnapshot(); + this.runTask(function () { + return _this20.rerender(); + }); + _DynamicContentTest5.prototype.assertInvariants.call(this); + }; + + TrustedContentTest.prototype.assertInvariants = function assertInvariants() { + // If it's not stable, we will wipe out all the content and replace them, + // so there are no invariants + }; + + return TrustedContentTest; + })(DynamicContentTest); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Dynamic content tests (trusted)', (function (_TrustedContentTest) { + babelHelpers.inherits(_class6, _TrustedContentTest); + + function _class6() { + babelHelpers.classCallCheck(this, _class6); + + _TrustedContentTest.apply(this, arguments); + } + + _class6.prototype.renderPath = function renderPath(path) { + var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + this.render('{{{' + path + '}}}', context); + }; + + _class6.prototype['@test updating trusted curlies'] = function testUpdatingTrustedCurlies() { + var _this21 = this; + + this.render('{{{htmlContent}}}{{{nested.htmlContent}}}', { + htmlContent: 'Max', + nested: { htmlContent: 'James' } + }); + + this.assertContent('MaxJames'); + + this.runTask(function () { + return _this21.rerender(); + }); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this21.context, 'htmlContent', 'Max'); + }); + + this.assertContent('MaxJames'); + + this.runTask(function () { + return _emberMetal.set(_this21.context, 'nested.htmlContent', 'Jammie'); + }); + + this.assertContent('MaxJammie'); + + this.runTask(function () { + _emberMetal.set(_this21.context, 'htmlContent', 'Max'); + _emberMetal.set(_this21.context, 'nested', { htmlContent: 'James' }); + }); + + this.assertContent('MaxJames'); + }; + + return _class6; + })(TrustedContentTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Dynamic content tests (integration)', (function (_RenderingTest3) { + babelHelpers.inherits(_class7, _RenderingTest3); + + function _class7() { + babelHelpers.classCallCheck(this, _class7); + + _RenderingTest3.apply(this, arguments); + } + + _class7.prototype['@test it can render a dynamic template'] = function testItCanRenderADynamicTemplate() { + var _this22 = this; + + var template = '\n
\n

Welcome to {{framework}}

\n
\n
\n

Why you should use {{framework}}?

\n
    \n
  1. It\'s great
  2. \n
  3. It\'s awesome
  4. \n
  5. It\'s {{framework}}
  6. \n
\n
\n \n '; + + var ember = '\n
\n

Welcome to Ember.js

\n
\n
\n

Why you should use Ember.js?

\n
    \n
  1. It\'s great
  2. \n
  3. It\'s awesome
  4. \n
  5. It\'s Ember.js
  6. \n
\n
\n \n '; + + var react = '\n
\n

Welcome to React

\n
\n
\n

Why you should use React?

\n
    \n
  1. It\'s great
  2. \n
  3. It\'s awesome
  4. \n
  5. It\'s React
  6. \n
\n
\n \n '; + + this.render(template, { + framework: 'Ember.js' + }); + this.assertHTML(ember); + + this.runTask(function () { + return _this22.rerender(); + }); + + this.assertHTML(ember); + + this.runTask(function () { + return _emberMetal.set(_this22.context, 'framework', 'React'); + }); + + this.assertHTML(react); + + this.runTask(function () { + return _emberMetal.set(_this22.context, 'framework', 'Ember.js'); + }); + + this.assertHTML(ember); + }; + + _class7.prototype['@test it should evaluate to nothing if part of the path is `undefined`'] = function testItShouldEvaluateToNothingIfPartOfThePathIsUndefined() { + var _this23 = this; + + this.render('{{foo.bar.baz.bizz}}', { + foo: {} + }); + + this.assertText(''); + + this.runTask(function () { + return _this23.rerender(); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this23.context, 'foo', { + bar: { baz: { bizz: 'Hey!' } } + }); + }); + + this.assertText('Hey!'); + + this.runTask(function () { + return _emberMetal.set(_this23.context, 'foo', {}); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this23.context, 'foo', { + bar: { baz: { bizz: 'Hello!' } } + }); + }); + + this.assertText('Hello!'); + + this.runTask(function () { + return _emberMetal.set(_this23.context, 'foo', {}); + }); + + this.assertText(''); + }; + + _class7.prototype['@test it should evaluate to nothing if part of the path is a primative'] = function testItShouldEvaluateToNothingIfPartOfThePathIsAPrimative() { + var _this24 = this; + + this.render('{{foo.bar.baz.bizz}}', { + foo: { bar: true } + }); + + this.assertText(''); + + this.runTask(function () { + return _this24.rerender(); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this24.context, 'foo', { + bar: false + }); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this24.context, 'foo', { + bar: 'Haha' + }); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this24.context, 'foo', { + bar: null + }); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this24.context, 'foo', { + bar: undefined + }); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this24.context, 'foo', { + bar: 1 + }); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this24.context, 'foo', { + bar: { baz: { bizz: 'Hello!' } } + }); + }); + + this.assertText('Hello!'); + + this.runTask(function () { + return _emberMetal.set(_this24.context, 'foo', { + bar: true + }); + }); + + this.assertText(''); + }; + + _class7.prototype['@test can set dynamic href'] = function testCanSetDynamicHref() { + var _this25 = this; + + this.render('Example', { + model: { + url: 'http://example.com' + } + }); + + this.assertElement(this.firstChild, { tagName: 'a', content: 'Example', attrs: { 'href': 'http://example.com' } }); + + this.runTask(function () { + return _this25.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'a', content: 'Example', attrs: { 'href': 'http://example.com' } }); + + this.runTask(function () { + return _emberMetal.set(_this25.context, 'model.url', 'http://linkedin.com'); + }); + + this.assertElement(this.firstChild, { tagName: 'a', content: 'Example', attrs: { 'href': 'http://linkedin.com' } }); + + this.runTask(function () { + return _emberMetal.set(_this25.context, 'model', { url: 'http://example.com' }); + }); + + this.assertElement(this.firstChild, { tagName: 'a', content: 'Example', attrs: { 'href': 'http://example.com' } }); + }; + + _class7.prototype['@test quoteless class attributes update correctly'] = function testQuotelessClassAttributesUpdateCorrectly() { + var _this26 = this; + + this.render('
hello
', { + fooBar: true + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo-bar') } }); + + this.runTask(function () { + return _this26.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo-bar') } }); + + this.runTask(function () { + return _emberMetal.set(_this26.context, 'fooBar', false); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this26.context, 'fooBar', true); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo-bar') } }); + }; + + _class7.prototype['@test quoted class attributes update correctly'] = function testQuotedClassAttributesUpdateCorrectly(assert) { + var _this27 = this; + + this.render('
hello
', { + fooBar: true + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo-bar') } }); + + this.runTask(function () { + return _this27.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo-bar') } }); + + this.runTask(function () { + return _emberMetal.set(_this27.context, 'fooBar', false); + }); + + assert.equal(this.firstChild.className, ''); + + this.runTask(function () { + return _emberMetal.set(_this27.context, 'fooBar', true); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo-bar') } }); + }; + + _class7.prototype['@test unquoted class attribute can contain multiple classes'] = function testUnquotedClassAttributeCanContainMultipleClasses() { + var _this28 = this; + + this.render('
hello
', { + model: { + classes: 'foo bar baz' + } + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo bar baz') } }); + + this.runTask(function () { + return _this28.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo bar baz') } }); + + this.runTask(function () { + return _emberMetal.set(_this28.context, 'model.classes', 'fizz bizz'); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('fizz bizz') } }); + + this.runTask(function () { + return _emberMetal.set(_this28.context, 'model', { classes: 'foo bar baz' }); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo bar baz') } }); + }; + + _class7.prototype['@test unquoted class attribute'] = function testUnquotedClassAttribute() { + var _this29 = this; + + this.render('
hello
', { + model: { + foo: 'foo' + } + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo') } }); + + this.runTask(function () { + return _this29.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo') } }); + + this.runTask(function () { + return _emberMetal.set(_this29.context, 'model.foo', 'fizz'); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('fizz') } }); + + this.runTask(function () { + return _emberMetal.set(_this29.context, 'model', { foo: 'foo' }); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo') } }); + }; + + _class7.prototype['@test quoted class attribute'] = function testQuotedClassAttribute() { + var _this30 = this; + + this.render('
hello
', { + model: { + foo: 'foo' + } + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo') } }); + + this.runTask(function () { + return _this30.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo') } }); + + this.runTask(function () { + return _emberMetal.set(_this30.context, 'model.foo', 'fizz'); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('fizz') } }); + + this.runTask(function () { + return _emberMetal.set(_this30.context, 'model', { foo: 'foo' }); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo') } }); + }; + + _class7.prototype['@test quoted class attribute can contain multiple classes'] = function testQuotedClassAttributeCanContainMultipleClasses() { + var _this31 = this; + + this.render('
hello
', { + model: { + classes: 'foo bar baz' + } + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo bar baz') } }); + + this.runTask(function () { + return _this31.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo bar baz') } }); + + this.runTask(function () { + return _emberMetal.set(_this31.context, 'model.classes', 'fizz bizz'); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('fizz bizz') } }); + + this.runTask(function () { + return _emberMetal.set(_this31.context, 'model', { classes: 'foo bar baz' }); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo bar baz') } }); + }; + + _class7.prototype['@test class attribute concats bound values'] = function testClassAttributeConcatsBoundValues() { + var _this32 = this; + + this.render('
hello
', { + model: { + foo: 'foo', + bar: 'bar', + bizz: 'bizz' + } + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo bar bizz') } }); + + this.runTask(function () { + return _this32.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo bar bizz') } }); + + this.runTask(function () { + return _emberMetal.set(_this32.context, 'model.foo', 'fizz'); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('fizz bar bizz') } }); + + this.runTask(function () { + return _emberMetal.set(_this32.context, 'model.bar', null); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('fizz bizz') } }); + + this.runTask(function () { + return _emberMetal.set(_this32.context, 'model', { + foo: 'foo', + bar: 'bar', + bizz: 'bizz' + }); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo bar bizz') } }); + }; + + _class7.prototype['@test class attribute accepts nested helpers, and updates'] = function testClassAttributeAcceptsNestedHelpersAndUpdates() { + var _this33 = this; + + this.render('
hello
', { + model: { + size: 'large', + hasSize: true, + hasShape: false, + shape: 'round' + } + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('large') } }); + + this.runTask(function () { + return _this33.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('large') } }); + + this.runTask(function () { + return _emberMetal.set(_this33.context, 'model.hasShape', true); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('large round') } }); + + this.runTask(function () { + return _emberMetal.set(_this33.context, 'model.hasSize', false); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('round') } }); + + this.runTask(function () { + return _emberMetal.set(_this33.context, 'model', { + size: 'large', + hasSize: true, + hasShape: false, + shape: 'round' + }); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('large') } }); + }; + + _class7.prototype['@test Multiple dynamic classes'] = function testMultipleDynamicClasses() { + var _this34 = this; + + this.render('
hello
', { + model: { + foo: 'foo', + bar: 'bar', + fizz: 'fizz', + baz: 'baz' + } + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo bar fizz baz') } }); + + this.runTask(function () { + return _this34.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo bar fizz baz') } }); + + this.runTask(function () { + _emberMetal.set(_this34.context, 'model.foo', null); + _emberMetal.set(_this34.context, 'model.fizz', null); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('bar baz') } }); + + this.runTask(function () { + _emberMetal.set(_this34.context, 'model', { + foo: 'foo', + bar: 'bar', + fizz: 'fizz', + baz: 'baz' + }); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo bar fizz baz') } }); + }; + + _class7.prototype['@test classes are ordered: See issue #9912'] = function testClassesAreOrderedSeeIssue9912() { + var _this35 = this; + + this.render('
hello
', { + model: { + foo: 'foo', + bar: 'bar' + } + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': 'foo static bar' } }); + + this.runTask(function () { + return _this35.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': 'foo static bar' } }); + + this.runTask(function () { + _emberMetal.set(_this35.context, 'model.bar', null); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': 'foo static ' } }); + + this.runTask(function () { + _emberMetal.set(_this35.context, 'model', { + foo: 'foo', + bar: 'bar' + }); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': 'foo static bar' } }); + }; + + return _class7; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + var warnings = undefined, + originalWarn = undefined; + + var StyleTest = (function (_RenderingTest4) { + babelHelpers.inherits(StyleTest, _RenderingTest4); + + function StyleTest() { + babelHelpers.classCallCheck(this, StyleTest); + + _RenderingTest4.apply(this, arguments); + warnings = []; + originalWarn = _emberMetal.getDebugFunction('warn'); + _emberMetal.setDebugFunction('warn', function (message, test) { + if (!test) { + warnings.push(message); + } + }); + } + + StyleTest.prototype.teardown = function teardown() { + var _RenderingTest4$prototype$teardown; + + (_RenderingTest4$prototype$teardown = _RenderingTest4.prototype.teardown).call.apply(_RenderingTest4$prototype$teardown, [this].concat(babelHelpers.slice.call(arguments))); + _emberMetal.setDebugFunction('warn', originalWarn); + }; + + StyleTest.prototype.assertStyleWarning = function assertStyleWarning() { + this.assert.deepEqual(warnings, [_emberViews.STYLE_WARNING]); + }; + + StyleTest.prototype.assertNoWarning = function assertNoWarning() { + this.assert.deepEqual(warnings, []); + }; + + return StyleTest; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Inline style tests', (function (_StyleTest) { + babelHelpers.inherits(_class8, _StyleTest); + + function _class8() { + babelHelpers.classCallCheck(this, _class8); + + _StyleTest.apply(this, arguments); + } + + _class8.prototype['@test can set dynamic style'] = function testCanSetDynamicStyle() { + var _this36 = this; + + this.render('
', { + model: { + style: 'width: 60px;' + } + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: '', attrs: { 'style': 'width: 60px;' } }); + + this.runTask(function () { + return _this36.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: '', attrs: { 'style': 'width: 60px;' } }); + + this.runTask(function () { + return _emberMetal.set(_this36.context, 'model.style', 'height: 60px;'); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: '', attrs: { 'style': 'height: 60px;' } }); + + this.runTask(function () { + return _emberMetal.set(_this36.context, 'model.style', null); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: '', attrs: {} }); + + this.runTask(function () { + return _emberMetal.set(_this36.context, 'model', { style: 'width: 60px;' }); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: '', attrs: { 'style': 'width: 60px;' } }); + }; + + _class8.prototype['@test can set dynamic style with -html-safe'] = function testCanSetDynamicStyleWithHtmlSafe() { + var _this37 = this; + + this.render('
', { + model: { + style: 'width: 60px;' + } + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: '', attrs: { 'style': 'width: 60px;' } }); + + this.runTask(function () { + return _this37.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: '', attrs: { 'style': 'width: 60px;' } }); + + this.runTask(function () { + return _emberMetal.set(_this37.context, 'model.style', 'height: 60px;'); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: '', attrs: { 'style': 'height: 60px;' } }); + + this.runTask(function () { + return _emberMetal.set(_this37.context, 'model', { style: 'width: 60px;' }); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: '', attrs: { 'style': 'width: 60px;' } }); + }; + + return _class8; + })(StyleTest)); + + if (!EmberDev.runningProdBuild) { + _emberGlimmerTestsUtilsTestCase.moduleFor('Inline style tests - warnings', (function (_StyleTest2) { + babelHelpers.inherits(_class9, _StyleTest2); + + function _class9() { + babelHelpers.classCallCheck(this, _class9); + + _StyleTest2.apply(this, arguments); + } + + _class9.prototype['@test specifying
generates a warning'] = function testSpecifyingDivStyleUserValueDivGeneratesAWarning(assert) { + this.render('
', { + userValue: 'width: 42px' + }); + + this.assertStyleWarning(); + }; + + _class9.prototype['@test specifying `attributeBindings: ["style"]` generates a warning'] = function testSpecifyingAttributeBindingsStyleGeneratesAWarning(assert) { + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['style'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar style=userValue}}', { + userValue: 'width: 42px' + }); + + this.assertStyleWarning(); + }; + + _class9.prototype['@test specifying `
` works properly without a warning'] = function testSpecifyingDivStyleUserValueDivWorksProperlyWithoutAWarning(assert) { + this.render('
', { + userValue: 'width: 42px' + }); + + this.assertNoWarning(); + }; + + _class9.prototype['@test specifying `
` works properly with a SafeString'] = function testSpecifyingDivStyleUserValueDivWorksProperlyWithASafeString(assert) { + this.render('
', { + userValue: new _emberGlimmerTestsUtilsHelpers.SafeString('width: 42px') + }); + + this.assertNoWarning(); + }; + + _class9.prototype['@test null value do not generate htmlsafe warning'] = function testNullValueDoNotGenerateHtmlsafeWarning(assert) { + this.render('
', { + userValue: null + }); + + this.assertNoWarning(); + }; + + _class9.prototype['@test undefined value do not generate htmlsafe warning'] = function testUndefinedValueDoNotGenerateHtmlsafeWarning(assert) { + this.render('
'); + + this.assertNoWarning(); + }; + + _class9.prototype['@test no warnings are triggered when using `-html-safe`'] = function testNoWarningsAreTriggeredWhenUsingHtmlSafe(assert) { + this.render('
', { + userValue: 'width: 42px' + }); + + this.assertNoWarning(); + }; + + _class9.prototype['@test no warnings are triggered when a safe string is quoted'] = function testNoWarningsAreTriggeredWhenASafeStringIsQuoted(assert) { + this.render('
', { + userValue: new _emberGlimmerTestsUtilsHelpers.SafeString('width: 42px') + }); + + this.assertNoWarning(); + }; + + _class9.prototype['@test binding warning is triggered when an unsafe string is quoted'] = function testBindingWarningIsTriggeredWhenAnUnsafeStringIsQuoted(assert) { + this.render('
', { + userValue: 'width: 42px' + }); + + this.assertStyleWarning(); + }; + + _class9.prototype['@test binding warning is triggered when a safe string for a complete property is concatenated in place'] = function testBindingWarningIsTriggeredWhenASafeStringForACompletePropertyIsConcatenatedInPlace(assert) { + this.render('
', { + userValue: new _emberGlimmerTestsUtilsHelpers.SafeString('width: 42px') + }); + + this.assertStyleWarning(); + }; + + _class9.prototype['@test binding warning is triggered when a safe string for a value is concatenated in place'] = function testBindingWarningIsTriggeredWhenASafeStringForAValueIsConcatenatedInPlace(assert) { + this.render('
', { + userValue: new _emberGlimmerTestsUtilsHelpers.SafeString('42px') + }); + + this.assertStyleWarning(); + }; + + _class9.prototype['@test binding warning is triggered when a safe string for a property name is concatenated in place'] = function testBindingWarningIsTriggeredWhenASafeStringForAPropertyNameIsConcatenatedInPlace(assert) { + this.render('
', { + userProperty: new _emberGlimmerTestsUtilsHelpers.SafeString('width') + }); + + this.assertStyleWarning(); + }; + + return _class9; + })(StyleTest)); + } +}); +enifed('ember-glimmer/tests/integration/content-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration'); + test('ember-glimmer/tests/integration/content-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/content-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/content-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration'); + QUnit.test('ember-glimmer/tests/integration/content-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/content-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/event-dispatcher-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { + 'use strict'; + + var canDataTransfer = !!document.createEvent('HTMLEvents').dataTransfer; + + function fireNativeWithDataTransfer(node, type, dataTransfer) { + var event = document.createEvent('HTMLEvents'); + event.initEvent(type, true, true); + event.dataTransfer = dataTransfer; + node.dispatchEvent(event); + } + + _emberGlimmerTestsUtilsTestCase.moduleFor('EventDispatcher', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test events bubble view hierarchy for form elements'] = function testEventsBubbleViewHierarchyForFormElements(assert) { + var _this = this; + + var receivedEvent = undefined; + + this.registerComponent('x-foo', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + change: function (event) { + receivedEvent = event; + } + }), + template: '' + }); + + this.render('{{x-foo}}'); + + this.runTask(function () { + return _this.$('#is-done').trigger('change'); + }); + assert.ok(receivedEvent, 'change event was triggered'); + assert.strictEqual(receivedEvent.target, this.$('#is-done')[0]); + }; + + _class.prototype['@test dispatches to the nearest event manager'] = function testDispatchesToTheNearestEventManager(assert) { + var _this2 = this; + + var receivedEvent = undefined; + + this.registerComponent('x-foo', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + click: function (event) { + assert.notOk(true, 'should not trigger `click` on component'); + }, + + eventManager: { + click: function (event) { + receivedEvent = event; + } + } + }), + + template: '' + }); + + this.render('{{x-foo}}'); + + this.runTask(function () { + return _this2.$('#is-done').trigger('click'); + }); + assert.strictEqual(receivedEvent.target, this.$('#is-done')[0]); + }; + + _class.prototype['@test event manager can re-dispatch to the component'] = function testEventManagerCanReDispatchToTheComponent(assert) { + var _this3 = this; + + var handlers = []; + + this.registerComponent('x-foo', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + click: function () { + handlers.push('component'); + }, + + eventManager: { + click: function (event, component) { + handlers.push('eventManager'); + // Re-dispatch event when you get it. + // + // The second parameter tells the dispatcher + // that this event has been handled. This + // API will clearly need to be reworked since + // multiple eventManagers in a single view + // hierarchy would break, but it shows that + // re-dispatching works + component.$().trigger('click', this); + } + } + }), + + template: '' + }); + + this.render('{{x-foo}}'); + + this.runTask(function () { + return _this3.$('#is-done').trigger('click'); + }); + assert.deepEqual(handlers, ['eventManager', 'component']); + }; + + _class.prototype['@test event handlers are wrapped in a run loop'] = function testEventHandlersAreWrappedInARunLoop(assert) { + this.registerComponent('x-foo', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + change: function () { + assert.ok(_emberMetal.run.currentRunLoop, 'a run loop should have started'); + } + }), + template: '' + }); + + this.render('{{x-foo}}'); + + this.$('#is-done').trigger('click'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('EventDispatcher#setup', (function (_RenderingTest2) { + babelHelpers.inherits(_class2, _RenderingTest2); + + function _class2() { + babelHelpers.classCallCheck(this, _class2); + + _RenderingTest2.call(this); + + var dispatcher = this.owner.lookup('event_dispatcher:main'); + _emberMetal.run(dispatcher, 'destroy'); + this.owner.__container__.reset('event_dispatcher:main'); + this.dispatcher = this.owner.lookup('event_dispatcher:main'); + } + + _class2.prototype['@test additonal events can be specified'] = function testAdditonalEventsCanBeSpecified(assert) { + this.dispatcher.setup({ myevent: 'myEvent' }); + + this.registerComponent('x-foo', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + myEvent: function () { + assert.ok(true, 'custom event was triggered'); + } + }), + template: '

Hello!

' + }); + + this.render('{{x-foo}}'); + + this.$('div').trigger('myevent'); + }; + + _class2.prototype['@test a rootElement can be specified'] = function testARootElementCanBeSpecified(assert) { + this.$().append('
'); + this.dispatcher.setup({ myevent: 'myEvent' }, '#app'); + + assert.ok(this.$('#app').hasClass('ember-application'), 'custom rootElement was used'); + assert.equal(this.dispatcher.rootElement, '#app', 'the dispatchers rootElement was updated'); + }; + + _class2.prototype['@test default events can be disabled via `customEvents`'] = function testDefaultEventsCanBeDisabledViaCustomEvents(assert) { + this.dispatcher.setup({ click: null }); + + this.registerComponent('x-foo', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + click: function () { + assert.ok(false, 'click method was called'); + }, + + null: function () { + assert.ok(false, 'null method was called'); + }, + + doubleClick: function () { + assert.ok(true, 'a non-disabled event is still handled properly'); + } + }), + + template: '

Hello!

' + }); + + this.render('{{x-foo}}'); + + this.$('div').trigger('click'); + this.$('div').trigger('dblclick'); + }; + + _class2.prototype['@test throws if specified rootElement does not exist'] = function testThrowsIfSpecifiedRootElementDoesNotExist(assert) { + var _this4 = this; + + assert.throws(function () { + _this4.dispatcher.setup({ myevent: 'myEvent' }, '#app'); + }); + }; + + return _class2; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + if (false) { + _emberGlimmerTestsUtilsTestCase.moduleFor('EventDispatcher - Instrumentation', (function (_RenderingTest3) { + babelHelpers.inherits(_class3, _RenderingTest3); + + function _class3() { + babelHelpers.classCallCheck(this, _class3); + + _RenderingTest3.apply(this, arguments); + } + + _class3.prototype.teardown = function teardown() { + _RenderingTest3.prototype.teardown.call(this); + _emberMetal.instrumentationReset(); + }; + + _class3.prototype['@test instruments triggered events'] = function testInstrumentsTriggeredEvents(assert) { + var clicked = 0; + + this.registerComponent('x-foo', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + click: function (evt) { + clicked++; + } + }), + template: '

hello

' + }); + + this.render('{{x-foo}}'); + + this.$('div').trigger('click'); + + assert.equal(clicked, 1, 'precond - the click handler was invoked'); + + var clickInstrumented = 0; + _emberMetal.instrumentationSubscribe('interaction.click', { + before: function () { + clickInstrumented++; + assert.equal(clicked, 1, 'invoked before event is handled'); + }, + after: function () { + clickInstrumented++; + assert.equal(clicked, 2, 'invoked after event is handled'); + } + }); + + var keypressInstrumented = 0; + _emberMetal.instrumentationSubscribe('interaction.keypress', { + before: function () { + keypressInstrumented++; + }, + after: function () { + keypressInstrumented++; + } + }); + + this.$('div').trigger('click'); + this.$('div').trigger('change'); + assert.equal(clicked, 2, 'precond - The click handler was invoked'); + assert.equal(clickInstrumented, 2, 'The click was instrumented'); + assert.strictEqual(keypressInstrumented, 0, 'The keypress was not instrumented'); + }; + + return _class3; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + } + + if (canDataTransfer) { + _emberGlimmerTestsUtilsTestCase.moduleFor('EventDispatcher - Event Properties', (function (_RenderingTest4) { + babelHelpers.inherits(_class4, _RenderingTest4); + + function _class4() { + babelHelpers.classCallCheck(this, _class4); + + _RenderingTest4.apply(this, arguments); + } + + _class4.prototype['@test dataTransfer property is added to drop event'] = function testDataTransferPropertyIsAddedToDropEvent(assert) { + var receivedEvent = undefined; + this.registerComponent('x-foo', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + drop: function (event) { + receivedEvent = event; + } + }) + }); + + this.render('{{x-foo}}'); + + fireNativeWithDataTransfer(this.$('div')[0], 'drop', 'success'); + assert.equal(receivedEvent.dataTransfer, 'success'); + }; + + return _class4; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + } +}); +enifed('ember-glimmer/tests/integration/event-dispatcher-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration'); + test('ember-glimmer/tests/integration/event-dispatcher-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/event-dispatcher-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/event-dispatcher-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration'); + QUnit.test('ember-glimmer/tests/integration/event-dispatcher-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/event-dispatcher-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/-class-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/test-helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsTestHelpers, _emberMetal) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{-class}}', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test casts binding to dasherized class'] = function testCastsBindingToDasherizedClass() { + var _this = this; + + this.registerComponent('foo-bar', { template: '' }); + this.render('{{foo-bar class=(-class someTruth "someTruth")}}', { + someTruth: true + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('some-truth ember-view') } }); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('some-truth ember-view') } }); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'someTruth', false); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') } }); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'someTruth', true); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('some-truth ember-view') } }); + }; + + _class.prototype['@tests casts leaf path of binding to dasherized class'] = function testsCastsLeafPathOfBindingToDasherizedClass() { + var _this2 = this; + + this.registerComponent('foo-bar', { template: '' }); + this.render('{{foo-bar class=(-class model.someTruth "someTruth")}}', { + model: { + someTruth: true + } + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('some-truth ember-view') } }); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('some-truth ember-view') } }); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'model.someTruth', false); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') } }); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'model', { someTruth: true }); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('some-truth ember-view') } }); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/-class-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/-class-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/-class-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/-class-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/-class-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/-class-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/closure-action-test', ['exports', 'ember-metal', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberMetal, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsHelpers) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n
clicked: {{clicked}}; foo: {{foo}}
\n\n {{click-me id="string-action" onClick=(action "on-click")}}\n {{click-me id="function-action" onClick=(action onClick)}}\n {{click-me id="mut-action" onClick=(action (mut clicked))}}\n '], ['\n
clicked: {{clicked}}; foo: {{foo}}
\n\n {{click-me id="string-action" onClick=(action "on-click")}}\n {{click-me id="function-action" onClick=(action onClick)}}\n {{click-me id="mut-action" onClick=(action (mut clicked))}}\n ']); + + if (false) { + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: closure {{action}} improved instrumentation', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { +babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype.subscribe = function subscribe(eventName, options) { + this.subscriber = _emberMetal.instrumentationSubscribe(eventName, options); + }; + + _class.prototype.teardown = function teardown() { + if (this.subscriber) { + _emberMetal.instrumentationUnsubscribe(this.subscriber); + } + + _RenderingTest.prototype.teardown.call(this); + }; + + _class.prototype['@test interaction event subscriber should be passed parameters'] = function testInteractionEventSubscriberShouldBePassedParameters() { + var _this = this; + + var actionParam = 'So krispy'; + var beforeParameters = []; + var afterParameters = []; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + fireAction: function () { + this.attrs.submit(actionParam); + } + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + outerSubmit: function () {} + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: '' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action outerSubmit)}}' + }); + + this.subscribe('interaction.ember-action', { + before: function (name, timestamp, payload) { + beforeParameters.push(payload.args); + }, + after: function (name, timestamp, payload) { + afterParameters.push(payload.args); + } + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + _this.$('#instrument-button').trigger('click'); + }); + + this.assert.deepEqual(beforeParameters, [[], [actionParam]], 'instrumentation subscriber before function was passed closure action parameters'); + this.assert.deepEqual(afterParameters, [[actionParam], []], 'instrumentation subscriber after function was passed closure action parameters'); + }; + + _class.prototype['@test interaction event subscriber should be passed target'] = function testInteractionEventSubscriberShouldBePassedTarget() { + var _this2 = this; + + var beforeParameters = []; + var afterParameters = []; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + myProperty: 'inner-thing', + actions: { + fireAction: function () { + this.attrs.submit(); + } + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + myProperty: 'outer-thing', + outerSubmit: function () {} + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: '' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action outerSubmit)}}' + }); + + this.subscribe('interaction.ember-action', { + before: function (name, timestamp, payload) { + beforeParameters.push(payload.target.get('myProperty')); + }, + after: function (name, timestamp, payload) { + afterParameters.push(payload.target.get('myProperty')); + } + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + _this2.$('#instrument-button').trigger('click'); + }); + + this.assert.deepEqual(beforeParameters, ['inner-thing', 'outer-thing'], 'instrumentation subscriber before function was passed target'); + this.assert.deepEqual(afterParameters, ['outer-thing', 'inner-thing'], 'instrumentation subscriber after function was passed target'); + }; + + _class.prototype['@test instrumented action should return value'] = function testInstrumentedActionShouldReturnValue() { + var _this3 = this; + + var returnedValue = 'Chris P is so krispy'; + var beforeParameter = undefined; + var afterParameter = undefined; + var actualReturnedValue = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + fireAction: function () { + actualReturnedValue = this.attrs.submit(); + } + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + outerSubmit: function () { + return returnedValue; + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: '' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action outerSubmit)}}' + }); + + this.subscribe('interaction.ember-action', { + before: function (name, timestamp, payload) { + beforeParameter = payload.target.get('myProperty'); + }, + after: function (name, timestamp, payload) { + afterParameter = payload.target.get('myProperty'); + } + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + _this3.$('#instrument-button').trigger('click'); + }); + + this.assert.equal(actualReturnedValue, returnedValue, 'action can return to caller'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + } + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: closure {{action}}', (function (_RenderingTest2) { +babelHelpers.inherits(_class2, _RenderingTest2); + + function _class2() { +babelHelpers.classCallCheck(this, _class2); + + _RenderingTest2.apply(this, arguments); + } + + _class2.prototype['@test action should be called'] = function testActionShouldBeCalled() { + var outerActionCalled = false; + var component = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + fireAction: function () { + this.attrs.submit(); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + outerSubmit: function () { + outerActionCalled = true; + } + }); + + this.registerComponent('inner-component', { ComponentClass: InnerComponent, template: 'inner' }); + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action outerSubmit)}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + component.fireAction(); + }); + + this.assert.ok(outerActionCalled, 'the action was called'); + }; + + _class2.prototype['@test an error is triggered when bound action function is undefined'] = function testAnErrorIsTriggeredWhenBoundActionFunctionIsUndefined() { + var _this4 = this; + + this.registerComponent('inner-component', { + template: 'inner' + }); + this.registerComponent('outer-component', { + template: '{{inner-component submit=(action somethingThatIsUndefined)}}' + }); + + expectAssertion(function () { + _this4.render('{{outer-component}}'); + }, /Action passed is null or undefined in \(action[^)]*\) from .*\./); + }; + + _class2.prototype['@test an error is triggered when bound action being passed in is a non-function'] = function testAnErrorIsTriggeredWhenBoundActionBeingPassedInIsANonFunction() { + var _this5 = this; + + this.registerComponent('inner-component', { + template: 'inner' + }); + this.registerComponent('outer-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + nonFunctionThing: {} + }), + template: '{{inner-component submit=(action nonFunctionThing)}}' + }); + + expectAssertion(function () { + _this5.render('{{outer-component}}'); + }, /An action could not be made for `.*` in .*\. Please confirm that you are using either a quoted action name \(i\.e\. `\(action '.*'\)`\) or a function available in .*\./); + }; + + _class2.prototype['@test [#12718] a nice error is shown when a bound action function is undefined and it is passed as attrs.foo'] = function test12718ANiceErrorIsShownWhenABoundActionFunctionIsUndefinedAndItIsPassedAsAttrsFoo() { + var _this6 = this; + + this.registerComponent('inner-component', { + template: '' + }); + + this.registerComponent('outer-component', { + template: '{{inner-component}}' + }); + + expectAssertion(function () { + _this6.render('{{outer-component}}'); + }, /Action passed is null or undefined in \(action[^)]*\) from .*\./); + }; + + _class2.prototype['@test action value is returned'] = function testActionValueIsReturned() { + var expectedValue = 'terrible tom'; + var returnedValue = undefined; + var innerComponent = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + returnedValue = this.attrs.submit(); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + outerSubmit: function () { + return expectedValue; + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action outerSubmit)}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.equal(returnedValue, expectedValue, 'action can return to caller'); + }; + + _class2.prototype['@test action should be called on the correct scope'] = function testActionShouldBeCalledOnTheCorrectScope() { + var innerComponent = undefined; + var outerComponent = undefined; + var actualComponent = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.attrs.submit(); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + outerComponent = this; + }, + isOuterComponent: true, + outerSubmit: function () { + actualComponent = this; + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action outerSubmit)}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.equal(actualComponent, outerComponent, 'action has the correct context'); + this.assert.ok(actualComponent.isOuterComponent, 'action has the correct context'); + }; + + _class2.prototype['@test arguments to action are passed, curry'] = function testArgumentsToActionArePassedCurry() { + var first = 'mitch'; + var second = 'martin'; + var third = 'matt'; + var fourth = 'wacky wycats'; + + var innerComponent = undefined; + var actualArgs = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.attrs.submit(fourth); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + third: third, + outerSubmit: function (actualFirst, actualSecond, actualThird, actualFourth) { + actualArgs = [].concat(babelHelpers.slice.call(arguments)); + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action (action outerSubmit "' + first + '") "' + second + '" third)}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.deepEqual(actualArgs, [first, second, third, fourth], 'action has the correct args'); + }; + + _class2.prototype['@test `this` can be passed as an argument'] = function testThisCanBePassedAsAnArgument() { + var value = {}; + var component = undefined; + var innerComponent = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.attrs.submit(); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + actions: { + outerAction: function (incomingValue) { + value = incomingValue; + } + } + }); + + this.registerComponent('inner-component', { ComponentClass: InnerComponent, template: 'inner' }); + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action "outerAction" this)}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.strictEqual(value, component, 'the component is passed at `this`'); + }; + + _class2.prototype['@test arguments to action are bound'] = function testArgumentsToActionAreBound() { + var value = 'lazy leah'; + + var innerComponent = undefined; + var outerComponent = undefined; + var actualArg = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.attrs.submit(); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + outerComponent = this; + }, + value: '', + outerSubmit: function (incomingValue) { + actualArg = incomingValue; + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action outerSubmit value)}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.strictEqual(actualArg, '', 'action has the correct first arg'); + + this.runTask(function () { + outerComponent.set('value', value); + }); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.strictEqual(actualArg, value, 'action has the correct first arg'); + }; + + _class2.prototype['@test array arguments are passed correctly to action'] = function testArrayArgumentsArePassedCorrectlyToAction() { + var first = 'foo'; + var second = [3, 5]; + var third = [4, 9]; + + var actualFirst = undefined; + var actualSecond = undefined; + var actualThird = undefined; + + var innerComponent = undefined; + var outerComponent = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.attrs.submit(second, third); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + outerComponent = this; + }, + outerSubmit: function (incomingFirst, incomingSecond, incomingThird) { + actualFirst = incomingFirst; + actualSecond = incomingSecond; + actualThird = incomingThird; + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action outerSubmit first)}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + outerComponent.set('first', first); + outerComponent.set('second', second); + }); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.equal(actualFirst, first, 'action has the correct first arg'); + this.assert.equal(actualSecond, second, 'action has the correct second arg'); + this.assert.equal(actualThird, third, 'action has the correct third arg'); + }; + + _class2.prototype['@test mut values can be wrapped in actions, are settable'] = function testMutValuesCanBeWrappedInActionsAreSettable() { + var newValue = 'trollin trek'; + + var innerComponent = undefined; + var outerComponent = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.attrs.submit(newValue); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + outerComponent = this; + }, + outerMut: 'patient peter' + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action (mut outerMut))}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.equal(outerComponent.get('outerMut'), newValue, 'mut value is set'); + }; + + _class2.prototype['@test mut values can be wrapped in actions, are settable with a curry'] = function testMutValuesCanBeWrappedInActionsAreSettableWithACurry() { + var newValue = 'trollin trek'; + + var innerComponent = undefined; + var outerComponent = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.attrs.submit(); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + outerComponent = this; + }, + outerMut: 'patient peter' + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action (mut outerMut) \'' + newValue + '\')}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.equal(outerComponent.get('outerMut'), newValue, 'mut value is set'); + }; + + _class2.prototype['@test action can create closures over actions'] = function testActionCanCreateClosuresOverActions() { + var first = 'raging robert'; + var second = 'mild machty'; + var returnValue = 'butch brian'; + + var actualFirst = undefined; + var actualSecond = undefined; + var actualReturnedValue = undefined; + + var innerComponent = undefined; + var outerComponent = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + actualReturnedValue = this.attrs.submit(second); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + outerComponent = this; + }, + actions: { + outerAction: function (incomingFirst, incomingSecond) { + actualFirst = incomingFirst; + actualSecond = incomingSecond; + return returnValue; + } + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action \'outerAction\' \'' + first + '\')}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.equal(actualReturnedValue, returnValue, 'return value is present'); + this.assert.equal(actualFirst, first, 'first argument is correct'); + this.assert.equal(actualSecond, second, 'second argument is correct'); + }; + + _class2.prototype['@test provides a helpful error if an action is not present'] = function testProvidesAHelpfulErrorIfAnActionIsNotPresent() { + var _this7 = this; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({}); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + something: function () { + // this is present to ensure `actions` hash is present + // a different error is triggered if `actions` is missing + // completely + } + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action \'doesNotExist\')}}' + }); + + expectAssertion(function () { + _this7.render('{{outer-component}}'); + }, /An action named 'doesNotExist' was not found in /); + }; + + _class2.prototype['@test provides a helpful error if actions hash is not present'] = function testProvidesAHelpfulErrorIfActionsHashIsNotPresent() { + var _this8 = this; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({}); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({}); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action \'doesNotExist\')}}' + }); + + expectAssertion(function () { + _this8.render('{{outer-component}}'); + }, /An action named 'doesNotExist' was not found in /); + }; + + _class2.prototype['@test action can create closures over actions with target'] = function testActionCanCreateClosuresOverActionsWithTarget() { + var innerComponent = undefined; + var actionCalled = false; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.attrs.submit(); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + otherComponent: _emberMetal.computed(function () { + return { + actions: { + outerAction: function () { + actionCalled = true; + } + } + }; + }) + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action \'outerAction\' target=otherComponent)}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.ok(actionCalled, 'action called on otherComponent'); + }; + + _class2.prototype['@test value can be used with action over actions'] = function testValueCanBeUsedWithActionOverActions() { + var newValue = 'yelping yehuda'; + + var innerComponent = undefined; + var actualValue = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.attrs.submit({ + readProp: newValue + }); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + outerContent: { + readProp: newValue + }, + actions: { + outerAction: function (incomingValue) { + actualValue = incomingValue; + } + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action \'outerAction\' value="readProp")}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.equal(actualValue, newValue, 'value is read'); + }; + + _class2.prototype['@test action will read the value of a first property'] = function testActionWillReadTheValueOfAFirstProperty() { + var newValue = 'irate igor'; + + var innerComponent = undefined; + var actualValue = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.attrs.submit({ + readProp: newValue + }); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + outerAction: function (incomingValue) { + actualValue = incomingValue; + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action outerAction value="readProp")}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.equal(actualValue, newValue, 'property is read'); + }; + + _class2.prototype['@test action will read the value of a curried first argument property'] = function testActionWillReadTheValueOfACurriedFirstArgumentProperty() { + var newValue = 'kissing kris'; + + var innerComponent = undefined; + var actualValue = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.attrs.submit(); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + objectArgument: { + readProp: newValue + }, + outerAction: function (incomingValue) { + actualValue = incomingValue; + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action outerAction objectArgument value="readProp")}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.equal(actualValue, newValue, 'property is read'); + }; + + _class2.prototype['@test action closure does not get auto-mut wrapped'] = function testActionClosureDoesNotGetAutoMutWrapped(assert) { + var first = 'raging robert'; + var second = 'mild machty'; + var returnValue = 'butch brian'; + + var innerComponent = undefined; + var actualFirst = undefined; + var actualSecond = undefined; + var actualReturnedValue = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.get('submit')(second); + this.get('attrs-submit')(second); + var attrsSubmitReturnValue = this.attrs['attrs-submit'](second); + var submitReturnValue = this.attrs.submit(second); + + assert.equal(attrsSubmitReturnValue, submitReturnValue, 'both attrs.foo and foo should behave the same'); + + return submitReturnValue; + } + }); + + var MiddleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({}); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + outerAction: function (incomingFirst, incomingSecond) { + actualFirst = incomingFirst; + actualSecond = incomingSecond; + return returnValue; + } + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('middle-component', { + ComponentClass: MiddleComponent, + template: '{{inner-component attrs-submit=attrs.submit submit=submit}}' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{middle-component submit=(action \'outerAction\' \'' + first + '\')}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + actualReturnedValue = innerComponent.fireAction(); + }); + + this.assert.equal(actualFirst, first, 'first argument is correct'); + this.assert.equal(actualSecond, second, 'second argument is correct'); + this.assert.equal(actualReturnedValue, returnValue, 'return value is present'); + }; + + _class2.prototype['@test action should be called within a run loop'] = function testActionShouldBeCalledWithinARunLoop() { + var innerComponent = undefined; + var capturedRunLoop = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.attrs.submit(); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + submit: function () { + capturedRunLoop = _emberMetal.run.currentRunLoop; + } + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action \'submit\')}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.ok(capturedRunLoop, 'action is called within a run loop'); + }; + + _class2.prototype['@test objects that define INVOKE can be casted to actions'] = function testObjectsThatDefineINVOKECanBeCastedToActions() { + var innerComponent = undefined; + var actionArgs = undefined; + var invokableArgs = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + actionArgs = this.attrs.submit(4, 5, 6); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + foo: 123, + submitTask: _emberMetal.computed(function () { + var _ref, + _this9 = this; + + return _ref = {}, _ref[_emberGlimmerTestsUtilsHelpers.INVOKE] = function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + invokableArgs = args; + return _this9.foo; + }, _ref; + }) + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action submitTask 1 2 3)}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.equal(actionArgs, 123); + this.assert.deepEqual(invokableArgs, [1, 2, 3, 4, 5, 6]); + }; + + _class2.prototype['@test closure action with `(mut undefinedThing)` works properly [GH#13959]'] = function testClosureActionWithMutUndefinedThingWorksProperlyGH13959() { + var _this10 = this; + + var component = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + label: undefined, + init: function () { + this._super.apply(this, arguments); + component = this; + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '' + }); + + this.render('{{example-component}}'); + + this.assertText('Click me'); + + this.assertStableRerender(); + + this.runTask(function () { + _this10.$('button').click(); + }); + + this.assertText('Clicked!'); + + this.runTask(function () { + component.set('label', 'Dun clicked'); + }); + + this.assertText('Dun clicked'); + + this.runTask(function () { + _this10.$('button').click(); + }); + + this.assertText('Clicked!'); + + this.runTask(function () { + component.set('label', undefined); + }); + + this.assertText('Click me'); + }; + + _class2.prototype['@test closure actions does not cause component hooks to fire unnecessarily [GH#14305] [GH#14654]'] = function testClosureActionsDoesNotCauseComponentHooksToFireUnnecessarilyGH14305GH14654(assert) { + var _this12 = this; + + var clicked = 0; + var didReceiveAttrsFired = 0; + + var ClickMeComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'button', + + click: function () { + this.get('onClick').call(undefined, ++clicked); + }, + + didReceiveAttrs: function () { + didReceiveAttrsFired++; + } + }); + + this.registerComponent('click-me', { + ComponentClass: ClickMeComponent + }); + + var outer = undefined; + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + clicked: 0, + + actions: { + 'on-click': function () { + this.incrementProperty('clicked'); + } + }, + + init: function () { + var _this11 = this; + + this._super(); + outer = this; + this.set('onClick', function () { + return _this11.incrementProperty('clicked'); + }); + } + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject) + }); + + this.render('{{outer-component foo=foo}}', { foo: 1 }); + + this.assertText('clicked: 0; foo: 1'); + + assert.equal(didReceiveAttrsFired, 3); + + this.runTask(function () { + return _this12.rerender(); + }); + + this.assertText('clicked: 0; foo: 1'); + + assert.equal(didReceiveAttrsFired, 3); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'foo', 2); + }); + + this.assertText('clicked: 0; foo: 2'); + + assert.equal(didReceiveAttrsFired, 3); + + this.runTask(function () { + return _this12.$('#string-action').click(); + }); + + this.assertText('clicked: 1; foo: 2'); + + assert.equal(didReceiveAttrsFired, 3); + + this.runTask(function () { + return _this12.$('#function-action').click(); + }); + + this.assertText('clicked: 2; foo: 2'); + + assert.equal(didReceiveAttrsFired, 3); + + this.runTask(function () { + return _emberMetal.set(outer, 'onClick', function () { + outer.incrementProperty('clicked'); + }); + }); + + this.assertText('clicked: 2; foo: 2'); + + assert.equal(didReceiveAttrsFired, 3); + + this.runTask(function () { + return _this12.$('#function-action').click(); + }); + + this.assertText('clicked: 3; foo: 2'); + + assert.equal(didReceiveAttrsFired, 3); + + this.runTask(function () { + return _this12.$('#mut-action').click(); + }); + + this.assertText('clicked: 4; foo: 2'); + + assert.equal(didReceiveAttrsFired, 3); + }; + + return _class2; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/closure-action-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/closure-action-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/closure-action-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/closure-action-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/closure-action-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/closure-action-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/concat-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{concat}}', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test it concats static arguments'] = function testItConcatsStaticArguments() { + this.render('{{concat "foo" " " "bar" " " "baz"}}'); + this.assertText('foo bar baz'); + }; + + _class.prototype['@test it updates for bound arguments'] = function testItUpdatesForBoundArguments() { + var _this = this; + + this.render('{{concat model.first model.second}}', { + model: { first: 'one', second: 'two' } + }); + + this.assertText('onetwo'); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertText('onetwo'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'model.first', 'three'); + }); + + this.assertText('threetwo'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'model.second', 'four'); + }); + + this.assertText('threefour'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'model', { first: 'one', second: 'two' }); + }); + + this.assertText('onetwo'); + }; + + _class.prototype['@test it can be used as a sub-expression'] = function testItCanBeUsedAsASubExpression() { + var _this2 = this; + + this.render('{{concat (concat model.first model.second) (concat model.third model.fourth)}}', { + model: { + first: 'one', + second: 'two', + third: 'three', + fourth: 'four' + } + }); + + this.assertText('onetwothreefour'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertText('onetwothreefour'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'model.first', 'five'); + }); + + this.assertText('fivetwothreefour'); + + this.runTask(function () { + _emberMetal.set(_this2.context, 'model.second', 'six'); + _emberMetal.set(_this2.context, 'model.third', 'seven'); + }); + + this.assertText('fivesixsevenfour'); + + this.runTask(function () { + _emberMetal.set(_this2.context, 'model', { + first: 'one', + second: 'two', + third: 'three', + fourth: 'four' + }); + }); + + this.assertText('onetwothreefour'); + }; + + _class.prototype['@test it can be used as input for other helpers'] = function testItCanBeUsedAsInputForOtherHelpers() { + var _this3 = this; + + this.registerHelper('x-eq', function (_ref) { + var actual = _ref[0]; + var expected = _ref[1]; + return actual === expected; + }); + + this.render('{{#if (x-eq (concat model.first model.second) "onetwo")}}Truthy!{{else}}False{{/if}}', { + model: { + first: 'one', + second: 'two' + } + }); + + this.assertText('Truthy!'); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertText('Truthy!'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'model.first', 'three'); + }); + + this.assertText('False'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'model', { first: 'one', second: 'two' }); + }); + + this.assertText('Truthy!'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/concat-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/concat-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/concat-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/concat-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/concat-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/concat-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/custom-helper-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'internal-test-helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _internalTestHelpers, _emberMetal) { + /* globals EmberDev */ + 'use strict'; + + var assert = QUnit.assert; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: custom helpers', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test it cannot override built-in syntax'] = function testItCannotOverrideBuiltInSyntax() { + var _this = this; + + this.registerHelper('if', function () { + return 'Nope'; + }); + expectAssertion(function () { + _this.render('{{if foo \'LOL\'}}', { foo: true }); + }, /You attempted to overwrite the built-in helper \"if\" which is not allowed. Please rename the helper./); + }; + + _class.prototype['@test it can resolve custom simple helpers with or without dashes'] = function testItCanResolveCustomSimpleHelpersWithOrWithoutDashes() { + var _this2 = this; + + this.registerHelper('hello', function () { + return 'hello'; + }); + this.registerHelper('hello-world', function () { + return 'hello world'; + }); + + this.render('{{hello}} | {{hello-world}}'); + + this.assertText('hello | hello world'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertText('hello | hello world'); + }; + + _class.prototype['@test it does not resolve helpers with a `.` (period)'] = function testItDoesNotResolveHelpersWithAPeriod() { + var _this3 = this; + + this.registerHelper('hello.world', function () { + return 'hello world'; + }); + + this.render('{{hello.world}}', { + hello: { + world: '' + } + }); + + this.assertText(''); + + this.assertStableRerender(); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'hello', { world: 'hello world!' }); + }); + + this.assertText('hello world!'); + + this.runTask(function () { + _emberMetal.set(_this3.context, 'hello', { + world: '' + }); + }); + + this.assertText(''); + }; + + _class.prototype['@test it can resolve custom makeBoundHelper with or without dashes [DEPRECATED]'] = function testItCanResolveCustomMakeBoundHelperWithOrWithoutDashesDEPRECATED() { + var _this4 = this; + + expectDeprecation(function () { + _this4.owner.register('helper:hello', _emberGlimmerTestsUtilsHelpers.makeBoundHelper(function () { + return 'hello'; + })); + }, 'Using `Ember.HTMLBars.makeBoundHelper` is deprecated. Please refactor to use `Ember.Helper` or `Ember.Helper.helper`.'); + + expectDeprecation(function () { + _this4.owner.register('helper:hello-world', _emberGlimmerTestsUtilsHelpers.makeBoundHelper(function () { + return 'hello world'; + })); + }, 'Using `Ember.HTMLBars.makeBoundHelper` is deprecated. Please refactor to use `Ember.Helper` or `Ember.Helper.helper`.'); + + this.render('{{hello}} | {{hello-world}}'); + + this.assertText('hello | hello world'); + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assertText('hello | hello world'); + }; + + _class.prototype['@test it can resolve custom class-based helpers with or without dashes'] = function testItCanResolveCustomClassBasedHelpersWithOrWithoutDashes() { + var _this5 = this; + + this.registerHelper('hello', { + compute: function () { + return 'hello'; + } + }); + + this.registerHelper('hello-world', { + compute: function () { + return 'hello world'; + } + }); + + this.render('{{hello}} | {{hello-world}}'); + + this.assertText('hello | hello world'); + + this.runTask(function () { + return _this5.rerender(); + }); + + this.assertText('hello | hello world'); + }; + + _class.prototype['@test throws if `this._super` is not called from `init`'] = function testThrowsIfThis_superIsNotCalledFromInit() { + var _this6 = this; + + this.registerHelper('hello-world', { + init: function () {} + }); + + expectAssertion(function () { + _this6.render('{{hello-world}}'); + }, /You must call `this._super\(...arguments\);` when overriding `init` on a framework object. Please update .* to call `this._super\(...arguments\);` from `init`./); + }; + + _class.prototype['@test class-based helper can recompute a new value'] = function testClassBasedHelperCanRecomputeANewValue() { + var _this7 = this; + + var destroyCount = 0; + var computeCount = 0; + var helper = undefined; + + this.registerHelper('hello-world', { + init: function () { + this._super.apply(this, arguments); + helper = this; + }, + compute: function () { + return ++computeCount; + }, + destroy: function () { + destroyCount++; + this._super(); + } + }); + + this.render('{{hello-world}}'); + + this.assertText('1'); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertText('1'); + + this.runTask(function () { + return helper.recompute(); + }); + + this.assertText('2'); + + assert.strictEqual(destroyCount, 0, 'destroy is not called on recomputation'); + }; + + _class.prototype['@test class-based helper with static arguments can recompute a new value'] = function testClassBasedHelperWithStaticArgumentsCanRecomputeANewValue() { + var _this8 = this; + + var destroyCount = 0; + var computeCount = 0; + var helper = undefined; + + this.registerHelper('hello-world', { + init: function () { + this._super.apply(this, arguments); + helper = this; + }, + compute: function () { + return ++computeCount; + }, + destroy: function () { + destroyCount++; + this._super(); + } + }); + + this.render('{{hello-world "whut"}}'); + + this.assertText('1'); + + this.runTask(function () { + return _this8.rerender(); + }); + + this.assertText('1'); + + this.runTask(function () { + return helper.recompute(); + }); + + this.assertText('2'); + + assert.strictEqual(destroyCount, 0, 'destroy is not called on recomputation'); + }; + + _class.prototype['@test simple helper is called for param changes'] = function testSimpleHelperIsCalledForParamChanges() { + var _this9 = this; + + var computeCount = 0; + + this.registerHelper('hello-world', function (_ref) { + var value = _ref[0]; + + computeCount++; + return value + '-value'; + }); + + this.render('{{hello-world model.name}}', { + model: { name: 'bob' } + }); + + this.assertText('bob-value'); + + assert.strictEqual(computeCount, 1, 'compute is called exactly 1 time'); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertText('bob-value'); + + assert.strictEqual(computeCount, 1, 'compute is called exactly 1 time'); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'model.name', 'sal'); + }); + + this.assertText('sal-value'); + + assert.strictEqual(computeCount, 2, 'compute is called exactly 2 times'); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'model', { name: 'bob' }); + }); + + this.assertText('bob-value'); + + assert.strictEqual(computeCount, 3, 'compute is called exactly 3 times'); + }; + + _class.prototype['@test class-based helper compute is called for param changes'] = function testClassBasedHelperComputeIsCalledForParamChanges() { + var _this10 = this; + + var createCount = 0; + var computeCount = 0; + + this.registerHelper('hello-world', { + init: function () { + this._super.apply(this, arguments); + createCount++; + }, + compute: function (_ref2) { + var value = _ref2[0]; + + computeCount++; + return value + '-value'; + } + }); + + this.render('{{hello-world model.name}}', { + model: { name: 'bob' } + }); + + this.assertText('bob-value'); + + assert.strictEqual(computeCount, 1, 'compute is called exactly 1 time'); + + this.runTask(function () { + return _this10.rerender(); + }); + + this.assertText('bob-value'); + + assert.strictEqual(computeCount, 1, 'compute is called exactly 1 time'); + + this.runTask(function () { + return _emberMetal.set(_this10.context, 'model.name', 'sal'); + }); + + this.assertText('sal-value'); + + assert.strictEqual(computeCount, 2, 'compute is called exactly 2 times'); + + this.runTask(function () { + return _emberMetal.set(_this10.context, 'model', { name: 'bob' }); + }); + + this.assertText('bob-value'); + + assert.strictEqual(computeCount, 3, 'compute is called exactly 3 times'); + assert.strictEqual(createCount, 1, 'helper is only created once'); + }; + + _class.prototype['@test simple helper receives params, hash'] = function testSimpleHelperReceivesParamsHash() { + var _this11 = this; + + this.registerHelper('hello-world', function (_params, _hash) { + return 'params: ' + JSON.stringify(_params) + ', hash: ' + JSON.stringify(_hash); + }); + + this.render('{{hello-world model.name "rich" first=model.age last="sam"}}', { + model: { + name: 'bob', + age: 42 + } + }); + + this.assertText('params: ["bob","rich"], hash: {"first":42,"last":"sam"}'); + + this.runTask(function () { + return _this11.rerender(); + }); + + this.assertText('params: ["bob","rich"], hash: {"first":42,"last":"sam"}'); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'model.name', 'sal'); + }); + + this.assertText('params: ["sal","rich"], hash: {"first":42,"last":"sam"}'); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'model.age', 28); + }); + + this.assertText('params: ["sal","rich"], hash: {"first":28,"last":"sam"}'); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'model', { name: 'bob', age: 42 }); + }); + + this.assertText('params: ["bob","rich"], hash: {"first":42,"last":"sam"}'); + }; + + _class.prototype['@test class-based helper receives params, hash'] = function testClassBasedHelperReceivesParamsHash() { + var _this12 = this; + + this.registerHelper('hello-world', { + compute: function (_params, _hash) { + return 'params: ' + JSON.stringify(_params) + ', hash: ' + JSON.stringify(_hash); + } + }); + + this.render('{{hello-world model.name "rich" first=model.age last="sam"}}', { + model: { + name: 'bob', + age: 42 + } + }); + + this.assertText('params: ["bob","rich"], hash: {"first":42,"last":"sam"}'); + + this.runTask(function () { + return _this12.rerender(); + }); + + this.assertText('params: ["bob","rich"], hash: {"first":42,"last":"sam"}'); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'model.name', 'sal'); + }); + + this.assertText('params: ["sal","rich"], hash: {"first":42,"last":"sam"}'); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'model.age', 28); + }); + + this.assertText('params: ["sal","rich"], hash: {"first":28,"last":"sam"}'); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'model', { name: 'bob', age: 42 }); + }); + + this.assertText('params: ["bob","rich"], hash: {"first":42,"last":"sam"}'); + }; + + _class.prototype['@test class-based helper usable in subexpressions'] = function testClassBasedHelperUsableInSubexpressions() { + var _this13 = this; + + this.registerHelper('join-words', { + compute: function (params) { + return params.join(' '); + } + }); + + this.render('{{join-words "Who"\n (join-words "overcomes" "by")\n model.reason\n (join-words (join-words "hath overcome but" "half"))\n (join-words "his" (join-words "foe"))}}', { + model: { reason: 'force' } + }); + + this.assertText('Who overcomes by force hath overcome but half his foe'); + + this.runTask(function () { + return _this13.rerender(); + }); + + this.assertText('Who overcomes by force hath overcome but half his foe'); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'model.reason', 'Nickleback'); + }); + + this.assertText('Who overcomes by Nickleback hath overcome but half his foe'); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'model', { reason: 'force' }); + }); + + this.assertText('Who overcomes by force hath overcome but half his foe'); + }; + + _class.prototype['@test parameterless helper is usable in subexpressions'] = function testParameterlessHelperIsUsableInSubexpressions() { + var _this14 = this; + + this.registerHelper('should-show', function () { + return true; + }); + + this.render('{{#if (should-show)}}true{{/if}}'); + + this.assertText('true'); + + this.runTask(function () { + return _this14.rerender(); + }); + + this.assertText('true'); + }; + + _class.prototype['@test parameterless helper is usable in attributes'] = function testParameterlessHelperIsUsableInAttributes() { + var _this15 = this; + + this.registerHelper('foo-bar', function () { + return 'baz'; + }); + + this.render('
'); + + this.assertHTML('
'); + + this.runTask(function () { + return _this15.rerender(); + }); + + this.assertHTML('
'); + }; + + _class.prototype['@test simple helper not usable with a block'] = function testSimpleHelperNotUsableWithABlock() { + var _this16 = this; + + this.registerHelper('some-helper', function () {}); + + expectAssertion(function () { + _this16.render('{{#some-helper}}{{/some-helper}}'); + }, /Helpers may not be used in the block form/); + }; + + _class.prototype['@test class-based helper not usable with a block'] = function testClassBasedHelperNotUsableWithABlock() { + var _this17 = this; + + this.registerHelper('some-helper', { + compute: function () {} + }); + + expectAssertion(function () { + _this17.render('{{#some-helper}}{{/some-helper}}'); + }, /Helpers may not be used in the block form/); + }; + + _class.prototype['@test simple helper not usable within element'] = function testSimpleHelperNotUsableWithinElement() { + var _this18 = this; + + this.registerHelper('some-helper', function () {}); + + expectAssertion(function () { + _this18.render('
'); + }, /Helpers may not be used in the element form/); + }; + + _class.prototype['@test class-based helper not usable within element'] = function testClassBasedHelperNotUsableWithinElement() { + var _this19 = this; + + this.registerHelper('some-helper', { + compute: function () {} + }); + + expectAssertion(function () { + _this19.render('
'); + }, /Helpers may not be used in the element form/); + }; + + _class.prototype['@test class-based helper is torn down'] = function testClassBasedHelperIsTornDown() { + var destroyCalled = 0; + + this.registerHelper('some-helper', { + destroy: function () { + destroyCalled++; + this._super.apply(this, arguments); + }, + compute: function () { + return 'must define a compute'; + } + }); + + this.render('{{some-helper}}'); + + _internalTestHelpers.runDestroy(this.component); + + assert.strictEqual(destroyCalled, 1, 'destroy called once'); + }; + + _class.prototype['@test class-based helper used in subexpression can recompute'] = function testClassBasedHelperUsedInSubexpressionCanRecompute() { + var _this20 = this; + + var helper = undefined; + var phrase = 'overcomes by'; + + this.registerHelper('dynamic-segment', { + init: function () { + this._super.apply(this, arguments); + helper = this; + }, + compute: function () { + return phrase; + } + }); + + this.registerHelper('join-words', { + compute: function (params) { + return params.join(' '); + } + }); + + this.render('{{join-words "Who"\n (dynamic-segment)\n "force"\n (join-words (join-words "hath overcome but" "half"))\n (join-words "his" (join-words "foe"))}}'); + + this.assertText('Who overcomes by force hath overcome but half his foe'); + + this.runTask(function () { + return _this20.rerender(); + }); + + this.assertText('Who overcomes by force hath overcome but half his foe'); + + phrase = 'believes his'; + + this.runTask(function () { + return helper.recompute(); + }); + + this.assertText('Who believes his force hath overcome but half his foe'); + + phrase = 'overcomes by'; + + this.runTask(function () { + return helper.recompute(); + }); + + this.assertText('Who overcomes by force hath overcome but half his foe'); + }; + + _class.prototype['@test class-based helper used in subexpression can recompute component'] = function testClassBasedHelperUsedInSubexpressionCanRecomputeComponent() { + var _this21 = this; + + var helper = undefined; + var phrase = 'overcomes by'; + + this.registerHelper('dynamic-segment', { + init: function () { + this._super.apply(this, arguments); + helper = this; + }, + compute: function () { + return phrase; + } + }); + + this.registerHelper('join-words', { + compute: function (params) { + return params.join(' '); + } + }); + + this.registerComponent('some-component', { + template: '{{first}} {{second}} {{third}} {{fourth}} {{fifth}}' + }); + + this.render('{{some-component first="Who"\n second=(dynamic-segment)\n third="force"\n fourth=(join-words (join-words "hath overcome but" "half"))\n fifth=(join-words "his" (join-words "foe"))}}'); + + this.assertText('Who overcomes by force hath overcome but half his foe'); + + this.runTask(function () { + return _this21.rerender(); + }); + + this.assertText('Who overcomes by force hath overcome but half his foe'); + + phrase = 'believes his'; + + this.runTask(function () { + return helper.recompute(); + }); + + this.assertText('Who believes his force hath overcome but half his foe'); + + phrase = 'overcomes by'; + + this.runTask(function () { + return helper.recompute(); + }); + + this.assertText('Who overcomes by force hath overcome but half his foe'); + }; + + _class.prototype['@test class-based helper used in subexpression is destroyed'] = function testClassBasedHelperUsedInSubexpressionIsDestroyed() { + var destroyCount = 0; + + this.registerHelper('dynamic-segment', { + phrase: 'overcomes by', + init: function () { + this._super.apply(this, arguments); + }, + compute: function () { + return this.phrase; + }, + destroy: function () { + destroyCount++; + this._super.apply(this, arguments); + } + }); + + this.registerHelper('join-words', { + compute: function (params) { + return params.join(' '); + } + }); + + this.render('{{join-words "Who"\n (dynamic-segment)\n "force"\n (join-words (join-words "hath overcome but" "half"))\n (join-words "his" (join-words "foe"))}}'); + + _internalTestHelpers.runDestroy(this.component); + + equal(destroyCount, 1, 'destroy is called after a view is destroyed'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + // these feature detects prevent errors in these tests + // on platforms (*cough* IE9 *cough*) that do not + // property support `Object.freeze` + var pushingIntoFrozenArrayThrows = (function () { + var array = []; + Object.freeze(array); + + try { + array.push('foo'); + + return false; + } catch (e) { + return true; + } + })(); + + var assigningExistingFrozenPropertyThrows = (function () { + var obj = { foo: 'asdf' }; + Object.freeze(obj); + + try { + obj.foo = 'derp'; + + return false; + } catch (e) { + return true; + } + })(); + + var addingPropertyToFrozenObjectThrows = (function () { + var obj = { foo: 'asdf' }; + Object.freeze(obj); + + try { + obj.bar = 'derp'; + + return false; + } catch (e) { + return true; + } + })(); + + if (!EmberDev.runningProdBuild && (pushingIntoFrozenArrayThrows || assigningExistingFrozenPropertyThrows || addingPropertyToFrozenObjectThrows)) { + (function () { + var HelperMutatingArgsTests = (function (_RenderingTest2) { + babelHelpers.inherits(HelperMutatingArgsTests, _RenderingTest2); + + function HelperMutatingArgsTests() { + babelHelpers.classCallCheck(this, HelperMutatingArgsTests); + + _RenderingTest2.apply(this, arguments); + } + + HelperMutatingArgsTests.prototype.buildCompute = function buildCompute() { + var _this22 = this; + + return function (params, hash) { + if (pushingIntoFrozenArrayThrows) { + _this22.assert.throws(function () { + params.push('foo'); + + // cannot assert error message as it varies by platform + }); + } + + if (assigningExistingFrozenPropertyThrows) { + _this22.assert.throws(function () { + hash.foo = 'bar'; + + // cannot assert error message as it varies by platform + }); + } + + if (addingPropertyToFrozenObjectThrows) { + _this22.assert.throws(function () { + hash.someUnusedHashProperty = 'bar'; + + // cannot assert error message as it varies by platform + }); + } + }; + }; + + HelperMutatingArgsTests.prototype['@test cannot mutate params - no positional specified / named specified'] = function testCannotMutateParamsNoPositionalSpecifiedNamedSpecified() { + this.render('{{test-helper foo=bar}}', { bar: 'derp' }); + }; + + HelperMutatingArgsTests.prototype['@test cannot mutate params - positional specified / no named specified'] = function testCannotMutateParamsPositionalSpecifiedNoNamedSpecified() { + this.render('{{test-helper bar}}', { bar: 'derp' }); + }; + + HelperMutatingArgsTests.prototype['@test cannot mutate params - positional specified / named specified'] = function testCannotMutateParamsPositionalSpecifiedNamedSpecified() { + this.render('{{test-helper bar foo=qux}}', { bar: 'derp', qux: 'baz' }); + }; + + HelperMutatingArgsTests.prototype['@test cannot mutate params - no positional specified / no named specified'] = function testCannotMutateParamsNoPositionalSpecifiedNoNamedSpecified() { + this.render('{{test-helper}}', { bar: 'derp', qux: 'baz' }); + }; + + return HelperMutatingArgsTests; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: mutation triggers errors - class based helper', (function (_HelperMutatingArgsTests) { + babelHelpers.inherits(_class2, _HelperMutatingArgsTests); + + function _class2() { + babelHelpers.classCallCheck(this, _class2); + + _HelperMutatingArgsTests.call(this); + + var compute = this.buildCompute(); + + this.registerHelper('test-helper', { + compute: compute + }); + } + + return _class2; + })(HelperMutatingArgsTests)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: mutation triggers errors - simple helper', (function (_HelperMutatingArgsTests2) { + babelHelpers.inherits(_class3, _HelperMutatingArgsTests2); + + function _class3() { + babelHelpers.classCallCheck(this, _class3); + + _HelperMutatingArgsTests2.call(this); + + var compute = this.buildCompute(); + + this.registerHelper('test-helper', compute); + } + + return _class3; + })(HelperMutatingArgsTests)); + })(); + } +}); +enifed('ember-glimmer/tests/integration/helpers/custom-helper-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/custom-helper-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/custom-helper-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/custom-helper-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/custom-helper-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/custom-helper-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/debugger-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/helpers/debugger', 'ember-metal', 'ember-runtime'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberGlimmerHelpersDebugger, _emberMetal, _emberRuntime) { + 'use strict'; + + // This file is generally not I-N-U-R tested, because the {{debugger}} helper currently + // does not run during re-render. This is something we eventually want to do, and when + // we implement that feature these tests should be updated accordingly. + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{debugger}}', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype.teardown = function teardown() { + _RenderingTest.prototype.teardown.call(this); + _emberGlimmerHelpersDebugger.resetDebuggerCallback(); + }; + + _class.prototype.expectDebuggerCallback = function expectDebuggerCallback(callback, debuggerCallback) { + var times = arguments.length <= 2 || arguments[2] === undefined ? 1 : arguments[2]; + + var called = 0; + + _emberGlimmerHelpersDebugger.setDebuggerCallback(function (context, get) { + called++; + debuggerCallback(context, get); + }); + + callback(); + + this.assert.strictEqual(called, times, 'Expect debugger callback to be called exactly ' + times + ' time(s)'); + }; + + _class.prototype.expectNoDebuggerCallback = function expectNoDebuggerCallback(callback) { + var called = 0; + + _emberGlimmerHelpersDebugger.setDebuggerCallback(function () { + return called++; + }); + + callback(); + + this.assert.strictEqual(called, 0, 'Expect no debugger callback'); + }; + + _class.prototype['@test should have the right context when used in a component layout'] = function testShouldHaveTheRightContextWhenUsedInAComponentLayout(assert) { + var _this = this; + + var instance = undefined; + + this.registerComponent('my-wrapper', { + template: '{{yield}}' + }); + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + instance = this; + } + }), + template: '{{debugger}}foo-bar' + }); + + this.expectDebuggerCallback(function () { + _this.render('{{#my-wrapper}}{{foo-bar}}{{/my-wrapper}}'); + }, function (context) { + assert.strictEqual(context, instance, 'context should be the component instance'); + }); + + this.assertText('foo-bar'); + + this.expectNoDebuggerCallback(function () { + return _this.runTask(function () { + return _this.rerender(); + }); + }); + + this.assertText('foo-bar'); + }; + + _class.prototype['@test should have the right context when yielded'] = function testShouldHaveTheRightContextWhenYielded(assert) { + var _this2 = this; + + var instance = undefined; + + this.registerComponent('my-wrapper', { + template: '{{yield}}' + }); + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + instance = this; + } + }), + template: '{{#my-wrapper}}{{debugger}}foo-bar{{/my-wrapper}}' + }); + + this.expectDebuggerCallback(function () { + _this2.render('{{foo-bar}}'); + }, function (context) { + assert.strictEqual(context, instance, 'context should be the component instance'); + }); + + this.assertText('foo-bar'); + + this.expectNoDebuggerCallback(function () { + return _this2.runTask(function () { + return _this2.rerender(); + }); + }); + + this.assertText('foo-bar'); + }; + + _class.prototype['@test should be called once per iteration in a loop'] = function testShouldBeCalledOncePerIterationInALoop(assert) { + var _this3 = this; + + var count = 0; + + _emberGlimmerHelpersDebugger.setDebuggerCallback(function () { + return count++; + }); + + var items = _emberRuntime.A([1, 2, 3, 4, 5]); + + this.render('{{#each items as |item|}}{{debugger}}[{{item}}]{{/each}}', { items: items }); + + this.assertText('[1][2][3][4][5]'); + + assert.equal(count, 5, 'should have fired once per iteration'); + + count = 0; + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertText('[1][2][3][4][5]'); + + assert.strictEqual(count, 0, 'should not fire for re-render'); + + count = 0; + + this.runTask(function () { + return items.pushObjects([6, 7, 8]); + }); + + this.assertText('[1][2][3][4][5][6][7][8]'); + + assert.equal(count, 3, 'should fire once per new items added to the loop'); + }; + + _class.prototype['@test could `get` properties from "self"'] = function testCouldGetPropertiesFromSelf(assert) { + var _this4 = this; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + this.zomg = 'zomg'; + } + }), + template: '{{debugger not.here}}foo-bar' + }); + + this.expectDebuggerCallback(function () { + _this4.render('{{foo-bar lol="lol" foo=foo}}', { foo: { bar: { baz: 'fooBarBaz' } } }); + }, function (context, get) { + assert.equal(get('this'), context, '{{this}}'); + + assert.equal(get('lol'), 'lol', '{{lol}}'); + assert.equal(get('this.lol'), 'lol', '{{this.lol}}'); + + assert.equal(get('zomg'), 'zomg', '{{zomg}}'); + assert.equal(get('this.zomg'), 'zomg', '{{this.zomg}}'); + + assert.equal(get('foo.bar.baz'), 'fooBarBaz', '{{foo.bar.baz}}'); + assert.equal(get('this.foo.bar.baz'), 'fooBarBaz', '{{this.foo.bar.baz}}'); + + assert.strictEqual(get('nope'), undefined, '{{nope}}'); + assert.strictEqual(get('this.nope'), undefined, '{{this.nope}}'); + + assert.strictEqual(get('not.here'), undefined, '{{not.here}}'); + assert.strictEqual(get('this.not.here'), undefined, '{{this.not.here}}'); + }); + + this.assertText('foo-bar'); + + this.expectNoDebuggerCallback(function () { + return _this4.runTask(function () { + return _this4.rerender(); + }); + }); + + this.assertText('foo-bar'); + }; + + _class.prototype['@test could `get` local variables'] = function testCouldGetLocalVariables(assert) { + var _this5 = this; + + var obj = { + foo: 'foo', + bar: { baz: { bat: 'barBazBat' } } + }; + + this.expectDebuggerCallback(function () { + _this5.render('{{#each-in obj as |key value|}}{{debugger}}[{{key}}]{{/each-in}}', { obj: obj }); + }, function (context, get) { + assert.equal(get('this'), context, '{{this}}'); + + assert.equal(get('obj'), obj); + + // Glimmer bug: + // assert.strictEqual(get('this.key'), undefined, '{{this.key}}'); + // assert.strictEqual(get('this.value'), undefined, '{{this.value}}'); + + var key = get('key'); + + if (key === 'foo') { + assert.equal(get('value'), 'foo', '{{value}} for key=foo'); + assert.strictEqual(get('value.baz.bat'), undefined, '{{value.baz.bat}} for key=foo'); + assert.strictEqual(get('value.nope'), undefined, '{{value.nope}} for key=foo'); + } else if (key === 'bar') { + assert.equal(get('value'), obj.bar, '{{value}} for key=bar'); + assert.equal(get('value.baz.bat'), 'barBazBat', '{{value.baz.bat}} for key=bar'); + assert.strictEqual(get('value.nope'), undefined, '{{value.nope}} for key=bar'); + } else { + assert.ok(false, 'Unknown key: ' + key); + } + }, 2); + + this.assertText('[foo][bar]'); + + this.expectNoDebuggerCallback(function () { + return _this5.runTask(function () { + return _this5.rerender(); + }); + }); + + this.assertText('[foo][bar]'); + + this.expectDebuggerCallback(function () { + _this5.runTask(function () { + return _emberMetal.set(obj, 'baz', 'baz'); + }); + }, function (context, get) { + assert.equal(get('this'), context, '{{this}}'); + + assert.equal(get('obj'), obj); + + assert.strictEqual(get('this.key'), undefined, '{{this.key}}'); + assert.strictEqual(get('this.value'), undefined, '{{this.value}}'); + + assert.equal(get('key'), 'baz', '{{key}} for key=baz'); + assert.equal(get('value'), 'baz', '{{value}} for key=baz'); + assert.strictEqual(get('value.baz.bat'), undefined, '{{value.baz.bat}} for key=baz'); + assert.strictEqual(get('value.nope'), undefined, '{{value.nope}} for key=baz'); + }); + + this.assertText('[foo][bar][baz]'); + + this.expectNoDebuggerCallback(function () { + return _this5.runTask(function () { + return _this5.rerender(); + }); + }); + + this.assertText('[foo][bar][baz]'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/debugger-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/debugger-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/debugger-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/debugger-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/debugger-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/debugger-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/element-action-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal', 'ember-runtime', 'ember-views'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal, _emberRuntime, _emberViews) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{#inner-component}}\n \n {{/inner-component}}\n '], ['\n {{#inner-component}}\n \n {{/inner-component}}\n ']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#target-component as |parent|}}\n {{other-component anotherTarget=parent}}\n {{/target-component}}\n '], ['\n {{#target-component as |parent|}}\n {{other-component anotherTarget=parent}}\n {{/target-component}}\n ']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#target-component as |aTarget|}}\n click me\n {{/target-component}}\n '], ['\n {{#target-component as |aTarget|}}\n click me\n {{/target-component}}\n ']), + _templateObject4 = babelHelpers.taggedTemplateLiteralLoose(['\n click me'], ['\n click me']), + _templateObject5 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#middle-component}}\n {{inner-component action="hey"}}\n {{/middle-component}}\n '], ['\n {{#middle-component}}\n {{inner-component action="hey"}}\n {{/middle-component}}\n ']), + _templateObject6 = babelHelpers.taggedTemplateLiteralLoose(['\n \n {{yield}}\n '], ['\n \n {{yield}}\n ']); + + function getActionAttributes(element) { + var attributes = element.attributes; + var actionAttrs = []; + + for (var i = 0; i < attributes.length; i++) { + var attr = attributes.item(i); + + if (attr.name.indexOf('data-ember-action-') === 0) { + actionAttrs.push(attr.name); + } + } + + return actionAttrs; + } + + function getActionIds(element) { + return getActionAttributes(element).map(function (attribute) { + return attribute.slice('data-ember-action-'.length); + }); + } + + if (false) { + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: element action instrumentation', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { +babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype.teardown = function teardown() { + _RenderingTest.prototype.teardown.call(this); + _emberMetal.instrumentationReset(); + }; + + _class.prototype['@test action should fire interaction event with proper params'] = function testActionShouldFireInteractionEventWithProperParams() { + var _this = this; + + var subscriberCallCount = 0; + var subscriberPayload = null; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + foo: function () {} + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '' + }); + + _emberMetal.instrumentationSubscribe('interaction.ember-action', { + before: function () { + subscriberCallCount++; + }, + after: function (name, time, payload) { + subscriberPayload = payload; + } + }); + + this.render('{{example-component}}'); + + this.assert.equal(subscriberCallCount, 0, 'subscriber has not been called'); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assert.equal(subscriberCallCount, 0, 'subscriber has not been called'); + + this.runTask(function () { + _this.$('button').click(); + }); + + this.assert.equal(subscriberCallCount, 1, 'subscriber has been called 1 time'); + this.assert.equal(subscriberPayload.name, 'foo', 'subscriber called with correct name'); + this.assert.equal(subscriberPayload.args[0], 'bar', 'subscriber called with correct args'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + } + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: element action', (function (_RenderingTest2) { +babelHelpers.inherits(_class2, _RenderingTest2); + + function _class2() { +babelHelpers.classCallCheck(this, _class2); + + _RenderingTest2.apply(this, arguments); + } + + _class2.prototype['@test it can call an action on its enclosing component'] = function testItCanCallAnActionOnItsEnclosingComponent() { + var _this2 = this; + + var fooCallCount = 0; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + foo: function () { + fooCallCount++; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '' + }); + + this.render('{{example-component}}'); + + this.assert.equal(fooCallCount, 0, 'foo has not been called'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assert.equal(fooCallCount, 0, 'foo has not been called'); + + this.runTask(function () { + _this2.$('button').click(); + }); + + this.assert.equal(fooCallCount, 1, 'foo has been called 1 time'); + + this.runTask(function () { + _this2.$('button').click(); + }); + + this.assert.equal(fooCallCount, 2, 'foo has been called 2 times'); + }; + + _class2.prototype['@test it can call an action with parameters'] = function testItCanCallAnActionWithParameters() { + var _this3 = this; + + var fooArgs = []; + var component = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + member: 'a', + init: function () { + this._super.apply(this, arguments); + component = this; + }, + actions: { + foo: function (thing) { + fooArgs.push(thing); + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '' + }); + + this.render('{{example-component}}'); + + this.assert.deepEqual(fooArgs, [], 'foo has not been called'); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assert.deepEqual(fooArgs, [], 'foo has not been called'); + + this.runTask(function () { + _this3.$('button').click(); + }); + + this.assert.deepEqual(fooArgs, ['a'], 'foo has not been called'); + + this.runTask(function () { + component.set('member', 'b'); + }); + + this.runTask(function () { + _this3.$('button').click(); + }); + + this.assert.deepEqual(fooArgs, ['a', 'b'], 'foo has been called with an updated value'); + }; + + _class2.prototype['@test it should output a marker attribute with a guid'] = function testItShouldOutputAMarkerAttributeWithAGuid() { + this.render(''); + + var button = this.$('button'); + + var attributes = getActionAttributes(button.get(0)); + + this.assert.ok(button.attr('data-ember-action').match(''), 'An empty data-ember-action attribute was added'); + this.assert.ok(attributes[0].match(/data-ember-action-\d+/), 'A data-ember-action-xyz attribute with a guid was added'); + }; + + _class2.prototype['@test it should allow alternative events to be handled'] = function testItShouldAllowAlternativeEventsToBeHandled() { + var _this4 = this; + + var showCalled = false; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + show: function () { + showCalled = true; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '
' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + var event = _emberViews.jQuery.Event('mouseup'); + _this4.$('#show').trigger(event); + }); + + this.assert.ok(showCalled, 'show action was called on mouseUp'); + }; + + _class2.prototype['@test inside a yield, the target points at the original target'] = function testInsideAYieldTheTargetPointsAtTheOriginalTarget() { + var _this5 = this; + + var targetWatted = false; + var innerWatted = false; + + var TargetComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + wat: function () { + targetWatted = true; + } + } + }); + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + wat: function () { + innerWatted = true; + } + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: '{{yield}}' + }); + + this.registerComponent('target-component', { + ComponentClass: TargetComponent, + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject) + }); + + this.render('{{target-component}}'); + + this.runTask(function () { + _this5.$('button').click(); + }); + + this.assert.ok(targetWatted, 'the correct target was watted'); + this.assert.notOk(innerWatted, 'the inner target was not watted'); + }; + + _class2.prototype['@test it should allow a target to be specified'] = function testItShouldAllowATargetToBeSpecified() { + var _this6 = this; + + var targetWatted = false; + + var TargetComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + wat: function () { + targetWatted = true; + } + } + }); + + var OtherComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({}); + + this.registerComponent('target-component', { + ComponentClass: TargetComponent, + template: '{{yield this}}' + }); + + this.registerComponent('other-component', { + ComponentClass: OtherComponent, + template: 'Wat?' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + + this.runTask(function () { + _this6.$('a').click(); + }); + + this.assert.equal(targetWatted, true, 'the specified target was watted'); + }; + + _class2.prototype['@test it should lazily evaluate the target'] = function testItShouldLazilyEvaluateTheTarget() { + var _this7 = this; + + var firstEdit = 0; + var secondEdit = 0; + var component = undefined; + + var first = { + edit: function () { + firstEdit++; + } + }; + + var second = { + edit: function () { + secondEdit++; + } + }; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + theTarget: first + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'Edit' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this7.$('a').click(); + }); + + this.assert.equal(firstEdit, 1); + + this.runTask(function () { + _emberMetal.set(component, 'theTarget', second); + }); + + this.runTask(function () { + _this7.$('a').click(); + }); + + this.assert.equal(firstEdit, 1); + this.assert.equal(secondEdit, 1); + }; + + _class2.prototype['@test it should register an event handler'] = function testItShouldRegisterAnEventHandler() { + var _this8 = this; + + var editHandlerWasCalled = false; + var shortcutHandlerWasCalled = false; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + edit: function () { + editHandlerWasCalled = true; + }, + shortcut: function () { + shortcutHandlerWasCalled = true; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'click me
click me too
' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + var event = _emberViews.jQuery.Event('click'); + event.altKey = true; + _this8.$('a[data-ember-action]').trigger(event); + }); + + this.assert.equal(editHandlerWasCalled, true, 'the event handler was called'); + + this.runTask(function () { + var event = _emberViews.jQuery.Event('click'); + event.ctrlKey = true; + _this8.$('div[data-ember-action]').trigger(event); + }); + + this.assert.equal(shortcutHandlerWasCalled, true, 'the "any" shortcut\'s event handler was called'); + }; + + _class2.prototype['@test it handles whitelisted bound modifier keys'] = function testItHandlesWhitelistedBoundModifierKeys() { + var _this9 = this; + + var editHandlerWasCalled = false; + var shortcutHandlerWasCalled = false; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + altKey: 'alt', + anyKey: 'any', + actions: { + edit: function () { + editHandlerWasCalled = true; + }, + shortcut: function () { + shortcutHandlerWasCalled = true; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'click me
click me too
' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + var event = _emberViews.jQuery.Event('click'); + event.altKey = true; + _this9.$('a[data-ember-action]').trigger(event); + }); + + this.assert.equal(editHandlerWasCalled, true, 'the event handler was called'); + + this.runTask(function () { + var event = _emberViews.jQuery.Event('click'); + event.ctrlKey = true; + _this9.$('div[data-ember-action]').trigger(event); + }); + + this.assert.equal(shortcutHandlerWasCalled, true, 'the "any" shortcut\'s event handler was called'); + }; + + _class2.prototype['@test it handles whitelisted bound modifier keys with current value'] = function testItHandlesWhitelistedBoundModifierKeysWithCurrentValue() { + var _this10 = this; + + var editHandlerWasCalled = false; + var component = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + acceptedKeys: 'alt', + actions: { + edit: function () { + editHandlerWasCalled = true; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'click me' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + var event = _emberViews.jQuery.Event('click'); + event.altKey = true; + _this10.$('a[data-ember-action]').trigger(event); + }); + + this.assert.equal(editHandlerWasCalled, true, 'the event handler was called'); + + editHandlerWasCalled = false; + + this.runTask(function () { + component.set('acceptedKeys', ''); + }); + + this.runTask(function () { + var event = _emberViews.jQuery.Event('click'); + _this10.$('div[data-ember-action]').trigger(event); + }); + + this.assert.equal(editHandlerWasCalled, false, 'the event handler was not called'); + }; + + _class2.prototype['@test should be able to use action more than once for the same event within a view'] = function testShouldBeAbleToUseActionMoreThanOnceForTheSameEventWithinAView() { + var _this11 = this; + + var editHandlerWasCalled = false; + var deleteHandlerWasCalled = false; + var originalHandlerWasCalled = false; + var component = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + actions: { + edit: function () { + editHandlerWasCalled = true; + }, + 'delete': function () { + deleteHandlerWasCalled = true; + } + }, + click: function () { + originalHandlerWasCalled = true; + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'editdelete' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this11.$('#edit').click(); + }); + + this.assert.equal(editHandlerWasCalled, true, 'the edit action was called'); + this.assert.equal(deleteHandlerWasCalled, false, 'the delete action was not called'); + this.assert.equal(originalHandlerWasCalled, true, 'the click handler was called (due to bubbling)'); + + editHandlerWasCalled = deleteHandlerWasCalled = originalHandlerWasCalled = false; + + this.runTask(function () { + _this11.$('#delete').click(); + }); + + this.assert.equal(editHandlerWasCalled, false, 'the edit action was not called'); + this.assert.equal(deleteHandlerWasCalled, true, 'the delete action was called'); + this.assert.equal(originalHandlerWasCalled, true, 'the click handler was called (due to bubbling)'); + + editHandlerWasCalled = deleteHandlerWasCalled = originalHandlerWasCalled = false; + + this.runTask(function () { + component.$().click(); + }); + + this.assert.equal(editHandlerWasCalled, false, 'the edit action was not called'); + this.assert.equal(deleteHandlerWasCalled, false, 'the delete action was not called'); + this.assert.equal(originalHandlerWasCalled, true, 'the click handler was called'); + }; + + _class2.prototype['@test the event should not bubble if `bubbles=false` is passed'] = function testTheEventShouldNotBubbleIfBubblesFalseIsPassed() { + var _this12 = this; + + var editHandlerWasCalled = false; + var deleteHandlerWasCalled = false; + var originalHandlerWasCalled = false; + var component = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + actions: { + edit: function () { + editHandlerWasCalled = true; + }, + 'delete': function () { + deleteHandlerWasCalled = true; + } + }, + click: function () { + originalHandlerWasCalled = true; + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'editdelete' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this12.$('#edit').click(); + }); + + this.assert.equal(editHandlerWasCalled, true, 'the edit action was called'); + this.assert.equal(deleteHandlerWasCalled, false, 'the delete action was not called'); + this.assert.equal(originalHandlerWasCalled, false, 'the click handler was not called'); + + editHandlerWasCalled = deleteHandlerWasCalled = originalHandlerWasCalled = false; + + this.runTask(function () { + _this12.$('#delete').click(); + }); + + this.assert.equal(editHandlerWasCalled, false, 'the edit action was not called'); + this.assert.equal(deleteHandlerWasCalled, true, 'the delete action was called'); + this.assert.equal(originalHandlerWasCalled, false, 'the click handler was not called'); + + editHandlerWasCalled = deleteHandlerWasCalled = originalHandlerWasCalled = false; + + this.runTask(function () { + component.$().click(); + }); + + this.assert.equal(editHandlerWasCalled, false, 'the edit action was not called'); + this.assert.equal(deleteHandlerWasCalled, false, 'the delete action was not called'); + this.assert.equal(originalHandlerWasCalled, true, 'the click handler was called'); + }; + + _class2.prototype['@test the event should not bubble if `bubbles=false` is passed bound'] = function testTheEventShouldNotBubbleIfBubblesFalseIsPassedBound() { + var _this13 = this; + + var editHandlerWasCalled = false; + var deleteHandlerWasCalled = false; + var originalHandlerWasCalled = false; + var component = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + isFalse: false, + actions: { + edit: function () { + editHandlerWasCalled = true; + }, + 'delete': function () { + deleteHandlerWasCalled = true; + } + }, + click: function () { + originalHandlerWasCalled = true; + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'editdelete' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this13.$('#edit').click(); + }); + + this.assert.equal(editHandlerWasCalled, true, 'the edit action was called'); + this.assert.equal(deleteHandlerWasCalled, false, 'the delete action was not called'); + this.assert.equal(originalHandlerWasCalled, false, 'the click handler was not called'); + + editHandlerWasCalled = deleteHandlerWasCalled = originalHandlerWasCalled = false; + + this.runTask(function () { + _this13.$('#delete').click(); + }); + + this.assert.equal(editHandlerWasCalled, false, 'the edit action was not called'); + this.assert.equal(deleteHandlerWasCalled, true, 'the delete action was called'); + this.assert.equal(originalHandlerWasCalled, false, 'the click handler was not called'); + + editHandlerWasCalled = deleteHandlerWasCalled = originalHandlerWasCalled = false; + + this.runTask(function () { + component.$().click(); + }); + + this.assert.equal(editHandlerWasCalled, false, 'the edit action was not called'); + this.assert.equal(deleteHandlerWasCalled, false, 'the delete action was not called'); + this.assert.equal(originalHandlerWasCalled, true, 'the click handler was called'); + }; + + _class2.prototype['@test the bubbling depends on the bound parameter'] = function testTheBubblingDependsOnTheBoundParameter() { + var _this14 = this; + + var editHandlerWasCalled = false; + var originalHandlerWasCalled = false; + var component = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + shouldBubble: false, + actions: { + edit: function () { + editHandlerWasCalled = true; + } + }, + click: function () { + originalHandlerWasCalled = true; + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'edit' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this14.$('#edit').click(); + }); + + this.assert.equal(editHandlerWasCalled, true, 'the edit action was called'); + this.assert.equal(originalHandlerWasCalled, false, 'the click handler was not called'); + + editHandlerWasCalled = originalHandlerWasCalled = false; + + this.runTask(function () { + component.set('shouldBubble', true); + }); + + this.runTask(function () { + _this14.$('#edit').click(); + }); + + this.assert.equal(editHandlerWasCalled, true, 'the edit action was called'); + this.assert.equal(originalHandlerWasCalled, true, 'the click handler was called'); + }; + + _class2.prototype['@test it should work properly in an #each block'] = function testItShouldWorkProperlyInAnEachBlock() { + var _this15 = this; + + var editHandlerWasCalled = false; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + items: _emberRuntime.A([1, 2, 3, 4]), + actions: { + edit: function () { + editHandlerWasCalled = true; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '{{#each items as |item|}}click me{{/each}}' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this15.$('a').click(); + }); + + this.assert.equal(editHandlerWasCalled, true, 'the event handler was called'); + }; + + _class2.prototype['@test it should work properly in a {{#with foo as |bar|}} block'] = function testItShouldWorkProperlyInAWithFooAsBarBlock() { + var _this16 = this; + + var editHandlerWasCalled = false; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + something: { ohai: 'there' }, + actions: { + edit: function () { + editHandlerWasCalled = true; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '{{#with something as |somethingElse|}}click me{{/with}}' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this16.$('a').click(); + }); + + this.assert.equal(editHandlerWasCalled, true, 'the event handler was called'); + }; + + _class2.prototype['@test it should unregister event handlers when an element action is removed'] = function testItShouldUnregisterEventHandlersWhenAnElementActionIsRemoved() { + var _this17 = this; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + edit: function () {} + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '{{#if isActive}}click me{{/if}}' + }); + + this.render('{{example-component isActive=isActive}}', { isActive: true }); + + equal(this.$('a[data-ember-action]').length, 1, 'The element is rendered'); + + var actionId = undefined; + + actionId = getActionIds(this.$('a[data-ember-action]').get(0))[0]; + + ok(_emberViews.ActionManager.registeredActions[actionId], 'An action is registered'); + + this.runTask(function () { + return _this17.rerender(); + }); + + equal(this.$('a[data-ember-action]').length, 1, 'The element is still present'); + + ok(_emberViews.ActionManager.registeredActions[actionId], 'The action is still registered'); + + this.runTask(function () { + return _emberMetal.set(_this17.context, 'isActive', false); + }); + + strictEqual(this.$('a[data-ember-action]').length, 0, 'The element is removed'); + + ok(!_emberViews.ActionManager.registeredActions[actionId], 'The action is unregistered'); + + this.runTask(function () { + return _emberMetal.set(_this17.context, 'isActive', true); + }); + + equal(this.$('a[data-ember-action]').length, 1, 'The element is rendered'); + + actionId = getActionIds(this.$('a[data-ember-action]').get(0))[0]; + + ok(_emberViews.ActionManager.registeredActions[actionId], 'A new action is registered'); + }; + + _class2.prototype['@test it should capture events from child elements and allow them to trigger the action'] = function testItShouldCaptureEventsFromChildElementsAndAllowThemToTriggerTheAction() { + var _this18 = this; + + var editHandlerWasCalled = false; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + edit: function () { + editHandlerWasCalled = true; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '
' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this18.$('button').click(); + }); + + this.assert.ok(editHandlerWasCalled, 'event on a child target triggered the action of its parent'); + }; + + _class2.prototype['@test it should allow bubbling of events from action helper to original parent event'] = function testItShouldAllowBubblingOfEventsFromActionHelperToOriginalParentEvent() { + var _this19 = this; + + var editHandlerWasCalled = false; + var originalHandlerWasCalled = false; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + edit: function () { + editHandlerWasCalled = true; + } + }, + click: function () { + originalHandlerWasCalled = true; + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'click me' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this19.$('a').click(); + }); + + this.assert.ok(editHandlerWasCalled && originalHandlerWasCalled, 'both event handlers were called'); + }; + + _class2.prototype['@test it should not bubble an event from action helper to original parent event if `bubbles=false` is passed'] = function testItShouldNotBubbleAnEventFromActionHelperToOriginalParentEventIfBubblesFalseIsPassed() { + var _this20 = this; + + var editHandlerWasCalled = false; + var originalHandlerWasCalled = false; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + edit: function () { + editHandlerWasCalled = true; + } + }, + click: function () { + originalHandlerWasCalled = true; + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'click me' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this20.$('a').click(); + }); + + this.assert.ok(editHandlerWasCalled, 'the child event handler was called'); + this.assert.notOk(originalHandlerWasCalled, 'the parent handler was not called'); + }; + + _class2.prototype['@test it should allow "send" as the action name (#594)'] = function testItShouldAllowSendAsTheActionName594() { + var _this21 = this; + + var sendHandlerWasCalled = false; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + send: function () { + sendHandlerWasCalled = true; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'click me' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this21.$('a').click(); + }); + + this.assert.ok(sendHandlerWasCalled, 'the event handler was called'); + }; + + _class2.prototype['@test it should send the view, event, and current context to the action'] = function testItShouldSendTheViewEventAndCurrentContextToTheAction() { + var _this22 = this; + + var passedTarget = undefined; + var passedContext = undefined; + var targetThis = undefined; + + var TargetComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + targetThis = this; + }, + actions: { + edit: function (context) { + passedTarget = this === targetThis; + passedContext = context; + } + } + }); + + var aContext = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + aContext = this; + } + }); + + this.registerComponent('target-component', { + ComponentClass: TargetComponent, + template: '{{yield this}}' + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3) + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this22.$('#edit').click(); + }); + + this.assert.ok(passedTarget, 'the action is called with the target as this'); + this.assert.strictEqual(passedContext, aContext, 'the parameter is passed along'); + }; + + _class2.prototype['@test it should only trigger actions for the event they were registered on'] = function testItShouldOnlyTriggerActionsForTheEventTheyWereRegisteredOn() { + var _this23 = this; + + var editHandlerWasCalled = false; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + edit: function () { + editHandlerWasCalled = true; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'click me' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this23.$('a').click(); + }); + + this.assert.ok(editHandlerWasCalled, 'the event handler was called on click'); + + editHandlerWasCalled = false; + + this.runTask(function () { + _this23.$('a').trigger('mouseover'); + }); + + this.assert.notOk(editHandlerWasCalled, 'the event handler was not called on mouseover'); + }; + + _class2.prototype['@test it should allow multiple contexts to be specified'] = function testItShouldAllowMultipleContextsToBeSpecified() { + var _this24 = this; + + var passedContexts = undefined; + var models = [_emberRuntime.Object.create(), _emberRuntime.Object.create()]; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + modelA: models[0], + modelB: models[1], + actions: { + edit: function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + passedContexts = args; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this24.$('button').click(); + }); + + this.assert.deepEqual(passedContexts, models, 'the action was called with the passed contexts'); + }; + + _class2.prototype['@test it should allow multiple contexts to be specified mixed with string args'] = function testItShouldAllowMultipleContextsToBeSpecifiedMixedWithStringArgs() { + var _this25 = this; + + var passedContexts = undefined; + var model = _emberRuntime.Object.create(); + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + model: model, + actions: { + edit: function () { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + passedContexts = args; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this25.$('button').click(); + }); + + this.assert.deepEqual(passedContexts, ['herp', model], 'the action was called with the passed contexts'); + }; + + _class2.prototype['@test it should not trigger action with special clicks'] = function testItShouldNotTriggerActionWithSpecialClicks() { + var showCalled = false; + var component = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + actions: { + show: function () { + showCalled = true; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '' + }); + + this.render('{{example-component}}'); + + var assert = this.assert; + + function checkClick(prop, value, expected) { + var event = _emberViews.jQuery.Event('click'); + event[prop] = value; + + component.$('button').trigger(event); + + if (expected) { + assert.ok(showCalled, 'should call action with ' + prop + ':' + value); + assert.ok(event.isDefaultPrevented(), 'should prevent default'); + } else { + assert.notOk(showCalled, 'should not call action with ' + prop + ':' + value); + assert.notOk(event.isDefaultPrevented(), 'should not prevent default'); + } + } + + checkClick('ctrlKey', true, false); + checkClick('altKey', true, false); + checkClick('metaKey', true, false); + checkClick('shiftKey', true, false); + checkClick('which', 2, false); + + checkClick('which', 1, true); + checkClick('which', undefined, true); // IE <9 + }; + + _class2.prototype['@test it can trigger actions for keyboard events'] = function testItCanTriggerActionsForKeyboardEvents() { + var _this26 = this; + + var showCalled = false; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + show: function () { + showCalled = true; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + var event = _emberViews.jQuery.Event('keyup'); + event.char = 'a'; + event.which = 65; + _this26.$('input').trigger(event); + }); + + this.assert.ok(showCalled, 'the action was called with keyup'); + }; + + _class2.prototype['@test a quoteless parameter should allow dynamic lookup of the actionName'] = function testAQuotelessParameterShouldAllowDynamicLookupOfTheActionName() { + var lastAction = undefined; + var actionOrder = []; + var component = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + hookMeUp: 'rock', + actions: { + rock: function () { + lastAction = 'rock'; + actionOrder.push('rock'); + }, + paper: function () { + lastAction = 'paper'; + actionOrder.push('paper'); + }, + scissors: function () { + lastAction = 'scissors'; + actionOrder.push('scissors'); + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'Whistle tips go woop woooop' + }); + + this.render('{{example-component}}'); + + var test = this; + + function testBoundAction(propertyValue) { + test.runTask(function () { + component.set('hookMeUp', propertyValue); + }); + + test.runTask(function () { + component.$('#bound-param').click(); + }); + + test.assert.ok(lastAction, propertyValue, 'lastAction set to ' + propertyValue); + } + + testBoundAction('rock'); + testBoundAction('paper'); + testBoundAction('scissors'); + + this.assert.deepEqual(actionOrder, ['rock', 'paper', 'scissors'], 'action name was looked up properly'); + }; + + _class2.prototype['@test a quoteless string parameter should resolve actionName, including path'] = function testAQuotelessStringParameterShouldResolveActionNameIncludingPath() { + var lastAction = undefined; + var actionOrder = []; + var component = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + allactions: _emberRuntime.A([{ title: 'Rock', name: 'rock' }, { title: 'Paper', name: 'paper' }, { title: 'Scissors', name: 'scissors' }]), + actions: { + rock: function () { + lastAction = 'rock'; + actionOrder.push('rock'); + }, + paper: function () { + lastAction = 'paper'; + actionOrder.push('paper'); + }, + scissors: function () { + lastAction = 'scissors'; + actionOrder.push('scissors'); + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '{{#each allactions as |allaction|}}{{allaction.title}}{{/each}}' + }); + + this.render('{{example-component}}'); + + var test = this; + + function testBoundAction(propertyValue) { + test.runTask(function () { + component.$('#' + propertyValue).click(); + }); + + test.assert.ok(lastAction, propertyValue, 'lastAction set to ' + propertyValue); + } + + testBoundAction('rock'); + testBoundAction('paper'); + testBoundAction('scissors'); + + this.assert.deepEqual(actionOrder, ['rock', 'paper', 'scissors'], 'action name was looked up properly'); + }; + + _class2.prototype['@test a quoteless function parameter should be called, including arguments'] = function testAQuotelessFunctionParameterShouldBeCalledIncludingArguments() { + var _this27 = this; + + var submitCalled = false; + var incomingArg = undefined; + + var arg = 'rough ray'; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + submit: function (actualArg) { + incomingArg = actualArg; + submitCalled = true; + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'Hi' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this27.$('a').click(); + }); + + this.assert.ok(submitCalled, 'submit function called'); + this.assert.equal(incomingArg, arg, 'argument passed'); + }; + + _class2.prototype['@test a quoteless parameter that does not resolve to a value asserts'] = function testAQuotelessParameterThatDoesNotResolveToAValueAsserts() { + var _this28 = this; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + ohNoeNotValid: function () {} + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'Hi' + }); + + expectAssertion(function () { + _this28.render('{{example-component}}'); + }, 'You specified a quoteless path, `ohNoeNotValid`, to the {{action}} helper ' + 'which did not resolve to an action name (a string). ' + 'Perhaps you meant to use a quoted actionName? (e.g. {{action "ohNoeNotValid"}}).'); + }; + + _class2.prototype['@test allows multiple actions on a single element'] = function testAllowsMultipleActionsOnASingleElement() { + var _this29 = this; + + var clickActionWasCalled = false; + var doubleClickActionWasCalled = false; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + clicked: function () { + clickActionWasCalled = true; + }, + doubleClicked: function () { + doubleClickActionWasCalled = true; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4) + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this29.$('a').trigger('click'); + }); + + this.assert.ok(clickActionWasCalled, 'the clicked action was called'); + + this.runTask(function () { + _this29.$('a').trigger('dblclick'); + }); + + this.assert.ok(doubleClickActionWasCalled, 'the doubleClicked action was called'); + }; + + _class2.prototype['@test it should respect preventDefault option if provided'] = function testItShouldRespectPreventDefaultOptionIfProvided() { + var _this30 = this; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + show: function () {} + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'Hi' + }); + + this.render('{{example-component}}'); + + var event = _emberViews.jQuery.Event('click'); + + this.runTask(function () { + _this30.$('a').trigger(event); + }); + + this.assert.equal(event.isDefaultPrevented(), false, 'should not preventDefault'); + }; + + _class2.prototype['@test it should respect preventDefault option if provided bound'] = function testItShouldRespectPreventDefaultOptionIfProvidedBound() { + var _this31 = this; + + var component = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + shouldPreventDefault: false, + init: function () { + this._super.apply(this, arguments); + component = this; + }, + actions: { + show: function () {} + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'Hi' + }); + + this.render('{{example-component}}'); + + var event = _emberViews.jQuery.Event('click'); + + this.runTask(function () { + _this31.$('a').trigger(event); + }); + + this.assert.equal(event.isDefaultPrevented(), false, 'should not preventDefault'); + + event = _emberViews.jQuery.Event('click'); + + this.runTask(function () { + component.set('shouldPreventDefault', true); + _this31.$('a').trigger(event); + }); + + this.assert.equal(event.isDefaultPrevented(), true, 'should preventDefault'); + }; + + _class2.prototype['@test it should target the proper component when `action` is in yielded block [GH #12409]'] = function testItShouldTargetTheProperComponentWhenActionIsInYieldedBlockGH12409() { + var _this32 = this; + + var outerActionCalled = false; + var innerClickCalled = false; + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + hey: function () { + outerActionCalled = true; + } + } + }); + + var MiddleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({}); + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + click: function () { + innerClickCalled = true; + this.sendAction(); + } + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5) + }); + + this.registerComponent('middle-component', { + ComponentClass: MiddleComponent, + template: '{{yield}}' + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject6) + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + _this32.$('button').click(); + }); + + this.assert.ok(outerActionCalled, 'the action fired on the proper target'); + this.assert.ok(innerClickCalled, 'the click was triggered'); + }; + + _class2.prototype['@test element action with (mut undefinedThing) works properly'] = function testElementActionWithMutUndefinedThingWorksProperly() { + var _this33 = this; + + var component = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + label: undefined, + init: function () { + this._super.apply(this, arguments); + component = this; + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '' + }); + + this.render('{{example-component}}'); + + this.assertText('Click me'); + + this.assertStableRerender(); + + this.runTask(function () { + _this33.$('button').click(); + }); + + this.assertText('Clicked!'); + + this.runTask(function () { + component.set('label', 'Dun clicked'); + }); + + this.assertText('Dun clicked'); + + this.runTask(function () { + _this33.$('button').click(); + }); + + this.assertText('Clicked!'); + + this.runTask(function () { + component.set('label', undefined); + }); + + this.assertText('Click me'); + }; + + return _class2; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/element-action-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/element-action-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/element-action-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/element-action-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/element-action-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/element-action-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/get-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{get}}', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test should be able to get an object value with a static key'] = function testShouldBeAbleToGetAnObjectValueWithAStaticKey() { + var _this = this; + + this.render('[{{get colors \'apple\'}}] [{{if true (get colors \'apple\')}}]', { + colors: { apple: 'red' } + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'colors.apple', 'green'); + }); + + this.assertText('[green] [green]'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'colors', { + apple: 'red' + }); + }); + + this.assertText('[red] [red]'); + }; + + _class.prototype['@test should be able to get an object value with nested static key'] = function testShouldBeAbleToGetAnObjectValueWithNestedStaticKey() { + var _this2 = this; + + this.render('[{{get colors "apple.gala"}}] [{{if true (get colors "apple.gala")}}]', { + colors: { + apple: { + gala: 'red and yellow' + } + } + }); + + this.assertText('[red and yellow] [red and yellow]'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertText('[red and yellow] [red and yellow]'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'colors.apple.gala', 'yellow and red striped'); + }); + + this.assertText('[yellow and red striped] [yellow and red striped]'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'colors', { apple: { gala: 'red and yellow' } }); + }); + + this.assertText('[red and yellow] [red and yellow]'); + }; + + _class.prototype['@test should be able to get an object value with a bound/dynamic key'] = function testShouldBeAbleToGetAnObjectValueWithABoundDynamicKey() { + var _this3 = this; + + this.render('[{{get colors key}}] [{{if true (get colors key)}}]', { + colors: { apple: 'red', banana: 'yellow' }, + key: 'apple' + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'key', 'banana'); + }); + + this.assertText('[yellow] [yellow]'); + + this.runTask(function () { + _emberMetal.set(_this3.context, 'colors.apple', 'green'); + _emberMetal.set(_this3.context, 'colors.banana', 'purple'); + }); + + this.assertText('[purple] [purple]'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'key', 'apple'); + }); + + this.assertText('[green] [green]'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'colors', { apple: 'red' }); + }); + + this.assertText('[red] [red]'); + }; + + _class.prototype['@test should be able to get an object value with nested dynamic key'] = function testShouldBeAbleToGetAnObjectValueWithNestedDynamicKey() { + var _this4 = this; + + this.render('[{{get colors key}}] [{{if true (get colors key)}}]', { + colors: { + apple: { + gala: 'red and yellow', + mcintosh: 'red' + }, + banana: 'yellow' + }, + key: 'apple.gala' + }); + + this.assertText('[red and yellow] [red and yellow]'); + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assertText('[red and yellow] [red and yellow]'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'key', 'apple.mcintosh'); + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'key', 'banana'); + }); + + this.assertText('[yellow] [yellow]'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'key', 'apple.gala'); + }); + + this.assertText('[red and yellow] [red and yellow]'); + }; + + _class.prototype['@test should be able to get an object value with subexpression returning nested key'] = function testShouldBeAbleToGetAnObjectValueWithSubexpressionReturningNestedKey() { + var _this5 = this; + + this.render('[{{get colors (concat \'apple\' \'.\' \'gala\')}}] [{{if true (get colors (concat \'apple\' \'.\' \'gala\'))}}]', { + colors: { + apple: { + gala: 'red and yellow', + mcintosh: 'red' + } + }, + key: 'apple.gala' + }); + + this.assertText('[red and yellow] [red and yellow]'); + + this.runTask(function () { + return _this5.rerender(); + }); + + this.assertText('[red and yellow] [red and yellow]'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'colors.apple.gala', 'yellow and red striped'); + }); + + this.assertText('[yellow and red striped] [yellow and red striped]'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'colors.apple.gala', 'yellow-redish'); + }); + + this.assertText('[yellow-redish] [yellow-redish]'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'colors', { + apple: { + gala: 'red and yellow', + mcintosh: 'red' + } + }); + }); + + this.assertText('[red and yellow] [red and yellow]'); + }; + + _class.prototype['@test should be able to get an object value with a get helper as the key'] = function testShouldBeAbleToGetAnObjectValueWithAGetHelperAsTheKey() { + var _this6 = this; + + this.render('[{{get colors (get possibleKeys key)}}] [{{if true (get colors (get possibleKeys key))}}]', { + colors: { apple: 'red', banana: 'yellow' }, + key: 'key1', + possibleKeys: { key1: 'apple', key2: 'banana' } + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _this6.rerender(); + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'key', 'key2'); + }); + + this.assertText('[yellow] [yellow]'); + + this.runTask(function () { + _emberMetal.set(_this6.context, 'colors.apple', 'green'); + _emberMetal.set(_this6.context, 'colors.banana', 'purple'); + }); + + this.assertText('[purple] [purple]'); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'key', 'key1'); + }); + + this.assertText('[green] [green]'); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'colors', { apple: 'red', banana: 'yellow' }); + }); + + this.assertText('[red] [red]'); + }; + + _class.prototype['@test should be able to get an object value with a get helper value as a bound/dynamic key'] = function testShouldBeAbleToGetAnObjectValueWithAGetHelperValueAsABoundDynamicKey() { + var _this7 = this; + + this.render('[{{get (get possibleValues objectKey) key}}] [{{if true (get (get possibleValues objectKey) key)}}]', { + possibleValues: { + colors1: { apple: 'red', banana: 'yellow' }, + colors2: { apple: 'green', banana: 'purple' } + }, + objectKey: 'colors1', + key: 'apple' + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'objectKey', 'colors2'); + }); + + this.assertText('[green] [green]'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'objectKey', 'colors1'); + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'key', 'banana'); + }); + + this.assertText('[yellow] [yellow]'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'objectKey', 'colors2'); + }); + + this.assertText('[purple] [purple]'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'objectKey', 'colors1'); + }); + + this.assertText('[yellow] [yellow]'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'key', 'apple'); + }); + }; + + _class.prototype['@test should be able to get an object value with a get helper as the value and a get helper as the key'] = function testShouldBeAbleToGetAnObjectValueWithAGetHelperAsTheValueAndAGetHelperAsTheKey() { + var _this8 = this; + + this.render('[{{get (get possibleValues objectKey) (get possibleKeys key)}}] [{{if true (get (get possibleValues objectKey) (get possibleKeys key))}}]', { + possibleValues: { + colors1: { apple: 'red', banana: 'yellow' }, + colors2: { apple: 'green', banana: 'purple' } + }, + objectKey: 'colors1', + possibleKeys: { + key1: 'apple', + key2: 'banana' + }, + key: 'key1' + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _this8.rerender(); + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _emberMetal.set(_this8.context, 'objectKey', 'colors2'); + }); + + this.assertText('[green] [green]'); + + this.runTask(function () { + return _emberMetal.set(_this8.context, 'objectKey', 'colors1'); + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _emberMetal.set(_this8.context, 'key', 'key2'); + }); + + this.assertText('[yellow] [yellow]'); + + this.runTask(function () { + return _emberMetal.set(_this8.context, 'objectKey', 'colors2'); + }); + + this.assertText('[purple] [purple]'); + + this.runTask(function () { + _emberMetal.set(_this8.context, 'objectKey', 'colors1'); + _emberMetal.set(_this8.context, 'key', 'key1'); + }); + + this.assertText('[red] [red]'); + }; + + _class.prototype['@test the result of a get helper can be yielded'] = function testTheResultOfAGetHelperCanBeYielded() { + var _this9 = this; + + var fooBarInstance = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + fooBarInstance = this; + this.mcintosh = 'red'; + } + }); + + this.registerComponent('foo-bar', { + ComponentClass: FooBarComponent, + template: '{{yield (get colors mcintosh)}}' + }); + + this.render('{{#foo-bar colors=colors as |value|}}{{value}}{{/foo-bar}}', { + colors: { + red: 'banana' + } + }); + + this.assertText('banana'); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertText('banana'); + + this.runTask(function () { + _emberMetal.set(fooBarInstance, 'mcintosh', 'yellow'); + _emberMetal.set(_this9.context, 'colors', { yellow: 'bus' }); + }); + + this.assertText('bus'); + + this.runTask(function () { + _emberMetal.set(fooBarInstance, 'mcintosh', 'red'); + _emberMetal.set(_this9.context, 'colors', { red: 'banana' }); + }); + + this.assertText('banana'); + }; + + _class.prototype['@test should handle object values as nulls'] = function testShouldHandleObjectValuesAsNulls() { + var _this10 = this; + + this.render('[{{get colors \'apple\'}}] [{{if true (get colors \'apple\')}}]', { + colors: null + }); + + this.assertText('[] []'); + + this.runTask(function () { + return _this10.rerender(); + }); + + this.assertText('[] []'); + + this.runTask(function () { + return _emberMetal.set(_this10.context, 'colors', { apple: 'green', banana: 'purple' }); + }); + + this.assertText('[green] [green]'); + + this.runTask(function () { + return _emberMetal.set(_this10.context, 'colors', null); + }); + + this.assertText('[] []'); + }; + + _class.prototype['@test should handle object keys as nulls'] = function testShouldHandleObjectKeysAsNulls() { + var _this11 = this; + + this.render('[{{get colors key}}] [{{if true (get colors key)}}]', { + colors: { + apple: 'red', + banana: 'yellow' + }, + key: null + }); + + this.assertText('[] []'); + + this.runTask(function () { + return _this11.rerender(); + }); + + this.assertText('[] []'); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'key', 'banana'); + }); + + this.assertText('[yellow] [yellow]'); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'key', null); + }); + + this.assertText('[] []'); + }; + + _class.prototype['@test should handle object values and keys as nulls'] = function testShouldHandleObjectValuesAndKeysAsNulls() { + this.render('[{{get colors \'apple\'}}] [{{if true (get colors key)}}]', { + colors: null, + key: null + }); + + this.assertText('[] []'); + }; + + _class.prototype['@test get helper value should be updatable using {{input}} and (mut) - static key'] = function testGetHelperValueShouldBeUpdatableUsingInputAndMutStaticKey(assert) { + var _this12 = this; + + this.render('{{input type=\'text\' value=(mut (get source \'banana\')) id=\'get-input\'}}', { + source: { + banana: 'banana' + } + }); + + assert.strictEqual(this.$('#get-input').val(), 'banana'); + + this.runTask(function () { + return _this12.rerender(); + }); + + assert.strictEqual(this.$('#get-input').val(), 'banana'); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'source.banana', 'yellow'); + }); + + assert.strictEqual(this.$('#get-input').val(), 'yellow'); + + this.runTask(function () { + return _this12.$('#get-input').val('some value').trigger('change'); + }); + + assert.strictEqual(this.$('#get-input').val(), 'some value'); + assert.strictEqual(_emberMetal.get(this.context, 'source.banana'), 'some value'); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'source', { banana: 'banana' }); + }); + + assert.strictEqual(this.$('#get-input').val(), 'banana'); + }; + + _class.prototype['@test get helper value should be updatable using {{input}} and (mut) - dynamic key'] = function testGetHelperValueShouldBeUpdatableUsingInputAndMutDynamicKey(assert) { + var _this13 = this; + + this.render('{{input type=\'text\' value=(mut (get source key)) id=\'get-input\'}}', { + source: { + apple: 'apple', + banana: 'banana' + }, + key: 'banana' + }); + + assert.strictEqual(this.$('#get-input').val(), 'banana'); + + this.runTask(function () { + return _this13.rerender(); + }); + + assert.strictEqual(this.$('#get-input').val(), 'banana'); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'source.banana', 'yellow'); + }); + + assert.strictEqual(this.$('#get-input').val(), 'yellow'); + + this.runTask(function () { + return _this13.$('#get-input').val('some value').trigger('change'); + }); + + assert.strictEqual(this.$('#get-input').val(), 'some value'); + assert.strictEqual(_emberMetal.get(this.context, 'source.banana'), 'some value'); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'key', 'apple'); + }); + + assert.strictEqual(this.$('#get-input').val(), 'apple'); + + this.runTask(function () { + return _this13.$('#get-input').val('some other value').trigger('change'); + }); + + assert.strictEqual(this.$('#get-input').val(), 'some other value'); + assert.strictEqual(_emberMetal.get(this.context, 'source.apple'), 'some other value'); + + this.runTask(function () { + _emberMetal.set(_this13.context, 'key', 'banana'); + _emberMetal.set(_this13.context, 'source', { banana: 'banana' }); + }); + + assert.strictEqual(this.$('#get-input').val(), 'banana'); + }; + + _class.prototype['@test get helper value should be updatable using {{input}} and (mut) - dynamic nested key'] = function testGetHelperValueShouldBeUpdatableUsingInputAndMutDynamicNestedKey(assert) { + var _this14 = this; + + this.render('{{input type=\'text\' value=(mut (get source key)) id=\'get-input\'}}', { + source: { + apple: { + gala: 'gala', + mcintosh: 'mcintosh' + }, + banana: 'banana' + }, + key: 'apple.mcintosh' + }); + + assert.strictEqual(this.$('#get-input').val(), 'mcintosh'); + + this.runTask(function () { + return _this14.rerender(); + }); + + assert.strictEqual(this.$('#get-input').val(), 'mcintosh'); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'source.apple.mcintosh', 'red'); + }); + + assert.strictEqual(this.$('#get-input').val(), 'red'); + + this.runTask(function () { + return _this14.$('#get-input').val('some value').trigger('change'); + }); + + assert.strictEqual(this.$('#get-input').val(), 'some value'); + assert.strictEqual(_emberMetal.get(this.context, 'source.apple.mcintosh'), 'some value'); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'key', 'apple.gala'); + }); + + assert.strictEqual(this.$('#get-input').val(), 'gala'); + + this.runTask(function () { + return _this14.$('#get-input').val('some other value').trigger('change'); + }); + + assert.strictEqual(this.$('#get-input').val(), 'some other value'); + assert.strictEqual(_emberMetal.get(this.context, 'source.apple.gala'), 'some other value'); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'key', 'banana'); + }); + + assert.strictEqual(this.$('#get-input').val(), 'banana'); + + this.runTask(function () { + return _this14.$('#get-input').val('yet another value').trigger('change'); + }); + + assert.strictEqual(this.$('#get-input').val(), 'yet another value'); + assert.strictEqual(_emberMetal.get(this.context, 'source.banana'), 'yet another value'); + + this.runTask(function () { + _emberMetal.set(_this14.context, 'key', 'apple.mcintosh'); + _emberMetal.set(_this14.context, 'source', { + apple: { + gala: 'gala', + mcintosh: 'mcintosh' + }, + banana: 'banana' + }); + }); + + assert.strictEqual(this.$('#get-input').val(), 'mcintosh'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/get-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/get-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/get-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/get-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/get-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/get-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/hash-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{hash}}', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test returns a hash with the right key-value'] = function testReturnsAHashWithTheRightKeyValue() { + var _this = this; + + this.render('{{#with (hash name="Sergio") as |person|}}{{person.name}}{{/with}}'); + + this.assertText('Sergio'); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertText('Sergio'); + }; + + _class.prototype['@test can have more than one key-value'] = function testCanHaveMoreThanOneKeyValue() { + var _this2 = this; + + this.render('{{#with (hash name="Sergio" lastName="Arbeo") as |person|}}{{person.name}} {{person.lastName}}{{/with}}'); + + this.assertText('Sergio Arbeo'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertText('Sergio Arbeo'); + }; + + _class.prototype['@test binds values when variables are used'] = function testBindsValuesWhenVariablesAreUsed() { + var _this3 = this; + + this.render('{{#with (hash name=model.firstName lastName="Arbeo") as |person|}}{{person.name}} {{person.lastName}}{{/with}}', { + model: { + firstName: 'Marisa' + } + }); + + this.assertText('Marisa Arbeo'); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertText('Marisa Arbeo'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'model.firstName', 'Sergio'); + }); + + this.assertText('Sergio Arbeo'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'model', { firstName: 'Marisa' }); + }); + + this.assertText('Marisa Arbeo'); + }; + + _class.prototype['@test binds multiple values when variables are used'] = function testBindsMultipleValuesWhenVariablesAreUsed() { + var _this4 = this; + + this.render('{{#with (hash name=model.firstName lastName=model.lastName) as |person|}}{{person.name}} {{person.lastName}}{{/with}}', { + model: { + firstName: 'Marisa', + lastName: 'Arbeo' + } + }); + + this.assertText('Marisa Arbeo'); + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assertText('Marisa Arbeo'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'model.firstName', 'Sergio'); + }); + + this.assertText('Sergio Arbeo'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'model.lastName', 'Smith'); + }); + + this.assertText('Sergio Smith'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'model', { + firstName: 'Marisa', + lastName: 'Arbeo' + }); + }); + + this.assertText('Marisa Arbeo'); + }; + + _class.prototype['@test hash helpers can be nested'] = function testHashHelpersCanBeNested() { + var _this5 = this; + + this.render('{{#with (hash person=(hash name=model.firstName)) as |ctx|}}{{ctx.person.name}}{{/with}}', { + model: { firstName: 'Balint' } + }); + + this.assertText('Balint'); + + this.runTask(function () { + return _this5.rerender(); + }); + + this.assertText('Balint'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'model.firstName', 'Chad'); + }); + + this.assertText('Chad'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'model', { firstName: 'Balint' }); + }); + + this.assertText('Balint'); + }; + + _class.prototype['@test should yield hash of internal properties'] = function testShouldYieldHashOfInternalProperties() { + var _this6 = this; + + var fooBarInstance = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + fooBarInstance = this; + this.model = { firstName: 'Chad' }; + } + }); + + this.registerComponent('foo-bar', { + ComponentClass: FooBarComponent, + template: '{{yield (hash firstName=model.firstName)}}' + }); + + this.render('{{#foo-bar as |values|}}{{values.firstName}}{{/foo-bar}}'); + + this.assertText('Chad'); + + this.runTask(function () { + return _this6.rerender(); + }); + + this.assertText('Chad'); + + this.runTask(function () { + return _emberMetal.set(fooBarInstance, 'model.firstName', 'Godfrey'); + }); + + this.assertText('Godfrey'); + + this.runTask(function () { + return _emberMetal.set(fooBarInstance, 'model', { firstName: 'Chad' }); + }); + + this.assertText('Chad'); + }; + + _class.prototype['@test should yield hash of internal and external properties'] = function testShouldYieldHashOfInternalAndExternalProperties() { + var _this7 = this; + + var fooBarInstance = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + fooBarInstance = this; + this.model = { firstName: 'Chad' }; + } + }); + + this.registerComponent('foo-bar', { + ComponentClass: FooBarComponent, + template: '{{yield (hash firstName=model.firstName lastName=lastName)}}' + }); + + this.render('{{#foo-bar lastName=model.lastName as |values|}}{{values.firstName}} {{values.lastName}}{{/foo-bar}}', { + model: { lastName: 'Hietala' } + }); + + this.assertText('Chad Hietala'); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertText('Chad Hietala'); + + this.runTask(function () { + _emberMetal.set(fooBarInstance, 'model.firstName', 'Godfrey'); + _emberMetal.set(_this7.context, 'model.lastName', 'Chan'); + }); + + this.assertText('Godfrey Chan'); + + this.runTask(function () { + _emberMetal.set(fooBarInstance, 'model', { firstName: 'Chad' }); + _emberMetal.set(_this7.context, 'model', { lastName: 'Hietala' }); + }); + + this.assertText('Chad Hietala'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/hash-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/hash-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/hash-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/hash-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/hash-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/hash-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/if-unless-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/shared-conditional-tests'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsSharedConditionalTests) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: inline {{if}}', (function (_IfUnlessHelperTest) { + babelHelpers.inherits(_class, _IfUnlessHelperTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _IfUnlessHelperTest.apply(this, arguments); + } + + _class.prototype.templateFor = function templateFor(_ref) { + var cond = _ref.cond; + var truthy = _ref.truthy; + var falsy = _ref.falsy; + + return '{{if ' + cond + ' ' + truthy + ' ' + falsy + '}}'; + }; + + _class.prototype['@test it raises when there are more than three arguments'] = function testItRaisesWhenThereAreMoreThanThreeArguments() { + var _this = this; + + expectAssertion(function () { + _this.render('{{if condition \'a\' \'b\' \'c\'}}', { condition: true }); + }, /The inline form of the `if` helper expects two or three arguments/); + }; + + _class.prototype['@test it raises when there are less than two arguments'] = function testItRaisesWhenThereAreLessThanTwoArguments() { + var _this2 = this; + + expectAssertion(function () { + _this2.render('{{if condition}}', { condition: true }); + }, /The inline form of the `if` helper expects two or three arguments/); + }; + + return _class; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessHelperTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: nested {{if}} helpers (returning truthy values)', (function (_IfUnlessHelperTest2) { + babelHelpers.inherits(_class2, _IfUnlessHelperTest2); + + function _class2() { + babelHelpers.classCallCheck(this, _class2); + + _IfUnlessHelperTest2.apply(this, arguments); + } + + _class2.prototype.templateFor = function templateFor(_ref2) { + var cond = _ref2.cond; + var truthy = _ref2.truthy; + var falsy = _ref2.falsy; + + return '{{if (if ' + cond + ' ' + cond + ' false) ' + truthy + ' ' + falsy + '}}'; + }; + + return _class2; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessHelperTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: nested {{if}} helpers (returning falsy values)', (function (_IfUnlessHelperTest3) { + babelHelpers.inherits(_class3, _IfUnlessHelperTest3); + + function _class3() { + babelHelpers.classCallCheck(this, _class3); + + _IfUnlessHelperTest3.apply(this, arguments); + } + + _class3.prototype.templateFor = function templateFor(_ref3) { + var cond = _ref3.cond; + var truthy = _ref3.truthy; + var falsy = _ref3.falsy; + + return '{{if (if ' + cond + ' true ' + cond + ') ' + truthy + ' ' + falsy + '}}'; + }; + + return _class3; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessHelperTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{if}} used with another helper', (function (_IfUnlessHelperTest4) { + babelHelpers.inherits(_class4, _IfUnlessHelperTest4); + + function _class4() { + babelHelpers.classCallCheck(this, _class4); + + _IfUnlessHelperTest4.apply(this, arguments); + } + + _class4.prototype.wrapperFor = function wrapperFor(templates) { + return '{{concat ' + templates.join(' ') + '}}'; + }; + + _class4.prototype.templateFor = function templateFor(_ref4) { + var cond = _ref4.cond; + var truthy = _ref4.truthy; + var falsy = _ref4.falsy; + + return '(if ' + cond + ' ' + truthy + ' ' + falsy + ')'; + }; + + return _class4; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessHelperTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{if}} used in attribute position', (function (_IfUnlessHelperTest5) { + babelHelpers.inherits(_class5, _IfUnlessHelperTest5); + + function _class5() { + babelHelpers.classCallCheck(this, _class5); + + _IfUnlessHelperTest5.apply(this, arguments); + } + + _class5.prototype.wrapperFor = function wrapperFor(templates) { + return '
'; + }; + + _class5.prototype.templateFor = function templateFor(_ref5) { + var cond = _ref5.cond; + var truthy = _ref5.truthy; + var falsy = _ref5.falsy; + + return '{{if ' + cond + ' ' + truthy + ' ' + falsy + '}}'; + }; + + _class5.prototype.textValue = function textValue() { + return this.$('div').attr('data-foo'); + }; + + return _class5; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessHelperTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: inline {{if}} and {{unless}} without the inverse argument', (function (_IfUnlessHelperTest6) { + babelHelpers.inherits(_class6, _IfUnlessHelperTest6); + + function _class6() { + babelHelpers.classCallCheck(this, _class6); + + _IfUnlessHelperTest6.apply(this, arguments); + } + + _class6.prototype.templateFor = function templateFor(_ref6) { + var cond = _ref6.cond; + var truthy = _ref6.truthy; + var falsy = _ref6.falsy; + + return '{{if ' + cond + ' ' + truthy + '}}{{unless ' + cond + ' ' + falsy + '}}'; + }; + + return _class6; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessHelperTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: inline {{unless}}', (function (_IfUnlessHelperTest7) { + babelHelpers.inherits(_class7, _IfUnlessHelperTest7); + + function _class7() { + babelHelpers.classCallCheck(this, _class7); + + _IfUnlessHelperTest7.apply(this, arguments); + } + + _class7.prototype.templateFor = function templateFor(_ref7) { + var cond = _ref7.cond; + var truthy = _ref7.truthy; + var falsy = _ref7.falsy; + + return '{{unless ' + cond + ' ' + falsy + ' ' + truthy + '}}'; + }; + + _class7.prototype['@test it raises when there are more than three arguments'] = function testItRaisesWhenThereAreMoreThanThreeArguments() { + var _this3 = this; + + expectAssertion(function () { + _this3.render('{{unless condition \'a\' \'b\' \'c\'}}', { condition: true }); + }, /The inline form of the `unless` helper expects two or three arguments/); + }; + + _class7.prototype['@test it raises when there are less than two arguments'] = function testItRaisesWhenThereAreLessThanTwoArguments() { + var _this4 = this; + + expectAssertion(function () { + _this4.render('{{unless condition}}', { condition: true }); + }, /The inline form of the `unless` helper expects two or three arguments/); + }; + + return _class7; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessHelperTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: nested {{unless}} helpers (returning truthy values)', (function (_IfUnlessHelperTest8) { + babelHelpers.inherits(_class8, _IfUnlessHelperTest8); + + function _class8() { + babelHelpers.classCallCheck(this, _class8); + + _IfUnlessHelperTest8.apply(this, arguments); + } + + _class8.prototype.templateFor = function templateFor(_ref8) { + var cond = _ref8.cond; + var truthy = _ref8.truthy; + var falsy = _ref8.falsy; + + return '{{unless (unless ' + cond + ' false ' + cond + ') ' + falsy + ' ' + truthy + '}}'; + }; + + return _class8; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessHelperTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: nested {{unless}} helpers (returning falsy values)', (function (_IfUnlessHelperTest9) { + babelHelpers.inherits(_class9, _IfUnlessHelperTest9); + + function _class9() { + babelHelpers.classCallCheck(this, _class9); + + _IfUnlessHelperTest9.apply(this, arguments); + } + + _class9.prototype.templateFor = function templateFor(_ref9) { + var cond = _ref9.cond; + var truthy = _ref9.truthy; + var falsy = _ref9.falsy; + + return '{{unless (unless ' + cond + ' ' + cond + ' true) ' + falsy + ' ' + truthy + '}}'; + }; + + return _class9; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessHelperTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{unless}} used with another helper', (function (_IfUnlessHelperTest10) { + babelHelpers.inherits(_class10, _IfUnlessHelperTest10); + + function _class10() { + babelHelpers.classCallCheck(this, _class10); + + _IfUnlessHelperTest10.apply(this, arguments); + } + + _class10.prototype.wrapperFor = function wrapperFor(templates) { + return '{{concat ' + templates.join(' ') + '}}'; + }; + + _class10.prototype.templateFor = function templateFor(_ref10) { + var cond = _ref10.cond; + var truthy = _ref10.truthy; + var falsy = _ref10.falsy; + + return '(unless ' + cond + ' ' + falsy + ' ' + truthy + ')'; + }; + + return _class10; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessHelperTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{unless}} used in attribute position', (function (_IfUnlessHelperTest11) { + babelHelpers.inherits(_class11, _IfUnlessHelperTest11); + + function _class11() { + babelHelpers.classCallCheck(this, _class11); + + _IfUnlessHelperTest11.apply(this, arguments); + } + + _class11.prototype.wrapperFor = function wrapperFor(templates) { + return '
'; + }; + + _class11.prototype.templateFor = function templateFor(_ref11) { + var cond = _ref11.cond; + var truthy = _ref11.truthy; + var falsy = _ref11.falsy; + + return '{{unless ' + cond + ' ' + falsy + ' ' + truthy + '}}'; + }; + + _class11.prototype.textValue = function textValue() { + return this.$('div').attr('data-foo'); + }; + + return _class11; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessHelperTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/if-unless-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/if-unless-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/if-unless-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/if-unless-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/if-unless-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/if-unless-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember-utils', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/test-case', 'internal-test-helpers'], function (exports, _emberUtils, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsTestCase, _internalTestHelpers) { + 'use strict'; + + var InputRenderingTest = (function (_RenderingTest) { + babelHelpers.inherits(InputRenderingTest, _RenderingTest); + + function InputRenderingTest() { + babelHelpers.classCallCheck(this, InputRenderingTest); + + _RenderingTest.call(this); + + this.registerComponent('-text-field', { ComponentClass: _emberGlimmerTestsUtilsHelpers.TextField }); + this.registerComponent('-checkbox', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Checkbox }); + } + + InputRenderingTest.prototype.$input = function $input() { + return this.$('input'); + }; + + InputRenderingTest.prototype.inputID = function inputID() { + return this.$input().prop('id'); + }; + + InputRenderingTest.prototype.assertDisabled = function assertDisabled() { + this.assert.ok(this.$('input').prop('disabled'), 'The input is disabled'); + }; + + InputRenderingTest.prototype.assertNotDisabled = function assertNotDisabled() { + this.assert.ok(this.$('input').is(':not(:disabled)'), 'The input is not disabled'); + }; + + InputRenderingTest.prototype.assertInputId = function assertInputId(expectedId) { + this.assert.equal(this.inputID(), expectedId, 'the input id should be `expectedId`'); + }; + + InputRenderingTest.prototype.assertSingleInput = function assertSingleInput() { + this.assert.equal(this.$('input').length, 1, 'A single text field was inserted'); + }; + + InputRenderingTest.prototype.assertSingleCheckbox = function assertSingleCheckbox() { + this.assert.equal(this.$('input[type=checkbox]').length, 1, 'A single checkbox is added'); + }; + + InputRenderingTest.prototype.assertCheckboxIsChecked = function assertCheckboxIsChecked() { + this.assert.equal(this.$input().prop('checked'), true, 'the checkbox is checked'); + }; + + InputRenderingTest.prototype.assertCheckboxIsNotChecked = function assertCheckboxIsNotChecked() { + this.assert.equal(this.$input().prop('checked'), false, 'the checkbox is not checked'); + }; + + InputRenderingTest.prototype.assertValue = function assertValue(expected) { + this.assert.equal(this.$input().val(), expected, 'the input value should be ' + expected); + }; + + InputRenderingTest.prototype.assertAttr = function assertAttr(name, expected) { + this.assert.equal(this.$input().attr(name), expected, 'the input ' + name + ' attribute has the value \'' + expected + '\''); + }; + + InputRenderingTest.prototype.assertAllAttrs = function assertAllAttrs(names, expected) { + var _this = this; + + names.forEach(function (name) { + return _this.assertAttr(name, expected); + }); + }; + + InputRenderingTest.prototype.assertSelectionRange = function assertSelectionRange(start, end) { + var input = this.$input()[0]; + this.assert.equal(input.selectionStart, start, 'the cursor start position should be ' + start); + this.assert.equal(input.selectionEnd, end, 'the cursor end position should be ' + end); + }; + + InputRenderingTest.prototype.triggerEvent = function triggerEvent(type, options) { + var event = document.createEvent('Events'); + event.initEvent(type, true, true); + _emberUtils.assign(event, options); + + var element = this.$input()[0]; + this.runTask(function () { + element.dispatchEvent(event); + }); + }; + + return InputRenderingTest; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{input}}', (function (_InputRenderingTest) { + babelHelpers.inherits(_class, _InputRenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _InputRenderingTest.apply(this, arguments); + } + + _class.prototype['@test a single text field is inserted into the DOM'] = function testASingleTextFieldIsInsertedIntoTheDOM(assert) { + var _this2 = this; + + this.render('{{input type="text" value=value}}', { value: 'hello' }); + + var id = this.inputID(); + + this.assertValue('hello'); + this.assertSingleInput(); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertValue('hello'); + this.assertSingleInput(); + this.assertInputId(id); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'value', 'goodbye'); + }); + + this.assertValue('goodbye'); + this.assertSingleInput(); + this.assertInputId(id); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'value', 'hello'); + }); + + this.assertValue('hello'); + this.assertSingleInput(); + this.assertInputId(id); + }; + + _class.prototype['@test default type'] = function testDefaultType() { + var _this3 = this; + + this.render('{{input}}'); + + this.assertAttr('type', 'text'); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertAttr('type', 'text'); + }; + + _class.prototype['@test dynamic attributes'] = function testDynamicAttributes() { + var _this4 = this; + + this.render('\n {{input type="text"\n disabled=disabled\n value=value\n placeholder=placeholder\n name=name\n maxlength=maxlength\n size=size\n tabindex=tabindex\n }}', { + disabled: false, + value: 'Original value', + placeholder: 'Original placeholder', + name: 'original-name', + maxlength: 10, + size: 20, + tabindex: 30 + }); + + this.assertNotDisabled(); + this.assertValue('Original value'); + this.assertAttr('placeholder', 'Original placeholder'); + this.assertAttr('name', 'original-name'); + this.assertAttr('maxlength', '10'); + // this.assertAttr('size', '20'); //NOTE: failing in IE (TEST_SUITE=sauce) + // this.assertAttr('tabindex', '30'); //NOTE: failing in IE (TEST_SUITE=sauce) + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assertNotDisabled(); + this.assertValue('Original value'); + this.assertAttr('placeholder', 'Original placeholder'); + this.assertAttr('name', 'original-name'); + this.assertAttr('maxlength', '10'); + // this.assertAttr('size', '20'); //NOTE: failing in IE (TEST_SUITE=sauce) + // this.assertAttr('tabindex', '30'); //NOTE: failing in IE (TEST_SUITE=sauce) + + this.runTask(function () { + _emberMetal.set(_this4.context, 'value', 'Updated value'); + _emberMetal.set(_this4.context, 'disabled', true); + _emberMetal.set(_this4.context, 'placeholder', 'Updated placeholder'); + _emberMetal.set(_this4.context, 'name', 'updated-name'); + _emberMetal.set(_this4.context, 'maxlength', 11); + // set(this.context, 'size', 21); //NOTE: failing in IE (TEST_SUITE=sauce) + // set(this.context, 'tabindex', 31); //NOTE: failing in IE (TEST_SUITE=sauce) + }); + + this.assertDisabled(); + this.assertValue('Updated value'); + this.assertAttr('placeholder', 'Updated placeholder'); + this.assertAttr('name', 'updated-name'); + this.assertAttr('maxlength', '11'); + // this.assertAttr('size', '21'); //NOTE: failing in IE (TEST_SUITE=sauce) + // this.assertAttr('tabindex', '31'); //NOTE: failing in IE (TEST_SUITE=sauce) + + this.runTask(function () { + _emberMetal.set(_this4.context, 'value', 'Original value'); + _emberMetal.set(_this4.context, 'disabled', false); + _emberMetal.set(_this4.context, 'placeholder', 'Original placeholder'); + _emberMetal.set(_this4.context, 'name', 'original-name'); + _emberMetal.set(_this4.context, 'maxlength', 10); + // set(this.context, 'size', 20); //NOTE: failing in IE (TEST_SUITE=sauce) + // set(this.context, 'tabindex', 30); //NOTE: failing in IE (TEST_SUITE=sauce) + }); + + this.assertNotDisabled(); + this.assertValue('Original value'); + this.assertAttr('placeholder', 'Original placeholder'); + this.assertAttr('name', 'original-name'); + this.assertAttr('maxlength', '10'); + // this.assertAttr('size', '20'); //NOTE: failing in IE (TEST_SUITE=sauce) + // this.assertAttr('tabindex', '30'); //NOTE: failing in IE (TEST_SUITE=sauce) + }; + + _class.prototype['@test static attributes'] = function testStaticAttributes() { + var _this5 = this; + + this.render('\n {{input type="text"\n disabled=true\n value="Original value"\n placeholder="Original placeholder"\n name="original-name"\n maxlength=10\n size=20\n tabindex=30\n }}'); + + this.assertDisabled(); + this.assertValue('Original value'); + this.assertAttr('placeholder', 'Original placeholder'); + this.assertAttr('name', 'original-name'); + this.assertAttr('maxlength', '10'); + // this.assertAttr('size', '20'); //NOTE: failing in IE (TEST_SUITE=sauce) + // this.assertAttr('tabindex', '30'); //NOTE: failing in IE (TEST_SUITE=sauce) + + this.runTask(function () { + return _this5.rerender(); + }); + + this.assertDisabled(); + this.assertValue('Original value'); + this.assertAttr('placeholder', 'Original placeholder'); + this.assertAttr('name', 'original-name'); + this.assertAttr('maxlength', '10'); + // this.assertAttr('size', '20'); //NOTE: failing in IE (TEST_SUITE=sauce) + // this.assertAttr('tabindex', '30'); //NOTE: failing in IE (TEST_SUITE=sauce) + }; + + _class.prototype['@test cursor selection range'] = function testCursorSelectionRange(assert) { + var _this6 = this; + + // Modifying input.selectionStart, which is utilized in the cursor tests, + // causes an event in Safari. + _internalTestHelpers.runDestroy(this.owner.lookup('event_dispatcher:main')); + + this.render('{{input type="text" value=value}}', { value: 'original' }); + + var input = this.$input()[0]; + + // See https://ember-twiddle.com/33e506329f8176ae874422644d4cc08c?openFiles=components.input-component.js%2Ctemplates.components.input-component.hbs + // this.assertSelectionRange(8, 8); //NOTE: this is (0, 0) on Firefox (TEST_SUITE=sauce) + + this.runTask(function () { + return _this6.rerender(); + }); + + // this.assertSelectionRange(8, 8); //NOTE: this is (0, 0) on Firefox (TEST_SUITE=sauce) + + this.runTask(function () { + input.selectionStart = 2; + input.selectionEnd = 4; + }); + + this.assertSelectionRange(2, 4); + + this.runTask(function () { + return _this6.rerender(); + }); + + this.assertSelectionRange(2, 4); + + // this.runTask(() => set(this.context, 'value', 'updated')); + // + // this.assertSelectionRange(7, 7); //NOTE: this fails in IE, the range is 0 -> 0 (TEST_SUITE=sauce) + // + // this.runTask(() => set(this.context, 'value', 'original')); + // + // this.assertSelectionRange(8, 8); //NOTE: this fails in IE, the range is 0 -> 0 (TEST_SUITE=sauce) + }; + + _class.prototype['@test specifying `on="someevent" action="foo"` results in a deprecation warning'] = function testSpecifyingOnSomeeventActionFooResultsInADeprecationWarning() { + var _this7 = this; + + expectDeprecation(function () { + _this7.render('{{input on="focus-in" action="doFoo" value="hello"}}'); + }, 'Using \'{{input on="focus-in" action="doFoo"}}\' (\'-top-level\' @ L1:C0) is deprecated. Please use \'{{input focus-in="doFoo"}}\' instead.'); + }; + + _class.prototype['@test sends an action with `{{input action="foo"}}` when is pressed [DEPRECATED]'] = function testSendsAnActionWithInputActionFooWhenEnterIsPressedDEPRECATED(assert) { + var _this8 = this; + + assert.expect(2); + + expectDeprecation(function () { + _this8.render('{{input action=\'foo\'}}', { + actions: { + foo: function () { + assert.ok(true, 'action was triggered'); + } + } + }); + }, /Please use '{{input enter="foo"}}' instead/); + + this.triggerEvent('keyup', { + keyCode: 13 + }); + }; + + _class.prototype['@test sends an action with `{{input enter="foo"}}` when is pressed'] = function testSendsAnActionWithInputEnterFooWhenEnterIsPressed(assert) { + assert.expect(1); + + this.render('{{input enter=\'foo\'}}', { + actions: { + foo: function () { + assert.ok(true, 'action was triggered'); + } + } + }); + + this.triggerEvent('keyup', { + keyCode: 13 + }); + }; + + _class.prototype['@test sends an action with `{{input key-press="foo"}}` is pressed'] = function testSendsAnActionWithInputKeyPressFooIsPressed(assert) { + assert.expect(1); + + this.render('{{input value=value key-press=\'foo\'}}', { + value: 'initial', + + actions: { + foo: function () { + assert.ok(true, 'action was triggered'); + } + } + }); + + this.triggerEvent('keypress', { + keyCode: 65 + }); + }; + + _class.prototype['@test sends an action to the parent level when `bubbles=true` is provided'] = function testSendsAnActionToTheParentLevelWhenBubblesTrueIsProvided(assert) { + assert.expect(1); + + var ParentComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + change: function () { + assert.ok(true, 'bubbled upwards'); + } + }); + + this.registerComponent('x-parent', { + ComponentClass: ParentComponent, + template: '{{input bubbles=true}}' + }); + this.render('{{x-parent}}'); + + this.triggerEvent('change'); + }; + + _class.prototype['@test triggers `focus-in` when focused'] = function testTriggersFocusInWhenFocused(assert) { + var _this9 = this; + + assert.expect(1); + + this.render('{{input focus-in=\'foo\'}}', { + actions: { + foo: function () { + assert.ok(true, 'action was triggered'); + } + } + }); + + this.runTask(function () { + _this9.$input().trigger('focusin'); + }); + }; + + _class.prototype['@test sends `insert-newline` when is pressed'] = function testSendsInsertNewlineWhenEnterIsPressed(assert) { + assert.expect(1); + + this.render('{{input insert-newline=\'foo\'}}', { + actions: { + foo: function () { + assert.ok(true, 'action was triggered'); + } + } + }); + + this.triggerEvent('keyup', { + keyCode: 13 + }); + }; + + _class.prototype['@test sends an action with `{{input escape-press="foo"}}` when is pressed'] = function testSendsAnActionWithInputEscapePressFooWhenEscapeIsPressed(assert) { + assert.expect(1); + + this.render('{{input escape-press=\'foo\'}}', { + actions: { + foo: function () { + assert.ok(true, 'action was triggered'); + } + } + }); + + this.triggerEvent('keyup', { + keyCode: 27 + }); + }; + + _class.prototype['@test sends an action with `{{input key-down="foo"}}` when a key is pressed'] = function testSendsAnActionWithInputKeyDownFooWhenAKeyIsPressed(assert) { + assert.expect(1); + + this.render('{{input key-down=\'foo\'}}', { + actions: { + foo: function () { + assert.ok(true, 'action was triggered'); + } + } + }); + + this.triggerEvent('keydown', { + keyCode: 65 + }); + }; + + _class.prototype['@test sends an action with `{{input key-up="foo"}}` when a key is pressed'] = function testSendsAnActionWithInputKeyUpFooWhenAKeyIsPressed(assert) { + assert.expect(1); + + this.render('{{input key-up=\'foo\'}}', { + actions: { + foo: function () { + assert.ok(true, 'action was triggered'); + } + } + }); + + this.triggerEvent('keyup', { + keyCode: 65 + }); + }; + + return _class; + })(InputRenderingTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{input}} with dynamic type', (function (_InputRenderingTest2) { + babelHelpers.inherits(_class2, _InputRenderingTest2); + + function _class2() { + babelHelpers.classCallCheck(this, _class2); + + _InputRenderingTest2.apply(this, arguments); + } + + _class2.prototype['@test a bound property can be used to determine type'] = function testABoundPropertyCanBeUsedToDetermineType() { + var _this10 = this; + + this.render('{{input type=type}}', { type: 'password' }); + + this.assertAttr('type', 'password'); + + this.runTask(function () { + return _this10.rerender(); + }); + + this.assertAttr('type', 'password'); + + this.runTask(function () { + return _emberMetal.set(_this10.context, 'type', 'text'); + }); + + this.assertAttr('type', 'text'); + + this.runTask(function () { + return _emberMetal.set(_this10.context, 'type', 'password'); + }); + + this.assertAttr('type', 'password'); + }; + + return _class2; + })(InputRenderingTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{input type=\'checkbox\'}}', (function (_InputRenderingTest3) { + babelHelpers.inherits(_class3, _InputRenderingTest3); + + function _class3() { + babelHelpers.classCallCheck(this, _class3); + + _InputRenderingTest3.apply(this, arguments); + } + + _class3.prototype['@test dynamic attributes'] = function testDynamicAttributes() { + var _this11 = this; + + this.render('{{input\n type=\'checkbox\'\n disabled=disabled\n name=name\n checked=checked\n tabindex=tabindex\n }}', { + disabled: false, + name: 'original-name', + checked: false, + tabindex: 10 + }); + + this.assertSingleCheckbox(); + this.assertNotDisabled(); + this.assertAttr('name', 'original-name'); + this.assertAttr('tabindex', '10'); + + this.runTask(function () { + return _this11.rerender(); + }); + + this.assertSingleCheckbox(); + this.assertNotDisabled(); + this.assertAttr('name', 'original-name'); + this.assertAttr('tabindex', '10'); + + this.runTask(function () { + _emberMetal.set(_this11.context, 'disabled', true); + _emberMetal.set(_this11.context, 'name', 'updated-name'); + _emberMetal.set(_this11.context, 'tabindex', 11); + }); + + this.assertSingleCheckbox(); + this.assertDisabled(); + this.assertAttr('name', 'updated-name'); + this.assertAttr('tabindex', '11'); + + this.runTask(function () { + _emberMetal.set(_this11.context, 'disabled', false); + _emberMetal.set(_this11.context, 'name', 'original-name'); + _emberMetal.set(_this11.context, 'tabindex', 10); + }); + + this.assertSingleCheckbox(); + this.assertNotDisabled(); + this.assertAttr('name', 'original-name'); + this.assertAttr('tabindex', '10'); + }; + + _class3.prototype['@test `value` property assertion'] = function testValuePropertyAssertion() { + var _this12 = this; + + expectAssertion(function () { + _this12.render('{{input type="checkbox" value=value}}', { value: 'value' }); + }, /you must use `checked=/); + }; + + _class3.prototype['@test with a bound type'] = function testWithABoundType(assert) { + var _this13 = this; + + this.render('{{input type=inputType checked=isChecked}}', { inputType: 'checkbox', isChecked: true }); + + this.assertSingleCheckbox(); + this.assertCheckboxIsChecked(); + + this.runTask(function () { + return _this13.rerender(); + }); + + this.assertCheckboxIsChecked(); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'isChecked', false); + }); + + this.assertCheckboxIsNotChecked(); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'isChecked', true); + }); + + this.assertCheckboxIsChecked(); + }; + + _class3.prototype['@test with static values'] = function testWithStaticValues(assert) { + var _this14 = this; + + this.render('{{input type="checkbox" disabled=false tabindex=10 name="original-name" checked=false}}'); + + this.assertSingleCheckbox(); + this.assertCheckboxIsNotChecked(); + this.assertNotDisabled(); + this.assertAttr('tabindex', '10'); + this.assertAttr('name', 'original-name'); + + this.runTask(function () { + return _this14.rerender(); + }); + + this.assertSingleCheckbox(); + this.assertCheckboxIsNotChecked(); + this.assertNotDisabled(); + this.assertAttr('tabindex', '10'); + this.assertAttr('name', 'original-name'); + }; + + return _class3; + })(InputRenderingTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{input type=\'text\'}}', (function (_InputRenderingTest4) { + babelHelpers.inherits(_class4, _InputRenderingTest4); + + function _class4() { + babelHelpers.classCallCheck(this, _class4); + + _InputRenderingTest4.apply(this, arguments); + } + + _class4.prototype['@test null values'] = function testNullValues(assert) { + var _this15 = this; + + var attributes = ['disabled', 'placeholder', 'name', 'maxlength', 'size', 'tabindex']; + + this.render('\n {{input type="text"\n disabled=disabled\n value=value\n placeholder=placeholder\n name=name\n maxlength=maxlength\n size=size\n tabindex=tabindex\n }}', { + disabled: null, + value: null, + placeholder: null, + name: null, + maxlength: null, + size: null, + tabindex: null + }); + + this.assertValue(''); + this.assertAllAttrs(attributes, undefined); + + this.runTask(function () { + return _this15.rerender(); + }); + + this.assertValue(''); + this.assertAllAttrs(attributes, undefined); + + this.runTask(function () { + _emberMetal.set(_this15.context, 'disabled', true); + _emberMetal.set(_this15.context, 'value', 'Updated value'); + _emberMetal.set(_this15.context, 'placeholder', 'Updated placeholder'); + _emberMetal.set(_this15.context, 'name', 'updated-name'); + _emberMetal.set(_this15.context, 'maxlength', 11); + _emberMetal.set(_this15.context, 'size', 21); + _emberMetal.set(_this15.context, 'tabindex', 31); + }); + + this.assertDisabled(); + this.assertValue('Updated value'); + this.assertAttr('placeholder', 'Updated placeholder'); + this.assertAttr('name', 'updated-name'); + this.assertAttr('maxlength', '11'); + this.assertAttr('size', '21'); + this.assertAttr('tabindex', '31'); + + this.runTask(function () { + _emberMetal.set(_this15.context, 'disabled', null); + _emberMetal.set(_this15.context, 'value', null); + _emberMetal.set(_this15.context, 'placeholder', null); + _emberMetal.set(_this15.context, 'name', null); + _emberMetal.set(_this15.context, 'maxlength', null); + // set(this.context, 'size', null); //NOTE: this fails with `Error: Failed to set the 'size' property on 'HTMLInputElement': The value provided is 0, which is an invalid size.` (TEST_SUITE=sauce) + _emberMetal.set(_this15.context, 'tabindex', null); + }); + + this.assertAttr('disabled', undefined); + this.assertValue(''); + // this.assertAttr('placeholder', undefined); //NOTE: this fails with a value of "null" (TEST_SUITE=sauce) + // this.assertAttr('name', undefined); //NOTE: this fails with a value of "null" (TEST_SUITE=sauce) + this.assertAttr('maxlength', undefined); + // this.assertAttr('size', undefined); //NOTE: re-enable once `size` bug above has been addressed + this.assertAttr('tabindex', undefined); + }; + + return _class4; + })(InputRenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/input-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/input-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/input-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/input-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/input-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/input-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/loc-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal, _ember) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{loc}}', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.call(this); + this.oldString = _ember.default.STRINGS; + _ember.default.STRINGS = { + 'Hello Friend': 'Hallo Freund', + 'Hello': 'Hallo, %@' + }; + } + + _class.prototype.teardown = function teardown() { + _RenderingTest.prototype.teardown.call(this); + _ember.default.STRINGS = this.oldString; + }; + + _class.prototype['@test it lets the original value through by default'] = function testItLetsTheOriginalValueThroughByDefault() { + var _this = this; + + this.render('{{loc "Hiya buddy!"}}'); + this.assertText('Hiya buddy!', 'the unlocalized string is correct'); + this.runTask(function () { + return _this.rerender(); + }); + this.assertText('Hiya buddy!', 'the unlocalized string is correct after rerender'); + }; + + _class.prototype['@test it localizes a simple string'] = function testItLocalizesASimpleString() { + var _this2 = this; + + this.render('{{loc "Hello Friend"}}'); + this.assertText('Hallo Freund', 'the localized string is correct'); + this.runTask(function () { + return _this2.rerender(); + }); + this.assertText('Hallo Freund', 'the localized string is correct after rerender'); + }; + + _class.prototype['@test it takes passed formats into an account'] = function testItTakesPassedFormatsIntoAnAccount() { + var _this3 = this; + + this.render('{{loc "%@, %@" "Hello" "Mr. Pitkin"}}'); + this.assertText('Hello, Mr. Pitkin', 'the formatted string is correct'); + this.runTask(function () { + return _this3.rerender(); + }); + this.assertText('Hello, Mr. Pitkin', 'the formatted string is correct after rerender'); + }; + + _class.prototype['@test it updates when bound params change'] = function testItUpdatesWhenBoundParamsChange() { + var _this4 = this; + + this.render('{{loc simple}} - {{loc personal \'Mr. Pitkin\'}}', { + simple: 'Hello Friend', + personal: 'Hello' + }); + this.assertText('Hallo Freund - Hallo, Mr. Pitkin', 'the bound value is correct'); + + this.runTask(function () { + return _this4.rerender(); + }); + this.assertText('Hallo Freund - Hallo, Mr. Pitkin', 'the bound value is correct after rerender'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'simple', 'G\'day mate'); + }); + this.assertText('G\'day mate - Hallo, Mr. Pitkin', 'the bound value is correct after update'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'simple', 'Hello Friend'); + }); + this.assertText('Hallo Freund - Hallo, Mr. Pitkin', 'the bound value is correct after reset'); + }; + + _class.prototype['@test it updates when nested bound params change'] = function testItUpdatesWhenNestedBoundParamsChange() { + var _this5 = this; + + this.render('{{loc greetings.simple}} - {{loc greetings.personal \'Mr. Pitkin\'}}', { + greetings: { + simple: 'Hello Friend', + personal: 'Hello' + } + }); + this.assertText('Hallo Freund - Hallo, Mr. Pitkin', 'the bound value is correct'); + + this.runTask(function () { + return _this5.rerender(); + }); + this.assertText('Hallo Freund - Hallo, Mr. Pitkin', 'the bound value is correct after rerender'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'greetings.simple', 'G\'day mate'); + }); + this.assertText('G\'day mate - Hallo, Mr. Pitkin', 'the bound value is correct after interior mutation'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'greetings', { + simple: 'Hello Friend', + personal: 'Hello' + }); + }); + this.assertText('Hallo Freund - Hallo, Mr. Pitkin', 'the bound value is correct after replacement'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/loc-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/loc-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/loc-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/loc-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/loc-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/loc-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/log-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-console'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberConsole) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{log}}', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class(assert) { + var _this = this; + + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.call(this); + + this.originalLog = _emberConsole.default.log; + this.logCalls = []; + _emberConsole.default.log = function () { + var _logCalls; + + (_logCalls = _this.logCalls).push.apply(_logCalls, arguments); + }; + } + + _class.prototype.teardown = function teardown() { + _RenderingTest.prototype.teardown.call(this); + _emberConsole.default.log = this.originalLog; + }; + + _class.prototype.assertLog = function assertLog(values) { + this.assertText(''); + this.assert.strictEqual(this.logCalls.length, values.length); + + for (var i = 0, len = values.length; i < len; i++) { + this.assert.strictEqual(this.logCalls[i], values[i]); + } + }; + + _class.prototype['@test correctly logs primitives'] = function testCorrectlyLogsPrimitives() { + this.render('{{log "one" 1 true}}'); + + this.assertLog(['one', 1, true]); + }; + + _class.prototype['@test correctly logs a property'] = function testCorrectlyLogsAProperty() { + this.render('{{log value}}', { + value: 'one' + }); + + this.assertLog(['one']); + }; + + _class.prototype['@test correctly logs multiple arguments'] = function testCorrectlyLogsMultipleArguments() { + this.render('{{log "my variable:" value}}', { + value: 'one' + }); + + this.assertLog(['my variable:', 'one']); + }; + + _class.prototype['@test correctly logs `this`'] = function testCorrectlyLogsThis() { + this.render('{{log this}}'); + + this.assertLog([this.context]); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/log-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/log-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/log-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/log-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/log-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/log-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/mut-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal', 'ember-glimmer/tests/utils/test-helpers'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal, _emberGlimmerTestsUtilsTestHelpers) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{mut}}', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test a simple mutable binding using `mut` propagates properly'] = function testASimpleMutableBindingUsingMutPropagatesProperly() { + var _this = this; + + var bottom = undefined; + + this.registerComponent('bottom-mut', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + bottom = this; + } + }), + template: '{{setMe}}' + }); + + this.registerComponent('middle-mut', { + template: '{{bottom-mut setMe=value}}' + }); + + this.render('{{middle-mut value=(mut val)}}', { + val: 12 + }); + + this.assertText('12', 'the data propagated downwards'); + + this.assertStableRerender(); + + this.runTask(function () { + return bottom.attrs.setMe.update(13); + }); + + this.assertText('13', 'the set took effect'); + this.assert.strictEqual(_emberMetal.get(bottom, 'setMe'), 13, 'the set took effect on bottom\'s prop'); + this.assert.strictEqual(bottom.attrs.setMe.value, 13, 'the set took effect on bottom\'s attr'); + this.assert.strictEqual(_emberMetal.get(this.context, 'val'), 13, 'the set propagated back up'); + + this.runTask(function () { + return _emberMetal.set(bottom, 'setMe', 14); + }); + + this.assertText('14', 'the set took effect'); + this.assert.strictEqual(_emberMetal.get(bottom, 'setMe'), 14, 'the set took effect on bottom\'s prop'); + this.assert.strictEqual(bottom.attrs.setMe.value, 14, 'the set took effect on bottom\'s attr'); + this.assert.strictEqual(_emberMetal.get(this.context, 'val'), 14, 'the set propagated back up'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'val', 12); + }); + + this.assertText('12'); + }; + + _class.prototype['@test a simple mutable binding using `mut` inserts into the DOM'] = function testASimpleMutableBindingUsingMutInsertsIntoTheDOM() { + var _this2 = this; + + var bottom = undefined, + middle = undefined; + + this.registerComponent('bottom-mut', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + bottom = this; + } + }), + template: '{{setMe}}' + }); + + this.registerComponent('middle-mut', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + middle = this; + } + }), + template: '{{bottom-mut setMe=(mut value)}}' + }); + + this.render('{{middle-mut value=(mut val)}}', { + val: 12 + }); + + this.assertText('12', 'the data propagated downwards'); + + this.assertStableRerender(); + + this.runTask(function () { + return bottom.attrs.setMe.update(13); + }); + + this.assertText('13', 'the set took effect'); + this.assert.strictEqual(_emberMetal.get(bottom, 'setMe'), 13, 'the set took effect on bottom\'s prop'); + this.assert.strictEqual(bottom.attrs.setMe.value, 13, 'the set took effect on bottom\'s attr'); + this.assert.strictEqual(_emberMetal.get(middle, 'value'), 13, 'the set propagated to middle\'s prop'); + this.assert.strictEqual(middle.attrs.value.value, 13, 'the set propagated to middle\'s attr'); + this.assert.strictEqual(_emberMetal.get(this.context, 'val'), 13, 'the set propagated back up'); + + this.runTask(function () { + return _emberMetal.set(bottom, 'setMe', 14); + }); + + this.assertText('14', 'the set took effect'); + this.assert.strictEqual(_emberMetal.get(bottom, 'setMe'), 14, 'the set took effect on bottom\'s prop'); + this.assert.strictEqual(bottom.attrs.setMe.value, 14, 'the set took effect on bottom\'s attr'); + this.assert.strictEqual(_emberMetal.get(middle, 'value'), 14, 'the set propagated to middle\'s prop'); + this.assert.strictEqual(middle.attrs.value.value, 14, 'the set propagated to middle\'s attr'); + this.assert.strictEqual(_emberMetal.get(this.context, 'val'), 14, 'the set propagated back up'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'val', 12); + }); + + this.assertText('12'); + }; + + _class.prototype['@test passing a literal results in a assertion'] = function testPassingALiteralResultsInAAssertion() { + var _this3 = this; + + this.registerComponent('bottom-mut', { template: '{{setMe}}' }); + + expectAssertion(function () { + _this3.render('{{bottom-mut setMe=(mut "foo bar")}}'); + }, 'You can only pass a path to mut'); + }; + + _class.prototype['@test passing the result of a helper invocation results in an assertion'] = function testPassingTheResultOfAHelperInvocationResultsInAnAssertion() { + var _this4 = this; + + this.registerComponent('bottom-mut', { template: '{{setMe}}' }); + + expectAssertion(function () { + _this4.render('{{bottom-mut setMe=(mut (concat "foo" " " "bar"))}}'); + }, 'You can only pass a path to mut'); + }; + + // See https://github.com/emberjs/ember.js/commit/807a0cd for an explanation of this test + + _class.prototype['@test using a string value through middle tier does not trigger assertion (due to the auto-mut transform)'] = function testUsingAStringValueThroughMiddleTierDoesNotTriggerAssertionDueToTheAutoMutTransform() { + var bottom = undefined; + + this.registerComponent('bottom-mut', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + bottom = this; + } + }), + template: '{{stuff}}' + }); + + this.registerComponent('middle-mut', { + template: '{{bottom-mut stuff=value}}' + }); + + this.render('{{middle-mut value="foo"}}'); + + this.assert.equal(_emberMetal.get(bottom, 'stuff'), 'foo', 'the data propagated'); + this.assertText('foo'); + + this.assertStableRerender(); + + // No U-R for this test + }; + + _class.prototype['@test {{readonly}} of a {{mut}} is converted into an immutable binding'] = function testReadonlyOfAMutIsConvertedIntoAnImmutableBinding() { + var _this5 = this; + + var middle = undefined, + bottom = undefined; + + this.registerComponent('bottom-mut', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + bottom = this; + } + }), + template: '{{setMe}}' + }); + + this.registerComponent('middle-mut', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + middle = this; + } + }), + template: '{{bottom-mut setMe=(readonly value)}}' + }); + + this.render('{{middle-mut value=(mut val)}}', { + val: 12 + }); + + this.assertText('12'); + + this.assertStableRerender(); + + this.runTask(function () { + return middle.attrs.value.update(13); + }); + + this.assert.strictEqual(_emberMetal.get(middle, 'value'), 13, 'the set took effect on middle\'s prop'); + this.assert.strictEqual(middle.attrs.value.value, 13, 'the set took effect on middle\'s attr'); + + this.runTask(function () { + return _emberMetal.set(middle, 'value', 14); + }); + + this.assert.strictEqual(_emberMetal.get(middle, 'value'), 14, 'the set took effect on middle\'s prop'); + this.assert.strictEqual(middle.attrs.value.value, 14, 'the set took effect on middle\'s attr'); + this.assert.strictEqual(bottom.attrs.setMe, 14, 'the mutable binding has been converted to an immutable cell'); + this.assertText('14'); + this.assert.strictEqual(_emberMetal.get(this.context, 'val'), 14, 'the set propagated back up'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'val', 12); + }); + + this.assertText('12'); + }; + + _class.prototype['@test mutable bindings work inside of yielded content'] = function testMutableBindingsWorkInsideOfYieldedContent() { + var _this6 = this; + + this.registerComponent('bottom-mut', { + template: '{{yield}}' + }); + + this.registerComponent('middle-mut', { + template: '{{#bottom-mut}}{{model.name}}{{/bottom-mut}}' + }); + + this.render('{{middle-mut model=(mut model)}}', { + model: { name: 'Matthew Beale' } + }); + + this.assertText('Matthew Beale'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'model.name', 'Joel Kang'); + }); + + this.assertText('Joel Kang'); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'model', { name: 'Matthew Beale' }); + }); + + this.assertText('Matthew Beale'); + }; + + _class.prototype['@test a simple mutable binding using {{mut}} is available in hooks'] = function testASimpleMutableBindingUsingMutIsAvailableInHooks() { + var _this7 = this; + + var bottom = undefined; + var willRender = []; + var didInsert = []; + + this.registerComponent('bottom-mut', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + willRender: function () { + willRender.push(_emberMetal.get(this, 'setMe')); + }, + didInsertElement: function () { + didInsert.push(_emberMetal.get(this, 'setMe')); + bottom = this; + } + }), + template: '{{setMe}}' + }); + + this.registerComponent('middle-mut', { + template: '{{bottom-mut setMe=(mut value)}}' + }); + + this.render('{{middle-mut value=(mut val)}}', { + val: 12 + }); + + this.assert.deepEqual(willRender, [12], 'willReceive is [12]'); + this.assert.deepEqual(didInsert, [12], 'didInsert is [12]'); + this.assertText('12'); + + this.assertStableRerender(); + + this.assert.deepEqual(willRender, [12], 'willReceive is [12]'); + this.assert.deepEqual(didInsert, [12], 'didInsert is [12]'); + this.assert.strictEqual(_emberMetal.get(bottom, 'setMe'), 12, 'the data propagated'); + + this.runTask(function () { + return bottom.attrs.setMe.update(13); + }); + + this.assert.strictEqual(_emberMetal.get(bottom, 'setMe'), 13, 'the set took effect on bottom\'s prop'); + this.assert.strictEqual(bottom.attrs.setMe.value, 13, 'the set took effect on bottom\'s attr'); + this.assert.strictEqual(_emberMetal.get(this.context, 'val'), 13, 'the set propagated back up'); + + this.runTask(function () { + return _emberMetal.set(bottom, 'setMe', 14); + }); + + this.assert.strictEqual(_emberMetal.get(bottom, 'setMe'), 14, 'the set took effect on bottom\'s prop'); + this.assert.strictEqual(bottom.attrs.setMe.value, 14, 'the set took effect on bottom\'s attr'); + this.assert.strictEqual(_emberMetal.get(this.context, 'val'), 14, 'the set propagated back up'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'val', 12); + }); + + this.assertText('12'); + }; + + _class.prototype['@test a mutable binding with a backing computed property and attribute present in the root of the component is updated when the upstream property invalidates #11023'] = function testAMutableBindingWithABackingComputedPropertyAndAttributePresentInTheRootOfTheComponentIsUpdatedWhenTheUpstreamPropertyInvalidates11023() { + var bottom = undefined, + middle = undefined; + + this.registerComponent('bottom-mut', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + thingy: null, + didInsertElement: function () { + bottom = this; + } + }), + template: '{{thingy}}' + }); + + this.registerComponent('middle-mut', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + baseValue: 12, + val: _emberMetal.computed('baseValue', function () { + return this.get('baseValue'); + }), + didInsertElement: function () { + middle = this; + } + }), + template: '{{bottom-mut thingy=(mut val)}}' + }); + + this.render('{{middle-mut}}'); + + this.assert.strictEqual(_emberMetal.get(bottom, 'thingy'), 12, 'data propagated'); + this.assertText('12'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(middle, 'baseValue', 13); + }); + + this.assert.strictEqual(_emberMetal.get(middle, 'val'), 13, 'the set took effect'); + this.assert.strictEqual(bottom.attrs.thingy.value, 13, 'the set propagated down to bottom\'s attrs'); + this.assert.strictEqual(_emberMetal.get(bottom, 'thingy'), 13, 'the set propagated down to bottom\'s prop'); + this.assertText('13'); + + this.runTask(function () { + return _emberMetal.set(middle, 'baseValue', 12); + }); + + this.assertText('12'); + }; + + _class.prototype['@test automatic mutable bindings exposes a mut cell in attrs'] = function testAutomaticMutableBindingsExposesAMutCellInAttrs() { + var inner = undefined; + + this.registerComponent('x-inner', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + inner = this; + } + }), + template: '{{foo}}' + }); + + this.registerComponent('x-outer', { + template: '{{x-inner foo=bar}}' + }); + + this.render('{{x-outer bar=baz}}', { baz: 'foo' }); + + this.assertText('foo'); + + this.assertStableRerender(); + + this.runTask(function () { + return inner.attrs.foo.update('bar'); + }); + + this.assert.equal(inner.attrs.foo.value, 'bar'); + this.assert.equal(_emberMetal.get(inner, 'foo'), 'bar'); + this.assertText('bar'); + + this.runTask(function () { + return inner.attrs.foo.update('foo'); + }); + + this.assertText('foo'); + }; + + _class.prototype['@test automatic mutable bindings tolerate undefined non-stream inputs and attempts to set them'] = function testAutomaticMutableBindingsTolerateUndefinedNonStreamInputsAndAttemptsToSetThem() { + var inner = undefined; + + this.registerComponent('x-inner', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + inner = this; + } + }), + template: '{{model}}' + }); + + this.registerComponent('x-outer', { + template: '{{x-inner model=nonexistent}}' + }); + + this.render('{{x-outer}}'); + + this.assertText(''); + + this.assertStableRerender(); + + this.runTask(function () { + return inner.attrs.model.update(42); + }); + + this.assert.equal(inner.attrs.model.value, 42); + this.assert.equal(_emberMetal.get(inner, 'model'), 42); + this.assertText('42'); + + this.runTask(function () { + return inner.attrs.model.update(undefined); + }); + + this.assertText(''); + }; + + _class.prototype['@test automatic mutable bindings tolerate constant non-stream inputs and attempts to set them'] = function testAutomaticMutableBindingsTolerateConstantNonStreamInputsAndAttemptsToSetThem() { + var inner = undefined; + + this.registerComponent('x-inner', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + inner = this; + } + }), + template: 'hello{{model}}' + }); + + this.registerComponent('x-outer', { + template: '{{x-inner model=x}}' + }); + + this.render('{{x-outer x="foo"}}'); + + this.assertText('hellofoo'); + + this.assertStableRerender(); + + this.runTask(function () { + return inner.attrs.model.update(42); + }); + + this.assert.equal(inner.attrs.model.value, 42); + this.assert.equal(_emberMetal.get(inner, 'model'), 42); + this.assertText('hello42'); + + this.runTask(function () { + return inner.attrs.model.update('foo'); + }); + + this.assertText('hellofoo'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Mutable Bindings used in Computed Properties that are bound as attributeBindings', (function (_RenderingTest2) { + babelHelpers.inherits(_class2, _RenderingTest2); + + function _class2() { + babelHelpers.classCallCheck(this, _class2); + + _RenderingTest2.apply(this, arguments); + } + + _class2.prototype['@test an attribute binding of a computed property of a 2-way bound attr recomputes when the attr changes'] = function testAnAttributeBindingOfAComputedPropertyOfA2WayBoundAttrRecomputesWhenTheAttrChanges() { + var _this8 = this; + + var input = undefined, + output = undefined; + + this.registerComponent('x-input', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + input = this; + } + }) + }); + + this.registerComponent('x-output', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['style'], + didInsertElement: function () { + output = this; + }, + style: _emberMetal.computed('height', function () { + var height = this.get('height'); + return 'height: ' + height + 'px;'; + }), + height: 20 + }), + template: '{{height}}' + }); + + this.render('{{x-output height=height}}{{x-input height=(mut height)}}', { + height: 60 + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { style: _emberGlimmerTestsUtilsTestHelpers.styles('height: 60px;') }, content: '60' }); + + this.assertStableRerender(); + + this.runTask(function () { + return input.attrs.height.update(35); + }); + + this.assert.strictEqual(_emberMetal.get(output, 'height'), 35, 'the set took effect'); + this.assert.strictEqual(_emberMetal.get(this.context, 'height'), 35, 'the set propagated back up'); + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { style: _emberGlimmerTestsUtilsTestHelpers.styles('height: 35px;') }, content: '35' }); + + this.runTask(function () { + return _emberMetal.set(input, 'height', 36); + }); + + this.assert.strictEqual(_emberMetal.get(output, 'height'), 36, 'the set took effect'); + this.assert.strictEqual(_emberMetal.get(this.context, 'height'), 36, 'the set propagated back up'); + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { style: _emberGlimmerTestsUtilsTestHelpers.styles('height: 36px;') }, content: '36' }); + + this.runTask(function () { + return _emberMetal.set(_this8.context, 'height', 60); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { style: _emberGlimmerTestsUtilsTestHelpers.styles('height: 60px;') }, content: '60' }); + this.assert.strictEqual(_emberMetal.get(input, 'height'), 60); + }; + + _class2.prototype['@test an attribute binding of a computed property with a setter of a 2-way bound attr recomputes when the attr changes'] = function testAnAttributeBindingOfAComputedPropertyWithASetterOfA2WayBoundAttrRecomputesWhenTheAttrChanges() { + var _this9 = this; + + var input = undefined, + output = undefined; + + this.registerComponent('x-input', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + input = this; + } + }) + }); + + this.registerComponent('x-output', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['style'], + didInsertElement: function () { + output = this; + }, + style: _emberMetal.computed('height', 'width', function () { + var height = this.get('height'); + var width = this.get('width'); + return 'height: ' + height + 'px; width: ' + width + 'px;'; + }), + height: 20, + width: _emberMetal.computed('height', { + get: function () { + return this.get('height') * 2; + }, + set: function (keyName, width) { + this.set('height', width / 2); + return width; + } + }) + }), + template: '{{width}}x{{height}}' + }); + + this.render('{{x-output width=width}}{{x-input width=(mut width)}}', { + width: 70 + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { style: _emberGlimmerTestsUtilsTestHelpers.styles('height: 35px; width: 70px;') }, content: '70x35' }); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(input, 'width', 80); + }); + + this.assert.strictEqual(_emberMetal.get(output, 'width'), 80, 'the set took effect'); + this.assert.strictEqual(_emberMetal.get(this.context, 'width'), 80, 'the set propagated back up'); + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { style: _emberGlimmerTestsUtilsTestHelpers.styles('height: 40px; width: 80px;') }, content: '80x40' }); + + this.runTask(function () { + return input.attrs.width.update(90); + }); + + this.assert.strictEqual(_emberMetal.get(output, 'width'), 90, 'the set took effect'); + this.assert.strictEqual(_emberMetal.get(this.context, 'width'), 90, 'the set propagated back up'); + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { style: _emberGlimmerTestsUtilsTestHelpers.styles('height: 45px; width: 90px;') }, content: '90x45' }); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'width', 70); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { style: _emberGlimmerTestsUtilsTestHelpers.styles('height: 35px; width: 70px;') }, content: '70x35' }); + this.assert.strictEqual(_emberMetal.get(input, 'width'), 70); + }; + + return _class2; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/mut-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/mut-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/mut-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/mut-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/mut-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/mut-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/partial-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each model.items as |template i|}}\n {{model.type}}: {{partial template}}\n {{/each}}'], ['\n {{#each model.items as |template i|}}\n {{model.type}}: {{partial template}}\n {{/each}}']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with item.thing as |t|}}\n {{partial t}}\n {{else}}\n Nothing!\n {{/with}}'], ['\n {{#with item.thing as |t|}}\n {{partial t}}\n {{else}}\n Nothing!\n {{/with}}']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{partial}}', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { +babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test should render other templates registered with the container'] = function testShouldRenderOtherTemplatesRegisteredWithTheContainer() { + this.registerPartial('_subTemplateFromContainer', 'sub-template'); + + this.render('This {{partial "subTemplateFromContainer"}} is pretty great.'); + + this.assertStableRerender(); + + this.assertText('This sub-template is pretty great.'); + }; + + _class.prototype['@test should render other slash-separated templates registered with the container'] = function testShouldRenderOtherSlashSeparatedTemplatesRegisteredWithTheContainer() { + this.registerPartial('child/_subTemplateFromContainer', 'sub-template'); + + this.render('This {{partial "child/subTemplateFromContainer"}} is pretty great.'); + + this.assertStableRerender(); + + this.assertText('This sub-template is pretty great.'); + }; + + _class.prototype['@test should use the current context'] = function testShouldUseTheCurrentContext() { + var _this = this; + + this.registerPartial('_person_name', '{{model.firstName}} {{model.lastName}}'); + + this.render('Who is {{partial "person_name"}}?', { + model: { + firstName: 'Kris', + lastName: 'Selden' + } + }); + + this.assertStableRerender(); + + this.assertText('Who is Kris Selden?'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'model.firstName', 'Kelly'); + }); + + this.assertText('Who is Kelly Selden?'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'model', { firstName: 'Kris', lastName: 'Selden' }); + }); + + this.assertText('Who is Kris Selden?'); + }; + + _class.prototype['@test Quoteless parameters passed to {{partial}} perform a bound property lookup of the partial name'] = function testQuotelessParametersPassedToPartialPerformABoundPropertyLookupOfThePartialName() { + var _this2 = this; + + this.registerPartial('_subTemplate', 'sub-template'); + this.registerPartial('_otherTemplate', 'other-template'); + + this.render('This {{partial templates.partialName}} is pretty {{partial nonexistent}}great.', { + templates: { partialName: 'subTemplate' } + }); + + this.assertStableRerender(); + + this.assertText('This sub-template is pretty great.'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'templates.partialName', 'otherTemplate'); + }); + + this.assertText('This other-template is pretty great.'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'templates.partialName', null); + }); + + this.assertText('This is pretty great.'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'templates', { partialName: 'subTemplate' }); + }); + + this.assertText('This sub-template is pretty great.'); + }; + + _class.prototype['@test dynamic partials in {{#each}}'] = function testDynamicPartialsInEach() { + var _this3 = this; + + this.registerPartial('_odd', 'ODD{{i}}'); + this.registerPartial('_even', 'EVEN{{i}}'); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { + model: { + items: ['even', 'odd', 'even', 'odd'], + type: 'number' + } + }); + + this.assertStableRerender(); + + this.assertText('number: EVEN0number: ODD1number: EVEN2number: ODD3'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'model.type', 'integer'); + }); + + this.assertText('integer: EVEN0integer: ODD1integer: EVEN2integer: ODD3'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'model', { + items: ['even', 'odd', 'even', 'odd'], + type: 'number' + }); + }); + + this.assertText('number: EVEN0number: ODD1number: EVEN2number: ODD3'); + }; + + _class.prototype['@test dynamic partials in {{#with}}'] = function testDynamicPartialsInWith() { + var _this4 = this; + + this.registerPartial('_thing', '{{t}}'); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2), { + item: { thing: false } + }); + + this.assertStableRerender(); + + this.assertText('Nothing!'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'item.thing', 'thing'); + }); + + this.assertText('thing'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'item', { thing: false }); + }); + + this.assertText('Nothing!'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/partial-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/partial-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/partial-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/partial-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/partial-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/partial-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/readonly-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{readonly}}', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test {{readonly}} of a path should work'] = function testReadonlyOfAPathShouldWork() { + var component = undefined; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + component = this; + } + }), + template: '{{value}}' + }); + + this.render('{{foo-bar value=(readonly val)}}', { + val: 12 + }); + + this.assertText('12'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(component, 'value', 13); + }); + this.assert.notOk(component.attrs.value.update); + + this.assertText('13', 'local property is updated'); + this.assert.equal(_emberMetal.get(this.context, 'val'), 12, 'upstream attribute is not updated'); + + // No U-R + }; + + _class.prototype['@test {{readonly}} of a string renders correctly'] = function testReadonlyOfAStringRendersCorrectly() { + var component = undefined; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + component = this; + } + }), + template: '{{value}}' + }); + + this.render('{{foo-bar value=(readonly "12")}}'); + + this.assertText('12'); + + this.assertStableRerender(); + + this.assert.notOk(component.attrs.value.update); + this.assert.strictEqual(_emberMetal.get(component, 'value'), '12'); + + this.runTask(function () { + return _emberMetal.set(component, 'value', '13'); + }); + + this.assertText('13', 'local property is updated'); + this.assert.strictEqual(_emberMetal.get(component, 'value'), '13'); + + this.runTask(function () { + return _emberMetal.set(component, 'value', '12'); + }); + + this.assertText('12'); + }; + + _class.prototype['@test {{mut}} of a {{readonly}} mutates only the middle and bottom tiers'] = function testMutOfAReadonlyMutatesOnlyTheMiddleAndBottomTiers() { + var _this = this; + + var middle = undefined, + bottom = undefined; + + this.registerComponent('x-bottom', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + bottom = this; + } + }), + template: '{{bar}}' + }); + + this.registerComponent('x-middle', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + middle = this; + } + }), + template: '{{foo}} {{x-bottom bar=(mut foo)}}' + }); + + this.render('{{x-middle foo=(readonly val)}}', { + val: 12 + }); + + this.assertText('12 12'); + + this.assertStableRerender(); + + this.assert.equal(_emberMetal.get(bottom, 'bar'), 12, 'bottom\'s local bar received the value'); + this.assert.equal(_emberMetal.get(middle, 'foo'), 12, 'middle\'s local foo received the value'); + + this.runTask(function () { + return bottom.attrs.bar.update(13); + }); + + this.assert.equal(_emberMetal.get(bottom, 'bar'), 13, 'bottom\'s local bar was updated after set of bottom\'s bar'); + this.assert.equal(_emberMetal.get(middle, 'foo'), 13, 'middle\'s local foo was updated after set of bottom\'s bar'); + this.assertText('13 13'); + this.assert.equal(_emberMetal.get(this.context, 'val'), 12, 'But context val is not updated'); + + this.runTask(function () { + return _emberMetal.set(bottom, 'bar', 14); + }); + + this.assert.equal(_emberMetal.get(bottom, 'bar'), 14, 'bottom\'s local bar was updated after set of bottom\'s bar'); + this.assert.equal(_emberMetal.get(middle, 'foo'), 14, 'middle\'s local foo was updated after set of bottom\'s bar'); + this.assertText('14 14'); + this.assert.equal(_emberMetal.get(this.context, 'val'), 12, 'But context val is not updated'); + + this.assert.notOk(middle.attrs.foo.update, 'middle\'s foo attr is not a mutable cell'); + this.runTask(function () { + return _emberMetal.set(middle, 'foo', 15); + }); + + this.assertText('15 15'); + this.assert.equal(_emberMetal.get(middle, 'foo'), 15, 'set of middle\'s foo took effect'); + this.assert.equal(_emberMetal.get(bottom, 'bar'), 15, 'bottom\'s local bar was updated after set of middle\'s foo'); + this.assert.equal(_emberMetal.get(this.context, 'val'), 12, 'Context val remains unchanged'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'val', 10); + }); + + this.assertText('10 10'); + this.assert.equal(_emberMetal.get(bottom, 'bar'), 10, 'bottom\'s local bar was updated after set of context\'s val'); + this.assert.equal(_emberMetal.get(middle, 'foo'), 10, 'middle\'s local foo was updated after set of context\'s val'); + + this.runTask(function () { + return _emberMetal.set(bottom, 'bar', undefined); + }); + + this.assertText(' '); + this.assert.equal(_emberMetal.get(bottom, 'bar'), undefined, 'bottom\'s local bar was updated to a falsy value'); + this.assert.equal(_emberMetal.get(middle, 'foo'), undefined, 'middle\'s local foo was updated to a falsy value'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'val', 12); + }); + this.assertText('12 12', 'bottom and middle were both reset'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/readonly-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/readonly-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/readonly-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/readonly-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/readonly-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/readonly-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/test-case'], function (exports, _emberMetal, _emberRuntime, _emberGlimmerTestsUtilsTestCase) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{render}}', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test should render given template'] = function testShouldRenderGivenTemplate() { + this.registerTemplate('home', '

BYE

'); + + this.render('

HI

{{render \'home\'}}'); + + this.assertText('HIBYE'); + }; + + _class.prototype['@test uses `controller:basic` as the basis for a generated controller when none exists for specified name'] = function testUsesControllerBasicAsTheBasisForAGeneratedControllerWhenNoneExistsForSpecifiedName() { + this.owner.register('controller:basic', _emberRuntime.Controller.extend({ + isBasicController: true + })); + this.registerTemplate('home', '{{isBasicController}}'); + + this.render('{{render \'home\'}}'); + + this.assertText('true'); + }; + + _class.prototype['@test generates a controller if none exists'] = function testGeneratesAControllerIfNoneExists() { + this.registerTemplate('home', '

{{this}}

'); + + this.render('

HI

{{render \'home\'}}'); + + this.assertText('HI(generated home controller)'); + }; + + _class.prototype['@test should use controller with the same name as template if present'] = function testShouldUseControllerWithTheSameNameAsTemplateIfPresent() { + this.owner.register('controller:home', _emberRuntime.Controller.extend({ name: 'home' })); + this.registerTemplate('home', '{{name}}

BYE

'); + + this.render('

HI

{{render \'home\'}}'); + + this.assertText('HIhomeBYE'); + }; + + _class.prototype['@test should render nested helpers'] = function testShouldRenderNestedHelpers() { + this.owner.register('controller:home', _emberRuntime.Controller.extend()); + this.owner.register('controller:foo', _emberRuntime.Controller.extend()); + this.owner.register('controller:bar', _emberRuntime.Controller.extend()); + this.owner.register('controller:baz', _emberRuntime.Controller.extend()); + + this.registerTemplate('home', '

BYE

'); + this.registerTemplate('foo', '

FOO

{{render \'bar\'}}'); + this.registerTemplate('bar', '

BAR

{{render \'baz\'}}'); + this.registerTemplate('baz', '

BAZ

'); + + this.render('

HI

{{render \'foo\'}}'); + this.assertText('HIFOOBARBAZ'); + }; + + _class.prototype['@test should have assertion if the template does not exist'] = function testShouldHaveAssertionIfTheTemplateDoesNotExist() { + var _this = this; + + this.owner.register('controller:oops', _emberRuntime.Controller.extend()); + + expectAssertion(function () { + _this.render('

HI

{{render \'oops\'}}'); + }, 'You used `{{render \'oops\'}}`, but \'oops\' can not be found as a template.'); + }; + + _class.prototype['@test should render given template with the singleton controller as its context'] = function testShouldRenderGivenTemplateWithTheSingletonControllerAsItsContext() { + var _this2 = this; + + this.owner.register('controller:post', _emberRuntime.Controller.extend({ + init: function () { + this.set('title', 'It\'s Simple Made Easy'); + } + })); + this.registerTemplate('post', '

{{title}}

'); + + this.render('

HI

{{render \'post\'}}'); + + this.assertText('HIIt\'s Simple Made Easy'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertText('HIIt\'s Simple Made Easy'); + + var controller = this.owner.lookup('controller:post'); + + this.runTask(function () { + return _emberMetal.set(controller, 'title', 'Rails is omakase'); + }); + + this.assertText('HIRails is omakase'); + + this.runTask(function () { + return _emberMetal.set(controller, 'title', 'It\'s Simple Made Easy'); + }); + + this.assertText('HIIt\'s Simple Made Easy'); + }; + + _class.prototype['@test should not destroy the singleton controller on teardown'] = function testShouldNotDestroyTheSingletonControllerOnTeardown(assert) { + var _this3 = this; + + var willDestroyFired = 0; + + this.owner.register('controller:post', _emberRuntime.Controller.extend({ + init: function () { + this.set('title', 'It\'s Simple Made Easy'); + }, + + willDestroy: function () { + this._super.apply(this, arguments); + willDestroyFired++; + } + })); + + this.registerTemplate('post', '

{{title}}

'); + + this.render('{{#if showPost}}{{render \'post\'}}{{else}}Nothing here{{/if}}', { showPost: false }); + + this.assertText('Nothing here'); + + assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertText('Nothing here'); + + assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'showPost', true); + }); + + this.assertText('It\'s Simple Made Easy'); + + assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'showPost', false); + }); + + this.assertText('Nothing here'); + + assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); + }; + + _class.prototype['@test should render given template with a supplied model'] = function testShouldRenderGivenTemplateWithASuppliedModel() { + var _this4 = this; + + this.owner.register('controller:post', _emberRuntime.Controller.extend()); + this.registerTemplate('post', '

{{model.title}}

'); + + expectDeprecation(function () { + _this4.render('

HI

{{render \'post\' post}}', { + post: { + title: 'It\'s Simple Made Easy' + } + }); + }, /Please refactor [\w\{\}"` ]+ to a component/); + + this.assertText('HIIt\'s Simple Made Easy'); + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assertText('HIIt\'s Simple Made Easy'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'post.title', 'Rails is omakase'); + }); + + this.assertText('HIRails is omakase'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'post', { title: 'It\'s Simple Made Easy' }); + }); + + this.assertText('HIIt\'s Simple Made Easy'); + }; + + _class.prototype['@test should destroy the non-singleton controllers on teardown'] = function testShouldDestroyTheNonSingletonControllersOnTeardown(assert) { + var _this5 = this; + + var willDestroyFired = 0; + + this.owner.register('controller:post', _emberRuntime.Controller.extend({ + willDestroy: function () { + this._super.apply(this, arguments); + willDestroyFired++; + } + })); + + this.registerTemplate('post', '

{{model.title}}

'); + + expectDeprecation(function () { + _this5.render('{{#if showPost}}{{render \'post\' post}}{{else}}Nothing here{{/if}}', { + showPost: false, + post: { + title: 'It\'s Simple Made Easy' + } + }); + }, /Please refactor [\w\{\}"` ]+ to a component/); + + this.assertText('Nothing here'); + + assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); + + this.runTask(function () { + return _this5.rerender(); + }); + + this.assertText('Nothing here'); + + assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'showPost', true); + }); + + this.assertText('It\'s Simple Made Easy'); + + assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'showPost', false); + }); + + this.assertText('Nothing here'); + + assert.strictEqual(willDestroyFired, 1, 'it did destroy the controller'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'showPost', true); + }); + + this.assertText('It\'s Simple Made Easy'); + + assert.strictEqual(willDestroyFired, 1, 'it did not destroy the controller'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'showPost', false); + }); + + this.assertText('Nothing here'); + + assert.strictEqual(willDestroyFired, 2, 'it did destroy the controller'); + }; + + _class.prototype['@test with a supplied model should not fire observers on the controller'] = function testWithASuppliedModelShouldNotFireObserversOnTheController() { + var _this6 = this; + + this.owner.register('controller:post', _emberRuntime.Controller.extend()); + this.registerTemplate('post', '

{{model.title}}

'); + + var postDidChange = 0; + expectDeprecation(function () { + _this6.render('

HI

{{render \'post\' post}}', { + postDidChange: _emberMetal.observer('post', function () { + postDidChange++; + }), + post: { + title: 'It\'s Simple Made Easy' + } + }); + }, /Please refactor [\w\{\}"` ]+ to a component/); + + this.assertText('HIIt\'s Simple Made Easy'); + + this.runTask(function () { + return _this6.rerender(); + }); + + this.assertText('HIIt\'s Simple Made Easy'); + }; + + _class.prototype['@test should raise an error when a given controller name does not resolve to a controller'] = function testShouldRaiseAnErrorWhenAGivenControllerNameDoesNotResolveToAController() { + var _this7 = this; + + this.registerTemplate('home', '

BYE

'); + this.owner.register('controller:posts', _emberRuntime.Controller.extend()); + expectAssertion(function () { + _this7.render('

HI

{{render "home" controller="postss"}}'); + }, /The controller name you supplied \'postss\' did not resolve to a controller./); + }; + + _class.prototype['@test should render with given controller'] = function testShouldRenderWithGivenController(assert) { + var _this8 = this; + + this.registerTemplate('home', '{{uniqueId}}'); + + var id = 0; + var model = {}; + + this.owner.register('controller:posts', _emberRuntime.Controller.extend({ + init: function () { + this._super.apply(this, arguments); + this.uniqueId = id++; + this.set('model', model); + } + })); + + this.render('{{render "home" controller="posts"}}'); + var renderedController = this.owner.lookup('controller:posts'); + var uniqueId = renderedController.get('uniqueId'); + var renderedModel = renderedController.get('model'); + + assert.equal(uniqueId, 0); + assert.equal(renderedModel, model); + this.assertText('0'); + + this.runTask(function () { + return _this8.rerender(); + }); + + assert.equal(uniqueId, 0); + assert.equal(renderedModel, model); + this.assertText('0'); + }; + + _class.prototype['@test should render templates with models multiple times'] = function testShouldRenderTemplatesWithModelsMultipleTimes(assert) { + var _this9 = this; + + this.owner.register('controller:post', _emberRuntime.Controller.extend()); + + this.registerTemplate('post', '

{{model.title}}

'); + expectDeprecation(function () { + _this9.render('

HI

{{render \'post\' post1}} {{render \'post\' post2}}', { + post1: { + title: 'Me First' + }, + post2: { + title: 'Then me' + } + }); + }, /Please refactor [\w\{\}"` ]+ to a component/); + + this.assertText('HI Me First Then me'); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertText('HI Me First Then me'); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'post1.title', 'I am new'); + }); + + this.assertText('HI I am new Then me'); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'post1', { title: 'Me First' }); + }); + + this.assertText('HI Me First Then me'); + }; + + _class.prototype['@test should not treat invocations with falsy contexts as context-less'] = function testShouldNotTreatInvocationsWithFalsyContextsAsContextLess(assert) { + var _this10 = this; + + this.registerTemplate('post', '

{{#unless model.zero}}NOTHING{{/unless}}

'); + this.owner.register('controller:post', _emberRuntime.Controller.extend()); + + expectDeprecation(function () { + _this10.render('

HI

{{render \'post\' zero}} {{render \'post\' nonexistent}}', { + model: { + zero: false + } + }); + }, /Please refactor [\w\{\}"` ]+ to a component/); + + assert.ok(this.$().text().match(/^HI ?NOTHING ?NOTHING$/)); + }; + + _class.prototype['@test should render templates both with and without models'] = function testShouldRenderTemplatesBothWithAndWithoutModels(assert) { + var _this11 = this; + + this.registerTemplate('post', '

Title:{{model.title}}

'); + this.owner.register('controller:post', _emberRuntime.Controller.extend()); + + var post = { + title: 'Rails is omakase' + }; + expectDeprecation(function () { + _this11.render('

HI

{{render \'post\'}} {{render \'post\' post}}', { + post: post + }); + }, /Please refactor [\w\{\}"` ]+ to a component/); + + assert.ok(this.$().text().match(/^HI ?Title: ?Title:Rails is omakase$/)); + + this.runTask(function () { + return _this11.rerender(); + }); + + assert.ok(this.$().text().match(/^HI ?Title: ?Title:Rails is omakase$/)); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'post.title', 'Simple Made Easy'); + }); + + assert.ok(this.$().text().match(/^HI ?Title: ?Title:Simple Made Easy$/)); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'post', { title: 'Rails is omakase' }); + }); + + assert.ok(this.$().text().match(/^HI ?Title: ?Title:Rails is omakase$/)); + }; + + _class.prototype['@test works with dot notation'] = function testWorksWithDotNotation() { + this.registerTemplate('blog.post', '{{uniqueId}}'); + + var id = 0; + this.owner.register('controller:blog.post', _emberRuntime.Controller.extend({ + init: function () { + this._super.apply(this, arguments); + this.uniqueId = id++; + } + })); + + this.render('{{render "blog.post"}}'); + + this.assertText('0'); + }; + + _class.prototype['@test throws an assertion if called with an unquoted template name'] = function testThrowsAnAssertionIfCalledWithAnUnquotedTemplateName() { + var _this12 = this; + + this.registerTemplate('home', '

BYE

'); + + expectAssertion(function () { + _this12.render('

HI

{{render home}}'); + }, 'The first argument of {{render}} must be quoted, e.g. {{render "sidebar"}}.'); + }; + + _class.prototype['@test throws an assertion if called with a literal for a model'] = function testThrowsAnAssertionIfCalledWithALiteralForAModel() { + var _this13 = this; + + this.registerTemplate('home', '

BYE

'); + expectAssertion(function () { + _this13.render('

HI

{{render "home" "model"}}', { + model: { + title: 'Simple Made Easy' + } + }); + }, 'The second argument of {{render}} must be a path, e.g. {{render "post" post}}.'); + }; + + _class.prototype['@test should set router as target when action not found on parentController is not found'] = function testShouldSetRouterAsTargetWhenActionNotFoundOnParentControllerIsNotFound(assert) { + var _this14 = this; + + var postController = undefined; + this.registerTemplate('post', 'post template'); + this.owner.register('controller:post', _emberRuntime.Controller.extend({ + init: function () { + this._super.apply(this, arguments); + postController = this; + } + })); + + var routerStub = { + send: function (actionName) { + assert.equal(actionName, 'someAction'); + assert.ok(true, 'routerStub#send called'); + } + }; + + this.owner.register('router:main', routerStub, { instantiate: false }); + + expectDeprecation(function () { + _this14.render('{{render \'post\' post1}}'); + }, /Please refactor [\w\{\}"` ]+ to a component/); + + postController.send('someAction'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/render-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/render-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/render-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/render-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/render-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/render-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/text-area-test', ['exports', 'ember-utils', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/test-helpers', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberUtils, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsTestHelpers, _emberGlimmerTestsUtilsAbstractTestCase) { + 'use strict'; + + var TextAreaRenderingTest = (function (_RenderingTest) { + babelHelpers.inherits(TextAreaRenderingTest, _RenderingTest); + + function TextAreaRenderingTest() { + babelHelpers.classCallCheck(this, TextAreaRenderingTest); + + _RenderingTest.call(this); + + this.registerComponent('-text-area', { ComponentClass: _emberGlimmerTestsUtilsHelpers.TextArea }); + } + + TextAreaRenderingTest.prototype.assertTextArea = function assertTextArea() { + var _ref2 = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + + var attrs = _ref2.attrs; + var value = _ref2.value; + + var mergedAttrs = _emberUtils.assign({ 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view ember-text-area') }, attrs); + this.assertComponentElement(this.firstChild, { tagName: 'textarea', attrs: mergedAttrs }); + + if (value) { + this.assert.strictEqual(value, this.firstChild.value); + } + }; + + TextAreaRenderingTest.prototype.triggerEvent = function triggerEvent(type) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + var event = document.createEvent('Events'); + event.initEvent(type, true, true); + _emberUtils.assign(event, options); + + this.firstChild.dispatchEvent(event); + }; + + return TextAreaRenderingTest; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest); + + var BoundTextAreaAttributes = (function () { + function BoundTextAreaAttributes(cases) { + babelHelpers.classCallCheck(this, BoundTextAreaAttributes); + + this.cases = cases; + } + + BoundTextAreaAttributes.prototype.generate = function generate(_ref3) { + var _ref; + + var attribute = _ref3.attribute; + var first = _ref3.first; + var second = _ref3.second; + + return _ref = {}, _ref['@test ' + attribute] = function (assert) { + var _attrs, + _attrs2, + _attrs3, + _this = this; + + this.render('{{textarea ' + attribute + '=value}}', { + value: first + }); + this.assertTextArea({ attrs: (_attrs = {}, _attrs[attribute] = first, _attrs) }); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'value', second); + }); + this.assertTextArea({ attrs: (_attrs2 = {}, _attrs2[attribute] = second, _attrs2) }); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'value', first); + }); + this.assertTextArea({ attrs: (_attrs3 = {}, _attrs3[attribute] = first, _attrs3) }); + }, _ref; + }; + + return BoundTextAreaAttributes; + })(); + + _emberGlimmerTestsUtilsAbstractTestCase.applyMixins(TextAreaRenderingTest, new BoundTextAreaAttributes([{ attribute: 'placeholder', first: 'Stuff here', second: 'Other stuff' }, { attribute: 'name', first: 'Stuff here', second: 'Other stuff' }, { attribute: 'title', first: 'Stuff here', second: 'Other stuff' }, { attribute: 'maxlength', first: '1', second: '2' }, { attribute: 'rows', first: '1', second: '2' }, { attribute: 'cols', first: '1', second: '2' }, { attribute: 'tabindex', first: '1', second: '2' }])); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{textarea}}', (function (_TextAreaRenderingTest) { + babelHelpers.inherits(_class, _TextAreaRenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _TextAreaRenderingTest.apply(this, arguments); + } + + _class.prototype['@test Should insert a textarea'] = function testShouldInsertATextarea() { + this.render('{{textarea}}'); + + equal(this.$('textarea').length, 1); + + this.assertStableRerender(); + }; + + _class.prototype['@test Should respect disabled'] = function testShouldRespectDisabled() { + this.render('{{textarea disabled=disabled}}', { + disabled: true + }); + ok(this.$('textarea').is(':disabled')); + }; + + _class.prototype['@test Should respect disabled when false'] = function testShouldRespectDisabledWhenFalse() { + this.render('{{textarea disabled=disabled}}', { + disabled: false + }); + ok(this.$('textarea').is(':not(:disabled)')); + }; + + _class.prototype['@test Should become disabled when the context changes'] = function testShouldBecomeDisabledWhenTheContextChanges() { + var _this2 = this; + + this.render('{{textarea disabled=disabled}}'); + ok(this.$('textarea').is(':not(:disabled)')); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'disabled', true); + }); + ok(this.$('textarea').is(':disabled')); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'disabled', false); + }); + ok(this.$('textarea').is(':not(:disabled)')); + }; + + _class.prototype['@test Should bind its contents to the specified value'] = function testShouldBindItsContentsToTheSpecifiedValue() { + var _this3 = this; + + this.render('{{textarea value=model.val}}', { + model: { val: 'A beautiful day in Seattle' } + }); + this.assertTextArea({ value: 'A beautiful day in Seattle' }); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'model.val', 'Auckland'); + }); + this.assertTextArea({ value: 'Auckland' }); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'model', { val: 'A beautiful day in Seattle' }); + }); + this.assertTextArea({ value: 'A beautiful day in Seattle' }); + }; + + _class.prototype['@test GH#14001 Should correctly handle an empty string bound value'] = function testGH14001ShouldCorrectlyHandleAnEmptyStringBoundValue() { + var _this4 = this; + + this.render('{{textarea value=message}}', { message: '' }); + + this.assert.strictEqual(this.firstChild.value, ''); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'message', 'hello'); + }); + + this.assert.strictEqual(this.firstChild.value, 'hello'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'message', ''); + }); + + this.assert.strictEqual(this.firstChild.value, ''); + }; + + _class.prototype['@test should update the value for `cut` / `input` / `change` events'] = function testShouldUpdateTheValueForCutInputChangeEvents() { + var _this5 = this; + + this.render('{{textarea value=model.val}}', { + model: { val: 'A beautiful day in Seattle' } + }); + this.assertTextArea({ value: 'A beautiful day in Seattle' }); + + this.assertStableRerender(); + + this.runTask(function () { + _this5.firstChild.value = 'Auckland'; + _this5.triggerEvent('cut'); + }); + this.assertTextArea({ value: 'Auckland' }); + + this.runTask(function () { + _this5.firstChild.value = 'Hope'; + _this5.triggerEvent('paste'); + }); + this.assertTextArea({ value: 'Hope' }); + + this.runTask(function () { + _this5.firstChild.value = 'Boston'; + _this5.triggerEvent('input'); + }); + this.assertTextArea({ value: 'Boston' }); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'model', { val: 'A beautiful day in Seattle' }); + }); + this.assertTextArea({ value: 'A beautiful day in Seattle' }); + }; + + return _class; + })(TextAreaRenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/text-area-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/text-area-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/text-area-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/text-area-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/text-area-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/text-area-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/unbound-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-runtime'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberRuntime) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n \n '], ['\n \n ']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n {{unbound (surround model.prefix model.value "bar")}} {{surround model.prefix model.value "bar"}} {{unbound (surround "bar" model.value model.suffix)}} {{surround "bar" model.value model.suffix}}'], ['\n {{unbound (surround model.prefix model.value "bar")}} {{surround model.prefix model.value "bar"}} {{unbound (surround "bar" model.value model.suffix)}} {{surround "bar" model.value model.suffix}}']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if (unbound model.foo)}}\n {{#if model.bar}}true{{/if}}\n {{#unless model.bar}}false{{/unless}}\n {{/if}}\n {{#unless (unbound model.notfoo)}}\n {{#if model.bar}}true{{/if}}\n {{#unless model.bar}}false{{/unless}}\n {{/unless}}'], ['\n {{#if (unbound model.foo)}}\n {{#if model.bar}}true{{/if}}\n {{#unless model.bar}}false{{/unless}}\n {{/if}}\n {{#unless (unbound model.notfoo)}}\n {{#if model.bar}}true{{/if}}\n {{#unless model.bar}}false{{/unless}}\n {{/unless}}']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{unbound}}', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { +babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test should be able to output a property without binding'] = function testShouldBeAbleToOutputAPropertyWithoutBinding() { + var _this = this; + + this.render('
{{unbound content.anUnboundString}}
', { + content: { + anUnboundString: 'No spans here, son.' + } + }); + + this.assertText('No spans here, son.'); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertText('No spans here, son.'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'content.anUnboundString', 'HEY'); + }); + + this.assertText('No spans here, son.'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'content', { + anUnboundString: 'No spans here, son.' + }); + }); + + this.assertText('No spans here, son.'); + }; + + _class.prototype['@test should be able to use unbound helper in #each helper'] = function testShouldBeAbleToUseUnboundHelperInEachHelper() { + var _this2 = this; + + this.render('
    {{#each items as |item|}}
  • {{unbound item}}
  • {{/each}}
', { + items: _emberRuntime.A(['a', 'b', 'c', 1, 2, 3]) + }); + + this.assertText('abc123'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertText('abc123'); + }; + + _class.prototype['@test should be able to use unbound helper in #each helper (with objects)'] = function testShouldBeAbleToUseUnboundHelperInEachHelperWithObjects() { + var _this3 = this; + + this.render('
    {{#each items as |item|}}
  • {{unbound item.wham}}
  • {{/each}}
', { + items: _emberRuntime.A([{ wham: 'bam' }, { wham: 1 }]) + }); + + this.assertText('bam1'); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertText('bam1'); + + this.runTask(function () { + return _this3.context.items.setEach('wham', 'HEY'); + }); + + this.assertText('bam1'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'items', _emberRuntime.A([{ wham: 'bam' }, { wham: 1 }])); + }); + + this.assertText('bam1'); + }; + + _class.prototype['@test it should assert unbound cannot be called with multiple arguments'] = function testItShouldAssertUnboundCannotBeCalledWithMultipleArguments() { + var _this4 = this; + + var willThrow = function () { + _this4.render('{{unbound foo bar}}', { + foo: 'BORK', + bar: 'BLOOP' + }); + }; + + expectAssertion(willThrow, /unbound helper cannot be called with multiple params or hash params/); + }; + + _class.prototype['@test should render on attributes'] = function testShouldRenderOnAttributes() { + var _this5 = this; + + this.render('', { + model: { foo: 'BORK' } + }); + + this.assertHTML(''); + + this.runTask(function () { + return _this5.rerender(); + }); + + this.assertHTML(''); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'model.foo', 'OOF'); + }); + + this.assertHTML(''); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'model', { foo: 'BORK' }); + }); + + this.assertHTML(''); + }; + + _class.prototype['@test should property escape unsafe hrefs'] = function testShouldPropertyEscapeUnsafeHrefs() { + var _this6 = this; + + var unsafeUrls = _emberRuntime.A([{ + name: 'Bob', + url: 'javascript:bob-is-cool' // jshint ignore:line + }, { + name: 'James', + url: 'vbscript:james-is-cool' // jshint ignore:line + }, { + name: 'Richard', + url: 'javascript:richard-is-cool' // jshint ignore:line + }]); + + this.render('', { + people: unsafeUrls + }); + + var escapedHtml = _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject); + + this.assertHTML(escapedHtml); + + this.runTask(function () { + return _this6.rerender(); + }); + + this.assertHTML(escapedHtml); + + this.runTask(function () { + return _this6.context.people.setEach('url', 'http://google.com'); + }); + + this.assertHTML(escapedHtml); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'people', unsafeUrls); + }); + + this.assertHTML(escapedHtml); + }; + + _class.prototype['@skip helper form updates on parent re-render'] = function skipHelperFormUpdatesOnParentReRender() { + var _this7 = this; + + this.render('{{unbound foo}}', { + foo: 'BORK' + }); + + this.assertText('BORK'); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertText('BORK'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'foo', 'OOF'); + }); + + this.assertText('BORK'); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertText('OOF'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'foo', ''); + }); + + this.assertText('OOF'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'foo', 'BORK'); + }); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertText('BORK'); + }; + + // semantics here is not guaranteed + + _class.prototype['@test sexpr form does not update no matter what'] = function testSexprFormDoesNotUpdateNoMatterWhat() { + var _this8 = this; + + this.registerHelper('capitalize', function (args) { + return args[0].toUpperCase(); + }); + + this.render('{{capitalize (unbound foo)}}', { + foo: 'bork' + }); + + this.assertText('BORK'); + + this.runTask(function () { + return _this8.rerender(); + }); + + this.assertText('BORK'); + + this.runTask(function () { + _emberMetal.set(_this8.context, 'foo', 'oof'); + _this8.rerender(); + }); + + this.assertText('BORK'); + + this.runTask(function () { + return _emberMetal.set(_this8.context, 'foo', 'blip'); + }); + + this.assertText('BORK'); + + this.runTask(function () { + _emberMetal.set(_this8.context, 'foo', 'bork'); + _this8.rerender(); + }); + + this.assertText('BORK'); + }; + + _class.prototype['@test sexpr in helper form does not update on parent re-render'] = function testSexprInHelperFormDoesNotUpdateOnParentReRender() { + var _this9 = this; + + this.registerHelper('capitalize', function (params) { + return params[0].toUpperCase(); + }); + + this.registerHelper('doublize', function (params) { + return params[0] + ' ' + params[0]; + }); + + this.render('{{capitalize (unbound (doublize foo))}}', { + foo: 'bork' + }); + + this.assertText('BORK BORK'); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertText('BORK BORK'); + + this.runTask(function () { + _emberMetal.set(_this9.context, 'foo', 'oof'); + _this9.rerender(); + }); + + this.assertText('BORK BORK'); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'foo', 'blip'); + }); + + this.assertText('BORK BORK'); + + this.runTask(function () { + _emberMetal.set(_this9.context, 'foo', 'bork'); + _this9.rerender(); + }); + + this.assertText('BORK BORK'); + }; + + _class.prototype['@test should be able to render an unbound helper invocation'] = function testShouldBeAbleToRenderAnUnboundHelperInvocation() { + var _this10 = this; + + this.registerHelper('repeat', function (_ref, _ref2) { + var value = _ref[0]; + var count = _ref2.count; + + var a = []; + while (a.length < count) { + a.push(value); + } + return a.join(''); + }); + + this.render('{{unbound (repeat foo count=bar)}} {{repeat foo count=bar}} {{unbound (repeat foo count=2)}} {{repeat foo count=4}}', { + foo: 'X', + bar: 5 + }); + + this.assertText('XXXXX XXXXX XX XXXX'); + + this.runTask(function () { + return _this10.rerender(); + }); + + this.assertText('XXXXX XXXXX XX XXXX'); + + this.runTask(function () { + return _emberMetal.set(_this10.context, 'bar', 1); + }); + + this.assertText('XXXXX X XX XXXX'); + + this.runTask(function () { + return _emberMetal.set(_this10.context, 'bar', 5); + }); + + this.assertText('XXXXX XXXXX XX XXXX'); + }; + + _class.prototype['@test should be able to render an bound helper invocation mixed with static values'] = function testShouldBeAbleToRenderAnBoundHelperInvocationMixedWithStaticValues() { + var _this11 = this; + + this.registerHelper('surround', function (_ref3) { + var prefix = _ref3[0]; + var value = _ref3[1]; + var suffix = _ref3[2]; + return prefix + '-' + value + '-' + suffix; + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2), { + model: { + prefix: 'before', + value: 'core', + suffix: 'after' + } + }); + + this.assertText('before-core-bar before-core-bar bar-core-after bar-core-after'); + + this.runTask(function () { + return _this11.rerender(); + }); + + this.assertText('before-core-bar before-core-bar bar-core-after bar-core-after'); + + this.runTask(function () { + _emberMetal.setProperties(_this11.context.model, { + prefix: 'beforeChanged', + value: 'coreChanged', + suffix: 'afterChanged' + }); + }); + + this.assertText('before-core-bar beforeChanged-coreChanged-bar bar-core-after bar-coreChanged-afterChanged'); + + this.runTask(function () { + _emberMetal.set(_this11.context, 'model', { + prefix: 'before', + value: 'core', + suffix: 'after' + }); + }); + + this.assertText('before-core-bar before-core-bar bar-core-after bar-core-after'); + }; + + _class.prototype['@test should be able to render unbound forms of multi-arg helpers'] = function testShouldBeAbleToRenderUnboundFormsOfMultiArgHelpers() { + var _this12 = this; + + this.registerHelper('fauxconcat', function (params) { + return params.join(''); + }); + + this.render('{{fauxconcat model.foo model.bar model.bing}} {{unbound (fauxconcat model.foo model.bar model.bing)}}', { + model: { + foo: 'a', + bar: 'b', + bing: 'c' + } + }); + + this.assertText('abc abc'); + + this.runTask(function () { + return _this12.rerender(); + }); + + this.assertText('abc abc'); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'model.bar', 'X'); + }); + + this.assertText('aXc abc'); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'model', { + foo: 'a', + bar: 'b', + bing: 'c' + }); + }); + + this.assertText('abc abc'); + }; + + _class.prototype['@test should be able to render an unbound helper invocation for helpers with dependent keys'] = function testShouldBeAbleToRenderAnUnboundHelperInvocationForHelpersWithDependentKeys() { + var _this13 = this; + + this.registerHelper('capitalizeName', { + destroy: function () { + this.removeObserver('value.firstName'); + this._super.apply(this, arguments); + }, + + compute: function (_ref4) { + var value = _ref4[0]; + + if (this.get('value')) { + this.removeObserver('value.firstName'); + } + this.set('value', value); + this.addObserver('value.firstName', this, this.recompute); + return value ? _emberMetal.get(value, 'firstName').toUpperCase() : ''; + } + }); + + this.registerHelper('concatNames', { + destroy: function () { + this.teardown(); + this._super.apply(this, arguments); + }, + teardown: function () { + this.removeObserver('value.firstName'); + this.removeObserver('value.lastName'); + }, + compute: function (_ref5) { + var value = _ref5[0]; + + if (this.get('value')) { + this.teardown(); + } + this.set('value', value); + this.addObserver('value.firstName', this, this.recompute); + this.addObserver('value.lastName', this, this.recompute); + return (value ? _emberMetal.get(value, 'firstName') : '') + (value ? _emberMetal.get(value, 'lastName') : ''); + } + }); + + this.render('{{capitalizeName person}} {{unbound (capitalizeName person)}} {{concatNames person}} {{unbound (concatNames person)}}', { + person: { + firstName: 'shooby', + lastName: 'taylor' + } + }); + + this.assertText('SHOOBY SHOOBY shoobytaylor shoobytaylor'); + + this.runTask(function () { + return _this13.rerender(); + }); + + this.assertText('SHOOBY SHOOBY shoobytaylor shoobytaylor'); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'person.firstName', 'sally'); + }); + + this.assertText('SALLY SHOOBY sallytaylor shoobytaylor'); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'person', { + firstName: 'shooby', + lastName: 'taylor' + }); + }); + + this.assertText('SHOOBY SHOOBY shoobytaylor shoobytaylor'); + }; + + _class.prototype['@test should be able to render an unbound helper invocation in #each helper'] = function testShouldBeAbleToRenderAnUnboundHelperInvocationInEachHelper() { + var _this14 = this; + + this.registerHelper('capitalize', function (params) { + return params[0].toUpperCase(); + }); + + this.render('{{#each people as |person|}}{{capitalize person.firstName}} {{unbound (capitalize person.firstName)}}{{/each}}', { + people: _emberRuntime.A([{ + firstName: 'shooby', + lastName: 'taylor' + }, { + firstName: 'cindy', + lastName: 'taylor' + }]) + }); + + this.assertText('SHOOBY SHOOBYCINDY CINDY'); + + this.runTask(function () { + return _this14.rerender(); + }); + + this.assertText('SHOOBY SHOOBYCINDY CINDY'); + + this.runTask(function () { + return _this14.context.people.setEach('firstName', 'chad'); + }); + + this.assertText('CHAD SHOOBYCHAD CINDY'); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'people', _emberRuntime.A([{ + firstName: 'shooby', + lastName: 'taylor' + }, { + firstName: 'cindy', + lastName: 'taylor' + }])); + }); + + this.assertText('SHOOBY SHOOBYCINDY CINDY'); + }; + + _class.prototype['@test should be able to render an unbound helper invocation with bound hash options'] = function testShouldBeAbleToRenderAnUnboundHelperInvocationWithBoundHashOptions() { + var _this15 = this; + + this.registerHelper('capitalizeName', { + destroy: function () { + this.removeObserver('value.firstName'); + this._super.apply(this, arguments); + }, + + compute: function (_ref6) { + var value = _ref6[0]; + + if (this.get('value')) { + this.removeObserver('value.firstName'); + } + this.set('value', value); + this.addObserver('value.firstName', this, this.recompute); + return value ? _emberMetal.get(value, 'firstName').toUpperCase() : ''; + } + }); + + this.registerHelper('concatNames', { + destroy: function () { + this.teardown(); + this._super.apply(this, arguments); + }, + teardown: function () { + this.removeObserver('value.firstName'); + this.removeObserver('value.lastName'); + }, + compute: function (_ref7) { + var value = _ref7[0]; + + if (this.get('value')) { + this.teardown(); + } + this.set('value', value); + this.addObserver('value.firstName', this, this.recompute); + this.addObserver('value.lastName', this, this.recompute); + return (value ? _emberMetal.get(value, 'firstName') : '') + (value ? _emberMetal.get(value, 'lastName') : ''); + } + }); + + this.render('{{capitalizeName person}} {{unbound (capitalizeName person)}} {{concatNames person}} {{unbound (concatNames person)}}', { + person: { + firstName: 'shooby', + lastName: 'taylor' + } + }); + + this.assertText('SHOOBY SHOOBY shoobytaylor shoobytaylor'); + + this.runTask(function () { + return _this15.rerender(); + }); + + this.assertText('SHOOBY SHOOBY shoobytaylor shoobytaylor'); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'person.firstName', 'sally'); + }); + + this.assertText('SALLY SHOOBY sallytaylor shoobytaylor'); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'person', { + firstName: 'shooby', + lastName: 'taylor' + }); + }); + + this.assertText('SHOOBY SHOOBY shoobytaylor shoobytaylor'); + }; + + _class.prototype['@test should be able to render bound form of a helper inside unbound form of same helper'] = function testShouldBeAbleToRenderBoundFormOfAHelperInsideUnboundFormOfSameHelper() { + var _this16 = this; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3), { + model: { + foo: true, + notfoo: false, + bar: true + } + }); + + this.assertText('truetrue'); + + this.runTask(function () { + return _this16.rerender(); + }); + + this.assertText('truetrue'); + + this.runTask(function () { + return _emberMetal.set(_this16.context, 'model.bar', false); + }); + + this.assertText('falsefalse'); + + this.runTask(function () { + return _emberMetal.set(_this16.context, 'model', { + foo: true, + notfoo: false, + bar: true + }); + }); + + this.assertText('truetrue'); + }; + + _class.prototype['@test yielding unbound does not update'] = function testYieldingUnboundDoesNotUpdate() { + var _this17 = this; + + var fooBarInstance = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + fooBarInstance = this; + }, + model: { foo: 'bork' } + }); + + this.registerComponent('foo-bar', { + ComponentClass: FooBarComponent, + template: '{{yield (unbound model.foo)}}' + }); + + this.render('{{#foo-bar as |value|}}{{value}}{{/foo-bar}}'); + + this.assertText('bork'); + + this.runTask(function () { + return _this17.rerender(); + }); + + this.assertText('bork'); + + this.runTask(function () { + return _emberMetal.set(fooBarInstance, 'model.foo', 'oof'); + }); + + this.assertText('bork'); + + this.runTask(function () { + return _emberMetal.set(fooBarInstance, 'model', { foo: 'bork' }); + }); + + this.assertText('bork'); + }; + + _class.prototype['@test yielding unbound hash does not update'] = function testYieldingUnboundHashDoesNotUpdate() { + var _this18 = this; + + var fooBarInstance = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + fooBarInstance = this; + }, + model: { foo: 'bork' } + }); + + this.registerComponent('foo-bar', { + ComponentClass: FooBarComponent, + template: '{{yield (unbound (hash foo=model.foo))}}' + }); + + this.render('{{#foo-bar as |value|}}{{value.foo}}{{/foo-bar}}'); + + this.assertText('bork'); + + this.runTask(function () { + return _this18.rerender(); + }); + + this.assertText('bork'); + + this.runTask(function () { + return _emberMetal.set(fooBarInstance, 'model.foo', 'oof'); + }); + + this.assertText('bork'); + + this.runTask(function () { + return _emberMetal.set(fooBarInstance, 'model', { foo: 'bork' }); + }); + + this.assertText('bork'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/unbound-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/unbound-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/unbound-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/unbound-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/unbound-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/unbound-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/yield-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal, _emberGlimmerTestsUtilsHelpers) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{yield}} helper', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test can yield to block'] = function testCanYieldToBlock() { + var _this = this; + + this.registerComponent('yield-comp', { template: '[In layout:] {{yield}}' }); + + this.render('{{#yield-comp}}[In Block:] {{object.title}}{{/yield-comp}}', { object: { title: 'Seattle' } }); + this.assertText('[In layout:] [In Block:] Seattle'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'object.title', 'Vancouver'); + }); + this.assertText('[In layout:] [In Block:] Vancouver'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'object', { title: 'Seattle' }); + }); + this.assertText('[In layout:] [In Block:] Seattle'); + }; + + _class.prototype['@test templates should yield to block inside a nested component'] = function testTemplatesShouldYieldToBlockInsideANestedComponent() { + var _this2 = this; + + this.registerComponent('outer-comp', { template: '
[In layout:] {{yield}}
' }); + this.registerComponent('inner-comp', { template: '{{#outer-comp}}[In Block:] {{object.title}}{{/outer-comp}}' }); + + this.render('{{inner-comp object=object}}', { object: { title: 'Seattle' } }); + this.assertText('[In layout:] [In Block:] Seattle'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'object.title', 'Vancouver'); + }); + this.assertText('[In layout:] [In Block:] Vancouver'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'object', { title: 'Seattle' }); + }); + this.assertText('[In layout:] [In Block:] Seattle'); + }; + + _class.prototype['@test templates should yield to block, when the yield is embedded in a each helper'] = function testTemplatesShouldYieldToBlockWhenTheYieldIsEmbeddedInAEachHelper() { + var _this3 = this; + + var list = [1, 2, 3]; + + this.registerComponent('outer-comp', { template: '{{#each list as |item|}}{{yield}}{{/each}}' }); + + this.render('{{#outer-comp list=list}}Hello{{/outer-comp}}', { list: list }); + this.assertText('HelloHelloHello'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'list', [4, 5]); + }); + this.assertText('HelloHello'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'list', list); + }); + this.assertText('HelloHelloHello'); + }; + + _class.prototype['@test templates should yield to block, when the yield is embedded in a if helper'] = function testTemplatesShouldYieldToBlockWhenTheYieldIsEmbeddedInAIfHelper() { + var _this4 = this; + + this.registerComponent('outer-comp', { template: '{{#if boolean}}{{yield}}{{/if}}' }); + + this.render('{{#outer-comp boolean=boolean}}Hello{{/outer-comp}}', { boolean: true }); + this.assertText('Hello'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'boolean', false); + }); + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'boolean', true); + }); + this.assertText('Hello'); + }; + + _class.prototype['@test simple curlies inside of a yielded clock should work when the yield is nested inside of another view'] = function testSimpleCurliesInsideOfAYieldedClockShouldWorkWhenTheYieldIsNestedInsideOfAnotherView() { + var _this5 = this; + + this.registerComponent('kiwi-comp', { template: '{{#if falsy}}{{else}}{{yield}}{{/if}}' }); + + this.render('{{#kiwi-comp}}{{text}}{{/kiwi-comp}}', { text: 'ohai' }); + this.assertText('ohai'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'text', 'portland'); + }); + this.assertText('portland'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'text', 'ohai'); + }); + this.assertText('ohai'); + }; + + _class.prototype['@test nested simple curlies inside of a yielded block should work when the yield is nested inside of another view'] = function testNestedSimpleCurliesInsideOfAYieldedBlockShouldWorkWhenTheYieldIsNestedInsideOfAnotherView() { + var _this6 = this; + + this.registerComponent('parent-comp', { template: '{{#if falsy}}{{else}}{{yield}}{{/if}}' }); + this.registerComponent('child-comp', { template: '{{#if falsy}}{{else}}{{text}}{{/if}}' }); + + this.render('{{#parent-comp}}{{child-comp text=text}}{{/parent-comp}}', { text: 'ohai' }); + this.assertText('ohai'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'text', 'portland'); + }); + this.assertText('portland'); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'text', 'ohai'); + }); + this.assertText('ohai'); + }; + + _class.prototype['@test yielding to a non-existent block is not an error'] = function testYieldingToANonExistentBlockIsNotAnError() { + var _this7 = this; + + this.registerComponent('yielding-comp', { template: 'Hello:{{yield}}' }); + this.registerComponent('outer-comp', { template: '{{yielding-comp}} {{title}}' }); + + this.render('{{outer-comp title=title}}', { title: 'Mr. Selden' }); + + this.assertText('Hello: Mr. Selden'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'title', 'Mr. Chag'); + }); + this.assertText('Hello: Mr. Chag'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'title', 'Mr. Selden'); + }); + this.assertText('Hello: Mr. Selden'); + }; + + _class.prototype['@test yield uses the original context'] = function testYieldUsesTheOriginalContext() { + var _this8 = this; + + var KiwiCompComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ boundText: 'Inner' }); + + this.registerComponent('kiwi-comp', { ComponentClass: KiwiCompComponent, template: '

{{boundText}}

{{yield}}

' }); + + this.render('{{#kiwi-comp}}{{boundText}}{{/kiwi-comp}}', { boundText: 'Original' }); + this.assertText('InnerOriginal'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this8.context, 'boundText', 'Otherworld'); + }); + this.assertText('InnerOtherworld'); + + this.runTask(function () { + return _emberMetal.set(_this8.context, 'boundText', 'Original'); + }); + this.assertText('InnerOriginal'); + }; + + _class.prototype['@test outer block param doesn\'t mask inner component property'] = function testOuterBlockParamDoesnTMaskInnerComponentProperty() { + var _this9 = this; + + var KiwiCompComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ boundText: 'Inner' }); + + this.registerComponent('kiwi-comp', { ComponentClass: KiwiCompComponent, template: '

{{boundText}}

{{yield}}

' }); + + this.render('{{#with boundText as |item|}}{{#kiwi-comp}}{{item}}{{/kiwi-comp}}{{/with}}', { boundText: 'Outer' }); + this.assertText('InnerOuter'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'boundText', 'Otherworld'); + }); + this.assertText('InnerOtherworld'); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'boundText', 'Outer'); + }); + this.assertText('InnerOuter'); + }; + + _class.prototype['@test inner block param doesn\'t mask yield property'] = function testInnerBlockParamDoesnTMaskYieldProperty() { + var _this10 = this; + + var KiwiCompComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ boundText: 'Inner' }); + + this.registerComponent('kiwi-comp', { ComponentClass: KiwiCompComponent, template: '{{#with boundText as |item|}}

{{item}}

{{yield}}

{{/with}}' }); + + this.render('{{#kiwi-comp}}{{item}}{{/kiwi-comp}}', { item: 'Outer' }); + this.assertText('InnerOuter'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this10.context, 'item', 'Otherworld'); + }); + this.assertText('InnerOtherworld'); + + this.runTask(function () { + return _emberMetal.set(_this10.context, 'item', 'Outer'); + }); + this.assertText('InnerOuter'); + }; + + _class.prototype['@test can bind a block param to a component and use it in yield'] = function testCanBindABlockParamToAComponentAndUseItInYield() { + var _this11 = this; + + this.registerComponent('kiwi-comp', { template: '

{{content}}

{{yield}}

' }); + + this.render('{{#with boundText as |item|}}{{#kiwi-comp content=item}}{{item}}{{/kiwi-comp}}{{/with}}', { boundText: 'Outer' }); + this.assertText('OuterOuter'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'boundText', 'Update'); + }); + this.assertText('UpdateUpdate'); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'boundText', 'Outer'); + }); + this.assertText('OuterOuter'); + }; + + // INUR not need with no data update + + _class.prototype['@test yield should not introduce a view'] = function testYieldShouldNotIntroduceAView() { + var ParentCompComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ isParentComponent: true }); + + var ChildCompComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + didReceiveAttrs: function () { + this._super(); + var parentView = this.get('parentView'); + + ok(parentView.get('isParentComponent')); + } + }); + + this.registerComponent('parent-comp', { ComponentClass: ParentCompComponent, template: '{{yield}}' }); + this.registerComponent('child-comp', { ComponentClass: ChildCompComponent }); + + this.render('{{#parent-comp}}{{child-comp}}{{/parent-comp}}'); + }; + + _class.prototype['@test yield with nested components (#3220)'] = function testYieldWithNestedComponents3220() { + var _this12 = this; + + this.registerComponent('inner-component', { template: '{{yield}}' }); + this.registerComponent('outer-component', { template: '{{#inner-component}}{{yield}}{{/inner-component}}' }); + + this.render('{{#outer-component}}Hello {{boundText}}{{/outer-component}}', { boundText: 'world' }); + this.assertText('Hello world'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'boundText', 'update'); + }); + this.assertText('Hello update'); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'boundText', 'world'); + }); + this.assertText('Hello world'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/yield-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/yield-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/yield-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/yield-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/yield-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/yield-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/input-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Input element tests', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype.runAttributeTest = function runAttributeTest(attributeName, values) { + var _this = this; + + var template = ''; + this.render(template, { value: values[0] }); + this.assertAttributeHasValue(attributeName, values[0], attributeName + ' is set on initial render'); + + this.runTask(function () { + return _this.rerender(); + }); + this.assertAttributeHasValue(attributeName, values[0], attributeName + ' is set on noop rerender'); + + this.setComponentValue(values[1]); + this.assertAttributeHasValue(attributeName, values[1], attributeName + ' is set on rerender'); + + this.setComponentValue(values[0]); + this.assertAttributeHasValue(attributeName, values[0], attributeName + ' can be set back to the initial value'); + }; + + _class.prototype.runPropertyTest = function runPropertyTest(propertyName, values) { + var _this2 = this; + + var attributeName = propertyName; + var template = ''; + this.render(template, { value: values[0] }); + this.assertPropertyHasValue(propertyName, values[0], propertyName + ' is set on initial render'); + + this.runTask(function () { + return _this2.rerender(); + }); + this.assertPropertyHasValue(propertyName, values[0], propertyName + ' is set on noop rerender'); + + this.setComponentValue(values[1]); + this.assertPropertyHasValue(propertyName, values[1], propertyName + ' is set on rerender'); + + this.setComponentValue(values[0]); + this.assertPropertyHasValue(propertyName, values[0], propertyName + ' can be set back to the initial value'); + }; + + _class.prototype.runFalsyValueProperty = function runFalsyValueProperty(values) { + var _this3 = this; + + var value = 'value'; + var template = ''; + this.render(template, { value: values[0] }); + this.assertPropertyHasValue(value, '', value + ' is set on initial render'); + + this.runTask(function () { + return _this3.rerender(); + }); + this.assertPropertyHasValue(value, '', value + ' is set on noop rerender'); + this.setComponentValue(values[1]); + + this.assertPropertyHasValue(value, values[1], value + ' is set on rerender'); + + this.setComponentValue(values[0]); + this.assertPropertyHasValue(value, '', value + ' can be set back to the initial value'); + }; + + _class.prototype['@test input disabled attribute'] = function testInputDisabledAttribute() { + var _this4 = this; + + var model = { model: { value: false } }; + + this.render('', model); + + this.assert.equal(this.$inputElement().prop('disabled'), false); + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assert.equal(this.$inputElement().prop('disabled'), false); + + this.runTask(function () { + return _this4.context.set('model.value', true); + }); + + this.assert.equal(this.$inputElement().prop('disabled'), true); + this.assertHTML(''); // Note the DOM output is + + this.runTask(function () { + return _this4.context.set('model.value', 'wat'); + }); + + this.assert.equal(this.$inputElement().prop('disabled'), true); + this.assertHTML(''); // Note the DOM output is + + this.runTask(function () { + return _this4.context.set('model', { value: false }); + }); + + this.assert.equal(this.$inputElement().prop('disabled'), false); + this.assertHTML(''); + }; + + _class.prototype['@test input value attribute'] = function testInputValueAttribute() { + this.runPropertyTest('value', ['foo', 'bar']); + }; + + _class.prototype['@test input placeholder attribute'] = function testInputPlaceholderAttribute() { + this.runAttributeTest('placeholder', ['foo', 'bar']); + }; + + _class.prototype['@test input name attribute'] = function testInputNameAttribute() { + this.runAttributeTest('name', ['nam', 'name']); + }; + + _class.prototype['@test input maxlength attribute'] = function testInputMaxlengthAttribute() { + this.runAttributeTest('maxlength', [2, 3]); + }; + + _class.prototype['@test input size attribute'] = function testInputSizeAttribute() { + this.runAttributeTest('size', [2, 3]); + }; + + _class.prototype['@test input tabindex attribute'] = function testInputTabindexAttribute() { + this.runAttributeTest('tabindex', [2, 3]); + }; + + _class.prototype['@test null input value'] = function testNullInputValue() { + this.runFalsyValueProperty([null, 'hello']); + }; + + _class.prototype['@test undefined input value'] = function testUndefinedInputValue() { + this.runFalsyValueProperty([undefined, 'hello']); + }; + + _class.prototype['@test undefined `toString` method as input value'] = function testUndefinedToStringMethodAsInputValue() { + this.runFalsyValueProperty([Object.create(null), 'hello']); + }; + + _class.prototype['@test cursor position is not lost when updating content'] = function testCursorPositionIsNotLostWhenUpdatingContent() { + var template = ''; + this.render(template, { value: 'hola' }); + + this.setDOMValue('hello'); + this.setSelectionRange(1, 3); + + this.setComponentValue('hello'); + + this.assertSelectionRange(1, 3); + + // Note: We should eventually get around to testing reseting, however + // browsers handle `selectionStart` and `selectionEnd` differently + // when are synthetically testing movement of the cursor. + }; + + _class.prototype['@test input can be updated multiple times'] = function testInputCanBeUpdatedMultipleTimes() { + var template = ''; + this.render(template, { value: 'hola' }); + + this.assertValue('hola', 'Value is initialised'); + + this.setComponentValue(''); + this.assertValue('', 'Value is set in the DOM'); + + this.setDOMValue('hola'); + this.setComponentValue('hola'); + this.assertValue('hola', 'Value is updated the first time'); + + this.setComponentValue(''); + this.assertValue('', 'Value is updated the second time'); + }; + + _class.prototype['@test DOM is SSOT if value is set'] = function testDOMIsSSOTIfValueIsSet() { + var template = ''; + this.render(template, { value: 'hola' }); + + this.assertValue('hola', 'Value is initialised'); + + this.setComponentValue('hello'); + + this.assertValue('hello', 'Value is initialised'); + + this.setDOMValue('hola'); + + this.assertValue('hola', 'DOM is used'); + + this.setComponentValue('bye'); + + this.assertValue('bye', 'Value is used'); + + // Simulates setting the input to the same value as it already is which won't cause a rerender + + this.setDOMValue('hola'); + + this.assertValue('hola', 'DOM is used'); + + this.setComponentValue('hola'); + + this.assertValue('hola', 'Value is used'); + }; + + // private helpers and assertions + + _class.prototype.setDOMValue = function setDOMValue(value) { + this.inputElement().value = value; + }; + + _class.prototype.setComponentValue = function setComponentValue(value) { + var _this5 = this; + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'value', value); + }); + }; + + _class.prototype.setSelectionRange = function setSelectionRange(start, end) { + this.inputElement().selectionStart = start; + this.inputElement().selectionEnd = end; + }; + + _class.prototype.inputElement = function inputElement() { + return this.$inputElement()[0]; + }; + + _class.prototype.$inputElement = function $inputElement() { + return this.$('input'); + }; + + _class.prototype.assertValue = function assertValue(value, message) { + this.assertPropertyHasValue('value', value, message); + }; + + _class.prototype.assertAttributeHasValue = function assertAttributeHasValue(attribute, value, message) { + this.assert.equal(this.$inputElement().attr(attribute), value, attribute + ' ' + message); + }; + + _class.prototype.assertPropertyHasValue = function assertPropertyHasValue(property, value, message) { + this.assert.equal(this.$inputElement().prop(property), value, property + ' ' + message); + }; + + _class.prototype.assertSelectionRange = function assertSelectionRange(start, end) { + this.assert.equal(this.inputElement().selectionStart, start); + this.assert.equal(this.inputElement().selectionEnd, end); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/input-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration'); + test('ember-glimmer/tests/integration/input-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/input-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/input-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration'); + QUnit.test('ember-glimmer/tests/integration/input-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/input-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/mount-test', ['exports', 'ember-utils', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-runtime', 'ember-metal', 'ember-application'], function (exports, _emberUtils, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberRuntime, _emberMetal, _emberApplication) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('{{mount}} assertions', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test it asserts that only a single param is passed'] = function testItAssertsThatOnlyASingleParamIsPassed() { + var _this = this; + + expectAssertion(function () { + _this.render('{{mount "chat" "foo"}}'); + }, /You can only pass a single argument to the {{mount}} helper, e.g. {{mount "chat-engine"}}./i); + }; + + _class.prototype['@test it asserts that the engine name argument is quoted'] = function testItAssertsThatTheEngineNameArgumentIsQuoted() { + var _this2 = this; + + expectAssertion(function () { + _this2.render('{{mount chat}}'); + }, /The first argument of {{mount}} must be quoted, e.g. {{mount "chat-engine"}}./i); + }; + + _class.prototype['@test it asserts that the specified engine is registered'] = function testItAssertsThatTheSpecifiedEngineIsRegistered() { + var _this3 = this; + + expectAssertion(function () { + _this3.render('{{mount "chat"}}'); + }, /You used `{{mount 'chat'}}`, but the engine 'chat' can not be found./i); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('{{mount}} test', (function (_ApplicationTest) { + babelHelpers.inherits(_class2, _ApplicationTest); + + function _class2() { + babelHelpers.classCallCheck(this, _class2); + + _ApplicationTest.call(this); + + var engineRegistrations = this.engineRegistrations = {}; + + this.registerEngine('chat', _emberApplication.Engine.extend({ + router: null, + + init: function () { + var _this4 = this; + + this._super.apply(this, arguments); + + Object.keys(engineRegistrations).forEach(function (fullName) { + _this4.register(fullName, engineRegistrations[fullName]); + }); + } + })); + + this.registerTemplate('index', '{{mount "chat"}}'); + } + + _class2.prototype['@test it boots an engine, instantiates its application controller, and renders its application template'] = function testItBootsAnEngineInstantiatesItsApplicationControllerAndRendersItsApplicationTemplate(assert) { + var _this5 = this; + + this.engineRegistrations['template:application'] = _emberGlimmerTestsUtilsHelpers.compile('

Chat here, {{username}}

', { moduleName: 'application' }); + + var controller = undefined; + + this.engineRegistrations['controller:application'] = _emberRuntime.Controller.extend({ + username: 'dgeb', + + init: function () { + this._super(); + controller = this; + } + }); + + return this.visit('/').then(function () { + assert.ok(controller, 'engine\'s application controller has been instantiated'); + + var engineInstance = _emberUtils.getOwner(controller); + assert.strictEqual(_emberApplication.getEngineParent(engineInstance), _this5.applicationInstance, 'engine instance has the application instance as its parent'); + + _this5.assertComponentElement(_this5.firstChild, { content: '

Chat here, dgeb

' }); + + _this5.runTask(function () { + return _emberMetal.set(controller, 'username', 'chancancode'); + }); + + _this5.assertComponentElement(_this5.firstChild, { content: '

Chat here, chancancode

' }); + + _this5.runTask(function () { + return _emberMetal.set(controller, 'username', 'dgeb'); + }); + + _this5.assertComponentElement(_this5.firstChild, { content: '

Chat here, dgeb

' }); + }); + }; + + return _class2; + })(_emberGlimmerTestsUtilsTestCase.ApplicationTest)); +}); +enifed('ember-glimmer/tests/integration/mount-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration'); + test('ember-glimmer/tests/integration/mount-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/mount-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/mount-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration'); + QUnit.test('ember-glimmer/tests/integration/mount-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/mount-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/outlet-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'internal-test-helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _internalTestHelpers, _emberMetal) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('outlet view', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + + var CoreOutlet = this.owner._lookupFactory('view:-outlet'); + this.component = CoreOutlet.create(); + } + + _class.prototype['@test should not error when initial rendered template is undefined'] = function testShouldNotErrorWhenInitialRenderedTemplateIsUndefined() { + var _this = this; + + var outletState = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'application', + controller: undefined, + ViewClass: undefined, + template: undefined + }, + + outlets: Object.create(null) + }; + + this.runTask(function () { + return _this.component.setOutletState(outletState); + }); + + _internalTestHelpers.runAppend(this.component); + + this.assertText(''); + }; + + _class.prototype['@test should render the outlet when set after DOM insertion'] = function testShouldRenderTheOutletWhenSetAfterDOMInsertion() { + var _this2 = this; + + var outletState = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'application', + controller: undefined, + ViewClass: undefined, + template: undefined + }, + + outlets: Object.create(null) + }; + + this.runTask(function () { + return _this2.component.setOutletState(outletState); + }); + + _internalTestHelpers.runAppend(this.component); + + this.assertText(''); + + this.registerTemplate('application', 'HI{{outlet}}'); + outletState = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'application', + controller: {}, + ViewClass: undefined, + template: this.owner.lookup('template:application') + }, + outlets: Object.create(null) + }; + + this.runTask(function () { + return _this2.component.setOutletState(outletState); + }); + + this.assertText('HI'); + + this.assertStableRerender(); + + this.registerTemplate('index', '

BYE

'); + outletState.outlets.main = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'index', + controller: {}, + ViewClass: undefined, + template: this.owner.lookup('template:index') + }, + outlets: Object.create(null) + }; + + this.runTask(function () { + return _this2.component.setOutletState(outletState); + }); + + this.assertText('HIBYE'); + }; + + _class.prototype['@test should render the outlet when set before DOM insertion'] = function testShouldRenderTheOutletWhenSetBeforeDOMInsertion() { + var _this3 = this; + + this.registerTemplate('application', 'HI{{outlet}}'); + var outletState = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'application', + controller: {}, + ViewClass: undefined, + template: this.owner.lookup('template:application') + }, + outlets: Object.create(null) + }; + + this.runTask(function () { + return _this3.component.setOutletState(outletState); + }); + + _internalTestHelpers.runAppend(this.component); + + this.assertText('HI'); + + this.assertStableRerender(); + + this.registerTemplate('index', '

BYE

'); + outletState.outlets.main = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'index', + controller: {}, + ViewClass: undefined, + template: this.owner.lookup('template:index') + }, + outlets: Object.create(null) + }; + + this.runTask(function () { + return _this3.component.setOutletState(outletState); + }); + + this.assertText('HIBYE'); + }; + + _class.prototype['@test should support an optional name'] = function testShouldSupportAnOptionalName() { + var _this4 = this; + + this.registerTemplate('application', '

HI

{{outlet "special"}}'); + var outletState = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'application', + controller: {}, + ViewClass: undefined, + template: this.owner.lookup('template:application') + }, + outlets: Object.create(null) + }; + + this.runTask(function () { + return _this4.component.setOutletState(outletState); + }); + + _internalTestHelpers.runAppend(this.component); + + this.assertText('HI'); + + this.assertStableRerender(); + + this.registerTemplate('special', '

BYE

'); + outletState.outlets.special = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'special', + controller: {}, + ViewClass: undefined, + template: this.owner.lookup('template:special') + }, + outlets: Object.create(null) + }; + + this.runTask(function () { + return _this4.component.setOutletState(outletState); + }); + + this.assertText('HIBYE'); + }; + + _class.prototype['@test does not default outlet name when positional argument is present'] = function testDoesNotDefaultOutletNameWhenPositionalArgumentIsPresent() { + var _this5 = this; + + this.registerTemplate('application', '

HI

{{outlet someUndefinedThing}}'); + var outletState = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'application', + controller: {}, + ViewClass: undefined, + template: this.owner.lookup('template:application') + }, + outlets: Object.create(null) + }; + + this.runTask(function () { + return _this5.component.setOutletState(outletState); + }); + + _internalTestHelpers.runAppend(this.component); + + this.assertText('HI'); + + this.assertStableRerender(); + + this.registerTemplate('special', '

BYE

'); + outletState.outlets.main = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'special', + controller: {}, + ViewClass: undefined, + template: this.owner.lookup('template:special') + }, + outlets: Object.create(null) + }; + + this.runTask(function () { + return _this5.component.setOutletState(outletState); + }); + + this.assertText('HI'); + }; + + _class.prototype['@test should support bound outlet name'] = function testShouldSupportBoundOutletName() { + var _this6 = this; + + var controller = { outletName: 'foo' }; + this.registerTemplate('application', '

HI

{{outlet outletName}}'); + var outletState = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'application', + controller: controller, + ViewClass: undefined, + template: this.owner.lookup('template:application') + }, + outlets: Object.create(null) + }; + + this.runTask(function () { + return _this6.component.setOutletState(outletState); + }); + + _internalTestHelpers.runAppend(this.component); + + this.assertText('HI'); + + this.assertStableRerender(); + + this.registerTemplate('foo', '

FOO

'); + outletState.outlets.foo = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'foo', + controller: {}, + ViewClass: undefined, + template: this.owner.lookup('template:foo') + }, + outlets: Object.create(null) + }; + + this.registerTemplate('bar', '

BAR

'); + outletState.outlets.bar = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'bar', + controller: {}, + ViewClass: undefined, + template: this.owner.lookup('template:bar') + }, + outlets: Object.create(null) + }; + + this.runTask(function () { + return _this6.component.setOutletState(outletState); + }); + + this.assertText('HIFOO'); + + this.runTask(function () { + return _emberMetal.set(controller, 'outletName', 'bar'); + }); + + this.assertText('HIBAR'); + }; + + _class.prototype['@test outletState can pass through user code (liquid-fire initimate API) '] = function testOutletStateCanPassThroughUserCodeLiquidFireInitimateAPI() { + var _this7 = this; + + this.registerTemplate('outer', 'A{{#-with-dynamic-vars outletState=(identity (-get-dynamic-var "outletState"))}}B{{outlet}}D{{/-with-dynamic-vars}}E'); + this.registerTemplate('inner', 'C'); + + // This looks like it doesn't do anything, but its presence + // guarantees that the outletState gets converted from a reference + // to a value and then back to a reference. That is what we're + // testing here. + this.registerHelper('identity', function (_ref) { + var a = _ref[0]; + return a; + }); + + var outletState = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'outer', + controller: {}, + ViewClass: undefined, + template: this.owner.lookup('template:outer') + }, + outlets: { + main: { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'inner', + controller: {}, + ViewClass: undefined, + template: this.owner.lookup('template:inner') + }, + outlets: Object.create(null) + } + } + }; + + this.runTask(function () { + return _this7.component.setOutletState(outletState); + }); + + _internalTestHelpers.runAppend(this.component); + + this.assertText('ABCDE'); + + this.assertStableRerender(); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/outlet-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration'); + test('ember-glimmer/tests/integration/outlet-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/outlet-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/outlet-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration'); + QUnit.test('ember-glimmer/tests/integration/outlet-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/outlet-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/refinements-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberMetal) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with var as |foo|}}\n {{foo}}\n {{/with}}\n\n ---\n\n {{#with var as |render|}}\n {{render}}\n {{/with}}\n\n ---\n\n {{#with var as |outlet|}}\n {{outlet}}\n {{/with}}\n\n ---\n\n {{#with var as |mount|}}\n {{mount}}\n {{/with}}\n\n ---\n\n {{#with var as |component|}}\n {{component}}\n {{/with}}\n\n ---\n\n {{#with var as |input|}}\n {{input}}\n {{/with}}\n\n ---\n\n {{#with var as |-with-dynamic-vars|}}\n {{-with-dynamic-vars}}\n {{/with}}\n\n ---\n\n {{#with var as |-in-element|}}\n {{-in-element}}\n {{/with}}'], ['\n {{#with var as |foo|}}\n {{foo}}\n {{/with}}\n\n ---\n\n {{#with var as |render|}}\n {{render}}\n {{/with}}\n\n ---\n\n {{#with var as |outlet|}}\n {{outlet}}\n {{/with}}\n\n ---\n\n {{#with var as |mount|}}\n {{mount}}\n {{/with}}\n\n ---\n\n {{#with var as |component|}}\n {{component}}\n {{/with}}\n\n ---\n\n {{#with var as |input|}}\n {{input}}\n {{/with}}\n\n ---\n\n {{#with var as |-with-dynamic-vars|}}\n {{-with-dynamic-vars}}\n {{/with}}\n\n ---\n\n {{#with var as |-in-element|}}\n {{-in-element}}\n {{/with}}']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('syntax refinements', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { +babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test block params should not be refined'] = function testBlockParamsShouldNotBeRefined() { + var _this = this; + + this.registerHelper('foo', function () { + return 'bar helper'; + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { var: 'var' }); + + this.assertText('var---var---var---var---var---var---var---var'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'var', 'RARRR!!!'); + }); + + this.assertText('RARRR!!!---RARRR!!!---RARRR!!!---RARRR!!!---RARRR!!!---RARRR!!!---RARRR!!!---RARRR!!!'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'var', 'var'); + }); + + this.assertText('var---var---var---var---var---var---var---var'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/refinements-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration'); + test('ember-glimmer/tests/integration/refinements-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/refinements-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/refinements-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration'); + QUnit.test('ember-glimmer/tests/integration/refinements-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/refinements-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/svg-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n
\n \n
\n '], ['\n
\n \n
\n ']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n
\n \n
\n '], ['\n
\n \n
\n ']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['\n
\n \n
\n '], ['\n
\n \n
\n ']), + _templateObject4 = babelHelpers.taggedTemplateLiteralLoose(['\n
\n \n
\n '], ['\n
\n \n
\n ']), + _templateObject5 = babelHelpers.taggedTemplateLiteralLoose(['\n
\n \n
\n '], ['\n
\n \n
\n ']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('SVG element tests', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { +babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test unquoted viewBox property is output'] = function testUnquotedViewBoxPropertyIsOutput(assert) { + var _this = this; + + var viewBoxString = '0 0 100 100'; + + this.render('
', { + model: { + viewBoxString: viewBoxString + } + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject, viewBoxString)); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject, viewBoxString)); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'model.viewBoxString', null); + }); + + assert.equal(this.firstChild.getAttribute('svg'), null); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'model', { viewBoxString: viewBoxString }); + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject, viewBoxString)); + }; + + _class.prototype['@test quoted viewBox property is output'] = function testQuotedViewBoxPropertyIsOutput(assert) { + var _this2 = this; + + var viewBoxString = '0 0 100 100'; + + this.render('
', { + model: { + viewBoxString: viewBoxString + } + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject, viewBoxString)); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject, viewBoxString)); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'model.viewBoxString', null); + }); + + assert.equal(this.firstChild.getAttribute('svg'), null); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'model', { viewBoxString: viewBoxString }); + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject, viewBoxString)); + }; + + _class.prototype['@test quoted viewBox property is concat'] = function testQuotedViewBoxPropertyIsConcat() { + var _this3 = this; + + var viewBoxString = '100 100'; + + this.render('
', { + model: { + viewBoxString: viewBoxString + } + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2, viewBoxString)); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2, viewBoxString)); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'model.viewBoxString', '200 200'); + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3)); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'model', { viewBoxString: viewBoxString }); + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2, viewBoxString)); + }; + + _class.prototype['@test class is output'] = function testClassIsOutput() { + var _this4 = this; + + this.render('
', { + model: { + color: 'blue' + } + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4)); + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4)); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'model.color', 'yellow'); + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5)); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'model', { color: 'blue' }); + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4)); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/svg-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration'); + test('ember-glimmer/tests/integration/svg-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/svg-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/svg-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration'); + QUnit.test('ember-glimmer/tests/integration/svg-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/svg-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/syntax/each-in-test', ['exports', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-runtime', 'ember-glimmer/tests/utils/shared-conditional-tests'], function (exports, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberRuntime, _emberGlimmerTestsUtilsSharedConditionalTests) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n {{#each-in categories as |category count|}}\n
  • {{category}}: {{count}}
  • \n {{/each-in}}\n
\n '], ['\n
    \n {{#each-in categories as |category count|}}\n
  • {{category}}: {{count}}
  • \n {{/each-in}}\n
\n ']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n
  • Smartphones: 8203
  • \n
  • JavaScript Frameworks: Infinity
  • \n
\n '], ['\n
    \n
  • Smartphones: 8203
  • \n
  • JavaScript Frameworks: Infinity
  • \n
\n ']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n
  • Smartphones: 100
  • \n
  • JavaScript Frameworks: Infinity
  • \n
  • Tweets: 443115
  • \n
\n '], ['\n
    \n
  • Smartphones: 100
  • \n
  • JavaScript Frameworks: Infinity
  • \n
  • Tweets: 443115
  • \n
\n ']), + _templateObject4 = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n {{#each-in categories as |category data|}}\n
  • {{category}}: {{data.reports.unitsSold}}
  • \n {{/each-in}}\n
\n '], ['\n
    \n {{#each-in categories as |category data|}}\n
  • {{category}}: {{data.reports.unitsSold}}
  • \n {{/each-in}}\n
\n ']), + _templateObject5 = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n {{#each-in categories key=\'@identity\' as |category count|}}\n
  • {{category}}: {{count}}
  • \n {{/each-in}}\n
\n '], ['\n
    \n {{#each-in categories key=\'@identity\' as |category count|}}\n
  • {{category}}: {{count}}
  • \n {{/each-in}}\n
\n ']), + _templateObject6 = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n
  • Smartphones: 8203
  • \n
  • Tablets: 8203
  • \n
  • JavaScript Frameworks: Infinity
  • \n
  • Bugs: Infinity
  • \n
\n '], ['\n
    \n
  • Smartphones: 8203
  • \n
  • Tablets: 8203
  • \n
  • JavaScript Frameworks: Infinity
  • \n
  • Bugs: Infinity
  • \n
\n ']), + _templateObject7 = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n
  • Smartphones: 100
  • \n
  • Tablets: 8203
  • \n
  • JavaScript Frameworks: Infinity
  • \n
  • Bugs: Infinity
  • \n
  • Tweets: 443115
  • \n
\n '], ['\n
    \n
  • Smartphones: 100
  • \n
  • Tablets: 8203
  • \n
  • JavaScript Frameworks: Infinity
  • \n
  • Bugs: Infinity
  • \n
  • Tweets: 443115
  • \n
\n ']), + _templateObject8 = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n {{#each-in (get collection type) as |category count|}}\n
  • {{category}}: {{count}}
  • \n {{/each-in}}\n
\n '], ['\n
    \n {{#each-in (get collection type) as |category count|}}\n
  • {{category}}: {{count}}
  • \n {{/each-in}}\n
\n ']), + _templateObject9 = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n
  • Emberinios: 533462
  • \n
  • Tweets: 7323
  • \n
\n '], ['\n
    \n
  • Emberinios: 533462
  • \n
  • Tweets: 7323
  • \n
\n ']), + _templateObject10 = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n
  • Televisions: 183
  • \n
  • Alarm Clocks: 999
  • \n
\n '], ['\n
    \n
  • Televisions: 183
  • \n
  • Alarm Clocks: 999
  • \n
\n ']), + _templateObject11 = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n
  • Televisions: 183
  • \n
  • Alarm Clocks: 999
  • \n
  • Tweets: 443115
  • \n
\n '], ['\n
    \n
  • Televisions: 183
  • \n
  • Alarm Clocks: 999
  • \n
  • Tweets: 443115
  • \n
\n ']), + _templateObject12 = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n
  • Emberinios: 123456
  • \n
\n '], ['\n
    \n
  • Emberinios: 123456
  • \n
\n ']), + _templateObject13 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each-in foo.bar.baz as |thing|}}\n {{thing}}\n {{/each-in}}'], ['\n {{#each-in foo.bar.baz as |thing|}}\n {{thing}}\n {{/each-in}}']), + _templateObject14 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each-in arr as |key value|}}\n [{{key}}:{{value}}]\n {{/each-in}}'], ['\n {{#each-in arr as |key value|}}\n [{{key}}:{{value}}]\n {{/each-in}}']), + _templateObject15 = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n
  • Smartphones: 100
  • \n
  • Tablets: 20
  • \n
\n '], ['\n
    \n
  • Smartphones: 100
  • \n
  • Tablets: 20
  • \n
\n ']); + + var EachInTest = (function (_TogglingSyntaxConditionalsTest) { +babelHelpers.inherits(EachInTest, _TogglingSyntaxConditionalsTest); + + function EachInTest() { +babelHelpers.classCallCheck(this, EachInTest); + + _TogglingSyntaxConditionalsTest.apply(this, arguments); + } + + EachInTest.prototype.templateFor = function templateFor(_ref) { + var cond = _ref.cond; + var truthy = _ref.truthy; + var falsy = _ref.falsy; + + return '{{#each-in ' + cond + ' as |key|}}' + truthy + '{{else}}' + falsy + '{{/each-in}}'; + }; + + return EachInTest; + })(_emberGlimmerTestsUtilsSharedConditionalTests.TogglingSyntaxConditionalsTest); + + function EmptyFunction() {} + + function NonEmptyFunction() {} + NonEmptyFunction.foo = 'bar'; + + var EmptyConstructor = function EmptyConstructor() { +babelHelpers.classCallCheck(this, EmptyConstructor); + }; + + var NonEmptyConstructor = function NonEmptyConstructor() { +babelHelpers.classCallCheck(this, NonEmptyConstructor); + }; + + NonEmptyConstructor.foo = 'bar'; + + var BasicEachInTest = (function (_EachInTest) { +babelHelpers.inherits(BasicEachInTest, _EachInTest); + + function BasicEachInTest() { +babelHelpers.classCallCheck(this, BasicEachInTest); + + _EachInTest.apply(this, arguments); + } + + return BasicEachInTest; + })(EachInTest); + + _emberGlimmerTestsUtilsAbstractTestCase.applyMixins(BasicEachInTest, new _emberGlimmerTestsUtilsSharedConditionalTests.TruthyGenerator([{ foo: 1 }, _emberRuntime.Object.create({ 'Not Empty': 1 }), [1], NonEmptyFunction, NonEmptyConstructor]), new _emberGlimmerTestsUtilsSharedConditionalTests.FalsyGenerator([null, undefined, false, '', 0, [], EmptyFunction, EmptyConstructor, {}, Object.create(null), Object.create({}), Object.create({ 'Not Empty': 1 }), _emberRuntime.Object.create()])); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#each-in}}', (function (_BasicEachInTest) { +babelHelpers.inherits(_class, _BasicEachInTest); + + function _class() { +babelHelpers.classCallCheck(this, _class); + + _BasicEachInTest.apply(this, arguments); + } + + _class.prototype['@test it repeats the given block for each item in the hash'] = function testItRepeatsTheGivenBlockForEachItemInTheHash() { + var _this = this; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { + categories: { + 'Smartphones': 8203, + 'JavaScript Frameworks': Infinity + } + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + + this.assertStableRerender(); + + this.runTask(function () { + _emberMetal.set(_this.context, 'categories.Smartphones', 100); + _emberMetal.set(_this.context, 'categories.Tweets', 443115); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3)); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'categories', { + 'Smartphones': 8203, + 'JavaScript Frameworks': Infinity + }); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + }; + + _class.prototype['@test it can render sub-paths of each item'] = function testItCanRenderSubPathsOfEachItem() { + var _this2 = this; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4), { + categories: { + 'Smartphones': { reports: { unitsSold: 8203 } }, + 'JavaScript Frameworks': { reports: { unitsSold: Infinity } } + } + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + + this.assertStableRerender(); + + this.runTask(function () { + _emberMetal.set(_this2.context, 'categories.Smartphones.reports.unitsSold', 100); + _emberMetal.set(_this2.context, 'categories.Tweets', { reports: { unitsSold: 443115 } }); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3)); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'categories', { + 'Smartphones': { reports: { unitsSold: 8203 } }, + 'JavaScript Frameworks': { reports: { unitsSold: Infinity } } + }); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + }; + + _class.prototype['@test it can render duplicate items'] = function testItCanRenderDuplicateItems() { + var _this3 = this; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5), { + categories: { + 'Smartphones': 8203, + 'Tablets': 8203, + 'JavaScript Frameworks': Infinity, + 'Bugs': Infinity + } + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject6)); + + this.assertStableRerender(); + + this.runTask(function () { + _emberMetal.set(_this3.context, 'categories.Smartphones', 100); + _emberMetal.set(_this3.context, 'categories.Tweets', 443115); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject7)); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'categories', { + 'Smartphones': 8203, + 'Tablets': 8203, + 'JavaScript Frameworks': Infinity, + 'Bugs': Infinity + }); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject6)); + }; + + _class.prototype['@test it repeats the given block when the hash is dynamic'] = function testItRepeatsTheGivenBlockWhenTheHashIsDynamic() { + var _this4 = this; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject8), { + collection: { + categories: { + 'Smartphones': 8203, + 'JavaScript Frameworks': Infinity + }, + otherCategories: { + 'Emberinios': 533462, + 'Tweets': 7323 + } + }, + type: 'categories' + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + + this.assertStableRerender(); + + this.runTask(function () { + _emberMetal.set(_this4.context, 'type', 'otherCategories'); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject9)); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'type', 'categories'); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + }; + + _class.prototype['@test it only iterates over an object\'s own properties'] = function testItOnlyIteratesOverAnObjectSOwnProperties() { + var _this5 = this; + + var protoCategories = { + 'Smartphones': 8203, + 'JavaScript Frameworks': Infinity + }; + + var categories = Object.create(protoCategories); + categories['Televisions'] = 183; + categories['Alarm Clocks'] = 999; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { categories: categories }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject10)); + + this.assertStableRerender(); + + this.runTask(function () { + _emberMetal.set(protoCategories, 'Robots', 666); + _emberMetal.set(categories, 'Tweets', 443115); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject11)); + + categories = Object.create(protoCategories); + categories['Televisions'] = 183; + categories['Alarm Clocks'] = 999; + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'categories', categories); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject10)); + }; + + _class.prototype['@test it does not observe direct property mutations (not going through set) on the object'] = function testItDoesNotObserveDirectPropertyMutationsNotGoingThroughSetOnTheObject() { + var _this6 = this; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { + categories: { + 'Smartphones': 8203, + 'JavaScript Frameworks': Infinity + } + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + + this.assertStableRerender(); + + this.runTask(function () { + var categories = _emberMetal.get(_this6.context, 'categories'); + delete categories.Smartphones; + }); + + this.assertInvariants(); + + this.runTask(function () { + var categories = _emberMetal.get(_this6.context, 'categories'); + categories['Emberinios'] = 123456; + }); + + this.assertInvariants(); + + this.runTask(function () { + _emberMetal.set(_this6.context, 'categories', { + Emberinios: 123456 + }); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject12)); + + this.runTask(function () { + _emberMetal.set(_this6.context, 'categories', { + 'Smartphones': 8203, + 'JavaScript Frameworks': Infinity + }); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + }; + + _class.prototype['@test keying off of `undefined` does not render'] = function testKeyingOffOfUndefinedDoesNotRender(assert) { + var _this7 = this; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject13), { foo: {} }); + + this.assertText(''); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'foo', { bar: { baz: { 'Here!': 1 } } }); + }); + + this.assertText('Here!'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'foo', {}); + }); + + this.assertText(''); + }; + + _class.prototype['@test it iterate over array with `in` instead of walking over elements'] = function testItIterateOverArrayWithInInsteadOfWalkingOverElements(assert) { + var _this8 = this; + + var arr = [1, 2, 3]; + arr.foo = 'bar'; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject14), { arr: arr }); + + this.assertText('[0:1][1:2][2:3][foo:bar]'); + + this.runTask(function () { + return _this8.rerender(); + }); + + this.assertText('[0:1][1:2][2:3][foo:bar]'); + + this.runTask(function () { + _emberMetal.set(arr, 'zomg', 'lol'); + }); + + this.assertText('[0:1][1:2][2:3][foo:bar][zomg:lol]'); + + arr = [1, 2, 3]; + arr.foo = 'bar'; + + this.runTask(function () { + return _emberMetal.set(_this8.context, 'arr', arr); + }); + + this.assertText('[0:1][1:2][2:3][foo:bar]'); + }; + +babelHelpers.createClass(_class, [{ + key: 'truthyValue', + get: function () { + return { 'Not Empty': 1 }; + } + }, { + key: 'falsyValue', + get: function () { + return {}; + } + }]); + return _class; + })(BasicEachInTest)); + + var EachInEdgeCasesTest = (function (_EachInTest2) { +babelHelpers.inherits(EachInEdgeCasesTest, _EachInTest2); + + function EachInEdgeCasesTest() { +babelHelpers.classCallCheck(this, EachInEdgeCasesTest); + + _EachInTest2.apply(this, arguments); + } + + return EachInEdgeCasesTest; + })(EachInTest); + + _emberGlimmerTestsUtilsAbstractTestCase.applyMixins(EachInEdgeCasesTest, new _emberGlimmerTestsUtilsSharedConditionalTests.FalsyGenerator([true, 1, 'hello'])); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#each-in}} edge cases', (function (_EachInEdgeCasesTest) { +babelHelpers.inherits(_class2, _EachInEdgeCasesTest); + + function _class2() { +babelHelpers.classCallCheck(this, _class2); + + _EachInEdgeCasesTest.apply(this, arguments); + } + +babelHelpers.createClass(_class2, [{ + key: 'truthyValue', + get: function () { + return { 'Not Empty': 1 }; + } + }, { + key: 'falsyValue', + get: function () { + return {}; + } + }]); + return _class2; + })(EachInEdgeCasesTest)); + + var EachInProxyTest = (function (_EachInTest3) { +babelHelpers.inherits(EachInProxyTest, _EachInTest3); + + function EachInProxyTest() { +babelHelpers.classCallCheck(this, EachInProxyTest); + + _EachInTest3.apply(this, arguments); + } + + return EachInProxyTest; + })(EachInTest); + + _emberGlimmerTestsUtilsAbstractTestCase.applyMixins(EachInProxyTest, new _emberGlimmerTestsUtilsSharedConditionalTests.TruthyGenerator([_emberRuntime.ObjectProxy.create({ content: { 'Not empty': 1 } })]), new _emberGlimmerTestsUtilsSharedConditionalTests.FalsyGenerator([_emberRuntime.ObjectProxy.create(), _emberRuntime.ObjectProxy.create({ content: null }), _emberRuntime.ObjectProxy.create({ content: {} }), _emberRuntime.ObjectProxy.create({ content: Object.create(null) }), _emberRuntime.ObjectProxy.create({ content: Object.create({}) }), _emberRuntime.ObjectProxy.create({ content: Object.create({ 'Not Empty': 1 }) }), _emberRuntime.ObjectProxy.create({ content: _emberRuntime.Object.create() })])); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#each-in}} with `ObjectProxy`', (function (_EachInProxyTest) { +babelHelpers.inherits(_class3, _EachInProxyTest); + + function _class3() { +babelHelpers.classCallCheck(this, _class3); + + _EachInProxyTest.apply(this, arguments); + } + + _class3.prototype['@test it iterates over the content, not the proxy'] = function testItIteratesOverTheContentNotTheProxy() { + var _this9 = this; + + var content = { + 'Smartphones': 8203, + 'JavaScript Frameworks': Infinity + }; + + var proxy = _emberRuntime.ObjectProxy.create({ + content: content, + foo: 'bar' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { categories: proxy }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + + this.assertStableRerender(); + + this.runTask(function () { + _emberMetal.set(proxy, 'content.Smartphones', 100); + _emberMetal.set(proxy, 'content.Tweets', 443115); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3)); + + this.runTask(function () { + _emberMetal.set(proxy, 'content', { + 'Smartphones': 100, + 'Tablets': 20 + }); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject15)); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'categories', _emberRuntime.ObjectProxy.create({ + content: { + 'Smartphones': 8203, + 'JavaScript Frameworks': Infinity + } + })); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + }; + +babelHelpers.createClass(_class3, [{ + key: 'truthyValue', + get: function () { + return _emberRuntime.ObjectProxy.create({ content: { 'Not Empty': 1 } }); + } + }, { + key: 'falsyValue', + get: function () { + return _emberRuntime.ObjectProxy.create({ content: null }); + } + }]); + return _class3; + })(EachInProxyTest)); +}); +enifed('ember-glimmer/tests/integration/syntax/each-in-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/syntax'); + test('ember-glimmer/tests/integration/syntax/each-in-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/syntax/each-in-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/syntax/each-in-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/syntax'); + QUnit.test('ember-glimmer/tests/integration/syntax/each-in-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/syntax/each-in-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/syntax/each-test', ['exports', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-runtime', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/shared-conditional-tests'], function (exports, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberRuntime, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsSharedConditionalTests) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each list as |item|}}\n
  • Prev
  • \n {{foo-bar item=item}}\n
  • Next
  • \n {{/each}}\n '], ['\n {{#each list as |item|}}\n
  • Prev
  • \n {{foo-bar item=item}}\n
  • Next
  • \n {{/each}}\n ']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each content as |value|}}\n {{value}}-\n {{#each options as |option|}}\n {{option.value}}:{{option.label}}\n {{/each}}\n {{/each}}\n '], ['\n {{#each content as |value|}}\n {{value}}-\n {{#each options as |option|}}\n {{option.value}}:{{option.label}}\n {{/each}}\n {{/each}}\n ']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each foo.bar.baz as |thing|}}\n {{thing}}\n {{/each}}'], ['\n {{#each foo.bar.baz as |thing|}}\n {{thing}}\n {{/each}}']), + _templateObject4 = babelHelpers.taggedTemplateLiteralLoose(['\n

    {{page.title}}

    \n\n
      \n {{#each model as |post|}}\n
    • {{post.title}}
    • \n {{/each}}\n
    \n '], ['\n

    {{page.title}}

    \n\n
      \n {{#each model as |post|}}\n
    • {{post.title}}
    • \n {{/each}}\n
    \n ']), + _templateObject5 = babelHelpers.taggedTemplateLiteralLoose(['\n

    Blog Posts

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n '], ['\n

    Blog Posts

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n ']), + _templateObject6 = babelHelpers.taggedTemplateLiteralLoose(['\n

    Essays

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n '], ['\n

    Essays

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n ']), + _templateObject7 = babelHelpers.taggedTemplateLiteralLoose(['\n

    Think Pieces™

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n '], ['\n

    Think Pieces™

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n ']); + + var ArrayLike = (function () { + function ArrayLike(content) { +babelHelpers.classCallCheck(this, ArrayLike); + + this._array = content; + } + + ArrayLike.prototype.forEach = function forEach(callback) { + this._array.forEach(callback); + }; + + // The following methods are APIs used by the tests + + ArrayLike.prototype.objectAt = function objectAt(idx) { + return this._array[idx]; + }; + + ArrayLike.prototype.clear = function clear() { + this._array.length = 0; + this.arrayContentDidChange(); + }; + + ArrayLike.prototype.replace = function replace(idx, del, ins) { + var _array; + + (_array = this._array).splice.apply(_array, [idx, del].concat(ins)); + this.arrayContentDidChange(); + }; + + ArrayLike.prototype.unshiftObject = function unshiftObject(obj) { + this._array.unshift(obj); + this.arrayContentDidChange(); + }; + + ArrayLike.prototype.unshiftObjects = function unshiftObjects(arr) { + var _array2; + + (_array2 = this._array).unshift.apply(_array2, arr); + this.arrayContentDidChange(); + }; + + ArrayLike.prototype.pushObject = function pushObject(obj) { + this._array.push(obj); + this.arrayContentDidChange(); + }; + + ArrayLike.prototype.pushObjects = function pushObjects(arr) { + var _array3; + + (_array3 = this._array).push.apply(_array3, arr); + this.arrayContentDidChange(); + }; + + ArrayLike.prototype.shiftObject = function shiftObject() { + var obj = this._array.shift(); + this.arrayContentDidChange(); + return obj; + }; + + ArrayLike.prototype.popObject = function popObject() { + var obj = this._array.pop(); + this.arrayContentDidChange(); + return obj; + }; + + ArrayLike.prototype.insertAt = function insertAt(idx, obj) { + this._array.splice(idx, 0, obj); + this.arrayContentDidChange(); + }; + + ArrayLike.prototype.removeAt = function removeAt(idx) { + var len = arguments.length <= 1 || arguments[1] === undefined ? 1 : arguments[1]; + + this._array.splice(idx, len); + this.arrayContentDidChange(); + }; + + ArrayLike.prototype.arrayContentDidChange = function arrayContentDidChange() { + _emberMetal.propertyDidChange(this, '[]'); + _emberMetal.propertyDidChange(this, 'length'); + }; + +babelHelpers.createClass(ArrayLike, [{ + key: 'length', + get: function () { + return this._array.length; + } + }]); + return ArrayLike; + })(); + + var TogglingEachTest = (function (_TogglingSyntaxConditionalsTest) { +babelHelpers.inherits(TogglingEachTest, _TogglingSyntaxConditionalsTest); + + function TogglingEachTest() { +babelHelpers.classCallCheck(this, TogglingEachTest); + + _TogglingSyntaxConditionalsTest.apply(this, arguments); + } + +babelHelpers.createClass(TogglingEachTest, [{ + key: 'truthyValue', + get: function () { + return ['non-empty']; + } + }, { + key: 'falsyValue', + get: function () { + return []; + } + }]); + return TogglingEachTest; + })(_emberGlimmerTestsUtilsSharedConditionalTests.TogglingSyntaxConditionalsTest); + + var BasicEachTest = (function (_TogglingEachTest) { +babelHelpers.inherits(BasicEachTest, _TogglingEachTest); + + function BasicEachTest() { +babelHelpers.classCallCheck(this, BasicEachTest); + + _TogglingEachTest.apply(this, arguments); + } + + return BasicEachTest; + })(TogglingEachTest); + + _emberGlimmerTestsUtilsAbstractTestCase.applyMixins(BasicEachTest, new _emberGlimmerTestsUtilsSharedConditionalTests.TruthyGenerator([['hello'], _emberRuntime.A(['hello']), new ArrayLike(['hello']), _emberRuntime.ArrayProxy.create({ content: ['hello'] }), _emberRuntime.ArrayProxy.create({ content: _emberRuntime.A(['hello']) })]), new _emberGlimmerTestsUtilsSharedConditionalTests.FalsyGenerator([null, undefined, false, '', 0, []]), _emberGlimmerTestsUtilsSharedConditionalTests.ArrayTestCases); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: toggling {{#each}}', (function (_BasicEachTest) { +babelHelpers.inherits(_class, _BasicEachTest); + + function _class() { +babelHelpers.classCallCheck(this, _class); + + _BasicEachTest.apply(this, arguments); + } + + _class.prototype.templateFor = function templateFor(_ref) { + var cond = _ref.cond; + var truthy = _ref.truthy; + var falsy = _ref.falsy; + + return '{{#each ' + cond + '}}' + truthy + '{{else}}' + falsy + '{{/each}}'; + }; + + return _class; + })(BasicEachTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: toggling {{#each as}}', (function (_BasicEachTest2) { +babelHelpers.inherits(_class2, _BasicEachTest2); + + function _class2() { +babelHelpers.classCallCheck(this, _class2); + + _BasicEachTest2.apply(this, arguments); + } + + _class2.prototype.templateFor = function templateFor(_ref2) { + var cond = _ref2.cond; + var truthy = _ref2.truthy; + var falsy = _ref2.falsy; + + return '{{#each ' + cond + ' as |test|}}' + truthy + '{{else}}' + falsy + '{{/each}}'; + }; + + return _class2; + })(BasicEachTest)); + + var EachEdgeCasesTest = (function (_TogglingEachTest2) { +babelHelpers.inherits(EachEdgeCasesTest, _TogglingEachTest2); + + function EachEdgeCasesTest() { +babelHelpers.classCallCheck(this, EachEdgeCasesTest); + + _TogglingEachTest2.apply(this, arguments); + } + + return EachEdgeCasesTest; + })(TogglingEachTest); + + _emberGlimmerTestsUtilsAbstractTestCase.applyMixins(EachEdgeCasesTest, new _emberGlimmerTestsUtilsSharedConditionalTests.FalsyGenerator([true, 'hello', 1, Object, function () {}, {}, { foo: 'bar' }, Object.create(null), Object.create({}), Object.create({ foo: 'bar' })])); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: toggling {{#each}}', (function (_EachEdgeCasesTest) { +babelHelpers.inherits(_class3, _EachEdgeCasesTest); + + function _class3() { +babelHelpers.classCallCheck(this, _class3); + + _EachEdgeCasesTest.apply(this, arguments); + } + + _class3.prototype.templateFor = function templateFor(_ref3) { + var cond = _ref3.cond; + var truthy = _ref3.truthy; + var falsy = _ref3.falsy; + + return '{{#each ' + cond + '}}' + truthy + '{{else}}' + falsy + '{{/each}}'; + }; + + return _class3; + })(EachEdgeCasesTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: toggling {{#each as}}', (function (_EachEdgeCasesTest2) { +babelHelpers.inherits(_class4, _EachEdgeCasesTest2); + + function _class4() { +babelHelpers.classCallCheck(this, _class4); + + _EachEdgeCasesTest2.apply(this, arguments); + } + + _class4.prototype.templateFor = function templateFor(_ref4) { + var cond = _ref4.cond; + var truthy = _ref4.truthy; + var falsy = _ref4.falsy; + + return '{{#each ' + cond + ' as |test|}}' + truthy + '{{else}}' + falsy + '{{/each}}'; + }; + + return _class4; + })(EachEdgeCasesTest)); + + var AbstractEachTest = (function (_RenderingTest) { +babelHelpers.inherits(AbstractEachTest, _RenderingTest); + + function AbstractEachTest() { +babelHelpers.classCallCheck(this, AbstractEachTest); + + _RenderingTest.apply(this, arguments); + } + + /* abstract */ + + AbstractEachTest.prototype.makeList = function makeList() { + // this.list = this.delegate = ...; + throw new Error('Not implemented: `makeList`'); + }; + + AbstractEachTest.prototype.replaceList = function replaceList(list) { + var _this = this; + + this.runTask(function () { + return _emberMetal.set(_this.context, 'list', _this.makeList(list)); + }); + }; + + AbstractEachTest.prototype.forEach = function forEach(callback) { + return this.delegate.forEach(callback); + }; + + AbstractEachTest.prototype.objectAt = function objectAt(idx) { + return this.delegate.objectAt(idx); + }; + + AbstractEachTest.prototype.clear = function clear() { + return this.delegate.clear(); + }; + + AbstractEachTest.prototype.replace = function replace(idx, del, ins) { + return this.delegate.replace(idx, del, ins); + }; + + AbstractEachTest.prototype.unshiftObject = function unshiftObject(obj) { + return this.delegate.unshiftObject(obj); + }; + + AbstractEachTest.prototype.unshiftObjects = function unshiftObjects(arr) { + return this.delegate.unshiftObjects(arr); + }; + + AbstractEachTest.prototype.pushObject = function pushObject(obj) { + return this.delegate.pushObject(obj); + }; + + AbstractEachTest.prototype.pushObjects = function pushObjects(arr) { + return this.delegate.pushObjects(arr); + }; + + AbstractEachTest.prototype.shiftObject = function shiftObject() { + return this.delegate.shiftObject(); + }; + + AbstractEachTest.prototype.popObject = function popObject() { + return this.delegate.popObject(); + }; + + AbstractEachTest.prototype.insertAt = function insertAt(idx, obj) { + return this.delegate.insertAt(idx, obj); + }; + + AbstractEachTest.prototype.removeAt = function removeAt(idx, len) { + return this.delegate.removeAt(idx, len); + }; + + AbstractEachTest.prototype.render = function render(template) { + var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + if (this.list === undefined) { + throw new Error('Must call `this.makeList()` before calling this.render()'); + } + + context.list = this.list; + + return _RenderingTest.prototype.render.call(this, template, context); + }; + + return AbstractEachTest; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest); + + var SingleEachTest = (function (_AbstractEachTest) { +babelHelpers.inherits(SingleEachTest, _AbstractEachTest); + + function SingleEachTest() { +babelHelpers.classCallCheck(this, SingleEachTest); + + _AbstractEachTest.apply(this, arguments); + } + + SingleEachTest.prototype['@test it repeats the given block for each item in the array'] = function testItRepeatsTheGivenBlockForEachItemInTheArray() { + var _this2 = this; + + this.makeList([{ text: 'hello' }]); + + this.render('{{#each list as |item|}}{{item.text}}{{else}}Empty{{/each}}'); + + this.assertText('hello'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertText('hello'); + + this.runTask(function () { + return _emberMetal.set(_this2.objectAt(0), 'text', 'Hello'); + }); + + this.assertText('Hello'); + + this.runTask(function () { + _this2.pushObject({ text: ' ' }); + _this2.pushObject({ text: 'World' }); + }); + + this.assertText('Hello World'); + + this.runTask(function () { + _this2.pushObject({ text: 'Earth' }); + _this2.removeAt(1); + _this2.insertAt(1, { text: 'Globe' }); + }); + + this.assertText('HelloGlobeWorldEarth'); + + this.runTask(function () { + _this2.pushObject({ text: 'Planet' }); + _this2.removeAt(1); + _this2.insertAt(1, { text: ' ' }); + _this2.pushObject({ text: ' ' }); + _this2.pushObject({ text: 'Earth' }); + _this2.removeAt(3); + }); + + this.assertText('Hello WorldPlanet Earth'); + + this.runTask(function () { + _this2.pushObject({ text: 'Globe' }); + _this2.removeAt(1); + _this2.insertAt(1, { text: ' ' }); + _this2.pushObject({ text: ' ' }); + _this2.pushObject({ text: 'World' }); + _this2.removeAt(2); + }); + + this.assertText('Hello Planet EarthGlobe World'); + + this.runTask(function () { + return _this2.replace(2, 4, { text: 'my' }); + }); + + this.assertText('Hello my World'); + + this.runTask(function () { + return _this2.clear(); + }); + + this.assertText('Empty'); + + this.replaceList([{ text: 'hello' }]); + + this.assertText('hello'); + }; + + SingleEachTest.prototype['@test it receives the index as the second parameter'] = function testItReceivesTheIndexAsTheSecondParameter() { + var _this3 = this; + + this.makeList([{ text: 'hello' }, { text: 'world' }]); + + this.render('{{#each list as |item index|}}[{{index}}. {{item.text}}]{{/each}}'); + + this.assertText('[0. hello][1. world]'); + + this.assertStableRerender(); + + this.runTask(function () { + return _this3.insertAt(1, { text: 'my' }); + }); + + this.assertText('[0. hello][1. my][2. world]'); + + this.replaceList([{ text: 'hello' }, { text: 'world' }]); + + this.assertText('[0. hello][1. world]'); + }; + + SingleEachTest.prototype['@test it accepts a string key'] = function testItAcceptsAStringKey() { + var _this4 = this; + + this.makeList([{ text: 'hello' }, { text: 'world' }]); + + this.render('{{#each list key=\'text\' as |item|}}{{item.text}}{{/each}}'); + + this.assertText('helloworld'); + + this.assertStableRerender(); + + this.runTask(function () { + return _this4.pushObject({ text: 'again' }); + }); + + this.assertText('helloworldagain'); + + this.replaceList([{ text: 'hello' }, { text: 'world' }]); + + this.assertText('helloworld'); + }; + + SingleEachTest.prototype['@test it accepts a numeric key'] = function testItAcceptsANumericKey() { + var _this5 = this; + + this.makeList([{ id: 1 }, { id: 2 }]); + + this.render('{{#each list key=\'id\' as |item|}}{{item.id}}{{/each}}'); + + this.assertText('12'); + + this.assertStableRerender(); + + this.runTask(function () { + return _this5.pushObject({ id: 3 }); + }); + + this.assertText('123'); + + this.replaceList([{ id: 1 }, { id: 2 }]); + + this.assertText('12'); + }; + + SingleEachTest.prototype['@test it can specify @index as the key'] = function testItCanSpecifyIndexAsTheKey() { + var _this6 = this; + + this.makeList([{ id: 1 }, { id: 2 }]); + + this.render('{{#each list key=\'@index\' as |item|}}{{item.id}}{{/each}}'); + + this.assertText('12'); + + this.assertStableRerender(); + + this.runTask(function () { + return _this6.pushObject({ id: 3 }); + }); + + this.assertText('123'); + + this.replaceList([{ id: 1 }, { id: 2 }]); + + this.assertText('12'); + }; + + SingleEachTest.prototype['@test it can specify @identity as the key for arrays of primitives'] = function testItCanSpecifyIdentityAsTheKeyForArraysOfPrimitives() { + var _this7 = this; + + this.makeList([1, 2]); + + this.render('{{#each list key=\'@identity\' as |item|}}{{item}}{{/each}}'); + + this.assertText('12'); + + this.assertStableRerender(); + + this.runTask(function () { + return _this7.pushObject(3); + }); + + this.assertText('123'); + + this.replaceList([1, 2]); + + this.assertText('12'); + }; + + SingleEachTest.prototype['@test it can specify @identity as the key for mixed arrays of objects and primitives'] = function testItCanSpecifyIdentityAsTheKeyForMixedArraysOfObjectsAndPrimitives() { + var _this8 = this; + + this.makeList([1, { id: 2 }, 3]); + + this.render('{{#each list key=\'@identity\' as |item|}}{{if item.id item.id item}}{{/each}}'); + + this.assertText('123'); + + this.assertStableRerender(); + + this.runTask(function () { + return _this8.insertAt(2, { id: 4 }); + }); + + this.assertText('1243'); + + this.replaceList([1, { id: 2 }, 3]); + + this.assertText('123'); + }; + + SingleEachTest.prototype['@test it can render duplicate primitive items'] = function testItCanRenderDuplicatePrimitiveItems() { + var _this9 = this; + + this.makeList(['a', 'a', 'a']); + + this.render('{{#each list as |item|}}{{item}}{{/each}}'); + + this.assertText('aaa'); + + this.assertStableRerender(); + + this.runTask(function () { + return _this9.pushObject('a'); + }); + + this.assertText('aaaa'); + + this.runTask(function () { + return _this9.pushObject('a'); + }); + + this.assertText('aaaaa'); + + this.replaceList(['a', 'a', 'a']); + + this.assertText('aaa'); + }; + + SingleEachTest.prototype['@test updating and setting within #each'] = function testUpdatingAndSettingWithinEach(assert) { + var _this10 = this; + + this.makeList([{ value: 1 }, { value: 2 }, { value: 3 }]); + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + this.isEven = true; + this.tagName = 'li'; + }, + + _isEven: function () { + this.set('isEven', this.get('item.value') % 2 === 0); + }, + + didUpdate: function () { + this._isEven(); + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '{{#if isEven}}{{item.value}}{{/if}}' }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject)); + + this.assertText('Prev1NextPrev2NextPrev3Next'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this10.context.list.objectAt(0), 'value', 3); + }); + + this.assertText('PrevNextPrev2NextPrev3Next'); + + this.replaceList([{ value: 1 }, { value: 2 }, { value: 3 }]); + + this.assertText('Prev1NextPrev2NextPrev3Next'); + }; + + SingleEachTest.prototype['@test it can render duplicate objects'] = function testItCanRenderDuplicateObjects() { + var _this11 = this; + + var duplicateItem = { text: 'foo' }; + + this.makeList([duplicateItem, duplicateItem, { text: 'bar' }, { text: 'baz' }]); + + this.render('{{#each list as |item|}}{{item.text}}{{/each}}'); + + this.assertText('foofoobarbaz'); + + this.assertStableRerender(); + + this.runTask(function () { + return _this11.pushObject(duplicateItem); + }); + + this.assertText('foofoobarbazfoo'); + + this.runTask(function () { + return _this11.pushObject(duplicateItem); + }); + + this.assertText('foofoobarbazfoofoo'); + + this.replaceList([duplicateItem, duplicateItem, { text: 'bar' }, { text: 'baz' }]); + + this.assertText('foofoobarbaz'); + }; + + SingleEachTest.prototype['@test it maintains DOM stability when condition changes between objects with the same keys'] = function testItMaintainsDOMStabilityWhenConditionChangesBetweenObjectsWithTheSameKeys() { + var _this12 = this; + + this.makeList([{ text: 'Hello' }, { text: ' ' }, { text: 'world' }]); + + this.render('{{#each list key="text" as |item|}}{{item.text}}{{/each}}'); + + this.assertText('Hello world'); + + this.takeSnapshot(); + + this.runTask(function () { + _this12.popObject(); + _this12.popObject(); + _this12.pushObject({ text: ' ' }); + _this12.pushObject({ text: 'world' }); + }); + + this.assertText('Hello world'); + + this.assertInvariants(); + + this.replaceList([{ text: 'Hello' }, { text: ' ' }, { text: 'world' }]); + + this.assertText('Hello world'); + + this.assertInvariants(); + }; + + SingleEachTest.prototype['@test it maintains DOM stability for stable keys when list is updated'] = function testItMaintainsDOMStabilityForStableKeysWhenListIsUpdated() { + var _this13 = this; + + this.makeList([{ text: 'Hello' }, { text: ' ' }, { text: 'world' }]); + + this.render('{{#each list key="text" as |item|}}{{item.text}}{{/each}}'); + + this.assertText('Hello world'); + + this.assertStableRerender(); + + var oldSnapshot = this.takeSnapshot(); + + this.runTask(function () { + _this13.unshiftObject({ text: ', ' }); + _this13.unshiftObject({ text: 'Hi' }); + _this13.pushObject({ text: '!' }); + _this13.pushObject({ text: 'earth' }); + }); + + this.assertText('Hi, Hello world!earth'); + + this.assertPartialInvariants(2, 5); + + this.replaceList([{ text: 'Hello' }, { text: ' ' }, { text: 'world' }]); + + this.assertText('Hello world'); + + this.assertInvariants(oldSnapshot, this.takeSnapshot()); + }; + + SingleEachTest.prototype['@test it renders all items with duplicate key values'] = function testItRendersAllItemsWithDuplicateKeyValues() { + var _this14 = this; + + this.makeList([{ text: 'Hello' }, { text: 'Hello' }, { text: 'Hello' }]); + + this.render('{{#each list key="text" as |item|}}{{item.text}}{{/each}}'); + + this.assertText('HelloHelloHello'); + + this.runTask(function () { + _this14.forEach(function (hash) { + return _emberMetal.set(hash, 'text', 'Goodbye'); + }); + }); + + this.assertText('GoodbyeGoodbyeGoodbye'); + + this.replaceList([{ text: 'Hello' }, { text: 'Hello' }, { text: 'Hello' }]); + + this.assertText('HelloHelloHello'); + }; + + SingleEachTest.prototype['@test context is not changed to the inner scope inside an {{#each as}} block'] = function testContextIsNotChangedToTheInnerScopeInsideAnEachAsBlock() { + var _this15 = this; + + this.makeList([{ name: 'Chad' }, { name: 'Zack' }, { name: 'Asa' }]); + + this.render('{{name}}-{{#each list as |person|}}{{name}}{{/each}}-{{name}}', { + name: 'Joel' + }); + + this.assertText('Joel-JoelJoelJoel-Joel'); + + this.assertStableRerender(); + + this.runTask(function () { + return _this15.shiftObject(); + }); + + this.assertText('Joel-JoelJoel-Joel'); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'name', 'Godfrey'); + }); + + this.assertText('Godfrey-GodfreyGodfrey-Godfrey'); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'name', 'Joel'); + }); + this.replaceList([{ name: 'Chad' }, { name: 'Zack' }, { name: 'Asa' }]); + + this.assertText('Joel-JoelJoelJoel-Joel'); + }; + + SingleEachTest.prototype['@test can access the item and the original scope'] = function testCanAccessTheItemAndTheOriginalScope() { + var _this16 = this; + + this.makeList([{ name: 'Tom Dale' }, { name: 'Yehuda Katz' }, { name: 'Godfrey Chan' }]); + + this.render('{{#each list key="name" as |person|}}[{{title}}: {{person.name}}]{{/each}}', { + title: 'Señor Engineer' + }); + + this.assertText('[Señor Engineer: Tom Dale][Señor Engineer: Yehuda Katz][Señor Engineer: Godfrey Chan]'); + + this.runTask(function () { + return _this16.rerender(); + }); + + this.assertText('[Señor Engineer: Tom Dale][Señor Engineer: Yehuda Katz][Señor Engineer: Godfrey Chan]'); + + this.runTask(function () { + _emberMetal.set(_this16.objectAt(1), 'name', 'Stefan Penner'); + _this16.removeAt(0); + _this16.pushObject({ name: 'Tom Dale' }); + _this16.insertAt(1, { name: 'Chad Hietala' }); + _emberMetal.set(_this16.context, 'title', 'Principal Engineer'); + }); + + this.assertText('[Principal Engineer: Stefan Penner][Principal Engineer: Chad Hietala][Principal Engineer: Godfrey Chan][Principal Engineer: Tom Dale]'); + + this.runTask(function () { + return _emberMetal.set(_this16.context, 'title', 'Señor Engineer'); + }); + this.replaceList([{ name: 'Tom Dale' }, { name: 'Yehuda Katz' }, { name: 'Godfrey Chan' }]); + + this.assertText('[Señor Engineer: Tom Dale][Señor Engineer: Yehuda Katz][Señor Engineer: Godfrey Chan]'); + }; + + SingleEachTest.prototype['@test the scoped variable is not available outside the {{#each}} block.'] = function testTheScopedVariableIsNotAvailableOutsideTheEachBlock() { + var _this17 = this; + + this.makeList(['Yehuda']); + + this.render('{{name}}-{{#each list as |name|}}{{name}}{{/each}}-{{name}}', { + name: 'Stef' + }); + + this.assertText('Stef-Yehuda-Stef'); + + this.runTask(function () { + return _this17.rerender(); + }); + + this.assertText('Stef-Yehuda-Stef'); + + this.runTask(function () { + return _this17.pushObjects([' ', 'Katz']); + }); + + this.assertText('Stef-Yehuda Katz-Stef'); + + this.runTask(function () { + return _emberMetal.set(_this17.context, 'name', 'Tom'); + }); + + this.assertText('Tom-Yehuda Katz-Tom'); + + this.runTask(function () { + return _emberMetal.set(_this17.context, 'name', 'Stef'); + }); + this.replaceList(['Yehuda']); + + this.assertText('Stef-Yehuda-Stef'); + }; + + SingleEachTest.prototype['@test inverse template is displayed with context'] = function testInverseTemplateIsDisplayedWithContext() { + var _this18 = this; + + this.makeList([]); + + this.render('{{#each list as |thing|}}Has Thing{{else}}No Thing {{otherThing}}{{/each}}', { + otherThing: 'bar' + }); + + this.assertText('No Thing bar'); + + this.runTask(function () { + return _this18.rerender(); + }); + + this.assertText('No Thing bar'); + + this.runTask(function () { + return _emberMetal.set(_this18.context, 'otherThing', 'biz'); + }); + + this.assertText('No Thing biz'); + + this.runTask(function () { + return _this18.pushObject('non-empty'); + }); + + this.assertText('Has Thing'); + + this.runTask(function () { + return _emberMetal.set(_this18.context, 'otherThing', 'baz'); + }); + + this.assertText('Has Thing'); + + this.runTask(function () { + return _emberMetal.set(_this18.context, 'otherThing', 'bar'); + }); + this.replaceList([]); + + this.assertText('No Thing bar'); + }; + + SingleEachTest.prototype['@test content that are not initially present updates correctly GH#13983'] = function testContentThatAreNotInitiallyPresentUpdatesCorrectlyGH13983() { + var _this19 = this; + + // The root cause of this bug is that Glimmer did not call `didInitializeChildren` + // on the inserted `TryOpcode`, causing that `TryOpcode` to have an uninitialized + // tag. Currently the only way to observe this the "JUMP-IF-NOT-MODIFIED", i.e. by + // wrapping it in an component. + + this.registerComponent('x-wrapper', { template: '{{yield}}' }); + + this.makeList([]); + + this.render('{{#x-wrapper}}{{#each list as |obj|}}[{{obj.text}}]{{/each}}{{/x-wrapper}}'); + + this.assertText(''); + + this.runTask(function () { + return _this19.rerender(); + }); + + this.assertText(''); + + this.runTask(function () { + return _this19.pushObject({ text: 'foo' }); + }); + + this.assertText('[foo]'); + + this.runTask(function () { + return _emberMetal.set(_this19.objectAt(0), 'text', 'FOO'); + }); + + this.assertText('[FOO]'); + + this.runTask(function () { + return _this19.pushObject({ text: 'bar' }); + }); + + this.assertText('[FOO][bar]'); + + this.runTask(function () { + return _emberMetal.set(_this19.objectAt(1), 'text', 'BAR'); + }); + + this.assertText('[FOO][BAR]'); + + this.runTask(function () { + return _emberMetal.set(_this19.objectAt(1), 'text', 'baz'); + }); + + this.assertText('[FOO][baz]'); + + this.runTask(function () { + return _this19.replace(1, 1, [{ text: 'BAZ' }]); + }); + + this.assertText('[FOO][BAZ]'); + + this.replaceList([]); + + this.assertText(''); + }; + + return SingleEachTest; + })(AbstractEachTest); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#each}} with arrays', (function (_SingleEachTest) { +babelHelpers.inherits(_class5, _SingleEachTest); + + function _class5() { +babelHelpers.classCallCheck(this, _class5); + + _SingleEachTest.apply(this, arguments); + } + + _class5.prototype.makeList = function makeList(list) { + return this.list = this.delegate = _emberRuntime.A(list); + }; + + return _class5; + })(SingleEachTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#each}} with array-like objects', (function (_SingleEachTest2) { +babelHelpers.inherits(_class6, _SingleEachTest2); + + function _class6() { +babelHelpers.classCallCheck(this, _class6); + + _SingleEachTest2.apply(this, arguments); + } + + _class6.prototype.makeList = function makeList(list) { + return this.list = this.delegate = new ArrayLike(list); + }; + + return _class6; + })(SingleEachTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#each}} with array proxies, modifying itself', (function (_SingleEachTest3) { +babelHelpers.inherits(_class7, _SingleEachTest3); + + function _class7() { +babelHelpers.classCallCheck(this, _class7); + + _SingleEachTest3.apply(this, arguments); + } + + _class7.prototype.makeList = function makeList(list) { + return this.list = this.delegate = _emberRuntime.ArrayProxy.create({ content: _emberRuntime.A(list) }); + }; + + return _class7; + })(SingleEachTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#each}} with array proxies, replacing its content', (function (_SingleEachTest4) { +babelHelpers.inherits(_class8, _SingleEachTest4); + + function _class8() { +babelHelpers.classCallCheck(this, _class8); + + _SingleEachTest4.apply(this, arguments); + } + + _class8.prototype.makeList = function makeList(list) { + var content = this.delegate = _emberRuntime.A(list); + return this.list = _emberRuntime.ArrayProxy.create({ content: content }); + }; + + _class8.prototype.replaceList = function replaceList(list) { + var _this20 = this; + + this.runTask(function () { + return _this20.list.set('content', _emberRuntime.A(list)); + }); + }; + + return _class8; + })(SingleEachTest)); + + // TODO: Refactor the following tests so we can run them against different kind of arrays + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: Multiple {{#each as}} helpers', (function (_RenderingTest2) { +babelHelpers.inherits(_class9, _RenderingTest2); + + function _class9() { +babelHelpers.classCallCheck(this, _class9); + + _RenderingTest2.apply(this, arguments); + } + + _class9.prototype['@test re-using the same variable with different {{#each}} blocks does not override each other'] = function testReUsingTheSameVariableWithDifferentEachBlocksDoesNotOverrideEachOther() { + var _this21 = this; + + this.render('Admin: {{#each admins key="name" as |person|}}[{{person.name}}]{{/each}} User: {{#each users key="name" as |person|}}[{{person.name}}]{{/each}}', { + admins: _emberRuntime.A([{ name: 'Tom Dale' }]), + users: _emberRuntime.A([{ name: 'Yehuda Katz' }]) + }); + + this.assertText('Admin: [Tom Dale] User: [Yehuda Katz]'); + + this.runTask(function () { + return _this21.rerender(); + }); + + this.assertText('Admin: [Tom Dale] User: [Yehuda Katz]'); + + this.runTask(function () { + _emberMetal.get(_this21.context, 'admins').pushObject({ name: 'Godfrey Chan' }); + _emberMetal.set(_emberMetal.get(_this21.context, 'users').objectAt(0), 'name', 'Stefan Penner'); + }); + + this.assertText('Admin: [Tom Dale][Godfrey Chan] User: [Stefan Penner]'); + + this.runTask(function () { + _emberMetal.set(_this21.context, 'admins', [{ name: 'Tom Dale' }]); + _emberMetal.set(_this21.context, 'users', [{ name: 'Yehuda Katz' }]); + }); + + this.assertText('Admin: [Tom Dale] User: [Yehuda Katz]'); + }; + + _class9.prototype['@test an outer {{#each}}\'s scoped variable does not clobber an inner {{#each}}\'s property if they share the same name - Issue #1315'] = function testAnOuterEachSScopedVariableDoesNotClobberAnInnerEachSPropertyIfTheyShareTheSameNameIssue1315() { + var _this22 = this; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2), { + content: _emberRuntime.A(['X', 'Y']), + options: _emberRuntime.A([{ label: 'One', value: 1 }, { label: 'Two', value: 2 }]) + }); + + this.assertText('X-1:One2:TwoY-1:One2:Two'); + + this.assertStableRerender(); + + this.runTask(function () { + _emberMetal.get(_this22.context, 'content').pushObject('Z'); + _emberMetal.set(_emberMetal.get(_this22.context, 'options').objectAt(0), 'value', 0); + }); + + this.assertText('X-0:One2:TwoY-0:One2:TwoZ-0:One2:Two'); + + this.runTask(function () { + _emberMetal.set(_this22.context, 'content', ['X', 'Y']); + _emberMetal.set(_this22.context, 'options', [{ label: 'One', value: 1 }, { label: 'Two', value: 2 }]); + }); + + this.assertText('X-1:One2:TwoY-1:One2:Two'); + }; + + _class9.prototype['@test the scoped variable is not available outside the {{#each}} block'] = function testTheScopedVariableIsNotAvailableOutsideTheEachBlock() { + var _this23 = this; + + this.render('{{ring}}-{{#each first as |ring|}}{{ring}}-{{#each fifth as |ring|}}{{ring}}-{{#each ninth as |ring|}}{{ring}}-{{/each}}{{ring}}-{{/each}}{{ring}}-{{/each}}{{ring}}', { + ring: 'Greed', + first: _emberRuntime.A(['Limbo']), + fifth: _emberRuntime.A(['Wrath']), + ninth: _emberRuntime.A(['Treachery']) + }); + + this.assertText('Greed-Limbo-Wrath-Treachery-Wrath-Limbo-Greed'); + + this.runTask(function () { + return _this23.rerender(); + }); + + this.assertText('Greed-Limbo-Wrath-Treachery-Wrath-Limbo-Greed'); + + this.runTask(function () { + _emberMetal.set(_this23.context, 'ring', 'O'); + _emberMetal.get(_this23.context, 'fifth').insertAt(0, 'D'); + }); + + this.assertText('O-Limbo-D-Treachery-D-Wrath-Treachery-Wrath-Limbo-O'); + + this.runTask(function () { + _emberMetal.get(_this23.context, 'first').pushObject('I'); + _emberMetal.get(_this23.context, 'ninth').replace(0, 1, 'K'); + }); + + this.assertText('O-Limbo-D-K-D-Wrath-K-Wrath-Limbo-I-D-K-D-Wrath-K-Wrath-I-O'); + + this.runTask(function () { + _emberMetal.set(_this23.context, 'ring', 'Greed'); + _emberMetal.set(_this23.context, 'first', ['Limbo']); + _emberMetal.set(_this23.context, 'fifth', ['Wrath']); + _emberMetal.set(_this23.context, 'ninth', ['Treachery']); + }); + + this.assertText('Greed-Limbo-Wrath-Treachery-Wrath-Limbo-Greed'); + }; + + _class9.prototype['@test it should support {{#each name as |foo|}}, then {{#each foo as |bar|}}'] = function testItShouldSupportEachNameAsFooThenEachFooAsBar() { + var _this24 = this; + + this.render('{{#each name key="@index" as |foo|}}{{#each foo as |bar|}}{{bar}}{{/each}}{{/each}}', { + name: _emberRuntime.A([_emberRuntime.A(['caterpillar'])]) + }); + + this.assertText('caterpillar'); + + this.runTask(function () { + return _this24.rerender(); + }); + + this.assertText('caterpillar'); + + this.runTask(function () { + var name = _emberMetal.get(_this24.context, 'name'); + name.objectAt(0).replace(0, 1, 'lady'); + name.pushObject(['bird']); + }); + + this.assertText('ladybird'); + + this.runTask(function () { + return _emberMetal.set(_this24.context, 'name', [['caterpillar']]); + }); + + this.assertText('caterpillar'); + }; + + return _class9; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#each as}} undefined path', (function (_RenderingTest3) { +babelHelpers.inherits(_class10, _RenderingTest3); + + function _class10() { +babelHelpers.classCallCheck(this, _class10); + + _RenderingTest3.apply(this, arguments); + } + + _class10.prototype['@test keying off of `undefined` does not render'] = function testKeyingOffOfUndefinedDoesNotRender(assert) { + var _this25 = this; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3), { foo: {} }); + + this.assertText(''); + + this.runTask(function () { + return _this25.rerender(); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this25.context, 'foo', { bar: { baz: ['Here!'] } }); + }); + + this.assertText('Here!'); + + this.runTask(function () { + return _emberMetal.set(_this25.context, 'foo', {}); + }); + + this.assertText(''); + }; + + return _class10; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + /* globals MutationObserver: false */ + if (typeof MutationObserver === 'function') { + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#each as}} DOM mutation test', (function (_RenderingTest4) { +babelHelpers.inherits(_class11, _RenderingTest4); + + function _class11() { +babelHelpers.classCallCheck(this, _class11); + + _RenderingTest4.call(this); + this.observer = null; + } + + _class11.prototype.observe = function observe(element) { + var observer = this.observer = new MutationObserver(function () {}); + observer.observe(element, { childList: true, characterData: true }); + }; + + _class11.prototype.teardown = function teardown() { + if (this.observer) { + this.observer.disconnect(); + } + + _RenderingTest4.prototype.teardown.call(this); + }; + + _class11.prototype.assertNoMutation = function assertNoMutation() { + this.assert.deepEqual(this.observer.takeRecords(), [], 'Expected no mutations'); + }; + + _class11.prototype.expectMutations = function expectMutations() { + this.assert.ok(this.observer.takeRecords().length > 0, 'Expected some mutations'); + }; + + _class11.prototype['@test {{#each}} should not mutate a subtree when the array has not changed [GH #14332]'] = function testEachShouldNotMutateASubtreeWhenTheArrayHasNotChangedGH14332(assert) { + var _this26 = this; + + var page = { title: 'Blog Posts' }; + + var model = [{ title: 'Rails is omakase' }, { title: 'Ember is omakase' }]; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4), { page: page, model: model }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5)); + + this.observe(this.$('#posts')[0]); + + // MutationObserver is async + return _emberRuntime.RSVP.Promise.resolve(function () { + _this26.assertStableRerender(); + }).then(function () { + _this26.assertNoMutation(); + + _this26.runTask(function () { + return _emberMetal.set(_this26.context, 'page', { title: 'Essays' }); + }); + + _this26.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject6)); + }).then(function () { + _this26.assertNoMutation(); + + _this26.runTask(function () { + return _emberMetal.set(_this26.context.page, 'title', 'Think Pieces™'); + }); + + _this26.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject7)); + }).then(function () { + // The last set is localized to the `page` object, so we do not expect Glimmer + // to re-iterate the list + _this26.assertNoMutation(); + }); + }; + + return _class11; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + } +}); +enifed('ember-glimmer/tests/integration/syntax/each-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/syntax'); + test('ember-glimmer/tests/integration/syntax/each-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/syntax/each-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/syntax/each-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/syntax'); + QUnit.test('ember-glimmer/tests/integration/syntax/each-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/syntax/each-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/syntax/if-unless-test', ['exports', 'ember-glimmer/tests/utils/helpers', 'ember-runtime', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/shared-conditional-tests'], function (exports, _emberGlimmerTestsUtilsHelpers, _emberRuntime, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsSharedConditionalTests) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if cond}}\n {{#each numbers as |number|}}\n {{foo-bar number=number}}\n {{/each}}\n {{else}}\n Nothing Here!\n {{/if}}'], ['\n {{#if cond}}\n {{#each numbers as |number|}}\n {{foo-bar number=number}}\n {{/each}}\n {{else}}\n Nothing Here!\n {{/if}}']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if foo.bar.baz}}\n Here!\n {{else}}\n Nothing Here!\n {{/if}}'], ['\n {{#if foo.bar.baz}}\n Here!\n {{else}}\n Nothing Here!\n {{/if}}']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#if}} with inverse', (function (_IfUnlessWithSyntaxTest) { +babelHelpers.inherits(_class, _IfUnlessWithSyntaxTest); + + function _class() { +babelHelpers.classCallCheck(this, _class); + + _IfUnlessWithSyntaxTest.apply(this, arguments); + } + + _class.prototype.templateFor = function templateFor(_ref) { + var cond = _ref.cond; + var truthy = _ref.truthy; + var falsy = _ref.falsy; + + return '{{#if ' + cond + '}}' + truthy + '{{else}}' + falsy + '{{/if}}'; + }; + + return _class; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessWithSyntaxTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#unless}} with inverse', (function (_IfUnlessWithSyntaxTest2) { +babelHelpers.inherits(_class2, _IfUnlessWithSyntaxTest2); + + function _class2() { +babelHelpers.classCallCheck(this, _class2); + + _IfUnlessWithSyntaxTest2.apply(this, arguments); + } + + _class2.prototype.templateFor = function templateFor(_ref2) { + var cond = _ref2.cond; + var truthy = _ref2.truthy; + var falsy = _ref2.falsy; + + return '{{#unless ' + cond + '}}' + falsy + '{{else}}' + truthy + '{{/unless}}'; + }; + + return _class2; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessWithSyntaxTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#if}} and {{#unless}} without inverse', (function (_IfUnlessWithSyntaxTest3) { +babelHelpers.inherits(_class3, _IfUnlessWithSyntaxTest3); + + function _class3() { +babelHelpers.classCallCheck(this, _class3); + + _IfUnlessWithSyntaxTest3.apply(this, arguments); + } + + _class3.prototype.templateFor = function templateFor(_ref3) { + var cond = _ref3.cond; + var truthy = _ref3.truthy; + var falsy = _ref3.falsy; + + return '{{#if ' + cond + '}}' + truthy + '{{/if}}{{#unless ' + cond + '}}' + falsy + '{{/unless}}'; + }; + + return _class3; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessWithSyntaxTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#if}}', (function (_RenderingTest) { +babelHelpers.inherits(_class4, _RenderingTest); + + function _class4() { +babelHelpers.classCallCheck(this, _class4); + + _RenderingTest.apply(this, arguments); + } + + _class4.prototype['@test using `if` with an `{{each}}` destroys components when transitioning to and from inverse (GH #12267)'] = function testUsingIfWithAnEachDestroysComponentsWhenTransitioningToAndFromInverseGH12267(assert) { + var _this = this; + + var destroyedChildrenCount = 0; + + this.registerComponent('foo-bar', { + template: '{{number}}', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + willDestroy: function () { + this._super(); + destroyedChildrenCount++; + } + }) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { cond: true, numbers: _emberRuntime.A([1, 2, 3]) }); + + this.assertText('123'); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertText('123'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'cond', false); + }); + + this.assertText('Nothing Here!'); + assert.equal(destroyedChildrenCount, 3, 'the children were properly destroyed'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'cond', true); + }); + + this.assertText('123'); + }; + + _class4.prototype['@test looking up `undefined` property defaults to false'] = function testLookingUpUndefinedPropertyDefaultsToFalse(assert) { + var _this2 = this; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2), { foo: {} }); + + this.assertText('Nothing Here!'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertText('Nothing Here!'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'foo', { bar: { baz: true } }); + }); + + this.assertText('Here!'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'foo', {}); + }); + + this.assertText('Nothing Here!'); + }; + + return _class4; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/syntax/if-unless-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/syntax'); + test('ember-glimmer/tests/integration/syntax/if-unless-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/syntax/if-unless-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/syntax/if-unless-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/syntax'); + QUnit.test('ember-glimmer/tests/integration/syntax/if-unless-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/syntax/if-unless-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/syntax/in-element-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/test-helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/component', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsTestHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerComponent, _emberMetal) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{#-in-element someElement}}\n {{text}}\n {{/-in-element}}\n '], ['\n {{#-in-element someElement}}\n {{text}}\n {{/-in-element}}\n ']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if showModal}}\n {{#-in-element someElement}}\n {{modal-display text=text}}\n {{/-in-element}}\n {{/if}}\n '], ['\n {{#if showModal}}\n {{#-in-element someElement}}\n {{modal-display text=text}}\n {{/-in-element}}\n {{/if}}\n ']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('{{-in-element}}', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { +babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test allows rendering into an external element'] = function testAllowsRenderingIntoAnExternalElement(assert) { + var _this = this; + + var someElement = document.createElement('div'); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { + someElement: someElement, + text: 'Whoop!' + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.element, ''); + _emberGlimmerTestsUtilsTestHelpers.equalTokens(someElement, 'Whoop!'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'text', 'Huzzah!!'); + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.element, ''); + _emberGlimmerTestsUtilsTestHelpers.equalTokens(someElement, 'Huzzah!!'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'text', 'Whoop!'); + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.element, ''); + _emberGlimmerTestsUtilsTestHelpers.equalTokens(someElement, 'Whoop!'); + }; + + _class.prototype['@test components are cleaned up properly'] = function testComponentsAreCleanedUpProperly(assert) { + var _this2 = this; + + var hooks = []; + + var someElement = document.createElement('div'); + + this.registerComponent('modal-display', { + ComponentClass: _emberGlimmerComponent.default.extend({ + didInsertElement: function () { + hooks.push('didInsertElement'); + }, + + willDestroyElement: function () { + hooks.push('willDestroyElement'); + } + }), + + template: '{{text}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2), { + someElement: someElement, + text: 'Whoop!', + showModal: false + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.element, ''); + _emberGlimmerTestsUtilsTestHelpers.equalTokens(someElement, ''); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'showModal', true); + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.element, ''); + this.assertComponentElement(someElement.firstChild, { content: 'Whoop!' }); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'text', 'Huzzah!'); + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.element, ''); + this.assertComponentElement(someElement.firstChild, { content: 'Huzzah!' }); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'text', 'Whoop!'); + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.element, ''); + this.assertComponentElement(someElement.firstChild, { content: 'Whoop!' }); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'showModal', false); + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.element, ''); + _emberGlimmerTestsUtilsTestHelpers.equalTokens(someElement, ''); + + assert.deepEqual(hooks, ['didInsertElement', 'willDestroyElement']); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/syntax/in-element-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/syntax'); + test('ember-glimmer/tests/integration/syntax/in-element-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/syntax/in-element-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/syntax/in-element-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/syntax'); + QUnit.test('ember-glimmer/tests/integration/syntax/in-element-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/syntax/in-element-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/syntax/with-dynamic-var-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{#-with-dynamic-vars foo="bar"}}\n {{-get-dynamic-var \'foo\'}}\n {{/-with-dynamic-vars}}\n '], ['\n {{#-with-dynamic-vars foo="bar"}}\n {{-get-dynamic-var \'foo\'}}\n {{/-with-dynamic-vars}}\n ']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#-with-dynamic-vars outletState="bar"}}\n {{-get-dynamic-var \'outletState\'}}\n {{/-with-dynamic-vars}}\n '], ['\n {{#-with-dynamic-vars outletState="bar"}}\n {{-get-dynamic-var \'outletState\'}}\n {{/-with-dynamic-vars}}\n ']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('{{-with-dynamic-var}}', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { +babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test does not allow setting values other than outletState'] = function testDoesNotAllowSettingValuesOtherThanOutletState(assert) { + var _this = this; + + expectAssertion(function () { + _this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject)); + }, /Using `-with-dynamic-scope` is only supported for `outletState` \(you used `foo`\)./); + }; + + _class.prototype['@test allows setting/getting outletState'] = function testAllowsSettingGettingOutletState(assert) { + // this is simply asserting that we can write and read outletState + // the actual value being used here is not what is used in real life + // feel free to change the value being set and asserted as needed + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + + this.assertText('bar'); + }; + + _class.prototype['@test does not allow setting values other than outletState'] = function testDoesNotAllowSettingValuesOtherThanOutletState(assert) { + var _this2 = this; + + expectAssertion(function () { + _this2.render('{{-get-dynamic-var \'foo\'}}'); + }, /Using `-get-dynamic-scope` is only supported for `outletState` \(you used `foo`\)./); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/syntax/with-dynamic-var-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/syntax'); + test('ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/syntax/with-dynamic-var-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/syntax'); + QUnit.test('ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/syntax/with-test', ['exports', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/shared-conditional-tests', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberMetal, _emberRuntime, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsSharedConditionalTests, _emberGlimmerTestsUtilsAbstractTestCase) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with foo.bar.baz as |thing|}}\n {{thing}}\n {{/with}}'], ['\n {{#with foo.bar.baz as |thing|}}\n {{thing}}\n {{/with}}']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n {{name}}\n {{#with committer1.name as |name|}}\n [{{name}}\n {{#with committer2.name as |name|}}\n [{{name}}]\n {{/with}}\n {{name}}]\n {{/with}}\n {{name}}\n {{#with committer2.name as |name|}}\n [{{name}}\n {{#with committer1.name as |name|}}\n [{{name}}]\n {{/with}}\n {{name}}]\n {{/with}}\n {{name}}\n '], ['\n {{name}}\n {{#with committer1.name as |name|}}\n [{{name}}\n {{#with committer2.name as |name|}}\n [{{name}}]\n {{/with}}\n {{name}}]\n {{/with}}\n {{name}}\n {{#with committer2.name as |name|}}\n [{{name}}\n {{#with committer1.name as |name|}}\n [{{name}}]\n {{/with}}\n {{name}}]\n {{/with}}\n {{name}}\n ']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#with}}', (function (_IfUnlessWithSyntaxTest) { +babelHelpers.inherits(_class, _IfUnlessWithSyntaxTest); + + function _class() { +babelHelpers.classCallCheck(this, _class); + + _IfUnlessWithSyntaxTest.apply(this, arguments); + } + + _class.prototype.templateFor = function templateFor(_ref) { + var cond = _ref.cond; + var truthy = _ref.truthy; + var falsy = _ref.falsy; + + return '{{#with ' + cond + '}}' + truthy + '{{else}}' + falsy + '{{/with}}'; + }; + + return _class; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessWithSyntaxTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#with as}}', (function (_IfUnlessWithSyntaxTest2) { +babelHelpers.inherits(_class2, _IfUnlessWithSyntaxTest2); + + function _class2() { +babelHelpers.classCallCheck(this, _class2); + + _IfUnlessWithSyntaxTest2.apply(this, arguments); + } + + _class2.prototype.templateFor = function templateFor(_ref2) { + var cond = _ref2.cond; + var truthy = _ref2.truthy; + var falsy = _ref2.falsy; + + return '{{#with ' + cond + ' as |test|}}' + truthy + '{{else}}' + falsy + '{{/with}}'; + }; + + _class2.prototype['@test keying off of `undefined` does not render'] = function testKeyingOffOfUndefinedDoesNotRender(assert) { + var _this = this; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { foo: {} }); + + this.assertText(''); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'foo', { bar: { baz: 'Here!' } }); + }); + + this.assertText('Here!'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'foo', {}); + }); + + this.assertText(''); + }; + + _class2.prototype['@test it renders and hides the given block based on the conditional'] = function testItRendersAndHidesTheGivenBlockBasedOnTheConditional() { + var _this2 = this; + + this.render('{{#with cond1 as |cond|}}{{cond.greeting}}{{else}}False{{/with}}', { + cond1: { greeting: 'Hello' } + }); + + this.assertText('Hello'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertText('Hello'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'cond1.greeting', 'Hello world'); + }); + + this.assertText('Hello world'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'cond1', false); + }); + + this.assertText('False'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'cond1', { greeting: 'Hello' }); + }); + + this.assertText('Hello'); + }; + + _class2.prototype['@test can access alias and original scope'] = function testCanAccessAliasAndOriginalScope() { + var _this3 = this; + + this.render('{{#with person as |tom|}}{{title}}: {{tom.name}}{{/with}}', { + title: 'Señor Engineer', + person: { name: 'Tom Dale' } + }); + + this.assertText('Señor Engineer: Tom Dale'); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertText('Señor Engineer: Tom Dale'); + + this.runTask(function () { + _emberMetal.set(_this3.context, 'person.name', 'Yehuda Katz'); + _emberMetal.set(_this3.context, 'title', 'Principal Engineer'); + }); + + this.assertText('Principal Engineer: Yehuda Katz'); + + this.runTask(function () { + _emberMetal.set(_this3.context, 'person', { name: 'Tom Dale' }); + _emberMetal.set(_this3.context, 'title', 'Señor Engineer'); + }); + + this.assertText('Señor Engineer: Tom Dale'); + }; + + _class2.prototype['@test the scoped variable is not available outside the {{#with}} block.'] = function testTheScopedVariableIsNotAvailableOutsideTheWithBlock() { + var _this4 = this; + + this.render('{{name}}-{{#with other as |name|}}{{name}}{{/with}}-{{name}}', { + name: 'Stef', + other: 'Yehuda' + }); + + this.assertText('Stef-Yehuda-Stef'); + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assertText('Stef-Yehuda-Stef'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'other', 'Chad'); + }); + + this.assertText('Stef-Chad-Stef'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'name', 'Tom'); + }); + + this.assertText('Tom-Chad-Tom'); + + this.runTask(function () { + _emberMetal.set(_this4.context, 'name', 'Stef'); + _emberMetal.set(_this4.context, 'other', 'Yehuda'); + }); + + this.assertText('Stef-Yehuda-Stef'); + }; + + _class2.prototype['@test inverse template is displayed with context'] = function testInverseTemplateIsDisplayedWithContext() { + var _this5 = this; + + this.render('{{#with falsyThing as |thing|}}Has Thing{{else}}No Thing {{otherThing}}{{/with}}', { + falsyThing: null, + otherThing: 'bar' + }); + + this.assertText('No Thing bar'); + + this.runTask(function () { + return _this5.rerender(); + }); + + this.assertText('No Thing bar'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'otherThing', 'biz'); + }); + + this.assertText('No Thing biz'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'falsyThing', true); + }); + + this.assertText('Has Thing'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'otherThing', 'baz'); + }); + + this.assertText('Has Thing'); + + this.runTask(function () { + _emberMetal.set(_this5.context, 'otherThing', 'bar'); + _emberMetal.set(_this5.context, 'falsyThing', null); + }); + + this.assertText('No Thing bar'); + }; + + _class2.prototype['@test can access alias of a proxy'] = function testCanAccessAliasOfAProxy() { + var _this6 = this; + + this.render('{{#with proxy as |person|}}{{person.name}}{{/with}}', { + proxy: _emberRuntime.ObjectProxy.create({ content: { name: 'Tom Dale' } }) + }); + + this.assertText('Tom Dale'); + + this.runTask(function () { + return _this6.rerender(); + }); + + this.assertText('Tom Dale'); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'proxy.name', 'Yehuda Katz'); + }); + + this.assertText('Yehuda Katz'); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'proxy.content', { name: 'Godfrey Chan' }); + }); + + this.assertText('Godfrey Chan'); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'proxy.content.name', 'Stefan Penner'); + }); + + this.assertText('Stefan Penner'); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'proxy.content', null); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'proxy', _emberRuntime.ObjectProxy.create({ content: { name: 'Tom Dale' } })); + }); + + this.assertText('Tom Dale'); + }; + + _class2.prototype['@test can access alias of an array'] = function testCanAccessAliasOfAnArray() { + var _this7 = this; + + this.render('{{#with arrayThing as |words|}}{{#each words as |word|}}{{word}}{{/each}}{{/with}}', { + arrayThing: _emberRuntime.A(['Hello', ' ', 'world']) + }); + + this.assertText('Hello world'); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertText('Hello world'); + + this.runTask(function () { + var array = _emberMetal.get(_this7.context, 'arrayThing'); + array.replace(0, 1, 'Goodbye'); + _emberRuntime.removeAt(array, 1); + array.insertAt(1, ', '); + array.pushObject('!'); + }); + + this.assertText('Goodbye, world!'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'arrayThing', ['Hello', ' ', 'world']); + }); + + this.assertText('Hello world'); + }; + + _class2.prototype['@test `attrs` can be used as a block param [GH#14678]'] = function testAttrsCanBeUsedAsABlockParamGH14678() { + var _this8 = this; + + this.render('{{#with hash as |attrs|}}[{{hash.foo}}-{{attrs.foo}}]{{/with}}', { + hash: { foo: 'foo' } + }); + + this.assertText('[foo-foo]'); + + this.runTask(function () { + return _this8.rerender(); + }); + + this.assertText('[foo-foo]'); + + this.runTask(function () { + return _this8.context.set('hash.foo', 'FOO'); + }); + + this.assertText('[FOO-FOO]'); + + this.runTask(function () { + return _this8.context.set('hash.foo', 'foo'); + }); + + this.assertText('[foo-foo]'); + }; + + return _class2; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessWithSyntaxTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: Multiple {{#with as}} helpers', (function (_RenderingTest) { +babelHelpers.inherits(_class3, _RenderingTest); + + function _class3() { +babelHelpers.classCallCheck(this, _class3); + + _RenderingTest.apply(this, arguments); + } + + _class3.prototype['@test re-using the same variable with different {{#with}} blocks does not override each other'] = function testReUsingTheSameVariableWithDifferentWithBlocksDoesNotOverrideEachOther() { + var _this9 = this; + + this.render('Admin: {{#with admin as |person|}}{{person.name}}{{/with}} User: {{#with user as |person|}}{{person.name}}{{/with}}', { + admin: { name: 'Tom Dale' }, + user: { name: 'Yehuda Katz' } + }); + + this.assertText('Admin: Tom Dale User: Yehuda Katz'); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertText('Admin: Tom Dale User: Yehuda Katz'); + + this.runTask(function () { + _emberMetal.set(_this9.context, 'admin.name', 'Godfrey Chan'); + _emberMetal.set(_this9.context, 'user.name', 'Stefan Penner'); + }); + + this.assertText('Admin: Godfrey Chan User: Stefan Penner'); + + this.runTask(function () { + _emberMetal.set(_this9.context, 'admin', { name: 'Tom Dale' }); + _emberMetal.set(_this9.context, 'user', { name: 'Yehuda Katz' }); + }); + + this.assertText('Admin: Tom Dale User: Yehuda Katz'); + }; + + _class3.prototype['@test the scoped variable is not available outside the {{#with}} block'] = function testTheScopedVariableIsNotAvailableOutsideTheWithBlock() { + var _this10 = this; + + this.render('{{ring}}-{{#with first as |ring|}}{{ring}}-{{#with fifth as |ring|}}{{ring}}-{{#with ninth as |ring|}}{{ring}}-{{/with}}{{ring}}-{{/with}}{{ring}}-{{/with}}{{ring}}', { + ring: 'Greed', + first: 'Limbo', + fifth: 'Wrath', + ninth: 'Treachery' + }); + + this.assertText('Greed-Limbo-Wrath-Treachery-Wrath-Limbo-Greed'); + + this.runTask(function () { + return _this10.rerender(); + }); + + this.assertText('Greed-Limbo-Wrath-Treachery-Wrath-Limbo-Greed'); + + this.runTask(function () { + _emberMetal.set(_this10.context, 'ring', 'O'); + _emberMetal.set(_this10.context, 'fifth', 'D'); + }); + + this.assertText('O-Limbo-D-Treachery-D-Limbo-O'); + + this.runTask(function () { + _emberMetal.set(_this10.context, 'first', 'I'); + _emberMetal.set(_this10.context, 'ninth', 'K'); + }); + + this.assertText('O-I-D-K-D-I-O'); + + this.runTask(function () { + _emberMetal.set(_this10.context, 'ring', 'Greed'); + _emberMetal.set(_this10.context, 'first', 'Limbo'); + _emberMetal.set(_this10.context, 'fifth', 'Wrath'); + _emberMetal.set(_this10.context, 'ninth', 'Treachery'); + }); + + this.assertText('Greed-Limbo-Wrath-Treachery-Wrath-Limbo-Greed'); + }; + + _class3.prototype['@test it should support {{#with name as |foo|}}, then {{#with foo as |bar|}}'] = function testItShouldSupportWithNameAsFooThenWithFooAsBar() { + var _this11 = this; + + this.render('{{#with name as |foo|}}{{#with foo as |bar|}}{{bar}}{{/with}}{{/with}}', { + name: 'caterpillar' + }); + + this.assertText('caterpillar'); + + this.runTask(function () { + return _this11.rerender(); + }); + + this.assertText('caterpillar'); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'name', 'butterfly'); + }); + + this.assertText('butterfly'); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'name', 'caterpillar'); + }); + + this.assertText('caterpillar'); + }; + + _class3.prototype['@test updating the context should update the alias'] = function testUpdatingTheContextShouldUpdateTheAlias() { + var _this12 = this; + + this.render('{{#with this as |person|}}{{person.name}}{{/with}}', { + name: 'Los Pivots' + }); + + this.assertText('Los Pivots'); + + this.runTask(function () { + return _this12.rerender(); + }); + + this.assertText('Los Pivots'); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'name', 'l\'Pivots'); + }); + + this.assertText('l\'Pivots'); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'name', 'Los Pivots'); + }); + + this.assertText('Los Pivots'); + }; + + _class3.prototype['@test nested {{#with}} blocks should have access to root context'] = function testNestedWithBlocksShouldHaveAccessToRootContext() { + var _this13 = this; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2), { + name: 'ebryn', + committer1: { name: 'trek' }, + committer2: { name: 'machty' } + }); + + this.assertText('ebryn[trek[machty]trek]ebryn[machty[trek]machty]ebryn'); + + this.runTask(function () { + return _this13.rerender(); + }); + + this.assertText('ebryn[trek[machty]trek]ebryn[machty[trek]machty]ebryn'); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'name', 'chancancode'); + }); + + this.assertText('chancancode[trek[machty]trek]chancancode[machty[trek]machty]chancancode'); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'committer1', { name: 'krisselden' }); + }); + + this.assertText('chancancode[krisselden[machty]krisselden]chancancode[machty[krisselden]machty]chancancode'); + + this.runTask(function () { + _emberMetal.set(_this13.context, 'committer1.name', 'wycats'); + _emberMetal.set(_this13.context, 'committer2', { name: 'rwjblue' }); + }); + + this.assertText('chancancode[wycats[rwjblue]wycats]chancancode[rwjblue[wycats]rwjblue]chancancode'); + + this.runTask(function () { + _emberMetal.set(_this13.context, 'name', 'ebryn'); + _emberMetal.set(_this13.context, 'committer1', { name: 'trek' }); + _emberMetal.set(_this13.context, 'committer2', { name: 'machty' }); + }); + + this.assertText('ebryn[trek[machty]trek]ebryn[machty[trek]machty]ebryn'); + }; + + return _class3; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/syntax/with-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/syntax'); + test('ember-glimmer/tests/integration/syntax/with-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/syntax/with-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/syntax/with-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/syntax'); + QUnit.test('ember-glimmer/tests/integration/syntax/with-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/syntax/with-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/unit/layout-cache-test', ['exports', 'ember-utils', 'ember-glimmer/tests/utils/test-case', 'glimmer-runtime'], function (exports, _emberUtils, _emberGlimmerTestsUtilsTestCase, _glimmerRuntime) { + 'use strict'; + + var Counter = (function () { + function Counter() { + babelHelpers.classCallCheck(this, Counter); + + this.reset(); + } + + Counter.prototype.increment = function increment(key) { + this.total++; + return this.counts[key] = (this.counts[key] || 0) + 1; + }; + + Counter.prototype.get = function get(key) { + return this.counts[key] || 0; + }; + + Counter.prototype.reset = function reset() { + this.total = 0; + this.counts = new _emberUtils.EmptyObject(); + }; + + return Counter; + })(); + + var COUNTER = new Counter(); + + var BasicCompiler = (function () { + function BasicCompiler(template) { + babelHelpers.classCallCheck(this, BasicCompiler); + + this.template = template; + } + + BasicCompiler.prototype.compile = function compile(builder) { + var template = this.template; + + COUNTER.increment(this.constructor.id + '+' + template.id); + builder.wrapLayout(template.asLayout()); + }; + + return BasicCompiler; + })(); + + var TypeOneCompiler = (function (_BasicCompiler) { + babelHelpers.inherits(TypeOneCompiler, _BasicCompiler); + + function TypeOneCompiler() { + babelHelpers.classCallCheck(this, TypeOneCompiler); + + _BasicCompiler.apply(this, arguments); + } + + return TypeOneCompiler; + })(BasicCompiler); + + var TypeTwoCompiler = (function (_BasicCompiler2) { + babelHelpers.inherits(TypeTwoCompiler, _BasicCompiler2); + + function TypeTwoCompiler() { + babelHelpers.classCallCheck(this, TypeTwoCompiler); + + _BasicCompiler2.apply(this, arguments); + } + + return TypeTwoCompiler; + })(BasicCompiler); + + TypeOneCompiler.id = 'type-one'; + TypeTwoCompiler.id = 'type-two'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Layout cache test', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.call(this); + COUNTER.reset(); + } + + _class.prototype.templateFor = function templateFor(content) { + var Factory = this.compile(content); + return this.env.getTemplate(Factory, this.owner); + }; + + _class.prototype['@test each template is only compiled once'] = function testEachTemplateIsOnlyCompiledOnce(assert) { + var env = this.env; + + var template1 = this.templateFor('Hello world!'); + var template2 = this.templateFor('{{foo}} {{bar}}'); + + assert.ok(env.getCompiledBlock(TypeOneCompiler, template1) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.strictEqual(COUNTER.get('type-one+' + template1.id), 1); + assert.strictEqual(COUNTER.get('type-one+' + template2.id), 0); + assert.strictEqual(COUNTER.total, 1); + + assert.ok(env.getCompiledBlock(TypeOneCompiler, template1) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.strictEqual(COUNTER.get('type-one+' + template1.id), 1); + assert.strictEqual(COUNTER.get('type-one+' + template2.id), 0); + assert.strictEqual(COUNTER.total, 1); + + assert.ok(env.getCompiledBlock(TypeOneCompiler, template2) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.strictEqual(COUNTER.get('type-one+' + template1.id), 1); + assert.strictEqual(COUNTER.get('type-one+' + template2.id), 1); + assert.strictEqual(COUNTER.total, 2); + + assert.ok(env.getCompiledBlock(TypeOneCompiler, template1) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeOneCompiler, template1) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeOneCompiler, template2) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeOneCompiler, template1) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeOneCompiler, template1) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeOneCompiler, template1) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeOneCompiler, template2) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeOneCompiler, template2) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + + assert.strictEqual(COUNTER.get('type-one+' + template1.id), 1); + assert.strictEqual(COUNTER.get('type-one+' + template2.id), 1); + assert.strictEqual(COUNTER.total, 2); + }; + + _class.prototype['@test each template/compiler pair is treated as unique'] = function testEachTemplateCompilerPairIsTreatedAsUnique(assert) { + var env = this.env; + + var template = this.templateFor('Hello world!'); + + assert.ok(env.getCompiledBlock(TypeOneCompiler, template) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.strictEqual(COUNTER.get('type-one+' + template.id), 1); + assert.strictEqual(COUNTER.get('type-two+' + template.id), 0); + assert.strictEqual(COUNTER.total, 1); + + assert.ok(env.getCompiledBlock(TypeOneCompiler, template) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.strictEqual(COUNTER.get('type-one+' + template.id), 1); + assert.strictEqual(COUNTER.get('type-two+' + template.id), 0); + assert.strictEqual(COUNTER.total, 1); + + assert.ok(env.getCompiledBlock(TypeTwoCompiler, template) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.strictEqual(COUNTER.get('type-one+' + template.id), 1); + assert.strictEqual(COUNTER.get('type-two+' + template.id), 1); + assert.strictEqual(COUNTER.total, 2); + + assert.ok(env.getCompiledBlock(TypeOneCompiler, template) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeOneCompiler, template) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeTwoCompiler, template) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeOneCompiler, template) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeOneCompiler, template) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeOneCompiler, template) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeTwoCompiler, template) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeTwoCompiler, template) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + + assert.strictEqual(COUNTER.get('type-one+' + template.id), 1); + assert.strictEqual(COUNTER.get('type-two+' + template.id), 1); + assert.strictEqual(COUNTER.total, 2); + }; + + _class.prototype['@test a template instance is returned (ensures templates can be injected into layout property)'] = function testATemplateInstanceIsReturnedEnsuresTemplatesCanBeInjectedIntoLayoutProperty(assert) { + var _this = this; + + var owner = this.owner; + var env = this.env; + + var templateInstanceFor = function (content) { + var _Factory$create; + + var Factory = _this.compile(content); + return Factory.create((_Factory$create = {}, _Factory$create[_emberUtils.OWNER] = owner, _Factory$create.env = env, _Factory$create)); + }; + + var template1 = templateInstanceFor('Hello world!'); + var template2 = templateInstanceFor('{{foo}} {{bar}}'); + + assert.ok(env.getCompiledBlock(TypeOneCompiler, template1) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeOneCompiler, template2) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/unit/layout-cache-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/unit'); + test('ember-glimmer/tests/unit/layout-cache-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/unit/layout-cache-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/unit/layout-cache-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/unit'); + QUnit.test('ember-glimmer/tests/unit/layout-cache-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/unit/layout-cache-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/unit/outlet-test', ['exports', 'ember-glimmer/views/outlet', 'ember-metal'], function (exports, _emberGlimmerViewsOutlet, _emberMetal) { + 'use strict'; + + QUnit.module('Glimmer OutletView'); + + QUnit.test('render in the render queue', function (assert) { + var didAppendOutletView = 0; + var expectedOutlet = '#foo.bar'; + + var renderer = { + appendOutletView: function (view, target) { + didAppendOutletView++; + assert.equal(view, outletView); + assert.equal(target, expectedOutlet); + } + }; + + var outletView = new _emberGlimmerViewsOutlet.default({}, renderer); + + _emberMetal.run(function () { + assert.equal(didAppendOutletView, 0, 'appendOutletView should not yet have been called (before appendTo)'); + outletView.appendTo(expectedOutlet); + assert.equal(didAppendOutletView, 0, 'appendOutletView should not yet have been called (sync after appendTo)'); + + _emberMetal.run.schedule('actions', function () { + return assert.equal(didAppendOutletView, 0, 'appendOutletView should not yet have been called (in actions)'); + }); + _emberMetal.run.schedule('render', function () { + return assert.equal(didAppendOutletView, 1, 'appendOutletView should be invoked in render'); + }); + }); + }); +}); +enifed('ember-glimmer/tests/unit/outlet-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/unit'); + test('ember-glimmer/tests/unit/outlet-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/unit/outlet-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/unit/outlet-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/unit'); + QUnit.test('ember-glimmer/tests/unit/outlet-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/unit/outlet-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/unit/template-factory-test', ['exports', 'ember-template-compiler', 'ember-glimmer/index', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberTemplateCompiler, _emberGlimmerIndex, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Template factory test', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test the template factory returned from precompile is the same as compile'] = function testTheTemplateFactoryReturnedFromPrecompileIsTheSameAsCompile(assert) { + var env = this.env; + + var templateStr = 'Hello {{name}}'; + var options = { moduleName: 'some-module' }; + + var spec = _emberTemplateCompiler.precompile(templateStr, options); + var body = 'exports.default = template(' + spec + ');'; + var module = new Function('exports', 'template', body); + var exports = {}; + module(exports, _emberGlimmerIndex.template); + var Precompiled = exports['default']; + + var Compiled = _emberTemplateCompiler.compile(templateStr, options); + + assert.equal(typeof Precompiled.create, 'function', 'precompiled is a factory'); + assert.ok(Precompiled.id, 'precompiled has id'); + + assert.equal(typeof Compiled.create, 'function', 'compiled is a factory'); + assert.ok(Compiled.id, 'compiled has id'); + + assert.equal(env._templateCache.misses, 0, 'misses 0'); + assert.equal(env._templateCache.hits, 0, 'hits 0'); + + var precompiled = env.getTemplate(Precompiled, env.owner); + + assert.equal(env._templateCache.misses, 1, 'misses 1'); + assert.equal(env._templateCache.hits, 0, 'hits 0'); + + var compiled = env.getTemplate(Compiled, env.owner); + + assert.equal(env._templateCache.misses, 2, 'misses 2'); + assert.equal(env._templateCache.hits, 0, 'hits 0'); + + assert.ok(typeof precompiled.spec !== 'string', 'Spec has been parsed'); + assert.ok(typeof compiled.spec !== 'string', 'Spec has been parsed'); + + this.registerComponent('x-precompiled', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + layout: Precompiled + }) + }); + + this.registerComponent('x-compiled', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + layout: Compiled + }) + }); + + this.render('{{x-precompiled name="precompiled"}} {{x-compiled name="compiled"}}'); + + assert.equal(env._templateCache.misses, 2, 'misses 2'); + assert.equal(env._templateCache.hits, 2, 'hits 2'); + + this.assertText('Hello precompiled Hello compiled'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/unit/template-factory-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/unit'); + test('ember-glimmer/tests/unit/template-factory-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/unit/template-factory-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/unit/template-factory-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/unit'); + QUnit.test('ember-glimmer/tests/unit/template-factory-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/unit/template-factory-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/utils/abstract-test-case', ['exports', 'internal-test-helpers'], function (exports, _internalTestHelpers) { + 'use strict'; + + exports.TestCase = _internalTestHelpers.AbstractTestCase; + exports.applyMixins = _internalTestHelpers.applyMixins; + exports.strip = _internalTestHelpers.strip; +}); +enifed('ember-glimmer/tests/utils/abstract-test-case.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/utils'); + test('ember-glimmer/tests/utils/abstract-test-case.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/utils/abstract-test-case.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/utils/abstract-test-case.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/utils'); + QUnit.test('ember-glimmer/tests/utils/abstract-test-case.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/utils/abstract-test-case.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/utils/helpers', ['exports', 'ember-template-compiler', 'ember-glimmer'], function (exports, _emberTemplateCompiler, _emberGlimmer) { + 'use strict'; + + exports.compile = _emberTemplateCompiler.compile; + exports.precompile = _emberTemplateCompiler.precompile; + exports.INVOKE = _emberGlimmer.INVOKE; + exports.Helper = _emberGlimmer.Helper; + exports.helper = _emberGlimmer.helper; + exports.Component = _emberGlimmer.Component; + exports.TextArea = _emberGlimmer.TextArea; + exports.LinkComponent = _emberGlimmer.LinkComponent; + exports.TextField = _emberGlimmer.TextField; + exports.InteractiveRender = _emberGlimmer.InteractiveRender; + exports.InertRenderer = _emberGlimmer.InertRenderer; + exports.makeBoundHelper = _emberGlimmer.makeBoundHelper; + exports.htmlSafe = _emberGlimmer.htmlSafe; + exports.SafeString = _emberGlimmer.SafeString; + exports.DOMChanges = _emberGlimmer.DOMChanges; + exports.isHTMLSafe = _emberGlimmer.isHTMLSafe; +}); +enifed('ember-glimmer/tests/utils/helpers.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/utils'); + test('ember-glimmer/tests/utils/helpers.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/utils/helpers.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/utils/helpers.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/utils'); + QUnit.test('ember-glimmer/tests/utils/helpers.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/utils/helpers.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/utils/shared-conditional-tests', ['exports', 'ember-utils', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberUtils, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberMetal, _emberRuntime, _emberGlimmerTestsUtilsHelpers) { + 'use strict'; + + var _ObjectTestCases, _ArrayTestCases; + + var AbstractConditionalsTest = (function (_RenderingTest) { + babelHelpers.inherits(AbstractConditionalsTest, _RenderingTest); + + function AbstractConditionalsTest() { + babelHelpers.classCallCheck(this, AbstractConditionalsTest); + + _RenderingTest.apply(this, arguments); + } + + AbstractConditionalsTest.prototype.wrapperFor = function wrapperFor(templates) { + return templates.join(''); + }; + + AbstractConditionalsTest.prototype.wrappedTemplateFor = function wrappedTemplateFor(options) { + return this.wrapperFor([this.templateFor(options)]); + }; + + /* abstract */ + + AbstractConditionalsTest.prototype.templateFor = function templateFor(_ref5) { + var cond = _ref5.cond; + var truthy = _ref5.truthy; + var falsy = _ref5.falsy; + + // e.g. `{{#if ${cond}}}${truthy}{{else}}${falsy}{{/if}}` + throw new Error('Not implemented: `templateFor`'); + }; + + /* abstract */ + + AbstractConditionalsTest.prototype.renderValues = function renderValues() { + throw new Error('Not implemented: `renderValues`'); + }; + + babelHelpers.createClass(AbstractConditionalsTest, [{ + key: 'truthyValue', + get: function () { + return true; + } + }, { + key: 'falsyValue', + get: function () { + return false; + } + }]); + return AbstractConditionalsTest; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest); + + var AbstractGenerator = (function () { + function AbstractGenerator(cases) { + babelHelpers.classCallCheck(this, AbstractGenerator); + + this.cases = cases; + } + + /* + The test cases in this file generally follow the following pattern: + + 1. Render with [ truthy, ...(other truthy variations), falsy, ...(other falsy variations) ] + 2. No-op rerender + 3. Make all of them falsy (through interior mutation) + 4. Make all of them truthy (through interior mutation, sometimes with some slight variations) + 5. Reset them to their original values (through replacement) + */ + + /* abstract */ + + AbstractGenerator.prototype.generate = function generate(value, idx) { + throw new Error('Not implemented: `generate`'); + }; + + return AbstractGenerator; + })(); + + var TruthyGenerator = (function (_AbstractGenerator) { + babelHelpers.inherits(TruthyGenerator, _AbstractGenerator); + + function TruthyGenerator() { + babelHelpers.classCallCheck(this, TruthyGenerator); + + _AbstractGenerator.apply(this, arguments); + } + + TruthyGenerator.prototype.generate = function generate(value, idx) { + var _ref; + + return _ref = {}, _ref['@test it should consider ' + JSON.stringify(value) + ' truthy [' + idx + ']'] = function () { + var _this = this; + + this.renderValues(value); + + this.assertText('T1'); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertText('T1'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'cond1', _this.falsyValue); + }); + + this.assertText('F1'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'cond1', value); + }); + + this.assertText('T1'); + }, _ref; + }; + + return TruthyGenerator; + })(AbstractGenerator); + + exports.TruthyGenerator = TruthyGenerator; + + var FalsyGenerator = (function (_AbstractGenerator2) { + babelHelpers.inherits(FalsyGenerator, _AbstractGenerator2); + + function FalsyGenerator() { + babelHelpers.classCallCheck(this, FalsyGenerator); + + _AbstractGenerator2.apply(this, arguments); + } + + FalsyGenerator.prototype.generate = function generate(value, idx) { + var _ref2; + + return _ref2 = {}, _ref2['@test it should consider ' + JSON.stringify(value) + ' falsy [' + idx + ']'] = function () { + var _this2 = this; + + this.renderValues(value); + + this.assertText('F1'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertText('F1'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'cond1', _this2.truthyValue); + }); + + this.assertText('T1'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'cond1', value); + }); + + this.assertText('F1'); + }, _ref2; + }; + + return FalsyGenerator; + })(AbstractGenerator); + + exports.FalsyGenerator = FalsyGenerator; + + var StableTruthyGenerator = (function (_TruthyGenerator) { + babelHelpers.inherits(StableTruthyGenerator, _TruthyGenerator); + + function StableTruthyGenerator() { + babelHelpers.classCallCheck(this, StableTruthyGenerator); + + _TruthyGenerator.apply(this, arguments); + } + + StableTruthyGenerator.prototype.generate = function generate(value, idx) { + var _assign; + + return _emberUtils.assign(_TruthyGenerator.prototype.generate.call(this, value, idx), (_assign = {}, _assign['@test it maintains DOM stability when condition changes from ' + value + ' to another truthy value and back [' + idx + ']'] = function () { + var _this3 = this; + + this.renderValues(value); + + this.assertText('T1'); + + this.takeSnapshot(); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'cond1', _this3.truthyValue); + }); + + this.assertText('T1'); + + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'cond1', value); + }); + + this.assertText('T1'); + + this.assertInvariants(); + }, _assign)); + }; + + return StableTruthyGenerator; + })(TruthyGenerator); + + exports.StableTruthyGenerator = StableTruthyGenerator; + + var StableFalsyGenerator = (function (_FalsyGenerator) { + babelHelpers.inherits(StableFalsyGenerator, _FalsyGenerator); + + function StableFalsyGenerator() { + babelHelpers.classCallCheck(this, StableFalsyGenerator); + + _FalsyGenerator.apply(this, arguments); + } + + StableFalsyGenerator.prototype.generate = function generate(value, idx) { + var _assign2; + + return _emberUtils.assign(_FalsyGenerator.prototype.generate.call(this, value), (_assign2 = {}, _assign2['@test it maintains DOM stability when condition changes from ' + value + ' to another falsy value and back [' + idx + ']'] = function () { + var _this4 = this; + + this.renderValues(value); + + this.assertText('F1'); + + this.takeSnapshot(); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'cond1', _this4.falsyValue); + }); + + this.assertText('F1'); + + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'cond1', value); + }); + + this.assertText('F1'); + + this.assertInvariants(); + }, _assign2)); + }; + + return StableFalsyGenerator; + })(FalsyGenerator); + + exports.StableFalsyGenerator = StableFalsyGenerator; + + var ObjectProxyGenerator = (function (_AbstractGenerator3) { + babelHelpers.inherits(ObjectProxyGenerator, _AbstractGenerator3); + + function ObjectProxyGenerator() { + babelHelpers.classCallCheck(this, ObjectProxyGenerator); + + _AbstractGenerator3.apply(this, arguments); + } + + // Testing behaviors shared across all conditionals, i.e. {{#if}}, {{#unless}}, + // {{#with}}, {{#each}}, {{#each-in}}, (if) and (unless) + + ObjectProxyGenerator.prototype.generate = function generate(value, idx) { + // This is inconsistent with our usual to-bool policy, but the current proxy implementation + // simply uses !!content to determine truthiness + if (value) { + var _ref3; + + return _ref3 = {}, _ref3['@test it should consider an object proxy with `' + JSON.stringify(value) + '` truthy [' + idx + ']'] = function () { + var _this5 = this; + + this.renderValues(_emberRuntime.ObjectProxy.create({ content: value })); + + this.assertText('T1'); + + this.runTask(function () { + return _this5.rerender(); + }); + + this.assertText('T1'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'cond1.content', _this5.falsyValue); + }); + + this.assertText('F1'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'cond1', _emberRuntime.ObjectProxy.create({ content: value })); + }); + + this.assertText('T1'); + }, _ref3; + } else { + var _ref4; + + return _ref4 = {}, _ref4['@test it should consider an object proxy with `' + JSON.stringify(value) + '` falsy [' + idx + ']'] = function () { + var _this6 = this; + + this.renderValues(_emberRuntime.ObjectProxy.create({ content: value })); + + this.assertText('F1'); + + this.runTask(function () { + return _this6.rerender(); + }); + + this.assertText('F1'); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'cond1.content', _this6.truthyValue); + }); + + this.assertText('T1'); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'cond1', _emberRuntime.ObjectProxy.create({ content: value })); + }); + + this.assertText('F1'); + }, _ref4; + } + }; + + return ObjectProxyGenerator; + })(AbstractGenerator); + + var BasicConditionalsTest = (function (_AbstractConditionalsTest) { + babelHelpers.inherits(BasicConditionalsTest, _AbstractConditionalsTest); + + function BasicConditionalsTest() { + babelHelpers.classCallCheck(this, BasicConditionalsTest); + + _AbstractConditionalsTest.apply(this, arguments); + } + + // Testing behaviors related to ember objects, object proxies, etc + + BasicConditionalsTest.prototype['@test it renders the corresponding block based on the conditional'] = function testItRendersTheCorrespondingBlockBasedOnTheConditional() { + var _this7 = this; + + this.renderValues(this.truthyValue, this.falsyValue); + + this.assertText('T1F2'); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertText('T1F2'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'cond1', _this7.falsyValue); + }); + + this.assertText('F1F2'); + + this.runTask(function () { + _emberMetal.set(_this7.context, 'cond1', _this7.truthyValue); + _emberMetal.set(_this7.context, 'cond2', _this7.truthyValue); + }); + + this.assertText('T1T2'); + + this.runTask(function () { + _emberMetal.set(_this7.context, 'cond1', _this7.truthyValue); + _emberMetal.set(_this7.context, 'cond2', _this7.falsyValue); + }); + + this.assertText('T1F2'); + }; + + return BasicConditionalsTest; + })(AbstractConditionalsTest); + + exports.BasicConditionalsTest = BasicConditionalsTest; + var ObjectTestCases = (_ObjectTestCases = {}, _ObjectTestCases['@test it considers object proxies without content falsy'] = function () { + var _this8 = this; + + this.renderValues(_emberRuntime.ObjectProxy.create({ content: {} }), _emberRuntime.ObjectProxy.create({ content: _emberRuntime.Object.create() }), _emberRuntime.ObjectProxy.create({ content: null })); + + this.assertText('T1T2F3'); + + this.runTask(function () { + return _this8.rerender(); + }); + + this.assertText('T1T2F3'); + + this.runTask(function () { + _emberMetal.set(_this8.context, 'cond1.content', null); + _emberMetal.set(_this8.context, 'cond2.content', null); + }); + + this.assertText('F1F2F3'); + + this.runTask(function () { + _emberMetal.set(_this8.context, 'cond1.content', _emberRuntime.Object.create()); + _emberMetal.set(_this8.context, 'cond2.content', {}); + _emberMetal.set(_this8.context, 'cond3.content', { foo: 'bar' }); + }); + + this.assertText('T1T2T3'); + + this.runTask(function () { + _emberMetal.set(_this8.context, 'cond1', _emberRuntime.ObjectProxy.create({ content: {} })); + _emberMetal.set(_this8.context, 'cond2', _emberRuntime.ObjectProxy.create({ content: _emberRuntime.Object.create() })); + _emberMetal.set(_this8.context, 'cond3', _emberRuntime.ObjectProxy.create({ content: null })); + }); + + this.assertText('T1T2F3'); + }, _ObjectTestCases); + + exports.ObjectTestCases = ObjectTestCases; + // Testing behaviors related to arrays and array proxies + var ArrayTestCases = (_ArrayTestCases = {}, _ArrayTestCases['@test it considers empty arrays falsy'] = function () { + var _this9 = this; + + this.renderValues(_emberRuntime.A(['hello']), _emberRuntime.A()); + + this.assertText('T1F2'); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertText('T1F2'); + + this.runTask(function () { + return _emberRuntime.removeAt(_emberMetal.get(_this9.context, 'cond1'), 0); + }); + + this.assertText('F1F2'); + + this.runTask(function () { + _emberMetal.get(_this9.context, 'cond1').pushObject('hello'); + _emberMetal.get(_this9.context, 'cond2').pushObjects([1]); + }); + + this.assertText('T1T2'); + + this.runTask(function () { + _emberMetal.set(_this9.context, 'cond1', _emberRuntime.A(['hello'])); + _emberMetal.set(_this9.context, 'cond2', _emberRuntime.A()); + }); + + this.assertText('T1F2'); + }, _ArrayTestCases['@test it considers array proxies without content falsy'] = function () { + var _this10 = this; + + this.renderValues(_emberRuntime.ArrayProxy.create({ content: _emberRuntime.A(['hello']) }), _emberRuntime.ArrayProxy.create({ content: null })); + + this.assertText('T1F2'); + + this.runTask(function () { + return _this10.rerender(); + }); + + this.assertText('T1F2'); + + this.runTask(function () { + _emberMetal.set(_this10.context, 'cond1.content', null); + _emberMetal.set(_this10.context, 'cond2.content', null); + }); + + this.assertText('F1F2'); + + this.runTask(function () { + _emberMetal.set(_this10.context, 'cond1.content', _emberRuntime.A(['hello'])); + _emberMetal.set(_this10.context, 'cond2.content', _emberRuntime.A([1])); + }); + + this.assertText('T1T2'); + + this.runTask(function () { + _emberMetal.set(_this10.context, 'cond1', _emberRuntime.ArrayProxy.create({ content: _emberRuntime.A(['hello']) })); + _emberMetal.set(_this10.context, 'cond2', _emberRuntime.ArrayProxy.create({ content: null })); + }); + + this.assertText('T1F2'); + }, _ArrayTestCases['@test it considers array proxies with empty arrays falsy'] = function () { + var _this11 = this; + + this.renderValues(_emberRuntime.ArrayProxy.create({ content: _emberRuntime.A(['hello']) }), _emberRuntime.ArrayProxy.create({ content: _emberRuntime.A() })); + + this.assertText('T1F2'); + + this.runTask(function () { + return _this11.rerender(); + }); + + this.assertText('T1F2'); + + this.runTask(function () { + return _emberRuntime.removeAt(_emberMetal.get(_this11.context, 'cond1.content'), 0); + }); + + this.assertText('F1F2'); + + this.runTask(function () { + _emberMetal.get(_this11.context, 'cond1.content').pushObject('hello'); + _emberMetal.get(_this11.context, 'cond2.content').pushObjects([1]); + }); + + this.assertText('T1T2'); + + this.runTask(function () { + _emberMetal.set(_this11.context, 'cond1', _emberRuntime.ArrayProxy.create({ content: _emberRuntime.A(['hello']) })); + _emberMetal.set(_this11.context, 'cond2', _emberRuntime.ArrayProxy.create({ content: _emberRuntime.A() })); + }); + + this.assertText('T1F2'); + }, _ArrayTestCases); + + exports.ArrayTestCases = ArrayTestCases; + var IfUnlessWithTestCases = [new StableTruthyGenerator([true, ' ', 'hello', 'false', 'null', 'undefined', 1, ['hello'], _emberRuntime.A(['hello']), {}, { foo: 'bar' }, _emberRuntime.Object.create(), _emberRuntime.Object.create({ foo: 'bar' }), _emberRuntime.ObjectProxy.create({ content: true }), Object, function () {}, + /*jshint -W053 */ + new String('hello'), new String(''), new Boolean(true), new Boolean(false), + /*jshint +W053 */ + new Date()]), new StableFalsyGenerator([false, null, undefined, '', 0, [], _emberRuntime.A(), _emberRuntime.ObjectProxy.create({ content: undefined })]), new ObjectProxyGenerator([true, ' ', 'hello', 'false', 'null', 'undefined', 1, ['hello'], _emberRuntime.A(['hello']), _emberRuntime.ArrayProxy.create({ content: ['hello'] }), _emberRuntime.ArrayProxy.create({ content: [] }), {}, { foo: 'bar' }, _emberRuntime.Object.create(), _emberRuntime.Object.create({ foo: 'bar' }), _emberRuntime.ObjectProxy.create({ content: true }), _emberRuntime.ObjectProxy.create({ content: undefined }), + /*jshint -W053 */ + new String('hello'), new String(''), new Boolean(true), new Boolean(false), + /*jshint +W053 */ + new Date(), false, null, undefined, '', 0, [], _emberRuntime.A()]), ObjectTestCases, ArrayTestCases]; + + // Testing behaviors shared across the "toggling" conditionals, i.e. {{#if}}, + // {{#unless}}, {{#with}}, {{#each}}, {{#each-in}}, (if) and (unless) + + var TogglingConditionalsTest = (function (_BasicConditionalsTest) { + babelHelpers.inherits(TogglingConditionalsTest, _BasicConditionalsTest); + + function TogglingConditionalsTest() { + babelHelpers.classCallCheck(this, TogglingConditionalsTest); + + _BasicConditionalsTest.apply(this, arguments); + } + + // Testing behaviors shared across the (if) and (unless) helpers + return TogglingConditionalsTest; + })(BasicConditionalsTest); + + exports.TogglingConditionalsTest = TogglingConditionalsTest; + + var TogglingHelperConditionalsTest = (function (_TogglingConditionalsTest) { + babelHelpers.inherits(TogglingHelperConditionalsTest, _TogglingConditionalsTest); + + function TogglingHelperConditionalsTest() { + babelHelpers.classCallCheck(this, TogglingHelperConditionalsTest); + + _TogglingConditionalsTest.apply(this, arguments); + } + + TogglingHelperConditionalsTest.prototype.renderValues = function renderValues() { + var templates = []; + var context = {}; + + for (var _len = arguments.length, values = Array(_len), _key = 0; _key < _len; _key++) { + values[_key] = arguments[_key]; + } + + for (var i = 1; i <= values.length; i++) { + templates.push(this.templateFor({ cond: 'cond' + i, truthy: 't' + i, falsy: 'f' + i })); + context['t' + i] = 'T' + i; + context['f' + i] = 'F' + i; + context['cond' + i] = values[i - 1]; + } + + var wrappedTemplate = this.wrapperFor(templates); + this.render(wrappedTemplate, context); + }; + + TogglingHelperConditionalsTest.prototype['@test it has access to the outer scope from both templates'] = function testItHasAccessToTheOuterScopeFromBothTemplates() { + var _this12 = this; + + var template = this.wrapperFor([this.templateFor({ cond: 'cond1', truthy: 'truthy', falsy: 'falsy' }), this.templateFor({ cond: 'cond2', truthy: 'truthy', falsy: 'falsy' })]); + + this.render(template, { cond1: this.truthyValue, cond2: this.falsyValue, truthy: 'YES', falsy: 'NO' }); + + this.assertText('YESNO'); + + this.runTask(function () { + return _this12.rerender(); + }); + + this.assertText('YESNO'); + + this.runTask(function () { + _emberMetal.set(_this12.context, 'truthy', 'YASS'); + _emberMetal.set(_this12.context, 'falsy', 'NOPE'); + }); + + this.assertText('YASSNOPE'); + + this.runTask(function () { + _emberMetal.set(_this12.context, 'cond1', _this12.falsyValue); + _emberMetal.set(_this12.context, 'cond2', _this12.truthyValue); + }); + + this.assertText('NOPEYASS'); + + this.runTask(function () { + _emberMetal.set(_this12.context, 'truthy', 'YES'); + _emberMetal.set(_this12.context, 'falsy', 'NO'); + _emberMetal.set(_this12.context, 'cond1', _this12.truthyValue); + _emberMetal.set(_this12.context, 'cond2', _this12.falsyValue); + }); + + this.assertText('YESNO'); + }; + + TogglingHelperConditionalsTest.prototype['@test it does not update when the unbound helper is used'] = function testItDoesNotUpdateWhenTheUnboundHelperIsUsed() { + var _this13 = this; + + var template = this.wrapperFor([this.templateFor({ cond: '(unbound cond1)', truthy: '"T1"', falsy: '"F1"' }), this.templateFor({ cond: '(unbound cond2)', truthy: '"T2"', falsy: '"F2"' })]); + + this.render(template, { cond1: this.truthyValue, cond2: this.falsyValue }); + + this.assertText('T1F2'); + + this.runTask(function () { + return _this13.rerender(); + }); + + this.assertText('T1F2'); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'cond1', _this13.falsyValue); + }); + + this.assertText('T1F2'); + + this.runTask(function () { + _emberMetal.set(_this13.context, 'cond1', _this13.truthyValue); + _emberMetal.set(_this13.context, 'cond2', _this13.truthyValue); + }); + + this.assertText('T1F2'); + + this.runTask(function () { + _emberMetal.set(_this13.context, 'cond1', _this13.truthyValue); + _emberMetal.set(_this13.context, 'cond2', _this13.falsyValue); + }); + + this.assertText('T1F2'); + }; + + TogglingHelperConditionalsTest.prototype['@test evaluation should be lazy'] = function testEvaluationShouldBeLazy(assert) { + var _this14 = this; + + var truthyEvaluated = undefined; + var falsyEvaluated = undefined; + + var withoutEvaluatingTruthy = function (callback) { + truthyEvaluated = false; + callback(); + assert.ok(!truthyEvaluated, 'x-truthy is not evaluated'); + }; + + var withoutEvaluatingFalsy = function (callback) { + falsyEvaluated = false; + callback(); + assert.ok(!falsyEvaluated, 'x-falsy is not evaluated'); + }; + + this.registerHelper('x-truthy', { + compute: function () { + truthyEvaluated = true; + return 'T'; + } + }); + + this.registerHelper('x-falsy', { + compute: function () { + falsyEvaluated = true; + return 'F'; + } + }); + + var template = this.wrappedTemplateFor({ cond: 'cond', truthy: '(x-truthy)', falsy: '(x-falsy)' }); + + withoutEvaluatingFalsy(function () { + return _this14.render(template, { cond: _this14.truthyValue }); + }); + + this.assertText('T'); + + withoutEvaluatingFalsy(function () { + return _this14.runTask(function () { + return _this14.rerender(); + }); + }); + + this.assertText('T'); + + withoutEvaluatingTruthy(function () { + return _this14.runTask(function () { + return _emberMetal.set(_this14.context, 'cond', _this14.falsyValue); + }); + }); + + this.assertText('F'); + + withoutEvaluatingTruthy(function () { + return _this14.runTask(function () { + return _this14.rerender(); + }); + }); + + this.assertText('F'); + + withoutEvaluatingFalsy(function () { + return _this14.runTask(function () { + return _emberMetal.set(_this14.context, 'cond', _this14.truthyValue); + }); + }); + + this.assertText('T'); + }; + + return TogglingHelperConditionalsTest; + })(TogglingConditionalsTest); + + exports.TogglingHelperConditionalsTest = TogglingHelperConditionalsTest; + + var IfUnlessHelperTest = (function (_TogglingHelperConditionalsTest) { + babelHelpers.inherits(IfUnlessHelperTest, _TogglingHelperConditionalsTest); + + function IfUnlessHelperTest() { + babelHelpers.classCallCheck(this, IfUnlessHelperTest); + + _TogglingHelperConditionalsTest.apply(this, arguments); + } + + return IfUnlessHelperTest; + })(TogglingHelperConditionalsTest); + + exports.IfUnlessHelperTest = IfUnlessHelperTest; + + _emberGlimmerTestsUtilsAbstractTestCase.applyMixins.apply(undefined, [IfUnlessHelperTest].concat(IfUnlessWithTestCases)); + + // Testing behaviors shared across the "toggling" syntatical constructs, + // i.e. {{#if}}, {{#unless}}, {{#with}}, {{#each}} and {{#each-in}} + + var TogglingSyntaxConditionalsTest = (function (_TogglingConditionalsTest2) { + babelHelpers.inherits(TogglingSyntaxConditionalsTest, _TogglingConditionalsTest2); + + function TogglingSyntaxConditionalsTest() { + babelHelpers.classCallCheck(this, TogglingSyntaxConditionalsTest); + + _TogglingConditionalsTest2.apply(this, arguments); + } + + TogglingSyntaxConditionalsTest.prototype.renderValues = function renderValues() { + var templates = []; + var context = {}; + + for (var _len2 = arguments.length, values = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + values[_key2] = arguments[_key2]; + } + + for (var i = 1; i <= values.length; i++) { + templates.push(this.templateFor({ cond: 'cond' + i, truthy: '{{t}}' + i, falsy: '{{f}}' + i })); + context['cond' + i] = values[i - 1]; + } + + var wrappedTemplate = this.wrapperFor(templates); + this.render(wrappedTemplate, _emberUtils.assign({ t: 'T', f: 'F' }, context)); + }; + + TogglingSyntaxConditionalsTest.prototype['@test it does not update when the unbound helper is used'] = function testItDoesNotUpdateWhenTheUnboundHelperIsUsed() { + var _this15 = this; + + var template = '' + this.templateFor({ cond: '(unbound cond1)', truthy: 'T1', falsy: 'F1' }) + this.templateFor({ cond: '(unbound cond2)', truthy: 'T2', falsy: 'F2' }); + + this.render(template, { cond1: this.truthyValue, cond2: this.falsyValue }); + + this.assertText('T1F2'); + + this.runTask(function () { + return _this15.rerender(); + }); + + this.assertText('T1F2'); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'cond1', _this15.falsyValue); + }); + + this.assertText('T1F2'); + + this.runTask(function () { + _emberMetal.set(_this15.context, 'cond1', _this15.truthyValue); + _emberMetal.set(_this15.context, 'cond2', _this15.truthyValue); + }); + + this.assertText('T1F2'); + + this.runTask(function () { + _emberMetal.set(_this15.context, 'cond1', _this15.truthyValue); + _emberMetal.set(_this15.context, 'cond2', _this15.falsyValue); + }); + + this.assertText('T1F2'); + }; + + TogglingSyntaxConditionalsTest.prototype['@test it has access to the outer scope from both templates'] = function testItHasAccessToTheOuterScopeFromBothTemplates() { + var _this16 = this; + + var template = this.wrapperFor([this.templateFor({ cond: 'cond1', truthy: '{{truthy}}', falsy: '{{falsy}}' }), this.templateFor({ cond: 'cond2', truthy: '{{truthy}}', falsy: '{{falsy}}' })]); + + this.render(template, { cond1: this.truthyValue, cond2: this.falsyValue, truthy: 'YES', falsy: 'NO' }); + + this.assertText('YESNO'); + + this.runTask(function () { + return _this16.rerender(); + }); + + this.assertText('YESNO'); + + this.runTask(function () { + _emberMetal.set(_this16.context, 'truthy', 'YASS'); + _emberMetal.set(_this16.context, 'falsy', 'NOPE'); + }); + + this.assertText('YASSNOPE'); + + this.runTask(function () { + _emberMetal.set(_this16.context, 'cond1', _this16.falsyValue); + _emberMetal.set(_this16.context, 'cond2', _this16.truthyValue); + }); + + this.assertText('NOPEYASS'); + + this.runTask(function () { + _emberMetal.set(_this16.context, 'truthy', 'YES'); + _emberMetal.set(_this16.context, 'falsy', 'NO'); + _emberMetal.set(_this16.context, 'cond1', _this16.truthyValue); + _emberMetal.set(_this16.context, 'cond2', _this16.falsyValue); + }); + + this.assertText('YESNO'); + }; + + TogglingSyntaxConditionalsTest.prototype['@test it updates correctly when enclosing another conditional'] = function testItUpdatesCorrectlyWhenEnclosingAnotherConditional() { + var _this17 = this; + + // This tests whether the outer conditional tracks its bounds correctly as its inner bounds changes + var inner = this.templateFor({ cond: 'inner', truthy: 'T-inner', falsy: 'F-inner' }); + var template = this.wrappedTemplateFor({ cond: 'outer', truthy: inner, falsy: 'F-outer' }); + + this.render(template, { outer: this.truthyValue, inner: this.truthyValue }); + + this.assertText('T-inner'); + + this.runTask(function () { + return _this17.rerender(); + }); + + this.assertText('T-inner'); + + // Changes the inner bounds + this.runTask(function () { + return _emberMetal.set(_this17.context, 'inner', _this17.falsyValue); + }); + + this.assertText('F-inner'); + + // Now rerender the outer conditional, which require first clearing its bounds + this.runTask(function () { + return _emberMetal.set(_this17.context, 'outer', _this17.falsyValue); + }); + + this.assertText('F-outer'); + }; + + TogglingSyntaxConditionalsTest.prototype['@test it updates correctly when enclosing #each'] = function testItUpdatesCorrectlyWhenEnclosingEach() { + var _this18 = this; + + // This tests whether the outer conditional tracks its bounds correctly as its inner bounds changes + var template = this.wrappedTemplateFor({ cond: 'outer', truthy: '{{#each inner as |text|}}{{text}}{{/each}}', falsy: 'F-outer' }); + + this.render(template, { outer: this.truthyValue, inner: ['inner', '-', 'before'] }); + + this.assertText('inner-before'); + + this.runTask(function () { + return _this18.rerender(); + }); + + this.assertText('inner-before'); + + // Changes the inner bounds + this.runTask(function () { + return _emberMetal.set(_this18.context, 'inner', ['inner-after']); + }); + + this.assertText('inner-after'); + + // Now rerender the outer conditional, which require first clearing its bounds + this.runTask(function () { + return _emberMetal.set(_this18.context, 'outer', _this18.falsyValue); + }); + + this.assertText('F-outer'); + + // Reset + this.runTask(function () { + _emberMetal.set(_this18.context, 'inner', ['inner-again']); + _emberMetal.set(_this18.context, 'outer', _this18.truthyValue); + }); + + this.assertText('inner-again'); + + // Now clear the inner bounds + this.runTask(function () { + return _emberMetal.set(_this18.context, 'inner', []); + }); + + this.assertText(''); + + // Now rerender the outer conditional, which require first clearing its bounds + this.runTask(function () { + return _emberMetal.set(_this18.context, 'outer', _this18.falsyValue); + }); + + this.assertText('F-outer'); + }; + + TogglingSyntaxConditionalsTest.prototype['@test it updates correctly when enclosing triple-curlies'] = function testItUpdatesCorrectlyWhenEnclosingTripleCurlies() { + var _this19 = this; + + // This tests whether the outer conditional tracks its bounds correctly as its inner bounds changes + var template = this.wrappedTemplateFor({ cond: 'outer', truthy: '{{{inner}}}', falsy: 'F-outer' }); + + this.render(template, { outer: this.truthyValue, inner: 'inner-before' }); + + this.assertText('inner-before'); + + this.runTask(function () { + return _this19.rerender(); + }); + + this.assertText('inner-before'); + + // Changes the inner bounds + this.runTask(function () { + return _emberMetal.set(_this19.context, 'inner', '

    inner-after

    '); + }); + + this.assertText('inner-after'); + + // Now rerender the outer conditional, which require first clearing its bounds + this.runTask(function () { + return _emberMetal.set(_this19.context, 'outer', _this19.falsyValue); + }); + + this.assertText('F-outer'); + }; + + TogglingSyntaxConditionalsTest.prototype['@test child conditional should not render children if parent conditional becomes false'] = function testChildConditionalShouldNotRenderChildrenIfParentConditionalBecomesFalse(assert) { + var _this20 = this; + + var childCreated = false; + + this.registerComponent('foo-bar', { + template: 'foo-bar', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + childCreated = true; + } + }) + }); + + var innerTemplate = this.templateFor({ cond: 'cond2', truthy: '{{foo-bar}}', falsy: '' }); + var wrappedTemplate = this.wrappedTemplateFor({ cond: 'cond1', truthy: innerTemplate, falsy: '' }); + + this.render(wrappedTemplate, { cond1: this.truthyValue, cond2: this.falsyValue }); + + assert.ok(!childCreated); + this.assertText(''); + + this.runTask(function () { + return _this20.rerender(); + }); + + assert.ok(!childCreated); + this.assertText(''); + + this.runTask(function () { + _emberMetal.set(_this20.context, 'cond2', _this20.truthyValue); + _emberMetal.set(_this20.context, 'cond1', _this20.falsyValue); + }); + + assert.ok(!childCreated); + this.assertText(''); + + this.runTask(function () { + _emberMetal.set(_this20.context, 'cond2', _this20.falsyValue); + _emberMetal.set(_this20.context, 'cond1', _this20.truthyValue); + }); + + assert.ok(!childCreated); + this.assertText(''); + }; + + TogglingSyntaxConditionalsTest.prototype['@test evaluation should be lazy'] = function testEvaluationShouldBeLazy(assert) { + var _this21 = this; + + var truthyEvaluated = undefined; + var falsyEvaluated = undefined; + + var withoutEvaluatingTruthy = function (callback) { + truthyEvaluated = false; + callback(); + assert.ok(!truthyEvaluated, 'x-truthy is not evaluated'); + }; + + var withoutEvaluatingFalsy = function (callback) { + falsyEvaluated = false; + callback(); + assert.ok(!falsyEvaluated, 'x-falsy is not evaluated'); + }; + + this.registerHelper('x-truthy', { + compute: function () { + truthyEvaluated = true; + return 'T'; + } + }); + + this.registerHelper('x-falsy', { + compute: function () { + falsyEvaluated = true; + return 'F'; + } + }); + + var template = this.wrappedTemplateFor({ cond: 'cond', truthy: '{{x-truthy}}', falsy: '{{x-falsy}}' }); + + withoutEvaluatingFalsy(function () { + return _this21.render(template, { cond: _this21.truthyValue }); + }); + + this.assertText('T'); + + withoutEvaluatingFalsy(function () { + return _this21.runTask(function () { + return _this21.rerender(); + }); + }); + + this.assertText('T'); + + withoutEvaluatingTruthy(function () { + return _this21.runTask(function () { + return _emberMetal.set(_this21.context, 'cond', _this21.falsyValue); + }); + }); + + this.assertText('F'); + + withoutEvaluatingTruthy(function () { + return _this21.runTask(function () { + return _this21.rerender(); + }); + }); + + this.assertText('F'); + + withoutEvaluatingFalsy(function () { + return _this21.runTask(function () { + return _emberMetal.set(_this21.context, 'cond', _this21.truthyValue); + }); + }); + + this.assertText('T'); + }; + + return TogglingSyntaxConditionalsTest; + })(TogglingConditionalsTest); + + exports.TogglingSyntaxConditionalsTest = TogglingSyntaxConditionalsTest; + + var IfUnlessWithSyntaxTest = (function (_TogglingSyntaxConditionalsTest) { + babelHelpers.inherits(IfUnlessWithSyntaxTest, _TogglingSyntaxConditionalsTest); + + function IfUnlessWithSyntaxTest() { + babelHelpers.classCallCheck(this, IfUnlessWithSyntaxTest); + + _TogglingSyntaxConditionalsTest.apply(this, arguments); + } + + return IfUnlessWithSyntaxTest; + })(TogglingSyntaxConditionalsTest); + + exports.IfUnlessWithSyntaxTest = IfUnlessWithSyntaxTest; + + _emberGlimmerTestsUtilsAbstractTestCase.applyMixins.apply(undefined, [IfUnlessWithSyntaxTest].concat(IfUnlessWithTestCases)); +}); +enifed('ember-glimmer/tests/utils/shared-conditional-tests.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/utils'); + test('ember-glimmer/tests/utils/shared-conditional-tests.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/utils/shared-conditional-tests.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/utils/shared-conditional-tests.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/utils'); + QUnit.test('ember-glimmer/tests/utils/shared-conditional-tests.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/utils/shared-conditional-tests.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/utils/string-test', ['exports', 'ember-glimmer/tests/utils/helpers', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case'], function (exports, _emberGlimmerTestsUtilsHelpers, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('SafeString', (function (_TestCase) { + babelHelpers.inherits(_class, _TestCase); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _TestCase.apply(this, arguments); + } + + _class.prototype['@test htmlSafe should return an instance of SafeString'] = function testHtmlSafeShouldReturnAnInstanceOfSafeString() { + var safeString = _emberGlimmerTestsUtilsHelpers.htmlSafe('you need to be more bold'); + + this.assert.ok(safeString instanceof _emberGlimmerTestsUtilsHelpers.SafeString, 'should be a SafeString'); + }; + + _class.prototype['@test htmlSafe should return an empty string for null'] = function testHtmlSafeShouldReturnAnEmptyStringForNull() { + var safeString = _emberGlimmerTestsUtilsHelpers.htmlSafe(null); + + this.assert.equal(safeString instanceof _emberGlimmerTestsUtilsHelpers.SafeString, true, 'should be a SafeString'); + this.assert.equal(safeString.toString(), '', 'should return an empty string'); + }; + + _class.prototype['@test htmlSafe should return an instance of SafeString'] = function testHtmlSafeShouldReturnAnInstanceOfSafeString() { + var safeString = _emberGlimmerTestsUtilsHelpers.htmlSafe(); + + this.assert.equal(safeString instanceof _emberGlimmerTestsUtilsHelpers.SafeString, true, 'should be a SafeString'); + this.assert.equal(safeString.toString(), '', 'should return an empty string'); + }; + + return _class; + })(_emberGlimmerTestsUtilsAbstractTestCase.TestCase)); + + if (true) { + _emberGlimmerTestsUtilsTestCase.moduleFor('SafeString isHTMLSafe', (function (_TestCase2) { + babelHelpers.inherits(_class2, _TestCase2); + + function _class2() { + babelHelpers.classCallCheck(this, _class2); + + _TestCase2.apply(this, arguments); + } + + _class2.prototype['@test isHTMLSafe should detect SafeString'] = function testIsHTMLSafeShouldDetectSafeString() { + var safeString = _emberGlimmerTestsUtilsHelpers.htmlSafe('Emphasize the important things.'); + + this.assert.ok(_emberGlimmerTestsUtilsHelpers.isHTMLSafe(safeString)); + }; + + _class2.prototype['@test isHTMLSafe should not detect SafeString on primatives'] = function testIsHTMLSafeShouldNotDetectSafeStringOnPrimatives() { + this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe('Hello World')); + this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe({})); + this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe([])); + this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe(10)); + this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe(null)); + }; + + return _class2; + })(_emberGlimmerTestsUtilsAbstractTestCase.TestCase)); + } +}); +enifed('ember-glimmer/tests/utils/string-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/utils'); + test('ember-glimmer/tests/utils/string-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/utils/string-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/utils/string-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/utils'); + QUnit.test('ember-glimmer/tests/utils/string-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/utils/string-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/utils/test-case', ['exports', 'internal-test-helpers'], function (exports, _internalTestHelpers) { + 'use strict'; + + exports.TestCase = _internalTestHelpers.AbstractTestCase; + exports.ApplicationTest = _internalTestHelpers.ApplicationTestCase; + exports.RenderingTest = _internalTestHelpers.RenderingTestCase; + exports.moduleFor = _internalTestHelpers.moduleFor; +}); +enifed('ember-glimmer/tests/utils/test-case.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/utils'); + test('ember-glimmer/tests/utils/test-case.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/utils/test-case.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/utils/test-case.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/utils'); + QUnit.test('ember-glimmer/tests/utils/test-case.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/utils/test-case.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/utils/test-helpers', ['exports', 'internal-test-helpers'], function (exports, _internalTestHelpers) { + 'use strict'; + + exports.styles = _internalTestHelpers.styles; + exports.classes = _internalTestHelpers.classes; + exports.equalTokens = _internalTestHelpers.equalTokens; + exports.equalsElement = _internalTestHelpers.equalsElement; +}); +enifed('ember-glimmer/tests/utils/test-helpers.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/utils'); + test('ember-glimmer/tests/utils/test-helpers.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/utils/test-helpers.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/utils/test-helpers.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/utils'); + QUnit.test('ember-glimmer/tests/utils/test-helpers.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/utils/test-helpers.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/utils/bindings.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/utils'); + test('ember-glimmer/utils/bindings.js should pass jscs', function () { + ok(true, 'ember-glimmer/utils/bindings.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/utils/bindings.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/utils'); + QUnit.test('ember-glimmer/utils/bindings.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/utils/bindings.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/utils/iterable.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/utils'); + test('ember-glimmer/utils/iterable.js should pass jscs', function () { + ok(true, 'ember-glimmer/utils/iterable.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/utils/iterable.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/utils'); + QUnit.test('ember-glimmer/utils/iterable.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/utils/iterable.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/utils/process-args.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/utils'); + test('ember-glimmer/utils/process-args.js should pass jscs', function () { + ok(true, 'ember-glimmer/utils/process-args.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/utils/process-args.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/utils'); + QUnit.test('ember-glimmer/utils/process-args.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/utils/process-args.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/utils/references.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/utils'); + test('ember-glimmer/utils/references.js should pass jscs', function () { + ok(true, 'ember-glimmer/utils/references.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/utils/references.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/utils'); + QUnit.test('ember-glimmer/utils/references.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/utils/references.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/utils/string.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/utils'); + test('ember-glimmer/utils/string.js should pass jscs', function () { + ok(true, 'ember-glimmer/utils/string.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/utils/string.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/utils'); + QUnit.test('ember-glimmer/utils/string.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/utils/string.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/utils/to-bool.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/utils'); + test('ember-glimmer/utils/to-bool.js should pass jscs', function () { + ok(true, 'ember-glimmer/utils/to-bool.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/utils/to-bool.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/utils'); + QUnit.test('ember-glimmer/utils/to-bool.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/utils/to-bool.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/views/outlet.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/views'); + test('ember-glimmer/views/outlet.js should pass jscs', function () { + ok(true, 'ember-glimmer/views/outlet.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/views/outlet.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/views'); + QUnit.test('ember-glimmer/views/outlet.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/views/outlet.js should pass jshint.'); + }); +}); +enifed('ember-metal/alias.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/alias.js should pass jscs', function () { + ok(true, 'ember-metal/alias.js should pass jscs.'); + }); +}); +enifed('ember-metal/alias.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/alias.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/alias.js should pass jshint.'); + }); +}); +enifed('ember-metal/binding.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/binding.js should pass jscs', function () { + ok(true, 'ember-metal/binding.js should pass jscs.'); + }); +}); +enifed('ember-metal/binding.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/binding.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/binding.js should pass jshint.'); + }); +}); +enifed('ember-metal/cache.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/cache.js should pass jscs', function () { + ok(true, 'ember-metal/cache.js should pass jscs.'); + }); +}); +enifed('ember-metal/cache.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/cache.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/cache.js should pass jshint.'); + }); +}); +enifed('ember-metal/chains.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/chains.js should pass jscs', function () { + ok(true, 'ember-metal/chains.js should pass jscs.'); + }); +}); +enifed('ember-metal/chains.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/chains.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/chains.js should pass jshint.'); + }); +}); +enifed('ember-metal/computed.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/computed.js should pass jscs', function () { + ok(true, 'ember-metal/computed.js should pass jscs.'); + }); +}); +enifed('ember-metal/computed.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/computed.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/computed.js should pass jshint.'); + }); +}); +enifed('ember-metal/core.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/core.js should pass jscs', function () { + ok(true, 'ember-metal/core.js should pass jscs.'); + }); +}); +enifed('ember-metal/core.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/core.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/core.js should pass jshint.'); + }); +}); +enifed('ember-metal/debug.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/debug.js should pass jscs', function () { + ok(true, 'ember-metal/debug.js should pass jscs.'); + }); +}); +enifed('ember-metal/debug.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/debug.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/debug.js should pass jshint.'); + }); +}); +enifed('ember-metal/dependent_keys.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/dependent_keys.js should pass jscs', function () { + ok(true, 'ember-metal/dependent_keys.js should pass jscs.'); + }); +}); +enifed('ember-metal/dependent_keys.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/dependent_keys.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/dependent_keys.js should pass jshint.'); + }); +}); +enifed('ember-metal/deprecate_property.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/deprecate_property.js should pass jscs', function () { + ok(true, 'ember-metal/deprecate_property.js should pass jscs.'); + }); +}); +enifed('ember-metal/deprecate_property.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/deprecate_property.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/deprecate_property.js should pass jshint.'); + }); +}); +enifed('ember-metal/descriptor.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/descriptor.js should pass jscs', function () { + ok(true, 'ember-metal/descriptor.js should pass jscs.'); + }); +}); +enifed('ember-metal/descriptor.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/descriptor.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/descriptor.js should pass jshint.'); + }); +}); +enifed('ember-metal/error.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/error.js should pass jscs', function () { + ok(true, 'ember-metal/error.js should pass jscs.'); + }); +}); +enifed('ember-metal/error.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/error.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/error.js should pass jshint.'); + }); +}); +enifed('ember-metal/error_handler.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/error_handler.js should pass jscs', function () { + ok(true, 'ember-metal/error_handler.js should pass jscs.'); + }); +}); +enifed('ember-metal/error_handler.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/error_handler.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/error_handler.js should pass jshint.'); + }); +}); +enifed('ember-metal/events.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/events.js should pass jscs', function () { + ok(true, 'ember-metal/events.js should pass jscs.'); + }); +}); +enifed('ember-metal/events.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/events.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/events.js should pass jshint.'); + }); +}); +enifed('ember-metal/expand_properties.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/expand_properties.js should pass jscs', function () { + ok(true, 'ember-metal/expand_properties.js should pass jscs.'); + }); +}); +enifed('ember-metal/expand_properties.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/expand_properties.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/expand_properties.js should pass jshint.'); + }); +}); +enifed('ember-metal/features.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/features.js should pass jscs', function () { + ok(true, 'ember-metal/features.js should pass jscs.'); + }); +}); +enifed('ember-metal/features.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/features.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/features.js should pass jshint.'); + }); +}); +enifed('ember-metal/get_properties.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/get_properties.js should pass jscs', function () { + ok(true, 'ember-metal/get_properties.js should pass jscs.'); + }); +}); +enifed('ember-metal/get_properties.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/get_properties.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/get_properties.js should pass jshint.'); + }); +}); +enifed('ember-metal/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/index.js should pass jscs', function () { + ok(true, 'ember-metal/index.js should pass jscs.'); + }); +}); +enifed('ember-metal/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/index.js should pass jshint.'); + }); +}); +enifed('ember-metal/injected_property.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/injected_property.js should pass jscs', function () { + ok(true, 'ember-metal/injected_property.js should pass jscs.'); + }); +}); +enifed('ember-metal/injected_property.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/injected_property.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/injected_property.js should pass jshint.'); + }); +}); +enifed('ember-metal/instrumentation.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/instrumentation.js should pass jscs', function () { + ok(true, 'ember-metal/instrumentation.js should pass jscs.'); + }); +}); +enifed('ember-metal/instrumentation.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/instrumentation.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/instrumentation.js should pass jshint.'); + }); +}); +enifed('ember-metal/is_blank.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/is_blank.js should pass jscs', function () { + ok(true, 'ember-metal/is_blank.js should pass jscs.'); + }); +}); +enifed('ember-metal/is_blank.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/is_blank.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/is_blank.js should pass jshint.'); + }); +}); +enifed('ember-metal/is_empty.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/is_empty.js should pass jscs', function () { + ok(true, 'ember-metal/is_empty.js should pass jscs.'); + }); +}); +enifed('ember-metal/is_empty.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/is_empty.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/is_empty.js should pass jshint.'); + }); +}); +enifed('ember-metal/is_none.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/is_none.js should pass jscs', function () { + ok(true, 'ember-metal/is_none.js should pass jscs.'); + }); +}); +enifed('ember-metal/is_none.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/is_none.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/is_none.js should pass jshint.'); + }); +}); +enifed('ember-metal/is_present.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/is_present.js should pass jscs', function () { + ok(true, 'ember-metal/is_present.js should pass jscs.'); + }); +}); +enifed('ember-metal/is_present.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/is_present.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/is_present.js should pass jshint.'); + }); +}); +enifed('ember-metal/is_proxy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/is_proxy.js should pass jscs', function () { + ok(true, 'ember-metal/is_proxy.js should pass jscs.'); + }); +}); +enifed('ember-metal/is_proxy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/is_proxy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/is_proxy.js should pass jshint.'); + }); +}); +enifed('ember-metal/libraries.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/libraries.js should pass jscs', function () { + ok(true, 'ember-metal/libraries.js should pass jscs.'); + }); +}); +enifed('ember-metal/libraries.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/libraries.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/libraries.js should pass jshint.'); + }); +}); +enifed('ember-metal/map.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/map.js should pass jscs', function () { + ok(true, 'ember-metal/map.js should pass jscs.'); + }); +}); +enifed('ember-metal/map.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/map.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/map.js should pass jshint.'); + }); +}); +enifed('ember-metal/merge.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/merge.js should pass jscs', function () { + ok(true, 'ember-metal/merge.js should pass jscs.'); + }); +}); +enifed('ember-metal/merge.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/merge.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/merge.js should pass jshint.'); + }); +}); +enifed('ember-metal/meta.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/meta.js should pass jscs', function () { + ok(true, 'ember-metal/meta.js should pass jscs.'); + }); +}); +enifed('ember-metal/meta.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/meta.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/meta.js should pass jshint.'); + }); +}); +enifed('ember-metal/meta_listeners.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/meta_listeners.js should pass jscs', function () { + ok(true, 'ember-metal/meta_listeners.js should pass jscs.'); + }); +}); +enifed('ember-metal/meta_listeners.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/meta_listeners.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/meta_listeners.js should pass jshint.'); + }); +}); +enifed('ember-metal/mixin.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/mixin.js should pass jscs', function () { + ok(true, 'ember-metal/mixin.js should pass jscs.'); + }); +}); +enifed('ember-metal/mixin.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/mixin.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/mixin.js should pass jshint.'); + }); +}); +enifed('ember-metal/observer.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/observer.js should pass jscs', function () { + ok(true, 'ember-metal/observer.js should pass jscs.'); + }); +}); +enifed('ember-metal/observer.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/observer.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/observer.js should pass jshint.'); + }); +}); +enifed('ember-metal/observer_set.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/observer_set.js should pass jscs', function () { + ok(true, 'ember-metal/observer_set.js should pass jscs.'); + }); +}); +enifed('ember-metal/observer_set.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/observer_set.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/observer_set.js should pass jshint.'); + }); +}); +enifed('ember-metal/path_cache.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/path_cache.js should pass jscs', function () { + ok(true, 'ember-metal/path_cache.js should pass jscs.'); + }); +}); +enifed('ember-metal/path_cache.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/path_cache.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/path_cache.js should pass jshint.'); + }); +}); +enifed('ember-metal/properties.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/properties.js should pass jscs', function () { + ok(true, 'ember-metal/properties.js should pass jscs.'); + }); +}); +enifed('ember-metal/properties.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/properties.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/properties.js should pass jshint.'); + }); +}); +enifed('ember-metal/property_events.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/property_events.js should pass jscs', function () { + ok(true, 'ember-metal/property_events.js should pass jscs.'); + }); +}); +enifed('ember-metal/property_events.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/property_events.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/property_events.js should pass jshint.'); + }); +}); +enifed('ember-metal/property_get.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/property_get.js should pass jscs', function () { + ok(true, 'ember-metal/property_get.js should pass jscs.'); + }); +}); +enifed('ember-metal/property_get.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/property_get.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/property_get.js should pass jshint.'); + }); +}); +enifed('ember-metal/property_set.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/property_set.js should pass jscs', function () { + ok(true, 'ember-metal/property_set.js should pass jscs.'); + }); +}); +enifed('ember-metal/property_set.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/property_set.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/property_set.js should pass jshint.'); + }); +}); +enifed('ember-metal/replace.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/replace.js should pass jscs', function () { + ok(true, 'ember-metal/replace.js should pass jscs.'); + }); +}); +enifed('ember-metal/replace.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/replace.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/replace.js should pass jshint.'); + }); +}); +enifed('ember-metal/run_loop.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/run_loop.js should pass jscs', function () { + ok(true, 'ember-metal/run_loop.js should pass jscs.'); + }); +}); +enifed('ember-metal/run_loop.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/run_loop.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/run_loop.js should pass jshint.'); + }); +}); +enifed('ember-metal/set_properties.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/set_properties.js should pass jscs', function () { + ok(true, 'ember-metal/set_properties.js should pass jscs.'); + }); +}); +enifed('ember-metal/set_properties.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/set_properties.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/set_properties.js should pass jshint.'); + }); +}); +enifed('ember-metal/tags.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/tags.js should pass jscs', function () { + ok(true, 'ember-metal/tags.js should pass jscs.'); + }); +}); +enifed('ember-metal/tags.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/tags.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tags.js should pass jshint.'); + }); +}); +enifed('ember-metal/testing.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/testing.js should pass jscs', function () { + ok(true, 'ember-metal/testing.js should pass jscs.'); + }); +}); +enifed('ember-metal/testing.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/testing.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/testing.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/accessors/get_path_test', ['exports', 'ember-metal/property_get'], function (exports, _emberMetalProperty_get) { + 'use strict'; + + var obj = undefined; + var moduleOpts = { + setup: function () { + obj = { + foo: { + bar: { + baz: { biff: 'BIFF' } + } + }, + foothis: { + bar: { + baz: { biff: 'BIFF' } + } + }, + falseValue: false, + emptyString: '', + Wuz: { + nar: 'foo' + }, + nullValue: null + }; + }, + + teardown: function () { + obj = undefined; + } + }; + + QUnit.module('Ember.get with path', moduleOpts); + + // .......................................................... + // LOCAL PATHS + // + + QUnit.test('[obj, foo] -> obj.foo', function () { + deepEqual(_emberMetalProperty_get.get(obj, 'foo'), obj.foo); + }); + + QUnit.test('[obj, foo.bar] -> obj.foo.bar', function () { + deepEqual(_emberMetalProperty_get.get(obj, 'foo.bar'), obj.foo.bar); + }); + + QUnit.test('[obj, foothis.bar] -> obj.foothis.bar', function () { + deepEqual(_emberMetalProperty_get.get(obj, 'foothis.bar'), obj.foothis.bar); + }); + + QUnit.test('[obj, falseValue.notDefined] -> (undefined)', function () { + strictEqual(_emberMetalProperty_get.get(obj, 'falseValue.notDefined'), undefined); + }); + + QUnit.test('[obj, emptyString.length] -> 0', function () { + strictEqual(_emberMetalProperty_get.get(obj, 'emptyString.length'), 0); + }); + + QUnit.test('[obj, nullValue.notDefined] -> (undefined)', function () { + strictEqual(_emberMetalProperty_get.get(obj, 'nullValue.notDefined'), undefined); + }); + + // .......................................................... + // GLOBAL PATHS TREATED LOCAL WITH GET + // + + QUnit.test('[obj, Wuz] -> obj.Wuz', function () { + deepEqual(_emberMetalProperty_get.get(obj, 'Wuz'), obj.Wuz); + }); + + QUnit.test('[obj, Wuz.nar] -> obj.Wuz.nar', function () { + deepEqual(_emberMetalProperty_get.get(obj, 'Wuz.nar'), obj.Wuz.nar); + }); + + QUnit.test('[obj, Foo] -> (undefined)', function () { + strictEqual(_emberMetalProperty_get.get(obj, 'Foo'), undefined); + }); + + QUnit.test('[obj, Foo.bar] -> (undefined)', function () { + strictEqual(_emberMetalProperty_get.get(obj, 'Foo.bar'), undefined); + }); +}); +enifed('ember-metal/tests/accessors/get_path_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/accessors'); + test('ember-metal/tests/accessors/get_path_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/accessors/get_path_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/accessors/get_path_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/accessors'); + QUnit.test('ember-metal/tests/accessors/get_path_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/accessors/get_path_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/accessors/get_properties_test', ['exports', 'ember-metal/get_properties'], function (exports, _emberMetalGet_properties) { + 'use strict'; + + QUnit.module('Ember.getProperties'); + + QUnit.test('can retrieve a hash of properties from an object via an argument list or array of property names', function () { + var obj = { + firstName: 'Steve', + lastName: 'Jobs', + companyName: 'Apple, Inc.' + }; + + deepEqual(_emberMetalGet_properties.default(obj, 'firstName', 'lastName'), { firstName: 'Steve', lastName: 'Jobs' }); + deepEqual(_emberMetalGet_properties.default(obj, 'firstName', 'lastName'), { firstName: 'Steve', lastName: 'Jobs' }); + deepEqual(_emberMetalGet_properties.default(obj, 'lastName'), { lastName: 'Jobs' }); + deepEqual(_emberMetalGet_properties.default(obj), {}); + deepEqual(_emberMetalGet_properties.default(obj, ['firstName', 'lastName']), { firstName: 'Steve', lastName: 'Jobs' }); + deepEqual(_emberMetalGet_properties.default(obj, ['firstName']), { firstName: 'Steve' }); + deepEqual(_emberMetalGet_properties.default(obj, []), {}); + }); +}); +enifed('ember-metal/tests/accessors/get_properties_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/accessors'); + test('ember-metal/tests/accessors/get_properties_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/accessors/get_properties_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/accessors/get_properties_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/accessors'); + QUnit.test('ember-metal/tests/accessors/get_properties_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/accessors/get_properties_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/accessors/get_test', ['exports', 'internal-test-helpers', 'ember-metal/property_get', 'ember-metal/mixin', 'ember-metal/observer'], function (exports, _internalTestHelpers, _emberMetalProperty_get, _emberMetalMixin, _emberMetalObserver) { + 'use strict'; + + QUnit.module('Ember.get'); + + QUnit.test('should get arbitrary properties on an object', function () { + var obj = { + string: 'string', + number: 23, + boolTrue: true, + boolFalse: false, + nullValue: null + }; + + for (var key in obj) { + if (!obj.hasOwnProperty(key)) { + continue; + } + equal(_emberMetalProperty_get.get(obj, key), obj[key], key); + } + }); + + QUnit.test('should not access a property more than once', function () { + var count = 0; + var obj = { + get id() { + return ++count; + } + }; + + _emberMetalProperty_get.get(obj, 'id'); + + equal(count, 1); + }); + + _internalTestHelpers.testBoth('should call unknownProperty on watched values if the value is undefined', function (get, set) { + var obj = { + count: 0, + unknownProperty: function (key) { + equal(key, 'foo', 'should pass key'); + this.count++; + return 'FOO'; + } + }; + + var count = 0; + _emberMetalObserver.addObserver(obj, 'foo', function () { + count++; + }); + + equal(get(obj, 'foo'), 'FOO', 'should return value from unknown'); + }); + + QUnit.test('warn on attemps to call get with no arguments', function () { + expectAssertion(function () { + _emberMetalProperty_get.get('aProperty'); + }, /Get must be called with two arguments;/i); + }); + + QUnit.test('warn on attemps to call get with only one argument', function () { + expectAssertion(function () { + _emberMetalProperty_get.get('aProperty'); + }, /Get must be called with two arguments;/i); + }); + + QUnit.test('warn on attemps to call get with more then two arguments', function () { + expectAssertion(function () { + _emberMetalProperty_get.get({}, 'aProperty', true); + }, /Get must be called with two arguments;/i); + }); + + QUnit.test('warn on attempts to get a property of undefined', function () { + expectAssertion(function () { + _emberMetalProperty_get.get(undefined, 'aProperty'); + }, /Cannot call get with 'aProperty' on an undefined object/i); + }); + + QUnit.test('warn on attempts to get a property path of undefined', function () { + expectAssertion(function () { + _emberMetalProperty_get.get(undefined, 'aProperty.on.aPath'); + }, /Cannot call get with 'aProperty.on.aPath' on an undefined object/); + }); + + QUnit.test('warn on attempts to get a property of null', function () { + expectAssertion(function () { + _emberMetalProperty_get.get(null, 'aProperty'); + }, /Cannot call get with 'aProperty' on an undefined object/); + }); + + QUnit.test('warn on attempts to get a property path of null', function () { + expectAssertion(function () { + _emberMetalProperty_get.get(null, 'aProperty.on.aPath'); + }, /Cannot call get with 'aProperty.on.aPath' on an undefined object/); + }); + + QUnit.test('warn on attempts to use get with an unsupported property path', function () { + var obj = {}; + expectAssertion(function () { + return _emberMetalProperty_get.get(obj, null); + }, /The key provided to get must be a string, you passed null/); + expectAssertion(function () { + return _emberMetalProperty_get.get(obj, NaN); + }, /The key provided to get must be a string, you passed NaN/); + expectAssertion(function () { + return _emberMetalProperty_get.get(obj, undefined); + }, /The key provided to get must be a string, you passed undefined/); + expectAssertion(function () { + return _emberMetalProperty_get.get(obj, false); + }, /The key provided to get must be a string, you passed false/); + expectAssertion(function () { + return _emberMetalProperty_get.get(obj, 42); + }, /The key provided to get must be a string, you passed 42/); + expectAssertion(function () { + return _emberMetalProperty_get.get(obj, ''); + }, /Cannot call `Ember.get` with an empty string/); + }); + + // .......................................................... + // BUGS + // + + QUnit.test('(regression) watched properties on unmodified inherited objects should still return their original value', function () { + var MyMixin = _emberMetalMixin.Mixin.create({ + someProperty: 'foo', + propertyDidChange: _emberMetalMixin.observer('someProperty', function () {}) + }); + + var baseObject = MyMixin.apply({}); + var theRealObject = Object.create(baseObject); + + equal(_emberMetalProperty_get.get(theRealObject, 'someProperty'), 'foo', 'should return the set value, not false'); + }); + + QUnit.module('Ember.getWithDefault'); + + QUnit.test('should get arbitrary properties on an object', function () { + var obj = { + string: 'string', + number: 23, + boolTrue: true, + boolFalse: false, + nullValue: null + }; + + for (var key in obj) { + if (!obj.hasOwnProperty(key)) { + continue; + } + equal(_emberMetalProperty_get.getWithDefault(obj, key, 'fail'), obj[key], key); + } + + obj = { + undef: undefined + }; + + equal(_emberMetalProperty_get.getWithDefault(obj, 'undef', 'default'), 'default', 'explicit undefined retrieves the default'); + equal(_emberMetalProperty_get.getWithDefault(obj, 'not-present', 'default'), 'default', 'non-present key retrieves the default'); + }); + + QUnit.test('should call unknownProperty if defined and value is undefined', function () { + var obj = { + count: 0, + unknownProperty: function (key) { + equal(key, 'foo', 'should pass key'); + this.count++; + return 'FOO'; + } + }; + + equal(_emberMetalProperty_get.get(obj, 'foo'), 'FOO', 'should return value from unknown'); + equal(obj.count, 1, 'should have invoked'); + }); + + _internalTestHelpers.testBoth('if unknownProperty is present, it is called', function (get, set) { + var obj = { + count: 0, + unknownProperty: function (key) { + if (key === 'foo') { + equal(key, 'foo', 'should pass key'); + this.count++; + return 'FOO'; + } + } + }; + + var count = 0; + _emberMetalObserver.addObserver(obj, 'foo', function () { + return count++; + }); + + equal(_emberMetalProperty_get.getWithDefault(obj, 'foo', 'fail'), 'FOO', 'should return value from unknownProperty'); + equal(_emberMetalProperty_get.getWithDefault(obj, 'bar', 'default'), 'default', 'should convert undefined from unknownProperty into default'); + }); + + // .......................................................... + // BUGS + // + + QUnit.test('(regression) watched properties on unmodified inherited objects should still return their original value', function () { + var MyMixin = _emberMetalMixin.Mixin.create({ + someProperty: 'foo', + propertyDidChange: _emberMetalMixin.observer('someProperty', function () {/* nothing to do */}) + }); + + var baseObject = MyMixin.apply({}); + var theRealObject = Object.create(baseObject); + + equal(_emberMetalProperty_get.getWithDefault(theRealObject, 'someProperty', 'fail'), 'foo', 'should return the set value, not false'); + }); +}); +enifed('ember-metal/tests/accessors/get_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/accessors'); + test('ember-metal/tests/accessors/get_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/accessors/get_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/accessors/get_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/accessors'); + QUnit.test('ember-metal/tests/accessors/get_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/accessors/get_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/accessors/is_global_path_test', ['exports', 'ember-metal/path_cache'], function (exports, _emberMetalPath_cache) { + 'use strict'; + + QUnit.module('Ember.isGlobalPath'); + + QUnit.test('global path\'s are recognized', function () { + ok(_emberMetalPath_cache.isGlobalPath('App.myProperty')); + ok(_emberMetalPath_cache.isGlobalPath('App.myProperty.subProperty')); + }); + + QUnit.test('if there is a \'this\' in the path, it\'s not a global path', function () { + ok(!_emberMetalPath_cache.isGlobalPath('this.myProperty')); + ok(!_emberMetalPath_cache.isGlobalPath('this')); + }); + + QUnit.test('if the path starts with a lowercase character, it is not a global path', function () { + ok(!_emberMetalPath_cache.isGlobalPath('myObj')); + ok(!_emberMetalPath_cache.isGlobalPath('myObj.SecondProperty')); + }); +}); +enifed('ember-metal/tests/accessors/is_global_path_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/accessors'); + test('ember-metal/tests/accessors/is_global_path_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/accessors/is_global_path_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/accessors/is_global_path_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/accessors'); + QUnit.test('ember-metal/tests/accessors/is_global_path_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/accessors/is_global_path_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/accessors/mandatory_setters_test', ['exports', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/watching', 'ember-metal/meta'], function (exports, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalWatching, _emberMetalMeta) { + 'use strict'; + + QUnit.module('mandatory-setters'); + + function hasMandatorySetter(object, property) { + try { + return Object.getOwnPropertyDescriptor(object, property).set.isMandatorySetter === true; + } catch (e) { + return false; + } + } + + function hasMetaValue(object, property) { + return _emberMetalMeta.meta(object).hasInValues(property); + } + + if (true) { + QUnit.test('does not assert if property is not being watched', function () { + var obj = { + someProp: null, + toString: function () { + return 'custom-object'; + } + }; + + obj.someProp = 'blastix'; + equal(_emberMetalProperty_get.get(obj, 'someProp'), 'blastix'); + }); + + QUnit.test('should not setup mandatory-setter if property is not writable', function () { + expect(6); + + var obj = {}; + + Object.defineProperty(obj, 'a', { value: true }); + Object.defineProperty(obj, 'b', { value: false }); + Object.defineProperty(obj, 'c', { value: undefined }); + Object.defineProperty(obj, 'd', { value: undefined, writable: false }); + Object.defineProperty(obj, 'e', { value: undefined, configurable: false }); + Object.defineProperty(obj, 'f', { value: undefined, configurable: true }); + + _emberMetalWatching.watch(obj, 'a'); + _emberMetalWatching.watch(obj, 'b'); + _emberMetalWatching.watch(obj, 'c'); + _emberMetalWatching.watch(obj, 'd'); + _emberMetalWatching.watch(obj, 'e'); + _emberMetalWatching.watch(obj, 'f'); + + ok(!hasMandatorySetter(obj, 'a'), 'mandatory-setter should not be installed'); + ok(!hasMandatorySetter(obj, 'b'), 'mandatory-setter should not be installed'); + ok(!hasMandatorySetter(obj, 'c'), 'mandatory-setter should not be installed'); + ok(!hasMandatorySetter(obj, 'd'), 'mandatory-setter should not be installed'); + ok(!hasMandatorySetter(obj, 'e'), 'mandatory-setter should not be installed'); + ok(!hasMandatorySetter(obj, 'f'), 'mandatory-setter should not be installed'); + }); + + QUnit.test('should not teardown non mandatory-setter descriptor', function () { + expect(1); + + var obj = { get a() { + return 'hi'; + } }; + + _emberMetalWatching.watch(obj, 'a'); + _emberMetalWatching.unwatch(obj, 'a'); + + equal(obj.a, 'hi'); + }); + + QUnit.test('should not confuse non descriptor watched gets', function () { + expect(2); + + var obj = { get a() { + return 'hi'; + } }; + + _emberMetalWatching.watch(obj, 'a'); + equal(_emberMetalProperty_get.get(obj, 'a'), 'hi'); + equal(obj.a, 'hi'); + }); + + QUnit.test('should not setup mandatory-setter if setter is already setup on property', function () { + expect(2); + + var obj = { someProp: null }; + + Object.defineProperty(obj, 'someProp', { + get: function () { + return null; + }, + + set: function (value) { + equal(value, 'foo-bar', 'custom setter was called'); + } + }); + + _emberMetalWatching.watch(obj, 'someProp'); + ok(!hasMandatorySetter(obj, 'someProp'), 'mandatory-setter should not be installed'); + + obj.someProp = 'foo-bar'; + }); + + QUnit.test('watched ES5 setter should not be smashed by mandatory setter', function () { + var value = undefined; + var obj = { + get foo() {}, + set foo(_value) { + value = _value; + } + }; + + _emberMetalWatching.watch(obj, 'foo'); + + _emberMetalProperty_set.set(obj, 'foo', 2); + equal(value, 2); + }); + + QUnit.test('should not setup mandatory-setter if setter is already setup on property in parent prototype', function () { + expect(2); + + function Foo() {} + + Object.defineProperty(Foo.prototype, 'someProp', { + get: function () { + return null; + }, + + set: function (value) { + equal(value, 'foo-bar', 'custom setter was called'); + } + }); + + var obj = new Foo(); + + _emberMetalWatching.watch(obj, 'someProp'); + ok(!hasMandatorySetter(obj, 'someProp'), 'mandatory-setter should not be installed'); + + obj.someProp = 'foo-bar'; + }); + + QUnit.test('should not setup mandatory-setter if setter is already setup on property in grandparent prototype', function () { + expect(2); + + function Foo() {} + + Object.defineProperty(Foo.prototype, 'someProp', { + get: function () { + return null; + }, + + set: function (value) { + equal(value, 'foo-bar', 'custom setter was called'); + } + }); + + function Bar() {} + Bar.prototype = Object.create(Foo.prototype); + Bar.prototype.constructor = Bar; + + var obj = new Bar(); + + _emberMetalWatching.watch(obj, 'someProp'); + ok(!hasMandatorySetter(obj, 'someProp'), 'mandatory-setter should not be installed'); + + obj.someProp = 'foo-bar'; + }); + + QUnit.test('should not setup mandatory-setter if setter is already setup on property in great grandparent prototype', function () { + expect(2); + + function Foo() {} + + Object.defineProperty(Foo.prototype, 'someProp', { + get: function () { + return null; + }, + + set: function (value) { + equal(value, 'foo-bar', 'custom setter was called'); + } + }); + + function Bar() {} + Bar.prototype = Object.create(Foo.prototype); + Bar.prototype.constructor = Bar; + + function Qux() {} + Qux.prototype = Object.create(Bar.prototype); + Qux.prototype.constructor = Qux; + + var obj = new Qux(); + + _emberMetalWatching.watch(obj, 'someProp'); + ok(!hasMandatorySetter(obj, 'someProp'), 'mandatory-setter should not be installed'); + + obj.someProp = 'foo-bar'; + }); + + QUnit.test('should assert if set without Ember.set when property is being watched', function () { + var obj = { + someProp: null, + toString: function () { + return 'custom-object'; + } + }; + + _emberMetalWatching.watch(obj, 'someProp'); + + expectAssertion(function () { + obj.someProp = 'foo-bar'; + }, 'You must use Ember.set() to set the `someProp` property (of custom-object) to `foo-bar`.'); + }); + + QUnit.test('should not assert if set with Ember.set when property is being watched', function () { + var obj = { + someProp: null, + toString: function () { + return 'custom-object'; + } + }; + + _emberMetalWatching.watch(obj, 'someProp'); + _emberMetalProperty_set.set(obj, 'someProp', 'foo-bar'); + + equal(_emberMetalProperty_get.get(obj, 'someProp'), 'foo-bar'); + }); + + QUnit.test('does not setup mandatory-setter if non-configurable', function () { + var obj = { + someProp: null, + toString: function () { + return 'custom-object'; + } + }; + + Object.defineProperty(obj, 'someProp', { + configurable: false, + enumerable: true, + value: 'blastix' + }); + + _emberMetalWatching.watch(obj, 'someProp'); + ok(!hasMandatorySetter(obj, 'someProp'), 'blastix'); + }); + + QUnit.test('ensure after watch the property is restored (and the value is no-longer stored in meta) [non-enumerable]', function () { + var obj = { + someProp: null, + toString: function () { + return 'custom-object'; + } + }; + + Object.defineProperty(obj, 'someProp', { + configurable: true, + enumerable: false, + value: 'blastix' + }); + + _emberMetalWatching.watch(obj, 'someProp'); + equal(hasMandatorySetter(obj, 'someProp'), true, 'should have a mandatory setter'); + + var descriptor = Object.getOwnPropertyDescriptor(obj, 'someProp'); + + equal(descriptor.enumerable, false, 'property should remain non-enumerable'); + equal(descriptor.configurable, true, 'property should remain configurable'); + equal(obj.someProp, 'blastix', 'expected value to be the getter'); + + equal(descriptor.value, undefined, 'expected existing value to NOT remain'); + + ok(hasMetaValue(obj, 'someProp'), 'someProp is stored in meta.values'); + + _emberMetalWatching.unwatch(obj, 'someProp'); + + ok(!hasMetaValue(obj, 'someProp'), 'someProp is no longer stored in meta.values'); + + descriptor = Object.getOwnPropertyDescriptor(obj, 'someProp'); + + equal(hasMandatorySetter(obj, 'someProp'), false, 'should no longer have a mandatory setter'); + + equal(descriptor.enumerable, false, 'property should remain non-enumerable'); + equal(descriptor.configurable, true, 'property should remain configurable'); + equal(obj.someProp, 'blastix', 'expected value to be the getter'); + equal(descriptor.value, 'blastix', 'expected existing value to remain'); + + obj.someProp = 'new value'; + + // make sure the descriptor remains correct (nothing funky, like a redefined, happened in the setter); + descriptor = Object.getOwnPropertyDescriptor(obj, 'someProp'); + + equal(descriptor.enumerable, false, 'property should remain non-enumerable'); + equal(descriptor.configurable, true, 'property should remain configurable'); + equal(descriptor.value, 'new value', 'expected existing value to NOT remain'); + equal(obj.someProp, 'new value', 'expected value to be the getter'); + equal(obj.someProp, 'new value'); + }); + + QUnit.test('ensure after watch the property is restored (and the value is no-longer stored in meta) [enumerable]', function () { + var obj = { + someProp: null, + toString: function () { + return 'custom-object'; + } + }; + + Object.defineProperty(obj, 'someProp', { + configurable: true, + enumerable: true, + value: 'blastix' + }); + + _emberMetalWatching.watch(obj, 'someProp'); + equal(hasMandatorySetter(obj, 'someProp'), true, 'should have a mandatory setter'); + + var descriptor = Object.getOwnPropertyDescriptor(obj, 'someProp'); + + equal(descriptor.enumerable, true, 'property should remain enumerable'); + equal(descriptor.configurable, true, 'property should remain configurable'); + equal(obj.someProp, 'blastix', 'expected value to be the getter'); + + equal(descriptor.value, undefined, 'expected existing value to NOT remain'); + + ok(hasMetaValue(obj, 'someProp'), 'someProp is stored in meta.values'); + + _emberMetalWatching.unwatch(obj, 'someProp'); + + ok(!hasMetaValue(obj, 'someProp'), 'someProp is no longer stored in meta.values'); + + descriptor = Object.getOwnPropertyDescriptor(obj, 'someProp'); + + equal(hasMandatorySetter(obj, 'someProp'), false, 'should no longer have a mandatory setter'); + + equal(descriptor.enumerable, true, 'property should remain enumerable'); + equal(descriptor.configurable, true, 'property should remain configurable'); + equal(obj.someProp, 'blastix', 'expected value to be the getter'); + equal(descriptor.value, 'blastix', 'expected existing value to remain'); + + obj.someProp = 'new value'; + + // make sure the descriptor remains correct (nothing funky, like a redefined, happened in the setter); + descriptor = Object.getOwnPropertyDescriptor(obj, 'someProp'); + + equal(descriptor.enumerable, true, 'property should remain enumerable'); + equal(descriptor.configurable, true, 'property should remain configurable'); + equal(descriptor.value, 'new value', 'expected existing value to NOT remain'); + equal(obj.someProp, 'new value'); + }); + + QUnit.test('sets up mandatory-setter if property comes from prototype', function () { + expect(2); + + var obj = { + someProp: null, + toString: function () { + return 'custom-object'; + } + }; + + var obj2 = Object.create(obj); + + _emberMetalWatching.watch(obj2, 'someProp'); + + ok(hasMandatorySetter(obj2, 'someProp'), 'mandatory setter has been setup'); + + expectAssertion(function () { + obj2.someProp = 'foo-bar'; + }, 'You must use Ember.set() to set the `someProp` property (of custom-object) to `foo-bar`.'); + }); + + QUnit.test('inheritance remains live', function () { + function Parent() {} + Parent.prototype.food = 'chips'; + + var child = new Parent(); + + equal(child.food, 'chips'); + + _emberMetalWatching.watch(child, 'food'); + + equal(child.food, 'chips'); + + Parent.prototype.food = 'icecreame'; + + equal(child.food, 'icecreame'); + + _emberMetalWatching.unwatch(child, 'food'); + + equal(child.food, 'icecreame'); + + Parent.prototype.food = 'chips'; + + equal(child.food, 'chips'); + }); + + QUnit.test('inheritance remains live and preserves this', function () { + function Parent(food) { + this._food = food; + } + + Object.defineProperty(Parent.prototype, 'food', { + get: function () { + return this._food; + } + }); + + var child = new Parent('chips'); + + equal(child.food, 'chips'); + + _emberMetalWatching.watch(child, 'food'); + + equal(child.food, 'chips'); + + child._food = 'icecreame'; + + equal(child.food, 'icecreame'); + + _emberMetalWatching.unwatch(child, 'food'); + + equal(child.food, 'icecreame'); + + var foodDesc = Object.getOwnPropertyDescriptor(Parent.prototype, 'food'); + ok(!foodDesc.configurable, 'Parent.prototype.food desc should be non configable'); + ok(!foodDesc.enumerable, 'Parent.prototype.food desc should be non enumerable'); + + equal(foodDesc.get.call({ + _food: 'hi' + }), 'hi'); + equal(foodDesc.set, undefined); + + equal(child.food, 'icecreame'); + }); + } +}); +enifed('ember-metal/tests/accessors/mandatory_setters_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/accessors'); + test('ember-metal/tests/accessors/mandatory_setters_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/accessors/mandatory_setters_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/accessors/mandatory_setters_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/accessors'); + QUnit.test('ember-metal/tests/accessors/mandatory_setters_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/accessors/mandatory_setters_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/accessors/set_path_test', ['exports', 'ember-environment', 'ember-metal/property_set', 'ember-metal/property_get'], function (exports, _emberEnvironment, _emberMetalProperty_set, _emberMetalProperty_get) { + 'use strict'; + + var originalLookup = _emberEnvironment.context.lookup; + var lookup = undefined; + + var obj = undefined; + function commonSetup() { + _emberEnvironment.context.lookup = lookup = {}; + obj = { + foo: { + bar: { + baz: { biff: 'BIFF' } + } + } + }; + } + + function commonTeardown() { + _emberEnvironment.context.lookup = originalLookup; + obj = null; + } + + QUnit.module('set with path', { + setup: commonSetup, + teardown: commonTeardown + }); + + QUnit.test('[Foo, bar] -> Foo.bar', function () { + lookup.Foo = { toString: function () { + return 'Foo'; + } }; // Behave like an Ember.Namespace + + _emberMetalProperty_set.set(lookup.Foo, 'bar', 'baz'); + equal(_emberMetalProperty_get.get(lookup.Foo, 'bar'), 'baz'); + }); + + // .......................................................... + // + // LOCAL PATHS + + QUnit.test('[obj, foo] -> obj.foo', function () { + _emberMetalProperty_set.set(obj, 'foo', 'BAM'); + equal(_emberMetalProperty_get.get(obj, 'foo'), 'BAM'); + }); + + QUnit.test('[obj, foo.bar] -> obj.foo.bar', function () { + _emberMetalProperty_set.set(obj, 'foo.bar', 'BAM'); + equal(_emberMetalProperty_get.get(obj, 'foo.bar'), 'BAM'); + }); + + // .......................................................... + // DEPRECATED + // + + QUnit.module('set with path - deprecated', { + setup: commonSetup, + teardown: commonTeardown + }); + + QUnit.test('[obj, bla.bla] gives a proper exception message', function () { + var exceptionMessage = 'Property set failed: object in path \"bla\" could not be found or was destroyed.'; + try { + _emberMetalProperty_set.set(obj, 'bla.bla', 'BAM'); + } catch (ex) { + equal(ex.message, exceptionMessage); + } + }); + + QUnit.test('[obj, foo.baz.bat] -> EXCEPTION', function () { + throws(function () { + return _emberMetalProperty_set.set(obj, 'foo.baz.bat', 'BAM'); + }); + }); + + QUnit.test('[obj, foo.baz.bat] -> EXCEPTION', function () { + _emberMetalProperty_set.trySet(obj, 'foo.baz.bat', 'BAM'); + ok(true, 'does not raise'); + }); +}); +enifed('ember-metal/tests/accessors/set_path_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/accessors'); + test('ember-metal/tests/accessors/set_path_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/accessors/set_path_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/accessors/set_path_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/accessors'); + QUnit.test('ember-metal/tests/accessors/set_path_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/accessors/set_path_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/accessors/set_test', ['exports', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/tags'], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalTags) { + 'use strict'; + + QUnit.module('set', { + teardown: function () { + _emberMetalTags.setHasViews(function () { + return false; + }); + } + }); + + QUnit.test('should set arbitrary properties on an object', function () { + var obj = { + string: 'string', + number: 23, + boolTrue: true, + boolFalse: false, + nullValue: null, + undefinedValue: undefined + }; + + var newObj = { + undefinedValue: 'emberjs' + }; + + for (var key in obj) { + if (!obj.hasOwnProperty(key)) { + continue; + } + + equal(_emberMetalProperty_set.set(newObj, key, obj[key]), obj[key], 'should return value'); + equal(_emberMetalProperty_get.get(newObj, key), obj[key], 'should set value'); + } + }); + + QUnit.test('should call setUnknownProperty if defined and value is undefined', function () { + var obj = { + count: 0, + + unknownProperty: function (key, value) { + ok(false, 'should not invoke unknownProperty if setUnknownProperty is defined'); + }, + + setUnknownProperty: function (key, value) { + equal(key, 'foo', 'should pass key'); + equal(value, 'BAR', 'should pass key'); + this.count++; + return 'FOO'; + } + }; + + equal(_emberMetalProperty_set.set(obj, 'foo', 'BAR'), 'BAR', 'should return set value'); + equal(obj.count, 1, 'should have invoked'); + }); + + QUnit.test('warn on attempts to call set with undefined as object', function () { + expectAssertion(function () { + return _emberMetalProperty_set.set(undefined, 'aProperty', 'BAM'); + }, /Cannot call set with 'aProperty' on an undefined object./); + }); + + QUnit.test('warn on attempts to call set with null as object', function () { + expectAssertion(function () { + return _emberMetalProperty_set.set(null, 'aProperty', 'BAM'); + }, /Cannot call set with 'aProperty' on an undefined object./); + }); + + QUnit.test('warn on attempts to use set with an unsupported property path', function () { + var obj = {}; + expectAssertion(function () { + return _emberMetalProperty_set.set(obj, null, 42); + }, /The key provided to set must be a string, you passed null/); + expectAssertion(function () { + return _emberMetalProperty_set.set(obj, NaN, 42); + }, /The key provided to set must be a string, you passed NaN/); + expectAssertion(function () { + return _emberMetalProperty_set.set(obj, undefined, 42); + }, /The key provided to set must be a string, you passed undefined/); + expectAssertion(function () { + return _emberMetalProperty_set.set(obj, false, 42); + }, /The key provided to set must be a string, you passed false/); + expectAssertion(function () { + return _emberMetalProperty_set.set(obj, 42, 42); + }, /The key provided to set must be a string, you passed 42/); + }); + + QUnit.test('warn on attempts of calling set on a destroyed object', function () { + var obj = { isDestroyed: true }; + + expectAssertion(function () { + return _emberMetalProperty_set.set(obj, 'favoriteFood', 'hot dogs'); + }, 'calling set on destroyed object: [object Object].favoriteFood = hot dogs'); + }); + + QUnit.test('does not trigger auto-run assertion for objects that have not been tagged', function (assert) { + _emberMetalTags.setHasViews(function () { + return true; + }); + var obj = {}; + + _emberMetalProperty_set.set(obj, 'foo', 'bar'); + + assert.equal(obj.foo, 'bar'); + }); +}); +enifed('ember-metal/tests/accessors/set_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/accessors'); + test('ember-metal/tests/accessors/set_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/accessors/set_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/accessors/set_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/accessors'); + QUnit.test('ember-metal/tests/accessors/set_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/accessors/set_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/alias_test', ['exports', 'ember-metal/alias', 'ember-metal/properties', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/meta', 'ember-metal/watching', 'ember-metal/observer', 'ember-metal/tags'], function (exports, _emberMetalAlias, _emberMetalProperties, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMeta, _emberMetalWatching, _emberMetalObserver, _emberMetalTags) { + 'use strict'; + + var obj = undefined, + count = undefined; + + QUnit.module('ember-metal/alias', { + setup: function () { + obj = { foo: { faz: 'FOO' } }; + count = 0; + }, + teardown: function () { + obj = null; + } + }); + + function incrementCount() { + count++; + } + + QUnit.test('should proxy get to alt key', function () { + _emberMetalProperties.defineProperty(obj, 'bar', _emberMetalAlias.default('foo.faz')); + equal(_emberMetalProperty_get.get(obj, 'bar'), 'FOO'); + }); + + QUnit.test('should proxy set to alt key', function () { + _emberMetalProperties.defineProperty(obj, 'bar', _emberMetalAlias.default('foo.faz')); + _emberMetalProperty_set.set(obj, 'bar', 'BAR'); + equal(_emberMetalProperty_get.get(obj, 'foo.faz'), 'BAR'); + }); + + QUnit.test('old dependent keys should not trigger property changes', function () { + var obj1 = Object.create(null); + _emberMetalProperties.defineProperty(obj1, 'foo', null, null); + _emberMetalProperties.defineProperty(obj1, 'bar', _emberMetalAlias.default('foo')); + _emberMetalProperties.defineProperty(obj1, 'baz', _emberMetalAlias.default('foo')); + _emberMetalProperties.defineProperty(obj1, 'baz', _emberMetalAlias.default('bar')); // redefine baz + _emberMetalObserver.addObserver(obj1, 'baz', incrementCount); + + _emberMetalProperty_set.set(obj1, 'foo', 'FOO'); + equal(count, 1); + + _emberMetalObserver.removeObserver(obj1, 'baz', incrementCount); + + _emberMetalProperty_set.set(obj1, 'foo', 'OOF'); + equal(count, 1); + }); + + QUnit.test('inheriting an observer of the alias from the prototype then\n redefining the alias on the instance to another property dependent on same key\n does not call the observer twice', function () { + var obj1 = Object.create(null); + + _emberMetalMeta.meta(obj1).proto = obj1; + + _emberMetalProperties.defineProperty(obj1, 'foo', null, null); + _emberMetalProperties.defineProperty(obj1, 'bar', _emberMetalAlias.default('foo')); + _emberMetalProperties.defineProperty(obj1, 'baz', _emberMetalAlias.default('foo')); + _emberMetalObserver.addObserver(obj1, 'baz', incrementCount); + + var obj2 = Object.create(obj1); + _emberMetalProperties.defineProperty(obj2, 'baz', _emberMetalAlias.default('bar')); // override baz + + _emberMetalProperty_set.set(obj2, 'foo', 'FOO'); + equal(count, 1); + + _emberMetalObserver.removeObserver(obj2, 'baz', incrementCount); + + _emberMetalProperty_set.set(obj2, 'foo', 'OOF'); + equal(count, 1); + }); + + QUnit.test('an observer of the alias works if added after defining the alias', function () { + _emberMetalProperties.defineProperty(obj, 'bar', _emberMetalAlias.default('foo.faz')); + _emberMetalObserver.addObserver(obj, 'bar', incrementCount); + ok(_emberMetalWatching.isWatching(obj, 'foo.faz')); + _emberMetalProperty_set.set(obj, 'foo.faz', 'BAR'); + equal(count, 1); + }); + + QUnit.test('an observer of the alias works if added before defining the alias', function () { + _emberMetalObserver.addObserver(obj, 'bar', incrementCount); + _emberMetalProperties.defineProperty(obj, 'bar', _emberMetalAlias.default('foo.faz')); + ok(_emberMetalWatching.isWatching(obj, 'foo.faz')); + _emberMetalProperty_set.set(obj, 'foo.faz', 'BAR'); + equal(count, 1); + }); + + QUnit.test('object with alias is dirtied if interior object of alias is set after consumption', function () { + _emberMetalProperties.defineProperty(obj, 'bar', _emberMetalAlias.default('foo.faz')); + _emberMetalProperty_get.get(obj, 'bar'); + assertDirty(obj, function () { + return _emberMetalProperty_set.set(obj, 'foo.faz', 'BAR'); + }, 'setting the aliased key should dirty the object'); + }); + + QUnit.test('setting alias on self should fail assertion', function () { + expectAssertion(function () { + return _emberMetalProperties.defineProperty(obj, 'bar', _emberMetalAlias.default('bar')); + }, 'Setting alias \'bar\' on self'); + }); + + function assertDirty(obj, callback, label) { + var tag = _emberMetalTags.tagFor(obj); + var tagValue = tag.value(); + callback(); + ok(!tag.validate(tagValue), label); + } +}); +enifed('ember-metal/tests/alias_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/alias_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/alias_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/alias_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/alias_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/alias_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/binding/connect_test', ['exports', 'ember-environment', 'internal-test-helpers', 'ember-metal/binding', 'ember-metal/run_loop', 'ember-metal/property_set', 'ember-metal/property_get'], function (exports, _emberEnvironment, _internalTestHelpers, _emberMetalBinding, _emberMetalRun_loop, _emberMetalProperty_set, _emberMetalProperty_get) { + 'use strict'; + + function performTest(binding, a, b, get, set, connect) { + if (connect === undefined) { + connect = function () { + return binding.connect(a); + }; + } + + ok(!_emberMetalRun_loop.default.currentRunLoop, 'performTest should not have a currentRunLoop'); + + equal(get(a, 'foo'), 'FOO', 'a should not have changed'); + equal(get(b, 'bar'), 'BAR', 'b should not have changed'); + + connect(); + + equal(get(a, 'foo'), 'BAR', 'a should have changed'); + equal(get(b, 'bar'), 'BAR', 'b should have changed'); + // + // make sure changes sync both ways + _emberMetalRun_loop.default(function () { + return set(b, 'bar', 'BAZZ'); + }); + equal(get(a, 'foo'), 'BAZZ', 'a should have changed'); + + _emberMetalRun_loop.default(function () { + return set(a, 'foo', 'BARF'); + }); + equal(get(b, 'bar'), 'BARF', 'a should have changed'); + } + + var originalLookup = undefined, + lookup = undefined, + GlobalB = undefined; + + QUnit.module('Ember.Binding', { + setup: function () { + originalLookup = _emberEnvironment.context.lookup; + _emberEnvironment.context.lookup = lookup = {}; + }, + teardown: function () { + lookup = null; + _emberEnvironment.context.lookup = originalLookup; + } + }); + + _internalTestHelpers.testBoth('Connecting a binding between two properties', function (get, set) { + var a = { foo: 'FOO', bar: 'BAR' }; + + // a.bar -> a.foo + var binding = new _emberMetalBinding.Binding('foo', 'bar'); + + expectDeprecation(function () { + performTest(binding, a, a, get, set); + }, /`Ember\.Binding` is deprecated./); + }); + + _internalTestHelpers.testBoth('Connecting a oneWay binding raises a deprecation', function (get, set) { + var a = { foo: 'FOO', bar: 'BAR', toString: function () { + return ''; + } }; + + // a.bar -> a.foo + var binding = new _emberMetalBinding.Binding('foo', 'bar').oneWay(); + + expectDeprecation(function () { + binding.connect(a); + }, /`Ember.Binding` is deprecated/); + }); + + _internalTestHelpers.testBoth('Connecting a binding between two objects', function (get, set) { + var b = { bar: 'BAR' }; + var a = { foo: 'FOO', b: b }; + + // b.bar -> a.foo + var binding = new _emberMetalBinding.Binding('foo', 'b.bar'); + + expectDeprecation(function () { + performTest(binding, a, b, get, set); + }, /`Ember\.Binding` is deprecated./); + }); + + _internalTestHelpers.testBoth('Connecting a binding to path', function (get, set) { + var a = { foo: 'FOO' }; + lookup['GlobalB'] = GlobalB = { + b: { bar: 'BAR' } + }; + + var b = get(GlobalB, 'b'); + + // globalB.b.bar -> a.foo + var binding = new _emberMetalBinding.Binding('foo', 'GlobalB.b.bar'); + + expectDeprecation(function () { + performTest(binding, a, b, get, set); + }, /`Ember\.Binding` is deprecated./); + + // make sure modifications update + b = { bar: 'BIFF' }; + + _emberMetalRun_loop.default(function () { + return set(GlobalB, 'b', b); + }); + + equal(get(a, 'foo'), 'BIFF', 'a should have changed'); + }); + + _internalTestHelpers.testBoth('Calling connect more than once', function (get, set) { + var b = { bar: 'BAR' }; + var a = { foo: 'FOO', b: b }; + + // b.bar -> a.foo + var binding = new _emberMetalBinding.Binding('foo', 'b.bar'); + + expectDeprecation(function () { + performTest(binding, a, b, get, set, function () { + binding.connect(a); + binding.connect(a); + }); + }, /`Ember\.Binding` is deprecated./); + }); + + QUnit.test('inherited bindings should sync on create', function () { + var a = undefined; + _emberMetalRun_loop.default(function () { + function A() { + _emberMetalBinding.bind(this, 'foo', 'bar.baz'); + } + + expectDeprecation(function () { + return a = new A(); + }, /`Ember\.Binding` is deprecated/); + + _emberMetalProperty_set.set(a, 'bar', { baz: 'BAZ' }); + }); + + equal(_emberMetalProperty_get.get(a, 'foo'), 'BAZ', 'should have synced binding on new obj'); + }); +}); +enifed('ember-metal/tests/binding/connect_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/binding'); + test('ember-metal/tests/binding/connect_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/binding/connect_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/binding/connect_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/binding'); + QUnit.test('ember-metal/tests/binding/connect_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/binding/connect_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/binding/sync_test', ['exports', 'internal-test-helpers', 'ember-metal/run_loop', 'ember-metal/observer', 'ember-metal/binding', 'ember-metal/computed', 'ember-metal/properties', 'ember-metal/property_events'], function (exports, _internalTestHelpers, _emberMetalRun_loop, _emberMetalObserver, _emberMetalBinding, _emberMetalComputed, _emberMetalProperties, _emberMetalProperty_events) { + 'use strict'; + + QUnit.module('system/binding/sync_test.js'); + + _internalTestHelpers.testBoth('bindings should not sync twice in a single run loop', function (get, set) { + var a = undefined, + b = undefined, + setValue = undefined; + var setCalled = 0; + var getCalled = 0; + + _emberMetalRun_loop.default(function () { + a = {}; + + _emberMetalProperties.defineProperty(a, 'foo', _emberMetalComputed.computed({ + get: function (key) { + getCalled++; + return setValue; + }, + set: function (key, value) { + setCalled++; + _emberMetalProperty_events.propertyWillChange(this, key); + setValue = value; + _emberMetalProperty_events.propertyDidChange(this, key); + return value; + } + }).volatile()); + + b = { + a: a + }; + + expectDeprecation(function () { + return _emberMetalBinding.bind(b, 'foo', 'a.foo'); + }, /`Ember.Binding` is deprecated/); + }); + + // reset after initial binding synchronization + getCalled = 0; + + _emberMetalRun_loop.default(function () { + set(a, 'foo', 'trollface'); + }); + + equal(get(b, 'foo'), 'trollface', 'the binding should sync'); + equal(setCalled, 1, 'Set should only be called once'); + equal(getCalled, 1, 'Get should only be called once'); + }); + + _internalTestHelpers.testBoth('bindings should not infinite loop if computed properties return objects', function (get, set) { + var a = undefined, + b = undefined; + var getCalled = 0; + + _emberMetalRun_loop.default(function () { + a = {}; + + _emberMetalProperties.defineProperty(a, 'foo', _emberMetalComputed.computed(function () { + getCalled++; + if (getCalled > 1000) { + throw 'infinite loop detected'; + } + return ['foo', 'bar']; + })); + + b = { + a: a + }; + + expectDeprecation(function () { + return _emberMetalBinding.bind(b, 'foo', 'a.foo'); + }, /`Ember.Binding` is deprecated/); + }); + + deepEqual(get(b, 'foo'), ['foo', 'bar'], 'the binding should sync'); + equal(getCalled, 1, 'Get should only be called once'); + }); + + _internalTestHelpers.testBoth('bindings should do the right thing when observers trigger bindings in the opposite direction', function (get, set) { + var a = undefined, + b = undefined, + c = undefined; + + _emberMetalRun_loop.default(function () { + a = { + foo: 'trololol' + }; + + b = { + a: a + }; + + var deprecationMessage = /`Ember.Binding` is deprecated/; + + expectDeprecation(function () { + return _emberMetalBinding.bind(b, 'foo', 'a.foo'); + }, deprecationMessage); + + c = { + a: a + }; + + expectDeprecation(function () { + _emberMetalBinding.bind(c, 'foo', 'a.foo'); + }, deprecationMessage); + }); + + _emberMetalObserver.addObserver(b, 'foo', function () { + return set(c, 'foo', 'what is going on'); + }); + + _emberMetalRun_loop.default(function () { + return set(a, 'foo', 'trollface'); + }); + + equal(get(a, 'foo'), 'what is going on'); + }); + + _internalTestHelpers.testBoth('bindings should not try to sync destroyed objects', function (get, set) { + var a = undefined, + b = undefined; + + _emberMetalRun_loop.default(function () { + a = { + foo: 'trololol' + }; + + b = { + a: a + }; + + var deprecationMessage = /`Ember.Binding` is deprecated/; + + expectDeprecation(function () { + return _emberMetalBinding.bind(b, 'foo', 'a.foo'); + }, deprecationMessage); + }); + + _emberMetalRun_loop.default(function () { + set(a, 'foo', 'trollface'); + set(b, 'isDestroyed', true); + ok(true, 'should not raise'); + }); + + _emberMetalRun_loop.default(function () { + a = { + foo: 'trololol' + }; + + b = { + a: a + }; + + var deprecationMessage = /`Ember.Binding` is deprecated/; + + expectDeprecation(function () { + return _emberMetalBinding.bind(b, 'foo', 'a.foo'); + }, deprecationMessage); + }); + + _emberMetalRun_loop.default(function () { + set(b, 'foo', 'trollface'); + set(a, 'isDestroyed', true); + ok(true, 'should not raise'); + }); + }); +}); +enifed('ember-metal/tests/binding/sync_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/binding'); + test('ember-metal/tests/binding/sync_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/binding/sync_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/binding/sync_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/binding'); + QUnit.test('ember-metal/tests/binding/sync_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/binding/sync_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/cache_test', ['exports', 'ember-metal/cache'], function (exports, _emberMetalCache) { + 'use strict'; + + QUnit.module('Cache'); + + QUnit.test('basic', function () { + var cache = new _emberMetalCache.default(100, function (key) { + return key.toUpperCase(); + }); + + equal(cache.get('foo'), 'FOO'); + equal(cache.get('bar'), 'BAR'); + equal(cache.get('foo'), 'FOO'); + }); + + QUnit.test('explicit sets', function () { + var cache = new _emberMetalCache.default(100, function (key) { + return key.toUpperCase(); + }); + + equal(cache.get('foo'), 'FOO'); + + equal(cache.set('foo', 'FOO!!!'), 'FOO!!!'); + + equal(cache.get('foo'), 'FOO!!!'); + + strictEqual(cache.set('foo', undefined), undefined); + + strictEqual(cache.get('foo'), undefined); + }); + + QUnit.test('caches computation correctly', function () { + var count = 0; + var cache = new _emberMetalCache.default(100, function (key) { + count++; + return key.toUpperCase(); + }); + + equal(count, 0); + cache.get('foo'); + equal(count, 1); + cache.get('bar'); + equal(count, 2); + cache.get('bar'); + equal(count, 2); + cache.get('foo'); + equal(count, 2); + }); + + QUnit.test('caches computation correctly with custom cache keys', function () { + var count = 0; + var cache = new _emberMetalCache.default(100, function (obj) { + count++; + return obj.value.toUpperCase(); + }, function (obj) { + return obj.key; + }); + + equal(count, 0); + cache.get({ key: 'foo', value: 'foo' }); + equal(count, 1); + cache.get({ key: 'bar', value: 'bar' }); + equal(count, 2); + cache.get({ key: 'bar', value: 'bar' }); + equal(count, 2); + cache.get({ key: 'foo', value: 'foo' }); + equal(count, 2); + }); + + QUnit.test('handles undefined value correctly', function () { + var count = 0; + var cache = new _emberMetalCache.default(100, function (key) { + count++; + }); + + equal(count, 0); + strictEqual(cache.get('foo'), undefined); + equal(count, 1); + strictEqual(cache.get('bar'), undefined); + equal(count, 2); + strictEqual(cache.get('bar'), undefined); + equal(count, 2); + strictEqual(cache.get('foo'), undefined); + equal(count, 2); + }); + + QUnit.test('continues working after reaching cache limit', function () { + var cache = new _emberMetalCache.default(3, function (key) { + return key.toUpperCase(); + }); + + cache.get('a'); + cache.get('b'); + cache.get('c'); + + equal(cache.get('d'), 'D'); + equal(cache.get('a'), 'A'); + equal(cache.get('b'), 'B'); + equal(cache.get('c'), 'C'); + }); +}); +enifed('ember-metal/tests/cache_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/cache_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/cache_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/cache_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/cache_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/cache_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/chains_test', ['exports', 'ember-metal/observer', 'ember-metal/property_get', 'ember-metal/chains', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/property_events', 'ember-metal/meta'], function (exports, _emberMetalObserver, _emberMetalProperty_get, _emberMetalChains, _emberMetalProperties, _emberMetalComputed, _emberMetalProperty_events, _emberMetalMeta) { + 'use strict'; + + QUnit.module('Chains'); + + QUnit.test('finishChains should properly copy chains from prototypes to instances', function () { + function didChange() {} + + var obj = {}; + _emberMetalObserver.addObserver(obj, 'foo.bar', null, didChange); + + var childObj = Object.create(obj); + _emberMetalChains.finishChains(childObj); + ok(_emberMetalMeta.peekMeta(obj) !== _emberMetalMeta.peekMeta(childObj).readableChains(), 'The chains object is copied'); + }); + + QUnit.test('does not observe primative values', function (assert) { + var obj = { + foo: { bar: 'STRING' } + }; + + _emberMetalObserver.addObserver(obj, 'foo.bar.baz', null, function () {}); + var meta = _emberMetalMeta.peekMeta(obj); + assert.notOk(meta._object); + }); + + QUnit.test('observer and CP chains', function () { + var obj = {}; + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.default('qux.[]', function () {})); + _emberMetalProperties.defineProperty(obj, 'qux', _emberMetalComputed.default(function () {})); + + // create DK chains + _emberMetalProperty_get.get(obj, 'foo'); + + // create observer chain + _emberMetalObserver.addObserver(obj, 'qux.length', function () {}); + + /* + +-----+ + | qux | root CP + +-----+ + ^ + +------+-----+ + | | + +--------+ +----+ + | length | | [] | chainWatchers + +--------+ +----+ + observer CP(foo, 'qux.[]') + */ + + // invalidate qux + _emberMetalProperty_events.propertyDidChange(obj, 'qux'); + + // CP chain is blown away + + /* + +-----+ + | qux | root CP + +-----+ + ^ + +------+xxxxxx + | x + +--------+ xxxxxx + | length | x [] x chainWatchers + +--------+ xxxxxx + observer CP(foo, 'qux.[]') + */ + + _emberMetalProperty_get.get(obj, 'qux'); // CP chain re-recreated + ok(true, 'no crash'); + }); +}); +enifed('ember-metal/tests/chains_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/chains_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/chains_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/chains_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/chains_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/chains_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/computed_test', ['exports', 'ember-runtime', 'internal-test-helpers', 'ember-metal/computed', 'ember-metal/properties', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/watching', 'ember-metal/observer'], function (exports, _emberRuntime, _internalTestHelpers, _emberMetalComputed, _emberMetalProperties, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalWatching, _emberMetalObserver) { + 'use strict'; + + var obj = undefined, + count = undefined; + + QUnit.module('computed'); + + QUnit.test('computed property should be an instance of descriptor', function () { + ok(_emberMetalComputed.computed(function () {}) instanceof _emberMetalProperties.Descriptor); + }); + + QUnit.test('computed properties assert the presence of a getter or setter function', function () { + expectAssertion(function () { + _emberMetalComputed.computed('nogetternorsetter', {}); + }, 'Computed properties must receive a getter or a setter, you passed none.'); + }); + + QUnit.test('computed properties check for the presence of a function or configuration object', function () { + expectAssertion(function () { + _emberMetalComputed.computed('nolastargument'); + }, 'Ember.computed expects a function or an object as last argument.'); + }); + + QUnit.test('computed properties defined with an object only allow `get` and `set` keys', function () { + expectAssertion(function () { + _emberMetalComputed.computed({ + get: function () {}, + set: function () {}, + other: function () {} + }); + }, 'Config object passed to an Ember.computed can only contain `get` or `set` keys.'); + }); + + QUnit.test('defining computed property should invoke property on get', function () { + var obj = {}; + var count = 0; + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed(function (key) { + count++; + return 'computed ' + key; + })); + + equal(_emberMetalProperty_get.get(obj, 'foo'), 'computed foo', 'should return value'); + equal(count, 1, 'should have invoked computed property'); + }); + + QUnit.test('defining computed property should invoke property on set', function () { + var obj = {}; + var count = 0; + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed({ + get: function (key) { + return this['__' + key]; + }, + set: function (key, value) { + count++; + this['__' + key] = 'computed ' + value; + return this['__' + key]; + } + })); + + equal(_emberMetalProperty_set.set(obj, 'foo', 'bar'), 'bar', 'should return set value'); + equal(count, 1, 'should have invoked computed property'); + equal(_emberMetalProperty_get.get(obj, 'foo'), 'computed bar', 'should return new value'); + }); + + QUnit.test('defining a computed property with a dependent key ending with @each is expanded to []', function () { + var cp = _emberMetalComputed.computed('blazo.@each', function () {}); + + deepEqual(cp._dependentKeys, ['blazo.[]']); + + cp = _emberMetalComputed.computed('qux', 'zoopa.@each', function () {}); + + deepEqual(cp._dependentKeys, ['qux', 'zoopa.[]']); + }); + + QUnit.test('defining a computed property with a dependent key more than one level deep beyond @each is not supported', function () { + expectNoWarning(function () { + _emberMetalComputed.computed('todos', function () {}); + }); + + expectNoWarning(function () { + _emberMetalComputed.computed('todos.@each.owner', function () {}); + }); + + expectWarning(function () { + _emberMetalComputed.computed('todos.@each.owner.name', function () {}); + }, /You used the key "todos\.@each\.owner\.name" which is invalid\. /); + + expectWarning(function () { + _emberMetalComputed.computed('todos.@each.owner.@each.name', function () {}); + }, /You used the key "todos\.@each\.owner\.@each\.name" which is invalid\. /); + }); + + var objA = undefined, + objB = undefined; + QUnit.module('computed should inherit through prototype', { + setup: function () { + objA = { __foo: 'FOO' }; + _emberMetalProperties.defineProperty(objA, 'foo', _emberMetalComputed.computed({ + get: function (key) { + return this['__' + key]; + }, + set: function (key, value) { + this['__' + key] = 'computed ' + value; + return this['__' + key]; + } + })); + + objB = Object.create(objA); + objB.__foo = 'FOO'; // make a copy; + }, + + teardown: function () { + objA = objB = null; + } + }); + + _internalTestHelpers.testBoth('using get() and set()', function (get, set) { + equal(get(objA, 'foo'), 'FOO', 'should get FOO from A'); + equal(get(objB, 'foo'), 'FOO', 'should get FOO from B'); + + set(objA, 'foo', 'BIFF'); + equal(get(objA, 'foo'), 'computed BIFF', 'should change A'); + equal(get(objB, 'foo'), 'FOO', 'should NOT change B'); + + set(objB, 'foo', 'bar'); + equal(get(objB, 'foo'), 'computed bar', 'should change B'); + equal(get(objA, 'foo'), 'computed BIFF', 'should NOT change A'); + + set(objA, 'foo', 'BAZ'); + equal(get(objA, 'foo'), 'computed BAZ', 'should change A'); + equal(get(objB, 'foo'), 'computed bar', 'should NOT change B'); + }); + + QUnit.module('redefining computed property to normal', { + setup: function () { + objA = { __foo: 'FOO' }; + _emberMetalProperties.defineProperty(objA, 'foo', _emberMetalComputed.computed({ + get: function (key) { + return this['__' + key]; + }, + set: function (key, value) { + this['__' + key] = 'computed ' + value; + return this['__' + key]; + } + })); + + objB = Object.create(objA); + _emberMetalProperties.defineProperty(objB, 'foo'); // make this just a normal property. + }, + + teardown: function () { + objA = objB = null; + } + }); + + _internalTestHelpers.testBoth('using get() and set()', function (get, set) { + equal(get(objA, 'foo'), 'FOO', 'should get FOO from A'); + equal(get(objB, 'foo'), undefined, 'should get undefined from B'); + + set(objA, 'foo', 'BIFF'); + equal(get(objA, 'foo'), 'computed BIFF', 'should change A'); + equal(get(objB, 'foo'), undefined, 'should NOT change B'); + + set(objB, 'foo', 'bar'); + equal(get(objB, 'foo'), 'bar', 'should change B'); + equal(get(objA, 'foo'), 'computed BIFF', 'should NOT change A'); + + set(objA, 'foo', 'BAZ'); + equal(get(objA, 'foo'), 'computed BAZ', 'should change A'); + equal(get(objB, 'foo'), 'bar', 'should NOT change B'); + }); + + QUnit.module('redefining computed property to another property', { + setup: function () { + objA = { __foo: 'FOO' }; + _emberMetalProperties.defineProperty(objA, 'foo', _emberMetalComputed.computed({ + get: function (key) { + return this['__' + key]; + }, + set: function (key, value) { + this['__' + key] = 'A ' + value; + return this['__' + key]; + } + })); + + objB = Object.create(objA); + objB.__foo = 'FOO'; + _emberMetalProperties.defineProperty(objB, 'foo', _emberMetalComputed.computed({ + get: function (key) { + return this['__' + key]; + }, + set: function (key, value) { + this['__' + key] = 'B ' + value; + return this['__' + key]; + } + })); + }, + + teardown: function () { + objA = objB = null; + } + }); + + _internalTestHelpers.testBoth('using get() and set()', function (get, set) { + equal(get(objA, 'foo'), 'FOO', 'should get FOO from A'); + equal(get(objB, 'foo'), 'FOO', 'should get FOO from B'); + + set(objA, 'foo', 'BIFF'); + equal(get(objA, 'foo'), 'A BIFF', 'should change A'); + equal(get(objB, 'foo'), 'FOO', 'should NOT change B'); + + set(objB, 'foo', 'bar'); + equal(get(objB, 'foo'), 'B bar', 'should change B'); + equal(get(objA, 'foo'), 'A BIFF', 'should NOT change A'); + + set(objA, 'foo', 'BAZ'); + equal(get(objA, 'foo'), 'A BAZ', 'should change A'); + equal(get(objB, 'foo'), 'B bar', 'should NOT change B'); + }); + + QUnit.module('computed - metadata'); + + QUnit.test('can set metadata on a computed property', function () { + var computedProperty = _emberMetalComputed.computed(function () {}); + computedProperty.meta({ key: 'keyValue' }); + + equal(computedProperty.meta().key, 'keyValue', 'saves passed meta hash to the _meta property'); + }); + + QUnit.test('meta should return an empty hash if no meta is set', function () { + var computedProperty = _emberMetalComputed.computed(function () {}); + deepEqual(computedProperty.meta(), {}, 'returned value is an empty hash'); + }); + + // .......................................................... + // CACHEABLE + // + + QUnit.module('computed - cacheable', { + setup: function () { + obj = {}; + count = 0; + var func = function (key, value) { + count++; + return 'bar ' + count; + }; + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed({ get: func, set: func })); + }, + + teardown: function () { + obj = count = null; + } + }); + + _internalTestHelpers.testBoth('cacheable should cache', function (get, set) { + equal(get(obj, 'foo'), 'bar 1', 'first get'); + equal(get(obj, 'foo'), 'bar 1', 'second get'); + equal(count, 1, 'should only invoke once'); + }); + + _internalTestHelpers.testBoth('modifying a cacheable property should update cache', function (get, set) { + equal(get(obj, 'foo'), 'bar 1', 'first get'); + equal(get(obj, 'foo'), 'bar 1', 'second get'); + + equal(set(obj, 'foo', 'baz'), 'baz', 'setting'); + equal(get(obj, 'foo'), 'bar 2', 'third get'); + equal(count, 2, 'should not invoke again'); + }); + + _internalTestHelpers.testBoth('inherited property should not pick up cache', function (get, set) { + var objB = Object.create(obj); + + equal(get(obj, 'foo'), 'bar 1', 'obj first get'); + equal(get(objB, 'foo'), 'bar 2', 'objB first get'); + + equal(get(obj, 'foo'), 'bar 1', 'obj second get'); + equal(get(objB, 'foo'), 'bar 2', 'objB second get'); + + set(obj, 'foo', 'baz'); // modify A + equal(get(obj, 'foo'), 'bar 3', 'obj third get'); + equal(get(objB, 'foo'), 'bar 2', 'objB third get'); + }); + + _internalTestHelpers.testBoth('cacheFor should return the cached value', function (get, set) { + equal(_emberMetalComputed.cacheFor(obj, 'foo'), undefined, 'should not yet be a cached value'); + + get(obj, 'foo'); + + equal(_emberMetalComputed.cacheFor(obj, 'foo'), 'bar 1', 'should retrieve cached value'); + }); + + _internalTestHelpers.testBoth('cacheFor should return falsy cached values', function (get, set) { + _emberMetalProperties.defineProperty(obj, 'falsy', _emberMetalComputed.computed(function () { + return false; + })); + + equal(_emberMetalComputed.cacheFor(obj, 'falsy'), undefined, 'should not yet be a cached value'); + + get(obj, 'falsy'); + + equal(_emberMetalComputed.cacheFor(obj, 'falsy'), false, 'should retrieve cached value'); + }); + + _internalTestHelpers.testBoth('setting a cached computed property passes the old value as the third argument', function (get, set) { + var obj = { + foo: 0 + }; + + var receivedOldValue = undefined; + + _emberMetalProperties.defineProperty(obj, 'plusOne', _emberMetalComputed.computed({ + get: function () {}, + set: function (key, value, oldValue) { + receivedOldValue = oldValue; + return value; + } }).property('foo')); + + set(obj, 'plusOne', 1); + strictEqual(receivedOldValue, undefined, 'oldValue should be undefined'); + + set(obj, 'plusOne', 2); + strictEqual(receivedOldValue, 1, 'oldValue should be 1'); + + set(obj, 'plusOne', 3); + strictEqual(receivedOldValue, 2, 'oldValue should be 2'); + }); + + // .......................................................... + // DEPENDENT KEYS + // + + QUnit.module('computed - dependentkey', { + setup: function () { + obj = { bar: 'baz' }; + count = 0; + var getterAndSetter = function (key, value) { + count++; + _emberMetalProperty_get.get(this, 'bar'); + return 'bar ' + count; + }; + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed({ + get: getterAndSetter, + set: getterAndSetter + }).property('bar')); + }, + + teardown: function () { + obj = count = null; + } + }); + + _internalTestHelpers.testBoth('should lazily watch dependent keys on set', function (get, set) { + equal(_emberMetalWatching.isWatching(obj, 'bar'), false, 'precond not watching dependent key'); + set(obj, 'foo', 'bar'); + equal(_emberMetalWatching.isWatching(obj, 'bar'), true, 'lazily watching dependent key'); + }); + + _internalTestHelpers.testBoth('should lazily watch dependent keys on get', function (get, set) { + equal(_emberMetalWatching.isWatching(obj, 'bar'), false, 'precond not watching dependent key'); + get(obj, 'foo'); + equal(_emberMetalWatching.isWatching(obj, 'bar'), true, 'lazily watching dependent key'); + }); + + _internalTestHelpers.testBoth('local dependent key should invalidate cache', function (get, set) { + equal(_emberMetalWatching.isWatching(obj, 'bar'), false, 'precond not watching dependent key'); + equal(get(obj, 'foo'), 'bar 1', 'get once'); + equal(_emberMetalWatching.isWatching(obj, 'bar'), true, 'lazily setup watching dependent key'); + equal(get(obj, 'foo'), 'bar 1', 'cached retrieve'); + + set(obj, 'bar', 'BIFF'); // should invalidate foo + + equal(get(obj, 'foo'), 'bar 2', 'should recache'); + equal(get(obj, 'foo'), 'bar 2', 'cached retrieve'); + }); + + _internalTestHelpers.testBoth('should invalidate multiple nested dependent keys', function (get, set) { + var count = 0; + _emberMetalProperties.defineProperty(obj, 'bar', _emberMetalComputed.computed(function () { + count++; + get(this, 'baz'); + return 'baz ' + count; + }).property('baz')); + + equal(_emberMetalWatching.isWatching(obj, 'bar'), false, 'precond not watching dependent key'); + equal(_emberMetalWatching.isWatching(obj, 'baz'), false, 'precond not watching dependent key'); + equal(get(obj, 'foo'), 'bar 1', 'get once'); + equal(_emberMetalWatching.isWatching(obj, 'bar'), true, 'lazily setup watching dependent key'); + equal(_emberMetalWatching.isWatching(obj, 'baz'), true, 'lazily setup watching dependent key'); + equal(get(obj, 'foo'), 'bar 1', 'cached retrieve'); + + set(obj, 'baz', 'BIFF'); // should invalidate bar -> foo + equal(_emberMetalWatching.isWatching(obj, 'bar'), false, 'should not be watching dependent key after cache cleared'); + equal(_emberMetalWatching.isWatching(obj, 'baz'), false, 'should not be watching dependent key after cache cleared'); + + equal(get(obj, 'foo'), 'bar 2', 'should recache'); + equal(get(obj, 'foo'), 'bar 2', 'cached retrieve'); + equal(_emberMetalWatching.isWatching(obj, 'bar'), true, 'lazily setup watching dependent key'); + equal(_emberMetalWatching.isWatching(obj, 'baz'), true, 'lazily setup watching dependent key'); + }); + + _internalTestHelpers.testBoth('circular keys should not blow up', function (get, set) { + var func = function (key, value) { + count++; + return 'bar ' + count; + }; + _emberMetalProperties.defineProperty(obj, 'bar', _emberMetalComputed.computed({ get: func, set: func }).property('foo')); + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed(function (key) { + count++; + return 'foo ' + count; + }).property('bar')); + + equal(get(obj, 'foo'), 'foo 1', 'get once'); + equal(get(obj, 'foo'), 'foo 1', 'cached retrieve'); + + set(obj, 'bar', 'BIFF'); // should invalidate bar -> foo -> bar + + equal(get(obj, 'foo'), 'foo 3', 'should recache'); + equal(get(obj, 'foo'), 'foo 3', 'cached retrieve'); + }); + + _internalTestHelpers.testBoth('redefining a property should undo old dependent keys', function (get, set) { + equal(_emberMetalWatching.isWatching(obj, 'bar'), false, 'precond not watching dependent key'); + equal(get(obj, 'foo'), 'bar 1'); + equal(_emberMetalWatching.isWatching(obj, 'bar'), true, 'lazily watching dependent key'); + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed(function () { + count++; + return 'baz ' + count; + }).property('baz')); + + equal(_emberMetalWatching.isWatching(obj, 'bar'), false, 'after redefining should not be watching dependent key'); + + equal(get(obj, 'foo'), 'baz 2'); + + set(obj, 'bar', 'BIFF'); // should not kill cache + equal(get(obj, 'foo'), 'baz 2'); + + set(obj, 'baz', 'BOP'); + equal(get(obj, 'foo'), 'baz 3'); + }); + + _internalTestHelpers.testBoth('can watch multiple dependent keys specified declaratively via brace expansion', function (get, set) { + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed(function (key) { + count++; + return 'foo ' + count; + }).property('qux.{bar,baz}')); + + equal(get(obj, 'foo'), 'foo 1', 'get once'); + equal(get(obj, 'foo'), 'foo 1', 'cached retrieve'); + + set(obj, 'qux', {}); + set(obj, 'qux.bar', 'bar'); // invalidate foo + + equal(get(obj, 'foo'), 'foo 2', 'foo invalidated from bar'); + + set(obj, 'qux.baz', 'baz'); // invalidate foo + + equal(get(obj, 'foo'), 'foo 3', 'foo invalidated from baz'); + + set(obj, 'qux.quux', 'quux'); // do not invalidate foo + + equal(get(obj, 'foo'), 'foo 3', 'foo not invalidated by quux'); + }); + + _internalTestHelpers.testBoth('throws assertion if brace expansion notation has spaces', function (get, set) { + expectAssertion(function () { + _emberMetalProperties.defineProperty(obj, 'roo', _emberMetalComputed.computed(function (key) { + count++; + return 'roo ' + count; + }).property('fee.{bar, baz,bop , }')); + }, /cannot contain spaces/); + }); + + // .......................................................... + // CHAINED DEPENDENT KEYS + // + + var func = undefined; + var moduleOpts = { + setup: function () { + obj = { + foo: { + bar: { + baz: { + biff: 'BIFF' + } + } + } + }; + + count = 0; + func = function () { + count++; + return _emberMetalProperty_get.get(obj, 'foo.bar.baz.biff') + ' ' + count; + }; + }, + + teardown: function () { + obj = count = func = null; + } + }; + + QUnit.module('computed - dependentkey with chained properties', moduleOpts); + + _internalTestHelpers.testBoth('depending on simple chain', function (get, set) { + // assign computed property + _emberMetalProperties.defineProperty(obj, 'prop', _emberMetalComputed.computed(func).property('foo.bar.baz.biff')); + + equal(get(obj, 'prop'), 'BIFF 1'); + + set(get(obj, 'foo.bar.baz'), 'biff', 'BUZZ'); + equal(get(obj, 'prop'), 'BUZZ 2'); + equal(get(obj, 'prop'), 'BUZZ 2'); + + set(get(obj, 'foo.bar'), 'baz', { biff: 'BLOB' }); + equal(get(obj, 'prop'), 'BLOB 3'); + equal(get(obj, 'prop'), 'BLOB 3'); + + set(get(obj, 'foo.bar.baz'), 'biff', 'BUZZ'); + equal(get(obj, 'prop'), 'BUZZ 4'); + equal(get(obj, 'prop'), 'BUZZ 4'); + + set(get(obj, 'foo'), 'bar', { baz: { biff: 'BOOM' } }); + equal(get(obj, 'prop'), 'BOOM 5'); + equal(get(obj, 'prop'), 'BOOM 5'); + + set(get(obj, 'foo.bar.baz'), 'biff', 'BUZZ'); + equal(get(obj, 'prop'), 'BUZZ 6'); + equal(get(obj, 'prop'), 'BUZZ 6'); + + set(obj, 'foo', { bar: { baz: { biff: 'BLARG' } } }); + equal(get(obj, 'prop'), 'BLARG 7'); + equal(get(obj, 'prop'), 'BLARG 7'); + + set(get(obj, 'foo.bar.baz'), 'biff', 'BUZZ'); + equal(get(obj, 'prop'), 'BUZZ 8'); + equal(get(obj, 'prop'), 'BUZZ 8'); + + _emberMetalProperties.defineProperty(obj, 'prop'); + set(obj, 'prop', 'NONE'); + equal(get(obj, 'prop'), 'NONE'); + + set(obj, 'foo', { bar: { baz: { biff: 'BLARG' } } }); + equal(get(obj, 'prop'), 'NONE'); // should do nothing + equal(count, 8, 'should be not have invoked computed again'); + }); + + _internalTestHelpers.testBoth('chained dependent keys should evaluate computed properties lazily', function (get, set) { + _emberMetalProperties.defineProperty(obj.foo.bar, 'b', _emberMetalComputed.computed(func)); + _emberMetalProperties.defineProperty(obj.foo, 'c', _emberMetalComputed.computed(function () {}).property('bar.b')); + equal(count, 0, 'b should not run'); + }); + + // .......................................................... + // improved-cp-syntax + // + + QUnit.module('computed - improved cp syntax'); + + QUnit.test('setter and getters are passed using an object', function () { + var testObj = _emberRuntime.Object.extend({ + a: '1', + b: '2', + aInt: _emberMetalComputed.computed('a', { + get: function (keyName) { + equal(keyName, 'aInt', 'getter receives the keyName'); + return parseInt(this.get('a')); + }, + set: function (keyName, value, oldValue) { + equal(keyName, 'aInt', 'setter receives the keyName'); + equal(value, 123, 'setter receives the new value'); + equal(oldValue, 1, 'setter receives the old value'); + this.set('a', '' + value); // side effect + return parseInt(this.get('a')); + } + }) + }).create(); + + ok(testObj.get('aInt') === 1, 'getter works'); + testObj.set('aInt', 123); + ok(testObj.get('a') === '123', 'setter works'); + ok(testObj.get('aInt') === 123, 'cp has been updated too'); + }); + + QUnit.test('setter can be omited', function () { + var testObj = _emberRuntime.Object.extend({ + a: '1', + b: '2', + aInt: _emberMetalComputed.computed('a', { + get: function (keyName) { + equal(keyName, 'aInt', 'getter receives the keyName'); + return parseInt(this.get('a')); + } + }) + }).create(); + + ok(testObj.get('aInt') === 1, 'getter works'); + ok(testObj.get('a') === '1'); + testObj.set('aInt', '123'); + ok(testObj.get('aInt') === '123', 'cp has been updated too'); + }); + + QUnit.test('the return value of the setter gets cached', function () { + var testObj = _emberRuntime.Object.extend({ + a: '1', + sampleCP: _emberMetalComputed.computed('a', { + get: function (keyName) { + ok(false, 'The getter should not be invoked'); + return 'get-value'; + }, + set: function (keyName, value, oldValue) { + return 'set-value'; + } + }) + }).create(); + + testObj.set('sampleCP', 'abcd'); + ok(testObj.get('sampleCP') === 'set-value', 'The return value of the CP was cached'); + }); + + // .......................................................... + // BUGS + // + + QUnit.module('computed edge cases'); + + QUnit.test('adding a computed property should show up in key iteration', function () { + var obj = {}; + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed(function () {})); + + var found = []; + for (var key in obj) { + found.push(key); + } + ok(found.indexOf('foo') >= 0, 'should find computed property in iteration found=' + found); + ok('foo' in obj, 'foo in obj should pass'); + }); + + _internalTestHelpers.testBoth('when setting a value after it had been retrieved empty don\'t pass function UNDEFINED as oldValue', function (get, set) { + var obj = {}; + var oldValueIsNoFunction = true; + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed({ + get: function () {}, + set: function (key, value, oldValue) { + if (typeof oldValue === 'function') { + oldValueIsNoFunction = false; + } + return undefined; + } + })); + + get(obj, 'foo'); + set(obj, 'foo', undefined); + + ok(oldValueIsNoFunction); + }); + + QUnit.module('computed - setter'); + + _internalTestHelpers.testBoth('setting a watched computed property', function (get, set) { + var obj = { + firstName: 'Yehuda', + lastName: 'Katz' + }; + _emberMetalProperties.defineProperty(obj, 'fullName', _emberMetalComputed.computed({ + get: function () { + return get(this, 'firstName') + ' ' + get(this, 'lastName'); + }, + set: function (key, value) { + var values = value.split(' '); + set(this, 'firstName', values[0]); + set(this, 'lastName', values[1]); + return value; + } + }).property('firstName', 'lastName')); + var fullNameWillChange = 0; + var fullNameDidChange = 0; + var firstNameWillChange = 0; + var firstNameDidChange = 0; + var lastNameWillChange = 0; + var lastNameDidChange = 0; + _emberMetalObserver._addBeforeObserver(obj, 'fullName', function () { + fullNameWillChange++; + }); + _emberMetalObserver.addObserver(obj, 'fullName', function () { + fullNameDidChange++; + }); + _emberMetalObserver._addBeforeObserver(obj, 'firstName', function () { + firstNameWillChange++; + }); + _emberMetalObserver.addObserver(obj, 'firstName', function () { + firstNameDidChange++; + }); + _emberMetalObserver._addBeforeObserver(obj, 'lastName', function () { + lastNameWillChange++; + }); + _emberMetalObserver.addObserver(obj, 'lastName', function () { + lastNameDidChange++; + }); + + equal(get(obj, 'fullName'), 'Yehuda Katz'); + + set(obj, 'fullName', 'Yehuda Katz'); + + set(obj, 'fullName', 'Kris Selden'); + + equal(get(obj, 'fullName'), 'Kris Selden'); + equal(get(obj, 'firstName'), 'Kris'); + equal(get(obj, 'lastName'), 'Selden'); + + equal(fullNameWillChange, 1); + equal(fullNameDidChange, 1); + equal(firstNameWillChange, 1); + equal(firstNameDidChange, 1); + equal(lastNameWillChange, 1); + equal(lastNameDidChange, 1); + }); + + _internalTestHelpers.testBoth('setting a cached computed property that modifies the value you give it', function (get, set) { + var obj = { + foo: 0 + }; + _emberMetalProperties.defineProperty(obj, 'plusOne', _emberMetalComputed.computed({ + get: function (key) { + return get(this, 'foo') + 1; + }, + set: function (key, value) { + set(this, 'foo', value); + return value + 1; + } + }).property('foo')); + var plusOneWillChange = 0; + var plusOneDidChange = 0; + _emberMetalObserver._addBeforeObserver(obj, 'plusOne', function () { + plusOneWillChange++; + }); + _emberMetalObserver.addObserver(obj, 'plusOne', function () { + plusOneDidChange++; + }); + + equal(get(obj, 'plusOne'), 1); + set(obj, 'plusOne', 1); + equal(get(obj, 'plusOne'), 2); + set(obj, 'plusOne', 1); + equal(get(obj, 'plusOne'), 2); + + equal(plusOneWillChange, 1); + equal(plusOneDidChange, 1); + + set(obj, 'foo', 5); + equal(get(obj, 'plusOne'), 6); + + equal(plusOneWillChange, 2); + equal(plusOneDidChange, 2); + }); + + QUnit.module('computed - default setter'); + + _internalTestHelpers.testBoth('when setting a value on a computed property that doesn\'t handle sets', function (get, set) { + var obj = {}; + var observerFired = false; + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed(function () { + return 'foo'; + })); + + _emberMetalObserver.addObserver(obj, 'foo', null, function () { + return observerFired = true; + }); + + set(obj, 'foo', 'bar'); + + equal(get(obj, 'foo'), 'bar', 'The set value is properly returned'); + ok(typeof obj.foo === 'string', 'The computed property was removed'); + ok(observerFired, 'The observer was still notified'); + }); + + QUnit.module('computed - readOnly'); + + QUnit.test('is chainable', function () { + var cp = _emberMetalComputed.computed(function () {}).readOnly(); + + ok(cp instanceof _emberMetalProperties.Descriptor); + ok(cp instanceof _emberMetalComputed.ComputedProperty); + }); + + QUnit.test('throws assertion if called over a CP with a setter defined with the new syntax', function () { + expectAssertion(function () { + _emberMetalComputed.computed({ + get: function () {}, + set: function () {} + }).readOnly(); + }, /Computed properties that define a setter using the new syntax cannot be read-only/); + }); + + _internalTestHelpers.testBoth('protects against setting', function (get, set) { + var obj = {}; + + _emberMetalProperties.defineProperty(obj, 'bar', _emberMetalComputed.computed(function (key) { + return 'barValue'; + }).readOnly()); + + equal(get(obj, 'bar'), 'barValue'); + + throws(function () { + set(obj, 'bar', 'newBar'); + }, /Cannot set read\-only property "bar" on object:/); + + equal(get(obj, 'bar'), 'barValue'); + }); +}); +enifed('ember-metal/tests/computed_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/computed_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/computed_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/computed_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/computed_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/computed_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/descriptor_test', ['exports', 'ember-runtime', 'ember-metal/mixin', 'ember-metal/properties', 'ember-metal/descriptor'], function (exports, _emberRuntime, _emberMetalMixin, _emberMetalProperties, _emberMetalDescriptor) { + 'use strict'; + + // IE9 soft-fails when trying to delete a non-configurable property + var hasCompliantDelete = (function () { + var obj = {}; + + Object.defineProperty(obj, 'zomg', { configurable: false, value: 'zomg' }); + + try { + delete obj.zomg; + } catch (e) { + return true; + } + + return false; + })(); + + // IE9 soft-fails when trying to assign to a non-writable property + var hasCompliantAssign = (function () { + var obj = {}; + + Object.defineProperty(obj, 'zomg', { writable: false, value: 'zomg' }); + + try { + obj.zomg = 'lol'; + } catch (e) { + return true; + } + + return false; + })(); + + var DescriptorTest = (function () { + + /* abstract static module(title: string); */ + + DescriptorTest.test = function test(title, callback) { + var _this = this; + + QUnit.test(title, function (assert) { + callback(assert, new _this(assert)); + }); + }; + + function DescriptorTest(assert) { + babelHelpers.classCallCheck(this, DescriptorTest); + + this.assert = assert; + } + + /* abstract install(key: string, desc: Descriptor); */ + + /* abstract set(key: string, value: any); */ + + /* abstract finalize(): Object; */ + return DescriptorTest; + })(); + + var classes = [(function (_DescriptorTest) { + babelHelpers.inherits(_class, _DescriptorTest); + + _class.module = function module(title) { + QUnit.module(title + ': using defineProperty on an object directly'); + }; + + function _class(assert) { + babelHelpers.classCallCheck(this, _class); + + _DescriptorTest.call(this, assert); + this.object = {}; + } + + _class.prototype.install = function install(key, desc) { + var object = this.object; + var assert = this.assert; + + _emberMetalProperties.defineProperty(object, key, desc); + + assert.ok(object.hasOwnProperty(key)); + }; + + _class.prototype.set = function set(key, value) { + this.object[key] = value; + }; + + _class.prototype.finalize = function finalize() { + return this.object; + }; + + _class.prototype.source = function source() { + return this.object; + }; + + return _class; + })(DescriptorTest), (function (_DescriptorTest2) { + babelHelpers.inherits(_class2, _DescriptorTest2); + + _class2.module = function module(title) { + QUnit.module(title + ': using defineProperty on a prototype'); + }; + + function _class2(assert) { + babelHelpers.classCallCheck(this, _class2); + + _DescriptorTest2.call(this, assert); + this.proto = {}; + } + + _class2.prototype.install = function install(key, desc) { + var proto = this.proto; + var assert = this.assert; + + _emberMetalProperties.defineProperty(proto, key, desc); + + assert.ok(proto.hasOwnProperty(key)); + }; + + _class2.prototype.set = function set(key, value) { + this.proto[key] = value; + }; + + _class2.prototype.finalize = function finalize() { + return Object.create(this.proto); + }; + + _class2.prototype.source = function source() { + return this.proto; + }; + + return _class2; + })(DescriptorTest), (function (_DescriptorTest3) { + babelHelpers.inherits(_class3, _DescriptorTest3); + + _class3.module = function module(title) { + QUnit.module(title + ': in EmberObject.extend()'); + }; + + function _class3(assert) { + babelHelpers.classCallCheck(this, _class3); + + _DescriptorTest3.call(this, assert); + this.klass = null; + this.props = {}; + } + + _class3.prototype.install = function install(key, desc) { + this.props[key] = desc; + }; + + _class3.prototype.set = function set(key, value) { + this.props[key] = value; + }; + + _class3.prototype.finalize = function finalize() { + this.klass = _emberRuntime.Object.extend(this.props); + return this.klass.create(); + }; + + _class3.prototype.source = function source() { + return this.klass.prototype; + }; + + return _class3; + })(DescriptorTest), (function (_DescriptorTest4) { + babelHelpers.inherits(_class4, _DescriptorTest4); + + _class4.module = function module(title) { + QUnit.module(title + ': in EmberObject.extend() through a mixin'); + }; + + function _class4(assert) { + babelHelpers.classCallCheck(this, _class4); + + _DescriptorTest4.call(this, assert); + this.klass = null; + this.props = {}; + } + + _class4.prototype.install = function install(key, desc) { + this.props[key] = desc; + }; + + _class4.prototype.set = function set(key, value) { + this.props[key] = value; + }; + + _class4.prototype.finalize = function finalize() { + this.klass = _emberRuntime.Object.extend(_emberMetalMixin.Mixin.create(this.props)); + return this.klass.create(); + }; + + _class4.prototype.source = function source() { + return this.klass.prototype; + }; + + return _class4; + })(DescriptorTest), (function (_DescriptorTest5) { + babelHelpers.inherits(_class5, _DescriptorTest5); + + _class5.module = function module(title) { + QUnit.module(title + ': inherited from another EmberObject super class'); + }; + + function _class5(assert) { + babelHelpers.classCallCheck(this, _class5); + + _DescriptorTest5.call(this, assert); + this.superklass = null; + this.props = {}; + } + + _class5.prototype.install = function install(key, desc) { + this.props[key] = desc; + }; + + _class5.prototype.set = function set(key, value) { + this.props[key] = value; + }; + + _class5.prototype.finalize = function finalize() { + this.superklass = _emberRuntime.Object.extend(this.props); + return this.superklass.extend().create(); + }; + + _class5.prototype.source = function source() { + return this.superklass.prototype; + }; + + return _class5; + })(DescriptorTest)]; + + classes.forEach(function (TestClass) { + TestClass.module('ember-metal/descriptor'); + + TestClass.test('defining a configurable property', function (assert, factory) { + factory.install('foo', _emberMetalDescriptor.default({ configurable: true, value: 'bar' })); + + var obj = factory.finalize(); + + assert.equal(obj.foo, 'bar'); + + var source = factory.source(); + + delete source.foo; + + assert.strictEqual(obj.foo, undefined); + + Object.defineProperty(source, 'foo', { configurable: true, value: 'baz' }); + + assert.equal(obj.foo, 'baz'); + }); + + TestClass.test('defining a non-configurable property', function (assert, factory) { + factory.install('foo', _emberMetalDescriptor.default({ configurable: false, value: 'bar' })); + + var obj = factory.finalize(); + + assert.equal(obj.foo, 'bar'); + + var source = factory.source(); + + if (hasCompliantDelete) { + assert.throws(function () { + return delete source.foo; + }, TypeError); + } else { + delete source.foo; + } + + assert.throws(function () { + return Object.defineProperty(source, 'foo', { configurable: true, value: 'baz' }); + }, TypeError); + + assert.equal(obj.foo, 'bar'); + }); + + TestClass.test('defining an enumerable property', function (assert, factory) { + factory.install('foo', _emberMetalDescriptor.default({ enumerable: true, value: 'bar' })); + + var obj = factory.finalize(); + + assert.equal(obj.foo, 'bar'); + + var source = factory.source(); + + assert.ok(Object.keys(source).indexOf('foo') !== -1); + }); + + TestClass.test('defining a non-enumerable property', function (assert, factory) { + factory.install('foo', _emberMetalDescriptor.default({ enumerable: false, value: 'bar' })); + + var obj = factory.finalize(); + + assert.equal(obj.foo, 'bar'); + + var source = factory.source(); + + assert.ok(Object.keys(source).indexOf('foo') === -1); + }); + + TestClass.test('defining a writable property', function (assert, factory) { + factory.install('foo', _emberMetalDescriptor.default({ writable: true, value: 'bar' })); + + var obj = factory.finalize(); + + assert.equal(obj.foo, 'bar'); + + var source = factory.source(); + + source.foo = 'baz'; + + assert.equal(obj.foo, 'baz'); + + obj.foo = 'bat'; + + assert.equal(obj.foo, 'bat'); + }); + + TestClass.test('defining a non-writable property', function (assert, factory) { + factory.install('foo', _emberMetalDescriptor.default({ writable: false, value: 'bar' })); + + var obj = factory.finalize(); + + assert.equal(obj.foo, 'bar'); + + var source = factory.source(); + + if (hasCompliantAssign) { + assert.throws(function () { + return source.foo = 'baz'; + }, TypeError); + assert.throws(function () { + return obj.foo = 'baz'; + }, TypeError); + } else { + source.foo = 'baz'; + obj.foo = 'baz'; + } + + assert.equal(obj.foo, 'bar'); + }); + + TestClass.test('defining a getter', function (assert, factory) { + factory.install('foo', _emberMetalDescriptor.default({ + get: function () { + return this.__foo__; + } + })); + + factory.set('__foo__', 'bar'); + + var obj = factory.finalize(); + + assert.equal(obj.foo, 'bar'); + + obj.__foo__ = 'baz'; + + assert.equal(obj.foo, 'baz'); + }); + + TestClass.test('defining a setter', function (assert, factory) { + factory.install('foo', _emberMetalDescriptor.default({ + set: function (value) { + this.__foo__ = value; + } + })); + + factory.set('__foo__', 'bar'); + + var obj = factory.finalize(); + + assert.equal(obj.__foo__, 'bar'); + + obj.foo = 'baz'; + + assert.equal(obj.__foo__, 'baz'); + }); + + TestClass.test('combining multiple setter and getters', function (assert, factory) { + factory.install('foo', _emberMetalDescriptor.default({ + get: function () { + return this.__foo__; + }, + + set: function (value) { + this.__foo__ = value; + } + })); + + factory.set('__foo__', 'foo'); + + factory.install('bar', _emberMetalDescriptor.default({ + get: function () { + return this.__bar__; + }, + + set: function (value) { + this.__bar__ = value; + } + })); + + factory.set('__bar__', 'bar'); + + factory.install('fooBar', _emberMetalDescriptor.default({ + get: function () { + return this.foo + '-' + this.bar; + } + })); + + var obj = factory.finalize(); + + assert.equal(obj.fooBar, 'foo-bar'); + + obj.foo = 'FOO'; + + assert.equal(obj.fooBar, 'FOO-bar'); + + obj.__bar__ = 'BAR'; + + assert.equal(obj.fooBar, 'FOO-BAR'); + + if (hasCompliantAssign) { + assert.throws(function () { + return obj.fooBar = 'foobar'; + }, TypeError); + } else { + obj.fooBar = 'foobar'; + } + + assert.equal(obj.fooBar, 'FOO-BAR'); + }); + }); +}); +enifed('ember-metal/tests/descriptor_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/descriptor_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/descriptor_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/descriptor_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/descriptor_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/descriptor_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/error_test', ['exports', 'ember-metal/error'], function (exports, _emberMetalError) { + 'use strict'; + + QUnit.module('Ember Error Throwing'); + + QUnit.test('new Ember.Error displays provided message', function () { + throws(function () { + throw new _emberMetalError.default('A Message'); + }, function (e) { + return e.message === 'A Message'; + }, 'the assigned message was displayed'); + }); +}); +enifed('ember-metal/tests/error_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/error_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/error_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/error_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/error_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/error_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/events_test', ['exports', 'ember-metal/mixin', 'ember-metal/meta', 'ember-metal/events'], function (exports, _emberMetalMixin, _emberMetalMeta, _emberMetalEvents) { + 'use strict'; + + QUnit.module('system/props/events_test'); + + QUnit.test('listener should receive event - removing should remove', function () { + var obj = {}; + var count = 0; + + function F() { + count++; + } + + _emberMetalEvents.addListener(obj, 'event!', F); + equal(count, 0, 'nothing yet'); + + _emberMetalEvents.sendEvent(obj, 'event!'); + equal(count, 1, 'received event'); + + _emberMetalEvents.removeListener(obj, 'event!', F); + + count = 0; + _emberMetalEvents.sendEvent(obj, 'event!'); + equal(count, 0, 'received event'); + }); + + QUnit.test('listeners should be inherited', function () { + var obj = {}; + var count = 0; + var F = function () { + count++; + }; + + _emberMetalEvents.addListener(obj, 'event!', F); + + var obj2 = Object.create(obj); + + equal(count, 0, 'nothing yet'); + + _emberMetalEvents.sendEvent(obj2, 'event!'); + equal(count, 1, 'received event'); + + _emberMetalEvents.removeListener(obj2, 'event!', F); + + count = 0; + _emberMetalEvents.sendEvent(obj2, 'event!'); + equal(count, 0, 'did not receive event'); + + _emberMetalEvents.sendEvent(obj, 'event!'); + equal(count, 1, 'should still invoke on parent'); + }); + + QUnit.test('adding a listener more than once should only invoke once', function () { + var obj = {}; + var count = 0; + function F() { + count++; + } + _emberMetalEvents.addListener(obj, 'event!', F); + _emberMetalEvents.addListener(obj, 'event!', F); + + _emberMetalEvents.sendEvent(obj, 'event!'); + equal(count, 1, 'should only invoke once'); + }); + + QUnit.test('adding a listener with a target should invoke with target', function () { + var obj = {}; + var target = undefined; + + target = { + count: 0, + method: function () { + this.count++; + } + }; + + _emberMetalEvents.addListener(obj, 'event!', target, target.method); + _emberMetalEvents.sendEvent(obj, 'event!'); + equal(target.count, 1, 'should invoke'); + }); + + QUnit.test('suspending a listener should not invoke during callback', function () { + var obj = {}; + var target = undefined, + otherTarget = undefined; + + target = { + count: 0, + method: function () { + this.count++; + } + }; + + otherTarget = { + count: 0, + method: function () { + this.count++; + } + }; + + _emberMetalEvents.addListener(obj, 'event!', target, target.method); + _emberMetalEvents.addListener(obj, 'event!', otherTarget, otherTarget.method); + + function callback() { + /*jshint validthis:true */ + equal(this, target); + + _emberMetalEvents.sendEvent(obj, 'event!'); + + return 'result'; + } + + _emberMetalEvents.sendEvent(obj, 'event!'); + + equal(_emberMetalEvents.suspendListener(obj, 'event!', target, target.method, callback), 'result'); + + _emberMetalEvents.sendEvent(obj, 'event!'); + + equal(target.count, 2, 'should invoke'); + equal(otherTarget.count, 3, 'should invoke'); + }); + + QUnit.test('adding a listener with string method should lookup method on event delivery', function () { + var obj = {}; + var target = undefined; + + target = { + count: 0, + method: function () {} + }; + + _emberMetalEvents.addListener(obj, 'event!', target, 'method'); + _emberMetalEvents.sendEvent(obj, 'event!'); + equal(target.count, 0, 'should invoke but do nothing'); + + target.method = function () { + this.count++; + }; + _emberMetalEvents.sendEvent(obj, 'event!'); + equal(target.count, 1, 'should invoke now'); + }); + + QUnit.test('calling sendEvent with extra params should be passed to listeners', function () { + var obj = {}; + var params = null; + _emberMetalEvents.addListener(obj, 'event!', function () { + params = Array.prototype.slice.call(arguments); + }); + + _emberMetalEvents.sendEvent(obj, 'event!', ['foo', 'bar']); + deepEqual(params, ['foo', 'bar'], 'params should be saved'); + }); + + QUnit.test('hasListeners tells you if there are listeners for a given event', function () { + var obj = {}; + + function F() {} + function F2() {} + + equal(_emberMetalEvents.hasListeners(obj, 'event!'), false, 'no listeners at first'); + + _emberMetalEvents.addListener(obj, 'event!', F); + _emberMetalEvents.addListener(obj, 'event!', F2); + + equal(_emberMetalEvents.hasListeners(obj, 'event!'), true, 'has listeners'); + + _emberMetalEvents.removeListener(obj, 'event!', F); + equal(_emberMetalEvents.hasListeners(obj, 'event!'), true, 'has listeners'); + + _emberMetalEvents.removeListener(obj, 'event!', F2); + equal(_emberMetalEvents.hasListeners(obj, 'event!'), false, 'has no more listeners'); + + _emberMetalEvents.addListener(obj, 'event!', F); + equal(_emberMetalEvents.hasListeners(obj, 'event!'), true, 'has listeners'); + }); + + QUnit.test('calling removeListener without method should remove all listeners', function () { + var obj = {}; + function F() {} + function F2() {} + + equal(_emberMetalEvents.hasListeners(obj, 'event!'), false, 'no listeners at first'); + + _emberMetalEvents.addListener(obj, 'event!', F); + _emberMetalEvents.addListener(obj, 'event!', F2); + + equal(_emberMetalEvents.hasListeners(obj, 'event!'), true, 'has listeners'); + _emberMetalEvents.removeListener(obj, 'event!'); + + equal(_emberMetalEvents.hasListeners(obj, 'event!'), false, 'has no more listeners'); + }); + + QUnit.test('while suspended, it should not be possible to add a duplicate listener', function () { + var obj = {}; + var target = undefined; + + target = { + count: 0, + method: function () { + this.count++; + } + }; + + _emberMetalEvents.addListener(obj, 'event!', target, target.method); + + function callback() { + _emberMetalEvents.addListener(obj, 'event!', target, target.method); + } + + _emberMetalEvents.sendEvent(obj, 'event!'); + + _emberMetalEvents.suspendListener(obj, 'event!', target, target.method, callback); + + equal(target.count, 1, 'should invoke'); + equal(_emberMetalMeta.meta(obj).matchingListeners('event!').length, 3, 'a duplicate listener wasn\'t added'); + + // now test suspendListeners... + + _emberMetalEvents.sendEvent(obj, 'event!'); + + _emberMetalEvents.suspendListeners(obj, ['event!'], target, target.method, callback); + + equal(target.count, 2, 'should have invoked again'); + equal(_emberMetalMeta.meta(obj).matchingListeners('event!').length, 3, 'a duplicate listener wasn\'t added'); + }); + + QUnit.test('a listener can be added as part of a mixin', function () { + var triggered = 0; + var MyMixin = _emberMetalMixin.Mixin.create({ + foo1: _emberMetalEvents.on('bar', function () { + triggered++; + }), + + foo2: _emberMetalEvents.on('bar', function () { + triggered++; + }) + }); + + var obj = {}; + MyMixin.apply(obj); + + _emberMetalEvents.sendEvent(obj, 'bar'); + equal(triggered, 2, 'should invoke listeners'); + }); + + QUnit.test('a listener added as part of a mixin may be overridden', function () { + var triggered = 0; + var FirstMixin = _emberMetalMixin.Mixin.create({ + foo: _emberMetalEvents.on('bar', function () { + triggered++; + }) + }); + var SecondMixin = _emberMetalMixin.Mixin.create({ + foo: _emberMetalEvents.on('baz', function () { + triggered++; + }) + }); + + var obj = {}; + FirstMixin.apply(obj); + SecondMixin.apply(obj); + + _emberMetalEvents.sendEvent(obj, 'bar'); + equal(triggered, 0, 'should not invoke from overriden property'); + + _emberMetalEvents.sendEvent(obj, 'baz'); + equal(triggered, 1, 'should invoke from subclass property'); + }); +}); +enifed('ember-metal/tests/events_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/events_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/events_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/events_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/events_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/events_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/expand_properties_test', ['exports', 'ember-metal/expand_properties'], function (exports, _emberMetalExpand_properties) { + 'use strict'; + + var foundProperties = []; + + function addProperty(property) { + foundProperties.push(property); + } + + QUnit.module('Property Brace Expansion Test', { + setup: function () { + foundProperties = []; + } + }); + + QUnit.test('Properties without expansions are unaffected', function () { + expect(1); + + _emberMetalExpand_properties.default('a', addProperty); + _emberMetalExpand_properties.default('a.b', addProperty); + _emberMetalExpand_properties.default('a.b.[]', addProperty); + _emberMetalExpand_properties.default('a.b.@each.c', addProperty); + + deepEqual(['a', 'a.b', 'a.b.[]', 'a.b.@each.c'].sort(), foundProperties.sort()); + }); + + QUnit.test('A single expansion at the end expands properly', function () { + expect(1); + + _emberMetalExpand_properties.default('a.b.{c,d}', addProperty); + + deepEqual(['a.b.c', 'a.b.d'].sort(), foundProperties.sort()); + }); + + QUnit.test('A property with only a brace expansion expands correctly', function () { + expect(1); + + _emberMetalExpand_properties.default('{a,b,c}', addProperty); + + var expected = ['a', 'b', 'c']; + deepEqual(expected.sort(), foundProperties.sort()); + }); + + QUnit.test('Expansions with single properties only expand once', function () { + expect(1); + + _emberMetalExpand_properties.default('a.b.{c}.d.{e}', addProperty); + + deepEqual(['a.b.c.d.e'], foundProperties); + }); + + QUnit.test('A single brace expansion expands correctly', function () { + expect(1); + + _emberMetalExpand_properties.default('a.{b,c,d}.e', addProperty); + + var expected = ['a.b.e', 'a.c.e', 'a.d.e']; + deepEqual(expected.sort(), foundProperties.sort()); + }); + + QUnit.test('Multiple brace expansions work correctly', function () { + expect(1); + + _emberMetalExpand_properties.default('{a,b,c}.d.{e,f}.g', addProperty); + + var expected = ['a.d.e.g', 'a.d.f.g', 'b.d.e.g', 'b.d.f.g', 'c.d.e.g', 'c.d.f.g']; + deepEqual(expected.sort(), foundProperties.sort()); + }); + + QUnit.test('A property with only brace expansions expands correctly', function () { + expect(1); + + _emberMetalExpand_properties.default('{a,b,c}.{d}.{e,f}', addProperty); + + var expected = ['a.d.e', 'a.d.f', 'b.d.e', 'b.d.f', 'c.d.e', 'c.d.f']; + deepEqual(expected.sort(), foundProperties.sort()); + }); + + QUnit.test('Nested brace expansions are not allowed', function () { + var nestedBraceProperties = ['a.{b.{c,d}}', 'a.{{b}.c}', 'a.{b,c}.{d.{e,f}.g', 'a.{b.{c}', 'a.{b,c}}']; + + nestedBraceProperties.forEach(function (invalidProperties) { + expectAssertion(function () { + return _emberMetalExpand_properties.default(invalidProperties, addProperty); + }); + }, /Brace expanded properties have to be balanced and cannot be nested/); + }); + + QUnit.test('A pattern must be a string', function () { + expect(1); + + expectAssertion(function () { + _emberMetalExpand_properties.default([], addProperty); + }, /A computed property key must be a string/); + }); + + QUnit.test('A pattern must not contain a space', function () { + expect(1); + + expectAssertion(function () { + _emberMetalExpand_properties.default('a, b', addProperty); + }, /Brace expanded properties cannot contain spaces, e.g. "user.{firstName, lastName}" should be "user.{firstName,lastName}"/); + }); +}); +enifed('ember-metal/tests/expand_properties_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/expand_properties_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/expand_properties_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/expand_properties_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/expand_properties_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/expand_properties_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/injected_property_test', ['exports', 'ember-utils', 'ember-metal/properties', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/injected_property'], function (exports, _emberUtils, _emberMetalProperties, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalInjected_property) { + 'use strict'; + + QUnit.module('InjectedProperty'); + + QUnit.test('injected properties should be descriptors', function () { + ok(new _emberMetalInjected_property.default() instanceof _emberMetalProperties.Descriptor); + }); + + QUnit.test('injected properties should be overridable', function () { + var obj = {}; + _emberMetalProperties.defineProperty(obj, 'foo', new _emberMetalInjected_property.default()); + + _emberMetalProperty_set.set(obj, 'foo', 'bar'); + + equal(_emberMetalProperty_get.get(obj, 'foo'), 'bar', 'should return the overriden value'); + }); + + QUnit.test('getting on an object without an owner or container should fail assertion', function () { + var obj = {}; + _emberMetalProperties.defineProperty(obj, 'foo', new _emberMetalInjected_property.default('type', 'name')); + + expectAssertion(function () { + _emberMetalProperty_get.get(obj, 'foo'); + }, /Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container./); + }); + + QUnit.test('getting on an object without an owner but with a container should not fail', function () { + var obj = { + container: { + lookup: function (key) { + ok(true, 'should call container.lookup'); + return key; + } + } + }; + + _emberMetalProperties.defineProperty(obj, 'foo', new _emberMetalInjected_property.default('type', 'name')); + + equal(_emberMetalProperty_get.get(obj, 'foo'), 'type:name', 'should return the value of container.lookup'); + }); + + QUnit.test('getting should return a lookup on the container', function () { + expect(2); + + var obj = {}; + + _emberUtils.setOwner(obj, { + lookup: function (key) { + ok(true, 'should call container.lookup'); + return key; + } + }); + + _emberMetalProperties.defineProperty(obj, 'foo', new _emberMetalInjected_property.default('type', 'name')); + + equal(_emberMetalProperty_get.get(obj, 'foo'), 'type:name', 'should return the value of container.lookup'); + }); + + QUnit.test('omitting the lookup name should default to the property name', function () { + var obj = {}; + + _emberUtils.setOwner(obj, { + lookup: function (key) { + return key; + } + }); + + _emberMetalProperties.defineProperty(obj, 'foo', new _emberMetalInjected_property.default('type')); + + equal(_emberMetalProperty_get.get(obj, 'foo'), 'type:foo', 'should lookup the type using the property name'); + }); +}); +enifed('ember-metal/tests/injected_property_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/injected_property_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/injected_property_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/injected_property_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/injected_property_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/injected_property_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/instrumentation_test', ['exports', 'ember-metal/instrumentation'], function (exports, _emberMetalInstrumentation) { + 'use strict'; + + QUnit.module('Ember Instrumentation', { + teardown: function () { + _emberMetalInstrumentation.reset(); + } + }); + + QUnit.test('execute block even if no listeners', function () { + var result = _emberMetalInstrumentation.instrument('render', {}, function () { + return 'hello'; + }); + equal(result, 'hello', 'called block'); + }); + + QUnit.test('subscribing to a simple path receives the listener', function () { + expect(12); + + var sentPayload = {}; + var count = 0; + + _emberMetalInstrumentation.subscribe('render', { + before: function (name, timestamp, payload) { + if (count === 0) { + strictEqual(name, 'render'); + } else { + strictEqual(name, 'render.handlebars'); + } + + ok(typeof timestamp === 'number'); + strictEqual(payload, sentPayload); + }, + + after: function (name, timestamp, payload) { + if (count === 0) { + strictEqual(name, 'render'); + } else { + strictEqual(name, 'render.handlebars'); + } + + ok(typeof timestamp === 'number'); + strictEqual(payload, sentPayload); + + count++; + } + }); + + _emberMetalInstrumentation.instrument('render', sentPayload, function () {}); + + _emberMetalInstrumentation.instrument('render.handlebars', sentPayload, function () {}); + }); + + QUnit.test('returning a value from the before callback passes it to the after callback', function () { + expect(2); + + var passthru1 = {}; + var passthru2 = {}; + + _emberMetalInstrumentation.subscribe('render', { + before: function (name, timestamp, payload) { + return passthru1; + }, + after: function (name, timestamp, payload, beforeValue) { + strictEqual(beforeValue, passthru1); + } + }); + + _emberMetalInstrumentation.subscribe('render', { + before: function (name, timestamp, payload) { + return passthru2; + }, + after: function (name, timestamp, payload, beforeValue) { + strictEqual(beforeValue, passthru2); + } + }); + + _emberMetalInstrumentation.instrument('render', null, function () {}); + }); + + QUnit.test('instrument with 2 args (name, callback) no payload', function () { + expect(1); + + _emberMetalInstrumentation.subscribe('render', { + before: function (name, timestamp, payload) { + deepEqual(payload, {}); + }, + after: function () {} + }); + + _emberMetalInstrumentation.instrument('render', function () {}); + }); + + QUnit.test('instrument with 3 args (name, callback, binding) no payload', function () { + expect(2); + + var binding = {}; + _emberMetalInstrumentation.subscribe('render', { + before: function (name, timestamp, payload) { + deepEqual(payload, {}); + }, + after: function () {} + }); + + _emberMetalInstrumentation.instrument('render', function () { + deepEqual(this, binding); + }, binding); + }); + + QUnit.test('instrument with 3 args (name, payload, callback) with payload', function () { + expect(1); + + var expectedPayload = { hi: 1 }; + _emberMetalInstrumentation.subscribe('render', { + before: function (name, timestamp, payload) { + deepEqual(payload, expectedPayload); + }, + after: function () {} + }); + + _emberMetalInstrumentation.instrument('render', expectedPayload, function () {}); + }); + + QUnit.test('instrument with 4 args (name, payload, callback, binding) with payload', function () { + expect(2); + + var expectedPayload = { hi: 1 }; + var binding = {}; + _emberMetalInstrumentation.subscribe('render', { + before: function (name, timestamp, payload) { + deepEqual(payload, expectedPayload); + }, + after: function () {} + }); + + _emberMetalInstrumentation.instrument('render', expectedPayload, function () { + deepEqual(this, binding); + }, binding); + }); + + QUnit.test('raising an exception in the instrumentation attaches it to the payload', function () { + expect(2); + + var error = new Error('Instrumentation'); + + _emberMetalInstrumentation.subscribe('render', { + before: function () {}, + after: function (name, timestamp, payload) { + strictEqual(payload.exception, error); + } + }); + + _emberMetalInstrumentation.subscribe('render', { + before: function () {}, + after: function (name, timestamp, payload) { + strictEqual(payload.exception, error); + } + }); + + _emberMetalInstrumentation.instrument('render.handlebars', null, function () { + throw error; + }); + }); + + QUnit.test('it is possible to add a new subscriber after the first instrument', function () { + _emberMetalInstrumentation.instrument('render.handlebars', null, function () {}); + + _emberMetalInstrumentation.subscribe('render', { + before: function () { + ok(true, 'Before callback was called'); + }, + after: function () { + ok(true, 'After callback was called'); + } + }); + + _emberMetalInstrumentation.instrument('render.handlebars', null, function () {}); + }); + + QUnit.test('it is possible to remove a subscriber', function () { + expect(4); + + var count = 0; + + var subscriber = _emberMetalInstrumentation.subscribe('render', { + before: function () { + equal(count, 0); + ok(true, 'Before callback was called'); + }, + after: function () { + equal(count, 0); + ok(true, 'After callback was called'); + count++; + } + }); + + _emberMetalInstrumentation.instrument('render.handlebars', null, function () {}); + + _emberMetalInstrumentation.unsubscribe(subscriber); + + _emberMetalInstrumentation.instrument('render.handlebars', null, function () {}); + }); +}); +enifed('ember-metal/tests/instrumentation_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/instrumentation_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/instrumentation_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/instrumentation_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/instrumentation_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/instrumentation_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/is_blank_test', ['exports', 'ember-metal/is_blank'], function (exports, _emberMetalIs_blank) { + 'use strict'; + + QUnit.module('Ember.isBlank'); + + QUnit.test('Ember.isBlank', function () { + var string = 'string'; + var fn = function () {}; + var object = { length: 0 }; + + equal(true, _emberMetalIs_blank.default(null), 'for null'); + equal(true, _emberMetalIs_blank.default(undefined), 'for undefined'); + equal(true, _emberMetalIs_blank.default(''), 'for an empty String'); + equal(true, _emberMetalIs_blank.default(' '), 'for a whitespace String'); + equal(true, _emberMetalIs_blank.default('\n\t'), 'for another whitespace String'); + equal(false, _emberMetalIs_blank.default('\n\t Hi'), 'for a String with whitespaces'); + equal(false, _emberMetalIs_blank.default(true), 'for true'); + equal(false, _emberMetalIs_blank.default(false), 'for false'); + equal(false, _emberMetalIs_blank.default(string), 'for a String'); + equal(false, _emberMetalIs_blank.default(fn), 'for a Function'); + equal(false, _emberMetalIs_blank.default(0), 'for 0'); + equal(true, _emberMetalIs_blank.default([]), 'for an empty Array'); + equal(false, _emberMetalIs_blank.default({}), 'for an empty Object'); + equal(true, _emberMetalIs_blank.default(object), 'for an Object that has zero \'length\''); + equal(false, _emberMetalIs_blank.default([1, 2, 3]), 'for a non-empty array'); + }); +}); +enifed('ember-metal/tests/is_blank_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/is_blank_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/is_blank_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/is_blank_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/is_blank_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/is_blank_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/is_empty_test', ['exports', 'ember-metal/is_empty', 'ember-metal/map'], function (exports, _emberMetalIs_empty, _emberMetalMap) { + 'use strict'; + + QUnit.module('Ember.isEmpty'); + + QUnit.test('Ember.isEmpty', function () { + var string = 'string'; + var fn = function () {}; + var object = { length: 0 }; + + equal(true, _emberMetalIs_empty.default(null), 'for null'); + equal(true, _emberMetalIs_empty.default(undefined), 'for undefined'); + equal(true, _emberMetalIs_empty.default(''), 'for an empty String'); + equal(false, _emberMetalIs_empty.default(' '), 'for a whitespace String'); + equal(false, _emberMetalIs_empty.default('\n\t'), 'for another whitespace String'); + equal(false, _emberMetalIs_empty.default(true), 'for true'); + equal(false, _emberMetalIs_empty.default(false), 'for false'); + equal(false, _emberMetalIs_empty.default(string), 'for a String'); + equal(false, _emberMetalIs_empty.default(fn), 'for a Function'); + equal(false, _emberMetalIs_empty.default(0), 'for 0'); + equal(true, _emberMetalIs_empty.default([]), 'for an empty Array'); + equal(false, _emberMetalIs_empty.default({}), 'for an empty Object'); + equal(true, _emberMetalIs_empty.default(object), 'for an Object that has zero \'length\''); + }); + + QUnit.test('Ember.isEmpty Ember.Map', function () { + var map = new _emberMetalMap.Map(); + equal(true, _emberMetalIs_empty.default(map), 'Empty map is empty'); + map.set('foo', 'bar'); + equal(false, _emberMetalIs_empty.default(map), 'Map is not empty'); + }); + + QUnit.test('Ember.isEmpty Ember.OrderedSet', function () { + var orderedSet = new _emberMetalMap.OrderedSet(); + equal(true, _emberMetalIs_empty.default(orderedSet), 'Empty ordered set is empty'); + orderedSet.add('foo'); + equal(false, _emberMetalIs_empty.default(orderedSet), 'Ordered set is not empty'); + }); +}); +enifed('ember-metal/tests/is_empty_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/is_empty_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/is_empty_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/is_empty_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/is_empty_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/is_empty_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/is_none_test', ['exports', 'ember-metal/is_none'], function (exports, _emberMetalIs_none) { + 'use strict'; + + QUnit.module('Ember.isNone'); + + QUnit.test('Ember.isNone', function () { + var string = 'string'; + var fn = function () {}; + + equal(true, _emberMetalIs_none.default(null), 'for null'); + equal(true, _emberMetalIs_none.default(undefined), 'for undefined'); + equal(false, _emberMetalIs_none.default(''), 'for an empty String'); + equal(false, _emberMetalIs_none.default(true), 'for true'); + equal(false, _emberMetalIs_none.default(false), 'for false'); + equal(false, _emberMetalIs_none.default(string), 'for a String'); + equal(false, _emberMetalIs_none.default(fn), 'for a Function'); + equal(false, _emberMetalIs_none.default(0), 'for 0'); + equal(false, _emberMetalIs_none.default([]), 'for an empty Array'); + equal(false, _emberMetalIs_none.default({}), 'for an empty Object'); + }); +}); +enifed('ember-metal/tests/is_none_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/is_none_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/is_none_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/is_none_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/is_none_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/is_none_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/is_present_test', ['exports', 'ember-metal/is_present'], function (exports, _emberMetalIs_present) { + 'use strict'; + + QUnit.module('Ember.isPresent'); + + QUnit.test('Ember.isPresent', function () { + var string = 'string'; + var fn = function () {}; + var object = { length: 0 }; + + equal(false, _emberMetalIs_present.default(), 'for no params'); + equal(false, _emberMetalIs_present.default(null), 'for null'); + equal(false, _emberMetalIs_present.default(undefined), 'for undefined'); + equal(false, _emberMetalIs_present.default(''), 'for an empty String'); + equal(false, _emberMetalIs_present.default(' '), 'for a whitespace String'); + equal(false, _emberMetalIs_present.default('\n\t'), 'for another whitespace String'); + equal(true, _emberMetalIs_present.default('\n\t Hi'), 'for a String with whitespaces'); + equal(true, _emberMetalIs_present.default(true), 'for true'); + equal(true, _emberMetalIs_present.default(false), 'for false'); + equal(true, _emberMetalIs_present.default(string), 'for a String'); + equal(true, _emberMetalIs_present.default(fn), 'for a Function'); + equal(true, _emberMetalIs_present.default(0), 'for 0'); + equal(false, _emberMetalIs_present.default([]), 'for an empty Array'); + equal(true, _emberMetalIs_present.default({}), 'for an empty Object'); + equal(false, _emberMetalIs_present.default(object), 'for an Object that has zero \'length\''); + equal(true, _emberMetalIs_present.default([1, 2, 3]), 'for a non-empty array'); + }); +}); +enifed('ember-metal/tests/is_present_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/is_present_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/is_present_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/is_present_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/is_present_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/is_present_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/libraries_test', ['exports', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/libraries'], function (exports, _emberMetalDebug, _emberMetalFeatures, _emberMetalLibraries) { + /* globals EmberDev */ + 'use strict'; + + var libs = undefined, + registry = undefined; + var originalWarn = _emberMetalDebug.getDebugFunction('warn'); + + QUnit.module('Libraries registry', { + setup: function () { + libs = new _emberMetalLibraries.Libraries(); + registry = libs._registry; + }, + + teardown: function () { + libs = null; + registry = null; + + _emberMetalDebug.setDebugFunction('warn', originalWarn); + } + }); + + QUnit.test('core libraries come before other libraries', function () { + expect(2); + + libs.register('my-lib', '2.0.0a'); + libs.registerCoreLibrary('DS', '1.0.0-beta.2'); + + equal(registry[0].name, 'DS'); + equal(registry[1].name, 'my-lib'); + }); + + QUnit.test('only the first registration of a library is stored', function () { + expect(3); + + libs.register('magic', 1.23); + libs.register('magic', 2.23); + + equal(registry[0].name, 'magic'); + equal(registry[0].version, 1.23); + equal(registry.length, 1); + }); + + if (false) { + QUnit.test('isRegistered returns correct value', function () { + expect(3); + + equal(libs.isRegistered('magic'), false); + + libs.register('magic', 1.23); + equal(libs.isRegistered('magic'), true); + + libs.deRegister('magic'); + equal(libs.isRegistered('magic'), false); + }); + } + + QUnit.test('attempting to register a library that is already registered warns you', function () { + if (EmberDev && EmberDev.runningProdBuild) { + ok(true, 'Logging does not occur in production builds'); + return; + } + + expect(1); + + libs.register('magic', 1.23); + + _emberMetalDebug.setDebugFunction('warn', function (msg, test) { + if (!test) { + equal(msg, 'Library "magic" is already registered with Ember.'); + } + }); + + // Should warn us + libs.register('magic', 2.23); + }); + + QUnit.test('libraries can be de-registered', function () { + expect(2); + + libs.register('lib1', '1.0.0b'); + libs.register('lib2', '1.0.0b'); + libs.register('lib3', '1.0.0b'); + + libs.deRegister('lib1'); + libs.deRegister('lib3'); + + equal(registry[0].name, 'lib2'); + equal(registry.length, 1); + }); +}); +enifed('ember-metal/tests/libraries_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/libraries_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/libraries_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/libraries_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/libraries_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/libraries_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/main_test', ['exports', 'ember-metal/index'], function (exports, _emberMetalIndex) { + 'use strict'; + + // testing reexports + + // From sindresourhus/semver-regex https://github.com/sindresorhus/semver-regex/blob/795b05628d96597ebcbe6d31ef4a432858365582/index.js#L3 + var SEMVER_REGEX = /^\bv?(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?\b$/; + + QUnit.module('ember-metal/core/main'); + + QUnit.test('Ember registers itself', function () { + var lib = _emberMetalIndex.default.libraries._registry[0]; + + equal(lib.name, 'Ember'); + equal(lib.version, _emberMetalIndex.default.VERSION); + }); + + QUnit.test('Ember.VERSION is in alignment with SemVer v2.0.0', function () { + ok(SEMVER_REGEX.test(_emberMetalIndex.default.VERSION), 'Ember.VERSION (' + _emberMetalIndex.default.VERSION + ')is valid SemVer v2.0.0'); + }); + + QUnit.test('SEMVER_REGEX properly validates and invalidates version numbers', function () { + function validateVersionString(versionString, expectedResult) { + equal(SEMVER_REGEX.test(versionString), expectedResult); + } + + // Postive test cases + validateVersionString('1.11.3', true); + validateVersionString('1.0.0-beta.16.1', true); + validateVersionString('1.12.1+canary.aba1412', true); + validateVersionString('2.0.0-beta.1+canary.bb344775', true); + + // Negative test cases + validateVersionString('1.11.3.aba18a', false); + validateVersionString('1.11', false); + }); + + QUnit.test('Ember.keys is deprecated', function () { + expectDeprecation(function () { + _emberMetalIndex.default.keys({}); + }, 'Ember.keys is deprecated in favor of Object.keys'); + }); + + QUnit.test('Ember.create is deprecated', function () { + expectDeprecation(function () { + _emberMetalIndex.default.create(null); + }, 'Ember.create is deprecated in favor of Object.create'); + }); + + QUnit.test('Ember.Backburner is deprecated', function () { + expectDeprecation(function () { + new _emberMetalIndex.default.Backburner(['foo']); + }, 'Usage of Ember.Backburner is deprecated.'); + }); +}); +enifed('ember-metal/tests/main_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/main_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/main_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/main_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/main_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/main_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/map_test', ['exports', 'ember-metal/map'], function (exports, _emberMetalMap) { + 'use strict'; + + var object = undefined, + number = undefined, + string = undefined, + map = undefined, + variety = undefined; + var varieties = [['Map', _emberMetalMap.Map], ['MapWithDefault', _emberMetalMap.MapWithDefault]]; + + function testMap(nameAndFunc) { + variety = nameAndFunc[0]; + + QUnit.module('Ember.' + variety + ' (forEach and get are implicitly tested)', { + setup: function () { + object = {}; + number = 42; + string = 'foo'; + + map = nameAndFunc[1].create(); + } + }); + + var mapHasLength = function (expected, theMap) { + theMap = theMap || map; + + var length = 0; + theMap.forEach(function () { + length++; + }); + + equal(length, expected, 'map should contain ' + expected + ' items'); + }; + + var mapHasEntries = function (entries, theMap) { + theMap = theMap || map; + + for (var i = 0; i < entries.length; i++) { + equal(theMap.get(entries[i][0]), entries[i][1]); + equal(theMap.has(entries[i][0]), true); + } + + mapHasLength(entries.length, theMap); + }; + + var unboundThis = undefined; + + (function () { + unboundThis = this; + })(); + + QUnit.test('set', function () { + map.set(object, 'winning'); + map.set(number, 'winning'); + map.set(string, 'winning'); + + mapHasEntries([[object, 'winning'], [number, 'winning'], [string, 'winning']]); + + map.set(object, 'losing'); + map.set(number, 'losing'); + map.set(string, 'losing'); + + mapHasEntries([[object, 'losing'], [number, 'losing'], [string, 'losing']]); + + equal(map.has('nope'), false, 'expected the key `nope` to not be present'); + equal(map.has({}), false, 'expected they key `{}` to not be present'); + }); + + QUnit.test('set chaining', function () { + map.set(object, 'winning').set(number, 'winning').set(string, 'winning'); + + mapHasEntries([[object, 'winning'], [number, 'winning'], [string, 'winning']]); + + map.set(object, 'losing').set(number, 'losing').set(string, 'losing'); + + mapHasEntries([[object, 'losing'], [number, 'losing'], [string, 'losing']]); + + equal(map.has('nope'), false, 'expected the key `nope` to not be present'); + equal(map.has({}), false, 'expected they key `{}` to not be present'); + }); + + QUnit.test('with key with undefined value', function () { + map.set('foo', undefined); + + map.forEach(function (value, key) { + equal(value, undefined); + equal(key, 'foo'); + }); + + ok(map.has('foo'), 'has key foo, even with undefined value'); + + equal(map.size, 1); + }); + + QUnit.test('arity of forEach is 1 – es6 23.1.3.5', function () { + equal(map.forEach.length, 1, 'expected arity for map.forEach is 1'); + }); + + QUnit.test('forEach throws without a callback as the first argument', function () { + equal(map.forEach.length, 1, 'expected arity for map.forEach is 1'); + }); + + QUnit.test('has empty collection', function () { + equal(map.has('foo'), false); + equal(map.has(), false); + }); + + QUnit.test('delete', function () { + expectNoDeprecation(); + + map.set(object, 'winning'); + map.set(number, 'winning'); + map.set(string, 'winning'); + + map.delete(object); + map.delete(number); + map.delete(string); + + // doesn't explode + map.delete({}); + + mapHasEntries([]); + }); + + QUnit.test('copy and then update', function () { + map.set(object, 'winning'); + map.set(number, 'winning'); + map.set(string, 'winning'); + + var map2 = map.copy(); + + map2.set(object, 'losing'); + map2.set(number, 'losing'); + map2.set(string, 'losing'); + + mapHasEntries([[object, 'winning'], [number, 'winning'], [string, 'winning']]); + + mapHasEntries([[object, 'losing'], [number, 'losing'], [string, 'losing']], map2); + }); + + QUnit.test('copy and then delete', function () { + map.set(object, 'winning'); + map.set(number, 'winning'); + map.set(string, 'winning'); + + var map2 = map.copy(); + + map2.delete(object); + map2.delete(number); + map2.delete(string); + + mapHasEntries([[object, 'winning'], [number, 'winning'], [string, 'winning']]); + + mapHasEntries([], map2); + }); + + QUnit.test('size', function () { + //Add a key twice + equal(map.size, 0); + map.set(string, 'a string'); + equal(map.size, 1); + map.set(string, 'the same string'); + equal(map.size, 1); + + //Add another + map.set(number, 'a number'); + equal(map.size, 2); + + //Remove one that doesn't exist + map.delete('does not exist'); + equal(map.size, 2); + + //Check copy + var copy = map.copy(); + equal(copy.size, 2); + + //Remove a key twice + map.delete(number); + equal(map.size, 1); + map.delete(number); + equal(map.size, 1); + + //Remove the last key + map.delete(string); + equal(map.size, 0); + map.delete(string); + equal(map.size, 0); + }); + + QUnit.test('forEach without proper callback', function () { + QUnit.throws(function () { + map.forEach(); + }, '[object Undefined] is not a function'); + + QUnit.throws(function () { + map.forEach(undefined); + }, '[object Undefined] is not a function'); + + QUnit.throws(function () { + map.forEach(1); + }, '[object Number] is not a function'); + + QUnit.throws(function () { + map.forEach({}); + }, '[object Object] is not a function'); + + map.forEach(function (value, key) { + map.delete(key); + }); + // ensure the error happens even if no data is present + equal(map.size, 0); + QUnit.throws(function () { + map.forEach({}); + }, '[object Object] is not a function'); + }); + + QUnit.test('forEach basic', function () { + map.set('a', 1); + map.set('b', 2); + map.set('c', 3); + + var iteration = 0; + + var expectations = [{ value: 1, key: 'a', context: unboundThis }, { value: 2, key: 'b', context: unboundThis }, { value: 3, key: 'c', context: unboundThis }]; + + map.forEach(function (value, key, theMap) { + var expectation = expectations[iteration]; + + equal(value, expectation.value, 'value should be correct'); + equal(key, expectation.key, 'key should be correct'); + equal(this, expectation.context, 'context should be as if it was unbound'); + equal(map, theMap, 'map being iterated over should be passed in'); + + iteration++; + }); + + equal(iteration, 3, 'expected 3 iterations'); + }); + + QUnit.test('forEach basic /w context', function () { + map.set('a', 1); + map.set('b', 2); + map.set('c', 3); + + var iteration = 0; + var context = {}; + var expectations = [{ value: 1, key: 'a', context: context }, { value: 2, key: 'b', context: context }, { value: 3, key: 'c', context: context }]; + + map.forEach(function (value, key, theMap) { + var expectation = expectations[iteration]; + + equal(value, expectation.value, 'value should be correct'); + equal(key, expectation.key, 'key should be correct'); + equal(this, expectation.context, 'context should be as if it was unbound'); + equal(map, theMap, 'map being iterated over should be passed in'); + + iteration++; + }, context); + + equal(iteration, 3, 'expected 3 iterations'); + }); + + QUnit.test('forEach basic /w deletion while enumerating', function () { + map.set('a', 1); + map.set('b', 2); + map.set('c', 3); + + var iteration = 0; + + var expectations = [{ value: 1, key: 'a', context: unboundThis }, { value: 2, key: 'b', context: unboundThis }]; + + map.forEach(function (value, key, theMap) { + if (iteration === 0) { + map.delete('c'); + } + + var expectation = expectations[iteration]; + + equal(value, expectation.value, 'value should be correct'); + equal(key, expectation.key, 'key should be correct'); + equal(this, expectation.context, 'context should be as if it was unbound'); + equal(map, theMap, 'map being iterated over should be passed in'); + + iteration++; + }); + + equal(iteration, 2, 'expected 3 iterations'); + }); + + QUnit.test('forEach basic /w addition while enumerating', function () { + map.set('a', 1); + map.set('b', 2); + map.set('c', 3); + + var iteration = 0; + + var expectations = [{ value: 1, key: 'a', context: unboundThis }, { value: 2, key: 'b', context: unboundThis }, { value: 3, key: 'c', context: unboundThis }, { value: 4, key: 'd', context: unboundThis }]; + + map.forEach(function (value, key, theMap) { + if (iteration === 0) { + map.set('d', 4); + } + + var expectation = expectations[iteration]; + + equal(value, expectation.value, 'value should be correct'); + equal(key, expectation.key, 'key should be correct'); + equal(this, expectation.context, 'context should be as if it was unbound'); + equal(map, theMap, 'map being iterated over should be passed in'); + + iteration++; + }); + + equal(iteration, 4, 'expected 3 iterations'); + }); + + QUnit.test('clear', function () { + var iterations = 0; + + map.set('a', 1); + map.set('b', 2); + map.set('c', 3); + map.set('d', 4); + + equal(map.size, 4); + + map.forEach(function () { + iterations++; + }); + equal(iterations, 4); + + map.clear(); + equal(map.size, 0); + iterations = 0; + map.forEach(function () { + iterations++; + }); + equal(iterations, 0); + }); + + QUnit.test('-0', function () { + equal(map.has(-0), false); + equal(map.has(0), false); + + map.set(-0, 'zero'); + + equal(map.has(-0), true); + equal(map.has(0), true); + + equal(map.get(0), 'zero'); + equal(map.get(-0), 'zero'); + + map.forEach(function (value, key) { + equal(1 / key, Infinity, 'spec says key should be positive zero'); + }); + }); + + QUnit.test('NaN', function () { + equal(map.has(NaN), false); + + map.set(NaN, 'not-a-number'); + + equal(map.has(NaN), true); + + equal(map.get(NaN), 'not-a-number'); + }); + + QUnit.test('NaN Boxed', function () { + //jshint -W053 + var boxed = new Number(NaN); + equal(map.has(boxed), false); + + map.set(boxed, 'not-a-number'); + + equal(map.has(boxed), true); + equal(map.has(NaN), false); + + equal(map.get(NaN), undefined); + equal(map.get(boxed), 'not-a-number'); + }); + + QUnit.test('0 value', function () { + var obj = {}; + equal(map.has(obj), false); + + equal(map.size, 0); + map.set(obj, 0); + equal(map.size, 1); + + equal(map.has(obj), true); + equal(map.get(obj), 0); + + map.delete(obj); + equal(map.has(obj), false); + equal(map.get(obj), undefined); + equal(map.size, 0); + }); + } + + for (var i = 0; i < varieties.length; i++) { + testMap(varieties[i]); + } + + QUnit.module('MapWithDefault - default values'); + + QUnit.test('Retrieving a value that has not been set returns and sets a default value', function () { + var map = _emberMetalMap.MapWithDefault.create({ + defaultValue: function (key) { + return [key]; + } + }); + + var value = map.get('ohai'); + deepEqual(value, ['ohai']); + + strictEqual(value, map.get('ohai')); + }); + + QUnit.test('Map.prototype.constructor', function () { + var map = new _emberMetalMap.Map(); + equal(map.constructor, _emberMetalMap.Map); + }); + + QUnit.test('Map() without `new`', function () { + QUnit.throws(function () { + // jshint newcap:false + _emberMetalMap.Map(); + }, /Constructor Map requires 'new'/); + }); + + QUnit.test('MapWithDefault.prototype.constructor', function () { + var map = new _emberMetalMap.MapWithDefault({ + defaultValue: function (key) { + return key; + } + }); + equal(map.constructor, _emberMetalMap.MapWithDefault); + }); + + QUnit.test('Copying a MapWithDefault copies the default value', function () { + var map = _emberMetalMap.MapWithDefault.create({ + defaultValue: function (key) { + return [key]; + } + }); + + map.set('ohai', 1); + map.get('bai'); + + var map2 = map.copy(); + + equal(map2.get('ohai'), 1); + deepEqual(map2.get('bai'), ['bai']); + + map2.set('kthx', 3); + + deepEqual(map.get('kthx'), ['kthx']); + equal(map2.get('kthx'), 3); + + deepEqual(map2.get('default'), ['default']); + + map2.defaultValue = function (key) { + return ['tom is on', key]; + }; + + deepEqual(map2.get('drugs'), ['tom is on', 'drugs']); + }); + + QUnit.module('OrderedSet', { + setup: function () { + object = {}; + number = 42; + string = 'foo'; + + map = _emberMetalMap.OrderedSet.create(); + } + }); + + QUnit.test('OrderedSet() without `new`', function () { + QUnit.throws(function () { + // jshint newcap:false + _emberMetalMap.OrderedSet(); + }, /Constructor OrderedSet requires 'new'/); + }); + + QUnit.test('add returns the set', function () { + var obj = {}; + equal(map.add(obj), map); + equal(map.add(obj), map, 'when it is already in the set'); + }); +}); +enifed('ember-metal/tests/map_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/map_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/map_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/map_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/map_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/map_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/meta_test', ['exports', 'ember-metal/meta'], function (exports, _emberMetalMeta) { + 'use strict'; + + QUnit.module('Ember.meta'); + + QUnit.test('should return the same hash for an object', function () { + var obj = {}; + + _emberMetalMeta.meta(obj).foo = 'bar'; + + equal(_emberMetalMeta.meta(obj).foo, 'bar', 'returns same hash with multiple calls to Ember.meta()'); + }); + + QUnit.test('meta is not enumerable', function () { + var proto = undefined, + obj = undefined, + props = undefined, + prop = undefined; + proto = { foo: 'bar' }; + _emberMetalMeta.meta(proto); + obj = Object.create(proto); + _emberMetalMeta.meta(obj); + obj.bar = 'baz'; + props = []; + for (prop in obj) { + props.push(prop); + } + deepEqual(props.sort(), ['bar', 'foo']); + if (typeof JSON !== 'undefined' && 'stringify' in JSON) { + try { + JSON.stringify(obj); + } catch (e) { + ok(false, 'meta should not fail JSON.stringify'); + } + } + }); + + QUnit.test('meta.listeners basics', function (assert) { + var t = {}; + var m = _emberMetalMeta.meta({}); + m.addToListeners('hello', t, 'm', 0); + var matching = m.matchingListeners('hello'); + assert.equal(matching.length, 3); + assert.equal(matching[0], t); + m.removeFromListeners('hello', t, 'm'); + matching = m.matchingListeners('hello'); + assert.equal(matching.length, 0); + }); + + QUnit.test('meta.listeners inheritance', function (assert) { + var target = {}; + var parent = {}; + var parentMeta = _emberMetalMeta.meta(parent); + parentMeta.addToListeners('hello', target, 'm', 0); + + var child = Object.create(parent); + var m = _emberMetalMeta.meta(child); + + var matching = m.matchingListeners('hello'); + assert.equal(matching.length, 3); + assert.equal(matching[0], target); + assert.equal(matching[1], 'm'); + assert.equal(matching[2], 0); + m.removeFromListeners('hello', target, 'm'); + matching = m.matchingListeners('hello'); + assert.equal(matching.length, 0); + matching = parentMeta.matchingListeners('hello'); + assert.equal(matching.length, 3); + }); + + QUnit.test('meta.listeners deduplication', function (assert) { + var t = {}; + var m = _emberMetalMeta.meta({}); + m.addToListeners('hello', t, 'm', 0); + m.addToListeners('hello', t, 'm', 0); + var matching = m.matchingListeners('hello'); + assert.equal(matching.length, 3); + assert.equal(matching[0], t); + }); +}); +enifed('ember-metal/tests/meta_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/meta_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/meta_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/meta_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/meta_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/meta_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/mixin/alias_method_test', ['exports', 'ember-metal/property_get', 'ember-metal/mixin'], function (exports, _emberMetalProperty_get, _emberMetalMixin) { + 'use strict'; + + QUnit.module('aliasMethod'); + + function validateAliasMethod(obj) { + equal(obj.fooMethod(), 'FOO', 'obj.fooMethod()'); + equal(obj.barMethod(), 'FOO', 'obj.barMethod should be a copy of foo'); + } + + QUnit.test('methods of another name are aliased when the mixin is applied', function () { + var MyMixin = _emberMetalMixin.Mixin.create({ + fooMethod: function () { + return 'FOO'; + }, + barMethod: _emberMetalMixin.aliasMethod('fooMethod') + }); + + var obj = MyMixin.apply({}); + validateAliasMethod(obj); + }); + + QUnit.test('should follow aliasMethods all the way down', function () { + var MyMixin = _emberMetalMixin.Mixin.create({ + bar: _emberMetalMixin.aliasMethod('foo'), // put first to break ordered iteration + baz: function () { + return 'baz'; + }, + foo: _emberMetalMixin.aliasMethod('baz') + }); + + var obj = MyMixin.apply({}); + equal(_emberMetalProperty_get.get(obj, 'bar')(), 'baz', 'should have followed aliasMethods'); + }); + + QUnit.test('should alias methods from other dependent mixins', function () { + var BaseMixin = _emberMetalMixin.Mixin.create({ + fooMethod: function () { + return 'FOO'; + } + }); + + var MyMixin = _emberMetalMixin.Mixin.create(BaseMixin, { + barMethod: _emberMetalMixin.aliasMethod('fooMethod') + }); + + var obj = MyMixin.apply({}); + validateAliasMethod(obj); + }); + + QUnit.test('should alias methods from other mixins applied at same time', function () { + var BaseMixin = _emberMetalMixin.Mixin.create({ + fooMethod: function () { + return 'FOO'; + } + }); + + var MyMixin = _emberMetalMixin.Mixin.create({ + barMethod: _emberMetalMixin.aliasMethod('fooMethod') + }); + + var obj = _emberMetalMixin.mixin({}, BaseMixin, MyMixin); + validateAliasMethod(obj); + }); + + QUnit.test('should alias methods from mixins already applied on object', function () { + var BaseMixin = _emberMetalMixin.Mixin.create({ + quxMethod: function () { + return 'qux'; + } + }); + + var MyMixin = _emberMetalMixin.Mixin.create({ + bar: _emberMetalMixin.aliasMethod('foo'), + barMethod: _emberMetalMixin.aliasMethod('fooMethod') + }); + + var obj = { + fooMethod: function () { + return 'FOO'; + } + }; + + BaseMixin.apply(obj); + MyMixin.apply(obj); + + validateAliasMethod(obj); + }); +}); +enifed('ember-metal/tests/mixin/alias_method_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/mixin'); + test('ember-metal/tests/mixin/alias_method_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/mixin/alias_method_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/mixin/alias_method_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/mixin'); + QUnit.test('ember-metal/tests/mixin/alias_method_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/mixin/alias_method_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/mixin/apply_test', ['exports', 'ember-metal/property_get', 'ember-metal/mixin'], function (exports, _emberMetalProperty_get, _emberMetalMixin) { + 'use strict'; + + QUnit.module('Ember.Mixin.apply'); + + function K() {} + + QUnit.test('using apply() should apply properties', function () { + var MixinA = _emberMetalMixin.Mixin.create({ foo: 'FOO', baz: K }); + var obj = {}; + _emberMetalMixin.mixin(obj, MixinA); + + equal(_emberMetalProperty_get.default(obj, 'foo'), 'FOO', 'should apply foo'); + equal(_emberMetalProperty_get.default(obj, 'baz'), K, 'should apply foo'); + }); + + QUnit.test('applying anonymous properties', function () { + var obj = {}; + _emberMetalMixin.mixin(obj, { + foo: 'FOO', + baz: K + }); + + equal(_emberMetalProperty_get.default(obj, 'foo'), 'FOO', 'should apply foo'); + equal(_emberMetalProperty_get.default(obj, 'baz'), K, 'should apply foo'); + }); + + QUnit.test('applying null values', function () { + expectAssertion(function () { + return _emberMetalMixin.mixin({}, null); + }); + }); + + QUnit.test('applying a property with an undefined value', function () { + var obj = { tagName: '' }; + _emberMetalMixin.mixin(obj, { tagName: undefined }); + + strictEqual(_emberMetalProperty_get.default(obj, 'tagName'), ''); + }); +}); +enifed('ember-metal/tests/mixin/apply_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/mixin'); + test('ember-metal/tests/mixin/apply_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/mixin/apply_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/mixin/apply_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/mixin'); + QUnit.test('ember-metal/tests/mixin/apply_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/mixin/apply_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/mixin/computed_test', ['exports', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/mixin', 'ember-metal/computed', 'ember-metal/properties'], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMixin, _emberMetalComputed, _emberMetalProperties) { + 'use strict'; + + function K() { + return this; + } + + QUnit.module('Mixin Computed Properties'); + + QUnit.test('overriding computed properties', function () { + var MixinA = undefined, + MixinB = undefined, + MixinC = undefined, + MixinD = undefined; + var obj = undefined; + + MixinA = _emberMetalMixin.Mixin.create({ + aProp: _emberMetalComputed.computed(function () { + return 'A'; + }) + }); + + MixinB = _emberMetalMixin.Mixin.create(MixinA, { + aProp: _emberMetalComputed.computed(function () { + return this._super.apply(this, arguments) + 'B'; + }) + }); + + MixinC = _emberMetalMixin.Mixin.create(MixinA, { + aProp: _emberMetalComputed.computed(function () { + return this._super.apply(this, arguments) + 'C'; + }) + }); + + MixinD = _emberMetalMixin.Mixin.create({ + aProp: _emberMetalComputed.computed(function () { + return this._super.apply(this, arguments) + 'D'; + }) + }); + + obj = {}; + MixinB.apply(obj); + equal(_emberMetalProperty_get.get(obj, 'aProp'), 'AB', 'should expose super for B'); + + obj = {}; + MixinC.apply(obj); + equal(_emberMetalProperty_get.get(obj, 'aProp'), 'AC', 'should expose super for C'); + + obj = {}; + + MixinA.apply(obj); + MixinD.apply(obj); + equal(_emberMetalProperty_get.get(obj, 'aProp'), 'AD', 'should define super for D'); + + obj = {}; + _emberMetalProperties.defineProperty(obj, 'aProp', _emberMetalComputed.computed(function (key) { + return 'obj'; + })); + MixinD.apply(obj); + equal(_emberMetalProperty_get.get(obj, 'aProp'), 'objD', 'should preserve original computed property'); + }); + + QUnit.test('calling set on overridden computed properties', function () { + var SuperMixin = undefined, + SubMixin = undefined; + var obj = undefined; + + var superGetOccurred = false; + var superSetOccurred = false; + + SuperMixin = _emberMetalMixin.Mixin.create({ + aProp: _emberMetalComputed.computed({ + get: function (key) { + superGetOccurred = true; + }, + set: function (key, value) { + superSetOccurred = true; + } + }) + }); + + SubMixin = _emberMetalMixin.Mixin.create(SuperMixin, { + aProp: _emberMetalComputed.computed({ + get: function (key) { + return this._super.apply(this, arguments); + }, + set: function (key, value) { + return this._super.apply(this, arguments); + } + }) + }); + + obj = {}; + SubMixin.apply(obj); + + _emberMetalProperty_set.set(obj, 'aProp', 'set thyself'); + ok(superSetOccurred, 'should pass set to _super'); + + superSetOccurred = false; // reset the set assertion + + obj = {}; + SubMixin.apply(obj); + + _emberMetalProperty_get.get(obj, 'aProp'); + ok(superGetOccurred, 'should pass get to _super'); + + _emberMetalProperty_set.set(obj, 'aProp', 'set thyself'); + ok(superSetOccurred, 'should pass set to _super after getting'); + }); + + QUnit.test('setter behavior works properly when overriding computed properties', function () { + var obj = {}; + + var MixinA = _emberMetalMixin.Mixin.create({ + cpWithSetter2: _emberMetalComputed.computed(K), + cpWithSetter3: _emberMetalComputed.computed(K), + cpWithoutSetter: _emberMetalComputed.computed(K) + }); + + var cpWasCalled = false; + + var MixinB = _emberMetalMixin.Mixin.create({ + cpWithSetter2: _emberMetalComputed.computed({ + get: K, + set: function (k, v) { + cpWasCalled = true; + } + }), + + cpWithSetter3: _emberMetalComputed.computed({ + get: K, + set: function (k, v) { + cpWasCalled = true; + } + }), + + cpWithoutSetter: _emberMetalComputed.computed(function (k) { + cpWasCalled = true; + }) + }); + + MixinA.apply(obj); + MixinB.apply(obj); + + _emberMetalProperty_set.set(obj, 'cpWithSetter2', 'test'); + ok(cpWasCalled, 'The computed property setter was called when defined with two args'); + cpWasCalled = false; + + _emberMetalProperty_set.set(obj, 'cpWithSetter3', 'test'); + ok(cpWasCalled, 'The computed property setter was called when defined with three args'); + cpWasCalled = false; + + _emberMetalProperty_set.set(obj, 'cpWithoutSetter', 'test'); + equal(_emberMetalProperty_get.get(obj, 'cpWithoutSetter'), 'test', 'The default setter was called, the value is correct'); + ok(!cpWasCalled, 'The default setter was called, not the CP itself'); + }); +}); +enifed('ember-metal/tests/mixin/computed_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/mixin'); + test('ember-metal/tests/mixin/computed_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/mixin/computed_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/mixin/computed_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/mixin'); + QUnit.test('ember-metal/tests/mixin/computed_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/mixin/computed_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/mixin/concatenated_properties_test', ['exports', 'ember-metal/property_get', 'ember-metal/mixin'], function (exports, _emberMetalProperty_get, _emberMetalMixin) { + 'use strict'; + + QUnit.module('Mixin concatenatedProperties'); + + QUnit.test('defining concatenated properties should concat future version', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + concatenatedProperties: ['foo'], + foo: ['a', 'b', 'c'] + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + foo: ['d', 'e', 'f'] + }); + + var obj = _emberMetalMixin.mixin({}, MixinA, MixinB); + deepEqual(_emberMetalProperty_get.default(obj, 'foo'), ['a', 'b', 'c', 'd', 'e', 'f']); + }); + + QUnit.test('defining concatenated properties should concat future version', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + concatenatedProperties: null + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + concatenatedProperties: null + }); + + var obj = _emberMetalMixin.mixin({}, MixinA, MixinB); + + deepEqual(obj.concatenatedProperties, []); + }); + + QUnit.test('concatenatedProperties should be concatenated', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + concatenatedProperties: ['foo'], + foo: ['a', 'b', 'c'] + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + concatenatedProperties: 'bar', + foo: ['d', 'e', 'f'], + bar: [1, 2, 3] + }); + + var MixinC = _emberMetalMixin.Mixin.create({ + bar: [4, 5, 6] + }); + + var obj = _emberMetalMixin.mixin({}, MixinA, MixinB, MixinC); + deepEqual(_emberMetalProperty_get.default(obj, 'concatenatedProperties'), ['foo', 'bar'], 'get concatenatedProperties'); + deepEqual(_emberMetalProperty_get.default(obj, 'foo'), ['a', 'b', 'c', 'd', 'e', 'f'], 'get foo'); + deepEqual(_emberMetalProperty_get.default(obj, 'bar'), [1, 2, 3, 4, 5, 6], 'get bar'); + }); + + QUnit.test('adding a prop that is not an array should make array', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + concatenatedProperties: ['foo'], + foo: [1, 2, 3] + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + foo: 4 + }); + + var obj = _emberMetalMixin.mixin({}, MixinA, MixinB); + deepEqual(_emberMetalProperty_get.default(obj, 'foo'), [1, 2, 3, 4]); + }); + + QUnit.test('adding a prop that is not an array should make array', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + concatenatedProperties: ['foo'], + foo: 'bar' + }); + + var obj = _emberMetalMixin.mixin({}, MixinA); + deepEqual(_emberMetalProperty_get.default(obj, 'foo'), ['bar']); + }); + + QUnit.test('adding a non-concatenable property that already has a defined value should result in an array with both values', function () { + var mixinA = _emberMetalMixin.Mixin.create({ + foo: 1 + }); + + var mixinB = _emberMetalMixin.Mixin.create({ + concatenatedProperties: ['foo'], + foo: 2 + }); + + var obj = _emberMetalMixin.mixin({}, mixinA, mixinB); + deepEqual(_emberMetalProperty_get.default(obj, 'foo'), [1, 2]); + }); + + QUnit.test('adding a concatenable property that already has a defined value should result in a concatenated value', function () { + var mixinA = _emberMetalMixin.Mixin.create({ + foobar: 'foo' + }); + + var mixinB = _emberMetalMixin.Mixin.create({ + concatenatedProperties: ['foobar'], + foobar: 'bar' + }); + + var obj = _emberMetalMixin.mixin({}, mixinA, mixinB); + equal(_emberMetalProperty_get.default(obj, 'foobar'), 'foobar'); + }); +}); +enifed('ember-metal/tests/mixin/concatenated_properties_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/mixin'); + test('ember-metal/tests/mixin/concatenated_properties_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/mixin/concatenated_properties_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/mixin/concatenated_properties_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/mixin'); + QUnit.test('ember-metal/tests/mixin/concatenated_properties_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/mixin/concatenated_properties_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/mixin/detect_test', ['exports', 'ember-metal/mixin'], function (exports, _emberMetalMixin) { + 'use strict'; + + QUnit.module('Mixin.detect'); + + QUnit.test('detect() finds a directly applied mixin', function () { + var MixinA = _emberMetalMixin.Mixin.create(); + var obj = {}; + + equal(MixinA.detect(obj), false, 'MixinA.detect(obj) before apply()'); + + MixinA.apply(obj); + equal(MixinA.detect(obj), true, 'MixinA.detect(obj) after apply()'); + }); + + QUnit.test('detect() finds nested mixins', function () { + var MixinA = _emberMetalMixin.Mixin.create({}); + var MixinB = _emberMetalMixin.Mixin.create(MixinA); + var obj = {}; + + equal(MixinA.detect(obj), false, 'MixinA.detect(obj) before apply()'); + + MixinB.apply(obj); + equal(MixinA.detect(obj), true, 'MixinA.detect(obj) after apply()'); + }); + + QUnit.test('detect() finds mixins on other mixins', function () { + var MixinA = _emberMetalMixin.Mixin.create({}); + var MixinB = _emberMetalMixin.Mixin.create(MixinA); + equal(MixinA.detect(MixinB), true, 'MixinA is part of MixinB'); + equal(MixinB.detect(MixinA), false, 'MixinB is not part of MixinA'); + }); + + QUnit.test('detect handles null values', function () { + var MixinA = _emberMetalMixin.Mixin.create(); + equal(MixinA.detect(null), false); + }); +}); +enifed('ember-metal/tests/mixin/detect_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/mixin'); + test('ember-metal/tests/mixin/detect_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/mixin/detect_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/mixin/detect_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/mixin'); + QUnit.test('ember-metal/tests/mixin/detect_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/mixin/detect_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/mixin/introspection_test', ['exports', 'ember-utils', 'ember-metal/mixin'], function (exports, _emberUtils, _emberMetalMixin) { + // NOTE: A previous iteration differentiated between public and private props + // as well as methods vs props. We are just keeping these for testing; the + // current impl doesn't care about the differences as much... + + 'use strict'; + + var PrivateProperty = _emberMetalMixin.Mixin.create({ + _foo: '_FOO' + }); + var PublicProperty = _emberMetalMixin.Mixin.create({ + foo: 'FOO' + }); + var PrivateMethod = _emberMetalMixin.Mixin.create({ + _fooMethod: function () {} + }); + var PublicMethod = _emberMetalMixin.Mixin.create({ + fooMethod: function () {} + }); + var BarProperties = _emberMetalMixin.Mixin.create({ + _bar: '_BAR', + bar: 'bar' + }); + var BarMethods = _emberMetalMixin.Mixin.create({ + _barMethod: function () {}, + barMethod: function () {} + }); + + var Combined = _emberMetalMixin.Mixin.create(BarProperties, BarMethods); + + var obj = undefined; + + QUnit.module('Basic introspection', { + setup: function () { + obj = {}; + _emberMetalMixin.mixin(obj, PrivateProperty, PublicProperty, PrivateMethod, PublicMethod, Combined); + } + }); + + QUnit.test('Ember.mixins()', function () { + function mapGuids(ary) { + return ary.map(function (x) { + return _emberUtils.guidFor(x); + }); + } + + deepEqual(mapGuids(_emberMetalMixin.Mixin.mixins(obj)), mapGuids([PrivateProperty, PublicProperty, PrivateMethod, PublicMethod, Combined, BarProperties, BarMethods]), 'should return included mixins'); + }); +}); +enifed('ember-metal/tests/mixin/introspection_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/mixin'); + test('ember-metal/tests/mixin/introspection_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/mixin/introspection_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/mixin/introspection_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/mixin'); + QUnit.test('ember-metal/tests/mixin/introspection_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/mixin/introspection_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/mixin/merged_properties_test', ['exports', 'ember-runtime', 'ember-metal/property_get', 'ember-metal/mixin'], function (exports, _emberRuntime, _emberMetalProperty_get, _emberMetalMixin) { + 'use strict'; + + QUnit.module('Mixin mergedProperties'); + + QUnit.test('defining mergedProperties should merge future version', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + mergedProperties: ['foo'], + foo: { a: true, b: true, c: true } + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + foo: { d: true, e: true, f: true } + }); + + var obj = _emberMetalMixin.mixin({}, MixinA, MixinB); + deepEqual(_emberMetalProperty_get.get(obj, 'foo'), { a: true, b: true, c: true, d: true, e: true, f: true }); + }); + + QUnit.test('defining mergedProperties on future mixin should merged into past', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + foo: { a: true, b: true, c: true } + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + mergedProperties: ['foo'], + foo: { d: true, e: true, f: true } + }); + + var obj = _emberMetalMixin.mixin({}, MixinA, MixinB); + deepEqual(_emberMetalProperty_get.get(obj, 'foo'), { a: true, b: true, c: true, d: true, e: true, f: true }); + }); + + QUnit.test('defining mergedProperties with null properties should keep properties null', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + mergedProperties: ['foo'], + foo: null + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + foo: null + }); + + var obj = _emberMetalMixin.mixin({}, MixinA, MixinB); + equal(_emberMetalProperty_get.get(obj, 'foo'), null); + }); + + QUnit.test('mergedProperties\' properties can get overwritten', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + mergedProperties: ['foo'], + foo: { a: 1 } + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + foo: { a: 2 } + }); + + var obj = _emberMetalMixin.mixin({}, MixinA, MixinB); + deepEqual(_emberMetalProperty_get.get(obj, 'foo'), { a: 2 }); + }); + + QUnit.test('mergedProperties should be concatenated', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + mergedProperties: ['foo'], + foo: { a: true, b: true, c: true } + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + mergedProperties: 'bar', + foo: { d: true, e: true, f: true }, + bar: { a: true, l: true } + }); + + var MixinC = _emberMetalMixin.Mixin.create({ + bar: { e: true, x: true } + }); + + var obj = _emberMetalMixin.mixin({}, MixinA, MixinB, MixinC); + deepEqual(_emberMetalProperty_get.get(obj, 'mergedProperties'), ['foo', 'bar'], 'get mergedProperties'); + deepEqual(_emberMetalProperty_get.get(obj, 'foo'), { a: true, b: true, c: true, d: true, e: true, f: true }, 'get foo'); + deepEqual(_emberMetalProperty_get.get(obj, 'bar'), { a: true, l: true, e: true, x: true }, 'get bar'); + }); + + QUnit.test('mergedProperties should exist even if not explicitly set on create', function () { + var AnObj = _emberRuntime.Object.extend({ + mergedProperties: ['options'], + options: { + a: 'a', + b: { + c: 'ccc' + } + } + }); + + var obj = AnObj.create({ + options: { + a: 'A' + } + }); + + equal(_emberMetalProperty_get.get(obj, 'options').a, 'A'); + equal(_emberMetalProperty_get.get(obj, 'options').b.c, 'ccc'); + }); + + QUnit.test('defining mergedProperties at create time should not modify the prototype', function () { + var AnObj = _emberRuntime.Object.extend({ + mergedProperties: ['options'], + options: { + a: 1 + } + }); + + var objA = AnObj.create({ + options: { + a: 2 + } + }); + var objB = AnObj.create({ + options: { + a: 3 + } + }); + + equal(_emberMetalProperty_get.get(objA, 'options').a, 2); + equal(_emberMetalProperty_get.get(objB, 'options').a, 3); + }); + + QUnit.test('mergedProperties\' overwriting methods can call _super', function () { + expect(4); + + var MixinA = _emberMetalMixin.Mixin.create({ + mergedProperties: ['foo'], + foo: { + meth: function (a) { + equal(a, 'WOOT', '_super successfully called MixinA\'s `foo.meth` method'); + return 'WAT'; + } + } + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + foo: { + meth: function (a) { + ok(true, 'MixinB\'s `foo.meth` method called'); + return this._super.apply(this, arguments); + } + } + }); + + var MixinC = _emberMetalMixin.Mixin.create({ + foo: { + meth: function (a) { + ok(true, 'MixinC\'s `foo.meth` method called'); + return this._super(a); + } + } + }); + + var obj = _emberMetalMixin.mixin({}, MixinA, MixinB, MixinC); + equal(obj.foo.meth('WOOT'), 'WAT'); + }); + + QUnit.test('Merging an Array should raise an error', function () { + expect(1); + + var MixinA = _emberMetalMixin.Mixin.create({ + mergedProperties: ['foo'], + foo: { a: true, b: true, c: true } + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + foo: ['a'] + }); + + expectAssertion(function () { + _emberMetalMixin.mixin({}, MixinA, MixinB); + }, 'You passed in `["a"]` as the value for `foo` but `foo` cannot be an Array'); + }); +}); +enifed('ember-metal/tests/mixin/merged_properties_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/mixin'); + test('ember-metal/tests/mixin/merged_properties_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/mixin/merged_properties_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/mixin/merged_properties_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/mixin'); + QUnit.test('ember-metal/tests/mixin/merged_properties_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/mixin/merged_properties_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/mixin/method_test', ['exports', 'ember-metal/mixin'], function (exports, _emberMetalMixin) { + 'use strict'; + + QUnit.module('Mixin Methods'); + + QUnit.test('defining simple methods', function () { + var MixinA = undefined, + obj = undefined, + props = undefined; + + props = { + publicMethod: function () { + return 'publicMethod'; + }, + _privateMethod: function () { + return 'privateMethod'; + } + }; + + MixinA = _emberMetalMixin.Mixin.create(props); + obj = {}; + MixinA.apply(obj); + + // but should be defined + equal(props.publicMethod(), 'publicMethod', 'publicMethod is func'); + equal(props._privateMethod(), 'privateMethod', 'privateMethod is func'); + }); + + QUnit.test('overriding public methods', function () { + var MixinA = undefined, + MixinB = undefined, + MixinD = undefined, + MixinF = undefined, + obj = undefined; + + MixinA = _emberMetalMixin.Mixin.create({ + publicMethod: function () { + return 'A'; + } + }); + + MixinB = _emberMetalMixin.Mixin.create(MixinA, { + publicMethod: function () { + return this._super.apply(this, arguments) + 'B'; + } + }); + + MixinD = _emberMetalMixin.Mixin.create(MixinA, { + publicMethod: function () { + return this._super.apply(this, arguments) + 'D'; + } + }); + + MixinF = _emberMetalMixin.Mixin.create({ + publicMethod: function () { + return this._super.apply(this, arguments) + 'F'; + } + }); + + obj = {}; + MixinB.apply(obj); + equal(obj.publicMethod(), 'AB', 'should define super for A and B'); + + obj = {}; + MixinD.apply(obj); + equal(obj.publicMethod(), 'AD', 'should define super for A and B'); + + obj = {}; + MixinA.apply(obj); + MixinF.apply(obj); + equal(obj.publicMethod(), 'AF', 'should define super for A and F'); + + obj = { publicMethod: function () { + return 'obj'; + } }; + MixinF.apply(obj); + equal(obj.publicMethod(), 'objF', 'should define super for F'); + }); + + QUnit.test('overriding inherited objects', function () { + var cnt = 0; + var MixinA = _emberMetalMixin.Mixin.create({ + foo: function () { + cnt++; + } + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + foo: function () { + this._super.apply(this, arguments); + cnt++; + } + }); + + var objA = {}; + MixinA.apply(objA); + + var objB = Object.create(objA); + MixinB.apply(objB); + + cnt = 0; + objB.foo(); + equal(cnt, 2, 'should invoke both methods'); + + cnt = 0; + objA.foo(); + equal(cnt, 1, 'should not screw w/ parent obj'); + }); + + QUnit.test('Including the same mixin more than once will only run once', function () { + var cnt = 0; + var MixinA = _emberMetalMixin.Mixin.create({ + foo: function () { + cnt++; + } + }); + + var MixinB = _emberMetalMixin.Mixin.create(MixinA, { + foo: function () { + this._super.apply(this, arguments); + } + }); + + var MixinC = _emberMetalMixin.Mixin.create(MixinA, { + foo: function () { + this._super.apply(this, arguments); + } + }); + + var MixinD = _emberMetalMixin.Mixin.create(MixinB, MixinC, MixinA, { + foo: function () { + this._super.apply(this, arguments); + } + }); + + var obj = {}; + MixinD.apply(obj); + MixinA.apply(obj); // try to apply again.. + + cnt = 0; + obj.foo(); + + equal(cnt, 1, 'should invoke MixinA.foo one time'); + }); + + QUnit.test('_super from a single mixin with no superclass does not error', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + foo: function () { + this._super.apply(this, arguments); + } + }); + + var obj = {}; + MixinA.apply(obj); + + obj.foo(); + ok(true); + }); + + QUnit.test('_super from a first-of-two mixins with no superclass function does not error', function () { + // _super was previously calling itself in the second assertion. + // Use remaining count of calls to ensure it doesn't loop indefinitely. + var remaining = 3; + var MixinA = _emberMetalMixin.Mixin.create({ + foo: function () { + if (remaining-- > 0) { + this._super.apply(this, arguments); + } + } + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + foo: function () { + this._super.apply(this, arguments); + } + }); + + var obj = {}; + MixinA.apply(obj); + MixinB.apply(obj); + + obj.foo(); + ok(true); + }); + + // .......................................................... + // CONFLICTS + // + + QUnit.module('Method Conflicts'); + + QUnit.test('overriding toString', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + toString: function () { + return 'FOO'; + } + }); + + var obj = {}; + MixinA.apply(obj); + equal(obj.toString(), 'FOO', 'should override toString w/o error'); + + obj = {}; + _emberMetalMixin.mixin(obj, { toString: function () { + return 'FOO'; + } }); + equal(obj.toString(), 'FOO', 'should override toString w/o error'); + }); + + // .......................................................... + // BUGS + // + + QUnit.module('system/mixin/method_test BUGS'); + + QUnit.test('applying several mixins at once with sup already defined causes infinite loop', function () { + var cnt = 0; + var MixinA = _emberMetalMixin.Mixin.create({ + foo: function () { + cnt++; + } + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + foo: function () { + this._super.apply(this, arguments); + cnt++; + } + }); + + var MixinC = _emberMetalMixin.Mixin.create({ + foo: function () { + this._super.apply(this, arguments); + cnt++; + } + }); + + var obj = {}; + _emberMetalMixin.mixin(obj, MixinA); // sup already exists + _emberMetalMixin.mixin(obj, MixinB, MixinC); // must be more than one mixin + + cnt = 0; + obj.foo(); + equal(cnt, 3, 'should invoke all 3 methods'); + }); +}); +enifed('ember-metal/tests/mixin/method_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/mixin'); + test('ember-metal/tests/mixin/method_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/mixin/method_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/mixin/method_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/mixin'); + QUnit.test('ember-metal/tests/mixin/method_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/mixin/method_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/mixin/observer_test', ['exports', 'internal-test-helpers', 'ember-metal/mixin', 'ember-metal/watching'], function (exports, _internalTestHelpers, _emberMetalMixin, _emberMetalWatching) { + 'use strict'; + + QUnit.module('Mixin observer'); + + _internalTestHelpers.testBoth('global observer helper', function (get, set) { + var MyMixin = _emberMetalMixin.Mixin.create({ + + count: 0, + + foo: _emberMetalMixin.observer('bar', function () { + set(this, 'count', get(this, 'count') + 1); + }) + + }); + + var obj = _emberMetalMixin.mixin({}, MyMixin); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj, 'bar', 'BAZ'); + equal(get(obj, 'count'), 1, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('global observer helper takes multiple params', function (get, set) { + var MyMixin = _emberMetalMixin.Mixin.create({ + + count: 0, + + foo: _emberMetalMixin.observer('bar', 'baz', function () { + set(this, 'count', get(this, 'count') + 1); + }) + + }); + + var obj = _emberMetalMixin.mixin({}, MyMixin); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj, 'bar', 'BAZ'); + set(obj, 'baz', 'BAZ'); + equal(get(obj, 'count'), 2, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('replacing observer should remove old observer', function (get, set) { + var MyMixin = _emberMetalMixin.Mixin.create({ + + count: 0, + + foo: _emberMetalMixin.observer('bar', function () { + set(this, 'count', get(this, 'count') + 1); + }) + + }); + + var Mixin2 = _emberMetalMixin.Mixin.create({ + foo: _emberMetalMixin.observer('baz', function () { + set(this, 'count', get(this, 'count') + 10); + }) + }); + + var obj = _emberMetalMixin.mixin({}, MyMixin, Mixin2); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj, 'bar', 'BAZ'); + equal(get(obj, 'count'), 0, 'should not invoke observer after change'); + + set(obj, 'baz', 'BAZ'); + equal(get(obj, 'count'), 10, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('observing chain with property before', function (get, set) { + var obj2 = { baz: 'baz' }; + + var MyMixin = _emberMetalMixin.Mixin.create({ + count: 0, + bar: obj2, + foo: _emberMetalMixin.observer('bar.baz', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }); + + var obj = _emberMetalMixin.mixin({}, MyMixin); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj2, 'baz', 'BAZ'); + equal(get(obj, 'count'), 1, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('observing chain with property after', function (get, set) { + var obj2 = { baz: 'baz' }; + + var MyMixin = _emberMetalMixin.Mixin.create({ + count: 0, + foo: _emberMetalMixin.observer('bar.baz', function () { + set(this, 'count', get(this, 'count') + 1); + }), + bar: obj2 + }); + + var obj = _emberMetalMixin.mixin({}, MyMixin); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj2, 'baz', 'BAZ'); + equal(get(obj, 'count'), 1, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('observing chain with property in mixin applied later', function (get, set) { + var obj2 = { baz: 'baz' }; + + var MyMixin = _emberMetalMixin.Mixin.create({ + + count: 0, + foo: _emberMetalMixin.observer('bar.baz', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }); + + var MyMixin2 = _emberMetalMixin.Mixin.create({ bar: obj2 }); + + var obj = _emberMetalMixin.mixin({}, MyMixin); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + MyMixin2.apply(obj); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj2, 'baz', 'BAZ'); + equal(get(obj, 'count'), 1, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('observing chain with existing property', function (get, set) { + var obj2 = { baz: 'baz' }; + + var MyMixin = _emberMetalMixin.Mixin.create({ + count: 0, + foo: _emberMetalMixin.observer('bar.baz', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }); + + var obj = _emberMetalMixin.mixin({ bar: obj2 }, MyMixin); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj2, 'baz', 'BAZ'); + equal(get(obj, 'count'), 1, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('observing chain with property in mixin before', function (get, set) { + var obj2 = { baz: 'baz' }; + var MyMixin2 = _emberMetalMixin.Mixin.create({ bar: obj2 }); + + var MyMixin = _emberMetalMixin.Mixin.create({ + count: 0, + foo: _emberMetalMixin.observer('bar.baz', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }); + + var obj = _emberMetalMixin.mixin({}, MyMixin2, MyMixin); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj2, 'baz', 'BAZ'); + equal(get(obj, 'count'), 1, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('observing chain with property in mixin after', function (get, set) { + var obj2 = { baz: 'baz' }; + var MyMixin2 = _emberMetalMixin.Mixin.create({ bar: obj2 }); + + var MyMixin = _emberMetalMixin.Mixin.create({ + count: 0, + foo: _emberMetalMixin.observer('bar.baz', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }); + + var obj = _emberMetalMixin.mixin({}, MyMixin, MyMixin2); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj2, 'baz', 'BAZ'); + equal(get(obj, 'count'), 1, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('observing chain with overriden property', function (get, set) { + var obj2 = { baz: 'baz' }; + var obj3 = { baz: 'foo' }; + + var MyMixin2 = _emberMetalMixin.Mixin.create({ bar: obj3 }); + + var MyMixin = _emberMetalMixin.Mixin.create({ + count: 0, + foo: _emberMetalMixin.observer('bar.baz', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }); + + var obj = _emberMetalMixin.mixin({ bar: obj2 }, MyMixin, MyMixin2); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + equal(_emberMetalWatching.isWatching(obj2, 'baz'), false, 'should not be watching baz'); + equal(_emberMetalWatching.isWatching(obj3, 'baz'), true, 'should be watching baz'); + + set(obj2, 'baz', 'BAZ'); + equal(get(obj, 'count'), 0, 'should not invoke observer after change'); + + set(obj3, 'baz', 'BEAR'); + equal(get(obj, 'count'), 1, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('providing the arguments in reverse order is deprecated', function (get, set) { + expectDeprecation(/Passing the dependentKeys after the callback function in Ember\.observer is deprecated. Ensure the callback function is the last argument/); + + _emberMetalMixin.Mixin.create({ + count: 0, + foo: _emberMetalMixin.observer(function () { + set(this, 'count', get(this, 'count') + 1); + }, 'bar.baz') + }); + }); +}); +enifed('ember-metal/tests/mixin/observer_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/mixin'); + test('ember-metal/tests/mixin/observer_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/mixin/observer_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/mixin/observer_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/mixin'); + QUnit.test('ember-metal/tests/mixin/observer_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/mixin/observer_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/mixin/reopen_test', ['exports', 'ember-metal/run_loop', 'ember-metal/property_get', 'ember-runtime', 'ember-metal/mixin'], function (exports, _emberMetalRun_loop, _emberMetalProperty_get, _emberRuntime, _emberMetalMixin) { + 'use strict'; + + QUnit.module('Ember.Mixin#reopen'); + + QUnit.test('using reopen() to add more properties to a simple', function () { + var MixinA = _emberMetalMixin.default.create({ foo: 'FOO', baz: 'BAZ' }); + MixinA.reopen({ bar: 'BAR', foo: 'FOO2' }); + var obj = {}; + MixinA.apply(obj); + + equal(_emberMetalProperty_get.default(obj, 'foo'), 'FOO2', 'mixin() should override'); + equal(_emberMetalProperty_get.default(obj, 'baz'), 'BAZ', 'preserve MixinA props'); + equal(_emberMetalProperty_get.default(obj, 'bar'), 'BAR', 'include MixinB props'); + }); + + QUnit.test('using reopen() and calling _super where there is not a super function does not cause infinite recursion', function () { + var Taco = _emberRuntime.Object.extend({ + createBreakfast: function () { + // There is no original createBreakfast function. + // Calling the wrapped _super function here + // used to end in an infinite call loop + this._super.apply(this, arguments); + return 'Breakfast!'; + } + }); + + Taco.reopen({ + createBreakfast: function () { + return this._super.apply(this, arguments); + } + }); + + var taco = Taco.create(); + + var result = undefined; + _emberMetalRun_loop.default(function () { + try { + result = taco.createBreakfast(); + } catch (e) { + result = 'Your breakfast was interrupted by an infinite stack error.'; + } + }); + + equal(result, 'Breakfast!'); + }); +}); +enifed('ember-metal/tests/mixin/reopen_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/mixin'); + test('ember-metal/tests/mixin/reopen_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/mixin/reopen_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/mixin/reopen_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/mixin'); + QUnit.test('ember-metal/tests/mixin/reopen_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/mixin/reopen_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/mixin/required_test', ['exports', 'ember-metal/mixin', 'ember-metal/property_get'], function (exports, _emberMetalMixin, _emberMetalProperty_get) { + 'use strict'; + + var PartialMixin = undefined, + FinalMixin = undefined, + obj = undefined; + + QUnit.module('Module.required', { + setup: function () { + expectDeprecation(function () { + PartialMixin = _emberMetalMixin.Mixin.create({ + foo: _emberMetalMixin.required(), + bar: 'BAR' + }); + }, 'Ember.required is deprecated as its behavior is inconsistent and unreliable.'); + + FinalMixin = _emberMetalMixin.Mixin.create({ + foo: 'FOO' + }); + + obj = {}; + }, + + teardown: function () { + PartialMixin = FinalMixin = obj = null; + } + }); + + QUnit.test('applying a mixin to meet requirement', function () { + FinalMixin.apply(obj); + PartialMixin.apply(obj); + equal(_emberMetalProperty_get.get(obj, 'foo'), 'FOO', 'should now be defined'); + }); + + QUnit.test('combined mixins to meet requirement', function () { + _emberMetalMixin.Mixin.create(PartialMixin, FinalMixin).apply(obj); + equal(_emberMetalProperty_get.get(obj, 'foo'), 'FOO', 'should now be defined'); + }); + + QUnit.test('merged mixin', function () { + _emberMetalMixin.Mixin.create(PartialMixin, { foo: 'FOO' }).apply(obj); + equal(_emberMetalProperty_get.get(obj, 'foo'), 'FOO', 'should now be defined'); + }); + + QUnit.test('define property on source object', function () { + obj.foo = 'FOO'; + PartialMixin.apply(obj); + equal(_emberMetalProperty_get.get(obj, 'foo'), 'FOO', 'should now be defined'); + }); + + QUnit.test('using apply', function () { + _emberMetalMixin.mixin(obj, PartialMixin, { foo: 'FOO' }); + equal(_emberMetalProperty_get.get(obj, 'foo'), 'FOO', 'should now be defined'); + }); +}); +enifed('ember-metal/tests/mixin/required_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/mixin'); + test('ember-metal/tests/mixin/required_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/mixin/required_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/mixin/required_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/mixin'); + QUnit.test('ember-metal/tests/mixin/required_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/mixin/required_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/mixin/without_test', ['exports', 'ember-metal/mixin'], function (exports, _emberMetalMixin) { + 'use strict'; + + QUnit.test('without should create a new mixin excluding named properties', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + foo: 'FOO', + bar: 'BAR' + }); + + var MixinB = MixinA.without('bar'); + + var obj = {}; + MixinB.apply(obj); + + equal(obj.foo, 'FOO', 'should defined foo'); + equal(obj.bar, undefined, 'should not define bar'); + }); +}); +enifed('ember-metal/tests/mixin/without_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/mixin'); + test('ember-metal/tests/mixin/without_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/mixin/without_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/mixin/without_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/mixin'); + QUnit.test('ember-metal/tests/mixin/without_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/mixin/without_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/observer_test', ['exports', 'ember-environment', 'internal-test-helpers', 'ember-metal/observer', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/mixin', 'ember-metal/run_loop'], function (exports, _emberEnvironment, _internalTestHelpers, _emberMetalObserver, _emberMetalProperty_events, _emberMetalProperties, _emberMetalComputed, _emberMetalMixin, _emberMetalRun_loop) { + 'use strict'; + + function K() {} + + // .......................................................... + // ADD OBSERVER + // + + QUnit.module('addObserver'); + + _internalTestHelpers.testBoth('observer should fire when property is modified', function (get, set) { + var obj = {}; + var count = 0; + + _emberMetalObserver.addObserver(obj, 'foo', function () { + equal(get(obj, 'foo'), 'bar', 'should invoke AFTER value changed'); + count++; + }); + + set(obj, 'foo', 'bar'); + equal(count, 1, 'should have invoked observer'); + }); + + _internalTestHelpers.testBoth('observer should fire when dependent property is modified', function (get, set) { + var obj = { bar: 'bar' }; + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed(function () { + return get(this, 'bar').toUpperCase(); + }).property('bar')); + + get(obj, 'foo'); + + var count = 0; + _emberMetalObserver.addObserver(obj, 'foo', function () { + equal(get(obj, 'foo'), 'BAZ', 'should have invoked after prop change'); + count++; + }); + + set(obj, 'bar', 'baz'); + equal(count, 1, 'should have invoked observer'); + }); + + _internalTestHelpers.testBoth('observer should continue to fire after dependent properties are accessed', function (get, set) { + var observerCount = 0; + var obj = {}; + + _emberMetalProperties.defineProperty(obj, 'prop', _emberMetalComputed.computed(function () { + return Math.random(); + })); + _emberMetalProperties.defineProperty(obj, 'anotherProp', _emberMetalComputed.computed('prop', function () { + return get(this, 'prop') + Math.random(); + })); + + _emberMetalObserver.addObserver(obj, 'prop', function () { + observerCount++; + }); + + get(obj, 'anotherProp'); + + for (var i = 0; i < 10; i++) { + _emberMetalProperty_events.propertyWillChange(obj, 'prop'); + _emberMetalProperty_events.propertyDidChange(obj, 'prop'); + } + + equal(observerCount, 10, 'should continue to fire indefinitely'); + }); + + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.Function) { + _internalTestHelpers.testBoth('observer added declaratively via brace expansion should fire when property changes', function (get, set) { + var obj = {}; + var count = 0; + + _emberMetalMixin.mixin(obj, { + observeFooAndBar: (function () { + count++; + }).observes('{foo,bar}') + }); + + set(obj, 'foo', 'foo'); + equal(count, 1, 'observer specified via brace expansion invoked on property change'); + + set(obj, 'bar', 'bar'); + equal(count, 2, 'observer specified via brace expansion invoked on property change'); + + set(obj, 'baz', 'baz'); + equal(count, 2, 'observer not invoked on unspecified property'); + }); + + _internalTestHelpers.testBoth('observer specified declaratively via brace expansion should fire when dependent property changes', function (get, set) { + var obj = { baz: 'Initial' }; + var count = 0; + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed(function () { + return get(this, 'bar').toLowerCase(); + }).property('bar')); + + _emberMetalProperties.defineProperty(obj, 'bar', _emberMetalComputed.computed(function () { + return get(this, 'baz').toUpperCase(); + }).property('baz')); + + _emberMetalMixin.mixin(obj, { + fooAndBarWatcher: (function () { + count++; + }).observes('{foo,bar}') + }); + + get(obj, 'foo'); + set(obj, 'baz', 'Baz'); + // fire once for foo, once for bar + equal(count, 2, 'observer specified via brace expansion invoked on dependent property change'); + + set(obj, 'quux', 'Quux'); + equal(count, 2, 'observer not fired on unspecified property'); + }); + } + + _internalTestHelpers.testBoth('observers watching multiple properties via brace expansion should fire when the properties change', function (get, set) { + var obj = {}; + var count = 0; + + _emberMetalMixin.mixin(obj, { + observeFooAndBar: _emberMetalMixin.observer('{foo,bar}', function () { + count++; + }) + }); + + set(obj, 'foo', 'foo'); + equal(count, 1, 'observer specified via brace expansion invoked on property change'); + + set(obj, 'bar', 'bar'); + equal(count, 2, 'observer specified via brace expansion invoked on property change'); + + set(obj, 'baz', 'baz'); + equal(count, 2, 'observer not invoked on unspecified property'); + }); + + _internalTestHelpers.testBoth('observers watching multiple properties via brace expansion should fire when dependent properties change', function (get, set) { + var obj = { baz: 'Initial' }; + var count = 0; + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed(function () { + return get(this, 'bar').toLowerCase(); + }).property('bar')); + + _emberMetalProperties.defineProperty(obj, 'bar', _emberMetalComputed.computed(function () { + return get(this, 'baz').toUpperCase(); + }).property('baz')); + + _emberMetalMixin.mixin(obj, { + fooAndBarWatcher: _emberMetalMixin.observer('{foo,bar}', function () { + count++; + }) + }); + + get(obj, 'foo'); + set(obj, 'baz', 'Baz'); + // fire once for foo, once for bar + equal(count, 2, 'observer specified via brace expansion invoked on dependent property change'); + + set(obj, 'quux', 'Quux'); + equal(count, 2, 'observer not fired on unspecified property'); + }); + + _internalTestHelpers.testBoth('nested observers should fire in order', function (get, set) { + var obj = { foo: 'foo', bar: 'bar' }; + var fooCount = 0; + var barCount = 0; + + _emberMetalObserver.addObserver(obj, 'foo', function () { + fooCount++; + }); + _emberMetalObserver.addObserver(obj, 'bar', function () { + set(obj, 'foo', 'BAZ'); + equal(fooCount, 1, 'fooCount should have fired already'); + barCount++; + }); + + set(obj, 'bar', 'BIFF'); + equal(barCount, 1, 'barCount should have fired'); + equal(fooCount, 1, 'foo should have fired'); + }); + + _internalTestHelpers.testBoth('removing an chain observer on change should not fail', function (get, set) { + var foo = { bar: 'bar' }; + var obj1 = { foo: foo }; + var obj2 = { foo: foo }; + var obj3 = { foo: foo }; + var obj4 = { foo: foo }; + var count1 = 0; + var count2 = 0; + var count3 = 0; + var count4 = 0; + + function observer1() { + count1++; + } + function observer2() { + count2++; + } + function observer3() { + count3++; + _emberMetalObserver.removeObserver(obj1, 'foo.bar', observer1); + _emberMetalObserver.removeObserver(obj2, 'foo.bar', observer2); + _emberMetalObserver.removeObserver(obj4, 'foo.bar', observer4); + } + function observer4() { + count4++; + } + + _emberMetalObserver.addObserver(obj1, 'foo.bar', observer1); + _emberMetalObserver.addObserver(obj2, 'foo.bar', observer2); + _emberMetalObserver.addObserver(obj3, 'foo.bar', observer3); + _emberMetalObserver.addObserver(obj4, 'foo.bar', observer4); + + set(foo, 'bar', 'baz'); + + equal(count1, 1, 'observer1 fired'); + equal(count2, 1, 'observer2 fired'); + equal(count3, 1, 'observer3 fired'); + equal(count4, 0, 'observer4 did not fire'); + }); + + _internalTestHelpers.testBoth('removing an chain before observer on change should not fail', function (get, set) { + var foo = { bar: 'bar' }; + var obj1 = { foo: foo }; + var obj2 = { foo: foo }; + var obj3 = { foo: foo }; + var obj4 = { foo: foo }; + var count1 = 0; + var count2 = 0; + var count3 = 0; + var count4 = 0; + + function observer1() { + count1++; + } + function observer2() { + count2++; + } + function observer3() { + count3++; + _emberMetalObserver._removeBeforeObserver(obj1, 'foo.bar', observer1); + _emberMetalObserver._removeBeforeObserver(obj2, 'foo.bar', observer2); + _emberMetalObserver._removeBeforeObserver(obj4, 'foo.bar', observer4); + } + function observer4() { + count4++; + } + + _emberMetalObserver._addBeforeObserver(obj1, 'foo.bar', observer1); + _emberMetalObserver._addBeforeObserver(obj2, 'foo.bar', observer2); + _emberMetalObserver._addBeforeObserver(obj3, 'foo.bar', observer3); + _emberMetalObserver._addBeforeObserver(obj4, 'foo.bar', observer4); + + set(foo, 'bar', 'baz'); + + equal(count1, 1, 'observer1 fired'); + equal(count2, 1, 'observer2 fired'); + equal(count3, 1, 'observer3 fired'); + equal(count4, 0, 'observer4 did not fire'); + }); + + _internalTestHelpers.testBoth('suspending an observer should not fire during callback', function (get, set) { + var obj = {}; + var target = undefined, + otherTarget = undefined; + + target = { + values: [], + method: function () { + this.values.push(get(obj, 'foo')); + } + }; + + otherTarget = { + values: [], + method: function () { + this.values.push(get(obj, 'foo')); + } + }; + + _emberMetalObserver.addObserver(obj, 'foo', target, target.method); + _emberMetalObserver.addObserver(obj, 'foo', otherTarget, otherTarget.method); + + function callback() { + /*jshint validthis:true */ + equal(this, target); + + set(obj, 'foo', '2'); + + return 'result'; + } + + set(obj, 'foo', '1'); + + equal(_emberMetalObserver._suspendObserver(obj, 'foo', target, target.method, callback), 'result'); + + set(obj, 'foo', '3'); + + deepEqual(target.values, ['1', '3'], 'should invoke'); + deepEqual(otherTarget.values, ['1', '2', '3'], 'should invoke'); + }); + + _internalTestHelpers.testBoth('suspending an observer should not defer change notifications during callback', function (get, set) { + var obj = {}; + var target = undefined, + otherTarget = undefined; + + target = { + values: [], + method: function () { + this.values.push(get(obj, 'foo')); + } + }; + + otherTarget = { + values: [], + method: function () { + this.values.push(get(obj, 'foo')); + } + }; + + _emberMetalObserver.addObserver(obj, 'foo', target, target.method); + _emberMetalObserver.addObserver(obj, 'foo', otherTarget, otherTarget.method); + + function callback() { + /*jshint validthis:true */ + equal(this, target); + + set(obj, 'foo', '2'); + + return 'result'; + } + + set(obj, 'foo', '1'); + + _emberMetalProperty_events.beginPropertyChanges(); + equal(_emberMetalObserver._suspendObserver(obj, 'foo', target, target.method, callback), 'result'); + _emberMetalProperty_events.endPropertyChanges(); + + set(obj, 'foo', '3'); + + deepEqual(target.values, ['1', '3'], 'should invoke'); + deepEqual(otherTarget.values, ['1', '2', '3'], 'should invoke'); + }); + + _internalTestHelpers.testBoth('suspending observers should not fire during callback', function (get, set) { + var obj = {}; + var target = undefined, + otherTarget = undefined; + + target = { + values: [], + method: function () { + this.values.push(get(obj, 'foo')); + } + }; + + otherTarget = { + values: [], + method: function () { + this.values.push(get(obj, 'foo')); + } + }; + + _emberMetalObserver.addObserver(obj, 'foo', target, target.method); + _emberMetalObserver.addObserver(obj, 'foo', otherTarget, otherTarget.method); + + function callback() { + /*jshint validthis:true */ + equal(this, target); + + set(obj, 'foo', '2'); + + return 'result'; + } + + set(obj, 'foo', '1'); + + equal(_emberMetalObserver._suspendObservers(obj, ['foo'], target, target.method, callback), 'result'); + + set(obj, 'foo', '3'); + + deepEqual(target.values, ['1', '3'], 'should invoke'); + deepEqual(otherTarget.values, ['1', '2', '3'], 'should invoke'); + }); + + _internalTestHelpers.testBoth('suspending observers should not defer change notifications during callback', function (get, set) { + var obj = {}; + var target = undefined, + otherTarget = undefined; + + target = { + values: [], + method: function () { + this.values.push(get(obj, 'foo')); + } + }; + + otherTarget = { + values: [], + method: function () { + this.values.push(get(obj, 'foo')); + } + }; + + _emberMetalObserver.addObserver(obj, 'foo', target, target.method); + _emberMetalObserver.addObserver(obj, 'foo', otherTarget, otherTarget.method); + + function callback() { + /*jshint validthis:true */ + equal(this, target); + + set(obj, 'foo', '2'); + + return 'result'; + } + + set(obj, 'foo', '1'); + + _emberMetalProperty_events.beginPropertyChanges(); + equal(_emberMetalObserver._suspendObservers(obj, ['foo'], target, target.method, callback), 'result'); + _emberMetalProperty_events.endPropertyChanges(); + + set(obj, 'foo', '3'); + + deepEqual(target.values, ['1', '3'], 'should invoke'); + deepEqual(otherTarget.values, ['1', '2', '3'], 'should invoke'); + }); + + _internalTestHelpers.testBoth('deferring property change notifications', function (get, set) { + var obj = { foo: 'foo' }; + var fooCount = 0; + + _emberMetalObserver.addObserver(obj, 'foo', function () { + fooCount++; + }); + + _emberMetalProperty_events.beginPropertyChanges(obj); + set(obj, 'foo', 'BIFF'); + set(obj, 'foo', 'BAZ'); + _emberMetalProperty_events.endPropertyChanges(obj); + + equal(fooCount, 1, 'foo should have fired once'); + }); + + _internalTestHelpers.testBoth('deferring property change notifications safely despite exceptions', function (get, set) { + var obj = { foo: 'foo' }; + var fooCount = 0; + var exc = new Error('Something unexpected happened!'); + + expect(2); + _emberMetalObserver.addObserver(obj, 'foo', function () { + fooCount++; + }); + + try { + _emberMetalProperty_events.changeProperties(function () { + set(obj, 'foo', 'BIFF'); + set(obj, 'foo', 'BAZ'); + throw exc; + }); + } catch (err) { + if (err !== exc) { + throw err; + } + } + + equal(fooCount, 1, 'foo should have fired once'); + + _emberMetalProperty_events.changeProperties(function () { + set(obj, 'foo', 'BIFF2'); + set(obj, 'foo', 'BAZ2'); + }); + + equal(fooCount, 2, 'foo should have fired again once'); + }); + + _internalTestHelpers.testBoth('deferring property change notifications will not defer before observers', function (get, set) { + var obj = { foo: 'foo' }; + var fooCount = 0; + + _emberMetalObserver._addBeforeObserver(obj, 'foo', function () { + fooCount++; + }); + + _emberMetalProperty_events.beginPropertyChanges(obj); + set(obj, 'foo', 'BIFF'); + equal(fooCount, 1, 'should fire before observer immediately'); + set(obj, 'foo', 'BAZ'); + _emberMetalProperty_events.endPropertyChanges(obj); + + equal(fooCount, 1, 'should not fire before observer twice'); + }); + + _internalTestHelpers.testBoth('addObserver should propagate through prototype', function (get, set) { + var obj = { foo: 'foo', count: 0 }; + var obj2 = undefined; + + _emberMetalObserver.addObserver(obj, 'foo', function () { + this.count++; + }); + obj2 = Object.create(obj); + + set(obj2, 'foo', 'bar'); + + equal(obj2.count, 1, 'should have invoked observer on inherited'); + equal(obj.count, 0, 'should not have invoked observer on parent'); + + obj2.count = 0; + set(obj, 'foo', 'baz'); + equal(obj.count, 1, 'should have invoked observer on parent'); + equal(obj2.count, 0, 'should not have invoked observer on inherited'); + }); + + _internalTestHelpers.testBoth('addObserver should respect targets with methods', function (get, set) { + var observed = { foo: 'foo' }; + + var target1 = { + count: 0, + + didChange: function (obj, keyName) { + var value = get(obj, keyName); + equal(this, target1, 'should invoke with this'); + equal(obj, observed, 'param1 should be observed object'); + equal(keyName, 'foo', 'param2 should be keyName'); + equal(value, 'BAZ', 'param3 should new value'); + this.count++; + } + }; + + var target2 = { + count: 0, + + didChange: function (obj, keyName) { + var value = get(obj, keyName); + equal(this, target2, 'should invoke with this'); + equal(obj, observed, 'param1 should be observed object'); + equal(keyName, 'foo', 'param2 should be keyName'); + equal(value, 'BAZ', 'param3 should new value'); + this.count++; + } + }; + + _emberMetalObserver.addObserver(observed, 'foo', target1, 'didChange'); + _emberMetalObserver.addObserver(observed, 'foo', target2, target2.didChange); + + set(observed, 'foo', 'BAZ'); + equal(target1.count, 1, 'target1 observer should have fired'); + equal(target2.count, 1, 'target2 observer should have fired'); + }); + + _internalTestHelpers.testBoth('addObserver should allow multiple objects to observe a property', function (get, set) { + var observed = { foo: 'foo' }; + + var target1 = { + count: 0, + + didChange: function (obj, keyName, value) { + this.count++; + } + }; + + var target2 = { + count: 0, + + didChange: function (obj, keyName, value) { + this.count++; + } + }; + + _emberMetalObserver.addObserver(observed, 'foo', target1, 'didChange'); + _emberMetalObserver.addObserver(observed, 'foo', target2, 'didChange'); + + set(observed, 'foo', 'BAZ'); + equal(target1.count, 1, 'target1 observer should have fired'); + equal(target2.count, 1, 'target2 observer should have fired'); + }); + + // .......................................................... + // REMOVE OBSERVER + // + + QUnit.module('removeObserver'); + + _internalTestHelpers.testBoth('removing observer should stop firing', function (get, set) { + var obj = {}; + var count = 0; + function F() { + count++; + } + _emberMetalObserver.addObserver(obj, 'foo', F); + + set(obj, 'foo', 'bar'); + equal(count, 1, 'should have invoked observer'); + + _emberMetalObserver.removeObserver(obj, 'foo', F); + + set(obj, 'foo', 'baz'); + equal(count, 1, 'removed observer shouldn\'t fire'); + }); + + _internalTestHelpers.testBoth('local observers can be removed', function (get, set) { + var barObserved = 0; + + var MyMixin = _emberMetalMixin.Mixin.create({ + foo1: _emberMetalMixin.observer('bar', function () { + barObserved++; + }), + + foo2: _emberMetalMixin.observer('bar', function () { + barObserved++; + }) + }); + + var obj = {}; + MyMixin.apply(obj); + + set(obj, 'bar', 'HI!'); + equal(barObserved, 2, 'precond - observers should be fired'); + + _emberMetalObserver.removeObserver(obj, 'bar', null, 'foo1'); + + barObserved = 0; + set(obj, 'bar', 'HI AGAIN!'); + + equal(barObserved, 1, 'removed observers should not be called'); + }); + + _internalTestHelpers.testBoth('removeObserver should respect targets with methods', function (get, set) { + var observed = { foo: 'foo' }; + + var target1 = { + count: 0, + + didChange: function () { + this.count++; + } + }; + + var target2 = { + count: 0, + + didChange: function () { + this.count++; + } + }; + + _emberMetalObserver.addObserver(observed, 'foo', target1, 'didChange'); + _emberMetalObserver.addObserver(observed, 'foo', target2, target2.didChange); + + set(observed, 'foo', 'BAZ'); + equal(target1.count, 1, 'target1 observer should have fired'); + equal(target2.count, 1, 'target2 observer should have fired'); + + _emberMetalObserver.removeObserver(observed, 'foo', target1, 'didChange'); + _emberMetalObserver.removeObserver(observed, 'foo', target2, target2.didChange); + + target1.count = target2.count = 0; + set(observed, 'foo', 'BAZ'); + equal(target1.count, 0, 'target1 observer should not fire again'); + equal(target2.count, 0, 'target2 observer should not fire again'); + }); + + // .......................................................... + // BEFORE OBSERVER + // + + QUnit.module('_addBeforeObserver'); + + _internalTestHelpers.testBoth('observer should fire before a property is modified', function (get, set) { + var obj = { foo: 'foo' }; + var count = 0; + + _emberMetalObserver._addBeforeObserver(obj, 'foo', function () { + equal(get(obj, 'foo'), 'foo', 'should invoke before value changed'); + count++; + }); + + set(obj, 'foo', 'bar'); + equal(count, 1, 'should have invoked observer'); + }); + + _internalTestHelpers.testBoth('observer should fire before dependent property is modified', function (get, set) { + var obj = { bar: 'bar' }; + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed(function () { + return get(this, 'bar').toUpperCase(); + }).property('bar')); + + get(obj, 'foo'); + + var count = 0; + _emberMetalObserver._addBeforeObserver(obj, 'foo', function () { + equal(get(obj, 'foo'), 'BAR', 'should have invoked after prop change'); + count++; + }); + + set(obj, 'bar', 'baz'); + equal(count, 1, 'should have invoked observer'); + }); + + _internalTestHelpers.testBoth('before observer watching multiple properties via brace expansion should fire when properties change', function (get, set) { + var obj = {}; + var count = 0; + + _emberMetalMixin.mixin(obj, { + fooAndBarWatcher: _emberMetalMixin._beforeObserver('{foo,bar}', function () { + count++; + }) + }); + + set(obj, 'foo', 'foo'); + equal(count, 1, 'observer specified via brace expansion invoked on property change'); + + set(obj, 'bar', 'bar'); + equal(count, 2, 'observer specified via brace expansion invoked on property change'); + + set(obj, 'baz', 'baz'); + equal(count, 2, 'observer not invoked on unspecified property'); + }); + + _internalTestHelpers.testBoth('before observer watching multiple properties via brace expansion should fire when dependent property changes', function (get, set) { + var obj = { baz: 'Initial' }; + var count = 0; + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed(function () { + return get(this, 'bar').toLowerCase(); + }).property('bar')); + + _emberMetalProperties.defineProperty(obj, 'bar', _emberMetalComputed.computed(function () { + return get(this, 'baz').toUpperCase(); + }).property('baz')); + + _emberMetalMixin.mixin(obj, { + fooAndBarWatcher: _emberMetalMixin._beforeObserver('{foo,bar}', function () { + count++; + }) + }); + + get(obj, 'foo'); + set(obj, 'baz', 'Baz'); + // fire once for foo, once for bar + equal(count, 2, 'observer specified via brace expansion invoked on dependent property change'); + + set(obj, 'quux', 'Quux'); + equal(count, 2, 'observer not fired on unspecified property'); + }); + + _internalTestHelpers.testBoth('_addBeforeObserver should propagate through prototype', function (get, set) { + var obj = { foo: 'foo', count: 0 }; + var obj2 = undefined; + + _emberMetalObserver._addBeforeObserver(obj, 'foo', function () { + this.count++; + }); + obj2 = Object.create(obj); + + set(obj2, 'foo', 'bar'); + equal(obj2.count, 1, 'should have invoked observer on inherited'); + equal(obj.count, 0, 'should not have invoked observer on parent'); + + obj2.count = 0; + set(obj, 'foo', 'baz'); + equal(obj.count, 1, 'should have invoked observer on parent'); + equal(obj2.count, 0, 'should not have invoked observer on inherited'); + }); + + _internalTestHelpers.testBoth('_addBeforeObserver should respect targets with methods', function (get, set) { + var observed = { foo: 'foo' }; + + var target1 = { + count: 0, + + willChange: function (obj, keyName) { + var value = get(obj, keyName); + equal(this, target1, 'should invoke with this'); + equal(obj, observed, 'param1 should be observed object'); + equal(keyName, 'foo', 'param2 should be keyName'); + equal(value, 'foo', 'param3 should old value'); + this.count++; + } + }; + + var target2 = { + count: 0, + + willChange: function (obj, keyName) { + var value = get(obj, keyName); + equal(this, target2, 'should invoke with this'); + equal(obj, observed, 'param1 should be observed object'); + equal(keyName, 'foo', 'param2 should be keyName'); + equal(value, 'foo', 'param3 should old value'); + this.count++; + } + }; + + _emberMetalObserver._addBeforeObserver(observed, 'foo', target1, 'willChange'); + _emberMetalObserver._addBeforeObserver(observed, 'foo', target2, target2.willChange); + + set(observed, 'foo', 'BAZ'); + equal(target1.count, 1, 'target1 observer should have fired'); + equal(target2.count, 1, 'target2 observer should have fired'); + }); + + // .......................................................... + // CHAINED OBSERVERS + // + + var obj = undefined, + count = undefined; + + QUnit.module('addObserver - dependentkey with chained properties', { + setup: function () { + obj = { + foo: { + bar: { + baz: { + biff: 'BIFF' + } + } + }, + Capital: { + foo: { + bar: { + baz: { + biff: 'BIFF' + } + } + } + } + }; + + count = 0; + }, + + teardown: function () { + obj = count = null; + } + }); + + _internalTestHelpers.testBoth('depending on a chain with a computed property', function (get, set) { + _emberMetalProperties.defineProperty(obj, 'computed', _emberMetalComputed.computed(function () { + return { foo: 'bar' }; + })); + + var changed = 0; + _emberMetalObserver.addObserver(obj, 'computed.foo', function () { + changed++; + }); + + equal(_emberMetalComputed.cacheFor(obj, 'computed'), undefined, 'addObserver should not compute CP'); + + set(obj, 'computed.foo', 'baz'); + + equal(changed, 1, 'should fire observer'); + }); + + _internalTestHelpers.testBoth('depending on a simple chain', function (get, set) { + var val = undefined; + _emberMetalObserver.addObserver(obj, 'foo.bar.baz.biff', function (target, key) { + val = get(target, key); + count++; + }); + + set(get(obj, 'foo.bar.baz'), 'biff', 'BUZZ'); + equal(val, 'BUZZ'); + equal(count, 1); + + set(get(obj, 'foo.bar'), 'baz', { biff: 'BLARG' }); + equal(val, 'BLARG'); + equal(count, 2); + + set(get(obj, 'foo'), 'bar', { baz: { biff: 'BOOM' } }); + equal(val, 'BOOM'); + equal(count, 3); + + set(obj, 'foo', { bar: { baz: { biff: 'BLARG' } } }); + equal(val, 'BLARG'); + equal(count, 4); + + set(get(obj, 'foo.bar.baz'), 'biff', 'BUZZ'); + equal(val, 'BUZZ'); + equal(count, 5); + + var foo = get(obj, 'foo'); + + set(obj, 'foo', 'BOO'); + equal(val, undefined); + equal(count, 6); + + set(foo.bar.baz, 'biff', 'BOOM'); + equal(count, 6, 'should be not have invoked observer'); + }); + + _internalTestHelpers.testBoth('depending on a chain with a capitalized first key', function (get, set) { + var val = undefined; + + _emberMetalObserver.addObserver(obj, 'Capital.foo.bar.baz.biff', function (target, key) { + val = get(obj, key); + count++; + }); + + set(get(obj, 'Capital.foo.bar.baz'), 'biff', 'BUZZ'); + equal(val, 'BUZZ'); + equal(count, 1); + + set(get(obj, 'Capital.foo.bar'), 'baz', { biff: 'BLARG' }); + equal(val, 'BLARG'); + equal(count, 2); + + set(get(obj, 'Capital.foo'), 'bar', { baz: { biff: 'BOOM' } }); + equal(val, 'BOOM'); + equal(count, 3); + + set(obj, 'Capital.foo', { bar: { baz: { biff: 'BLARG' } } }); + equal(val, 'BLARG'); + equal(count, 4); + + set(get(obj, 'Capital.foo.bar.baz'), 'biff', 'BUZZ'); + equal(val, 'BUZZ'); + equal(count, 5); + + var foo = get(obj, 'foo'); + + set(obj, 'Capital.foo', 'BOO'); + equal(val, undefined); + equal(count, 6); + + set(foo.bar.baz, 'biff', 'BOOM'); + equal(count, 6, 'should be not have invoked observer'); + }); + + QUnit.module('_removeBeforeObserver'); + + // .......................................................... + // SETTING IDENTICAL VALUES + // + + QUnit.module('props/observer_test - setting identical values'); + + _internalTestHelpers.testBoth('setting simple prop should not trigger', function (get, set) { + var obj = { foo: 'bar' }; + var count = 0; + + _emberMetalObserver.addObserver(obj, 'foo', function () { + count++; + }); + + set(obj, 'foo', 'bar'); + equal(count, 0, 'should not trigger observer'); + + set(obj, 'foo', 'baz'); + equal(count, 1, 'should trigger observer'); + + set(obj, 'foo', 'baz'); + equal(count, 1, 'should not trigger observer again'); + }); + + // The issue here is when a computed property is directly set with a value, then has a + // dependent key change (which triggers a cache expiration and recomputation), observers will + // not be fired if the CP setter is called with the last set value. + _internalTestHelpers.testBoth('setting a cached computed property whose value has changed should trigger', function (get, set) { + var obj = {}; + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed({ + get: function () { + return get(this, 'baz'); + }, + set: function (key, value) { + return value; + } + }).property('baz')); + + var count = 0; + + _emberMetalObserver.addObserver(obj, 'foo', function () { + count++; + }); + + set(obj, 'foo', 'bar'); + equal(count, 1); + equal(get(obj, 'foo'), 'bar'); + + set(obj, 'baz', 'qux'); + equal(count, 2); + equal(get(obj, 'foo'), 'qux'); + + get(obj, 'foo'); + set(obj, 'foo', 'bar'); + equal(count, 3); + equal(get(obj, 'foo'), 'bar'); + }); + + QUnit.module('Ember.immediateObserver (Deprecated)'); + + _internalTestHelpers.testBoth('immediate observers should fire synchronously', function (get, set) { + expectDeprecation(/Usage of `Ember.immediateObserver` is deprecated, use `Ember.observer` instead./); + var obj = {}; + var observerCalled = 0; + var mixin = undefined; + + // explicitly create a run loop so we do not inadvertently + // trigger deferred behavior + _emberMetalRun_loop.default(function () { + mixin = _emberMetalMixin.Mixin.create({ + fooDidChange: _emberMetalMixin._immediateObserver('foo', function () { + observerCalled++; + equal(get(this, 'foo'), 'barbaz', 'newly set value is immediately available'); + }) + }); + + mixin.apply(obj); + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed({ + get: function () { + return 'yes hello this is foo'; + }, + set: function (key, value) { + return value; + } + })); + + equal(get(obj, 'foo'), 'yes hello this is foo', 'precond - computed property returns a value'); + equal(observerCalled, 0, 'observer has not yet been called'); + + set(obj, 'foo', 'barbaz'); + + equal(observerCalled, 1, 'observer was called once'); + }); + }); + + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.Function) { + _internalTestHelpers.testBoth('immediate observers added declaratively via brace expansion fire synchronously', function (get, set) { + var obj = {}; + var observerCalled = 0; + var mixin = undefined; + + // explicitly create a run loop so we do not inadvertently + // trigger deferred behavior + _emberMetalRun_loop.default(function () { + expectDeprecation(function () { + mixin = _emberMetalMixin.Mixin.create({ + fooDidChange: (function () { + observerCalled++; + equal(get(this, 'foo'), 'barbaz', 'newly set value is immediately available'); + }).observesImmediately('{foo,bar}') + }); + }, /Function#observesImmediately is deprecated. Use Function#observes instead/); + + mixin.apply(obj); + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed({ + get: function (key) { + return 'yes hello this is foo'; + }, + set: function (key, value) { + return value; + } + })); + + equal(get(obj, 'foo'), 'yes hello this is foo', 'precond - computed property returns a value'); + equal(observerCalled, 0, 'observer has not yet been called'); + + set(obj, 'foo', 'barbaz'); + + equal(observerCalled, 1, 'observer was called once'); + }); + }); + } + + _internalTestHelpers.testBoth('immediate observers watching multiple properties via brace expansion fire synchronously', function (get, set) { + expectDeprecation(/Usage of `Ember.immediateObserver` is deprecated, use `Ember.observer` instead./); + var obj = {}; + var observerCalled = 0; + var mixin = undefined; + + // explicitly create a run loop so we do not inadvertently + // trigger deferred behavior + _emberMetalRun_loop.default(function () { + mixin = _emberMetalMixin.Mixin.create({ + fooDidChange: _emberMetalMixin._immediateObserver('{foo,bar}', function () { + observerCalled++; + equal(get(this, 'foo'), 'barbaz', 'newly set value is immediately available'); + }) + }); + + mixin.apply(obj); + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed({ + get: function () { + return 'yes hello this is foo'; + }, + set: function (key, value) { + return value; + } + })); + + equal(get(obj, 'foo'), 'yes hello this is foo', 'precond - computed property returns a value'); + equal(observerCalled, 0, 'observer has not yet been called'); + + set(obj, 'foo', 'barbaz'); + + equal(observerCalled, 1, 'observer was called once'); + }); + }); + + _internalTestHelpers.testBoth('immediate observers are for internal properties only', function (get, set) { + expectDeprecation(/Usage of `Ember.immediateObserver` is deprecated, use `Ember.observer` instead./); + expectAssertion(function () { + _emberMetalMixin._immediateObserver('foo.bar', function () { + return this; + }); + }, 'Immediate observers must observe internal properties only, not properties on other objects.'); + }); + + QUnit.module('changeProperties'); + + _internalTestHelpers.testBoth('observers added/removed during changeProperties should do the right thing.', function (get, set) { + var obj = { + foo: 0 + }; + function Observer() { + this.willChangeCount = 0; + this.didChangeCount = 0; + } + Observer.prototype = { + add: function () { + _emberMetalObserver._addBeforeObserver(obj, 'foo', this, 'willChange'); + _emberMetalObserver.addObserver(obj, 'foo', this, 'didChange'); + }, + remove: function () { + _emberMetalObserver._removeBeforeObserver(obj, 'foo', this, 'willChange'); + _emberMetalObserver.removeObserver(obj, 'foo', this, 'didChange'); + }, + willChange: function () { + this.willChangeCount++; + }, + didChange: function () { + this.didChangeCount++; + } + }; + var addedBeforeFirstChangeObserver = new Observer(); + var addedAfterFirstChangeObserver = new Observer(); + var addedAfterLastChangeObserver = new Observer(); + var removedBeforeFirstChangeObserver = new Observer(); + var removedBeforeLastChangeObserver = new Observer(); + var removedAfterLastChangeObserver = new Observer(); + removedBeforeFirstChangeObserver.add(); + removedBeforeLastChangeObserver.add(); + removedAfterLastChangeObserver.add(); + _emberMetalProperty_events.changeProperties(function () { + removedBeforeFirstChangeObserver.remove(); + addedBeforeFirstChangeObserver.add(); + + set(obj, 'foo', 1); + + equal(addedBeforeFirstChangeObserver.willChangeCount, 1, '_addBeforeObserver called before the first change invoked immediately'); + equal(addedBeforeFirstChangeObserver.didChangeCount, 0, 'addObserver called before the first change is deferred'); + + addedAfterFirstChangeObserver.add(); + removedBeforeLastChangeObserver.remove(); + + set(obj, 'foo', 2); + + equal(addedAfterFirstChangeObserver.willChangeCount, 1, '_addBeforeObserver called after the first change invoked immediately'); + equal(addedAfterFirstChangeObserver.didChangeCount, 0, 'addObserver called after the first change is deferred'); + + addedAfterLastChangeObserver.add(); + removedAfterLastChangeObserver.remove(); + }); + + equal(removedBeforeFirstChangeObserver.willChangeCount, 0, '_removeBeforeObserver called before the first change sees none'); + equal(removedBeforeFirstChangeObserver.didChangeCount, 0, 'removeObserver called before the first change sees none'); + equal(addedBeforeFirstChangeObserver.willChangeCount, 1, '_addBeforeObserver called before the first change sees only 1'); + equal(addedBeforeFirstChangeObserver.didChangeCount, 1, 'addObserver called before the first change sees only 1'); + equal(addedAfterFirstChangeObserver.willChangeCount, 1, '_addBeforeObserver called after the first change sees 1'); + equal(addedAfterFirstChangeObserver.didChangeCount, 1, 'addObserver called after the first change sees 1'); + equal(addedAfterLastChangeObserver.willChangeCount, 0, '_addBeforeObserver called after the last change sees none'); + equal(addedAfterLastChangeObserver.didChangeCount, 0, 'addObserver called after the last change sees none'); + equal(removedBeforeLastChangeObserver.willChangeCount, 1, '_removeBeforeObserver called before the last change still sees 1'); + equal(removedBeforeLastChangeObserver.didChangeCount, 1, 'removeObserver called before the last change still sees 1'); + equal(removedAfterLastChangeObserver.willChangeCount, 1, '_removeBeforeObserver called after the last change still sees 1'); + equal(removedAfterLastChangeObserver.didChangeCount, 1, 'removeObserver called after the last change still sees 1'); + }); + + QUnit.module('Keys behavior with observers'); + + _internalTestHelpers.testBoth('should not leak properties on the prototype', function () { + function Beer() {} + Beer.prototype.type = 'ipa'; + + var beer = new Beer(); + + _emberMetalObserver.addObserver(beer, 'type', K); + deepEqual(Object.keys(beer), []); + _emberMetalObserver.removeObserver(beer, 'type', K); + }); + + _internalTestHelpers.testBoth('observing a non existent property', function (get, set) { + function Beer() {} + Beer.prototype.type = 'ipa'; + + var beer = new Beer(); + + _emberMetalObserver.addObserver(beer, 'brand', K); + + deepEqual(Object.keys(beer), []); + + set(beer, 'brand', 'Corona'); + deepEqual(Object.keys(beer), ['brand']); + + _emberMetalObserver.removeObserver(beer, 'brand', K); + }); + + _internalTestHelpers.testBoth('with observers switched on and off', function (get, set) { + function Beer() {} + Beer.prototype.type = 'ipa'; + + var beer = new Beer(); + + _emberMetalObserver.addObserver(beer, 'type', K); + _emberMetalObserver.removeObserver(beer, 'type', K); + + deepEqual(Object.keys(beer), []); + }); + + _internalTestHelpers.testBoth('observers switched on and off with setter in between', function (get, set) { + function Beer() {} + Beer.prototype.type = 'ipa'; + + var beer = new Beer(); + + _emberMetalObserver.addObserver(beer, 'type', K); + set(beer, 'type', 'ale'); + _emberMetalObserver.removeObserver(beer, 'type', K); + + deepEqual(Object.keys(beer), ['type']); + }); + + _internalTestHelpers.testBoth('observer switched on and off and then setter', function (get, set) { + function Beer() {} + Beer.prototype.type = 'ipa'; + + var beer = new Beer(); + + _emberMetalObserver.addObserver(beer, 'type', K); + _emberMetalObserver.removeObserver(beer, 'type', K); + set(beer, 'type', 'ale'); + + deepEqual(Object.keys(beer), ['type']); + }); + + _internalTestHelpers.testBoth('observers switched on and off with setter in between (observed property is not shadowing)', function (get, set) { + function Beer() {} + + var beer = new Beer(); + set(beer, 'type', 'ale'); + deepEqual(Object.keys(beer), ['type'], 'only set'); + + var otherBeer = new Beer(); + _emberMetalObserver.addObserver(otherBeer, 'type', K); + set(otherBeer, 'type', 'ale'); + deepEqual(Object.keys(otherBeer), ['type'], 'addObserver -> set'); + + var yetAnotherBeer = new Beer(); + _emberMetalObserver.addObserver(yetAnotherBeer, 'type', K); + set(yetAnotherBeer, 'type', 'ale'); + _emberMetalObserver.removeObserver(beer, 'type', K); + deepEqual(Object.keys(yetAnotherBeer), ['type'], 'addObserver -> set -> removeObserver'); + + var itsMyLastBeer = new Beer(); + set(itsMyLastBeer, 'type', 'ale'); + _emberMetalObserver.removeObserver(beer, 'type', K); + deepEqual(Object.keys(itsMyLastBeer), ['type'], 'set -> removeObserver'); + }); + + _internalTestHelpers.testBoth('observers switched on and off with setter in between (observed property is shadowing one on the prototype)', function (get, set) { + function Beer() {} + Beer.prototype.type = 'ipa'; + + var beer = new Beer(); + set(beer, 'type', 'ale'); + deepEqual(Object.keys(beer), ['type'], 'after set'); + + var otherBeer = new Beer(); + _emberMetalObserver.addObserver(otherBeer, 'type', K); + set(otherBeer, 'type', 'ale'); + deepEqual(Object.keys(otherBeer), ['type'], 'addObserver -> set'); + + var yetAnotherBeer = new Beer(); + _emberMetalObserver.addObserver(yetAnotherBeer, 'type', K); + set(yetAnotherBeer, 'type', 'ale'); + _emberMetalObserver.removeObserver(beer, 'type', K); + deepEqual(Object.keys(yetAnotherBeer), ['type'], 'addObserver -> set -> removeObserver'); + + var itsMyLastBeer = new Beer(); + set(itsMyLastBeer, 'type', 'ale'); + _emberMetalObserver.removeObserver(beer, 'type', K); + deepEqual(Object.keys(itsMyLastBeer), ['type'], 'set -> removeObserver'); + }); +}); +enifed('ember-metal/tests/observer_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/observer_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/observer_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/observer_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/observer_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/observer_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/performance_test', ['exports', 'ember-metal/property_set', 'ember-metal/property_get', 'ember-metal/computed', 'ember-metal/properties', 'ember-metal/property_events', 'ember-metal/observer'], function (exports, _emberMetalProperty_set, _emberMetalProperty_get, _emberMetalComputed, _emberMetalProperties, _emberMetalProperty_events, _emberMetalObserver) { + 'use strict'; + + /* + This test file is designed to capture performance regressions related to + deferred computation. Things like run loops, computed properties, and bindings + should run the minimum amount of times to achieve best performance, so any + bugs that cause them to get evaluated more than necessary should be put here. + */ + + QUnit.module('Computed Properties - Number of times evaluated'); + + QUnit.test('computed properties that depend on multiple properties should run only once per run loop', function () { + var obj = { a: 'a', b: 'b', c: 'c' }; + var cpCount = 0; + var obsCount = 0; + + _emberMetalProperties.defineProperty(obj, 'abc', _emberMetalComputed.computed(function (key) { + cpCount++; + return 'computed ' + key; + }).property('a', 'b', 'c')); + + _emberMetalProperty_get.get(obj, 'abc'); + + cpCount = 0; + + _emberMetalObserver.addObserver(obj, 'abc', function () { + obsCount++; + }); + + _emberMetalProperty_events.beginPropertyChanges(); + _emberMetalProperty_set.set(obj, 'a', 'aa'); + _emberMetalProperty_set.set(obj, 'b', 'bb'); + _emberMetalProperty_set.set(obj, 'c', 'cc'); + _emberMetalProperty_events.endPropertyChanges(); + + _emberMetalProperty_get.get(obj, 'abc'); + + equal(cpCount, 1, 'The computed property is only invoked once'); + equal(obsCount, 1, 'The observer is only invoked once'); + }); + + QUnit.test('computed properties are not executed if they are the last segment of an observer chain pain', function () { + var foo = { bar: { baz: {} } }; + + var count = 0; + + _emberMetalProperties.defineProperty(foo.bar.baz, 'bam', _emberMetalComputed.computed(function () { + count++; + })); + + _emberMetalObserver.addObserver(foo, 'bar.baz.bam', function () {}); + + _emberMetalProperty_events.propertyDidChange(_emberMetalProperty_get.get(foo, 'bar.baz'), 'bam'); + + equal(count, 0, 'should not have recomputed property'); + }); +}); +enifed('ember-metal/tests/performance_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/performance_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/performance_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/performance_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/performance_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/performance_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/properties_test', ['exports', 'ember-metal/computed', 'ember-metal/properties', 'ember-metal/deprecate_property'], function (exports, _emberMetalComputed, _emberMetalProperties, _emberMetalDeprecate_property) { + 'use strict'; + + QUnit.module('Ember.defineProperty'); + + QUnit.test('toString', function () { + var obj = {}; + _emberMetalProperties.defineProperty(obj, 'toString', undefined, function () { + return 'FOO'; + }); + equal(obj.toString(), 'FOO', 'should replace toString'); + }); + + QUnit.test('for data properties, didDefineProperty hook should be called if implemented', function () { + expect(2); + + var obj = { + didDefineProperty: function (obj, keyName, value) { + equal(keyName, 'foo', 'key name should be foo'); + equal(value, 'bar', 'value should be bar'); + } + }; + + _emberMetalProperties.defineProperty(obj, 'foo', undefined, 'bar'); + }); + + QUnit.test('for computed properties, didDefineProperty hook should be called if implemented', function () { + expect(2); + + var computedProperty = _emberMetalComputed.computed(function () { + return this; + }); + + var obj = { + didDefineProperty: function (obj, keyName, value) { + equal(keyName, 'foo', 'key name should be foo'); + strictEqual(value, computedProperty, 'value should be passed as computed property'); + } + }; + + _emberMetalProperties.defineProperty(obj, 'foo', computedProperty); + }); + + QUnit.test('for descriptor properties, didDefineProperty hook should be called if implemented', function () { + expect(2); + + var descriptor = { + writable: true, + configurable: false, + enumerable: true, + value: 42 + }; + + var obj = { + didDefineProperty: function (obj, keyName, value) { + equal(keyName, 'answer', 'key name should be answer'); + strictEqual(value, descriptor, 'value should be passed as descriptor'); + } + }; + + _emberMetalProperties.defineProperty(obj, 'answer', descriptor); + }); + + QUnit.module('Ember.deprecateProperty'); + + QUnit.test('enables access to deprecated property and returns the value of the new property', function () { + expect(3); + var obj = { foo: 'bar' }; + + _emberMetalDeprecate_property.deprecateProperty(obj, 'baz', 'foo'); + + expectDeprecation(); + equal(obj.baz, obj.foo, 'baz and foo are equal'); + + obj.foo = 'blammo'; + equal(obj.baz, obj.foo, 'baz and foo are equal'); + }); + + QUnit.test('deprecatedKey is not enumerable', function () { + expect(2); + var obj = { foo: 'bar', blammo: 'whammy' }; + + _emberMetalDeprecate_property.deprecateProperty(obj, 'baz', 'foo'); + + for (var prop in obj) { + if (obj.hasOwnProperty(prop)) { + notEqual(prop, 'baz'); + } + } + }); + + QUnit.test('enables setter to deprecated property and updates the value of the new property', function () { + expect(3); + var obj = { foo: 'bar' }; + + _emberMetalDeprecate_property.deprecateProperty(obj, 'baz', 'foo'); + + expectDeprecation(); + obj.baz = 'bloop'; + equal(obj.foo, 'bloop', 'updating baz updates foo'); + equal(obj.baz, obj.foo, 'baz and foo are equal'); + }); +}); +enifed('ember-metal/tests/properties_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/properties_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/properties_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/properties_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/properties_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/properties_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/property_did_change_hook', ['exports', 'internal-test-helpers', 'ember-metal/property_events', 'ember-metal/watching', 'ember-metal/properties', 'ember-metal/alias', 'ember-metal/computed'], function (exports, _internalTestHelpers, _emberMetalProperty_events, _emberMetalWatching, _emberMetalProperties, _emberMetalAlias, _emberMetalComputed) { + 'use strict'; + + QUnit.module('PROPERTY_DID_CHANGE'); + + _internalTestHelpers.testBoth('alias and cp', function (get, set) { + var _obj; + + var counts = {}; + var obj = (_obj = { + child: {} + }, _obj[_emberMetalProperty_events.PROPERTY_DID_CHANGE] = function (keyName) { + counts[keyName] = (counts[keyName] || 0) + 1; + }, _obj); + + _emberMetalProperties.defineProperty(obj, 'cost', _emberMetalAlias.default('child.cost')); + _emberMetalProperties.defineProperty(obj, 'tax', _emberMetalAlias.default('child.tax')); + + _emberMetalProperties.defineProperty(obj, 'total', _emberMetalComputed.computed('cost', 'tax', { + get: function () { + return get(this, 'cost') + get(this, 'tax'); + } + })); + + ok(!_emberMetalWatching.isWatching(obj, 'child.cost'), 'precond alias target `child.cost` is not watched'); + equal(get(obj, 'cost'), undefined); + // this is how PROPERTY_DID_CHANGE will get notified + ok(_emberMetalWatching.isWatching(obj, 'child.cost'), 'alias target `child.cost` is watched after consumption'); + + ok(!_emberMetalWatching.isWatching(obj, 'child.tax'), 'precond alias target `child.tax` is not watched'); + equal(get(obj, 'tax'), undefined); + // this is how PROPERTY_DID_CHANGE will get notified + ok(_emberMetalWatching.isWatching(obj, 'child.tax'), 'alias target `child.cost` is watched after consumption'); + + // increments the watching count on the alias itself to 1 + ok(isNaN(get(obj, 'total')), 'total is initialized'); + + // decrements the watching count on the alias itself to 0 + set(obj, 'child', { + cost: 399.00, + tax: 32.93 + }); + + // this should have called PROPERTY_DID_CHANGE for all of them + equal(counts['cost'], 1, 'PROPERTY_DID_CHANGE called with cost'); + equal(counts['tax'], 1, 'PROPERTY_DID_CHANGE called with tax'); + equal(counts['total'], 1, 'PROPERTY_DID_CHANGE called with total'); + + // we should still have a dependency installed + ok(_emberMetalWatching.isWatching(obj, 'child.cost'), 'watching child.cost'); + ok(_emberMetalWatching.isWatching(obj, 'child.tax'), 'watching child.tax'); + + set(obj, 'child', { + cost: 100.00, + tax: 10.00 + }); + + equal(counts['cost'], 2, 'PROPERTY_DID_CHANGE called with cost'); + equal(counts['tax'], 2, 'PROPERTY_DID_CHANGE called with tax'); + equal(counts['total'], 1, 'PROPERTY_DID_CHANGE called with total'); + }); +}); +enifed('ember-metal/tests/property_did_change_hook.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/property_did_change_hook.js should pass jscs', function () { + ok(true, 'ember-metal/tests/property_did_change_hook.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/property_did_change_hook.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/property_did_change_hook.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/property_did_change_hook.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/run_loop/add_queue_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { + 'use strict'; + + var originalQueues = _emberMetalRun_loop.default.queues; + var queues = undefined; + + QUnit.module('system/run_loop/add_queue_test', { + setup: function () { + _emberMetalRun_loop.default.queues = queues = ['blork', 'bleep']; + }, + teardown: function () { + _emberMetalRun_loop.default.queues = originalQueues; + } + }); + + QUnit.test('adds a queue after a specified one', function () { + _emberMetalRun_loop.default._addQueue('testeroo', 'blork'); + + equal(queues.indexOf('testeroo'), 1, 'new queue was added after specified queue'); + }); + + QUnit.test('does not add the queue if it already exists', function () { + _emberMetalRun_loop.default._addQueue('testeroo', 'blork'); + _emberMetalRun_loop.default._addQueue('testeroo', 'blork'); + + equal(queues.length, 3, 'queue was not added twice'); + }); +}); +enifed('ember-metal/tests/run_loop/add_queue_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/run_loop'); + test('ember-metal/tests/run_loop/add_queue_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/run_loop/add_queue_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/run_loop/add_queue_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/run_loop'); + QUnit.test('ember-metal/tests/run_loop/add_queue_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/run_loop/add_queue_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/run_loop/debounce_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { + 'use strict'; + + var originalDebounce = _emberMetalRun_loop.default.backburner.debounce; + var wasCalled = false; + + QUnit.module('Ember.run.debounce', { + setup: function () { + _emberMetalRun_loop.default.backburner.debounce = function () { + wasCalled = true; + }; + }, + teardown: function () { + _emberMetalRun_loop.default.backburner.debounce = originalDebounce; + } + }); + + QUnit.test('Ember.run.debounce uses Backburner.debounce', function () { + _emberMetalRun_loop.default.debounce(function () {}); + ok(wasCalled, 'Ember.run.debounce used'); + }); +}); +enifed('ember-metal/tests/run_loop/debounce_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/run_loop'); + test('ember-metal/tests/run_loop/debounce_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/run_loop/debounce_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/run_loop/debounce_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/run_loop'); + QUnit.test('ember-metal/tests/run_loop/debounce_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/run_loop/debounce_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/run_loop/later_test', ['exports', 'ember-metal/is_none', 'ember-metal/run_loop'], function (exports, _emberMetalIs_none, _emberMetalRun_loop) { + 'use strict'; + + var originalSetTimeout = window.setTimeout; + var originalDateValueOf = Date.prototype.valueOf; + var originalPlatform = _emberMetalRun_loop.default.backburner._platform; + + function wait(callback, maxWaitCount) { + maxWaitCount = _emberMetalIs_none.default(maxWaitCount) ? 100 : maxWaitCount; + + originalSetTimeout(function () { + if (maxWaitCount > 0 && (_emberMetalRun_loop.default.hasScheduledTimers() || _emberMetalRun_loop.default.currentRunLoop)) { + wait(callback, maxWaitCount - 1); + + return; + } + + callback(); + }, 10); + } + + // Synchronous "sleep". This simulates work being done + // after run.later was called but before the run loop + // has flushed. In previous versions, this would have + // caused the run.later callback to have run from + // within the run loop flush, since by the time the + // run loop has to flush, it would have considered + // the timer already expired. + function pauseUntil(time) { + // jscs:disable + while (+new Date() < time) {} /* do nothing - sleeping */ + // jscs:enable + } + + QUnit.module('run.later', { + teardown: function () { + _emberMetalRun_loop.default.backburner._platform = originalPlatform; + window.setTimeout = originalSetTimeout; + Date.prototype.valueOf = originalDateValueOf; + } + }); + + asyncTest('should invoke after specified period of time - function only', function () { + var invoked = false; + + _emberMetalRun_loop.default(function () { + _emberMetalRun_loop.default.later(function () { + return invoked = true; + }, 100); + }); + + wait(function () { + QUnit.start(); + equal(invoked, true, 'should have invoked later item'); + }); + }); + + asyncTest('should invoke after specified period of time - target/method', function () { + var obj = { invoked: false }; + + _emberMetalRun_loop.default(function () { + _emberMetalRun_loop.default.later(obj, function () { + this.invoked = true; + }, 100); + }); + + wait(function () { + QUnit.start(); + equal(obj.invoked, true, 'should have invoked later item'); + }); + }); + + asyncTest('should invoke after specified period of time - target/method/args', function () { + var obj = { invoked: 0 }; + + _emberMetalRun_loop.default(function () { + _emberMetalRun_loop.default.later(obj, function (amt) { + this.invoked += amt; + }, 10, 100); + }); + + wait(function () { + QUnit.start(); + equal(obj.invoked, 10, 'should have invoked later item'); + }); + }); + + asyncTest('should always invoke within a separate runloop', function () { + var obj = { invoked: 0 }; + var firstRunLoop = undefined, + secondRunLoop = undefined; + + _emberMetalRun_loop.default(function () { + firstRunLoop = _emberMetalRun_loop.default.currentRunLoop; + + _emberMetalRun_loop.default.later(obj, function (amt) { + this.invoked += amt; + secondRunLoop = _emberMetalRun_loop.default.currentRunLoop; + }, 10, 1); + + pauseUntil(+new Date() + 100); + }); + + ok(firstRunLoop, 'first run loop captured'); + ok(!_emberMetalRun_loop.default.currentRunLoop, 'shouldn\'t be in a run loop after flush'); + equal(obj.invoked, 0, 'shouldn\'t have invoked later item yet'); + + wait(function () { + QUnit.start(); + equal(obj.invoked, 10, 'should have invoked later item'); + ok(secondRunLoop, 'second run loop took place'); + ok(secondRunLoop !== firstRunLoop, 'two different run loops took place'); + }); + }); + + // Our current implementation doesn't allow us to correctly enforce this ordering. + // We should probably implement a queue to provide this guarantee. + // See https://github.com/emberjs/ember.js/issues/3526 for more information. + + // asyncTest('callback order', function() { + // let array = []; + // function fn(val) { array.push(val); } + + // run(function() { + // run.later(this, fn, 4, 5); + // run.later(this, fn, 1, 1); + // run.later(this, fn, 5, 10); + // run.later(this, fn, 2, 3); + // run.later(this, fn, 3, 3); + // }); + + // deepEqual(array, []); + + // wait(function() { + // QUnit.start(); + // deepEqual(array, [1,2,3,4,5], 'callbacks were called in expected order'); + // }); + // }); + + // Out current implementation doesn't allow us to properly enforce what is tested here. + // We should probably fix it, but it's not technically a bug right now. + // See https://github.com/emberjs/ember.js/issues/3522 for more information. + + // asyncTest('callbacks coalesce into same run loop if expiring at the same time', function() { + // let array = []; + // function fn(val) { array.push(run.currentRunLoop); } + + // run(function() { + + // // Force +new Date to return the same result while scheduling + // // run.later timers. Otherwise: non-determinism! + // let now = +new Date(); + // Date.prototype.valueOf = function() { return now; }; + + // run.later(this, fn, 10); + // run.later(this, fn, 200); + // run.later(this, fn, 200); + + // Date.prototype.valueOf = originalDateValueOf; + // }); + + // deepEqual(array, []); + + // wait(function() { + // QUnit.start(); + // equal(array.length, 3, 'all callbacks called'); + // ok(array[0] !== array[1], 'first two callbacks have different run loops'); + // ok(array[0], 'first runloop present'); + // ok(array[1], 'second runloop present'); + // equal(array[1], array[2], 'last two callbacks got the same run loop'); + // }); + // }); + + asyncTest('inception calls to run.later should run callbacks in separate run loops', function () { + var runLoop = undefined, + finished = undefined; + + _emberMetalRun_loop.default(function () { + runLoop = _emberMetalRun_loop.default.currentRunLoop; + ok(runLoop); + + _emberMetalRun_loop.default.later(function () { + ok(_emberMetalRun_loop.default.currentRunLoop && _emberMetalRun_loop.default.currentRunLoop !== runLoop, 'first later callback has own run loop'); + runLoop = _emberMetalRun_loop.default.currentRunLoop; + + _emberMetalRun_loop.default.later(function () { + ok(_emberMetalRun_loop.default.currentRunLoop && _emberMetalRun_loop.default.currentRunLoop !== runLoop, 'second later callback has own run loop'); + finished = true; + }, 40); + }, 40); + }); + + wait(function () { + QUnit.start(); + ok(finished, 'all .later callbacks run'); + }); + }); + + asyncTest('setTimeout should never run with a negative wait', function () { + // Rationale: The old run loop code was susceptible to an occasional + // bug where invokeLaterTimers would be scheduled with a setTimeout + // with a negative wait. Modern browsers normalize this to 0, but + // older browsers (IE <= 8) break with a negative wait, which + // happens when an expired timer callback takes a while to run, + // which is what we simulate here. + var newSetTimeoutUsed = undefined; + _emberMetalRun_loop.default.backburner._platform = { + setTimeout: function () { + var wait = arguments[arguments.length - 1]; + newSetTimeoutUsed = true; + ok(!isNaN(wait) && wait >= 0, 'wait is a non-negative number'); + + return originalPlatform.setTimeout.apply(originalPlatform, arguments); + } + }; + + var count = 0; + _emberMetalRun_loop.default(function () { + _emberMetalRun_loop.default.later(function () { + count++; + + // This will get run first. Waste some time. + // This is intended to break invokeLaterTimers code by taking a + // long enough time that other timers should technically expire. It's + // fine that they're not called in this run loop; just need to + // make sure that invokeLaterTimers doesn't end up scheduling + // a negative setTimeout. + pauseUntil(+new Date() + 60); + }, 1); + + _emberMetalRun_loop.default.later(function () { + equal(count, 1, 'callbacks called in order'); + }, 50); + }); + + wait(function () { + QUnit.start(); + ok(newSetTimeoutUsed, 'stub setTimeout was used'); + }); + }); +}); +enifed('ember-metal/tests/run_loop/later_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/run_loop'); + test('ember-metal/tests/run_loop/later_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/run_loop/later_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/run_loop/later_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/run_loop'); + QUnit.test('ember-metal/tests/run_loop/later_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/run_loop/later_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/run_loop/next_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { + 'use strict'; + + QUnit.module('run.next'); + + asyncTest('should invoke immediately on next timeout', function () { + var invoked = false; + + _emberMetalRun_loop.default(function () { + return _emberMetalRun_loop.default.next(function () { + return invoked = true; + }); + }); + + equal(invoked, false, 'should not have invoked yet'); + + setTimeout(function () { + QUnit.start(); + equal(invoked, true, 'should have invoked later item'); + }, 20); + }); + + asyncTest('callback should be called from within separate loop', function () { + var firstRunLoop = undefined, + secondRunLoop = undefined; + _emberMetalRun_loop.default(function () { + firstRunLoop = _emberMetalRun_loop.default.currentRunLoop; + _emberMetalRun_loop.default.next(function () { + return secondRunLoop = _emberMetalRun_loop.default.currentRunLoop; + }); + }); + + setTimeout(function () { + QUnit.start(); + ok(secondRunLoop, 'callback was called from within run loop'); + ok(firstRunLoop && secondRunLoop !== firstRunLoop, 'two separate run loops were invoked'); + }, 20); + }); + + asyncTest('multiple calls to run.next share coalesce callbacks into same run loop', function () { + var firstRunLoop = undefined, + secondRunLoop = undefined, + thirdRunLoop = undefined; + _emberMetalRun_loop.default(function () { + firstRunLoop = _emberMetalRun_loop.default.currentRunLoop; + _emberMetalRun_loop.default.next(function () { + return secondRunLoop = _emberMetalRun_loop.default.currentRunLoop; + }); + _emberMetalRun_loop.default.next(function () { + return thirdRunLoop = _emberMetalRun_loop.default.currentRunLoop; + }); + }); + + setTimeout(function () { + QUnit.start(); + ok(secondRunLoop && secondRunLoop === thirdRunLoop, 'callbacks coalesced into same run loop'); + }, 20); + }); +}); +enifed('ember-metal/tests/run_loop/next_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/run_loop'); + test('ember-metal/tests/run_loop/next_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/run_loop/next_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/run_loop/next_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/run_loop'); + QUnit.test('ember-metal/tests/run_loop/next_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/run_loop/next_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/run_loop/once_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { + 'use strict'; + + QUnit.module('system/run_loop/once_test'); + + QUnit.test('calling invokeOnce more than once invokes only once', function () { + var count = 0; + _emberMetalRun_loop.default(function () { + function F() { + count++; + } + _emberMetalRun_loop.default.once(F); + _emberMetalRun_loop.default.once(F); + _emberMetalRun_loop.default.once(F); + }); + + equal(count, 1, 'should have invoked once'); + }); + + QUnit.test('should differentiate based on target', function () { + var A = { count: 0 }; + var B = { count: 0 }; + _emberMetalRun_loop.default(function () { + function F() { + this.count++; + } + _emberMetalRun_loop.default.once(A, F); + _emberMetalRun_loop.default.once(B, F); + _emberMetalRun_loop.default.once(A, F); + _emberMetalRun_loop.default.once(B, F); + }); + + equal(A.count, 1, 'should have invoked once on A'); + equal(B.count, 1, 'should have invoked once on B'); + }); + + QUnit.test('should ignore other arguments - replacing previous ones', function () { + var A = { count: 0 }; + var B = { count: 0 }; + + _emberMetalRun_loop.default(function () { + function F(amt) { + this.count += amt; + } + _emberMetalRun_loop.default.once(A, F, 10); + _emberMetalRun_loop.default.once(B, F, 20); + _emberMetalRun_loop.default.once(A, F, 30); + _emberMetalRun_loop.default.once(B, F, 40); + }); + + equal(A.count, 30, 'should have invoked once on A'); + equal(B.count, 40, 'should have invoked once on B'); + }); + + QUnit.test('should be inside of a runloop when running', function () { + _emberMetalRun_loop.default(function () { + _emberMetalRun_loop.default.once(function () { + return ok(!!_emberMetalRun_loop.default.currentRunLoop, 'should have a runloop'); + }); + }); + }); +}); +enifed('ember-metal/tests/run_loop/once_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/run_loop'); + test('ember-metal/tests/run_loop/once_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/run_loop/once_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/run_loop/once_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/run_loop'); + QUnit.test('ember-metal/tests/run_loop/once_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/run_loop/once_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/run_loop/onerror_test', ['exports', 'ember-metal/run_loop', 'ember-metal/error_handler'], function (exports, _emberMetalRun_loop, _emberMetalError_handler) { + 'use strict'; + + QUnit.module('system/run_loop/onerror_test'); + + QUnit.test('With Ember.onerror undefined, errors in Ember.run are thrown', function () { + var thrown = new Error('Boom!'); + var original = _emberMetalError_handler.getOnerror(); + + var caught = undefined; + _emberMetalError_handler.setOnerror(undefined); + try { + _emberMetalRun_loop.default(function () { + throw thrown; + }); + } catch (error) { + caught = error; + } finally { + _emberMetalError_handler.setOnerror(original); + } + + deepEqual(caught, thrown); + }); + + QUnit.test('With Ember.onerror set, errors in Ember.run are caught', function () { + var thrown = new Error('Boom!'); + var original = _emberMetalError_handler.getOnerror(); + + var caught = undefined; + _emberMetalError_handler.setOnerror(function (error) { + caught = error; + }); + try { + _emberMetalRun_loop.default(function () { + throw thrown; + }); + } finally { + _emberMetalError_handler.setOnerror(original); + } + + deepEqual(caught, thrown); + }); +}); +enifed('ember-metal/tests/run_loop/onerror_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/run_loop'); + test('ember-metal/tests/run_loop/onerror_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/run_loop/onerror_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/run_loop/onerror_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/run_loop'); + QUnit.test('ember-metal/tests/run_loop/onerror_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/run_loop/onerror_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/run_loop/run_bind_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { + 'use strict'; + + QUnit.module('system/run_loop/run_bind_test'); + + QUnit.test('Ember.run.bind builds a run-loop wrapped callback handler', function () { + expect(3); + + var obj = { + value: 0, + increment: function (increment) { + ok(_emberMetalRun_loop.default.currentRunLoop, 'expected a run-loop'); + return this.value += increment; + } + }; + + var proxiedFunction = _emberMetalRun_loop.default.bind(obj, obj.increment, 1); + equal(proxiedFunction(), 1); + equal(obj.value, 1); + }); + + QUnit.test('Ember.run.bind keeps the async callback arguments', function () { + expect(4); + + function asyncCallback(increment, increment2, increment3) { + ok(_emberMetalRun_loop.default.currentRunLoop, 'expected a run-loop'); + equal(increment, 1); + equal(increment2, 2); + equal(increment3, 3); + } + + function asyncFunction(fn) { + fn(2, 3); + } + + asyncFunction(_emberMetalRun_loop.default.bind(asyncCallback, asyncCallback, 1)); + }); +}); +enifed('ember-metal/tests/run_loop/run_bind_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/run_loop'); + test('ember-metal/tests/run_loop/run_bind_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/run_loop/run_bind_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/run_loop/run_bind_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/run_loop'); + QUnit.test('ember-metal/tests/run_loop/run_bind_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/run_loop/run_bind_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/run_loop/run_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { + 'use strict'; + + QUnit.module('system/run_loop/run_test'); + + QUnit.test('Ember.run invokes passed function, returning value', function () { + var obj = { + foo: function () { + return [this.bar, 'FOO']; + }, + bar: 'BAR', + checkArgs: function (arg1, arg2) { + return [arg1, this.bar, arg2]; + } + }; + + equal(_emberMetalRun_loop.default(function () { + return 'FOO'; + }), 'FOO', 'pass function only'); + deepEqual(_emberMetalRun_loop.default(obj, obj.foo), ['BAR', 'FOO'], 'pass obj and obj.method'); + deepEqual(_emberMetalRun_loop.default(obj, 'foo'), ['BAR', 'FOO'], 'pass obj and "method"'); + deepEqual(_emberMetalRun_loop.default(obj, obj.checkArgs, 'hello', 'world'), ['hello', 'BAR', 'world'], 'pass obj, obj.method, and extra arguments'); + }); +}); +enifed('ember-metal/tests/run_loop/run_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/run_loop'); + test('ember-metal/tests/run_loop/run_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/run_loop/run_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/run_loop/run_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/run_loop'); + QUnit.test('ember-metal/tests/run_loop/run_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/run_loop/run_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/run_loop/schedule_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { + 'use strict'; + + QUnit.module('system/run_loop/schedule_test'); + + QUnit.test('scheduling item in queue should defer until finished', function () { + var cnt = 0; + + _emberMetalRun_loop.default(function () { + _emberMetalRun_loop.default.schedule('actions', function () { + return cnt++; + }); + _emberMetalRun_loop.default.schedule('actions', function () { + return cnt++; + }); + equal(cnt, 0, 'should not run action yet'); + }); + + equal(cnt, 2, 'should flush actions now'); + }); + + QUnit.test('a scheduled item can be canceled', function (assert) { + var hasRan = false; + + _emberMetalRun_loop.default(function () { + var cancelId = _emberMetalRun_loop.default.schedule('actions', function () { + return hasRan = true; + }); + _emberMetalRun_loop.default.cancel(cancelId); + }); + + assert.notOk(hasRan, 'should not have ran callback run'); + }); + + QUnit.test('nested runs should queue each phase independently', function () { + var cnt = 0; + + _emberMetalRun_loop.default(function () { + _emberMetalRun_loop.default.schedule('actions', function () { + return cnt++; + }); + equal(cnt, 0, 'should not run action yet'); + + _emberMetalRun_loop.default(function () { + _emberMetalRun_loop.default.schedule('actions', function () { + return cnt++; + }); + }); + equal(cnt, 1, 'should not run action yet'); + }); + + equal(cnt, 2, 'should flush actions now'); + }); + + QUnit.test('prior queues should be flushed before moving on to next queue', function () { + var order = []; + + _emberMetalRun_loop.default(function () { + var runLoop = _emberMetalRun_loop.default.currentRunLoop; + ok(runLoop, 'run loop present'); + + _emberMetalRun_loop.default.schedule('sync', function () { + order.push('sync'); + equal(runLoop, _emberMetalRun_loop.default.currentRunLoop, 'same run loop used'); + }); + + _emberMetalRun_loop.default.schedule('actions', function () { + order.push('actions'); + equal(runLoop, _emberMetalRun_loop.default.currentRunLoop, 'same run loop used'); + + _emberMetalRun_loop.default.schedule('actions', function () { + order.push('actions'); + equal(runLoop, _emberMetalRun_loop.default.currentRunLoop, 'same run loop used'); + }); + + _emberMetalRun_loop.default.schedule('sync', function () { + order.push('sync'); + equal(runLoop, _emberMetalRun_loop.default.currentRunLoop, 'same run loop used'); + }); + }); + + _emberMetalRun_loop.default.schedule('destroy', function () { + order.push('destroy'); + equal(runLoop, _emberMetalRun_loop.default.currentRunLoop, 'same run loop used'); + }); + }); + + deepEqual(order, ['sync', 'actions', 'sync', 'actions', 'destroy']); + }); + + QUnit.test('makes sure it does not trigger an autorun during testing', function () { + expectAssertion(function () { + return _emberMetalRun_loop.default.schedule('actions', function () {}); + }, /wrap any code with asynchronous side-effects in a run/); + + // make sure not just the first violation is asserted. + expectAssertion(function () { + return _emberMetalRun_loop.default.schedule('actions', function () {}); + }, /wrap any code with asynchronous side-effects in a run/); + }); +}); +enifed('ember-metal/tests/run_loop/schedule_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/run_loop'); + test('ember-metal/tests/run_loop/schedule_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/run_loop/schedule_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/run_loop/schedule_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/run_loop'); + QUnit.test('ember-metal/tests/run_loop/schedule_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/run_loop/schedule_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/run_loop/sync_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { + 'use strict'; + + QUnit.module('system/run_loop/sync_test'); + + QUnit.test('sync() will immediately flush the sync queue only', function () { + var cnt = 0; + + _emberMetalRun_loop.default(function () { + function cntup() { + cnt++; + } + + function syncfunc() { + if (++cnt < 5) { + _emberMetalRun_loop.default.schedule('sync', syncfunc); + } + _emberMetalRun_loop.default.schedule('actions', cntup); + } + + syncfunc(); + + equal(cnt, 1, 'should not run action yet'); + _emberMetalRun_loop.default.sync(); + + equal(cnt, 5, 'should have run sync queue continuously'); + }); + + equal(cnt, 10, 'should flush actions now too'); + }); + + QUnit.test('calling sync() outside a run loop does not cause an error', function () { + expect(0); + + _emberMetalRun_loop.default.sync(); + }); +}); +enifed('ember-metal/tests/run_loop/sync_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/run_loop'); + test('ember-metal/tests/run_loop/sync_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/run_loop/sync_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/run_loop/sync_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/run_loop'); + QUnit.test('ember-metal/tests/run_loop/sync_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/run_loop/sync_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/run_loop/unwind_test', ['exports', 'ember-metal/run_loop', 'ember-metal/error'], function (exports, _emberMetalRun_loop, _emberMetalError) { + 'use strict'; + + QUnit.module('system/run_loop/unwind_test'); + + QUnit.test('RunLoop unwinds despite unhandled exception', function () { + var initialRunLoop = _emberMetalRun_loop.default.currentRunLoop; + + throws(function () { + _emberMetalRun_loop.default(function () { + _emberMetalRun_loop.default.schedule('actions', function () { + throw new _emberMetalError.default('boom!'); + }); + }); + }, Error, 'boom!'); + + // The real danger at this point is that calls to autorun will stick + // tasks into the already-dead runloop, which will never get + // flushed. I can't easily demonstrate this in a unit test because + // autorun explicitly doesn't work in test mode. - ef4 + equal(_emberMetalRun_loop.default.currentRunLoop, initialRunLoop, 'Previous run loop should be cleaned up despite exception'); + + // Prevent a failure in this test from breaking subsequent tests. + _emberMetalRun_loop.default.currentRunLoop = initialRunLoop; + }); + + QUnit.test('run unwinds despite unhandled exception', function () { + var initialRunLoop = _emberMetalRun_loop.default.currentRunLoop; + + throws(function () { + _emberMetalRun_loop.default(function () { + throw new _emberMetalError.default('boom!'); + }); + }, _emberMetalError.default, 'boom!'); + + equal(_emberMetalRun_loop.default.currentRunLoop, initialRunLoop, 'Previous run loop should be cleaned up despite exception'); + + // Prevent a failure in this test from breaking subsequent tests. + _emberMetalRun_loop.default.currentRunLoop = initialRunLoop; + }); +}); +enifed('ember-metal/tests/run_loop/unwind_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/run_loop'); + test('ember-metal/tests/run_loop/unwind_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/run_loop/unwind_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/run_loop/unwind_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/run_loop'); + QUnit.test('ember-metal/tests/run_loop/unwind_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/run_loop/unwind_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/set_properties_test', ['exports', 'ember-metal/set_properties'], function (exports, _emberMetalSet_properties) { + 'use strict'; + + QUnit.module('Ember.setProperties'); + + QUnit.test('supports setting multiple attributes at once', function () { + deepEqual(_emberMetalSet_properties.default(null, null), null, 'noop for null properties and null object'); + deepEqual(_emberMetalSet_properties.default(undefined, undefined), undefined, 'noop for undefined properties and undefined object'); + + deepEqual(_emberMetalSet_properties.default({}), undefined, 'noop for no properties'); + deepEqual(_emberMetalSet_properties.default({}, undefined), undefined, 'noop for undefined'); + deepEqual(_emberMetalSet_properties.default({}, null), null, 'noop for null'); + deepEqual(_emberMetalSet_properties.default({}, NaN), NaN, 'noop for NaN'); + deepEqual(_emberMetalSet_properties.default({}, {}), {}, 'meh'); + + deepEqual(_emberMetalSet_properties.default({}, { foo: 1 }), { foo: 1 }, 'Set a single property'); + + deepEqual(_emberMetalSet_properties.default({}, { foo: 1, bar: 1 }), { foo: 1, bar: 1 }, 'Set multiple properties'); + + deepEqual(_emberMetalSet_properties.default({ foo: 2, baz: 2 }, { foo: 1 }), { foo: 1 }, 'Set one of multiple properties'); + + deepEqual(_emberMetalSet_properties.default({ foo: 2, baz: 2 }, { bar: 2 }), { + bar: 2 + }, 'Set an additional, previously unset property'); + }); +}); +enifed('ember-metal/tests/set_properties_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/set_properties_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/set_properties_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/set_properties_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/set_properties_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/set_properties_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/watching/is_watching_test', ['exports', 'ember-metal/computed', 'ember-metal/property_get', 'ember-metal/properties', 'ember-metal/mixin', 'ember-metal/observer', 'ember-metal/watching'], function (exports, _emberMetalComputed, _emberMetalProperty_get, _emberMetalProperties, _emberMetalMixin, _emberMetalObserver, _emberMetalWatching) { + 'use strict'; + + QUnit.module('isWatching'); + + function testObserver(setup, teardown) { + var key = arguments.length <= 2 || arguments[2] === undefined ? 'key' : arguments[2]; + + var obj = {}; + function fn() {} + + equal(_emberMetalWatching.isWatching(obj, key), false, 'precond - isWatching is false by default'); + setup(obj, key, fn); + equal(_emberMetalWatching.isWatching(obj, key), true, 'isWatching is true when observers are added'); + teardown(obj, key, fn); + equal(_emberMetalWatching.isWatching(obj, key), false, 'isWatching is false after observers are removed'); + } + + QUnit.test('isWatching is true for regular local observers', function () { + testObserver(function (obj, key, fn) { + _emberMetalMixin.Mixin.create({ + didChange: _emberMetalMixin.observer(key, fn) + }).apply(obj); + }, function (obj, key, fn) { + return _emberMetalObserver.removeObserver(obj, key, obj, fn); + }); + }); + + QUnit.test('isWatching is true for nonlocal observers', function () { + testObserver(function (obj, key, fn) { + _emberMetalObserver.addObserver(obj, key, obj, fn); + }, function (obj, key, fn) { + return _emberMetalObserver.removeObserver(obj, key, obj, fn); + }); + }); + + QUnit.test('isWatching is true for chained observers', function () { + testObserver(function (obj, key, fn) { + _emberMetalObserver.addObserver(obj, key + '.bar', obj, fn); + }, function (obj, key, fn) { + _emberMetalObserver.removeObserver(obj, key + '.bar', obj, fn); + }); + }); + + QUnit.test('isWatching is true for computed properties', function () { + testObserver(function (obj, key, fn) { + _emberMetalProperties.defineProperty(obj, 'computed', _emberMetalComputed.computed(fn).property(key)); + _emberMetalProperty_get.get(obj, 'computed'); + }, function (obj, key, fn) { + return _emberMetalProperties.defineProperty(obj, 'computed', null); + }); + }); + + QUnit.test('isWatching is true for chained computed properties', function () { + testObserver(function (obj, key, fn) { + _emberMetalProperties.defineProperty(obj, 'computed', _emberMetalComputed.computed(fn).property(key + '.bar')); + _emberMetalProperty_get.get(obj, 'computed'); + }, function (obj, key, fn) { + return _emberMetalProperties.defineProperty(obj, 'computed', null); + }); + }); + + // can't watch length on Array - it is special... + // But you should be able to watch a length property of an object + QUnit.test('isWatching is true for \'length\' property on object', function () { + testObserver(function (obj, key, fn) { + _emberMetalProperties.defineProperty(obj, 'length', null, '26.2 miles'); + _emberMetalObserver.addObserver(obj, 'length', obj, fn); + }, function (obj, key, fn) { + return _emberMetalObserver.removeObserver(obj, 'length', obj, fn); + }, 'length'); + }); +}); +enifed('ember-metal/tests/watching/is_watching_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/watching'); + test('ember-metal/tests/watching/is_watching_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/watching/is_watching_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/watching/is_watching_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/watching'); + QUnit.test('ember-metal/tests/watching/is_watching_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/watching/is_watching_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/watching/unwatch_test', ['exports', 'internal-test-helpers', 'ember-metal/watching', 'ember-metal/properties', 'ember-metal/events', 'ember-metal/computed', 'ember-metal/property_set'], function (exports, _internalTestHelpers, _emberMetalWatching, _emberMetalProperties, _emberMetalEvents, _emberMetalComputed, _emberMetalProperty_set) { + 'use strict'; + + var willCount = undefined, + didCount = undefined; + + QUnit.module('unwatch', { + setup: function () { + willCount = didCount = 0; + } + }); + + function addListeners(obj, keyPath) { + _emberMetalEvents.addListener(obj, keyPath + ':before', function () { + return willCount++; + }); + _emberMetalEvents.addListener(obj, keyPath + ':change', function () { + return didCount++; + }); + } + + _internalTestHelpers.testBoth('unwatching a computed property - regular get/set', function (get, set) { + var obj = {}; + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed({ + get: function () { + return this.__foo; + }, + set: function (keyName, value) { + this.__foo = value; + return this.__foo; + } + })); + addListeners(obj, 'foo'); + + _emberMetalWatching.watch(obj, 'foo'); + set(obj, 'foo', 'bar'); + equal(willCount, 1, 'should have invoked willCount'); + equal(didCount, 1, 'should have invoked didCount'); + + _emberMetalWatching.unwatch(obj, 'foo'); + willCount = didCount = 0; + set(obj, 'foo', 'BAZ'); + equal(willCount, 0, 'should NOT have invoked willCount'); + equal(didCount, 0, 'should NOT have invoked didCount'); + }); + + _internalTestHelpers.testBoth('unwatching a regular property - regular get/set', function (get, set) { + var obj = { foo: 'BIFF' }; + addListeners(obj, 'foo'); + + _emberMetalWatching.watch(obj, 'foo'); + set(obj, 'foo', 'bar'); + equal(willCount, 1, 'should have invoked willCount'); + equal(didCount, 1, 'should have invoked didCount'); + + _emberMetalWatching.unwatch(obj, 'foo'); + willCount = didCount = 0; + set(obj, 'foo', 'BAZ'); + equal(willCount, 0, 'should NOT have invoked willCount'); + equal(didCount, 0, 'should NOT have invoked didCount'); + }); + + QUnit.test('unwatching should be nested', function () { + var obj = { foo: 'BIFF' }; + addListeners(obj, 'foo'); + + _emberMetalWatching.watch(obj, 'foo'); + _emberMetalWatching.watch(obj, 'foo'); + _emberMetalProperty_set.set(obj, 'foo', 'bar'); + equal(willCount, 1, 'should have invoked willCount'); + equal(didCount, 1, 'should have invoked didCount'); + + _emberMetalWatching.unwatch(obj, 'foo'); + willCount = didCount = 0; + _emberMetalProperty_set.set(obj, 'foo', 'BAZ'); + equal(willCount, 1, 'should NOT have invoked willCount'); + equal(didCount, 1, 'should NOT have invoked didCount'); + + _emberMetalWatching.unwatch(obj, 'foo'); + willCount = didCount = 0; + _emberMetalProperty_set.set(obj, 'foo', 'BAZ'); + equal(willCount, 0, 'should NOT have invoked willCount'); + equal(didCount, 0, 'should NOT have invoked didCount'); + }); + + _internalTestHelpers.testBoth('unwatching "length" property on an object', function (get, set) { + var obj = { foo: 'RUN' }; + addListeners(obj, 'length'); + + // Can watch length when it is undefined + _emberMetalWatching.watch(obj, 'length'); + set(obj, 'length', '10k'); + equal(willCount, 1, 'should have invoked willCount'); + equal(didCount, 1, 'should have invoked didCount'); + + // Should stop watching despite length now being defined (making object 'array-like') + _emberMetalWatching.unwatch(obj, 'length'); + willCount = didCount = 0; + set(obj, 'length', '5k'); + equal(willCount, 0, 'should NOT have invoked willCount'); + equal(didCount, 0, 'should NOT have invoked didCount'); + }); + + _internalTestHelpers.testBoth('unwatching should not destroy non MANDATORY_SETTER descriptor', function (get, set) { + var obj = { get foo() { + return 'RUN'; + } }; + + equal(obj.foo, 'RUN', 'obj.foo'); + _emberMetalWatching.watch(obj, 'foo'); + equal(obj.foo, 'RUN', 'obj.foo after watch'); + _emberMetalWatching.unwatch(obj, 'foo'); + equal(obj.foo, 'RUN', 'obj.foo after unwatch'); + }); +}); +enifed('ember-metal/tests/watching/unwatch_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/watching'); + test('ember-metal/tests/watching/unwatch_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/watching/unwatch_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/watching/unwatch_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/watching'); + QUnit.test('ember-metal/tests/watching/unwatch_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/watching/unwatch_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/watching/watch_test', ['exports', 'ember-environment', 'ember-metal/meta', 'ember-metal/property_set', 'ember-metal/property_get', 'ember-metal/computed', 'ember-metal/properties', 'internal-test-helpers', 'ember-metal/events', 'ember-metal/watching'], function (exports, _emberEnvironment, _emberMetalMeta, _emberMetalProperty_set, _emberMetalProperty_get, _emberMetalComputed, _emberMetalProperties, _internalTestHelpers, _emberMetalEvents, _emberMetalWatching) { + 'use strict'; + + var willCount = undefined, + didCount = undefined, + willKeys = undefined, + didKeys = undefined, + originalLookup = undefined, + lookup = undefined; + + QUnit.module('watch', { + setup: function () { + willCount = didCount = 0; + willKeys = []; + didKeys = []; + + originalLookup = _emberEnvironment.context.lookup; + _emberEnvironment.context.lookup = lookup = {}; + }, + + teardown: function () { + _emberEnvironment.context.lookup = originalLookup; + } + }); + + function addListeners(obj, keyPath) { + _emberMetalEvents.addListener(obj, keyPath + ':before', function () { + willCount++; + willKeys.push(keyPath); + }); + _emberMetalEvents.addListener(obj, keyPath + ':change', function () { + didCount++; + didKeys.push(keyPath); + }); + } + + _internalTestHelpers.testBoth('watching a computed property', function (get, set) { + var obj = {}; + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed({ + get: function () { + return this.__foo; + }, + set: function (keyName, value) { + if (value !== undefined) { + this.__foo = value; + } + return this.__foo; + } + })); + addListeners(obj, 'foo'); + + _emberMetalWatching.watch(obj, 'foo'); + set(obj, 'foo', 'bar'); + equal(willCount, 1, 'should have invoked willCount'); + equal(didCount, 1, 'should have invoked didCount'); + }); + + _internalTestHelpers.testBoth('watching a regular defined property', function (get, set) { + var obj = { foo: 'baz' }; + addListeners(obj, 'foo'); + + _emberMetalWatching.watch(obj, 'foo'); + equal(get(obj, 'foo'), 'baz', 'should have original prop'); + + set(obj, 'foo', 'bar'); + equal(willCount, 1, 'should have invoked willCount'); + equal(didCount, 1, 'should have invoked didCount'); + + equal(get(obj, 'foo'), 'bar', 'should get new value'); + equal(obj.foo, 'bar', 'property should be accessible on obj'); + }); + + _internalTestHelpers.testBoth('watching a regular undefined property', function (get, set) { + var obj = {}; + addListeners(obj, 'foo'); + + _emberMetalWatching.watch(obj, 'foo'); + + equal('foo' in obj, false, 'precond undefined'); + + set(obj, 'foo', 'bar'); + + equal(willCount, 1, 'should have invoked willCount'); + equal(didCount, 1, 'should have invoked didCount'); + + equal(get(obj, 'foo'), 'bar', 'should get new value'); + equal(obj.foo, 'bar', 'property should be accessible on obj'); + }); + + _internalTestHelpers.testBoth('watches should inherit', function (get, set) { + var obj = { foo: 'baz' }; + var objB = Object.create(obj); + + addListeners(obj, 'foo'); + _emberMetalWatching.watch(obj, 'foo'); + equal(get(obj, 'foo'), 'baz', 'should have original prop'); + + set(obj, 'foo', 'bar'); + set(objB, 'foo', 'baz'); + equal(willCount, 2, 'should have invoked willCount once only'); + equal(didCount, 2, 'should have invoked didCount once only'); + }); + + QUnit.test('watching an object THEN defining it should work also', function () { + var obj = {}; + addListeners(obj, 'foo'); + + _emberMetalWatching.watch(obj, 'foo'); + + _emberMetalProperties.defineProperty(obj, 'foo'); + _emberMetalProperty_set.set(obj, 'foo', 'bar'); + + equal(_emberMetalProperty_get.default(obj, 'foo'), 'bar', 'should have set'); + equal(willCount, 1, 'should have invoked willChange once'); + equal(didCount, 1, 'should have invoked didChange once'); + }); + + QUnit.test('watching a chain then defining the property', function () { + var obj = {}; + var foo = { bar: 'bar' }; + addListeners(obj, 'foo.bar'); + addListeners(foo, 'bar'); + + _emberMetalWatching.watch(obj, 'foo.bar'); + + _emberMetalProperties.defineProperty(obj, 'foo', undefined, foo); + _emberMetalProperty_set.set(foo, 'bar', 'baz'); + + deepEqual(willKeys, ['foo.bar', 'bar'], 'should have invoked willChange with bar, foo.bar'); + deepEqual(didKeys, ['foo.bar', 'bar'], 'should have invoked didChange with bar, foo.bar'); + equal(willCount, 2, 'should have invoked willChange twice'); + equal(didCount, 2, 'should have invoked didChange twice'); + }); + + QUnit.test('watching a chain then defining the nested property', function () { + var bar = {}; + var obj = { foo: bar }; + var baz = { baz: 'baz' }; + addListeners(obj, 'foo.bar.baz'); + addListeners(baz, 'baz'); + + _emberMetalWatching.watch(obj, 'foo.bar.baz'); + + _emberMetalProperties.defineProperty(bar, 'bar', undefined, baz); + _emberMetalProperty_set.set(baz, 'baz', 'BOO'); + + deepEqual(willKeys, ['foo.bar.baz', 'baz'], 'should have invoked willChange with bar, foo.bar'); + deepEqual(didKeys, ['foo.bar.baz', 'baz'], 'should have invoked didChange with bar, foo.bar'); + equal(willCount, 2, 'should have invoked willChange twice'); + equal(didCount, 2, 'should have invoked didChange twice'); + }); + + _internalTestHelpers.testBoth('watching an object value then unwatching should restore old value', function (get, set) { + var obj = { foo: { bar: { baz: { biff: 'BIFF' } } } }; + addListeners(obj, 'foo.bar.baz.biff'); + + _emberMetalWatching.watch(obj, 'foo.bar.baz.biff'); + + var foo = get(obj, 'foo'); + equal(get(get(get(foo, 'bar'), 'baz'), 'biff'), 'BIFF', 'biff should exist'); + + _emberMetalWatching.unwatch(obj, 'foo.bar.baz.biff'); + equal(get(get(get(foo, 'bar'), 'baz'), 'biff'), 'BIFF', 'biff should exist'); + }); + + QUnit.test('when watching another object, destroy should remove chain watchers from the other object', function () { + var objA = {}; + var objB = { foo: 'bar' }; + objA.b = objB; + addListeners(objA, 'b.foo'); + + _emberMetalWatching.watch(objA, 'b.foo'); + + var meta_objB = _emberMetalMeta.meta(objB); + var chainNode = _emberMetalMeta.meta(objA).readableChains()._chains.b._chains.foo; + + equal(meta_objB.peekWatching('foo'), 1, 'should be watching foo'); + equal(meta_objB.readableChainWatchers().has('foo', chainNode), true, 'should have chain watcher'); + + _emberMetalWatching.destroy(objA); + + equal(meta_objB.peekWatching('foo'), 0, 'should not be watching foo'); + equal(meta_objB.readableChainWatchers().has('foo', chainNode), false, 'should not have chain watcher'); + }); + + // TESTS for length property + + _internalTestHelpers.testBoth('watching "length" property on an object', function (get, set) { + var obj = { length: '26.2 miles' }; + addListeners(obj, 'length'); + + _emberMetalWatching.watch(obj, 'length'); + equal(get(obj, 'length'), '26.2 miles', 'should have original prop'); + + set(obj, 'length', '10k'); + equal(willCount, 1, 'should have invoked willCount'); + equal(didCount, 1, 'should have invoked didCount'); + + equal(get(obj, 'length'), '10k', 'should get new value'); + equal(obj.length, '10k', 'property should be accessible on obj'); + }); + + _internalTestHelpers.testBoth('watching "length" property on an array', function (get, set) { + var arr = []; + addListeners(arr, 'length'); + + _emberMetalWatching.watch(arr, 'length'); + equal(get(arr, 'length'), 0, 'should have original prop'); + + set(arr, 'length', '10'); + equal(willCount, 1, 'should NOT have invoked willCount'); + equal(didCount, 1, 'should NOT have invoked didCount'); + + equal(get(arr, 'length'), 10, 'should get new value'); + equal(arr.length, 10, 'property should be accessible on arr'); + }); + + _internalTestHelpers.testBoth('watch + ES5 getter', function (get) { + var parent = { b: 1 }; + var child = { + get b() { + return parent.b; + } + }; + + equal(parent.b, 1, 'parent.b should be 1'); + equal(child.b, 1, 'child.b should be 1'); + equal(get(child, 'b'), 1, 'Ember.get(child, "b") should be 1'); + + _emberMetalWatching.watch(child, 'b'); + + equal(parent.b, 1, 'parent.b should be 1 (after watch)'); + equal(child.b, 1, 'child.b should be 1 (after watch)'); + + equal(get(child, 'b'), 1, 'Ember.get(child, "b") should be 1 (after watch)'); + }); + + _internalTestHelpers.testBoth('watch + Ember.set + no-descriptor', function (get, set) { + var child = {}; + + equal(child.b, undefined, 'child.b '); + equal(get(child, 'b'), undefined, 'Ember.get(child, "b")'); + + _emberMetalWatching.watch(child, 'b'); + set(child, 'b', 1); + + equal(child.b, 1, 'child.b (after watch)'); + equal(get(child, 'b'), 1, 'Ember.get(child, "b") (after watch)'); + }); +}); +enifed('ember-metal/tests/watching/watch_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/watching'); + test('ember-metal/tests/watching/watch_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/watching/watch_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/watching/watch_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/watching'); + QUnit.test('ember-metal/tests/watching/watch_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/watching/watch_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/weak_map_test', ['exports', 'ember-metal/weak_map'], function (exports, _emberMetalWeak_map) { + 'use strict'; + + QUnit.module('Ember.WeakMap'); + + QUnit.test('has weakMap like qualities', function (assert) { + var map = new _emberMetalWeak_map.default(); + var map2 = new _emberMetalWeak_map.default(); + + var a = {}; + var b = {}; + var c = {}; + + assert.strictEqual(map.get(a), undefined); + assert.strictEqual(map.get(b), undefined); + assert.strictEqual(map.get(c), undefined); + + assert.strictEqual(map2.get(a), undefined); + assert.strictEqual(map2.get(b), undefined); + assert.strictEqual(map2.get(c), undefined); + + assert.strictEqual(map.set(a, 1), map, 'map.set should return itself'); + assert.strictEqual(map.get(a), 1); + assert.strictEqual(map.set(b, undefined), map); + assert.strictEqual(map.set(a, 2), map); + assert.strictEqual(map.get(a), 2); + assert.strictEqual(map.set(b, undefined), map); + + assert.strictEqual(map2.get(a), undefined); + assert.strictEqual(map2.get(b), undefined); + assert.strictEqual(map2.get(c), undefined); + + assert.strictEqual(map.set(c, 1), map); + assert.strictEqual(map.get(c), 1); + assert.strictEqual(map.get(a), 2); + assert.strictEqual(map.get(b), undefined); + + assert.strictEqual(map2.set(a, 3), map2); + assert.strictEqual(map2.set(b, 4), map2); + assert.strictEqual(map2.set(c, 5), map2); + + assert.strictEqual(map2.get(a), 3); + assert.strictEqual(map2.get(b), 4); + assert.strictEqual(map2.get(c), 5); + + assert.strictEqual(map.get(c), 1); + assert.strictEqual(map.get(a), 2); + assert.strictEqual(map.get(b), undefined); + }); + + QUnit.test('WeakMap constructor requres new', function (assert) { + var expectedError = new TypeError('Constructor WeakMap requires \'new\''); + + assert.throws(function () { + // jshint newcap: false + _emberMetalWeak_map.default(); + }, expectedError); + }); + + QUnit.test('constructing a WeakMap with an invalid iterator throws an error', function (assert) { + var expectedError = new TypeError('The weak map constructor polyfill only supports an array argument'); + + assert.throws(function () { + new _emberMetalWeak_map.default({ a: 1 }); + }, expectedError); + }); + + QUnit.test('constructing a WeakMap with a valid iterator inserts the entries', function (assert) { + var a = {}; + var b = {}; + var c = {}; + + var map = new _emberMetalWeak_map.default([[a, 1], [b, 2], [c, 3]]); + + assert.strictEqual(map.get(a), 1); + assert.strictEqual(map.get(b), 2); + assert.strictEqual(map.get(c), 3); + }); + + QUnit.test('that error is thrown when using a primitive key', function (assert) { + var expectedError = new TypeError('Invalid value used as weak map key'); + var map = new _emberMetalWeak_map.default(); + + assert.throws(function () { + return map.set('a', 1); + }, expectedError); + assert.throws(function () { + return map.set(1, 1); + }, expectedError); + assert.throws(function () { + return map.set(true, 1); + }, expectedError); + assert.throws(function () { + return map.set(null, 1); + }, expectedError); + assert.throws(function () { + return map.set(undefined, 1); + }, expectedError); + }); + + QUnit.test('that .has and .delete work as expected', function (assert) { + var map = new _emberMetalWeak_map.default(); + var a = {}; + var b = {}; + var foo = { id: 1, name: 'My file', progress: 0 }; + + assert.strictEqual(map.set(a, foo), map); + assert.strictEqual(map.get(a), foo); + assert.strictEqual(map.has(a), true); + assert.strictEqual(map.has(b), false); + assert.strictEqual(map.delete(a), true); + assert.strictEqual(map.has(a), false); + assert.strictEqual(map.delete(a), false); + assert.strictEqual(map.set(a, undefined), map); + assert.strictEqual(map.has(a), true); + assert.strictEqual(map.delete(a), true); + assert.strictEqual(map.delete(a), false); + assert.strictEqual(map.has(a), false); + }); + + QUnit.test('that .toString works as expected', function (assert) { + var map = new _emberMetalWeak_map.default(); + + assert.strictEqual(map.toString(), '[object WeakMap]'); + }); +}); +enifed('ember-metal/tests/weak_map_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/weak_map_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/weak_map_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/weak_map_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/weak_map_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/weak_map_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/transaction.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/transaction.js should pass jscs', function () { + ok(true, 'ember-metal/transaction.js should pass jscs.'); + }); +}); +enifed('ember-metal/transaction.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/transaction.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/transaction.js should pass jshint.'); + }); +}); +enifed('ember-metal/watch_key.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/watch_key.js should pass jscs', function () { + ok(true, 'ember-metal/watch_key.js should pass jscs.'); + }); +}); +enifed('ember-metal/watch_key.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/watch_key.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/watch_key.js should pass jshint.'); + }); +}); +enifed('ember-metal/watch_path.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/watch_path.js should pass jscs', function () { + ok(true, 'ember-metal/watch_path.js should pass jscs.'); + }); +}); +enifed('ember-metal/watch_path.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/watch_path.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/watch_path.js should pass jshint.'); + }); +}); +enifed('ember-metal/watching.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/watching.js should pass jscs', function () { + ok(true, 'ember-metal/watching.js should pass jscs.'); + }); +}); +enifed('ember-metal/watching.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/watching.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/watching.js should pass jshint.'); + }); +}); +enifed('ember-metal/weak_map.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/weak_map.js should pass jscs', function () { + ok(true, 'ember-metal/weak_map.js should pass jscs.'); + }); +}); +enifed('ember-metal/weak_map.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/weak_map.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/weak_map.js should pass jshint.'); + }); +}); +enifed('ember-routing/ext/controller.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/ext'); + test('ember-routing/ext/controller.js should pass jscs', function () { + ok(true, 'ember-routing/ext/controller.js should pass jscs.'); + }); +}); +enifed('ember-routing/ext/controller.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/ext'); + QUnit.test('ember-routing/ext/controller.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/ext/controller.js should pass jshint.'); + }); +}); +enifed('ember-routing/ext/run_loop.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/ext'); + test('ember-routing/ext/run_loop.js should pass jscs', function () { + ok(true, 'ember-routing/ext/run_loop.js should pass jscs.'); + }); +}); +enifed('ember-routing/ext/run_loop.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/ext'); + QUnit.test('ember-routing/ext/run_loop.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/ext/run_loop.js should pass jshint.'); + }); +}); +enifed('ember-routing/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing'); + test('ember-routing/index.js should pass jscs', function () { + ok(true, 'ember-routing/index.js should pass jscs.'); + }); +}); +enifed('ember-routing/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing'); + QUnit.test('ember-routing/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/index.js should pass jshint.'); + }); +}); +enifed('ember-routing/location/api.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/location'); + test('ember-routing/location/api.js should pass jscs', function () { + ok(true, 'ember-routing/location/api.js should pass jscs.'); + }); +}); +enifed('ember-routing/location/api.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/location'); + QUnit.test('ember-routing/location/api.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/location/api.js should pass jshint.'); + }); +}); +enifed('ember-routing/location/auto_location.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/location'); + test('ember-routing/location/auto_location.js should pass jscs', function () { + ok(true, 'ember-routing/location/auto_location.js should pass jscs.'); + }); +}); +enifed('ember-routing/location/auto_location.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/location'); + QUnit.test('ember-routing/location/auto_location.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/location/auto_location.js should pass jshint.'); + }); +}); +enifed('ember-routing/location/hash_location.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/location'); + test('ember-routing/location/hash_location.js should pass jscs', function () { + ok(true, 'ember-routing/location/hash_location.js should pass jscs.'); + }); +}); +enifed('ember-routing/location/hash_location.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/location'); + QUnit.test('ember-routing/location/hash_location.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/location/hash_location.js should pass jshint.'); + }); +}); +enifed('ember-routing/location/history_location.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/location'); + test('ember-routing/location/history_location.js should pass jscs', function () { + ok(true, 'ember-routing/location/history_location.js should pass jscs.'); + }); +}); +enifed('ember-routing/location/history_location.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/location'); + QUnit.test('ember-routing/location/history_location.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/location/history_location.js should pass jshint.'); + }); +}); +enifed('ember-routing/location/none_location.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/location'); + test('ember-routing/location/none_location.js should pass jscs', function () { + ok(true, 'ember-routing/location/none_location.js should pass jscs.'); + }); +}); +enifed('ember-routing/location/none_location.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/location'); + QUnit.test('ember-routing/location/none_location.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/location/none_location.js should pass jshint.'); + }); +}); +enifed('ember-routing/location/util.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/location'); + test('ember-routing/location/util.js should pass jscs', function () { + ok(true, 'ember-routing/location/util.js should pass jscs.'); + }); +}); +enifed('ember-routing/location/util.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/location'); + QUnit.test('ember-routing/location/util.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/location/util.js should pass jshint.'); + }); +}); +enifed('ember-routing/services/routing.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/services'); + test('ember-routing/services/routing.js should pass jscs', function () { + ok(true, 'ember-routing/services/routing.js should pass jscs.'); + }); +}); +enifed('ember-routing/services/routing.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/services'); + QUnit.test('ember-routing/services/routing.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/services/routing.js should pass jshint.'); + }); +}); +enifed('ember-routing/system/cache.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/system'); + test('ember-routing/system/cache.js should pass jscs', function () { + ok(true, 'ember-routing/system/cache.js should pass jscs.'); + }); +}); +enifed('ember-routing/system/cache.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/system'); + QUnit.test('ember-routing/system/cache.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/system/cache.js should pass jshint.'); + }); +}); +enifed('ember-routing/system/controller_for.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/system'); + test('ember-routing/system/controller_for.js should pass jscs', function () { + ok(true, 'ember-routing/system/controller_for.js should pass jscs.'); + }); +}); +enifed('ember-routing/system/controller_for.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/system'); + QUnit.test('ember-routing/system/controller_for.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/system/controller_for.js should pass jshint.'); + }); +}); +enifed('ember-routing/system/dsl.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/system'); + test('ember-routing/system/dsl.js should pass jscs', function () { + ok(true, 'ember-routing/system/dsl.js should pass jscs.'); + }); +}); +enifed('ember-routing/system/dsl.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/system'); + QUnit.test('ember-routing/system/dsl.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/system/dsl.js should pass jshint.'); + }); +}); +enifed('ember-routing/system/generate_controller.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/system'); + test('ember-routing/system/generate_controller.js should pass jscs', function () { + ok(true, 'ember-routing/system/generate_controller.js should pass jscs.'); + }); +}); +enifed('ember-routing/system/generate_controller.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/system'); + QUnit.test('ember-routing/system/generate_controller.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/system/generate_controller.js should pass jshint.'); + }); +}); +enifed('ember-routing/system/query_params.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/system'); + test('ember-routing/system/query_params.js should pass jscs', function () { + ok(true, 'ember-routing/system/query_params.js should pass jscs.'); + }); +}); +enifed('ember-routing/system/query_params.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/system'); + QUnit.test('ember-routing/system/query_params.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/system/query_params.js should pass jshint.'); + }); +}); +enifed('ember-routing/system/route.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/system'); + test('ember-routing/system/route.js should pass jscs', function () { + ok(true, 'ember-routing/system/route.js should pass jscs.'); + }); +}); +enifed('ember-routing/system/route.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/system'); + QUnit.test('ember-routing/system/route.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/system/route.js should pass jshint.'); + }); +}); +enifed('ember-routing/system/router.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/system'); + test('ember-routing/system/router.js should pass jscs', function () { + ok(true, 'ember-routing/system/router.js should pass jscs.'); + }); +}); +enifed('ember-routing/system/router.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/system'); + QUnit.test('ember-routing/system/router.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/system/router.js should pass jshint.'); + }); +}); +enifed('ember-routing/system/router_state.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/system'); + test('ember-routing/system/router_state.js should pass jscs', function () { + ok(true, 'ember-routing/system/router_state.js should pass jscs.'); + }); +}); +enifed('ember-routing/system/router_state.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/system'); + QUnit.test('ember-routing/system/router_state.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/system/router_state.js should pass jshint.'); + }); +}); +enifed('ember-routing/tests/ext/controller_test', ['exports', 'ember-utils', 'internal-test-helpers', 'ember-runtime'], function (exports, _emberUtils, _internalTestHelpers, _emberRuntime) { + 'use strict'; + + QUnit.module('ember-routing/ext/controller'); + + QUnit.test('transitionToRoute considers an engine\'s mountPoint', function () { + expect(4); + + var router = { + transitionTo: function (route) { + return route; + } + }; + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { + routable: true, + mountPoint: 'foo.bar' + } + }); + + var controller = _emberRuntime.Controller.create({ target: router }); + _emberUtils.setOwner(controller, engineInstance); + + strictEqual(controller.transitionToRoute('application'), 'foo.bar.application', 'properly prefixes application route'); + strictEqual(controller.transitionToRoute('posts'), 'foo.bar.posts', 'properly prefixes child routes'); + throws(function () { + return controller.transitionToRoute('/posts'); + }, 'throws when trying to use a url'); + + var queryParams = {}; + strictEqual(controller.transitionToRoute(queryParams), queryParams, 'passes query param only transitions through'); + }); +}); +enifed('ember-routing/tests/ext/controller_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/tests/ext'); + test('ember-routing/tests/ext/controller_test.js should pass jscs', function () { + ok(true, 'ember-routing/tests/ext/controller_test.js should pass jscs.'); + }); +}); +enifed('ember-routing/tests/ext/controller_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/tests/ext'); + QUnit.test('ember-routing/tests/ext/controller_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/tests/ext/controller_test.js should pass jshint.'); + }); +}); +enifed('ember-routing/tests/location/auto_location_test', ['exports', 'ember-utils', 'ember-environment', 'ember-metal', 'ember-routing/location/auto_location', 'ember-routing/location/history_location', 'ember-routing/location/hash_location', 'ember-routing/location/none_location', 'internal-test-helpers'], function (exports, _emberUtils, _emberEnvironment, _emberMetal, _emberRoutingLocationAuto_location, _emberRoutingLocationHistory_location, _emberRoutingLocationHash_location, _emberRoutingLocationNone_location, _internalTestHelpers) { + 'use strict'; + + function mockBrowserLocation(overrides) { + return _emberUtils.assign({ + href: 'http://test.com/', + pathname: '/', + hash: '', + search: '', + replace: function () { + ok(false, 'location.replace should not be called during testing'); + } + }, overrides); + } + + function mockBrowserHistory(overrides) { + return _emberUtils.assign({ + pushState: function () { + ok(false, 'history.pushState should not be called during testing'); + }, + replaceState: function () { + ok(false, 'history.replaceState should not be called during testing'); + } + }, overrides); + } + + function createLocation(location, history) { + var _AutoLocation$create; + + var owner = _internalTestHelpers.buildOwner(); + + owner.register('location:history', _emberRoutingLocationHistory_location.default); + owner.register('location:hash', _emberRoutingLocationHash_location.default); + owner.register('location:none', _emberRoutingLocationNone_location.default); + + var autolocation = _emberRoutingLocationAuto_location.default.create((_AutoLocation$create = {}, _AutoLocation$create[_emberUtils.OWNER] = owner, _AutoLocation$create.location = location, _AutoLocation$create.history = history, _AutoLocation$create.global = {}, _AutoLocation$create)); + + return autolocation; + } + + var location = undefined; + + QUnit.module('Ember.AutoLocation', { + teardown: function () { + if (location) { + _emberMetal.run(location, 'destroy'); + } + } + }); + + QUnit.test('AutoLocation should have the `global`', function (assert) { + var location = _emberRoutingLocationAuto_location.default.create(); + + assert.ok(location.global, 'has a global defined'); + assert.strictEqual(location.global, _emberEnvironment.environment.window, 'has the environments window global'); + }); + + QUnit.test('AutoLocation should return concrete implementation\'s value for `getURL`', function () { + expect(1); + + var browserLocation = mockBrowserLocation(); + var browserHistory = mockBrowserHistory(); + + location = createLocation(browserLocation, browserHistory); + location.detect(); + + var concreteImplementation = _emberMetal.get(location, 'concreteImplementation'); + + concreteImplementation.getURL = function () { + return '/lincoln/park'; + }; + + equal(location.getURL(), '/lincoln/park'); + }); + + QUnit.test('AutoLocation should use a HistoryLocation instance when pushStates is supported', function () { + expect(1); + + var browserLocation = mockBrowserLocation(); + var browserHistory = mockBrowserHistory(); + + location = createLocation(browserLocation, browserHistory); + location.detect(); + + ok(_emberMetal.get(location, 'concreteImplementation') instanceof _emberRoutingLocationHistory_location.default); + }); + + QUnit.test('AutoLocation should use a HashLocation instance when pushStates are not supported, but hashchange events are and the URL is already in the HashLocation format', function () { + expect(1); + + var browserLocation = mockBrowserLocation({ + hash: '#/testd' + }); + + location = createLocation(browserLocation); + location.global = { + onhashchange: function () {} + }; + + location.detect(); + ok(_emberMetal.get(location, 'concreteImplementation') instanceof _emberRoutingLocationHash_location.default); + }); + + QUnit.test('AutoLocation should use a NoneLocation instance when neither history nor hashchange are supported.', function () { + expect(1); + + location = createLocation(mockBrowserLocation()); + location.detect(); + + ok(_emberMetal.get(location, 'concreteImplementation') instanceof _emberRoutingLocationNone_location.default); + }); + + QUnit.test('AutoLocation should use an index path (i.e. \'/\') without any location.hash as OK for HashLocation', function () { + expect(1); + + var browserLocation = mockBrowserLocation({ + href: 'http://test.com/', + pathname: '/', + hash: '', + search: '', + replace: function (path) { + ok(false, 'location.replace should not be called'); + } + }); + + location = createLocation(browserLocation); + location.global = { + onhashchange: function () {} + }; + + location.detect(); + + ok(_emberMetal.get(location, 'concreteImplementation') instanceof _emberRoutingLocationHash_location.default, 'uses a HashLocation'); + }); + + QUnit.test('AutoLocation should transform the URL for hashchange-only browsers viewing a HistoryLocation-formatted path', function () { + expect(3); + + var browserLocation = mockBrowserLocation({ + hash: '', + hostname: 'test.com', + href: 'http://test.com/test', + pathname: '/test', + protocol: 'http:', + port: '', + search: '', + + replace: function (path) { + equal(path, 'http://test.com/#/test', 'location.replace should be called with normalized HashLocation path'); + } + }); + + var location = createLocation(browserLocation); + location.global = { + onhashchange: function () {} + }; + + location.detect(); + + ok(_emberMetal.get(location, 'concreteImplementation') instanceof _emberRoutingLocationNone_location.default, 'NoneLocation should be used while we attempt to location.replace()'); + equal(_emberMetal.get(location, 'cancelRouterSetup'), true, 'cancelRouterSetup should be set so the router knows.'); + }); + + QUnit.test('AutoLocation should replace the URL for pushState-supported browsers viewing a HashLocation-formatted url', function () { + expect(2); + + var browserLocation = mockBrowserLocation({ + hash: '#/test', + hostname: 'test.com', + href: 'http://test.com/#/test', + pathname: '/', + protocol: 'http:', + port: '', + search: '' + }); + + var browserHistory = mockBrowserHistory({ + replaceState: function (state, title, path) { + equal(path, '/test', 'history.replaceState should be called with normalized HistoryLocation url'); + } + }); + + var location = createLocation(browserLocation, browserHistory); + location.detect(); + + ok(_emberMetal.get(location, 'concreteImplementation'), _emberRoutingLocationHistory_location.default); + }); + + QUnit.test('AutoLocation requires any rootURL given to end in a trailing forward slash', function () { + expect(3); + var browserLocation = mockBrowserLocation(); + var expectedMsg = /rootURL must end with a trailing forward slash e.g. "\/app\/"/; + + location = createLocation(browserLocation); + location.rootURL = 'app'; + + expectAssertion(function () { + location.detect(); + }, expectedMsg); + + location.rootURL = '/app'; + expectAssertion(function () { + location.detect(); + }, expectedMsg); + + // Note the trailing whitespace + location.rootURL = '/app/ '; + expectAssertion(function () { + location.detect(); + }, expectedMsg); + }); + + QUnit.test('AutoLocation provides its rootURL to the concreteImplementation', function () { + expect(1); + var browserLocation = mockBrowserLocation({ + pathname: '/some/subdir/derp' + }); + var browserHistory = mockBrowserHistory(); + + location = createLocation(browserLocation, browserHistory); + location.rootURL = '/some/subdir/'; + + location.detect(); + + var concreteLocation = _emberMetal.get(location, 'concreteImplementation'); + equal(location.rootURL, concreteLocation.rootURL); + }); + + QUnit.test('getHistoryPath() should return a normalized, HistoryLocation-supported path', function () { + expect(3); + + var browserLocation = mockBrowserLocation({ + href: 'http://test.com/app/about?foo=bar#foo', + pathname: '/app/about', + search: '?foo=bar', + hash: '#foo' + }); + + equal(_emberRoutingLocationAuto_location.getHistoryPath('/app/', browserLocation), '/app/about?foo=bar#foo', 'URLs already in HistoryLocation form should come out the same'); + + browserLocation = mockBrowserLocation({ + href: 'http://test.com/app/#/about?foo=bar#foo', + pathname: '/app/', + search: '', + hash: '#/about?foo=bar#foo' + }); + equal(_emberRoutingLocationAuto_location.getHistoryPath('/app/', browserLocation), '/app/about?foo=bar#foo', 'HashLocation formed URLs should be normalized'); + + browserLocation = mockBrowserLocation({ + href: 'http://test.com/app/#about?foo=bar#foo', + pathname: '/app/', + search: '', + hash: '#about?foo=bar#foo' + }); + equal(_emberRoutingLocationAuto_location.getHistoryPath('/app', browserLocation), '/app/#about?foo=bar#foo', 'URLs with a hash not following #/ convention shouldn\'t be normalized as a route'); + }); + + QUnit.test('getHashPath() should return a normalized, HashLocation-supported path', function () { + expect(3); + + var browserLocation = mockBrowserLocation({ + href: 'http://test.com/app/#/about?foo=bar#foo', + pathname: '/app/', + search: '', + hash: '#/about?foo=bar#foo' + }); + equal(_emberRoutingLocationAuto_location.getHashPath('/app/', browserLocation), '/app/#/about?foo=bar#foo', 'URLs already in HistoryLocation form should come out the same'); + + browserLocation = mockBrowserLocation({ + href: 'http://test.com/app/about?foo=bar#foo', + pathname: '/app/about', + search: '?foo=bar', + hash: '#foo' + }); + equal(_emberRoutingLocationAuto_location.getHashPath('/app/', browserLocation), '/app/#/about?foo=bar#foo', 'HistoryLocation formed URLs should be normalized'); + + browserLocation = mockBrowserLocation({ + href: 'http://test.com/app/#about?foo=bar#foo', + pathname: '/app/', + search: '', + hash: '#about?foo=bar#foo' + }); + + equal(_emberRoutingLocationAuto_location.getHashPath('/app/', browserLocation), '/app/#/#about?foo=bar#foo', 'URLs with a hash not following #/ convention shouldn\'t be normalized as a route'); + }); +}); +enifed('ember-routing/tests/location/auto_location_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/tests/location'); + test('ember-routing/tests/location/auto_location_test.js should pass jscs', function () { + ok(true, 'ember-routing/tests/location/auto_location_test.js should pass jscs.'); + }); +}); +enifed('ember-routing/tests/location/auto_location_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/tests/location'); + QUnit.test('ember-routing/tests/location/auto_location_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/tests/location/auto_location_test.js should pass jshint.'); + }); +}); +enifed('ember-routing/tests/location/hash_location_test', ['exports', 'ember-metal', 'ember-routing/location/hash_location'], function (exports, _emberMetal, _emberRoutingLocationHash_location) { + 'use strict'; + + var HashTestLocation = undefined, + location = undefined; + + function createLocation(options) { + if (!options) { + options = {}; + } + location = HashTestLocation.create(options); + } + + function mockBrowserLocation(path) { + // This is a neat trick to auto-magically extract the hostname from any + // url by letting the browser do the work ;) + var tmp = document.createElement('a'); + tmp.href = path; + + var protocol = !tmp.protocol || tmp.protocol === ':' ? 'http' : tmp.protocol; + var pathname = tmp.pathname.match(/^\//) ? tmp.pathname : '/' + tmp.pathname; + + return { + hash: tmp.hash, + host: tmp.host || 'localhost', + hostname: tmp.hostname || 'localhost', + href: tmp.href, + pathname: pathname, + port: tmp.port || '', + protocol: protocol, + search: tmp.search + }; + } + + function triggerHashchange() { + var event = document.createEvent('HTMLEvents'); + event.initEvent('hashchange', true, false); + window.dispatchEvent(event); + } + + QUnit.module('Ember.HashLocation', { + setup: function () { + HashTestLocation = _emberRoutingLocationHash_location.default.extend({ + _location: { + href: 'http://test.com/', + pathname: '/', + hash: '', + search: '', + replace: function () { + ok(false, 'location.replace should not be called during testing'); + } + } + }); + }, + + teardown: function () { + _emberMetal.run(function () { + if (location) { + location.destroy(); + } + }); + } + }); + + QUnit.test('HashLocation.getURL() returns the current url', function () { + expect(1); + + createLocation({ + _location: mockBrowserLocation('/#/foo/bar') + }); + + equal(location.getURL(), '/foo/bar'); + }); + + QUnit.test('HashLocation.getURL() includes extra hashes', function () { + expect(1); + + createLocation({ + _location: mockBrowserLocation('/#/foo#bar#car') + }); + + equal(location.getURL(), '/foo#bar#car'); + }); + + QUnit.test('HashLocation.getURL() assumes location.hash without #/ prefix is not a route path', function () { + expect(1); + + createLocation({ + _location: mockBrowserLocation('/#foo#bar') + }); + + equal(location.getURL(), '/#foo#bar'); + }); + + QUnit.test('HashLocation.getURL() returns a normal forward slash when there is no location.hash', function () { + expect(1); + + createLocation({ + _location: mockBrowserLocation('/') + }); + + equal(location.getURL(), '/'); + }); + + QUnit.test('HashLocation.setURL() correctly sets the url', function () { + expect(2); + + createLocation(); + + location.setURL('/bar'); + + equal(_emberMetal.get(location, 'location.hash'), '/bar'); + equal(_emberMetal.get(location, 'lastSetURL'), '/bar'); + }); + + QUnit.test('HashLocation.replaceURL() correctly replaces to the path with a page reload', function () { + expect(2); + + createLocation({ + _location: { + replace: function (path) { + equal(path, '#/foo'); + } + } + }); + + location.replaceURL('/foo'); + + equal(_emberMetal.get(location, 'lastSetURL'), '/foo'); + }); + + QUnit.test('HashLocation.onUpdateURL callback executes as expected', function () { + expect(1); + + createLocation({ + _location: mockBrowserLocation('/#/foo/bar') + }); + + var callback = function (param) { + equal(param, '/foo/bar', 'path is passed as param'); + }; + + location.onUpdateURL(callback); + + triggerHashchange(); + }); + + QUnit.test('HashLocation.onUpdateURL doesn\'t execute callback if lastSetURL === path', function () { + expect(0); + + createLocation({ + _location: { + href: '/#/foo/bar' + }, + lastSetURL: '/foo/bar' + }); + + var callback = function (param) { + ok(false, 'callback should not be called'); + }; + + location.onUpdateURL(callback); + + triggerHashchange(); + }); + + QUnit.test('HashLocation.formatURL() prepends a # to the provided string', function () { + expect(1); + + createLocation(); + + equal(location.formatURL('/foo#bar'), '#/foo#bar'); + }); + + QUnit.test('HashLocation.willDestroy() cleans up hashchange event listener', function () { + expect(1); + + createLocation(); + + var callback = function (param) { + ok(true, 'should invoke callback once'); + }; + + location.onUpdateURL(callback); + + triggerHashchange(); + + _emberMetal.run(location, 'destroy'); + location = null; + + triggerHashchange(); + }); +}); +enifed('ember-routing/tests/location/hash_location_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/tests/location'); + test('ember-routing/tests/location/hash_location_test.js should pass jscs', function () { + ok(true, 'ember-routing/tests/location/hash_location_test.js should pass jscs.'); + }); +}); +enifed('ember-routing/tests/location/hash_location_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/tests/location'); + QUnit.test('ember-routing/tests/location/hash_location_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/tests/location/hash_location_test.js should pass jshint.'); + }); +}); +enifed('ember-routing/tests/location/history_location_test', ['exports', 'ember-metal', 'ember-routing/location/history_location'], function (exports, _emberMetal, _emberRoutingLocationHistory_location) { + 'use strict'; + + var FakeHistory = undefined, + HistoryTestLocation = undefined, + location = undefined; + + function createLocation(options) { + if (!options) { + options = {}; + } + location = HistoryTestLocation.create(options); + } + + function mockBrowserLocation(path) { + // This is a neat trick to auto-magically extract the hostname from any + // url by letting the browser do the work ;) + var tmp = document.createElement('a'); + tmp.href = path; + + var protocol = !tmp.protocol || tmp.protocol === ':' ? 'http' : tmp.protocol; + var pathname = tmp.pathname.match(/^\//) ? tmp.pathname : '/' + tmp.pathname; + + return { + hash: tmp.hash, + host: tmp.host || 'localhost', + hostname: tmp.hostname || 'localhost', + href: tmp.href, + pathname: pathname, + port: tmp.port || '', + protocol: protocol, + search: tmp.search + }; + } + + QUnit.module('Ember.HistoryLocation', { + setup: function () { + FakeHistory = { + state: null, + _states: [], + replaceState: function (state, title, url) { + this.state = state; + this._states[0] = state; + }, + pushState: function (state, title, url) { + this.state = state; + this._states.unshift(state); + } + }; + + HistoryTestLocation = _emberRoutingLocationHistory_location.default.extend({ + history: FakeHistory + }); + }, + + teardown: function () { + _emberMetal.run(function () { + if (location) { + location.destroy(); + } + }); + } + }); + + QUnit.test('HistoryLocation initState does not get fired on init', function () { + expect(1); + + HistoryTestLocation.reopen({ + init: function () { + ok(true, 'init was called'); + this._super.apply(this, arguments); + }, + initState: function () { + ok(false, 'initState() should not be called automatically'); + } + }); + + createLocation(); + }); + + QUnit.test('webkit doesn\'t fire popstate on page load', function () { + expect(1); + + HistoryTestLocation.reopen({ + initState: function () { + this._super.apply(this, arguments); + // these two should be equal to be able + // to successfully detect webkit initial popstate + equal(this._previousURL, this.getURL()); + } + }); + + createLocation(); + location.initState(); + }); + + QUnit.test('base URL is removed when retrieving the current pathname', function () { + expect(1); + + HistoryTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + + _emberMetal.set(this, 'location', mockBrowserLocation('/base/foo/bar')); + _emberMetal.set(this, 'baseURL', '/base/'); + }, + + initState: function () { + this._super.apply(this, arguments); + + equal(this.getURL(), '/foo/bar'); + } + }); + + createLocation(); + location.initState(); + }); + + QUnit.test('base URL is preserved when moving around', function () { + expect(1); + + HistoryTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + + _emberMetal.set(this, 'location', mockBrowserLocation('/base/foo/bar')); + _emberMetal.set(this, 'baseURL', '/base/'); + } + }); + + createLocation(); + location.initState(); + location.setURL('/one/two'); + + equal(location._historyState.path, '/base/one/two'); + }); + + QUnit.test('setURL continues to set even with a null state (iframes may set this)', function () { + expect(1); + + createLocation(); + location.initState(); + + FakeHistory.pushState(null); + location.setURL('/three/four'); + + equal(location._historyState.path, '/three/four'); + }); + + QUnit.test('replaceURL continues to set even with a null state (iframes may set this)', function () { + expect(1); + + createLocation(); + location.initState(); + + FakeHistory.pushState(null); + location.replaceURL('/three/four'); + + equal(location._historyState.path, '/three/four'); + }); + + QUnit.test('HistoryLocation.getURL() returns the current url, excluding both rootURL and baseURL', function () { + expect(1); + + HistoryTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + + _emberMetal.set(this, 'location', mockBrowserLocation('/base/foo/bar')); + _emberMetal.set(this, 'rootURL', '/app/'); + _emberMetal.set(this, 'baseURL', '/base/'); + } + }); + + createLocation(); + + equal(location.getURL(), '/foo/bar'); + }); + + QUnit.test('HistoryLocation.getURL() returns the current url, does not remove rootURL if its not at start of url', function () { + expect(1); + + HistoryTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + + _emberMetal.set(this, 'location', mockBrowserLocation('/foo/bar/baz')); + _emberMetal.set(this, 'rootURL', '/bar/'); + } + }); + + createLocation(); + + equal(location.getURL(), '/foo/bar/baz'); + }); + + QUnit.test('HistoryLocation.getURL() will not remove the rootURL when only a partial match', function () { + expect(1); + + HistoryTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + _emberMetal.set(this, 'location', mockBrowserLocation('/bars/baz')); + _emberMetal.set(this, 'rootURL', '/bar/'); + } + }); + + createLocation(); + + equal(location.getURL(), '/bars/baz'); + }); + + QUnit.test('HistoryLocation.getURL() returns the current url, does not remove baseURL if its not at start of url', function () { + expect(1); + + HistoryTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + + _emberMetal.set(this, 'location', mockBrowserLocation('/foo/bar/baz')); + _emberMetal.set(this, 'baseURL', '/bar/'); + } + }); + + createLocation(); + + equal(location.getURL(), '/foo/bar/baz'); + }); + + QUnit.test('HistoryLocation.getURL() will not remove the baseURL when only a partial match', function () { + expect(1); + + HistoryTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + _emberMetal.set(this, 'location', mockBrowserLocation('/bars/baz')); + _emberMetal.set(this, 'baseURL', '/bar/'); + } + }); + + createLocation(); + + equal(location.getURL(), '/bars/baz'); + }); + + QUnit.test('HistoryLocation.getURL() includes location.search', function () { + expect(1); + + HistoryTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + _emberMetal.set(this, 'location', mockBrowserLocation('/foo/bar?time=morphin')); + } + }); + + createLocation(); + + equal(location.getURL(), '/foo/bar?time=morphin'); + }); + + QUnit.test('HistoryLocation.getURL() includes location.hash', function () { + expect(1); + + HistoryTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + _emberMetal.set(this, 'location', mockBrowserLocation('/foo/bar#pink-power-ranger')); + } + }); + + createLocation(); + + equal(location.getURL(), '/foo/bar#pink-power-ranger'); + }); + + QUnit.test('HistoryLocation.getURL() includes location.hash and location.search', function () { + expect(1); + + HistoryTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + _emberMetal.set(this, 'location', mockBrowserLocation('/foo/bar?time=morphin#pink-power-ranger')); + } + }); + + createLocation(); + + equal(location.getURL(), '/foo/bar?time=morphin#pink-power-ranger'); + }); +}); +enifed('ember-routing/tests/location/history_location_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/tests/location'); + test('ember-routing/tests/location/history_location_test.js should pass jscs', function () { + ok(true, 'ember-routing/tests/location/history_location_test.js should pass jscs.'); + }); +}); +enifed('ember-routing/tests/location/history_location_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/tests/location'); + QUnit.test('ember-routing/tests/location/history_location_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/tests/location/history_location_test.js should pass jshint.'); + }); +}); +enifed('ember-routing/tests/location/none_location_test', ['exports', 'ember-metal', 'ember-routing/location/none_location'], function (exports, _emberMetal, _emberRoutingLocationNone_location) { + 'use strict'; + + var NoneTestLocation = undefined, + location = undefined; + + function createLocation(options) { + if (!options) { + options = {}; + } + location = NoneTestLocation.create(options); + } + + QUnit.module('Ember.NoneLocation', { + setup: function () { + NoneTestLocation = _emberRoutingLocationNone_location.default.extend({}); + }, + + teardown: function () { + _emberMetal.run(function () { + if (location) { + location.destroy(); + } + }); + } + }); + + QUnit.test('NoneLocation.formatURL() returns the current url always appending rootURL', function () { + expect(1); + + NoneTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + _emberMetal.set(this, 'rootURL', '/en/'); + } + }); + + createLocation(); + + equal(location.formatURL('/foo/bar'), '/en/foo/bar'); + }); + + QUnit.test('NoneLocation.getURL() returns the current path minus rootURL', function () { + expect(1); + + NoneTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + _emberMetal.set(this, 'rootURL', '/foo/'); + _emberMetal.set(this, 'path', '/foo/bar'); + } + }); + + createLocation(); + + equal(location.getURL(), '/bar'); + }); + + QUnit.test('NoneLocation.getURL() will remove the rootURL only from the beginning of a url', function () { + expect(1); + + NoneTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + _emberMetal.set(this, 'rootURL', '/bar/'); + _emberMetal.set(this, 'path', '/foo/bar/baz'); + } + }); + + createLocation(); + + equal(location.getURL(), '/foo/bar/baz'); + }); + + QUnit.test('NoneLocation.getURL() will not remove the rootURL when only a partial match', function () { + expect(1); + + NoneTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + _emberMetal.set(this, 'rootURL', '/bar/'); + _emberMetal.set(this, 'path', '/bars/baz'); + } + }); + + createLocation(); + + equal(location.getURL(), '/bars/baz'); + }); +}); +enifed('ember-routing/tests/location/none_location_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/tests/location'); + test('ember-routing/tests/location/none_location_test.js should pass jscs', function () { + ok(true, 'ember-routing/tests/location/none_location_test.js should pass jscs.'); + }); +}); +enifed('ember-routing/tests/location/none_location_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/tests/location'); + QUnit.test('ember-routing/tests/location/none_location_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/tests/location/none_location_test.js should pass jshint.'); + }); +}); +enifed('ember-routing/tests/location/util_test', ['exports', 'ember-utils', 'ember-routing/location/util'], function (exports, _emberUtils, _emberRoutingLocationUtil) { + 'use strict'; + + function mockBrowserLocation(overrides) { + return _emberUtils.assign({ + href: 'http://test.com/', + pathname: '/', + hash: '', + search: '', + replace: function () { + ok(false, 'location.replace should not be called during testing'); + } + }, overrides); + } + + QUnit.module('Location Utilities'); + + QUnit.test('replacePath cannot be used to redirect to a different origin', function () { + expect(1); + + var expectedURL = undefined; + + var location = { + protocol: 'http:', + hostname: 'emberjs.com', + port: '1337', + + replace: function (url) { + equal(url, expectedURL); + } + }; + + expectedURL = 'http://emberjs.com:1337//google.com'; + _emberRoutingLocationUtil.replacePath(location, '//google.com'); + }); + + QUnit.test('getPath() should normalize location.pathname, making sure it always returns a leading slash', function () { + expect(2); + + var location = mockBrowserLocation({ pathname: 'test' }); + equal(_emberRoutingLocationUtil.getPath(location), '/test', 'When there is no leading slash, one is added.'); + + location = mockBrowserLocation({ pathname: '/test' }); + equal(_emberRoutingLocationUtil.getPath(location), '/test', 'When a leading slash is already there, it isn\'t added again'); + }); + + QUnit.test('getQuery() should return location.search as-is', function () { + expect(1); + + var location = mockBrowserLocation({ search: '?foo=bar' }); + equal(_emberRoutingLocationUtil.getQuery(location), '?foo=bar'); + }); + + QUnit.test('getFullPath() should return full pathname including query and hash', function () { + expect(1); + + var location = mockBrowserLocation({ + href: 'http://test.com/about?foo=bar#foo', + pathname: '/about', + search: '?foo=bar', + hash: '#foo' + }); + + equal(_emberRoutingLocationUtil.getFullPath(location), '/about?foo=bar#foo'); + }); + + QUnit.test('Feature-Detecting onhashchange', function () { + equal(_emberRoutingLocationUtil.supportsHashChange(undefined, { onhashchange: function () {} }), true, 'When not in IE, use onhashchange existence as evidence of the feature'); + equal(_emberRoutingLocationUtil.supportsHashChange(undefined, {}), false, 'When not in IE, use onhashchange absence as evidence of the feature absence'); + equal(_emberRoutingLocationUtil.supportsHashChange(7, { onhashchange: function () {} }), false, 'When in IE7 compatibility mode, never report existence of the feature'); + equal(_emberRoutingLocationUtil.supportsHashChange(8, { onhashchange: function () {} }), true, 'When in IE8+, use onhashchange existence as evidence of the feature'); + }); + + // jscs:disable + QUnit.test("Feature-detecting the history API", function () { + equal(_emberRoutingLocationUtil.supportsHistory("", { pushState: true }), true, "returns true if not Android Gingerbread and history.pushState exists"); + equal(_emberRoutingLocationUtil.supportsHistory("", {}), false, "returns false if history.pushState doesn't exist"); + equal(_emberRoutingLocationUtil.supportsHistory("", undefined), false, "returns false if history doesn't exist"); + + equal(_emberRoutingLocationUtil.supportsHistory("Mozilla/5.0 (Linux; U; Android 2.3.5; en-us; HTC Vision Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", { pushState: true }), false, "returns false if Android 2.x stock browser (not Chrome) claiming to support pushState"); + + equal(_emberRoutingLocationUtil.supportsHistory("Mozilla/5.0 (Linux; U; Android 4.0.3; nl-nl; GT-N7000 Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", { pushState: true }), false, "returns false for Android 4.0.x stock browser (not Chrome) claiming to support pushState"); + + equal(_emberRoutingLocationUtil.supportsHistory("Mozilla/5.0 (Linux; U; Android 20.3.5; en-us; HTC Vision Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", { pushState: true }), true, "returns true if Android version begins with 2, but is greater than 2"); + + equal(_emberRoutingLocationUtil.supportsHistory("Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19", { pushState: true }), true, "returns true for Chrome (not stock browser) on Android 4.0.x"); + + // Windows Phone UA and History API: https://github.com/Modernizr/Modernizr/issues/1471 + equal(_emberRoutingLocationUtil.supportsHistory("Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; Microsoft; Virtual) like iPhone OS 7_0_3 Mac OS X AppleWebKit/537 (KHTML, like Gecko) Mobile Safari/537", { pushState: true }), true, "returns true for Windows Phone 8.1 with misleading user agent string"); + }); + // jscs:enable +}); +enifed('ember-routing/tests/location/util_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/tests/location'); + test('ember-routing/tests/location/util_test.js should pass jscs', function () { + ok(true, 'ember-routing/tests/location/util_test.js should pass jscs.'); + }); +}); +enifed('ember-routing/tests/location/util_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/tests/location'); + QUnit.test('ember-routing/tests/location/util_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/tests/location/util_test.js should pass jshint.'); + }); +}); +enifed('ember-routing/tests/system/cache_test', ['exports', 'ember-routing/system/cache'], function (exports, _emberRoutingSystemCache) { + 'use strict'; + + QUnit.module('BucketCache', { + setup: function () { + this.cache = _emberRoutingSystemCache.default.create(); + } + }); + + QUnit.test('has - returns false when bucket is not in cache', function (assert) { + assert.strictEqual(this.cache.has('foo'), false); + assert.strictEqual(this.cache.has('constructor'), false); + }); + + QUnit.test('has - returns true when bucket is in cache', function (assert) { + var token = {}; + + this.cache.stash('foo', 'bar', token); + this.cache.stash('constructor', 'bar', token); + + assert.strictEqual(this.cache.has('foo'), true); + assert.strictEqual(this.cache.has('constructor'), true); + }); + + QUnit.test('lookup - returns stashed value if key does exist in bucket', function (assert) { + var token = {}; + var defaultValue = {}; + + this.cache.stash('foo', 'bar', token); + + assert.strictEqual(this.cache.lookup('foo', 'bar', defaultValue), token); + }); + + QUnit.test('lookup - returns default value if key does not exist in bucket', function (assert) { + var token = {}; + var defaultValue = {}; + + this.cache.stash('foo', 'bar', token); + + assert.strictEqual(this.cache.lookup('foo', 'boo', defaultValue), defaultValue); + assert.strictEqual(this.cache.lookup('foo', 'constructor', defaultValue), defaultValue); + }); + + QUnit.test('lookup - returns default value if bucket does not exist', function (assert) { + var defaultValue = {}; + + assert.strictEqual(this.cache.lookup('boo', 'bar', defaultValue), defaultValue); + assert.strictEqual(this.cache.lookup('constructor', 'bar', defaultValue), defaultValue); + }); +}); +enifed('ember-routing/tests/system/cache_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/tests/system'); + test('ember-routing/tests/system/cache_test.js should pass jscs', function () { + ok(true, 'ember-routing/tests/system/cache_test.js should pass jscs.'); + }); +}); +enifed('ember-routing/tests/system/cache_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/tests/system'); + QUnit.test('ember-routing/tests/system/cache_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/tests/system/cache_test.js should pass jshint.'); + }); +}); +enifed('ember-routing/tests/system/controller_for_test', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/system/controller_for', 'ember-routing/system/generate_controller', 'internal-test-helpers'], function (exports, _emberMetal, _emberRuntime, _emberRoutingSystemController_for, _emberRoutingSystemGenerate_controller, _internalTestHelpers) { + 'use strict'; + + function buildInstance(namespace) { + var owner = _internalTestHelpers.buildOwner(); + + owner.__registry__.resolver = resolverFor(namespace); + owner.registerOptionsForType('view', { singleton: false }); + + owner.register('application:main', namespace, { instantiate: false }); + + owner.register('controller:basic', _emberRuntime.Controller, { instantiate: false }); + + return owner; + } + + function resolverFor(namespace) { + return { + resolve: function (fullName) { + var nameParts = fullName.split(':'); + var type = nameParts[0]; + var name = nameParts[1]; + + if (name === 'basic') { + name = ''; + } + var className = _emberRuntime.String.classify(name) + _emberRuntime.String.classify(type); + var factory = _emberMetal.get(namespace, className); + + if (factory) { + return factory; + } + } + }; + } + + var appInstance = undefined, + appController = undefined, + namespace = undefined; + + QUnit.module('Ember.controllerFor', { + setup: function () { + namespace = _emberRuntime.Namespace.create(); + appInstance = buildInstance(namespace); + appInstance.register('controller:app', _emberRuntime.Controller.extend()); + appController = appInstance.lookup('controller:app'); + }, + teardown: function () { + _emberMetal.run(function () { + appInstance.destroy(); + namespace.destroy(); + }); + } + }); + + QUnit.test('controllerFor should lookup for registered controllers', function () { + var controller = _emberRoutingSystemController_for.default(appInstance, 'app'); + + equal(appController, controller, 'should find app controller'); + }); + + QUnit.module('Ember.generateController', { + setup: function () { + namespace = _emberRuntime.Namespace.create(); + appInstance = buildInstance(namespace); + }, + teardown: function () { + _emberMetal.run(function () { + appInstance.destroy(); + namespace.destroy(); + }); + } + }); + + QUnit.test('generateController should create Ember.Controller', function () { + var controller = _emberRoutingSystemGenerate_controller.default(appInstance, 'home'); + + ok(controller instanceof _emberRuntime.Controller, 'should create controller'); + }); + + QUnit.test('generateController should create App.Controller if provided', function () { + var controller = undefined; + namespace.Controller = _emberRuntime.Controller.extend(); + + controller = _emberRoutingSystemGenerate_controller.default(appInstance, 'home'); + + ok(controller instanceof namespace.Controller, 'should create controller'); + }); +}); +// A +enifed('ember-routing/tests/system/controller_for_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/tests/system'); + test('ember-routing/tests/system/controller_for_test.js should pass jscs', function () { + ok(true, 'ember-routing/tests/system/controller_for_test.js should pass jscs.'); + }); +}); +enifed('ember-routing/tests/system/controller_for_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/tests/system'); + QUnit.test('ember-routing/tests/system/controller_for_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/tests/system/controller_for_test.js should pass jshint.'); + }); +}); +enifed('ember-routing/tests/system/dsl_test', ['exports', 'ember-utils', 'ember-routing/system/router', 'internal-test-helpers'], function (exports, _emberUtils, _emberRoutingSystemRouter, _internalTestHelpers) { + 'use strict'; + + var Router = undefined; + + function setup() { + Router = _emberRoutingSystemRouter.default.extend(); + } + + function teardown() { + Router = null; + } + + QUnit.module('Ember Router DSL', { + setup: setup, + teardown: teardown + }); + + QUnit.test('should fail when using a reserved route name', function () { + expectDeprecation('this.resource() is deprecated. Use this.route(\'name\', { resetNamespace: true }, function () {}) instead.'); + var reservedNames = ['array', 'basic', 'object', 'application']; + + expect(reservedNames.length * 2 + 1); + + reservedNames.forEach(function (reservedName) { + expectAssertion(function () { + Router = _emberRoutingSystemRouter.default.extend(); + + Router.map(function () { + this.route(reservedName); + }); + + var router = Router.create(); + router._initRouterJs(); + }, '\'' + reservedName + '\' cannot be used as a route name.'); + + expectAssertion(function () { + Router = _emberRoutingSystemRouter.default.extend(); + + Router.map(function () { + this.resource(reservedName); + }); + + var router = Router.create(); + router._initRouterJs(); + }, '\'' + reservedName + '\' cannot be used as a route name.'); + }); + }); + + QUnit.test('should reset namespace if nested with resource', function () { + expectDeprecation('this.resource() is deprecated. Use this.route(\'name\', { resetNamespace: true }, function () {}) instead.'); + + Router = Router.map(function () { + this.resource('bleep', function () { + this.resource('bloop', function () { + this.resource('blork'); + }); + }); + }); + + var router = Router.create(); + router._initRouterJs(); + + ok(router.router.recognizer.names['bleep'], 'nested resources do not contain parent name'); + ok(router.router.recognizer.names['bloop'], 'nested resources do not contain parent name'); + ok(router.router.recognizer.names['blork'], 'nested resources do not contain parent name'); + }); + + QUnit.test('should retain resource namespace if nested with routes', function () { + Router = Router.map(function () { + this.route('bleep', function () { + this.route('bloop', function () { + this.route('blork'); + }); + }); + }); + + var router = Router.create(); + router._initRouterJs(); + + ok(router.router.recognizer.names['bleep'], 'parent name was used as base of nested routes'); + ok(router.router.recognizer.names['bleep.bloop'], 'parent name was used as base of nested routes'); + ok(router.router.recognizer.names['bleep.bloop.blork'], 'parent name was used as base of nested routes'); + }); + + QUnit.test('should add loading and error routes if _isRouterMapResult is true', function () { + Router.map(function () { + this.route('blork'); + }); + + var router = Router.create({ + _hasModuleBasedResolver: function () { + return true; + } + }); + + router._initRouterJs(); + + ok(router.router.recognizer.names['blork'], 'main route was created'); + ok(router.router.recognizer.names['blork_loading'], 'loading route was added'); + ok(router.router.recognizer.names['blork_error'], 'error route was added'); + }); + + QUnit.test('should not add loading and error routes if _isRouterMapResult is false', function () { + Router.map(function () { + this.route('blork'); + }); + + var router = Router.create(); + router._initRouterJs(false); + + ok(router.router.recognizer.names['blork'], 'main route was created'); + ok(!router.router.recognizer.names['blork_loading'], 'loading route was not added'); + ok(!router.router.recognizer.names['blork_error'], 'error route was not added'); + }); + + QUnit.test('should reset namespace of loading and error routes for routes with resetNamespace', function () { + Router.map(function () { + this.route('blork', function () { + this.route('blorp'); + this.route('bleep', { resetNamespace: true }); + }); + }); + + var router = Router.create({ + _hasModuleBasedResolver: function () { + return true; + } + }); + + router._initRouterJs(); + + ok(router.router.recognizer.names['blork.blorp'], 'nested route was created'); + ok(router.router.recognizer.names['blork.blorp_loading'], 'nested loading route was added'); + ok(router.router.recognizer.names['blork.blorp_error'], 'nested error route was added'); + + ok(router.router.recognizer.names['bleep'], 'reset route was created'); + ok(router.router.recognizer.names['bleep_loading'], 'reset loading route was added'); + ok(router.router.recognizer.names['bleep_error'], 'reset error route was added'); + + ok(!router.router.recognizer.names['blork.bleep'], 'nested reset route was not created'); + ok(!router.router.recognizer.names['blork.bleep_loading'], 'nested reset loading route was not added'); + ok(!router.router.recognizer.names['blork.bleep_error'], 'nested reset error route was not added'); + }); + + QUnit.test('should throw an error when defining a route serializer outside an engine', function () { + Router.map(function () { + var _this = this; + + throws(function () { + _this.route('posts', { serialize: function () {} }); + }, /Defining a route serializer on route 'posts' outside an Engine is not allowed/); + }); + + Router.create()._initRouterJs(); + }); + + QUnit.module('Ember Router DSL with engines', { + setup: setup, + teardown: teardown + }); + + QUnit.test('should allow mounting of engines', function (assert) { + assert.expect(3); + + Router = Router.map(function () { + this.route('bleep', function () { + this.route('bloop', function () { + this.mount('chat'); + }); + }); + }); + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { routable: true } + }); + + var router = Router.create(); + _emberUtils.setOwner(router, engineInstance); + router._initRouterJs(); + + assert.ok(router.router.recognizer.names['bleep'], 'parent name was used as base of nested routes'); + assert.ok(router.router.recognizer.names['bleep.bloop'], 'parent name was used as base of nested routes'); + assert.ok(router.router.recognizer.names['bleep.bloop.chat'], 'parent name was used as base of mounted engine'); + }); + + QUnit.test('should allow mounting of engines at a custom path', function (assert) { + assert.expect(1); + + Router = Router.map(function () { + this.route('bleep', function () { + this.route('bloop', function () { + this.mount('chat', { path: 'custom-chat' }); + }); + }); + }); + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { routable: true } + }); + + var router = Router.create(); + _emberUtils.setOwner(router, engineInstance); + router._initRouterJs(); + + assert.deepEqual(router.router.recognizer.names['bleep.bloop.chat'].segments.slice(1, 4).map(function (s) { + return s.string; + }), ['bleep', 'bloop', 'custom-chat'], 'segments are properly associated with mounted engine'); + }); + + QUnit.test('should allow aliasing of engine names with `as`', function (assert) { + assert.expect(1); + + Router = Router.map(function () { + this.route('bleep', function () { + this.route('bloop', function () { + this.mount('chat', { as: 'blork' }); + }); + }); + }); + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { routable: true } + }); + + var router = Router.create(); + _emberUtils.setOwner(router, engineInstance); + router._initRouterJs(); + + assert.deepEqual(router.router.recognizer.names['bleep.bloop.blork'].segments.slice(1, 4).map(function (s) { + return s.string; + }), ['bleep', 'bloop', 'blork'], 'segments are properly associated with mounted engine with aliased name'); + }); + + QUnit.test('should add loading and error routes to a mount if _isRouterMapResult is true', function () { + Router.map(function () { + this.mount('chat'); + }); + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { routable: true } + }); + + var router = Router.create({ + _hasModuleBasedResolver: function () { + return true; + } + }); + _emberUtils.setOwner(router, engineInstance); + router._initRouterJs(); + + ok(router.router.recognizer.names['chat'], 'main route was created'); + ok(router.router.recognizer.names['chat_loading'], 'loading route was added'); + ok(router.router.recognizer.names['chat_error'], 'error route was added'); + }); + + QUnit.test('should add loading and error routes to a mount alias if _isRouterMapResult is true', function () { + Router.map(function () { + this.mount('chat', { as: 'shoutbox' }); + }); + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { routable: true } + }); + + var router = Router.create({ + _hasModuleBasedResolver: function () { + return true; + } + }); + _emberUtils.setOwner(router, engineInstance); + router._initRouterJs(); + + ok(router.router.recognizer.names['shoutbox'], 'main route was created'); + ok(router.router.recognizer.names['shoutbox_loading'], 'loading route was added'); + ok(router.router.recognizer.names['shoutbox_error'], 'error route was added'); + }); + + QUnit.test('should not add loading and error routes to a mount if _isRouterMapResult is false', function () { + Router.map(function () { + this.mount('chat'); + }); + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { routable: true } + }); + + var router = Router.create(); + _emberUtils.setOwner(router, engineInstance); + router._initRouterJs(false); + + ok(router.router.recognizer.names['chat'], 'main route was created'); + ok(!router.router.recognizer.names['chat_loading'], 'loading route was not added'); + ok(!router.router.recognizer.names['chat_error'], 'error route was not added'); + }); + + QUnit.test('should reset namespace of loading and error routes for mounts with resetNamespace', function () { + Router.map(function () { + this.route('news', function () { + this.mount('chat'); + this.mount('blog', { resetNamespace: true }); + }); + }); + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { routable: true } + }); + + var router = Router.create({ + _hasModuleBasedResolver: function () { + return true; + } + }); + _emberUtils.setOwner(router, engineInstance); + router._initRouterJs(); + + ok(router.router.recognizer.names['news.chat'], 'nested route was created'); + ok(router.router.recognizer.names['news.chat_loading'], 'nested loading route was added'); + ok(router.router.recognizer.names['news.chat_error'], 'nested error route was added'); + + ok(router.router.recognizer.names['blog'], 'reset route was created'); + ok(router.router.recognizer.names['blog_loading'], 'reset loading route was added'); + ok(router.router.recognizer.names['blog_error'], 'reset error route was added'); + + ok(!router.router.recognizer.names['news.blog'], 'nested reset route was not created'); + ok(!router.router.recognizer.names['news.blog_loading'], 'nested reset loading route was not added'); + ok(!router.router.recognizer.names['news.blog_error'], 'nested reset error route was not added'); + }); +}); +enifed('ember-routing/tests/system/dsl_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/tests/system'); + test('ember-routing/tests/system/dsl_test.js should pass jscs', function () { + ok(true, 'ember-routing/tests/system/dsl_test.js should pass jscs.'); + }); +}); +enifed('ember-routing/tests/system/dsl_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/tests/system'); + QUnit.test('ember-routing/tests/system/dsl_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/tests/system/dsl_test.js should pass jshint.'); + }); +}); +enifed('ember-routing/tests/system/route_test', ['exports', 'ember-utils', 'internal-test-helpers', 'ember-runtime', 'ember-routing/system/route'], function (exports, _emberUtils, _internalTestHelpers, _emberRuntime, _emberRoutingSystemRoute) { + 'use strict'; + + var route = undefined, + routeOne = undefined, + routeTwo = undefined, + lookupHash = undefined; + + function setup() { + route = _emberRoutingSystemRoute.default.create(); + } + + function teardown() { + _internalTestHelpers.runDestroy(route); + } + + QUnit.module('Ember.Route', { + setup: setup, + teardown: teardown + }); + + QUnit.test('default store utilizes the container to acquire the model factory', function () { + expect(4); + + var Post = _emberRuntime.Object.extend(); + var post = {}; + + Post.reopenClass({ + find: function (id) { + return post; + } + }); + + _emberUtils.setOwner(route, _internalTestHelpers.buildOwner({ + ownerOptions: { + hasRegistration: function () { + return true; + }, + + _lookupFactory: function (fullName) { + equal(fullName, 'model:post', 'correct factory was looked up'); + + return Post; + } + } + })); + + route.set('_qp', null); + + equal(route.model({ post_id: 1 }), post); + equal(route.findModel('post', 1), post, '#findModel returns the correct post'); + }); + + QUnit.test('\'store\' can be injected by data persistence frameworks', function () { + expect(8); + _internalTestHelpers.runDestroy(route); + + var owner = _internalTestHelpers.buildOwner(); + + var post = { + id: 1 + }; + + var Store = _emberRuntime.Object.extend({ + find: function (type, value) { + ok(true, 'injected model was called'); + equal(type, 'post', 'correct type was called'); + equal(value, 1, 'correct value was called'); + return post; + } + }); + + owner.register('route:index', _emberRoutingSystemRoute.default); + owner.register('store:main', Store); + + owner.inject('route', 'store', 'store:main'); + + route = owner.lookup('route:index'); + + equal(route.model({ post_id: 1 }), post, '#model returns the correct post'); + equal(route.findModel('post', 1), post, '#findModel returns the correct post'); + }); + + QUnit.test('assert if \'store.find\' method is not found', function () { + expect(1); + _internalTestHelpers.runDestroy(route); + + var owner = _internalTestHelpers.buildOwner(); + var Post = _emberRuntime.Object.extend(); + + owner.register('route:index', _emberRoutingSystemRoute.default); + owner.register('model:post', Post); + + route = owner.lookup('route:index'); + + expectAssertion(function () { + route.findModel('post', 1); + }, 'Post has no method `find`.'); + }); + + QUnit.test('asserts if model class is not found', function () { + expect(1); + _internalTestHelpers.runDestroy(route); + + var owner = _internalTestHelpers.buildOwner(); + owner.register('route:index', _emberRoutingSystemRoute.default); + + route = owner.lookup('route:index'); + + expectAssertion(function () { + route.model({ post_id: 1 }); + }, /You used the dynamic segment post_id in your route undefined, but .Post did not exist and you did not override your route\'s `model` hook./); + }); + + QUnit.test('\'store\' does not need to be injected', function () { + expect(1); + + _internalTestHelpers.runDestroy(route); + + var owner = _internalTestHelpers.buildOwner(); + + owner.register('route:index', _emberRoutingSystemRoute.default); + + route = owner.lookup('route:index'); + + ignoreAssertion(function () { + route.model({ post_id: 1 }); + }); + + ok(true, 'no error was raised'); + }); + + QUnit.test('modelFor doesn\'t require the router', function () { + expect(1); + + var owner = _internalTestHelpers.buildOwner(); + _emberUtils.setOwner(route, owner); + + var foo = { name: 'foo' }; + + var FooRoute = _emberRoutingSystemRoute.default.extend({ + currentModel: foo + }); + + owner.register('route:foo', FooRoute); + + strictEqual(route.modelFor('foo'), foo); + }); + + QUnit.test('.send just calls an action if the router is absent', function () { + expect(7); + var route = _emberRoutingSystemRoute.default.extend({ + actions: { + returnsTrue: function (foo, bar) { + equal(foo, 1); + equal(bar, 2); + equal(this, route); + return true; + }, + + returnsFalse: function () { + ok(true, 'returnsFalse was called'); + return false; + } + } + }).create(); + + equal(true, route.send('returnsTrue', 1, 2)); + equal(false, route.send('returnsFalse')); + equal(undefined, route.send('nonexistent', 1, 2, 3)); + }); + + QUnit.test('.send just calls an action if the routers internal router property is absent', function () { + expect(7); + var route = _emberRoutingSystemRoute.default.extend({ + router: {}, + actions: { + returnsTrue: function (foo, bar) { + equal(foo, 1); + equal(bar, 2); + equal(this, route); + return true; + }, + + returnsFalse: function () { + ok(true, 'returnsFalse was called'); + return false; + } + } + }).create(); + + equal(true, route.send('returnsTrue', 1, 2)); + equal(false, route.send('returnsFalse')); + equal(undefined, route.send('nonexistent', 1, 2, 3)); + }); + + QUnit.test('can access `actions` hash via `_actions` [DEPRECATED]', function () { + expect(2); + + var route = _emberRoutingSystemRoute.default.extend({ + actions: { + foo: function () { + ok(true, 'called foo action'); + } + } + }).create(); + + expectDeprecation(function () { + route._actions.foo(); + }, 'Usage of `_actions` is deprecated, use `actions` instead.'); + }); + + QUnit.test('actions in both `_actions` and `actions` results in an assertion', function () { + expectAssertion(function () { + _emberRoutingSystemRoute.default.extend({ + _actions: {}, + actions: {} + }).create(); + }, 'Specifying `_actions` and `actions` in the same mixin is not supported.'); + }); + + QUnit.test('actions added via `_actions` can be used [DEPRECATED]', function () { + expect(3); + + var route = undefined; + expectDeprecation(function () { + route = _emberRoutingSystemRoute.default.extend({ + _actions: { + bar: function () { + ok(true, 'called bar action'); + } + } + }, { + actions: { + foo: function () { + ok(true, 'called foo action'); + } + } + }).create(); + }, 'Specifying actions in `_actions` is deprecated, please use `actions` instead.'); + + route.send('foo'); + route.send('bar'); + }); + + QUnit.module('Ember.Route serialize', { + setup: setup, + teardown: teardown + }); + + QUnit.test('returns the models properties if params does not include *_id', function () { + var model = { id: 2, firstName: 'Ned', lastName: 'Ryerson' }; + + deepEqual(route.serialize(model, ['firstName', 'lastName']), { firstName: 'Ned', lastName: 'Ryerson' }, 'serialized correctly'); + }); + + QUnit.test('returns model.id if params include *_id', function () { + var model = { id: 2 }; + + deepEqual(route.serialize(model, ['post_id']), { post_id: 2 }, 'serialized correctly'); + }); + + QUnit.test('returns checks for existence of model.post_id before trying model.id', function () { + var model = { post_id: 3 }; + + deepEqual(route.serialize(model, ['post_id']), { post_id: 3 }, 'serialized correctly'); + }); + + QUnit.test('returns undefined if model is not set', function () { + equal(route.serialize(undefined, ['post_id']), undefined, 'serialized correctly'); + }); + + QUnit.module('Ember.Route interaction', { + setup: function () { + var owner = { + lookup: function (fullName) { + return lookupHash[fullName]; + } + }; + + routeOne = _emberRoutingSystemRoute.default.create({ routeName: 'one' }); + routeTwo = _emberRoutingSystemRoute.default.create({ routeName: 'two' }); + + _emberUtils.setOwner(routeOne, owner); + _emberUtils.setOwner(routeTwo, owner); + + lookupHash = { + 'route:one': routeOne, + 'route:two': routeTwo + }; + }, + + teardown: function () { + _internalTestHelpers.runDestroy(routeOne); + _internalTestHelpers.runDestroy(routeTwo); + } + }); + + QUnit.test('controllerFor uses route\'s controllerName if specified', function () { + var testController = {}; + lookupHash['controller:test'] = testController; + + routeOne.controllerName = 'test'; + + equal(routeTwo.controllerFor('one'), testController); + }); + + QUnit.module('Route injected properties'); + + QUnit.test('services can be injected into routes', function () { + var owner = _internalTestHelpers.buildOwner(); + + owner.register('route:application', _emberRoutingSystemRoute.default.extend({ + authService: _emberRuntime.inject.service('auth') + })); + + owner.register('service:auth', _emberRuntime.Service.extend()); + + var appRoute = owner.lookup('route:application'); + var authService = owner.lookup('service:auth'); + + equal(authService, appRoute.get('authService'), 'service.auth is injected'); + }); + + QUnit.module('Ember.Route with engines'); + + QUnit.test('paramsFor considers an engine\'s mountPoint', function (assert) { + expect(2); + + var router = { + _deserializeQueryParams: function () {}, + router: { + state: { + handlerInfos: [{ name: 'posts' }], + params: { + 'foo.bar': { a: 'b' }, + 'foo.bar.posts': { c: 'd' } + } + } + } + }; + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { + routable: true, + + mountPoint: 'foo.bar', + + lookup: function (name) { + if (name === 'route:posts') { + return postsRoute; + } else if (name === 'route:application') { + return applicationRoute; + } + } + } + }); + + var applicationRoute = _emberRoutingSystemRoute.default.create({ router: router, routeName: 'application', fullRouteName: 'foo.bar' }); + var postsRoute = _emberRoutingSystemRoute.default.create({ router: router, routeName: 'posts', fullRouteName: 'foo.bar.posts' }); + var route = _emberRoutingSystemRoute.default.create({ router: router }); + + _emberUtils.setOwner(applicationRoute, engineInstance); + _emberUtils.setOwner(postsRoute, engineInstance); + _emberUtils.setOwner(route, engineInstance); + + assert.deepEqual(route.paramsFor('application'), { a: 'b' }, 'params match for root `application` route in engine'); + assert.deepEqual(route.paramsFor('posts'), { c: 'd' }, 'params match for `posts` route in engine'); + }); + + QUnit.test('modelFor considers an engine\'s mountPoint', function () { + expect(2); + + var applicationModel = { id: '1' }; + var postsModel = { id: '2' }; + + var router = { + router: { + activeTransition: { + resolvedModels: { + 'foo.bar': applicationModel, + 'foo.bar.posts': postsModel + } + } + } + }; + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { + routable: true, + + mountPoint: 'foo.bar', + + lookup: function (name) { + if (name === 'route:posts') { + return postsRoute; + } else if (name === 'route:application') { + return applicationRoute; + } + } + } + }); + + var applicationRoute = _emberRoutingSystemRoute.default.create({ router: router, routeName: 'application' }); + var postsRoute = _emberRoutingSystemRoute.default.create({ router: router, routeName: 'posts' }); + var route = _emberRoutingSystemRoute.default.create({ router: router }); + + _emberUtils.setOwner(applicationRoute, engineInstance); + _emberUtils.setOwner(postsRoute, engineInstance); + _emberUtils.setOwner(route, engineInstance); + + strictEqual(route.modelFor('application'), applicationModel); + strictEqual(route.modelFor('posts'), postsModel); + }); + + QUnit.test('transitionTo considers an engine\'s mountPoint', function () { + expect(4); + + var router = { + transitionTo: function (route) { + return route; + } + }; + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { + routable: true, + mountPoint: 'foo.bar' + } + }); + + var route = _emberRoutingSystemRoute.default.create({ router: router }); + _emberUtils.setOwner(route, engineInstance); + + strictEqual(route.transitionTo('application'), 'foo.bar.application', 'properly prefixes application route'); + strictEqual(route.transitionTo('posts'), 'foo.bar.posts', 'properly prefixes child routes'); + throws(function () { + return route.transitionTo('/posts'); + }, 'throws when trying to use a url'); + + var queryParams = {}; + strictEqual(route.transitionTo(queryParams), queryParams, 'passes query param only transitions through'); + }); + + QUnit.test('intermediateTransitionTo considers an engine\'s mountPoint', function () { + expect(4); + + var lastRoute = undefined; + var router = { + intermediateTransitionTo: function (route) { + lastRoute = route; + } + }; + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { + routable: true, + mountPoint: 'foo.bar' + } + }); + + var route = _emberRoutingSystemRoute.default.create({ router: router }); + _emberUtils.setOwner(route, engineInstance); + + route.intermediateTransitionTo('application'); + strictEqual(lastRoute, 'foo.bar.application', 'properly prefixes application route'); + + route.intermediateTransitionTo('posts'); + strictEqual(lastRoute, 'foo.bar.posts', 'properly prefixes child routes'); + + throws(function () { + return route.intermediateTransitionTo('/posts'); + }, 'throws when trying to use a url'); + + var queryParams = {}; + route.intermediateTransitionTo(queryParams); + strictEqual(lastRoute, queryParams, 'passes query param only transitions through'); + }); + + QUnit.test('replaceWith considers an engine\'s mountPoint', function () { + expect(4); + + var router = { + replaceWith: function (route) { + return route; + } + }; + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { + routable: true, + mountPoint: 'foo.bar' + } + }); + + var route = _emberRoutingSystemRoute.default.create({ router: router }); + _emberUtils.setOwner(route, engineInstance); + + strictEqual(route.replaceWith('application'), 'foo.bar.application', 'properly prefixes application route'); + strictEqual(route.replaceWith('posts'), 'foo.bar.posts', 'properly prefixes child routes'); + throws(function () { + return route.replaceWith('/posts'); + }, 'throws when trying to use a url'); + + var queryParams = {}; + strictEqual(route.replaceWith(queryParams), queryParams, 'passes query param only transitions through'); + }); +}); +enifed('ember-routing/tests/system/route_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/tests/system'); + test('ember-routing/tests/system/route_test.js should pass jscs', function () { + ok(true, 'ember-routing/tests/system/route_test.js should pass jscs.'); + }); +}); +enifed('ember-routing/tests/system/route_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/tests/system'); + QUnit.test('ember-routing/tests/system/route_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/tests/system/route_test.js should pass jshint.'); + }); +}); +enifed('ember-routing/tests/system/router_test', ['exports', 'ember-utils', 'ember-routing/location/hash_location', 'ember-routing/location/history_location', 'ember-routing/location/auto_location', 'ember-routing/location/none_location', 'ember-routing/system/router', 'internal-test-helpers'], function (exports, _emberUtils, _emberRoutingLocationHash_location, _emberRoutingLocationHistory_location, _emberRoutingLocationAuto_location, _emberRoutingLocationNone_location, _emberRoutingSystemRouter, _internalTestHelpers) { + 'use strict'; + + var owner = undefined; + + function createRouter(settings) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + var CustomRouter = _emberRoutingSystemRouter.default.extend(); + var router = CustomRouter.create(settings); + + if (!options.skipOwner) { + _emberUtils.setOwner(router, owner); + } + + if (!options.disableSetup) { + router.setupRouter(); + } + + return router; + } + + QUnit.module('Ember Router', { + setup: function () { + owner = _internalTestHelpers.buildOwner(); + + //register the HashLocation (the default) + owner.register('location:hash', _emberRoutingLocationHash_location.default); + owner.register('location:history', _emberRoutingLocationHistory_location.default); + owner.register('location:auto', _emberRoutingLocationAuto_location.default); + owner.register('location:none', _emberRoutingLocationNone_location.default); + }, + teardown: function () { + _internalTestHelpers.runDestroy(owner); + owner = null; + } + }); + + QUnit.test('can create a router without an owner', function () { + createRouter(null, { disableSetup: true, skipOwner: true }); + + ok(true, 'no errors were thrown when creating without a container'); + }); + + QUnit.test('should not create a router.js instance upon init', function () { + var router = createRouter(null, { disableSetup: true }); + + ok(!router.router); + }); + + QUnit.test('should not reify location until setupRouter is called', function () { + var router = createRouter(null, { disableSetup: true }); + equal(typeof router.location, 'string', 'location is specified as a string'); + + router.setupRouter(); + + equal(typeof router.location, 'object', 'location is reified into an object'); + }); + + QUnit.test('should destroy its location upon destroying the routers owner.', function () { + var router = createRouter(); + var location = router.get('location'); + + _internalTestHelpers.runDestroy(owner); + + ok(location.isDestroyed, 'location should be destroyed'); + }); + + QUnit.test('should instantiate its location with its `rootURL`', function () { + var router = createRouter({ + rootURL: '/rootdir/' + }); + var location = router.get('location'); + + equal(location.get('rootURL'), '/rootdir/'); + }); + + QUnit.test('replacePath should be called with the right path', function () { + expect(1); + + var location = owner.lookup('location:auto'); + + var browserLocation = { + href: 'http://test.com/rootdir/welcome', + origin: 'http://test.com', + pathname: '/rootdir/welcome', + hash: '', + search: '', + replace: function (url) { + equal(url, 'http://test.com/rootdir/#/welcome'); + } + }; + + location.location = browserLocation; + location.global = { onhashchange: function () {} }; + location.history = null; + + createRouter({ + location: 'auto', + rootURL: '/rootdir/' + }); + }); + + QUnit.test('Ember.Router._routePath should consume identical prefixes', function () { + createRouter(); + + expect(8); + + function routePath(s1, s2, s3) { + var handlerInfos = Array.prototype.slice.call(arguments).map(function (s) { + return { name: s }; + }); + handlerInfos.unshift({ name: 'ignored' }); + + return _emberRoutingSystemRouter.default._routePath(handlerInfos); + } + + equal(routePath('foo'), 'foo'); + equal(routePath('foo', 'bar', 'baz'), 'foo.bar.baz'); + equal(routePath('foo', 'foo.bar'), 'foo.bar'); + equal(routePath('foo', 'foo.bar', 'foo.bar.baz'), 'foo.bar.baz'); + equal(routePath('foo', 'foo.bar', 'foo.bar.baz.wow'), 'foo.bar.baz.wow'); + equal(routePath('foo', 'foo.bar.baz.wow'), 'foo.bar.baz.wow'); + equal(routePath('foo.bar', 'bar.baz.wow'), 'foo.bar.baz.wow'); + + // This makes no sense, not trying to handle it, just + // making sure it doesn't go boom. + equal(routePath('foo.bar.baz', 'foo'), 'foo.bar.baz.foo'); + }); + + QUnit.test('Router should cancel routing setup when the Location class says so via cancelRouterSetup', function () { + expect(0); + + var router = undefined; + var FakeLocation = { + cancelRouterSetup: true, + create: function () { + return this; + } + }; + + owner.register('location:fake', FakeLocation); + + router = createRouter({ + location: 'fake', + + _setupRouter: function () { + ok(false, '_setupRouter should not be called'); + } + }); + + router.startRouting(); + }); + + QUnit.test('AutoLocation should replace the url when it\'s not in the preferred format', function () { + expect(1); + + var location = owner.lookup('location:auto'); + + location.location = { + href: 'http://test.com/rootdir/welcome', + origin: 'http://test.com', + pathname: '/rootdir/welcome', + hash: '', + search: '', + replace: function (url) { + equal(url, 'http://test.com/rootdir/#/welcome'); + } + }; + location.history = null; + location.global = { + onhashchange: function () {} + }; + + createRouter({ + location: 'auto', + rootURL: '/rootdir/' + }); + }); + + QUnit.test('Router#handleURL should remove any #hashes before doing URL transition', function () { + expect(2); + + var router = createRouter({ + _doURLTransition: function (routerJsMethod, url) { + equal(routerJsMethod, 'handleURL'); + equal(url, '/foo/bar?time=morphin'); + } + }); + + router.handleURL('/foo/bar?time=morphin#pink-power-ranger'); + }); + + QUnit.test('Router#triggerEvent allows actions to bubble when returning true', function (assert) { + assert.expect(2); + + var handlerInfos = [{ + name: 'application', + handler: { + actions: { + loading: function () { + assert.ok(false, 'loading not handled by application route'); + } + } + } + }, { + name: 'about', + handler: { + actions: { + loading: function () { + assert.ok(true, 'loading handled by about route'); + return false; + } + } + } + }, { + name: 'about.me', + handler: { + actions: { + loading: function () { + assert.ok(true, 'loading handled by about.me route'); + return true; + } + } + } + }]; + + _emberRoutingSystemRouter.triggerEvent(handlerInfos, false, ['loading']); + }); + + QUnit.test('Router#triggerEvent ignores handlers that have not loaded yet', function (assert) { + assert.expect(1); + + var handlerInfos = [{ + name: 'about', + handler: { + actions: { + loading: function () { + assert.ok(true, 'loading handled by about route'); + } + } + } + }, { + name: 'about.me', + handler: undefined + }]; + + _emberRoutingSystemRouter.triggerEvent(handlerInfos, false, ['loading']); + }); +}); +enifed('ember-routing/tests/system/router_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/tests/system'); + test('ember-routing/tests/system/router_test.js should pass jscs', function () { + ok(true, 'ember-routing/tests/system/router_test.js should pass jscs.'); + }); +}); +enifed('ember-routing/tests/system/router_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/tests/system'); + QUnit.test('ember-routing/tests/system/router_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/tests/system/router_test.js should pass jshint.'); + }); +}); +enifed('ember-routing/tests/utils_test', ['exports', 'ember-routing/utils'], function (exports, _emberRoutingUtils) { + 'use strict'; + + QUnit.module('Routing query parameter utils - normalizeControllerQueryParams'); + + QUnit.test('returns the cached value if that has been previously set', function (assert) { + var cached = {}; + var params = ['foo']; + params._qpMap = cached; + + var normalized = _emberRoutingUtils.normalizeControllerQueryParams(params); + equal(cached, normalized, 'cached value returned if previously set'); + }); + + QUnit.test('converts array style into verbose object style', function (assert) { + var paramName = 'foo'; + var params = [paramName]; + var normalized = _emberRoutingUtils.normalizeControllerQueryParams(params); + + ok(normalized[paramName], 'turns the query param name into key'); + equal(normalized[paramName].as, null, 'includes a blank alias in \'as\' key'); + equal(normalized[paramName].scope, 'model', 'defaults scope to model'); + }); + + QUnit.test('converts object stlye [{foo: \'an_alias\'}]', function (assert) { + var paramName = 'foo'; + var params = [{ 'foo': 'an_alias' }]; + var normalized = _emberRoutingUtils.normalizeControllerQueryParams(params); + + ok(normalized[paramName], 'retains the query param name as key'); + equal(normalized[paramName].as, 'an_alias', 'includes the provided alias in \'as\' key'); + equal(normalized[paramName].scope, 'model', 'defaults scope to model'); + }); + + QUnit.test('retains maximally verbose object stlye [{foo: {as: \'foo\'}}]', function (assert) { + var paramName = 'foo'; + var params = [{ 'foo': { as: 'an_alias' } }]; + var normalized = _emberRoutingUtils.normalizeControllerQueryParams(params); + + ok(normalized[paramName], 'retains the query param name as key'); + equal(normalized[paramName].as, 'an_alias', 'includes the provided alias in \'as\' key'); + equal(normalized[paramName].scope, 'model', 'defaults scope to model'); + }); +}); +enifed('ember-routing/tests/utils_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/tests'); + test('ember-routing/tests/utils_test.js should pass jscs', function () { + ok(true, 'ember-routing/tests/utils_test.js should pass jscs.'); + }); +}); +enifed('ember-routing/tests/utils_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/tests'); + QUnit.test('ember-routing/tests/utils_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/tests/utils_test.js should pass jshint.'); + }); +}); +enifed('ember-routing/utils.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing'); + test('ember-routing/utils.js should pass jscs', function () { + ok(true, 'ember-routing/utils.js should pass jscs.'); + }); +}); +enifed('ember-routing/utils.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing'); + QUnit.test('ember-routing/utils.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/utils.js should pass jshint.'); + }); +}); +enifed('ember-runtime/compare.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime'); + test('ember-runtime/compare.js should pass jscs', function () { + ok(true, 'ember-runtime/compare.js should pass jscs.'); + }); +}); +enifed('ember-runtime/compare.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime'); + QUnit.test('ember-runtime/compare.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/compare.js should pass jshint.'); + }); +}); +enifed('ember-runtime/computed/computed_macros.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/computed'); + test('ember-runtime/computed/computed_macros.js should pass jscs', function () { + ok(true, 'ember-runtime/computed/computed_macros.js should pass jscs.'); + }); +}); +enifed('ember-runtime/computed/computed_macros.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/computed'); + QUnit.test('ember-runtime/computed/computed_macros.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/computed/computed_macros.js should pass jshint.'); + }); +}); +enifed('ember-runtime/computed/reduce_computed_macros.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/computed'); + test('ember-runtime/computed/reduce_computed_macros.js should pass jscs', function () { + ok(true, 'ember-runtime/computed/reduce_computed_macros.js should pass jscs.'); + }); +}); +enifed('ember-runtime/computed/reduce_computed_macros.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/computed'); + QUnit.test('ember-runtime/computed/reduce_computed_macros.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/computed/reduce_computed_macros.js should pass jshint.'); + }); +}); +enifed('ember-runtime/controllers/controller.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/controllers'); + test('ember-runtime/controllers/controller.js should pass jscs', function () { + ok(true, 'ember-runtime/controllers/controller.js should pass jscs.'); + }); +}); +enifed('ember-runtime/controllers/controller.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/controllers'); + QUnit.test('ember-runtime/controllers/controller.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/controllers/controller.js should pass jshint.'); + }); +}); +enifed('ember-runtime/copy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime'); + test('ember-runtime/copy.js should pass jscs', function () { + ok(true, 'ember-runtime/copy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/copy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime'); + QUnit.test('ember-runtime/copy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/copy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/ext/function.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/ext'); + test('ember-runtime/ext/function.js should pass jscs', function () { + ok(true, 'ember-runtime/ext/function.js should pass jscs.'); + }); +}); +enifed('ember-runtime/ext/function.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/ext'); + QUnit.test('ember-runtime/ext/function.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/ext/function.js should pass jshint.'); + }); +}); +enifed("ember-runtime/ext/rsvp.jscs-test", ["exports"], function (exports) { + "use strict"; +}); +enifed('ember-runtime/ext/rsvp.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/ext'); + QUnit.test('ember-runtime/ext/rsvp.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/ext/rsvp.js should pass jshint.'); + }); +}); +enifed('ember-runtime/ext/string.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/ext'); + test('ember-runtime/ext/string.js should pass jscs', function () { + ok(true, 'ember-runtime/ext/string.js should pass jscs.'); + }); +}); +enifed('ember-runtime/ext/string.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/ext'); + QUnit.test('ember-runtime/ext/string.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/ext/string.js should pass jshint.'); + }); +}); +enifed('ember-runtime/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime'); + test('ember-runtime/index.js should pass jscs', function () { + ok(true, 'ember-runtime/index.js should pass jscs.'); + }); +}); +enifed('ember-runtime/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime'); + QUnit.test('ember-runtime/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/index.js should pass jshint.'); + }); +}); +enifed('ember-runtime/inject.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime'); + test('ember-runtime/inject.js should pass jscs', function () { + ok(true, 'ember-runtime/inject.js should pass jscs.'); + }); +}); +enifed('ember-runtime/inject.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime'); + QUnit.test('ember-runtime/inject.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/inject.js should pass jshint.'); + }); +}); +enifed('ember-runtime/is-equal.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime'); + test('ember-runtime/is-equal.js should pass jscs', function () { + ok(true, 'ember-runtime/is-equal.js should pass jscs.'); + }); +}); +enifed('ember-runtime/is-equal.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime'); + QUnit.test('ember-runtime/is-equal.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/is-equal.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/-proxy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/-proxy.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/-proxy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/-proxy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/-proxy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/-proxy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/action_handler.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/action_handler.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/action_handler.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/action_handler.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/action_handler.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/action_handler.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/array.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/array.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/array.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/array.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/array.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/array.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/comparable.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/comparable.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/comparable.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/comparable.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/comparable.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/comparable.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/container_proxy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/container_proxy.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/container_proxy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/container_proxy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/container_proxy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/container_proxy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/controller.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/controller.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/controller.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/controller.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/controller.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/controller.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/controller_content_model_alias_deprecation.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/controller_content_model_alias_deprecation.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/controller_content_model_alias_deprecation.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/controller_content_model_alias_deprecation.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/controller_content_model_alias_deprecation.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/controller_content_model_alias_deprecation.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/copyable.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/copyable.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/copyable.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/copyable.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/copyable.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/copyable.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/enumerable.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/enumerable.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/enumerable.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/enumerable.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/enumerable.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/enumerable.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/evented.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/evented.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/evented.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/evented.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/evented.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/evented.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/freezable.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/freezable.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/freezable.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/freezable.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/freezable.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/freezable.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/mutable_array.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/mutable_array.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/mutable_array.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/mutable_array.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/mutable_array.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/mutable_array.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/mutable_enumerable.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/mutable_enumerable.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/mutable_enumerable.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/mutable_enumerable.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/mutable_enumerable.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/mutable_enumerable.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/observable.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/observable.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/observable.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/observable.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/observable.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/observable.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/promise_proxy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/promise_proxy.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/promise_proxy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/promise_proxy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/promise_proxy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/promise_proxy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/registry_proxy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/registry_proxy.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/registry_proxy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/registry_proxy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/registry_proxy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/registry_proxy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/target_action_support.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/target_action_support.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/target_action_support.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/target_action_support.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/target_action_support.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/target_action_support.js should pass jshint.'); + }); +}); +enifed('ember-runtime/string_registry.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime'); + test('ember-runtime/string_registry.js should pass jscs', function () { + ok(true, 'ember-runtime/string_registry.js should pass jscs.'); + }); +}); +enifed('ember-runtime/string_registry.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime'); + QUnit.test('ember-runtime/string_registry.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/string_registry.js should pass jshint.'); + }); +}); +enifed('ember-runtime/system/application.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/system'); + test('ember-runtime/system/application.js should pass jscs', function () { + ok(true, 'ember-runtime/system/application.js should pass jscs.'); + }); +}); +enifed('ember-runtime/system/application.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/system'); + QUnit.test('ember-runtime/system/application.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/system/application.js should pass jshint.'); + }); +}); +enifed('ember-runtime/system/array_proxy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/system'); + test('ember-runtime/system/array_proxy.js should pass jscs', function () { + ok(true, 'ember-runtime/system/array_proxy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/system/array_proxy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/system'); + QUnit.test('ember-runtime/system/array_proxy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/system/array_proxy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/system/core_object.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/system'); + test('ember-runtime/system/core_object.js should pass jscs', function () { + ok(true, 'ember-runtime/system/core_object.js should pass jscs.'); + }); +}); +enifed('ember-runtime/system/core_object.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/system'); + QUnit.test('ember-runtime/system/core_object.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/system/core_object.js should pass jshint.'); + }); +}); +enifed('ember-runtime/system/each_proxy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/system'); + test('ember-runtime/system/each_proxy.js should pass jscs', function () { + ok(true, 'ember-runtime/system/each_proxy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/system/each_proxy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/system'); + QUnit.test('ember-runtime/system/each_proxy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/system/each_proxy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/system/lazy_load.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/system'); + test('ember-runtime/system/lazy_load.js should pass jscs', function () { + ok(true, 'ember-runtime/system/lazy_load.js should pass jscs.'); + }); +}); +enifed('ember-runtime/system/lazy_load.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/system'); + QUnit.test('ember-runtime/system/lazy_load.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/system/lazy_load.js should pass jshint.'); + }); +}); +enifed('ember-runtime/system/namespace.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/system'); + test('ember-runtime/system/namespace.js should pass jscs', function () { + ok(true, 'ember-runtime/system/namespace.js should pass jscs.'); + }); +}); +enifed('ember-runtime/system/namespace.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/system'); + QUnit.test('ember-runtime/system/namespace.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/system/namespace.js should pass jshint.'); + }); +}); +enifed('ember-runtime/system/native_array.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/system'); + test('ember-runtime/system/native_array.js should pass jscs', function () { + ok(true, 'ember-runtime/system/native_array.js should pass jscs.'); + }); +}); +enifed('ember-runtime/system/native_array.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/system'); + QUnit.test('ember-runtime/system/native_array.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/system/native_array.js should pass jshint.'); + }); +}); +enifed('ember-runtime/system/object.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/system'); + test('ember-runtime/system/object.js should pass jscs', function () { + ok(true, 'ember-runtime/system/object.js should pass jscs.'); + }); +}); +enifed('ember-runtime/system/object.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/system'); + QUnit.test('ember-runtime/system/object.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/system/object.js should pass jshint.'); + }); +}); +enifed('ember-runtime/system/object_proxy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/system'); + test('ember-runtime/system/object_proxy.js should pass jscs', function () { + ok(true, 'ember-runtime/system/object_proxy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/system/object_proxy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/system'); + QUnit.test('ember-runtime/system/object_proxy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/system/object_proxy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/system/service.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/system'); + test('ember-runtime/system/service.js should pass jscs', function () { + ok(true, 'ember-runtime/system/service.js should pass jscs.'); + }); +}); +enifed('ember-runtime/system/service.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/system'); + QUnit.test('ember-runtime/system/service.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/system/service.js should pass jshint.'); + }); +}); +enifed('ember-runtime/system/string.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/system'); + test('ember-runtime/system/string.js should pass jscs', function () { + ok(true, 'ember-runtime/system/string.js should pass jscs.'); + }); +}); +enifed('ember-runtime/system/string.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/system'); + QUnit.test('ember-runtime/system/string.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/system/string.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/computed/computed_macros_test', ['exports', 'ember-metal', 'ember-runtime/computed/computed_macros', 'internal-test-helpers', 'ember-runtime/system/object', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeComputedComputed_macros, _internalTestHelpers, _emberRuntimeSystemObject, _emberRuntimeSystemNative_array) { + 'use strict'; + + QUnit.module('CP macros'); + + _internalTestHelpers.testBoth('Ember.computed.empty', function (get, set) { + var obj = _emberRuntimeSystemObject.default.extend({ + bestLannister: null, + lannisters: null, + + bestLannisterUnspecified: _emberRuntimeComputedComputed_macros.empty('bestLannister'), + noLannistersKnown: _emberRuntimeComputedComputed_macros.empty('lannisters') + }).create({ + lannisters: _emberRuntimeSystemNative_array.A() + }); + + equal(get(obj, 'bestLannisterUnspecified'), true, 'bestLannister initially empty'); + equal(get(obj, 'noLannistersKnown'), true, 'lannisters initially empty'); + + get(obj, 'lannisters').pushObject('Tyrion'); + set(obj, 'bestLannister', 'Tyrion'); + + equal(get(obj, 'bestLannisterUnspecified'), false, 'empty respects strings'); + equal(get(obj, 'noLannistersKnown'), false, 'empty respects array mutations'); + }); + + _internalTestHelpers.testBoth('Ember.computed.notEmpty', function (get, set) { + var obj = _emberRuntimeSystemObject.default.extend({ + bestLannister: null, + lannisters: null, + + bestLannisterSpecified: _emberRuntimeComputedComputed_macros.notEmpty('bestLannister'), + LannistersKnown: _emberRuntimeComputedComputed_macros.notEmpty('lannisters') + }).create({ + lannisters: _emberRuntimeSystemNative_array.A() + }); + + equal(get(obj, 'bestLannisterSpecified'), false, 'bestLannister initially empty'); + equal(get(obj, 'LannistersKnown'), false, 'lannisters initially empty'); + + get(obj, 'lannisters').pushObject('Tyrion'); + set(obj, 'bestLannister', 'Tyrion'); + + equal(get(obj, 'bestLannisterSpecified'), true, 'empty respects strings'); + equal(get(obj, 'LannistersKnown'), true, 'empty respects array mutations'); + }); + + _internalTestHelpers.testBoth('computed.not', function (get, set) { + var obj = { foo: true }; + _emberMetal.defineProperty(obj, 'notFoo', _emberRuntimeComputedComputed_macros.not('foo')); + equal(get(obj, 'notFoo'), false); + + obj = { foo: { bar: true } }; + _emberMetal.defineProperty(obj, 'notFoo', _emberRuntimeComputedComputed_macros.not('foo.bar')); + equal(get(obj, 'notFoo'), false); + }); + + _internalTestHelpers.testBoth('computed.empty', function (get, set) { + var obj = { foo: [], bar: undefined, baz: null, quz: '' }; + _emberMetal.defineProperty(obj, 'fooEmpty', _emberRuntimeComputedComputed_macros.empty('foo')); + _emberMetal.defineProperty(obj, 'barEmpty', _emberRuntimeComputedComputed_macros.empty('bar')); + _emberMetal.defineProperty(obj, 'bazEmpty', _emberRuntimeComputedComputed_macros.empty('baz')); + _emberMetal.defineProperty(obj, 'quzEmpty', _emberRuntimeComputedComputed_macros.empty('quz')); + + equal(get(obj, 'fooEmpty'), true); + set(obj, 'foo', [1]); + equal(get(obj, 'fooEmpty'), false); + equal(get(obj, 'barEmpty'), true); + equal(get(obj, 'bazEmpty'), true); + equal(get(obj, 'quzEmpty'), true); + set(obj, 'quz', 'asdf'); + equal(get(obj, 'quzEmpty'), false); + }); + + _internalTestHelpers.testBoth('computed.bool', function (get, set) { + var obj = { foo: function () {}, bar: 'asdf', baz: null, quz: false }; + _emberMetal.defineProperty(obj, 'fooBool', _emberRuntimeComputedComputed_macros.bool('foo')); + _emberMetal.defineProperty(obj, 'barBool', _emberRuntimeComputedComputed_macros.bool('bar')); + _emberMetal.defineProperty(obj, 'bazBool', _emberRuntimeComputedComputed_macros.bool('baz')); + _emberMetal.defineProperty(obj, 'quzBool', _emberRuntimeComputedComputed_macros.bool('quz')); + equal(get(obj, 'fooBool'), true); + equal(get(obj, 'barBool'), true); + equal(get(obj, 'bazBool'), false); + equal(get(obj, 'quzBool'), false); + }); + + _internalTestHelpers.testBoth('computed.alias', function (get, set) { + var obj = { bar: 'asdf', baz: null, quz: false }; + _emberMetal.defineProperty(obj, 'bay', _emberMetal.computed(function (key) { + return 'apple'; + })); + + _emberMetal.defineProperty(obj, 'barAlias', _emberMetal.alias('bar')); + _emberMetal.defineProperty(obj, 'bazAlias', _emberMetal.alias('baz')); + _emberMetal.defineProperty(obj, 'quzAlias', _emberMetal.alias('quz')); + _emberMetal.defineProperty(obj, 'bayAlias', _emberMetal.alias('bay')); + + equal(get(obj, 'barAlias'), 'asdf'); + equal(get(obj, 'bazAlias'), null); + equal(get(obj, 'quzAlias'), false); + equal(get(obj, 'bayAlias'), 'apple'); + + set(obj, 'barAlias', 'newBar'); + set(obj, 'bazAlias', 'newBaz'); + set(obj, 'quzAlias', null); + + equal(get(obj, 'barAlias'), 'newBar'); + equal(get(obj, 'bazAlias'), 'newBaz'); + equal(get(obj, 'quzAlias'), null); + + equal(get(obj, 'bar'), 'newBar'); + equal(get(obj, 'baz'), 'newBaz'); + equal(get(obj, 'quz'), null); + }); + + _internalTestHelpers.testBoth('computed.alias set', function (get, set) { + var obj = {}; + var constantValue = 'always `a`'; + + _emberMetal.defineProperty(obj, 'original', _emberMetal.computed({ + get: function (key) { + return constantValue; + }, + set: function (key, value) { + return constantValue; + } + })); + _emberMetal.defineProperty(obj, 'aliased', _emberMetal.alias('original')); + + equal(get(obj, 'original'), constantValue); + equal(get(obj, 'aliased'), constantValue); + + set(obj, 'aliased', 'should not set to this value'); + + equal(get(obj, 'original'), constantValue); + equal(get(obj, 'aliased'), constantValue); + }); + + _internalTestHelpers.testBoth('computed.match', function (get, set) { + var obj = { name: 'Paul' }; + _emberMetal.defineProperty(obj, 'isPaul', _emberRuntimeComputedComputed_macros.match('name', /Paul/)); + + equal(get(obj, 'isPaul'), true, 'is Paul'); + + set(obj, 'name', 'Pierre'); + + equal(get(obj, 'isPaul'), false, 'is not Paul anymore'); + }); + + _internalTestHelpers.testBoth('computed.notEmpty', function (get, set) { + var obj = { items: [1] }; + _emberMetal.defineProperty(obj, 'hasItems', _emberRuntimeComputedComputed_macros.notEmpty('items')); + + equal(get(obj, 'hasItems'), true, 'is not empty'); + + set(obj, 'items', []); + + equal(get(obj, 'hasItems'), false, 'is empty'); + }); + + _internalTestHelpers.testBoth('computed.equal', function (get, set) { + var obj = { name: 'Paul' }; + _emberMetal.defineProperty(obj, 'isPaul', _emberRuntimeComputedComputed_macros.equal('name', 'Paul')); + + equal(get(obj, 'isPaul'), true, 'is Paul'); + + set(obj, 'name', 'Pierre'); + + equal(get(obj, 'isPaul'), false, 'is not Paul anymore'); + }); + + _internalTestHelpers.testBoth('computed.gt', function (get, set) { + var obj = { number: 2 }; + _emberMetal.defineProperty(obj, 'isGreaterThenOne', _emberRuntimeComputedComputed_macros.gt('number', 1)); + + equal(get(obj, 'isGreaterThenOne'), true, 'is gt'); + + set(obj, 'number', 1); + + equal(get(obj, 'isGreaterThenOne'), false, 'is not gt'); + + set(obj, 'number', 0); + + equal(get(obj, 'isGreaterThenOne'), false, 'is not gt'); + }); + + _internalTestHelpers.testBoth('computed.gte', function (get, set) { + var obj = { number: 2 }; + _emberMetal.defineProperty(obj, 'isGreaterOrEqualThenOne', _emberRuntimeComputedComputed_macros.gte('number', 1)); + + equal(get(obj, 'isGreaterOrEqualThenOne'), true, 'is gte'); + + set(obj, 'number', 1); + + equal(get(obj, 'isGreaterOrEqualThenOne'), true, 'is gte'); + + set(obj, 'number', 0); + + equal(get(obj, 'isGreaterOrEqualThenOne'), false, 'is not gte'); + }); + + _internalTestHelpers.testBoth('computed.lt', function (get, set) { + var obj = { number: 0 }; + _emberMetal.defineProperty(obj, 'isLesserThenOne', _emberRuntimeComputedComputed_macros.lt('number', 1)); + + equal(get(obj, 'isLesserThenOne'), true, 'is lt'); + + set(obj, 'number', 1); + + equal(get(obj, 'isLesserThenOne'), false, 'is not lt'); + + set(obj, 'number', 2); + + equal(get(obj, 'isLesserThenOne'), false, 'is not lt'); + }); + + _internalTestHelpers.testBoth('computed.lte', function (get, set) { + var obj = { number: 0 }; + _emberMetal.defineProperty(obj, 'isLesserOrEqualThenOne', _emberRuntimeComputedComputed_macros.lte('number', 1)); + + equal(get(obj, 'isLesserOrEqualThenOne'), true, 'is lte'); + + set(obj, 'number', 1); + + equal(get(obj, 'isLesserOrEqualThenOne'), true, 'is lte'); + + set(obj, 'number', 2); + + equal(get(obj, 'isLesserOrEqualThenOne'), false, 'is not lte'); + }); + + _internalTestHelpers.testBoth('computed.and two properties', function (get, set) { + var obj = { one: true, two: true }; + _emberMetal.defineProperty(obj, 'oneAndTwo', _emberRuntimeComputedComputed_macros.and('one', 'two')); + + equal(get(obj, 'oneAndTwo'), true, 'one and two'); + + set(obj, 'one', false); + + equal(get(obj, 'oneAndTwo'), false, 'one and not two'); + + set(obj, 'one', null); + set(obj, 'two', 'Yes'); + + equal(get(obj, 'oneAndTwo'), null, 'returns falsy value as in &&'); + + set(obj, 'one', true); + set(obj, 'two', 2); + + equal(get(obj, 'oneAndTwo'), 2, 'returns truthy value as in &&'); + }); + + _internalTestHelpers.testBoth('computed.and three properties', function (get, set) { + var obj = { one: true, two: true, three: true }; + _emberMetal.defineProperty(obj, 'oneTwoThree', _emberRuntimeComputedComputed_macros.and('one', 'two', 'three')); + + equal(get(obj, 'oneTwoThree'), true, 'one and two and three'); + + set(obj, 'one', false); + + equal(get(obj, 'oneTwoThree'), false, 'one and not two and not three'); + + set(obj, 'one', true); + set(obj, 'two', 2); + set(obj, 'three', 3); + + equal(get(obj, 'oneTwoThree'), 3, 'returns truthy value as in &&'); + }); + + _internalTestHelpers.testBoth('computed.and expand properties', function (get, set) { + var obj = { one: true, two: true, three: true }; + _emberMetal.defineProperty(obj, 'oneTwoThree', _emberRuntimeComputedComputed_macros.and('{one,two,three}')); + + equal(get(obj, 'oneTwoThree'), true, 'one and two and three'); + + set(obj, 'one', false); + + equal(get(obj, 'oneTwoThree'), false, 'one and not two and not three'); + + set(obj, 'one', true); + set(obj, 'two', 2); + set(obj, 'three', 3); + + equal(get(obj, 'oneTwoThree'), 3, 'returns truthy value as in &&'); + }); + + _internalTestHelpers.testBoth('computed.or two properties', function (get, set) { + var obj = { one: true, two: true }; + _emberMetal.defineProperty(obj, 'oneOrTwo', _emberRuntimeComputedComputed_macros.or('one', 'two')); + + equal(get(obj, 'oneOrTwo'), true, 'one or two'); + + set(obj, 'one', false); + + equal(get(obj, 'oneOrTwo'), true, 'one or two'); + + set(obj, 'two', false); + + equal(get(obj, 'oneOrTwo'), false, 'nor one nor two'); + + set(obj, 'two', null); + + equal(get(obj, 'oneOrTwo'), null, 'returns last falsy value as in ||'); + + set(obj, 'two', true); + + equal(get(obj, 'oneOrTwo'), true, 'one or two'); + + set(obj, 'one', 1); + + equal(get(obj, 'oneOrTwo'), 1, 'returns truthy value as in ||'); + }); + + _internalTestHelpers.testBoth('computed.or three properties', function (get, set) { + var obj = { one: true, two: true, three: true }; + _emberMetal.defineProperty(obj, 'oneTwoThree', _emberRuntimeComputedComputed_macros.or('one', 'two', 'three')); + + equal(get(obj, 'oneTwoThree'), true, 'one or two or three'); + + set(obj, 'one', false); + + equal(get(obj, 'oneTwoThree'), true, 'one or two or three'); + + set(obj, 'two', false); + + equal(get(obj, 'oneTwoThree'), true, 'one or two or three'); + + set(obj, 'three', false); + + equal(get(obj, 'oneTwoThree'), false, 'one or two or three'); + + set(obj, 'three', null); + + equal(get(obj, 'oneTwoThree'), null, 'returns last falsy value as in ||'); + + set(obj, 'two', true); + + equal(get(obj, 'oneTwoThree'), true, 'one or two or three'); + + set(obj, 'one', 1); + + equal(get(obj, 'oneTwoThree'), 1, 'returns truthy value as in ||'); + }); + + _internalTestHelpers.testBoth('computed.or expand properties', function (get, set) { + var obj = { one: true, two: true, three: true }; + _emberMetal.defineProperty(obj, 'oneTwoThree', _emberRuntimeComputedComputed_macros.or('{one,two,three}')); + + equal(get(obj, 'oneTwoThree'), true, 'one or two or three'); + + set(obj, 'one', false); + + equal(get(obj, 'oneTwoThree'), true, 'one or two or three'); + + set(obj, 'two', false); + + equal(get(obj, 'oneTwoThree'), true, 'one or two or three'); + + set(obj, 'three', false); + + equal(get(obj, 'oneTwoThree'), false, 'one or two or three'); + + set(obj, 'three', null); + + equal(get(obj, 'oneTwoThree'), null, 'returns last falsy value as in ||'); + + set(obj, 'two', true); + + equal(get(obj, 'oneTwoThree'), true, 'one or two or three'); + + set(obj, 'one', 1); + + equal(get(obj, 'oneTwoThree'), 1, 'returns truthy value as in ||'); + }); + + _internalTestHelpers.testBoth('computed.or and computed.and warn about dependent keys with spaces', function (get, set) { + var obj = { one: true, two: true }; + expectAssertion(function () { + _emberMetal.defineProperty(obj, 'oneOrTwo', _emberRuntimeComputedComputed_macros.or('one', 'two three')); + }, /Dependent keys passed to Ember\.computed\.or\(\) can't have spaces\./); + + expectAssertion(function () { + _emberMetal.defineProperty(obj, 'oneAndTwo', _emberRuntimeComputedComputed_macros.and('one', 'two three')); + }, /Dependent keys passed to Ember\.computed\.and\(\) can't have spaces\./); + }); + + _internalTestHelpers.testBoth('computed.oneWay', function (get, set) { + var obj = { + firstName: 'Teddy', + lastName: 'Zeenny' + }; + + _emberMetal.defineProperty(obj, 'nickName', _emberRuntimeComputedComputed_macros.oneWay('firstName')); + + equal(get(obj, 'firstName'), 'Teddy'); + equal(get(obj, 'lastName'), 'Zeenny'); + equal(get(obj, 'nickName'), 'Teddy'); + + set(obj, 'nickName', 'TeddyBear'); + + equal(get(obj, 'firstName'), 'Teddy'); + equal(get(obj, 'lastName'), 'Zeenny'); + + equal(get(obj, 'nickName'), 'TeddyBear'); + + set(obj, 'firstName', 'TEDDDDDDDDYYY'); + + equal(get(obj, 'nickName'), 'TeddyBear'); + }); + + _internalTestHelpers.testBoth('computed.readOnly', function (get, set) { + var obj = { + firstName: 'Teddy', + lastName: 'Zeenny' + }; + + _emberMetal.defineProperty(obj, 'nickName', _emberRuntimeComputedComputed_macros.readOnly('firstName')); + + equal(get(obj, 'firstName'), 'Teddy'); + equal(get(obj, 'lastName'), 'Zeenny'); + equal(get(obj, 'nickName'), 'Teddy'); + + throws(function () { + set(obj, 'nickName', 'TeddyBear'); + }, / /); + + equal(get(obj, 'firstName'), 'Teddy'); + equal(get(obj, 'lastName'), 'Zeenny'); + + equal(get(obj, 'nickName'), 'Teddy'); + + set(obj, 'firstName', 'TEDDDDDDDDYYY'); + + equal(get(obj, 'nickName'), 'TEDDDDDDDDYYY'); + }); + + _internalTestHelpers.testBoth('computed.deprecatingAlias', function (get, set) { + var obj = { bar: 'asdf', baz: null, quz: false }; + _emberMetal.defineProperty(obj, 'bay', _emberMetal.computed(function (key) { + return 'apple'; + })); + + _emberMetal.defineProperty(obj, 'barAlias', _emberRuntimeComputedComputed_macros.deprecatingAlias('bar')); + _emberMetal.defineProperty(obj, 'bazAlias', _emberRuntimeComputedComputed_macros.deprecatingAlias('baz')); + _emberMetal.defineProperty(obj, 'quzAlias', _emberRuntimeComputedComputed_macros.deprecatingAlias('quz')); + _emberMetal.defineProperty(obj, 'bayAlias', _emberRuntimeComputedComputed_macros.deprecatingAlias('bay')); + + expectDeprecation(function () { + equal(get(obj, 'barAlias'), 'asdf'); + }, 'Usage of `barAlias` is deprecated, use `bar` instead.'); + + expectDeprecation(function () { + equal(get(obj, 'bazAlias'), null); + }, 'Usage of `bazAlias` is deprecated, use `baz` instead.'); + + expectDeprecation(function () { + equal(get(obj, 'quzAlias'), false); + }, 'Usage of `quzAlias` is deprecated, use `quz` instead.'); + + expectDeprecation(function () { + equal(get(obj, 'bayAlias'), 'apple'); + }, 'Usage of `bayAlias` is deprecated, use `bay` instead.'); + + expectDeprecation(function () { + set(obj, 'barAlias', 'newBar'); + }, 'Usage of `barAlias` is deprecated, use `bar` instead.'); + + expectDeprecation(function () { + set(obj, 'bazAlias', 'newBaz'); + }, 'Usage of `bazAlias` is deprecated, use `baz` instead.'); + + expectDeprecation(function () { + set(obj, 'quzAlias', null); + }, 'Usage of `quzAlias` is deprecated, use `quz` instead.'); + + equal(get(obj, 'barAlias'), 'newBar'); + equal(get(obj, 'bazAlias'), 'newBaz'); + equal(get(obj, 'quzAlias'), null); + + equal(get(obj, 'bar'), 'newBar'); + equal(get(obj, 'baz'), 'newBaz'); + equal(get(obj, 'quz'), null); + }); +}); +enifed('ember-runtime/tests/computed/computed_macros_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/computed'); + test('ember-runtime/tests/computed/computed_macros_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/computed/computed_macros_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/computed/computed_macros_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/computed'); + QUnit.test('ember-runtime/tests/computed/computed_macros_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/computed/computed_macros_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/computed/reduce_computed_macros_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object', 'ember-runtime/system/object_proxy', 'ember-runtime/computed/reduce_computed_macros', 'ember-runtime/utils', 'ember-runtime/system/native_array', 'ember-runtime/mixins/mutable_array'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject, _emberRuntimeSystemObject_proxy, _emberRuntimeComputedReduce_computed_macros, _emberRuntimeUtils, _emberRuntimeSystemNative_array, _emberRuntimeMixinsMutable_array) { + 'use strict'; + + var obj = undefined; + QUnit.module('map', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + mapped: _emberRuntimeComputedReduce_computed_macros.map('array.@each.v', function (item) { + return item.v; + }), + mappedObjects: _emberRuntimeComputedReduce_computed_macros.map('arrayObjects.@each.v', function (item) { + return { name: item.v.name }; + }) + }).create({ + arrayObjects: _emberRuntimeSystemNative_array.A([{ v: { name: 'Robert' } }, { v: { name: 'Leanna' } }]), + + array: _emberRuntimeSystemNative_array.A([{ v: 1 }, { v: 3 }, { v: 2 }, { v: 1 }]) + }); + }, + + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('map is readOnly', function () { + QUnit.throws(function () { + obj.set('mapped', 1); + }, /Cannot set read-only property "mapped" on object:/); + }); + + QUnit.test('it maps simple properties', function () { + deepEqual(obj.get('mapped'), [1, 3, 2, 1]); + + obj.get('array').pushObject({ v: 5 }); + + deepEqual(obj.get('mapped'), [1, 3, 2, 1, 5]); + + _emberRuntimeMixinsMutable_array.removeAt(obj.get('array'), 3); + + deepEqual(obj.get('mapped'), [1, 3, 2, 5]); + }); + + QUnit.test('it maps simple unshifted properties', function () { + var array = _emberRuntimeSystemNative_array.A(); + + obj = _emberRuntimeSystemObject.default.extend({ + mapped: _emberRuntimeComputedReduce_computed_macros.map('array', function (item) { + return item.toUpperCase(); + }) + }).create({ + array: array + }); + + array.unshiftObject('c'); + array.unshiftObject('b'); + array.unshiftObject('a'); + + array.popObject(); + + deepEqual(obj.get('mapped'), ['A', 'B'], 'properties unshifted in sequence are mapped correctly'); + }); + + QUnit.test('it has the correct `this`', function () { + obj = _emberRuntimeSystemObject.default.extend({ + mapped: _emberRuntimeComputedReduce_computed_macros.map('array', function (item) { + equal(this, obj, 'should have correct context'); + return this.upperCase(item); + }), + upperCase: function (string) { + return string.toUpperCase(); + } + }).create({ + array: ['a', 'b', 'c'] + }); + + deepEqual(obj.get('mapped'), ['A', 'B', 'C'], 'properties unshifted in sequence are mapped correctly'); + }); + + QUnit.test('it passes the index to the callback', function () { + var array = ['a', 'b', 'c']; + + obj = _emberRuntimeSystemObject.default.extend({ + mapped: _emberRuntimeComputedReduce_computed_macros.map('array', function (item, index) { + return index; + }) + }).create({ + array: array + }); + + deepEqual(obj.get('mapped'), [0, 1, 2], 'index is passed to callback correctly'); + }); + + QUnit.test('it maps objects', function () { + deepEqual(obj.get('mappedObjects'), [{ name: 'Robert' }, { name: 'Leanna' }]); + + obj.get('arrayObjects').pushObject({ + v: { name: 'Eddard' } + }); + + deepEqual(obj.get('mappedObjects'), [{ name: 'Robert' }, { name: 'Leanna' }, { name: 'Eddard' }]); + + _emberRuntimeMixinsMutable_array.removeAt(obj.get('arrayObjects'), 1); + + deepEqual(obj.get('mappedObjects'), [{ name: 'Robert' }, { name: 'Eddard' }]); + + _emberMetal.set(obj.get('arrayObjects')[0], 'v', { name: 'Stannis' }); + + deepEqual(obj.get('mappedObjects'), [{ name: 'Stannis' }, { name: 'Eddard' }]); + }); + + QUnit.test('it maps unshifted objects with property observers', function () { + var array = _emberRuntimeSystemNative_array.A(); + var cObj = { v: 'c' }; + + obj = _emberRuntimeSystemObject.default.extend({ + mapped: _emberRuntimeComputedReduce_computed_macros.map('array.@each.v', function (item) { + return _emberMetal.get(item, 'v').toUpperCase(); + }) + }).create({ + array: array + }); + + array.unshiftObject(cObj); + array.unshiftObject({ v: 'b' }); + array.unshiftObject({ v: 'a' }); + + _emberMetal.set(cObj, 'v', 'd'); + + deepEqual(array.mapBy('v'), ['a', 'b', 'd'], 'precond - unmapped array is correct'); + deepEqual(obj.get('mapped'), ['A', 'B', 'D'], 'properties unshifted in sequence are mapped correctly'); + }); + + QUnit.module('mapBy', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + mapped: _emberRuntimeComputedReduce_computed_macros.mapBy('array', 'v') + }).create({ + array: _emberRuntimeSystemNative_array.A([{ v: 1 }, { v: 3 }, { v: 2 }, { v: 1 }]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('mapBy is readOnly', function () { + QUnit.throws(function () { + obj.set('mapped', 1); + }, /Cannot set read-only property "mapped" on object:/); + }); + + QUnit.test('it maps properties', function () { + deepEqual(obj.get('mapped'), [1, 3, 2, 1]); + + obj.get('array').pushObject({ v: 5 }); + + deepEqual(obj.get('mapped'), [1, 3, 2, 1, 5]); + + _emberRuntimeMixinsMutable_array.removeAt(obj.get('array'), 3); + + deepEqual(obj.get('mapped'), [1, 3, 2, 5]); + }); + + QUnit.test('it is observable', function () { + var calls = 0; + + deepEqual(obj.get('mapped'), [1, 3, 2, 1]); + + _emberMetal.addObserver(obj, 'mapped.@each', function () { + return calls++; + }); + + obj.get('array').pushObject({ v: 5 }); + + equal(calls, 1, 'mapBy is observable'); + }); + + QUnit.module('filter', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + filtered: _emberRuntimeComputedReduce_computed_macros.filter('array', function (item) { + return item % 2 === 0; + }) + }).create({ + array: _emberRuntimeSystemNative_array.A([1, 2, 3, 4, 5, 6, 7, 8]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('filter is readOnly', function () { + QUnit.throws(function () { + obj.set('filtered', 1); + }, /Cannot set read-only property "filtered" on object:/); + }); + + QUnit.test('it filters according to the specified filter function', function () { + deepEqual(obj.get('filtered'), [2, 4, 6, 8], 'filter filters by the specified function'); + }); + + QUnit.test('it passes the index to the callback', function () { + obj = _emberRuntimeSystemObject.default.extend({ + filtered: _emberRuntimeComputedReduce_computed_macros.filter('array', function (item, index) { + return index === 1; + }) + }).create({ + array: ['a', 'b', 'c'] + }); + + deepEqual(_emberMetal.get(obj, 'filtered'), ['b'], 'index is passed to callback correctly'); + }); + + QUnit.test('it has the correct `this`', function () { + obj = _emberRuntimeSystemObject.default.extend({ + filtered: _emberRuntimeComputedReduce_computed_macros.filter('array', function (item, index) { + equal(this, obj); + return this.isOne(index); + }), + isOne: function (value) { + return value === 1; + } + }).create({ + array: ['a', 'b', 'c'] + }); + + deepEqual(_emberMetal.get(obj, 'filtered'), ['b'], 'index is passed to callback correctly'); + }); + + QUnit.test('it passes the array to the callback', function () { + obj = _emberRuntimeSystemObject.default.extend({ + filtered: _emberRuntimeComputedReduce_computed_macros.filter('array', function (item, index, array) { + return index === _emberMetal.get(array, 'length') - 2; + }) + }).create({ + array: _emberRuntimeSystemNative_array.A(['a', 'b', 'c']) + }); + + deepEqual(obj.get('filtered'), ['b'], 'array is passed to callback correctly'); + }); + + QUnit.test('it caches properly', function () { + var array = obj.get('array'); + + var filtered = obj.get('filtered'); + ok(filtered === obj.get('filtered')); + + array.addObject(11); + var newFiltered = obj.get('filtered'); + + ok(filtered !== newFiltered); + + ok(obj.get('filtered') === newFiltered); + }); + + QUnit.test('it updates as the array is modified', function () { + var array = obj.get('array'); + + deepEqual(obj.get('filtered'), [2, 4, 6, 8], 'precond - filtered array is initially correct'); + + array.addObject(11); + deepEqual(obj.get('filtered'), [2, 4, 6, 8], 'objects not passing the filter are not added'); + + array.addObject(12); + deepEqual(obj.get('filtered'), [2, 4, 6, 8, 12], 'objects passing the filter are added'); + + array.removeObject(3); + array.removeObject(4); + + deepEqual(obj.get('filtered'), [2, 6, 8, 12], 'objects removed from the dependent array are removed from the computed array'); + }); + + QUnit.test('the dependent array can be cleared one at a time', function () { + var array = _emberMetal.get(obj, 'array'); + + deepEqual(obj.get('filtered'), [2, 4, 6, 8], 'precond - filtered array is initially correct'); + + // clear 1-8 but in a random order + array.removeObject(3); + array.removeObject(1); + array.removeObject(2); + array.removeObject(4); + array.removeObject(8); + array.removeObject(6); + array.removeObject(5); + array.removeObject(7); + + deepEqual(obj.get('filtered'), [], 'filtered array cleared correctly'); + }); + + QUnit.test('the dependent array can be `clear`ed directly (#3272)', function () { + deepEqual(obj.get('filtered'), [2, 4, 6, 8], 'precond - filtered array is initially correct'); + + obj.get('array').clear(); + + deepEqual(obj.get('filtered'), [], 'filtered array cleared correctly'); + }); + + QUnit.test('it updates as the array is replaced', function () { + deepEqual(obj.get('filtered'), [2, 4, 6, 8], 'precond - filtered array is initially correct'); + + obj.set('array', [20, 21, 22, 23, 24]); + + deepEqual(obj.get('filtered'), [20, 22, 24], 'computed array is updated when array is changed'); + }); + + QUnit.module('filterBy', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + a1s: _emberRuntimeComputedReduce_computed_macros.filterBy('array', 'a', 1), + as: _emberRuntimeComputedReduce_computed_macros.filterBy('array', 'a'), + bs: _emberRuntimeComputedReduce_computed_macros.filterBy('array', 'b') + }).create({ + array: _emberRuntimeSystemNative_array.A([{ name: 'one', a: 1, b: false }, { name: 'two', a: 2, b: false }, { name: 'three', a: 1, b: true }, { name: 'four', b: true }]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('filterBy is readOnly', function () { + QUnit.throws(function () { + obj.set('as', 1); + }, /Cannot set read-only property "as" on object:/); + }); + + QUnit.test('properties can be filtered by truthiness', function () { + deepEqual(obj.get('as').mapBy('name'), ['one', 'two', 'three'], 'properties can be filtered by existence'); + deepEqual(obj.get('bs').mapBy('name'), ['three', 'four'], 'booleans can be filtered'); + + _emberMetal.set(obj.get('array')[0], 'a', undefined); + _emberMetal.set(obj.get('array')[3], 'a', true); + + _emberMetal.set(obj.get('array')[0], 'b', true); + _emberMetal.set(obj.get('array')[3], 'b', false); + + deepEqual(obj.get('as').mapBy('name'), ['two', 'three', 'four'], 'arrays computed by filter property respond to property changes'); + deepEqual(obj.get('bs').mapBy('name'), ['one', 'three'], 'arrays computed by filtered property respond to property changes'); + + obj.get('array').pushObject({ name: 'five', a: 6, b: true }); + + deepEqual(obj.get('as').mapBy('name'), ['two', 'three', 'four', 'five'], 'arrays computed by filter property respond to added objects'); + deepEqual(obj.get('bs').mapBy('name'), ['one', 'three', 'five'], 'arrays computed by filtered property respond to added objects'); + + obj.get('array').popObject(); + + deepEqual(obj.get('as').mapBy('name'), ['two', 'three', 'four'], 'arrays computed by filter property respond to removed objects'); + deepEqual(obj.get('bs').mapBy('name'), ['one', 'three'], 'arrays computed by filtered property respond to removed objects'); + + obj.set('array', [{ name: 'six', a: 12, b: true }]); + + deepEqual(obj.get('as').mapBy('name'), ['six'], 'arrays computed by filter property respond to array changes'); + deepEqual(obj.get('bs').mapBy('name'), ['six'], 'arrays computed by filtered property respond to array changes'); + }); + + QUnit.test('properties can be filtered by values', function () { + deepEqual(obj.get('a1s').mapBy('name'), ['one', 'three'], 'properties can be filtered by matching value'); + + obj.get('array').pushObject({ name: 'five', a: 1 }); + + deepEqual(obj.get('a1s').mapBy('name'), ['one', 'three', 'five'], 'arrays computed by matching value respond to added objects'); + + obj.get('array').popObject(); + + deepEqual(obj.get('a1s').mapBy('name'), ['one', 'three'], 'arrays computed by matching value respond to removed objects'); + + _emberMetal.set(obj.get('array')[1], 'a', 1); + _emberMetal.set(obj.get('array')[2], 'a', 2); + + deepEqual(obj.get('a1s').mapBy('name'), ['one', 'two'], 'arrays computed by matching value respond to modified properties'); + }); + + QUnit.test('properties values can be replaced', function () { + obj = _emberRuntimeSystemObject.default.extend({ + a1s: _emberRuntimeComputedReduce_computed_macros.filterBy('array', 'a', 1), + a1bs: _emberRuntimeComputedReduce_computed_macros.filterBy('a1s', 'b') + }).create({ + array: [] + }); + + deepEqual(obj.get('a1bs').mapBy('name'), [], 'properties can be filtered by matching value'); + + _emberMetal.set(obj, 'array', [{ name: 'item1', a: 1, b: true }]); + + deepEqual(obj.get('a1bs').mapBy('name'), ['item1'], 'properties can be filtered by matching value'); + }); + + [['uniq', _emberRuntimeComputedReduce_computed_macros.uniq], ['union', _emberRuntimeComputedReduce_computed_macros.union]].forEach(function (tuple) { + var name = tuple[0]; + var macro = tuple[1]; + + QUnit.module('computed.' + name, { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + union: macro('array', 'array2', 'array3') + }).create({ + array: _emberRuntimeSystemNative_array.A([1, 2, 3, 4, 5, 6]), + array2: _emberRuntimeSystemNative_array.A([4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9]), + array3: _emberRuntimeSystemNative_array.A([1, 8, 10]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test(name + ' is readOnly', function () { + QUnit.throws(function () { + obj.set('union', 1); + }, /Cannot set read-only property "union" on object:/); + }); + + QUnit.test('does not include duplicates', function () { + var array = obj.get('array'); + var array2 = obj.get('array2'); + + deepEqual(obj.get('union').sort(function (x, y) { + return x - y; + }), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], name + ' does not include duplicates'); + + array.pushObject(8); + + deepEqual(obj.get('union').sort(function (x, y) { + return x - y; + }), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], name + ' does not add existing items'); + + array.pushObject(11); + + deepEqual(obj.get('union').sort(function (x, y) { + return x - y; + }), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], name + ' adds new items'); + + _emberRuntimeMixinsMutable_array.removeAt(array2, 6); // remove 7 + + deepEqual(obj.get('union').sort(function (x, y) { + return x - y; + }), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], name + ' does not remove items that are still in the dependent array'); + + array2.removeObject(7); + + deepEqual(obj.get('union').sort(function (x, y) { + return x - y; + }), [1, 2, 3, 4, 5, 6, 8, 9, 10, 11], name + ' removes items when their last instance is gone'); + }); + + QUnit.test('has set-union semantics', function () { + var array = obj.get('array'); + + deepEqual(obj.get('union').sort(function (x, y) { + return x - y; + }), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], name + ' is initially correct'); + + array.removeObject(6); + + deepEqual(obj.get('union').sort(function (x, y) { + return x - y; + }), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 'objects are not removed if they exist in other dependent arrays'); + + array.clear(); + + deepEqual(obj.get('union').sort(function (x, y) { + return x - y; + }), [1, 4, 5, 6, 7, 8, 9, 10], 'objects are removed when they are no longer in any dependent array'); + }); + }); + + if (true) { + QUnit.module('computed.uniqBy', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + list: null, + uniqueById: _emberRuntimeComputedReduce_computed_macros.uniqBy('list', 'id') + }).create({ + list: _emberRuntimeSystemNative_array.A([{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 1, value: 'one' }]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('uniqBy is readOnly', function () { + QUnit.throws(function () { + obj.set('uniqueById', 1); + }, /Cannot set read-only property "uniqueById" on object:/); + }); + QUnit.test('does not include duplicates', function () { + deepEqual(obj.get('uniqueById'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }]); + }); + + QUnit.test('it does not share state among instances', function () { + var MyObject = _emberRuntimeSystemObject.default.extend({ + list: [], + uniqueByName: _emberRuntimeComputedReduce_computed_macros.uniqBy('list', 'name') + }); + var a = MyObject.create({ list: [{ name: 'bob' }, { name: 'mitch' }, { name: 'mitch' }] }); + var b = MyObject.create({ list: [{ name: 'warren' }, { name: 'mitch' }] }); + + deepEqual(a.get('uniqueByName'), [{ name: 'bob' }, { name: 'mitch' }]); + // Making sure that 'mitch' appears + deepEqual(b.get('uniqueByName'), [{ name: 'warren' }, { name: 'mitch' }]); + }); + + QUnit.test('it handles changes to the dependent array', function () { + obj.get('list').pushObject({ id: 3, value: 'three' }); + + deepEqual(obj.get('uniqueById'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 3, value: 'three' }], 'The list includes three'); + + obj.get('list').pushObject({ id: 3, value: 'three' }); + + deepEqual(obj.get('uniqueById'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 3, value: 'three' }], 'The list does not include a duplicate three'); + }); + + QUnit.test('it returns an empty array when computed on a non-array', function () { + var MyObject = _emberRuntimeSystemObject.default.extend({ + list: null, + uniq: _emberRuntimeComputedReduce_computed_macros.uniqBy('list', 'name') + }); + var a = MyObject.create({ list: 'not an array' }); + + deepEqual(a.get('uniq'), []); + }); + } + + QUnit.module('computed.intersect', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + intersection: _emberRuntimeComputedReduce_computed_macros.intersect('array', 'array2', 'array3') + }).create({ + array: _emberRuntimeSystemNative_array.A([1, 2, 3, 4, 5, 6]), + array2: _emberRuntimeSystemNative_array.A([3, 3, 3, 4, 5]), + array3: _emberRuntimeSystemNative_array.A([3, 5, 6, 7, 8]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('intersect is readOnly', function () { + QUnit.throws(function () { + obj.set('intersection', 1); + }, /Cannot set read-only property "intersection" on object:/); + }); + + QUnit.test('it has set-intersection semantics', function () { + var array2 = obj.get('array2'); + var array3 = obj.get('array3'); + + deepEqual(obj.get('intersection').sort(function (x, y) { + return x - y; + }), [3, 5], 'intersection is initially correct'); + + array2.shiftObject(); + + deepEqual(obj.get('intersection').sort(function (x, y) { + return x - y; + }), [3, 5], 'objects are not removed when they are still in all dependent arrays'); + + array2.shiftObject(); + + deepEqual(obj.get('intersection').sort(function (x, y) { + return x - y; + }), [3, 5], 'objects are not removed when they are still in all dependent arrays'); + + array2.shiftObject(); + + deepEqual(obj.get('intersection'), [5], 'objects are removed once they are gone from all dependent arrays'); + + array2.pushObject(1); + + deepEqual(obj.get('intersection'), [5], 'objects are not added as long as they are missing from any dependent array'); + + array3.pushObject(1); + + deepEqual(obj.get('intersection').sort(function (x, y) { + return x - y; + }), [1, 5], 'objects added once they belong to all dependent arrays'); + }); + + QUnit.module('setDiff', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + diff: _emberRuntimeComputedReduce_computed_macros.setDiff('array', 'array2') + }).create({ + array: _emberRuntimeSystemNative_array.A([1, 2, 3, 4, 5, 6, 7]), + array2: _emberRuntimeSystemNative_array.A([3, 4, 5, 10]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('setDiff is readOnly', function () { + QUnit.throws(function () { + obj.set('diff', 1); + }, /Cannot set read-only property "diff" on object:/); + }); + + QUnit.test('it throws an error if given fewer or more than two dependent properties', function () { + throws(function () { + _emberRuntimeSystemObject.default.extend({ + diff: _emberRuntimeComputedReduce_computed_macros.setDiff('array') + }).create({ + array: _emberRuntimeSystemNative_array.A([1, 2, 3, 4, 5, 6, 7]), + array2: _emberRuntimeSystemNative_array.A([3, 4, 5]) + }); + }, /requires exactly two dependent arrays/, 'setDiff requires two dependent arrays'); + + throws(function () { + _emberRuntimeSystemObject.default.extend({ + diff: _emberRuntimeComputedReduce_computed_macros.setDiff('array', 'array2', 'array3') + }).create({ + array: _emberRuntimeSystemNative_array.A([1, 2, 3, 4, 5, 6, 7]), + array2: _emberRuntimeSystemNative_array.A([3, 4, 5]), + array3: _emberRuntimeSystemNative_array.A([7]) + }); + }, /requires exactly two dependent arrays/, 'setDiff requires two dependent arrays'); + }); + + QUnit.test('it has set-diff semantics', function () { + var array1 = obj.get('array'); + var array2 = obj.get('array2'); + + deepEqual(obj.get('diff').sort(function (x, y) { + return x - y; + }), [1, 2, 6, 7], 'set-diff is initially correct'); + + array2.popObject(); + + deepEqual(obj.get('diff').sort(function (x, y) { + return x - y; + }), [1, 2, 6, 7], 'removing objects from the remove set has no effect if the object is not in the keep set'); + + array2.shiftObject(); + + deepEqual(obj.get('diff').sort(function (x, y) { + return x - y; + }), [1, 2, 3, 6, 7], 'removing objects from the remove set adds them if they\'re in the keep set'); + + array1.removeObject(3); + + deepEqual(obj.get('diff').sort(function (x, y) { + return x - y; + }), [1, 2, 6, 7], 'removing objects from the keep array removes them from the computed array'); + + array1.pushObject(5); + + deepEqual(obj.get('diff').sort(function (x, y) { + return x - y; + }), [1, 2, 6, 7], 'objects added to the keep array that are in the remove array are not added to the computed array'); + + array1.pushObject(22); + + deepEqual(obj.get('diff').sort(function (x, y) { + return x - y; + }), [1, 2, 6, 7, 22], 'objects added to the keep array not in the remove array are added to the computed array'); + }); + + function commonSortTests() { + QUnit.test('arrays are initially sorted', function () { + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'array is initially sorted'); + }); + + QUnit.test('default sort order is correct', function () { + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'array is initially sorted'); + }); + + QUnit.test('changing the dependent array updates the sorted array', function () { + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + obj.set('items', [{ fname: 'Roose', lname: 'Bolton' }, { fname: 'Theon', lname: 'Greyjoy' }, { fname: 'Ramsey', lname: 'Bolton' }, { fname: 'Stannis', lname: 'Baratheon' }]); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Stannis', 'Ramsey', 'Roose', 'Theon'], 'changing dependent array updates sorted array'); + }); + + QUnit.test('adding to the dependent array updates the sorted array', function () { + var items = obj.get('items'); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + items.pushObject({ + fname: 'Tyrion', + lname: 'Lannister' + }); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Tyrion', 'Bran', 'Robb'], 'Adding to the dependent array updates the sorted array'); + }); + + QUnit.test('removing from the dependent array updates the sorted array', function () { + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + obj.get('items').popObject(); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Robb'], 'Removing from the dependent array updates the sorted array'); + }); + + QUnit.test('distinct items may be sort-equal, although their relative order will not be guaranteed', function () { + // We recreate jaime and "Cersei" here only for test stability: we want + // their guid-ordering to be deterministic + var jaimeInDisguise = { + fname: 'Cersei', + lname: 'Lannister', + age: 34 + }; + + var jaime = { + fname: 'Jaime', + lname: 'Lannister', + age: 34 + }; + + var items = obj.get('items'); + + items.replace(0, 1, jaime); + items.replace(1, 1, jaimeInDisguise); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + _emberMetal.set(jaimeInDisguise, 'fname', 'Jaime'); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Jaime', 'Jaime', 'Bran', 'Robb'], 'sorted array is updated'); + + _emberMetal.set(jaimeInDisguise, 'fname', 'Cersei'); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'sorted array is updated'); + }); + + QUnit.test('guid sort-order fallback with a search proxy is not confused by non-search ObjectProxys', function () { + var tyrion = { + fname: 'Tyrion', + lname: 'Lannister' + }; + + var tyrionInDisguise = _emberRuntimeSystemObject_proxy.default.create({ + fname: 'Yollo', + lname: '', + content: tyrion + }); + + var items = obj.get('items'); + + items.pushObject(tyrion); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Tyrion', 'Bran', 'Robb']); + + items.pushObject(tyrionInDisguise); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Yollo', 'Cersei', 'Jaime', 'Tyrion', 'Bran', 'Robb']); + }); + } + + QUnit.module('sort - sortProperties', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + sortedItems: _emberRuntimeComputedReduce_computed_macros.sort('items', 'itemSorting') + }).create({ + itemSorting: _emberRuntimeSystemNative_array.A(['lname', 'fname']), + items: _emberRuntimeSystemNative_array.A([{ fname: 'Jaime', lname: 'Lannister', age: 34 }, { fname: 'Cersei', lname: 'Lannister', age: 34 }, { fname: 'Robb', lname: 'Stark', age: 16 }, { fname: 'Bran', lname: 'Stark', age: 8 }]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('sort is readOnly', function () { + QUnit.throws(function () { + obj.set('sortedItems', 1); + }, /Cannot set read-only property "sortedItems" on object:/); + }); + + commonSortTests(); + + QUnit.test('updating sort properties detaches observers for old sort properties', function () { + var objectToRemove = obj.get('items')[3]; + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + obj.set('itemSorting', _emberRuntimeSystemNative_array.A(['fname:desc'])); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Robb', 'Jaime', 'Cersei', 'Bran'], 'after updating sort properties array is updated'); + + obj.get('items').removeObject(objectToRemove); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Robb', 'Jaime', 'Cersei'], 'after removing item array is updated'); + + _emberMetal.set(objectToRemove, 'lname', 'Updated-Stark'); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Robb', 'Jaime', 'Cersei'], 'after changing removed item array is not updated'); + }); + + QUnit.test('updating sort properties updates the sorted array', function () { + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + obj.set('itemSorting', _emberRuntimeSystemNative_array.A(['fname:desc'])); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Robb', 'Jaime', 'Cersei', 'Bran'], 'after updating sort properties array is updated'); + }); + + QUnit.test('updating sort properties invalidates the sorted array', function () { + var sortProps = obj.get('itemSorting'); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + sortProps.clear(); + sortProps.pushObject('fname'); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Bran', 'Cersei', 'Jaime', 'Robb'], 'after updating sort properties array is updated'); + }); + + QUnit.test('updating new sort properties invalidates the sorted array', function () { + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + obj.set('itemSorting', _emberRuntimeSystemNative_array.A(['age:desc', 'fname:asc'])); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Robb', 'Bran'], 'precond - array is correct after item sorting is changed'); + + _emberMetal.set(obj.get('items')[1], 'age', 29); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Jaime', 'Cersei', 'Robb', 'Bran'], 'after updating sort properties array is updated'); + }); + + QUnit.test('sort direction defaults to ascending', function () { + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb']); + }); + + QUnit.test('sort direction defaults to ascending (with sort property change)', function () { + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + obj.set('itemSorting', _emberRuntimeSystemNative_array.A(['fname'])); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Bran', 'Cersei', 'Jaime', 'Robb'], 'sort direction defaults to ascending'); + }); + + QUnit.test('updating an item\'s sort properties updates the sorted array', function () { + var tyrionInDisguise = obj.get('items')[1]; + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + _emberMetal.set(tyrionInDisguise, 'fname', 'Tyrion'); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Jaime', 'Tyrion', 'Bran', 'Robb'], 'updating an item\'s sort properties updates the sorted array'); + }); + + QUnit.test('updating several of an item\'s sort properties updated the sorted array', function () { + var sansaInDisguise = obj.get('items')[1]; + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + _emberMetal.setProperties(sansaInDisguise, { + fname: 'Sansa', + lname: 'Stark' + }); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Jaime', 'Bran', 'Robb', 'Sansa'], 'updating an item\'s sort properties updates the sorted array'); + }); + + QUnit.test('updating an item\'s sort properties does not error when binary search does a self compare (#3273)', function () { + var jaime = { + name: 'Jaime', + status: 1 + }; + + var cersei = { + name: 'Cersei', + status: 2 + }; + + var obj = _emberRuntimeSystemObject.default.extend({ + sortProps: ['status'], + sortedPeople: _emberRuntimeComputedReduce_computed_macros.sort('people', 'sortProps') + }).create({ + people: [jaime, cersei] + }); + + deepEqual(obj.get('sortedPeople'), [jaime, cersei], 'precond - array is initially sorted'); + + _emberMetal.set(cersei, 'status', 3); + + deepEqual(obj.get('sortedPeople'), [jaime, cersei], 'array is sorted correctly'); + + _emberMetal.set(cersei, 'status', 2); + + deepEqual(obj.get('sortedPeople'), [jaime, cersei], 'array is sorted correctly'); + }); + + QUnit.test('array observers do not leak', function () { + var daria = { name: 'Daria' }; + var jane = { name: 'Jane' }; + + var sisters = [jane, daria]; + + var sortProps = _emberRuntimeSystemNative_array.A(['name']); + var jaime = _emberRuntimeSystemObject.default.extend({ + sortedPeople: _emberRuntimeComputedReduce_computed_macros.sort('sisters', 'sortProps'), + sortProps: sortProps + }).create({ + sisters: sisters + }); + + jaime.get('sortedPeople'); + _emberMetal.run(jaime, 'destroy'); + + try { + sortProps.pushObject({ + name: 'Anna' + }); + ok(true); + } catch (e) { + ok(false, e); + } + }); + + QUnit.test('property paths in sort properties update the sorted array', function () { + var jaime = { + relatedObj: { status: 1, firstName: 'Jaime', lastName: 'Lannister' } + }; + + var cersei = { + relatedObj: { status: 2, firstName: 'Cersei', lastName: 'Lannister' } + }; + + var sansa = _emberRuntimeSystemObject.default.create({ + relatedObj: { status: 3, firstName: 'Sansa', lastName: 'Stark' } + }); + + var obj = _emberRuntimeSystemObject.default.extend({ + sortProps: ['relatedObj.status'], + sortedPeople: _emberRuntimeComputedReduce_computed_macros.sort('people', 'sortProps') + }).create({ + people: [jaime, cersei, sansa] + }); + + deepEqual(obj.get('sortedPeople'), [jaime, cersei, sansa], 'precond - array is initially sorted'); + + _emberMetal.set(cersei, 'status', 3); + + deepEqual(obj.get('sortedPeople'), [jaime, cersei, sansa], 'array is sorted correctly'); + + _emberMetal.set(cersei, 'status', 1); + + deepEqual(obj.get('sortedPeople'), [jaime, cersei, sansa], 'array is sorted correctly'); + + sansa.set('status', 1); + + deepEqual(obj.get('sortedPeople'), [jaime, cersei, sansa], 'array is sorted correctly'); + + obj.set('sortProps', ['relatedObj.firstName']); + + deepEqual(obj.get('sortedPeople'), [cersei, jaime, sansa], 'array is sorted correctly'); + }); + + QUnit.test('if the dependentKey is neither an array nor object, it will return an empty array', function () { + _emberMetal.set(obj, 'items', null); + ok(_emberRuntimeUtils.isArray(obj.get('sortedItems')), 'returns an empty arrays'); + + _emberMetal.set(obj, 'array', undefined); + ok(_emberRuntimeUtils.isArray(obj.get('sortedItems')), 'returns an empty arrays'); + + _emberMetal.set(obj, 'array', 'not an array'); + ok(_emberRuntimeUtils.isArray(obj.get('sortedItems')), 'returns an empty arrays'); + }); + + function sortByLnameFname(a, b) { + var lna = _emberMetal.get(a, 'lname'); + var lnb = _emberMetal.get(b, 'lname'); + + if (lna !== lnb) { + return lna > lnb ? 1 : -1; + } + + return sortByFnameAsc(a, b); + } + + function sortByFnameAsc(a, b) { + var fna = _emberMetal.get(a, 'fname'); + var fnb = _emberMetal.get(b, 'fname'); + + if (fna === fnb) { + return 0; + } + return fna > fnb ? 1 : -1; + } + + QUnit.module('sort - sort function', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + sortedItems: _emberRuntimeComputedReduce_computed_macros.sort('items.@each.fname', sortByLnameFname) + }).create({ + items: _emberRuntimeSystemNative_array.A([{ fname: 'Jaime', lname: 'Lannister', age: 34 }, { fname: 'Cersei', lname: 'Lannister', age: 34 }, { fname: 'Robb', lname: 'Stark', age: 16 }, { fname: 'Bran', lname: 'Stark', age: 8 }]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('sort has correct `this`', function () { + var obj = _emberRuntimeSystemObject.default.extend({ + sortedItems: _emberRuntimeComputedReduce_computed_macros.sort('items.@each.fname', function (a, b) { + equal(this, obj, 'expected the object to be `this`'); + return this.sortByLastName(a, b); + }), + sortByLastName: function (a, b) { + return sortByFnameAsc(a, b); + } + }).create({ + items: _emberRuntimeSystemNative_array.A([{ fname: 'Jaime', lname: 'Lannister', age: 34 }, { fname: 'Cersei', lname: 'Lannister', age: 34 }, { fname: 'Robb', lname: 'Stark', age: 16 }, { fname: 'Bran', lname: 'Stark', age: 8 }]) + }); + + obj.get('sortedItems'); + }); + + QUnit.test('sort (with function) is readOnly', function () { + QUnit.throws(function () { + obj.set('sortedItems', 1); + }, /Cannot set read-only property "sortedItems" on object:/); + }); + + commonSortTests(); + + QUnit.test('changing item properties specified via @each triggers a resort of the modified item', function () { + var items = _emberMetal.get(obj, 'items'); + + var tyrionInDisguise = items[1]; + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + _emberMetal.set(tyrionInDisguise, 'fname', 'Tyrion'); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Jaime', 'Tyrion', 'Bran', 'Robb'], 'updating a specified property on an item resorts it'); + }); + + QUnit.test('changing item properties not specified via @each does not trigger a resort', function () { + var items = obj.get('items'); + var cersei = items[1]; + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + _emberMetal.set(cersei, 'lname', 'Stark'); // plot twist! (possibly not canon) + + // The array has become unsorted. If your sort function is sensitive to + // properties, they *must* be specified as dependent item property keys or + // we'll be doing binary searches on unsorted arrays. + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'updating an unspecified property on an item does not resort it'); + }); + + QUnit.module('sort - stability', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + sortProps: ['count', 'name'], + sortedItems: _emberRuntimeComputedReduce_computed_macros.sort('items', 'sortProps') + }).create({ + items: [{ name: 'A', count: 1, thing: 4 }, { name: 'B', count: 1, thing: 3 }, { name: 'C', count: 1, thing: 2 }, { name: 'D', count: 1, thing: 4 }] + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('sorts correctly as only one property changes', function () { + deepEqual(obj.get('sortedItems').mapBy('name'), ['A', 'B', 'C', 'D'], 'initial'); + + _emberMetal.set(obj.get('items')[3], 'count', 2); + + deepEqual(obj.get('sortedItems').mapBy('name'), ['A', 'B', 'C', 'D'], 'final'); + }); + + var klass = undefined; + QUnit.module('sort - concurrency', { + setup: function () { + klass = _emberRuntimeSystemObject.default.extend({ + sortProps: ['count'], + sortedItems: _emberRuntimeComputedReduce_computed_macros.sort('items', 'sortProps'), + customSortedItems: _emberRuntimeComputedReduce_computed_macros.sort('items.@each.count', function (a, b) { + return a.count - b.count; + }) + }); + obj = klass.create({ + items: _emberRuntimeSystemNative_array.A([{ name: 'A', count: 1, thing: 4, id: 1 }, { name: 'B', count: 2, thing: 3, id: 2 }, { name: 'C', count: 3, thing: 2, id: 3 }, { name: 'D', count: 4, thing: 1, id: 4 }]) + }); + }, + + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('sorts correctly after mutation to the sort properties', function () { + var sorted = obj.get('sortedItems'); + deepEqual(sorted.mapBy('name'), ['A', 'B', 'C', 'D'], 'initial'); + + _emberMetal.set(obj.get('items')[1], 'count', 5); + _emberMetal.set(obj.get('items')[2], 'count', 6); + + deepEqual(obj.get('sortedItems').mapBy('name'), ['A', 'D', 'B', 'C'], 'final'); + }); + + QUnit.test('sort correctly after mutation to the sort', function () { + deepEqual(obj.get('customSortedItems').mapBy('name'), ['A', 'B', 'C', 'D'], 'initial'); + + _emberMetal.set(obj.get('items')[1], 'count', 5); + _emberMetal.set(obj.get('items')[2], 'count', 6); + + deepEqual(obj.get('customSortedItems').mapBy('name'), ['A', 'D', 'B', 'C'], 'final'); + + deepEqual(obj.get('sortedItems').mapBy('name'), ['A', 'D', 'B', 'C'], 'final'); + }); + + QUnit.test('sort correctly on multiple instances of the same class', function () { + var obj2 = klass.create({ + items: _emberRuntimeSystemNative_array.A([{ name: 'W', count: 23, thing: 4 }, { name: 'X', count: 24, thing: 3 }, { name: 'Y', count: 25, thing: 2 }, { name: 'Z', count: 26, thing: 1 }]) + }); + + deepEqual(obj2.get('sortedItems').mapBy('name'), ['W', 'X', 'Y', 'Z'], 'initial'); + deepEqual(obj.get('sortedItems').mapBy('name'), ['A', 'B', 'C', 'D'], 'initial'); + + _emberMetal.set(obj.get('items')[1], 'count', 5); + _emberMetal.set(obj.get('items')[2], 'count', 6); + _emberMetal.set(obj2.get('items')[1], 'count', 27); + _emberMetal.set(obj2.get('items')[2], 'count', 28); + + deepEqual(obj.get('sortedItems').mapBy('name'), ['A', 'D', 'B', 'C'], 'final'); + deepEqual(obj2.get('sortedItems').mapBy('name'), ['W', 'Z', 'X', 'Y'], 'final'); + + obj.set('sortProps', ['thing']); + + deepEqual(obj.get('sortedItems').mapBy('name'), ['D', 'C', 'B', 'A'], 'final'); + + obj2.notifyPropertyChange('sortedItems'); // invalidate to flush, to get DK refreshed + obj2.get('sortedItems'); // flush to get updated DK + + obj2.set('items.firstObject.count', 9999); + + deepEqual(obj2.get('sortedItems').mapBy('name'), ['Z', 'X', 'Y', 'W'], 'final'); + }); + + QUnit.test('sort correctly when multiple sorts are chained on the same instance of a class', function () { + var obj2 = klass.extend({ + items: _emberMetal.computed('sibling.sortedItems.[]', function () { + return this.get('sibling.sortedItems'); + }), + asdf: _emberMetal.observer('sibling.sortedItems.[]', function () { + this.get('sibling.sortedItems'); + }) + }).create({ + sibling: obj + }); + + /* + ┌───────────┐ ┌────────────┐ + │sortedProps│ │sortedProps2│ + └───────────┘ └────────────┘ + ▲ ▲ + │ ╔═══════════╗ │ + │─ ─ ─ ─ ─ ─ ─ ▶║ CP (sort) ║◀─ ─ ─ ─ ─ ─ ─ ┤ + │ ╚═══════════╝ │ + │ │ + ┌───────────┐ ┏━━━━━━━━━━━┓ ┏━━━━━━━━━━━━┓ + │ │ ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┃ ┃ ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┃ ┃ + │ items │◀── items.@each.count │◀──┃sortedItems┃◀─── items.@each.count │◀───┃sortedItems2┃ + │ │ └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┃ ┃ └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┃ ┃ + └───────────┘ ┗━━━━━━━━━━━┛ ┗━━━━━━━━━━━━┛ + */ + + deepEqual(obj.get('sortedItems').mapBy('name'), ['A', 'B', 'C', 'D'], 'obj.sortedItems.name should be sorted alpha'); + deepEqual(obj2.get('sortedItems').mapBy('name'), ['A', 'B', 'C', 'D'], 'obj2.sortedItems.name should be sorted alpha'); + + _emberMetal.set(obj.get('items')[1], 'count', 5); + _emberMetal.set(obj.get('items')[2], 'count', 6); + + deepEqual(obj.get('sortedItems').mapBy('name'), ['A', 'D', 'B', 'C'], 'obj.sortedItems.name should now have changed'); + deepEqual(obj2.get('sortedItems').mapBy('name'), ['A', 'D', 'B', 'C'], 'obj2.sortedItems.name should still mirror sortedItems2'); + + obj.set('sortProps', ['thing']); + obj2.set('sortProps', ['id']); + + deepEqual(obj2.get('sortedItems').mapBy('name'), ['A', 'B', 'C', 'D'], 'we now sort obj2 by id, so we expect a b c d'); + deepEqual(obj.get('sortedItems').mapBy('name'), ['D', 'C', 'B', 'A'], 'we now sort obj by thing'); + }); + + QUnit.module('max', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + max: _emberRuntimeComputedReduce_computed_macros.max('items') + }).create({ + items: _emberRuntimeSystemNative_array.A([1, 2, 3]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('max is readOnly', function () { + QUnit.throws(function () { + obj.set('max', 1); + }, /Cannot set read-only property "max" on object:/); + }); + + QUnit.test('max tracks the max number as objects are added', function () { + equal(obj.get('max'), 3, 'precond - max is initially correct'); + + var items = obj.get('items'); + + items.pushObject(5); + + equal(obj.get('max'), 5, 'max updates when a larger number is added'); + + items.pushObject(2); + + equal(obj.get('max'), 5, 'max does not update when a smaller number is added'); + }); + + QUnit.test('max recomputes when the current max is removed', function () { + equal(obj.get('max'), 3, 'precond - max is initially correct'); + + obj.get('items').removeObject(2); + + equal(obj.get('max'), 3, 'max is unchanged when a non-max item is removed'); + + obj.get('items').removeObject(3); + + equal(obj.get('max'), 1, 'max is recomputed when the current max is removed'); + }); + + QUnit.module('min', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + min: _emberRuntimeComputedReduce_computed_macros.min('items') + }).create({ + items: _emberRuntimeSystemNative_array.A([1, 2, 3]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('min is readOnly', function () { + QUnit.throws(function () { + obj.set('min', 1); + }, /Cannot set read-only property "min" on object:/); + }); + + QUnit.test('min tracks the min number as objects are added', function () { + equal(obj.get('min'), 1, 'precond - min is initially correct'); + + obj.get('items').pushObject(-2); + + equal(obj.get('min'), -2, 'min updates when a smaller number is added'); + + obj.get('items').pushObject(2); + + equal(obj.get('min'), -2, 'min does not update when a larger number is added'); + }); + + QUnit.test('min recomputes when the current min is removed', function () { + var items = obj.get('items'); + + equal(obj.get('min'), 1, 'precond - min is initially correct'); + + items.removeObject(2); + + equal(obj.get('min'), 1, 'min is unchanged when a non-min item is removed'); + + items.removeObject(1); + + equal(obj.get('min'), 3, 'min is recomputed when the current min is removed'); + }); + + QUnit.module('Ember.arrayComputed - mixed sugar', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + lannisters: _emberRuntimeComputedReduce_computed_macros.filterBy('items', 'lname', 'Lannister'), + lannisterSorting: _emberRuntimeSystemNative_array.A(['fname']), + sortedLannisters: _emberRuntimeComputedReduce_computed_macros.sort('lannisters', 'lannisterSorting'), + + starks: _emberRuntimeComputedReduce_computed_macros.filterBy('items', 'lname', 'Stark'), + starkAges: _emberRuntimeComputedReduce_computed_macros.mapBy('starks', 'age'), + oldestStarkAge: _emberRuntimeComputedReduce_computed_macros.max('starkAges') + }).create({ + items: _emberRuntimeSystemNative_array.A([{ fname: 'Jaime', lname: 'Lannister', age: 34 }, { fname: 'Cersei', lname: 'Lannister', age: 34 }, { fname: 'Robb', lname: 'Stark', age: 16 }, { fname: 'Bran', lname: 'Stark', age: 8 }]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('filtering and sorting can be combined', function () { + var items = obj.get('items'); + + deepEqual(obj.get('sortedLannisters').mapBy('fname'), ['Cersei', 'Jaime'], 'precond - array is initially filtered and sorted'); + + items.pushObject({ fname: 'Tywin', lname: 'Lannister' }); + items.pushObject({ fname: 'Lyanna', lname: 'Stark' }); + items.pushObject({ fname: 'Gerion', lname: 'Lannister' }); + + deepEqual(obj.get('sortedLannisters').mapBy('fname'), ['Cersei', 'Gerion', 'Jaime', 'Tywin'], 'updates propagate to array'); + }); + + QUnit.test('filtering, sorting and reduce (max) can be combined', function () { + var items = obj.get('items'); + + equal(16, obj.get('oldestStarkAge'), 'precond - end of chain is initially correct'); + + items.pushObject({ fname: 'Rickon', lname: 'Stark', age: 5 }); + + equal(16, obj.get('oldestStarkAge'), 'chain is updated correctly'); + + items.pushObject({ fname: 'Eddard', lname: 'Stark', age: 35 }); + + equal(35, obj.get('oldestStarkAge'), 'chain is updated correctly'); + }); + + function todo(name, priority) { + return _emberRuntimeSystemObject.default.create({ name: name, priority: priority }); + } + + function priorityComparator(todoA, todoB) { + var pa = parseInt(_emberMetal.get(todoA, 'priority'), 10); + var pb = parseInt(_emberMetal.get(todoB, 'priority'), 10); + + return pa - pb; + } + + function evenPriorities(todo) { + var p = parseInt(_emberMetal.get(todo, 'priority'), 10); + + return p % 2 === 0; + } + + QUnit.module('Ember.arrayComputed - chains', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + sorted: _emberRuntimeComputedReduce_computed_macros.sort('todos.@each.priority', priorityComparator), + filtered: _emberRuntimeComputedReduce_computed_macros.filter('sorted.@each.priority', evenPriorities) + }).create({ + todos: _emberRuntimeSystemNative_array.A([todo('E', 4), todo('D', 3), todo('C', 2), todo('B', 1), todo('A', 0)]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('it can filter and sort when both depend on the same item property', function () { + deepEqual(obj.get('todos').mapBy('name'), ['E', 'D', 'C', 'B', 'A'], 'precond - todos initially correct'); + deepEqual(obj.get('sorted').mapBy('name'), ['A', 'B', 'C', 'D', 'E'], 'precond - sorted initially correct'); + deepEqual(obj.get('filtered').mapBy('name'), ['A', 'C', 'E'], 'precond - filtered initially correct'); + + _emberMetal.set(obj.get('todos')[1], 'priority', 6); + + deepEqual(obj.get('todos').mapBy('name'), ['E', 'D', 'C', 'B', 'A'], 'precond - todos remain correct'); + deepEqual(obj.get('sorted').mapBy('name'), ['A', 'B', 'C', 'E', 'D'], 'precond - sorted updated correctly'); + deepEqual(obj.get('filtered').mapBy('name'), ['A', 'C', 'E', 'D'], 'filtered updated correctly'); + }); + + var userFnCalls = undefined; + QUnit.module('Chaining array and reduced CPs', { + setup: function () { + userFnCalls = 0; + obj = _emberRuntimeSystemObject.default.extend({ + mapped: _emberRuntimeComputedReduce_computed_macros.mapBy('array', 'v'), + max: _emberRuntimeComputedReduce_computed_macros.max('mapped'), + maxDidChange: _emberMetal.observer('max', function () { + return userFnCalls++; + }) + }).create({ + array: _emberRuntimeSystemNative_array.A([{ v: 1 }, { v: 3 }, { v: 2 }, { v: 1 }]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('it computes interdependent array computed properties', function () { + equal(obj.get('max'), 3, 'sanity - it properly computes the maximum value'); + + var calls = 0; + + _emberMetal.addObserver(obj, 'max', function () { + return calls++; + }); + + obj.get('array').pushObject({ v: 5 }); + + equal(obj.get('max'), 5, 'maximum value is updated correctly'); + equal(userFnCalls, 1, 'object defined observers fire'); + equal(calls, 1, 'runtime created observers fire'); + }); + + QUnit.module('sum', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + total: _emberRuntimeComputedReduce_computed_macros.sum('array') + }).create({ + array: _emberRuntimeSystemNative_array.A([1, 2, 3]) + }); + }, + + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('sum is readOnly', function () { + QUnit.throws(function () { + obj.set('total', 1); + }, /Cannot set read-only property "total" on object:/); + }); + QUnit.test('sums the values in the dependentKey', function () { + equal(obj.get('total'), 6, 'sums the values'); + }); + + QUnit.test('if the dependentKey is neither an array nor object, it will return `0`', function () { + _emberMetal.set(obj, 'array', null); + equal(_emberMetal.get(obj, 'total'), 0, 'returns 0'); + + _emberMetal.set(obj, 'array', undefined); + equal(_emberMetal.get(obj, 'total'), 0, 'returns 0'); + + _emberMetal.set(obj, 'array', 'not an array'); + equal(_emberMetal.get(obj, 'total'), 0, 'returns 0'); + }); + + QUnit.test('updates when array is modified', function () { + obj.get('array').pushObject(1); + + equal(obj.get('total'), 7, 'recomputed when elements are added'); + + obj.get('array').popObject(); + + equal(obj.get('total'), 6, 'recomputes when elements are removed'); + }); + + QUnit.module('collect'); + + _internalTestHelpers.testBoth('works', function (get, set) { + var obj = { one: 'foo', two: 'bar', three: null }; + _emberMetal.defineProperty(obj, 'all', _emberRuntimeComputedReduce_computed_macros.collect('one', 'two', 'three', 'four')); + + deepEqual(get(obj, 'all'), ['foo', 'bar', null, null], 'have all of them'); + + set(obj, 'four', true); + + deepEqual(get(obj, 'all'), ['foo', 'bar', null, true], 'have all of them'); + + var a = []; + set(obj, 'one', 0); + set(obj, 'three', a); + + deepEqual(get(obj, 'all'), [0, 'bar', a, true], 'have all of them'); + }); +}); +enifed('ember-runtime/tests/computed/reduce_computed_macros_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/computed'); + test('ember-runtime/tests/computed/reduce_computed_macros_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/computed/reduce_computed_macros_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/computed/reduce_computed_macros_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/computed'); + QUnit.test('ember-runtime/tests/computed/reduce_computed_macros_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/computed/reduce_computed_macros_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/controllers/controller_test', ['exports', 'ember-runtime/controllers/controller', 'ember-runtime/system/service', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/inject', 'internal-test-helpers'], function (exports, _emberRuntimeControllersController, _emberRuntimeSystemService, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeInject, _internalTestHelpers) { + /* global EmberDev */ + + 'use strict'; + + QUnit.module('Controller event handling'); + + QUnit.test('can access `actions` hash via `_actions` [DEPRECATED]', function () { + expect(2); + + var controller = _emberRuntimeControllersController.default.extend({ + actions: { + foo: function () { + ok(true, 'called foo action'); + } + } + }).create(); + + expectDeprecation(function () { + controller._actions.foo(); + }, 'Usage of `_actions` is deprecated, use `actions` instead.'); + }); + + QUnit.test('Action can be handled by a function on actions object', function () { + expect(1); + var TestController = _emberRuntimeControllersController.default.extend({ + actions: { + poke: function () { + ok(true, 'poked'); + } + } + }); + var controller = TestController.create(); + controller.send('poke'); + }); + + QUnit.test('A handled action can be bubbled to the target for continued processing', function () { + expect(2); + var TestController = _emberRuntimeControllersController.default.extend({ + actions: { + poke: function () { + ok(true, 'poked 1'); + return true; + } + } + }); + + var controller = TestController.create({ + target: _emberRuntimeControllersController.default.extend({ + actions: { + poke: function () { + ok(true, 'poked 2'); + } + } + }).create() + }); + controller.send('poke'); + }); + + QUnit.test('Action can be handled by a superclass\' actions object', function () { + expect(4); + + var SuperController = _emberRuntimeControllersController.default.extend({ + actions: { + foo: function () { + ok(true, 'foo'); + }, + bar: function (msg) { + equal(msg, 'HELLO'); + } + } + }); + + var BarControllerMixin = _emberMetal.Mixin.create({ + actions: { + bar: function (msg) { + equal(msg, 'HELLO'); + this._super(msg); + } + } + }); + + var IndexController = SuperController.extend(BarControllerMixin, { + actions: { + baz: function () { + ok(true, 'baz'); + } + } + }); + + var controller = IndexController.create({}); + controller.send('foo'); + controller.send('bar', 'HELLO'); + controller.send('baz'); + }); + + QUnit.module('Controller deprecations'); + + QUnit.module('Controller Content -> Model Alias'); + + QUnit.test('`model` is aliased as `content`', function () { + expect(1); + var controller = _emberRuntimeControllersController.default.extend({ + model: 'foo-bar' + }).create(); + + equal(controller.get('content'), 'foo-bar', 'content is an alias of model'); + }); + + QUnit.test('`content` is moved to `model` when `model` is unset', function () { + expect(2); + var controller = undefined; + + ignoreDeprecation(function () { + controller = _emberRuntimeControllersController.default.extend({ + content: 'foo-bar' + }).create(); + }); + + equal(controller.get('model'), 'foo-bar', 'model is set properly'); + equal(controller.get('content'), 'foo-bar', 'content is set properly'); + }); + + QUnit.test('specifying `content` (without `model` specified) results in deprecation', function () { + expect(1); + var controller = undefined; + + expectDeprecation(function () { + controller = _emberRuntimeControllersController.default.extend({ + content: 'foo-bar' + }).create(); + }, 'Do not specify `content` on a Controller, use `model` instead.'); + }); + + QUnit.test('specifying `content` (with `model` specified) does not result in deprecation', function () { + expect(3); + expectNoDeprecation(); + + var controller = _emberRuntimeControllersController.default.extend({ + content: 'foo-bar', + model: 'blammo' + }).create(); + + equal(_emberMetal.get(controller, 'content'), 'foo-bar'); + equal(_emberMetal.get(controller, 'model'), 'blammo'); + }); + + QUnit.module('Controller injected properties'); + + if (!EmberDev.runningProdBuild) { + QUnit.test('defining a controller on a non-controller should fail assertion', function () { + expectAssertion(function () { + var owner = _internalTestHelpers.buildOwner(); + + var AnObject = _emberRuntimeSystemObject.default.extend({ + foo: _emberRuntimeInject.default.controller('bar') + }); + + owner.register('foo:main', AnObject); + + owner._lookupFactory('foo:main'); + }, /Defining an injected controller property on a non-controller is not allowed./); + }); + } + + QUnit.test('controllers can be injected into controllers', function () { + var owner = _internalTestHelpers.buildOwner(); + + owner.register('controller:post', _emberRuntimeControllersController.default.extend({ + postsController: _emberRuntimeInject.default.controller('posts') + })); + + owner.register('controller:posts', _emberRuntimeControllersController.default.extend()); + + var postController = owner.lookup('controller:post'); + var postsController = owner.lookup('controller:posts'); + + equal(postsController, postController.get('postsController'), 'controller.posts is injected'); + }); + + QUnit.test('services can be injected into controllers', function () { + var owner = _internalTestHelpers.buildOwner(); + + owner.register('controller:application', _emberRuntimeControllersController.default.extend({ + authService: _emberRuntimeInject.default.service('auth') + })); + + owner.register('service:auth', _emberRuntimeSystemService.default.extend()); + + var appController = owner.lookup('controller:application'); + var authService = owner.lookup('service:auth'); + + equal(authService, appController.get('authService'), 'service.auth is injected'); + }); +}); +enifed('ember-runtime/tests/controllers/controller_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/controllers'); + test('ember-runtime/tests/controllers/controller_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/controllers/controller_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/controllers/controller_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/controllers'); + QUnit.test('ember-runtime/tests/controllers/controller_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/controllers/controller_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/core/compare_test', ['exports', 'ember-runtime/utils', 'ember-runtime/system/object', 'ember-runtime/compare', 'ember-runtime/mixins/comparable'], function (exports, _emberRuntimeUtils, _emberRuntimeSystemObject, _emberRuntimeCompare, _emberRuntimeMixinsComparable) { + 'use strict'; + + var data = []; + var Comp = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsComparable.default); + + Comp.reopenClass({ + compare: function (obj) { + return obj.get('val'); + } + }); + + QUnit.module('Ember.compare()', { + setup: function () { + data[0] = null; + data[1] = false; + data[2] = true; + data[3] = -12; + data[4] = 3.5; + data[5] = 'a string'; + data[6] = 'another string'; + data[7] = 'last string'; + data[8] = [1, 2]; + data[9] = [1, 2, 3]; + data[10] = [1, 3]; + data[11] = { a: 'hash' }; + data[12] = _emberRuntimeSystemObject.default.create(); + data[13] = function (a) { + return a; + }; + data[14] = new Date('2012/01/01'); + data[15] = new Date('2012/06/06'); + } + }); + + QUnit.test('ordering should work', function () { + var suspect = undefined, + comparable = undefined, + failureMessage = undefined, + suspectIndex = undefined, + comparableIndex = undefined; + + for (suspectIndex = 0; suspectIndex < data.length; suspectIndex++) { + suspect = data[suspectIndex]; + + equal(_emberRuntimeCompare.default(suspect, suspect), 0, suspectIndex + ' should equal itself'); + + for (comparableIndex = suspectIndex + 1; comparableIndex < data.length; comparableIndex++) { + comparable = data[comparableIndex]; + + failureMessage = 'data[' + suspectIndex + '] (' + _emberRuntimeUtils.typeOf(suspect) + ') should be smaller than data[' + comparableIndex + '] (' + _emberRuntimeUtils.typeOf(comparable) + ')'; + + equal(_emberRuntimeCompare.default(suspect, comparable), -1, failureMessage); + } + } + }); + + QUnit.test('comparables should return values in the range of -1, 0, 1', function () { + var negOne = Comp.create({ + val: -1 + }); + + var zero = Comp.create({ + val: 0 + }); + + var one = Comp.create({ + val: 1 + }); + + equal(_emberRuntimeCompare.default(negOne, 'a'), -1, 'First item comparable - returns -1 (not negated)'); + equal(_emberRuntimeCompare.default(zero, 'b'), 0, 'First item comparable - returns 0 (not negated)'); + equal(_emberRuntimeCompare.default(one, 'c'), 1, 'First item comparable - returns 1 (not negated)'); + + equal(_emberRuntimeCompare.default('a', negOne), 1, 'Second item comparable - returns -1 (negated)'); + equal(_emberRuntimeCompare.default('b', zero), 0, 'Second item comparable - returns 0 (negated)'); + equal(_emberRuntimeCompare.default('c', one), -1, 'Second item comparable - returns 1 (negated)'); + }); +}); +enifed('ember-runtime/tests/core/compare_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/core'); + test('ember-runtime/tests/core/compare_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/core/compare_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/core/compare_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/core'); + QUnit.test('ember-runtime/tests/core/compare_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/core/compare_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/core/copy_test', ['exports', 'ember-runtime/copy'], function (exports, _emberRuntimeCopy) { + 'use strict'; + + QUnit.module('Ember Copy Method'); + + QUnit.test('Ember.copy null', function () { + var obj = { field: null }; + + equal(_emberRuntimeCopy.default(obj, true).field, null, 'null should still be null'); + }); + + QUnit.test('Ember.copy date', function () { + var date = new Date(2014, 7, 22); + var dateCopy = _emberRuntimeCopy.default(date); + + equal(date.getTime(), dateCopy.getTime(), 'dates should be equivalent'); + }); + + QUnit.test('Ember.copy null prototype object', function () { + var obj = Object.create(null); + + obj.foo = 'bar'; + + equal(_emberRuntimeCopy.default(obj).foo, 'bar', 'bar should still be bar'); + }); + + QUnit.test('Ember.copy Array', function () { + var array = [1, null, new Date(2015, 9, 9), 'four']; + var arrayCopy = _emberRuntimeCopy.default(array); + + deepEqual(array, arrayCopy, 'array content cloned successfully in new array'); + }); +}); +enifed('ember-runtime/tests/core/copy_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/core'); + test('ember-runtime/tests/core/copy_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/core/copy_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/core/copy_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/core'); + QUnit.test('ember-runtime/tests/core/copy_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/core/copy_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/core/isEqual_test', ['exports', 'ember-runtime/is-equal'], function (exports, _emberRuntimeIsEqual) { + 'use strict'; + + QUnit.module('isEqual'); + + QUnit.test('undefined and null', function () { + ok(_emberRuntimeIsEqual.default(undefined, undefined), 'undefined is equal to undefined'); + ok(!_emberRuntimeIsEqual.default(undefined, null), 'undefined is not equal to null'); + ok(_emberRuntimeIsEqual.default(null, null), 'null is equal to null'); + ok(!_emberRuntimeIsEqual.default(null, undefined), 'null is not equal to undefined'); + }); + + QUnit.test('strings should be equal', function () { + ok(!_emberRuntimeIsEqual.default('Hello', 'Hi'), 'different Strings are unequal'); + ok(_emberRuntimeIsEqual.default('Hello', 'Hello'), 'same Strings are equal'); + }); + + QUnit.test('numericals should be equal', function () { + ok(_emberRuntimeIsEqual.default(24, 24), 'same numbers are equal'); + ok(!_emberRuntimeIsEqual.default(24, 21), 'different numbers are inequal'); + }); + + QUnit.test('dates should be equal', function () { + ok(_emberRuntimeIsEqual.default(new Date(1985, 7, 22), new Date(1985, 7, 22)), 'same dates are equal'); + ok(!_emberRuntimeIsEqual.default(new Date(2014, 7, 22), new Date(1985, 7, 22)), 'different dates are not equal'); + }); + + QUnit.test('array should be equal', function () { + // NOTE: We don't test for array contents -- that would be too expensive. + ok(!_emberRuntimeIsEqual.default([1, 2], [1, 2]), 'two array instances with the same values should not be equal'); + ok(!_emberRuntimeIsEqual.default([1, 2], [1]), 'two array instances with different values should not be equal'); + }); + + QUnit.test('first object implements isEqual should use it', function () { + ok(_emberRuntimeIsEqual.default({ isEqual: function () { + return true; + } }, null), 'should return true always'); + + var obj = { isEqual: function () { + return false; + } }; + equal(_emberRuntimeIsEqual.default(obj, obj), false, 'should return false because isEqual returns false'); + }); +}); +enifed('ember-runtime/tests/core/isEqual_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/core'); + test('ember-runtime/tests/core/isEqual_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/core/isEqual_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/core/isEqual_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/core'); + QUnit.test('ember-runtime/tests/core/isEqual_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/core/isEqual_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/core/is_array_test', ['exports', 'ember-runtime/utils', 'ember-runtime/system/native_array', 'ember-runtime/system/array_proxy', 'ember-environment'], function (exports, _emberRuntimeUtils, _emberRuntimeSystemNative_array, _emberRuntimeSystemArray_proxy, _emberEnvironment) { + 'use strict'; + + QUnit.module('Ember Type Checking'); + + var global = undefined; + + QUnit.test('Ember.isArray', function () { + var numarray = [1, 2, 3]; + var number = 23; + var strarray = ['Hello', 'Hi']; + var string = 'Hello'; + var object = {}; + var length = { length: 12 }; + var fn = function () {}; + var arrayProxy = _emberRuntimeSystemArray_proxy.default.create({ content: _emberRuntimeSystemNative_array.A() }); + + equal(_emberRuntimeUtils.isArray(numarray), true, '[1,2,3]'); + equal(_emberRuntimeUtils.isArray(number), false, '23'); + equal(_emberRuntimeUtils.isArray(strarray), true, '["Hello", "Hi"]'); + equal(_emberRuntimeUtils.isArray(string), false, '"Hello"'); + equal(_emberRuntimeUtils.isArray(object), false, '{}'); + equal(_emberRuntimeUtils.isArray(length), true, '{ length: 12 }'); + equal(_emberRuntimeUtils.isArray(global), false, 'global'); + equal(_emberRuntimeUtils.isArray(fn), false, 'function() {}'); + equal(_emberRuntimeUtils.isArray(arrayProxy), true, '[]'); + }); + + if (_emberEnvironment.environment.window && typeof _emberEnvironment.environment.window.FileList === 'function') { + QUnit.test('Ember.isArray(fileList)', function () { + var fileListElement = document.createElement('input'); + fileListElement.type = 'file'; + var fileList = fileListElement.files; + equal(_emberRuntimeUtils.isArray(fileList), false, 'fileList'); + }); + } +}); +enifed('ember-runtime/tests/core/is_array_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/core'); + test('ember-runtime/tests/core/is_array_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/core/is_array_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/core/is_array_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/core'); + QUnit.test('ember-runtime/tests/core/is_array_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/core/is_array_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/core/is_empty_test', ['exports', 'ember-metal', 'ember-runtime/system/array_proxy', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemNative_array) { + 'use strict'; + + QUnit.module('Ember.isEmpty'); + + QUnit.test('Ember.isEmpty', function () { + var arrayProxy = _emberRuntimeSystemArray_proxy.default.create({ content: _emberRuntimeSystemNative_array.A() }); + + equal(true, _emberMetal.isEmpty(arrayProxy), 'for an ArrayProxy that has empty content'); + }); +}); +enifed('ember-runtime/tests/core/is_empty_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/core'); + test('ember-runtime/tests/core/is_empty_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/core/is_empty_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/core/is_empty_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/core'); + QUnit.test('ember-runtime/tests/core/is_empty_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/core/is_empty_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/core/type_of_test', ['exports', 'ember-runtime/utils', 'ember-runtime/system/object', 'ember-environment'], function (exports, _emberRuntimeUtils, _emberRuntimeSystemObject, _emberEnvironment) { + 'use strict'; + + QUnit.module('Ember Type Checking'); + + QUnit.test('Ember.typeOf', function () { + var MockedDate = function () {}; + MockedDate.prototype = new Date(); + + var mockedDate = new MockedDate(); + var date = new Date(); + var error = new Error('boum'); + var object = { a: 'b' }; + var a = null; + var arr = [1, 2, 3]; + var obj = {}; + var instance = _emberRuntimeSystemObject.default.create({ method: function () {} }); + + equal(_emberRuntimeUtils.typeOf(), 'undefined', 'undefined'); + equal(_emberRuntimeUtils.typeOf(null), 'null', 'null'); + equal(_emberRuntimeUtils.typeOf('Cyril'), 'string', 'Cyril'); + equal(_emberRuntimeUtils.typeOf(101), 'number', '101'); + equal(_emberRuntimeUtils.typeOf(true), 'boolean', 'true'); + equal(_emberRuntimeUtils.typeOf([1, 2, 90]), 'array', '[1,2,90]'); + equal(_emberRuntimeUtils.typeOf(/abc/), 'regexp', '/abc/'); + equal(_emberRuntimeUtils.typeOf(date), 'date', 'new Date()'); + equal(_emberRuntimeUtils.typeOf(mockedDate), 'date', 'mocked date'); + equal(_emberRuntimeUtils.typeOf(error), 'error', 'error'); + equal(_emberRuntimeUtils.typeOf(object), 'object', 'object'); + equal(_emberRuntimeUtils.typeOf(undefined), 'undefined', 'item of type undefined'); + equal(_emberRuntimeUtils.typeOf(a), 'null', 'item of type null'); + equal(_emberRuntimeUtils.typeOf(arr), 'array', 'item of type array'); + equal(_emberRuntimeUtils.typeOf(obj), 'object', 'item of type object'); + equal(_emberRuntimeUtils.typeOf(instance), 'instance', 'item of type instance'); + equal(_emberRuntimeUtils.typeOf(instance.method), 'function', 'item of type function'); + equal(_emberRuntimeUtils.typeOf(_emberRuntimeSystemObject.default.extend()), 'class', 'item of type class'); + equal(_emberRuntimeUtils.typeOf(new Error()), 'error', 'item of type error'); + }); + + if (_emberEnvironment.environment.window && typeof _emberEnvironment.environment.window.FileList === 'function') { + QUnit.test('Ember.typeOf(fileList)', function () { + var fileListElement = document.createElement('input'); + fileListElement.type = 'file'; + var fileList = fileListElement.files; + equal(_emberRuntimeUtils.typeOf(fileList), 'filelist', 'item of type filelist'); + }); + } +}); +enifed('ember-runtime/tests/core/type_of_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/core'); + test('ember-runtime/tests/core/type_of_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/core/type_of_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/core/type_of_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/core'); + QUnit.test('ember-runtime/tests/core/type_of_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/core/type_of_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/ext/function_test', ['exports', 'ember-environment', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object', 'ember-runtime/mixins/evented'], function (exports, _emberEnvironment, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject, _emberRuntimeMixinsEvented) { + 'use strict'; + + QUnit.module('Function.prototype.observes() helper'); + + _internalTestHelpers.testBoth('global observer helper takes multiple params', function (get, set) { + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.Function) { + ok('undefined' === typeof Function.prototype.observes, 'Function.prototype helper disabled'); + return; + } + + var MyMixin = _emberMetal.Mixin.create({ + + count: 0, + + foo: (function () { + set(this, 'count', get(this, 'count') + 1); + }).observes('bar', 'baz') + + }); + + var obj = _emberMetal.mixin({}, MyMixin); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj, 'bar', 'BAZ'); + set(obj, 'baz', 'BAZ'); + equal(get(obj, 'count'), 2, 'should invoke observer after change'); + }); + + QUnit.module('Function.prototype.on() helper'); + + _internalTestHelpers.testBoth('sets up an event listener, and can trigger the function on multiple events', function (get, set) { + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.Function) { + ok('undefined' === typeof Function.prototype.on, 'Function.prototype helper disabled'); + return; + } + + var MyMixin = _emberMetal.Mixin.create({ + + count: 0, + + foo: (function () { + set(this, 'count', get(this, 'count') + 1); + }).on('bar', 'baz') + + }); + + var obj = _emberMetal.mixin({}, _emberRuntimeMixinsEvented.default, MyMixin); + equal(get(obj, 'count'), 0, 'should not invoke listener immediately'); + + obj.trigger('bar'); + obj.trigger('baz'); + equal(get(obj, 'count'), 2, 'should invoke listeners when events trigger'); + }); + + _internalTestHelpers.testBoth('can be chained with observes', function (get, set) { + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.Function) { + ok('Function.prototype helper disabled'); + return; + } + + var MyMixin = _emberMetal.Mixin.create({ + + count: 0, + bay: 'bay', + foo: (function () { + set(this, 'count', get(this, 'count') + 1); + }).observes('bay').on('bar') + }); + + var obj = _emberMetal.mixin({}, _emberRuntimeMixinsEvented.default, MyMixin); + equal(get(obj, 'count'), 0, 'should not invoke listener immediately'); + + set(obj, 'bay', 'BAY'); + obj.trigger('bar'); + equal(get(obj, 'count'), 2, 'should invoke observer and listener'); + }); + + QUnit.module('Function.prototype.property() helper'); + + _internalTestHelpers.testBoth('sets up a ComputedProperty', function (get, set) { + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.Function) { + ok('undefined' === typeof Function.prototype.property, 'Function.prototype helper disabled'); + return; + } + + var MyClass = _emberRuntimeSystemObject.default.extend({ + firstName: null, + lastName: null, + fullName: (function () { + return get(this, 'firstName') + ' ' + get(this, 'lastName'); + }).property('firstName', 'lastName') + }); + + var obj = MyClass.create({ firstName: 'Fred', lastName: 'Flinstone' }); + equal(get(obj, 'fullName'), 'Fred Flinstone', 'should return the computed value'); + + set(obj, 'firstName', 'Wilma'); + equal(get(obj, 'fullName'), 'Wilma Flinstone', 'should return the new computed value'); + + set(obj, 'lastName', ''); + equal(get(obj, 'fullName'), 'Wilma ', 'should return the new computed value'); + }); +}); +enifed('ember-runtime/tests/ext/function_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/ext'); + test('ember-runtime/tests/ext/function_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/ext/function_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/ext/function_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/ext'); + QUnit.test('ember-runtime/tests/ext/function_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/ext/function_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/ext/mixin_test', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; + + QUnit.module('system/mixin/binding_test'); + + QUnit.test('Defining a property ending in Binding should setup binding when applied', function () { + var MyMixin = _emberMetal.Mixin.create({ + fooBinding: 'bar.baz' + }); + + var obj = { bar: { baz: 'BIFF' } }; + + _emberMetal.run(function () { + var deprecationMessage = /`Ember.Binding` is deprecated/; + + expectDeprecation(function () { + MyMixin.apply(obj); + }, deprecationMessage); + }); + + ok(_emberMetal.get(obj, 'fooBinding') instanceof _emberMetal.Binding, 'should be a binding object'); + equal(_emberMetal.get(obj, 'foo'), 'BIFF', 'binding should be created and synced'); + }); + + QUnit.test('Defining a property ending in Binding should apply to prototype children', function () { + var MyMixin = _emberMetal.run(function () { + return _emberMetal.Mixin.create({ + fooBinding: 'bar.baz' + }); + }); + + var obj = { bar: { baz: 'BIFF' } }; + + _emberMetal.run(function () { + var deprecationMessage = /`Ember.Binding` is deprecated/; + + expectDeprecation(function () { + MyMixin.apply(obj); + }, deprecationMessage); + }); + + var obj2 = Object.create(obj); + _emberMetal.run(function () { + return _emberMetal.set(_emberMetal.get(obj2, 'bar'), 'baz', 'BARG'); + }); + + ok(_emberMetal.get(obj2, 'fooBinding') instanceof _emberMetal.Binding, 'should be a binding object'); + equal(_emberMetal.get(obj2, 'foo'), 'BARG', 'binding should be created and synced'); + }); +}); +enifed('ember-runtime/tests/ext/mixin_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/ext'); + test('ember-runtime/tests/ext/mixin_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/ext/mixin_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/ext/mixin_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/ext'); + QUnit.test('ember-runtime/tests/ext/mixin_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/ext/mixin_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/ext/rsvp_test', ['exports', 'ember-metal', 'ember-runtime/ext/rsvp'], function (exports, _emberMetal, _emberRuntimeExtRsvp) { + 'use strict'; + + var ORIGINAL_ONERROR = _emberMetal.getOnerror(); + + QUnit.module('Ember.RSVP', { + teardown: function () { + _emberMetal.setOnerror(ORIGINAL_ONERROR); + } + }); + + QUnit.test('Ensure that errors thrown from within a promise are sent to the console', function () { + var error = new Error('Error thrown in a promise for testing purposes.'); + + try { + _emberMetal.run(function () { + new _emberRuntimeExtRsvp.default.Promise(function (resolve, reject) { + throw error; + }); + }); + ok(false, 'expected assertion to be thrown'); + } catch (e) { + equal(e, error, 'error was re-thrown'); + } + }); + + QUnit.test('TransitionAborted errors are not re-thrown', function () { + expect(1); + var fakeTransitionAbort = { name: 'TransitionAborted' }; + + _emberMetal.run(_emberRuntimeExtRsvp.default, 'reject', fakeTransitionAbort); + + ok(true, 'did not throw an error when dealing with TransitionAborted'); + }); + + QUnit.test('Can reject with non-Error object', function (assert) { + var wasEmberTesting = _emberMetal.isTesting(); + _emberMetal.setTesting(false); + expect(1); + + try { + _emberMetal.run(_emberRuntimeExtRsvp.default, 'reject', 'foo'); + } catch (e) { + ok(false, 'should not throw'); + } finally { + _emberMetal.setTesting(wasEmberTesting); + } + + ok(true); + }); + + QUnit.test('Can reject with no arguments', function (assert) { + var wasEmberTesting = _emberMetal.isTesting(); + _emberMetal.setTesting(false); + expect(1); + + try { + _emberMetal.run(_emberRuntimeExtRsvp.default, 'reject'); + } catch (e) { + ok(false, 'should not throw'); + } finally { + _emberMetal.setTesting(wasEmberTesting); + } + + ok(true); + }); + + QUnit.test('rejections like jqXHR which have errorThrown property work', function () { + expect(2); + + var wasEmberTesting = _emberMetal.isTesting(); + var wasOnError = _emberMetal.getOnerror(); + + try { + (function () { + _emberMetal.setTesting(false); + _emberMetal.setOnerror(function (error) { + equal(error, actualError, 'expected the real error on the jqXHR'); + equal(error.__reason_with_error_thrown__, jqXHR, 'also retains a helpful reference to the rejection reason'); + }); + + var actualError = new Error('OMG what really happened'); + var jqXHR = { + errorThrown: actualError + }; + + _emberMetal.run(_emberRuntimeExtRsvp.default, 'reject', jqXHR); + })(); + } finally { + _emberMetal.setOnerror(wasOnError); + _emberMetal.setTesting(wasEmberTesting); + } + }); + + QUnit.test('rejections where the errorThrown is a string should wrap the sting in an error object', function () { + expect(2); + + var wasEmberTesting = _emberMetal.isTesting(); + var wasOnError = _emberMetal.getOnerror(); + + try { + (function () { + _emberMetal.setTesting(false); + _emberMetal.setOnerror(function (error) { + equal(error.message, actualError, 'expected the real error on the jqXHR'); + equal(error.__reason_with_error_thrown__, jqXHR, 'also retains a helpful reference to the rejection reason'); + }); + + var actualError = 'OMG what really happened'; + var jqXHR = { + errorThrown: actualError + }; + + _emberMetal.run(_emberRuntimeExtRsvp.default, 'reject', jqXHR); + })(); + } finally { + _emberMetal.setOnerror(wasOnError); + _emberMetal.setTesting(wasEmberTesting); + } + }); + + QUnit.test('rejections can be serialized to JSON', function (assert) { + expect(2); + + var wasEmberTesting = _emberMetal.isTesting(); + var wasOnError = _emberMetal.getOnerror(); + + try { + _emberMetal.setTesting(false); + _emberMetal.setOnerror(function (error) { + assert.equal(error.message, 'a fail'); + assert.ok(JSON.stringify(error), 'Error can be serialized'); + }); + + var jqXHR = { + errorThrown: new Error('a fail') + }; + + _emberMetal.run(_emberRuntimeExtRsvp.default, 'reject', jqXHR); + } finally { + _emberMetal.setOnerror(wasOnError); + _emberMetal.setTesting(wasEmberTesting); + } + }); + + var reason = 'i failed'; + QUnit.module('Ember.test: rejection assertions'); + + function ajax(something) { + return _emberRuntimeExtRsvp.default.Promise(function (resolve) { + QUnit.stop(); + setTimeout(function () { + QUnit.start(); + resolve(); + }, 0); // fake true / foreign async + }); + } + + QUnit.test('unambigiously unhandled rejection', function () { + QUnit.throws(function () { + _emberMetal.run(function () { + _emberRuntimeExtRsvp.default.Promise.reject(reason); + }); // something is funky, we should likely assert + }, reason); + }); + + QUnit.test('sync handled', function () { + _emberMetal.run(function () { + _emberRuntimeExtRsvp.default.Promise.reject(reason).catch(function () {}); + }); // handled, we shouldn't need to assert. + ok(true, 'reached end of test'); + }); + + QUnit.test('handled within the same micro-task (via Ember.RVP.Promise)', function () { + _emberMetal.run(function () { + var rejection = _emberRuntimeExtRsvp.default.Promise.reject(reason); + _emberRuntimeExtRsvp.default.Promise.resolve(1).then(function () { + return rejection.catch(function () {}); + }); + }); // handled, we shouldn't need to assert. + ok(true, 'reached end of test'); + }); + + QUnit.test('handled within the same micro-task (via direct run-loop)', function () { + _emberMetal.run(function () { + var rejection = _emberRuntimeExtRsvp.default.Promise.reject(reason); + _emberMetal.run.schedule('afterRender', function () { + return rejection.catch(function () {}); + }); + }); // handled, we shouldn't need to assert. + ok(true, 'reached end of test'); + }); + + QUnit.test('handled in the next microTask queue flush (run.next)', function () { + expect(2); + + QUnit.throws(function () { + _emberMetal.run(function () { + var rejection = _emberRuntimeExtRsvp.default.Promise.reject(reason); + + QUnit.stop(); + _emberMetal.run.next(function () { + QUnit.start(); + rejection.catch(function () {}); + ok(true, 'reached end of test'); + }); + }); + }, reason); + + // a promise rejection survived a full flush of the run-loop without being handled + // this is very likely an issue. + }); + + QUnit.test('handled in the same microTask Queue flush do to data locality', function () { + // an ambiguous scenario, this may or may not assert + // it depends on the locality of `user#1` + var store = { + find: function () { + return _emberRuntimeExtRsvp.default.Promise.resolve(1); + } + }; + _emberMetal.run(function () { + var rejection = _emberRuntimeExtRsvp.default.Promise.reject(reason); + store.find('user', 1).then(function () { + return rejection.catch(function () {}); + }); + }); + + ok(true, 'reached end of test'); + }); + + QUnit.test('handled in a different microTask Queue flush do to data locality', function () { + // an ambiguous scenario, this may or may not assert + // it depends on the locality of `user#1` + var store = { + find: function () { + return ajax(); + } + }; + QUnit.throws(function () { + _emberMetal.run(function () { + var rejection = _emberRuntimeExtRsvp.default.Promise.reject(reason); + store.find('user', 1).then(function () { + rejection.catch(function () {}); + ok(true, 'reached end of test'); + }); + }); + }, reason); + }); + + QUnit.test('handled in the next microTask queue flush (ajax example)', function () { + QUnit.throws(function () { + _emberMetal.run(function () { + var rejection = _emberRuntimeExtRsvp.default.Promise.reject(reason); + ajax('/something/').then(function () { + rejection.catch(function () {}); + ok(true, 'reached end of test'); + }); + }); + }, reason); + }); +}); +enifed('ember-runtime/tests/ext/rsvp_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/ext'); + test('ember-runtime/tests/ext/rsvp_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/ext/rsvp_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/ext/rsvp_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/ext'); + QUnit.test('ember-runtime/tests/ext/rsvp_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/ext/rsvp_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/inject_test', ['exports', 'ember-metal', 'ember-runtime/inject', 'ember-runtime/system/object', 'internal-test-helpers'], function (exports, _emberMetal, _emberRuntimeInject, _emberRuntimeSystemObject, _internalTestHelpers) { + /* global EmberDev */ + + 'use strict'; + + QUnit.module('inject'); + + QUnit.test('calling `inject` directly should error', function () { + expectAssertion(function () { + _emberRuntimeInject.default('foo'); + }, /Injected properties must be created through helpers/); + }); + + if (!EmberDev.runningProdBuild) { + // this check is done via an assertion which is stripped from + // production builds + QUnit.test('injection type validation is run when first looked up', function () { + expect(1); + + _emberRuntimeInject.createInjectionHelper('foo', function () { + ok(true, 'should call validation method'); + }); + + var owner = _internalTestHelpers.buildOwner(); + + var AnObject = _emberRuntimeSystemObject.default.extend({ + bar: _emberRuntimeInject.default.foo(), + baz: _emberRuntimeInject.default.foo() + }); + + owner.register('foo:main', AnObject); + owner._lookupFactory('foo:main'); + }); + + QUnit.test('attempting to inject a nonexistent container key should error', function () { + var owner = _internalTestHelpers.buildOwner(); + var AnObject = _emberRuntimeSystemObject.default.extend({ + foo: new _emberMetal.InjectedProperty('bar', 'baz') + }); + + owner.register('foo:main', AnObject); + + throws(function () { + owner.lookup('foo:main'); + }, /Attempting to inject an unknown injection: 'bar:baz'/); + }); + } + + QUnit.test('factories should return a list of lazy injection full names', function () { + var AnObject = _emberRuntimeSystemObject.default.extend({ + foo: new _emberMetal.InjectedProperty('foo', 'bar'), + bar: new _emberMetal.InjectedProperty('quux') + }); + + deepEqual(AnObject._lazyInjections(), { 'foo': 'foo:bar', 'bar': 'quux:bar' }, 'should return injected container keys'); + }); +}); +enifed('ember-runtime/tests/inject_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests'); + test('ember-runtime/tests/inject_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/inject_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/inject_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests'); + QUnit.test('ember-runtime/tests/inject_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/inject_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/mixins/observable/chained_test', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeSystemNative_array) { + 'use strict'; + + /* + NOTE: This test is adapted from the 1.x series of unit tests. The tests + are the same except for places where we intend to break the API we instead + validate that we warn the developer appropriately. + + CHANGES FROM 1.6: + + * changed obj.set() and obj.get() to Ember.set() and Ember.get() + * changed obj.addObserver() to addObserver() + */ + + QUnit.module('Ember.Observable - Observing with @each'); + + QUnit.test('chained observers on enumerable properties are triggered when the observed property of any item changes', function () { + var family = _emberRuntimeSystemObject.default.create({ momma: null }); + var momma = _emberRuntimeSystemObject.default.create({ children: [] }); + + var child1 = _emberRuntimeSystemObject.default.create({ name: 'Bartholomew' }); + var child2 = _emberRuntimeSystemObject.default.create({ name: 'Agnes' }); + var child3 = _emberRuntimeSystemObject.default.create({ name: 'Dan' }); + var child4 = _emberRuntimeSystemObject.default.create({ name: 'Nancy' }); + + _emberMetal.set(family, 'momma', momma); + _emberMetal.set(momma, 'children', _emberRuntimeSystemNative_array.A([child1, child2, child3])); + + var observerFiredCount = 0; + _emberMetal.addObserver(family, 'momma.children.@each.name', this, function () { + observerFiredCount++; + }); + + observerFiredCount = 0; + _emberMetal.run(function () { + return _emberMetal.get(momma, 'children').setEach('name', 'Juan'); + }); + equal(observerFiredCount, 3, 'observer fired after changing child names'); + + observerFiredCount = 0; + _emberMetal.run(function () { + return _emberMetal.get(momma, 'children').pushObject(child4); + }); + equal(observerFiredCount, 1, 'observer fired after adding a new item'); + + observerFiredCount = 0; + _emberMetal.run(function () { + return _emberMetal.set(child4, 'name', 'Herbert'); + }); + equal(observerFiredCount, 1, 'observer fired after changing property on new object'); + + _emberMetal.set(momma, 'children', []); + + observerFiredCount = 0; + _emberMetal.run(function () { + return _emberMetal.set(child1, 'name', 'Hanna'); + }); + equal(observerFiredCount, 0, 'observer did not fire after removing changing property on a removed object'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/mixins/observable/chained_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/legacy_1x/mixins/observable'); + test('ember-runtime/tests/legacy_1x/mixins/observable/chained_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/chained_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/mixins/observable/chained_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/legacy_1x/mixins/observable'); + QUnit.test('ember-runtime/tests/legacy_1x/mixins/observable/chained_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/chained_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/mixins/observable/observable_test', ['exports', 'ember-environment', 'ember-metal', 'ember-runtime/system/string', 'ember-runtime/system/object', 'ember-runtime/mixins/observable', 'ember-runtime/system/native_array'], function (exports, _emberEnvironment, _emberMetal, _emberRuntimeSystemString, _emberRuntimeSystemObject, _emberRuntimeMixinsObservable, _emberRuntimeSystemNative_array) { + 'use strict'; + + /* + NOTE: This test is adapted from the 1.x series of unit tests. The tests + are the same except for places where we intend to break the API we instead + validate that we warn the developer appropriately. + + CHANGES FROM 1.6: + + * Added ObservableObject which applies the Ember.Observable mixin. + * Changed reference to Ember.T_FUNCTION to 'function' + * Changed all references to sc_super to this._super(...arguments) + * Changed Ember.objectForPropertyPath() to Ember.getPath() + * Removed allPropertiesDidChange test - no longer supported + * Changed test that uses 'ObjectE' as path to 'objectE' to reflect new + rule on using capital letters for property paths. + * Removed test passing context to addObserver. context param is no longer + supported. + * Changed calls to Ember.Binding.flushPendingChanges() -> run.sync() + * removed test in observer around line 862 that expected key/value to be + the last item in the chained path. Should be root and chained path + + */ + + // ======================================================================== + // Ember.Observable Tests + // ======================================================================== + + var object, ObjectC, ObjectD, objectA, objectB, lookup; + + var ObservableObject = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsObservable.default); + var originalLookup = _emberEnvironment.context.lookup; + + // .......................................................... + // GET() + // + + QUnit.module('object.get()', { + + setup: function () { + object = ObservableObject.extend(_emberRuntimeMixinsObservable.default, { + computed: _emberMetal.computed(function () { + return 'value'; + }).volatile(), + method: function () { + return 'value'; + }, + unknownProperty: function (key, value) { + this.lastUnknownProperty = key; + return 'unknown'; + } + }).create({ + normal: 'value', + numberVal: 24, + toggleVal: true, + nullProperty: null + }); + } + + }); + + QUnit.test('should get normal properties', function () { + equal(object.get('normal'), 'value'); + }); + + QUnit.test('should call computed properties and return their result', function () { + equal(object.get('computed'), 'value'); + }); + + QUnit.test('should return the function for a non-computed property', function () { + var value = object.get('method'); + equal(typeof value, 'function'); + }); + + QUnit.test('should return null when property value is null', function () { + equal(object.get('nullProperty'), null); + }); + + QUnit.test('should call unknownProperty when value is undefined', function () { + equal(object.get('unknown'), 'unknown'); + equal(object.lastUnknownProperty, 'unknown'); + }); + + // .......................................................... + // Ember.GET() + // + QUnit.module('Ember.get()', { + setup: function () { + objectA = ObservableObject.extend({ + computed: _emberMetal.computed(function () { + return 'value'; + }).volatile(), + method: function () { + return 'value'; + }, + unknownProperty: function (key, value) { + this.lastUnknownProperty = key; + return 'unknown'; + } + }).create({ + normal: 'value', + numberVal: 24, + toggleVal: true, + nullProperty: null + }); + + objectB = { + normal: 'value', + nullProperty: null + }; + } + }); + + QUnit.test('should get normal properties on Ember.Observable', function () { + equal(_emberMetal.get(objectA, 'normal'), 'value'); + }); + + QUnit.test('should call computed properties on Ember.Observable and return their result', function () { + equal(_emberMetal.get(objectA, 'computed'), 'value'); + }); + + QUnit.test('should return the function for a non-computed property on Ember.Observable', function () { + var value = _emberMetal.get(objectA, 'method'); + equal(typeof value, 'function'); + }); + + QUnit.test('should return null when property value is null on Ember.Observable', function () { + equal(_emberMetal.get(objectA, 'nullProperty'), null); + }); + + QUnit.test('should call unknownProperty when value is undefined on Ember.Observable', function () { + equal(_emberMetal.get(objectA, 'unknown'), 'unknown'); + equal(objectA.lastUnknownProperty, 'unknown'); + }); + + QUnit.test('should get normal properties on standard objects', function () { + equal(_emberMetal.get(objectB, 'normal'), 'value'); + }); + + QUnit.test('should return null when property is null on standard objects', function () { + equal(_emberMetal.get(objectB, 'nullProperty'), null); + }); + + /* + QUnit.test("raise if the provided object is null", function() { + throws(function() { + get(null, 'key'); + }); + }); + */ + + QUnit.test('raise if the provided object is undefined', function () { + expectAssertion(function () { + _emberMetal.get(undefined, 'key'); + }, /Cannot call get with 'key' on an undefined object/i); + }); + + QUnit.module('Ember.get() with paths'); + + QUnit.test('should return a property at a given path relative to the passed object', function () { + var foo = ObservableObject.create({ + bar: ObservableObject.extend({ + baz: _emberMetal.computed(function () { + return 'blargh'; + }).volatile() + }).create() + }); + + equal(_emberMetal.get(foo, 'bar.baz'), 'blargh'); + }); + + QUnit.test('should return a property at a given path relative to the passed object - JavaScript hash', function () { + var foo = { + bar: { + baz: 'blargh' + } + }; + + equal(_emberMetal.get(foo, 'bar.baz'), 'blargh'); + }); + + // .......................................................... + // SET() + // + + QUnit.module('object.set()', { + + setup: function () { + object = ObservableObject.extend({ + computed: _emberMetal.computed({ + get: function (key) { + return this._computed; + }, + set: function (key, value) { + this._computed = value; + return this._computed; + } + }).volatile(), + + method: function (key, value) { + if (value !== undefined) { + this._method = value; + } + return this._method; + }, + + unknownProperty: function (key) { + return this._unknown; + }, + + setUnknownProperty: function (key, value) { + this._unknown = value; + return this._unknown; + }, + + // normal property + normal: 'value', + + // computed property + _computed: 'computed', + // method, but not a property + _method: 'method', + // null property + nullProperty: null, + + // unknown property + _unknown: 'unknown' + }).create(); + } + + }); + + QUnit.test('should change normal properties and return the value', function () { + var ret = object.set('normal', 'changed'); + equal(object.get('normal'), 'changed'); + equal(ret, 'changed'); + }); + + QUnit.test('should call computed properties passing value and return the value', function () { + var ret = object.set('computed', 'changed'); + equal(object.get('_computed'), 'changed'); + equal(ret, 'changed'); + }); + + QUnit.test('should change normal properties when passing undefined', function () { + var ret = object.set('normal', undefined); + equal(object.get('normal'), undefined); + equal(ret, undefined); + }); + + QUnit.test('should replace the function for a non-computed property and return the value', function () { + var ret = object.set('method', 'changed'); + equal(object.get('_method'), 'method'); // make sure this was NOT run + ok(typeof object.get('method') !== 'function'); + equal(ret, 'changed'); + }); + + QUnit.test('should replace prover when property value is null', function () { + var ret = object.set('nullProperty', 'changed'); + equal(object.get('nullProperty'), 'changed'); + equal(ret, 'changed'); + }); + + QUnit.test('should call unknownProperty with value when property is undefined', function () { + var ret = object.set('unknown', 'changed'); + equal(object.get('_unknown'), 'changed'); + equal(ret, 'changed'); + }); + + // .......................................................... + // COMPUTED PROPERTIES + // + + QUnit.module('Computed properties', { + setup: function () { + lookup = _emberEnvironment.context.lookup = {}; + + object = ObservableObject.extend({ + computed: _emberMetal.computed({ + get: function () { + this.computedCalls.push('getter-called'); + return 'computed'; + }, + set: function (key, value) { + this.computedCalls.push(value); + } + }).volatile(), + + computedCached: _emberMetal.computed({ + get: function () { + this.computedCachedCalls.push('getter-called'); + return 'computedCached'; + }, + set: function (key, value) { + this.computedCachedCalls.push(value); + } + }), + + dependent: _emberMetal.computed({ + get: function () { + this.dependentCalls.push('getter-called'); + return 'dependent'; + }, + set: function (key, value) { + this.dependentCalls.push(value); + } + }).property('changer').volatile(), + dependentFront: _emberMetal.computed('changer', { + get: function () { + this.dependentFrontCalls.push('getter-called'); + return 'dependentFront'; + }, + set: function (key, value) { + this.dependentFrontCalls.push(value); + } + }).volatile(), + dependentCached: _emberMetal.computed({ + get: function () { + this.dependentCachedCalls.push('getter-called!'); + return 'dependentCached'; + }, + set: function (key, value) { + this.dependentCachedCalls.push(value); + } + }).property('changer'), + + inc: _emberMetal.computed('changer', function () { + return this.incCallCount++; + }), + + nestedInc: _emberMetal.computed(function (key) { + _emberMetal.get(this, 'inc'); + return this.nestedIncCallCount++; + }).property('inc'), + + isOn: _emberMetal.computed({ + get: function () { + return this.get('state') === 'on'; + }, + set: function (key, value) { + this.set('state', 'on'); + return this.get('state') === 'on'; + } + }).property('state').volatile(), + + isOff: _emberMetal.computed({ + get: function () { + return this.get('state') === 'off'; + }, + set: function (key, value) { + this.set('state', 'off'); + return this.get('state') === 'off'; + } + }).property('state').volatile() + + }).create({ + computedCalls: [], + computedCachedCalls: [], + changer: 'foo', + dependentCalls: [], + dependentFrontCalls: [], + dependentCachedCalls: [], + incCallCount: 0, + nestedIncCallCount: 0, + state: 'on' + }); + }, + teardown: function () { + _emberEnvironment.context.lookup = originalLookup; + } + }); + + QUnit.test('getting values should call function return value', function () { + // get each property twice. Verify return. + var keys = _emberRuntimeSystemString.w('computed computedCached dependent dependentFront dependentCached'); + + keys.forEach(function (key) { + equal(object.get(key), key, 'Try #1: object.get(' + key + ') should run function'); + equal(object.get(key), key, 'Try #2: object.get(' + key + ') should run function'); + }); + + // verify each call count. cached should only be called once + _emberRuntimeSystemString.w('computedCalls dependentFrontCalls dependentCalls').forEach(function (key) { + equal(object[key].length, 2, 'non-cached property ' + key + ' should be called 2x'); + }); + + _emberRuntimeSystemString.w('computedCachedCalls dependentCachedCalls').forEach(function (key) { + equal(object[key].length, 1, 'non-cached property ' + key + ' should be called 1x'); + }); + }); + + QUnit.test('setting values should call function return value', function () { + // get each property twice. Verify return. + var keys = _emberRuntimeSystemString.w('computed dependent dependentFront computedCached dependentCached'); + var values = _emberRuntimeSystemString.w('value1 value2'); + + keys.forEach(function (key) { + equal(object.set(key, values[0]), values[0], 'Try #1: object.set(' + key + ', ' + values[0] + ') should run function'); + + equal(object.set(key, values[1]), values[1], 'Try #2: object.set(' + key + ', ' + values[1] + ') should run function'); + + equal(object.set(key, values[1]), values[1], 'Try #3: object.set(' + key + ', ' + values[1] + ') should not run function since it is setting same value as before'); + }); + + // verify each call count. cached should only be called once + keys.forEach(function (key) { + var calls = object[key + 'Calls']; + var idx, expectedLength; + + // Cached properties first check their cached value before setting the + // property. Other properties blindly call set. + expectedLength = 3; + equal(calls.length, expectedLength, 'set(' + key + ') should be called the right amount of times'); + for (idx = 0; idx < 2; idx++) { + equal(calls[idx], values[idx], 'call #' + (idx + 1) + ' to set(' + key + ') should have passed value ' + values[idx]); + } + }); + }); + + QUnit.test('notify change should clear cache', function () { + // call get several times to collect call count + object.get('computedCached'); // should run func + object.get('computedCached'); // should not run func + + object.propertyWillChange('computedCached').propertyDidChange('computedCached'); + + object.get('computedCached'); // should run again + equal(object.computedCachedCalls.length, 2, 'should have invoked method 2x'); + }); + + QUnit.test('change dependent should clear cache', function () { + // call get several times to collect call count + var ret1 = object.get('inc'); // should run func + equal(object.get('inc'), ret1, 'multiple calls should not run cached prop'); + + object.set('changer', 'bar'); + + equal(object.get('inc'), ret1 + 1, 'should increment after dependent key changes'); // should run again + }); + + QUnit.test('just notifying change of dependent should clear cache', function () { + // call get several times to collect call count + var ret1 = object.get('inc'); // should run func + equal(object.get('inc'), ret1, 'multiple calls should not run cached prop'); + + object.notifyPropertyChange('changer'); + + equal(object.get('inc'), ret1 + 1, 'should increment after dependent key changes'); // should run again + }); + + QUnit.test('changing dependent should clear nested cache', function () { + // call get several times to collect call count + var ret1 = object.get('nestedInc'); // should run func + equal(object.get('nestedInc'), ret1, 'multiple calls should not run cached prop'); + + object.set('changer', 'bar'); + + equal(object.get('nestedInc'), ret1 + 1, 'should increment after dependent key changes'); // should run again + }); + + QUnit.test('just notifying change of dependent should clear nested cache', function () { + // call get several times to collect call count + var ret1 = object.get('nestedInc'); // should run func + equal(object.get('nestedInc'), ret1, 'multiple calls should not run cached prop'); + + object.notifyPropertyChange('changer'); + + equal(object.get('nestedInc'), ret1 + 1, 'should increment after dependent key changes'); // should run again + }); + + // This verifies a specific bug encountered where observers for computed + // properties would fire before their prop caches were cleared. + QUnit.test('change dependent should clear cache when observers of dependent are called', function () { + // call get several times to collect call count + var ret1 = object.get('inc'); // should run func + equal(object.get('inc'), ret1, 'multiple calls should not run cached prop'); + + // add observer to verify change... + object.addObserver('inc', this, function () { + equal(object.get('inc'), ret1 + 1, 'should increment after dependent key changes'); // should run again + }); + + // now run + object.set('changer', 'bar'); + }); + + QUnit.test('setting one of two computed properties that depend on a third property should clear the kvo cache', function () { + // we have to call set twice to fill up the cache + object.set('isOff', true); + object.set('isOn', true); + + // setting isOff to true should clear the kvo cache + object.set('isOff', true); + equal(object.get('isOff'), true, 'object.isOff should be true'); + equal(object.get('isOn'), false, 'object.isOn should be false'); + }); + + QUnit.test('dependent keys should be able to be specified as property paths', function () { + var depObj = ObservableObject.extend({ + menuPrice: _emberMetal.computed(function () { + return this.get('menu.price'); + }).property('menu.price') + }).create({ + menu: ObservableObject.create({ + price: 5 + }) + }); + + equal(depObj.get('menuPrice'), 5, 'precond - initial value returns 5'); + + depObj.set('menu.price', 6); + + equal(depObj.get('menuPrice'), 6, 'cache is properly invalidated after nested property changes'); + }); + + QUnit.test('nested dependent keys should propagate after they update', function () { + var bindObj; + _emberMetal.run(function () { + lookup.DepObj = ObservableObject.extend({ + price: _emberMetal.computed(function () { + return this.get('restaurant.menu.price'); + }).property('restaurant.menu.price') + }).create({ + restaurant: ObservableObject.create({ + menu: ObservableObject.create({ + price: 5 + }) + }) + }); + + expectDeprecation(function () { + bindObj = ObservableObject.extend({ + priceBinding: 'DepObj.price' + }).create(); + }, /`Ember.Binding` is deprecated/); + }); + + equal(bindObj.get('price'), 5, 'precond - binding propagates'); + + _emberMetal.run(function () { + lookup.DepObj.set('restaurant.menu.price', 10); + }); + + equal(bindObj.get('price'), 10, 'binding propagates after a nested dependent keys updates'); + + _emberMetal.run(function () { + lookup.DepObj.set('restaurant.menu', ObservableObject.create({ + price: 15 + })); + }); + + equal(bindObj.get('price'), 15, 'binding propagates after a middle dependent keys updates'); + }); + + QUnit.test('cacheable nested dependent keys should clear after their dependencies update', function () { + ok(true); + + var DepObj; + + _emberMetal.run(function () { + lookup.DepObj = DepObj = ObservableObject.extend({ + price: _emberMetal.computed('restaurant.menu.price', function () { + return this.get('restaurant.menu.price'); + }) + }).create({ + restaurant: ObservableObject.create({ + menu: ObservableObject.create({ + price: 5 + }) + }) + }); + }); + + equal(DepObj.get('price'), 5, 'precond - computed property is correct'); + + _emberMetal.run(function () { + DepObj.set('restaurant.menu.price', 10); + }); + equal(DepObj.get('price'), 10, 'cacheable computed properties are invalidated even if no run loop occurred'); + + _emberMetal.run(function () { + DepObj.set('restaurant.menu.price', 20); + }); + equal(DepObj.get('price'), 20, 'cacheable computed properties are invalidated after a second get before a run loop'); + equal(DepObj.get('price'), 20, 'precond - computed properties remain correct after a run loop'); + + _emberMetal.run(function () { + DepObj.set('restaurant.menu', ObservableObject.create({ + price: 15 + })); + }); + + equal(DepObj.get('price'), 15, 'cacheable computed properties are invalidated after a middle property changes'); + + _emberMetal.run(function () { + DepObj.set('restaurant.menu', ObservableObject.create({ + price: 25 + })); + }); + + equal(DepObj.get('price'), 25, 'cacheable computed properties are invalidated after a middle property changes again, before a run loop'); + }); + + // .......................................................... + // OBSERVABLE OBJECTS + // + + QUnit.module('Observable objects & object properties ', { + setup: function () { + object = ObservableObject.extend({ + getEach: function () { + var keys = ['normal', 'abnormal']; + var ret = []; + for (var idx = 0; idx < keys.length; idx++) { + ret[ret.length] = this.get(keys[idx]); + } + return ret; + }, + + newObserver: function () { + this.abnormal = 'changedValueObserved'; + }, + + testObserver: _emberMetal.observer('normal', function () { + this.abnormal = 'removedObserver'; + }), + + testArrayObserver: _emberMetal.observer('normalArray.[]', function () { + this.abnormal = 'notifiedObserver'; + }) + }).create({ + normal: 'value', + abnormal: 'zeroValue', + numberVal: 24, + toggleVal: true, + observedProperty: 'beingWatched', + testRemove: 'observerToBeRemoved', + normalArray: _emberRuntimeSystemNative_array.A([1, 2, 3, 4, 5]) + }); + } + }); + + QUnit.test('incrementProperty and decrementProperty', function () { + var newValue = object.incrementProperty('numberVal'); + + equal(25, newValue, 'numerical value incremented'); + object.numberVal = 24; + newValue = object.decrementProperty('numberVal'); + equal(23, newValue, 'numerical value decremented'); + object.numberVal = 25; + newValue = object.incrementProperty('numberVal', 5); + equal(30, newValue, 'numerical value incremented by specified increment'); + object.numberVal = 25; + newValue = object.incrementProperty('numberVal', -5); + equal(20, newValue, 'minus numerical value incremented by specified increment'); + object.numberVal = 25; + newValue = object.incrementProperty('numberVal', 0); + equal(25, newValue, 'zero numerical value incremented by specified increment'); + + expectAssertion(function () { + newValue = object.incrementProperty('numberVal', 0 - void 0); // Increment by NaN + }, /Must pass a numeric value to incrementProperty/i); + + expectAssertion(function () { + newValue = object.incrementProperty('numberVal', 'Ember'); // Increment by non-numeric String + }, /Must pass a numeric value to incrementProperty/i); + + expectAssertion(function () { + newValue = object.incrementProperty('numberVal', 1 / 0); // Increment by Infinity + }, /Must pass a numeric value to incrementProperty/i); + + equal(25, newValue, 'Attempting to increment by non-numeric values should not increment value'); + + object.numberVal = 25; + newValue = object.decrementProperty('numberVal', 5); + equal(20, newValue, 'numerical value decremented by specified increment'); + object.numberVal = 25; + newValue = object.decrementProperty('numberVal', -5); + equal(30, newValue, 'minus numerical value decremented by specified increment'); + object.numberVal = 25; + newValue = object.decrementProperty('numberVal', 0); + equal(25, newValue, 'zero numerical value decremented by specified increment'); + + expectAssertion(function () { + newValue = object.decrementProperty('numberVal', 0 - void 0); // Decrement by NaN + }, /Must pass a numeric value to decrementProperty/i); + + expectAssertion(function () { + newValue = object.decrementProperty('numberVal', 'Ember'); // Decrement by non-numeric String + }, /Must pass a numeric value to decrementProperty/i); + + expectAssertion(function () { + newValue = object.decrementProperty('numberVal', 1 / 0); // Decrement by Infinity + }, /Must pass a numeric value to decrementProperty/i); + + equal(25, newValue, 'Attempting to decrement by non-numeric values should not decrement value'); + }); + + QUnit.test('toggle function, should be boolean', function () { + equal(object.toggleProperty('toggleVal', true, false), object.get('toggleVal')); + equal(object.toggleProperty('toggleVal', true, false), object.get('toggleVal')); + equal(object.toggleProperty('toggleVal', undefined, undefined), object.get('toggleVal')); + }); + + QUnit.test('should notify array observer when array changes', function () { + _emberMetal.get(object, 'normalArray').replace(0, 0, 6); + equal(object.abnormal, 'notifiedObserver', 'observer should be notified'); + }); + + QUnit.module('object.addObserver()', { + setup: function () { + ObjectC = ObservableObject.create({ + objectE: ObservableObject.create({ + propertyVal: 'chainedProperty' + }), + + normal: 'value', + normal1: 'zeroValue', + normal2: 'dependentValue', + incrementor: 10, + + action: function () { + this.normal1 = 'newZeroValue'; + }, + + observeOnceAction: function () { + this.incrementor = this.incrementor + 1; + }, + + chainedObserver: function () { + this.normal2 = 'chainedPropertyObserved'; + } + }); + } + }); + + QUnit.test('should register an observer for a property', function () { + ObjectC.addObserver('normal', ObjectC, 'action'); + ObjectC.set('normal', 'newValue'); + equal(ObjectC.normal1, 'newZeroValue'); + }); + + QUnit.test('should register an observer for a property - Special case of chained property', function () { + ObjectC.addObserver('objectE.propertyVal', ObjectC, 'chainedObserver'); + ObjectC.objectE.set('propertyVal', 'chainedPropertyValue'); + equal('chainedPropertyObserved', ObjectC.normal2); + ObjectC.normal2 = 'dependentValue'; + ObjectC.set('objectE', ''); + equal('chainedPropertyObserved', ObjectC.normal2); + }); + + QUnit.module('object.removeObserver()', { + setup: function () { + ObjectD = ObservableObject.create({ + objectF: ObservableObject.create({ + propertyVal: 'chainedProperty' + }), + + normal: 'value', + normal1: 'zeroValue', + normal2: 'dependentValue', + ArrayKeys: ['normal', 'normal1'], + + addAction: function () { + this.normal1 = 'newZeroValue'; + }, + removeAction: function () { + this.normal2 = 'newDependentValue'; + }, + removeChainedObserver: function () { + this.normal2 = 'chainedPropertyObserved'; + }, + + observableValue: 'hello world', + + observer1: function () { + // Just an observer + }, + observer2: function () { + this.removeObserver('observableValue', null, 'observer1'); + this.removeObserver('observableValue', null, 'observer2'); + this.hasObserverFor('observableValue'); // Tickle 'getMembers()' + this.removeObserver('observableValue', null, 'observer3'); + }, + observer3: function () { + // Just an observer + } + }); + } + }); + + QUnit.test('should unregister an observer for a property', function () { + ObjectD.addObserver('normal', ObjectD, 'addAction'); + ObjectD.set('normal', 'newValue'); + equal(ObjectD.normal1, 'newZeroValue'); + + ObjectD.set('normal1', 'zeroValue'); + + ObjectD.removeObserver('normal', ObjectD, 'addAction'); + ObjectD.set('normal', 'newValue'); + equal(ObjectD.normal1, 'zeroValue'); + }); + + QUnit.test('should unregister an observer for a property - special case when key has a \'.\' in it.', function () { + ObjectD.addObserver('objectF.propertyVal', ObjectD, 'removeChainedObserver'); + ObjectD.objectF.set('propertyVal', 'chainedPropertyValue'); + ObjectD.removeObserver('objectF.propertyVal', ObjectD, 'removeChainedObserver'); + ObjectD.normal2 = 'dependentValue'; + ObjectD.objectF.set('propertyVal', 'removedPropertyValue'); + equal('dependentValue', ObjectD.normal2); + ObjectD.set('objectF', ''); + equal('dependentValue', ObjectD.normal2); + }); + + QUnit.test('removing an observer inside of an observer shouldn’t cause any problems', function () { + // The observable system should be protected against clients removing + // observers in the middle of observer notification. + var encounteredError = false; + try { + ObjectD.addObserver('observableValue', null, 'observer1'); + ObjectD.addObserver('observableValue', null, 'observer2'); + ObjectD.addObserver('observableValue', null, 'observer3'); + _emberMetal.run(function () { + ObjectD.set('observableValue', 'hi world'); + }); + } catch (e) { + encounteredError = true; + } + equal(encounteredError, false); + }); + + QUnit.module('Bind function', { + setup: function () { + objectA = ObservableObject.create({ + name: 'Sproutcore', + location: 'Timbaktu' + }); + + objectB = ObservableObject.create({ + normal: 'value', + computed: function () { + this.normal = 'newValue'; + } + }); + + lookup = _emberEnvironment.context.lookup = { + 'Namespace': { + objectA: objectA, + objectB: objectB + } + }; + }, + + teardown: function () { + _emberEnvironment.context.lookup = originalLookup; + } + }); + + QUnit.test('should bind property with method parameter as undefined', function () { + // creating binding + _emberMetal.run(function () { + expectDeprecation(function () { + objectA.bind('name', 'Namespace.objectB.normal', undefined); + }, /`Ember.Binding` is deprecated/); + }); + + // now make a change to see if the binding triggers. + _emberMetal.run(function () { + objectB.set('normal', 'changedValue'); + }); + + // support new-style bindings if available + equal('changedValue', objectA.get('name'), 'objectA.name is bound'); + }); + + // .......................................................... + // SPECIAL CASES + // + + QUnit.test('changing chained observer object to null should not raise exception', function () { + var obj = ObservableObject.create({ + foo: ObservableObject.create({ + bar: ObservableObject.create({ bat: 'BAT' }) + }) + }); + + var callCount = 0; + obj.foo.addObserver('bar.bat', obj, function (target, key, value) { + callCount++; + }); + + _emberMetal.run(function () { + obj.foo.set('bar', null); + }); + + equal(callCount, 1, 'changing bar should trigger observer'); + expect(1); + }); +}); +enifed('ember-runtime/tests/legacy_1x/mixins/observable/observable_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/legacy_1x/mixins/observable'); + test('ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/mixins/observable/observable_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/legacy_1x/mixins/observable'); + QUnit.test('ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/mixins/observable'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeMixinsObservable) { + /* + NOTE: This test is adapted from the 1.x series of unit tests. The tests + are the same except for places where we intend to break the API we instead + validate that we warn the developer appropriately. + + CHANGES FROM 1.6: + + * Create ObservableObject which includes Ember.Observable + */ + + // ======================================================================== + // Ember.Observable Tests + // ======================================================================== + + 'use strict'; + + var ObservableObject = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsObservable.default); + + // .......................................................... + // GET() + // + + QUnit.module('object.observesForKey()'); + + QUnit.test('should get observers', function () { + var o1 = ObservableObject.create({ foo: 100 }); + var o2 = ObservableObject.create({ func: function () {} }); + var o3 = ObservableObject.create({ func: function () {} }); + var observers = null; + + equal(_emberMetal.get(o1.observersForKey('foo'), 'length'), 0, 'o1.observersForKey should return empty array'); + + o1.addObserver('foo', o2, o2.func); + o1.addObserver('foo', o3, o3.func); + + observers = o1.observersForKey('foo'); + + equal(_emberMetal.get(observers, 'length'), 2, 'o2.observersForKey should return an array with length 2'); + equal(observers[0][0], o2, 'first item in observers array should be o2'); + equal(observers[1][0], o3, 'second item in observers array should be o3'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/legacy_1x/mixins/observable'); + test('ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/legacy_1x/mixins/observable'); + QUnit.test('ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test', ['exports', 'ember-runtime/system/object', 'ember-runtime/mixins/observable', 'ember-metal'], function (exports, _emberRuntimeSystemObject, _emberRuntimeMixinsObservable, _emberMetal) { + /* + NOTE: This test is adapted from the 1.x series of unit tests. The tests + are the same except for places where we intend to break the API we instead + validate that we warn the developer appropriately. + + CHANGES FROM 1.6: + + * Create ObservableObject which includes Ember.Observable + * Remove test that tests internal _kvo_changeLevel property. This is an + implementation detail. + * Remove test for allPropertiesDidChange + * Removed star observer test. no longer supported + * Removed property revision test. no longer supported + */ + + // ======================================================================== + // Ember.Observable Tests + // ======================================================================== + + 'use strict'; + + var ObservableObject = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsObservable.default); + + var revMatches = false; + var ObjectA = undefined; + + QUnit.module('object.propertyChanges', { + setup: function () { + ObjectA = ObservableObject.extend({ + action: _emberMetal.observer('foo', function () { + this.set('prop', 'changedPropValue'); + }), + notifyAction: _emberMetal.observer('newFoo', function () { + this.set('newProp', 'changedNewPropValue'); + }), + + notifyAllAction: _emberMetal.observer('prop', function () { + this.set('newFoo', 'changedNewFooValue'); + }), + + starObserver: function (target, key, value, rev) { + revMatches = rev === target.propertyRevision; + this.starProp = key; + } + }).create({ + starProp: null, + + foo: 'fooValue', + prop: 'propValue', + + newFoo: 'newFooValue', + newProp: 'newPropValue' + }); + } + }); + + QUnit.test('should observe the changes within the nested begin / end property changes', function () { + //start the outer nest + ObjectA.beginPropertyChanges(); + + // Inner nest + ObjectA.beginPropertyChanges(); + ObjectA.set('foo', 'changeFooValue'); + + equal(ObjectA.prop, 'propValue'); + ObjectA.endPropertyChanges(); + + //end inner nest + ObjectA.set('prop', 'changePropValue'); + equal(ObjectA.newFoo, 'newFooValue'); + + //close the outer nest + ObjectA.endPropertyChanges(); + + equal(ObjectA.prop, 'changedPropValue'); + equal(ObjectA.newFoo, 'changedNewFooValue'); + }); + + QUnit.test('should observe the changes within the begin and end property changes', function () { + ObjectA.beginPropertyChanges(); + ObjectA.set('foo', 'changeFooValue'); + + equal(ObjectA.prop, 'propValue'); + ObjectA.endPropertyChanges(); + + equal(ObjectA.prop, 'changedPropValue'); + }); + + QUnit.test('should indicate that the property of an object has just changed', function () { + // indicate that property of foo will change to its subscribers + ObjectA.propertyWillChange('foo'); + + //Value of the prop is unchanged yet as this will be changed when foo changes + equal(ObjectA.prop, 'propValue'); + + //change the value of foo. + ObjectA.set('foo', 'changeFooValue'); + + // Indicate the subscribers of foo that the value has just changed + ObjectA.propertyDidChange('foo', null); + + // Values of prop has just changed + equal(ObjectA.prop, 'changedPropValue'); + }); + + QUnit.test('should notify that the property of an object has changed', function () { + // Notify to its subscriber that the values of 'newFoo' will be changed. In this + // case the observer is "newProp". Therefore this will call the notifyAction function + // and value of "newProp" will be changed. + ObjectA.notifyPropertyChange('newFoo', 'fooValue'); + + //value of newProp changed. + equal(ObjectA.newProp, 'changedNewPropValue'); + }); + + QUnit.test('should invalidate function property cache when notifyPropertyChange is called', function () { + var a = ObservableObject.extend({ + b: _emberMetal.computed({ + get: function () { + return this._b; + }, + set: function (key, value) { + this._b = value; + return this; + } + }).volatile() + }).create({ + _b: null + }); + + a.set('b', 'foo'); + equal(a.get('b'), 'foo', 'should have set the correct value for property b'); + + a._b = 'bar'; + a.notifyPropertyChange('b'); + a.set('b', 'foo'); + equal(a.get('b'), 'foo', 'should have invalidated the cache so that the newly set value is actually set'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/legacy_1x/mixins/observable'); + test('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/legacy_1x/mixins/observable'); + QUnit.test('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/binding_test', ['exports', 'ember-environment', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberEnvironment, _emberMetal, _emberRuntimeSystemObject) { + 'use strict'; + + /* + NOTE: This test is adapted from the 1.x series of unit tests. The tests + are the same except for places where we intend to break the API we instead + validate that we warn the developer appropriately. + + CHANGES FROM 1.6: + + * All calls to run.sync() were changed to + run.sync() + + * Bindings no longer accept a root object as their second param. Instead + our test binding objects were put under a single object they could + originate from. + + * tests that inspected internal properties were removed. + + * converted foo.get/foo.set to use get/Ember.set + + * Removed tests for Binding.isConnected. Since binding instances are now + shared this property no longer makes sense. + + * Changed call calls for obj.bind(...) to bind(obj, ...); + + * Changed all calls to sc_super() to this._super(...arguments) + + * Changed all calls to disconnect() to pass the root object. + + * removed calls to Binding.destroy() as that method is no longer useful + (or defined) + + * changed use of T_STRING to 'string' + */ + + // ======================================================================== + // Binding Tests + // ======================================================================== + + var TestNamespace = undefined, + fromObject = undefined, + toObject = undefined, + binding = undefined, + Bon1 = undefined, + bon2 = undefined, + root = undefined; // global variables + var originalLookup = _emberEnvironment.context.lookup; + var lookup = undefined; + + QUnit.module('basic object binding', { + setup: function () { + fromObject = _emberRuntimeSystemObject.default.create({ value: 'start' }); + toObject = _emberRuntimeSystemObject.default.create({ value: 'end' }); + root = { fromObject: fromObject, toObject: toObject }; + _emberMetal.run(function () { + expectDeprecation(function () { + binding = _emberMetal.bind(root, 'toObject.value', 'fromObject.value'); + }, /`Ember\.Binding` is deprecated./); + }); + } + }); + + QUnit.test('binding should have synced on connect', function () { + equal(_emberMetal.get(toObject, 'value'), 'start', 'toObject.value should match fromObject.value'); + }); + + QUnit.test('fromObject change should propagate to toObject only after flush', function () { + _emberMetal.run(function () { + _emberMetal.set(fromObject, 'value', 'change'); + equal(_emberMetal.get(toObject, 'value'), 'start'); + }); + equal(_emberMetal.get(toObject, 'value'), 'change'); + }); + + QUnit.test('toObject change should propagate to fromObject only after flush', function () { + _emberMetal.run(function () { + _emberMetal.set(toObject, 'value', 'change'); + equal(_emberMetal.get(fromObject, 'value'), 'start'); + }); + equal(_emberMetal.get(fromObject, 'value'), 'change'); + }); + + QUnit.test('deferred observing during bindings', function () { + // setup special binding + fromObject = _emberRuntimeSystemObject.default.create({ + value1: 'value1', + value2: 'value2' + }); + + toObject = _emberRuntimeSystemObject.default.extend({ + observer: _emberMetal.observer('value1', 'value2', function () { + equal(_emberMetal.get(this, 'value1'), 'CHANGED', 'value1 when observer fires'); + equal(_emberMetal.get(this, 'value2'), 'CHANGED', 'value2 when observer fires'); + this.callCount++; + }) + }).create({ + value1: 'value1', + value2: 'value2', + + callCount: 0 + }); + + var root = { fromObject: fromObject, toObject: toObject }; + _emberMetal.run(function () { + expectDeprecation(function () { + _emberMetal.bind(root, 'toObject.value1', 'fromObject.value1'); + }, /`Ember\.Binding` is deprecated./); + + expectDeprecation(function () { + _emberMetal.bind(root, 'toObject.value2', 'fromObject.value2'); + }, /`Ember\.Binding` is deprecated./); + + // change both value1 + value2, then flush bindings. observer should only + // fire after bindings are done flushing. + _emberMetal.set(fromObject, 'value1', 'CHANGED'); + _emberMetal.set(fromObject, 'value2', 'CHANGED'); + }); + + equal(toObject.callCount, 2, 'should call observer twice'); + }); + + QUnit.test('binding disconnection actually works', function () { + binding.disconnect(root); + _emberMetal.run(function () { + _emberMetal.set(fromObject, 'value', 'change'); + }); + equal(_emberMetal.get(toObject, 'value'), 'start'); + }); + + var first = undefined, + second = undefined, + third = undefined, + binding1 = undefined, + binding2 = undefined; // global variables + + // .......................................................... + // chained binding + // + + QUnit.module('chained binding', { + + setup: function () { + _emberMetal.run(function () { + first = _emberRuntimeSystemObject.default.create({ output: 'first' }); + + second = _emberRuntimeSystemObject.default.extend({ + inputDidChange: _emberMetal.observer('input', function () { + _emberMetal.set(this, 'output', _emberMetal.get(this, 'input')); + }) + }).create({ + input: 'second', + output: 'second' + }); + + third = _emberRuntimeSystemObject.default.create({ input: 'third' }); + + root = { first: first, second: second, third: third }; + + expectDeprecation(function () { + binding1 = _emberMetal.bind(root, 'second.input', 'first.output'); + }, /`Ember\.Binding` is deprecated./); + + expectDeprecation(function () { + binding2 = _emberMetal.bind(root, 'second.output', 'third.input'); + }, /`Ember\.Binding` is deprecated./); + }); + }, + teardown: function () { + _emberMetal.run.cancelTimers(); + } + }); + + QUnit.test('changing first output should propagate to third after flush', function () { + _emberMetal.run(function () { + _emberMetal.set(first, 'output', 'change'); + equal('change', _emberMetal.get(first, 'output'), 'first.output'); + ok('change' !== _emberMetal.get(third, 'input'), 'third.input'); + }); + + equal('change', _emberMetal.get(first, 'output'), 'first.output'); + equal('change', _emberMetal.get(second, 'input'), 'second.input'); + equal('change', _emberMetal.get(second, 'output'), 'second.output'); + equal('change', _emberMetal.get(third, 'input'), 'third.input'); + }); + + // .......................................................... + // Custom Binding + // + + QUnit.module('Custom Binding', { + setup: function () { + _emberEnvironment.context.lookup = lookup = {}; + + Bon1 = _emberRuntimeSystemObject.default.extend({ + value1: 'hi', + value2: 83, + array1: [] + }); + + bon2 = _emberRuntimeSystemObject.default.create({ + val1: 'hello', + val2: 25, + arr: [1, 2, 3, 4] + }); + + _emberEnvironment.context.lookup['TestNamespace'] = TestNamespace = { + bon2: bon2, + Bon1: Bon1 + }; + }, + teardown: function () { + _emberEnvironment.context.lookup = originalLookup; + Bon1 = bon2 = TestNamespace = null; + _emberMetal.run.cancelTimers(); + } + }); + + QUnit.test('two bindings to the same value should sync in the order they are initialized', function () { + _emberMetal.run.begin(); + + var a = _emberRuntimeSystemObject.default.create({ + foo: 'bar' + }); + + var b = _emberRuntimeSystemObject.default.extend({ + C: _emberRuntimeSystemObject.default.extend({ + foo: 'bee', + fooBinding: 'owner.foo' + }), + + init: function () { + this._super.apply(this, arguments); + _emberMetal.set(this, 'c', this.C.create({ owner: this })); + } + }); + + expectDeprecation(function () { + b = b.create({ + foo: 'baz', + fooBinding: 'a.foo', + a: a + }); + }, /`Ember\.Binding` is deprecated./); + + _emberMetal.run.end(); + + equal(_emberMetal.get(a, 'foo'), 'bar', 'a.foo should not change'); + equal(_emberMetal.get(b, 'foo'), 'bar', 'a.foo should propagate up to b.foo'); + equal(_emberMetal.get(b.c, 'foo'), 'bar', 'a.foo should propagate up to b.c.foo'); + }); + + // .......................................................... + // propertyNameBinding with longhand + // + + QUnit.module('propertyNameBinding with longhand', { + setup: function () { + _emberEnvironment.context.lookup = lookup = {}; + + lookup['TestNamespace'] = TestNamespace = {}; + _emberMetal.run(function () { + TestNamespace.fromObject = _emberRuntimeSystemObject.default.create({ + value: 'originalValue' + }); + + expectDeprecation(function () { + TestNamespace.toObject = _emberRuntimeSystemObject.default.extend({ + valueBinding: _emberMetal.Binding.from('TestNamespace.fromObject.value'), + relativeBinding: _emberMetal.Binding.from('localValue') + }).create({ + localValue: 'originalLocal' + }); + }, /`Ember\.Binding` is deprecated./); + }); + }, + teardown: function () { + TestNamespace = undefined; + _emberEnvironment.context.lookup = originalLookup; + } + }); + + QUnit.test('works with full path', function () { + _emberMetal.run(function () { + return _emberMetal.set(TestNamespace.fromObject, 'value', 'updatedValue'); + }); + + equal(_emberMetal.get(TestNamespace.toObject, 'value'), 'updatedValue'); + + _emberMetal.run(function () { + return _emberMetal.set(TestNamespace.fromObject, 'value', 'newerValue'); + }); + + equal(_emberMetal.get(TestNamespace.toObject, 'value'), 'newerValue'); + }); + + QUnit.test('works with local path', function () { + _emberMetal.run(function () { + return _emberMetal.set(TestNamespace.toObject, 'localValue', 'updatedValue'); + }); + + equal(_emberMetal.get(TestNamespace.toObject, 'relative'), 'updatedValue'); + + _emberMetal.run(function () { + return _emberMetal.set(TestNamespace.toObject, 'localValue', 'newerValue'); + }); + + equal(_emberMetal.get(TestNamespace.toObject, 'relative'), 'newerValue'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/binding_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/legacy_1x/system'); + test('ember-runtime/tests/legacy_1x/system/binding_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/legacy_1x/system/binding_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/binding_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/legacy_1x/system'); + QUnit.test('ember-runtime/tests/legacy_1x/system/binding_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/legacy_1x/system/binding_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/object/base_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { + 'use strict'; + + /* + NOTE: This test is adapted from the 1.x series of unit tests. The tests + are the same except for places where we intend to break the API we instead + validate that we warn the developer appropriately. + + CHANGES FROM 1.6: + + * Changed get(obj, ) and set(obj, ) to Ember.get() and Ember.set() + * Removed obj.instanceOf() and obj.kindOf() tests. use obj instanceof Foo + instead + * Removed respondsTo() and tryToPerform() tests. Can be brought back in a + utils package. + * Removed destroy() test. You can impl yourself but not built in + * Changed Class.subclassOf() test to Class.detect() + * Remove broken test for 'superclass' property. + * Removed obj.didChangeFor() + */ + + // ======================================================================== + // EmberObject Base Tests + // ======================================================================== + + var obj = undefined, + obj1 = undefined, + don = undefined; // global variables + + QUnit.module('A new EmberObject instance', { + + setup: function () { + obj = _emberRuntimeSystemObject.default.create({ + foo: 'bar', + total: 12345, + aMethodThatExists: function () {}, + aMethodThatReturnsTrue: function () { + return true; + }, + aMethodThatReturnsFoobar: function () { + return 'Foobar'; + }, + aMethodThatReturnsFalse: function () { + return false; + } + }); + }, + + teardown: function () { + obj = undefined; + } + + }); + + QUnit.test('Should return its properties when requested using EmberObject#get', function () { + equal(_emberMetal.get(obj, 'foo'), 'bar'); + equal(_emberMetal.get(obj, 'total'), 12345); + }); + + QUnit.test('Should allow changing of those properties by calling EmberObject#set', function () { + equal(_emberMetal.get(obj, 'foo'), 'bar'); + equal(_emberMetal.get(obj, 'total'), 12345); + + _emberMetal.set(obj, 'foo', 'Chunky Bacon'); + _emberMetal.set(obj, 'total', 12); + + equal(_emberMetal.get(obj, 'foo'), 'Chunky Bacon'); + equal(_emberMetal.get(obj, 'total'), 12); + }); + + QUnit.module('EmberObject superclass and subclasses', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + method1: function () { + return 'hello'; + } + }); + obj1 = obj.extend(); + don = obj1.create({ + method2: function () { + return this.superclass(); + } + }); + }, + + teardown: function () { + obj = undefined; + obj1 = undefined; + don = undefined; + } + }); + + QUnit.test('Checking the detect() function on an object and its subclass', function () { + equal(obj.detect(obj1), true); + equal(obj1.detect(obj), false); + }); + + QUnit.test('Checking the detectInstance() function on an object and its subclass', function () { + ok(_emberRuntimeSystemObject.default.detectInstance(obj.create())); + ok(obj.detectInstance(obj.create())); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/object/base_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/legacy_1x/system/object'); + test('ember-runtime/tests/legacy_1x/system/object/base_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/legacy_1x/system/object/base_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/object/base_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/legacy_1x/system/object'); + QUnit.test('ember-runtime/tests/legacy_1x/system/object/base_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/legacy_1x/system/object/base_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test', ['exports', 'ember-environment', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberEnvironment, _emberMetal, _emberRuntimeSystemObject) { + 'use strict'; + + /* + NOTE: This test is adapted from the 1.x series of unit tests. The tests + are the same except for places where we intend to break the API we instead + validate that we warn the developer appropriately. + + CHANGES FROM 1.6: + + * changed Ember.Bending.flushPendingChanges() -> run.sync(); + * changes obj.set() and obj.get() to Ember.set() and Ember.get() + * Fixed an actual bug in unit tests around line 133 + * fixed 'bindings should disconnect on destroy' test to use destroy. + */ + + // ======================================================================== + // EmberObject bindings Tests + // ======================================================================== + + var originalLookup = _emberEnvironment.context.lookup; + var testObject = undefined, + fromObject = undefined, + extraObject = undefined, + TestObject = undefined; + var TestNamespace = undefined, + lookup = undefined; + + QUnit.module('bind() method', { + setup: function () { + _emberEnvironment.context.lookup = lookup = {}; + + testObject = _emberRuntimeSystemObject.default.create({ + foo: 'bar', + bar: 'foo', + extraObject: null + }); + + fromObject = _emberRuntimeSystemObject.default.create({ + bar: 'foo', + extraObject: null + }); + + extraObject = _emberRuntimeSystemObject.default.create({ + foo: 'extraObjectValue' + }); + + lookup['TestNamespace'] = TestNamespace = { + fromObject: fromObject, + testObject: testObject + }; + }, + + teardown: function () { + testObject = fromObject = extraObject = null; + _emberEnvironment.context.lookup = originalLookup; + } + }); + + QUnit.test('bind(TestNamespace.fromObject.bar) should follow absolute path', function () { + _emberMetal.run(function () { + expectDeprecation(function () { + // create binding + testObject.bind('foo', 'TestNamespace.fromObject.bar'); + }, /`Ember.Binding` is deprecated/); + + // now make a change to see if the binding triggers. + _emberMetal.set(fromObject, 'bar', 'changedValue'); + }); + + equal('changedValue', _emberMetal.get(testObject, 'foo'), 'testObject.foo'); + }); + + QUnit.test('bind(.bar) should bind to relative path', function () { + _emberMetal.run(function () { + expectDeprecation(function () { + // create binding + testObject.bind('foo', 'bar'); + }, /`Ember.Binding` is deprecated/); + + // now make a change to see if the binding triggers. + _emberMetal.set(testObject, 'bar', 'changedValue'); + }); + + equal('changedValue', _emberMetal.get(testObject, 'foo'), 'testObject.foo'); + }); + + QUnit.module('fooBinding method', { + setup: function () { + _emberEnvironment.context.lookup = lookup = {}; + + TestObject = _emberRuntimeSystemObject.default.extend({ + foo: 'bar', + bar: 'foo', + extraObject: null + }); + + fromObject = _emberRuntimeSystemObject.default.create({ + bar: 'foo', + extraObject: null + }); + + extraObject = _emberRuntimeSystemObject.default.create({ + foo: 'extraObjectValue' + }); + + lookup['TestNamespace'] = TestNamespace = { + fromObject: fromObject, + testObject: TestObject + }; + }, + + teardown: function () { + _emberEnvironment.context.lookup = originalLookup; + TestObject = fromObject = extraObject = null; + // delete TestNamespace; + } + }); + + var deprecationMessage = /`Ember.Binding` is deprecated/; + + QUnit.test('fooBinding: TestNamespace.fromObject.bar should follow absolute path', function () { + _emberMetal.run(function () { + expectDeprecation(function () { + // create binding + testObject = TestObject.extend({ + fooBinding: 'TestNamespace.fromObject.bar' + }).create(); + }, deprecationMessage); + + // now make a change to see if the binding triggers. + _emberMetal.set(fromObject, 'bar', 'changedValue'); + }); + + equal('changedValue', _emberMetal.get(testObject, 'foo'), 'testObject.foo'); + }); + + QUnit.test('fooBinding: .bar should bind to relative path', function () { + _emberMetal.run(function () { + expectDeprecation(function () { + // create binding + testObject = TestObject.extend({ + fooBinding: 'bar' + }).create(); + }, deprecationMessage); + + // now make a change to see if the binding triggers. + _emberMetal.set(testObject, 'bar', 'changedValue'); + }); + + equal('changedValue', _emberMetal.get(testObject, 'foo'), 'testObject.foo'); + }); + + QUnit.test('fooBinding: should disconnect bindings when destroyed', function () { + _emberMetal.run(function () { + expectDeprecation(function () { + // create binding + testObject = TestObject.extend({ + fooBinding: 'TestNamespace.fromObject.bar' + }).create(); + }, deprecationMessage); + + _emberMetal.set(TestNamespace.fromObject, 'bar', 'BAZ'); + }); + + equal(_emberMetal.get(testObject, 'foo'), 'BAZ', 'binding should have synced'); + + _emberMetal.run(function () { + return testObject.destroy(); + }); + + _emberMetal.run(function () { + return _emberMetal.set(TestNamespace.fromObject, 'bar', 'BIFF'); + }); + + ok(_emberMetal.get(testObject, 'foo') !== 'bar', 'binding should not have synced'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/legacy_1x/system/object'); + test('ember-runtime/tests/legacy_1x/system/object/bindings_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/legacy_1x/system/object/bindings_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/legacy_1x/system/object'); + QUnit.test('ember-runtime/tests/legacy_1x/system/object/bindings_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/legacy_1x/system/object/bindings_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/object/concatenated_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { + 'use strict'; + + /* + NOTE: This test is adapted from the 1.x series of unit tests. The tests + are the same except for places where we intend to break the API we instead + validate that we warn the developer appropriately. + + CHANGES FROM 1.6: + + * changed get(obj, ) and set(obj, ) to Ember.get() and Ember.set() + * converted uses of obj.isEqual() to use deepEqual() test since isEqual is not + always defined + */ + + function K() { + return this; + } + + var klass = undefined; + + QUnit.module('EmberObject Concatenated Properties', { + setup: function () { + klass = _emberRuntimeSystemObject.default.extend({ + concatenatedProperties: ['values', 'functions'], + values: ['a', 'b', 'c'], + functions: [K] + }); + } + }); + + QUnit.test('concatenates instances', function () { + var obj = klass.create({ + values: ['d', 'e', 'f'] + }); + + var values = _emberMetal.get(obj, 'values'); + var expected = ['a', 'b', 'c', 'd', 'e', 'f']; + + deepEqual(values, expected, 'should concatenate values property (expected: ' + expected + ', got: ' + values + ')'); + }); + + QUnit.test('concatenates subclasses', function () { + var subKlass = klass.extend({ + values: ['d', 'e', 'f'] + }); + var obj = subKlass.create(); + + var values = _emberMetal.get(obj, 'values'); + var expected = ['a', 'b', 'c', 'd', 'e', 'f']; + + deepEqual(values, expected, 'should concatenate values property (expected: ' + expected + ', got: ' + values + ')'); + }); + + QUnit.test('concatenates reopen', function () { + klass.reopen({ + values: ['d', 'e', 'f'] + }); + var obj = klass.create(); + + var values = _emberMetal.get(obj, 'values'); + var expected = ['a', 'b', 'c', 'd', 'e', 'f']; + + deepEqual(values, expected, 'should concatenate values property (expected: ' + expected + ', got: ' + values + ')'); + }); + + QUnit.test('concatenates mixin', function () { + var mixin = { + values: ['d', 'e'] + }; + var subKlass = klass.extend(mixin, { + values: ['f'] + }); + var obj = subKlass.create(); + + var values = _emberMetal.get(obj, 'values'); + var expected = ['a', 'b', 'c', 'd', 'e', 'f']; + + deepEqual(values, expected, 'should concatenate values property (expected: ' + expected + ', got: ' + values + ')'); + }); + + QUnit.test('concatenates reopen, subclass, and instance', function () { + klass.reopen({ values: ['d'] }); + var subKlass = klass.extend({ values: ['e'] }); + var obj = subKlass.create({ values: ['f'] }); + + var values = _emberMetal.get(obj, 'values'); + var expected = ['a', 'b', 'c', 'd', 'e', 'f']; + + deepEqual(values, expected, 'should concatenate values property (expected: ' + expected + ', got: ' + values + ')'); + }); + + QUnit.test('concatenates subclasses when the values are functions', function () { + var subKlass = klass.extend({ + functions: K + }); + var obj = subKlass.create(); + + var values = _emberMetal.get(obj, 'functions'); + var expected = [K, K]; + + deepEqual(values, expected, 'should concatenate functions property (expected: ' + expected + ', got: ' + values + ')'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/object/concatenated_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/legacy_1x/system/object'); + test('ember-runtime/tests/legacy_1x/system/object/concatenated_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/legacy_1x/system/object/concatenated_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/object/concatenated_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/legacy_1x/system/object'); + QUnit.test('ember-runtime/tests/legacy_1x/system/object/concatenated_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/legacy_1x/system/object/concatenated_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/run_loop_test', ['exports', 'ember-metal', 'ember-runtime/mixins/observable', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeMixinsObservable, _emberRuntimeSystemObject) { + 'use strict'; + + /* + NOTE: This test is adapted from the 1.x series of unit tests. The tests + are the same except for places where we intend to break the API we instead + validate that we warn the developer appropriately. + + CHANGES FROM 1.6: + + * Updated the API usage for setting up and syncing Binding since these + are not the APIs this file is testing. + + * Disabled a call to invokeOnce() around line 127 because it appeared to be + broken anyway. I don't think it ever even worked. + */ + + var MyApp = undefined, + binding1 = undefined, + binding2 = undefined; + + QUnit.module('System:run_loop() - chained binding', { + setup: function () { + MyApp = {}; + MyApp.first = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsObservable.default).create({ + output: 'MyApp.first' + }); + + MyApp.second = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsObservable.default, { + inputDidChange: _emberMetal.observer('input', function () { + this.set('output', this.get('input')); + }) + }).create({ + input: 'MyApp.second', + output: 'MyApp.second' + }); + + MyApp.third = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsObservable.default).create({ + input: 'MyApp.third' + }); + } + }); + + var deprecationMessage = /`Ember.Binding` is deprecated/; + + QUnit.test('Should propagate bindings after the RunLoop completes (using Ember.RunLoop)', function () { + _emberMetal.run(function () { + //Binding of output of MyApp.first object to input of MyApp.second object + expectDeprecation(function () { + binding1 = _emberMetal.Binding.from('first.output').to('second.input').connect(MyApp); + }, deprecationMessage); + + //Binding of output of MyApp.second object to input of MyApp.third object + expectDeprecation(function () { + binding2 = _emberMetal.Binding.from('second.output').to('third.input').connect(MyApp); + }, deprecationMessage); + }); + + _emberMetal.run(function () { + // Based on the above binding if you change the output of MyApp.first + // object it should change the all the variable of + // MyApp.first,MyApp.second and MyApp.third object + MyApp.first.set('output', 'change'); + + //Changes the output of the MyApp.first object + equal(MyApp.first.get('output'), 'change'); + + //since binding has not taken into effect the value still remains as change. + equal(MyApp.second.get('output'), 'MyApp.first'); + }); // allows bindings to trigger... + + //Value of the output variable changed to 'change' + equal(MyApp.first.get('output'), 'change'); + + //Since binding triggered after the end loop the value changed to 'change'. + equal(MyApp.second.get('output'), 'change'); + }); + + QUnit.test('Should propagate bindings after the RunLoop completes', function () { + _emberMetal.run(function () { + //Binding of output of MyApp.first object to input of MyApp.second object + expectDeprecation(function () { + binding1 = _emberMetal.Binding.from('first.output').to('second.input').connect(MyApp); + }, deprecationMessage); + + //Binding of output of MyApp.second object to input of MyApp.third object + expectDeprecation(function () { + binding2 = _emberMetal.Binding.from('second.output').to('third.input').connect(MyApp); + }, deprecationMessage); + }); + + _emberMetal.run(function () { + //Based on the above binding if you change the output of MyApp.first object it should + //change the all the variable of MyApp.first,MyApp.second and MyApp.third object + MyApp.first.set('output', 'change'); + + //Changes the output of the MyApp.first object + equal(MyApp.first.get('output'), 'change'); + + //since binding has not taken into effect the value still remains as change. + equal(MyApp.second.get('output'), 'MyApp.first'); + }); + + //Value of the output variable changed to 'change' + equal(MyApp.first.get('output'), 'change'); + + //Since binding triggered after the end loop the value changed to 'change'. + equal(MyApp.second.get('output'), 'change'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/run_loop_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/legacy_1x/system'); + test('ember-runtime/tests/legacy_1x/system/run_loop_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/legacy_1x/system/run_loop_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/run_loop_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/legacy_1x/system'); + QUnit.test('ember-runtime/tests/legacy_1x/system/run_loop_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/legacy_1x/system/run_loop_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/main_test', ['exports', 'ember-runtime/index'], function (exports, _emberRuntimeIndex) { + 'use strict'; + + QUnit.module('ember-runtime/main'); + + QUnit.test('Ember.computed.collect', function () { + var MyObj = _emberRuntimeIndex.Object.extend({ + props: _emberRuntimeIndex.collect('foo', 'bar', 'baz') + }); + + var myObj = MyObj.create({ + foo: 3, + bar: 5, + baz: 'asdf' + }); + + var propsValue = myObj.get('props'); + + deepEqual(propsValue, [3, 5, 'asdf']); + }); +}); +enifed('ember-runtime/tests/main_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests'); + test('ember-runtime/tests/main_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/main_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/main_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests'); + QUnit.test('ember-runtime/tests/main_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/main_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/mixins/array_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/tests/suites/array', 'ember-runtime/system/object', 'ember-runtime/mixins/array', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeTestsSuitesArray, _emberRuntimeSystemObject, _emberRuntimeMixinsArray, _emberRuntimeSystemNative_array) { + 'use strict'; + + /* + Implement a basic fake mutable array. This validates that any non-native + enumerable can impl this API. + */ + var TestArray = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsArray.default, { + _content: null, + + init: function () { + var ary = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; + + this._content = ary; + }, + + // some methods to modify the array so we can test changes. Note that + // arrays can be modified even if they don't implement MutableArray. The + // MutableArray is just a standard API for mutation but not required. + addObject: function (obj) { + var idx = this._content.length; + _emberRuntimeMixinsArray.arrayContentWillChange(this, idx, 0, 1); + this._content.push(obj); + _emberRuntimeMixinsArray.arrayContentDidChange(this, idx, 0, 1); + }, + + removeFirst: function (idx) { + _emberRuntimeMixinsArray.arrayContentWillChange(this, 0, 1, 0); + this._content.shift(); + _emberRuntimeMixinsArray.arrayContentDidChange(this, 0, 1, 0); + }, + + objectAt: function (idx) { + return this._content[idx]; + }, + + length: _emberMetal.computed(function () { + return this._content.length; + }) + }); + + _emberRuntimeTestsSuitesArray.ArrayTests.extend({ + + name: 'Basic Mutable Array', + + newObject: function (ary) { + ary = ary ? ary.slice() : this.newFixture(3); + return new TestArray(ary); + }, + + // allows for testing of the basic enumerable after an internal mutation + mutate: function (obj) { + obj.addObject(this.getFixture(1)[0]); + }, + + toArray: function (obj) { + return obj.slice(); + } + + }).run(); + + QUnit.test('the return value of slice has Ember.Array applied', function () { + var x = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsArray.default).create({ + length: 0 + }); + var y = x.slice(1); + equal(_emberRuntimeMixinsArray.default.detect(y), true, 'mixin should be applied'); + }); + + QUnit.test('slice supports negative index arguments', function () { + var testArray = new TestArray([1, 2, 3, 4]); + + deepEqual(testArray.slice(-2), [3, 4], 'slice(-2)'); + deepEqual(testArray.slice(-2, -1), [3], 'slice(-2, -1'); + deepEqual(testArray.slice(-2, -2), [], 'slice(-2, -2)'); + deepEqual(testArray.slice(-1, -2), [], 'slice(-1, -2)'); + + deepEqual(testArray.slice(-4, 1), [1], 'slice(-4, 1)'); + deepEqual(testArray.slice(-4, 5), [1, 2, 3, 4], 'slice(-4, 5)'); + deepEqual(testArray.slice(-4), [1, 2, 3, 4], 'slice(-4)'); + + deepEqual(testArray.slice(0, -1), [1, 2, 3], 'slice(0, -1)'); + deepEqual(testArray.slice(0, -4), [], 'slice(0, -4)'); + deepEqual(testArray.slice(0, -3), [1], 'slice(0, -3)'); + }); + + // .......................................................... + // CONTENT DID CHANGE + // + + var DummyArray = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsArray.default, { + nextObject: function () {}, + length: 0, + objectAt: function (idx) { + return 'ITEM-' + idx; + } + }); + + var obj = undefined, + observer = undefined; + + // .......................................................... + // NOTIFY ARRAY OBSERVERS + // + + QUnit.module('mixins/array/arrayContent[Will|Did]Change'); + + QUnit.test('should notify observers of []', function () { + obj = DummyArray.extend({ + enumerablePropertyDidChange: _emberMetal.observer('[]', function () { + this._count++; + }) + }).create({ + _count: 0 + }); + + equal(obj._count, 0, 'should not have invoked yet'); + + _emberRuntimeMixinsArray.arrayContentWillChange(obj, 0, 1, 1); + _emberRuntimeMixinsArray.arrayContentDidChange(obj, 0, 1, 1); + + equal(obj._count, 1, 'should have invoked'); + }); + + // .......................................................... + // NOTIFY CHANGES TO LENGTH + // + + QUnit.module('notify observers of length', { + setup: function () { + obj = DummyArray.extend({ + lengthDidChange: _emberMetal.observer('length', function () { + this._after++; + }) + }).create({ + _after: 0 + }); + + equal(obj._after, 0, 'should not have fired yet'); + }, + + teardown: function () { + obj = null; + } + }); + + QUnit.test('should notify observers when call with no params', function () { + _emberRuntimeMixinsArray.arrayContentWillChange(obj); + equal(obj._after, 0); + + _emberRuntimeMixinsArray.arrayContentDidChange(obj); + equal(obj._after, 1); + }); + + // API variation that included items only + QUnit.test('should not notify when passed lengths are same', function () { + _emberRuntimeMixinsArray.arrayContentWillChange(obj, 0, 1, 1); + equal(obj._after, 0); + + _emberRuntimeMixinsArray.arrayContentDidChange(obj, 0, 1, 1); + equal(obj._after, 0); + }); + + QUnit.test('should notify when passed lengths are different', function () { + _emberRuntimeMixinsArray.arrayContentWillChange(obj, 0, 1, 2); + equal(obj._after, 0); + + _emberRuntimeMixinsArray.arrayContentDidChange(obj, 0, 1, 2); + equal(obj._after, 1); + }); + + // .......................................................... + // NOTIFY ARRAY OBSERVER + // + + QUnit.module('notify array observers', { + setup: function () { + obj = DummyArray.create(); + + observer = _emberRuntimeSystemObject.default.extend({ + arrayWillChange: function () { + equal(this._before, null); // should only call once + this._before = Array.prototype.slice.call(arguments); + }, + + arrayDidChange: function () { + equal(this._after, null); // should only call once + this._after = Array.prototype.slice.call(arguments); + } + }).create({ + _before: null, + _after: null + }); + + _emberRuntimeMixinsArray.addArrayObserver(obj, observer); + }, + + teardown: function () { + obj = observer = null; + } + }); + + QUnit.test('should notify enumerable observers when called with no params', function () { + _emberRuntimeMixinsArray.arrayContentWillChange(obj); + deepEqual(observer._before, [obj, 0, -1, -1]); + + _emberRuntimeMixinsArray.arrayContentDidChange(obj); + deepEqual(observer._after, [obj, 0, -1, -1]); + }); + + // API variation that included items only + QUnit.test('should notify when called with same length items', function () { + _emberRuntimeMixinsArray.arrayContentWillChange(obj, 0, 1, 1); + deepEqual(observer._before, [obj, 0, 1, 1]); + + _emberRuntimeMixinsArray.arrayContentDidChange(obj, 0, 1, 1); + deepEqual(observer._after, [obj, 0, 1, 1]); + }); + + QUnit.test('should notify when called with diff length items', function () { + _emberRuntimeMixinsArray.arrayContentWillChange(obj, 0, 2, 1); + deepEqual(observer._before, [obj, 0, 2, 1]); + + _emberRuntimeMixinsArray.arrayContentDidChange(obj, 0, 2, 1); + deepEqual(observer._after, [obj, 0, 2, 1]); + }); + + QUnit.test('removing enumerable observer should disable', function () { + _emberRuntimeMixinsArray.removeArrayObserver(obj, observer); + _emberRuntimeMixinsArray.arrayContentWillChange(obj); + deepEqual(observer._before, null); + + _emberRuntimeMixinsArray.arrayContentDidChange(obj); + deepEqual(observer._after, null); + }); + + // .......................................................... + // NOTIFY ENUMERABLE OBSERVER + // + + QUnit.module('notify enumerable observers as well', { + setup: function () { + obj = DummyArray.create(); + + observer = _emberRuntimeSystemObject.default.extend({ + enumerableWillChange: function () { + equal(this._before, null); // should only call once + this._before = Array.prototype.slice.call(arguments); + }, + + enumerableDidChange: function () { + equal(this._after, null); // should only call once + this._after = Array.prototype.slice.call(arguments); + } + }).create({ + _before: null, + _after: null + }); + + obj.addEnumerableObserver(observer); + }, + + teardown: function () { + obj = observer = null; + } + }); + + QUnit.test('should notify enumerable observers when called with no params', function () { + _emberRuntimeMixinsArray.arrayContentWillChange(obj); + deepEqual(observer._before, [obj, null, null], 'before'); + + _emberRuntimeMixinsArray.arrayContentDidChange(obj); + deepEqual(observer._after, [obj, null, null], 'after'); + }); + + // API variation that included items only + QUnit.test('should notify when called with same length items', function () { + _emberRuntimeMixinsArray.arrayContentWillChange(obj, 0, 1, 1); + deepEqual(observer._before, [obj, ['ITEM-0'], 1], 'before'); + + _emberRuntimeMixinsArray.arrayContentDidChange(obj, 0, 1, 1); + deepEqual(observer._after, [obj, 1, ['ITEM-0']], 'after'); + }); + + QUnit.test('should notify when called with diff length items', function () { + _emberRuntimeMixinsArray.arrayContentWillChange(obj, 0, 2, 1); + deepEqual(observer._before, [obj, ['ITEM-0', 'ITEM-1'], 1], 'before'); + + _emberRuntimeMixinsArray.arrayContentDidChange(obj, 0, 2, 1); + deepEqual(observer._after, [obj, 2, ['ITEM-0']], 'after'); + }); + + QUnit.test('removing enumerable observer should disable', function () { + obj.removeEnumerableObserver(observer); + _emberRuntimeMixinsArray.arrayContentWillChange(obj); + deepEqual(observer._before, null, 'before'); + + _emberRuntimeMixinsArray.arrayContentDidChange(obj); + deepEqual(observer._after, null, 'after'); + }); + + // .......................................................... + // @each + // + + var ary = undefined; + + QUnit.module('EmberArray.@each support', { + setup: function () { + ary = new TestArray([{ isDone: true, desc: 'Todo 1' }, { isDone: false, desc: 'Todo 2' }, { isDone: true, desc: 'Todo 3' }, { isDone: false, desc: 'Todo 4' }]); + }, + + teardown: function () { + ary = null; + } + }); + + QUnit.test('adding an object should notify (@each.isDone)', function () { + var called = 0; + + var observerObject = _emberRuntimeSystemObject.default.create({ + wasCalled: function () { + called++; + } + }); + + _emberMetal.addObserver(ary, '@each.isDone', observerObject, 'wasCalled'); + + ary.addObject(_emberRuntimeSystemObject.default.create({ + desc: 'foo', + isDone: false + })); + + equal(called, 1, 'calls observer when object is pushed'); + }); + + QUnit.test('@each is readOnly', function () { + expect(1); + + throws(function () { + _emberMetal.set(ary, '@each', 'foo'); + }, /Cannot set read-only property "@each"/); + }); + + QUnit.test('using @each to observe arrays that does not return objects raise error', function () { + var called = 0; + + var observerObject = _emberRuntimeSystemObject.default.create({ + wasCalled: function () { + called++; + } + }); + + ary = TestArray.create({ + objectAt: function (idx) { + return _emberMetal.get(this._content[idx], 'desc'); + } + }); + + _emberMetal.addObserver(ary, '@each.isDone', observerObject, 'wasCalled'); + + expectAssertion(function () { + ary.addObject(_emberRuntimeSystemObject.default.create({ + desc: 'foo', + isDone: false + })); + }, /When using @each to observe the array/); + + equal(called, 0, 'not calls observer when object is pushed'); + }); + + QUnit.test('modifying the array should also indicate the isDone prop itself has changed', function () { + // NOTE: we never actually get the '@each.isDone' property here. This is + // important because it tests the case where we don't have an isDone + // EachArray materialized but just want to know when the property has + // changed. + + var each = _emberMetal.get(ary, '@each'); + var count = 0; + + _emberMetal.addObserver(each, 'isDone', function () { + return count++; + }); + + count = 0; + var item = _emberRuntimeMixinsArray.objectAt(ary, 2); + _emberMetal.set(item, 'isDone', !_emberMetal.get(item, 'isDone')); + equal(count, 1, '@each.isDone should have notified'); + }); + + QUnit.test('`objectAt` returns correct object', function () { + var arr = ['first', 'second', 'third', 'fourth']; + equal(_emberRuntimeMixinsArray.objectAt(arr, 2), 'third'); + equal(_emberRuntimeMixinsArray.objectAt(arr, 4), undefined); + }); + + _internalTestHelpers.testBoth('should be clear caches for computed properties that have dependent keys on arrays that are changed after object initialization', function (get, set) { + var obj = _emberRuntimeSystemObject.default.extend({ + init: function () { + this._super.apply(this, arguments); + set(this, 'resources', _emberRuntimeSystemNative_array.A()); + }, + + common: _emberMetal.computed('resources.@each.common', function () { + return get(_emberRuntimeMixinsArray.objectAt(get(this, 'resources'), 0), 'common'); + }) + }).create(); + + get(obj, 'resources').pushObject(_emberRuntimeSystemObject.default.create({ common: 'HI!' })); + equal('HI!', get(obj, 'common')); + + set(_emberRuntimeMixinsArray.objectAt(get(obj, 'resources'), 0), 'common', 'BYE!'); + equal('BYE!', get(obj, 'common')); + }); + + _internalTestHelpers.testBoth('observers that contain @each in the path should fire only once the first time they are accessed', function (get, set) { + var count = 0; + + var obj = _emberRuntimeSystemObject.default.extend({ + init: function () { + this._super.apply(this, arguments); + // Observer does not fire on init + set(this, 'resources', _emberRuntimeSystemNative_array.A()); + }, + + commonDidChange: _emberMetal.observer('resources.@each.common', function () { + return count++; + }) + }).create(); + + // Observer fires second time when new object is added + get(obj, 'resources').pushObject(_emberRuntimeSystemObject.default.create({ common: 'HI!' })); + // Observer fires third time when property on an object is changed + set(_emberRuntimeMixinsArray.objectAt(get(obj, 'resources'), 0), 'common', 'BYE!'); + + equal(count, 2, 'observers should only be called once'); + }); +}); +enifed('ember-runtime/tests/mixins/array_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/mixins'); + test('ember-runtime/tests/mixins/array_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/mixins/array_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/mixins/array_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/mixins'); + QUnit.test('ember-runtime/tests/mixins/array_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/mixins/array_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/mixins/comparable_test', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/compare', 'ember-runtime/mixins/comparable'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeCompare, _emberRuntimeMixinsComparable) { + 'use strict'; + + var Rectangle = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsComparable.default, { + length: 0, + width: 0, + + area: function () { + return _emberMetal.get(this, 'length') * _emberMetal.get(this, 'width'); + }, + + compare: function (a, b) { + return _emberRuntimeCompare.default(a.area(), b.area()); + } + + }); + + var r1 = undefined, + r2 = undefined; + + QUnit.module('Comparable', { + setup: function () { + r1 = Rectangle.create({ length: 6, width: 12 }); + r2 = Rectangle.create({ length: 6, width: 13 }); + } + }); + + QUnit.test('should be comparable and return the correct result', function () { + equal(_emberRuntimeMixinsComparable.default.detect(r1), true); + equal(_emberRuntimeCompare.default(r1, r1), 0); + equal(_emberRuntimeCompare.default(r1, r2), -1); + equal(_emberRuntimeCompare.default(r2, r1), 1); + }); +}); +enifed('ember-runtime/tests/mixins/comparable_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/mixins'); + test('ember-runtime/tests/mixins/comparable_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/mixins/comparable_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/mixins/comparable_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/mixins'); + QUnit.test('ember-runtime/tests/mixins/comparable_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/mixins/comparable_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/mixins/container_proxy_test', ['exports', 'ember-utils', 'container', 'ember-runtime/mixins/container_proxy', 'ember-runtime/system/object'], function (exports, _emberUtils, _container, _emberRuntimeMixinsContainer_proxy, _emberRuntimeSystemObject) { + 'use strict'; + + QUnit.module('ember-runtime/mixins/container_proxy', { + setup: function () { + this.Owner = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsContainer_proxy.default); + this.instance = this.Owner.create(); + + var registry = new _container.Registry(); + + this.instance.__container__ = new _container.Container(registry, { + owner: this.instance + }); + } + }); + + QUnit.test('provides ownerInjection helper method', function (assert) { + var result = this.instance.ownerInjection(); + + assert.equal(result[_emberUtils.OWNER], this.instance, 'returns an object with the OWNER symbol'); + }); +}); +enifed('ember-runtime/tests/mixins/container_proxy_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/mixins'); + test('ember-runtime/tests/mixins/container_proxy_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/mixins/container_proxy_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/mixins/container_proxy_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/mixins'); + QUnit.test('ember-runtime/tests/mixins/container_proxy_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/mixins/container_proxy_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/mixins/copyable_test', ['exports', 'ember-utils', 'ember-runtime/tests/suites/copyable', 'ember-runtime/mixins/copyable', 'ember-runtime/mixins/freezable', 'ember-runtime/system/object', 'ember-metal'], function (exports, _emberUtils, _emberRuntimeTestsSuitesCopyable, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsFreezable, _emberRuntimeSystemObject, _emberMetal) { + 'use strict'; + + QUnit.module('Ember.Copyable.frozenCopy'); + + QUnit.test('should be deprecated', function () { + expectDeprecation('`frozenCopy` is deprecated, use `Object.freeze` instead.'); + + var Obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsFreezable.Freezable, _emberRuntimeMixinsCopyable.default, { + copy: function () { + return Obj.create(); + } + }); + + Obj.create().frozenCopy(); + }); + + var CopyableObject = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsCopyable.default, { + id: null, + + init: function () { + this._super.apply(this, arguments); + _emberMetal.set(this, 'id', _emberUtils.generateGuid()); + }, + + copy: function () { + var ret = new CopyableObject(); + _emberMetal.set(ret, 'id', _emberMetal.get(this, 'id')); + return ret; + } + }); + + _emberRuntimeTestsSuitesCopyable.default.extend({ + + name: 'Copyable Basic Test', + + newObject: function () { + return new CopyableObject(); + }, + + isEqual: function (a, b) { + if (!(a instanceof CopyableObject) || !(b instanceof CopyableObject)) { + return false; + } + + return _emberMetal.get(a, 'id') === _emberMetal.get(b, 'id'); + } + }).run(); +}); +enifed('ember-runtime/tests/mixins/copyable_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/mixins'); + test('ember-runtime/tests/mixins/copyable_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/mixins/copyable_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/mixins/copyable_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/mixins'); + QUnit.test('ember-runtime/tests/mixins/copyable_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/mixins/copyable_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/mixins/enumerable_test', ['exports', 'ember-runtime/tests/suites/enumerable', 'ember-runtime/system/object', 'ember-runtime/mixins/enumerable', 'ember-runtime/mixins/array', 'ember-runtime/system/native_array', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesEnumerable, _emberRuntimeSystemObject, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsArray, _emberRuntimeSystemNative_array, _emberMetal) { + 'use strict'; + + function K() { + return this; + } + + /* + Implement a basic fake enumerable. This validates that any non-native + enumerable can impl this API. + */ + var TestEnumerable = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default, { + _content: null, + + init: function () { + var ary = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; + + this._content = ary; + }, + + addObject: function (obj) { + if (this._content.indexOf(obj) >= 0) { + return this; + } + + this._content.push(obj); + this.enumerableContentDidChange(); + }, + + nextObject: function (idx) { + return idx >= _emberMetal.get(this, 'length') ? undefined : this._content[idx]; + }, + + length: _emberMetal.computed(function () { + return this._content.length; + }), + + slice: function () { + return this._content.slice(); + } + + }); + + _emberRuntimeTestsSuitesEnumerable.default.extend({ + name: 'Basic Enumerable', + + newObject: function (ary) { + ary = ary ? ary.slice() : this.newFixture(3); + return new TestEnumerable(ary); + }, + + // allows for testing of the basic enumerable after an internal mutation + mutate: function (obj) { + obj.addObject(obj._content.length + 1); + }, + + toArray: function (obj) { + return obj.slice(); + } + + }).run(); + + QUnit.module('Ember.Enumerable'); + + QUnit.test('should apply Ember.Array to return value of map', function () { + var x = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default).create(); + var y = x.map(K); + equal(_emberRuntimeMixinsArray.default.detect(y), true, 'should have mixin applied'); + }); + + QUnit.test('should apply Ember.Array to return value of filter', function () { + var x = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default).create(); + var y = x.filter(K); + equal(_emberRuntimeMixinsArray.default.detect(y), true, 'should have mixin applied'); + }); + + QUnit.test('should apply Ember.Array to return value of invoke', function () { + var x = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default).create(); + var y = x.invoke(K); + equal(_emberRuntimeMixinsArray.default.detect(y), true, 'should have mixin applied'); + }); + + QUnit.test('should apply Ember.Array to return value of toArray', function () { + var x = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default).create(); + var y = x.toArray(K); + equal(_emberRuntimeMixinsArray.default.detect(y), true, 'should have mixin applied'); + }); + + QUnit.test('should apply Ember.Array to return value of without', function () { + var X = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default, { + contains: function () { + return true; + } + }); + + if (true) { + X.reopen({ + includes: function () { + return true; + } + }); + } + + var x = X.create(); + var y = x.without(K); + equal(_emberRuntimeMixinsArray.default.detect(y), true, 'should have mixin applied'); + }); + + QUnit.test('should apply Ember.Array to return value of uniq', function () { + var x = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default).create(); + var y = x.uniq(K); + equal(_emberRuntimeMixinsArray.default.detect(y), true, 'should have mixin applied'); + }); + + QUnit.test('any', function () { + var kittens = _emberRuntimeSystemNative_array.A([{ + color: 'white' + }, { + color: 'black' + }, { + color: 'white' + }]); + var foundWhite = kittens.any(function (kitten) { + return kitten.color === 'white'; + }); + var foundWhite2 = kittens.isAny('color', 'white'); + + equal(foundWhite, true); + equal(foundWhite2, true); + }); + + QUnit.test('any with NaN', function () { + var numbers = _emberRuntimeSystemNative_array.A([1, 2, NaN, 4]); + + var hasNaN = numbers.any(function (n) { + return isNaN(n); + }); + + equal(hasNaN, true, 'works when matching NaN'); + }); + + QUnit.test('every', function () { + var allColorsKittens = _emberRuntimeSystemNative_array.A([{ + color: 'white' + }, { + color: 'black' + }, { + color: 'white' + }]); + var allWhiteKittens = _emberRuntimeSystemNative_array.A([{ + color: 'white' + }, { + color: 'white' + }, { + color: 'white' + }]); + var allWhite = false; + var whiteKittenPredicate = function (kitten) { + return kitten.color === 'white'; + }; + + allWhite = allColorsKittens.every(whiteKittenPredicate); + equal(allWhite, false); + + allWhite = allWhiteKittens.every(whiteKittenPredicate); + equal(allWhite, true); + + allWhite = allColorsKittens.isEvery('color', 'white'); + equal(allWhite, false); + + allWhite = allWhiteKittens.isEvery('color', 'white'); + equal(allWhite, true); + }); + + if (true) { + QUnit.test('should throw an error passing a second argument to includes', function () { + var x = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default).create(); + + equal(x.includes('any'), false); + expectAssertion(function () { + x.includes('any', 1); + }, /Enumerable#includes cannot accept a second argument "startAt" as enumerable items are unordered./); + }); + } + + // .......................................................... + // CONTENT DID CHANGE + // + + var DummyEnum = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default, { + nextObject: function () {}, + length: 0 + }); + + var obj = undefined, + observer = undefined; + + // .......................................................... + // NOTIFY ENUMERABLE PROPERTY + // + + QUnit.module('mixins/enumerable/enumerableContentDidChange'); + + QUnit.test('should notify observers of []', function () { + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default, { + nextObject: function () {}, // avoid exceptions + + enumerablePropertyDidChange: _emberMetal.observer('[]', function () { + this._count++; + }) + }).create({ + _count: 0 + }); + + equal(obj._count, 0, 'should not have invoked yet'); + obj.enumerableContentWillChange(); + obj.enumerableContentDidChange(); + equal(obj._count, 1, 'should have invoked'); + }); + + // .......................................................... + // NOTIFY CHANGES TO LENGTH + // + + QUnit.module('notify observers of length', { + setup: function () { + obj = DummyEnum.extend({ + lengthDidChange: _emberMetal.observer('length', function () { + this._after++; + }) + }).create({ + _after: 0 + }); + + equal(obj._after, 0, 'should not have fired yet'); + }, + + teardown: function () { + obj = null; + } + }); + + QUnit.test('should notify observers when call with no params', function () { + obj.enumerableContentWillChange(); + equal(obj._after, 0); + + obj.enumerableContentDidChange(); + equal(obj._after, 1); + }); + + // API variation that included items only + QUnit.test('should not notify when passed arrays of same length', function () { + var added = ['foo']; + var removed = ['bar']; + + obj.enumerableContentWillChange(removed, added); + equal(obj._after, 0); + + obj.enumerableContentDidChange(removed, added); + equal(obj._after, 0); + }); + + QUnit.test('should notify when passed arrays of different length', function () { + var added = ['foo']; + var removed = ['bar', 'baz']; + + obj.enumerableContentWillChange(removed, added); + equal(obj._after, 0); + + obj.enumerableContentDidChange(removed, added); + equal(obj._after, 1); + }); + + // API variation passes indexes only + QUnit.test('should not notify when passed with indexes', function () { + obj.enumerableContentWillChange(1, 1); + equal(obj._after, 0); + + obj.enumerableContentDidChange(1, 1); + equal(obj._after, 0); + }); + + QUnit.test('should notify when passed old index API with delta', function () { + obj.enumerableContentWillChange(1, 2); + equal(obj._after, 0); + + obj.enumerableContentDidChange(1, 2); + equal(obj._after, 1); + }); + + // .......................................................... + // NOTIFY ENUMERABLE OBSERVER + // + + QUnit.module('notify enumerable observers', { + setup: function () { + obj = DummyEnum.create(); + + observer = _emberRuntimeSystemObject.default.extend({ + enumerableWillChange: function () { + equal(this._before, null); // should only call once + this._before = Array.prototype.slice.call(arguments); + }, + + enumerableDidChange: function () { + equal(this._after, null); // should only call once + this._after = Array.prototype.slice.call(arguments); + } + }).create({ + _before: null, + _after: null + }); + + obj.addEnumerableObserver(observer); + }, + + teardown: function () { + obj = observer = null; + } + }); + + QUnit.test('should notify enumerable observers when called with no params', function () { + obj.enumerableContentWillChange(); + deepEqual(observer._before, [obj, null, null]); + + obj.enumerableContentDidChange(); + deepEqual(observer._after, [obj, null, null]); + }); + + // API variation that included items only + QUnit.test('should notify when called with same length items', function () { + var added = ['foo']; + var removed = ['bar']; + + obj.enumerableContentWillChange(removed, added); + deepEqual(observer._before, [obj, removed, added]); + + obj.enumerableContentDidChange(removed, added); + deepEqual(observer._after, [obj, removed, added]); + }); + + QUnit.test('should notify when called with diff length items', function () { + var added = ['foo', 'baz']; + var removed = ['bar']; + + obj.enumerableContentWillChange(removed, added); + deepEqual(observer._before, [obj, removed, added]); + + obj.enumerableContentDidChange(removed, added); + deepEqual(observer._after, [obj, removed, added]); + }); + + QUnit.test('should not notify when passed with indexes only', function () { + obj.enumerableContentWillChange(1, 2); + deepEqual(observer._before, [obj, 1, 2]); + + obj.enumerableContentDidChange(1, 2); + deepEqual(observer._after, [obj, 1, 2]); + }); + + QUnit.test('removing enumerable observer should disable', function () { + obj.removeEnumerableObserver(observer); + obj.enumerableContentWillChange(); + deepEqual(observer._before, null); + + obj.enumerableContentDidChange(); + deepEqual(observer._after, null); + }); +}); +enifed('ember-runtime/tests/mixins/enumerable_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/mixins'); + test('ember-runtime/tests/mixins/enumerable_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/mixins/enumerable_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/mixins/enumerable_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/mixins'); + QUnit.test('ember-runtime/tests/mixins/enumerable_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/mixins/enumerable_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/mixins/freezable_test', ['exports', 'ember-runtime/system/object', 'ember-runtime/mixins/freezable'], function (exports, _emberRuntimeSystemObject, _emberRuntimeMixinsFreezable) { + 'use strict'; + + QUnit.module('Ember.Freezable'); + + QUnit.test('should be deprecated', function () { + expectDeprecation('`Ember.Freezable` is deprecated, use `Object.freeze` instead.'); + _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsFreezable.Freezable).create(); + }); +}); +enifed('ember-runtime/tests/mixins/freezable_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/mixins'); + test('ember-runtime/tests/mixins/freezable_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/mixins/freezable_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/mixins/freezable_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/mixins'); + QUnit.test('ember-runtime/tests/mixins/freezable_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/mixins/freezable_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/mixins/mutable_array_test', ['exports', 'ember-metal', 'ember-runtime/tests/suites/mutable_array', 'ember-runtime/mixins/mutable_array', 'ember-runtime/system/object', 'ember-runtime/system/native_array', 'ember-runtime/mixins/array'], function (exports, _emberMetal, _emberRuntimeTestsSuitesMutable_array, _emberRuntimeMixinsMutable_array, _emberRuntimeSystemObject, _emberRuntimeSystemNative_array, _emberRuntimeMixinsArray) { + 'use strict'; + + /* + Implement a basic fake mutable array. This validates that any non-native + enumerable can impl this API. + */ + var TestMutableArray = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsMutable_array.default, { + + _content: null, + + init: function () { + var ary = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; + + this._content = _emberRuntimeSystemNative_array.A(ary); + }, + + replace: function (idx, amt, objects) { + var args = objects ? objects.slice() : []; + var removeAmt = amt; + var addAmt = args.length; + + _emberRuntimeMixinsArray.arrayContentWillChange(this, idx, removeAmt, addAmt); + + args.unshift(amt); + args.unshift(idx); + this._content.splice.apply(this._content, args); + _emberRuntimeMixinsArray.arrayContentDidChange(this, idx, removeAmt, addAmt); + return this; + }, + + objectAt: function (idx) { + return this._content[idx]; + }, + + length: _emberMetal.computed(function () { + return this._content.length; + }), + + slice: function () { + return this._content.slice(); + } + + }); + + _emberRuntimeTestsSuitesMutable_array.default.extend({ + + name: 'Basic Mutable Array', + + newObject: function (ary) { + ary = ary ? ary.slice() : this.newFixture(3); + return new TestMutableArray(ary); + }, + + // allows for testing of the basic enumerable after an internal mutation + mutate: function (obj) { + obj.addObject(this.getFixture(1)[0]); + }, + + toArray: function (obj) { + return obj.slice(); + } + + }).run(); +}); +enifed('ember-runtime/tests/mixins/mutable_array_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/mixins'); + test('ember-runtime/tests/mixins/mutable_array_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/mixins/mutable_array_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/mixins/mutable_array_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/mixins'); + QUnit.test('ember-runtime/tests/mixins/mutable_array_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/mixins/mutable_array_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/mixins/mutable_enumerable_test', ['exports', 'ember-runtime/tests/suites/mutable_enumerable', 'ember-runtime/mixins/mutable_enumerable', 'ember-runtime/system/object', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesMutable_enumerable, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeSystemObject, _emberMetal) { + 'use strict'; + + /* + Implement a basic fake mutable array. This validates that any non-native + enumerable can impl this API. + */ + var TestMutableEnumerable = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsMutable_enumerable.default, { + _content: null, + + addObject: function (obj) { + if (this._content.indexOf(obj) >= 0) { + return this; + } + + this.enumerableContentWillChange(null, [obj]); + this._content.push(obj); + this.enumerableContentDidChange(null, [obj]); + }, + + removeObject: function (obj) { + var idx = this._content.indexOf(obj); + if (idx < 0) { + return this; + } + + this.enumerableContentWillChange([obj], null); + this._content.splice(idx, 1); + this.enumerableContentDidChange([obj], null); + return this; + }, + + init: function (ary) { + this._content = ary || []; + }, + + nextObject: function (idx) { + return idx >= _emberMetal.get(this, 'length') ? undefined : this._content[idx]; + }, + + length: _emberMetal.computed(function () { + return this._content.length; + }), + + slice: function () { + return this._content.slice(); + } + }); + + _emberRuntimeTestsSuitesMutable_enumerable.default.extend({ + name: 'Basic Mutable Array', + + newObject: function (ary) { + ary = ary ? ary.slice() : this.newFixture(3); + return new TestMutableEnumerable(ary); + }, + + // allows for testing of the basic enumerable after an internal mutation + mutate: function (obj) { + obj.addObject(this.getFixture(1)[0]); + }, + + toArray: function (obj) { + return obj.slice(); + } + }).run(); +}); +enifed('ember-runtime/tests/mixins/mutable_enumerable_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/mixins'); + test('ember-runtime/tests/mixins/mutable_enumerable_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/mixins/mutable_enumerable_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/mixins/mutable_enumerable_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/mixins'); + QUnit.test('ember-runtime/tests/mixins/mutable_enumerable_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/mixins/mutable_enumerable_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/mixins/observable_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject) { + 'use strict'; + + QUnit.module('mixins/observable'); + + QUnit.test('should be able to use getProperties to get a POJO of provided keys', function () { + var obj = _emberRuntimeSystemObject.default.create({ + firstName: 'Steve', + lastName: 'Jobs', + companyName: 'Apple, Inc.' + }); + + var pojo = obj.getProperties('firstName', 'lastName'); + equal('Steve', pojo.firstName); + equal('Jobs', pojo.lastName); + }); + + QUnit.test('should be able to use getProperties with array parameter to get a POJO of provided keys', function () { + var obj = _emberRuntimeSystemObject.default.create({ + firstName: 'Steve', + lastName: 'Jobs', + companyName: 'Apple, Inc.' + }); + + var pojo = obj.getProperties(['firstName', 'lastName']); + equal('Steve', pojo.firstName); + equal('Jobs', pojo.lastName); + }); + + QUnit.test('should be able to use setProperties to set multiple properties at once', function () { + var obj = _emberRuntimeSystemObject.default.create({ + firstName: 'Steve', + lastName: 'Jobs', + companyName: 'Apple, Inc.' + }); + + obj.setProperties({ firstName: 'Tim', lastName: 'Cook' }); + equal('Tim', obj.get('firstName')); + equal('Cook', obj.get('lastName')); + }); + + _internalTestHelpers.testBoth('calling setProperties completes safely despite exceptions', function (get, set) { + var exc = new Error('Something unexpected happened!'); + var obj = _emberRuntimeSystemObject.default.extend({ + companyName: _emberMetal.computed({ + get: function () { + return 'Apple, Inc.'; + }, + set: function (key, value) { + throw exc; + } + }) + }).create({ + firstName: 'Steve', + lastName: 'Jobs' + }); + + var firstNameChangedCount = 0; + + _emberMetal.addObserver(obj, 'firstName', function () { + return firstNameChangedCount++; + }); + + try { + obj.setProperties({ + firstName: 'Tim', + lastName: 'Cook', + companyName: 'Fruit Co., Inc.' + }); + } catch (err) { + if (err !== exc) { + throw err; + } + } + + equal(firstNameChangedCount, 1, 'firstName should have fired once'); + }); + + _internalTestHelpers.testBoth('should be able to retrieve cached values of computed properties without invoking the computed property', function (get) { + var obj = _emberRuntimeSystemObject.default.extend({ + foo: _emberMetal.computed(function () { + return 'foo'; + }) + }).create({ + bar: 'bar' + }); + + equal(obj.cacheFor('foo'), undefined, 'should return undefined if no value has been cached'); + get(obj, 'foo'); + + equal(get(obj, 'foo'), 'foo', 'precond - should cache the value'); + equal(obj.cacheFor('foo'), 'foo', 'should return the cached value after it is invoked'); + + equal(obj.cacheFor('bar'), undefined, 'returns undefined if the value is not a computed property'); + }); + + QUnit.test('incrementProperty should work even if value is number in string', function () { + var obj = _emberRuntimeSystemObject.default.create({ + age: '24' + }); + obj.incrementProperty('age'); + equal(25, obj.get('age')); + }); +}); +enifed('ember-runtime/tests/mixins/observable_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/mixins'); + test('ember-runtime/tests/mixins/observable_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/mixins/observable_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/mixins/observable_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/mixins'); + QUnit.test('ember-runtime/tests/mixins/observable_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/mixins/observable_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/mixins/promise_proxy_test', ['exports', 'ember-metal', 'ember-runtime/system/object_proxy', 'ember-runtime/mixins/promise_proxy', 'ember-runtime/ext/rsvp', 'rsvp'], function (exports, _emberMetal, _emberRuntimeSystemObject_proxy, _emberRuntimeMixinsPromise_proxy, _emberRuntimeExtRsvp, _rsvp) { + 'use strict'; + + var ObjectPromiseProxy = undefined; + + QUnit.test('present on ember namespace', function () { + ok(_emberRuntimeMixinsPromise_proxy.default, 'expected PromiseProxyMixin to exist'); + }); + + QUnit.module('Ember.PromiseProxy - ObjectProxy', { + setup: function () { + ObjectPromiseProxy = _emberRuntimeSystemObject_proxy.default.extend(_emberRuntimeMixinsPromise_proxy.default); + }, + + teardown: function () { + _rsvp.on('error', _emberRuntimeExtRsvp.onerrorDefault); + } + }); + + QUnit.test('no promise, invoking then should raise', function () { + var proxy = ObjectPromiseProxy.create(); + + throws(function () { + proxy.then(function () { + return this; + }, function () { + return this; + }); + }, new RegExp('PromiseProxy\'s promise must be set')); + }); + + QUnit.test('fulfillment', function () { + var value = { + firstName: 'stef', + lastName: 'penner' + }; + + var deferred = _rsvp.defer(); + + var proxy = ObjectPromiseProxy.create({ + promise: deferred.promise + }); + + var didFulfillCount = 0; + var didRejectCount = 0; + + proxy.then(function () { + return didFulfillCount++; + }, function () { + return didRejectCount++; + }); + + equal(_emberMetal.get(proxy, 'content'), undefined, 'expects the proxy to have no content'); + equal(_emberMetal.get(proxy, 'reason'), undefined, 'expects the proxy to have no reason'); + equal(_emberMetal.get(proxy, 'isPending'), true, 'expects the proxy to indicate that it is loading'); + equal(_emberMetal.get(proxy, 'isSettled'), false, 'expects the proxy to indicate that it is not settled'); + equal(_emberMetal.get(proxy, 'isRejected'), false, 'expects the proxy to indicate that it is not rejected'); + equal(_emberMetal.get(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled'); + + equal(didFulfillCount, 0, 'should not yet have been fulfilled'); + equal(didRejectCount, 0, 'should not yet have been rejected'); + + _emberMetal.run(deferred, 'resolve', value); + + equal(didFulfillCount, 1, 'should have been fulfilled'); + equal(didRejectCount, 0, 'should not have been rejected'); + + equal(_emberMetal.get(proxy, 'content'), value, 'expects the proxy to have content'); + equal(_emberMetal.get(proxy, 'reason'), undefined, 'expects the proxy to still have no reason'); + equal(_emberMetal.get(proxy, 'isPending'), false, 'expects the proxy to indicate that it is no longer loading'); + equal(_emberMetal.get(proxy, 'isSettled'), true, 'expects the proxy to indicate that it is settled'); + equal(_emberMetal.get(proxy, 'isRejected'), false, 'expects the proxy to indicate that it is not rejected'); + equal(_emberMetal.get(proxy, 'isFulfilled'), true, 'expects the proxy to indicate that it is fulfilled'); + + _emberMetal.run(deferred, 'resolve', value); + + equal(didFulfillCount, 1, 'should still have been only fulfilled once'); + equal(didRejectCount, 0, 'should still not have been rejected'); + + _emberMetal.run(deferred, 'reject', value); + + equal(didFulfillCount, 1, 'should still have been only fulfilled once'); + equal(didRejectCount, 0, 'should still not have been rejected'); + + equal(_emberMetal.get(proxy, 'content'), value, 'expects the proxy to have still have same content'); + equal(_emberMetal.get(proxy, 'reason'), undefined, 'expects the proxy still to have no reason'); + equal(_emberMetal.get(proxy, 'isPending'), false, 'expects the proxy to indicate that it is no longer loading'); + equal(_emberMetal.get(proxy, 'isSettled'), true, 'expects the proxy to indicate that it is settled'); + equal(_emberMetal.get(proxy, 'isRejected'), false, 'expects the proxy to indicate that it is not rejected'); + equal(_emberMetal.get(proxy, 'isFulfilled'), true, 'expects the proxy to indicate that it is fulfilled'); + + // rest of the promise semantics are tested in directly in RSVP + }); + + QUnit.test('rejection', function () { + var reason = new Error('failure'); + var deferred = _rsvp.defer(); + var proxy = ObjectPromiseProxy.create({ + promise: deferred.promise + }); + + var didFulfillCount = 0; + var didRejectCount = 0; + + proxy.then(function () { + return didFulfillCount++; + }, function () { + return didRejectCount++; + }); + + equal(_emberMetal.get(proxy, 'content'), undefined, 'expects the proxy to have no content'); + equal(_emberMetal.get(proxy, 'reason'), undefined, 'expects the proxy to have no reason'); + equal(_emberMetal.get(proxy, 'isPending'), true, 'expects the proxy to indicate that it is loading'); + equal(_emberMetal.get(proxy, 'isSettled'), false, 'expects the proxy to indicate that it is not settled'); + equal(_emberMetal.get(proxy, 'isRejected'), false, 'expects the proxy to indicate that it is not rejected'); + equal(_emberMetal.get(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled'); + + equal(didFulfillCount, 0, 'should not yet have been fulfilled'); + equal(didRejectCount, 0, 'should not yet have been rejected'); + + _emberMetal.run(deferred, 'reject', reason); + + equal(didFulfillCount, 0, 'should not yet have been fulfilled'); + equal(didRejectCount, 1, 'should have been rejected'); + + equal(_emberMetal.get(proxy, 'content'), undefined, 'expects the proxy to have no content'); + equal(_emberMetal.get(proxy, 'reason'), reason, 'expects the proxy to have a reason'); + equal(_emberMetal.get(proxy, 'isPending'), false, 'expects the proxy to indicate that it is not longer loading'); + equal(_emberMetal.get(proxy, 'isSettled'), true, 'expects the proxy to indicate that it is settled'); + equal(_emberMetal.get(proxy, 'isRejected'), true, 'expects the proxy to indicate that it is rejected'); + equal(_emberMetal.get(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled'); + + _emberMetal.run(deferred, 'reject', reason); + + equal(didFulfillCount, 0, 'should stll not yet have been fulfilled'); + equal(didRejectCount, 1, 'should still remain rejected'); + + _emberMetal.run(deferred, 'resolve', 1); + + equal(didFulfillCount, 0, 'should stll not yet have been fulfilled'); + equal(didRejectCount, 1, 'should still remain rejected'); + + equal(_emberMetal.get(proxy, 'content'), undefined, 'expects the proxy to have no content'); + equal(_emberMetal.get(proxy, 'reason'), reason, 'expects the proxy to have a reason'); + equal(_emberMetal.get(proxy, 'isPending'), false, 'expects the proxy to indicate that it is not longer loading'); + equal(_emberMetal.get(proxy, 'isSettled'), true, 'expects the proxy to indicate that it is settled'); + equal(_emberMetal.get(proxy, 'isRejected'), true, 'expects the proxy to indicate that it is rejected'); + equal(_emberMetal.get(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled'); + }); + + QUnit.test('unhandled rejects still propagate to RSVP.on(\'error\', ...) ', function () { + expect(1); + + _rsvp.on('error', onerror); + _rsvp.off('error', _emberRuntimeExtRsvp.onerrorDefault); + + var expectedReason = new Error('failure'); + var deferred = _rsvp.defer(); + + var proxy = ObjectPromiseProxy.create({ + promise: deferred.promise + }); + + proxy.get('promise'); + + function onerror(reason) { + equal(reason, expectedReason, 'expected reason'); + } + + _rsvp.on('error', onerror); + _rsvp.off('error', _emberRuntimeExtRsvp.onerrorDefault); + + _emberMetal.run(deferred, 'reject', expectedReason); + + _rsvp.on('error', _emberRuntimeExtRsvp.onerrorDefault); + _rsvp.off('error', onerror); + + _emberMetal.run(deferred, 'reject', expectedReason); + + _rsvp.on('error', _emberRuntimeExtRsvp.onerrorDefault); + _rsvp.off('error', onerror); + }); + + QUnit.test('should work with promise inheritance', function () { + function PromiseSubclass() { + _rsvp.Promise.apply(this, arguments); + } + + PromiseSubclass.prototype = Object.create(_rsvp.Promise.prototype); + PromiseSubclass.prototype.constructor = PromiseSubclass; + PromiseSubclass.cast = _rsvp.Promise.cast; + + var proxy = ObjectPromiseProxy.create({ + promise: new PromiseSubclass(function () {}) + }); + + ok(proxy.then() instanceof PromiseSubclass, 'promise proxy respected inheritance'); + }); + + QUnit.test('should reset isFulfilled and isRejected when promise is reset', function () { + var deferred = _emberRuntimeExtRsvp.default.defer(); + + var proxy = ObjectPromiseProxy.create({ + promise: deferred.promise + }); + + equal(_emberMetal.get(proxy, 'isPending'), true, 'expects the proxy to indicate that it is loading'); + equal(_emberMetal.get(proxy, 'isSettled'), false, 'expects the proxy to indicate that it is not settled'); + equal(_emberMetal.get(proxy, 'isRejected'), false, 'expects the proxy to indicate that it is not rejected'); + equal(_emberMetal.get(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled'); + + _emberMetal.run(deferred, 'resolve'); + + equal(_emberMetal.get(proxy, 'isPending'), false, 'expects the proxy to indicate that it is no longer loading'); + equal(_emberMetal.get(proxy, 'isSettled'), true, 'expects the proxy to indicate that it is settled'); + equal(_emberMetal.get(proxy, 'isRejected'), false, 'expects the proxy to indicate that it is not rejected'); + equal(_emberMetal.get(proxy, 'isFulfilled'), true, 'expects the proxy to indicate that it is fulfilled'); + + var anotherDeferred = _emberRuntimeExtRsvp.default.defer(); + proxy.set('promise', anotherDeferred.promise); + + equal(_emberMetal.get(proxy, 'isPending'), true, 'expects the proxy to indicate that it is loading'); + equal(_emberMetal.get(proxy, 'isSettled'), false, 'expects the proxy to indicate that it is not settled'); + equal(_emberMetal.get(proxy, 'isRejected'), false, 'expects the proxy to indicate that it is not rejected'); + equal(_emberMetal.get(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled'); + + _emberMetal.run(anotherDeferred, 'reject'); + + equal(_emberMetal.get(proxy, 'isPending'), false, 'expects the proxy to indicate that it is not longer loading'); + equal(_emberMetal.get(proxy, 'isSettled'), true, 'expects the proxy to indicate that it is settled'); + equal(_emberMetal.get(proxy, 'isRejected'), true, 'expects the proxy to indicate that it is rejected'); + equal(_emberMetal.get(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled'); + }); + + QUnit.test('should have content when isFulfilled is set', function () { + var deferred = _emberRuntimeExtRsvp.default.defer(); + + var proxy = ObjectPromiseProxy.create({ + promise: deferred.promise + }); + + proxy.addObserver('isFulfilled', function () { + return equal(_emberMetal.get(proxy, 'content'), true); + }); + + _emberMetal.run(deferred, 'resolve', true); + }); + + QUnit.test('should have reason when isRejected is set', function () { + var error = new Error('Y U REJECT?!?'); + var deferred = _emberRuntimeExtRsvp.default.defer(); + + var proxy = ObjectPromiseProxy.create({ + promise: deferred.promise + }); + + proxy.addObserver('isRejected', function () { + return equal(_emberMetal.get(proxy, 'reason'), error); + }); + + try { + _emberMetal.run(deferred, 'reject', error); + } catch (e) { + equal(e, error); + } + }); + + QUnit.test('should not error if promise is resolved after proxy has been destroyed', function () { + var deferred = _emberRuntimeExtRsvp.default.defer(); + + var proxy = ObjectPromiseProxy.create({ + promise: deferred.promise + }); + + proxy.then(function () {}, function () {}); + + _emberMetal.run(proxy, 'destroy'); + + _emberMetal.run(deferred, 'resolve', true); + + ok(true, 'resolving the promise after the proxy has been destroyed does not raise an error'); + }); + + QUnit.test('should not error if promise is rejected after proxy has been destroyed', function () { + var deferred = _emberRuntimeExtRsvp.default.defer(); + + var proxy = ObjectPromiseProxy.create({ + promise: deferred.promise + }); + + proxy.then(function () {}, function () {}); + + _emberMetal.run(proxy, 'destroy'); + + _emberMetal.run(deferred, 'reject', 'some reason'); + + ok(true, 'rejecting the promise after the proxy has been destroyed does not raise an error'); + }); + + QUnit.test('promise chain is not broken if promised is resolved after proxy has been destroyed', function () { + var deferred = _emberRuntimeExtRsvp.default.defer(); + var expectedValue = {}; + var receivedValue = undefined; + var didResolveCount = 0; + + var proxy = ObjectPromiseProxy.create({ + promise: deferred.promise + }); + + proxy.then(function (value) { + receivedValue = value; + didResolveCount++; + }, function () {}); + + _emberMetal.run(proxy, 'destroy'); + + _emberMetal.run(deferred, 'resolve', expectedValue); + + equal(didResolveCount, 1, 'callback called'); + equal(receivedValue, expectedValue, 'passed value is the value the promise was resolved with'); + }); + + QUnit.test('promise chain is not broken if promised is rejected after proxy has been destroyed', function () { + var deferred = _emberRuntimeExtRsvp.default.defer(); + var expectedReason = 'some reason'; + var receivedReason = undefined; + var didRejectCount = 0; + + var proxy = ObjectPromiseProxy.create({ + promise: deferred.promise + }); + + proxy.then(function () {}, function (reason) { + receivedReason = reason; + didRejectCount++; + }); + + _emberMetal.run(proxy, 'destroy'); + + _emberMetal.run(deferred, 'reject', expectedReason); + + equal(didRejectCount, 1, 'callback called'); + equal(receivedReason, expectedReason, 'passed reason is the reason the promise was rejected for'); + }); +}); +enifed('ember-runtime/tests/mixins/promise_proxy_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/mixins'); + test('ember-runtime/tests/mixins/promise_proxy_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/mixins/promise_proxy_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/mixins/promise_proxy_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/mixins'); + QUnit.test('ember-runtime/tests/mixins/promise_proxy_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/mixins/promise_proxy_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/mixins/target_action_support_test', ['exports', 'ember-environment', 'ember-runtime/system/object', 'ember-runtime/mixins/target_action_support'], function (exports, _emberEnvironment, _emberRuntimeSystemObject, _emberRuntimeMixinsTarget_action_support) { + 'use strict'; + + var originalLookup = _emberEnvironment.context.lookup; + var lookup = undefined; + + QUnit.module('TargetActionSupport', { + setup: function () { + _emberEnvironment.context.lookup = lookup = {}; + }, + teardown: function () { + _emberEnvironment.context.lookup = originalLookup; + } + }); + + QUnit.test('it should return false if no target or action are specified', function () { + expect(1); + + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsTarget_action_support.default).create(); + + ok(false === obj.triggerAction(), 'no target or action was specified'); + }); + + QUnit.test('it should support actions specified as strings', function () { + expect(2); + + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsTarget_action_support.default).create({ + target: _emberRuntimeSystemObject.default.create({ + anEvent: function () { + ok(true, 'anEvent method was called'); + } + }), + + action: 'anEvent' + }); + + ok(true === obj.triggerAction(), 'a valid target and action were specified'); + }); + + QUnit.test('it should invoke the send() method on objects that implement it', function () { + expect(3); + + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsTarget_action_support.default).create({ + target: _emberRuntimeSystemObject.default.create({ + send: function (evt, context) { + equal(evt, 'anEvent', 'send() method was invoked with correct event name'); + equal(context, obj, 'send() method was invoked with correct context'); + } + }), + + action: 'anEvent' + }); + + ok(true === obj.triggerAction(), 'a valid target and action were specified'); + }); + + QUnit.test('it should find targets specified using a property path', function () { + expect(2); + + var Test = {}; + lookup.Test = Test; + + Test.targetObj = _emberRuntimeSystemObject.default.create({ + anEvent: function () { + ok(true, 'anEvent method was called on global object'); + } + }); + + var myObj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsTarget_action_support.default).create({ + target: 'Test.targetObj', + action: 'anEvent' + }); + + ok(true === myObj.triggerAction(), 'a valid target and action were specified'); + }); + + QUnit.test('it should use an actionContext object specified as a property on the object', function () { + expect(2); + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsTarget_action_support.default).create({ + action: 'anEvent', + actionContext: {}, + target: _emberRuntimeSystemObject.default.create({ + anEvent: function (ctx) { + ok(obj.actionContext === ctx, 'anEvent method was called with the expected context'); + } + }) + }); + ok(true === obj.triggerAction(), 'a valid target and action were specified'); + }); + + QUnit.test('it should find an actionContext specified as a property path', function () { + expect(2); + + var Test = {}; + lookup.Test = Test; + Test.aContext = {}; + + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsTarget_action_support.default).create({ + action: 'anEvent', + actionContext: 'Test.aContext', + target: _emberRuntimeSystemObject.default.create({ + anEvent: function (ctx) { + ok(Test.aContext === ctx, 'anEvent method was called with the expected context'); + } + }) + }); + + ok(true === obj.triggerAction(), 'a valid target and action were specified'); + }); + + QUnit.test('it should use the target specified in the argument', function () { + expect(2); + var targetObj = _emberRuntimeSystemObject.default.create({ + anEvent: function () { + ok(true, 'anEvent method was called'); + } + }); + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsTarget_action_support.default).create({ + action: 'anEvent' + }); + + ok(true === obj.triggerAction({ target: targetObj }), 'a valid target and action were specified'); + }); + + QUnit.test('it should use the action specified in the argument', function () { + expect(2); + + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsTarget_action_support.default).create({ + target: _emberRuntimeSystemObject.default.create({ + anEvent: function () { + ok(true, 'anEvent method was called'); + } + }) + }); + ok(true === obj.triggerAction({ action: 'anEvent' }), 'a valid target and action were specified'); + }); + + QUnit.test('it should use the actionContext specified in the argument', function () { + expect(2); + var context = {}; + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsTarget_action_support.default).create({ + target: _emberRuntimeSystemObject.default.create({ + anEvent: function (ctx) { + ok(context === ctx, 'anEvent method was called with the expected context'); + } + }), + action: 'anEvent' + }); + + ok(true === obj.triggerAction({ actionContext: context }), 'a valid target and action were specified'); + }); + + QUnit.test('it should allow multiple arguments from actionContext', function () { + expect(3); + var param1 = 'someParam'; + var param2 = 'someOtherParam'; + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsTarget_action_support.default).create({ + target: _emberRuntimeSystemObject.default.create({ + anEvent: function (first, second) { + ok(first === param1, 'anEvent method was called with the expected first argument'); + ok(second === param2, 'anEvent method was called with the expected second argument'); + } + }), + action: 'anEvent' + }); + + ok(true === obj.triggerAction({ actionContext: [param1, param2] }), 'a valid target and action were specified'); + }); + + QUnit.test('it should use a null value specified in the actionContext argument', function () { + expect(2); + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsTarget_action_support.default).create({ + target: _emberRuntimeSystemObject.default.create({ + anEvent: function (ctx) { + ok(null === ctx, 'anEvent method was called with the expected context (null)'); + } + }), + action: 'anEvent' + }); + ok(true === obj.triggerAction({ actionContext: null }), 'a valid target and action were specified'); + }); +}); +enifed('ember-runtime/tests/mixins/target_action_support_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/mixins'); + test('ember-runtime/tests/mixins/target_action_support_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/mixins/target_action_support_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/mixins/target_action_support_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/mixins'); + QUnit.test('ember-runtime/tests/mixins/target_action_support_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/mixins/target_action_support_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/array', ['exports', 'ember-runtime/tests/suites/enumerable', 'ember-runtime/tests/suites/array/indexOf', 'ember-runtime/tests/suites/array/lastIndexOf', 'ember-runtime/tests/suites/array/objectAt', 'ember-runtime/tests/suites/array/includes', 'ember-runtime/mixins/array', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesEnumerable, _emberRuntimeTestsSuitesArrayIndexOf, _emberRuntimeTestsSuitesArrayLastIndexOf, _emberRuntimeTestsSuitesArrayObjectAt, _emberRuntimeTestsSuitesArrayIncludes, _emberRuntimeMixinsArray, _emberMetal) { + 'use strict'; + + var ObserverClass = _emberRuntimeTestsSuitesEnumerable.ObserverClass.extend({ + observeArray: function (obj) { + _emberRuntimeMixinsArray.addArrayObserver(obj, this); + return this; + }, + + stopObserveArray: function (obj) { + _emberRuntimeMixinsArray.removeArrayObserver(obj, this); + return this; + }, + + arrayWillChange: function () { + equal(this._before, null, 'should only call once'); + this._before = Array.prototype.slice.call(arguments); + }, + + arrayDidChange: function () { + equal(this._after, null, 'should only call once'); + this._after = Array.prototype.slice.call(arguments); + } + }); + + var ArrayTests = _emberRuntimeTestsSuitesEnumerable.EnumerableTests.extend({ + observerClass: ObserverClass + }); + + ArrayTests.ObserverClass = ObserverClass; + + ArrayTests.importModuleTests(_emberRuntimeTestsSuitesArrayIndexOf.default); + ArrayTests.importModuleTests(_emberRuntimeTestsSuitesArrayLastIndexOf.default); + ArrayTests.importModuleTests(_emberRuntimeTestsSuitesArrayObjectAt.default); + + if (true) { + ArrayTests.importModuleTests(_emberRuntimeTestsSuitesArrayIncludes.default); + } + + exports.ArrayTests = ArrayTests; + exports.ObserverClass = ObserverClass; +}); +enifed('ember-runtime/tests/suites/array.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites'); + test('ember-runtime/tests/suites/array.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/array.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/array.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites'); + QUnit.test('ember-runtime/tests/suites/array.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/array.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/array/includes', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('includes'); + + suite.test('includes returns correct value if startAt is positive', function () { + var data = this.newFixture(3); + var obj = this.newObject(data); + + equal(obj.includes(data[1], 1), true, 'should return true if included'); + equal(obj.includes(data[0], 1), false, 'should return false if not included'); + }); + + suite.test('includes returns correct value if startAt is negative', function () { + var data = this.newFixture(3); + var obj = this.newObject(data); + + equal(obj.includes(data[1], -2), true, 'should return true if included'); + equal(obj.includes(data[0], -2), false, 'should return false if not included'); + }); + + suite.test('includes returns true if startAt + length is still negative', function () { + var data = this.newFixture(1); + var obj = this.newObject(data); + + equal(obj.includes(data[0], -2), true, 'should return true if included'); + equal(obj.includes(this.newFixture(1), -2), false, 'should return false if not included'); + }); + + suite.test('includes returns false if startAt out of bounds', function () { + var data = this.newFixture(1); + var obj = this.newObject(data); + + equal(obj.includes(data[0], 2), false, 'should return false if startAt >= length'); + equal(obj.includes(this.newFixture(1), 2), false, 'should return false if startAt >= length'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/array/includes.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/array'); + test('ember-runtime/tests/suites/array/includes.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/array/includes.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/array/includes.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/array'); + QUnit.test('ember-runtime/tests/suites/array/includes.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/array/includes.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/array/indexOf', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('indexOf'); + + suite.test('should return index of object', function () { + var expected = this.newFixture(3); + var obj = this.newObject(expected); + var len = 3; + + for (var idx = 0; idx < len; idx++) { + equal(obj.indexOf(expected[idx]), idx, 'obj.indexOf(' + expected[idx] + ') should match idx'); + } + }); + + suite.test('should return -1 when requesting object not in index', function () { + var obj = this.newObject(this.newFixture(3)); + var foo = {}; + + equal(obj.indexOf(foo), -1, 'obj.indexOf(foo) should be < 0'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/array/indexOf.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/array'); + test('ember-runtime/tests/suites/array/indexOf.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/array/indexOf.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/array/indexOf.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/array'); + QUnit.test('ember-runtime/tests/suites/array/indexOf.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/array/indexOf.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/array/lastIndexOf', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('lastIndexOf'); + + suite.test('should return index of object\'s last occurrence', function () { + var expected = this.newFixture(3); + var obj = this.newObject(expected); + var len = 3; + + for (var idx = 0; idx < len; idx++) { + equal(obj.lastIndexOf(expected[idx]), idx, 'obj.lastIndexOf(' + expected[idx] + ') should match idx'); + } + }); + + suite.test('should return index of object\'s last occurrence even startAt search location is equal to length', function () { + var expected = this.newFixture(3); + var obj = this.newObject(expected); + var len = 3; + + for (var idx = 0; idx < len; idx++) { + equal(obj.lastIndexOf(expected[idx], len), idx, 'obj.lastIndexOfs(' + expected[idx] + ') should match idx'); + } + }); + + suite.test('should return index of object\'s last occurrence even startAt search location is greater than length', function () { + var expected = this.newFixture(3); + var obj = this.newObject(expected); + var len = 3; + + for (var idx = 0; idx < len; idx++) { + equal(obj.lastIndexOf(expected[idx], len + 1), idx, 'obj.lastIndexOf(' + expected[idx] + ') should match idx'); + } + }); + + suite.test('should return -1 when no match is found', function () { + var obj = this.newObject(this.newFixture(3)); + var foo = {}; + + equal(obj.lastIndexOf(foo), -1, 'obj.lastIndexOf(foo) should be -1'); + }); + + suite.test('should return -1 when no match is found even startAt search location is equal to length', function () { + var obj = this.newObject(this.newFixture(3)); + var foo = {}; + + equal(obj.lastIndexOf(foo, obj.length), -1, 'obj.lastIndexOf(foo) should be -1'); + }); + + suite.test('should return -1 when no match is found even startAt search location is greater than length', function () { + var obj = this.newObject(this.newFixture(3)); + var foo = {}; + + equal(obj.lastIndexOf(foo, obj.length + 1), -1, 'obj.lastIndexOf(foo) should be -1'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/array/lastIndexOf.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/array'); + test('ember-runtime/tests/suites/array/lastIndexOf.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/array/lastIndexOf.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/array/lastIndexOf.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/array'); + QUnit.test('ember-runtime/tests/suites/array/lastIndexOf.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/array/lastIndexOf.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/array/objectAt', ['exports', 'ember-runtime/tests/suites/suite', 'ember-runtime/mixins/array'], function (exports, _emberRuntimeTestsSuitesSuite, _emberRuntimeMixinsArray) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('objectAt'); + + suite.test('should return object at specified index', function () { + var expected = this.newFixture(3); + var obj = this.newObject(expected); + var len = expected.length; + + for (var idx = 0; idx < len; idx++) { + equal(_emberRuntimeMixinsArray.objectAt(obj, idx), expected[idx], 'obj.objectAt(' + idx + ') should match'); + } + }); + + suite.test('should return undefined when requesting objects beyond index', function () { + var obj = undefined; + + obj = this.newObject(this.newFixture(3)); + equal(_emberRuntimeMixinsArray.objectAt(obj, 5), undefined, 'should return undefined for obj.objectAt(5) when len = 3'); + + obj = this.newObject([]); + equal(_emberRuntimeMixinsArray.objectAt(obj, 0), undefined, 'should return undefined for obj.objectAt(0) when len = 0'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/array/objectAt.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/array'); + test('ember-runtime/tests/suites/array/objectAt.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/array/objectAt.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/array/objectAt.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/array'); + QUnit.test('ember-runtime/tests/suites/array/objectAt.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/array/objectAt.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/copyable', ['exports', 'ember-runtime/tests/suites/suite', 'ember-runtime/tests/suites/copyable/copy', 'ember-runtime/tests/suites/copyable/frozenCopy'], function (exports, _emberRuntimeTestsSuitesSuite, _emberRuntimeTestsSuitesCopyableCopy, _emberRuntimeTestsSuitesCopyableFrozenCopy) { + 'use strict'; + + var CopyableTests = _emberRuntimeTestsSuitesSuite.Suite.extend({ + + /* + __Required.__ You must implement this method to apply this mixin. + Must be able to create a new object for testing. + @returns {Object} object + */ + newObject: null, + + /* + __Required.__ You must implement this method to apply this mixin. + Compares the two passed in objects. Returns true if the two objects + are logically equivalent. + @param {Object} a + First object + @param {Object} b + Second object + @returns {Boolean} + */ + isEqual: null, + + /* + Set this to true if you expect the objects you test to be freezable. + The suite will verify that your objects actually match this. (i.e. if + you say you can't test freezable it will verify that your objects really + aren't freezable.) + @type Boolean + */ + shouldBeFreezable: false + + }); + + CopyableTests.importModuleTests(_emberRuntimeTestsSuitesCopyableCopy.default); + CopyableTests.importModuleTests(_emberRuntimeTestsSuitesCopyableFrozenCopy.default); + + exports.default = CopyableTests; +}); +enifed('ember-runtime/tests/suites/copyable.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites'); + test('ember-runtime/tests/suites/copyable.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/copyable.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/copyable.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites'); + QUnit.test('ember-runtime/tests/suites/copyable.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/copyable.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/copyable/copy', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('copy'); + + suite.test('should return an equivalent copy', function () { + var obj = this.newObject(); + var copy = obj.copy(); + ok(this.isEqual(obj, copy), 'old object and new object should be equivalent'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/copyable/copy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/copyable'); + test('ember-runtime/tests/suites/copyable/copy.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/copyable/copy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/copyable/copy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/copyable'); + QUnit.test('ember-runtime/tests/suites/copyable/copy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/copyable/copy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/copyable/frozenCopy', ['exports', 'ember-runtime/tests/suites/suite', 'ember-runtime/mixins/freezable', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberRuntimeMixinsFreezable, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('frozenCopy'); + + suite.test('frozen objects should return same instance', function () { + var obj = undefined, + copy = undefined; + + obj = this.newObject(); + if (_emberMetal.get(this, 'shouldBeFreezable')) { + expectDeprecation('`frozenCopy` is deprecated, use Object.freeze instead.'); + + ok(!_emberRuntimeMixinsFreezable.Freezable || _emberRuntimeMixinsFreezable.Freezable.detect(obj), 'object should be freezable'); + + copy = obj.frozenCopy(); + ok(this.isEqual(obj, copy), 'new copy should be equal'); + ok(_emberMetal.get(copy, 'isFrozen'), 'returned value should be frozen'); + + copy = obj.freeze().frozenCopy(); + equal(copy, obj, 'returns frozen object should be same'); + ok(_emberMetal.get(copy, 'isFrozen'), 'returned object should be frozen'); + } else { + ok(!_emberRuntimeMixinsFreezable.Freezable || !_emberRuntimeMixinsFreezable.Freezable.detect(obj), 'object should not be freezable'); + } + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/copyable/frozenCopy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/copyable'); + test('ember-runtime/tests/suites/copyable/frozenCopy.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/copyable/frozenCopy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/copyable/frozenCopy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/copyable'); + QUnit.test('ember-runtime/tests/suites/copyable/frozenCopy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/copyable/frozenCopy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable', ['exports', 'ember-utils', 'ember-runtime/tests/suites/suite', 'ember-runtime/system/object', 'ember-metal', 'ember-runtime/tests/suites/enumerable/any', 'ember-runtime/tests/suites/enumerable/is_any', 'ember-runtime/tests/suites/enumerable/compact', 'ember-runtime/tests/suites/enumerable/contains', 'ember-runtime/tests/suites/enumerable/includes', 'ember-runtime/tests/suites/enumerable/every', 'ember-runtime/tests/suites/enumerable/filter', 'ember-runtime/tests/suites/enumerable/find', 'ember-runtime/tests/suites/enumerable/firstObject', 'ember-runtime/tests/suites/enumerable/forEach', 'ember-runtime/tests/suites/enumerable/mapBy', 'ember-runtime/tests/suites/enumerable/invoke', 'ember-runtime/tests/suites/enumerable/lastObject', 'ember-runtime/tests/suites/enumerable/map', 'ember-runtime/tests/suites/enumerable/reduce', 'ember-runtime/tests/suites/enumerable/reject', 'ember-runtime/tests/suites/enumerable/sortBy', 'ember-runtime/tests/suites/enumerable/toArray', 'ember-runtime/tests/suites/enumerable/uniq', 'ember-runtime/tests/suites/enumerable/uniqBy', 'ember-runtime/tests/suites/enumerable/without'], function (exports, _emberUtils, _emberRuntimeTestsSuitesSuite, _emberRuntimeSystemObject, _emberMetal, _emberRuntimeTestsSuitesEnumerableAny, _emberRuntimeTestsSuitesEnumerableIs_any, _emberRuntimeTestsSuitesEnumerableCompact, _emberRuntimeTestsSuitesEnumerableContains, _emberRuntimeTestsSuitesEnumerableIncludes, _emberRuntimeTestsSuitesEnumerableEvery, _emberRuntimeTestsSuitesEnumerableFilter, _emberRuntimeTestsSuitesEnumerableFind, _emberRuntimeTestsSuitesEnumerableFirstObject, _emberRuntimeTestsSuitesEnumerableForEach, _emberRuntimeTestsSuitesEnumerableMapBy, _emberRuntimeTestsSuitesEnumerableInvoke, _emberRuntimeTestsSuitesEnumerableLastObject, _emberRuntimeTestsSuitesEnumerableMap, _emberRuntimeTestsSuitesEnumerableReduce, _emberRuntimeTestsSuitesEnumerableReject, _emberRuntimeTestsSuitesEnumerableSortBy, _emberRuntimeTestsSuitesEnumerableToArray, _emberRuntimeTestsSuitesEnumerableUniq, _emberRuntimeTestsSuitesEnumerableUniqBy, _emberRuntimeTestsSuitesEnumerableWithout) { + 'use strict'; + + var ObserverClass = _emberRuntimeSystemObject.default.extend({ + _keysBefore: null, + _keys: null, + _values: null, + _before: null, + _after: null, + + isEnabled: true, + + init: function () { + this._super.apply(this, arguments); + this.reset(); + }, + + propertyWillChange: function (target, key) { + if (this._keysBefore[key] === undefined) { + this._keysBefore[key] = 0; + } + this._keysBefore[key]++; + }, + + /* + Invoked when the property changes. Just records the parameters for + later analysis. + */ + propertyDidChange: function (target, key, value) { + if (this._keys[key] === undefined) { + this._keys[key] = 0; + } + this._keys[key]++; + this._values[key] = value; + }, + + /* + Resets the recorded results for another run. + @returns {Object} receiver + */ + reset: function () { + this._keysBefore = {}; + this._keys = {}; + this._values = {}; + this._before = null; + this._after = null; + return this; + }, + + observeBefore: function (obj) { + var keys = Array.prototype.slice.call(arguments, 1); + var loc = keys.length; + while (--loc >= 0) { + _emberMetal._addBeforeObserver(obj, keys[loc], this, 'propertyWillChange'); + } + + return this; + }, + + /* + Begins observing the passed key names on the passed object. Any changes + on the named properties will be recorded. + @param {Ember.Enumerable} obj + The enumerable to observe. + @returns {Object} receiver + */ + observe: function (obj) { + if (obj.addObserver) { + var keys = Array.prototype.slice.call(arguments, 1); + var loc = keys.length; + + while (--loc >= 0) { + obj.addObserver(keys[loc], this, 'propertyDidChange'); + } + } else { + this.isEnabled = false; + } + return this; + }, + + /* + Returns true if the passed key was invoked. If you pass a value as + well then validates that the values match. + @param {String} key + Key to validate + @param {Object} value + (Optional) value + @returns {Boolean} + */ + validate: function (key, value) { + if (!this.isEnabled) { + return true; + } + + if (!this._keys[key]) { + return false; + } + + if (arguments.length > 1) { + return this._values[key] === value; + } else { + return true; + } + }, + + /* + Returns times the before observer as invoked. + @param {String} key + Key to check + */ + timesCalledBefore: function (key) { + return this._keysBefore[key] || 0; + }, + + /* + Returns times the observer as invoked. + @param {String} key + Key to check + */ + timesCalled: function (key) { + return this._keys[key] || 0; + }, + + /* + begins acting as an enumerable observer. + */ + observeEnumerable: function (obj) { + obj.addEnumerableObserver(this); + return this; + }, + + stopObserveEnumerable: function (obj) { + obj.removeEnumerableObserver(this); + return this; + }, + + enumerableWillChange: function () { + equal(this._before, null, 'should only call once'); + this._before = Array.prototype.slice.call(arguments); + }, + + enumerableDidChange: function () { + equal(this._after, null, 'should only call once'); + this._after = Array.prototype.slice.call(arguments); + } + }); + + var EnumerableTests = _emberRuntimeTestsSuitesSuite.Suite.extend({ + /* + __Required.__ You must implement this method to apply this mixin. + Implement to return a new enumerable object for testing. Should accept + either no parameters, a single number (indicating the desired length of + the collection) or an array of objects. + @param {Array} content + An array of items to include in the enumerable optionally. + @returns {Ember.Enumerable} a new enumerable + */ + newObject: null, + + /* + Implement to return a set of new fixture strings that can be applied to + the enumerable. This may be passed into the newObject method. + @param {Number} count + The number of items required. + @returns {Array} array of strings + */ + newFixture: function (cnt) { + var ret = []; + while (--cnt >= 0) { + ret.push(_emberUtils.generateGuid()); + } + + return ret; + }, + + /* + Implement to return a set of new fixture objects that can be applied to + the enumerable. This may be passed into the newObject method. + @param {Number} cnt + The number of items required. + @returns {Array} array of objects + */ + newObjectsFixture: function (cnt) { + var ret = []; + var item = undefined; + while (--cnt >= 0) { + item = {}; + _emberUtils.guidFor(item); + ret.push(item); + } + return ret; + }, + + /* + __Required.__ You must implement this method to apply this mixin. + Implement accept an instance of the enumerable and return an array + containing the objects in the enumerable. This is used only for testing + so performance is not important. + @param {Ember.Enumerable} enumerable + The enumerable to convert. + @returns {Array} array of items + */ + toArray: null, + + /* + Implement this method if your object can mutate internally (even if it + does not support the MutableEnumerable API). The method should accept + an object of your desired type and modify it somehow. Suite tests will + use this to ensure that all appropriate caches, etc. clear when the + mutation occurs. + If you do not define this optional method, then mutation-related tests + will be skipped. + @param {Ember.Enumerable} enumerable + The enumerable to mutate + @returns {void} + */ + mutate: function () {}, + + /* + Becomes true when you define a new mutate() method, indicating that + mutation tests should run. This is calculated automatically. + @type Boolean + */ + canTestMutation: _emberMetal.computed(function () { + return this.mutate !== EnumerableTests.prototype.mutate; + }), + + /* + Invoked to actually run the test - overridden by mixins + */ + run: function () {}, + + /* + Creates a new observer object for testing. You can add this object as an + observer on an array and it will record results anytime it is invoked. + After running the test, call the validate() method on the observer to + validate the results. + */ + newObserver: function (obj) { + var ret = _emberMetal.get(this, 'observerClass').create(); + if (arguments.length > 0) { + ret.observeBefore.apply(ret, arguments); + } + + if (arguments.length > 0) { + ret.observe.apply(ret, arguments); + } + + return ret; + }, + + observerClass: ObserverClass + }); + + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableAny.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableIs_any.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableCompact.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableContains.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableEvery.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableFilter.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableFind.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableFirstObject.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableForEach.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableMapBy.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableInvoke.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableLastObject.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableMap.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableReduce.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableReject.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableSortBy.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableToArray.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableUniq.default); + + if (true) { + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableUniqBy.default); + } + + if (true) { + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableIncludes.default); + } + + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableWithout.default); + + exports.default = EnumerableTests; + exports.EnumerableTests = EnumerableTests; + exports.ObserverClass = ObserverClass; +}); +enifed('ember-runtime/tests/suites/enumerable.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites'); + test('ember-runtime/tests/suites/enumerable.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites'); + QUnit.test('ember-runtime/tests/suites/enumerable.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/any', ['exports', 'ember-runtime/tests/suites/suite', 'ember-runtime/system/native_array'], function (exports, _emberRuntimeTestsSuitesSuite, _emberRuntimeSystemNative_array) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + // .......................................................... + // any() + // + + suite.module('any'); + + suite.test('any should should invoke callback on each item as long as you return false', function () { + var obj = this.newObject(); + var ary = this.toArray(obj); + var found = []; + var result = undefined; + + result = obj.any(function (i) { + found.push(i); + return false; + }); + equal(result, false, 'return value of obj.any'); + deepEqual(found, ary, 'items passed during any() should match'); + }); + + suite.test('any should stop invoking when you return true', function () { + var obj = this.newObject(); + var ary = this.toArray(obj); + var cnt = ary.length - 2; + var exp = cnt; + var found = []; + var result = undefined; + + result = obj.any(function (i) { + found.push(i); + return --cnt <= 0; + }); + equal(result, true, 'return value of obj.any'); + equal(found.length, exp, 'should invoke proper number of times'); + deepEqual(found, ary.slice(0, -2), 'items passed during any() should match'); + }); + + suite.test('any should return true if any object matches the callback', function () { + var obj = _emberRuntimeSystemNative_array.A([0, 1, 2]); + var result = undefined; + + result = obj.any(function (i) { + return !!i; + }); + equal(result, true, 'return value of obj.any'); + }); + + suite.test('any should return false if no object matches the callback', function () { + var obj = _emberRuntimeSystemNative_array.A([0, null, false]); + var result = undefined; + + result = obj.any(function (i) { + return !!i; + }); + equal(result, false, 'return value of obj.any'); + }); + + suite.test('any should produce correct results even if the matching element is undefined', function () { + var obj = _emberRuntimeSystemNative_array.A([undefined]); + var result = undefined; + + result = obj.any(function (i) { + return true; + }); + equal(result, true, 'return value of obj.any'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/any.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/any.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/any.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/any.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/any.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/any.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/compact', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('compact'); + + suite.test('removes null and undefined values from enumerable', function () { + var obj = this.newObject([null, 1, false, '', undefined, 0, null]); + var ary = obj.compact(); + deepEqual(ary, [1, false, '', 0]); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/compact.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/compact.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/compact.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/compact.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/compact.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/compact.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/contains', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('contains'); + + suite.test('contains returns true if item is in enumerable', function () { + var data = this.newFixture(3); + var obj = this.newObject(data); + + if (true) { + expectDeprecation('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.'); + } + equal(obj.contains(data[1]), true, 'should return true if contained'); + }); + + suite.test('contains returns false if item is not in enumerable', function () { + var data = this.newFixture(1); + var obj = this.newObject(this.newFixture(3)); + + if (true) { + expectDeprecation('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.'); + } + equal(obj.contains(data[0]), false, 'should return false if not contained'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/contains.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/contains.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/contains.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/contains.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/contains.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/contains.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/every', ['exports', 'ember-runtime/system/object', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeSystemObject, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + // .......................................................... + // every() + // + + suite.module('every'); + + suite.test('every should should invoke callback on each item as long as you return true', function () { + var obj = this.newObject(); + var ary = this.toArray(obj); + var found = []; + var result = undefined; + + result = obj.every(function (i) { + found.push(i); + return true; + }); + equal(result, true, 'return value of obj.every'); + deepEqual(found, ary, 'items passed during every() should match'); + }); + + suite.test('every should stop invoking when you return false', function () { + var obj = this.newObject(); + var ary = this.toArray(obj); + var cnt = ary.length - 2; + var exp = cnt; + var found = []; + var result = undefined; + + result = obj.every(function (i) { + found.push(i); + return --cnt > 0; + }); + equal(result, false, 'return value of obj.every'); + equal(found.length, exp, 'should invoke proper number of times'); + deepEqual(found, ary.slice(0, -2), 'items passed during every() should match'); + }); + + // .......................................................... + // isEvery() + // + + suite.module('isEvery'); + + suite.test('should return true of every property matches', function () { + var obj = this.newObject([{ foo: 'foo', bar: 'BAZ' }, _emberRuntimeSystemObject.default.create({ foo: 'foo', bar: 'bar' })]); + + equal(obj.isEvery('foo', 'foo'), true, 'isEvery(foo)'); + equal(obj.isEvery('bar', 'bar'), false, 'isEvery(bar)'); + }); + + suite.test('should return true of every property is true', function () { + var obj = this.newObject([{ foo: 'foo', bar: true }, _emberRuntimeSystemObject.default.create({ foo: 'bar', bar: false })]); + + // different values - all eval to true + equal(obj.isEvery('foo'), true, 'isEvery(foo)'); + equal(obj.isEvery('bar'), false, 'isEvery(bar)'); + }); + + suite.test('should return true if every property matches null', function () { + var obj = this.newObject([{ foo: null, bar: 'BAZ' }, _emberRuntimeSystemObject.default.create({ foo: null, bar: null })]); + + equal(obj.isEvery('foo', null), true, 'isEvery(\'foo\', null)'); + equal(obj.isEvery('bar', null), false, 'isEvery(\'bar\', null)'); + }); + + suite.test('should return true if every property is undefined', function () { + var obj = this.newObject([{ foo: undefined, bar: 'BAZ' }, _emberRuntimeSystemObject.default.create({ bar: undefined })]); + + equal(obj.isEvery('foo', undefined), true, 'isEvery(\'foo\', undefined)'); + equal(obj.isEvery('bar', undefined), false, 'isEvery(\'bar\', undefined)'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/every.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/every.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/every.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/every.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/every.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/every.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/filter', ['exports', 'ember-runtime/system/object', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeSystemObject, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + // .......................................................... + // filter() + // + + suite.module('filter'); + + suite.test('filter should invoke on each item', function () { + var obj = this.newObject(); + var ary = this.toArray(obj); + var cnt = ary.length - 2; + var found = []; + var result = undefined; + + // return true on all but the last two + result = obj.filter(function (i) { + found.push(i); + return --cnt >= 0; + }); + deepEqual(found, ary, 'should have invoked on each item'); + deepEqual(result, ary.slice(0, -2), 'filtered array should exclude items'); + }); + + // .......................................................... + // filterBy() + // + + suite.module('filterBy'); + + suite.test('should filter based on object', function () { + var obj = undefined, + ary = undefined; + + ary = [{ foo: 'foo', bar: 'BAZ' }, _emberRuntimeSystemObject.default.create({ foo: 'foo', bar: 'bar' })]; + + obj = this.newObject(ary); + + deepEqual(obj.filterBy('foo', 'foo'), ary, 'filterBy(foo)'); + deepEqual(obj.filterBy('bar', 'bar'), [ary[1]], 'filterBy(bar)'); + }); + + suite.test('should include in result if property is true', function () { + var obj = undefined, + ary = undefined; + + ary = [{ foo: 'foo', bar: true }, _emberRuntimeSystemObject.default.create({ foo: 'bar', bar: false })]; + + obj = this.newObject(ary); + + // different values - all eval to true + deepEqual(obj.filterBy('foo'), ary, 'filterBy(foo)'); + deepEqual(obj.filterBy('bar'), [ary[0]], 'filterBy(bar)'); + }); + + suite.test('should filter on second argument if provided', function () { + var obj = undefined, + ary = undefined; + + ary = [{ name: 'obj1', foo: 3 }, _emberRuntimeSystemObject.default.create({ name: 'obj2', foo: 2 }), { name: 'obj3', foo: 2 }, _emberRuntimeSystemObject.default.create({ name: 'obj4', foo: 3 })]; + + obj = this.newObject(ary); + + deepEqual(obj.filterBy('foo', 3), [ary[0], ary[3]], 'filterBy(\'foo\', 3)\')'); + }); + + suite.test('should correctly filter null second argument', function () { + var obj = undefined, + ary = undefined; + + ary = [{ name: 'obj1', foo: 3 }, _emberRuntimeSystemObject.default.create({ name: 'obj2', foo: null }), { name: 'obj3', foo: null }, _emberRuntimeSystemObject.default.create({ name: 'obj4', foo: 3 })]; + + obj = this.newObject(ary); + + deepEqual(obj.filterBy('foo', null), [ary[1], ary[2]], 'filterBy(\'foo\', 3)\')'); + }); + + suite.test('should not return all objects on undefined second argument', function () { + var obj = undefined, + ary = undefined; + + ary = [{ name: 'obj1', foo: 3 }, _emberRuntimeSystemObject.default.create({ name: 'obj2', foo: 2 })]; + + obj = this.newObject(ary); + + deepEqual(obj.filterBy('foo', undefined), [], 'filterBy(\'foo\', 3)\')'); + }); + + suite.test('should correctly filter explicit undefined second argument', function () { + var obj = undefined, + ary = undefined; + + ary = [{ name: 'obj1', foo: 3 }, _emberRuntimeSystemObject.default.create({ name: 'obj2', foo: 3 }), { name: 'obj3', foo: undefined }, _emberRuntimeSystemObject.default.create({ name: 'obj4', foo: undefined }), { name: 'obj5' }, _emberRuntimeSystemObject.default.create({ name: 'obj6' })]; + + obj = this.newObject(ary); + + deepEqual(obj.filterBy('foo', undefined), ary.slice(2), 'filterBy(\'foo\', 3)\')'); + }); + + suite.test('should not match undefined properties without second argument', function () { + var obj = undefined, + ary = undefined; + + ary = [{ name: 'obj1', foo: 3 }, _emberRuntimeSystemObject.default.create({ name: 'obj2', foo: 3 }), { name: 'obj3', foo: undefined }, _emberRuntimeSystemObject.default.create({ name: 'obj4', foo: undefined }), { name: 'obj5' }, _emberRuntimeSystemObject.default.create({ name: 'obj6' })]; + + obj = this.newObject(ary); + + deepEqual(obj.filterBy('foo'), ary.slice(0, 2), 'filterBy(\'foo\', 3)\')'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/filter.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/filter.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/filter.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/filter.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/filter.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/filter.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/find', ['exports', 'ember-runtime/system/object', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeSystemObject, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + // .......................................................... + // find() + // + + suite.module('find'); + + suite.test('find should invoke callback on each item as long as you return false', function () { + var obj = this.newObject(); + var ary = this.toArray(obj); + var found = []; + var result = undefined; + + result = obj.find(function (i) { + found.push(i); + return false; + }); + equal(result, undefined, 'return value of obj.find'); + deepEqual(found, ary, 'items passed during find() should match'); + }); + + suite.test('every should stop invoking when you return true', function () { + var obj = this.newObject(); + var ary = this.toArray(obj); + var cnt = ary.length - 2; + var exp = cnt; + var found = []; + var result = undefined; + + result = obj.find(function (i) { + found.push(i); + return --cnt >= 0; + }); + equal(result, ary[exp - 1], 'return value of obj.find'); + equal(found.length, exp, 'should invoke proper number of times'); + deepEqual(found, ary.slice(0, -2), 'items passed during find() should match'); + }); + + // .......................................................... + // findBy() + // + + suite.module('findBy'); + + suite.test('should return first object of property matches', function () { + var ary = undefined, + obj = undefined; + + ary = [{ foo: 'foo', bar: 'BAZ' }, _emberRuntimeSystemObject.default.create({ foo: 'foo', bar: 'bar' })]; + + obj = this.newObject(ary); + + equal(obj.findBy('foo', 'foo'), ary[0], 'findBy(foo)'); + equal(obj.findBy('bar', 'bar'), ary[1], 'findBy(bar)'); + }); + + suite.test('should return first object with truthy prop', function () { + var ary = undefined, + obj = undefined; + + ary = [{ foo: 'foo', bar: false }, _emberRuntimeSystemObject.default.create({ foo: 'bar', bar: true })]; + + obj = this.newObject(ary); + + // different values - all eval to true + equal(obj.findBy('foo'), ary[0], 'findBy(foo)'); + equal(obj.findBy('bar'), ary[1], 'findBy(bar)'); + }); + + suite.test('should return first null property match', function () { + var ary = undefined, + obj = undefined; + + ary = [{ foo: null, bar: 'BAZ' }, _emberRuntimeSystemObject.default.create({ foo: null, bar: null })]; + + obj = this.newObject(ary); + + equal(obj.findBy('foo', null), ary[0], 'findBy(\'foo\', null)'); + equal(obj.findBy('bar', null), ary[1], 'findBy(\'bar\', null)'); + }); + + suite.test('should return first undefined property match', function () { + var ary = undefined, + obj = undefined; + + ary = [{ foo: undefined, bar: 'BAZ' }, _emberRuntimeSystemObject.default.create({})]; + + obj = this.newObject(ary); + + equal(obj.findBy('foo', undefined), ary[0], 'findBy(\'foo\', undefined)'); + equal(obj.findBy('bar', undefined), ary[1], 'findBy(\'bar\', undefined)'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/find.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/find.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/find.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/find.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/find.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/find.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/firstObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('firstObject'); + + suite.test('returns first item in enumerable', function () { + var obj = this.newObject(); + equal(_emberMetal.get(obj, 'firstObject'), this.toArray(obj)[0]); + }); + + suite.test('returns undefined if enumerable is empty', function () { + var obj = this.newObject([]); + equal(_emberMetal.get(obj, 'firstObject'), undefined); + }); + + suite.test('can not be set', function () { + var obj = this.newObject([]); + + equal(_emberMetal.get(obj, 'firstObject'), this.toArray(obj)[0]); + + throws(function () { + _emberMetal.set(obj, 'firstObject', 'foo!'); + }, /Cannot set read-only property "firstObject" on object/); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/firstObject.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/firstObject.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/firstObject.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/firstObject.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/firstObject.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/firstObject.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/forEach', ['exports', 'ember-utils', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberUtils, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('forEach'); + + suite.test('forEach should iterate over list', function () { + var obj = this.newObject(); + var ary = this.toArray(obj); + var found = []; + + obj.forEach(function (i) { + return found.push(i); + }); + deepEqual(found, ary, 'items passed during forEach should match'); + }); + + suite.test('forEach should iterate over list after mutation', function () { + if (_emberMetal.get(this, 'canTestMutation')) { + expect(0); + return; + } + + var obj = this.newObject(); + var ary = this.toArray(obj); + var found = []; + + obj.forEach(function (i) { + return found.push(i); + }); + deepEqual(found, ary, 'items passed during forEach should match'); + + this.mutate(obj); + ary = this.toArray(obj); + found = []; + + obj.forEach(function (i) { + return found.push(i); + }); + deepEqual(found, ary, 'items passed during forEach should match'); + }); + + suite.test('2nd target parameter', function () { + var _this = this; + + var obj = this.newObject(); + var target = this; + + obj.forEach(function () { + // ES6TODO: When transpiled we will end up with "use strict" which disables automatically binding to the global context. + // Therefore, the following test can never pass in strict mode unless we modify the `map` function implementation to + // use `Ember.lookup` if target is not specified. + // + // equal(guidFor(this), guidFor(global), 'should pass the global object as this if no context'); + }); + + obj.forEach(function () { + equal(_emberUtils.guidFor(_this), _emberUtils.guidFor(target), 'should pass target as this if context'); + }, target); + }); + + suite.test('callback params', function () { + var obj = this.newObject(); + var ary = this.toArray(obj); + var loc = 0; + + obj.forEach(function (item, idx, enumerable) { + equal(item, ary[loc], 'item param'); + equal(idx, loc, 'idx param'); + equal(_emberUtils.guidFor(enumerable), _emberUtils.guidFor(obj), 'enumerable param'); + loc++; + }); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/forEach.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/forEach.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/forEach.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/forEach.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/forEach.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/forEach.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/includes', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('includes'); + + suite.test('includes returns true if item is in enumerable', function () { + var data = this.newFixture(1); + var obj = this.newObject([].concat(data, [NaN, undefined, null])); + + equal(obj.includes(data[0]), true, 'should return true if included'); + equal(obj.includes(NaN), true, 'should return true if NaN included'); + equal(obj.includes(undefined), true, 'should return true if undefined included'); + equal(obj.includes(null), true, 'should return true if null included'); + }); + + suite.test('includes returns false if item is not in enumerable', function () { + var data = this.newFixture(1); + var obj = this.newObject([].concat(this.newFixture(3), [null])); + + equal(obj.includes(data[0]), false, 'should return false if not included'); + equal(obj.includes(undefined), false, 'should return false if undefined not included but null is included'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/includes.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/includes.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/includes.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/includes.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/includes.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/includes.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/invoke', ['exports', 'ember-runtime/system/object', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeSystemObject, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('invoke'); + + suite.test('invoke should call on each object that implements', function () { + var cnt = undefined, + ary = undefined, + obj = undefined; + + function F(amt) { + cnt += amt === undefined ? 1 : amt; + } + cnt = 0; + ary = [{ foo: F }, _emberRuntimeSystemObject.default.create({ foo: F }), + + // NOTE: does not impl foo - invoke should just skip + _emberRuntimeSystemObject.default.create({ bar: F }), { foo: F }]; + + obj = this.newObject(ary); + obj.invoke('foo'); + equal(cnt, 3, 'should have invoked 3 times'); + + cnt = 0; + obj.invoke('foo', 2); + equal(cnt, 6, 'should have invoked 3 times, passing param'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/invoke.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/invoke.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/invoke.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/invoke.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/invoke.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/invoke.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/is_any', ['exports', 'ember-runtime/system/object', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeSystemObject, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + // .......................................................... + // isAny() + // + + suite.module('isAny'); + + suite.test('should return true of any property matches', function () { + var obj = this.newObject([{ foo: 'foo', bar: 'BAZ' }, _emberRuntimeSystemObject.default.create({ foo: 'foo', bar: 'bar' })]); + + equal(obj.isAny('foo', 'foo'), true, 'isAny(foo)'); + equal(obj.isAny('bar', 'bar'), true, 'isAny(bar)'); + equal(obj.isAny('bar', 'BIFF'), false, 'isAny(BIFF)'); + }); + + suite.test('should return true of any property is true', function () { + var obj = this.newObject([{ foo: 'foo', bar: true }, _emberRuntimeSystemObject.default.create({ foo: 'bar', bar: false })]); + + // different values - all eval to true + equal(obj.isAny('foo'), true, 'isAny(foo)'); + equal(obj.isAny('bar'), true, 'isAny(bar)'); + equal(obj.isAny('BIFF'), false, 'isAny(biff)'); + }); + + suite.test('should return true if any property matches null', function () { + var obj = this.newObject([{ foo: null, bar: 'bar' }, _emberRuntimeSystemObject.default.create({ foo: 'foo', bar: null })]); + + equal(obj.isAny('foo', null), true, 'isAny(\'foo\', null)'); + equal(obj.isAny('bar', null), true, 'isAny(\'bar\', null)'); + }); + + suite.test('should return true if any property is undefined', function () { + var obj = this.newObject([{ foo: undefined, bar: 'bar' }, _emberRuntimeSystemObject.default.create({ foo: 'foo' })]); + + equal(obj.isAny('foo', undefined), true, 'isAny(\'foo\', undefined)'); + equal(obj.isAny('bar', undefined), true, 'isAny(\'bar\', undefined)'); + }); + + suite.test('should not match undefined properties without second argument', function () { + var obj = this.newObject([{ foo: undefined }, _emberRuntimeSystemObject.default.create({})]); + + equal(obj.isAny('foo'), false, 'isAny(\'foo\', undefined)'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/is_any.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/is_any.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/is_any.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/is_any.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/is_any.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/is_any.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/lastObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('lastObject'); + + suite.test('returns last item in enumerable', function () { + var obj = this.newObject(); + var ary = this.toArray(obj); + + equal(_emberMetal.get(obj, 'lastObject'), ary[ary.length - 1]); + }); + + suite.test('returns undefined if enumerable is empty', function () { + var obj = this.newObject([]); + + equal(_emberMetal.get(obj, 'lastObject'), undefined); + }); + + suite.test('can not be set', function () { + var obj = this.newObject(); + var ary = this.toArray(obj); + + equal(_emberMetal.get(obj, 'lastObject'), ary[ary.length - 1]); + + throws(function () { + _emberMetal.set(obj, 'lastObject', 'foo!'); + }, /Cannot set read-only property "lastObject" on object/); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/lastObject.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/lastObject.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/lastObject.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/lastObject.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/lastObject.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/lastObject.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/map', ['exports', 'ember-utils', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberUtils, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('map'); + + var mapFunc = function (item) { + return item ? item.toString() : null; + }; + + suite.test('map should iterate over list', function () { + var obj = this.newObject(); + var ary = this.toArray(obj).map(mapFunc); + var found = []; + + found = obj.map(mapFunc); + deepEqual(found, ary, 'mapped arrays should match'); + }); + + suite.test('map should iterate over list after mutation', function () { + if (_emberMetal.get(this, 'canTestMutation')) { + expect(0); + return; + } + + var obj = this.newObject(); + var ary = this.toArray(obj).map(mapFunc); + var found = undefined; + + found = obj.map(mapFunc); + deepEqual(found, ary, 'items passed during forEach should match'); + + this.mutate(obj); + ary = this.toArray(obj).map(mapFunc); + found = obj.map(mapFunc); + deepEqual(found, ary, 'items passed during forEach should match'); + }); + + suite.test('2nd target parameter', function () { + var _this = this; + + var obj = this.newObject(); + var target = this; + + obj.map(function () { + // ES6TODO: When transpiled we will end up with "use strict" which disables automatically binding to the global context. + // Therefore, the following test can never pass in strict mode unless we modify the `map` function implementation to + // use `Ember.lookup` if target is not specified. + // + // equal(guidFor(this), guidFor(global), 'should pass the global object as this if no context'); + }); + + obj.map(function () { + equal(_emberUtils.guidFor(_this), _emberUtils.guidFor(target), 'should pass target as this if context'); + }, target); + }); + + suite.test('callback params', function () { + var obj = this.newObject(); + var ary = this.toArray(obj); + var loc = 0; + + obj.map(function (item, idx, enumerable) { + equal(item, ary[loc], 'item param'); + equal(idx, loc, 'idx param'); + equal(_emberUtils.guidFor(enumerable), _emberUtils.guidFor(obj), 'enumerable param'); + loc++; + }); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/map.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/map.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/map.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/map.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/map.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/map.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/mapBy', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('mapBy'); + + suite.test('get value of each property', function () { + var obj = this.newObject([{ a: 1 }, { a: 2 }]); + equal(obj.mapBy('a').join(''), '12'); + }); + + suite.test('should work also through getEach alias', function () { + var obj = this.newObject([{ a: 1 }, { a: 2 }]); + equal(obj.getEach('a').join(''), '12'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/mapBy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/mapBy.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/mapBy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/mapBy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/mapBy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/mapBy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/reduce', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('reduce'); + + suite.test('collects a summary value from an enumeration', function () { + var obj = this.newObject([1, 2, 3]); + var res = obj.reduce(function (previousValue, item, index, enumerable) { + return previousValue + item; + }, 0); + equal(res, 6); + }); + + suite.test('passes index of item to callback', function () { + var obj = this.newObject([1, 2, 3]); + var res = obj.reduce(function (previousValue, item, index, enumerable) { + return previousValue + index; + }, 0); + equal(res, 3); + }); + + suite.test('passes enumerable object to callback', function () { + var obj = this.newObject([1, 2, 3]); + var res = obj.reduce(function (previousValue, item, index, enumerable) { + return enumerable; + }, 0); + equal(res, obj); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/reduce.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/reduce.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/reduce.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/reduce.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/reduce.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/reduce.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/reject', ['exports', 'ember-runtime/system/object', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeSystemObject, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + // .......................................................... + // reject() + // + + suite.module('reject'); + + suite.test('should reject any item that does not meet the condition', function () { + var obj = this.newObject([1, 2, 3, 4]); + var result = undefined; + + result = obj.reject(function (i) { + return i < 3; + }); + deepEqual(result, [3, 4], 'reject the correct items'); + }); + + suite.test('should be the inverse of filter', function () { + var obj = this.newObject([1, 2, 3, 4]); + var isEven = function (i) { + return i % 2 === 0; + }; + var filtered = undefined, + rejected = undefined; + + filtered = obj.filter(isEven); + rejected = obj.reject(isEven); + + deepEqual(filtered, [2, 4], 'filtered evens'); + deepEqual(rejected, [1, 3], 'rejected evens'); + }); + + // .......................................................... + // rejectBy() + // + + suite.module('rejectBy'); + + suite.test('should reject based on object', function () { + var obj = undefined, + ary = undefined; + + ary = [{ foo: 'foo', bar: 'BAZ' }, _emberRuntimeSystemObject.default.create({ foo: 'foo', bar: 'bar' })]; + + obj = this.newObject(ary); + + deepEqual(obj.rejectBy('foo', 'foo'), [], 'rejectBy(foo)'); + deepEqual(obj.rejectBy('bar', 'bar'), [ary[0]], 'rejectBy(bar)'); + }); + + suite.test('should include in result if property is false', function () { + var obj = undefined, + ary = undefined; + + ary = [{ foo: false, bar: true }, _emberRuntimeSystemObject.default.create({ foo: false, bar: false })]; + + obj = this.newObject(ary); + + deepEqual(obj.rejectBy('foo'), ary, 'rejectBy(foo)'); + deepEqual(obj.rejectBy('bar'), [ary[1]], 'rejectBy(bar)'); + }); + + suite.test('should reject on second argument if provided', function () { + var obj = undefined, + ary = undefined; + + ary = [{ name: 'obj1', foo: 3 }, _emberRuntimeSystemObject.default.create({ name: 'obj2', foo: 2 }), { name: 'obj3', foo: 2 }, _emberRuntimeSystemObject.default.create({ name: 'obj4', foo: 3 })]; + + obj = this.newObject(ary); + + deepEqual(obj.rejectBy('foo', 3), [ary[1], ary[2]], 'rejectBy(\'foo\', 3)\')'); + }); + + suite.test('should correctly reject null second argument', function () { + var obj = undefined, + ary = undefined; + + ary = [{ name: 'obj1', foo: 3 }, _emberRuntimeSystemObject.default.create({ name: 'obj2', foo: null }), { name: 'obj3', foo: null }, _emberRuntimeSystemObject.default.create({ name: 'obj4', foo: 3 })]; + + obj = this.newObject(ary); + + deepEqual(obj.rejectBy('foo', null), [ary[0], ary[3]], 'rejectBy(\'foo\', null)\')'); + }); + + suite.test('should correctly reject undefined second argument', function () { + var obj = undefined, + ary = undefined; + + ary = [{ name: 'obj1', foo: 3 }, _emberRuntimeSystemObject.default.create({ name: 'obj2', foo: 2 })]; + + obj = this.newObject(ary); + + deepEqual(obj.rejectBy('bar', undefined), [], 'rejectBy(\'bar\', undefined)\')'); + }); + + suite.test('should correctly reject explicit undefined second argument', function () { + var obj = undefined, + ary = undefined; + + ary = [{ name: 'obj1', foo: 3 }, _emberRuntimeSystemObject.default.create({ name: 'obj2', foo: 3 }), { name: 'obj3', foo: undefined }, _emberRuntimeSystemObject.default.create({ name: 'obj4', foo: undefined }), { name: 'obj5' }, _emberRuntimeSystemObject.default.create({ name: 'obj6' })]; + + obj = this.newObject(ary); + + deepEqual(obj.rejectBy('foo', undefined), ary.slice(0, 2), 'rejectBy(\'foo\', undefined)\')'); + }); + + suite.test('should match undefined, null, or false properties without second argument', function () { + var obj = undefined, + ary = undefined; + + ary = [{ name: 'obj1', foo: 3 }, _emberRuntimeSystemObject.default.create({ name: 'obj2', foo: 3 }), { name: 'obj3', foo: undefined }, _emberRuntimeSystemObject.default.create({ name: 'obj4', foo: undefined }), { name: 'obj5' }, _emberRuntimeSystemObject.default.create({ name: 'obj6' }), { name: 'obj7', foo: null }, _emberRuntimeSystemObject.default.create({ name: 'obj8', foo: null }), { name: 'obj9', foo: false }, _emberRuntimeSystemObject.default.create({ name: 'obj10', foo: false })]; + + obj = this.newObject(ary); + + deepEqual(obj.rejectBy('foo'), ary.slice(2), 'rejectBy(\'foo\')\')'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/reject.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/reject.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/reject.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/reject.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/reject.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/reject.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/sortBy', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('sortBy'); + + suite.test('sort by value of property', function () { + var obj = this.newObject([{ a: 2 }, { a: 1 }]); + var sorted = obj.sortBy('a'); + + equal(_emberMetal.get(sorted[0], 'a'), 1); + equal(_emberMetal.get(sorted[1], 'a'), 2); + }); + + suite.test('supports multiple propertyNames', function () { + var obj = this.newObject([{ a: 1, b: 2 }, { a: 1, b: 1 }]); + var sorted = obj.sortBy('a', 'b'); + + equal(_emberMetal.get(sorted[0], 'b'), 1); + equal(_emberMetal.get(sorted[1], 'b'), 2); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/sortBy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/sortBy.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/sortBy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/sortBy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/sortBy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/sortBy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/toArray', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('toArray'); + + suite.test('toArray should convert to an array', function () { + var obj = this.newObject(); + deepEqual(obj.toArray(), this.toArray(obj)); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/toArray.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/toArray.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/toArray.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/toArray.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/toArray.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/toArray.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/uniq', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('uniq'); + + suite.test('should return new instance with duplicates removed', function () { + var before = undefined, + after = undefined, + obj = undefined, + ret = undefined; + + after = this.newFixture(3); + before = [after[0], after[1], after[2], after[1], after[0]]; + obj = this.newObject(before); + before = obj.toArray(); // in case of set before will be different... + + ret = obj.uniq(); + deepEqual(this.toArray(ret), after, 'should have removed item'); + deepEqual(this.toArray(obj), before, 'should not have changed original'); + }); + + suite.test('should return duplicate of same content if no duplicates found', function () { + var item = undefined, + obj = undefined, + ret = undefined; + obj = this.newObject(this.newFixture(3)); + ret = obj.uniq(item); + ok(ret !== obj, 'should not be same object'); + deepEqual(this.toArray(ret), this.toArray(obj), 'should be the same content'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/uniq.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/uniq.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/uniq.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/uniq.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/uniq.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/uniq.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/uniqBy', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('uniqBy'); + + if (true) { + suite.test('should return new instance with duplicates removed', function () { + var numbers = this.newObject([{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 1, value: 'one' }]); + deepEqual(numbers.uniqBy('id'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }]); + }); + } + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/uniqBy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/uniqBy.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/uniqBy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/uniqBy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/uniqBy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/uniqBy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/without', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('without'); + + suite.test('should return new instance with item removed', function () { + var before = undefined, + after = undefined, + obj = undefined, + ret = undefined; + + before = this.newFixture(3); + after = [before[0], before[2]]; + obj = this.newObject(before); + + ret = obj.without(before[1]); + deepEqual(this.toArray(ret), after, 'should have removed item'); + deepEqual(this.toArray(obj), before, 'should not have changed original'); + }); + + if (true) { + suite.test('should remove NaN value', function () { + var before = undefined, + after = undefined, + obj = undefined, + ret = undefined; + + before = [].concat(this.newFixture(2), [NaN]); + after = [before[0], before[1]]; + obj = this.newObject(before); + + ret = obj.without(NaN); + deepEqual(this.toArray(ret), after, 'should have removed item'); + }); + } + + suite.test('should return same instance if object not found', function () { + var item = undefined, + obj = undefined, + ret = undefined; + + item = this.newFixture(1)[0]; + obj = this.newObject(this.newFixture(3)); + + ret = obj.without(item); + equal(ret, obj, 'should be same instance'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/without.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/without.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/without.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/without.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/without.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/without.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array', ['exports', 'ember-runtime/tests/suites/array', 'ember-runtime/tests/suites/mutable_array/insertAt', 'ember-runtime/tests/suites/mutable_array/popObject', 'ember-runtime/tests/suites/mutable_array/pushObject', 'ember-runtime/tests/suites/mutable_array/pushObjects', 'ember-runtime/tests/suites/mutable_array/removeAt', 'ember-runtime/tests/suites/mutable_array/replace', 'ember-runtime/tests/suites/mutable_array/shiftObject', 'ember-runtime/tests/suites/mutable_array/unshiftObject', 'ember-runtime/tests/suites/mutable_array/reverseObjects'], function (exports, _emberRuntimeTestsSuitesArray, _emberRuntimeTestsSuitesMutable_arrayInsertAt, _emberRuntimeTestsSuitesMutable_arrayPopObject, _emberRuntimeTestsSuitesMutable_arrayPushObject, _emberRuntimeTestsSuitesMutable_arrayPushObjects, _emberRuntimeTestsSuitesMutable_arrayRemoveAt, _emberRuntimeTestsSuitesMutable_arrayReplace, _emberRuntimeTestsSuitesMutable_arrayShiftObject, _emberRuntimeTestsSuitesMutable_arrayUnshiftObject, _emberRuntimeTestsSuitesMutable_arrayReverseObjects) { + 'use strict'; + + var MutableArrayTests = _emberRuntimeTestsSuitesArray.ArrayTests.extend(); + MutableArrayTests.importModuleTests(_emberRuntimeTestsSuitesMutable_arrayInsertAt.default); + MutableArrayTests.importModuleTests(_emberRuntimeTestsSuitesMutable_arrayPopObject.default); + MutableArrayTests.importModuleTests(_emberRuntimeTestsSuitesMutable_arrayPushObject.default); + MutableArrayTests.importModuleTests(_emberRuntimeTestsSuitesMutable_arrayPushObjects.default); + MutableArrayTests.importModuleTests(_emberRuntimeTestsSuitesMutable_arrayRemoveAt.default); + MutableArrayTests.importModuleTests(_emberRuntimeTestsSuitesMutable_arrayReplace.default); + MutableArrayTests.importModuleTests(_emberRuntimeTestsSuitesMutable_arrayShiftObject.default); + MutableArrayTests.importModuleTests(_emberRuntimeTestsSuitesMutable_arrayUnshiftObject.default); + MutableArrayTests.importModuleTests(_emberRuntimeTestsSuitesMutable_arrayReverseObjects.default); + + exports.default = MutableArrayTests; +}); +enifed('ember-runtime/tests/suites/mutable_array.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites'); + test('ember-runtime/tests/suites/mutable_array.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites'); + QUnit.test('ember-runtime/tests/suites/mutable_array.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/addObject', ['exports', 'ember-metal', 'ember-runtime/tests/suites/suite'], function (exports, _emberMetal, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('addObject'); + + suite.test('should return receiver', function () { + var before = this.newFixture(3); + var obj = this.newObject(before); + equal(obj.addObject(before[1]), obj, 'should return receiver'); + }); + + suite.test('[A,B].addObject(C) => [A,B,C] + notify', function () { + var before = this.newFixture(2); + var item = this.newFixture(1)[0]; + var after = [before[0], before[1], item]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.addObject(item); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + } + }); + + suite.test('[A,B,C].addObject(A) => [A,B,C] + NO notify', function () { + var before = this.newFixture(3); + var after = before; + var item = before[0]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.addObject(item); // note: item in set + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.validate('[]'), false, 'should NOT have notified []'); + equal(observer.validate('@each'), false, 'should NOT have notified @each'); + equal(observer.validate('length'), false, 'should NOT have notified length'); + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once'); + } + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/addObject.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/addObject.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/addObject.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/addObject.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/addObject.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/addObject.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/clear', ['exports', 'ember-metal', 'ember-runtime/tests/suites/suite'], function (exports, _emberMetal, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('clear'); + + suite.test('[].clear() => [] + notify', function () { + var before = []; + var after = []; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(obj.clear(), obj, 'return self'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.validate('[]'), false, 'should NOT have notified [] once'); + equal(observer.validate('@each'), false, 'should NOT have notified @each once'); + equal(observer.validate('length'), false, 'should NOT have notified length once'); + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once'); + }); + + suite.test('[X].clear() => [] + notify', function () { + var obj, before, after, observer; + + before = this.newFixture(1); + after = []; + obj = this.newObject(before); + observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(obj.clear(), obj, 'return self'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/clear.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/clear.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/clear.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/clear.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/clear.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/clear.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/insertAt', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('insertAt'); + + suite.test('[].insertAt(0, X) => [X] + notify', function () { + var after = this.newFixture(1); + var obj = this.newObject([]); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.insertAt(0, after[0]); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalledBefore('[]'), 1, 'should have notified [] will change once'); + equal(observer.timesCalledBefore('@each'), 0, 'should not have notified @each will change once'); + equal(observer.timesCalledBefore('length'), 1, 'should have notified length will change once'); + equal(observer.timesCalledBefore('firstObject'), 1, 'should have notified firstObject will change once'); + equal(observer.timesCalledBefore('lastObject'), 1, 'should have notified lastObject will change once'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] did change once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each did change once'); + equal(observer.timesCalled('length'), 1, 'should have notified length did change once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject did change once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject did change once'); + }); + + suite.test('[].insertAt(200,X) => OUT_OF_RANGE_EXCEPTION exception', function () { + var obj = this.newObject([]); + var that = this; + + throws(function () { + return obj.insertAt(200, that.newFixture(1)[0]); + }, Error); + }); + + suite.test('[A].insertAt(0, X) => [X,A] + notify', function () { + var item = this.newFixture(1)[0]; + var before = this.newFixture(1); + var after = [item, before[0]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.insertAt(0, item); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalledBefore('[]'), 1, 'should have notified [] will change once'); + equal(observer.timesCalledBefore('@each'), 0, 'should not have notified @each will change once'); + equal(observer.timesCalledBefore('length'), 1, 'should have notified length will change once'); + equal(observer.timesCalledBefore('firstObject'), 1, 'should have notified firstObject will change once'); + equal(observer.timesCalledBefore('lastObject'), 0, 'should NOT have notified lastObject will change once'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + }); + + suite.test('[A].insertAt(1, X) => [A,X] + notify', function () { + var item = this.newFixture(1)[0]; + var before = this.newFixture(1); + var after = [before[0], item]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.insertAt(1, item); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalledBefore('[]'), 1, 'should have notified [] will change once'); + equal(observer.timesCalledBefore('@each'), 0, 'should not have notified @each will change once'); + equal(observer.timesCalledBefore('length'), 1, 'should have notified length will change once'); + equal(observer.timesCalledBefore('firstObject'), 0, 'should NOT have notified firstObject will change once'); + equal(observer.timesCalledBefore('lastObject'), 1, 'should have notified lastObject will change once'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + }); + + suite.test('[A].insertAt(200,X) => OUT_OF_RANGE exception', function () { + var obj = this.newObject(this.newFixture(1)); + var that = this; + + throws(function () { + return obj.insertAt(200, that.newFixture(1)[0]); + }, Error); + }); + + suite.test('[A,B,C].insertAt(0,X) => [X,A,B,C] + notify', function () { + var item = this.newFixture(1)[0]; + var before = this.newFixture(3); + var after = [item, before[0], before[1], before[2]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.insertAt(0, item); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalledBefore('[]'), 1, 'should have notified [] will change once'); + equal(observer.timesCalledBefore('@each'), 0, 'should not have notified @each will change once'); + equal(observer.timesCalledBefore('length'), 1, 'should have notified length will change once'); + equal(observer.timesCalledBefore('firstObject'), 1, 'should have notified firstObject will change once'); + equal(observer.timesCalledBefore('lastObject'), 0, 'should NOT have notified lastObject will change once'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + }); + + suite.test('[A,B,C].insertAt(1,X) => [A,X,B,C] + notify', function () { + var item = this.newFixture(1)[0]; + var before = this.newFixture(3); + var after = [before[0], item, before[1], before[2]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.insertAt(1, item); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalledBefore('[]'), 1, 'should have notified [] will change once'); + equal(observer.timesCalledBefore('@each'), 0, 'should not have notified @each will change once'); + equal(observer.timesCalledBefore('length'), 1, 'should have notified length will change once'); + equal(observer.timesCalledBefore('firstObject'), 0, 'should NOT have notified firstObject will change once'); + equal(observer.timesCalledBefore('lastObject'), 0, 'should NOT have notified lastObject will change once'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + }); + + suite.test('[A,B,C].insertAt(3,X) => [A,B,C,X] + notify', function () { + var item = this.newFixture(1)[0]; + var before = this.newFixture(3); + var after = [before[0], before[1], before[2], item]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.insertAt(3, item); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalledBefore('[]'), 1, 'should have notified [] will change once'); + equal(observer.timesCalledBefore('@each'), 0, 'should not have notified @each will change once'); + equal(observer.timesCalledBefore('length'), 1, 'should have notified length will change once'); + equal(observer.timesCalledBefore('firstObject'), 0, 'should NOT have notified firstObject will change once'); + equal(observer.timesCalledBefore('lastObject'), 1, 'should have notified lastObject will change once'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/insertAt.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/insertAt.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/insertAt.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/insertAt.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/insertAt.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/insertAt.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/popObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('popObject'); + + suite.test('[].popObject() => [] + returns undefined + NO notify', function () { + var obj = this.newObject([]); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(obj.popObject(), undefined, 'popObject results'); + + deepEqual(this.toArray(obj), [], 'post item results'); + + equal(observer.validate('[]'), false, 'should NOT have notified []'); + equal(observer.validate('@each'), false, 'should NOT have notified @each'); + equal(observer.validate('length'), false, 'should NOT have notified length'); + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + }); + + suite.test('[X].popObject() => [] + notify', function () { + var before = this.newFixture(1); + var after = []; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + var ret = obj.popObject(); + + equal(ret, before[0], 'return object'); + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + }); + + suite.test('[A,B,C].popObject() => [A,B] + notify', function () { + var before = this.newFixture(3); + var after = [before[0], before[1]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + var ret = obj.popObject(); + + equal(ret, before[2], 'return object'); + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/popObject.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/popObject.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/popObject.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/popObject.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/popObject.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/popObject.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/pushObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('pushObject'); + + suite.test('returns pushed object', function () { + var exp = this.newFixture(1)[0]; + var obj = this.newObject([]); + + equal(obj.pushObject(exp), exp, 'should return pushed object'); + }); + + suite.test('[].pushObject(X) => [X] + notify', function () { + var before = []; + var after = this.newFixture(1); + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.pushObject(after[0]); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + }); + + suite.test('[A,B,C].pushObject(X) => [A,B,C,X] + notify', function () { + var before = this.newFixture(3); + var item = this.newFixture(1)[0]; + var after = [before[0], before[1], before[2], item]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.pushObject(item); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/pushObject.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/pushObject.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/pushObject.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/pushObject.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/pushObject.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/pushObject.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/pushObjects', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('pushObjects'); + + suite.test('should raise exception if not Ember.Enumerable is passed to pushObjects', function () { + var obj = this.newObject([]); + + throws(function () { + return obj.pushObjects('string'); + }); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/pushObjects.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/pushObjects.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/pushObjects.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/pushObjects.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/pushObjects.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/pushObjects.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/removeAt', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal', 'ember-runtime/mixins/mutable_array'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal, _emberRuntimeMixinsMutable_array) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('removeAt'); + + suite.test('removeAt([X], 0) => [] + notify', function () { + var before = this.newFixture(1); + var after = []; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(_emberRuntimeMixinsMutable_array.removeAt(obj, 0), obj, 'return self'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + }); + + suite.test('removeAt([], 200) => OUT_OF_RANGE_EXCEPTION exception', function () { + var obj = this.newObject([]); + throws(function () { + return _emberRuntimeMixinsMutable_array.removeAt(obj, 200); + }, Error); + }); + + suite.test('removeAt([A,B], 0) => [B] + notify', function () { + var before = this.newFixture(2); + var after = [before[1]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(_emberRuntimeMixinsMutable_array.removeAt(obj, 0), obj, 'return self'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + }); + + suite.test('removeAt([A,B], 1) => [A] + notify', function () { + var before = this.newFixture(2); + var after = [before[0]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(_emberRuntimeMixinsMutable_array.removeAt(obj, 1), obj, 'return self'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + }); + + suite.test('removeAt([A,B,C], 1) => [A,C] + notify', function () { + var before = this.newFixture(3); + var after = [before[0], before[2]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(_emberRuntimeMixinsMutable_array.removeAt(obj, 1), obj, 'return self'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once'); + }); + + suite.test('removeAt([A,B,C,D], 1,2) => [A,D] + notify', function () { + var before = this.newFixture(4); + var after = [before[0], before[3]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(_emberRuntimeMixinsMutable_array.removeAt(obj, 1, 2), obj, 'return self'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once'); + }); + + suite.test('[A,B,C,D].removeAt(1,2) => [A,D] + notify', function () { + var obj, before, after, observer; + + before = this.newFixture(4); + after = [before[0], before[3]]; + obj = this.newObject(before); + observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(obj.removeAt(1, 2), obj, 'return self'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/removeAt.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/removeAt.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/removeAt.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/removeAt.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/removeAt.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/removeAt.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/removeObject', ['exports', 'ember-metal', 'ember-runtime/tests/suites/suite'], function (exports, _emberMetal, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('removeObject'); + + suite.test('should return receiver', function () { + var before = this.newFixture(3); + var obj = this.newObject(before); + + equal(obj.removeObject(before[1]), obj, 'should return receiver'); + }); + + suite.test('[A,B,C].removeObject(B) => [A,C] + notify', function () { + var before = this.newFixture(3); + var after = [before[0], before[2]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.removeObject(before[1]); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once'); + } + }); + + suite.test('[A,B,C].removeObject(D) => [A,B,C]', function () { + var before = this.newFixture(3); + var after = before; + var item = this.newFixture(1)[0]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.removeObject(item); // note: item not in set + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.validate('[]'), false, 'should NOT have notified []'); + equal(observer.validate('@each'), false, 'should NOT have notified @each'); + equal(observer.validate('length'), false, 'should NOT have notified length'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once'); + } + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/removeObject.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/removeObject.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/removeObject.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/removeObject.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/removeObject.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/removeObject.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/replace', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('replace'); + + suite.test('[].replace(0,0,\'X\') => [\'X\'] + notify', function () { + var exp = this.newFixture(1); + var obj = this.newObject([]); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.replace(0, 0, exp); + + deepEqual(this.toArray(obj), exp, 'post item results'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + }); + + suite.test('[].replace(0,0,"X") => ["X"] + avoid calling objectAt and notifying fistObject/lastObject when not in cache', function () { + var obj, exp, observer; + var called = 0; + exp = this.newFixture(1); + obj = this.newObject([]); + obj.objectAt = function () { + called++; + }; + observer = this.newObserver(obj, 'firstObject', 'lastObject'); + + obj.replace(0, 0, exp); + + equal(called, 0, 'should NOT have called objectAt upon replace when firstObject/lastObject are not cached'); + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject since not cached'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject since not cached'); + }); + + suite.test('[A,B,C,D].replace(1,2,X) => [A,X,D] + notify', function () { + var before = this.newFixture(4); + var replace = this.newFixture(1); + var after = [before[0], replace[0], before[3]]; + + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.replace(1, 2, replace); + + deepEqual(this.toArray(obj), after, 'post item results'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once'); + }); + + suite.test('[A,B,C,D].replace(1,2,[X,Y]) => [A,X,Y,D] + notify', function () { + var before = this.newFixture(4); + var replace = this.newFixture(2); + var after = [before[0], replace[0], replace[1], before[3]]; + + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.replace(1, 2, replace); + + deepEqual(this.toArray(obj), after, 'post item results'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.validate('length'), false, 'should NOT have notified length'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once'); + }); + + suite.test('[A,B].replace(1,0,[X,Y]) => [A,X,Y,B] + notify', function () { + var before = this.newFixture(2); + var replace = this.newFixture(2); + var after = [before[0], replace[0], replace[1], before[1]]; + + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.replace(1, 0, replace); + + deepEqual(this.toArray(obj), after, 'post item results'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once'); + }); + + suite.test('[A,B,C,D].replace(2,2) => [A,B] + notify', function () { + var before = this.newFixture(4); + var after = [before[0], before[1]]; + + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.replace(2, 2); + + deepEqual(this.toArray(obj), after, 'post item results'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + }); + + suite.test('Adding object should notify enumerable observer', function () { + var fixtures = this.newFixture(4); + var obj = this.newObject(fixtures); + var observer = this.newObserver(obj).observeEnumerable(obj); + var item = this.newFixture(1)[0]; + + obj.replace(2, 2, [item]); + + deepEqual(observer._before, [obj, [fixtures[2], fixtures[3]], 1], 'before'); + deepEqual(observer._after, [obj, 2, [item]], 'after'); + }); + + suite.test('Adding object should notify array observer', function () { + var fixtures = this.newFixture(4); + var obj = this.newObject(fixtures); + var observer = this.newObserver(obj).observeArray(obj); + var item = this.newFixture(1)[0]; + + obj.replace(2, 2, [item]); + + deepEqual(observer._before, [obj, 2, 2, 1], 'before'); + deepEqual(observer._after, [obj, 2, 2, 1], 'after'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/replace.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/replace.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/replace.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/replace.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/replace.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/replace.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/reverseObjects', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('reverseObjects'); + + suite.test('[A,B,C].reverseObjects() => [] + notify', function () { + var before = this.newFixture(3); + var after = [before[2], before[1], before[0]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(obj.reverseObjects(), obj, 'return self'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 0, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/reverseObjects.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/reverseObjects.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/reverseObjects.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/reverseObjects.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/reverseObjects.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/reverseObjects.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/setObjects', ['exports', 'ember-metal', 'ember-runtime/tests/suites/suite'], function (exports, _emberMetal, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('setObjects'); + + suite.test('[A,B,C].setObjects([]) = > [] + notify', function () { + var before = this.newFixture(3); + var after = []; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(obj.setObjects(after), obj, 'return self'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + }); + + suite.test('[A,B,C].setObjects([D, E, F, G]) = > [D, E, F, G] + notify', function () { + var before = this.newFixture(3); + var after = this.newFixture(4); + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(obj.setObjects(after), obj, 'return self'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/setObjects.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/setObjects.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/setObjects.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/setObjects.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/setObjects.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/setObjects.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/shiftObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('shiftObject'); + + suite.test('[].shiftObject() => [] + returns undefined + NO notify', function () { + var before = []; + var after = []; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(obj.shiftObject(), undefined); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.validate('[]', undefined, 1), false, 'should NOT have notified [] once'); + equal(observer.validate('@each', undefined, 1), false, 'should NOT have notified @each once'); + equal(observer.validate('length', undefined, 1), false, 'should NOT have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once'); + }); + + suite.test('[X].shiftObject() => [] + notify', function () { + var before = this.newFixture(1); + var after = []; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(obj.shiftObject(), before[0], 'should return object'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + }); + + suite.test('[A,B,C].shiftObject() => [B,C] + notify', function () { + var before = this.newFixture(3); + var after = [before[1], before[2]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(obj.shiftObject(), before[0], 'should return object'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/shiftObject.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/shiftObject.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/shiftObject.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/shiftObject.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/shiftObject.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/shiftObject.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/unshiftObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('unshiftObject'); + + suite.test('returns unshifted object', function () { + var obj = this.newObject([]); + var item = this.newFixture(1)[0]; + + equal(obj.unshiftObject(item), item, 'should return unshifted object'); + }); + + suite.test('[].unshiftObject(X) => [X] + notify', function () { + var before = []; + var item = this.newFixture(1)[0]; + var after = [item]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.unshiftObject(item); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + }); + + suite.test('[A,B,C].unshiftObject(X) => [X,A,B,C] + notify', function () { + var before = this.newFixture(3); + var item = this.newFixture(1)[0]; + var after = [item, before[0], before[1], before[2]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.unshiftObject(item); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + }); + + suite.test('[A,B,C].unshiftObject(A) => [A,A,B,C] + notify', function () { + var before = this.newFixture(3); + var item = before[0]; // note same object as current head. should end up twice + var after = [item, before[0], before[1], before[2]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.unshiftObject(item); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/unshiftObject.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/unshiftObject.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/unshiftObject.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/unshiftObject.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/unshiftObject.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/unshiftObject.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/unshiftObjects', ['exports', 'ember-metal', 'ember-runtime/tests/suites/suite'], function (exports, _emberMetal, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('unshiftObjects'); + + suite.test('returns receiver', function () { + var obj = this.newObject([]); + var items = this.newFixture(3); + + equal(obj.unshiftObjects(items), obj, 'should return receiver'); + }); + + suite.test('[].unshiftObjects([A,B,C]) => [A,B,C] + notify', function () { + var before = []; + var items = this.newFixture(3); + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.unshiftObjects(items); + + deepEqual(this.toArray(obj), items, 'post item results'); + equal(_emberMetal.get(obj, 'length'), items.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + }); + + suite.test('[A,B,C].unshiftObjects([X,Y]) => [X,Y,A,B,C] + notify', function () { + var before = this.newFixture(3); + var items = this.newFixture(2); + var after = items.concat(before); + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.unshiftObjects(items); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + }); + + suite.test('[A,B,C].unshiftObjects([A,B]) => [A,B,A,B,C] + notify', function () { + var before = this.newFixture(3); + var items = [before[0], before[1]]; // note same object as current head. should end up twice + var after = items.concat(before); + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.unshiftObjects(items); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/unshiftObjects.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/unshiftObjects.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/unshiftObjects.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/unshiftObjects.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/unshiftObjects.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/unshiftObjects.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_enumerable', ['exports', 'ember-runtime/tests/suites/enumerable', 'ember-runtime/tests/suites/mutable_enumerable/addObject', 'ember-runtime/tests/suites/mutable_enumerable/removeObject', 'ember-runtime/tests/suites/mutable_enumerable/removeObjects'], function (exports, _emberRuntimeTestsSuitesEnumerable, _emberRuntimeTestsSuitesMutable_enumerableAddObject, _emberRuntimeTestsSuitesMutable_enumerableRemoveObject, _emberRuntimeTestsSuitesMutable_enumerableRemoveObjects) { + 'use strict'; + + var MutableEnumerableTests = _emberRuntimeTestsSuitesEnumerable.EnumerableTests.extend(); + MutableEnumerableTests.importModuleTests(_emberRuntimeTestsSuitesMutable_enumerableAddObject.default); + MutableEnumerableTests.importModuleTests(_emberRuntimeTestsSuitesMutable_enumerableRemoveObject.default); + MutableEnumerableTests.importModuleTests(_emberRuntimeTestsSuitesMutable_enumerableRemoveObjects.default); + + exports.default = MutableEnumerableTests; +}); +enifed('ember-runtime/tests/suites/mutable_enumerable.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites'); + test('ember-runtime/tests/suites/mutable_enumerable.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_enumerable.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_enumerable.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites'); + QUnit.test('ember-runtime/tests/suites/mutable_enumerable.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_enumerable.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_enumerable/addObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('addObject'); + + suite.test('should return receiver', function () { + var before = this.newFixture(3); + var obj = this.newObject(before); + + equal(obj.addObject(before[1]), obj, 'should return receiver'); + }); + + suite.test('[A,B].addObject(C) => [A,B,C] + notify', function () { + var before = this.newFixture(2); + var item = this.newFixture(1)[0]; + var after = [before[0], before[1], item]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject'); + + _emberMetal.get(obj, 'firstObject'); + _emberMetal.get(obj, 'lastObject'); + + obj.addObject(item); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + // This gets called since MutableEnumerable is naive about changes + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + } + }); + + suite.test('[A,B,C].addObject(A) => [A,B,C] + NO notify', function () { + var before = this.newFixture(3); + var after = before; + var item = before[0]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject'); + + obj.addObject(item); // note: item in set + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.validate('[]'), false, 'should NOT have notified []'); + equal(observer.validate('length'), false, 'should NOT have notified length'); + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + } + }); + + suite.test('Adding object should notify enumerable observer', function () { + var obj = this.newObject(this.newFixture(3)); + var observer = this.newObserver(obj).observeEnumerable(obj); + var item = this.newFixture(1)[0]; + + obj.addObject(item); + + deepEqual(observer._before, [obj, null, [item]]); + deepEqual(observer._after, [obj, null, [item]]); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_enumerable/addObject.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_enumerable'); + test('ember-runtime/tests/suites/mutable_enumerable/addObject.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_enumerable/addObject.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_enumerable/addObject.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_enumerable'); + QUnit.test('ember-runtime/tests/suites/mutable_enumerable/addObject.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_enumerable/addObject.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_enumerable/removeObject', ['exports', 'ember-metal', 'ember-runtime/tests/suites/suite', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeTestsSuitesSuite, _emberRuntimeSystemNative_array) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('removeObject'); + + suite.test('should return receiver', function () { + var before = this.newFixture(3); + var obj = this.newObject(before); + + equal(obj.removeObject(before[1]), obj, 'should return receiver'); + }); + + suite.test('[A,B,C].removeObject(B) => [A,C] + notify', function () { + var before = _emberRuntimeSystemNative_array.A(this.newFixture(3)); + var after = [before[0], before[2]]; + var obj = before; + var observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); // Prime the cache + + obj.removeObject(before[1]); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + } + }); + + suite.test('[A,B,C].removeObject(D) => [A,B,C]', function () { + var before = _emberRuntimeSystemNative_array.A(this.newFixture(3)); + var after = before; + var item = this.newFixture(1)[0]; + var obj = before; + var observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); // Prime the cache + + obj.removeObject(item); // Note: item not in set + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.validate('[]'), false, 'should NOT have notified []'); + equal(observer.validate('length'), false, 'should NOT have notified length'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + } + }); + + suite.test('Removing object should notify enumerable observer', function () { + var fixtures = this.newFixture(3); + var obj = this.newObject(fixtures); + var observer = this.newObserver(obj).observeEnumerable(obj); + var item = fixtures[1]; + + obj.removeObject(item); + + deepEqual(observer._before, [obj, [item], null]); + deepEqual(observer._after, [obj, [item], null]); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_enumerable/removeObject.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_enumerable'); + test('ember-runtime/tests/suites/mutable_enumerable/removeObject.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_enumerable/removeObject.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_enumerable/removeObject.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_enumerable'); + QUnit.test('ember-runtime/tests/suites/mutable_enumerable/removeObject.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_enumerable/removeObject.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_enumerable/removeObjects', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal', 'ember-runtime/system/native_array'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal, _emberRuntimeSystemNative_array) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('removeObjects'); + + suite.test('should return receiver', function () { + var before = _emberRuntimeSystemNative_array.A(this.newFixture(3)); + var obj = before; + + equal(obj.removeObjects(before[1]), obj, 'should return receiver'); + }); + + suite.test('[A,B,C].removeObjects([B]) => [A,C] + notify', function () { + var before = _emberRuntimeSystemNative_array.A(this.newFixture(3)); + var after = [before[0], before[2]]; + var obj = before; + var observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); // Prime the cache + + obj.removeObjects([before[1]]); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + } + }); + + suite.test('[{A},{B},{C}].removeObjects([{B}]) => [{A},{C}] + notify', function () { + var before = _emberRuntimeSystemNative_array.A(this.newObjectsFixture(3)); + var after = [before[0], before[2]]; + var obj = before; + var observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); // Prime the cache + + obj.removeObjects([before[1]]); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + } + }); + + suite.test('[A,B,C].removeObjects([A,B]) => [C] + notify', function () { + var before = _emberRuntimeSystemNative_array.A(this.newFixture(3)); + var after = [before[2]]; + var obj = before; + var observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); // Prime the cache + + obj.removeObjects([before[0], before[1]]); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + } + }); + + suite.test('[{A},{B},{C}].removeObjects([{A},{B}]) => [{C}] + notify', function () { + var before = _emberRuntimeSystemNative_array.A(this.newObjectsFixture(3)); + var after = [before[2]]; + var obj = before; + var observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); // Prime the cache + + obj.removeObjects([before[0], before[1]]); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + } + }); + + suite.test('[A,B,C].removeObjects([A,B,C]) => [] + notify', function () { + var before = _emberRuntimeSystemNative_array.A(this.newFixture(3)); + var after = []; + var obj = before; + var observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); // Prime the cache + + obj.removeObjects([before[0], before[1], before[2]]); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject'); + } + }); + + suite.test('[{A},{B},{C}].removeObjects([{A},{B},{C}]) => [] + notify', function () { + var before = _emberRuntimeSystemNative_array.A(this.newObjectsFixture(3)); + var after = []; + var obj = before; + var observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); // Prime the cache + + obj.removeObjects(before); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject'); + equal(observer.validate('lastObject'), 1, 'should have notified lastObject'); + } + }); + + suite.test('[A,B,C].removeObjects([D]) => [A,B,C]', function () { + var before = _emberRuntimeSystemNative_array.A(this.newFixture(3)); + var after = before; + var item = this.newFixture(1)[0]; + var obj = before; + var observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); // Prime the cache + + obj.removeObjects([item]); // Note: item not in set + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.validate('[]'), false, 'should NOT have notified []'); + equal(observer.validate('length'), false, 'should NOT have notified length'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + } + }); + + suite.test('Removing objects should notify enumerable observer', function () { + var fixtures = this.newFixture(3); + var obj = this.newObject(fixtures); + var observer = this.newObserver(obj).observeEnumerable(obj); + var item = fixtures[1]; + + obj.removeObjects([item]); + + deepEqual(observer._before, [obj, [item], null]); + deepEqual(observer._after, [obj, [item], null]); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_enumerable/removeObjects.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_enumerable'); + test('ember-runtime/tests/suites/mutable_enumerable/removeObjects.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_enumerable/removeObjects.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_enumerable/removeObjects.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_enumerable'); + QUnit.test('ember-runtime/tests/suites/mutable_enumerable/removeObjects.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_enumerable/removeObjects.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/suite', ['exports', 'ember-utils', 'ember-runtime/system/object', 'ember-metal'], function (exports, _emberUtils, _emberRuntimeSystemObject, _emberMetal) { + 'use strict'; + + /* + @class + A Suite can be used to define a reusable set of unit tests that can be + applied to any object. Suites are most useful for defining tests that + work against a mixin or plugin API. Developers implementing objects that + use the mixin or support the API can then run these tests against their + own code to verify compliance. + + To define a suite, you need to define the tests themselves as well as a + callback API implementers can use to tie your tests to their specific class. + + ## Defining a Callback API + + To define the callback API, just extend this class and add your properties + or methods that must be provided. + + ## Defining Unit Tests + + To add unit tests, use the suite.module() or suite.test() methods instead + of a regular module() or test() method when defining your tests. This will + add the tests to the suite. + + ## Using a Suite + + To use a Suite to test your own objects, extend the suite subclass and + define any required methods. Then call run() on the new subclass. This + will create an instance of your class and then defining the unit tests. + + @extends Ember.Object + @private + */ + var Suite = _emberRuntimeSystemObject.default.extend({ + + /* + __Required.__ You must implement this method to apply this mixin. + Define a name for these tests - all modules are prefixed w/ it. + @type String + */ + name: null, + + /* + Invoked to actually run the test - overridden by mixins + */ + run: function () {} + + }); + + Suite.reopenClass({ + + plan: null, + + run: function () { + var C = this; + return new C().run(); + }, + + module: function (desc, opts) { + if (!opts) { + opts = {}; + } + + var setup = opts.setup; + var teardown = opts.teardown; + this.reopen({ + run: function () { + this._super.apply(this, arguments); + var title = _emberMetal.get(this, 'name') + ': ' + desc; + var ctx = this; + QUnit.module(title, { + setup: function () { + if (setup) { + setup.call(ctx); + } + }, + + teardown: function () { + if (teardown) { + teardown.call(ctx); + } + } + }); + } + }); + }, + + test: function (name, func) { + this.reopen({ + run: function () { + this._super.apply(this, arguments); + var ctx = this; + + if (!func) { + QUnit.test(name); // output warning + } else { + QUnit.test(name, function () { + return func.call(ctx); + }); + } + } + }); + }, + + // convert to guids to minimize logging. + same: function (actual, exp, message) { + actual = actual && actual.map ? actual.map(function (x) { + return _emberUtils.guidFor(x); + }) : actual; + exp = exp && exp.map ? exp.map(function (x) { + return _emberUtils.guidFor(x); + }) : exp; + return deepEqual(actual, exp, message); + }, + + // easy way to disable tests + notest: function () {}, + + importModuleTests: function (builder) { + var _this = this; + + this.module(builder._module); + + builder._tests.forEach(function (descAndFunc) { + _this.test.apply(_this, descAndFunc); + }); + } + }); + + var SuiteModuleBuilder = _emberRuntimeSystemObject.default.extend({ + _module: null, + _tests: null, + + init: function () { + this._tests = []; + }, + + module: function (name) { + this._module = name; + }, + + test: function (name, func) { + this._tests.push([name, func]); + } + }); + + exports.SuiteModuleBuilder = SuiteModuleBuilder; + exports.Suite = Suite; + exports.default = Suite; +}); +enifed('ember-runtime/tests/suites/suite.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites'); + test('ember-runtime/tests/suites/suite.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/suite.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/suite.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites'); + QUnit.test('ember-runtime/tests/suites/suite.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/suite.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/application/base_test', ['exports', 'ember-runtime/system/namespace', 'ember-runtime/system/application'], function (exports, _emberRuntimeSystemNamespace, _emberRuntimeSystemApplication) { + 'use strict'; + + QUnit.module('Ember.Application'); + + QUnit.test('Ember.Application should be a subclass of Ember.Namespace', function () { + ok(_emberRuntimeSystemNamespace.default.detect(_emberRuntimeSystemApplication.default), 'Ember.Application subclass of Ember.Namespace'); + }); +}); +enifed('ember-runtime/tests/system/application/base_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/application'); + test('ember-runtime/tests/system/application/base_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/application/base_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/application/base_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/application'); + QUnit.test('ember-runtime/tests/system/application/base_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/application/base_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/arranged_content_test', ['exports', 'ember-metal', 'ember-runtime/system/array_proxy', 'ember-runtime/system/native_array', 'ember-runtime/mixins/array'], function (exports, _emberMetal, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemNative_array, _emberRuntimeMixinsArray) { + 'use strict'; + + var array = undefined; + + QUnit.module('ArrayProxy - arrangedContent', { + setup: function () { + _emberMetal.run(function () { + array = _emberRuntimeSystemArray_proxy.default.extend({ + arrangedContent: _emberMetal.computed('content.[]', function () { + var content = this.get('content'); + return content && _emberRuntimeSystemNative_array.A(content.slice().sort(function (a, b) { + if (a == null) { + a = -1; + } + if (b == null) { + b = -1; + } + return b - a; + })); + }) + }).create({ + content: _emberRuntimeSystemNative_array.A([1, 2, 4, 5]) + }); + }); + }, + teardown: function () { + _emberMetal.run(function () { + return array.destroy(); + }); + } + }); + + QUnit.test('addObject - adds to end of \'content\' if not present', function () { + _emberMetal.run(function () { + return array.addObject(3); + }); + + deepEqual(array.get('content'), [1, 2, 4, 5, 3], 'adds to end of content'); + deepEqual(array.get('arrangedContent'), [5, 4, 3, 2, 1], 'arrangedContent stays sorted'); + + _emberMetal.run(function () { + return array.addObject(1); + }); + + deepEqual(array.get('content'), [1, 2, 4, 5, 3], 'does not add existing number to content'); + }); + + QUnit.test('addObjects - adds to end of \'content\' if not present', function () { + _emberMetal.run(function () { + return array.addObjects([1, 3, 6]); + }); + + deepEqual(array.get('content'), [1, 2, 4, 5, 3, 6], 'adds to end of content'); + deepEqual(array.get('arrangedContent'), [6, 5, 4, 3, 2, 1], 'arrangedContent stays sorted'); + }); + + QUnit.test('compact - returns arrangedContent without nulls and undefined', function () { + _emberMetal.run(function () { + return array.set('content', _emberRuntimeSystemNative_array.A([1, 3, null, 2, undefined])); + }); + + deepEqual(array.compact(), [3, 2, 1]); + }); + + QUnit.test('indexOf - returns index of object in arrangedContent', function () { + equal(array.indexOf(4), 1, 'returns arranged index'); + }); + + QUnit.test('insertAt - raises, indeterminate behavior', function () { + throws(function () { + return _emberMetal.run(function () { + return array.insertAt(2, 3); + }); + }); + }); + + QUnit.test('lastIndexOf - returns last index of object in arrangedContent', function () { + _emberMetal.run(function () { + return array.pushObject(4); + }); + + equal(array.lastIndexOf(4), 2, 'returns last arranged index'); + }); + + QUnit.test('nextObject - returns object at index in arrangedContent', function () { + equal(array.nextObject(1), 4, 'returns object at index'); + }); + + QUnit.test('objectAt - returns object at index in arrangedContent', function () { + equal(_emberRuntimeMixinsArray.objectAt(array, 1), 4, 'returns object at index'); + }); + + // Not sure if we need a specific test for it, since it's internal + QUnit.test('objectAtContent - returns object at index in arrangedContent', function () { + equal(array.objectAtContent(1), 4, 'returns object at index'); + }); + + QUnit.test('objectsAt - returns objects at indices in arrangedContent', function () { + deepEqual(array.objectsAt([0, 2, 4]), [5, 2, undefined], 'returns objects at indices'); + }); + + QUnit.test('popObject - removes last object in arrangedContent', function () { + var popped = undefined; + _emberMetal.run(function () { + return popped = array.popObject(); + }); + equal(popped, 1, 'returns last object'); + deepEqual(array.get('content'), [2, 4, 5], 'removes from content'); + }); + + QUnit.test('pushObject - adds to end of content even if it already exists', function () { + _emberMetal.run(function () { + return array.pushObject(1); + }); + deepEqual(array.get('content'), [1, 2, 4, 5, 1], 'adds to end of content'); + }); + + QUnit.test('pushObjects - adds multiple to end of content even if it already exists', function () { + _emberMetal.run(function () { + return array.pushObjects([1, 2, 4]); + }); + deepEqual(array.get('content'), [1, 2, 4, 5, 1, 2, 4], 'adds to end of content'); + }); + + QUnit.test('removeAt - removes from index in arrangedContent', function () { + _emberMetal.run(function () { + return array.removeAt(1, 2); + }); + deepEqual(array.get('content'), [1, 5]); + }); + + QUnit.test('removeObject - removes object from content', function () { + _emberMetal.run(function () { + return array.removeObject(2); + }); + deepEqual(array.get('content'), [1, 4, 5]); + }); + + QUnit.test('removeObjects - removes objects from content', function () { + _emberMetal.run(function () { + return array.removeObjects([2, 4, 6]); + }); + deepEqual(array.get('content'), [1, 5]); + }); + + QUnit.test('replace - raises, indeterminate behavior', function () { + throws(function () { + return _emberMetal.run(function () { + return array.replace(1, 2, [3]); + }); + }); + }); + + QUnit.test('replaceContent - does a standard array replace on content', function () { + _emberMetal.run(function () { + return array.replaceContent(1, 2, [3]); + }); + deepEqual(array.get('content'), [1, 3, 5]); + }); + + QUnit.test('reverseObjects - raises, use Sortable#sortAscending', function () { + throws(function () { + return _emberMetal.run(function () { + return array.reverseObjects(); + }); + }); + }); + + QUnit.test('setObjects - replaces entire content', function () { + _emberMetal.run(function () { + return array.setObjects([6, 7, 8]); + }); + deepEqual(array.get('content'), [6, 7, 8], 'replaces content'); + }); + + QUnit.test('shiftObject - removes from start of arrangedContent', function () { + var shifted = _emberMetal.run(function () { + return array.shiftObject(); + }); + + equal(shifted, 5, 'returns first object'); + deepEqual(array.get('content'), [1, 2, 4], 'removes object from content'); + }); + + QUnit.test('slice - returns a slice of the arrangedContent', function () { + deepEqual(array.slice(1, 3), [4, 2], 'returns sliced arrangedContent'); + }); + + QUnit.test('toArray - returns copy of arrangedContent', function () { + deepEqual(array.toArray(), [5, 4, 2, 1]); + }); + + QUnit.test('unshiftObject - adds to start of content', function () { + _emberMetal.run(function () { + return array.unshiftObject(6); + }); + deepEqual(array.get('content'), [6, 1, 2, 4, 5], 'adds to start of content'); + }); + + QUnit.test('unshiftObjects - adds to start of content', function () { + _emberMetal.run(function () { + array.unshiftObjects([6, 7]); + }); + deepEqual(array.get('content'), [6, 7, 1, 2, 4, 5], 'adds to start of content'); + }); + + QUnit.test('without - returns arrangedContent without object', function () { + deepEqual(array.without(2), [5, 4, 1], 'returns arranged without object'); + }); + + QUnit.test('lastObject - returns last arranged object', function () { + equal(array.get('lastObject'), 1, 'returns last arranged object'); + }); + + QUnit.test('firstObject - returns first arranged object', function () { + equal(array.get('firstObject'), 5, 'returns first arranged object'); + }); + + QUnit.module('ArrayProxy - arrangedContent matching content', { + setup: function () { + _emberMetal.run(function () { + array = _emberRuntimeSystemArray_proxy.default.create({ + content: _emberRuntimeSystemNative_array.A([1, 2, 4, 5]) + }); + }); + }, + teardown: function () { + _emberMetal.run(function () { + array.destroy(); + }); + } + }); + + QUnit.test('insertAt - inserts object at specified index', function () { + _emberMetal.run(function () { + array.insertAt(2, 3); + }); + deepEqual(array.get('content'), [1, 2, 3, 4, 5]); + }); + + QUnit.test('replace - does a standard array replace', function () { + _emberMetal.run(function () { + array.replace(1, 2, [3]); + }); + deepEqual(array.get('content'), [1, 3, 5]); + }); + + QUnit.test('reverseObjects - reverses content', function () { + _emberMetal.run(function () { + array.reverseObjects(); + }); + deepEqual(array.get('content'), [5, 4, 2, 1]); + }); + + QUnit.module('ArrayProxy - arrangedContent with transforms', { + setup: function () { + _emberMetal.run(function () { + array = _emberRuntimeSystemArray_proxy.default.extend({ + arrangedContent: _emberMetal.computed(function () { + var content = this.get('content'); + return content && _emberRuntimeSystemNative_array.A(content.slice().sort(function (a, b) { + if (a == null) { + a = -1; + } + if (b == null) { + b = -1; + } + return b - a; + })); + }).property('content.[]'), + + objectAtContent: function (idx) { + var obj = _emberRuntimeMixinsArray.objectAt(this.get('arrangedContent'), idx); + return obj && obj.toString(); + } + }).create({ + content: _emberRuntimeSystemNative_array.A([1, 2, 4, 5]) + }); + }); + }, + teardown: function () { + _emberMetal.run(function () { + array.destroy(); + }); + } + }); + + QUnit.test('indexOf - returns index of object in arrangedContent', function () { + equal(array.indexOf('4'), 1, 'returns arranged index'); + }); + + QUnit.test('lastIndexOf - returns last index of object in arrangedContent', function () { + _emberMetal.run(function () { + array.pushObject(4); + }); + equal(array.lastIndexOf('4'), 2, 'returns last arranged index'); + }); + + QUnit.test('nextObject - returns object at index in arrangedContent', function () { + equal(array.nextObject(1), '4', 'returns object at index'); + }); + + QUnit.test('objectAt - returns object at index in arrangedContent', function () { + equal(_emberRuntimeMixinsArray.objectAt(array, 1), '4', 'returns object at index'); + }); + + // Not sure if we need a specific test for it, since it's internal + QUnit.test('objectAtContent - returns object at index in arrangedContent', function () { + equal(array.objectAtContent(1), '4', 'returns object at index'); + }); + + QUnit.test('objectsAt - returns objects at indices in arrangedContent', function () { + deepEqual(array.objectsAt([0, 2, 4]), ['5', '2', undefined], 'returns objects at indices'); + }); + + QUnit.test('popObject - removes last object in arrangedContent', function () { + var popped = undefined; + _emberMetal.run(function () { + popped = array.popObject(); + }); + equal(popped, '1', 'returns last object'); + deepEqual(array.get('content'), [2, 4, 5], 'removes from content'); + }); + + QUnit.test('removeObject - removes object from content', function () { + _emberMetal.run(function () { + array.removeObject('2'); + }); + deepEqual(array.get('content'), [1, 4, 5]); + }); + + QUnit.test('removeObjects - removes objects from content', function () { + _emberMetal.run(function () { + array.removeObjects(['2', '4', '6']); + }); + deepEqual(array.get('content'), [1, 5]); + }); + + QUnit.test('shiftObject - removes from start of arrangedContent', function () { + var shifted = undefined; + _emberMetal.run(function () { + shifted = array.shiftObject(); + }); + equal(shifted, '5', 'returns first object'); + deepEqual(array.get('content'), [1, 2, 4], 'removes object from content'); + }); + + QUnit.test('slice - returns a slice of the arrangedContent', function () { + deepEqual(array.slice(1, 3), ['4', '2'], 'returns sliced arrangedContent'); + }); + + QUnit.test('toArray - returns copy of arrangedContent', function () { + deepEqual(array.toArray(), ['5', '4', '2', '1']); + }); + + QUnit.test('without - returns arrangedContent without object', function () { + deepEqual(array.without('2'), ['5', '4', '1'], 'returns arranged without object'); + }); + + QUnit.test('lastObject - returns last arranged object', function () { + equal(array.get('lastObject'), '1', 'returns last arranged object'); + }); + + QUnit.test('firstObject - returns first arranged object', function () { + equal(array.get('firstObject'), '5', 'returns first arranged object'); + }); + + QUnit.test('arrangedContentArray{Will,Did}Change are called when the arranged content changes', function () { + // The behaviour covered by this test may change in the future if we decide + // that built-in array methods are not overridable. + + var willChangeCallCount = 0; + var didChangeCallCount = 0; + + var content = _emberRuntimeSystemNative_array.A([1, 2, 3]); + _emberRuntimeSystemArray_proxy.default.extend({ + arrangedContentArrayWillChange: function () { + willChangeCallCount++; + this._super.apply(this, arguments); + }, + arrangedContentArrayDidChange: function () { + didChangeCallCount++; + this._super.apply(this, arguments); + } + }).create({ content: content }); + + equal(willChangeCallCount, 0); + equal(didChangeCallCount, 0); + + content.pushObject(4); + content.pushObject(5); + + equal(willChangeCallCount, 2); + equal(didChangeCallCount, 2); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/arranged_content_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/array_proxy'); + test('ember-runtime/tests/system/array_proxy/arranged_content_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/array_proxy/arranged_content_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/arranged_content_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/array_proxy'); + QUnit.test('ember-runtime/tests/system/array_proxy/arranged_content_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/array_proxy/arranged_content_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/content_change_test', ['exports', 'ember-metal', 'ember-runtime/computed/computed_macros', 'ember-runtime/system/array_proxy', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeComputedComputed_macros, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemNative_array) { + 'use strict'; + + QUnit.module('ArrayProxy - content change'); + + QUnit.test('should update length for null content', function () { + var proxy = _emberRuntimeSystemArray_proxy.default.create({ + content: _emberRuntimeSystemNative_array.A([1, 2, 3]) + }); + + equal(proxy.get('length'), 3, 'precond - length is 3'); + + proxy.set('content', null); + + equal(proxy.get('length'), 0, 'length updates'); + }); + + QUnit.test('should update length for null content when there is a computed property watching length', function () { + var proxy = _emberRuntimeSystemArray_proxy.default.extend({ + isEmpty: _emberRuntimeComputedComputed_macros.not('length') + }).create({ + content: _emberRuntimeSystemNative_array.A([1, 2, 3]) + }); + + equal(proxy.get('length'), 3, 'precond - length is 3'); + + // Consume computed property that depends on length + proxy.get('isEmpty'); + + // update content + proxy.set('content', null); + + equal(proxy.get('length'), 0, 'length updates'); + }); + + QUnit.test('The `arrangedContentWillChange` method is invoked before `content` is changed.', function () { + var callCount = 0; + var expectedLength = undefined; + + var proxy = _emberRuntimeSystemArray_proxy.default.extend({ + arrangedContentWillChange: function () { + equal(this.get('arrangedContent.length'), expectedLength, 'hook should be invoked before array has changed'); + callCount++; + } + }).create({ content: _emberRuntimeSystemNative_array.A([1, 2, 3]) }); + + proxy.pushObject(4); + equal(callCount, 0, 'pushing content onto the array doesn\'t trigger it'); + + proxy.get('content').pushObject(5); + equal(callCount, 0, 'pushing content onto the content array doesn\'t trigger it'); + + expectedLength = 5; + proxy.set('content', _emberRuntimeSystemNative_array.A(['a', 'b'])); + equal(callCount, 1, 'replacing the content array triggers the hook'); + }); + + QUnit.test('The `arrangedContentDidChange` method is invoked after `content` is changed.', function () { + var callCount = 0; + var expectedLength = undefined; + + var proxy = _emberRuntimeSystemArray_proxy.default.extend({ + arrangedContentDidChange: function () { + equal(this.get('arrangedContent.length'), expectedLength, 'hook should be invoked after array has changed'); + callCount++; + } + }).create({ + content: _emberRuntimeSystemNative_array.A([1, 2, 3]) + }); + + equal(callCount, 0, 'hook is not called after creating the object'); + + proxy.pushObject(4); + equal(callCount, 0, 'pushing content onto the array doesn\'t trigger it'); + + proxy.get('content').pushObject(5); + equal(callCount, 0, 'pushing content onto the content array doesn\'t trigger it'); + + expectedLength = 2; + proxy.set('content', _emberRuntimeSystemNative_array.A(['a', 'b'])); + equal(callCount, 1, 'replacing the content array triggers the hook'); + }); + + QUnit.test('The ArrayProxy doesn\'t explode when assigned a destroyed object', function () { + var proxy1 = _emberRuntimeSystemArray_proxy.default.create(); + var proxy2 = _emberRuntimeSystemArray_proxy.default.create(); + + _emberMetal.run(function () { + return proxy1.destroy(); + }); + + _emberMetal.set(proxy2, 'content', proxy1); + + ok(true, 'No exception was raised'); + }); + + QUnit.test('arrayContent{Will,Did}Change are called when the content changes', function () { + // The behaviour covered by this test may change in the future if we decide + // that built-in array methods are not overridable. + + var willChangeCallCount = 0; + var didChangeCallCount = 0; + + var content = _emberRuntimeSystemNative_array.A([1, 2, 3]); + _emberRuntimeSystemArray_proxy.default.extend({ + arrayContentWillChange: function () { + willChangeCallCount++; + this._super.apply(this, arguments); + }, + arrayContentDidChange: function () { + didChangeCallCount++; + this._super.apply(this, arguments); + } + }).create({ content: content }); + + equal(willChangeCallCount, 0); + equal(didChangeCallCount, 0); + + content.pushObject(4); + content.pushObject(5); + + equal(willChangeCallCount, 2); + equal(didChangeCallCount, 2); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/content_change_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/array_proxy'); + test('ember-runtime/tests/system/array_proxy/content_change_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/array_proxy/content_change_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/content_change_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/array_proxy'); + QUnit.test('ember-runtime/tests/system/array_proxy/content_change_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/array_proxy/content_change_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/content_update_test', ['exports', 'ember-metal', 'ember-runtime/system/array_proxy', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemNative_array) { + 'use strict'; + + QUnit.module('Ember.ArrayProxy - content update'); + + QUnit.test('The `contentArrayDidChange` method is invoked after `content` is updated.', function () { + var observerCalled = false; + var proxy = _emberRuntimeSystemArray_proxy.default.extend({ + arrangedContent: _emberMetal.computed('content', function (key) { + return _emberRuntimeSystemNative_array.A(this.get('content').slice()); + }), + + contentArrayDidChange: function (array, idx, removedCount, addedCount) { + observerCalled = true; + return this._super(array, idx, removedCount, addedCount); + } + }).create({ + content: _emberRuntimeSystemNative_array.A() + }); + + proxy.pushObject(1); + + ok(observerCalled, 'contentArrayDidChange is invoked'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/content_update_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/array_proxy'); + test('ember-runtime/tests/system/array_proxy/content_update_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/array_proxy/content_update_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/content_update_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/array_proxy'); + QUnit.test('ember-runtime/tests/system/array_proxy/content_update_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/array_proxy/content_update_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/length_test', ['exports', 'ember-runtime/system/array_proxy', 'ember-runtime/system/object', 'ember-metal', 'ember-runtime/system/native_array'], function (exports, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemObject, _emberMetal, _emberRuntimeSystemNative_array) { + 'use strict'; + + QUnit.module('Ember.ArrayProxy - content change (length)'); + + QUnit.test('array proxy + aliasedProperty complex test', function () { + var aCalled = undefined, + bCalled = undefined, + cCalled = undefined, + dCalled = undefined, + eCalled = undefined; + + aCalled = bCalled = cCalled = dCalled = eCalled = 0; + + var obj = _emberRuntimeSystemObject.default.extend({ + colors: _emberMetal.computed.reads('model'), + length: _emberMetal.computed.reads('colors.length'), + + a: _emberMetal.observer('length', function () { + return aCalled++; + }), + b: _emberMetal.observer('colors.length', function () { + return bCalled++; + }), + c: _emberMetal.observer('colors.content.length', function () { + return cCalled++; + }), + d: _emberMetal.observer('colors.[]', function () { + return dCalled++; + }), + e: _emberMetal.observer('colors.content.[]', function () { + return eCalled++; + }) + }).create(); + + obj.set('model', _emberRuntimeSystemArray_proxy.default.create({ + content: _emberRuntimeSystemNative_array.A(['red', 'yellow', 'blue']) + })); + + equal(obj.get('colors.content.length'), 3); + equal(obj.get('colors.length'), 3); + equal(obj.get('length'), 3); + + equal(aCalled, 1, 'expected observer `length` to be called ONCE'); + equal(bCalled, 1, 'expected observer `colors.length` to be called ONCE'); + equal(cCalled, 1, 'expected observer `colors.content.length` to be called ONCE'); + equal(dCalled, 1, 'expected observer `colors.[]` to be called ONCE'); + equal(eCalled, 1, 'expected observer `colors.content.[]` to be called ONCE'); + + obj.get('colors').pushObjects(['green', 'red']); + + equal(obj.get('colors.content.length'), 5); + equal(obj.get('colors.length'), 5); + equal(obj.get('length'), 5); + + equal(aCalled, 2, 'expected observer `length` to be called TWICE'); + equal(bCalled, 2, 'expected observer `colors.length` to be called TWICE'); + equal(cCalled, 2, 'expected observer `colors.content.length` to be called TWICE'); + equal(dCalled, 2, 'expected observer `colors.[]` to be called TWICE'); + equal(eCalled, 2, 'expected observer `colors.content.[]` to be called TWICE'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/length_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/array_proxy'); + test('ember-runtime/tests/system/array_proxy/length_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/array_proxy/length_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/length_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/array_proxy'); + QUnit.test('ember-runtime/tests/system/array_proxy/length_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/array_proxy/length_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/suite_test', ['exports', 'ember-runtime/tests/suites/mutable_array', 'ember-runtime/system/array_proxy', 'ember-metal', 'ember-runtime/system/native_array'], function (exports, _emberRuntimeTestsSuitesMutable_array, _emberRuntimeSystemArray_proxy, _emberMetal, _emberRuntimeSystemNative_array) { + 'use strict'; + + _emberRuntimeTestsSuitesMutable_array.default.extend({ + name: 'Ember.ArrayProxy', + + newObject: function (ary) { + var ret = ary ? ary.slice() : this.newFixture(3); + return _emberRuntimeSystemArray_proxy.default.create({ content: _emberRuntimeSystemNative_array.A(ret) }); + }, + + mutate: function (obj) { + obj.pushObject(_emberMetal.get(obj, 'length') + 1); + }, + + toArray: function (obj) { + return obj.toArray ? obj.toArray() : obj.slice(); + } + }).run(); +}); +enifed('ember-runtime/tests/system/array_proxy/suite_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/array_proxy'); + test('ember-runtime/tests/system/array_proxy/suite_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/array_proxy/suite_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/suite_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/array_proxy'); + QUnit.test('ember-runtime/tests/system/array_proxy/suite_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/array_proxy/suite_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/watching_and_listening_test', ['exports', 'ember-metal', 'ember-runtime/system/array_proxy', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemNative_array) { + 'use strict'; + + function sortedListenersFor(obj, eventName) { + return _emberMetal.listenersFor(obj, eventName).sort(function (listener1, listener2) { + return listener1[1] > listener2[1] ? -1 : 1; + }); + } + + QUnit.module('ArrayProxy - watching and listening'); + + QUnit.test('setting \'content\' adds listeners correctly', function () { + var content = _emberRuntimeSystemNative_array.A(); + var proxy = _emberRuntimeSystemArray_proxy.default.create(); + + deepEqual(sortedListenersFor(content, '@array:before'), []); + deepEqual(sortedListenersFor(content, '@array:change'), []); + + proxy.set('content', content); + + deepEqual(sortedListenersFor(content, '@array:before'), [[proxy, 'contentArrayWillChange'], [proxy, 'arrangedContentArrayWillChange']]); + deepEqual(sortedListenersFor(content, '@array:change'), [[proxy, 'contentArrayDidChange'], [proxy, 'arrangedContentArrayDidChange']]); + }); + + QUnit.test('changing \'content\' adds and removes listeners correctly', function () { + var content1 = _emberRuntimeSystemNative_array.A(); + var content2 = _emberRuntimeSystemNative_array.A(); + var proxy = _emberRuntimeSystemArray_proxy.default.create({ content: content1 }); + + deepEqual(sortedListenersFor(content1, '@array:before'), [[proxy, 'contentArrayWillChange'], [proxy, 'arrangedContentArrayWillChange']]); + deepEqual(sortedListenersFor(content1, '@array:change'), [[proxy, 'contentArrayDidChange'], [proxy, 'arrangedContentArrayDidChange']]); + + proxy.set('content', content2); + + deepEqual(sortedListenersFor(content1, '@array:before'), []); + deepEqual(sortedListenersFor(content1, '@array:change'), []); + deepEqual(sortedListenersFor(content2, '@array:before'), [[proxy, 'contentArrayWillChange'], [proxy, 'arrangedContentArrayWillChange']]); + deepEqual(sortedListenersFor(content2, '@array:change'), [[proxy, 'contentArrayDidChange'], [proxy, 'arrangedContentArrayDidChange']]); + }); + + QUnit.test('regression test for https://github.com/emberjs/ember.js/issues/12475', function () { + var item1a = { id: 1 }; + var item1b = { id: 2 }; + var item1c = { id: 3 }; + var content1 = _emberRuntimeSystemNative_array.A([item1a, item1b, item1c]); + + var proxy = _emberRuntimeSystemArray_proxy.default.create({ content: content1 }); + var obj = { proxy: proxy }; + + _emberMetal.defineProperty(obj, 'ids', _emberMetal.computed('proxy.@each.id', function () { + return _emberMetal.get(this, 'proxy').mapBy('id'); + })); + + // These manually added observers are to simulate the observers added by the + // rendering process in a template like: + // + // {{#each items as |item|}} + // {{item.id}} + // {{/each}} + _emberMetal.addObserver(item1a, 'id', function () {}); + _emberMetal.addObserver(item1b, 'id', function () {}); + _emberMetal.addObserver(item1c, 'id', function () {}); + + // The EachProxy has not yet been consumed. Only the manually added + // observers are watching. + equal(_emberMetal.watcherCount(item1a, 'id'), 1); + equal(_emberMetal.watcherCount(item1b, 'id'), 1); + equal(_emberMetal.watcherCount(item1c, 'id'), 1); + + // Consume the each proxy. This causes the EachProxy to add two observers + // per item: one for "before" events and one for "after" events. + deepEqual(_emberMetal.get(obj, 'ids'), [1, 2, 3]); + + // For each item, the two each proxy observers and one manual added observer + // are watching. + equal(_emberMetal.watcherCount(item1a, 'id'), 3); + equal(_emberMetal.watcherCount(item1b, 'id'), 3); + equal(_emberMetal.watcherCount(item1c, 'id'), 3); + + // This should be a no-op because observers do not fire if the value + // 1. is an object and 2. is the same as the old value. + proxy.set('content', content1); + + equal(_emberMetal.watcherCount(item1a, 'id'), 3); + equal(_emberMetal.watcherCount(item1b, 'id'), 3); + equal(_emberMetal.watcherCount(item1c, 'id'), 3); + + // This is repeated to catch the regression. It should still be a no-op. + proxy.set('content', content1); + + equal(_emberMetal.watcherCount(item1a, 'id'), 3); + equal(_emberMetal.watcherCount(item1b, 'id'), 3); + equal(_emberMetal.watcherCount(item1c, 'id'), 3); + + // Set the content to a new array with completely different items and + // repeat the process. + var item2a = { id: 4 }; + var item2b = { id: 5 }; + var item2c = { id: 6 }; + var content2 = _emberRuntimeSystemNative_array.A([item2a, item2b, item2c]); + + _emberMetal.addObserver(item2a, 'id', function () {}); + _emberMetal.addObserver(item2b, 'id', function () {}); + _emberMetal.addObserver(item2c, 'id', function () {}); + + proxy.set('content', content2); + + deepEqual(_emberMetal.get(obj, 'ids'), [4, 5, 6]); + + equal(_emberMetal.watcherCount(item2a, 'id'), 3); + equal(_emberMetal.watcherCount(item2b, 'id'), 3); + equal(_emberMetal.watcherCount(item2c, 'id'), 3); + + // Ensure that the observers added by the EachProxy on all items in the + // first content array have been torn down. + equal(_emberMetal.watcherCount(item1a, 'id'), 1); + equal(_emberMetal.watcherCount(item1b, 'id'), 1); + equal(_emberMetal.watcherCount(item1c, 'id'), 1); + + proxy.set('content', content2); + + equal(_emberMetal.watcherCount(item2a, 'id'), 3); + equal(_emberMetal.watcherCount(item2b, 'id'), 3); + equal(_emberMetal.watcherCount(item2c, 'id'), 3); + + proxy.set('content', content2); + + equal(_emberMetal.watcherCount(item2a, 'id'), 3); + equal(_emberMetal.watcherCount(item2b, 'id'), 3); + equal(_emberMetal.watcherCount(item2c, 'id'), 3); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/watching_and_listening_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/array_proxy'); + test('ember-runtime/tests/system/array_proxy/watching_and_listening_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/array_proxy/watching_and_listening_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/watching_and_listening_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/array_proxy'); + QUnit.test('ember-runtime/tests/system/array_proxy/watching_and_listening_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/array_proxy/watching_and_listening_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/core_object_test', ['exports', 'ember-runtime/system/core_object', 'ember-metal/property_set', 'ember-metal/mixin'], function (exports, _emberRuntimeSystemCore_object, _emberMetalProperty_set, _emberMetalMixin) { + 'use strict'; + + QUnit.module('Ember.CoreObject'); + + QUnit.test('works with new (one arg)', function () { + var obj = new _emberRuntimeSystemCore_object.default({ + firstName: 'Stef', + lastName: 'Penner' + }); + + equal(obj.firstName, 'Stef'); + equal(obj.lastName, 'Penner'); + }); + + QUnit.test('works with new (> 1 arg)', function () { + var obj = new _emberRuntimeSystemCore_object.default({ + firstName: 'Stef', + lastName: 'Penner' + }, { + other: 'name' + }); + + equal(obj.firstName, 'Stef'); + equal(obj.lastName, 'Penner'); + + equal(obj.other, undefined); // doesn't support multiple pojo' to the constructor + }); + + QUnit.test('toString should be not be added as a property when calling toString()', function () { + var obj = new _emberRuntimeSystemCore_object.default({ + firstName: 'Foo', + lastName: 'Bar' + }); + + obj.toString(); + + notOk(obj.hasOwnProperty('toString'), 'Calling toString() should not create a toString class property'); + }); + + QUnit.test('[POST_INIT] invoked during construction', function (assert) { + var _CoreObject$extend; + + var callCount = 0; + var Obj = _emberRuntimeSystemCore_object.default.extend((_CoreObject$extend = {}, _CoreObject$extend[_emberRuntimeSystemCore_object.POST_INIT] = function () { + callCount++; + }, _CoreObject$extend)); + + equal(callCount, 0); + + Obj.create(); + + equal(callCount, 1); + }); + + QUnit.test('[POST_INIT] invoked before finishChains', function (assert) { + var _CoreObject$extend2; + + var callCount = 0; + + var Obj = _emberRuntimeSystemCore_object.default.extend((_CoreObject$extend2 = {}, _CoreObject$extend2[_emberRuntimeSystemCore_object.POST_INIT] = function () { + _emberMetalProperty_set.set(this, 'hi', 1); + }, _CoreObject$extend2.hiDidChange = _emberMetalMixin.observer('hi', function () { + callCount++; + }), _CoreObject$extend2)); + + equal(callCount, 0); + + var obj = Obj.create(); + + equal(callCount, 0); + + _emberMetalProperty_set.set(obj, 'hi', 2); + + equal(callCount, 1); + }); +}); +enifed('ember-runtime/tests/system/core_object_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system'); + test('ember-runtime/tests/system/core_object_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/core_object_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/core_object_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system'); + QUnit.test('ember-runtime/tests/system/core_object_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/core_object_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/lazy_load_test', ['exports', 'ember-metal', 'ember-runtime/system/lazy_load'], function (exports, _emberMetal, _emberRuntimeSystemLazy_load) { + 'use strict'; + + QUnit.module('Lazy Loading', { + teardown: function () { + var keys = Object.keys(_emberRuntimeSystemLazy_load._loaded); + for (var i = 0; i < keys.length; i++) { + delete _emberRuntimeSystemLazy_load._loaded[keys[i]]; + } + } + }); + + QUnit.test('if a load hook is registered, it is executed when runLoadHooks are exected', function () { + var count = 0; + + _emberMetal.run(function () { + _emberRuntimeSystemLazy_load.onLoad('__test_hook__', function (object) { + count += object; + }); + }); + + _emberMetal.run(function () { + _emberRuntimeSystemLazy_load.runLoadHooks('__test_hook__', 1); + }); + + equal(count, 1, 'the object was passed into the load hook'); + }); + + QUnit.test('if runLoadHooks was already run, it executes newly added hooks immediately', function () { + var count = 0; + _emberMetal.run(function () { + _emberRuntimeSystemLazy_load.onLoad('__test_hook__', function (object) { + return count += object; + }); + }); + + _emberMetal.run(function () { + return _emberRuntimeSystemLazy_load.runLoadHooks('__test_hook__', 1); + }); + + count = 0; + _emberMetal.run(function () { + _emberRuntimeSystemLazy_load.onLoad('__test_hook__', function (object) { + return count += object; + }); + }); + + equal(count, 1, 'the original object was passed into the load hook'); + }); + + QUnit.test('hooks in ENV.EMBER_LOAD_HOOKS[\'hookName\'] get executed', function () { + // Note that the necessary code to perform this test is run before + // the Ember lib is loaded in tests/index.html + + _emberMetal.run(function () { + _emberRuntimeSystemLazy_load.runLoadHooks('__before_ember_test_hook__', 1); + }); + + equal(window.ENV.__test_hook_count__, 1, 'the object was passed into the load hook'); + }); + + if (typeof window === 'object' && typeof window.dispatchEvent === 'function' && typeof CustomEvent === 'function') { + QUnit.test('load hooks trigger a custom event', function () { + var eventObject = 'super duper awesome events'; + + window.addEventListener('__test_hook_for_events__', function (e) { + ok(true, 'custom event was fired'); + equal(e.detail, eventObject, 'event details are provided properly'); + }); + + _emberMetal.run(function () { + _emberRuntimeSystemLazy_load.runLoadHooks('__test_hook_for_events__', eventObject); + }); + }); + } +}); +enifed('ember-runtime/tests/system/lazy_load_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system'); + test('ember-runtime/tests/system/lazy_load_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/lazy_load_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/lazy_load_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system'); + QUnit.test('ember-runtime/tests/system/lazy_load_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/lazy_load_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/namespace/base_test', ['exports', 'ember-environment', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/system/namespace'], function (exports, _emberEnvironment, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeSystemNamespace) { + 'use strict'; + + var originalLookup = _emberEnvironment.context.lookup; + var lookup = undefined; + + QUnit.module('Namespace', { + setup: function () { + _emberRuntimeSystemNamespace.setSearchDisabled(false); + + lookup = _emberEnvironment.context.lookup = {}; + }, + teardown: function () { + _emberRuntimeSystemNamespace.setSearchDisabled(false); + + for (var prop in lookup) { + if (lookup[prop]) { + _emberMetal.run(lookup[prop], 'destroy'); + } + } + + _emberEnvironment.context.lookup = originalLookup; + } + }); + + QUnit.test('Namespace should be a subclass of EmberObject', function () { + ok(_emberRuntimeSystemObject.default.detect(_emberRuntimeSystemNamespace.default)); + }); + + QUnit.test('Namespace should be duck typed', function () { + ok(_emberMetal.get(_emberRuntimeSystemNamespace.default.create(), 'isNamespace'), 'isNamespace property is true'); + }); + + QUnit.test('Namespace is found and named', function () { + var nsA = lookup.NamespaceA = _emberRuntimeSystemNamespace.default.create(); + equal(nsA.toString(), 'NamespaceA', 'namespaces should have a name if they are on lookup'); + + var nsB = lookup.NamespaceB = _emberRuntimeSystemNamespace.default.create(); + equal(nsB.toString(), 'NamespaceB', 'namespaces work if created after the first namespace processing pass'); + }); + + QUnit.test('Classes under an Namespace are properly named', function () { + var nsA = lookup.NamespaceA = _emberRuntimeSystemNamespace.default.create(); + nsA.Foo = _emberRuntimeSystemObject.default.extend(); + equal(nsA.Foo.toString(), 'NamespaceA.Foo', 'Classes pick up their parent namespace'); + + nsA.Bar = _emberRuntimeSystemObject.default.extend(); + equal(nsA.Bar.toString(), 'NamespaceA.Bar', 'New Classes get the naming treatment too'); + + var nsB = lookup.NamespaceB = _emberRuntimeSystemNamespace.default.create(); + nsB.Foo = _emberRuntimeSystemObject.default.extend(); + equal(nsB.Foo.toString(), 'NamespaceB.Foo', 'Classes in new namespaces get the naming treatment'); + }); + + //test("Classes under Ember are properly named", function() { + // // ES6TODO: This test does not work reliably when running independent package build with Broccoli config. + // Ember.TestObject = EmberObject.extend({}); + // equal(Ember.TestObject.toString(), "Ember.TestObject", "class under Ember is given a string representation"); + //}); + + QUnit.test('Lowercase namespaces are no longer supported', function () { + var nsC = lookup.namespaceC = _emberRuntimeSystemNamespace.default.create(); + equal(nsC.toString(), undefined); + }); + + QUnit.test('A namespace can be assigned a custom name', function () { + var nsA = _emberRuntimeSystemNamespace.default.create({ + name: 'NamespaceA' + }); + + var nsB = lookup.NamespaceB = _emberRuntimeSystemNamespace.default.create({ + name: 'CustomNamespaceB' + }); + + nsA.Foo = _emberRuntimeSystemObject.default.extend(); + nsB.Foo = _emberRuntimeSystemObject.default.extend(); + + equal(nsA.Foo.toString(), 'NamespaceA.Foo', 'The namespace\'s name is used when the namespace is not in the lookup object'); + equal(nsB.Foo.toString(), 'CustomNamespaceB.Foo', 'The namespace\'s name is used when the namespace is in the lookup object'); + }); + + QUnit.test('Calling namespace.nameClasses() eagerly names all classes', function () { + _emberRuntimeSystemNamespace.setSearchDisabled(true); + + var namespace = lookup.NS = _emberRuntimeSystemNamespace.default.create(); + + namespace.ClassA = _emberRuntimeSystemObject.default.extend(); + namespace.ClassB = _emberRuntimeSystemObject.default.extend(); + + _emberRuntimeSystemNamespace.default.processAll(); + + equal(namespace.ClassA.toString(), 'NS.ClassA'); + equal(namespace.ClassB.toString(), 'NS.ClassB'); + }); + + QUnit.test('A namespace can be looked up by its name', function () { + var NS = lookup.NS = _emberRuntimeSystemNamespace.default.create(); + var UI = lookup.UI = _emberRuntimeSystemNamespace.default.create(); + var CF = lookup.CF = _emberRuntimeSystemNamespace.default.create(); + + equal(_emberRuntimeSystemNamespace.default.byName('NS'), NS); + equal(_emberRuntimeSystemNamespace.default.byName('UI'), UI); + equal(_emberRuntimeSystemNamespace.default.byName('CF'), CF); + }); + + QUnit.test('A nested namespace can be looked up by its name', function () { + var UI = lookup.UI = _emberRuntimeSystemNamespace.default.create(); + UI.Nav = _emberRuntimeSystemNamespace.default.create(); + + equal(_emberRuntimeSystemNamespace.default.byName('UI.Nav'), UI.Nav); + }); + + QUnit.test('Destroying a namespace before caching lookup removes it from the list of namespaces', function () { + var CF = lookup.CF = _emberRuntimeSystemNamespace.default.create(); + + _emberMetal.run(CF, 'destroy'); + equal(_emberRuntimeSystemNamespace.default.byName('CF'), undefined, 'namespace can not be found after destroyed'); + }); + + QUnit.test('Destroying a namespace after looking up removes it from the list of namespaces', function () { + var CF = lookup.CF = _emberRuntimeSystemNamespace.default.create(); + + equal(_emberRuntimeSystemNamespace.default.byName('CF'), CF, 'precondition - namespace can be looked up by name'); + + _emberMetal.run(CF, 'destroy'); + equal(_emberRuntimeSystemNamespace.default.byName('CF'), undefined, 'namespace can not be found after destroyed'); + }); +}); +enifed('ember-runtime/tests/system/namespace/base_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/namespace'); + test('ember-runtime/tests/system/namespace/base_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/namespace/base_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/namespace/base_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/namespace'); + QUnit.test('ember-runtime/tests/system/namespace/base_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/namespace/base_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/native_array/a_test', ['exports', 'ember-runtime/mixins/array', 'ember-runtime/system/native_array'], function (exports, _emberRuntimeMixinsArray, _emberRuntimeSystemNative_array) { + 'use strict'; + + QUnit.module('Ember.A'); + + QUnit.test('Ember.A', function () { + deepEqual(_emberRuntimeSystemNative_array.A([1, 2]), [1, 2], 'array values were not be modified'); + deepEqual(_emberRuntimeSystemNative_array.A(), [], 'returned an array with no arguments'); + deepEqual(_emberRuntimeSystemNative_array.A(null), [], 'returned an array with a null argument'); + ok(_emberRuntimeMixinsArray.default.detect(_emberRuntimeSystemNative_array.A()), 'returned an ember array'); + ok(_emberRuntimeMixinsArray.default.detect(_emberRuntimeSystemNative_array.A([1, 2])), 'returned an ember array'); + }); +}); +enifed('ember-runtime/tests/system/native_array/a_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/native_array'); + test('ember-runtime/tests/system/native_array/a_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/native_array/a_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/native_array/a_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/native_array'); + QUnit.test('ember-runtime/tests/system/native_array/a_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/native_array/a_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/native_array/copyable_suite_test', ['exports', 'ember-utils', 'ember-runtime/system/native_array', 'ember-runtime/tests/suites/copyable'], function (exports, _emberUtils, _emberRuntimeSystemNative_array, _emberRuntimeTestsSuitesCopyable) { + 'use strict'; + + _emberRuntimeTestsSuitesCopyable.default.extend({ + name: 'NativeArray Copyable', + + newObject: function () { + return _emberRuntimeSystemNative_array.A([_emberUtils.generateGuid()]); + }, + + isEqual: function (a, b) { + if (!(a instanceof Array)) { + return false; + } + + if (!(b instanceof Array)) { + return false; + } + + if (a.length !== b.length) { + return false; + } + + return a[0] === b[0]; + }, + + shouldBeFreezable: false + }).run(); + + QUnit.module('NativeArray Copyable'); + + QUnit.test('deep copy is respected', function () { + var array = _emberRuntimeSystemNative_array.A([{ id: 1 }, { id: 2 }, { id: 3 }]); + + var copiedArray = array.copy(true); + + deepEqual(copiedArray, array, 'copied array is equivalent'); + ok(copiedArray[0] !== array[0], 'objects inside should be unique'); + }); +}); +enifed('ember-runtime/tests/system/native_array/copyable_suite_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/native_array'); + test('ember-runtime/tests/system/native_array/copyable_suite_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/native_array/copyable_suite_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/native_array/copyable_suite_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/native_array'); + QUnit.test('ember-runtime/tests/system/native_array/copyable_suite_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/native_array/copyable_suite_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/native_array/suite_test', ['exports', 'ember-runtime/system/native_array', 'ember-runtime/tests/suites/mutable_array'], function (exports, _emberRuntimeSystemNative_array, _emberRuntimeTestsSuitesMutable_array) { + 'use strict'; + + _emberRuntimeTestsSuitesMutable_array.default.extend({ + name: 'Native Array', + + newObject: function (ary) { + return _emberRuntimeSystemNative_array.A(ary ? ary.slice() : this.newFixture(3)); + }, + + mutate: function (obj) { + obj.pushObject(obj.length + 1); + }, + + toArray: function (obj) { + return obj.slice(); // make a copy. + } + }).run(); +}); +enifed('ember-runtime/tests/system/native_array/suite_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/native_array'); + test('ember-runtime/tests/system/native_array/suite_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/native_array/suite_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/native_array/suite_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/native_array'); + QUnit.test('ember-runtime/tests/system/native_array/suite_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/native_array/suite_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/computed_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject) { + 'use strict'; + + function K() { + return this; + } + + QUnit.module('EmberObject computed property'); + + _internalTestHelpers.testWithDefault('computed property on instance', function (get, set) { + var MyClass = _emberRuntimeSystemObject.default.extend({ + foo: _emberMetal.computed(function () { + return 'FOO'; + }) + }); + + equal(get(new MyClass(), 'foo'), 'FOO'); + }); + + _internalTestHelpers.testWithDefault('computed property on subclass', function (get, set) { + var MyClass = _emberRuntimeSystemObject.default.extend({ + foo: _emberMetal.computed(function () { + return 'FOO'; + }) + }); + + var Subclass = MyClass.extend({ + foo: _emberMetal.computed(function () { + return 'BAR'; + }) + }); + + equal(get(new Subclass(), 'foo'), 'BAR'); + }); + + _internalTestHelpers.testWithDefault('replacing computed property with regular val', function (get, set) { + var MyClass = _emberRuntimeSystemObject.default.extend({ + foo: _emberMetal.computed(function () { + return 'FOO'; + }) + }); + + var Subclass = MyClass.extend({ + foo: 'BAR' + }); + + equal(get(new Subclass(), 'foo'), 'BAR'); + }); + + _internalTestHelpers.testWithDefault('complex depndent keys', function (get, set) { + var MyClass = _emberRuntimeSystemObject.default.extend({ + + init: function () { + this._super.apply(this, arguments); + set(this, 'bar', { baz: 'BIFF' }); + }, + + count: 0, + + foo: _emberMetal.computed(function () { + set(this, 'count', get(this, 'count') + 1); + return _emberMetal.get(get(this, 'bar'), 'baz') + ' ' + get(this, 'count'); + }).property('bar.baz') + + }); + + var Subclass = MyClass.extend({ + count: 20 + }); + + var obj1 = new MyClass(); + var obj2 = new Subclass(); + + equal(get(obj1, 'foo'), 'BIFF 1'); + equal(get(obj2, 'foo'), 'BIFF 21'); + + set(get(obj1, 'bar'), 'baz', 'BLARG'); + + equal(get(obj1, 'foo'), 'BLARG 2'); + equal(get(obj2, 'foo'), 'BIFF 21'); + + set(get(obj2, 'bar'), 'baz', 'BOOM'); + + equal(get(obj1, 'foo'), 'BLARG 2'); + equal(get(obj2, 'foo'), 'BOOM 22'); + }); + + _internalTestHelpers.testWithDefault('complex dependent keys changing complex dependent keys', function (get, set) { + var MyClass = _emberRuntimeSystemObject.default.extend({ + init: function () { + this._super.apply(this, arguments); + set(this, 'bar', { baz: 'BIFF' }); + }, + + count: 0, + + foo: _emberMetal.computed(function () { + set(this, 'count', get(this, 'count') + 1); + return _emberMetal.get(get(this, 'bar'), 'baz') + ' ' + get(this, 'count'); + }).property('bar.baz') + }); + + var Subclass = MyClass.extend({ + init: function () { + this._super.apply(this, arguments); + set(this, 'bar2', { baz: 'BIFF2' }); + }, + + count: 0, + + foo: _emberMetal.computed(function () { + set(this, 'count', get(this, 'count') + 1); + return _emberMetal.get(get(this, 'bar2'), 'baz') + ' ' + get(this, 'count'); + }).property('bar2.baz') + }); + + var obj2 = new Subclass(); + + equal(get(obj2, 'foo'), 'BIFF2 1'); + + set(get(obj2, 'bar'), 'baz', 'BLARG'); + equal(get(obj2, 'foo'), 'BIFF2 1', 'should not invalidate property'); + + set(get(obj2, 'bar2'), 'baz', 'BLARG'); + equal(get(obj2, 'foo'), 'BLARG 2', 'should invalidate property'); + }); + + QUnit.test('can retrieve metadata for a computed property', function () { + var MyClass = _emberRuntimeSystemObject.default.extend({ + computedProperty: _emberMetal.computed(function () {}).meta({ key: 'keyValue' }) + }); + + equal(_emberMetal.get(MyClass.metaForProperty('computedProperty'), 'key'), 'keyValue', 'metadata saved on the computed property can be retrieved'); + + var ClassWithNoMetadata = _emberRuntimeSystemObject.default.extend({ + computedProperty: _emberMetal.computed(function () {}).volatile(), + + staticProperty: 12 + }); + + equal(typeof ClassWithNoMetadata.metaForProperty('computedProperty'), 'object', 'returns empty hash if no metadata has been saved'); + + expectAssertion(function () { + ClassWithNoMetadata.metaForProperty('nonexistentProperty'); + }, 'metaForProperty() could not find a computed property with key \'nonexistentProperty\'.'); + + expectAssertion(function () { + ClassWithNoMetadata.metaForProperty('staticProperty'); + }, 'metaForProperty() could not find a computed property with key \'staticProperty\'.'); + }); + + QUnit.test('can iterate over a list of computed properties for a class', function () { + var MyClass = _emberRuntimeSystemObject.default.extend({ + foo: _emberMetal.computed(function () {}), + + fooDidChange: _emberMetal.observer('foo', function () {}), + + bar: _emberMetal.computed(function () {}), + + qux: _emberMetal.alias('foo') + }); + + var SubClass = MyClass.extend({ + baz: _emberMetal.computed(function () {}) + }); + + SubClass.reopen({ + bat: _emberMetal.computed(function () {}).meta({ iAmBat: true }) + }); + + var list = []; + + MyClass.eachComputedProperty(function (name) { + list.push(name); + }); + + deepEqual(list.sort(), ['bar', 'foo', 'qux'], 'watched and unwatched computed properties are iterated'); + + list = []; + + SubClass.eachComputedProperty(function (name, meta) { + list.push(name); + + if (name === 'bat') { + deepEqual(meta, { iAmBat: true }); + } else { + deepEqual(meta, {}); + } + }); + + deepEqual(list.sort(), ['bar', 'bat', 'baz', 'foo', 'qux'], 'all inherited properties are included'); + }); + + QUnit.test('list of properties updates when an additional property is added (such cache busting)', function () { + var MyClass = _emberRuntimeSystemObject.default.extend({ + foo: _emberMetal.computed(K), + + fooDidChange: _emberMetal.observer('foo', function () {}), + + bar: _emberMetal.computed(K) + }); + + var list = []; + + MyClass.eachComputedProperty(function (name) { + list.push(name); + }); + + deepEqual(list.sort(), ['bar', 'foo'].sort(), 'expected two computed properties'); + + MyClass.reopen({ + baz: _emberMetal.computed(K) + }); + + MyClass.create(); // force apply mixins + + list = []; + + MyClass.eachComputedProperty(function (name) { + list.push(name); + }); + + deepEqual(list.sort(), ['bar', 'foo', 'baz'].sort(), 'expected three computed properties'); + }); + + QUnit.test('Calling _super in call outside the immediate function of a CP getter works', function () { + function macro(callback) { + return _emberMetal.computed(function () { + return callback.call(this); + }); + } + + var MyClass = _emberRuntimeSystemObject.default.extend({ + foo: _emberMetal.computed(function () { + return 'FOO'; + }) + }); + + var SubClass = MyClass.extend({ + foo: macro(function () { + return this._super(); + }) + }); + + ok(_emberMetal.get(SubClass.create(), 'foo'), 'FOO', 'super value is fetched'); + }); + + QUnit.test('Calling _super in apply outside the immediate function of a CP getter works', function () { + function macro(callback) { + return _emberMetal.computed(function () { + return callback.apply(this); + }); + } + + var MyClass = _emberRuntimeSystemObject.default.extend({ + foo: _emberMetal.computed(function () { + return 'FOO'; + }) + }); + + var SubClass = MyClass.extend({ + foo: macro(function () { + return this._super(); + }) + }); + + ok(_emberMetal.get(SubClass.create(), 'foo'), 'FOO', 'super value is fetched'); + }); +}); +enifed('ember-runtime/tests/system/object/computed_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/computed_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/computed_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/computed_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/computed_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/computed_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/create_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { + 'use strict'; + + QUnit.module('EmberObject.create', {}); + + QUnit.test('simple properties are set', function () { + var o = _emberRuntimeSystemObject.default.create({ ohai: 'there' }); + equal(o.get('ohai'), 'there'); + }); + + QUnit.test('calls computed property setters', function () { + var MyClass = _emberRuntimeSystemObject.default.extend({ + foo: _emberMetal.computed({ + get: function () { + return 'this is not the value you\'re looking for'; + }, + set: function (key, value) { + return value; + } + }) + }); + + var o = MyClass.create({ foo: 'bar' }); + equal(o.get('foo'), 'bar'); + }); + + if (true) { + QUnit.test('sets up mandatory setters for watched simple properties', function () { + var MyClass = _emberRuntimeSystemObject.default.extend({ + foo: null, + bar: null, + fooDidChange: _emberMetal.observer('foo', function () {}) + }); + + var o = MyClass.create({ foo: 'bar', bar: 'baz' }); + equal(o.get('foo'), 'bar'); + + var descriptor = Object.getOwnPropertyDescriptor(o, 'foo'); + ok(descriptor.set, 'Mandatory setter was setup'); + + descriptor = Object.getOwnPropertyDescriptor(o, 'bar'); + ok(!descriptor.set, 'Mandatory setter was not setup'); + }); + } + + QUnit.test('allows bindings to be defined', function () { + var obj = undefined; + + var deprecationMessage = /`Ember.Binding` is deprecated/; + + expectDeprecation(function () { + obj = _emberRuntimeSystemObject.default.create({ + foo: 'foo', + barBinding: 'foo' + }); + }, deprecationMessage); + + equal(obj.get('bar'), 'foo', 'The binding value is correct'); + }); + + QUnit.test('calls setUnknownProperty if defined', function () { + var setUnknownPropertyCalled = false; + + var MyClass = _emberRuntimeSystemObject.default.extend({ + setUnknownProperty: function (key, value) { + setUnknownPropertyCalled = true; + } + }); + + MyClass.create({ foo: 'bar' }); + ok(setUnknownPropertyCalled, 'setUnknownProperty was called'); + }); + + QUnit.test('throws if you try to define a computed property', function () { + expectAssertion(function () { + _emberRuntimeSystemObject.default.create({ + foo: _emberMetal.computed(function () {}) + }); + }, 'Ember.Object.create no longer supports defining computed properties. Define computed properties using extend() or reopen() before calling create().'); + }); + + QUnit.test('throws if you try to call _super in a method', function () { + expectAssertion(function () { + _emberRuntimeSystemObject.default.create({ + foo: function () { + this._super.apply(this, arguments); + } + }); + }, 'Ember.Object.create no longer supports defining methods that call _super.'); + }); + + QUnit.test('throws if you try to \'mixin\' a definition', function () { + var myMixin = _emberMetal.Mixin.create({ + adder: function (arg1, arg2) { + return arg1 + arg2; + } + }); + + expectAssertion(function () { + _emberRuntimeSystemObject.default.create(myMixin); + }, 'Ember.Object.create no longer supports mixing in other definitions, use .extend & .create separately instead.'); + }); + + // This test is for IE8. + QUnit.test('property name is the same as own prototype property', function () { + var MyClass = _emberRuntimeSystemObject.default.extend({ + toString: function () { + return 'MyClass'; + } + }); + + equal(MyClass.create().toString(), 'MyClass', 'should inherit property from the arguments of `EmberObject.create`'); + }); + + QUnit.test('inherits properties from passed in EmberObject', function () { + var baseObj = _emberRuntimeSystemObject.default.create({ foo: 'bar' }); + var secondaryObj = _emberRuntimeSystemObject.default.create(baseObj); + + equal(secondaryObj.foo, baseObj.foo, 'Em.O.create inherits properties from EmberObject parameter'); + }); + + QUnit.test('throws if you try to pass anything a string as a parameter', function () { + var expected = 'EmberObject.create only accepts an objects.'; + + throws(function () { + return _emberRuntimeSystemObject.default.create('some-string'); + }, expected); + }); + + QUnit.test('EmberObject.create can take undefined as a parameter', function () { + var o = _emberRuntimeSystemObject.default.create(undefined); + deepEqual(_emberRuntimeSystemObject.default.create(), o); + }); + + QUnit.test('EmberObject.create can take null as a parameter', function () { + var o = _emberRuntimeSystemObject.default.create(null); + deepEqual(_emberRuntimeSystemObject.default.create(), o); + }); + + QUnit.test('EmberObject.create avoids allocating a binding map when not necessary', function () { + var o = _emberRuntimeSystemObject.default.create(); + var m = _emberMetal.meta(o); + ok(!m.peekBindings(), 'A binding map is not allocated'); + }); +}); +enifed('ember-runtime/tests/system/object/create_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/create_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/create_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/create_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/create_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/create_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/destroy_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject) { + 'use strict'; + + QUnit.module('ember-runtime/system/object/destroy_test'); + + _internalTestHelpers.testBoth('should schedule objects to be destroyed at the end of the run loop', function (get, set) { + var obj = _emberRuntimeSystemObject.default.create(); + var meta = undefined; + + _emberMetal.run(function () { + obj.destroy(); + meta = _emberMetal.peekMeta(obj); + ok(meta, 'meta is not destroyed immediately'); + ok(get(obj, 'isDestroying'), 'object is marked as destroying immediately'); + ok(!get(obj, 'isDestroyed'), 'object is not destroyed immediately'); + }); + + meta = _emberMetal.peekMeta(obj); + ok(get(obj, 'isDestroyed'), 'object is destroyed after run loop finishes'); + }); + + if (true) { + // MANDATORY_SETTER moves value to meta.values + // a destroyed object removes meta but leaves the accessor + // that looks it up + QUnit.test('should raise an exception when modifying watched properties on a destroyed object', function () { + var obj = _emberRuntimeSystemObject.default.extend({ + fooDidChange: _emberMetal.observer('foo', function () {}) + }).create({ + foo: 'bar' + }); + + _emberMetal.run(function () { + return obj.destroy(); + }); + + throws(function () { + return _emberMetal.set(obj, 'foo', 'baz'); + }, Error, 'raises an exception'); + }); + } + + QUnit.test('observers should not fire after an object has been destroyed', function () { + var count = 0; + var obj = _emberRuntimeSystemObject.default.extend({ + fooDidChange: _emberMetal.observer('foo', function () { + count++; + }) + }).create(); + + obj.set('foo', 'bar'); + + equal(count, 1, 'observer was fired once'); + + _emberMetal.run(function () { + _emberMetal.beginPropertyChanges(); + obj.set('foo', 'quux'); + obj.destroy(); + _emberMetal.endPropertyChanges(); + }); + + equal(count, 1, 'observer was not called after object was destroyed'); + }); + + QUnit.test('destroyed objects should not see each others changes during teardown but a long lived object should', function () { + var shouldChange = 0; + var shouldNotChange = 0; + + var objs = {}; + + var A = _emberRuntimeSystemObject.default.extend({ + objs: objs, + isAlive: true, + willDestroy: function () { + this.set('isAlive', false); + }, + bDidChange: _emberMetal.observer('objs.b.isAlive', function () { + shouldNotChange++; + }), + cDidChange: _emberMetal.observer('objs.c.isAlive', function () { + shouldNotChange++; + }) + }); + + var B = _emberRuntimeSystemObject.default.extend({ + objs: objs, + isAlive: true, + willDestroy: function () { + this.set('isAlive', false); + }, + aDidChange: _emberMetal.observer('objs.a.isAlive', function () { + shouldNotChange++; + }), + cDidChange: _emberMetal.observer('objs.c.isAlive', function () { + shouldNotChange++; + }) + }); + + var C = _emberRuntimeSystemObject.default.extend({ + objs: objs, + isAlive: true, + willDestroy: function () { + this.set('isAlive', false); + }, + aDidChange: _emberMetal.observer('objs.a.isAlive', function () { + shouldNotChange++; + }), + bDidChange: _emberMetal.observer('objs.b.isAlive', function () { + shouldNotChange++; + }) + }); + + var LongLivedObject = _emberRuntimeSystemObject.default.extend({ + objs: objs, + isAliveDidChange: _emberMetal.observer('objs.a.isAlive', function () { + shouldChange++; + }) + }); + + objs.a = new A(); + + objs.b = new B(); + + objs.c = new C(); + + new LongLivedObject(); + + _emberMetal.run(function () { + var keys = Object.keys(objs); + for (var i = 0; i < keys.length; i++) { + objs[keys[i]].destroy(); + } + }); + + equal(shouldNotChange, 0, 'destroyed graph objs should not see change in willDestroy'); + equal(shouldChange, 1, 'long lived should see change in willDestroy'); + }); + + QUnit.test('bindings should be synced when are updated in the willDestroy hook', function () { + var bar = _emberRuntimeSystemObject.default.create({ + value: false, + willDestroy: function () { + this.set('value', true); + } + }); + + var foo = _emberRuntimeSystemObject.default.create({ + value: null, + bar: bar + }); + + _emberMetal.run(function () { + var deprecationMessage = /`Ember.Binding` is deprecated/; + + expectDeprecation(function () { + _emberMetal.bind(foo, 'value', 'bar.value'); + }, deprecationMessage); + }); + + ok(bar.get('value') === false, 'the initial value has been bound'); + + _emberMetal.run(function () { + return bar.destroy(); + }); + + ok(foo.get('value'), 'foo is synced when the binding is updated in the willDestroy hook'); + }); +}); +enifed('ember-runtime/tests/system/object/destroy_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/destroy_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/destroy_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/destroy_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/destroy_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/destroy_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/detectInstance_test', ['exports', 'ember-runtime/system/object'], function (exports, _emberRuntimeSystemObject) { + 'use strict'; + + QUnit.module('system/object/detectInstance'); + + QUnit.test('detectInstance detects instances correctly', function () { + var A = _emberRuntimeSystemObject.default.extend(); + var B = A.extend(); + var C = A.extend(); + + var o = _emberRuntimeSystemObject.default.create(); + var a = A.create(); + var b = B.create(); + var c = C.create(); + + ok(_emberRuntimeSystemObject.default.detectInstance(o), 'o is an instance of EmberObject'); + ok(_emberRuntimeSystemObject.default.detectInstance(a), 'a is an instance of EmberObject'); + ok(_emberRuntimeSystemObject.default.detectInstance(b), 'b is an instance of EmberObject'); + ok(_emberRuntimeSystemObject.default.detectInstance(c), 'c is an instance of EmberObject'); + + ok(!A.detectInstance(o), 'o is not an instance of A'); + ok(A.detectInstance(a), 'a is an instance of A'); + ok(A.detectInstance(b), 'b is an instance of A'); + ok(A.detectInstance(c), 'c is an instance of A'); + + ok(!B.detectInstance(o), 'o is not an instance of B'); + ok(!B.detectInstance(a), 'a is not an instance of B'); + ok(B.detectInstance(b), 'b is an instance of B'); + ok(!B.detectInstance(c), 'c is not an instance of B'); + + ok(!C.detectInstance(o), 'o is not an instance of C'); + ok(!C.detectInstance(a), 'a is not an instance of C'); + ok(!C.detectInstance(b), 'b is not an instance of C'); + ok(C.detectInstance(c), 'c is an instance of C'); + }); +}); +enifed('ember-runtime/tests/system/object/detectInstance_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/detectInstance_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/detectInstance_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/detectInstance_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/detectInstance_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/detectInstance_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/detect_test', ['exports', 'ember-runtime/system/object'], function (exports, _emberRuntimeSystemObject) { + 'use strict'; + + QUnit.module('system/object/detect'); + + QUnit.test('detect detects classes correctly', function () { + var A = _emberRuntimeSystemObject.default.extend(); + var B = A.extend(); + var C = A.extend(); + + ok(_emberRuntimeSystemObject.default.detect(_emberRuntimeSystemObject.default), 'EmberObject is an EmberObject class'); + ok(_emberRuntimeSystemObject.default.detect(A), 'A is an EmberObject class'); + ok(_emberRuntimeSystemObject.default.detect(B), 'B is an EmberObject class'); + ok(_emberRuntimeSystemObject.default.detect(C), 'C is an EmberObject class'); + + ok(!A.detect(_emberRuntimeSystemObject.default), 'EmberObject is not an A class'); + ok(A.detect(A), 'A is an A class'); + ok(A.detect(B), 'B is an A class'); + ok(A.detect(C), 'C is an A class'); + + ok(!B.detect(_emberRuntimeSystemObject.default), 'EmberObject is not a B class'); + ok(!B.detect(A), 'A is not a B class'); + ok(B.detect(B), 'B is a B class'); + ok(!B.detect(C), 'C is not a B class'); + + ok(!C.detect(_emberRuntimeSystemObject.default), 'EmberObject is not a C class'); + ok(!C.detect(A), 'A is not a C class'); + ok(!C.detect(B), 'B is not a C class'); + ok(C.detect(C), 'C is a C class'); + }); +}); +enifed('ember-runtime/tests/system/object/detect_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/detect_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/detect_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/detect_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/detect_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/detect_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/events_test', ['exports', 'ember-runtime/system/object', 'ember-runtime/mixins/evented'], function (exports, _emberRuntimeSystemObject, _emberRuntimeMixinsEvented) { + 'use strict'; + + QUnit.module('Object events'); + + QUnit.test('a listener can be added to an object', function () { + var count = 0; + var F = function () { + count++; + }; + + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEvented.default).create(); + + obj.on('event!', F); + obj.trigger('event!'); + + equal(count, 1, 'the event was triggered'); + + obj.trigger('event!'); + + equal(count, 2, 'the event was triggered'); + }); + + QUnit.test('a listener can be added and removed automatically the first time it is triggered', function () { + var count = 0; + var F = function () { + count++; + }; + + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEvented.default).create(); + + obj.one('event!', F); + obj.trigger('event!'); + + equal(count, 1, 'the event was triggered'); + + obj.trigger('event!'); + + equal(count, 1, 'the event was not triggered again'); + }); + + QUnit.test('triggering an event can have arguments', function () { + var self = undefined, + args = undefined; + + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEvented.default).create(); + + obj.on('event!', function () { + args = [].slice.call(arguments); + self = this; + }); + + obj.trigger('event!', 'foo', 'bar'); + + deepEqual(args, ['foo', 'bar']); + equal(self, obj); + }); + + QUnit.test('a listener can be added and removed automatically and have arguments', function () { + var self = undefined, + args = undefined; + var count = 0; + + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEvented.default).create(); + + obj.one('event!', function () { + args = [].slice.call(arguments); + self = this; + count++; + }); + + obj.trigger('event!', 'foo', 'bar'); + + deepEqual(args, ['foo', 'bar']); + equal(self, obj); + equal(count, 1, 'the event is triggered once'); + + obj.trigger('event!', 'baz', 'bat'); + + deepEqual(args, ['foo', 'bar']); + equal(count, 1, 'the event was not triggered again'); + equal(self, obj); + }); + + QUnit.test('binding an event can specify a different target', function () { + var self = undefined, + args = undefined; + + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEvented.default).create(); + var target = {}; + + obj.on('event!', target, function () { + args = [].slice.call(arguments); + self = this; + }); + + obj.trigger('event!', 'foo', 'bar'); + + deepEqual(args, ['foo', 'bar']); + equal(self, target); + }); + + QUnit.test('a listener registered with one can take method as string and can be added with different target', function () { + var count = 0; + var target = {}; + target.fn = function () { + count++; + }; + + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEvented.default).create(); + + obj.one('event!', target, 'fn'); + obj.trigger('event!'); + + equal(count, 1, 'the event was triggered'); + + obj.trigger('event!'); + + equal(count, 1, 'the event was not triggered again'); + }); + + QUnit.test('a listener registered with one can be removed with off', function () { + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEvented.default, { + F: function () {} + }).create(); + var F = function () {}; + + obj.one('event!', F); + obj.one('event!', obj, 'F'); + + equal(obj.has('event!'), true, 'has events'); + + obj.off('event!', F); + obj.off('event!', obj, 'F'); + + equal(obj.has('event!'), false, 'has no more events'); + }); + + QUnit.test('adding and removing listeners should be chainable', function () { + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEvented.default).create(); + var F = function () {}; + + var ret = obj.on('event!', F); + equal(ret, obj, '#on returns self'); + + ret = obj.off('event!', F); + equal(ret, obj, '#off returns self'); + + ret = obj.one('event!', F); + equal(ret, obj, '#one returns self'); + }); +}); +enifed('ember-runtime/tests/system/object/events_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/events_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/events_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/events_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/events_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/events_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/extend_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { + 'use strict'; + + QUnit.module('EmberObject.extend'); + + QUnit.test('Basic extend', function () { + var SomeClass = _emberRuntimeSystemObject.default.extend({ foo: 'BAR' }); + ok(SomeClass.isClass, 'A class has isClass of true'); + var obj = new SomeClass(); + equal(obj.foo, 'BAR'); + }); + + QUnit.test('Sub-subclass', function () { + var SomeClass = _emberRuntimeSystemObject.default.extend({ foo: 'BAR' }); + var AnotherClass = SomeClass.extend({ bar: 'FOO' }); + var obj = new AnotherClass(); + equal(obj.foo, 'BAR'); + equal(obj.bar, 'FOO'); + }); + + QUnit.test('Overriding a method several layers deep', function () { + var SomeClass = _emberRuntimeSystemObject.default.extend({ + fooCnt: 0, + foo: function () { + this.fooCnt++; + }, + + barCnt: 0, + bar: function () { + this.barCnt++; + } + }); + + var AnotherClass = SomeClass.extend({ + barCnt: 0, + bar: function () { + this.barCnt++; + this._super.apply(this, arguments); + } + }); + + var FinalClass = AnotherClass.extend({ + fooCnt: 0, + foo: function () { + this.fooCnt++; + this._super.apply(this, arguments); + } + }); + + var obj = new FinalClass(); + obj.foo(); + obj.bar(); + equal(obj.fooCnt, 2, 'should invoke both'); + equal(obj.barCnt, 2, 'should invoke both'); + + // Try overriding on create also + obj = FinalClass.extend({ + foo: function () { + this.fooCnt++; + this._super.apply(this, arguments); + } + }).create(); + + obj.foo(); + obj.bar(); + equal(obj.fooCnt, 3, 'should invoke final as well'); + equal(obj.barCnt, 2, 'should invoke both'); + }); + + QUnit.test('With concatenatedProperties', function () { + var SomeClass = _emberRuntimeSystemObject.default.extend({ things: 'foo', concatenatedProperties: ['things'] }); + var AnotherClass = SomeClass.extend({ things: 'bar' }); + var YetAnotherClass = SomeClass.extend({ things: 'baz' }); + var some = new SomeClass(); + var another = new AnotherClass(); + var yetAnother = new YetAnotherClass(); + deepEqual(some.get('things'), ['foo'], 'base class should have just its value'); + deepEqual(another.get('things'), ['foo', 'bar'], 'subclass should have base class\' and its own'); + deepEqual(yetAnother.get('things'), ['foo', 'baz'], 'subclass should have base class\' and its own'); + }); + + QUnit.test('With concatenatedProperties class properties', function () { + var SomeClass = _emberRuntimeSystemObject.default.extend(); + SomeClass.reopenClass({ + concatenatedProperties: ['things'], + things: 'foo' + }); + var AnotherClass = SomeClass.extend(); + AnotherClass.reopenClass({ things: 'bar' }); + var YetAnotherClass = SomeClass.extend(); + YetAnotherClass.reopenClass({ things: 'baz' }); + var some = new SomeClass(); + var another = new AnotherClass(); + var yetAnother = new YetAnotherClass(); + deepEqual(_emberMetal.get(some.constructor, 'things'), ['foo'], 'base class should have just its value'); + deepEqual(_emberMetal.get(another.constructor, 'things'), ['foo', 'bar'], 'subclass should have base class\' and its own'); + deepEqual(_emberMetal.get(yetAnother.constructor, 'things'), ['foo', 'baz'], 'subclass should have base class\' and its own'); + }); +}); +enifed('ember-runtime/tests/system/object/extend_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/extend_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/extend_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/extend_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/extend_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/extend_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/observer_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject) { + 'use strict'; + + QUnit.module('EmberObject observer'); + + _internalTestHelpers.testBoth('observer on class', function (get, set) { + var MyClass = _emberRuntimeSystemObject.default.extend({ + count: 0, + + foo: _emberMetal.observer('bar', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }); + + var obj = new MyClass(); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj, 'bar', 'BAZ'); + equal(get(obj, 'count'), 1, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('observer on subclass', function (get, set) { + var MyClass = _emberRuntimeSystemObject.default.extend({ + count: 0, + + foo: _emberMetal.observer('bar', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }); + + var Subclass = MyClass.extend({ + foo: _emberMetal.observer('baz', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }); + + var obj = new Subclass(); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj, 'bar', 'BAZ'); + equal(get(obj, 'count'), 0, 'should not invoke observer after change'); + + set(obj, 'baz', 'BAZ'); + equal(get(obj, 'count'), 1, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('observer on instance', function (get, set) { + var obj = _emberRuntimeSystemObject.default.extend({ + foo: _emberMetal.observer('bar', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }).create({ + count: 0 + }); + + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj, 'bar', 'BAZ'); + equal(get(obj, 'count'), 1, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('observer on instance overriding class', function (get, set) { + var MyClass = _emberRuntimeSystemObject.default.extend({ + count: 0, + + foo: _emberMetal.observer('bar', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }); + + var obj = MyClass.extend({ + foo: _emberMetal.observer('baz', function () { + // <-- change property we observe + set(this, 'count', get(this, 'count') + 1); + }) + }).create(); + + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj, 'bar', 'BAZ'); + equal(get(obj, 'count'), 0, 'should not invoke observer after change'); + + set(obj, 'baz', 'BAZ'); + equal(get(obj, 'count'), 1, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('observer should not fire after being destroyed', function (get, set) { + var obj = _emberRuntimeSystemObject.default.extend({ + count: 0, + foo: _emberMetal.observer('bar', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }).create(); + + equal(get(obj, 'count'), 0, 'precond - should not invoke observer immediately'); + + _emberMetal.run(function () { + return obj.destroy(); + }); + + expectAssertion(function () { + set(obj, 'bar', 'BAZ'); + }, 'calling set on destroyed object: ' + obj + '.bar = BAZ'); + + equal(get(obj, 'count'), 0, 'should not invoke observer after change'); + }); + // .......................................................... + // COMPLEX PROPERTIES + // + + _internalTestHelpers.testBoth('chain observer on class', function (get, set) { + var MyClass = _emberRuntimeSystemObject.default.extend({ + count: 0, + + foo: _emberMetal.observer('bar.baz', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }); + + var obj1 = MyClass.create({ + bar: { baz: 'biff' } + }); + + var obj2 = MyClass.create({ + bar: { baz: 'biff2' } + }); + + equal(get(obj1, 'count'), 0, 'should not invoke yet'); + equal(get(obj2, 'count'), 0, 'should not invoke yet'); + + set(get(obj1, 'bar'), 'baz', 'BIFF1'); + equal(get(obj1, 'count'), 1, 'should invoke observer on obj1'); + equal(get(obj2, 'count'), 0, 'should not invoke yet'); + + set(get(obj2, 'bar'), 'baz', 'BIFF2'); + equal(get(obj1, 'count'), 1, 'should not invoke again'); + equal(get(obj2, 'count'), 1, 'should invoke observer on obj2'); + }); + + _internalTestHelpers.testBoth('chain observer on class', function (get, set) { + var MyClass = _emberRuntimeSystemObject.default.extend({ + count: 0, + + foo: _emberMetal.observer('bar.baz', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }); + + var obj1 = MyClass.extend().create({ + bar: { baz: 'biff' } + }); + + var obj2 = MyClass.extend({ + foo: _emberMetal.observer('bar2.baz', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }).create({ + bar: { baz: 'biff2' }, + bar2: { baz: 'biff3' } + }); + + equal(get(obj1, 'count'), 0, 'should not invoke yet'); + equal(get(obj2, 'count'), 0, 'should not invoke yet'); + + set(get(obj1, 'bar'), 'baz', 'BIFF1'); + equal(get(obj1, 'count'), 1, 'should invoke observer on obj1'); + equal(get(obj2, 'count'), 0, 'should not invoke yet'); + + set(get(obj2, 'bar'), 'baz', 'BIFF2'); + equal(get(obj1, 'count'), 1, 'should not invoke again'); + equal(get(obj2, 'count'), 0, 'should not invoke yet'); + + set(get(obj2, 'bar2'), 'baz', 'BIFF3'); + equal(get(obj1, 'count'), 1, 'should not invoke again'); + equal(get(obj2, 'count'), 1, 'should invoke observer on obj2'); + }); + + _internalTestHelpers.testBoth('chain observer on class that has a reference to an uninitialized object will finish chains that reference it', function (get, set) { + var changed = false; + + var ChildClass = _emberRuntimeSystemObject.default.extend({ + parent: null, + parentOneTwoDidChange: _emberMetal.observer('parent.one.two', function () { + changed = true; + }) + }); + + var ParentClass = _emberRuntimeSystemObject.default.extend({ + one: { + two: 'old' + }, + init: function () { + this.child = ChildClass.create({ + parent: this + }); + } + }); + + var parent = new ParentClass(); + + equal(changed, false, 'precond'); + + parent.set('one.two', 'new'); + + equal(changed, true, 'child should have been notified of change to path'); + + parent.set('one', { two: 'newer' }); + + equal(changed, true, 'child should have been notified of change to path'); + }); +}); +enifed('ember-runtime/tests/system/object/observer_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/observer_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/observer_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/observer_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/observer_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/observer_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/reopenClass_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { + 'use strict'; + + QUnit.module('system/object/reopenClass'); + + QUnit.test('adds new properties to subclass', function () { + var Subclass = _emberRuntimeSystemObject.default.extend(); + Subclass.reopenClass({ + foo: function () { + return 'FOO'; + }, + bar: 'BAR' + }); + + equal(Subclass.foo(), 'FOO', 'Adds method'); + equal(_emberMetal.get(Subclass, 'bar'), 'BAR', 'Adds property'); + }); + + QUnit.test('class properties inherited by subclasses', function () { + var Subclass = _emberRuntimeSystemObject.default.extend(); + Subclass.reopenClass({ + foo: function () { + return 'FOO'; + }, + bar: 'BAR' + }); + + var SubSub = Subclass.extend(); + + equal(SubSub.foo(), 'FOO', 'Adds method'); + equal(_emberMetal.get(SubSub, 'bar'), 'BAR', 'Adds property'); + }); +}); +enifed('ember-runtime/tests/system/object/reopenClass_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/reopenClass_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/reopenClass_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/reopenClass_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/reopenClass_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/reopenClass_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/reopen_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { + 'use strict'; + + QUnit.module('system/core_object/reopen'); + + QUnit.test('adds new properties to subclass instance', function () { + var Subclass = _emberRuntimeSystemObject.default.extend(); + Subclass.reopen({ + foo: function () { + return 'FOO'; + }, + bar: 'BAR' + }); + + equal(new Subclass().foo(), 'FOO', 'Adds method'); + equal(_emberMetal.get(new Subclass(), 'bar'), 'BAR', 'Adds property'); + }); + + QUnit.test('reopened properties inherited by subclasses', function () { + var Subclass = _emberRuntimeSystemObject.default.extend(); + var SubSub = Subclass.extend(); + + Subclass.reopen({ + foo: function () { + return 'FOO'; + }, + bar: 'BAR' + }); + + equal(new SubSub().foo(), 'FOO', 'Adds method'); + equal(_emberMetal.get(new SubSub(), 'bar'), 'BAR', 'Adds property'); + }); + + QUnit.test('allows reopening already instantiated classes', function () { + var Subclass = _emberRuntimeSystemObject.default.extend(); + + Subclass.create(); + + Subclass.reopen({ + trololol: true + }); + + equal(Subclass.create().get('trololol'), true, 'reopen works'); + }); +}); +enifed('ember-runtime/tests/system/object/reopen_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/reopen_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/reopen_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/reopen_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/reopen_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/reopen_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/strict-mode-test', ['exports', 'ember-runtime/system/object'], function (exports, _emberRuntimeSystemObject) { + 'use strict'; + + QUnit.module('strict mode tests'); + + QUnit.test('__superWrapper does not throw errors in strict mode', function () { + var Foo = _emberRuntimeSystemObject.default.extend({ + blah: function () { + return 'foo'; + } + }); + + var Bar = Foo.extend({ + blah: function () { + return 'bar'; + }, + + callBlah: function () { + var blah = this.blah; + + return blah(); + } + }); + + var bar = Bar.create(); + + equal(bar.callBlah(), 'bar', 'can call local function without call/apply'); + }); +}); +enifed('ember-runtime/tests/system/object/strict-mode-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/strict-mode-test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/strict-mode-test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/strict-mode-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/strict-mode-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/strict-mode-test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/subclasses_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { + 'use strict'; + + QUnit.module('system/object/subclasses'); + + QUnit.test('chains should copy forward to subclasses when prototype created', function () { + var ObjectWithChains = undefined, + objWithChains = undefined, + SubWithChains = undefined, + SubSub = undefined, + subSub = undefined; + _emberMetal.run(function () { + ObjectWithChains = _emberRuntimeSystemObject.default.extend({ + obj: { + a: 'a', + hi: 'hi' + }, + aBinding: 'obj.a' // add chain + }); + + var deprecationMessage = /`Ember.Binding` is deprecated/; + + expectDeprecation(function () { + // realize prototype + objWithChains = ObjectWithChains.create(); + }, deprecationMessage); + + // should not copy chains from parent yet + SubWithChains = ObjectWithChains.extend({ + hiBinding: 'obj.hi', // add chain + hello: _emberMetal.computed(function () { + return this.get('obj.hi') + ' world'; + }).property('hi'), // observe chain + greetingBinding: 'hello' + }); + + SubSub = SubWithChains.extend(); + + expectDeprecation(function () { + // should realize prototypes and copy forward chains + subSub = SubSub.create(); + }, deprecationMessage); + }); + equal(subSub.get('greeting'), 'hi world'); + _emberMetal.run(function () { + return objWithChains.set('obj.hi', 'hello'); + }); + equal(subSub.get('greeting'), 'hello world'); + }); +}); +enifed('ember-runtime/tests/system/object/subclasses_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/subclasses_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/subclasses_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/subclasses_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/subclasses_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/subclasses_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/toString_test', ['exports', 'ember-utils', 'ember-environment', 'ember-runtime/system/object', 'ember-runtime/system/namespace'], function (exports, _emberUtils, _emberEnvironment, _emberRuntimeSystemObject, _emberRuntimeSystemNamespace) { + 'use strict'; + + var originalLookup = _emberEnvironment.context.lookup; + var lookup = undefined; + + QUnit.module('system/object/toString', { + setup: function () { + _emberEnvironment.context.lookup = lookup = {}; + }, + teardown: function () { + _emberEnvironment.context.lookup = originalLookup; + } + }); + + QUnit.test('toString() returns the same value if called twice', function () { + var Foo = _emberRuntimeSystemNamespace.default.create(); + Foo.toString = function () { + return 'Foo'; + }; + + Foo.Bar = _emberRuntimeSystemObject.default.extend(); + + equal(Foo.Bar.toString(), 'Foo.Bar'); + equal(Foo.Bar.toString(), 'Foo.Bar'); + + var obj = Foo.Bar.create(); + + equal(obj.toString(), ''); + equal(obj.toString(), ''); + + equal(Foo.Bar.toString(), 'Foo.Bar'); + }); + + QUnit.test('toString on a class returns a useful value when nested in a namespace', function () { + var obj = undefined; + + var Foo = _emberRuntimeSystemNamespace.default.create(); + Foo.toString = function () { + return 'Foo'; + }; + + Foo.Bar = _emberRuntimeSystemObject.default.extend(); + equal(Foo.Bar.toString(), 'Foo.Bar'); + + obj = Foo.Bar.create(); + equal(obj.toString(), ''); + + Foo.Baz = Foo.Bar.extend(); + equal(Foo.Baz.toString(), 'Foo.Baz'); + + obj = Foo.Baz.create(); + equal(obj.toString(), ''); + + obj = Foo.Bar.create(); + equal(obj.toString(), ''); + }); + + QUnit.test('toString on a namespace finds the namespace in lookup', function () { + var Foo = lookup.Foo = _emberRuntimeSystemNamespace.default.create(); + + equal(Foo.toString(), 'Foo'); + }); + + QUnit.test('toString on a namespace finds the namespace in lookup', function () { + var Foo = lookup.Foo = _emberRuntimeSystemNamespace.default.create(); + var obj = undefined; + + Foo.Bar = _emberRuntimeSystemObject.default.extend(); + + equal(Foo.Bar.toString(), 'Foo.Bar'); + + obj = Foo.Bar.create(); + equal(obj.toString(), ''); + }); + + QUnit.test('toString on a namespace falls back to modulePrefix, if defined', function () { + var Foo = _emberRuntimeSystemNamespace.default.create({ modulePrefix: 'foo' }); + + equal(Foo.toString(), 'foo'); + }); + + QUnit.test('toString includes toStringExtension if defined', function () { + var Foo = _emberRuntimeSystemObject.default.extend({ + toStringExtension: function () { + return 'fooey'; + } + }); + var foo = Foo.create(); + var Bar = _emberRuntimeSystemObject.default.extend({}); + var bar = Bar.create(); + + // simulate these classes being defined on a Namespace + Foo[_emberUtils.GUID_KEY + '_name'] = 'Foo'; + Bar[_emberUtils.GUID_KEY + '_name'] = 'Bar'; + + equal(bar.toString(), '', 'does not include toStringExtension part'); + equal(foo.toString(), '', 'Includes toStringExtension result'); + }); +}); +enifed('ember-runtime/tests/system/object/toString_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/toString_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/toString_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/toString_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/toString_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/toString_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object_proxy_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object_proxy'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject_proxy) { + 'use strict'; + + QUnit.module('ObjectProxy'); + + _internalTestHelpers.testBoth('should not proxy properties passed to create', function (get, set) { + var Proxy = _emberRuntimeSystemObject_proxy.default.extend({ + cp: _emberMetal.computed({ + get: function (key) { + return this._cp; + }, + set: function (key, value) { + this._cp = value; + return this._cp; + } + }) + }); + var proxy = Proxy.create({ + prop: 'Foo', + cp: 'Bar' + }); + + equal(get(proxy, 'prop'), 'Foo', 'should not have tried to proxy set'); + equal(proxy._cp, 'Bar', 'should use CP setter'); + }); + + _internalTestHelpers.testBoth('should proxy properties to content', function (get, set) { + var content = { + firstName: 'Tom', + lastName: 'Dale', + unknownProperty: function (key) { + return key + ' unknown'; + } + }; + var proxy = _emberRuntimeSystemObject_proxy.default.create(); + + equal(get(proxy, 'firstName'), undefined, 'get on proxy without content should return undefined'); + expectAssertion(function () { + set(proxy, 'firstName', 'Foo'); + }, /Cannot delegate set\('firstName', Foo\) to the 'content'/i); + + set(proxy, 'content', content); + + equal(get(proxy, 'firstName'), 'Tom', 'get on proxy with content should forward to content'); + equal(get(proxy, 'lastName'), 'Dale', 'get on proxy with content should forward to content'); + equal(get(proxy, 'foo'), 'foo unknown', 'get on proxy with content should forward to content'); + + set(proxy, 'lastName', 'Huda'); + + equal(get(content, 'lastName'), 'Huda', 'content should have new value from set on proxy'); + equal(get(proxy, 'lastName'), 'Huda', 'proxy should have new value from set on proxy'); + + set(proxy, 'content', { firstName: 'Yehuda', lastName: 'Katz' }); + + equal(get(proxy, 'firstName'), 'Yehuda', 'proxy should reflect updated content'); + equal(get(proxy, 'lastName'), 'Katz', 'proxy should reflect updated content'); + }); + + _internalTestHelpers.testBoth('should work with watched properties', function (get, set) { + var content1 = { firstName: 'Tom', lastName: 'Dale' }; + var content2 = { firstName: 'Yehuda', lastName: 'Katz' }; + var count = 0; + var last = undefined; + + var Proxy = _emberRuntimeSystemObject_proxy.default.extend({ + fullName: _emberMetal.computed(function () { + var firstName = this.get('firstName'); + var lastName = this.get('lastName'); + + if (firstName && lastName) { + return firstName + ' ' + lastName; + } + return firstName || lastName; + }).property('firstName', 'lastName') + }); + + var proxy = Proxy.create(); + + _emberMetal.addObserver(proxy, 'fullName', function () { + last = get(proxy, 'fullName'); + count++; + }); + + // proxy without content returns undefined + equal(get(proxy, 'fullName'), undefined); + + // setting content causes all watched properties to change + set(proxy, 'content', content1); + // both dependent keys changed + equal(count, 2); + equal(last, 'Tom Dale'); + + // setting property in content causes proxy property to change + set(content1, 'lastName', 'Huda'); + equal(count, 3); + equal(last, 'Tom Huda'); + + // replacing content causes all watched properties to change + set(proxy, 'content', content2); + // both dependent keys changed + equal(count, 5); + equal(last, 'Yehuda Katz'); + // content1 is no longer watched + ok(!_emberMetal.isWatching(content1, 'firstName'), 'not watching firstName'); + ok(!_emberMetal.isWatching(content1, 'lastName'), 'not watching lastName'); + + // setting property in new content + set(content2, 'firstName', 'Tomhuda'); + equal(last, 'Tomhuda Katz'); + equal(count, 6); + + // setting property in proxy syncs with new content + set(proxy, 'lastName', 'Katzdale'); + equal(count, 7); + equal(last, 'Tomhuda Katzdale'); + equal(get(content2, 'firstName'), 'Tomhuda'); + equal(get(content2, 'lastName'), 'Katzdale'); + }); + + QUnit.test('set and get should work with paths', function () { + var content = { foo: { bar: 'baz' } }; + var proxy = _emberRuntimeSystemObject_proxy.default.create({ content: content }); + var count = 0; + + proxy.set('foo.bar', 'hello'); + equal(proxy.get('foo.bar'), 'hello'); + equal(proxy.get('content.foo.bar'), 'hello'); + + proxy.addObserver('foo.bar', function () { + count++; + }); + + proxy.set('foo.bar', 'bye'); + + equal(count, 1); + equal(proxy.get('foo.bar'), 'bye'); + equal(proxy.get('content.foo.bar'), 'bye'); + }); + + _internalTestHelpers.testBoth('should transition between watched and unwatched strategies', function (get, set) { + var content = { foo: 'foo' }; + var proxy = _emberRuntimeSystemObject_proxy.default.create({ content: content }); + var count = 0; + + function observer() { + count++; + } + + equal(get(proxy, 'foo'), 'foo'); + + set(content, 'foo', 'bar'); + + equal(get(proxy, 'foo'), 'bar'); + + set(proxy, 'foo', 'foo'); + + equal(get(content, 'foo'), 'foo'); + equal(get(proxy, 'foo'), 'foo'); + + _emberMetal.addObserver(proxy, 'foo', observer); + + equal(count, 0); + equal(get(proxy, 'foo'), 'foo'); + + set(content, 'foo', 'bar'); + + equal(count, 1); + equal(get(proxy, 'foo'), 'bar'); + + set(proxy, 'foo', 'foo'); + + equal(count, 2); + equal(get(content, 'foo'), 'foo'); + equal(get(proxy, 'foo'), 'foo'); + + _emberMetal.removeObserver(proxy, 'foo', observer); + + set(content, 'foo', 'bar'); + + equal(get(proxy, 'foo'), 'bar'); + + set(proxy, 'foo', 'foo'); + + equal(get(content, 'foo'), 'foo'); + equal(get(proxy, 'foo'), 'foo'); + }); + + _internalTestHelpers.testBoth('setting `undefined` to a proxied content property should override its existing value', function (get, set) { + var proxyObject = _emberRuntimeSystemObject_proxy.default.create({ + content: { + prop: 'emberjs' + } + }); + set(proxyObject, 'prop', undefined); + equal(get(proxyObject, 'prop'), undefined, 'sets the `undefined` value to the proxied content'); + }); +}); +enifed('ember-runtime/tests/system/object_proxy_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system'); + test('ember-runtime/tests/system/object_proxy_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object_proxy_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object_proxy_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system'); + QUnit.test('ember-runtime/tests/system/object_proxy_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object_proxy_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/string/camelize_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { + 'use strict'; + + QUnit.module('EmberStringUtils.camelize'); + + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + QUnit.test('String.prototype.camelize is not modified without EXTEND_PROTOTYPES', function () { + ok('undefined' === typeof String.prototype.camelize, 'String.prototype helper disabled'); + }); + } + + QUnit.test('camelize normal string', function () { + deepEqual(_emberRuntimeSystemString.camelize('my favorite items'), 'myFavoriteItems'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('my favorite items'.camelize(), 'myFavoriteItems'); + } + }); + + QUnit.test('camelize capitalized string', function () { + deepEqual(_emberRuntimeSystemString.camelize('I Love Ramen'), 'iLoveRamen'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('I Love Ramen'.camelize(), 'iLoveRamen'); + } + }); + + QUnit.test('camelize dasherized string', function () { + deepEqual(_emberRuntimeSystemString.camelize('css-class-name'), 'cssClassName'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('css-class-name'.camelize(), 'cssClassName'); + } + }); + + QUnit.test('camelize underscored string', function () { + deepEqual(_emberRuntimeSystemString.camelize('action_name'), 'actionName'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('action_name'.camelize(), 'actionName'); + } + }); + + QUnit.test('camelize dot notation string', function () { + deepEqual(_emberRuntimeSystemString.camelize('action.name'), 'actionName'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('action.name'.camelize(), 'actionName'); + } + }); + + QUnit.test('does nothing with camelcased string', function () { + deepEqual(_emberRuntimeSystemString.camelize('innerHTML'), 'innerHTML'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('innerHTML'.camelize(), 'innerHTML'); + } + }); + + QUnit.test('camelize namespaced classified string', function () { + deepEqual(_emberRuntimeSystemString.camelize('PrivateDocs/OwnerInvoice'), 'privateDocs/ownerInvoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('PrivateDocs/OwnerInvoice'.camelize(), 'privateDocs/ownerInvoice'); + } + }); + + QUnit.test('camelize namespaced underscored string', function () { + deepEqual(_emberRuntimeSystemString.camelize('private_docs/owner_invoice'), 'privateDocs/ownerInvoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('private_docs/owner_invoice'.camelize(), 'privateDocs/ownerInvoice'); + } + }); + + QUnit.test('camelize namespaced dasherized string', function () { + deepEqual(_emberRuntimeSystemString.camelize('private-docs/owner-invoice'), 'privateDocs/ownerInvoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('private-docs/owner-invoice'.camelize(), 'privateDocs/ownerInvoice'); + } + }); +}); +enifed('ember-runtime/tests/system/string/camelize_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/string'); + test('ember-runtime/tests/system/string/camelize_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/string/camelize_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/string/camelize_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/string'); + QUnit.test('ember-runtime/tests/system/string/camelize_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/string/camelize_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/string/capitalize_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { + 'use strict'; + + QUnit.module('EmberStringUtils.capitalize'); + + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + QUnit.test('String.prototype.capitalize is not modified without EXTEND_PROTOTYPES', function () { + ok('undefined' === typeof String.prototype.capitalize, 'String.prototype helper disabled'); + }); + } + + QUnit.test('capitalize normal string', function () { + deepEqual(_emberRuntimeSystemString.capitalize('my favorite items'), 'My favorite items'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('my favorite items'.capitalize(), 'My favorite items'); + } + }); + + QUnit.test('capitalize dasherized string', function () { + deepEqual(_emberRuntimeSystemString.capitalize('css-class-name'), 'Css-class-name'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('css-class-name'.capitalize(), 'Css-class-name'); + } + }); + + QUnit.test('capitalize underscored string', function () { + deepEqual(_emberRuntimeSystemString.capitalize('action_name'), 'Action_name'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('action_name'.capitalize(), 'Action_name'); + } + }); + + QUnit.test('capitalize camelcased string', function () { + deepEqual(_emberRuntimeSystemString.capitalize('innerHTML'), 'InnerHTML'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('innerHTML'.capitalize(), 'InnerHTML'); + } + }); + + QUnit.test('does nothing with capitalized string', function () { + deepEqual(_emberRuntimeSystemString.capitalize('Capitalized string'), 'Capitalized string'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('Capitalized string'.capitalize(), 'Capitalized string'); + } + }); + + QUnit.test('capitalize namespaced camelized string', function () { + deepEqual(_emberRuntimeSystemString.capitalize('privateDocs/ownerInvoice'), 'PrivateDocs/OwnerInvoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('privateDocs/ownerInvoice'.capitalize(), 'PrivateDocs/OwnerInvoice'); + } + }); + + QUnit.test('capitalize namespaced underscored string', function () { + deepEqual(_emberRuntimeSystemString.capitalize('private_docs/owner_invoice'), 'Private_docs/Owner_invoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('private_docs/owner_invoice'.capitalize(), 'Private_docs/Owner_invoice'); + } + }); + + QUnit.test('capitalize namespaced dasherized string', function () { + deepEqual(_emberRuntimeSystemString.capitalize('private-docs/owner-invoice'), 'Private-docs/Owner-invoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('private-docs/owner-invoice'.capitalize(), 'Private-docs/Owner-invoice'); + } + }); +}); +enifed('ember-runtime/tests/system/string/capitalize_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/string'); + test('ember-runtime/tests/system/string/capitalize_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/string/capitalize_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/string/capitalize_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/string'); + QUnit.test('ember-runtime/tests/system/string/capitalize_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/string/capitalize_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/string/classify_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { + 'use strict'; + + QUnit.module('EmberStringUtils.classify'); + + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + QUnit.test('String.prototype.classify is not modified without EXTEND_PROTOTYPES', function () { + ok('undefined' === typeof String.prototype.classify, 'String.prototype helper disabled'); + }); + } + + function test(given, expected, description) { + QUnit.test(description, function () { + deepEqual(_emberRuntimeSystemString.classify(given), expected); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual(given.classify(), expected); + } + }); + } + + test('my favorite items', 'MyFavoriteItems', 'classify normal string'); + test('css-class-name', 'CssClassName', 'classify dasherized string'); + test('action_name', 'ActionName', 'classify underscored string'); + test('privateDocs/ownerInvoice', 'PrivateDocs/OwnerInvoice', 'classify namespaced camelized string'); + test('private_docs/owner_invoice', 'PrivateDocs/OwnerInvoice', 'classify namespaced underscored string'); + test('private-docs/owner-invoice', 'PrivateDocs/OwnerInvoice', 'classify namespaced dasherized string'); + test('-view-registry', '_ViewRegistry', 'classify prefixed dasherized string'); + test('components/-text-field', 'Components/_TextField', 'classify namespaced prefixed dasherized string'); + test('_Foo_Bar', '_FooBar', 'classify underscore-prefixed underscored string'); + test('_Foo-Bar', '_FooBar', 'classify underscore-prefixed dasherized string'); + test('_foo/_bar', '_Foo/_Bar', 'classify underscore-prefixed-namespaced underscore-prefixed string'); + test('-foo/_bar', '_Foo/_Bar', 'classify dash-prefixed-namespaced underscore-prefixed string'); + test('-foo/-bar', '_Foo/_Bar', 'classify dash-prefixed-namespaced dash-prefixed string'); + test('InnerHTML', 'InnerHTML', 'does nothing with classified string'); + test('_FooBar', '_FooBar', 'does nothing with classified prefixed string'); +}); +enifed('ember-runtime/tests/system/string/classify_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/string'); + test('ember-runtime/tests/system/string/classify_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/string/classify_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/string/classify_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/string'); + QUnit.test('ember-runtime/tests/system/string/classify_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/string/classify_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/string/dasherize_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { + 'use strict'; + + QUnit.module('EmberStringUtils.dasherize'); + + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + QUnit.test('String.prototype.dasherize is not modified without EXTEND_PROTOTYPES', function () { + ok('undefined' === typeof String.prototype.dasherize, 'String.prototype helper disabled'); + }); + } + + QUnit.test('dasherize normal string', function () { + deepEqual(_emberRuntimeSystemString.dasherize('my favorite items'), 'my-favorite-items'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('my favorite items'.dasherize(), 'my-favorite-items'); + } + }); + + QUnit.test('does nothing with dasherized string', function () { + deepEqual(_emberRuntimeSystemString.dasherize('css-class-name'), 'css-class-name'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('css-class-name'.dasherize(), 'css-class-name'); + } + }); + + QUnit.test('dasherize underscored string', function () { + deepEqual(_emberRuntimeSystemString.dasherize('action_name'), 'action-name'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('action_name'.dasherize(), 'action-name'); + } + }); + + QUnit.test('dasherize camelcased string', function () { + deepEqual(_emberRuntimeSystemString.dasherize('innerHTML'), 'inner-html'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('innerHTML'.dasherize(), 'inner-html'); + } + }); + + QUnit.test('dasherize string that is the property name of Object.prototype', function () { + deepEqual(_emberRuntimeSystemString.dasherize('toString'), 'to-string'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('toString'.dasherize(), 'to-string'); + } + }); + + QUnit.test('dasherize namespaced classified string', function () { + deepEqual(_emberRuntimeSystemString.dasherize('PrivateDocs/OwnerInvoice'), 'private-docs/owner-invoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('PrivateDocs/OwnerInvoice'.dasherize(), 'private-docs/owner-invoice'); + } + }); + + QUnit.test('dasherize namespaced camelized string', function () { + deepEqual(_emberRuntimeSystemString.dasherize('privateDocs/ownerInvoice'), 'private-docs/owner-invoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('privateDocs/ownerInvoice'.dasherize(), 'private-docs/owner-invoice'); + } + }); + + QUnit.test('dasherize namespaced underscored string', function () { + deepEqual(_emberRuntimeSystemString.dasherize('private_docs/owner_invoice'), 'private-docs/owner-invoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('private_docs/owner_invoice'.dasherize(), 'private-docs/owner-invoice'); + } + }); +}); +enifed('ember-runtime/tests/system/string/dasherize_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/string'); + test('ember-runtime/tests/system/string/dasherize_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/string/dasherize_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/string/dasherize_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/string'); + QUnit.test('ember-runtime/tests/system/string/dasherize_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/string/dasherize_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/string/decamelize_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { + 'use strict'; + + QUnit.module('EmberStringUtils.decamelize'); + + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + QUnit.test('String.prototype.decamelize is not modified without EXTEND_PROTOTYPES', function () { + ok('undefined' === typeof String.prototype.decamelize, 'String.prototype helper disabled'); + }); + } + + QUnit.test('does nothing with normal string', function () { + deepEqual(_emberRuntimeSystemString.decamelize('my favorite items'), 'my favorite items'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('my favorite items'.decamelize(), 'my favorite items'); + } + }); + + QUnit.test('does nothing with dasherized string', function () { + deepEqual(_emberRuntimeSystemString.decamelize('css-class-name'), 'css-class-name'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('css-class-name'.decamelize(), 'css-class-name'); + } + }); + + QUnit.test('does nothing with underscored string', function () { + deepEqual(_emberRuntimeSystemString.decamelize('action_name'), 'action_name'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('action_name'.decamelize(), 'action_name'); + } + }); + + QUnit.test('converts a camelized string into all lower case separated by underscores.', function () { + deepEqual(_emberRuntimeSystemString.decamelize('innerHTML'), 'inner_html'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('innerHTML'.decamelize(), 'inner_html'); + } + }); + + QUnit.test('decamelizes strings with numbers', function () { + deepEqual(_emberRuntimeSystemString.decamelize('size160Url'), 'size160_url'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('size160Url'.decamelize(), 'size160_url'); + } + }); + + QUnit.test('decamelize namespaced classified string', function () { + deepEqual(_emberRuntimeSystemString.decamelize('PrivateDocs/OwnerInvoice'), 'private_docs/owner_invoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('PrivateDocs/OwnerInvoice'.decamelize(), 'private_docs/owner_invoice'); + } + }); + + QUnit.test('decamelize namespaced camelized string', function () { + deepEqual(_emberRuntimeSystemString.decamelize('privateDocs/ownerInvoice'), 'private_docs/owner_invoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('privateDocs/ownerInvoice'.decamelize(), 'private_docs/owner_invoice'); + } + }); +}); +enifed('ember-runtime/tests/system/string/decamelize_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/string'); + test('ember-runtime/tests/system/string/decamelize_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/string/decamelize_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/string/decamelize_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/string'); + QUnit.test('ember-runtime/tests/system/string/decamelize_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/string/decamelize_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/string/fmt_string_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { + 'use strict'; + + QUnit.module('EmberStringUtils.fmt'); + + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + QUnit.test('String.prototype.fmt is not modified without EXTEND_PROTOTYPES', function () { + ok('undefined' === typeof String.prototype.fmt, 'String.prototype helper disabled'); + }); + } + + QUnit.test('\'Hello %@ %@\'.fmt(\'John\', \'Doe\') => \'Hello John Doe\'', function () { + expectDeprecation('Ember.String.fmt is deprecated, use ES6 template strings instead.'); + equal(_emberRuntimeSystemString.fmt('Hello %@ %@', ['John', 'Doe']), 'Hello John Doe'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + equal('Hello %@ %@'.fmt('John', 'Doe'), 'Hello John Doe'); + } + }); + + QUnit.test('\'Hello %@2 %@1\'.fmt(\'John\', \'Doe\') => \'Hello Doe John\'', function () { + expectDeprecation('Ember.String.fmt is deprecated, use ES6 template strings instead.'); + equal(_emberRuntimeSystemString.fmt('Hello %@2 %@1', ['John', 'Doe']), 'Hello Doe John'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + equal('Hello %@2 %@1'.fmt('John', 'Doe'), 'Hello Doe John'); + } + }); + + QUnit.test('\'%@08 %@07 %@06 %@05 %@04 %@03 %@02 %@01\'.fmt(\'One\', \'Two\', \'Three\', \'Four\', \'Five\', \'Six\', \'Seven\', \'Eight\') => \'Eight Seven Six Five Four Three Two One\'', function () { + expectDeprecation('Ember.String.fmt is deprecated, use ES6 template strings instead.'); + equal(_emberRuntimeSystemString.fmt('%@08 %@07 %@06 %@05 %@04 %@03 %@02 %@01', ['One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight']), 'Eight Seven Six Five Four Three Two One'); + + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + equal('%@08 %@07 %@06 %@05 %@04 %@03 %@02 %@01'.fmt('One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight'), 'Eight Seven Six Five Four Three Two One'); + } + }); + + QUnit.test('\'data: %@\'.fmt({ id: 3 }) => \'data: {id: 3}\'', function () { + expectDeprecation('Ember.String.fmt is deprecated, use ES6 template strings instead.'); + equal(_emberRuntimeSystemString.fmt('data: %@', [{ id: 3 }]), 'data: {id: 3}'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + equal('data: %@'.fmt({ id: 3 }), 'data: {id: 3}'); + } + }); + + QUnit.test('works with argument form', function () { + expectDeprecation('Ember.String.fmt is deprecated, use ES6 template strings instead.'); + equal(_emberRuntimeSystemString.fmt('%@', 'John'), 'John'); + equal(_emberRuntimeSystemString.fmt('%@ %@', ['John'], 'Doe'), '[John] Doe'); + }); +}); +enifed('ember-runtime/tests/system/string/fmt_string_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/string'); + test('ember-runtime/tests/system/string/fmt_string_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/string/fmt_string_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/string/fmt_string_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/string'); + QUnit.test('ember-runtime/tests/system/string/fmt_string_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/string/fmt_string_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/string/loc_test', ['exports', 'ember-metal', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberMetal, _emberEnvironment, _emberRuntimeSystemString) { + 'use strict'; + + var oldString = undefined; + + QUnit.module('EmberStringUtils.loc', { + setup: function () { + oldString = _emberMetal.default.STRINGS; + _emberMetal.default.STRINGS = { + '_Hello World': 'Bonjour le monde', + '_Hello %@': 'Bonjour %@', + '_Hello %@ %@': 'Bonjour %@ %@', + '_Hello %@# %@#': 'Bonjour %@2 %@1' + }; + }, + + teardown: function () { + _emberMetal.default.STRINGS = oldString; + } + }); + + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + QUnit.test('String.prototype.loc is not available without EXTEND_PROTOTYPES', function () { + ok('undefined' === typeof String.prototype.loc, 'String.prototype helper disabled'); + }); + } + + QUnit.test('\'_Hello World\'.loc() => \'Bonjour le monde\'', function () { + equal(_emberRuntimeSystemString.loc('_Hello World'), 'Bonjour le monde'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + equal('_Hello World'.loc(), 'Bonjour le monde'); + } + }); + + QUnit.test('\'_Hello %@ %@\'.loc(\'John\', \'Doe\') => \'Bonjour John Doe\'', function () { + equal(_emberRuntimeSystemString.loc('_Hello %@ %@', ['John', 'Doe']), 'Bonjour John Doe'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + equal('_Hello %@ %@'.loc('John', 'Doe'), 'Bonjour John Doe'); + } + }); + + QUnit.test('\'_Hello %@# %@#\'.loc(\'John\', \'Doe\') => \'Bonjour Doe John\'', function () { + equal(_emberRuntimeSystemString.loc('_Hello %@# %@#', ['John', 'Doe']), 'Bonjour Doe John'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + equal('_Hello %@# %@#'.loc('John', 'Doe'), 'Bonjour Doe John'); + } + }); + + QUnit.test('\'_Not In Strings\'.loc() => \'_Not In Strings\'', function () { + equal(_emberRuntimeSystemString.loc('_Not In Strings'), '_Not In Strings'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + equal('_Not In Strings'.loc(), '_Not In Strings'); + } + }); + + QUnit.test('works with argument form', function () { + equal(_emberRuntimeSystemString.loc('_Hello %@', 'John'), 'Bonjour John'); + equal(_emberRuntimeSystemString.loc('_Hello %@ %@', ['John'], 'Doe'), 'Bonjour [John] Doe'); + }); +}); +// ES6TODO Ember.STRINGS +enifed('ember-runtime/tests/system/string/loc_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/string'); + test('ember-runtime/tests/system/string/loc_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/string/loc_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/string/loc_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/string'); + QUnit.test('ember-runtime/tests/system/string/loc_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/string/loc_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/string/underscore_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { + 'use strict'; + + QUnit.module('EmberStringUtils.underscore'); + + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + QUnit.test('String.prototype.underscore is not available without EXTEND_PROTOTYPES', function () { + ok('undefined' === typeof String.prototype.underscore, 'String.prototype helper disabled'); + }); + } + + QUnit.test('with normal string', function () { + deepEqual(_emberRuntimeSystemString.underscore('my favorite items'), 'my_favorite_items'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('my favorite items'.underscore(), 'my_favorite_items'); + } + }); + + QUnit.test('with dasherized string', function () { + deepEqual(_emberRuntimeSystemString.underscore('css-class-name'), 'css_class_name'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('css-class-name'.underscore(), 'css_class_name'); + } + }); + + QUnit.test('does nothing with underscored string', function () { + deepEqual(_emberRuntimeSystemString.underscore('action_name'), 'action_name'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('action_name'.underscore(), 'action_name'); + } + }); + + QUnit.test('with camelcased string', function () { + deepEqual(_emberRuntimeSystemString.underscore('innerHTML'), 'inner_html'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('innerHTML'.underscore(), 'inner_html'); + } + }); + + QUnit.test('underscore namespaced classified string', function () { + deepEqual(_emberRuntimeSystemString.underscore('PrivateDocs/OwnerInvoice'), 'private_docs/owner_invoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('PrivateDocs/OwnerInvoice'.underscore(), 'private_docs/owner_invoice'); + } + }); + + QUnit.test('underscore namespaced camelized string', function () { + deepEqual(_emberRuntimeSystemString.underscore('privateDocs/ownerInvoice'), 'private_docs/owner_invoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('privateDocs/ownerInvoice'.underscore(), 'private_docs/owner_invoice'); + } + }); + + QUnit.test('underscore namespaced dasherized string', function () { + deepEqual(_emberRuntimeSystemString.underscore('private-docs/owner-invoice'), 'private_docs/owner_invoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('private-docs/owner-invoice'.underscore(), 'private_docs/owner_invoice'); + } + }); +}); +enifed('ember-runtime/tests/system/string/underscore_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/string'); + test('ember-runtime/tests/system/string/underscore_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/string/underscore_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/string/underscore_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/string'); + QUnit.test('ember-runtime/tests/system/string/underscore_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/string/underscore_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/string/w_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { + 'use strict'; + + QUnit.module('EmberStringUtils.w'); + + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + QUnit.test('String.prototype.w is not available without EXTEND_PROTOTYPES', function () { + ok('undefined' === typeof String.prototype.w, 'String.prototype helper disabled'); + }); + } + + QUnit.test('\'one two three\'.w() => [\'one\',\'two\',\'three\']', function () { + deepEqual(_emberRuntimeSystemString.w('one two three'), ['one', 'two', 'three']); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('one two three'.w(), ['one', 'two', 'three']); + } + }); + + QUnit.test('\'one two three\'.w() with extra spaces between words => [\'one\',\'two\',\'three\']', function () { + deepEqual(_emberRuntimeSystemString.w('one two three'), ['one', 'two', 'three']); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('one two three'.w(), ['one', 'two', 'three']); + } + }); + + QUnit.test('\'one two three\'.w() with tabs', function () { + deepEqual(_emberRuntimeSystemString.w('one\ttwo three'), ['one', 'two', 'three']); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('one\ttwo three'.w(), ['one', 'two', 'three']); + } + }); +}); +enifed('ember-runtime/tests/system/string/w_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/string'); + test('ember-runtime/tests/system/string/w_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/string/w_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/string/w_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/string'); + QUnit.test('ember-runtime/tests/system/string/w_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/string/w_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/utils.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime'); + test('ember-runtime/utils.js should pass jscs', function () { + ok(true, 'ember-runtime/utils.js should pass jscs.'); + }); +}); +enifed('ember-runtime/utils.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime'); + QUnit.test('ember-runtime/utils.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/utils.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/compat.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler'); + test('ember-template-compiler/compat.js should pass jscs', function () { + ok(true, 'ember-template-compiler/compat.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/compat.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler'); + QUnit.test('ember-template-compiler/compat.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/compat.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler'); + test('ember-template-compiler/index.js should pass jscs', function () { + ok(true, 'ember-template-compiler/index.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler'); + QUnit.test('ember-template-compiler/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/index.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/assert-reserved-named-arguments.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/assert-reserved-named-arguments.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/assert-reserved-named-arguments.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/assert-reserved-named-arguments.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/assert-reserved-named-arguments.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/assert-reserved-named-arguments.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/deprecate-render-model.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/deprecate-render-model.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/deprecate-render-model.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/deprecate-render-model.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/deprecate-render-model.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/deprecate-render-model.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/index.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/index.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/index.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-action-syntax.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-action-syntax.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-action-syntax.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-action-syntax.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-action-syntax.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-action-syntax.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-angle-bracket-components.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-angle-bracket-components.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-angle-bracket-components.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-angle-bracket-components.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-angle-bracket-components.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-angle-bracket-components.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-attrs-into-args.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-attrs-into-args.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-attrs-into-args.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-attrs-into-args.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-attrs-into-args.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-attrs-into-args.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-each-in-into-each.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-each-in-into-each.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-each-in-into-each.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-each-in-into-each.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-each-in-into-each.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-each-in-into-each.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-has-block-syntax.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-has-block-syntax.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-has-block-syntax.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-has-block-syntax.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-has-block-syntax.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-has-block-syntax.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-inline-link-to.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-inline-link-to.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-inline-link-to.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-inline-link-to.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-inline-link-to.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-inline-link-to.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-input-on-to-onEvent.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-input-on-to-onEvent.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-input-on-to-onEvent.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-input-on-to-onEvent.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-input-on-to-onEvent.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-input-on-to-onEvent.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-input-type-syntax.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-input-type-syntax.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-input-type-syntax.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-input-type-syntax.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-input-type-syntax.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-input-type-syntax.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-item-class.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-item-class.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-item-class.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-item-class.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-item-class.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-item-class.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-old-binding-syntax.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-old-binding-syntax.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-old-binding-syntax.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-old-binding-syntax.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-old-binding-syntax.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-old-binding-syntax.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-old-class-binding-syntax.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-old-class-binding-syntax.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-old-class-binding-syntax.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-old-class-binding-syntax.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-old-class-binding-syntax.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-old-class-binding-syntax.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-top-level-components.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-top-level-components.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-top-level-components.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-top-level-components.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-top-level-components.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-top-level-components.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/system/bootstrap.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/system'); + test('ember-template-compiler/system/bootstrap.js should pass jscs', function () { + ok(true, 'ember-template-compiler/system/bootstrap.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/system/bootstrap.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/system'); + QUnit.test('ember-template-compiler/system/bootstrap.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/system/bootstrap.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/system/calculate-location-display.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/system'); + test('ember-template-compiler/system/calculate-location-display.js should pass jscs', function () { + ok(true, 'ember-template-compiler/system/calculate-location-display.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/system/calculate-location-display.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/system'); + QUnit.test('ember-template-compiler/system/calculate-location-display.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/system/calculate-location-display.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/system/compile-options.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/system'); + test('ember-template-compiler/system/compile-options.js should pass jscs', function () { + ok(true, 'ember-template-compiler/system/compile-options.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/system/compile-options.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/system'); + QUnit.test('ember-template-compiler/system/compile-options.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/system/compile-options.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/system/compile.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/system'); + test('ember-template-compiler/system/compile.js should pass jscs', function () { + ok(true, 'ember-template-compiler/system/compile.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/system/compile.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/system'); + QUnit.test('ember-template-compiler/system/compile.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/system/compile.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/system/precompile.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/system'); + test('ember-template-compiler/system/precompile.js should pass jscs', function () { + ok(true, 'ember-template-compiler/system/precompile.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/system/precompile.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/system'); + QUnit.test('ember-template-compiler/system/precompile.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/system/precompile.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test', ['exports', 'ember-template-compiler/index'], function (exports, _emberTemplateCompilerIndex) { + 'use strict'; + + QUnit.module('ember-template-compiler: assert-reserved-named-arguments'); + + QUnit.test('Paths beginning with @ are not valid', function () { + expect(3); + + expectAssertion(function () { + _emberTemplateCompilerIndex.compile('{{@foo}}', { + moduleName: 'baz/foo-bar' + }); + }, '\'@foo\' is not a valid path. (\'baz/foo-bar\' @ L1:C2) '); + + expectAssertion(function () { + _emberTemplateCompilerIndex.compile('{{#if @foo}}Yup{{/if}}', { + moduleName: 'baz/foo-bar' + }); + }, '\'@foo\' is not a valid path. (\'baz/foo-bar\' @ L1:C6) '); + + expectAssertion(function () { + _emberTemplateCompilerIndex.compile('{{input type=(if @foo "bar" "baz")}}', { + moduleName: 'baz/foo-bar' + }); + }, '\'@foo\' is not a valid path. (\'baz/foo-bar\' @ L1:C17) '); + }); +}); +enifed('ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/tests/plugins'); + test('ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.js should pass jscs', function () { + ok(true, 'ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/tests/plugins'); + QUnit.test('ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/tests/plugins/deprecate-render-model-test', ['exports', 'ember-template-compiler/index'], function (exports, _emberTemplateCompilerIndex) { + 'use strict'; + + QUnit.module('ember-template-compiler: deprecate-model-render'); + + QUnit.test('Using `{{render` with model provides a deprecation', function () { + expect(1); + + var expectedMessage = 'Please refactor `{{render "foo-bar" coolModel}}` to a component and' + ' invoke via `{{foo-bar model=coolModel}}`. (\'baz/foo-bar\' @ L1:C0) '; + + expectDeprecation(function () { + _emberTemplateCompilerIndex.compile('{{render "foo-bar" coolModel}}', { + moduleName: 'baz/foo-bar' + }); + }, expectedMessage); + }); +}); +enifed('ember-template-compiler/tests/plugins/deprecate-render-model-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/tests/plugins'); + test('ember-template-compiler/tests/plugins/deprecate-render-model-test.js should pass jscs', function () { + ok(true, 'ember-template-compiler/tests/plugins/deprecate-render-model-test.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/tests/plugins/deprecate-render-model-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/tests/plugins'); + QUnit.test('ember-template-compiler/tests/plugins/deprecate-render-model-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/tests/plugins/deprecate-render-model-test.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/tests/plugins/transform-inline-link-to-test', ['exports', 'ember-template-compiler/index'], function (exports, _emberTemplateCompilerIndex) { + 'use strict'; + + QUnit.module('ember-template-compiler: assert-no-view-and-controller-paths without legacy view support'); + + QUnit.test('Can transform an inline {{link-to}} without error', function () { + expect(0); + + _emberTemplateCompilerIndex.compile('{{link-to \'foo\' \'index\'}}', { + moduleName: 'foo/bar/baz' + }); + }); +}); +enifed('ember-template-compiler/tests/plugins/transform-inline-link-to-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/tests/plugins'); + test('ember-template-compiler/tests/plugins/transform-inline-link-to-test.js should pass jscs', function () { + ok(true, 'ember-template-compiler/tests/plugins/transform-inline-link-to-test.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/tests/plugins/transform-inline-link-to-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/tests/plugins'); + QUnit.test('ember-template-compiler/tests/plugins/transform-inline-link-to-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/tests/plugins/transform-inline-link-to-test.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/tests/plugins/transform-input-on-test', ['exports', 'ember-template-compiler/index'], function (exports, _emberTemplateCompilerIndex) { + 'use strict'; + + QUnit.module('ember-template-compiler: transform-input-on'); + + QUnit.test('Using `action` without `on` provides a deprecation', function () { + expect(1); + + expectDeprecation(function () { + _emberTemplateCompilerIndex.compile('{{input action="foo"}}', { + moduleName: 'foo/bar/baz' + }); + }, 'Using \'{{input action="foo"}}\' (\'foo/bar/baz\' @ L1:C0) is deprecated. Please use \'{{input enter="foo"}}\' instead.'); + }); + + QUnit.test('Using `action` with `on` provides a deprecation', function () { + expect(1); + + expectDeprecation(function () { + _emberTemplateCompilerIndex.compile('{{input on="focus-in" action="foo"}}', { + moduleName: 'foo/bar/baz' + }); + }, 'Using \'{{input on="focus-in" action="foo"}}\' (\'foo/bar/baz\' @ L1:C0) is deprecated. Please use \'{{input focus-in="foo"}}\' instead.'); + }); + + QUnit.test('Using `on=\'keyPress\'` does not clobber `keyPress`', function () { + expect(1); + + expectDeprecation(function () { + _emberTemplateCompilerIndex.compile('{{input on="keyPress" action="foo"}}', { + moduleName: 'foo/bar/baz' + }); + }, 'Using \'{{input on="keyPress" action="foo"}}\' (\'foo/bar/baz\' @ L1:C0) is deprecated. Please use \'{{input key-press="foo"}}\' instead.'); + }); + + QUnit.test('Using `on=\'foo\'` without `action=\'asdf\'` raises specific deprecation', function () { + expect(1); + + expectDeprecation(function () { + _emberTemplateCompilerIndex.compile('{{input on="asdf"}}', { + moduleName: 'foo/bar/baz' + }); + }, 'Using \'{{input on="asdf" ...}}\' without specifying an action (\'foo/bar/baz\' @ L1:C0) will do nothing.'); + }); +}); +enifed('ember-template-compiler/tests/plugins/transform-input-on-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/tests/plugins'); + test('ember-template-compiler/tests/plugins/transform-input-on-test.js should pass jscs', function () { + ok(true, 'ember-template-compiler/tests/plugins/transform-input-on-test.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/tests/plugins/transform-input-on-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/tests/plugins'); + QUnit.test('ember-template-compiler/tests/plugins/transform-input-on-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/tests/plugins/transform-input-on-test.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/tests/system/bootstrap-test', ['exports', 'ember-metal', 'ember-views', 'ember-glimmer', 'ember-template-compiler/system/bootstrap', 'internal-test-helpers'], function (exports, _emberMetal, _emberViews, _emberGlimmer, _emberTemplateCompilerSystemBootstrap, _internalTestHelpers) { + 'use strict'; + + var trim = _emberViews.jQuery.trim; + + var component = undefined, + fixture = undefined; + + function checkTemplate(templateName) { + _emberMetal.run(function () { + return _emberTemplateCompilerSystemBootstrap.default({ context: fixture, hasTemplate: _emberGlimmer.hasTemplate, setTemplate: _emberGlimmer.setTemplate }); + }); + + var template = _emberGlimmer.getTemplate(templateName); + + ok(template, 'template is available on Ember.TEMPLATES'); + equal(_emberViews.jQuery('#qunit-fixture script').length, 0, 'script removed'); + + var owner = _internalTestHelpers.buildOwner(); + owner.register('template:-top-level', template); + owner.register('component:-top-level', _emberGlimmer.Component.extend({ + layoutName: '-top-level', + firstName: 'Tobias', + drug: 'teamocil' + })); + + component = owner.lookup('component:-top-level'); + _internalTestHelpers.runAppend(component); + + equal(_emberViews.jQuery('#qunit-fixture').text().trim(), 'Tobias takes teamocil', 'template works'); + _internalTestHelpers.runDestroy(component); + } + + QUnit.module('ember-templates: bootstrap', { + setup: function () { + fixture = document.getElementById('qunit-fixture'); + }, + teardown: function () { + _emberGlimmer.setTemplates({}); + _internalTestHelpers.runDestroy(component); + } + }); + + QUnit.test('template with data-template-name should add a new template to Ember.TEMPLATES', function () { + _emberViews.jQuery('#qunit-fixture').html(''); + + checkTemplate('funkyTemplate'); + }); + + QUnit.test('template with id instead of data-template-name should add a new template to Ember.TEMPLATES', function () { + _emberViews.jQuery('#qunit-fixture').html(''); + + checkTemplate('funkyTemplate'); + }); + + QUnit.test('template without data-template-name or id should default to application', function () { + _emberViews.jQuery('#qunit-fixture').html(''); + + checkTemplate('application'); + }); + + if (typeof Handlebars === 'object') { + QUnit.test('template with type text/x-raw-handlebars should be parsed', function () { + _emberViews.jQuery('#qunit-fixture').html(''); + + _emberMetal.run(function () { + return _emberTemplateCompilerSystemBootstrap.default({ context: fixture, hasTemplate: _emberGlimmer.hasTemplate, setTemplate: _emberGlimmer.setTemplate }); + }); + + var template = _emberGlimmer.getTemplate('funkyTemplate'); + + ok(template, 'template with name funkyTemplate available'); + + // This won't even work with Ember templates + equal(trim(template({ name: 'Tobias' })), 'Tobias'); + }); + } + + QUnit.test('duplicated default application templates should throw exception', function () { + _emberViews.jQuery('#qunit-fixture').html(''); + + throws(function () { + return _emberTemplateCompilerSystemBootstrap.default({ context: fixture, hasTemplate: _emberGlimmer.hasTemplate, setTemplate: _emberGlimmer.setTemplate }); + }, /Template named "[^"]+" already exists\./, 'duplicate templates should not be allowed'); + }); + + QUnit.test('default application template and id application template present should throw exception', function () { + _emberViews.jQuery('#qunit-fixture').html(''); + + throws(function () { + return _emberTemplateCompilerSystemBootstrap.default({ context: fixture, hasTemplate: _emberGlimmer.hasTemplate, setTemplate: _emberGlimmer.setTemplate }); + }, /Template named "[^"]+" already exists\./, 'duplicate templates should not be allowed'); + }); + + QUnit.test('default application template and data-template-name application template present should throw exception', function () { + _emberViews.jQuery('#qunit-fixture').html(''); + + throws(function () { + return _emberTemplateCompilerSystemBootstrap.default({ context: fixture, hasTemplate: _emberGlimmer.hasTemplate, setTemplate: _emberGlimmer.setTemplate }); + }, /Template named "[^"]+" already exists\./, 'duplicate templates should not be allowed'); + }); + + QUnit.test('duplicated template id should throw exception', function () { + _emberViews.jQuery('#qunit-fixture').html(''); + + throws(function () { + return _emberTemplateCompilerSystemBootstrap.default({ context: fixture, hasTemplate: _emberGlimmer.hasTemplate, setTemplate: _emberGlimmer.setTemplate }); + }, /Template named "[^"]+" already exists\./, 'duplicate templates should not be allowed'); + }); + + QUnit.test('duplicated template data-template-name should throw exception', function () { + _emberViews.jQuery('#qunit-fixture').html(''); + + throws(function () { + return _emberTemplateCompilerSystemBootstrap.default({ context: fixture, hasTemplate: _emberGlimmer.hasTemplate, setTemplate: _emberGlimmer.setTemplate }); + }, /Template named "[^"]+" already exists\./, 'duplicate templates should not be allowed'); + }); +}); +enifed('ember-template-compiler/tests/system/bootstrap-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/tests/system'); + test('ember-template-compiler/tests/system/bootstrap-test.js should pass jscs', function () { + ok(true, 'ember-template-compiler/tests/system/bootstrap-test.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/tests/system/bootstrap-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/tests/system'); + QUnit.test('ember-template-compiler/tests/system/bootstrap-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/tests/system/bootstrap-test.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/tests/system/compile_options_test', ['exports', 'ember-template-compiler/index'], function (exports, _emberTemplateCompilerIndex) { + 'use strict'; + + QUnit.module('ember-template-compiler: default compile options'); + + QUnit.test('default options are a new copy', function () { + notEqual(_emberTemplateCompilerIndex.compileOptions(), _emberTemplateCompilerIndex.compileOptions()); + }); + + QUnit.test('has default AST plugins', function (assert) { + assert.expect(_emberTemplateCompilerIndex.defaultPlugins.length); + + var plugins = _emberTemplateCompilerIndex.compileOptions().plugins.ast; + + for (var i = 0; i < _emberTemplateCompilerIndex.defaultPlugins.length; i++) { + var plugin = _emberTemplateCompilerIndex.defaultPlugins[i]; + assert.ok(plugins.indexOf(plugin) > -1, 'includes ' + plugin); + } + }); +}); +enifed('ember-template-compiler/tests/system/compile_options_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/tests/system'); + test('ember-template-compiler/tests/system/compile_options_test.js should pass jscs', function () { + ok(true, 'ember-template-compiler/tests/system/compile_options_test.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/tests/system/compile_options_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/tests/system'); + QUnit.test('ember-template-compiler/tests/system/compile_options_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/tests/system/compile_options_test.js should pass jshint.'); + }); +}); +enifed('ember-testing/adapters/adapter.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/adapters'); + test('ember-testing/adapters/adapter.js should pass jscs', function () { + ok(true, 'ember-testing/adapters/adapter.js should pass jscs.'); + }); +}); +enifed('ember-testing/adapters/adapter.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/adapters'); + QUnit.test('ember-testing/adapters/adapter.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/adapters/adapter.js should pass jshint.'); + }); +}); +enifed('ember-testing/adapters/qunit.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/adapters'); + test('ember-testing/adapters/qunit.js should pass jscs', function () { + ok(true, 'ember-testing/adapters/qunit.js should pass jscs.'); + }); +}); +enifed('ember-testing/adapters/qunit.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/adapters'); + QUnit.test('ember-testing/adapters/qunit.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/adapters/qunit.js should pass jshint.'); + }); +}); +enifed('ember-testing/events.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing'); + test('ember-testing/events.js should pass jscs', function () { + ok(true, 'ember-testing/events.js should pass jscs.'); + }); +}); +enifed('ember-testing/events.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing'); + QUnit.test('ember-testing/events.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/events.js should pass jshint.'); + }); +}); +enifed('ember-testing/ext/application.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/ext'); + test('ember-testing/ext/application.js should pass jscs', function () { + ok(true, 'ember-testing/ext/application.js should pass jscs.'); + }); +}); +enifed('ember-testing/ext/application.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/ext'); + QUnit.test('ember-testing/ext/application.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/ext/application.js should pass jshint.'); + }); +}); +enifed('ember-testing/ext/rsvp.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/ext'); + test('ember-testing/ext/rsvp.js should pass jscs', function () { + ok(true, 'ember-testing/ext/rsvp.js should pass jscs.'); + }); +}); +enifed('ember-testing/ext/rsvp.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/ext'); + QUnit.test('ember-testing/ext/rsvp.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/ext/rsvp.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing'); + test('ember-testing/helpers.js should pass jscs', function () { + ok(true, 'ember-testing/helpers.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing'); + QUnit.test('ember-testing/helpers.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/and_then.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/and_then.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/and_then.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/and_then.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/and_then.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/and_then.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/click.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/click.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/click.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/click.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/click.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/click.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/current_path.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/current_path.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/current_path.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/current_path.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/current_path.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/current_path.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/current_route_name.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/current_route_name.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/current_route_name.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/current_route_name.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/current_route_name.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/current_route_name.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/current_url.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/current_url.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/current_url.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/current_url.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/current_url.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/current_url.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/fill_in.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/fill_in.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/fill_in.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/fill_in.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/fill_in.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/fill_in.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/find.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/find.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/find.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/find.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/find.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/find.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/find_with_assert.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/find_with_assert.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/find_with_assert.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/find_with_assert.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/find_with_assert.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/find_with_assert.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/key_event.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/key_event.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/key_event.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/key_event.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/key_event.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/key_event.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/pause_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/pause_test.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/pause_test.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/pause_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/pause_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/pause_test.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/trigger_event.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/trigger_event.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/trigger_event.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/trigger_event.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/trigger_event.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/trigger_event.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/visit.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/visit.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/visit.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/visit.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/visit.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/visit.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/wait.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/wait.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/wait.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/wait.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/wait.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/wait.js should pass jshint.'); + }); +}); +enifed('ember-testing/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing'); + test('ember-testing/index.js should pass jscs', function () { + ok(true, 'ember-testing/index.js should pass jscs.'); + }); +}); +enifed('ember-testing/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing'); + QUnit.test('ember-testing/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/index.js should pass jshint.'); + }); +}); +enifed('ember-testing/initializers.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing'); + test('ember-testing/initializers.js should pass jscs', function () { + ok(true, 'ember-testing/initializers.js should pass jscs.'); + }); +}); +enifed('ember-testing/initializers.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing'); + QUnit.test('ember-testing/initializers.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/initializers.js should pass jshint.'); + }); +}); +enifed('ember-testing/setup_for_testing.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing'); + test('ember-testing/setup_for_testing.js should pass jscs', function () { + ok(true, 'ember-testing/setup_for_testing.js should pass jscs.'); + }); +}); +enifed('ember-testing/setup_for_testing.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing'); + QUnit.test('ember-testing/setup_for_testing.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/setup_for_testing.js should pass jshint.'); + }); +}); +enifed('ember-testing/support.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing'); + test('ember-testing/support.js should pass jscs', function () { + ok(true, 'ember-testing/support.js should pass jscs.'); + }); +}); +enifed('ember-testing/support.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing'); + QUnit.test('ember-testing/support.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/support.js should pass jshint.'); + }); +}); +enifed('ember-testing/test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing'); + test('ember-testing/test.js should pass jscs', function () { + ok(true, 'ember-testing/test.js should pass jscs.'); + }); +}); +enifed('ember-testing/test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing'); + QUnit.test('ember-testing/test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/test.js should pass jshint.'); + }); +}); +enifed('ember-testing/test/adapter.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/test'); + test('ember-testing/test/adapter.js should pass jscs', function () { + ok(true, 'ember-testing/test/adapter.js should pass jscs.'); + }); +}); +enifed('ember-testing/test/adapter.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/test'); + QUnit.test('ember-testing/test/adapter.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/test/adapter.js should pass jshint.'); + }); +}); +enifed('ember-testing/test/helpers.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/test'); + test('ember-testing/test/helpers.js should pass jscs', function () { + ok(true, 'ember-testing/test/helpers.js should pass jscs.'); + }); +}); +enifed('ember-testing/test/helpers.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/test'); + QUnit.test('ember-testing/test/helpers.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/test/helpers.js should pass jshint.'); + }); +}); +enifed('ember-testing/test/on_inject_helpers.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/test'); + test('ember-testing/test/on_inject_helpers.js should pass jscs', function () { + ok(true, 'ember-testing/test/on_inject_helpers.js should pass jscs.'); + }); +}); +enifed('ember-testing/test/on_inject_helpers.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/test'); + QUnit.test('ember-testing/test/on_inject_helpers.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/test/on_inject_helpers.js should pass jshint.'); + }); +}); +enifed('ember-testing/test/pending_requests.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/test'); + test('ember-testing/test/pending_requests.js should pass jscs', function () { + ok(true, 'ember-testing/test/pending_requests.js should pass jscs.'); + }); +}); +enifed('ember-testing/test/pending_requests.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/test'); + QUnit.test('ember-testing/test/pending_requests.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/test/pending_requests.js should pass jshint.'); + }); +}); +enifed('ember-testing/test/promise.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/test'); + test('ember-testing/test/promise.js should pass jscs', function () { + ok(true, 'ember-testing/test/promise.js should pass jscs.'); + }); +}); +enifed('ember-testing/test/promise.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/test'); + QUnit.test('ember-testing/test/promise.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/test/promise.js should pass jshint.'); + }); +}); +enifed('ember-testing/test/run.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/test'); + test('ember-testing/test/run.js should pass jscs', function () { + ok(true, 'ember-testing/test/run.js should pass jscs.'); + }); +}); +enifed('ember-testing/test/run.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/test'); + QUnit.test('ember-testing/test/run.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/test/run.js should pass jshint.'); + }); +}); +enifed('ember-testing/test/waiters.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/test'); + test('ember-testing/test/waiters.js should pass jscs', function () { + ok(true, 'ember-testing/test/waiters.js should pass jscs.'); + }); +}); +enifed('ember-testing/test/waiters.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/test'); + QUnit.test('ember-testing/test/waiters.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/test/waiters.js should pass jshint.'); + }); +}); +enifed('ember-testing/tests/acceptance_test', ['exports', 'ember-metal', 'ember-views', 'ember-testing/test', 'ember-testing/adapters/qunit', 'ember-testing/initializers', 'ember-application', 'ember-routing', 'ember-template-compiler', 'ember-runtime', 'ember-glimmer'], function (exports, _emberMetal, _emberViews, _emberTestingTest, _emberTestingAdaptersQunit, _emberTestingInitializers, _emberApplication, _emberRouting, _emberTemplateCompiler, _emberRuntime, _emberGlimmer) { + 'use strict'; + + //ES6TODO: we need {{link-to}} and {{outlet}} to exist here + + var App, find, click, fillIn, currentRoute, currentURL, visit, originalAdapter, andThen, indexHitCount; + + QUnit.module('ember-testing Acceptance', { + setup: function () { + _emberViews.jQuery('').appendTo('head'); + _emberViews.jQuery('
    ').appendTo('body'); + + originalAdapter = _emberTestingTest.default.adapter; + + _emberMetal.run(function () { + indexHitCount = 0; + + App = _emberApplication.Application.create({ + rootElement: '#ember-testing' + }); + + App.Router.map(function () { + this.route('posts'); + this.route('comments'); + + this.route('abort_transition'); + + this.route('redirect'); + }); + + App.IndexRoute = _emberRouting.Route.extend({ + model: function () { + indexHitCount += 1; + } + }); + + App.PostsRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + currentRoute = 'posts'; + this._super.apply(this, arguments); + } + }); + + _emberGlimmer.setTemplate('posts', _emberTemplateCompiler.compile('
    ')); + + App.CommentsRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + currentRoute = 'comments'; + this._super.apply(this, arguments); + } + }); + + _emberGlimmer.setTemplate('comments', _emberTemplateCompiler.compile('
    {{input type="text"}}
    ')); + + App.AbortTransitionRoute = _emberRouting.Route.extend({ + beforeModel: function (transition) { + transition.abort(); + } + }); + + App.RedirectRoute = _emberRouting.Route.extend({ + beforeModel: function () { + this.transitionTo('comments'); + } + }); + + App.setupForTesting(); + }); + + _emberTestingTest.default.registerAsyncHelper('slowHelper', function () { + return new _emberRuntime.RSVP.Promise(function (resolve) { + setTimeout(resolve, 10); + }); + }); + + App.injectTestHelpers(); + + find = window.find; + click = window.click; + fillIn = window.fillIn; + visit = window.visit; + andThen = window.andThen; + currentURL = window.currentURL; + }, + + teardown: function () { + _emberTestingTest.default.unregisterHelper('slowHelper'); + _emberGlimmer.setTemplates({}); + _emberViews.jQuery('#ember-testing-container, #ember-testing').remove(); + _emberMetal.run(App, App.destroy); + App = null; + _emberTestingTest.default.adapter = originalAdapter; + indexHitCount = 0; + } + }); + + QUnit.test('helpers can be chained with then', function () { + expect(6); + + currentRoute = 'index'; + + visit('/posts').then(function () { + equal(currentRoute, 'posts', 'Successfully visited posts route'); + equal(currentURL(), '/posts', 'posts URL is correct'); + return click('a:contains("Comments")'); + }).then(function () { + equal(currentRoute, 'comments', 'visit chained with click'); + return fillIn('.ember-text-field', 'yeah'); + }).then(function () { + equal(_emberViews.jQuery('.ember-text-field').val(), 'yeah', 'chained with fillIn'); + return fillIn('.ember-text-field', '#ember-testing-container', 'context working'); + }).then(function () { + equal(_emberViews.jQuery('.ember-text-field').val(), 'context working', 'chained with fillIn'); + return click('.does-not-exist'); + }).then(null, function (e) { + equal(e.message, 'Element .does-not-exist not found.', 'Non-existent click exception caught'); + }); + }); + + // Keep this for backwards compatibility + + QUnit.test('helpers can be chained to each other', function () { + expect(7); + + currentRoute = 'index'; + + visit('/posts').click('a:first', '#comments-link').fillIn('.ember-text-field', 'hello').then(function () { + equal(currentRoute, 'comments', 'Successfully visited comments route'); + equal(currentURL(), '/comments', 'Comments URL is correct'); + equal(_emberViews.jQuery('.ember-text-field').val(), 'hello', 'Fillin successfully works'); + find('.ember-text-field').one('keypress', function (e) { + equal(e.keyCode, 13, 'keyevent chained with correct keyCode.'); + equal(e.which, 13, 'keyevent chained with correct which.'); + }); + }).keyEvent('.ember-text-field', 'keypress', 13).visit('/posts').then(function () { + equal(currentRoute, 'posts', 'Thens can also be chained to helpers'); + equal(currentURL(), '/posts', 'URL is set correct on chained helpers'); + }); + }); + + QUnit.test('helpers don\'t need to be chained', function () { + expect(5); + + currentRoute = 'index'; + + visit('/posts'); + + click('a:first', '#comments-link'); + + fillIn('.ember-text-field', 'hello'); + + andThen(function () { + equal(currentRoute, 'comments', 'Successfully visited comments route'); + equal(currentURL(), '/comments', 'Comments URL is correct'); + equal(find('.ember-text-field').val(), 'hello', 'Fillin successfully works'); + }); + + visit('/posts'); + + andThen(function () { + equal(currentRoute, 'posts'); + equal(currentURL(), '/posts'); + }); + }); + + QUnit.test('Nested async helpers', function () { + expect(5); + + currentRoute = 'index'; + + visit('/posts'); + + andThen(function () { + click('a:first', '#comments-link'); + + fillIn('.ember-text-field', 'hello'); + }); + + andThen(function () { + equal(currentRoute, 'comments', 'Successfully visited comments route'); + equal(currentURL(), '/comments', 'Comments URL is correct'); + equal(find('.ember-text-field').val(), 'hello', 'Fillin successfully works'); + }); + + visit('/posts'); + + andThen(function () { + equal(currentRoute, 'posts'); + equal(currentURL(), '/posts'); + }); + }); + + QUnit.test('Multiple nested async helpers', function () { + expect(3); + + visit('/posts'); + + andThen(function () { + click('a:first', '#comments-link'); + + fillIn('.ember-text-field', 'hello'); + fillIn('.ember-text-field', 'goodbye'); + }); + + andThen(function () { + equal(find('.ember-text-field').val(), 'goodbye', 'Fillin successfully works'); + equal(currentRoute, 'comments', 'Successfully visited comments route'); + equal(currentURL(), '/comments', 'Comments URL is correct'); + }); + }); + + QUnit.test('Helpers nested in thens', function () { + expect(5); + + currentRoute = 'index'; + + visit('/posts').then(function () { + click('a:first', '#comments-link'); + }); + + andThen(function () { + fillIn('.ember-text-field', 'hello'); + }); + + andThen(function () { + equal(currentRoute, 'comments', 'Successfully visited comments route'); + equal(currentURL(), '/comments', 'Comments URL is correct'); + equal(find('.ember-text-field').val(), 'hello', 'Fillin successfully works'); + }); + + visit('/posts'); + + andThen(function () { + equal(currentRoute, 'posts'); + equal(currentURL(), '/posts', 'Posts URL is correct'); + }); + }); + + QUnit.test('Aborted transitions are not logged via Ember.Test.adapter#exception', function () { + expect(0); + + _emberTestingTest.default.adapter = _emberTestingAdaptersQunit.default.create({ + exception: function (error) { + ok(false, 'aborted transitions are not logged'); + } + }); + + visit('/abort_transition'); + }); + + QUnit.test('Unhandled exceptions are logged via Ember.Test.adapter#exception', function () { + expect(2); + + var asyncHandled; + _emberTestingTest.default.adapter = _emberTestingAdaptersQunit.default.create({ + exception: function (error) { + equal(error.message, 'Element .does-not-exist not found.', 'Exception successfully caught and passed to Ember.Test.adapter.exception'); + asyncHandled['catch'](function () {}); // handle the rejection so it doesn't leak later. + } + }); + + visit('/posts'); + + click('.invalid-element').then(null, function (error) { + equal(error.message, 'Element .invalid-element not found.', 'Exception successfully handled in the rejection handler'); + }); + + asyncHandled = click('.does-not-exist'); + }); + + QUnit.test('Unhandled exceptions in `andThen` are logged via Ember.Test.adapter#exception', function () { + expect(1); + + _emberTestingTest.default.adapter = _emberTestingAdaptersQunit.default.create({ + exception: function (error) { + equal(error.message, 'Catch me', 'Exception successfully caught and passed to Ember.Test.adapter.exception'); + } + }); + + visit('/posts'); + + andThen(function () { + throw new Error('Catch me'); + }); + }); + + QUnit.test('should not start routing on the root URL when visiting another', function () { + expect(4); + + visit('/posts'); + + andThen(function () { + ok(find('#comments-link'), 'found comments-link'); + equal(currentRoute, 'posts', 'Successfully visited posts route'); + equal(currentURL(), '/posts', 'Posts URL is correct'); + equal(indexHitCount, 0, 'should not hit index route when visiting another route'); + }); + }); + + QUnit.test('only enters the index route once when visiting /', function () { + expect(1); + + visit('/'); + + andThen(function () { + equal(indexHitCount, 1, 'should hit index once when visiting /'); + }); + }); + + QUnit.test('test must not finish while asyncHelpers are pending', function () { + expect(2); + + var async = 0; + var innerRan = false; + + _emberTestingTest.default.adapter = _emberTestingAdaptersQunit.default.extend({ + asyncStart: function () { + async++; + this._super(); + }, + asyncEnd: function () { + async--; + this._super(); + } + }).create(); + + App.testHelpers.slowHelper(); + andThen(function () { + innerRan = true; + }); + + equal(innerRan, false, 'should not have run yet'); + ok(async > 0, 'should have told the adapter to pause'); + + if (async === 0) { + // If we failed the test, prevent zalgo from escaping and breaking + // our other tests. + _emberTestingTest.default.adapter.asyncStart(); + _emberTestingTest.default.resolve().then(function () { + _emberTestingTest.default.adapter.asyncEnd(); + }); + } + }); + + QUnit.test('visiting a URL that causes another transition should yield the correct URL', function () { + expect(1); + + visit('/redirect'); + + andThen(function () { + equal(currentURL(), '/comments', 'Redirected to Comments URL'); + }); + }); + + QUnit.test('visiting a URL and then visiting a second URL with a transition should yield the correct URL', function () { + expect(2); + + visit('/posts'); + + andThen(function () { + equal(currentURL(), '/posts', 'First visited URL is correct'); + }); + + visit('/redirect'); + + andThen(function () { + equal(currentURL(), '/comments', 'Redirected to Comments URL'); + }); + }); + + QUnit.module('ember-testing Acceptance – teardown'); + + QUnit.test('that the setup/teardown happens correct', function () { + expect(2); + + _emberViews.jQuery('').appendTo('head'); + _emberViews.jQuery('
    ').appendTo('body'); + + _emberMetal.run(function () { + indexHitCount = 0; + App = _emberApplication.Application.create({ + rootElement: '#ember-testing' + }); + }); + App.injectTestHelpers(); + + _emberViews.jQuery('#ember-testing-container, #ember-testing').remove(); + ok(typeof _emberTestingTest.default.Promise.prototype.click === 'function'); + _emberMetal.run(App, App.destroy); + equal(_emberTestingTest.default.Promise.prototype.click, undefined); + App = null; + _emberTestingTest.default.adapter = originalAdapter; + indexHitCount = 0; + }); +}); +// ensure the initializer is setup +enifed('ember-testing/tests/acceptance_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/tests'); + test('ember-testing/tests/acceptance_test.js should pass jscs', function () { + ok(true, 'ember-testing/tests/acceptance_test.js should pass jscs.'); + }); +}); +enifed('ember-testing/tests/acceptance_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/tests'); + QUnit.test('ember-testing/tests/acceptance_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/tests/acceptance_test.js should pass jshint.'); + }); +}); +enifed('ember-testing/tests/adapters/adapter_test', ['exports', 'ember-metal', 'ember-testing/adapters/adapter'], function (exports, _emberMetal, _emberTestingAdaptersAdapter) { + 'use strict'; + + var adapter; + + QUnit.module('ember-testing Adapter', { + setup: function () { + adapter = new _emberTestingAdaptersAdapter.default(); + }, + teardown: function () { + _emberMetal.run(adapter, adapter.destroy); + } + }); + + // Can't test these this way anymore since we have nothing to compare to + // test("asyncStart is a noop", function() { + // equal(adapter.asyncStart, K); + // }); + + // test("asyncEnd is a noop", function() { + // equal(adapter.asyncEnd, K); + // }); + + QUnit.test('exception throws', function () { + var error = 'Hai'; + var thrown; + + try { + adapter.exception(error); + } catch (e) { + thrown = e; + } + equal(thrown, error); + }); +}); +enifed('ember-testing/tests/adapters/adapter_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/tests/adapters'); + test('ember-testing/tests/adapters/adapter_test.js should pass jscs', function () { + ok(true, 'ember-testing/tests/adapters/adapter_test.js should pass jscs.'); + }); +}); +enifed('ember-testing/tests/adapters/adapter_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/tests/adapters'); + QUnit.test('ember-testing/tests/adapters/adapter_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/tests/adapters/adapter_test.js should pass jshint.'); + }); +}); +enifed('ember-testing/tests/adapters/qunit_test', ['exports', 'ember-metal', 'ember-testing/adapters/qunit'], function (exports, _emberMetal, _emberTestingAdaptersQunit) { + 'use strict'; + + var adapter; + + QUnit.module('ember-testing QUnitAdapter', { + setup: function () { + adapter = new _emberTestingAdaptersQunit.default(); + }, + teardown: function () { + _emberMetal.run(adapter, adapter.destroy); + } + }); + + QUnit.test('asyncStart calls stop', function () { + var originalStop = QUnit.stop; + try { + QUnit.stop = function () { + ok(true, 'stop called'); + }; + adapter.asyncStart(); + } finally { + QUnit.stop = originalStop; + } + }); + + QUnit.test('asyncEnd calls start', function () { + var originalStart = QUnit.start; + try { + QUnit.start = function () { + ok(true, 'start called'); + }; + adapter.asyncEnd(); + } finally { + QUnit.start = originalStart; + } + }); + + QUnit.test('exception causes a failing assertion', function () { + var error = { err: 'hai' }; + var originalOk = window.ok; + try { + window.ok = function (val, msg) { + originalOk(!val, 'ok is called with false'); + originalOk(msg, '{err: "hai"}'); + }; + adapter.exception(error); + } finally { + window.ok = originalOk; + } + }); +}); +enifed('ember-testing/tests/adapters/qunit_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/tests/adapters'); + test('ember-testing/tests/adapters/qunit_test.js should pass jscs', function () { + ok(true, 'ember-testing/tests/adapters/qunit_test.js should pass jscs.'); + }); +}); +enifed('ember-testing/tests/adapters/qunit_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/tests/adapters'); + QUnit.test('ember-testing/tests/adapters/qunit_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/tests/adapters/qunit_test.js should pass jshint.'); + }); +}); +enifed('ember-testing/tests/adapters_test', ['exports', 'ember-metal', 'ember-testing/test', 'ember-testing/adapters/adapter', 'ember-testing/adapters/qunit', 'ember-application'], function (exports, _emberMetal, _emberTestingTest, _emberTestingAdaptersAdapter, _emberTestingAdaptersQunit, _emberApplication) { + 'use strict'; + + var App, originalAdapter; + + QUnit.module('ember-testing Adapters', { + setup: function () { + originalAdapter = _emberTestingTest.default.adapter; + }, + teardown: function () { + _emberMetal.run(App, App.destroy); + App.removeTestHelpers(); + App = null; + + _emberTestingTest.default.adapter = originalAdapter; + } + }); + + QUnit.test('Setting a test adapter manually', function () { + expect(1); + var CustomAdapter; + + CustomAdapter = _emberTestingAdaptersAdapter.default.extend({ + asyncStart: function () { + ok(true, 'Correct adapter was used'); + } + }); + + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + _emberTestingTest.default.adapter = CustomAdapter.create(); + App.setupForTesting(); + }); + + _emberTestingTest.default.adapter.asyncStart(); + }); + + QUnit.test('QUnitAdapter is used by default', function () { + expect(1); + + _emberTestingTest.default.adapter = null; + + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.setupForTesting(); + }); + + ok(_emberTestingTest.default.adapter instanceof _emberTestingAdaptersQunit.default); + }); +}); +enifed('ember-testing/tests/adapters_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/tests'); + test('ember-testing/tests/adapters_test.js should pass jscs', function () { + ok(true, 'ember-testing/tests/adapters_test.js should pass jscs.'); + }); +}); +enifed('ember-testing/tests/adapters_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/tests'); + QUnit.test('ember-testing/tests/adapters_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/tests/adapters_test.js should pass jshint.'); + }); +}); +enifed('ember-testing/tests/ext/rsvp_test', ['exports', 'ember-testing/ext/rsvp', 'ember-testing/test/adapter', 'ember-metal'], function (exports, _emberTestingExtRsvp, _emberTestingTestAdapter, _emberMetal) { + 'use strict'; + + var originalTestAdapter = _emberTestingTestAdapter.getAdapter(); + var originalTestingFlag = _emberMetal.isTesting(); + + var asyncStarted = 0; + var asyncEnded = 0; + + QUnit.module('ember-testing RSVP', { + setup: function () { + _emberMetal.setTesting(true); + _emberTestingTestAdapter.setAdapter({ + asyncStart: function () { + asyncStarted++; + QUnit.stop(); + }, + asyncEnd: function () { + asyncEnded++; + QUnit.start(); + } + }); + }, + teardown: function () { + asyncStarted = 0; + asyncEnded = 0; + _emberTestingTestAdapter.setAdapter(originalTestAdapter); + _emberMetal.setTesting(originalTestingFlag); + } + }); + + QUnit.test('given `Ember.testing = true`, correctly informs the test suite about async steps', function () { + expect(19); + + ok(!_emberMetal.run.currentRunLoop, 'expect no run-loop'); + + _emberMetal.setTesting(true); + + equal(asyncStarted, 0); + equal(asyncEnded, 0); + + var user = _emberTestingExtRsvp.default.Promise.resolve({ + name: 'tomster' + }); + + equal(asyncStarted, 0); + equal(asyncEnded, 0); + + user.then(function (user) { + equal(asyncStarted, 1); + equal(asyncEnded, 1); + + equal(user.name, 'tomster'); + + return _emberTestingExtRsvp.default.Promise.resolve(1).then(function () { + equal(asyncStarted, 1); + equal(asyncEnded, 1); + }); + }).then(function () { + equal(asyncStarted, 1); + equal(asyncEnded, 1); + + return new _emberTestingExtRsvp.default.Promise(function (resolve) { + QUnit.stop(); // raw async, we must inform the test framework manually + setTimeout(function () { + QUnit.start(); // raw async, we must inform the test framework manually + + equal(asyncStarted, 1); + equal(asyncEnded, 1); + + resolve({ + name: 'async tomster' + }); + + equal(asyncStarted, 2); + equal(asyncEnded, 1); + }, 0); + }); + }).then(function (user) { + equal(user.name, 'async tomster'); + equal(asyncStarted, 2); + equal(asyncEnded, 2); + }); + }); +}); +enifed('ember-testing/tests/ext/rsvp_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/tests/ext'); + test('ember-testing/tests/ext/rsvp_test.js should pass jscs', function () { + ok(true, 'ember-testing/tests/ext/rsvp_test.js should pass jscs.'); + }); +}); +enifed('ember-testing/tests/ext/rsvp_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/tests/ext'); + QUnit.test('ember-testing/tests/ext/rsvp_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/tests/ext/rsvp_test.js should pass jshint.'); + }); +}); +enifed('ember-testing/tests/helper_registration_test', ['exports', 'ember-metal', 'ember-testing/test', 'ember-application'], function (exports, _emberMetal, _emberTestingTest, _emberApplication) { + 'use strict'; + + var App, appBooted, helperContainer; + + function registerHelper() { + _emberTestingTest.default.registerHelper('boot', function (app) { + _emberMetal.run(app, app.advanceReadiness); + appBooted = true; + return app.testHelpers.wait(); + }); + } + + function unregisterHelper() { + _emberTestingTest.default.unregisterHelper('boot'); + } + + var originalAdapter = _emberTestingTest.default.adapter; + + function setupApp() { + appBooted = false; + helperContainer = {}; + + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.setupForTesting(); + App.injectTestHelpers(helperContainer); + }); + } + + function destroyApp() { + if (App) { + _emberMetal.run(App, 'destroy'); + App = null; + } + } + + QUnit.module('Test - registerHelper/unregisterHelper', { + teardown: function () { + _emberTestingTest.default.adapter = originalAdapter; + destroyApp(); + } + }); + + QUnit.test('Helper gets registered', function () { + expect(2); + + registerHelper(); + setupApp(); + + ok(App.testHelpers.boot); + ok(helperContainer.boot); + }); + + QUnit.test('Helper is ran when called', function (assert) { + var done = assert.async(); + assert.expect(1); + + registerHelper(); + setupApp(); + + App.testHelpers.boot().then(function () { + assert.ok(appBooted); + }).finally(done); + }); + + QUnit.test('Helper can be unregistered', function () { + expect(4); + + registerHelper(); + setupApp(); + + ok(App.testHelpers.boot); + ok(helperContainer.boot); + + unregisterHelper(); + + setupApp(); + + ok(!App.testHelpers.boot, 'once unregistered the helper is not added to App.testHelpers'); + ok(!helperContainer.boot, 'once unregistered the helper is not added to the helperContainer'); + }); +}); +enifed('ember-testing/tests/helper_registration_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/tests'); + test('ember-testing/tests/helper_registration_test.js should pass jscs', function () { + ok(true, 'ember-testing/tests/helper_registration_test.js should pass jscs.'); + }); +}); +enifed('ember-testing/tests/helper_registration_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/tests'); + QUnit.test('ember-testing/tests/helper_registration_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/tests/helper_registration_test.js should pass jshint.'); + }); +}); +enifed('ember-testing/tests/helpers_test', ['exports', 'ember-routing', 'ember-runtime', 'ember-metal', 'ember-views', 'ember-glimmer', 'ember-testing/test', 'ember-testing/helpers', 'ember-testing/initializers', 'ember-testing/setup_for_testing', 'ember-application', 'ember-template-compiler', 'ember-testing/test/pending_requests', 'ember-testing/test/adapter', 'ember-testing/test/waiters'], function (exports, _emberRouting, _emberRuntime, _emberMetal, _emberViews, _emberGlimmer, _emberTestingTest, _emberTestingHelpers, _emberTestingInitializers, _emberTestingSetup_for_testing, _emberApplication, _emberTemplateCompiler, _emberTestingTestPending_requests, _emberTestingTestAdapter, _emberTestingTestWaiters) { + 'use strict'; + + var App; + var originalAdapter = _emberTestingTestAdapter.getAdapter(); + + function cleanup() { + // Teardown setupForTesting + + _emberTestingTestAdapter.setAdapter(originalAdapter); + _emberMetal.run(function () { + _emberViews.jQuery(document).off('ajaxSend'); + _emberViews.jQuery(document).off('ajaxComplete'); + }); + _emberTestingTestPending_requests.clearPendingRequests(); + // Test.waiters = null; + + // Other cleanup + + if (App) { + _emberMetal.run(App, App.destroy); + App.removeTestHelpers(); + App = null; + } + + _emberGlimmer.setTemplates({}); + } + + function assertHelpers(application, helperContainer, expected) { + if (!helperContainer) { + helperContainer = window; + } + if (expected === undefined) { + expected = true; + } + + function checkHelperPresent(helper, expected) { + var presentInHelperContainer = !!helperContainer[helper]; + var presentInTestHelpers = !!application.testHelpers[helper]; + + ok(presentInHelperContainer === expected, 'Expected \'' + helper + '\' to be present in the helper container (defaults to window).'); + ok(presentInTestHelpers === expected, 'Expected \'' + helper + '\' to be present in App.testHelpers.'); + } + + checkHelperPresent('visit', expected); + checkHelperPresent('click', expected); + checkHelperPresent('keyEvent', expected); + checkHelperPresent('fillIn', expected); + checkHelperPresent('wait', expected); + checkHelperPresent('triggerEvent', expected); + } + + function assertNoHelpers(application, helperContainer) { + assertHelpers(application, helperContainer, false); + } + + function currentRouteName(app) { + return app.testHelpers.currentRouteName(); + } + + function currentPath(app) { + return app.testHelpers.currentPath(); + } + + function currentURL(app) { + return app.testHelpers.currentURL(); + } + + function setupApp() { + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.setupForTesting(); + + App.injectTestHelpers(); + }); + } + + QUnit.module('ember-testing: Helper setup', { + setup: function () { + cleanup(); + }, + teardown: function () { + cleanup(); + } + }); + + function registerHelper() { + _emberTestingTest.default.registerHelper('LeakyMcLeakLeak', function (app) {}); + } + + QUnit.test('Ember.Application#injectTestHelpers/#removeTestHelpers', function () { + App = _emberMetal.run(_emberApplication.Application, _emberApplication.Application.create); + assertNoHelpers(App); + + registerHelper(); + + App.injectTestHelpers(); + assertHelpers(App); + ok(_emberTestingTest.default.Promise.prototype.LeakyMcLeakLeak, 'helper in question SHOULD be present'); + + App.removeTestHelpers(); + assertNoHelpers(App); + + equal(_emberTestingTest.default.Promise.prototype.LeakyMcLeakLeak, undefined, 'should NOT leak test promise extensions'); + }); + + QUnit.test('Ember.Application#setupForTesting', function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.setupForTesting(); + }); + + equal(App.__container__.lookup('router:main').location, 'none'); + }); + + QUnit.test('Ember.Application.setupForTesting sets the application to `testing`.', function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.setupForTesting(); + }); + + equal(App.testing, true, 'Application instance is set to testing.'); + }); + + QUnit.test('Ember.Application.setupForTesting leaves the system in a deferred state.', function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.setupForTesting(); + }); + + equal(App._readinessDeferrals, 1, 'App is in deferred state after setupForTesting.'); + }); + + QUnit.test('App.reset() after Application.setupForTesting leaves the system in a deferred state.', function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.setupForTesting(); + }); + + equal(App._readinessDeferrals, 1, 'App is in deferred state after setupForTesting.'); + + App.reset(); + equal(App._readinessDeferrals, 1, 'App is in deferred state after setupForTesting.'); + }); + + QUnit.test('Ember.Application#setupForTesting attaches ajax listeners', function () { + var documentEvents; + + documentEvents = _emberViews.jQuery._data(document, 'events'); + + if (!documentEvents) { + documentEvents = {}; + } + + ok(documentEvents['ajaxSend'] === undefined, 'there are no ajaxSend listers setup prior to calling injectTestHelpers'); + ok(documentEvents['ajaxComplete'] === undefined, 'there are no ajaxComplete listers setup prior to calling injectTestHelpers'); + + _emberMetal.run(function () { + _emberTestingSetup_for_testing.default(); + }); + + documentEvents = _emberViews.jQuery._data(document, 'events'); + + equal(documentEvents['ajaxSend'].length, 1, 'calling injectTestHelpers registers an ajaxSend handler'); + equal(documentEvents['ajaxComplete'].length, 1, 'calling injectTestHelpers registers an ajaxComplete handler'); + }); + + QUnit.test('Ember.Application#setupForTesting attaches ajax listeners only once', function () { + var documentEvents; + + documentEvents = _emberViews.jQuery._data(document, 'events'); + + if (!documentEvents) { + documentEvents = {}; + } + + ok(documentEvents['ajaxSend'] === undefined, 'there are no ajaxSend listeners setup prior to calling injectTestHelpers'); + ok(documentEvents['ajaxComplete'] === undefined, 'there are no ajaxComplete listeners setup prior to calling injectTestHelpers'); + + _emberMetal.run(function () { + _emberTestingSetup_for_testing.default(); + }); + _emberMetal.run(function () { + _emberTestingSetup_for_testing.default(); + }); + + documentEvents = _emberViews.jQuery._data(document, 'events'); + + equal(documentEvents['ajaxSend'].length, 1, 'calling injectTestHelpers registers an ajaxSend handler'); + equal(documentEvents['ajaxComplete'].length, 1, 'calling injectTestHelpers registers an ajaxComplete handler'); + }); + + QUnit.test('Ember.Application#injectTestHelpers calls callbacks registered with onInjectHelpers', function () { + var injected = 0; + + _emberTestingTest.default.onInjectHelpers(function () { + injected++; + }); + + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.setupForTesting(); + }); + + equal(injected, 0, 'onInjectHelpers are not called before injectTestHelpers'); + + App.injectTestHelpers(); + + equal(injected, 1, 'onInjectHelpers are called after injectTestHelpers'); + }); + + QUnit.test('Ember.Application#injectTestHelpers adds helpers to provided object.', function () { + var helpers = {}; + + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.setupForTesting(); + }); + + App.injectTestHelpers(helpers); + assertHelpers(App, helpers); + + App.removeTestHelpers(); + assertNoHelpers(App, helpers); + }); + + QUnit.test('Ember.Application#removeTestHelpers resets the helperContainer\'s original values', function () { + var helpers = { visit: 'snazzleflabber' }; + + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.setupForTesting(); + }); + + App.injectTestHelpers(helpers); + + ok(helpers.visit !== 'snazzleflabber', 'helper added to container'); + App.removeTestHelpers(); + + ok(helpers.visit === 'snazzleflabber', 'original value added back to container'); + }); + + QUnit.module('ember-testing: Helper methods', { + setup: function () { + setupApp(); + }, + teardown: function () { + cleanup(); + } + }); + + QUnit.test('`wait` respects registerWaiters', function (assert) { + assert.expect(3); + + var done = assert.async(); + + var counter = 0; + function waiter() { + return ++counter > 2; + } + + var other = 0; + function otherWaiter() { + return ++other > 2; + } + + _emberMetal.run(App, App.advanceReadiness); + _emberTestingTestWaiters.registerWaiter(waiter); + _emberTestingTestWaiters.registerWaiter(otherWaiter); + + App.testHelpers.wait().then(function () { + equal(waiter(), true, 'should not resolve until our waiter is ready'); + _emberTestingTestWaiters.unregisterWaiter(waiter); + counter = 0; + return App.testHelpers.wait(); + }).then(function () { + equal(counter, 0, 'unregistered waiter was not checked'); + equal(otherWaiter(), true, 'other waiter is still registered'); + }).finally(function () { + _emberTestingTestWaiters.unregisterWaiter(otherWaiter); + done(); + }); + }); + + QUnit.test('`visit` advances readiness.', function () { + expect(2); + + equal(App._readinessDeferrals, 1, 'App is in deferred state after setupForTesting.'); + + return App.testHelpers.visit('/').then(function () { + equal(App._readinessDeferrals, 0, 'App\'s readiness was advanced by visit.'); + }); + }); + + QUnit.test('`wait` helper can be passed a resolution value', function () { + expect(4); + + var promise, wait; + + promise = new _emberRuntime.RSVP.Promise(function (resolve) { + _emberMetal.run(null, resolve, 'promise'); + }); + + _emberMetal.run(App, App.advanceReadiness); + + wait = App.testHelpers.wait; + + return wait('text').then(function (val) { + equal(val, 'text', 'can resolve to a string'); + return wait(1); + }).then(function (val) { + equal(val, 1, 'can resolve to an integer'); + return wait({ age: 10 }); + }).then(function (val) { + deepEqual(val, { age: 10 }, 'can resolve to an object'); + return wait(promise); + }).then(function (val) { + equal(val, 'promise', 'can resolve to a promise resolution value'); + }); + }); + + QUnit.test('`click` triggers appropriate events in order', function () { + expect(5); + + var click, wait, events; + + App.IndexWrapperComponent = _emberGlimmer.Component.extend({ + classNames: 'index-wrapper', + + didInsertElement: function () { + this.$().on('mousedown focusin mouseup click', function (e) { + events.push(e.type); + }); + } + }); + + App.XCheckboxComponent = _emberGlimmer.Component.extend({ + tagName: 'input', + attributeBindings: ['type'], + type: 'checkbox', + click: function () { + events.push('click:' + this.get('checked')); + }, + change: function () { + events.push('change:' + this.get('checked')); + } + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#index-wrapper}}{{input type="text"}} {{x-checkbox type="checkbox"}} {{textarea}}
    {{/index-wrapper}}')); + + _emberMetal.run(App, App.advanceReadiness); + + click = App.testHelpers.click; + wait = App.testHelpers.wait; + + return wait().then(function () { + events = []; + return click('.index-wrapper'); + }).then(function () { + deepEqual(events, ['mousedown', 'mouseup', 'click'], 'fires events in order'); + }).then(function () { + events = []; + return click('.index-wrapper input[type=text]'); + }).then(function () { + deepEqual(events, ['mousedown', 'focusin', 'mouseup', 'click'], 'fires focus events on inputs'); + }).then(function () { + events = []; + return click('.index-wrapper textarea'); + }).then(function () { + deepEqual(events, ['mousedown', 'focusin', 'mouseup', 'click'], 'fires focus events on textareas'); + }).then(function () { + events = []; + return click('.index-wrapper div'); + }).then(function () { + deepEqual(events, ['mousedown', 'focusin', 'mouseup', 'click'], 'fires focus events on contenteditable'); + }).then(function () { + events = []; + return click('.index-wrapper input[type=checkbox]'); + }).then(function () { + // i.e. mousedown, mouseup, change:true, click, click:true + // Firefox differs so we can't assert the exact ordering here. + // See https://bugzilla.mozilla.org/show_bug.cgi?id=843554. + equal(events.length, 5, 'fires click and change on checkboxes'); + }); + }); + + QUnit.test('`click` triggers native events with simulated X/Y coordinates', function () { + expect(15); + + var click, wait, events; + + App.IndexWrapperComponent = _emberGlimmer.Component.extend({ + classNames: 'index-wrapper', + + didInsertElement: function () { + var pushEvent = function (e) { + return events.push(e); + }; + this.element.addEventListener('mousedown', pushEvent); + this.element.addEventListener('mouseup', pushEvent); + this.element.addEventListener('click', pushEvent); + } + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#index-wrapper}}some text{{/index-wrapper}}')); + + _emberMetal.run(App, App.advanceReadiness); + + click = App.testHelpers.click; + wait = App.testHelpers.wait; + + return wait().then(function () { + events = []; + return click('.index-wrapper'); + }).then(function () { + events.forEach(function (e) { + ok(e instanceof window.Event, 'The event is an instance of MouseEvent'); + ok(typeof e.screenX === 'number' && e.screenX > 0, 'screenX is correct'); + ok(typeof e.screenY === 'number' && e.screenY > 0, 'screenY is correct'); + ok(typeof e.clientX === 'number' && e.clientX > 0, 'clientX is correct'); + ok(typeof e.clientY === 'number' && e.clientY > 0, 'clientY is correct'); + }); + }); + }); + + QUnit.test('`triggerEvent` with mouseenter triggers native events with simulated X/Y coordinates', function () { + expect(5); + + var triggerEvent, wait, evt; + + App.IndexWrapperComponent = _emberGlimmer.Component.extend({ + classNames: 'index-wrapper', + + didInsertElement: function () { + this.element.addEventListener('mouseenter', function (e) { + return evt = e; + }); + } + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#index-wrapper}}some text{{/index-wrapper}}')); + + _emberMetal.run(App, App.advanceReadiness); + + triggerEvent = App.testHelpers.triggerEvent; + wait = App.testHelpers.wait; + + return wait().then(function () { + return triggerEvent('.index-wrapper', 'mouseenter'); + }).then(function () { + ok(evt instanceof window.Event, 'The event is an instance of MouseEvent'); + ok(typeof evt.screenX === 'number' && evt.screenX > 0, 'screenX is correct'); + ok(typeof evt.screenY === 'number' && evt.screenY > 0, 'screenY is correct'); + ok(typeof evt.clientX === 'number' && evt.clientX > 0, 'clientX is correct'); + ok(typeof evt.clientY === 'number' && evt.clientY > 0, 'clientY is correct'); + }); + }); + + QUnit.test('`wait` waits for outstanding timers', function () { + expect(1); + + var wait_done = false; + + _emberMetal.run(App, App.advanceReadiness); + + _emberMetal.run.later(this, function () { + wait_done = true; + }, 500); + + return App.testHelpers.wait().then(function () { + equal(wait_done, true, 'should wait for the timer to be fired.'); + }); + }); + + QUnit.test('`wait` respects registerWaiters with optional context', function () { + expect(3); + + var obj = { + counter: 0, + ready: function () { + return ++this.counter > 2; + } + }; + + var other = 0; + function otherWaiter() { + return ++other > 2; + } + + _emberMetal.run(App, App.advanceReadiness); + _emberTestingTestWaiters.registerWaiter(obj, obj.ready); + _emberTestingTestWaiters.registerWaiter(otherWaiter); + + return App.testHelpers.wait().then(function () { + equal(obj.ready(), true, 'should not resolve until our waiter is ready'); + _emberTestingTestWaiters.unregisterWaiter(obj, obj.ready); + obj.counter = 0; + return App.testHelpers.wait(); + }).then(function () { + equal(obj.counter, 0, 'the unregistered waiter should still be at 0'); + equal(otherWaiter(), true, 'other waiter should still be registered'); + }).finally(function () { + _emberTestingTestWaiters.unregisterWaiter(otherWaiter); + }); + }); + + QUnit.test('`wait` does not error if routing has not begun', function () { + expect(1); + + return App.testHelpers.wait().then(function () { + ok(true, 'should not error without `visit`'); + }); + }); + + QUnit.test('`triggerEvent accepts an optional options hash without context', function () { + expect(3); + + var triggerEvent, wait, event; + + App.IndexWrapperComponent = _emberGlimmer.Component.extend({ + didInsertElement: function () { + this.$('.input').on('keydown change', function (e) { + event = e; + }); + } + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{index-wrapper}}')); + _emberGlimmer.setTemplate('components/index-wrapper', _emberTemplateCompiler.compile('{{input type="text" id="scope" class="input"}}')); + + _emberMetal.run(App, App.advanceReadiness); + + triggerEvent = App.testHelpers.triggerEvent; + wait = App.testHelpers.wait; + + return wait().then(function () { + return triggerEvent('.input', 'keydown', { keyCode: 13 }); + }).then(function () { + equal(event.keyCode, 13, 'options were passed'); + equal(event.type, 'keydown', 'correct event was triggered'); + equal(event.target.getAttribute('id'), 'scope', 'triggered on the correct element'); + }); + }); + + QUnit.test('`triggerEvent can limit searching for a selector to a scope', function () { + expect(2); + + var triggerEvent, wait, event; + + App.IndexWrapperComponent = _emberGlimmer.Component.extend({ + + didInsertElement: function () { + this.$('.input').on('blur change', function (e) { + event = e; + }); + } + }); + + _emberGlimmer.setTemplate('components/index-wrapper', _emberTemplateCompiler.compile('{{input type="text" id="outside-scope" class="input"}}
    {{input type="text" id="inside-scope" class="input"}}
    ')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{index-wrapper}}')); + + _emberMetal.run(App, App.advanceReadiness); + + triggerEvent = App.testHelpers.triggerEvent; + wait = App.testHelpers.wait; + + return wait().then(function () { + return triggerEvent('.input', '#limited', 'blur'); + }).then(function () { + equal(event.type, 'blur', 'correct event was triggered'); + equal(event.target.getAttribute('id'), 'inside-scope', 'triggered on the correct element'); + }); + }); + + QUnit.test('`triggerEvent` can be used to trigger arbitrary events', function () { + expect(2); + + var triggerEvent, wait, event; + + App.IndexWrapperComponent = _emberGlimmer.Component.extend({ + didInsertElement: function () { + this.$('#foo').on('blur change', function (e) { + event = e; + }); + } + }); + + _emberGlimmer.setTemplate('components/index-wrapper', _emberTemplateCompiler.compile('{{input type="text" id="foo"}}')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{index-wrapper}}')); + + _emberMetal.run(App, App.advanceReadiness); + + triggerEvent = App.testHelpers.triggerEvent; + wait = App.testHelpers.wait; + + return wait().then(function () { + return triggerEvent('#foo', 'blur'); + }).then(function () { + equal(event.type, 'blur', 'correct event was triggered'); + equal(event.target.getAttribute('id'), 'foo', 'triggered on the correct element'); + }); + }); + + QUnit.test('`fillIn` takes context into consideration', function () { + expect(2); + var fillIn, find, visit, andThen, wait; + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('
    {{input type="text" id="first" class="current"}}
    {{input type="text" id="second" class="current"}}')); + + _emberMetal.run(App, App.advanceReadiness); + + fillIn = App.testHelpers.fillIn; + find = App.testHelpers.find; + visit = App.testHelpers.visit; + andThen = App.testHelpers.andThen; + wait = App.testHelpers.wait; + + visit('/'); + fillIn('.current', '#parent', 'current value'); + + return andThen(function () { + equal(find('#first').val(), 'current value'); + equal(find('#second').val(), ''); + }); + }); + + QUnit.test('`fillIn` focuses on the element', function () { + expect(2); + var fillIn, find, visit, andThen, wait; + + App.ApplicationRoute = _emberRouting.Route.extend({ + actions: { + wasFocused: function () { + ok(true, 'focusIn event was triggered'); + } + } + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('
    {{input type="text" id="first" focus-in="wasFocused"}}
    ')); + + _emberMetal.run(App, App.advanceReadiness); + + fillIn = App.testHelpers.fillIn; + find = App.testHelpers.find; + visit = App.testHelpers.visit; + andThen = App.testHelpers.andThen; + wait = App.testHelpers.wait; + + visit('/'); + fillIn('#first', 'current value'); + andThen(function () { + equal(find('#first').val(), 'current value'); + }); + + return wait(); + }); + + QUnit.test('`fillIn` fires `input` and `change` events in the proper order', function () { + expect(1); + + var fillIn, visit, andThen, wait; + var events = []; + App.IndexController = _emberRuntime.Controller.extend({ + actions: { + oninputHandler: function (e) { + events.push(e.type); + }, + onchangeHandler: function (e) { + events.push(e.type); + } + } + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('')); + + _emberMetal.run(App, App.advanceReadiness); + + fillIn = App.testHelpers.fillIn; + visit = App.testHelpers.visit; + andThen = App.testHelpers.andThen; + wait = App.testHelpers.wait; + + visit('/'); + fillIn('#first', 'current value'); + andThen(function () { + deepEqual(events, ['input', 'change'], '`input` and `change` events are fired in the proper order'); + }); + + return wait(); + }); + + QUnit.test('`fillIn` only sets the value in the first matched element', function () { + var fillIn = undefined, + find = undefined, + visit = undefined, + andThen = undefined, + wait = undefined; + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('')); + _emberMetal.run(App, App.advanceReadiness); + + fillIn = App.testHelpers.fillIn; + find = App.testHelpers.find; + visit = App.testHelpers.visit; + andThen = App.testHelpers.andThen; + wait = App.testHelpers.wait; + + visit('/'); + fillIn('input.in-test', 'new value'); + andThen(function () { + equal(find('#first').val(), 'new value'); + equal(find('#second').val(), ''); + }); + + return wait(); + }); + + QUnit.test('`triggerEvent accepts an optional options hash and context', function () { + expect(3); + + var triggerEvent, wait, event; + + App.IndexWrapperComponent = _emberGlimmer.Component.extend({ + didInsertElement: function () { + this.$('.input').on('keydown change', function (e) { + event = e; + }); + } + }); + + _emberGlimmer.setTemplate('components/index-wrapper', _emberTemplateCompiler.compile('{{input type="text" id="outside-scope" class="input"}}
    {{input type="text" id="inside-scope" class="input"}}
    ')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{index-wrapper}}')); + + _emberMetal.run(App, App.advanceReadiness); + + triggerEvent = App.testHelpers.triggerEvent; + wait = App.testHelpers.wait; + + return wait().then(function () { + return triggerEvent('.input', '#limited', 'keydown', { keyCode: 13 }); + }).then(function () { + equal(event.keyCode, 13, 'options were passed'); + equal(event.type, 'keydown', 'correct event was triggered'); + equal(event.target.getAttribute('id'), 'inside-scope', 'triggered on the correct element'); + }); + }); + + QUnit.module('ember-testing debugging helpers', { + setup: function () { + setupApp(); + + _emberMetal.run(function () { + App.Router = _emberRouting.Router.extend({ + location: 'none' + }); + }); + + _emberMetal.run(App, 'advanceReadiness'); + }, + + teardown: function () { + cleanup(); + } + }); + + QUnit.test('pauseTest pauses', function () { + expect(1); + + function fakeAdapterAsyncStart() { + ok(true, 'Async start should be called after waiting for other helpers'); + } + + App.testHelpers.andThen(function () { + _emberTestingTest.default.adapter.asyncStart = fakeAdapterAsyncStart; + }); + + App.testHelpers.pauseTest(); + }); + + if (false) { + QUnit.test('resumeTest resumes paused tests', function () { + expect(1); + + var pausePromise = App.testHelpers.pauseTest(); + setTimeout(function () { + return App.testHelpers.resumeTest(); + }, 0); + + return pausePromise.then(function () { + return ok(true, 'pauseTest promise was resolved'); + }); + }); + + QUnit.test('resumeTest throws if nothing to resume', function () { + expect(1); + + throws(function () { + return App.testHelpers.resumeTest(); + }, /Testing has not been paused. There is nothing to resume./); + }); + } + + QUnit.module('ember-testing routing helpers', { + setup: function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.setupForTesting(); + + App.injectTestHelpers(); + + App.Router = _emberRouting.Router.extend({ + location: 'none' + }); + + App.Router.map(function () { + this.route('posts', { resetNamespace: true }, function () { + this.route('new'); + }); + }); + }); + + _emberMetal.run(App, 'advanceReadiness'); + }, + + teardown: function () { + cleanup(); + } + }); + + QUnit.test('currentRouteName for \'/\'', function () { + expect(3); + + return App.testHelpers.visit('/').then(function () { + equal(App.testHelpers.currentRouteName(), 'index', 'should equal \'index\'.'); + equal(App.testHelpers.currentPath(), 'index', 'should equal \'index\'.'); + equal(App.testHelpers.currentURL(), '/', 'should equal \'/\'.'); + }); + }); + + QUnit.test('currentRouteName for \'/posts\'', function () { + expect(3); + + return App.testHelpers.visit('/posts').then(function () { + equal(App.testHelpers.currentRouteName(), 'posts.index', 'should equal \'posts.index\'.'); + equal(App.testHelpers.currentPath(), 'posts.index', 'should equal \'posts.index\'.'); + equal(App.testHelpers.currentURL(), '/posts', 'should equal \'/posts\'.'); + }); + }); + + QUnit.test('currentRouteName for \'/posts/new\'', function () { + expect(3); + + return App.testHelpers.visit('/posts/new').then(function () { + equal(App.testHelpers.currentRouteName(), 'posts.new', 'should equal \'posts.new\'.'); + equal(App.testHelpers.currentPath(), 'posts.new', 'should equal \'posts.new\'.'); + equal(App.testHelpers.currentURL(), '/posts/new', 'should equal \'/posts/new\'.'); + }); + }); + + QUnit.module('ember-testing pendingRequests', { + setup: function () { + setupApp(); + }, + + teardown: function () { + cleanup(); + } + }); + + QUnit.test('pendingRequests is maintained for ajaxSend and ajaxComplete events', function () { + equal(_emberTestingTestPending_requests.pendingRequests(), 0); + var xhr = { some: 'xhr' }; + _emberViews.jQuery(document).trigger('ajaxSend', xhr); + equal(_emberTestingTestPending_requests.pendingRequests(), 1, 'Ember.Test.pendingRequests was incremented'); + _emberViews.jQuery(document).trigger('ajaxComplete', xhr); + equal(_emberTestingTestPending_requests.pendingRequests(), 0, 'Ember.Test.pendingRequests was decremented'); + }); + + QUnit.test('pendingRequests is ignores ajaxComplete events from past setupForTesting calls', function () { + equal(_emberTestingTestPending_requests.pendingRequests(), 0); + var xhr = { some: 'xhr' }; + _emberViews.jQuery(document).trigger('ajaxSend', xhr); + equal(_emberTestingTestPending_requests.pendingRequests(), 1, 'Ember.Test.pendingRequests was incremented'); + + _emberMetal.run(function () { + _emberTestingSetup_for_testing.default(); + }); + equal(_emberTestingTestPending_requests.pendingRequests(), 0, 'Ember.Test.pendingRequests was reset'); + + var altXhr = { some: 'more xhr' }; + _emberViews.jQuery(document).trigger('ajaxSend', altXhr); + equal(_emberTestingTestPending_requests.pendingRequests(), 1, 'Ember.Test.pendingRequests was incremented'); + _emberViews.jQuery(document).trigger('ajaxComplete', xhr); + equal(_emberTestingTestPending_requests.pendingRequests(), 1, 'Ember.Test.pendingRequests is not impressed with your unexpected complete'); + }); + + QUnit.test('pendingRequests is reset by setupForTesting', function () { + _emberTestingTestPending_requests.incrementPendingRequests(); + _emberMetal.run(function () { + _emberTestingSetup_for_testing.default(); + }); + equal(_emberTestingTestPending_requests.pendingRequests(), 0, 'pendingRequests is reset'); + }); + + QUnit.module('ember-testing async router', { + setup: function () { + cleanup(); + + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.Router = _emberRouting.Router.extend({ + location: 'none' + }); + + App.Router.map(function () { + this.route('user', { resetNamespace: true }, function () { + this.route('profile'); + this.route('edit'); + }); + }); + + App.UserRoute = _emberRouting.Route.extend({ + model: function () { + return resolveLater(); + } + }); + + App.UserProfileRoute = _emberRouting.Route.extend({ + beforeModel: function () { + var self = this; + return resolveLater().then(function () { + self.transitionTo('user.edit'); + }); + } + }); + + // Emulates a long-running unscheduled async operation. + function resolveLater() { + var promise; + + _emberMetal.run(function () { + promise = new _emberRuntime.RSVP.Promise(function (resolve) { + // The wait() helper has a 10ms tick. We should resolve() after at least one tick + // to test whether wait() held off while the async router was still loading. 20ms + // should be enough. + setTimeout(function () { + _emberMetal.run(function () { + resolve(_emberRuntime.Object.create({ firstName: 'Tom' })); + }); + }, 20); + }); + }); + + return promise; + } + + App.setupForTesting(); + }); + + App.injectTestHelpers(); + _emberMetal.run(App, 'advanceReadiness'); + }, + + teardown: function () { + cleanup(); + } + }); + + QUnit.test('currentRouteName for \'/user\'', function () { + expect(4); + + return App.testHelpers.visit('/user').then(function () { + equal(currentRouteName(App), 'user.index', 'should equal \'user.index\'.'); + equal(currentPath(App), 'user.index', 'should equal \'user.index\'.'); + equal(currentURL(App), '/user', 'should equal \'/user\'.'); + equal(App.__container__.lookup('route:user').get('controller.model.firstName'), 'Tom', 'should equal \'Tom\'.'); + }); + }); + + QUnit.test('currentRouteName for \'/user/profile\'', function () { + expect(4); + + return App.testHelpers.visit('/user/profile').then(function () { + equal(currentRouteName(App), 'user.edit', 'should equal \'user.edit\'.'); + equal(currentPath(App), 'user.edit', 'should equal \'user.edit\'.'); + equal(currentURL(App), '/user/edit', 'should equal \'/user/edit\'.'); + equal(App.__container__.lookup('route:user').get('controller.model.firstName'), 'Tom', 'should equal \'Tom\'.'); + }); + }); + + var originalVisitHelper, originalFindHelper, originalWaitHelper; + + QUnit.module('can override built-in helpers', { + setup: function () { + originalVisitHelper = _emberTestingTest.default._helpers.visit; + originalFindHelper = _emberTestingTest.default._helpers.find; + originalWaitHelper = _emberTestingTest.default._helpers.wait; + + _emberViews.jQuery('').appendTo('head'); + _emberViews.jQuery('
    ').appendTo('body'); + _emberMetal.run(function () { + App = _emberApplication.Application.create({ + rootElement: '#ember-testing' + }); + + App.setupForTesting(); + }); + }, + + teardown: function () { + cleanup(); + + _emberTestingTest.default._helpers.visit = originalVisitHelper; + _emberTestingTest.default._helpers.find = originalFindHelper; + _emberTestingTest.default._helpers.wait = originalWaitHelper; + } + }); + + QUnit.test('can override visit helper', function () { + expect(1); + + _emberTestingTest.default.registerHelper('visit', function () { + ok(true, 'custom visit helper was called'); + }); + + App.injectTestHelpers(); + + return App.testHelpers.visit(); + }); + + QUnit.test('can override find helper', function () { + expect(1); + + _emberTestingTest.default.registerHelper('find', function () { + ok(true, 'custom find helper was called'); + + return ['not empty array']; + }); + + App.injectTestHelpers(); + + return App.testHelpers.findWithAssert('.who-cares'); + }); +}); +// ensure that the helpers are loaded +// ensure the initializer is setup +enifed('ember-testing/tests/helpers_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/tests'); + test('ember-testing/tests/helpers_test.js should pass jscs', function () { + ok(true, 'ember-testing/tests/helpers_test.js should pass jscs.'); + }); +}); +enifed('ember-testing/tests/helpers_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/tests'); + QUnit.test('ember-testing/tests/helpers_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/tests/helpers_test.js should pass jshint.'); + }); +}); +enifed('ember-testing/tests/integration_test', ['exports', 'ember-metal', 'ember-runtime', 'ember-views', 'ember-testing/test', 'ember-routing', 'ember-application', 'ember-template-compiler', 'ember-glimmer'], function (exports, _emberMetal, _emberRuntime, _emberViews, _emberTestingTest, _emberRouting, _emberApplication, _emberTemplateCompiler, _emberGlimmer) { + 'use strict'; + + var App, find, visit; + var originalAdapter = _emberTestingTest.default.adapter; + + QUnit.module('ember-testing Integration', { + setup: function () { + _emberViews.jQuery('
    ').appendTo('body'); + _emberMetal.run(function () { + _emberGlimmer.setTemplate('people', _emberTemplateCompiler.compile('
    {{#each model as |person|}}
    {{person.firstName}}
    {{/each}}
    ')); + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet}}')); + + App = _emberApplication.Application.create({ + rootElement: '#ember-testing' + }); + + App.Router.map(function () { + this.route('people', { path: '/' }); + }); + + App.PeopleRoute = _emberRouting.Route.extend({ + model: function () { + return App.Person.find(); + } + }); + + App.PeopleController = _emberRuntime.Controller.extend({}); + + App.Person = _emberRuntime.Object.extend({ + firstName: '' + }); + + App.Person.reopenClass({ + find: function () { + return _emberRuntime.A(); + } + }); + + App.setupForTesting(); + }); + + _emberMetal.run(function () { + App.reset(); + }); + + App.injectTestHelpers(); + + find = window.find; + visit = window.visit; + }, + + teardown: function () { + App.removeTestHelpers(); + _emberGlimmer.setTemplates({}); + _emberViews.jQuery('#ember-testing-container, #ember-testing').remove(); + _emberMetal.run(App, App.destroy); + App = null; + _emberTestingTest.default.adapter = originalAdapter; + } + }); + + QUnit.test('template is bound to empty array of people', function () { + App.Person.find = function () { + return _emberRuntime.A(); + }; + _emberMetal.run(App, 'advanceReadiness'); + visit('/').then(function () { + var rows = find('.name').length; + equal(rows, 0, 'successfully stubbed an empty array of people'); + }); + }); + + QUnit.test('template is bound to array of 2 people', function () { + App.Person.find = function () { + var people = _emberRuntime.A(); + var first = App.Person.create({ firstName: 'x' }); + var last = App.Person.create({ firstName: 'y' }); + _emberMetal.run(people, people.pushObject, first); + _emberMetal.run(people, people.pushObject, last); + return people; + }; + _emberMetal.run(App, 'advanceReadiness'); + visit('/').then(function () { + var rows = find('.name').length; + equal(rows, 2, 'successfully stubbed a non empty array of people'); + }); + }); + + QUnit.test('template is again bound to empty array of people', function () { + App.Person.find = function () { + return _emberRuntime.A(); + }; + _emberMetal.run(App, 'advanceReadiness'); + visit('/').then(function () { + var rows = find('.name').length; + equal(rows, 0, 'successfully stubbed another empty array of people'); + }); + }); + + QUnit.test('`visit` can be called without advancedReadiness.', function () { + App.Person.find = function () { + return _emberRuntime.A(); + }; + + visit('/').then(function () { + var rows = find('.name').length; + equal(rows, 0, 'stubbed an empty array of people without calling advancedReadiness.'); + }); + }); +}); +enifed('ember-testing/tests/integration_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/tests'); + test('ember-testing/tests/integration_test.js should pass jscs', function () { + ok(true, 'ember-testing/tests/integration_test.js should pass jscs.'); + }); +}); +enifed('ember-testing/tests/integration_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/tests'); + QUnit.test('ember-testing/tests/integration_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/tests/integration_test.js should pass jshint.'); + }); +}); +enifed('ember-testing/tests/reexports_test', ['exports', 'ember', 'internal-test-helpers'], function (exports, _ember, _internalTestHelpers) { + 'use strict'; + + QUnit.module('ember-testing reexports'); + + [ + // ember-testing + ['Test', 'ember-testing'], ['Test.Adapter', 'ember-testing', 'Adapter'], ['Test.QUnitAdapter', 'ember-testing', 'QUnitAdapter'], ['setupForTesting', 'ember-testing']].forEach(function (reexport) { + var path = reexport[0]; + var moduleId = reexport[1]; + var exportName = reexport[2]; + + // default path === exportName if none present + if (!exportName) { + exportName = path; + } + + QUnit.test('Ember.' + path + ' exports correctly', function (assert) { + _internalTestHelpers.confirmExport(_ember.default, assert, path, moduleId, exportName); + }); + }); +}); +enifed('ember-testing/tests/reexports_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/tests'); + test('ember-testing/tests/reexports_test.js should pass jscs', function () { + ok(true, 'ember-testing/tests/reexports_test.js should pass jscs.'); + }); +}); +enifed('ember-testing/tests/reexports_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/tests'); + QUnit.test('ember-testing/tests/reexports_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/tests/reexports_test.js should pass jshint.'); + }); +}); +enifed('ember-testing/tests/simple_setup', ['exports', 'ember-metal', 'ember-views'], function (exports, _emberMetal, _emberViews) { + 'use strict'; + + var App; + + QUnit.module('Simple Testing Setup', { + teardown: function () { + if (App) { + App.removeTestHelpers(); + _emberViews.jQuery('#ember-testing-container, #ember-testing').remove(); + _emberMetal.run(App, 'destroy'); + App = null; + } + } + }); +}); +enifed('ember-testing/tests/simple_setup.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/tests'); + test('ember-testing/tests/simple_setup.js should pass jscs', function () { + ok(true, 'ember-testing/tests/simple_setup.js should pass jscs.'); + }); +}); +enifed('ember-testing/tests/simple_setup.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/tests'); + QUnit.test('ember-testing/tests/simple_setup.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/tests/simple_setup.js should pass jshint.'); + }); +}); +enifed('ember-testing/tests/test/waiters-test', ['exports', 'ember-metal', 'ember-testing/test/waiters'], function (exports, _emberMetal, _emberTestingTestWaiters) { + 'use strict'; + + var Waiters = (function () { + function Waiters() { + babelHelpers.classCallCheck(this, Waiters); + + this._waiters = []; + } + + Waiters.prototype.add = function add() { + this._waiters.push([].concat(babelHelpers.slice.call(arguments))); + }; + + Waiters.prototype.register = function register() { + this.forEach(function () { + _emberTestingTestWaiters.registerWaiter.apply(undefined, arguments); + }); + }; + + Waiters.prototype.unregister = function unregister() { + this.forEach(function () { + _emberTestingTestWaiters.unregisterWaiter.apply(undefined, arguments); + }); + }; + + Waiters.prototype.forEach = function forEach(callback) { + for (var i = 0; i < this._waiters.length; i++) { + var args = this._waiters[i]; + + callback.apply(undefined, args); + } + }; + + Waiters.prototype.check = function check() { + this.register(); + var result = _emberTestingTestWaiters.checkWaiters(); + this.unregister(); + + return result; + }; + + return Waiters; + })(); + + QUnit.module('ember-testing: waiters', { + setup: function () { + this.waiters = new Waiters(); + }, + + teardown: function () { + this.waiters.unregister(); + } + }); + + QUnit.test('registering a waiter', function (assert) { + assert.expect(2); + + var obj = { foo: true }; + + this.waiters.add(obj, function () { + assert.ok(this.foo, 'has proper `this` context'); + return true; + }); + + this.waiters.add(function () { + assert.ok(true, 'is called'); + return true; + }); + + this.waiters.check(); + }); + + QUnit.test('unregistering a waiter', function (assert) { + assert.expect(2); + + var obj = { foo: true }; + + this.waiters.add(obj, function () { + assert.ok(true, 'precond - waiter with context is registered'); + return true; + }); + + this.waiters.add(function () { + assert.ok(true, 'precond - waiter without context is registered'); + return true; + }); + + this.waiters.check(); + this.waiters.unregister(); + + _emberTestingTestWaiters.checkWaiters(); + }); + + QUnit.test('checkWaiters returns false if all waiters return true', function (assert) { + assert.expect(3); + + this.waiters.add(function () { + assert.ok(true, 'precond - waiter is registered'); + + return true; + }); + + this.waiters.add(function () { + assert.ok(true, 'precond - waiter is registered'); + + return true; + }); + + assert.notOk(this.waiters.check(), 'checkWaiters returns true if all waiters return true'); + }); + + QUnit.test('checkWaiters returns true if any waiters return false', function (assert) { + assert.expect(3); + + this.waiters.add(function () { + assert.ok(true, 'precond - waiter is registered'); + + return true; + }); + + this.waiters.add(function () { + assert.ok(true, 'precond - waiter is registered'); + + return false; + }); + + assert.ok(this.waiters.check(), 'checkWaiters returns false if any waiters return false'); + }); + + QUnit.test('checkWaiters short circuits after first falsey waiter', function (assert) { + assert.expect(2); + + this.waiters.add(function () { + assert.ok(true, 'precond - waiter is registered'); + + return false; + }); + + this.waiters.add(function () { + assert.notOk(true, 'waiter should not be called'); + }); + + assert.ok(this.waiters.check(), 'checkWaiters returns false if any waiters return false'); + }); + + QUnit.test('generateDeprecatedWaitersArray provides deprecated access to waiters array', function (assert) { + var waiter1 = function () {}; + var waiter2 = function () {}; + + this.waiters.add(waiter1); + this.waiters.add(waiter2); + + this.waiters.register(); + + var waiters = undefined; + if (true) { + expectDeprecation(function () { + waiters = _emberTestingTestWaiters.generateDeprecatedWaitersArray(); + }, /Usage of `Ember.Test.waiters` is deprecated/); + } else { + waiters = _emberTestingTestWaiters.generateDeprecatedWaitersArray(); + } + + assert.deepEqual(waiters, [[null, waiter1], [null, waiter2]]); + }); +}); +enifed('ember-testing/tests/test/waiters-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/tests/test'); + test('ember-testing/tests/test/waiters-test.js should pass jscs', function () { + ok(true, 'ember-testing/tests/test/waiters-test.js should pass jscs.'); + }); +}); +enifed('ember-testing/tests/test/waiters-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/tests/test'); + QUnit.test('ember-testing/tests/test/waiters-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/tests/test/waiters-test.js should pass jshint.'); + }); +}); +enifed('ember-utils/apply-str.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/apply-str.js should pass jscs', function () { + ok(true, 'ember-utils/apply-str.js should pass jscs.'); + }); +}); +enifed('ember-utils/apply-str.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/apply-str.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/apply-str.js should pass jshint.'); + }); +}); +enifed('ember-utils/assign.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/assign.js should pass jscs', function () { + ok(true, 'ember-utils/assign.js should pass jscs.'); + }); +}); +enifed('ember-utils/assign.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/assign.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/assign.js should pass jshint.'); + }); +}); +enifed('ember-utils/dictionary.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/dictionary.js should pass jscs', function () { + ok(true, 'ember-utils/dictionary.js should pass jscs.'); + }); +}); +enifed('ember-utils/dictionary.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/dictionary.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/dictionary.js should pass jshint.'); + }); +}); +enifed('ember-utils/empty-object.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/empty-object.js should pass jscs', function () { + ok(true, 'ember-utils/empty-object.js should pass jscs.'); + }); +}); +enifed('ember-utils/empty-object.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/empty-object.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/empty-object.js should pass jshint.'); + }); +}); +enifed('ember-utils/guid.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/guid.js should pass jscs', function () { + ok(true, 'ember-utils/guid.js should pass jscs.'); + }); +}); +enifed('ember-utils/guid.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/guid.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/guid.js should pass jshint.'); + }); +}); +enifed('ember-utils/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/index.js should pass jscs', function () { + ok(true, 'ember-utils/index.js should pass jscs.'); + }); +}); +enifed('ember-utils/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/index.js should pass jshint.'); + }); +}); +enifed('ember-utils/inspect.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/inspect.js should pass jscs', function () { + ok(true, 'ember-utils/inspect.js should pass jscs.'); + }); +}); +enifed('ember-utils/inspect.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/inspect.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/inspect.js should pass jshint.'); + }); +}); +enifed('ember-utils/intern.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/intern.js should pass jscs', function () { + ok(true, 'ember-utils/intern.js should pass jscs.'); + }); +}); +enifed('ember-utils/intern.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/intern.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/intern.js should pass jshint.'); + }); +}); +enifed('ember-utils/invoke.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/invoke.js should pass jscs', function () { + ok(true, 'ember-utils/invoke.js should pass jscs.'); + }); +}); +enifed('ember-utils/invoke.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/invoke.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/invoke.js should pass jshint.'); + }); +}); +enifed('ember-utils/lookup-descriptor.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/lookup-descriptor.js should pass jscs', function () { + ok(true, 'ember-utils/lookup-descriptor.js should pass jscs.'); + }); +}); +enifed('ember-utils/lookup-descriptor.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/lookup-descriptor.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/lookup-descriptor.js should pass jshint.'); + }); +}); +enifed('ember-utils/make-array.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/make-array.js should pass jscs', function () { + ok(true, 'ember-utils/make-array.js should pass jscs.'); + }); +}); +enifed('ember-utils/make-array.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/make-array.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/make-array.js should pass jshint.'); + }); +}); +enifed('ember-utils/owner.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/owner.js should pass jscs', function () { + ok(true, 'ember-utils/owner.js should pass jscs.'); + }); +}); +enifed('ember-utils/owner.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/owner.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/owner.js should pass jshint.'); + }); +}); +enifed('ember-utils/super.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/super.js should pass jscs', function () { + ok(true, 'ember-utils/super.js should pass jscs.'); + }); +}); +enifed('ember-utils/super.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/super.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/super.js should pass jshint.'); + }); +}); +enifed('ember-utils/symbol.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/symbol.js should pass jscs', function () { + ok(true, 'ember-utils/symbol.js should pass jscs.'); + }); +}); +enifed('ember-utils/symbol.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/symbol.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/symbol.js should pass jshint.'); + }); +}); +enifed('ember-utils/tests/assign_test', ['exports', 'ember-utils/assign'], function (exports, _emberUtilsAssign) { + 'use strict'; + + QUnit.module('Ember.assign'); + + QUnit.test('Ember.assign', function () { + var a = { a: 1 }; + var b = { b: 2 }; + var c = { c: 3 }; + var a2 = { a: 4 }; + + _emberUtilsAssign.default(a, b, c, a2); + + deepEqual(a, { a: 4, b: 2, c: 3 }); + deepEqual(b, { b: 2 }); + deepEqual(c, { c: 3 }); + deepEqual(a2, { a: 4 }); + }); +}); +enifed('ember-utils/tests/assign_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils/tests'); + test('ember-utils/tests/assign_test.js should pass jscs', function () { + ok(true, 'ember-utils/tests/assign_test.js should pass jscs.'); + }); +}); +enifed('ember-utils/tests/assign_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils/tests'); + QUnit.test('ember-utils/tests/assign_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/tests/assign_test.js should pass jshint.'); + }); +}); +enifed('ember-utils/tests/can_invoke_test', ['exports', 'ember-utils/index'], function (exports, _emberUtilsIndex) { + 'use strict'; + + var obj = undefined; + + QUnit.module('Ember.canInvoke', { + setup: function () { + obj = { + foobar: 'foobar', + aMethodThatExists: function () {} + }; + }, + + teardown: function () { + obj = undefined; + } + }); + + QUnit.test('should return false if the object doesn\'t exist', function () { + equal(_emberUtilsIndex.canInvoke(undefined, 'aMethodThatDoesNotExist'), false); + }); + + QUnit.test('should return true if the method exists on the object', function () { + equal(_emberUtilsIndex.canInvoke(obj, 'aMethodThatExists'), true); + }); + + QUnit.test('should return false if the method doesn\'t exist on the object', function () { + equal(_emberUtilsIndex.canInvoke(obj, 'aMethodThatDoesNotExist'), false); + }); + + QUnit.test('should return false if the property exists on the object but is a non-function', function () { + equal(_emberUtilsIndex.canInvoke(obj, 'foobar'), false); + }); +}); +enifed('ember-utils/tests/can_invoke_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils/tests'); + test('ember-utils/tests/can_invoke_test.js should pass jscs', function () { + ok(true, 'ember-utils/tests/can_invoke_test.js should pass jscs.'); + }); +}); +enifed('ember-utils/tests/can_invoke_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils/tests'); + QUnit.test('ember-utils/tests/can_invoke_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/tests/can_invoke_test.js should pass jshint.'); + }); +}); +enifed('ember-utils/tests/checkHasSuper_test', ['exports', 'ember-environment', 'ember-utils/index'], function (exports, _emberEnvironment, _emberUtilsIndex) { + 'use strict'; + + QUnit.module('checkHasSuper'); + + // Only run this test on browsers that we are certain should have function + // source available. This allows the test suite to continue to pass on other + // platforms that correctly (for them) fall back to the "always wrap" code. + if (_emberEnvironment.environment.isPhantom || _emberEnvironment.environment.isChrome || _emberEnvironment.environment.isFirefox) { + QUnit.test('does not super wrap needlessly [GH #12462]', function (assert) { + assert.notOk(_emberUtilsIndex.checkHasSuper(function () {}), 'empty function does not have super'); + }); + } +}); +enifed('ember-utils/tests/checkHasSuper_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils/tests'); + test('ember-utils/tests/checkHasSuper_test.js should pass jscs', function () { + ok(true, 'ember-utils/tests/checkHasSuper_test.js should pass jscs.'); + }); +}); +enifed('ember-utils/tests/checkHasSuper_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils/tests'); + QUnit.test('ember-utils/tests/checkHasSuper_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/tests/checkHasSuper_test.js should pass jshint.'); + }); +}); +enifed('ember-utils/tests/generate_guid_test', ['exports', 'ember-utils/index'], function (exports, _emberUtilsIndex) { + 'use strict'; + + QUnit.module('Ember.generateGuid'); + + QUnit.test('Prefix', function () { + var a = {}; + + ok(_emberUtilsIndex.generateGuid(a, 'tyrell').indexOf('tyrell') > -1, 'guid can be prefixed'); + }); +}); +enifed('ember-utils/tests/generate_guid_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils/tests'); + test('ember-utils/tests/generate_guid_test.js should pass jscs', function () { + ok(true, 'ember-utils/tests/generate_guid_test.js should pass jscs.'); + }); +}); +enifed('ember-utils/tests/generate_guid_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils/tests'); + QUnit.test('ember-utils/tests/generate_guid_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/tests/generate_guid_test.js should pass jshint.'); + }); +}); +enifed('ember-utils/tests/guid_for_test', ['exports', 'ember-utils/index'], function (exports, _emberUtilsIndex) { + 'use strict'; + + QUnit.module('guidFor'); + + function sameGuid(a, b, message) { + equal(_emberUtilsIndex.guidFor(a), _emberUtilsIndex.guidFor(b), message); + } + + function diffGuid(a, b, message) { + ok(_emberUtilsIndex.guidFor(a) !== _emberUtilsIndex.guidFor(b), message); + } + + function nanGuid(obj) { + var type = typeof obj; + ok(isNaN(parseInt(_emberUtilsIndex.guidFor(obj), 0)), 'guids for ' + type + 'don\'t parse to numbers'); + } + + QUnit.test('Object', function () { + var a = {}; + var b = {}; + + sameGuid(a, a, 'same object always yields same guid'); + diffGuid(a, b, 'different objects yield different guids'); + nanGuid(a); + }); + + QUnit.test('strings', function () { + var a = 'string A'; + var aprime = 'string A'; + var b = 'String B'; + + sameGuid(a, a, 'same string always yields same guid'); + sameGuid(a, aprime, 'identical strings always yield the same guid'); + diffGuid(a, b, 'different strings yield different guids'); + nanGuid(a); + }); + + QUnit.test('numbers', function () { + var a = 23; + var aprime = 23; + var b = 34; + + sameGuid(a, a, 'same numbers always yields same guid'); + sameGuid(a, aprime, 'identical numbers always yield the same guid'); + diffGuid(a, b, 'different numbers yield different guids'); + nanGuid(a); + }); + + QUnit.test('numbers', function () { + var a = true; + var aprime = true; + var b = false; + + sameGuid(a, a, 'same booleans always yields same guid'); + sameGuid(a, aprime, 'identical booleans always yield the same guid'); + diffGuid(a, b, 'different boolean yield different guids'); + nanGuid(a); + nanGuid(b); + }); + + QUnit.test('null and undefined', function () { + var a = null; + var aprime = null; + var b = undefined; + + sameGuid(a, a, 'null always returns the same guid'); + sameGuid(b, b, 'undefined always returns the same guid'); + sameGuid(a, aprime, 'different nulls return the same guid'); + diffGuid(a, b, 'null and undefined return different guids'); + nanGuid(a); + nanGuid(b); + }); + + QUnit.test('arrays', function () { + var a = ['a', 'b', 'c']; + var aprime = ['a', 'b', 'c']; + var b = ['1', '2', '3']; + + sameGuid(a, a, 'same instance always yields same guid'); + diffGuid(a, aprime, 'identical arrays always yield the same guid'); + diffGuid(a, b, 'different arrays yield different guids'); + nanGuid(a); + }); +}); +enifed('ember-utils/tests/guid_for_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils/tests'); + test('ember-utils/tests/guid_for_test.js should pass jscs', function () { + ok(true, 'ember-utils/tests/guid_for_test.js should pass jscs.'); + }); +}); +enifed('ember-utils/tests/guid_for_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils/tests'); + QUnit.test('ember-utils/tests/guid_for_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/tests/guid_for_test.js should pass jshint.'); + }); +}); +enifed('ember-utils/tests/inspect_test', ['exports', 'ember-utils/index'], function (exports, _emberUtilsIndex) { + 'use strict'; + + // Symbol is not defined on pre-ES2015 runtimes, so this let's us safely test + // for it's existence (where a simple `if (Symbol)` would ReferenceError) + var HAS_NATIVE_SYMBOL = typeof Symbol === 'function'; + + QUnit.module('Ember.inspect'); + + QUnit.test('strings', function () { + equal(_emberUtilsIndex.inspect('foo'), 'foo'); + }); + + QUnit.test('numbers', function () { + equal(_emberUtilsIndex.inspect(2.6), '2.6'); + }); + + QUnit.test('null', function () { + equal(_emberUtilsIndex.inspect(null), 'null'); + }); + + QUnit.test('undefined', function () { + equal(_emberUtilsIndex.inspect(undefined), 'undefined'); + }); + + QUnit.test('true', function () { + equal(_emberUtilsIndex.inspect(true), 'true'); + }); + + QUnit.test('false', function () { + equal(_emberUtilsIndex.inspect(false), 'false'); + }); + + QUnit.test('object', function () { + equal(_emberUtilsIndex.inspect({}), '{}'); + equal(_emberUtilsIndex.inspect({ foo: 'bar' }), '{foo: bar}'); + equal(_emberUtilsIndex.inspect({ foo: function () { + return this; + } }), '{foo: function() { ... }}'); + }); + + QUnit.test('objects without a prototype', function () { + var prototypelessObj = Object.create(null); + equal(_emberUtilsIndex.inspect({ foo: prototypelessObj }), '{foo: [object Object]}'); + }); + + QUnit.test('array', function () { + equal(_emberUtilsIndex.inspect([1, 2, 3]), '[1,2,3]'); + }); + + QUnit.test('regexp', function () { + equal(_emberUtilsIndex.inspect(/regexp/), '/regexp/'); + }); + + QUnit.test('date', function () { + var inspected = _emberUtilsIndex.inspect(new Date('Sat Apr 30 2011 13:24:11')); + ok(inspected.match(/Sat Apr 30/), 'The inspected date has its date'); + ok(inspected.match(/2011/), 'The inspected date has its year'); + ok(inspected.match(/13:24:11/), 'The inspected date has its time'); + }); + + QUnit.test('inspect outputs the toString() representation of Symbols', function () { + if (HAS_NATIVE_SYMBOL) { + var symbol = Symbol('test'); + equal(_emberUtilsIndex.inspect(symbol), 'Symbol(test)'); + } else { + expect(0); + } + }); +}); +enifed('ember-utils/tests/inspect_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils/tests'); + test('ember-utils/tests/inspect_test.js should pass jscs', function () { + ok(true, 'ember-utils/tests/inspect_test.js should pass jscs.'); + }); +}); +enifed('ember-utils/tests/inspect_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils/tests'); + QUnit.test('ember-utils/tests/inspect_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/tests/inspect_test.js should pass jshint.'); + }); +}); +enifed('ember-utils/tests/to-string-test', ['exports', 'ember-utils/index'], function (exports, _emberUtilsIndex) { + 'use strict'; + + QUnit.module('ember-utils toString'); + + QUnit.test('toString uses an object\'s toString method when available', function () { + var obj = { + toString: function () { + return 'bob'; + } + }; + + strictEqual(_emberUtilsIndex.toString(obj), 'bob'); + }); + + QUnit.test('toString falls back to Object.prototype.toString', function () { + var obj = Object.create(null); + + strictEqual(_emberUtilsIndex.toString(obj), ({}).toString()); + }); +}); +enifed('ember-utils/tests/to-string-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils/tests'); + test('ember-utils/tests/to-string-test.js should pass jscs', function () { + ok(true, 'ember-utils/tests/to-string-test.js should pass jscs.'); + }); +}); +enifed('ember-utils/tests/to-string-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils/tests'); + QUnit.test('ember-utils/tests/to-string-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/tests/to-string-test.js should pass jshint.'); + }); +}); +enifed('ember-utils/tests/try_invoke_test', ['exports', 'ember-utils/index'], function (exports, _emberUtilsIndex) { + 'use strict'; + + var obj = undefined; + + QUnit.module('Ember.tryInvoke', { + setup: function () { + obj = { + aMethodThatExists: function () { + return true; + }, + aMethodThatTakesArguments: function (arg1, arg2) { + return arg1 === arg2; + } + }; + }, + + teardown: function () { + obj = undefined; + } + }); + + QUnit.test('should return undefined when the object doesn\'t exist', function () { + equal(_emberUtilsIndex.tryInvoke(undefined, 'aMethodThatDoesNotExist'), undefined); + }); + + QUnit.test('should return undefined when asked to perform a method that doesn\'t exist on the object', function () { + equal(_emberUtilsIndex.tryInvoke(obj, 'aMethodThatDoesNotExist'), undefined); + }); + + QUnit.test('should return what the method returns when asked to perform a method that exists on the object', function () { + equal(_emberUtilsIndex.tryInvoke(obj, 'aMethodThatExists'), true); + }); + + QUnit.test('should return what the method returns when asked to perform a method that takes arguments and exists on the object', function () { + equal(_emberUtilsIndex.tryInvoke(obj, 'aMethodThatTakesArguments', [true, true]), true); + }); +}); +enifed('ember-utils/tests/try_invoke_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils/tests'); + test('ember-utils/tests/try_invoke_test.js should pass jscs', function () { + ok(true, 'ember-utils/tests/try_invoke_test.js should pass jscs.'); + }); +}); +enifed('ember-utils/tests/try_invoke_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils/tests'); + QUnit.test('ember-utils/tests/try_invoke_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/tests/try_invoke_test.js should pass jshint.'); + }); +}); +enifed('ember-utils/to-string.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/to-string.js should pass jscs', function () { + ok(true, 'ember-utils/to-string.js should pass jscs.'); + }); +}); +enifed('ember-utils/to-string.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/to-string.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/to-string.js should pass jshint.'); + }); +}); +enifed('ember-views/compat/attrs.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/compat'); + test('ember-views/compat/attrs.js should pass jscs', function () { + ok(true, 'ember-views/compat/attrs.js should pass jscs.'); + }); +}); +enifed('ember-views/compat/attrs.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/compat'); + QUnit.test('ember-views/compat/attrs.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/compat/attrs.js should pass jshint.'); + }); +}); +enifed('ember-views/compat/fallback-view-registry.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/compat'); + test('ember-views/compat/fallback-view-registry.js should pass jscs', function () { + ok(true, 'ember-views/compat/fallback-view-registry.js should pass jscs.'); + }); +}); +enifed('ember-views/compat/fallback-view-registry.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/compat'); + QUnit.test('ember-views/compat/fallback-view-registry.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/compat/fallback-view-registry.js should pass jshint.'); + }); +}); +enifed('ember-views/component_lookup.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views'); + test('ember-views/component_lookup.js should pass jscs', function () { + ok(true, 'ember-views/component_lookup.js should pass jscs.'); + }); +}); +enifed('ember-views/component_lookup.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views'); + QUnit.test('ember-views/component_lookup.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/component_lookup.js should pass jshint.'); + }); +}); +enifed('ember-views/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views'); + test('ember-views/index.js should pass jscs', function () { + ok(true, 'ember-views/index.js should pass jscs.'); + }); +}); +enifed('ember-views/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views'); + QUnit.test('ember-views/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/index.js should pass jshint.'); + }); +}); +enifed('ember-views/mixins/action_support.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/mixins'); + test('ember-views/mixins/action_support.js should pass jscs', function () { + ok(true, 'ember-views/mixins/action_support.js should pass jscs.'); + }); +}); +enifed('ember-views/mixins/action_support.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/mixins'); + QUnit.test('ember-views/mixins/action_support.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/mixins/action_support.js should pass jshint.'); + }); +}); +enifed('ember-views/mixins/child_views_support.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/mixins'); + test('ember-views/mixins/child_views_support.js should pass jscs', function () { + ok(true, 'ember-views/mixins/child_views_support.js should pass jscs.'); + }); +}); +enifed('ember-views/mixins/child_views_support.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/mixins'); + QUnit.test('ember-views/mixins/child_views_support.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/mixins/child_views_support.js should pass jshint.'); + }); +}); +enifed('ember-views/mixins/class_names_support.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/mixins'); + test('ember-views/mixins/class_names_support.js should pass jscs', function () { + ok(true, 'ember-views/mixins/class_names_support.js should pass jscs.'); + }); +}); +enifed('ember-views/mixins/class_names_support.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/mixins'); + QUnit.test('ember-views/mixins/class_names_support.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/mixins/class_names_support.js should pass jshint.'); + }); +}); +enifed('ember-views/mixins/text_support.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/mixins'); + test('ember-views/mixins/text_support.js should pass jscs', function () { + ok(true, 'ember-views/mixins/text_support.js should pass jscs.'); + }); +}); +enifed('ember-views/mixins/text_support.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/mixins'); + QUnit.test('ember-views/mixins/text_support.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/mixins/text_support.js should pass jshint.'); + }); +}); +enifed('ember-views/mixins/view_state_support.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/mixins'); + test('ember-views/mixins/view_state_support.js should pass jscs', function () { + ok(true, 'ember-views/mixins/view_state_support.js should pass jscs.'); + }); +}); +enifed('ember-views/mixins/view_state_support.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/mixins'); + QUnit.test('ember-views/mixins/view_state_support.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/mixins/view_state_support.js should pass jshint.'); + }); +}); +enifed('ember-views/mixins/view_support.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/mixins'); + test('ember-views/mixins/view_support.js should pass jscs', function () { + ok(true, 'ember-views/mixins/view_support.js should pass jscs.'); + }); +}); +enifed('ember-views/mixins/view_support.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/mixins'); + QUnit.test('ember-views/mixins/view_support.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/mixins/view_support.js should pass jshint.'); + }); +}); +enifed('ember-views/system/action_manager.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/system'); + test('ember-views/system/action_manager.js should pass jscs', function () { + ok(true, 'ember-views/system/action_manager.js should pass jscs.'); + }); +}); +enifed('ember-views/system/action_manager.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/system'); + QUnit.test('ember-views/system/action_manager.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/system/action_manager.js should pass jshint.'); + }); +}); +enifed('ember-views/system/event_dispatcher.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/system'); + test('ember-views/system/event_dispatcher.js should pass jscs', function () { + ok(true, 'ember-views/system/event_dispatcher.js should pass jscs.'); + }); +}); +enifed('ember-views/system/event_dispatcher.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/system'); + QUnit.test('ember-views/system/event_dispatcher.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/system/event_dispatcher.js should pass jshint.'); + }); +}); +enifed('ember-views/system/ext.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/system'); + test('ember-views/system/ext.js should pass jscs', function () { + ok(true, 'ember-views/system/ext.js should pass jscs.'); + }); +}); +enifed('ember-views/system/ext.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/system'); + QUnit.test('ember-views/system/ext.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/system/ext.js should pass jshint.'); + }); +}); +enifed('ember-views/system/jquery.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/system'); + test('ember-views/system/jquery.js should pass jscs', function () { + ok(true, 'ember-views/system/jquery.js should pass jscs.'); + }); +}); +enifed('ember-views/system/jquery.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/system'); + QUnit.test('ember-views/system/jquery.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/system/jquery.js should pass jshint.'); + }); +}); +enifed('ember-views/system/lookup_partial.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/system'); + test('ember-views/system/lookup_partial.js should pass jscs', function () { + ok(true, 'ember-views/system/lookup_partial.js should pass jscs.'); + }); +}); +enifed('ember-views/system/lookup_partial.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/system'); + QUnit.test('ember-views/system/lookup_partial.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/system/lookup_partial.js should pass jshint.'); + }); +}); +enifed('ember-views/system/utils.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/system'); + test('ember-views/system/utils.js should pass jscs', function () { + ok(true, 'ember-views/system/utils.js should pass jscs.'); + }); +}); +enifed('ember-views/system/utils.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/system'); + QUnit.test('ember-views/system/utils.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/system/utils.js should pass jshint.'); + }); +}); +enifed('ember-views/utils/lookup-component.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/utils'); + test('ember-views/utils/lookup-component.js should pass jscs', function () { + ok(true, 'ember-views/utils/lookup-component.js should pass jscs.'); + }); +}); +enifed('ember-views/utils/lookup-component.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/utils'); + QUnit.test('ember-views/utils/lookup-component.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/utils/lookup-component.js should pass jshint.'); + }); +}); +enifed('ember-views/views/core_view.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/views'); + test('ember-views/views/core_view.js should pass jscs', function () { + ok(true, 'ember-views/views/core_view.js should pass jscs.'); + }); +}); +enifed('ember-views/views/core_view.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/views'); + QUnit.test('ember-views/views/core_view.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/views/core_view.js should pass jshint.'); + }); +}); +enifed('ember-views/views/states.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/views'); + test('ember-views/views/states.js should pass jscs', function () { + ok(true, 'ember-views/views/states.js should pass jscs.'); + }); +}); +enifed('ember-views/views/states.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/views'); + QUnit.test('ember-views/views/states.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/views/states.js should pass jshint.'); + }); +}); +enifed('ember-views/views/states/default.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/views/states'); + test('ember-views/views/states/default.js should pass jscs', function () { + ok(true, 'ember-views/views/states/default.js should pass jscs.'); + }); +}); +enifed('ember-views/views/states/default.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/views/states'); + QUnit.test('ember-views/views/states/default.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/views/states/default.js should pass jshint.'); + }); +}); +enifed('ember-views/views/states/destroying.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/views/states'); + test('ember-views/views/states/destroying.js should pass jscs', function () { + ok(true, 'ember-views/views/states/destroying.js should pass jscs.'); + }); +}); +enifed('ember-views/views/states/destroying.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/views/states'); + QUnit.test('ember-views/views/states/destroying.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/views/states/destroying.js should pass jshint.'); + }); +}); +enifed('ember-views/views/states/has_element.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/views/states'); + test('ember-views/views/states/has_element.js should pass jscs', function () { + ok(true, 'ember-views/views/states/has_element.js should pass jscs.'); + }); +}); +enifed('ember-views/views/states/has_element.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/views/states'); + QUnit.test('ember-views/views/states/has_element.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/views/states/has_element.js should pass jshint.'); + }); +}); +enifed('ember-views/views/states/in_dom.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/views/states'); + test('ember-views/views/states/in_dom.js should pass jscs', function () { + ok(true, 'ember-views/views/states/in_dom.js should pass jscs.'); + }); +}); +enifed('ember-views/views/states/in_dom.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/views/states'); + QUnit.test('ember-views/views/states/in_dom.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/views/states/in_dom.js should pass jshint.'); + }); +}); +enifed('ember-views/views/states/pre_render.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/views/states'); + test('ember-views/views/states/pre_render.js should pass jscs', function () { + ok(true, 'ember-views/views/states/pre_render.js should pass jscs.'); + }); +}); +enifed('ember-views/views/states/pre_render.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/views/states'); + QUnit.test('ember-views/views/states/pre_render.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/views/states/pre_render.js should pass jshint.'); + }); +}); +enifed('ember-views/views/view.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/views'); + test('ember-views/views/view.js should pass jscs', function () { + ok(true, 'ember-views/views/view.js should pass jscs.'); + }); +}); +enifed('ember-views/views/view.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/views'); + QUnit.test('ember-views/views/view.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/views/view.js should pass jshint.'); + }); +}); +enifed('ember/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember'); + test('ember/index.js should pass jscs', function () { + ok(true, 'ember/index.js should pass jscs.'); + }); +}); +enifed('ember/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember'); + QUnit.test('ember/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/index.js should pass jshint.'); + }); +}); +enifed('ember/tests/application_lifecycle_test', ['exports', 'ember-application', 'ember-routing', 'ember-metal', 'ember-glimmer', 'ember-views', 'ember-template-compiler'], function (exports, _emberApplication, _emberRouting, _emberMetal, _emberGlimmer, _emberViews, _emberTemplateCompiler) { + 'use strict'; + + var App = undefined, + TEMPLATES = undefined, + appInstance = undefined, + router = undefined; + + function setupApp(klass) { + _emberMetal.run(function () { + App = klass.create({ + rootElement: '#qunit-fixture' + }); + + App.Router = App.Router.extend({ + location: 'none' + }); + + App.deferReadiness(); + + appInstance = App.__deprecatedInstance__; + }); + } + + QUnit.module('Application Lifecycle', { + setup: function () { + TEMPLATES = _emberGlimmer.getTemplates(); + setupApp(_emberApplication.Application.extend()); + }, + + teardown: function () { + router = null; + _emberMetal.run(App, 'destroy'); + _emberGlimmer.setTemplates({}); + } + }); + + function handleURL(path) { + router = appInstance.lookup('router:main'); + return _emberMetal.run(function () { + return router.handleURL(path).then(function (value) { + ok(true, 'url: `' + path + '` was handled'); + return value; + }, function (reason) { + ok(false, reason); + throw reason; + }); + }); + } + + QUnit.test('Resetting the application allows controller properties to be set when a route deactivates', function () { + App.Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + setupController: function () { + this.controllerFor('home').set('selectedMenuItem', 'home'); + }, + deactivate: function () { + this.controllerFor('home').set('selectedMenuItem', null); + } + }); + App.ApplicationRoute = _emberRouting.Route.extend({ + setupController: function () { + this.controllerFor('application').set('selectedMenuItem', 'home'); + }, + deactivate: function () { + this.controllerFor('application').set('selectedMenuItem', null); + } + }); + + appInstance.lookup('router:main'); + + _emberMetal.run(App, 'advanceReadiness'); + + handleURL('/'); + + equal(_emberRouting.controllerFor(appInstance, 'home').get('selectedMenuItem'), 'home'); + equal(_emberRouting.controllerFor(appInstance, 'application').get('selectedMenuItem'), 'home'); + + App.reset(); + + equal(_emberRouting.controllerFor(appInstance, 'home').get('selectedMenuItem'), null); + equal(_emberRouting.controllerFor(appInstance, 'application').get('selectedMenuItem'), null); + }); + + QUnit.test('Destroying the application resets the router before the appInstance is destroyed', function () { + App.Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + setupController: function () { + this.controllerFor('home').set('selectedMenuItem', 'home'); + }, + deactivate: function () { + this.controllerFor('home').set('selectedMenuItem', null); + } + }); + App.ApplicationRoute = _emberRouting.Route.extend({ + setupController: function () { + this.controllerFor('application').set('selectedMenuItem', 'home'); + }, + deactivate: function () { + this.controllerFor('application').set('selectedMenuItem', null); + } + }); + + appInstance.lookup('router:main'); + + _emberMetal.run(App, 'advanceReadiness'); + + handleURL('/'); + + equal(_emberRouting.controllerFor(appInstance, 'home').get('selectedMenuItem'), 'home'); + equal(_emberRouting.controllerFor(appInstance, 'application').get('selectedMenuItem'), 'home'); + + _emberMetal.run(App, 'destroy'); + + equal(_emberRouting.controllerFor(appInstance, 'home').get('selectedMenuItem'), null); + equal(_emberRouting.controllerFor(appInstance, 'application').get('selectedMenuItem'), null); + }); + + QUnit.test('Destroying a route after the router does create an undestroyed `toplevelView`', function () { + App.Router.map(function () { + this.route('home', { path: '/' }); + }); + + _emberGlimmer.setTemplates({ + index: _emberTemplateCompiler.compile('Index!'), + application: _emberTemplateCompiler.compile('Application! {{outlet}}') + }); + + App.IndexRoute = _emberRouting.Route.extend(); + _emberMetal.run(App, 'advanceReadiness'); + + handleURL('/'); + + var router = appInstance.lookup('router:main'); + var route = appInstance.lookup('route:index'); + + _emberMetal.run(router, 'destroy'); + equal(router._toplevelView, null, 'the toplevelView was cleared'); + + _emberMetal.run(route, 'destroy'); + equal(router._toplevelView, null, 'the toplevelView was not reinitialized'); + + _emberMetal.run(App, 'destroy'); + equal(router._toplevelView, null, 'the toplevelView was not reinitialized'); + }); + + QUnit.test('initializers can augment an applications customEvents hash', function (assert) { + assert.expect(1); + + _emberMetal.run(App, 'destroy'); + + var ApplicationSubclass = _emberApplication.Application.extend(); + + ApplicationSubclass.initializer({ + name: 'customize-things', + initialize: function (application) { + application.customEvents = { + wowza: 'wowza' + }; + } + }); + + setupApp(ApplicationSubclass); + + App.FooBarComponent = _emberGlimmer.Component.extend({ + wowza: function () { + assert.ok(true, 'fired the event!'); + } + }); + + TEMPLATES['application'] = _emberTemplateCompiler.compile('{{foo-bar}}'); + TEMPLATES['components/foo-bar'] = _emberTemplateCompiler.compile('
    '); + + _emberMetal.run(App, 'advanceReadiness'); + + _emberMetal.run(function () { + return _emberViews.jQuery('#wowza-thingy').trigger('wowza'); + }); + }); + + QUnit.test('instanceInitializers can augment an the customEvents hash', function (assert) { + assert.expect(1); + + _emberMetal.run(App, 'destroy'); + + var ApplicationSubclass = _emberApplication.Application.extend(); + + ApplicationSubclass.instanceInitializer({ + name: 'customize-things', + initialize: function (application) { + application.customEvents = { + herky: 'jerky' + }; + } + }); + + setupApp(ApplicationSubclass); + + App.FooBarComponent = _emberGlimmer.Component.extend({ + jerky: function () { + assert.ok(true, 'fired the event!'); + } + }); + + TEMPLATES['application'] = _emberTemplateCompiler.compile('{{foo-bar}}'); + TEMPLATES['components/foo-bar'] = _emberTemplateCompiler.compile('
    '); + + _emberMetal.run(App, 'advanceReadiness'); + + _emberMetal.run(function () { + return _emberViews.jQuery('#herky-thingy').trigger('herky'); + }); + }); +}); +enifed('ember/tests/application_lifecycle_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests'); + test('ember/tests/application_lifecycle_test.js should pass jscs', function () { + ok(true, 'ember/tests/application_lifecycle_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/application_lifecycle_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests'); + QUnit.test('ember/tests/application_lifecycle_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/application_lifecycle_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/component_registration_test', ['exports', 'ember-runtime', 'ember-metal', 'ember-application', 'ember-routing', 'ember-template-compiler', 'ember-glimmer', 'ember-views'], function (exports, _emberRuntime, _emberMetal, _emberApplication, _emberRouting, _emberTemplateCompiler, _emberGlimmer, _emberViews) { + 'use strict'; + + var App = undefined, + appInstance = undefined; + + function prepare() { + _emberGlimmer.setTemplate('components/expand-it', _emberTemplateCompiler.compile('

    hello {{yield}}

    ')); + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('Hello world {{#expand-it}}world{{/expand-it}}')); + } + + function cleanup() { + _emberMetal.run(function () { + try { + if (App) { + App.destroy(); + } + App = appInstance = null; + } finally { + _emberGlimmer.setTemplates({}); + } + }); + } + + QUnit.module('Application Lifecycle - Component Registration', { + setup: prepare, + teardown: cleanup + }); + + function boot(callback) { + var startURL = arguments.length <= 1 || arguments[1] === undefined ? '/' : arguments[1]; + + _emberMetal.run(function () { + App = _emberApplication.Application.create({ + name: 'App', + rootElement: '#qunit-fixture' + }); + + App.deferReadiness(); + + App.Router = _emberRouting.Router.extend({ + location: 'none' + }); + + appInstance = App.__deprecatedInstance__; + + if (callback) { + callback(); + } + }); + + var router = appInstance.lookup('router:main'); + + _emberMetal.run(App, 'advanceReadiness'); + _emberMetal.run(function () { + return router.handleURL(startURL); + }); + } + + QUnit.test('The helper becomes the body of the component', function () { + boot(); + equal(_emberViews.jQuery('div.ember-view > div.ember-view', '#qunit-fixture').text(), 'hello world', 'The component is composed correctly'); + }); + + QUnit.test('If a component is registered, it is used', function () { + boot(function () { + appInstance.register('component:expand-it', _emberGlimmer.Component.extend({ + classNames: 'testing123' + })); + }); + + equal(_emberViews.jQuery('div.testing123', '#qunit-fixture').text(), 'hello world', 'The component is composed correctly'); + }); + + QUnit.test('Late-registered components can be rendered with custom `layout` property', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    there goes {{my-hero}}
    ')); + + boot(function () { + appInstance.register('component:my-hero', _emberGlimmer.Component.extend({ + classNames: 'testing123', + layout: _emberTemplateCompiler.compile('watch him as he GOES') + })); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'there goes watch him as he GOES', 'The component is composed correctly'); + }); + + QUnit.test('Late-registered components can be rendered with template registered on the container', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    hello world {{sally-rutherford}}-{{#sally-rutherford}}!!!{{/sally-rutherford}}
    ')); + + boot(function () { + appInstance.register('template:components/sally-rutherford', _emberTemplateCompiler.compile('funkytowny{{yield}}')); + appInstance.register('component:sally-rutherford', _emberGlimmer.Component); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'hello world funkytowny-funkytowny!!!', 'The component is composed correctly'); + }); + + QUnit.test('Late-registered components can be rendered with ONLY the template registered on the container', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    hello world {{borf-snorlax}}-{{#borf-snorlax}}!!!{{/borf-snorlax}}
    ')); + + boot(function () { + appInstance.register('template:components/borf-snorlax', _emberTemplateCompiler.compile('goodfreakingTIMES{{yield}}')); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'hello world goodfreakingTIMES-goodfreakingTIMES!!!', 'The component is composed correctly'); + }); + + QUnit.test('Assigning layoutName to a component should setup the template as a layout', function () { + expect(1); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{#my-component}}{{text}}{{/my-component}}
    ')); + _emberGlimmer.setTemplate('foo-bar-baz', _emberTemplateCompiler.compile('{{text}}-{{yield}}')); + + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + 'text': 'outer' + })); + + appInstance.register('component:my-component', _emberGlimmer.Component.extend({ + text: 'inner', + layoutName: 'foo-bar-baz' + })); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'inner-outer', 'The component is composed correctly'); + }); + + QUnit.test('Assigning layoutName and layout to a component should use the `layout` value', function () { + expect(1); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{#my-component}}{{text}}{{/my-component}}
    ')); + _emberGlimmer.setTemplate('foo-bar-baz', _emberTemplateCompiler.compile('No way!')); + + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + 'text': 'outer' + })); + + appInstance.register('component:my-component', _emberGlimmer.Component.extend({ + text: 'inner', + layoutName: 'foo-bar-baz', + layout: _emberTemplateCompiler.compile('{{text}}-{{yield}}') + })); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'inner-outer', 'The component is composed correctly'); + }); + + QUnit.test('Assigning defaultLayout to a component should set it up as a layout if no layout was found [DEPRECATED]', function () { + expect(2); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{#my-component}}{{text}}{{/my-component}}
    ')); + + expectDeprecation(function () { + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + 'text': 'outer' + })); + + appInstance.register('component:my-component', _emberGlimmer.Component.extend({ + text: 'inner', + defaultLayout: _emberTemplateCompiler.compile('{{text}}-{{yield}}') + })); + }); + }, /Specifying `defaultLayout` to .+ is deprecated\./); + + equal(_emberViews.jQuery('#wrapper').text(), 'inner-outer', 'The component is composed correctly'); + }); + + QUnit.test('Assigning defaultLayout to a component should set it up as a layout if layout was found [DEPRECATED]', function () { + expect(2); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{#my-component}}{{text}}{{/my-component}}
    ')); + _emberGlimmer.setTemplate('components/my-component', _emberTemplateCompiler.compile('{{text}}-{{yield}}')); + + expectDeprecation(function () { + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + 'text': 'outer' + })); + + appInstance.register('component:my-component', _emberGlimmer.Component.extend({ + text: 'inner', + defaultLayout: _emberTemplateCompiler.compile('should not see this!') + })); + }); + }, /Specifying `defaultLayout` to .+ is deprecated\./); + + equal(_emberViews.jQuery('#wrapper').text(), 'inner-outer', 'The component is composed correctly'); + }); + + QUnit.test('Using name of component that does not exist', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{#no-good}} {{/no-good}}
    ')); + + expectAssertion(function () { + return boot(); + }, /.* named "no-good" .*/); + }); + + QUnit.module('Application Lifecycle - Component Context', { + setup: prepare, + teardown: cleanup + }); + + QUnit.test('Components with a block should have the proper content when a template is provided', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{#my-component}}{{text}}{{/my-component}}
    ')); + _emberGlimmer.setTemplate('components/my-component', _emberTemplateCompiler.compile('{{text}}-{{yield}}')); + + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + 'text': 'outer' + })); + + appInstance.register('component:my-component', _emberGlimmer.Component.extend({ + text: 'inner' + })); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'inner-outer', 'The component is composed correctly'); + }); + + QUnit.test('Components with a block should yield the proper content without a template provided', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{#my-component}}{{text}}{{/my-component}}
    ')); + + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + 'text': 'outer' + })); + + appInstance.register('component:my-component', _emberGlimmer.Component.extend({ + text: 'inner' + })); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'outer', 'The component is composed correctly'); + }); + + QUnit.test('Components without a block should have the proper content when a template is provided', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{my-component}}
    ')); + _emberGlimmer.setTemplate('components/my-component', _emberTemplateCompiler.compile('{{text}}')); + + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + 'text': 'outer' + })); + + appInstance.register('component:my-component', _emberGlimmer.Component.extend({ + text: 'inner' + })); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'inner', 'The component is composed correctly'); + }); + + QUnit.test('Components without a block should have the proper content', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{my-component}}
    ')); + + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + 'text': 'outer' + })); + + appInstance.register('component:my-component', _emberGlimmer.Component.extend({ + didInsertElement: function () { + this.$().html('Some text inserted by jQuery'); + } + })); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'Some text inserted by jQuery', 'The component is composed correctly'); + }); + + // The test following this one is the non-deprecated version + QUnit.test('properties of a component without a template should not collide with internal structures [DEPRECATED]', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{my-component data=foo}}
    ')); + + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + 'text': 'outer', + 'foo': 'Some text inserted by jQuery' + })); + + appInstance.register('component:my-component', _emberGlimmer.Component.extend({ + didInsertElement: function () { + this.$().html(this.get('data')); + } + })); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'Some text inserted by jQuery', 'The component is composed correctly'); + }); + + QUnit.test('attrs property of a component without a template should not collide with internal structures', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{my-component attrs=foo}}
    ')); + + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + 'text': 'outer', + 'foo': 'Some text inserted by jQuery' + })); + + appInstance.register('component:my-component', _emberGlimmer.Component.extend({ + didInsertElement: function () { + // FIXME: I'm unsure if this is even the right way to access attrs + this.$().html(this.get('attrs.attrs.value')); + } + })); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'Some text inserted by jQuery', 'The component is composed correctly'); + }); + + QUnit.test('Components trigger actions in the parents context when called from within a block', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{#my-component}}Fizzbuzz{{/my-component}}
    ')); + + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + actions: { + fizzbuzz: function () { + ok(true, 'action triggered on parent'); + } + } + })); + + appInstance.register('component:my-component', _emberGlimmer.Component.extend()); + }); + + _emberMetal.run(function () { + _emberViews.jQuery('#fizzbuzz', '#wrapper').click(); + }); + }); + + QUnit.test('Components trigger actions in the components context when called from within its template', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{#my-component}}{{text}}{{/my-component}}
    ')); + _emberGlimmer.setTemplate('components/my-component', _emberTemplateCompiler.compile('Fizzbuzz')); + + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + actions: { + fizzbuzz: function () { + ok(false, 'action triggered on the wrong context'); + } + } + })); + + appInstance.register('component:my-component', _emberGlimmer.Component.extend({ + actions: { + fizzbuzz: function () { + ok(true, 'action triggered on component'); + } + } + })); + }); + + _emberViews.jQuery('#fizzbuzz', '#wrapper').click(); + }); +}); +enifed('ember/tests/component_registration_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests'); + test('ember/tests/component_registration_test.js should pass jscs', function () { + ok(true, 'ember/tests/component_registration_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/component_registration_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests'); + QUnit.test('ember/tests/component_registration_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/component_registration_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/controller_test', ['exports', 'ember-runtime', 'ember-routing', 'ember-metal', 'ember-template-compiler', 'ember-application', 'ember-glimmer', 'ember-views'], function (exports, _emberRuntime, _emberRouting, _emberMetal, _emberTemplateCompiler, _emberApplication, _emberGlimmer, _emberViews) { + 'use strict'; + + /* + In Ember 1.x, controllers subtly affect things like template scope + and action targets in exciting and often inscrutable ways. This test + file contains integration tests that verify the correct behavior of + the many parts of the system that change and rely upon controller scope, + from the runtime up to the templating layer. + */ + + var App = undefined, + $fixture = undefined; + + QUnit.module('Template scoping examples', { + setup: function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create({ + name: 'App', + rootElement: '#qunit-fixture' + }); + App.deferReadiness(); + + App.Router.reopen({ + location: 'none' + }); + + App.LoadingRoute = _emberRouting.Route.extend(); + }); + + $fixture = _emberViews.jQuery('#qunit-fixture'); + }, + + teardown: function () { + _emberMetal.run(function () { + return App.destroy(); + }); + + App = null; + + _emberGlimmer.setTemplates({}); + } + }); + + QUnit.test('Actions inside an outlet go to the associated controller', function () { + expect(1); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{component-with-action action=\'componentAction\'}}')); + + App.IndexController = _emberRuntime.Controller.extend({ + actions: { + componentAction: function () { + ok(true, 'received the click'); + } + } + }); + + App.ComponentWithActionComponent = _emberGlimmer.Component.extend({ + classNames: ['component-with-action'], + click: function () { + this.sendAction(); + } + }); + + bootApp(); + + $fixture.find('.component-with-action').click(); + }); + + function bootApp() { + _emberMetal.run(App, 'advanceReadiness'); + } +}); +enifed('ember/tests/controller_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests'); + test('ember/tests/controller_test.js should pass jscs', function () { + ok(true, 'ember/tests/controller_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/controller_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests'); + QUnit.test('ember/tests/controller_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/controller_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/global-api-test', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { + 'use strict'; + + QUnit.module('Global API Tests'); + + function confirmExport(property, internal) { + QUnit.test('confirm ' + property + ' is exported', function () { + var theExport = _emberMetal.get(window, property); + ok(theExport + ' is exported'); + if (internal !== undefined) { + equal(theExport, internal, theExport + ' is exported properly'); + } + }); + } + + confirmExport('Ember.DefaultResolver'); + confirmExport('Ember.generateController'); + confirmExport('Ember.Helper'); + confirmExport('Ember.Helper.helper'); + confirmExport('Ember.isArray', _emberRuntime.isArray); +}); +enifed('ember/tests/global-api-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests'); + test('ember/tests/global-api-test.js should pass jscs', function () { + ok(true, 'ember/tests/global-api-test.js should pass jscs.'); + }); +}); +enifed('ember/tests/global-api-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests'); + QUnit.test('ember/tests/global-api-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/global-api-test.js should pass jshint.'); + }); +}); +enifed('ember/tests/helpers/helper_registration_test', ['exports', 'ember-runtime', 'ember-metal', 'ember-template-compiler', 'ember-glimmer', 'ember-application', 'ember-routing', 'ember-views'], function (exports, _emberRuntime, _emberMetal, _emberTemplateCompiler, _emberGlimmer, _emberApplication, _emberRouting, _emberViews) { + 'use strict'; + + var App = undefined, + appInstance = undefined; + + QUnit.module('Application Lifecycle - Helper Registration', { + teardown: function () { + _emberMetal.run(function () { + if (App) { + App.destroy(); + } + + App = appInstance = null; + _emberGlimmer.setTemplates({}); + }); + } + }); + + function boot(callback) { + _emberMetal.run(function () { + App = _emberApplication.Application.create({ + name: 'App', + rootElement: '#qunit-fixture' + }); + + App.deferReadiness(); + + App.Router = _emberRouting.Router.extend({ + location: 'none' + }); + + appInstance = App.__deprecatedInstance__; + + if (callback) { + callback(); + } + }); + + var router = appInstance.lookup('router:main'); + + _emberMetal.run(App, 'advanceReadiness'); + _emberMetal.run(function () { + return router.handleURL('/'); + }); + } + + QUnit.test('Unbound dashed helpers registered on the container can be late-invoked', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{x-borf}} {{x-borf \'YES\'}}
    ')); + var myHelper = _emberGlimmer.helper(function (params) { + return params[0] || 'BORF'; + }); + + boot(function () { + App.register('helper:x-borf', myHelper); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'BORF YES', 'The helper was invoked from the container'); + }); + + QUnit.test('Bound helpers registered on the container can be late-invoked', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{x-reverse}} {{x-reverse foo}}
    ')); + + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + foo: 'alex' + })); + + appInstance.register('helper:x-reverse', _emberGlimmer.helper(function (_ref) { + var value = _ref[0]; + + return value ? value.split('').reverse().join('') : '--'; + })); + }); + + equal(_emberViews.jQuery('#wrapper').text(), '-- xela', 'The bound helper was invoked from the container'); + }); + + QUnit.test('Undashed helpers registered on the container can be invoked', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{omg}}|{{yorp \'boo\'}}|{{yorp \'ya\'}}
    ')); + + boot(function () { + appInstance.register('helper:omg', _emberGlimmer.helper(function () { + return 'OMG'; + })); + + appInstance.register('helper:yorp', _emberGlimmer.helper(function (_ref2) { + var value = _ref2[0]; + return value; + })); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'OMG|boo|ya', 'The helper was invoked from the container'); + }); + + QUnit.test('Helpers can receive injections', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{full-name}}
    ')); + + var serviceCalled = false; + boot(function () { + appInstance.register('service:name-builder', _emberRuntime.Service.extend({ + build: function () { + serviceCalled = true; + } + })); + appInstance.register('helper:full-name', _emberGlimmer.Helper.extend({ + nameBuilder: _emberRuntime.inject.service('name-builder'), + compute: function () { + this.get('nameBuilder').build(); + } + })); + }); + + ok(serviceCalled, 'service was injected, method called'); + }); +}); +enifed('ember/tests/helpers/helper_registration_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/helpers'); + test('ember/tests/helpers/helper_registration_test.js should pass jscs', function () { + ok(true, 'ember/tests/helpers/helper_registration_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/helpers/helper_registration_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/helpers'); + QUnit.test('ember/tests/helpers/helper_registration_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/helpers/helper_registration_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/helpers/link_to_test', ['exports', 'ember-console', 'ember-runtime', 'ember-metal', 'ember-routing', 'ember-application', 'ember-views', 'ember-template-compiler', 'ember-glimmer'], function (exports, _emberConsole, _emberRuntime, _emberMetal, _emberRouting, _emberApplication, _emberViews, _emberTemplateCompiler, _emberGlimmer) { + 'use strict'; + + var Router = undefined, + App = undefined, + router = undefined, + appInstance = undefined; + + function bootApplication() { + router = appInstance.lookup('router:main'); + _emberMetal.run(App, 'advanceReadiness'); + } + + // IE includes the host name + function normalizeUrl(url) { + return url.replace(/https?:\/\/[^\/]+/, ''); + } + + function shouldNotBeActive(selector) { + checkActive(selector, false); + } + + function shouldBeActive(selector) { + checkActive(selector, true); + } + + function checkActive(selector, active) { + var classList = _emberViews.jQuery(selector, '#qunit-fixture')[0].className; + equal(classList.indexOf('active') > -1, active, selector + ' active should be ' + active.toString()); + } + + var updateCount = undefined, + replaceCount = undefined; + + function sharedSetup() { + App = _emberApplication.Application.create({ + name: 'App', + rootElement: '#qunit-fixture' + }); + + App.deferReadiness(); + + updateCount = replaceCount = 0; + App.Router.reopen({ + location: _emberRouting.NoneLocation.create({ + setURL: function (path) { + updateCount++; + _emberMetal.set(this, 'path', path); + }, + + replaceURL: function (path) { + replaceCount++; + _emberMetal.set(this, 'path', path); + } + }) + }); + + Router = App.Router; + appInstance = App.__deprecatedInstance__; + } + + function sharedTeardown() { + _emberMetal.run(function () { + return App.destroy(); + }); + _emberGlimmer.setTemplates({}); + _emberMetal.instrumentationReset(); + } + + QUnit.module('The {{link-to}} helper', { + setup: function () { + _emberMetal.run(function () { + sharedSetup(); + + _emberGlimmer.setTemplate('app', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Home

    {{#link-to \'about\' id=\'about-link\'}}About{{/link-to}}{{#link-to \'index\' id=\'self-link\'}}Self{{/link-to}}')); + _emberGlimmer.setTemplate('about', _emberTemplateCompiler.compile('

    About

    {{#link-to \'index\' id=\'home-link\'}}Home{{/link-to}}{{#link-to \'about\' id=\'self-link\'}}Self{{/link-to}}')); + _emberGlimmer.setTemplate('item', _emberTemplateCompiler.compile('

    Item

    {{model.name}}

    {{#link-to \'index\' id=\'home-link\'}}Home{{/link-to}}')); + + appInstance.unregister('router:main'); + appInstance.register('router:main', Router); + }); + }, + + teardown: sharedTeardown + }); + + QUnit.test('The {{link-to}} helper moves into the named route', function () { + Router.map(function (match) { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + equal(_emberViews.jQuery('h3:contains(Home)', '#qunit-fixture').length, 1, 'The home template was rendered'); + equal(_emberViews.jQuery('#self-link.active', '#qunit-fixture').length, 1, 'The self-link was rendered with active class'); + equal(_emberViews.jQuery('#about-link:not(.active)', '#qunit-fixture').length, 1, 'The other link was rendered without active class'); + + _emberMetal.run(function () { + return _emberViews.jQuery('#about-link', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('h3:contains(About)', '#qunit-fixture').length, 1, 'The about template was rendered'); + equal(_emberViews.jQuery('#self-link.active', '#qunit-fixture').length, 1, 'The self-link was rendered with active class'); + equal(_emberViews.jQuery('#home-link:not(.active)', '#qunit-fixture').length, 1, 'The other link was rendered without active class'); + }); + + if (false) { + QUnit.test('The {{link-to}} helper fires an interaction event', function (assert) { + assert.expect(2); + Router.map(function (match) { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + _emberMetal.instrumentationSubscribe('interaction.link-to', { + before: function () { + assert.ok(true, 'instrumentation subscriber was called'); + }, + after: function () { + assert.ok(true, 'instrumentation subscriber was called'); + } + }); + + _emberViews.jQuery('#about-link', '#qunit-fixture').click(); + }); + + QUnit.test('The {{link-to}} helper interaction event includes the route name', function (assert) { + assert.expect(2); + Router.map(function (match) { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + _emberMetal.instrumentationSubscribe('interaction.link-to', { + before: function (name, timestamp, _ref) { + var routeName = _ref.routeName; + + assert.equal(routeName, 'about', 'instrumentation subscriber was passed route name'); + }, + after: function (name, timestamp, _ref2) { + var routeName = _ref2.routeName; + + assert.equal(routeName, 'about', 'instrumentation subscriber was passed route name'); + } + }); + + _emberViews.jQuery('#about-link', '#qunit-fixture').click(); + }); + + QUnit.test('The {{link-to}} helper interaction event includes the transition in the after hook', function (assert) { + assert.expect(1); + Router.map(function (match) { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + _emberMetal.instrumentationSubscribe('interaction.link-to', { + before: function () {}, + after: function (name, timestamp, _ref3) { + var transition = _ref3.transition; + + assert.equal(transition.targetName, 'about', 'instrumentation subscriber was passed route name'); + } + }); + + _emberViews.jQuery('#about-link', '#qunit-fixture').click(); + }); + } + + QUnit.test('The {{link-to}} helper supports URL replacement', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Home

    {{#link-to \'about\' id=\'about-link\' replace=true}}About{{/link-to}}')); + + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + equal(updateCount, 0, 'precond: setURL has not been called'); + equal(replaceCount, 0, 'precond: replaceURL has not been called'); + + _emberMetal.run(function () { + return _emberViews.jQuery('#about-link', '#qunit-fixture').click(); + }); + + equal(updateCount, 0, 'setURL should not be called'); + equal(replaceCount, 1, 'replaceURL should be called once'); + }); + + QUnit.test('The {{link-to}} helper supports URL replacement via replace=boundTruthyThing', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Home

    {{#link-to \'about\' id=\'about-link\' replace=boundTruthyThing}}About{{/link-to}}')); + + App.IndexController = _emberRuntime.Controller.extend({ + boundTruthyThing: true + }); + + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + equal(updateCount, 0, 'precond: setURL has not been called'); + equal(replaceCount, 0, 'precond: replaceURL has not been called'); + + _emberMetal.run(function () { + return _emberViews.jQuery('#about-link', '#qunit-fixture').click(); + }); + + equal(updateCount, 0, 'setURL should not be called'); + equal(replaceCount, 1, 'replaceURL should be called once'); + }); + + QUnit.test('The {{link-to}} helper supports setting replace=boundFalseyThing', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Home

    {{#link-to \'about\' id=\'about-link\' replace=boundFalseyThing}}About{{/link-to}}')); + + App.IndexController = _emberRuntime.Controller.extend({ + boundFalseyThing: false + }); + + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + equal(updateCount, 0, 'precond: setURL has not been called'); + equal(replaceCount, 0, 'precond: replaceURL has not been called'); + + _emberMetal.run(function () { + return _emberViews.jQuery('#about-link', '#qunit-fixture').click(); + }); + + equal(updateCount, 1, 'setURL should be called'); + equal(replaceCount, 0, 'replaceURL should not be called'); + }); + + // jscs:disable + + QUnit.test("the {{link-to}} helper doesn't add an href when the tagName isn't 'a'", function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to \'about\' id=\'about-link\' tagName=\'div\'}}About{{/link-to}}')); + + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + equal(_emberViews.jQuery('#about-link').attr('href'), undefined, 'there is no href attribute'); + }); + + QUnit.test("the {{link-to}} applies a 'disabled' class when disabled", function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('\n {{#link-to "about" id="about-link-static" disabledWhen="shouldDisable"}}About{{/link-to}}\n {{#link-to "about" id="about-link-dynamic" disabledWhen=dynamicDisabledWhen}}About{{/link-to}}\n ')); + + App.IndexController = _emberRuntime.Controller.extend({ + shouldDisable: true, + dynamicDisabledWhen: 'shouldDisable' + }); + + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + equal(_emberViews.jQuery('#about-link-static.disabled', '#qunit-fixture').length, 1, 'The static link is disabled when its disabledWhen is true'); + equal(_emberViews.jQuery('#about-link-dynamic.disabled', '#qunit-fixture').length, 1, 'The dynamic link is disabled when its disabledWhen is true'); + + _emberMetal.run(function () { + return _emberMetal.set(appInstance.lookup('controller:index'), 'dynamicDisabledWhen', false); + }); + + equal(_emberViews.jQuery('#about-link-dynamic.disabled', '#qunit-fixture').length, 0, 'The dynamic link is re-enabled when its disabledWhen becomes false'); + }); + + QUnit.test("the {{link-to}} doesn't apply a 'disabled' class if disabledWhen is not provided", function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to "about" id="about-link"}}About{{/link-to}}')); + + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + ok(!_emberViews.jQuery('#about-link', '#qunit-fixture').hasClass('disabled'), 'The link is not disabled if disabledWhen not provided'); + }); + + QUnit.test('the {{link-to}} helper supports a custom disabledClass', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to "about" id="about-link" disabledWhen=true disabledClass="do-not-want"}}About{{/link-to}}')); + + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + equal(_emberViews.jQuery('#about-link.do-not-want', '#qunit-fixture').length, 1, 'The link can apply a custom disabled class'); + }); + + QUnit.test('the {{link-to}} helper supports a custom disabledClass set via bound param', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to "about" id="about-link" disabledWhen=true disabledClass=disabledClass}}About{{/link-to}}')); + + Router.map(function () { + this.route('about'); + }); + + App.IndexController = _emberRuntime.Controller.extend({ + disabledClass: 'do-not-want' + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + equal(_emberViews.jQuery('#about-link.do-not-want', '#qunit-fixture').length, 1, 'The link can apply a custom disabled class via bound param'); + }); + + QUnit.test('the {{link-to}} helper does not respond to clicks when disabled', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to "about" id="about-link" disabledWhen=true}}About{{/link-to}}')); + + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + _emberMetal.run(function () { + return _emberViews.jQuery('#about-link', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('h3:contains(About)', '#qunit-fixture').length, 0, 'Transitioning did not occur'); + }); + + QUnit.test('the {{link-to}} helper responds to clicks according to its disabledWhen bound param', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to "about" id="about-link" disabledWhen=disabledWhen}}About{{/link-to}}')); + + Router.map(function () { + this.route('about'); + }); + + App.IndexController = _emberRuntime.Controller.extend({ + disabledWhen: true + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + _emberMetal.run(function () { + return _emberViews.jQuery('#about-link', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('h3:contains(About)', '#qunit-fixture').length, 0, 'Transitioning did not occur'); + + _emberMetal.run(function () { + return _emberMetal.set(appInstance.lookup('controller:index'), 'disabledWhen', false); + }); + _emberMetal.run(function () { + return _emberViews.jQuery('#about-link', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('h3:contains(About)', '#qunit-fixture').length, 1, 'Transitioning did occur when disabledWhen became false'); + }); + + QUnit.test('The {{link-to}} helper supports a custom activeClass', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("

    Home

    {{#link-to 'about' id='about-link'}}About{{/link-to}}{{#link-to 'index' id='self-link' activeClass='zomg-active'}}Self{{/link-to}}")); + + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + equal(_emberViews.jQuery('h3:contains(Home)', '#qunit-fixture').length, 1, 'The home template was rendered'); + equal(_emberViews.jQuery('#self-link.zomg-active', '#qunit-fixture').length, 1, 'The self-link was rendered with active class'); + equal(_emberViews.jQuery('#about-link:not(.active)', '#qunit-fixture').length, 1, 'The other link was rendered without active class'); + }); + + QUnit.test('The {{link-to}} helper supports a custom activeClass from a bound param', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Home

    {{#link-to \'about\' id=\'about-link\'}}About{{/link-to}}{{#link-to \'index\' id=\'self-link\' activeClass=activeClass}}Self{{/link-to}}')); + + Router.map(function () { + this.route('about'); + }); + + App.IndexController = _emberRuntime.Controller.extend({ + activeClass: 'zomg-active' + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + equal(_emberViews.jQuery('h3:contains(Home)', '#qunit-fixture').length, 1, 'The home template was rendered'); + equal(_emberViews.jQuery('#self-link.zomg-active', '#qunit-fixture').length, 1, 'The self-link was rendered with active class'); + equal(_emberViews.jQuery('#about-link:not(.active)', '#qunit-fixture').length, 1, 'The other link was rendered without active class'); + }); + + QUnit.test("The {{link-to}} helper supports 'classNameBindings' with custom values [GH #11699]", function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Home

    {{#link-to \'about\' id=\'about-link\' classNameBindings=\'foo:foo-is-true:foo-is-false\'}}About{{/link-to}}')); + + Router.map(function () { + this.route('about'); + }); + + App.IndexController = _emberRuntime.Controller.extend({ + foo: false + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + equal(_emberViews.jQuery('#about-link.foo-is-false', '#qunit-fixture').length, 1, 'The about-link was rendered with the falsy class'); + + var controller = appInstance.lookup('controller:index'); + + _emberMetal.run(function () { + return controller.set('foo', true); + }); + + equal(_emberViews.jQuery('#about-link.foo-is-true', '#qunit-fixture').length, 1, 'The about-link was rendered with the truthy class after toggling the property'); + }); + + QUnit.test('The {{link-to}} helper supports leaving off .index for nested routes', function () { + Router.map(function () { + this.route('about', function () { + this.route('item'); + }); + }); + + _emberGlimmer.setTemplate('about', _emberTemplateCompiler.compile('

    About

    {{outlet}}')); + _emberGlimmer.setTemplate('about/index', _emberTemplateCompiler.compile("
    Index
    ")); + _emberGlimmer.setTemplate('about/item', _emberTemplateCompiler.compile("
    {{#link-to 'about'}}About{{/link-to}}
    ")); + + bootApplication(); + + _emberMetal.run(router, 'handleURL', '/about/item'); + + equal(normalizeUrl(_emberViews.jQuery('#item a', '#qunit-fixture').attr('href')), '/about'); + }); + + QUnit.test('The {{link-to}} helper supports currentWhen (DEPRECATED)', function () { + expectDeprecation('Usage of `currentWhen` is deprecated, use `current-when` instead.'); + + Router.map(function (match) { + this.route('index', { path: '/' }, function () { + this.route('about'); + }); + + this.route('item'); + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Home

    {{outlet}}')); + _emberGlimmer.setTemplate('index/about', _emberTemplateCompiler.compile("{{#link-to 'item' id='other-link' currentWhen='index'}}ITEM{{/link-to}}")); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/about'); + }); + + equal(_emberViews.jQuery('#other-link.active', '#qunit-fixture').length, 1, 'The link is active since current-when is a parent route'); + }); + + QUnit.test('The {{link-to}} helper supports custom, nested, current-when', function () { + Router.map(function (match) { + this.route('index', { path: '/' }, function () { + this.route('about'); + }); + + this.route('item'); + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Home

    {{outlet}}')); + _emberGlimmer.setTemplate('index/about', _emberTemplateCompiler.compile("{{#link-to 'item' id='other-link' current-when='index'}}ITEM{{/link-to}}")); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/about'); + }); + + equal(_emberViews.jQuery('#other-link.active', '#qunit-fixture').length, 1, 'The link is active since current-when is a parent route'); + }); + + QUnit.test('The {{link-to}} helper does not disregard current-when when it is given explicitly for a route', function () { + Router.map(function (match) { + this.route('index', { path: '/' }, function () { + this.route('about'); + }); + + this.route('items', function () { + this.route('item'); + }); + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Home

    {{outlet}}')); + _emberGlimmer.setTemplate('index/about', _emberTemplateCompiler.compile("{{#link-to 'items' id='other-link' current-when='index'}}ITEM{{/link-to}}")); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/about'); + }); + + equal(_emberViews.jQuery('#other-link.active', '#qunit-fixture').length, 1, 'The link is active when current-when is given for explicitly for a route'); + }); + + QUnit.test('The {{link-to}} helper does not disregard current-when when it is set via a bound param', function () { + Router.map(function (match) { + this.route('index', { path: '/' }, function () { + this.route('about'); + }); + + this.route('items', function () { + this.route('item'); + }); + }); + + App.IndexAboutController = _emberRuntime.Controller.extend({ + currentWhen: 'index' + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Home

    {{outlet}}')); + _emberGlimmer.setTemplate('index/about', _emberTemplateCompiler.compile("{{#link-to 'items' id='other-link' current-when=currentWhen}}ITEM{{/link-to}}")); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/about'); + }); + + equal(_emberViews.jQuery('#other-link.active', '#qunit-fixture').length, 1, 'The link is active when current-when is given for explicitly for a route'); + }); + + QUnit.test('The {{link-to}} helper supports multiple current-when routes', function () { + Router.map(function (match) { + this.route('index', { path: '/' }, function () { + this.route('about'); + }); + this.route('item'); + this.route('foo'); + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Home

    {{outlet}}')); + _emberGlimmer.setTemplate('index/about', _emberTemplateCompiler.compile("{{#link-to 'item' id='link1' current-when='item index'}}ITEM{{/link-to}}")); + _emberGlimmer.setTemplate('item', _emberTemplateCompiler.compile("{{#link-to 'item' id='link2' current-when='item index'}}ITEM{{/link-to}}")); + _emberGlimmer.setTemplate('foo', _emberTemplateCompiler.compile("{{#link-to 'item' id='link3' current-when='item index'}}ITEM{{/link-to}}")); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/about'); + }); + + equal(_emberViews.jQuery('#link1.active', '#qunit-fixture').length, 1, 'The link is active since current-when contains the parent route'); + + _emberMetal.run(function () { + return router.handleURL('/item'); + }); + + equal(_emberViews.jQuery('#link2.active', '#qunit-fixture').length, 1, 'The link is active since you are on the active route'); + + _emberMetal.run(function () { + return router.handleURL('/foo'); + }); + + equal(_emberViews.jQuery('#link3.active', '#qunit-fixture').length, 0, 'The link is not active since current-when does not contain the active route'); + }); + + QUnit.test('The {{link-to}} helper defaults to bubbling', function () { + _emberGlimmer.setTemplate('about', _emberTemplateCompiler.compile("
    {{#link-to 'about.contact' id='about-contact'}}About{{/link-to}}
    {{outlet}}")); + _emberGlimmer.setTemplate('about/contact', _emberTemplateCompiler.compile("

    Contact

    ")); + + Router.map(function () { + this.route('about', function () { + this.route('contact'); + }); + }); + + var hidden = 0; + + App.AboutRoute = _emberRouting.Route.extend({ + actions: { + hide: function () { + hidden++; + } + } + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/about'); + }); + + _emberMetal.run(function () { + return _emberViews.jQuery('#about-contact', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('#contact', '#qunit-fixture').text(), 'Contact', 'precond - the link worked'); + + equal(hidden, 1, 'The link bubbles'); + }); + + QUnit.test('The {{link-to}} helper supports bubbles=false', function () { + _emberGlimmer.setTemplate('about', _emberTemplateCompiler.compile("
    {{#link-to 'about.contact' id='about-contact' bubbles=false}}About{{/link-to}}
    {{outlet}}")); + _emberGlimmer.setTemplate('about/contact', _emberTemplateCompiler.compile("

    Contact

    ")); + + Router.map(function () { + this.route('about', function () { + this.route('contact'); + }); + }); + + var hidden = 0; + + App.AboutRoute = _emberRouting.Route.extend({ + actions: { + hide: function () { + hidden++; + } + } + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/about'); + }); + + _emberMetal.run(function () { + return _emberViews.jQuery('#about-contact', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('#contact', '#qunit-fixture').text(), 'Contact', 'precond - the link worked'); + + equal(hidden, 0, "The link didn't bubble"); + }); + + QUnit.test('The {{link-to}} helper supports bubbles=boundFalseyThing', function () { + _emberGlimmer.setTemplate('about', _emberTemplateCompiler.compile("
    {{#link-to 'about.contact' id='about-contact' bubbles=boundFalseyThing}}About{{/link-to}}
    {{outlet}}")); + _emberGlimmer.setTemplate('about/contact', _emberTemplateCompiler.compile("

    Contact

    ")); + + App.AboutController = _emberRuntime.Controller.extend({ + boundFalseyThing: false + }); + + Router.map(function () { + this.route('about', function () { + this.route('contact'); + }); + }); + + var hidden = 0; + + App.AboutRoute = _emberRouting.Route.extend({ + actions: { + hide: function () { + hidden++; + } + } + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/about'); + }); + _emberMetal.run(function () { + return _emberViews.jQuery('#about-contact', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('#contact', '#qunit-fixture').text(), 'Contact', 'precond - the link worked'); + + equal(hidden, 0, "The link didn't bubble"); + }); + + QUnit.test('The {{link-to}} helper moves into the named route with context', function () { + Router.map(function (match) { + this.route('about'); + this.route('item', { path: '/item/:id' }); + }); + + _emberGlimmer.setTemplate('about', _emberTemplateCompiler.compile("

    List

      {{#each model as |person|}}
    • {{#link-to 'item' person}}{{person.name}}{{/link-to}}
    • {{/each}}
    {{#link-to 'index' id='home-link'}}Home{{/link-to}}")); + + App.AboutRoute = _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.A([{ id: 'yehuda', name: 'Yehuda Katz' }, { id: 'tom', name: 'Tom Dale' }, { id: 'erik', name: 'Erik Brynroflsson' }]); + } + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/about'); + }); + + equal(_emberViews.jQuery('h3:contains(List)', '#qunit-fixture').length, 1, 'The home template was rendered'); + equal(normalizeUrl(_emberViews.jQuery('#home-link').attr('href')), '/', 'The home link points back at /'); + + _emberMetal.run(function () { + return _emberViews.jQuery('li a:contains(Yehuda)', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('h3:contains(Item)', '#qunit-fixture').length, 1, 'The item template was rendered'); + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'Yehuda Katz', 'The name is correct'); + + _emberMetal.run(function () { + return _emberViews.jQuery('#home-link').click(); + }); + _emberMetal.run(function () { + return _emberViews.jQuery('#about-link').click(); + }); + + equal(normalizeUrl(_emberViews.jQuery('li a:contains(Yehuda)').attr('href')), '/item/yehuda'); + equal(normalizeUrl(_emberViews.jQuery('li a:contains(Tom)').attr('href')), '/item/tom'); + equal(normalizeUrl(_emberViews.jQuery('li a:contains(Erik)').attr('href')), '/item/erik'); + + _emberMetal.run(function () { + return _emberViews.jQuery('li a:contains(Erik)', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('h3:contains(Item)', '#qunit-fixture').length, 1, 'The item template was rendered'); + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'Erik Brynroflsson', 'The name is correct'); + }); + + QUnit.test('The {{link-to}} helper binds some anchor html tag common attributes', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("

    Home

    {{#link-to 'index' id='self-link' title='title-attr' rel='rel-attr' tabindex='-1'}}Self{{/link-to}}")); + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + var link = _emberViews.jQuery('#self-link', '#qunit-fixture'); + equal(link.attr('title'), 'title-attr', 'The self-link contains title attribute'); + equal(link.attr('rel'), 'rel-attr', 'The self-link contains rel attribute'); + equal(link.attr('tabindex'), '-1', 'The self-link contains tabindex attribute'); + }); + + QUnit.test('The {{link-to}} helper supports `target` attribute', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("

    Home

    {{#link-to 'index' id='self-link' target='_blank'}}Self{{/link-to}}")); + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + var link = _emberViews.jQuery('#self-link', '#qunit-fixture'); + equal(link.attr('target'), '_blank', 'The self-link contains `target` attribute'); + }); + + QUnit.test('The {{link-to}} helper supports `target` attribute specified as a bound param', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("

    Home

    {{#link-to 'index' id='self-link' target=boundLinkTarget}}Self{{/link-to}}")); + + App.IndexController = _emberRuntime.Controller.extend({ + boundLinkTarget: '_blank' + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + var link = _emberViews.jQuery('#self-link', '#qunit-fixture'); + equal(link.attr('target'), '_blank', 'The self-link contains `target` attribute'); + }); + + QUnit.test('The {{link-to}} helper does not call preventDefault if `target` attribute is provided', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("

    Home

    {{#link-to 'index' id='self-link' target='_blank'}}Self{{/link-to}}")); + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + var event = _emberViews.jQuery.Event('click'); + _emberViews.jQuery('#self-link', '#qunit-fixture').trigger(event); + + equal(event.isDefaultPrevented(), false, 'should not preventDefault when target attribute is specified'); + }); + + QUnit.test('The {{link-to}} helper should preventDefault when `target = _self`', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("

    Home

    {{#link-to 'index' id='self-link' target='_self'}}Self{{/link-to}}")); + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + var event = _emberViews.jQuery.Event('click'); + _emberViews.jQuery('#self-link', '#qunit-fixture').trigger(event); + + equal(event.isDefaultPrevented(), true, 'should preventDefault when target attribute is `_self`'); + }); + + QUnit.test('The {{link-to}} helper should not transition if target is not equal to _self or empty', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("{{#link-to 'about' id='about-link' replace=true target='_blank'}}About{{/link-to}}")); + + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + _emberMetal.run(function () { + return _emberViews.jQuery('#about-link', '#qunit-fixture').click(); + }); + + notEqual(appInstance.lookup('controller:application').get('currentRouteName'), 'about', 'link-to should not transition if target is not equal to _self or empty'); + }); + + QUnit.test('The {{link-to}} helper accepts string/numeric arguments', function () { + Router.map(function () { + this.route('filter', { path: '/filters/:filter' }); + this.route('post', { path: '/post/:post_id' }); + this.route('repo', { path: '/repo/:owner/:name' }); + }); + + App.FilterController = _emberRuntime.Controller.extend({ + filter: 'unpopular', + repo: _emberRuntime.Object.create({ owner: 'ember', name: 'ember.js' }), + post_id: 123 + }); + _emberGlimmer.setTemplate('filter', _emberTemplateCompiler.compile('

    {{filter}}

    {{#link-to "filter" "unpopular" id="link"}}Unpopular{{/link-to}}{{#link-to "filter" filter id="path-link"}}Unpopular{{/link-to}}{{#link-to "post" post_id id="post-path-link"}}Post{{/link-to}}{{#link-to "post" 123 id="post-number-link"}}Post{{/link-to}}{{#link-to "repo" repo id="repo-object-link"}}Repo{{/link-to}}')); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile(' ')); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/filters/popular'); + }); + + equal(normalizeUrl(_emberViews.jQuery('#link', '#qunit-fixture').attr('href')), '/filters/unpopular'); + equal(normalizeUrl(_emberViews.jQuery('#path-link', '#qunit-fixture').attr('href')), '/filters/unpopular'); + equal(normalizeUrl(_emberViews.jQuery('#post-path-link', '#qunit-fixture').attr('href')), '/post/123'); + equal(normalizeUrl(_emberViews.jQuery('#post-number-link', '#qunit-fixture').attr('href')), '/post/123'); + equal(normalizeUrl(_emberViews.jQuery('#repo-object-link', '#qunit-fixture').attr('href')), '/repo/ember/ember.js'); + }); + + QUnit.test("Issue 4201 - Shorthand for route.index shouldn't throw errors about context arguments", function () { + expect(2); + Router.map(function () { + this.route('lobby', function () { + this.route('index', { path: ':lobby_id' }); + this.route('list'); + }); + }); + + App.LobbyIndexRoute = _emberRouting.Route.extend({ + model: function (params) { + equal(params.lobby_id, 'foobar'); + return params.lobby_id; + } + }); + + _emberGlimmer.setTemplate('lobby/index', _emberTemplateCompiler.compile("{{#link-to 'lobby' 'foobar' id='lobby-link'}}Lobby{{/link-to}}")); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('')); + _emberGlimmer.setTemplate('lobby/list', _emberTemplateCompiler.compile("{{#link-to 'lobby' 'foobar' id='lobby-link'}}Lobby{{/link-to}}")); + bootApplication(); + _emberMetal.run(router, 'handleURL', '/lobby/list'); + _emberMetal.run(_emberViews.jQuery('#lobby-link'), 'click'); + shouldBeActive('#lobby-link'); + }); + + QUnit.test('Quoteless route param performs property lookup', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("{{#link-to 'index' id='string-link'}}string{{/link-to}}{{#link-to foo id='path-link'}}path{{/link-to}}")); + + function assertEquality(href) { + equal(normalizeUrl(_emberViews.jQuery('#string-link', '#qunit-fixture').attr('href')), '/'); + equal(normalizeUrl(_emberViews.jQuery('#path-link', '#qunit-fixture').attr('href')), href); + } + + App.IndexController = _emberRuntime.Controller.extend({ + foo: 'index' + }); + + App.Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(router, 'handleURL', '/'); + + assertEquality('/'); + + var controller = appInstance.lookup('controller:index'); + _emberMetal.run(function () { + return controller.set('foo', 'about'); + }); + + assertEquality('/about'); + }); + + QUnit.test('link-to with null/undefined dynamic parameters are put in a loading state', function () { + expect(19); + + var oldWarn = _emberConsole.default.warn; + var warnCalled = false; + _emberConsole.default.warn = function () { + warnCalled = true; + }; + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("{{#link-to destinationRoute routeContext loadingClass='i-am-loading' id='context-link'}}string{{/link-to}}{{#link-to secondRoute loadingClass=loadingClass id='static-link'}}string{{/link-to}}")); + + var thing = _emberRuntime.Object.create({ id: 123 }); + + App.IndexController = _emberRuntime.Controller.extend({ + destinationRoute: null, + routeContext: null, + loadingClass: 'i-am-loading' + }); + + App.AboutRoute = _emberRouting.Route.extend({ + activate: function () { + ok(true, 'About was entered'); + } + }); + + App.Router.map(function () { + this.route('thing', { path: '/thing/:thing_id' }); + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(router, 'handleURL', '/'); + + function assertLinkStatus($link, url) { + if (url) { + equal(normalizeUrl($link.attr('href')), url, 'loaded link-to has expected href'); + ok(!$link.hasClass('i-am-loading'), 'loaded linkComponent has no loadingClass'); + } else { + equal(normalizeUrl($link.attr('href')), '#', "unloaded link-to has href='#'"); + ok($link.hasClass('i-am-loading'), 'loading linkComponent has loadingClass'); + } + } + + var $contextLink = _emberViews.jQuery('#context-link', '#qunit-fixture'); + var $staticLink = _emberViews.jQuery('#static-link', '#qunit-fixture'); + var controller = appInstance.lookup('controller:index'); + + assertLinkStatus($contextLink); + assertLinkStatus($staticLink); + + _emberMetal.run(function () { + warnCalled = false; + $contextLink.click(); + ok(warnCalled, 'Logger.warn was called from clicking loading link'); + }); + + // Set the destinationRoute (context is still null). + _emberMetal.run(controller, 'set', 'destinationRoute', 'thing'); + assertLinkStatus($contextLink); + + // Set the routeContext to an id + _emberMetal.run(controller, 'set', 'routeContext', '456'); + assertLinkStatus($contextLink, '/thing/456'); + + // Test that 0 isn't interpreted as falsy. + _emberMetal.run(controller, 'set', 'routeContext', 0); + assertLinkStatus($contextLink, '/thing/0'); + + // Set the routeContext to an object + _emberMetal.run(controller, 'set', 'routeContext', thing); + assertLinkStatus($contextLink, '/thing/123'); + + // Set the destinationRoute back to null. + _emberMetal.run(controller, 'set', 'destinationRoute', null); + assertLinkStatus($contextLink); + + _emberMetal.run(function () { + warnCalled = false; + $staticLink.click(); + ok(warnCalled, 'Logger.warn was called from clicking loading link'); + }); + + _emberMetal.run(controller, 'set', 'secondRoute', 'about'); + assertLinkStatus($staticLink, '/about'); + + // Click the now-active link + _emberMetal.run($staticLink, 'click'); + + _emberConsole.default.warn = oldWarn; + }); + + QUnit.test('The {{link-to}} helper refreshes href element when one of params changes', function () { + Router.map(function () { + this.route('post', { path: '/posts/:post_id' }); + }); + + var post = _emberRuntime.Object.create({ id: '1' }); + var secondPost = _emberRuntime.Object.create({ id: '2' }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to "post" post id="post"}}post{{/link-to}}')); + + App.IndexController = _emberRuntime.Controller.extend(); + var indexController = appInstance.lookup('controller:index'); + + _emberMetal.run(function () { + return indexController.set('post', post); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + equal(normalizeUrl(_emberViews.jQuery('#post', '#qunit-fixture').attr('href')), '/posts/1', 'precond - Link has rendered href attr properly'); + + _emberMetal.run(function () { + return indexController.set('post', secondPost); + }); + + equal(_emberViews.jQuery('#post', '#qunit-fixture').attr('href'), '/posts/2', 'href attr was updated after one of the params had been changed'); + + _emberMetal.run(function () { + return indexController.set('post', null); + }); + + equal(_emberViews.jQuery('#post', '#qunit-fixture').attr('href'), '#', 'href attr becomes # when one of the arguments in nullified'); + }); + + QUnit.test('The {{link-to}} helper is active when a route is active', function () { + Router.map(function () { + this.route('about', function () { + this.route('item'); + }); + }); + + _emberGlimmer.setTemplate('about', _emberTemplateCompiler.compile("
    {{#link-to 'about' id='about-link'}}About{{/link-to}} {{#link-to 'about.item' id='item-link'}}Item{{/link-to}} {{outlet}}
    ")); + _emberGlimmer.setTemplate('about/item', _emberTemplateCompiler.compile(' ')); + _emberGlimmer.setTemplate('about/index', _emberTemplateCompiler.compile(' ')); + + bootApplication(); + + _emberMetal.run(router, 'handleURL', '/about'); + + equal(_emberViews.jQuery('#about-link.active', '#qunit-fixture').length, 1, 'The about route link is active'); + equal(_emberViews.jQuery('#item-link.active', '#qunit-fixture').length, 0, 'The item route link is inactive'); + + _emberMetal.run(router, 'handleURL', '/about/item'); + + equal(_emberViews.jQuery('#about-link.active', '#qunit-fixture').length, 1, 'The about route link is active'); + equal(_emberViews.jQuery('#item-link.active', '#qunit-fixture').length, 1, 'The item route link is active'); + }); + + QUnit.test("The {{link-to}} helper works in an #each'd array of string route names", function () { + Router.map(function () { + this.route('foo'); + this.route('bar'); + this.route('rar'); + }); + + App.IndexController = _emberRuntime.Controller.extend({ + routeNames: _emberRuntime.A(['foo', 'bar', 'rar']), + route1: 'bar', + route2: 'foo' + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#each routeNames as |routeName|}}{{#link-to routeName}}{{routeName}}{{/link-to}}{{/each}}{{#each routeNames as |r|}}{{#link-to r}}{{r}}{{/link-to}}{{/each}}{{#link-to route1}}a{{/link-to}}{{#link-to route2}}b{{/link-to}}')); + + bootApplication(); + + function linksEqual($links, expected) { + equal($links.length, expected.length, 'Has correct number of links'); + + var idx = undefined; + for (idx = 0; idx < $links.length; idx++) { + var href = _emberViews.jQuery($links[idx]).attr('href'); + // Old IE includes the whole hostname as well + equal(href.slice(-expected[idx].length), expected[idx], 'Expected link to be \'' + expected[idx] + '\', but was \'' + href + '\''); + } + } + + linksEqual(_emberViews.jQuery('a', '#qunit-fixture'), ['/foo', '/bar', '/rar', '/foo', '/bar', '/rar', '/bar', '/foo']); + + var indexController = appInstance.lookup('controller:index'); + _emberMetal.run(indexController, 'set', 'route1', 'rar'); + + linksEqual(_emberViews.jQuery('a', '#qunit-fixture'), ['/foo', '/bar', '/rar', '/foo', '/bar', '/rar', '/rar', '/foo']); + + _emberMetal.run(indexController.routeNames, 'shiftObject'); + + linksEqual(_emberViews.jQuery('a', '#qunit-fixture'), ['/bar', '/rar', '/bar', '/rar', '/rar', '/foo']); + }); + + QUnit.test('The non-block form {{link-to}} helper moves into the named route', function () { + expect(3); + Router.map(function (match) { + this.route('contact'); + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("

    Home

    {{link-to 'Contact us' 'contact' id='contact-link'}}{{#link-to 'index' id='self-link'}}Self{{/link-to}}")); + _emberGlimmer.setTemplate('contact', _emberTemplateCompiler.compile("

    Contact

    {{link-to 'Home' 'index' id='home-link'}}{{link-to 'Self' 'contact' id='self-link'}}")); + + bootApplication(); + + _emberMetal.run(function () { + return _emberViews.jQuery('#contact-link', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('h3:contains(Contact)', '#qunit-fixture').length, 1, 'The contact template was rendered'); + equal(_emberViews.jQuery('#self-link.active', '#qunit-fixture').length, 1, 'The self-link was rendered with active class'); + equal(_emberViews.jQuery('#home-link:not(.active)', '#qunit-fixture').length, 1, 'The other link was rendered without active class'); + }); + + QUnit.test('The non-block form {{link-to}} helper updates the link text when it is a binding', function () { + expect(8); + Router.map(function (match) { + this.route('contact'); + }); + + App.IndexController = _emberRuntime.Controller.extend({ + contactName: 'Jane' + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("

    Home

    {{link-to contactName 'contact' id='contact-link'}}{{#link-to 'index' id='self-link'}}Self{{/link-to}}")); + _emberGlimmer.setTemplate('contact', _emberTemplateCompiler.compile("

    Contact

    {{link-to 'Home' 'index' id='home-link'}}{{link-to 'Self' 'contact' id='self-link'}}")); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + var controller = appInstance.lookup('controller:index'); + + equal(_emberViews.jQuery('#contact-link:contains(Jane)', '#qunit-fixture').length, 1, 'The link title is correctly resolved'); + + _emberMetal.run(function () { + return controller.set('contactName', 'Joe'); + }); + + equal(_emberViews.jQuery('#contact-link:contains(Joe)', '#qunit-fixture').length, 1, 'The link title is correctly updated when the bound property changes'); + + _emberMetal.run(function () { + return controller.set('contactName', 'Robert'); + }); + + equal(_emberViews.jQuery('#contact-link:contains(Robert)', '#qunit-fixture').length, 1, 'The link title is correctly updated when the bound property changes a second time'); + + _emberMetal.run(function () { + return _emberViews.jQuery('#contact-link', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('h3:contains(Contact)', '#qunit-fixture').length, 1, 'The contact template was rendered'); + equal(_emberViews.jQuery('#self-link.active', '#qunit-fixture').length, 1, 'The self-link was rendered with active class'); + equal(_emberViews.jQuery('#home-link:not(.active)', '#qunit-fixture').length, 1, 'The other link was rendered without active class'); + + _emberMetal.run(function () { + return _emberViews.jQuery('#home-link', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('h3:contains(Home)', '#qunit-fixture').length, 1, 'The index template was rendered'); + equal(_emberViews.jQuery('#contact-link:contains(Robert)', '#qunit-fixture').length, 1, 'The link title is correctly updated when the route changes'); + }); + + QUnit.test('The non-block form {{link-to}} helper moves into the named route with context', function () { + expect(5); + + Router.map(function (match) { + this.route('item', { path: '/item/:id' }); + }); + + App.IndexRoute = _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.A([{ id: 'yehuda', name: 'Yehuda Katz' }, { id: 'tom', name: 'Tom Dale' }, { id: 'erik', name: 'Erik Brynroflsson' }]); + } + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("

    Home

      {{#each model as |person|}}
    • {{link-to person.name 'item' person}}
    • {{/each}}
    ")); + _emberGlimmer.setTemplate('item', _emberTemplateCompiler.compile("

    Item

    {{model.name}}

    {{#link-to 'index' id='home-link'}}Home{{/link-to}}")); + + bootApplication(); + + _emberMetal.run(function () { + return _emberViews.jQuery('li a:contains(Yehuda)', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('h3:contains(Item)', '#qunit-fixture').length, 1, 'The item template was rendered'); + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'Yehuda Katz', 'The name is correct'); + + _emberMetal.run(function () { + return _emberViews.jQuery('#home-link').click(); + }); + + equal(normalizeUrl(_emberViews.jQuery('li a:contains(Yehuda)').attr('href')), '/item/yehuda'); + equal(normalizeUrl(_emberViews.jQuery('li a:contains(Tom)').attr('href')), '/item/tom'); + equal(normalizeUrl(_emberViews.jQuery('li a:contains(Erik)').attr('href')), '/item/erik'); + }); + + QUnit.test('The non-block form {{link-to}} performs property lookup', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("{{link-to 'string' 'index' id='string-link'}}{{link-to path foo id='path-link'}}")); + + function assertEquality(href) { + equal(normalizeUrl(_emberViews.jQuery('#string-link', '#qunit-fixture').attr('href')), '/'); + equal(normalizeUrl(_emberViews.jQuery('#path-link', '#qunit-fixture').attr('href')), href); + } + + App.IndexController = _emberRuntime.Controller.extend({ + foo: 'index' + }); + + App.Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(router, 'handleURL', '/'); + + assertEquality('/'); + + var controller = appInstance.lookup('controller:index'); + _emberMetal.run(function () { + return controller.set('foo', 'about'); + }); + + assertEquality('/about'); + }); + + QUnit.test('The non-block form {{link-to}} protects against XSS', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile("{{link-to display 'index' id='link'}}")); + + App.ApplicationController = _emberRuntime.Controller.extend({ + display: 'blahzorz' + }); + + bootApplication(); + + _emberMetal.run(router, 'handleURL', '/'); + + var controller = appInstance.lookup('controller:application'); + + equal(_emberViews.jQuery('#link', '#qunit-fixture').text(), 'blahzorz'); + _emberMetal.run(function () { + return controller.set('display', 'BLAMMO'); + }); + + equal(_emberViews.jQuery('#link', '#qunit-fixture').text(), 'BLAMMO'); + equal(_emberViews.jQuery('b', '#qunit-fixture').length, 0); + }); + + QUnit.test('the {{link-to}} helper calls preventDefault', function () { + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(router, 'handleURL', '/'); + + var event = _emberViews.jQuery.Event('click'); + _emberViews.jQuery('#about-link', '#qunit-fixture').trigger(event); + + equal(event.isDefaultPrevented(), true, 'should preventDefault'); + }); + + QUnit.test('the {{link-to}} helper does not call preventDefault if `preventDefault=false` is passed as an option', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("{{#link-to 'about' id='about-link' preventDefault=false}}About{{/link-to}}")); + + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(router, 'handleURL', '/'); + + var event = _emberViews.jQuery.Event('click'); + _emberViews.jQuery('#about-link', '#qunit-fixture').trigger(event); + + equal(event.isDefaultPrevented(), false, 'should not preventDefault'); + }); + + QUnit.test('the {{link-to}} helper does not call preventDefault if `preventDefault=boundFalseyThing` is passed as an option', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("{{#link-to 'about' id='about-link' preventDefault=boundFalseyThing}}About{{/link-to}}")); + + App.IndexController = _emberRuntime.Controller.extend({ + boundFalseyThing: false + }); + + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(router, 'handleURL', '/'); + + var event = _emberViews.jQuery.Event('click'); + _emberViews.jQuery('#about-link', '#qunit-fixture').trigger(event); + + equal(event.isDefaultPrevented(), false, 'should not preventDefault'); + }); + + QUnit.test('the {{link-to}} helper throws a useful error if you invoke it wrong', function () { + expect(1); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile("{{#link-to 'post'}}Post{{/link-to}}")); + + Router.map(function () { + this.route('post', { path: 'post/:post_id' }); + }); + + QUnit.throws(function () { + bootApplication(); + }, /(You attempted to define a `\{\{link-to "post"\}\}` but did not pass the parameters required for generating its dynamic segments.|You must provide param `post_id` to `generate`)/); + }); + + QUnit.test('the {{link-to}} helper does not throw an error if its route has exited', function () { + expect(0); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile("{{#link-to 'index' id='home-link'}}Home{{/link-to}}{{#link-to 'post' defaultPost id='default-post-link'}}Default Post{{/link-to}}{{#if currentPost}}{{#link-to 'post' currentPost id='current-post-link'}}Current Post{{/link-to}}{{/if}}")); + + App.ApplicationController = _emberRuntime.Controller.extend({ + defaultPost: { id: 1 }, + postController: _emberRuntime.inject.controller('post'), + currentPost: _emberMetal.alias('postController.model') + }); + + App.PostController = _emberRuntime.Controller.extend(); + + App.PostRoute = _emberRouting.Route.extend({ + model: function () { + return { id: 2 }; + }, + serialize: function (model) { + return { post_id: model.id }; + } + }); + + Router.map(function () { + this.route('post', { path: 'post/:post_id' }); + }); + + bootApplication(); + + _emberMetal.run(router, 'handleURL', '/'); + + _emberMetal.run(function () { + return _emberViews.jQuery('#default-post-link', '#qunit-fixture').click(); + }); + _emberMetal.run(function () { + return _emberViews.jQuery('#home-link', '#qunit-fixture').click(); + }); + _emberMetal.run(function () { + return _emberViews.jQuery('#current-post-link', '#qunit-fixture').click(); + }); + _emberMetal.run(function () { + return _emberViews.jQuery('#home-link', '#qunit-fixture').click(); + }); + }); + + QUnit.test('{{link-to}} active property respects changing parent route context', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile("{{link-to 'OMG' 'things' 'omg' id='omg-link'}} " + "{{link-to 'LOL' 'things' 'lol' id='lol-link'}} ")); + + Router.map(function () { + this.route('things', { path: '/things/:name' }, function () { + this.route('other'); + }); + }); + + bootApplication(); + + _emberMetal.run(router, 'handleURL', '/things/omg'); + shouldBeActive('#omg-link'); + shouldNotBeActive('#lol-link'); + + _emberMetal.run(router, 'handleURL', '/things/omg/other'); + shouldBeActive('#omg-link'); + shouldNotBeActive('#lol-link'); + }); + + QUnit.test('{{link-to}} populates href with default query param values even without query-params object', function () { + App.IndexController = _emberRuntime.Controller.extend({ + queryParams: ['foo'], + foo: '123' + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("{{#link-to 'index' id='the-link'}}Index{{/link-to}}")); + bootApplication(); + equal(_emberViews.jQuery('#the-link').attr('href'), '/', 'link has right href'); + }); + + QUnit.test('{{link-to}} populates href with default query param values with empty query-params object', function () { + App.IndexController = _emberRuntime.Controller.extend({ + queryParams: ['foo'], + foo: '123' + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("{{#link-to 'index' (query-params) id='the-link'}}Index{{/link-to}}")); + bootApplication(); + equal(_emberViews.jQuery('#the-link').attr('href'), '/', 'link has right href'); + }); + + QUnit.test('{{link-to}} with only query-params and a block updates when route changes', function () { + Router.map(function () { + this.route('about'); + }); + + App.ApplicationController = _emberRuntime.Controller.extend({ + queryParams: ['foo', 'bar'], + foo: '123', + bar: 'yes' + }); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{#link-to (query-params foo=\'456\' bar=\'NAW\') id=\'the-link\'}}Index{{/link-to}}')); + bootApplication(); + equal(_emberViews.jQuery('#the-link').attr('href'), '/?bar=NAW&foo=456', 'link has right href'); + + _emberMetal.run(function () { + return router.handleURL('/about'); + }); + + equal(_emberViews.jQuery('#the-link').attr('href'), '/about?bar=NAW&foo=456', 'link has right href'); + }); + + QUnit.test('Block-less {{link-to}} with only query-params updates when route changes', function () { + Router.map(function () { + this.route('about'); + }); + + App.ApplicationController = _emberRuntime.Controller.extend({ + queryParams: ['foo', 'bar'], + foo: '123', + bar: 'yes' + }); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{link-to "Index" (query-params foo=\'456\' bar=\'NAW\') id=\'the-link\'}}')); + bootApplication(); + equal(_emberViews.jQuery('#the-link').attr('href'), '/?bar=NAW&foo=456', 'link has right href'); + + _emberMetal.run(function () { + return router.handleURL('/about'); + }); + + equal(_emberViews.jQuery('#the-link').attr('href'), '/about?bar=NAW&foo=456', 'link has right href'); + }); + + QUnit.test('The {{link-to}} helper can use dynamic params', function () { + Router.map(function (match) { + this.route('foo', { path: 'foo/:some/:thing' }); + this.route('bar', { path: 'bar/:some/:thing/:else' }); + }); + + var controller = undefined; + App.IndexController = _emberRuntime.Controller.extend({ + init: function () { + this._super.apply(this, arguments); + + controller = this; + + this.dynamicLinkParams = ['foo', 'one', 'two']; + } + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('\n

    Home

    \n\n {{#link-to params=dynamicLinkParams id="dynamic-link"}}Dynamic{{/link-to}}\n ')); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + var link = _emberViews.jQuery('#dynamic-link', '#qunit-fixture'); + + equal(link.attr('href'), '/foo/one/two'); + + _emberMetal.run(function () { + controller.set('dynamicLinkParams', ['bar', 'one', 'two', 'three']); + }); + + equal(link.attr('href'), '/bar/one/two/three'); + }); + + QUnit.test('GJ: {{link-to}} to a parent root model hook which performs a `transitionTo` has correct active class #13256', function () { + expect(1); + + Router.map(function () { + this.route('parent', function () { + this.route('child'); + }); + }); + + App.ParentRoute = _emberRouting.Route.extend({ + afterModel: function (transition) { + this.transitionTo('parent.child'); + } + }); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('\n {{link-to \'Parent\' \'parent\' id=\'parent-link\'}}\n ')); + + bootApplication(); + + _emberMetal.run(_emberViews.jQuery('#parent-link'), 'click'); + + shouldBeActive('#parent-link'); + }); +}); +enifed('ember/tests/helpers/link_to_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/helpers'); + test('ember/tests/helpers/link_to_test.js should pass jscs', function () { + ok(true, 'ember/tests/helpers/link_to_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/helpers/link_to_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/helpers'); + QUnit.test('ember/tests/helpers/link_to_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/helpers/link_to_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test', ['exports', 'ember-runtime', 'ember-routing', 'ember-metal', 'ember-template-compiler', 'ember-application', 'ember-views', 'ember-glimmer'], function (exports, _emberRuntime, _emberRouting, _emberMetal, _emberTemplateCompiler, _emberApplication, _emberViews, _emberGlimmer) { + 'use strict'; + + var Router = undefined, + App = undefined, + router = undefined, + registry = undefined, + container = undefined; + + var aboutDefer = undefined, + otherDefer = undefined; + + function bootApplication() { + router = container.lookup('router:main'); + _emberMetal.run(App, 'advanceReadiness'); + } + + function assertHasClass(className) { + var i = 1; + while (i < arguments.length) { + var $a = arguments[i]; + var shouldHaveClass = arguments[i + 1]; + equal($a.hasClass(className), shouldHaveClass, $a.attr('id') + ' should ' + (shouldHaveClass ? '' : 'not ') + 'have class ' + className); + i += 2; + } + } + + var updateCount = undefined, + replaceCount = undefined; + + function sharedSetup() { + App = _emberApplication.Application.create({ + name: 'App', + rootElement: '#qunit-fixture' + }); + + App.deferReadiness(); + + updateCount = replaceCount = 0; + App.Router.reopen({ + location: _emberRouting.NoneLocation.create({ + setURL: function (path) { + updateCount++; + _emberMetal.set(this, 'path', path); + }, + + replaceURL: function (path) { + replaceCount++; + _emberMetal.set(this, 'path', path); + } + }) + }); + + Router = App.Router; + registry = App.__registry__; + container = App.__container__; + } + + function sharedTeardown() { + _emberMetal.run(function () { + return App.destroy(); + }); + _emberGlimmer.setTemplates({}); + } + + QUnit.module('The {{link-to}} helper: .transitioning-in .transitioning-out CSS classes', { + setup: function () { + _emberMetal.run(function () { + sharedSetup(); + + registry.unregister('router:main'); + registry.register('router:main', Router); + + Router.map(function () { + this.route('about'); + this.route('other'); + }); + + App.AboutRoute = _emberRouting.Route.extend({ + model: function () { + aboutDefer = _emberRuntime.RSVP.defer(); + return aboutDefer.promise; + } + }); + + App.OtherRoute = _emberRouting.Route.extend({ + model: function () { + otherDefer = _emberRuntime.RSVP.defer(); + return otherDefer.promise; + } + }); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet}}{{link-to \'Index\' \'index\' id=\'index-link\'}}{{link-to \'About\' \'about\' id=\'about-link\'}}{{link-to \'Other\' \'other\' id=\'other-link\'}}')); + }); + }, + + teardown: function () { + sharedTeardown(); + aboutDefer = null; + } + }); + + QUnit.test('while a transition is underway', function () { + expect(18); + bootApplication(); + + var $index = _emberViews.jQuery('#index-link'); + var $about = _emberViews.jQuery('#about-link'); + var $other = _emberViews.jQuery('#other-link'); + + _emberMetal.run($about, 'click'); + + assertHasClass('active', $index, true, $about, false, $other, false); + assertHasClass('ember-transitioning-in', $index, false, $about, true, $other, false); + assertHasClass('ember-transitioning-out', $index, true, $about, false, $other, false); + + _emberMetal.run(aboutDefer, 'resolve'); + + assertHasClass('active', $index, false, $about, true, $other, false); + assertHasClass('ember-transitioning-in', $index, false, $about, false, $other, false); + assertHasClass('ember-transitioning-out', $index, false, $about, false, $other, false); + }); + + QUnit.test('while a transition is underway with nested link-to\'s', function () { + expect(54); + + Router.map(function () { + this.route('parent-route', function () { + this.route('about'); + this.route('other'); + }); + }); + + App.ParentRouteAboutRoute = _emberRouting.Route.extend({ + model: function () { + aboutDefer = _emberRuntime.RSVP.defer(); + return aboutDefer.promise; + } + }); + + App.ParentRouteOtherRoute = _emberRouting.Route.extend({ + model: function () { + otherDefer = _emberRuntime.RSVP.defer(); + return otherDefer.promise; + } + }); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('\n {{outlet}}\n {{#link-to \'index\' tagName=\'li\'}}\n {{link-to \'Index\' \'index\' id=\'index-link\'}}\n {{/link-to}}\n {{#link-to \'parent-route.about\' tagName=\'li\'}}\n {{link-to \'About\' \'parent-route.about\' id=\'about-link\'}}\n {{/link-to}}\n {{#link-to \'parent-route.other\' tagName=\'li\'}}\n {{link-to \'Other\' \'parent-route.other\' id=\'other-link\'}}\n {{/link-to}}\n ')); + + bootApplication(); + + var $index = _emberViews.jQuery('#index-link'); + var $about = _emberViews.jQuery('#about-link'); + var $other = _emberViews.jQuery('#other-link'); + + _emberMetal.run($about, 'click'); + + assertHasClass('active', $index, true, $about, false, $other, false); + assertHasClass('ember-transitioning-in', $index, false, $about, true, $other, false); + assertHasClass('ember-transitioning-out', $index, true, $about, false, $other, false); + + _emberMetal.run(aboutDefer, 'resolve'); + + assertHasClass('active', $index, false, $about, true, $other, false); + assertHasClass('ember-transitioning-in', $index, false, $about, false, $other, false); + assertHasClass('ember-transitioning-out', $index, false, $about, false, $other, false); + + _emberMetal.run($other, 'click'); + + assertHasClass('active', $index, false, $about, true, $other, false); + assertHasClass('ember-transitioning-in', $index, false, $about, false, $other, true); + assertHasClass('ember-transitioning-out', $index, false, $about, true, $other, false); + + _emberMetal.run(otherDefer, 'resolve'); + + assertHasClass('active', $index, false, $about, false, $other, true); + assertHasClass('ember-transitioning-in', $index, false, $about, false, $other, false); + assertHasClass('ember-transitioning-out', $index, false, $about, false, $other, false); + + _emberMetal.run($about, 'click'); + + assertHasClass('active', $index, false, $about, false, $other, true); + assertHasClass('ember-transitioning-in', $index, false, $about, true, $other, false); + assertHasClass('ember-transitioning-out', $index, false, $about, false, $other, true); + + _emberMetal.run(aboutDefer, 'resolve'); + + assertHasClass('active', $index, false, $about, true, $other, false); + assertHasClass('ember-transitioning-in', $index, false, $about, false, $other, false); + assertHasClass('ember-transitioning-out', $index, false, $about, false, $other, false); + }); +}); +enifed('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/helpers/link_to_test'); + test('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js should pass jscs', function () { + ok(true, 'ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/helpers/link_to_test'); + QUnit.test('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/helpers/link_to_test/link_to_with_query_params_test', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing', 'ember-template-compiler', 'ember-application', 'ember-views', 'ember-glimmer'], function (exports, _emberMetal, _emberRuntime, _emberRouting, _emberTemplateCompiler, _emberApplication, _emberViews, _emberGlimmer) { + 'use strict'; + + var Router = undefined, + App = undefined, + router = undefined, + registry = undefined, + container = undefined; + + function bootApplication() { + router = container.lookup('router:main'); + _emberMetal.run(App, 'advanceReadiness'); + } + + function shouldNotBeActive(selector) { + checkActive(selector, false); + } + + function shouldBeActive(selector) { + checkActive(selector, true); + } + + function checkActive(selector, active) { + var classList = _emberViews.jQuery(selector, '#qunit-fixture')[0].className; + equal(classList.indexOf('active') > -1, active, selector + ' active should be ' + active.toString()); + } + + var updateCount = undefined, + replaceCount = undefined; + + function sharedSetup() { + App = _emberApplication.Application.create({ + name: 'App', + rootElement: '#qunit-fixture' + }); + + App.deferReadiness(); + + updateCount = replaceCount = 0; + App.Router.reopen({ + location: _emberRouting.NoneLocation.create({ + setURL: function (path) { + updateCount++; + _emberMetal.set(this, 'path', path); + }, + + replaceURL: function (path) { + replaceCount++; + _emberMetal.set(this, 'path', path); + } + }) + }); + + Router = App.Router; + registry = App.__registry__; + container = App.__container__; + } + + function sharedTeardown() { + _emberMetal.run(function () { + return App.destroy(); + }); + _emberGlimmer.setTemplates({}); + } + + QUnit.module('The {{link-to}} helper: invoking with query params', { + setup: function () { + _emberMetal.run(function () { + sharedSetup(); + + App.IndexController = _emberRuntime.Controller.extend({ + queryParams: ['foo', 'bar', 'abool'], + foo: '123', + bar: 'abc', + boundThing: 'OMG', + abool: true + }); + + App.AboutController = _emberRuntime.Controller.extend({ + queryParams: ['baz', 'bat'], + baz: 'alex', + bat: 'borf' + }); + + registry.unregister('router:main'); + registry.register('router:main', Router); + }); + }, + + teardown: sharedTeardown + }); + + QUnit.test('doesn\'t update controller QP properties on current route when invoked', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to \'index\' id=\'the-link\'}}Index{{/link-to}}')); + bootApplication(); + + _emberMetal.run(_emberViews.jQuery('#the-link'), 'click'); + var indexController = container.lookup('controller:index'); + deepEqual(indexController.getProperties('foo', 'bar'), { foo: '123', bar: 'abc' }, 'controller QP properties not'); + }); + + QUnit.test('doesn\'t update controller QP properties on current route when invoked (empty query-params obj)', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to \'index\' (query-params) id=\'the-link\'}}Index{{/link-to}}')); + bootApplication(); + + _emberMetal.run(_emberViews.jQuery('#the-link'), 'click'); + var indexController = container.lookup('controller:index'); + deepEqual(indexController.getProperties('foo', 'bar'), { foo: '123', bar: 'abc' }, 'controller QP properties not'); + }); + + QUnit.test('link-to with no params throws', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to id=\'the-link\'}}Index{{/link-to}}')); + expectAssertion(function () { + return bootApplication(); + }, /one or more/); + }); + + QUnit.test('doesn\'t update controller QP properties on current route when invoked (empty query-params obj, inferred route)', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to (query-params) id=\'the-link\'}}Index{{/link-to}}')); + bootApplication(); + + _emberMetal.run(_emberViews.jQuery('#the-link'), 'click'); + var indexController = container.lookup('controller:index'); + deepEqual(indexController.getProperties('foo', 'bar'), { foo: '123', bar: 'abc' }, 'controller QP properties not'); + }); + + QUnit.test('updates controller QP properties on current route when invoked', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to \'index\' (query-params foo=\'456\') id=\'the-link\'}}Index{{/link-to}}')); + bootApplication(); + + _emberMetal.run(_emberViews.jQuery('#the-link'), 'click'); + var indexController = container.lookup('controller:index'); + deepEqual(indexController.getProperties('foo', 'bar'), { foo: '456', bar: 'abc' }, 'controller QP properties updated'); + }); + + QUnit.test('updates controller QP properties on current route when invoked (inferred route)', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to (query-params foo=\'456\') id=\'the-link\'}}Index{{/link-to}}')); + bootApplication(); + + _emberMetal.run(_emberViews.jQuery('#the-link'), 'click'); + var indexController = container.lookup('controller:index'); + deepEqual(indexController.getProperties('foo', 'bar'), { foo: '456', bar: 'abc' }, 'controller QP properties updated'); + }); + + QUnit.test('updates controller QP properties on other route after transitioning to that route', function () { + Router.map(function () { + this.route('about'); + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to \'about\' (query-params baz=\'lol\') id=\'the-link\'}}About{{/link-to}}')); + bootApplication(); + + equal(_emberViews.jQuery('#the-link').attr('href'), '/about?baz=lol'); + _emberMetal.run(_emberViews.jQuery('#the-link'), 'click'); + var aboutController = container.lookup('controller:about'); + deepEqual(aboutController.getProperties('baz', 'bat'), { baz: 'lol', bat: 'borf' }, 'about controller QP properties updated'); + + equal(container.lookup('controller:application').get('currentPath'), 'about'); + }); + + QUnit.test('supplied QP properties can be bound', function () { + var indexController = container.lookup('controller:index'); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to (query-params foo=boundThing) id=\'the-link\'}}Index{{/link-to}}')); + + bootApplication(); + + equal(_emberViews.jQuery('#the-link').attr('href'), '/?foo=OMG'); + _emberMetal.run(indexController, 'set', 'boundThing', 'ASL'); + equal(_emberViews.jQuery('#the-link').attr('href'), '/?foo=ASL'); + }); + + QUnit.test('supplied QP properties can be bound (booleans)', function () { + var indexController = container.lookup('controller:index'); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to (query-params abool=boundThing) id=\'the-link\'}}Index{{/link-to}}')); + + bootApplication(); + + equal(_emberViews.jQuery('#the-link').attr('href'), '/?abool=OMG'); + _emberMetal.run(indexController, 'set', 'boundThing', false); + equal(_emberViews.jQuery('#the-link').attr('href'), '/?abool=false'); + + _emberMetal.run(_emberViews.jQuery('#the-link'), 'click'); + + deepEqual(indexController.getProperties('foo', 'bar', 'abool'), { foo: '123', bar: 'abc', abool: false }); + }); + + QUnit.test('href updates when unsupplied controller QP props change', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to (query-params foo=\'lol\') id=\'the-link\'}}Index{{/link-to}}')); + + bootApplication(); + var indexController = container.lookup('controller:index'); + + equal(_emberViews.jQuery('#the-link').attr('href'), '/?foo=lol'); + _emberMetal.run(indexController, 'set', 'bar', 'BORF'); + equal(_emberViews.jQuery('#the-link').attr('href'), '/?bar=BORF&foo=lol'); + _emberMetal.run(indexController, 'set', 'foo', 'YEAH'); + equal(_emberViews.jQuery('#the-link').attr('href'), '/?bar=BORF&foo=lol'); + }); + + QUnit.test('The {{link-to}} with only query params always transitions to the current route with the query params applied', function () { + // Test harness for bug #12033 + + _emberGlimmer.setTemplate('cars', _emberTemplateCompiler.compile('\n {{#link-to \'cars.create\' id=\'create-link\'}}Create new car{{/link-to}}\n {{#link-to (query-params page=\'2\') id=\'page2-link\'}}Page 2{{/link-to}}\n {{outlet}}\n ')); + + _emberGlimmer.setTemplate('cars/create', _emberTemplateCompiler.compile('{{#link-to \'cars\' id=\'close-link\'}}Close create form{{/link-to}}')); + + Router.map(function () { + this.route('cars', function () { + this.route('create'); + }); + }); + + App.CarsController = _emberRuntime.Controller.extend({ + queryParams: ['page'], + page: 1 + }); + + bootApplication(); + + var carsController = container.lookup('controller:cars'); + + _emberMetal.run(function () { + return router.handleURL('/cars/create'); + }); + + _emberMetal.run(function () { + equal(router.currentRouteName, 'cars.create'); + _emberViews.jQuery('#close-link').click(); + }); + + _emberMetal.run(function () { + equal(router.currentRouteName, 'cars.index'); + equal(router.get('url'), '/cars'); + equal(carsController.get('page'), 1, 'The page query-param is 1'); + _emberViews.jQuery('#page2-link').click(); + }); + + _emberMetal.run(function () { + equal(router.currentRouteName, 'cars.index', 'The active route is still cars'); + equal(router.get('url'), '/cars?page=2', 'The url has been updated'); + equal(carsController.get('page'), 2, 'The query params have been updated'); + }); + }); + + QUnit.test('The {{link-to}} applies activeClass when query params are not changed', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('\n {{#link-to (query-params foo=\'cat\') id=\'cat-link\'}}Index{{/link-to}}\n {{#link-to (query-params foo=\'dog\') id=\'dog-link\'}}Index{{/link-to}}\n {{#link-to \'index\' id=\'change-nothing\'}}Index{{/link-to}}\n ')); + + _emberGlimmer.setTemplate('search', _emberTemplateCompiler.compile('\n {{#link-to (query-params search=\'same\') id=\'same-search\'}}Index{{/link-to}}\n {{#link-to (query-params search=\'change\') id=\'change-search\'}}Index{{/link-to}}\n {{#link-to (query-params search=\'same\' archive=true) id=\'same-search-add-archive\'}}Index{{/link-to}}\n {{#link-to (query-params archive=true) id=\'only-add-archive\'}}Index{{/link-to}}\n {{#link-to (query-params search=\'same\' archive=true) id=\'both-same\'}}Index{{/link-to}}\n {{#link-to (query-params search=\'different\' archive=true) id=\'change-one\'}}Index{{/link-to}}\n {{#link-to (query-params search=\'different\' archive=false) id=\'remove-one\'}}Index{{/link-to}}\n {{outlet}}\n ')); + + _emberGlimmer.setTemplate('search/results', _emberTemplateCompiler.compile('\n {{#link-to (query-params sort=\'title\') id=\'same-sort-child-only\'}}Index{{/link-to}}\n {{#link-to (query-params search=\'same\') id=\'same-search-parent-only\'}}Index{{/link-to}}\n {{#link-to (query-params search=\'change\') id=\'change-search-parent-only\'}}Index{{/link-to}}\n {{#link-to (query-params search=\'same\' sort=\'title\') id=\'same-search-same-sort-child-and-parent\'}}Index{{/link-to}}\n {{#link-to (query-params search=\'same\' sort=\'author\') id=\'same-search-different-sort-child-and-parent\'}}Index{{/link-to}}\n {{#link-to (query-params search=\'change\' sort=\'title\') id=\'change-search-same-sort-child-and-parent\'}}Index{{/link-to}}\n {{#link-to (query-params foo=\'dog\') id=\'dog-link\'}}Index{{/link-to}}\n ')); + + Router.map(function () { + this.route('search', function () { + this.route('results'); + }); + }); + + App.SearchController = _emberRuntime.Controller.extend({ + queryParams: ['search', 'archive'], + search: '', + archive: false + }); + + App.SearchResultsController = _emberRuntime.Controller.extend({ + queryParams: ['sort', 'showDetails'], + sort: 'title', + showDetails: true + }); + + bootApplication(); + + //Basic tests + shouldNotBeActive('#cat-link'); + shouldNotBeActive('#dog-link'); + _emberMetal.run(router, 'handleURL', '/?foo=cat'); + shouldBeActive('#cat-link'); + shouldNotBeActive('#dog-link'); + _emberMetal.run(router, 'handleURL', '/?foo=dog'); + shouldBeActive('#dog-link'); + shouldNotBeActive('#cat-link'); + shouldBeActive('#change-nothing'); + + //Multiple params + _emberMetal.run(function () { + return router.handleURL('/search?search=same'); + }); + shouldBeActive('#same-search'); + shouldNotBeActive('#change-search'); + shouldNotBeActive('#same-search-add-archive'); + shouldNotBeActive('#only-add-archive'); + shouldNotBeActive('#remove-one'); + + _emberMetal.run(function () { + return router.handleURL('/search?search=same&archive=true'); + }); + + shouldBeActive('#both-same'); + shouldNotBeActive('#change-one'); + + //Nested Controllers + _emberMetal.run(function () { + // Note: this is kind of a strange case; sort's default value is 'title', + // so this URL shouldn't have been generated in the first place, but + // we should also be able to gracefully handle these cases. + router.handleURL('/search/results?search=same&sort=title&showDetails=true'); + }); + //shouldBeActive('#same-sort-child-only'); + shouldBeActive('#same-search-parent-only'); + shouldNotBeActive('#change-search-parent-only'); + shouldBeActive('#same-search-same-sort-child-and-parent'); + shouldNotBeActive('#same-search-different-sort-child-and-parent'); + shouldNotBeActive('#change-search-same-sort-child-and-parent'); + }); + + QUnit.test('The {{link-to}} applies active class when query-param is number', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('\n {{#link-to (query-params page=pageNumber) id=\'page-link\'}}Index{{/link-to}}\n ')); + + App.IndexController = _emberRuntime.Controller.extend({ + queryParams: ['page'], + page: 1, + pageNumber: 5 + }); + + bootApplication(); + + shouldNotBeActive('#page-link'); + _emberMetal.run(router, 'handleURL', '/?page=5'); + shouldBeActive('#page-link'); + }); + + QUnit.test('The {{link-to}} applies active class when query-param is array', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('\n {{#link-to (query-params pages=pagesArray) id=\'array-link\'}}Index{{/link-to}}\n {{#link-to (query-params pages=biggerArray) id=\'bigger-link\'}}Index{{/link-to}}\n {{#link-to (query-params pages=emptyArray) id=\'empty-link\'}}Index{{/link-to}}\n ')); + + App.IndexController = _emberRuntime.Controller.extend({ + queryParams: ['pages'], + pages: [], + pagesArray: [1, 2], + biggerArray: [1, 2, 3], + emptyArray: [] + }); + + bootApplication(); + + shouldNotBeActive('#array-link'); + _emberMetal.run(router, 'handleURL', '/?pages=%5B1%2C2%5D'); + shouldBeActive('#array-link'); + shouldNotBeActive('#bigger-link'); + shouldNotBeActive('#empty-link'); + _emberMetal.run(router, 'handleURL', '/?pages=%5B2%2C1%5D'); + shouldNotBeActive('#array-link'); + shouldNotBeActive('#bigger-link'); + shouldNotBeActive('#empty-link'); + _emberMetal.run(router, 'handleURL', '/?pages=%5B1%2C2%2C3%5D'); + shouldBeActive('#bigger-link'); + shouldNotBeActive('#array-link'); + shouldNotBeActive('#empty-link'); + }); + + QUnit.test('The {{link-to}} helper applies active class to parent route', function () { + App.Router.map(function () { + this.route('parent', function () { + this.route('child'); + }); + }); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('\n {{#link-to \'parent\' id=\'parent-link\'}}Parent{{/link-to}}\n {{#link-to \'parent.child\' id=\'parent-child-link\'}}Child{{/link-to}}\n {{#link-to \'parent\' (query-params foo=cat) id=\'parent-link-qp\'}}Parent{{/link-to}}\n {{outlet}}\n ')); + + App.ParentChildController = _emberRuntime.Controller.extend({ + queryParams: ['foo'], + foo: 'bar' + }); + + bootApplication(); + shouldNotBeActive('#parent-link'); + shouldNotBeActive('#parent-child-link'); + shouldNotBeActive('#parent-link-qp'); + _emberMetal.run(router, 'handleURL', '/parent/child?foo=dog'); + shouldBeActive('#parent-link'); + shouldNotBeActive('#parent-link-qp'); + }); + + QUnit.test('The {{link-to}} helper disregards query-params in activeness computation when current-when specified', function () { + App.Router.map(function () { + this.route('parent'); + }); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('\n {{#link-to \'parent\' (query-params page=1) current-when=\'parent\' id=\'app-link\'}}Parent{{/link-to}} {{outlet}}\n ')); + _emberGlimmer.setTemplate('parent', _emberTemplateCompiler.compile('\n {{#link-to \'parent\' (query-params page=1) current-when=\'parent\' id=\'parent-link\'}}Parent{{/link-to}} {{outlet}}\n ')); + + App.ParentController = _emberRuntime.Controller.extend({ + queryParams: ['page'], + page: 1 + }); + + bootApplication(); + equal(_emberViews.jQuery('#app-link').attr('href'), '/parent'); + shouldNotBeActive('#app-link'); + + _emberMetal.run(router, 'handleURL', '/parent?page=2'); + equal(_emberViews.jQuery('#app-link').attr('href'), '/parent'); + shouldBeActive('#app-link'); + equal(_emberViews.jQuery('#parent-link').attr('href'), '/parent'); + shouldBeActive('#parent-link'); + + var parentController = container.lookup('controller:parent'); + equal(parentController.get('page'), 2); + _emberMetal.run(parentController, 'set', 'page', 3); + equal(router.get('location.path'), '/parent?page=3'); + shouldBeActive('#app-link'); + shouldBeActive('#parent-link'); + + _emberViews.jQuery('#app-link').click(); + equal(router.get('location.path'), '/parent'); + }); + + QUnit.test('link-to default query params while in active transition regression test', function () { + App.Router.map(function () { + this.route('foos'); + this.route('bars'); + }); + var foos = _emberRuntime.RSVP.defer(); + var bars = _emberRuntime.RSVP.defer(); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('\n {{link-to \'Foos\' \'foos\' id=\'foos-link\'}}\n {{link-to \'Baz Foos\' \'foos\' (query-params baz=true) id=\'baz-foos-link\'}}\n {{link-to \'Quux Bars\' \'bars\' (query-params quux=true) id=\'bars-link\'}}\n ')); + + App.FoosController = _emberRuntime.Controller.extend({ + queryParams: ['status'], + baz: false + }); + + App.FoosRoute = _emberRouting.Route.extend({ + model: function () { + return foos.promise; + } + }); + + App.BarsController = _emberRuntime.Controller.extend({ + queryParams: ['status'], + quux: false + }); + + App.BarsRoute = _emberRouting.Route.extend({ + model: function () { + return bars.promise; + } + }); + + bootApplication(); + equal(_emberViews.jQuery('#foos-link').attr('href'), '/foos'); + equal(_emberViews.jQuery('#baz-foos-link').attr('href'), '/foos?baz=true'); + equal(_emberViews.jQuery('#bars-link').attr('href'), '/bars?quux=true'); + + equal(router.get('location.path'), ''); + + shouldNotBeActive('#foos-link'); + shouldNotBeActive('#baz-foos-link'); + shouldNotBeActive('#bars-link'); + + _emberMetal.run(_emberViews.jQuery('#bars-link'), 'click'); + shouldNotBeActive('#bars-link'); + + _emberMetal.run(_emberViews.jQuery('#foos-link'), 'click'); + shouldNotBeActive('#foos-link'); + + _emberMetal.run(foos, 'resolve'); + + equal(router.get('location.path'), '/foos'); + shouldBeActive('#foos-link'); + }); +}); +enifed('ember/tests/helpers/link_to_test/link_to_with_query_params_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/helpers/link_to_test'); + test('ember/tests/helpers/link_to_test/link_to_with_query_params_test.js should pass jscs', function () { + ok(true, 'ember/tests/helpers/link_to_test/link_to_with_query_params_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/helpers/link_to_test/link_to_with_query_params_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/helpers/link_to_test'); + QUnit.test('ember/tests/helpers/link_to_test/link_to_with_query_params_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/helpers/link_to_test/link_to_with_query_params_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/homepage_example_test', ['exports', 'ember-routing', 'ember-metal', 'ember-application', 'ember-runtime', 'ember-template-compiler', 'ember-views', 'ember-glimmer'], function (exports, _emberRouting, _emberMetal, _emberApplication, _emberRuntime, _emberTemplateCompiler, _emberViews, _emberGlimmer) { + 'use strict'; + + var App = undefined, + $fixture = undefined; + + function setupExample() { + // setup templates + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    People

      {{#each model as |person|}}
    • Hello, {{person.fullName}}!
    • {{/each}}
    ')); + + App.Person = _emberRuntime.Object.extend({ + firstName: null, + lastName: null, + + fullName: _emberMetal.computed('firstName', 'lastName', function () { + return this.get('firstName') + ' ' + this.get('lastName'); + }) + }); + + App.IndexRoute = _emberRouting.Route.extend({ + model: function () { + var people = _emberRuntime.A([App.Person.create({ + firstName: 'Tom', + lastName: 'Dale' + }), App.Person.create({ + firstName: 'Yehuda', + lastName: 'Katz' + })]); + return people; + } + }); + } + + QUnit.module('Homepage Example', { + setup: function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create({ + name: 'App', + rootElement: '#qunit-fixture' + }); + App.deferReadiness(); + + App.Router.reopen({ + location: 'none' + }); + + App.LoadingRoute = _emberRouting.Route.extend(); + }); + + $fixture = _emberViews.jQuery('#qunit-fixture'); + setupExample(); + }, + + teardown: function () { + _emberMetal.run(function () { + return App.destroy(); + }); + + App = null; + + _emberGlimmer.setTemplates({}); + } + }); + + QUnit.test('The example renders correctly', function () { + _emberMetal.run(App, 'advanceReadiness'); + + equal($fixture.find('h1:contains(People)').length, 1); + equal($fixture.find('li').length, 2); + equal($fixture.find('li:nth-of-type(1)').text(), 'Hello, Tom Dale!'); + equal($fixture.find('li:nth-of-type(2)').text(), 'Hello, Yehuda Katz!'); + }); +}); +enifed('ember/tests/homepage_example_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests'); + test('ember/tests/homepage_example_test.js should pass jscs', function () { + ok(true, 'ember/tests/homepage_example_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/homepage_example_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests'); + QUnit.test('ember/tests/homepage_example_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/homepage_example_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/integration/multiple-app-test', ['exports', 'ember-metal', 'ember-template-compiler', 'ember-application', 'ember-glimmer', 'ember-views'], function (exports, _emberMetal, _emberTemplateCompiler, _emberApplication, _emberGlimmer, _emberViews) { + 'use strict'; + + var App1 = undefined, + App2 = undefined, + actions = undefined; + + function startApp(rootElement) { + var application = undefined; + + _emberMetal.run(function () { + application = _emberApplication.Application.create({ + rootElement: rootElement + }); + application.deferReadiness(); + + application.Router.reopen({ + location: 'none' + }); + + var registry = application.__registry__; + + registry.register('component:special-button', _emberGlimmer.Component.extend({ + actions: { + doStuff: function () { + actions.push(rootElement); + } + } + })); + registry.register('template:application', _emberTemplateCompiler.compile('{{outlet}}', { moduleName: 'application' })); + registry.register('template:index', _emberTemplateCompiler.compile('

    Node 1

    {{special-button}}', { moduleName: 'index' })); + registry.register('template:components/special-button', _emberTemplateCompiler.compile('', { moduleName: 'components/special-button' })); + }); + + return application; + } + + function handleURL(application, path) { + var router = application.__container__.lookup('router:main'); + return _emberMetal.run(router, 'handleURL', path); + } + + QUnit.module('View Integration', { + setup: function () { + actions = []; + _emberViews.jQuery('#qunit-fixture').html('
    '); + App1 = startApp('#app-1'); + App2 = startApp('#app-2'); + }, + + teardown: function () { + _emberMetal.run(App1, 'destroy'); + _emberMetal.run(App2, 'destroy'); + App1 = App2 = null; + } + }); + + QUnit.test('booting multiple applications can properly handle events', function (assert) { + _emberMetal.run(App1, 'advanceReadiness'); + _emberMetal.run(App2, 'advanceReadiness'); + + handleURL(App1, '/'); + handleURL(App2, '/'); + + _emberViews.jQuery('#app-2 .do-stuff').click(); + _emberViews.jQuery('#app-1 .do-stuff').click(); + + assert.deepEqual(actions, ['#app-2', '#app-1']); + }); +}); +enifed('ember/tests/integration/multiple-app-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/integration'); + test('ember/tests/integration/multiple-app-test.js should pass jscs', function () { + ok(true, 'ember/tests/integration/multiple-app-test.js should pass jscs.'); + }); +}); +enifed('ember/tests/integration/multiple-app-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/integration'); + QUnit.test('ember/tests/integration/multiple-app-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/integration/multiple-app-test.js should pass jshint.'); + }); +}); +enifed('ember/tests/reexports_test', ['exports', 'ember/index', 'internal-test-helpers', 'ember-metal'], function (exports, _emberIndex, _internalTestHelpers, _emberMetal) { + 'use strict'; + + QUnit.module('ember reexports'); + + [ + // ember-utils + ['getOwner', 'ember-utils', 'getOwner'], ['setOwner', 'ember-utils', 'setOwner'], + // ['assign', 'ember-metal'], TODO: fix this test, we use `Object.assign` if present + ['GUID_KEY', 'ember-utils'], ['uuid', 'ember-utils'], ['generateGuid', 'ember-utils'], ['guidFor', 'ember-utils'], ['inspect', 'ember-utils'], ['makeArray', 'ember-utils'], ['canInvoke', 'ember-utils'], ['tryInvoke', 'ember-utils'], ['wrap', 'ember-utils'], ['applyStr', 'ember-utils'], + + // ember-environment + // ['ENV', 'ember-environment', 'ENV'], TODO: fix this, its failing because we are hitting the getter + + // container + ['Registry', 'container', 'Registry'], ['Container', 'container', 'Container'], + + // ember-metal + ['computed', 'ember-metal'], ['computed.alias', 'ember-metal', 'alias'], ['ComputedProperty', 'ember-metal'], ['cacheFor', 'ember-metal'], ['deprecate', 'ember-metal'], ['deprecateFunc', 'ember-metal'], ['assert', 'ember-metal'], ['warn', 'ember-metal'], ['debug', 'ember-metal'], ['runInDebug', 'ember-metal'], ['merge', 'ember-metal'], ['instrument', 'ember-metal'], ['Instrumentation.instrument', 'ember-metal', 'instrument'], ['Instrumentation.subscribe', 'ember-metal', 'instrumentationSubscribe'], ['Instrumentation.unsubscribe', 'ember-metal', 'instrumentationUnsubscribe'], ['Instrumentation.reset', 'ember-metal', 'instrumentationReset'], ['testing', 'ember-metal', { get: 'isTesting', set: 'setTesting' }], ['onerror', 'ember-metal', { get: 'getOnerror', set: 'setOnerror' }], + // ['create'], TODO: figure out what to do here + // ['keys'], TODO: figure out what to do here + ['FEATURES', 'ember-metal'], ['FEATURES.isEnabled', 'ember-metal', 'isFeatureEnabled'], ['Error', 'ember-metal'], ['META_DESC', 'ember-metal'], ['meta', 'ember-metal'], ['get', 'ember-metal'], ['set', 'ember-metal'], ['_getPath', 'ember-metal'], ['getWithDefault', 'ember-metal'], ['trySet', 'ember-metal'], ['_Cache', 'ember-metal', 'Cache'], ['on', 'ember-metal'], ['addListener', 'ember-metal'], ['removeListener', 'ember-metal'], ['_suspendListener', 'ember-metal', 'suspendListener'], ['_suspendListeners', 'ember-metal', 'suspendListeners'], ['sendEvent', 'ember-metal'], ['hasListeners', 'ember-metal'], ['watchedEvents', 'ember-metal'], ['listenersFor', 'ember-metal'], ['accumulateListeners', 'ember-metal'], ['isNone', 'ember-metal'], ['isEmpty', 'ember-metal'], ['isBlank', 'ember-metal'], ['isPresent', 'ember-metal'], ['_Backburner', 'backburner', 'default'], ['run', 'ember-metal'], ['_ObserverSet', 'ember-metal', 'ObserverSet'], ['propertyWillChange', 'ember-metal'], ['propertyDidChange', 'ember-metal'], ['overrideChains', 'ember-metal'], ['beginPropertyChanges', 'ember-metal'], ['beginPropertyChanges', 'ember-metal'], ['endPropertyChanges', 'ember-metal'], ['changeProperties', 'ember-metal'], ['defineProperty', 'ember-metal'], ['watchKey', 'ember-metal'], ['unwatchKey', 'ember-metal'], ['removeChainWatcher', 'ember-metal'], ['_ChainNode', 'ember-metal', 'ChainNode'], ['finishChains', 'ember-metal'], ['watchPath', 'ember-metal'], ['unwatchPath', 'ember-metal'], ['watch', 'ember-metal'], ['isWatching', 'ember-metal'], ['unwatch', 'ember-metal'], ['destroy', 'ember-metal'], ['libraries', 'ember-metal'], ['OrderedSet', 'ember-metal'], ['Map', 'ember-metal'], ['MapWithDefault', 'ember-metal'], ['getProperties', 'ember-metal'], ['setProperties', 'ember-metal'], ['expandProperties', 'ember-metal'], ['NAME_KEY', 'ember-metal'], ['addObserver', 'ember-metal'], ['observersFor', 'ember-metal'], ['removeObserver', 'ember-metal'], ['_suspendObserver', 'ember-metal'], ['_suspendObservers', 'ember-metal'], ['required', 'ember-metal'], ['aliasMethod', 'ember-metal'], ['observer', 'ember-metal'], ['immediateObserver', 'ember-metal', '_immediateObserver'], ['mixin', 'ember-metal'], ['Mixin', 'ember-metal'], ['bind', 'ember-metal'], ['Binding', 'ember-metal'], ['isGlobalPath', 'ember-metal'], + + // ember-views + ['$', 'ember-views', 'jQuery'], ['ViewUtils.isSimpleClick', 'ember-views', 'isSimpleClick'], ['ViewUtils.getViewElement', 'ember-views', 'getViewElement'], ['ViewUtils.getViewBounds', 'ember-views', 'getViewBounds'], ['ViewUtils.getViewClientRects', 'ember-views', 'getViewClientRects'], ['ViewUtils.getViewBoundingClientRect', 'ember-views', 'getViewBoundingClientRect'], ['ViewUtils.getRootViews', 'ember-views', 'getRootViews'], ['ViewUtils.getChildViews', 'ember-views', 'getChildViews'], ['TextSupport', 'ember-views'], ['ComponentLookup', 'ember-views'], ['EventDispatcher', 'ember-views'], + + // ember-glimmer + ['Component', 'ember-glimmer', 'Component'], ['Helper', 'ember-glimmer', 'Helper'], ['Helper.helper', 'ember-glimmer', 'helper'], ['Checkbox', 'ember-glimmer', 'Checkbox'], ['LinkComponent', 'ember-glimmer', 'LinkComponent'], ['TextArea', 'ember-glimmer', 'TextArea'], ['TextField', 'ember-glimmer', 'TextField'], ['TEMPLATES', 'ember-glimmer', { get: 'getTemplates', set: 'setTemplates' }], ['Handlebars.template', 'ember-glimmer', 'template'], ['Handlebars.SafeString', 'ember-glimmer', { get: '_getSafeString' }], ['Handlebars.Utils.escapeExpression', 'ember-glimmer', 'escapeExpression'], ['String.htmlSafe', 'ember-glimmer', 'htmlSafe'], ['HTMLBars.makeBoundHelper', 'ember-glimmer', 'makeBoundHelper'], + + // ember-runtime + ['_RegistryProxyMixin', 'ember-runtime', 'RegistryProxyMixin'], ['_ContainerProxyMixin', 'ember-runtime', 'ContainerProxyMixin'], ['Object', 'ember-runtime'], ['String', 'ember-runtime'], ['compare', 'ember-runtime'], ['copy', 'ember-runtime'], ['isEqual', 'ember-runtime'], ['inject', 'ember-runtime'], ['Array', 'ember-runtime'], ['Comparable', 'ember-runtime'], ['Namespace', 'ember-runtime'], ['Enumerable', 'ember-runtime'], ['ArrayProxy', 'ember-runtime'], ['ObjectProxy', 'ember-runtime'], ['ActionHandler', 'ember-runtime'], ['CoreObject', 'ember-runtime'], ['NativeArray', 'ember-runtime'], ['Copyable', 'ember-runtime'], ['Freezable', 'ember-runtime'], ['FROZEN_ERROR', 'ember-runtime'], ['MutableEnumerable', 'ember-runtime'], ['MutableArray', 'ember-runtime'], ['TargetActionSupport', 'ember-runtime'], ['Evented', 'ember-runtime'], ['PromiseProxyMixin', 'ember-runtime'], ['Observable', 'ember-runtime'], ['typeOf', 'ember-runtime'], ['isArray', 'ember-runtime'], ['Object', 'ember-runtime'], ['onLoad', 'ember-runtime'], ['runLoadHooks', 'ember-runtime'], ['Controller', 'ember-runtime'], ['ControllerMixin', 'ember-runtime'], ['Service', 'ember-runtime'], ['_ProxyMixin', 'ember-runtime'], ['RSVP', 'ember-runtime'], ['STRINGS', 'ember-runtime', { get: 'getStrings', set: 'setStrings' }], ['BOOTED', 'ember-runtime', { get: 'isNamespaceSearchDisabled', set: 'setNamespaceSearchDisabled' }], + + // ember-routing + ['Location', 'ember-routing'], ['AutoLocation', 'ember-routing'], ['HashLocation', 'ember-routing'], ['HistoryLocation', 'ember-routing'], ['NoneLocation', 'ember-routing'], ['controllerFor', 'ember-routing'], ['generateControllerFactory', 'ember-routing'], ['generateController', 'ember-routing'], ['RouterDSL', 'ember-routing'], ['Router', 'ember-routing'], ['Route', 'ember-routing'], + + // ember-application + ['Application', 'ember-application'], ['ApplicationInstance', 'ember-application'], ['Engine', 'ember-application'], ['EngineInstance', 'ember-application'], ['Resolver', 'ember-application'], ['DefaultResolver', 'ember-application', 'Resolver'], + + // ember-extension-support + ['DataAdapter', 'ember-extension-support'], ['ContainerDebugAdapter', 'ember-extension-support']].forEach(function (reexport) { + var path = reexport[0]; + var moduleId = reexport[1]; + var exportName = reexport[2]; + + // default path === exportName if none present + if (!exportName) { + exportName = path; + } + + QUnit.test('Ember.' + path + ' exports correctly', function (assert) { + _internalTestHelpers.confirmExport(_emberIndex.default, assert, path, moduleId, exportName); + }); + }); + + if (true) { + QUnit.test('Ember.String.isHTMLSafe exports correctly', function (assert) { + _internalTestHelpers.confirmExport(_emberIndex.default, assert, 'String.isHTMLSafe', 'ember-glimmer', 'isHTMLSafe'); + }); + } + + if (false) { + QUnit.test('Ember.WeakMap exports correctly', function (assert) { + _internalTestHelpers.confirmExport(_emberIndex.default, assert, 'WeakMap', 'ember-metal', 'WeakMap'); + }); + } +}); +enifed('ember/tests/reexports_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests'); + test('ember/tests/reexports_test.js should pass jscs', function () { + ok(true, 'ember/tests/reexports_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/reexports_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests'); + QUnit.test('ember/tests/reexports_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/reexports_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-console', 'ember-runtime', 'ember-routing', 'ember-metal', 'ember-glimmer', 'ember-views', 'ember-template-compiler', 'ember-application', 'router'], function (exports, _emberUtils, _emberConsole, _emberRuntime, _emberRouting, _emberMetal, _emberGlimmer, _emberViews, _emberTemplateCompiler, _emberApplication, _router) { + 'use strict'; + + var trim = _emberViews.jQuery.trim; + + var Router = undefined, + App = undefined, + router = undefined, + registry = undefined, + container = undefined, + originalLoggerError = undefined; + + function bootApplication() { + router = container.lookup('router:main'); + _emberMetal.run(App, 'advanceReadiness'); + } + + function handleURL(path) { + return _emberMetal.run(function () { + return router.handleURL(path).then(function (value) { + ok(true, 'url: `' + path + '` was handled'); + return value; + }, function (reason) { + ok(false, 'failed to visit:`' + path + '` reason: `' + QUnit.jsDump.parse(reason)); + throw reason; + }); + }); + } + + function handleURLAborts(path) { + _emberMetal.run(function () { + router.handleURL(path).then(function (value) { + ok(false, 'url: `' + path + '` was NOT to be handled'); + }, function (reason) { + ok(reason && reason.message === 'TransitionAborted', 'url: `' + path + '` was to be aborted'); + }); + }); + } + + function handleURLRejectsWith(path, expectedReason) { + _emberMetal.run(function () { + router.handleURL(path).then(function (value) { + ok(false, 'expected handleURLing: `' + path + '` to fail'); + }, function (reason) { + equal(reason, expectedReason); + }); + }); + } + + QUnit.module('Basic Routing', { + setup: function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create({ + name: 'App', + rootElement: '#qunit-fixture' + }); + + App.deferReadiness(); + + App.Router.reopen({ + location: 'none' + }); + + Router = App.Router; + + App.LoadingRoute = _emberRouting.Route.extend({}); + + registry = App.__registry__; + container = App.__container__; + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('home', _emberTemplateCompiler.compile('

    Hours

    ')); + _emberGlimmer.setTemplate('homepage', _emberTemplateCompiler.compile('

    Megatroll

    {{model.home}}

    ')); + _emberGlimmer.setTemplate('camelot', _emberTemplateCompiler.compile('

    Is a silly place

    ')); + + originalLoggerError = _emberConsole.default.error; + }); + }, + + teardown: function () { + _emberMetal.run(function () { + App.destroy(); + App = null; + + _emberGlimmer.setTemplates({}); + _emberConsole.default.error = originalLoggerError; + }); + } + }); + + QUnit.test('warn on URLs not included in the route set', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + bootApplication(); + + expectAssertion(function () { + return _emberMetal.run(function () { + return router.handleURL('/what-is-this-i-dont-even'); + }); + }, 'The URL \'/what-is-this-i-dont-even\' did not match any routes in your application'); + }); + + QUnit.test('The Homepage', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({}); + + var currentPath = undefined; + + App.ApplicationController = _emberRuntime.Controller.extend({ + currentPathDidChange: _emberMetal.observer('currentPath', function () { + currentPath = _emberMetal.get(this, 'currentPath'); + }) + }); + + bootApplication(); + + equal(currentPath, 'home'); + equal(_emberViews.jQuery('h3:contains(Hours)', '#qunit-fixture').length, 1, 'The home template was rendered'); + }); + + QUnit.test('The Home page and the Camelot page with multiple Router.map calls', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + Router.map(function () { + this.route('camelot', { path: '/camelot' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({}); + + App.CamelotRoute = _emberRouting.Route.extend({}); + + var currentPath = undefined; + + App.ApplicationController = _emberRuntime.Controller.extend({ + currentPathDidChange: _emberMetal.observer('currentPath', function () { + currentPath = _emberMetal.get(this, 'currentPath'); + }) + }); + + App.CamelotController = _emberRuntime.Controller.extend({ + currentPathDidChange: _emberMetal.observer('currentPath', function () { + currentPath = _emberMetal.get(this, 'currentPath'); + }) + }); + + bootApplication(); + + handleURL('/camelot'); + + equal(currentPath, 'camelot'); + equal(_emberViews.jQuery('h3:contains(silly)', '#qunit-fixture').length, 1, 'The camelot template was rendered'); + + handleURL('/'); + + equal(currentPath, 'home'); + equal(_emberViews.jQuery('h3:contains(Hours)', '#qunit-fixture').length, 1, 'The home template was rendered'); + }); + + QUnit.test('The Homepage with explicit template name in renderTemplate', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render('homepage'); + } + }); + + bootApplication(); + + equal(_emberViews.jQuery('h3:contains(Megatroll)', '#qunit-fixture').length, 1, 'The homepage template was rendered'); + }); + + QUnit.test('An alternate template will pull in an alternate controller', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render('homepage'); + } + }); + + App.HomepageController = _emberRuntime.Controller.extend({ + model: { + home: 'Comes from homepage' + } + }); + + bootApplication(); + + equal(_emberViews.jQuery('h3:contains(Megatroll) + p:contains(Comes from homepage)', '#qunit-fixture').length, 1, 'The homepage template was rendered'); + }); + + QUnit.test('An alternate template will pull in an alternate controller instead of controllerName', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + controllerName: 'foo', + renderTemplate: function () { + this.render('homepage'); + } + }); + + App.FooController = _emberRuntime.Controller.extend({ + model: { + home: 'Comes from Foo' + } + }); + + App.HomepageController = _emberRuntime.Controller.extend({ + model: { + home: 'Comes from homepage' + } + }); + + bootApplication(); + + equal(_emberViews.jQuery('h3:contains(Megatroll) + p:contains(Comes from homepage)', '#qunit-fixture').length, 1, 'The homepage template was rendered'); + }); + + QUnit.test('The template will pull in an alternate controller via key/value', function () { + Router.map(function () { + this.route('homepage', { path: '/' }); + }); + + App.HomepageRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render({ controller: 'home' }); + } + }); + + App.HomeController = _emberRuntime.Controller.extend({ + model: { + home: 'Comes from home.' + } + }); + + bootApplication(); + + equal(_emberViews.jQuery('h3:contains(Megatroll) + p:contains(Comes from home.)', '#qunit-fixture').length, 1, 'The homepage template was rendered from data from the HomeController'); + }); + + QUnit.test('The Homepage with explicit template name in renderTemplate and controller', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeController = _emberRuntime.Controller.extend({ + model: { + home: 'YES I AM HOME' + } + }); + + App.HomeRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render('homepage'); + } + }); + + bootApplication(); + + equal(_emberViews.jQuery('h3:contains(Megatroll) + p:contains(YES I AM HOME)', '#qunit-fixture').length, 1, 'The homepage template was rendered'); + }); + + QUnit.test('Model passed via renderTemplate model is set as controller\'s model', function () { + _emberGlimmer.setTemplate('bio', _emberTemplateCompiler.compile('

    {{model.name}}

    ')); + + App.BioController = _emberRuntime.Controller.extend(); + + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render('bio', { + model: { name: 'emberjs' } + }); + } + }); + + bootApplication(); + + equal(_emberViews.jQuery('p:contains(emberjs)', '#qunit-fixture').length, 1, 'Passed model was set as controllers model'); + }); + + QUnit.test('render uses templateName from route', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + _emberGlimmer.setTemplate('the_real_home_template', _emberTemplateCompiler.compile('

    THIS IS THE REAL HOME

    ')); + + App.HomeController = _emberRuntime.Controller.extend(); + App.HomeRoute = _emberRouting.Route.extend({ + templateName: 'the_real_home_template' + }); + + bootApplication(); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'THIS IS THE REAL HOME', 'The homepage template was rendered'); + }); + + QUnit.test('defining templateName allows other templates to be rendered', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + _emberGlimmer.setTemplate('alert', _emberTemplateCompiler.compile('
    Invader!
    ')); + _emberGlimmer.setTemplate('the_real_home_template', _emberTemplateCompiler.compile('

    THIS IS THE REAL HOME

    {{outlet \'alert\'}}')); + + App.HomeController = _emberRuntime.Controller.extend(); + App.HomeRoute = _emberRouting.Route.extend({ + templateName: 'the_real_home_template', + actions: { + showAlert: function () { + this.render('alert', { + into: 'home', + outlet: 'alert' + }); + } + } + }); + + bootApplication(); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'THIS IS THE REAL HOME', 'The homepage template was rendered'); + + _emberMetal.run(function () { + return router.send('showAlert'); + }); + + equal(_emberViews.jQuery('.alert-box', '#qunit-fixture').text(), 'Invader!', 'Template for alert was render into outlet'); + }); + + QUnit.test('templateName is still used when calling render with no name and options', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + _emberGlimmer.setTemplate('alert', _emberTemplateCompiler.compile('
    Invader!
    ')); + _emberGlimmer.setTemplate('home', _emberTemplateCompiler.compile('

    THIS IS THE REAL HOME

    {{outlet \'alert\'}}')); + + App.HomeRoute = _emberRouting.Route.extend({ + templateName: 'alert', + renderTemplate: function () { + this.render({}); + } + }); + + bootApplication(); + + equal(_emberViews.jQuery('.alert-box', '#qunit-fixture').text(), 'Invader!', 'default templateName was rendered into outlet'); + }); + + QUnit.test('The Homepage with a `setupController` hook', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + setupController: function (controller) { + _emberMetal.set(controller, 'hours', _emberRuntime.A(['Monday through Friday: 9am to 5pm', 'Saturday: Noon to Midnight', 'Sunday: Noon to 6pm'])); + } + }); + + _emberGlimmer.setTemplate('home', _emberTemplateCompiler.compile('
      {{#each hours as |entry|}}
    • {{entry}}
    • {{/each}}
    ')); + + bootApplication(); + + equal(_emberViews.jQuery('ul li', '#qunit-fixture').eq(2).text(), 'Sunday: Noon to 6pm', 'The template was rendered with the hours context'); + }); + + QUnit.test('The route controller is still set when overriding the setupController hook', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + setupController: function (controller) { + // no-op + // importantly, we are not calling this._super here + } + }); + + registry.register('controller:home', _emberRuntime.Controller.extend()); + + bootApplication(); + + deepEqual(container.lookup('route:home').controller, container.lookup('controller:home'), 'route controller is the home controller'); + }); + + QUnit.test('The route controller can be specified via controllerName', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + _emberGlimmer.setTemplate('home', _emberTemplateCompiler.compile('

    {{myValue}}

    ')); + + App.HomeRoute = _emberRouting.Route.extend({ + controllerName: 'myController' + }); + + registry.register('controller:myController', _emberRuntime.Controller.extend({ + myValue: 'foo' + })); + + bootApplication(); + + deepEqual(container.lookup('route:home').controller, container.lookup('controller:myController'), 'route controller is set by controllerName'); + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'foo', 'The homepage template was rendered with data from the custom controller'); + }); + + QUnit.test('The route controller specified via controllerName is used in render', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + _emberGlimmer.setTemplate('alternative_home', _emberTemplateCompiler.compile('

    alternative home: {{myValue}}

    ')); + + App.HomeRoute = _emberRouting.Route.extend({ + controllerName: 'myController', + renderTemplate: function () { + this.render('alternative_home'); + } + }); + + registry.register('controller:myController', _emberRuntime.Controller.extend({ + myValue: 'foo' + })); + + bootApplication(); + + deepEqual(container.lookup('route:home').controller, container.lookup('controller:myController'), 'route controller is set by controllerName'); + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'alternative home: foo', 'The homepage template was rendered with data from the custom controller'); + }); + + QUnit.test('The route controller specified via controllerName is used in render even when a controller with the routeName is available', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + _emberGlimmer.setTemplate('home', _emberTemplateCompiler.compile('

    home: {{myValue}}

    ')); + + App.HomeRoute = _emberRouting.Route.extend({ + controllerName: 'myController' + }); + + registry.register('controller:home', _emberRuntime.Controller.extend({ + myValue: 'home' + })); + + registry.register('controller:myController', _emberRuntime.Controller.extend({ + myValue: 'myController' + })); + + bootApplication(); + + deepEqual(container.lookup('route:home').controller, container.lookup('controller:myController'), 'route controller is set by controllerName'); + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'home: myController', 'The homepage template was rendered with data from the custom controller'); + }); + + QUnit.test('The Homepage with a `setupController` hook modifying other controllers', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + setupController: function (controller) { + _emberMetal.set(this.controllerFor('home'), 'hours', _emberRuntime.A(['Monday through Friday: 9am to 5pm', 'Saturday: Noon to Midnight', 'Sunday: Noon to 6pm'])); + } + }); + + _emberGlimmer.setTemplate('home', _emberTemplateCompiler.compile('
      {{#each hours as |entry|}}
    • {{entry}}
    • {{/each}}
    ')); + + bootApplication(); + + equal(_emberViews.jQuery('ul li', '#qunit-fixture').eq(2).text(), 'Sunday: Noon to 6pm', 'The template was rendered with the hours context'); + }); + + QUnit.test('The Homepage with a computed context that does not get overridden', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeController = _emberRuntime.Controller.extend({ + model: _emberMetal.computed(function () { + return _emberRuntime.A(['Monday through Friday: 9am to 5pm', 'Saturday: Noon to Midnight', 'Sunday: Noon to 6pm']); + }) + }); + + _emberGlimmer.setTemplate('home', _emberTemplateCompiler.compile('
      {{#each model as |passage|}}
    • {{passage}}
    • {{/each}}
    ')); + + bootApplication(); + + equal(_emberViews.jQuery('ul li', '#qunit-fixture').eq(2).text(), 'Sunday: Noon to 6pm', 'The template was rendered with the context intact'); + }); + + QUnit.test('The Homepage getting its controller context via model', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.A(['Monday through Friday: 9am to 5pm', 'Saturday: Noon to Midnight', 'Sunday: Noon to 6pm']); + }, + + setupController: function (controller, model) { + equal(this.controllerFor('home'), controller); + + _emberMetal.set(this.controllerFor('home'), 'hours', model); + } + }); + + _emberGlimmer.setTemplate('home', _emberTemplateCompiler.compile('
      {{#each hours as |entry|}}
    • {{entry}}
    • {{/each}}
    ')); + + bootApplication(); + + equal(_emberViews.jQuery('ul li', '#qunit-fixture').eq(2).text(), 'Sunday: Noon to 6pm', 'The template was rendered with the hours context'); + }); + + QUnit.test('The Specials Page getting its controller context by deserializing the params hash', function () { + Router.map(function () { + this.route('home', { path: '/' }); + this.route('special', { path: '/specials/:menu_item_id' }); + }); + + App.SpecialRoute = _emberRouting.Route.extend({ + model: function (params) { + return _emberRuntime.Object.create({ + menuItemId: params.menu_item_id + }); + }, + + setupController: function (controller, model) { + _emberMetal.set(controller, 'model', model); + } + }); + + _emberGlimmer.setTemplate('special', _emberTemplateCompiler.compile('

    {{model.menuItemId}}

    ')); + + bootApplication(); + + registry.register('controller:special', _emberRuntime.Controller.extend()); + + handleURL('/specials/1'); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), '1', 'The model was used to render the template'); + }); + + QUnit.test('The Specials Page defaults to looking models up via `find`', function () { + Router.map(function () { + this.route('home', { path: '/' }); + this.route('special', { path: '/specials/:menu_item_id' }); + }); + + App.MenuItem = _emberRuntime.Object.extend(); + App.MenuItem.reopenClass({ + find: function (id) { + return App.MenuItem.create({ + id: id + }); + } + }); + + App.SpecialRoute = _emberRouting.Route.extend({ + setupController: function (controller, model) { + _emberMetal.set(controller, 'model', model); + } + }); + + _emberGlimmer.setTemplate('special', _emberTemplateCompiler.compile('

    {{model.id}}

    ')); + + bootApplication(); + + registry.register('controller:special', _emberRuntime.Controller.extend()); + + handleURL('/specials/1'); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), '1', 'The model was used to render the template'); + }); + + QUnit.test('The Special Page returning a promise puts the app into a loading state until the promise is resolved', function () { + Router.map(function () { + this.route('home', { path: '/' }); + this.route('special', { path: '/specials/:menu_item_id' }); + }); + + var menuItem = undefined, + resolve = undefined; + + App.MenuItem = _emberRuntime.Object.extend(); + App.MenuItem.reopenClass({ + find: function (id) { + menuItem = App.MenuItem.create({ id: id }); + + return new _emberRuntime.RSVP.Promise(function (res) { + resolve = res; + }); + } + }); + + App.LoadingRoute = _emberRouting.Route.extend({}); + + App.SpecialRoute = _emberRouting.Route.extend({ + setupController: function (controller, model) { + _emberMetal.set(controller, 'model', model); + } + }); + + _emberGlimmer.setTemplate('special', _emberTemplateCompiler.compile('

    {{model.id}}

    ')); + + _emberGlimmer.setTemplate('loading', _emberTemplateCompiler.compile('

    LOADING!

    ')); + + bootApplication(); + + registry.register('controller:special', _emberRuntime.Controller.extend()); + + handleURL('/specials/1'); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'LOADING!', 'The app is in the loading state'); + + _emberMetal.run(function () { + return resolve(menuItem); + }); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), '1', 'The app is now in the specials state'); + }); + + QUnit.test('The loading state doesn\'t get entered for promises that resolve on the same run loop', function () { + Router.map(function () { + this.route('home', { path: '/' }); + this.route('special', { path: '/specials/:menu_item_id' }); + }); + + App.MenuItem = _emberRuntime.Object.extend(); + App.MenuItem.reopenClass({ + find: function (id) { + return { id: id }; + } + }); + + App.LoadingRoute = _emberRouting.Route.extend({ + enter: function () { + ok(false, 'LoadingRoute shouldn\'t have been entered.'); + } + }); + + App.SpecialRoute = _emberRouting.Route.extend({ + setupController: function (controller, model) { + _emberMetal.set(controller, 'model', model); + } + }); + + _emberGlimmer.setTemplate('special', _emberTemplateCompiler.compile('

    {{model.id}}

    ')); + + _emberGlimmer.setTemplate('loading', _emberTemplateCompiler.compile('

    LOADING!

    ')); + + bootApplication(); + + registry.register('controller:special', _emberRuntime.Controller.extend()); + + handleURL('/specials/1'); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), '1', 'The app is now in the specials state'); + }); + + /* + asyncTest("The Special page returning an error fires the error hook on SpecialRoute", function() { + Router.map(function() { + this.route("home", { path: "/" }); + this.route("special", { path: "/specials/:menu_item_id" }); + }); + + let menuItem; + + App.MenuItem = Ember.Object.extend(); + App.MenuItem.reopenClass({ + find: function(id) { + menuItem = App.MenuItem.create({ id: id }); + run.later(function() { menuItem.resolve(menuItem); }, 1); + return menuItem; + } + }); + + App.SpecialRoute = Route.extend({ + setup: function() { + throw 'Setup error'; + }, + actions: { + error: function(reason) { + equal(reason, 'Setup error'); + QUnit.start(); + } + } + }); + + bootApplication(); + + handleURLRejectsWith('/specials/1', 'Setup error'); + }); + */ + + QUnit.test('The Special page returning an error invokes SpecialRoute\'s error handler', function () { + Router.map(function () { + this.route('home', { path: '/' }); + this.route('special', { path: '/specials/:menu_item_id' }); + }); + + var menuItem = undefined, + promise = undefined, + resolve = undefined; + + App.MenuItem = _emberRuntime.Object.extend(); + App.MenuItem.reopenClass({ + find: function (id) { + menuItem = App.MenuItem.create({ id: id }); + promise = new _emberRuntime.RSVP.Promise(function (res) { + resolve = res; + }); + + return promise; + } + }); + + App.SpecialRoute = _emberRouting.Route.extend({ + setup: function () { + throw 'Setup error'; + }, + actions: { + error: function (reason) { + equal(reason, 'Setup error', 'SpecialRoute#error received the error thrown from setup'); + return true; + } + } + }); + + bootApplication(); + + handleURLRejectsWith('/specials/1', 'Setup error'); + + _emberMetal.run(function () { + return resolve(menuItem); + }); + }); + + var testOverridableErrorHandler = function (handlersName) { + expect(2); + + Router.map(function () { + this.route('home', { path: '/' }); + this.route('special', { path: '/specials/:menu_item_id' }); + }); + + var menuItem = undefined, + resolve = undefined; + + App.MenuItem = _emberRuntime.Object.extend(); + App.MenuItem.reopenClass({ + find: function (id) { + menuItem = App.MenuItem.create({ id: id }); + return new _emberRuntime.RSVP.Promise(function (res) { + resolve = res; + }); + } + }); + + var attrs = {}; + attrs[handlersName] = { + error: function (reason) { + equal(reason, 'Setup error', 'error was correctly passed to custom ApplicationRoute handler'); + return true; + } + }; + + App.ApplicationRoute = _emberRouting.Route.extend(attrs); + + App.SpecialRoute = _emberRouting.Route.extend({ + setup: function () { + throw 'Setup error'; + } + }); + + bootApplication(); + + handleURLRejectsWith('/specials/1', 'Setup error'); + + _emberMetal.run(function () { + return resolve(menuItem); + }); + }; + + QUnit.test('ApplicationRoute\'s default error handler can be overridden', function () { + testOverridableErrorHandler('actions'); + }); + + QUnit.asyncTest('Moving from one page to another triggers the correct callbacks', function () { + expect(3); + + Router.map(function () { + this.route('home', { path: '/' }); + this.route('special', { path: '/specials/:menu_item_id' }); + }); + + App.MenuItem = _emberRuntime.Object.extend(); + + App.SpecialRoute = _emberRouting.Route.extend({ + setupController: function (controller, model) { + _emberMetal.set(controller, 'model', model); + } + }); + + _emberGlimmer.setTemplate('home', _emberTemplateCompiler.compile('

    Home

    ')); + + _emberGlimmer.setTemplate('special', _emberTemplateCompiler.compile('

    {{model.id}}

    ')); + + bootApplication(); + + registry.register('controller:special', _emberRuntime.Controller.extend()); + + var transition = handleURL('/'); + + _emberMetal.run(function () { + transition.then(function () { + equal(_emberViews.jQuery('h3', '#qunit-fixture').text(), 'Home', 'The app is now in the initial state'); + + var promiseContext = App.MenuItem.create({ id: 1 }); + _emberMetal.run.later(function () { + return _emberRuntime.RSVP.resolve(promiseContext); + }, 1); + + return router.transitionTo('special', promiseContext); + }).then(function (result) { + deepEqual(router.location.path, '/specials/1'); + QUnit.start(); + }); + }); + }); + + QUnit.asyncTest('Nested callbacks are not exited when moving to siblings', function () { + Router.map(function () { + this.route('root', { path: '/' }, function () { + this.route('special', { path: '/specials/:menu_item_id', resetNamespace: true }); + }); + }); + + App.RootRoute = _emberRouting.Route.extend({ + model: function () { + rootModel++; + return this._super.apply(this, arguments); + }, + + setupController: function () { + rootSetup++; + }, + + renderTemplate: function () { + rootRender++; + }, + + serialize: function () { + rootSerialize++; + return this._super.apply(this, arguments); + } + }); + + var currentPath = undefined; + + App.ApplicationController = _emberRuntime.Controller.extend({ + currentPathDidChange: _emberMetal.observer('currentPath', function () { + currentPath = _emberMetal.get(this, 'currentPath'); + }) + }); + + var menuItem = undefined; + + App.MenuItem = _emberRuntime.Object.extend(); + App.MenuItem.reopenClass({ + find: function (id) { + menuItem = App.MenuItem.create({ id: id }); + return menuItem; + } + }); + + App.LoadingRoute = _emberRouting.Route.extend({}); + + App.HomeRoute = _emberRouting.Route.extend({}); + + App.SpecialRoute = _emberRouting.Route.extend({ + setupController: function (controller, model) { + _emberMetal.set(controller, 'model', model); + } + }); + + _emberGlimmer.setTemplate('root/index', _emberTemplateCompiler.compile('

    Home

    ')); + + _emberGlimmer.setTemplate('special', _emberTemplateCompiler.compile('

    {{model.id}}

    ')); + + _emberGlimmer.setTemplate('loading', _emberTemplateCompiler.compile('

    LOADING!

    ')); + + var rootSetup = 0; + var rootRender = 0; + var rootModel = 0; + var rootSerialize = 0; + + bootApplication(); + + registry.register('controller:special', _emberRuntime.Controller.extend()); + + equal(_emberViews.jQuery('h3', '#qunit-fixture').text(), 'Home', 'The app is now in the initial state'); + equal(rootSetup, 1, 'The root setup was triggered'); + equal(rootRender, 1, 'The root render was triggered'); + equal(rootSerialize, 0, 'The root serialize was not called'); + equal(rootModel, 1, 'The root model was called'); + + router = container.lookup('router:main'); + + _emberMetal.run(function () { + var menuItem = App.MenuItem.create({ id: 1 }); + _emberMetal.run.later(function () { + return _emberRuntime.RSVP.resolve(menuItem); + }, 1); + + router.transitionTo('special', menuItem).then(function (result) { + equal(rootSetup, 1, 'The root setup was not triggered again'); + equal(rootRender, 1, 'The root render was not triggered again'); + equal(rootSerialize, 0, 'The root serialize was not called'); + + // TODO: Should this be changed? + equal(rootModel, 1, 'The root model was called again'); + + deepEqual(router.location.path, '/specials/1'); + equal(currentPath, 'root.special'); + + QUnit.start(); + }); + }); + }); + + QUnit.asyncTest('Events are triggered on the controller if a matching action name is implemented', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + var model = { name: 'Tom Dale' }; + var stateIsNotCalled = true; + + App.HomeRoute = _emberRouting.Route.extend({ + model: function () { + return model; + }, + + actions: { + showStuff: function (obj) { + stateIsNotCalled = false; + } + } + }); + + _emberGlimmer.setTemplate('home', _emberTemplateCompiler.compile('{{name}}')); + + var controller = _emberRuntime.Controller.extend({ + actions: { + showStuff: function (context) { + ok(stateIsNotCalled, 'an event on the state is not triggered'); + deepEqual(context, { name: 'Tom Dale' }, 'an event with context is passed'); + QUnit.start(); + } + } + }); + + registry.register('controller:home', controller); + + bootApplication(); + + _emberViews.jQuery('#qunit-fixture a').click(); + }); + + QUnit.asyncTest('Events are triggered on the current state when defined in `actions` object', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + var model = { name: 'Tom Dale' }; + + App.HomeRoute = _emberRouting.Route.extend({ + model: function () { + return model; + }, + + actions: { + showStuff: function (obj) { + ok(this instanceof App.HomeRoute, 'the handler is an App.HomeRoute'); + // Using Ember.copy removes any private Ember vars which older IE would be confused by + deepEqual(_emberRuntime.copy(obj, true), { name: 'Tom Dale' }, 'the context is correct'); + QUnit.start(); + } + } + }); + + _emberGlimmer.setTemplate('home', _emberTemplateCompiler.compile('{{model.name}}')); + + bootApplication(); + + _emberViews.jQuery('#qunit-fixture a').click(); + }); + + QUnit.asyncTest('Events defined in `actions` object are triggered on the current state when routes are nested', function () { + Router.map(function () { + this.route('root', { path: '/' }, function () { + this.route('index', { path: '/' }); + }); + }); + + var model = { name: 'Tom Dale' }; + + App.RootRoute = _emberRouting.Route.extend({ + actions: { + showStuff: function (obj) { + ok(this instanceof App.RootRoute, 'the handler is an App.HomeRoute'); + // Using Ember.copy removes any private Ember vars which older IE would be confused by + deepEqual(_emberRuntime.copy(obj, true), { name: 'Tom Dale' }, 'the context is correct'); + QUnit.start(); + } + } + }); + + App.RootIndexRoute = _emberRouting.Route.extend({ + model: function () { + return model; + } + }); + + _emberGlimmer.setTemplate('root/index', _emberTemplateCompiler.compile('{{model.name}}')); + + bootApplication(); + + _emberViews.jQuery('#qunit-fixture a').click(); + }); + + QUnit.test('Events can be handled by inherited event handlers', function () { + expect(4); + + App.SuperRoute = _emberRouting.Route.extend({ + actions: { + foo: function () { + ok(true, 'foo'); + }, + bar: function (msg) { + equal(msg, 'HELLO'); + } + } + }); + + App.RouteMixin = _emberMetal.Mixin.create({ + actions: { + bar: function (msg) { + equal(msg, 'HELLO'); + this._super(msg); + } + } + }); + + App.IndexRoute = App.SuperRoute.extend(App.RouteMixin, { + actions: { + baz: function () { + ok(true, 'baz'); + } + } + }); + + bootApplication(); + + router.send('foo'); + router.send('bar', 'HELLO'); + router.send('baz'); + }); + + QUnit.asyncTest('Actions are not triggered on the controller if a matching action name is implemented as a method', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + var model = { name: 'Tom Dale' }; + var stateIsNotCalled = true; + + App.HomeRoute = _emberRouting.Route.extend({ + model: function () { + return model; + }, + + actions: { + showStuff: function (context) { + ok(stateIsNotCalled, 'an event on the state is not triggered'); + deepEqual(context, { name: 'Tom Dale' }, 'an event with context is passed'); + QUnit.start(); + } + } + }); + + _emberGlimmer.setTemplate('home', _emberTemplateCompiler.compile('{{name}}')); + + var controller = _emberRuntime.Controller.extend({ + showStuff: function (context) { + stateIsNotCalled = false; + ok(stateIsNotCalled, 'an event on the state is not triggered'); + } + }); + + registry.register('controller:home', controller); + + bootApplication(); + + _emberViews.jQuery('#qunit-fixture a').click(); + }); + + QUnit.asyncTest('actions can be triggered with multiple arguments', function () { + Router.map(function () { + this.route('root', { path: '/' }, function () { + this.route('index', { path: '/' }); + }); + }); + + var model1 = { name: 'Tilde' }; + var model2 = { name: 'Tom Dale' }; + + App.RootRoute = _emberRouting.Route.extend({ + actions: { + showStuff: function (obj1, obj2) { + ok(this instanceof App.RootRoute, 'the handler is an App.HomeRoute'); + // Using Ember.copy removes any private Ember vars which older IE would be confused by + deepEqual(_emberRuntime.copy(obj1, true), { name: 'Tilde' }, 'the first context is correct'); + deepEqual(_emberRuntime.copy(obj2, true), { name: 'Tom Dale' }, 'the second context is correct'); + QUnit.start(); + } + } + }); + + App.RootIndexController = _emberRuntime.Controller.extend({ + model1: model1, + model2: model2 + }); + + _emberGlimmer.setTemplate('root/index', _emberTemplateCompiler.compile('{{model1.name}}')); + + bootApplication(); + + _emberViews.jQuery('#qunit-fixture a').click(); + }); + + QUnit.test('transitioning multiple times in a single run loop only sets the URL once', function () { + Router.map(function () { + this.route('root', { path: '/' }); + this.route('foo'); + this.route('bar'); + }); + + bootApplication(); + + var urlSetCount = 0; + + router.get('location').setURL = function (path) { + urlSetCount++; + _emberMetal.set(this, 'path', path); + }; + + equal(urlSetCount, 0); + + _emberMetal.run(function () { + router.transitionTo('foo'); + router.transitionTo('bar'); + }); + + equal(urlSetCount, 1); + equal(router.get('location').getURL(), '/bar'); + }); + + QUnit.test('navigating away triggers a url property change', function () { + expect(3); + + Router.map(function () { + this.route('root', { path: '/' }); + this.route('foo', { path: '/foo' }); + this.route('bar', { path: '/bar' }); + }); + + bootApplication(); + + _emberMetal.run(function () { + _emberMetal.addObserver(router, 'url', function () { + ok(true, 'url change event was fired'); + }); + }); + + ['foo', 'bar', '/foo'].forEach(function (destination) { + return _emberMetal.run(router, 'transitionTo', destination); + }); + }); + + QUnit.test('using replaceWith calls location.replaceURL if available', function () { + var setCount = 0; + var replaceCount = 0; + + Router.reopen({ + location: _emberRouting.NoneLocation.create({ + setURL: function (path) { + setCount++; + _emberMetal.set(this, 'path', path); + }, + + replaceURL: function (path) { + replaceCount++; + _emberMetal.set(this, 'path', path); + } + }) + }); + + Router.map(function () { + this.route('root', { path: '/' }); + this.route('foo'); + }); + + bootApplication(); + + equal(setCount, 0); + equal(replaceCount, 0); + + _emberMetal.run(function () { + return router.replaceWith('foo'); + }); + + equal(setCount, 0, 'should not call setURL'); + equal(replaceCount, 1, 'should call replaceURL once'); + equal(router.get('location').getURL(), '/foo'); + }); + + QUnit.test('using replaceWith calls setURL if location.replaceURL is not defined', function () { + var setCount = 0; + + Router.reopen({ + location: _emberRouting.NoneLocation.create({ + setURL: function (path) { + setCount++; + _emberMetal.set(this, 'path', path); + } + }) + }); + + Router.map(function () { + this.route('root', { path: '/' }); + this.route('foo'); + }); + + bootApplication(); + + equal(setCount, 0); + + _emberMetal.run(function () { + return router.replaceWith('foo'); + }); + + equal(setCount, 1, 'should call setURL once'); + equal(router.get('location').getURL(), '/foo'); + }); + + QUnit.test('Route inherits model from parent route', function () { + expect(9); + + Router.map(function () { + this.route('the_post', { path: '/posts/:post_id' }, function () { + this.route('comments'); + + this.route('shares', { path: '/shares/:share_id', resetNamespace: true }, function () { + this.route('share'); + }); + }); + }); + + var post1 = {}; + var post2 = {}; + var post3 = {}; + var currentPost = undefined; + var share1 = {}; + var share2 = {}; + var share3 = {}; + + var posts = { + 1: post1, + 2: post2, + 3: post3 + }; + var shares = { + 1: share1, + 2: share2, + 3: share3 + }; + + App.ThePostRoute = _emberRouting.Route.extend({ + model: function (params) { + return posts[params.post_id]; + } + }); + + App.ThePostCommentsRoute = _emberRouting.Route.extend({ + afterModel: function (post, transition) { + var parent_model = this.modelFor('thePost'); + + equal(post, parent_model); + } + }); + + App.SharesRoute = _emberRouting.Route.extend({ + model: function (params) { + return shares[params.share_id]; + } + }); + + App.SharesShareRoute = _emberRouting.Route.extend({ + afterModel: function (share, transition) { + var parent_model = this.modelFor('shares'); + + equal(share, parent_model); + } + }); + + bootApplication(); + + currentPost = post1; + handleURL('/posts/1/comments'); + handleURL('/posts/1/shares/1'); + + currentPost = post2; + handleURL('/posts/2/comments'); + handleURL('/posts/2/shares/2'); + + currentPost = post3; + handleURL('/posts/3/comments'); + handleURL('/posts/3/shares/3'); + }); + + QUnit.test('Routes with { resetNamespace: true } inherits model from parent route', function () { + expect(6); + + Router.map(function () { + this.route('the_post', { path: '/posts/:post_id' }, function () { + this.route('comments', { resetNamespace: true }, function () {}); + }); + }); + + var post1 = {}; + var post2 = {}; + var post3 = {}; + var currentPost = undefined; + + var posts = { + 1: post1, + 2: post2, + 3: post3 + }; + + App.ThePostRoute = _emberRouting.Route.extend({ + model: function (params) { + return posts[params.post_id]; + } + }); + + App.CommentsRoute = _emberRouting.Route.extend({ + afterModel: function (post, transition) { + var parent_model = this.modelFor('thePost'); + + equal(post, parent_model); + } + }); + + bootApplication(); + + currentPost = post1; + handleURL('/posts/1/comments'); + + currentPost = post2; + handleURL('/posts/2/comments'); + + currentPost = post3; + handleURL('/posts/3/comments'); + }); + + QUnit.test('It is possible to get the model from a parent route', function () { + expect(9); + + Router.map(function () { + this.route('the_post', { path: '/posts/:post_id' }, function () { + this.route('comments', { resetNamespace: true }); + }); + }); + + var post1 = {}; + var post2 = {}; + var post3 = {}; + var currentPost = undefined; + + var posts = { + 1: post1, + 2: post2, + 3: post3 + }; + + App.ThePostRoute = _emberRouting.Route.extend({ + model: function (params) { + return posts[params.post_id]; + } + }); + + App.CommentsRoute = _emberRouting.Route.extend({ + model: function () { + // Allow both underscore / camelCase format. + equal(this.modelFor('thePost'), currentPost); + equal(this.modelFor('the_post'), currentPost); + } + }); + + bootApplication(); + + currentPost = post1; + handleURL('/posts/1/comments'); + + currentPost = post2; + handleURL('/posts/2/comments'); + + currentPost = post3; + handleURL('/posts/3/comments'); + }); + + QUnit.test('A redirection hook is provided', function () { + Router.map(function () { + this.route('choose', { path: '/' }); + this.route('home'); + }); + + var chooseFollowed = 0; + var destination = undefined; + + App.ChooseRoute = _emberRouting.Route.extend({ + redirect: function () { + if (destination) { + this.transitionTo(destination); + } + }, + + setupController: function () { + chooseFollowed++; + } + }); + + destination = 'home'; + + bootApplication(); + + equal(chooseFollowed, 0, 'The choose route wasn\'t entered since a transition occurred'); + equal(_emberViews.jQuery('h3:contains(Hours)', '#qunit-fixture').length, 1, 'The home template was rendered'); + equal(_emberUtils.getOwner(router).lookup('controller:application').get('currentPath'), 'home'); + }); + + QUnit.test('Redirecting from the middle of a route aborts the remainder of the routes', function () { + expect(3); + + Router.map(function () { + this.route('home'); + this.route('foo', function () { + this.route('bar', { resetNamespace: true }, function () { + this.route('baz'); + }); + }); + }); + + App.BarRoute = _emberRouting.Route.extend({ + redirect: function () { + this.transitionTo('home'); + }, + setupController: function () { + ok(false, 'Should transition before setupController'); + } + }); + + App.BarBazRoute = _emberRouting.Route.extend({ + enter: function () { + ok(false, 'Should abort transition getting to next route'); + } + }); + + bootApplication(); + + handleURLAborts('/foo/bar/baz'); + + equal(_emberUtils.getOwner(router).lookup('controller:application').get('currentPath'), 'home'); + equal(router.get('location').getURL(), '/home'); + }); + + QUnit.test('Redirecting to the current target in the middle of a route does not abort initial routing', function () { + expect(5); + + Router.map(function () { + this.route('home'); + this.route('foo', function () { + this.route('bar', { resetNamespace: true }, function () { + this.route('baz'); + }); + }); + }); + + var successCount = 0; + App.BarRoute = _emberRouting.Route.extend({ + redirect: function () { + this.transitionTo('bar.baz').then(function () { + successCount++; + }); + }, + + setupController: function () { + ok(true, 'Should still invoke bar\'s setupController'); + } + }); + + App.BarBazRoute = _emberRouting.Route.extend({ + setupController: function () { + ok(true, 'Should still invoke bar.baz\'s setupController'); + } + }); + + bootApplication(); + + handleURL('/foo/bar/baz'); + + equal(_emberUtils.getOwner(router).lookup('controller:application').get('currentPath'), 'foo.bar.baz'); + equal(successCount, 1, 'transitionTo success handler was called once'); + }); + + QUnit.test('Redirecting to the current target with a different context aborts the remainder of the routes', function () { + expect(4); + + Router.map(function () { + this.route('home'); + this.route('foo', function () { + this.route('bar', { path: 'bar/:id', resetNamespace: true }, function () { + this.route('baz'); + }); + }); + }); + + var model = { id: 2 }; + + var count = 0; + + App.BarRoute = _emberRouting.Route.extend({ + afterModel: function (context) { + if (count++ > 10) { + ok(false, 'infinite loop'); + } else { + this.transitionTo('bar.baz', model); + } + } + }); + + App.BarBazRoute = _emberRouting.Route.extend({ + setupController: function () { + ok(true, 'Should still invoke setupController'); + } + }); + + bootApplication(); + + handleURLAborts('/foo/bar/1/baz'); + + equal(_emberUtils.getOwner(router).lookup('controller:application').get('currentPath'), 'foo.bar.baz'); + equal(router.get('location').getURL(), '/foo/bar/2/baz'); + }); + + QUnit.test('Transitioning from a parent event does not prevent currentPath from being set', function () { + Router.map(function () { + this.route('foo', function () { + this.route('bar', { resetNamespace: true }, function () { + this.route('baz'); + }); + this.route('qux'); + }); + }); + + App.FooRoute = _emberRouting.Route.extend({ + actions: { + goToQux: function () { + this.transitionTo('foo.qux'); + } + } + }); + + bootApplication(); + + var applicationController = _emberUtils.getOwner(router).lookup('controller:application'); + + handleURL('/foo/bar/baz'); + + equal(applicationController.get('currentPath'), 'foo.bar.baz'); + + _emberMetal.run(function () { + return router.send('goToQux'); + }); + + equal(applicationController.get('currentPath'), 'foo.qux'); + equal(router.get('location').getURL(), '/foo/qux'); + }); + + QUnit.test('Generated names can be customized when providing routes with dot notation', function () { + expect(4); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('
    Index
    ')); + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('

    Home

    {{outlet}}
    ')); + _emberGlimmer.setTemplate('foo', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); + _emberGlimmer.setTemplate('bar', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); + _emberGlimmer.setTemplate('bar/baz', _emberTemplateCompiler.compile('

    {{name}}Bottom!

    ')); + + Router.map(function () { + this.route('foo', { path: '/top' }, function () { + this.route('bar', { path: '/middle', resetNamespace: true }, function () { + this.route('baz', { path: '/bottom' }); + }); + }); + }); + + App.FooRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + ok(true, 'FooBarRoute was called'); + return this._super.apply(this, arguments); + } + }); + + App.BarBazRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + ok(true, 'BarBazRoute was called'); + return this._super.apply(this, arguments); + } + }); + + App.BarController = _emberRuntime.Controller.extend({ + name: 'Bar' + }); + + App.BarBazController = _emberRuntime.Controller.extend({ + name: 'BarBaz' + }); + + bootApplication(); + + handleURL('/top/middle/bottom'); + + equal(_emberViews.jQuery('.main .middle .bottom p', '#qunit-fixture').text(), 'BarBazBottom!', 'The templates were rendered into their appropriate parents'); + }); + + QUnit.test('Child routes render into their parent route\'s template by default', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('
    Index
    ')); + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('

    Home

    {{outlet}}
    ')); + _emberGlimmer.setTemplate('top', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); + _emberGlimmer.setTemplate('middle', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); + _emberGlimmer.setTemplate('middle/bottom', _emberTemplateCompiler.compile('

    Bottom!

    ')); + + Router.map(function () { + this.route('top', function () { + this.route('middle', { resetNamespace: true }, function () { + this.route('bottom'); + }); + }); + }); + + bootApplication(); + + handleURL('/top/middle/bottom'); + + equal(_emberViews.jQuery('.main .middle .bottom p', '#qunit-fixture').text(), 'Bottom!', 'The templates were rendered into their appropriate parents'); + }); + + QUnit.test('Child routes render into specified template', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('
    Index
    ')); + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('

    Home

    {{outlet}}
    ')); + _emberGlimmer.setTemplate('top', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); + _emberGlimmer.setTemplate('middle', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); + _emberGlimmer.setTemplate('middle/bottom', _emberTemplateCompiler.compile('

    Bottom!

    ')); + + Router.map(function () { + this.route('top', function () { + this.route('middle', { resetNamespace: true }, function () { + this.route('bottom'); + }); + }); + }); + + App.MiddleBottomRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render('middle/bottom', { into: 'top' }); + } + }); + + bootApplication(); + + handleURL('/top/middle/bottom'); + + equal(_emberViews.jQuery('.main .middle .bottom p', '#qunit-fixture').length, 0, 'should not render into the middle template'); + equal(_emberViews.jQuery('.main .middle > p', '#qunit-fixture').text(), 'Bottom!', 'The template was rendered into the top template'); + }); + + QUnit.test('Rendering into specified template with slash notation', function () { + _emberGlimmer.setTemplate('person/profile', _emberTemplateCompiler.compile('profile {{outlet}}')); + _emberGlimmer.setTemplate('person/details', _emberTemplateCompiler.compile('details!')); + + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render('person/profile'); + this.render('person/details', { into: 'person/profile' }); + } + }); + + bootApplication(); + + equal(_emberViews.jQuery('#qunit-fixture:contains(profile details!)').length, 1, 'The templates were rendered'); + }); + + QUnit.test('Parent route context change', function () { + var editCount = 0; + var editedPostIds = _emberRuntime.A(); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('posts', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('post', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('post/index', _emberTemplateCompiler.compile('showing')); + _emberGlimmer.setTemplate('post/edit', _emberTemplateCompiler.compile('editing')); + + Router.map(function () { + this.route('posts', function () { + this.route('post', { path: '/:postId', resetNamespace: true }, function () { + this.route('edit'); + }); + }); + }); + + App.PostsRoute = _emberRouting.Route.extend({ + actions: { + showPost: function (context) { + this.transitionTo('post', context); + } + } + }); + + App.PostRoute = _emberRouting.Route.extend({ + model: function (params) { + return { id: params.postId }; + }, + + serialize: function (model) { + return { postId: model.id }; + }, + + actions: { + editPost: function (context) { + this.transitionTo('post.edit'); + } + } + }); + + App.PostEditRoute = _emberRouting.Route.extend({ + model: function (params) { + var postId = this.modelFor('post').id; + editedPostIds.push(postId); + return null; + }, + setup: function () { + this._super.apply(this, arguments); + editCount++; + } + }); + + bootApplication(); + + handleURL('/posts/1'); + + _emberMetal.run(function () { + return router.send('editPost'); + }); + _emberMetal.run(function () { + return router.send('showPost', { id: '2' }); + }); + _emberMetal.run(function () { + return router.send('editPost'); + }); + + equal(editCount, 2, 'set up the edit route twice without failure'); + deepEqual(editedPostIds, ['1', '2'], 'modelFor posts.post returns the right context'); + }); + + QUnit.test('Router accounts for rootURL on page load when using history location', function () { + var rootURL = window.location.pathname + '/app'; + var postsTemplateRendered = false; + var setHistory = undefined, + HistoryTestLocation = undefined; + + setHistory = function (obj, path) { + obj.set('history', { state: { path: path } }); + }; + + // Create new implementation that extends HistoryLocation + // and set current location to rootURL + '/posts' + HistoryTestLocation = _emberRouting.HistoryLocation.extend({ + initState: function () { + var path = rootURL + '/posts'; + + setHistory(this, path); + this.set('location', { + pathname: path, + href: 'http://localhost/' + path + }); + }, + + replaceState: function (path) { + setHistory(this, path); + }, + + pushState: function (path) { + setHistory(this, path); + } + }); + + registry.register('location:historyTest', HistoryTestLocation); + + Router.reopen({ + location: 'historyTest', + rootURL: rootURL + }); + + Router.map(function () { + this.route('posts', { path: '/posts' }); + }); + + App.PostsRoute = _emberRouting.Route.extend({ + model: function () {}, + renderTemplate: function () { + postsTemplateRendered = true; + } + }); + + bootApplication(); + + ok(postsTemplateRendered, 'Posts route successfully stripped from rootURL'); + }); + + QUnit.test('The rootURL is passed properly to the location implementation', function () { + expect(1); + var rootURL = '/blahzorz'; + var HistoryTestLocation = undefined; + + HistoryTestLocation = _emberRouting.HistoryLocation.extend({ + rootURL: 'this is not the URL you are looking for', + initState: function () { + equal(this.get('rootURL'), rootURL); + } + }); + + registry.register('location:history-test', HistoryTestLocation); + + Router.reopen({ + location: 'history-test', + rootURL: rootURL, + // if we transition in this test we will receive failures + // if the tests are run from a static file + _doURLTransition: function () {} + }); + + bootApplication(); + }); + + QUnit.test('Only use route rendered into main outlet for default into property on child', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet \'menu\'}}{{outlet}}')); + _emberGlimmer.setTemplate('posts', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('posts/index', _emberTemplateCompiler.compile('

    postsIndex

    ')); + _emberGlimmer.setTemplate('posts/menu', _emberTemplateCompiler.compile('
    postsMenu
    ')); + + Router.map(function () { + this.route('posts', function () {}); + }); + + App.PostsRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render(); + this.render('posts/menu', { + into: 'application', + outlet: 'menu' + }); + } + }); + + bootApplication(); + + handleURL('/posts'); + + equal(_emberViews.jQuery('div.posts-menu:contains(postsMenu)', '#qunit-fixture').length, 1, 'The posts/menu template was rendered'); + equal(_emberViews.jQuery('p.posts-index:contains(postsIndex)', '#qunit-fixture').length, 1, 'The posts/index template was rendered'); + }); + + QUnit.test('Generating a URL should not affect currentModel', function () { + Router.map(function () { + this.route('post', { path: '/posts/:post_id' }); + }); + + var posts = { + 1: { id: 1 }, + 2: { id: 2 } + }; + + App.PostRoute = _emberRouting.Route.extend({ + model: function (params) { + return posts[params.post_id]; + } + }); + + bootApplication(); + + handleURL('/posts/1'); + + var route = container.lookup('route:post'); + equal(route.modelFor('post'), posts[1]); + + var url = router.generate('post', posts[2]); + equal(url, '/posts/2'); + + equal(route.modelFor('post'), posts[1]); + }); + + QUnit.test('Generated route should be an instance of App.Route if provided', function () { + var generatedRoute = undefined; + + Router.map(function () { + this.route('posts'); + }); + + App.Route = _emberRouting.Route.extend(); + + bootApplication(); + + handleURL('/posts'); + + generatedRoute = container.lookup('route:posts'); + + ok(generatedRoute instanceof App.Route, 'should extend the correct route'); + }); + + QUnit.test('Nested index route is not overriden by parent\'s implicit index route', function () { + Router.map(function () { + this.route('posts', function () { + this.route('index', { path: ':category' }); + }); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.transitionTo('posts', { category: 'emberjs' }); + }); + + deepEqual(router.location.path, '/posts/emberjs'); + }); + + QUnit.test('Application template does not duplicate when re-rendered', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('

    I Render Once

    {{outlet}}')); + + Router.map(function () { + this.route('posts'); + }); + + App.ApplicationRoute = _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.A(); + } + }); + + bootApplication(); + + // should cause application template to re-render + handleURL('/posts'); + + equal(_emberViews.jQuery('h3:contains(I Render Once)').length, 1); + }); + + QUnit.test('Child routes should render inside the application template if the application template causes a redirect', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('

    App

    {{outlet}}')); + _emberGlimmer.setTemplate('posts', _emberTemplateCompiler.compile('posts')); + + Router.map(function () { + this.route('posts'); + this.route('photos'); + }); + + App.ApplicationRoute = _emberRouting.Route.extend({ + afterModel: function () { + this.transitionTo('posts'); + } + }); + + bootApplication(); + + equal(_emberViews.jQuery('#qunit-fixture > div').text(), 'App posts'); + }); + + QUnit.test('The template is not re-rendered when the route\'s context changes', function () { + Router.map(function () { + this.route('page', { path: '/page/:name' }); + }); + + App.PageRoute = _emberRouting.Route.extend({ + model: function (params) { + return _emberRuntime.Object.create({ name: params.name }); + } + }); + + var insertionCount = 0; + App.FooBarComponent = _emberGlimmer.Component.extend({ + didInsertElement: function () { + insertionCount += 1; + } + }); + + _emberGlimmer.setTemplate('page', _emberTemplateCompiler.compile('

    {{model.name}}{{foo-bar}}

    ')); + + bootApplication(); + + handleURL('/page/first'); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'first'); + equal(insertionCount, 1); + + handleURL('/page/second'); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'second'); + equal(insertionCount, 1, 'view should have inserted only once'); + + _emberMetal.run(function () { + return router.transitionTo('page', _emberRuntime.Object.create({ name: 'third' })); + }); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'third'); + equal(insertionCount, 1, 'view should still have inserted only once'); + }); + + QUnit.test('The template is not re-rendered when two routes present the exact same template & controller', function () { + Router.map(function () { + this.route('first'); + this.route('second'); + this.route('third'); + this.route('fourth'); + }); + + // Note add a component to test insertion + + var insertionCount = 0; + App.XInputComponent = _emberGlimmer.Component.extend({ + didInsertElement: function () { + insertionCount += 1; + } + }); + + App.SharedRoute = _emberRouting.Route.extend({ + setupController: function (controller) { + this.controllerFor('shared').set('message', 'This is the ' + this.routeName + ' message'); + }, + + renderTemplate: function (controller, context) { + this.render('shared', { controller: 'shared' }); + } + }); + + App.FirstRoute = App.SharedRoute.extend(); + App.SecondRoute = App.SharedRoute.extend(); + App.ThirdRoute = App.SharedRoute.extend(); + App.FourthRoute = App.SharedRoute.extend(); + + App.SharedController = _emberRuntime.Controller.extend(); + + _emberGlimmer.setTemplate('shared', _emberTemplateCompiler.compile('

    {{message}}{{x-input}}

    ')); + + bootApplication(); + + handleURL('/first'); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'This is the first message'); + equal(insertionCount, 1, 'expected one assertion'); + + // Transition by URL + handleURL('/second'); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'This is the second message'); + equal(insertionCount, 1, 'expected one assertion'); + + // Then transition directly by route name + _emberMetal.run(function () { + router.transitionTo('third').then(function (value) { + ok(true, 'expected transition'); + }, function (reason) { + ok(false, 'unexpected transition failure: ', QUnit.jsDump.parse(reason)); + }); + }); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'This is the third message'); + equal(insertionCount, 1, 'expected one assertion'); + + // Lastly transition to a different view, with the same controller and template + handleURL('/fourth'); + equal(insertionCount, 1, 'expected one assertion'); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'This is the fourth message'); + }); + + QUnit.test('ApplicationRoute with model does not proxy the currentPath', function () { + var model = {}; + var currentPath = undefined; + + App.ApplicationRoute = _emberRouting.Route.extend({ + model: function () { + return model; + } + }); + + App.ApplicationController = _emberRuntime.Controller.extend({ + currentPathDidChange: _emberMetal.observer('currentPath', function () { + currentPath = _emberMetal.get(this, 'currentPath'); + }) + }); + + bootApplication(); + + equal(currentPath, 'index', 'currentPath is index'); + equal('currentPath' in model, false, 'should have defined currentPath on controller'); + }); + + QUnit.test('Promises encountered on app load put app into loading state until resolved', function () { + expect(2); + + var deferred = _emberRuntime.RSVP.defer(); + + App.IndexRoute = _emberRouting.Route.extend({ + model: function () { + return deferred.promise; + } + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    INDEX

    ')); + _emberGlimmer.setTemplate('loading', _emberTemplateCompiler.compile('

    LOADING

    ')); + + bootApplication(); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'LOADING', 'The loading state is displaying.'); + _emberMetal.run(deferred.resolve); + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'INDEX', 'The index route is display.'); + }); + + QUnit.test('Route should tear down multiple outlets', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet \'menu\'}}{{outlet}}{{outlet \'footer\'}}')); + _emberGlimmer.setTemplate('posts', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('users', _emberTemplateCompiler.compile('users')); + _emberGlimmer.setTemplate('posts/index', _emberTemplateCompiler.compile('

    postsIndex

    ')); + _emberGlimmer.setTemplate('posts/menu', _emberTemplateCompiler.compile('
    postsMenu
    ')); + _emberGlimmer.setTemplate('posts/footer', _emberTemplateCompiler.compile('')); + + Router.map(function () { + this.route('posts', function () {}); + this.route('users', function () {}); + }); + + App.PostsRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render('posts/menu', { + into: 'application', + outlet: 'menu' + }); + + this.render(); + + this.render('posts/footer', { + into: 'application', + outlet: 'footer' + }); + } + }); + + bootApplication(); + + handleURL('/posts'); + + equal(_emberViews.jQuery('div.posts-menu:contains(postsMenu)', '#qunit-fixture').length, 1, 'The posts/menu template was rendered'); + equal(_emberViews.jQuery('p.posts-index:contains(postsIndex)', '#qunit-fixture').length, 1, 'The posts/index template was rendered'); + equal(_emberViews.jQuery('div.posts-footer:contains(postsFooter)', '#qunit-fixture').length, 1, 'The posts/footer template was rendered'); + + handleURL('/users'); + + equal(_emberViews.jQuery('div.posts-menu:contains(postsMenu)', '#qunit-fixture').length, 0, 'The posts/menu template was removed'); + equal(_emberViews.jQuery('p.posts-index:contains(postsIndex)', '#qunit-fixture').length, 0, 'The posts/index template was removed'); + equal(_emberViews.jQuery('div.posts-footer:contains(postsFooter)', '#qunit-fixture').length, 0, 'The posts/footer template was removed'); + }); + + QUnit.test('Route will assert if you try to explicitly render {into: ...} a missing template', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render({ into: 'nonexistent' }); + } + }); + + expectAssertion(function () { + return bootApplication(); + }, 'You attempted to render into \'nonexistent\' but it was not found'); + }); + + QUnit.test('Route supports clearing outlet explicitly', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet}}{{outlet \'modal\'}}')); + _emberGlimmer.setTemplate('posts', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('users', _emberTemplateCompiler.compile('users')); + _emberGlimmer.setTemplate('posts/index', _emberTemplateCompiler.compile('
    postsIndex {{outlet}}
    ')); + _emberGlimmer.setTemplate('posts/modal', _emberTemplateCompiler.compile('
    postsModal
    ')); + _emberGlimmer.setTemplate('posts/extra', _emberTemplateCompiler.compile('
    postsExtra
    ')); + + Router.map(function () { + this.route('posts', function () {}); + this.route('users', function () {}); + }); + + App.PostsRoute = _emberRouting.Route.extend({ + actions: { + showModal: function () { + this.render('posts/modal', { + into: 'application', + outlet: 'modal' + }); + }, + hideModal: function () { + this.disconnectOutlet({ outlet: 'modal', parentView: 'application' }); + } + } + }); + + App.PostsIndexRoute = _emberRouting.Route.extend({ + actions: { + showExtra: function () { + this.render('posts/extra', { + into: 'posts/index' + }); + }, + hideExtra: function () { + this.disconnectOutlet({ parentView: 'posts/index' }); + } + } + }); + + bootApplication(); + + handleURL('/posts'); + + equal(_emberViews.jQuery('div.posts-index:contains(postsIndex)', '#qunit-fixture').length, 1, 'The posts/index template was rendered'); + + _emberMetal.run(function () { + return router.send('showModal'); + }); + + equal(_emberViews.jQuery('div.posts-modal:contains(postsModal)', '#qunit-fixture').length, 1, 'The posts/modal template was rendered'); + + _emberMetal.run(function () { + return router.send('showExtra'); + }); + + equal(_emberViews.jQuery('div.posts-extra:contains(postsExtra)', '#qunit-fixture').length, 1, 'The posts/extra template was rendered'); + + _emberMetal.run(function () { + return router.send('hideModal'); + }); + + equal(_emberViews.jQuery('div.posts-modal:contains(postsModal)', '#qunit-fixture').length, 0, 'The posts/modal template was removed'); + + _emberMetal.run(function () { + return router.send('hideExtra'); + }); + + equal(_emberViews.jQuery('div.posts-extra:contains(postsExtra)', '#qunit-fixture').length, 0, 'The posts/extra template was removed'); + _emberMetal.run(function () { + router.send('showModal'); + }); + equal(_emberViews.jQuery('div.posts-modal:contains(postsModal)', '#qunit-fixture').length, 1, 'The posts/modal template was rendered'); + _emberMetal.run(function () { + router.send('showExtra'); + }); + equal(_emberViews.jQuery('div.posts-extra:contains(postsExtra)', '#qunit-fixture').length, 1, 'The posts/extra template was rendered'); + + handleURL('/users'); + + equal(_emberViews.jQuery('div.posts-index:contains(postsIndex)', '#qunit-fixture').length, 0, 'The posts/index template was removed'); + equal(_emberViews.jQuery('div.posts-modal:contains(postsModal)', '#qunit-fixture').length, 0, 'The posts/modal template was removed'); + equal(_emberViews.jQuery('div.posts-extra:contains(postsExtra)', '#qunit-fixture').length, 0, 'The posts/extra template was removed'); + }); + + QUnit.test('Route supports clearing outlet using string parameter', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet}}{{outlet \'modal\'}}')); + _emberGlimmer.setTemplate('posts', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('users', _emberTemplateCompiler.compile('users')); + _emberGlimmer.setTemplate('posts/index', _emberTemplateCompiler.compile('
    postsIndex {{outlet}}
    ')); + _emberGlimmer.setTemplate('posts/modal', _emberTemplateCompiler.compile('
    postsModal
    ')); + + Router.map(function () { + this.route('posts', function () {}); + this.route('users', function () {}); + }); + + App.PostsRoute = _emberRouting.Route.extend({ + actions: { + showModal: function () { + this.render('posts/modal', { + into: 'application', + outlet: 'modal' + }); + }, + hideModal: function () { + this.disconnectOutlet('modal'); + } + } + }); + + bootApplication(); + + handleURL('/posts'); + + equal(_emberViews.jQuery('div.posts-index:contains(postsIndex)', '#qunit-fixture').length, 1, 'The posts/index template was rendered'); + + _emberMetal.run(function () { + return router.send('showModal'); + }); + + equal(_emberViews.jQuery('div.posts-modal:contains(postsModal)', '#qunit-fixture').length, 1, 'The posts/modal template was rendered'); + + _emberMetal.run(function () { + return router.send('hideModal'); + }); + + equal(_emberViews.jQuery('div.posts-modal:contains(postsModal)', '#qunit-fixture').length, 0, 'The posts/modal template was removed'); + + handleURL('/users'); + + equal(_emberViews.jQuery('div.posts-index:contains(postsIndex)', '#qunit-fixture').length, 0, 'The posts/index template was removed'); + equal(_emberViews.jQuery('div.posts-modal:contains(postsModal)', '#qunit-fixture').length, 0, 'The posts/modal template was removed'); + }); + + QUnit.test('Route silently fails when cleaning an outlet from an inactive view', function () { + expect(1); // handleURL + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('posts', _emberTemplateCompiler.compile('{{outlet \'modal\'}}')); + _emberGlimmer.setTemplate('modal', _emberTemplateCompiler.compile('A Yo.')); + + Router.map(function () { + this.route('posts'); + }); + + App.PostsRoute = _emberRouting.Route.extend({ + actions: { + hideSelf: function () { + this.disconnectOutlet({ outlet: 'main', parentView: 'application' }); + }, + showModal: function () { + this.render('modal', { into: 'posts', outlet: 'modal' }); + }, + hideModal: function () { + this.disconnectOutlet({ outlet: 'modal', parentView: 'posts' }); + } + } + }); + + bootApplication(); + + handleURL('/posts'); + + _emberMetal.run(function () { + return router.send('showModal'); + }); + _emberMetal.run(function () { + return router.send('hideSelf'); + }); + _emberMetal.run(function () { + return router.send('hideModal'); + }); + }); + + QUnit.test('Router `willTransition` hook passes in cancellable transition', function () { + // Should hit willTransition 3 times, once for the initial route, and then 2 more times + // for the two handleURL calls below + expect(3); + + Router.map(function () { + this.route('nork'); + this.route('about'); + }); + + Router.reopen({ + init: function () { + this._super(); + this.on('willTransition', this.testWillTransitionHook); + }, + testWillTransitionHook: function (transition, url) { + ok(true, 'willTransition was called ' + url); + transition.abort(); + } + }); + + App.LoadingRoute = _emberRouting.Route.extend({ + activate: function () { + ok(false, 'LoadingRoute was not entered'); + } + }); + + App.NorkRoute = _emberRouting.Route.extend({ + activate: function () { + ok(false, 'NorkRoute was not entered'); + } + }); + + App.AboutRoute = _emberRouting.Route.extend({ + activate: function () { + ok(false, 'AboutRoute was not entered'); + } + }); + + bootApplication(); + + // Attempted transitions out of index should abort. + _emberMetal.run(router, 'handleURL', '/nork'); + _emberMetal.run(router, 'handleURL', '/about'); + }); + + QUnit.test('Aborting/redirecting the transition in `willTransition` prevents LoadingRoute from being entered', function () { + expect(8); + + Router.map(function () { + this.route('nork'); + this.route('about'); + }); + + var redirect = false; + + App.IndexRoute = _emberRouting.Route.extend({ + actions: { + willTransition: function (transition) { + ok(true, 'willTransition was called'); + if (redirect) { + // router.js won't refire `willTransition` for this redirect + this.transitionTo('about'); + } else { + transition.abort(); + } + } + } + }); + + var deferred = null; + + App.LoadingRoute = _emberRouting.Route.extend({ + activate: function () { + ok(deferred, 'LoadingRoute should be entered at this time'); + }, + deactivate: function () { + ok(true, 'LoadingRoute was exited'); + } + }); + + App.NorkRoute = _emberRouting.Route.extend({ + activate: function () { + ok(true, 'NorkRoute was entered'); + } + }); + + App.AboutRoute = _emberRouting.Route.extend({ + activate: function () { + ok(true, 'AboutRoute was entered'); + }, + model: function () { + if (deferred) { + return deferred.promise; + } + } + }); + + bootApplication(); + + // Attempted transitions out of index should abort. + _emberMetal.run(router, 'transitionTo', 'nork'); + _emberMetal.run(router, 'handleURL', '/nork'); + + // Attempted transitions out of index should redirect to about + redirect = true; + _emberMetal.run(router, 'transitionTo', 'nork'); + _emberMetal.run(router, 'transitionTo', 'index'); + + // Redirected transitions out of index to a route with a + // promise model should pause the transition and + // activate LoadingRoute + deferred = _emberRuntime.RSVP.defer(); + _emberMetal.run(router, 'transitionTo', 'nork'); + _emberMetal.run(deferred.resolve); + }); + + QUnit.test('`didTransition` event fires on the router', function () { + expect(3); + + Router.map(function () { + this.route('nork'); + }); + + router = container.lookup('router:main'); + + router.one('didTransition', function () { + ok(true, 'didTransition fired on initial routing'); + }); + + bootApplication(); + + router.one('didTransition', function () { + ok(true, 'didTransition fired on the router'); + equal(router.get('url'), '/nork', 'The url property is updated by the time didTransition fires'); + }); + + _emberMetal.run(router, 'transitionTo', 'nork'); + }); + QUnit.test('`didTransition` can be reopened', function () { + expect(1); + + Router.map(function () { + this.route('nork'); + }); + + Router.reopen({ + didTransition: function () { + this._super.apply(this, arguments); + ok(true, 'reopened didTransition was called'); + } + }); + + bootApplication(); + }); + + QUnit.test('`activate` event fires on the route', function () { + expect(2); + + var eventFired = 0; + + Router.map(function () { + this.route('nork'); + }); + + App.NorkRoute = _emberRouting.Route.extend({ + init: function () { + this._super.apply(this, arguments); + + this.on('activate', function () { + equal(++eventFired, 1, 'activate event is fired once'); + }); + }, + + activate: function () { + ok(true, 'activate hook is called'); + } + }); + + bootApplication(); + + _emberMetal.run(router, 'transitionTo', 'nork'); + }); + + QUnit.test('`deactivate` event fires on the route', function () { + expect(2); + + var eventFired = 0; + + Router.map(function () { + this.route('nork'); + this.route('dork'); + }); + + App.NorkRoute = _emberRouting.Route.extend({ + init: function () { + this._super.apply(this, arguments); + + this.on('deactivate', function () { + equal(++eventFired, 1, 'deactivate event is fired once'); + }); + }, + + deactivate: function () { + ok(true, 'deactivate hook is called'); + } + }); + + bootApplication(); + + _emberMetal.run(router, 'transitionTo', 'nork'); + _emberMetal.run(router, 'transitionTo', 'dork'); + }); + + QUnit.test('Actions can be handled by inherited action handlers', function () { + expect(4); + + App.SuperRoute = _emberRouting.Route.extend({ + actions: { + foo: function () { + ok(true, 'foo'); + }, + bar: function (msg) { + equal(msg, 'HELLO'); + } + } + }); + + App.RouteMixin = _emberMetal.Mixin.create({ + actions: { + bar: function (msg) { + equal(msg, 'HELLO'); + this._super(msg); + } + } + }); + + App.IndexRoute = App.SuperRoute.extend(App.RouteMixin, { + actions: { + baz: function () { + ok(true, 'baz'); + } + } + }); + + bootApplication(); + + router.send('foo'); + router.send('bar', 'HELLO'); + router.send('baz'); + }); + + QUnit.test('transitionTo returns Transition when passed a route name', function () { + expect(1); + Router.map(function () { + this.route('root', { path: '/' }); + this.route('bar'); + }); + + bootApplication(); + + var transition = _emberMetal.run(function () { + return router.transitionTo('bar'); + }); + + equal(transition instanceof _router.Transition, true); + }); + + QUnit.test('transitionTo returns Transition when passed a url', function () { + expect(1); + Router.map(function () { + this.route('root', { path: '/' }); + this.route('bar', function () { + this.route('baz'); + }); + }); + + bootApplication(); + + var transition = _emberMetal.run(function () { + return router.transitionTo('/bar/baz'); + }); + + equal(transition instanceof _router.Transition, true); + }); + + QUnit.test('currentRouteName is a property installed on ApplicationController that can be used in transitionTo', function () { + expect(24); + + Router.map(function () { + this.route('be', function () { + this.route('excellent', { resetNamespace: true }, function () { + this.route('to', { resetNamespace: true }, function () { + this.route('each', { resetNamespace: true }, function () { + this.route('other'); + }); + }); + }); + }); + }); + + bootApplication(); + + var appController = _emberUtils.getOwner(router).lookup('controller:application'); + + function transitionAndCheck(path, expectedPath, expectedRouteName) { + if (path) { + _emberMetal.run(router, 'transitionTo', path); + } + equal(appController.get('currentPath'), expectedPath); + equal(appController.get('currentRouteName'), expectedRouteName); + } + + transitionAndCheck(null, 'index', 'index'); + transitionAndCheck('/be', 'be.index', 'be.index'); + transitionAndCheck('/be/excellent', 'be.excellent.index', 'excellent.index'); + transitionAndCheck('/be/excellent/to', 'be.excellent.to.index', 'to.index'); + transitionAndCheck('/be/excellent/to/each', 'be.excellent.to.each.index', 'each.index'); + transitionAndCheck('/be/excellent/to/each/other', 'be.excellent.to.each.other', 'each.other'); + + transitionAndCheck('index', 'index', 'index'); + transitionAndCheck('be', 'be.index', 'be.index'); + transitionAndCheck('excellent', 'be.excellent.index', 'excellent.index'); + transitionAndCheck('to.index', 'be.excellent.to.index', 'to.index'); + transitionAndCheck('each', 'be.excellent.to.each.index', 'each.index'); + transitionAndCheck('each.other', 'be.excellent.to.each.other', 'each.other'); + }); + + QUnit.test('Route model hook finds the same model as a manual find', function () { + var Post = undefined; + App.Post = _emberRuntime.Object.extend(); + App.Post.reopenClass({ + find: function () { + Post = this; + return {}; + } + }); + + Router.map(function () { + this.route('post', { path: '/post/:post_id' }); + }); + + bootApplication(); + + handleURL('/post/1'); + + equal(App.Post, Post); + }); + + QUnit.test('Routes can refresh themselves causing their model hooks to be re-run', function () { + Router.map(function () { + this.route('parent', { path: '/parent/:parent_id' }, function () { + this.route('child'); + }); + }); + + var appcount = 0; + App.ApplicationRoute = _emberRouting.Route.extend({ + model: function () { + ++appcount; + } + }); + + var parentcount = 0; + App.ParentRoute = _emberRouting.Route.extend({ + model: function (params) { + equal(params.parent_id, '123'); + ++parentcount; + }, + actions: { + refreshParent: function () { + this.refresh(); + } + } + }); + + var childcount = 0; + App.ParentChildRoute = _emberRouting.Route.extend({ + model: function () { + ++childcount; + } + }); + + bootApplication(); + + equal(appcount, 1); + equal(parentcount, 0); + equal(childcount, 0); + + _emberMetal.run(router, 'transitionTo', 'parent.child', '123'); + + equal(appcount, 1); + equal(parentcount, 1); + equal(childcount, 1); + + _emberMetal.run(router, 'send', 'refreshParent'); + + equal(appcount, 1); + equal(parentcount, 2); + equal(childcount, 2); + }); + + QUnit.test('Specifying non-existent controller name in route#render throws', function () { + expect(1); + + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + try { + this.render('homepage', { controller: 'stefanpenneristhemanforme' }); + } catch (e) { + equal(e.message, 'You passed `controller: \'stefanpenneristhemanforme\'` into the `render` method, but no such controller could be found.'); + } + } + }); + + bootApplication(); + }); + + QUnit.test('Redirecting with null model doesn\'t error out', function () { + Router.map(function () { + this.route('home', { path: '/' }); + this.route('about', { path: '/about/:hurhurhur' }); + }); + + App.AboutRoute = _emberRouting.Route.extend({ + serialize: function (model) { + if (model === null) { + return { hurhurhur: 'TreeklesMcGeekles' }; + } + } + }); + + App.HomeRoute = _emberRouting.Route.extend({ + beforeModel: function () { + this.transitionTo('about', null); + } + }); + + bootApplication(); + + equal(router.get('location.path'), '/about/TreeklesMcGeekles'); + }); + + QUnit.test('rejecting the model hooks promise with a non-error prints the `message` property', function () { + expect(5); + + var rejectedMessage = 'OMG!! SOOOOOO BAD!!!!'; + var rejectedStack = 'Yeah, buddy: stack gets printed too.'; + + Router.map(function () { + this.route('yippie', { path: '/' }); + }); + + _emberConsole.default.error = function (initialMessage, errorMessage, errorStack) { + equal(initialMessage, 'Error while processing route: yippie', 'a message with the current route name is printed'); + equal(errorMessage, rejectedMessage, 'the rejected reason\'s message property is logged'); + equal(errorStack, rejectedStack, 'the rejected reason\'s stack property is logged'); + }; + + App.YippieRoute = _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.RSVP.reject({ message: rejectedMessage, stack: rejectedStack }); + } + }); + + throws(function () { + bootApplication(); + }, function (err) { + equal(err.message, rejectedMessage); + return true; + }, 'expected an exception'); + }); + + QUnit.test('rejecting the model hooks promise with an error with `errorThrown` property prints `errorThrown.message` property', function () { + expect(5); + var rejectedMessage = 'OMG!! SOOOOOO BAD!!!!'; + var rejectedStack = 'Yeah, buddy: stack gets printed too.'; + + Router.map(function () { + this.route('yippie', { path: '/' }); + }); + + _emberConsole.default.error = function (initialMessage, errorMessage, errorStack) { + equal(initialMessage, 'Error while processing route: yippie', 'a message with the current route name is printed'); + equal(errorMessage, rejectedMessage, 'the rejected reason\'s message property is logged'); + equal(errorStack, rejectedStack, 'the rejected reason\'s stack property is logged'); + }; + + App.YippieRoute = _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.RSVP.reject({ + errorThrown: { message: rejectedMessage, stack: rejectedStack } + }); + } + }); + + throws(function () { + return bootApplication(); + }, function (err) { + equal(err.message, rejectedMessage); + return true; + }, 'expected an exception'); + }); + + QUnit.test('rejecting the model hooks promise with no reason still logs error', function () { + Router.map(function () { + this.route('wowzers', { path: '/' }); + }); + + _emberConsole.default.error = function (initialMessage) { + equal(initialMessage, 'Error while processing route: wowzers', 'a message with the current route name is printed'); + }; + + App.WowzersRoute = _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.RSVP.reject(); + } + }); + + bootApplication(); + }); + + QUnit.test('rejecting the model hooks promise with a string shows a good error', function () { + expect(3); + var originalLoggerError = _emberConsole.default.error; + var rejectedMessage = 'Supercalifragilisticexpialidocious'; + + Router.map(function () { + this.route('yondo', { path: '/' }); + }); + + _emberConsole.default.error = function (initialMessage, errorMessage) { + equal(initialMessage, 'Error while processing route: yondo', 'a message with the current route name is printed'); + equal(errorMessage, rejectedMessage, 'the rejected reason\'s message property is logged'); + }; + + App.YondoRoute = _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.RSVP.reject(rejectedMessage); + } + }); + + throws(function () { + return bootApplication(); + }, rejectedMessage, 'expected an exception'); + + _emberConsole.default.error = originalLoggerError; + }); + + QUnit.test('willLeave, willChangeContext, willChangeModel actions don\'t fire unless feature flag enabled', function () { + expect(1); + + App.Router.map(function () { + this.route('about'); + }); + + function shouldNotFire() { + ok(false, 'this action shouldn\'t have been received'); + } + + App.IndexRoute = _emberRouting.Route.extend({ + actions: { + willChangeModel: shouldNotFire, + willChangeContext: shouldNotFire, + willLeave: shouldNotFire + } + }); + + App.AboutRoute = _emberRouting.Route.extend({ + setupController: function () { + ok(true, 'about route was entered'); + } + }); + + bootApplication(); + _emberMetal.run(router, 'transitionTo', 'about'); + }); + + QUnit.test('Errors in transitionTo within redirect hook are logged', function () { + expect(4); + var actual = []; + + Router.map(function () { + this.route('yondo', { path: '/' }); + this.route('stink-bomb'); + }); + + App.YondoRoute = _emberRouting.Route.extend({ + redirect: function () { + this.transitionTo('stink-bomb', { something: 'goes boom' }); + } + }); + + _emberConsole.default.error = function () { + // push the arguments onto an array so we can detect if the error gets logged twice + actual.push(arguments); + }; + + throws(function () { + return bootApplication(); + }, /More context objects were passed/); + + equal(actual.length, 1, 'the error is only logged once'); + equal(actual[0][0], 'Error while processing route: yondo', 'source route is printed'); + ok(actual[0][1].match(/More context objects were passed than there are dynamic segments for the route: stink-bomb/), 'the error is printed'); + }); + + QUnit.test('Errors in transition show error template if available', function () { + _emberGlimmer.setTemplate('error', _emberTemplateCompiler.compile('
    Error!
    ')); + + Router.map(function () { + this.route('yondo', { path: '/' }); + this.route('stink-bomb'); + }); + + App.YondoRoute = _emberRouting.Route.extend({ + redirect: function () { + this.transitionTo('stink-bomb', { something: 'goes boom' }); + } + }); + + throws(function () { + return bootApplication(); + }, /More context objects were passed/); + + equal(_emberViews.jQuery('#error').length, 1, 'Error template was rendered.'); + }); + + QUnit.test('Route#resetController gets fired when changing models and exiting routes', function () { + expect(4); + + Router.map(function () { + this.route('a', function () { + this.route('b', { path: '/b/:id', resetNamespace: true }, function () {}); + this.route('c', { path: '/c/:id', resetNamespace: true }, function () {}); + }); + this.route('out'); + }); + + var calls = []; + + var SpyRoute = _emberRouting.Route.extend({ + setupController: function (controller, model, transition) { + calls.push(['setup', this.routeName]); + }, + + resetController: function (controller) { + calls.push(['reset', this.routeName]); + } + }); + + App.ARoute = SpyRoute.extend(); + App.BRoute = SpyRoute.extend(); + App.CRoute = SpyRoute.extend(); + App.OutRoute = SpyRoute.extend(); + + bootApplication(); + deepEqual(calls, []); + + _emberMetal.run(router, 'transitionTo', 'b', 'b-1'); + deepEqual(calls, [['setup', 'a'], ['setup', 'b']]); + calls.length = 0; + + _emberMetal.run(router, 'transitionTo', 'c', 'c-1'); + deepEqual(calls, [['reset', 'b'], ['setup', 'c']]); + calls.length = 0; + + _emberMetal.run(router, 'transitionTo', 'out'); + deepEqual(calls, [['reset', 'c'], ['reset', 'a'], ['setup', 'out']]); + }); + + QUnit.test('Exception during initialization of non-initial route is not swallowed', function () { + Router.map(function () { + this.route('boom'); + }); + App.BoomRoute = _emberRouting.Route.extend({ + init: function () { + throw new Error('boom!'); + } + }); + bootApplication(); + throws(function () { + return _emberMetal.run(router, 'transitionTo', 'boom'); + }, /\bboom\b/); + }); + + QUnit.test('Exception during load of non-initial route is not swallowed', function () { + Router.map(function () { + this.route('boom'); + }); + var lookup = container.lookup; + container.lookup = function () { + if (arguments[0] === 'route:boom') { + throw new Error('boom!'); + } + return lookup.apply(this, arguments); + }; + App.BoomRoute = _emberRouting.Route.extend({ + init: function () { + throw new Error('boom!'); + } + }); + bootApplication(); + throws(function () { + return _emberMetal.run(router, 'transitionTo', 'boom'); + }); + }); + + QUnit.test('Exception during initialization of initial route is not swallowed', function () { + Router.map(function () { + this.route('boom', { path: '/' }); + }); + App.BoomRoute = _emberRouting.Route.extend({ + init: function () { + throw new Error('boom!'); + } + }); + throws(function () { + return bootApplication(); + }, /\bboom\b/); + }); + + QUnit.test('Exception during load of initial route is not swallowed', function () { + Router.map(function () { + this.route('boom', { path: '/' }); + }); + var lookup = container.lookup; + container.lookup = function () { + if (arguments[0] === 'route:boom') { + throw new Error('boom!'); + } + return lookup.apply(this, arguments); + }; + App.BoomRoute = _emberRouting.Route.extend({ + init: function () { + throw new Error('boom!'); + } + }); + throws(function () { + return bootApplication(); + }, /\bboom\b/); + }); + + QUnit.test('{{outlet}} works when created after initial render', function () { + _emberGlimmer.setTemplate('sample', _emberTemplateCompiler.compile('Hi{{#if showTheThing}}{{outlet}}{{/if}}Bye')); + _emberGlimmer.setTemplate('sample/inner', _emberTemplateCompiler.compile('Yay')); + _emberGlimmer.setTemplate('sample/inner2', _emberTemplateCompiler.compile('Boo')); + Router.map(function () { + this.route('sample', { path: '/' }, function () { + this.route('inner', { path: '/' }); + this.route('inner2', { path: '/2' }); + }); + }); + + bootApplication(); + + equal(_emberViews.jQuery('#qunit-fixture').text(), 'HiBye', 'initial render'); + + _emberMetal.run(function () { + return container.lookup('controller:sample').set('showTheThing', true); + }); + + equal(_emberViews.jQuery('#qunit-fixture').text(), 'HiYayBye', 'second render'); + + handleURL('/2'); + + equal(_emberViews.jQuery('#qunit-fixture').text(), 'HiBooBye', 'third render'); + }); + + QUnit.test('Can render into a named outlet at the top level', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('A-{{outlet}}-B-{{outlet "other"}}-C')); + _emberGlimmer.setTemplate('modal', _emberTemplateCompiler.compile('Hello world')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('The index')); + + registry.register('route:application', _emberRouting.Route.extend({ + renderTemplate: function () { + this.render(); + this.render('modal', { + into: 'application', + outlet: 'other' + }); + } + })); + + bootApplication(); + + equal(_emberViews.jQuery('#qunit-fixture').text(), 'A-The index-B-Hello world-C', 'initial render'); + }); + + QUnit.test('Can disconnect a named outlet at the top level', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('A-{{outlet}}-B-{{outlet "other"}}-C')); + _emberGlimmer.setTemplate('modal', _emberTemplateCompiler.compile('Hello world')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('The index')); + + registry.register('route:application', _emberRouting.Route.extend({ + renderTemplate: function () { + this.render(); + this.render('modal', { + into: 'application', + outlet: 'other' + }); + }, + actions: { + banish: function () { + this.disconnectOutlet({ + parentView: 'application', + outlet: 'other' + }); + } + } + })); + + bootApplication(); + + equal(_emberViews.jQuery('#qunit-fixture').text(), 'A-The index-B-Hello world-C', 'initial render'); + + _emberMetal.run(router, 'send', 'banish'); + + equal(_emberViews.jQuery('#qunit-fixture').text(), 'A-The index-B--C', 'second render'); + }); + + QUnit.test('Can render into a named outlet at the top level, with empty main outlet', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('A-{{outlet}}-B-{{outlet "other"}}-C')); + _emberGlimmer.setTemplate('modal', _emberTemplateCompiler.compile('Hello world')); + + Router.map(function () { + this.route('hasNoTemplate', { path: '/' }); + }); + + registry.register('route:application', _emberRouting.Route.extend({ + renderTemplate: function () { + this.render(); + this.render('modal', { + into: 'application', + outlet: 'other' + }); + } + })); + + bootApplication(); + + equal(_emberViews.jQuery('#qunit-fixture').text(), 'A--B-Hello world-C', 'initial render'); + }); + + QUnit.test('Can render into a named outlet at the top level, later', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('A-{{outlet}}-B-{{outlet "other"}}-C')); + _emberGlimmer.setTemplate('modal', _emberTemplateCompiler.compile('Hello world')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('The index')); + + registry.register('route:application', _emberRouting.Route.extend({ + actions: { + launch: function () { + this.render('modal', { + into: 'application', + outlet: 'other' + }); + } + } + })); + + bootApplication(); + + equal(_emberViews.jQuery('#qunit-fixture').text(), 'A-The index-B--C', 'initial render'); + + _emberMetal.run(router, 'send', 'launch'); + + equal(_emberViews.jQuery('#qunit-fixture').text(), 'A-The index-B-Hello world-C', 'second render'); + }); + + QUnit.test('Can render routes with no \'main\' outlet and their children', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{outlet "app"}}
    ')); + _emberGlimmer.setTemplate('app', _emberTemplateCompiler.compile('
    {{outlet "common"}}
    {{outlet "sub"}}
    ')); + _emberGlimmer.setTemplate('common', _emberTemplateCompiler.compile('
    ')); + _emberGlimmer.setTemplate('sub', _emberTemplateCompiler.compile('
    ')); + + Router.map(function () { + this.route('app', { path: '/app' }, function () { + this.route('sub', { path: '/sub', resetNamespace: true }); + }); + }); + + App.AppRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render('app', { + outlet: 'app', + into: 'application' + }); + this.render('common', { + outlet: 'common', + into: 'app' + }); + } + }); + + App.SubRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render('sub', { + outlet: 'sub', + into: 'app' + }); + } + }); + + bootApplication(); + handleURL('/app'); + equal(_emberViews.jQuery('#app-common #common').length, 1, 'Finds common while viewing /app'); + handleURL('/app/sub'); + equal(_emberViews.jQuery('#app-common #common').length, 1, 'Finds common while viewing /app/sub'); + equal(_emberViews.jQuery('#app-sub #sub').length, 1, 'Finds sub while viewing /app/sub'); + }); + + QUnit.test('Tolerates stacked renders', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet}}{{outlet "modal"}}')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('hi')); + _emberGlimmer.setTemplate('layer', _emberTemplateCompiler.compile('layer')); + App.ApplicationRoute = _emberRouting.Route.extend({ + actions: { + openLayer: function () { + this.render('layer', { + into: 'application', + outlet: 'modal' + }); + }, + close: function () { + this.disconnectOutlet({ + outlet: 'modal', + parentView: 'application' + }); + } + } + }); + bootApplication(); + equal(trim(_emberViews.jQuery('#qunit-fixture').text()), 'hi'); + _emberMetal.run(router, 'send', 'openLayer'); + equal(trim(_emberViews.jQuery('#qunit-fixture').text()), 'hilayer'); + _emberMetal.run(router, 'send', 'openLayer'); + equal(trim(_emberViews.jQuery('#qunit-fixture').text()), 'hilayer'); + _emberMetal.run(router, 'send', 'close'); + equal(trim(_emberViews.jQuery('#qunit-fixture').text()), 'hi'); + }); + + QUnit.test('Renders child into parent with non-default template name', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); + _emberGlimmer.setTemplate('exports/root', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); + _emberGlimmer.setTemplate('exports/index', _emberTemplateCompiler.compile('
    ')); + + Router.map(function () { + this.route('root', function () {}); + }); + + App.RootRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render('exports/root'); + } + }); + + App.RootIndexRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render('exports/index'); + } + }); + + bootApplication(); + handleURL('/root'); + equal(_emberViews.jQuery('#qunit-fixture .a .b .c').length, 1); + }); + + QUnit.test('Allows any route to disconnectOutlet another route\'s templates', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet}}{{outlet "modal"}}')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('hi')); + _emberGlimmer.setTemplate('layer', _emberTemplateCompiler.compile('layer')); + App.ApplicationRoute = _emberRouting.Route.extend({ + actions: { + openLayer: function () { + this.render('layer', { + into: 'application', + outlet: 'modal' + }); + } + } + }); + App.IndexRoute = _emberRouting.Route.extend({ + actions: { + close: function () { + this.disconnectOutlet({ + parentView: 'application', + outlet: 'modal' + }); + } + } + }); + bootApplication(); + equal(trim(_emberViews.jQuery('#qunit-fixture').text()), 'hi'); + _emberMetal.run(router, 'send', 'openLayer'); + equal(trim(_emberViews.jQuery('#qunit-fixture').text()), 'hilayer'); + _emberMetal.run(router, 'send', 'close'); + equal(trim(_emberViews.jQuery('#qunit-fixture').text()), 'hi'); + }); + + QUnit.test('Can this.render({into:...}) the render helper', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('other')); + _emberGlimmer.setTemplate('bar', _emberTemplateCompiler.compile('bar')); + + App.IndexRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render({ into: 'sidebar' }); + }, + actions: { + changeToBar: function () { + this.disconnectOutlet({ + parentView: 'sidebar', + outlet: 'main' + }); + this.render('bar', { into: 'sidebar' }); + } + } + }); + + bootApplication(); + equal(_emberViews.jQuery('#qunit-fixture .sidebar').text(), 'other'); + _emberMetal.run(router, 'send', 'changeToBar'); + equal(_emberViews.jQuery('#qunit-fixture .sidebar').text(), 'bar'); + }); + + QUnit.test('Can disconnect from the render helper', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('other')); + + App.IndexRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render({ into: 'sidebar' }); + }, + actions: { + disconnect: function () { + this.disconnectOutlet({ + parentView: 'sidebar', + outlet: 'main' + }); + } + } + }); + + bootApplication(); + equal(_emberViews.jQuery('#qunit-fixture .sidebar').text(), 'other'); + _emberMetal.run(router, 'send', 'disconnect'); + equal(_emberViews.jQuery('#qunit-fixture .sidebar').text(), ''); + }); + + QUnit.test('Can this.render({into:...}) the render helper\'s children', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); + _emberGlimmer.setTemplate('other', _emberTemplateCompiler.compile('other')); + _emberGlimmer.setTemplate('bar', _emberTemplateCompiler.compile('bar')); + + App.IndexRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render({ into: 'sidebar' }); + this.render('other', { into: 'index' }); + }, + actions: { + changeToBar: function () { + this.disconnectOutlet({ + parentView: 'index', + outlet: 'main' + }); + this.render('bar', { into: 'index' }); + } + } + }); + + bootApplication(); + equal(_emberViews.jQuery('#qunit-fixture .sidebar .index').text(), 'other'); + _emberMetal.run(router, 'send', 'changeToBar'); + equal(_emberViews.jQuery('#qunit-fixture .sidebar .index').text(), 'bar'); + }); + + QUnit.test('Can disconnect from the render helper\'s children', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); + _emberGlimmer.setTemplate('other', _emberTemplateCompiler.compile('other')); + + App.IndexRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render({ into: 'sidebar' }); + this.render('other', { into: 'index' }); + }, + actions: { + disconnect: function () { + this.disconnectOutlet({ + parentView: 'index', + outlet: 'main' + }); + } + } + }); + + bootApplication(); + equal(_emberViews.jQuery('#qunit-fixture .sidebar .index').text(), 'other'); + _emberMetal.run(router, 'send', 'disconnect'); + equal(_emberViews.jQuery('#qunit-fixture .sidebar .index').text(), ''); + }); + + QUnit.test('Can this.render({into:...}) nested render helpers', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); + _emberGlimmer.setTemplate('cart', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('other')); + _emberGlimmer.setTemplate('baz', _emberTemplateCompiler.compile('baz')); + + App.IndexRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render({ into: 'cart' }); + }, + actions: { + changeToBaz: function () { + this.disconnectOutlet({ + parentView: 'cart', + outlet: 'main' + }); + this.render('baz', { into: 'cart' }); + } + } + }); + + bootApplication(); + equal(_emberViews.jQuery('#qunit-fixture .cart').text(), 'other'); + _emberMetal.run(router, 'send', 'changeToBaz'); + equal(_emberViews.jQuery('#qunit-fixture .cart').text(), 'baz'); + }); + + QUnit.test('Can disconnect from nested render helpers', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); + _emberGlimmer.setTemplate('cart', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('other')); + + App.IndexRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render({ into: 'cart' }); + }, + actions: { + disconnect: function () { + this.disconnectOutlet({ + parentView: 'cart', + outlet: 'main' + }); + } + } + }); + + bootApplication(); + equal(_emberViews.jQuery('#qunit-fixture .cart').text(), 'other'); + _emberMetal.run(router, 'send', 'disconnect'); + equal(_emberViews.jQuery('#qunit-fixture .cart').text(), ''); + }); + + QUnit.test('Components inside an outlet have their didInsertElement hook invoked when the route is displayed', function (assert) { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#if showFirst}}{{my-component}}{{else}}{{other-component}}{{/if}}')); + + var myComponentCounter = 0; + var otherComponentCounter = 0; + var indexController = undefined; + + App.IndexController = _emberRuntime.Controller.extend({ + showFirst: true + }); + + App.IndexRoute = _emberRouting.Route.extend({ + setupController: function (controller) { + indexController = controller; + } + }); + + App.MyComponentComponent = _emberGlimmer.Component.extend({ + didInsertElement: function () { + myComponentCounter++; + } + }); + + App.OtherComponentComponent = _emberGlimmer.Component.extend({ + didInsertElement: function () { + otherComponentCounter++; + } + }); + + bootApplication(); + + assert.strictEqual(myComponentCounter, 1, 'didInsertElement invoked on displayed component'); + assert.strictEqual(otherComponentCounter, 0, 'didInsertElement not invoked on displayed component'); + + _emberMetal.run(function () { + return indexController.set('showFirst', false); + }); + + assert.strictEqual(myComponentCounter, 1, 'didInsertElement not invoked on displayed component'); + assert.strictEqual(otherComponentCounter, 1, 'didInsertElement invoked on displayed component'); + }); + + QUnit.test('Doesnt swallow exception thrown from willTransition', function () { + expect(1); + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('index')); + _emberGlimmer.setTemplate('other', _emberTemplateCompiler.compile('other')); + + Router.map(function () { + this.route('other', function () {}); + }); + + App.IndexRoute = _emberRouting.Route.extend({ + actions: { + willTransition: function () { + throw new Error('boom'); + } + } + }); + + bootApplication(); + + throws(function () { + _emberMetal.run(function () { + return router.handleURL('/other'); + }); + }, /boom/, 'expected an exception that didnt happen'); + }); + + QUnit.test('Exception if outlet name is undefined in render and disconnectOutlet', function (assert) { + App.ApplicationRoute = _emberRouting.Route.extend({ + actions: { + showModal: function () { + this.render({ + outlet: undefined, + parentView: 'application' + }); + }, + hideModal: function () { + this.disconnectOutlet({ + outlet: undefined, + parentView: 'application' + }); + } + } + }); + + bootApplication(); + + throws(function () { + _emberMetal.run(function () { + return router.send('showModal'); + }); + }, /You passed undefined as the outlet name/); + + throws(function () { + _emberMetal.run(function () { + return router.send('hideModal'); + }); + }, /You passed undefined as the outlet name/); + }); + + QUnit.test('Route serializers work for Engines', function () { + expect(2); + + // Register engine + var BlogEngine = _emberApplication.Engine.extend(); + registry.register('engine:blog', BlogEngine); + + // Register engine route map + var postSerialize = function (params) { + ok(true, 'serialize hook runs'); + return { + post_id: params.id + }; + }; + var BlogMap = function () { + this.route('post', { path: '/post/:post_id', serialize: postSerialize }); + }; + registry.register('route-map:blog', BlogMap); + + Router.map(function () { + this.mount('blog'); + }); + + bootApplication(); + + equal(router.router.generate('blog.post', { id: '13' }), '/blog/post/13', 'url is generated properly'); + }); + + QUnit.test('Defining a Route#serialize method in an Engine throws an error', function () { + expect(1); + + // Register engine + var BlogEngine = _emberApplication.Engine.extend(); + registry.register('engine:blog', BlogEngine); + + // Register engine route map + var BlogMap = function () { + this.route('post'); + }; + registry.register('route-map:blog', BlogMap); + + Router.map(function () { + this.mount('blog'); + }); + + bootApplication(); + + var PostRoute = _emberRouting.Route.extend({ serialize: function () {} }); + container.lookup('engine:blog').register('route:post', PostRoute); + + throws(function () { + return router.transitionTo('blog.post'); + }, /Defining a custom serialize method on an Engine route is not supported/); + }); + + QUnit.test('App.destroy does not leave undestroyed views after clearing engines', function () { + expect(4); + + var engineInstance = undefined; + // Register engine + var BlogEngine = _emberApplication.Engine.extend(); + registry.register('engine:blog', BlogEngine); + var EngineIndexRoute = _emberRouting.Route.extend({ + init: function () { + this._super.apply(this, arguments); + engineInstance = _emberUtils.getOwner(this); + } + }); + + // Register engine route map + var BlogMap = function () { + this.route('post'); + }; + registry.register('route-map:blog', BlogMap); + + Router.map(function () { + this.mount('blog'); + }); + + bootApplication(); + + var engine = container.lookup('engine:blog'); + engine.register('route:index', EngineIndexRoute); + engine.register('template:index', _emberTemplateCompiler.compile('Engine Post!')); + + handleURL('/blog'); + + var route = engineInstance.lookup('route:index'); + + _emberMetal.run(router, 'destroy'); + equal(router._toplevelView, null, 'the toplevelView was cleared'); + + _emberMetal.run(route, 'destroy'); + equal(router._toplevelView, null, 'the toplevelView was not reinitialized'); + + _emberMetal.run(App, 'destroy'); + equal(router._toplevelView, null, 'the toplevelView was not reinitialized'); + }); +}); +enifed('ember/tests/routing/basic_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/routing'); + test('ember/tests/routing/basic_test.js should pass jscs', function () { + ok(true, 'ember/tests/routing/basic_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/routing/basic_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/routing'); + QUnit.test('ember/tests/routing/basic_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/basic_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'ember-metal', 'ember-routing', 'ember-views', 'internal-test-helpers'], function (exports, _emberRuntime, _emberMetal, _emberRouting, _emberViews, _internalTestHelpers) { + 'use strict'; + + _internalTestHelpers.moduleFor('Query Params - main', (function (_QueryParamTestCase) { + babelHelpers.inherits(_class, _QueryParamTestCase); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _QueryParamTestCase.apply(this, arguments); + } + + _class.prototype.refreshModelWhileLoadingTest = function refreshModelWhileLoadingTest(loadingReturn) { + var _actions, + _this = this; + + var assert = this.assert; + + assert.expect(9); + + var appModelCount = 0; + var promiseResolve = undefined; + + this.registerRoute('application', _emberRouting.Route.extend({ + queryParams: { + appomg: { + defaultValue: 'applol' + } + }, + model: function (params) { + appModelCount++; + } + })); + + this.setSingleQPController('index', 'omg', undefined, { + omg: undefined + }); + + var actionName = typeof loadingReturn !== 'undefined' ? 'loading' : 'ignore'; + var indexModelCount = 0; + this.registerRoute('index', _emberRouting.Route.extend({ + queryParams: { + omg: { + refreshModel: true + } + }, + actions: (_actions = {}, _actions[actionName] = function () { + return loadingReturn; + }, _actions), + model: function (params) { + indexModelCount++; + if (indexModelCount === 2) { + assert.deepEqual(params, { omg: 'lex' }); + return new _emberRuntime.RSVP.Promise(function (resolve) { + promiseResolve = resolve; + return; + }); + } else if (indexModelCount === 3) { + assert.deepEqual(params, { omg: 'hello' }, 'Model hook reruns even if the previous one didnt finish'); + } + } + })); + + return this.visit('/').then(function () { + assert.equal(appModelCount, 1, 'appModelCount is 1'); + assert.equal(indexModelCount, 1); + + var indexController = _this.getController('index'); + _this.setAndFlush(indexController, 'omg', 'lex'); + + assert.equal(appModelCount, 1, 'appModelCount is 1'); + assert.equal(indexModelCount, 2); + + _this.setAndFlush(indexController, 'omg', 'hello'); + assert.equal(appModelCount, 1, 'appModelCount is 1'); + assert.equal(indexModelCount, 3); + + _emberMetal.run(function () { + promiseResolve(); + }); + + assert.equal(_emberMetal.get(indexController, 'omg'), 'hello', 'At the end last value prevails'); + }); + }; + + _class.prototype['@test No replaceURL occurs on startup because default values don\'t show up in URL'] = function testNoReplaceURLOccursOnStartupBecauseDefaultValuesDonTShowUpInURL(assert) { + assert.expect(1); + + this.setSingleQPController('index'); + + return this.visitAndAssert('/'); + }; + + _class.prototype['@test Calling transitionTo does not lose query params already on the activeTransition'] = function testCallingTransitionToDoesNotLoseQueryParamsAlreadyOnTheActiveTransition(assert) { + var _this2 = this; + + assert.expect(2); + + this.router.map(function () { + this.route('parent', function () { + this.route('child'); + this.route('sibling'); + }); + }); + + this.registerRoute('parent.child', _emberRouting.Route.extend({ + afterModel: function () { + this.transitionTo('parent.sibling'); + } + })); + + this.setSingleQPController('parent'); + + return this.visit('/parent/child?foo=lol').then(function () { + _this2.assertCurrentPath('/parent/sibling?foo=lol', 'redirected to the sibling route, instead of child route'); + assert.equal(_this2.getController('parent').get('foo'), 'lol', 'controller has value from the active transition'); + }); + }; + + _class.prototype['@test Single query params can be set on the controller and reflected in the url'] = function testSingleQueryParamsCanBeSetOnTheControllerAndReflectedInTheUrl(assert) { + var _this3 = this; + + assert.expect(3); + + this.router.map(function () { + this.route('home', { path: '/' }); + }); + + this.setSingleQPController('home'); + + return this.visitAndAssert('/').then(function () { + var controller = _this3.getController('home'); + + _this3.setAndFlush(controller, 'foo', '456'); + _this3.assertCurrentPath('/?foo=456'); + + _this3.setAndFlush(controller, 'foo', '987'); + _this3.assertCurrentPath('/?foo=987'); + }); + }; + + _class.prototype['@test Query params can map to different url keys configured on the controller'] = function testQueryParamsCanMapToDifferentUrlKeysConfiguredOnTheController(assert) { + var _this4 = this; + + assert.expect(6); + + this.registerController('index', _emberRuntime.Controller.extend({ + queryParams: [{ foo: 'other_foo', bar: { as: 'other_bar' } }], + foo: 'FOO', + bar: 'BAR' + })); + + return this.visitAndAssert('/').then(function () { + var controller = _this4.getController('index'); + + _this4.setAndFlush(controller, 'foo', 'LEX'); + _this4.assertCurrentPath('/?other_foo=LEX', 'QP mapped correctly without \'as\''); + + _this4.setAndFlush(controller, 'foo', 'WOO'); + _this4.assertCurrentPath('/?other_foo=WOO', 'QP updated correctly without \'as\''); + + _this4.transitionTo('/?other_foo=NAW'); + assert.equal(controller.get('foo'), 'NAW', 'QP managed correctly on URL transition'); + + _this4.setAndFlush(controller, 'bar', 'NERK'); + _this4.assertCurrentPath('/?other_bar=NERK&other_foo=NAW', 'QP mapped correctly with \'as\''); + + _this4.setAndFlush(controller, 'bar', 'NUKE'); + _this4.assertCurrentPath('/?other_bar=NUKE&other_foo=NAW', 'QP updated correctly with \'as\''); + }); + }; + + _class.prototype['@test Routes have a private overridable serializeQueryParamKey hook'] = function testRoutesHaveAPrivateOverridableSerializeQueryParamKeyHook(assert) { + var _this5 = this; + + assert.expect(2); + + this.registerRoute('index', _emberRouting.Route.extend({ + serializeQueryParamKey: _emberRuntime.String.dasherize + })); + + this.setSingleQPController('index', 'funTimes', ''); + + return this.visitAndAssert('/').then(function () { + var controller = _this5.getController('index'); + + _this5.setAndFlush(controller, 'funTimes', 'woot'); + _this5.assertCurrentPath('/?fun-times=woot'); + }); + }; + + _class.prototype['@test Can override inherited QP behavior by specifying queryParams as a computed property'] = function testCanOverrideInheritedQPBehaviorBySpecifyingQueryParamsAsAComputedProperty(assert) { + var _this6 = this; + + assert.expect(3); + + this.setSingleQPController('index', 'a', 0, { + queryParams: _emberMetal.computed(function () { + return ['c']; + }), + c: true + }); + + return this.visitAndAssert('/').then(function () { + var indexController = _this6.getController('index'); + + _this6.setAndFlush(indexController, 'a', 1); + _this6.assertCurrentPath('/', 'QP did not update due to being overriden'); + + _this6.setAndFlush(indexController, 'c', false); + _this6.assertCurrentPath('/?c=false', 'QP updated with overriden param'); + }); + }; + + _class.prototype['@test Can concatenate inherited QP behavior by specifying queryParams as an array'] = function testCanConcatenateInheritedQPBehaviorBySpecifyingQueryParamsAsAnArray(assert) { + var _this7 = this; + + assert.expect(3); + + this.setSingleQPController('index', 'a', 0, { + queryParams: ['c'], + c: true + }); + + return this.visitAndAssert('/').then(function () { + var indexController = _this7.getController('index'); + + _this7.setAndFlush(indexController, 'a', 1); + _this7.assertCurrentPath('/?a=1', 'Inherited QP did update'); + + _this7.setAndFlush(indexController, 'c', false); + _this7.assertCurrentPath('/?a=1&c=false', 'New QP did update'); + }); + }; + + _class.prototype['@test model hooks receives query params'] = function testModelHooksReceivesQueryParams(assert) { + assert.expect(2); + + this.setSingleQPController('index'); + + this.registerRoute('index', _emberRouting.Route.extend({ + model: function (params) { + assert.deepEqual(params, { foo: 'bar' }); + } + })); + + return this.visitAndAssert('/'); + }; + + _class.prototype['@test model hooks receives query params with dynamic segment params'] = function testModelHooksReceivesQueryParamsWithDynamicSegmentParams(assert) { + assert.expect(2); + + this.router.map(function () { + this.route('index', { path: '/:id' }); + }); + + this.setSingleQPController('index'); + + this.registerRoute('index', _emberRouting.Route.extend({ + model: function (params) { + assert.deepEqual(params, { foo: 'bar', id: 'baz' }); + } + })); + + return this.visitAndAssert('/baz'); + }; + + _class.prototype['@test model hooks receives query params (overridden by incoming url value)'] = function testModelHooksReceivesQueryParamsOverriddenByIncomingUrlValue(assert) { + assert.expect(2); + + this.router.map(function () { + this.route('index', { path: '/:id' }); + }); + + this.setSingleQPController('index'); + + this.registerRoute('index', _emberRouting.Route.extend({ + model: function (params) { + assert.deepEqual(params, { foo: 'baz', id: 'boo' }); + } + })); + + return this.visitAndAssert('/boo?foo=baz'); + }; + + _class.prototype['@test error is thrown if dynamic segment and query param have same name'] = function testErrorIsThrownIfDynamicSegmentAndQueryParamHaveSameName(assert) { + var _this8 = this; + + assert.expect(1); + + this.router.map(function () { + this.route('index', { path: '/:foo' }); + }); + + this.setSingleQPController('index'); + + expectAssertion(function () { + _this8.visitAndAssert('/boo?foo=baz'); + }, 'The route \'index\' has both a dynamic segment and query param with name \'foo\'. Please rename one to avoid collisions.'); + }; + + _class.prototype['@test controllers won\'t be eagerly instantiated by internal query params logic'] = function testControllersWonTBeEagerlyInstantiatedByInternalQueryParamsLogic(assert) { + var _this9 = this; + + assert.expect(10); + + this.router.map(function () { + this.route('cats', function () { + this.route('index', { path: '/' }); + }); + this.route('home', { path: '/' }); + this.route('about'); + }); + + this.registerTemplate('home', '

    {{link-to \'About\' \'about\' (query-params lol=\'wat\') id=\'link-to-about\'}}

    '); + this.registerTemplate('about', '

    {{link-to \'Home\' \'home\' (query-params foo=\'naw\')}}

    '); + this.registerTemplate('cats.index', '

    {{link-to \'Cats\' \'cats\' (query-params name=\'domino\') id=\'cats-link\'}}

    '); + + var homeShouldBeCreated = false; + var aboutShouldBeCreated = false; + var catsIndexShouldBeCreated = false; + + this.registerRoute('home', _emberRouting.Route.extend({ + setup: function () { + homeShouldBeCreated = true; + this._super.apply(this, arguments); + } + })); + + this.setSingleQPController('home', 'foo', '123', { + init: function () { + this._super.apply(this, arguments); + assert.ok(homeShouldBeCreated, 'HomeController should be created at this time'); + } + }); + + this.registerRoute('about', _emberRouting.Route.extend({ + setup: function () { + aboutShouldBeCreated = true; + this._super.apply(this, arguments); + } + })); + + this.setSingleQPController('about', 'lol', 'haha', { + init: function () { + this._super.apply(this, arguments); + assert.ok(aboutShouldBeCreated, 'AboutController should be created at this time'); + } + }); + + this.registerRoute('cats.index', _emberRouting.Route.extend({ + model: function () { + return []; + }, + setup: function () { + catsIndexShouldBeCreated = true; + this._super.apply(this, arguments); + }, + setupController: function (controller, context) { + controller.set('model', context); + } + })); + + this.registerController('cats.index', _emberRuntime.Controller.extend({ + queryParams: ['breed', 'name'], + breed: 'Golden', + name: null, + init: function () { + this._super.apply(this, arguments); + assert.ok(catsIndexShouldBeCreated, 'CatsIndexController should be created at this time'); + } + })); + + return this.visitAndAssert('/').then(function () { + var controller = _this9.getController('home'); + + _this9.setAndFlush(controller, 'foo', '456'); + _this9.assertCurrentPath('/?foo=456'); + assert.equal(_emberViews.jQuery('#link-to-about').attr('href'), '/about?lol=wat', 'link to about is correct'); + + _this9.transitionTo('about'); + _this9.assertCurrentPath('/about'); + + _this9.transitionTo('cats'); + _this9.assertCurrentPath('/cats'); + assert.equal(_emberViews.jQuery('#cats-link').attr('href'), '/cats?name=domino', 'link to cats is correct'); + + _emberMetal.run(_emberViews.jQuery('#cats-link'), 'click'); + _this9.assertCurrentPath('/cats?name=domino'); + }); + }; + + _class.prototype['@test query params have been set by the time setupController is called'] = function testQueryParamsHaveBeenSetByTheTimeSetupControllerIsCalled(assert) { + assert.expect(2); + + this.setSingleQPController('application'); + + this.registerRoute('application', _emberRouting.Route.extend({ + setupController: function (controller) { + assert.equal(controller.get('foo'), 'YEAH', 'controller\'s foo QP property set before setupController called'); + } + })); + + return this.visitAndAssert('/?foo=YEAH'); + }; + + _class.prototype['@test mapped query params have been set by the time setupController is called'] = function testMappedQueryParamsHaveBeenSetByTheTimeSetupControllerIsCalled(assert) { + assert.expect(2); + + this.setSingleQPController('application', { faz: 'foo' }); + + this.registerRoute('application', _emberRouting.Route.extend({ + setupController: function (controller) { + assert.equal(controller.get('faz'), 'YEAH', 'controller\'s foo QP property set before setupController called'); + } + })); + + return this.visitAndAssert('/?foo=YEAH'); + }; + + _class.prototype['@test Route#paramsFor fetches query params with default value'] = function testRouteParamsForFetchesQueryParamsWithDefaultValue(assert) { + assert.expect(2); + + this.router.map(function () { + this.route('index', { path: '/:something' }); + }); + + this.setSingleQPController('index'); + + this.registerRoute('index', _emberRouting.Route.extend({ + model: function (params, transition) { + assert.deepEqual(this.paramsFor('index'), { something: 'baz', foo: 'bar' }, 'could retrieve params for index'); + } + })); + + return this.visitAndAssert('/baz'); + }; + + _class.prototype['@test Route#paramsFor fetches query params with non-default value'] = function testRouteParamsForFetchesQueryParamsWithNonDefaultValue(assert) { + assert.expect(2); + + this.router.map(function () { + this.route('index', { path: '/:something' }); + }); + + this.setSingleQPController('index'); + + this.registerRoute('index', _emberRouting.Route.extend({ + model: function (params, transition) { + assert.deepEqual(this.paramsFor('index'), { something: 'baz', foo: 'boo' }, 'could retrieve params for index'); + } + })); + + return this.visitAndAssert('/baz?foo=boo'); + }; + + _class.prototype['@test Route#paramsFor fetches default falsy query params'] = function testRouteParamsForFetchesDefaultFalsyQueryParams(assert) { + assert.expect(2); + + this.router.map(function () { + this.route('index', { path: '/:something' }); + }); + + this.setSingleQPController('index', 'foo', false); + + this.registerRoute('index', _emberRouting.Route.extend({ + model: function (params, transition) { + assert.deepEqual(this.paramsFor('index'), { something: 'baz', foo: false }, 'could retrieve params for index'); + } + })); + + return this.visitAndAssert('/baz'); + }; + + _class.prototype['@test Route#paramsFor fetches non-default falsy query params'] = function testRouteParamsForFetchesNonDefaultFalsyQueryParams(assert) { + assert.expect(2); + + this.router.map(function () { + this.route('index', { path: '/:something' }); + }); + + this.setSingleQPController('index', 'foo', true); + + this.registerRoute('index', _emberRouting.Route.extend({ + model: function (params, transition) { + assert.deepEqual(this.paramsFor('index'), { something: 'baz', foo: false }, 'could retrieve params for index'); + } + })); + + return this.visitAndAssert('/baz?foo=false'); + }; + + _class.prototype['@test model hook can query prefix-less application params'] = function testModelHookCanQueryPrefixLessApplicationParams(assert) { + assert.expect(4); + + this.setSingleQPController('application', 'appomg', 'applol'); + this.setSingleQPController('index', 'omg', 'lol'); + + this.registerRoute('application', _emberRouting.Route.extend({ + model: function (params) { + assert.deepEqual(params, { appomg: 'applol' }); + } + })); + + this.registerRoute('index', _emberRouting.Route.extend({ + model: function (params) { + assert.deepEqual(params, { omg: 'lol' }); + assert.deepEqual(this.paramsFor('application'), { appomg: 'applol' }); + } + })); + + return this.visitAndAssert('/'); + }; + + _class.prototype['@test model hook can query prefix-less application params (overridden by incoming url value)'] = function testModelHookCanQueryPrefixLessApplicationParamsOverriddenByIncomingUrlValue(assert) { + assert.expect(4); + + this.setSingleQPController('application', 'appomg', 'applol'); + this.setSingleQPController('index', 'omg', 'lol'); + + this.registerRoute('application', _emberRouting.Route.extend({ + model: function (params) { + assert.deepEqual(params, { appomg: 'appyes' }); + } + })); + + this.registerRoute('index', _emberRouting.Route.extend({ + model: function (params) { + assert.deepEqual(params, { omg: 'yes' }); + assert.deepEqual(this.paramsFor('application'), { appomg: 'appyes' }); + } + })); + + return this.visitAndAssert('/?appomg=appyes&omg=yes'); + }; + + _class.prototype['@test can opt into full transition by setting refreshModel in route queryParams'] = function testCanOptIntoFullTransitionBySettingRefreshModelInRouteQueryParams(assert) { + var _this10 = this; + + assert.expect(7); + + this.setSingleQPController('application', 'appomg', 'applol'); + this.setSingleQPController('index', 'omg', 'lol'); + + var appModelCount = 0; + this.registerRoute('application', _emberRouting.Route.extend({ + model: function (params) { + appModelCount++; + } + })); + + var indexModelCount = 0; + this.registerRoute('index', _emberRouting.Route.extend({ + queryParams: { + omg: { + refreshModel: true + } + }, + model: function (params) { + indexModelCount++; + + if (indexModelCount === 1) { + assert.deepEqual(params, { omg: 'lol' }, 'params are correct on first pass'); + } else if (indexModelCount === 2) { + assert.deepEqual(params, { omg: 'lex' }, 'params are correct on second pass'); + } + } + })); + + return this.visitAndAssert('/').then(function () { + assert.equal(appModelCount, 1, 'app model hook ran'); + assert.equal(indexModelCount, 1, 'index model hook ran'); + + var indexController = _this10.getController('index'); + _this10.setAndFlush(indexController, 'omg', 'lex'); + + assert.equal(appModelCount, 1, 'app model hook did not run again'); + assert.equal(indexModelCount, 2, 'index model hook ran again due to refreshModel'); + }); + }; + + _class.prototype['@test refreshModel does not cause a second transition during app boot '] = function testRefreshModelDoesNotCauseASecondTransitionDuringAppBoot(assert) { + assert.expect(1); + + this.setSingleQPController('application', 'appomg', 'applol'); + this.setSingleQPController('index', 'omg', 'lol'); + + this.registerRoute('index', _emberRouting.Route.extend({ + queryParams: { + omg: { + refreshModel: true + } + }, + refresh: function () { + assert.ok(false); + } + })); + + return this.visitAndAssert('/?appomg=hello&omg=world'); + }; + + _class.prototype['@test queryParams are updated when a controller property is set and the route is refreshed. Issue #13263 '] = function testQueryParamsAreUpdatedWhenAControllerPropertyIsSetAndTheRouteIsRefreshedIssue13263(assert) { + var _this11 = this; + + this.registerTemplate('application', '{{foo}}{{outlet}}'); + + this.setSingleQPController('application', 'foo', 1, { + actions: { + increment: function () { + this.incrementProperty('foo'); + this.send('refreshRoute'); + } + } + }); + + this.registerRoute('application', _emberRouting.Route.extend({ + actions: { + refreshRoute: function () { + this.refresh(); + } + } + })); + + return this.visitAndAssert('/').then(function () { + assert.equal(_emberViews.jQuery('#test-value').text().trim(), '1'); + + _emberMetal.run(_emberViews.jQuery('#test-button'), 'click'); + assert.equal(_emberViews.jQuery('#test-value').text().trim(), '2'); + _this11.assertCurrentPath('/?foo=2'); + + _emberMetal.run(_emberViews.jQuery('#test-button'), 'click'); + assert.equal(_emberViews.jQuery('#test-value').text().trim(), '3'); + _this11.assertCurrentPath('/?foo=3'); + }); + }; + + _class.prototype['@test Use Ember.get to retrieve query params \'refreshModel\' configuration'] = function testUseEmberGetToRetrieveQueryParamsRefreshModelConfiguration(assert) { + var _this12 = this; + + assert.expect(7); + + this.setSingleQPController('application', 'appomg', 'applol'); + this.setSingleQPController('index', 'omg', 'lol'); + + var appModelCount = 0; + this.registerRoute('application', _emberRouting.Route.extend({ + model: function (params) { + appModelCount++; + } + })); + + var indexModelCount = 0; + this.registerRoute('index', _emberRouting.Route.extend({ + queryParams: _emberRuntime.Object.create({ + unknownProperty: function (keyName) { + return { refreshModel: true }; + } + }), + model: function (params) { + indexModelCount++; + + if (indexModelCount === 1) { + assert.deepEqual(params, { omg: 'lol' }); + } else if (indexModelCount === 2) { + assert.deepEqual(params, { omg: 'lex' }); + } + } + })); + + return this.visitAndAssert('/').then(function () { + assert.equal(appModelCount, 1); + assert.equal(indexModelCount, 1); + + var indexController = _this12.getController('index'); + _this12.setAndFlush(indexController, 'omg', 'lex'); + + assert.equal(appModelCount, 1); + assert.equal(indexModelCount, 2); + }); + }; + + _class.prototype['@test can use refreshModel even with URL changes that remove QPs from address bar'] = function testCanUseRefreshModelEvenWithURLChangesThatRemoveQPsFromAddressBar(assert) { + var _this13 = this; + + assert.expect(4); + + this.setSingleQPController('index', 'omg', 'lol'); + + var indexModelCount = 0; + this.registerRoute('index', _emberRouting.Route.extend({ + queryParams: { + omg: { + refreshModel: true + } + }, + model: function (params) { + indexModelCount++; + + var data = undefined; + if (indexModelCount === 1) { + data = 'foo'; + } else if (indexModelCount === 2) { + data = 'lol'; + } + + assert.deepEqual(params, { omg: data }, 'index#model receives right data'); + } + })); + + return this.visitAndAssert('/?omg=foo').then(function () { + _this13.transitionTo('/'); + + var indexController = _this13.getController('index'); + assert.equal(indexController.get('omg'), 'lol'); + }); + }; + + _class.prototype['@test can opt into a replace query by specifying replace:true in the Route config hash'] = function testCanOptIntoAReplaceQueryBySpecifyingReplaceTrueInTheRouteConfigHash(assert) { + var _this14 = this; + + assert.expect(2); + + this.setSingleQPController('application', 'alex', 'matchneer'); + + this.registerRoute('application', _emberRouting.Route.extend({ + queryParams: { + alex: { + replace: true + } + } + })); + + return this.visitAndAssert('/').then(function () { + var appController = _this14.getController('application'); + _this14.expectedReplaceURL = '/?alex=wallace'; + _this14.setAndFlush(appController, 'alex', 'wallace'); + }); + }; + + _class.prototype['@test Route query params config can be configured using property name instead of URL key'] = function testRouteQueryParamsConfigCanBeConfiguredUsingPropertyNameInsteadOfURLKey(assert) { + var _this15 = this; + + assert.expect(2); + + this.registerController('application', _emberRuntime.Controller.extend({ + queryParams: [{ commitBy: 'commit_by' }] + })); + + this.registerRoute('application', _emberRouting.Route.extend({ + queryParams: { + commitBy: { + replace: true + } + } + })); + + return this.visitAndAssert('/').then(function () { + var appController = _this15.getController('application'); + _this15.expectedReplaceURL = '/?commit_by=igor_seb'; + _this15.setAndFlush(appController, 'commitBy', 'igor_seb'); + }); + }; + + _class.prototype['@test An explicit replace:false on a changed QP always wins and causes a pushState'] = function testAnExplicitReplaceFalseOnAChangedQPAlwaysWinsAndCausesAPushState(assert) { + var _this16 = this; + + assert.expect(3); + + this.registerController('application', _emberRuntime.Controller.extend({ + queryParams: ['alex', 'steely'], + alex: 'matchneer', + steely: 'dan' + })); + + this.registerRoute('application', _emberRouting.Route.extend({ + queryParams: { + alex: { + replace: true + }, + steely: { + replace: false + } + } + })); + + return this.visit('/').then(function () { + var appController = _this16.getController('application'); + _this16.expectedPushURL = '/?alex=wallace&steely=jan'; + _emberMetal.run(appController, 'setProperties', { alex: 'wallace', steely: 'jan' }); + + _this16.expectedPushURL = '/?alex=wallace&steely=fran'; + _emberMetal.run(appController, 'setProperties', { steely: 'fran' }); + + _this16.expectedReplaceURL = '/?alex=sriracha&steely=fran'; + _emberMetal.run(appController, 'setProperties', { alex: 'sriracha' }); + }); + }; + + _class.prototype['@test can opt into full transition by setting refreshModel in route queryParams when transitioning from child to parent'] = function testCanOptIntoFullTransitionBySettingRefreshModelInRouteQueryParamsWhenTransitioningFromChildToParent(assert) { + this.registerTemplate('parent', '{{outlet}}'); + this.registerTemplate('parent.child', '{{link-to \'Parent\' \'parent\' (query-params foo=\'change\') id=\'parent-link\'}}'); + + this.router.map(function () { + this.route('parent', function () { + this.route('child'); + }); + }); + + var parentModelCount = 0; + this.registerRoute('parent', _emberRouting.Route.extend({ + model: function () { + parentModelCount++; + }, + queryParams: { + foo: { + refreshModel: true + } + } + })); + + this.setSingleQPController('parent', 'foo', 'abc'); + + return this.visit('/parent/child?foo=lol').then(function () { + assert.equal(parentModelCount, 1); + + _emberMetal.run(_emberViews.jQuery('#parent-link'), 'click'); + assert.equal(parentModelCount, 2); + }); + }; + + _class.prototype['@test Use Ember.get to retrieve query params \'replace\' configuration'] = function testUseEmberGetToRetrieveQueryParamsReplaceConfiguration(assert) { + var _this17 = this; + + assert.expect(2); + + this.setSingleQPController('application', 'alex', 'matchneer'); + + this.registerRoute('application', _emberRouting.Route.extend({ + queryParams: _emberRuntime.Object.create({ + unknownProperty: function (keyName) { + // We are simulating all qps requiring refresh + return { replace: true }; + } + }) + })); + + return this.visitAndAssert('/').then(function () { + var appController = _this17.getController('application'); + _this17.expectedReplaceURL = '/?alex=wallace'; + _this17.setAndFlush(appController, 'alex', 'wallace'); + }); + }; + + _class.prototype['@test can override incoming QP values in setupController'] = function testCanOverrideIncomingQPValuesInSetupController(assert) { + var _this18 = this; + + assert.expect(3); + + this.router.map(function () { + this.route('about'); + }); + + this.setSingleQPController('index', 'omg', 'lol'); + + this.registerRoute('index', _emberRouting.Route.extend({ + setupController: function (controller) { + assert.ok(true, 'setupController called'); + controller.set('omg', 'OVERRIDE'); + }, + actions: { + queryParamsDidChange: function () { + assert.ok(false, 'queryParamsDidChange shouldn\'t fire'); + } + } + })); + + return this.visitAndAssert('/about').then(function () { + _this18.transitionTo('index'); + _this18.assertCurrentPath('/?omg=OVERRIDE'); + }); + }; + + _class.prototype['@test can override incoming QP array values in setupController'] = function testCanOverrideIncomingQPArrayValuesInSetupController(assert) { + var _this19 = this; + + assert.expect(3); + + this.router.map(function () { + this.route('about'); + }); + + this.setSingleQPController('index', 'omg', ['lol']); + + this.registerRoute('index', _emberRouting.Route.extend({ + setupController: function (controller) { + assert.ok(true, 'setupController called'); + controller.set('omg', ['OVERRIDE']); + }, + actions: { + queryParamsDidChange: function () { + assert.ok(false, 'queryParamsDidChange shouldn\'t fire'); + } + } + })); + + return this.visitAndAssert('/about').then(function () { + _this19.transitionTo('index'); + _this19.assertCurrentPath('/?omg=' + encodeURIComponent(JSON.stringify(['OVERRIDE']))); + }); + }; + + _class.prototype['@test URL transitions that remove QPs still register as QP changes'] = function testURLTransitionsThatRemoveQPsStillRegisterAsQPChanges(assert) { + var _this20 = this; + + assert.expect(2); + + this.setSingleQPController('index', 'omg', 'lol'); + + return this.visit('/?omg=borf').then(function () { + var indexController = _this20.getController('index'); + assert.equal(indexController.get('omg'), 'borf'); + + _this20.transitionTo('/'); + assert.equal(indexController.get('omg'), 'lol'); + }); + }; + + _class.prototype['@test Subresource naming style is supported'] = function testSubresourceNamingStyleIsSupported(assert) { + var _this21 = this; + + assert.expect(5); + + this.router.map(function () { + this.route('abc.def', { path: '/abcdef' }, function () { + this.route('zoo'); + }); + }); + + this.registerTemplate('application', '{{link-to \'A\' \'abc.def\' (query-params foo=\'123\') id=\'one\'}}{{link-to \'B\' \'abc.def.zoo\' (query-params foo=\'123\' bar=\'456\') id=\'two\'}}{{outlet}}'); + + this.setSingleQPController('abc.def', 'foo', 'lol'); + this.setSingleQPController('abc.def.zoo', 'bar', 'haha'); + + return this.visitAndAssert('/').then(function () { + assert.equal(_emberViews.jQuery('#one').attr('href'), '/abcdef?foo=123'); + assert.equal(_emberViews.jQuery('#two').attr('href'), '/abcdef/zoo?bar=456&foo=123'); + + _emberMetal.run(_emberViews.jQuery('#one'), 'click'); + _this21.assertCurrentPath('/abcdef?foo=123'); + + _emberMetal.run(_emberViews.jQuery('#two'), 'click'); + _this21.assertCurrentPath('/abcdef/zoo?bar=456&foo=123'); + }); + }; + + _class.prototype['@test transitionTo supports query params'] = function testTransitionToSupportsQueryParams(assert) { + var _this22 = this; + + this.setSingleQPController('index', 'foo', 'lol'); + + return this.visitAndAssert('/').then(function () { + _this22.transitionTo({ queryParams: { foo: 'borf' } }); + _this22.assertCurrentPath('/?foo=borf', 'shorthand supported'); + + _this22.transitionTo({ queryParams: { 'index:foo': 'blaf' } }); + _this22.assertCurrentPath('/?foo=blaf', 'longform supported'); + + _this22.transitionTo({ queryParams: { 'index:foo': false } }); + _this22.assertCurrentPath('/?foo=false', 'longform supported (bool)'); + + _this22.transitionTo({ queryParams: { foo: false } }); + _this22.assertCurrentPath('/?foo=false', 'shorhand supported (bool)'); + }); + }; + + _class.prototype['@test transitionTo supports query params (multiple)'] = function testTransitionToSupportsQueryParamsMultiple(assert) { + var _this23 = this; + + this.registerController('index', _emberRuntime.Controller.extend({ + queryParams: ['foo', 'bar'], + foo: 'lol', + bar: 'wat' + })); + + return this.visitAndAssert('/').then(function () { + _this23.transitionTo({ queryParams: { foo: 'borf' } }); + _this23.assertCurrentPath('/?foo=borf', 'shorthand supported'); + + _this23.transitionTo({ queryParams: { 'index:foo': 'blaf' } }); + _this23.assertCurrentPath('/?foo=blaf', 'longform supported'); + + _this23.transitionTo({ queryParams: { 'index:foo': false } }); + _this23.assertCurrentPath('/?foo=false', 'longform supported (bool)'); + + _this23.transitionTo({ queryParams: { foo: false } }); + _this23.assertCurrentPath('/?foo=false', 'shorhand supported (bool)'); + }); + }; + + _class.prototype['@test setting controller QP to empty string doesn\'t generate null in URL'] = function testSettingControllerQPToEmptyStringDoesnTGenerateNullInURL(assert) { + var _this24 = this; + + assert.expect(1); + + this.setSingleQPController('index', 'foo', '123'); + + return this.visit('/').then(function () { + var controller = _this24.getController('index'); + + _this24.expectedPushURL = '/?foo='; + _this24.setAndFlush(controller, 'foo', ''); + }); + }; + + _class.prototype['@test setting QP to empty string doesn\'t generate null in URL'] = function testSettingQPToEmptyStringDoesnTGenerateNullInURL(assert) { + var _this25 = this; + + assert.expect(1); + + this.registerRoute('index', _emberRouting.Route.extend({ + queryParams: { + foo: { + defaultValue: '123' + } + } + })); + + return this.visit('/').then(function () { + var controller = _this25.getController('index'); + + _this25.expectedPushURL = '/?foo='; + _this25.setAndFlush(controller, 'foo', ''); + }); + }; + + _class.prototype['@test A default boolean value deserializes QPs as booleans rather than strings'] = function testADefaultBooleanValueDeserializesQPsAsBooleansRatherThanStrings(assert) { + var _this26 = this; + + assert.expect(3); + + this.setSingleQPController('index', 'foo', false); + + this.registerRoute('index', _emberRouting.Route.extend({ + model: function (params) { + assert.equal(params.foo, true, 'model hook received foo as boolean true'); + } + })); + + return this.visit('/?foo=true').then(function () { + var controller = _this26.getController('index'); + assert.equal(controller.get('foo'), true); + + _this26.transitionTo('/?foo=false'); + assert.equal(controller.get('foo'), false); + }); + }; + + _class.prototype['@test Query param without value are empty string'] = function testQueryParamWithoutValueAreEmptyString(assert) { + var _this27 = this; + + assert.expect(1); + + this.registerController('index', _emberRuntime.Controller.extend({ + queryParams: ['foo'], + foo: '' + })); + + return this.visit('/?foo=').then(function () { + var controller = _this27.getController('index'); + assert.equal(controller.get('foo'), ''); + }); + }; + + _class.prototype['@test Array query params can be set'] = function testArrayQueryParamsCanBeSet(assert) { + var _this28 = this; + + assert.expect(2); + + this.router.map(function () { + this.route('home', { path: '/' }); + }); + + this.setSingleQPController('home', 'foo', []); + + return this.visit('/').then(function () { + var controller = _this28.getController('home'); + + _this28.setAndFlush(controller, 'foo', [1, 2]); + _this28.assertCurrentPath('/?foo=%5B1%2C2%5D'); + + _this28.setAndFlush(controller, 'foo', [3, 4]); + _this28.assertCurrentPath('/?foo=%5B3%2C4%5D'); + }); + }; + + _class.prototype['@test (de)serialization: arrays'] = function testDeSerializationArrays(assert) { + var _this29 = this; + + assert.expect(4); + + this.setSingleQPController('index', 'foo', [1]); + + return this.visitAndAssert('/').then(function () { + _this29.transitionTo({ queryParams: { foo: [2, 3] } }); + _this29.assertCurrentPath('/?foo=%5B2%2C3%5D', 'shorthand supported'); + _this29.transitionTo({ queryParams: { 'index:foo': [4, 5] } }); + _this29.assertCurrentPath('/?foo=%5B4%2C5%5D', 'longform supported'); + _this29.transitionTo({ queryParams: { foo: [] } }); + _this29.assertCurrentPath('/?foo=%5B%5D', 'longform supported'); + }); + }; + + _class.prototype['@test Url with array query param sets controller property to array'] = function testUrlWithArrayQueryParamSetsControllerPropertyToArray(assert) { + var _this30 = this; + + assert.expect(1); + + this.setSingleQPController('index', 'foo', ''); + + return this.visit('/?foo[]=1&foo[]=2&foo[]=3').then(function () { + var controller = _this30.getController('index'); + assert.deepEqual(controller.get('foo'), ['1', '2', '3']); + }); + }; + + _class.prototype['@test Array query params can be pushed/popped'] = function testArrayQueryParamsCanBePushedPopped(assert) { + var _this31 = this; + + assert.expect(17); + + this.router.map(function () { + this.route('home', { path: '/' }); + }); + + this.setSingleQPController('home', 'foo', _emberRuntime.A()); + + return this.visitAndAssert('/').then(function () { + var controller = _this31.getController('home'); + + _emberMetal.run(controller.foo, 'pushObject', 1); + _this31.assertCurrentPath('/?foo=%5B1%5D'); + assert.deepEqual(controller.foo, [1]); + + _emberMetal.run(controller.foo, 'popObject'); + _this31.assertCurrentPath('/'); + assert.deepEqual(controller.foo, []); + + _emberMetal.run(controller.foo, 'pushObject', 1); + _this31.assertCurrentPath('/?foo=%5B1%5D'); + assert.deepEqual(controller.foo, [1]); + + _emberMetal.run(controller.foo, 'popObject'); + _this31.assertCurrentPath('/'); + assert.deepEqual(controller.foo, []); + + _emberMetal.run(controller.foo, 'pushObject', 1); + _this31.assertCurrentPath('/?foo=%5B1%5D'); + assert.deepEqual(controller.foo, [1]); + + _emberMetal.run(controller.foo, 'pushObject', 2); + _this31.assertCurrentPath('/?foo=%5B1%2C2%5D'); + assert.deepEqual(controller.foo, [1, 2]); + + _emberMetal.run(controller.foo, 'popObject'); + _this31.assertCurrentPath('/?foo=%5B1%5D'); + assert.deepEqual(controller.foo, [1]); + + _emberMetal.run(controller.foo, 'unshiftObject', 'lol'); + _this31.assertCurrentPath('/?foo=%5B%22lol%22%2C1%5D'); + assert.deepEqual(controller.foo, ['lol', 1]); + }); + }; + + _class.prototype['@test Overwriting with array with same content shouldn\'t refire update'] = function testOverwritingWithArrayWithSameContentShouldnTRefireUpdate(assert) { + var _this32 = this; + + assert.expect(4); + + this.router.map(function () { + this.route('home', { path: '/' }); + }); + + var modelCount = 0; + this.registerRoute('home', _emberRouting.Route.extend({ + model: function () { + modelCount++; + } + })); + + this.setSingleQPController('home', 'foo', _emberRuntime.A([1])); + + return this.visitAndAssert('/').then(function () { + assert.equal(modelCount, 1); + + var controller = _this32.getController('home'); + _this32.setAndFlush(controller, 'model', _emberRuntime.A([1])); + + assert.equal(modelCount, 1); + _this32.assertCurrentPath('/'); + }); + }; + + _class.prototype['@test Defaulting to params hash as the model should not result in that params object being watched'] = function testDefaultingToParamsHashAsTheModelShouldNotResultInThatParamsObjectBeingWatched(assert) { + var _this33 = this; + + assert.expect(1); + + this.router.map(function () { + this.route('other'); + }); + + // This causes the params hash, which is returned as a route's + // model if no other model could be resolved given the provided + // params (and no custom model hook was defined), to be watched, + // unless we return a copy of the params hash. + this.setSingleQPController('application', 'woot', 'wat'); + + this.registerRoute('other', _emberRouting.Route.extend({ + model: function (p, trans) { + var m = _emberMetal.meta(trans.params.application); + assert.ok(!m.peekWatching('woot'), 'A meta object isn\'t constructed for this params POJO'); + } + })); + + return this.visit('/').then(function () { + _this33.transitionTo('other'); + }); + }; + + _class.prototype['@test A child of a resource route still defaults to parent route\'s model even if the child route has a query param'] = function testAChildOfAResourceRouteStillDefaultsToParentRouteSModelEvenIfTheChildRouteHasAQueryParam(assert) { + assert.expect(2); + + this.setSingleQPController('index', 'woot', undefined, { + woot: undefined + }); + + this.registerRoute('application', _emberRouting.Route.extend({ + model: function (p, trans) { + return { woot: true }; + } + })); + + this.registerRoute('index', _emberRouting.Route.extend({ + setupController: function (controller, model) { + assert.deepEqual(model, { woot: true }, 'index route inherited model route from parent route'); + } + })); + + return this.visitAndAssert('/'); + }; + + _class.prototype['@test opting into replace does not affect transitions between routes'] = function testOptingIntoReplaceDoesNotAffectTransitionsBetweenRoutes(assert) { + var _this34 = this; + + assert.expect(5); + + this.registerTemplate('application', '{{link-to \'Foo\' \'foo\' id=\'foo-link\'}}{{link-to \'Bar\' \'bar\' id=\'bar-no-qp-link\'}}{{link-to \'Bar\' \'bar\' (query-params raytiley=\'isthebest\') id=\'bar-link\'}}{{outlet}}'); + + this.router.map(function () { + this.route('foo'); + this.route('bar'); + }); + + this.setSingleQPController('bar', 'raytiley', 'israd'); + + this.registerRoute('bar', _emberRouting.Route.extend({ + queryParams: { + raytiley: { + replace: true + } + } + })); + + return this.visit('/').then(function () { + var controller = _this34.getController('bar'); + + _this34.expectedPushURL = '/foo'; + _emberMetal.run(_emberViews.jQuery('#foo-link'), 'click'); + + _this34.expectedPushURL = '/bar'; + _emberMetal.run(_emberViews.jQuery('#bar-no-qp-link'), 'click'); + + _this34.expectedReplaceURL = '/bar?raytiley=woot'; + _this34.setAndFlush(controller, 'raytiley', 'woot'); + + _this34.expectedPushURL = '/foo'; + _emberMetal.run(_emberViews.jQuery('#foo-link'), 'click'); + + _this34.expectedPushURL = '/bar?raytiley=isthebest'; + _emberMetal.run(_emberViews.jQuery('#bar-link'), 'click'); + }); + }; + + _class.prototype['@test undefined isn\'t serialized or deserialized into a string'] = function testUndefinedIsnTSerializedOrDeserializedIntoAString(assert) { + var _this35 = this; + + assert.expect(4); + + this.router.map(function () { + this.route('example'); + }); + + this.registerTemplate('application', '{{link-to \'Example\' \'example\' (query-params foo=undefined) id=\'the-link\'}}'); + + this.setSingleQPController('example', 'foo', undefined, { + foo: undefined + }); + + this.registerRoute('example', _emberRouting.Route.extend({ + model: function (params) { + assert.deepEqual(params, { foo: undefined }); + } + })); + + return this.visitAndAssert('/').then(function () { + assert.equal(_this35.$('#the-link').attr('href'), '/example', 'renders without undefined qp serialized'); + + return _this35.transitionTo('example', { queryParams: { foo: undefined } }).then(function () { + _this35.assertCurrentPath('/example'); + }); + }); + }; + + _class.prototype['@test when refreshModel is true and loading hook is undefined, model hook will rerun when QPs change even if previous did not finish'] = function testWhenRefreshModelIsTrueAndLoadingHookIsUndefinedModelHookWillRerunWhenQPsChangeEvenIfPreviousDidNotFinish(assert) { + return this.refreshModelWhileLoadingTest(); + }; + + _class.prototype['@test when refreshModel is true and loading hook returns false, model hook will rerun when QPs change even if previous did not finish'] = function testWhenRefreshModelIsTrueAndLoadingHookReturnsFalseModelHookWillRerunWhenQPsChangeEvenIfPreviousDidNotFinish(assert) { + return this.refreshModelWhileLoadingTest(false); + }; + + _class.prototype['@test when refreshModel is true and loading hook returns true, model hook will rerun when QPs change even if previous did not finish'] = function testWhenRefreshModelIsTrueAndLoadingHookReturnsTrueModelHookWillRerunWhenQPsChangeEvenIfPreviousDidNotFinish(assert) { + return this.refreshModelWhileLoadingTest(true); + }; + + _class.prototype['@test warn user that Route\'s queryParams configuration must be an Object, not an Array'] = function testWarnUserThatRouteSQueryParamsConfigurationMustBeAnObjectNotAnArray(assert) { + var _this36 = this; + + assert.expect(1); + + this.registerRoute('application', _emberRouting.Route.extend({ + queryParams: [{ commitBy: { replace: true } }] + })); + + expectAssertion(function () { + _this36.visit('/'); + }, 'You passed in `[{"commitBy":{"replace":true}}]` as the value for `queryParams` but `queryParams` cannot be an Array'); + }; + + _class.prototype['@test handle route names that clash with Object.prototype properties'] = function testHandleRouteNamesThatClashWithObjectPrototypeProperties(assert) { + var _this37 = this; + + assert.expect(1); + + this.router.map(function () { + this.route('constructor'); + }); + + this.registerRoute('constructor', _emberRouting.Route.extend({ + queryParams: { + foo: { + defaultValue: '123' + } + } + })); + + return this.visit('/').then(function () { + _this37.transitionTo('constructor', { queryParams: { foo: '999' } }); + var controller = _this37.getController('constructor'); + assert.equal(_emberMetal.get(controller, 'foo'), '999'); + }); + }; + + return _class; + })(_internalTestHelpers.QueryParamTestCase)); +}); +enifed('ember/tests/routing/query_params_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/routing'); + test('ember/tests/routing/query_params_test.js should pass jscs', function () { + ok(true, 'ember/tests/routing/query_params_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/routing/query_params_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/routing'); + QUnit.test('ember/tests/routing/query_params_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/query_params_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test', ['exports', 'ember-runtime', 'ember-routing', 'ember-metal', 'ember-views', 'internal-test-helpers'], function (exports, _emberRuntime, _emberRouting, _emberMetal, _emberViews, _internalTestHelpers) { + 'use strict'; + + var ModelDependentQPTestCase = (function (_QueryParamTestCase) { + babelHelpers.inherits(ModelDependentQPTestCase, _QueryParamTestCase); + + function ModelDependentQPTestCase() { + babelHelpers.classCallCheck(this, ModelDependentQPTestCase); + + _QueryParamTestCase.apply(this, arguments); + } + + ModelDependentQPTestCase.prototype.boot = function boot() { + this.setupApplication(); + return this.visitApplication(); + }; + + ModelDependentQPTestCase.prototype.teardown = function teardown() { + var _QueryParamTestCase$prototype$teardown; + + (_QueryParamTestCase$prototype$teardown = _QueryParamTestCase.prototype.teardown).call.apply(_QueryParamTestCase$prototype$teardown, [this].concat(babelHelpers.slice.call(arguments))); + this.assert.ok(!this.expectedModelHookParams, 'there should be no pending expectation of expected model hook params'); + }; + + ModelDependentQPTestCase.prototype.reopenController = function reopenController(name, options) { + this.application.resolveRegistration('controller:' + name).reopen(options); + }; + + ModelDependentQPTestCase.prototype.reopenRoute = function reopenRoute(name, options) { + this.application.resolveRegistration('route:' + name).reopen(options); + }; + + ModelDependentQPTestCase.prototype.queryParamsStickyTest1 = function queryParamsStickyTest1(urlPrefix) { + var _this = this; + + var assert = this.assert; + + assert.expect(14); + + return this.boot().then(function () { + _emberMetal.run(_this.$link1, 'click'); + _this.assertCurrentPath(urlPrefix + '/a-1'); + + _this.setAndFlush(_this.controller, 'q', 'lol'); + + assert.equal(_this.$link1.attr('href'), urlPrefix + '/a-1?q=lol'); + assert.equal(_this.$link2.attr('href'), urlPrefix + '/a-2'); + assert.equal(_this.$link3.attr('href'), urlPrefix + '/a-3'); + + _emberMetal.run(_this.$link2, 'click'); + + assert.equal(_this.controller.get('q'), 'wat'); + assert.equal(_this.controller.get('z'), 0); + assert.deepEqual(_this.controller.get('model'), { id: 'a-2' }); + assert.equal(_this.$link1.attr('href'), urlPrefix + '/a-1?q=lol'); + assert.equal(_this.$link2.attr('href'), urlPrefix + '/a-2'); + assert.equal(_this.$link3.attr('href'), urlPrefix + '/a-3'); + }); + }; + + ModelDependentQPTestCase.prototype.queryParamsStickyTest2 = function queryParamsStickyTest2(urlPrefix) { + var _this2 = this; + + var assert = this.assert; + + assert.expect(24); + + return this.boot().then(function () { + _this2.expectedModelHookParams = { id: 'a-1', q: 'lol', z: 0 }; + _this2.transitionTo(urlPrefix + '/a-1?q=lol'); + + assert.deepEqual(_this2.controller.get('model'), { id: 'a-1' }); + assert.equal(_this2.controller.get('q'), 'lol'); + assert.equal(_this2.controller.get('z'), 0); + assert.equal(_this2.$link1.attr('href'), urlPrefix + '/a-1?q=lol'); + assert.equal(_this2.$link2.attr('href'), urlPrefix + '/a-2'); + assert.equal(_this2.$link3.attr('href'), urlPrefix + '/a-3'); + + _this2.expectedModelHookParams = { id: 'a-2', q: 'lol', z: 0 }; + _this2.transitionTo(urlPrefix + '/a-2?q=lol'); + + assert.deepEqual(_this2.controller.get('model'), { id: 'a-2' }, 'controller\'s model changed to a-2'); + assert.equal(_this2.controller.get('q'), 'lol'); + assert.equal(_this2.controller.get('z'), 0); + assert.equal(_this2.$link1.attr('href'), urlPrefix + '/a-1?q=lol'); + assert.equal(_this2.$link2.attr('href'), urlPrefix + '/a-2?q=lol'); // fail + assert.equal(_this2.$link3.attr('href'), urlPrefix + '/a-3'); + + _this2.expectedModelHookParams = { id: 'a-3', q: 'lol', z: 123 }; + _this2.transitionTo(urlPrefix + '/a-3?q=lol&z=123'); + + assert.equal(_this2.controller.get('q'), 'lol'); + assert.equal(_this2.controller.get('z'), 123); + assert.equal(_this2.$link1.attr('href'), urlPrefix + '/a-1?q=lol'); + assert.equal(_this2.$link2.attr('href'), urlPrefix + '/a-2?q=lol'); + assert.equal(_this2.$link3.attr('href'), urlPrefix + '/a-3?q=lol&z=123'); + }); + }; + + ModelDependentQPTestCase.prototype.queryParamsStickyTest3 = function queryParamsStickyTest3(urlPrefix, articleLookup) { + var _this3 = this; + + var assert = this.assert; + + assert.expect(32); + + this.registerTemplate('application', '{{#each articles as |a|}} {{link-to \'Article\' \'' + articleLookup + '\' a.id id=a.id}} {{/each}}'); + + return this.boot().then(function () { + _this3.expectedModelHookParams = { id: 'a-1', q: 'wat', z: 0 }; + _this3.transitionTo(articleLookup, 'a-1'); + + assert.deepEqual(_this3.controller.get('model'), { id: 'a-1' }); + assert.equal(_this3.controller.get('q'), 'wat'); + assert.equal(_this3.controller.get('z'), 0); + assert.equal(_this3.$link1.attr('href'), urlPrefix + '/a-1'); + assert.equal(_this3.$link2.attr('href'), urlPrefix + '/a-2'); + assert.equal(_this3.$link3.attr('href'), urlPrefix + '/a-3'); + + _this3.expectedModelHookParams = { id: 'a-2', q: 'lol', z: 0 }; + _this3.transitionTo(articleLookup, 'a-2', { queryParams: { q: 'lol' } }); + + assert.deepEqual(_this3.controller.get('model'), { id: 'a-2' }); + assert.equal(_this3.controller.get('q'), 'lol'); + assert.equal(_this3.controller.get('z'), 0); + assert.equal(_this3.$link1.attr('href'), urlPrefix + '/a-1'); + assert.equal(_this3.$link2.attr('href'), urlPrefix + '/a-2?q=lol'); + assert.equal(_this3.$link3.attr('href'), urlPrefix + '/a-3'); + + _this3.expectedModelHookParams = { id: 'a-3', q: 'hay', z: 0 }; + _this3.transitionTo(articleLookup, 'a-3', { queryParams: { q: 'hay' } }); + + assert.deepEqual(_this3.controller.get('model'), { id: 'a-3' }); + assert.equal(_this3.controller.get('q'), 'hay'); + assert.equal(_this3.controller.get('z'), 0); + assert.equal(_this3.$link1.attr('href'), urlPrefix + '/a-1'); + assert.equal(_this3.$link2.attr('href'), urlPrefix + '/a-2?q=lol'); + assert.equal(_this3.$link3.attr('href'), urlPrefix + '/a-3?q=hay'); + + _this3.expectedModelHookParams = { id: 'a-2', q: 'lol', z: 1 }; + _this3.transitionTo(articleLookup, 'a-2', { queryParams: { z: 1 } }); + + assert.deepEqual(_this3.controller.get('model'), { id: 'a-2' }); + assert.equal(_this3.controller.get('q'), 'lol'); + assert.equal(_this3.controller.get('z'), 1); + assert.equal(_this3.$link1.attr('href'), urlPrefix + '/a-1'); + assert.equal(_this3.$link2.attr('href'), urlPrefix + '/a-2?q=lol&z=1'); + assert.equal(_this3.$link3.attr('href'), urlPrefix + '/a-3?q=hay'); + }); + }; + + ModelDependentQPTestCase.prototype.queryParamsStickyTest4 = function queryParamsStickyTest4(urlPrefix, articleLookup) { + var _this4 = this; + + var assert = this.assert; + + assert.expect(24); + + this.setupApplication(); + + this.reopenController(articleLookup, { + queryParams: { q: { scope: 'controller' } } + }); + + return this.visitApplication().then(function () { + _emberMetal.run(_this4.$link1, 'click'); + _this4.assertCurrentPath(urlPrefix + '/a-1'); + + _this4.setAndFlush(_this4.controller, 'q', 'lol'); + + assert.equal(_this4.$link1.attr('href'), urlPrefix + '/a-1?q=lol'); + assert.equal(_this4.$link2.attr('href'), urlPrefix + '/a-2?q=lol'); + assert.equal(_this4.$link3.attr('href'), urlPrefix + '/a-3?q=lol'); + + _emberMetal.run(_this4.$link2, 'click'); + + assert.equal(_this4.controller.get('q'), 'lol'); + assert.equal(_this4.controller.get('z'), 0); + assert.deepEqual(_this4.controller.get('model'), { id: 'a-2' }); + + assert.equal(_this4.$link1.attr('href'), urlPrefix + '/a-1?q=lol'); + assert.equal(_this4.$link2.attr('href'), urlPrefix + '/a-2?q=lol'); + assert.equal(_this4.$link3.attr('href'), urlPrefix + '/a-3?q=lol'); + + _this4.expectedModelHookParams = { id: 'a-3', q: 'haha', z: 123 }; + _this4.transitionTo(urlPrefix + '/a-3?q=haha&z=123'); + + assert.deepEqual(_this4.controller.get('model'), { id: 'a-3' }); + assert.equal(_this4.controller.get('q'), 'haha'); + assert.equal(_this4.controller.get('z'), 123); + + assert.equal(_this4.$link1.attr('href'), urlPrefix + '/a-1?q=haha'); + assert.equal(_this4.$link2.attr('href'), urlPrefix + '/a-2?q=haha'); + assert.equal(_this4.$link3.attr('href'), urlPrefix + '/a-3?q=haha&z=123'); + + _this4.setAndFlush(_this4.controller, 'q', 'woot'); + + assert.equal(_this4.$link1.attr('href'), urlPrefix + '/a-1?q=woot'); + assert.equal(_this4.$link2.attr('href'), urlPrefix + '/a-2?q=woot'); + assert.equal(_this4.$link3.attr('href'), urlPrefix + '/a-3?q=woot&z=123'); + }); + }; + + ModelDependentQPTestCase.prototype.queryParamsStickyTest5 = function queryParamsStickyTest5(urlPrefix, commentsLookupKey) { + var _this5 = this; + + var assert = this.assert; + + assert.expect(12); + + return this.boot().then(function () { + _this5.transitionTo(commentsLookupKey, 'a-1'); + + var commentsCtrl = _this5.getController(commentsLookupKey); + assert.equal(commentsCtrl.get('page'), 1); + _this5.assertCurrentPath(urlPrefix + '/a-1/comments'); + + _this5.setAndFlush(commentsCtrl, 'page', 2); + _this5.assertCurrentPath(urlPrefix + '/a-1/comments?page=2'); + + _this5.setAndFlush(commentsCtrl, 'page', 3); + _this5.assertCurrentPath(urlPrefix + '/a-1/comments?page=3'); + + _this5.transitionTo(commentsLookupKey, 'a-2'); + assert.equal(commentsCtrl.get('page'), 1); + _this5.assertCurrentPath(urlPrefix + '/a-2/comments'); + + _this5.transitionTo(commentsLookupKey, 'a-1'); + assert.equal(commentsCtrl.get('page'), 3); + _this5.assertCurrentPath(urlPrefix + '/a-1/comments?page=3'); + }); + }; + + ModelDependentQPTestCase.prototype.queryParamsStickyTest6 = function queryParamsStickyTest6(urlPrefix, articleLookup, commentsLookup) { + var _this6 = this; + + var assert = this.assert; + + assert.expect(13); + + this.setupApplication(); + + this.reopenRoute(articleLookup, { + resetController: function (controller, isExiting) { + this.controllerFor(commentsLookup).set('page', 1); + if (isExiting) { + controller.set('q', 'imdone'); + } + } + }); + + this.registerTemplate('about', '{{link-to \'A\' \'' + commentsLookup + '\' \'a-1\' id=\'one\'}} {{link-to \'B\' \'' + commentsLookup + '\' \'a-2\' id=\'two\'}}'); + + return this.visitApplication().then(function () { + _this6.transitionTo(commentsLookup, 'a-1'); + + var commentsCtrl = _this6.getController(commentsLookup); + assert.equal(commentsCtrl.get('page'), 1); + _this6.assertCurrentPath(urlPrefix + '/a-1/comments'); + + _this6.setAndFlush(commentsCtrl, 'page', 2); + _this6.assertCurrentPath(urlPrefix + '/a-1/comments?page=2'); + + _this6.transitionTo(commentsLookup, 'a-2'); + assert.equal(commentsCtrl.get('page'), 1); + assert.equal(_this6.controller.get('q'), 'wat'); + + _this6.transitionTo(commentsLookup, 'a-1'); + + _this6.assertCurrentPath(urlPrefix + '/a-1/comments'); + assert.equal(commentsCtrl.get('page'), 1); + + _this6.transitionTo('about'); + assert.equal(_emberViews.jQuery('#one').attr('href'), urlPrefix + '/a-1/comments?q=imdone'); + assert.equal(_emberViews.jQuery('#two').attr('href'), urlPrefix + '/a-2/comments'); + }); + }; + + return ModelDependentQPTestCase; + })(_internalTestHelpers.QueryParamTestCase); + + _internalTestHelpers.moduleFor('Query Params - model-dependent state', (function (_ModelDependentQPTestCase) { + babelHelpers.inherits(_class, _ModelDependentQPTestCase); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _ModelDependentQPTestCase.apply(this, arguments); + } + + _class.prototype.setupApplication = function setupApplication() { + this.router.map(function () { + this.route('article', { path: '/a/:id' }, function () { + this.route('comments', { resetNamespace: true }); + }); + this.route('about'); + }); + + var articles = _emberRuntime.A([{ id: 'a-1' }, { id: 'a-2' }, { id: 'a-3' }]); + + this.registerController('application', _emberRuntime.Controller.extend({ + articles: articles + })); + + var self = this; + var assert = this.assert; + this.registerRoute('article', _emberRouting.Route.extend({ + model: function (params) { + if (self.expectedModelHookParams) { + assert.deepEqual(params, self.expectedModelHookParams, 'the ArticleRoute model hook received the expected merged dynamic segment + query params hash'); + self.expectedModelHookParams = null; + } + return articles.findBy('id', params.id); + } + })); + + this.registerController('article', _emberRuntime.Controller.extend({ + queryParams: ['q', 'z'], + q: 'wat', + z: 0 + })); + + this.registerController('comments', _emberRuntime.Controller.extend({ + queryParams: 'page', + page: 1 + })); + + this.registerTemplate('application', '{{#each articles as |a|}} 1{{link-to \'Article\' \'article\' a id=a.id}} {{/each}} {{outlet}}'); + }; + + _class.prototype.visitApplication = function visitApplication() { + var _this7 = this; + + return this.visit('/').then(function () { + var assert = _this7.assert; + + _this7.$link1 = _emberViews.jQuery('#a-1'); + _this7.$link2 = _emberViews.jQuery('#a-2'); + _this7.$link3 = _emberViews.jQuery('#a-3'); + + assert.equal(_this7.$link1.attr('href'), '/a/a-1'); + assert.equal(_this7.$link2.attr('href'), '/a/a-2'); + assert.equal(_this7.$link3.attr('href'), '/a/a-3'); + + _this7.controller = _this7.getController('article'); + }); + }; + + _class.prototype['@test query params have \'model\' stickiness by default'] = function testQueryParamsHaveModelStickinessByDefault() { + return this.queryParamsStickyTest1('/a'); + }; + + _class.prototype['@test query params have \'model\' stickiness by default (url changes)'] = function testQueryParamsHaveModelStickinessByDefaultUrlChanges() { + return this.queryParamsStickyTest2('/a'); + }; + + _class.prototype['@test query params have \'model\' stickiness by default (params-based transitions)'] = function testQueryParamsHaveModelStickinessByDefaultParamsBasedTransitions() { + return this.queryParamsStickyTest3('/a', 'article'); + }; + + _class.prototype['@test \'controller\' stickiness shares QP state between models'] = function testControllerStickinessSharesQPStateBetweenModels() { + return this.queryParamsStickyTest4('/a', 'article'); + }; + + _class.prototype['@test \'model\' stickiness is scoped to current or first dynamic parent route'] = function testModelStickinessIsScopedToCurrentOrFirstDynamicParentRoute() { + return this.queryParamsStickyTest5('/a', 'comments'); + }; + + _class.prototype['@test can reset query params using the resetController hook'] = function testCanResetQueryParamsUsingTheResetControllerHook() { + return this.queryParamsStickyTest6('/a', 'article', 'comments'); + }; + + return _class; + })(ModelDependentQPTestCase)); + + _internalTestHelpers.moduleFor('Query Params - model-dependent state (nested)', (function (_ModelDependentQPTestCase2) { + babelHelpers.inherits(_class2, _ModelDependentQPTestCase2); + + function _class2() { + babelHelpers.classCallCheck(this, _class2); + + _ModelDependentQPTestCase2.apply(this, arguments); + } + + _class2.prototype.setupApplication = function setupApplication() { + this.router.map(function () { + this.route('site', function () { + this.route('article', { path: '/a/:id' }, function () { + this.route('comments'); + }); + }); + this.route('about'); + }); + + var site_articles = _emberRuntime.A([{ id: 'a-1' }, { id: 'a-2' }, { id: 'a-3' }]); + + this.registerController('application', _emberRuntime.Controller.extend({ + articles: site_articles + })); + + var self = this; + var assert = this.assert; + this.registerRoute('site.article', _emberRouting.Route.extend({ + model: function (params) { + if (self.expectedModelHookParams) { + assert.deepEqual(params, self.expectedModelHookParams, 'the ArticleRoute model hook received the expected merged dynamic segment + query params hash'); + self.expectedModelHookParams = null; + } + return site_articles.findBy('id', params.id); + } + })); + + this.registerController('site.article', _emberRuntime.Controller.extend({ + queryParams: ['q', 'z'], + q: 'wat', + z: 0 + })); + + this.registerController('site.article.comments', _emberRuntime.Controller.extend({ + queryParams: 'page', + page: 1 + })); + + this.registerTemplate('application', '{{#each articles as |a|}} {{link-to \'Article\' \'site.article\' a id=a.id}} {{/each}} {{outlet}}'); + }; + + _class2.prototype.visitApplication = function visitApplication() { + var _this8 = this; + + return this.visit('/').then(function () { + var assert = _this8.assert; + + _this8.$link1 = _emberViews.jQuery('#a-1'); + _this8.$link2 = _emberViews.jQuery('#a-2'); + _this8.$link3 = _emberViews.jQuery('#a-3'); + + assert.equal(_this8.$link1.attr('href'), '/site/a/a-1'); + assert.equal(_this8.$link2.attr('href'), '/site/a/a-2'); + assert.equal(_this8.$link3.attr('href'), '/site/a/a-3'); + + _this8.controller = _this8.getController('site.article'); + }); + }; + + _class2.prototype['@test query params have \'model\' stickiness by default'] = function testQueryParamsHaveModelStickinessByDefault() { + return this.queryParamsStickyTest1('/site/a'); + }; + + _class2.prototype['@test query params have \'model\' stickiness by default (url changes)'] = function testQueryParamsHaveModelStickinessByDefaultUrlChanges() { + return this.queryParamsStickyTest2('/site/a'); + }; + + _class2.prototype['@test query params have \'model\' stickiness by default (params-based transitions)'] = function testQueryParamsHaveModelStickinessByDefaultParamsBasedTransitions() { + return this.queryParamsStickyTest3('/site/a', 'site.article'); + }; + + _class2.prototype['@test \'controller\' stickiness shares QP state between models'] = function testControllerStickinessSharesQPStateBetweenModels() { + return this.queryParamsStickyTest4('/site/a', 'site.article'); + }; + + _class2.prototype['@test \'model\' stickiness is scoped to current or first dynamic parent route'] = function testModelStickinessIsScopedToCurrentOrFirstDynamicParentRoute() { + return this.queryParamsStickyTest5('/site/a', 'site.article.comments'); + }; + + _class2.prototype['@test can reset query params using the resetController hook'] = function testCanResetQueryParamsUsingTheResetControllerHook() { + return this.queryParamsStickyTest6('/site/a', 'site.article', 'site.article.comments'); + }; + + return _class2; + })(ModelDependentQPTestCase)); + + _internalTestHelpers.moduleFor('Query Params - model-dependent state (nested & more than 1 dynamic segment)', (function (_ModelDependentQPTestCase3) { + babelHelpers.inherits(_class3, _ModelDependentQPTestCase3); + + function _class3() { + babelHelpers.classCallCheck(this, _class3); + + _ModelDependentQPTestCase3.apply(this, arguments); + } + + _class3.prototype.setupApplication = function setupApplication() { + this.router.map(function () { + this.route('site', { path: '/site/:site_id' }, function () { + this.route('article', { path: '/a/:article_id' }, function () { + this.route('comments'); + }); + }); + }); + + var sites = _emberRuntime.A([{ id: 's-1' }, { id: 's-2' }, { id: 's-3' }]); + var site_articles = _emberRuntime.A([{ id: 'a-1' }, { id: 'a-2' }, { id: 'a-3' }]); + + this.registerController('application', _emberRuntime.Controller.extend({ + siteArticles: site_articles, + sites: sites, + allSitesAllArticles: _emberMetal.computed({ + get: function () { + var ret = []; + var siteArticles = this.siteArticles; + var sites = this.sites; + sites.forEach(function (site) { + ret = ret.concat(siteArticles.map(function (article) { + return { id: site.id + '-' + article.id, site_id: site.id, article_id: article.id }; + })); + }); + return ret; + } + }) + })); + + var self = this; + var assert = this.assert; + this.registerRoute('site', _emberRouting.Route.extend({ + model: function (params) { + if (self.expectedSiteModelHookParams) { + assert.deepEqual(params, self.expectedSiteModelHookParams, 'the SiteRoute model hook received the expected merged dynamic segment + query params hash'); + self.expectedSiteModelHookParams = null; + } + return sites.findBy('id', params.site_id); + } + })); + + this.registerRoute('site.article', _emberRouting.Route.extend({ + model: function (params) { + if (self.expectedArticleModelHookParams) { + assert.deepEqual(params, self.expectedArticleModelHookParams, 'the SiteArticleRoute model hook received the expected merged dynamic segment + query params hash'); + self.expectedArticleModelHookParams = null; + } + return site_articles.findBy('id', params.article_id); + } + })); + + this.registerController('site', _emberRuntime.Controller.extend({ + queryParams: ['country'], + country: 'au' + })); + + this.registerController('site.article', _emberRuntime.Controller.extend({ + queryParams: ['q', 'z'], + q: 'wat', + z: 0 + })); + + this.registerController('site.article.comments', _emberRuntime.Controller.extend({ + queryParams: ['page'], + page: 1 + })); + + this.registerTemplate('application', '{{#each allSitesAllArticles as |a|}} {{#link-to \'site.article\' a.site_id a.article_id id=a.id}}Article [{{a.site_id}}] [{{a.article_id}}]{{/link-to}} {{/each}} {{outlet}}'); + }; + + _class3.prototype.visitApplication = function visitApplication() { + var _this9 = this; + + return this.visit('/').then(function () { + var assert = _this9.assert; + + _this9.links = {}; + _this9.links['s-1-a-1'] = _emberViews.jQuery('#s-1-a-1'); + _this9.links['s-1-a-2'] = _emberViews.jQuery('#s-1-a-2'); + _this9.links['s-1-a-3'] = _emberViews.jQuery('#s-1-a-3'); + _this9.links['s-2-a-1'] = _emberViews.jQuery('#s-2-a-1'); + _this9.links['s-2-a-2'] = _emberViews.jQuery('#s-2-a-2'); + _this9.links['s-2-a-3'] = _emberViews.jQuery('#s-2-a-3'); + _this9.links['s-3-a-1'] = _emberViews.jQuery('#s-3-a-1'); + _this9.links['s-3-a-2'] = _emberViews.jQuery('#s-3-a-2'); + _this9.links['s-3-a-3'] = _emberViews.jQuery('#s-3-a-3'); + + assert.equal(_this9.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1'); + assert.equal(_this9.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2'); + assert.equal(_this9.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3'); + assert.equal(_this9.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1'); + assert.equal(_this9.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2'); + assert.equal(_this9.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3'); + assert.equal(_this9.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1'); + assert.equal(_this9.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2'); + assert.equal(_this9.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3'); + + _this9.site_controller = _this9.getController('site'); + _this9.article_controller = _this9.getController('site.article'); + }); + }; + + _class3.prototype['@test query params have \'model\' stickiness by default'] = function testQueryParamsHaveModelStickinessByDefault(assert) { + var _this10 = this; + + assert.expect(59); // Insane. + + return this.boot().then(function () { + _emberMetal.run(_this10.links['s-1-a-1'], 'click'); + assert.deepEqual(_this10.site_controller.get('model'), { id: 's-1' }); + assert.deepEqual(_this10.article_controller.get('model'), { id: 'a-1' }); + _this10.assertCurrentPath('/site/s-1/a/a-1'); + + _this10.setAndFlush(_this10.article_controller, 'q', 'lol'); + + assert.equal(_this10.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1?q=lol'); + assert.equal(_this10.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2'); + assert.equal(_this10.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3'); + assert.equal(_this10.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1?q=lol'); + assert.equal(_this10.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2'); + assert.equal(_this10.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3'); + assert.equal(_this10.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1?q=lol'); + assert.equal(_this10.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2'); + assert.equal(_this10.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3'); + + _this10.setAndFlush(_this10.site_controller, 'country', 'us'); + + assert.equal(_this10.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1?country=us&q=lol'); + assert.equal(_this10.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2?country=us'); + assert.equal(_this10.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3?country=us'); + assert.equal(_this10.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1?q=lol'); + assert.equal(_this10.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2'); + assert.equal(_this10.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3'); + assert.equal(_this10.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1?q=lol'); + assert.equal(_this10.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2'); + assert.equal(_this10.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3'); + + _emberMetal.run(_this10.links['s-1-a-2'], 'click'); + + assert.equal(_this10.site_controller.get('country'), 'us'); + assert.equal(_this10.article_controller.get('q'), 'wat'); + assert.equal(_this10.article_controller.get('z'), 0); + assert.deepEqual(_this10.site_controller.get('model'), { id: 's-1' }); + assert.deepEqual(_this10.article_controller.get('model'), { id: 'a-2' }); + assert.equal(_this10.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1?country=us&q=lol'); + assert.equal(_this10.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2?country=us'); + assert.equal(_this10.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3?country=us'); + assert.equal(_this10.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1?q=lol'); + assert.equal(_this10.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2'); + assert.equal(_this10.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3'); + assert.equal(_this10.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1?q=lol'); + assert.equal(_this10.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2'); + assert.equal(_this10.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3'); + + _emberMetal.run(_this10.links['s-2-a-2'], 'click'); + + assert.equal(_this10.site_controller.get('country'), 'au'); + assert.equal(_this10.article_controller.get('q'), 'wat'); + assert.equal(_this10.article_controller.get('z'), 0); + assert.deepEqual(_this10.site_controller.get('model'), { id: 's-2' }); + assert.deepEqual(_this10.article_controller.get('model'), { id: 'a-2' }); + assert.equal(_this10.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1?country=us&q=lol'); + assert.equal(_this10.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2?country=us'); + assert.equal(_this10.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3?country=us'); + assert.equal(_this10.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1?q=lol'); + assert.equal(_this10.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2'); + assert.equal(_this10.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3'); + assert.equal(_this10.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1?q=lol'); + assert.equal(_this10.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2'); + assert.equal(_this10.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3'); + }); + }; + + _class3.prototype['@test query params have \'model\' stickiness by default (url changes)'] = function testQueryParamsHaveModelStickinessByDefaultUrlChanges(assert) { + var _this11 = this; + + assert.expect(88); // INSANE. + + return this.boot().then(function () { + _this11.expectedSiteModelHookParams = { site_id: 's-1', country: 'au' }; + _this11.expectedArticleModelHookParams = { article_id: 'a-1', q: 'lol', z: 0 }; + _this11.transitionTo('/site/s-1/a/a-1?q=lol'); + + assert.deepEqual(_this11.site_controller.get('model'), { id: 's-1' }, 'site controller\'s model is s-1'); + assert.deepEqual(_this11.article_controller.get('model'), { id: 'a-1' }, 'article controller\'s model is a-1'); + assert.equal(_this11.site_controller.get('country'), 'au'); + assert.equal(_this11.article_controller.get('q'), 'lol'); + assert.equal(_this11.article_controller.get('z'), 0); + assert.equal(_this11.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1?q=lol'); + assert.equal(_this11.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2'); + assert.equal(_this11.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3'); + assert.equal(_this11.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1?q=lol'); + assert.equal(_this11.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2'); + assert.equal(_this11.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3'); + assert.equal(_this11.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1?q=lol'); + assert.equal(_this11.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2'); + assert.equal(_this11.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3'); + + _this11.expectedSiteModelHookParams = { site_id: 's-2', country: 'us' }; + _this11.expectedArticleModelHookParams = { article_id: 'a-1', q: 'lol', z: 0 }; + _this11.transitionTo('/site/s-2/a/a-1?country=us&q=lol'); + + assert.deepEqual(_this11.site_controller.get('model'), { id: 's-2' }, 'site controller\'s model is s-2'); + assert.deepEqual(_this11.article_controller.get('model'), { id: 'a-1' }, 'article controller\'s model is a-1'); + assert.equal(_this11.site_controller.get('country'), 'us'); + assert.equal(_this11.article_controller.get('q'), 'lol'); + assert.equal(_this11.article_controller.get('z'), 0); + assert.equal(_this11.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1?q=lol'); + assert.equal(_this11.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2'); + assert.equal(_this11.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3'); + assert.equal(_this11.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1?country=us&q=lol'); + assert.equal(_this11.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2?country=us'); + assert.equal(_this11.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3?country=us'); + assert.equal(_this11.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1?q=lol'); + assert.equal(_this11.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2'); + assert.equal(_this11.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3'); + + _this11.expectedSiteModelHookParams = { site_id: 's-2', country: 'us' }; + _this11.expectedArticleModelHookParams = { article_id: 'a-2', q: 'lol', z: 0 }; + _this11.transitionTo('/site/s-2/a/a-2?country=us&q=lol'); + + assert.deepEqual(_this11.site_controller.get('model'), { id: 's-2' }, 'site controller\'s model is s-2'); + assert.deepEqual(_this11.article_controller.get('model'), { id: 'a-2' }, 'article controller\'s model is a-2'); + assert.equal(_this11.site_controller.get('country'), 'us'); + assert.equal(_this11.article_controller.get('q'), 'lol'); + assert.equal(_this11.article_controller.get('z'), 0); + assert.equal(_this11.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1?q=lol'); + assert.equal(_this11.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2?q=lol'); + assert.equal(_this11.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3'); + assert.equal(_this11.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1?country=us&q=lol'); + assert.equal(_this11.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2?country=us&q=lol'); + assert.equal(_this11.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3?country=us'); + assert.equal(_this11.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1?q=lol'); + assert.equal(_this11.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2?q=lol'); + assert.equal(_this11.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3'); + + _this11.expectedSiteModelHookParams = { site_id: 's-2', country: 'us' }; + _this11.expectedArticleModelHookParams = { article_id: 'a-3', q: 'lol', z: 123 }; + _this11.transitionTo('/site/s-2/a/a-3?country=us&q=lol&z=123'); + + assert.deepEqual(_this11.site_controller.get('model'), { id: 's-2' }, 'site controller\'s model is s-2'); + assert.deepEqual(_this11.article_controller.get('model'), { id: 'a-3' }, 'article controller\'s model is a-3'); + assert.equal(_this11.site_controller.get('country'), 'us'); + assert.equal(_this11.article_controller.get('q'), 'lol'); + assert.equal(_this11.article_controller.get('z'), 123); + assert.equal(_this11.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1?q=lol'); + assert.equal(_this11.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2?q=lol'); + assert.equal(_this11.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3?q=lol&z=123'); + assert.equal(_this11.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1?country=us&q=lol'); + assert.equal(_this11.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2?country=us&q=lol'); + assert.equal(_this11.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3?country=us&q=lol&z=123'); + assert.equal(_this11.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1?q=lol'); + assert.equal(_this11.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2?q=lol'); + assert.equal(_this11.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3?q=lol&z=123'); + + _this11.expectedSiteModelHookParams = { site_id: 's-3', country: 'nz' }; + _this11.expectedArticleModelHookParams = { article_id: 'a-3', q: 'lol', z: 123 }; + _this11.transitionTo('/site/s-3/a/a-3?country=nz&q=lol&z=123'); + + assert.deepEqual(_this11.site_controller.get('model'), { id: 's-3' }, 'site controller\'s model is s-3'); + assert.deepEqual(_this11.article_controller.get('model'), { id: 'a-3' }, 'article controller\'s model is a-3'); + assert.equal(_this11.site_controller.get('country'), 'nz'); + assert.equal(_this11.article_controller.get('q'), 'lol'); + assert.equal(_this11.article_controller.get('z'), 123); + assert.equal(_this11.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1?q=lol'); + assert.equal(_this11.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2?q=lol'); + assert.equal(_this11.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3?q=lol&z=123'); + assert.equal(_this11.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1?country=us&q=lol'); + assert.equal(_this11.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2?country=us&q=lol'); + assert.equal(_this11.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3?country=us&q=lol&z=123'); + assert.equal(_this11.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1?country=nz&q=lol'); + assert.equal(_this11.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2?country=nz&q=lol'); + assert.equal(_this11.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3?country=nz&q=lol&z=123'); + }); + }; + + _class3.prototype['@test query params have \'model\' stickiness by default (params-based transitions)'] = function testQueryParamsHaveModelStickinessByDefaultParamsBasedTransitions(assert) { + var _this12 = this; + + assert.expect(118); // <-- INSANE! Like why is this even a thing? + + return this.boot().then(function () { + _this12.expectedSiteModelHookParams = { site_id: 's-1', country: 'au' }; + _this12.expectedArticleModelHookParams = { article_id: 'a-1', q: 'wat', z: 0 }; + _this12.transitionTo('site.article', 's-1', 'a-1'); + + assert.deepEqual(_this12.site_controller.get('model'), { id: 's-1' }); + assert.deepEqual(_this12.article_controller.get('model'), { id: 'a-1' }); + assert.equal(_this12.site_controller.get('country'), 'au'); + assert.equal(_this12.article_controller.get('q'), 'wat'); + assert.equal(_this12.article_controller.get('z'), 0); + assert.equal(_this12.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1'); + assert.equal(_this12.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2'); + assert.equal(_this12.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3'); + assert.equal(_this12.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1'); + assert.equal(_this12.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2'); + assert.equal(_this12.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3'); + assert.equal(_this12.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1'); + assert.equal(_this12.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2'); + assert.equal(_this12.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3'); + + _this12.expectedSiteModelHookParams = { site_id: 's-1', country: 'au' }; + _this12.expectedArticleModelHookParams = { article_id: 'a-2', q: 'lol', z: 0 }; + _this12.transitionTo('site.article', 's-1', 'a-2', { queryParams: { q: 'lol' } }); + + assert.deepEqual(_this12.site_controller.get('model'), { id: 's-1' }); + assert.deepEqual(_this12.article_controller.get('model'), { id: 'a-2' }); + assert.equal(_this12.site_controller.get('country'), 'au'); + assert.equal(_this12.article_controller.get('q'), 'lol'); + assert.equal(_this12.article_controller.get('z'), 0); + assert.equal(_this12.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1'); + assert.equal(_this12.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2?q=lol'); + assert.equal(_this12.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3'); + assert.equal(_this12.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1'); + assert.equal(_this12.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2?q=lol'); + assert.equal(_this12.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3'); + assert.equal(_this12.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1'); + assert.equal(_this12.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2?q=lol'); + assert.equal(_this12.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3'); + + _this12.expectedSiteModelHookParams = { site_id: 's-1', country: 'au' }; + _this12.expectedArticleModelHookParams = { article_id: 'a-3', q: 'hay', z: 0 }; + _this12.transitionTo('site.article', 's-1', 'a-3', { queryParams: { q: 'hay' } }); + + assert.deepEqual(_this12.site_controller.get('model'), { id: 's-1' }); + assert.deepEqual(_this12.article_controller.get('model'), { id: 'a-3' }); + assert.equal(_this12.site_controller.get('country'), 'au'); + assert.equal(_this12.article_controller.get('q'), 'hay'); + assert.equal(_this12.article_controller.get('z'), 0); + assert.equal(_this12.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1'); + assert.equal(_this12.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2?q=lol'); + assert.equal(_this12.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3?q=hay'); + assert.equal(_this12.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1'); + assert.equal(_this12.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2?q=lol'); + assert.equal(_this12.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3?q=hay'); + assert.equal(_this12.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1'); + assert.equal(_this12.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2?q=lol'); + assert.equal(_this12.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3?q=hay'); + + _this12.expectedSiteModelHookParams = { site_id: 's-1', country: 'au' }; + _this12.expectedArticleModelHookParams = { article_id: 'a-2', q: 'lol', z: 1 }; + _this12.transitionTo('site.article', 's-1', 'a-2', { queryParams: { z: 1 } }); + + assert.deepEqual(_this12.site_controller.get('model'), { id: 's-1' }); + assert.deepEqual(_this12.article_controller.get('model'), { id: 'a-2' }); + assert.equal(_this12.site_controller.get('country'), 'au'); + assert.equal(_this12.article_controller.get('q'), 'lol'); + assert.equal(_this12.article_controller.get('z'), 1); + assert.equal(_this12.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1'); + assert.equal(_this12.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2?q=lol&z=1'); + assert.equal(_this12.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3?q=hay'); + assert.equal(_this12.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1'); + assert.equal(_this12.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2?q=lol&z=1'); + assert.equal(_this12.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3?q=hay'); + assert.equal(_this12.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1'); + assert.equal(_this12.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2?q=lol&z=1'); + assert.equal(_this12.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3?q=hay'); + + _this12.expectedSiteModelHookParams = { site_id: 's-2', country: 'us' }; + _this12.expectedArticleModelHookParams = { article_id: 'a-2', q: 'lol', z: 1 }; + _this12.transitionTo('site.article', 's-2', 'a-2', { queryParams: { country: 'us' } }); + + assert.deepEqual(_this12.site_controller.get('model'), { id: 's-2' }); + assert.deepEqual(_this12.article_controller.get('model'), { id: 'a-2' }); + assert.equal(_this12.site_controller.get('country'), 'us'); + assert.equal(_this12.article_controller.get('q'), 'lol'); + assert.equal(_this12.article_controller.get('z'), 1); + assert.equal(_this12.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1'); + assert.equal(_this12.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2?q=lol&z=1'); + assert.equal(_this12.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3?q=hay'); + assert.equal(_this12.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1?country=us'); + assert.equal(_this12.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2?country=us&q=lol&z=1'); + assert.equal(_this12.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3?country=us&q=hay'); + assert.equal(_this12.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1'); + assert.equal(_this12.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2?q=lol&z=1'); + assert.equal(_this12.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3?q=hay'); + + _this12.expectedSiteModelHookParams = { site_id: 's-2', country: 'us' }; + _this12.expectedArticleModelHookParams = { article_id: 'a-1', q: 'yeah', z: 0 }; + _this12.transitionTo('site.article', 's-2', 'a-1', { queryParams: { q: 'yeah' } }); + + assert.deepEqual(_this12.site_controller.get('model'), { id: 's-2' }); + assert.deepEqual(_this12.article_controller.get('model'), { id: 'a-1' }); + assert.equal(_this12.site_controller.get('country'), 'us'); + assert.equal(_this12.article_controller.get('q'), 'yeah'); + assert.equal(_this12.article_controller.get('z'), 0); + assert.equal(_this12.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1?q=yeah'); + assert.equal(_this12.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2?q=lol&z=1'); + assert.equal(_this12.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3?q=hay'); + assert.equal(_this12.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1?country=us&q=yeah'); + assert.equal(_this12.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2?country=us&q=lol&z=1'); + assert.equal(_this12.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3?country=us&q=hay'); + assert.equal(_this12.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1?q=yeah'); + assert.equal(_this12.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2?q=lol&z=1'); + assert.equal(_this12.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3?q=hay'); + + _this12.expectedSiteModelHookParams = { site_id: 's-3', country: 'nz' }; + _this12.expectedArticleModelHookParams = { article_id: 'a-3', q: 'hay', z: 3 }; + _this12.transitionTo('site.article', 's-3', 'a-3', { queryParams: { country: 'nz', z: 3 } }); + + assert.deepEqual(_this12.site_controller.get('model'), { id: 's-3' }); + assert.deepEqual(_this12.article_controller.get('model'), { id: 'a-3' }); + assert.equal(_this12.site_controller.get('country'), 'nz'); + assert.equal(_this12.article_controller.get('q'), 'hay'); + assert.equal(_this12.article_controller.get('z'), 3); + assert.equal(_this12.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1?q=yeah'); + assert.equal(_this12.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2?q=lol&z=1'); + assert.equal(_this12.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3?q=hay&z=3'); + assert.equal(_this12.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1?country=us&q=yeah'); + assert.equal(_this12.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2?country=us&q=lol&z=1'); + assert.equal(_this12.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3?country=us&q=hay&z=3'); + assert.equal(_this12.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1?country=nz&q=yeah'); + assert.equal(_this12.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2?country=nz&q=lol&z=1'); + assert.equal(_this12.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3?country=nz&q=hay&z=3'); + }); + }; + + return _class3; + })(ModelDependentQPTestCase)); +}); +enifed('ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/routing/query_params_test'); + test('ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js should pass jscs', function () { + ok(true, 'ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/routing/query_params_test'); + QUnit.test('ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/routing/query_params_test/overlapping_query_params_test', ['exports', 'ember-runtime', 'ember-metal', 'internal-test-helpers'], function (exports, _emberRuntime, _emberMetal, _internalTestHelpers) { + 'use strict'; + + _internalTestHelpers.moduleFor('Query Params - overlapping query param property names', (function (_QueryParamTestCase) { + babelHelpers.inherits(_class, _QueryParamTestCase); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _QueryParamTestCase.apply(this, arguments); + } + + _class.prototype.setupBase = function setupBase() { + this.router.map(function () { + this.route('parent', function () { + this.route('child'); + }); + }); + + return this.visit('/parent/child'); + }; + + _class.prototype['@test can remap same-named qp props'] = function testCanRemapSameNamedQpProps(assert) { + var _this = this; + + assert.expect(7); + + this.setMappedQPController('parent'); + this.setMappedQPController('parent.child', 'page', 'childPage'); + + return this.setupBase().then(function () { + _this.assertCurrentPath('/parent/child'); + + var parentController = _this.getController('parent'); + var parentChildController = _this.getController('parent.child'); + + _this.setAndFlush(parentController, 'page', 2); + _this.assertCurrentPath('/parent/child?parentPage=2'); + _this.setAndFlush(parentController, 'page', 1); + _this.assertCurrentPath('/parent/child'); + + _this.setAndFlush(parentChildController, 'page', 2); + _this.assertCurrentPath('/parent/child?childPage=2'); + _this.setAndFlush(parentChildController, 'page', 1); + _this.assertCurrentPath('/parent/child'); + + _emberMetal.run(function () { + parentController.set('page', 2); + parentChildController.set('page', 2); + }); + + _this.assertCurrentPath('/parent/child?childPage=2&parentPage=2'); + + _emberMetal.run(function () { + parentController.set('page', 1); + parentChildController.set('page', 1); + }); + + _this.assertCurrentPath('/parent/child'); + }); + }; + + _class.prototype['@test query params can be either controller property or url key'] = function testQueryParamsCanBeEitherControllerPropertyOrUrlKey(assert) { + var _this2 = this; + + assert.expect(3); + + this.setMappedQPController('parent'); + + return this.setupBase().then(function () { + _this2.assertCurrentPath('/parent/child'); + + _this2.transitionTo('parent.child', { queryParams: { page: 2 } }); + _this2.assertCurrentPath('/parent/child?parentPage=2'); + + _this2.transitionTo('parent.child', { queryParams: { parentPage: 3 } }); + _this2.assertCurrentPath('/parent/child?parentPage=3'); + }); + }; + + _class.prototype['@test query param matching a url key and controller property'] = function testQueryParamMatchingAUrlKeyAndControllerProperty(assert) { + var _this3 = this; + + assert.expect(3); + + this.setMappedQPController('parent', 'page', 'parentPage'); + this.setMappedQPController('parent.child', 'index', 'page'); + + return this.setupBase().then(function () { + _this3.transitionTo('parent.child', { queryParams: { page: 2 } }); + _this3.assertCurrentPath('/parent/child?parentPage=2'); + + _this3.transitionTo('parent.child', { queryParams: { parentPage: 3 } }); + _this3.assertCurrentPath('/parent/child?parentPage=3'); + + _this3.transitionTo('parent.child', { queryParams: { index: 2, page: 2 } }); + _this3.assertCurrentPath('/parent/child?page=2&parentPage=2'); + }); + }; + + _class.prototype['@test query param matching same property on two controllers use the urlKey higher in the chain'] = function testQueryParamMatchingSamePropertyOnTwoControllersUseTheUrlKeyHigherInTheChain(assert) { + var _this4 = this; + + assert.expect(4); + + this.setMappedQPController('parent', 'page', 'parentPage'); + this.setMappedQPController('parent.child', 'page', 'childPage'); + + return this.setupBase().then(function () { + _this4.transitionTo('parent.child', { queryParams: { page: 2 } }); + _this4.assertCurrentPath('/parent/child?parentPage=2'); + + _this4.transitionTo('parent.child', { queryParams: { parentPage: 3 } }); + _this4.assertCurrentPath('/parent/child?parentPage=3'); + + _this4.transitionTo('parent.child', { queryParams: { childPage: 2, page: 2 } }); + _this4.assertCurrentPath('/parent/child?childPage=2&parentPage=2'); + + _this4.transitionTo('parent.child', { queryParams: { childPage: 3, parentPage: 4 } }); + _this4.assertCurrentPath('/parent/child?childPage=3&parentPage=4'); + }); + }; + + _class.prototype['@test query params in the same route hierarchy with the same url key get auto-scoped'] = function testQueryParamsInTheSameRouteHierarchyWithTheSameUrlKeyGetAutoScoped(assert) { + var _this5 = this; + + assert.expect(1); + + this.setMappedQPController('parent'); + this.setMappedQPController('parent.child'); + + expectAssertion(function () { + _this5.setupBase(); + }, 'You\'re not allowed to have more than one controller property map to the same query param key, but both `parent:page` and `parent.child:page` map to `parentPage`. You can fix this by mapping one of the controller properties to a different query param key via the `as` config option, e.g. `page: { as: \'other-page\' }`'); + }; + + _class.prototype['@test Support shared but overridable mixin pattern'] = function testSupportSharedButOverridableMixinPattern(assert) { + var _this6 = this; + + assert.expect(7); + + var HasPage = _emberMetal.Mixin.create({ + queryParams: 'page', + page: 1 + }); + + this.registerController('parent', _emberRuntime.Controller.extend(HasPage, { + queryParams: { page: 'yespage' } + })); + + this.registerController('parent.child', _emberRuntime.Controller.extend(HasPage)); + + return this.setupBase().then(function () { + _this6.assertCurrentPath('/parent/child'); + + var parentController = _this6.getController('parent'); + var parentChildController = _this6.getController('parent.child'); + + _this6.setAndFlush(parentChildController, 'page', 2); + _this6.assertCurrentPath('/parent/child?page=2'); + assert.equal(parentController.get('page'), 1); + assert.equal(parentChildController.get('page'), 2); + + _this6.setAndFlush(parentController, 'page', 2); + _this6.assertCurrentPath('/parent/child?page=2&yespage=2'); + assert.equal(parentController.get('page'), 2); + assert.equal(parentChildController.get('page'), 2); + }); + }; + + return _class; + })(_internalTestHelpers.QueryParamTestCase)); +}); +enifed('ember/tests/routing/query_params_test/overlapping_query_params_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/routing/query_params_test'); + test('ember/tests/routing/query_params_test/overlapping_query_params_test.js should pass jscs', function () { + ok(true, 'ember/tests/routing/query_params_test/overlapping_query_params_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/routing/query_params_test/overlapping_query_params_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/routing/query_params_test'); + QUnit.test('ember/tests/routing/query_params_test/overlapping_query_params_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/query_params_test/overlapping_query_params_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/routing/query_params_test/query_param_async_get_handler_test', ['exports', 'ember-runtime', 'ember-routing', 'internal-test-helpers'], function (exports, _emberRuntime, _emberRouting, _internalTestHelpers) { + 'use strict'; + + // These tests mimic what happens with lazily loaded Engines. + _internalTestHelpers.moduleFor('Query Params - async get handler', (function (_QueryParamTestCase) { + babelHelpers.inherits(_class, _QueryParamTestCase); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _QueryParamTestCase.apply(this, arguments); + } + + _class.prototype['@test can render a link to an asynchronously loaded route without fetching the route'] = function testCanRenderALinkToAnAsynchronouslyLoadedRouteWithoutFetchingTheRoute(assert) { + var _this = this; + + assert.expect(4); + + this.router.map(function () { + this.route('post', { path: '/post/:id' }); + }); + + this.setSingleQPController('post'); + + var setupAppTemplate = function () { + _this.registerTemplate('application', '\n {{link-to \'Post\' \'post\' 1337 (query-params foo=\'bar\') class=\'post-link\'}}\n {{link-to \'Post\' \'post\' 7331 (query-params foo=\'boo\') class=\'post-link\'}}\n {{outlet}}\n '); + }; + + setupAppTemplate(); + + return this.visitAndAssert('/').then(function () { + assert.equal(_this.$('.post-link').eq(0).attr('href'), '/post/1337?foo=bar', 'renders correctly with default QP value'); + assert.equal(_this.$('.post-link').eq(1).attr('href'), '/post/7331?foo=boo', 'renders correctly with non-default QP value'); + assert.deepEqual(_this.fetchedHandlers, ['application', 'index'], 'only fetched the handlers for the route we\'re on'); + }); + }; + + _class.prototype['@test can transitionTo to an asynchronously loaded route with simple query params'] = function testCanTransitionToToAnAsynchronouslyLoadedRouteWithSimpleQueryParams(assert) { + var _this2 = this; + + assert.expect(6); + + this.router.map(function () { + this.route('post', { path: '/post/:id' }); + this.route('posts'); + }); + + this.setSingleQPController('post'); + + var postController = undefined; + return this.visitAndAssert('/').then(function () { + postController = _this2.getController('post'); + + return _this2.transitionTo('posts').then(function () { + _this2.assertCurrentPath('/posts'); + }); + }).then(function () { + return _this2.transitionTo('post', 1337, { queryParams: { foo: 'boo' } }).then(function () { + assert.equal(postController.get('foo'), 'boo', 'simple QP is correctly set on controller'); + _this2.assertCurrentPath('/post/1337?foo=boo'); + }); + }).then(function () { + return _this2.transitionTo('post', 1337, { queryParams: { foo: 'bar' } }).then(function () { + assert.equal(postController.get('foo'), 'bar', 'simple QP is correctly set with default value'); + _this2.assertCurrentPath('/post/1337'); + }); + }); + }; + + _class.prototype['@test can transitionTo to an asynchronously loaded route with array query params'] = function testCanTransitionToToAnAsynchronouslyLoadedRouteWithArrayQueryParams(assert) { + var _this3 = this; + + assert.expect(5); + + this.router.map(function () { + this.route('post', { path: '/post/:id' }); + }); + + this.setSingleQPController('post', 'comments', []); + + var postController = undefined; + return this.visitAndAssert('/').then(function () { + postController = _this3.getController('post'); + return _this3.transitionTo('post', 1337, { queryParams: { comments: [1, 2] } }).then(function () { + assert.deepEqual(postController.get('comments'), [1, 2], 'array QP is correctly set with default value'); + _this3.assertCurrentPath('/post/1337?comments=%5B1%2C2%5D'); + }); + }).then(function () { + return _this3.transitionTo('post', 1338).then(function () { + assert.deepEqual(postController.get('comments'), [], 'array QP is correctly set on controller'); + _this3.assertCurrentPath('/post/1338'); + }); + }); + }; + + _class.prototype['@test can transitionTo to an asynchronously loaded route with mapped query params'] = function testCanTransitionToToAnAsynchronouslyLoadedRouteWithMappedQueryParams(assert) { + var _this4 = this; + + assert.expect(7); + + this.router.map(function () { + this.route('post', { path: '/post/:id' }, function () { + this.route('index', { path: '/' }); + }); + }); + + this.setSingleQPController('post'); + this.setMappedQPController('post.index', 'comment', 'note'); + + var postController = undefined; + var postIndexController = undefined; + + return this.visitAndAssert('/').then(function () { + postController = _this4.getController('post'); + postIndexController = _this4.getController('post.index'); + + return _this4.transitionTo('post.index', 1337, { queryParams: { note: 6, foo: 'boo' } }).then(function () { + assert.equal(postController.get('foo'), 'boo', 'simple QP is correctly set on controller'); + assert.equal(postIndexController.get('comment'), 6, 'mapped QP is correctly set on controller'); + _this4.assertCurrentPath('/post/1337?foo=boo¬e=6'); + }); + }).then(function () { + return _this4.transitionTo('post', 1337, { queryParams: { foo: 'bar' } }).then(function () { + assert.equal(postController.get('foo'), 'bar', 'simple QP is correctly set with default value'); + assert.equal(postIndexController.get('comment'), 6, 'mapped QP retains value scoped to model'); + _this4.assertCurrentPath('/post/1337?note=6'); + }); + }); + }; + + _class.prototype['@test can transitionTo with a URL'] = function testCanTransitionToWithAURL(assert) { + var _this5 = this; + + assert.expect(7); + + this.router.map(function () { + this.route('post', { path: '/post/:id' }, function () { + this.route('index', { path: '/' }); + }); + }); + + this.setSingleQPController('post'); + this.setMappedQPController('post.index', 'comment', 'note'); + + var postController = undefined; + var postIndexController = undefined; + + return this.visitAndAssert('/').then(function () { + postController = _this5.getController('post'); + postIndexController = _this5.getController('post.index'); + + return _this5.transitionTo('/post/1337?foo=boo¬e=6').then(function () { + assert.equal(postController.get('foo'), 'boo', 'simple QP is correctly deserialized on controller'); + assert.equal(postIndexController.get('comment'), 6, 'mapped QP is correctly deserialized on controller'); + _this5.assertCurrentPath('/post/1337?foo=boo¬e=6'); + }); + }).then(function () { + return _this5.transitionTo('/post/1337?note=6').then(function () { + assert.equal(postController.get('foo'), 'bar', 'simple QP is correctly deserialized with default value'); + assert.equal(postIndexController.get('comment'), 6, 'mapped QP retains value scoped to model'); + _this5.assertCurrentPath('/post/1337?note=6'); + }); + }); + }; + + _class.prototype['@test undefined isn\'t serialized or deserialized into a string'] = function testUndefinedIsnTSerializedOrDeserializedIntoAString(assert) { + var _this6 = this; + + assert.expect(4); + + this.router.map(function () { + this.route('example'); + }); + + this.registerTemplate('application', '{{link-to \'Example\' \'example\' (query-params foo=undefined) id=\'the-link\'}}'); + + this.setSingleQPController('example', 'foo', undefined, { + foo: undefined + }); + + this.registerRoute('example', _emberRouting.Route.extend({ + model: function (params) { + assert.deepEqual(params, { foo: undefined }); + } + })); + + return this.visitAndAssert('/').then(function () { + assert.equal(_this6.$('#the-link').attr('href'), '/example', 'renders without undefined qp serialized'); + + return _this6.transitionTo('example', { queryParams: { foo: undefined } }).then(function () { + _this6.assertCurrentPath('/example'); + }); + }); + }; + + babelHelpers.createClass(_class, [{ + key: 'routerOptions', + get: function () { + var fetchedHandlers = this.fetchedHandlers = []; + + return { + location: 'test', + + _getQPMeta: function (handlerInfo) { + return this._bucketCache.lookup('route-meta', handlerInfo.name); + }, + + _getHandlerFunction: function () { + var getHandler = this._super.apply(this, arguments); + var cache = {}; + + return function (routeName) { + fetchedHandlers.push(routeName); + + // Cache the returns so we don't have more than one Promise for a + // given handler. + return cache[routeName] || (cache[routeName] = new _emberRuntime.RSVP.Promise(function (resolve) { + setTimeout(function () { + return resolve(getHandler(routeName)); + }, 10); + })); + }; + } + }; + } + }]); + return _class; + })(_internalTestHelpers.QueryParamTestCase)); +}); +enifed('ember/tests/routing/query_params_test/query_param_async_get_handler_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/routing/query_params_test'); + test('ember/tests/routing/query_params_test/query_param_async_get_handler_test.js should pass jscs', function () { + ok(true, 'ember/tests/routing/query_params_test/query_param_async_get_handler_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/routing/query_params_test/query_param_async_get_handler_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/routing/query_params_test'); + QUnit.test('ember/tests/routing/query_params_test/query_param_async_get_handler_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/query_params_test/query_param_async_get_handler_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/routing/query_params_test/query_params_paramless_link_to_test', ['exports', 'ember-runtime', 'ember-views', 'internal-test-helpers'], function (exports, _emberRuntime, _emberViews, _internalTestHelpers) { + 'use strict'; + + _internalTestHelpers.moduleFor('Query Params - paramless link-to', (function (_QueryParamTestCase) { + babelHelpers.inherits(_class, _QueryParamTestCase); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _QueryParamTestCase.apply(this, arguments); + } + + _class.prototype.testParamlessLinks = function testParamlessLinks(assert, routeName) { + assert.expect(1); + + this.registerTemplate(routeName, '{{link-to \'index\' \'index\' id=\'index-link\'}}'); + + this.registerController(routeName, _emberRuntime.Controller.extend({ + queryParams: ['foo'], + foo: 'wat' + })); + + return this.visit('/?foo=YEAH').then(function () { + assert.equal(_emberViews.jQuery('#index-link').attr('href'), '/?foo=YEAH'); + }); + }; + + _class.prototype['@test param-less links in an app booted with query params in the URL don\'t reset the query params: application'] = function testParamLessLinksInAnAppBootedWithQueryParamsInTheURLDonTResetTheQueryParamsApplication(assert) { + return this.testParamlessLinks(assert, 'application'); + }; + + _class.prototype['@test param-less links in an app booted with query params in the URL don\'t reset the query params: index'] = function testParamLessLinksInAnAppBootedWithQueryParamsInTheURLDonTResetTheQueryParamsIndex(assert) { + return this.testParamlessLinks(assert, 'index'); + }; + + return _class; + })(_internalTestHelpers.QueryParamTestCase)); +}); +enifed('ember/tests/routing/query_params_test/query_params_paramless_link_to_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/routing/query_params_test'); + test('ember/tests/routing/query_params_test/query_params_paramless_link_to_test.js should pass jscs', function () { + ok(true, 'ember/tests/routing/query_params_test/query_params_paramless_link_to_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/routing/query_params_test/query_params_paramless_link_to_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/routing/query_params_test'); + QUnit.test('ember/tests/routing/query_params_test/query_params_paramless_link_to_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/query_params_test/query_params_paramless_link_to_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/routing/query_params_test/shared_state_test', ['exports', 'ember-runtime', 'ember', 'ember-metal', 'ember-views', 'internal-test-helpers'], function (exports, _emberRuntime, _ember, _emberMetal, _emberViews, _internalTestHelpers) { + 'use strict'; + + _internalTestHelpers.moduleFor('Query Params - shared service state', (function (_QueryParamTestCase) { + babelHelpers.inherits(_class, _QueryParamTestCase); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _QueryParamTestCase.apply(this, arguments); + } + + _class.prototype.boot = function boot() { + this.setupApplication(); + return this.visitApplication(); + }; + + _class.prototype.setupApplication = function setupApplication() { + this.router.map(function () { + this.route('home', { path: '/' }); + this.route('dashboard'); + }); + + this.application.register('service:filters', _emberRuntime.Service.extend({ + shared: true + })); + + this.registerController('home', _emberRuntime.Controller.extend({ + filters: _ember.default.inject.service() + })); + + this.registerController('dashboard', _emberRuntime.Controller.extend({ + filters: _ember.default.inject.service(), + queryParams: [{ 'filters.shared': 'shared' }] + })); + + this.registerTemplate('application', '{{link-to \'Home\' \'home\' }}
    {{outlet}}
    '); + this.registerTemplate('home', '{{link-to \'Dashboard\' \'dashboard\' }}{{input type="checkbox" id=\'filters-checkbox\' checked=(mut filters.shared) }}'); + this.registerTemplate('dashboard', '{{link-to \'Home\' \'home\' }}'); + }; + + _class.prototype.visitApplication = function visitApplication() { + return this.visit('/'); + }; + + _class.prototype['@test can modify shared state before transition'] = function testCanModifySharedStateBeforeTransition(assert) { + var _this = this; + + assert.expect(1); + + return this.boot().then(function () { + _this.$input = _emberViews.jQuery('#filters-checkbox'); + + // click the checkbox once to set filters.shared to false + _emberMetal.run(_this.$input, 'click'); + + return _this.visit('/dashboard').then(function () { + assert.ok(true, 'expecting navigating to dashboard to succeed'); + }); + }); + }; + + _class.prototype['@test can modify shared state back to the default value before transition'] = function testCanModifySharedStateBackToTheDefaultValueBeforeTransition(assert) { + var _this2 = this; + + assert.expect(1); + + return this.boot().then(function () { + _this2.$input = _emberViews.jQuery('#filters-checkbox'); + + // click the checkbox twice to set filters.shared to false and back to true + _emberMetal.run(_this2.$input, 'click'); + _emberMetal.run(_this2.$input, 'click'); + + return _this2.visit('/dashboard').then(function () { + assert.ok(true, 'expecting navigating to dashboard to succeed'); + }); + }); + }; + + return _class; + })(_internalTestHelpers.QueryParamTestCase)); +}); +enifed('ember/tests/routing/query_params_test/shared_state_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/routing/query_params_test'); + test('ember/tests/routing/query_params_test/shared_state_test.js should pass jscs', function () { + ok(true, 'ember/tests/routing/query_params_test/shared_state_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/routing/query_params_test/shared_state_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/routing/query_params_test'); + QUnit.test('ember/tests/routing/query_params_test/shared_state_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/query_params_test/shared_state_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/routing/router_map_test', ['exports', 'ember-metal', 'ember-template-compiler', 'ember-application', 'ember-routing', 'ember-views', 'ember-glimmer'], function (exports, _emberMetal, _emberTemplateCompiler, _emberApplication, _emberRouting, _emberViews, _emberGlimmer) { + 'use strict'; + + var router = undefined, + App = undefined, + container = undefined; + + function bootApplication() { + router = container.lookup('router:main'); + _emberMetal.run(App, 'advanceReadiness'); + } + + function handleURL(path) { + return _emberMetal.run(function () { + return router.handleURL(path).then(function (value) { + ok(true, 'url: `' + path + '` was handled'); + return value; + }, function (reason) { + ok(false, 'failed to visit:`' + path + '` reason: `' + QUnit.jsDump.parse(reason)); + throw reason; + }); + }); + } + + QUnit.module('Router.map', { + setup: function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create({ + name: 'App', + rootElement: '#qunit-fixture' + }); + + App.deferReadiness(); + + App.Router.reopen({ + location: 'none' + }); + + container = App.__container__; + }); + }, + + teardown: function () { + _emberMetal.run(function () { + App.destroy(); + App = null; + + _emberGlimmer.setTemplates({}); + }); + } + }); + + QUnit.test('Router.map returns an Ember Router class', function () { + expect(1); + + var ret = App.Router.map(function () { + this.route('hello'); + }); + + ok(_emberRouting.Router.detect(ret)); + }); + + QUnit.test('Router.map can be called multiple times', function () { + expect(4); + + _emberGlimmer.setTemplate('hello', _emberTemplateCompiler.compile('Hello!')); + _emberGlimmer.setTemplate('goodbye', _emberTemplateCompiler.compile('Goodbye!')); + + App.Router.map(function () { + this.route('hello'); + }); + + App.Router.map(function () { + this.route('goodbye'); + }); + + bootApplication(); + + handleURL('/hello'); + + equal(_emberViews.jQuery('#qunit-fixture').text(), 'Hello!', 'The hello template was rendered'); + + handleURL('/goodbye'); + + equal(_emberViews.jQuery('#qunit-fixture').text(), 'Goodbye!', 'The goodbye template was rendered'); + }); +}); +enifed('ember/tests/routing/router_map_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/routing'); + test('ember/tests/routing/router_map_test.js should pass jscs', function () { + ok(true, 'ember/tests/routing/router_map_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/routing/router_map_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/routing'); + QUnit.test('ember/tests/routing/router_map_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/router_map_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/routing/substates_test', ['exports', 'ember-runtime', 'ember-routing', 'ember-metal', 'ember-template-compiler', 'ember-application', 'ember-views', 'ember-glimmer'], function (exports, _emberRuntime, _emberRouting, _emberMetal, _emberTemplateCompiler, _emberApplication, _emberViews, _emberGlimmer) { + 'use strict'; + + var Router = undefined, + App = undefined, + templates = undefined, + router = undefined, + container = undefined, + registry = undefined, + counter = undefined; + + function step(expectedValue, description) { + equal(counter, expectedValue, 'Step ' + expectedValue + ': ' + description); + counter++; + } + + function bootApplication(startingURL) { + for (var _name in templates) { + _emberGlimmer.setTemplate(_name, _emberTemplateCompiler.compile(templates[_name])); + } + + if (startingURL) { + _emberRouting.NoneLocation.reopen({ + path: startingURL + }); + } + + startingURL = startingURL || ''; + router = container.lookup('router:main'); + _emberMetal.run(App, 'advanceReadiness'); + } + + QUnit.module('Loading/Error Substates', { + setup: function () { + counter = 1; + + _emberMetal.run(function () { + App = _emberApplication.Application.create({ + name: 'App', + rootElement: '#qunit-fixture', + // fake a modules resolver + Resolver: _emberApplication.Resolver.extend({ moduleBasedResolver: true }) + }); + + App.deferReadiness(); + + App.Router.reopen({ + location: 'none' + }); + + Router = App.Router; + + container = App.__container__; + registry = App.__registry__; + + templates = { + application: '
    {{outlet}}
    ', + index: 'INDEX', + loading: 'LOADING', + bro: 'BRO', + sis: 'SIS' + }; + }); + }, + + teardown: function () { + _emberMetal.run(function () { + App.destroy(); + App = null; + + _emberGlimmer.setTemplates({}); + }); + + _emberRouting.NoneLocation.reopen({ + path: '' + }); + } + }); + + QUnit.test('Slow promise from a child route of application enters nested loading state', function () { + var broModel = {}; + var broDeferred = _emberRuntime.RSVP.defer(); + + Router.map(function () { + this.route('bro'); + }); + + App.ApplicationRoute = _emberRouting.Route.extend({ + setupController: function () { + step(2, 'ApplicationRoute#setup'); + } + }); + + App.BroRoute = _emberRouting.Route.extend({ + model: function () { + step(1, 'BroRoute#model'); + return broDeferred.promise; + } + }); + + bootApplication('/bro'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'LOADING', 'The Loading template is nested in application template\'s outlet'); + + _emberMetal.run(broDeferred, 'resolve', broModel); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'BRO', 'bro template has loaded and replaced loading template'); + }); + + QUnit.test('Slow promises waterfall on startup', function () { + expect(7); + + var grandmaDeferred = _emberRuntime.RSVP.defer(); + var sallyDeferred = _emberRuntime.RSVP.defer(); + + Router.map(function () { + this.route('grandma', function () { + this.route('mom', { resetNamespace: true }, function () { + this.route('sally'); + }); + }); + }); + + templates.grandma = 'GRANDMA {{outlet}}'; + templates.mom = 'MOM {{outlet}}'; + templates['mom/loading'] = 'MOMLOADING'; + templates['mom/sally'] = 'SALLY'; + + App.GrandmaRoute = _emberRouting.Route.extend({ + model: function () { + step(1, 'GrandmaRoute#model'); + return grandmaDeferred.promise; + } + }); + + App.MomRoute = _emberRouting.Route.extend({ + model: function () { + step(2, 'Mom#model'); + return {}; + } + }); + + App.MomSallyRoute = _emberRouting.Route.extend({ + model: function () { + step(3, 'SallyRoute#model'); + return sallyDeferred.promise; + }, + setupController: function () { + step(4, 'SallyRoute#setupController'); + } + }); + + bootApplication('/grandma/mom/sally'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'LOADING', 'The Loading template is nested in application template\'s outlet'); + + _emberMetal.run(grandmaDeferred, 'resolve', {}); + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'GRANDMA MOM MOMLOADING', 'Mom\'s child loading route is displayed due to sally\'s slow promise'); + + _emberMetal.run(sallyDeferred, 'resolve', {}); + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'GRANDMA MOM SALLY', 'Sally template displayed'); + }); + + QUnit.test('ApplicationRoute#currentPath reflects loading state path', function () { + expect(4); + + var momDeferred = _emberRuntime.RSVP.defer(); + + Router.map(function () { + this.route('grandma', function () { + this.route('mom'); + }); + }); + + templates.grandma = 'GRANDMA {{outlet}}'; + templates['grandma/loading'] = 'GRANDMALOADING'; + templates['grandma/mom'] = 'MOM'; + + App.GrandmaMomRoute = _emberRouting.Route.extend({ + model: function () { + return momDeferred.promise; + } + }); + + bootApplication('/grandma/mom'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'GRANDMA GRANDMALOADING'); + + var appController = container.lookup('controller:application'); + equal(appController.get('currentPath'), 'grandma.loading', 'currentPath reflects loading state'); + + _emberMetal.run(momDeferred, 'resolve', {}); + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'GRANDMA MOM'); + equal(appController.get('currentPath'), 'grandma.mom', 'currentPath reflects final state'); + }); + + QUnit.test('Slow promises returned from ApplicationRoute#model don\'t enter LoadingRoute', function () { + expect(2); + + var appDeferred = _emberRuntime.RSVP.defer(); + + App.ApplicationRoute = _emberRouting.Route.extend({ + model: function () { + return appDeferred.promise; + } + }); + + App.LoadingRoute = _emberRouting.Route.extend({ + setupController: function () { + ok(false, 'shouldn\'t get here'); + } + }); + + bootApplication(); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), '', 'nothing has been rendered yet'); + + _emberMetal.run(appDeferred, 'resolve', {}); + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'INDEX'); + }); + + QUnit.test('Don\'t enter loading route unless either route or template defined', function () { + delete templates.loading; + + expect(2); + + var indexDeferred = _emberRuntime.RSVP.defer(); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.IndexRoute = _emberRouting.Route.extend({ + model: function () { + return indexDeferred.promise; + } + }); + + bootApplication(); + + var appController = container.lookup('controller:application'); + ok(appController.get('currentPath') !== 'loading', 'loading state not entered'); + + _emberMetal.run(indexDeferred, 'resolve', {}); + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'INDEX'); + }); + + QUnit.test('Enter loading route if only LoadingRoute defined', function () { + delete templates.loading; + + expect(4); + + var indexDeferred = _emberRuntime.RSVP.defer(); + + App.IndexRoute = _emberRouting.Route.extend({ + model: function () { + step(1, 'IndexRoute#model'); + return indexDeferred.promise; + } + }); + + App.LoadingRoute = _emberRouting.Route.extend({ + setupController: function () { + step(2, 'LoadingRoute#setupController'); + } + }); + + bootApplication(); + + var appController = container.lookup('controller:application'); + equal(appController.get('currentPath'), 'loading', 'loading state entered'); + + _emberMetal.run(indexDeferred, 'resolve', {}); + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'INDEX'); + }); + + QUnit.test('Enter child loading state of pivot route', function () { + expect(4); + + var deferred = _emberRuntime.RSVP.defer(); + + Router.map(function () { + this.route('grandma', function () { + this.route('mom', { resetNamespace: true }, function () { + this.route('sally'); + }); + this.route('smells'); + }); + }); + + templates['grandma/loading'] = 'GMONEYLOADING'; + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.MomSallyRoute = _emberRouting.Route.extend({ + setupController: function () { + step(1, 'SallyRoute#setupController'); + } + }); + + App.GrandmaSmellsRoute = _emberRouting.Route.extend({ + model: function () { + return deferred.promise; + } + }); + + bootApplication('/grandma/mom/sally'); + + var appController = container.lookup('controller:application'); + equal(appController.get('currentPath'), 'grandma.mom.sally', 'Initial route fully loaded'); + + _emberMetal.run(router, 'transitionTo', 'grandma.smells'); + equal(appController.get('currentPath'), 'grandma.loading', 'in pivot route\'s child loading state'); + + _emberMetal.run(deferred, 'resolve', {}); + + equal(appController.get('currentPath'), 'grandma.smells', 'Finished transition'); + }); + + QUnit.test('Loading actions bubble to root, but don\'t enter substates above pivot', function () { + expect(6); + + delete templates.loading; + + var sallyDeferred = _emberRuntime.RSVP.defer(); + var smellsDeferred = _emberRuntime.RSVP.defer(); + + Router.map(function () { + this.route('grandma', function () { + this.route('mom', { resetNamespace: true }, function () { + this.route('sally'); + }); + this.route('smells'); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.ApplicationRoute = _emberRouting.Route.extend({ + actions: { + loading: function (transition, route) { + ok(true, 'loading action received on ApplicationRoute'); + } + } + }); + + App.MomSallyRoute = _emberRouting.Route.extend({ + model: function () { + return sallyDeferred.promise; + } + }); + + App.GrandmaSmellsRoute = _emberRouting.Route.extend({ + model: function () { + return smellsDeferred.promise; + } + }); + + bootApplication('/grandma/mom/sally'); + + var appController = container.lookup('controller:application'); + ok(!appController.get('currentPath'), 'Initial route fully loaded'); + _emberMetal.run(sallyDeferred, 'resolve', {}); + + equal(appController.get('currentPath'), 'grandma.mom.sally', 'transition completed'); + + _emberMetal.run(router, 'transitionTo', 'grandma.smells'); + equal(appController.get('currentPath'), 'grandma.mom.sally', 'still in initial state because the only loading state is above the pivot route'); + + _emberMetal.run(smellsDeferred, 'resolve', {}); + + equal(appController.get('currentPath'), 'grandma.smells', 'Finished transition'); + }); + + QUnit.test('Default error event moves into nested route', function () { + expect(6); + + templates['grandma'] = 'GRANDMA {{outlet}}'; + templates['grandma/error'] = 'ERROR: {{model.msg}}'; + + Router.map(function () { + this.route('grandma', function () { + this.route('mom', { resetNamespace: true }, function () { + this.route('sally'); + }); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.MomSallyRoute = _emberRouting.Route.extend({ + model: function () { + step(1, 'MomSallyRoute#model'); + + return _emberRuntime.RSVP.reject({ + msg: 'did it broke?' + }); + }, + actions: { + error: function () { + step(2, 'MomSallyRoute#actions.error'); + return true; + } + } + }); + + throws(function () { + bootApplication('/grandma/mom/sally'); + }, function (err) { + return err.msg === 'did it broke?'; + }); + + step(3, 'App finished booting'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'GRANDMA ERROR: did it broke?', 'error bubbles'); + + var appController = container.lookup('controller:application'); + equal(appController.get('currentPath'), 'grandma.error', 'Initial route fully loaded'); + }); + + QUnit.test('Error events that aren\'t bubbled don\t throw application assertions', function () { + expect(2); + + templates['grandma'] = 'GRANDMA {{outlet}}'; + + Router.map(function () { + this.route('grandma', function () { + this.route('mom', { resetNamespace: true }, function () { + this.route('sally'); + }); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.MomSallyRoute = _emberRouting.Route.extend({ + model: function () { + step(1, 'MomSallyRoute#model'); + + return _emberRuntime.RSVP.reject({ + msg: 'did it broke?' + }); + }, + actions: { + error: function (err) { + equal(err.msg, 'did it broke?'); + return false; + } + } + }); + + bootApplication('/grandma/mom/sally'); + }); + + QUnit.test('Non-bubbled errors that re-throw aren\'t swallowed', function () { + expect(2); + + templates['grandma'] = 'GRANDMA {{outlet}}'; + + Router.map(function () { + this.route('grandma', function () { + this.route('mom', { resetNamespace: true }, function () { + this.route('sally'); + }); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.MomSallyRoute = _emberRouting.Route.extend({ + model: function () { + step(1, 'MomSallyRoute#model'); + + return _emberRuntime.RSVP.reject({ + msg: 'did it broke?' + }); + }, + actions: { + error: function (err) { + // returns undefined which is falsey + throw err; + } + } + }); + + throws(function () { + bootApplication('/grandma/mom/sally'); + }, function (err) { + return err.msg === 'did it broke?'; + }); + }); + + QUnit.test('Handled errors that re-throw aren\'t swallowed', function () { + expect(4); + + var handledError = undefined; + + templates['grandma'] = 'GRANDMA {{outlet}}'; + + Router.map(function () { + this.route('grandma', function () { + this.route('mom', { resetNamespace: true }, function () { + this.route('sally'); + this.route('this-route-throws'); + }); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.MomSallyRoute = _emberRouting.Route.extend({ + model: function () { + step(1, 'MomSallyRoute#model'); + + return _emberRuntime.RSVP.reject({ + msg: 'did it broke?' + }); + }, + actions: { + error: function (err) { + step(2, 'MomSallyRoute#error'); + + handledError = err; + + this.transitionTo('mom.this-route-throws'); + + // Marks error as handled + return false; + } + } + }); + + App.MomThisRouteThrowsRoute = _emberRouting.Route.extend({ + model: function () { + step(3, 'MomThisRouteThrows#model'); + + throw handledError; + } + }); + + throws(function () { + bootApplication('/grandma/mom/sally'); + }, function (err) { + return err.msg === 'did it broke?'; + }); + }); + + QUnit.test('Handled errors that bubble can be handled at a higher level', function () { + expect(4); + + var handledError = undefined; + + templates['grandma'] = 'GRANDMA {{outlet}}'; + + Router.map(function () { + this.route('grandma', function () { + this.route('mom', { resetNamespace: true }, function () { + this.route('sally'); + }); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.MomRoute = _emberRouting.Route.extend({ + actions: { + error: function (err) { + step(3, 'MomRoute#error'); + + equal(err, handledError, 'error handled and rebubbled is handleable at heigher route'); + } + } + }); + + App.MomSallyRoute = _emberRouting.Route.extend({ + model: function () { + step(1, 'MomSallyRoute#model'); + + return _emberRuntime.RSVP.reject({ + msg: 'did it broke?' + }); + }, + + actions: { + error: function (err) { + step(2, 'MomSallyRoute#error'); + + handledError = err; + + return true; + } + } + }); + + bootApplication('/grandma/mom/sally'); + }); + + QUnit.test('errors that are bubbled are thrown at a higher level if not handled', function () { + expect(3); + + var handledError = undefined; + + templates['grandma'] = 'GRANDMA {{outlet}}'; + + Router.map(function () { + this.route('grandma', function () { + this.route('mom', { resetNamespace: true }, function () { + this.route('sally'); + }); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.MomSallyRoute = _emberRouting.Route.extend({ + model: function () { + step(1, 'MomSallyRoute#model'); + + return _emberRuntime.RSVP.reject({ + msg: 'did it broke?' + }); + }, + + actions: { + error: function (err) { + step(2, 'MomSallyRoute#error'); + + handledError = err; + + return true; + } + } + }); + + throws(function () { + bootApplication('/grandma/mom/sally'); + }, function (err) { + return err.msg === 'did it broke?'; + }, 'Correct error was thrown'); + }); + + QUnit.test('Handled errors that are thrown through rejection aren\'t swallowed', function () { + expect(4); + + var handledError = undefined; + + templates['grandma'] = 'GRANDMA {{outlet}}'; + + Router.map(function () { + this.route('grandma', function () { + this.route('mom', { resetNamespace: true }, function () { + this.route('sally'); + this.route('this-route-throws'); + }); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.MomSallyRoute = _emberRouting.Route.extend({ + model: function () { + step(1, 'MomSallyRoute#model'); + + return _emberRuntime.RSVP.reject({ + msg: 'did it broke?' + }); + }, + actions: { + error: function (err) { + step(2, 'MomSallyRoute#error'); + + handledError = err; + + this.transitionTo('mom.this-route-throws'); + + // Marks error as handled + return false; + } + } + }); + + App.MomThisRouteThrowsRoute = _emberRouting.Route.extend({ + model: function () { + step(3, 'MomThisRouteThrows#model'); + + return _emberRuntime.RSVP.reject(handledError); + } + }); + + throws(function () { + bootApplication('/grandma/mom/sally'); + }, function (err) { + return err.msg === 'did it broke?'; + }); + }); + + QUnit.test('Setting a query param during a slow transition should work', function () { + var deferred = _emberRuntime.RSVP.defer(); + + Router.map(function () { + this.route('grandma', { path: '/grandma/:seg' }, function () {}); + }); + + templates['grandma/loading'] = 'GMONEYLOADING'; + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.IndexRoute = _emberRouting.Route.extend({ + beforeModel: function () { + this.transitionTo('grandma', 1); + } + }); + + App.GrandmaRoute = _emberRouting.Route.extend({ + queryParams: { + test: { defaultValue: 1 } + } + }); + + App.GrandmaIndexRoute = _emberRouting.Route.extend({ + model: function () { + return deferred.promise; + } + }); + + bootApplication('/'); + + var appController = container.lookup('controller:application'); + var grandmaController = container.lookup('controller:grandma'); + + equal(appController.get('currentPath'), 'grandma.loading', 'Initial route should be loading'); + + _emberMetal.run(function () { + grandmaController.set('test', 3); + }); + + equal(appController.get('currentPath'), 'grandma.loading', 'Route should still be loading'); + equal(grandmaController.get('test'), 3, 'Controller query param value should have changed'); + + _emberMetal.run(deferred, 'resolve', {}); + + equal(appController.get('currentPath'), 'grandma.index', 'Transition should be complete'); + }); + + QUnit.test('Slow promises returned from ApplicationRoute#model enter ApplicationLoadingRoute if present', function () { + expect(2); + + var appDeferred = _emberRuntime.RSVP.defer(); + + App.ApplicationRoute = _emberRouting.Route.extend({ + model: function () { + return appDeferred.promise; + } + }); + + var loadingRouteEntered = false; + App.ApplicationLoadingRoute = _emberRouting.Route.extend({ + setupController: function () { + loadingRouteEntered = true; + } + }); + + bootApplication(); + + ok(loadingRouteEntered, 'ApplicationLoadingRoute was entered'); + + _emberMetal.run(appDeferred, 'resolve', {}); + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'INDEX'); + }); + + QUnit.test('Slow promises returned from ApplicationRoute#model enter application_loading if template present', function () { + expect(3); + + templates['application_loading'] = '
    TOPLEVEL LOADING
    '; + + var appDeferred = _emberRuntime.RSVP.defer(); + App.ApplicationRoute = _emberRouting.Route.extend({ + model: function () { + return appDeferred.promise; + } + }); + + bootApplication(); + + equal(_emberViews.jQuery('#qunit-fixture #toplevel-loading').text(), 'TOPLEVEL LOADING'); + + _emberMetal.run(appDeferred, 'resolve', {}); + + equal(_emberViews.jQuery('#toplevel-loading', '#qunit-fixture').length, 0, 'top-level loading View has been entirely removed from DOM'); + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'INDEX'); + }); + + QUnit.test('Default error event moves into nested route, prioritizing more specifically named error route', function () { + expect(6); + + templates['grandma'] = 'GRANDMA {{outlet}}'; + templates['grandma/error'] = 'ERROR: {{model.msg}}'; + templates['mom_error'] = 'MOM ERROR: {{model.msg}}'; + + Router.map(function () { + this.route('grandma', function () { + this.route('mom', { resetNamespace: true }, function () { + this.route('sally'); + }); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.MomSallyRoute = _emberRouting.Route.extend({ + model: function () { + step(1, 'MomSallyRoute#model'); + + return _emberRuntime.RSVP.reject({ + msg: 'did it broke?' + }); + }, + actions: { + error: function () { + step(2, 'MomSallyRoute#actions.error'); + return true; + } + } + }); + + throws(function () { + bootApplication('/grandma/mom/sally'); + }, function (err) { + return err.msg === 'did it broke?'; + }); + + step(3, 'App finished booting'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'GRANDMA MOM ERROR: did it broke?', 'the more specifically-named mom error substate was entered over the other error route'); + + var appController = container.lookup('controller:application'); + equal(appController.get('currentPath'), 'grandma.mom_error', 'Initial route fully loaded'); + }); + + QUnit.test('Prioritized substate entry works with preserved-namespace nested routes', function () { + expect(2); + + templates['foo/bar_loading'] = 'FOOBAR LOADING'; + templates['foo/bar/index'] = 'YAY'; + + Router.map(function () { + this.route('foo', function () { + this.route('bar', { path: '/bar' }, function () {}); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + var deferred = _emberRuntime.RSVP.defer(); + App.FooBarRoute = _emberRouting.Route.extend({ + model: function () { + return deferred.promise; + } + }); + + bootApplication('/foo/bar'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'FOOBAR LOADING', 'foo.bar_loading was entered (as opposed to something like foo/foo/bar_loading)'); + + _emberMetal.run(deferred, 'resolve'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'YAY'); + }); + + QUnit.test('Prioritized substate entry works with reset-namespace nested routes', function () { + expect(2); + + templates['bar_loading'] = 'BAR LOADING'; + templates['bar/index'] = 'YAY'; + + Router.map(function () { + this.route('foo', function () { + this.route('bar', { path: '/bar', resetNamespace: true }, function () {}); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + var deferred = _emberRuntime.RSVP.defer(); + App.BarRoute = _emberRouting.Route.extend({ + model: function () { + return deferred.promise; + } + }); + + bootApplication('/foo/bar'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'BAR LOADING', 'foo.bar_loading was entered (as opposed to something like foo/foo/bar_loading)'); + + _emberMetal.run(deferred, 'resolve'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'YAY'); + }); + + QUnit.test('Prioritized loading substate entry works with preserved-namespace nested routes', function () { + expect(2); + + templates['foo/bar_loading'] = 'FOOBAR LOADING'; + templates['foo/bar'] = 'YAY'; + + Router.map(function () { + this.route('foo', function () { + this.route('bar'); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + var deferred = _emberRuntime.RSVP.defer(); + App.FooBarRoute = _emberRouting.Route.extend({ + model: function () { + return deferred.promise; + } + }); + + bootApplication('/foo/bar'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'FOOBAR LOADING', 'foo.bar_loading was entered (as opposed to something like foo/foo/bar_loading)'); + + _emberMetal.run(deferred, 'resolve'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'YAY'); + }); + + QUnit.test('Prioritized error substate entry works with preserved-namespace nested routes', function () { + expect(2); + + templates['foo/bar_error'] = 'FOOBAR ERROR: {{model.msg}}'; + templates['foo/bar'] = 'YAY'; + + Router.map(function () { + this.route('foo', function () { + this.route('bar'); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.FooBarRoute = _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.RSVP.reject({ + msg: 'did it broke?' + }); + } + }); + + throws(function () { + bootApplication('/foo/bar'); + }, function (err) { + return err.msg === 'did it broke?'; + }); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'FOOBAR ERROR: did it broke?', 'foo.bar_error was entered (as opposed to something like foo/foo/bar_error)'); + }); + + QUnit.test('Prioritized loading substate entry works with auto-generated index routes', function () { + expect(2); + + templates['foo/index_loading'] = 'FOO LOADING'; + templates['foo/index'] = 'YAY'; + templates['foo'] = '{{outlet}}'; + + Router.map(function () { + this.route('foo', function () { + this.route('bar'); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + var deferred = _emberRuntime.RSVP.defer(); + App.FooIndexRoute = _emberRouting.Route.extend({ + model: function () { + return deferred.promise; + } + }); + App.FooRoute = _emberRouting.Route.extend({ + model: function () { + return true; + } + }); + + bootApplication('/foo'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'FOO LOADING', 'foo.index_loading was entered'); + + _emberMetal.run(deferred, 'resolve'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'YAY'); + }); + + QUnit.test('Prioritized error substate entry works with auto-generated index routes', function () { + expect(2); + + templates['foo/index_error'] = 'FOO ERROR: {{model.msg}}'; + templates['foo/index'] = 'YAY'; + templates['foo'] = '{{outlet}}'; + + Router.map(function () { + this.route('foo', function () { + this.route('bar'); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.FooIndexRoute = _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.RSVP.reject({ + msg: 'did it broke?' + }); + } + }); + App.FooRoute = _emberRouting.Route.extend({ + model: function () { + return true; + } + }); + + throws(function () { + return bootApplication('/foo'); + }, function (err) { + return err.msg === 'did it broke?'; + }); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'FOO ERROR: did it broke?', 'foo.index_error was entered'); + }); + + QUnit.test('Rejected promises returned from ApplicationRoute transition into top-level application_error', function () { + expect(3); + + templates['application_error'] = '

    TOPLEVEL ERROR: {{model.msg}}

    '; + + var reject = true; + App.ApplicationRoute = _emberRouting.Route.extend({ + model: function () { + if (reject) { + return _emberRuntime.RSVP.reject({ msg: 'BAD NEWS BEARS' }); + } else { + return {}; + } + } + }); + + throws(function () { + return bootApplication(); + }, function (err) { + return err.msg === 'BAD NEWS BEARS'; + }); + + equal(_emberViews.jQuery('#toplevel-error', '#qunit-fixture').text(), 'TOPLEVEL ERROR: BAD NEWS BEARS'); + + reject = false; + _emberMetal.run(router, 'transitionTo', 'index'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'INDEX'); + }); +}); +enifed('ember/tests/routing/substates_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/routing'); + test('ember/tests/routing/substates_test.js should pass jscs', function () { + ok(true, 'ember/tests/routing/substates_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/routing/substates_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/routing'); + QUnit.test('ember/tests/routing/substates_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/substates_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/routing/toplevel_dom_test', ['exports', 'ember-metal', 'ember-template-compiler', 'ember-application', 'ember-views', 'ember-routing', 'ember-glimmer'], function (exports, _emberMetal, _emberTemplateCompiler, _emberApplication, _emberViews, _emberRouting, _emberGlimmer) { + 'use strict'; + + var App = undefined, + templates = undefined, + router = undefined, + container = undefined; + + function bootApplication() { + for (var _name in templates) { + _emberGlimmer.setTemplate(_name, _emberTemplateCompiler.compile(templates[_name])); + } + router = container.lookup('router:main'); + _emberMetal.run(App, 'advanceReadiness'); + } + + QUnit.module('Top Level DOM Structure', { + setup: function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create({ + name: 'App', + rootElement: '#qunit-fixture' + }); + + App.deferReadiness(); + + App.Router.reopen({ + location: 'none' + }); + + container = App.__container__; + + templates = { + application: 'hello world' + }; + }); + }, + + teardown: function () { + _emberMetal.run(function () { + App.destroy(); + App = null; + _emberGlimmer.setTemplates({}); + }); + + _emberRouting.NoneLocation.reopen({ + path: '' + }); + } + }); + + QUnit.test('Topmost template always get an element', function () { + bootApplication(); + equal(_emberViews.jQuery('#qunit-fixture > .ember-view').text(), 'hello world'); + }); +}); +enifed('ember/tests/routing/toplevel_dom_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/routing'); + test('ember/tests/routing/toplevel_dom_test.js should pass jscs', function () { + ok(true, 'ember/tests/routing/toplevel_dom_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/routing/toplevel_dom_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/routing'); + QUnit.test('ember/tests/routing/toplevel_dom_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/toplevel_dom_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/view_instrumentation_test', ['exports', 'ember-metal', 'ember-views', 'ember-application', 'ember-template-compiler', 'ember-glimmer'], function (exports, _emberMetal, _emberViews, _emberApplication, _emberTemplateCompiler, _emberGlimmer) { + 'use strict'; + + var App = undefined, + $fixture = undefined; + + function setupExample() { + // setup templates + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Index

    ')); + _emberGlimmer.setTemplate('posts', _emberTemplateCompiler.compile('

    Posts

    ')); + + App.Router.map(function () { + this.route('posts'); + }); + } + + function handleURL(path) { + var router = App.__container__.lookup('router:main'); + return _emberMetal.run(router, 'handleURL', path); + } + + QUnit.module('View Instrumentation', { + setup: function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create({ + rootElement: '#qunit-fixture' + }); + App.deferReadiness(); + + App.Router.reopen({ + location: 'none' + }); + }); + + $fixture = _emberViews.jQuery('#qunit-fixture'); + setupExample(); + }, + + teardown: function () { + _emberMetal.instrumentationReset(); + _emberMetal.run(App, 'destroy'); + App = null; + _emberGlimmer.setTemplates({}); + } + }); + + QUnit.test('Nodes without view instances are instrumented', function (assert) { + var called = false; + _emberMetal.instrumentationSubscribe('render', { + before: function () { + called = true; + }, + after: function () {} + }); + _emberMetal.run(App, 'advanceReadiness'); + assert.equal($fixture.text(), 'Index', 'It rendered the right template'); + assert.ok(called, 'Instrumentation called on first render'); + called = false; + handleURL('/posts'); + assert.equal($fixture.text(), 'Posts', 'It rendered the right template'); + assert.ok(called, 'instrumentation called on transition to non-view backed route'); + }); +}); +enifed('ember/tests/view_instrumentation_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests'); + test('ember/tests/view_instrumentation_test.js should pass jscs', function () { + ok(true, 'ember/tests/view_instrumentation_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/view_instrumentation_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests'); + QUnit.test('ember/tests/view_instrumentation_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/view_instrumentation_test.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/apply-mixins.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers'); + test('internal-test-helpers/apply-mixins.js should pass jscs', function () { + ok(true, 'internal-test-helpers/apply-mixins.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/apply-mixins.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers'); + QUnit.test('internal-test-helpers/apply-mixins.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/apply-mixins.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/build-owner.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers'); + test('internal-test-helpers/build-owner.js should pass jscs', function () { + ok(true, 'internal-test-helpers/build-owner.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/build-owner.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers'); + QUnit.test('internal-test-helpers/build-owner.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/build-owner.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/confirm-export.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers'); + test('internal-test-helpers/confirm-export.js should pass jscs', function () { + ok(true, 'internal-test-helpers/confirm-export.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/confirm-export.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers'); + QUnit.test('internal-test-helpers/confirm-export.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/confirm-export.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/equal-inner-html.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers'); + test('internal-test-helpers/equal-inner-html.js should pass jscs', function () { + ok(true, 'internal-test-helpers/equal-inner-html.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/equal-inner-html.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers'); + QUnit.test('internal-test-helpers/equal-inner-html.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/equal-inner-html.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/equal-tokens.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers'); + test('internal-test-helpers/equal-tokens.js should pass jscs', function () { + ok(true, 'internal-test-helpers/equal-tokens.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/equal-tokens.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers'); + QUnit.test('internal-test-helpers/equal-tokens.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/equal-tokens.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/factory.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers'); + test('internal-test-helpers/factory.js should pass jscs', function () { + ok(true, 'internal-test-helpers/factory.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/factory.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers'); + QUnit.test('internal-test-helpers/factory.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/factory.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers'); + test('internal-test-helpers/index.js should pass jscs', function () { + ok(true, 'internal-test-helpers/index.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers'); + QUnit.test('internal-test-helpers/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/index.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/matchers.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers'); + test('internal-test-helpers/matchers.js should pass jscs', function () { + ok(true, 'internal-test-helpers/matchers.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/matchers.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers'); + QUnit.test('internal-test-helpers/matchers.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/matchers.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/module-for.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers'); + test('internal-test-helpers/module-for.js should pass jscs', function () { + ok(true, 'internal-test-helpers/module-for.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/module-for.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers'); + QUnit.test('internal-test-helpers/module-for.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/module-for.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/run.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers'); + test('internal-test-helpers/run.js should pass jscs', function () { + ok(true, 'internal-test-helpers/run.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/run.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers'); + QUnit.test('internal-test-helpers/run.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/run.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/strip.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers'); + test('internal-test-helpers/strip.js should pass jscs', function () { + ok(true, 'internal-test-helpers/strip.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/strip.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers'); + QUnit.test('internal-test-helpers/strip.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/strip.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/test-cases/abstract-application.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers/test-cases'); + test('internal-test-helpers/test-cases/abstract-application.js should pass jscs', function () { + ok(true, 'internal-test-helpers/test-cases/abstract-application.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/test-cases/abstract-application.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers/test-cases'); + QUnit.test('internal-test-helpers/test-cases/abstract-application.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/test-cases/abstract-application.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/test-cases/abstract-rendering.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers/test-cases'); + test('internal-test-helpers/test-cases/abstract-rendering.js should pass jscs', function () { + ok(true, 'internal-test-helpers/test-cases/abstract-rendering.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/test-cases/abstract-rendering.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers/test-cases'); + QUnit.test('internal-test-helpers/test-cases/abstract-rendering.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/test-cases/abstract-rendering.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/test-cases/abstract.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers/test-cases'); + test('internal-test-helpers/test-cases/abstract.js should pass jscs', function () { + ok(true, 'internal-test-helpers/test-cases/abstract.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/test-cases/abstract.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers/test-cases'); + QUnit.test('internal-test-helpers/test-cases/abstract.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/test-cases/abstract.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/test-cases/application.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers/test-cases'); + test('internal-test-helpers/test-cases/application.js should pass jscs', function () { + ok(true, 'internal-test-helpers/test-cases/application.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/test-cases/application.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers/test-cases'); + QUnit.test('internal-test-helpers/test-cases/application.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/test-cases/application.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/test-cases/query-param.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers/test-cases'); + test('internal-test-helpers/test-cases/query-param.js should pass jscs', function () { + ok(true, 'internal-test-helpers/test-cases/query-param.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/test-cases/query-param.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers/test-cases'); + QUnit.test('internal-test-helpers/test-cases/query-param.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/test-cases/query-param.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/test-cases/rendering.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers/test-cases'); + test('internal-test-helpers/test-cases/rendering.js should pass jscs', function () { + ok(true, 'internal-test-helpers/test-cases/rendering.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/test-cases/rendering.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers/test-cases'); + QUnit.test('internal-test-helpers/test-cases/rendering.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/test-cases/rendering.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/test-groups.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers'); + test('internal-test-helpers/test-groups.js should pass jscs', function () { + ok(true, 'internal-test-helpers/test-groups.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/test-groups.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers'); + QUnit.test('internal-test-helpers/test-groups.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/test-groups.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/tests/index-test', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('internal-test-helpers'); + + QUnit.test('module present', function (assert) { + assert.ok(true, 'each package needs at least one test to be able to run through `npm test`'); + }); +}); +enifed('internal-test-helpers/tests/index-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers/tests'); + test('internal-test-helpers/tests/index-test.js should pass jscs', function () { + ok(true, 'internal-test-helpers/tests/index-test.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/tests/index-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers/tests'); + QUnit.test('internal-test-helpers/tests/index-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/tests/index-test.js should pass jshint.'); + }); +}); +}()); diff --git a/ember-tests.prod.js b/ember-tests.prod.js new file mode 100644 index 000000000..778ec9cff --- /dev/null +++ b/ember-tests.prod.js @@ -0,0 +1,82555 @@ +;(function() { +/*! + * @overview Ember - JavaScript Application Framework + * @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.10.2-with-backtracking + */ + +var enifed, requireModule, Ember; +var mainContext = this; + +(function() { + var isNode = typeof window === 'undefined' && + typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; + + if (!isNode) { + Ember = this.Ember = this.Ember || {}; + } + + if (typeof Ember === 'undefined') { Ember = {}; } + + if (typeof Ember.__loader === 'undefined') { + var registry = {}; + var seen = {}; + + enifed = function(name, deps, callback) { + var value = { }; + + if (!callback) { + value.deps = []; + value.callback = deps; + } else { + value.deps = deps; + value.callback = callback; + } + + registry[name] = value; + }; + + requireModule = function(name) { + return internalRequire(name, null); + }; + + // setup `require` module + requireModule['default'] = requireModule; + + requireModule.has = function registryHas(moduleName) { + return !!registry[moduleName] || !!registry[moduleName + '/index']; + }; + + function missingModule(name, referrerName) { + if (referrerName) { + throw new Error('Could not find module ' + name + ' required by: ' + referrerName); + } else { + throw new Error('Could not find module ' + name); + } + } + + function internalRequire(_name, referrerName) { + var name = _name; + var mod = registry[name]; + + if (!mod) { + name = name + '/index'; + mod = registry[name]; + } + + var exports = seen[name]; + + if (exports !== undefined) { + return exports; + } + + exports = seen[name] = {}; + + if (!mod) { + missingModule(_name, referrerName); + } + + var deps = mod.deps; + var callback = mod.callback; + var reified = new Array(deps.length); + + for (var i = 0; i < deps.length; i++) { + if (deps[i] === 'exports') { + reified[i] = exports; + } else if (deps[i] === 'require') { + reified[i] = requireModule; + } else { + reified[i] = internalRequire(deps[i], name); + } + } + + callback.apply(this, reified); + + return exports; + } + + requireModule._eak_seen = registry; + + Ember.__loader = { + define: enifed, + require: requireModule, + registry: registry + }; + } else { + enifed = Ember.__loader.define; + requireModule = Ember.__loader.require; + } +})(); + +var babelHelpers; + +function inherits(subClass, superClass) { + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : defaults(subClass, superClass); +} + +function taggedTemplateLiteralLoose(strings, raw) { + strings.raw = raw; + return strings; +} + +function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } +} + +function createClass(Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; +} + +function interopExportWildcard(obj, defaults) { + var newObj = defaults({}, obj); + delete newObj['default']; + return newObj; +} + +function defaults(obj, defaults) { + var keys = Object.getOwnPropertyNames(defaults); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = Object.getOwnPropertyDescriptor(defaults, key); + if (value && value.configurable && obj[key] === undefined) { + Object.defineProperty(obj, key, value); + } + } + return obj; +} + +babelHelpers = { + inherits: inherits, + taggedTemplateLiteralLoose: taggedTemplateLiteralLoose, + slice: Array.prototype.slice, + createClass: createClass, + interopExportWildcard: interopExportWildcard, + defaults: defaults +}; + +enifed('container/container.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - container'); + test('container/container.js should pass jscs', function () { + ok(true, 'container/container.js should pass jscs.'); + }); +}); +enifed('container/container.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - container'); + QUnit.test('container/container.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'container/container.js should pass jshint.'); + }); +}); +enifed('container/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - container'); + test('container/index.js should pass jscs', function () { + ok(true, 'container/index.js should pass jscs.'); + }); +}); +enifed('container/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - container'); + QUnit.test('container/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'container/index.js should pass jshint.'); + }); +}); +enifed('container/registry.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - container'); + test('container/registry.js should pass jscs', function () { + ok(true, 'container/registry.js should pass jscs.'); + }); +}); +enifed('container/registry.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - container'); + QUnit.test('container/registry.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'container/registry.js should pass jshint.'); + }); +}); +enifed('container/tests/container_test', ['exports', 'ember-utils', 'ember-environment', 'ember-metal', 'container/index', 'internal-test-helpers'], function (exports, _emberUtils, _emberEnvironment, _emberMetal, _containerIndex, _internalTestHelpers) { + 'use strict'; + + var originalModelInjections = undefined; + + QUnit.module('Container', { + setup: function () { + originalModelInjections = _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS; + }, + teardown: function () { + _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS = originalModelInjections; + } + }); + + QUnit.test('A registered factory returns the same instance each time', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + + var postController = container.lookup('controller:post'); + + ok(postController instanceof PostController, 'The lookup is an instance of the factory'); + + equal(postController, container.lookup('controller:post')); + }); + + QUnit.test('A registered factory is returned from lookupFactory', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + + var PostControllerFactory = container.lookupFactory('controller:post'); + + ok(PostControllerFactory, 'factory is returned'); + ok(PostControllerFactory.create() instanceof PostController, 'The return of factory.create is an instance of PostController'); + }); + + QUnit.test('A registered factory is returned from lookupFactory is the same factory each time', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + + deepEqual(container.lookupFactory('controller:post'), container.lookupFactory('controller:post'), 'The return of lookupFactory is always the same'); + }); + + QUnit.test('A factory returned from lookupFactory has a debugkey', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + var PostFactory = container.lookupFactory('controller:post'); + equal(PostFactory._debugContainerKey, 'controller:post', 'factory instance receives _debugContainerKey'); + }); + + QUnit.test('fallback for to create time injections if factory has no extend', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var AppleController = _internalTestHelpers.factory(); + var PostController = _internalTestHelpers.factory(); + + PostController.extend = undefined; // remove extend + + registry.register('controller:apple', AppleController); + registry.register('controller:post', PostController); + registry.injection('controller:post', 'apple', 'controller:apple'); + + var postController = container.lookup('controller:post'); + + equal(postController._debugContainerKey, 'controller:post', 'instance receives _debugContainerKey'); + ok(postController.apple instanceof AppleController, 'instance receives an apple of instance AppleController'); + }); + + QUnit.test('The descendants of a factory returned from lookupFactory have a container and debugkey', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + var instance = undefined; + + registry.register('controller:post', PostController); + instance = container.lookupFactory('controller:post').create(); + + equal(instance._debugContainerKey, 'controller:post', 'factory instance receives _debugContainerKey'); + + ok(instance instanceof PostController, 'factory instance is instance of factory'); + }); + + QUnit.test('A registered factory returns a fresh instance if singleton: false is passed as an option', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + + var postController1 = container.lookup('controller:post'); + var postController2 = container.lookup('controller:post', { singleton: false }); + var postController3 = container.lookup('controller:post', { singleton: false }); + var postController4 = container.lookup('controller:post'); + + equal(postController1.toString(), postController4.toString(), 'Singleton factories looked up normally return the same value'); + notEqual(postController1.toString(), postController2.toString(), 'Singleton factories are not equal to factories looked up with singleton: false'); + notEqual(postController2.toString(), postController3.toString(), 'Two factories looked up with singleton: false are not equal'); + notEqual(postController3.toString(), postController4.toString(), 'A singleton factory looked up after a factory called with singleton: false is not equal'); + + ok(postController1 instanceof PostController, 'All instances are instances of the registered factory'); + ok(postController2 instanceof PostController, 'All instances are instances of the registered factory'); + ok(postController3 instanceof PostController, 'All instances are instances of the registered factory'); + ok(postController4 instanceof PostController, 'All instances are instances of the registered factory'); + }); + + QUnit.test('A factory type with a registered injection\'s instances receive that injection', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + var Store = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + registry.register('store:main', Store); + + registry.typeInjection('controller', 'store', 'store:main'); + + var postController = container.lookup('controller:post'); + var store = container.lookup('store:main'); + + equal(postController.store, store); + }); + + QUnit.test('An individual factory with a registered injection receives the injection', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + var Store = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + registry.register('store:main', Store); + + registry.injection('controller:post', 'store', 'store:main'); + + var postController = container.lookup('controller:post'); + var store = container.lookup('store:main'); + + equal(store._debugContainerKey, 'store:main'); + + equal(postController._debugContainerKey, 'controller:post'); + equal(postController.store, store, 'has the correct store injected'); + }); + + QUnit.test('A factory with both type and individual injections', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + var Store = _internalTestHelpers.factory(); + var Router = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + registry.register('store:main', Store); + registry.register('router:main', Router); + + registry.injection('controller:post', 'store', 'store:main'); + registry.typeInjection('controller', 'router', 'router:main'); + + var postController = container.lookup('controller:post'); + var store = container.lookup('store:main'); + var router = container.lookup('router:main'); + + equal(postController.store, store); + equal(postController.router, router); + }); + + QUnit.test('A factory with both type and individual factoryInjections', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + var Store = _internalTestHelpers.factory(); + var Router = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + registry.register('store:main', Store); + registry.register('router:main', Router); + + registry.factoryInjection('controller:post', 'store', 'store:main'); + registry.factoryTypeInjection('controller', 'router', 'router:main'); + + var PostControllerFactory = container.lookupFactory('controller:post'); + var store = container.lookup('store:main'); + var router = container.lookup('router:main'); + + equal(PostControllerFactory.store, store, 'PostControllerFactory has the instance of store'); + equal(PostControllerFactory.router, router, 'PostControllerFactory has the route instance'); + }); + + QUnit.test('A non-singleton instance is never cached', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostView = _internalTestHelpers.factory(); + + registry.register('view:post', PostView, { singleton: false }); + + var postView1 = container.lookup('view:post'); + var postView2 = container.lookup('view:post'); + + ok(postView1 !== postView2, 'Non-singletons are not cached'); + }); + + QUnit.test('A non-instantiated property is not instantiated', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + + var template = function () {}; + registry.register('template:foo', template, { instantiate: false }); + equal(container.lookup('template:foo'), template); + }); + + QUnit.test('A failed lookup returns undefined', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + + equal(container.lookup('doesnot:exist'), undefined); + }); + + QUnit.test('An invalid factory throws an error', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + + registry.register('controller:foo', {}); + + throws(function () { + container.lookup('controller:foo'); + }, /Failed to create an instance of \'controller:foo\'/); + }); + + QUnit.test('Injecting a failed lookup raises an error', function () { + _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS = true; + + var registry = new _containerIndex.Registry(); + var container = registry.container(); + + var fooInstance = {}; + var fooFactory = {}; + + var Foo = { + create: function (args) { + return fooInstance; + }, + extend: function (args) { + return fooFactory; + } + }; + + registry.register('model:foo', Foo); + registry.injection('model:foo', 'store', 'store:main'); + + throws(function () { + container.lookup('model:foo'); + }); + }); + + QUnit.test('Injecting a falsy value does not raise an error', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var ApplicationController = _internalTestHelpers.factory(); + + registry.register('controller:application', ApplicationController); + registry.register('user:current', null, { instantiate: false }); + registry.injection('controller:application', 'currentUser', 'user:current'); + + strictEqual(container.lookup('controller:application').currentUser, null); + }); + + QUnit.test('The container returns same value each time even if the value is falsy', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + + registry.register('falsy:value', null, { instantiate: false }); + + strictEqual(container.lookup('falsy:value'), container.lookup('falsy:value')); + }); + + QUnit.test('Destroying the container destroys any cached singletons', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + var PostView = _internalTestHelpers.factory(); + var template = function () {}; + + registry.register('controller:post', PostController); + registry.register('view:post', PostView, { singleton: false }); + registry.register('template:post', template, { instantiate: false }); + + registry.injection('controller:post', 'postView', 'view:post'); + + var postController = container.lookup('controller:post'); + var postView = postController.postView; + + ok(postView instanceof PostView, 'The non-singleton was injected'); + + container.destroy(); + + ok(postController.isDestroyed, 'Singletons are destroyed'); + ok(!postView.isDestroyed, 'Non-singletons are not destroyed'); + }); + + QUnit.test('The container can use a registry hook to resolve factories lazily', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + + registry.resolver = { + resolve: function (fullName) { + if (fullName === 'controller:post') { + return PostController; + } + } + }; + + var postController = container.lookup('controller:post'); + + ok(postController instanceof PostController, 'The correct factory was provided'); + }); + + QUnit.test('The container normalizes names before resolving', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + + registry.normalizeFullName = function (fullName) { + return 'controller:post'; + }; + + registry.register('controller:post', PostController); + var postController = container.lookup('controller:normalized'); + + ok(postController instanceof PostController, 'Normalizes the name before resolving'); + }); + + QUnit.test('The container normalizes names when looking factory up', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + + registry.normalizeFullName = function (fullName) { + return 'controller:post'; + }; + + registry.register('controller:post', PostController); + var fact = container.lookupFactory('controller:normalized'); + + equal(fact.toString() === PostController.extend().toString(), true, 'Normalizes the name when looking factory up'); + }); + + QUnit.test('Options can be registered that should be applied to a given factory', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostView = _internalTestHelpers.factory(); + + registry.resolver = { + resolve: function (fullName) { + if (fullName === 'view:post') { + return PostView; + } + } + }; + + registry.options('view:post', { instantiate: true, singleton: false }); + + var postView1 = container.lookup('view:post'); + var postView2 = container.lookup('view:post'); + + ok(postView1 instanceof PostView, 'The correct factory was provided'); + ok(postView2 instanceof PostView, 'The correct factory was provided'); + + ok(postView1 !== postView2, 'The two lookups are different'); + }); + + QUnit.test('Options can be registered that should be applied to all factories for a given type', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostView = _internalTestHelpers.factory(); + + registry.resolver = { + resolve: function (fullName) { + if (fullName === 'view:post') { + return PostView; + } + } + }; + + registry.optionsForType('view', { singleton: false }); + + var postView1 = container.lookup('view:post'); + var postView2 = container.lookup('view:post'); + + ok(postView1 instanceof PostView, 'The correct factory was provided'); + ok(postView2 instanceof PostView, 'The correct factory was provided'); + + ok(postView1 !== postView2, 'The two lookups are different'); + }); + + QUnit.test('An injected non-singleton instance is never cached', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostView = _internalTestHelpers.factory(); + var PostViewHelper = _internalTestHelpers.factory(); + + registry.register('view:post', PostView, { singleton: false }); + registry.register('view_helper:post', PostViewHelper, { singleton: false }); + registry.injection('view:post', 'viewHelper', 'view_helper:post'); + + var postView1 = container.lookup('view:post'); + var postView2 = container.lookup('view:post'); + + ok(postView1.viewHelper !== postView2.viewHelper, 'Injected non-singletons are not cached'); + }); + + QUnit.test('Factory resolves are cached', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + var resolveWasCalled = []; + registry.resolve = function (fullName) { + resolveWasCalled.push(fullName); + return PostController; + }; + + deepEqual(resolveWasCalled, []); + container.lookupFactory('controller:post'); + deepEqual(resolveWasCalled, ['controller:post']); + + container.lookupFactory('controller:post'); + deepEqual(resolveWasCalled, ['controller:post']); + }); + + QUnit.test('factory for non extendables (MODEL) resolves are cached', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + var resolveWasCalled = []; + registry.resolve = function (fullName) { + resolveWasCalled.push(fullName); + return PostController; + }; + + deepEqual(resolveWasCalled, []); + container.lookupFactory('model:post'); + deepEqual(resolveWasCalled, ['model:post']); + + container.lookupFactory('model:post'); + deepEqual(resolveWasCalled, ['model:post']); + }); + + QUnit.test('factory for non extendables resolves are cached', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = {}; + var resolveWasCalled = []; + + registry.resolve = function (fullName) { + resolveWasCalled.push(fullName); + return PostController; + }; + + deepEqual(resolveWasCalled, []); + container.lookupFactory('foo:post'); + deepEqual(resolveWasCalled, ['foo:post']); + + container.lookupFactory('foo:post'); + deepEqual(resolveWasCalled, ['foo:post']); + }); + + QUnit.test('The `_onLookup` hook is called on factories when looked up the first time', function () { + expect(2); + + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var Apple = _internalTestHelpers.factory(); + + Apple.reopenClass({ + _onLookup: function (fullName) { + equal(fullName, 'apple:main', 'calls lazy injection method with the lookup full name'); + equal(this, Apple, 'calls lazy injection method in the factory context'); + } + }); + + registry.register('apple:main', Apple); + + container.lookupFactory('apple:main'); + container.lookupFactory('apple:main'); + }); + + QUnit.test('A factory\'s lazy injections are validated when first instantiated', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var Apple = _internalTestHelpers.factory(); + var Orange = _internalTestHelpers.factory(); + + Apple.reopenClass({ + _lazyInjections: function () { + return ['orange:main', 'banana:main']; + } + }); + + registry.register('apple:main', Apple); + registry.register('orange:main', Orange); + + throws(function () { + container.lookup('apple:main'); + }, /Attempting to inject an unknown injection: 'banana:main'/); + }); + + QUnit.test('Lazy injection validations are cached', function () { + expect(1); + + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var Apple = _internalTestHelpers.factory(); + var Orange = _internalTestHelpers.factory(); + + Apple.reopenClass({ + _lazyInjections: function () { + ok(true, 'should call lazy injection method'); + return ['orange:main']; + } + }); + + registry.register('apple:main', Apple); + registry.register('orange:main', Orange); + + container.lookup('apple:main'); + container.lookup('apple:main'); + }); + + QUnit.test('An object with its owner pre-set should be returned from ownerInjection', function () { + var owner = {}; + var registry = new _containerIndex.Registry(); + var container = registry.container({ owner: owner }); + + var result = container.ownerInjection(); + + equal(result[_emberUtils.OWNER], owner, 'owner is properly included'); + }); + + QUnit.test('A deprecated `container` property is appended to every object instantiated from an extendable factory', function () { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + registry.register('controller:post', PostController); + var postController = container.lookup('controller:post'); + + expectDeprecation(function () { + _emberMetal.get(postController, 'container'); + }, 'Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.'); + + expectDeprecation(function () { + var c = postController.container; + strictEqual(c, container); + }, 'Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.'); + }); + + QUnit.test('A deprecated `container` property is appended to every object instantiated from a non-extendable factory, and a fake container is available during instantiation.', function () { + expect(8); + + var owner = {}; + var registry = new _containerIndex.Registry(); + var container = registry.container({ owner: owner }); + + // Define a simple non-extendable factory + function PostController(options) { + this.container = options.container; + } + + PostController.create = function (options) { + ok(options.container, 'fake container has been injected and is available during `create`.'); + + expectDeprecation(function () { + options.container.lookup('abc:one'); + }, 'Using the injected `container` is deprecated. Please use the `getOwner` helper to access the owner of this object and then call `lookup` instead.'); + + expectDeprecation(function () { + options.container.lookupFactory('abc:two'); + }, 'Using the injected `container` is deprecated. Please use the `getOwner` helper to access the owner of this object and then call `_lookupFactory` instead.'); + + // non-deprecated usage of `lookup` and `_lookupFactory` + owner.lookup = function (fullName) { + equal(fullName, 'abc:one', 'lookup on owner called properly'); + }; + owner._lookupFactory = function (fullName) { + equal(fullName, 'abc:two', '_lookupFactory on owner called properly'); + }; + var foundOwner = _emberUtils.getOwner(options); + foundOwner.lookup('abc:one'); + foundOwner._lookupFactory('abc:two'); + + return new PostController(options); + }; + + registry.register('controller:post', PostController); + var postController = container.lookup('controller:post'); + + expectDeprecation(function () { + _emberMetal.get(postController, 'container'); + }, 'Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.'); + + expectDeprecation(function () { + var c = postController.container; + strictEqual(c, container, 'Injected container is now regular (not fake) container, but access is still deprecated.'); + }, 'Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.'); + }); + + QUnit.test('A deprecated `container` property is only set on a non-extendable factory instance if `container` is present and writable.', function () { + expect(2); + + var owner = {}; + var registry = new _containerIndex.Registry(); + var container = registry.container({ owner: owner }); + + // Define a non-extendable factory that is frozen after `create` + var PostController = function () {}; + PostController.create = function () { + var instance = new PostController(); + + Object.seal(instance); + + return instance; + }; + + registry.register('controller:post', PostController); + var postController = container.lookup('controller:post'); + + equal(postController.container, undefined, 'container was not added'); + + var OtherController = function () { + this.container = 'foo'; + }; + + OtherController.create = function () { + var instance = new OtherController(); + + Object.freeze(instance); + + return instance; + }; + + registry.register('controller:other', OtherController); + var otherController = container.lookup('controller:other'); + + equal(otherController.container, 'foo', 'container was not added'); + }); + + QUnit.test('An extendable factory can provide `container` upon create, with a deprecation', function (assert) { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + + registry.register('controller:post', _internalTestHelpers.factory()); + + var PostController = container.lookupFactory('controller:post'); + + var postController = undefined; + + expectDeprecation(function () { + postController = PostController.create({ + container: 'foo' + }); + }, /Providing the \`container\` property to .+ is deprecated. Please use \`Ember.setOwner\` or \`owner.ownerInjection\(\)\` instead to provide an owner to the instance being created/); + + expectDeprecation(function () { + var c = postController.container; + assert.equal(c, 'foo', 'the `container` provided to `.create`was used'); + }, 'Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.'); + }); + + QUnit.test('lookupFactory passes options through to expandlocallookup', function (assert) { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + + registry.expandLocalLookup = function (fullName, options) { + assert.ok(true, 'expandLocalLookup was called'); + assert.equal(fullName, 'foo:bar'); + assert.deepEqual(options, { source: 'baz:qux' }); + + return 'controller:post'; + }; + + var PostControllerFactory = container.lookupFactory('foo:bar', { source: 'baz:qux' }); + + assert.ok(PostControllerFactory.create() instanceof PostController, 'The return of factory.create is an instance of PostController'); + }); + + QUnit.test('lookup passes options through to expandlocallookup', function (assert) { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + var PostController = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + + registry.expandLocalLookup = function (fullName, options) { + assert.ok(true, 'expandLocalLookup was called'); + assert.equal(fullName, 'foo:bar'); + assert.deepEqual(options, { source: 'baz:qux' }); + + return 'controller:post'; + }; + + var PostControllerLookupResult = container.lookup('foo:bar', { source: 'baz:qux' }); + + assert.ok(PostControllerLookupResult instanceof PostController); + }); +}); +enifed('container/tests/container_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - container/tests'); + test('container/tests/container_test.js should pass jscs', function () { + ok(true, 'container/tests/container_test.js should pass jscs.'); + }); +}); +enifed('container/tests/container_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - container/tests'); + QUnit.test('container/tests/container_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'container/tests/container_test.js should pass jshint.'); + }); +}); +enifed('container/tests/owner_test', ['exports', 'ember-utils'], function (exports, _emberUtils) { + 'use strict'; + + QUnit.module('Owner', {}); + + QUnit.test('An owner can be set with `setOwner` and retrieved with `getOwner`', function () { + var owner = {}; + var obj = {}; + + strictEqual(_emberUtils.getOwner(obj), undefined, 'owner has not been set'); + + _emberUtils.setOwner(obj, owner); + + strictEqual(_emberUtils.getOwner(obj), owner, 'owner has been set'); + + strictEqual(obj[_emberUtils.OWNER], owner, 'owner has been set to the OWNER symbol'); + }); +}); +enifed('container/tests/owner_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - container/tests'); + test('container/tests/owner_test.js should pass jscs', function () { + ok(true, 'container/tests/owner_test.js should pass jscs.'); + }); +}); +enifed('container/tests/owner_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - container/tests'); + QUnit.test('container/tests/owner_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'container/tests/owner_test.js should pass jshint.'); + }); +}); +enifed('container/tests/registry_test', ['exports', 'container/index', 'internal-test-helpers'], function (exports, _containerIndex, _internalTestHelpers) { + 'use strict'; + + QUnit.module('Registry'); + + QUnit.test('A registered factory is returned from resolve', function () { + var registry = new _containerIndex.Registry(); + var PostController = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + + var PostControllerFactory = registry.resolve('controller:post'); + + ok(PostControllerFactory, 'factory is returned'); + ok(PostControllerFactory.create() instanceof PostController, 'The return of factory.create is an instance of PostController'); + }); + + QUnit.test('The registered factory returned from resolve is the same factory each time', function () { + var registry = new _containerIndex.Registry(); + var PostController = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + + deepEqual(registry.resolve('controller:post'), registry.resolve('controller:post'), 'The return of resolve is always the same'); + }); + + QUnit.test('The registered value returned from resolve is the same value each time even if the value is falsy', function () { + var registry = new _containerIndex.Registry(); + + registry.register('falsy:value', null, { instantiate: false }); + + strictEqual(registry.resolve('falsy:value'), registry.resolve('falsy:value'), 'The return of resolve is always the same'); + }); + + QUnit.test('The value returned from resolver is the same value as the original value even if the value is falsy', function () { + var resolver = { + resolve: function (fullName) { + if (fullName === 'falsy:value') { + return null; + } + } + }; + var registry = new _containerIndex.Registry({ resolver: resolver }); + + strictEqual(registry.resolve('falsy:value'), null); + }); + + QUnit.test('A registered factory returns true for `has` if an item is registered', function () { + var registry = new _containerIndex.Registry(); + var PostController = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + + equal(registry.has('controller:post'), true, 'The `has` method returned true for registered factories'); + equal(registry.has('controller:posts'), false, 'The `has` method returned false for unregistered factories'); + }); + + QUnit.test('Throw exception when trying to inject `type:thing` on all type(s)', function () { + var registry = new _containerIndex.Registry(); + var PostController = _internalTestHelpers.factory(); + + registry.register('controller:post', PostController); + + throws(function () { + registry.typeInjection('controller', 'injected', 'controller:post'); + }, /Cannot inject a 'controller:post' on other controller\(s\)\./); + }); + + QUnit.test('The registry can take a hook to resolve factories lazily', function () { + var PostController = _internalTestHelpers.factory(); + var resolver = { + resolve: function (fullName) { + if (fullName === 'controller:post') { + return PostController; + } + } + }; + var registry = new _containerIndex.Registry({ resolver: resolver }); + + strictEqual(registry.resolve('controller:post'), PostController, 'The correct factory was provided'); + }); + + QUnit.test('The registry respects the resolver hook for `has`', function () { + var PostController = _internalTestHelpers.factory(); + var resolver = { + resolve: function (fullName) { + if (fullName === 'controller:post') { + return PostController; + } + } + }; + var registry = new _containerIndex.Registry({ resolver: resolver }); + + ok(registry.has('controller:post'), 'the `has` method uses the resolver hook'); + }); + + QUnit.test('The registry normalizes names when resolving', function () { + var registry = new _containerIndex.Registry(); + var PostController = _internalTestHelpers.factory(); + + registry.normalizeFullName = function (fullName) { + return 'controller:post'; + }; + + registry.register('controller:post', PostController); + var type = registry.resolve('controller:normalized'); + + strictEqual(type, PostController, 'Normalizes the name when resolving'); + }); + + QUnit.test('The registry normalizes names when checking if the factory is registered', function () { + var registry = new _containerIndex.Registry(); + var PostController = _internalTestHelpers.factory(); + + registry.normalizeFullName = function (fullName) { + return fullName === 'controller:normalized' ? 'controller:post' : fullName; + }; + + registry.register('controller:post', PostController); + var isPresent = registry.has('controller:normalized'); + + equal(isPresent, true, 'Normalizes the name when checking if the factory or instance is present'); + }); + + QUnit.test('validateFullName throws an error if name is incorrect', function () { + expect(2); + + var registry = new _containerIndex.Registry(); + var PostController = _internalTestHelpers.factory(); + + registry.normalize = function (fullName) { + return 'controller:post'; + }; + + registry.register('controller:post', PostController); + throws(function () { + registry.validateFullName('post'); + }, /TypeError: Invalid Fullname, expected: 'type:name' got: post/); + + throws(function () { + registry.validateFullName('route:http://foo.bar.com/baz'); + }, /TypeError: Invalid Fullname, expected: 'type:name' got: route:http:\/\/foo.bar.com\/baz/); + }); + + QUnit.test('The registry normalizes names when injecting', function () { + var registry = new _containerIndex.Registry(); + var PostController = _internalTestHelpers.factory(); + var user = { name: 'Stef' }; + + registry.normalize = function (fullName) { + return 'controller:post'; + }; + + registry.register('controller:post', PostController); + registry.register('user:post', user, { instantiate: false }); + registry.injection('controller:post', 'user', 'controller:normalized'); + + deepEqual(registry.resolve('controller:post'), user, 'Normalizes the name when injecting'); + }); + + QUnit.test('cannot register an `undefined` factory', function () { + var registry = new _containerIndex.Registry(); + + throws(function () { + registry.register('controller:apple', undefined); + }, ''); + }); + + QUnit.test('can re-register a factory', function () { + var registry = new _containerIndex.Registry(); + var FirstApple = _internalTestHelpers.factory('first'); + var SecondApple = _internalTestHelpers.factory('second'); + + registry.register('controller:apple', FirstApple); + registry.register('controller:apple', SecondApple); + + ok(registry.resolve('controller:apple').create() instanceof SecondApple); + }); + + QUnit.test('cannot re-register a factory if it has been resolved', function () { + var registry = new _containerIndex.Registry(); + var FirstApple = _internalTestHelpers.factory('first'); + var SecondApple = _internalTestHelpers.factory('second'); + + registry.register('controller:apple', FirstApple); + strictEqual(registry.resolve('controller:apple'), FirstApple); + + throws(function () { + registry.register('controller:apple', SecondApple); + }, /Cannot re-register: 'controller:apple', as it has already been resolved\./); + + strictEqual(registry.resolve('controller:apple'), FirstApple); + }); + + QUnit.test('registry.has should not accidentally cause injections on that factory to be run. (Mitigate merely on observing)', function () { + expect(1); + + var registry = new _containerIndex.Registry(); + var FirstApple = _internalTestHelpers.factory('first'); + var SecondApple = _internalTestHelpers.factory('second'); + + SecondApple.extend = function (a, b, c) { + ok(false, 'should not extend or touch the injected model, merely to inspect existence of another'); + }; + + registry.register('controller:apple', FirstApple); + registry.register('controller:second-apple', SecondApple); + registry.injection('controller:apple', 'badApple', 'controller:second-apple'); + + ok(registry.has('controller:apple')); + }); + + QUnit.test('registry.has should not error for invalid fullNames)', function () { + expect(1); + + var registry = new _containerIndex.Registry(); + + ok(!registry.has('foo:bar:baz')); + }); + + QUnit.test('once resolved, always return the same result', function () { + expect(1); + + var registry = new _containerIndex.Registry(); + + registry.resolver = { + resolve: function () { + return 'bar'; + } + }; + + var Bar = registry.resolve('models:bar'); + + registry.resolver = { + resolve: function () { + return 'not bar'; + } + }; + + equal(registry.resolve('models:bar'), Bar); + }); + + QUnit.test('factory resolves are cached', function () { + var registry = new _containerIndex.Registry(); + var PostController = _internalTestHelpers.factory(); + var resolveWasCalled = []; + + registry.resolver = { + resolve: function (fullName) { + resolveWasCalled.push(fullName); + return PostController; + } + }; + + deepEqual(resolveWasCalled, []); + registry.resolve('controller:post'); + deepEqual(resolveWasCalled, ['controller:post']); + + registry.resolve('controller:post'); + deepEqual(resolveWasCalled, ['controller:post']); + }); + + QUnit.test('factory for non extendables (MODEL) resolves are cached', function () { + var registry = new _containerIndex.Registry(); + var PostController = _internalTestHelpers.factory(); + var resolveWasCalled = []; + + registry.resolver = { + resolve: function (fullName) { + resolveWasCalled.push(fullName); + return PostController; + } + }; + + deepEqual(resolveWasCalled, []); + registry.resolve('model:post'); + deepEqual(resolveWasCalled, ['model:post']); + + registry.resolve('model:post'); + deepEqual(resolveWasCalled, ['model:post']); + }); + + QUnit.test('factory for non extendables resolves are cached', function () { + var registry = new _containerIndex.Registry(); + var PostController = {}; + var resolveWasCalled = []; + + registry.resolver = { + resolve: function (fullName) { + resolveWasCalled.push(fullName); + return PostController; + } + }; + + deepEqual(resolveWasCalled, []); + registry.resolve('foo:post'); + deepEqual(resolveWasCalled, ['foo:post']); + + registry.resolve('foo:post'); + deepEqual(resolveWasCalled, ['foo:post']); + }); + + QUnit.test('registry.container creates a container', function () { + var registry = new _containerIndex.Registry(); + var PostController = _internalTestHelpers.factory(); + registry.register('controller:post', PostController); + + var container = registry.container(); + var postController = container.lookup('controller:post'); + + ok(postController instanceof PostController, 'The lookup is an instance of the registered factory'); + }); + + QUnit.test('`describe` will be handled by the resolver, then by the fallback registry, if available', function () { + var fallback = { + describe: function (fullName) { + return fullName + '-fallback'; + } + }; + + var resolver = { + lookupDescription: function (fullName) { + return fullName + '-resolver'; + } + }; + + var registry = new _containerIndex.Registry({ fallback: fallback, resolver: resolver }); + + equal(registry.describe('controller:post'), 'controller:post-resolver', '`describe` handled by the resolver first.'); + + registry.resolver = null; + + equal(registry.describe('controller:post'), 'controller:post-fallback', '`describe` handled by fallback registry next.'); + + registry.fallback = null; + + equal(registry.describe('controller:post'), 'controller:post', '`describe` by default returns argument.'); + }); + + QUnit.test('`normalizeFullName` will be handled by the resolver, then by the fallback registry, if available', function () { + var fallback = { + normalizeFullName: function (fullName) { + return fullName + '-fallback'; + } + }; + + var resolver = { + normalize: function (fullName) { + return fullName + '-resolver'; + } + }; + + var registry = new _containerIndex.Registry({ fallback: fallback, resolver: resolver }); + + equal(registry.normalizeFullName('controller:post'), 'controller:post-resolver', '`normalizeFullName` handled by the resolver first.'); + + registry.resolver = null; + + equal(registry.normalizeFullName('controller:post'), 'controller:post-fallback', '`normalizeFullName` handled by fallback registry next.'); + + registry.fallback = null; + + equal(registry.normalizeFullName('controller:post'), 'controller:post', '`normalizeFullName` by default returns argument.'); + }); + + QUnit.test('`makeToString` will be handled by the resolver, then by the fallback registry, if available', function () { + var fallback = { + makeToString: function (fullName) { + return fullName + '-fallback'; + } + }; + + var resolver = { + makeToString: function (fullName) { + return fullName + '-resolver'; + } + }; + + var registry = new _containerIndex.Registry({ fallback: fallback, resolver: resolver }); + + equal(registry.makeToString('controller:post'), 'controller:post-resolver', '`makeToString` handled by the resolver first.'); + + registry.resolver = null; + + equal(registry.makeToString('controller:post'), 'controller:post-fallback', '`makeToString` handled by fallback registry next.'); + + registry.fallback = null; + + equal(registry.makeToString('controller:post'), 'controller:post', '`makeToString` by default returns argument.'); + }); + + QUnit.test('`resolve` can be handled by a fallback registry', function () { + var fallback = new _containerIndex.Registry(); + + var registry = new _containerIndex.Registry({ fallback: fallback }); + var PostController = _internalTestHelpers.factory(); + + fallback.register('controller:post', PostController); + + var PostControllerFactory = registry.resolve('controller:post'); + + ok(PostControllerFactory, 'factory is returned'); + ok(PostControllerFactory.create() instanceof PostController, 'The return of factory.create is an instance of PostController'); + }); + + QUnit.test('`has` can be handled by a fallback registry', function () { + var fallback = new _containerIndex.Registry(); + + var registry = new _containerIndex.Registry({ fallback: fallback }); + var PostController = _internalTestHelpers.factory(); + + fallback.register('controller:post', PostController); + + equal(registry.has('controller:post'), true, 'Fallback registry is checked for registration'); + }); + + QUnit.test('`getInjections` includes injections from a fallback registry', function () { + var fallback = new _containerIndex.Registry(); + var registry = new _containerIndex.Registry({ fallback: fallback }); + + equal(registry.getInjections('model:user').length, 0, 'No injections in the primary registry'); + + fallback.injection('model:user', 'post', 'model:post'); + + equal(registry.getInjections('model:user').length, 1, 'Injections from the fallback registry are merged'); + }); + + QUnit.test('`getTypeInjections` includes type injections from a fallback registry', function () { + var fallback = new _containerIndex.Registry(); + var registry = new _containerIndex.Registry({ fallback: fallback }); + + equal(registry.getTypeInjections('model').length, 0, 'No injections in the primary registry'); + + fallback.injection('model', 'source', 'source:main'); + + equal(registry.getTypeInjections('model').length, 1, 'Injections from the fallback registry are merged'); + }); + + QUnit.test('`getFactoryInjections` includes factory injections from a fallback registry', function () { + var fallback = new _containerIndex.Registry(); + var registry = new _containerIndex.Registry({ fallback: fallback }); + + equal(registry.getFactoryInjections('model:user').length, 0, 'No factory injections in the primary registry'); + + fallback.factoryInjection('model:user', 'store', 'store:main'); + + equal(registry.getFactoryInjections('model:user').length, 1, 'Factory injections from the fallback registry are merged'); + }); + + QUnit.test('`getFactoryTypeInjections` includes factory type injections from a fallback registry', function () { + var fallback = new _containerIndex.Registry(); + var registry = new _containerIndex.Registry({ fallback: fallback }); + + equal(registry.getFactoryTypeInjections('model').length, 0, 'No factory type injections in the primary registry'); + + fallback.factoryInjection('model', 'store', 'store:main'); + + equal(registry.getFactoryTypeInjections('model').length, 1, 'Factory type injections from the fallback registry are merged'); + }); + + QUnit.test('`knownForType` contains keys for each item of a given type', function () { + var registry = new _containerIndex.Registry(); + + registry.register('foo:bar-baz', 'baz'); + registry.register('foo:qux-fez', 'fez'); + + var found = registry.knownForType('foo'); + + deepEqual(found, { + 'foo:bar-baz': true, + 'foo:qux-fez': true + }); + }); + + QUnit.test('`knownForType` includes fallback registry results', function () { + var fallback = new _containerIndex.Registry(); + var registry = new _containerIndex.Registry({ fallback: fallback }); + + registry.register('foo:bar-baz', 'baz'); + registry.register('foo:qux-fez', 'fez'); + fallback.register('foo:zurp-zorp', 'zorp'); + + var found = registry.knownForType('foo'); + + deepEqual(found, { + 'foo:bar-baz': true, + 'foo:qux-fez': true, + 'foo:zurp-zorp': true + }); + }); + + QUnit.test('`knownForType` is called on the resolver if present', function () { + expect(3); + + var resolver = { + knownForType: function (type) { + ok(true, 'knownForType called on the resolver'); + equal(type, 'foo', 'the type was passed through'); + + return { 'foo:yorp': true }; + } + }; + + var registry = new _containerIndex.Registry({ + resolver: resolver + }); + registry.register('foo:bar-baz', 'baz'); + + var found = registry.knownForType('foo'); + + deepEqual(found, { + 'foo:yorp': true, + 'foo:bar-baz': true + }); + }); + + QUnit.test('A registry can be created with a deprecated `resolver` function instead of an object', function () { + expect(2); + + var registry = undefined; + + expectDeprecation(function () { + registry = new _containerIndex.Registry({ + resolver: function (fullName) { + return fullName + '-resolved'; + } + }); + }, 'Passing a `resolver` function into a Registry is deprecated. Please pass in a Resolver object with a `resolve` method.'); + + equal(registry.resolve('foo:bar'), 'foo:bar-resolved', '`resolve` still calls the deprecated function'); + }); + + QUnit.test('resolver.expandLocalLookup is not required', function (assert) { + assert.expect(1); + + var registry = new _containerIndex.Registry({ + resolver: {} + }); + + var result = registry.expandLocalLookup('foo:bar', { + source: 'baz:qux' + }); + + assert.equal(result, null); + }); + + QUnit.test('expandLocalLookup is called on the resolver if present', function (assert) { + assert.expect(4); + + var resolver = { + expandLocalLookup: function (targetFullName, sourceFullName) { + assert.ok(true, 'expandLocalLookup is called on the resolver'); + assert.equal(targetFullName, 'foo:bar', 'the targetFullName was passed through'); + assert.equal(sourceFullName, 'baz:qux', 'the sourceFullName was passed through'); + + return 'foo:qux/bar'; + } + }; + + var registry = new _containerIndex.Registry({ + resolver: resolver + }); + + var result = registry.expandLocalLookup('foo:bar', { + source: 'baz:qux' + }); + + assert.equal(result, 'foo:qux/bar'); + }); + + QUnit.test('`expandLocalLookup` is handled by the resolver, then by the fallback registry, if available', function (assert) { + assert.expect(9); + + var fallbackResolver = { + expandLocalLookup: function (targetFullName, sourceFullName) { + assert.ok(true, 'expandLocalLookup is called on the fallback resolver'); + assert.equal(targetFullName, 'foo:bar', 'the targetFullName was passed through'); + assert.equal(sourceFullName, 'baz:qux', 'the sourceFullName was passed through'); + + return 'foo:qux/bar-fallback'; + } + }; + + var resolver = { + expandLocalLookup: function (targetFullName, sourceFullName) { + assert.ok(true, 'expandLocalLookup is called on the resolver'); + assert.equal(targetFullName, 'foo:bar', 'the targetFullName was passed through'); + assert.equal(sourceFullName, 'baz:qux', 'the sourceFullName was passed through'); + + return 'foo:qux/bar-resolver'; + } + }; + + var fallbackRegistry = new _containerIndex.Registry({ + resolver: fallbackResolver + }); + + var registry = new _containerIndex.Registry({ + fallback: fallbackRegistry, + resolver: resolver + }); + + var result = registry.expandLocalLookup('foo:bar', { + source: 'baz:qux' + }); + + assert.equal(result, 'foo:qux/bar-resolver', 'handled by the resolver'); + + registry.resolver = null; + + result = registry.expandLocalLookup('foo:bar', { + source: 'baz:qux' + }); + + assert.equal(result, 'foo:qux/bar-fallback', 'handled by the fallback registry'); + + registry.fallback = null; + + result = registry.expandLocalLookup('foo:bar', { + source: 'baz:qux' + }); + + assert.equal(result, null, 'null is returned by default when no resolver or fallback registry is present'); + }); + + QUnit.test('resolver.expandLocalLookup result is cached', function (assert) { + assert.expect(3); + var result = undefined; + + var resolver = { + expandLocalLookup: function (targetFullName, sourceFullName) { + assert.ok(true, 'expandLocalLookup is called on the resolver'); + + return 'foo:qux/bar'; + } + }; + + var registry = new _containerIndex.Registry({ + resolver: resolver + }); + + result = registry.expandLocalLookup('foo:bar', { + source: 'baz:qux' + }); + + assert.equal(result, 'foo:qux/bar'); + + result = registry.expandLocalLookup('foo:bar', { + source: 'baz:qux' + }); + + assert.equal(result, 'foo:qux/bar'); + }); + + QUnit.test('resolver.expandLocalLookup cache is busted when any unregister is called', function (assert) { + assert.expect(4); + var result = undefined; + + var resolver = { + expandLocalLookup: function (targetFullName, sourceFullName) { + assert.ok(true, 'expandLocalLookup is called on the resolver'); + + return 'foo:qux/bar'; + } + }; + + var registry = new _containerIndex.Registry({ + resolver: resolver + }); + + result = registry.expandLocalLookup('foo:bar', { + source: 'baz:qux' + }); + + assert.equal(result, 'foo:qux/bar'); + + registry.unregister('foo:bar'); + + result = registry.expandLocalLookup('foo:bar', { + source: 'baz:qux' + }); + + assert.equal(result, 'foo:qux/bar'); + }); + + QUnit.test('resolve calls expandLocallookup when it receives options.source', function (assert) { + assert.expect(3); + + var resolver = { + resolve: function () {}, + expandLocalLookup: function (targetFullName, sourceFullName) { + assert.ok(true, 'expandLocalLookup is called on the resolver'); + assert.equal(targetFullName, 'foo:bar', 'the targetFullName was passed through'); + assert.equal(sourceFullName, 'baz:qux', 'the sourceFullName was passed through'); + + return 'foo:qux/bar'; + } + }; + + var registry = new _containerIndex.Registry({ + resolver: resolver + }); + + registry.resolve('foo:bar', { + source: 'baz:qux' + }); + }); + + QUnit.test('has uses expandLocalLookup', function (assert) { + assert.expect(5); + var resolvedFullNames = []; + var result = undefined; + + var resolver = { + resolve: function (name) { + resolvedFullNames.push(name); + + return 'yippie!'; + }, + + expandLocalLookup: function (targetFullName, sourceFullName) { + assert.ok(true, 'expandLocalLookup is called on the resolver'); + + if (targetFullName === 'foo:bar') { + return 'foo:qux/bar'; + } else { + return null; + } + } + }; + + var registry = new _containerIndex.Registry({ + resolver: resolver + }); + + result = registry.has('foo:bar', { + source: 'baz:qux' + }); + + assert.ok(result, 'found foo:bar/qux'); + + result = registry.has('foo:baz', { + source: 'baz:qux' + }); + + assert.ok(!result, 'foo:baz/qux not found'); + + assert.deepEqual(['foo:qux/bar'], resolvedFullNames); + }); +}); +enifed('container/tests/registry_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - container/tests'); + test('container/tests/registry_test.js should pass jscs', function () { + ok(true, 'container/tests/registry_test.js should pass jscs.'); + }); +}); +enifed('container/tests/registry_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - container/tests'); + QUnit.test('container/tests/registry_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'container/tests/registry_test.js should pass jshint.'); + }); +}); +enifed('ember-application/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application'); + test('ember-application/index.js should pass jscs', function () { + ok(true, 'ember-application/index.js should pass jscs.'); + }); +}); +enifed('ember-application/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application'); + QUnit.test('ember-application/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/index.js should pass jshint.'); + }); +}); +enifed('ember-application/initializers/dom-templates.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/initializers'); + test('ember-application/initializers/dom-templates.js should pass jscs', function () { + ok(true, 'ember-application/initializers/dom-templates.js should pass jscs.'); + }); +}); +enifed('ember-application/initializers/dom-templates.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/initializers'); + QUnit.test('ember-application/initializers/dom-templates.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/initializers/dom-templates.js should pass jshint.'); + }); +}); +enifed('ember-application/system/application-instance.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/system'); + test('ember-application/system/application-instance.js should pass jscs', function () { + ok(true, 'ember-application/system/application-instance.js should pass jscs.'); + }); +}); +enifed('ember-application/system/application-instance.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/system'); + QUnit.test('ember-application/system/application-instance.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/system/application-instance.js should pass jshint.'); + }); +}); +enifed('ember-application/system/application.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/system'); + test('ember-application/system/application.js should pass jscs', function () { + ok(true, 'ember-application/system/application.js should pass jscs.'); + }); +}); +enifed('ember-application/system/application.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/system'); + QUnit.test('ember-application/system/application.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/system/application.js should pass jshint.'); + }); +}); +enifed('ember-application/system/engine-instance.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/system'); + test('ember-application/system/engine-instance.js should pass jscs', function () { + ok(true, 'ember-application/system/engine-instance.js should pass jscs.'); + }); +}); +enifed('ember-application/system/engine-instance.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/system'); + QUnit.test('ember-application/system/engine-instance.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/system/engine-instance.js should pass jshint.'); + }); +}); +enifed('ember-application/system/engine-parent.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/system'); + test('ember-application/system/engine-parent.js should pass jscs', function () { + ok(true, 'ember-application/system/engine-parent.js should pass jscs.'); + }); +}); +enifed('ember-application/system/engine-parent.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/system'); + QUnit.test('ember-application/system/engine-parent.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/system/engine-parent.js should pass jshint.'); + }); +}); +enifed('ember-application/system/engine.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/system'); + test('ember-application/system/engine.js should pass jscs', function () { + ok(true, 'ember-application/system/engine.js should pass jscs.'); + }); +}); +enifed('ember-application/system/engine.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/system'); + QUnit.test('ember-application/system/engine.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/system/engine.js should pass jshint.'); + }); +}); +enifed('ember-application/system/resolver.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/system'); + test('ember-application/system/resolver.js should pass jscs', function () { + ok(true, 'ember-application/system/resolver.js should pass jscs.'); + }); +}); +enifed('ember-application/system/resolver.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/system'); + QUnit.test('ember-application/system/resolver.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/system/resolver.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/application_instance_test', ['exports', 'ember-application/system/engine', 'ember-application/system/application', 'ember-application/system/application-instance', 'ember-metal', 'ember-views', 'container', 'internal-test-helpers', 'ember-runtime'], function (exports, _emberApplicationSystemEngine, _emberApplicationSystemApplication, _emberApplicationSystemApplicationInstance, _emberMetal, _emberViews, _container, _internalTestHelpers, _emberRuntime) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); + + var application = undefined, + appInstance = undefined; + + QUnit.module('Ember.ApplicationInstance', { + setup: function () { + _emberViews.jQuery('#qunit-fixture').html('
    HI
    HI
    '); + application = _emberMetal.run(function () { + return _emberApplicationSystemApplication.default.create({ rootElement: '#one', router: null }); + }); + }, + + teardown: function () { + _emberViews.jQuery('#qunit-fixture').empty(); + + if (appInstance) { + _emberMetal.run(appInstance, 'destroy'); + } + + if (application) { + _emberMetal.run(application, 'destroy'); + } + } + }); + + QUnit.test('an application instance can be created based upon an application', function () { + appInstance = _emberMetal.run(function () { + return appInstance = _emberApplicationSystemApplicationInstance.default.create({ application: application }); + }); + + ok(appInstance, 'instance should be created'); + equal(appInstance.application, application, 'application should be set to parent'); + }); + + QUnit.test('properties (and aliases) are correctly assigned for accessing the container and registry', function () { + expect(9); + + appInstance = _emberMetal.run(function () { + return _emberApplicationSystemApplicationInstance.default.create({ application: application }); + }); + + ok(appInstance, 'instance should be created'); + ok(appInstance.__container__, '#__container__ is accessible'); + ok(appInstance.__registry__, '#__registry__ is accessible'); + + ok(typeof appInstance.container.lookup === 'function', '#container.lookup is available as a function'); + + // stub with a no-op to keep deprecation test simple + appInstance.__container__.lookup = function () { + ok(true, '#loookup alias is called correctly'); + }; + + expectDeprecation(function () { + appInstance.container.lookup(); + }, /Using `ApplicationInstance.container.lookup` is deprecated. Please use `ApplicationInstance.lookup` instead./); + + ok(typeof appInstance.registry.register === 'function', '#registry.register is available as a function'); + appInstance.__registry__.register = function () { + ok(true, '#register alias is called correctly'); + }; + + expectDeprecation(function () { + appInstance.registry.register(); + }, /Using `ApplicationInstance.registry.register` is deprecated. Please use `ApplicationInstance.register` instead./); + }); + + QUnit.test('customEvents added to the application before setupEventDispatcher', function (assert) { + assert.expect(1); + + appInstance = _emberMetal.run(function () { + return _emberApplicationSystemApplicationInstance.default.create({ application: application }); + }); + + application.customEvents = { + awesome: 'sauce' + }; + + var eventDispatcher = appInstance.lookup('event_dispatcher:main'); + eventDispatcher.setup = function (events) { + assert.equal(events.awesome, 'sauce'); + }; + + appInstance.setupEventDispatcher(); + }); + + QUnit.test('customEvents added to the application before setupEventDispatcher', function (assert) { + assert.expect(1); + + _emberMetal.run(function () { + return appInstance = _emberApplicationSystemApplicationInstance.default.create({ application: application }); + }); + + application.customEvents = { + awesome: 'sauce' + }; + + var eventDispatcher = appInstance.lookup('event_dispatcher:main'); + eventDispatcher.setup = function (events) { + assert.equal(events.awesome, 'sauce'); + }; + + appInstance.setupEventDispatcher(); + }); + + QUnit.test('customEvents added to the application instance before setupEventDispatcher', function (assert) { + assert.expect(1); + + appInstance = _emberMetal.run(function () { + return _emberApplicationSystemApplicationInstance.default.create({ application: application }); + }); + + appInstance.customEvents = { + awesome: 'sauce' + }; + + var eventDispatcher = appInstance.lookup('event_dispatcher:main'); + eventDispatcher.setup = function (events) { + assert.equal(events.awesome, 'sauce'); + }; + + appInstance.setupEventDispatcher(); + }); + + QUnit.test('unregistering a factory clears all cached instances of that factory', function (assert) { + assert.expect(3); + + appInstance = _emberMetal.run(function () { + return _emberApplicationSystemApplicationInstance.default.create({ application: application }); + }); + + var PostController = _internalTestHelpers.factory(); + + appInstance.register('controller:post', PostController); + + var postController1 = appInstance.lookup('controller:post'); + assert.ok(postController1, 'lookup creates instance'); + + appInstance.unregister('controller:post'); + appInstance.register('controller:post', PostController); + + var postController2 = appInstance.lookup('controller:post'); + assert.ok(postController2, 'lookup creates instance'); + + assert.notStrictEqual(postController1, postController2, 'lookup creates a brand new instance, because the previous one was reset'); + }); + + QUnit.test('can build and boot a registered engine', function (assert) { + assert.expect(10); + + var ChatEngine = _emberApplicationSystemEngine.default.extend(); + var chatEngineInstance = undefined; + + application.register('engine:chat', ChatEngine); + + _emberMetal.run(function () { + appInstance = _emberApplicationSystemApplicationInstance.default.create({ application: application }); + appInstance.setupRegistry(); + chatEngineInstance = appInstance.buildChildEngineInstance('chat'); + }); + + return chatEngineInstance.boot().then(function () { + assert.ok(true, 'boot successful'); + + var registrations = ['route:basic', 'event_dispatcher:main', 'service:-routing', 'service:-glimmer-environment']; + + registrations.forEach(function (key) { + assert.strictEqual(chatEngineInstance.resolveRegistration(key), appInstance.resolveRegistration(key), 'Engine and parent app share registrations for \'' + key + '\''); + }); + + var singletons = ['router:main', _container.privatize(_templateObject), '-view-registry:main', '-environment:main']; + + var env = appInstance.lookup('-environment:main'); + singletons.push(env.isInteractive ? 'renderer:-dom' : 'renderer:-inert'); + + singletons.forEach(function (key) { + assert.strictEqual(chatEngineInstance.lookup(key), appInstance.lookup(key), 'Engine and parent app share singleton \'' + key + '\''); + }); + }); + }); + + QUnit.test('can build a registry via Ember.ApplicationInstance.setupRegistry() -- simulates ember-test-helpers', function (assert) { + var namespace = _emberRuntime.Object.create({ + Resolver: { create: function () {} } + }); + + var registry = _emberApplicationSystemApplication.default.buildRegistry(namespace); + + _emberApplicationSystemApplicationInstance.default.setupRegistry(registry); + + assert.equal(registry.resolve('service:-document'), document); + }); +}); +enifed('ember-application/tests/system/application_instance_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/application_instance_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/application_instance_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/application_instance_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/application_instance_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/application_instance_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/application_test', ['exports', 'ember', 'ember-environment', 'ember-metal', 'ember-application/system/application', 'ember-application/system/resolver', 'ember-routing', 'ember-views', 'ember-runtime', 'ember-template-compiler', 'ember-glimmer', 'container', 'ember-application/tests/test-helpers/registry-check'], function (exports, _ember, _emberEnvironment, _emberMetal, _emberApplicationSystemApplication, _emberApplicationSystemResolver, _emberRouting, _emberViews, _emberRuntime, _emberTemplateCompiler, _emberGlimmer, _container, _emberApplicationTestsTestHelpersRegistryCheck) { + /*globals EmberDev */ + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['template:components/-default'], ['template:components/-default']); + + var trim = _emberViews.jQuery.trim; + + var app = undefined, + application = undefined, + originalLookup = undefined, + originalDebug = undefined, + originalWarn = undefined; + + QUnit.module('Ember.Application', { + setup: function () { + originalLookup = _emberEnvironment.context.lookup; + originalDebug = _emberMetal.getDebugFunction('debug'); + originalWarn = _emberMetal.getDebugFunction('warn'); + + _emberViews.jQuery('#qunit-fixture').html('
    HI
    HI
    '); + application = _emberMetal.run(function () { + return _emberApplicationSystemApplication.default.create({ rootElement: '#one', router: null }); + }); + }, + + teardown: function () { + _emberViews.jQuery('#qunit-fixture').empty(); + _emberMetal.setDebugFunction('debug', originalDebug); + _emberMetal.setDebugFunction('warn', originalWarn); + + _emberEnvironment.context.lookup = originalLookup; + + if (application) { + _emberMetal.run(application, 'destroy'); + } + + if (app) { + _emberMetal.run(app, 'destroy'); + } + } + }); + + QUnit.test('you can make a new application in a non-overlapping element', function () { + app = _emberMetal.run(function () { + return _emberApplicationSystemApplication.default.create({ rootElement: '#two', router: null }); + }); + + _emberMetal.run(app, 'destroy'); + ok(true, 'should not raise'); + }); + + QUnit.test('you cannot make a new application that is a parent of an existing application', function () { + expectAssertion(function () { + _emberMetal.run(function () { + return _emberApplicationSystemApplication.default.create({ rootElement: '#qunit-fixture' }); + }); + }); + }); + + QUnit.test('you cannot make a new application that is a descendant of an existing application', function () { + expectAssertion(function () { + _emberMetal.run(function () { + return _emberApplicationSystemApplication.default.create({ rootElement: '#one-child' }); + }); + }); + }); + + QUnit.test('you cannot make a new application that is a duplicate of an existing application', function () { + expectAssertion(function () { + _emberMetal.run(function () { + return _emberApplicationSystemApplication.default.create({ rootElement: '#one' }); + }); + }); + }); + + QUnit.test('you cannot make two default applications without a rootElement error', function () { + expectAssertion(function () { + _emberMetal.run(function () { + return _emberApplicationSystemApplication.default.create({ router: false }); + }); + }); + }); + + QUnit.test('acts like a namespace', function () { + var lookup = _emberEnvironment.context.lookup = {}; + + app = _emberMetal.run(function () { + return lookup.TestApp = _emberApplicationSystemApplication.default.create({ rootElement: '#two', router: false }); + }); + + _emberRuntime.setNamespaceSearchDisabled(false); + app.Foo = _emberRuntime.Object.extend(); + equal(app.Foo.toString(), 'TestApp.Foo', 'Classes pick up their parent namespace'); + }); + + QUnit.test('includes deprecated access to `application.registry`', function () { + expect(3); + + ok(typeof application.registry.register === 'function', '#registry.register is available as a function'); + + application.__registry__.register = function () { + ok(true, '#register alias is called correctly'); + }; + + expectDeprecation(function () { + application.registry.register(); + }, /Using `Application.registry.register` is deprecated. Please use `Application.register` instead./); + }); + + QUnit.test('builds a registry', function () { + strictEqual(application.resolveRegistration('application:main'), application, 'application:main is registered'); + deepEqual(application.registeredOptionsForType('component'), { singleton: false }, 'optionsForType \'component\''); + deepEqual(application.registeredOptionsForType('view'), { singleton: false }, 'optionsForType \'view\''); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'controller:basic'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, '-view-registry:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'view', '_viewRegistry', '-view-registry:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'route', '_topLevelViewTemplate', 'template:-outlet'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'route:basic'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'event_dispatcher:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'router:main', 'namespace', 'application:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'view:-outlet', 'namespace', 'application:main'); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'location:auto'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'location:hash'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'location:history'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'location:none'); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'controller', 'target', 'router:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'controller', 'namespace', 'application:main'); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, _container.privatize(_templateObject)); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'router', '_bucketCache', _container.privatize(_templateObject)); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'route', '_bucketCache', _container.privatize(_templateObject)); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'route', 'router', 'router:main'); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'component:-text-field'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'component:-text-area'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'component:-checkbox'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'component:link-to'); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'service:-routing'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'service:-routing', 'router', 'router:main'); + + // DEBUGGING + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'resolver-for-debugging:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'container-debug-adapter:main', 'resolver', 'resolver-for-debugging:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'data-adapter:main', 'containerDebugAdapter', 'container-debug-adapter:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'container-debug-adapter:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'component-lookup:main'); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'service:-glimmer-environment'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'service:-dom-changes'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'service:-dom-tree-construction'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'service:-glimmer-environment', 'appendOperations', 'service:-dom-tree-construction'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'service:-glimmer-environment', 'updateOperations', 'service:-dom-changes'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'renderer', 'env', 'service:-glimmer-environment'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'view:-outlet'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'renderer:-dom'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'renderer:-inert'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, _container.privatize(_templateObject2)); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(application, 'template:-outlet'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'view:-outlet', 'template', 'template:-outlet'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(application, 'template', 'env', 'service:-glimmer-environment'); + deepEqual(application.registeredOptionsForType('helper'), { instantiate: false }, 'optionsForType \'helper\''); + }); + + var originalLogVersion = _emberEnvironment.ENV.LOG_VERSION; + + QUnit.module('Ember.Application initialization', { + teardown: function () { + if (app) { + _emberMetal.run(app, 'destroy'); + } + _emberGlimmer.setTemplates({}); + _emberEnvironment.ENV.LOG_VERSION = originalLogVersion; + } + }); + + QUnit.test('initialized application goes to initial route', function () { + _emberMetal.run(function () { + app = _emberApplicationSystemApplication.default.create({ + rootElement: '#qunit-fixture' + }); + + app.Router.reopen({ + location: 'none' + }); + + app.register('template:application', _emberTemplateCompiler.compile('{{outlet}}')); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Hi from index

    ')); + }); + + equal(_emberViews.jQuery('#qunit-fixture h1').text(), 'Hi from index'); + }); + + QUnit.test('ready hook is called before routing begins', function () { + expect(2); + + _emberMetal.run(function () { + function registerRoute(application, name, callback) { + var route = _emberRouting.Route.extend({ + activate: callback + }); + + application.register('route:' + name, route); + } + + var MyApplication = _emberApplicationSystemApplication.default.extend({ + ready: function () { + registerRoute(this, 'index', function () { + ok(true, 'last-minute route is activated'); + }); + } + }); + + app = MyApplication.create({ + rootElement: '#qunit-fixture' + }); + + app.Router.reopen({ + location: 'none' + }); + + registerRoute(app, 'application', function () { + return ok(true, 'normal route is activated'); + }); + }); + }); + + QUnit.test('initialize application via initialize call', function () { + _emberMetal.run(function () { + app = _emberApplicationSystemApplication.default.create({ + rootElement: '#qunit-fixture' + }); + + app.Router.reopen({ + location: 'none' + }); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('

    Hello!

    ')); + }); + + // This is not a public way to access the container; we just + // need to make some assertions about the created router + var router = app.__container__.lookup('router:main'); + equal(router instanceof _emberRouting.Router, true, 'Router was set from initialize call'); + equal(router.location instanceof _emberRouting.NoneLocation, true, 'Location was set from location implementation name'); + }); + + QUnit.test('initialize application with stateManager via initialize call from Router class', function () { + _emberMetal.run(function () { + app = _emberApplicationSystemApplication.default.create({ + rootElement: '#qunit-fixture' + }); + + app.Router.reopen({ + location: 'none' + }); + + app.register('template:application', _emberTemplateCompiler.compile('

    Hello!

    ')); + }); + + var router = app.__container__.lookup('router:main'); + equal(router instanceof _emberRouting.Router, true, 'Router was set from initialize call'); + equal(_emberViews.jQuery('#qunit-fixture h1').text(), 'Hello!'); + }); + + QUnit.test('ApplicationView is inserted into the page', function () { + _emberMetal.run(function () { + app = _emberApplicationSystemApplication.default.create({ + rootElement: '#qunit-fixture' + }); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('

    Hello!

    ')); + + app.ApplicationController = _emberRuntime.Controller.extend(); + + app.Router.reopen({ + location: 'none' + }); + }); + + equal(_emberViews.jQuery('#qunit-fixture h1').text(), 'Hello!'); + }); + + QUnit.test('Minimal Application initialized with just an application template', function () { + _emberViews.jQuery('#qunit-fixture').html(''); + app = _emberMetal.run(function () { + return _emberApplicationSystemApplication.default.create({ + rootElement: '#qunit-fixture' + }); + }); + + equal(trim(_emberViews.jQuery('#qunit-fixture').text()), 'Hello World'); + }); + + QUnit.test('enable log of libraries with an ENV var', function () { + if (EmberDev && EmberDev.runningProdBuild) { + ok(true, 'Logging does not occur in production builds'); + return; + } + + var messages = []; + + _emberEnvironment.ENV.LOG_VERSION = true; + + _emberMetal.setDebugFunction('debug', function (message) { + return messages.push(message); + }); + + _emberMetal.libraries.register('my-lib', '2.0.0a'); + + app = _emberMetal.run(function () { + return _emberApplicationSystemApplication.default.create({ + rootElement: '#qunit-fixture' + }); + }); + + equal(messages[1], 'Ember : ' + _ember.VERSION); + equal(messages[2], 'jQuery : ' + _emberViews.jQuery().jquery); + equal(messages[3], 'my-lib : ' + '2.0.0a'); + + _emberMetal.libraries.deRegister('my-lib'); + }); + + QUnit.test('disable log version of libraries with an ENV var', function () { + var logged = false; + + _emberEnvironment.ENV.LOG_VERSION = false; + + _emberMetal.setDebugFunction('debug', function () { + return logged = true; + }); + + _emberViews.jQuery('#qunit-fixture').empty(); + + _emberMetal.run(function () { + app = _emberApplicationSystemApplication.default.create({ + rootElement: '#qunit-fixture' + }); + + app.Router.reopen({ + location: 'none' + }); + }); + + ok(!logged, 'library version logging skipped'); + }); + + QUnit.test('can resolve custom router', function () { + var CustomRouter = _emberRouting.Router.extend(); + + var Resolver = _emberApplicationSystemResolver.default.extend({ + resolveMain: function (parsedName) { + if (parsedName.type === 'router') { + return CustomRouter; + } else { + return this._super(parsedName); + } + } + }); + + app = _emberMetal.run(function () { + return _emberApplicationSystemApplication.default.create({ + Resolver: Resolver + }); + }); + + ok(app.__container__.lookup('router:main') instanceof CustomRouter, 'application resolved the correct router'); + }); + + QUnit.test('can specify custom router', function () { + app = _emberMetal.run(function () { + return _emberApplicationSystemApplication.default.create({ + Router: _emberRouting.Router.extend() + }); + }); + + ok(app.__container__.lookup('router:main') instanceof _emberRouting.Router, 'application resolved the correct router'); + }); + + QUnit.test('does not leak itself in onLoad._loaded', function () { + equal(_emberRuntime._loaded.application, undefined); + var app = _emberMetal.run(_emberApplicationSystemApplication.default, 'create'); + equal(_emberRuntime._loaded.application, app); + _emberMetal.run(app, 'destroy'); + equal(_emberRuntime._loaded.application, undefined); + }); + + QUnit.test('can build a registry via Ember.Application.buildRegistry() --- simulates ember-test-helpers', function (assert) { + var namespace = _emberRuntime.Object.create({ + Resolver: { create: function () {} } + }); + + var registry = _emberApplicationSystemApplication.default.buildRegistry(namespace); + + assert.equal(registry.resolve('application:main'), namespace); + }); +}); +enifed('ember-application/tests/system/application_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/application_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/application_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/application_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/application_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/application_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/bootstrap-test', ['exports', 'ember-metal', 'ember-application/system/application', 'ember-routing', 'ember-views', 'ember-glimmer'], function (exports, _emberMetal, _emberApplicationSystemApplication, _emberRouting, _emberViews, _emberGlimmer) { + 'use strict'; + + var app = undefined; + + QUnit.module('Ember.Application', { + teardown: function () { + if (app) { + _emberMetal.run(app, 'destroy'); + } + + _emberGlimmer.setTemplates({}); + } + }); + + QUnit.test('templates in script tags are extracted at application creation', function (assert) { + _emberViews.jQuery('#qunit-fixture').html('\n
    \n\n \n \n '); + + var application = _emberApplicationSystemApplication.default.extend(); + application.Router = _emberRouting.Router.extend({ + location: 'none' + }); + + app = _emberMetal.run(function () { + return application.create({ rootElement: '#app' }); + }); + + assert.equal(_emberViews.jQuery('#app').text(), 'Hello World!'); + }); +}); +enifed('ember-application/tests/system/bootstrap-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/bootstrap-test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/bootstrap-test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/bootstrap-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/bootstrap-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/bootstrap-test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/dependency_injection/custom_resolver_test', ['exports', 'ember-views', 'ember-metal', 'ember-application/system/application', 'ember-application/system/resolver', 'ember-template-compiler'], function (exports, _emberViews, _emberMetal, _emberApplicationSystemApplication, _emberApplicationSystemResolver, _emberTemplateCompiler) { + 'use strict'; + + var application = undefined; + + QUnit.module('Ember.Application Dependency Injection – customResolver', { + setup: function () { + var fallbackTemplate = _emberTemplateCompiler.compile('

    Fallback

    '); + + var Resolver = _emberApplicationSystemResolver.default.extend({ + resolveTemplate: function (resolvable) { + var resolvedTemplate = this._super(resolvable); + if (resolvedTemplate) { + return resolvedTemplate; + } + if (resolvable.fullNameWithoutType === 'application') { + return fallbackTemplate; + } else { + return; + } + } + }); + + application = _emberMetal.run(function () { + return _emberApplicationSystemApplication.default.create({ + Resolver: Resolver, + rootElement: '#qunit-fixture' + }); + }); + }, + + teardown: function () { + _emberMetal.run(application, 'destroy'); + } + }); + + QUnit.test('a resolver can be supplied to application', function () { + equal(_emberViews.jQuery('h1', application.rootElement).text(), 'Fallback'); + }); +}); +enifed('ember-application/tests/system/dependency_injection/custom_resolver_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system/dependency_injection'); + test('ember-application/tests/system/dependency_injection/custom_resolver_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/dependency_injection/custom_resolver_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/dependency_injection/custom_resolver_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system/dependency_injection'); + QUnit.test('ember-application/tests/system/dependency_injection/custom_resolver_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/dependency_injection/custom_resolver_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/dependency_injection/default_resolver_test', ['exports', 'ember-environment', 'ember-metal', 'ember-runtime', 'ember-routing', 'ember-application/system/application', 'ember-glimmer', 'ember-template-compiler'], function (exports, _emberEnvironment, _emberMetal, _emberRuntime, _emberRouting, _emberApplicationSystemApplication, _emberGlimmer, _emberTemplateCompiler) { + /* globals EmberDev */ + 'use strict'; + + var registry = undefined, + locator = undefined, + application = undefined, + originalLookup = undefined, + originalInfo = undefined; + + QUnit.module('Ember.Application Dependency Injection - default resolver', { + setup: function () { + originalLookup = _emberEnvironment.context.lookup; + application = _emberMetal.run(_emberApplicationSystemApplication.default, 'create'); + + registry = application.__registry__; + locator = application.__container__; + originalInfo = _emberMetal.getDebugFunction('info'); + }, + + teardown: function () { + _emberGlimmer.setTemplates({}); + _emberEnvironment.context.lookup = originalLookup; + _emberMetal.run(application, 'destroy'); + var UserInterfaceNamespace = _emberRuntime.Namespace.NAMESPACES_BY_ID['UserInterface']; + if (UserInterfaceNamespace) { + _emberMetal.run(UserInterfaceNamespace, 'destroy'); + } + + _emberMetal.setDebugFunction('info', originalInfo); + } + }); + + QUnit.test('the default resolver can look things up in other namespaces', function () { + var UserInterface = _emberEnvironment.context.lookup.UserInterface = _emberRuntime.Namespace.create(); + UserInterface.NavigationController = _emberRuntime.Controller.extend(); + + var nav = locator.lookup('controller:userInterface/navigation'); + + ok(nav instanceof UserInterface.NavigationController, 'the result should be an instance of the specified class'); + }); + + QUnit.test('the default resolver looks up templates in Ember.TEMPLATES', function () { + var fooTemplate = _emberTemplateCompiler.compile('foo template'); + var fooBarTemplate = _emberTemplateCompiler.compile('fooBar template'); + var fooBarBazTemplate = _emberTemplateCompiler.compile('fooBar/baz template'); + + _emberGlimmer.setTemplate('foo', fooTemplate); + _emberGlimmer.setTemplate('fooBar', fooBarTemplate); + _emberGlimmer.setTemplate('fooBar/baz', fooBarBazTemplate); + + equal(locator.lookupFactory('template:foo'), fooTemplate, 'resolves template:foo'); + equal(locator.lookupFactory('template:fooBar'), fooBarTemplate, 'resolves template:foo_bar'); + equal(locator.lookupFactory('template:fooBar.baz'), fooBarBazTemplate, 'resolves template:foo_bar.baz'); + }); + + QUnit.test('the default resolver looks up basic name as no prefix', function () { + ok(_emberRuntime.Controller.detect(locator.lookup('controller:basic')), 'locator looks up correct controller'); + }); + + function detectEqual(first, second, message) { + ok(first.detect(second), message); + } + + QUnit.test('the default resolver looks up arbitrary types on the namespace', function () { + application.FooManager = _emberRuntime.Object.extend({}); + + detectEqual(application.FooManager, registry.resolve('manager:foo'), 'looks up FooManager on application'); + }); + + QUnit.test('the default resolver resolves models on the namespace', function () { + application.Post = _emberRuntime.Object.extend({}); + + detectEqual(application.Post, locator.lookupFactory('model:post'), 'looks up Post model on application'); + }); + + QUnit.test('the default resolver resolves *:main on the namespace', function () { + application.FooBar = _emberRuntime.Object.extend({}); + + detectEqual(application.FooBar, locator.lookupFactory('foo-bar:main'), 'looks up FooBar type without name on application'); + }); + + QUnit.test('the default resolver resolves container-registered helpers', function () { + var shorthandHelper = _emberGlimmer.helper(function () {}); + var helper = _emberGlimmer.Helper.extend(); + + application.register('helper:shorthand', shorthandHelper); + application.register('helper:complete', helper); + + var lookedUpShorthandHelper = locator.lookupFactory('helper:shorthand'); + ok(lookedUpShorthandHelper.isHelperInstance, 'shorthand helper isHelper'); + + var lookedUpHelper = locator.lookupFactory('helper:complete'); + ok(lookedUpHelper.isHelperFactory, 'complete helper is factory'); + ok(helper.detect(lookedUpHelper), 'looked up complete helper'); + }); + + QUnit.test('the default resolver resolves helpers on the namespace', function () { + var ShorthandHelper = _emberGlimmer.helper(function () {}); + var CompleteHelper = _emberGlimmer.Helper.extend(); + var LegacyHTMLBarsBoundHelper = undefined; + + expectDeprecation(function () { + LegacyHTMLBarsBoundHelper = _emberGlimmer.makeBoundHelper(function () {}); + }, 'Using `Ember.HTMLBars.makeBoundHelper` is deprecated. Please refactor to use `Ember.Helper` or `Ember.Helper.helper`.'); + + application.ShorthandHelper = ShorthandHelper; + application.CompleteHelper = CompleteHelper; + application.LegacyHtmlBarsBoundHelper = LegacyHTMLBarsBoundHelper; // Must use lowered "tml" in "HTMLBars" for resolver to find this + + var resolvedShorthand = registry.resolve('helper:shorthand'); + var resolvedComplete = registry.resolve('helper:complete'); + var resolvedLegacyHTMLBars = registry.resolve('helper:legacy-html-bars-bound'); + + equal(resolvedShorthand, ShorthandHelper, 'resolve fetches the shorthand helper factory'); + equal(resolvedComplete, CompleteHelper, 'resolve fetches the complete helper factory'); + equal(resolvedLegacyHTMLBars, LegacyHTMLBarsBoundHelper, 'resolves legacy HTMLBars bound helper'); + }); + + QUnit.test('the default resolver resolves to the same instance, no matter the notation ', function () { + application.NestedPostController = _emberRuntime.Controller.extend({}); + + equal(locator.lookup('controller:nested-post'), locator.lookup('controller:nested_post'), 'looks up NestedPost controller on application'); + }); + + QUnit.test('the default resolver throws an error if the fullName to resolve is invalid', function () { + throws(function () { + registry.resolve(undefined); + }, TypeError, /Invalid fullName/); + throws(function () { + registry.resolve(null); + }, TypeError, /Invalid fullName/); + throws(function () { + registry.resolve(''); + }, TypeError, /Invalid fullName/); + throws(function () { + registry.resolve(''); + }, TypeError, /Invalid fullName/); + throws(function () { + registry.resolve(':'); + }, TypeError, /Invalid fullName/); + throws(function () { + registry.resolve('model'); + }, TypeError, /Invalid fullName/); + throws(function () { + registry.resolve('model:'); + }, TypeError, /Invalid fullName/); + throws(function () { + registry.resolve(':type'); + }, TypeError, /Invalid fullName/); + }); + + QUnit.test('the default resolver logs hits if `LOG_RESOLVER` is set', function () { + if (EmberDev && EmberDev.runningProdBuild) { + ok(true, 'Logging does not occur in production builds'); + return; + } + + expect(3); + + application.LOG_RESOLVER = true; + application.ScoobyDoo = _emberRuntime.Object.extend(); + application.toString = function () { + return 'App'; + }; + + _emberMetal.setDebugFunction('info', function (symbol, name, padding, lookupDescription) { + equal(symbol, '[✓]', 'proper symbol is printed when a module is found'); + equal(name, 'doo:scooby', 'proper lookup value is logged'); + equal(lookupDescription, 'App.ScoobyDoo'); + }); + + registry.resolve('doo:scooby'); + }); + + QUnit.test('the default resolver logs misses if `LOG_RESOLVER` is set', function () { + if (EmberDev && EmberDev.runningProdBuild) { + ok(true, 'Logging does not occur in production builds'); + return; + } + + expect(3); + + application.LOG_RESOLVER = true; + application.toString = function () { + return 'App'; + }; + + _emberMetal.setDebugFunction('info', function (symbol, name, padding, lookupDescription) { + equal(symbol, '[ ]', 'proper symbol is printed when a module is not found'); + equal(name, 'doo:scooby', 'proper lookup value is logged'); + equal(lookupDescription, 'App.ScoobyDoo'); + }); + + registry.resolve('doo:scooby'); + }); + + QUnit.test('doesn\'t log without LOG_RESOLVER', function () { + if (EmberDev && EmberDev.runningProdBuild) { + ok(true, 'Logging does not occur in production builds'); + return; + } + + var infoCount = 0; + + application.ScoobyDoo = _emberRuntime.Object.extend(); + + _emberMetal.setDebugFunction('info', function (symbol, name) { + return infoCount = infoCount + 1; + }); + + registry.resolve('doo:scooby'); + registry.resolve('doo:scrappy'); + equal(infoCount, 0, 'Logger.info should not be called if LOG_RESOLVER is not set'); + }); + + QUnit.test('lookup description', function () { + application.toString = function () { + return 'App'; + }; + + equal(registry.describe('controller:foo'), 'App.FooController', 'Type gets appended at the end'); + equal(registry.describe('controller:foo.bar'), 'App.FooBarController', 'dots are removed'); + equal(registry.describe('model:foo'), 'App.Foo', 'models don\'t get appended at the end'); + }); + + QUnit.test('assertion for routes without isRouteFactory property', function () { + application.FooRoute = _emberGlimmer.Component.extend(); + + expectAssertion(function () { + return registry.resolve('route:foo'); + }, /to resolve to an Ember.Route/, 'Should assert'); + }); + + QUnit.test('no assertion for routes that extend from Ember.Route', function () { + expect(0); + application.FooRoute = _emberRouting.Route.extend(); + registry.resolve('route:foo'); + }); + + QUnit.test('deprecation warning for service factories without isServiceFactory property', function () { + expectDeprecation(/service factories must have an `isServiceFactory` property/); + application.FooService = _emberRuntime.Object.extend(); + registry.resolve('service:foo'); + }); + + QUnit.test('no deprecation warning for service factories that extend from Ember.Service', function () { + expectNoDeprecation(); + application.FooService = _emberRuntime.Service.extend(); + registry.resolve('service:foo'); + }); + + QUnit.test('deprecation warning for component factories without isComponentFactory property', function () { + expectDeprecation(/component factories must have an `isComponentFactory` property/); + application.FooComponent = _emberRuntime.Object.extend(); + registry.resolve('component:foo'); + }); + + QUnit.test('no deprecation warning for component factories that extend from Ember.Component', function () { + expectNoDeprecation(); + application.FooView = _emberGlimmer.Component.extend(); + registry.resolve('component:foo'); + }); + + QUnit.test('knownForType returns each item for a given type found', function () { + application.FooBarHelper = 'foo'; + application.BazQuxHelper = 'bar'; + + var found = registry.resolver.knownForType('helper'); + + // using `Object.keys` and manually confirming values over using `deepEqual` + // due to an issue in QUnit (through at least 1.20.0) that are unable to properly compare + // objects with an `undefined` constructor (like ember-metal/empty_object) + var foundKeys = Object.keys(found); + + deepEqual(foundKeys, ['helper:foo-bar', 'helper:baz-qux']); + ok(found['helper:foo-bar']); + ok(found['helper:baz-qux']); + }); + + QUnit.test('knownForType is not required to be present on the resolver', function () { + delete registry.resolver.knownForType; + + registry.resolver.knownForType('helper', function () {}); + + ok(true, 'does not error'); + }); +}); +enifed('ember-application/tests/system/dependency_injection/default_resolver_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system/dependency_injection'); + test('ember-application/tests/system/dependency_injection/default_resolver_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/dependency_injection/default_resolver_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/dependency_injection/default_resolver_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system/dependency_injection'); + QUnit.test('ember-application/tests/system/dependency_injection/default_resolver_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/dependency_injection/default_resolver_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/dependency_injection/normalization_test', ['exports', 'ember-metal', 'ember-application/system/application'], function (exports, _emberMetal, _emberApplicationSystemApplication) { + 'use strict'; + + var application = undefined, + registry = undefined; + + QUnit.module('Ember.Application Dependency Injection – normalization', { + setup: function () { + application = _emberMetal.run(_emberApplicationSystemApplication.default, 'create'); + registry = application.__registry__; + }, + + teardown: function () { + _emberMetal.run(application, 'destroy'); + } + }); + + QUnit.test('normalization', function () { + ok(registry.normalize, 'registry#normalize is present'); + + equal(registry.normalize('foo:bar'), 'foo:bar'); + + equal(registry.normalize('controller:posts'), 'controller:posts'); + equal(registry.normalize('controller:posts_index'), 'controller:postsIndex'); + equal(registry.normalize('controller:posts.index'), 'controller:postsIndex'); + equal(registry.normalize('controller:posts-index'), 'controller:postsIndex'); + equal(registry.normalize('controller:posts.post.index'), 'controller:postsPostIndex'); + equal(registry.normalize('controller:posts_post.index'), 'controller:postsPostIndex'); + equal(registry.normalize('controller:posts.post_index'), 'controller:postsPostIndex'); + equal(registry.normalize('controller:posts.post-index'), 'controller:postsPostIndex'); + equal(registry.normalize('controller:postsIndex'), 'controller:postsIndex'); + equal(registry.normalize('controller:blogPosts.index'), 'controller:blogPostsIndex'); + equal(registry.normalize('controller:blog/posts.index'), 'controller:blog/postsIndex'); + equal(registry.normalize('controller:blog/posts-index'), 'controller:blog/postsIndex'); + equal(registry.normalize('controller:blog/posts.post.index'), 'controller:blog/postsPostIndex'); + equal(registry.normalize('controller:blog/posts_post.index'), 'controller:blog/postsPostIndex'); + equal(registry.normalize('controller:blog/posts_post-index'), 'controller:blog/postsPostIndex'); + + equal(registry.normalize('template:blog/posts_index'), 'template:blog/posts_index'); + }); + + QUnit.test('normalization is indempotent', function () { + var examples = ['controller:posts', 'controller:posts.post.index', 'controller:blog/posts.post_index', 'template:foo_bar']; + + examples.forEach(function (example) { + equal(registry.normalize(registry.normalize(example)), registry.normalize(example)); + }); + }); +}); +enifed('ember-application/tests/system/dependency_injection/normalization_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system/dependency_injection'); + test('ember-application/tests/system/dependency_injection/normalization_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/dependency_injection/normalization_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/dependency_injection/normalization_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system/dependency_injection'); + QUnit.test('ember-application/tests/system/dependency_injection/normalization_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/dependency_injection/normalization_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/dependency_injection/to_string_test', ['exports', 'ember-utils', 'ember-environment', 'ember-metal', 'ember-application/system/application', 'ember-runtime', 'ember-application/system/resolver'], function (exports, _emberUtils, _emberEnvironment, _emberMetal, _emberApplicationSystemApplication, _emberRuntime, _emberApplicationSystemResolver) { + 'use strict'; + + var originalLookup = undefined, + App = undefined, + originalModelInjections = undefined; + + QUnit.module('Ember.Application Dependency Injection – toString', { + setup: function () { + originalModelInjections = _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS; + _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS = true; + + originalLookup = _emberEnvironment.context.lookup; + + _emberMetal.run(function () { + App = _emberApplicationSystemApplication.default.create(); + _emberEnvironment.context.lookup = { + App: App + }; + }); + + App.Post = _emberRuntime.Object.extend(); + }, + + teardown: function () { + _emberEnvironment.context.lookup = originalLookup; + _emberMetal.run(App, 'destroy'); + _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS = originalModelInjections; + } + }); + + QUnit.test('factories', function () { + var PostFactory = App.__container__.lookupFactory('model:post'); + equal(PostFactory.toString(), 'App.Post', 'expecting the model to be post'); + }); + + QUnit.test('instances', function () { + var post = App.__container__.lookup('model:post'); + var guid = _emberUtils.guidFor(post); + + equal(post.toString(), '', 'expecting the model to be post'); + }); + + QUnit.test('with a custom resolver', function () { + _emberMetal.run(App, 'destroy'); + + _emberMetal.run(function () { + App = _emberApplicationSystemApplication.default.create({ + Resolver: _emberApplicationSystemResolver.default.extend({ + makeToString: function (factory, fullName) { + return fullName; + } + }) + }); + }); + + App.register('model:peter', _emberRuntime.Object.extend()); + + var peter = App.__container__.lookup('model:peter'); + var guid = _emberUtils.guidFor(peter); + + equal(peter.toString(), '', 'expecting the supermodel to be peter'); + }); +}); +// lookup, etc +enifed('ember-application/tests/system/dependency_injection/to_string_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system/dependency_injection'); + test('ember-application/tests/system/dependency_injection/to_string_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/dependency_injection/to_string_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/dependency_injection/to_string_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system/dependency_injection'); + QUnit.test('ember-application/tests/system/dependency_injection/to_string_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/dependency_injection/to_string_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/dependency_injection_test', ['exports', 'ember-environment', 'ember-metal', 'ember-runtime', 'ember-application/system/application'], function (exports, _emberEnvironment, _emberMetal, _emberRuntime, _emberApplicationSystemApplication) { + 'use strict'; + + var EmberApplication = _emberApplicationSystemApplication.default; + + var originalLookup = _emberEnvironment.context.lookup; + var registry = undefined, + locator = undefined, + lookup = undefined, + application = undefined, + originalModelInjections = undefined; + + QUnit.module('Ember.Application Dependency Injection', { + setup: function () { + originalModelInjections = _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS; + _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS = true; + + application = _emberMetal.run(EmberApplication, 'create'); + + application.Person = _emberRuntime.Object.extend({}); + application.Orange = _emberRuntime.Object.extend({}); + application.Email = _emberRuntime.Object.extend({}); + application.User = _emberRuntime.Object.extend({}); + application.PostIndexController = _emberRuntime.Object.extend({}); + + application.register('model:person', application.Person, { singleton: false }); + application.register('model:user', application.User, { singleton: false }); + application.register('fruit:favorite', application.Orange); + application.register('communication:main', application.Email, { singleton: false }); + application.register('controller:postIndex', application.PostIndexController, { singleton: true }); + + registry = application.__registry__; + locator = application.__container__; + + lookup = _emberEnvironment.context.lookup = {}; + }, + teardown: function () { + _emberMetal.run(application, 'destroy'); + application = locator = null; + _emberEnvironment.context.lookup = originalLookup; + _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS = originalModelInjections; + } + }); + + QUnit.test('container lookup is normalized', function () { + var dotNotationController = locator.lookup('controller:post.index'); + var camelCaseController = locator.lookup('controller:postIndex'); + + ok(dotNotationController instanceof application.PostIndexController); + ok(camelCaseController instanceof application.PostIndexController); + + equal(dotNotationController, camelCaseController); + }); + + QUnit.test('registered entities can be looked up later', function () { + equal(registry.resolve('model:person'), application.Person); + equal(registry.resolve('model:user'), application.User); + equal(registry.resolve('fruit:favorite'), application.Orange); + equal(registry.resolve('communication:main'), application.Email); + equal(registry.resolve('controller:postIndex'), application.PostIndexController); + + equal(locator.lookup('fruit:favorite'), locator.lookup('fruit:favorite'), 'singleton lookup worked'); + ok(locator.lookup('model:user') !== locator.lookup('model:user'), 'non-singleton lookup worked'); + }); + + QUnit.test('injections', function () { + application.inject('model', 'fruit', 'fruit:favorite'); + application.inject('model:user', 'communication', 'communication:main'); + + var user = locator.lookup('model:user'); + var person = locator.lookup('model:person'); + var fruit = locator.lookup('fruit:favorite'); + + equal(user.get('fruit'), fruit); + equal(person.get('fruit'), fruit); + + ok(application.Email.detectInstance(user.get('communication'))); + }); +}); +enifed('ember-application/tests/system/dependency_injection_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/dependency_injection_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/dependency_injection_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/dependency_injection_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/dependency_injection_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/dependency_injection_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/engine_initializers_test', ['exports', 'ember-metal', 'ember-application/system/engine'], function (exports, _emberMetal, _emberApplicationSystemEngine) { + 'use strict'; + + var MyEngine = undefined, + myEngine = undefined, + myEngineInstance = undefined; + + QUnit.module('Ember.Engine initializers', { + setup: function () {}, + + teardown: function () { + _emberMetal.run(function () { + if (myEngineInstance) { + myEngineInstance.destroy(); + } + + if (myEngine) { + myEngine.destroy(); + } + }); + } + }); + + QUnit.test('initializers require proper \'name\' and \'initialize\' properties', function () { + MyEngine = _emberApplicationSystemEngine.default.extend(); + + expectAssertion(function () { + _emberMetal.run(function () { + MyEngine.initializer({ name: 'initializer' }); + }); + }); + + expectAssertion(function () { + _emberMetal.run(function () { + MyEngine.initializer({ initialize: function () {} }); + }); + }); + }); + + QUnit.test('initializers are passed an Engine', function () { + MyEngine = _emberApplicationSystemEngine.default.extend(); + + MyEngine.initializer({ + name: 'initializer', + initialize: function (engine) { + ok(engine instanceof _emberApplicationSystemEngine.default, 'initialize is passed an Engine'); + } + }); + + myEngine = MyEngine.create(); + myEngineInstance = myEngine.buildInstance(); + }); + + QUnit.test('initializers can be registered in a specified order', function () { + var order = []; + + MyEngine = _emberApplicationSystemEngine.default.extend(); + MyEngine.initializer({ + name: 'fourth', + after: 'third', + initialize: function (engine) { + order.push('fourth'); + } + }); + + MyEngine.initializer({ + name: 'second', + after: 'first', + before: 'third', + initialize: function (engine) { + order.push('second'); + } + }); + + MyEngine.initializer({ + name: 'fifth', + after: 'fourth', + before: 'sixth', + initialize: function (engine) { + order.push('fifth'); + } + }); + + MyEngine.initializer({ + name: 'first', + before: 'second', + initialize: function (engine) { + order.push('first'); + } + }); + + MyEngine.initializer({ + name: 'third', + initialize: function (engine) { + order.push('third'); + } + }); + + MyEngine.initializer({ + name: 'sixth', + initialize: function (engine) { + order.push('sixth'); + } + }); + + myEngine = MyEngine.create(); + myEngineInstance = myEngine.buildInstance(); + + deepEqual(order, ['first', 'second', 'third', 'fourth', 'fifth', 'sixth']); + }); + + QUnit.test('initializers can be registered in a specified order as an array', function () { + var order = []; + + MyEngine = _emberApplicationSystemEngine.default.extend(); + + MyEngine.initializer({ + name: 'third', + initialize: function (engine) { + order.push('third'); + } + }); + + MyEngine.initializer({ + name: 'second', + after: 'first', + before: ['third', 'fourth'], + initialize: function (engine) { + order.push('second'); + } + }); + + MyEngine.initializer({ + name: 'fourth', + after: ['second', 'third'], + initialize: function (engine) { + order.push('fourth'); + } + }); + + MyEngine.initializer({ + name: 'fifth', + after: 'fourth', + before: 'sixth', + initialize: function (engine) { + order.push('fifth'); + } + }); + + MyEngine.initializer({ + name: 'first', + before: ['second'], + initialize: function (engine) { + order.push('first'); + } + }); + + MyEngine.initializer({ + name: 'sixth', + initialize: function (engine) { + order.push('sixth'); + } + }); + + myEngine = MyEngine.create(); + myEngineInstance = myEngine.buildInstance(); + + deepEqual(order, ['first', 'second', 'third', 'fourth', 'fifth', 'sixth']); + }); + + QUnit.test('initializers can have multiple dependencies', function () { + var order = []; + + MyEngine = _emberApplicationSystemEngine.default.extend(); + + var a = { + name: 'a', + before: 'b', + initialize: function (engine) { + order.push('a'); + } + }; + var b = { + name: 'b', + initialize: function (engine) { + order.push('b'); + } + }; + var c = { + name: 'c', + after: 'b', + initialize: function (engine) { + order.push('c'); + } + }; + var afterB = { + name: 'after b', + after: 'b', + initialize: function (engine) { + order.push('after b'); + } + }; + var afterC = { + name: 'after c', + after: 'c', + initialize: function (engine) { + order.push('after c'); + } + }; + + MyEngine.initializer(b); + MyEngine.initializer(a); + MyEngine.initializer(afterC); + MyEngine.initializer(afterB); + MyEngine.initializer(c); + + myEngine = MyEngine.create(); + myEngineInstance = myEngine.buildInstance(); + + ok(order.indexOf(a.name) < order.indexOf(b.name), 'a < b'); + ok(order.indexOf(b.name) < order.indexOf(c.name), 'b < c'); + ok(order.indexOf(b.name) < order.indexOf(afterB.name), 'b < afterB'); + ok(order.indexOf(c.name) < order.indexOf(afterC.name), 'c < afterC'); + }); + + QUnit.test('initializers set on Engine subclasses are not shared between engines', function () { + var firstInitializerRunCount = 0; + var secondInitializerRunCount = 0; + var FirstEngine = _emberApplicationSystemEngine.default.extend(); + + FirstEngine.initializer({ + name: 'first', + initialize: function (engine) { + firstInitializerRunCount++; + } + }); + + var SecondEngine = _emberApplicationSystemEngine.default.extend(); + + SecondEngine.initializer({ + name: 'second', + initialize: function (engine) { + secondInitializerRunCount++; + } + }); + + var firstEngine = FirstEngine.create(); + var firstEngineInstance = firstEngine.buildInstance(); + + equal(firstInitializerRunCount, 1, 'first initializer only was run'); + equal(secondInitializerRunCount, 0, 'first initializer only was run'); + + var secondEngine = SecondEngine.create(); + var secondEngineInstance = secondEngine.buildInstance(); + + equal(firstInitializerRunCount, 1, 'second initializer only was run'); + equal(secondInitializerRunCount, 1, 'second initializer only was run'); + + _emberMetal.run(function () { + firstEngineInstance.destroy(); + secondEngineInstance.destroy(); + + firstEngine.destroy(); + secondEngine.destroy(); + }); + }); + + QUnit.test('initializers are concatenated', function () { + var firstInitializerRunCount = 0; + var secondInitializerRunCount = 0; + var FirstEngine = _emberApplicationSystemEngine.default.extend(); + + FirstEngine.initializer({ + name: 'first', + initialize: function (engine) { + firstInitializerRunCount++; + } + }); + + var SecondEngine = FirstEngine.extend(); + + SecondEngine.initializer({ + name: 'second', + initialize: function (engine) { + secondInitializerRunCount++; + } + }); + + var firstEngine = FirstEngine.create(); + var firstEngineInstance = firstEngine.buildInstance(); + + equal(firstInitializerRunCount, 1, 'first initializer only was run when base class created'); + equal(secondInitializerRunCount, 0, 'second initializer was not run when first base class created'); + firstInitializerRunCount = 0; + + var secondEngine = SecondEngine.create(); + var secondEngineInstance = secondEngine.buildInstance(); + + equal(firstInitializerRunCount, 1, 'first initializer was run when subclass created'); + equal(secondInitializerRunCount, 1, 'second initializers was run when subclass created'); + + _emberMetal.run(function () { + firstEngineInstance.destroy(); + secondEngineInstance.destroy(); + + firstEngine.destroy(); + secondEngine.destroy(); + }); + }); + + QUnit.test('initializers are per-engine', function () { + expect(2); + + var FirstEngine = _emberApplicationSystemEngine.default.extend(); + + FirstEngine.initializer({ + name: 'abc', + initialize: function (engine) {} + }); + + expectAssertion(function () { + FirstEngine.initializer({ + name: 'abc', + initialize: function (engine) {} + }); + }); + + var SecondEngine = _emberApplicationSystemEngine.default.extend(); + SecondEngine.instanceInitializer({ + name: 'abc', + initialize: function (engine) {} + }); + + ok(true, 'Two engines can have initializers named the same.'); + }); + + QUnit.test('initializers are executed in their own context', function () { + expect(1); + + MyEngine = _emberApplicationSystemEngine.default.extend(); + + MyEngine.initializer({ + name: 'coolInitializer', + myProperty: 'cool', + initialize: function (engine) { + equal(this.myProperty, 'cool', 'should have access to its own context'); + } + }); + + myEngine = MyEngine.create(); + myEngineInstance = myEngine.buildInstance(); + }); +}); +enifed('ember-application/tests/system/engine_initializers_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/engine_initializers_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/engine_initializers_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/engine_initializers_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/engine_initializers_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/engine_initializers_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/engine_instance_initializers_test', ['exports', 'ember-metal', 'ember-application/system/engine', 'ember-application/system/engine-instance', 'ember-application/system/engine-parent'], function (exports, _emberMetal, _emberApplicationSystemEngine, _emberApplicationSystemEngineInstance, _emberApplicationSystemEngineParent) { + 'use strict'; + + var MyEngine = undefined, + myEngine = undefined, + myEngineInstance = undefined; + + function buildEngineInstance(EngineClass) { + var engineInstance = EngineClass.buildInstance(); + _emberApplicationSystemEngineParent.setEngineParent(engineInstance, { + lookup: function () { + return {}; + }, + resolveRegistration: function () { + return {}; + } + }); + return engineInstance; + } + + QUnit.module('Ember.Engine instance initializers', { + setup: function () {}, + + teardown: function () { + _emberMetal.run(function () { + if (myEngineInstance) { + myEngineInstance.destroy(); + } + + if (myEngine) { + myEngine.destroy(); + } + }); + } + }); + + QUnit.test('initializers require proper \'name\' and \'initialize\' properties', function () { + MyEngine = _emberApplicationSystemEngine.default.extend(); + + expectAssertion(function () { + _emberMetal.run(function () { + MyEngine.instanceInitializer({ name: 'initializer' }); + }); + }); + + expectAssertion(function () { + _emberMetal.run(function () { + MyEngine.instanceInitializer({ initialize: function () {} }); + }); + }); + }); + + QUnit.test('initializers are passed an engine instance', function () { + MyEngine = _emberApplicationSystemEngine.default.extend(); + + MyEngine.instanceInitializer({ + name: 'initializer', + initialize: function (instance) { + ok(instance instanceof _emberApplicationSystemEngineInstance.default, 'initialize is passed an engine instance'); + } + }); + + myEngine = MyEngine.create(); + myEngineInstance = buildEngineInstance(myEngine); + return myEngineInstance.boot(); + }); + + QUnit.test('initializers can be registered in a specified order', function () { + var order = []; + + MyEngine = _emberApplicationSystemEngine.default.extend(); + + MyEngine.instanceInitializer({ + name: 'fourth', + after: 'third', + initialize: function (engine) { + order.push('fourth'); + } + }); + + MyEngine.instanceInitializer({ + name: 'second', + after: 'first', + before: 'third', + initialize: function (engine) { + order.push('second'); + } + }); + + MyEngine.instanceInitializer({ + name: 'fifth', + after: 'fourth', + before: 'sixth', + initialize: function (engine) { + order.push('fifth'); + } + }); + + MyEngine.instanceInitializer({ + name: 'first', + before: 'second', + initialize: function (engine) { + order.push('first'); + } + }); + + MyEngine.instanceInitializer({ + name: 'third', + initialize: function (engine) { + order.push('third'); + } + }); + + MyEngine.instanceInitializer({ + name: 'sixth', + initialize: function (engine) { + order.push('sixth'); + } + }); + + myEngine = MyEngine.create(); + myEngineInstance = buildEngineInstance(myEngine); + + return myEngineInstance.boot().then(function () { + deepEqual(order, ['first', 'second', 'third', 'fourth', 'fifth', 'sixth']); + }); + }); + + QUnit.test('initializers can be registered in a specified order as an array', function () { + var order = []; + MyEngine = _emberApplicationSystemEngine.default.extend(); + + MyEngine.instanceInitializer({ + name: 'third', + initialize: function (engine) { + order.push('third'); + } + }); + + MyEngine.instanceInitializer({ + name: 'second', + after: 'first', + before: ['third', 'fourth'], + initialize: function (engine) { + order.push('second'); + } + }); + + MyEngine.instanceInitializer({ + name: 'fourth', + after: ['second', 'third'], + initialize: function (engine) { + order.push('fourth'); + } + }); + + MyEngine.instanceInitializer({ + name: 'fifth', + after: 'fourth', + before: 'sixth', + initialize: function (engine) { + order.push('fifth'); + } + }); + + MyEngine.instanceInitializer({ + name: 'first', + before: ['second'], + initialize: function (engine) { + order.push('first'); + } + }); + + MyEngine.instanceInitializer({ + name: 'sixth', + initialize: function (engine) { + order.push('sixth'); + } + }); + + myEngine = MyEngine.create(); + myEngineInstance = buildEngineInstance(myEngine); + + return myEngineInstance.boot().then(function () { + deepEqual(order, ['first', 'second', 'third', 'fourth', 'fifth', 'sixth']); + }); + }); + + QUnit.test('initializers can have multiple dependencies', function () { + var order = []; + + MyEngine = _emberApplicationSystemEngine.default.extend(); + + var a = { + name: 'a', + before: 'b', + initialize: function (engine) { + order.push('a'); + } + }; + var b = { + name: 'b', + initialize: function (engine) { + order.push('b'); + } + }; + var c = { + name: 'c', + after: 'b', + initialize: function (engine) { + order.push('c'); + } + }; + var afterB = { + name: 'after b', + after: 'b', + initialize: function (engine) { + order.push('after b'); + } + }; + var afterC = { + name: 'after c', + after: 'c', + initialize: function (engine) { + order.push('after c'); + } + }; + + MyEngine.instanceInitializer(b); + MyEngine.instanceInitializer(a); + MyEngine.instanceInitializer(afterC); + MyEngine.instanceInitializer(afterB); + MyEngine.instanceInitializer(c); + + myEngine = MyEngine.create(); + myEngineInstance = buildEngineInstance(myEngine); + + return myEngineInstance.boot().then(function () { + ok(order.indexOf(a.name) < order.indexOf(b.name), 'a < b'); + ok(order.indexOf(b.name) < order.indexOf(c.name), 'b < c'); + ok(order.indexOf(b.name) < order.indexOf(afterB.name), 'b < afterB'); + ok(order.indexOf(c.name) < order.indexOf(afterC.name), 'c < afterC'); + }); + }); + + QUnit.test('initializers set on Engine subclasses should not be shared between engines', function () { + var firstInitializerRunCount = 0; + var secondInitializerRunCount = 0; + var FirstEngine = _emberApplicationSystemEngine.default.extend(); + var firstEngine = undefined, + firstEngineInstance = undefined; + + FirstEngine.instanceInitializer({ + name: 'first', + initialize: function (engine) { + firstInitializerRunCount++; + } + }); + + var SecondEngine = _emberApplicationSystemEngine.default.extend(); + var secondEngine = undefined, + secondEngineInstance = undefined; + + SecondEngine.instanceInitializer({ + name: 'second', + initialize: function (engine) { + secondInitializerRunCount++; + } + }); + + firstEngine = FirstEngine.create(); + firstEngineInstance = buildEngineInstance(firstEngine); + + return firstEngineInstance.boot().then(function () { + equal(firstInitializerRunCount, 1, 'first initializer only was run'); + equal(secondInitializerRunCount, 0, 'first initializer only was run'); + + secondEngine = SecondEngine.create(); + secondEngineInstance = buildEngineInstance(secondEngine); + return secondEngineInstance.boot(); + }).then(function () { + equal(firstInitializerRunCount, 1, 'second initializer only was run'); + equal(secondInitializerRunCount, 1, 'second initializer only was run'); + + _emberMetal.run(function () { + firstEngineInstance.destroy(); + secondEngineInstance.destroy(); + + firstEngine.destroy(); + secondEngine.destroy(); + }); + }); + }); + + QUnit.test('initializers are concatenated', function () { + var firstInitializerRunCount = 0; + var secondInitializerRunCount = 0; + var FirstEngine = _emberApplicationSystemEngine.default.extend(); + + FirstEngine.instanceInitializer({ + name: 'first', + initialize: function (engine) { + firstInitializerRunCount++; + } + }); + + var SecondEngine = FirstEngine.extend(); + + SecondEngine.instanceInitializer({ + name: 'second', + initialize: function (engine) { + secondInitializerRunCount++; + } + }); + + var firstEngine = FirstEngine.create(); + var firstEngineInstance = buildEngineInstance(firstEngine); + + var secondEngine = undefined, + secondEngineInstance = undefined; + + return firstEngineInstance.boot().then(function () { + equal(firstInitializerRunCount, 1, 'first initializer only was run when base class created'); + equal(secondInitializerRunCount, 0, 'second initializer was not run when first base class created'); + firstInitializerRunCount = 0; + + secondEngine = SecondEngine.create(); + secondEngineInstance = buildEngineInstance(secondEngine); + return secondEngineInstance.boot(); + }).then(function () { + equal(firstInitializerRunCount, 1, 'first initializer was run when subclass created'); + equal(secondInitializerRunCount, 1, 'second initializers was run when subclass created'); + + _emberMetal.run(function () { + firstEngineInstance.destroy(); + secondEngineInstance.destroy(); + + firstEngine.destroy(); + secondEngine.destroy(); + }); + }); + }); + + QUnit.test('initializers are per-engine', function () { + expect(2); + + var FirstEngine = _emberApplicationSystemEngine.default.extend(); + + FirstEngine.instanceInitializer({ + name: 'abc', + initialize: function (engine) {} + }); + + expectAssertion(function () { + FirstEngine.instanceInitializer({ + name: 'abc', + initialize: function (engine) {} + }); + }); + + var SecondEngine = _emberApplicationSystemEngine.default.extend(); + SecondEngine.instanceInitializer({ + name: 'abc', + initialize: function (engine) {} + }); + + ok(true, 'Two engines can have initializers named the same.'); + }); + + QUnit.test('initializers are executed in their own context', function () { + expect(1); + + var MyEngine = _emberApplicationSystemEngine.default.extend(); + + MyEngine.instanceInitializer({ + name: 'coolInitializer', + myProperty: 'cool', + initialize: function (engine) { + equal(this.myProperty, 'cool', 'should have access to its own context'); + } + }); + + myEngine = MyEngine.create(); + myEngineInstance = buildEngineInstance(myEngine); + + return myEngineInstance.boot(); + }); +}); +enifed('ember-application/tests/system/engine_instance_initializers_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/engine_instance_initializers_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/engine_instance_initializers_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/engine_instance_initializers_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/engine_instance_initializers_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/engine_instance_initializers_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/engine_instance_test', ['exports', 'ember-application/system/engine', 'ember-application/system/engine-instance', 'ember-application/system/engine-parent', 'ember-metal', 'internal-test-helpers'], function (exports, _emberApplicationSystemEngine, _emberApplicationSystemEngineInstance, _emberApplicationSystemEngineParent, _emberMetal, _internalTestHelpers) { + 'use strict'; + + var engine = undefined, + engineInstance = undefined; + + QUnit.module('Ember.EngineInstance', { + setup: function () { + _emberMetal.run(function () { + engine = _emberApplicationSystemEngine.default.create({ router: null }); + }); + }, + + teardown: function () { + if (engineInstance) { + _emberMetal.run(engineInstance, 'destroy'); + } + + if (engine) { + _emberMetal.run(engine, 'destroy'); + } + } + }); + + QUnit.test('an engine instance can be created based upon a base engine', function () { + _emberMetal.run(function () { + engineInstance = _emberApplicationSystemEngineInstance.default.create({ base: engine }); + }); + + ok(engineInstance, 'instance should be created'); + equal(engineInstance.base, engine, 'base should be set to engine'); + }); + + QUnit.test('unregistering a factory clears all cached instances of that factory', function (assert) { + assert.expect(3); + + engineInstance = _emberMetal.run(function () { + return _emberApplicationSystemEngineInstance.default.create({ base: engine }); + }); + + var PostComponent = _internalTestHelpers.factory(); + + engineInstance.register('component:post', PostComponent); + + var postComponent1 = engineInstance.lookup('component:post'); + assert.ok(postComponent1, 'lookup creates instance'); + + engineInstance.unregister('component:post'); + engineInstance.register('component:post', PostComponent); + + var postComponent2 = engineInstance.lookup('component:post'); + assert.ok(postComponent2, 'lookup creates instance'); + + assert.notStrictEqual(postComponent1, postComponent2, 'lookup creates a brand new instance because previous one was reset'); + }); + + QUnit.test('can be booted when its parent has been set', function (assert) { + assert.expect(3); + + engineInstance = _emberMetal.run(function () { + return _emberApplicationSystemEngineInstance.default.create({ base: engine }); + }); + + expectAssertion(function () { + engineInstance._bootSync(); + }, 'An engine instance\'s parent must be set via `setEngineParent(engine, parent)` prior to calling `engine.boot()`.'); + + _emberApplicationSystemEngineParent.setEngineParent(engineInstance, {}); + + // Stub `cloneParentDependencies`, the internals of which are tested along + // with application instances. + engineInstance.cloneParentDependencies = function () { + assert.ok(true, 'parent dependencies are cloned'); + }; + + return engineInstance.boot().then(function () { + assert.ok(true, 'boot successful'); + }); + }); + + QUnit.test('can build a child instance of a registered engine', function (assert) { + var ChatEngine = _emberApplicationSystemEngine.default.extend(); + var chatEngineInstance = undefined; + + engine.register('engine:chat', ChatEngine); + + _emberMetal.run(function () { + engineInstance = _emberApplicationSystemEngineInstance.default.create({ base: engine }); + + // Try to build an unregistered engine. + throws(function () { + engineInstance.buildChildEngineInstance('fake'); + }, 'You attempted to mount the engine \'fake\', but it is not registered with its parent.'); + + // Build the `chat` engine, registered above. + chatEngineInstance = engineInstance.buildChildEngineInstance('chat'); + }); + + assert.ok(chatEngineInstance, 'child engine instance successfully created'); + + assert.strictEqual(_emberApplicationSystemEngineParent.getEngineParent(chatEngineInstance), engineInstance, 'child engine instance is assigned the correct parent'); + }); +}); +enifed('ember-application/tests/system/engine_instance_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/engine_instance_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/engine_instance_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/engine_instance_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/engine_instance_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/engine_instance_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/engine_parent_test', ['exports', 'ember-application/system/engine-parent'], function (exports, _emberApplicationSystemEngineParent) { + 'use strict'; + + QUnit.module('EngineParent', {}); + + QUnit.test('An engine\'s parent can be set with `setEngineParent` and retrieved with `getEngineParent`', function () { + var engine = {}; + var parent = {}; + + strictEqual(_emberApplicationSystemEngineParent.getEngineParent(engine), undefined, 'parent has not been set'); + + _emberApplicationSystemEngineParent.setEngineParent(engine, parent); + + strictEqual(_emberApplicationSystemEngineParent.getEngineParent(engine), parent, 'parent has been set'); + + strictEqual(engine[_emberApplicationSystemEngineParent.ENGINE_PARENT], parent, 'parent has been set to the ENGINE_PARENT symbol'); + }); +}); +enifed('ember-application/tests/system/engine_parent_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/engine_parent_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/engine_parent_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/engine_parent_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/engine_parent_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/engine_parent_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/engine_test', ['exports', 'ember-environment', 'ember-metal', 'ember-application/system/engine', 'ember-runtime', 'container', 'ember-application/tests/test-helpers/registry-check'], function (exports, _emberEnvironment, _emberMetal, _emberApplicationSystemEngine, _emberRuntime, _container, _emberApplicationTestsTestHelpersRegistryCheck) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['template:components/-default'], ['template:components/-default']); + + var engine = undefined; + var originalLookup = _emberEnvironment.context.lookup; + var lookup = undefined; + + QUnit.module('Ember.Engine', { + setup: function () { + lookup = _emberEnvironment.context.lookup = {}; + engine = _emberMetal.run(function () { + return _emberApplicationSystemEngine.default.create(); + }); + }, + + teardown: function () { + _emberEnvironment.context.lookup = originalLookup; + if (engine) { + _emberMetal.run(engine, 'destroy'); + } + } + }); + + QUnit.test('acts like a namespace', function () { + engine = _emberMetal.run(function () { + return lookup.TestEngine = _emberApplicationSystemEngine.default.create(); + }); + + engine.Foo = _emberRuntime.Object.extend(); + equal(engine.Foo.toString(), 'TestEngine.Foo', 'Classes pick up their parent namespace'); + }); + + QUnit.test('builds a registry', function () { + strictEqual(engine.resolveRegistration('application:main'), engine, 'application:main is registered'); + deepEqual(engine.registeredOptionsForType('component'), { singleton: false }, 'optionsForType \'component\''); + deepEqual(engine.registeredOptionsForType('view'), { singleton: false }, 'optionsForType \'view\''); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(engine, 'controller:basic'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'view', '_viewRegistry', '-view-registry:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'route', '_topLevelViewTemplate', 'template:-outlet'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'view:-outlet', 'namespace', 'application:main'); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'controller', 'target', 'router:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'controller', 'namespace', 'application:main'); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'router', '_bucketCache', _container.privatize(_templateObject)); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'route', '_bucketCache', _container.privatize(_templateObject)); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'route', 'router', 'router:main'); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(engine, 'component:-text-field'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(engine, 'component:-text-area'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(engine, 'component:-checkbox'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(engine, 'component:link-to'); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(engine, 'service:-routing'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'service:-routing', 'router', 'router:main'); + + // DEBUGGING + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(engine, 'resolver-for-debugging:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'container-debug-adapter:main', 'resolver', 'resolver-for-debugging:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'data-adapter:main', 'containerDebugAdapter', 'container-debug-adapter:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(engine, 'container-debug-adapter:main'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(engine, 'component-lookup:main'); + + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'service:-dom-changes', 'document', 'service:-document'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'service:-dom-tree-construction', 'document', 'service:-document'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(engine, 'view:-outlet'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(engine, _container.privatize(_templateObject2)); + _emberApplicationTestsTestHelpersRegistryCheck.verifyRegistration(engine, 'template:-outlet'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'view:-outlet', 'template', 'template:-outlet'); + _emberApplicationTestsTestHelpersRegistryCheck.verifyInjection(engine, 'template', 'env', 'service:-glimmer-environment'); + deepEqual(engine.registeredOptionsForType('helper'), { instantiate: false }, 'optionsForType \'helper\''); + }); +}); +enifed('ember-application/tests/system/engine_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/engine_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/engine_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/engine_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/engine_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/engine_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/initializers_test', ['exports', 'ember-metal', 'ember-application/system/application', 'ember-views'], function (exports, _emberMetal, _emberApplicationSystemApplication, _emberViews) { + 'use strict'; + + var app = undefined; + + QUnit.module('Ember.Application initializers', { + teardown: function () { + if (app) { + _emberMetal.run(function () { + return app.destroy(); + }); + } + } + }); + + QUnit.test('initializers require proper \'name\' and \'initialize\' properties', function () { + var MyApplication = _emberApplicationSystemApplication.default.extend(); + + expectAssertion(function () { + _emberMetal.run(function () { + MyApplication.initializer({ name: 'initializer' }); + }); + }); + + expectAssertion(function () { + _emberMetal.run(function () { + MyApplication.initializer({ initialize: function () {} }); + }); + }); + }); + + QUnit.test('initializers that throw errors cause the boot promise to reject with the error', function () { + QUnit.expect(2); + QUnit.stop(); + + var MyApplication = _emberApplicationSystemApplication.default.extend(); + + MyApplication.initializer({ + name: 'initializer', + initialize: function () { + throw new Error('boot failure'); + } + }); + + app = MyApplication.create({ + autoboot: false + }); + + try { + app.boot().then(function (app) { + QUnit.start(); + ok(false, 'The boot promise should not resolve when there is a boot error'); + }, function (err) { + QUnit.start(); + ok(err instanceof Error, 'The boot promise should reject with an error'); + equal(err.message, 'boot failure'); + }); + } catch (e) { + QUnit.start(); + ok(false, 'The boot method should not throw'); + throw e; + } + }); + + QUnit.test('initializers are passed an App', function () { + var MyApplication = _emberApplicationSystemApplication.default.extend(); + + MyApplication.initializer({ + name: 'initializer', + initialize: function (App) { + ok(App instanceof _emberApplicationSystemApplication.default, 'initialize is passed an Application'); + } + }); + + _emberMetal.run(function () { + app = MyApplication.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + }); + + QUnit.test('initializers can be registered in a specified order', function () { + var order = []; + var MyApplication = _emberApplicationSystemApplication.default.extend(); + MyApplication.initializer({ + name: 'fourth', + after: 'third', + initialize: function (registry) { + order.push('fourth'); + } + }); + + MyApplication.initializer({ + name: 'second', + after: 'first', + before: 'third', + initialize: function (registry) { + order.push('second'); + } + }); + + MyApplication.initializer({ + name: 'fifth', + after: 'fourth', + before: 'sixth', + initialize: function (registry) { + order.push('fifth'); + } + }); + + MyApplication.initializer({ + name: 'first', + before: 'second', + initialize: function (registry) { + order.push('first'); + } + }); + + MyApplication.initializer({ + name: 'third', + initialize: function (registry) { + order.push('third'); + } + }); + + MyApplication.initializer({ + name: 'sixth', + initialize: function (registry) { + order.push('sixth'); + } + }); + + _emberMetal.run(function () { + app = MyApplication.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + + deepEqual(order, ['first', 'second', 'third', 'fourth', 'fifth', 'sixth']); + }); + + QUnit.test('initializers can be registered in a specified order as an array', function () { + var order = []; + var MyApplication = _emberApplicationSystemApplication.default.extend(); + + MyApplication.initializer({ + name: 'third', + initialize: function (registry) { + order.push('third'); + } + }); + + MyApplication.initializer({ + name: 'second', + after: 'first', + before: ['third', 'fourth'], + initialize: function (registry) { + order.push('second'); + } + }); + + MyApplication.initializer({ + name: 'fourth', + after: ['second', 'third'], + initialize: function (registry) { + order.push('fourth'); + } + }); + + MyApplication.initializer({ + name: 'fifth', + after: 'fourth', + before: 'sixth', + initialize: function (registry) { + order.push('fifth'); + } + }); + + MyApplication.initializer({ + name: 'first', + before: ['second'], + initialize: function (registry) { + order.push('first'); + } + }); + + MyApplication.initializer({ + name: 'sixth', + initialize: function (registry) { + order.push('sixth'); + } + }); + + _emberMetal.run(function () { + app = MyApplication.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + + deepEqual(order, ['first', 'second', 'third', 'fourth', 'fifth', 'sixth']); + }); + + QUnit.test('initializers can have multiple dependencies', function () { + var order = []; + var a = { + name: 'a', + before: 'b', + initialize: function (registry) { + order.push('a'); + } + }; + var b = { + name: 'b', + initialize: function (registry) { + order.push('b'); + } + }; + var c = { + name: 'c', + after: 'b', + initialize: function (registry) { + order.push('c'); + } + }; + var afterB = { + name: 'after b', + after: 'b', + initialize: function (registry) { + order.push('after b'); + } + }; + var afterC = { + name: 'after c', + after: 'c', + initialize: function (registry) { + order.push('after c'); + } + }; + + _emberApplicationSystemApplication.default.initializer(b); + _emberApplicationSystemApplication.default.initializer(a); + _emberApplicationSystemApplication.default.initializer(afterC); + _emberApplicationSystemApplication.default.initializer(afterB); + _emberApplicationSystemApplication.default.initializer(c); + + _emberMetal.run(function () { + app = _emberApplicationSystemApplication.default.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + + ok(order.indexOf(a.name) < order.indexOf(b.name), 'a < b'); + ok(order.indexOf(b.name) < order.indexOf(c.name), 'b < c'); + ok(order.indexOf(b.name) < order.indexOf(afterB.name), 'b < afterB'); + ok(order.indexOf(c.name) < order.indexOf(afterC.name), 'c < afterC'); + }); + + QUnit.test('initializers set on Application subclasses are not shared between apps', function () { + var firstInitializerRunCount = 0; + var secondInitializerRunCount = 0; + var FirstApp = _emberApplicationSystemApplication.default.extend(); + + FirstApp.initializer({ + name: 'first', + initialize: function (registry) { + firstInitializerRunCount++; + } + }); + + var SecondApp = _emberApplicationSystemApplication.default.extend(); + + SecondApp.initializer({ + name: 'second', + initialize: function (registry) { + secondInitializerRunCount++; + } + }); + + _emberViews.jQuery('#qunit-fixture').html('
    '); + + var firstApp = _emberMetal.run(function () { + return FirstApp.create({ + router: false, + rootElement: '#qunit-fixture #first' + }); + }); + + equal(firstInitializerRunCount, 1, 'first initializer only was run'); + equal(secondInitializerRunCount, 0, 'first initializer only was run'); + + var secondApp = _emberMetal.run(function () { + return SecondApp.create({ + router: false, + rootElement: '#qunit-fixture #second' + }); + }); + + equal(firstInitializerRunCount, 1, 'second initializer only was run'); + equal(secondInitializerRunCount, 1, 'second initializer only was run'); + + _emberMetal.run(function () { + firstApp.destroy(); + secondApp.destroy(); + }); + }); + + QUnit.test('initializers are concatenated', function () { + var firstInitializerRunCount = 0; + var secondInitializerRunCount = 0; + var FirstApp = _emberApplicationSystemApplication.default.extend(); + + FirstApp.initializer({ + name: 'first', + initialize: function (registry) { + firstInitializerRunCount++; + } + }); + + var SecondApp = FirstApp.extend(); + SecondApp.initializer({ + name: 'second', + initialize: function (registry) { + secondInitializerRunCount++; + } + }); + + _emberViews.jQuery('#qunit-fixture').html('
    '); + var firstApp = _emberMetal.run(function () { + return FirstApp.create({ + router: false, + rootElement: '#qunit-fixture #first' + }); + }); + equal(firstInitializerRunCount, 1, 'first initializer only was run when base class created'); + equal(secondInitializerRunCount, 0, 'first initializer only was run when base class created'); + firstInitializerRunCount = 0; + + var secondApp = _emberMetal.run(function () { + return SecondApp.create({ + router: false, + rootElement: '#qunit-fixture #second' + }); + }); + + equal(firstInitializerRunCount, 1, 'first initializer was run when subclass created'); + equal(secondInitializerRunCount, 1, 'second initializers was run when subclass created'); + _emberMetal.run(function () { + firstApp.destroy(); + secondApp.destroy(); + }); + }); + + QUnit.test('initializers are per-app', function () { + expect(2); + + var FirstApp = _emberApplicationSystemApplication.default.extend(); + + FirstApp.initializer({ + name: 'abc', + initialize: function (app) {} + }); + + expectAssertion(function () { + FirstApp.initializer({ + name: 'abc', + initialize: function (app) {} + }); + }); + + var SecondApp = _emberApplicationSystemApplication.default.extend(); + SecondApp.instanceInitializer({ + name: 'abc', + initialize: function (app) {} + }); + + ok(true, 'Two apps can have initializers named the same.'); + }); + + QUnit.test('initializers are executed in their own context', function () { + expect(1); + var MyApplication = _emberApplicationSystemApplication.default.extend(); + + MyApplication.initializer({ + name: 'coolInitializer', + myProperty: 'cool', + initialize: function (application) { + equal(this.myProperty, 'cool', 'should have access to its own context'); + } + }); + + _emberMetal.run(function () { + app = MyApplication.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + }); + + QUnit.test('initializers throw a deprecation warning when receiving a second argument', function () { + expect(1); + + var MyApplication = _emberApplicationSystemApplication.default.extend(); + + MyApplication.initializer({ + name: 'deprecated', + initialize: function (registry, application) {} + }); + + expectDeprecation(function () { + _emberMetal.run(function () { + app = MyApplication.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + }, /The `initialize` method for Application initializer 'deprecated' should take only one argument - `App`, an instance of an `Application`./); + }); +}); +enifed('ember-application/tests/system/initializers_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/initializers_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/initializers_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/initializers_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/initializers_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/initializers_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/instance_initializers_test', ['exports', 'ember-metal', 'ember-application/system/application', 'ember-application/system/application-instance', 'ember-views'], function (exports, _emberMetal, _emberApplicationSystemApplication, _emberApplicationSystemApplicationInstance, _emberViews) { + 'use strict'; + + var app = undefined; + + QUnit.module('Ember.Application instance initializers', { + teardown: function () { + if (app) { + _emberMetal.run(function () { + return app.destroy(); + }); + } + } + }); + + QUnit.test('initializers require proper \'name\' and \'initialize\' properties', function () { + var MyApplication = _emberApplicationSystemApplication.default.extend(); + + expectAssertion(function () { + _emberMetal.run(function () { + MyApplication.instanceInitializer({ name: 'initializer' }); + }); + }); + + expectAssertion(function () { + _emberMetal.run(function () { + MyApplication.instanceInitializer({ initialize: function () {} }); + }); + }); + }); + + QUnit.test('initializers are passed an app instance', function () { + var MyApplication = _emberApplicationSystemApplication.default.extend(); + + MyApplication.instanceInitializer({ + name: 'initializer', + initialize: function (instance) { + ok(instance instanceof _emberApplicationSystemApplicationInstance.default, 'initialize is passed an application instance'); + } + }); + + _emberMetal.run(function () { + app = MyApplication.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + }); + + QUnit.test('initializers can be registered in a specified order', function () { + var order = []; + var MyApplication = _emberApplicationSystemApplication.default.extend(); + MyApplication.instanceInitializer({ + name: 'fourth', + after: 'third', + initialize: function (registry) { + order.push('fourth'); + } + }); + + MyApplication.instanceInitializer({ + name: 'second', + after: 'first', + before: 'third', + initialize: function (registry) { + order.push('second'); + } + }); + + MyApplication.instanceInitializer({ + name: 'fifth', + after: 'fourth', + before: 'sixth', + initialize: function (registry) { + order.push('fifth'); + } + }); + + MyApplication.instanceInitializer({ + name: 'first', + before: 'second', + initialize: function (registry) { + order.push('first'); + } + }); + + MyApplication.instanceInitializer({ + name: 'third', + initialize: function (registry) { + order.push('third'); + } + }); + + MyApplication.instanceInitializer({ + name: 'sixth', + initialize: function (registry) { + order.push('sixth'); + } + }); + + _emberMetal.run(function () { + app = MyApplication.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + + deepEqual(order, ['first', 'second', 'third', 'fourth', 'fifth', 'sixth']); + }); + + QUnit.test('initializers can be registered in a specified order as an array', function () { + var order = []; + var MyApplication = _emberApplicationSystemApplication.default.extend(); + + MyApplication.instanceInitializer({ + name: 'third', + initialize: function (registry) { + order.push('third'); + } + }); + + MyApplication.instanceInitializer({ + name: 'second', + after: 'first', + before: ['third', 'fourth'], + initialize: function (registry) { + order.push('second'); + } + }); + + MyApplication.instanceInitializer({ + name: 'fourth', + after: ['second', 'third'], + initialize: function (registry) { + order.push('fourth'); + } + }); + + MyApplication.instanceInitializer({ + name: 'fifth', + after: 'fourth', + before: 'sixth', + initialize: function (registry) { + order.push('fifth'); + } + }); + + MyApplication.instanceInitializer({ + name: 'first', + before: ['second'], + initialize: function (registry) { + order.push('first'); + } + }); + + MyApplication.instanceInitializer({ + name: 'sixth', + initialize: function (registry) { + order.push('sixth'); + } + }); + + _emberMetal.run(function () { + app = MyApplication.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + + deepEqual(order, ['first', 'second', 'third', 'fourth', 'fifth', 'sixth']); + }); + + QUnit.test('initializers can have multiple dependencies', function () { + var order = []; + var a = { + name: 'a', + before: 'b', + initialize: function (registry) { + order.push('a'); + } + }; + var b = { + name: 'b', + initialize: function (registry) { + order.push('b'); + } + }; + var c = { + name: 'c', + after: 'b', + initialize: function (registry) { + order.push('c'); + } + }; + var afterB = { + name: 'after b', + after: 'b', + initialize: function (registry) { + order.push('after b'); + } + }; + var afterC = { + name: 'after c', + after: 'c', + initialize: function (registry) { + order.push('after c'); + } + }; + + _emberApplicationSystemApplication.default.instanceInitializer(b); + _emberApplicationSystemApplication.default.instanceInitializer(a); + _emberApplicationSystemApplication.default.instanceInitializer(afterC); + _emberApplicationSystemApplication.default.instanceInitializer(afterB); + _emberApplicationSystemApplication.default.instanceInitializer(c); + + _emberMetal.run(function () { + app = _emberApplicationSystemApplication.default.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + + ok(order.indexOf(a.name) < order.indexOf(b.name), 'a < b'); + ok(order.indexOf(b.name) < order.indexOf(c.name), 'b < c'); + ok(order.indexOf(b.name) < order.indexOf(afterB.name), 'b < afterB'); + ok(order.indexOf(c.name) < order.indexOf(afterC.name), 'c < afterC'); + }); + + QUnit.test('initializers set on Application subclasses should not be shared between apps', function () { + var firstInitializerRunCount = 0; + var secondInitializerRunCount = 0; + var FirstApp = _emberApplicationSystemApplication.default.extend(); + var firstApp = undefined, + secondApp = undefined; + + FirstApp.instanceInitializer({ + name: 'first', + initialize: function (registry) { + firstInitializerRunCount++; + } + }); + var SecondApp = _emberApplicationSystemApplication.default.extend(); + SecondApp.instanceInitializer({ + name: 'second', + initialize: function (registry) { + secondInitializerRunCount++; + } + }); + _emberViews.jQuery('#qunit-fixture').html('
    '); + _emberMetal.run(function () { + firstApp = FirstApp.create({ + router: false, + rootElement: '#qunit-fixture #first' + }); + }); + equal(firstInitializerRunCount, 1, 'first initializer only was run'); + equal(secondInitializerRunCount, 0, 'first initializer only was run'); + _emberMetal.run(function () { + secondApp = SecondApp.create({ + router: false, + rootElement: '#qunit-fixture #second' + }); + }); + equal(firstInitializerRunCount, 1, 'second initializer only was run'); + equal(secondInitializerRunCount, 1, 'second initializer only was run'); + _emberMetal.run(function () { + firstApp.destroy(); + secondApp.destroy(); + }); + }); + + QUnit.test('initializers are concatenated', function () { + var firstInitializerRunCount = 0; + var secondInitializerRunCount = 0; + var FirstApp = _emberApplicationSystemApplication.default.extend(); + var firstApp = undefined, + secondApp = undefined; + + FirstApp.instanceInitializer({ + name: 'first', + initialize: function (registry) { + firstInitializerRunCount++; + } + }); + + var SecondApp = FirstApp.extend(); + SecondApp.instanceInitializer({ + name: 'second', + initialize: function (registry) { + secondInitializerRunCount++; + } + }); + + _emberViews.jQuery('#qunit-fixture').html('
    '); + _emberMetal.run(function () { + firstApp = FirstApp.create({ + router: false, + rootElement: '#qunit-fixture #first' + }); + }); + equal(firstInitializerRunCount, 1, 'first initializer only was run when base class created'); + equal(secondInitializerRunCount, 0, 'first initializer only was run when base class created'); + firstInitializerRunCount = 0; + _emberMetal.run(function () { + secondApp = SecondApp.create({ + router: false, + rootElement: '#qunit-fixture #second' + }); + }); + equal(firstInitializerRunCount, 1, 'first initializer was run when subclass created'); + equal(secondInitializerRunCount, 1, 'second initializers was run when subclass created'); + _emberMetal.run(function () { + firstApp.destroy(); + secondApp.destroy(); + }); + }); + + QUnit.test('initializers are per-app', function () { + expect(2); + + var FirstApp = _emberApplicationSystemApplication.default.extend(); + + FirstApp.instanceInitializer({ + name: 'abc', + initialize: function (app) {} + }); + + expectAssertion(function () { + FirstApp.instanceInitializer({ + name: 'abc', + initialize: function (app) {} + }); + }); + + var SecondApp = _emberApplicationSystemApplication.default.extend(); + SecondApp.instanceInitializer({ + name: 'abc', + initialize: function (app) {} + }); + + ok(true, 'Two apps can have initializers named the same.'); + }); + + QUnit.test('initializers are run before ready hook', function () { + expect(2); + + var readyWasCalled = false; + + var MyApplication = _emberApplicationSystemApplication.default.extend({ + ready: function () { + ok(true, 'ready is called'); + readyWasCalled = true; + } + }); + + MyApplication.instanceInitializer({ + name: 'initializer', + initialize: function () { + ok(!readyWasCalled, 'ready is not yet called'); + } + }); + + _emberMetal.run(function () { + app = MyApplication.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + }); + + QUnit.test('initializers are executed in their own context', function () { + expect(1); + + var MyApplication = _emberApplicationSystemApplication.default.extend(); + + MyApplication.instanceInitializer({ + name: 'coolInitializer', + myProperty: 'cool', + initialize: function (registry, application) { + equal(this.myProperty, 'cool', 'should have access to its own context'); + } + }); + + _emberMetal.run(function () { + app = MyApplication.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + }); + + QUnit.test('initializers get an instance on app reset', function () { + expect(2); + + var MyApplication = _emberApplicationSystemApplication.default.extend(); + + MyApplication.instanceInitializer({ + name: 'giveMeAnInstance', + initialize: function (instance) { + ok(!!instance, 'Initializer got an instance'); + } + }); + + _emberMetal.run(function () { + app = MyApplication.create({ + router: false, + rootElement: '#qunit-fixture' + }); + }); + + _emberMetal.run(app, 'reset'); + }); +}); +enifed('ember-application/tests/system/instance_initializers_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/instance_initializers_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/instance_initializers_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/instance_initializers_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/instance_initializers_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/instance_initializers_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/logging_test', ['exports', 'ember-console', 'ember-metal', 'ember-application/system/application', 'ember-runtime', 'ember-routing', 'ember-template-compiler'], function (exports, _emberConsole, _emberMetal, _emberApplicationSystemApplication, _emberRuntime, _emberRouting, _emberTemplateCompiler) { + /*globals EmberDev */ + + 'use strict'; + + var App = undefined, + logs = undefined, + originalLogger = undefined; + + QUnit.module('Ember.Application – logging of generated classes', { + setup: function () { + logs = {}; + + originalLogger = _emberConsole.default.info; + + _emberConsole.default.info = function () { + var fullName = arguments[1].fullName; + + logs[fullName] = logs[fullName] || 0; + logs[fullName]++; + }; + + _emberMetal.run(function () { + App = _emberApplicationSystemApplication.default.create({ + LOG_ACTIVE_GENERATION: true + }); + + App.Router.reopen({ + location: 'none' + }); + + App.Router.map(function () { + this.route('posts', { resetNamespace: true }); + }); + + App.deferReadiness(); + }); + }, + + teardown: function () { + _emberConsole.default.info = originalLogger; + + _emberMetal.run(App, 'destroy'); + + logs = App = null; + } + }); + + function visit(path) { + QUnit.stop(); + + var promise = _emberMetal.run(function () { + return new _emberRuntime.RSVP.Promise(function (resolve, reject) { + var router = App.__container__.lookup('router:main'); + + resolve(router.handleURL(path).then(function (value) { + QUnit.start(); + ok(true, 'visited: `' + path + '`'); + return value; + }, function (reason) { + QUnit.start(); + ok(false, 'failed to visit:`' + path + '` reason: `' + QUnit.jsDump.parse(reason)); + throw reason; + })); + }); + }); + + return { + then: function (resolve, reject) { + _emberMetal.run(promise, 'then', resolve, reject); + } + }; + } + + QUnit.test('log class generation if logging enabled', function () { + if (EmberDev && EmberDev.runningProdBuild) { + ok(true, 'Logging does not occur in production builds'); + return; + } + + _emberMetal.run(App, 'advanceReadiness'); + + visit('/posts').then(function () { + equal(Object.keys(logs).length, 6, 'expected logs'); + }); + }); + + QUnit.test('do NOT log class generation if logging disabled', function () { + App.reopen({ + LOG_ACTIVE_GENERATION: false + }); + + _emberMetal.run(App, 'advanceReadiness'); + + visit('/posts').then(function () { + equal(Object.keys(logs).length, 0, 'expected no logs'); + }); + }); + + QUnit.test('actively generated classes get logged', function () { + if (EmberDev && EmberDev.runningProdBuild) { + ok(true, 'Logging does not occur in production builds'); + return; + } + + _emberMetal.run(App, 'advanceReadiness'); + + visit('/posts').then(function () { + equal(logs['controller:application'], 1, 'expected: ApplicationController was generated'); + equal(logs['controller:posts'], 1, 'expected: PostsController was generated'); + + equal(logs['route:application'], 1, 'expected: ApplicationRoute was generated'); + equal(logs['route:posts'], 1, 'expected: PostsRoute was generated'); + }); + }); + + QUnit.test('predefined classes do not get logged', function () { + App.ApplicationController = _emberRuntime.Controller.extend(); + App.PostsController = _emberRuntime.Controller.extend(); + + App.ApplicationRoute = _emberRouting.Route.extend(); + App.PostsRoute = _emberRouting.Route.extend(); + + _emberMetal.run(App, 'advanceReadiness'); + + visit('/posts').then(function () { + ok(!logs['controller:application'], 'did not expect: ApplicationController was generated'); + ok(!logs['controller:posts'], 'did not expect: PostsController was generated'); + + ok(!logs['route:application'], 'did not expect: ApplicationRoute was generated'); + ok(!logs['route:posts'], 'did not expect: PostsRoute was generated'); + }); + }); + + QUnit.module('Ember.Application – logging of view lookups', { + setup: function () { + logs = {}; + + originalLogger = _emberConsole.default.info; + + _emberConsole.default.info = function () { + var fullName = arguments[1].fullName; + + logs[fullName] = logs[fullName] || 0; + logs[fullName]++; + }; + + _emberMetal.run(function () { + App = _emberApplicationSystemApplication.default.create({ + LOG_VIEW_LOOKUPS: true + }); + + App.Router.reopen({ + location: 'none' + }); + + App.Router.map(function () { + this.route('posts', { resetNamespace: true }); + }); + + App.deferReadiness(); + }); + }, + + teardown: function () { + _emberConsole.default.info = originalLogger; + + _emberMetal.run(App, 'destroy'); + + logs = App = null; + } + }); + + QUnit.test('log when template and view are missing when flag is active', function () { + if (EmberDev && EmberDev.runningProdBuild) { + ok(true, 'Logging does not occur in production builds'); + return; + } + + App.register('template:application', _emberTemplateCompiler.compile('{{outlet}}')); + _emberMetal.run(App, 'advanceReadiness'); + + visit('/posts').then(function () { + equal(logs['template:application'], undefined, 'expected: Should not log template:application since it exists.'); + equal(logs['template:index'], 1, 'expected: Could not find "index" template or view.'); + equal(logs['template:posts'], 1, 'expected: Could not find "posts" template or view.'); + }); + }); + + QUnit.test('do not log when template and view are missing when flag is not true', function () { + App.reopen({ + LOG_VIEW_LOOKUPS: false + }); + + _emberMetal.run(App, 'advanceReadiness'); + + visit('/posts').then(function () { + equal(Object.keys(logs).length, 0, 'expected no logs'); + }); + }); + + QUnit.test('do not log which views are used with templates when flag is not true', function () { + App.reopen({ + LOG_VIEW_LOOKUPS: false + }); + + _emberMetal.run(App, 'advanceReadiness'); + + visit('/posts').then(function () { + equal(Object.keys(logs).length, 0, 'expected no logs'); + }); + }); +}); +enifed('ember-application/tests/system/logging_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/logging_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/logging_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/logging_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/logging_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/logging_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/readiness_test', ['exports', 'ember-metal', 'ember-application/system/application'], function (exports, _emberMetal, _emberApplicationSystemApplication) { + 'use strict'; + + var jQuery = undefined, + application = undefined, + Application = undefined; + var readyWasCalled = undefined, + domReady = undefined, + readyCallbacks = undefined; + + // We are using a small mock of jQuery because jQuery is third-party code with + // very well-defined semantics, and we want to confirm that a jQuery stub run + // in a more minimal server environment that implements this behavior will be + // sufficient for Ember's requirements. + + QUnit.module('Application readiness', { + setup: function () { + readyWasCalled = 0; + readyCallbacks = []; + + var jQueryInstance = { + ready: function (callback) { + readyCallbacks.push(callback); + if (jQuery.isReady) { + domReady(); + } + } + }; + + jQuery = function () { + return jQueryInstance; + }; + jQuery.isReady = false; + + var domReadyCalled = 0; + domReady = function () { + if (domReadyCalled !== 0) { + return; + } + domReadyCalled++; + for (var i = 0; i < readyCallbacks.length; i++) { + readyCallbacks[i](); + } + }; + + Application = _emberApplicationSystemApplication.default.extend({ + $: jQuery, + + ready: function () { + readyWasCalled++; + } + }); + }, + + teardown: function () { + if (application) { + _emberMetal.run(function () { + return application.destroy(); + }); + } + } + }); + + // These tests are confirming that if the callbacks passed into jQuery's ready hook is called + // synchronously during the application's initialization, we get the same behavior as if + // it was triggered after initialization. + + QUnit.test('Ember.Application\'s ready event is called right away if jQuery is already ready', function () { + jQuery.isReady = true; + + _emberMetal.run(function () { + application = Application.create({ router: false }); + + equal(readyWasCalled, 0, 'ready is not called until later'); + }); + + equal(readyWasCalled, 1, 'ready was called'); + + domReady(); + + equal(readyWasCalled, 1, 'application\'s ready was not called again'); + }); + + QUnit.test('Ember.Application\'s ready event is called after the document becomes ready', function () { + _emberMetal.run(function () { + application = Application.create({ router: false }); + }); + + equal(readyWasCalled, 0, 'ready wasn\'t called yet'); + + domReady(); + + equal(readyWasCalled, 1, 'ready was called now that DOM is ready'); + }); + + QUnit.test('Ember.Application\'s ready event can be deferred by other components', function () { + _emberMetal.run(function () { + application = Application.create({ router: false }); + application.deferReadiness(); + }); + + equal(readyWasCalled, 0, 'ready wasn\'t called yet'); + + domReady(); + + equal(readyWasCalled, 0, 'ready wasn\'t called yet'); + + _emberMetal.run(function () { + application.advanceReadiness(); + equal(readyWasCalled, 0); + }); + + equal(readyWasCalled, 1, 'ready was called now all readiness deferrals are advanced'); + }); + + QUnit.test('Ember.Application\'s ready event can be deferred by other components', function () { + jQuery.isReady = false; + + _emberMetal.run(function () { + application = Application.create({ router: false }); + application.deferReadiness(); + equal(readyWasCalled, 0, 'ready wasn\'t called yet'); + }); + + domReady(); + + equal(readyWasCalled, 0, 'ready wasn\'t called yet'); + + _emberMetal.run(function () { + application.advanceReadiness(); + }); + + equal(readyWasCalled, 1, 'ready was called now all readiness deferrals are advanced'); + + expectAssertion(function () { + application.deferReadiness(); + }); + }); +}); +enifed('ember-application/tests/system/readiness_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/readiness_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/readiness_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/readiness_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/readiness_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/readiness_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/reset_test', ['exports', 'ember-metal', 'ember-application/system/application', 'ember-runtime', 'ember-routing', 'container'], function (exports, _emberMetal, _emberApplicationSystemApplication, _emberRuntime, _emberRouting, _container) { + 'use strict'; + + var application = undefined, + Application = undefined; + + QUnit.module('Ember.Application - resetting', { + setup: function () { + Application = _emberApplicationSystemApplication.default.extend({ + name: 'App', + rootElement: '#qunit-fixture' + }); + }, + teardown: function () { + Application = null; + if (application) { + _emberMetal.run(application, 'destroy'); + } + } + }); + + QUnit.test('Brings its own run-loop if not provided', function () { + application = _emberMetal.run(Application, 'create'); + application.ready = function () { + QUnit.start(); + ok(true, 'app booted'); + }; + + QUnit.stop(); + application.reset(); + }); + + QUnit.test('Does not bring its own run loop if one is already provided', function () { + expect(3); + + var didBecomeReady = false; + + application = _emberMetal.run(Application, 'create'); + + _emberMetal.run(function () { + application.ready = function () { + didBecomeReady = true; + }; + + application.reset(); + + application.deferReadiness(); + ok(!didBecomeReady, 'app is not ready'); + }); + + ok(!didBecomeReady, 'app is not ready'); + _emberMetal.run(application, 'advanceReadiness'); + ok(didBecomeReady, 'app is ready'); + }); + + QUnit.test('When an application is reset, new instances of controllers are generated', function () { + _emberMetal.run(function () { + application = Application.create(); + application.AcademicController = _emberRuntime.Controller.extend(); + }); + + var firstController = application.__container__.lookup('controller:academic'); + var secondController = application.__container__.lookup('controller:academic'); + + application.reset(); + + var thirdController = application.__container__.lookup('controller:academic'); + + strictEqual(firstController, secondController, 'controllers looked up in succession should be the same instance'); + + ok(firstController.isDestroying, 'controllers are destroyed when their application is reset'); + + notStrictEqual(firstController, thirdController, 'controllers looked up after the application is reset should not be the same instance'); + }); + + QUnit.test('When an application is reset, the eventDispatcher is destroyed and recreated', function () { + var eventDispatcherWasSetup = undefined, + eventDispatcherWasDestroyed = undefined; + + eventDispatcherWasSetup = 0; + eventDispatcherWasDestroyed = 0; + + var mock_event_dispatcher = { + create: function () { + return { + setup: function () { + eventDispatcherWasSetup++; + }, + destroy: function () { + eventDispatcherWasDestroyed++; + } + }; + } + }; + + // this is pretty awful. We should make this less Global-ly. + var originalRegister = _container.Registry.prototype.register; + _container.Registry.prototype.register = function (name, type, options) { + if (name === 'event_dispatcher:main') { + return mock_event_dispatcher; + } else { + return originalRegister.call(this, name, type, options); + } + }; + + try { + _emberMetal.run(function () { + application = Application.create(); + + equal(eventDispatcherWasSetup, 0); + equal(eventDispatcherWasDestroyed, 0); + }); + + equal(eventDispatcherWasSetup, 1); + equal(eventDispatcherWasDestroyed, 0); + + application.reset(); + + equal(eventDispatcherWasDestroyed, 1); + equal(eventDispatcherWasSetup, 2, 'setup called after reset'); + } catch (error) { + _container.Registry.prototype.register = originalRegister; + } + + _container.Registry.prototype.register = originalRegister; + }); + + QUnit.test('When an application is reset, the router URL is reset to `/`', function () { + var location = undefined, + router = undefined; + + _emberMetal.run(function () { + application = Application.create(); + application.Router = _emberRouting.Router.extend({ + location: 'none' + }); + + application.Router.map(function () { + this.route('one'); + this.route('two'); + }); + }); + + router = application.__container__.lookup('router:main'); + + location = router.get('location'); + + _emberMetal.run(function () { + location.handleURL('/one'); + }); + + application.reset(); + + var applicationController = application.__container__.lookup('controller:application'); + router = application.__container__.lookup('router:main'); + location = router.get('location'); + + equal(location.getURL(), ''); + + equal(_emberMetal.get(applicationController, 'currentPath'), 'index'); + + location = application.__container__.lookup('router:main').get('location'); + _emberMetal.run(function () { + location.handleURL('/one'); + }); + + equal(_emberMetal.get(applicationController, 'currentPath'), 'one'); + }); + + QUnit.test('When an application with advance/deferReadiness is reset, the app does correctly become ready after reset', function () { + var readyCallCount; + + readyCallCount = 0; + + _emberMetal.run(function () { + application = Application.create({ + ready: function () { + readyCallCount++; + } + }); + + application.deferReadiness(); + equal(readyCallCount, 0, 'ready has not yet been called'); + }); + + _emberMetal.run(function () { + application.advanceReadiness(); + }); + + equal(readyCallCount, 1, 'ready was called once'); + + application.reset(); + + equal(readyCallCount, 2, 'ready was called twice'); + }); + + QUnit.test('With ember-data like initializer and constant', function () { + var readyCallCount = undefined; + + readyCallCount = 0; + + var DS = { + Store: _emberRuntime.Object.extend({ + init: function () { + if (!_emberMetal.get(DS, 'defaultStore')) { + _emberMetal.set(DS, 'defaultStore', this); + } + + this._super.apply(this, arguments); + }, + willDestroy: function () { + if (_emberMetal.get(DS, 'defaultStore') === this) { + _emberMetal.set(DS, 'defaultStore', null); + } + } + }) + }; + + Application.initializer({ + name: 'store', + initialize: function (application) { + application.unregister('store:main'); + application.register('store:main', application.Store); + + application.__container__.lookup('store:main'); + } + }); + + _emberMetal.run(function () { + application = Application.create(); + application.Store = DS.Store; + }); + + ok(DS.defaultStore, 'has defaultStore'); + + application.reset(); + + ok(DS.defaultStore, 'still has defaultStore'); + ok(application.__container__.lookup('store:main'), 'store is still present'); + }); +}); +enifed('ember-application/tests/system/reset_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/reset_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/reset_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/reset_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/reset_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/reset_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/system/visit_test', ['exports', 'ember-runtime', 'ember-metal', 'ember-application/system/application', 'ember-application/system/application-instance', 'ember-application/system/engine', 'ember-routing', 'ember-glimmer', 'ember-template-compiler', 'ember-views'], function (exports, _emberRuntime, _emberMetal, _emberApplicationSystemApplication, _emberApplicationSystemApplicationInstance, _emberApplicationSystemEngine, _emberRouting, _emberGlimmer, _emberTemplateCompiler, _emberViews) { + 'use strict'; + + var App = null; + var instance = null; + var instances = []; + + function createApplication(integration) { + App = _emberApplicationSystemApplication.default.extend().create({ + autoboot: false, + rootElement: '#qunit-fixture', + LOG_TRANSITIONS: true, + LOG_TRANSITIONS_INTERNAL: true, + LOG_ACTIVE_GENERATION: true + }); + + App.Router = _emberRouting.Router.extend({ + location: 'none' + }); + + if (integration) { + App.instanceInitializer({ + name: 'auto-cleanup', + initialize: function (_instance) { + instances.push(_instance); + } + }); + } else { + App.instanceInitializer({ + name: 'auto-cleanup', + initialize: function (_instance) { + if (instance) { + _emberMetal.run(instance, 'destroy'); + } + + instance = _instance; + } + }); + } + + return App; + } + + function expectAsyncError() { + _emberRuntime.RSVP.off('error'); + } + + QUnit.module('Ember.Application - visit()', { + teardown: function () { + _emberRuntime.RSVP.on('error', _emberRuntime.onerrorDefault); + + if (instance) { + _emberMetal.run(instance, 'destroy'); + instance = null; + } + + if (App) { + _emberMetal.run(App, 'destroy'); + App = null; + } + } + }); + + // This tests whether the application is "autobooted" by registering an + // instance initializer and asserting it never gets run. Since this is + // inherently testing that async behavior *doesn't* happen, we set a + // 500ms timeout to verify that when autoboot is set to false, the + // instance initializer that would normally get called on DOM ready + // does not fire. + QUnit.test('Applications with autoboot set to false do not autoboot', function (assert) { + function delay(time) { + return new _emberRuntime.RSVP.Promise(function (resolve) { + return _emberMetal.run.later(resolve, time); + }); + } + + var appBooted = 0; + var instanceBooted = 0; + + _emberMetal.run(function () { + createApplication(); + + App.initializer({ + name: 'assert-no-autoboot', + initialize: function () { + appBooted++; + } + }); + + App.instanceInitializer({ + name: 'assert-no-autoboot', + initialize: function () { + instanceBooted++; + } + }); + }); + + // Continue after 500ms + return delay(500).then(function () { + assert.ok(appBooted === 0, '500ms elapsed without app being booted'); + assert.ok(instanceBooted === 0, '500ms elapsed without instances being booted'); + + return _emberMetal.run(App, 'boot'); + }).then(function () { + assert.ok(appBooted === 1, 'app should boot when manually calling `app.boot()`'); + assert.ok(instanceBooted === 0, 'no instances should be booted automatically when manually calling `app.boot()'); + }); + }); + + QUnit.test('calling visit() on an app without first calling boot() should boot the app', function (assert) { + var appBooted = 0; + var instanceBooted = 0; + + _emberMetal.run(function () { + createApplication(); + + App.initializer({ + name: 'assert-no-autoboot', + initialize: function () { + appBooted++; + } + }); + + App.instanceInitializer({ + name: 'assert-no-autoboot', + initialize: function () { + instanceBooted++; + } + }); + }); + + return _emberMetal.run(App, 'visit', '/').then(function () { + assert.ok(appBooted === 1, 'the app should be booted`'); + assert.ok(instanceBooted === 1, 'an instances should be booted'); + }); + }); + + QUnit.test('calling visit() on an already booted app should not boot it again', function (assert) { + var appBooted = 0; + var instanceBooted = 0; + + _emberMetal.run(function () { + createApplication(); + + App.initializer({ + name: 'assert-no-autoboot', + initialize: function () { + appBooted++; + } + }); + + App.instanceInitializer({ + name: 'assert-no-autoboot', + initialize: function () { + instanceBooted++; + } + }); + }); + + return _emberMetal.run(App, 'boot').then(function () { + assert.ok(appBooted === 1, 'the app should be booted'); + assert.ok(instanceBooted === 0, 'no instances should be booted'); + + return _emberMetal.run(App, 'visit', '/'); + }).then(function () { + assert.ok(appBooted === 1, 'the app should not be booted again'); + assert.ok(instanceBooted === 1, 'an instance should be booted'); + + return _emberMetal.run(App, 'visit', '/'); + }).then(function () { + assert.ok(appBooted === 1, 'the app should not be booted again'); + assert.ok(instanceBooted === 2, 'another instance should be booted'); + }); + }); + + QUnit.test('visit() rejects on application boot failure', function (assert) { + _emberMetal.run(function () { + createApplication(); + + App.initializer({ + name: 'error', + initialize: function () { + throw new Error('boot failure'); + } + }); + }); + + expectAsyncError(); + + return _emberMetal.run(App, 'visit', '/').then(function () { + assert.ok(false, 'It should not resolve the promise'); + }, function (error) { + assert.ok(error instanceof Error, 'It should reject the promise with the boot error'); + assert.equal(error.message, 'boot failure'); + }); + }); + + QUnit.test('visit() rejects on instance boot failure', function (assert) { + _emberMetal.run(function () { + createApplication(); + + App.instanceInitializer({ + name: 'error', + initialize: function () { + throw new Error('boot failure'); + } + }); + }); + + expectAsyncError(); + + return _emberMetal.run(App, 'visit', '/').then(function () { + assert.ok(false, 'It should not resolve the promise'); + }, function (error) { + assert.ok(error instanceof Error, 'It should reject the promise with the boot error'); + assert.equal(error.message, 'boot failure'); + }); + }); + + QUnit.test('visit() follows redirects', function (assert) { + _emberMetal.run(function () { + createApplication(); + + App.Router.map(function () { + this.route('a'); + this.route('b', { path: '/b/:b' }); + this.route('c', { path: '/c/:c' }); + }); + + App.register('route:a', _emberRouting.Route.extend({ + afterModel: function () { + this.replaceWith('b', 'zomg'); + } + })); + + App.register('route:b', _emberRouting.Route.extend({ + afterModel: function (params) { + this.transitionTo('c', params.b); + } + })); + }); + + return _emberMetal.run(App, 'visit', '/a').then(function (instance) { + assert.ok(instance instanceof _emberApplicationSystemApplicationInstance.default, 'promise is resolved with an ApplicationInstance'); + assert.equal(instance.getURL(), '/c/zomg', 'It should follow all redirects'); + }); + }); + + QUnit.test('visit() rejects if an error occured during a transition', function (assert) { + _emberMetal.run(function () { + createApplication(); + + App.Router.map(function () { + this.route('a'); + this.route('b', { path: '/b/:b' }); + this.route('c', { path: '/c/:c' }); + }); + + App.register('route:a', _emberRouting.Route.extend({ + afterModel: function () { + this.replaceWith('b', 'zomg'); + } + })); + + App.register('route:b', _emberRouting.Route.extend({ + afterModel: function (params) { + this.transitionTo('c', params.b); + } + })); + + App.register('route:c', _emberRouting.Route.extend({ + afterModel: function (params) { + throw new Error('transition failure'); + } + })); + }); + + expectAsyncError(); + + return _emberMetal.run(App, 'visit', '/a').then(function () { + assert.ok(false, 'It should not resolve the promise'); + }, function (error) { + assert.ok(error instanceof Error, 'It should reject the promise with the boot error'); + assert.equal(error.message, 'transition failure'); + }); + }); + + QUnit.test('visit() chain', function (assert) { + _emberMetal.run(function () { + createApplication(); + + App.Router.map(function () { + this.route('a'); + this.route('b'); + this.route('c'); + }); + }); + + return _emberMetal.run(App, 'visit', '/').then(function (instance) { + assert.ok(instance instanceof _emberApplicationSystemApplicationInstance.default, 'promise is resolved with an ApplicationInstance'); + assert.equal(instance.getURL(), '/'); + + return instance.visit('/a'); + }).then(function (instance) { + assert.ok(instance instanceof _emberApplicationSystemApplicationInstance.default, 'promise is resolved with an ApplicationInstance'); + assert.equal(instance.getURL(), '/a'); + + return instance.visit('/b'); + }).then(function (instance) { + assert.ok(instance instanceof _emberApplicationSystemApplicationInstance.default, 'promise is resolved with an ApplicationInstance'); + assert.equal(instance.getURL(), '/b'); + + return instance.visit('/c'); + }).then(function (instance) { + assert.ok(instance instanceof _emberApplicationSystemApplicationInstance.default, 'promise is resolved with an ApplicationInstance'); + assert.equal(instance.getURL(), '/c'); + }); + }); + + QUnit.test('visit() returns a promise that resolves when the view has rendered', function (assert) { + _emberMetal.run(function () { + createApplication(); + + App.register('template:application', _emberTemplateCompiler.compile('

    Hello world

    ')); + }); + + assert.strictEqual(_emberViews.jQuery('#qunit-fixture').children().length, 0, 'there are no elements in the fixture element'); + + return _emberMetal.run(App, 'visit', '/').then(function (instance) { + assert.ok(instance instanceof _emberApplicationSystemApplicationInstance.default, 'promise is resolved with an ApplicationInstance'); + assert.equal(_emberViews.jQuery('#qunit-fixture > .ember-view h1').text(), 'Hello world', 'the application was rendered once the promise resolves'); + }); + }); + + QUnit.test('visit() returns a promise that resolves without rendering when shouldRender is set to false', function (assert) { + assert.expect(3); + + _emberMetal.run(function () { + createApplication(); + + App.register('template:application', _emberTemplateCompiler.compile('

    Hello world

    ')); + }); + + assert.strictEqual(_emberViews.jQuery('#qunit-fixture').children().length, 0, 'there are no elements in the fixture element'); + + return _emberMetal.run(App, 'visit', '/', { shouldRender: false }).then(function (instance) { + assert.ok(instance instanceof _emberApplicationSystemApplicationInstance.default, 'promise is resolved with an ApplicationInstance'); + assert.strictEqual(_emberViews.jQuery('#qunit-fixture').children().length, 0, 'there are still no elements in the fixture element after visit'); + }); + }); + + QUnit.test('visit() renders a template when shouldRender is set to true', function (assert) { + assert.expect(3); + + _emberMetal.run(function () { + createApplication(); + + App.register('template:application', _emberTemplateCompiler.compile('

    Hello world

    ')); + }); + + assert.strictEqual(_emberViews.jQuery('#qunit-fixture').children().length, 0, 'there are no elements in the fixture element'); + + return _emberMetal.run(App, 'visit', '/', { shouldRender: true }).then(function (instance) { + assert.ok(instance instanceof _emberApplicationSystemApplicationInstance.default, 'promise is resolved with an ApplicationInstance'); + assert.strictEqual(_emberViews.jQuery('#qunit-fixture').children().length, 1, 'there is 1 element in the fixture element after visit'); + }); + }); + + QUnit.test('visit() returns a promise that resolves without rendering when shouldRender is set to false with Engines', function (assert) { + assert.expect(3); + + _emberMetal.run(function () { + createApplication(); + + App.register('template:application', _emberTemplateCompiler.compile('

    Hello world

    ')); + + // Register engine + var BlogEngine = _emberApplicationSystemEngine.default.extend(); + App.register('engine:blog', BlogEngine); + + // Register engine route map + var BlogMap = function () {}; + App.register('route-map:blog', BlogMap); + + App.Router.map(function () { + this.mount('blog'); + }); + }); + + assert.strictEqual(_emberViews.jQuery('#qunit-fixture').children().length, 0, 'there are no elements in the fixture element'); + + return _emberMetal.run(App, 'visit', '/blog', { shouldRender: false }).then(function (instance) { + assert.ok(instance instanceof _emberApplicationSystemApplicationInstance.default, 'promise is resolved with an ApplicationInstance'); + assert.strictEqual(_emberViews.jQuery('#qunit-fixture').children().length, 0, 'there are still no elements in the fixture element after visit'); + }); + }); + + QUnit.test('visit() on engine resolves engine component', function (assert) { + assert.expect(2); + + _emberMetal.run(function () { + createApplication(); + + // Register engine + var BlogEngine = _emberApplicationSystemEngine.default.extend({ + init: function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + this._super.apply(this, args); + this.register('template:application', _emberTemplateCompiler.compile('{{cache-money}}')); + this.register('template:components/cache-money', _emberTemplateCompiler.compile('\n

    Dis cache money

    \n ')); + this.register('component:cache-money', _emberGlimmer.Component.extend({})); + } + }); + App.register('engine:blog', BlogEngine); + + // Register engine route map + var BlogMap = function () {}; + App.register('route-map:blog', BlogMap); + + App.Router.map(function () { + this.mount('blog'); + }); + }); + + assert.strictEqual(_emberViews.jQuery('#qunit-fixture').children().length, 0, 'there are no elements in the fixture element'); + + return _emberMetal.run(App, 'visit', '/blog', { shouldRender: true }).then(function (instance) { + assert.strictEqual(_emberViews.jQuery('#qunit-fixture').find('p').text(), 'Dis cache money', 'Engine component is resolved'); + }); + }); + + QUnit.test('visit() on engine resolves engine helper', function (assert) { + assert.expect(2); + + _emberMetal.run(function () { + createApplication(); + + // Register engine + var BlogEngine = _emberApplicationSystemEngine.default.extend({ + init: function () { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + this._super.apply(this, args); + this.register('template:application', _emberTemplateCompiler.compile('{{swag}}')); + this.register('helper:swag', _emberGlimmer.helper(function () { + return 'turnt up'; + })); + } + }); + App.register('engine:blog', BlogEngine); + + // Register engine route map + var BlogMap = function () {}; + App.register('route-map:blog', BlogMap); + + App.Router.map(function () { + this.mount('blog'); + }); + }); + + assert.strictEqual(_emberViews.jQuery('#qunit-fixture').children().length, 0, 'there are no elements in the fixture element'); + + return _emberMetal.run(App, 'visit', '/blog', { shouldRender: true }).then(function (instance) { + assert.strictEqual(_emberViews.jQuery('#qunit-fixture').text(), 'turnt up', 'Engine component is resolved'); + }); + }); + + QUnit.module('Ember.Application - visit() Integration Tests', { + teardown: function () { + if (instances) { + _emberMetal.run(instances, 'forEach', function (i) { + return i.destroy(); + }); + instances = []; + } + + if (App) { + _emberMetal.run(App, 'destroy'); + App = null; + } + } + }); + + QUnit.test('Ember Islands-style setup', function (assert) { + var xFooInitCalled = false; + var xFooDidInsertElementCalled = false; + + var xBarInitCalled = false; + var xBarDidInsertElementCalled = false; + + _emberMetal.run(function () { + createApplication(true); + + App.Router.map(function () { + this.route('show', { path: '/:component_name' }); + }); + + App.register('route:show', _emberRouting.Route.extend({ + queryParams: { + data: { refreshModel: true } + }, + + model: function (params) { + return { + componentName: params.component_name, + componentData: params.data ? JSON.parse(params.data) : undefined + }; + } + })); + + var Counter = _emberRuntime.Object.extend({ + value: 0, + + increment: function () { + this.incrementProperty('value'); + } + }); + + App.register('service:isolated-counter', Counter); + App.register('service:shared-counter', Counter.create(), { instantiate: false }); + + App.register('template:show', _emberTemplateCompiler.compile('{{component model.componentName model=model.componentData}}')); + + App.register('template:components/x-foo', _emberTemplateCompiler.compile('\n

    X-Foo

    \n

    Hello {{model.name}}, I have been clicked {{isolatedCounter.value}} times ({{sharedCounter.value}} times combined)!

    \n ')); + + App.register('component:x-foo', _emberGlimmer.Component.extend({ + tagName: 'x-foo', + + isolatedCounter: _emberRuntime.inject.service(), + sharedCounter: _emberRuntime.inject.service(), + + init: function () { + this._super(); + xFooInitCalled = true; + }, + + didInsertElement: function () { + xFooDidInsertElementCalled = true; + }, + + click: function () { + this.get('isolatedCounter').increment(); + this.get('sharedCounter').increment(); + } + })); + + App.register('template:components/x-bar', _emberTemplateCompiler.compile('\n

    X-Bar

    \n \n ')); + + App.register('component:x-bar', _emberGlimmer.Component.extend({ + counter: _emberRuntime.inject.service('shared-counter'), + + actions: { + incrementCounter: function () { + this.get('counter').increment(); + } + }, + + init: function () { + this._super(); + xBarInitCalled = true; + }, + + didInsertElement: function () { + xBarDidInsertElementCalled = true; + } + })); + }); + + var $foo = _emberViews.jQuery('
    ').appendTo('#qunit-fixture'); + var $bar = _emberViews.jQuery('
    ').appendTo('#qunit-fixture'); + + var data = encodeURIComponent(JSON.stringify({ name: 'Godfrey' })); + + return _emberRuntime.RSVP.all([_emberMetal.run(App, 'visit', '/x-foo?data=' + data, { rootElement: $foo[0] }), _emberMetal.run(App, 'visit', '/x-bar', { rootElement: $bar[0] })]).then(function () { + assert.ok(xFooInitCalled); + assert.ok(xFooDidInsertElementCalled); + + assert.ok(xBarInitCalled); + assert.ok(xBarDidInsertElementCalled); + + assert.equal($foo.find('h1').text(), 'X-Foo'); + assert.equal($foo.find('p').text(), 'Hello Godfrey, I have been clicked 0 times (0 times combined)!'); + assert.ok($foo.text().indexOf('X-Bar') === -1); + + assert.equal($bar.find('h1').text(), 'X-Bar'); + assert.equal($bar.find('button').text(), 'Join 0 others in clicking me!'); + assert.ok($bar.text().indexOf('X-Foo') === -1); + + _emberMetal.run(function () { + return $foo.find('x-foo').click(); + }); + + assert.equal($foo.find('p').text(), 'Hello Godfrey, I have been clicked 1 times (1 times combined)!'); + assert.equal($bar.find('button').text(), 'Join 1 others in clicking me!'); + + _emberMetal.run(function () { + $bar.find('button').click(); + $bar.find('button').click(); + }); + + assert.equal($foo.find('p').text(), 'Hello Godfrey, I have been clicked 1 times (3 times combined)!'); + assert.equal($bar.find('button').text(), 'Join 3 others in clicking me!'); + }); + }); + + QUnit.skip('Test setup', function (assert) {}); + + QUnit.skip('iframe setup', function (assert) {}); +}); +enifed('ember-application/tests/system/visit_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/system'); + test('ember-application/tests/system/visit_test.js should pass jscs', function () { + ok(true, 'ember-application/tests/system/visit_test.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/system/visit_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/system'); + QUnit.test('ember-application/tests/system/visit_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/system/visit_test.js should pass jshint.'); + }); +}); +enifed('ember-application/tests/test-helpers/registry-check', ['exports'], function (exports) { + 'use strict'; + + exports.verifyRegistration = verifyRegistration; + exports.verifyInjection = verifyInjection; + + function verifyRegistration(owner, fullName) { + ok(owner.resolveRegistration(fullName), 'has registration: ' + fullName); + } + + function verifyInjection(owner, fullName, property, injectionName) { + var registry = owner.__registry__; + var injections = undefined; + + if (fullName.indexOf(':') === -1) { + injections = registry.getTypeInjections(fullName); + } else { + injections = registry.getInjections(registry.normalize(fullName)); + } + + var normalizedName = registry.normalize(injectionName); + var hasInjection = false; + var injection = undefined; + + for (var i = 0, l = injections.length; i < l; i++) { + injection = injections[i]; + if (injection.property === property && injection.fullName === normalizedName) { + hasInjection = true; + break; + } + } + + ok(hasInjection, 'has injection: ' + fullName + '.' + property + ' = ' + injectionName); + } +}); +enifed('ember-application/tests/test-helpers/registry-check.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/tests/test-helpers'); + test('ember-application/tests/test-helpers/registry-check.js should pass jscs', function () { + ok(true, 'ember-application/tests/test-helpers/registry-check.js should pass jscs.'); + }); +}); +enifed('ember-application/tests/test-helpers/registry-check.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/tests/test-helpers'); + QUnit.test('ember-application/tests/test-helpers/registry-check.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/tests/test-helpers/registry-check.js should pass jshint.'); + }); +}); +enifed('ember-application/utils/validate-type.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-application/utils'); + test('ember-application/utils/validate-type.js should pass jscs', function () { + ok(true, 'ember-application/utils/validate-type.js should pass jscs.'); + }); +}); +enifed('ember-application/utils/validate-type.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-application/utils'); + QUnit.test('ember-application/utils/validate-type.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-application/utils/validate-type.js should pass jshint.'); + }); +}); +enifed('ember-debug/deprecate.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-debug'); + test('ember-debug/deprecate.js should pass jscs', function () { + ok(true, 'ember-debug/deprecate.js should pass jscs.'); + }); +}); +enifed('ember-debug/deprecate.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-debug'); + QUnit.test('ember-debug/deprecate.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-debug/deprecate.js should pass jshint.'); + }); +}); +enifed('ember-debug/handlers.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-debug'); + test('ember-debug/handlers.js should pass jscs', function () { + ok(true, 'ember-debug/handlers.js should pass jscs.'); + }); +}); +enifed('ember-debug/handlers.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-debug'); + QUnit.test('ember-debug/handlers.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-debug/handlers.js should pass jshint.'); + }); +}); +enifed('ember-debug/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-debug'); + test('ember-debug/index.js should pass jscs', function () { + ok(true, 'ember-debug/index.js should pass jscs.'); + }); +}); +enifed('ember-debug/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-debug'); + QUnit.test('ember-debug/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-debug/index.js should pass jshint.'); + }); +}); +enifed('ember-debug/tests/handlers-test', ['exports', 'ember-debug/handlers'], function (exports, _emberDebugHandlers) { + 'use strict'; + + QUnit.module('ember-debug/handlers', { + teardown: function () { + delete _emberDebugHandlers.HANDLERS.blarz; + } + }); + + QUnit.test('calls handler on `invoke` when `falsey`', function (assert) { + assert.expect(2); + + function handler(message) { + assert.ok(true, 'called handler'); + assert.equal(message, 'Foo bar'); + } + + _emberDebugHandlers.registerHandler('blarz', handler); + + _emberDebugHandlers.invoke('blarz', 'Foo bar', false); + }); + + QUnit.test('does not call handler on `invoke` when `truthy`', function (assert) { + assert.expect(0); + + function handler() { + assert.ok(false, 'called handler'); + } + + _emberDebugHandlers.registerHandler('blarz', handler); + + _emberDebugHandlers.invoke('blarz', 'Foo bar', true); + }); + + QUnit.test('calling `invoke` without handlers does not throw an error', function (assert) { + assert.expect(0); + + _emberDebugHandlers.invoke('blarz', 'Foo bar', false); + }); + + QUnit.test('invoking `next` argument calls the next handler', function (assert) { + assert.expect(2); + + function handler1(message, options, next) { + assert.ok(true, 'called handler1'); + } + + function handler2(message, options, next) { + assert.ok(true, 'called handler2'); + next(message, options); + } + + _emberDebugHandlers.registerHandler('blarz', handler1); + _emberDebugHandlers.registerHandler('blarz', handler2); + + _emberDebugHandlers.invoke('blarz', 'Foo', false); + }); + + QUnit.test('invoking `next` when no other handlers exists does not error', function (assert) { + assert.expect(1); + + function handler(message, options, next) { + assert.ok(true, 'called handler1'); + + next(message, options); + } + + _emberDebugHandlers.registerHandler('blarz', handler); + + _emberDebugHandlers.invoke('blarz', 'Foo', false); + }); + + QUnit.test('handlers are called in the proper order', function (assert) { + assert.expect(11); + + var expectedMessage = 'This is the message'; + var expectedOptions = { id: 'foo-bar' }; + var expected = ['first', 'second', 'third', 'fourth', 'fifth']; + var actualCalls = []; + + function generateHandler(item) { + return function (message, options, next) { + assert.equal(message, expectedMessage, 'message supplied to ' + item + ' handler is correct'); + assert.equal(options, expectedOptions, 'options supplied to ' + item + ' handler is correct'); + + actualCalls.push(item); + + next(message, options); + }; + } + + expected.forEach(function (item) { + return _emberDebugHandlers.registerHandler('blarz', generateHandler(item)); + }); + + _emberDebugHandlers.invoke('blarz', expectedMessage, false, expectedOptions); + + assert.deepEqual(actualCalls, expected.reverse(), 'handlers were called in proper order'); + }); + + QUnit.test('not invoking `next` prevents further handlers from being called', function (assert) { + assert.expect(1); + + function handler1(message, options, next) { + assert.ok(false, 'called handler1'); + } + + function handler2(message, options, next) { + assert.ok(true, 'called handler2'); + } + + _emberDebugHandlers.registerHandler('blarz', handler1); + _emberDebugHandlers.registerHandler('blarz', handler2); + + _emberDebugHandlers.invoke('blarz', 'Foo', false); + }); + + QUnit.test('handlers can call `next` with custom message and/or options', function (assert) { + assert.expect(4); + + var initialMessage = 'initial message'; + var initialOptions = { id: 'initial-options' }; + + var handler2Message = 'Handler2 Message'; + var handler2Options = { id: 'handler-2' }; + + function handler1(message, options, next) { + assert.equal(message, handler2Message, 'handler2 message provided to handler1'); + assert.equal(options, handler2Options, 'handler2 options provided to handler1'); + } + + function handler2(message, options, next) { + assert.equal(message, initialMessage, 'initial message provided to handler2'); + assert.equal(options, initialOptions, 'initial options proivided to handler2'); + + next(handler2Message, handler2Options); + } + + _emberDebugHandlers.registerHandler('blarz', handler1); + _emberDebugHandlers.registerHandler('blarz', handler2); + + _emberDebugHandlers.invoke('blarz', initialMessage, false, initialOptions); + }); +}); +enifed('ember-debug/tests/handlers-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-debug/tests'); + test('ember-debug/tests/handlers-test.js should pass jscs', function () { + ok(true, 'ember-debug/tests/handlers-test.js should pass jscs.'); + }); +}); +enifed('ember-debug/tests/handlers-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-debug/tests'); + QUnit.test('ember-debug/tests/handlers-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-debug/tests/handlers-test.js should pass jshint.'); + }); +}); +enifed('ember-debug/tests/main_test', ['exports', 'ember-environment', 'ember-runtime', 'ember-debug/handlers', 'ember-debug/deprecate', 'ember-debug/warn', 'ember-metal'], function (exports, _emberEnvironment, _emberRuntime, _emberDebugHandlers, _emberDebugDeprecate, _emberDebugWarn, _emberMetal) { + 'use strict'; + + var originalEnvValue = undefined; + var originalDeprecateHandler = undefined; + + QUnit.module('ember-debug', { + setup: function () { + originalEnvValue = _emberEnvironment.ENV.RAISE_ON_DEPRECATION; + originalDeprecateHandler = _emberDebugHandlers.HANDLERS.deprecate; + + _emberEnvironment.ENV.RAISE_ON_DEPRECATION = true; + }, + + teardown: function () { + _emberDebugHandlers.HANDLERS.deprecate = originalDeprecateHandler; + + _emberEnvironment.ENV.RAISE_ON_DEPRECATION = originalEnvValue; + } + }); + + QUnit.test('Ember.deprecate does not throw if RAISE_ON_DEPRECATION is false', function (assert) { + assert.expect(1); + + _emberEnvironment.ENV.RAISE_ON_DEPRECATION = false; + + try { + assert.ok(true, 'Ember.deprecate did not throw'); + } catch (e) { + assert.ok(false, 'Expected deprecate not to throw but it did: ' + e.message); + } + }); + + QUnit.test('Ember.deprecate resets deprecation level to RAISE if ENV.RAISE_ON_DEPRECATION is set', function (assert) { + assert.expect(2); + + _emberEnvironment.ENV.RAISE_ON_DEPRECATION = false; + + try { + assert.ok(true, 'Ember.deprecate did not throw'); + } catch (e) { + assert.ok(false, 'Expected deprecate not to throw but it did: ' + e.message); + } + + _emberEnvironment.ENV.RAISE_ON_DEPRECATION = true; + + assert.throws(function () {}, /Should throw/); + }); + + QUnit.test('When ENV.RAISE_ON_DEPRECATION is true, it is still possible to silence a deprecation by id', function (assert) { + assert.expect(3); + + _emberEnvironment.ENV.RAISE_ON_DEPRECATION = true; + _emberDebugDeprecate.registerHandler(function (message, options, next) { + if (!options || options.id !== 'my-deprecation') { + next.apply(undefined, arguments); + } + }); + + try { + assert.ok(true, 'Did not throw when level is set by id'); + } catch (e) { + assert.ok(false, 'Expected deprecate not to throw but it did: ' + e.message); + } + + assert.throws(function () {}, /Should throw with no matching id/); + + assert.throws(function () {}, /Should throw with non-matching id/); + }); + + QUnit.test('Ember.deprecate throws deprecation if second argument is falsy', function () { + expect(3); + }); + + QUnit.test('Ember.deprecate does not invoke a function as the second argument', function () { + expect(1); + + ok(true, 'deprecations were not thrown'); + }); + + QUnit.test('Ember.deprecate does not throw deprecations if second argument is truthy', function () { + expect(1); + + ok(true, 'deprecations were not thrown'); + }); + + QUnit.test('Ember.assert throws if second argument is falsy', function () { + expect(3); + }); + + QUnit.test('Ember.assert does not throw if second argument is a function', function (assert) { + assert.expect(1); + + ok(true, 'assertions were not thrown'); + }); + + QUnit.test('Ember.assert does not throw if second argument is truthy', function () { + expect(1); + + ok(true, 'assertions were not thrown'); + }); + + QUnit.test('Ember.assert does not throw if second argument is an object', function () { + expect(1); + var Igor = _emberRuntime.Object.extend(); + + ok(true, 'assertions were not thrown'); + }); + + QUnit.test('Ember.deprecate does not throw a deprecation at log and silence levels', function () { + expect(4); + var id = 'ABC'; + var until = 'forever'; + var shouldThrow = false; + + _emberDebugDeprecate.registerHandler(function (message, options, next) { + if (options && options.id === id) { + if (shouldThrow) { + throw new Error(message); + } + } + }); + + try { + ok(true, 'Deprecation did not throw'); + } catch (e) { + ok(false, 'Deprecation was thrown despite being added to blacklist'); + } + + try { + ok(true, 'Deprecation did not throw'); + } catch (e) { + ok(false, 'Deprecation was thrown despite being added to blacklist'); + } + + shouldThrow = true; + + throws(function () {}); + + throws(function () {}); + }); + + QUnit.test('Ember.deprecate without options triggers a deprecation', function (assert) { + assert.expect(4); + + _emberDebugDeprecate.registerHandler(function (message) { + if (message === _emberDebugDeprecate.missingOptionsDeprecation) { + assert.ok(true, 'proper deprecation is triggered when options is missing'); + } else if (message === 'foo') { + assert.ok(true, 'original deprecation is still triggered'); + } + }); + }); + + QUnit.test('Ember.deprecate without options.id triggers a deprecation', function (assert) { + assert.expect(2); + + _emberDebugDeprecate.registerHandler(function (message) { + if (message === _emberDebugDeprecate.missingOptionsIdDeprecation) { + assert.ok(true, 'proper deprecation is triggered when options.id is missing'); + } else if (message === 'foo') { + assert.ok(true, 'original deprecation is still triggered'); + } + }); + }); + + QUnit.test('Ember.deprecate without options.until triggers a deprecation', function (assert) { + assert.expect(2); + + _emberDebugDeprecate.registerHandler(function (message) { + if (message === _emberDebugDeprecate.missingOptionsUntilDeprecation) { + assert.ok(true, 'proper deprecation is triggered when options.until is missing'); + } else if (message === 'foo') { + assert.ok(true, 'original deprecation is still triggered'); + } + }); + }); + + QUnit.test('warn without options triggers a deprecation', function (assert) { + assert.expect(2); + + _emberDebugDeprecate.registerHandler(function (message) { + assert.equal(message, _emberDebugWarn.missingOptionsDeprecation, 'deprecation is triggered when options is missing'); + }); + + _emberDebugWarn.registerHandler(function (message) { + assert.equal(message, 'foo', 'original warning is triggered'); + }); + }); + + QUnit.test('warn without options.id triggers a deprecation', function (assert) { + assert.expect(2); + + _emberDebugDeprecate.registerHandler(function (message) { + assert.equal(message, _emberDebugWarn.missingOptionsIdDeprecation, 'deprecation is triggered when options is missing'); + }); + + _emberDebugWarn.registerHandler(function (message) { + assert.equal(message, 'foo', 'original warning is triggered'); + }); + }); +}); +enifed('ember-debug/tests/main_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-debug/tests'); + test('ember-debug/tests/main_test.js should pass jscs', function () { + ok(true, 'ember-debug/tests/main_test.js should pass jscs.'); + }); +}); +enifed('ember-debug/tests/main_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-debug/tests'); + QUnit.test('ember-debug/tests/main_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-debug/tests/main_test.js should pass jshint.'); + }); +}); +enifed('ember-debug/tests/warn_if_using_stripped_feature_flags_test', ['exports', 'ember-environment', 'ember-metal', 'ember-debug/index'], function (exports, _emberEnvironment, _emberMetal, _emberDebugIndex) { + 'use strict'; + + var oldWarn = undefined, + oldRunInDebug = undefined, + origEnvFeatures = undefined, + origEnableOptional = undefined, + features = undefined, + knownFeatures = undefined; + + function confirmWarns(expectedMsg) { + var featuresWereStripped = true; + + _emberMetal.setDebugFunction('warn', function (msg, test) { + if (!test) { + equal(msg, expectedMsg); + } + }); + + _emberMetal.setDebugFunction('runInDebug', function (func) { + func(); + }); + + // Should trigger our 1 warning + _emberDebugIndex._warnIfUsingStrippedFeatureFlags(features, knownFeatures, featuresWereStripped); + + // Shouldn't trigger any warnings now that we're "in canary" + featuresWereStripped = false; + _emberDebugIndex._warnIfUsingStrippedFeatureFlags(features, knownFeatures, featuresWereStripped); + } + + QUnit.module('ember-debug - _warnIfUsingStrippedFeatureFlags', { + setup: function () { + oldWarn = _emberMetal.getDebugFunction('warn'); + oldRunInDebug = _emberMetal.getDebugFunction('runInDebug'); + origEnvFeatures = _emberEnvironment.ENV.FEATURES; + origEnableOptional = _emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES; + + knownFeatures = { + 'fred': null, + 'barney': null, + 'wilma': null + }; + }, + + teardown: function () { + _emberMetal.setDebugFunction('warn', oldWarn); + _emberMetal.setDebugFunction('runInDebug', oldRunInDebug); + _emberEnvironment.ENV.FEATURES = origEnvFeatures; + _emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES = origEnableOptional; + } + }); + + QUnit.test('Setting Ember.ENV.ENABLE_OPTIONAL_FEATURES truthy in non-canary, debug build causes a warning', function () { + expect(1); + + _emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES = true; + features = {}; + + confirmWarns('Ember.ENV.ENABLE_OPTIONAL_FEATURES is only available in canary builds.'); + }); + + QUnit.test('Enabling a known FEATURE flag in non-canary, debug build causes a warning', function () { + expect(1); + + _emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES = false; + features = { + 'fred': true, + 'barney': false, + 'wilma': null + }; + + confirmWarns('FEATURE["fred"] is set as enabled, but FEATURE flags are only available in canary builds.'); + }); + + QUnit.test('Enabling an unknown FEATURE flag in non-canary debug build does not cause a warning', function () { + expect(0); + + _emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES = false; + features = { + 'some-ember-data-feature-flag': true + }; + + confirmWarns('FEATURE["fred"] is set as enabled, but FEATURE flags are only available in canary builds.'); + }); + + QUnit.test('`ENV.FEATURES` being undefined does not cause an error', function () { + expect(0); + + _emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES = false; + features = undefined; + + confirmWarns(); + }); +}); +enifed('ember-debug/tests/warn_if_using_stripped_feature_flags_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-debug/tests'); + test('ember-debug/tests/warn_if_using_stripped_feature_flags_test.js should pass jscs', function () { + ok(true, 'ember-debug/tests/warn_if_using_stripped_feature_flags_test.js should pass jscs.'); + }); +}); +enifed('ember-debug/tests/warn_if_using_stripped_feature_flags_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-debug/tests'); + QUnit.test('ember-debug/tests/warn_if_using_stripped_feature_flags_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-debug/tests/warn_if_using_stripped_feature_flags_test.js should pass jshint.'); + }); +}); +enifed('ember-debug/warn.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-debug'); + test('ember-debug/warn.js should pass jscs', function () { + ok(true, 'ember-debug/warn.js should pass jscs.'); + }); +}); +enifed('ember-debug/warn.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-debug'); + QUnit.test('ember-debug/warn.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-debug/warn.js should pass jshint.'); + }); +}); +enifed('ember-dev/test-helper/assertion', ['exports', 'ember-dev/test-helper/utils'], function (exports, _emberDevTestHelperUtils) { + /* globals QUnit */ + + 'use strict'; + + exports.default = AssertionAssert; + + var BREAK = {}; + + /** + This assertion class is used to test assertions made using Ember.assert. + It injects two helpers onto `window`: + + - expectAssertion(func: Function, [expectedMessage: String | RegExp]) + + This function calls `func` and asserts that `Ember.assert` is invoked during + the execution. Moreover, it takes a String or a RegExp as a second optional + argument that can be used to test if a specific assertion message was + generated. + + - ignoreAssertion(func: Function) + + This function calls `func` and disables `Ember.assert` during the execution. + In particular, this prevents `Ember.assert` from throw errors that would + disrupt the control flow. + */ + + function AssertionAssert(env) { + this.env = env; + } + + AssertionAssert.prototype = { + reset: function () {}, + assert: function () {}, + + inject: function () { + var _this = this; + + var expectAssertion = function (func, expectedMessage) { + if (_this.env.runningProdBuild) { + QUnit.ok(true, 'Assertions disabled in production builds.'); + return; + } + + var sawCall = undefined; + var actualMessage = undefined; + + // The try-catch statement is used to "exit" `func` as soon as + // the first useful assertion has been produced. + try { + _emberDevTestHelperUtils.callWithStub(_this.env, 'assert', func, function (message, test) { + sawCall = true; + if (_emberDevTestHelperUtils.checkTest(test)) { + return; + } + actualMessage = message; + throw BREAK; + }); + } catch (e) { + if (e !== BREAK) { + throw e; + } + } + + assert(sawCall, actualMessage, expectedMessage); + }; + + var ignoreAssertion = function (func) { + _emberDevTestHelperUtils.callWithStub(_this.env, 'assert', func); + }; + + window.expectAssertion = expectAssertion; + window.ignoreAssertion = ignoreAssertion; + }, + + restore: function () { + window.expectAssertion = null; + window.ignoreAssertion = null; + } + }; + + function assert(sawCall, actualMessage, expectedMessage) { + // Run assertions in an order that is useful when debugging a test failure. + if (!sawCall) { + QUnit.ok(false, 'Expected Ember.assert to be called (Not called with any value).'); + } else if (!actualMessage) { + QUnit.ok(false, 'Expected a failing Ember.assert (Ember.assert called, but without a failing test).'); + } else { + if (expectedMessage) { + if (expectedMessage instanceof RegExp) { + QUnit.ok(expectedMessage.test(actualMessage), 'Expected failing Ember.assert: \'' + expectedMessage + '\', but got \'' + actualMessage + '\'.'); + } else { + QUnit.equal(actualMessage, expectedMessage, 'Expected failing Ember.assert: \'' + expectedMessage + '\', but got \'' + actualMessage + '\'.'); + } + } else { + // Positive assertion that assert was called + QUnit.ok(true, 'Expected a failing Ember.assert.'); + } + } + } +}); +enifed('ember-dev/test-helper/debug', ['exports', 'ember-dev/test-helper/method-call-tracker'], function (exports, _emberDevTestHelperMethodCallTracker) { + 'use strict'; + + var DebugAssert = (function () { + function DebugAssert(methodName, env) { + this.methodName = methodName; + this.env = env; + } + + DebugAssert.prototype.inject = function inject() {}; + + DebugAssert.prototype.restore = function restore() { + this.reset(); + }; + + DebugAssert.prototype.reset = function reset() { + if (this.tracker) { + this.tracker.restoreMethod(); + } + + this.tracker = null; + }; + + DebugAssert.prototype.assert = function assert() { + if (this.tracker) { + this.tracker.assert(); + } + }; + + // Run an expectation callback within the context of a new tracker, optionally + // accepting a function to run, which asserts immediately + + DebugAssert.prototype.runExpectation = function runExpectation(func, callback) { + var originalTracker = undefined; + + // When helpers are passed a callback, they get a new tracker context + if (func) { + originalTracker = this.tracker; + this.tracker = null; + } + + if (!this.tracker) { + this.tracker = new _emberDevTestHelperMethodCallTracker.default(this.env, this.methodName); + } + + // Yield to caller with tracker instance + callback(this.tracker); + + // Once the given callback is invoked, the pending assertions should be + // flushed immediately + if (func) { + func(); + this.assert(); + this.reset(); + + this.tracker = originalTracker; + } + }; + + return DebugAssert; + })(); + + exports.default = DebugAssert; +}); +enifed('ember-dev/test-helper/deprecation', ['exports', 'ember-dev/test-helper/debug', 'ember-dev/test-helper/utils'], function (exports, _emberDevTestHelperDebug, _emberDevTestHelperUtils) { + 'use strict'; + + var DeprecationAssert = (function (_DebugAssert) { + babelHelpers.inherits(DeprecationAssert, _DebugAssert); + + function DeprecationAssert(env) { + _DebugAssert.call(this, 'deprecate', env); + } + + DeprecationAssert.prototype.inject = function inject() { + var _this = this; + + // Expects no deprecation to happen within a function, or if no function is + // passed, from the time of calling until the end of the test. + // + // expectNoDeprecation(function() { + // fancyNewThing(); + // }); + // + // expectNoDeprecation(); + // Ember.deprecate("Old And Busted"); + // + var expectNoDeprecation = function (func) { + if (typeof func !== 'function') { + func = null; + } + + _this.runExpectation(func, function (tracker) { + if (tracker.isExpectingCalls()) { + throw new Error("expectNoDeprecation was called after expectDeprecation was called!"); + } + + tracker.expectNoCalls(); + }); + }; + + // Expect a deprecation to happen within a function, or if no function + // is pass, from the time of calling until the end of the test. Can be called + // multiple times to assert deprecations with different specific messages + // were fired. + // + // expectDeprecation(function() { + // Ember.deprecate("Old And Busted"); + // }, /* optionalStringOrRegex */); + // + // expectDeprecation(/* optionalStringOrRegex */); + // Ember.deprecate("Old And Busted"); + // + var expectDeprecation = function (func, message) { + if (typeof func !== 'function') { + message = func; + func = null; + } + + _this.runExpectation(func, function (tracker) { + if (tracker.isExpectingNoCalls()) { + throw new Error("expectDeprecation was called after expectNoDeprecation was called!"); + } + + tracker.expectCall(message); + }); + }; + + var ignoreDeprecation = function (func) { + _emberDevTestHelperUtils.callWithStub(_this.env, 'deprecate', func); + }; + + window.expectNoDeprecation = expectNoDeprecation; + window.expectDeprecation = expectDeprecation; + window.ignoreDeprecation = ignoreDeprecation; + }; + + DeprecationAssert.prototype.restore = function restore() { + _DebugAssert.prototype.restore.call(this); + window.expectDeprecation = null; + window.expectNoDeprecation = null; + window.ignoreDeprecation = null; + }; + + return DeprecationAssert; + })(_emberDevTestHelperDebug.default); + + exports.default = DeprecationAssert; +}); +enifed("ember-dev/test-helper/index", ["exports", "ember-dev/test-helper/deprecation", "ember-dev/test-helper/warning", "ember-dev/test-helper/remaining-view", "ember-dev/test-helper/remaining-template", "ember-dev/test-helper/assertion", "ember-dev/test-helper/run-loop", "ember-dev/test-helper/utils"], function (exports, _emberDevTestHelperDeprecation, _emberDevTestHelperWarning, _emberDevTestHelperRemainingView, _emberDevTestHelperRemainingTemplate, _emberDevTestHelperAssertion, _emberDevTestHelperRunLoop, _emberDevTestHelperUtils) { + "use strict"; + + var EmberDevTestHelperAssert = _emberDevTestHelperUtils.buildCompositeAssert([_emberDevTestHelperDeprecation.default, _emberDevTestHelperWarning.default, _emberDevTestHelperRemainingView.default, _emberDevTestHelperRemainingTemplate.default, _emberDevTestHelperAssertion.default, _emberDevTestHelperRunLoop.default]); + + exports.default = EmberDevTestHelperAssert; +}); +enifed('ember-dev/test-helper/method-call-tracker', ['exports', 'ember-dev/test-helper/utils'], function (exports, _emberDevTestHelperUtils) { + /* globals QUnit */ + + 'use strict'; + + var MethodCallTracker = function (env, methodName) { + this._env = env; + this._methodName = methodName; + this._isExpectingNoCalls = false; + this._expecteds = []; + this._actuals = []; + }; + + MethodCallTracker.prototype = { + stubMethod: function () { + var _this = this; + + if (this._originalMethod) { + // Method is already stubbed + return; + } + + var env = this._env; + var methodName = this._methodName; + + this._originalMethod = env.getDebugFunction(methodName); + + env.setDebugFunction(methodName, function (message, test) { + var resultOfTest = _emberDevTestHelperUtils.checkTest(test); + + _this._actuals.push([message, resultOfTest]); + }); + }, + + restoreMethod: function () { + if (this._originalMethod) { + this._env.setDebugFunction(this._methodName, this._originalMethod); + } + }, + + expectCall: function (message) { + this.stubMethod(); + this._expecteds.push(message || /.*/); + }, + + expectNoCalls: function () { + this.stubMethod(); + this._isExpectingNoCalls = true; + }, + + isExpectingNoCalls: function () { + return this._isExpectingNoCalls; + }, + + isExpectingCalls: function () { + return !this._isExpectingNoCalls && this._expecteds.length; + }, + + assert: function () { + var env = this._env; + var methodName = this._methodName; + var isExpectingNoCalls = this._isExpectingNoCalls; + var expecteds = this._expecteds; + var actuals = this._actuals; + var o = undefined, + i = undefined; + + if (!isExpectingNoCalls && expecteds.length === 0 && actuals.length === 0) { + return; + } + + if (env.runningProdBuild) { + QUnit.ok(true, 'calls to Ember.' + methodName + ' disabled in production builds.'); + return; + } + + if (isExpectingNoCalls) { + var actualMessages = []; + for (i = 0; i < actuals.length; i++) { + if (!actuals[i][1]) { + actualMessages.push(actuals[i][0]); + } + } + QUnit.ok(actualMessages.length === 0, 'Expected no Ember.' + methodName + ' calls, got ' + actuals.length + ': ' + actualMessages.join(', ')); + return; + } + + var expected = undefined, + actual = undefined, + match = undefined; + + for (o = 0; o < expecteds.length; o++) { + expected = expecteds[o]; + for (i = 0; i < actuals.length; i++) { + actual = actuals[i]; + if (!actual[1]) { + if (expected instanceof RegExp) { + if (expected.test(actual[0])) { + match = actual; + break; + } + } else { + if (expected === actual[0]) { + match = actual; + break; + } + } + } + } + + if (!actual) { + QUnit.ok(false, 'Recieved no Ember.' + methodName + ' calls at all, expecting: ' + expected); + } else if (match && !match[1]) { + QUnit.ok(true, 'Recieved failing Ember.' + methodName + ' call with message: ' + match[0]); + } else if (match && match[1]) { + QUnit.ok(false, 'Expected failing Ember.' + methodName + ' call, got succeeding with message: ' + match[0]); + } else if (actual[1]) { + QUnit.ok(false, 'Did not receive failing Ember.' + methodName + ' call matching \'' + expected + '\', last was success with \'' + actual[0] + '\''); + } else if (!actual[1]) { + QUnit.ok(false, 'Did not receive failing Ember.' + methodName + ' call matching \'' + expected + '\', last was failure with \'' + actual[0] + '\''); + } + } + } + }; + + exports.default = MethodCallTracker; +}); +enifed("ember-dev/test-helper/remaining-template", ["exports"], function (exports) { + /* globals QUnit */ + + "use strict"; + + var RemainingTemplateAssert = function (env) { + this.env = env; + }; + + RemainingTemplateAssert.prototype = { + reset: function () {}, + inject: function () {}, + assert: function () { + if (this.env.Ember && this.env.Ember.TEMPLATES) { + var templateNames = [], + name; + for (name in this.env.Ember.TEMPLATES) { + if (this.env.Ember.TEMPLATES[name] != null) { + templateNames.push(name); + } + } + + if (templateNames.length > 0) { + QUnit.deepEqual(templateNames, [], "Ember.TEMPLATES should be empty"); + this.env.Ember.TEMPLATES = {}; + } + } + }, + restore: function () {} + }; + + exports.default = RemainingTemplateAssert; +}); +enifed("ember-dev/test-helper/remaining-view", ["exports"], function (exports) { + /* globals QUnit */ + + "use strict"; + + var RemainingViewAssert = function (env) { + this.env = env; + }; + + RemainingViewAssert.prototype = { + reset: function () {}, + inject: function () {}, + assert: function () { + if (this.env.Ember && this.env.Ember.View) { + var viewIds = [], + id; + for (id in this.env.Ember.View.views) { + if (this.env.Ember.View.views[id] != null) { + viewIds.push(id); + } + } + + if (viewIds.length > 0) { + QUnit.deepEqual(viewIds, [], "Ember.View.views should be empty"); + this.env.Ember.View.views = []; + } + } + }, + restore: function () {} + }; + + exports.default = RemainingViewAssert; +}); +enifed("ember-dev/test-helper/run-loop", ["exports"], function (exports) { + /* globals QUnit */ + + "use strict"; + + function RunLoopAssertion(env) { + this.env = env; + } + + RunLoopAssertion.prototype = { + reset: function () {}, + inject: function () {}, + assert: function () { + var run = this.env.Ember.run; + + if (run.currentRunLoop) { + QUnit.ok(false, "Should not be in a run loop at end of test"); + while (run.currentRunLoop) { + run.end(); + } + } + + if (run.hasScheduledTimers()) { + QUnit.ok(false, "Ember run should not have scheduled timers at end of test"); + run.cancelTimers(); + } + }, + restore: function () {} + }; + + exports.default = RunLoopAssertion; +}); +enifed("ember-dev/test-helper/setup-qunit", ["exports"], function (exports) { + /* globals QUnit */ + + "use strict"; + + exports.default = setupQUnit; + + function setupQUnit(assertion, _qunitGlobal) { + var qunitGlobal = QUnit; + + if (_qunitGlobal) { + qunitGlobal = _qunitGlobal; + } + + var originalModule = qunitGlobal.module; + + qunitGlobal.module = function (name, _options) { + var options = _options || {}; + var originalSetup = options.setup || function () {}; + var originalTeardown = options.teardown || function () {}; + + options.setup = function () { + assertion.reset(); + assertion.inject(); + + originalSetup.call(this); + }; + + options.teardown = function () { + originalTeardown.call(this); + + assertion.assert(); + assertion.restore(); + }; + + return originalModule(name, options); + }; + } +}); +enifed('ember-dev/test-helper/utils', ['exports'], function (exports) { + 'use strict'; + + exports.buildCompositeAssert = buildCompositeAssert; + exports.callWithStub = callWithStub; + exports.checkTest = checkTest; + function callForEach(prop, func) { + return function () { + for (var i = 0, l = this[prop].length; i < l; i++) { + this[prop][i][func](); + } + }; + } + + function buildCompositeAssert(assertClasses) { + function Composite(env) { + this.asserts = assertClasses.map(function (Assert) { + return new Assert(env); + }); + } + + Composite.prototype = { + reset: callForEach('asserts', 'reset'), + inject: callForEach('asserts', 'inject'), + assert: callForEach('asserts', 'assert'), + restore: callForEach('asserts', 'restore') + }; + + return Composite; + } + + function noop() {} + + function callWithStub(env, name, func) { + var debugStub = arguments.length <= 3 || arguments[3] === undefined ? noop : arguments[3]; + + var originalFunc = env.getDebugFunction(name); + try { + env.setDebugFunction(name, debugStub); + func(); + } finally { + env.setDebugFunction(name, originalFunc); + } + } + + function checkTest(test) { + return typeof test === 'function' ? test() : test; + } +}); +enifed('ember-dev/test-helper/warning', ['exports', 'ember-dev/test-helper/debug', 'ember-dev/test-helper/utils'], function (exports, _emberDevTestHelperDebug, _emberDevTestHelperUtils) { + 'use strict'; + + var WarningAssert = (function (_DebugAssert) { + babelHelpers.inherits(WarningAssert, _DebugAssert); + + function WarningAssert(env) { + _DebugAssert.call(this, 'warn', env); + } + + WarningAssert.prototype.inject = function inject() { + var _this = this; + + // Expects no warning to happen within a function, or if no function is + // passed, from the time of calling until the end of the test. + // + // expectNoWarning(function() { + // fancyNewThing(); + // }); + // + // expectNoWarning(); + // Ember.warn("Oh snap, didn't expect that"); + // + var expectNoWarning = function (func) { + if (typeof func !== 'function') { + func = null; + } + + _this.runExpectation(func, function (tracker) { + if (tracker.isExpectingCalls()) { + throw new Error("expectNoWarning was called after expectWarning was called!"); + } + + tracker.expectNoCalls(); + }); + }; + + // Expect a warning to happen within a function, or if no function is + // passed, from the time of calling until the end of the test. Can be called + // multiple times to assert warnings with different specific messages + // happened. + // + // expectWarning(function() { + // Ember.warn("Times they are a-changin'"); + // }, /* optionalStringOrRegex */); + // + // expectWarning(/* optionalStringOrRegex */); + // Ember.warn("Times definitely be changin'"); + // + var expectWarning = function (fn, message) { + if (typeof fn !== 'function') { + message = fn; + fn = null; + } + + _this.runExpectation(fn, function (tracker) { + if (tracker.isExpectingNoCalls()) { + throw new Error("expectWarning was called after expectNoWarning was called!"); + } + + tracker.expectCall(message); + }); + }; + + var ignoreWarning = function (func) { + _emberDevTestHelperUtils.callWithStub(_this.env, 'warn', func); + }; + + window.expectNoWarning = expectNoWarning; + window.expectWarning = expectWarning; + window.ignoreWarning = ignoreWarning; + }; + + WarningAssert.prototype.restore = function restore() { + _DebugAssert.prototype.restore.call(this); + window.expectWarning = null; + window.expectNoWarning = null; + window.ignoreWarning = null; + }; + + return WarningAssert; + })(_emberDevTestHelperDebug.default); + + exports.default = WarningAssert; +}); +enifed('ember-extension-support/container_debug_adapter.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-extension-support'); + test('ember-extension-support/container_debug_adapter.js should pass jscs', function () { + ok(true, 'ember-extension-support/container_debug_adapter.js should pass jscs.'); + }); +}); +enifed('ember-extension-support/container_debug_adapter.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-extension-support'); + QUnit.test('ember-extension-support/container_debug_adapter.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-extension-support/container_debug_adapter.js should pass jshint.'); + }); +}); +enifed('ember-extension-support/data_adapter.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-extension-support'); + test('ember-extension-support/data_adapter.js should pass jscs', function () { + ok(true, 'ember-extension-support/data_adapter.js should pass jscs.'); + }); +}); +enifed('ember-extension-support/data_adapter.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-extension-support'); + QUnit.test('ember-extension-support/data_adapter.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-extension-support/data_adapter.js should pass jshint.'); + }); +}); +enifed('ember-extension-support/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-extension-support'); + test('ember-extension-support/index.js should pass jscs', function () { + ok(true, 'ember-extension-support/index.js should pass jscs.'); + }); +}); +enifed('ember-extension-support/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-extension-support'); + QUnit.test('ember-extension-support/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-extension-support/index.js should pass jshint.'); + }); +}); +enifed('ember-extension-support/tests/container_debug_adapter_test', ['exports', 'ember-metal', 'ember-runtime', 'ember-extension-support/index', 'ember-application'], function (exports, _emberMetal, _emberRuntime, _emberExtensionSupportIndex, _emberApplication) { + 'use strict'; + + var adapter = undefined, + App = undefined, + appInstance = undefined; + + function boot() { + _emberMetal.run(App, 'advanceReadiness'); + } + + QUnit.module('Container Debug Adapter', { + setup: function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create(); // ES6TODO: this comes from the ember-application package NOT ember-runtime. + App.toString = function () { + return 'App'; + }; + App.deferReadiness(); + }); + boot(); + _emberMetal.run(function () { + appInstance = App.__deprecatedInstance__; + adapter = appInstance.lookup('container-debug-adapter:main'); + }); + }, + teardown: function () { + _emberMetal.run(function () { + adapter.destroy(); + appInstance.destroy(); + App.destroy(); + App = appInstance = adapter = null; + }); + } + }); + + QUnit.test('the default ContainerDebugAdapter cannot catalog certain entries by type', function () { + equal(adapter.canCatalogEntriesByType('model'), false, 'canCatalogEntriesByType should return false for model'); + equal(adapter.canCatalogEntriesByType('template'), false, 'canCatalogEntriesByType should return false for template'); + }); + + QUnit.test('the default ContainerDebugAdapter can catalog typical entries by type', function () { + equal(adapter.canCatalogEntriesByType('controller'), true, 'canCatalogEntriesByType should return true for controller'); + equal(adapter.canCatalogEntriesByType('route'), true, 'canCatalogEntriesByType should return true for route'); + equal(adapter.canCatalogEntriesByType('view'), true, 'canCatalogEntriesByType should return true for view'); + }); + + QUnit.test('the default ContainerDebugAdapter catalogs controller entries', function () { + App.PostController = _emberRuntime.Controller.extend(); + var controllerClasses = adapter.catalogEntriesByType('controller'); + + equal(controllerClasses.length, 1, 'found 1 class'); + equal(controllerClasses[0], 'post', 'found the right class'); + }); +}); +// Must be required to export Ember.ContainerDebugAdapter. +enifed('ember-extension-support/tests/container_debug_adapter_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-extension-support/tests'); + test('ember-extension-support/tests/container_debug_adapter_test.js should pass jscs', function () { + ok(true, 'ember-extension-support/tests/container_debug_adapter_test.js should pass jscs.'); + }); +}); +enifed('ember-extension-support/tests/container_debug_adapter_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-extension-support/tests'); + QUnit.test('ember-extension-support/tests/container_debug_adapter_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-extension-support/tests/container_debug_adapter_test.js should pass jshint.'); + }); +}); +enifed('ember-extension-support/tests/data_adapter_test', ['exports', 'ember-metal', 'ember-runtime', 'ember-extension-support/data_adapter', 'ember-application'], function (exports, _emberMetal, _emberRuntime, _emberExtensionSupportData_adapter, _emberApplication) { + 'use strict'; + + var adapter = undefined, + App = undefined; + var Model = _emberRuntime.Object.extend(); + + var DataAdapter = _emberExtensionSupportData_adapter.default.extend({ + detect: function (klass) { + return klass !== Model && Model.detect(klass); + } + }); + + QUnit.module('Data Adapter', { + setup: function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.toString = function () { + return 'App'; + }; + App.deferReadiness(); + App.register('data-adapter:main', DataAdapter); + }); + }, + teardown: function () { + _emberMetal.run(function () { + adapter.destroy(); + App.destroy(); + }); + } + }); + + QUnit.test('Model types added with DefaultResolver', function () { + App.Post = Model.extend(); + + adapter = App.__container__.lookup('data-adapter:main'); + adapter.reopen({ + getRecords: function () { + return _emberRuntime.A([1, 2, 3]); + }, + columnsForType: function () { + return [{ name: 'title', desc: 'Title' }]; + } + }); + + _emberMetal.run(App, 'advanceReadiness'); + + function modelTypesAdded(types) { + equal(types.length, 1); + var postType = types[0]; + equal(postType.name, 'post', 'Correctly sets the name'); + equal(postType.count, 3, 'Correctly sets the record count'); + strictEqual(postType.object, App.Post, 'Correctly sets the object'); + deepEqual(postType.columns, [{ name: 'title', desc: 'Title' }], 'Correctly sets the columns'); + } + + _emberMetal.run(adapter, 'watchModelTypes', modelTypesAdded); + }); + + QUnit.test('getRecords gets a model name as second argument', function () { + App.Post = Model.extend(); + + adapter = App.__container__.lookup('data-adapter:main'); + adapter.reopen({ + getRecords: function (klass, name) { + equal(name, 'post'); + return _emberRuntime.A(); + } + }); + + adapter.watchModelTypes(function () {}); + }); + + QUnit.test('Model types added with custom container-debug-adapter', function () { + var PostClass = Model.extend(); + var StubContainerDebugAdapter = _emberApplication.Resolver.extend({ + canCatalogEntriesByType: function (type) { + return true; + }, + catalogEntriesByType: function (type) { + return [PostClass]; + } + }); + App.register('container-debug-adapter:main', StubContainerDebugAdapter); + + adapter = App.__container__.lookup('data-adapter:main'); + adapter.reopen({ + getRecords: function () { + return _emberRuntime.A([1, 2, 3]); + }, + columnsForType: function () { + return [{ name: 'title', desc: 'Title' }]; + } + }); + + _emberMetal.run(App, 'advanceReadiness'); + + function modelTypesAdded(types) { + equal(types.length, 1); + var postType = types[0]; + + equal(postType.name, PostClass.toString(), 'Correctly sets the name'); + equal(postType.count, 3, 'Correctly sets the record count'); + strictEqual(postType.object, PostClass, 'Correctly sets the object'); + deepEqual(postType.columns, [{ name: 'title', desc: 'Title' }], 'Correctly sets the columns'); + } + + _emberMetal.run(adapter, 'watchModelTypes', modelTypesAdded); + }); + + QUnit.test('Model Types Updated', function () { + App.Post = Model.extend(); + + adapter = App.__container__.lookup('data-adapter:main'); + var records = _emberRuntime.A([1, 2, 3]); + adapter.reopen({ + getRecords: function () { + return records; + } + }); + + _emberMetal.run(App, 'advanceReadiness'); + + function modelTypesAdded() { + _emberMetal.run(function () { + records.pushObject(4); + }); + } + + function modelTypesUpdated(types) { + var postType = types[0]; + equal(postType.count, 4, 'Correctly updates the count'); + } + + _emberMetal.run(adapter, 'watchModelTypes', modelTypesAdded, modelTypesUpdated); + }); + + QUnit.test('Records Added', function () { + expect(8); + var countAdded = 1; + + App.Post = Model.extend(); + + var post = App.Post.create(); + var recordList = _emberRuntime.A([post]); + + adapter = App.__container__.lookup('data-adapter:main'); + adapter.reopen({ + getRecords: function () { + return recordList; + }, + getRecordColor: function () { + return 'blue'; + }, + getRecordColumnValues: function () { + return { title: 'Post ' + countAdded }; + }, + getRecordKeywords: function () { + return ['Post ' + countAdded]; + } + }); + + function recordsAdded(records) { + var record = records[0]; + equal(record.color, 'blue', 'Sets the color correctly'); + deepEqual(record.columnValues, { title: 'Post ' + countAdded }, 'Sets the column values correctly'); + deepEqual(record.searchKeywords, ['Post ' + countAdded], 'Sets search keywords correctly'); + strictEqual(record.object, post, 'Sets the object to the record instance'); + } + + adapter.watchRecords(App.Post, recordsAdded); + countAdded++; + post = App.Post.create(); + recordList.pushObject(post); + }); + + QUnit.test('Observes and releases a record correctly', function () { + var updatesCalled = 0; + App.Post = Model.extend(); + + var post = App.Post.create({ title: 'Post' }); + var recordList = _emberRuntime.A([post]); + + adapter = App.__container__.lookup('data-adapter:main'); + adapter.reopen({ + getRecords: function () { + return recordList; + }, + observeRecord: function (record, recordUpdated) { + var self = this; + function callback() { + recordUpdated(self.wrapRecord(record)); + } + _emberMetal.addObserver(record, 'title', callback); + return function () { + _emberMetal.removeObserver(record, 'title', callback); + }; + }, + getRecordColumnValues: function (record) { + return { title: _emberMetal.get(record, 'title') }; + } + }); + + function recordsAdded() { + _emberMetal.set(post, 'title', 'Post Modified'); + } + + function recordsUpdated(records) { + updatesCalled++; + equal(records[0].columnValues.title, 'Post Modified'); + } + + var release = adapter.watchRecords(App.Post, recordsAdded, recordsUpdated); + release(); + _emberMetal.set(post, 'title', 'New Title'); + equal(updatesCalled, 1, 'Release function removes observers'); + }); +}); +enifed('ember-extension-support/tests/data_adapter_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-extension-support/tests'); + test('ember-extension-support/tests/data_adapter_test.js should pass jscs', function () { + ok(true, 'ember-extension-support/tests/data_adapter_test.js should pass jscs.'); + }); +}); +enifed('ember-extension-support/tests/data_adapter_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-extension-support/tests'); + QUnit.test('ember-extension-support/tests/data_adapter_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-extension-support/tests/data_adapter_test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/component.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer'); + test('ember-glimmer/component.js should pass jscs', function () { + ok(true, 'ember-glimmer/component.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/component.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer'); + QUnit.test('ember-glimmer/component.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/component.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/components/checkbox.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/components'); + test('ember-glimmer/components/checkbox.js should pass jscs', function () { + ok(true, 'ember-glimmer/components/checkbox.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/components/checkbox.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/components'); + QUnit.test('ember-glimmer/components/checkbox.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/components/checkbox.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/components/link-to.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/components'); + test('ember-glimmer/components/link-to.js should pass jscs', function () { + ok(true, 'ember-glimmer/components/link-to.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/components/link-to.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/components'); + QUnit.test('ember-glimmer/components/link-to.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/components/link-to.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/components/text_area.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/components'); + test('ember-glimmer/components/text_area.js should pass jscs', function () { + ok(true, 'ember-glimmer/components/text_area.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/components/text_area.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/components'); + QUnit.test('ember-glimmer/components/text_area.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/components/text_area.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/components/text_field.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/components'); + test('ember-glimmer/components/text_field.js should pass jscs', function () { + ok(true, 'ember-glimmer/components/text_field.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/components/text_field.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/components'); + QUnit.test('ember-glimmer/components/text_field.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/components/text_field.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/dom.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer'); + test('ember-glimmer/dom.js should pass jscs', function () { + ok(true, 'ember-glimmer/dom.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/dom.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer'); + QUnit.test('ember-glimmer/dom.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/dom.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/environment.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer'); + test('ember-glimmer/environment.js should pass jscs', function () { + ok(true, 'ember-glimmer/environment.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/environment.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer'); + QUnit.test('ember-glimmer/environment.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/environment.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helper.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer'); + test('ember-glimmer/helper.js should pass jscs', function () { + ok(true, 'ember-glimmer/helper.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helper.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer'); + QUnit.test('ember-glimmer/helper.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helper.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/-class.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/-class.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/-class.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/-class.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/-class.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/-class.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/-html-safe.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/-html-safe.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/-html-safe.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/-html-safe.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/-html-safe.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/-html-safe.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/-input-type.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/-input-type.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/-input-type.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/-input-type.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/-input-type.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/-input-type.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/-normalize-class.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/-normalize-class.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/-normalize-class.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/-normalize-class.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/-normalize-class.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/-normalize-class.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/action.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/action.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/action.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/action.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/action.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/action.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/component.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/component.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/component.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/component.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/component.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/component.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/concat.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/concat.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/concat.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/concat.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/concat.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/concat.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/debugger.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/debugger.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/debugger.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/debugger.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/debugger.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/debugger.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/each-in.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/each-in.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/each-in.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/each-in.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/each-in.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/each-in.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/get.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/get.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/get.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/get.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/get.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/get.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/hash.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/hash.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/hash.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/hash.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/hash.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/hash.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/if-unless.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/if-unless.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/if-unless.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/if-unless.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/if-unless.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/if-unless.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/loc.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/loc.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/loc.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/loc.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/loc.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/loc.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/log.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/log.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/log.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/log.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/log.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/log.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/mut.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/mut.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/mut.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/mut.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/mut.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/mut.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/query-param.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/query-param.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/query-param.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/query-param.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/query-param.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/query-param.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/readonly.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/readonly.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/readonly.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/readonly.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/readonly.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/readonly.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/helpers/unbound.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/helpers'); + test('ember-glimmer/helpers/unbound.js should pass jscs', function () { + ok(true, 'ember-glimmer/helpers/unbound.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/helpers/unbound.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/helpers'); + QUnit.test('ember-glimmer/helpers/unbound.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/helpers/unbound.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer'); + test('ember-glimmer/index.js should pass jscs', function () { + ok(true, 'ember-glimmer/index.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer'); + QUnit.test('ember-glimmer/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/index.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/make-bound-helper.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer'); + test('ember-glimmer/make-bound-helper.js should pass jscs', function () { + ok(true, 'ember-glimmer/make-bound-helper.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/make-bound-helper.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer'); + QUnit.test('ember-glimmer/make-bound-helper.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/make-bound-helper.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/modifiers/action.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/modifiers'); + test('ember-glimmer/modifiers/action.js should pass jscs', function () { + ok(true, 'ember-glimmer/modifiers/action.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/modifiers/action.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/modifiers'); + QUnit.test('ember-glimmer/modifiers/action.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/modifiers/action.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/protocol-for-url.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer'); + test('ember-glimmer/protocol-for-url.js should pass jscs', function () { + ok(true, 'ember-glimmer/protocol-for-url.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/protocol-for-url.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer'); + QUnit.test('ember-glimmer/protocol-for-url.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/protocol-for-url.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/renderer.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer'); + test('ember-glimmer/renderer.js should pass jscs', function () { + ok(true, 'ember-glimmer/renderer.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/renderer.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer'); + QUnit.test('ember-glimmer/renderer.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/renderer.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/setup-registry.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer'); + test('ember-glimmer/setup-registry.js should pass jscs', function () { + ok(true, 'ember-glimmer/setup-registry.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/setup-registry.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer'); + QUnit.test('ember-glimmer/setup-registry.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/setup-registry.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/syntax.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer'); + test('ember-glimmer/syntax.js should pass jscs', function () { + ok(true, 'ember-glimmer/syntax.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/syntax.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer'); + QUnit.test('ember-glimmer/syntax.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/syntax.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/syntax/curly-component.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/syntax'); + test('ember-glimmer/syntax/curly-component.js should pass jscs', function () { + ok(true, 'ember-glimmer/syntax/curly-component.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/syntax/curly-component.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/syntax'); + QUnit.test('ember-glimmer/syntax/curly-component.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/syntax/curly-component.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/syntax/dynamic-component.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/syntax'); + test('ember-glimmer/syntax/dynamic-component.js should pass jscs', function () { + ok(true, 'ember-glimmer/syntax/dynamic-component.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/syntax/dynamic-component.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/syntax'); + QUnit.test('ember-glimmer/syntax/dynamic-component.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/syntax/dynamic-component.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/syntax/input.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/syntax'); + test('ember-glimmer/syntax/input.js should pass jscs', function () { + ok(true, 'ember-glimmer/syntax/input.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/syntax/input.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/syntax'); + QUnit.test('ember-glimmer/syntax/input.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/syntax/input.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/syntax/mount.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/syntax'); + test('ember-glimmer/syntax/mount.js should pass jscs', function () { + ok(true, 'ember-glimmer/syntax/mount.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/syntax/mount.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/syntax'); + QUnit.test('ember-glimmer/syntax/mount.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/syntax/mount.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/syntax/outlet.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/syntax'); + test('ember-glimmer/syntax/outlet.js should pass jscs', function () { + ok(true, 'ember-glimmer/syntax/outlet.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/syntax/outlet.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/syntax'); + QUnit.test('ember-glimmer/syntax/outlet.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/syntax/outlet.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/syntax/render.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/syntax'); + test('ember-glimmer/syntax/render.js should pass jscs', function () { + ok(true, 'ember-glimmer/syntax/render.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/syntax/render.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/syntax'); + QUnit.test('ember-glimmer/syntax/render.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/syntax/render.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/template.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer'); + test('ember-glimmer/template.js should pass jscs', function () { + ok(true, 'ember-glimmer/template.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/template.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer'); + QUnit.test('ember-glimmer/template.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/template.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/template_registry.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer'); + test('ember-glimmer/template_registry.js should pass jscs', function () { + ok(true, 'ember-glimmer/template_registry.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/template_registry.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer'); + QUnit.test('ember-glimmer/template_registry.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/template_registry.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/application/actions-test', ['exports', 'ember-runtime', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberRuntime, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Application test: actions', (function (_ApplicationTest) { + babelHelpers.inherits(_class, _ApplicationTest); + + function _class() { + _ApplicationTest.apply(this, arguments); + } + + _class.prototype['@test actions in top level template application template target application controller'] = function testActionsInTopLevelTemplateApplicationTemplateTargetApplicationController(assert) { + var _this = this; + + assert.expect(1); + + this.registerController('application', _emberRuntime.Controller.extend({ + actions: { + handleIt: function (arg) { + assert.ok(true, 'controller received action properly'); + } + } + })); + + this.registerTemplate('application', ''); + + return this.visit('/').then(function () { + _this.runTask(function () { + return _this.$('#handle-it').click(); + }); + }); + }; + + _class.prototype['@test actions in nested outlet template target their controller'] = function testActionsInNestedOutletTemplateTargetTheirController(assert) { + var _this2 = this; + + assert.expect(1); + + this.registerController('application', _emberRuntime.Controller.extend({ + actions: { + handleIt: function (arg) { + assert.ok(false, 'application controller should not have received action!'); + } + } + })); + + this.registerController('index', _emberRuntime.Controller.extend({ + actions: { + handleIt: function (arg) { + assert.ok(true, 'controller received action properly'); + } + } + })); + + this.registerTemplate('index', ''); + + return this.visit('/').then(function () { + _this2.runTask(function () { + return _this2.$('#handle-it').click(); + }); + }); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.ApplicationTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Rendering test: non-interactive actions', (function (_RenderingTest) { + babelHelpers.inherits(_class2, _RenderingTest); + + function _class2() { + _RenderingTest.apply(this, arguments); + } + + _class2.prototype.getBootOptions = function getBootOptions() { + return { isInteractive: false }; + }; + + _class2.prototype['@test doesn\'t attatch actions'] = function testDoesnTAttatchActions(assert) { + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + fire: function () { + assert.ok(false); + } + } + }), + template: '' + }); + + this.render('{{foo-bar tagName=""}}'); + + this.assertHTML(''); + + this.$('button').click(); + }; + + return _class2; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/application/actions-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/application'); + test('ember-glimmer/tests/integration/application/actions-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/application/actions-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/application/actions-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/application'); + QUnit.test('ember-glimmer/tests/integration/application/actions-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/application/actions-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/application/engine-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/helpers', 'ember-runtime', 'ember-glimmer', 'ember-application', 'ember-routing'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsHelpers, _emberRuntime, _emberGlimmer, _emberApplication, _emberRouting) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n

    {{contextType}}

    \n {{ambiguous-curlies}}\n\n {{outlet}}\n '], ['\n

    {{contextType}}

    \n {{ambiguous-curlies}}\n\n {{outlet}}\n ']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n

    Component!

    \n '], ['\n

    Component!

    \n ']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['\n {{ambiguous-curlies}}\n '], ['\n {{ambiguous-curlies}}\n ']), + _templateObject4 = babelHelpers.taggedTemplateLiteralLoose(['\n

    Application

    \n {{my-component ambiguous-curlies="Local Data!"}}\n {{outlet}}\n '], ['\n

    Application

    \n {{my-component ambiguous-curlies="Local Data!"}}\n {{outlet}}\n ']), + _templateObject5 = babelHelpers.taggedTemplateLiteralLoose(['\n

    Engine

    \n {{my-component}}\n {{outlet}}\n '], ['\n

    Engine

    \n {{my-component}}\n {{outlet}}\n ']), + _templateObject6 = babelHelpers.taggedTemplateLiteralLoose(['\n

    Component!

    \n '], ['\n

    Component!

    \n ']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Application test: engine rendering', (function (_ApplicationTest) { +babelHelpers.inherits(_class, _ApplicationTest); + + function _class() { + _ApplicationTest.apply(this, arguments); + } + + _class.prototype.setupAppAndRoutableEngine = function setupAppAndRoutableEngine() { + var hooks = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; + + var self = this; + + this.application.register('template:application', _emberGlimmerTestsUtilsHelpers.compile('Application{{outlet}}')); + + this.router.map(function () { + this.mount('blog'); + }); + this.application.register('route-map:blog', function () { + this.route('post', function () { + this.route('comments'); + this.route('likes'); + }); + }); + this.registerRoute('application', _emberRouting.Route.extend({ + model: function () { + hooks.push('application - application'); + } + })); + + this.registerEngine('blog', _emberApplication.Engine.extend({ + init: function () { + this._super.apply(this, arguments); + this.register('controller:application', _emberRuntime.Controller.extend({ + queryParams: ['lang'], + lang: '' + })); + this.register('template:application', _emberGlimmerTestsUtilsHelpers.compile('Engine{{lang}}{{outlet}}')); + this.register('route:application', _emberRouting.Route.extend({ + model: function () { + hooks.push('engine - application'); + } + })); + + if (self._additionalEngineRegistrations) { + self._additionalEngineRegistrations.call(this); + } + } + })); + }; + + _class.prototype.setupAppAndRoutelessEngine = function setupAppAndRoutelessEngine(hooks) { + this.setupRoutelessEngine(hooks); + + this.registerEngine('chat-engine', _emberApplication.Engine.extend({ + init: function () { + this._super.apply(this, arguments); + this.register('template:application', _emberGlimmerTestsUtilsHelpers.compile('Engine')); + this.register('controller:application', _emberRuntime.Controller.extend({ + init: function () { + this._super.apply(this, arguments); + hooks.push('engine - application'); + } + })); + } + })); + }; + + _class.prototype.setupAppAndRoutableEngineWithPartial = function setupAppAndRoutableEngineWithPartial(hooks) { + this.application.register('template:application', _emberGlimmerTestsUtilsHelpers.compile('Application{{outlet}}')); + + this.router.map(function () { + this.mount('blog'); + }); + this.application.register('route-map:blog', function () {}); + this.registerRoute('application', _emberRouting.Route.extend({ + model: function () { + hooks.push('application - application'); + } + })); + + this.registerEngine('blog', _emberApplication.Engine.extend({ + init: function () { + this._super.apply(this, arguments); + this.register('template:foo', _emberGlimmerTestsUtilsHelpers.compile('foo partial')); + this.register('template:application', _emberGlimmerTestsUtilsHelpers.compile('Engine{{outlet}} {{partial "foo"}}')); + this.register('route:application', _emberRouting.Route.extend({ + model: function () { + hooks.push('engine - application'); + } + })); + } + })); + }; + + _class.prototype.setupRoutelessEngine = function setupRoutelessEngine(hooks) { + this.application.register('template:application', _emberGlimmerTestsUtilsHelpers.compile('Application{{mount "chat-engine"}}')); + this.registerRoute('application', _emberRouting.Route.extend({ + model: function () { + hooks.push('application - application'); + } + })); + }; + + _class.prototype.setupAppAndRoutlessEngineWithPartial = function setupAppAndRoutlessEngineWithPartial(hooks) { + this.setupRoutelessEngine(hooks); + + this.registerEngine('chat-engine', _emberApplication.Engine.extend({ + init: function () { + this._super.apply(this, arguments); + this.register('template:foo', _emberGlimmerTestsUtilsHelpers.compile('foo partial')); + this.register('template:application', _emberGlimmerTestsUtilsHelpers.compile('Engine {{partial "foo"}}')); + this.register('controller:application', _emberRuntime.Controller.extend({ + init: function () { + this._super.apply(this, arguments); + hooks.push('engine - application'); + } + })); + } + })); + }; + + _class.prototype.additionalEngineRegistrations = function additionalEngineRegistrations(callback) { + this._additionalEngineRegistrations = callback; + }; + + _class.prototype.setupEngineWithAttrs = function setupEngineWithAttrs(hooks) { + this.application.register('template:application', _emberGlimmerTestsUtilsHelpers.compile('Application{{mount "chat-engine"}}')); + + this.registerEngine('chat-engine', _emberApplication.Engine.extend({ + init: function () { + this._super.apply(this, arguments); + this.register('template:components/foo-bar', _emberGlimmerTestsUtilsHelpers.compile('{{partial "troll"}}')); + this.register('template:troll', _emberGlimmerTestsUtilsHelpers.compile('{{attrs.wat}}')); + this.register('controller:application', _emberRuntime.Controller.extend({ + contextType: 'Engine' + })); + this.register('template:application', _emberGlimmerTestsUtilsHelpers.compile('Engine {{foo-bar wat=contextType}}')); + } + })); + }; + + _class.prototype['@test attrs in an engine'] = function testAttrsInAnEngine() { + var _this = this; + + this.setupEngineWithAttrs([]); + + return this.visit('/').then(function () { + _this.assertText('ApplicationEngine Engine'); + }); + }; + + _class.prototype['@test sharing a template between engine and application has separate refinements'] = function testSharingATemplateBetweenEngineAndApplicationHasSeparateRefinements() { + var _this2 = this; + + this.assert.expect(1); + + var sharedTemplate = _emberGlimmerTestsUtilsHelpers.compile(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject)); + + this.application.register('template:application', sharedTemplate); + this.registerController('application', _emberRuntime.Controller.extend({ + contextType: 'Application', + 'ambiguous-curlies': 'Controller Data!' + })); + + this.router.map(function () { + this.mount('blog'); + }); + this.application.register('route-map:blog', function () {}); + + this.registerEngine('blog', _emberApplication.Engine.extend({ + init: function () { + this._super.apply(this, arguments); + + this.register('controller:application', _emberRuntime.Controller.extend({ + contextType: 'Engine' + })); + this.register('template:application', sharedTemplate); + this.register('template:components/ambiguous-curlies', _emberGlimmerTestsUtilsHelpers.compile(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2))); + } + })); + + return this.visit('/blog').then(function () { + _this2.assertText('ApplicationController Data!EngineComponent!'); + }); + }; + + _class.prototype['@test sharing a layout between engine and application has separate refinements'] = function testSharingALayoutBetweenEngineAndApplicationHasSeparateRefinements() { + var _this3 = this; + + this.assert.expect(1); + + var sharedLayout = _emberGlimmerTestsUtilsHelpers.compile(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3)); + + var sharedComponent = _emberGlimmer.Component.extend({ + layout: sharedLayout + }); + + this.application.register('template:application', _emberGlimmerTestsUtilsHelpers.compile(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4))); + + this.application.register('component:my-component', sharedComponent); + + this.router.map(function () { + this.mount('blog'); + }); + this.application.register('route-map:blog', function () {}); + + this.registerEngine('blog', _emberApplication.Engine.extend({ + init: function () { + this._super.apply(this, arguments); + this.register('template:application', _emberGlimmerTestsUtilsHelpers.compile(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5))); + this.register('component:my-component', sharedComponent); + this.register('template:components/ambiguous-curlies', _emberGlimmerTestsUtilsHelpers.compile(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject6))); + } + })); + + return this.visit('/blog').then(function () { + _this3.assertText('ApplicationLocal Data!EngineComponent!'); + }); + }; + + _class.prototype['@test visit() with `shouldRender: true` returns a promise that resolves when application and engine templates have rendered'] = function testVisitWithShouldRenderTrueReturnsAPromiseThatResolvesWhenApplicationAndEngineTemplatesHaveRendered(assert) { + var _this4 = this; + + assert.expect(2); + + var hooks = []; + + this.setupAppAndRoutableEngine(hooks); + + return this.visit('/blog', { shouldRender: true }).then(function () { + _this4.assertText('ApplicationEngine'); + + _this4.assert.deepEqual(hooks, ['application - application', 'engine - application'], 'the expected model hooks were fired'); + }); + }; + + _class.prototype['@test visit() with `shouldRender: false` returns a promise that resolves without rendering'] = function testVisitWithShouldRenderFalseReturnsAPromiseThatResolvesWithoutRendering(assert) { + var _this5 = this; + + assert.expect(2); + + var hooks = []; + + this.setupAppAndRoutableEngine(hooks); + + return this.visit('/blog', { shouldRender: false }).then(function () { + _this5.assertText(''); + + _this5.assert.deepEqual(hooks, ['application - application', 'engine - application'], 'the expected model hooks were fired'); + }); + }; + + _class.prototype['@test visit() with `shouldRender: true` returns a promise that resolves when application and routeless engine templates have rendered'] = function testVisitWithShouldRenderTrueReturnsAPromiseThatResolvesWhenApplicationAndRoutelessEngineTemplatesHaveRendered(assert) { + var _this6 = this; + + assert.expect(2); + + var hooks = []; + + this.setupAppAndRoutelessEngine(hooks); + + return this.visit('/', { shouldRender: true }).then(function () { + _this6.assertText('ApplicationEngine'); + + _this6.assert.deepEqual(hooks, ['application - application', 'engine - application'], 'the expected hooks were fired'); + }); + }; + + _class.prototype['@test visit() with partials in routable engine'] = function testVisitWithPartialsInRoutableEngine(assert) { + var _this7 = this; + + assert.expect(2); + + var hooks = []; + + this.setupAppAndRoutableEngineWithPartial(hooks); + + return this.visit('/blog', { shouldRender: true }).then(function () { + _this7.assertText('ApplicationEngine foo partial'); + + _this7.assert.deepEqual(hooks, ['application - application', 'engine - application'], 'the expected hooks were fired'); + }); + }; + + _class.prototype['@test visit() with partials in non-routable engine'] = function testVisitWithPartialsInNonRoutableEngine(assert) { + var _this8 = this; + + assert.expect(2); + + var hooks = []; + + this.setupAppAndRoutlessEngineWithPartial(hooks); + + return this.visit('/', { shouldRender: true }).then(function () { + _this8.assertText('ApplicationEngine foo partial'); + + _this8.assert.deepEqual(hooks, ['application - application', 'engine - application'], 'the expected hooks were fired'); + }); + }; + + _class.prototype['@test deactivate should be called on Engine Routes before destruction'] = function testDeactivateShouldBeCalledOnEngineRoutesBeforeDestruction(assert) { + var _this9 = this; + + assert.expect(3); + + this.setupAppAndRoutableEngine(); + + this.registerEngine('blog', _emberApplication.Engine.extend({ + init: function () { + this._super.apply(this, arguments); + this.register('template:application', _emberGlimmerTestsUtilsHelpers.compile('Engine{{outlet}}')); + this.register('route:application', _emberRouting.Route.extend({ + deactivate: function () { + assert.notOk(this.isDestroyed, 'Route is not destroyed'); + assert.notOk(this.isDestroying, 'Route is not being destroyed'); + } + })); + } + })); + + return this.visit('/blog').then(function () { + _this9.assertText('ApplicationEngine'); + }); + }; + + _class.prototype['@test engine should lookup and use correct controller'] = function testEngineShouldLookupAndUseCorrectController(assert) { + var _this10 = this; + + this.setupAppAndRoutableEngine(); + + return this.visit('/blog?lang=English').then(function () { + _this10.assertText('ApplicationEngineEnglish'); + }); + }; + + _class.prototype['@test error substate route works for the application route of an Engine'] = function testErrorSubstateRouteWorksForTheApplicationRouteOfAnEngine(assert) { + var _this11 = this; + + assert.expect(2); + + this.setupAppAndRoutableEngine(); + this.application.__registry__.resolver.moduleBasedResolver = true; + this.additionalEngineRegistrations(function () { + this.register('template:application_error', _emberGlimmerTestsUtilsHelpers.compile('Error! {{model.message}}')); + this.register('route:post', _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.RSVP.reject(new Error('Oh, noes!')); + } + })); + }); + + return this.visit('/').then(function () { + _this11.assertText('Application'); + return _this11.transitionTo('blog.post'); + }).catch(function () { + _this11.assertText('ApplicationError! Oh, noes!'); + }); + }; + + _class.prototype['@test error route works for the application route of an Engine'] = function testErrorRouteWorksForTheApplicationRouteOfAnEngine(assert) { + var _this12 = this; + + assert.expect(2); + + this.setupAppAndRoutableEngine(); + this.application.__registry__.resolver.moduleBasedResolver = true; + this.additionalEngineRegistrations(function () { + this.register('template:error', _emberGlimmerTestsUtilsHelpers.compile('Error! {{model.message}}')); + this.register('route:post', _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.RSVP.reject(new Error('Oh, noes!')); + } + })); + }); + + return this.visit('/').then(function () { + _this12.assertText('Application'); + return _this12.transitionTo('blog.post'); + }).catch(function () { + _this12.assertText('ApplicationEngineError! Oh, noes!'); + }); + }; + + _class.prototype['@test error substate route works for a child route of an Engine'] = function testErrorSubstateRouteWorksForAChildRouteOfAnEngine(assert) { + var _this13 = this; + + assert.expect(2); + + this.setupAppAndRoutableEngine(); + this.application.__registry__.resolver.moduleBasedResolver = true; + this.additionalEngineRegistrations(function () { + this.register('template:post_error', _emberGlimmerTestsUtilsHelpers.compile('Error! {{model.message}}')); + this.register('route:post', _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.RSVP.reject(new Error('Oh, noes!')); + } + })); + }); + + return this.visit('/').then(function () { + _this13.assertText('Application'); + return _this13.transitionTo('blog.post'); + }).catch(function () { + _this13.assertText('ApplicationEngineError! Oh, noes!'); + }); + }; + + _class.prototype['@test error route works for a child route of an Engine'] = function testErrorRouteWorksForAChildRouteOfAnEngine(assert) { + var _this14 = this; + + assert.expect(2); + + this.setupAppAndRoutableEngine(); + this.application.__registry__.resolver.moduleBasedResolver = true; + this.additionalEngineRegistrations(function () { + this.register('template:post.error', _emberGlimmerTestsUtilsHelpers.compile('Error! {{model.message}}')); + this.register('route:post.comments', _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.RSVP.reject(new Error('Oh, noes!')); + } + })); + }); + + return this.visit('/').then(function () { + _this14.assertText('Application'); + return _this14.transitionTo('blog.post.comments'); + }).catch(function () { + _this14.assertText('ApplicationEngineError! Oh, noes!'); + }); + }; + + _class.prototype['@test loading substate route works for the application route of an Engine'] = function testLoadingSubstateRouteWorksForTheApplicationRouteOfAnEngine(assert) { + var _this15 = this; + + assert.expect(3); + + var resolveLoading = undefined; + + this.setupAppAndRoutableEngine(); + this.application.__registry__.resolver.moduleBasedResolver = true; + this.additionalEngineRegistrations(function () { + this.register('template:application_loading', _emberGlimmerTestsUtilsHelpers.compile('Loading')); + this.register('template:post', _emberGlimmerTestsUtilsHelpers.compile('Post')); + this.register('route:post', _emberRouting.Route.extend({ + model: function () { + return new _emberRuntime.RSVP.Promise(function (resolve) { + resolveLoading = resolve; + }); + } + })); + }); + + return this.visit('/').then(function () { + _this15.assertText('Application'); + var transition = _this15.transitionTo('blog.post'); + + _this15.runTaskNext(function () { + _this15.assertText('ApplicationLoading'); + resolveLoading(); + }); + + return transition.then(function () { + _this15.runTaskNext(function () { + return _this15.assertText('ApplicationEnginePost'); + }); + }); + }); + }; + + _class.prototype['@test loading route works for the application route of an Engine'] = function testLoadingRouteWorksForTheApplicationRouteOfAnEngine(assert) { + var _this16 = this; + + assert.expect(3); + + var resolveLoading = undefined; + + this.setupAppAndRoutableEngine(); + this.additionalEngineRegistrations(function () { + this.register('template:loading', _emberGlimmerTestsUtilsHelpers.compile('Loading')); + this.register('template:post', _emberGlimmerTestsUtilsHelpers.compile('Post')); + this.register('route:post', _emberRouting.Route.extend({ + model: function () { + return new _emberRuntime.RSVP.Promise(function (resolve) { + resolveLoading = resolve; + }); + } + })); + }); + + return this.visit('/').then(function () { + _this16.assertText('Application'); + var transition = _this16.transitionTo('blog.post'); + + _this16.runTaskNext(function () { + _this16.assertText('ApplicationEngineLoading'); + resolveLoading(); + }); + + return transition.then(function () { + _this16.runTaskNext(function () { + return _this16.assertText('ApplicationEnginePost'); + }); + }); + }); + }; + + _class.prototype['@test loading substate route works for a child route of an Engine'] = function testLoadingSubstateRouteWorksForAChildRouteOfAnEngine(assert) { + var _this17 = this; + + assert.expect(3); + + var resolveLoading = undefined; + + this.setupAppAndRoutableEngine(); + this.application.__registry__.resolver.moduleBasedResolver = true; + this.additionalEngineRegistrations(function () { + this.register('template:post', _emberGlimmerTestsUtilsHelpers.compile('{{outlet}}')); + this.register('template:post.comments', _emberGlimmerTestsUtilsHelpers.compile('Comments')); + this.register('template:post.likes_loading', _emberGlimmerTestsUtilsHelpers.compile('Loading')); + this.register('template:post.likes', _emberGlimmerTestsUtilsHelpers.compile('Likes')); + this.register('route:post.likes', _emberRouting.Route.extend({ + model: function () { + return new _emberRuntime.RSVP.Promise(function (resolve) { + resolveLoading = resolve; + }); + } + })); + }); + + return this.visit('/blog/post/comments').then(function () { + _this17.assertText('ApplicationEngineComments'); + var transition = _this17.transitionTo('blog.post.likes'); + + _this17.runTaskNext(function () { + _this17.assertText('ApplicationEngineLoading'); + resolveLoading(); + }); + + return transition.then(function () { + _this17.runTaskNext(function () { + return _this17.assertText('ApplicationEngineLikes'); + }); + }); + }); + }; + + _class.prototype['@test loading route works for a child route of an Engine'] = function testLoadingRouteWorksForAChildRouteOfAnEngine(assert) { + var _this18 = this; + + assert.expect(3); + + var resolveLoading = undefined; + + this.setupAppAndRoutableEngine(); + this.additionalEngineRegistrations(function () { + this.register('template:post', _emberGlimmerTestsUtilsHelpers.compile('{{outlet}}')); + this.register('template:post.comments', _emberGlimmerTestsUtilsHelpers.compile('Comments')); + this.register('template:post.loading', _emberGlimmerTestsUtilsHelpers.compile('Loading')); + this.register('template:post.likes', _emberGlimmerTestsUtilsHelpers.compile('Likes')); + this.register('route:post.likes', _emberRouting.Route.extend({ + model: function () { + return new _emberRuntime.RSVP.Promise(function (resolve) { + resolveLoading = resolve; + }); + } + })); + }); + + return this.visit('/blog/post/comments').then(function () { + _this18.assertText('ApplicationEngineComments'); + var transition = _this18.transitionTo('blog.post.likes'); + + _this18.runTaskNext(function () { + _this18.assertText('ApplicationEngineLoading'); + resolveLoading(); + }); + + return transition.then(function () { + _this18.runTaskNext(function () { + return _this18.assertText('ApplicationEngineLikes'); + }); + }); + }); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.ApplicationTest)); +}); +enifed('ember-glimmer/tests/integration/application/engine-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/application'); + test('ember-glimmer/tests/integration/application/engine-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/application/engine-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/application/engine-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/application'); + QUnit.test('ember-glimmer/tests/integration/application/engine-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/application/engine-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/application/rendering-test', ['exports', 'ember-runtime', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-routing'], function (exports, _emberRuntime, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberRouting) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n
      \n {{#each model as |item|}}\n
    • {{item}}
    • \n {{/each}}\n
    \n '], ['\n
      \n {{#each model as |item|}}\n
    • {{item}}
    • \n {{/each}}\n
    \n ']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n
      \n
    • red
    • \n
    • yellow
    • \n
    • blue
    • \n
    \n '], ['\n
      \n
    • red
    • \n
    • yellow
    • \n
    • blue
    • \n
    \n ']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['\n \n
    {{outlet}}
    \n '], ['\n \n
    {{outlet}}
    \n ']), + _templateObject4 = babelHelpers.taggedTemplateLiteralLoose(['\n Ember\n '], ['\n Ember\n ']), + _templateObject5 = babelHelpers.taggedTemplateLiteralLoose(['\n \n
    \n
      \n
    • red
    • \n
    • yellow
    • \n
    • blue
    • \n
    \n
    \n '], ['\n \n
    \n
      \n
    • red
    • \n
    • yellow
    • \n
    • blue
    • \n
    \n
    \n ']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Application test: rendering', (function (_ApplicationTest) { +babelHelpers.inherits(_class, _ApplicationTest); + + function _class() { + _ApplicationTest.apply(this, arguments); + } + + _class.prototype['@test it can render the application template'] = function testItCanRenderTheApplicationTemplate(assert) { + var _this = this; + + this.registerTemplate('application', 'Hello world!'); + + return this.visit('/').then(function () { + _this.assertText('Hello world!'); + }); + }; + + _class.prototype['@test it can access the model provided by the route'] = function testItCanAccessTheModelProvidedByTheRoute(assert) { + var _this2 = this; + + this.registerRoute('application', _emberRouting.Route.extend({ + model: function () { + return ['red', 'yellow', 'blue']; + } + })); + + this.registerTemplate('application', _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject)); + + return this.visit('/').then(function () { + _this2.assertComponentElement(_this2.firstChild, { + content: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2) + }); + }); + }; + + _class.prototype['@test it can render a nested route'] = function testItCanRenderANestedRoute(assert) { + var _this3 = this; + + this.router.map(function () { + this.route('lists', function () { + this.route('colors', function () { + this.route('favorite'); + }); + }); + }); + + // The "favorite" route will inherit the model + this.registerRoute('lists.colors', _emberRouting.Route.extend({ + model: function () { + return ['red', 'yellow', 'blue']; + } + })); + + this.registerTemplate('lists.colors.favorite', _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject)); + + return this.visit('/lists/colors/favorite').then(function () { + _this3.assertComponentElement(_this3.firstChild, { + content: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2) + }); + }); + }; + + _class.prototype['@test it can render into named outlets'] = function testItCanRenderIntoNamedOutlets(assert) { + var _this4 = this; + + this.router.map(function () { + this.route('colors'); + }); + + this.registerTemplate('application', _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3)); + + this.registerTemplate('nav', _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4)); + + this.registerRoute('application', _emberRouting.Route.extend({ + renderTemplate: function () { + this.render(); + this.render('nav', { + into: 'application', + outlet: 'nav' + }); + } + })); + + this.registerRoute('colors', _emberRouting.Route.extend({ + model: function () { + return ['red', 'yellow', 'blue']; + } + })); + + this.registerTemplate('colors', _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject)); + + return this.visit('/colors').then(function () { + _this4.assertComponentElement(_this4.firstChild, { + content: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5) + }); + }); + }; + + _class.prototype['@test it can render into named outlets'] = function testItCanRenderIntoNamedOutlets(assert) { + var _this5 = this; + + this.router.map(function () { + this.route('colors'); + }); + + this.registerTemplate('application', _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3)); + + this.registerTemplate('nav', _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4)); + + this.registerRoute('application', _emberRouting.Route.extend({ + renderTemplate: function () { + this.render(); + this.render('nav', { + into: 'application', + outlet: 'nav' + }); + } + })); + + this.registerRoute('colors', _emberRouting.Route.extend({ + model: function () { + return ['red', 'yellow', 'blue']; + } + })); + + this.registerTemplate('colors', _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject)); + + return this.visit('/colors').then(function () { + _this5.assertComponentElement(_this5.firstChild, { + content: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5) + }); + }); + }; + + _class.prototype['@test it should update the outlets when switching between routes'] = function testItShouldUpdateTheOutletsWhenSwitchingBetweenRoutes(assert) { + var _this6 = this; + + this.router.map(function () { + this.route('a'); + this.route('b', function () { + this.route('c'); + this.route('d'); + }); + }); + + this.registerTemplate('a', 'A{{outlet}}'); + this.registerTemplate('b', 'B{{outlet}}'); + this.registerTemplate('b.c', 'C'); + this.registerTemplate('b.d', 'D'); + + return this.visit('/b/c').then(function () { + // this.assertComponentElement(this.firstChild, { content: 'BC' }); + _this6.assertText('BC'); + return _this6.visit('/a'); + }).then(function () { + // this.assertComponentElement(this.firstChild, { content: 'A' }); + _this6.assertText('A'); + return _this6.visit('/b/d'); + }).then(function () { + _this6.assertText('BD'); + // this.assertComponentElement(this.firstChild, { content: 'BD' }); + }); + }; + + _class.prototype['@test it should produce a stable DOM when the model changes'] = function testItShouldProduceAStableDOMWhenTheModelChanges(assert) { + var _this7 = this; + + this.router.map(function () { + this.route('color', { path: '/colors/:color' }); + }); + + this.registerRoute('color', _emberRouting.Route.extend({ + model: function (params) { + return params.color; + } + })); + + this.registerTemplate('color', 'color: {{model}}'); + + return this.visit('/colors/red').then(function () { + _this7.assertComponentElement(_this7.firstChild, { content: 'color: red' }); + _this7.takeSnapshot(); + return _this7.visit('/colors/green'); + }).then(function () { + _this7.assertComponentElement(_this7.firstChild, { content: 'color: green' }); + _this7.assertInvariants(); + }); + }; + + _class.prototype['@test it should have the right controller in scope for the route template'] = function testItShouldHaveTheRightControllerInScopeForTheRouteTemplate() { + var _this8 = this; + + this.router.map(function () { + this.route('a'); + this.route('b'); + }); + + this.registerController('a', _emberRuntime.Controller.extend({ + value: 'a' + })); + + this.registerController('b', _emberRuntime.Controller.extend({ + value: 'b' + })); + + this.registerTemplate('a', '{{value}}'); + this.registerTemplate('b', '{{value}}'); + + return this.visit('/a').then(function () { + _this8.assertText('a'); + return _this8.visit('/b'); + }).then(function () { + return _this8.assertText('b'); + }); + }; + + _class.prototype['@test it should update correctly when the controller changes'] = function testItShouldUpdateCorrectlyWhenTheControllerChanges(assert) { + var _this9 = this; + + this.router.map(function () { + this.route('color', { path: '/colors/:color' }); + }); + + this.registerRoute('color', _emberRouting.Route.extend({ + model: function (params) { + return { color: params.color }; + }, + + renderTemplate: function (controller, model) { + this.render({ controller: model.color, model: model }); + } + })); + + this.registerController('red', _emberRuntime.Controller.extend({ + color: 'red' + })); + + this.registerController('green', _emberRuntime.Controller.extend({ + color: 'green' + })); + + this.registerTemplate('color', 'model color: {{model.color}}, controller color: {{color}}'); + + return this.visit('/colors/red').then(function () { + _this9.assertComponentElement(_this9.firstChild, { content: 'model color: red, controller color: red' }); + _this9.takeSnapshot(); + return _this9.visit('/colors/green'); + }).then(function () { + _this9.assertComponentElement(_this9.firstChild, { content: 'model color: green, controller color: green' }); + _this9.assertInvariants(); + }); + }; + + _class.prototype['@test it should produce a stable DOM when two routes render the same template'] = function testItShouldProduceAStableDOMWhenTwoRoutesRenderTheSameTemplate(assert) { + var _this10 = this; + + this.router.map(function () { + this.route('a'); + this.route('b'); + }); + + this.registerRoute('a', _emberRouting.Route.extend({ + model: function () { + return 'A'; + }, + + renderTemplate: function (controller, model) { + this.render('common', { controller: 'common', model: model }); + } + })); + + this.registerRoute('b', _emberRouting.Route.extend({ + model: function () { + return 'B'; + }, + + renderTemplate: function (controller, model) { + this.render('common', { controller: 'common', model: model }); + } + })); + + this.registerController('common', _emberRuntime.Controller.extend({ + prefix: 'common' + })); + + this.registerTemplate('common', '{{prefix}} {{model}}'); + + return this.visit('/a').then(function () { + _this10.assertComponentElement(_this10.firstChild, { content: 'common A' }); + _this10.takeSnapshot(); + return _this10.visit('/b'); + }).then(function () { + _this10.assertComponentElement(_this10.firstChild, { content: 'common B' }); + _this10.assertInvariants(); + }); + }; + + // Regression test, glimmer child outlets tried to assume the first element. + // but the if put-args clobbered the args used by did-create-element. + // I wish there was a way to assert that the OutletComponentManager did not + // receive a didCreateElement. + + _class.prototype['@test a child outlet is always a fragment'] = function testAChildOutletIsAlwaysAFragment() { + var _this11 = this; + + this.registerTemplate('application', '{{outlet}}'); + this.registerTemplate('index', '{{#if true}}1{{/if}}
    2
    '); + return this.visit('/').then(function () { + _this11.assertComponentElement(_this11.firstChild, { content: '1
    2
    ' }); + }); + }; + + _class.prototype['@test it allows a transition during route activate'] = function testItAllowsATransitionDuringRouteActivate(assert) { + var _this12 = this; + + this.router.map(function () { + this.route('a'); + }); + + this.registerRoute('index', _emberRouting.Route.extend({ + activate: function () { + this.transitionTo('a'); + } + })); + + this.registerTemplate('a', 'Hello from A!'); + + return this.visit('/').then(function () { + _this12.assertComponentElement(_this12.firstChild, { + content: 'Hello from A!' + }); + }); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.ApplicationTest)); +}); +enifed('ember-glimmer/tests/integration/application/rendering-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/application'); + test('ember-glimmer/tests/integration/application/rendering-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/application/rendering-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/application/rendering-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/application'); + QUnit.test('ember-glimmer/tests/integration/application/rendering-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/application/rendering-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/binding_integration_test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Binding integration tests', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test should accept bindings as a string or an Ember.binding'] = function testShouldAcceptBindingsAsAStringOrAnEmberBinding() { + var _this = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + twoWayTestBinding: _emberMetal.Binding.from('direction'), + stringTestBinding: 'direction', + twoWayObjectTestBinding: _emberMetal.Binding.from('displacement.distance'), + stringObjectTestBinding: 'displacement.distance' + }); + + this.registerComponent('foo-bar', { + ComponentClass: FooBarComponent, + template: 'two way: {{twoWayTest}}, string: {{stringTest}}, object: {{twoWayObjectTest}}, string object: {{stringObjectTest}}' + }); + + expectDeprecation(function () { + _this.render('{{foo-bar direction=direction displacement=displacement}}', { + direction: 'down', + displacement: { + distance: 10 + } + }); + }, /`Ember\.Binding` is deprecated/); + + this.assertText('two way: down, string: down, object: 10, string object: 10'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'direction', 'up'); + }); + + this.assertText('two way: up, string: up, object: 10, string object: 10'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'displacement.distance', 20); + }); + + this.assertText('two way: up, string: up, object: 20, string object: 20'); + + this.runTask(function () { + _emberMetal.set(_this.context, 'direction', 'right'); + _emberMetal.set(_this.context, 'displacement.distance', 30); + }); + + this.assertText('two way: right, string: right, object: 30, string object: 30'); + + this.runTask(function () { + _emberMetal.set(_this.context, 'direction', 'down'); + _emberMetal.set(_this.context, 'displacement', { distance: 10 }); + }); + + this.assertText('two way: down, string: down, object: 10, string object: 10'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/binding_integration_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration'); + test('ember-glimmer/tests/integration/binding_integration_test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/binding_integration_test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/binding_integration_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration'); + QUnit.test('ember-glimmer/tests/integration/binding_integration_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/binding_integration_test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/append-test', ['exports', 'ember-metal', 'ember-views', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberMetal, _emberViews, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsAbstractTestCase) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if showFooBar}}\n {{foo-bar}}\n {{else}}\n {{baz-qux}}\n {{/if}}\n '], ['\n {{#if showFooBar}}\n {{foo-bar}}\n {{else}}\n {{baz-qux}}\n {{/if}}\n ']); + + var AbstractAppendTest = (function (_RenderingTest) { +babelHelpers.inherits(AbstractAppendTest, _RenderingTest); + + function AbstractAppendTest() { + _RenderingTest.call(this); + + this.components = []; + this.ids = []; + } + + AbstractAppendTest.prototype.teardown = function teardown() { + var _this = this; + + this.component = null; + + this.components.forEach(function (component) { + _this.runTask(function () { + return component.destroy(); + }); + }); + + this.ids.forEach(function (id) { + var $element = _emberViews.jQuery(id).remove(); + _this.assert.strictEqual($element.length, 0, 'Should not leak element: #' + id); + }); + + _RenderingTest.prototype.teardown.call(this); + }; + + /* abstract append(component): Element; */ + + AbstractAppendTest.prototype.didAppend = function didAppend(component) { + this.components.push(component); + this.ids.push(component.elementId); + }; + + AbstractAppendTest.prototype['@test lifecycle hooks during component append'] = function testLifecycleHooksDuringComponentAppend(assert) { + var _this3 = this; + + var hooks = []; + + var oldRegisterComponent = this.registerComponent; + var componentsByName = {}; + + // TODO: refactor/combine with other life-cycle tests + this.registerComponent = function (name, _options) { + function pushHook(hookName) { + hooks.push([name, hookName]); + } + + var options = { + ComponentClass: _options.ComponentClass.extend({ + init: function () { + var _this2 = this, + _arguments = arguments; + + expectDeprecation(function () { + _this2._super.apply(_this2, _arguments); + }, /didInitAttrs called/); + if (name in componentsByName) { + throw new TypeError('Component named: ` ' + name + ' ` already registered'); + } + componentsByName[name] = this; + pushHook('init'); + this.on('init', function () { + return pushHook('on(init)'); + }); + }, + + didInitAttrs: function (options) { + pushHook('didInitAttrs', options); + }, + + didReceiveAttrs: function () { + pushHook('didReceiveAttrs'); + }, + + willInsertElement: function () { + pushHook('willInsertElement'); + }, + + willRender: function () { + pushHook('willRender'); + }, + + didInsertElement: function () { + pushHook('didInsertElement'); + }, + + didRender: function () { + pushHook('didRender'); + }, + + didUpdateAttrs: function () { + pushHook('didUpdateAttrs'); + }, + + willUpdate: function () { + pushHook('willUpdate'); + }, + + didUpdate: function () { + pushHook('didUpdate'); + }, + + willDestroyElement: function () { + pushHook('willDestroyElement'); + }, + + willClearRender: function () { + pushHook('willClearRender'); + }, + + didDestroyElement: function () { + pushHook('didDestroyElement'); + }, + + willDestroy: function () { + pushHook('willDestroy'); + this._super.apply(this, arguments); + } + }), + template: _options.template + }; + + oldRegisterComponent.call(this, name, options); + }; + + this.registerComponent('x-parent', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + layoutName: 'components/x-parent' + }), + + template: '[parent: {{foo}}]{{#x-child bar=foo}}[yielded: {{foo}}]{{/x-child}}' + }); + + this.registerComponent('x-child', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '' + }), + + template: '[child: {{bar}}]{{yield}}' + }); + + var XParent = this.owner._lookupFactory('component:x-parent'); + + this.component = XParent.create({ foo: 'zomg' }); + + assert.deepEqual(hooks, [['x-parent', 'init'], ['x-parent', 'didInitAttrs'], ['x-parent', 'didReceiveAttrs'], ['x-parent', 'on(init)']], 'creation of x-parent'); + + hooks.length = 0; + + this.element = this.append(this.component); + + assert.deepEqual(hooks, [['x-parent', 'willInsertElement'], ['x-child', 'init'], ['x-child', 'didInitAttrs'], ['x-child', 'didReceiveAttrs'], ['x-child', 'on(init)'], ['x-child', 'willRender'], ['x-child', 'willInsertElement'], ['x-child', 'didInsertElement'], ['x-child', 'didRender'], ['x-parent', 'didInsertElement'], ['x-parent', 'didRender']], 'appending of x-parent'); + + hooks.length = 0; + + this.runTask(function () { + return componentsByName['x-parent'].rerender(); + }); + + assert.deepEqual(hooks, [['x-parent', 'willUpdate'], ['x-parent', 'willRender'], ['x-parent', 'didUpdate'], ['x-parent', 'didRender']], 'rerender x-parent'); + + hooks.length = 0; + + this.runTask(function () { + return componentsByName['x-child'].rerender(); + }); + + assert.deepEqual(hooks, [['x-parent', 'willUpdate'], ['x-parent', 'willRender'], ['x-child', 'willUpdate'], ['x-child', 'willRender'], ['x-child', 'didUpdate'], ['x-child', 'didRender'], ['x-parent', 'didUpdate'], ['x-parent', 'didRender']], 'rerender x-child'); + + hooks.length = 0; + + this.runTask(function () { + return _emberMetal.set(_this3.component, 'foo', 'wow'); + }); + + assert.deepEqual(hooks, [['x-parent', 'willUpdate'], ['x-parent', 'willRender'], ['x-child', 'didUpdateAttrs'], ['x-child', 'didReceiveAttrs'], ['x-child', 'willUpdate'], ['x-child', 'willRender'], ['x-child', 'didUpdate'], ['x-child', 'didRender'], ['x-parent', 'didUpdate'], ['x-parent', 'didRender']], 'set foo = wow'); + + hooks.length = 0; + + this.runTask(function () { + return _emberMetal.set(_this3.component, 'foo', 'zomg'); + }); + + assert.deepEqual(hooks, [['x-parent', 'willUpdate'], ['x-parent', 'willRender'], ['x-child', 'didUpdateAttrs'], ['x-child', 'didReceiveAttrs'], ['x-child', 'willUpdate'], ['x-child', 'willRender'], ['x-child', 'didUpdate'], ['x-child', 'didRender'], ['x-parent', 'didUpdate'], ['x-parent', 'didRender']], 'set foo = zomg'); + + hooks.length = 0; + + this.runTask(function () { + return _this3.component.destroy(); + }); + + assert.deepEqual(hooks, [['x-parent', 'willDestroyElement'], ['x-parent', 'willClearRender'], ['x-child', 'willDestroyElement'], ['x-child', 'willClearRender'], ['x-child', 'didDestroyElement'], ['x-parent', 'didDestroyElement'], ['x-parent', 'willDestroy'], ['x-child', 'willDestroy']], 'destroy'); + }; + + AbstractAppendTest.prototype['@test appending, updating and destroying a single component'] = function testAppendingUpdatingAndDestroyingASingleComponent(assert) { + var _this4 = this; + + var willDestroyCalled = 0; + + this.registerComponent('x-parent', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + layoutName: 'components/x-parent', + willDestroyElement: function () { + willDestroyCalled++; + } + }), + + template: '[parent: {{foo}}]{{#x-child bar=foo}}[yielded: {{foo}}]{{/x-child}}' + }); + + this.registerComponent('x-child', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '' + }), + + template: '[child: {{bar}}]{{yield}}' + }); + + var XParent = this.owner._lookupFactory('component:x-parent'); + + this.component = XParent.create({ foo: 'zomg' }); + + assert.ok(!this.component.element, 'precond - should not have an element'); + + this.element = this.append(this.component); + + var componentElement = this.component.element; + + this.assertComponentElement(componentElement, { content: '[parent: zomg][child: zomg][yielded: zomg]' }); + + assert.equal(componentElement.parentElement, this.element, 'It should be attached to the target'); + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assertComponentElement(componentElement, { content: '[parent: zomg][child: zomg][yielded: zomg]' }); + + assert.equal(componentElement.parentElement, this.element, 'It should be attached to the target'); + + this.runTask(function () { + return _emberMetal.set(_this4.component, 'foo', 'wow'); + }); + + this.assertComponentElement(componentElement, { content: '[parent: wow][child: wow][yielded: wow]' }); + + assert.equal(componentElement.parentElement, this.element, 'It should be attached to the target'); + + this.runTask(function () { + return _emberMetal.set(_this4.component, 'foo', 'zomg'); + }); + + this.assertComponentElement(componentElement, { content: '[parent: zomg][child: zomg][yielded: zomg]' }); + + assert.equal(componentElement.parentElement, this.element, 'It should be attached to the target'); + + this.runTask(function () { + return _this4.component.destroy(); + }); + + if (this.isHTMLBars) { + // Bug in Glimmer – component should not have .element at this point + assert.ok(!this.component.element, 'It should not have an element'); + } + + assert.ok(!componentElement.parentElement, 'The component element should be detached'); + + this.assert.equal(willDestroyCalled, 1); + }; + + AbstractAppendTest.prototype['@test appending, updating and destroying multiple components'] = function testAppendingUpdatingAndDestroyingMultipleComponents(assert) { + var _this5 = this; + + var willDestroyCalled = 0; + + this.registerComponent('x-first', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + layoutName: 'components/x-first', + + willDestroyElement: function () { + willDestroyCalled++; + } + }), + + template: 'x-first {{foo}}!' + }); + + this.registerComponent('x-second', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + layoutName: 'components/x-second', + + willDestroyElement: function () { + willDestroyCalled++; + } + }), + + template: 'x-second {{bar}}!' + }); + + var First = this.owner._lookupFactory('component:x-first'); + var Second = this.owner._lookupFactory('component:x-second'); + + var first = First.create({ foo: 'foo' }); + var second = Second.create({ bar: 'bar' }); + + this.assert.ok(!first.element, 'precond - should not have an element'); + this.assert.ok(!second.element, 'precond - should not have an element'); + + var wrapper1 = undefined, + wrapper2 = undefined; + + this.runTask(function () { + return wrapper1 = _this5.append(first); + }); + this.runTask(function () { + return wrapper2 = _this5.append(second); + }); + + var componentElement1 = first.element; + var componentElement2 = second.element; + + this.assertComponentElement(componentElement1, { content: 'x-first foo!' }); + this.assertComponentElement(componentElement2, { content: 'x-second bar!' }); + + assert.equal(componentElement1.parentElement, wrapper1, 'The first component should be attached to the target'); + assert.equal(componentElement2.parentElement, wrapper2, 'The second component should be attached to the target'); + + this.runTask(function () { + return _emberMetal.set(first, 'foo', 'FOO'); + }); + + this.assertComponentElement(componentElement1, { content: 'x-first FOO!' }); + this.assertComponentElement(componentElement2, { content: 'x-second bar!' }); + + assert.equal(componentElement1.parentElement, wrapper1, 'The first component should be attached to the target'); + assert.equal(componentElement2.parentElement, wrapper2, 'The second component should be attached to the target'); + + this.runTask(function () { + return _emberMetal.set(second, 'bar', 'BAR'); + }); + + this.assertComponentElement(componentElement1, { content: 'x-first FOO!' }); + this.assertComponentElement(componentElement2, { content: 'x-second BAR!' }); + + assert.equal(componentElement1.parentElement, wrapper1, 'The first component should be attached to the target'); + assert.equal(componentElement2.parentElement, wrapper2, 'The second component should be attached to the target'); + + this.runTask(function () { + _emberMetal.set(first, 'foo', 'foo'); + _emberMetal.set(second, 'bar', 'bar'); + }); + + this.assertComponentElement(componentElement1, { content: 'x-first foo!' }); + this.assertComponentElement(componentElement2, { content: 'x-second bar!' }); + + assert.equal(componentElement1.parentElement, wrapper1, 'The first component should be attached to the target'); + assert.equal(componentElement2.parentElement, wrapper2, 'The second component should be attached to the target'); + + this.runTask(function () { + first.destroy(); + second.destroy(); + }); + + if (this.isHTMLBars) { + // Bug in Glimmer – component should not have .element at this point + assert.ok(!first.element, 'The first component should not have an element'); + assert.ok(!second.element, 'The second component should not have an element'); + } + + assert.ok(!componentElement1.parentElement, 'The first component element should be detached'); + assert.ok(!componentElement2.parentElement, 'The second component element should be detached'); + + this.assert.equal(willDestroyCalled, 2); + }; + + AbstractAppendTest.prototype['@test can appendTo while rendering'] = function testCanAppendToWhileRendering(assert) { + var _this6 = this; + + var owner = this.owner; + + var append = function (component) { + return _this6.append(component); + }; + + var wrapper1 = undefined, + wrapper2 = undefined, + element1 = undefined, + element2 = undefined; + this.registerComponent('first-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + layout: _emberGlimmerTestsUtilsHelpers.compile('component-one'), + + didInsertElement: function () { + element1 = this.element; + var SecondComponent = owner._lookupFactory('component:second-component'); + + wrapper2 = append(SecondComponent.create()); + } + }) + }); + + this.registerComponent('second-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + layout: _emberGlimmerTestsUtilsHelpers.compile('component-two'), + + didInsertElement: function () { + element2 = this.element; + } + }) + }); + + var FirstComponent = this.owner._lookupFactory('component:first-component'); + + this.runTask(function () { + return wrapper1 = append(FirstComponent.create()); + }); + + this.assertComponentElement(element1, { content: 'component-one' }); + this.assertComponentElement(element2, { content: 'component-two' }); + }; + + AbstractAppendTest.prototype['@test can appendTo and remove while rendering'] = function testCanAppendToAndRemoveWhileRendering(assert) { + var _this7 = this; + + var owner = this.owner; + + var append = function (component) { + return _this7.append(component); + }; + + var element1 = undefined, + element2 = undefined, + element3 = undefined, + element4 = undefined, + component1 = undefined, + component2 = undefined; + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + layout: _emberGlimmerTestsUtilsHelpers.compile('foo-bar'), + + init: function () { + this._super.apply(this, arguments); + component1 = this; + }, + + didInsertElement: function () { + element1 = this.element; + var OtherRoot = owner._lookupFactory('component:other-root'); + + this._instance = OtherRoot.create({ + didInsertElement: function () { + element2 = this.element; + } + }); + + append(this._instance); + }, + + willDestroy: function () { + this._instance.destroy(); + } + }) + }); + + this.registerComponent('baz-qux', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + layout: _emberGlimmerTestsUtilsHelpers.compile('baz-qux'), + + init: function () { + this._super.apply(this, arguments); + component2 = this; + }, + + didInsertElement: function () { + element3 = this.element; + var OtherRoot = owner._lookupFactory('component:other-root'); + + this._instance = OtherRoot.create({ + didInsertElement: function () { + element4 = this.element; + } + }); + + append(this._instance); + }, + + willDestroy: function () { + this._instance.destroy(); + } + }) + }); + + var instantiatedRoots = 0; + var destroyedRoots = 0; + this.registerComponent('other-root', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + layout: _emberGlimmerTestsUtilsHelpers.compile('fake-thing: {{counter}}'), + init: function () { + this._super.apply(this, arguments); + this.counter = instantiatedRoots++; + }, + willDestroy: function () { + destroyedRoots++; + this._super.apply(this, arguments); + } + }) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { showFooBar: true }); + + this.assertComponentElement(element1, {}); + this.assertComponentElement(element2, { content: 'fake-thing: 0' }); + assert.equal(instantiatedRoots, 1); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'showFooBar', false); + }); + + assert.equal(instantiatedRoots, 2); + assert.equal(destroyedRoots, 1); + + this.assertComponentElement(element3, {}); + this.assertComponentElement(element4, { content: 'fake-thing: 1' }); + + this.runTask(function () { + component1.destroy(); + component2.destroy(); + }); + + assert.equal(instantiatedRoots, 2); + assert.equal(destroyedRoots, 2); + }; + + return AbstractAppendTest; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest); + + _emberGlimmerTestsUtilsTestCase.moduleFor('append: no arguments (attaching to document.body)', (function (_AbstractAppendTest) { +babelHelpers.inherits(_class, _AbstractAppendTest); + + function _class() { + _AbstractAppendTest.apply(this, arguments); + } + + _class.prototype.append = function append(component) { + this.runTask(function () { + return component.append(); + }); + this.didAppend(component); + return document.body; + }; + + return _class; + })(AbstractAppendTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('appendTo: a selector', (function (_AbstractAppendTest2) { +babelHelpers.inherits(_class2, _AbstractAppendTest2); + + function _class2() { + _AbstractAppendTest2.apply(this, arguments); + } + + _class2.prototype.append = function append(component) { + this.runTask(function () { + return component.appendTo('#qunit-fixture'); + }); + this.didAppend(component); + return _emberViews.jQuery('#qunit-fixture')[0]; + }; + + _class2.prototype['@test raises an assertion when the target does not exist in the DOM'] = function testRaisesAnAssertionWhenTheTargetDoesNotExistInTheDOM(assert) { + var _this8 = this; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + layoutName: 'components/foo-bar' + }), + template: 'FOO BAR!' + }); + + var FooBar = this.owner._lookupFactory('component:foo-bar'); + + this.component = FooBar.create(); + + assert.ok(!this.component.element, 'precond - should not have an element'); + + this.runTask(function () { + expectAssertion(function () { + _this8.component.appendTo('#does-not-exist-in-dom'); + }, /You tried to append to \(#does-not-exist-in-dom\) but that isn't in the DOM/); + }); + + assert.ok(!this.component.element, 'component should not have an element'); + }; + + return _class2; + })(AbstractAppendTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('appendTo: an element', (function (_AbstractAppendTest3) { +babelHelpers.inherits(_class3, _AbstractAppendTest3); + + function _class3() { + _AbstractAppendTest3.apply(this, arguments); + } + + _class3.prototype.append = function append(component) { + var element = _emberViews.jQuery('#qunit-fixture')[0]; + this.runTask(function () { + return component.appendTo(element); + }); + this.didAppend(component); + return element; + }; + + return _class3; + })(AbstractAppendTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('appendTo: with multiple components', (function (_AbstractAppendTest4) { +babelHelpers.inherits(_class4, _AbstractAppendTest4); + + function _class4() { + _AbstractAppendTest4.apply(this, arguments); + } + + _class4.prototype.append = function append(component) { + this.runTask(function () { + return component.appendTo('#qunit-fixture'); + }); + this.didAppend(component); + return _emberViews.jQuery('#qunit-fixture')[0]; + }; + + return _class4; + })(AbstractAppendTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('renderToElement: no arguments (defaults to a body context)', (function (_AbstractAppendTest5) { +babelHelpers.inherits(_class5, _AbstractAppendTest5); + + function _class5() { + _AbstractAppendTest5.apply(this, arguments); + } + + _class5.prototype.append = function append(component) { + var wrapper = undefined; + + this.runTask(function () { + return wrapper = component.renderToElement(); + }); + this.didAppend(component); + + this.assert.equal(wrapper.tagName, 'BODY', 'wrapper is a body element'); + this.assert.notEqual(wrapper, document.body, 'wrapper is not document.body'); + this.assert.ok(!wrapper.parentNode, 'wrapper is detached'); + + return wrapper; + }; + + return _class5; + })(AbstractAppendTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('renderToElement: a div', (function (_AbstractAppendTest6) { +babelHelpers.inherits(_class6, _AbstractAppendTest6); + + function _class6() { + _AbstractAppendTest6.apply(this, arguments); + } + + _class6.prototype.append = function append(component) { + var wrapper = undefined; + + this.runTask(function () { + return wrapper = component.renderToElement('div'); + }); + this.didAppend(component); + + this.assert.equal(wrapper.tagName, 'DIV', 'wrapper is a body element'); + this.assert.ok(!wrapper.parentNode, 'wrapper is detached'); + + return wrapper; + }; + + return _class6; + })(AbstractAppendTest)); +}); +enifed('ember-glimmer/tests/integration/components/append-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/append-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/append-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/append-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/append-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/append-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/attribute-bindings-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberMetal) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{foo-bar hasFoo=true foo=foo hasBar=false bar=bar}}\n {{foo-bar hasFoo=false foo=foo hasBar=true bar=bar}}\n {{foo-bar hasFoo=true foo=foo hasBar=true bar=bar}}\n {{foo-bar hasFoo=false foo=foo hasBar=false bar=bar}}\n '], ['\n {{foo-bar hasFoo=true foo=foo hasBar=false bar=bar}}\n {{foo-bar hasFoo=false foo=foo hasBar=true bar=bar}}\n {{foo-bar hasFoo=true foo=foo hasBar=true bar=bar}}\n {{foo-bar hasFoo=false foo=foo hasBar=false bar=bar}}\n ']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Attribute bindings integration', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test it can have attribute bindings'] = function testItCanHaveAttributeBindings() { + var _this = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['foo:data-foo', 'bar:data-bar'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar foo=foo bar=bar}}', { foo: 'foo', bar: 'bar' }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'data-foo': 'foo', 'data-bar': 'bar' }, content: 'hello' }); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'data-foo': 'foo', 'data-bar': 'bar' }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this.context, 'foo', 'FOO'); + _emberMetal.set(_this.context, 'bar', undefined); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'data-foo': 'FOO' }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this.context, 'foo', 'foo'); + _emberMetal.set(_this.context, 'bar', 'bar'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'data-foo': 'foo', 'data-bar': 'bar' }, content: 'hello' }); + }; + + _class.prototype['@test it can have attribute bindings with attrs'] = function testItCanHaveAttributeBindingsWithAttrs() { + var _this2 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['attrs.foo:data-foo', 'attrs.baz.bar:data-bar'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar foo=model.foo baz=model.baz}}', { + model: { foo: undefined, baz: { bar: 'bar' } } + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'data-bar': 'bar' } }); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'data-bar': 'bar' } }); + + this.runTask(function () { + _emberMetal.set(_this2.context, 'model.foo', 'foo'); + _emberMetal.set(_this2.context, 'model.baz.bar', undefined); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'data-foo': 'foo' }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'model', { + foo: undefined, baz: { bar: 'bar' } + }); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'data-bar': 'bar' } }); + }; + + _class.prototype['@test it can have attribute bindings with a nested path'] = function testItCanHaveAttributeBindingsWithANestedPath() { + var _this3 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['foo.bar:data-foo-bar'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar foo=foo}}', { foo: { bar: 'foo-bar' } }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'data-foo-bar': 'foo-bar' }, content: 'hello' }); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'data-foo-bar': 'foo-bar' }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'foo.bar', 'FOO-BAR'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'data-foo-bar': 'FOO-BAR' }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'foo.bar', undefined); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: {}, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'foo', undefined); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: {}, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'foo', { bar: 'foo-bar' }); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'data-foo-bar': 'foo-bar' }, content: 'hello' }); + }; + + _class.prototype['@test handles non-microsyntax attributeBindings'] = function testHandlesNonMicrosyntaxAttributeBindings() { + var _this4 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['type'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar type=submit}}', { + submit: 'submit' + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { type: 'submit' }, content: 'hello' }); + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { type: 'submit' }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'submit', 'password'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { type: 'password' }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'submit', null); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: {}, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'submit', 'submit'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { type: 'submit' }, content: 'hello' }); + }; + + _class.prototype['@test non-microsyntax attributeBindings cannot contain nested paths'] = function testNonMicrosyntaxAttributeBindingsCannotContainNestedPaths() { + var _this5 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['foo.bar'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + expectAssertion(function () { + _this5.render('{{foo-bar foo=foo}}', { foo: { bar: 'foo-bar' } }); + }, /Illegal attributeBinding: 'foo.bar' is not a valid attribute name./); + }; + + _class.prototype['@test normalizes attributeBindings for property names'] = function testNormalizesAttributeBindingsForPropertyNames() { + var _this6 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['tiTLe'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar tiTLe=name}}', { + name: 'qux' + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { title: 'qux' }, content: 'hello' }); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'name', null); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: {}, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'name', 'qux'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { title: 'qux' }, content: 'hello' }); + }; + + _class.prototype['@test normalizes attributeBindings for attribute names'] = function testNormalizesAttributeBindingsForAttributeNames() { + var _this7 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['foo:data-FOO'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar foo=foo}}', { + foo: 'qux' + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'data-foo': 'qux' }, content: 'hello' }); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'foo', null); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: {}, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'foo', 'qux'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'data-foo': 'qux' }, content: 'hello' }); + }; + + _class.prototype['@test attributeBindings handles null/undefined'] = function testAttributeBindingsHandlesNullUndefined() { + var _this8 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['fizz', 'bar'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar fizz=fizz bar=bar}}', { + fizz: null, + bar: undefined + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: {}, content: 'hello' }); + + this.runTask(function () { + return _this8.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: {}, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this8.context, 'fizz', 'fizz'); + _emberMetal.set(_this8.context, 'bar', 'bar'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { fizz: 'fizz', bar: 'bar' }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this8.context, 'fizz', null); + _emberMetal.set(_this8.context, 'bar', undefined); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: {}, content: 'hello' }); + }; + + _class.prototype['@test attributeBindings handles number value'] = function testAttributeBindingsHandlesNumberValue() { + var _this9 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['size'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar size=size}}', { + size: 21 + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { size: '21' }, content: 'hello' }); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { size: '21' }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'size', 0); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { size: '0' }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'size', 21); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { size: '21' }, content: 'hello' }); + }; + + _class.prototype['@test handles internal and external changes'] = function testHandlesInternalAndExternalChanges() { + var _this10 = this; + + var component = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['type'], + type: 'password', + init: function () { + this._super.apply(this, arguments); + component = this; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar}}'); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { type: 'password' }, content: 'hello' }); + + this.runTask(function () { + return _this10.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { type: 'password' }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(component, 'type', 'checkbox'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { type: 'checkbox' }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(component, 'type', 'password'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { type: 'password' }, content: 'hello' }); + }; + + _class.prototype['@test can set attributeBindings on component with a different tagName'] = function testCanSetAttributeBindingsOnComponentWithADifferentTagName() { + var _this11 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'input', + attributeBindings: ['type', 'isDisabled:disabled'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent }); + + this.render('{{foo-bar type=type isDisabled=disabled}}', { + type: 'password', + disabled: false + }); + + this.assertComponentElement(this.firstChild, { tagName: 'input', attrs: { type: 'password' } }); + + this.runTask(function () { + return _this11.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'input', attrs: { type: 'password' } }); + + this.runTask(function () { + _emberMetal.set(_this11.context, 'type', 'checkbox'); + _emberMetal.set(_this11.context, 'disabled', true); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'input', attrs: { type: 'checkbox', disabled: '' } }); + + this.runTask(function () { + _emberMetal.set(_this11.context, 'type', 'password'); + _emberMetal.set(_this11.context, 'disabled', false); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'input', attrs: { type: 'password' } }); + }; + + _class.prototype['@test should allow namespaced attributes in micro syntax'] = function testShouldAllowNamespacedAttributesInMicroSyntax() { + var _this12 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['xlinkHref:xlink:href'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent }); + + this.render('{{foo-bar type=type xlinkHref=xlinkHref}}', { + xlinkHref: '/foo.png' + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'xlink:href': '/foo.png' } }); + + this.runTask(function () { + return _this12.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'xlink:href': '/foo.png' } }); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'xlinkHref', '/lol.png'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'xlink:href': '/lol.png' } }); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'xlinkHref', '/foo.png'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'xlink:href': '/foo.png' } }); + }; + + // This comes into play when using the {{#each}} helper. If the + // passed array item is a String, it will be converted into a + // String object instead of a normal string. + + _class.prototype['@test should allow for String objects'] = function testShouldAllowForStringObjects() { + var _this13 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['foo'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent }); + + this.render('{{foo-bar foo=foo}}', { + foo: (function () { + return this; + }).call('bar') + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'foo': 'bar' } }); + + this.runTask(function () { + return _this13.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'foo': 'bar' } }); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'foo', (function () { + return this; + }).call('baz')); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'foo': 'baz' } }); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'foo', (function () { + return this; + }).call('bar')); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'foo': 'bar' } }); + }; + + _class.prototype['@test can set id initially via attributeBindings '] = function testCanSetIdInitiallyViaAttributeBindings() { + var _this14 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['specialSauce:id'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent }); + + this.render('{{foo-bar specialSauce=sauce}}', { + sauce: 'special-sauce' + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'id': 'special-sauce' } }); + + this.runTask(function () { + return _this14.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'id': 'special-sauce' } }); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'sauce', 'foo'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'id': 'special-sauce' } }); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'sauce', 'special-sauce'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'id': 'special-sauce' } }); + }; + + _class.prototype['@test attributeBindings are overwritten'] = function testAttributeBindingsAreOverwritten() { + var _this15 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['href'], + href: 'a href' + }); + + var FizzBarComponent = FooBarComponent.extend({ + attributeBindings: ['newHref:href'] + }); + + this.registerComponent('fizz-bar', { ComponentClass: FizzBarComponent }); + + this.render('{{fizz-bar newHref=href}}', { + href: 'dog.html' + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { href: 'dog.html' } }); + + this.runTask(function () { + return _this15.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { href: 'dog.html' } }); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'href', 'cat.html'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { href: 'cat.html' } }); + }; + + _class.prototype['@test it can set attribute bindings in the constructor'] = function testItCanSetAttributeBindingsInTheConstructor() { + var _this16 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + + var bindings = []; + + if (this.get('hasFoo')) { + bindings.push('foo:data-foo'); + } + + if (this.get('hasBar')) { + bindings.push('bar:data-bar'); + } + + this.attributeBindings = bindings; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { foo: 'foo', bar: 'bar' }); + + this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'data-foo': 'foo' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: { 'data-bar': 'bar' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'data-foo': 'foo', 'data-bar': 'bar' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(3), { tagName: 'div', attrs: {}, content: 'hello' }); + + this.runTask(function () { + return _this16.rerender(); + }); + + this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'data-foo': 'foo' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: { 'data-bar': 'bar' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'data-foo': 'foo', 'data-bar': 'bar' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(3), { tagName: 'div', attrs: {}, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this16.context, 'foo', 'FOO'); + _emberMetal.set(_this16.context, 'bar', undefined); + }); + + this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'data-foo': 'FOO' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: {}, content: 'hello' }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'data-foo': 'FOO' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(3), { tagName: 'div', attrs: {}, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this16.context, 'bar', 'BAR'); + }); + + this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'data-foo': 'FOO' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: { 'data-bar': 'BAR' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'data-foo': 'FOO', 'data-bar': 'BAR' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(3), { tagName: 'div', attrs: {}, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this16.context, 'foo', 'foo'); + _emberMetal.set(_this16.context, 'bar', 'bar'); + }); + + this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'data-foo': 'foo' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: { 'data-bar': 'bar' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'data-foo': 'foo', 'data-bar': 'bar' }, content: 'hello' }); + this.assertComponentElement(this.nthChild(3), { tagName: 'div', attrs: {}, content: 'hello' }); + }; + + _class.prototype['@test it should not allow attributeBindings to be set'] = function testItShouldNotAllowAttributeBindingsToBeSet() { + var _this17 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + expectAssertion(function () { + _this17.render('{{foo-bar attributeBindings="one two"}}'); + }, /Setting 'attributeBindings' via template helpers is not allowed/); + }; + + _class.prototype['@test asserts if an attributeBinding is setup on class'] = function testAssertsIfAnAttributeBindingIsSetupOnClass() { + var _this18 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['class'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + expectAssertion(function () { + _this18.render('{{foo-bar}}'); + }, /You cannot use class as an attributeBinding, use classNameBindings instead./i); + }; + + _class.prototype['@test blacklists href bindings based on protocol'] = function testBlacklistsHrefBindingsBasedOnProtocol() { + /* jshint scripturl:true */ + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'a', + attributeBindings: ['href'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar href=xss}}', { + xss: 'javascript:alert(\'foo\')' + }); + + this.assertComponentElement(this.firstChild, { tagName: 'a', attrs: { href: 'unsafe:javascript:alert(\'foo\')' } }); + }; + + _class.prototype['@test it can bind the role attribute (issue #14007)'] = function testItCanBindTheRoleAttributeIssue14007() { + var _this19 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ attributeBindings: ['role'] }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar role=role}}', { role: 'button' }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { role: 'button' } }); + + this.runTask(function () { + return _this19.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { role: 'button' } }); + + this.runTask(function () { + return _emberMetal.set(_this19.context, 'role', 'combobox'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { role: 'combobox' } }); + + this.runTask(function () { + return _emberMetal.set(_this19.context, 'role', null); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div' }); + }; + + _class.prototype['@test component with an `id` attribute binding of undefined'] = function testComponentWithAnIdAttributeBindingOfUndefined() { + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['id'], + + id: undefined + }) + }); + + this.registerComponent('baz-qux', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['somethingUndefined:id'], + + somethingUndefined: undefined + }) + }); + this.render('{{foo-bar}}{{baz-qux}}'); + + this.assertComponentElement(this.nthChild(0), { content: '' }); + this.assertComponentElement(this.nthChild(1), { content: '' }); + + this.assert.ok(this.nthChild(0).id.match(/ember\d+/), 'a valid `id` was used'); + this.assert.ok(this.nthChild(1).id.match(/ember\d+/), 'a valid `id` was used'); + }; + + _class.prototype['@test component with an `id` attribute binding of null'] = function testComponentWithAnIdAttributeBindingOfNull() { + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['id'], + + id: null + }) + }); + + this.registerComponent('baz-qux', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['somethingNull:id'], + + somethingNull: null + }) + }); + this.render('{{foo-bar}}{{baz-qux}}'); + + this.assertComponentElement(this.nthChild(0), { content: '' }); + this.assertComponentElement(this.nthChild(1), { content: '' }); + + this.assert.ok(this.nthChild(0).id.match(/ember\d+/), 'a valid `id` was used'); + this.assert.ok(this.nthChild(1).id.match(/ember\d+/), 'a valid `id` was used'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/components/attribute-bindings-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/attribute-bindings-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/attribute-bindings-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/attribute-bindings-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/attribute-bindings-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/attribute-bindings-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/attrs-lookup-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal', 'ember-glimmer/tests/utils/test-helpers'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal, _emberGlimmerTestsUtilsTestHelpers) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: attrs lookup', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test it should be able to lookup attrs without `attrs.` - template access'] = function testItShouldBeAbleToLookupAttrsWithoutAttrsTemplateAccess() { + var _this = this; + + this.registerComponent('foo-bar', { template: '{{first}}' }); + + this.render('{{foo-bar first=firstAttr}}', { + firstAttr: 'first attr' + }); + + this.assertText('first attr'); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertText('first attr'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'firstAttr', 'second attr'); + }); + + this.assertText('second attr'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'firstAttr', 'first attr'); + }); + + this.assertText('first attr'); + }; + + _class.prototype['@test it should be able to lookup attrs without `attrs.` - component access'] = function testItShouldBeAbleToLookupAttrsWithoutAttrsComponentAccess(assert) { + var _this2 = this; + + var instance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + instance = this; + } + }); + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '{{first}}' }); + + this.render('{{foo-bar first=firstAttr}}', { + firstAttr: 'first attr' + }); + + assert.equal(instance.get('first'), 'first attr'); + + this.runTask(function () { + return _this2.rerender(); + }); + + assert.equal(instance.get('first'), 'first attr'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'firstAttr', 'second attr'); + }); + + assert.equal(instance.get('first'), 'second attr'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'firstAttr', 'first attr'); + }); + + this.assertText('first attr'); + }; + + _class.prototype['@test should be able to modify a provided attr into local state #11571 / #11559'] = function testShouldBeAbleToModifyAProvidedAttrIntoLocalState1157111559(assert) { + var _this3 = this; + + var instance = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + instance = this; + }, + + didReceiveAttrs: function () { + this.set('first', this.get('first').toUpperCase()); + } + }); + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '{{first}}' }); + + this.render('{{foo-bar first="first attr"}}'); + + assert.equal(instance.get('first'), 'FIRST ATTR', 'component lookup uses local state'); + this.assertText('FIRST ATTR'); + + this.runTask(function () { + return _this3.rerender(); + }); + + assert.equal(instance.get('first'), 'FIRST ATTR', 'component lookup uses local state during rerender'); + this.assertText('FIRST ATTR'); + + // This is testing that passing string literals for use as initial values, + // so there is no update step + }; + + _class.prototype['@test should be able to access unspecified attr #12035'] = function testShouldBeAbleToAccessUnspecifiedAttr12035(assert) { + var _this4 = this; + + var instance = undefined; + var wootVal = 'yes'; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + instance = this; + }, + + didReceiveAttrs: function () { + assert.equal(this.get('woot'), wootVal, 'found attr in didReceiveAttrs'); + } + }); + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent }); + + this.render('{{foo-bar woot=woot}}', { + woot: wootVal + }); + + assert.equal(instance.get('woot'), 'yes', 'component found attr'); + + this.runTask(function () { + return _this4.rerender(); + }); + + assert.equal(instance.get('woot'), 'yes', 'component found attr after rerender'); + + this.runTask(function () { + wootVal = 'nope'; + _emberMetal.set(_this4.context, 'woot', wootVal); + }); + + assert.equal(instance.get('woot'), 'nope', 'component found attr after attr change'); + + this.runTask(function () { + wootVal = 'yes'; + _emberMetal.set(_this4.context, 'woot', wootVal); + }); + + assert.equal(instance.get('woot'), 'yes', 'component found attr after reset'); + }; + + _class.prototype['@test getAttr() should return the same value as get()'] = function testGetAttrShouldReturnTheSameValueAsGet(assert) { + var _this5 = this; + + assert.expect(33); + + var instance = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + instance = this; + }, + + didReceiveAttrs: function () { + var rootFirstPositional = this.get('firstPositional'); + var rootFirst = this.get('first'); + var rootSecond = this.get('second'); + var attrFirstPositional = this.getAttr('firstPositional'); + var attrFirst = this.getAttr('first'); + var attrSecond = this.getAttr('second'); + + equal(rootFirstPositional, attrFirstPositional, 'root property matches attrs value'); + equal(rootFirst, attrFirst, 'root property matches attrs value'); + equal(rootSecond, attrSecond, 'root property matches attrs value'); + } + }); + + FooBarComponent.reopenClass({ + positionalParams: ['firstPositional'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent }); + + this.render('{{foo-bar firstPositional first=first second=second}}', { + firstPositional: 'firstPositional', + first: 'first', + second: 'second' + }); + + assert.equal(instance.get('firstPositional'), 'firstPositional', 'matches known value'); + assert.equal(instance.get('first'), 'first', 'matches known value'); + assert.equal(instance.get('second'), 'second', 'matches known value'); + + this.runTask(function () { + return _this5.rerender(); + }); + + assert.equal(instance.get('firstPositional'), 'firstPositional', 'matches known value'); + assert.equal(instance.get('first'), 'first', 'matches known value'); + assert.equal(instance.get('second'), 'second', 'matches known value'); + + this.runTask(function () { + _emberMetal.set(_this5.context, 'first', 'third'); + }); + + assert.equal(instance.get('firstPositional'), 'firstPositional', 'matches known value'); + assert.equal(instance.get('first'), 'third', 'matches known value'); + assert.equal(instance.get('second'), 'second', 'matches known value'); + + this.runTask(function () { + _emberMetal.set(_this5.context, 'second', 'fourth'); + }); + + assert.equal(instance.get('firstPositional'), 'firstPositional', 'matches known value'); + assert.equal(instance.get('first'), 'third', 'matches known value'); + assert.equal(instance.get('second'), 'fourth', 'matches known value'); + + this.runTask(function () { + _emberMetal.set(_this5.context, 'firstPositional', 'fifth'); + }); + + assert.equal(instance.get('firstPositional'), 'fifth', 'matches known value'); + assert.equal(instance.get('first'), 'third', 'matches known value'); + assert.equal(instance.get('second'), 'fourth', 'matches known value'); + + this.runTask(function () { + _emberMetal.set(_this5.context, 'firstPositional', 'firstPositional'); + _emberMetal.set(_this5.context, 'first', 'first'); + _emberMetal.set(_this5.context, 'second', 'second'); + }); + + assert.equal(instance.get('firstPositional'), 'firstPositional', 'matches known value'); + assert.equal(instance.get('first'), 'first', 'matches known value'); + assert.equal(instance.get('second'), 'second', 'matches known value'); + }; + + _class.prototype['@test bound computed properties can be overriden in extensions, set during init, and passed in as attrs'] = function testBoundComputedPropertiesCanBeOverridenInExtensionsSetDuringInitAndPassedInAsAttrs() { + var FooClass = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['style'], + style: _emberMetal.computed('height', 'color', function () { + var height = this.get('height'); + var color = this.get('color'); + return 'height: ' + height + 'px; background-color: ' + color + ';'; + }), + color: 'red', + height: 20 + }); + + var BarClass = FooClass.extend({ + init: function () { + this._super.apply(this, arguments); + this.height = 150; + }, + color: 'yellow' + }); + + this.registerComponent('x-foo', { ComponentClass: FooClass }); + this.registerComponent('x-bar', { ComponentClass: BarClass }); + + this.render('{{x-foo}}{{x-bar}}{{x-bar color="green"}}'); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { style: _emberGlimmerTestsUtilsTestHelpers.styles('height: 20px; background-color: red;') } }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: { style: _emberGlimmerTestsUtilsTestHelpers.styles('height: 150px; background-color: yellow;') } }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { style: _emberGlimmerTestsUtilsTestHelpers.styles('height: 150px; background-color: green;') } }); + + this.assertStableRerender(); + + // No U-R + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/components/attrs-lookup-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/attrs-lookup-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/attrs-lookup-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/attrs-lookup-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/attrs-lookup-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/attrs-lookup-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/class-bindings-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/test-helpers', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsTestHelpers, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{foo-bar foo=foo bindIsEnabled=true isEnabled=isEnabled bindIsHappy=false isHappy=isHappy}}\n {{foo-bar foo=foo bindIsEnabled=false isEnabled=isEnabled bindIsHappy=true isHappy=isHappy}}\n {{foo-bar foo=foo bindIsEnabled=true isEnabled=isEnabled bindIsHappy=true isHappy=isHappy}}\n {{foo-bar foo=foo bindIsEnabled=false isEnabled=isEnabled bindIsHappy=false isHappy=isHappy}}\n '], ['\n {{foo-bar foo=foo bindIsEnabled=true isEnabled=isEnabled bindIsHappy=false isHappy=isHappy}}\n {{foo-bar foo=foo bindIsEnabled=false isEnabled=isEnabled bindIsHappy=true isHappy=isHappy}}\n {{foo-bar foo=foo bindIsEnabled=true isEnabled=isEnabled bindIsHappy=true isHappy=isHappy}}\n {{foo-bar foo=foo bindIsEnabled=false isEnabled=isEnabled bindIsHappy=false isHappy=isHappy}}\n ']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('ClassNameBindings integration', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test it can have class name bindings on the class definition'] = function testItCanHaveClassNameBindingsOnTheClassDefinition() { + var _this = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNameBindings: ['foo', 'isEnabled:enabled', 'isHappy:happy:sad'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar foo=foo isEnabled=isEnabled isHappy=isHappy}}', { foo: 'foo', isEnabled: true, isHappy: false }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo enabled sad') }, content: 'hello' }); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo enabled sad') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this.context, 'foo', 'FOO'); + _emberMetal.set(_this.context, 'isEnabled', false); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view FOO sad') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this.context, 'foo', undefined); + _emberMetal.set(_this.context, 'isHappy', true); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view happy') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this.context, 'foo', 'foo'); + _emberMetal.set(_this.context, 'isEnabled', true); + _emberMetal.set(_this.context, 'isHappy', false); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo enabled sad') }, content: 'hello' }); + }; + + _class.prototype['@test attrs in classNameBindings'] = function testAttrsInClassNameBindings() { + var _this2 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNameBindings: ['attrs.joker:purple:green', 'attrs.batman.robin:black:red'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar joker=model.wat batman=model.super}}', { + model: { wat: false, super: { robin: true } } + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view green black') }, content: 'hello' }); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view green black') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this2.context, 'model.wat', true); + _emberMetal.set(_this2.context, 'model.super.robin', false); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view purple red') }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'model', { + wat: false, super: { robin: true } + }); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view green black') }, content: 'hello' }); + }; + + _class.prototype['@test it can have class name bindings in the template'] = function testItCanHaveClassNameBindingsInTheTemplate() { + var _this3 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar classNameBindings="model.someInitiallyTrueProperty model.someInitiallyFalseProperty model.someInitiallyUndefinedProperty :static model.isBig:big model.isOpen:open:closed model.isUp::down model.bar:isTruthy:isFalsy"}}', { + model: { + someInitiallyTrueProperty: true, + someInitiallyFalseProperty: false, + isBig: true, + isOpen: false, + isUp: true, + bar: true + } + }); + + this.assertComponentElement(this.firstChild, { + attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view some-initially-true-property static big closed isTruthy') }, + content: 'hello' + }); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertComponentElement(this.firstChild, { + attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view some-initially-true-property static big closed isTruthy') }, + content: 'hello' + }); + + this.runTask(function () { + _emberMetal.set(_this3.context, 'model.someInitiallyTrueProperty', false); + _emberMetal.set(_this3.context, 'model.someInitiallyFalseProperty', true); + _emberMetal.set(_this3.context, 'model.someInitiallyUndefinedProperty', true); + _emberMetal.set(_this3.context, 'model.isBig', false); + _emberMetal.set(_this3.context, 'model.isOpen', true); + _emberMetal.set(_this3.context, 'model.isUp', false); + _emberMetal.set(_this3.context, 'model.bar', false); + }); + + this.assertComponentElement(this.firstChild, { + attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view some-initially-false-property some-initially-undefined-property static open down isFalsy') }, + content: 'hello' + }); + + this.runTask(function () { + _emberMetal.set(_this3.context, 'model', { + someInitiallyTrueProperty: true, + someInitiallyFalseProperty: false, + someInitiallyUndefinedProperty: undefined, + isBig: true, + isOpen: false, + isUp: true, + bar: true + }); + }); + + this.assertComponentElement(this.firstChild, { + attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view some-initially-true-property static big closed isTruthy') }, + content: 'hello' + }); + }; + + _class.prototype['@test it can have class name bindings with nested paths'] = function testItCanHaveClassNameBindingsWithNestedPaths() { + var _this4 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNameBindings: ['foo.bar', 'is.enabled:enabled', 'is.happy:happy:sad'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar foo=foo is=is}}', { foo: { bar: 'foo-bar' }, is: { enabled: true, happy: false } }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar enabled sad') }, content: 'hello' }); + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar enabled sad') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this4.context, 'foo.bar', 'FOO-BAR'); + _emberMetal.set(_this4.context, 'is.enabled', false); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view FOO-BAR sad') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this4.context, 'foo.bar', null); + _emberMetal.set(_this4.context, 'is.happy', true); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view happy') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this4.context, 'foo', null); + _emberMetal.set(_this4.context, 'is', null); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view sad') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this4.context, 'foo', { bar: 'foo-bar' }); + _emberMetal.set(_this4.context, 'is', { enabled: true, happy: false }); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar enabled sad') }, content: 'hello' }); + }; + + _class.prototype['@test it should dasherize the path when the it resolves to true'] = function testItShouldDasherizeThePathWhenTheItResolvesToTrue() { + var _this5 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNameBindings: ['fooBar', 'nested.fooBarBaz'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar fooBar=fooBar nested=nested}}', { fooBar: true, nested: { fooBarBaz: false } }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar') }, content: 'hello' }); + + this.runTask(function () { + return _this5.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this5.context, 'fooBar', false); + _emberMetal.set(_this5.context, 'nested.fooBarBaz', true); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar-baz') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this5.context, 'fooBar', 'FOO-BAR'); + _emberMetal.set(_this5.context, 'nested.fooBarBaz', null); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view FOO-BAR') }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'nested', null); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view FOO-BAR') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this5.context, 'fooBar', true); + _emberMetal.set(_this5.context, 'nested', { fooBarBaz: false }); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar') }, content: 'hello' }); + }; + + _class.prototype['@test const bindings can be set as attrs'] = function testConstBindingsCanBeSetAsAttrs() { + var _this6 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + this.render('{{foo-bar classNameBindings="foo:enabled:disabled"}}', { + foo: true + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view enabled') }, content: 'hello' }); + + this.runTask(function () { + return _this6.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view enabled') }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'foo', false); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view disabled') }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'foo', true); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view enabled') }, content: 'hello' }); + }; + + _class.prototype['@test :: class name syntax works with an empty true class'] = function testClassNameSyntaxWorksWithAnEmptyTrueClass() { + var _this7 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNameBindings: ['isEnabled::not-enabled'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar isEnabled=enabled}}', { + enabled: false + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view not-enabled') }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'enabled', true); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'enabled', false); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view not-enabled') }, content: 'hello' }); + }; + + _class.prototype['@test uses all provided static class names (issue #11193)'] = function testUsesAllProvidedStaticClassNamesIssue11193() { + var _this8 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNameBindings: [':class-one', ':class-two'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar}}', { + enabled: false + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view class-one class-two') }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this8.context, 'enabled', true); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view class-one class-two') }, content: 'hello' }); + }; + + _class.prototype['@test Providing a binding with a space in it asserts'] = function testProvidingABindingWithASpaceInItAsserts() { + var _this9 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNameBindings: 'i:think:i am:so:clever' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + expectAssertion(function () { + _this9.render('{{foo-bar}}'); + }, /classNameBindings must not have spaces in them/i); + }; + + _class.prototype['@test it can set class name bindings in the constructor'] = function testItCanSetClassNameBindingsInTheConstructor() { + var _this10 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNameBindings: ['foo'], + + init: function () { + this._super(); + + var bindings = this.classNameBindings; + + if (this.get('bindIsEnabled')) { + bindings.push('isEnabled:enabled'); + } + + if (this.get('bindIsHappy')) { + bindings.push('isHappy:happy:sad'); + } + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { foo: 'foo', isEnabled: true, isHappy: false }); + + this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo enabled') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo sad') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo enabled sad') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(3), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo') }, content: 'hello' }); + + this.runTask(function () { + return _this10.rerender(); + }); + + this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo enabled') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo sad') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo enabled sad') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(3), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this10.context, 'foo', 'FOO'); + _emberMetal.set(_this10.context, 'isEnabled', false); + }); + + this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view FOO') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view FOO sad') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view FOO sad') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(3), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view FOO') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this10.context, 'foo', undefined); + _emberMetal.set(_this10.context, 'isHappy', true); + }); + + this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view happy') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view happy') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(3), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') }, content: 'hello' }); + + this.runTask(function () { + _emberMetal.set(_this10.context, 'foo', 'foo'); + _emberMetal.set(_this10.context, 'isEnabled', true); + _emberMetal.set(_this10.context, 'isHappy', false); + }); + + this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo enabled') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo sad') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo enabled sad') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(3), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo') }, content: 'hello' }); + }; + + _class.prototype['@test using a computed property for classNameBindings triggers an assertion'] = function testUsingAComputedPropertyForClassNameBindingsTriggersAnAssertion() { + var _this11 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNameBindings: _emberMetal.computed(function () { + return ['isHappy:happy:sad']; + }) + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + expectAssertion(function () { + _this11.render('{{foo-bar}}'); + }, /Only arrays are allowed/); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('ClassBinding integration', (function (_RenderingTest2) { +babelHelpers.inherits(_class2, _RenderingTest2); + + function _class2() { + _RenderingTest2.apply(this, arguments); + } + + _class2.prototype['@test it should apply classBinding without condition always'] = function testItShouldApplyClassBindingWithoutConditionAlways() { + var _this12 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar classBinding=":foo"}}'); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo ember-view') } }); + + this.runTask(function () { + return _this12.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo ember-view') } }); + }; + + _class2.prototype['@test it should merge classBinding with class'] = function testItShouldMergeClassBindingWithClass() { + var _this13 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar classBinding="birdman:respeck" class="myName"}}', { birdman: true }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('respeck myName ember-view') } }); + + this.runTask(function () { + return _this13.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('respeck myName ember-view') } }); + }; + + _class2.prototype['@test it should apply classBinding with only truthy condition'] = function testItShouldApplyClassBindingWithOnlyTruthyCondition() { + var _this14 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar classBinding="myName:respeck"}}', { myName: true }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('respeck ember-view') } }); + + this.runTask(function () { + return _this14.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('respeck ember-view') } }); + }; + + _class2.prototype['@test it should apply classBinding with only falsy condition'] = function testItShouldApplyClassBindingWithOnlyFalsyCondition() { + var _this15 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar classBinding="myName::shade"}}', { myName: false }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('shade ember-view') } }); + + this.runTask(function () { + return _this15.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('shade ember-view') } }); + }; + + _class2.prototype['@test it should apply nothing when classBinding is falsy but only supplies truthy class'] = function testItShouldApplyNothingWhenClassBindingIsFalsyButOnlySuppliesTruthyClass() { + var _this16 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar classBinding="myName:respeck"}}', { myName: false }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') } }); + + this.runTask(function () { + return _this16.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') } }); + }; + + _class2.prototype['@test it should apply nothing when classBinding is truthy but only supplies falsy class'] = function testItShouldApplyNothingWhenClassBindingIsTruthyButOnlySuppliesFalsyClass() { + var _this17 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar classBinding="myName::shade"}}', { myName: true }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') } }); + + this.runTask(function () { + return _this17.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') } }); + }; + + _class2.prototype['@test it should apply classBinding with falsy condition'] = function testItShouldApplyClassBindingWithFalsyCondition() { + var _this18 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar classBinding="swag:fresh:scrub"}}', { swag: false }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('scrub ember-view') } }); + + this.runTask(function () { + return _this18.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('scrub ember-view') } }); + }; + + _class2.prototype['@test it should apply classBinding with truthy condition'] = function testItShouldApplyClassBindingWithTruthyCondition() { + var _this19 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar classBinding="swag:fresh:scrub"}}', { swag: true }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('fresh ember-view') } }); + + this.runTask(function () { + return _this19.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('fresh ember-view') } }); + }; + + return _class2; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/components/class-bindings-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/class-bindings-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/class-bindings-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/class-bindings-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/class-bindings-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/class-bindings-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/closure-components-test', ['exports', 'ember-utils', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-metal'], function (exports, _emberUtils, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberMetal) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{component (component "-looked-up") "Hodari" greeting="Hodi"}}'], ['\n {{component (component "-looked-up") "Hodari" greeting="Hodi"}}']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n {{component (component "-looked-up" "Hodari" greeting="Hodi")\n greeting="Hola"}}'], ['\n {{component (component "-looked-up" "Hodari" greeting="Hodi")\n greeting="Hola"}}']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with (hash comp=(component "-looked-up" greeting=model.greeting)) as |my|}}\n {{#my.comp}}{{/my.comp}}\n {{/with}}'], ['\n {{#with (hash comp=(component "-looked-up" greeting=model.greeting)) as |my|}}\n {{#my.comp}}{{/my.comp}}\n {{/with}}']), + _templateObject4 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with (component "-looked-up" greeting="Hola" name="Dolores" age=33) as |first|}}\n {{#with (component first greeting="Hej" name="Sigmundur") as |second|}}\n {{component second greeting=model.greeting}}\n {{/with}}\n {{/with}}'], ['\n {{#with (component "-looked-up" greeting="Hola" name="Dolores" age=33) as |first|}}\n {{#with (component first greeting="Hej" name="Sigmundur") as |second|}}\n {{component second greeting=model.greeting}}\n {{/with}}\n {{/with}}']), + _templateObject5 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with (hash lookedup=(component "-looked-up")) as |object|}}\n {{object.lookedup}}\n {{/with}}'], ['\n {{#with (hash lookedup=(component "-looked-up")) as |object|}}\n {{object.lookedup}}\n {{/with}}']), + _templateObject6 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with (hash lookedup=(component "-looked-up")) as |object|}}\n {{object.lookedup expectedText=model.expectedText}}\n {{/with}}'], ['\n {{#with (hash lookedup=(component "-looked-up")) as |object|}}\n {{object.lookedup expectedText=model.expectedText}}\n {{/with}}']), + _templateObject7 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with (hash lookedup=(component "-looked-up" expectedText=model.expectedText)) as |object|}}\n {{object.lookedup}}\n {{/with}}'], ['\n {{#with (hash lookedup=(component "-looked-up" expectedText=model.expectedText)) as |object|}}\n {{object.lookedup}}\n {{/with}}']), + _templateObject8 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with (hash lookedup=(component "-looked-up")) as |object|}}\n {{object.lookedup model.expectedText "Hola"}}\n {{/with}}'], ['\n {{#with (hash lookedup=(component "-looked-up")) as |object|}}\n {{object.lookedup model.expectedText "Hola"}}\n {{/with}}']), + _templateObject9 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with (hash my-component=(component \'my-component\' first)) as |c|}}\n {{c.my-component}}\n {{/with}}'], ['\n {{#with (hash my-component=(component \'my-component\' first)) as |c|}}\n {{c.my-component}}\n {{/with}}']), + _templateObject10 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#my-component my-attr=myProp as |api|}}\n {{api.my-nested-component}}\n {{/my-component}}\n
    \n '], ['\n {{#my-component my-attr=myProp as |api|}}\n {{api.my-nested-component}}\n {{/my-component}}\n
    \n ']), + _templateObject11 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#select-box as |sb|}}\n {{sb.option label="Foo"}}\n {{sb.option}}\n {{/select-box}}'], ['\n {{#select-box as |sb|}}\n {{sb.option label="Foo"}}\n {{sb.option}}\n {{/select-box}}']), + _templateObject12 = babelHelpers.taggedTemplateLiteralLoose(['\n '], ['\n ']), + _templateObject13 = babelHelpers.taggedTemplateLiteralLoose(['\n {{component (component "change-button" model.val2)}}\n {{model.val2}}'], ['\n {{component (component "change-button" model.val2)}}\n {{model.val2}}']), + _templateObject14 = babelHelpers.taggedTemplateLiteralLoose(['\n message: {{message}}{{inner-component message=message}}\n '], ['\n ']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: closure components', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test renders with component helper'] = function testRendersWithComponentHelper() { + var _this = this; + + var expectedText = 'Hodi'; + + this.registerComponent('-looked-up', { + template: expectedText + }); + + this.render('{{component (component "-looked-up")}}'); + + this.assertText(expectedText); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertText(expectedText); + }; + + _class.prototype['@test renders with component helper with invocation params, hash'] = function testRendersWithComponentHelperWithInvocationParamsHash() { + var _this2 = this; + + this.registerComponent('-looked-up', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['name'] + }), + template: '{{greeting}} {{name}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject)); + + this.assertText('Hodi Hodari'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertText('Hodi Hodari'); + }; + + _class.prototype['@test GH#13742 keeps nested rest positional parameters if rendered with no positional parameters'] = function testGH13742KeepsNestedRestPositionalParametersIfRenderedWithNoPositionalParameters() { + var _this3 = this; + + this.registerComponent('-looked-up', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'params' + }), + template: '{{#each params as |p|}}{{p}}{{/each}}' + }); + + this.render('{{component (component "-looked-up" model.greeting model.name)}}', { + model: { + greeting: 'Gabon ', + name: 'Zack' + } + }); + + this.assertText('Gabon Zack'); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertText('Gabon Zack'); + + this.runTask(function () { + return _this3.context.set('model.greeting', 'Good morning '); + }); + + this.assertText('Good morning Zack'); + + this.runTask(function () { + return _this3.context.set('model.name', 'Matthew'); + }); + + this.assertText('Good morning Matthew'); + + this.runTask(function () { + return _this3.context.set('model', { greeting: 'Gabon ', name: 'Zack' }); + }); + + this.assertText('Gabon Zack'); + }; + + // Take a look at this one. Seems to pass even when currying isn't implemented. + + _class.prototype['@test overwrites nested rest positional parameters if rendered with positional parameters'] = function testOverwritesNestedRestPositionalParametersIfRenderedWithPositionalParameters() { + var _this4 = this; + + this.registerComponent('-looked-up', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'params' + }), + template: '{{#each params as |p|}}{{p}}{{/each}}' + }); + + this.render('{{component (component "-looked-up" model.greeting model.name) model.name model.greeting}}', { + model: { + greeting: 'Gabon ', + name: 'Zack' + } + }); + + this.assertText('ZackGabon '); + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assertText('ZackGabon '); + + this.runTask(function () { + return _this4.context.set('model.greeting', 'Good morning '); + }); + + this.assertText('ZackGood morning '); + + this.runTask(function () { + return _this4.context.set('model.name', 'Matthew'); + }); + + this.assertText('MatthewGood morning '); + + this.runTask(function () { + return _this4.context.set('model', { greeting: 'Gabon ', name: 'Zack' }); + }); + + this.assertText('ZackGabon '); + }; + + _class.prototype['@test GH#13742 keeps nested rest positional parameters if nested and rendered with no positional parameters'] = function testGH13742KeepsNestedRestPositionalParametersIfNestedAndRenderedWithNoPositionalParameters() { + var _this5 = this; + + this.registerComponent('-looked-up', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'params' + }), + template: '{{#each params as |p|}}{{p}}{{/each}}' + }); + + this.render('{{component (component (component "-looked-up" model.greeting model.name))}}', { + model: { + greeting: 'Gabon ', + name: 'Zack' + } + }); + + this.assertText('Gabon Zack'); + + this.runTask(function () { + return _this5.rerender(); + }); + + this.assertText('Gabon Zack'); + + this.runTask(function () { + return _this5.context.set('model.greeting', 'Good morning '); + }); + + this.assertText('Good morning Zack'); + + this.runTask(function () { + return _this5.context.set('model.name', 'Matthew'); + }); + + this.assertText('Good morning Matthew'); + + this.runTask(function () { + return _this5.context.set('model', { greeting: 'Gabon ', name: 'Zack' }); + }); + + this.assertText('Gabon Zack'); + }; + + _class.prototype['@test overwrites nested rest positional parameters if nested with new pos params and rendered with no positional parameters'] = function testOverwritesNestedRestPositionalParametersIfNestedWithNewPosParamsAndRenderedWithNoPositionalParameters() { + var _this6 = this; + + this.registerComponent('-looked-up', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'params' + }), + template: '{{#each params as |p|}}{{p}}{{/each}}' + }); + + this.render('{{component (component (component "-looked-up" model.greeting model.name) model.name model.greeting)}}', { + model: { + greeting: 'Gabon ', + name: 'Zack' + } + }); + + this.assertText('ZackGabon '); + + this.runTask(function () { + return _this6.rerender(); + }); + + this.assertText('ZackGabon '); + + this.runTask(function () { + return _this6.context.set('model.greeting', 'Good morning '); + }); + + this.assertText('ZackGood morning '); + + this.runTask(function () { + return _this6.context.set('model.name', 'Matthew'); + }); + + this.assertText('MatthewGood morning '); + + this.runTask(function () { + return _this6.context.set('model', { greeting: 'Gabon ', name: 'Zack' }); + }); + + this.assertText('ZackGabon '); + }; + + _class.prototype['@test renders with component helper with curried params, hash'] = function testRendersWithComponentHelperWithCurriedParamsHash() { + var _this7 = this; + + this.registerComponent('-looked-up', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['name'] + }), + template: '{{greeting}} {{name}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + + this.assertText('Hola Hodari'); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertText('Hola Hodari'); + }; + + _class.prototype['@test updates when component path is bound'] = function testUpdatesWhenComponentPathIsBound() { + var _this8 = this; + + this.registerComponent('-mandarin', { + template: 'ni hao' + }); + + this.registerComponent('-hindi', { + template: 'Namaste' + }); + + this.render('{{component (component model.lookupComponent)}}', { + model: { + lookupComponent: '-mandarin' + } + }); + + this.assertText('ni hao'); + + this.runTask(function () { + return _this8.rerender(); + }); + + this.assertText('ni hao'); + + this.runTask(function () { + return _this8.context.set('model.lookupComponent', '-hindi'); + }); + + this.assertText('Namaste'); + + this.runTask(function () { + return _this8.context.set('model', { lookupComponent: '-mandarin' }); + }); + + this.assertText('ni hao'); + }; + + _class.prototype['@test updates when curried hash argument is bound'] = function testUpdatesWhenCurriedHashArgumentIsBound() { + var _this9 = this; + + this.registerComponent('-looked-up', { + template: '{{greeting}}' + }); + + this.render('{{component (component "-looked-up" greeting=model.greeting)}}', { + model: { + greeting: 'Hodi' + } + }); + + this.assertText('Hodi'); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertText('Hodi'); + + this.runTask(function () { + return _this9.context.set('model.greeting', 'Hola'); + }); + + this.assertText('Hola'); + + this.runTask(function () { + return _this9.context.set('model', { greeting: 'Hodi' }); + }); + + this.assertText('Hodi'); + }; + + _class.prototype['@test updates when curried hash arguments is bound in block form'] = function testUpdatesWhenCurriedHashArgumentsIsBoundInBlockForm() { + var _this10 = this; + + this.registerComponent('-looked-up', { + template: '{{greeting}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3), { + model: { + greeting: 'Hodi' + } + }); + + this.assertText('Hodi'); + + this.runTask(function () { + return _this10.rerender(); + }); + + this.assertText('Hodi'); + + this.runTask(function () { + return _this10.context.set('model.greeting', 'Hola'); + }); + + this.assertText('Hola'); + + this.runTask(function () { + return _this10.context.set('model', { greeting: 'Hodi' }); + }); + + this.assertText('Hodi'); + }; + + _class.prototype['@test nested components overwrite named positional parameters'] = function testNestedComponentsOverwriteNamedPositionalParameters() { + var _this11 = this; + + this.registerComponent('-looked-up', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['name', 'age'] + }), + template: '{{name}} {{age}}' + }); + + this.render('{{component (component (component "-looked-up" "Sergio" 29) "Marvin" 21) "Hodari"}}'); + + this.assertText('Hodari 21'); + + this.runTask(function () { + return _this11.rerender(); + }); + + this.assertText('Hodari 21'); + }; + + _class.prototype['@test nested components overwrite hash parameters'] = function testNestedComponentsOverwriteHashParameters() { + var _this12 = this; + + this.registerComponent('-looked-up', { + template: '{{greeting}} {{name}} {{age}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4), { + model: { + greeting: 'Hodi' + } + }); + + this.assertText('Hodi Sigmundur 33'); + + this.runTask(function () { + return _this12.rerender(); + }); + + this.assertText('Hodi Sigmundur 33'); + + this.runTask(function () { + return _this12.context.set('model.greeting', 'Kaixo'); + }); + + this.assertText('Kaixo Sigmundur 33'); + + this.runTask(function () { + return _this12.context.set('model', { greeting: 'Hodi' }); + }); + + this.assertText('Hodi Sigmundur 33'); + }; + + _class.prototype['@test bound outer named parameters get updated in the right scope'] = function testBoundOuterNamedParametersGetUpdatedInTheRightScope() { + var _this13 = this; + + this.registerComponent('-inner-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['comp'] + }), + template: '{{component comp "Inner"}}' + }); + + this.registerComponent('-looked-up', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['name', 'age'] + }), + template: '{{name}} {{age}}' + }); + + this.render('{{component "-inner-component" (component "-looked-up" model.outerName model.outerAge)}}', { + model: { + outerName: 'Outer', + outerAge: 28 + } + }); + + this.assertText('Inner 28'); + + this.runTask(function () { + return _this13.rerender(); + }); + + this.assertText('Inner 28'); + + this.runTask(function () { + return _this13.context.set('model.outerAge', 29); + }); + + this.assertText('Inner 29'); + + this.runTask(function () { + return _this13.context.set('model.outerName', 'Not outer'); + }); + + this.assertText('Inner 29'); + + this.runTask(function () { + _this13.context.set('model', { + outerName: 'Outer', + outerAge: 28 + }); + }); + + this.assertText('Inner 28'); + }; + + _class.prototype['@test bound outer hash parameters get updated in the right scope'] = function testBoundOuterHashParametersGetUpdatedInTheRightScope() { + var _this14 = this; + + this.registerComponent('-inner-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['comp'] + }), + template: '{{component comp name="Inner"}}' + }); + + this.registerComponent('-looked-up', { + template: '{{name}} {{age}}' + }); + + this.render('{{component "-inner-component" (component "-looked-up" name=model.outerName age=model.outerAge)}}', { + model: { + outerName: 'Outer', + outerAge: 28 + } + }); + + this.assertText('Inner 28'); + + this.runTask(function () { + return _this14.rerender(); + }); + + this.assertText('Inner 28'); + + this.runTask(function () { + return _this14.context.set('model.outerAge', 29); + }); + + this.assertText('Inner 29'); + + this.runTask(function () { + return _this14.context.set('model.outerName', 'Not outer'); + }); + + this.assertText('Inner 29'); + + this.runTask(function () { + _this14.context.set('model', { + outerName: 'Outer', + outerAge: 28 + }); + }); + + this.assertText('Inner 28'); + }; + + _class.prototype['@test conflicting positional and hash parameters raise and assertion if in the same closure'] = function testConflictingPositionalAndHashParametersRaiseAndAssertionIfInTheSameClosure() { + var _this15 = this; + + this.registerComponent('-looked-up', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['name'] + }), + template: '{{greeting}} {{name}}' + }); + + expectAssertion(function () { + _this15.render('{{component (component "-looked-up" "Hodari" name="Sergio") "Hodari" greeting="Hodi"}}'); + }, 'You cannot specify both a positional param (at position 0) and the hash argument `name`.'); + }; + + _class.prototype['@test conflicting positional and hash parameters does not raise an assertion if rerendered'] = function testConflictingPositionalAndHashParametersDoesNotRaiseAnAssertionIfRerendered() { + var _this16 = this; + + // In some cases, rerendering with a positional param used to cause an + // assertion. This test checks it does not. + this.registerComponent('-looked-up', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['name'] + }), + template: '{{greeting}} {{name}}' + }); + + this.render('{{component (component "-looked-up" model.name greeting="Hodi")}}', { + model: { + name: 'Hodari' + } + }); + + this.assertText('Hodi Hodari'); + + this.runTask(function () { + return _this16.rerender(); + }); + + this.assertText('Hodi Hodari'); + + this.runTask(function () { + return _this16.context.set('model.name', 'Sergio'); + }); + + this.assertText('Hodi Sergio'); + + this.runTask(function () { + return _this16.context.set('model', { name: 'Hodari' }); + }); + + this.assertText('Hodi Hodari'); + }; + + _class.prototype['@test conflicting positional and hash parameters does not raise an assertion if in different closure'] = function testConflictingPositionalAndHashParametersDoesNotRaiseAnAssertionIfInDifferentClosure() { + var _this17 = this; + + this.registerComponent('-looked-up', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['name'] + }), + template: '{{greeting}} {{name}}' + }); + + this.render('{{component (component "-looked-up" "Hodari") name="Sergio" greeting="Hodi"}}'); + + this.assertText('Hodi Sergio'); + + this.runTask(function () { + return _this17.rerender(); + }); + + this.assertText('Hodi Sergio'); + }; + + _class.prototype['@test raises an asserton when component path is null'] = function testRaisesAnAssertonWhenComponentPathIsNull() { + var _this18 = this; + + expectAssertion(function () { + _this18.render('{{component (component lookupComponent)}}'); + }); + }; + + _class.prototype['@test raises an assertion when component path is not a component name (static)'] = function testRaisesAnAssertionWhenComponentPathIsNotAComponentNameStatic() { + var _this19 = this; + + expectAssertion(function () { + _this19.render('{{component (component "not-a-component")}}'); + }, 'The component helper cannot be used without a valid component name. You used "not-a-component" via (component "not-a-component")'); + }; + + _class.prototype['@test raises an assertion when component path is not a component name (dynamic)'] = function testRaisesAnAssertionWhenComponentPathIsNotAComponentNameDynamic() { + var _this20 = this; + + expectAssertion(function () { + _this20.render('{{component (component compName)}}', { + compName: 'not-a-component' + }); + }, /The component helper cannot be used without a valid component name. You used "not-a-component" via \(component .*\)/); + }; + + _class.prototype['@test renders with dot path'] = function testRendersWithDotPath() { + var _this21 = this; + + var expectedText = 'Hodi'; + this.registerComponent('-looked-up', { + template: expectedText + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5)); + + this.assertText(expectedText); + + this.runTask(function () { + return _this21.rerender(); + }); + + this.assertText(expectedText); + }; + + _class.prototype['@test renders with dot path and attr'] = function testRendersWithDotPathAndAttr() { + var _this22 = this; + + var expectedText = 'Hodi'; + this.registerComponent('-looked-up', { + template: '{{expectedText}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject6), { + model: { + expectedText: expectedText + } + }); + + this.assertText(expectedText); + + this.runTask(function () { + return _this22.rerender(); + }); + + this.assertText(expectedText); + + this.runTask(function () { + return _this22.context.set('model.expectedText', 'Hola'); + }); + + this.assertText('Hola'); + + this.runTask(function () { + return _this22.context.set('model', { expectedText: expectedText }); + }); + + this.assertText(expectedText); + }; + + _class.prototype['@test renders with dot path and curried over attr'] = function testRendersWithDotPathAndCurriedOverAttr() { + var _this23 = this; + + var expectedText = 'Hodi'; + this.registerComponent('-looked-up', { + template: '{{expectedText}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject7), { + model: { + expectedText: expectedText + } + }); + + this.assertText(expectedText); + + this.runTask(function () { + return _this23.rerender(); + }); + + this.assertText(expectedText); + + this.runTask(function () { + return _this23.context.set('model.expectedText', 'Hola'); + }); + + this.assertText('Hola'); + + this.runTask(function () { + return _this23.context.set('model', { expectedText: expectedText }); + }); + + this.assertText(expectedText); + }; + + _class.prototype['@test renders with dot path and with rest positional parameters'] = function testRendersWithDotPathAndWithRestPositionalParameters() { + var _this24 = this; + + this.registerComponent('-looked-up', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'params' + }), + template: '{{params}}' + }); + + var expectedText = 'Hodi'; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject8), { + model: { + expectedText: expectedText + } + }); + + this.assertText(expectedText + ',Hola'); + + this.runTask(function () { + return _this24.rerender(); + }); + + this.assertText(expectedText + ',Hola'); + + this.runTask(function () { + return _this24.context.set('model.expectedText', 'Kaixo'); + }); + + this.assertText('Kaixo,Hola'); + + this.runTask(function () { + return _this24.context.set('model', { expectedText: expectedText }); + }); + + this.assertText(expectedText + ',Hola'); + }; + + _class.prototype['@test renders with dot path and rest parameter does not leak'] = function testRendersWithDotPathAndRestParameterDoesNotLeak(assert) { + // In the original implementation, positional parameters were not handled + // correctly causing the first positional parameter to be the closure + // component itself. + var value = false; + + this.registerComponent('my-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didReceiveAttrs: function () { + value = this.getAttr('value'); + } + }).reopenClass({ + positionalParams: ['value'] + }) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject9), { first: 'first' }); + + assert.equal(value, 'first', 'value is the expected parameter'); + }; + + _class.prototype['@test renders with dot path and updates attributes'] = function testRendersWithDotPathAndUpdatesAttributes(assert) { + var _this25 = this; + + this.registerComponent('my-nested-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didReceiveAttrs: function () { + this.set('myProp', this.getAttr('my-parent-attr')); + } + }), + template: '{{myProp}}' + }); + + this.registerComponent('my-component', { + template: '{{yield (hash my-nested-component=(component "my-nested-component" my-parent-attr=my-attr))}}' + }); + + this.registerComponent('my-action-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + changeValue: function () { + this.incrementProperty('myProp'); + } + } + }), + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject10) + }); + + this.render('{{my-action-component myProp=model.myProp}}', { + model: { + myProp: 1 + } + }); + + assert.equal(this.$('#nested-prop').text(), '1'); + + this.runTask(function () { + return _this25.rerender(); + }); + + assert.equal(this.$('#nested-prop').text(), '1'); + + this.runTask(function () { + return _this25.$('button').click(); + }); + + assert.equal(this.$('#nested-prop').text(), '2'); + + this.runTask(function () { + return _this25.$('button').click(); + }); + + assert.equal(this.$('#nested-prop').text(), '3'); + + this.runTask(function () { + return _this25.context.set('model', { myProp: 1 }); + }); + + assert.equal(this.$('#nested-prop').text(), '1'); + }; + + _class.prototype['@test adding parameters to a closure component\'s instance does not add it to other instances'] = function testAddingParametersToAClosureComponentSInstanceDoesNotAddItToOtherInstances() { + var _this26 = this; + + // If parameters and attributes are not handled correctly, setting a value + // in an invokation can leak to others invocation. + this.registerComponent('select-box', { + template: '{{yield (hash option=(component "select-box-option"))}}' + }); + + this.registerComponent('select-box-option', { + template: '{{label}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject11)); + + this.assertText('Foo'); + + this.runTask(function () { + return _this26.rerender(); + }); + + this.assertText('Foo'); + }; + + _class.prototype['@test parameters in a closure are mutable when closure is a param'] = function testParametersInAClosureAreMutableWhenClosureIsAParam(assert) { + var _this27 = this; + + // This checks that a `(mut)` is added to parameters and attributes to + // contextual components when it is a param. + + this.registerComponent('change-button', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['val'] + }), + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject12) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject13), { + model: { + val2: 8 + } + }); + + assert.equal(this.$('.value').text(), '8'); + + this.runTask(function () { + return _this27.rerender(); + }); + + assert.equal(this.$('.value').text(), '8'); + + this.runTask(function () { + return _this27.$('.my-button').click(); + }); + + assert.equal(this.$('.value').text(), '10'); + + this.runTask(function () { + return _this27.context.set('model', { val2: 8 }); + }); + + assert.equal(this.$('.value').text(), '8'); + }; + + _class.prototype['@test tagless blockless components render'] = function testTaglessBlocklessComponentsRender(assert) { + var _this28 = this; + + this.registerComponent('my-comp', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ tagName: '' }) + }); + + this.render('{{my-comp}}'); + + this.runTask(function () { + return _this28.rerender(); + }); + + assert.equal(this.$().text(), ''); + }; + + _class.prototype['@test GH#13494 tagless blockless component with property binding'] = function testGH13494TaglessBlocklessComponentWithPropertyBinding(assert) { + var _this29 = this; + + this.registerComponent('outer-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + message: 'hello', + actions: { + change: function () { + this.set('message', 'goodbye'); + } + } + }), + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject14) + }); + + this.registerComponent('inner-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '' + }) + }); + + this.render('{{outer-component}}'); + + assert.equal(this.$().text(), 'message: hello'); + + this.runTask(function () { + return _this29.rerender(); + }); + + assert.equal(this.$().text(), 'message: hello'); + + this.runTask(function () { + return _this29.$('button').click(); + }); + + assert.equal(this.$().text(), 'message: goodbye'); + + this.runTask(function () { + return _this29.rerender(); + }); + + assert.equal(this.$().text(), 'message: goodbye'); + }; + + _class.prototype['@test GH#13982 contextual component ref is stable even when bound params change'] = function testGH13982ContextualComponentRefIsStableEvenWhenBoundParamsChange(assert) { + var _this30 = this; + + var instance = undefined, + previousInstance = undefined; + var initCount = 0; + + this.registerComponent('my-comp', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + previousInstance = instance; + instance = this; + initCount++; + }, + isOpen: undefined + }), + template: '{{if isOpen "open" "closed"}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject15), { + isOpen: true + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'a instance was created'); + assert.equal(previousInstance, undefined, 'no previous component exists'); + assert.equal(initCount, 1, 'the component was constructed exactly 1 time'); + assert.equal(this.$().text(), 'open', 'the componet text is "open"'); + + this.runTask(function () { + return _this30.rerender(); + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'the component instance exists'); + assert.equal(previousInstance, undefined, 'no previous component exists'); + assert.equal(initCount, 1, 'the component was constructed exactly 1 time'); + assert.equal(this.$().text(), 'open', 'the componet text is "open"'); + + this.runTask(function () { + return _this30.context.set('isOpen', false); + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'the component instance exists'); + assert.equal(previousInstance, undefined, 'no previous component exists'); + assert.equal(initCount, 1, 'the component was constructed exactly 1 time'); + assert.equal(this.$().text(), 'closed', 'the component text is "closed"'); + + this.runTask(function () { + return _this30.rerender(); + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'the component instance exists'); + assert.equal(previousInstance, undefined, 'no previous component exists'); + assert.equal(initCount, 1, 'the component was constructed exactly 1 time'); + assert.equal(this.$().text(), 'closed', 'the component text is "closed"'); + + this.runTask(function () { + return _this30.context.set('isOpen', true); + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'the component instance exists'); + assert.equal(previousInstance, undefined, 'no previous component exists'); + assert.equal(initCount, 1, 'the component was constructed exactly 1 time'); + assert.equal(this.$().text(), 'open', 'the componet text is "open"'); + }; + + _class.prototype['@test GH#13982 contextual component ref is stable even when bound params change (bound name param)'] = function testGH13982ContextualComponentRefIsStableEvenWhenBoundParamsChangeBoundNameParam(assert) { + var _this31 = this; + + var instance = undefined, + previousInstance = undefined; + var initCount = 0; + + this.registerComponent('my-comp', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + previousInstance = instance; + instance = this; + initCount++; + }, + isOpen: undefined + }), + template: '{{if isOpen "open" "closed"}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject16), { + compName: 'my-comp', + isOpen: true + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'a instance was created'); + assert.equal(previousInstance, undefined, 'no previous component exists'); + assert.equal(initCount, 1, 'the component was constructed exactly 1 time'); + assert.equal(this.$().text(), 'open', 'the componet text is "open"'); + + this.runTask(function () { + return _this31.rerender(); + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'the component instance exists'); + assert.equal(previousInstance, undefined, 'no previous component exists'); + assert.equal(initCount, 1, 'the component was constructed exactly 1 time'); + assert.equal(this.$().text(), 'open', 'the componet text is "open"'); + + this.runTask(function () { + return _this31.context.set('isOpen', false); + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'the component instance exists'); + assert.equal(previousInstance, undefined, 'no previous component exists'); + assert.equal(initCount, 1, 'the component was constructed exactly 1 time'); + assert.equal(this.$().text(), 'closed', 'the component text is "closed"'); + + this.runTask(function () { + return _this31.rerender(); + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'the component instance exists'); + assert.equal(previousInstance, undefined, 'no previous component exists'); + assert.equal(initCount, 1, 'the component was constructed exactly 1 time'); + assert.equal(this.$().text(), 'closed', 'the component text is "closed"'); + + this.runTask(function () { + return _this31.context.set('isOpen', true); + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'the component instance exists'); + assert.equal(previousInstance, undefined, 'no previous component exists'); + assert.equal(initCount, 1, 'the component was constructed exactly 1 time'); + assert.equal(this.$().text(), 'open', 'the componet text is "open"'); + }; + + _class.prototype['@test GH#13982 contextual component ref is recomputed when component name param changes'] = function testGH13982ContextualComponentRefIsRecomputedWhenComponentNameParamChanges(assert) { + var _this32 = this; + + var instance = undefined, + previousInstance = undefined; + var initCount = 0; + + this.registerComponent('my-comp', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + previousInstance = instance; + instance = this; + initCount++; + }, + isOpen: undefined + }), + template: 'my-comp: {{if isOpen "open" "closed"}}' + }); + + this.registerComponent('your-comp', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + previousInstance = instance; + instance = this; + initCount++; + }, + isOpen: undefined + }), + template: 'your-comp: {{if isOpen "open" "closed"}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject16), { + compName: 'my-comp', + isOpen: true + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'a instance was created'); + assert.equal(previousInstance, undefined, 'there is no previous instance'); + assert.equal(initCount, 1, 'the component was constructed exactly 1 time'); + assert.equal(this.$().text(), 'my-comp: open'); + + this.runTask(function () { + return _this32.rerender(); + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'a instance exists after rerender'); + assert.equal(previousInstance, undefined, 'there is no previous instance after rerender'); + assert.equal(initCount, 1, 'the component was constructed exactly 1 time'); + assert.equal(this.$().text(), 'my-comp: open'); + + this.runTask(function () { + return _this32.context.set('compName', 'your-comp'); + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'an instance was created after component name changed'); + assert.ok(!_emberMetal.isEmpty(previousInstance), 'a previous instance now exists'); + assert.notEqual(instance, previousInstance, 'the instance and previous instance are not the same object'); + assert.equal(initCount, 2, 'the component was constructed exactly 2 times'); + assert.equal(this.$().text(), 'your-comp: open'); + + this.runTask(function () { + return _this32.rerender(); + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'an instance was created after component name changed (rerender)'); + assert.ok(!_emberMetal.isEmpty(previousInstance), 'a previous instance now exists (rerender)'); + assert.notEqual(instance, previousInstance, 'the instance and previous instance are not the same object (rerender)'); + assert.equal(initCount, 2, 'the component was constructed exactly 2 times (rerender)'); + assert.equal(this.$().text(), 'your-comp: open'); + + this.runTask(function () { + return _this32.context.set('compName', 'my-comp'); + }); + + assert.ok(!_emberMetal.isEmpty(instance), 'an instance was created after component name changed'); + assert.ok(!_emberMetal.isEmpty(previousInstance), 'a previous instance still exists'); + assert.notEqual(instance, previousInstance, 'the instance and previous instance are not the same object'); + assert.equal(initCount, 3, 'the component was constructed exactly 3 times (rerender)'); + assert.equal(this.$().text(), 'my-comp: open'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + var ClosureComponentMutableParamsTest = (function (_RenderingTest2) { +babelHelpers.inherits(ClosureComponentMutableParamsTest, _RenderingTest2); + + function ClosureComponentMutableParamsTest() { + _RenderingTest2.apply(this, arguments); + } + + ClosureComponentMutableParamsTest.prototype.render = function render(templateStr) { + var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + _RenderingTest2.prototype.render.call(this, templateStr + '{{model.val2}}', _emberUtils.assign(context, { model: { val2: 8 } })); + }; + + return ClosureComponentMutableParamsTest; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest); + + var MutableParamTestGenerator = (function () { + function MutableParamTestGenerator(cases) { + this.cases = cases; + } + + MutableParamTestGenerator.prototype.generate = function generate(_ref2) { + var _ref; + + var title = _ref2.title; + var setup = _ref2.setup; + + return _ref = {}, _ref['@test parameters in a closure are mutable when closure is a ' + title] = function (assert) { + var _this33 = this; + + this.registerComponent('change-button', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['val'] + }), + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject17) + }); + + setup.call(this, assert); + + assert.equal(this.$('.value').text(), '8'); + + this.runTask(function () { + return _this33.rerender(); + }); + + assert.equal(this.$('.value').text(), '8'); + + this.runTask(function () { + return _this33.$('.my-button').click(); + }); + + assert.equal(this.$('.value').text(), '10'); + + this.runTask(function () { + return _this33.context.set('model', { val2: 8 }); + }); + + assert.equal(this.$('.value').text(), '8'); + }, _ref; + }; + + return MutableParamTestGenerator; + })(); + + _emberGlimmerTestsUtilsAbstractTestCase.applyMixins(ClosureComponentMutableParamsTest, new MutableParamTestGenerator([{ + title: 'param', + setup: function () { + this.render('{{component (component "change-button" model.val2)}}'); + } + }, { + title: 'nested param', + setup: function () { + this.registerComponent('my-comp', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['components'] + }), + template: '{{component components.comp}}' + }); + + this.render('{{my-comp (hash comp=(component "change-button" model.val2))}}'); + } + }, { + title: 'hash value', + setup: function () { + this.registerComponent('my-comp', { + template: '{{component component}}' + }); + + this.render('{{my-comp component=(component "change-button" val=model.val2)}}'); + } + }, { + title: 'nested hash value', + setup: function () { + this.registerComponent('my-comp', { + template: '{{component components.button}}' + }); + + this.render('{{my-comp components=(hash button=(component "change-button" val=model.val2))}}'); + } + }])); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: closure components -- mutable params', ClosureComponentMutableParamsTest); +}); +enifed('ember-glimmer/tests/integration/components/closure-components-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/closure-components-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/closure-components-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/closure-components-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/closure-components-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/closure-components-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/curly-components-test', ['exports', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/test-helpers'], function (exports, _emberMetal, _emberRuntime, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsTestHelpers) { + /* globals EmberDev */ + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{foo-bar class="bar baz"}}\n {{foo-bar classNames="bar baz"}}\n {{foo-bar}}\n '], ['\n {{foo-bar class="bar baz"}}\n {{foo-bar classNames="bar baz"}}\n {{foo-bar}}\n ']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if cond1}}\n {{#foo-bar id=1}}\n {{#if cond2}}\n {{#foo-bar id=2}}{{/foo-bar}}\n {{#if cond3}}\n {{#foo-bar id=3}}\n {{#if cond4}}\n {{#foo-bar id=4}}\n {{#if cond5}}\n {{#foo-bar id=5}}{{/foo-bar}}\n {{#foo-bar id=6}}{{/foo-bar}}\n {{#foo-bar id=7}}{{/foo-bar}}\n {{/if}}\n {{#foo-bar id=8}}{{/foo-bar}}\n {{/foo-bar}}\n {{/if}}\n {{/foo-bar}}\n {{/if}}\n {{/if}}\n {{/foo-bar}}\n {{/if}}'], ['\n {{#if cond1}}\n {{#foo-bar id=1}}\n {{#if cond2}}\n {{#foo-bar id=2}}{{/foo-bar}}\n {{#if cond3}}\n {{#foo-bar id=3}}\n {{#if cond4}}\n {{#foo-bar id=4}}\n {{#if cond5}}\n {{#foo-bar id=5}}{{/foo-bar}}\n {{#foo-bar id=6}}{{/foo-bar}}\n {{#foo-bar id=7}}{{/foo-bar}}\n {{/if}}\n {{#foo-bar id=8}}{{/foo-bar}}\n {{/foo-bar}}\n {{/if}}\n {{/foo-bar}}\n {{/if}}\n {{/if}}\n {{/foo-bar}}\n {{/if}}']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if isStream}}\n true\n {{else}}\n false\n {{/if}}\n '], ['\n {{#if isStream}}\n true\n {{else}}\n false\n {{/if}}\n ']), + _templateObject4 = babelHelpers.taggedTemplateLiteralLoose(['\n Args: {{this.attrs.value}} | {{attrs.value}} | {{value}}\n {{#each this.attrs.items as |item|}}\n {{item}}\n {{/each}}\n {{#each attrs.items as |item|}}\n {{item}}\n {{/each}}\n {{#each items as |item|}}\n {{item}}\n {{/each}}\n '], ['\n Args: {{this.attrs.value}} | {{attrs.value}} | {{value}}\n {{#each this.attrs.items as |item|}}\n {{item}}\n {{/each}}\n {{#each attrs.items as |item|}}\n {{item}}\n {{/each}}\n {{#each items as |item|}}\n {{item}}\n {{/each}}\n ']), + _templateObject5 = babelHelpers.taggedTemplateLiteralLoose(['Args: lul | lul | lul111'], ['Args: lul | lul | lul111']), + _templateObject6 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with-block someProp=prop}}\n In template\n {{/with-block}}'], ['\n {{#with-block someProp=prop}}\n In template\n {{/with-block}}']), + _templateObject7 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each names as |name|}}\n {{name}}\n {{/each}}'], ['\n {{#each names as |name|}}\n {{name}}\n {{/each}}']), + _templateObject8 = babelHelpers.taggedTemplateLiteralLoose(['\n {{sample-component "Foo" 4 "Bar" elementId="args-3"}}\n {{sample-component "Foo" 4 "Bar" 5 "Baz" elementId="args-5"}}'], ['\n {{sample-component "Foo" 4 "Bar" elementId="args-3"}}\n {{sample-component "Foo" 4 "Bar" 5 "Baz" elementId="args-5"}}']), + _templateObject9 = babelHelpers.taggedTemplateLiteralLoose(['\n {{sample-component "one" "two" elementId="two-positional"}}\n {{sample-component "one" second="two" elementId="one-positional"}}\n {{sample-component first="one" second="two" elementId="no-positional"}}'], ['\n {{sample-component "one" "two" elementId="two-positional"}}\n {{sample-component "one" second="two" elementId="one-positional"}}\n {{sample-component first="one" second="two" elementId="no-positional"}}']), + _templateObject10 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each n as |name|}}\n {{name}}\n {{/each}}'], ['\n {{#each n as |name|}}\n {{name}}\n {{/each}}']), + _templateObject11 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with-template name="with-block"}}\n [In block - {{name}}]\n {{/with-template}}\n {{with-template name="without-block"}}'], ['\n {{#with-template name="with-block"}}\n [In block - {{name}}]\n {{/with-template}}\n {{with-template name="without-block"}}']), + _templateObject12 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if hasBlock}}\n {{yield}}\n {{else}}\n No Block!\n {{/if}}'], ['\n {{#if hasBlock}}\n {{yield}}\n {{else}}\n No Block!\n {{/if}}']), + _templateObject13 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with-block}}\n In template\n {{/with-block}}'], ['\n {{#with-block}}\n In template\n {{/with-block}}']), + _templateObject14 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if hasBlockParams}}\n {{yield this}} - In Component\n {{else}}\n {{yield}} No Block!\n {{/if}}'], ['\n {{#if hasBlockParams}}\n {{yield this}} - In Component\n {{else}}\n {{yield}} No Block!\n {{/if}}']), + _templateObject15 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with-block as |something|}}\n In template\n {{/with-block}}'], ['\n {{#with-block as |something|}}\n In template\n {{/with-block}}']), + _templateObject16 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if hasBlockParams}}\n {{yield this}}\n {{else}}\n {{yield}} No Block Param!\n {{/if}}'], ['\n {{#if hasBlockParams}}\n {{yield this}}\n {{else}}\n {{yield}} No Block Param!\n {{/if}}']), + _templateObject17 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with-block}}\n In block\n {{/with-block}}'], ['\n {{#with-block}}\n In block\n {{/with-block}}']), + _templateObject18 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if predicate}}\n Yes:{{yield someValue}}\n {{else}}\n No:{{yield to="inverse"}}\n {{/if}}'], ['\n {{#if predicate}}\n Yes:{{yield someValue}}\n {{else}}\n No:{{yield to="inverse"}}\n {{/if}}']), + _templateObject19 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#my-if predicate=activated someValue=42 as |result|}}\n Hello{{result}}\n {{else}}\n Goodbye\n {{/my-if}}'], ['\n {{#my-if predicate=activated someValue=42 as |result|}}\n Hello{{result}}\n {{else}}\n Goodbye\n {{/my-if}}']), + _templateObject20 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if (hasBlock "inverse")}}\n Yes\n {{else}}\n No\n {{/if}}'], ['\n {{#if (hasBlock "inverse")}}\n Yes\n {{else}}\n No\n {{/if}}']), + _templateObject21 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#check-inverse}}{{/check-inverse}}\n {{#check-inverse}}{{else}}{{/check-inverse}}'], ['\n {{#check-inverse}}{{/check-inverse}}\n {{#check-inverse}}{{else}}{{/check-inverse}}']), + _templateObject22 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if (hasBlock)}}\n Yes\n {{else}}\n No\n {{/if}}'], ['\n {{#if (hasBlock)}}\n Yes\n {{else}}\n No\n {{/if}}']), + _templateObject23 = babelHelpers.taggedTemplateLiteralLoose(['\n {{check-block}}\n {{#check-block}}{{/check-block}}'], ['\n {{check-block}}\n {{#check-block}}{{/check-block}}']), + _templateObject24 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if (hasBlockParams "inverse")}}\n Yes\n {{else}}\n No\n {{/if}}'], ['\n {{#if (hasBlockParams "inverse")}}\n Yes\n {{else}}\n No\n {{/if}}']), + _templateObject25 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#check-inverse}}{{/check-inverse}}\n {{#check-inverse as |something|}}{{/check-inverse}}'], ['\n {{#check-inverse}}{{/check-inverse}}\n {{#check-inverse as |something|}}{{/check-inverse}}']), + _templateObject26 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if (hasBlockParams)}}\n Yes\n {{else}}\n No\n {{/if}}'], ['\n {{#if (hasBlockParams)}}\n Yes\n {{else}}\n No\n {{/if}}']), + _templateObject27 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#check-block}}{{/check-block}}\n {{#check-block as |something|}}{{/check-block}}'], ['\n {{#check-block}}{{/check-block}}\n {{#check-block as |something|}}{{/check-block}}']), + _templateObject28 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if hasBlock}}\n Yes\n {{else}}\n No\n {{/if}}'], ['\n {{#if hasBlock}}\n Yes\n {{else}}\n No\n {{/if}}']), + _templateObject29 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#check-params}}{{/check-params}}\n {{#check-params as |foo|}}{{/check-params}}'], ['\n {{#check-params}}{{/check-params}}\n {{#check-params as |foo|}}{{/check-params}}']), + _templateObject30 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if hasBlockParams}}\n Yes\n {{else}}\n No\n {{/if}}'], ['\n {{#if hasBlockParams}}\n Yes\n {{else}}\n No\n {{/if}}']), + _templateObject31 = babelHelpers.taggedTemplateLiteralLoose(['\n {{check-attr}}\n {{#check-attr}}{{/check-attr}}'], ['\n {{check-attr}}\n {{#check-attr}}{{/check-attr}}']), + _templateObject32 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#check-attr}}{{/check-attr}}\n {{#check-attr}}{{else}}{{/check-attr}}'], ['\n {{#check-attr}}{{/check-attr}}\n {{#check-attr}}{{else}}{{/check-attr}}']), + _templateObject33 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#check-attr}}{{/check-attr}}\n {{#check-attr as |something|}}{{/check-attr}}'], ['\n {{#check-attr}}{{/check-attr}}\n {{#check-attr as |something|}}{{/check-attr}}']), + _templateObject34 = babelHelpers.taggedTemplateLiteralLoose(['\n {{check-helper}}\n {{#check-helper}}{{/check-helper}}'], ['\n {{check-helper}}\n {{#check-helper}}{{/check-helper}}']), + _templateObject35 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#check-helper}}{{/check-helper}}\n {{#check-helper}}{{else}}{{/check-helper}}'], ['\n {{#check-helper}}{{/check-helper}}\n {{#check-helper}}{{else}}{{/check-helper}}']), + _templateObject36 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#check-helper}}{{/check-helper}}\n {{#check-helper as |something|}}{{/check-helper}}'], ['\n {{#check-helper}}{{/check-helper}}\n {{#check-helper as |something|}}{{/check-helper}}']), + _templateObject37 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#x-outer}}\n {{#if showInner}}\n {{x-inner}}\n {{/if}}\n {{/x-outer}}'], ['\n {{#x-outer}}\n {{#if showInner}}\n {{x-inner}}\n {{/if}}\n {{/x-outer}}']), + _templateObject38 = babelHelpers.taggedTemplateLiteralLoose(['\n In layout. {{#each items as |item|}}\n [{{child-non-block item=item}}]\n {{/each}}'], ['\n In layout. {{#each items as |item|}}\n [{{child-non-block item=item}}]\n {{/each}}']), + _templateObject39 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#some-clicky-thing classNames="baz"}}\n Click Me\n {{/some-clicky-thing}}'], ['\n {{#some-clicky-thing classNames="baz"}}\n Click Me\n {{/some-clicky-thing}}']), + _templateObject40 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each blahzz as |p|}}\n {{p}}\n {{/each}}\n - {{yield}}'], ['\n {{#each blahzz as |p|}}\n {{p}}\n {{/each}}\n - {{yield}}']), + _templateObject41 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#some-clicky-thing blahzz="baz"}}\n Click Me\n {{/some-clicky-thing}}'], ['\n {{#some-clicky-thing blahzz="baz"}}\n Click Me\n {{/some-clicky-thing}}']), + _templateObject42 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#x-select value=value as |select|}}\n {{#x-option value="1" select=select}}1{{/x-option}}\n {{#x-option value="2" select=select}}2{{/x-option}}\n {{/x-select}}\n '], ['\n {{#x-select value=value as |select|}}\n {{#x-option value="1" select=select}}1{{/x-option}}\n {{#x-option value="2" select=select}}2{{/x-option}}\n {{/x-select}}\n ']), + _templateObject43 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#list-items items=items as |thing|}}\n |{{thing}}|\n\n {{#if editMode}}\n Remove {{thing}}\n {{/if}}\n {{/list-items}}\n '], ['\n {{#list-items items=items as |thing|}}\n |{{thing}}|\n\n {{#if editMode}}\n Remove {{thing}}\n {{/if}}\n {{/list-items}}\n ']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: curly components', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test it can render a basic component'] = function testItCanRenderABasicComponent() { + var _this = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar}}'); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + }; + + _class.prototype['@test it can render a template only component'] = function testItCanRenderATemplateOnlyComponent() { + var _this2 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar}}'); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + }; + + _class.prototype['@test it can have a custom id and it is not bound'] = function testItCanHaveACustomIdAndItIsNotBound() { + var _this3 = this; + + this.registerComponent('foo-bar', { template: '{{id}} {{elementId}}' }); + + this.render('{{foo-bar id=customId}}', { + customId: 'bizz' + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { id: 'bizz' }, content: 'bizz bizz' }); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { id: 'bizz' }, content: 'bizz bizz' }); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'customId', 'bar'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { id: 'bizz' }, content: 'bar bizz' }); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'customId', 'bizz'); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { id: 'bizz' }, content: 'bizz bizz' }); + }; + + _class.prototype['@test elementId cannot change'] = function testElementIdCannotChange(assert) { + var component = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + elementId: 'blahzorz', + init: function () { + this._super.apply(this, arguments); + component = this; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '{{elementId}}' }); + + this.render('{{foo-bar}}'); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { id: 'blahzorz' }, content: 'blahzorz' }); + + if (EmberDev && !EmberDev.runningProdBuild) { + var willThrow = function () { + return _emberMetal.run(null, _emberMetal.set, component, 'elementId', 'herpyderpy'); + }; + + assert.throws(willThrow, /Changing a view's elementId after creation is not allowed/); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { id: 'blahzorz' }, content: 'blahzorz' }); + } + }; + + _class.prototype['@test can specify template with `layoutName` property'] = function testCanSpecifyTemplateWithLayoutNameProperty() { + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + elementId: 'blahzorz', + layoutName: 'fizz-bar', + init: function () { + this._super.apply(this, arguments); + this.local = 'hey'; + } + }); + + this.registerTemplate('fizz-bar', 'FIZZ BAR {{local}}'); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent }); + + this.render('{{foo-bar}}'); + + this.assertText('FIZZ BAR hey'); + }; + + _class.prototype['@test can specify template with `defaultLayout` property [DEPRECATED]'] = function testCanSpecifyTemplateWithDefaultLayoutPropertyDEPRECATED() { + expectDeprecation(/Specifying `defaultLayout` to .* is deprecated. Please use `layout` instead/); + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + elementId: 'blahzorz', + defaultLayout: _emberGlimmerTestsUtilsHelpers.compile('much wat {{lulz}}'), + init: function () { + this._super.apply(this, arguments); + this.lulz = 'hey'; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent }); + + this.render('{{foo-bar}}'); + + this.assertText('much wat hey'); + }; + + _class.prototype['@test layout takes precedence over defaultLayout'] = function testLayoutTakesPrecedenceOverDefaultLayout() { + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + elementId: 'blahzorz', + layout: _emberGlimmerTestsUtilsHelpers.compile('so much layout wat {{lulz}}'), + defaultLayout: _emberGlimmerTestsUtilsHelpers.compile('much wat {{lulz}}'), + init: function () { + this._super.apply(this, arguments); + this.lulz = 'hey'; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent }); + + this.render('{{foo-bar}}'); + + this.assertText('so much layout wat hey'); + }; + + _class.prototype['@test layout supports computed property'] = function testLayoutSupportsComputedProperty() { + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + elementId: 'blahzorz', + layout: _emberMetal.computed(function () { + return _emberGlimmerTestsUtilsHelpers.compile('so much layout wat {{lulz}}'); + }), + init: function () { + this._super.apply(this, arguments); + this.lulz = 'heyo'; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent }); + + this.render('{{foo-bar}}'); + + this.assertText('so much layout wat heyo'); + }; + + _class.prototype['@test passing undefined elementId results in a default elementId'] = function testPassingUndefinedElementIdResultsInADefaultElementId(assert) { + var _this4 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'h1' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'something' }); + + this.render('{{foo-bar id=somethingUndefined}}'); + + var foundId = this.$('h1').attr('id'); + assert.ok(/^ember/.test(foundId), 'Has a reasonable id attribute (found id=' + foundId + ').'); + + this.runTask(function () { + return _this4.rerender(); + }); + + var newFoundId = this.$('h1').attr('id'); + assert.ok(/^ember/.test(newFoundId), 'Has a reasonable id attribute (found id=' + newFoundId + ').'); + + assert.equal(foundId, newFoundId); + }; + + _class.prototype['@test id is an alias for elementId'] = function testIdIsAnAliasForElementId(assert) { + var _this5 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'h1' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'something' }); + + this.render('{{foo-bar id="custom-id"}}'); + + var foundId = this.$('h1').attr('id'); + assert.equal(foundId, 'custom-id'); + + this.runTask(function () { + return _this5.rerender(); + }); + + var newFoundId = this.$('h1').attr('id'); + assert.equal(newFoundId, 'custom-id'); + + assert.equal(foundId, newFoundId); + }; + + _class.prototype['@test cannot pass both id and elementId at the same time'] = function testCannotPassBothIdAndElementIdAtTheSameTime(assert) { + var _this6 = this; + + this.registerComponent('foo-bar', { template: '' }); + + expectAssertion(function () { + _this6.render('{{foo-bar id="zomg" elementId="lol"}}'); + }, /You cannot invoke a component with both 'id' and 'elementId' at the same time./); + }; + + _class.prototype['@test it can have a custom tagName'] = function testItCanHaveACustomTagName() { + var _this7 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'foo-bar' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar}}'); + + this.assertComponentElement(this.firstChild, { tagName: 'foo-bar', content: 'hello' }); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'foo-bar', content: 'hello' }); + }; + + _class.prototype['@test it can have a custom tagName set in the constructor'] = function testItCanHaveACustomTagNameSetInTheConstructor() { + var _this8 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + this.tagName = 'foo-bar'; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar}}'); + + this.assertComponentElement(this.firstChild, { tagName: 'foo-bar', content: 'hello' }); + + this.runTask(function () { + return _this8.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'foo-bar', content: 'hello' }); + }; + + _class.prototype['@test it can have a custom tagName from the invocation'] = function testItCanHaveACustomTagNameFromTheInvocation() { + var _this9 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar tagName="foo-bar"}}'); + + this.assertComponentElement(this.firstChild, { tagName: 'foo-bar', content: 'hello' }); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'foo-bar', content: 'hello' }); + }; + + _class.prototype['@test class is applied before didInsertElement'] = function testClassIsAppliedBeforeDidInsertElement(assert) { + var componentClass = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + componentClass = this.element.className; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar class="foo-bar"}}'); + + assert.equal(componentClass, 'foo-bar ember-view'); + }; + + _class.prototype['@test it can have custom classNames'] = function testItCanHaveCustomClassNames() { + var _this10 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNames: ['foo', 'bar'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar}}'); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar') }, content: 'hello' }); + + this.runTask(function () { + return _this10.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar') }, content: 'hello' }); + }; + + _class.prototype['@test should not apply falsy class name'] = function testShouldNotApplyFalsyClassName() { + var _this11 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar class=somethingFalsy}}', { + somethingFalsy: false + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: 'ember-view' }, content: 'hello' }); + + this.runTask(function () { + return _this11.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: 'ember-view' }, content: 'hello' }); + }; + + _class.prototype['@test should apply classes of the dasherized property name when bound property specified is true'] = function testShouldApplyClassesOfTheDasherizedPropertyNameWhenBoundPropertySpecifiedIsTrue() { + var _this12 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar class=model.someTruth}}', { + model: { someTruth: true } + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('ember-view some-truth') }, content: 'hello' }); + + this.runTask(function () { + return _this12.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('ember-view some-truth') }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'model.someTruth', false); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') }, content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'model', { someTruth: true }); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('ember-view some-truth') }, content: 'hello' }); + }; + + _class.prototype['@test class property on components can be dynamic'] = function testClassPropertyOnComponentsCanBeDynamic() { + var _this13 = this; + + this.registerComponent('foo-bar', { template: 'hello' }); + + this.render('{{foo-bar class=(if fooBar "foo-bar")}}', { + fooBar: true + }); + + this.assertComponentElement(this.firstChild, { content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar') } }); + + this.runTask(function () { + return _this13.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar') } }); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'fooBar', false); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') } }); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'fooBar', true); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar') } }); + }; + + _class.prototype['@test it can have custom classNames from constructor'] = function testItCanHaveCustomClassNamesFromConstructor() { + var _this14 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + this.classNames.push('foo', 'bar', 'outside-' + this.get('extraClass')); + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar extraClass="baz"}}'); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar outside-baz') }, content: 'hello' }); + + this.runTask(function () { + return _this14.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar outside-baz') }, content: 'hello' }); + }; + + _class.prototype['@test it can set custom classNames from the invocation'] = function testItCanSetCustomClassNamesFromTheInvocation() { + var _this15 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNames: ['foo'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject)); + + this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar baz') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar baz') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo') }, content: 'hello' }); + + this.runTask(function () { + return _this15.rerender(); + }); + + this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar baz') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(1), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar baz') }, content: 'hello' }); + this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo') }, content: 'hello' }); + }; + + _class.prototype['@test it has an element'] = function testItHasAnElement() { + var _this16 = this; + + var instance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + instance = this; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar}}'); + + var element1 = instance.element; + + this.assertComponentElement(element1, { content: 'hello' }); + + this.runTask(function () { + return _this16.rerender(); + }); + + var element2 = instance.element; + + this.assertComponentElement(element2, { content: 'hello' }); + + this.assertSameNode(element2, element1); + }; + + _class.prototype['@test it has a jQuery proxy to the element'] = function testItHasAJQueryProxyToTheElement(assert) { + var _this17 = this; + + var instance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + instance = this; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar}}'); + + var element1 = instance.$()[0]; + + this.assertComponentElement(element1, { content: 'hello' }); + + this.runTask(function () { + return _this17.rerender(); + }); + + var element2 = instance.$()[0]; + + this.assertComponentElement(element2, { content: 'hello' }); + + this.assertSameNode(element2, element1); + }; + + _class.prototype['@test it scopes the jQuery proxy to the component element'] = function testItScopesTheJQueryProxyToTheComponentElement(assert) { + var _this18 = this; + + var instance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + instance = this; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'inner' }); + + this.render('outer{{foo-bar}}'); + + var $span = instance.$('span'); + + assert.equal($span.length, 1); + assert.equal($span.attr('class'), 'inner'); + + this.runTask(function () { + return _this18.rerender(); + }); + + $span = instance.$('span'); + + assert.equal($span.length, 1); + assert.equal($span.attr('class'), 'inner'); + }; + + _class.prototype['@test an empty component does not have childNodes'] = function testAnEmptyComponentDoesNotHaveChildNodes(assert) { + var _this19 = this; + + var fooBarInstance = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'input', + init: function () { + this._super(); + fooBarInstance = this; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '' }); + + this.render('{{foo-bar}}'); + + this.assertComponentElement(this.firstChild, { tagName: 'input' }); + + assert.strictEqual(fooBarInstance.element.childNodes.length, 0); + + this.runTask(function () { + return _this19.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'input' }); + + assert.strictEqual(fooBarInstance.element.childNodes.length, 0); + }; + + _class.prototype['@test it has the right parentView and childViews'] = function testItHasTheRightParentViewAndChildViews(assert) { + var _this20 = this; + + var fooBarInstance = undefined, + fooBarBazInstance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + fooBarInstance = this; + } + }); + + var FooBarBazComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + fooBarBazInstance = this; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'foo-bar {{foo-bar-baz}}' }); + this.registerComponent('foo-bar-baz', { ComponentClass: FooBarBazComponent, template: 'foo-bar-baz' }); + + this.render('{{foo-bar}}'); + this.assertText('foo-bar foo-bar-baz'); + + assert.equal(fooBarInstance.parentView, this.component); + assert.equal(fooBarBazInstance.parentView, fooBarInstance); + + assert.deepEqual(this.component.childViews, [fooBarInstance]); + assert.deepEqual(fooBarInstance.childViews, [fooBarBazInstance]); + + this.runTask(function () { + return _this20.rerender(); + }); + this.assertText('foo-bar foo-bar-baz'); + + assert.equal(fooBarInstance.parentView, this.component); + assert.equal(fooBarBazInstance.parentView, fooBarInstance); + + assert.deepEqual(this.component.childViews, [fooBarInstance]); + assert.deepEqual(fooBarInstance.childViews, [fooBarBazInstance]); + }; + + _class.prototype['@test it renders passed named arguments'] = function testItRendersPassedNamedArguments() { + var _this21 = this; + + this.registerComponent('foo-bar', { + template: '{{foo}}' + }); + + this.render('{{foo-bar foo=model.bar}}', { + model: { + bar: 'Hola' + } + }); + + this.assertText('Hola'); + + this.runTask(function () { + return _this21.rerender(); + }); + + this.assertText('Hola'); + + this.runTask(function () { + return _this21.context.set('model.bar', 'Hello'); + }); + + this.assertText('Hello'); + + this.runTask(function () { + return _this21.context.set('model', { bar: 'Hola' }); + }); + + this.assertText('Hola'); + }; + + _class.prototype['@test it can render a basic component with a block'] = function testItCanRenderABasicComponentWithABlock() { + var _this22 = this; + + this.registerComponent('foo-bar', { template: '{{yield}} - In component' }); + + this.render('{{#foo-bar}}hello{{/foo-bar}}'); + + this.assertComponentElement(this.firstChild, { content: 'hello - In component' }); + + this.runTask(function () { + return _this22.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello - In component' }); + }; + + _class.prototype['@test it can render a basic component with a block when the yield is in a partial'] = function testItCanRenderABasicComponentWithABlockWhenTheYieldIsInAPartial() { + var _this23 = this; + + this.registerPartial('_partialWithYield', 'yielded: [{{yield}}]'); + + this.registerComponent('foo-bar', { template: '{{partial "partialWithYield"}} - In component' }); + + this.render('{{#foo-bar}}hello{{/foo-bar}}'); + + this.assertComponentElement(this.firstChild, { content: 'yielded: [hello] - In component' }); + + this.runTask(function () { + return _this23.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'yielded: [hello] - In component' }); + }; + + _class.prototype['@test it can render a basic component with a block param when the yield is in a partial'] = function testItCanRenderABasicComponentWithABlockParamWhenTheYieldIsInAPartial() { + var _this24 = this; + + this.registerPartial('_partialWithYield', 'yielded: [{{yield "hello"}}]'); + + this.registerComponent('foo-bar', { template: '{{partial "partialWithYield"}} - In component' }); + + this.render('{{#foo-bar as |value|}}{{value}}{{/foo-bar}}'); + + this.assertComponentElement(this.firstChild, { content: 'yielded: [hello] - In component' }); + + this.runTask(function () { + return _this24.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'yielded: [hello] - In component' }); + }; + + _class.prototype['@test it renders the layout with the component instance as the context'] = function testItRendersTheLayoutWithTheComponentInstanceAsTheContext() { + var _this25 = this; + + var instance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + instance = this; + this.set('message', 'hello'); + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '{{message}}' }); + + this.render('{{foo-bar}}'); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + + this.runTask(function () { + return _this25.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(instance, 'message', 'goodbye'); + }); + + this.assertComponentElement(this.firstChild, { content: 'goodbye' }); + + this.runTask(function () { + return _emberMetal.set(instance, 'message', 'hello'); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + }; + + _class.prototype['@test it preserves the outer context when yielding'] = function testItPreservesTheOuterContextWhenYielding() { + var _this26 = this; + + this.registerComponent('foo-bar', { template: '{{yield}}' }); + + this.render('{{#foo-bar}}{{message}}{{/foo-bar}}', { message: 'hello' }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + + this.runTask(function () { + return _this26.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this26.context, 'message', 'goodbye'); + }); + + this.assertComponentElement(this.firstChild, { content: 'goodbye' }); + + this.runTask(function () { + return _emberMetal.set(_this26.context, 'message', 'hello'); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + }; + + _class.prototype['@test it can yield a block param named for reserved words [GH#14096]'] = function testItCanYieldABlockParamNamedForReservedWordsGH14096() { + var instance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + instance = this; + }, + + name: 'foo-bar' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '{{yield this}}' }); + + this.render('{{#foo-bar as |component|}}{{component.name}}{{/foo-bar}}'); + + this.assertComponentElement(this.firstChild, { content: 'foo-bar' }); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(instance, 'name', 'derp-qux'); + }); + + this.assertComponentElement(this.firstChild, { content: 'derp-qux' }); + + this.runTask(function () { + return _emberMetal.set(instance, 'name', 'foo-bar'); + }); + + this.assertComponentElement(this.firstChild, { content: 'foo-bar' }); + }; + + _class.prototype['@test it can yield internal and external properties positionally'] = function testItCanYieldInternalAndExternalPropertiesPositionally() { + var _this27 = this; + + var instance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + instance = this; + }, + greeting: 'hello' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '{{yield greeting greetee.firstName}}' }); + + this.render('{{#foo-bar greetee=person as |greeting name|}}{{name}} {{person.lastName}}, {{greeting}}{{/foo-bar}}', { + person: { + firstName: 'Joel', + lastName: 'Kang' + } + }); + + this.assertComponentElement(this.firstChild, { content: 'Joel Kang, hello' }); + + this.runTask(function () { + return _this27.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'Joel Kang, hello' }); + + this.runTask(function () { + return _emberMetal.set(_this27.context, 'person', { firstName: 'Dora', lastName: 'the Explorer' }); + }); + + this.assertComponentElement(this.firstChild, { content: 'Dora the Explorer, hello' }); + + this.runTask(function () { + return _emberMetal.set(instance, 'greeting', 'hola'); + }); + + this.assertComponentElement(this.firstChild, { content: 'Dora the Explorer, hola' }); + + this.runTask(function () { + _emberMetal.set(instance, 'greeting', 'hello'); + _emberMetal.set(_this27.context, 'person', { + firstName: 'Joel', + lastName: 'Kang' + }); + }); + + this.assertComponentElement(this.firstChild, { content: 'Joel Kang, hello' }); + }; + + _class.prototype['@test #11519 - block param infinite loop'] = function test11519BlockParamInfiniteLoop() { + var _this28 = this; + + var instance = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + instance = this; + }, + danger: 0 + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '{{danger}}{{yield danger}}' }); + + // On initial render, create streams. The bug will not have manifested yet, but at this point + // we have created streams that create a circular invalidation. + this.render('{{#foo-bar as |dangerBlockParam|}}{{/foo-bar}}'); + + this.assertText('0'); + + // Trigger a non-revalidating re-render. The yielded block will not be dirtied + // nor will block param streams, and thus no infinite loop will occur. + this.runTask(function () { + return _this28.rerender(); + }); + + this.assertText('0'); + + // Trigger a revalidation, which will cause an infinite loop without the fix + // in place. Note that we do not see the infinite loop is in testing mode, + // because a deprecation warning about re-renders is issued, which Ember + // treats as an exception. + this.runTask(function () { + return _emberMetal.set(instance, 'danger', 1); + }); + + this.assertText('1'); + + this.runTask(function () { + return _emberMetal.set(instance, 'danger', 0); + }); + + this.assertText('0'); + }; + + _class.prototype['@test the component and its child components are destroyed'] = function testTheComponentAndItsChildComponentsAreDestroyed(assert) { + var _this29 = this; + + var destroyed = { 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0 }; + + this.registerComponent('foo-bar', { + template: '{{id}} {{yield}}', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + willDestroy: function () { + this._super(); + destroyed[this.get('id')]++; + } + }) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2), { + cond1: true, + cond2: true, + cond3: true, + cond4: true, + cond5: true + }); + + this.assertText('1 2 3 4 5 6 7 8 '); + + this.runTask(function () { + return _this29.rerender(); + }); + + assert.deepEqual(destroyed, { 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0 }); + + this.runTask(function () { + return _emberMetal.set(_this29.context, 'cond5', false); + }); + + this.assertText('1 2 3 4 8 '); + + assert.deepEqual(destroyed, { 1: 0, 2: 0, 3: 0, 4: 0, 5: 1, 6: 1, 7: 1, 8: 0 }); + + this.runTask(function () { + _emberMetal.set(_this29.context, 'cond3', false); + _emberMetal.set(_this29.context, 'cond5', true); + _emberMetal.set(_this29.context, 'cond4', false); + }); + + assert.deepEqual(destroyed, { 1: 0, 2: 0, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1 }); + + this.runTask(function () { + _emberMetal.set(_this29.context, 'cond2', false); + _emberMetal.set(_this29.context, 'cond1', false); + }); + + assert.deepEqual(destroyed, { 1: 1, 2: 1, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1 }); + }; + + _class.prototype['@test should escape HTML in normal mustaches'] = function testShouldEscapeHTMLInNormalMustaches() { + var _this30 = this; + + var component = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + output: 'you need to be more bold' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '{{output}}' }); + + this.render('{{foo-bar}}'); + + this.assertText('you need to be more bold'); + + this.runTask(function () { + return _this30.rerender(); + }); + + this.assertText('you need to be more bold'); + + this.runTask(function () { + return _emberMetal.set(component, 'output', 'you are so super'); + }); + + this.assertText('you are so super'); + + this.runTask(function () { + return _emberMetal.set(component, 'output', 'you need to be more bold'); + }); + }; + + _class.prototype['@test should not escape HTML in triple mustaches'] = function testShouldNotEscapeHTMLInTripleMustaches(assert) { + var _this31 = this; + + var expectedHtmlBold = 'you need to be more bold'; + var expectedHtmlItalic = 'you are so super'; + var component = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + output: expectedHtmlBold + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '{{{output}}}' }); + + this.render('{{foo-bar}}'); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.firstChild, expectedHtmlBold); + + this.runTask(function () { + return _this31.rerender(); + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.firstChild, expectedHtmlBold); + + this.runTask(function () { + return _emberMetal.set(component, 'output', expectedHtmlItalic); + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.firstChild, expectedHtmlItalic); + + this.runTask(function () { + return _emberMetal.set(component, 'output', expectedHtmlBold); + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.firstChild, expectedHtmlBold); + }; + + _class.prototype['@test should not escape HTML if string is a htmlSafe'] = function testShouldNotEscapeHTMLIfStringIsAHtmlSafe(assert) { + var _this32 = this; + + var expectedHtmlBold = 'you need to be more bold'; + var expectedHtmlItalic = 'you are so super'; + var component = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + output: _emberGlimmerTestsUtilsHelpers.htmlSafe(expectedHtmlBold) + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '{{output}}' }); + + this.render('{{foo-bar}}'); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.firstChild, expectedHtmlBold); + + this.runTask(function () { + return _this32.rerender(); + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.firstChild, expectedHtmlBold); + + this.runTask(function () { + return _emberMetal.set(component, 'output', _emberGlimmerTestsUtilsHelpers.htmlSafe(expectedHtmlItalic)); + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.firstChild, expectedHtmlItalic); + + this.runTask(function () { + return _emberMetal.set(component, 'output', _emberGlimmerTestsUtilsHelpers.htmlSafe(expectedHtmlBold)); + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.firstChild, expectedHtmlBold); + }; + + _class.prototype['@test late bound layouts return the same definition'] = function testLateBoundLayoutsReturnTheSameDefinition(assert) { + var templateIds = []; + var component = undefined; + + // This is testing the scenario where you import a template and + // set it to the layout property: + // + // import layout from './template'; + // + // export default Ember.Component.extend({ + // layout + // }); + var hello = _emberGlimmerTestsUtilsHelpers.compile('Hello'); + var bye = _emberGlimmerTestsUtilsHelpers.compile('Bye'); + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + this.layout = this.cond ? hello : bye; + component = this; + templateIds.push(this.layout.id); + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent }); + + this.render('{{foo-bar cond=true}}{{foo-bar cond=false}}{{foo-bar cond=true}}{{foo-bar cond=false}}'); + + var t1 = templateIds[0]; + var t2 = templateIds[1]; + var t3 = templateIds[2]; + var t4 = templateIds[3]; + + assert.equal(t1, t3); + assert.equal(t2, t4); + }; + + _class.prototype['@test can use isStream property without conflict (#13271)'] = function testCanUseIsStreamPropertyWithoutConflict13271() { + var _this33 = this; + + var component = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + isStream: true, + + init: function () { + this._super.apply(this, arguments); + component = this; + } + }); + + this.registerComponent('foo-bar', { + ComponentClass: FooBarComponent, + + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3) + }); + + this.render('{{foo-bar}}'); + + this.assertComponentElement(this.firstChild, { content: 'true' }); + + this.runTask(function () { + return _this33.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'true' }); + + this.runTask(function () { + return _emberMetal.set(component, 'isStream', false); + }); + + this.assertComponentElement(this.firstChild, { content: 'false' }); + + this.runTask(function () { + return _emberMetal.set(component, 'isStream', true); + }); + + this.assertComponentElement(this.firstChild, { content: 'true' }); + }; + + _class.prototype['@test lookup of component takes priority over property'] = function testLookupOfComponentTakesPriorityOverProperty() { + var _this34 = this; + + this.registerComponent('some-component', { + template: 'some-component' + }); + + this.render('{{some-prop}} {{some-component}}', { + 'some-component': 'not-some-component', + 'some-prop': 'some-prop' + }); + + this.assertText('some-prop some-component'); + + this.runTask(function () { + return _this34.rerender(); + }); + + this.assertText('some-prop some-component'); + }; + + _class.prototype['@test component without dash is not looked up'] = function testComponentWithoutDashIsNotLookedUp() { + var _this35 = this; + + this.registerComponent('somecomponent', { + template: 'somecomponent' + }); + + this.render('{{somecomponent}}', { + 'somecomponent': 'notsomecomponent' + }); + + this.assertText('notsomecomponent'); + + this.runTask(function () { + return _this35.rerender(); + }); + + this.assertText('notsomecomponent'); + + this.runTask(function () { + return _this35.context.set('somecomponent', 'not not notsomecomponent'); + }); + + this.assertText('not not notsomecomponent'); + + this.runTask(function () { + return _this35.context.set('somecomponent', 'notsomecomponent'); + }); + + this.assertText('notsomecomponent'); + }; + + _class.prototype['@test non-block with properties on attrs'] = function testNonBlockWithPropertiesOnAttrs() { + var _this36 = this; + + this.registerComponent('non-block', { + template: 'In layout - someProp: {{attrs.someProp}}' + }); + + this.render('{{non-block someProp=prop}}', { + prop: 'something here' + }); + + this.assertText('In layout - someProp: something here'); + + this.runTask(function () { + return _this36.rerender(); + }); + + this.assertText('In layout - someProp: something here'); + + this.runTask(function () { + return _this36.context.set('prop', 'other thing there'); + }); + + this.assertText('In layout - someProp: other thing there'); + + this.runTask(function () { + return _this36.context.set('prop', 'something here'); + }); + + this.assertText('In layout - someProp: something here'); + }; + + _class.prototype['@test non-block with properties overridden in init'] = function testNonBlockWithPropertiesOverriddenInInit() { + var _this37 = this; + + var instance = undefined; + this.registerComponent('non-block', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + instance = this; + this.someProp = 'value set in instance'; + } + }), + template: 'In layout - someProp: {{someProp}}' + }); + + this.render('{{non-block someProp=prop}}', { + prop: 'something passed when invoked' + }); + + this.assertText('In layout - someProp: value set in instance'); + + this.runTask(function () { + return _this37.rerender(); + }); + + this.assertText('In layout - someProp: value set in instance'); + + this.runTask(function () { + return _this37.context.set('prop', 'updated something passed when invoked'); + }); + + this.assertText('In layout - someProp: updated something passed when invoked'); + + this.runTask(function () { + return instance.set('someProp', 'update value set in instance'); + }); + + this.assertText('In layout - someProp: update value set in instance'); + + this.runTask(function () { + return _this37.context.set('prop', 'something passed when invoked'); + }); + this.runTask(function () { + return instance.set('someProp', 'value set in instance'); + }); + + this.assertText('In layout - someProp: value set in instance'); + }; + + _class.prototype['@test rerendering component with attrs from parent'] = function testRerenderingComponentWithAttrsFromParent(assert) { + var _this38 = this; + + var willUpdateCount = 0; + var didReceiveAttrsCount = 0; + + function expectHooks(_ref, callback) { + var willUpdate = _ref.willUpdate; + var didReceiveAttrs = _ref.didReceiveAttrs; + + willUpdateCount = 0; + didReceiveAttrsCount = 0; + + callback(); + + if (willUpdate) { + assert.strictEqual(willUpdateCount, 1, 'The willUpdate hook was fired'); + } else { + assert.strictEqual(willUpdateCount, 0, 'The willUpdate hook was not fired'); + } + + if (didReceiveAttrs) { + assert.strictEqual(didReceiveAttrsCount, 1, 'The didReceiveAttrs hook was fired'); + } else { + assert.strictEqual(didReceiveAttrsCount, 0, 'The didReceiveAttrs hook was not fired'); + } + } + + this.registerComponent('non-block', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didReceiveAttrs: function () { + didReceiveAttrsCount++; + }, + + willUpdate: function () { + willUpdateCount++; + } + }), + template: 'In layout - someProp: {{someProp}}' + }); + + expectHooks({ willUpdate: false, didReceiveAttrs: true }, function () { + _this38.render('{{non-block someProp=someProp}}', { + someProp: 'wycats' + }); + }); + + this.assertText('In layout - someProp: wycats'); + + // Note: Hooks are not fired in Glimmer for idempotent re-renders + expectHooks({ willUpdate: false, didReceiveAttrs: false }, function () { + _this38.runTask(function () { + return _this38.rerender(); + }); + }); + + this.assertText('In layout - someProp: wycats'); + + expectHooks({ willUpdate: true, didReceiveAttrs: true }, function () { + _this38.runTask(function () { + return _this38.context.set('someProp', 'tomdale'); + }); + }); + + this.assertText('In layout - someProp: tomdale'); + + // Note: Hooks are not fired in Glimmer for idempotent re-renders + expectHooks({ willUpdate: false, didReceiveAttrs: false }, function () { + _this38.runTask(function () { + return _this38.rerender(); + }); + }); + + this.assertText('In layout - someProp: tomdale'); + + expectHooks({ willUpdate: true, didReceiveAttrs: true }, function () { + _this38.runTask(function () { + return _this38.context.set('someProp', 'wycats'); + }); + }); + + this.assertText('In layout - someProp: wycats'); + }; + + _class.prototype['@test this.attrs.foo === attrs.foo === foo'] = function testThisAttrsFooAttrsFooFoo() { + var _this39 = this; + + this.registerComponent('foo-bar', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4) + }); + + this.render('{{foo-bar value=model.value items=model.items}}', { + model: { + value: 'wat', + items: [1, 2, 3] + } + }); + + this.assertStableRerender(); + + this.runTask(function () { + _this39.context.set('model.value', 'lul'); + _this39.context.set('model.items', [1]); + }); + + this.assertText(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5)); + + this.runTask(function () { + return _this39.context.set('model', { value: 'wat', items: [1, 2, 3] }); + }); + + this.assertText('Args: wat | wat | wat123123123'); + }; + + _class.prototype['@test non-block with properties on self'] = function testNonBlockWithPropertiesOnSelf() { + var _this40 = this; + + this.registerComponent('non-block', { + template: 'In layout - someProp: {{someProp}}' + }); + + this.render('{{non-block someProp=prop}}', { + prop: 'something here' + }); + + this.assertText('In layout - someProp: something here'); + + this.runTask(function () { + return _this40.rerender(); + }); + + this.assertText('In layout - someProp: something here'); + + this.runTask(function () { + return _this40.context.set('prop', 'something else'); + }); + + this.assertText('In layout - someProp: something else'); + + this.runTask(function () { + return _this40.context.set('prop', 'something here'); + }); + + this.assertText('In layout - someProp: something here'); + }; + + _class.prototype['@test block with properties on self'] = function testBlockWithPropertiesOnSelf() { + var _this41 = this; + + this.registerComponent('with-block', { + template: 'In layout - someProp: {{someProp}} - {{yield}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject6), { + prop: 'something here' + }); + + this.assertText('In layout - someProp: something here - In template'); + + this.runTask(function () { + return _this41.rerender(); + }); + + this.assertText('In layout - someProp: something here - In template'); + + this.runTask(function () { + return _this41.context.set('prop', 'something else'); + }); + + this.assertText('In layout - someProp: something else - In template'); + + this.runTask(function () { + return _this41.context.set('prop', 'something here'); + }); + + this.assertText('In layout - someProp: something here - In template'); + }; + + _class.prototype['@test block with properties on attrs'] = function testBlockWithPropertiesOnAttrs() { + var _this42 = this; + + this.registerComponent('with-block', { + template: 'In layout - someProp: {{attrs.someProp}} - {{yield}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject6), { + prop: 'something here' + }); + + this.assertText('In layout - someProp: something here - In template'); + + this.runTask(function () { + return _this42.rerender(); + }); + + this.assertText('In layout - someProp: something here - In template'); + + this.runTask(function () { + return _this42.context.set('prop', 'something else'); + }); + + this.assertText('In layout - someProp: something else - In template'); + + this.runTask(function () { + return _this42.context.set('prop', 'something here'); + }); + + this.assertText('In layout - someProp: something here - In template'); + }; + + _class.prototype['@test static arbitrary number of positional parameters'] = function testStaticArbitraryNumberOfPositionalParameters(assert) { + var _this43 = this; + + this.registerComponent('sample-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'names' + }), + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject7) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject8)); + + assert.equal(this.$('#args-3').text(), 'Foo4Bar'); + assert.equal(this.$('#args-5').text(), 'Foo4Bar5Baz'); + + this.runTask(function () { + return _this43.rerender(); + }); + + assert.equal(this.$('#args-3').text(), 'Foo4Bar'); + assert.equal(this.$('#args-5').text(), 'Foo4Bar5Baz'); + }; + + _class.prototype['@test arbitrary positional parameter conflict with hash parameter is reported'] = function testArbitraryPositionalParameterConflictWithHashParameterIsReported() { + var _this44 = this; + + this.registerComponent('sample-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'names' + }), + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject7) + }); + + expectAssertion(function () { + _this44.render('{{sample-component "Foo" 4 "Bar" names=numbers id="args-3"}}', { + numbers: [1, 2, 3] + }); + }, 'You cannot specify positional parameters and the hash argument `names`.'); + }; + + _class.prototype['@test can use hash parameter instead of arbitrary positional param [GH #12444]'] = function testCanUseHashParameterInsteadOfArbitraryPositionalParamGH12444(assert) { + var _this45 = this; + + this.registerComponent('sample-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'names' + }), + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject7) + }); + + this.render('{{sample-component names=things}}', { + things: _emberRuntime.A(['Foo', 4, 'Bar']) + }); + + this.assertText('Foo4Bar'); + + this.runTask(function () { + return _this45.rerender(); + }); + + this.assertText('Foo4Bar'); + + this.runTask(function () { + return _this45.context.get('things').pushObject(5); + }); + + this.assertText('Foo4Bar5'); + + this.runTask(function () { + return _this45.context.get('things').shiftObject(); + }); + + this.assertText('4Bar5'); + + this.runTask(function () { + return _this45.context.get('things').clear(); + }); + + this.assertText(''); + + this.runTask(function () { + return _this45.context.set('things', _emberRuntime.A(['Foo', 4, 'Bar'])); + }); + + this.assertText('Foo4Bar'); + }; + + _class.prototype['@test can use hash parameter instead of positional param'] = function testCanUseHashParameterInsteadOfPositionalParam(assert) { + var _this46 = this; + + this.registerComponent('sample-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['first', 'second'] + }), + template: '{{first}} - {{second}}' + }); + + // TODO: Fix when id is implemented + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject9)); + + assert.equal(this.$('#two-positional').text(), 'one - two'); + assert.equal(this.$('#one-positional').text(), 'one - two'); + assert.equal(this.$('#no-positional').text(), 'one - two'); + + this.runTask(function () { + return _this46.rerender(); + }); + + assert.equal(this.$('#two-positional').text(), 'one - two'); + assert.equal(this.$('#one-positional').text(), 'one - two'); + assert.equal(this.$('#no-positional').text(), 'one - two'); + }; + + _class.prototype['@test dynamic arbitrary number of positional parameters'] = function testDynamicArbitraryNumberOfPositionalParameters(assert) { + var _this47 = this; + + this.registerComponent('sample-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'n' + }), + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject10) + }); + + this.render('{{sample-component user1 user2}}', { + user1: 'Foo', + user2: 4 + }); + + this.assertText('Foo4'); + + this.runTask(function () { + return _this47.rerender(); + }); + + this.assertText('Foo4'); + + this.runTask(function () { + return _this47.context.set('user1', 'Bar'); + }); + + this.assertText('Bar4'); + + this.runTask(function () { + return _this47.context.set('user2', '5'); + }); + + this.assertText('Bar5'); + + this.runTask(function () { + _this47.context.set('user1', 'Foo'); + _this47.context.set('user2', 4); + }); + + this.assertText('Foo4'); + }; + + _class.prototype['@test with ariaRole specified'] = function testWithAriaRoleSpecified() { + var _this48 = this; + + this.registerComponent('aria-test', { + template: 'Here!' + }); + + this.render('{{aria-test ariaRole=role}}', { + role: 'main' + }); + + this.assertComponentElement(this.firstChild, { attrs: { role: 'main' } }); + + this.runTask(function () { + return _this48.rerender(); + }); + + this.assertComponentElement(this.firstChild, { attrs: { role: 'main' } }); + + this.runTask(function () { + return _this48.context.set('role', 'input'); + }); + + this.assertComponentElement(this.firstChild, { attrs: { role: 'input' } }); + + this.runTask(function () { + return _this48.context.set('role', 'main'); + }); + + this.assertComponentElement(this.firstChild, { attrs: { role: 'main' } }); + }; + + _class.prototype['@test `template` specified in component is overriden by block'] = function testTemplateSpecifiedInComponentIsOverridenByBlock() { + var _this49 = this; + + this.registerComponent('with-template', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + template: _emberGlimmerTestsUtilsHelpers.compile('Should not be used') + }), + template: '[In layout - {{name}}] {{yield}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject11), { + name: 'Whoop, whoop!' + }); + + this.assertText('[In layout - with-block] [In block - Whoop, whoop!][In layout - without-block] '); + + this.runTask(function () { + return _this49.rerender(); + }); + + this.assertText('[In layout - with-block] [In block - Whoop, whoop!][In layout - without-block] '); + + this.runTask(function () { + return _this49.context.set('name', 'Ole, ole'); + }); + + this.assertText('[In layout - with-block] [In block - Ole, ole][In layout - without-block] '); + + this.runTask(function () { + return _this49.context.set('name', 'Whoop, whoop!'); + }); + + this.assertText('[In layout - with-block] [In block - Whoop, whoop!][In layout - without-block] '); + }; + + _class.prototype['@test hasBlock is true when block supplied'] = function testHasBlockIsTrueWhenBlockSupplied() { + var _this50 = this; + + this.registerComponent('with-block', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject12) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject13)); + + this.assertText('In template'); + + this.runTask(function () { + return _this50.rerender(); + }); + + this.assertText('In template'); + }; + + _class.prototype['@test hasBlock is false when no block supplied'] = function testHasBlockIsFalseWhenNoBlockSupplied() { + var _this51 = this; + + this.registerComponent('with-block', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject12) + }); + + this.render('{{with-block}}'); + + this.assertText('No Block!'); + + this.runTask(function () { + return _this51.rerender(); + }); + + this.assertText('No Block!'); + }; + + _class.prototype['@test hasBlockParams is true when block param supplied'] = function testHasBlockParamsIsTrueWhenBlockParamSupplied() { + var _this52 = this; + + this.registerComponent('with-block', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject14) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject15)); + + this.assertText('In template - In Component'); + + this.runTask(function () { + return _this52.rerender(); + }); + + this.assertText('In template - In Component'); + }; + + _class.prototype['@test hasBlockParams is false when no block param supplied'] = function testHasBlockParamsIsFalseWhenNoBlockParamSupplied() { + var _this53 = this; + + this.registerComponent('with-block', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject16) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject17)); + + this.assertText('In block No Block Param!'); + + this.runTask(function () { + return _this53.rerender(); + }); + + this.assertText('In block No Block Param!'); + }; + + _class.prototype['@test static named positional parameters'] = function testStaticNamedPositionalParameters() { + var _this54 = this; + + this.registerComponent('sample-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['name', 'age'] + }), + template: '{{name}}{{age}}' + }); + + this.render('{{sample-component "Quint" 4}}'); + + this.assertText('Quint4'); + + this.runTask(function () { + return _this54.rerender(); + }); + + this.assertText('Quint4'); + }; + + _class.prototype['@test dynamic named positional parameters'] = function testDynamicNamedPositionalParameters() { + var _this55 = this; + + this.registerComponent('sample-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['name', 'age'] + }), + template: '{{name}}{{age}}' + }); + + this.render('{{sample-component myName myAge}}', { + myName: 'Quint', + myAge: 4 + }); + + this.assertText('Quint4'); + + this.runTask(function () { + return _this55.rerender(); + }); + + this.assertText('Quint4'); + + this.runTask(function () { + return _this55.context.set('myName', 'Sergio'); + }); + + this.assertText('Sergio4'); + + this.runTask(function () { + return _this55.context.set('myAge', 2); + }); + + this.assertText('Sergio2'); + + this.runTask(function () { + _this55.context.set('myName', 'Quint'); + _this55.context.set('myAge', 4); + }); + + this.assertText('Quint4'); + }; + + _class.prototype['@test if a value is passed as a non-positional parameter, it raises an assertion'] = function testIfAValueIsPassedAsANonPositionalParameterItRaisesAnAssertion() { + var _this56 = this; + + this.registerComponent('sample-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['name'] + }), + template: '{{name}}' + }); + + expectAssertion(function () { + _this56.render('{{sample-component notMyName name=myName}}', { + myName: 'Quint', + notMyName: 'Sergio' + }); + }, 'You cannot specify both a positional param (at position 0) and the hash argument `name`.'); + }; + + _class.prototype['@test yield to inverse'] = function testYieldToInverse() { + var _this57 = this; + + this.registerComponent('my-if', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject18) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject19), { + activated: true + }); + + this.assertText('Yes:Hello42'); + + this.runTask(function () { + return _this57.rerender(); + }); + + this.assertText('Yes:Hello42'); + + this.runTask(function () { + return _this57.context.set('activated', false); + }); + + this.assertText('No:Goodbye'); + + this.runTask(function () { + return _this57.context.set('activated', true); + }); + + this.assertText('Yes:Hello42'); + }; + + _class.prototype['@test expression hasBlock inverse'] = function testExpressionHasBlockInverse(assert) { + this.registerComponent('check-inverse', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject20) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject21)); + + this.assertComponentElement(this.firstChild, { content: 'No' }); + this.assertComponentElement(this.nthChild(1), { content: 'Yes' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test expression hasBlock default'] = function testExpressionHasBlockDefault(assert) { + this.registerComponent('check-block', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject22) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject23)); + + this.assertComponentElement(this.firstChild, { content: 'No' }); + this.assertComponentElement(this.nthChild(1), { content: 'Yes' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test expression hasBlockParams inverse'] = function testExpressionHasBlockParamsInverse(assert) { + this.registerComponent('check-inverse', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject24) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject25)); + + this.assertComponentElement(this.firstChild, { content: 'No' }); + this.assertComponentElement(this.nthChild(1), { content: 'No' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test expression hasBlockParams default'] = function testExpressionHasBlockParamsDefault(assert) { + this.registerComponent('check-block', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject26) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject27)); + + this.assertComponentElement(this.firstChild, { content: 'No' }); + this.assertComponentElement(this.nthChild(1), { content: 'Yes' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test non-expression hasBlock'] = function testNonExpressionHasBlock(assert) { + this.registerComponent('check-block', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject28) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject23)); + + this.assertComponentElement(this.firstChild, { content: 'No' }); + this.assertComponentElement(this.nthChild(1), { content: 'Yes' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test expression hasBlockParams'] = function testExpressionHasBlockParams(assert) { + this.registerComponent('check-params', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject26) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject29)); + + this.assertComponentElement(this.firstChild, { content: 'No' }); + this.assertComponentElement(this.nthChild(1), { content: 'Yes' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test non-expression hasBlockParams'] = function testNonExpressionHasBlockParams(assert) { + this.registerComponent('check-params', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject30) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject29)); + + this.assertComponentElement(this.firstChild, { content: 'No' }); + this.assertComponentElement(this.nthChild(1), { content: 'Yes' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test hasBlock expression in an attribute'] = function testHasBlockExpressionInAnAttribute(assert) { + this.registerComponent('check-attr', { + template: '' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject31)); + + _emberGlimmerTestsUtilsTestHelpers.equalsElement(this.$('button')[0], 'button', { name: 'false' }, ''); + _emberGlimmerTestsUtilsTestHelpers.equalsElement(this.$('button')[1], 'button', { name: 'true' }, ''); + + this.assertStableRerender(); + }; + + _class.prototype['@test hasBlock inverse expression in an attribute'] = function testHasBlockInverseExpressionInAnAttribute(assert) { + this.registerComponent('check-attr', { + template: '' + }, ''); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject32)); + + _emberGlimmerTestsUtilsTestHelpers.equalsElement(this.$('button')[0], 'button', { name: 'false' }, ''); + _emberGlimmerTestsUtilsTestHelpers.equalsElement(this.$('button')[1], 'button', { name: 'true' }, ''); + + this.assertStableRerender(); + }; + + _class.prototype['@test hasBlockParams expression in an attribute'] = function testHasBlockParamsExpressionInAnAttribute(assert) { + this.registerComponent('check-attr', { + template: '' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject33)); + + _emberGlimmerTestsUtilsTestHelpers.equalsElement(this.$('button')[0], 'button', { name: 'false' }, ''); + _emberGlimmerTestsUtilsTestHelpers.equalsElement(this.$('button')[1], 'button', { name: 'true' }, ''); + + this.assertStableRerender(); + }; + + _class.prototype['@test hasBlockParams inverse expression in an attribute'] = function testHasBlockParamsInverseExpressionInAnAttribute(assert) { + this.registerComponent('check-attr', { + template: '' + }, ''); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject33)); + + _emberGlimmerTestsUtilsTestHelpers.equalsElement(this.$('button')[0], 'button', { name: 'false' }, ''); + _emberGlimmerTestsUtilsTestHelpers.equalsElement(this.$('button')[1], 'button', { name: 'false' }, ''); + + this.assertStableRerender(); + }; + + _class.prototype['@test hasBlock as a param to a helper'] = function testHasBlockAsAParamToAHelper(assert) { + this.registerComponent('check-helper', { + template: '{{if hasBlock "true" "false"}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject34)); + + this.assertComponentElement(this.firstChild, { content: 'false' }); + this.assertComponentElement(this.nthChild(1), { content: 'true' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test hasBlock as an expression param to a helper'] = function testHasBlockAsAnExpressionParamToAHelper(assert) { + this.registerComponent('check-helper', { + template: '{{if (hasBlock) "true" "false"}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject34)); + + this.assertComponentElement(this.firstChild, { content: 'false' }); + this.assertComponentElement(this.nthChild(1), { content: 'true' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test hasBlock inverse as a param to a helper'] = function testHasBlockInverseAsAParamToAHelper(assert) { + this.registerComponent('check-helper', { + template: '{{if (hasBlock "inverse") "true" "false"}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject35)); + + this.assertComponentElement(this.firstChild, { content: 'false' }); + this.assertComponentElement(this.nthChild(1), { content: 'true' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test hasBlockParams as a param to a helper'] = function testHasBlockParamsAsAParamToAHelper(assert) { + this.registerComponent('check-helper', { + template: '{{if hasBlockParams "true" "false"}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject36)); + + this.assertComponentElement(this.firstChild, { content: 'false' }); + this.assertComponentElement(this.nthChild(1), { content: 'true' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test hasBlockParams as an expression param to a helper'] = function testHasBlockParamsAsAnExpressionParamToAHelper(assert) { + this.registerComponent('check-helper', { + template: '{{if (hasBlockParams) "true" "false"}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject36)); + + this.assertComponentElement(this.firstChild, { content: 'false' }); + this.assertComponentElement(this.nthChild(1), { content: 'true' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test hasBlockParams inverse as a param to a helper'] = function testHasBlockParamsInverseAsAParamToAHelper(assert) { + this.registerComponent('check-helper', { + template: '{{if (hasBlockParams "inverse") "true" "false"}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject36)); + + this.assertComponentElement(this.firstChild, { content: 'false' }); + this.assertComponentElement(this.nthChild(1), { content: 'false' }); + + this.assertStableRerender(); + }; + + _class.prototype['@test component in template of a yielding component should have the proper parentView'] = function testComponentInTemplateOfAYieldingComponentShouldHaveTheProperParentView(assert) { + var _this58 = this; + + var outer = undefined, + innerTemplate = undefined, + innerLayout = undefined; + + this.registerComponent('x-outer', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + outer = this; + } + }), + template: '{{x-inner-in-layout}}{{yield}}' + }); + + this.registerComponent('x-inner-in-template', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerTemplate = this; + } + }) + }); + + this.registerComponent('x-inner-in-layout', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerLayout = this; + } + }) + }); + + this.render('{{#x-outer}}{{x-inner-in-template}}{{/x-outer}}'); + + assert.equal(innerTemplate.parentView, outer, 'receives the wrapping component as its parentView in template blocks'); + assert.equal(innerLayout.parentView, outer, 'receives the wrapping component as its parentView in layout'); + assert.equal(outer.parentView, this.context, 'x-outer receives the ambient scope as its parentView'); + + this.runTask(function () { + return _this58.rerender(); + }); + + assert.equal(innerTemplate.parentView, outer, 'receives the wrapping component as its parentView in template blocks'); + assert.equal(innerLayout.parentView, outer, 'receives the wrapping component as its parentView in layout'); + assert.equal(outer.parentView, this.context, 'x-outer receives the ambient scope as its parentView'); + }; + + _class.prototype['@test newly-added sub-components get correct parentView'] = function testNewlyAddedSubComponentsGetCorrectParentView(assert) { + var _this59 = this; + + var outer = undefined, + inner = undefined; + + this.registerComponent('x-outer', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + outer = this; + } + }) + }); + + this.registerComponent('x-inner', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + inner = this; + } + }) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject37), { + showInner: false + }); + + assert.equal(outer.parentView, this.context, 'x-outer receives the ambient scope as its parentView'); + + this.runTask(function () { + return _this59.rerender(); + }); + + assert.equal(outer.parentView, this.context, 'x-outer receives the ambient scope as its parentView (after rerender)'); + + this.runTask(function () { + return _this59.context.set('showInner', true); + }); + + assert.equal(outer.parentView, this.context, 'x-outer receives the ambient scope as its parentView'); + assert.equal(inner.parentView, outer, 'receives the wrapping component as its parentView in template blocks'); + + this.runTask(function () { + return _this59.context.set('showInner', false); + }); + + assert.equal(outer.parentView, this.context, 'x-outer receives the ambient scope as its parentView'); + }; + + _class.prototype['@test when a property is changed during children\'s rendering'] = function testWhenAPropertyIsChangedDuringChildrenSRendering(assert) { + var _this60 = this; + + if (true) { + expectDeprecation(/modified value twice on <\(.+> in a single render/); + } + + var outer = undefined, + middle = undefined; + + this.registerComponent('x-outer', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + outer = this; + }, + value: 1 + }), + template: '{{#x-middle}}{{x-inner value=value}}{{/x-middle}}' + }); + + this.registerComponent('x-middle', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + middle = this; + }, + value: null + }), + template: '
    {{value}}
    {{yield}}' + }); + + this.registerComponent('x-inner', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + value: null, + pushDataUp: _emberMetal.observer('value', function () { + middle.set('value', this.get('value')); + }) + }), + template: '
    {{value}}
    ' + }); + + this.render('{{x-outer}}'); + + assert.equal(this.$('#inner-value').text(), '1', 'initial render of inner'); + assert.equal(this.$('#middle-value').text(), '', 'initial render of middle (observers do not run during init)'); + + this.runTask(function () { + return _this60.rerender(); + }); + + assert.equal(this.$('#inner-value').text(), '1', 'initial render of inner'); + assert.equal(this.$('#middle-value').text(), '', 'initial render of middle (observers do not run during init)'); + + if (!true) { + expectAssertion(function () { + _this60.runTask(function () { + return outer.set('value', 2); + }); + }, /modified value twice on <\(.+> in a single render/); + + return; + } else { + this.runTask(function () { + return outer.set('value', 2); + }); + } + + assert.equal(this.$('#inner-value').text(), '2', 'second render of inner'); + assert.equal(this.$('#middle-value').text(), '2', 'second render of middle'); + + this.runTask(function () { + return outer.set('value', 3); + }); + + assert.equal(this.$('#inner-value').text(), '3', 'third render of inner'); + assert.equal(this.$('#middle-value').text(), '3', 'third render of middle'); + + this.runTask(function () { + return outer.set('value', 1); + }); + + assert.equal(this.$('#inner-value').text(), '1', 'reset render of inner'); + assert.equal(this.$('#middle-value').text(), '1', 'reset render of middle'); + }; + + _class.prototype['@test when a shared dependency is changed during children\'s rendering'] = function testWhenASharedDependencyIsChangedDuringChildrenSRendering(assert) { + var _this61 = this; + + if (true) { + expectDeprecation(/modified wrapper.content twice on in a single render/); + } + + var outer = undefined, + middle = undefined; + + this.registerComponent('x-outer', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + outer = this; + }, + value: 1, + wrapper: _emberRuntime.Object.create({ content: null }) + }), + template: '
    {{wrapper.content}}
    {{x-inner value=value wrapper=wrapper}}' + }); + + this.registerComponent('x-inner', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + middle = this; + }, + didReceiveAttrs: function () { + this.get('wrapper').set('content', this.get('value')); + }, + value: null + }), + template: '
    {{wrapper.content}}
    ' + }); + + if (!true) { + expectAssertion(function () { + _this61.render('{{x-outer}}'); + }, /modified wrapper.content twice on in a single render/); + + return; + } else { + this.render('{{x-outer}}'); + } + + assert.equal(this.$('#inner-value').text(), '1', 'initial render of inner'); + assert.equal(this.$('#outer-value').text(), '1', 'initial render of outer'); + + this.runTask(function () { + return _this61.rerender(); + }); + + assert.equal(this.$('#inner-value').text(), '1', 're-render of inner'); + assert.equal(this.$('#outer-value').text(), '1', 're-render of outer'); + + this.runTask(function () { + return outer.set('value', 2); + }); + + assert.equal(this.$('#inner-value').text(), '2', 'second render of inner'); + assert.equal(this.$('#outer-value').text(), '2', 'second render of outer'); + + this.runTask(function () { + return outer.set('value', 3); + }); + + assert.equal(this.$('#inner-value').text(), '3', 'third render of inner'); + assert.equal(this.$('#outer-value').text(), '3', 'third render of outer'); + + this.runTask(function () { + return outer.set('value', 1); + }); + + assert.equal(this.$('#inner-value').text(), '1', 'reset render of inner'); + assert.equal(this.$('#outer-value').text(), '1', 'reset render of outer'); + }; + + _class.prototype['@test non-block with each rendering child components'] = function testNonBlockWithEachRenderingChildComponents() { + var _this62 = this; + + this.registerComponent('non-block', { + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject38) + }); + + this.registerComponent('child-non-block', { + template: 'Child: {{item}}.' + }); + + var items = _emberRuntime.A(['Tom', 'Dick', 'Harry']); + + this.render('{{non-block items=items}}', { items: items }); + + this.assertText('In layout. [Child: Tom.][Child: Dick.][Child: Harry.]'); + + this.runTask(function () { + return _this62.rerender(); + }); + + this.assertText('In layout. [Child: Tom.][Child: Dick.][Child: Harry.]'); + + this.runTask(function () { + return _this62.context.get('items').pushObject('Sergio'); + }); + + this.assertText('In layout. [Child: Tom.][Child: Dick.][Child: Harry.][Child: Sergio.]'); + + this.runTask(function () { + return _this62.context.get('items').shiftObject(); + }); + + this.assertText('In layout. [Child: Dick.][Child: Harry.][Child: Sergio.]'); + + this.runTask(function () { + return _this62.context.set('items', _emberRuntime.A(['Tom', 'Dick', 'Harry'])); + }); + + this.assertText('In layout. [Child: Tom.][Child: Dick.][Child: Harry.]'); + }; + + _class.prototype['@test specifying classNames results in correct class'] = function testSpecifyingClassNamesResultsInCorrectClass(assert) { + var _this63 = this; + + var clickyThing = undefined; + + this.registerComponent('some-clicky-thing', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'button', + classNames: ['foo', 'bar'], + init: function () { + this._super.apply(this, arguments); + clickyThing = this; + } + }) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject39)); + + // TODO: ember-view is no longer viewable in the classNames array. Bug or + // feature? + var expectedClassNames = ['ember-view', 'foo', 'bar', 'baz']; + + assert.ok(this.$('button').is('.foo.bar.baz.ember-view'), 'the element has the correct classes: ' + this.$('button').attr('class')); + // `ember-view` is no longer in classNames. + // assert.deepEqual(clickyThing.get('classNames'), expectedClassNames, 'classNames are properly combined'); + this.assertComponentElement(this.firstChild, { tagName: 'button', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes(expectedClassNames.join(' ')) } }); + + this.runTask(function () { + return _this63.rerender(); + }); + + assert.ok(this.$('button').is('.foo.bar.baz.ember-view'), 'the element has the correct classes: ' + this.$('button').attr('class') + ' (rerender)'); + // `ember-view` is no longer in classNames. + // assert.deepEqual(clickyThing.get('classNames'), expectedClassNames, 'classNames are properly combined (rerender)'); + this.assertComponentElement(this.firstChild, { tagName: 'button', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes(expectedClassNames.join(' ')) } }); + }; + + _class.prototype['@test specifying custom concatenatedProperties avoids clobbering'] = function testSpecifyingCustomConcatenatedPropertiesAvoidsClobbering(assert) { + var _this64 = this; + + var clickyThing = undefined; + this.registerComponent('some-clicky-thing', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + concatenatedProperties: ['blahzz'], + blahzz: ['blark', 'pory'], + init: function () { + this._super.apply(this, arguments); + clickyThing = this; + } + }), + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject40) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject41)); + + this.assertText('blarkporybaz- Click Me'); + + this.runTask(function () { + return _this64.rerender(); + }); + + this.assertText('blarkporybaz- Click Me'); + }; + + _class.prototype['@test a two way binding flows upstream when consumed in the template'] = function testATwoWayBindingFlowsUpstreamWhenConsumedInTheTemplate() { + var _this65 = this; + + var component = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + } + }); + + this.registerComponent('foo-bar', { + ComponentClass: FooBarComponent, + + template: '{{bar}}' + }); + + this.render('{{localBar}} - {{foo-bar bar=localBar}}', { + localBar: 'initial value' + }); + + this.assertText('initial value - initial value'); + + this.runTask(function () { + return _this65.rerender(); + }); + + this.assertText('initial value - initial value'); + + if (false) { + expectAssertion(function () { + component.bar = 'foo-bar'; + }, /You must use Ember\.set\(\) to set the `bar` property \(of .+\) to `foo-bar`\./); + + this.assertText('initial value - initial value'); + } + + this.runTask(function () { + component.set('bar', 'updated value'); + }); + + this.assertText('updated value - updated value'); + + this.runTask(function () { + component.set('bar', undefined); + }); + + this.assertText(' - '); + + this.runTask(function () { + _this65.component.set('localBar', 'initial value'); + }); + + this.assertText('initial value - initial value'); + }; + + _class.prototype['@test a two way binding flows upstream through a CP when consumed in the template'] = function testATwoWayBindingFlowsUpstreamThroughACPWhenConsumedInTheTemplate() { + var _this66 = this; + + var component = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + + bar: _emberMetal.computed({ + get: function () { + return this._bar; + }, + + set: function (key, value) { + this._bar = value; + return this._bar; + } + }) + }); + + this.registerComponent('foo-bar', { + ComponentClass: FooBarComponent, + + template: '{{bar}}' + }); + + this.render('{{localBar}} - {{foo-bar bar=localBar}}', { + localBar: 'initial value' + }); + + this.assertText('initial value - initial value'); + + this.runTask(function () { + return _this66.rerender(); + }); + + this.assertText('initial value - initial value'); + + this.runTask(function () { + component.set('bar', 'updated value'); + }); + + this.assertText('updated value - updated value'); + + this.runTask(function () { + _this66.component.set('localBar', 'initial value'); + }); + + this.assertText('initial value - initial value'); + }; + + _class.prototype['@test a two way binding flows upstream through a CP without template consumption'] = function testATwoWayBindingFlowsUpstreamThroughACPWithoutTemplateConsumption() { + var _this67 = this; + + var component = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + + bar: _emberMetal.computed({ + get: function () { + return this._bar; + }, + + set: function (key, value) { + this._bar = value; + return this._bar; + } + }) + }); + + this.registerComponent('foo-bar', { + ComponentClass: FooBarComponent, + template: '' + }); + + this.render('{{localBar}}{{foo-bar bar=localBar}}', { + localBar: 'initial value' + }); + + this.assertText('initial value'); + + this.runTask(function () { + return _this67.rerender(); + }); + + this.assertText('initial value'); + + this.runTask(function () { + component.set('bar', 'updated value'); + }); + + this.assertText('updated value'); + + this.runTask(function () { + _this67.component.set('localBar', 'initial value'); + }); + + this.assertText('initial value'); + }; + + _class.prototype['@test services can be injected into components'] = function testServicesCanBeInjectedIntoComponents() { + var _this68 = this; + + var service = undefined; + this.registerService('name', _emberRuntime.Service.extend({ + init: function () { + this._super.apply(this, arguments); + service = this; + }, + last: 'Jackson' + })); + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + name: _emberRuntime.inject.service() + }), + template: '{{name.last}}' + }); + + this.render('{{foo-bar}}'); + + this.assertText('Jackson'); + + this.runTask(function () { + return _this68.rerender(); + }); + + this.assertText('Jackson'); + + this.runTask(function () { + service.set('last', 'McGuffey'); + }); + + this.assertText('McGuffey'); + + this.runTask(function () { + service.set('last', 'Jackson'); + }); + + this.assertText('Jackson'); + }; + + _class.prototype['@test can access `actions` hash via `_actions` [DEPRECATED]'] = function testCanAccessActionsHashVia_actionsDEPRECATED() { + var _this69 = this; + + var component = undefined; + + function derp() {} + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + + actions: { + derp: derp + } + }) + }); + + this.render('{{foo-bar}}'); + + this.assert.strictEqual(component.actions.derp, derp); + + expectDeprecation(function () { + _this69.assert.strictEqual(component._actions.derp, derp); + }, 'Usage of `_actions` is deprecated, use `actions` instead.'); + }; + + _class.prototype['@test throws if `this._super` is not called from `init`'] = function testThrowsIfThis_superIsNotCalledFromInit() { + var _this70 = this; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () {} + }) + }); + + expectAssertion(function () { + _this70.render('{{foo-bar}}'); + }, /You must call `this._super\(...arguments\);` when overriding `init` on a framework object. Please update .* to call `this._super\(...arguments\);` from `init`./); + }; + + _class.prototype['@test should toggle visibility with isVisible'] = function testShouldToggleVisibilityWithIsVisible(assert) { + var _this71 = this; + + var assertStyle = function (expected) { + var matcher = _emberGlimmerTestsUtilsTestHelpers.styles(expected); + var actual = _this71.firstChild.getAttribute('style'); + + assert.pushResult({ + result: matcher.match(actual), + message: matcher.message(), + actual: actual, + expected: expected + }); + }; + + this.registerComponent('foo-bar', { + template: '

    foo

    ' + }); + + this.render('{{foo-bar id="foo-bar" isVisible=visible}}', { + visible: false + }); + + assertStyle('display: none;'); + + this.assertStableRerender(); + + this.runTask(function () { + _emberMetal.set(_this71.context, 'visible', true); + }); + assertStyle(''); + + this.runTask(function () { + _emberMetal.set(_this71.context, 'visible', false); + }); + assertStyle('display: none;'); + }; + + _class.prototype['@test isVisible does not overwrite component style'] = function testIsVisibleDoesNotOverwriteComponentStyle(assert) { + var _this72 = this; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['style'], + style: _emberGlimmerTestsUtilsHelpers.htmlSafe('color: blue;') + }), + + template: '

    foo

    ' + }); + + this.render('{{foo-bar id="foo-bar" isVisible=visible}}', { + visible: false + }); + + this.assertComponentElement(this.firstChild, { + tagName: 'div', + attrs: { id: 'foo-bar', style: _emberGlimmerTestsUtilsTestHelpers.styles('color: blue; display: none;') } + }); + + this.assertStableRerender(); + + this.runTask(function () { + _emberMetal.set(_this72.context, 'visible', true); + }); + + this.assertComponentElement(this.firstChild, { + tagName: 'div', + attrs: { id: 'foo-bar', style: _emberGlimmerTestsUtilsTestHelpers.styles('color: blue;') } + }); + + this.runTask(function () { + _emberMetal.set(_this72.context, 'visible', false); + }); + + this.assertComponentElement(this.firstChild, { + tagName: 'div', + attrs: { id: 'foo-bar', style: _emberGlimmerTestsUtilsTestHelpers.styles('color: blue; display: none;') } + }); + }; + + _class.prototype['@test adds isVisible binding when style binding is missing and other bindings exist'] = function testAddsIsVisibleBindingWhenStyleBindingIsMissingAndOtherBindingsExist(assert) { + var _this73 = this; + + var assertStyle = function (expected) { + var matcher = _emberGlimmerTestsUtilsTestHelpers.styles(expected); + var actual = _this73.firstChild.getAttribute('style'); + + assert.pushResult({ + result: matcher.match(actual), + message: matcher.message(), + actual: actual, + expected: expected + }); + }; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['foo'], + foo: 'bar' + }), + template: '

    foo

    ' + }); + + this.render('{{foo-bar id="foo-bar" foo=foo isVisible=visible}}', { + visible: false, + foo: 'baz' + }); + + assertStyle('display: none;'); + + this.assertStableRerender(); + + this.runTask(function () { + _emberMetal.set(_this73.context, 'visible', true); + }); + + assertStyle(''); + + this.runTask(function () { + _emberMetal.set(_this73.context, 'visible', false); + _emberMetal.set(_this73.context, 'foo', 'woo'); + }); + + assertStyle('display: none;'); + assert.equal(this.firstChild.getAttribute('foo'), 'woo'); + }; + + _class.prototype['@test it can use readDOMAttr to read input value'] = function testItCanUseReadDOMAttrToReadInputValue() { + var _this74 = this; + + var component = undefined; + var assertElement = function (expectedValue) { + // value is a property, not an attribute + _this74.assertHTML(''); + _this74.assert.equal(_this74.firstChild.value, expectedValue, 'value property is correct'); + _this74.assert.equal(_emberMetal.get(component, 'value'), expectedValue, 'component.get("value") is correct'); + }; + + this.registerComponent('one-way-input', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'input', + attributeBindings: ['value'], + + init: function () { + this._super.apply(this, arguments); + component = this; + }, + + change: function () { + var value = this.readDOMAttr('value'); + this.set('value', value); + } + }) + }); + + this.render('{{one-way-input value=value}}', { + value: 'foo' + }); + + assertElement('foo'); + + this.assertStableRerender(); + + this.runTask(function () { + _this74.firstChild.value = 'bar'; + _this74.$('input').trigger('change'); + }); + + assertElement('bar'); + + this.runTask(function () { + _this74.firstChild.value = 'foo'; + _this74.$('input').trigger('change'); + }); + + assertElement('foo'); + + this.runTask(function () { + _emberMetal.set(component, 'value', 'bar'); + }); + + assertElement('bar'); + + this.runTask(function () { + _this74.firstChild.value = 'foo'; + _this74.$('input').trigger('change'); + }); + + assertElement('foo'); + }; + + _class.prototype['@test child triggers revalidate during parent destruction (GH#13846)'] = function testChildTriggersRevalidateDuringParentDestructionGH13846() { + var select = undefined; + + this.registerComponent('x-select', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'select', + + init: function () { + this._super(); + this.options = _emberRuntime.A([]); + this.value = null; + + select = this; + }, + + updateValue: function () { + var newValue = this.get('options.lastObject.value'); + + this.set('value', newValue); + }, + + registerOption: function (option) { + this.get('options').addObject(option); + }, + + unregisterOption: function (option) { + this.get('options').removeObject(option); + + this.updateValue(); + } + }), + + template: '{{yield this}}' + }); + + this.registerComponent('x-option', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'option', + attributeBindings: ['selected'], + + didInsertElement: function () { + this._super.apply(this, arguments); + + this.get('select').registerOption(this); + }, + + selected: _emberMetal.computed('select.value', function () { + return this.get('value') === this.get('select.value'); + }), + + willDestroyElement: function () { + this._super.apply(this, arguments); + this.get('select').unregisterOption(this); + } + }) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject42)); + + this.teardown(); + + this.assert.ok(true, 'no errors during teardown'); + }; + + _class.prototype['@test setting a property in willDestroyElement does not assert (GH#14273)'] = function testSettingAPropertyInWillDestroyElementDoesNotAssertGH14273(assert) { + assert.expect(2); + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + this.showFoo = true; + }, + + willDestroyElement: function () { + this.set('showFoo', false); + assert.ok(true, 'willDestroyElement was fired'); + this._super.apply(this, arguments); + } + }), + + template: '{{#if showFoo}}things{{/if}}' + }); + + this.render('{{foo-bar}}'); + + this.assertText('things'); + }; + + _class.prototype['@test using didInitAttrs as an event is deprecated'] = function testUsingDidInitAttrsAsAnEventIsDeprecated(assert) { + var _this75 = this; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + foo: _emberMetal.on('didInitAttrs', function () { + assert.ok(true, 'should fire `didInitAttrs` event'); + }) + }) + }); + + expectDeprecation(function () { + _this75.render('{{foo-bar}}'); + }, /didInitAttrs called/); + }; + + // This test is a replication of the "component unit tests" scenario. When we deprecate + // and remove them, this test could be removed as well. This is not fully/intentionally + // supported, and it is unclear that this particular behavior is actually relied on. + // Since there is no real "invocation" here, it has other issues and inconsistencies, + // like there is no real "attrs" here, and there is no "update" pass. + + _class.prototype['@test did{Init,Receive}Attrs fires even if component is not rendered'] = function testDidInitReceiveAttrsFiresEvenIfComponentIsNotRendered(assert) { + var _this76 = this; + + expectDeprecation(/didInitAttrs called/); + + var didInitAttrsCount = 0; + var didReceiveAttrsCount = 0; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + this.didInit = true; + }, + + didInitAttrs: function () { + assert.ok(this.didInit, 'expected init to have run before didInitAttrs'); + didInitAttrsCount++; + }, + + didReceiveAttrs: function () { + assert.ok(this.didInit, 'expected init to have run before didReceiveAttrs'); + didReceiveAttrsCount++; + }, + + willRender: function () { + throw new Error('Unexpected render!'); + } + }) + }); + + assert.strictEqual(didInitAttrsCount, 0, 'precond: didInitAttrs is not fired'); + assert.strictEqual(didReceiveAttrsCount, 0, 'precond: didReceiveAttrs is not fired'); + + this.runTask(function () { + return _this76.component = _this76.owner.lookup('component:foo-bar'); + }); + + assert.strictEqual(didInitAttrsCount, 1, 'precond: didInitAttrs is fired'); + assert.strictEqual(didReceiveAttrsCount, 1, 'precond: didReceiveAttrs is fired'); + }; + + _class.prototype['@test did{Init,Receive}Attrs fires after .init() but before observers become active'] = function testDidInitReceiveAttrsFiresAfterInitButBeforeObserversBecomeActive(assert) { + var _this77 = this; + + expectDeprecation(/didInitAttrs called/); + + var fooCopyDidChangeCount = 0; + var barCopyDidChangeCount = 0; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + this.didInit = true; + }, + + didInitAttrs: function (_ref2) { + var attrs = _ref2.attrs; + + assert.ok(this.didInit, 'expected init to have run before didInitAttrs'); + this.set('fooCopy', attrs.foo.value + 1); + }, + + didReceiveAttrs: function (_ref3) { + var newAttrs = _ref3.newAttrs; + + assert.ok(this.didInit, 'expected init to have run before didReceiveAttrs'); + this.set('barCopy', newAttrs.bar.value + 1); + }, + + fooCopyDidChange: _emberMetal.observer('fooCopy', function () { + fooCopyDidChangeCount++; + }), + barCopyDidChange: _emberMetal.observer('barCopy', function () { + barCopyDidChangeCount++; + }) + }), + + template: '{{foo}}-{{fooCopy}}-{{bar}}-{{barCopy}}' + }); + + this.render('{{foo-bar foo=foo bar=bar}}', { foo: 1, bar: 3 }); + + this.assertText('1-2-3-4'); + + assert.strictEqual(fooCopyDidChangeCount, 0, 'expected NO observer firing for: fooCopy'); + assert.strictEqual(barCopyDidChangeCount, 0, 'expected NO observer firing for: barCopy'); + + this.runTask(function () { + return _emberMetal.set(_this77.context, 'foo', 5); + }); + + this.assertText('5-2-3-4'); + + assert.strictEqual(fooCopyDidChangeCount, 0, 'expected observer firing for: fooCopy'); + assert.strictEqual(barCopyDidChangeCount, 0, 'expected NO observer firing for: barCopy'); + + this.runTask(function () { + return _emberMetal.set(_this77.context, 'bar', 7); + }); + + this.assertText('5-2-7-8'); + + assert.strictEqual(fooCopyDidChangeCount, 0, 'expected observer firing for: fooCopy'); + assert.strictEqual(barCopyDidChangeCount, 1, 'expected observer firing for: barCopy'); + }; + + _class.prototype['@test returning `true` from an action does not bubble if `target` is not specified (GH#14275)'] = function testReturningTrueFromAnActionDoesNotBubbleIfTargetIsNotSpecifiedGH14275(assert) { + var _this78 = this; + + this.registerComponent('display-toggle', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + show: function () { + assert.ok(true, 'display-toggle show action was called'); + return true; + } + } + }), + + template: '' + }); + + this.render('{{display-toggle}}', { + send: function () { + assert.notOk(true, 'send should not be called when action is not "subscribed" to'); + } + }); + + this.assertText('Show'); + + this.runTask(function () { + return _this78.$('button').click(); + }); + }; + + _class.prototype['@test returning `true` from an action bubbles to the `target` if specified'] = function testReturningTrueFromAnActionBubblesToTheTargetIfSpecified(assert) { + var _this79 = this; + + assert.expect(4); + + this.registerComponent('display-toggle', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + show: function () { + assert.ok(true, 'display-toggle show action was called'); + return true; + } + } + }), + + template: '' + }); + + this.render('{{display-toggle target=this}}', { + send: function (actionName) { + assert.ok(true, 'send should be called when action is "subscribed" to'); + assert.equal(actionName, 'show'); + } + }); + + this.assertText('Show'); + + this.runTask(function () { + return _this79.$('button').click(); + }); + }; + + _class.prototype['@test component yielding in an {{#each}} has correct block values after rerendering (GH#14284)'] = function testComponentYieldingInAnEachHasCorrectBlockValuesAfterRerenderingGH14284() { + var _this80 = this; + + this.registerComponent('list-items', { + template: '{{#each items as |item|}}{{yield item}}{{/each}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject43), { + editMode: false, + items: ['foo', 'bar', 'qux', 'baz'] + }); + + this.assertText('|foo||bar||qux||baz|'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this80.context, 'editMode', true); + }); + + this.assertText('|foo|Remove foo|bar|Remove bar|qux|Remove qux|baz|Remove baz'); + + this.runTask(function () { + return _emberMetal.set(_this80.context, 'editMode', false); + }); + + this.assertText('|foo||bar||qux||baz|'); + }; + + _class.prototype['@test unimplimented positionalParams do not cause an error GH#14416'] = function testUnimplimentedPositionalParamsDoNotCauseAnErrorGH14416(assert) { + this.registerComponent('foo-bar', { + template: 'hello' + }); + + this.render('{{foo-bar wat}}'); + this.assertText('hello'); + }; + + _class.prototype['@test using attrs for positional params'] = function testUsingAttrsForPositionalParams(assert) { + var MyComponent = _emberGlimmerTestsUtilsHelpers.Component.extend(); + + this.registerComponent('foo-bar', { + ComponentClass: MyComponent.reopenClass({ + positionalParams: ['myVar'] + }), + template: 'MyVar1: {{attrs.myVar}} {{myVar}} MyVar2: {{myVar2}} {{attrs.myVar2}}' + }); + + this.render('{{foo-bar 1 myVar2=2}}'); + + this.assertText('MyVar1: 1 1 MyVar2: 2 2'); + }; + + _class.prototype['@test can use `{{this}}` to emit the component\'s toString value [GH#14581]'] = function testCanUseThisToEmitTheComponentSToStringValueGH14581(assert) { + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + toString: function () { + return 'special sauce goes here!'; + } + }), + template: '{{this}}' + }); + + this.render('{{foo-bar}}'); + + this.assertText('special sauce goes here!'); + }; + + _class.prototype['@test can use `{{this` to access paths on current context [GH#14581]'] = function testCanUseThisToAccessPathsOnCurrentContextGH14581(assert) { + var instance = undefined; + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + + instance = this; + }, + + foo: { + bar: { + baz: 'huzzah!' + } + } + }), + template: '{{this.foo.bar.baz}}' + }); + + this.render('{{foo-bar}}'); + + this.assertText('huzzah!'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(instance, 'foo.bar.baz', 'yippie!'); + }); + + this.assertText('yippie!'); + + this.runTask(function () { + return _emberMetal.set(instance, 'foo.bar.baz', 'huzzah!'); + }); + + this.assertText('huzzah!'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/components/curly-components-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/curly-components-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/curly-components-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/curly-components-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/curly-components-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/curly-components-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/dynamic-components-test', ['exports', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case'], function (exports, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if cond1}}\n {{#component "foo-bar" id=1}}\n {{#if cond2}}\n {{#component "foo-bar" id=2}}{{/component}}\n {{#if cond3}}\n {{#component "foo-bar" id=3}}\n {{#if cond4}}\n {{#component "foo-bar" id=4}}\n {{#if cond5}}\n {{#component "foo-bar" id=5}}{{/component}}\n {{#component "foo-bar" id=6}}{{/component}}\n {{#component "foo-bar" id=7}}{{/component}}\n {{/if}}\n {{#component "foo-bar" id=8}}{{/component}}\n {{/component}}\n {{/if}}\n {{/component}}\n {{/if}}\n {{/if}}\n {{/component}}\n {{/if}}'], ['\n {{#if cond1}}\n {{#component "foo-bar" id=1}}\n {{#if cond2}}\n {{#component "foo-bar" id=2}}{{/component}}\n {{#if cond3}}\n {{#component "foo-bar" id=3}}\n {{#if cond4}}\n {{#component "foo-bar" id=4}}\n {{#if cond5}}\n {{#component "foo-bar" id=5}}{{/component}}\n {{#component "foo-bar" id=6}}{{/component}}\n {{#component "foo-bar" id=7}}{{/component}}\n {{/if}}\n {{#component "foo-bar" id=8}}{{/component}}\n {{/component}}\n {{/if}}\n {{/component}}\n {{/if}}\n {{/if}}\n {{/component}}\n {{/if}}']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each names as |name|}}\n {{name}}\n {{/each}}'], ['\n {{#each names as |name|}}\n {{name}}\n {{/each}}']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each n as |name|}}\n {{name}}\n {{/each}}'], ['\n {{#each n as |name|}}\n {{name}}\n {{/each}}']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: dynamic components', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test it can render a basic component with a static component name argument'] = function testItCanRenderABasicComponentWithAStaticComponentNameArgument() { + var _this = this; + + this.registerComponent('foo-bar', { template: 'hello {{name}}' }); + + this.render('{{component "foo-bar" name=name}}', { name: 'Sarah' }); + + this.assertComponentElement(this.firstChild, { content: 'hello Sarah' }); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Sarah' }); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'name', 'Gavin'); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Gavin' }); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'name', 'Sarah'); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Sarah' }); + }; + + _class.prototype['@test it can render a basic component with a dynamic component name argument'] = function testItCanRenderABasicComponentWithADynamicComponentNameArgument() { + var _this2 = this; + + this.registerComponent('foo-bar', { template: 'hello {{name}} from foo-bar' }); + this.registerComponent('foo-bar-baz', { template: 'hello {{name}} from foo-bar-baz' }); + + this.render('{{component componentName name=name}}', { componentName: 'foo-bar', name: 'Alex' }); + + this.assertComponentElement(this.firstChild, { content: 'hello Alex from foo-bar' }); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Alex from foo-bar' }); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'name', 'Ben'); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Ben from foo-bar' }); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'componentName', 'foo-bar-baz'); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Ben from foo-bar-baz' }); + + this.runTask(function () { + _emberMetal.set(_this2.context, 'componentName', 'foo-bar'); + _emberMetal.set(_this2.context, 'name', 'Alex'); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Alex from foo-bar' }); + }; + + _class.prototype['@test it has an element'] = function testItHasAnElement() { + var _this3 = this; + + var instance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + instance = this; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{component "foo-bar"}}'); + + var element1 = instance.element; + + this.assertComponentElement(element1, { content: 'hello' }); + + this.runTask(function () { + return _this3.rerender(); + }); + + var element2 = instance.element; + + this.assertComponentElement(element2, { content: 'hello' }); + + this.assertSameNode(element2, element1); + }; + + _class.prototype['@test it has a jQuery proxy to the element'] = function testItHasAJQueryProxyToTheElement(assert) { + var _this4 = this; + + var instance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + instance = this; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{component "foo-bar"}}'); + + var element1 = instance.$()[0]; + + this.assertComponentElement(element1, { content: 'hello' }); + + this.runTask(function () { + return _this4.rerender(); + }); + + var element2 = instance.$()[0]; + + this.assertComponentElement(element2, { content: 'hello' }); + + this.assertSameNode(element2, element1); + }; + + _class.prototype['@test it scopes the jQuery proxy to the component element'] = function testItScopesTheJQueryProxyToTheComponentElement(assert) { + var _this5 = this; + + var instance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + instance = this; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'inner' }); + + this.render('outer{{component "foo-bar"}}'); + + var $span = instance.$('span'); + + assert.equal($span.length, 1); + assert.equal($span.attr('class'), 'inner'); + + this.runTask(function () { + return _this5.rerender(); + }); + + $span = instance.$('span'); + + assert.equal($span.length, 1); + assert.equal($span.attr('class'), 'inner'); + }; + + _class.prototype['@test it has the right parentView and childViews'] = function testItHasTheRightParentViewAndChildViews(assert) { + var _this6 = this; + + var fooBarInstance = undefined, + fooBarBazInstance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + fooBarInstance = this; + } + }); + + var FooBarBazComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + fooBarBazInstance = this; + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'foo-bar {{foo-bar-baz}}' }); + this.registerComponent('foo-bar-baz', { ComponentClass: FooBarBazComponent, template: 'foo-bar-baz' }); + + this.render('{{component "foo-bar"}}'); + this.assertText('foo-bar foo-bar-baz'); + + assert.equal(fooBarInstance.parentView, this.component); + assert.equal(fooBarBazInstance.parentView, fooBarInstance); + + assert.deepEqual(this.component.childViews, [fooBarInstance]); + assert.deepEqual(fooBarInstance.childViews, [fooBarBazInstance]); + + this.runTask(function () { + return _this6.rerender(); + }); + this.assertText('foo-bar foo-bar-baz'); + + assert.equal(fooBarInstance.parentView, this.component); + assert.equal(fooBarBazInstance.parentView, fooBarInstance); + + assert.deepEqual(this.component.childViews, [fooBarInstance]); + assert.deepEqual(fooBarInstance.childViews, [fooBarBazInstance]); + }; + + _class.prototype['@test it can render a basic component with a block'] = function testItCanRenderABasicComponentWithABlock() { + var _this7 = this; + + this.registerComponent('foo-bar', { template: '{{yield}}' }); + + this.render('{{#component "foo-bar"}}hello{{/component}}'); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + }; + + _class.prototype['@test it renders the layout with the component instance as the context'] = function testItRendersTheLayoutWithTheComponentInstanceAsTheContext() { + var _this8 = this; + + var instance = undefined; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + instance = this; + this.set('message', 'hello'); + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '{{message}}' }); + + this.render('{{component "foo-bar"}}'); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + + this.runTask(function () { + return _this8.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(instance, 'message', 'goodbye'); + }); + + this.assertComponentElement(this.firstChild, { content: 'goodbye' }); + + this.runTask(function () { + return _emberMetal.set(instance, 'message', 'hello'); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + }; + + _class.prototype['@test it preserves the outer context when yielding'] = function testItPreservesTheOuterContextWhenYielding() { + var _this9 = this; + + this.registerComponent('foo-bar', { template: '{{yield}}' }); + + this.render('{{#component "foo-bar"}}{{message}}{{/component}}', { message: 'hello' }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'message', 'goodbye'); + }); + + this.assertComponentElement(this.firstChild, { content: 'goodbye' }); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'message', 'hello'); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + }; + + _class.prototype['@test the component and its child components are destroyed'] = function testTheComponentAndItsChildComponentsAreDestroyed(assert) { + var _this10 = this; + + var destroyed = { 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0 }; + + this.registerComponent('foo-bar', { + template: '{{id}} {{yield}}', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + willDestroy: function () { + this._super(); + destroyed[this.get('id')]++; + } + }) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { + cond1: true, + cond2: true, + cond3: true, + cond4: true, + cond5: true + }); + + this.assertText('1 2 3 4 5 6 7 8 '); + + this.runTask(function () { + return _this10.rerender(); + }); + + assert.deepEqual(destroyed, { 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0 }); + + this.runTask(function () { + return _emberMetal.set(_this10.context, 'cond5', false); + }); + + this.assertText('1 2 3 4 8 '); + + assert.deepEqual(destroyed, { 1: 0, 2: 0, 3: 0, 4: 0, 5: 1, 6: 1, 7: 1, 8: 0 }); + + this.runTask(function () { + _emberMetal.set(_this10.context, 'cond3', false); + _emberMetal.set(_this10.context, 'cond5', true); + _emberMetal.set(_this10.context, 'cond4', false); + }); + + assert.deepEqual(destroyed, { 1: 0, 2: 0, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1 }); + + this.runTask(function () { + _emberMetal.set(_this10.context, 'cond2', false); + _emberMetal.set(_this10.context, 'cond1', false); + }); + + assert.deepEqual(destroyed, { 1: 1, 2: 1, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1 }); + }; + + _class.prototype['@test component helper destroys underlying component when it is swapped out'] = function testComponentHelperDestroysUnderlyingComponentWhenItIsSwappedOut(assert) { + var _this11 = this; + + var destroyed = { 'foo-bar': 0, 'foo-bar-baz': 0 }; + var testContext = this; + + this.registerComponent('foo-bar', { + template: 'hello from foo-bar', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + willDestroyElement: function () { + assert.equal(testContext.$('#' + this.elementId).length, 1, 'element is still attached to the document'); + }, + + willDestroy: function () { + this._super(); + destroyed['foo-bar']++; + } + }) + }); + + this.registerComponent('foo-bar-baz', { + template: 'hello from foo-bar-baz', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + willDestroy: function () { + this._super(); + destroyed['foo-bar-baz']++; + } + }) + }); + + this.render('{{component componentName name=name}}', { componentName: 'foo-bar' }); + + assert.deepEqual(destroyed, { 'foo-bar': 0, 'foo-bar-baz': 0 }); + + this.runTask(function () { + return _this11.rerender(); + }); + + assert.deepEqual(destroyed, { 'foo-bar': 0, 'foo-bar-baz': 0 }); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'componentName', 'foo-bar-baz'); + }); + + assert.deepEqual(destroyed, { 'foo-bar': 1, 'foo-bar-baz': 0 }); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'componentName', 'foo-bar'); + }); + + assert.deepEqual(destroyed, { 'foo-bar': 1, 'foo-bar-baz': 1 }); + }; + + _class.prototype['@test component helper with bound properties are updating correctly in init of component'] = function testComponentHelperWithBoundPropertiesAreUpdatingCorrectlyInInitOfComponent(assert) { + var _this12 = this; + + this.registerComponent('foo-bar', { + template: 'foo-bar {{location}} {{locationCopy}} {{yield}}', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + this.set('locationCopy', this.get('location')); + } + }) + }); + + this.registerComponent('foo-bar-baz', { + template: 'foo-bar-baz {{location}} {{locationCopy}} {{yield}}', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + this.set('locationCopy', this.get('location')); + } + }) + }); + + this.registerComponent('outer-component', { + template: '{{#component componentName location=location}}arepas!{{/component}}', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + componentName: _emberMetal.computed('location', function () { + if (this.get('location') === 'Caracas') { + return 'foo-bar'; + } else { + return 'foo-bar-baz'; + } + }) + }) + }); + + this.render('{{outer-component location=location}}', { location: 'Caracas' }); + + this.assertText('foo-bar Caracas Caracas arepas!'); + + this.runTask(function () { + return _this12.rerender(); + }); + + this.assertText('foo-bar Caracas Caracas arepas!'); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'location', 'Loisaida'); + }); + + this.assertText('foo-bar-baz Loisaida Loisaida arepas!'); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'location', 'Caracas'); + }); + + this.assertText('foo-bar Caracas Caracas arepas!'); + }; + + _class.prototype['@test component helper with actions'] = function testComponentHelperWithActions(assert) { + var _this14 = this; + + this.registerComponent('inner-component', { + template: 'inner-component {{yield}}', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNames: 'inner-component', + didInsertElement: function () { + var _this13 = this; + + // trigger action on click in absence of app's EventDispatcher + this.$().on('click', function () { + _this13.sendAction('somethingClicked'); + }); + }, + willDestroyElement: function () { + this.$().off('click'); + } + }) + }); + + var actionTriggered = 0; + this.registerComponent('outer-component', { + template: '{{#component componentName somethingClicked="mappedAction"}}arepas!{{/component}}', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + classNames: 'outer-component', + componentName: 'inner-component', + actions: { + mappedAction: function () { + actionTriggered++; + } + } + }) + }); + + this.render('{{outer-component}}'); + + assert.equal(actionTriggered, 0, 'action was not triggered'); + + this.runTask(function () { + _this14.$('.inner-component').trigger('click'); + }); + + assert.equal(actionTriggered, 1, 'action was triggered'); + }; + + _class.prototype['@test nested component helpers'] = function testNestedComponentHelpers(assert) { + var _this15 = this; + + this.registerComponent('foo-bar', { template: 'yippie! {{attrs.location}} {{yield}}' }); + this.registerComponent('baz-qux', { template: 'yummy {{attrs.location}} {{yield}}' }); + this.registerComponent('corge-grault', { template: 'delicious {{attrs.location}} {{yield}}' }); + + this.render('{{#component componentName1 location=location}}{{#component componentName2 location=location}}arepas!{{/component}}{{/component}}', { + componentName1: 'foo-bar', + componentName2: 'baz-qux', + location: 'Caracas' + }); + + this.assertText('yippie! Caracas yummy Caracas arepas!'); + + this.runTask(function () { + return _this15.rerender(); + }); + + this.assertText('yippie! Caracas yummy Caracas arepas!'); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'location', 'Loisaida'); + }); + + this.assertText('yippie! Loisaida yummy Loisaida arepas!'); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'componentName1', 'corge-grault'); + }); + + this.assertText('delicious Loisaida yummy Loisaida arepas!'); + + this.runTask(function () { + _emberMetal.set(_this15.context, 'componentName1', 'foo-bar'); + _emberMetal.set(_this15.context, 'location', 'Caracas'); + }); + + this.assertText('yippie! Caracas yummy Caracas arepas!'); + }; + + _class.prototype['@test component with dynamic name argument resolving to non-existent component'] = function testComponentWithDynamicNameArgumentResolvingToNonExistentComponent(assert) { + var _this16 = this; + + expectAssertion(function () { + _this16.render('{{component componentName}}', { componentName: 'does-not-exist' }); + }, /Could not find component named "does-not-exist"/); + }; + + _class.prototype['@test component with static name argument for non-existent component'] = function testComponentWithStaticNameArgumentForNonExistentComponent(assert) { + var _this17 = this; + + expectAssertion(function () { + _this17.render('{{component "does-not-exist"}}'); + }, /Could not find component named "does-not-exist"/); + }; + + _class.prototype['@test component with dynamic component name resolving to a component, then non-existent component'] = function testComponentWithDynamicComponentNameResolvingToAComponentThenNonExistentComponent(assert) { + var _this18 = this; + + this.registerComponent('foo-bar', { template: 'hello {{name}}' }); + + this.render('{{component componentName name=name}}', { componentName: 'foo-bar', name: 'Alex' }); + + this.assertText('hello Alex'); + + this.runTask(function () { + return _this18.rerender(); + }); + + this.assertText('hello Alex'); + + this.runTask(function () { + return _emberMetal.set(_this18.context, 'componentName', undefined); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this18.context, 'componentName', 'foo-bar'); + }); + + this.assertText('hello Alex'); + }; + + _class.prototype['@test component helper properly invalidates hash params inside an {{each}} invocation #11044'] = function testComponentHelperProperlyInvalidatesHashParamsInsideAnEachInvocation11044(assert) { + var _this19 = this; + + this.registerComponent('foo-bar', { + template: '[{{internalName}} - {{name}}]', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + willRender: function () { + // store internally available name to ensure that the name available in `this.attrs.name` + // matches the template lookup name + _emberMetal.set(this, 'internalName', this.get('name')); + } + }) + }); + + this.render('{{#each items as |item|}}{{component "foo-bar" name=item.name}}{{/each}}', { + items: [{ name: 'Robert' }, { name: 'Jacquie' }] + }); + + this.assertText('[Robert - Robert][Jacquie - Jacquie]'); + + this.runTask(function () { + return _this19.rerender(); + }); + + this.assertText('[Robert - Robert][Jacquie - Jacquie]'); + + this.runTask(function () { + return _emberMetal.set(_this19.context, 'items', [{ name: 'Max' }, { name: 'James' }]); + }); + + this.assertText('[Max - Max][James - James]'); + + this.runTask(function () { + return _emberMetal.set(_this19.context, 'items', [{ name: 'Robert' }, { name: 'Jacquie' }]); + }); + + this.assertText('[Robert - Robert][Jacquie - Jacquie]'); + }; + + _class.prototype['@test dashless components should not be found'] = function testDashlessComponentsShouldNotBeFound(assert) { + var _this20 = this; + + this.registerComponent('dashless2', { template: 'Do not render me!' }); + + expectAssertion(function () { + _this20.render('{{component "dashless"}}'); + }, /You cannot use 'dashless' as a component name. Component names must contain a hyphen./); + }; + + _class.prototype['@test positional parameters does not clash when rendering different components'] = function testPositionalParametersDoesNotClashWhenRenderingDifferentComponents(assert) { + var _this21 = this; + + this.registerComponent('foo-bar', { + template: 'hello {{name}} ({{age}}) from foo-bar', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['name', 'age'] + }) + }); + + this.registerComponent('foo-bar-baz', { + template: 'hello {{name}} ({{age}}) from foo-bar-baz', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['name', 'age'] + }) + }); + + this.render('{{component componentName name age}}', { + componentName: 'foo-bar', + name: 'Alex', + age: 29 + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Alex (29) from foo-bar' }); + + this.runTask(function () { + return _this21.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Alex (29) from foo-bar' }); + + this.runTask(function () { + return _emberMetal.set(_this21.context, 'name', 'Ben'); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Ben (29) from foo-bar' }); + + this.runTask(function () { + return _emberMetal.set(_this21.context, 'age', 22); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Ben (22) from foo-bar' }); + + this.runTask(function () { + return _emberMetal.set(_this21.context, 'componentName', 'foo-bar-baz'); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Ben (22) from foo-bar-baz' }); + + this.runTask(function () { + _emberMetal.set(_this21.context, 'componentName', 'foo-bar'); + _emberMetal.set(_this21.context, 'name', 'Alex'); + _emberMetal.set(_this21.context, 'age', 29); + }); + + this.assertComponentElement(this.firstChild, { content: 'hello Alex (29) from foo-bar' }); + }; + + _class.prototype['@test positional parameters does not pollute the attributes when changing components'] = function testPositionalParametersDoesNotPolluteTheAttributesWhenChangingComponents(assert) { + var _this22 = this; + + this.registerComponent('normal-message', { + template: 'Normal: {{something}}!', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: ['something'] + }) + }); + + this.registerComponent('alternative-message', { + template: 'Alternative: {{something}} {{somethingElse}}!', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + something: 'Another' + }).reopenClass({ + positionalParams: ['somethingElse'] + }) + }); + + this.render('{{component componentName message}}', { componentName: 'normal-message', message: 'Hello' }); + + this.assertComponentElement(this.firstChild, { content: 'Normal: Hello!' }); + + this.runTask(function () { + return _this22.rerender(); + }); + + this.assertComponentElement(this.firstChild, { content: 'Normal: Hello!' }); + + this.runTask(function () { + return _emberMetal.set(_this22.context, 'componentName', 'alternative-message'); + }); + + this.assertComponentElement(this.firstChild, { content: 'Alternative: Another Hello!' }); + + this.runTask(function () { + return _emberMetal.set(_this22.context, 'message', 'Hi'); + }); + + this.assertComponentElement(this.firstChild, { content: 'Alternative: Another Hi!' }); + + this.runTask(function () { + _emberMetal.set(_this22.context, 'componentName', 'normal-message'); + _emberMetal.set(_this22.context, 'message', 'Hello'); + }); + + this.assertComponentElement(this.firstChild, { content: 'Normal: Hello!' }); + }; + + _class.prototype['@test static arbitrary number of positional parameters'] = function testStaticArbitraryNumberOfPositionalParameters(assert) { + var _this23 = this; + + this.registerComponent('sample-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'names' + }), + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2) + }); + + this.render('{{component "sample-component" "Foo" 4 "Bar" 5 "Baz" elementId="helper"}}'); + + this.assertText('Foo4Bar5Baz'); + + this.runTask(function () { + return _this23.rerender(); + }); + + this.assertText('Foo4Bar5Baz'); + }; + + _class.prototype['@test dynamic arbitrary number of positional parameters'] = function testDynamicArbitraryNumberOfPositionalParameters(assert) { + var _this24 = this; + + this.registerComponent('sample-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'n' + }), + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3) + }); + + this.render('{{component "sample-component" user1 user2}}', { + user1: 'Foo', + user2: 4 + }); + + this.assertText('Foo4'); + + this.runTask(function () { + return _this24.rerender(); + }); + + this.assertText('Foo4'); + + this.runTask(function () { + return _this24.context.set('user1', 'Bar'); + }); + + this.assertText('Bar4'); + + this.runTask(function () { + return _this24.context.set('user2', '5'); + }); + + this.assertText('Bar5'); + + this.runTask(function () { + _this24.context.set('user1', 'Foo'); + _this24.context.set('user2', 4); + }); + + this.assertText('Foo4'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/components/dynamic-components-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/dynamic-components-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/dynamic-components-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/dynamic-components-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/dynamic-components-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/dynamic-components-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/fragment-components-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['
    Hey
    bar'], ['
    Hey
    bar']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['bar'], ['bar']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['bizz'], ['bizz']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: fragment components', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype.getCustomDispatcherEvents = function getCustomDispatcherEvents() { + return { + hitDem: 'folks' + }; + }; + + _class.prototype['@test fragments do not render an outer tag'] = function testFragmentsDoNotRenderAnOuterTag() { + var instance = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '', + init: function () { + this._super(); + instance = this; + this.foo = true; + this.bar = 'bar'; + } + }); + + var template = '{{#if foo}}
    Hey
    {{/if}}{{yield bar}}'; + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: template }); + + this.render('{{#foo-bar as |bar|}}{{bar}}{{/foo-bar}}'); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject)); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(instance, 'foo', false); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + + this.runTask(function () { + return _emberMetal.set(instance, 'bar', 'bizz'); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3)); + + this.runTask(function () { + _emberMetal.set(instance, 'bar', 'bar'); + _emberMetal.set(instance, 'foo', true); + }); + }; + + _class.prototype['@test throws an error if an event function is defined in a tagless component'] = function testThrowsAnErrorIfAnEventFunctionIsDefinedInATaglessComponent() { + var _this = this; + + var instance = undefined; + var template = 'hit dem folks'; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '', + init: function () { + this._super(); + instance = this; + }, + click: function () {} + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: template }); + + expectAssertion(function () { + _this.render('{{#foo-bar}}{{/foo-bar}}'); + }, /You can not define a function that handles DOM events in the .* tagless component since it doesn't have any DOM element./); + }; + + _class.prototype['@test throws an error if a custom defined event function is defined in a tagless component'] = function testThrowsAnErrorIfACustomDefinedEventFunctionIsDefinedInATaglessComponent() { + var _this2 = this; + + var instance = undefined; + var template = 'hit dem folks'; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '', + init: function () { + this._super(); + instance = this; + }, + folks: function () {} + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: template }); + + expectAssertion(function () { + _this2.render('{{#foo-bar}}{{/foo-bar}}'); + }, /You can not define a function that handles DOM events in the .* tagless component since it doesn't have any DOM element./); + }; + + _class.prototype['@test throws an error if `tagName` is an empty string and `classNameBindings` are specified'] = function testThrowsAnErrorIfTagNameIsAnEmptyStringAndClassNameBindingsAreSpecified() { + var _this3 = this; + + var instance = undefined; + var template = 'hit dem folks'; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '', + init: function () { + this._super(); + instance = this; + }, + foo: true, + classNameBindings: ['foo:is-foo:is-bar'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: template }); + + expectAssertion(function () { + _this3.render('{{#foo-bar}}{{/foo-bar}}'); + }, /You cannot use `classNameBindings` on a tag-less component/); + }; + + _class.prototype['@test throws an error if `tagName` is an empty string and `attributeBindings` are specified'] = function testThrowsAnErrorIfTagNameIsAnEmptyStringAndAttributeBindingsAreSpecified() { + var _this4 = this; + + var template = 'hit dem folks'; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '', + attributeBindings: ['href'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: template }); + expectAssertion(function () { + _this4.render('{{#foo-bar}}{{/foo-bar}}'); + }, /You cannot use `attributeBindings` on a tag-less component/); + }; + + _class.prototype['@test throws an error if `tagName` is an empty string and `elementId` is specified via JS'] = function testThrowsAnErrorIfTagNameIsAnEmptyStringAndElementIdIsSpecifiedViaJS() { + var _this5 = this; + + var template = 'hit dem folks'; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '', + elementId: 'turntUp' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: template }); + expectAssertion(function () { + _this5.render('{{#foo-bar}}{{/foo-bar}}'); + }, /You cannot use `elementId` on a tag-less component/); + }; + + _class.prototype['@test throws an error if `tagName` is an empty string and `elementId` is specified via template'] = function testThrowsAnErrorIfTagNameIsAnEmptyStringAndElementIdIsSpecifiedViaTemplate() { + var _this6 = this; + + var template = 'hit dem folks'; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: template }); + expectAssertion(function () { + _this6.render('{{#foo-bar elementId=\'turntUp\'}}{{/foo-bar}}'); + }, /You cannot use `elementId` on a tag-less component/); + }; + + _class.prototype['@test does not throw an error if `tagName` is an empty string and `id` is specified via JS'] = function testDoesNotThrowAnErrorIfTagNameIsAnEmptyStringAndIdIsSpecifiedViaJS() { + var template = '{{id}}'; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '', + id: 'baz' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: template }); + this.render('{{#foo-bar}}{{/foo-bar}}'); + this.assertText('baz'); + }; + + _class.prototype['@test does not throw an error if `tagName` is an empty string and `id` is specified via template'] = function testDoesNotThrowAnErrorIfTagNameIsAnEmptyStringAndIdIsSpecifiedViaTemplate() { + var template = '{{id}}'; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: template }); + this.render('{{#foo-bar id=\'baz\'}}{{/foo-bar}}'); + this.assertText('baz'); + }; + + _class.prototype['@test does not throw an error if `tagName` is an empty string and `id` is bound property specified via template'] = function testDoesNotThrowAnErrorIfTagNameIsAnEmptyStringAndIdIsBoundPropertySpecifiedViaTemplate() { + var _this7 = this; + + var template = '{{id}}'; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: template }); + + this.render('{{#foo-bar id=fooBarId}}{{/foo-bar}}', { fooBarId: 'baz' }); + + this.assertText('baz'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'fooBarId', 'qux'); + }); + + this.assertText('qux'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'fooBarId', 'baz'); + }); + + this.assertText('baz'); + }; + + _class.prototype['@test does not throw an error if `tagName` is an empty string and `id` is specified via template and passed to child component'] = function testDoesNotThrowAnErrorIfTagNameIsAnEmptyStringAndIdIsSpecifiedViaTemplateAndPassedToChildComponent() { + var fooBarTemplate = '{{#baz-child id=id}}{{/baz-child}}'; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '' + }); + var BazChildComponent = _emberGlimmerTestsUtilsHelpers.Component.extend(); + var bazChildTemplate = '{{id}}'; + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: fooBarTemplate }); + this.registerComponent('baz-child', { ComponentClass: BazChildComponent, template: bazChildTemplate }); + this.render('{{#foo-bar id=\'baz\'}}{{/foo-bar}}'); + this.assertText('baz'); + }; + + _class.prototype['@test throws an error if when $() is accessed on component where `tagName` is an empty string'] = function testThrowsAnErrorIfWhen$IsAccessedOnComponentWhereTagNameIsAnEmptyString() { + var _this8 = this; + + var template = 'hit dem folks'; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '', + init: function () { + this._super(); + this.$(); + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: template }); + + expectAssertion(function () { + _this8.render('{{#foo-bar}}{{/foo-bar}}'); + }, /You cannot access this.\$\(\) on a component with `tagName: \'\'` specified/); + }; + + _class.prototype['@test renders a contained view with omitted start tag and tagless parent view context'] = function testRendersAContainedViewWithOmittedStartTagAndTaglessParentViewContext() { + var _this9 = this; + + this.registerComponent('root-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'section' + }), + template: '{{frag-ment}}' + }); + + this.registerComponent('frag-ment', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '' + }), + template: '{{my-span}}' + }); + + this.registerComponent('my-span', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'span' + }), + template: 'dab' + }); + + this.render('{{root-component}}'); + + this.assertElement(this.firstChild, { tagName: 'section' }); + this.assertElement(this.firstChild.firstElementChild, { tagName: 'span' }); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'section' }); + this.assertElement(this.firstChild.firstElementChild, { tagName: 'span' }); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/components/fragment-components-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/fragment-components-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/fragment-components-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/fragment-components-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/fragment-components-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/fragment-components-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/instrumentation-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components instrumentation', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + var _this = this; + + _RenderingTest.call(this); + + this.resetEvents(); + + _emberMetal.instrumentationSubscribe('render.component', { + before: function (name, timestamp, payload) { + if (payload.view !== _this.component) { + _this.actual.before.push(payload); + } + }, + after: function (name, timestamp, payload) { + if (payload.view !== _this.component) { + _this.actual.after.push(payload); + } + } + }); + } + + _class.prototype.resetEvents = function resetEvents() { + this.expected = { + before: [], + after: [] + }; + + this.actual = { + before: [], + after: [] + }; + }; + + _class.prototype.teardown = function teardown() { + this.assert.deepEqual(this.actual.before, [], 'No unexpected events (before)'); + this.assert.deepEqual(this.actual.after, [], 'No unexpected events (after)'); + _RenderingTest.prototype.teardown.call(this); + _emberMetal.instrumentationReset(); + }; + + _class.prototype['@test zomg'] = function testZomg(assert) { + assert.ok(true); + }; + + _class.prototype['@test it should receive an instrumentation event for both initial render and updates'] = function testItShouldReceiveAnInstrumentationEventForBothInitialRenderAndUpdates(assert) { + var _this2 = this; + + var testCase = this; + + var BaseClass = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '', + + willRender: function () { + testCase.expected.before.push(this); + testCase.expected.after.unshift(this); + } + }); + + this.registerComponent('x-bar', { + template: '[x-bar: {{bar}}] {{yield}}', + ComponentClass: BaseClass.extend() + }); + + this.registerComponent('x-baz', { + template: '[x-baz: {{baz}}]', + ComponentClass: BaseClass.extend() + }); + + this.registerComponent('x-bat', { + template: '[x-bat: {{bat}}]', + ComponentClass: BaseClass.extend() + }); + + this.render('[-top-level: {{foo}}] {{#x-bar bar=bar}}{{x-baz baz=baz}}{{/x-bar}} {{x-bat bat=bat}}', { + foo: 'foo', bar: 'bar', baz: 'baz', bat: 'bat' + }); + + this.assertText('[-top-level: foo] [x-bar: bar] [x-baz: baz] [x-bat: bat]'); + + this.assertEvents('after initial render', true); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertEvents('after no-op rerender'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'foo', 'FOO'); + }); + + this.assertEvents('after updating top-level'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'baz', 'BAZ'); + }); + + this.assertEvents('after updating inner-most'); + + this.runTask(function () { + _emberMetal.set(_this2.context, 'bar', 'BAR'); + _emberMetal.set(_this2.context, 'bat', 'BAT'); + }); + + this.assertEvents('after updating the rest'); + + this.runTask(function () { + _emberMetal.set(_this2.context, 'foo', 'FOO'); + _emberMetal.set(_this2.context, 'bar', 'BAR'); + _emberMetal.set(_this2.context, 'baz', 'BAZ'); + _emberMetal.set(_this2.context, 'bat', 'BAT'); + }); + + this.assertEvents('after reset'); + }; + + _class.prototype.assertEvents = function assertEvents(label) { + var initialRender = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; + var actual = this.actual; + var expected = this.expected; + + this.assert.strictEqual(actual.before.length, actual.after.length, label + ': before and after callbacks should be balanced'); + + this._assertEvents(label + ' (before):', actual.before, expected.before, initialRender); + this._assertEvents(label + ' (after):', actual.before, expected.before, initialRender); + + this.resetEvents(); + }; + + _class.prototype._assertEvents = function _assertEvents(label, actual, expected, initialRender) { + var _this3 = this; + + this.assert.equal(actual.length, expected.length, label + ': expected ' + expected.length + ' and got ' + actual.length); + + actual.forEach(function (payload, i) { + return _this3.assertPayload(payload, expected[i], initialRender); + }); + }; + + _class.prototype.assertPayload = function assertPayload(payload, component, initialRender) { + this.assert.equal(payload.object, component.toString(), 'payload.object'); + this.assert.equal(payload.containerKey, component._debugContainerKey, 'payload.containerKey'); + this.assert.equal(payload.view, component, 'payload.view'); + this.assert.strictEqual(payload.initialRender, initialRender, 'payload.initialRender'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/components/instrumentation-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/instrumentation-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/instrumentation-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/instrumentation-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/instrumentation-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/instrumentation-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/life-cycle-test', ['exports', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-views', 'ember-glimmer/tests/utils/test-helpers', 'ember-utils', 'internal-test-helpers'], function (exports, _emberMetal, _emberRuntime, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberViews, _emberGlimmerTestsUtilsTestHelpers, _emberUtils, _internalTestHelpers) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n Twitter: {{', '}}|\n ', '\n
    '], ['\n
    \n Twitter: {{', '}}|\n ', '\n
    ']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n Name: {{', '}}|\n ', '\n
    '], ['\n
    \n Name: {{', '}}|\n ', '\n
    ']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n Website: {{', '}}\n
    '], ['\n
    \n Website: {{', '}}\n
    ']), + _templateObject4 = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n ', '|\n ', '|\n ', '\n
    '], ['\n
    \n ', '|\n ', '|\n ', '\n
    ']), + _templateObject5 = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n Top: ', '\n
    '], ['\n
    \n Top: ', '\n
    ']), + _templateObject6 = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n Middle: ', '\n
    '], ['\n
    \n Middle: ', '\n
    ']), + _templateObject7 = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n Bottom: {{', '}}\n
    '], ['\n
    \n Bottom: {{', '}}\n
    ']), + _templateObject8 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#nested-item}}Item: {{count}}{{/nested-item}}\n '], ['\n {{#nested-item}}Item: {{count}}{{/nested-item}}\n ']), + _templateObject9 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#nested-item}}Nothing to see here{{/nested-item}}\n '], ['\n {{#nested-item}}Nothing to see here{{/nested-item}}\n ']), + _templateObject10 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each items as |item|}}\n ', '\n {{else}}\n ', '\n {{/each}}\n '], ['\n {{#each items as |item|}}\n ', '\n {{else}}\n ', '\n {{/each}}\n ']), + _templateObject11 = babelHelpers.taggedTemplateLiteralLoose(['\n {{yield}}\n
      \n {{#nested-component nestedId=(concat itemId \'-A\')}}A{{/nested-component}}\n {{#nested-component nestedId=(concat itemId \'-B\')}}B{{/nested-component}}\n
    \n '], ['\n {{yield}}\n
      \n {{#nested-component nestedId=(concat itemId \'-A\')}}A{{/nested-component}}\n {{#nested-component nestedId=(concat itemId \'-B\')}}B{{/nested-component}}\n
    \n ']), + _templateObject12 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each items as |item|}}\n {{#parent-component itemId=item.id}}{{item.id}}{{/parent-component}}\n {{/each}}\n {{#if model.shouldShow}}\n {{#parent-component itemId=6}}6{{/parent-component}}\n {{/if}}\n {{#if model.shouldShow}}\n {{#parent-component itemId=7}}7{{/parent-component}}\n {{/if}}\n '], ['\n {{#each items as |item|}}\n {{#parent-component itemId=item.id}}{{item.id}}{{/parent-component}}\n {{/each}}\n {{#if model.shouldShow}}\n {{#parent-component itemId=6}}6{{/parent-component}}\n {{/if}}\n {{#if model.shouldShow}}\n {{#parent-component itemId=7}}7{{/parent-component}}\n {{/if}}\n ']); + + var LifeCycleHooksTest = (function (_RenderingTest) { +babelHelpers.inherits(LifeCycleHooksTest, _RenderingTest); + + function LifeCycleHooksTest() { + _RenderingTest.call(this); + this.hooks = []; + this.components = {}; + this.componentRegistry = []; + this.teardownAssertions = []; + } + + LifeCycleHooksTest.prototype.teardown = function teardown() { + _RenderingTest.prototype.teardown.call(this); + + for (var i = 0; i < this.teardownAssertions.length; i++) { + this.teardownAssertions[i](); + } + }; + + LifeCycleHooksTest.prototype.getBootOptions = function getBootOptions() { + return { + isInteractive: this.isInteractive + }; + }; + + /* abstract */ + + /* abstract */ + + LifeCycleHooksTest.prototype.invocationFor = function invocationFor(name) { + var namedArgs = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + throw new Error('Not implemented: `invocationFor`'); + }; + + /* abstract */ + + LifeCycleHooksTest.prototype.attrFor = function attrFor(name) { + throw new Error('Not implemented: `attrFor`'); + }; + + LifeCycleHooksTest.prototype.assertRegisteredViews = function assertRegisteredViews(label) { + var viewRegistry = this.owner.lookup('-view-registry:main'); + var topLevelId = _emberViews.getViewId(this.component); + var actual = Object.keys(viewRegistry).sort().filter(function (id) { + return id !== topLevelId; + }); + + if (this.isInteractive) { + var expected = this.componentRegistry.sort(); + + this.assert.deepEqual(actual, expected, 'registered views - ' + label); + } else { + this.assert.deepEqual(actual, [], 'no views should be registered for non-interactive mode'); + } + }; + + LifeCycleHooksTest.prototype.registerComponent = function registerComponent(name, _ref) { + var _this = this; + + var _ref$template = _ref.template; + var template = _ref$template === undefined ? null : _ref$template; + + var pushComponent = function (instance) { + _this.components[name] = instance; + _this.componentRegistry.push(_emberViews.getViewId(instance)); + }; + + var removeComponent = function (instance) { + var index = _this.componentRegistry.indexOf(instance); + _this.componentRegistry.splice(index, 1); + + delete _this.components[name]; + }; + + var pushHook = function (hookName, args) { + _this.hooks.push(hook(name, hookName, args)); + }; + + var assertParentView = function (hookName, instance) { + _this.assert.ok(instance.parentView, 'parentView should be present in ' + hookName); + + if (hookName === 'willDestroyElement') { + _this.assert.ok(instance.parentView.childViews.indexOf(instance) !== -1, 'view is still connected to parentView in ' + hookName); + } + }; + + var assertElement = function (hookName, instance) { + var inDOM = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2]; + + if (instance.tagName === '') { + return; + } + + _this.assert.ok(_emberViews.getViewElement(instance), 'element should be present on ' + instance + ' during ' + hookName); + + if (_this.isInteractive) { + _this.assert.ok(instance.element, 'this.element should be present on ' + instance + ' during ' + hookName); + _this.assert.equal(document.body.contains(instance.element), inDOM, 'element for ' + instance + ' ' + (inDOM ? 'should' : 'should not') + ' be in the DOM during ' + hookName); + } else { + _this.assert.throws(function () { + return instance.element; + }, /Accessing `this.element` is not allowed in non-interactive environments/); + } + }; + + var assertNoElement = function (hookName, instance) { + _this.assert.strictEqual(_emberViews.getViewElement(instance), null, 'element should not be present in ' + hookName); + + if (_this.isInteractive) { + _this.assert.strictEqual(instance.element, null, 'this.element should not be present in ' + hookName); + } else { + _this.assert.throws(function () { + return instance.element; + }, /Accessing `this.element` is not allowed in non-interactive environments/); + } + }; + + var assertState = function (hookName, expectedState, instance) { + _this.assert.equal(instance._state, expectedState, 'within ' + hookName + ' the expected _state is ' + expectedState); + }; + + var isInteractive = this.isInteractive; + + var ComponentClass = this.ComponentClass.extend({ + init: function () { + var _this2 = this, + _arguments = arguments; + + expectDeprecation(function () { + _this2._super.apply(_this2, _arguments); + }, /didInitAttrs called/); + + this.isInitialRender = true; + this.componentName = name; + pushHook('init'); + pushComponent(this); + assertParentView('init', this); + assertNoElement('init', this); + assertState('init', 'preRender', this); + + this.on('init', function () { + return pushHook('on(init)'); + }); + + _emberMetal.run.scheduleOnce('afterRender', function () { + _this2.isInitialRender = false; + }); + }, + + didInitAttrs: function (options) { + pushHook('didInitAttrs', options); + assertParentView('didInitAttrs', this); + assertNoElement('didInitAttrs', this); + assertState('didInitAttrs', 'preRender', this); + }, + + didReceiveAttrs: function (options) { + pushHook('didReceiveAttrs', options); + assertParentView('didReceiveAttrs', this); + + if (this.isInitialRender) { + assertNoElement('didReceiveAttrs', this); + assertState('didReceiveAttrs', 'preRender', this); + } else { + assertElement('didReceiveAttrs', this); + + if (isInteractive) { + assertState('didReceiveAttrs', 'inDOM', this); + } else { + assertState('didReceiveAttrs', 'hasElement', this); + } + } + }, + + willInsertElement: function () { + pushHook('willInsertElement'); + assertParentView('willInsertElement', this); + assertElement('willInsertElement', this, false); + assertState('willInsertElement', 'hasElement', this); + }, + + willRender: function () { + pushHook('willRender'); + assertParentView('willRender', this); + + if (this.isInitialRender) { + assertNoElement('willRender', this, false); + assertState('willRender', 'preRender', this); + } else { + assertElement('willRender', this); + assertState('willRender', 'inDOM', this); + } + }, + + didInsertElement: function () { + pushHook('didInsertElement'); + assertParentView('didInsertElement', this); + assertElement('didInsertElement', this); + assertState('didInsertElement', 'inDOM', this); + }, + + didRender: function () { + pushHook('didRender'); + assertParentView('didRender', this); + assertElement('didRender', this); + assertState('didRender', 'inDOM', this); + }, + + didUpdateAttrs: function (options) { + pushHook('didUpdateAttrs', options); + assertParentView('didUpdateAttrs', this); + + if (isInteractive) { + assertState('didUpdateAttrs', 'inDOM', this); + } else { + assertState('didUpdateAttrs', 'hasElement', this); + } + }, + + willUpdate: function (options) { + pushHook('willUpdate', options); + assertParentView('willUpdate', this); + assertElement('willUpdate', this); + assertState('willUpdate', 'inDOM', this); + }, + + didUpdate: function (options) { + pushHook('didUpdate', options); + assertParentView('didUpdate', this); + assertElement('didUpdate', this); + assertState('didUpdate', 'inDOM', this); + }, + + willDestroyElement: function () { + pushHook('willDestroyElement'); + assertParentView('willDestroyElement', this); + assertElement('willDestroyElement', this); + assertState('willDestroyElement', 'inDOM', this); + }, + + willClearRender: function () { + pushHook('willClearRender'); + assertParentView('willClearRender', this); + assertElement('willClearRender', this); + assertState('willClearRender', 'inDOM', this); + }, + + didDestroyElement: function () { + pushHook('didDestroyElement'); + assertNoElement('didDestroyElement', this); + assertState('didDestroyElement', 'destroying', this); + }, + + willDestroy: function () { + pushHook('willDestroy'); + removeComponent(this); + + this._super.apply(this, arguments); + } + }); + + _RenderingTest.prototype.registerComponent.call(this, name, { ComponentClass: ComponentClass, template: template }); + }; + + LifeCycleHooksTest.prototype.assertHooks = function assertHooks(_ref2) { + var label = _ref2.label; + var interactive = _ref2.interactive; + var nonInteractive = _ref2.nonInteractive; + + var rawHooks = this.isInteractive ? interactive : nonInteractive; + var hooks = rawHooks.map(function (raw) { + return hook.apply(undefined, raw); + }); + this.assert.deepEqual(json(this.hooks), json(hooks), label); + this.hooks = []; + }; + + LifeCycleHooksTest.prototype['@test lifecycle hooks are invoked in a predictable order'] = function testLifecycleHooksAreInvokedInAPredictableOrder() { + var _this3 = this; + + var _boundHelpers = this.boundHelpers; + var attr = _boundHelpers.attr; + var invoke = _boundHelpers.invoke; + + this.registerComponent('the-top', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject, attr('twitter'), invoke('the-middle', { name: string('Tom Dale') })) + }); + + this.registerComponent('the-middle', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2, attr('name'), invoke('the-bottom', { website: string('tomdale.net') })) + }); + + this.registerComponent('the-bottom', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3, attr('website')) + }); + + this.render(invoke('the-top', { twitter: expr('twitter') }), { twitter: '@tomdale' }); + + this.assertText('Twitter: @tomdale|Name: Tom Dale|Website: tomdale.net'); + this.assertRegisteredViews('intial render'); + + var topAttrs = { twitter: '@tomdale' }; + var middleAttrs = { name: 'Tom Dale' }; + var bottomAttrs = { website: 'tomdale.net' }; + + this.assertHooks({ + label: 'after initial render', + + interactive: [ + // Sync hooks + + ['the-top', 'init'], ['the-top', 'didInitAttrs', { attrs: topAttrs }], ['the-top', 'didReceiveAttrs', { newAttrs: topAttrs }], ['the-top', 'on(init)'], ['the-top', 'willRender'], ['the-top', 'willInsertElement'], ['the-middle', 'init'], ['the-middle', 'didInitAttrs', { attrs: middleAttrs }], ['the-middle', 'didReceiveAttrs', { newAttrs: middleAttrs }], ['the-middle', 'on(init)'], ['the-middle', 'willRender'], ['the-middle', 'willInsertElement'], ['the-bottom', 'init'], ['the-bottom', 'didInitAttrs', { attrs: bottomAttrs }], ['the-bottom', 'didReceiveAttrs', { newAttrs: bottomAttrs }], ['the-bottom', 'on(init)'], ['the-bottom', 'willRender'], ['the-bottom', 'willInsertElement'], + + // Async hooks + + ['the-bottom', 'didInsertElement'], ['the-bottom', 'didRender'], ['the-middle', 'didInsertElement'], ['the-middle', 'didRender'], ['the-top', 'didInsertElement'], ['the-top', 'didRender']], + + nonInteractive: [ + // Sync hooks + ['the-top', 'init'], ['the-top', 'didInitAttrs', { attrs: topAttrs }], ['the-top', 'didReceiveAttrs', { newAttrs: topAttrs }], ['the-top', 'on(init)'], ['the-middle', 'init'], ['the-middle', 'didInitAttrs', { attrs: middleAttrs }], ['the-middle', 'didReceiveAttrs', { newAttrs: middleAttrs }], ['the-middle', 'on(init)'], ['the-bottom', 'init'], ['the-bottom', 'didInitAttrs', { attrs: bottomAttrs }], ['the-bottom', 'didReceiveAttrs', { newAttrs: bottomAttrs }], ['the-bottom', 'on(init)']] + }); + + this.runTask(function () { + return _this3.components['the-bottom'].rerender(); + }); + + this.assertText('Twitter: @tomdale|Name: Tom Dale|Website: tomdale.net'); + + this.assertHooks({ + label: 'after no-op rerender (bottom)', + + interactive: [ + // Sync hooks + ['the-top', 'willUpdate'], ['the-top', 'willRender'], ['the-middle', 'willUpdate'], ['the-middle', 'willRender'], ['the-bottom', 'willUpdate'], ['the-bottom', 'willRender'], + + // Async hooks + + ['the-bottom', 'didUpdate'], ['the-bottom', 'didRender'], ['the-middle', 'didUpdate'], ['the-middle', 'didRender'], ['the-top', 'didUpdate'], ['the-top', 'didRender']], + + nonInteractive: [] + }); + + this.runTask(function () { + return _this3.components['the-middle'].rerender(); + }); + + this.assertText('Twitter: @tomdale|Name: Tom Dale|Website: tomdale.net'); + + this.assertHooks({ + label: 'after no-op rerender (middle)', + + interactive: [ + // Sync hooks + + ['the-top', 'willUpdate'], ['the-top', 'willRender'], ['the-middle', 'willUpdate'], ['the-middle', 'willRender'], + + // Async hooks + + ['the-middle', 'didUpdate'], ['the-middle', 'didRender'], ['the-top', 'didUpdate'], ['the-top', 'didRender']], + + nonInteractive: [] + }); + + this.runTask(function () { + return _this3.components['the-top'].rerender(); + }); + + this.assertText('Twitter: @tomdale|Name: Tom Dale|Website: tomdale.net'); + + this.assertHooks({ + label: 'after no-op rerender (top)', + + interactive: [ + // Sync hooks + + ['the-top', 'willUpdate'], ['the-top', 'willRender'], + + // Async hooks + + ['the-top', 'didUpdate'], ['the-top', 'didRender']], + + nonInteractive: [] + }); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'twitter', '@horsetomdale'); + }); + + this.assertText('Twitter: @horsetomdale|Name: Tom Dale|Website: tomdale.net'); + + // Because the `twitter` attr is only used by the topmost component, + // and not passed down, we do not expect to see lifecycle hooks + // called for child components. If the `didReceiveAttrs` hook used + // the new attribute to rerender itself imperatively, that would result + // in lifecycle hooks being invoked for the child. + + topAttrs = { oldAttrs: { twitter: '@tomdale' }, newAttrs: { twitter: '@horsetomdale' } }; + + this.assertHooks({ + label: 'after update', + + interactive: [ + // Sync hooks + + ['the-top', 'didUpdateAttrs', topAttrs], ['the-top', 'didReceiveAttrs', topAttrs], ['the-top', 'willUpdate'], ['the-top', 'willRender'], + + // Async hooks + + ['the-top', 'didUpdate'], ['the-top', 'didRender']], + + nonInteractive: [ + // Sync hooks + ['the-top', 'didUpdateAttrs', topAttrs], ['the-top', 'didReceiveAttrs', topAttrs]] + }); + + this.teardownAssertions.push(function () { + _this3.assertHooks({ + label: 'destroy', + + interactive: [['the-top', 'willDestroyElement'], ['the-top', 'willClearRender'], ['the-middle', 'willDestroyElement'], ['the-middle', 'willClearRender'], ['the-bottom', 'willDestroyElement'], ['the-bottom', 'willClearRender'], ['the-top', 'didDestroyElement'], ['the-middle', 'didDestroyElement'], ['the-bottom', 'didDestroyElement'], ['the-top', 'willDestroy'], ['the-middle', 'willDestroy'], ['the-bottom', 'willDestroy']], + + nonInteractive: [['the-top', 'willDestroy'], ['the-middle', 'willDestroy'], ['the-bottom', 'willDestroy']] + }); + + _this3.assertRegisteredViews('after destroy'); + }); + }; + + LifeCycleHooksTest.prototype['@test lifecycle hooks are invoked in a correct sibling order'] = function testLifecycleHooksAreInvokedInACorrectSiblingOrder() { + var _this4 = this; + + var _boundHelpers2 = this.boundHelpers; + var attr = _boundHelpers2.attr; + var invoke = _boundHelpers2.invoke; + + this.registerComponent('the-parent', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4, invoke('the-first-child', { twitter: expr(attr('twitter')) }), invoke('the-second-child', { name: expr(attr('name')) }), invoke('the-last-child', { website: expr(attr('website')) })) + }); + + this.registerComponent('the-first-child', { template: 'Twitter: {{' + attr('twitter') + '}}' }); + + this.registerComponent('the-second-child', { template: 'Name: {{' + attr('name') + '}}' }); + + this.registerComponent('the-last-child', { template: 'Website: {{' + attr('website') + '}}' }); + + this.render(invoke('the-parent', { + twitter: expr('twitter'), + name: expr('name'), + website: expr('website') + }), { + twitter: '@tomdale', + name: 'Tom Dale', + website: 'tomdale.net' + }); + + this.assertText('Twitter: @tomdale|Name: Tom Dale|Website: tomdale.net'); + this.assertRegisteredViews('intial render'); + + var parentAttrs = { twitter: '@tomdale', name: 'Tom Dale', website: 'tomdale.net' }; + var firstAttrs = { twitter: '@tomdale' }; + var secondAttrs = { name: 'Tom Dale' }; + var lastAttrs = { website: 'tomdale.net' }; + + this.assertHooks({ + label: 'after initial render', + + interactive: [ + // Sync hooks + + ['the-parent', 'init'], ['the-parent', 'didInitAttrs', { attrs: parentAttrs }], ['the-parent', 'didReceiveAttrs', { newAttrs: parentAttrs }], ['the-parent', 'on(init)'], ['the-parent', 'willRender'], ['the-parent', 'willInsertElement'], ['the-first-child', 'init'], ['the-first-child', 'didInitAttrs', { attrs: firstAttrs }], ['the-first-child', 'didReceiveAttrs', { newAttrs: firstAttrs }], ['the-first-child', 'on(init)'], ['the-first-child', 'willRender'], ['the-first-child', 'willInsertElement'], ['the-second-child', 'init'], ['the-second-child', 'didInitAttrs', { attrs: secondAttrs }], ['the-second-child', 'didReceiveAttrs', { newAttrs: secondAttrs }], ['the-second-child', 'on(init)'], ['the-second-child', 'willRender'], ['the-second-child', 'willInsertElement'], ['the-last-child', 'init'], ['the-last-child', 'didInitAttrs', { attrs: lastAttrs }], ['the-last-child', 'didReceiveAttrs', { newAttrs: lastAttrs }], ['the-last-child', 'on(init)'], ['the-last-child', 'willRender'], ['the-last-child', 'willInsertElement'], + + // Async hooks + + ['the-first-child', 'didInsertElement'], ['the-first-child', 'didRender'], ['the-second-child', 'didInsertElement'], ['the-second-child', 'didRender'], ['the-last-child', 'didInsertElement'], ['the-last-child', 'didRender'], ['the-parent', 'didInsertElement'], ['the-parent', 'didRender']], + + nonInteractive: [ + // Sync hooks + + ['the-parent', 'init'], ['the-parent', 'didInitAttrs', { attrs: parentAttrs }], ['the-parent', 'didReceiveAttrs', { newAttrs: parentAttrs }], ['the-parent', 'on(init)'], ['the-first-child', 'init'], ['the-first-child', 'didInitAttrs', { attrs: firstAttrs }], ['the-first-child', 'didReceiveAttrs', { newAttrs: firstAttrs }], ['the-first-child', 'on(init)'], ['the-second-child', 'init'], ['the-second-child', 'didInitAttrs', { attrs: secondAttrs }], ['the-second-child', 'didReceiveAttrs', { newAttrs: secondAttrs }], ['the-second-child', 'on(init)'], ['the-last-child', 'init'], ['the-last-child', 'didInitAttrs', { attrs: lastAttrs }], ['the-last-child', 'didReceiveAttrs', { newAttrs: lastAttrs }], ['the-last-child', 'on(init)']] + }); + + this.runTask(function () { + return _this4.components['the-first-child'].rerender(); + }); + + this.assertText('Twitter: @tomdale|Name: Tom Dale|Website: tomdale.net'); + + this.assertHooks({ + label: 'after no-op rerender (first child)', + + interactive: [ + // Sync hooks + + ['the-parent', 'willUpdate'], ['the-parent', 'willRender'], ['the-first-child', 'willUpdate'], ['the-first-child', 'willRender'], + + // Async hooks + + ['the-first-child', 'didUpdate'], ['the-first-child', 'didRender'], ['the-parent', 'didUpdate'], ['the-parent', 'didRender']], + + nonInteractive: [] + }); + + this.runTask(function () { + return _this4.components['the-second-child'].rerender(); + }); + + this.assertText('Twitter: @tomdale|Name: Tom Dale|Website: tomdale.net'); + + this.assertHooks({ + label: 'after no-op rerender (second child)', + + interactive: [ + // Sync hooks + + ['the-parent', 'willUpdate'], ['the-parent', 'willRender'], ['the-second-child', 'willUpdate'], ['the-second-child', 'willRender'], + + // Async hooks + + ['the-second-child', 'didUpdate'], ['the-second-child', 'didRender'], ['the-parent', 'didUpdate'], ['the-parent', 'didRender']], + + nonInteractive: [] + }); + + this.runTask(function () { + return _this4.components['the-last-child'].rerender(); + }); + + this.assertText('Twitter: @tomdale|Name: Tom Dale|Website: tomdale.net'); + + this.assertHooks({ + label: 'after no-op rerender (last child)', + + interactive: [ + // Sync hooks + + ['the-parent', 'willUpdate'], ['the-parent', 'willRender'], ['the-last-child', 'willUpdate'], ['the-last-child', 'willRender'], + + // Async hooks + + ['the-last-child', 'didUpdate'], ['the-last-child', 'didRender'], ['the-parent', 'didUpdate'], ['the-parent', 'didRender']], + + nonInteractive: [] + }); + + this.runTask(function () { + return _this4.components['the-parent'].rerender(); + }); + + this.assertText('Twitter: @tomdale|Name: Tom Dale|Website: tomdale.net'); + + this.assertHooks({ + label: 'after no-op rerender (parent)', + + interactive: [ + // Sync hooks + + ['the-parent', 'willUpdate'], ['the-parent', 'willRender'], + + // Async hooks + + ['the-parent', 'didUpdate'], ['the-parent', 'didRender']], + + nonInteractive: [] + }); + + this.runTask(function () { + return _emberMetal.setProperties(_this4.context, { + twitter: '@horsetomdale', + name: 'Horse Tom Dale', + website: 'horsetomdale.net' + }); + }); + + this.assertText('Twitter: @horsetomdale|Name: Horse Tom Dale|Website: horsetomdale.net'); + + parentAttrs = { + oldAttrs: { twitter: '@tomdale', name: 'Tom Dale', website: 'tomdale.net' }, + newAttrs: { twitter: '@horsetomdale', name: 'Horse Tom Dale', website: 'horsetomdale.net' } + }; + firstAttrs = { oldAttrs: { twitter: '@tomdale' }, newAttrs: { twitter: '@horsetomdale' } }; + secondAttrs = { oldAttrs: { name: 'Tom Dale' }, newAttrs: { name: 'Horse Tom Dale' } }; + lastAttrs = { oldAttrs: { website: 'tomdale.net' }, newAttrs: { website: 'horsetomdale.net' } }; + + this.assertHooks({ + label: 'after update', + + interactive: [ + // Sync hooks + + ['the-parent', 'didUpdateAttrs', parentAttrs], ['the-parent', 'didReceiveAttrs', parentAttrs], ['the-parent', 'willUpdate'], ['the-parent', 'willRender'], ['the-first-child', 'didUpdateAttrs', firstAttrs], ['the-first-child', 'didReceiveAttrs', firstAttrs], ['the-first-child', 'willUpdate'], ['the-first-child', 'willRender'], ['the-second-child', 'didUpdateAttrs', secondAttrs], ['the-second-child', 'didReceiveAttrs', secondAttrs], ['the-second-child', 'willUpdate'], ['the-second-child', 'willRender'], ['the-last-child', 'didUpdateAttrs', lastAttrs], ['the-last-child', 'didReceiveAttrs', lastAttrs], ['the-last-child', 'willUpdate'], ['the-last-child', 'willRender'], + + // Async hooks + + ['the-first-child', 'didUpdate'], ['the-first-child', 'didRender'], ['the-second-child', 'didUpdate'], ['the-second-child', 'didRender'], ['the-last-child', 'didUpdate'], ['the-last-child', 'didRender'], ['the-parent', 'didUpdate'], ['the-parent', 'didRender']], + + nonInteractive: [ + // Sync hooks + + ['the-parent', 'didUpdateAttrs', parentAttrs], ['the-parent', 'didReceiveAttrs', parentAttrs], ['the-first-child', 'didUpdateAttrs', firstAttrs], ['the-first-child', 'didReceiveAttrs', firstAttrs], ['the-second-child', 'didUpdateAttrs', secondAttrs], ['the-second-child', 'didReceiveAttrs', secondAttrs], ['the-last-child', 'didUpdateAttrs', lastAttrs], ['the-last-child', 'didReceiveAttrs', lastAttrs]] + }); + + this.teardownAssertions.push(function () { + _this4.assertHooks({ + label: 'destroy', + + interactive: [['the-parent', 'willDestroyElement'], ['the-parent', 'willClearRender'], ['the-first-child', 'willDestroyElement'], ['the-first-child', 'willClearRender'], ['the-second-child', 'willDestroyElement'], ['the-second-child', 'willClearRender'], ['the-last-child', 'willDestroyElement'], ['the-last-child', 'willClearRender'], ['the-parent', 'didDestroyElement'], ['the-first-child', 'didDestroyElement'], ['the-second-child', 'didDestroyElement'], ['the-last-child', 'didDestroyElement'], ['the-parent', 'willDestroy'], ['the-first-child', 'willDestroy'], ['the-second-child', 'willDestroy'], ['the-last-child', 'willDestroy']], + + nonInteractive: [['the-parent', 'willDestroy'], ['the-first-child', 'willDestroy'], ['the-second-child', 'willDestroy'], ['the-last-child', 'willDestroy']] + }); + + _this4.assertRegisteredViews('after destroy'); + }); + }; + + LifeCycleHooksTest.prototype['@test passing values through attrs causes lifecycle hooks to fire if the attribute values have changed'] = function testPassingValuesThroughAttrsCausesLifecycleHooksToFireIfTheAttributeValuesHaveChanged() { + var _this5 = this; + + var _boundHelpers3 = this.boundHelpers; + var attr = _boundHelpers3.attr; + var invoke = _boundHelpers3.invoke; + + this.registerComponent('the-top', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5, invoke('the-middle', { twitterTop: expr(attr('twitter')) })) + }); + + this.registerComponent('the-middle', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject6, invoke('the-bottom', { twitterMiddle: expr(attr('twitterTop')) })) + }); + + this.registerComponent('the-bottom', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject7, attr('twitterMiddle')) + }); + + this.render(invoke('the-top', { twitter: expr('twitter') }), { twitter: '@tomdale' }); + + this.assertText('Top: Middle: Bottom: @tomdale'); + this.assertRegisteredViews('intial render'); + + var topAttrs = { twitter: '@tomdale' }; + var middleAttrs = { twitterTop: '@tomdale' }; + var bottomAttrs = { twitterMiddle: '@tomdale' }; + + this.assertHooks({ + label: 'after initial render', + + interactive: [ + // Sync hooks + + ['the-top', 'init'], ['the-top', 'didInitAttrs', { attrs: topAttrs }], ['the-top', 'didReceiveAttrs', { newAttrs: topAttrs }], ['the-top', 'on(init)'], ['the-top', 'willRender'], ['the-top', 'willInsertElement'], ['the-middle', 'init'], ['the-middle', 'didInitAttrs', { attrs: middleAttrs }], ['the-middle', 'didReceiveAttrs', { newAttrs: middleAttrs }], ['the-middle', 'on(init)'], ['the-middle', 'willRender'], ['the-middle', 'willInsertElement'], ['the-bottom', 'init'], ['the-bottom', 'didInitAttrs', { attrs: bottomAttrs }], ['the-bottom', 'didReceiveAttrs', { newAttrs: bottomAttrs }], ['the-bottom', 'on(init)'], ['the-bottom', 'willRender'], ['the-bottom', 'willInsertElement'], + + // Async hooks + + ['the-bottom', 'didInsertElement'], ['the-bottom', 'didRender'], ['the-middle', 'didInsertElement'], ['the-middle', 'didRender'], ['the-top', 'didInsertElement'], ['the-top', 'didRender']], + + nonInteractive: [ + // Sync hooks + + ['the-top', 'init'], ['the-top', 'didInitAttrs', { attrs: topAttrs }], ['the-top', 'didReceiveAttrs', { newAttrs: topAttrs }], ['the-top', 'on(init)'], ['the-middle', 'init'], ['the-middle', 'didInitAttrs', { attrs: middleAttrs }], ['the-middle', 'didReceiveAttrs', { newAttrs: middleAttrs }], ['the-middle', 'on(init)'], ['the-bottom', 'init'], ['the-bottom', 'didInitAttrs', { attrs: bottomAttrs }], ['the-bottom', 'didReceiveAttrs', { newAttrs: bottomAttrs }], ['the-bottom', 'on(init)']] + }); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'twitter', '@horsetomdale'); + }); + + this.assertText('Top: Middle: Bottom: @horsetomdale'); + + // Because the `twitter` attr is used by the all of the components, + // the lifecycle hooks are invoked for all components. + + topAttrs = { oldAttrs: { twitter: '@tomdale' }, newAttrs: { twitter: '@horsetomdale' } }; + middleAttrs = { oldAttrs: { twitterTop: '@tomdale' }, newAttrs: { twitterTop: '@horsetomdale' } }; + bottomAttrs = { oldAttrs: { twitterMiddle: '@tomdale' }, newAttrs: { twitterMiddle: '@horsetomdale' } }; + + this.assertHooks({ + label: 'after updating (root)', + + interactive: [ + // Sync hooks + + ['the-top', 'didUpdateAttrs', topAttrs], ['the-top', 'didReceiveAttrs', topAttrs], ['the-top', 'willUpdate'], ['the-top', 'willRender'], ['the-middle', 'didUpdateAttrs', middleAttrs], ['the-middle', 'didReceiveAttrs', middleAttrs], ['the-middle', 'willUpdate'], ['the-middle', 'willRender'], ['the-bottom', 'didUpdateAttrs', bottomAttrs], ['the-bottom', 'didReceiveAttrs', bottomAttrs], ['the-bottom', 'willUpdate'], ['the-bottom', 'willRender'], + + // Async hooks + + ['the-bottom', 'didUpdate'], ['the-bottom', 'didRender'], ['the-middle', 'didUpdate'], ['the-middle', 'didRender'], ['the-top', 'didUpdate'], ['the-top', 'didRender']], + + nonInteractive: [ + // Sync hooks + + ['the-top', 'didUpdateAttrs', topAttrs], ['the-top', 'didReceiveAttrs', topAttrs], ['the-middle', 'didUpdateAttrs', middleAttrs], ['the-middle', 'didReceiveAttrs', middleAttrs], ['the-bottom', 'didUpdateAttrs', bottomAttrs], ['the-bottom', 'didReceiveAttrs', bottomAttrs]] + }); + + this.runTask(function () { + return _this5.rerender(); + }); + + this.assertText('Top: Middle: Bottom: @horsetomdale'); + + // In this case, because the attrs are passed down, all child components are invoked. + + topAttrs = { oldAttrs: { twitter: '@horsetomdale' }, newAttrs: { twitter: '@horsetomdale' } }; + middleAttrs = { oldAttrs: { twitterTop: '@horsetomdale' }, newAttrs: { twitterTop: '@horsetomdale' } }; + bottomAttrs = { oldAttrs: { twitterMiddle: '@horsetomdale' }, newAttrs: { twitterMiddle: '@horsetomdale' } }; + + this.assertHooks({ + label: 'after no-op rernder (root)', + interactive: [], + nonInteractive: [] + }); + + this.teardownAssertions.push(function () { + _this5.assertHooks({ + label: 'destroy', + + interactive: [['the-top', 'willDestroyElement'], ['the-top', 'willClearRender'], ['the-middle', 'willDestroyElement'], ['the-middle', 'willClearRender'], ['the-bottom', 'willDestroyElement'], ['the-bottom', 'willClearRender'], ['the-top', 'didDestroyElement'], ['the-middle', 'didDestroyElement'], ['the-bottom', 'didDestroyElement'], ['the-top', 'willDestroy'], ['the-middle', 'willDestroy'], ['the-bottom', 'willDestroy']], + + nonInteractive: [['the-top', 'willDestroy'], ['the-middle', 'willDestroy'], ['the-bottom', 'willDestroy']] + }); + + _this5.assertRegisteredViews('after destroy'); + }); + }; + + LifeCycleHooksTest.prototype['@test components rendered from `{{each}}` have correct life-cycle hooks to be called'] = function testComponentsRenderedFromEachHaveCorrectLifeCycleHooksToBeCalled() { + var _this6 = this; + + var invoke = this.boundHelpers.invoke; + + this.registerComponent('nested-item', { template: '{{yield}}' }); + + this.registerComponent('an-item', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject8) }); + + this.registerComponent('no-items', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject9) }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject10, invoke('an-item', { count: expr('item') }), invoke('no-items')), { + items: [1, 2, 3, 4, 5] + }); + + this.assertText('Item: 1Item: 2Item: 3Item: 4Item: 5'); + this.assertRegisteredViews('intial render'); + + var initialHooks = function (count) { + var ret = [['an-item', 'init'], ['an-item', 'didInitAttrs', { attrs: { count: count } }], ['an-item', 'didReceiveAttrs', { newAttrs: { count: count } }], ['an-item', 'on(init)']]; + if (_this6.isInteractive) { + ret.push(['an-item', 'willRender'], ['an-item', 'willInsertElement']); + } + ret.push(['nested-item', 'init'], ['nested-item', 'didInitAttrs', { attrs: {} }], ['nested-item', 'didReceiveAttrs', { newAttrs: {} }], ['nested-item', 'on(init)']); + if (_this6.isInteractive) { + ret.push(['nested-item', 'willRender'], ['nested-item', 'willInsertElement']); + } + return ret; + }; + + var initialAfterRenderHooks = function (count) { + if (_this6.isInteractive) { + return [['nested-item', 'didInsertElement'], ['nested-item', 'didRender'], ['an-item', 'didInsertElement'], ['an-item', 'didRender']]; + } else { + return []; + } + }; + + this.assertHooks({ + label: 'after initial render', + + interactive: [].concat(initialHooks(1), initialHooks(2), initialHooks(3), initialHooks(4), initialHooks(5), initialAfterRenderHooks(5), initialAfterRenderHooks(4), initialAfterRenderHooks(3), initialAfterRenderHooks(2), initialAfterRenderHooks(1)), + + nonInteractive: [].concat(initialHooks(1), initialHooks(2), initialHooks(3), initialHooks(4), initialHooks(5), initialAfterRenderHooks(5), initialAfterRenderHooks(4), initialAfterRenderHooks(3), initialAfterRenderHooks(2), initialAfterRenderHooks(1)) + }); + + // TODO: Is this correct? Should childViews be populated in non-interactive mode? + if (this.isInteractive) { + this.assert.equal(this.component.childViews.length, 5, 'childViews precond'); + } + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'items', []); + }); + + // TODO: Is this correct? Should childViews be populated in non-interactive mode? + if (this.isInteractive) { + this.assert.equal(this.component.childViews.length, 1, 'childViews updated'); + } + + this.assertText('Nothing to see here'); + + this.assertHooks({ + label: 'reset to empty array', + + interactive: [['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['no-items', 'init'], ['no-items', 'didInitAttrs', { attrs: {} }], ['no-items', 'didReceiveAttrs', { newAttrs: {} }], ['no-items', 'on(init)'], ['no-items', 'willRender'], ['no-items', 'willInsertElement'], ['nested-item', 'init'], ['nested-item', 'didInitAttrs', { attrs: {} }], ['nested-item', 'didReceiveAttrs', { newAttrs: {} }], ['nested-item', 'on(init)'], ['nested-item', 'willRender'], ['nested-item', 'willInsertElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['nested-item', 'didInsertElement'], ['nested-item', 'didRender'], ['no-items', 'didInsertElement'], ['no-items', 'didRender'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy']], + + nonInteractive: [['no-items', 'init'], ['no-items', 'didInitAttrs', { attrs: {} }], ['no-items', 'didReceiveAttrs', { newAttrs: {} }], ['no-items', 'on(init)'], ['nested-item', 'init'], ['nested-item', 'didInitAttrs', { attrs: {} }], ['nested-item', 'didReceiveAttrs', { newAttrs: {} }], ['nested-item', 'on(init)'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy']] + }); + + this.teardownAssertions.push(function () { + _this6.assertHooks({ + label: 'destroy', + + interactive: [['no-items', 'willDestroyElement'], ['no-items', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['no-items', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['no-items', 'willDestroy'], ['nested-item', 'willDestroy']], + + nonInteractive: [['no-items', 'willDestroy'], ['nested-item', 'willDestroy']] + }); + + _this6.assertRegisteredViews('after destroy'); + }); + }; + +babelHelpers.createClass(LifeCycleHooksTest, [{ + key: 'isInteractive', + get: function () { + return true; + } + }, { + key: 'ComponentClass', + get: function () { + throw new Error('Not implemented: `ComponentClass`'); + } + }, { + key: 'boundHelpers', + get: function () { + return { + invoke: bind(this.invocationFor, this), + attr: bind(this.attrFor, this) + }; + } + }]); + return LifeCycleHooksTest; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest); + + var CurlyComponentsTest = (function (_LifeCycleHooksTest) { +babelHelpers.inherits(CurlyComponentsTest, _LifeCycleHooksTest); + + function CurlyComponentsTest() { + _LifeCycleHooksTest.apply(this, arguments); + } + + CurlyComponentsTest.prototype.invocationFor = function invocationFor(name) { + var _this7 = this; + + var namedArgs = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + var attrs = Object.keys(namedArgs).map(function (k) { + return k + '=' + _this7.val(namedArgs[k]); + }).join(' '); + return '{{' + name + ' ' + attrs + '}}'; + }; + + CurlyComponentsTest.prototype.attrFor = function attrFor(name) { + return '' + name; + }; + + /* private */ + + CurlyComponentsTest.prototype.val = function val(value) { + if (value.isString) { + return JSON.stringify(value.value); + } else if (value.isExpr) { + return '(readonly ' + value.value + ')'; + } else { + throw new Error('Unknown value: ' + value); + } + }; + +babelHelpers.createClass(CurlyComponentsTest, [{ + key: 'ComponentClass', + get: function () { + return _emberGlimmerTestsUtilsHelpers.Component; + } + }]); + return CurlyComponentsTest; + })(LifeCycleHooksTest); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: interactive lifecycle hooks (curly components)', (function (_CurlyComponentsTest) { +babelHelpers.inherits(_class, _CurlyComponentsTest); + + function _class() { + _CurlyComponentsTest.apply(this, arguments); + } + +babelHelpers.createClass(_class, [{ + key: 'isInteractive', + get: function () { + return true; + } + }]); + return _class; + })(CurlyComponentsTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: non-interactive lifecycle hooks (curly components)', (function (_CurlyComponentsTest2) { +babelHelpers.inherits(_class2, _CurlyComponentsTest2); + + function _class2() { + _CurlyComponentsTest2.apply(this, arguments); + } + +babelHelpers.createClass(_class2, [{ + key: 'isInteractive', + get: function () { + return false; + } + }]); + return _class2; + })(CurlyComponentsTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: interactive lifecycle hooks (tagless curly components)', (function (_CurlyComponentsTest3) { +babelHelpers.inherits(_class3, _CurlyComponentsTest3); + + function _class3() { + _CurlyComponentsTest3.apply(this, arguments); + } + +babelHelpers.createClass(_class3, [{ + key: 'ComponentClass', + get: function () { + return _emberGlimmerTestsUtilsHelpers.Component.extend({ tagName: '' }); + } + }, { + key: 'isInteractive', + get: function () { + return true; + } + }]); + return _class3; + })(CurlyComponentsTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: non-interactive lifecycle hooks (tagless curly components)', (function (_CurlyComponentsTest4) { +babelHelpers.inherits(_class4, _CurlyComponentsTest4); + + function _class4() { + _CurlyComponentsTest4.apply(this, arguments); + } + +babelHelpers.createClass(_class4, [{ + key: 'ComponentClass', + get: function () { + return _emberGlimmerTestsUtilsHelpers.Component.extend({ tagName: '' }); + } + }, { + key: 'isInteractive', + get: function () { + return false; + } + }]); + return _class4; + })(CurlyComponentsTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Run loop and lifecycle hooks', (function (_RenderingTest2) { +babelHelpers.inherits(_class5, _RenderingTest2); + + function _class5() { + _RenderingTest2.apply(this, arguments); + } + + _class5.prototype['@test afterRender set'] = function testAfterRenderSet() { + var _this9 = this; + + var ComponentClass = _emberGlimmerTestsUtilsHelpers.Component.extend({ + width: '5', + didInsertElement: function () { + var _this8 = this; + + _emberMetal.run.scheduleOnce('afterRender', function () { + _this8.set('width', '10'); + }); + } + }); + + var template = '{{width}}'; + this.registerComponent('foo-bar', { ComponentClass: ComponentClass, template: template }); + + this.render('{{foo-bar}}'); + + this.assertText('10'); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertText('10'); + }; + + _class5.prototype['@test afterRender set on parent'] = function testAfterRenderSetOnParent() { + var _this11 = this; + + var ComponentClass = _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + var _this10 = this; + + _emberMetal.run.scheduleOnce('afterRender', function () { + var parent = _this10.get('parent'); + parent.set('foo', 'wat'); + }); + } + }); + + var template = '{{foo}}'; + + this.registerComponent('foo-bar', { ComponentClass: ComponentClass, template: template }); + + this.render('{{foo-bar parent=this foo=foo}}'); + + this.assertText('wat'); + + this.runTask(function () { + return _this11.rerender(); + }); + + this.assertText('wat'); + }; + + _class5.prototype['@test `willRender` can set before render (GH#14458)'] = function testWillRenderCanSetBeforeRenderGH14458(assert) { + var ComponentClass = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'a', + customHref: 'http://google.com', + attributeBindings: ['customHref:href'], + willRender: function () { + this.set('customHref', 'http://willRender.com'); + } + }); + + var template = 'Hello World'; + + this.registerComponent('foo-bar', { ComponentClass: ComponentClass, template: template }); + + this.render('{{foo-bar id="foo"}}'); + + this.assertElement(this.firstChild, { + tagName: 'a', + attrs: { + id: 'foo', + href: 'http://willRender.com', + class: _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') + } + }); + }; + + _class5.prototype['@test that thing about destroying'] = function testThatThingAboutDestroying(assert) { + var _this12 = this; + + var ParentDestroyedElements = []; + var ChildDestroyedElements = []; + + var ParentComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + willDestroyElement: function () { + ParentDestroyedElements.push({ + id: this.itemId, + name: 'parent-component', + hasParent: !!this.element.parentNode, + nextSibling: !!this.element.nextSibling, + previousSibling: !!this.element.previousSibling + }); + } + }); + + var PartentTemplate = _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject11); + + var NestedComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + willDestroyElement: function () { + ChildDestroyedElements.push({ + id: this.nestedId, + name: 'nested-component', + hasParent: !!this.element.parentNode, + nextSibling: !!this.element.nextSibling, + previousSibling: !!this.element.previousSibling + }); + } + }); + + var NestedTemplate = '{{yield}}'; + + this.registerComponent('parent-component', { + ComponentClass: ParentComponent, + template: PartentTemplate + }); + + this.registerComponent('nested-component', { + ComponentClass: NestedComponent, + template: NestedTemplate + }); + + var array = _emberRuntime.A([{ id: 1 }, { id: 2 }, { id: 3 }, { id: 4 }, { id: 5 }]); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject12), { + items: array, + model: { shouldShow: true } + }); + + this.assertText('1AB2AB3AB4AB5AB6AB7AB'); + + this.runTask(function () { + array.removeAt(2); + array.removeAt(2); + _emberMetal.set(_this12.context, 'model.shouldShow', false); + }); + + this.assertText('1AB2AB5AB'); + + assertDestroyHooks(assert, [].concat(ParentDestroyedElements), [{ + id: 3, + hasParent: true, + nextSibling: true, + previousSibling: true + }, { + id: 4, + hasParent: true, + nextSibling: true, + previousSibling: true + }, { + id: 6, + hasParent: true, + nextSibling: true, + previousSibling: true + }, { + id: 7, + hasParent: true, + nextSibling: false, + previousSibling: true + }]); + + assertDestroyHooks(assert, [].concat(ChildDestroyedElements), [{ + id: '3-A', + hasParent: true, + nextSibling: true, + previousSibling: false + }, { + id: '3-B', + hasParent: true, + nextSibling: false, + previousSibling: true + }, { + id: '4-A', + hasParent: true, + nextSibling: true, + previousSibling: false + }, { + id: '4-B', + hasParent: true, + nextSibling: false, + previousSibling: true + }, { + id: '6-A', + hasParent: true, + nextSibling: true, + previousSibling: false + }, { + id: '6-B', + hasParent: true, + nextSibling: false, + previousSibling: true + }, { + id: '7-A', + hasParent: true, + nextSibling: true, + previousSibling: false + }, { + id: '7-B', + hasParent: true, + nextSibling: false, + previousSibling: true + }]); + }; + + _class5.prototype['@test lifecycle hooks have proper access to this.$()'] = function testLifecycleHooksHaveProperAccessToThis$(assert) { + assert.expect(6); + var component = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'div', + init: function () { + assert.notOk(this.$(), 'no access to element via this.$() on init() enter'); + this._super.apply(this, arguments); + assert.notOk(this.$(), 'no access to element via this.$() after init() finished'); + }, + willInsertElement: function () { + component = this; + assert.ok(this.$(), 'willInsertElement has access to element via this.$()'); + }, + didInsertElement: function () { + assert.ok(this.$(), 'didInsertElement has access to element via this.$()'); + }, + willDestroyElement: function () { + assert.ok(this.$(), 'willDestroyElement has access to element via this.$()'); + }, + didDestroyElement: function () { + assert.notOk(this.$(), 'didDestroyElement does not have access to element via this.$()'); + } + }); + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + var owner = this.owner; + + var comp = owner.lookup('component:foo-bar'); + _internalTestHelpers.runAppend(comp); + this.runTask(function () { + return _emberUtils.tryInvoke(component, 'destroy'); + }); + }; + + return _class5; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + function assertDestroyHooks(assert, _actual, _expected) { + _expected.forEach(function (expected, i) { + var name = expected.name; + assert.equal(expected.id, _actual[i].id, name + ' id is the same'); + assert.equal(expected.hasParent, _actual[i].hasParent, name + ' has parent node'); + assert.equal(expected.nextSibling, _actual[i].nextSibling, name + ' has next sibling node'); + assert.equal(expected.previousSibling, _actual[i].previousSibling, name + ' has previous sibling node'); + }); + } + + function bind(func, thisArg) { + return function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return func.apply(thisArg, args); + }; + } + + function string(value) { + return { isString: true, value: value }; + } + + function expr(value) { + return { isExpr: true, value: value }; + } + + function hook(name, hook, args) { + return { name: name, hook: hook, args: args }; + } + + function json(serializable) { + return JSON.parse(JSON.stringify(serializable)); + } +}); + +// Sync hooks + +// Async hooks + +// Sync hooks + +// Async hooks +enifed('ember-glimmer/tests/integration/components/life-cycle-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/life-cycle-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/life-cycle-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/life-cycle-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/life-cycle-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/life-cycle-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/link-to-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-runtime', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/test-helpers'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberRuntime, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsTestHelpers) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Link-to component', (function (_ApplicationTest) { + babelHelpers.inherits(_class, _ApplicationTest); + + function _class() { + _ApplicationTest.apply(this, arguments); + } + + _class.prototype.visitWithDeprecation = function visitWithDeprecation(path, deprecation) { + var _this = this; + + var p = undefined; + + expectDeprecation(function () { + p = _this.visit(path); + }, deprecation); + + return p; + }; + + _class.prototype['@test accessing `currentWhen` triggers a deprecation'] = function testAccessingCurrentWhenTriggersADeprecation(assert) { + var component = undefined; + this.registerComponent('link-to', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.LinkComponent.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + } + }) + }); + + this.registerTemplate('application', '{{link-to \'Index\' \'index\'}}'); + + return this.visit('/').then(function () { + expectDeprecation(function () { + component.get('currentWhen'); + }, /Usage of `currentWhen` is deprecated, use `current-when` instead/); + }); + }; + + _class.prototype['@test should be able to be inserted in DOM when the router is not present'] = function testShouldBeAbleToBeInsertedInDOMWhenTheRouterIsNotPresent() { + var _this2 = this; + + this.registerTemplate('application', '{{#link-to \'index\'}}Go to Index{{/link-to}}'); + + return this.visit('/').then(function () { + _this2.assertText('Go to Index'); + }); + }; + + _class.prototype['@test re-renders when title changes'] = function testReRendersWhenTitleChanges() { + var _this3 = this; + + var controller = undefined; + + this.registerTemplate('application', '{{link-to title routeName}}'); + this.registerController('application', _emberRuntime.Controller.extend({ + init: function () { + this._super.apply(this, arguments); + controller = this; + }, + title: 'foo', + routeName: 'index' + })); + + return this.visit('/').then(function () { + _this3.assertText('foo'); + _this3.runTask(function () { + return _emberMetal.set(controller, 'title', 'bar'); + }); + _this3.assertText('bar'); + }); + }; + + _class.prototype['@test escaped inline form (double curlies) escapes link title'] = function testEscapedInlineFormDoubleCurliesEscapesLinkTitle() { + var _this4 = this; + + this.registerTemplate('application', '{{link-to title \'index\'}}'); + this.registerController('application', _emberRuntime.Controller.extend({ + title: 'blah' + })); + + return this.visit('/').then(function () { + _this4.assertText('blah'); + }); + }; + + _class.prototype['@test escaped inline form with (-html-safe) does not escape link title'] = function testEscapedInlineFormWithHtmlSafeDoesNotEscapeLinkTitle(assert) { + var _this5 = this; + + this.registerTemplate('application', '{{link-to (-html-safe title) \'index\'}}'); + this.registerController('application', _emberRuntime.Controller.extend({ + title: 'blah' + })); + + return this.visit('/').then(function () { + _this5.assertText('blah'); + assert.equal(_this5.$('b').length, 1); + }); + }; + + _class.prototype['@test unescaped inline form (triple curlies) does not escape link title'] = function testUnescapedInlineFormTripleCurliesDoesNotEscapeLinkTitle(assert) { + var _this6 = this; + + this.registerTemplate('application', '{{{link-to title \'index\'}}}'); + this.registerController('application', _emberRuntime.Controller.extend({ + title: 'blah' + })); + + return this.visit('/').then(function () { + _this6.assertText('blah'); + assert.equal(_this6.$('b').length, 1); + }); + }; + + _class.prototype['@test unwraps controllers'] = function testUnwrapsControllers() { + var _this7 = this; + + this.router.map(function () { + this.route('profile', { path: '/profile/:id' }); + }); + this.registerTemplate('application', '{{#link-to \'profile\' otherController}}Text{{/link-to}}'); + this.registerController('application', _emberRuntime.Controller.extend({ + otherController: _emberRuntime.Controller.create({ + model: 'foo' + }) + })); + + var deprecation = /Providing `{{link-to}}` with a param that is wrapped in a controller is deprecated./; + + return this.visitWithDeprecation('/', deprecation).then(function () { + _this7.assertText('Text'); + }); + }; + + _class.prototype['@test able to safely extend the built-in component and use the normal path'] = function testAbleToSafelyExtendTheBuiltInComponentAndUseTheNormalPath() { + var _this8 = this; + + this.registerComponent('custom-link-to', { ComponentClass: _emberGlimmerTestsUtilsHelpers.LinkComponent.extend() }); + this.registerTemplate('application', '{{#custom-link-to \'index\'}}{{title}}{{/custom-link-to}}'); + this.registerController('application', _emberRuntime.Controller.extend({ + title: 'Hello' + })); + + return this.visit('/').then(function () { + _this8.assertText('Hello'); + }); + }; + + _class.prototype['@test [GH#13432] able to safely extend the built-in component and invoke it inline'] = function testGH13432AbleToSafelyExtendTheBuiltInComponentAndInvokeItInline() { + var _this9 = this; + + this.registerComponent('custom-link-to', { ComponentClass: _emberGlimmerTestsUtilsHelpers.LinkComponent.extend() }); + this.registerTemplate('application', '{{custom-link-to title \'index\'}}'); + this.registerController('application', _emberRuntime.Controller.extend({ + title: 'Hello' + })); + + return this.visit('/').then(function () { + _this9.assertText('Hello'); + }); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.ApplicationTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Link-to component with query-params', (function (_ApplicationTest2) { + babelHelpers.inherits(_class2, _ApplicationTest2); + + function _class2() { + _ApplicationTest2.apply(this, arguments); + + this.registerController('index', _emberRuntime.Controller.extend({ + queryParams: ['foo'], + foo: '123', + bar: 'yes' + })); + } + + _class2.prototype['@test populates href with fully supplied query param values'] = function testPopulatesHrefWithFullySuppliedQueryParamValues(assert) { + var _this10 = this; + + this.registerTemplate('index', '{{#link-to \'index\' (query-params foo=\'456\' bar=\'NAW\')}}Index{{/link-to}}'); + + return this.visit('/').then(function () { + _this10.assertComponentElement(_this10.firstChild.firstElementChild, { + tagName: 'a', + attrs: { href: '/?bar=NAW&foo=456' }, + content: 'Index' + }); + }); + }; + + _class2.prototype['@test populates href with partially supplied query param values, but omits if value is default value'] = function testPopulatesHrefWithPartiallySuppliedQueryParamValuesButOmitsIfValueIsDefaultValue() { + var _this11 = this; + + this.registerTemplate('index', '{{#link-to \'index\' (query-params foo=\'123\')}}Index{{/link-to}}'); + + return this.visit('/').then(function () { + _this11.assertComponentElement(_this11.firstChild.firstElementChild, { + tagName: 'a', + attrs: { href: '/', class: _emberGlimmerTestsUtilsTestHelpers.classes('ember-view active') }, + content: 'Index' + }); + }); + }; + + return _class2; + })(_emberGlimmerTestsUtilsTestCase.ApplicationTest)); +}); +enifed('ember-glimmer/tests/integration/components/link-to-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/link-to-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/link-to-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/link-to-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/link-to-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/link-to-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/local-lookup-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers) { + 'use strict'; + + function buildResolver() { + var resolver = { + resolve: function () {}, + expandLocalLookup: function (fullName, sourceFullName) { + var _sourceFullName$split = sourceFullName.split(':'); + + var sourceType = _sourceFullName$split[0]; + var sourceName = _sourceFullName$split[1]; + + var _fullName$split = fullName.split(':'); + + var type = _fullName$split[0]; + var name = _fullName$split[1]; + + if (type !== 'template' && sourceType === 'template' && sourceName.slice(0, 11) === 'components/') { + sourceName = sourceName.slice(11); + } + + if (type === 'template' && sourceType === 'template' && name.slice(0, 11) === 'components/') { + name = name.slice(11); + } + + var result = type + ':' + sourceName + '/' + name; + + return result; + } + }; + + return resolver; + } + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: local lookup', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype.getResolver = function getResolver() { + return buildResolver(); + }; + + _class.prototype['@test it can lookup a local template'] = function testItCanLookupALocalTemplate() { + var _this = this; + + this.registerComponent('x-outer/x-inner', { template: 'Nested template says: {{yield}}' }); + this.registerComponent('x-outer', { template: '{{#x-inner}}Hi!{{/x-inner}}' }); + + this.render('{{x-outer}}'); + + this.assertText('Nested template says: Hi!', 'Initial render works'); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertText('Nested template says: Hi!', 'Re-render works'); + }; + + _class.prototype['@test tagless blockless component can lookup local template'] = function testTaglessBlocklessComponentCanLookupLocalTemplate() { + var _this2 = this; + + this.registerComponent('x-outer/x-inner', { template: 'Nested template says: {{yield}}' }); + this.registerTemplate('components/x-outer', '{{#x-inner}}Hi!{{/x-inner}}'); + this.registerComponent('x-outer', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ tagName: '' }) + }); + + this.render('{{x-outer}}'); + + this.assertText('Nested template says: Hi!', 'Re-render works'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertText('Nested template says: Hi!', 'Re-render works'); + }; + + _class.prototype['@test it can lookup a local component template'] = function testItCanLookupALocalComponentTemplate() { + var _this3 = this; + + this.registerTemplate('components/x-outer/x-inner', 'Nested template says: {{yield}}'); + this.registerTemplate('components/x-outer', '{{#x-inner}}Hi!{{/x-inner}}'); + + this.render('{{x-outer}}'); + + this.assertText('Nested template says: Hi!', 'Initial render works'); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertText('Nested template says: Hi!', 'Re-render works'); + }; + + _class.prototype['@test it can local lookup a dynamic component'] = function testItCanLocalLookupADynamicComponent() { + var _this4 = this; + + this.registerComponent('foo-bar', { template: 'yall finished {{component child}}' }); + this.registerComponent('foo-bar/biz-baz', { template: 'or yall done?' }); + + this.render('{{foo-bar child=child}}', { child: 'biz-baz' }); + + this.assertText('yall finished or yall done?'); + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assertText('yall finished or yall done?'); + }; + + _class.prototype['@test it can local lookup a dynamic component from a dynamic component'] = function testItCanLocalLookupADynamicComponentFromADynamicComponent() { + var _this5 = this; + + this.registerComponent('foo-bar', { template: 'yall finished {{component child}}' }); + this.registerComponent('foo-bar/biz-baz', { template: 'or yall done?' }); + + this.render('{{component componentName child=child}}', { componentName: 'foo-bar', child: 'biz-baz' }); + + this.assertText('yall finished or yall done?'); + + this.runTask(function () { + return _this5.rerender(); + }); + + this.assertText('yall finished or yall done?'); + }; + + _class.prototype['@test it can local lookup a dynamic component from a passed named argument'] = function testItCanLocalLookupADynamicComponentFromAPassedNamedArgument() { + var _this6 = this; + + this.registerComponent('parent-foo', { template: 'yall finished {{global-biz baz=(component \'local-bar\')}}' }); + this.registerComponent('global-biz', { template: 'or {{component baz}}' }); + this.registerComponent('parent-foo/local-bar', { template: 'yall done?' }); + + this.render('{{parent-foo}}'); + + this.assertText('yall finished or yall done?'); + + this.runTask(function () { + return _this6.rerender(); + }); + + this.assertText('yall finished or yall done?'); + }; + + _class.prototype['@test it can local lookup a re-wrapped dynamic component from a passed named argument'] = function testItCanLocalLookupAReWrappedDynamicComponentFromAPassedNamedArgument() { + var _this7 = this; + + this.registerComponent('parent-foo', { template: 'yall finished {{global-x comp=(component \'local-bar\')}}' }); + this.registerComponent('global-x', { template: 'or {{global-y comp=(component comp phrase=\'done\')}}' }); + this.registerComponent('global-y', { template: '{{component comp}}?' }); + this.registerComponent('parent-foo/local-bar', { template: 'yall {{phrase}}' }); + + this.render('{{parent-foo}}'); + + this.assertText('yall finished or yall done?'); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertText('yall finished or yall done?'); + }; + + _class.prototype['@test it can nest local lookups of dynamic components from a passed named argument'] = function testItCanNestLocalLookupsOfDynamicComponentsFromAPassedNamedArgument() { + var _this8 = this; + + this.registerComponent('parent-foo', { template: 'yall finished {{global-x comp=(component \'local-bar\')}}' }); + this.registerComponent('global-x', { template: 'or {{global-y comp=(component comp phrase=\'done\')}}' }); + this.registerComponent('global-y', { template: '{{component comp}}{{component \'local-bar\'}}' }); + this.registerComponent('parent-foo/local-bar', { template: 'yall {{phrase}}' }); + this.registerComponent('global-y/local-bar', { template: '?' }); + + this.render('{{parent-foo}}'); + + this.assertText('yall finished or yall done?'); + + this.runTask(function () { + return _this8.rerender(); + }); + + this.assertText('yall finished or yall done?'); + }; + + _class.prototype['@test it can switch from local to global lookups of dynamic components from a passed named argument'] = function testItCanSwitchFromLocalToGlobalLookupsOfDynamicComponentsFromAPassedNamedArgument() { + var _this9 = this; + + this.registerComponent('parent-foo', { template: 'yall finished {{global-x comp=(component bar)}}' }); + this.registerComponent('global-x', { template: 'or yall {{component comp}}' }); + this.registerComponent('parent-foo/local-bar', { template: 'done?' }); + this.registerComponent('global-bar', { template: 'ready?' }); + + this.render('{{parent-foo bar=bar}}', { bar: 'local-bar' }); + + this.assertText('yall finished or yall done?'); + + this.runTask(function () { + return _this9.context.set('bar', 'global-bar'); + }); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertText('yall finished or yall ready?'); + }; + + _class.prototype['@test it can lookup a local helper'] = function testItCanLookupALocalHelper() { + var _this10 = this; + + this.registerHelper('x-outer/x-helper', function () { + return 'Who dis?'; + }); + this.registerComponent('x-outer', { template: 'Who dat? {{x-helper}}' }); + + this.render('{{x-outer}}'); + + this.assertText('Who dat? Who dis?', 'Initial render works'); + + this.runTask(function () { + return _this10.rerender(); + }); + + this.assertText('Who dat? Who dis?', 'Re-render works'); + }; + + _class.prototype['@test it overrides global helper lookup'] = function testItOverridesGlobalHelperLookup() { + var _this11 = this; + + this.registerHelper('x-outer/x-helper', function () { + return 'Who dis?'; + }); + + this.registerHelper('x-helper', function () { + return 'I dunno'; + }); + + this.registerComponent('x-outer', { template: 'Who dat? {{x-helper}}' }); + + this.render('{{x-outer}} {{x-helper}}'); + + this.assertText('Who dat? Who dis? I dunno', 'Initial render works'); + + this.runTask(function () { + return _this11.rerender(); + }); + + this.assertText('Who dat? Who dis? I dunno', 'Re-render works'); + }; + + _class.prototype['@test lookup without match issues standard assertion (with local helper name)'] = function testLookupWithoutMatchIssuesStandardAssertionWithLocalHelperName() { + var _this12 = this; + + this.registerComponent('x-outer', { template: '{{#x-inner}}Hi!{{/x-inner}}' }); + + expectAssertion(function () { + _this12.render('{{x-outer}}'); + }, /A component or helper named "x-inner" could not be found/); + }; + + _class.prototype['@test overrides global lookup'] = function testOverridesGlobalLookup() { + var _this13 = this; + + this.registerComponent('x-outer', { template: '{{#x-inner}}Hi!{{/x-inner}}' }); + this.registerComponent('x-outer/x-inner', { template: 'Nested template says (from local): {{yield}}' }); + this.registerComponent('x-inner', { template: 'Nested template says (from global): {{yield}}' }); + + this.render('{{#x-inner}}Hi!{{/x-inner}} {{x-outer}} {{#x-outer/x-inner}}Hi!{{/x-outer/x-inner}}'); + + this.assertText('Nested template says (from global): Hi! Nested template says (from local): Hi! Nested template says (from local): Hi!'); + + this.runTask(function () { + return _this13.rerender(); + }); + + this.assertText('Nested template says (from global): Hi! Nested template says (from local): Hi! Nested template says (from local): Hi!'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/components/local-lookup-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/local-lookup-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/local-lookup-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/local-lookup-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/local-lookup-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/local-lookup-test.js should pass jshint.'); + }); +}); +enifed("ember-glimmer/tests/integration/components/render-to-element-test", ["exports"], function (exports) { + "use strict"; +}); +enifed('ember-glimmer/tests/integration/components/render-to-element-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/render-to-element-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/render-to-element-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/render-to-element-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/render-to-element-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/render-to-element-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/target-action-test', ['exports', 'ember-utils', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-runtime', 'ember-routing'], function (exports, _emberUtils, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberRuntime, _emberRouting) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{#component-a}}\n {{component-b bar="derp"}}\n {{/component-a}}\n '], ['\n {{#component-a}}\n {{component-b bar="derp"}}\n {{/component-a}}\n ']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: sendAction', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.call(this); + this.actionCounts = {}; + this.sendCount = 0; + this.actionArguments = null; + + var self = this; + + this.registerComponent('action-delegate', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + self.delegate = this; + this.name = 'action-delegate'; + } + }) + }); + } + + _class.prototype.renderDelegate = function renderDelegate() { + var template = arguments.length <= 0 || arguments[0] === undefined ? '{{action-delegate}}' : arguments[0]; + var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + var root = this; + context = _emberUtils.assign(context, { + send: function (actionName) { + root.sendCount++; + root.actionCounts[actionName] = root.actionCounts[actionName] || 0; + root.actionCounts[actionName]++; + + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + root.actionArguments = args; + } + }); + this.render(template, context); + }; + + _class.prototype.assertSendCount = function assertSendCount(count) { + this.assert.equal(this.sendCount, count, 'Send was called ' + count + ' time(s)'); + }; + + _class.prototype.assertNamedSendCount = function assertNamedSendCount(actionName, count) { + this.assert.equal(this.actionCounts[actionName], count, 'An action named \'' + actionName + '\' was sent ' + count + ' times'); + }; + + _class.prototype.assertSentWithArgs = function assertSentWithArgs(expected) { + var message = arguments.length <= 1 || arguments[1] === undefined ? 'arguments were sent with the action' : arguments[1]; + + this.assert.deepEqual(this.actionArguments, expected, message); + }; + + _class.prototype['@test Calling sendAction on a component without an action defined does nothing'] = function testCallingSendActionOnAComponentWithoutAnActionDefinedDoesNothing() { + var _this = this; + + this.renderDelegate(); + + this.runTask(function () { + return _this.delegate.sendAction(); + }); + + this.assertSendCount(0); + }; + + _class.prototype['@test Calling sendAction on a component with an action defined calls send on the controller'] = function testCallingSendActionOnAComponentWithAnActionDefinedCallsSendOnTheController() { + var _this2 = this; + + this.renderDelegate(); + + this.runTask(function () { + _emberMetal.set(_this2.delegate, 'action', 'addItem'); + _this2.delegate.sendAction(); + }); + + this.assertSendCount(1); + this.assertNamedSendCount('addItem', 1); + }; + + _class.prototype['@test Calling sendAction on a component with a function calls the function'] = function testCallingSendActionOnAComponentWithAFunctionCallsTheFunction() { + var _this3 = this; + + this.assert.expect(1); + + this.renderDelegate(); + + this.runTask(function () { + _emberMetal.set(_this3.delegate, 'action', function () { + return _this3.assert.ok(true, 'function is called'); + }); + _this3.delegate.sendAction(); + }); + }; + + _class.prototype['@test Calling sendAction on a component with a function calls the function with arguments'] = function testCallingSendActionOnAComponentWithAFunctionCallsTheFunctionWithArguments() { + var _this4 = this; + + this.assert.expect(1); + var argument = {}; + + this.renderDelegate(); + + this.runTask(function () { + _emberMetal.set(_this4.delegate, 'action', function (actualArgument) { + _this4.assert.deepEqual(argument, actualArgument, 'argument is passed'); + }); + _this4.delegate.sendAction('action', argument); + }); + }; + + // TODO consolidate these next 2 tests + + _class.prototype['@test Calling sendAction on a component with a reference attr calls the function with arguments'] = function testCallingSendActionOnAComponentWithAReferenceAttrCallsTheFunctionWithArguments() { + var _this5 = this; + + this.renderDelegate('{{action-delegate playing=playing}}', { + playing: null + }); + + this.runTask(function () { + return _this5.delegate.sendAction(); + }); + + this.assertSendCount(0); + + this.runTask(function () { + _emberMetal.set(_this5.context, 'playing', 'didStartPlaying'); + }); + + this.runTask(function () { + _this5.delegate.sendAction('playing'); + }); + + this.assertSendCount(1); + this.assertNamedSendCount('didStartPlaying', 1); + }; + + _class.prototype['@test Calling sendAction on a component with a {{mut}} attr calls the function with arguments'] = function testCallingSendActionOnAComponentWithAMutAttrCallsTheFunctionWithArguments() { + var _this6 = this; + + this.renderDelegate('{{action-delegate playing=(mut playing)}}', { + playing: null + }); + + this.runTask(function () { + return _this6.delegate.sendAction('playing'); + }); + + this.assertSendCount(0); + + this.runTask(function () { + return _this6.delegate.attrs.playing.update('didStartPlaying'); + }); + this.runTask(function () { + return _this6.delegate.sendAction('playing'); + }); + + this.assertSendCount(1); + this.assertNamedSendCount('didStartPlaying', 1); + }; + + _class.prototype['@test Calling sendAction with a named action uses the component\'s property as the action name'] = function testCallingSendActionWithANamedActionUsesTheComponentSPropertyAsTheActionName() { + var _this7 = this; + + this.renderDelegate(); + + var component = this.delegate; + + this.runTask(function () { + _emberMetal.set(_this7.delegate, 'playing', 'didStartPlaying'); + component.sendAction('playing'); + }); + + this.assertSendCount(1); + this.assertNamedSendCount('didStartPlaying', 1); + + this.runTask(function () { + return component.sendAction('playing'); + }); + + this.assertSendCount(2); + this.assertNamedSendCount('didStartPlaying', 2); + + this.runTask(function () { + _emberMetal.set(component, 'action', 'didDoSomeBusiness'); + component.sendAction(); + }); + + this.assertSendCount(3); + this.assertNamedSendCount('didDoSomeBusiness', 1); + }; + + _class.prototype['@test Calling sendAction when the action name is not a string raises an exception'] = function testCallingSendActionWhenTheActionNameIsNotAStringRaisesAnException() { + var _this8 = this; + + this.renderDelegate(); + + this.runTask(function () { + _emberMetal.set(_this8.delegate, 'action', {}); + _emberMetal.set(_this8.delegate, 'playing', {}); + }); + + expectAssertion(function () { + return _this8.delegate.sendAction(); + }); + expectAssertion(function () { + return _this8.delegate.sendAction('playing'); + }); + }; + + _class.prototype['@test Calling sendAction on a component with contexts'] = function testCallingSendActionOnAComponentWithContexts() { + var _this9 = this; + + this.renderDelegate(); + + var testContext = { song: 'She Broke My Ember' }; + var firstContext = { song: 'She Broke My Ember' }; + var secondContext = { song: 'My Achey Breaky Ember' }; + + this.runTask(function () { + _emberMetal.set(_this9.delegate, 'playing', 'didStartPlaying'); + _this9.delegate.sendAction('playing', testContext); + }); + + this.assertSendCount(1); + this.assertNamedSendCount('didStartPlaying', 1); + this.assertSentWithArgs([testContext], 'context was sent with the action'); + + this.runTask(function () { + _this9.delegate.sendAction('playing', firstContext, secondContext); + }); + + this.assertSendCount(2); + this.assertNamedSendCount('didStartPlaying', 2); + this.assertSentWithArgs([firstContext, secondContext], 'multiple contexts were sent to the action'); + }; + + _class.prototype['@test calling sendAction on a component within a block sends to the outer scope GH#14216'] = function testCallingSendActionOnAComponentWithinABlockSendsToTheOuterScopeGH14216(assert) { + var testContext = this; + // overrides default action-delegate so actions can be added + this.registerComponent('action-delegate', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + testContext.delegate = this; + this.name = 'action-delegate'; + }, + + actions: { + derp: function (arg1) { + assert.ok(true, 'action called on action-delgate'); + assert.equal(arg1, 'something special', 'argument passed through properly'); + } + } + }), + + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject) + }); + + this.registerComponent('component-a', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + this.name = 'component-a'; + }, + actions: { + derp: function () { + assert.ok(false, 'no! bad scoping!'); + } + } + }) + }); + + var innerChild = undefined; + this.registerComponent('component-b', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerChild = this; + this.name = 'component-b'; + } + }) + }); + + this.renderDelegate(); + + this.runTask(function () { + return innerChild.sendAction('bar', 'something special'); + }); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: sendAction to a controller', (function (_ApplicationTest) { +babelHelpers.inherits(_class2, _ApplicationTest); + + function _class2() { + _ApplicationTest.apply(this, arguments); + } + + _class2.prototype['@test sendAction should trigger an action on the parent component\'s controller if it exists'] = function testSendActionShouldTriggerAnActionOnTheParentComponentSControllerIfItExists(assert) { + var _this10 = this; + + assert.expect(15); + + var component = undefined; + + this.router.map(function () { + this.route('a'); + this.route('b'); + this.route('c', function () { + this.route('d'); + this.route('e'); + }); + }); + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + } + }), + template: '{{val}}' + }); + + this.registerController('a', _emberRuntime.Controller.extend({ + send: function (actionName, actionContext) { + assert.equal(actionName, 'poke', 'send() method was invoked from a top level controller'); + assert.equal(actionContext, 'top', 'action arguments were passed into the top level controller'); + } + })); + this.registerTemplate('a', '{{foo-bar val="a" poke="poke"}}'); + + this.registerRoute('b', _emberRouting.Route.extend({ + actions: { + poke: function (actionContext) { + assert.ok(true, 'Unhandled action sent to route'); + assert.equal(actionContext, 'top no controller'); + } + } + })); + this.registerTemplate('b', '{{foo-bar val="b" poke="poke"}}'); + + this.registerRoute('c', _emberRouting.Route.extend({ + actions: { + poke: function (actionContext) { + assert.ok(true, 'Unhandled action sent to route'); + assert.equal(actionContext, 'top with nested no controller'); + } + } + })); + this.registerTemplate('c', '{{foo-bar val="c" poke="poke"}}{{outlet}}'); + + this.registerRoute('c.d', _emberRouting.Route.extend({})); + + this.registerController('c.d', _emberRuntime.Controller.extend({ + send: function (actionName, actionContext) { + assert.equal(actionName, 'poke', 'send() method was invoked from a nested controller'); + assert.equal(actionContext, 'nested', 'action arguments were passed into the nested controller'); + } + })); + this.registerTemplate('c.d', '{{foo-bar val=".d" poke="poke"}}'); + + this.registerRoute('c.e', _emberRouting.Route.extend({ + actions: { + poke: function (actionContext) { + assert.ok(true, 'Unhandled action sent to route'); + assert.equal(actionContext, 'nested no controller'); + } + } + })); + this.registerTemplate('c.e', '{{foo-bar val=".e" poke="poke"}}'); + + return this.visit('/a').then(function () { + return component.sendAction('poke', 'top'); + }).then(function () { + _this10.assertText('a'); + return _this10.visit('/b'); + }).then(function () { + return component.sendAction('poke', 'top no controller'); + }).then(function () { + _this10.assertText('b'); + return _this10.visit('/c'); + }).then(function () { + return component.sendAction('poke', 'top with nested no controller'); + }).then(function () { + _this10.assertText('c'); + return _this10.visit('/c/d'); + }).then(function () { + return component.sendAction('poke', 'nested'); + }).then(function () { + _this10.assertText('c.d'); + return _this10.visit('/c/e'); + }).then(function () { + return component.sendAction('poke', 'nested no controller'); + }).then(function () { + return _this10.assertText('c.e'); + }); + }; + + _class2.prototype['@test sendAction should not trigger an action in an outlet\'s controller if a parent component handles it'] = function testSendActionShouldNotTriggerAnActionInAnOutletSControllerIfAParentComponentHandlesIt(assert) { + assert.expect(1); + + var component = undefined; + + this.registerComponent('x-parent', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + poke: function () { + assert.ok(true, 'parent component handled the aciton'); + } + } + }), + template: '{{x-child poke="poke"}}' + }); + + this.registerComponent('x-child', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + } + }) + }); + + this.registerTemplate('application', '{{x-parent}}'); + this.registerController('application', _emberRuntime.Controller.extend({ + send: function (actionName) { + throw new Error('controller action should not be called'); + } + })); + + return this.visit('/').then(function () { + return component.sendAction('poke'); + }); + }; + + return _class2; + })(_emberGlimmerTestsUtilsTestCase.ApplicationTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: sendAction of a closure action', (function (_RenderingTest2) { +babelHelpers.inherits(_class3, _RenderingTest2); + + function _class3() { + _RenderingTest2.apply(this, arguments); + } + + _class3.prototype['@test action should be called'] = function testActionShouldBeCalled(assert) { + assert.expect(1); + var component = undefined; + + this.registerComponent('inner-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + } + }), + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + outerSubmit: function () { + assert.ok(true, 'outerSubmit called'); + } + }), + template: '{{inner-component submitAction=(action outerSubmit)}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + return component.sendAction('submitAction'); + }); + }; + + _class3.prototype['@test contexts passed to sendAction are appended to the bound arguments on a closure action'] = function testContextsPassedToSendActionAreAppendedToTheBoundArgumentsOnAClosureAction() { + var first = 'mitch'; + var second = 'martin'; + var third = 'matt'; + var fourth = 'wacky wycats'; + + var innerComponent = undefined; + var actualArgs = undefined; + + this.registerComponent('inner-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + } + }), + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + third: third, + actions: { + outerSubmit: function () { + actualArgs = [].concat(babelHelpers.slice.call(arguments)); + } + } + }), + template: '{{inner-component innerSubmit=(action (action "outerSubmit" "' + first + '") "' + second + '" third)}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + return innerComponent.sendAction('innerSubmit', fourth); + }); + + this.assert.deepEqual(actualArgs, [first, second, third, fourth], 'action has the correct args'); + }; + + return _class3; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: send', (function (_RenderingTest3) { +babelHelpers.inherits(_class4, _RenderingTest3); + + function _class4() { + _RenderingTest3.apply(this, arguments); + } + + _class4.prototype['@test sending to undefined actions triggers an error'] = function testSendingToUndefinedActionsTriggersAnError(assert) { + assert.expect(2); + + var component = undefined; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + component = this; + }, + actions: { + foo: function (message) { + assert.equal('bar', message); + } + } + }) + }); + + this.render('{{foo-bar}}'); + + this.runTask(function () { + return component.send('foo', 'bar'); + }); + + expectAssertion(function () { + return component.send('baz', 'bar'); + }, /had no action handler for: baz/); + }; + + _class4.prototype['@test `send` will call send from a target if it is defined'] = function testSendWillCallSendFromATargetIfItIsDefined() { + var _this11 = this; + + var component = undefined; + var target = { + send: function (message, payload) { + _this11.assert.equal('foo', message); + _this11.assert.equal('baz', payload); + } + }; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + component = this; + }, + target: target + }) + }); + + this.render('{{foo-bar}}'); + + this.runTask(function () { + return component.send('foo', 'baz'); + }); + }; + + _class4.prototype['@test a handled action can be bubbled to the target for continued processing'] = function testAHandledActionCanBeBubbledToTheTargetForContinuedProcessing() { + var _this12 = this; + + this.assert.expect(2); + + var component = undefined; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + actions: { + poke: function () { + _this12.assert.ok(true, 'component action called'); + return true; + } + }, + target: _emberRuntime.Controller.extend({ + actions: { + poke: function () { + _this12.assert.ok(true, 'action bubbled to controller'); + } + } + }).create() + }) + }); + + this.render('{{foo-bar poke="poke"}}'); + + this.runTask(function () { + return component.send('poke'); + }); + }; + + _class4.prototype['@test action can be handled by a superclass\' actions object'] = function testActionCanBeHandledByASuperclassActionsObject(assert) { + this.assert.expect(4); + + var component = undefined; + + var SuperComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + foo: function () { + assert.ok(true, 'foo'); + }, + bar: function (msg) { + assert.equal(msg, 'HELLO'); + } + } + }); + + var BarViewMixin = _emberMetal.Mixin.create({ + actions: { + bar: function (msg) { + assert.equal(msg, 'HELLO'); + this._super(msg); + } + } + }); + + this.registerComponent('x-index', { + ComponentClass: SuperComponent.extend(BarViewMixin, { + init: function () { + this._super.apply(this, arguments); + component = this; + }, + actions: { + baz: function () { + assert.ok(true, 'baz'); + } + } + }) + }); + + this.render('{{x-index}}'); + + this.runTask(function () { + component.send('foo'); + component.send('bar', 'HELLO'); + component.send('baz'); + }); + }; + + _class4.prototype['@test actions cannot be provided at create time'] = function testActionsCannotBeProvidedAtCreateTime(assert) { + expectAssertion(function () { + return _emberGlimmerTestsUtilsHelpers.Component.create({ + actions: { + foo: function () { + assert.ok(true, 'foo'); + } + } + }); + }); + // but should be OK on an object that doesn't mix in Ember.ActionHandler + _emberRuntime.Object.create({ + actions: ['foo'] + }); + }; + + return _class4; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/components/target-action-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/target-action-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/target-action-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/target-action-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/target-action-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/target-action-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/utils-test', ['exports', 'ember-runtime', 'ember-views', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberRuntime, _emberViews, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('View tree tests', (function (_ApplicationTest) { + babelHelpers.inherits(_class, _ApplicationTest); + + function _class() { + _ApplicationTest.call(this); + + this.registerComponent('x-tagless', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '' + }), + + template: '
    [{{id}}] {{#if isShowing}}{{yield}}{{/if}}
    ' + }); + + this.registerComponent('x-toggle', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + isExpanded: true, + + click: function () { + this.toggleProperty('isExpanded'); + return false; + } + }), + + template: '[{{id}}] {{#if isExpanded}}{{yield}}{{/if}}' + }); + + var ToggleController = _emberRuntime.Controller.extend({ + isExpanded: true, + + actions: { + toggle: function () { + this.toggleProperty('isExpanded'); + } + } + }); + + this.registerController('application', ToggleController); + + this.registerTemplate('application', '\n {{x-tagless id="root-1"}}\n\n {{#x-toggle id="root-2"}}\n {{x-toggle id="inner-1"}}\n\n {{#x-toggle id="inner-2"}}\n {{x-toggle id="inner-3"}}\n {{/x-toggle}}\n {{/x-toggle}}\n\n \n\n {{#if isExpanded}}\n {{x-toggle id="root-3"}}\n {{/if}}\n\n {{outlet}}\n '); + + this.registerController('index', ToggleController.extend({ + isExpanded: false + })); + + this.registerTemplate('index', '\n {{x-tagless id="root-4"}}\n\n {{#x-toggle id="root-5" isExpanded=false}}\n {{x-toggle id="inner-4"}}\n\n {{#x-toggle id="inner-5"}}\n {{x-toggle id="inner-6"}}\n {{/x-toggle}}\n {{/x-toggle}}\n\n \n\n {{#if isExpanded}}\n {{x-toggle id="root-6"}}\n {{/if}}\n '); + + this.registerTemplate('zomg', '\n {{x-tagless id="root-7"}}\n\n {{#x-toggle id="root-8"}}\n {{x-toggle id="inner-7"}}\n\n {{#x-toggle id="inner-8"}}\n {{x-toggle id="inner-9"}}\n {{/x-toggle}}\n {{/x-toggle}}\n\n {{#x-toggle id="root-9"}}\n {{outlet}}\n {{/x-toggle}}\n '); + + this.registerTemplate('zomg.lol', '\n {{x-toggle id="inner-10"}}\n '); + + this.router.map(function () { + this.route('zomg', function () { + this.route('lol'); + }); + }); + } + + _class.prototype['@test getRootViews'] = function testGetRootViews(assert) { + var _this = this; + + return this.visit('/').then(function () { + _this.assertRootViews(['root-1', 'root-2', 'root-3', 'root-4', 'root-5']); + + _this.runTask(function () { + return _emberViews.jQuery('#toggle-application').click(); + }); + + _this.assertRootViews(['root-1', 'root-2', 'root-4', 'root-5']); + + _this.runTask(function () { + _emberViews.jQuery('#toggle-application').click(); + _emberViews.jQuery('#toggle-index').click(); + }); + + _this.assertRootViews(['root-1', 'root-2', 'root-3', 'root-4', 'root-5', 'root-6']); + + return _this.visit('/zomg/lol'); + }).then(function () { + _this.assertRootViews(['root-1', 'root-2', 'root-3', 'root-7', 'root-8', 'root-9']); + + return _this.visit('/'); + }).then(function () { + _this.assertRootViews(['root-1', 'root-2', 'root-3', 'root-4', 'root-5', 'root-6']); + }); + }; + + _class.prototype.assertRootViews = function assertRootViews(ids) { + var owner = this.applicationInstance; + + var actual = _emberViews.getRootViews(owner).map(function (view) { + return view.id; + }).sort(); + var expected = ids.sort(); + + this.assert.deepEqual(actual, expected, 'root views'); + }; + + _class.prototype['@test getChildViews'] = function testGetChildViews(assert) { + var _this2 = this; + + return this.visit('/').then(function () { + _this2.assertChildViews('root-2', ['inner-1', 'inner-2']); + _this2.assertChildViews('root-5', []); + _this2.assertChildViews('inner-2', ['inner-3']); + + _this2.runTask(function () { + return _emberViews.jQuery('#root-2').click(); + }); + + _this2.assertChildViews('root-2', []); + + _this2.runTask(function () { + return _emberViews.jQuery('#root-5').click(); + }); + + _this2.assertChildViews('root-5', ['inner-4', 'inner-5']); + _this2.assertChildViews('inner-5', ['inner-6']); + + return _this2.visit('/zomg'); + }).then(function () { + _this2.assertChildViews('root-2', []); + _this2.assertChildViews('root-8', ['inner-7', 'inner-8']); + _this2.assertChildViews('inner-8', ['inner-9']); + _this2.assertChildViews('root-9', []); + + _this2.runTask(function () { + return _emberViews.jQuery('#root-8').click(); + }); + + _this2.assertChildViews('root-8', []); + + return _this2.visit('/zomg/lol'); + }).then(function () { + _this2.assertChildViews('root-2', []); + _this2.assertChildViews('root-8', []); + _this2.assertChildViews('root-9', ['inner-10']); + + return _this2.visit('/'); + }).then(function () { + _this2.assertChildViews('root-2', []); + _this2.assertChildViews('root-5', []); + + _this2.runTask(function () { + return _emberViews.jQuery('#root-2').click(); + }); + _this2.runTask(function () { + return _emberViews.jQuery('#inner-2').click(); + }); + + _this2.assertChildViews('root-2', ['inner-1', 'inner-2']); + _this2.assertChildViews('inner-2', []); + }); + }; + + _class.prototype['@test getChildViews does not return duplicates'] = function testGetChildViewsDoesNotReturnDuplicates(assert) { + var _this3 = this; + + return this.visit('/').then(function () { + _this3.assertChildViews('root-2', ['inner-1', 'inner-2']); + + _this3.runTask(function () { + return _emberViews.jQuery('#root-2').click(); + }); + _this3.runTask(function () { + return _emberViews.jQuery('#root-2').click(); + }); + _this3.runTask(function () { + return _emberViews.jQuery('#root-2').click(); + }); + _this3.runTask(function () { + return _emberViews.jQuery('#root-2').click(); + }); + _this3.runTask(function () { + return _emberViews.jQuery('#root-2').click(); + }); + _this3.runTask(function () { + return _emberViews.jQuery('#root-2').click(); + }); + _this3.runTask(function () { + return _emberViews.jQuery('#root-2').click(); + }); + _this3.runTask(function () { + return _emberViews.jQuery('#root-2').click(); + }); + _this3.runTask(function () { + return _emberViews.jQuery('#root-2').click(); + }); + _this3.runTask(function () { + return _emberViews.jQuery('#root-2').click(); + }); + + _this3.assertChildViews('root-2', ['inner-1', 'inner-2']); + }); + }; + + _class.prototype.assertChildViews = function assertChildViews(parentId, childIds) { + var parentView = this.viewFor(parentId); + var childViews = _emberViews.getChildViews(parentView); + + var actual = childViews.map(function (view) { + return view.id; + }).sort(); + var expected = childIds.sort(); + + this.assert.deepEqual(actual, expected, 'child views for #' + parentId); + }; + + _class.prototype.viewFor = function viewFor(id) { + var owner = this.applicationInstance; + var registry = owner.lookup('-view-registry:main'); + return registry[id]; + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.ApplicationTest)); + + var hasGetClientRects = undefined, + hasGetBoundingClientRect = undefined; + var ClientRectListCtor = undefined, + ClientRectCtor = undefined; + + (function () { + if (document.createRange) { + var range = document.createRange(); + + if (range.getClientRects) { + var clientRectsList = range.getClientRects(); + hasGetClientRects = true; + ClientRectListCtor = clientRectsList && clientRectsList.constructor; + } + + if (range.getBoundingClientRect) { + var clientRect = range.getBoundingClientRect(); + hasGetBoundingClientRect = true; + ClientRectCtor = clientRect && clientRect.constructor; + } + } + })(); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Bounds tests', (function (_RenderingTest) { + babelHelpers.inherits(_class2, _RenderingTest); + + function _class2() { + _RenderingTest.apply(this, arguments); + } + + _class2.prototype['@test getViewBounds on a regular component'] = function testGetViewBoundsOnARegularComponent(assert) { + var component = undefined; + this.registerComponent('hi-mom', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + } + }), + template: '

    Hi, mom!

    ' + }); + + this.render('{{hi-mom}}'); + + var _getViewBounds = _emberViews.getViewBounds(component); + + var parentElement = _getViewBounds.parentElement; + var firstNode = _getViewBounds.firstNode; + var lastNode = _getViewBounds.lastNode; + + assert.equal(parentElement, this.element, 'a regular component should have the right parentElement'); + assert.equal(firstNode, component.element, 'a regular component should have a single node that is its element'); + assert.equal(lastNode, component.element, 'a regular component should have a single node that is its element'); + }; + + _class2.prototype['@test getViewBounds on a tagless component'] = function testGetViewBoundsOnATaglessComponent(assert) { + var component = undefined; + this.registerComponent('hi-mom', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: '', + init: function () { + this._super.apply(this, arguments); + component = this; + } + }), + template: 'Hi, mom!' + }); + + this.render('{{hi-mom}}'); + + var _getViewBounds2 = _emberViews.getViewBounds(component); + + var parentElement = _getViewBounds2.parentElement; + var firstNode = _getViewBounds2.firstNode; + var lastNode = _getViewBounds2.lastNode; + + assert.equal(parentElement, this.element, 'a tagless component should have the right parentElement'); + assert.equal(firstNode, this.$('#start-node')[0], 'a tagless component should have a range enclosing all of its nodes'); + assert.equal(lastNode, this.$('#before-end-node')[0].nextSibling, 'a tagless component should have a range enclosing all of its nodes'); + }; + + _class2.prototype['@test getViewClientRects'] = function testGetViewClientRects(assert) { + if (!hasGetClientRects || !ClientRectListCtor) { + assert.ok(true, 'The test environment does not support the DOM API required to run this test.'); + return; + } + + var component = undefined; + this.registerComponent('hi-mom', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + } + }), + template: '

    Hi, mom!

    ' + }); + + this.render('{{hi-mom}}'); + + assert.ok(_emberViews.getViewClientRects(component) instanceof ClientRectListCtor); + }; + + _class2.prototype['@test getViewBoundingClientRect'] = function testGetViewBoundingClientRect(assert) { + if (!hasGetBoundingClientRect || !ClientRectCtor) { + assert.ok(true, 'The test environment does not support the DOM API required to run this test.'); + return; + } + + var component = undefined; + this.registerComponent('hi-mom', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + } + }), + template: '

    Hi, mom!

    ' + }); + + this.render('{{hi-mom}}'); + + assert.ok(_emberViews.getViewBoundingClientRect(component) instanceof ClientRectCtor); + }; + + return _class2; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/components/utils-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/utils-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/utils-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/utils-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/utils-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/utils-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/web-component-fallback-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: web component fallback', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test custom elements are rendered'] = function testCustomElementsAreRendered() { + var template = 'hello'; + + this.render(template); + + this.assertHTML(template); + + this.assertStableRerender(); + }; + + _class.prototype['@test custom elements can have bound attributes'] = function testCustomElementsCanHaveBoundAttributes() { + var _this = this; + + var template = 'hello'; + + this.render(template, { name: 'Robert' }); + + this.assertHTML('hello'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'name', 'Kris'); + }); + + this.assertHTML('hello'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'name', 'Robert'); + }); + + this.assertHTML('hello'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/components/web-component-fallback-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/web-component-fallback-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/web-component-fallback-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/web-component-fallback-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/web-component-fallback-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/web-component-fallback-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/will-destroy-element-hook-test', ['exports', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/test-case'], function (exports, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsTestCase) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Component willDestroyElement hook', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test it calls willDestroyElement when removed by if'] = function testItCallsWillDestroyElementWhenRemovedByIf(assert) { + var _this = this; + + var didInsertElementCount = 0; + var willDestroyElementCount = 0; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + didInsertElementCount++; + assert.notEqual(this.element.parentNode, null, 'precond component is in DOM'); + }, + willDestroyElement: function () { + willDestroyElementCount++; + assert.notEqual(this.element.parentNode, null, 'has not been removed from DOM yet'); + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{#if switch}}{{foo-bar}}{{/if}}', { switch: true }); + + assert.equal(didInsertElementCount, 1, 'didInsertElement was called once'); + + this.assertComponentElement(this.firstChild, { content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'switch', false); + }); + + assert.equal(willDestroyElementCount, 1, 'willDestroyElement was called once'); + + this.assertText(''); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/components/will-destroy-element-hook-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/components'); + test('ember-glimmer/tests/integration/components/will-destroy-element-hook-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/components/will-destroy-element-hook-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/components/will-destroy-element-hook-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/components'); + QUnit.test('ember-glimmer/tests/integration/components/will-destroy-element-hook-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/components/will-destroy-element-hook-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/content-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/test-helpers', 'ember-views', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberMetal, _emberRuntime, _emberGlimmerTestsUtilsTestHelpers, _emberViews, _emberGlimmerTestsUtilsHelpers) { + /* globals EmberDev */ + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Static content tests', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test it can render a static text node'] = function testItCanRenderAStaticTextNode() { + var _this = this; + + this.render('hello'); + var text1 = this.assertTextNode(this.firstChild, 'hello'); + + this.runTask(function () { + return _this.rerender(); + }); + + var text2 = this.assertTextNode(this.firstChild, 'hello'); + + this.assertSameNode(text1, text2); + }; + + _class.prototype['@test it can render a static element'] = function testItCanRenderAStaticElement() { + var _this2 = this; + + this.render('

    hello

    '); + var p1 = this.assertElement(this.firstChild, { tagName: 'p' }); + var text1 = this.assertTextNode(this.firstChild.firstChild, 'hello'); + + this.runTask(function () { + return _this2.rerender(); + }); + + var p2 = this.assertElement(this.firstChild, { tagName: 'p' }); + var text2 = this.assertTextNode(this.firstChild.firstChild, 'hello'); + + this.assertSameNode(p1, p2); + this.assertSameNode(text1, text2); + }; + + _class.prototype['@test it can render a static template'] = function testItCanRenderAStaticTemplate() { + var _this3 = this; + + var template = '\n
    \n

    Welcome to Ember.js

    \n
    \n
    \n

    Why you should use Ember.js?

    \n
      \n
    1. It\'s great
    2. \n
    3. It\'s awesome
    4. \n
    5. It\'s Ember.js
    6. \n
    \n
    \n \n '; + + this.render(template); + this.assertHTML(template); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertHTML(template); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + var DynamicContentTest = (function (_RenderingTest2) { + babelHelpers.inherits(DynamicContentTest, _RenderingTest2); + + function DynamicContentTest() { + _RenderingTest2.apply(this, arguments); + } + + /* abstract */ + + DynamicContentTest.prototype.renderPath = function renderPath(path) { + var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + throw new Error('Not implemented: `renderValues`'); + }; + + DynamicContentTest.prototype.assertIsEmpty = function assertIsEmpty() { + this.assert.strictEqual(this.firstChild, null); + }; + + /* abstract */ + + DynamicContentTest.prototype.assertContent = function assertContent(content) { + throw new Error('Not implemented: `assertContent`'); + }; + + DynamicContentTest.prototype['@test it can render a dynamic path'] = function testItCanRenderADynamicPath() { + var _this4 = this; + + this.renderPath('message', { message: 'hello' }); + + this.assertContent('hello'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'message', 'goodbye'); + }); + + this.assertContent('goodbye'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'message', 'hello'); + }); + + this.assertContent('hello'); + this.assertInvariants(); + }; + + DynamicContentTest.prototype['@test resolves the string length properly'] = function testResolvesTheStringLengthProperly() { + var _this5 = this; + + this.render('

    {{foo.length}}

    ', { foo: undefined }); + + this.assertHTML('

    '); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'foo', 'foo'); + }); + + this.assertHTML('

    3

    '); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'foo', ''); + }); + + this.assertHTML('

    0

    '); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'foo', undefined); + }); + + this.assertHTML('

    '); + }; + + DynamicContentTest.prototype['@test resolves the array length properly'] = function testResolvesTheArrayLengthProperly() { + var _this6 = this; + + this.render('

    {{foo.length}}

    ', { foo: undefined }); + + this.assertHTML('

    '); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'foo', [1, 2, 3]); + }); + + this.assertHTML('

    3

    '); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'foo', []); + }); + + this.assertHTML('

    0

    '); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'foo', undefined); + }); + + this.assertHTML('

    '); + }; + + DynamicContentTest.prototype['@test it can render a capitalized path with no deprecation'] = function testItCanRenderACapitalizedPathWithNoDeprecation() { + var _this7 = this; + + expectNoDeprecation(); + + this.renderPath('CaptializedPath', { CaptializedPath: 'no deprecation' }); + + this.assertContent('no deprecation'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'CaptializedPath', 'still no deprecation'); + }); + + this.assertContent('still no deprecation'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'CaptializedPath', 'no deprecation'); + }); + + this.assertContent('no deprecation'); + this.assertInvariants(); + }; + + DynamicContentTest.prototype['@test it can render undefined dynamic paths'] = function testItCanRenderUndefinedDynamicPaths() { + var _this8 = this; + + this.renderPath('name', {}); + + this.assertIsEmpty(); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this8.context, 'name', 'foo-bar'); + }); + + this.assertContent('foo-bar'); + + this.runTask(function () { + return _emberMetal.set(_this8.context, 'name', undefined); + }); + + this.assertIsEmpty(); + }; + + DynamicContentTest.prototype['@test it can render a deeply nested dynamic path'] = function testItCanRenderADeeplyNestedDynamicPath() { + var _this9 = this; + + this.renderPath('a.b.c.d.e.f', { + a: { b: { c: { d: { e: { f: 'hello' } } } } } + }); + + this.assertContent('hello'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'a.b.c.d.e.f', 'goodbye'); + }); + + this.assertContent('goodbye'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'a.b.c.d', { e: { f: 'aloha' } }); + }); + + this.assertContent('aloha'); + this.assertInvariants(); + + this.runTask(function () { + _emberMetal.set(_this9.context, 'a', { b: { c: { d: { e: { f: 'hello' } } } } }); + }); + + this.assertContent('hello'); + this.assertInvariants(); + }; + + DynamicContentTest.prototype['@test it can render a computed property'] = function testItCanRenderAComputedProperty() { + var _this10 = this; + + var Formatter = _emberRuntime.Object.extend({ + formattedMessage: _emberMetal.computed('message', function () { + return this.get('message').toUpperCase(); + }) + }); + + var m = Formatter.create({ message: 'hello' }); + + this.renderPath('m.formattedMessage', { m: m }); + + this.assertContent('HELLO'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(m, 'message', 'goodbye'); + }); + + this.assertContent('GOODBYE'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this10.context, 'm', Formatter.create({ message: 'hello' })); + }); + + this.assertContent('HELLO'); + this.assertInvariants(); + }; + + DynamicContentTest.prototype['@test it can render a computed property with nested dependency'] = function testItCanRenderAComputedPropertyWithNestedDependency() { + var _this11 = this; + + var Formatter = _emberRuntime.Object.extend({ + formattedMessage: _emberMetal.computed('messenger.message', function () { + return this.get('messenger.message').toUpperCase(); + }) + }); + + var m = Formatter.create({ messenger: { message: 'hello' } }); + + this.renderPath('m.formattedMessage', { m: m }); + + this.assertContent('HELLO'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(m, 'messenger.message', 'goodbye'); + }); + + this.assertContent('GOODBYE'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'm', Formatter.create({ messenger: { message: 'hello' } })); + }); + + this.assertContent('HELLO'); + this.assertInvariants(); + }; + + DynamicContentTest.prototype['@test it can read from a proxy object'] = function testItCanReadFromAProxyObject() { + var _this12 = this; + + this.renderPath('proxy.name', { proxy: _emberRuntime.ObjectProxy.create({ content: { name: 'Tom Dale' } }) }); + + this.assertContent('Tom Dale'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'proxy.content.name', 'Yehuda Katz'); + }); + + this.assertContent('Yehuda Katz'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'proxy.content', { name: 'Godfrey Chan' }); + }); + + this.assertContent('Godfrey Chan'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'proxy.name', 'Stefan Penner'); + }); + + this.assertContent('Stefan Penner'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'proxy.content', null); + }); + + this.assertIsEmpty(); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'proxy', _emberRuntime.ObjectProxy.create({ content: { name: 'Tom Dale' } })); + }); + + this.assertContent('Tom Dale'); + this.assertInvariants(); + }; + + DynamicContentTest.prototype['@test it can read from a nested path in a proxy object'] = function testItCanReadFromANestedPathInAProxyObject() { + var _this13 = this; + + this.renderPath('proxy.name.last', { proxy: _emberRuntime.ObjectProxy.create({ content: { name: { first: 'Tom', last: 'Dale' } } }) }); + + this.assertContent('Dale'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'proxy.content.name.last', 'Cruise'); + }); + + this.assertContent('Cruise'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'proxy.content.name.first', 'Suri'); + }); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'proxy.content.name', { first: 'Yehuda', last: 'Katz' }); + }); + + this.assertContent('Katz'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'proxy.content', { name: { first: 'Godfrey', last: 'Chan' } }); + }); + + this.assertContent('Chan'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'proxy.name', { first: 'Stefan', last: 'Penner' }); + }); + + this.assertContent('Penner'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'proxy', null); + }); + + this.assertIsEmpty(); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'proxy', _emberRuntime.ObjectProxy.create({ content: { name: { first: 'Tom', last: 'Dale' } } })); + }); + + this.assertContent('Dale'); + this.assertInvariants(); + }; + + DynamicContentTest.prototype['@test it can read from a path flipping between a proxy and a real object'] = function testItCanReadFromAPathFlippingBetweenAProxyAndARealObject() { + var _this14 = this; + + this.renderPath('proxyOrObject.name.last', { proxyOrObject: _emberRuntime.ObjectProxy.create({ content: { name: { first: 'Tom', last: 'Dale' } } }) }); + + this.assertContent('Dale'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'proxyOrObject', { name: { first: 'Tom', last: 'Dale' } }); + }); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'proxyOrObject.name.last', 'Cruise'); + }); + + this.assertContent('Cruise'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'proxyOrObject.name.first', 'Suri'); + }); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'proxyOrObject', { name: { first: 'Yehuda', last: 'Katz' } }); + }); + + this.assertContent('Katz'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'proxyOrObject', _emberRuntime.ObjectProxy.create({ content: { name: { first: 'Godfrey', last: 'Chan' } } })); + }); + + this.assertContent('Chan'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'proxyOrObject.content.name', { first: 'Stefan', last: 'Penner' }); + }); + + this.assertContent('Penner'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'proxyOrObject', null); + }); + + this.assertIsEmpty(); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'proxyOrObject', _emberRuntime.ObjectProxy.create({ content: { name: { first: 'Tom', last: 'Dale' } } })); + }); + + this.assertContent('Dale'); + this.assertInvariants(); + }; + + DynamicContentTest.prototype['@test it can read from a path flipping between a real object and a proxy'] = function testItCanReadFromAPathFlippingBetweenARealObjectAndAProxy() { + var _this15 = this; + + this.renderPath('objectOrProxy.name.last', { objectOrProxy: { name: { first: 'Tom', last: 'Dale' } } }); + + this.assertContent('Dale'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'objectOrProxy', _emberRuntime.ObjectProxy.create({ content: { name: { first: 'Tom', last: 'Dale' } } })); + }); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'objectOrProxy.content.name.last', 'Cruise'); + }); + + this.assertContent('Cruise'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'objectOrProxy.content.name.first', 'Suri'); + }); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'objectOrProxy.content', { name: { first: 'Yehuda', last: 'Katz' } }); + }); + + this.assertContent('Katz'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'objectOrProxy', { name: { first: 'Godfrey', last: 'Chan' } }); + }); + + this.assertContent('Chan'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'objectOrProxy.name', { first: 'Stefan', last: 'Penner' }); + }); + + this.assertContent('Penner'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'objectOrProxy', null); + }); + + this.assertIsEmpty(); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'objectOrProxy', { name: { first: 'Tom', last: 'Dale' } }); + }); + + this.assertContent('Dale'); + this.assertInvariants(); + }; + + DynamicContentTest.prototype['@test it can read from a null object'] = function testItCanReadFromANullObject() { + var _this16 = this; + + var nullObject = Object.create(null); + nullObject['message'] = 'hello'; + + this.renderPath('nullObject.message', { nullObject: nullObject }); + + this.assertContent('hello'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(nullObject, 'message', 'goodbye'); + }); + + this.assertContent('goodbye'); + this.assertInvariants(); + + nullObject = Object.create(null); + nullObject['message'] = 'hello'; + + this.runTask(function () { + return _emberMetal.set(_this16.context, 'nullObject', nullObject); + }); + + this.assertContent('hello'); + this.assertInvariants(); + }; + + DynamicContentTest.prototype['@test it can render a readOnly property of a path'] = function testItCanRenderAReadOnlyPropertyOfAPath() { + var _this17 = this; + + var Messenger = _emberRuntime.Object.extend({ + message: _emberMetal.computed.readOnly('a.b.c') + }); + + var messenger = Messenger.create({ + a: { + b: { + c: 'hello' + } + } + }); + + this.renderPath('messenger.message', { messenger: messenger }); + + this.assertContent('hello'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(messenger, 'a.b.c', 'hi'); + }); + + this.assertContent('hi'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this17.context, 'messenger.a.b', { + c: 'goodbye' + }); + }); + + this.assertContent('goodbye'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this17.context, 'messenger', { + message: 'hello' + }); + }); + + this.assertContent('hello'); + this.assertInvariants(); + }; + + return DynamicContentTest; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest); + + var EMPTY = {}; + + var ContentTestGenerator = (function () { + function ContentTestGenerator(cases) { + var tag = arguments.length <= 1 || arguments[1] === undefined ? '@test' : arguments[1]; + + this.cases = cases; + this.tag = tag; + } + + ContentTestGenerator.prototype.generate = function generate(_ref3) { + var value = _ref3[0]; + var expected = _ref3[1]; + var label = _ref3[2]; + + var tag = this.tag; + label = label || value; + + if (expected === EMPTY) { + var _ref; + + return _ref = {}, _ref[tag + ' rendering ' + label] = function () { + var _this18 = this; + + this.renderPath('value', { value: value }); + + this.assertIsEmpty(); + + this.runTask(function () { + return _emberMetal.set(_this18.context, 'value', 'hello'); + }); + + this.assertContent('hello'); + + this.runTask(function () { + return _emberMetal.set(_this18.context, 'value', value); + }); + + this.assertIsEmpty(); + }, _ref; + } else { + var _ref2; + + return _ref2 = {}, _ref2[tag + ' rendering ' + label] = function () { + var _this19 = this; + + this.renderPath('value', { value: value }); + + this.assertContent(expected); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this19.context, 'value', 'hello'); + }); + + this.assertContent('hello'); + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this19.context, 'value', value); + }); + + this.assertContent(expected); + this.assertInvariants(); + }, _ref2; + } + }; + + return ContentTestGenerator; + })(); + + var SharedContentTestCases = new ContentTestGenerator([['foo', 'foo'], [0, '0'], [-0, '0', '-0'], [1, '1'], [-1, '-1'], [0.0, '0', '0.0'], [0.5, '0.5'], [undefined, EMPTY], [null, EMPTY], [true, 'true'], [false, 'false'], [NaN, 'NaN'], [new Date(2000, 0, 1), String(new Date(2000, 0, 1)), 'a Date object'], [Infinity, 'Infinity'], [1 / -0, '-Infinity'], [{ foo: 'bar' }, '[object Object]', '{ foo: \'bar\' }'], [{ toString: function () { + return 'foo'; + } }, 'foo', 'an object with a custom toString function'], [{ valueOf: function () { + return 1; + } }, '[object Object]', 'an object with a custom valueOf function'], + + // Escaping tests + ['MaxJames', 'MaxJames']]); + + var GlimmerContentTestCases = new ContentTestGenerator([[Object.create(null), EMPTY, 'an object with no toString']]); + + if (typeof Symbol !== 'undefined') { + GlimmerContentTestCases.cases.push([Symbol('debug'), 'Symbol(debug)', 'a symbol']); + } + + _emberGlimmerTestsUtilsAbstractTestCase.applyMixins(DynamicContentTest, SharedContentTestCases, GlimmerContentTestCases); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Dynamic content tests (content position)', (function (_DynamicContentTest) { + babelHelpers.inherits(_class2, _DynamicContentTest); + + function _class2() { + _DynamicContentTest.apply(this, arguments); + } + + _class2.prototype.renderPath = function renderPath(path) { + var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + this.render('{{' + path + '}}', context); + }; + + _class2.prototype.assertContent = function assertContent(content) { + this.assert.strictEqual(this.nodesCount, 1, 'It should render exactly one text node'); + this.assertTextNode(this.firstChild, content); + }; + + return _class2; + })(DynamicContentTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Dynamic content tests (content concat)', (function (_DynamicContentTest2) { + babelHelpers.inherits(_class3, _DynamicContentTest2); + + function _class3() { + _DynamicContentTest2.apply(this, arguments); + } + + _class3.prototype.renderPath = function renderPath(path) { + var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + this.render('{{concat "" ' + path + ' ""}}', context); + }; + + _class3.prototype.assertContent = function assertContent(content) { + this.assert.strictEqual(this.nodesCount, 1, 'It should render exactly one text node'); + this.assertTextNode(this.firstChild, content); + }; + + return _class3; + })(DynamicContentTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Dynamic content tests (inside an element)', (function (_DynamicContentTest3) { + babelHelpers.inherits(_class4, _DynamicContentTest3); + + function _class4() { + _DynamicContentTest3.apply(this, arguments); + } + + _class4.prototype.renderPath = function renderPath(path) { + var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + this.render('

    {{' + path + '}}

    ', context); + }; + + _class4.prototype.assertIsEmpty = function assertIsEmpty() { + this.assert.strictEqual(this.nodesCount, 1, 'It should render exactly one

    tag'); + this.assertElement(this.firstChild, { tagName: 'p' }); + this.assertText(''); + }; + + _class4.prototype.assertContent = function assertContent(content) { + this.assert.strictEqual(this.nodesCount, 1, 'It should render exactly one

    tag'); + this.assertElement(this.firstChild, { tagName: 'p' }); + this.assertText(content); + }; + + return _class4; + })(DynamicContentTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Dynamic content tests (attribute position)', (function (_DynamicContentTest4) { + babelHelpers.inherits(_class5, _DynamicContentTest4); + + function _class5() { + _DynamicContentTest4.apply(this, arguments); + } + + _class5.prototype.renderPath = function renderPath(path) { + var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + this.render('

    ', context); + }; + + _class5.prototype.assertIsEmpty = function assertIsEmpty() { + this.assert.strictEqual(this.nodesCount, 1, 'It should render exactly one
    tag'); + this.assertElement(this.firstChild, { tagName: 'div', content: '' }); + }; + + _class5.prototype.assertContent = function assertContent(content) { + this.assert.strictEqual(this.nodesCount, 1, 'It should render exactly one
    tag'); + this.assertElement(this.firstChild, { tagName: 'div', attrs: { 'data-foo': content }, content: '' }); + }; + + return _class5; + })(DynamicContentTest)); + + var TrustedContentTest = (function (_DynamicContentTest5) { + babelHelpers.inherits(TrustedContentTest, _DynamicContentTest5); + + function TrustedContentTest() { + _DynamicContentTest5.apply(this, arguments); + } + + TrustedContentTest.prototype.assertIsEmpty = function assertIsEmpty() { + this.assert.strictEqual(this.firstChild, null); + }; + + TrustedContentTest.prototype.assertContent = function assertContent(content) { + this.assertHTML(content); + }; + + TrustedContentTest.prototype.assertStableRerender = function assertStableRerender() { + var _this20 = this; + + this.takeSnapshot(); + this.runTask(function () { + return _this20.rerender(); + }); + _DynamicContentTest5.prototype.assertInvariants.call(this); + }; + + TrustedContentTest.prototype.assertInvariants = function assertInvariants() { + // If it's not stable, we will wipe out all the content and replace them, + // so there are no invariants + }; + + return TrustedContentTest; + })(DynamicContentTest); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Dynamic content tests (trusted)', (function (_TrustedContentTest) { + babelHelpers.inherits(_class6, _TrustedContentTest); + + function _class6() { + _TrustedContentTest.apply(this, arguments); + } + + _class6.prototype.renderPath = function renderPath(path) { + var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + this.render('{{{' + path + '}}}', context); + }; + + _class6.prototype['@test updating trusted curlies'] = function testUpdatingTrustedCurlies() { + var _this21 = this; + + this.render('{{{htmlContent}}}{{{nested.htmlContent}}}', { + htmlContent: 'Max', + nested: { htmlContent: 'James' } + }); + + this.assertContent('MaxJames'); + + this.runTask(function () { + return _this21.rerender(); + }); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this21.context, 'htmlContent', 'Max'); + }); + + this.assertContent('MaxJames'); + + this.runTask(function () { + return _emberMetal.set(_this21.context, 'nested.htmlContent', 'Jammie'); + }); + + this.assertContent('MaxJammie'); + + this.runTask(function () { + _emberMetal.set(_this21.context, 'htmlContent', 'Max'); + _emberMetal.set(_this21.context, 'nested', { htmlContent: 'James' }); + }); + + this.assertContent('MaxJames'); + }; + + return _class6; + })(TrustedContentTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Dynamic content tests (integration)', (function (_RenderingTest3) { + babelHelpers.inherits(_class7, _RenderingTest3); + + function _class7() { + _RenderingTest3.apply(this, arguments); + } + + _class7.prototype['@test it can render a dynamic template'] = function testItCanRenderADynamicTemplate() { + var _this22 = this; + + var template = '\n
    \n

    Welcome to {{framework}}

    \n
    \n
    \n

    Why you should use {{framework}}?

    \n
      \n
    1. It\'s great
    2. \n
    3. It\'s awesome
    4. \n
    5. It\'s {{framework}}
    6. \n
    \n
    \n \n '; + + var ember = '\n
    \n

    Welcome to Ember.js

    \n
    \n
    \n

    Why you should use Ember.js?

    \n
      \n
    1. It\'s great
    2. \n
    3. It\'s awesome
    4. \n
    5. It\'s Ember.js
    6. \n
    \n
    \n \n '; + + var react = '\n
    \n

    Welcome to React

    \n
    \n
    \n

    Why you should use React?

    \n
      \n
    1. It\'s great
    2. \n
    3. It\'s awesome
    4. \n
    5. It\'s React
    6. \n
    \n
    \n \n '; + + this.render(template, { + framework: 'Ember.js' + }); + this.assertHTML(ember); + + this.runTask(function () { + return _this22.rerender(); + }); + + this.assertHTML(ember); + + this.runTask(function () { + return _emberMetal.set(_this22.context, 'framework', 'React'); + }); + + this.assertHTML(react); + + this.runTask(function () { + return _emberMetal.set(_this22.context, 'framework', 'Ember.js'); + }); + + this.assertHTML(ember); + }; + + _class7.prototype['@test it should evaluate to nothing if part of the path is `undefined`'] = function testItShouldEvaluateToNothingIfPartOfThePathIsUndefined() { + var _this23 = this; + + this.render('{{foo.bar.baz.bizz}}', { + foo: {} + }); + + this.assertText(''); + + this.runTask(function () { + return _this23.rerender(); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this23.context, 'foo', { + bar: { baz: { bizz: 'Hey!' } } + }); + }); + + this.assertText('Hey!'); + + this.runTask(function () { + return _emberMetal.set(_this23.context, 'foo', {}); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this23.context, 'foo', { + bar: { baz: { bizz: 'Hello!' } } + }); + }); + + this.assertText('Hello!'); + + this.runTask(function () { + return _emberMetal.set(_this23.context, 'foo', {}); + }); + + this.assertText(''); + }; + + _class7.prototype['@test it should evaluate to nothing if part of the path is a primative'] = function testItShouldEvaluateToNothingIfPartOfThePathIsAPrimative() { + var _this24 = this; + + this.render('{{foo.bar.baz.bizz}}', { + foo: { bar: true } + }); + + this.assertText(''); + + this.runTask(function () { + return _this24.rerender(); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this24.context, 'foo', { + bar: false + }); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this24.context, 'foo', { + bar: 'Haha' + }); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this24.context, 'foo', { + bar: null + }); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this24.context, 'foo', { + bar: undefined + }); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this24.context, 'foo', { + bar: 1 + }); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this24.context, 'foo', { + bar: { baz: { bizz: 'Hello!' } } + }); + }); + + this.assertText('Hello!'); + + this.runTask(function () { + return _emberMetal.set(_this24.context, 'foo', { + bar: true + }); + }); + + this.assertText(''); + }; + + _class7.prototype['@test can set dynamic href'] = function testCanSetDynamicHref() { + var _this25 = this; + + this.render('Example', { + model: { + url: 'http://example.com' + } + }); + + this.assertElement(this.firstChild, { tagName: 'a', content: 'Example', attrs: { 'href': 'http://example.com' } }); + + this.runTask(function () { + return _this25.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'a', content: 'Example', attrs: { 'href': 'http://example.com' } }); + + this.runTask(function () { + return _emberMetal.set(_this25.context, 'model.url', 'http://linkedin.com'); + }); + + this.assertElement(this.firstChild, { tagName: 'a', content: 'Example', attrs: { 'href': 'http://linkedin.com' } }); + + this.runTask(function () { + return _emberMetal.set(_this25.context, 'model', { url: 'http://example.com' }); + }); + + this.assertElement(this.firstChild, { tagName: 'a', content: 'Example', attrs: { 'href': 'http://example.com' } }); + }; + + _class7.prototype['@test quoteless class attributes update correctly'] = function testQuotelessClassAttributesUpdateCorrectly() { + var _this26 = this; + + this.render('
    hello
    ', { + fooBar: true + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo-bar') } }); + + this.runTask(function () { + return _this26.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo-bar') } }); + + this.runTask(function () { + return _emberMetal.set(_this26.context, 'fooBar', false); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello' }); + + this.runTask(function () { + return _emberMetal.set(_this26.context, 'fooBar', true); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo-bar') } }); + }; + + _class7.prototype['@test quoted class attributes update correctly'] = function testQuotedClassAttributesUpdateCorrectly(assert) { + var _this27 = this; + + this.render('
    hello
    ', { + fooBar: true + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo-bar') } }); + + this.runTask(function () { + return _this27.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo-bar') } }); + + this.runTask(function () { + return _emberMetal.set(_this27.context, 'fooBar', false); + }); + + assert.equal(this.firstChild.className, ''); + + this.runTask(function () { + return _emberMetal.set(_this27.context, 'fooBar', true); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo-bar') } }); + }; + + _class7.prototype['@test unquoted class attribute can contain multiple classes'] = function testUnquotedClassAttributeCanContainMultipleClasses() { + var _this28 = this; + + this.render('
    hello
    ', { + model: { + classes: 'foo bar baz' + } + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo bar baz') } }); + + this.runTask(function () { + return _this28.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo bar baz') } }); + + this.runTask(function () { + return _emberMetal.set(_this28.context, 'model.classes', 'fizz bizz'); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('fizz bizz') } }); + + this.runTask(function () { + return _emberMetal.set(_this28.context, 'model', { classes: 'foo bar baz' }); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo bar baz') } }); + }; + + _class7.prototype['@test unquoted class attribute'] = function testUnquotedClassAttribute() { + var _this29 = this; + + this.render('
    hello
    ', { + model: { + foo: 'foo' + } + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo') } }); + + this.runTask(function () { + return _this29.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo') } }); + + this.runTask(function () { + return _emberMetal.set(_this29.context, 'model.foo', 'fizz'); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('fizz') } }); + + this.runTask(function () { + return _emberMetal.set(_this29.context, 'model', { foo: 'foo' }); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo') } }); + }; + + _class7.prototype['@test quoted class attribute'] = function testQuotedClassAttribute() { + var _this30 = this; + + this.render('
    hello
    ', { + model: { + foo: 'foo' + } + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo') } }); + + this.runTask(function () { + return _this30.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo') } }); + + this.runTask(function () { + return _emberMetal.set(_this30.context, 'model.foo', 'fizz'); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('fizz') } }); + + this.runTask(function () { + return _emberMetal.set(_this30.context, 'model', { foo: 'foo' }); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo') } }); + }; + + _class7.prototype['@test quoted class attribute can contain multiple classes'] = function testQuotedClassAttributeCanContainMultipleClasses() { + var _this31 = this; + + this.render('
    hello
    ', { + model: { + classes: 'foo bar baz' + } + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo bar baz') } }); + + this.runTask(function () { + return _this31.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo bar baz') } }); + + this.runTask(function () { + return _emberMetal.set(_this31.context, 'model.classes', 'fizz bizz'); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('fizz bizz') } }); + + this.runTask(function () { + return _emberMetal.set(_this31.context, 'model', { classes: 'foo bar baz' }); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo bar baz') } }); + }; + + _class7.prototype['@test class attribute concats bound values'] = function testClassAttributeConcatsBoundValues() { + var _this32 = this; + + this.render('
    hello
    ', { + model: { + foo: 'foo', + bar: 'bar', + bizz: 'bizz' + } + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo bar bizz') } }); + + this.runTask(function () { + return _this32.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo bar bizz') } }); + + this.runTask(function () { + return _emberMetal.set(_this32.context, 'model.foo', 'fizz'); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('fizz bar bizz') } }); + + this.runTask(function () { + return _emberMetal.set(_this32.context, 'model.bar', null); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('fizz bizz') } }); + + this.runTask(function () { + return _emberMetal.set(_this32.context, 'model', { + foo: 'foo', + bar: 'bar', + bizz: 'bizz' + }); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo bar bizz') } }); + }; + + _class7.prototype['@test class attribute accepts nested helpers, and updates'] = function testClassAttributeAcceptsNestedHelpersAndUpdates() { + var _this33 = this; + + this.render('
    hello
    ', { + model: { + size: 'large', + hasSize: true, + hasShape: false, + shape: 'round' + } + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('large') } }); + + this.runTask(function () { + return _this33.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('large') } }); + + this.runTask(function () { + return _emberMetal.set(_this33.context, 'model.hasShape', true); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('large round') } }); + + this.runTask(function () { + return _emberMetal.set(_this33.context, 'model.hasSize', false); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('round') } }); + + this.runTask(function () { + return _emberMetal.set(_this33.context, 'model', { + size: 'large', + hasSize: true, + hasShape: false, + shape: 'round' + }); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('large') } }); + }; + + _class7.prototype['@test Multiple dynamic classes'] = function testMultipleDynamicClasses() { + var _this34 = this; + + this.render('
    hello
    ', { + model: { + foo: 'foo', + bar: 'bar', + fizz: 'fizz', + baz: 'baz' + } + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo bar fizz baz') } }); + + this.runTask(function () { + return _this34.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo bar fizz baz') } }); + + this.runTask(function () { + _emberMetal.set(_this34.context, 'model.foo', null); + _emberMetal.set(_this34.context, 'model.fizz', null); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('bar baz') } }); + + this.runTask(function () { + _emberMetal.set(_this34.context, 'model', { + foo: 'foo', + bar: 'bar', + fizz: 'fizz', + baz: 'baz' + }); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('foo bar fizz baz') } }); + }; + + _class7.prototype['@test classes are ordered: See issue #9912'] = function testClassesAreOrderedSeeIssue9912() { + var _this35 = this; + + this.render('
    hello
    ', { + model: { + foo: 'foo', + bar: 'bar' + } + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': 'foo static bar' } }); + + this.runTask(function () { + return _this35.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': 'foo static bar' } }); + + this.runTask(function () { + _emberMetal.set(_this35.context, 'model.bar', null); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': 'foo static ' } }); + + this.runTask(function () { + _emberMetal.set(_this35.context, 'model', { + foo: 'foo', + bar: 'bar' + }); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: 'hello', attrs: { 'class': 'foo static bar' } }); + }; + + return _class7; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + var warnings = undefined, + originalWarn = undefined; + + var StyleTest = (function (_RenderingTest4) { + babelHelpers.inherits(StyleTest, _RenderingTest4); + + function StyleTest() { + _RenderingTest4.apply(this, arguments); + warnings = []; + originalWarn = _emberMetal.getDebugFunction('warn'); + _emberMetal.setDebugFunction('warn', function (message, test) { + if (!test) { + warnings.push(message); + } + }); + } + + StyleTest.prototype.teardown = function teardown() { + var _RenderingTest4$prototype$teardown; + + (_RenderingTest4$prototype$teardown = _RenderingTest4.prototype.teardown).call.apply(_RenderingTest4$prototype$teardown, [this].concat(babelHelpers.slice.call(arguments))); + _emberMetal.setDebugFunction('warn', originalWarn); + }; + + StyleTest.prototype.assertStyleWarning = function assertStyleWarning() { + this.assert.deepEqual(warnings, [_emberViews.STYLE_WARNING]); + }; + + StyleTest.prototype.assertNoWarning = function assertNoWarning() { + this.assert.deepEqual(warnings, []); + }; + + return StyleTest; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Inline style tests', (function (_StyleTest) { + babelHelpers.inherits(_class8, _StyleTest); + + function _class8() { + _StyleTest.apply(this, arguments); + } + + _class8.prototype['@test can set dynamic style'] = function testCanSetDynamicStyle() { + var _this36 = this; + + this.render('
    ', { + model: { + style: 'width: 60px;' + } + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: '', attrs: { 'style': 'width: 60px;' } }); + + this.runTask(function () { + return _this36.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: '', attrs: { 'style': 'width: 60px;' } }); + + this.runTask(function () { + return _emberMetal.set(_this36.context, 'model.style', 'height: 60px;'); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: '', attrs: { 'style': 'height: 60px;' } }); + + this.runTask(function () { + return _emberMetal.set(_this36.context, 'model.style', null); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: '', attrs: {} }); + + this.runTask(function () { + return _emberMetal.set(_this36.context, 'model', { style: 'width: 60px;' }); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: '', attrs: { 'style': 'width: 60px;' } }); + }; + + _class8.prototype['@test can set dynamic style with -html-safe'] = function testCanSetDynamicStyleWithHtmlSafe() { + var _this37 = this; + + this.render('
    ', { + model: { + style: 'width: 60px;' + } + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: '', attrs: { 'style': 'width: 60px;' } }); + + this.runTask(function () { + return _this37.rerender(); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: '', attrs: { 'style': 'width: 60px;' } }); + + this.runTask(function () { + return _emberMetal.set(_this37.context, 'model.style', 'height: 60px;'); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: '', attrs: { 'style': 'height: 60px;' } }); + + this.runTask(function () { + return _emberMetal.set(_this37.context, 'model', { style: 'width: 60px;' }); + }); + + this.assertElement(this.firstChild, { tagName: 'div', content: '', attrs: { 'style': 'width: 60px;' } }); + }; + + return _class8; + })(StyleTest)); + + if (!EmberDev.runningProdBuild) { + _emberGlimmerTestsUtilsTestCase.moduleFor('Inline style tests - warnings', (function (_StyleTest2) { + babelHelpers.inherits(_class9, _StyleTest2); + + function _class9() { + _StyleTest2.apply(this, arguments); + } + + _class9.prototype['@test specifying
    generates a warning'] = function testSpecifyingDivStyleUserValueDivGeneratesAWarning(assert) { + this.render('
    ', { + userValue: 'width: 42px' + }); + + this.assertStyleWarning(); + }; + + _class9.prototype['@test specifying `attributeBindings: ["style"]` generates a warning'] = function testSpecifyingAttributeBindingsStyleGeneratesAWarning(assert) { + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['style'] + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + this.render('{{foo-bar style=userValue}}', { + userValue: 'width: 42px' + }); + + this.assertStyleWarning(); + }; + + _class9.prototype['@test specifying `
    ` works properly without a warning'] = function testSpecifyingDivStyleUserValueDivWorksProperlyWithoutAWarning(assert) { + this.render('
    ', { + userValue: 'width: 42px' + }); + + this.assertNoWarning(); + }; + + _class9.prototype['@test specifying `
    ` works properly with a SafeString'] = function testSpecifyingDivStyleUserValueDivWorksProperlyWithASafeString(assert) { + this.render('
    ', { + userValue: new _emberGlimmerTestsUtilsHelpers.SafeString('width: 42px') + }); + + this.assertNoWarning(); + }; + + _class9.prototype['@test null value do not generate htmlsafe warning'] = function testNullValueDoNotGenerateHtmlsafeWarning(assert) { + this.render('
    ', { + userValue: null + }); + + this.assertNoWarning(); + }; + + _class9.prototype['@test undefined value do not generate htmlsafe warning'] = function testUndefinedValueDoNotGenerateHtmlsafeWarning(assert) { + this.render('
    '); + + this.assertNoWarning(); + }; + + _class9.prototype['@test no warnings are triggered when using `-html-safe`'] = function testNoWarningsAreTriggeredWhenUsingHtmlSafe(assert) { + this.render('
    ', { + userValue: 'width: 42px' + }); + + this.assertNoWarning(); + }; + + _class9.prototype['@test no warnings are triggered when a safe string is quoted'] = function testNoWarningsAreTriggeredWhenASafeStringIsQuoted(assert) { + this.render('
    ', { + userValue: new _emberGlimmerTestsUtilsHelpers.SafeString('width: 42px') + }); + + this.assertNoWarning(); + }; + + _class9.prototype['@test binding warning is triggered when an unsafe string is quoted'] = function testBindingWarningIsTriggeredWhenAnUnsafeStringIsQuoted(assert) { + this.render('
    ', { + userValue: 'width: 42px' + }); + + this.assertStyleWarning(); + }; + + _class9.prototype['@test binding warning is triggered when a safe string for a complete property is concatenated in place'] = function testBindingWarningIsTriggeredWhenASafeStringForACompletePropertyIsConcatenatedInPlace(assert) { + this.render('
    ', { + userValue: new _emberGlimmerTestsUtilsHelpers.SafeString('width: 42px') + }); + + this.assertStyleWarning(); + }; + + _class9.prototype['@test binding warning is triggered when a safe string for a value is concatenated in place'] = function testBindingWarningIsTriggeredWhenASafeStringForAValueIsConcatenatedInPlace(assert) { + this.render('
    ', { + userValue: new _emberGlimmerTestsUtilsHelpers.SafeString('42px') + }); + + this.assertStyleWarning(); + }; + + _class9.prototype['@test binding warning is triggered when a safe string for a property name is concatenated in place'] = function testBindingWarningIsTriggeredWhenASafeStringForAPropertyNameIsConcatenatedInPlace(assert) { + this.render('
    ', { + userProperty: new _emberGlimmerTestsUtilsHelpers.SafeString('width') + }); + + this.assertStyleWarning(); + }; + + return _class9; + })(StyleTest)); + } +}); +enifed('ember-glimmer/tests/integration/content-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration'); + test('ember-glimmer/tests/integration/content-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/content-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/content-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration'); + QUnit.test('ember-glimmer/tests/integration/content-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/content-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/event-dispatcher-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { + 'use strict'; + + var canDataTransfer = !!document.createEvent('HTMLEvents').dataTransfer; + + function fireNativeWithDataTransfer(node, type, dataTransfer) { + var event = document.createEvent('HTMLEvents'); + event.initEvent(type, true, true); + event.dataTransfer = dataTransfer; + node.dispatchEvent(event); + } + + _emberGlimmerTestsUtilsTestCase.moduleFor('EventDispatcher', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test events bubble view hierarchy for form elements'] = function testEventsBubbleViewHierarchyForFormElements(assert) { + var _this = this; + + var receivedEvent = undefined; + + this.registerComponent('x-foo', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + change: function (event) { + receivedEvent = event; + } + }), + template: '' + }); + + this.render('{{x-foo}}'); + + this.runTask(function () { + return _this.$('#is-done').trigger('change'); + }); + assert.ok(receivedEvent, 'change event was triggered'); + assert.strictEqual(receivedEvent.target, this.$('#is-done')[0]); + }; + + _class.prototype['@test dispatches to the nearest event manager'] = function testDispatchesToTheNearestEventManager(assert) { + var _this2 = this; + + var receivedEvent = undefined; + + this.registerComponent('x-foo', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + click: function (event) { + assert.notOk(true, 'should not trigger `click` on component'); + }, + + eventManager: { + click: function (event) { + receivedEvent = event; + } + } + }), + + template: '' + }); + + this.render('{{x-foo}}'); + + this.runTask(function () { + return _this2.$('#is-done').trigger('click'); + }); + assert.strictEqual(receivedEvent.target, this.$('#is-done')[0]); + }; + + _class.prototype['@test event manager can re-dispatch to the component'] = function testEventManagerCanReDispatchToTheComponent(assert) { + var _this3 = this; + + var handlers = []; + + this.registerComponent('x-foo', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + click: function () { + handlers.push('component'); + }, + + eventManager: { + click: function (event, component) { + handlers.push('eventManager'); + // Re-dispatch event when you get it. + // + // The second parameter tells the dispatcher + // that this event has been handled. This + // API will clearly need to be reworked since + // multiple eventManagers in a single view + // hierarchy would break, but it shows that + // re-dispatching works + component.$().trigger('click', this); + } + } + }), + + template: '' + }); + + this.render('{{x-foo}}'); + + this.runTask(function () { + return _this3.$('#is-done').trigger('click'); + }); + assert.deepEqual(handlers, ['eventManager', 'component']); + }; + + _class.prototype['@test event handlers are wrapped in a run loop'] = function testEventHandlersAreWrappedInARunLoop(assert) { + this.registerComponent('x-foo', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + change: function () { + assert.ok(_emberMetal.run.currentRunLoop, 'a run loop should have started'); + } + }), + template: '' + }); + + this.render('{{x-foo}}'); + + this.$('#is-done').trigger('click'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('EventDispatcher#setup', (function (_RenderingTest2) { + babelHelpers.inherits(_class2, _RenderingTest2); + + function _class2() { + _RenderingTest2.call(this); + + var dispatcher = this.owner.lookup('event_dispatcher:main'); + _emberMetal.run(dispatcher, 'destroy'); + this.owner.__container__.reset('event_dispatcher:main'); + this.dispatcher = this.owner.lookup('event_dispatcher:main'); + } + + _class2.prototype['@test additonal events can be specified'] = function testAdditonalEventsCanBeSpecified(assert) { + this.dispatcher.setup({ myevent: 'myEvent' }); + + this.registerComponent('x-foo', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + myEvent: function () { + assert.ok(true, 'custom event was triggered'); + } + }), + template: '

    Hello!

    ' + }); + + this.render('{{x-foo}}'); + + this.$('div').trigger('myevent'); + }; + + _class2.prototype['@test a rootElement can be specified'] = function testARootElementCanBeSpecified(assert) { + this.$().append('
    '); + this.dispatcher.setup({ myevent: 'myEvent' }, '#app'); + + assert.ok(this.$('#app').hasClass('ember-application'), 'custom rootElement was used'); + assert.equal(this.dispatcher.rootElement, '#app', 'the dispatchers rootElement was updated'); + }; + + _class2.prototype['@test default events can be disabled via `customEvents`'] = function testDefaultEventsCanBeDisabledViaCustomEvents(assert) { + this.dispatcher.setup({ click: null }); + + this.registerComponent('x-foo', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + click: function () { + assert.ok(false, 'click method was called'); + }, + + null: function () { + assert.ok(false, 'null method was called'); + }, + + doubleClick: function () { + assert.ok(true, 'a non-disabled event is still handled properly'); + } + }), + + template: '

    Hello!

    ' + }); + + this.render('{{x-foo}}'); + + this.$('div').trigger('click'); + this.$('div').trigger('dblclick'); + }; + + _class2.prototype['@test throws if specified rootElement does not exist'] = function testThrowsIfSpecifiedRootElementDoesNotExist(assert) { + var _this4 = this; + + assert.throws(function () { + _this4.dispatcher.setup({ myevent: 'myEvent' }, '#app'); + }); + }; + + return _class2; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + if (false) { + _emberGlimmerTestsUtilsTestCase.moduleFor('EventDispatcher - Instrumentation', (function (_RenderingTest3) { + babelHelpers.inherits(_class3, _RenderingTest3); + + function _class3() { + _RenderingTest3.apply(this, arguments); + } + + _class3.prototype.teardown = function teardown() { + _RenderingTest3.prototype.teardown.call(this); + _emberMetal.instrumentationReset(); + }; + + _class3.prototype['@test instruments triggered events'] = function testInstrumentsTriggeredEvents(assert) { + var clicked = 0; + + this.registerComponent('x-foo', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + click: function (evt) { + clicked++; + } + }), + template: '

    hello

    ' + }); + + this.render('{{x-foo}}'); + + this.$('div').trigger('click'); + + assert.equal(clicked, 1, 'precond - the click handler was invoked'); + + var clickInstrumented = 0; + _emberMetal.instrumentationSubscribe('interaction.click', { + before: function () { + clickInstrumented++; + assert.equal(clicked, 1, 'invoked before event is handled'); + }, + after: function () { + clickInstrumented++; + assert.equal(clicked, 2, 'invoked after event is handled'); + } + }); + + var keypressInstrumented = 0; + _emberMetal.instrumentationSubscribe('interaction.keypress', { + before: function () { + keypressInstrumented++; + }, + after: function () { + keypressInstrumented++; + } + }); + + this.$('div').trigger('click'); + this.$('div').trigger('change'); + assert.equal(clicked, 2, 'precond - The click handler was invoked'); + assert.equal(clickInstrumented, 2, 'The click was instrumented'); + assert.strictEqual(keypressInstrumented, 0, 'The keypress was not instrumented'); + }; + + return _class3; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + } + + if (canDataTransfer) { + _emberGlimmerTestsUtilsTestCase.moduleFor('EventDispatcher - Event Properties', (function (_RenderingTest4) { + babelHelpers.inherits(_class4, _RenderingTest4); + + function _class4() { + _RenderingTest4.apply(this, arguments); + } + + _class4.prototype['@test dataTransfer property is added to drop event'] = function testDataTransferPropertyIsAddedToDropEvent(assert) { + var receivedEvent = undefined; + this.registerComponent('x-foo', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + drop: function (event) { + receivedEvent = event; + } + }) + }); + + this.render('{{x-foo}}'); + + fireNativeWithDataTransfer(this.$('div')[0], 'drop', 'success'); + assert.equal(receivedEvent.dataTransfer, 'success'); + }; + + return _class4; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + } +}); +enifed('ember-glimmer/tests/integration/event-dispatcher-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration'); + test('ember-glimmer/tests/integration/event-dispatcher-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/event-dispatcher-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/event-dispatcher-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration'); + QUnit.test('ember-glimmer/tests/integration/event-dispatcher-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/event-dispatcher-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/-class-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/test-helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsTestHelpers, _emberMetal) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{-class}}', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test casts binding to dasherized class'] = function testCastsBindingToDasherizedClass() { + var _this = this; + + this.registerComponent('foo-bar', { template: '' }); + this.render('{{foo-bar class=(-class someTruth "someTruth")}}', { + someTruth: true + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('some-truth ember-view') } }); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('some-truth ember-view') } }); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'someTruth', false); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') } }); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'someTruth', true); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('some-truth ember-view') } }); + }; + + _class.prototype['@tests casts leaf path of binding to dasherized class'] = function testsCastsLeafPathOfBindingToDasherizedClass() { + var _this2 = this; + + this.registerComponent('foo-bar', { template: '' }); + this.render('{{foo-bar class=(-class model.someTruth "someTruth")}}', { + model: { + someTruth: true + } + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('some-truth ember-view') } }); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('some-truth ember-view') } }); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'model.someTruth', false); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') } }); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'model', { someTruth: true }); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('some-truth ember-view') } }); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/-class-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/-class-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/-class-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/-class-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/-class-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/-class-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/closure-action-test', ['exports', 'ember-metal', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberMetal, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsHelpers) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n
    clicked: {{clicked}}; foo: {{foo}}
    \n\n {{click-me id="string-action" onClick=(action "on-click")}}\n {{click-me id="function-action" onClick=(action onClick)}}\n {{click-me id="mut-action" onClick=(action (mut clicked))}}\n '], ['\n
    clicked: {{clicked}}; foo: {{foo}}
    \n\n {{click-me id="string-action" onClick=(action "on-click")}}\n {{click-me id="function-action" onClick=(action onClick)}}\n {{click-me id="mut-action" onClick=(action (mut clicked))}}\n ']); + + if (false) { + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: closure {{action}} improved instrumentation', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype.subscribe = function subscribe(eventName, options) { + this.subscriber = _emberMetal.instrumentationSubscribe(eventName, options); + }; + + _class.prototype.teardown = function teardown() { + if (this.subscriber) { + _emberMetal.instrumentationUnsubscribe(this.subscriber); + } + + _RenderingTest.prototype.teardown.call(this); + }; + + _class.prototype['@test interaction event subscriber should be passed parameters'] = function testInteractionEventSubscriberShouldBePassedParameters() { + var _this = this; + + var actionParam = 'So krispy'; + var beforeParameters = []; + var afterParameters = []; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + fireAction: function () { + this.attrs.submit(actionParam); + } + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + outerSubmit: function () {} + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: '' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action outerSubmit)}}' + }); + + this.subscribe('interaction.ember-action', { + before: function (name, timestamp, payload) { + beforeParameters.push(payload.args); + }, + after: function (name, timestamp, payload) { + afterParameters.push(payload.args); + } + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + _this.$('#instrument-button').trigger('click'); + }); + + this.assert.deepEqual(beforeParameters, [[], [actionParam]], 'instrumentation subscriber before function was passed closure action parameters'); + this.assert.deepEqual(afterParameters, [[actionParam], []], 'instrumentation subscriber after function was passed closure action parameters'); + }; + + _class.prototype['@test interaction event subscriber should be passed target'] = function testInteractionEventSubscriberShouldBePassedTarget() { + var _this2 = this; + + var beforeParameters = []; + var afterParameters = []; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + myProperty: 'inner-thing', + actions: { + fireAction: function () { + this.attrs.submit(); + } + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + myProperty: 'outer-thing', + outerSubmit: function () {} + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: '' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action outerSubmit)}}' + }); + + this.subscribe('interaction.ember-action', { + before: function (name, timestamp, payload) { + beforeParameters.push(payload.target.get('myProperty')); + }, + after: function (name, timestamp, payload) { + afterParameters.push(payload.target.get('myProperty')); + } + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + _this2.$('#instrument-button').trigger('click'); + }); + + this.assert.deepEqual(beforeParameters, ['inner-thing', 'outer-thing'], 'instrumentation subscriber before function was passed target'); + this.assert.deepEqual(afterParameters, ['outer-thing', 'inner-thing'], 'instrumentation subscriber after function was passed target'); + }; + + _class.prototype['@test instrumented action should return value'] = function testInstrumentedActionShouldReturnValue() { + var _this3 = this; + + var returnedValue = 'Chris P is so krispy'; + var beforeParameter = undefined; + var afterParameter = undefined; + var actualReturnedValue = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + fireAction: function () { + actualReturnedValue = this.attrs.submit(); + } + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + outerSubmit: function () { + return returnedValue; + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: '' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action outerSubmit)}}' + }); + + this.subscribe('interaction.ember-action', { + before: function (name, timestamp, payload) { + beforeParameter = payload.target.get('myProperty'); + }, + after: function (name, timestamp, payload) { + afterParameter = payload.target.get('myProperty'); + } + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + _this3.$('#instrument-button').trigger('click'); + }); + + this.assert.equal(actualReturnedValue, returnedValue, 'action can return to caller'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + } + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: closure {{action}}', (function (_RenderingTest2) { +babelHelpers.inherits(_class2, _RenderingTest2); + + function _class2() { + _RenderingTest2.apply(this, arguments); + } + + _class2.prototype['@test action should be called'] = function testActionShouldBeCalled() { + var outerActionCalled = false; + var component = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + fireAction: function () { + this.attrs.submit(); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + outerSubmit: function () { + outerActionCalled = true; + } + }); + + this.registerComponent('inner-component', { ComponentClass: InnerComponent, template: 'inner' }); + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action outerSubmit)}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + component.fireAction(); + }); + + this.assert.ok(outerActionCalled, 'the action was called'); + }; + + _class2.prototype['@test an error is triggered when bound action function is undefined'] = function testAnErrorIsTriggeredWhenBoundActionFunctionIsUndefined() { + var _this4 = this; + + this.registerComponent('inner-component', { + template: 'inner' + }); + this.registerComponent('outer-component', { + template: '{{inner-component submit=(action somethingThatIsUndefined)}}' + }); + + expectAssertion(function () { + _this4.render('{{outer-component}}'); + }, /Action passed is null or undefined in \(action[^)]*\) from .*\./); + }; + + _class2.prototype['@test an error is triggered when bound action being passed in is a non-function'] = function testAnErrorIsTriggeredWhenBoundActionBeingPassedInIsANonFunction() { + var _this5 = this; + + this.registerComponent('inner-component', { + template: 'inner' + }); + this.registerComponent('outer-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + nonFunctionThing: {} + }), + template: '{{inner-component submit=(action nonFunctionThing)}}' + }); + + expectAssertion(function () { + _this5.render('{{outer-component}}'); + }, /An action could not be made for `.*` in .*\. Please confirm that you are using either a quoted action name \(i\.e\. `\(action '.*'\)`\) or a function available in .*\./); + }; + + _class2.prototype['@test [#12718] a nice error is shown when a bound action function is undefined and it is passed as attrs.foo'] = function test12718ANiceErrorIsShownWhenABoundActionFunctionIsUndefinedAndItIsPassedAsAttrsFoo() { + var _this6 = this; + + this.registerComponent('inner-component', { + template: '' + }); + + this.registerComponent('outer-component', { + template: '{{inner-component}}' + }); + + expectAssertion(function () { + _this6.render('{{outer-component}}'); + }, /Action passed is null or undefined in \(action[^)]*\) from .*\./); + }; + + _class2.prototype['@test action value is returned'] = function testActionValueIsReturned() { + var expectedValue = 'terrible tom'; + var returnedValue = undefined; + var innerComponent = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + returnedValue = this.attrs.submit(); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + outerSubmit: function () { + return expectedValue; + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action outerSubmit)}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.equal(returnedValue, expectedValue, 'action can return to caller'); + }; + + _class2.prototype['@test action should be called on the correct scope'] = function testActionShouldBeCalledOnTheCorrectScope() { + var innerComponent = undefined; + var outerComponent = undefined; + var actualComponent = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.attrs.submit(); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + outerComponent = this; + }, + isOuterComponent: true, + outerSubmit: function () { + actualComponent = this; + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action outerSubmit)}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.equal(actualComponent, outerComponent, 'action has the correct context'); + this.assert.ok(actualComponent.isOuterComponent, 'action has the correct context'); + }; + + _class2.prototype['@test arguments to action are passed, curry'] = function testArgumentsToActionArePassedCurry() { + var first = 'mitch'; + var second = 'martin'; + var third = 'matt'; + var fourth = 'wacky wycats'; + + var innerComponent = undefined; + var actualArgs = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.attrs.submit(fourth); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + third: third, + outerSubmit: function (actualFirst, actualSecond, actualThird, actualFourth) { + actualArgs = [].concat(babelHelpers.slice.call(arguments)); + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action (action outerSubmit "' + first + '") "' + second + '" third)}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.deepEqual(actualArgs, [first, second, third, fourth], 'action has the correct args'); + }; + + _class2.prototype['@test `this` can be passed as an argument'] = function testThisCanBePassedAsAnArgument() { + var value = {}; + var component = undefined; + var innerComponent = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.attrs.submit(); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + actions: { + outerAction: function (incomingValue) { + value = incomingValue; + } + } + }); + + this.registerComponent('inner-component', { ComponentClass: InnerComponent, template: 'inner' }); + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action "outerAction" this)}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.strictEqual(value, component, 'the component is passed at `this`'); + }; + + _class2.prototype['@test arguments to action are bound'] = function testArgumentsToActionAreBound() { + var value = 'lazy leah'; + + var innerComponent = undefined; + var outerComponent = undefined; + var actualArg = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.attrs.submit(); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + outerComponent = this; + }, + value: '', + outerSubmit: function (incomingValue) { + actualArg = incomingValue; + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action outerSubmit value)}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.strictEqual(actualArg, '', 'action has the correct first arg'); + + this.runTask(function () { + outerComponent.set('value', value); + }); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.strictEqual(actualArg, value, 'action has the correct first arg'); + }; + + _class2.prototype['@test array arguments are passed correctly to action'] = function testArrayArgumentsArePassedCorrectlyToAction() { + var first = 'foo'; + var second = [3, 5]; + var third = [4, 9]; + + var actualFirst = undefined; + var actualSecond = undefined; + var actualThird = undefined; + + var innerComponent = undefined; + var outerComponent = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.attrs.submit(second, third); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + outerComponent = this; + }, + outerSubmit: function (incomingFirst, incomingSecond, incomingThird) { + actualFirst = incomingFirst; + actualSecond = incomingSecond; + actualThird = incomingThird; + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action outerSubmit first)}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + outerComponent.set('first', first); + outerComponent.set('second', second); + }); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.equal(actualFirst, first, 'action has the correct first arg'); + this.assert.equal(actualSecond, second, 'action has the correct second arg'); + this.assert.equal(actualThird, third, 'action has the correct third arg'); + }; + + _class2.prototype['@test mut values can be wrapped in actions, are settable'] = function testMutValuesCanBeWrappedInActionsAreSettable() { + var newValue = 'trollin trek'; + + var innerComponent = undefined; + var outerComponent = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.attrs.submit(newValue); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + outerComponent = this; + }, + outerMut: 'patient peter' + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action (mut outerMut))}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.equal(outerComponent.get('outerMut'), newValue, 'mut value is set'); + }; + + _class2.prototype['@test mut values can be wrapped in actions, are settable with a curry'] = function testMutValuesCanBeWrappedInActionsAreSettableWithACurry() { + var newValue = 'trollin trek'; + + var innerComponent = undefined; + var outerComponent = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.attrs.submit(); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + outerComponent = this; + }, + outerMut: 'patient peter' + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action (mut outerMut) \'' + newValue + '\')}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.equal(outerComponent.get('outerMut'), newValue, 'mut value is set'); + }; + + _class2.prototype['@test action can create closures over actions'] = function testActionCanCreateClosuresOverActions() { + var first = 'raging robert'; + var second = 'mild machty'; + var returnValue = 'butch brian'; + + var actualFirst = undefined; + var actualSecond = undefined; + var actualReturnedValue = undefined; + + var innerComponent = undefined; + var outerComponent = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + actualReturnedValue = this.attrs.submit(second); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + outerComponent = this; + }, + actions: { + outerAction: function (incomingFirst, incomingSecond) { + actualFirst = incomingFirst; + actualSecond = incomingSecond; + return returnValue; + } + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action \'outerAction\' \'' + first + '\')}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.equal(actualReturnedValue, returnValue, 'return value is present'); + this.assert.equal(actualFirst, first, 'first argument is correct'); + this.assert.equal(actualSecond, second, 'second argument is correct'); + }; + + _class2.prototype['@test provides a helpful error if an action is not present'] = function testProvidesAHelpfulErrorIfAnActionIsNotPresent() { + var _this7 = this; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({}); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + something: function () { + // this is present to ensure `actions` hash is present + // a different error is triggered if `actions` is missing + // completely + } + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action \'doesNotExist\')}}' + }); + + expectAssertion(function () { + _this7.render('{{outer-component}}'); + }, /An action named 'doesNotExist' was not found in /); + }; + + _class2.prototype['@test provides a helpful error if actions hash is not present'] = function testProvidesAHelpfulErrorIfActionsHashIsNotPresent() { + var _this8 = this; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({}); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({}); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action \'doesNotExist\')}}' + }); + + expectAssertion(function () { + _this8.render('{{outer-component}}'); + }, /An action named 'doesNotExist' was not found in /); + }; + + _class2.prototype['@test action can create closures over actions with target'] = function testActionCanCreateClosuresOverActionsWithTarget() { + var innerComponent = undefined; + var actionCalled = false; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.attrs.submit(); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + otherComponent: _emberMetal.computed(function () { + return { + actions: { + outerAction: function () { + actionCalled = true; + } + } + }; + }) + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action \'outerAction\' target=otherComponent)}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.ok(actionCalled, 'action called on otherComponent'); + }; + + _class2.prototype['@test value can be used with action over actions'] = function testValueCanBeUsedWithActionOverActions() { + var newValue = 'yelping yehuda'; + + var innerComponent = undefined; + var actualValue = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.attrs.submit({ + readProp: newValue + }); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + outerContent: { + readProp: newValue + }, + actions: { + outerAction: function (incomingValue) { + actualValue = incomingValue; + } + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action \'outerAction\' value="readProp")}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.equal(actualValue, newValue, 'value is read'); + }; + + _class2.prototype['@test action will read the value of a first property'] = function testActionWillReadTheValueOfAFirstProperty() { + var newValue = 'irate igor'; + + var innerComponent = undefined; + var actualValue = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.attrs.submit({ + readProp: newValue + }); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + outerAction: function (incomingValue) { + actualValue = incomingValue; + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action outerAction value="readProp")}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.equal(actualValue, newValue, 'property is read'); + }; + + _class2.prototype['@test action will read the value of a curried first argument property'] = function testActionWillReadTheValueOfACurriedFirstArgumentProperty() { + var newValue = 'kissing kris'; + + var innerComponent = undefined; + var actualValue = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.attrs.submit(); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + objectArgument: { + readProp: newValue + }, + outerAction: function (incomingValue) { + actualValue = incomingValue; + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action outerAction objectArgument value="readProp")}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.equal(actualValue, newValue, 'property is read'); + }; + + _class2.prototype['@test action closure does not get auto-mut wrapped'] = function testActionClosureDoesNotGetAutoMutWrapped(assert) { + var first = 'raging robert'; + var second = 'mild machty'; + var returnValue = 'butch brian'; + + var innerComponent = undefined; + var actualFirst = undefined; + var actualSecond = undefined; + var actualReturnedValue = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.get('submit')(second); + this.get('attrs-submit')(second); + var attrsSubmitReturnValue = this.attrs['attrs-submit'](second); + var submitReturnValue = this.attrs.submit(second); + + assert.equal(attrsSubmitReturnValue, submitReturnValue, 'both attrs.foo and foo should behave the same'); + + return submitReturnValue; + } + }); + + var MiddleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({}); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + outerAction: function (incomingFirst, incomingSecond) { + actualFirst = incomingFirst; + actualSecond = incomingSecond; + return returnValue; + } + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('middle-component', { + ComponentClass: MiddleComponent, + template: '{{inner-component attrs-submit=attrs.submit submit=submit}}' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{middle-component submit=(action \'outerAction\' \'' + first + '\')}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + actualReturnedValue = innerComponent.fireAction(); + }); + + this.assert.equal(actualFirst, first, 'first argument is correct'); + this.assert.equal(actualSecond, second, 'second argument is correct'); + this.assert.equal(actualReturnedValue, returnValue, 'return value is present'); + }; + + _class2.prototype['@test action should be called within a run loop'] = function testActionShouldBeCalledWithinARunLoop() { + var innerComponent = undefined; + var capturedRunLoop = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + this.attrs.submit(); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + submit: function () { + capturedRunLoop = _emberMetal.run.currentRunLoop; + } + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action \'submit\')}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.ok(capturedRunLoop, 'action is called within a run loop'); + }; + + _class2.prototype['@test objects that define INVOKE can be casted to actions'] = function testObjectsThatDefineINVOKECanBeCastedToActions() { + var innerComponent = undefined; + var actionArgs = undefined; + var invokableArgs = undefined; + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + innerComponent = this; + }, + fireAction: function () { + actionArgs = this.attrs.submit(4, 5, 6); + } + }); + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + foo: 123, + submitTask: _emberMetal.computed(function () { + var _ref, + _this9 = this; + + return _ref = {}, _ref[_emberGlimmerTestsUtilsHelpers.INVOKE] = function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + invokableArgs = args; + return _this9.foo; + }, _ref; + }) + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: 'inner' + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: '{{inner-component submit=(action submitTask 1 2 3)}}' + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + innerComponent.fireAction(); + }); + + this.assert.equal(actionArgs, 123); + this.assert.deepEqual(invokableArgs, [1, 2, 3, 4, 5, 6]); + }; + + _class2.prototype['@test closure action with `(mut undefinedThing)` works properly [GH#13959]'] = function testClosureActionWithMutUndefinedThingWorksProperlyGH13959() { + var _this10 = this; + + var component = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + label: undefined, + init: function () { + this._super.apply(this, arguments); + component = this; + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '' + }); + + this.render('{{example-component}}'); + + this.assertText('Click me'); + + this.assertStableRerender(); + + this.runTask(function () { + _this10.$('button').click(); + }); + + this.assertText('Clicked!'); + + this.runTask(function () { + component.set('label', 'Dun clicked'); + }); + + this.assertText('Dun clicked'); + + this.runTask(function () { + _this10.$('button').click(); + }); + + this.assertText('Clicked!'); + + this.runTask(function () { + component.set('label', undefined); + }); + + this.assertText('Click me'); + }; + + _class2.prototype['@test closure actions does not cause component hooks to fire unnecessarily [GH#14305] [GH#14654]'] = function testClosureActionsDoesNotCauseComponentHooksToFireUnnecessarilyGH14305GH14654(assert) { + var _this12 = this; + + var clicked = 0; + var didReceiveAttrsFired = 0; + + var ClickMeComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: 'button', + + click: function () { + this.get('onClick').call(undefined, ++clicked); + }, + + didReceiveAttrs: function () { + didReceiveAttrsFired++; + } + }); + + this.registerComponent('click-me', { + ComponentClass: ClickMeComponent + }); + + var outer = undefined; + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + clicked: 0, + + actions: { + 'on-click': function () { + this.incrementProperty('clicked'); + } + }, + + init: function () { + var _this11 = this; + + this._super(); + outer = this; + this.set('onClick', function () { + return _this11.incrementProperty('clicked'); + }); + } + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject) + }); + + this.render('{{outer-component foo=foo}}', { foo: 1 }); + + this.assertText('clicked: 0; foo: 1'); + + assert.equal(didReceiveAttrsFired, 3); + + this.runTask(function () { + return _this12.rerender(); + }); + + this.assertText('clicked: 0; foo: 1'); + + assert.equal(didReceiveAttrsFired, 3); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'foo', 2); + }); + + this.assertText('clicked: 0; foo: 2'); + + assert.equal(didReceiveAttrsFired, 3); + + this.runTask(function () { + return _this12.$('#string-action').click(); + }); + + this.assertText('clicked: 1; foo: 2'); + + assert.equal(didReceiveAttrsFired, 3); + + this.runTask(function () { + return _this12.$('#function-action').click(); + }); + + this.assertText('clicked: 2; foo: 2'); + + assert.equal(didReceiveAttrsFired, 3); + + this.runTask(function () { + return _emberMetal.set(outer, 'onClick', function () { + outer.incrementProperty('clicked'); + }); + }); + + this.assertText('clicked: 2; foo: 2'); + + assert.equal(didReceiveAttrsFired, 3); + + this.runTask(function () { + return _this12.$('#function-action').click(); + }); + + this.assertText('clicked: 3; foo: 2'); + + assert.equal(didReceiveAttrsFired, 3); + + this.runTask(function () { + return _this12.$('#mut-action').click(); + }); + + this.assertText('clicked: 4; foo: 2'); + + assert.equal(didReceiveAttrsFired, 3); + }; + + return _class2; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/closure-action-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/closure-action-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/closure-action-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/closure-action-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/closure-action-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/closure-action-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/concat-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{concat}}', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test it concats static arguments'] = function testItConcatsStaticArguments() { + this.render('{{concat "foo" " " "bar" " " "baz"}}'); + this.assertText('foo bar baz'); + }; + + _class.prototype['@test it updates for bound arguments'] = function testItUpdatesForBoundArguments() { + var _this = this; + + this.render('{{concat model.first model.second}}', { + model: { first: 'one', second: 'two' } + }); + + this.assertText('onetwo'); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertText('onetwo'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'model.first', 'three'); + }); + + this.assertText('threetwo'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'model.second', 'four'); + }); + + this.assertText('threefour'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'model', { first: 'one', second: 'two' }); + }); + + this.assertText('onetwo'); + }; + + _class.prototype['@test it can be used as a sub-expression'] = function testItCanBeUsedAsASubExpression() { + var _this2 = this; + + this.render('{{concat (concat model.first model.second) (concat model.third model.fourth)}}', { + model: { + first: 'one', + second: 'two', + third: 'three', + fourth: 'four' + } + }); + + this.assertText('onetwothreefour'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertText('onetwothreefour'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'model.first', 'five'); + }); + + this.assertText('fivetwothreefour'); + + this.runTask(function () { + _emberMetal.set(_this2.context, 'model.second', 'six'); + _emberMetal.set(_this2.context, 'model.third', 'seven'); + }); + + this.assertText('fivesixsevenfour'); + + this.runTask(function () { + _emberMetal.set(_this2.context, 'model', { + first: 'one', + second: 'two', + third: 'three', + fourth: 'four' + }); + }); + + this.assertText('onetwothreefour'); + }; + + _class.prototype['@test it can be used as input for other helpers'] = function testItCanBeUsedAsInputForOtherHelpers() { + var _this3 = this; + + this.registerHelper('x-eq', function (_ref) { + var actual = _ref[0]; + var expected = _ref[1]; + return actual === expected; + }); + + this.render('{{#if (x-eq (concat model.first model.second) "onetwo")}}Truthy!{{else}}False{{/if}}', { + model: { + first: 'one', + second: 'two' + } + }); + + this.assertText('Truthy!'); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertText('Truthy!'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'model.first', 'three'); + }); + + this.assertText('False'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'model', { first: 'one', second: 'two' }); + }); + + this.assertText('Truthy!'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/concat-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/concat-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/concat-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/concat-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/concat-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/concat-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/custom-helper-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'internal-test-helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _internalTestHelpers, _emberMetal) { + /* globals EmberDev */ + 'use strict'; + + var assert = QUnit.assert; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: custom helpers', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test it cannot override built-in syntax'] = function testItCannotOverrideBuiltInSyntax() { + var _this = this; + + this.registerHelper('if', function () { + return 'Nope'; + }); + expectAssertion(function () { + _this.render('{{if foo \'LOL\'}}', { foo: true }); + }, /You attempted to overwrite the built-in helper \"if\" which is not allowed. Please rename the helper./); + }; + + _class.prototype['@test it can resolve custom simple helpers with or without dashes'] = function testItCanResolveCustomSimpleHelpersWithOrWithoutDashes() { + var _this2 = this; + + this.registerHelper('hello', function () { + return 'hello'; + }); + this.registerHelper('hello-world', function () { + return 'hello world'; + }); + + this.render('{{hello}} | {{hello-world}}'); + + this.assertText('hello | hello world'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertText('hello | hello world'); + }; + + _class.prototype['@test it does not resolve helpers with a `.` (period)'] = function testItDoesNotResolveHelpersWithAPeriod() { + var _this3 = this; + + this.registerHelper('hello.world', function () { + return 'hello world'; + }); + + this.render('{{hello.world}}', { + hello: { + world: '' + } + }); + + this.assertText(''); + + this.assertStableRerender(); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'hello', { world: 'hello world!' }); + }); + + this.assertText('hello world!'); + + this.runTask(function () { + _emberMetal.set(_this3.context, 'hello', { + world: '' + }); + }); + + this.assertText(''); + }; + + _class.prototype['@test it can resolve custom makeBoundHelper with or without dashes [DEPRECATED]'] = function testItCanResolveCustomMakeBoundHelperWithOrWithoutDashesDEPRECATED() { + var _this4 = this; + + expectDeprecation(function () { + _this4.owner.register('helper:hello', _emberGlimmerTestsUtilsHelpers.makeBoundHelper(function () { + return 'hello'; + })); + }, 'Using `Ember.HTMLBars.makeBoundHelper` is deprecated. Please refactor to use `Ember.Helper` or `Ember.Helper.helper`.'); + + expectDeprecation(function () { + _this4.owner.register('helper:hello-world', _emberGlimmerTestsUtilsHelpers.makeBoundHelper(function () { + return 'hello world'; + })); + }, 'Using `Ember.HTMLBars.makeBoundHelper` is deprecated. Please refactor to use `Ember.Helper` or `Ember.Helper.helper`.'); + + this.render('{{hello}} | {{hello-world}}'); + + this.assertText('hello | hello world'); + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assertText('hello | hello world'); + }; + + _class.prototype['@test it can resolve custom class-based helpers with or without dashes'] = function testItCanResolveCustomClassBasedHelpersWithOrWithoutDashes() { + var _this5 = this; + + this.registerHelper('hello', { + compute: function () { + return 'hello'; + } + }); + + this.registerHelper('hello-world', { + compute: function () { + return 'hello world'; + } + }); + + this.render('{{hello}} | {{hello-world}}'); + + this.assertText('hello | hello world'); + + this.runTask(function () { + return _this5.rerender(); + }); + + this.assertText('hello | hello world'); + }; + + _class.prototype['@test throws if `this._super` is not called from `init`'] = function testThrowsIfThis_superIsNotCalledFromInit() { + var _this6 = this; + + this.registerHelper('hello-world', { + init: function () {} + }); + + expectAssertion(function () { + _this6.render('{{hello-world}}'); + }, /You must call `this._super\(...arguments\);` when overriding `init` on a framework object. Please update .* to call `this._super\(...arguments\);` from `init`./); + }; + + _class.prototype['@test class-based helper can recompute a new value'] = function testClassBasedHelperCanRecomputeANewValue() { + var _this7 = this; + + var destroyCount = 0; + var computeCount = 0; + var helper = undefined; + + this.registerHelper('hello-world', { + init: function () { + this._super.apply(this, arguments); + helper = this; + }, + compute: function () { + return ++computeCount; + }, + destroy: function () { + destroyCount++; + this._super(); + } + }); + + this.render('{{hello-world}}'); + + this.assertText('1'); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertText('1'); + + this.runTask(function () { + return helper.recompute(); + }); + + this.assertText('2'); + + assert.strictEqual(destroyCount, 0, 'destroy is not called on recomputation'); + }; + + _class.prototype['@test class-based helper with static arguments can recompute a new value'] = function testClassBasedHelperWithStaticArgumentsCanRecomputeANewValue() { + var _this8 = this; + + var destroyCount = 0; + var computeCount = 0; + var helper = undefined; + + this.registerHelper('hello-world', { + init: function () { + this._super.apply(this, arguments); + helper = this; + }, + compute: function () { + return ++computeCount; + }, + destroy: function () { + destroyCount++; + this._super(); + } + }); + + this.render('{{hello-world "whut"}}'); + + this.assertText('1'); + + this.runTask(function () { + return _this8.rerender(); + }); + + this.assertText('1'); + + this.runTask(function () { + return helper.recompute(); + }); + + this.assertText('2'); + + assert.strictEqual(destroyCount, 0, 'destroy is not called on recomputation'); + }; + + _class.prototype['@test simple helper is called for param changes'] = function testSimpleHelperIsCalledForParamChanges() { + var _this9 = this; + + var computeCount = 0; + + this.registerHelper('hello-world', function (_ref) { + var value = _ref[0]; + + computeCount++; + return value + '-value'; + }); + + this.render('{{hello-world model.name}}', { + model: { name: 'bob' } + }); + + this.assertText('bob-value'); + + assert.strictEqual(computeCount, 1, 'compute is called exactly 1 time'); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertText('bob-value'); + + assert.strictEqual(computeCount, 1, 'compute is called exactly 1 time'); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'model.name', 'sal'); + }); + + this.assertText('sal-value'); + + assert.strictEqual(computeCount, 2, 'compute is called exactly 2 times'); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'model', { name: 'bob' }); + }); + + this.assertText('bob-value'); + + assert.strictEqual(computeCount, 3, 'compute is called exactly 3 times'); + }; + + _class.prototype['@test class-based helper compute is called for param changes'] = function testClassBasedHelperComputeIsCalledForParamChanges() { + var _this10 = this; + + var createCount = 0; + var computeCount = 0; + + this.registerHelper('hello-world', { + init: function () { + this._super.apply(this, arguments); + createCount++; + }, + compute: function (_ref2) { + var value = _ref2[0]; + + computeCount++; + return value + '-value'; + } + }); + + this.render('{{hello-world model.name}}', { + model: { name: 'bob' } + }); + + this.assertText('bob-value'); + + assert.strictEqual(computeCount, 1, 'compute is called exactly 1 time'); + + this.runTask(function () { + return _this10.rerender(); + }); + + this.assertText('bob-value'); + + assert.strictEqual(computeCount, 1, 'compute is called exactly 1 time'); + + this.runTask(function () { + return _emberMetal.set(_this10.context, 'model.name', 'sal'); + }); + + this.assertText('sal-value'); + + assert.strictEqual(computeCount, 2, 'compute is called exactly 2 times'); + + this.runTask(function () { + return _emberMetal.set(_this10.context, 'model', { name: 'bob' }); + }); + + this.assertText('bob-value'); + + assert.strictEqual(computeCount, 3, 'compute is called exactly 3 times'); + assert.strictEqual(createCount, 1, 'helper is only created once'); + }; + + _class.prototype['@test simple helper receives params, hash'] = function testSimpleHelperReceivesParamsHash() { + var _this11 = this; + + this.registerHelper('hello-world', function (_params, _hash) { + return 'params: ' + JSON.stringify(_params) + ', hash: ' + JSON.stringify(_hash); + }); + + this.render('{{hello-world model.name "rich" first=model.age last="sam"}}', { + model: { + name: 'bob', + age: 42 + } + }); + + this.assertText('params: ["bob","rich"], hash: {"first":42,"last":"sam"}'); + + this.runTask(function () { + return _this11.rerender(); + }); + + this.assertText('params: ["bob","rich"], hash: {"first":42,"last":"sam"}'); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'model.name', 'sal'); + }); + + this.assertText('params: ["sal","rich"], hash: {"first":42,"last":"sam"}'); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'model.age', 28); + }); + + this.assertText('params: ["sal","rich"], hash: {"first":28,"last":"sam"}'); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'model', { name: 'bob', age: 42 }); + }); + + this.assertText('params: ["bob","rich"], hash: {"first":42,"last":"sam"}'); + }; + + _class.prototype['@test class-based helper receives params, hash'] = function testClassBasedHelperReceivesParamsHash() { + var _this12 = this; + + this.registerHelper('hello-world', { + compute: function (_params, _hash) { + return 'params: ' + JSON.stringify(_params) + ', hash: ' + JSON.stringify(_hash); + } + }); + + this.render('{{hello-world model.name "rich" first=model.age last="sam"}}', { + model: { + name: 'bob', + age: 42 + } + }); + + this.assertText('params: ["bob","rich"], hash: {"first":42,"last":"sam"}'); + + this.runTask(function () { + return _this12.rerender(); + }); + + this.assertText('params: ["bob","rich"], hash: {"first":42,"last":"sam"}'); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'model.name', 'sal'); + }); + + this.assertText('params: ["sal","rich"], hash: {"first":42,"last":"sam"}'); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'model.age', 28); + }); + + this.assertText('params: ["sal","rich"], hash: {"first":28,"last":"sam"}'); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'model', { name: 'bob', age: 42 }); + }); + + this.assertText('params: ["bob","rich"], hash: {"first":42,"last":"sam"}'); + }; + + _class.prototype['@test class-based helper usable in subexpressions'] = function testClassBasedHelperUsableInSubexpressions() { + var _this13 = this; + + this.registerHelper('join-words', { + compute: function (params) { + return params.join(' '); + } + }); + + this.render('{{join-words "Who"\n (join-words "overcomes" "by")\n model.reason\n (join-words (join-words "hath overcome but" "half"))\n (join-words "his" (join-words "foe"))}}', { + model: { reason: 'force' } + }); + + this.assertText('Who overcomes by force hath overcome but half his foe'); + + this.runTask(function () { + return _this13.rerender(); + }); + + this.assertText('Who overcomes by force hath overcome but half his foe'); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'model.reason', 'Nickleback'); + }); + + this.assertText('Who overcomes by Nickleback hath overcome but half his foe'); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'model', { reason: 'force' }); + }); + + this.assertText('Who overcomes by force hath overcome but half his foe'); + }; + + _class.prototype['@test parameterless helper is usable in subexpressions'] = function testParameterlessHelperIsUsableInSubexpressions() { + var _this14 = this; + + this.registerHelper('should-show', function () { + return true; + }); + + this.render('{{#if (should-show)}}true{{/if}}'); + + this.assertText('true'); + + this.runTask(function () { + return _this14.rerender(); + }); + + this.assertText('true'); + }; + + _class.prototype['@test parameterless helper is usable in attributes'] = function testParameterlessHelperIsUsableInAttributes() { + var _this15 = this; + + this.registerHelper('foo-bar', function () { + return 'baz'; + }); + + this.render('
    '); + + this.assertHTML('
    '); + + this.runTask(function () { + return _this15.rerender(); + }); + + this.assertHTML('
    '); + }; + + _class.prototype['@test simple helper not usable with a block'] = function testSimpleHelperNotUsableWithABlock() { + var _this16 = this; + + this.registerHelper('some-helper', function () {}); + + expectAssertion(function () { + _this16.render('{{#some-helper}}{{/some-helper}}'); + }, /Helpers may not be used in the block form/); + }; + + _class.prototype['@test class-based helper not usable with a block'] = function testClassBasedHelperNotUsableWithABlock() { + var _this17 = this; + + this.registerHelper('some-helper', { + compute: function () {} + }); + + expectAssertion(function () { + _this17.render('{{#some-helper}}{{/some-helper}}'); + }, /Helpers may not be used in the block form/); + }; + + _class.prototype['@test simple helper not usable within element'] = function testSimpleHelperNotUsableWithinElement() { + var _this18 = this; + + this.registerHelper('some-helper', function () {}); + + expectAssertion(function () { + _this18.render('
    '); + }, /Helpers may not be used in the element form/); + }; + + _class.prototype['@test class-based helper not usable within element'] = function testClassBasedHelperNotUsableWithinElement() { + var _this19 = this; + + this.registerHelper('some-helper', { + compute: function () {} + }); + + expectAssertion(function () { + _this19.render('
    '); + }, /Helpers may not be used in the element form/); + }; + + _class.prototype['@test class-based helper is torn down'] = function testClassBasedHelperIsTornDown() { + var destroyCalled = 0; + + this.registerHelper('some-helper', { + destroy: function () { + destroyCalled++; + this._super.apply(this, arguments); + }, + compute: function () { + return 'must define a compute'; + } + }); + + this.render('{{some-helper}}'); + + _internalTestHelpers.runDestroy(this.component); + + assert.strictEqual(destroyCalled, 1, 'destroy called once'); + }; + + _class.prototype['@test class-based helper used in subexpression can recompute'] = function testClassBasedHelperUsedInSubexpressionCanRecompute() { + var _this20 = this; + + var helper = undefined; + var phrase = 'overcomes by'; + + this.registerHelper('dynamic-segment', { + init: function () { + this._super.apply(this, arguments); + helper = this; + }, + compute: function () { + return phrase; + } + }); + + this.registerHelper('join-words', { + compute: function (params) { + return params.join(' '); + } + }); + + this.render('{{join-words "Who"\n (dynamic-segment)\n "force"\n (join-words (join-words "hath overcome but" "half"))\n (join-words "his" (join-words "foe"))}}'); + + this.assertText('Who overcomes by force hath overcome but half his foe'); + + this.runTask(function () { + return _this20.rerender(); + }); + + this.assertText('Who overcomes by force hath overcome but half his foe'); + + phrase = 'believes his'; + + this.runTask(function () { + return helper.recompute(); + }); + + this.assertText('Who believes his force hath overcome but half his foe'); + + phrase = 'overcomes by'; + + this.runTask(function () { + return helper.recompute(); + }); + + this.assertText('Who overcomes by force hath overcome but half his foe'); + }; + + _class.prototype['@test class-based helper used in subexpression can recompute component'] = function testClassBasedHelperUsedInSubexpressionCanRecomputeComponent() { + var _this21 = this; + + var helper = undefined; + var phrase = 'overcomes by'; + + this.registerHelper('dynamic-segment', { + init: function () { + this._super.apply(this, arguments); + helper = this; + }, + compute: function () { + return phrase; + } + }); + + this.registerHelper('join-words', { + compute: function (params) { + return params.join(' '); + } + }); + + this.registerComponent('some-component', { + template: '{{first}} {{second}} {{third}} {{fourth}} {{fifth}}' + }); + + this.render('{{some-component first="Who"\n second=(dynamic-segment)\n third="force"\n fourth=(join-words (join-words "hath overcome but" "half"))\n fifth=(join-words "his" (join-words "foe"))}}'); + + this.assertText('Who overcomes by force hath overcome but half his foe'); + + this.runTask(function () { + return _this21.rerender(); + }); + + this.assertText('Who overcomes by force hath overcome but half his foe'); + + phrase = 'believes his'; + + this.runTask(function () { + return helper.recompute(); + }); + + this.assertText('Who believes his force hath overcome but half his foe'); + + phrase = 'overcomes by'; + + this.runTask(function () { + return helper.recompute(); + }); + + this.assertText('Who overcomes by force hath overcome but half his foe'); + }; + + _class.prototype['@test class-based helper used in subexpression is destroyed'] = function testClassBasedHelperUsedInSubexpressionIsDestroyed() { + var destroyCount = 0; + + this.registerHelper('dynamic-segment', { + phrase: 'overcomes by', + init: function () { + this._super.apply(this, arguments); + }, + compute: function () { + return this.phrase; + }, + destroy: function () { + destroyCount++; + this._super.apply(this, arguments); + } + }); + + this.registerHelper('join-words', { + compute: function (params) { + return params.join(' '); + } + }); + + this.render('{{join-words "Who"\n (dynamic-segment)\n "force"\n (join-words (join-words "hath overcome but" "half"))\n (join-words "his" (join-words "foe"))}}'); + + _internalTestHelpers.runDestroy(this.component); + + equal(destroyCount, 1, 'destroy is called after a view is destroyed'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + // these feature detects prevent errors in these tests + // on platforms (*cough* IE9 *cough*) that do not + // property support `Object.freeze` + var pushingIntoFrozenArrayThrows = (function () { + var array = []; + Object.freeze(array); + + try { + array.push('foo'); + + return false; + } catch (e) { + return true; + } + })(); + + var assigningExistingFrozenPropertyThrows = (function () { + var obj = { foo: 'asdf' }; + Object.freeze(obj); + + try { + obj.foo = 'derp'; + + return false; + } catch (e) { + return true; + } + })(); + + var addingPropertyToFrozenObjectThrows = (function () { + var obj = { foo: 'asdf' }; + Object.freeze(obj); + + try { + obj.bar = 'derp'; + + return false; + } catch (e) { + return true; + } + })(); + + if (!EmberDev.runningProdBuild && (pushingIntoFrozenArrayThrows || assigningExistingFrozenPropertyThrows || addingPropertyToFrozenObjectThrows)) { + (function () { + var HelperMutatingArgsTests = (function (_RenderingTest2) { + babelHelpers.inherits(HelperMutatingArgsTests, _RenderingTest2); + + function HelperMutatingArgsTests() { + _RenderingTest2.apply(this, arguments); + } + + HelperMutatingArgsTests.prototype.buildCompute = function buildCompute() { + var _this22 = this; + + return function (params, hash) { + if (pushingIntoFrozenArrayThrows) { + _this22.assert.throws(function () { + params.push('foo'); + + // cannot assert error message as it varies by platform + }); + } + + if (assigningExistingFrozenPropertyThrows) { + _this22.assert.throws(function () { + hash.foo = 'bar'; + + // cannot assert error message as it varies by platform + }); + } + + if (addingPropertyToFrozenObjectThrows) { + _this22.assert.throws(function () { + hash.someUnusedHashProperty = 'bar'; + + // cannot assert error message as it varies by platform + }); + } + }; + }; + + HelperMutatingArgsTests.prototype['@test cannot mutate params - no positional specified / named specified'] = function testCannotMutateParamsNoPositionalSpecifiedNamedSpecified() { + this.render('{{test-helper foo=bar}}', { bar: 'derp' }); + }; + + HelperMutatingArgsTests.prototype['@test cannot mutate params - positional specified / no named specified'] = function testCannotMutateParamsPositionalSpecifiedNoNamedSpecified() { + this.render('{{test-helper bar}}', { bar: 'derp' }); + }; + + HelperMutatingArgsTests.prototype['@test cannot mutate params - positional specified / named specified'] = function testCannotMutateParamsPositionalSpecifiedNamedSpecified() { + this.render('{{test-helper bar foo=qux}}', { bar: 'derp', qux: 'baz' }); + }; + + HelperMutatingArgsTests.prototype['@test cannot mutate params - no positional specified / no named specified'] = function testCannotMutateParamsNoPositionalSpecifiedNoNamedSpecified() { + this.render('{{test-helper}}', { bar: 'derp', qux: 'baz' }); + }; + + return HelperMutatingArgsTests; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: mutation triggers errors - class based helper', (function (_HelperMutatingArgsTests) { + babelHelpers.inherits(_class2, _HelperMutatingArgsTests); + + function _class2() { + _HelperMutatingArgsTests.call(this); + + var compute = this.buildCompute(); + + this.registerHelper('test-helper', { + compute: compute + }); + } + + return _class2; + })(HelperMutatingArgsTests)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: mutation triggers errors - simple helper', (function (_HelperMutatingArgsTests2) { + babelHelpers.inherits(_class3, _HelperMutatingArgsTests2); + + function _class3() { + _HelperMutatingArgsTests2.call(this); + + var compute = this.buildCompute(); + + this.registerHelper('test-helper', compute); + } + + return _class3; + })(HelperMutatingArgsTests)); + })(); + } +}); +enifed('ember-glimmer/tests/integration/helpers/custom-helper-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/custom-helper-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/custom-helper-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/custom-helper-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/custom-helper-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/custom-helper-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/debugger-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/helpers/debugger', 'ember-metal', 'ember-runtime'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberGlimmerHelpersDebugger, _emberMetal, _emberRuntime) { + 'use strict'; + + // This file is generally not I-N-U-R tested, because the {{debugger}} helper currently + // does not run during re-render. This is something we eventually want to do, and when + // we implement that feature these tests should be updated accordingly. + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{debugger}}', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype.teardown = function teardown() { + _RenderingTest.prototype.teardown.call(this); + _emberGlimmerHelpersDebugger.resetDebuggerCallback(); + }; + + _class.prototype.expectDebuggerCallback = function expectDebuggerCallback(callback, debuggerCallback) { + var times = arguments.length <= 2 || arguments[2] === undefined ? 1 : arguments[2]; + + var called = 0; + + _emberGlimmerHelpersDebugger.setDebuggerCallback(function (context, get) { + called++; + debuggerCallback(context, get); + }); + + callback(); + + this.assert.strictEqual(called, times, 'Expect debugger callback to be called exactly ' + times + ' time(s)'); + }; + + _class.prototype.expectNoDebuggerCallback = function expectNoDebuggerCallback(callback) { + var called = 0; + + _emberGlimmerHelpersDebugger.setDebuggerCallback(function () { + return called++; + }); + + callback(); + + this.assert.strictEqual(called, 0, 'Expect no debugger callback'); + }; + + _class.prototype['@test should have the right context when used in a component layout'] = function testShouldHaveTheRightContextWhenUsedInAComponentLayout(assert) { + var _this = this; + + var instance = undefined; + + this.registerComponent('my-wrapper', { + template: '{{yield}}' + }); + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + instance = this; + } + }), + template: '{{debugger}}foo-bar' + }); + + this.expectDebuggerCallback(function () { + _this.render('{{#my-wrapper}}{{foo-bar}}{{/my-wrapper}}'); + }, function (context) { + assert.strictEqual(context, instance, 'context should be the component instance'); + }); + + this.assertText('foo-bar'); + + this.expectNoDebuggerCallback(function () { + return _this.runTask(function () { + return _this.rerender(); + }); + }); + + this.assertText('foo-bar'); + }; + + _class.prototype['@test should have the right context when yielded'] = function testShouldHaveTheRightContextWhenYielded(assert) { + var _this2 = this; + + var instance = undefined; + + this.registerComponent('my-wrapper', { + template: '{{yield}}' + }); + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + instance = this; + } + }), + template: '{{#my-wrapper}}{{debugger}}foo-bar{{/my-wrapper}}' + }); + + this.expectDebuggerCallback(function () { + _this2.render('{{foo-bar}}'); + }, function (context) { + assert.strictEqual(context, instance, 'context should be the component instance'); + }); + + this.assertText('foo-bar'); + + this.expectNoDebuggerCallback(function () { + return _this2.runTask(function () { + return _this2.rerender(); + }); + }); + + this.assertText('foo-bar'); + }; + + _class.prototype['@test should be called once per iteration in a loop'] = function testShouldBeCalledOncePerIterationInALoop(assert) { + var _this3 = this; + + var count = 0; + + _emberGlimmerHelpersDebugger.setDebuggerCallback(function () { + return count++; + }); + + var items = _emberRuntime.A([1, 2, 3, 4, 5]); + + this.render('{{#each items as |item|}}{{debugger}}[{{item}}]{{/each}}', { items: items }); + + this.assertText('[1][2][3][4][5]'); + + assert.equal(count, 5, 'should have fired once per iteration'); + + count = 0; + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertText('[1][2][3][4][5]'); + + assert.strictEqual(count, 0, 'should not fire for re-render'); + + count = 0; + + this.runTask(function () { + return items.pushObjects([6, 7, 8]); + }); + + this.assertText('[1][2][3][4][5][6][7][8]'); + + assert.equal(count, 3, 'should fire once per new items added to the loop'); + }; + + _class.prototype['@test could `get` properties from "self"'] = function testCouldGetPropertiesFromSelf(assert) { + var _this4 = this; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + this.zomg = 'zomg'; + } + }), + template: '{{debugger not.here}}foo-bar' + }); + + this.expectDebuggerCallback(function () { + _this4.render('{{foo-bar lol="lol" foo=foo}}', { foo: { bar: { baz: 'fooBarBaz' } } }); + }, function (context, get) { + assert.equal(get('this'), context, '{{this}}'); + + assert.equal(get('lol'), 'lol', '{{lol}}'); + assert.equal(get('this.lol'), 'lol', '{{this.lol}}'); + + assert.equal(get('zomg'), 'zomg', '{{zomg}}'); + assert.equal(get('this.zomg'), 'zomg', '{{this.zomg}}'); + + assert.equal(get('foo.bar.baz'), 'fooBarBaz', '{{foo.bar.baz}}'); + assert.equal(get('this.foo.bar.baz'), 'fooBarBaz', '{{this.foo.bar.baz}}'); + + assert.strictEqual(get('nope'), undefined, '{{nope}}'); + assert.strictEqual(get('this.nope'), undefined, '{{this.nope}}'); + + assert.strictEqual(get('not.here'), undefined, '{{not.here}}'); + assert.strictEqual(get('this.not.here'), undefined, '{{this.not.here}}'); + }); + + this.assertText('foo-bar'); + + this.expectNoDebuggerCallback(function () { + return _this4.runTask(function () { + return _this4.rerender(); + }); + }); + + this.assertText('foo-bar'); + }; + + _class.prototype['@test could `get` local variables'] = function testCouldGetLocalVariables(assert) { + var _this5 = this; + + var obj = { + foo: 'foo', + bar: { baz: { bat: 'barBazBat' } } + }; + + this.expectDebuggerCallback(function () { + _this5.render('{{#each-in obj as |key value|}}{{debugger}}[{{key}}]{{/each-in}}', { obj: obj }); + }, function (context, get) { + assert.equal(get('this'), context, '{{this}}'); + + assert.equal(get('obj'), obj); + + // Glimmer bug: + // assert.strictEqual(get('this.key'), undefined, '{{this.key}}'); + // assert.strictEqual(get('this.value'), undefined, '{{this.value}}'); + + var key = get('key'); + + if (key === 'foo') { + assert.equal(get('value'), 'foo', '{{value}} for key=foo'); + assert.strictEqual(get('value.baz.bat'), undefined, '{{value.baz.bat}} for key=foo'); + assert.strictEqual(get('value.nope'), undefined, '{{value.nope}} for key=foo'); + } else if (key === 'bar') { + assert.equal(get('value'), obj.bar, '{{value}} for key=bar'); + assert.equal(get('value.baz.bat'), 'barBazBat', '{{value.baz.bat}} for key=bar'); + assert.strictEqual(get('value.nope'), undefined, '{{value.nope}} for key=bar'); + } else { + assert.ok(false, 'Unknown key: ' + key); + } + }, 2); + + this.assertText('[foo][bar]'); + + this.expectNoDebuggerCallback(function () { + return _this5.runTask(function () { + return _this5.rerender(); + }); + }); + + this.assertText('[foo][bar]'); + + this.expectDebuggerCallback(function () { + _this5.runTask(function () { + return _emberMetal.set(obj, 'baz', 'baz'); + }); + }, function (context, get) { + assert.equal(get('this'), context, '{{this}}'); + + assert.equal(get('obj'), obj); + + assert.strictEqual(get('this.key'), undefined, '{{this.key}}'); + assert.strictEqual(get('this.value'), undefined, '{{this.value}}'); + + assert.equal(get('key'), 'baz', '{{key}} for key=baz'); + assert.equal(get('value'), 'baz', '{{value}} for key=baz'); + assert.strictEqual(get('value.baz.bat'), undefined, '{{value.baz.bat}} for key=baz'); + assert.strictEqual(get('value.nope'), undefined, '{{value.nope}} for key=baz'); + }); + + this.assertText('[foo][bar][baz]'); + + this.expectNoDebuggerCallback(function () { + return _this5.runTask(function () { + return _this5.rerender(); + }); + }); + + this.assertText('[foo][bar][baz]'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/debugger-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/debugger-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/debugger-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/debugger-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/debugger-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/debugger-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/element-action-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal', 'ember-runtime', 'ember-views'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal, _emberRuntime, _emberViews) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{#inner-component}}\n \n {{/inner-component}}\n '], ['\n {{#inner-component}}\n \n {{/inner-component}}\n ']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#target-component as |parent|}}\n {{other-component anotherTarget=parent}}\n {{/target-component}}\n '], ['\n {{#target-component as |parent|}}\n {{other-component anotherTarget=parent}}\n {{/target-component}}\n ']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#target-component as |aTarget|}}\n click me\n {{/target-component}}\n '], ['\n {{#target-component as |aTarget|}}\n click me\n {{/target-component}}\n ']), + _templateObject4 = babelHelpers.taggedTemplateLiteralLoose(['\n click me'], ['\n click me']), + _templateObject5 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#middle-component}}\n {{inner-component action="hey"}}\n {{/middle-component}}\n '], ['\n {{#middle-component}}\n {{inner-component action="hey"}}\n {{/middle-component}}\n ']), + _templateObject6 = babelHelpers.taggedTemplateLiteralLoose(['\n \n {{yield}}\n '], ['\n \n {{yield}}\n ']); + + function getActionAttributes(element) { + var attributes = element.attributes; + var actionAttrs = []; + + for (var i = 0; i < attributes.length; i++) { + var attr = attributes.item(i); + + if (attr.name.indexOf('data-ember-action-') === 0) { + actionAttrs.push(attr.name); + } + } + + return actionAttrs; + } + + function getActionIds(element) { + return getActionAttributes(element).map(function (attribute) { + return attribute.slice('data-ember-action-'.length); + }); + } + + if (false) { + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: element action instrumentation', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype.teardown = function teardown() { + _RenderingTest.prototype.teardown.call(this); + _emberMetal.instrumentationReset(); + }; + + _class.prototype['@test action should fire interaction event with proper params'] = function testActionShouldFireInteractionEventWithProperParams() { + var _this = this; + + var subscriberCallCount = 0; + var subscriberPayload = null; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + foo: function () {} + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '' + }); + + _emberMetal.instrumentationSubscribe('interaction.ember-action', { + before: function () { + subscriberCallCount++; + }, + after: function (name, time, payload) { + subscriberPayload = payload; + } + }); + + this.render('{{example-component}}'); + + this.assert.equal(subscriberCallCount, 0, 'subscriber has not been called'); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assert.equal(subscriberCallCount, 0, 'subscriber has not been called'); + + this.runTask(function () { + _this.$('button').click(); + }); + + this.assert.equal(subscriberCallCount, 1, 'subscriber has been called 1 time'); + this.assert.equal(subscriberPayload.name, 'foo', 'subscriber called with correct name'); + this.assert.equal(subscriberPayload.args[0], 'bar', 'subscriber called with correct args'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + } + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: element action', (function (_RenderingTest2) { +babelHelpers.inherits(_class2, _RenderingTest2); + + function _class2() { + _RenderingTest2.apply(this, arguments); + } + + _class2.prototype['@test it can call an action on its enclosing component'] = function testItCanCallAnActionOnItsEnclosingComponent() { + var _this2 = this; + + var fooCallCount = 0; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + foo: function () { + fooCallCount++; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '' + }); + + this.render('{{example-component}}'); + + this.assert.equal(fooCallCount, 0, 'foo has not been called'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assert.equal(fooCallCount, 0, 'foo has not been called'); + + this.runTask(function () { + _this2.$('button').click(); + }); + + this.assert.equal(fooCallCount, 1, 'foo has been called 1 time'); + + this.runTask(function () { + _this2.$('button').click(); + }); + + this.assert.equal(fooCallCount, 2, 'foo has been called 2 times'); + }; + + _class2.prototype['@test it can call an action with parameters'] = function testItCanCallAnActionWithParameters() { + var _this3 = this; + + var fooArgs = []; + var component = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + member: 'a', + init: function () { + this._super.apply(this, arguments); + component = this; + }, + actions: { + foo: function (thing) { + fooArgs.push(thing); + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '' + }); + + this.render('{{example-component}}'); + + this.assert.deepEqual(fooArgs, [], 'foo has not been called'); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assert.deepEqual(fooArgs, [], 'foo has not been called'); + + this.runTask(function () { + _this3.$('button').click(); + }); + + this.assert.deepEqual(fooArgs, ['a'], 'foo has not been called'); + + this.runTask(function () { + component.set('member', 'b'); + }); + + this.runTask(function () { + _this3.$('button').click(); + }); + + this.assert.deepEqual(fooArgs, ['a', 'b'], 'foo has been called with an updated value'); + }; + + _class2.prototype['@test it should output a marker attribute with a guid'] = function testItShouldOutputAMarkerAttributeWithAGuid() { + this.render(''); + + var button = this.$('button'); + + var attributes = getActionAttributes(button.get(0)); + + this.assert.ok(button.attr('data-ember-action').match(''), 'An empty data-ember-action attribute was added'); + this.assert.ok(attributes[0].match(/data-ember-action-\d+/), 'A data-ember-action-xyz attribute with a guid was added'); + }; + + _class2.prototype['@test it should allow alternative events to be handled'] = function testItShouldAllowAlternativeEventsToBeHandled() { + var _this4 = this; + + var showCalled = false; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + show: function () { + showCalled = true; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '
    ' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + var event = _emberViews.jQuery.Event('mouseup'); + _this4.$('#show').trigger(event); + }); + + this.assert.ok(showCalled, 'show action was called on mouseUp'); + }; + + _class2.prototype['@test inside a yield, the target points at the original target'] = function testInsideAYieldTheTargetPointsAtTheOriginalTarget() { + var _this5 = this; + + var targetWatted = false; + var innerWatted = false; + + var TargetComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + wat: function () { + targetWatted = true; + } + } + }); + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + wat: function () { + innerWatted = true; + } + } + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: '{{yield}}' + }); + + this.registerComponent('target-component', { + ComponentClass: TargetComponent, + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject) + }); + + this.render('{{target-component}}'); + + this.runTask(function () { + _this5.$('button').click(); + }); + + this.assert.ok(targetWatted, 'the correct target was watted'); + this.assert.notOk(innerWatted, 'the inner target was not watted'); + }; + + _class2.prototype['@test it should allow a target to be specified'] = function testItShouldAllowATargetToBeSpecified() { + var _this6 = this; + + var targetWatted = false; + + var TargetComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + wat: function () { + targetWatted = true; + } + } + }); + + var OtherComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({}); + + this.registerComponent('target-component', { + ComponentClass: TargetComponent, + template: '{{yield this}}' + }); + + this.registerComponent('other-component', { + ComponentClass: OtherComponent, + template: 'Wat?' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + + this.runTask(function () { + _this6.$('a').click(); + }); + + this.assert.equal(targetWatted, true, 'the specified target was watted'); + }; + + _class2.prototype['@test it should lazily evaluate the target'] = function testItShouldLazilyEvaluateTheTarget() { + var _this7 = this; + + var firstEdit = 0; + var secondEdit = 0; + var component = undefined; + + var first = { + edit: function () { + firstEdit++; + } + }; + + var second = { + edit: function () { + secondEdit++; + } + }; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + theTarget: first + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'Edit' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this7.$('a').click(); + }); + + this.assert.equal(firstEdit, 1); + + this.runTask(function () { + _emberMetal.set(component, 'theTarget', second); + }); + + this.runTask(function () { + _this7.$('a').click(); + }); + + this.assert.equal(firstEdit, 1); + this.assert.equal(secondEdit, 1); + }; + + _class2.prototype['@test it should register an event handler'] = function testItShouldRegisterAnEventHandler() { + var _this8 = this; + + var editHandlerWasCalled = false; + var shortcutHandlerWasCalled = false; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + edit: function () { + editHandlerWasCalled = true; + }, + shortcut: function () { + shortcutHandlerWasCalled = true; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'click me
    click me too
    ' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + var event = _emberViews.jQuery.Event('click'); + event.altKey = true; + _this8.$('a[data-ember-action]').trigger(event); + }); + + this.assert.equal(editHandlerWasCalled, true, 'the event handler was called'); + + this.runTask(function () { + var event = _emberViews.jQuery.Event('click'); + event.ctrlKey = true; + _this8.$('div[data-ember-action]').trigger(event); + }); + + this.assert.equal(shortcutHandlerWasCalled, true, 'the "any" shortcut\'s event handler was called'); + }; + + _class2.prototype['@test it handles whitelisted bound modifier keys'] = function testItHandlesWhitelistedBoundModifierKeys() { + var _this9 = this; + + var editHandlerWasCalled = false; + var shortcutHandlerWasCalled = false; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + altKey: 'alt', + anyKey: 'any', + actions: { + edit: function () { + editHandlerWasCalled = true; + }, + shortcut: function () { + shortcutHandlerWasCalled = true; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'click me
    click me too
    ' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + var event = _emberViews.jQuery.Event('click'); + event.altKey = true; + _this9.$('a[data-ember-action]').trigger(event); + }); + + this.assert.equal(editHandlerWasCalled, true, 'the event handler was called'); + + this.runTask(function () { + var event = _emberViews.jQuery.Event('click'); + event.ctrlKey = true; + _this9.$('div[data-ember-action]').trigger(event); + }); + + this.assert.equal(shortcutHandlerWasCalled, true, 'the "any" shortcut\'s event handler was called'); + }; + + _class2.prototype['@test it handles whitelisted bound modifier keys with current value'] = function testItHandlesWhitelistedBoundModifierKeysWithCurrentValue() { + var _this10 = this; + + var editHandlerWasCalled = false; + var component = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + acceptedKeys: 'alt', + actions: { + edit: function () { + editHandlerWasCalled = true; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'click me' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + var event = _emberViews.jQuery.Event('click'); + event.altKey = true; + _this10.$('a[data-ember-action]').trigger(event); + }); + + this.assert.equal(editHandlerWasCalled, true, 'the event handler was called'); + + editHandlerWasCalled = false; + + this.runTask(function () { + component.set('acceptedKeys', ''); + }); + + this.runTask(function () { + var event = _emberViews.jQuery.Event('click'); + _this10.$('div[data-ember-action]').trigger(event); + }); + + this.assert.equal(editHandlerWasCalled, false, 'the event handler was not called'); + }; + + _class2.prototype['@test should be able to use action more than once for the same event within a view'] = function testShouldBeAbleToUseActionMoreThanOnceForTheSameEventWithinAView() { + var _this11 = this; + + var editHandlerWasCalled = false; + var deleteHandlerWasCalled = false; + var originalHandlerWasCalled = false; + var component = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + actions: { + edit: function () { + editHandlerWasCalled = true; + }, + 'delete': function () { + deleteHandlerWasCalled = true; + } + }, + click: function () { + originalHandlerWasCalled = true; + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'editdelete' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this11.$('#edit').click(); + }); + + this.assert.equal(editHandlerWasCalled, true, 'the edit action was called'); + this.assert.equal(deleteHandlerWasCalled, false, 'the delete action was not called'); + this.assert.equal(originalHandlerWasCalled, true, 'the click handler was called (due to bubbling)'); + + editHandlerWasCalled = deleteHandlerWasCalled = originalHandlerWasCalled = false; + + this.runTask(function () { + _this11.$('#delete').click(); + }); + + this.assert.equal(editHandlerWasCalled, false, 'the edit action was not called'); + this.assert.equal(deleteHandlerWasCalled, true, 'the delete action was called'); + this.assert.equal(originalHandlerWasCalled, true, 'the click handler was called (due to bubbling)'); + + editHandlerWasCalled = deleteHandlerWasCalled = originalHandlerWasCalled = false; + + this.runTask(function () { + component.$().click(); + }); + + this.assert.equal(editHandlerWasCalled, false, 'the edit action was not called'); + this.assert.equal(deleteHandlerWasCalled, false, 'the delete action was not called'); + this.assert.equal(originalHandlerWasCalled, true, 'the click handler was called'); + }; + + _class2.prototype['@test the event should not bubble if `bubbles=false` is passed'] = function testTheEventShouldNotBubbleIfBubblesFalseIsPassed() { + var _this12 = this; + + var editHandlerWasCalled = false; + var deleteHandlerWasCalled = false; + var originalHandlerWasCalled = false; + var component = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + actions: { + edit: function () { + editHandlerWasCalled = true; + }, + 'delete': function () { + deleteHandlerWasCalled = true; + } + }, + click: function () { + originalHandlerWasCalled = true; + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'editdelete' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this12.$('#edit').click(); + }); + + this.assert.equal(editHandlerWasCalled, true, 'the edit action was called'); + this.assert.equal(deleteHandlerWasCalled, false, 'the delete action was not called'); + this.assert.equal(originalHandlerWasCalled, false, 'the click handler was not called'); + + editHandlerWasCalled = deleteHandlerWasCalled = originalHandlerWasCalled = false; + + this.runTask(function () { + _this12.$('#delete').click(); + }); + + this.assert.equal(editHandlerWasCalled, false, 'the edit action was not called'); + this.assert.equal(deleteHandlerWasCalled, true, 'the delete action was called'); + this.assert.equal(originalHandlerWasCalled, false, 'the click handler was not called'); + + editHandlerWasCalled = deleteHandlerWasCalled = originalHandlerWasCalled = false; + + this.runTask(function () { + component.$().click(); + }); + + this.assert.equal(editHandlerWasCalled, false, 'the edit action was not called'); + this.assert.equal(deleteHandlerWasCalled, false, 'the delete action was not called'); + this.assert.equal(originalHandlerWasCalled, true, 'the click handler was called'); + }; + + _class2.prototype['@test the event should not bubble if `bubbles=false` is passed bound'] = function testTheEventShouldNotBubbleIfBubblesFalseIsPassedBound() { + var _this13 = this; + + var editHandlerWasCalled = false; + var deleteHandlerWasCalled = false; + var originalHandlerWasCalled = false; + var component = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + isFalse: false, + actions: { + edit: function () { + editHandlerWasCalled = true; + }, + 'delete': function () { + deleteHandlerWasCalled = true; + } + }, + click: function () { + originalHandlerWasCalled = true; + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'editdelete' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this13.$('#edit').click(); + }); + + this.assert.equal(editHandlerWasCalled, true, 'the edit action was called'); + this.assert.equal(deleteHandlerWasCalled, false, 'the delete action was not called'); + this.assert.equal(originalHandlerWasCalled, false, 'the click handler was not called'); + + editHandlerWasCalled = deleteHandlerWasCalled = originalHandlerWasCalled = false; + + this.runTask(function () { + _this13.$('#delete').click(); + }); + + this.assert.equal(editHandlerWasCalled, false, 'the edit action was not called'); + this.assert.equal(deleteHandlerWasCalled, true, 'the delete action was called'); + this.assert.equal(originalHandlerWasCalled, false, 'the click handler was not called'); + + editHandlerWasCalled = deleteHandlerWasCalled = originalHandlerWasCalled = false; + + this.runTask(function () { + component.$().click(); + }); + + this.assert.equal(editHandlerWasCalled, false, 'the edit action was not called'); + this.assert.equal(deleteHandlerWasCalled, false, 'the delete action was not called'); + this.assert.equal(originalHandlerWasCalled, true, 'the click handler was called'); + }; + + _class2.prototype['@test the bubbling depends on the bound parameter'] = function testTheBubblingDependsOnTheBoundParameter() { + var _this14 = this; + + var editHandlerWasCalled = false; + var originalHandlerWasCalled = false; + var component = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + shouldBubble: false, + actions: { + edit: function () { + editHandlerWasCalled = true; + } + }, + click: function () { + originalHandlerWasCalled = true; + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'edit' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this14.$('#edit').click(); + }); + + this.assert.equal(editHandlerWasCalled, true, 'the edit action was called'); + this.assert.equal(originalHandlerWasCalled, false, 'the click handler was not called'); + + editHandlerWasCalled = originalHandlerWasCalled = false; + + this.runTask(function () { + component.set('shouldBubble', true); + }); + + this.runTask(function () { + _this14.$('#edit').click(); + }); + + this.assert.equal(editHandlerWasCalled, true, 'the edit action was called'); + this.assert.equal(originalHandlerWasCalled, true, 'the click handler was called'); + }; + + _class2.prototype['@test it should work properly in an #each block'] = function testItShouldWorkProperlyInAnEachBlock() { + var _this15 = this; + + var editHandlerWasCalled = false; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + items: _emberRuntime.A([1, 2, 3, 4]), + actions: { + edit: function () { + editHandlerWasCalled = true; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '{{#each items as |item|}}click me{{/each}}' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this15.$('a').click(); + }); + + this.assert.equal(editHandlerWasCalled, true, 'the event handler was called'); + }; + + _class2.prototype['@test it should work properly in a {{#with foo as |bar|}} block'] = function testItShouldWorkProperlyInAWithFooAsBarBlock() { + var _this16 = this; + + var editHandlerWasCalled = false; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + something: { ohai: 'there' }, + actions: { + edit: function () { + editHandlerWasCalled = true; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '{{#with something as |somethingElse|}}click me{{/with}}' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this16.$('a').click(); + }); + + this.assert.equal(editHandlerWasCalled, true, 'the event handler was called'); + }; + + _class2.prototype['@test it should unregister event handlers when an element action is removed'] = function testItShouldUnregisterEventHandlersWhenAnElementActionIsRemoved() { + var _this17 = this; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + edit: function () {} + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '{{#if isActive}}click me{{/if}}' + }); + + this.render('{{example-component isActive=isActive}}', { isActive: true }); + + equal(this.$('a[data-ember-action]').length, 1, 'The element is rendered'); + + var actionId = undefined; + + actionId = getActionIds(this.$('a[data-ember-action]').get(0))[0]; + + ok(_emberViews.ActionManager.registeredActions[actionId], 'An action is registered'); + + this.runTask(function () { + return _this17.rerender(); + }); + + equal(this.$('a[data-ember-action]').length, 1, 'The element is still present'); + + ok(_emberViews.ActionManager.registeredActions[actionId], 'The action is still registered'); + + this.runTask(function () { + return _emberMetal.set(_this17.context, 'isActive', false); + }); + + strictEqual(this.$('a[data-ember-action]').length, 0, 'The element is removed'); + + ok(!_emberViews.ActionManager.registeredActions[actionId], 'The action is unregistered'); + + this.runTask(function () { + return _emberMetal.set(_this17.context, 'isActive', true); + }); + + equal(this.$('a[data-ember-action]').length, 1, 'The element is rendered'); + + actionId = getActionIds(this.$('a[data-ember-action]').get(0))[0]; + + ok(_emberViews.ActionManager.registeredActions[actionId], 'A new action is registered'); + }; + + _class2.prototype['@test it should capture events from child elements and allow them to trigger the action'] = function testItShouldCaptureEventsFromChildElementsAndAllowThemToTriggerTheAction() { + var _this18 = this; + + var editHandlerWasCalled = false; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + edit: function () { + editHandlerWasCalled = true; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '
    ' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this18.$('button').click(); + }); + + this.assert.ok(editHandlerWasCalled, 'event on a child target triggered the action of its parent'); + }; + + _class2.prototype['@test it should allow bubbling of events from action helper to original parent event'] = function testItShouldAllowBubblingOfEventsFromActionHelperToOriginalParentEvent() { + var _this19 = this; + + var editHandlerWasCalled = false; + var originalHandlerWasCalled = false; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + edit: function () { + editHandlerWasCalled = true; + } + }, + click: function () { + originalHandlerWasCalled = true; + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'click me' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this19.$('a').click(); + }); + + this.assert.ok(editHandlerWasCalled && originalHandlerWasCalled, 'both event handlers were called'); + }; + + _class2.prototype['@test it should not bubble an event from action helper to original parent event if `bubbles=false` is passed'] = function testItShouldNotBubbleAnEventFromActionHelperToOriginalParentEventIfBubblesFalseIsPassed() { + var _this20 = this; + + var editHandlerWasCalled = false; + var originalHandlerWasCalled = false; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + edit: function () { + editHandlerWasCalled = true; + } + }, + click: function () { + originalHandlerWasCalled = true; + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'click me' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this20.$('a').click(); + }); + + this.assert.ok(editHandlerWasCalled, 'the child event handler was called'); + this.assert.notOk(originalHandlerWasCalled, 'the parent handler was not called'); + }; + + _class2.prototype['@test it should allow "send" as the action name (#594)'] = function testItShouldAllowSendAsTheActionName594() { + var _this21 = this; + + var sendHandlerWasCalled = false; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + send: function () { + sendHandlerWasCalled = true; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'click me' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this21.$('a').click(); + }); + + this.assert.ok(sendHandlerWasCalled, 'the event handler was called'); + }; + + _class2.prototype['@test it should send the view, event, and current context to the action'] = function testItShouldSendTheViewEventAndCurrentContextToTheAction() { + var _this22 = this; + + var passedTarget = undefined; + var passedContext = undefined; + var targetThis = undefined; + + var TargetComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + targetThis = this; + }, + actions: { + edit: function (context) { + passedTarget = this === targetThis; + passedContext = context; + } + } + }); + + var aContext = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + aContext = this; + } + }); + + this.registerComponent('target-component', { + ComponentClass: TargetComponent, + template: '{{yield this}}' + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3) + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this22.$('#edit').click(); + }); + + this.assert.ok(passedTarget, 'the action is called with the target as this'); + this.assert.strictEqual(passedContext, aContext, 'the parameter is passed along'); + }; + + _class2.prototype['@test it should only trigger actions for the event they were registered on'] = function testItShouldOnlyTriggerActionsForTheEventTheyWereRegisteredOn() { + var _this23 = this; + + var editHandlerWasCalled = false; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + edit: function () { + editHandlerWasCalled = true; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'click me' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this23.$('a').click(); + }); + + this.assert.ok(editHandlerWasCalled, 'the event handler was called on click'); + + editHandlerWasCalled = false; + + this.runTask(function () { + _this23.$('a').trigger('mouseover'); + }); + + this.assert.notOk(editHandlerWasCalled, 'the event handler was not called on mouseover'); + }; + + _class2.prototype['@test it should allow multiple contexts to be specified'] = function testItShouldAllowMultipleContextsToBeSpecified() { + var _this24 = this; + + var passedContexts = undefined; + var models = [_emberRuntime.Object.create(), _emberRuntime.Object.create()]; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + modelA: models[0], + modelB: models[1], + actions: { + edit: function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + passedContexts = args; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this24.$('button').click(); + }); + + this.assert.deepEqual(passedContexts, models, 'the action was called with the passed contexts'); + }; + + _class2.prototype['@test it should allow multiple contexts to be specified mixed with string args'] = function testItShouldAllowMultipleContextsToBeSpecifiedMixedWithStringArgs() { + var _this25 = this; + + var passedContexts = undefined; + var model = _emberRuntime.Object.create(); + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + model: model, + actions: { + edit: function () { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + passedContexts = args; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this25.$('button').click(); + }); + + this.assert.deepEqual(passedContexts, ['herp', model], 'the action was called with the passed contexts'); + }; + + _class2.prototype['@test it should not trigger action with special clicks'] = function testItShouldNotTriggerActionWithSpecialClicks() { + var showCalled = false; + var component = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + actions: { + show: function () { + showCalled = true; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '' + }); + + this.render('{{example-component}}'); + + var assert = this.assert; + + function checkClick(prop, value, expected) { + var event = _emberViews.jQuery.Event('click'); + event[prop] = value; + + component.$('button').trigger(event); + + if (expected) { + assert.ok(showCalled, 'should call action with ' + prop + ':' + value); + assert.ok(event.isDefaultPrevented(), 'should prevent default'); + } else { + assert.notOk(showCalled, 'should not call action with ' + prop + ':' + value); + assert.notOk(event.isDefaultPrevented(), 'should not prevent default'); + } + } + + checkClick('ctrlKey', true, false); + checkClick('altKey', true, false); + checkClick('metaKey', true, false); + checkClick('shiftKey', true, false); + checkClick('which', 2, false); + + checkClick('which', 1, true); + checkClick('which', undefined, true); // IE <9 + }; + + _class2.prototype['@test it can trigger actions for keyboard events'] = function testItCanTriggerActionsForKeyboardEvents() { + var _this26 = this; + + var showCalled = false; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + show: function () { + showCalled = true; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + var event = _emberViews.jQuery.Event('keyup'); + event.char = 'a'; + event.which = 65; + _this26.$('input').trigger(event); + }); + + this.assert.ok(showCalled, 'the action was called with keyup'); + }; + + _class2.prototype['@test a quoteless parameter should allow dynamic lookup of the actionName'] = function testAQuotelessParameterShouldAllowDynamicLookupOfTheActionName() { + var lastAction = undefined; + var actionOrder = []; + var component = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + hookMeUp: 'rock', + actions: { + rock: function () { + lastAction = 'rock'; + actionOrder.push('rock'); + }, + paper: function () { + lastAction = 'paper'; + actionOrder.push('paper'); + }, + scissors: function () { + lastAction = 'scissors'; + actionOrder.push('scissors'); + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'Whistle tips go woop woooop' + }); + + this.render('{{example-component}}'); + + var test = this; + + function testBoundAction(propertyValue) { + test.runTask(function () { + component.set('hookMeUp', propertyValue); + }); + + test.runTask(function () { + component.$('#bound-param').click(); + }); + + test.assert.ok(lastAction, propertyValue, 'lastAction set to ' + propertyValue); + } + + testBoundAction('rock'); + testBoundAction('paper'); + testBoundAction('scissors'); + + this.assert.deepEqual(actionOrder, ['rock', 'paper', 'scissors'], 'action name was looked up properly'); + }; + + _class2.prototype['@test a quoteless string parameter should resolve actionName, including path'] = function testAQuotelessStringParameterShouldResolveActionNameIncludingPath() { + var lastAction = undefined; + var actionOrder = []; + var component = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + component = this; + }, + allactions: _emberRuntime.A([{ title: 'Rock', name: 'rock' }, { title: 'Paper', name: 'paper' }, { title: 'Scissors', name: 'scissors' }]), + actions: { + rock: function () { + lastAction = 'rock'; + actionOrder.push('rock'); + }, + paper: function () { + lastAction = 'paper'; + actionOrder.push('paper'); + }, + scissors: function () { + lastAction = 'scissors'; + actionOrder.push('scissors'); + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '{{#each allactions as |allaction|}}{{allaction.title}}{{/each}}' + }); + + this.render('{{example-component}}'); + + var test = this; + + function testBoundAction(propertyValue) { + test.runTask(function () { + component.$('#' + propertyValue).click(); + }); + + test.assert.ok(lastAction, propertyValue, 'lastAction set to ' + propertyValue); + } + + testBoundAction('rock'); + testBoundAction('paper'); + testBoundAction('scissors'); + + this.assert.deepEqual(actionOrder, ['rock', 'paper', 'scissors'], 'action name was looked up properly'); + }; + + _class2.prototype['@test a quoteless function parameter should be called, including arguments'] = function testAQuotelessFunctionParameterShouldBeCalledIncludingArguments() { + var _this27 = this; + + var submitCalled = false; + var incomingArg = undefined; + + var arg = 'rough ray'; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + submit: function (actualArg) { + incomingArg = actualArg; + submitCalled = true; + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'Hi' + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this27.$('a').click(); + }); + + this.assert.ok(submitCalled, 'submit function called'); + this.assert.equal(incomingArg, arg, 'argument passed'); + }; + + _class2.prototype['@test a quoteless parameter that does not resolve to a value asserts'] = function testAQuotelessParameterThatDoesNotResolveToAValueAsserts() { + var _this28 = this; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + ohNoeNotValid: function () {} + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'Hi' + }); + + expectAssertion(function () { + _this28.render('{{example-component}}'); + }, 'You specified a quoteless path, `ohNoeNotValid`, to the {{action}} helper ' + 'which did not resolve to an action name (a string). ' + 'Perhaps you meant to use a quoted actionName? (e.g. {{action "ohNoeNotValid"}}).'); + }; + + _class2.prototype['@test allows multiple actions on a single element'] = function testAllowsMultipleActionsOnASingleElement() { + var _this29 = this; + + var clickActionWasCalled = false; + var doubleClickActionWasCalled = false; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + clicked: function () { + clickActionWasCalled = true; + }, + doubleClicked: function () { + doubleClickActionWasCalled = true; + } + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4) + }); + + this.render('{{example-component}}'); + + this.runTask(function () { + _this29.$('a').trigger('click'); + }); + + this.assert.ok(clickActionWasCalled, 'the clicked action was called'); + + this.runTask(function () { + _this29.$('a').trigger('dblclick'); + }); + + this.assert.ok(doubleClickActionWasCalled, 'the doubleClicked action was called'); + }; + + _class2.prototype['@test it should respect preventDefault option if provided'] = function testItShouldRespectPreventDefaultOptionIfProvided() { + var _this30 = this; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + show: function () {} + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'Hi' + }); + + this.render('{{example-component}}'); + + var event = _emberViews.jQuery.Event('click'); + + this.runTask(function () { + _this30.$('a').trigger(event); + }); + + this.assert.equal(event.isDefaultPrevented(), false, 'should not preventDefault'); + }; + + _class2.prototype['@test it should respect preventDefault option if provided bound'] = function testItShouldRespectPreventDefaultOptionIfProvidedBound() { + var _this31 = this; + + var component = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + shouldPreventDefault: false, + init: function () { + this._super.apply(this, arguments); + component = this; + }, + actions: { + show: function () {} + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: 'Hi' + }); + + this.render('{{example-component}}'); + + var event = _emberViews.jQuery.Event('click'); + + this.runTask(function () { + _this31.$('a').trigger(event); + }); + + this.assert.equal(event.isDefaultPrevented(), false, 'should not preventDefault'); + + event = _emberViews.jQuery.Event('click'); + + this.runTask(function () { + component.set('shouldPreventDefault', true); + _this31.$('a').trigger(event); + }); + + this.assert.equal(event.isDefaultPrevented(), true, 'should preventDefault'); + }; + + _class2.prototype['@test it should target the proper component when `action` is in yielded block [GH #12409]'] = function testItShouldTargetTheProperComponentWhenActionIsInYieldedBlockGH12409() { + var _this32 = this; + + var outerActionCalled = false; + var innerClickCalled = false; + + var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + actions: { + hey: function () { + outerActionCalled = true; + } + } + }); + + var MiddleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({}); + + var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + click: function () { + innerClickCalled = true; + this.sendAction(); + } + }); + + this.registerComponent('outer-component', { + ComponentClass: OuterComponent, + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5) + }); + + this.registerComponent('middle-component', { + ComponentClass: MiddleComponent, + template: '{{yield}}' + }); + + this.registerComponent('inner-component', { + ComponentClass: InnerComponent, + template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject6) + }); + + this.render('{{outer-component}}'); + + this.runTask(function () { + _this32.$('button').click(); + }); + + this.assert.ok(outerActionCalled, 'the action fired on the proper target'); + this.assert.ok(innerClickCalled, 'the click was triggered'); + }; + + _class2.prototype['@test element action with (mut undefinedThing) works properly'] = function testElementActionWithMutUndefinedThingWorksProperly() { + var _this33 = this; + + var component = undefined; + + var ExampleComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + label: undefined, + init: function () { + this._super.apply(this, arguments); + component = this; + } + }); + + this.registerComponent('example-component', { + ComponentClass: ExampleComponent, + template: '' + }); + + this.render('{{example-component}}'); + + this.assertText('Click me'); + + this.assertStableRerender(); + + this.runTask(function () { + _this33.$('button').click(); + }); + + this.assertText('Clicked!'); + + this.runTask(function () { + component.set('label', 'Dun clicked'); + }); + + this.assertText('Dun clicked'); + + this.runTask(function () { + _this33.$('button').click(); + }); + + this.assertText('Clicked!'); + + this.runTask(function () { + component.set('label', undefined); + }); + + this.assertText('Click me'); + }; + + return _class2; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/element-action-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/element-action-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/element-action-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/element-action-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/element-action-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/element-action-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/get-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{get}}', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test should be able to get an object value with a static key'] = function testShouldBeAbleToGetAnObjectValueWithAStaticKey() { + var _this = this; + + this.render('[{{get colors \'apple\'}}] [{{if true (get colors \'apple\')}}]', { + colors: { apple: 'red' } + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'colors.apple', 'green'); + }); + + this.assertText('[green] [green]'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'colors', { + apple: 'red' + }); + }); + + this.assertText('[red] [red]'); + }; + + _class.prototype['@test should be able to get an object value with nested static key'] = function testShouldBeAbleToGetAnObjectValueWithNestedStaticKey() { + var _this2 = this; + + this.render('[{{get colors "apple.gala"}}] [{{if true (get colors "apple.gala")}}]', { + colors: { + apple: { + gala: 'red and yellow' + } + } + }); + + this.assertText('[red and yellow] [red and yellow]'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertText('[red and yellow] [red and yellow]'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'colors.apple.gala', 'yellow and red striped'); + }); + + this.assertText('[yellow and red striped] [yellow and red striped]'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'colors', { apple: { gala: 'red and yellow' } }); + }); + + this.assertText('[red and yellow] [red and yellow]'); + }; + + _class.prototype['@test should be able to get an object value with a bound/dynamic key'] = function testShouldBeAbleToGetAnObjectValueWithABoundDynamicKey() { + var _this3 = this; + + this.render('[{{get colors key}}] [{{if true (get colors key)}}]', { + colors: { apple: 'red', banana: 'yellow' }, + key: 'apple' + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'key', 'banana'); + }); + + this.assertText('[yellow] [yellow]'); + + this.runTask(function () { + _emberMetal.set(_this3.context, 'colors.apple', 'green'); + _emberMetal.set(_this3.context, 'colors.banana', 'purple'); + }); + + this.assertText('[purple] [purple]'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'key', 'apple'); + }); + + this.assertText('[green] [green]'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'colors', { apple: 'red' }); + }); + + this.assertText('[red] [red]'); + }; + + _class.prototype['@test should be able to get an object value with nested dynamic key'] = function testShouldBeAbleToGetAnObjectValueWithNestedDynamicKey() { + var _this4 = this; + + this.render('[{{get colors key}}] [{{if true (get colors key)}}]', { + colors: { + apple: { + gala: 'red and yellow', + mcintosh: 'red' + }, + banana: 'yellow' + }, + key: 'apple.gala' + }); + + this.assertText('[red and yellow] [red and yellow]'); + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assertText('[red and yellow] [red and yellow]'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'key', 'apple.mcintosh'); + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'key', 'banana'); + }); + + this.assertText('[yellow] [yellow]'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'key', 'apple.gala'); + }); + + this.assertText('[red and yellow] [red and yellow]'); + }; + + _class.prototype['@test should be able to get an object value with subexpression returning nested key'] = function testShouldBeAbleToGetAnObjectValueWithSubexpressionReturningNestedKey() { + var _this5 = this; + + this.render('[{{get colors (concat \'apple\' \'.\' \'gala\')}}] [{{if true (get colors (concat \'apple\' \'.\' \'gala\'))}}]', { + colors: { + apple: { + gala: 'red and yellow', + mcintosh: 'red' + } + }, + key: 'apple.gala' + }); + + this.assertText('[red and yellow] [red and yellow]'); + + this.runTask(function () { + return _this5.rerender(); + }); + + this.assertText('[red and yellow] [red and yellow]'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'colors.apple.gala', 'yellow and red striped'); + }); + + this.assertText('[yellow and red striped] [yellow and red striped]'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'colors.apple.gala', 'yellow-redish'); + }); + + this.assertText('[yellow-redish] [yellow-redish]'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'colors', { + apple: { + gala: 'red and yellow', + mcintosh: 'red' + } + }); + }); + + this.assertText('[red and yellow] [red and yellow]'); + }; + + _class.prototype['@test should be able to get an object value with a get helper as the key'] = function testShouldBeAbleToGetAnObjectValueWithAGetHelperAsTheKey() { + var _this6 = this; + + this.render('[{{get colors (get possibleKeys key)}}] [{{if true (get colors (get possibleKeys key))}}]', { + colors: { apple: 'red', banana: 'yellow' }, + key: 'key1', + possibleKeys: { key1: 'apple', key2: 'banana' } + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _this6.rerender(); + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'key', 'key2'); + }); + + this.assertText('[yellow] [yellow]'); + + this.runTask(function () { + _emberMetal.set(_this6.context, 'colors.apple', 'green'); + _emberMetal.set(_this6.context, 'colors.banana', 'purple'); + }); + + this.assertText('[purple] [purple]'); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'key', 'key1'); + }); + + this.assertText('[green] [green]'); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'colors', { apple: 'red', banana: 'yellow' }); + }); + + this.assertText('[red] [red]'); + }; + + _class.prototype['@test should be able to get an object value with a get helper value as a bound/dynamic key'] = function testShouldBeAbleToGetAnObjectValueWithAGetHelperValueAsABoundDynamicKey() { + var _this7 = this; + + this.render('[{{get (get possibleValues objectKey) key}}] [{{if true (get (get possibleValues objectKey) key)}}]', { + possibleValues: { + colors1: { apple: 'red', banana: 'yellow' }, + colors2: { apple: 'green', banana: 'purple' } + }, + objectKey: 'colors1', + key: 'apple' + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'objectKey', 'colors2'); + }); + + this.assertText('[green] [green]'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'objectKey', 'colors1'); + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'key', 'banana'); + }); + + this.assertText('[yellow] [yellow]'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'objectKey', 'colors2'); + }); + + this.assertText('[purple] [purple]'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'objectKey', 'colors1'); + }); + + this.assertText('[yellow] [yellow]'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'key', 'apple'); + }); + }; + + _class.prototype['@test should be able to get an object value with a get helper as the value and a get helper as the key'] = function testShouldBeAbleToGetAnObjectValueWithAGetHelperAsTheValueAndAGetHelperAsTheKey() { + var _this8 = this; + + this.render('[{{get (get possibleValues objectKey) (get possibleKeys key)}}] [{{if true (get (get possibleValues objectKey) (get possibleKeys key))}}]', { + possibleValues: { + colors1: { apple: 'red', banana: 'yellow' }, + colors2: { apple: 'green', banana: 'purple' } + }, + objectKey: 'colors1', + possibleKeys: { + key1: 'apple', + key2: 'banana' + }, + key: 'key1' + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _this8.rerender(); + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _emberMetal.set(_this8.context, 'objectKey', 'colors2'); + }); + + this.assertText('[green] [green]'); + + this.runTask(function () { + return _emberMetal.set(_this8.context, 'objectKey', 'colors1'); + }); + + this.assertText('[red] [red]'); + + this.runTask(function () { + return _emberMetal.set(_this8.context, 'key', 'key2'); + }); + + this.assertText('[yellow] [yellow]'); + + this.runTask(function () { + return _emberMetal.set(_this8.context, 'objectKey', 'colors2'); + }); + + this.assertText('[purple] [purple]'); + + this.runTask(function () { + _emberMetal.set(_this8.context, 'objectKey', 'colors1'); + _emberMetal.set(_this8.context, 'key', 'key1'); + }); + + this.assertText('[red] [red]'); + }; + + _class.prototype['@test the result of a get helper can be yielded'] = function testTheResultOfAGetHelperCanBeYielded() { + var _this9 = this; + + var fooBarInstance = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + fooBarInstance = this; + this.mcintosh = 'red'; + } + }); + + this.registerComponent('foo-bar', { + ComponentClass: FooBarComponent, + template: '{{yield (get colors mcintosh)}}' + }); + + this.render('{{#foo-bar colors=colors as |value|}}{{value}}{{/foo-bar}}', { + colors: { + red: 'banana' + } + }); + + this.assertText('banana'); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertText('banana'); + + this.runTask(function () { + _emberMetal.set(fooBarInstance, 'mcintosh', 'yellow'); + _emberMetal.set(_this9.context, 'colors', { yellow: 'bus' }); + }); + + this.assertText('bus'); + + this.runTask(function () { + _emberMetal.set(fooBarInstance, 'mcintosh', 'red'); + _emberMetal.set(_this9.context, 'colors', { red: 'banana' }); + }); + + this.assertText('banana'); + }; + + _class.prototype['@test should handle object values as nulls'] = function testShouldHandleObjectValuesAsNulls() { + var _this10 = this; + + this.render('[{{get colors \'apple\'}}] [{{if true (get colors \'apple\')}}]', { + colors: null + }); + + this.assertText('[] []'); + + this.runTask(function () { + return _this10.rerender(); + }); + + this.assertText('[] []'); + + this.runTask(function () { + return _emberMetal.set(_this10.context, 'colors', { apple: 'green', banana: 'purple' }); + }); + + this.assertText('[green] [green]'); + + this.runTask(function () { + return _emberMetal.set(_this10.context, 'colors', null); + }); + + this.assertText('[] []'); + }; + + _class.prototype['@test should handle object keys as nulls'] = function testShouldHandleObjectKeysAsNulls() { + var _this11 = this; + + this.render('[{{get colors key}}] [{{if true (get colors key)}}]', { + colors: { + apple: 'red', + banana: 'yellow' + }, + key: null + }); + + this.assertText('[] []'); + + this.runTask(function () { + return _this11.rerender(); + }); + + this.assertText('[] []'); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'key', 'banana'); + }); + + this.assertText('[yellow] [yellow]'); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'key', null); + }); + + this.assertText('[] []'); + }; + + _class.prototype['@test should handle object values and keys as nulls'] = function testShouldHandleObjectValuesAndKeysAsNulls() { + this.render('[{{get colors \'apple\'}}] [{{if true (get colors key)}}]', { + colors: null, + key: null + }); + + this.assertText('[] []'); + }; + + _class.prototype['@test get helper value should be updatable using {{input}} and (mut) - static key'] = function testGetHelperValueShouldBeUpdatableUsingInputAndMutStaticKey(assert) { + var _this12 = this; + + this.render('{{input type=\'text\' value=(mut (get source \'banana\')) id=\'get-input\'}}', { + source: { + banana: 'banana' + } + }); + + assert.strictEqual(this.$('#get-input').val(), 'banana'); + + this.runTask(function () { + return _this12.rerender(); + }); + + assert.strictEqual(this.$('#get-input').val(), 'banana'); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'source.banana', 'yellow'); + }); + + assert.strictEqual(this.$('#get-input').val(), 'yellow'); + + this.runTask(function () { + return _this12.$('#get-input').val('some value').trigger('change'); + }); + + assert.strictEqual(this.$('#get-input').val(), 'some value'); + assert.strictEqual(_emberMetal.get(this.context, 'source.banana'), 'some value'); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'source', { banana: 'banana' }); + }); + + assert.strictEqual(this.$('#get-input').val(), 'banana'); + }; + + _class.prototype['@test get helper value should be updatable using {{input}} and (mut) - dynamic key'] = function testGetHelperValueShouldBeUpdatableUsingInputAndMutDynamicKey(assert) { + var _this13 = this; + + this.render('{{input type=\'text\' value=(mut (get source key)) id=\'get-input\'}}', { + source: { + apple: 'apple', + banana: 'banana' + }, + key: 'banana' + }); + + assert.strictEqual(this.$('#get-input').val(), 'banana'); + + this.runTask(function () { + return _this13.rerender(); + }); + + assert.strictEqual(this.$('#get-input').val(), 'banana'); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'source.banana', 'yellow'); + }); + + assert.strictEqual(this.$('#get-input').val(), 'yellow'); + + this.runTask(function () { + return _this13.$('#get-input').val('some value').trigger('change'); + }); + + assert.strictEqual(this.$('#get-input').val(), 'some value'); + assert.strictEqual(_emberMetal.get(this.context, 'source.banana'), 'some value'); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'key', 'apple'); + }); + + assert.strictEqual(this.$('#get-input').val(), 'apple'); + + this.runTask(function () { + return _this13.$('#get-input').val('some other value').trigger('change'); + }); + + assert.strictEqual(this.$('#get-input').val(), 'some other value'); + assert.strictEqual(_emberMetal.get(this.context, 'source.apple'), 'some other value'); + + this.runTask(function () { + _emberMetal.set(_this13.context, 'key', 'banana'); + _emberMetal.set(_this13.context, 'source', { banana: 'banana' }); + }); + + assert.strictEqual(this.$('#get-input').val(), 'banana'); + }; + + _class.prototype['@test get helper value should be updatable using {{input}} and (mut) - dynamic nested key'] = function testGetHelperValueShouldBeUpdatableUsingInputAndMutDynamicNestedKey(assert) { + var _this14 = this; + + this.render('{{input type=\'text\' value=(mut (get source key)) id=\'get-input\'}}', { + source: { + apple: { + gala: 'gala', + mcintosh: 'mcintosh' + }, + banana: 'banana' + }, + key: 'apple.mcintosh' + }); + + assert.strictEqual(this.$('#get-input').val(), 'mcintosh'); + + this.runTask(function () { + return _this14.rerender(); + }); + + assert.strictEqual(this.$('#get-input').val(), 'mcintosh'); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'source.apple.mcintosh', 'red'); + }); + + assert.strictEqual(this.$('#get-input').val(), 'red'); + + this.runTask(function () { + return _this14.$('#get-input').val('some value').trigger('change'); + }); + + assert.strictEqual(this.$('#get-input').val(), 'some value'); + assert.strictEqual(_emberMetal.get(this.context, 'source.apple.mcintosh'), 'some value'); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'key', 'apple.gala'); + }); + + assert.strictEqual(this.$('#get-input').val(), 'gala'); + + this.runTask(function () { + return _this14.$('#get-input').val('some other value').trigger('change'); + }); + + assert.strictEqual(this.$('#get-input').val(), 'some other value'); + assert.strictEqual(_emberMetal.get(this.context, 'source.apple.gala'), 'some other value'); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'key', 'banana'); + }); + + assert.strictEqual(this.$('#get-input').val(), 'banana'); + + this.runTask(function () { + return _this14.$('#get-input').val('yet another value').trigger('change'); + }); + + assert.strictEqual(this.$('#get-input').val(), 'yet another value'); + assert.strictEqual(_emberMetal.get(this.context, 'source.banana'), 'yet another value'); + + this.runTask(function () { + _emberMetal.set(_this14.context, 'key', 'apple.mcintosh'); + _emberMetal.set(_this14.context, 'source', { + apple: { + gala: 'gala', + mcintosh: 'mcintosh' + }, + banana: 'banana' + }); + }); + + assert.strictEqual(this.$('#get-input').val(), 'mcintosh'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/get-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/get-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/get-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/get-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/get-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/get-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/hash-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{hash}}', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test returns a hash with the right key-value'] = function testReturnsAHashWithTheRightKeyValue() { + var _this = this; + + this.render('{{#with (hash name="Sergio") as |person|}}{{person.name}}{{/with}}'); + + this.assertText('Sergio'); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertText('Sergio'); + }; + + _class.prototype['@test can have more than one key-value'] = function testCanHaveMoreThanOneKeyValue() { + var _this2 = this; + + this.render('{{#with (hash name="Sergio" lastName="Arbeo") as |person|}}{{person.name}} {{person.lastName}}{{/with}}'); + + this.assertText('Sergio Arbeo'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertText('Sergio Arbeo'); + }; + + _class.prototype['@test binds values when variables are used'] = function testBindsValuesWhenVariablesAreUsed() { + var _this3 = this; + + this.render('{{#with (hash name=model.firstName lastName="Arbeo") as |person|}}{{person.name}} {{person.lastName}}{{/with}}', { + model: { + firstName: 'Marisa' + } + }); + + this.assertText('Marisa Arbeo'); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertText('Marisa Arbeo'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'model.firstName', 'Sergio'); + }); + + this.assertText('Sergio Arbeo'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'model', { firstName: 'Marisa' }); + }); + + this.assertText('Marisa Arbeo'); + }; + + _class.prototype['@test binds multiple values when variables are used'] = function testBindsMultipleValuesWhenVariablesAreUsed() { + var _this4 = this; + + this.render('{{#with (hash name=model.firstName lastName=model.lastName) as |person|}}{{person.name}} {{person.lastName}}{{/with}}', { + model: { + firstName: 'Marisa', + lastName: 'Arbeo' + } + }); + + this.assertText('Marisa Arbeo'); + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assertText('Marisa Arbeo'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'model.firstName', 'Sergio'); + }); + + this.assertText('Sergio Arbeo'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'model.lastName', 'Smith'); + }); + + this.assertText('Sergio Smith'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'model', { + firstName: 'Marisa', + lastName: 'Arbeo' + }); + }); + + this.assertText('Marisa Arbeo'); + }; + + _class.prototype['@test hash helpers can be nested'] = function testHashHelpersCanBeNested() { + var _this5 = this; + + this.render('{{#with (hash person=(hash name=model.firstName)) as |ctx|}}{{ctx.person.name}}{{/with}}', { + model: { firstName: 'Balint' } + }); + + this.assertText('Balint'); + + this.runTask(function () { + return _this5.rerender(); + }); + + this.assertText('Balint'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'model.firstName', 'Chad'); + }); + + this.assertText('Chad'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'model', { firstName: 'Balint' }); + }); + + this.assertText('Balint'); + }; + + _class.prototype['@test should yield hash of internal properties'] = function testShouldYieldHashOfInternalProperties() { + var _this6 = this; + + var fooBarInstance = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + fooBarInstance = this; + this.model = { firstName: 'Chad' }; + } + }); + + this.registerComponent('foo-bar', { + ComponentClass: FooBarComponent, + template: '{{yield (hash firstName=model.firstName)}}' + }); + + this.render('{{#foo-bar as |values|}}{{values.firstName}}{{/foo-bar}}'); + + this.assertText('Chad'); + + this.runTask(function () { + return _this6.rerender(); + }); + + this.assertText('Chad'); + + this.runTask(function () { + return _emberMetal.set(fooBarInstance, 'model.firstName', 'Godfrey'); + }); + + this.assertText('Godfrey'); + + this.runTask(function () { + return _emberMetal.set(fooBarInstance, 'model', { firstName: 'Chad' }); + }); + + this.assertText('Chad'); + }; + + _class.prototype['@test should yield hash of internal and external properties'] = function testShouldYieldHashOfInternalAndExternalProperties() { + var _this7 = this; + + var fooBarInstance = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super(); + fooBarInstance = this; + this.model = { firstName: 'Chad' }; + } + }); + + this.registerComponent('foo-bar', { + ComponentClass: FooBarComponent, + template: '{{yield (hash firstName=model.firstName lastName=lastName)}}' + }); + + this.render('{{#foo-bar lastName=model.lastName as |values|}}{{values.firstName}} {{values.lastName}}{{/foo-bar}}', { + model: { lastName: 'Hietala' } + }); + + this.assertText('Chad Hietala'); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertText('Chad Hietala'); + + this.runTask(function () { + _emberMetal.set(fooBarInstance, 'model.firstName', 'Godfrey'); + _emberMetal.set(_this7.context, 'model.lastName', 'Chan'); + }); + + this.assertText('Godfrey Chan'); + + this.runTask(function () { + _emberMetal.set(fooBarInstance, 'model', { firstName: 'Chad' }); + _emberMetal.set(_this7.context, 'model', { lastName: 'Hietala' }); + }); + + this.assertText('Chad Hietala'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/hash-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/hash-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/hash-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/hash-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/hash-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/hash-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/if-unless-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/shared-conditional-tests'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsSharedConditionalTests) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: inline {{if}}', (function (_IfUnlessHelperTest) { + babelHelpers.inherits(_class, _IfUnlessHelperTest); + + function _class() { + _IfUnlessHelperTest.apply(this, arguments); + } + + _class.prototype.templateFor = function templateFor(_ref) { + var cond = _ref.cond; + var truthy = _ref.truthy; + var falsy = _ref.falsy; + + return '{{if ' + cond + ' ' + truthy + ' ' + falsy + '}}'; + }; + + _class.prototype['@test it raises when there are more than three arguments'] = function testItRaisesWhenThereAreMoreThanThreeArguments() { + var _this = this; + + expectAssertion(function () { + _this.render('{{if condition \'a\' \'b\' \'c\'}}', { condition: true }); + }, /The inline form of the `if` helper expects two or three arguments/); + }; + + _class.prototype['@test it raises when there are less than two arguments'] = function testItRaisesWhenThereAreLessThanTwoArguments() { + var _this2 = this; + + expectAssertion(function () { + _this2.render('{{if condition}}', { condition: true }); + }, /The inline form of the `if` helper expects two or three arguments/); + }; + + return _class; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessHelperTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: nested {{if}} helpers (returning truthy values)', (function (_IfUnlessHelperTest2) { + babelHelpers.inherits(_class2, _IfUnlessHelperTest2); + + function _class2() { + _IfUnlessHelperTest2.apply(this, arguments); + } + + _class2.prototype.templateFor = function templateFor(_ref2) { + var cond = _ref2.cond; + var truthy = _ref2.truthy; + var falsy = _ref2.falsy; + + return '{{if (if ' + cond + ' ' + cond + ' false) ' + truthy + ' ' + falsy + '}}'; + }; + + return _class2; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessHelperTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: nested {{if}} helpers (returning falsy values)', (function (_IfUnlessHelperTest3) { + babelHelpers.inherits(_class3, _IfUnlessHelperTest3); + + function _class3() { + _IfUnlessHelperTest3.apply(this, arguments); + } + + _class3.prototype.templateFor = function templateFor(_ref3) { + var cond = _ref3.cond; + var truthy = _ref3.truthy; + var falsy = _ref3.falsy; + + return '{{if (if ' + cond + ' true ' + cond + ') ' + truthy + ' ' + falsy + '}}'; + }; + + return _class3; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessHelperTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{if}} used with another helper', (function (_IfUnlessHelperTest4) { + babelHelpers.inherits(_class4, _IfUnlessHelperTest4); + + function _class4() { + _IfUnlessHelperTest4.apply(this, arguments); + } + + _class4.prototype.wrapperFor = function wrapperFor(templates) { + return '{{concat ' + templates.join(' ') + '}}'; + }; + + _class4.prototype.templateFor = function templateFor(_ref4) { + var cond = _ref4.cond; + var truthy = _ref4.truthy; + var falsy = _ref4.falsy; + + return '(if ' + cond + ' ' + truthy + ' ' + falsy + ')'; + }; + + return _class4; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessHelperTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{if}} used in attribute position', (function (_IfUnlessHelperTest5) { + babelHelpers.inherits(_class5, _IfUnlessHelperTest5); + + function _class5() { + _IfUnlessHelperTest5.apply(this, arguments); + } + + _class5.prototype.wrapperFor = function wrapperFor(templates) { + return '
    '; + }; + + _class5.prototype.templateFor = function templateFor(_ref5) { + var cond = _ref5.cond; + var truthy = _ref5.truthy; + var falsy = _ref5.falsy; + + return '{{if ' + cond + ' ' + truthy + ' ' + falsy + '}}'; + }; + + _class5.prototype.textValue = function textValue() { + return this.$('div').attr('data-foo'); + }; + + return _class5; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessHelperTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: inline {{if}} and {{unless}} without the inverse argument', (function (_IfUnlessHelperTest6) { + babelHelpers.inherits(_class6, _IfUnlessHelperTest6); + + function _class6() { + _IfUnlessHelperTest6.apply(this, arguments); + } + + _class6.prototype.templateFor = function templateFor(_ref6) { + var cond = _ref6.cond; + var truthy = _ref6.truthy; + var falsy = _ref6.falsy; + + return '{{if ' + cond + ' ' + truthy + '}}{{unless ' + cond + ' ' + falsy + '}}'; + }; + + return _class6; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessHelperTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: inline {{unless}}', (function (_IfUnlessHelperTest7) { + babelHelpers.inherits(_class7, _IfUnlessHelperTest7); + + function _class7() { + _IfUnlessHelperTest7.apply(this, arguments); + } + + _class7.prototype.templateFor = function templateFor(_ref7) { + var cond = _ref7.cond; + var truthy = _ref7.truthy; + var falsy = _ref7.falsy; + + return '{{unless ' + cond + ' ' + falsy + ' ' + truthy + '}}'; + }; + + _class7.prototype['@test it raises when there are more than three arguments'] = function testItRaisesWhenThereAreMoreThanThreeArguments() { + var _this3 = this; + + expectAssertion(function () { + _this3.render('{{unless condition \'a\' \'b\' \'c\'}}', { condition: true }); + }, /The inline form of the `unless` helper expects two or three arguments/); + }; + + _class7.prototype['@test it raises when there are less than two arguments'] = function testItRaisesWhenThereAreLessThanTwoArguments() { + var _this4 = this; + + expectAssertion(function () { + _this4.render('{{unless condition}}', { condition: true }); + }, /The inline form of the `unless` helper expects two or three arguments/); + }; + + return _class7; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessHelperTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: nested {{unless}} helpers (returning truthy values)', (function (_IfUnlessHelperTest8) { + babelHelpers.inherits(_class8, _IfUnlessHelperTest8); + + function _class8() { + _IfUnlessHelperTest8.apply(this, arguments); + } + + _class8.prototype.templateFor = function templateFor(_ref8) { + var cond = _ref8.cond; + var truthy = _ref8.truthy; + var falsy = _ref8.falsy; + + return '{{unless (unless ' + cond + ' false ' + cond + ') ' + falsy + ' ' + truthy + '}}'; + }; + + return _class8; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessHelperTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: nested {{unless}} helpers (returning falsy values)', (function (_IfUnlessHelperTest9) { + babelHelpers.inherits(_class9, _IfUnlessHelperTest9); + + function _class9() { + _IfUnlessHelperTest9.apply(this, arguments); + } + + _class9.prototype.templateFor = function templateFor(_ref9) { + var cond = _ref9.cond; + var truthy = _ref9.truthy; + var falsy = _ref9.falsy; + + return '{{unless (unless ' + cond + ' ' + cond + ' true) ' + falsy + ' ' + truthy + '}}'; + }; + + return _class9; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessHelperTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{unless}} used with another helper', (function (_IfUnlessHelperTest10) { + babelHelpers.inherits(_class10, _IfUnlessHelperTest10); + + function _class10() { + _IfUnlessHelperTest10.apply(this, arguments); + } + + _class10.prototype.wrapperFor = function wrapperFor(templates) { + return '{{concat ' + templates.join(' ') + '}}'; + }; + + _class10.prototype.templateFor = function templateFor(_ref10) { + var cond = _ref10.cond; + var truthy = _ref10.truthy; + var falsy = _ref10.falsy; + + return '(unless ' + cond + ' ' + falsy + ' ' + truthy + ')'; + }; + + return _class10; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessHelperTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{unless}} used in attribute position', (function (_IfUnlessHelperTest11) { + babelHelpers.inherits(_class11, _IfUnlessHelperTest11); + + function _class11() { + _IfUnlessHelperTest11.apply(this, arguments); + } + + _class11.prototype.wrapperFor = function wrapperFor(templates) { + return '
    '; + }; + + _class11.prototype.templateFor = function templateFor(_ref11) { + var cond = _ref11.cond; + var truthy = _ref11.truthy; + var falsy = _ref11.falsy; + + return '{{unless ' + cond + ' ' + falsy + ' ' + truthy + '}}'; + }; + + _class11.prototype.textValue = function textValue() { + return this.$('div').attr('data-foo'); + }; + + return _class11; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessHelperTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/if-unless-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/if-unless-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/if-unless-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/if-unless-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/if-unless-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/if-unless-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember-utils', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/test-case', 'internal-test-helpers'], function (exports, _emberUtils, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsTestCase, _internalTestHelpers) { + 'use strict'; + + var InputRenderingTest = (function (_RenderingTest) { + babelHelpers.inherits(InputRenderingTest, _RenderingTest); + + function InputRenderingTest() { + _RenderingTest.call(this); + + this.registerComponent('-text-field', { ComponentClass: _emberGlimmerTestsUtilsHelpers.TextField }); + this.registerComponent('-checkbox', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Checkbox }); + } + + InputRenderingTest.prototype.$input = function $input() { + return this.$('input'); + }; + + InputRenderingTest.prototype.inputID = function inputID() { + return this.$input().prop('id'); + }; + + InputRenderingTest.prototype.assertDisabled = function assertDisabled() { + this.assert.ok(this.$('input').prop('disabled'), 'The input is disabled'); + }; + + InputRenderingTest.prototype.assertNotDisabled = function assertNotDisabled() { + this.assert.ok(this.$('input').is(':not(:disabled)'), 'The input is not disabled'); + }; + + InputRenderingTest.prototype.assertInputId = function assertInputId(expectedId) { + this.assert.equal(this.inputID(), expectedId, 'the input id should be `expectedId`'); + }; + + InputRenderingTest.prototype.assertSingleInput = function assertSingleInput() { + this.assert.equal(this.$('input').length, 1, 'A single text field was inserted'); + }; + + InputRenderingTest.prototype.assertSingleCheckbox = function assertSingleCheckbox() { + this.assert.equal(this.$('input[type=checkbox]').length, 1, 'A single checkbox is added'); + }; + + InputRenderingTest.prototype.assertCheckboxIsChecked = function assertCheckboxIsChecked() { + this.assert.equal(this.$input().prop('checked'), true, 'the checkbox is checked'); + }; + + InputRenderingTest.prototype.assertCheckboxIsNotChecked = function assertCheckboxIsNotChecked() { + this.assert.equal(this.$input().prop('checked'), false, 'the checkbox is not checked'); + }; + + InputRenderingTest.prototype.assertValue = function assertValue(expected) { + this.assert.equal(this.$input().val(), expected, 'the input value should be ' + expected); + }; + + InputRenderingTest.prototype.assertAttr = function assertAttr(name, expected) { + this.assert.equal(this.$input().attr(name), expected, 'the input ' + name + ' attribute has the value \'' + expected + '\''); + }; + + InputRenderingTest.prototype.assertAllAttrs = function assertAllAttrs(names, expected) { + var _this = this; + + names.forEach(function (name) { + return _this.assertAttr(name, expected); + }); + }; + + InputRenderingTest.prototype.assertSelectionRange = function assertSelectionRange(start, end) { + var input = this.$input()[0]; + this.assert.equal(input.selectionStart, start, 'the cursor start position should be ' + start); + this.assert.equal(input.selectionEnd, end, 'the cursor end position should be ' + end); + }; + + InputRenderingTest.prototype.triggerEvent = function triggerEvent(type, options) { + var event = document.createEvent('Events'); + event.initEvent(type, true, true); + _emberUtils.assign(event, options); + + var element = this.$input()[0]; + this.runTask(function () { + element.dispatchEvent(event); + }); + }; + + return InputRenderingTest; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{input}}', (function (_InputRenderingTest) { + babelHelpers.inherits(_class, _InputRenderingTest); + + function _class() { + _InputRenderingTest.apply(this, arguments); + } + + _class.prototype['@test a single text field is inserted into the DOM'] = function testASingleTextFieldIsInsertedIntoTheDOM(assert) { + var _this2 = this; + + this.render('{{input type="text" value=value}}', { value: 'hello' }); + + var id = this.inputID(); + + this.assertValue('hello'); + this.assertSingleInput(); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertValue('hello'); + this.assertSingleInput(); + this.assertInputId(id); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'value', 'goodbye'); + }); + + this.assertValue('goodbye'); + this.assertSingleInput(); + this.assertInputId(id); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'value', 'hello'); + }); + + this.assertValue('hello'); + this.assertSingleInput(); + this.assertInputId(id); + }; + + _class.prototype['@test default type'] = function testDefaultType() { + var _this3 = this; + + this.render('{{input}}'); + + this.assertAttr('type', 'text'); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertAttr('type', 'text'); + }; + + _class.prototype['@test dynamic attributes'] = function testDynamicAttributes() { + var _this4 = this; + + this.render('\n {{input type="text"\n disabled=disabled\n value=value\n placeholder=placeholder\n name=name\n maxlength=maxlength\n size=size\n tabindex=tabindex\n }}', { + disabled: false, + value: 'Original value', + placeholder: 'Original placeholder', + name: 'original-name', + maxlength: 10, + size: 20, + tabindex: 30 + }); + + this.assertNotDisabled(); + this.assertValue('Original value'); + this.assertAttr('placeholder', 'Original placeholder'); + this.assertAttr('name', 'original-name'); + this.assertAttr('maxlength', '10'); + // this.assertAttr('size', '20'); //NOTE: failing in IE (TEST_SUITE=sauce) + // this.assertAttr('tabindex', '30'); //NOTE: failing in IE (TEST_SUITE=sauce) + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assertNotDisabled(); + this.assertValue('Original value'); + this.assertAttr('placeholder', 'Original placeholder'); + this.assertAttr('name', 'original-name'); + this.assertAttr('maxlength', '10'); + // this.assertAttr('size', '20'); //NOTE: failing in IE (TEST_SUITE=sauce) + // this.assertAttr('tabindex', '30'); //NOTE: failing in IE (TEST_SUITE=sauce) + + this.runTask(function () { + _emberMetal.set(_this4.context, 'value', 'Updated value'); + _emberMetal.set(_this4.context, 'disabled', true); + _emberMetal.set(_this4.context, 'placeholder', 'Updated placeholder'); + _emberMetal.set(_this4.context, 'name', 'updated-name'); + _emberMetal.set(_this4.context, 'maxlength', 11); + // set(this.context, 'size', 21); //NOTE: failing in IE (TEST_SUITE=sauce) + // set(this.context, 'tabindex', 31); //NOTE: failing in IE (TEST_SUITE=sauce) + }); + + this.assertDisabled(); + this.assertValue('Updated value'); + this.assertAttr('placeholder', 'Updated placeholder'); + this.assertAttr('name', 'updated-name'); + this.assertAttr('maxlength', '11'); + // this.assertAttr('size', '21'); //NOTE: failing in IE (TEST_SUITE=sauce) + // this.assertAttr('tabindex', '31'); //NOTE: failing in IE (TEST_SUITE=sauce) + + this.runTask(function () { + _emberMetal.set(_this4.context, 'value', 'Original value'); + _emberMetal.set(_this4.context, 'disabled', false); + _emberMetal.set(_this4.context, 'placeholder', 'Original placeholder'); + _emberMetal.set(_this4.context, 'name', 'original-name'); + _emberMetal.set(_this4.context, 'maxlength', 10); + // set(this.context, 'size', 20); //NOTE: failing in IE (TEST_SUITE=sauce) + // set(this.context, 'tabindex', 30); //NOTE: failing in IE (TEST_SUITE=sauce) + }); + + this.assertNotDisabled(); + this.assertValue('Original value'); + this.assertAttr('placeholder', 'Original placeholder'); + this.assertAttr('name', 'original-name'); + this.assertAttr('maxlength', '10'); + // this.assertAttr('size', '20'); //NOTE: failing in IE (TEST_SUITE=sauce) + // this.assertAttr('tabindex', '30'); //NOTE: failing in IE (TEST_SUITE=sauce) + }; + + _class.prototype['@test static attributes'] = function testStaticAttributes() { + var _this5 = this; + + this.render('\n {{input type="text"\n disabled=true\n value="Original value"\n placeholder="Original placeholder"\n name="original-name"\n maxlength=10\n size=20\n tabindex=30\n }}'); + + this.assertDisabled(); + this.assertValue('Original value'); + this.assertAttr('placeholder', 'Original placeholder'); + this.assertAttr('name', 'original-name'); + this.assertAttr('maxlength', '10'); + // this.assertAttr('size', '20'); //NOTE: failing in IE (TEST_SUITE=sauce) + // this.assertAttr('tabindex', '30'); //NOTE: failing in IE (TEST_SUITE=sauce) + + this.runTask(function () { + return _this5.rerender(); + }); + + this.assertDisabled(); + this.assertValue('Original value'); + this.assertAttr('placeholder', 'Original placeholder'); + this.assertAttr('name', 'original-name'); + this.assertAttr('maxlength', '10'); + // this.assertAttr('size', '20'); //NOTE: failing in IE (TEST_SUITE=sauce) + // this.assertAttr('tabindex', '30'); //NOTE: failing in IE (TEST_SUITE=sauce) + }; + + _class.prototype['@test cursor selection range'] = function testCursorSelectionRange(assert) { + var _this6 = this; + + // Modifying input.selectionStart, which is utilized in the cursor tests, + // causes an event in Safari. + _internalTestHelpers.runDestroy(this.owner.lookup('event_dispatcher:main')); + + this.render('{{input type="text" value=value}}', { value: 'original' }); + + var input = this.$input()[0]; + + // See https://ember-twiddle.com/33e506329f8176ae874422644d4cc08c?openFiles=components.input-component.js%2Ctemplates.components.input-component.hbs + // this.assertSelectionRange(8, 8); //NOTE: this is (0, 0) on Firefox (TEST_SUITE=sauce) + + this.runTask(function () { + return _this6.rerender(); + }); + + // this.assertSelectionRange(8, 8); //NOTE: this is (0, 0) on Firefox (TEST_SUITE=sauce) + + this.runTask(function () { + input.selectionStart = 2; + input.selectionEnd = 4; + }); + + this.assertSelectionRange(2, 4); + + this.runTask(function () { + return _this6.rerender(); + }); + + this.assertSelectionRange(2, 4); + + // this.runTask(() => set(this.context, 'value', 'updated')); + // + // this.assertSelectionRange(7, 7); //NOTE: this fails in IE, the range is 0 -> 0 (TEST_SUITE=sauce) + // + // this.runTask(() => set(this.context, 'value', 'original')); + // + // this.assertSelectionRange(8, 8); //NOTE: this fails in IE, the range is 0 -> 0 (TEST_SUITE=sauce) + }; + + _class.prototype['@test specifying `on="someevent" action="foo"` results in a deprecation warning'] = function testSpecifyingOnSomeeventActionFooResultsInADeprecationWarning() { + var _this7 = this; + + expectDeprecation(function () { + _this7.render('{{input on="focus-in" action="doFoo" value="hello"}}'); + }, 'Using \'{{input on="focus-in" action="doFoo"}}\' (\'-top-level\' @ L1:C0) is deprecated. Please use \'{{input focus-in="doFoo"}}\' instead.'); + }; + + _class.prototype['@test sends an action with `{{input action="foo"}}` when is pressed [DEPRECATED]'] = function testSendsAnActionWithInputActionFooWhenEnterIsPressedDEPRECATED(assert) { + var _this8 = this; + + assert.expect(2); + + expectDeprecation(function () { + _this8.render('{{input action=\'foo\'}}', { + actions: { + foo: function () { + assert.ok(true, 'action was triggered'); + } + } + }); + }, /Please use '{{input enter="foo"}}' instead/); + + this.triggerEvent('keyup', { + keyCode: 13 + }); + }; + + _class.prototype['@test sends an action with `{{input enter="foo"}}` when is pressed'] = function testSendsAnActionWithInputEnterFooWhenEnterIsPressed(assert) { + assert.expect(1); + + this.render('{{input enter=\'foo\'}}', { + actions: { + foo: function () { + assert.ok(true, 'action was triggered'); + } + } + }); + + this.triggerEvent('keyup', { + keyCode: 13 + }); + }; + + _class.prototype['@test sends an action with `{{input key-press="foo"}}` is pressed'] = function testSendsAnActionWithInputKeyPressFooIsPressed(assert) { + assert.expect(1); + + this.render('{{input value=value key-press=\'foo\'}}', { + value: 'initial', + + actions: { + foo: function () { + assert.ok(true, 'action was triggered'); + } + } + }); + + this.triggerEvent('keypress', { + keyCode: 65 + }); + }; + + _class.prototype['@test sends an action to the parent level when `bubbles=true` is provided'] = function testSendsAnActionToTheParentLevelWhenBubblesTrueIsProvided(assert) { + assert.expect(1); + + var ParentComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + change: function () { + assert.ok(true, 'bubbled upwards'); + } + }); + + this.registerComponent('x-parent', { + ComponentClass: ParentComponent, + template: '{{input bubbles=true}}' + }); + this.render('{{x-parent}}'); + + this.triggerEvent('change'); + }; + + _class.prototype['@test triggers `focus-in` when focused'] = function testTriggersFocusInWhenFocused(assert) { + var _this9 = this; + + assert.expect(1); + + this.render('{{input focus-in=\'foo\'}}', { + actions: { + foo: function () { + assert.ok(true, 'action was triggered'); + } + } + }); + + this.runTask(function () { + _this9.$input().trigger('focusin'); + }); + }; + + _class.prototype['@test sends `insert-newline` when is pressed'] = function testSendsInsertNewlineWhenEnterIsPressed(assert) { + assert.expect(1); + + this.render('{{input insert-newline=\'foo\'}}', { + actions: { + foo: function () { + assert.ok(true, 'action was triggered'); + } + } + }); + + this.triggerEvent('keyup', { + keyCode: 13 + }); + }; + + _class.prototype['@test sends an action with `{{input escape-press="foo"}}` when is pressed'] = function testSendsAnActionWithInputEscapePressFooWhenEscapeIsPressed(assert) { + assert.expect(1); + + this.render('{{input escape-press=\'foo\'}}', { + actions: { + foo: function () { + assert.ok(true, 'action was triggered'); + } + } + }); + + this.triggerEvent('keyup', { + keyCode: 27 + }); + }; + + _class.prototype['@test sends an action with `{{input key-down="foo"}}` when a key is pressed'] = function testSendsAnActionWithInputKeyDownFooWhenAKeyIsPressed(assert) { + assert.expect(1); + + this.render('{{input key-down=\'foo\'}}', { + actions: { + foo: function () { + assert.ok(true, 'action was triggered'); + } + } + }); + + this.triggerEvent('keydown', { + keyCode: 65 + }); + }; + + _class.prototype['@test sends an action with `{{input key-up="foo"}}` when a key is pressed'] = function testSendsAnActionWithInputKeyUpFooWhenAKeyIsPressed(assert) { + assert.expect(1); + + this.render('{{input key-up=\'foo\'}}', { + actions: { + foo: function () { + assert.ok(true, 'action was triggered'); + } + } + }); + + this.triggerEvent('keyup', { + keyCode: 65 + }); + }; + + return _class; + })(InputRenderingTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{input}} with dynamic type', (function (_InputRenderingTest2) { + babelHelpers.inherits(_class2, _InputRenderingTest2); + + function _class2() { + _InputRenderingTest2.apply(this, arguments); + } + + _class2.prototype['@test a bound property can be used to determine type'] = function testABoundPropertyCanBeUsedToDetermineType() { + var _this10 = this; + + this.render('{{input type=type}}', { type: 'password' }); + + this.assertAttr('type', 'password'); + + this.runTask(function () { + return _this10.rerender(); + }); + + this.assertAttr('type', 'password'); + + this.runTask(function () { + return _emberMetal.set(_this10.context, 'type', 'text'); + }); + + this.assertAttr('type', 'text'); + + this.runTask(function () { + return _emberMetal.set(_this10.context, 'type', 'password'); + }); + + this.assertAttr('type', 'password'); + }; + + return _class2; + })(InputRenderingTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{input type=\'checkbox\'}}', (function (_InputRenderingTest3) { + babelHelpers.inherits(_class3, _InputRenderingTest3); + + function _class3() { + _InputRenderingTest3.apply(this, arguments); + } + + _class3.prototype['@test dynamic attributes'] = function testDynamicAttributes() { + var _this11 = this; + + this.render('{{input\n type=\'checkbox\'\n disabled=disabled\n name=name\n checked=checked\n tabindex=tabindex\n }}', { + disabled: false, + name: 'original-name', + checked: false, + tabindex: 10 + }); + + this.assertSingleCheckbox(); + this.assertNotDisabled(); + this.assertAttr('name', 'original-name'); + this.assertAttr('tabindex', '10'); + + this.runTask(function () { + return _this11.rerender(); + }); + + this.assertSingleCheckbox(); + this.assertNotDisabled(); + this.assertAttr('name', 'original-name'); + this.assertAttr('tabindex', '10'); + + this.runTask(function () { + _emberMetal.set(_this11.context, 'disabled', true); + _emberMetal.set(_this11.context, 'name', 'updated-name'); + _emberMetal.set(_this11.context, 'tabindex', 11); + }); + + this.assertSingleCheckbox(); + this.assertDisabled(); + this.assertAttr('name', 'updated-name'); + this.assertAttr('tabindex', '11'); + + this.runTask(function () { + _emberMetal.set(_this11.context, 'disabled', false); + _emberMetal.set(_this11.context, 'name', 'original-name'); + _emberMetal.set(_this11.context, 'tabindex', 10); + }); + + this.assertSingleCheckbox(); + this.assertNotDisabled(); + this.assertAttr('name', 'original-name'); + this.assertAttr('tabindex', '10'); + }; + + _class3.prototype['@test `value` property assertion'] = function testValuePropertyAssertion() { + var _this12 = this; + + expectAssertion(function () { + _this12.render('{{input type="checkbox" value=value}}', { value: 'value' }); + }, /you must use `checked=/); + }; + + _class3.prototype['@test with a bound type'] = function testWithABoundType(assert) { + var _this13 = this; + + this.render('{{input type=inputType checked=isChecked}}', { inputType: 'checkbox', isChecked: true }); + + this.assertSingleCheckbox(); + this.assertCheckboxIsChecked(); + + this.runTask(function () { + return _this13.rerender(); + }); + + this.assertCheckboxIsChecked(); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'isChecked', false); + }); + + this.assertCheckboxIsNotChecked(); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'isChecked', true); + }); + + this.assertCheckboxIsChecked(); + }; + + _class3.prototype['@test with static values'] = function testWithStaticValues(assert) { + var _this14 = this; + + this.render('{{input type="checkbox" disabled=false tabindex=10 name="original-name" checked=false}}'); + + this.assertSingleCheckbox(); + this.assertCheckboxIsNotChecked(); + this.assertNotDisabled(); + this.assertAttr('tabindex', '10'); + this.assertAttr('name', 'original-name'); + + this.runTask(function () { + return _this14.rerender(); + }); + + this.assertSingleCheckbox(); + this.assertCheckboxIsNotChecked(); + this.assertNotDisabled(); + this.assertAttr('tabindex', '10'); + this.assertAttr('name', 'original-name'); + }; + + return _class3; + })(InputRenderingTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{input type=\'text\'}}', (function (_InputRenderingTest4) { + babelHelpers.inherits(_class4, _InputRenderingTest4); + + function _class4() { + _InputRenderingTest4.apply(this, arguments); + } + + _class4.prototype['@test null values'] = function testNullValues(assert) { + var _this15 = this; + + var attributes = ['disabled', 'placeholder', 'name', 'maxlength', 'size', 'tabindex']; + + this.render('\n {{input type="text"\n disabled=disabled\n value=value\n placeholder=placeholder\n name=name\n maxlength=maxlength\n size=size\n tabindex=tabindex\n }}', { + disabled: null, + value: null, + placeholder: null, + name: null, + maxlength: null, + size: null, + tabindex: null + }); + + this.assertValue(''); + this.assertAllAttrs(attributes, undefined); + + this.runTask(function () { + return _this15.rerender(); + }); + + this.assertValue(''); + this.assertAllAttrs(attributes, undefined); + + this.runTask(function () { + _emberMetal.set(_this15.context, 'disabled', true); + _emberMetal.set(_this15.context, 'value', 'Updated value'); + _emberMetal.set(_this15.context, 'placeholder', 'Updated placeholder'); + _emberMetal.set(_this15.context, 'name', 'updated-name'); + _emberMetal.set(_this15.context, 'maxlength', 11); + _emberMetal.set(_this15.context, 'size', 21); + _emberMetal.set(_this15.context, 'tabindex', 31); + }); + + this.assertDisabled(); + this.assertValue('Updated value'); + this.assertAttr('placeholder', 'Updated placeholder'); + this.assertAttr('name', 'updated-name'); + this.assertAttr('maxlength', '11'); + this.assertAttr('size', '21'); + this.assertAttr('tabindex', '31'); + + this.runTask(function () { + _emberMetal.set(_this15.context, 'disabled', null); + _emberMetal.set(_this15.context, 'value', null); + _emberMetal.set(_this15.context, 'placeholder', null); + _emberMetal.set(_this15.context, 'name', null); + _emberMetal.set(_this15.context, 'maxlength', null); + // set(this.context, 'size', null); //NOTE: this fails with `Error: Failed to set the 'size' property on 'HTMLInputElement': The value provided is 0, which is an invalid size.` (TEST_SUITE=sauce) + _emberMetal.set(_this15.context, 'tabindex', null); + }); + + this.assertAttr('disabled', undefined); + this.assertValue(''); + // this.assertAttr('placeholder', undefined); //NOTE: this fails with a value of "null" (TEST_SUITE=sauce) + // this.assertAttr('name', undefined); //NOTE: this fails with a value of "null" (TEST_SUITE=sauce) + this.assertAttr('maxlength', undefined); + // this.assertAttr('size', undefined); //NOTE: re-enable once `size` bug above has been addressed + this.assertAttr('tabindex', undefined); + }; + + return _class4; + })(InputRenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/input-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/input-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/input-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/input-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/input-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/input-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/loc-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal, _ember) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{loc}}', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.call(this); + this.oldString = _ember.default.STRINGS; + _ember.default.STRINGS = { + 'Hello Friend': 'Hallo Freund', + 'Hello': 'Hallo, %@' + }; + } + + _class.prototype.teardown = function teardown() { + _RenderingTest.prototype.teardown.call(this); + _ember.default.STRINGS = this.oldString; + }; + + _class.prototype['@test it lets the original value through by default'] = function testItLetsTheOriginalValueThroughByDefault() { + var _this = this; + + this.render('{{loc "Hiya buddy!"}}'); + this.assertText('Hiya buddy!', 'the unlocalized string is correct'); + this.runTask(function () { + return _this.rerender(); + }); + this.assertText('Hiya buddy!', 'the unlocalized string is correct after rerender'); + }; + + _class.prototype['@test it localizes a simple string'] = function testItLocalizesASimpleString() { + var _this2 = this; + + this.render('{{loc "Hello Friend"}}'); + this.assertText('Hallo Freund', 'the localized string is correct'); + this.runTask(function () { + return _this2.rerender(); + }); + this.assertText('Hallo Freund', 'the localized string is correct after rerender'); + }; + + _class.prototype['@test it takes passed formats into an account'] = function testItTakesPassedFormatsIntoAnAccount() { + var _this3 = this; + + this.render('{{loc "%@, %@" "Hello" "Mr. Pitkin"}}'); + this.assertText('Hello, Mr. Pitkin', 'the formatted string is correct'); + this.runTask(function () { + return _this3.rerender(); + }); + this.assertText('Hello, Mr. Pitkin', 'the formatted string is correct after rerender'); + }; + + _class.prototype['@test it updates when bound params change'] = function testItUpdatesWhenBoundParamsChange() { + var _this4 = this; + + this.render('{{loc simple}} - {{loc personal \'Mr. Pitkin\'}}', { + simple: 'Hello Friend', + personal: 'Hello' + }); + this.assertText('Hallo Freund - Hallo, Mr. Pitkin', 'the bound value is correct'); + + this.runTask(function () { + return _this4.rerender(); + }); + this.assertText('Hallo Freund - Hallo, Mr. Pitkin', 'the bound value is correct after rerender'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'simple', 'G\'day mate'); + }); + this.assertText('G\'day mate - Hallo, Mr. Pitkin', 'the bound value is correct after update'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'simple', 'Hello Friend'); + }); + this.assertText('Hallo Freund - Hallo, Mr. Pitkin', 'the bound value is correct after reset'); + }; + + _class.prototype['@test it updates when nested bound params change'] = function testItUpdatesWhenNestedBoundParamsChange() { + var _this5 = this; + + this.render('{{loc greetings.simple}} - {{loc greetings.personal \'Mr. Pitkin\'}}', { + greetings: { + simple: 'Hello Friend', + personal: 'Hello' + } + }); + this.assertText('Hallo Freund - Hallo, Mr. Pitkin', 'the bound value is correct'); + + this.runTask(function () { + return _this5.rerender(); + }); + this.assertText('Hallo Freund - Hallo, Mr. Pitkin', 'the bound value is correct after rerender'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'greetings.simple', 'G\'day mate'); + }); + this.assertText('G\'day mate - Hallo, Mr. Pitkin', 'the bound value is correct after interior mutation'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'greetings', { + simple: 'Hello Friend', + personal: 'Hello' + }); + }); + this.assertText('Hallo Freund - Hallo, Mr. Pitkin', 'the bound value is correct after replacement'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/loc-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/loc-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/loc-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/loc-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/loc-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/loc-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/log-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-console'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberConsole) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{log}}', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class(assert) { + var _this = this; + + _RenderingTest.call(this); + + this.originalLog = _emberConsole.default.log; + this.logCalls = []; + _emberConsole.default.log = function () { + var _logCalls; + + (_logCalls = _this.logCalls).push.apply(_logCalls, arguments); + }; + } + + _class.prototype.teardown = function teardown() { + _RenderingTest.prototype.teardown.call(this); + _emberConsole.default.log = this.originalLog; + }; + + _class.prototype.assertLog = function assertLog(values) { + this.assertText(''); + this.assert.strictEqual(this.logCalls.length, values.length); + + for (var i = 0, len = values.length; i < len; i++) { + this.assert.strictEqual(this.logCalls[i], values[i]); + } + }; + + _class.prototype['@test correctly logs primitives'] = function testCorrectlyLogsPrimitives() { + this.render('{{log "one" 1 true}}'); + + this.assertLog(['one', 1, true]); + }; + + _class.prototype['@test correctly logs a property'] = function testCorrectlyLogsAProperty() { + this.render('{{log value}}', { + value: 'one' + }); + + this.assertLog(['one']); + }; + + _class.prototype['@test correctly logs multiple arguments'] = function testCorrectlyLogsMultipleArguments() { + this.render('{{log "my variable:" value}}', { + value: 'one' + }); + + this.assertLog(['my variable:', 'one']); + }; + + _class.prototype['@test correctly logs `this`'] = function testCorrectlyLogsThis() { + this.render('{{log this}}'); + + this.assertLog([this.context]); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/log-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/log-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/log-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/log-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/log-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/log-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/mut-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal', 'ember-glimmer/tests/utils/test-helpers'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal, _emberGlimmerTestsUtilsTestHelpers) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{mut}}', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test a simple mutable binding using `mut` propagates properly'] = function testASimpleMutableBindingUsingMutPropagatesProperly() { + var _this = this; + + var bottom = undefined; + + this.registerComponent('bottom-mut', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + bottom = this; + } + }), + template: '{{setMe}}' + }); + + this.registerComponent('middle-mut', { + template: '{{bottom-mut setMe=value}}' + }); + + this.render('{{middle-mut value=(mut val)}}', { + val: 12 + }); + + this.assertText('12', 'the data propagated downwards'); + + this.assertStableRerender(); + + this.runTask(function () { + return bottom.attrs.setMe.update(13); + }); + + this.assertText('13', 'the set took effect'); + this.assert.strictEqual(_emberMetal.get(bottom, 'setMe'), 13, 'the set took effect on bottom\'s prop'); + this.assert.strictEqual(bottom.attrs.setMe.value, 13, 'the set took effect on bottom\'s attr'); + this.assert.strictEqual(_emberMetal.get(this.context, 'val'), 13, 'the set propagated back up'); + + this.runTask(function () { + return _emberMetal.set(bottom, 'setMe', 14); + }); + + this.assertText('14', 'the set took effect'); + this.assert.strictEqual(_emberMetal.get(bottom, 'setMe'), 14, 'the set took effect on bottom\'s prop'); + this.assert.strictEqual(bottom.attrs.setMe.value, 14, 'the set took effect on bottom\'s attr'); + this.assert.strictEqual(_emberMetal.get(this.context, 'val'), 14, 'the set propagated back up'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'val', 12); + }); + + this.assertText('12'); + }; + + _class.prototype['@test a simple mutable binding using `mut` inserts into the DOM'] = function testASimpleMutableBindingUsingMutInsertsIntoTheDOM() { + var _this2 = this; + + var bottom = undefined, + middle = undefined; + + this.registerComponent('bottom-mut', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + bottom = this; + } + }), + template: '{{setMe}}' + }); + + this.registerComponent('middle-mut', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + middle = this; + } + }), + template: '{{bottom-mut setMe=(mut value)}}' + }); + + this.render('{{middle-mut value=(mut val)}}', { + val: 12 + }); + + this.assertText('12', 'the data propagated downwards'); + + this.assertStableRerender(); + + this.runTask(function () { + return bottom.attrs.setMe.update(13); + }); + + this.assertText('13', 'the set took effect'); + this.assert.strictEqual(_emberMetal.get(bottom, 'setMe'), 13, 'the set took effect on bottom\'s prop'); + this.assert.strictEqual(bottom.attrs.setMe.value, 13, 'the set took effect on bottom\'s attr'); + this.assert.strictEqual(_emberMetal.get(middle, 'value'), 13, 'the set propagated to middle\'s prop'); + this.assert.strictEqual(middle.attrs.value.value, 13, 'the set propagated to middle\'s attr'); + this.assert.strictEqual(_emberMetal.get(this.context, 'val'), 13, 'the set propagated back up'); + + this.runTask(function () { + return _emberMetal.set(bottom, 'setMe', 14); + }); + + this.assertText('14', 'the set took effect'); + this.assert.strictEqual(_emberMetal.get(bottom, 'setMe'), 14, 'the set took effect on bottom\'s prop'); + this.assert.strictEqual(bottom.attrs.setMe.value, 14, 'the set took effect on bottom\'s attr'); + this.assert.strictEqual(_emberMetal.get(middle, 'value'), 14, 'the set propagated to middle\'s prop'); + this.assert.strictEqual(middle.attrs.value.value, 14, 'the set propagated to middle\'s attr'); + this.assert.strictEqual(_emberMetal.get(this.context, 'val'), 14, 'the set propagated back up'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'val', 12); + }); + + this.assertText('12'); + }; + + _class.prototype['@test passing a literal results in a assertion'] = function testPassingALiteralResultsInAAssertion() { + var _this3 = this; + + this.registerComponent('bottom-mut', { template: '{{setMe}}' }); + + expectAssertion(function () { + _this3.render('{{bottom-mut setMe=(mut "foo bar")}}'); + }, 'You can only pass a path to mut'); + }; + + _class.prototype['@test passing the result of a helper invocation results in an assertion'] = function testPassingTheResultOfAHelperInvocationResultsInAnAssertion() { + var _this4 = this; + + this.registerComponent('bottom-mut', { template: '{{setMe}}' }); + + expectAssertion(function () { + _this4.render('{{bottom-mut setMe=(mut (concat "foo" " " "bar"))}}'); + }, 'You can only pass a path to mut'); + }; + + // See https://github.com/emberjs/ember.js/commit/807a0cd for an explanation of this test + + _class.prototype['@test using a string value through middle tier does not trigger assertion (due to the auto-mut transform)'] = function testUsingAStringValueThroughMiddleTierDoesNotTriggerAssertionDueToTheAutoMutTransform() { + var bottom = undefined; + + this.registerComponent('bottom-mut', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + bottom = this; + } + }), + template: '{{stuff}}' + }); + + this.registerComponent('middle-mut', { + template: '{{bottom-mut stuff=value}}' + }); + + this.render('{{middle-mut value="foo"}}'); + + this.assert.equal(_emberMetal.get(bottom, 'stuff'), 'foo', 'the data propagated'); + this.assertText('foo'); + + this.assertStableRerender(); + + // No U-R for this test + }; + + _class.prototype['@test {{readonly}} of a {{mut}} is converted into an immutable binding'] = function testReadonlyOfAMutIsConvertedIntoAnImmutableBinding() { + var _this5 = this; + + var middle = undefined, + bottom = undefined; + + this.registerComponent('bottom-mut', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + bottom = this; + } + }), + template: '{{setMe}}' + }); + + this.registerComponent('middle-mut', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + middle = this; + } + }), + template: '{{bottom-mut setMe=(readonly value)}}' + }); + + this.render('{{middle-mut value=(mut val)}}', { + val: 12 + }); + + this.assertText('12'); + + this.assertStableRerender(); + + this.runTask(function () { + return middle.attrs.value.update(13); + }); + + this.assert.strictEqual(_emberMetal.get(middle, 'value'), 13, 'the set took effect on middle\'s prop'); + this.assert.strictEqual(middle.attrs.value.value, 13, 'the set took effect on middle\'s attr'); + + this.runTask(function () { + return _emberMetal.set(middle, 'value', 14); + }); + + this.assert.strictEqual(_emberMetal.get(middle, 'value'), 14, 'the set took effect on middle\'s prop'); + this.assert.strictEqual(middle.attrs.value.value, 14, 'the set took effect on middle\'s attr'); + this.assert.strictEqual(bottom.attrs.setMe, 14, 'the mutable binding has been converted to an immutable cell'); + this.assertText('14'); + this.assert.strictEqual(_emberMetal.get(this.context, 'val'), 14, 'the set propagated back up'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'val', 12); + }); + + this.assertText('12'); + }; + + _class.prototype['@test mutable bindings work inside of yielded content'] = function testMutableBindingsWorkInsideOfYieldedContent() { + var _this6 = this; + + this.registerComponent('bottom-mut', { + template: '{{yield}}' + }); + + this.registerComponent('middle-mut', { + template: '{{#bottom-mut}}{{model.name}}{{/bottom-mut}}' + }); + + this.render('{{middle-mut model=(mut model)}}', { + model: { name: 'Matthew Beale' } + }); + + this.assertText('Matthew Beale'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'model.name', 'Joel Kang'); + }); + + this.assertText('Joel Kang'); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'model', { name: 'Matthew Beale' }); + }); + + this.assertText('Matthew Beale'); + }; + + _class.prototype['@test a simple mutable binding using {{mut}} is available in hooks'] = function testASimpleMutableBindingUsingMutIsAvailableInHooks() { + var _this7 = this; + + var bottom = undefined; + var willRender = []; + var didInsert = []; + + this.registerComponent('bottom-mut', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + willRender: function () { + willRender.push(_emberMetal.get(this, 'setMe')); + }, + didInsertElement: function () { + didInsert.push(_emberMetal.get(this, 'setMe')); + bottom = this; + } + }), + template: '{{setMe}}' + }); + + this.registerComponent('middle-mut', { + template: '{{bottom-mut setMe=(mut value)}}' + }); + + this.render('{{middle-mut value=(mut val)}}', { + val: 12 + }); + + this.assert.deepEqual(willRender, [12], 'willReceive is [12]'); + this.assert.deepEqual(didInsert, [12], 'didInsert is [12]'); + this.assertText('12'); + + this.assertStableRerender(); + + this.assert.deepEqual(willRender, [12], 'willReceive is [12]'); + this.assert.deepEqual(didInsert, [12], 'didInsert is [12]'); + this.assert.strictEqual(_emberMetal.get(bottom, 'setMe'), 12, 'the data propagated'); + + this.runTask(function () { + return bottom.attrs.setMe.update(13); + }); + + this.assert.strictEqual(_emberMetal.get(bottom, 'setMe'), 13, 'the set took effect on bottom\'s prop'); + this.assert.strictEqual(bottom.attrs.setMe.value, 13, 'the set took effect on bottom\'s attr'); + this.assert.strictEqual(_emberMetal.get(this.context, 'val'), 13, 'the set propagated back up'); + + this.runTask(function () { + return _emberMetal.set(bottom, 'setMe', 14); + }); + + this.assert.strictEqual(_emberMetal.get(bottom, 'setMe'), 14, 'the set took effect on bottom\'s prop'); + this.assert.strictEqual(bottom.attrs.setMe.value, 14, 'the set took effect on bottom\'s attr'); + this.assert.strictEqual(_emberMetal.get(this.context, 'val'), 14, 'the set propagated back up'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'val', 12); + }); + + this.assertText('12'); + }; + + _class.prototype['@test a mutable binding with a backing computed property and attribute present in the root of the component is updated when the upstream property invalidates #11023'] = function testAMutableBindingWithABackingComputedPropertyAndAttributePresentInTheRootOfTheComponentIsUpdatedWhenTheUpstreamPropertyInvalidates11023() { + var bottom = undefined, + middle = undefined; + + this.registerComponent('bottom-mut', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + thingy: null, + didInsertElement: function () { + bottom = this; + } + }), + template: '{{thingy}}' + }); + + this.registerComponent('middle-mut', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + baseValue: 12, + val: _emberMetal.computed('baseValue', function () { + return this.get('baseValue'); + }), + didInsertElement: function () { + middle = this; + } + }), + template: '{{bottom-mut thingy=(mut val)}}' + }); + + this.render('{{middle-mut}}'); + + this.assert.strictEqual(_emberMetal.get(bottom, 'thingy'), 12, 'data propagated'); + this.assertText('12'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(middle, 'baseValue', 13); + }); + + this.assert.strictEqual(_emberMetal.get(middle, 'val'), 13, 'the set took effect'); + this.assert.strictEqual(bottom.attrs.thingy.value, 13, 'the set propagated down to bottom\'s attrs'); + this.assert.strictEqual(_emberMetal.get(bottom, 'thingy'), 13, 'the set propagated down to bottom\'s prop'); + this.assertText('13'); + + this.runTask(function () { + return _emberMetal.set(middle, 'baseValue', 12); + }); + + this.assertText('12'); + }; + + _class.prototype['@test automatic mutable bindings exposes a mut cell in attrs'] = function testAutomaticMutableBindingsExposesAMutCellInAttrs() { + var inner = undefined; + + this.registerComponent('x-inner', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + inner = this; + } + }), + template: '{{foo}}' + }); + + this.registerComponent('x-outer', { + template: '{{x-inner foo=bar}}' + }); + + this.render('{{x-outer bar=baz}}', { baz: 'foo' }); + + this.assertText('foo'); + + this.assertStableRerender(); + + this.runTask(function () { + return inner.attrs.foo.update('bar'); + }); + + this.assert.equal(inner.attrs.foo.value, 'bar'); + this.assert.equal(_emberMetal.get(inner, 'foo'), 'bar'); + this.assertText('bar'); + + this.runTask(function () { + return inner.attrs.foo.update('foo'); + }); + + this.assertText('foo'); + }; + + _class.prototype['@test automatic mutable bindings tolerate undefined non-stream inputs and attempts to set them'] = function testAutomaticMutableBindingsTolerateUndefinedNonStreamInputsAndAttemptsToSetThem() { + var inner = undefined; + + this.registerComponent('x-inner', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + inner = this; + } + }), + template: '{{model}}' + }); + + this.registerComponent('x-outer', { + template: '{{x-inner model=nonexistent}}' + }); + + this.render('{{x-outer}}'); + + this.assertText(''); + + this.assertStableRerender(); + + this.runTask(function () { + return inner.attrs.model.update(42); + }); + + this.assert.equal(inner.attrs.model.value, 42); + this.assert.equal(_emberMetal.get(inner, 'model'), 42); + this.assertText('42'); + + this.runTask(function () { + return inner.attrs.model.update(undefined); + }); + + this.assertText(''); + }; + + _class.prototype['@test automatic mutable bindings tolerate constant non-stream inputs and attempts to set them'] = function testAutomaticMutableBindingsTolerateConstantNonStreamInputsAndAttemptsToSetThem() { + var inner = undefined; + + this.registerComponent('x-inner', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + inner = this; + } + }), + template: 'hello{{model}}' + }); + + this.registerComponent('x-outer', { + template: '{{x-inner model=x}}' + }); + + this.render('{{x-outer x="foo"}}'); + + this.assertText('hellofoo'); + + this.assertStableRerender(); + + this.runTask(function () { + return inner.attrs.model.update(42); + }); + + this.assert.equal(inner.attrs.model.value, 42); + this.assert.equal(_emberMetal.get(inner, 'model'), 42); + this.assertText('hello42'); + + this.runTask(function () { + return inner.attrs.model.update('foo'); + }); + + this.assertText('hellofoo'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Mutable Bindings used in Computed Properties that are bound as attributeBindings', (function (_RenderingTest2) { + babelHelpers.inherits(_class2, _RenderingTest2); + + function _class2() { + _RenderingTest2.apply(this, arguments); + } + + _class2.prototype['@test an attribute binding of a computed property of a 2-way bound attr recomputes when the attr changes'] = function testAnAttributeBindingOfAComputedPropertyOfA2WayBoundAttrRecomputesWhenTheAttrChanges() { + var _this8 = this; + + var input = undefined, + output = undefined; + + this.registerComponent('x-input', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + input = this; + } + }) + }); + + this.registerComponent('x-output', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['style'], + didInsertElement: function () { + output = this; + }, + style: _emberMetal.computed('height', function () { + var height = this.get('height'); + return 'height: ' + height + 'px;'; + }), + height: 20 + }), + template: '{{height}}' + }); + + this.render('{{x-output height=height}}{{x-input height=(mut height)}}', { + height: 60 + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { style: _emberGlimmerTestsUtilsTestHelpers.styles('height: 60px;') }, content: '60' }); + + this.assertStableRerender(); + + this.runTask(function () { + return input.attrs.height.update(35); + }); + + this.assert.strictEqual(_emberMetal.get(output, 'height'), 35, 'the set took effect'); + this.assert.strictEqual(_emberMetal.get(this.context, 'height'), 35, 'the set propagated back up'); + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { style: _emberGlimmerTestsUtilsTestHelpers.styles('height: 35px;') }, content: '35' }); + + this.runTask(function () { + return _emberMetal.set(input, 'height', 36); + }); + + this.assert.strictEqual(_emberMetal.get(output, 'height'), 36, 'the set took effect'); + this.assert.strictEqual(_emberMetal.get(this.context, 'height'), 36, 'the set propagated back up'); + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { style: _emberGlimmerTestsUtilsTestHelpers.styles('height: 36px;') }, content: '36' }); + + this.runTask(function () { + return _emberMetal.set(_this8.context, 'height', 60); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { style: _emberGlimmerTestsUtilsTestHelpers.styles('height: 60px;') }, content: '60' }); + this.assert.strictEqual(_emberMetal.get(input, 'height'), 60); + }; + + _class2.prototype['@test an attribute binding of a computed property with a setter of a 2-way bound attr recomputes when the attr changes'] = function testAnAttributeBindingOfAComputedPropertyWithASetterOfA2WayBoundAttrRecomputesWhenTheAttrChanges() { + var _this9 = this; + + var input = undefined, + output = undefined; + + this.registerComponent('x-input', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + input = this; + } + }) + }); + + this.registerComponent('x-output', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + attributeBindings: ['style'], + didInsertElement: function () { + output = this; + }, + style: _emberMetal.computed('height', 'width', function () { + var height = this.get('height'); + var width = this.get('width'); + return 'height: ' + height + 'px; width: ' + width + 'px;'; + }), + height: 20, + width: _emberMetal.computed('height', { + get: function () { + return this.get('height') * 2; + }, + set: function (keyName, width) { + this.set('height', width / 2); + return width; + } + }) + }), + template: '{{width}}x{{height}}' + }); + + this.render('{{x-output width=width}}{{x-input width=(mut width)}}', { + width: 70 + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { style: _emberGlimmerTestsUtilsTestHelpers.styles('height: 35px; width: 70px;') }, content: '70x35' }); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(input, 'width', 80); + }); + + this.assert.strictEqual(_emberMetal.get(output, 'width'), 80, 'the set took effect'); + this.assert.strictEqual(_emberMetal.get(this.context, 'width'), 80, 'the set propagated back up'); + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { style: _emberGlimmerTestsUtilsTestHelpers.styles('height: 40px; width: 80px;') }, content: '80x40' }); + + this.runTask(function () { + return input.attrs.width.update(90); + }); + + this.assert.strictEqual(_emberMetal.get(output, 'width'), 90, 'the set took effect'); + this.assert.strictEqual(_emberMetal.get(this.context, 'width'), 90, 'the set propagated back up'); + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { style: _emberGlimmerTestsUtilsTestHelpers.styles('height: 45px; width: 90px;') }, content: '90x45' }); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'width', 70); + }); + + this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { style: _emberGlimmerTestsUtilsTestHelpers.styles('height: 35px; width: 70px;') }, content: '70x35' }); + this.assert.strictEqual(_emberMetal.get(input, 'width'), 70); + }; + + return _class2; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/mut-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/mut-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/mut-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/mut-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/mut-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/mut-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/partial-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each model.items as |template i|}}\n {{model.type}}: {{partial template}}\n {{/each}}'], ['\n {{#each model.items as |template i|}}\n {{model.type}}: {{partial template}}\n {{/each}}']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with item.thing as |t|}}\n {{partial t}}\n {{else}}\n Nothing!\n {{/with}}'], ['\n {{#with item.thing as |t|}}\n {{partial t}}\n {{else}}\n Nothing!\n {{/with}}']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{partial}}', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test should render other templates registered with the container'] = function testShouldRenderOtherTemplatesRegisteredWithTheContainer() { + this.registerPartial('_subTemplateFromContainer', 'sub-template'); + + this.render('This {{partial "subTemplateFromContainer"}} is pretty great.'); + + this.assertStableRerender(); + + this.assertText('This sub-template is pretty great.'); + }; + + _class.prototype['@test should render other slash-separated templates registered with the container'] = function testShouldRenderOtherSlashSeparatedTemplatesRegisteredWithTheContainer() { + this.registerPartial('child/_subTemplateFromContainer', 'sub-template'); + + this.render('This {{partial "child/subTemplateFromContainer"}} is pretty great.'); + + this.assertStableRerender(); + + this.assertText('This sub-template is pretty great.'); + }; + + _class.prototype['@test should use the current context'] = function testShouldUseTheCurrentContext() { + var _this = this; + + this.registerPartial('_person_name', '{{model.firstName}} {{model.lastName}}'); + + this.render('Who is {{partial "person_name"}}?', { + model: { + firstName: 'Kris', + lastName: 'Selden' + } + }); + + this.assertStableRerender(); + + this.assertText('Who is Kris Selden?'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'model.firstName', 'Kelly'); + }); + + this.assertText('Who is Kelly Selden?'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'model', { firstName: 'Kris', lastName: 'Selden' }); + }); + + this.assertText('Who is Kris Selden?'); + }; + + _class.prototype['@test Quoteless parameters passed to {{partial}} perform a bound property lookup of the partial name'] = function testQuotelessParametersPassedToPartialPerformABoundPropertyLookupOfThePartialName() { + var _this2 = this; + + this.registerPartial('_subTemplate', 'sub-template'); + this.registerPartial('_otherTemplate', 'other-template'); + + this.render('This {{partial templates.partialName}} is pretty {{partial nonexistent}}great.', { + templates: { partialName: 'subTemplate' } + }); + + this.assertStableRerender(); + + this.assertText('This sub-template is pretty great.'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'templates.partialName', 'otherTemplate'); + }); + + this.assertText('This other-template is pretty great.'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'templates.partialName', null); + }); + + this.assertText('This is pretty great.'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'templates', { partialName: 'subTemplate' }); + }); + + this.assertText('This sub-template is pretty great.'); + }; + + _class.prototype['@test dynamic partials in {{#each}}'] = function testDynamicPartialsInEach() { + var _this3 = this; + + this.registerPartial('_odd', 'ODD{{i}}'); + this.registerPartial('_even', 'EVEN{{i}}'); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { + model: { + items: ['even', 'odd', 'even', 'odd'], + type: 'number' + } + }); + + this.assertStableRerender(); + + this.assertText('number: EVEN0number: ODD1number: EVEN2number: ODD3'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'model.type', 'integer'); + }); + + this.assertText('integer: EVEN0integer: ODD1integer: EVEN2integer: ODD3'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'model', { + items: ['even', 'odd', 'even', 'odd'], + type: 'number' + }); + }); + + this.assertText('number: EVEN0number: ODD1number: EVEN2number: ODD3'); + }; + + _class.prototype['@test dynamic partials in {{#with}}'] = function testDynamicPartialsInWith() { + var _this4 = this; + + this.registerPartial('_thing', '{{t}}'); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2), { + item: { thing: false } + }); + + this.assertStableRerender(); + + this.assertText('Nothing!'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'item.thing', 'thing'); + }); + + this.assertText('thing'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'item', { thing: false }); + }); + + this.assertText('Nothing!'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/partial-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/partial-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/partial-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/partial-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/partial-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/partial-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/readonly-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{readonly}}', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test {{readonly}} of a path should work'] = function testReadonlyOfAPathShouldWork() { + var component = undefined; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + component = this; + } + }), + template: '{{value}}' + }); + + this.render('{{foo-bar value=(readonly val)}}', { + val: 12 + }); + + this.assertText('12'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(component, 'value', 13); + }); + this.assert.notOk(component.attrs.value.update); + + this.assertText('13', 'local property is updated'); + this.assert.equal(_emberMetal.get(this.context, 'val'), 12, 'upstream attribute is not updated'); + + // No U-R + }; + + _class.prototype['@test {{readonly}} of a string renders correctly'] = function testReadonlyOfAStringRendersCorrectly() { + var component = undefined; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + component = this; + } + }), + template: '{{value}}' + }); + + this.render('{{foo-bar value=(readonly "12")}}'); + + this.assertText('12'); + + this.assertStableRerender(); + + this.assert.notOk(component.attrs.value.update); + this.assert.strictEqual(_emberMetal.get(component, 'value'), '12'); + + this.runTask(function () { + return _emberMetal.set(component, 'value', '13'); + }); + + this.assertText('13', 'local property is updated'); + this.assert.strictEqual(_emberMetal.get(component, 'value'), '13'); + + this.runTask(function () { + return _emberMetal.set(component, 'value', '12'); + }); + + this.assertText('12'); + }; + + _class.prototype['@test {{mut}} of a {{readonly}} mutates only the middle and bottom tiers'] = function testMutOfAReadonlyMutatesOnlyTheMiddleAndBottomTiers() { + var _this = this; + + var middle = undefined, + bottom = undefined; + + this.registerComponent('x-bottom', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + bottom = this; + } + }), + template: '{{bar}}' + }); + + this.registerComponent('x-middle', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didInsertElement: function () { + middle = this; + } + }), + template: '{{foo}} {{x-bottom bar=(mut foo)}}' + }); + + this.render('{{x-middle foo=(readonly val)}}', { + val: 12 + }); + + this.assertText('12 12'); + + this.assertStableRerender(); + + this.assert.equal(_emberMetal.get(bottom, 'bar'), 12, 'bottom\'s local bar received the value'); + this.assert.equal(_emberMetal.get(middle, 'foo'), 12, 'middle\'s local foo received the value'); + + this.runTask(function () { + return bottom.attrs.bar.update(13); + }); + + this.assert.equal(_emberMetal.get(bottom, 'bar'), 13, 'bottom\'s local bar was updated after set of bottom\'s bar'); + this.assert.equal(_emberMetal.get(middle, 'foo'), 13, 'middle\'s local foo was updated after set of bottom\'s bar'); + this.assertText('13 13'); + this.assert.equal(_emberMetal.get(this.context, 'val'), 12, 'But context val is not updated'); + + this.runTask(function () { + return _emberMetal.set(bottom, 'bar', 14); + }); + + this.assert.equal(_emberMetal.get(bottom, 'bar'), 14, 'bottom\'s local bar was updated after set of bottom\'s bar'); + this.assert.equal(_emberMetal.get(middle, 'foo'), 14, 'middle\'s local foo was updated after set of bottom\'s bar'); + this.assertText('14 14'); + this.assert.equal(_emberMetal.get(this.context, 'val'), 12, 'But context val is not updated'); + + this.assert.notOk(middle.attrs.foo.update, 'middle\'s foo attr is not a mutable cell'); + this.runTask(function () { + return _emberMetal.set(middle, 'foo', 15); + }); + + this.assertText('15 15'); + this.assert.equal(_emberMetal.get(middle, 'foo'), 15, 'set of middle\'s foo took effect'); + this.assert.equal(_emberMetal.get(bottom, 'bar'), 15, 'bottom\'s local bar was updated after set of middle\'s foo'); + this.assert.equal(_emberMetal.get(this.context, 'val'), 12, 'Context val remains unchanged'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'val', 10); + }); + + this.assertText('10 10'); + this.assert.equal(_emberMetal.get(bottom, 'bar'), 10, 'bottom\'s local bar was updated after set of context\'s val'); + this.assert.equal(_emberMetal.get(middle, 'foo'), 10, 'middle\'s local foo was updated after set of context\'s val'); + + this.runTask(function () { + return _emberMetal.set(bottom, 'bar', undefined); + }); + + this.assertText(' '); + this.assert.equal(_emberMetal.get(bottom, 'bar'), undefined, 'bottom\'s local bar was updated to a falsy value'); + this.assert.equal(_emberMetal.get(middle, 'foo'), undefined, 'middle\'s local foo was updated to a falsy value'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'val', 12); + }); + this.assertText('12 12', 'bottom and middle were both reset'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/readonly-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/readonly-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/readonly-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/readonly-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/readonly-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/readonly-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/test-case'], function (exports, _emberMetal, _emberRuntime, _emberGlimmerTestsUtilsTestCase) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{render}}', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test should render given template'] = function testShouldRenderGivenTemplate() { + this.registerTemplate('home', '

    BYE

    '); + + this.render('

    HI

    {{render \'home\'}}'); + + this.assertText('HIBYE'); + }; + + _class.prototype['@test uses `controller:basic` as the basis for a generated controller when none exists for specified name'] = function testUsesControllerBasicAsTheBasisForAGeneratedControllerWhenNoneExistsForSpecifiedName() { + this.owner.register('controller:basic', _emberRuntime.Controller.extend({ + isBasicController: true + })); + this.registerTemplate('home', '{{isBasicController}}'); + + this.render('{{render \'home\'}}'); + + this.assertText('true'); + }; + + _class.prototype['@test generates a controller if none exists'] = function testGeneratesAControllerIfNoneExists() { + this.registerTemplate('home', '

    {{this}}

    '); + + this.render('

    HI

    {{render \'home\'}}'); + + this.assertText('HI(generated home controller)'); + }; + + _class.prototype['@test should use controller with the same name as template if present'] = function testShouldUseControllerWithTheSameNameAsTemplateIfPresent() { + this.owner.register('controller:home', _emberRuntime.Controller.extend({ name: 'home' })); + this.registerTemplate('home', '{{name}}

    BYE

    '); + + this.render('

    HI

    {{render \'home\'}}'); + + this.assertText('HIhomeBYE'); + }; + + _class.prototype['@test should render nested helpers'] = function testShouldRenderNestedHelpers() { + this.owner.register('controller:home', _emberRuntime.Controller.extend()); + this.owner.register('controller:foo', _emberRuntime.Controller.extend()); + this.owner.register('controller:bar', _emberRuntime.Controller.extend()); + this.owner.register('controller:baz', _emberRuntime.Controller.extend()); + + this.registerTemplate('home', '

    BYE

    '); + this.registerTemplate('foo', '

    FOO

    {{render \'bar\'}}'); + this.registerTemplate('bar', '

    BAR

    {{render \'baz\'}}'); + this.registerTemplate('baz', '

    BAZ

    '); + + this.render('

    HI

    {{render \'foo\'}}'); + this.assertText('HIFOOBARBAZ'); + }; + + _class.prototype['@test should have assertion if the template does not exist'] = function testShouldHaveAssertionIfTheTemplateDoesNotExist() { + var _this = this; + + this.owner.register('controller:oops', _emberRuntime.Controller.extend()); + + expectAssertion(function () { + _this.render('

    HI

    {{render \'oops\'}}'); + }, 'You used `{{render \'oops\'}}`, but \'oops\' can not be found as a template.'); + }; + + _class.prototype['@test should render given template with the singleton controller as its context'] = function testShouldRenderGivenTemplateWithTheSingletonControllerAsItsContext() { + var _this2 = this; + + this.owner.register('controller:post', _emberRuntime.Controller.extend({ + init: function () { + this.set('title', 'It\'s Simple Made Easy'); + } + })); + this.registerTemplate('post', '

    {{title}}

    '); + + this.render('

    HI

    {{render \'post\'}}'); + + this.assertText('HIIt\'s Simple Made Easy'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertText('HIIt\'s Simple Made Easy'); + + var controller = this.owner.lookup('controller:post'); + + this.runTask(function () { + return _emberMetal.set(controller, 'title', 'Rails is omakase'); + }); + + this.assertText('HIRails is omakase'); + + this.runTask(function () { + return _emberMetal.set(controller, 'title', 'It\'s Simple Made Easy'); + }); + + this.assertText('HIIt\'s Simple Made Easy'); + }; + + _class.prototype['@test should not destroy the singleton controller on teardown'] = function testShouldNotDestroyTheSingletonControllerOnTeardown(assert) { + var _this3 = this; + + var willDestroyFired = 0; + + this.owner.register('controller:post', _emberRuntime.Controller.extend({ + init: function () { + this.set('title', 'It\'s Simple Made Easy'); + }, + + willDestroy: function () { + this._super.apply(this, arguments); + willDestroyFired++; + } + })); + + this.registerTemplate('post', '

    {{title}}

    '); + + this.render('{{#if showPost}}{{render \'post\'}}{{else}}Nothing here{{/if}}', { showPost: false }); + + this.assertText('Nothing here'); + + assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertText('Nothing here'); + + assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'showPost', true); + }); + + this.assertText('It\'s Simple Made Easy'); + + assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'showPost', false); + }); + + this.assertText('Nothing here'); + + assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); + }; + + _class.prototype['@test should render given template with a supplied model'] = function testShouldRenderGivenTemplateWithASuppliedModel() { + var _this4 = this; + + this.owner.register('controller:post', _emberRuntime.Controller.extend()); + this.registerTemplate('post', '

    {{model.title}}

    '); + + expectDeprecation(function () { + _this4.render('

    HI

    {{render \'post\' post}}', { + post: { + title: 'It\'s Simple Made Easy' + } + }); + }, /Please refactor [\w\{\}"` ]+ to a component/); + + this.assertText('HIIt\'s Simple Made Easy'); + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assertText('HIIt\'s Simple Made Easy'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'post.title', 'Rails is omakase'); + }); + + this.assertText('HIRails is omakase'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'post', { title: 'It\'s Simple Made Easy' }); + }); + + this.assertText('HIIt\'s Simple Made Easy'); + }; + + _class.prototype['@test should destroy the non-singleton controllers on teardown'] = function testShouldDestroyTheNonSingletonControllersOnTeardown(assert) { + var _this5 = this; + + var willDestroyFired = 0; + + this.owner.register('controller:post', _emberRuntime.Controller.extend({ + willDestroy: function () { + this._super.apply(this, arguments); + willDestroyFired++; + } + })); + + this.registerTemplate('post', '

    {{model.title}}

    '); + + expectDeprecation(function () { + _this5.render('{{#if showPost}}{{render \'post\' post}}{{else}}Nothing here{{/if}}', { + showPost: false, + post: { + title: 'It\'s Simple Made Easy' + } + }); + }, /Please refactor [\w\{\}"` ]+ to a component/); + + this.assertText('Nothing here'); + + assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); + + this.runTask(function () { + return _this5.rerender(); + }); + + this.assertText('Nothing here'); + + assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'showPost', true); + }); + + this.assertText('It\'s Simple Made Easy'); + + assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'showPost', false); + }); + + this.assertText('Nothing here'); + + assert.strictEqual(willDestroyFired, 1, 'it did destroy the controller'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'showPost', true); + }); + + this.assertText('It\'s Simple Made Easy'); + + assert.strictEqual(willDestroyFired, 1, 'it did not destroy the controller'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'showPost', false); + }); + + this.assertText('Nothing here'); + + assert.strictEqual(willDestroyFired, 2, 'it did destroy the controller'); + }; + + _class.prototype['@test with a supplied model should not fire observers on the controller'] = function testWithASuppliedModelShouldNotFireObserversOnTheController() { + var _this6 = this; + + this.owner.register('controller:post', _emberRuntime.Controller.extend()); + this.registerTemplate('post', '

    {{model.title}}

    '); + + var postDidChange = 0; + expectDeprecation(function () { + _this6.render('

    HI

    {{render \'post\' post}}', { + postDidChange: _emberMetal.observer('post', function () { + postDidChange++; + }), + post: { + title: 'It\'s Simple Made Easy' + } + }); + }, /Please refactor [\w\{\}"` ]+ to a component/); + + this.assertText('HIIt\'s Simple Made Easy'); + + this.runTask(function () { + return _this6.rerender(); + }); + + this.assertText('HIIt\'s Simple Made Easy'); + }; + + _class.prototype['@test should raise an error when a given controller name does not resolve to a controller'] = function testShouldRaiseAnErrorWhenAGivenControllerNameDoesNotResolveToAController() { + var _this7 = this; + + this.registerTemplate('home', '

    BYE

    '); + this.owner.register('controller:posts', _emberRuntime.Controller.extend()); + expectAssertion(function () { + _this7.render('

    HI

    {{render "home" controller="postss"}}'); + }, /The controller name you supplied \'postss\' did not resolve to a controller./); + }; + + _class.prototype['@test should render with given controller'] = function testShouldRenderWithGivenController(assert) { + var _this8 = this; + + this.registerTemplate('home', '{{uniqueId}}'); + + var id = 0; + var model = {}; + + this.owner.register('controller:posts', _emberRuntime.Controller.extend({ + init: function () { + this._super.apply(this, arguments); + this.uniqueId = id++; + this.set('model', model); + } + })); + + this.render('{{render "home" controller="posts"}}'); + var renderedController = this.owner.lookup('controller:posts'); + var uniqueId = renderedController.get('uniqueId'); + var renderedModel = renderedController.get('model'); + + assert.equal(uniqueId, 0); + assert.equal(renderedModel, model); + this.assertText('0'); + + this.runTask(function () { + return _this8.rerender(); + }); + + assert.equal(uniqueId, 0); + assert.equal(renderedModel, model); + this.assertText('0'); + }; + + _class.prototype['@test should render templates with models multiple times'] = function testShouldRenderTemplatesWithModelsMultipleTimes(assert) { + var _this9 = this; + + this.owner.register('controller:post', _emberRuntime.Controller.extend()); + + this.registerTemplate('post', '

    {{model.title}}

    '); + expectDeprecation(function () { + _this9.render('

    HI

    {{render \'post\' post1}} {{render \'post\' post2}}', { + post1: { + title: 'Me First' + }, + post2: { + title: 'Then me' + } + }); + }, /Please refactor [\w\{\}"` ]+ to a component/); + + this.assertText('HI Me First Then me'); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertText('HI Me First Then me'); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'post1.title', 'I am new'); + }); + + this.assertText('HI I am new Then me'); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'post1', { title: 'Me First' }); + }); + + this.assertText('HI Me First Then me'); + }; + + _class.prototype['@test should not treat invocations with falsy contexts as context-less'] = function testShouldNotTreatInvocationsWithFalsyContextsAsContextLess(assert) { + var _this10 = this; + + this.registerTemplate('post', '

    {{#unless model.zero}}NOTHING{{/unless}}

    '); + this.owner.register('controller:post', _emberRuntime.Controller.extend()); + + expectDeprecation(function () { + _this10.render('

    HI

    {{render \'post\' zero}} {{render \'post\' nonexistent}}', { + model: { + zero: false + } + }); + }, /Please refactor [\w\{\}"` ]+ to a component/); + + assert.ok(this.$().text().match(/^HI ?NOTHING ?NOTHING$/)); + }; + + _class.prototype['@test should render templates both with and without models'] = function testShouldRenderTemplatesBothWithAndWithoutModels(assert) { + var _this11 = this; + + this.registerTemplate('post', '

    Title:{{model.title}}

    '); + this.owner.register('controller:post', _emberRuntime.Controller.extend()); + + var post = { + title: 'Rails is omakase' + }; + expectDeprecation(function () { + _this11.render('

    HI

    {{render \'post\'}} {{render \'post\' post}}', { + post: post + }); + }, /Please refactor [\w\{\}"` ]+ to a component/); + + assert.ok(this.$().text().match(/^HI ?Title: ?Title:Rails is omakase$/)); + + this.runTask(function () { + return _this11.rerender(); + }); + + assert.ok(this.$().text().match(/^HI ?Title: ?Title:Rails is omakase$/)); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'post.title', 'Simple Made Easy'); + }); + + assert.ok(this.$().text().match(/^HI ?Title: ?Title:Simple Made Easy$/)); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'post', { title: 'Rails is omakase' }); + }); + + assert.ok(this.$().text().match(/^HI ?Title: ?Title:Rails is omakase$/)); + }; + + _class.prototype['@test works with dot notation'] = function testWorksWithDotNotation() { + this.registerTemplate('blog.post', '{{uniqueId}}'); + + var id = 0; + this.owner.register('controller:blog.post', _emberRuntime.Controller.extend({ + init: function () { + this._super.apply(this, arguments); + this.uniqueId = id++; + } + })); + + this.render('{{render "blog.post"}}'); + + this.assertText('0'); + }; + + _class.prototype['@test throws an assertion if called with an unquoted template name'] = function testThrowsAnAssertionIfCalledWithAnUnquotedTemplateName() { + var _this12 = this; + + this.registerTemplate('home', '

    BYE

    '); + + expectAssertion(function () { + _this12.render('

    HI

    {{render home}}'); + }, 'The first argument of {{render}} must be quoted, e.g. {{render "sidebar"}}.'); + }; + + _class.prototype['@test throws an assertion if called with a literal for a model'] = function testThrowsAnAssertionIfCalledWithALiteralForAModel() { + var _this13 = this; + + this.registerTemplate('home', '

    BYE

    '); + expectAssertion(function () { + _this13.render('

    HI

    {{render "home" "model"}}', { + model: { + title: 'Simple Made Easy' + } + }); + }, 'The second argument of {{render}} must be a path, e.g. {{render "post" post}}.'); + }; + + _class.prototype['@test should set router as target when action not found on parentController is not found'] = function testShouldSetRouterAsTargetWhenActionNotFoundOnParentControllerIsNotFound(assert) { + var _this14 = this; + + var postController = undefined; + this.registerTemplate('post', 'post template'); + this.owner.register('controller:post', _emberRuntime.Controller.extend({ + init: function () { + this._super.apply(this, arguments); + postController = this; + } + })); + + var routerStub = { + send: function (actionName) { + assert.equal(actionName, 'someAction'); + assert.ok(true, 'routerStub#send called'); + } + }; + + this.owner.register('router:main', routerStub, { instantiate: false }); + + expectDeprecation(function () { + _this14.render('{{render \'post\' post1}}'); + }, /Please refactor [\w\{\}"` ]+ to a component/); + + postController.send('someAction'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/render-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/render-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/render-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/render-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/render-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/render-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/text-area-test', ['exports', 'ember-utils', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/test-helpers', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberUtils, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsTestHelpers, _emberGlimmerTestsUtilsAbstractTestCase) { + 'use strict'; + + var TextAreaRenderingTest = (function (_RenderingTest) { + babelHelpers.inherits(TextAreaRenderingTest, _RenderingTest); + + function TextAreaRenderingTest() { + _RenderingTest.call(this); + + this.registerComponent('-text-area', { ComponentClass: _emberGlimmerTestsUtilsHelpers.TextArea }); + } + + TextAreaRenderingTest.prototype.assertTextArea = function assertTextArea() { + var _ref2 = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + + var attrs = _ref2.attrs; + var value = _ref2.value; + + var mergedAttrs = _emberUtils.assign({ 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view ember-text-area') }, attrs); + this.assertComponentElement(this.firstChild, { tagName: 'textarea', attrs: mergedAttrs }); + + if (value) { + this.assert.strictEqual(value, this.firstChild.value); + } + }; + + TextAreaRenderingTest.prototype.triggerEvent = function triggerEvent(type) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + var event = document.createEvent('Events'); + event.initEvent(type, true, true); + _emberUtils.assign(event, options); + + this.firstChild.dispatchEvent(event); + }; + + return TextAreaRenderingTest; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest); + + var BoundTextAreaAttributes = (function () { + function BoundTextAreaAttributes(cases) { + this.cases = cases; + } + + BoundTextAreaAttributes.prototype.generate = function generate(_ref3) { + var _ref; + + var attribute = _ref3.attribute; + var first = _ref3.first; + var second = _ref3.second; + + return _ref = {}, _ref['@test ' + attribute] = function (assert) { + var _attrs, + _attrs2, + _attrs3, + _this = this; + + this.render('{{textarea ' + attribute + '=value}}', { + value: first + }); + this.assertTextArea({ attrs: (_attrs = {}, _attrs[attribute] = first, _attrs) }); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'value', second); + }); + this.assertTextArea({ attrs: (_attrs2 = {}, _attrs2[attribute] = second, _attrs2) }); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'value', first); + }); + this.assertTextArea({ attrs: (_attrs3 = {}, _attrs3[attribute] = first, _attrs3) }); + }, _ref; + }; + + return BoundTextAreaAttributes; + })(); + + _emberGlimmerTestsUtilsAbstractTestCase.applyMixins(TextAreaRenderingTest, new BoundTextAreaAttributes([{ attribute: 'placeholder', first: 'Stuff here', second: 'Other stuff' }, { attribute: 'name', first: 'Stuff here', second: 'Other stuff' }, { attribute: 'title', first: 'Stuff here', second: 'Other stuff' }, { attribute: 'maxlength', first: '1', second: '2' }, { attribute: 'rows', first: '1', second: '2' }, { attribute: 'cols', first: '1', second: '2' }, { attribute: 'tabindex', first: '1', second: '2' }])); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{textarea}}', (function (_TextAreaRenderingTest) { + babelHelpers.inherits(_class, _TextAreaRenderingTest); + + function _class() { + _TextAreaRenderingTest.apply(this, arguments); + } + + _class.prototype['@test Should insert a textarea'] = function testShouldInsertATextarea() { + this.render('{{textarea}}'); + + equal(this.$('textarea').length, 1); + + this.assertStableRerender(); + }; + + _class.prototype['@test Should respect disabled'] = function testShouldRespectDisabled() { + this.render('{{textarea disabled=disabled}}', { + disabled: true + }); + ok(this.$('textarea').is(':disabled')); + }; + + _class.prototype['@test Should respect disabled when false'] = function testShouldRespectDisabledWhenFalse() { + this.render('{{textarea disabled=disabled}}', { + disabled: false + }); + ok(this.$('textarea').is(':not(:disabled)')); + }; + + _class.prototype['@test Should become disabled when the context changes'] = function testShouldBecomeDisabledWhenTheContextChanges() { + var _this2 = this; + + this.render('{{textarea disabled=disabled}}'); + ok(this.$('textarea').is(':not(:disabled)')); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'disabled', true); + }); + ok(this.$('textarea').is(':disabled')); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'disabled', false); + }); + ok(this.$('textarea').is(':not(:disabled)')); + }; + + _class.prototype['@test Should bind its contents to the specified value'] = function testShouldBindItsContentsToTheSpecifiedValue() { + var _this3 = this; + + this.render('{{textarea value=model.val}}', { + model: { val: 'A beautiful day in Seattle' } + }); + this.assertTextArea({ value: 'A beautiful day in Seattle' }); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'model.val', 'Auckland'); + }); + this.assertTextArea({ value: 'Auckland' }); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'model', { val: 'A beautiful day in Seattle' }); + }); + this.assertTextArea({ value: 'A beautiful day in Seattle' }); + }; + + _class.prototype['@test GH#14001 Should correctly handle an empty string bound value'] = function testGH14001ShouldCorrectlyHandleAnEmptyStringBoundValue() { + var _this4 = this; + + this.render('{{textarea value=message}}', { message: '' }); + + this.assert.strictEqual(this.firstChild.value, ''); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'message', 'hello'); + }); + + this.assert.strictEqual(this.firstChild.value, 'hello'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'message', ''); + }); + + this.assert.strictEqual(this.firstChild.value, ''); + }; + + _class.prototype['@test should update the value for `cut` / `input` / `change` events'] = function testShouldUpdateTheValueForCutInputChangeEvents() { + var _this5 = this; + + this.render('{{textarea value=model.val}}', { + model: { val: 'A beautiful day in Seattle' } + }); + this.assertTextArea({ value: 'A beautiful day in Seattle' }); + + this.assertStableRerender(); + + this.runTask(function () { + _this5.firstChild.value = 'Auckland'; + _this5.triggerEvent('cut'); + }); + this.assertTextArea({ value: 'Auckland' }); + + this.runTask(function () { + _this5.firstChild.value = 'Hope'; + _this5.triggerEvent('paste'); + }); + this.assertTextArea({ value: 'Hope' }); + + this.runTask(function () { + _this5.firstChild.value = 'Boston'; + _this5.triggerEvent('input'); + }); + this.assertTextArea({ value: 'Boston' }); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'model', { val: 'A beautiful day in Seattle' }); + }); + this.assertTextArea({ value: 'A beautiful day in Seattle' }); + }; + + return _class; + })(TextAreaRenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/text-area-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/text-area-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/text-area-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/text-area-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/text-area-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/text-area-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/unbound-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-runtime'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberRuntime) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n \n '], ['\n \n ']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n {{unbound (surround model.prefix model.value "bar")}} {{surround model.prefix model.value "bar"}} {{unbound (surround "bar" model.value model.suffix)}} {{surround "bar" model.value model.suffix}}'], ['\n {{unbound (surround model.prefix model.value "bar")}} {{surround model.prefix model.value "bar"}} {{unbound (surround "bar" model.value model.suffix)}} {{surround "bar" model.value model.suffix}}']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if (unbound model.foo)}}\n {{#if model.bar}}true{{/if}}\n {{#unless model.bar}}false{{/unless}}\n {{/if}}\n {{#unless (unbound model.notfoo)}}\n {{#if model.bar}}true{{/if}}\n {{#unless model.bar}}false{{/unless}}\n {{/unless}}'], ['\n {{#if (unbound model.foo)}}\n {{#if model.bar}}true{{/if}}\n {{#unless model.bar}}false{{/unless}}\n {{/if}}\n {{#unless (unbound model.notfoo)}}\n {{#if model.bar}}true{{/if}}\n {{#unless model.bar}}false{{/unless}}\n {{/unless}}']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{unbound}}', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test should be able to output a property without binding'] = function testShouldBeAbleToOutputAPropertyWithoutBinding() { + var _this = this; + + this.render('
    {{unbound content.anUnboundString}}
    ', { + content: { + anUnboundString: 'No spans here, son.' + } + }); + + this.assertText('No spans here, son.'); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertText('No spans here, son.'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'content.anUnboundString', 'HEY'); + }); + + this.assertText('No spans here, son.'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'content', { + anUnboundString: 'No spans here, son.' + }); + }); + + this.assertText('No spans here, son.'); + }; + + _class.prototype['@test should be able to use unbound helper in #each helper'] = function testShouldBeAbleToUseUnboundHelperInEachHelper() { + var _this2 = this; + + this.render('
      {{#each items as |item|}}
    • {{unbound item}}
    • {{/each}}
    ', { + items: _emberRuntime.A(['a', 'b', 'c', 1, 2, 3]) + }); + + this.assertText('abc123'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertText('abc123'); + }; + + _class.prototype['@test should be able to use unbound helper in #each helper (with objects)'] = function testShouldBeAbleToUseUnboundHelperInEachHelperWithObjects() { + var _this3 = this; + + this.render('
      {{#each items as |item|}}
    • {{unbound item.wham}}
    • {{/each}}
    ', { + items: _emberRuntime.A([{ wham: 'bam' }, { wham: 1 }]) + }); + + this.assertText('bam1'); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertText('bam1'); + + this.runTask(function () { + return _this3.context.items.setEach('wham', 'HEY'); + }); + + this.assertText('bam1'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'items', _emberRuntime.A([{ wham: 'bam' }, { wham: 1 }])); + }); + + this.assertText('bam1'); + }; + + _class.prototype['@test it should assert unbound cannot be called with multiple arguments'] = function testItShouldAssertUnboundCannotBeCalledWithMultipleArguments() { + var _this4 = this; + + var willThrow = function () { + _this4.render('{{unbound foo bar}}', { + foo: 'BORK', + bar: 'BLOOP' + }); + }; + + expectAssertion(willThrow, /unbound helper cannot be called with multiple params or hash params/); + }; + + _class.prototype['@test should render on attributes'] = function testShouldRenderOnAttributes() { + var _this5 = this; + + this.render('', { + model: { foo: 'BORK' } + }); + + this.assertHTML(''); + + this.runTask(function () { + return _this5.rerender(); + }); + + this.assertHTML(''); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'model.foo', 'OOF'); + }); + + this.assertHTML(''); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'model', { foo: 'BORK' }); + }); + + this.assertHTML(''); + }; + + _class.prototype['@test should property escape unsafe hrefs'] = function testShouldPropertyEscapeUnsafeHrefs() { + var _this6 = this; + + var unsafeUrls = _emberRuntime.A([{ + name: 'Bob', + url: 'javascript:bob-is-cool' // jshint ignore:line + }, { + name: 'James', + url: 'vbscript:james-is-cool' // jshint ignore:line + }, { + name: 'Richard', + url: 'javascript:richard-is-cool' // jshint ignore:line + }]); + + this.render('', { + people: unsafeUrls + }); + + var escapedHtml = _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject); + + this.assertHTML(escapedHtml); + + this.runTask(function () { + return _this6.rerender(); + }); + + this.assertHTML(escapedHtml); + + this.runTask(function () { + return _this6.context.people.setEach('url', 'http://google.com'); + }); + + this.assertHTML(escapedHtml); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'people', unsafeUrls); + }); + + this.assertHTML(escapedHtml); + }; + + _class.prototype['@skip helper form updates on parent re-render'] = function skipHelperFormUpdatesOnParentReRender() { + var _this7 = this; + + this.render('{{unbound foo}}', { + foo: 'BORK' + }); + + this.assertText('BORK'); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertText('BORK'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'foo', 'OOF'); + }); + + this.assertText('BORK'); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertText('OOF'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'foo', ''); + }); + + this.assertText('OOF'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'foo', 'BORK'); + }); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertText('BORK'); + }; + + // semantics here is not guaranteed + + _class.prototype['@test sexpr form does not update no matter what'] = function testSexprFormDoesNotUpdateNoMatterWhat() { + var _this8 = this; + + this.registerHelper('capitalize', function (args) { + return args[0].toUpperCase(); + }); + + this.render('{{capitalize (unbound foo)}}', { + foo: 'bork' + }); + + this.assertText('BORK'); + + this.runTask(function () { + return _this8.rerender(); + }); + + this.assertText('BORK'); + + this.runTask(function () { + _emberMetal.set(_this8.context, 'foo', 'oof'); + _this8.rerender(); + }); + + this.assertText('BORK'); + + this.runTask(function () { + return _emberMetal.set(_this8.context, 'foo', 'blip'); + }); + + this.assertText('BORK'); + + this.runTask(function () { + _emberMetal.set(_this8.context, 'foo', 'bork'); + _this8.rerender(); + }); + + this.assertText('BORK'); + }; + + _class.prototype['@test sexpr in helper form does not update on parent re-render'] = function testSexprInHelperFormDoesNotUpdateOnParentReRender() { + var _this9 = this; + + this.registerHelper('capitalize', function (params) { + return params[0].toUpperCase(); + }); + + this.registerHelper('doublize', function (params) { + return params[0] + ' ' + params[0]; + }); + + this.render('{{capitalize (unbound (doublize foo))}}', { + foo: 'bork' + }); + + this.assertText('BORK BORK'); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertText('BORK BORK'); + + this.runTask(function () { + _emberMetal.set(_this9.context, 'foo', 'oof'); + _this9.rerender(); + }); + + this.assertText('BORK BORK'); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'foo', 'blip'); + }); + + this.assertText('BORK BORK'); + + this.runTask(function () { + _emberMetal.set(_this9.context, 'foo', 'bork'); + _this9.rerender(); + }); + + this.assertText('BORK BORK'); + }; + + _class.prototype['@test should be able to render an unbound helper invocation'] = function testShouldBeAbleToRenderAnUnboundHelperInvocation() { + var _this10 = this; + + this.registerHelper('repeat', function (_ref, _ref2) { + var value = _ref[0]; + var count = _ref2.count; + + var a = []; + while (a.length < count) { + a.push(value); + } + return a.join(''); + }); + + this.render('{{unbound (repeat foo count=bar)}} {{repeat foo count=bar}} {{unbound (repeat foo count=2)}} {{repeat foo count=4}}', { + foo: 'X', + bar: 5 + }); + + this.assertText('XXXXX XXXXX XX XXXX'); + + this.runTask(function () { + return _this10.rerender(); + }); + + this.assertText('XXXXX XXXXX XX XXXX'); + + this.runTask(function () { + return _emberMetal.set(_this10.context, 'bar', 1); + }); + + this.assertText('XXXXX X XX XXXX'); + + this.runTask(function () { + return _emberMetal.set(_this10.context, 'bar', 5); + }); + + this.assertText('XXXXX XXXXX XX XXXX'); + }; + + _class.prototype['@test should be able to render an bound helper invocation mixed with static values'] = function testShouldBeAbleToRenderAnBoundHelperInvocationMixedWithStaticValues() { + var _this11 = this; + + this.registerHelper('surround', function (_ref3) { + var prefix = _ref3[0]; + var value = _ref3[1]; + var suffix = _ref3[2]; + return prefix + '-' + value + '-' + suffix; + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2), { + model: { + prefix: 'before', + value: 'core', + suffix: 'after' + } + }); + + this.assertText('before-core-bar before-core-bar bar-core-after bar-core-after'); + + this.runTask(function () { + return _this11.rerender(); + }); + + this.assertText('before-core-bar before-core-bar bar-core-after bar-core-after'); + + this.runTask(function () { + _emberMetal.setProperties(_this11.context.model, { + prefix: 'beforeChanged', + value: 'coreChanged', + suffix: 'afterChanged' + }); + }); + + this.assertText('before-core-bar beforeChanged-coreChanged-bar bar-core-after bar-coreChanged-afterChanged'); + + this.runTask(function () { + _emberMetal.set(_this11.context, 'model', { + prefix: 'before', + value: 'core', + suffix: 'after' + }); + }); + + this.assertText('before-core-bar before-core-bar bar-core-after bar-core-after'); + }; + + _class.prototype['@test should be able to render unbound forms of multi-arg helpers'] = function testShouldBeAbleToRenderUnboundFormsOfMultiArgHelpers() { + var _this12 = this; + + this.registerHelper('fauxconcat', function (params) { + return params.join(''); + }); + + this.render('{{fauxconcat model.foo model.bar model.bing}} {{unbound (fauxconcat model.foo model.bar model.bing)}}', { + model: { + foo: 'a', + bar: 'b', + bing: 'c' + } + }); + + this.assertText('abc abc'); + + this.runTask(function () { + return _this12.rerender(); + }); + + this.assertText('abc abc'); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'model.bar', 'X'); + }); + + this.assertText('aXc abc'); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'model', { + foo: 'a', + bar: 'b', + bing: 'c' + }); + }); + + this.assertText('abc abc'); + }; + + _class.prototype['@test should be able to render an unbound helper invocation for helpers with dependent keys'] = function testShouldBeAbleToRenderAnUnboundHelperInvocationForHelpersWithDependentKeys() { + var _this13 = this; + + this.registerHelper('capitalizeName', { + destroy: function () { + this.removeObserver('value.firstName'); + this._super.apply(this, arguments); + }, + + compute: function (_ref4) { + var value = _ref4[0]; + + if (this.get('value')) { + this.removeObserver('value.firstName'); + } + this.set('value', value); + this.addObserver('value.firstName', this, this.recompute); + return value ? _emberMetal.get(value, 'firstName').toUpperCase() : ''; + } + }); + + this.registerHelper('concatNames', { + destroy: function () { + this.teardown(); + this._super.apply(this, arguments); + }, + teardown: function () { + this.removeObserver('value.firstName'); + this.removeObserver('value.lastName'); + }, + compute: function (_ref5) { + var value = _ref5[0]; + + if (this.get('value')) { + this.teardown(); + } + this.set('value', value); + this.addObserver('value.firstName', this, this.recompute); + this.addObserver('value.lastName', this, this.recompute); + return (value ? _emberMetal.get(value, 'firstName') : '') + (value ? _emberMetal.get(value, 'lastName') : ''); + } + }); + + this.render('{{capitalizeName person}} {{unbound (capitalizeName person)}} {{concatNames person}} {{unbound (concatNames person)}}', { + person: { + firstName: 'shooby', + lastName: 'taylor' + } + }); + + this.assertText('SHOOBY SHOOBY shoobytaylor shoobytaylor'); + + this.runTask(function () { + return _this13.rerender(); + }); + + this.assertText('SHOOBY SHOOBY shoobytaylor shoobytaylor'); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'person.firstName', 'sally'); + }); + + this.assertText('SALLY SHOOBY sallytaylor shoobytaylor'); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'person', { + firstName: 'shooby', + lastName: 'taylor' + }); + }); + + this.assertText('SHOOBY SHOOBY shoobytaylor shoobytaylor'); + }; + + _class.prototype['@test should be able to render an unbound helper invocation in #each helper'] = function testShouldBeAbleToRenderAnUnboundHelperInvocationInEachHelper() { + var _this14 = this; + + this.registerHelper('capitalize', function (params) { + return params[0].toUpperCase(); + }); + + this.render('{{#each people as |person|}}{{capitalize person.firstName}} {{unbound (capitalize person.firstName)}}{{/each}}', { + people: _emberRuntime.A([{ + firstName: 'shooby', + lastName: 'taylor' + }, { + firstName: 'cindy', + lastName: 'taylor' + }]) + }); + + this.assertText('SHOOBY SHOOBYCINDY CINDY'); + + this.runTask(function () { + return _this14.rerender(); + }); + + this.assertText('SHOOBY SHOOBYCINDY CINDY'); + + this.runTask(function () { + return _this14.context.people.setEach('firstName', 'chad'); + }); + + this.assertText('CHAD SHOOBYCHAD CINDY'); + + this.runTask(function () { + return _emberMetal.set(_this14.context, 'people', _emberRuntime.A([{ + firstName: 'shooby', + lastName: 'taylor' + }, { + firstName: 'cindy', + lastName: 'taylor' + }])); + }); + + this.assertText('SHOOBY SHOOBYCINDY CINDY'); + }; + + _class.prototype['@test should be able to render an unbound helper invocation with bound hash options'] = function testShouldBeAbleToRenderAnUnboundHelperInvocationWithBoundHashOptions() { + var _this15 = this; + + this.registerHelper('capitalizeName', { + destroy: function () { + this.removeObserver('value.firstName'); + this._super.apply(this, arguments); + }, + + compute: function (_ref6) { + var value = _ref6[0]; + + if (this.get('value')) { + this.removeObserver('value.firstName'); + } + this.set('value', value); + this.addObserver('value.firstName', this, this.recompute); + return value ? _emberMetal.get(value, 'firstName').toUpperCase() : ''; + } + }); + + this.registerHelper('concatNames', { + destroy: function () { + this.teardown(); + this._super.apply(this, arguments); + }, + teardown: function () { + this.removeObserver('value.firstName'); + this.removeObserver('value.lastName'); + }, + compute: function (_ref7) { + var value = _ref7[0]; + + if (this.get('value')) { + this.teardown(); + } + this.set('value', value); + this.addObserver('value.firstName', this, this.recompute); + this.addObserver('value.lastName', this, this.recompute); + return (value ? _emberMetal.get(value, 'firstName') : '') + (value ? _emberMetal.get(value, 'lastName') : ''); + } + }); + + this.render('{{capitalizeName person}} {{unbound (capitalizeName person)}} {{concatNames person}} {{unbound (concatNames person)}}', { + person: { + firstName: 'shooby', + lastName: 'taylor' + } + }); + + this.assertText('SHOOBY SHOOBY shoobytaylor shoobytaylor'); + + this.runTask(function () { + return _this15.rerender(); + }); + + this.assertText('SHOOBY SHOOBY shoobytaylor shoobytaylor'); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'person.firstName', 'sally'); + }); + + this.assertText('SALLY SHOOBY sallytaylor shoobytaylor'); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'person', { + firstName: 'shooby', + lastName: 'taylor' + }); + }); + + this.assertText('SHOOBY SHOOBY shoobytaylor shoobytaylor'); + }; + + _class.prototype['@test should be able to render bound form of a helper inside unbound form of same helper'] = function testShouldBeAbleToRenderBoundFormOfAHelperInsideUnboundFormOfSameHelper() { + var _this16 = this; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3), { + model: { + foo: true, + notfoo: false, + bar: true + } + }); + + this.assertText('truetrue'); + + this.runTask(function () { + return _this16.rerender(); + }); + + this.assertText('truetrue'); + + this.runTask(function () { + return _emberMetal.set(_this16.context, 'model.bar', false); + }); + + this.assertText('falsefalse'); + + this.runTask(function () { + return _emberMetal.set(_this16.context, 'model', { + foo: true, + notfoo: false, + bar: true + }); + }); + + this.assertText('truetrue'); + }; + + _class.prototype['@test yielding unbound does not update'] = function testYieldingUnboundDoesNotUpdate() { + var _this17 = this; + + var fooBarInstance = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + fooBarInstance = this; + }, + model: { foo: 'bork' } + }); + + this.registerComponent('foo-bar', { + ComponentClass: FooBarComponent, + template: '{{yield (unbound model.foo)}}' + }); + + this.render('{{#foo-bar as |value|}}{{value}}{{/foo-bar}}'); + + this.assertText('bork'); + + this.runTask(function () { + return _this17.rerender(); + }); + + this.assertText('bork'); + + this.runTask(function () { + return _emberMetal.set(fooBarInstance, 'model.foo', 'oof'); + }); + + this.assertText('bork'); + + this.runTask(function () { + return _emberMetal.set(fooBarInstance, 'model', { foo: 'bork' }); + }); + + this.assertText('bork'); + }; + + _class.prototype['@test yielding unbound hash does not update'] = function testYieldingUnboundHashDoesNotUpdate() { + var _this18 = this; + + var fooBarInstance = undefined; + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + fooBarInstance = this; + }, + model: { foo: 'bork' } + }); + + this.registerComponent('foo-bar', { + ComponentClass: FooBarComponent, + template: '{{yield (unbound (hash foo=model.foo))}}' + }); + + this.render('{{#foo-bar as |value|}}{{value.foo}}{{/foo-bar}}'); + + this.assertText('bork'); + + this.runTask(function () { + return _this18.rerender(); + }); + + this.assertText('bork'); + + this.runTask(function () { + return _emberMetal.set(fooBarInstance, 'model.foo', 'oof'); + }); + + this.assertText('bork'); + + this.runTask(function () { + return _emberMetal.set(fooBarInstance, 'model', { foo: 'bork' }); + }); + + this.assertText('bork'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/unbound-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/unbound-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/unbound-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/unbound-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/unbound-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/unbound-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/yield-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal, _emberGlimmerTestsUtilsHelpers) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{yield}} helper', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test can yield to block'] = function testCanYieldToBlock() { + var _this = this; + + this.registerComponent('yield-comp', { template: '[In layout:] {{yield}}' }); + + this.render('{{#yield-comp}}[In Block:] {{object.title}}{{/yield-comp}}', { object: { title: 'Seattle' } }); + this.assertText('[In layout:] [In Block:] Seattle'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'object.title', 'Vancouver'); + }); + this.assertText('[In layout:] [In Block:] Vancouver'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'object', { title: 'Seattle' }); + }); + this.assertText('[In layout:] [In Block:] Seattle'); + }; + + _class.prototype['@test templates should yield to block inside a nested component'] = function testTemplatesShouldYieldToBlockInsideANestedComponent() { + var _this2 = this; + + this.registerComponent('outer-comp', { template: '
    [In layout:] {{yield}}
    ' }); + this.registerComponent('inner-comp', { template: '{{#outer-comp}}[In Block:] {{object.title}}{{/outer-comp}}' }); + + this.render('{{inner-comp object=object}}', { object: { title: 'Seattle' } }); + this.assertText('[In layout:] [In Block:] Seattle'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'object.title', 'Vancouver'); + }); + this.assertText('[In layout:] [In Block:] Vancouver'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'object', { title: 'Seattle' }); + }); + this.assertText('[In layout:] [In Block:] Seattle'); + }; + + _class.prototype['@test templates should yield to block, when the yield is embedded in a each helper'] = function testTemplatesShouldYieldToBlockWhenTheYieldIsEmbeddedInAEachHelper() { + var _this3 = this; + + var list = [1, 2, 3]; + + this.registerComponent('outer-comp', { template: '{{#each list as |item|}}{{yield}}{{/each}}' }); + + this.render('{{#outer-comp list=list}}Hello{{/outer-comp}}', { list: list }); + this.assertText('HelloHelloHello'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'list', [4, 5]); + }); + this.assertText('HelloHello'); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'list', list); + }); + this.assertText('HelloHelloHello'); + }; + + _class.prototype['@test templates should yield to block, when the yield is embedded in a if helper'] = function testTemplatesShouldYieldToBlockWhenTheYieldIsEmbeddedInAIfHelper() { + var _this4 = this; + + this.registerComponent('outer-comp', { template: '{{#if boolean}}{{yield}}{{/if}}' }); + + this.render('{{#outer-comp boolean=boolean}}Hello{{/outer-comp}}', { boolean: true }); + this.assertText('Hello'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'boolean', false); + }); + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'boolean', true); + }); + this.assertText('Hello'); + }; + + _class.prototype['@test simple curlies inside of a yielded clock should work when the yield is nested inside of another view'] = function testSimpleCurliesInsideOfAYieldedClockShouldWorkWhenTheYieldIsNestedInsideOfAnotherView() { + var _this5 = this; + + this.registerComponent('kiwi-comp', { template: '{{#if falsy}}{{else}}{{yield}}{{/if}}' }); + + this.render('{{#kiwi-comp}}{{text}}{{/kiwi-comp}}', { text: 'ohai' }); + this.assertText('ohai'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'text', 'portland'); + }); + this.assertText('portland'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'text', 'ohai'); + }); + this.assertText('ohai'); + }; + + _class.prototype['@test nested simple curlies inside of a yielded block should work when the yield is nested inside of another view'] = function testNestedSimpleCurliesInsideOfAYieldedBlockShouldWorkWhenTheYieldIsNestedInsideOfAnotherView() { + var _this6 = this; + + this.registerComponent('parent-comp', { template: '{{#if falsy}}{{else}}{{yield}}{{/if}}' }); + this.registerComponent('child-comp', { template: '{{#if falsy}}{{else}}{{text}}{{/if}}' }); + + this.render('{{#parent-comp}}{{child-comp text=text}}{{/parent-comp}}', { text: 'ohai' }); + this.assertText('ohai'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'text', 'portland'); + }); + this.assertText('portland'); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'text', 'ohai'); + }); + this.assertText('ohai'); + }; + + _class.prototype['@test yielding to a non-existent block is not an error'] = function testYieldingToANonExistentBlockIsNotAnError() { + var _this7 = this; + + this.registerComponent('yielding-comp', { template: 'Hello:{{yield}}' }); + this.registerComponent('outer-comp', { template: '{{yielding-comp}} {{title}}' }); + + this.render('{{outer-comp title=title}}', { title: 'Mr. Selden' }); + + this.assertText('Hello: Mr. Selden'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'title', 'Mr. Chag'); + }); + this.assertText('Hello: Mr. Chag'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'title', 'Mr. Selden'); + }); + this.assertText('Hello: Mr. Selden'); + }; + + _class.prototype['@test yield uses the original context'] = function testYieldUsesTheOriginalContext() { + var _this8 = this; + + var KiwiCompComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ boundText: 'Inner' }); + + this.registerComponent('kiwi-comp', { ComponentClass: KiwiCompComponent, template: '

    {{boundText}}

    {{yield}}

    ' }); + + this.render('{{#kiwi-comp}}{{boundText}}{{/kiwi-comp}}', { boundText: 'Original' }); + this.assertText('InnerOriginal'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this8.context, 'boundText', 'Otherworld'); + }); + this.assertText('InnerOtherworld'); + + this.runTask(function () { + return _emberMetal.set(_this8.context, 'boundText', 'Original'); + }); + this.assertText('InnerOriginal'); + }; + + _class.prototype['@test outer block param doesn\'t mask inner component property'] = function testOuterBlockParamDoesnTMaskInnerComponentProperty() { + var _this9 = this; + + var KiwiCompComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ boundText: 'Inner' }); + + this.registerComponent('kiwi-comp', { ComponentClass: KiwiCompComponent, template: '

    {{boundText}}

    {{yield}}

    ' }); + + this.render('{{#with boundText as |item|}}{{#kiwi-comp}}{{item}}{{/kiwi-comp}}{{/with}}', { boundText: 'Outer' }); + this.assertText('InnerOuter'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'boundText', 'Otherworld'); + }); + this.assertText('InnerOtherworld'); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'boundText', 'Outer'); + }); + this.assertText('InnerOuter'); + }; + + _class.prototype['@test inner block param doesn\'t mask yield property'] = function testInnerBlockParamDoesnTMaskYieldProperty() { + var _this10 = this; + + var KiwiCompComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ boundText: 'Inner' }); + + this.registerComponent('kiwi-comp', { ComponentClass: KiwiCompComponent, template: '{{#with boundText as |item|}}

    {{item}}

    {{yield}}

    {{/with}}' }); + + this.render('{{#kiwi-comp}}{{item}}{{/kiwi-comp}}', { item: 'Outer' }); + this.assertText('InnerOuter'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this10.context, 'item', 'Otherworld'); + }); + this.assertText('InnerOtherworld'); + + this.runTask(function () { + return _emberMetal.set(_this10.context, 'item', 'Outer'); + }); + this.assertText('InnerOuter'); + }; + + _class.prototype['@test can bind a block param to a component and use it in yield'] = function testCanBindABlockParamToAComponentAndUseItInYield() { + var _this11 = this; + + this.registerComponent('kiwi-comp', { template: '

    {{content}}

    {{yield}}

    ' }); + + this.render('{{#with boundText as |item|}}{{#kiwi-comp content=item}}{{item}}{{/kiwi-comp}}{{/with}}', { boundText: 'Outer' }); + this.assertText('OuterOuter'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'boundText', 'Update'); + }); + this.assertText('UpdateUpdate'); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'boundText', 'Outer'); + }); + this.assertText('OuterOuter'); + }; + + // INUR not need with no data update + + _class.prototype['@test yield should not introduce a view'] = function testYieldShouldNotIntroduceAView() { + var ParentCompComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ isParentComponent: true }); + + var ChildCompComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + didReceiveAttrs: function () { + this._super(); + var parentView = this.get('parentView'); + + ok(parentView.get('isParentComponent')); + } + }); + + this.registerComponent('parent-comp', { ComponentClass: ParentCompComponent, template: '{{yield}}' }); + this.registerComponent('child-comp', { ComponentClass: ChildCompComponent }); + + this.render('{{#parent-comp}}{{child-comp}}{{/parent-comp}}'); + }; + + _class.prototype['@test yield with nested components (#3220)'] = function testYieldWithNestedComponents3220() { + var _this12 = this; + + this.registerComponent('inner-component', { template: '{{yield}}' }); + this.registerComponent('outer-component', { template: '{{#inner-component}}{{yield}}{{/inner-component}}' }); + + this.render('{{#outer-component}}Hello {{boundText}}{{/outer-component}}', { boundText: 'world' }); + this.assertText('Hello world'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'boundText', 'update'); + }); + this.assertText('Hello update'); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'boundText', 'world'); + }); + this.assertText('Hello world'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/helpers/yield-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/helpers'); + test('ember-glimmer/tests/integration/helpers/yield-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/helpers/yield-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/helpers/yield-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); + QUnit.test('ember-glimmer/tests/integration/helpers/yield-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/yield-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/input-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Input element tests', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype.runAttributeTest = function runAttributeTest(attributeName, values) { + var _this = this; + + var template = ''; + this.render(template, { value: values[0] }); + this.assertAttributeHasValue(attributeName, values[0], attributeName + ' is set on initial render'); + + this.runTask(function () { + return _this.rerender(); + }); + this.assertAttributeHasValue(attributeName, values[0], attributeName + ' is set on noop rerender'); + + this.setComponentValue(values[1]); + this.assertAttributeHasValue(attributeName, values[1], attributeName + ' is set on rerender'); + + this.setComponentValue(values[0]); + this.assertAttributeHasValue(attributeName, values[0], attributeName + ' can be set back to the initial value'); + }; + + _class.prototype.runPropertyTest = function runPropertyTest(propertyName, values) { + var _this2 = this; + + var attributeName = propertyName; + var template = ''; + this.render(template, { value: values[0] }); + this.assertPropertyHasValue(propertyName, values[0], propertyName + ' is set on initial render'); + + this.runTask(function () { + return _this2.rerender(); + }); + this.assertPropertyHasValue(propertyName, values[0], propertyName + ' is set on noop rerender'); + + this.setComponentValue(values[1]); + this.assertPropertyHasValue(propertyName, values[1], propertyName + ' is set on rerender'); + + this.setComponentValue(values[0]); + this.assertPropertyHasValue(propertyName, values[0], propertyName + ' can be set back to the initial value'); + }; + + _class.prototype.runFalsyValueProperty = function runFalsyValueProperty(values) { + var _this3 = this; + + var value = 'value'; + var template = ''; + this.render(template, { value: values[0] }); + this.assertPropertyHasValue(value, '', value + ' is set on initial render'); + + this.runTask(function () { + return _this3.rerender(); + }); + this.assertPropertyHasValue(value, '', value + ' is set on noop rerender'); + this.setComponentValue(values[1]); + + this.assertPropertyHasValue(value, values[1], value + ' is set on rerender'); + + this.setComponentValue(values[0]); + this.assertPropertyHasValue(value, '', value + ' can be set back to the initial value'); + }; + + _class.prototype['@test input disabled attribute'] = function testInputDisabledAttribute() { + var _this4 = this; + + var model = { model: { value: false } }; + + this.render('', model); + + this.assert.equal(this.$inputElement().prop('disabled'), false); + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assert.equal(this.$inputElement().prop('disabled'), false); + + this.runTask(function () { + return _this4.context.set('model.value', true); + }); + + this.assert.equal(this.$inputElement().prop('disabled'), true); + this.assertHTML(''); // Note the DOM output is + + this.runTask(function () { + return _this4.context.set('model.value', 'wat'); + }); + + this.assert.equal(this.$inputElement().prop('disabled'), true); + this.assertHTML(''); // Note the DOM output is + + this.runTask(function () { + return _this4.context.set('model', { value: false }); + }); + + this.assert.equal(this.$inputElement().prop('disabled'), false); + this.assertHTML(''); + }; + + _class.prototype['@test input value attribute'] = function testInputValueAttribute() { + this.runPropertyTest('value', ['foo', 'bar']); + }; + + _class.prototype['@test input placeholder attribute'] = function testInputPlaceholderAttribute() { + this.runAttributeTest('placeholder', ['foo', 'bar']); + }; + + _class.prototype['@test input name attribute'] = function testInputNameAttribute() { + this.runAttributeTest('name', ['nam', 'name']); + }; + + _class.prototype['@test input maxlength attribute'] = function testInputMaxlengthAttribute() { + this.runAttributeTest('maxlength', [2, 3]); + }; + + _class.prototype['@test input size attribute'] = function testInputSizeAttribute() { + this.runAttributeTest('size', [2, 3]); + }; + + _class.prototype['@test input tabindex attribute'] = function testInputTabindexAttribute() { + this.runAttributeTest('tabindex', [2, 3]); + }; + + _class.prototype['@test null input value'] = function testNullInputValue() { + this.runFalsyValueProperty([null, 'hello']); + }; + + _class.prototype['@test undefined input value'] = function testUndefinedInputValue() { + this.runFalsyValueProperty([undefined, 'hello']); + }; + + _class.prototype['@test undefined `toString` method as input value'] = function testUndefinedToStringMethodAsInputValue() { + this.runFalsyValueProperty([Object.create(null), 'hello']); + }; + + _class.prototype['@test cursor position is not lost when updating content'] = function testCursorPositionIsNotLostWhenUpdatingContent() { + var template = ''; + this.render(template, { value: 'hola' }); + + this.setDOMValue('hello'); + this.setSelectionRange(1, 3); + + this.setComponentValue('hello'); + + this.assertSelectionRange(1, 3); + + // Note: We should eventually get around to testing reseting, however + // browsers handle `selectionStart` and `selectionEnd` differently + // when are synthetically testing movement of the cursor. + }; + + _class.prototype['@test input can be updated multiple times'] = function testInputCanBeUpdatedMultipleTimes() { + var template = ''; + this.render(template, { value: 'hola' }); + + this.assertValue('hola', 'Value is initialised'); + + this.setComponentValue(''); + this.assertValue('', 'Value is set in the DOM'); + + this.setDOMValue('hola'); + this.setComponentValue('hola'); + this.assertValue('hola', 'Value is updated the first time'); + + this.setComponentValue(''); + this.assertValue('', 'Value is updated the second time'); + }; + + _class.prototype['@test DOM is SSOT if value is set'] = function testDOMIsSSOTIfValueIsSet() { + var template = ''; + this.render(template, { value: 'hola' }); + + this.assertValue('hola', 'Value is initialised'); + + this.setComponentValue('hello'); + + this.assertValue('hello', 'Value is initialised'); + + this.setDOMValue('hola'); + + this.assertValue('hola', 'DOM is used'); + + this.setComponentValue('bye'); + + this.assertValue('bye', 'Value is used'); + + // Simulates setting the input to the same value as it already is which won't cause a rerender + + this.setDOMValue('hola'); + + this.assertValue('hola', 'DOM is used'); + + this.setComponentValue('hola'); + + this.assertValue('hola', 'Value is used'); + }; + + // private helpers and assertions + + _class.prototype.setDOMValue = function setDOMValue(value) { + this.inputElement().value = value; + }; + + _class.prototype.setComponentValue = function setComponentValue(value) { + var _this5 = this; + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'value', value); + }); + }; + + _class.prototype.setSelectionRange = function setSelectionRange(start, end) { + this.inputElement().selectionStart = start; + this.inputElement().selectionEnd = end; + }; + + _class.prototype.inputElement = function inputElement() { + return this.$inputElement()[0]; + }; + + _class.prototype.$inputElement = function $inputElement() { + return this.$('input'); + }; + + _class.prototype.assertValue = function assertValue(value, message) { + this.assertPropertyHasValue('value', value, message); + }; + + _class.prototype.assertAttributeHasValue = function assertAttributeHasValue(attribute, value, message) { + this.assert.equal(this.$inputElement().attr(attribute), value, attribute + ' ' + message); + }; + + _class.prototype.assertPropertyHasValue = function assertPropertyHasValue(property, value, message) { + this.assert.equal(this.$inputElement().prop(property), value, property + ' ' + message); + }; + + _class.prototype.assertSelectionRange = function assertSelectionRange(start, end) { + this.assert.equal(this.inputElement().selectionStart, start); + this.assert.equal(this.inputElement().selectionEnd, end); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/input-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration'); + test('ember-glimmer/tests/integration/input-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/input-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/input-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration'); + QUnit.test('ember-glimmer/tests/integration/input-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/input-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/mount-test', ['exports', 'ember-utils', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-runtime', 'ember-metal', 'ember-application'], function (exports, _emberUtils, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberRuntime, _emberMetal, _emberApplication) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('{{mount}} assertions', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test it asserts that only a single param is passed'] = function testItAssertsThatOnlyASingleParamIsPassed() { + var _this = this; + + expectAssertion(function () { + _this.render('{{mount "chat" "foo"}}'); + }, /You can only pass a single argument to the {{mount}} helper, e.g. {{mount "chat-engine"}}./i); + }; + + _class.prototype['@test it asserts that the engine name argument is quoted'] = function testItAssertsThatTheEngineNameArgumentIsQuoted() { + var _this2 = this; + + expectAssertion(function () { + _this2.render('{{mount chat}}'); + }, /The first argument of {{mount}} must be quoted, e.g. {{mount "chat-engine"}}./i); + }; + + _class.prototype['@test it asserts that the specified engine is registered'] = function testItAssertsThatTheSpecifiedEngineIsRegistered() { + var _this3 = this; + + expectAssertion(function () { + _this3.render('{{mount "chat"}}'); + }, /You used `{{mount 'chat'}}`, but the engine 'chat' can not be found./i); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('{{mount}} test', (function (_ApplicationTest) { + babelHelpers.inherits(_class2, _ApplicationTest); + + function _class2() { + _ApplicationTest.call(this); + + var engineRegistrations = this.engineRegistrations = {}; + + this.registerEngine('chat', _emberApplication.Engine.extend({ + router: null, + + init: function () { + var _this4 = this; + + this._super.apply(this, arguments); + + Object.keys(engineRegistrations).forEach(function (fullName) { + _this4.register(fullName, engineRegistrations[fullName]); + }); + } + })); + + this.registerTemplate('index', '{{mount "chat"}}'); + } + + _class2.prototype['@test it boots an engine, instantiates its application controller, and renders its application template'] = function testItBootsAnEngineInstantiatesItsApplicationControllerAndRendersItsApplicationTemplate(assert) { + var _this5 = this; + + this.engineRegistrations['template:application'] = _emberGlimmerTestsUtilsHelpers.compile('

    Chat here, {{username}}

    ', { moduleName: 'application' }); + + var controller = undefined; + + this.engineRegistrations['controller:application'] = _emberRuntime.Controller.extend({ + username: 'dgeb', + + init: function () { + this._super(); + controller = this; + } + }); + + return this.visit('/').then(function () { + assert.ok(controller, 'engine\'s application controller has been instantiated'); + + var engineInstance = _emberUtils.getOwner(controller); + assert.strictEqual(_emberApplication.getEngineParent(engineInstance), _this5.applicationInstance, 'engine instance has the application instance as its parent'); + + _this5.assertComponentElement(_this5.firstChild, { content: '

    Chat here, dgeb

    ' }); + + _this5.runTask(function () { + return _emberMetal.set(controller, 'username', 'chancancode'); + }); + + _this5.assertComponentElement(_this5.firstChild, { content: '

    Chat here, chancancode

    ' }); + + _this5.runTask(function () { + return _emberMetal.set(controller, 'username', 'dgeb'); + }); + + _this5.assertComponentElement(_this5.firstChild, { content: '

    Chat here, dgeb

    ' }); + }); + }; + + return _class2; + })(_emberGlimmerTestsUtilsTestCase.ApplicationTest)); +}); +enifed('ember-glimmer/tests/integration/mount-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration'); + test('ember-glimmer/tests/integration/mount-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/mount-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/mount-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration'); + QUnit.test('ember-glimmer/tests/integration/mount-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/mount-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/outlet-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'internal-test-helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _internalTestHelpers, _emberMetal) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('outlet view', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + + var CoreOutlet = this.owner._lookupFactory('view:-outlet'); + this.component = CoreOutlet.create(); + } + + _class.prototype['@test should not error when initial rendered template is undefined'] = function testShouldNotErrorWhenInitialRenderedTemplateIsUndefined() { + var _this = this; + + var outletState = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'application', + controller: undefined, + ViewClass: undefined, + template: undefined + }, + + outlets: Object.create(null) + }; + + this.runTask(function () { + return _this.component.setOutletState(outletState); + }); + + _internalTestHelpers.runAppend(this.component); + + this.assertText(''); + }; + + _class.prototype['@test should render the outlet when set after DOM insertion'] = function testShouldRenderTheOutletWhenSetAfterDOMInsertion() { + var _this2 = this; + + var outletState = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'application', + controller: undefined, + ViewClass: undefined, + template: undefined + }, + + outlets: Object.create(null) + }; + + this.runTask(function () { + return _this2.component.setOutletState(outletState); + }); + + _internalTestHelpers.runAppend(this.component); + + this.assertText(''); + + this.registerTemplate('application', 'HI{{outlet}}'); + outletState = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'application', + controller: {}, + ViewClass: undefined, + template: this.owner.lookup('template:application') + }, + outlets: Object.create(null) + }; + + this.runTask(function () { + return _this2.component.setOutletState(outletState); + }); + + this.assertText('HI'); + + this.assertStableRerender(); + + this.registerTemplate('index', '

    BYE

    '); + outletState.outlets.main = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'index', + controller: {}, + ViewClass: undefined, + template: this.owner.lookup('template:index') + }, + outlets: Object.create(null) + }; + + this.runTask(function () { + return _this2.component.setOutletState(outletState); + }); + + this.assertText('HIBYE'); + }; + + _class.prototype['@test should render the outlet when set before DOM insertion'] = function testShouldRenderTheOutletWhenSetBeforeDOMInsertion() { + var _this3 = this; + + this.registerTemplate('application', 'HI{{outlet}}'); + var outletState = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'application', + controller: {}, + ViewClass: undefined, + template: this.owner.lookup('template:application') + }, + outlets: Object.create(null) + }; + + this.runTask(function () { + return _this3.component.setOutletState(outletState); + }); + + _internalTestHelpers.runAppend(this.component); + + this.assertText('HI'); + + this.assertStableRerender(); + + this.registerTemplate('index', '

    BYE

    '); + outletState.outlets.main = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'index', + controller: {}, + ViewClass: undefined, + template: this.owner.lookup('template:index') + }, + outlets: Object.create(null) + }; + + this.runTask(function () { + return _this3.component.setOutletState(outletState); + }); + + this.assertText('HIBYE'); + }; + + _class.prototype['@test should support an optional name'] = function testShouldSupportAnOptionalName() { + var _this4 = this; + + this.registerTemplate('application', '

    HI

    {{outlet "special"}}'); + var outletState = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'application', + controller: {}, + ViewClass: undefined, + template: this.owner.lookup('template:application') + }, + outlets: Object.create(null) + }; + + this.runTask(function () { + return _this4.component.setOutletState(outletState); + }); + + _internalTestHelpers.runAppend(this.component); + + this.assertText('HI'); + + this.assertStableRerender(); + + this.registerTemplate('special', '

    BYE

    '); + outletState.outlets.special = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'special', + controller: {}, + ViewClass: undefined, + template: this.owner.lookup('template:special') + }, + outlets: Object.create(null) + }; + + this.runTask(function () { + return _this4.component.setOutletState(outletState); + }); + + this.assertText('HIBYE'); + }; + + _class.prototype['@test does not default outlet name when positional argument is present'] = function testDoesNotDefaultOutletNameWhenPositionalArgumentIsPresent() { + var _this5 = this; + + this.registerTemplate('application', '

    HI

    {{outlet someUndefinedThing}}'); + var outletState = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'application', + controller: {}, + ViewClass: undefined, + template: this.owner.lookup('template:application') + }, + outlets: Object.create(null) + }; + + this.runTask(function () { + return _this5.component.setOutletState(outletState); + }); + + _internalTestHelpers.runAppend(this.component); + + this.assertText('HI'); + + this.assertStableRerender(); + + this.registerTemplate('special', '

    BYE

    '); + outletState.outlets.main = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'special', + controller: {}, + ViewClass: undefined, + template: this.owner.lookup('template:special') + }, + outlets: Object.create(null) + }; + + this.runTask(function () { + return _this5.component.setOutletState(outletState); + }); + + this.assertText('HI'); + }; + + _class.prototype['@test should support bound outlet name'] = function testShouldSupportBoundOutletName() { + var _this6 = this; + + var controller = { outletName: 'foo' }; + this.registerTemplate('application', '

    HI

    {{outlet outletName}}'); + var outletState = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'application', + controller: controller, + ViewClass: undefined, + template: this.owner.lookup('template:application') + }, + outlets: Object.create(null) + }; + + this.runTask(function () { + return _this6.component.setOutletState(outletState); + }); + + _internalTestHelpers.runAppend(this.component); + + this.assertText('HI'); + + this.assertStableRerender(); + + this.registerTemplate('foo', '

    FOO

    '); + outletState.outlets.foo = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'foo', + controller: {}, + ViewClass: undefined, + template: this.owner.lookup('template:foo') + }, + outlets: Object.create(null) + }; + + this.registerTemplate('bar', '

    BAR

    '); + outletState.outlets.bar = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'bar', + controller: {}, + ViewClass: undefined, + template: this.owner.lookup('template:bar') + }, + outlets: Object.create(null) + }; + + this.runTask(function () { + return _this6.component.setOutletState(outletState); + }); + + this.assertText('HIFOO'); + + this.runTask(function () { + return _emberMetal.set(controller, 'outletName', 'bar'); + }); + + this.assertText('HIBAR'); + }; + + _class.prototype['@test outletState can pass through user code (liquid-fire initimate API) '] = function testOutletStateCanPassThroughUserCodeLiquidFireInitimateAPI() { + var _this7 = this; + + this.registerTemplate('outer', 'A{{#-with-dynamic-vars outletState=(identity (-get-dynamic-var "outletState"))}}B{{outlet}}D{{/-with-dynamic-vars}}E'); + this.registerTemplate('inner', 'C'); + + // This looks like it doesn't do anything, but its presence + // guarantees that the outletState gets converted from a reference + // to a value and then back to a reference. That is what we're + // testing here. + this.registerHelper('identity', function (_ref) { + var a = _ref[0]; + return a; + }); + + var outletState = { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'outer', + controller: {}, + ViewClass: undefined, + template: this.owner.lookup('template:outer') + }, + outlets: { + main: { + render: { + owner: this.owner, + into: undefined, + outlet: 'main', + name: 'inner', + controller: {}, + ViewClass: undefined, + template: this.owner.lookup('template:inner') + }, + outlets: Object.create(null) + } + } + }; + + this.runTask(function () { + return _this7.component.setOutletState(outletState); + }); + + _internalTestHelpers.runAppend(this.component); + + this.assertText('ABCDE'); + + this.assertStableRerender(); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/outlet-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration'); + test('ember-glimmer/tests/integration/outlet-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/outlet-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/outlet-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration'); + QUnit.test('ember-glimmer/tests/integration/outlet-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/outlet-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/refinements-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberMetal) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with var as |foo|}}\n {{foo}}\n {{/with}}\n\n ---\n\n {{#with var as |render|}}\n {{render}}\n {{/with}}\n\n ---\n\n {{#with var as |outlet|}}\n {{outlet}}\n {{/with}}\n\n ---\n\n {{#with var as |mount|}}\n {{mount}}\n {{/with}}\n\n ---\n\n {{#with var as |component|}}\n {{component}}\n {{/with}}\n\n ---\n\n {{#with var as |input|}}\n {{input}}\n {{/with}}\n\n ---\n\n {{#with var as |-with-dynamic-vars|}}\n {{-with-dynamic-vars}}\n {{/with}}\n\n ---\n\n {{#with var as |-in-element|}}\n {{-in-element}}\n {{/with}}'], ['\n {{#with var as |foo|}}\n {{foo}}\n {{/with}}\n\n ---\n\n {{#with var as |render|}}\n {{render}}\n {{/with}}\n\n ---\n\n {{#with var as |outlet|}}\n {{outlet}}\n {{/with}}\n\n ---\n\n {{#with var as |mount|}}\n {{mount}}\n {{/with}}\n\n ---\n\n {{#with var as |component|}}\n {{component}}\n {{/with}}\n\n ---\n\n {{#with var as |input|}}\n {{input}}\n {{/with}}\n\n ---\n\n {{#with var as |-with-dynamic-vars|}}\n {{-with-dynamic-vars}}\n {{/with}}\n\n ---\n\n {{#with var as |-in-element|}}\n {{-in-element}}\n {{/with}}']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('syntax refinements', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test block params should not be refined'] = function testBlockParamsShouldNotBeRefined() { + var _this = this; + + this.registerHelper('foo', function () { + return 'bar helper'; + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { var: 'var' }); + + this.assertText('var---var---var---var---var---var---var---var'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'var', 'RARRR!!!'); + }); + + this.assertText('RARRR!!!---RARRR!!!---RARRR!!!---RARRR!!!---RARRR!!!---RARRR!!!---RARRR!!!---RARRR!!!'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'var', 'var'); + }); + + this.assertText('var---var---var---var---var---var---var---var'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/refinements-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration'); + test('ember-glimmer/tests/integration/refinements-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/refinements-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/refinements-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration'); + QUnit.test('ember-glimmer/tests/integration/refinements-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/refinements-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/svg-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n \n
    \n '], ['\n
    \n \n
    \n ']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n \n
    \n '], ['\n
    \n \n
    \n ']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n \n
    \n '], ['\n
    \n \n
    \n ']), + _templateObject4 = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n \n
    \n '], ['\n
    \n \n
    \n ']), + _templateObject5 = babelHelpers.taggedTemplateLiteralLoose(['\n
    \n \n
    \n '], ['\n
    \n \n
    \n ']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('SVG element tests', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test unquoted viewBox property is output'] = function testUnquotedViewBoxPropertyIsOutput(assert) { + var _this = this; + + var viewBoxString = '0 0 100 100'; + + this.render('
    ', { + model: { + viewBoxString: viewBoxString + } + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject, viewBoxString)); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject, viewBoxString)); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'model.viewBoxString', null); + }); + + assert.equal(this.firstChild.getAttribute('svg'), null); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'model', { viewBoxString: viewBoxString }); + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject, viewBoxString)); + }; + + _class.prototype['@test quoted viewBox property is output'] = function testQuotedViewBoxPropertyIsOutput(assert) { + var _this2 = this; + + var viewBoxString = '0 0 100 100'; + + this.render('
    ', { + model: { + viewBoxString: viewBoxString + } + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject, viewBoxString)); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject, viewBoxString)); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'model.viewBoxString', null); + }); + + assert.equal(this.firstChild.getAttribute('svg'), null); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'model', { viewBoxString: viewBoxString }); + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject, viewBoxString)); + }; + + _class.prototype['@test quoted viewBox property is concat'] = function testQuotedViewBoxPropertyIsConcat() { + var _this3 = this; + + var viewBoxString = '100 100'; + + this.render('
    ', { + model: { + viewBoxString: viewBoxString + } + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2, viewBoxString)); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2, viewBoxString)); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'model.viewBoxString', '200 200'); + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3)); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'model', { viewBoxString: viewBoxString }); + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2, viewBoxString)); + }; + + _class.prototype['@test class is output'] = function testClassIsOutput() { + var _this4 = this; + + this.render('
    ', { + model: { + color: 'blue' + } + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4)); + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4)); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'model.color', 'yellow'); + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5)); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'model', { color: 'blue' }); + }); + + this.assertInnerHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4)); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/svg-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration'); + test('ember-glimmer/tests/integration/svg-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/svg-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/svg-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration'); + QUnit.test('ember-glimmer/tests/integration/svg-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/svg-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/syntax/each-in-test', ['exports', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-runtime', 'ember-glimmer/tests/utils/shared-conditional-tests'], function (exports, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberRuntime, _emberGlimmerTestsUtilsSharedConditionalTests) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n
      \n {{#each-in categories as |category count|}}\n
    • {{category}}: {{count}}
    • \n {{/each-in}}\n
    \n '], ['\n
      \n {{#each-in categories as |category count|}}\n
    • {{category}}: {{count}}
    • \n {{/each-in}}\n
    \n ']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n
      \n
    • Smartphones: 8203
    • \n
    • JavaScript Frameworks: Infinity
    • \n
    \n '], ['\n
      \n
    • Smartphones: 8203
    • \n
    • JavaScript Frameworks: Infinity
    • \n
    \n ']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['\n
      \n
    • Smartphones: 100
    • \n
    • JavaScript Frameworks: Infinity
    • \n
    • Tweets: 443115
    • \n
    \n '], ['\n
      \n
    • Smartphones: 100
    • \n
    • JavaScript Frameworks: Infinity
    • \n
    • Tweets: 443115
    • \n
    \n ']), + _templateObject4 = babelHelpers.taggedTemplateLiteralLoose(['\n
      \n {{#each-in categories as |category data|}}\n
    • {{category}}: {{data.reports.unitsSold}}
    • \n {{/each-in}}\n
    \n '], ['\n
      \n {{#each-in categories as |category data|}}\n
    • {{category}}: {{data.reports.unitsSold}}
    • \n {{/each-in}}\n
    \n ']), + _templateObject5 = babelHelpers.taggedTemplateLiteralLoose(['\n
      \n {{#each-in categories key=\'@identity\' as |category count|}}\n
    • {{category}}: {{count}}
    • \n {{/each-in}}\n
    \n '], ['\n
      \n {{#each-in categories key=\'@identity\' as |category count|}}\n
    • {{category}}: {{count}}
    • \n {{/each-in}}\n
    \n ']), + _templateObject6 = babelHelpers.taggedTemplateLiteralLoose(['\n
      \n
    • Smartphones: 8203
    • \n
    • Tablets: 8203
    • \n
    • JavaScript Frameworks: Infinity
    • \n
    • Bugs: Infinity
    • \n
    \n '], ['\n
      \n
    • Smartphones: 8203
    • \n
    • Tablets: 8203
    • \n
    • JavaScript Frameworks: Infinity
    • \n
    • Bugs: Infinity
    • \n
    \n ']), + _templateObject7 = babelHelpers.taggedTemplateLiteralLoose(['\n
      \n
    • Smartphones: 100
    • \n
    • Tablets: 8203
    • \n
    • JavaScript Frameworks: Infinity
    • \n
    • Bugs: Infinity
    • \n
    • Tweets: 443115
    • \n
    \n '], ['\n
      \n
    • Smartphones: 100
    • \n
    • Tablets: 8203
    • \n
    • JavaScript Frameworks: Infinity
    • \n
    • Bugs: Infinity
    • \n
    • Tweets: 443115
    • \n
    \n ']), + _templateObject8 = babelHelpers.taggedTemplateLiteralLoose(['\n
      \n {{#each-in (get collection type) as |category count|}}\n
    • {{category}}: {{count}}
    • \n {{/each-in}}\n
    \n '], ['\n
      \n {{#each-in (get collection type) as |category count|}}\n
    • {{category}}: {{count}}
    • \n {{/each-in}}\n
    \n ']), + _templateObject9 = babelHelpers.taggedTemplateLiteralLoose(['\n
      \n
    • Emberinios: 533462
    • \n
    • Tweets: 7323
    • \n
    \n '], ['\n
      \n
    • Emberinios: 533462
    • \n
    • Tweets: 7323
    • \n
    \n ']), + _templateObject10 = babelHelpers.taggedTemplateLiteralLoose(['\n
      \n
    • Televisions: 183
    • \n
    • Alarm Clocks: 999
    • \n
    \n '], ['\n
      \n
    • Televisions: 183
    • \n
    • Alarm Clocks: 999
    • \n
    \n ']), + _templateObject11 = babelHelpers.taggedTemplateLiteralLoose(['\n
      \n
    • Televisions: 183
    • \n
    • Alarm Clocks: 999
    • \n
    • Tweets: 443115
    • \n
    \n '], ['\n
      \n
    • Televisions: 183
    • \n
    • Alarm Clocks: 999
    • \n
    • Tweets: 443115
    • \n
    \n ']), + _templateObject12 = babelHelpers.taggedTemplateLiteralLoose(['\n
      \n
    • Emberinios: 123456
    • \n
    \n '], ['\n
      \n
    • Emberinios: 123456
    • \n
    \n ']), + _templateObject13 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each-in foo.bar.baz as |thing|}}\n {{thing}}\n {{/each-in}}'], ['\n {{#each-in foo.bar.baz as |thing|}}\n {{thing}}\n {{/each-in}}']), + _templateObject14 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each-in arr as |key value|}}\n [{{key}}:{{value}}]\n {{/each-in}}'], ['\n {{#each-in arr as |key value|}}\n [{{key}}:{{value}}]\n {{/each-in}}']), + _templateObject15 = babelHelpers.taggedTemplateLiteralLoose(['\n
      \n
    • Smartphones: 100
    • \n
    • Tablets: 20
    • \n
    \n '], ['\n
      \n
    • Smartphones: 100
    • \n
    • Tablets: 20
    • \n
    \n ']); + + var EachInTest = (function (_TogglingSyntaxConditionalsTest) { +babelHelpers.inherits(EachInTest, _TogglingSyntaxConditionalsTest); + + function EachInTest() { + _TogglingSyntaxConditionalsTest.apply(this, arguments); + } + + EachInTest.prototype.templateFor = function templateFor(_ref) { + var cond = _ref.cond; + var truthy = _ref.truthy; + var falsy = _ref.falsy; + + return '{{#each-in ' + cond + ' as |key|}}' + truthy + '{{else}}' + falsy + '{{/each-in}}'; + }; + + return EachInTest; + })(_emberGlimmerTestsUtilsSharedConditionalTests.TogglingSyntaxConditionalsTest); + + function EmptyFunction() {} + + function NonEmptyFunction() {} + NonEmptyFunction.foo = 'bar'; + + var EmptyConstructor = function EmptyConstructor() {}; + + var NonEmptyConstructor = function NonEmptyConstructor() {}; + + NonEmptyConstructor.foo = 'bar'; + + var BasicEachInTest = (function (_EachInTest) { +babelHelpers.inherits(BasicEachInTest, _EachInTest); + + function BasicEachInTest() { + _EachInTest.apply(this, arguments); + } + + return BasicEachInTest; + })(EachInTest); + + _emberGlimmerTestsUtilsAbstractTestCase.applyMixins(BasicEachInTest, new _emberGlimmerTestsUtilsSharedConditionalTests.TruthyGenerator([{ foo: 1 }, _emberRuntime.Object.create({ 'Not Empty': 1 }), [1], NonEmptyFunction, NonEmptyConstructor]), new _emberGlimmerTestsUtilsSharedConditionalTests.FalsyGenerator([null, undefined, false, '', 0, [], EmptyFunction, EmptyConstructor, {}, Object.create(null), Object.create({}), Object.create({ 'Not Empty': 1 }), _emberRuntime.Object.create()])); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#each-in}}', (function (_BasicEachInTest) { +babelHelpers.inherits(_class, _BasicEachInTest); + + function _class() { + _BasicEachInTest.apply(this, arguments); + } + + _class.prototype['@test it repeats the given block for each item in the hash'] = function testItRepeatsTheGivenBlockForEachItemInTheHash() { + var _this = this; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { + categories: { + 'Smartphones': 8203, + 'JavaScript Frameworks': Infinity + } + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + + this.assertStableRerender(); + + this.runTask(function () { + _emberMetal.set(_this.context, 'categories.Smartphones', 100); + _emberMetal.set(_this.context, 'categories.Tweets', 443115); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3)); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'categories', { + 'Smartphones': 8203, + 'JavaScript Frameworks': Infinity + }); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + }; + + _class.prototype['@test it can render sub-paths of each item'] = function testItCanRenderSubPathsOfEachItem() { + var _this2 = this; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4), { + categories: { + 'Smartphones': { reports: { unitsSold: 8203 } }, + 'JavaScript Frameworks': { reports: { unitsSold: Infinity } } + } + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + + this.assertStableRerender(); + + this.runTask(function () { + _emberMetal.set(_this2.context, 'categories.Smartphones.reports.unitsSold', 100); + _emberMetal.set(_this2.context, 'categories.Tweets', { reports: { unitsSold: 443115 } }); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3)); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'categories', { + 'Smartphones': { reports: { unitsSold: 8203 } }, + 'JavaScript Frameworks': { reports: { unitsSold: Infinity } } + }); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + }; + + _class.prototype['@test it can render duplicate items'] = function testItCanRenderDuplicateItems() { + var _this3 = this; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5), { + categories: { + 'Smartphones': 8203, + 'Tablets': 8203, + 'JavaScript Frameworks': Infinity, + 'Bugs': Infinity + } + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject6)); + + this.assertStableRerender(); + + this.runTask(function () { + _emberMetal.set(_this3.context, 'categories.Smartphones', 100); + _emberMetal.set(_this3.context, 'categories.Tweets', 443115); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject7)); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'categories', { + 'Smartphones': 8203, + 'Tablets': 8203, + 'JavaScript Frameworks': Infinity, + 'Bugs': Infinity + }); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject6)); + }; + + _class.prototype['@test it repeats the given block when the hash is dynamic'] = function testItRepeatsTheGivenBlockWhenTheHashIsDynamic() { + var _this4 = this; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject8), { + collection: { + categories: { + 'Smartphones': 8203, + 'JavaScript Frameworks': Infinity + }, + otherCategories: { + 'Emberinios': 533462, + 'Tweets': 7323 + } + }, + type: 'categories' + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + + this.assertStableRerender(); + + this.runTask(function () { + _emberMetal.set(_this4.context, 'type', 'otherCategories'); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject9)); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'type', 'categories'); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + }; + + _class.prototype['@test it only iterates over an object\'s own properties'] = function testItOnlyIteratesOverAnObjectSOwnProperties() { + var _this5 = this; + + var protoCategories = { + 'Smartphones': 8203, + 'JavaScript Frameworks': Infinity + }; + + var categories = Object.create(protoCategories); + categories['Televisions'] = 183; + categories['Alarm Clocks'] = 999; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { categories: categories }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject10)); + + this.assertStableRerender(); + + this.runTask(function () { + _emberMetal.set(protoCategories, 'Robots', 666); + _emberMetal.set(categories, 'Tweets', 443115); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject11)); + + categories = Object.create(protoCategories); + categories['Televisions'] = 183; + categories['Alarm Clocks'] = 999; + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'categories', categories); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject10)); + }; + + _class.prototype['@test it does not observe direct property mutations (not going through set) on the object'] = function testItDoesNotObserveDirectPropertyMutationsNotGoingThroughSetOnTheObject() { + var _this6 = this; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { + categories: { + 'Smartphones': 8203, + 'JavaScript Frameworks': Infinity + } + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + + this.assertStableRerender(); + + this.runTask(function () { + var categories = _emberMetal.get(_this6.context, 'categories'); + delete categories.Smartphones; + }); + + this.assertInvariants(); + + this.runTask(function () { + var categories = _emberMetal.get(_this6.context, 'categories'); + categories['Emberinios'] = 123456; + }); + + this.assertInvariants(); + + this.runTask(function () { + _emberMetal.set(_this6.context, 'categories', { + Emberinios: 123456 + }); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject12)); + + this.runTask(function () { + _emberMetal.set(_this6.context, 'categories', { + 'Smartphones': 8203, + 'JavaScript Frameworks': Infinity + }); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + }; + + _class.prototype['@test keying off of `undefined` does not render'] = function testKeyingOffOfUndefinedDoesNotRender(assert) { + var _this7 = this; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject13), { foo: {} }); + + this.assertText(''); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'foo', { bar: { baz: { 'Here!': 1 } } }); + }); + + this.assertText('Here!'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'foo', {}); + }); + + this.assertText(''); + }; + + _class.prototype['@test it iterate over array with `in` instead of walking over elements'] = function testItIterateOverArrayWithInInsteadOfWalkingOverElements(assert) { + var _this8 = this; + + var arr = [1, 2, 3]; + arr.foo = 'bar'; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject14), { arr: arr }); + + this.assertText('[0:1][1:2][2:3][foo:bar]'); + + this.runTask(function () { + return _this8.rerender(); + }); + + this.assertText('[0:1][1:2][2:3][foo:bar]'); + + this.runTask(function () { + _emberMetal.set(arr, 'zomg', 'lol'); + }); + + this.assertText('[0:1][1:2][2:3][foo:bar][zomg:lol]'); + + arr = [1, 2, 3]; + arr.foo = 'bar'; + + this.runTask(function () { + return _emberMetal.set(_this8.context, 'arr', arr); + }); + + this.assertText('[0:1][1:2][2:3][foo:bar]'); + }; + +babelHelpers.createClass(_class, [{ + key: 'truthyValue', + get: function () { + return { 'Not Empty': 1 }; + } + }, { + key: 'falsyValue', + get: function () { + return {}; + } + }]); + return _class; + })(BasicEachInTest)); + + var EachInEdgeCasesTest = (function (_EachInTest2) { +babelHelpers.inherits(EachInEdgeCasesTest, _EachInTest2); + + function EachInEdgeCasesTest() { + _EachInTest2.apply(this, arguments); + } + + return EachInEdgeCasesTest; + })(EachInTest); + + _emberGlimmerTestsUtilsAbstractTestCase.applyMixins(EachInEdgeCasesTest, new _emberGlimmerTestsUtilsSharedConditionalTests.FalsyGenerator([true, 1, 'hello'])); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#each-in}} edge cases', (function (_EachInEdgeCasesTest) { +babelHelpers.inherits(_class2, _EachInEdgeCasesTest); + + function _class2() { + _EachInEdgeCasesTest.apply(this, arguments); + } + +babelHelpers.createClass(_class2, [{ + key: 'truthyValue', + get: function () { + return { 'Not Empty': 1 }; + } + }, { + key: 'falsyValue', + get: function () { + return {}; + } + }]); + return _class2; + })(EachInEdgeCasesTest)); + + var EachInProxyTest = (function (_EachInTest3) { +babelHelpers.inherits(EachInProxyTest, _EachInTest3); + + function EachInProxyTest() { + _EachInTest3.apply(this, arguments); + } + + return EachInProxyTest; + })(EachInTest); + + _emberGlimmerTestsUtilsAbstractTestCase.applyMixins(EachInProxyTest, new _emberGlimmerTestsUtilsSharedConditionalTests.TruthyGenerator([_emberRuntime.ObjectProxy.create({ content: { 'Not empty': 1 } })]), new _emberGlimmerTestsUtilsSharedConditionalTests.FalsyGenerator([_emberRuntime.ObjectProxy.create(), _emberRuntime.ObjectProxy.create({ content: null }), _emberRuntime.ObjectProxy.create({ content: {} }), _emberRuntime.ObjectProxy.create({ content: Object.create(null) }), _emberRuntime.ObjectProxy.create({ content: Object.create({}) }), _emberRuntime.ObjectProxy.create({ content: Object.create({ 'Not Empty': 1 }) }), _emberRuntime.ObjectProxy.create({ content: _emberRuntime.Object.create() })])); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#each-in}} with `ObjectProxy`', (function (_EachInProxyTest) { +babelHelpers.inherits(_class3, _EachInProxyTest); + + function _class3() { + _EachInProxyTest.apply(this, arguments); + } + + _class3.prototype['@test it iterates over the content, not the proxy'] = function testItIteratesOverTheContentNotTheProxy() { + var _this9 = this; + + var content = { + 'Smartphones': 8203, + 'JavaScript Frameworks': Infinity + }; + + var proxy = _emberRuntime.ObjectProxy.create({ + content: content, + foo: 'bar' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { categories: proxy }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + + this.assertStableRerender(); + + this.runTask(function () { + _emberMetal.set(proxy, 'content.Smartphones', 100); + _emberMetal.set(proxy, 'content.Tweets', 443115); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3)); + + this.runTask(function () { + _emberMetal.set(proxy, 'content', { + 'Smartphones': 100, + 'Tablets': 20 + }); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject15)); + + this.runTask(function () { + return _emberMetal.set(_this9.context, 'categories', _emberRuntime.ObjectProxy.create({ + content: { + 'Smartphones': 8203, + 'JavaScript Frameworks': Infinity + } + })); + }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + }; + +babelHelpers.createClass(_class3, [{ + key: 'truthyValue', + get: function () { + return _emberRuntime.ObjectProxy.create({ content: { 'Not Empty': 1 } }); + } + }, { + key: 'falsyValue', + get: function () { + return _emberRuntime.ObjectProxy.create({ content: null }); + } + }]); + return _class3; + })(EachInProxyTest)); +}); +enifed('ember-glimmer/tests/integration/syntax/each-in-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/syntax'); + test('ember-glimmer/tests/integration/syntax/each-in-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/syntax/each-in-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/syntax/each-in-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/syntax'); + QUnit.test('ember-glimmer/tests/integration/syntax/each-in-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/syntax/each-in-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/syntax/each-test', ['exports', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-runtime', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/shared-conditional-tests'], function (exports, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberRuntime, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsSharedConditionalTests) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each list as |item|}}\n
  • Prev
  • \n {{foo-bar item=item}}\n
  • Next
  • \n {{/each}}\n '], ['\n {{#each list as |item|}}\n
  • Prev
  • \n {{foo-bar item=item}}\n
  • Next
  • \n {{/each}}\n ']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each content as |value|}}\n {{value}}-\n {{#each options as |option|}}\n {{option.value}}:{{option.label}}\n {{/each}}\n {{/each}}\n '], ['\n {{#each content as |value|}}\n {{value}}-\n {{#each options as |option|}}\n {{option.value}}:{{option.label}}\n {{/each}}\n {{/each}}\n ']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each foo.bar.baz as |thing|}}\n {{thing}}\n {{/each}}'], ['\n {{#each foo.bar.baz as |thing|}}\n {{thing}}\n {{/each}}']), + _templateObject4 = babelHelpers.taggedTemplateLiteralLoose(['\n

    {{page.title}}

    \n\n
      \n {{#each model as |post|}}\n
    • {{post.title}}
    • \n {{/each}}\n
    \n '], ['\n

    {{page.title}}

    \n\n
      \n {{#each model as |post|}}\n
    • {{post.title}}
    • \n {{/each}}\n
    \n ']), + _templateObject5 = babelHelpers.taggedTemplateLiteralLoose(['\n

    Blog Posts

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n '], ['\n

    Blog Posts

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n ']), + _templateObject6 = babelHelpers.taggedTemplateLiteralLoose(['\n

    Essays

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n '], ['\n

    Essays

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n ']), + _templateObject7 = babelHelpers.taggedTemplateLiteralLoose(['\n

    Think Pieces™

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n '], ['\n

    Think Pieces™

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n ']); + + var ArrayLike = (function () { + function ArrayLike(content) { + this._array = content; + } + + ArrayLike.prototype.forEach = function forEach(callback) { + this._array.forEach(callback); + }; + + // The following methods are APIs used by the tests + + ArrayLike.prototype.objectAt = function objectAt(idx) { + return this._array[idx]; + }; + + ArrayLike.prototype.clear = function clear() { + this._array.length = 0; + this.arrayContentDidChange(); + }; + + ArrayLike.prototype.replace = function replace(idx, del, ins) { + var _array; + + (_array = this._array).splice.apply(_array, [idx, del].concat(ins)); + this.arrayContentDidChange(); + }; + + ArrayLike.prototype.unshiftObject = function unshiftObject(obj) { + this._array.unshift(obj); + this.arrayContentDidChange(); + }; + + ArrayLike.prototype.unshiftObjects = function unshiftObjects(arr) { + var _array2; + + (_array2 = this._array).unshift.apply(_array2, arr); + this.arrayContentDidChange(); + }; + + ArrayLike.prototype.pushObject = function pushObject(obj) { + this._array.push(obj); + this.arrayContentDidChange(); + }; + + ArrayLike.prototype.pushObjects = function pushObjects(arr) { + var _array3; + + (_array3 = this._array).push.apply(_array3, arr); + this.arrayContentDidChange(); + }; + + ArrayLike.prototype.shiftObject = function shiftObject() { + var obj = this._array.shift(); + this.arrayContentDidChange(); + return obj; + }; + + ArrayLike.prototype.popObject = function popObject() { + var obj = this._array.pop(); + this.arrayContentDidChange(); + return obj; + }; + + ArrayLike.prototype.insertAt = function insertAt(idx, obj) { + this._array.splice(idx, 0, obj); + this.arrayContentDidChange(); + }; + + ArrayLike.prototype.removeAt = function removeAt(idx) { + var len = arguments.length <= 1 || arguments[1] === undefined ? 1 : arguments[1]; + + this._array.splice(idx, len); + this.arrayContentDidChange(); + }; + + ArrayLike.prototype.arrayContentDidChange = function arrayContentDidChange() { + _emberMetal.propertyDidChange(this, '[]'); + _emberMetal.propertyDidChange(this, 'length'); + }; + +babelHelpers.createClass(ArrayLike, [{ + key: 'length', + get: function () { + return this._array.length; + } + }]); + return ArrayLike; + })(); + + var TogglingEachTest = (function (_TogglingSyntaxConditionalsTest) { +babelHelpers.inherits(TogglingEachTest, _TogglingSyntaxConditionalsTest); + + function TogglingEachTest() { + _TogglingSyntaxConditionalsTest.apply(this, arguments); + } + +babelHelpers.createClass(TogglingEachTest, [{ + key: 'truthyValue', + get: function () { + return ['non-empty']; + } + }, { + key: 'falsyValue', + get: function () { + return []; + } + }]); + return TogglingEachTest; + })(_emberGlimmerTestsUtilsSharedConditionalTests.TogglingSyntaxConditionalsTest); + + var BasicEachTest = (function (_TogglingEachTest) { +babelHelpers.inherits(BasicEachTest, _TogglingEachTest); + + function BasicEachTest() { + _TogglingEachTest.apply(this, arguments); + } + + return BasicEachTest; + })(TogglingEachTest); + + _emberGlimmerTestsUtilsAbstractTestCase.applyMixins(BasicEachTest, new _emberGlimmerTestsUtilsSharedConditionalTests.TruthyGenerator([['hello'], _emberRuntime.A(['hello']), new ArrayLike(['hello']), _emberRuntime.ArrayProxy.create({ content: ['hello'] }), _emberRuntime.ArrayProxy.create({ content: _emberRuntime.A(['hello']) })]), new _emberGlimmerTestsUtilsSharedConditionalTests.FalsyGenerator([null, undefined, false, '', 0, []]), _emberGlimmerTestsUtilsSharedConditionalTests.ArrayTestCases); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: toggling {{#each}}', (function (_BasicEachTest) { +babelHelpers.inherits(_class, _BasicEachTest); + + function _class() { + _BasicEachTest.apply(this, arguments); + } + + _class.prototype.templateFor = function templateFor(_ref) { + var cond = _ref.cond; + var truthy = _ref.truthy; + var falsy = _ref.falsy; + + return '{{#each ' + cond + '}}' + truthy + '{{else}}' + falsy + '{{/each}}'; + }; + + return _class; + })(BasicEachTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: toggling {{#each as}}', (function (_BasicEachTest2) { +babelHelpers.inherits(_class2, _BasicEachTest2); + + function _class2() { + _BasicEachTest2.apply(this, arguments); + } + + _class2.prototype.templateFor = function templateFor(_ref2) { + var cond = _ref2.cond; + var truthy = _ref2.truthy; + var falsy = _ref2.falsy; + + return '{{#each ' + cond + ' as |test|}}' + truthy + '{{else}}' + falsy + '{{/each}}'; + }; + + return _class2; + })(BasicEachTest)); + + var EachEdgeCasesTest = (function (_TogglingEachTest2) { +babelHelpers.inherits(EachEdgeCasesTest, _TogglingEachTest2); + + function EachEdgeCasesTest() { + _TogglingEachTest2.apply(this, arguments); + } + + return EachEdgeCasesTest; + })(TogglingEachTest); + + _emberGlimmerTestsUtilsAbstractTestCase.applyMixins(EachEdgeCasesTest, new _emberGlimmerTestsUtilsSharedConditionalTests.FalsyGenerator([true, 'hello', 1, Object, function () {}, {}, { foo: 'bar' }, Object.create(null), Object.create({}), Object.create({ foo: 'bar' })])); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: toggling {{#each}}', (function (_EachEdgeCasesTest) { +babelHelpers.inherits(_class3, _EachEdgeCasesTest); + + function _class3() { + _EachEdgeCasesTest.apply(this, arguments); + } + + _class3.prototype.templateFor = function templateFor(_ref3) { + var cond = _ref3.cond; + var truthy = _ref3.truthy; + var falsy = _ref3.falsy; + + return '{{#each ' + cond + '}}' + truthy + '{{else}}' + falsy + '{{/each}}'; + }; + + return _class3; + })(EachEdgeCasesTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: toggling {{#each as}}', (function (_EachEdgeCasesTest2) { +babelHelpers.inherits(_class4, _EachEdgeCasesTest2); + + function _class4() { + _EachEdgeCasesTest2.apply(this, arguments); + } + + _class4.prototype.templateFor = function templateFor(_ref4) { + var cond = _ref4.cond; + var truthy = _ref4.truthy; + var falsy = _ref4.falsy; + + return '{{#each ' + cond + ' as |test|}}' + truthy + '{{else}}' + falsy + '{{/each}}'; + }; + + return _class4; + })(EachEdgeCasesTest)); + + var AbstractEachTest = (function (_RenderingTest) { +babelHelpers.inherits(AbstractEachTest, _RenderingTest); + + function AbstractEachTest() { + _RenderingTest.apply(this, arguments); + } + + /* abstract */ + + AbstractEachTest.prototype.makeList = function makeList() { + // this.list = this.delegate = ...; + throw new Error('Not implemented: `makeList`'); + }; + + AbstractEachTest.prototype.replaceList = function replaceList(list) { + var _this = this; + + this.runTask(function () { + return _emberMetal.set(_this.context, 'list', _this.makeList(list)); + }); + }; + + AbstractEachTest.prototype.forEach = function forEach(callback) { + return this.delegate.forEach(callback); + }; + + AbstractEachTest.prototype.objectAt = function objectAt(idx) { + return this.delegate.objectAt(idx); + }; + + AbstractEachTest.prototype.clear = function clear() { + return this.delegate.clear(); + }; + + AbstractEachTest.prototype.replace = function replace(idx, del, ins) { + return this.delegate.replace(idx, del, ins); + }; + + AbstractEachTest.prototype.unshiftObject = function unshiftObject(obj) { + return this.delegate.unshiftObject(obj); + }; + + AbstractEachTest.prototype.unshiftObjects = function unshiftObjects(arr) { + return this.delegate.unshiftObjects(arr); + }; + + AbstractEachTest.prototype.pushObject = function pushObject(obj) { + return this.delegate.pushObject(obj); + }; + + AbstractEachTest.prototype.pushObjects = function pushObjects(arr) { + return this.delegate.pushObjects(arr); + }; + + AbstractEachTest.prototype.shiftObject = function shiftObject() { + return this.delegate.shiftObject(); + }; + + AbstractEachTest.prototype.popObject = function popObject() { + return this.delegate.popObject(); + }; + + AbstractEachTest.prototype.insertAt = function insertAt(idx, obj) { + return this.delegate.insertAt(idx, obj); + }; + + AbstractEachTest.prototype.removeAt = function removeAt(idx, len) { + return this.delegate.removeAt(idx, len); + }; + + AbstractEachTest.prototype.render = function render(template) { + var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + if (this.list === undefined) { + throw new Error('Must call `this.makeList()` before calling this.render()'); + } + + context.list = this.list; + + return _RenderingTest.prototype.render.call(this, template, context); + }; + + return AbstractEachTest; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest); + + var SingleEachTest = (function (_AbstractEachTest) { +babelHelpers.inherits(SingleEachTest, _AbstractEachTest); + + function SingleEachTest() { + _AbstractEachTest.apply(this, arguments); + } + + SingleEachTest.prototype['@test it repeats the given block for each item in the array'] = function testItRepeatsTheGivenBlockForEachItemInTheArray() { + var _this2 = this; + + this.makeList([{ text: 'hello' }]); + + this.render('{{#each list as |item|}}{{item.text}}{{else}}Empty{{/each}}'); + + this.assertText('hello'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertText('hello'); + + this.runTask(function () { + return _emberMetal.set(_this2.objectAt(0), 'text', 'Hello'); + }); + + this.assertText('Hello'); + + this.runTask(function () { + _this2.pushObject({ text: ' ' }); + _this2.pushObject({ text: 'World' }); + }); + + this.assertText('Hello World'); + + this.runTask(function () { + _this2.pushObject({ text: 'Earth' }); + _this2.removeAt(1); + _this2.insertAt(1, { text: 'Globe' }); + }); + + this.assertText('HelloGlobeWorldEarth'); + + this.runTask(function () { + _this2.pushObject({ text: 'Planet' }); + _this2.removeAt(1); + _this2.insertAt(1, { text: ' ' }); + _this2.pushObject({ text: ' ' }); + _this2.pushObject({ text: 'Earth' }); + _this2.removeAt(3); + }); + + this.assertText('Hello WorldPlanet Earth'); + + this.runTask(function () { + _this2.pushObject({ text: 'Globe' }); + _this2.removeAt(1); + _this2.insertAt(1, { text: ' ' }); + _this2.pushObject({ text: ' ' }); + _this2.pushObject({ text: 'World' }); + _this2.removeAt(2); + }); + + this.assertText('Hello Planet EarthGlobe World'); + + this.runTask(function () { + return _this2.replace(2, 4, { text: 'my' }); + }); + + this.assertText('Hello my World'); + + this.runTask(function () { + return _this2.clear(); + }); + + this.assertText('Empty'); + + this.replaceList([{ text: 'hello' }]); + + this.assertText('hello'); + }; + + SingleEachTest.prototype['@test it receives the index as the second parameter'] = function testItReceivesTheIndexAsTheSecondParameter() { + var _this3 = this; + + this.makeList([{ text: 'hello' }, { text: 'world' }]); + + this.render('{{#each list as |item index|}}[{{index}}. {{item.text}}]{{/each}}'); + + this.assertText('[0. hello][1. world]'); + + this.assertStableRerender(); + + this.runTask(function () { + return _this3.insertAt(1, { text: 'my' }); + }); + + this.assertText('[0. hello][1. my][2. world]'); + + this.replaceList([{ text: 'hello' }, { text: 'world' }]); + + this.assertText('[0. hello][1. world]'); + }; + + SingleEachTest.prototype['@test it accepts a string key'] = function testItAcceptsAStringKey() { + var _this4 = this; + + this.makeList([{ text: 'hello' }, { text: 'world' }]); + + this.render('{{#each list key=\'text\' as |item|}}{{item.text}}{{/each}}'); + + this.assertText('helloworld'); + + this.assertStableRerender(); + + this.runTask(function () { + return _this4.pushObject({ text: 'again' }); + }); + + this.assertText('helloworldagain'); + + this.replaceList([{ text: 'hello' }, { text: 'world' }]); + + this.assertText('helloworld'); + }; + + SingleEachTest.prototype['@test it accepts a numeric key'] = function testItAcceptsANumericKey() { + var _this5 = this; + + this.makeList([{ id: 1 }, { id: 2 }]); + + this.render('{{#each list key=\'id\' as |item|}}{{item.id}}{{/each}}'); + + this.assertText('12'); + + this.assertStableRerender(); + + this.runTask(function () { + return _this5.pushObject({ id: 3 }); + }); + + this.assertText('123'); + + this.replaceList([{ id: 1 }, { id: 2 }]); + + this.assertText('12'); + }; + + SingleEachTest.prototype['@test it can specify @index as the key'] = function testItCanSpecifyIndexAsTheKey() { + var _this6 = this; + + this.makeList([{ id: 1 }, { id: 2 }]); + + this.render('{{#each list key=\'@index\' as |item|}}{{item.id}}{{/each}}'); + + this.assertText('12'); + + this.assertStableRerender(); + + this.runTask(function () { + return _this6.pushObject({ id: 3 }); + }); + + this.assertText('123'); + + this.replaceList([{ id: 1 }, { id: 2 }]); + + this.assertText('12'); + }; + + SingleEachTest.prototype['@test it can specify @identity as the key for arrays of primitives'] = function testItCanSpecifyIdentityAsTheKeyForArraysOfPrimitives() { + var _this7 = this; + + this.makeList([1, 2]); + + this.render('{{#each list key=\'@identity\' as |item|}}{{item}}{{/each}}'); + + this.assertText('12'); + + this.assertStableRerender(); + + this.runTask(function () { + return _this7.pushObject(3); + }); + + this.assertText('123'); + + this.replaceList([1, 2]); + + this.assertText('12'); + }; + + SingleEachTest.prototype['@test it can specify @identity as the key for mixed arrays of objects and primitives'] = function testItCanSpecifyIdentityAsTheKeyForMixedArraysOfObjectsAndPrimitives() { + var _this8 = this; + + this.makeList([1, { id: 2 }, 3]); + + this.render('{{#each list key=\'@identity\' as |item|}}{{if item.id item.id item}}{{/each}}'); + + this.assertText('123'); + + this.assertStableRerender(); + + this.runTask(function () { + return _this8.insertAt(2, { id: 4 }); + }); + + this.assertText('1243'); + + this.replaceList([1, { id: 2 }, 3]); + + this.assertText('123'); + }; + + SingleEachTest.prototype['@test it can render duplicate primitive items'] = function testItCanRenderDuplicatePrimitiveItems() { + var _this9 = this; + + this.makeList(['a', 'a', 'a']); + + this.render('{{#each list as |item|}}{{item}}{{/each}}'); + + this.assertText('aaa'); + + this.assertStableRerender(); + + this.runTask(function () { + return _this9.pushObject('a'); + }); + + this.assertText('aaaa'); + + this.runTask(function () { + return _this9.pushObject('a'); + }); + + this.assertText('aaaaa'); + + this.replaceList(['a', 'a', 'a']); + + this.assertText('aaa'); + }; + + SingleEachTest.prototype['@test updating and setting within #each'] = function testUpdatingAndSettingWithinEach(assert) { + var _this10 = this; + + this.makeList([{ value: 1 }, { value: 2 }, { value: 3 }]); + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + this.isEven = true; + this.tagName = 'li'; + }, + + _isEven: function () { + this.set('isEven', this.get('item.value') % 2 === 0); + }, + + didUpdate: function () { + this._isEven(); + } + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: '{{#if isEven}}{{item.value}}{{/if}}' }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject)); + + this.assertText('Prev1NextPrev2NextPrev3Next'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this10.context.list.objectAt(0), 'value', 3); + }); + + this.assertText('PrevNextPrev2NextPrev3Next'); + + this.replaceList([{ value: 1 }, { value: 2 }, { value: 3 }]); + + this.assertText('Prev1NextPrev2NextPrev3Next'); + }; + + SingleEachTest.prototype['@test it can render duplicate objects'] = function testItCanRenderDuplicateObjects() { + var _this11 = this; + + var duplicateItem = { text: 'foo' }; + + this.makeList([duplicateItem, duplicateItem, { text: 'bar' }, { text: 'baz' }]); + + this.render('{{#each list as |item|}}{{item.text}}{{/each}}'); + + this.assertText('foofoobarbaz'); + + this.assertStableRerender(); + + this.runTask(function () { + return _this11.pushObject(duplicateItem); + }); + + this.assertText('foofoobarbazfoo'); + + this.runTask(function () { + return _this11.pushObject(duplicateItem); + }); + + this.assertText('foofoobarbazfoofoo'); + + this.replaceList([duplicateItem, duplicateItem, { text: 'bar' }, { text: 'baz' }]); + + this.assertText('foofoobarbaz'); + }; + + SingleEachTest.prototype['@test it maintains DOM stability when condition changes between objects with the same keys'] = function testItMaintainsDOMStabilityWhenConditionChangesBetweenObjectsWithTheSameKeys() { + var _this12 = this; + + this.makeList([{ text: 'Hello' }, { text: ' ' }, { text: 'world' }]); + + this.render('{{#each list key="text" as |item|}}{{item.text}}{{/each}}'); + + this.assertText('Hello world'); + + this.takeSnapshot(); + + this.runTask(function () { + _this12.popObject(); + _this12.popObject(); + _this12.pushObject({ text: ' ' }); + _this12.pushObject({ text: 'world' }); + }); + + this.assertText('Hello world'); + + this.assertInvariants(); + + this.replaceList([{ text: 'Hello' }, { text: ' ' }, { text: 'world' }]); + + this.assertText('Hello world'); + + this.assertInvariants(); + }; + + SingleEachTest.prototype['@test it maintains DOM stability for stable keys when list is updated'] = function testItMaintainsDOMStabilityForStableKeysWhenListIsUpdated() { + var _this13 = this; + + this.makeList([{ text: 'Hello' }, { text: ' ' }, { text: 'world' }]); + + this.render('{{#each list key="text" as |item|}}{{item.text}}{{/each}}'); + + this.assertText('Hello world'); + + this.assertStableRerender(); + + var oldSnapshot = this.takeSnapshot(); + + this.runTask(function () { + _this13.unshiftObject({ text: ', ' }); + _this13.unshiftObject({ text: 'Hi' }); + _this13.pushObject({ text: '!' }); + _this13.pushObject({ text: 'earth' }); + }); + + this.assertText('Hi, Hello world!earth'); + + this.assertPartialInvariants(2, 5); + + this.replaceList([{ text: 'Hello' }, { text: ' ' }, { text: 'world' }]); + + this.assertText('Hello world'); + + this.assertInvariants(oldSnapshot, this.takeSnapshot()); + }; + + SingleEachTest.prototype['@test it renders all items with duplicate key values'] = function testItRendersAllItemsWithDuplicateKeyValues() { + var _this14 = this; + + this.makeList([{ text: 'Hello' }, { text: 'Hello' }, { text: 'Hello' }]); + + this.render('{{#each list key="text" as |item|}}{{item.text}}{{/each}}'); + + this.assertText('HelloHelloHello'); + + this.runTask(function () { + _this14.forEach(function (hash) { + return _emberMetal.set(hash, 'text', 'Goodbye'); + }); + }); + + this.assertText('GoodbyeGoodbyeGoodbye'); + + this.replaceList([{ text: 'Hello' }, { text: 'Hello' }, { text: 'Hello' }]); + + this.assertText('HelloHelloHello'); + }; + + SingleEachTest.prototype['@test context is not changed to the inner scope inside an {{#each as}} block'] = function testContextIsNotChangedToTheInnerScopeInsideAnEachAsBlock() { + var _this15 = this; + + this.makeList([{ name: 'Chad' }, { name: 'Zack' }, { name: 'Asa' }]); + + this.render('{{name}}-{{#each list as |person|}}{{name}}{{/each}}-{{name}}', { + name: 'Joel' + }); + + this.assertText('Joel-JoelJoelJoel-Joel'); + + this.assertStableRerender(); + + this.runTask(function () { + return _this15.shiftObject(); + }); + + this.assertText('Joel-JoelJoel-Joel'); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'name', 'Godfrey'); + }); + + this.assertText('Godfrey-GodfreyGodfrey-Godfrey'); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'name', 'Joel'); + }); + this.replaceList([{ name: 'Chad' }, { name: 'Zack' }, { name: 'Asa' }]); + + this.assertText('Joel-JoelJoelJoel-Joel'); + }; + + SingleEachTest.prototype['@test can access the item and the original scope'] = function testCanAccessTheItemAndTheOriginalScope() { + var _this16 = this; + + this.makeList([{ name: 'Tom Dale' }, { name: 'Yehuda Katz' }, { name: 'Godfrey Chan' }]); + + this.render('{{#each list key="name" as |person|}}[{{title}}: {{person.name}}]{{/each}}', { + title: 'Señor Engineer' + }); + + this.assertText('[Señor Engineer: Tom Dale][Señor Engineer: Yehuda Katz][Señor Engineer: Godfrey Chan]'); + + this.runTask(function () { + return _this16.rerender(); + }); + + this.assertText('[Señor Engineer: Tom Dale][Señor Engineer: Yehuda Katz][Señor Engineer: Godfrey Chan]'); + + this.runTask(function () { + _emberMetal.set(_this16.objectAt(1), 'name', 'Stefan Penner'); + _this16.removeAt(0); + _this16.pushObject({ name: 'Tom Dale' }); + _this16.insertAt(1, { name: 'Chad Hietala' }); + _emberMetal.set(_this16.context, 'title', 'Principal Engineer'); + }); + + this.assertText('[Principal Engineer: Stefan Penner][Principal Engineer: Chad Hietala][Principal Engineer: Godfrey Chan][Principal Engineer: Tom Dale]'); + + this.runTask(function () { + return _emberMetal.set(_this16.context, 'title', 'Señor Engineer'); + }); + this.replaceList([{ name: 'Tom Dale' }, { name: 'Yehuda Katz' }, { name: 'Godfrey Chan' }]); + + this.assertText('[Señor Engineer: Tom Dale][Señor Engineer: Yehuda Katz][Señor Engineer: Godfrey Chan]'); + }; + + SingleEachTest.prototype['@test the scoped variable is not available outside the {{#each}} block.'] = function testTheScopedVariableIsNotAvailableOutsideTheEachBlock() { + var _this17 = this; + + this.makeList(['Yehuda']); + + this.render('{{name}}-{{#each list as |name|}}{{name}}{{/each}}-{{name}}', { + name: 'Stef' + }); + + this.assertText('Stef-Yehuda-Stef'); + + this.runTask(function () { + return _this17.rerender(); + }); + + this.assertText('Stef-Yehuda-Stef'); + + this.runTask(function () { + return _this17.pushObjects([' ', 'Katz']); + }); + + this.assertText('Stef-Yehuda Katz-Stef'); + + this.runTask(function () { + return _emberMetal.set(_this17.context, 'name', 'Tom'); + }); + + this.assertText('Tom-Yehuda Katz-Tom'); + + this.runTask(function () { + return _emberMetal.set(_this17.context, 'name', 'Stef'); + }); + this.replaceList(['Yehuda']); + + this.assertText('Stef-Yehuda-Stef'); + }; + + SingleEachTest.prototype['@test inverse template is displayed with context'] = function testInverseTemplateIsDisplayedWithContext() { + var _this18 = this; + + this.makeList([]); + + this.render('{{#each list as |thing|}}Has Thing{{else}}No Thing {{otherThing}}{{/each}}', { + otherThing: 'bar' + }); + + this.assertText('No Thing bar'); + + this.runTask(function () { + return _this18.rerender(); + }); + + this.assertText('No Thing bar'); + + this.runTask(function () { + return _emberMetal.set(_this18.context, 'otherThing', 'biz'); + }); + + this.assertText('No Thing biz'); + + this.runTask(function () { + return _this18.pushObject('non-empty'); + }); + + this.assertText('Has Thing'); + + this.runTask(function () { + return _emberMetal.set(_this18.context, 'otherThing', 'baz'); + }); + + this.assertText('Has Thing'); + + this.runTask(function () { + return _emberMetal.set(_this18.context, 'otherThing', 'bar'); + }); + this.replaceList([]); + + this.assertText('No Thing bar'); + }; + + SingleEachTest.prototype['@test content that are not initially present updates correctly GH#13983'] = function testContentThatAreNotInitiallyPresentUpdatesCorrectlyGH13983() { + var _this19 = this; + + // The root cause of this bug is that Glimmer did not call `didInitializeChildren` + // on the inserted `TryOpcode`, causing that `TryOpcode` to have an uninitialized + // tag. Currently the only way to observe this the "JUMP-IF-NOT-MODIFIED", i.e. by + // wrapping it in an component. + + this.registerComponent('x-wrapper', { template: '{{yield}}' }); + + this.makeList([]); + + this.render('{{#x-wrapper}}{{#each list as |obj|}}[{{obj.text}}]{{/each}}{{/x-wrapper}}'); + + this.assertText(''); + + this.runTask(function () { + return _this19.rerender(); + }); + + this.assertText(''); + + this.runTask(function () { + return _this19.pushObject({ text: 'foo' }); + }); + + this.assertText('[foo]'); + + this.runTask(function () { + return _emberMetal.set(_this19.objectAt(0), 'text', 'FOO'); + }); + + this.assertText('[FOO]'); + + this.runTask(function () { + return _this19.pushObject({ text: 'bar' }); + }); + + this.assertText('[FOO][bar]'); + + this.runTask(function () { + return _emberMetal.set(_this19.objectAt(1), 'text', 'BAR'); + }); + + this.assertText('[FOO][BAR]'); + + this.runTask(function () { + return _emberMetal.set(_this19.objectAt(1), 'text', 'baz'); + }); + + this.assertText('[FOO][baz]'); + + this.runTask(function () { + return _this19.replace(1, 1, [{ text: 'BAZ' }]); + }); + + this.assertText('[FOO][BAZ]'); + + this.replaceList([]); + + this.assertText(''); + }; + + return SingleEachTest; + })(AbstractEachTest); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#each}} with arrays', (function (_SingleEachTest) { +babelHelpers.inherits(_class5, _SingleEachTest); + + function _class5() { + _SingleEachTest.apply(this, arguments); + } + + _class5.prototype.makeList = function makeList(list) { + return this.list = this.delegate = _emberRuntime.A(list); + }; + + return _class5; + })(SingleEachTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#each}} with array-like objects', (function (_SingleEachTest2) { +babelHelpers.inherits(_class6, _SingleEachTest2); + + function _class6() { + _SingleEachTest2.apply(this, arguments); + } + + _class6.prototype.makeList = function makeList(list) { + return this.list = this.delegate = new ArrayLike(list); + }; + + return _class6; + })(SingleEachTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#each}} with array proxies, modifying itself', (function (_SingleEachTest3) { +babelHelpers.inherits(_class7, _SingleEachTest3); + + function _class7() { + _SingleEachTest3.apply(this, arguments); + } + + _class7.prototype.makeList = function makeList(list) { + return this.list = this.delegate = _emberRuntime.ArrayProxy.create({ content: _emberRuntime.A(list) }); + }; + + return _class7; + })(SingleEachTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#each}} with array proxies, replacing its content', (function (_SingleEachTest4) { +babelHelpers.inherits(_class8, _SingleEachTest4); + + function _class8() { + _SingleEachTest4.apply(this, arguments); + } + + _class8.prototype.makeList = function makeList(list) { + var content = this.delegate = _emberRuntime.A(list); + return this.list = _emberRuntime.ArrayProxy.create({ content: content }); + }; + + _class8.prototype.replaceList = function replaceList(list) { + var _this20 = this; + + this.runTask(function () { + return _this20.list.set('content', _emberRuntime.A(list)); + }); + }; + + return _class8; + })(SingleEachTest)); + + // TODO: Refactor the following tests so we can run them against different kind of arrays + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: Multiple {{#each as}} helpers', (function (_RenderingTest2) { +babelHelpers.inherits(_class9, _RenderingTest2); + + function _class9() { + _RenderingTest2.apply(this, arguments); + } + + _class9.prototype['@test re-using the same variable with different {{#each}} blocks does not override each other'] = function testReUsingTheSameVariableWithDifferentEachBlocksDoesNotOverrideEachOther() { + var _this21 = this; + + this.render('Admin: {{#each admins key="name" as |person|}}[{{person.name}}]{{/each}} User: {{#each users key="name" as |person|}}[{{person.name}}]{{/each}}', { + admins: _emberRuntime.A([{ name: 'Tom Dale' }]), + users: _emberRuntime.A([{ name: 'Yehuda Katz' }]) + }); + + this.assertText('Admin: [Tom Dale] User: [Yehuda Katz]'); + + this.runTask(function () { + return _this21.rerender(); + }); + + this.assertText('Admin: [Tom Dale] User: [Yehuda Katz]'); + + this.runTask(function () { + _emberMetal.get(_this21.context, 'admins').pushObject({ name: 'Godfrey Chan' }); + _emberMetal.set(_emberMetal.get(_this21.context, 'users').objectAt(0), 'name', 'Stefan Penner'); + }); + + this.assertText('Admin: [Tom Dale][Godfrey Chan] User: [Stefan Penner]'); + + this.runTask(function () { + _emberMetal.set(_this21.context, 'admins', [{ name: 'Tom Dale' }]); + _emberMetal.set(_this21.context, 'users', [{ name: 'Yehuda Katz' }]); + }); + + this.assertText('Admin: [Tom Dale] User: [Yehuda Katz]'); + }; + + _class9.prototype['@test an outer {{#each}}\'s scoped variable does not clobber an inner {{#each}}\'s property if they share the same name - Issue #1315'] = function testAnOuterEachSScopedVariableDoesNotClobberAnInnerEachSPropertyIfTheyShareTheSameNameIssue1315() { + var _this22 = this; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2), { + content: _emberRuntime.A(['X', 'Y']), + options: _emberRuntime.A([{ label: 'One', value: 1 }, { label: 'Two', value: 2 }]) + }); + + this.assertText('X-1:One2:TwoY-1:One2:Two'); + + this.assertStableRerender(); + + this.runTask(function () { + _emberMetal.get(_this22.context, 'content').pushObject('Z'); + _emberMetal.set(_emberMetal.get(_this22.context, 'options').objectAt(0), 'value', 0); + }); + + this.assertText('X-0:One2:TwoY-0:One2:TwoZ-0:One2:Two'); + + this.runTask(function () { + _emberMetal.set(_this22.context, 'content', ['X', 'Y']); + _emberMetal.set(_this22.context, 'options', [{ label: 'One', value: 1 }, { label: 'Two', value: 2 }]); + }); + + this.assertText('X-1:One2:TwoY-1:One2:Two'); + }; + + _class9.prototype['@test the scoped variable is not available outside the {{#each}} block'] = function testTheScopedVariableIsNotAvailableOutsideTheEachBlock() { + var _this23 = this; + + this.render('{{ring}}-{{#each first as |ring|}}{{ring}}-{{#each fifth as |ring|}}{{ring}}-{{#each ninth as |ring|}}{{ring}}-{{/each}}{{ring}}-{{/each}}{{ring}}-{{/each}}{{ring}}', { + ring: 'Greed', + first: _emberRuntime.A(['Limbo']), + fifth: _emberRuntime.A(['Wrath']), + ninth: _emberRuntime.A(['Treachery']) + }); + + this.assertText('Greed-Limbo-Wrath-Treachery-Wrath-Limbo-Greed'); + + this.runTask(function () { + return _this23.rerender(); + }); + + this.assertText('Greed-Limbo-Wrath-Treachery-Wrath-Limbo-Greed'); + + this.runTask(function () { + _emberMetal.set(_this23.context, 'ring', 'O'); + _emberMetal.get(_this23.context, 'fifth').insertAt(0, 'D'); + }); + + this.assertText('O-Limbo-D-Treachery-D-Wrath-Treachery-Wrath-Limbo-O'); + + this.runTask(function () { + _emberMetal.get(_this23.context, 'first').pushObject('I'); + _emberMetal.get(_this23.context, 'ninth').replace(0, 1, 'K'); + }); + + this.assertText('O-Limbo-D-K-D-Wrath-K-Wrath-Limbo-I-D-K-D-Wrath-K-Wrath-I-O'); + + this.runTask(function () { + _emberMetal.set(_this23.context, 'ring', 'Greed'); + _emberMetal.set(_this23.context, 'first', ['Limbo']); + _emberMetal.set(_this23.context, 'fifth', ['Wrath']); + _emberMetal.set(_this23.context, 'ninth', ['Treachery']); + }); + + this.assertText('Greed-Limbo-Wrath-Treachery-Wrath-Limbo-Greed'); + }; + + _class9.prototype['@test it should support {{#each name as |foo|}}, then {{#each foo as |bar|}}'] = function testItShouldSupportEachNameAsFooThenEachFooAsBar() { + var _this24 = this; + + this.render('{{#each name key="@index" as |foo|}}{{#each foo as |bar|}}{{bar}}{{/each}}{{/each}}', { + name: _emberRuntime.A([_emberRuntime.A(['caterpillar'])]) + }); + + this.assertText('caterpillar'); + + this.runTask(function () { + return _this24.rerender(); + }); + + this.assertText('caterpillar'); + + this.runTask(function () { + var name = _emberMetal.get(_this24.context, 'name'); + name.objectAt(0).replace(0, 1, 'lady'); + name.pushObject(['bird']); + }); + + this.assertText('ladybird'); + + this.runTask(function () { + return _emberMetal.set(_this24.context, 'name', [['caterpillar']]); + }); + + this.assertText('caterpillar'); + }; + + return _class9; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#each as}} undefined path', (function (_RenderingTest3) { +babelHelpers.inherits(_class10, _RenderingTest3); + + function _class10() { + _RenderingTest3.apply(this, arguments); + } + + _class10.prototype['@test keying off of `undefined` does not render'] = function testKeyingOffOfUndefinedDoesNotRender(assert) { + var _this25 = this; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject3), { foo: {} }); + + this.assertText(''); + + this.runTask(function () { + return _this25.rerender(); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this25.context, 'foo', { bar: { baz: ['Here!'] } }); + }); + + this.assertText('Here!'); + + this.runTask(function () { + return _emberMetal.set(_this25.context, 'foo', {}); + }); + + this.assertText(''); + }; + + return _class10; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + /* globals MutationObserver: false */ + if (typeof MutationObserver === 'function') { + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#each as}} DOM mutation test', (function (_RenderingTest4) { +babelHelpers.inherits(_class11, _RenderingTest4); + + function _class11() { + _RenderingTest4.call(this); + this.observer = null; + } + + _class11.prototype.observe = function observe(element) { + var observer = this.observer = new MutationObserver(function () {}); + observer.observe(element, { childList: true, characterData: true }); + }; + + _class11.prototype.teardown = function teardown() { + if (this.observer) { + this.observer.disconnect(); + } + + _RenderingTest4.prototype.teardown.call(this); + }; + + _class11.prototype.assertNoMutation = function assertNoMutation() { + this.assert.deepEqual(this.observer.takeRecords(), [], 'Expected no mutations'); + }; + + _class11.prototype.expectMutations = function expectMutations() { + this.assert.ok(this.observer.takeRecords().length > 0, 'Expected some mutations'); + }; + + _class11.prototype['@test {{#each}} should not mutate a subtree when the array has not changed [GH #14332]'] = function testEachShouldNotMutateASubtreeWhenTheArrayHasNotChangedGH14332(assert) { + var _this26 = this; + + var page = { title: 'Blog Posts' }; + + var model = [{ title: 'Rails is omakase' }, { title: 'Ember is omakase' }]; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4), { page: page, model: model }); + + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5)); + + this.observe(this.$('#posts')[0]); + + // MutationObserver is async + return _emberRuntime.RSVP.Promise.resolve(function () { + _this26.assertStableRerender(); + }).then(function () { + _this26.assertNoMutation(); + + _this26.runTask(function () { + return _emberMetal.set(_this26.context, 'page', { title: 'Essays' }); + }); + + _this26.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject6)); + }).then(function () { + _this26.assertNoMutation(); + + _this26.runTask(function () { + return _emberMetal.set(_this26.context.page, 'title', 'Think Pieces™'); + }); + + _this26.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject7)); + }).then(function () { + // The last set is localized to the `page` object, so we do not expect Glimmer + // to re-iterate the list + _this26.assertNoMutation(); + }); + }; + + return _class11; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + } +}); +enifed('ember-glimmer/tests/integration/syntax/each-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/syntax'); + test('ember-glimmer/tests/integration/syntax/each-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/syntax/each-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/syntax/each-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/syntax'); + QUnit.test('ember-glimmer/tests/integration/syntax/each-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/syntax/each-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/syntax/if-unless-test', ['exports', 'ember-glimmer/tests/utils/helpers', 'ember-runtime', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/shared-conditional-tests'], function (exports, _emberGlimmerTestsUtilsHelpers, _emberRuntime, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsSharedConditionalTests) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if cond}}\n {{#each numbers as |number|}}\n {{foo-bar number=number}}\n {{/each}}\n {{else}}\n Nothing Here!\n {{/if}}'], ['\n {{#if cond}}\n {{#each numbers as |number|}}\n {{foo-bar number=number}}\n {{/each}}\n {{else}}\n Nothing Here!\n {{/if}}']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if foo.bar.baz}}\n Here!\n {{else}}\n Nothing Here!\n {{/if}}'], ['\n {{#if foo.bar.baz}}\n Here!\n {{else}}\n Nothing Here!\n {{/if}}']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#if}} with inverse', (function (_IfUnlessWithSyntaxTest) { +babelHelpers.inherits(_class, _IfUnlessWithSyntaxTest); + + function _class() { + _IfUnlessWithSyntaxTest.apply(this, arguments); + } + + _class.prototype.templateFor = function templateFor(_ref) { + var cond = _ref.cond; + var truthy = _ref.truthy; + var falsy = _ref.falsy; + + return '{{#if ' + cond + '}}' + truthy + '{{else}}' + falsy + '{{/if}}'; + }; + + return _class; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessWithSyntaxTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#unless}} with inverse', (function (_IfUnlessWithSyntaxTest2) { +babelHelpers.inherits(_class2, _IfUnlessWithSyntaxTest2); + + function _class2() { + _IfUnlessWithSyntaxTest2.apply(this, arguments); + } + + _class2.prototype.templateFor = function templateFor(_ref2) { + var cond = _ref2.cond; + var truthy = _ref2.truthy; + var falsy = _ref2.falsy; + + return '{{#unless ' + cond + '}}' + falsy + '{{else}}' + truthy + '{{/unless}}'; + }; + + return _class2; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessWithSyntaxTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#if}} and {{#unless}} without inverse', (function (_IfUnlessWithSyntaxTest3) { +babelHelpers.inherits(_class3, _IfUnlessWithSyntaxTest3); + + function _class3() { + _IfUnlessWithSyntaxTest3.apply(this, arguments); + } + + _class3.prototype.templateFor = function templateFor(_ref3) { + var cond = _ref3.cond; + var truthy = _ref3.truthy; + var falsy = _ref3.falsy; + + return '{{#if ' + cond + '}}' + truthy + '{{/if}}{{#unless ' + cond + '}}' + falsy + '{{/unless}}'; + }; + + return _class3; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessWithSyntaxTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#if}}', (function (_RenderingTest) { +babelHelpers.inherits(_class4, _RenderingTest); + + function _class4() { + _RenderingTest.apply(this, arguments); + } + + _class4.prototype['@test using `if` with an `{{each}}` destroys components when transitioning to and from inverse (GH #12267)'] = function testUsingIfWithAnEachDestroysComponentsWhenTransitioningToAndFromInverseGH12267(assert) { + var _this = this; + + var destroyedChildrenCount = 0; + + this.registerComponent('foo-bar', { + template: '{{number}}', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + willDestroy: function () { + this._super(); + destroyedChildrenCount++; + } + }) + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { cond: true, numbers: _emberRuntime.A([1, 2, 3]) }); + + this.assertText('123'); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertText('123'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'cond', false); + }); + + this.assertText('Nothing Here!'); + assert.equal(destroyedChildrenCount, 3, 'the children were properly destroyed'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'cond', true); + }); + + this.assertText('123'); + }; + + _class4.prototype['@test looking up `undefined` property defaults to false'] = function testLookingUpUndefinedPropertyDefaultsToFalse(assert) { + var _this2 = this; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2), { foo: {} }); + + this.assertText('Nothing Here!'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertText('Nothing Here!'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'foo', { bar: { baz: true } }); + }); + + this.assertText('Here!'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'foo', {}); + }); + + this.assertText('Nothing Here!'); + }; + + return _class4; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/syntax/if-unless-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/syntax'); + test('ember-glimmer/tests/integration/syntax/if-unless-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/syntax/if-unless-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/syntax/if-unless-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/syntax'); + QUnit.test('ember-glimmer/tests/integration/syntax/if-unless-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/syntax/if-unless-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/syntax/in-element-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/test-helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/component', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsTestHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerComponent, _emberMetal) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{#-in-element someElement}}\n {{text}}\n {{/-in-element}}\n '], ['\n {{#-in-element someElement}}\n {{text}}\n {{/-in-element}}\n ']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#if showModal}}\n {{#-in-element someElement}}\n {{modal-display text=text}}\n {{/-in-element}}\n {{/if}}\n '], ['\n {{#if showModal}}\n {{#-in-element someElement}}\n {{modal-display text=text}}\n {{/-in-element}}\n {{/if}}\n ']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('{{-in-element}}', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test allows rendering into an external element'] = function testAllowsRenderingIntoAnExternalElement(assert) { + var _this = this; + + var someElement = document.createElement('div'); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { + someElement: someElement, + text: 'Whoop!' + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.element, ''); + _emberGlimmerTestsUtilsTestHelpers.equalTokens(someElement, 'Whoop!'); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'text', 'Huzzah!!'); + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.element, ''); + _emberGlimmerTestsUtilsTestHelpers.equalTokens(someElement, 'Huzzah!!'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'text', 'Whoop!'); + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.element, ''); + _emberGlimmerTestsUtilsTestHelpers.equalTokens(someElement, 'Whoop!'); + }; + + _class.prototype['@test components are cleaned up properly'] = function testComponentsAreCleanedUpProperly(assert) { + var _this2 = this; + + var hooks = []; + + var someElement = document.createElement('div'); + + this.registerComponent('modal-display', { + ComponentClass: _emberGlimmerComponent.default.extend({ + didInsertElement: function () { + hooks.push('didInsertElement'); + }, + + willDestroyElement: function () { + hooks.push('willDestroyElement'); + } + }), + + template: '{{text}}' + }); + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2), { + someElement: someElement, + text: 'Whoop!', + showModal: false + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.element, ''); + _emberGlimmerTestsUtilsTestHelpers.equalTokens(someElement, ''); + + this.assertStableRerender(); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'showModal', true); + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.element, ''); + this.assertComponentElement(someElement.firstChild, { content: 'Whoop!' }); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'text', 'Huzzah!'); + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.element, ''); + this.assertComponentElement(someElement.firstChild, { content: 'Huzzah!' }); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'text', 'Whoop!'); + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.element, ''); + this.assertComponentElement(someElement.firstChild, { content: 'Whoop!' }); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'showModal', false); + }); + + _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.element, ''); + _emberGlimmerTestsUtilsTestHelpers.equalTokens(someElement, ''); + + assert.deepEqual(hooks, ['didInsertElement', 'willDestroyElement']); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/syntax/in-element-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/syntax'); + test('ember-glimmer/tests/integration/syntax/in-element-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/syntax/in-element-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/syntax/in-element-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/syntax'); + QUnit.test('ember-glimmer/tests/integration/syntax/in-element-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/syntax/in-element-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/syntax/with-dynamic-var-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{#-with-dynamic-vars foo="bar"}}\n {{-get-dynamic-var \'foo\'}}\n {{/-with-dynamic-vars}}\n '], ['\n {{#-with-dynamic-vars foo="bar"}}\n {{-get-dynamic-var \'foo\'}}\n {{/-with-dynamic-vars}}\n ']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#-with-dynamic-vars outletState="bar"}}\n {{-get-dynamic-var \'outletState\'}}\n {{/-with-dynamic-vars}}\n '], ['\n {{#-with-dynamic-vars outletState="bar"}}\n {{-get-dynamic-var \'outletState\'}}\n {{/-with-dynamic-vars}}\n ']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('{{-with-dynamic-var}}', (function (_RenderingTest) { +babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test does not allow setting values other than outletState'] = function testDoesNotAllowSettingValuesOtherThanOutletState(assert) { + var _this = this; + + expectAssertion(function () { + _this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject)); + }, /Using `-with-dynamic-scope` is only supported for `outletState` \(you used `foo`\)./); + }; + + _class.prototype['@test allows setting/getting outletState'] = function testAllowsSettingGettingOutletState(assert) { + // this is simply asserting that we can write and read outletState + // the actual value being used here is not what is used in real life + // feel free to change the value being set and asserted as needed + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2)); + + this.assertText('bar'); + }; + + _class.prototype['@test does not allow setting values other than outletState'] = function testDoesNotAllowSettingValuesOtherThanOutletState(assert) { + var _this2 = this; + + expectAssertion(function () { + _this2.render('{{-get-dynamic-var \'foo\'}}'); + }, /Using `-get-dynamic-scope` is only supported for `outletState` \(you used `foo`\)./); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/syntax/with-dynamic-var-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/syntax'); + test('ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/syntax/with-dynamic-var-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/syntax'); + QUnit.test('ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/integration/syntax/with-test', ['exports', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/shared-conditional-tests', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberMetal, _emberRuntime, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsSharedConditionalTests, _emberGlimmerTestsUtilsAbstractTestCase) { + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with foo.bar.baz as |thing|}}\n {{thing}}\n {{/with}}'], ['\n {{#with foo.bar.baz as |thing|}}\n {{thing}}\n {{/with}}']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n {{name}}\n {{#with committer1.name as |name|}}\n [{{name}}\n {{#with committer2.name as |name|}}\n [{{name}}]\n {{/with}}\n {{name}}]\n {{/with}}\n {{name}}\n {{#with committer2.name as |name|}}\n [{{name}}\n {{#with committer1.name as |name|}}\n [{{name}}]\n {{/with}}\n {{name}}]\n {{/with}}\n {{name}}\n '], ['\n {{name}}\n {{#with committer1.name as |name|}}\n [{{name}}\n {{#with committer2.name as |name|}}\n [{{name}}]\n {{/with}}\n {{name}}]\n {{/with}}\n {{name}}\n {{#with committer2.name as |name|}}\n [{{name}}\n {{#with committer1.name as |name|}}\n [{{name}}]\n {{/with}}\n {{name}}]\n {{/with}}\n {{name}}\n ']); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#with}}', (function (_IfUnlessWithSyntaxTest) { +babelHelpers.inherits(_class, _IfUnlessWithSyntaxTest); + + function _class() { + _IfUnlessWithSyntaxTest.apply(this, arguments); + } + + _class.prototype.templateFor = function templateFor(_ref) { + var cond = _ref.cond; + var truthy = _ref.truthy; + var falsy = _ref.falsy; + + return '{{#with ' + cond + '}}' + truthy + '{{else}}' + falsy + '{{/with}}'; + }; + + return _class; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessWithSyntaxTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#with as}}', (function (_IfUnlessWithSyntaxTest2) { +babelHelpers.inherits(_class2, _IfUnlessWithSyntaxTest2); + + function _class2() { + _IfUnlessWithSyntaxTest2.apply(this, arguments); + } + + _class2.prototype.templateFor = function templateFor(_ref2) { + var cond = _ref2.cond; + var truthy = _ref2.truthy; + var falsy = _ref2.falsy; + + return '{{#with ' + cond + ' as |test|}}' + truthy + '{{else}}' + falsy + '{{/with}}'; + }; + + _class2.prototype['@test keying off of `undefined` does not render'] = function testKeyingOffOfUndefinedDoesNotRender(assert) { + var _this = this; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject), { foo: {} }); + + this.assertText(''); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'foo', { bar: { baz: 'Here!' } }); + }); + + this.assertText('Here!'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'foo', {}); + }); + + this.assertText(''); + }; + + _class2.prototype['@test it renders and hides the given block based on the conditional'] = function testItRendersAndHidesTheGivenBlockBasedOnTheConditional() { + var _this2 = this; + + this.render('{{#with cond1 as |cond|}}{{cond.greeting}}{{else}}False{{/with}}', { + cond1: { greeting: 'Hello' } + }); + + this.assertText('Hello'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertText('Hello'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'cond1.greeting', 'Hello world'); + }); + + this.assertText('Hello world'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'cond1', false); + }); + + this.assertText('False'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'cond1', { greeting: 'Hello' }); + }); + + this.assertText('Hello'); + }; + + _class2.prototype['@test can access alias and original scope'] = function testCanAccessAliasAndOriginalScope() { + var _this3 = this; + + this.render('{{#with person as |tom|}}{{title}}: {{tom.name}}{{/with}}', { + title: 'Señor Engineer', + person: { name: 'Tom Dale' } + }); + + this.assertText('Señor Engineer: Tom Dale'); + + this.runTask(function () { + return _this3.rerender(); + }); + + this.assertText('Señor Engineer: Tom Dale'); + + this.runTask(function () { + _emberMetal.set(_this3.context, 'person.name', 'Yehuda Katz'); + _emberMetal.set(_this3.context, 'title', 'Principal Engineer'); + }); + + this.assertText('Principal Engineer: Yehuda Katz'); + + this.runTask(function () { + _emberMetal.set(_this3.context, 'person', { name: 'Tom Dale' }); + _emberMetal.set(_this3.context, 'title', 'Señor Engineer'); + }); + + this.assertText('Señor Engineer: Tom Dale'); + }; + + _class2.prototype['@test the scoped variable is not available outside the {{#with}} block.'] = function testTheScopedVariableIsNotAvailableOutsideTheWithBlock() { + var _this4 = this; + + this.render('{{name}}-{{#with other as |name|}}{{name}}{{/with}}-{{name}}', { + name: 'Stef', + other: 'Yehuda' + }); + + this.assertText('Stef-Yehuda-Stef'); + + this.runTask(function () { + return _this4.rerender(); + }); + + this.assertText('Stef-Yehuda-Stef'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'other', 'Chad'); + }); + + this.assertText('Stef-Chad-Stef'); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'name', 'Tom'); + }); + + this.assertText('Tom-Chad-Tom'); + + this.runTask(function () { + _emberMetal.set(_this4.context, 'name', 'Stef'); + _emberMetal.set(_this4.context, 'other', 'Yehuda'); + }); + + this.assertText('Stef-Yehuda-Stef'); + }; + + _class2.prototype['@test inverse template is displayed with context'] = function testInverseTemplateIsDisplayedWithContext() { + var _this5 = this; + + this.render('{{#with falsyThing as |thing|}}Has Thing{{else}}No Thing {{otherThing}}{{/with}}', { + falsyThing: null, + otherThing: 'bar' + }); + + this.assertText('No Thing bar'); + + this.runTask(function () { + return _this5.rerender(); + }); + + this.assertText('No Thing bar'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'otherThing', 'biz'); + }); + + this.assertText('No Thing biz'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'falsyThing', true); + }); + + this.assertText('Has Thing'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'otherThing', 'baz'); + }); + + this.assertText('Has Thing'); + + this.runTask(function () { + _emberMetal.set(_this5.context, 'otherThing', 'bar'); + _emberMetal.set(_this5.context, 'falsyThing', null); + }); + + this.assertText('No Thing bar'); + }; + + _class2.prototype['@test can access alias of a proxy'] = function testCanAccessAliasOfAProxy() { + var _this6 = this; + + this.render('{{#with proxy as |person|}}{{person.name}}{{/with}}', { + proxy: _emberRuntime.ObjectProxy.create({ content: { name: 'Tom Dale' } }) + }); + + this.assertText('Tom Dale'); + + this.runTask(function () { + return _this6.rerender(); + }); + + this.assertText('Tom Dale'); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'proxy.name', 'Yehuda Katz'); + }); + + this.assertText('Yehuda Katz'); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'proxy.content', { name: 'Godfrey Chan' }); + }); + + this.assertText('Godfrey Chan'); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'proxy.content.name', 'Stefan Penner'); + }); + + this.assertText('Stefan Penner'); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'proxy.content', null); + }); + + this.assertText(''); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'proxy', _emberRuntime.ObjectProxy.create({ content: { name: 'Tom Dale' } })); + }); + + this.assertText('Tom Dale'); + }; + + _class2.prototype['@test can access alias of an array'] = function testCanAccessAliasOfAnArray() { + var _this7 = this; + + this.render('{{#with arrayThing as |words|}}{{#each words as |word|}}{{word}}{{/each}}{{/with}}', { + arrayThing: _emberRuntime.A(['Hello', ' ', 'world']) + }); + + this.assertText('Hello world'); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertText('Hello world'); + + this.runTask(function () { + var array = _emberMetal.get(_this7.context, 'arrayThing'); + array.replace(0, 1, 'Goodbye'); + _emberRuntime.removeAt(array, 1); + array.insertAt(1, ', '); + array.pushObject('!'); + }); + + this.assertText('Goodbye, world!'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'arrayThing', ['Hello', ' ', 'world']); + }); + + this.assertText('Hello world'); + }; + + _class2.prototype['@test `attrs` can be used as a block param [GH#14678]'] = function testAttrsCanBeUsedAsABlockParamGH14678() { + var _this8 = this; + + this.render('{{#with hash as |attrs|}}[{{hash.foo}}-{{attrs.foo}}]{{/with}}', { + hash: { foo: 'foo' } + }); + + this.assertText('[foo-foo]'); + + this.runTask(function () { + return _this8.rerender(); + }); + + this.assertText('[foo-foo]'); + + this.runTask(function () { + return _this8.context.set('hash.foo', 'FOO'); + }); + + this.assertText('[FOO-FOO]'); + + this.runTask(function () { + return _this8.context.set('hash.foo', 'foo'); + }); + + this.assertText('[foo-foo]'); + }; + + return _class2; + })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessWithSyntaxTest)); + + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: Multiple {{#with as}} helpers', (function (_RenderingTest) { +babelHelpers.inherits(_class3, _RenderingTest); + + function _class3() { + _RenderingTest.apply(this, arguments); + } + + _class3.prototype['@test re-using the same variable with different {{#with}} blocks does not override each other'] = function testReUsingTheSameVariableWithDifferentWithBlocksDoesNotOverrideEachOther() { + var _this9 = this; + + this.render('Admin: {{#with admin as |person|}}{{person.name}}{{/with}} User: {{#with user as |person|}}{{person.name}}{{/with}}', { + admin: { name: 'Tom Dale' }, + user: { name: 'Yehuda Katz' } + }); + + this.assertText('Admin: Tom Dale User: Yehuda Katz'); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertText('Admin: Tom Dale User: Yehuda Katz'); + + this.runTask(function () { + _emberMetal.set(_this9.context, 'admin.name', 'Godfrey Chan'); + _emberMetal.set(_this9.context, 'user.name', 'Stefan Penner'); + }); + + this.assertText('Admin: Godfrey Chan User: Stefan Penner'); + + this.runTask(function () { + _emberMetal.set(_this9.context, 'admin', { name: 'Tom Dale' }); + _emberMetal.set(_this9.context, 'user', { name: 'Yehuda Katz' }); + }); + + this.assertText('Admin: Tom Dale User: Yehuda Katz'); + }; + + _class3.prototype['@test the scoped variable is not available outside the {{#with}} block'] = function testTheScopedVariableIsNotAvailableOutsideTheWithBlock() { + var _this10 = this; + + this.render('{{ring}}-{{#with first as |ring|}}{{ring}}-{{#with fifth as |ring|}}{{ring}}-{{#with ninth as |ring|}}{{ring}}-{{/with}}{{ring}}-{{/with}}{{ring}}-{{/with}}{{ring}}', { + ring: 'Greed', + first: 'Limbo', + fifth: 'Wrath', + ninth: 'Treachery' + }); + + this.assertText('Greed-Limbo-Wrath-Treachery-Wrath-Limbo-Greed'); + + this.runTask(function () { + return _this10.rerender(); + }); + + this.assertText('Greed-Limbo-Wrath-Treachery-Wrath-Limbo-Greed'); + + this.runTask(function () { + _emberMetal.set(_this10.context, 'ring', 'O'); + _emberMetal.set(_this10.context, 'fifth', 'D'); + }); + + this.assertText('O-Limbo-D-Treachery-D-Limbo-O'); + + this.runTask(function () { + _emberMetal.set(_this10.context, 'first', 'I'); + _emberMetal.set(_this10.context, 'ninth', 'K'); + }); + + this.assertText('O-I-D-K-D-I-O'); + + this.runTask(function () { + _emberMetal.set(_this10.context, 'ring', 'Greed'); + _emberMetal.set(_this10.context, 'first', 'Limbo'); + _emberMetal.set(_this10.context, 'fifth', 'Wrath'); + _emberMetal.set(_this10.context, 'ninth', 'Treachery'); + }); + + this.assertText('Greed-Limbo-Wrath-Treachery-Wrath-Limbo-Greed'); + }; + + _class3.prototype['@test it should support {{#with name as |foo|}}, then {{#with foo as |bar|}}'] = function testItShouldSupportWithNameAsFooThenWithFooAsBar() { + var _this11 = this; + + this.render('{{#with name as |foo|}}{{#with foo as |bar|}}{{bar}}{{/with}}{{/with}}', { + name: 'caterpillar' + }); + + this.assertText('caterpillar'); + + this.runTask(function () { + return _this11.rerender(); + }); + + this.assertText('caterpillar'); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'name', 'butterfly'); + }); + + this.assertText('butterfly'); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'name', 'caterpillar'); + }); + + this.assertText('caterpillar'); + }; + + _class3.prototype['@test updating the context should update the alias'] = function testUpdatingTheContextShouldUpdateTheAlias() { + var _this12 = this; + + this.render('{{#with this as |person|}}{{person.name}}{{/with}}', { + name: 'Los Pivots' + }); + + this.assertText('Los Pivots'); + + this.runTask(function () { + return _this12.rerender(); + }); + + this.assertText('Los Pivots'); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'name', 'l\'Pivots'); + }); + + this.assertText('l\'Pivots'); + + this.runTask(function () { + return _emberMetal.set(_this12.context, 'name', 'Los Pivots'); + }); + + this.assertText('Los Pivots'); + }; + + _class3.prototype['@test nested {{#with}} blocks should have access to root context'] = function testNestedWithBlocksShouldHaveAccessToRootContext() { + var _this13 = this; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject2), { + name: 'ebryn', + committer1: { name: 'trek' }, + committer2: { name: 'machty' } + }); + + this.assertText('ebryn[trek[machty]trek]ebryn[machty[trek]machty]ebryn'); + + this.runTask(function () { + return _this13.rerender(); + }); + + this.assertText('ebryn[trek[machty]trek]ebryn[machty[trek]machty]ebryn'); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'name', 'chancancode'); + }); + + this.assertText('chancancode[trek[machty]trek]chancancode[machty[trek]machty]chancancode'); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'committer1', { name: 'krisselden' }); + }); + + this.assertText('chancancode[krisselden[machty]krisselden]chancancode[machty[krisselden]machty]chancancode'); + + this.runTask(function () { + _emberMetal.set(_this13.context, 'committer1.name', 'wycats'); + _emberMetal.set(_this13.context, 'committer2', { name: 'rwjblue' }); + }); + + this.assertText('chancancode[wycats[rwjblue]wycats]chancancode[rwjblue[wycats]rwjblue]chancancode'); + + this.runTask(function () { + _emberMetal.set(_this13.context, 'name', 'ebryn'); + _emberMetal.set(_this13.context, 'committer1', { name: 'trek' }); + _emberMetal.set(_this13.context, 'committer2', { name: 'machty' }); + }); + + this.assertText('ebryn[trek[machty]trek]ebryn[machty[trek]machty]ebryn'); + }; + + return _class3; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/integration/syntax/with-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/integration/syntax'); + test('ember-glimmer/tests/integration/syntax/with-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/integration/syntax/with-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/integration/syntax/with-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/integration/syntax'); + QUnit.test('ember-glimmer/tests/integration/syntax/with-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/integration/syntax/with-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/unit/layout-cache-test', ['exports', 'ember-utils', 'ember-glimmer/tests/utils/test-case', 'glimmer-runtime'], function (exports, _emberUtils, _emberGlimmerTestsUtilsTestCase, _glimmerRuntime) { + 'use strict'; + + var Counter = (function () { + function Counter() { + this.reset(); + } + + Counter.prototype.increment = function increment(key) { + this.total++; + return this.counts[key] = (this.counts[key] || 0) + 1; + }; + + Counter.prototype.get = function get(key) { + return this.counts[key] || 0; + }; + + Counter.prototype.reset = function reset() { + this.total = 0; + this.counts = new _emberUtils.EmptyObject(); + }; + + return Counter; + })(); + + var COUNTER = new Counter(); + + var BasicCompiler = (function () { + function BasicCompiler(template) { + this.template = template; + } + + BasicCompiler.prototype.compile = function compile(builder) { + var template = this.template; + + COUNTER.increment(this.constructor.id + '+' + template.id); + builder.wrapLayout(template.asLayout()); + }; + + return BasicCompiler; + })(); + + var TypeOneCompiler = (function (_BasicCompiler) { + babelHelpers.inherits(TypeOneCompiler, _BasicCompiler); + + function TypeOneCompiler() { + _BasicCompiler.apply(this, arguments); + } + + return TypeOneCompiler; + })(BasicCompiler); + + var TypeTwoCompiler = (function (_BasicCompiler2) { + babelHelpers.inherits(TypeTwoCompiler, _BasicCompiler2); + + function TypeTwoCompiler() { + _BasicCompiler2.apply(this, arguments); + } + + return TypeTwoCompiler; + })(BasicCompiler); + + TypeOneCompiler.id = 'type-one'; + TypeTwoCompiler.id = 'type-two'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Layout cache test', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.call(this); + COUNTER.reset(); + } + + _class.prototype.templateFor = function templateFor(content) { + var Factory = this.compile(content); + return this.env.getTemplate(Factory, this.owner); + }; + + _class.prototype['@test each template is only compiled once'] = function testEachTemplateIsOnlyCompiledOnce(assert) { + var env = this.env; + + var template1 = this.templateFor('Hello world!'); + var template2 = this.templateFor('{{foo}} {{bar}}'); + + assert.ok(env.getCompiledBlock(TypeOneCompiler, template1) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.strictEqual(COUNTER.get('type-one+' + template1.id), 1); + assert.strictEqual(COUNTER.get('type-one+' + template2.id), 0); + assert.strictEqual(COUNTER.total, 1); + + assert.ok(env.getCompiledBlock(TypeOneCompiler, template1) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.strictEqual(COUNTER.get('type-one+' + template1.id), 1); + assert.strictEqual(COUNTER.get('type-one+' + template2.id), 0); + assert.strictEqual(COUNTER.total, 1); + + assert.ok(env.getCompiledBlock(TypeOneCompiler, template2) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.strictEqual(COUNTER.get('type-one+' + template1.id), 1); + assert.strictEqual(COUNTER.get('type-one+' + template2.id), 1); + assert.strictEqual(COUNTER.total, 2); + + assert.ok(env.getCompiledBlock(TypeOneCompiler, template1) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeOneCompiler, template1) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeOneCompiler, template2) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeOneCompiler, template1) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeOneCompiler, template1) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeOneCompiler, template1) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeOneCompiler, template2) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeOneCompiler, template2) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + + assert.strictEqual(COUNTER.get('type-one+' + template1.id), 1); + assert.strictEqual(COUNTER.get('type-one+' + template2.id), 1); + assert.strictEqual(COUNTER.total, 2); + }; + + _class.prototype['@test each template/compiler pair is treated as unique'] = function testEachTemplateCompilerPairIsTreatedAsUnique(assert) { + var env = this.env; + + var template = this.templateFor('Hello world!'); + + assert.ok(env.getCompiledBlock(TypeOneCompiler, template) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.strictEqual(COUNTER.get('type-one+' + template.id), 1); + assert.strictEqual(COUNTER.get('type-two+' + template.id), 0); + assert.strictEqual(COUNTER.total, 1); + + assert.ok(env.getCompiledBlock(TypeOneCompiler, template) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.strictEqual(COUNTER.get('type-one+' + template.id), 1); + assert.strictEqual(COUNTER.get('type-two+' + template.id), 0); + assert.strictEqual(COUNTER.total, 1); + + assert.ok(env.getCompiledBlock(TypeTwoCompiler, template) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.strictEqual(COUNTER.get('type-one+' + template.id), 1); + assert.strictEqual(COUNTER.get('type-two+' + template.id), 1); + assert.strictEqual(COUNTER.total, 2); + + assert.ok(env.getCompiledBlock(TypeOneCompiler, template) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeOneCompiler, template) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeTwoCompiler, template) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeOneCompiler, template) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeOneCompiler, template) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeOneCompiler, template) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeTwoCompiler, template) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeTwoCompiler, template) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + + assert.strictEqual(COUNTER.get('type-one+' + template.id), 1); + assert.strictEqual(COUNTER.get('type-two+' + template.id), 1); + assert.strictEqual(COUNTER.total, 2); + }; + + _class.prototype['@test a template instance is returned (ensures templates can be injected into layout property)'] = function testATemplateInstanceIsReturnedEnsuresTemplatesCanBeInjectedIntoLayoutProperty(assert) { + var _this = this; + + var owner = this.owner; + var env = this.env; + + var templateInstanceFor = function (content) { + var _Factory$create; + + var Factory = _this.compile(content); + return Factory.create((_Factory$create = {}, _Factory$create[_emberUtils.OWNER] = owner, _Factory$create.env = env, _Factory$create)); + }; + + var template1 = templateInstanceFor('Hello world!'); + var template2 = templateInstanceFor('{{foo}} {{bar}}'); + + assert.ok(env.getCompiledBlock(TypeOneCompiler, template1) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + assert.ok(env.getCompiledBlock(TypeOneCompiler, template2) instanceof _glimmerRuntime.CompiledBlock, 'should return a CompiledBlock'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/unit/layout-cache-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/unit'); + test('ember-glimmer/tests/unit/layout-cache-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/unit/layout-cache-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/unit/layout-cache-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/unit'); + QUnit.test('ember-glimmer/tests/unit/layout-cache-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/unit/layout-cache-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/unit/outlet-test', ['exports', 'ember-glimmer/views/outlet', 'ember-metal'], function (exports, _emberGlimmerViewsOutlet, _emberMetal) { + 'use strict'; + + QUnit.module('Glimmer OutletView'); + + QUnit.test('render in the render queue', function (assert) { + var didAppendOutletView = 0; + var expectedOutlet = '#foo.bar'; + + var renderer = { + appendOutletView: function (view, target) { + didAppendOutletView++; + assert.equal(view, outletView); + assert.equal(target, expectedOutlet); + } + }; + + var outletView = new _emberGlimmerViewsOutlet.default({}, renderer); + + _emberMetal.run(function () { + assert.equal(didAppendOutletView, 0, 'appendOutletView should not yet have been called (before appendTo)'); + outletView.appendTo(expectedOutlet); + assert.equal(didAppendOutletView, 0, 'appendOutletView should not yet have been called (sync after appendTo)'); + + _emberMetal.run.schedule('actions', function () { + return assert.equal(didAppendOutletView, 0, 'appendOutletView should not yet have been called (in actions)'); + }); + _emberMetal.run.schedule('render', function () { + return assert.equal(didAppendOutletView, 1, 'appendOutletView should be invoked in render'); + }); + }); + }); +}); +enifed('ember-glimmer/tests/unit/outlet-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/unit'); + test('ember-glimmer/tests/unit/outlet-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/unit/outlet-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/unit/outlet-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/unit'); + QUnit.test('ember-glimmer/tests/unit/outlet-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/unit/outlet-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/unit/template-factory-test', ['exports', 'ember-template-compiler', 'ember-glimmer/index', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberTemplateCompiler, _emberGlimmerIndex, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Template factory test', (function (_RenderingTest) { + babelHelpers.inherits(_class, _RenderingTest); + + function _class() { + _RenderingTest.apply(this, arguments); + } + + _class.prototype['@test the template factory returned from precompile is the same as compile'] = function testTheTemplateFactoryReturnedFromPrecompileIsTheSameAsCompile(assert) { + var env = this.env; + + var templateStr = 'Hello {{name}}'; + var options = { moduleName: 'some-module' }; + + var spec = _emberTemplateCompiler.precompile(templateStr, options); + var body = 'exports.default = template(' + spec + ');'; + var module = new Function('exports', 'template', body); + var exports = {}; + module(exports, _emberGlimmerIndex.template); + var Precompiled = exports['default']; + + var Compiled = _emberTemplateCompiler.compile(templateStr, options); + + assert.equal(typeof Precompiled.create, 'function', 'precompiled is a factory'); + assert.ok(Precompiled.id, 'precompiled has id'); + + assert.equal(typeof Compiled.create, 'function', 'compiled is a factory'); + assert.ok(Compiled.id, 'compiled has id'); + + assert.equal(env._templateCache.misses, 0, 'misses 0'); + assert.equal(env._templateCache.hits, 0, 'hits 0'); + + var precompiled = env.getTemplate(Precompiled, env.owner); + + assert.equal(env._templateCache.misses, 1, 'misses 1'); + assert.equal(env._templateCache.hits, 0, 'hits 0'); + + var compiled = env.getTemplate(Compiled, env.owner); + + assert.equal(env._templateCache.misses, 2, 'misses 2'); + assert.equal(env._templateCache.hits, 0, 'hits 0'); + + assert.ok(typeof precompiled.spec !== 'string', 'Spec has been parsed'); + assert.ok(typeof compiled.spec !== 'string', 'Spec has been parsed'); + + this.registerComponent('x-precompiled', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + layout: Precompiled + }) + }); + + this.registerComponent('x-compiled', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + layout: Compiled + }) + }); + + this.render('{{x-precompiled name="precompiled"}} {{x-compiled name="compiled"}}'); + + assert.equal(env._templateCache.misses, 2, 'misses 2'); + assert.equal(env._templateCache.hits, 2, 'hits 2'); + + this.assertText('Hello precompiled Hello compiled'); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); +}); +enifed('ember-glimmer/tests/unit/template-factory-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/unit'); + test('ember-glimmer/tests/unit/template-factory-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/unit/template-factory-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/unit/template-factory-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/unit'); + QUnit.test('ember-glimmer/tests/unit/template-factory-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/unit/template-factory-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/utils/abstract-test-case', ['exports', 'internal-test-helpers'], function (exports, _internalTestHelpers) { + 'use strict'; + + exports.TestCase = _internalTestHelpers.AbstractTestCase; + exports.applyMixins = _internalTestHelpers.applyMixins; + exports.strip = _internalTestHelpers.strip; +}); +enifed('ember-glimmer/tests/utils/abstract-test-case.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/utils'); + test('ember-glimmer/tests/utils/abstract-test-case.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/utils/abstract-test-case.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/utils/abstract-test-case.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/utils'); + QUnit.test('ember-glimmer/tests/utils/abstract-test-case.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/utils/abstract-test-case.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/utils/helpers', ['exports', 'ember-template-compiler', 'ember-glimmer'], function (exports, _emberTemplateCompiler, _emberGlimmer) { + 'use strict'; + + exports.compile = _emberTemplateCompiler.compile; + exports.precompile = _emberTemplateCompiler.precompile; + exports.INVOKE = _emberGlimmer.INVOKE; + exports.Helper = _emberGlimmer.Helper; + exports.helper = _emberGlimmer.helper; + exports.Component = _emberGlimmer.Component; + exports.TextArea = _emberGlimmer.TextArea; + exports.LinkComponent = _emberGlimmer.LinkComponent; + exports.TextField = _emberGlimmer.TextField; + exports.InteractiveRender = _emberGlimmer.InteractiveRender; + exports.InertRenderer = _emberGlimmer.InertRenderer; + exports.makeBoundHelper = _emberGlimmer.makeBoundHelper; + exports.htmlSafe = _emberGlimmer.htmlSafe; + exports.SafeString = _emberGlimmer.SafeString; + exports.DOMChanges = _emberGlimmer.DOMChanges; + exports.isHTMLSafe = _emberGlimmer.isHTMLSafe; +}); +enifed('ember-glimmer/tests/utils/helpers.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/utils'); + test('ember-glimmer/tests/utils/helpers.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/utils/helpers.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/utils/helpers.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/utils'); + QUnit.test('ember-glimmer/tests/utils/helpers.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/utils/helpers.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/utils/shared-conditional-tests', ['exports', 'ember-utils', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberUtils, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberMetal, _emberRuntime, _emberGlimmerTestsUtilsHelpers) { + 'use strict'; + + var _ObjectTestCases, _ArrayTestCases; + + var AbstractConditionalsTest = (function (_RenderingTest) { + babelHelpers.inherits(AbstractConditionalsTest, _RenderingTest); + + function AbstractConditionalsTest() { + _RenderingTest.apply(this, arguments); + } + + AbstractConditionalsTest.prototype.wrapperFor = function wrapperFor(templates) { + return templates.join(''); + }; + + AbstractConditionalsTest.prototype.wrappedTemplateFor = function wrappedTemplateFor(options) { + return this.wrapperFor([this.templateFor(options)]); + }; + + /* abstract */ + + AbstractConditionalsTest.prototype.templateFor = function templateFor(_ref5) { + var cond = _ref5.cond; + var truthy = _ref5.truthy; + var falsy = _ref5.falsy; + + // e.g. `{{#if ${cond}}}${truthy}{{else}}${falsy}{{/if}}` + throw new Error('Not implemented: `templateFor`'); + }; + + /* abstract */ + + AbstractConditionalsTest.prototype.renderValues = function renderValues() { + throw new Error('Not implemented: `renderValues`'); + }; + + babelHelpers.createClass(AbstractConditionalsTest, [{ + key: 'truthyValue', + get: function () { + return true; + } + }, { + key: 'falsyValue', + get: function () { + return false; + } + }]); + return AbstractConditionalsTest; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest); + + var AbstractGenerator = (function () { + function AbstractGenerator(cases) { + this.cases = cases; + } + + /* + The test cases in this file generally follow the following pattern: + + 1. Render with [ truthy, ...(other truthy variations), falsy, ...(other falsy variations) ] + 2. No-op rerender + 3. Make all of them falsy (through interior mutation) + 4. Make all of them truthy (through interior mutation, sometimes with some slight variations) + 5. Reset them to their original values (through replacement) + */ + + /* abstract */ + + AbstractGenerator.prototype.generate = function generate(value, idx) { + throw new Error('Not implemented: `generate`'); + }; + + return AbstractGenerator; + })(); + + var TruthyGenerator = (function (_AbstractGenerator) { + babelHelpers.inherits(TruthyGenerator, _AbstractGenerator); + + function TruthyGenerator() { + _AbstractGenerator.apply(this, arguments); + } + + TruthyGenerator.prototype.generate = function generate(value, idx) { + var _ref; + + return _ref = {}, _ref['@test it should consider ' + JSON.stringify(value) + ' truthy [' + idx + ']'] = function () { + var _this = this; + + this.renderValues(value); + + this.assertText('T1'); + + this.runTask(function () { + return _this.rerender(); + }); + + this.assertText('T1'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'cond1', _this.falsyValue); + }); + + this.assertText('F1'); + + this.runTask(function () { + return _emberMetal.set(_this.context, 'cond1', value); + }); + + this.assertText('T1'); + }, _ref; + }; + + return TruthyGenerator; + })(AbstractGenerator); + + exports.TruthyGenerator = TruthyGenerator; + + var FalsyGenerator = (function (_AbstractGenerator2) { + babelHelpers.inherits(FalsyGenerator, _AbstractGenerator2); + + function FalsyGenerator() { + _AbstractGenerator2.apply(this, arguments); + } + + FalsyGenerator.prototype.generate = function generate(value, idx) { + var _ref2; + + return _ref2 = {}, _ref2['@test it should consider ' + JSON.stringify(value) + ' falsy [' + idx + ']'] = function () { + var _this2 = this; + + this.renderValues(value); + + this.assertText('F1'); + + this.runTask(function () { + return _this2.rerender(); + }); + + this.assertText('F1'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'cond1', _this2.truthyValue); + }); + + this.assertText('T1'); + + this.runTask(function () { + return _emberMetal.set(_this2.context, 'cond1', value); + }); + + this.assertText('F1'); + }, _ref2; + }; + + return FalsyGenerator; + })(AbstractGenerator); + + exports.FalsyGenerator = FalsyGenerator; + + var StableTruthyGenerator = (function (_TruthyGenerator) { + babelHelpers.inherits(StableTruthyGenerator, _TruthyGenerator); + + function StableTruthyGenerator() { + _TruthyGenerator.apply(this, arguments); + } + + StableTruthyGenerator.prototype.generate = function generate(value, idx) { + var _assign; + + return _emberUtils.assign(_TruthyGenerator.prototype.generate.call(this, value, idx), (_assign = {}, _assign['@test it maintains DOM stability when condition changes from ' + value + ' to another truthy value and back [' + idx + ']'] = function () { + var _this3 = this; + + this.renderValues(value); + + this.assertText('T1'); + + this.takeSnapshot(); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'cond1', _this3.truthyValue); + }); + + this.assertText('T1'); + + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this3.context, 'cond1', value); + }); + + this.assertText('T1'); + + this.assertInvariants(); + }, _assign)); + }; + + return StableTruthyGenerator; + })(TruthyGenerator); + + exports.StableTruthyGenerator = StableTruthyGenerator; + + var StableFalsyGenerator = (function (_FalsyGenerator) { + babelHelpers.inherits(StableFalsyGenerator, _FalsyGenerator); + + function StableFalsyGenerator() { + _FalsyGenerator.apply(this, arguments); + } + + StableFalsyGenerator.prototype.generate = function generate(value, idx) { + var _assign2; + + return _emberUtils.assign(_FalsyGenerator.prototype.generate.call(this, value), (_assign2 = {}, _assign2['@test it maintains DOM stability when condition changes from ' + value + ' to another falsy value and back [' + idx + ']'] = function () { + var _this4 = this; + + this.renderValues(value); + + this.assertText('F1'); + + this.takeSnapshot(); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'cond1', _this4.falsyValue); + }); + + this.assertText('F1'); + + this.assertInvariants(); + + this.runTask(function () { + return _emberMetal.set(_this4.context, 'cond1', value); + }); + + this.assertText('F1'); + + this.assertInvariants(); + }, _assign2)); + }; + + return StableFalsyGenerator; + })(FalsyGenerator); + + exports.StableFalsyGenerator = StableFalsyGenerator; + + var ObjectProxyGenerator = (function (_AbstractGenerator3) { + babelHelpers.inherits(ObjectProxyGenerator, _AbstractGenerator3); + + function ObjectProxyGenerator() { + _AbstractGenerator3.apply(this, arguments); + } + + // Testing behaviors shared across all conditionals, i.e. {{#if}}, {{#unless}}, + // {{#with}}, {{#each}}, {{#each-in}}, (if) and (unless) + + ObjectProxyGenerator.prototype.generate = function generate(value, idx) { + // This is inconsistent with our usual to-bool policy, but the current proxy implementation + // simply uses !!content to determine truthiness + if (value) { + var _ref3; + + return _ref3 = {}, _ref3['@test it should consider an object proxy with `' + JSON.stringify(value) + '` truthy [' + idx + ']'] = function () { + var _this5 = this; + + this.renderValues(_emberRuntime.ObjectProxy.create({ content: value })); + + this.assertText('T1'); + + this.runTask(function () { + return _this5.rerender(); + }); + + this.assertText('T1'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'cond1.content', _this5.falsyValue); + }); + + this.assertText('F1'); + + this.runTask(function () { + return _emberMetal.set(_this5.context, 'cond1', _emberRuntime.ObjectProxy.create({ content: value })); + }); + + this.assertText('T1'); + }, _ref3; + } else { + var _ref4; + + return _ref4 = {}, _ref4['@test it should consider an object proxy with `' + JSON.stringify(value) + '` falsy [' + idx + ']'] = function () { + var _this6 = this; + + this.renderValues(_emberRuntime.ObjectProxy.create({ content: value })); + + this.assertText('F1'); + + this.runTask(function () { + return _this6.rerender(); + }); + + this.assertText('F1'); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'cond1.content', _this6.truthyValue); + }); + + this.assertText('T1'); + + this.runTask(function () { + return _emberMetal.set(_this6.context, 'cond1', _emberRuntime.ObjectProxy.create({ content: value })); + }); + + this.assertText('F1'); + }, _ref4; + } + }; + + return ObjectProxyGenerator; + })(AbstractGenerator); + + var BasicConditionalsTest = (function (_AbstractConditionalsTest) { + babelHelpers.inherits(BasicConditionalsTest, _AbstractConditionalsTest); + + function BasicConditionalsTest() { + _AbstractConditionalsTest.apply(this, arguments); + } + + // Testing behaviors related to ember objects, object proxies, etc + + BasicConditionalsTest.prototype['@test it renders the corresponding block based on the conditional'] = function testItRendersTheCorrespondingBlockBasedOnTheConditional() { + var _this7 = this; + + this.renderValues(this.truthyValue, this.falsyValue); + + this.assertText('T1F2'); + + this.runTask(function () { + return _this7.rerender(); + }); + + this.assertText('T1F2'); + + this.runTask(function () { + return _emberMetal.set(_this7.context, 'cond1', _this7.falsyValue); + }); + + this.assertText('F1F2'); + + this.runTask(function () { + _emberMetal.set(_this7.context, 'cond1', _this7.truthyValue); + _emberMetal.set(_this7.context, 'cond2', _this7.truthyValue); + }); + + this.assertText('T1T2'); + + this.runTask(function () { + _emberMetal.set(_this7.context, 'cond1', _this7.truthyValue); + _emberMetal.set(_this7.context, 'cond2', _this7.falsyValue); + }); + + this.assertText('T1F2'); + }; + + return BasicConditionalsTest; + })(AbstractConditionalsTest); + + exports.BasicConditionalsTest = BasicConditionalsTest; + var ObjectTestCases = (_ObjectTestCases = {}, _ObjectTestCases['@test it considers object proxies without content falsy'] = function () { + var _this8 = this; + + this.renderValues(_emberRuntime.ObjectProxy.create({ content: {} }), _emberRuntime.ObjectProxy.create({ content: _emberRuntime.Object.create() }), _emberRuntime.ObjectProxy.create({ content: null })); + + this.assertText('T1T2F3'); + + this.runTask(function () { + return _this8.rerender(); + }); + + this.assertText('T1T2F3'); + + this.runTask(function () { + _emberMetal.set(_this8.context, 'cond1.content', null); + _emberMetal.set(_this8.context, 'cond2.content', null); + }); + + this.assertText('F1F2F3'); + + this.runTask(function () { + _emberMetal.set(_this8.context, 'cond1.content', _emberRuntime.Object.create()); + _emberMetal.set(_this8.context, 'cond2.content', {}); + _emberMetal.set(_this8.context, 'cond3.content', { foo: 'bar' }); + }); + + this.assertText('T1T2T3'); + + this.runTask(function () { + _emberMetal.set(_this8.context, 'cond1', _emberRuntime.ObjectProxy.create({ content: {} })); + _emberMetal.set(_this8.context, 'cond2', _emberRuntime.ObjectProxy.create({ content: _emberRuntime.Object.create() })); + _emberMetal.set(_this8.context, 'cond3', _emberRuntime.ObjectProxy.create({ content: null })); + }); + + this.assertText('T1T2F3'); + }, _ObjectTestCases); + + exports.ObjectTestCases = ObjectTestCases; + // Testing behaviors related to arrays and array proxies + var ArrayTestCases = (_ArrayTestCases = {}, _ArrayTestCases['@test it considers empty arrays falsy'] = function () { + var _this9 = this; + + this.renderValues(_emberRuntime.A(['hello']), _emberRuntime.A()); + + this.assertText('T1F2'); + + this.runTask(function () { + return _this9.rerender(); + }); + + this.assertText('T1F2'); + + this.runTask(function () { + return _emberRuntime.removeAt(_emberMetal.get(_this9.context, 'cond1'), 0); + }); + + this.assertText('F1F2'); + + this.runTask(function () { + _emberMetal.get(_this9.context, 'cond1').pushObject('hello'); + _emberMetal.get(_this9.context, 'cond2').pushObjects([1]); + }); + + this.assertText('T1T2'); + + this.runTask(function () { + _emberMetal.set(_this9.context, 'cond1', _emberRuntime.A(['hello'])); + _emberMetal.set(_this9.context, 'cond2', _emberRuntime.A()); + }); + + this.assertText('T1F2'); + }, _ArrayTestCases['@test it considers array proxies without content falsy'] = function () { + var _this10 = this; + + this.renderValues(_emberRuntime.ArrayProxy.create({ content: _emberRuntime.A(['hello']) }), _emberRuntime.ArrayProxy.create({ content: null })); + + this.assertText('T1F2'); + + this.runTask(function () { + return _this10.rerender(); + }); + + this.assertText('T1F2'); + + this.runTask(function () { + _emberMetal.set(_this10.context, 'cond1.content', null); + _emberMetal.set(_this10.context, 'cond2.content', null); + }); + + this.assertText('F1F2'); + + this.runTask(function () { + _emberMetal.set(_this10.context, 'cond1.content', _emberRuntime.A(['hello'])); + _emberMetal.set(_this10.context, 'cond2.content', _emberRuntime.A([1])); + }); + + this.assertText('T1T2'); + + this.runTask(function () { + _emberMetal.set(_this10.context, 'cond1', _emberRuntime.ArrayProxy.create({ content: _emberRuntime.A(['hello']) })); + _emberMetal.set(_this10.context, 'cond2', _emberRuntime.ArrayProxy.create({ content: null })); + }); + + this.assertText('T1F2'); + }, _ArrayTestCases['@test it considers array proxies with empty arrays falsy'] = function () { + var _this11 = this; + + this.renderValues(_emberRuntime.ArrayProxy.create({ content: _emberRuntime.A(['hello']) }), _emberRuntime.ArrayProxy.create({ content: _emberRuntime.A() })); + + this.assertText('T1F2'); + + this.runTask(function () { + return _this11.rerender(); + }); + + this.assertText('T1F2'); + + this.runTask(function () { + return _emberRuntime.removeAt(_emberMetal.get(_this11.context, 'cond1.content'), 0); + }); + + this.assertText('F1F2'); + + this.runTask(function () { + _emberMetal.get(_this11.context, 'cond1.content').pushObject('hello'); + _emberMetal.get(_this11.context, 'cond2.content').pushObjects([1]); + }); + + this.assertText('T1T2'); + + this.runTask(function () { + _emberMetal.set(_this11.context, 'cond1', _emberRuntime.ArrayProxy.create({ content: _emberRuntime.A(['hello']) })); + _emberMetal.set(_this11.context, 'cond2', _emberRuntime.ArrayProxy.create({ content: _emberRuntime.A() })); + }); + + this.assertText('T1F2'); + }, _ArrayTestCases); + + exports.ArrayTestCases = ArrayTestCases; + var IfUnlessWithTestCases = [new StableTruthyGenerator([true, ' ', 'hello', 'false', 'null', 'undefined', 1, ['hello'], _emberRuntime.A(['hello']), {}, { foo: 'bar' }, _emberRuntime.Object.create(), _emberRuntime.Object.create({ foo: 'bar' }), _emberRuntime.ObjectProxy.create({ content: true }), Object, function () {}, + /*jshint -W053 */ + new String('hello'), new String(''), new Boolean(true), new Boolean(false), + /*jshint +W053 */ + new Date()]), new StableFalsyGenerator([false, null, undefined, '', 0, [], _emberRuntime.A(), _emberRuntime.ObjectProxy.create({ content: undefined })]), new ObjectProxyGenerator([true, ' ', 'hello', 'false', 'null', 'undefined', 1, ['hello'], _emberRuntime.A(['hello']), _emberRuntime.ArrayProxy.create({ content: ['hello'] }), _emberRuntime.ArrayProxy.create({ content: [] }), {}, { foo: 'bar' }, _emberRuntime.Object.create(), _emberRuntime.Object.create({ foo: 'bar' }), _emberRuntime.ObjectProxy.create({ content: true }), _emberRuntime.ObjectProxy.create({ content: undefined }), + /*jshint -W053 */ + new String('hello'), new String(''), new Boolean(true), new Boolean(false), + /*jshint +W053 */ + new Date(), false, null, undefined, '', 0, [], _emberRuntime.A()]), ObjectTestCases, ArrayTestCases]; + + // Testing behaviors shared across the "toggling" conditionals, i.e. {{#if}}, + // {{#unless}}, {{#with}}, {{#each}}, {{#each-in}}, (if) and (unless) + + var TogglingConditionalsTest = (function (_BasicConditionalsTest) { + babelHelpers.inherits(TogglingConditionalsTest, _BasicConditionalsTest); + + function TogglingConditionalsTest() { + _BasicConditionalsTest.apply(this, arguments); + } + + // Testing behaviors shared across the (if) and (unless) helpers + return TogglingConditionalsTest; + })(BasicConditionalsTest); + + exports.TogglingConditionalsTest = TogglingConditionalsTest; + + var TogglingHelperConditionalsTest = (function (_TogglingConditionalsTest) { + babelHelpers.inherits(TogglingHelperConditionalsTest, _TogglingConditionalsTest); + + function TogglingHelperConditionalsTest() { + _TogglingConditionalsTest.apply(this, arguments); + } + + TogglingHelperConditionalsTest.prototype.renderValues = function renderValues() { + var templates = []; + var context = {}; + + for (var _len = arguments.length, values = Array(_len), _key = 0; _key < _len; _key++) { + values[_key] = arguments[_key]; + } + + for (var i = 1; i <= values.length; i++) { + templates.push(this.templateFor({ cond: 'cond' + i, truthy: 't' + i, falsy: 'f' + i })); + context['t' + i] = 'T' + i; + context['f' + i] = 'F' + i; + context['cond' + i] = values[i - 1]; + } + + var wrappedTemplate = this.wrapperFor(templates); + this.render(wrappedTemplate, context); + }; + + TogglingHelperConditionalsTest.prototype['@test it has access to the outer scope from both templates'] = function testItHasAccessToTheOuterScopeFromBothTemplates() { + var _this12 = this; + + var template = this.wrapperFor([this.templateFor({ cond: 'cond1', truthy: 'truthy', falsy: 'falsy' }), this.templateFor({ cond: 'cond2', truthy: 'truthy', falsy: 'falsy' })]); + + this.render(template, { cond1: this.truthyValue, cond2: this.falsyValue, truthy: 'YES', falsy: 'NO' }); + + this.assertText('YESNO'); + + this.runTask(function () { + return _this12.rerender(); + }); + + this.assertText('YESNO'); + + this.runTask(function () { + _emberMetal.set(_this12.context, 'truthy', 'YASS'); + _emberMetal.set(_this12.context, 'falsy', 'NOPE'); + }); + + this.assertText('YASSNOPE'); + + this.runTask(function () { + _emberMetal.set(_this12.context, 'cond1', _this12.falsyValue); + _emberMetal.set(_this12.context, 'cond2', _this12.truthyValue); + }); + + this.assertText('NOPEYASS'); + + this.runTask(function () { + _emberMetal.set(_this12.context, 'truthy', 'YES'); + _emberMetal.set(_this12.context, 'falsy', 'NO'); + _emberMetal.set(_this12.context, 'cond1', _this12.truthyValue); + _emberMetal.set(_this12.context, 'cond2', _this12.falsyValue); + }); + + this.assertText('YESNO'); + }; + + TogglingHelperConditionalsTest.prototype['@test it does not update when the unbound helper is used'] = function testItDoesNotUpdateWhenTheUnboundHelperIsUsed() { + var _this13 = this; + + var template = this.wrapperFor([this.templateFor({ cond: '(unbound cond1)', truthy: '"T1"', falsy: '"F1"' }), this.templateFor({ cond: '(unbound cond2)', truthy: '"T2"', falsy: '"F2"' })]); + + this.render(template, { cond1: this.truthyValue, cond2: this.falsyValue }); + + this.assertText('T1F2'); + + this.runTask(function () { + return _this13.rerender(); + }); + + this.assertText('T1F2'); + + this.runTask(function () { + return _emberMetal.set(_this13.context, 'cond1', _this13.falsyValue); + }); + + this.assertText('T1F2'); + + this.runTask(function () { + _emberMetal.set(_this13.context, 'cond1', _this13.truthyValue); + _emberMetal.set(_this13.context, 'cond2', _this13.truthyValue); + }); + + this.assertText('T1F2'); + + this.runTask(function () { + _emberMetal.set(_this13.context, 'cond1', _this13.truthyValue); + _emberMetal.set(_this13.context, 'cond2', _this13.falsyValue); + }); + + this.assertText('T1F2'); + }; + + TogglingHelperConditionalsTest.prototype['@test evaluation should be lazy'] = function testEvaluationShouldBeLazy(assert) { + var _this14 = this; + + var truthyEvaluated = undefined; + var falsyEvaluated = undefined; + + var withoutEvaluatingTruthy = function (callback) { + truthyEvaluated = false; + callback(); + assert.ok(!truthyEvaluated, 'x-truthy is not evaluated'); + }; + + var withoutEvaluatingFalsy = function (callback) { + falsyEvaluated = false; + callback(); + assert.ok(!falsyEvaluated, 'x-falsy is not evaluated'); + }; + + this.registerHelper('x-truthy', { + compute: function () { + truthyEvaluated = true; + return 'T'; + } + }); + + this.registerHelper('x-falsy', { + compute: function () { + falsyEvaluated = true; + return 'F'; + } + }); + + var template = this.wrappedTemplateFor({ cond: 'cond', truthy: '(x-truthy)', falsy: '(x-falsy)' }); + + withoutEvaluatingFalsy(function () { + return _this14.render(template, { cond: _this14.truthyValue }); + }); + + this.assertText('T'); + + withoutEvaluatingFalsy(function () { + return _this14.runTask(function () { + return _this14.rerender(); + }); + }); + + this.assertText('T'); + + withoutEvaluatingTruthy(function () { + return _this14.runTask(function () { + return _emberMetal.set(_this14.context, 'cond', _this14.falsyValue); + }); + }); + + this.assertText('F'); + + withoutEvaluatingTruthy(function () { + return _this14.runTask(function () { + return _this14.rerender(); + }); + }); + + this.assertText('F'); + + withoutEvaluatingFalsy(function () { + return _this14.runTask(function () { + return _emberMetal.set(_this14.context, 'cond', _this14.truthyValue); + }); + }); + + this.assertText('T'); + }; + + return TogglingHelperConditionalsTest; + })(TogglingConditionalsTest); + + exports.TogglingHelperConditionalsTest = TogglingHelperConditionalsTest; + + var IfUnlessHelperTest = (function (_TogglingHelperConditionalsTest) { + babelHelpers.inherits(IfUnlessHelperTest, _TogglingHelperConditionalsTest); + + function IfUnlessHelperTest() { + _TogglingHelperConditionalsTest.apply(this, arguments); + } + + return IfUnlessHelperTest; + })(TogglingHelperConditionalsTest); + + exports.IfUnlessHelperTest = IfUnlessHelperTest; + + _emberGlimmerTestsUtilsAbstractTestCase.applyMixins.apply(undefined, [IfUnlessHelperTest].concat(IfUnlessWithTestCases)); + + // Testing behaviors shared across the "toggling" syntatical constructs, + // i.e. {{#if}}, {{#unless}}, {{#with}}, {{#each}} and {{#each-in}} + + var TogglingSyntaxConditionalsTest = (function (_TogglingConditionalsTest2) { + babelHelpers.inherits(TogglingSyntaxConditionalsTest, _TogglingConditionalsTest2); + + function TogglingSyntaxConditionalsTest() { + _TogglingConditionalsTest2.apply(this, arguments); + } + + TogglingSyntaxConditionalsTest.prototype.renderValues = function renderValues() { + var templates = []; + var context = {}; + + for (var _len2 = arguments.length, values = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + values[_key2] = arguments[_key2]; + } + + for (var i = 1; i <= values.length; i++) { + templates.push(this.templateFor({ cond: 'cond' + i, truthy: '{{t}}' + i, falsy: '{{f}}' + i })); + context['cond' + i] = values[i - 1]; + } + + var wrappedTemplate = this.wrapperFor(templates); + this.render(wrappedTemplate, _emberUtils.assign({ t: 'T', f: 'F' }, context)); + }; + + TogglingSyntaxConditionalsTest.prototype['@test it does not update when the unbound helper is used'] = function testItDoesNotUpdateWhenTheUnboundHelperIsUsed() { + var _this15 = this; + + var template = '' + this.templateFor({ cond: '(unbound cond1)', truthy: 'T1', falsy: 'F1' }) + this.templateFor({ cond: '(unbound cond2)', truthy: 'T2', falsy: 'F2' }); + + this.render(template, { cond1: this.truthyValue, cond2: this.falsyValue }); + + this.assertText('T1F2'); + + this.runTask(function () { + return _this15.rerender(); + }); + + this.assertText('T1F2'); + + this.runTask(function () { + return _emberMetal.set(_this15.context, 'cond1', _this15.falsyValue); + }); + + this.assertText('T1F2'); + + this.runTask(function () { + _emberMetal.set(_this15.context, 'cond1', _this15.truthyValue); + _emberMetal.set(_this15.context, 'cond2', _this15.truthyValue); + }); + + this.assertText('T1F2'); + + this.runTask(function () { + _emberMetal.set(_this15.context, 'cond1', _this15.truthyValue); + _emberMetal.set(_this15.context, 'cond2', _this15.falsyValue); + }); + + this.assertText('T1F2'); + }; + + TogglingSyntaxConditionalsTest.prototype['@test it has access to the outer scope from both templates'] = function testItHasAccessToTheOuterScopeFromBothTemplates() { + var _this16 = this; + + var template = this.wrapperFor([this.templateFor({ cond: 'cond1', truthy: '{{truthy}}', falsy: '{{falsy}}' }), this.templateFor({ cond: 'cond2', truthy: '{{truthy}}', falsy: '{{falsy}}' })]); + + this.render(template, { cond1: this.truthyValue, cond2: this.falsyValue, truthy: 'YES', falsy: 'NO' }); + + this.assertText('YESNO'); + + this.runTask(function () { + return _this16.rerender(); + }); + + this.assertText('YESNO'); + + this.runTask(function () { + _emberMetal.set(_this16.context, 'truthy', 'YASS'); + _emberMetal.set(_this16.context, 'falsy', 'NOPE'); + }); + + this.assertText('YASSNOPE'); + + this.runTask(function () { + _emberMetal.set(_this16.context, 'cond1', _this16.falsyValue); + _emberMetal.set(_this16.context, 'cond2', _this16.truthyValue); + }); + + this.assertText('NOPEYASS'); + + this.runTask(function () { + _emberMetal.set(_this16.context, 'truthy', 'YES'); + _emberMetal.set(_this16.context, 'falsy', 'NO'); + _emberMetal.set(_this16.context, 'cond1', _this16.truthyValue); + _emberMetal.set(_this16.context, 'cond2', _this16.falsyValue); + }); + + this.assertText('YESNO'); + }; + + TogglingSyntaxConditionalsTest.prototype['@test it updates correctly when enclosing another conditional'] = function testItUpdatesCorrectlyWhenEnclosingAnotherConditional() { + var _this17 = this; + + // This tests whether the outer conditional tracks its bounds correctly as its inner bounds changes + var inner = this.templateFor({ cond: 'inner', truthy: 'T-inner', falsy: 'F-inner' }); + var template = this.wrappedTemplateFor({ cond: 'outer', truthy: inner, falsy: 'F-outer' }); + + this.render(template, { outer: this.truthyValue, inner: this.truthyValue }); + + this.assertText('T-inner'); + + this.runTask(function () { + return _this17.rerender(); + }); + + this.assertText('T-inner'); + + // Changes the inner bounds + this.runTask(function () { + return _emberMetal.set(_this17.context, 'inner', _this17.falsyValue); + }); + + this.assertText('F-inner'); + + // Now rerender the outer conditional, which require first clearing its bounds + this.runTask(function () { + return _emberMetal.set(_this17.context, 'outer', _this17.falsyValue); + }); + + this.assertText('F-outer'); + }; + + TogglingSyntaxConditionalsTest.prototype['@test it updates correctly when enclosing #each'] = function testItUpdatesCorrectlyWhenEnclosingEach() { + var _this18 = this; + + // This tests whether the outer conditional tracks its bounds correctly as its inner bounds changes + var template = this.wrappedTemplateFor({ cond: 'outer', truthy: '{{#each inner as |text|}}{{text}}{{/each}}', falsy: 'F-outer' }); + + this.render(template, { outer: this.truthyValue, inner: ['inner', '-', 'before'] }); + + this.assertText('inner-before'); + + this.runTask(function () { + return _this18.rerender(); + }); + + this.assertText('inner-before'); + + // Changes the inner bounds + this.runTask(function () { + return _emberMetal.set(_this18.context, 'inner', ['inner-after']); + }); + + this.assertText('inner-after'); + + // Now rerender the outer conditional, which require first clearing its bounds + this.runTask(function () { + return _emberMetal.set(_this18.context, 'outer', _this18.falsyValue); + }); + + this.assertText('F-outer'); + + // Reset + this.runTask(function () { + _emberMetal.set(_this18.context, 'inner', ['inner-again']); + _emberMetal.set(_this18.context, 'outer', _this18.truthyValue); + }); + + this.assertText('inner-again'); + + // Now clear the inner bounds + this.runTask(function () { + return _emberMetal.set(_this18.context, 'inner', []); + }); + + this.assertText(''); + + // Now rerender the outer conditional, which require first clearing its bounds + this.runTask(function () { + return _emberMetal.set(_this18.context, 'outer', _this18.falsyValue); + }); + + this.assertText('F-outer'); + }; + + TogglingSyntaxConditionalsTest.prototype['@test it updates correctly when enclosing triple-curlies'] = function testItUpdatesCorrectlyWhenEnclosingTripleCurlies() { + var _this19 = this; + + // This tests whether the outer conditional tracks its bounds correctly as its inner bounds changes + var template = this.wrappedTemplateFor({ cond: 'outer', truthy: '{{{inner}}}', falsy: 'F-outer' }); + + this.render(template, { outer: this.truthyValue, inner: 'inner-before' }); + + this.assertText('inner-before'); + + this.runTask(function () { + return _this19.rerender(); + }); + + this.assertText('inner-before'); + + // Changes the inner bounds + this.runTask(function () { + return _emberMetal.set(_this19.context, 'inner', '

    inner-after

    '); + }); + + this.assertText('inner-after'); + + // Now rerender the outer conditional, which require first clearing its bounds + this.runTask(function () { + return _emberMetal.set(_this19.context, 'outer', _this19.falsyValue); + }); + + this.assertText('F-outer'); + }; + + TogglingSyntaxConditionalsTest.prototype['@test child conditional should not render children if parent conditional becomes false'] = function testChildConditionalShouldNotRenderChildrenIfParentConditionalBecomesFalse(assert) { + var _this20 = this; + + var childCreated = false; + + this.registerComponent('foo-bar', { + template: 'foo-bar', + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + childCreated = true; + } + }) + }); + + var innerTemplate = this.templateFor({ cond: 'cond2', truthy: '{{foo-bar}}', falsy: '' }); + var wrappedTemplate = this.wrappedTemplateFor({ cond: 'cond1', truthy: innerTemplate, falsy: '' }); + + this.render(wrappedTemplate, { cond1: this.truthyValue, cond2: this.falsyValue }); + + assert.ok(!childCreated); + this.assertText(''); + + this.runTask(function () { + return _this20.rerender(); + }); + + assert.ok(!childCreated); + this.assertText(''); + + this.runTask(function () { + _emberMetal.set(_this20.context, 'cond2', _this20.truthyValue); + _emberMetal.set(_this20.context, 'cond1', _this20.falsyValue); + }); + + assert.ok(!childCreated); + this.assertText(''); + + this.runTask(function () { + _emberMetal.set(_this20.context, 'cond2', _this20.falsyValue); + _emberMetal.set(_this20.context, 'cond1', _this20.truthyValue); + }); + + assert.ok(!childCreated); + this.assertText(''); + }; + + TogglingSyntaxConditionalsTest.prototype['@test evaluation should be lazy'] = function testEvaluationShouldBeLazy(assert) { + var _this21 = this; + + var truthyEvaluated = undefined; + var falsyEvaluated = undefined; + + var withoutEvaluatingTruthy = function (callback) { + truthyEvaluated = false; + callback(); + assert.ok(!truthyEvaluated, 'x-truthy is not evaluated'); + }; + + var withoutEvaluatingFalsy = function (callback) { + falsyEvaluated = false; + callback(); + assert.ok(!falsyEvaluated, 'x-falsy is not evaluated'); + }; + + this.registerHelper('x-truthy', { + compute: function () { + truthyEvaluated = true; + return 'T'; + } + }); + + this.registerHelper('x-falsy', { + compute: function () { + falsyEvaluated = true; + return 'F'; + } + }); + + var template = this.wrappedTemplateFor({ cond: 'cond', truthy: '{{x-truthy}}', falsy: '{{x-falsy}}' }); + + withoutEvaluatingFalsy(function () { + return _this21.render(template, { cond: _this21.truthyValue }); + }); + + this.assertText('T'); + + withoutEvaluatingFalsy(function () { + return _this21.runTask(function () { + return _this21.rerender(); + }); + }); + + this.assertText('T'); + + withoutEvaluatingTruthy(function () { + return _this21.runTask(function () { + return _emberMetal.set(_this21.context, 'cond', _this21.falsyValue); + }); + }); + + this.assertText('F'); + + withoutEvaluatingTruthy(function () { + return _this21.runTask(function () { + return _this21.rerender(); + }); + }); + + this.assertText('F'); + + withoutEvaluatingFalsy(function () { + return _this21.runTask(function () { + return _emberMetal.set(_this21.context, 'cond', _this21.truthyValue); + }); + }); + + this.assertText('T'); + }; + + return TogglingSyntaxConditionalsTest; + })(TogglingConditionalsTest); + + exports.TogglingSyntaxConditionalsTest = TogglingSyntaxConditionalsTest; + + var IfUnlessWithSyntaxTest = (function (_TogglingSyntaxConditionalsTest) { + babelHelpers.inherits(IfUnlessWithSyntaxTest, _TogglingSyntaxConditionalsTest); + + function IfUnlessWithSyntaxTest() { + _TogglingSyntaxConditionalsTest.apply(this, arguments); + } + + return IfUnlessWithSyntaxTest; + })(TogglingSyntaxConditionalsTest); + + exports.IfUnlessWithSyntaxTest = IfUnlessWithSyntaxTest; + + _emberGlimmerTestsUtilsAbstractTestCase.applyMixins.apply(undefined, [IfUnlessWithSyntaxTest].concat(IfUnlessWithTestCases)); +}); +enifed('ember-glimmer/tests/utils/shared-conditional-tests.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/utils'); + test('ember-glimmer/tests/utils/shared-conditional-tests.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/utils/shared-conditional-tests.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/utils/shared-conditional-tests.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/utils'); + QUnit.test('ember-glimmer/tests/utils/shared-conditional-tests.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/utils/shared-conditional-tests.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/utils/string-test', ['exports', 'ember-glimmer/tests/utils/helpers', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case'], function (exports, _emberGlimmerTestsUtilsHelpers, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase) { + 'use strict'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('SafeString', (function (_TestCase) { + babelHelpers.inherits(_class, _TestCase); + + function _class() { + _TestCase.apply(this, arguments); + } + + _class.prototype['@test htmlSafe should return an instance of SafeString'] = function testHtmlSafeShouldReturnAnInstanceOfSafeString() { + var safeString = _emberGlimmerTestsUtilsHelpers.htmlSafe('you need to be more bold'); + + this.assert.ok(safeString instanceof _emberGlimmerTestsUtilsHelpers.SafeString, 'should be a SafeString'); + }; + + _class.prototype['@test htmlSafe should return an empty string for null'] = function testHtmlSafeShouldReturnAnEmptyStringForNull() { + var safeString = _emberGlimmerTestsUtilsHelpers.htmlSafe(null); + + this.assert.equal(safeString instanceof _emberGlimmerTestsUtilsHelpers.SafeString, true, 'should be a SafeString'); + this.assert.equal(safeString.toString(), '', 'should return an empty string'); + }; + + _class.prototype['@test htmlSafe should return an instance of SafeString'] = function testHtmlSafeShouldReturnAnInstanceOfSafeString() { + var safeString = _emberGlimmerTestsUtilsHelpers.htmlSafe(); + + this.assert.equal(safeString instanceof _emberGlimmerTestsUtilsHelpers.SafeString, true, 'should be a SafeString'); + this.assert.equal(safeString.toString(), '', 'should return an empty string'); + }; + + return _class; + })(_emberGlimmerTestsUtilsAbstractTestCase.TestCase)); + + if (true) { + _emberGlimmerTestsUtilsTestCase.moduleFor('SafeString isHTMLSafe', (function (_TestCase2) { + babelHelpers.inherits(_class2, _TestCase2); + + function _class2() { + _TestCase2.apply(this, arguments); + } + + _class2.prototype['@test isHTMLSafe should detect SafeString'] = function testIsHTMLSafeShouldDetectSafeString() { + var safeString = _emberGlimmerTestsUtilsHelpers.htmlSafe('Emphasize the important things.'); + + this.assert.ok(_emberGlimmerTestsUtilsHelpers.isHTMLSafe(safeString)); + }; + + _class2.prototype['@test isHTMLSafe should not detect SafeString on primatives'] = function testIsHTMLSafeShouldNotDetectSafeStringOnPrimatives() { + this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe('Hello World')); + this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe({})); + this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe([])); + this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe(10)); + this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe(null)); + }; + + return _class2; + })(_emberGlimmerTestsUtilsAbstractTestCase.TestCase)); + } +}); +enifed('ember-glimmer/tests/utils/string-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/utils'); + test('ember-glimmer/tests/utils/string-test.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/utils/string-test.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/utils/string-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/utils'); + QUnit.test('ember-glimmer/tests/utils/string-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/utils/string-test.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/utils/test-case', ['exports', 'internal-test-helpers'], function (exports, _internalTestHelpers) { + 'use strict'; + + exports.TestCase = _internalTestHelpers.AbstractTestCase; + exports.ApplicationTest = _internalTestHelpers.ApplicationTestCase; + exports.RenderingTest = _internalTestHelpers.RenderingTestCase; + exports.moduleFor = _internalTestHelpers.moduleFor; +}); +enifed('ember-glimmer/tests/utils/test-case.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/utils'); + test('ember-glimmer/tests/utils/test-case.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/utils/test-case.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/utils/test-case.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/utils'); + QUnit.test('ember-glimmer/tests/utils/test-case.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/utils/test-case.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/tests/utils/test-helpers', ['exports', 'internal-test-helpers'], function (exports, _internalTestHelpers) { + 'use strict'; + + exports.styles = _internalTestHelpers.styles; + exports.classes = _internalTestHelpers.classes; + exports.equalTokens = _internalTestHelpers.equalTokens; + exports.equalsElement = _internalTestHelpers.equalsElement; +}); +enifed('ember-glimmer/tests/utils/test-helpers.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/tests/utils'); + test('ember-glimmer/tests/utils/test-helpers.js should pass jscs', function () { + ok(true, 'ember-glimmer/tests/utils/test-helpers.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/tests/utils/test-helpers.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/tests/utils'); + QUnit.test('ember-glimmer/tests/utils/test-helpers.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/utils/test-helpers.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/utils/bindings.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/utils'); + test('ember-glimmer/utils/bindings.js should pass jscs', function () { + ok(true, 'ember-glimmer/utils/bindings.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/utils/bindings.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/utils'); + QUnit.test('ember-glimmer/utils/bindings.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/utils/bindings.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/utils/iterable.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/utils'); + test('ember-glimmer/utils/iterable.js should pass jscs', function () { + ok(true, 'ember-glimmer/utils/iterable.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/utils/iterable.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/utils'); + QUnit.test('ember-glimmer/utils/iterable.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/utils/iterable.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/utils/process-args.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/utils'); + test('ember-glimmer/utils/process-args.js should pass jscs', function () { + ok(true, 'ember-glimmer/utils/process-args.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/utils/process-args.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/utils'); + QUnit.test('ember-glimmer/utils/process-args.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/utils/process-args.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/utils/references.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/utils'); + test('ember-glimmer/utils/references.js should pass jscs', function () { + ok(true, 'ember-glimmer/utils/references.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/utils/references.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/utils'); + QUnit.test('ember-glimmer/utils/references.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/utils/references.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/utils/string.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/utils'); + test('ember-glimmer/utils/string.js should pass jscs', function () { + ok(true, 'ember-glimmer/utils/string.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/utils/string.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/utils'); + QUnit.test('ember-glimmer/utils/string.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/utils/string.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/utils/to-bool.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/utils'); + test('ember-glimmer/utils/to-bool.js should pass jscs', function () { + ok(true, 'ember-glimmer/utils/to-bool.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/utils/to-bool.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/utils'); + QUnit.test('ember-glimmer/utils/to-bool.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/utils/to-bool.js should pass jshint.'); + }); +}); +enifed('ember-glimmer/views/outlet.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-glimmer/views'); + test('ember-glimmer/views/outlet.js should pass jscs', function () { + ok(true, 'ember-glimmer/views/outlet.js should pass jscs.'); + }); +}); +enifed('ember-glimmer/views/outlet.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-glimmer/views'); + QUnit.test('ember-glimmer/views/outlet.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/views/outlet.js should pass jshint.'); + }); +}); +enifed('ember-metal/alias.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/alias.js should pass jscs', function () { + ok(true, 'ember-metal/alias.js should pass jscs.'); + }); +}); +enifed('ember-metal/alias.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/alias.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/alias.js should pass jshint.'); + }); +}); +enifed('ember-metal/binding.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/binding.js should pass jscs', function () { + ok(true, 'ember-metal/binding.js should pass jscs.'); + }); +}); +enifed('ember-metal/binding.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/binding.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/binding.js should pass jshint.'); + }); +}); +enifed('ember-metal/cache.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/cache.js should pass jscs', function () { + ok(true, 'ember-metal/cache.js should pass jscs.'); + }); +}); +enifed('ember-metal/cache.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/cache.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/cache.js should pass jshint.'); + }); +}); +enifed('ember-metal/chains.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/chains.js should pass jscs', function () { + ok(true, 'ember-metal/chains.js should pass jscs.'); + }); +}); +enifed('ember-metal/chains.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/chains.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/chains.js should pass jshint.'); + }); +}); +enifed('ember-metal/computed.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/computed.js should pass jscs', function () { + ok(true, 'ember-metal/computed.js should pass jscs.'); + }); +}); +enifed('ember-metal/computed.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/computed.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/computed.js should pass jshint.'); + }); +}); +enifed('ember-metal/core.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/core.js should pass jscs', function () { + ok(true, 'ember-metal/core.js should pass jscs.'); + }); +}); +enifed('ember-metal/core.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/core.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/core.js should pass jshint.'); + }); +}); +enifed('ember-metal/debug.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/debug.js should pass jscs', function () { + ok(true, 'ember-metal/debug.js should pass jscs.'); + }); +}); +enifed('ember-metal/debug.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/debug.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/debug.js should pass jshint.'); + }); +}); +enifed('ember-metal/dependent_keys.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/dependent_keys.js should pass jscs', function () { + ok(true, 'ember-metal/dependent_keys.js should pass jscs.'); + }); +}); +enifed('ember-metal/dependent_keys.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/dependent_keys.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/dependent_keys.js should pass jshint.'); + }); +}); +enifed('ember-metal/deprecate_property.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/deprecate_property.js should pass jscs', function () { + ok(true, 'ember-metal/deprecate_property.js should pass jscs.'); + }); +}); +enifed('ember-metal/deprecate_property.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/deprecate_property.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/deprecate_property.js should pass jshint.'); + }); +}); +enifed('ember-metal/descriptor.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/descriptor.js should pass jscs', function () { + ok(true, 'ember-metal/descriptor.js should pass jscs.'); + }); +}); +enifed('ember-metal/descriptor.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/descriptor.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/descriptor.js should pass jshint.'); + }); +}); +enifed('ember-metal/error.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/error.js should pass jscs', function () { + ok(true, 'ember-metal/error.js should pass jscs.'); + }); +}); +enifed('ember-metal/error.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/error.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/error.js should pass jshint.'); + }); +}); +enifed('ember-metal/error_handler.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/error_handler.js should pass jscs', function () { + ok(true, 'ember-metal/error_handler.js should pass jscs.'); + }); +}); +enifed('ember-metal/error_handler.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/error_handler.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/error_handler.js should pass jshint.'); + }); +}); +enifed('ember-metal/events.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/events.js should pass jscs', function () { + ok(true, 'ember-metal/events.js should pass jscs.'); + }); +}); +enifed('ember-metal/events.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/events.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/events.js should pass jshint.'); + }); +}); +enifed('ember-metal/expand_properties.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/expand_properties.js should pass jscs', function () { + ok(true, 'ember-metal/expand_properties.js should pass jscs.'); + }); +}); +enifed('ember-metal/expand_properties.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/expand_properties.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/expand_properties.js should pass jshint.'); + }); +}); +enifed('ember-metal/features.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/features.js should pass jscs', function () { + ok(true, 'ember-metal/features.js should pass jscs.'); + }); +}); +enifed('ember-metal/features.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/features.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/features.js should pass jshint.'); + }); +}); +enifed('ember-metal/get_properties.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/get_properties.js should pass jscs', function () { + ok(true, 'ember-metal/get_properties.js should pass jscs.'); + }); +}); +enifed('ember-metal/get_properties.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/get_properties.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/get_properties.js should pass jshint.'); + }); +}); +enifed('ember-metal/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/index.js should pass jscs', function () { + ok(true, 'ember-metal/index.js should pass jscs.'); + }); +}); +enifed('ember-metal/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/index.js should pass jshint.'); + }); +}); +enifed('ember-metal/injected_property.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/injected_property.js should pass jscs', function () { + ok(true, 'ember-metal/injected_property.js should pass jscs.'); + }); +}); +enifed('ember-metal/injected_property.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/injected_property.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/injected_property.js should pass jshint.'); + }); +}); +enifed('ember-metal/instrumentation.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/instrumentation.js should pass jscs', function () { + ok(true, 'ember-metal/instrumentation.js should pass jscs.'); + }); +}); +enifed('ember-metal/instrumentation.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/instrumentation.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/instrumentation.js should pass jshint.'); + }); +}); +enifed('ember-metal/is_blank.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/is_blank.js should pass jscs', function () { + ok(true, 'ember-metal/is_blank.js should pass jscs.'); + }); +}); +enifed('ember-metal/is_blank.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/is_blank.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/is_blank.js should pass jshint.'); + }); +}); +enifed('ember-metal/is_empty.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/is_empty.js should pass jscs', function () { + ok(true, 'ember-metal/is_empty.js should pass jscs.'); + }); +}); +enifed('ember-metal/is_empty.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/is_empty.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/is_empty.js should pass jshint.'); + }); +}); +enifed('ember-metal/is_none.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/is_none.js should pass jscs', function () { + ok(true, 'ember-metal/is_none.js should pass jscs.'); + }); +}); +enifed('ember-metal/is_none.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/is_none.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/is_none.js should pass jshint.'); + }); +}); +enifed('ember-metal/is_present.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/is_present.js should pass jscs', function () { + ok(true, 'ember-metal/is_present.js should pass jscs.'); + }); +}); +enifed('ember-metal/is_present.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/is_present.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/is_present.js should pass jshint.'); + }); +}); +enifed('ember-metal/is_proxy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/is_proxy.js should pass jscs', function () { + ok(true, 'ember-metal/is_proxy.js should pass jscs.'); + }); +}); +enifed('ember-metal/is_proxy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/is_proxy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/is_proxy.js should pass jshint.'); + }); +}); +enifed('ember-metal/libraries.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/libraries.js should pass jscs', function () { + ok(true, 'ember-metal/libraries.js should pass jscs.'); + }); +}); +enifed('ember-metal/libraries.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/libraries.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/libraries.js should pass jshint.'); + }); +}); +enifed('ember-metal/map.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/map.js should pass jscs', function () { + ok(true, 'ember-metal/map.js should pass jscs.'); + }); +}); +enifed('ember-metal/map.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/map.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/map.js should pass jshint.'); + }); +}); +enifed('ember-metal/merge.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/merge.js should pass jscs', function () { + ok(true, 'ember-metal/merge.js should pass jscs.'); + }); +}); +enifed('ember-metal/merge.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/merge.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/merge.js should pass jshint.'); + }); +}); +enifed('ember-metal/meta.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/meta.js should pass jscs', function () { + ok(true, 'ember-metal/meta.js should pass jscs.'); + }); +}); +enifed('ember-metal/meta.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/meta.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/meta.js should pass jshint.'); + }); +}); +enifed('ember-metal/meta_listeners.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/meta_listeners.js should pass jscs', function () { + ok(true, 'ember-metal/meta_listeners.js should pass jscs.'); + }); +}); +enifed('ember-metal/meta_listeners.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/meta_listeners.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/meta_listeners.js should pass jshint.'); + }); +}); +enifed('ember-metal/mixin.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/mixin.js should pass jscs', function () { + ok(true, 'ember-metal/mixin.js should pass jscs.'); + }); +}); +enifed('ember-metal/mixin.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/mixin.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/mixin.js should pass jshint.'); + }); +}); +enifed('ember-metal/observer.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/observer.js should pass jscs', function () { + ok(true, 'ember-metal/observer.js should pass jscs.'); + }); +}); +enifed('ember-metal/observer.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/observer.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/observer.js should pass jshint.'); + }); +}); +enifed('ember-metal/observer_set.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/observer_set.js should pass jscs', function () { + ok(true, 'ember-metal/observer_set.js should pass jscs.'); + }); +}); +enifed('ember-metal/observer_set.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/observer_set.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/observer_set.js should pass jshint.'); + }); +}); +enifed('ember-metal/path_cache.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/path_cache.js should pass jscs', function () { + ok(true, 'ember-metal/path_cache.js should pass jscs.'); + }); +}); +enifed('ember-metal/path_cache.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/path_cache.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/path_cache.js should pass jshint.'); + }); +}); +enifed('ember-metal/properties.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/properties.js should pass jscs', function () { + ok(true, 'ember-metal/properties.js should pass jscs.'); + }); +}); +enifed('ember-metal/properties.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/properties.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/properties.js should pass jshint.'); + }); +}); +enifed('ember-metal/property_events.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/property_events.js should pass jscs', function () { + ok(true, 'ember-metal/property_events.js should pass jscs.'); + }); +}); +enifed('ember-metal/property_events.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/property_events.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/property_events.js should pass jshint.'); + }); +}); +enifed('ember-metal/property_get.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/property_get.js should pass jscs', function () { + ok(true, 'ember-metal/property_get.js should pass jscs.'); + }); +}); +enifed('ember-metal/property_get.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/property_get.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/property_get.js should pass jshint.'); + }); +}); +enifed('ember-metal/property_set.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/property_set.js should pass jscs', function () { + ok(true, 'ember-metal/property_set.js should pass jscs.'); + }); +}); +enifed('ember-metal/property_set.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/property_set.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/property_set.js should pass jshint.'); + }); +}); +enifed('ember-metal/replace.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/replace.js should pass jscs', function () { + ok(true, 'ember-metal/replace.js should pass jscs.'); + }); +}); +enifed('ember-metal/replace.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/replace.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/replace.js should pass jshint.'); + }); +}); +enifed('ember-metal/run_loop.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/run_loop.js should pass jscs', function () { + ok(true, 'ember-metal/run_loop.js should pass jscs.'); + }); +}); +enifed('ember-metal/run_loop.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/run_loop.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/run_loop.js should pass jshint.'); + }); +}); +enifed('ember-metal/set_properties.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/set_properties.js should pass jscs', function () { + ok(true, 'ember-metal/set_properties.js should pass jscs.'); + }); +}); +enifed('ember-metal/set_properties.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/set_properties.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/set_properties.js should pass jshint.'); + }); +}); +enifed('ember-metal/tags.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/tags.js should pass jscs', function () { + ok(true, 'ember-metal/tags.js should pass jscs.'); + }); +}); +enifed('ember-metal/tags.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/tags.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tags.js should pass jshint.'); + }); +}); +enifed('ember-metal/testing.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/testing.js should pass jscs', function () { + ok(true, 'ember-metal/testing.js should pass jscs.'); + }); +}); +enifed('ember-metal/testing.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/testing.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/testing.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/accessors/get_path_test', ['exports', 'ember-metal/property_get'], function (exports, _emberMetalProperty_get) { + 'use strict'; + + var obj = undefined; + var moduleOpts = { + setup: function () { + obj = { + foo: { + bar: { + baz: { biff: 'BIFF' } + } + }, + foothis: { + bar: { + baz: { biff: 'BIFF' } + } + }, + falseValue: false, + emptyString: '', + Wuz: { + nar: 'foo' + }, + nullValue: null + }; + }, + + teardown: function () { + obj = undefined; + } + }; + + QUnit.module('Ember.get with path', moduleOpts); + + // .......................................................... + // LOCAL PATHS + // + + QUnit.test('[obj, foo] -> obj.foo', function () { + deepEqual(_emberMetalProperty_get.get(obj, 'foo'), obj.foo); + }); + + QUnit.test('[obj, foo.bar] -> obj.foo.bar', function () { + deepEqual(_emberMetalProperty_get.get(obj, 'foo.bar'), obj.foo.bar); + }); + + QUnit.test('[obj, foothis.bar] -> obj.foothis.bar', function () { + deepEqual(_emberMetalProperty_get.get(obj, 'foothis.bar'), obj.foothis.bar); + }); + + QUnit.test('[obj, falseValue.notDefined] -> (undefined)', function () { + strictEqual(_emberMetalProperty_get.get(obj, 'falseValue.notDefined'), undefined); + }); + + QUnit.test('[obj, emptyString.length] -> 0', function () { + strictEqual(_emberMetalProperty_get.get(obj, 'emptyString.length'), 0); + }); + + QUnit.test('[obj, nullValue.notDefined] -> (undefined)', function () { + strictEqual(_emberMetalProperty_get.get(obj, 'nullValue.notDefined'), undefined); + }); + + // .......................................................... + // GLOBAL PATHS TREATED LOCAL WITH GET + // + + QUnit.test('[obj, Wuz] -> obj.Wuz', function () { + deepEqual(_emberMetalProperty_get.get(obj, 'Wuz'), obj.Wuz); + }); + + QUnit.test('[obj, Wuz.nar] -> obj.Wuz.nar', function () { + deepEqual(_emberMetalProperty_get.get(obj, 'Wuz.nar'), obj.Wuz.nar); + }); + + QUnit.test('[obj, Foo] -> (undefined)', function () { + strictEqual(_emberMetalProperty_get.get(obj, 'Foo'), undefined); + }); + + QUnit.test('[obj, Foo.bar] -> (undefined)', function () { + strictEqual(_emberMetalProperty_get.get(obj, 'Foo.bar'), undefined); + }); +}); +enifed('ember-metal/tests/accessors/get_path_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/accessors'); + test('ember-metal/tests/accessors/get_path_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/accessors/get_path_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/accessors/get_path_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/accessors'); + QUnit.test('ember-metal/tests/accessors/get_path_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/accessors/get_path_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/accessors/get_properties_test', ['exports', 'ember-metal/get_properties'], function (exports, _emberMetalGet_properties) { + 'use strict'; + + QUnit.module('Ember.getProperties'); + + QUnit.test('can retrieve a hash of properties from an object via an argument list or array of property names', function () { + var obj = { + firstName: 'Steve', + lastName: 'Jobs', + companyName: 'Apple, Inc.' + }; + + deepEqual(_emberMetalGet_properties.default(obj, 'firstName', 'lastName'), { firstName: 'Steve', lastName: 'Jobs' }); + deepEqual(_emberMetalGet_properties.default(obj, 'firstName', 'lastName'), { firstName: 'Steve', lastName: 'Jobs' }); + deepEqual(_emberMetalGet_properties.default(obj, 'lastName'), { lastName: 'Jobs' }); + deepEqual(_emberMetalGet_properties.default(obj), {}); + deepEqual(_emberMetalGet_properties.default(obj, ['firstName', 'lastName']), { firstName: 'Steve', lastName: 'Jobs' }); + deepEqual(_emberMetalGet_properties.default(obj, ['firstName']), { firstName: 'Steve' }); + deepEqual(_emberMetalGet_properties.default(obj, []), {}); + }); +}); +enifed('ember-metal/tests/accessors/get_properties_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/accessors'); + test('ember-metal/tests/accessors/get_properties_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/accessors/get_properties_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/accessors/get_properties_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/accessors'); + QUnit.test('ember-metal/tests/accessors/get_properties_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/accessors/get_properties_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/accessors/get_test', ['exports', 'internal-test-helpers', 'ember-metal/property_get', 'ember-metal/mixin', 'ember-metal/observer'], function (exports, _internalTestHelpers, _emberMetalProperty_get, _emberMetalMixin, _emberMetalObserver) { + 'use strict'; + + QUnit.module('Ember.get'); + + QUnit.test('should get arbitrary properties on an object', function () { + var obj = { + string: 'string', + number: 23, + boolTrue: true, + boolFalse: false, + nullValue: null + }; + + for (var key in obj) { + if (!obj.hasOwnProperty(key)) { + continue; + } + equal(_emberMetalProperty_get.get(obj, key), obj[key], key); + } + }); + + QUnit.test('should not access a property more than once', function () { + var count = 0; + var obj = { + get id() { + return ++count; + } + }; + + _emberMetalProperty_get.get(obj, 'id'); + + equal(count, 1); + }); + + _internalTestHelpers.testBoth('should call unknownProperty on watched values if the value is undefined', function (get, set) { + var obj = { + count: 0, + unknownProperty: function (key) { + equal(key, 'foo', 'should pass key'); + this.count++; + return 'FOO'; + } + }; + + var count = 0; + _emberMetalObserver.addObserver(obj, 'foo', function () { + count++; + }); + + equal(get(obj, 'foo'), 'FOO', 'should return value from unknown'); + }); + + QUnit.test('warn on attemps to call get with no arguments', function () { + expectAssertion(function () { + _emberMetalProperty_get.get('aProperty'); + }, /Get must be called with two arguments;/i); + }); + + QUnit.test('warn on attemps to call get with only one argument', function () { + expectAssertion(function () { + _emberMetalProperty_get.get('aProperty'); + }, /Get must be called with two arguments;/i); + }); + + QUnit.test('warn on attemps to call get with more then two arguments', function () { + expectAssertion(function () { + _emberMetalProperty_get.get({}, 'aProperty', true); + }, /Get must be called with two arguments;/i); + }); + + QUnit.test('warn on attempts to get a property of undefined', function () { + expectAssertion(function () { + _emberMetalProperty_get.get(undefined, 'aProperty'); + }, /Cannot call get with 'aProperty' on an undefined object/i); + }); + + QUnit.test('warn on attempts to get a property path of undefined', function () { + expectAssertion(function () { + _emberMetalProperty_get.get(undefined, 'aProperty.on.aPath'); + }, /Cannot call get with 'aProperty.on.aPath' on an undefined object/); + }); + + QUnit.test('warn on attempts to get a property of null', function () { + expectAssertion(function () { + _emberMetalProperty_get.get(null, 'aProperty'); + }, /Cannot call get with 'aProperty' on an undefined object/); + }); + + QUnit.test('warn on attempts to get a property path of null', function () { + expectAssertion(function () { + _emberMetalProperty_get.get(null, 'aProperty.on.aPath'); + }, /Cannot call get with 'aProperty.on.aPath' on an undefined object/); + }); + + QUnit.test('warn on attempts to use get with an unsupported property path', function () { + var obj = {}; + expectAssertion(function () { + return _emberMetalProperty_get.get(obj, null); + }, /The key provided to get must be a string, you passed null/); + expectAssertion(function () { + return _emberMetalProperty_get.get(obj, NaN); + }, /The key provided to get must be a string, you passed NaN/); + expectAssertion(function () { + return _emberMetalProperty_get.get(obj, undefined); + }, /The key provided to get must be a string, you passed undefined/); + expectAssertion(function () { + return _emberMetalProperty_get.get(obj, false); + }, /The key provided to get must be a string, you passed false/); + expectAssertion(function () { + return _emberMetalProperty_get.get(obj, 42); + }, /The key provided to get must be a string, you passed 42/); + expectAssertion(function () { + return _emberMetalProperty_get.get(obj, ''); + }, /Cannot call `Ember.get` with an empty string/); + }); + + // .......................................................... + // BUGS + // + + QUnit.test('(regression) watched properties on unmodified inherited objects should still return their original value', function () { + var MyMixin = _emberMetalMixin.Mixin.create({ + someProperty: 'foo', + propertyDidChange: _emberMetalMixin.observer('someProperty', function () {}) + }); + + var baseObject = MyMixin.apply({}); + var theRealObject = Object.create(baseObject); + + equal(_emberMetalProperty_get.get(theRealObject, 'someProperty'), 'foo', 'should return the set value, not false'); + }); + + QUnit.module('Ember.getWithDefault'); + + QUnit.test('should get arbitrary properties on an object', function () { + var obj = { + string: 'string', + number: 23, + boolTrue: true, + boolFalse: false, + nullValue: null + }; + + for (var key in obj) { + if (!obj.hasOwnProperty(key)) { + continue; + } + equal(_emberMetalProperty_get.getWithDefault(obj, key, 'fail'), obj[key], key); + } + + obj = { + undef: undefined + }; + + equal(_emberMetalProperty_get.getWithDefault(obj, 'undef', 'default'), 'default', 'explicit undefined retrieves the default'); + equal(_emberMetalProperty_get.getWithDefault(obj, 'not-present', 'default'), 'default', 'non-present key retrieves the default'); + }); + + QUnit.test('should call unknownProperty if defined and value is undefined', function () { + var obj = { + count: 0, + unknownProperty: function (key) { + equal(key, 'foo', 'should pass key'); + this.count++; + return 'FOO'; + } + }; + + equal(_emberMetalProperty_get.get(obj, 'foo'), 'FOO', 'should return value from unknown'); + equal(obj.count, 1, 'should have invoked'); + }); + + _internalTestHelpers.testBoth('if unknownProperty is present, it is called', function (get, set) { + var obj = { + count: 0, + unknownProperty: function (key) { + if (key === 'foo') { + equal(key, 'foo', 'should pass key'); + this.count++; + return 'FOO'; + } + } + }; + + var count = 0; + _emberMetalObserver.addObserver(obj, 'foo', function () { + return count++; + }); + + equal(_emberMetalProperty_get.getWithDefault(obj, 'foo', 'fail'), 'FOO', 'should return value from unknownProperty'); + equal(_emberMetalProperty_get.getWithDefault(obj, 'bar', 'default'), 'default', 'should convert undefined from unknownProperty into default'); + }); + + // .......................................................... + // BUGS + // + + QUnit.test('(regression) watched properties on unmodified inherited objects should still return their original value', function () { + var MyMixin = _emberMetalMixin.Mixin.create({ + someProperty: 'foo', + propertyDidChange: _emberMetalMixin.observer('someProperty', function () {/* nothing to do */}) + }); + + var baseObject = MyMixin.apply({}); + var theRealObject = Object.create(baseObject); + + equal(_emberMetalProperty_get.getWithDefault(theRealObject, 'someProperty', 'fail'), 'foo', 'should return the set value, not false'); + }); +}); +enifed('ember-metal/tests/accessors/get_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/accessors'); + test('ember-metal/tests/accessors/get_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/accessors/get_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/accessors/get_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/accessors'); + QUnit.test('ember-metal/tests/accessors/get_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/accessors/get_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/accessors/is_global_path_test', ['exports', 'ember-metal/path_cache'], function (exports, _emberMetalPath_cache) { + 'use strict'; + + QUnit.module('Ember.isGlobalPath'); + + QUnit.test('global path\'s are recognized', function () { + ok(_emberMetalPath_cache.isGlobalPath('App.myProperty')); + ok(_emberMetalPath_cache.isGlobalPath('App.myProperty.subProperty')); + }); + + QUnit.test('if there is a \'this\' in the path, it\'s not a global path', function () { + ok(!_emberMetalPath_cache.isGlobalPath('this.myProperty')); + ok(!_emberMetalPath_cache.isGlobalPath('this')); + }); + + QUnit.test('if the path starts with a lowercase character, it is not a global path', function () { + ok(!_emberMetalPath_cache.isGlobalPath('myObj')); + ok(!_emberMetalPath_cache.isGlobalPath('myObj.SecondProperty')); + }); +}); +enifed('ember-metal/tests/accessors/is_global_path_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/accessors'); + test('ember-metal/tests/accessors/is_global_path_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/accessors/is_global_path_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/accessors/is_global_path_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/accessors'); + QUnit.test('ember-metal/tests/accessors/is_global_path_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/accessors/is_global_path_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/accessors/mandatory_setters_test', ['exports', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/watching', 'ember-metal/meta'], function (exports, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalWatching, _emberMetalMeta) { + 'use strict'; + + QUnit.module('mandatory-setters'); + + function hasMandatorySetter(object, property) { + try { + return Object.getOwnPropertyDescriptor(object, property).set.isMandatorySetter === true; + } catch (e) { + return false; + } + } + + function hasMetaValue(object, property) { + return _emberMetalMeta.meta(object).hasInValues(property); + } + + if (false) { + QUnit.test('does not assert if property is not being watched', function () { + var obj = { + someProp: null, + toString: function () { + return 'custom-object'; + } + }; + + obj.someProp = 'blastix'; + equal(_emberMetalProperty_get.get(obj, 'someProp'), 'blastix'); + }); + + QUnit.test('should not setup mandatory-setter if property is not writable', function () { + expect(6); + + var obj = {}; + + Object.defineProperty(obj, 'a', { value: true }); + Object.defineProperty(obj, 'b', { value: false }); + Object.defineProperty(obj, 'c', { value: undefined }); + Object.defineProperty(obj, 'd', { value: undefined, writable: false }); + Object.defineProperty(obj, 'e', { value: undefined, configurable: false }); + Object.defineProperty(obj, 'f', { value: undefined, configurable: true }); + + _emberMetalWatching.watch(obj, 'a'); + _emberMetalWatching.watch(obj, 'b'); + _emberMetalWatching.watch(obj, 'c'); + _emberMetalWatching.watch(obj, 'd'); + _emberMetalWatching.watch(obj, 'e'); + _emberMetalWatching.watch(obj, 'f'); + + ok(!hasMandatorySetter(obj, 'a'), 'mandatory-setter should not be installed'); + ok(!hasMandatorySetter(obj, 'b'), 'mandatory-setter should not be installed'); + ok(!hasMandatorySetter(obj, 'c'), 'mandatory-setter should not be installed'); + ok(!hasMandatorySetter(obj, 'd'), 'mandatory-setter should not be installed'); + ok(!hasMandatorySetter(obj, 'e'), 'mandatory-setter should not be installed'); + ok(!hasMandatorySetter(obj, 'f'), 'mandatory-setter should not be installed'); + }); + + QUnit.test('should not teardown non mandatory-setter descriptor', function () { + expect(1); + + var obj = { get a() { + return 'hi'; + } }; + + _emberMetalWatching.watch(obj, 'a'); + _emberMetalWatching.unwatch(obj, 'a'); + + equal(obj.a, 'hi'); + }); + + QUnit.test('should not confuse non descriptor watched gets', function () { + expect(2); + + var obj = { get a() { + return 'hi'; + } }; + + _emberMetalWatching.watch(obj, 'a'); + equal(_emberMetalProperty_get.get(obj, 'a'), 'hi'); + equal(obj.a, 'hi'); + }); + + QUnit.test('should not setup mandatory-setter if setter is already setup on property', function () { + expect(2); + + var obj = { someProp: null }; + + Object.defineProperty(obj, 'someProp', { + get: function () { + return null; + }, + + set: function (value) { + equal(value, 'foo-bar', 'custom setter was called'); + } + }); + + _emberMetalWatching.watch(obj, 'someProp'); + ok(!hasMandatorySetter(obj, 'someProp'), 'mandatory-setter should not be installed'); + + obj.someProp = 'foo-bar'; + }); + + QUnit.test('watched ES5 setter should not be smashed by mandatory setter', function () { + var value = undefined; + var obj = { + get foo() {}, + set foo(_value) { + value = _value; + } + }; + + _emberMetalWatching.watch(obj, 'foo'); + + _emberMetalProperty_set.set(obj, 'foo', 2); + equal(value, 2); + }); + + QUnit.test('should not setup mandatory-setter if setter is already setup on property in parent prototype', function () { + expect(2); + + function Foo() {} + + Object.defineProperty(Foo.prototype, 'someProp', { + get: function () { + return null; + }, + + set: function (value) { + equal(value, 'foo-bar', 'custom setter was called'); + } + }); + + var obj = new Foo(); + + _emberMetalWatching.watch(obj, 'someProp'); + ok(!hasMandatorySetter(obj, 'someProp'), 'mandatory-setter should not be installed'); + + obj.someProp = 'foo-bar'; + }); + + QUnit.test('should not setup mandatory-setter if setter is already setup on property in grandparent prototype', function () { + expect(2); + + function Foo() {} + + Object.defineProperty(Foo.prototype, 'someProp', { + get: function () { + return null; + }, + + set: function (value) { + equal(value, 'foo-bar', 'custom setter was called'); + } + }); + + function Bar() {} + Bar.prototype = Object.create(Foo.prototype); + Bar.prototype.constructor = Bar; + + var obj = new Bar(); + + _emberMetalWatching.watch(obj, 'someProp'); + ok(!hasMandatorySetter(obj, 'someProp'), 'mandatory-setter should not be installed'); + + obj.someProp = 'foo-bar'; + }); + + QUnit.test('should not setup mandatory-setter if setter is already setup on property in great grandparent prototype', function () { + expect(2); + + function Foo() {} + + Object.defineProperty(Foo.prototype, 'someProp', { + get: function () { + return null; + }, + + set: function (value) { + equal(value, 'foo-bar', 'custom setter was called'); + } + }); + + function Bar() {} + Bar.prototype = Object.create(Foo.prototype); + Bar.prototype.constructor = Bar; + + function Qux() {} + Qux.prototype = Object.create(Bar.prototype); + Qux.prototype.constructor = Qux; + + var obj = new Qux(); + + _emberMetalWatching.watch(obj, 'someProp'); + ok(!hasMandatorySetter(obj, 'someProp'), 'mandatory-setter should not be installed'); + + obj.someProp = 'foo-bar'; + }); + + QUnit.test('should assert if set without Ember.set when property is being watched', function () { + var obj = { + someProp: null, + toString: function () { + return 'custom-object'; + } + }; + + _emberMetalWatching.watch(obj, 'someProp'); + + expectAssertion(function () { + obj.someProp = 'foo-bar'; + }, 'You must use Ember.set() to set the `someProp` property (of custom-object) to `foo-bar`.'); + }); + + QUnit.test('should not assert if set with Ember.set when property is being watched', function () { + var obj = { + someProp: null, + toString: function () { + return 'custom-object'; + } + }; + + _emberMetalWatching.watch(obj, 'someProp'); + _emberMetalProperty_set.set(obj, 'someProp', 'foo-bar'); + + equal(_emberMetalProperty_get.get(obj, 'someProp'), 'foo-bar'); + }); + + QUnit.test('does not setup mandatory-setter if non-configurable', function () { + var obj = { + someProp: null, + toString: function () { + return 'custom-object'; + } + }; + + Object.defineProperty(obj, 'someProp', { + configurable: false, + enumerable: true, + value: 'blastix' + }); + + _emberMetalWatching.watch(obj, 'someProp'); + ok(!hasMandatorySetter(obj, 'someProp'), 'blastix'); + }); + + QUnit.test('ensure after watch the property is restored (and the value is no-longer stored in meta) [non-enumerable]', function () { + var obj = { + someProp: null, + toString: function () { + return 'custom-object'; + } + }; + + Object.defineProperty(obj, 'someProp', { + configurable: true, + enumerable: false, + value: 'blastix' + }); + + _emberMetalWatching.watch(obj, 'someProp'); + equal(hasMandatorySetter(obj, 'someProp'), true, 'should have a mandatory setter'); + + var descriptor = Object.getOwnPropertyDescriptor(obj, 'someProp'); + + equal(descriptor.enumerable, false, 'property should remain non-enumerable'); + equal(descriptor.configurable, true, 'property should remain configurable'); + equal(obj.someProp, 'blastix', 'expected value to be the getter'); + + equal(descriptor.value, undefined, 'expected existing value to NOT remain'); + + ok(hasMetaValue(obj, 'someProp'), 'someProp is stored in meta.values'); + + _emberMetalWatching.unwatch(obj, 'someProp'); + + ok(!hasMetaValue(obj, 'someProp'), 'someProp is no longer stored in meta.values'); + + descriptor = Object.getOwnPropertyDescriptor(obj, 'someProp'); + + equal(hasMandatorySetter(obj, 'someProp'), false, 'should no longer have a mandatory setter'); + + equal(descriptor.enumerable, false, 'property should remain non-enumerable'); + equal(descriptor.configurable, true, 'property should remain configurable'); + equal(obj.someProp, 'blastix', 'expected value to be the getter'); + equal(descriptor.value, 'blastix', 'expected existing value to remain'); + + obj.someProp = 'new value'; + + // make sure the descriptor remains correct (nothing funky, like a redefined, happened in the setter); + descriptor = Object.getOwnPropertyDescriptor(obj, 'someProp'); + + equal(descriptor.enumerable, false, 'property should remain non-enumerable'); + equal(descriptor.configurable, true, 'property should remain configurable'); + equal(descriptor.value, 'new value', 'expected existing value to NOT remain'); + equal(obj.someProp, 'new value', 'expected value to be the getter'); + equal(obj.someProp, 'new value'); + }); + + QUnit.test('ensure after watch the property is restored (and the value is no-longer stored in meta) [enumerable]', function () { + var obj = { + someProp: null, + toString: function () { + return 'custom-object'; + } + }; + + Object.defineProperty(obj, 'someProp', { + configurable: true, + enumerable: true, + value: 'blastix' + }); + + _emberMetalWatching.watch(obj, 'someProp'); + equal(hasMandatorySetter(obj, 'someProp'), true, 'should have a mandatory setter'); + + var descriptor = Object.getOwnPropertyDescriptor(obj, 'someProp'); + + equal(descriptor.enumerable, true, 'property should remain enumerable'); + equal(descriptor.configurable, true, 'property should remain configurable'); + equal(obj.someProp, 'blastix', 'expected value to be the getter'); + + equal(descriptor.value, undefined, 'expected existing value to NOT remain'); + + ok(hasMetaValue(obj, 'someProp'), 'someProp is stored in meta.values'); + + _emberMetalWatching.unwatch(obj, 'someProp'); + + ok(!hasMetaValue(obj, 'someProp'), 'someProp is no longer stored in meta.values'); + + descriptor = Object.getOwnPropertyDescriptor(obj, 'someProp'); + + equal(hasMandatorySetter(obj, 'someProp'), false, 'should no longer have a mandatory setter'); + + equal(descriptor.enumerable, true, 'property should remain enumerable'); + equal(descriptor.configurable, true, 'property should remain configurable'); + equal(obj.someProp, 'blastix', 'expected value to be the getter'); + equal(descriptor.value, 'blastix', 'expected existing value to remain'); + + obj.someProp = 'new value'; + + // make sure the descriptor remains correct (nothing funky, like a redefined, happened in the setter); + descriptor = Object.getOwnPropertyDescriptor(obj, 'someProp'); + + equal(descriptor.enumerable, true, 'property should remain enumerable'); + equal(descriptor.configurable, true, 'property should remain configurable'); + equal(descriptor.value, 'new value', 'expected existing value to NOT remain'); + equal(obj.someProp, 'new value'); + }); + + QUnit.test('sets up mandatory-setter if property comes from prototype', function () { + expect(2); + + var obj = { + someProp: null, + toString: function () { + return 'custom-object'; + } + }; + + var obj2 = Object.create(obj); + + _emberMetalWatching.watch(obj2, 'someProp'); + + ok(hasMandatorySetter(obj2, 'someProp'), 'mandatory setter has been setup'); + + expectAssertion(function () { + obj2.someProp = 'foo-bar'; + }, 'You must use Ember.set() to set the `someProp` property (of custom-object) to `foo-bar`.'); + }); + + QUnit.test('inheritance remains live', function () { + function Parent() {} + Parent.prototype.food = 'chips'; + + var child = new Parent(); + + equal(child.food, 'chips'); + + _emberMetalWatching.watch(child, 'food'); + + equal(child.food, 'chips'); + + Parent.prototype.food = 'icecreame'; + + equal(child.food, 'icecreame'); + + _emberMetalWatching.unwatch(child, 'food'); + + equal(child.food, 'icecreame'); + + Parent.prototype.food = 'chips'; + + equal(child.food, 'chips'); + }); + + QUnit.test('inheritance remains live and preserves this', function () { + function Parent(food) { + this._food = food; + } + + Object.defineProperty(Parent.prototype, 'food', { + get: function () { + return this._food; + } + }); + + var child = new Parent('chips'); + + equal(child.food, 'chips'); + + _emberMetalWatching.watch(child, 'food'); + + equal(child.food, 'chips'); + + child._food = 'icecreame'; + + equal(child.food, 'icecreame'); + + _emberMetalWatching.unwatch(child, 'food'); + + equal(child.food, 'icecreame'); + + var foodDesc = Object.getOwnPropertyDescriptor(Parent.prototype, 'food'); + ok(!foodDesc.configurable, 'Parent.prototype.food desc should be non configable'); + ok(!foodDesc.enumerable, 'Parent.prototype.food desc should be non enumerable'); + + equal(foodDesc.get.call({ + _food: 'hi' + }), 'hi'); + equal(foodDesc.set, undefined); + + equal(child.food, 'icecreame'); + }); + } +}); +enifed('ember-metal/tests/accessors/mandatory_setters_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/accessors'); + test('ember-metal/tests/accessors/mandatory_setters_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/accessors/mandatory_setters_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/accessors/mandatory_setters_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/accessors'); + QUnit.test('ember-metal/tests/accessors/mandatory_setters_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/accessors/mandatory_setters_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/accessors/set_path_test', ['exports', 'ember-environment', 'ember-metal/property_set', 'ember-metal/property_get'], function (exports, _emberEnvironment, _emberMetalProperty_set, _emberMetalProperty_get) { + 'use strict'; + + var originalLookup = _emberEnvironment.context.lookup; + var lookup = undefined; + + var obj = undefined; + function commonSetup() { + _emberEnvironment.context.lookup = lookup = {}; + obj = { + foo: { + bar: { + baz: { biff: 'BIFF' } + } + } + }; + } + + function commonTeardown() { + _emberEnvironment.context.lookup = originalLookup; + obj = null; + } + + QUnit.module('set with path', { + setup: commonSetup, + teardown: commonTeardown + }); + + QUnit.test('[Foo, bar] -> Foo.bar', function () { + lookup.Foo = { toString: function () { + return 'Foo'; + } }; // Behave like an Ember.Namespace + + _emberMetalProperty_set.set(lookup.Foo, 'bar', 'baz'); + equal(_emberMetalProperty_get.get(lookup.Foo, 'bar'), 'baz'); + }); + + // .......................................................... + // + // LOCAL PATHS + + QUnit.test('[obj, foo] -> obj.foo', function () { + _emberMetalProperty_set.set(obj, 'foo', 'BAM'); + equal(_emberMetalProperty_get.get(obj, 'foo'), 'BAM'); + }); + + QUnit.test('[obj, foo.bar] -> obj.foo.bar', function () { + _emberMetalProperty_set.set(obj, 'foo.bar', 'BAM'); + equal(_emberMetalProperty_get.get(obj, 'foo.bar'), 'BAM'); + }); + + // .......................................................... + // DEPRECATED + // + + QUnit.module('set with path - deprecated', { + setup: commonSetup, + teardown: commonTeardown + }); + + QUnit.test('[obj, bla.bla] gives a proper exception message', function () { + var exceptionMessage = 'Property set failed: object in path \"bla\" could not be found or was destroyed.'; + try { + _emberMetalProperty_set.set(obj, 'bla.bla', 'BAM'); + } catch (ex) { + equal(ex.message, exceptionMessage); + } + }); + + QUnit.test('[obj, foo.baz.bat] -> EXCEPTION', function () { + throws(function () { + return _emberMetalProperty_set.set(obj, 'foo.baz.bat', 'BAM'); + }); + }); + + QUnit.test('[obj, foo.baz.bat] -> EXCEPTION', function () { + _emberMetalProperty_set.trySet(obj, 'foo.baz.bat', 'BAM'); + ok(true, 'does not raise'); + }); +}); +enifed('ember-metal/tests/accessors/set_path_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/accessors'); + test('ember-metal/tests/accessors/set_path_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/accessors/set_path_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/accessors/set_path_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/accessors'); + QUnit.test('ember-metal/tests/accessors/set_path_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/accessors/set_path_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/accessors/set_test', ['exports', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/tags'], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalTags) { + 'use strict'; + + QUnit.module('set', { + teardown: function () { + _emberMetalTags.setHasViews(function () { + return false; + }); + } + }); + + QUnit.test('should set arbitrary properties on an object', function () { + var obj = { + string: 'string', + number: 23, + boolTrue: true, + boolFalse: false, + nullValue: null, + undefinedValue: undefined + }; + + var newObj = { + undefinedValue: 'emberjs' + }; + + for (var key in obj) { + if (!obj.hasOwnProperty(key)) { + continue; + } + + equal(_emberMetalProperty_set.set(newObj, key, obj[key]), obj[key], 'should return value'); + equal(_emberMetalProperty_get.get(newObj, key), obj[key], 'should set value'); + } + }); + + QUnit.test('should call setUnknownProperty if defined and value is undefined', function () { + var obj = { + count: 0, + + unknownProperty: function (key, value) { + ok(false, 'should not invoke unknownProperty if setUnknownProperty is defined'); + }, + + setUnknownProperty: function (key, value) { + equal(key, 'foo', 'should pass key'); + equal(value, 'BAR', 'should pass key'); + this.count++; + return 'FOO'; + } + }; + + equal(_emberMetalProperty_set.set(obj, 'foo', 'BAR'), 'BAR', 'should return set value'); + equal(obj.count, 1, 'should have invoked'); + }); + + QUnit.test('warn on attempts to call set with undefined as object', function () { + expectAssertion(function () { + return _emberMetalProperty_set.set(undefined, 'aProperty', 'BAM'); + }, /Cannot call set with 'aProperty' on an undefined object./); + }); + + QUnit.test('warn on attempts to call set with null as object', function () { + expectAssertion(function () { + return _emberMetalProperty_set.set(null, 'aProperty', 'BAM'); + }, /Cannot call set with 'aProperty' on an undefined object./); + }); + + QUnit.test('warn on attempts to use set with an unsupported property path', function () { + var obj = {}; + expectAssertion(function () { + return _emberMetalProperty_set.set(obj, null, 42); + }, /The key provided to set must be a string, you passed null/); + expectAssertion(function () { + return _emberMetalProperty_set.set(obj, NaN, 42); + }, /The key provided to set must be a string, you passed NaN/); + expectAssertion(function () { + return _emberMetalProperty_set.set(obj, undefined, 42); + }, /The key provided to set must be a string, you passed undefined/); + expectAssertion(function () { + return _emberMetalProperty_set.set(obj, false, 42); + }, /The key provided to set must be a string, you passed false/); + expectAssertion(function () { + return _emberMetalProperty_set.set(obj, 42, 42); + }, /The key provided to set must be a string, you passed 42/); + }); + + QUnit.test('warn on attempts of calling set on a destroyed object', function () { + var obj = { isDestroyed: true }; + + expectAssertion(function () { + return _emberMetalProperty_set.set(obj, 'favoriteFood', 'hot dogs'); + }, 'calling set on destroyed object: [object Object].favoriteFood = hot dogs'); + }); + + QUnit.test('does not trigger auto-run assertion for objects that have not been tagged', function (assert) { + _emberMetalTags.setHasViews(function () { + return true; + }); + var obj = {}; + + _emberMetalProperty_set.set(obj, 'foo', 'bar'); + + assert.equal(obj.foo, 'bar'); + }); +}); +enifed('ember-metal/tests/accessors/set_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/accessors'); + test('ember-metal/tests/accessors/set_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/accessors/set_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/accessors/set_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/accessors'); + QUnit.test('ember-metal/tests/accessors/set_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/accessors/set_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/alias_test', ['exports', 'ember-metal/alias', 'ember-metal/properties', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/meta', 'ember-metal/watching', 'ember-metal/observer', 'ember-metal/tags'], function (exports, _emberMetalAlias, _emberMetalProperties, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMeta, _emberMetalWatching, _emberMetalObserver, _emberMetalTags) { + 'use strict'; + + var obj = undefined, + count = undefined; + + QUnit.module('ember-metal/alias', { + setup: function () { + obj = { foo: { faz: 'FOO' } }; + count = 0; + }, + teardown: function () { + obj = null; + } + }); + + function incrementCount() { + count++; + } + + QUnit.test('should proxy get to alt key', function () { + _emberMetalProperties.defineProperty(obj, 'bar', _emberMetalAlias.default('foo.faz')); + equal(_emberMetalProperty_get.get(obj, 'bar'), 'FOO'); + }); + + QUnit.test('should proxy set to alt key', function () { + _emberMetalProperties.defineProperty(obj, 'bar', _emberMetalAlias.default('foo.faz')); + _emberMetalProperty_set.set(obj, 'bar', 'BAR'); + equal(_emberMetalProperty_get.get(obj, 'foo.faz'), 'BAR'); + }); + + QUnit.test('old dependent keys should not trigger property changes', function () { + var obj1 = Object.create(null); + _emberMetalProperties.defineProperty(obj1, 'foo', null, null); + _emberMetalProperties.defineProperty(obj1, 'bar', _emberMetalAlias.default('foo')); + _emberMetalProperties.defineProperty(obj1, 'baz', _emberMetalAlias.default('foo')); + _emberMetalProperties.defineProperty(obj1, 'baz', _emberMetalAlias.default('bar')); // redefine baz + _emberMetalObserver.addObserver(obj1, 'baz', incrementCount); + + _emberMetalProperty_set.set(obj1, 'foo', 'FOO'); + equal(count, 1); + + _emberMetalObserver.removeObserver(obj1, 'baz', incrementCount); + + _emberMetalProperty_set.set(obj1, 'foo', 'OOF'); + equal(count, 1); + }); + + QUnit.test('inheriting an observer of the alias from the prototype then\n redefining the alias on the instance to another property dependent on same key\n does not call the observer twice', function () { + var obj1 = Object.create(null); + + _emberMetalMeta.meta(obj1).proto = obj1; + + _emberMetalProperties.defineProperty(obj1, 'foo', null, null); + _emberMetalProperties.defineProperty(obj1, 'bar', _emberMetalAlias.default('foo')); + _emberMetalProperties.defineProperty(obj1, 'baz', _emberMetalAlias.default('foo')); + _emberMetalObserver.addObserver(obj1, 'baz', incrementCount); + + var obj2 = Object.create(obj1); + _emberMetalProperties.defineProperty(obj2, 'baz', _emberMetalAlias.default('bar')); // override baz + + _emberMetalProperty_set.set(obj2, 'foo', 'FOO'); + equal(count, 1); + + _emberMetalObserver.removeObserver(obj2, 'baz', incrementCount); + + _emberMetalProperty_set.set(obj2, 'foo', 'OOF'); + equal(count, 1); + }); + + QUnit.test('an observer of the alias works if added after defining the alias', function () { + _emberMetalProperties.defineProperty(obj, 'bar', _emberMetalAlias.default('foo.faz')); + _emberMetalObserver.addObserver(obj, 'bar', incrementCount); + ok(_emberMetalWatching.isWatching(obj, 'foo.faz')); + _emberMetalProperty_set.set(obj, 'foo.faz', 'BAR'); + equal(count, 1); + }); + + QUnit.test('an observer of the alias works if added before defining the alias', function () { + _emberMetalObserver.addObserver(obj, 'bar', incrementCount); + _emberMetalProperties.defineProperty(obj, 'bar', _emberMetalAlias.default('foo.faz')); + ok(_emberMetalWatching.isWatching(obj, 'foo.faz')); + _emberMetalProperty_set.set(obj, 'foo.faz', 'BAR'); + equal(count, 1); + }); + + QUnit.test('object with alias is dirtied if interior object of alias is set after consumption', function () { + _emberMetalProperties.defineProperty(obj, 'bar', _emberMetalAlias.default('foo.faz')); + _emberMetalProperty_get.get(obj, 'bar'); + assertDirty(obj, function () { + return _emberMetalProperty_set.set(obj, 'foo.faz', 'BAR'); + }, 'setting the aliased key should dirty the object'); + }); + + QUnit.test('setting alias on self should fail assertion', function () { + expectAssertion(function () { + return _emberMetalProperties.defineProperty(obj, 'bar', _emberMetalAlias.default('bar')); + }, 'Setting alias \'bar\' on self'); + }); + + function assertDirty(obj, callback, label) { + var tag = _emberMetalTags.tagFor(obj); + var tagValue = tag.value(); + callback(); + ok(!tag.validate(tagValue), label); + } +}); +enifed('ember-metal/tests/alias_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/alias_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/alias_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/alias_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/alias_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/alias_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/binding/connect_test', ['exports', 'ember-environment', 'internal-test-helpers', 'ember-metal/binding', 'ember-metal/run_loop', 'ember-metal/property_set', 'ember-metal/property_get'], function (exports, _emberEnvironment, _internalTestHelpers, _emberMetalBinding, _emberMetalRun_loop, _emberMetalProperty_set, _emberMetalProperty_get) { + 'use strict'; + + function performTest(binding, a, b, get, set, connect) { + if (connect === undefined) { + connect = function () { + return binding.connect(a); + }; + } + + ok(!_emberMetalRun_loop.default.currentRunLoop, 'performTest should not have a currentRunLoop'); + + equal(get(a, 'foo'), 'FOO', 'a should not have changed'); + equal(get(b, 'bar'), 'BAR', 'b should not have changed'); + + connect(); + + equal(get(a, 'foo'), 'BAR', 'a should have changed'); + equal(get(b, 'bar'), 'BAR', 'b should have changed'); + // + // make sure changes sync both ways + _emberMetalRun_loop.default(function () { + return set(b, 'bar', 'BAZZ'); + }); + equal(get(a, 'foo'), 'BAZZ', 'a should have changed'); + + _emberMetalRun_loop.default(function () { + return set(a, 'foo', 'BARF'); + }); + equal(get(b, 'bar'), 'BARF', 'a should have changed'); + } + + var originalLookup = undefined, + lookup = undefined, + GlobalB = undefined; + + QUnit.module('Ember.Binding', { + setup: function () { + originalLookup = _emberEnvironment.context.lookup; + _emberEnvironment.context.lookup = lookup = {}; + }, + teardown: function () { + lookup = null; + _emberEnvironment.context.lookup = originalLookup; + } + }); + + _internalTestHelpers.testBoth('Connecting a binding between two properties', function (get, set) { + var a = { foo: 'FOO', bar: 'BAR' }; + + // a.bar -> a.foo + var binding = new _emberMetalBinding.Binding('foo', 'bar'); + + expectDeprecation(function () { + performTest(binding, a, a, get, set); + }, /`Ember\.Binding` is deprecated./); + }); + + _internalTestHelpers.testBoth('Connecting a oneWay binding raises a deprecation', function (get, set) { + var a = { foo: 'FOO', bar: 'BAR', toString: function () { + return ''; + } }; + + // a.bar -> a.foo + var binding = new _emberMetalBinding.Binding('foo', 'bar').oneWay(); + + expectDeprecation(function () { + binding.connect(a); + }, /`Ember.Binding` is deprecated/); + }); + + _internalTestHelpers.testBoth('Connecting a binding between two objects', function (get, set) { + var b = { bar: 'BAR' }; + var a = { foo: 'FOO', b: b }; + + // b.bar -> a.foo + var binding = new _emberMetalBinding.Binding('foo', 'b.bar'); + + expectDeprecation(function () { + performTest(binding, a, b, get, set); + }, /`Ember\.Binding` is deprecated./); + }); + + _internalTestHelpers.testBoth('Connecting a binding to path', function (get, set) { + var a = { foo: 'FOO' }; + lookup['GlobalB'] = GlobalB = { + b: { bar: 'BAR' } + }; + + var b = get(GlobalB, 'b'); + + // globalB.b.bar -> a.foo + var binding = new _emberMetalBinding.Binding('foo', 'GlobalB.b.bar'); + + expectDeprecation(function () { + performTest(binding, a, b, get, set); + }, /`Ember\.Binding` is deprecated./); + + // make sure modifications update + b = { bar: 'BIFF' }; + + _emberMetalRun_loop.default(function () { + return set(GlobalB, 'b', b); + }); + + equal(get(a, 'foo'), 'BIFF', 'a should have changed'); + }); + + _internalTestHelpers.testBoth('Calling connect more than once', function (get, set) { + var b = { bar: 'BAR' }; + var a = { foo: 'FOO', b: b }; + + // b.bar -> a.foo + var binding = new _emberMetalBinding.Binding('foo', 'b.bar'); + + expectDeprecation(function () { + performTest(binding, a, b, get, set, function () { + binding.connect(a); + binding.connect(a); + }); + }, /`Ember\.Binding` is deprecated./); + }); + + QUnit.test('inherited bindings should sync on create', function () { + var a = undefined; + _emberMetalRun_loop.default(function () { + function A() { + _emberMetalBinding.bind(this, 'foo', 'bar.baz'); + } + + expectDeprecation(function () { + return a = new A(); + }, /`Ember\.Binding` is deprecated/); + + _emberMetalProperty_set.set(a, 'bar', { baz: 'BAZ' }); + }); + + equal(_emberMetalProperty_get.get(a, 'foo'), 'BAZ', 'should have synced binding on new obj'); + }); +}); +enifed('ember-metal/tests/binding/connect_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/binding'); + test('ember-metal/tests/binding/connect_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/binding/connect_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/binding/connect_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/binding'); + QUnit.test('ember-metal/tests/binding/connect_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/binding/connect_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/binding/sync_test', ['exports', 'internal-test-helpers', 'ember-metal/run_loop', 'ember-metal/observer', 'ember-metal/binding', 'ember-metal/computed', 'ember-metal/properties', 'ember-metal/property_events'], function (exports, _internalTestHelpers, _emberMetalRun_loop, _emberMetalObserver, _emberMetalBinding, _emberMetalComputed, _emberMetalProperties, _emberMetalProperty_events) { + 'use strict'; + + QUnit.module('system/binding/sync_test.js'); + + _internalTestHelpers.testBoth('bindings should not sync twice in a single run loop', function (get, set) { + var a = undefined, + b = undefined, + setValue = undefined; + var setCalled = 0; + var getCalled = 0; + + _emberMetalRun_loop.default(function () { + a = {}; + + _emberMetalProperties.defineProperty(a, 'foo', _emberMetalComputed.computed({ + get: function (key) { + getCalled++; + return setValue; + }, + set: function (key, value) { + setCalled++; + _emberMetalProperty_events.propertyWillChange(this, key); + setValue = value; + _emberMetalProperty_events.propertyDidChange(this, key); + return value; + } + }).volatile()); + + b = { + a: a + }; + + expectDeprecation(function () { + return _emberMetalBinding.bind(b, 'foo', 'a.foo'); + }, /`Ember.Binding` is deprecated/); + }); + + // reset after initial binding synchronization + getCalled = 0; + + _emberMetalRun_loop.default(function () { + set(a, 'foo', 'trollface'); + }); + + equal(get(b, 'foo'), 'trollface', 'the binding should sync'); + equal(setCalled, 1, 'Set should only be called once'); + equal(getCalled, 1, 'Get should only be called once'); + }); + + _internalTestHelpers.testBoth('bindings should not infinite loop if computed properties return objects', function (get, set) { + var a = undefined, + b = undefined; + var getCalled = 0; + + _emberMetalRun_loop.default(function () { + a = {}; + + _emberMetalProperties.defineProperty(a, 'foo', _emberMetalComputed.computed(function () { + getCalled++; + if (getCalled > 1000) { + throw 'infinite loop detected'; + } + return ['foo', 'bar']; + })); + + b = { + a: a + }; + + expectDeprecation(function () { + return _emberMetalBinding.bind(b, 'foo', 'a.foo'); + }, /`Ember.Binding` is deprecated/); + }); + + deepEqual(get(b, 'foo'), ['foo', 'bar'], 'the binding should sync'); + equal(getCalled, 1, 'Get should only be called once'); + }); + + _internalTestHelpers.testBoth('bindings should do the right thing when observers trigger bindings in the opposite direction', function (get, set) { + var a = undefined, + b = undefined, + c = undefined; + + _emberMetalRun_loop.default(function () { + a = { + foo: 'trololol' + }; + + b = { + a: a + }; + + var deprecationMessage = /`Ember.Binding` is deprecated/; + + expectDeprecation(function () { + return _emberMetalBinding.bind(b, 'foo', 'a.foo'); + }, deprecationMessage); + + c = { + a: a + }; + + expectDeprecation(function () { + _emberMetalBinding.bind(c, 'foo', 'a.foo'); + }, deprecationMessage); + }); + + _emberMetalObserver.addObserver(b, 'foo', function () { + return set(c, 'foo', 'what is going on'); + }); + + _emberMetalRun_loop.default(function () { + return set(a, 'foo', 'trollface'); + }); + + equal(get(a, 'foo'), 'what is going on'); + }); + + _internalTestHelpers.testBoth('bindings should not try to sync destroyed objects', function (get, set) { + var a = undefined, + b = undefined; + + _emberMetalRun_loop.default(function () { + a = { + foo: 'trololol' + }; + + b = { + a: a + }; + + var deprecationMessage = /`Ember.Binding` is deprecated/; + + expectDeprecation(function () { + return _emberMetalBinding.bind(b, 'foo', 'a.foo'); + }, deprecationMessage); + }); + + _emberMetalRun_loop.default(function () { + set(a, 'foo', 'trollface'); + set(b, 'isDestroyed', true); + ok(true, 'should not raise'); + }); + + _emberMetalRun_loop.default(function () { + a = { + foo: 'trololol' + }; + + b = { + a: a + }; + + var deprecationMessage = /`Ember.Binding` is deprecated/; + + expectDeprecation(function () { + return _emberMetalBinding.bind(b, 'foo', 'a.foo'); + }, deprecationMessage); + }); + + _emberMetalRun_loop.default(function () { + set(b, 'foo', 'trollface'); + set(a, 'isDestroyed', true); + ok(true, 'should not raise'); + }); + }); +}); +enifed('ember-metal/tests/binding/sync_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/binding'); + test('ember-metal/tests/binding/sync_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/binding/sync_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/binding/sync_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/binding'); + QUnit.test('ember-metal/tests/binding/sync_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/binding/sync_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/cache_test', ['exports', 'ember-metal/cache'], function (exports, _emberMetalCache) { + 'use strict'; + + QUnit.module('Cache'); + + QUnit.test('basic', function () { + var cache = new _emberMetalCache.default(100, function (key) { + return key.toUpperCase(); + }); + + equal(cache.get('foo'), 'FOO'); + equal(cache.get('bar'), 'BAR'); + equal(cache.get('foo'), 'FOO'); + }); + + QUnit.test('explicit sets', function () { + var cache = new _emberMetalCache.default(100, function (key) { + return key.toUpperCase(); + }); + + equal(cache.get('foo'), 'FOO'); + + equal(cache.set('foo', 'FOO!!!'), 'FOO!!!'); + + equal(cache.get('foo'), 'FOO!!!'); + + strictEqual(cache.set('foo', undefined), undefined); + + strictEqual(cache.get('foo'), undefined); + }); + + QUnit.test('caches computation correctly', function () { + var count = 0; + var cache = new _emberMetalCache.default(100, function (key) { + count++; + return key.toUpperCase(); + }); + + equal(count, 0); + cache.get('foo'); + equal(count, 1); + cache.get('bar'); + equal(count, 2); + cache.get('bar'); + equal(count, 2); + cache.get('foo'); + equal(count, 2); + }); + + QUnit.test('caches computation correctly with custom cache keys', function () { + var count = 0; + var cache = new _emberMetalCache.default(100, function (obj) { + count++; + return obj.value.toUpperCase(); + }, function (obj) { + return obj.key; + }); + + equal(count, 0); + cache.get({ key: 'foo', value: 'foo' }); + equal(count, 1); + cache.get({ key: 'bar', value: 'bar' }); + equal(count, 2); + cache.get({ key: 'bar', value: 'bar' }); + equal(count, 2); + cache.get({ key: 'foo', value: 'foo' }); + equal(count, 2); + }); + + QUnit.test('handles undefined value correctly', function () { + var count = 0; + var cache = new _emberMetalCache.default(100, function (key) { + count++; + }); + + equal(count, 0); + strictEqual(cache.get('foo'), undefined); + equal(count, 1); + strictEqual(cache.get('bar'), undefined); + equal(count, 2); + strictEqual(cache.get('bar'), undefined); + equal(count, 2); + strictEqual(cache.get('foo'), undefined); + equal(count, 2); + }); + + QUnit.test('continues working after reaching cache limit', function () { + var cache = new _emberMetalCache.default(3, function (key) { + return key.toUpperCase(); + }); + + cache.get('a'); + cache.get('b'); + cache.get('c'); + + equal(cache.get('d'), 'D'); + equal(cache.get('a'), 'A'); + equal(cache.get('b'), 'B'); + equal(cache.get('c'), 'C'); + }); +}); +enifed('ember-metal/tests/cache_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/cache_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/cache_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/cache_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/cache_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/cache_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/chains_test', ['exports', 'ember-metal/observer', 'ember-metal/property_get', 'ember-metal/chains', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/property_events', 'ember-metal/meta'], function (exports, _emberMetalObserver, _emberMetalProperty_get, _emberMetalChains, _emberMetalProperties, _emberMetalComputed, _emberMetalProperty_events, _emberMetalMeta) { + 'use strict'; + + QUnit.module('Chains'); + + QUnit.test('finishChains should properly copy chains from prototypes to instances', function () { + function didChange() {} + + var obj = {}; + _emberMetalObserver.addObserver(obj, 'foo.bar', null, didChange); + + var childObj = Object.create(obj); + _emberMetalChains.finishChains(childObj); + ok(_emberMetalMeta.peekMeta(obj) !== _emberMetalMeta.peekMeta(childObj).readableChains(), 'The chains object is copied'); + }); + + QUnit.test('does not observe primative values', function (assert) { + var obj = { + foo: { bar: 'STRING' } + }; + + _emberMetalObserver.addObserver(obj, 'foo.bar.baz', null, function () {}); + var meta = _emberMetalMeta.peekMeta(obj); + assert.notOk(meta._object); + }); + + QUnit.test('observer and CP chains', function () { + var obj = {}; + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.default('qux.[]', function () {})); + _emberMetalProperties.defineProperty(obj, 'qux', _emberMetalComputed.default(function () {})); + + // create DK chains + _emberMetalProperty_get.get(obj, 'foo'); + + // create observer chain + _emberMetalObserver.addObserver(obj, 'qux.length', function () {}); + + /* + +-----+ + | qux | root CP + +-----+ + ^ + +------+-----+ + | | + +--------+ +----+ + | length | | [] | chainWatchers + +--------+ +----+ + observer CP(foo, 'qux.[]') + */ + + // invalidate qux + _emberMetalProperty_events.propertyDidChange(obj, 'qux'); + + // CP chain is blown away + + /* + +-----+ + | qux | root CP + +-----+ + ^ + +------+xxxxxx + | x + +--------+ xxxxxx + | length | x [] x chainWatchers + +--------+ xxxxxx + observer CP(foo, 'qux.[]') + */ + + _emberMetalProperty_get.get(obj, 'qux'); // CP chain re-recreated + ok(true, 'no crash'); + }); +}); +enifed('ember-metal/tests/chains_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/chains_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/chains_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/chains_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/chains_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/chains_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/computed_test', ['exports', 'ember-runtime', 'internal-test-helpers', 'ember-metal/computed', 'ember-metal/properties', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/watching', 'ember-metal/observer'], function (exports, _emberRuntime, _internalTestHelpers, _emberMetalComputed, _emberMetalProperties, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalWatching, _emberMetalObserver) { + 'use strict'; + + var obj = undefined, + count = undefined; + + QUnit.module('computed'); + + QUnit.test('computed property should be an instance of descriptor', function () { + ok(_emberMetalComputed.computed(function () {}) instanceof _emberMetalProperties.Descriptor); + }); + + QUnit.test('computed properties assert the presence of a getter or setter function', function () { + expectAssertion(function () { + _emberMetalComputed.computed('nogetternorsetter', {}); + }, 'Computed properties must receive a getter or a setter, you passed none.'); + }); + + QUnit.test('computed properties check for the presence of a function or configuration object', function () { + expectAssertion(function () { + _emberMetalComputed.computed('nolastargument'); + }, 'Ember.computed expects a function or an object as last argument.'); + }); + + QUnit.test('computed properties defined with an object only allow `get` and `set` keys', function () { + expectAssertion(function () { + _emberMetalComputed.computed({ + get: function () {}, + set: function () {}, + other: function () {} + }); + }, 'Config object passed to an Ember.computed can only contain `get` or `set` keys.'); + }); + + QUnit.test('defining computed property should invoke property on get', function () { + var obj = {}; + var count = 0; + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed(function (key) { + count++; + return 'computed ' + key; + })); + + equal(_emberMetalProperty_get.get(obj, 'foo'), 'computed foo', 'should return value'); + equal(count, 1, 'should have invoked computed property'); + }); + + QUnit.test('defining computed property should invoke property on set', function () { + var obj = {}; + var count = 0; + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed({ + get: function (key) { + return this['__' + key]; + }, + set: function (key, value) { + count++; + this['__' + key] = 'computed ' + value; + return this['__' + key]; + } + })); + + equal(_emberMetalProperty_set.set(obj, 'foo', 'bar'), 'bar', 'should return set value'); + equal(count, 1, 'should have invoked computed property'); + equal(_emberMetalProperty_get.get(obj, 'foo'), 'computed bar', 'should return new value'); + }); + + QUnit.test('defining a computed property with a dependent key ending with @each is expanded to []', function () { + var cp = _emberMetalComputed.computed('blazo.@each', function () {}); + + deepEqual(cp._dependentKeys, ['blazo.[]']); + + cp = _emberMetalComputed.computed('qux', 'zoopa.@each', function () {}); + + deepEqual(cp._dependentKeys, ['qux', 'zoopa.[]']); + }); + + QUnit.test('defining a computed property with a dependent key more than one level deep beyond @each is not supported', function () { + expectNoWarning(function () { + _emberMetalComputed.computed('todos', function () {}); + }); + + expectNoWarning(function () { + _emberMetalComputed.computed('todos.@each.owner', function () {}); + }); + + expectWarning(function () { + _emberMetalComputed.computed('todos.@each.owner.name', function () {}); + }, /You used the key "todos\.@each\.owner\.name" which is invalid\. /); + + expectWarning(function () { + _emberMetalComputed.computed('todos.@each.owner.@each.name', function () {}); + }, /You used the key "todos\.@each\.owner\.@each\.name" which is invalid\. /); + }); + + var objA = undefined, + objB = undefined; + QUnit.module('computed should inherit through prototype', { + setup: function () { + objA = { __foo: 'FOO' }; + _emberMetalProperties.defineProperty(objA, 'foo', _emberMetalComputed.computed({ + get: function (key) { + return this['__' + key]; + }, + set: function (key, value) { + this['__' + key] = 'computed ' + value; + return this['__' + key]; + } + })); + + objB = Object.create(objA); + objB.__foo = 'FOO'; // make a copy; + }, + + teardown: function () { + objA = objB = null; + } + }); + + _internalTestHelpers.testBoth('using get() and set()', function (get, set) { + equal(get(objA, 'foo'), 'FOO', 'should get FOO from A'); + equal(get(objB, 'foo'), 'FOO', 'should get FOO from B'); + + set(objA, 'foo', 'BIFF'); + equal(get(objA, 'foo'), 'computed BIFF', 'should change A'); + equal(get(objB, 'foo'), 'FOO', 'should NOT change B'); + + set(objB, 'foo', 'bar'); + equal(get(objB, 'foo'), 'computed bar', 'should change B'); + equal(get(objA, 'foo'), 'computed BIFF', 'should NOT change A'); + + set(objA, 'foo', 'BAZ'); + equal(get(objA, 'foo'), 'computed BAZ', 'should change A'); + equal(get(objB, 'foo'), 'computed bar', 'should NOT change B'); + }); + + QUnit.module('redefining computed property to normal', { + setup: function () { + objA = { __foo: 'FOO' }; + _emberMetalProperties.defineProperty(objA, 'foo', _emberMetalComputed.computed({ + get: function (key) { + return this['__' + key]; + }, + set: function (key, value) { + this['__' + key] = 'computed ' + value; + return this['__' + key]; + } + })); + + objB = Object.create(objA); + _emberMetalProperties.defineProperty(objB, 'foo'); // make this just a normal property. + }, + + teardown: function () { + objA = objB = null; + } + }); + + _internalTestHelpers.testBoth('using get() and set()', function (get, set) { + equal(get(objA, 'foo'), 'FOO', 'should get FOO from A'); + equal(get(objB, 'foo'), undefined, 'should get undefined from B'); + + set(objA, 'foo', 'BIFF'); + equal(get(objA, 'foo'), 'computed BIFF', 'should change A'); + equal(get(objB, 'foo'), undefined, 'should NOT change B'); + + set(objB, 'foo', 'bar'); + equal(get(objB, 'foo'), 'bar', 'should change B'); + equal(get(objA, 'foo'), 'computed BIFF', 'should NOT change A'); + + set(objA, 'foo', 'BAZ'); + equal(get(objA, 'foo'), 'computed BAZ', 'should change A'); + equal(get(objB, 'foo'), 'bar', 'should NOT change B'); + }); + + QUnit.module('redefining computed property to another property', { + setup: function () { + objA = { __foo: 'FOO' }; + _emberMetalProperties.defineProperty(objA, 'foo', _emberMetalComputed.computed({ + get: function (key) { + return this['__' + key]; + }, + set: function (key, value) { + this['__' + key] = 'A ' + value; + return this['__' + key]; + } + })); + + objB = Object.create(objA); + objB.__foo = 'FOO'; + _emberMetalProperties.defineProperty(objB, 'foo', _emberMetalComputed.computed({ + get: function (key) { + return this['__' + key]; + }, + set: function (key, value) { + this['__' + key] = 'B ' + value; + return this['__' + key]; + } + })); + }, + + teardown: function () { + objA = objB = null; + } + }); + + _internalTestHelpers.testBoth('using get() and set()', function (get, set) { + equal(get(objA, 'foo'), 'FOO', 'should get FOO from A'); + equal(get(objB, 'foo'), 'FOO', 'should get FOO from B'); + + set(objA, 'foo', 'BIFF'); + equal(get(objA, 'foo'), 'A BIFF', 'should change A'); + equal(get(objB, 'foo'), 'FOO', 'should NOT change B'); + + set(objB, 'foo', 'bar'); + equal(get(objB, 'foo'), 'B bar', 'should change B'); + equal(get(objA, 'foo'), 'A BIFF', 'should NOT change A'); + + set(objA, 'foo', 'BAZ'); + equal(get(objA, 'foo'), 'A BAZ', 'should change A'); + equal(get(objB, 'foo'), 'B bar', 'should NOT change B'); + }); + + QUnit.module('computed - metadata'); + + QUnit.test('can set metadata on a computed property', function () { + var computedProperty = _emberMetalComputed.computed(function () {}); + computedProperty.meta({ key: 'keyValue' }); + + equal(computedProperty.meta().key, 'keyValue', 'saves passed meta hash to the _meta property'); + }); + + QUnit.test('meta should return an empty hash if no meta is set', function () { + var computedProperty = _emberMetalComputed.computed(function () {}); + deepEqual(computedProperty.meta(), {}, 'returned value is an empty hash'); + }); + + // .......................................................... + // CACHEABLE + // + + QUnit.module('computed - cacheable', { + setup: function () { + obj = {}; + count = 0; + var func = function (key, value) { + count++; + return 'bar ' + count; + }; + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed({ get: func, set: func })); + }, + + teardown: function () { + obj = count = null; + } + }); + + _internalTestHelpers.testBoth('cacheable should cache', function (get, set) { + equal(get(obj, 'foo'), 'bar 1', 'first get'); + equal(get(obj, 'foo'), 'bar 1', 'second get'); + equal(count, 1, 'should only invoke once'); + }); + + _internalTestHelpers.testBoth('modifying a cacheable property should update cache', function (get, set) { + equal(get(obj, 'foo'), 'bar 1', 'first get'); + equal(get(obj, 'foo'), 'bar 1', 'second get'); + + equal(set(obj, 'foo', 'baz'), 'baz', 'setting'); + equal(get(obj, 'foo'), 'bar 2', 'third get'); + equal(count, 2, 'should not invoke again'); + }); + + _internalTestHelpers.testBoth('inherited property should not pick up cache', function (get, set) { + var objB = Object.create(obj); + + equal(get(obj, 'foo'), 'bar 1', 'obj first get'); + equal(get(objB, 'foo'), 'bar 2', 'objB first get'); + + equal(get(obj, 'foo'), 'bar 1', 'obj second get'); + equal(get(objB, 'foo'), 'bar 2', 'objB second get'); + + set(obj, 'foo', 'baz'); // modify A + equal(get(obj, 'foo'), 'bar 3', 'obj third get'); + equal(get(objB, 'foo'), 'bar 2', 'objB third get'); + }); + + _internalTestHelpers.testBoth('cacheFor should return the cached value', function (get, set) { + equal(_emberMetalComputed.cacheFor(obj, 'foo'), undefined, 'should not yet be a cached value'); + + get(obj, 'foo'); + + equal(_emberMetalComputed.cacheFor(obj, 'foo'), 'bar 1', 'should retrieve cached value'); + }); + + _internalTestHelpers.testBoth('cacheFor should return falsy cached values', function (get, set) { + _emberMetalProperties.defineProperty(obj, 'falsy', _emberMetalComputed.computed(function () { + return false; + })); + + equal(_emberMetalComputed.cacheFor(obj, 'falsy'), undefined, 'should not yet be a cached value'); + + get(obj, 'falsy'); + + equal(_emberMetalComputed.cacheFor(obj, 'falsy'), false, 'should retrieve cached value'); + }); + + _internalTestHelpers.testBoth('setting a cached computed property passes the old value as the third argument', function (get, set) { + var obj = { + foo: 0 + }; + + var receivedOldValue = undefined; + + _emberMetalProperties.defineProperty(obj, 'plusOne', _emberMetalComputed.computed({ + get: function () {}, + set: function (key, value, oldValue) { + receivedOldValue = oldValue; + return value; + } }).property('foo')); + + set(obj, 'plusOne', 1); + strictEqual(receivedOldValue, undefined, 'oldValue should be undefined'); + + set(obj, 'plusOne', 2); + strictEqual(receivedOldValue, 1, 'oldValue should be 1'); + + set(obj, 'plusOne', 3); + strictEqual(receivedOldValue, 2, 'oldValue should be 2'); + }); + + // .......................................................... + // DEPENDENT KEYS + // + + QUnit.module('computed - dependentkey', { + setup: function () { + obj = { bar: 'baz' }; + count = 0; + var getterAndSetter = function (key, value) { + count++; + _emberMetalProperty_get.get(this, 'bar'); + return 'bar ' + count; + }; + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed({ + get: getterAndSetter, + set: getterAndSetter + }).property('bar')); + }, + + teardown: function () { + obj = count = null; + } + }); + + _internalTestHelpers.testBoth('should lazily watch dependent keys on set', function (get, set) { + equal(_emberMetalWatching.isWatching(obj, 'bar'), false, 'precond not watching dependent key'); + set(obj, 'foo', 'bar'); + equal(_emberMetalWatching.isWatching(obj, 'bar'), true, 'lazily watching dependent key'); + }); + + _internalTestHelpers.testBoth('should lazily watch dependent keys on get', function (get, set) { + equal(_emberMetalWatching.isWatching(obj, 'bar'), false, 'precond not watching dependent key'); + get(obj, 'foo'); + equal(_emberMetalWatching.isWatching(obj, 'bar'), true, 'lazily watching dependent key'); + }); + + _internalTestHelpers.testBoth('local dependent key should invalidate cache', function (get, set) { + equal(_emberMetalWatching.isWatching(obj, 'bar'), false, 'precond not watching dependent key'); + equal(get(obj, 'foo'), 'bar 1', 'get once'); + equal(_emberMetalWatching.isWatching(obj, 'bar'), true, 'lazily setup watching dependent key'); + equal(get(obj, 'foo'), 'bar 1', 'cached retrieve'); + + set(obj, 'bar', 'BIFF'); // should invalidate foo + + equal(get(obj, 'foo'), 'bar 2', 'should recache'); + equal(get(obj, 'foo'), 'bar 2', 'cached retrieve'); + }); + + _internalTestHelpers.testBoth('should invalidate multiple nested dependent keys', function (get, set) { + var count = 0; + _emberMetalProperties.defineProperty(obj, 'bar', _emberMetalComputed.computed(function () { + count++; + get(this, 'baz'); + return 'baz ' + count; + }).property('baz')); + + equal(_emberMetalWatching.isWatching(obj, 'bar'), false, 'precond not watching dependent key'); + equal(_emberMetalWatching.isWatching(obj, 'baz'), false, 'precond not watching dependent key'); + equal(get(obj, 'foo'), 'bar 1', 'get once'); + equal(_emberMetalWatching.isWatching(obj, 'bar'), true, 'lazily setup watching dependent key'); + equal(_emberMetalWatching.isWatching(obj, 'baz'), true, 'lazily setup watching dependent key'); + equal(get(obj, 'foo'), 'bar 1', 'cached retrieve'); + + set(obj, 'baz', 'BIFF'); // should invalidate bar -> foo + equal(_emberMetalWatching.isWatching(obj, 'bar'), false, 'should not be watching dependent key after cache cleared'); + equal(_emberMetalWatching.isWatching(obj, 'baz'), false, 'should not be watching dependent key after cache cleared'); + + equal(get(obj, 'foo'), 'bar 2', 'should recache'); + equal(get(obj, 'foo'), 'bar 2', 'cached retrieve'); + equal(_emberMetalWatching.isWatching(obj, 'bar'), true, 'lazily setup watching dependent key'); + equal(_emberMetalWatching.isWatching(obj, 'baz'), true, 'lazily setup watching dependent key'); + }); + + _internalTestHelpers.testBoth('circular keys should not blow up', function (get, set) { + var func = function (key, value) { + count++; + return 'bar ' + count; + }; + _emberMetalProperties.defineProperty(obj, 'bar', _emberMetalComputed.computed({ get: func, set: func }).property('foo')); + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed(function (key) { + count++; + return 'foo ' + count; + }).property('bar')); + + equal(get(obj, 'foo'), 'foo 1', 'get once'); + equal(get(obj, 'foo'), 'foo 1', 'cached retrieve'); + + set(obj, 'bar', 'BIFF'); // should invalidate bar -> foo -> bar + + equal(get(obj, 'foo'), 'foo 3', 'should recache'); + equal(get(obj, 'foo'), 'foo 3', 'cached retrieve'); + }); + + _internalTestHelpers.testBoth('redefining a property should undo old dependent keys', function (get, set) { + equal(_emberMetalWatching.isWatching(obj, 'bar'), false, 'precond not watching dependent key'); + equal(get(obj, 'foo'), 'bar 1'); + equal(_emberMetalWatching.isWatching(obj, 'bar'), true, 'lazily watching dependent key'); + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed(function () { + count++; + return 'baz ' + count; + }).property('baz')); + + equal(_emberMetalWatching.isWatching(obj, 'bar'), false, 'after redefining should not be watching dependent key'); + + equal(get(obj, 'foo'), 'baz 2'); + + set(obj, 'bar', 'BIFF'); // should not kill cache + equal(get(obj, 'foo'), 'baz 2'); + + set(obj, 'baz', 'BOP'); + equal(get(obj, 'foo'), 'baz 3'); + }); + + _internalTestHelpers.testBoth('can watch multiple dependent keys specified declaratively via brace expansion', function (get, set) { + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed(function (key) { + count++; + return 'foo ' + count; + }).property('qux.{bar,baz}')); + + equal(get(obj, 'foo'), 'foo 1', 'get once'); + equal(get(obj, 'foo'), 'foo 1', 'cached retrieve'); + + set(obj, 'qux', {}); + set(obj, 'qux.bar', 'bar'); // invalidate foo + + equal(get(obj, 'foo'), 'foo 2', 'foo invalidated from bar'); + + set(obj, 'qux.baz', 'baz'); // invalidate foo + + equal(get(obj, 'foo'), 'foo 3', 'foo invalidated from baz'); + + set(obj, 'qux.quux', 'quux'); // do not invalidate foo + + equal(get(obj, 'foo'), 'foo 3', 'foo not invalidated by quux'); + }); + + _internalTestHelpers.testBoth('throws assertion if brace expansion notation has spaces', function (get, set) { + expectAssertion(function () { + _emberMetalProperties.defineProperty(obj, 'roo', _emberMetalComputed.computed(function (key) { + count++; + return 'roo ' + count; + }).property('fee.{bar, baz,bop , }')); + }, /cannot contain spaces/); + }); + + // .......................................................... + // CHAINED DEPENDENT KEYS + // + + var func = undefined; + var moduleOpts = { + setup: function () { + obj = { + foo: { + bar: { + baz: { + biff: 'BIFF' + } + } + } + }; + + count = 0; + func = function () { + count++; + return _emberMetalProperty_get.get(obj, 'foo.bar.baz.biff') + ' ' + count; + }; + }, + + teardown: function () { + obj = count = func = null; + } + }; + + QUnit.module('computed - dependentkey with chained properties', moduleOpts); + + _internalTestHelpers.testBoth('depending on simple chain', function (get, set) { + // assign computed property + _emberMetalProperties.defineProperty(obj, 'prop', _emberMetalComputed.computed(func).property('foo.bar.baz.biff')); + + equal(get(obj, 'prop'), 'BIFF 1'); + + set(get(obj, 'foo.bar.baz'), 'biff', 'BUZZ'); + equal(get(obj, 'prop'), 'BUZZ 2'); + equal(get(obj, 'prop'), 'BUZZ 2'); + + set(get(obj, 'foo.bar'), 'baz', { biff: 'BLOB' }); + equal(get(obj, 'prop'), 'BLOB 3'); + equal(get(obj, 'prop'), 'BLOB 3'); + + set(get(obj, 'foo.bar.baz'), 'biff', 'BUZZ'); + equal(get(obj, 'prop'), 'BUZZ 4'); + equal(get(obj, 'prop'), 'BUZZ 4'); + + set(get(obj, 'foo'), 'bar', { baz: { biff: 'BOOM' } }); + equal(get(obj, 'prop'), 'BOOM 5'); + equal(get(obj, 'prop'), 'BOOM 5'); + + set(get(obj, 'foo.bar.baz'), 'biff', 'BUZZ'); + equal(get(obj, 'prop'), 'BUZZ 6'); + equal(get(obj, 'prop'), 'BUZZ 6'); + + set(obj, 'foo', { bar: { baz: { biff: 'BLARG' } } }); + equal(get(obj, 'prop'), 'BLARG 7'); + equal(get(obj, 'prop'), 'BLARG 7'); + + set(get(obj, 'foo.bar.baz'), 'biff', 'BUZZ'); + equal(get(obj, 'prop'), 'BUZZ 8'); + equal(get(obj, 'prop'), 'BUZZ 8'); + + _emberMetalProperties.defineProperty(obj, 'prop'); + set(obj, 'prop', 'NONE'); + equal(get(obj, 'prop'), 'NONE'); + + set(obj, 'foo', { bar: { baz: { biff: 'BLARG' } } }); + equal(get(obj, 'prop'), 'NONE'); // should do nothing + equal(count, 8, 'should be not have invoked computed again'); + }); + + _internalTestHelpers.testBoth('chained dependent keys should evaluate computed properties lazily', function (get, set) { + _emberMetalProperties.defineProperty(obj.foo.bar, 'b', _emberMetalComputed.computed(func)); + _emberMetalProperties.defineProperty(obj.foo, 'c', _emberMetalComputed.computed(function () {}).property('bar.b')); + equal(count, 0, 'b should not run'); + }); + + // .......................................................... + // improved-cp-syntax + // + + QUnit.module('computed - improved cp syntax'); + + QUnit.test('setter and getters are passed using an object', function () { + var testObj = _emberRuntime.Object.extend({ + a: '1', + b: '2', + aInt: _emberMetalComputed.computed('a', { + get: function (keyName) { + equal(keyName, 'aInt', 'getter receives the keyName'); + return parseInt(this.get('a')); + }, + set: function (keyName, value, oldValue) { + equal(keyName, 'aInt', 'setter receives the keyName'); + equal(value, 123, 'setter receives the new value'); + equal(oldValue, 1, 'setter receives the old value'); + this.set('a', '' + value); // side effect + return parseInt(this.get('a')); + } + }) + }).create(); + + ok(testObj.get('aInt') === 1, 'getter works'); + testObj.set('aInt', 123); + ok(testObj.get('a') === '123', 'setter works'); + ok(testObj.get('aInt') === 123, 'cp has been updated too'); + }); + + QUnit.test('setter can be omited', function () { + var testObj = _emberRuntime.Object.extend({ + a: '1', + b: '2', + aInt: _emberMetalComputed.computed('a', { + get: function (keyName) { + equal(keyName, 'aInt', 'getter receives the keyName'); + return parseInt(this.get('a')); + } + }) + }).create(); + + ok(testObj.get('aInt') === 1, 'getter works'); + ok(testObj.get('a') === '1'); + testObj.set('aInt', '123'); + ok(testObj.get('aInt') === '123', 'cp has been updated too'); + }); + + QUnit.test('the return value of the setter gets cached', function () { + var testObj = _emberRuntime.Object.extend({ + a: '1', + sampleCP: _emberMetalComputed.computed('a', { + get: function (keyName) { + ok(false, 'The getter should not be invoked'); + return 'get-value'; + }, + set: function (keyName, value, oldValue) { + return 'set-value'; + } + }) + }).create(); + + testObj.set('sampleCP', 'abcd'); + ok(testObj.get('sampleCP') === 'set-value', 'The return value of the CP was cached'); + }); + + // .......................................................... + // BUGS + // + + QUnit.module('computed edge cases'); + + QUnit.test('adding a computed property should show up in key iteration', function () { + var obj = {}; + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed(function () {})); + + var found = []; + for (var key in obj) { + found.push(key); + } + ok(found.indexOf('foo') >= 0, 'should find computed property in iteration found=' + found); + ok('foo' in obj, 'foo in obj should pass'); + }); + + _internalTestHelpers.testBoth('when setting a value after it had been retrieved empty don\'t pass function UNDEFINED as oldValue', function (get, set) { + var obj = {}; + var oldValueIsNoFunction = true; + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed({ + get: function () {}, + set: function (key, value, oldValue) { + if (typeof oldValue === 'function') { + oldValueIsNoFunction = false; + } + return undefined; + } + })); + + get(obj, 'foo'); + set(obj, 'foo', undefined); + + ok(oldValueIsNoFunction); + }); + + QUnit.module('computed - setter'); + + _internalTestHelpers.testBoth('setting a watched computed property', function (get, set) { + var obj = { + firstName: 'Yehuda', + lastName: 'Katz' + }; + _emberMetalProperties.defineProperty(obj, 'fullName', _emberMetalComputed.computed({ + get: function () { + return get(this, 'firstName') + ' ' + get(this, 'lastName'); + }, + set: function (key, value) { + var values = value.split(' '); + set(this, 'firstName', values[0]); + set(this, 'lastName', values[1]); + return value; + } + }).property('firstName', 'lastName')); + var fullNameWillChange = 0; + var fullNameDidChange = 0; + var firstNameWillChange = 0; + var firstNameDidChange = 0; + var lastNameWillChange = 0; + var lastNameDidChange = 0; + _emberMetalObserver._addBeforeObserver(obj, 'fullName', function () { + fullNameWillChange++; + }); + _emberMetalObserver.addObserver(obj, 'fullName', function () { + fullNameDidChange++; + }); + _emberMetalObserver._addBeforeObserver(obj, 'firstName', function () { + firstNameWillChange++; + }); + _emberMetalObserver.addObserver(obj, 'firstName', function () { + firstNameDidChange++; + }); + _emberMetalObserver._addBeforeObserver(obj, 'lastName', function () { + lastNameWillChange++; + }); + _emberMetalObserver.addObserver(obj, 'lastName', function () { + lastNameDidChange++; + }); + + equal(get(obj, 'fullName'), 'Yehuda Katz'); + + set(obj, 'fullName', 'Yehuda Katz'); + + set(obj, 'fullName', 'Kris Selden'); + + equal(get(obj, 'fullName'), 'Kris Selden'); + equal(get(obj, 'firstName'), 'Kris'); + equal(get(obj, 'lastName'), 'Selden'); + + equal(fullNameWillChange, 1); + equal(fullNameDidChange, 1); + equal(firstNameWillChange, 1); + equal(firstNameDidChange, 1); + equal(lastNameWillChange, 1); + equal(lastNameDidChange, 1); + }); + + _internalTestHelpers.testBoth('setting a cached computed property that modifies the value you give it', function (get, set) { + var obj = { + foo: 0 + }; + _emberMetalProperties.defineProperty(obj, 'plusOne', _emberMetalComputed.computed({ + get: function (key) { + return get(this, 'foo') + 1; + }, + set: function (key, value) { + set(this, 'foo', value); + return value + 1; + } + }).property('foo')); + var plusOneWillChange = 0; + var plusOneDidChange = 0; + _emberMetalObserver._addBeforeObserver(obj, 'plusOne', function () { + plusOneWillChange++; + }); + _emberMetalObserver.addObserver(obj, 'plusOne', function () { + plusOneDidChange++; + }); + + equal(get(obj, 'plusOne'), 1); + set(obj, 'plusOne', 1); + equal(get(obj, 'plusOne'), 2); + set(obj, 'plusOne', 1); + equal(get(obj, 'plusOne'), 2); + + equal(plusOneWillChange, 1); + equal(plusOneDidChange, 1); + + set(obj, 'foo', 5); + equal(get(obj, 'plusOne'), 6); + + equal(plusOneWillChange, 2); + equal(plusOneDidChange, 2); + }); + + QUnit.module('computed - default setter'); + + _internalTestHelpers.testBoth('when setting a value on a computed property that doesn\'t handle sets', function (get, set) { + var obj = {}; + var observerFired = false; + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed(function () { + return 'foo'; + })); + + _emberMetalObserver.addObserver(obj, 'foo', null, function () { + return observerFired = true; + }); + + set(obj, 'foo', 'bar'); + + equal(get(obj, 'foo'), 'bar', 'The set value is properly returned'); + ok(typeof obj.foo === 'string', 'The computed property was removed'); + ok(observerFired, 'The observer was still notified'); + }); + + QUnit.module('computed - readOnly'); + + QUnit.test('is chainable', function () { + var cp = _emberMetalComputed.computed(function () {}).readOnly(); + + ok(cp instanceof _emberMetalProperties.Descriptor); + ok(cp instanceof _emberMetalComputed.ComputedProperty); + }); + + QUnit.test('throws assertion if called over a CP with a setter defined with the new syntax', function () { + expectAssertion(function () { + _emberMetalComputed.computed({ + get: function () {}, + set: function () {} + }).readOnly(); + }, /Computed properties that define a setter using the new syntax cannot be read-only/); + }); + + _internalTestHelpers.testBoth('protects against setting', function (get, set) { + var obj = {}; + + _emberMetalProperties.defineProperty(obj, 'bar', _emberMetalComputed.computed(function (key) { + return 'barValue'; + }).readOnly()); + + equal(get(obj, 'bar'), 'barValue'); + + throws(function () { + set(obj, 'bar', 'newBar'); + }, /Cannot set read\-only property "bar" on object:/); + + equal(get(obj, 'bar'), 'barValue'); + }); +}); +enifed('ember-metal/tests/computed_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/computed_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/computed_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/computed_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/computed_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/computed_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/descriptor_test', ['exports', 'ember-runtime', 'ember-metal/mixin', 'ember-metal/properties', 'ember-metal/descriptor'], function (exports, _emberRuntime, _emberMetalMixin, _emberMetalProperties, _emberMetalDescriptor) { + 'use strict'; + + // IE9 soft-fails when trying to delete a non-configurable property + var hasCompliantDelete = (function () { + var obj = {}; + + Object.defineProperty(obj, 'zomg', { configurable: false, value: 'zomg' }); + + try { + delete obj.zomg; + } catch (e) { + return true; + } + + return false; + })(); + + // IE9 soft-fails when trying to assign to a non-writable property + var hasCompliantAssign = (function () { + var obj = {}; + + Object.defineProperty(obj, 'zomg', { writable: false, value: 'zomg' }); + + try { + obj.zomg = 'lol'; + } catch (e) { + return true; + } + + return false; + })(); + + var DescriptorTest = (function () { + + /* abstract static module(title: string); */ + + DescriptorTest.test = function test(title, callback) { + var _this = this; + + QUnit.test(title, function (assert) { + callback(assert, new _this(assert)); + }); + }; + + function DescriptorTest(assert) { + this.assert = assert; + } + + /* abstract install(key: string, desc: Descriptor); */ + + /* abstract set(key: string, value: any); */ + + /* abstract finalize(): Object; */ + return DescriptorTest; + })(); + + var classes = [(function (_DescriptorTest) { + babelHelpers.inherits(_class, _DescriptorTest); + + _class.module = function module(title) { + QUnit.module(title + ': using defineProperty on an object directly'); + }; + + function _class(assert) { + _DescriptorTest.call(this, assert); + this.object = {}; + } + + _class.prototype.install = function install(key, desc) { + var object = this.object; + var assert = this.assert; + + _emberMetalProperties.defineProperty(object, key, desc); + + assert.ok(object.hasOwnProperty(key)); + }; + + _class.prototype.set = function set(key, value) { + this.object[key] = value; + }; + + _class.prototype.finalize = function finalize() { + return this.object; + }; + + _class.prototype.source = function source() { + return this.object; + }; + + return _class; + })(DescriptorTest), (function (_DescriptorTest2) { + babelHelpers.inherits(_class2, _DescriptorTest2); + + _class2.module = function module(title) { + QUnit.module(title + ': using defineProperty on a prototype'); + }; + + function _class2(assert) { + _DescriptorTest2.call(this, assert); + this.proto = {}; + } + + _class2.prototype.install = function install(key, desc) { + var proto = this.proto; + var assert = this.assert; + + _emberMetalProperties.defineProperty(proto, key, desc); + + assert.ok(proto.hasOwnProperty(key)); + }; + + _class2.prototype.set = function set(key, value) { + this.proto[key] = value; + }; + + _class2.prototype.finalize = function finalize() { + return Object.create(this.proto); + }; + + _class2.prototype.source = function source() { + return this.proto; + }; + + return _class2; + })(DescriptorTest), (function (_DescriptorTest3) { + babelHelpers.inherits(_class3, _DescriptorTest3); + + _class3.module = function module(title) { + QUnit.module(title + ': in EmberObject.extend()'); + }; + + function _class3(assert) { + _DescriptorTest3.call(this, assert); + this.klass = null; + this.props = {}; + } + + _class3.prototype.install = function install(key, desc) { + this.props[key] = desc; + }; + + _class3.prototype.set = function set(key, value) { + this.props[key] = value; + }; + + _class3.prototype.finalize = function finalize() { + this.klass = _emberRuntime.Object.extend(this.props); + return this.klass.create(); + }; + + _class3.prototype.source = function source() { + return this.klass.prototype; + }; + + return _class3; + })(DescriptorTest), (function (_DescriptorTest4) { + babelHelpers.inherits(_class4, _DescriptorTest4); + + _class4.module = function module(title) { + QUnit.module(title + ': in EmberObject.extend() through a mixin'); + }; + + function _class4(assert) { + _DescriptorTest4.call(this, assert); + this.klass = null; + this.props = {}; + } + + _class4.prototype.install = function install(key, desc) { + this.props[key] = desc; + }; + + _class4.prototype.set = function set(key, value) { + this.props[key] = value; + }; + + _class4.prototype.finalize = function finalize() { + this.klass = _emberRuntime.Object.extend(_emberMetalMixin.Mixin.create(this.props)); + return this.klass.create(); + }; + + _class4.prototype.source = function source() { + return this.klass.prototype; + }; + + return _class4; + })(DescriptorTest), (function (_DescriptorTest5) { + babelHelpers.inherits(_class5, _DescriptorTest5); + + _class5.module = function module(title) { + QUnit.module(title + ': inherited from another EmberObject super class'); + }; + + function _class5(assert) { + _DescriptorTest5.call(this, assert); + this.superklass = null; + this.props = {}; + } + + _class5.prototype.install = function install(key, desc) { + this.props[key] = desc; + }; + + _class5.prototype.set = function set(key, value) { + this.props[key] = value; + }; + + _class5.prototype.finalize = function finalize() { + this.superklass = _emberRuntime.Object.extend(this.props); + return this.superklass.extend().create(); + }; + + _class5.prototype.source = function source() { + return this.superklass.prototype; + }; + + return _class5; + })(DescriptorTest)]; + + classes.forEach(function (TestClass) { + TestClass.module('ember-metal/descriptor'); + + TestClass.test('defining a configurable property', function (assert, factory) { + factory.install('foo', _emberMetalDescriptor.default({ configurable: true, value: 'bar' })); + + var obj = factory.finalize(); + + assert.equal(obj.foo, 'bar'); + + var source = factory.source(); + + delete source.foo; + + assert.strictEqual(obj.foo, undefined); + + Object.defineProperty(source, 'foo', { configurable: true, value: 'baz' }); + + assert.equal(obj.foo, 'baz'); + }); + + TestClass.test('defining a non-configurable property', function (assert, factory) { + factory.install('foo', _emberMetalDescriptor.default({ configurable: false, value: 'bar' })); + + var obj = factory.finalize(); + + assert.equal(obj.foo, 'bar'); + + var source = factory.source(); + + if (hasCompliantDelete) { + assert.throws(function () { + return delete source.foo; + }, TypeError); + } else { + delete source.foo; + } + + assert.throws(function () { + return Object.defineProperty(source, 'foo', { configurable: true, value: 'baz' }); + }, TypeError); + + assert.equal(obj.foo, 'bar'); + }); + + TestClass.test('defining an enumerable property', function (assert, factory) { + factory.install('foo', _emberMetalDescriptor.default({ enumerable: true, value: 'bar' })); + + var obj = factory.finalize(); + + assert.equal(obj.foo, 'bar'); + + var source = factory.source(); + + assert.ok(Object.keys(source).indexOf('foo') !== -1); + }); + + TestClass.test('defining a non-enumerable property', function (assert, factory) { + factory.install('foo', _emberMetalDescriptor.default({ enumerable: false, value: 'bar' })); + + var obj = factory.finalize(); + + assert.equal(obj.foo, 'bar'); + + var source = factory.source(); + + assert.ok(Object.keys(source).indexOf('foo') === -1); + }); + + TestClass.test('defining a writable property', function (assert, factory) { + factory.install('foo', _emberMetalDescriptor.default({ writable: true, value: 'bar' })); + + var obj = factory.finalize(); + + assert.equal(obj.foo, 'bar'); + + var source = factory.source(); + + source.foo = 'baz'; + + assert.equal(obj.foo, 'baz'); + + obj.foo = 'bat'; + + assert.equal(obj.foo, 'bat'); + }); + + TestClass.test('defining a non-writable property', function (assert, factory) { + factory.install('foo', _emberMetalDescriptor.default({ writable: false, value: 'bar' })); + + var obj = factory.finalize(); + + assert.equal(obj.foo, 'bar'); + + var source = factory.source(); + + if (hasCompliantAssign) { + assert.throws(function () { + return source.foo = 'baz'; + }, TypeError); + assert.throws(function () { + return obj.foo = 'baz'; + }, TypeError); + } else { + source.foo = 'baz'; + obj.foo = 'baz'; + } + + assert.equal(obj.foo, 'bar'); + }); + + TestClass.test('defining a getter', function (assert, factory) { + factory.install('foo', _emberMetalDescriptor.default({ + get: function () { + return this.__foo__; + } + })); + + factory.set('__foo__', 'bar'); + + var obj = factory.finalize(); + + assert.equal(obj.foo, 'bar'); + + obj.__foo__ = 'baz'; + + assert.equal(obj.foo, 'baz'); + }); + + TestClass.test('defining a setter', function (assert, factory) { + factory.install('foo', _emberMetalDescriptor.default({ + set: function (value) { + this.__foo__ = value; + } + })); + + factory.set('__foo__', 'bar'); + + var obj = factory.finalize(); + + assert.equal(obj.__foo__, 'bar'); + + obj.foo = 'baz'; + + assert.equal(obj.__foo__, 'baz'); + }); + + TestClass.test('combining multiple setter and getters', function (assert, factory) { + factory.install('foo', _emberMetalDescriptor.default({ + get: function () { + return this.__foo__; + }, + + set: function (value) { + this.__foo__ = value; + } + })); + + factory.set('__foo__', 'foo'); + + factory.install('bar', _emberMetalDescriptor.default({ + get: function () { + return this.__bar__; + }, + + set: function (value) { + this.__bar__ = value; + } + })); + + factory.set('__bar__', 'bar'); + + factory.install('fooBar', _emberMetalDescriptor.default({ + get: function () { + return this.foo + '-' + this.bar; + } + })); + + var obj = factory.finalize(); + + assert.equal(obj.fooBar, 'foo-bar'); + + obj.foo = 'FOO'; + + assert.equal(obj.fooBar, 'FOO-bar'); + + obj.__bar__ = 'BAR'; + + assert.equal(obj.fooBar, 'FOO-BAR'); + + if (hasCompliantAssign) { + assert.throws(function () { + return obj.fooBar = 'foobar'; + }, TypeError); + } else { + obj.fooBar = 'foobar'; + } + + assert.equal(obj.fooBar, 'FOO-BAR'); + }); + }); +}); +enifed('ember-metal/tests/descriptor_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/descriptor_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/descriptor_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/descriptor_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/descriptor_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/descriptor_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/error_test', ['exports', 'ember-metal/error'], function (exports, _emberMetalError) { + 'use strict'; + + QUnit.module('Ember Error Throwing'); + + QUnit.test('new Ember.Error displays provided message', function () { + throws(function () { + throw new _emberMetalError.default('A Message'); + }, function (e) { + return e.message === 'A Message'; + }, 'the assigned message was displayed'); + }); +}); +enifed('ember-metal/tests/error_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/error_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/error_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/error_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/error_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/error_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/events_test', ['exports', 'ember-metal/mixin', 'ember-metal/meta', 'ember-metal/events'], function (exports, _emberMetalMixin, _emberMetalMeta, _emberMetalEvents) { + 'use strict'; + + QUnit.module('system/props/events_test'); + + QUnit.test('listener should receive event - removing should remove', function () { + var obj = {}; + var count = 0; + + function F() { + count++; + } + + _emberMetalEvents.addListener(obj, 'event!', F); + equal(count, 0, 'nothing yet'); + + _emberMetalEvents.sendEvent(obj, 'event!'); + equal(count, 1, 'received event'); + + _emberMetalEvents.removeListener(obj, 'event!', F); + + count = 0; + _emberMetalEvents.sendEvent(obj, 'event!'); + equal(count, 0, 'received event'); + }); + + QUnit.test('listeners should be inherited', function () { + var obj = {}; + var count = 0; + var F = function () { + count++; + }; + + _emberMetalEvents.addListener(obj, 'event!', F); + + var obj2 = Object.create(obj); + + equal(count, 0, 'nothing yet'); + + _emberMetalEvents.sendEvent(obj2, 'event!'); + equal(count, 1, 'received event'); + + _emberMetalEvents.removeListener(obj2, 'event!', F); + + count = 0; + _emberMetalEvents.sendEvent(obj2, 'event!'); + equal(count, 0, 'did not receive event'); + + _emberMetalEvents.sendEvent(obj, 'event!'); + equal(count, 1, 'should still invoke on parent'); + }); + + QUnit.test('adding a listener more than once should only invoke once', function () { + var obj = {}; + var count = 0; + function F() { + count++; + } + _emberMetalEvents.addListener(obj, 'event!', F); + _emberMetalEvents.addListener(obj, 'event!', F); + + _emberMetalEvents.sendEvent(obj, 'event!'); + equal(count, 1, 'should only invoke once'); + }); + + QUnit.test('adding a listener with a target should invoke with target', function () { + var obj = {}; + var target = undefined; + + target = { + count: 0, + method: function () { + this.count++; + } + }; + + _emberMetalEvents.addListener(obj, 'event!', target, target.method); + _emberMetalEvents.sendEvent(obj, 'event!'); + equal(target.count, 1, 'should invoke'); + }); + + QUnit.test('suspending a listener should not invoke during callback', function () { + var obj = {}; + var target = undefined, + otherTarget = undefined; + + target = { + count: 0, + method: function () { + this.count++; + } + }; + + otherTarget = { + count: 0, + method: function () { + this.count++; + } + }; + + _emberMetalEvents.addListener(obj, 'event!', target, target.method); + _emberMetalEvents.addListener(obj, 'event!', otherTarget, otherTarget.method); + + function callback() { + /*jshint validthis:true */ + equal(this, target); + + _emberMetalEvents.sendEvent(obj, 'event!'); + + return 'result'; + } + + _emberMetalEvents.sendEvent(obj, 'event!'); + + equal(_emberMetalEvents.suspendListener(obj, 'event!', target, target.method, callback), 'result'); + + _emberMetalEvents.sendEvent(obj, 'event!'); + + equal(target.count, 2, 'should invoke'); + equal(otherTarget.count, 3, 'should invoke'); + }); + + QUnit.test('adding a listener with string method should lookup method on event delivery', function () { + var obj = {}; + var target = undefined; + + target = { + count: 0, + method: function () {} + }; + + _emberMetalEvents.addListener(obj, 'event!', target, 'method'); + _emberMetalEvents.sendEvent(obj, 'event!'); + equal(target.count, 0, 'should invoke but do nothing'); + + target.method = function () { + this.count++; + }; + _emberMetalEvents.sendEvent(obj, 'event!'); + equal(target.count, 1, 'should invoke now'); + }); + + QUnit.test('calling sendEvent with extra params should be passed to listeners', function () { + var obj = {}; + var params = null; + _emberMetalEvents.addListener(obj, 'event!', function () { + params = Array.prototype.slice.call(arguments); + }); + + _emberMetalEvents.sendEvent(obj, 'event!', ['foo', 'bar']); + deepEqual(params, ['foo', 'bar'], 'params should be saved'); + }); + + QUnit.test('hasListeners tells you if there are listeners for a given event', function () { + var obj = {}; + + function F() {} + function F2() {} + + equal(_emberMetalEvents.hasListeners(obj, 'event!'), false, 'no listeners at first'); + + _emberMetalEvents.addListener(obj, 'event!', F); + _emberMetalEvents.addListener(obj, 'event!', F2); + + equal(_emberMetalEvents.hasListeners(obj, 'event!'), true, 'has listeners'); + + _emberMetalEvents.removeListener(obj, 'event!', F); + equal(_emberMetalEvents.hasListeners(obj, 'event!'), true, 'has listeners'); + + _emberMetalEvents.removeListener(obj, 'event!', F2); + equal(_emberMetalEvents.hasListeners(obj, 'event!'), false, 'has no more listeners'); + + _emberMetalEvents.addListener(obj, 'event!', F); + equal(_emberMetalEvents.hasListeners(obj, 'event!'), true, 'has listeners'); + }); + + QUnit.test('calling removeListener without method should remove all listeners', function () { + var obj = {}; + function F() {} + function F2() {} + + equal(_emberMetalEvents.hasListeners(obj, 'event!'), false, 'no listeners at first'); + + _emberMetalEvents.addListener(obj, 'event!', F); + _emberMetalEvents.addListener(obj, 'event!', F2); + + equal(_emberMetalEvents.hasListeners(obj, 'event!'), true, 'has listeners'); + _emberMetalEvents.removeListener(obj, 'event!'); + + equal(_emberMetalEvents.hasListeners(obj, 'event!'), false, 'has no more listeners'); + }); + + QUnit.test('while suspended, it should not be possible to add a duplicate listener', function () { + var obj = {}; + var target = undefined; + + target = { + count: 0, + method: function () { + this.count++; + } + }; + + _emberMetalEvents.addListener(obj, 'event!', target, target.method); + + function callback() { + _emberMetalEvents.addListener(obj, 'event!', target, target.method); + } + + _emberMetalEvents.sendEvent(obj, 'event!'); + + _emberMetalEvents.suspendListener(obj, 'event!', target, target.method, callback); + + equal(target.count, 1, 'should invoke'); + equal(_emberMetalMeta.meta(obj).matchingListeners('event!').length, 3, 'a duplicate listener wasn\'t added'); + + // now test suspendListeners... + + _emberMetalEvents.sendEvent(obj, 'event!'); + + _emberMetalEvents.suspendListeners(obj, ['event!'], target, target.method, callback); + + equal(target.count, 2, 'should have invoked again'); + equal(_emberMetalMeta.meta(obj).matchingListeners('event!').length, 3, 'a duplicate listener wasn\'t added'); + }); + + QUnit.test('a listener can be added as part of a mixin', function () { + var triggered = 0; + var MyMixin = _emberMetalMixin.Mixin.create({ + foo1: _emberMetalEvents.on('bar', function () { + triggered++; + }), + + foo2: _emberMetalEvents.on('bar', function () { + triggered++; + }) + }); + + var obj = {}; + MyMixin.apply(obj); + + _emberMetalEvents.sendEvent(obj, 'bar'); + equal(triggered, 2, 'should invoke listeners'); + }); + + QUnit.test('a listener added as part of a mixin may be overridden', function () { + var triggered = 0; + var FirstMixin = _emberMetalMixin.Mixin.create({ + foo: _emberMetalEvents.on('bar', function () { + triggered++; + }) + }); + var SecondMixin = _emberMetalMixin.Mixin.create({ + foo: _emberMetalEvents.on('baz', function () { + triggered++; + }) + }); + + var obj = {}; + FirstMixin.apply(obj); + SecondMixin.apply(obj); + + _emberMetalEvents.sendEvent(obj, 'bar'); + equal(triggered, 0, 'should not invoke from overriden property'); + + _emberMetalEvents.sendEvent(obj, 'baz'); + equal(triggered, 1, 'should invoke from subclass property'); + }); +}); +enifed('ember-metal/tests/events_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/events_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/events_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/events_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/events_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/events_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/expand_properties_test', ['exports', 'ember-metal/expand_properties'], function (exports, _emberMetalExpand_properties) { + 'use strict'; + + var foundProperties = []; + + function addProperty(property) { + foundProperties.push(property); + } + + QUnit.module('Property Brace Expansion Test', { + setup: function () { + foundProperties = []; + } + }); + + QUnit.test('Properties without expansions are unaffected', function () { + expect(1); + + _emberMetalExpand_properties.default('a', addProperty); + _emberMetalExpand_properties.default('a.b', addProperty); + _emberMetalExpand_properties.default('a.b.[]', addProperty); + _emberMetalExpand_properties.default('a.b.@each.c', addProperty); + + deepEqual(['a', 'a.b', 'a.b.[]', 'a.b.@each.c'].sort(), foundProperties.sort()); + }); + + QUnit.test('A single expansion at the end expands properly', function () { + expect(1); + + _emberMetalExpand_properties.default('a.b.{c,d}', addProperty); + + deepEqual(['a.b.c', 'a.b.d'].sort(), foundProperties.sort()); + }); + + QUnit.test('A property with only a brace expansion expands correctly', function () { + expect(1); + + _emberMetalExpand_properties.default('{a,b,c}', addProperty); + + var expected = ['a', 'b', 'c']; + deepEqual(expected.sort(), foundProperties.sort()); + }); + + QUnit.test('Expansions with single properties only expand once', function () { + expect(1); + + _emberMetalExpand_properties.default('a.b.{c}.d.{e}', addProperty); + + deepEqual(['a.b.c.d.e'], foundProperties); + }); + + QUnit.test('A single brace expansion expands correctly', function () { + expect(1); + + _emberMetalExpand_properties.default('a.{b,c,d}.e', addProperty); + + var expected = ['a.b.e', 'a.c.e', 'a.d.e']; + deepEqual(expected.sort(), foundProperties.sort()); + }); + + QUnit.test('Multiple brace expansions work correctly', function () { + expect(1); + + _emberMetalExpand_properties.default('{a,b,c}.d.{e,f}.g', addProperty); + + var expected = ['a.d.e.g', 'a.d.f.g', 'b.d.e.g', 'b.d.f.g', 'c.d.e.g', 'c.d.f.g']; + deepEqual(expected.sort(), foundProperties.sort()); + }); + + QUnit.test('A property with only brace expansions expands correctly', function () { + expect(1); + + _emberMetalExpand_properties.default('{a,b,c}.{d}.{e,f}', addProperty); + + var expected = ['a.d.e', 'a.d.f', 'b.d.e', 'b.d.f', 'c.d.e', 'c.d.f']; + deepEqual(expected.sort(), foundProperties.sort()); + }); + + QUnit.test('Nested brace expansions are not allowed', function () { + var nestedBraceProperties = ['a.{b.{c,d}}', 'a.{{b}.c}', 'a.{b,c}.{d.{e,f}.g', 'a.{b.{c}', 'a.{b,c}}']; + + nestedBraceProperties.forEach(function (invalidProperties) { + expectAssertion(function () { + return _emberMetalExpand_properties.default(invalidProperties, addProperty); + }); + }, /Brace expanded properties have to be balanced and cannot be nested/); + }); + + QUnit.test('A pattern must be a string', function () { + expect(1); + + expectAssertion(function () { + _emberMetalExpand_properties.default([], addProperty); + }, /A computed property key must be a string/); + }); + + QUnit.test('A pattern must not contain a space', function () { + expect(1); + + expectAssertion(function () { + _emberMetalExpand_properties.default('a, b', addProperty); + }, /Brace expanded properties cannot contain spaces, e.g. "user.{firstName, lastName}" should be "user.{firstName,lastName}"/); + }); +}); +enifed('ember-metal/tests/expand_properties_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/expand_properties_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/expand_properties_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/expand_properties_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/expand_properties_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/expand_properties_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/injected_property_test', ['exports', 'ember-utils', 'ember-metal/properties', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/injected_property'], function (exports, _emberUtils, _emberMetalProperties, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalInjected_property) { + 'use strict'; + + QUnit.module('InjectedProperty'); + + QUnit.test('injected properties should be descriptors', function () { + ok(new _emberMetalInjected_property.default() instanceof _emberMetalProperties.Descriptor); + }); + + QUnit.test('injected properties should be overridable', function () { + var obj = {}; + _emberMetalProperties.defineProperty(obj, 'foo', new _emberMetalInjected_property.default()); + + _emberMetalProperty_set.set(obj, 'foo', 'bar'); + + equal(_emberMetalProperty_get.get(obj, 'foo'), 'bar', 'should return the overriden value'); + }); + + QUnit.test('getting on an object without an owner or container should fail assertion', function () { + var obj = {}; + _emberMetalProperties.defineProperty(obj, 'foo', new _emberMetalInjected_property.default('type', 'name')); + + expectAssertion(function () { + _emberMetalProperty_get.get(obj, 'foo'); + }, /Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container./); + }); + + QUnit.test('getting on an object without an owner but with a container should not fail', function () { + var obj = { + container: { + lookup: function (key) { + ok(true, 'should call container.lookup'); + return key; + } + } + }; + + _emberMetalProperties.defineProperty(obj, 'foo', new _emberMetalInjected_property.default('type', 'name')); + + equal(_emberMetalProperty_get.get(obj, 'foo'), 'type:name', 'should return the value of container.lookup'); + }); + + QUnit.test('getting should return a lookup on the container', function () { + expect(2); + + var obj = {}; + + _emberUtils.setOwner(obj, { + lookup: function (key) { + ok(true, 'should call container.lookup'); + return key; + } + }); + + _emberMetalProperties.defineProperty(obj, 'foo', new _emberMetalInjected_property.default('type', 'name')); + + equal(_emberMetalProperty_get.get(obj, 'foo'), 'type:name', 'should return the value of container.lookup'); + }); + + QUnit.test('omitting the lookup name should default to the property name', function () { + var obj = {}; + + _emberUtils.setOwner(obj, { + lookup: function (key) { + return key; + } + }); + + _emberMetalProperties.defineProperty(obj, 'foo', new _emberMetalInjected_property.default('type')); + + equal(_emberMetalProperty_get.get(obj, 'foo'), 'type:foo', 'should lookup the type using the property name'); + }); +}); +enifed('ember-metal/tests/injected_property_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/injected_property_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/injected_property_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/injected_property_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/injected_property_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/injected_property_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/instrumentation_test', ['exports', 'ember-metal/instrumentation'], function (exports, _emberMetalInstrumentation) { + 'use strict'; + + QUnit.module('Ember Instrumentation', { + teardown: function () { + _emberMetalInstrumentation.reset(); + } + }); + + QUnit.test('execute block even if no listeners', function () { + var result = _emberMetalInstrumentation.instrument('render', {}, function () { + return 'hello'; + }); + equal(result, 'hello', 'called block'); + }); + + QUnit.test('subscribing to a simple path receives the listener', function () { + expect(12); + + var sentPayload = {}; + var count = 0; + + _emberMetalInstrumentation.subscribe('render', { + before: function (name, timestamp, payload) { + if (count === 0) { + strictEqual(name, 'render'); + } else { + strictEqual(name, 'render.handlebars'); + } + + ok(typeof timestamp === 'number'); + strictEqual(payload, sentPayload); + }, + + after: function (name, timestamp, payload) { + if (count === 0) { + strictEqual(name, 'render'); + } else { + strictEqual(name, 'render.handlebars'); + } + + ok(typeof timestamp === 'number'); + strictEqual(payload, sentPayload); + + count++; + } + }); + + _emberMetalInstrumentation.instrument('render', sentPayload, function () {}); + + _emberMetalInstrumentation.instrument('render.handlebars', sentPayload, function () {}); + }); + + QUnit.test('returning a value from the before callback passes it to the after callback', function () { + expect(2); + + var passthru1 = {}; + var passthru2 = {}; + + _emberMetalInstrumentation.subscribe('render', { + before: function (name, timestamp, payload) { + return passthru1; + }, + after: function (name, timestamp, payload, beforeValue) { + strictEqual(beforeValue, passthru1); + } + }); + + _emberMetalInstrumentation.subscribe('render', { + before: function (name, timestamp, payload) { + return passthru2; + }, + after: function (name, timestamp, payload, beforeValue) { + strictEqual(beforeValue, passthru2); + } + }); + + _emberMetalInstrumentation.instrument('render', null, function () {}); + }); + + QUnit.test('instrument with 2 args (name, callback) no payload', function () { + expect(1); + + _emberMetalInstrumentation.subscribe('render', { + before: function (name, timestamp, payload) { + deepEqual(payload, {}); + }, + after: function () {} + }); + + _emberMetalInstrumentation.instrument('render', function () {}); + }); + + QUnit.test('instrument with 3 args (name, callback, binding) no payload', function () { + expect(2); + + var binding = {}; + _emberMetalInstrumentation.subscribe('render', { + before: function (name, timestamp, payload) { + deepEqual(payload, {}); + }, + after: function () {} + }); + + _emberMetalInstrumentation.instrument('render', function () { + deepEqual(this, binding); + }, binding); + }); + + QUnit.test('instrument with 3 args (name, payload, callback) with payload', function () { + expect(1); + + var expectedPayload = { hi: 1 }; + _emberMetalInstrumentation.subscribe('render', { + before: function (name, timestamp, payload) { + deepEqual(payload, expectedPayload); + }, + after: function () {} + }); + + _emberMetalInstrumentation.instrument('render', expectedPayload, function () {}); + }); + + QUnit.test('instrument with 4 args (name, payload, callback, binding) with payload', function () { + expect(2); + + var expectedPayload = { hi: 1 }; + var binding = {}; + _emberMetalInstrumentation.subscribe('render', { + before: function (name, timestamp, payload) { + deepEqual(payload, expectedPayload); + }, + after: function () {} + }); + + _emberMetalInstrumentation.instrument('render', expectedPayload, function () { + deepEqual(this, binding); + }, binding); + }); + + QUnit.test('raising an exception in the instrumentation attaches it to the payload', function () { + expect(2); + + var error = new Error('Instrumentation'); + + _emberMetalInstrumentation.subscribe('render', { + before: function () {}, + after: function (name, timestamp, payload) { + strictEqual(payload.exception, error); + } + }); + + _emberMetalInstrumentation.subscribe('render', { + before: function () {}, + after: function (name, timestamp, payload) { + strictEqual(payload.exception, error); + } + }); + + _emberMetalInstrumentation.instrument('render.handlebars', null, function () { + throw error; + }); + }); + + QUnit.test('it is possible to add a new subscriber after the first instrument', function () { + _emberMetalInstrumentation.instrument('render.handlebars', null, function () {}); + + _emberMetalInstrumentation.subscribe('render', { + before: function () { + ok(true, 'Before callback was called'); + }, + after: function () { + ok(true, 'After callback was called'); + } + }); + + _emberMetalInstrumentation.instrument('render.handlebars', null, function () {}); + }); + + QUnit.test('it is possible to remove a subscriber', function () { + expect(4); + + var count = 0; + + var subscriber = _emberMetalInstrumentation.subscribe('render', { + before: function () { + equal(count, 0); + ok(true, 'Before callback was called'); + }, + after: function () { + equal(count, 0); + ok(true, 'After callback was called'); + count++; + } + }); + + _emberMetalInstrumentation.instrument('render.handlebars', null, function () {}); + + _emberMetalInstrumentation.unsubscribe(subscriber); + + _emberMetalInstrumentation.instrument('render.handlebars', null, function () {}); + }); +}); +enifed('ember-metal/tests/instrumentation_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/instrumentation_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/instrumentation_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/instrumentation_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/instrumentation_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/instrumentation_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/is_blank_test', ['exports', 'ember-metal/is_blank'], function (exports, _emberMetalIs_blank) { + 'use strict'; + + QUnit.module('Ember.isBlank'); + + QUnit.test('Ember.isBlank', function () { + var string = 'string'; + var fn = function () {}; + var object = { length: 0 }; + + equal(true, _emberMetalIs_blank.default(null), 'for null'); + equal(true, _emberMetalIs_blank.default(undefined), 'for undefined'); + equal(true, _emberMetalIs_blank.default(''), 'for an empty String'); + equal(true, _emberMetalIs_blank.default(' '), 'for a whitespace String'); + equal(true, _emberMetalIs_blank.default('\n\t'), 'for another whitespace String'); + equal(false, _emberMetalIs_blank.default('\n\t Hi'), 'for a String with whitespaces'); + equal(false, _emberMetalIs_blank.default(true), 'for true'); + equal(false, _emberMetalIs_blank.default(false), 'for false'); + equal(false, _emberMetalIs_blank.default(string), 'for a String'); + equal(false, _emberMetalIs_blank.default(fn), 'for a Function'); + equal(false, _emberMetalIs_blank.default(0), 'for 0'); + equal(true, _emberMetalIs_blank.default([]), 'for an empty Array'); + equal(false, _emberMetalIs_blank.default({}), 'for an empty Object'); + equal(true, _emberMetalIs_blank.default(object), 'for an Object that has zero \'length\''); + equal(false, _emberMetalIs_blank.default([1, 2, 3]), 'for a non-empty array'); + }); +}); +enifed('ember-metal/tests/is_blank_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/is_blank_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/is_blank_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/is_blank_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/is_blank_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/is_blank_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/is_empty_test', ['exports', 'ember-metal/is_empty', 'ember-metal/map'], function (exports, _emberMetalIs_empty, _emberMetalMap) { + 'use strict'; + + QUnit.module('Ember.isEmpty'); + + QUnit.test('Ember.isEmpty', function () { + var string = 'string'; + var fn = function () {}; + var object = { length: 0 }; + + equal(true, _emberMetalIs_empty.default(null), 'for null'); + equal(true, _emberMetalIs_empty.default(undefined), 'for undefined'); + equal(true, _emberMetalIs_empty.default(''), 'for an empty String'); + equal(false, _emberMetalIs_empty.default(' '), 'for a whitespace String'); + equal(false, _emberMetalIs_empty.default('\n\t'), 'for another whitespace String'); + equal(false, _emberMetalIs_empty.default(true), 'for true'); + equal(false, _emberMetalIs_empty.default(false), 'for false'); + equal(false, _emberMetalIs_empty.default(string), 'for a String'); + equal(false, _emberMetalIs_empty.default(fn), 'for a Function'); + equal(false, _emberMetalIs_empty.default(0), 'for 0'); + equal(true, _emberMetalIs_empty.default([]), 'for an empty Array'); + equal(false, _emberMetalIs_empty.default({}), 'for an empty Object'); + equal(true, _emberMetalIs_empty.default(object), 'for an Object that has zero \'length\''); + }); + + QUnit.test('Ember.isEmpty Ember.Map', function () { + var map = new _emberMetalMap.Map(); + equal(true, _emberMetalIs_empty.default(map), 'Empty map is empty'); + map.set('foo', 'bar'); + equal(false, _emberMetalIs_empty.default(map), 'Map is not empty'); + }); + + QUnit.test('Ember.isEmpty Ember.OrderedSet', function () { + var orderedSet = new _emberMetalMap.OrderedSet(); + equal(true, _emberMetalIs_empty.default(orderedSet), 'Empty ordered set is empty'); + orderedSet.add('foo'); + equal(false, _emberMetalIs_empty.default(orderedSet), 'Ordered set is not empty'); + }); +}); +enifed('ember-metal/tests/is_empty_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/is_empty_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/is_empty_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/is_empty_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/is_empty_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/is_empty_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/is_none_test', ['exports', 'ember-metal/is_none'], function (exports, _emberMetalIs_none) { + 'use strict'; + + QUnit.module('Ember.isNone'); + + QUnit.test('Ember.isNone', function () { + var string = 'string'; + var fn = function () {}; + + equal(true, _emberMetalIs_none.default(null), 'for null'); + equal(true, _emberMetalIs_none.default(undefined), 'for undefined'); + equal(false, _emberMetalIs_none.default(''), 'for an empty String'); + equal(false, _emberMetalIs_none.default(true), 'for true'); + equal(false, _emberMetalIs_none.default(false), 'for false'); + equal(false, _emberMetalIs_none.default(string), 'for a String'); + equal(false, _emberMetalIs_none.default(fn), 'for a Function'); + equal(false, _emberMetalIs_none.default(0), 'for 0'); + equal(false, _emberMetalIs_none.default([]), 'for an empty Array'); + equal(false, _emberMetalIs_none.default({}), 'for an empty Object'); + }); +}); +enifed('ember-metal/tests/is_none_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/is_none_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/is_none_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/is_none_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/is_none_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/is_none_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/is_present_test', ['exports', 'ember-metal/is_present'], function (exports, _emberMetalIs_present) { + 'use strict'; + + QUnit.module('Ember.isPresent'); + + QUnit.test('Ember.isPresent', function () { + var string = 'string'; + var fn = function () {}; + var object = { length: 0 }; + + equal(false, _emberMetalIs_present.default(), 'for no params'); + equal(false, _emberMetalIs_present.default(null), 'for null'); + equal(false, _emberMetalIs_present.default(undefined), 'for undefined'); + equal(false, _emberMetalIs_present.default(''), 'for an empty String'); + equal(false, _emberMetalIs_present.default(' '), 'for a whitespace String'); + equal(false, _emberMetalIs_present.default('\n\t'), 'for another whitespace String'); + equal(true, _emberMetalIs_present.default('\n\t Hi'), 'for a String with whitespaces'); + equal(true, _emberMetalIs_present.default(true), 'for true'); + equal(true, _emberMetalIs_present.default(false), 'for false'); + equal(true, _emberMetalIs_present.default(string), 'for a String'); + equal(true, _emberMetalIs_present.default(fn), 'for a Function'); + equal(true, _emberMetalIs_present.default(0), 'for 0'); + equal(false, _emberMetalIs_present.default([]), 'for an empty Array'); + equal(true, _emberMetalIs_present.default({}), 'for an empty Object'); + equal(false, _emberMetalIs_present.default(object), 'for an Object that has zero \'length\''); + equal(true, _emberMetalIs_present.default([1, 2, 3]), 'for a non-empty array'); + }); +}); +enifed('ember-metal/tests/is_present_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/is_present_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/is_present_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/is_present_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/is_present_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/is_present_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/libraries_test', ['exports', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/libraries'], function (exports, _emberMetalDebug, _emberMetalFeatures, _emberMetalLibraries) { + /* globals EmberDev */ + 'use strict'; + + var libs = undefined, + registry = undefined; + var originalWarn = _emberMetalDebug.getDebugFunction('warn'); + + QUnit.module('Libraries registry', { + setup: function () { + libs = new _emberMetalLibraries.Libraries(); + registry = libs._registry; + }, + + teardown: function () { + libs = null; + registry = null; + + _emberMetalDebug.setDebugFunction('warn', originalWarn); + } + }); + + QUnit.test('core libraries come before other libraries', function () { + expect(2); + + libs.register('my-lib', '2.0.0a'); + libs.registerCoreLibrary('DS', '1.0.0-beta.2'); + + equal(registry[0].name, 'DS'); + equal(registry[1].name, 'my-lib'); + }); + + QUnit.test('only the first registration of a library is stored', function () { + expect(3); + + libs.register('magic', 1.23); + libs.register('magic', 2.23); + + equal(registry[0].name, 'magic'); + equal(registry[0].version, 1.23); + equal(registry.length, 1); + }); + + if (false) { + QUnit.test('isRegistered returns correct value', function () { + expect(3); + + equal(libs.isRegistered('magic'), false); + + libs.register('magic', 1.23); + equal(libs.isRegistered('magic'), true); + + libs.deRegister('magic'); + equal(libs.isRegistered('magic'), false); + }); + } + + QUnit.test('attempting to register a library that is already registered warns you', function () { + if (EmberDev && EmberDev.runningProdBuild) { + ok(true, 'Logging does not occur in production builds'); + return; + } + + expect(1); + + libs.register('magic', 1.23); + + _emberMetalDebug.setDebugFunction('warn', function (msg, test) { + if (!test) { + equal(msg, 'Library "magic" is already registered with Ember.'); + } + }); + + // Should warn us + libs.register('magic', 2.23); + }); + + QUnit.test('libraries can be de-registered', function () { + expect(2); + + libs.register('lib1', '1.0.0b'); + libs.register('lib2', '1.0.0b'); + libs.register('lib3', '1.0.0b'); + + libs.deRegister('lib1'); + libs.deRegister('lib3'); + + equal(registry[0].name, 'lib2'); + equal(registry.length, 1); + }); +}); +enifed('ember-metal/tests/libraries_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/libraries_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/libraries_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/libraries_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/libraries_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/libraries_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/main_test', ['exports', 'ember-metal/index'], function (exports, _emberMetalIndex) { + 'use strict'; + + // testing reexports + + // From sindresourhus/semver-regex https://github.com/sindresorhus/semver-regex/blob/795b05628d96597ebcbe6d31ef4a432858365582/index.js#L3 + var SEMVER_REGEX = /^\bv?(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?\b$/; + + QUnit.module('ember-metal/core/main'); + + QUnit.test('Ember registers itself', function () { + var lib = _emberMetalIndex.default.libraries._registry[0]; + + equal(lib.name, 'Ember'); + equal(lib.version, _emberMetalIndex.default.VERSION); + }); + + QUnit.test('Ember.VERSION is in alignment with SemVer v2.0.0', function () { + ok(SEMVER_REGEX.test(_emberMetalIndex.default.VERSION), 'Ember.VERSION (' + _emberMetalIndex.default.VERSION + ')is valid SemVer v2.0.0'); + }); + + QUnit.test('SEMVER_REGEX properly validates and invalidates version numbers', function () { + function validateVersionString(versionString, expectedResult) { + equal(SEMVER_REGEX.test(versionString), expectedResult); + } + + // Postive test cases + validateVersionString('1.11.3', true); + validateVersionString('1.0.0-beta.16.1', true); + validateVersionString('1.12.1+canary.aba1412', true); + validateVersionString('2.0.0-beta.1+canary.bb344775', true); + + // Negative test cases + validateVersionString('1.11.3.aba18a', false); + validateVersionString('1.11', false); + }); + + QUnit.test('Ember.keys is deprecated', function () { + expectDeprecation(function () { + _emberMetalIndex.default.keys({}); + }, 'Ember.keys is deprecated in favor of Object.keys'); + }); + + QUnit.test('Ember.create is deprecated', function () { + expectDeprecation(function () { + _emberMetalIndex.default.create(null); + }, 'Ember.create is deprecated in favor of Object.create'); + }); + + QUnit.test('Ember.Backburner is deprecated', function () { + expectDeprecation(function () { + new _emberMetalIndex.default.Backburner(['foo']); + }, 'Usage of Ember.Backburner is deprecated.'); + }); +}); +enifed('ember-metal/tests/main_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/main_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/main_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/main_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/main_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/main_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/map_test', ['exports', 'ember-metal/map'], function (exports, _emberMetalMap) { + 'use strict'; + + var object = undefined, + number = undefined, + string = undefined, + map = undefined, + variety = undefined; + var varieties = [['Map', _emberMetalMap.Map], ['MapWithDefault', _emberMetalMap.MapWithDefault]]; + + function testMap(nameAndFunc) { + variety = nameAndFunc[0]; + + QUnit.module('Ember.' + variety + ' (forEach and get are implicitly tested)', { + setup: function () { + object = {}; + number = 42; + string = 'foo'; + + map = nameAndFunc[1].create(); + } + }); + + var mapHasLength = function (expected, theMap) { + theMap = theMap || map; + + var length = 0; + theMap.forEach(function () { + length++; + }); + + equal(length, expected, 'map should contain ' + expected + ' items'); + }; + + var mapHasEntries = function (entries, theMap) { + theMap = theMap || map; + + for (var i = 0; i < entries.length; i++) { + equal(theMap.get(entries[i][0]), entries[i][1]); + equal(theMap.has(entries[i][0]), true); + } + + mapHasLength(entries.length, theMap); + }; + + var unboundThis = undefined; + + (function () { + unboundThis = this; + })(); + + QUnit.test('set', function () { + map.set(object, 'winning'); + map.set(number, 'winning'); + map.set(string, 'winning'); + + mapHasEntries([[object, 'winning'], [number, 'winning'], [string, 'winning']]); + + map.set(object, 'losing'); + map.set(number, 'losing'); + map.set(string, 'losing'); + + mapHasEntries([[object, 'losing'], [number, 'losing'], [string, 'losing']]); + + equal(map.has('nope'), false, 'expected the key `nope` to not be present'); + equal(map.has({}), false, 'expected they key `{}` to not be present'); + }); + + QUnit.test('set chaining', function () { + map.set(object, 'winning').set(number, 'winning').set(string, 'winning'); + + mapHasEntries([[object, 'winning'], [number, 'winning'], [string, 'winning']]); + + map.set(object, 'losing').set(number, 'losing').set(string, 'losing'); + + mapHasEntries([[object, 'losing'], [number, 'losing'], [string, 'losing']]); + + equal(map.has('nope'), false, 'expected the key `nope` to not be present'); + equal(map.has({}), false, 'expected they key `{}` to not be present'); + }); + + QUnit.test('with key with undefined value', function () { + map.set('foo', undefined); + + map.forEach(function (value, key) { + equal(value, undefined); + equal(key, 'foo'); + }); + + ok(map.has('foo'), 'has key foo, even with undefined value'); + + equal(map.size, 1); + }); + + QUnit.test('arity of forEach is 1 – es6 23.1.3.5', function () { + equal(map.forEach.length, 1, 'expected arity for map.forEach is 1'); + }); + + QUnit.test('forEach throws without a callback as the first argument', function () { + equal(map.forEach.length, 1, 'expected arity for map.forEach is 1'); + }); + + QUnit.test('has empty collection', function () { + equal(map.has('foo'), false); + equal(map.has(), false); + }); + + QUnit.test('delete', function () { + expectNoDeprecation(); + + map.set(object, 'winning'); + map.set(number, 'winning'); + map.set(string, 'winning'); + + map.delete(object); + map.delete(number); + map.delete(string); + + // doesn't explode + map.delete({}); + + mapHasEntries([]); + }); + + QUnit.test('copy and then update', function () { + map.set(object, 'winning'); + map.set(number, 'winning'); + map.set(string, 'winning'); + + var map2 = map.copy(); + + map2.set(object, 'losing'); + map2.set(number, 'losing'); + map2.set(string, 'losing'); + + mapHasEntries([[object, 'winning'], [number, 'winning'], [string, 'winning']]); + + mapHasEntries([[object, 'losing'], [number, 'losing'], [string, 'losing']], map2); + }); + + QUnit.test('copy and then delete', function () { + map.set(object, 'winning'); + map.set(number, 'winning'); + map.set(string, 'winning'); + + var map2 = map.copy(); + + map2.delete(object); + map2.delete(number); + map2.delete(string); + + mapHasEntries([[object, 'winning'], [number, 'winning'], [string, 'winning']]); + + mapHasEntries([], map2); + }); + + QUnit.test('size', function () { + //Add a key twice + equal(map.size, 0); + map.set(string, 'a string'); + equal(map.size, 1); + map.set(string, 'the same string'); + equal(map.size, 1); + + //Add another + map.set(number, 'a number'); + equal(map.size, 2); + + //Remove one that doesn't exist + map.delete('does not exist'); + equal(map.size, 2); + + //Check copy + var copy = map.copy(); + equal(copy.size, 2); + + //Remove a key twice + map.delete(number); + equal(map.size, 1); + map.delete(number); + equal(map.size, 1); + + //Remove the last key + map.delete(string); + equal(map.size, 0); + map.delete(string); + equal(map.size, 0); + }); + + QUnit.test('forEach without proper callback', function () { + QUnit.throws(function () { + map.forEach(); + }, '[object Undefined] is not a function'); + + QUnit.throws(function () { + map.forEach(undefined); + }, '[object Undefined] is not a function'); + + QUnit.throws(function () { + map.forEach(1); + }, '[object Number] is not a function'); + + QUnit.throws(function () { + map.forEach({}); + }, '[object Object] is not a function'); + + map.forEach(function (value, key) { + map.delete(key); + }); + // ensure the error happens even if no data is present + equal(map.size, 0); + QUnit.throws(function () { + map.forEach({}); + }, '[object Object] is not a function'); + }); + + QUnit.test('forEach basic', function () { + map.set('a', 1); + map.set('b', 2); + map.set('c', 3); + + var iteration = 0; + + var expectations = [{ value: 1, key: 'a', context: unboundThis }, { value: 2, key: 'b', context: unboundThis }, { value: 3, key: 'c', context: unboundThis }]; + + map.forEach(function (value, key, theMap) { + var expectation = expectations[iteration]; + + equal(value, expectation.value, 'value should be correct'); + equal(key, expectation.key, 'key should be correct'); + equal(this, expectation.context, 'context should be as if it was unbound'); + equal(map, theMap, 'map being iterated over should be passed in'); + + iteration++; + }); + + equal(iteration, 3, 'expected 3 iterations'); + }); + + QUnit.test('forEach basic /w context', function () { + map.set('a', 1); + map.set('b', 2); + map.set('c', 3); + + var iteration = 0; + var context = {}; + var expectations = [{ value: 1, key: 'a', context: context }, { value: 2, key: 'b', context: context }, { value: 3, key: 'c', context: context }]; + + map.forEach(function (value, key, theMap) { + var expectation = expectations[iteration]; + + equal(value, expectation.value, 'value should be correct'); + equal(key, expectation.key, 'key should be correct'); + equal(this, expectation.context, 'context should be as if it was unbound'); + equal(map, theMap, 'map being iterated over should be passed in'); + + iteration++; + }, context); + + equal(iteration, 3, 'expected 3 iterations'); + }); + + QUnit.test('forEach basic /w deletion while enumerating', function () { + map.set('a', 1); + map.set('b', 2); + map.set('c', 3); + + var iteration = 0; + + var expectations = [{ value: 1, key: 'a', context: unboundThis }, { value: 2, key: 'b', context: unboundThis }]; + + map.forEach(function (value, key, theMap) { + if (iteration === 0) { + map.delete('c'); + } + + var expectation = expectations[iteration]; + + equal(value, expectation.value, 'value should be correct'); + equal(key, expectation.key, 'key should be correct'); + equal(this, expectation.context, 'context should be as if it was unbound'); + equal(map, theMap, 'map being iterated over should be passed in'); + + iteration++; + }); + + equal(iteration, 2, 'expected 3 iterations'); + }); + + QUnit.test('forEach basic /w addition while enumerating', function () { + map.set('a', 1); + map.set('b', 2); + map.set('c', 3); + + var iteration = 0; + + var expectations = [{ value: 1, key: 'a', context: unboundThis }, { value: 2, key: 'b', context: unboundThis }, { value: 3, key: 'c', context: unboundThis }, { value: 4, key: 'd', context: unboundThis }]; + + map.forEach(function (value, key, theMap) { + if (iteration === 0) { + map.set('d', 4); + } + + var expectation = expectations[iteration]; + + equal(value, expectation.value, 'value should be correct'); + equal(key, expectation.key, 'key should be correct'); + equal(this, expectation.context, 'context should be as if it was unbound'); + equal(map, theMap, 'map being iterated over should be passed in'); + + iteration++; + }); + + equal(iteration, 4, 'expected 3 iterations'); + }); + + QUnit.test('clear', function () { + var iterations = 0; + + map.set('a', 1); + map.set('b', 2); + map.set('c', 3); + map.set('d', 4); + + equal(map.size, 4); + + map.forEach(function () { + iterations++; + }); + equal(iterations, 4); + + map.clear(); + equal(map.size, 0); + iterations = 0; + map.forEach(function () { + iterations++; + }); + equal(iterations, 0); + }); + + QUnit.test('-0', function () { + equal(map.has(-0), false); + equal(map.has(0), false); + + map.set(-0, 'zero'); + + equal(map.has(-0), true); + equal(map.has(0), true); + + equal(map.get(0), 'zero'); + equal(map.get(-0), 'zero'); + + map.forEach(function (value, key) { + equal(1 / key, Infinity, 'spec says key should be positive zero'); + }); + }); + + QUnit.test('NaN', function () { + equal(map.has(NaN), false); + + map.set(NaN, 'not-a-number'); + + equal(map.has(NaN), true); + + equal(map.get(NaN), 'not-a-number'); + }); + + QUnit.test('NaN Boxed', function () { + //jshint -W053 + var boxed = new Number(NaN); + equal(map.has(boxed), false); + + map.set(boxed, 'not-a-number'); + + equal(map.has(boxed), true); + equal(map.has(NaN), false); + + equal(map.get(NaN), undefined); + equal(map.get(boxed), 'not-a-number'); + }); + + QUnit.test('0 value', function () { + var obj = {}; + equal(map.has(obj), false); + + equal(map.size, 0); + map.set(obj, 0); + equal(map.size, 1); + + equal(map.has(obj), true); + equal(map.get(obj), 0); + + map.delete(obj); + equal(map.has(obj), false); + equal(map.get(obj), undefined); + equal(map.size, 0); + }); + } + + for (var i = 0; i < varieties.length; i++) { + testMap(varieties[i]); + } + + QUnit.module('MapWithDefault - default values'); + + QUnit.test('Retrieving a value that has not been set returns and sets a default value', function () { + var map = _emberMetalMap.MapWithDefault.create({ + defaultValue: function (key) { + return [key]; + } + }); + + var value = map.get('ohai'); + deepEqual(value, ['ohai']); + + strictEqual(value, map.get('ohai')); + }); + + QUnit.test('Map.prototype.constructor', function () { + var map = new _emberMetalMap.Map(); + equal(map.constructor, _emberMetalMap.Map); + }); + + QUnit.test('Map() without `new`', function () { + QUnit.throws(function () { + // jshint newcap:false + _emberMetalMap.Map(); + }, /Constructor Map requires 'new'/); + }); + + QUnit.test('MapWithDefault.prototype.constructor', function () { + var map = new _emberMetalMap.MapWithDefault({ + defaultValue: function (key) { + return key; + } + }); + equal(map.constructor, _emberMetalMap.MapWithDefault); + }); + + QUnit.test('Copying a MapWithDefault copies the default value', function () { + var map = _emberMetalMap.MapWithDefault.create({ + defaultValue: function (key) { + return [key]; + } + }); + + map.set('ohai', 1); + map.get('bai'); + + var map2 = map.copy(); + + equal(map2.get('ohai'), 1); + deepEqual(map2.get('bai'), ['bai']); + + map2.set('kthx', 3); + + deepEqual(map.get('kthx'), ['kthx']); + equal(map2.get('kthx'), 3); + + deepEqual(map2.get('default'), ['default']); + + map2.defaultValue = function (key) { + return ['tom is on', key]; + }; + + deepEqual(map2.get('drugs'), ['tom is on', 'drugs']); + }); + + QUnit.module('OrderedSet', { + setup: function () { + object = {}; + number = 42; + string = 'foo'; + + map = _emberMetalMap.OrderedSet.create(); + } + }); + + QUnit.test('OrderedSet() without `new`', function () { + QUnit.throws(function () { + // jshint newcap:false + _emberMetalMap.OrderedSet(); + }, /Constructor OrderedSet requires 'new'/); + }); + + QUnit.test('add returns the set', function () { + var obj = {}; + equal(map.add(obj), map); + equal(map.add(obj), map, 'when it is already in the set'); + }); +}); +enifed('ember-metal/tests/map_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/map_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/map_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/map_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/map_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/map_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/meta_test', ['exports', 'ember-metal/meta'], function (exports, _emberMetalMeta) { + 'use strict'; + + QUnit.module('Ember.meta'); + + QUnit.test('should return the same hash for an object', function () { + var obj = {}; + + _emberMetalMeta.meta(obj).foo = 'bar'; + + equal(_emberMetalMeta.meta(obj).foo, 'bar', 'returns same hash with multiple calls to Ember.meta()'); + }); + + QUnit.test('meta is not enumerable', function () { + var proto = undefined, + obj = undefined, + props = undefined, + prop = undefined; + proto = { foo: 'bar' }; + _emberMetalMeta.meta(proto); + obj = Object.create(proto); + _emberMetalMeta.meta(obj); + obj.bar = 'baz'; + props = []; + for (prop in obj) { + props.push(prop); + } + deepEqual(props.sort(), ['bar', 'foo']); + if (typeof JSON !== 'undefined' && 'stringify' in JSON) { + try { + JSON.stringify(obj); + } catch (e) { + ok(false, 'meta should not fail JSON.stringify'); + } + } + }); + + QUnit.test('meta.listeners basics', function (assert) { + var t = {}; + var m = _emberMetalMeta.meta({}); + m.addToListeners('hello', t, 'm', 0); + var matching = m.matchingListeners('hello'); + assert.equal(matching.length, 3); + assert.equal(matching[0], t); + m.removeFromListeners('hello', t, 'm'); + matching = m.matchingListeners('hello'); + assert.equal(matching.length, 0); + }); + + QUnit.test('meta.listeners inheritance', function (assert) { + var target = {}; + var parent = {}; + var parentMeta = _emberMetalMeta.meta(parent); + parentMeta.addToListeners('hello', target, 'm', 0); + + var child = Object.create(parent); + var m = _emberMetalMeta.meta(child); + + var matching = m.matchingListeners('hello'); + assert.equal(matching.length, 3); + assert.equal(matching[0], target); + assert.equal(matching[1], 'm'); + assert.equal(matching[2], 0); + m.removeFromListeners('hello', target, 'm'); + matching = m.matchingListeners('hello'); + assert.equal(matching.length, 0); + matching = parentMeta.matchingListeners('hello'); + assert.equal(matching.length, 3); + }); + + QUnit.test('meta.listeners deduplication', function (assert) { + var t = {}; + var m = _emberMetalMeta.meta({}); + m.addToListeners('hello', t, 'm', 0); + m.addToListeners('hello', t, 'm', 0); + var matching = m.matchingListeners('hello'); + assert.equal(matching.length, 3); + assert.equal(matching[0], t); + }); +}); +enifed('ember-metal/tests/meta_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/meta_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/meta_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/meta_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/meta_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/meta_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/mixin/alias_method_test', ['exports', 'ember-metal/property_get', 'ember-metal/mixin'], function (exports, _emberMetalProperty_get, _emberMetalMixin) { + 'use strict'; + + QUnit.module('aliasMethod'); + + function validateAliasMethod(obj) { + equal(obj.fooMethod(), 'FOO', 'obj.fooMethod()'); + equal(obj.barMethod(), 'FOO', 'obj.barMethod should be a copy of foo'); + } + + QUnit.test('methods of another name are aliased when the mixin is applied', function () { + var MyMixin = _emberMetalMixin.Mixin.create({ + fooMethod: function () { + return 'FOO'; + }, + barMethod: _emberMetalMixin.aliasMethod('fooMethod') + }); + + var obj = MyMixin.apply({}); + validateAliasMethod(obj); + }); + + QUnit.test('should follow aliasMethods all the way down', function () { + var MyMixin = _emberMetalMixin.Mixin.create({ + bar: _emberMetalMixin.aliasMethod('foo'), // put first to break ordered iteration + baz: function () { + return 'baz'; + }, + foo: _emberMetalMixin.aliasMethod('baz') + }); + + var obj = MyMixin.apply({}); + equal(_emberMetalProperty_get.get(obj, 'bar')(), 'baz', 'should have followed aliasMethods'); + }); + + QUnit.test('should alias methods from other dependent mixins', function () { + var BaseMixin = _emberMetalMixin.Mixin.create({ + fooMethod: function () { + return 'FOO'; + } + }); + + var MyMixin = _emberMetalMixin.Mixin.create(BaseMixin, { + barMethod: _emberMetalMixin.aliasMethod('fooMethod') + }); + + var obj = MyMixin.apply({}); + validateAliasMethod(obj); + }); + + QUnit.test('should alias methods from other mixins applied at same time', function () { + var BaseMixin = _emberMetalMixin.Mixin.create({ + fooMethod: function () { + return 'FOO'; + } + }); + + var MyMixin = _emberMetalMixin.Mixin.create({ + barMethod: _emberMetalMixin.aliasMethod('fooMethod') + }); + + var obj = _emberMetalMixin.mixin({}, BaseMixin, MyMixin); + validateAliasMethod(obj); + }); + + QUnit.test('should alias methods from mixins already applied on object', function () { + var BaseMixin = _emberMetalMixin.Mixin.create({ + quxMethod: function () { + return 'qux'; + } + }); + + var MyMixin = _emberMetalMixin.Mixin.create({ + bar: _emberMetalMixin.aliasMethod('foo'), + barMethod: _emberMetalMixin.aliasMethod('fooMethod') + }); + + var obj = { + fooMethod: function () { + return 'FOO'; + } + }; + + BaseMixin.apply(obj); + MyMixin.apply(obj); + + validateAliasMethod(obj); + }); +}); +enifed('ember-metal/tests/mixin/alias_method_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/mixin'); + test('ember-metal/tests/mixin/alias_method_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/mixin/alias_method_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/mixin/alias_method_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/mixin'); + QUnit.test('ember-metal/tests/mixin/alias_method_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/mixin/alias_method_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/mixin/apply_test', ['exports', 'ember-metal/property_get', 'ember-metal/mixin'], function (exports, _emberMetalProperty_get, _emberMetalMixin) { + 'use strict'; + + QUnit.module('Ember.Mixin.apply'); + + function K() {} + + QUnit.test('using apply() should apply properties', function () { + var MixinA = _emberMetalMixin.Mixin.create({ foo: 'FOO', baz: K }); + var obj = {}; + _emberMetalMixin.mixin(obj, MixinA); + + equal(_emberMetalProperty_get.default(obj, 'foo'), 'FOO', 'should apply foo'); + equal(_emberMetalProperty_get.default(obj, 'baz'), K, 'should apply foo'); + }); + + QUnit.test('applying anonymous properties', function () { + var obj = {}; + _emberMetalMixin.mixin(obj, { + foo: 'FOO', + baz: K + }); + + equal(_emberMetalProperty_get.default(obj, 'foo'), 'FOO', 'should apply foo'); + equal(_emberMetalProperty_get.default(obj, 'baz'), K, 'should apply foo'); + }); + + QUnit.test('applying null values', function () { + expectAssertion(function () { + return _emberMetalMixin.mixin({}, null); + }); + }); + + QUnit.test('applying a property with an undefined value', function () { + var obj = { tagName: '' }; + _emberMetalMixin.mixin(obj, { tagName: undefined }); + + strictEqual(_emberMetalProperty_get.default(obj, 'tagName'), ''); + }); +}); +enifed('ember-metal/tests/mixin/apply_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/mixin'); + test('ember-metal/tests/mixin/apply_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/mixin/apply_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/mixin/apply_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/mixin'); + QUnit.test('ember-metal/tests/mixin/apply_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/mixin/apply_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/mixin/computed_test', ['exports', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/mixin', 'ember-metal/computed', 'ember-metal/properties'], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMixin, _emberMetalComputed, _emberMetalProperties) { + 'use strict'; + + function K() { + return this; + } + + QUnit.module('Mixin Computed Properties'); + + QUnit.test('overriding computed properties', function () { + var MixinA = undefined, + MixinB = undefined, + MixinC = undefined, + MixinD = undefined; + var obj = undefined; + + MixinA = _emberMetalMixin.Mixin.create({ + aProp: _emberMetalComputed.computed(function () { + return 'A'; + }) + }); + + MixinB = _emberMetalMixin.Mixin.create(MixinA, { + aProp: _emberMetalComputed.computed(function () { + return this._super.apply(this, arguments) + 'B'; + }) + }); + + MixinC = _emberMetalMixin.Mixin.create(MixinA, { + aProp: _emberMetalComputed.computed(function () { + return this._super.apply(this, arguments) + 'C'; + }) + }); + + MixinD = _emberMetalMixin.Mixin.create({ + aProp: _emberMetalComputed.computed(function () { + return this._super.apply(this, arguments) + 'D'; + }) + }); + + obj = {}; + MixinB.apply(obj); + equal(_emberMetalProperty_get.get(obj, 'aProp'), 'AB', 'should expose super for B'); + + obj = {}; + MixinC.apply(obj); + equal(_emberMetalProperty_get.get(obj, 'aProp'), 'AC', 'should expose super for C'); + + obj = {}; + + MixinA.apply(obj); + MixinD.apply(obj); + equal(_emberMetalProperty_get.get(obj, 'aProp'), 'AD', 'should define super for D'); + + obj = {}; + _emberMetalProperties.defineProperty(obj, 'aProp', _emberMetalComputed.computed(function (key) { + return 'obj'; + })); + MixinD.apply(obj); + equal(_emberMetalProperty_get.get(obj, 'aProp'), 'objD', 'should preserve original computed property'); + }); + + QUnit.test('calling set on overridden computed properties', function () { + var SuperMixin = undefined, + SubMixin = undefined; + var obj = undefined; + + var superGetOccurred = false; + var superSetOccurred = false; + + SuperMixin = _emberMetalMixin.Mixin.create({ + aProp: _emberMetalComputed.computed({ + get: function (key) { + superGetOccurred = true; + }, + set: function (key, value) { + superSetOccurred = true; + } + }) + }); + + SubMixin = _emberMetalMixin.Mixin.create(SuperMixin, { + aProp: _emberMetalComputed.computed({ + get: function (key) { + return this._super.apply(this, arguments); + }, + set: function (key, value) { + return this._super.apply(this, arguments); + } + }) + }); + + obj = {}; + SubMixin.apply(obj); + + _emberMetalProperty_set.set(obj, 'aProp', 'set thyself'); + ok(superSetOccurred, 'should pass set to _super'); + + superSetOccurred = false; // reset the set assertion + + obj = {}; + SubMixin.apply(obj); + + _emberMetalProperty_get.get(obj, 'aProp'); + ok(superGetOccurred, 'should pass get to _super'); + + _emberMetalProperty_set.set(obj, 'aProp', 'set thyself'); + ok(superSetOccurred, 'should pass set to _super after getting'); + }); + + QUnit.test('setter behavior works properly when overriding computed properties', function () { + var obj = {}; + + var MixinA = _emberMetalMixin.Mixin.create({ + cpWithSetter2: _emberMetalComputed.computed(K), + cpWithSetter3: _emberMetalComputed.computed(K), + cpWithoutSetter: _emberMetalComputed.computed(K) + }); + + var cpWasCalled = false; + + var MixinB = _emberMetalMixin.Mixin.create({ + cpWithSetter2: _emberMetalComputed.computed({ + get: K, + set: function (k, v) { + cpWasCalled = true; + } + }), + + cpWithSetter3: _emberMetalComputed.computed({ + get: K, + set: function (k, v) { + cpWasCalled = true; + } + }), + + cpWithoutSetter: _emberMetalComputed.computed(function (k) { + cpWasCalled = true; + }) + }); + + MixinA.apply(obj); + MixinB.apply(obj); + + _emberMetalProperty_set.set(obj, 'cpWithSetter2', 'test'); + ok(cpWasCalled, 'The computed property setter was called when defined with two args'); + cpWasCalled = false; + + _emberMetalProperty_set.set(obj, 'cpWithSetter3', 'test'); + ok(cpWasCalled, 'The computed property setter was called when defined with three args'); + cpWasCalled = false; + + _emberMetalProperty_set.set(obj, 'cpWithoutSetter', 'test'); + equal(_emberMetalProperty_get.get(obj, 'cpWithoutSetter'), 'test', 'The default setter was called, the value is correct'); + ok(!cpWasCalled, 'The default setter was called, not the CP itself'); + }); +}); +enifed('ember-metal/tests/mixin/computed_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/mixin'); + test('ember-metal/tests/mixin/computed_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/mixin/computed_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/mixin/computed_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/mixin'); + QUnit.test('ember-metal/tests/mixin/computed_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/mixin/computed_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/mixin/concatenated_properties_test', ['exports', 'ember-metal/property_get', 'ember-metal/mixin'], function (exports, _emberMetalProperty_get, _emberMetalMixin) { + 'use strict'; + + QUnit.module('Mixin concatenatedProperties'); + + QUnit.test('defining concatenated properties should concat future version', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + concatenatedProperties: ['foo'], + foo: ['a', 'b', 'c'] + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + foo: ['d', 'e', 'f'] + }); + + var obj = _emberMetalMixin.mixin({}, MixinA, MixinB); + deepEqual(_emberMetalProperty_get.default(obj, 'foo'), ['a', 'b', 'c', 'd', 'e', 'f']); + }); + + QUnit.test('defining concatenated properties should concat future version', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + concatenatedProperties: null + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + concatenatedProperties: null + }); + + var obj = _emberMetalMixin.mixin({}, MixinA, MixinB); + + deepEqual(obj.concatenatedProperties, []); + }); + + QUnit.test('concatenatedProperties should be concatenated', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + concatenatedProperties: ['foo'], + foo: ['a', 'b', 'c'] + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + concatenatedProperties: 'bar', + foo: ['d', 'e', 'f'], + bar: [1, 2, 3] + }); + + var MixinC = _emberMetalMixin.Mixin.create({ + bar: [4, 5, 6] + }); + + var obj = _emberMetalMixin.mixin({}, MixinA, MixinB, MixinC); + deepEqual(_emberMetalProperty_get.default(obj, 'concatenatedProperties'), ['foo', 'bar'], 'get concatenatedProperties'); + deepEqual(_emberMetalProperty_get.default(obj, 'foo'), ['a', 'b', 'c', 'd', 'e', 'f'], 'get foo'); + deepEqual(_emberMetalProperty_get.default(obj, 'bar'), [1, 2, 3, 4, 5, 6], 'get bar'); + }); + + QUnit.test('adding a prop that is not an array should make array', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + concatenatedProperties: ['foo'], + foo: [1, 2, 3] + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + foo: 4 + }); + + var obj = _emberMetalMixin.mixin({}, MixinA, MixinB); + deepEqual(_emberMetalProperty_get.default(obj, 'foo'), [1, 2, 3, 4]); + }); + + QUnit.test('adding a prop that is not an array should make array', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + concatenatedProperties: ['foo'], + foo: 'bar' + }); + + var obj = _emberMetalMixin.mixin({}, MixinA); + deepEqual(_emberMetalProperty_get.default(obj, 'foo'), ['bar']); + }); + + QUnit.test('adding a non-concatenable property that already has a defined value should result in an array with both values', function () { + var mixinA = _emberMetalMixin.Mixin.create({ + foo: 1 + }); + + var mixinB = _emberMetalMixin.Mixin.create({ + concatenatedProperties: ['foo'], + foo: 2 + }); + + var obj = _emberMetalMixin.mixin({}, mixinA, mixinB); + deepEqual(_emberMetalProperty_get.default(obj, 'foo'), [1, 2]); + }); + + QUnit.test('adding a concatenable property that already has a defined value should result in a concatenated value', function () { + var mixinA = _emberMetalMixin.Mixin.create({ + foobar: 'foo' + }); + + var mixinB = _emberMetalMixin.Mixin.create({ + concatenatedProperties: ['foobar'], + foobar: 'bar' + }); + + var obj = _emberMetalMixin.mixin({}, mixinA, mixinB); + equal(_emberMetalProperty_get.default(obj, 'foobar'), 'foobar'); + }); +}); +enifed('ember-metal/tests/mixin/concatenated_properties_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/mixin'); + test('ember-metal/tests/mixin/concatenated_properties_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/mixin/concatenated_properties_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/mixin/concatenated_properties_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/mixin'); + QUnit.test('ember-metal/tests/mixin/concatenated_properties_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/mixin/concatenated_properties_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/mixin/detect_test', ['exports', 'ember-metal/mixin'], function (exports, _emberMetalMixin) { + 'use strict'; + + QUnit.module('Mixin.detect'); + + QUnit.test('detect() finds a directly applied mixin', function () { + var MixinA = _emberMetalMixin.Mixin.create(); + var obj = {}; + + equal(MixinA.detect(obj), false, 'MixinA.detect(obj) before apply()'); + + MixinA.apply(obj); + equal(MixinA.detect(obj), true, 'MixinA.detect(obj) after apply()'); + }); + + QUnit.test('detect() finds nested mixins', function () { + var MixinA = _emberMetalMixin.Mixin.create({}); + var MixinB = _emberMetalMixin.Mixin.create(MixinA); + var obj = {}; + + equal(MixinA.detect(obj), false, 'MixinA.detect(obj) before apply()'); + + MixinB.apply(obj); + equal(MixinA.detect(obj), true, 'MixinA.detect(obj) after apply()'); + }); + + QUnit.test('detect() finds mixins on other mixins', function () { + var MixinA = _emberMetalMixin.Mixin.create({}); + var MixinB = _emberMetalMixin.Mixin.create(MixinA); + equal(MixinA.detect(MixinB), true, 'MixinA is part of MixinB'); + equal(MixinB.detect(MixinA), false, 'MixinB is not part of MixinA'); + }); + + QUnit.test('detect handles null values', function () { + var MixinA = _emberMetalMixin.Mixin.create(); + equal(MixinA.detect(null), false); + }); +}); +enifed('ember-metal/tests/mixin/detect_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/mixin'); + test('ember-metal/tests/mixin/detect_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/mixin/detect_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/mixin/detect_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/mixin'); + QUnit.test('ember-metal/tests/mixin/detect_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/mixin/detect_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/mixin/introspection_test', ['exports', 'ember-utils', 'ember-metal/mixin'], function (exports, _emberUtils, _emberMetalMixin) { + // NOTE: A previous iteration differentiated between public and private props + // as well as methods vs props. We are just keeping these for testing; the + // current impl doesn't care about the differences as much... + + 'use strict'; + + var PrivateProperty = _emberMetalMixin.Mixin.create({ + _foo: '_FOO' + }); + var PublicProperty = _emberMetalMixin.Mixin.create({ + foo: 'FOO' + }); + var PrivateMethod = _emberMetalMixin.Mixin.create({ + _fooMethod: function () {} + }); + var PublicMethod = _emberMetalMixin.Mixin.create({ + fooMethod: function () {} + }); + var BarProperties = _emberMetalMixin.Mixin.create({ + _bar: '_BAR', + bar: 'bar' + }); + var BarMethods = _emberMetalMixin.Mixin.create({ + _barMethod: function () {}, + barMethod: function () {} + }); + + var Combined = _emberMetalMixin.Mixin.create(BarProperties, BarMethods); + + var obj = undefined; + + QUnit.module('Basic introspection', { + setup: function () { + obj = {}; + _emberMetalMixin.mixin(obj, PrivateProperty, PublicProperty, PrivateMethod, PublicMethod, Combined); + } + }); + + QUnit.test('Ember.mixins()', function () { + function mapGuids(ary) { + return ary.map(function (x) { + return _emberUtils.guidFor(x); + }); + } + + deepEqual(mapGuids(_emberMetalMixin.Mixin.mixins(obj)), mapGuids([PrivateProperty, PublicProperty, PrivateMethod, PublicMethod, Combined, BarProperties, BarMethods]), 'should return included mixins'); + }); +}); +enifed('ember-metal/tests/mixin/introspection_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/mixin'); + test('ember-metal/tests/mixin/introspection_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/mixin/introspection_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/mixin/introspection_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/mixin'); + QUnit.test('ember-metal/tests/mixin/introspection_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/mixin/introspection_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/mixin/merged_properties_test', ['exports', 'ember-runtime', 'ember-metal/property_get', 'ember-metal/mixin'], function (exports, _emberRuntime, _emberMetalProperty_get, _emberMetalMixin) { + 'use strict'; + + QUnit.module('Mixin mergedProperties'); + + QUnit.test('defining mergedProperties should merge future version', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + mergedProperties: ['foo'], + foo: { a: true, b: true, c: true } + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + foo: { d: true, e: true, f: true } + }); + + var obj = _emberMetalMixin.mixin({}, MixinA, MixinB); + deepEqual(_emberMetalProperty_get.get(obj, 'foo'), { a: true, b: true, c: true, d: true, e: true, f: true }); + }); + + QUnit.test('defining mergedProperties on future mixin should merged into past', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + foo: { a: true, b: true, c: true } + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + mergedProperties: ['foo'], + foo: { d: true, e: true, f: true } + }); + + var obj = _emberMetalMixin.mixin({}, MixinA, MixinB); + deepEqual(_emberMetalProperty_get.get(obj, 'foo'), { a: true, b: true, c: true, d: true, e: true, f: true }); + }); + + QUnit.test('defining mergedProperties with null properties should keep properties null', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + mergedProperties: ['foo'], + foo: null + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + foo: null + }); + + var obj = _emberMetalMixin.mixin({}, MixinA, MixinB); + equal(_emberMetalProperty_get.get(obj, 'foo'), null); + }); + + QUnit.test('mergedProperties\' properties can get overwritten', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + mergedProperties: ['foo'], + foo: { a: 1 } + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + foo: { a: 2 } + }); + + var obj = _emberMetalMixin.mixin({}, MixinA, MixinB); + deepEqual(_emberMetalProperty_get.get(obj, 'foo'), { a: 2 }); + }); + + QUnit.test('mergedProperties should be concatenated', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + mergedProperties: ['foo'], + foo: { a: true, b: true, c: true } + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + mergedProperties: 'bar', + foo: { d: true, e: true, f: true }, + bar: { a: true, l: true } + }); + + var MixinC = _emberMetalMixin.Mixin.create({ + bar: { e: true, x: true } + }); + + var obj = _emberMetalMixin.mixin({}, MixinA, MixinB, MixinC); + deepEqual(_emberMetalProperty_get.get(obj, 'mergedProperties'), ['foo', 'bar'], 'get mergedProperties'); + deepEqual(_emberMetalProperty_get.get(obj, 'foo'), { a: true, b: true, c: true, d: true, e: true, f: true }, 'get foo'); + deepEqual(_emberMetalProperty_get.get(obj, 'bar'), { a: true, l: true, e: true, x: true }, 'get bar'); + }); + + QUnit.test('mergedProperties should exist even if not explicitly set on create', function () { + var AnObj = _emberRuntime.Object.extend({ + mergedProperties: ['options'], + options: { + a: 'a', + b: { + c: 'ccc' + } + } + }); + + var obj = AnObj.create({ + options: { + a: 'A' + } + }); + + equal(_emberMetalProperty_get.get(obj, 'options').a, 'A'); + equal(_emberMetalProperty_get.get(obj, 'options').b.c, 'ccc'); + }); + + QUnit.test('defining mergedProperties at create time should not modify the prototype', function () { + var AnObj = _emberRuntime.Object.extend({ + mergedProperties: ['options'], + options: { + a: 1 + } + }); + + var objA = AnObj.create({ + options: { + a: 2 + } + }); + var objB = AnObj.create({ + options: { + a: 3 + } + }); + + equal(_emberMetalProperty_get.get(objA, 'options').a, 2); + equal(_emberMetalProperty_get.get(objB, 'options').a, 3); + }); + + QUnit.test('mergedProperties\' overwriting methods can call _super', function () { + expect(4); + + var MixinA = _emberMetalMixin.Mixin.create({ + mergedProperties: ['foo'], + foo: { + meth: function (a) { + equal(a, 'WOOT', '_super successfully called MixinA\'s `foo.meth` method'); + return 'WAT'; + } + } + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + foo: { + meth: function (a) { + ok(true, 'MixinB\'s `foo.meth` method called'); + return this._super.apply(this, arguments); + } + } + }); + + var MixinC = _emberMetalMixin.Mixin.create({ + foo: { + meth: function (a) { + ok(true, 'MixinC\'s `foo.meth` method called'); + return this._super(a); + } + } + }); + + var obj = _emberMetalMixin.mixin({}, MixinA, MixinB, MixinC); + equal(obj.foo.meth('WOOT'), 'WAT'); + }); + + QUnit.test('Merging an Array should raise an error', function () { + expect(1); + + var MixinA = _emberMetalMixin.Mixin.create({ + mergedProperties: ['foo'], + foo: { a: true, b: true, c: true } + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + foo: ['a'] + }); + + expectAssertion(function () { + _emberMetalMixin.mixin({}, MixinA, MixinB); + }, 'You passed in `["a"]` as the value for `foo` but `foo` cannot be an Array'); + }); +}); +enifed('ember-metal/tests/mixin/merged_properties_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/mixin'); + test('ember-metal/tests/mixin/merged_properties_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/mixin/merged_properties_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/mixin/merged_properties_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/mixin'); + QUnit.test('ember-metal/tests/mixin/merged_properties_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/mixin/merged_properties_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/mixin/method_test', ['exports', 'ember-metal/mixin'], function (exports, _emberMetalMixin) { + 'use strict'; + + QUnit.module('Mixin Methods'); + + QUnit.test('defining simple methods', function () { + var MixinA = undefined, + obj = undefined, + props = undefined; + + props = { + publicMethod: function () { + return 'publicMethod'; + }, + _privateMethod: function () { + return 'privateMethod'; + } + }; + + MixinA = _emberMetalMixin.Mixin.create(props); + obj = {}; + MixinA.apply(obj); + + // but should be defined + equal(props.publicMethod(), 'publicMethod', 'publicMethod is func'); + equal(props._privateMethod(), 'privateMethod', 'privateMethod is func'); + }); + + QUnit.test('overriding public methods', function () { + var MixinA = undefined, + MixinB = undefined, + MixinD = undefined, + MixinF = undefined, + obj = undefined; + + MixinA = _emberMetalMixin.Mixin.create({ + publicMethod: function () { + return 'A'; + } + }); + + MixinB = _emberMetalMixin.Mixin.create(MixinA, { + publicMethod: function () { + return this._super.apply(this, arguments) + 'B'; + } + }); + + MixinD = _emberMetalMixin.Mixin.create(MixinA, { + publicMethod: function () { + return this._super.apply(this, arguments) + 'D'; + } + }); + + MixinF = _emberMetalMixin.Mixin.create({ + publicMethod: function () { + return this._super.apply(this, arguments) + 'F'; + } + }); + + obj = {}; + MixinB.apply(obj); + equal(obj.publicMethod(), 'AB', 'should define super for A and B'); + + obj = {}; + MixinD.apply(obj); + equal(obj.publicMethod(), 'AD', 'should define super for A and B'); + + obj = {}; + MixinA.apply(obj); + MixinF.apply(obj); + equal(obj.publicMethod(), 'AF', 'should define super for A and F'); + + obj = { publicMethod: function () { + return 'obj'; + } }; + MixinF.apply(obj); + equal(obj.publicMethod(), 'objF', 'should define super for F'); + }); + + QUnit.test('overriding inherited objects', function () { + var cnt = 0; + var MixinA = _emberMetalMixin.Mixin.create({ + foo: function () { + cnt++; + } + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + foo: function () { + this._super.apply(this, arguments); + cnt++; + } + }); + + var objA = {}; + MixinA.apply(objA); + + var objB = Object.create(objA); + MixinB.apply(objB); + + cnt = 0; + objB.foo(); + equal(cnt, 2, 'should invoke both methods'); + + cnt = 0; + objA.foo(); + equal(cnt, 1, 'should not screw w/ parent obj'); + }); + + QUnit.test('Including the same mixin more than once will only run once', function () { + var cnt = 0; + var MixinA = _emberMetalMixin.Mixin.create({ + foo: function () { + cnt++; + } + }); + + var MixinB = _emberMetalMixin.Mixin.create(MixinA, { + foo: function () { + this._super.apply(this, arguments); + } + }); + + var MixinC = _emberMetalMixin.Mixin.create(MixinA, { + foo: function () { + this._super.apply(this, arguments); + } + }); + + var MixinD = _emberMetalMixin.Mixin.create(MixinB, MixinC, MixinA, { + foo: function () { + this._super.apply(this, arguments); + } + }); + + var obj = {}; + MixinD.apply(obj); + MixinA.apply(obj); // try to apply again.. + + cnt = 0; + obj.foo(); + + equal(cnt, 1, 'should invoke MixinA.foo one time'); + }); + + QUnit.test('_super from a single mixin with no superclass does not error', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + foo: function () { + this._super.apply(this, arguments); + } + }); + + var obj = {}; + MixinA.apply(obj); + + obj.foo(); + ok(true); + }); + + QUnit.test('_super from a first-of-two mixins with no superclass function does not error', function () { + // _super was previously calling itself in the second assertion. + // Use remaining count of calls to ensure it doesn't loop indefinitely. + var remaining = 3; + var MixinA = _emberMetalMixin.Mixin.create({ + foo: function () { + if (remaining-- > 0) { + this._super.apply(this, arguments); + } + } + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + foo: function () { + this._super.apply(this, arguments); + } + }); + + var obj = {}; + MixinA.apply(obj); + MixinB.apply(obj); + + obj.foo(); + ok(true); + }); + + // .......................................................... + // CONFLICTS + // + + QUnit.module('Method Conflicts'); + + QUnit.test('overriding toString', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + toString: function () { + return 'FOO'; + } + }); + + var obj = {}; + MixinA.apply(obj); + equal(obj.toString(), 'FOO', 'should override toString w/o error'); + + obj = {}; + _emberMetalMixin.mixin(obj, { toString: function () { + return 'FOO'; + } }); + equal(obj.toString(), 'FOO', 'should override toString w/o error'); + }); + + // .......................................................... + // BUGS + // + + QUnit.module('system/mixin/method_test BUGS'); + + QUnit.test('applying several mixins at once with sup already defined causes infinite loop', function () { + var cnt = 0; + var MixinA = _emberMetalMixin.Mixin.create({ + foo: function () { + cnt++; + } + }); + + var MixinB = _emberMetalMixin.Mixin.create({ + foo: function () { + this._super.apply(this, arguments); + cnt++; + } + }); + + var MixinC = _emberMetalMixin.Mixin.create({ + foo: function () { + this._super.apply(this, arguments); + cnt++; + } + }); + + var obj = {}; + _emberMetalMixin.mixin(obj, MixinA); // sup already exists + _emberMetalMixin.mixin(obj, MixinB, MixinC); // must be more than one mixin + + cnt = 0; + obj.foo(); + equal(cnt, 3, 'should invoke all 3 methods'); + }); +}); +enifed('ember-metal/tests/mixin/method_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/mixin'); + test('ember-metal/tests/mixin/method_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/mixin/method_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/mixin/method_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/mixin'); + QUnit.test('ember-metal/tests/mixin/method_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/mixin/method_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/mixin/observer_test', ['exports', 'internal-test-helpers', 'ember-metal/mixin', 'ember-metal/watching'], function (exports, _internalTestHelpers, _emberMetalMixin, _emberMetalWatching) { + 'use strict'; + + QUnit.module('Mixin observer'); + + _internalTestHelpers.testBoth('global observer helper', function (get, set) { + var MyMixin = _emberMetalMixin.Mixin.create({ + + count: 0, + + foo: _emberMetalMixin.observer('bar', function () { + set(this, 'count', get(this, 'count') + 1); + }) + + }); + + var obj = _emberMetalMixin.mixin({}, MyMixin); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj, 'bar', 'BAZ'); + equal(get(obj, 'count'), 1, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('global observer helper takes multiple params', function (get, set) { + var MyMixin = _emberMetalMixin.Mixin.create({ + + count: 0, + + foo: _emberMetalMixin.observer('bar', 'baz', function () { + set(this, 'count', get(this, 'count') + 1); + }) + + }); + + var obj = _emberMetalMixin.mixin({}, MyMixin); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj, 'bar', 'BAZ'); + set(obj, 'baz', 'BAZ'); + equal(get(obj, 'count'), 2, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('replacing observer should remove old observer', function (get, set) { + var MyMixin = _emberMetalMixin.Mixin.create({ + + count: 0, + + foo: _emberMetalMixin.observer('bar', function () { + set(this, 'count', get(this, 'count') + 1); + }) + + }); + + var Mixin2 = _emberMetalMixin.Mixin.create({ + foo: _emberMetalMixin.observer('baz', function () { + set(this, 'count', get(this, 'count') + 10); + }) + }); + + var obj = _emberMetalMixin.mixin({}, MyMixin, Mixin2); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj, 'bar', 'BAZ'); + equal(get(obj, 'count'), 0, 'should not invoke observer after change'); + + set(obj, 'baz', 'BAZ'); + equal(get(obj, 'count'), 10, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('observing chain with property before', function (get, set) { + var obj2 = { baz: 'baz' }; + + var MyMixin = _emberMetalMixin.Mixin.create({ + count: 0, + bar: obj2, + foo: _emberMetalMixin.observer('bar.baz', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }); + + var obj = _emberMetalMixin.mixin({}, MyMixin); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj2, 'baz', 'BAZ'); + equal(get(obj, 'count'), 1, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('observing chain with property after', function (get, set) { + var obj2 = { baz: 'baz' }; + + var MyMixin = _emberMetalMixin.Mixin.create({ + count: 0, + foo: _emberMetalMixin.observer('bar.baz', function () { + set(this, 'count', get(this, 'count') + 1); + }), + bar: obj2 + }); + + var obj = _emberMetalMixin.mixin({}, MyMixin); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj2, 'baz', 'BAZ'); + equal(get(obj, 'count'), 1, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('observing chain with property in mixin applied later', function (get, set) { + var obj2 = { baz: 'baz' }; + + var MyMixin = _emberMetalMixin.Mixin.create({ + + count: 0, + foo: _emberMetalMixin.observer('bar.baz', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }); + + var MyMixin2 = _emberMetalMixin.Mixin.create({ bar: obj2 }); + + var obj = _emberMetalMixin.mixin({}, MyMixin); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + MyMixin2.apply(obj); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj2, 'baz', 'BAZ'); + equal(get(obj, 'count'), 1, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('observing chain with existing property', function (get, set) { + var obj2 = { baz: 'baz' }; + + var MyMixin = _emberMetalMixin.Mixin.create({ + count: 0, + foo: _emberMetalMixin.observer('bar.baz', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }); + + var obj = _emberMetalMixin.mixin({ bar: obj2 }, MyMixin); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj2, 'baz', 'BAZ'); + equal(get(obj, 'count'), 1, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('observing chain with property in mixin before', function (get, set) { + var obj2 = { baz: 'baz' }; + var MyMixin2 = _emberMetalMixin.Mixin.create({ bar: obj2 }); + + var MyMixin = _emberMetalMixin.Mixin.create({ + count: 0, + foo: _emberMetalMixin.observer('bar.baz', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }); + + var obj = _emberMetalMixin.mixin({}, MyMixin2, MyMixin); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj2, 'baz', 'BAZ'); + equal(get(obj, 'count'), 1, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('observing chain with property in mixin after', function (get, set) { + var obj2 = { baz: 'baz' }; + var MyMixin2 = _emberMetalMixin.Mixin.create({ bar: obj2 }); + + var MyMixin = _emberMetalMixin.Mixin.create({ + count: 0, + foo: _emberMetalMixin.observer('bar.baz', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }); + + var obj = _emberMetalMixin.mixin({}, MyMixin, MyMixin2); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj2, 'baz', 'BAZ'); + equal(get(obj, 'count'), 1, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('observing chain with overriden property', function (get, set) { + var obj2 = { baz: 'baz' }; + var obj3 = { baz: 'foo' }; + + var MyMixin2 = _emberMetalMixin.Mixin.create({ bar: obj3 }); + + var MyMixin = _emberMetalMixin.Mixin.create({ + count: 0, + foo: _emberMetalMixin.observer('bar.baz', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }); + + var obj = _emberMetalMixin.mixin({ bar: obj2 }, MyMixin, MyMixin2); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + equal(_emberMetalWatching.isWatching(obj2, 'baz'), false, 'should not be watching baz'); + equal(_emberMetalWatching.isWatching(obj3, 'baz'), true, 'should be watching baz'); + + set(obj2, 'baz', 'BAZ'); + equal(get(obj, 'count'), 0, 'should not invoke observer after change'); + + set(obj3, 'baz', 'BEAR'); + equal(get(obj, 'count'), 1, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('providing the arguments in reverse order is deprecated', function (get, set) { + expectDeprecation(/Passing the dependentKeys after the callback function in Ember\.observer is deprecated. Ensure the callback function is the last argument/); + + _emberMetalMixin.Mixin.create({ + count: 0, + foo: _emberMetalMixin.observer(function () { + set(this, 'count', get(this, 'count') + 1); + }, 'bar.baz') + }); + }); +}); +enifed('ember-metal/tests/mixin/observer_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/mixin'); + test('ember-metal/tests/mixin/observer_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/mixin/observer_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/mixin/observer_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/mixin'); + QUnit.test('ember-metal/tests/mixin/observer_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/mixin/observer_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/mixin/reopen_test', ['exports', 'ember-metal/run_loop', 'ember-metal/property_get', 'ember-runtime', 'ember-metal/mixin'], function (exports, _emberMetalRun_loop, _emberMetalProperty_get, _emberRuntime, _emberMetalMixin) { + 'use strict'; + + QUnit.module('Ember.Mixin#reopen'); + + QUnit.test('using reopen() to add more properties to a simple', function () { + var MixinA = _emberMetalMixin.default.create({ foo: 'FOO', baz: 'BAZ' }); + MixinA.reopen({ bar: 'BAR', foo: 'FOO2' }); + var obj = {}; + MixinA.apply(obj); + + equal(_emberMetalProperty_get.default(obj, 'foo'), 'FOO2', 'mixin() should override'); + equal(_emberMetalProperty_get.default(obj, 'baz'), 'BAZ', 'preserve MixinA props'); + equal(_emberMetalProperty_get.default(obj, 'bar'), 'BAR', 'include MixinB props'); + }); + + QUnit.test('using reopen() and calling _super where there is not a super function does not cause infinite recursion', function () { + var Taco = _emberRuntime.Object.extend({ + createBreakfast: function () { + // There is no original createBreakfast function. + // Calling the wrapped _super function here + // used to end in an infinite call loop + this._super.apply(this, arguments); + return 'Breakfast!'; + } + }); + + Taco.reopen({ + createBreakfast: function () { + return this._super.apply(this, arguments); + } + }); + + var taco = Taco.create(); + + var result = undefined; + _emberMetalRun_loop.default(function () { + try { + result = taco.createBreakfast(); + } catch (e) { + result = 'Your breakfast was interrupted by an infinite stack error.'; + } + }); + + equal(result, 'Breakfast!'); + }); +}); +enifed('ember-metal/tests/mixin/reopen_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/mixin'); + test('ember-metal/tests/mixin/reopen_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/mixin/reopen_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/mixin/reopen_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/mixin'); + QUnit.test('ember-metal/tests/mixin/reopen_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/mixin/reopen_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/mixin/required_test', ['exports', 'ember-metal/mixin', 'ember-metal/property_get'], function (exports, _emberMetalMixin, _emberMetalProperty_get) { + 'use strict'; + + var PartialMixin = undefined, + FinalMixin = undefined, + obj = undefined; + + QUnit.module('Module.required', { + setup: function () { + expectDeprecation(function () { + PartialMixin = _emberMetalMixin.Mixin.create({ + foo: _emberMetalMixin.required(), + bar: 'BAR' + }); + }, 'Ember.required is deprecated as its behavior is inconsistent and unreliable.'); + + FinalMixin = _emberMetalMixin.Mixin.create({ + foo: 'FOO' + }); + + obj = {}; + }, + + teardown: function () { + PartialMixin = FinalMixin = obj = null; + } + }); + + QUnit.test('applying a mixin to meet requirement', function () { + FinalMixin.apply(obj); + PartialMixin.apply(obj); + equal(_emberMetalProperty_get.get(obj, 'foo'), 'FOO', 'should now be defined'); + }); + + QUnit.test('combined mixins to meet requirement', function () { + _emberMetalMixin.Mixin.create(PartialMixin, FinalMixin).apply(obj); + equal(_emberMetalProperty_get.get(obj, 'foo'), 'FOO', 'should now be defined'); + }); + + QUnit.test('merged mixin', function () { + _emberMetalMixin.Mixin.create(PartialMixin, { foo: 'FOO' }).apply(obj); + equal(_emberMetalProperty_get.get(obj, 'foo'), 'FOO', 'should now be defined'); + }); + + QUnit.test('define property on source object', function () { + obj.foo = 'FOO'; + PartialMixin.apply(obj); + equal(_emberMetalProperty_get.get(obj, 'foo'), 'FOO', 'should now be defined'); + }); + + QUnit.test('using apply', function () { + _emberMetalMixin.mixin(obj, PartialMixin, { foo: 'FOO' }); + equal(_emberMetalProperty_get.get(obj, 'foo'), 'FOO', 'should now be defined'); + }); +}); +enifed('ember-metal/tests/mixin/required_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/mixin'); + test('ember-metal/tests/mixin/required_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/mixin/required_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/mixin/required_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/mixin'); + QUnit.test('ember-metal/tests/mixin/required_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/mixin/required_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/mixin/without_test', ['exports', 'ember-metal/mixin'], function (exports, _emberMetalMixin) { + 'use strict'; + + QUnit.test('without should create a new mixin excluding named properties', function () { + var MixinA = _emberMetalMixin.Mixin.create({ + foo: 'FOO', + bar: 'BAR' + }); + + var MixinB = MixinA.without('bar'); + + var obj = {}; + MixinB.apply(obj); + + equal(obj.foo, 'FOO', 'should defined foo'); + equal(obj.bar, undefined, 'should not define bar'); + }); +}); +enifed('ember-metal/tests/mixin/without_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/mixin'); + test('ember-metal/tests/mixin/without_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/mixin/without_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/mixin/without_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/mixin'); + QUnit.test('ember-metal/tests/mixin/without_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/mixin/without_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/observer_test', ['exports', 'ember-environment', 'internal-test-helpers', 'ember-metal/observer', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/mixin', 'ember-metal/run_loop'], function (exports, _emberEnvironment, _internalTestHelpers, _emberMetalObserver, _emberMetalProperty_events, _emberMetalProperties, _emberMetalComputed, _emberMetalMixin, _emberMetalRun_loop) { + 'use strict'; + + function K() {} + + // .......................................................... + // ADD OBSERVER + // + + QUnit.module('addObserver'); + + _internalTestHelpers.testBoth('observer should fire when property is modified', function (get, set) { + var obj = {}; + var count = 0; + + _emberMetalObserver.addObserver(obj, 'foo', function () { + equal(get(obj, 'foo'), 'bar', 'should invoke AFTER value changed'); + count++; + }); + + set(obj, 'foo', 'bar'); + equal(count, 1, 'should have invoked observer'); + }); + + _internalTestHelpers.testBoth('observer should fire when dependent property is modified', function (get, set) { + var obj = { bar: 'bar' }; + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed(function () { + return get(this, 'bar').toUpperCase(); + }).property('bar')); + + get(obj, 'foo'); + + var count = 0; + _emberMetalObserver.addObserver(obj, 'foo', function () { + equal(get(obj, 'foo'), 'BAZ', 'should have invoked after prop change'); + count++; + }); + + set(obj, 'bar', 'baz'); + equal(count, 1, 'should have invoked observer'); + }); + + _internalTestHelpers.testBoth('observer should continue to fire after dependent properties are accessed', function (get, set) { + var observerCount = 0; + var obj = {}; + + _emberMetalProperties.defineProperty(obj, 'prop', _emberMetalComputed.computed(function () { + return Math.random(); + })); + _emberMetalProperties.defineProperty(obj, 'anotherProp', _emberMetalComputed.computed('prop', function () { + return get(this, 'prop') + Math.random(); + })); + + _emberMetalObserver.addObserver(obj, 'prop', function () { + observerCount++; + }); + + get(obj, 'anotherProp'); + + for (var i = 0; i < 10; i++) { + _emberMetalProperty_events.propertyWillChange(obj, 'prop'); + _emberMetalProperty_events.propertyDidChange(obj, 'prop'); + } + + equal(observerCount, 10, 'should continue to fire indefinitely'); + }); + + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.Function) { + _internalTestHelpers.testBoth('observer added declaratively via brace expansion should fire when property changes', function (get, set) { + var obj = {}; + var count = 0; + + _emberMetalMixin.mixin(obj, { + observeFooAndBar: (function () { + count++; + }).observes('{foo,bar}') + }); + + set(obj, 'foo', 'foo'); + equal(count, 1, 'observer specified via brace expansion invoked on property change'); + + set(obj, 'bar', 'bar'); + equal(count, 2, 'observer specified via brace expansion invoked on property change'); + + set(obj, 'baz', 'baz'); + equal(count, 2, 'observer not invoked on unspecified property'); + }); + + _internalTestHelpers.testBoth('observer specified declaratively via brace expansion should fire when dependent property changes', function (get, set) { + var obj = { baz: 'Initial' }; + var count = 0; + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed(function () { + return get(this, 'bar').toLowerCase(); + }).property('bar')); + + _emberMetalProperties.defineProperty(obj, 'bar', _emberMetalComputed.computed(function () { + return get(this, 'baz').toUpperCase(); + }).property('baz')); + + _emberMetalMixin.mixin(obj, { + fooAndBarWatcher: (function () { + count++; + }).observes('{foo,bar}') + }); + + get(obj, 'foo'); + set(obj, 'baz', 'Baz'); + // fire once for foo, once for bar + equal(count, 2, 'observer specified via brace expansion invoked on dependent property change'); + + set(obj, 'quux', 'Quux'); + equal(count, 2, 'observer not fired on unspecified property'); + }); + } + + _internalTestHelpers.testBoth('observers watching multiple properties via brace expansion should fire when the properties change', function (get, set) { + var obj = {}; + var count = 0; + + _emberMetalMixin.mixin(obj, { + observeFooAndBar: _emberMetalMixin.observer('{foo,bar}', function () { + count++; + }) + }); + + set(obj, 'foo', 'foo'); + equal(count, 1, 'observer specified via brace expansion invoked on property change'); + + set(obj, 'bar', 'bar'); + equal(count, 2, 'observer specified via brace expansion invoked on property change'); + + set(obj, 'baz', 'baz'); + equal(count, 2, 'observer not invoked on unspecified property'); + }); + + _internalTestHelpers.testBoth('observers watching multiple properties via brace expansion should fire when dependent properties change', function (get, set) { + var obj = { baz: 'Initial' }; + var count = 0; + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed(function () { + return get(this, 'bar').toLowerCase(); + }).property('bar')); + + _emberMetalProperties.defineProperty(obj, 'bar', _emberMetalComputed.computed(function () { + return get(this, 'baz').toUpperCase(); + }).property('baz')); + + _emberMetalMixin.mixin(obj, { + fooAndBarWatcher: _emberMetalMixin.observer('{foo,bar}', function () { + count++; + }) + }); + + get(obj, 'foo'); + set(obj, 'baz', 'Baz'); + // fire once for foo, once for bar + equal(count, 2, 'observer specified via brace expansion invoked on dependent property change'); + + set(obj, 'quux', 'Quux'); + equal(count, 2, 'observer not fired on unspecified property'); + }); + + _internalTestHelpers.testBoth('nested observers should fire in order', function (get, set) { + var obj = { foo: 'foo', bar: 'bar' }; + var fooCount = 0; + var barCount = 0; + + _emberMetalObserver.addObserver(obj, 'foo', function () { + fooCount++; + }); + _emberMetalObserver.addObserver(obj, 'bar', function () { + set(obj, 'foo', 'BAZ'); + equal(fooCount, 1, 'fooCount should have fired already'); + barCount++; + }); + + set(obj, 'bar', 'BIFF'); + equal(barCount, 1, 'barCount should have fired'); + equal(fooCount, 1, 'foo should have fired'); + }); + + _internalTestHelpers.testBoth('removing an chain observer on change should not fail', function (get, set) { + var foo = { bar: 'bar' }; + var obj1 = { foo: foo }; + var obj2 = { foo: foo }; + var obj3 = { foo: foo }; + var obj4 = { foo: foo }; + var count1 = 0; + var count2 = 0; + var count3 = 0; + var count4 = 0; + + function observer1() { + count1++; + } + function observer2() { + count2++; + } + function observer3() { + count3++; + _emberMetalObserver.removeObserver(obj1, 'foo.bar', observer1); + _emberMetalObserver.removeObserver(obj2, 'foo.bar', observer2); + _emberMetalObserver.removeObserver(obj4, 'foo.bar', observer4); + } + function observer4() { + count4++; + } + + _emberMetalObserver.addObserver(obj1, 'foo.bar', observer1); + _emberMetalObserver.addObserver(obj2, 'foo.bar', observer2); + _emberMetalObserver.addObserver(obj3, 'foo.bar', observer3); + _emberMetalObserver.addObserver(obj4, 'foo.bar', observer4); + + set(foo, 'bar', 'baz'); + + equal(count1, 1, 'observer1 fired'); + equal(count2, 1, 'observer2 fired'); + equal(count3, 1, 'observer3 fired'); + equal(count4, 0, 'observer4 did not fire'); + }); + + _internalTestHelpers.testBoth('removing an chain before observer on change should not fail', function (get, set) { + var foo = { bar: 'bar' }; + var obj1 = { foo: foo }; + var obj2 = { foo: foo }; + var obj3 = { foo: foo }; + var obj4 = { foo: foo }; + var count1 = 0; + var count2 = 0; + var count3 = 0; + var count4 = 0; + + function observer1() { + count1++; + } + function observer2() { + count2++; + } + function observer3() { + count3++; + _emberMetalObserver._removeBeforeObserver(obj1, 'foo.bar', observer1); + _emberMetalObserver._removeBeforeObserver(obj2, 'foo.bar', observer2); + _emberMetalObserver._removeBeforeObserver(obj4, 'foo.bar', observer4); + } + function observer4() { + count4++; + } + + _emberMetalObserver._addBeforeObserver(obj1, 'foo.bar', observer1); + _emberMetalObserver._addBeforeObserver(obj2, 'foo.bar', observer2); + _emberMetalObserver._addBeforeObserver(obj3, 'foo.bar', observer3); + _emberMetalObserver._addBeforeObserver(obj4, 'foo.bar', observer4); + + set(foo, 'bar', 'baz'); + + equal(count1, 1, 'observer1 fired'); + equal(count2, 1, 'observer2 fired'); + equal(count3, 1, 'observer3 fired'); + equal(count4, 0, 'observer4 did not fire'); + }); + + _internalTestHelpers.testBoth('suspending an observer should not fire during callback', function (get, set) { + var obj = {}; + var target = undefined, + otherTarget = undefined; + + target = { + values: [], + method: function () { + this.values.push(get(obj, 'foo')); + } + }; + + otherTarget = { + values: [], + method: function () { + this.values.push(get(obj, 'foo')); + } + }; + + _emberMetalObserver.addObserver(obj, 'foo', target, target.method); + _emberMetalObserver.addObserver(obj, 'foo', otherTarget, otherTarget.method); + + function callback() { + /*jshint validthis:true */ + equal(this, target); + + set(obj, 'foo', '2'); + + return 'result'; + } + + set(obj, 'foo', '1'); + + equal(_emberMetalObserver._suspendObserver(obj, 'foo', target, target.method, callback), 'result'); + + set(obj, 'foo', '3'); + + deepEqual(target.values, ['1', '3'], 'should invoke'); + deepEqual(otherTarget.values, ['1', '2', '3'], 'should invoke'); + }); + + _internalTestHelpers.testBoth('suspending an observer should not defer change notifications during callback', function (get, set) { + var obj = {}; + var target = undefined, + otherTarget = undefined; + + target = { + values: [], + method: function () { + this.values.push(get(obj, 'foo')); + } + }; + + otherTarget = { + values: [], + method: function () { + this.values.push(get(obj, 'foo')); + } + }; + + _emberMetalObserver.addObserver(obj, 'foo', target, target.method); + _emberMetalObserver.addObserver(obj, 'foo', otherTarget, otherTarget.method); + + function callback() { + /*jshint validthis:true */ + equal(this, target); + + set(obj, 'foo', '2'); + + return 'result'; + } + + set(obj, 'foo', '1'); + + _emberMetalProperty_events.beginPropertyChanges(); + equal(_emberMetalObserver._suspendObserver(obj, 'foo', target, target.method, callback), 'result'); + _emberMetalProperty_events.endPropertyChanges(); + + set(obj, 'foo', '3'); + + deepEqual(target.values, ['1', '3'], 'should invoke'); + deepEqual(otherTarget.values, ['1', '2', '3'], 'should invoke'); + }); + + _internalTestHelpers.testBoth('suspending observers should not fire during callback', function (get, set) { + var obj = {}; + var target = undefined, + otherTarget = undefined; + + target = { + values: [], + method: function () { + this.values.push(get(obj, 'foo')); + } + }; + + otherTarget = { + values: [], + method: function () { + this.values.push(get(obj, 'foo')); + } + }; + + _emberMetalObserver.addObserver(obj, 'foo', target, target.method); + _emberMetalObserver.addObserver(obj, 'foo', otherTarget, otherTarget.method); + + function callback() { + /*jshint validthis:true */ + equal(this, target); + + set(obj, 'foo', '2'); + + return 'result'; + } + + set(obj, 'foo', '1'); + + equal(_emberMetalObserver._suspendObservers(obj, ['foo'], target, target.method, callback), 'result'); + + set(obj, 'foo', '3'); + + deepEqual(target.values, ['1', '3'], 'should invoke'); + deepEqual(otherTarget.values, ['1', '2', '3'], 'should invoke'); + }); + + _internalTestHelpers.testBoth('suspending observers should not defer change notifications during callback', function (get, set) { + var obj = {}; + var target = undefined, + otherTarget = undefined; + + target = { + values: [], + method: function () { + this.values.push(get(obj, 'foo')); + } + }; + + otherTarget = { + values: [], + method: function () { + this.values.push(get(obj, 'foo')); + } + }; + + _emberMetalObserver.addObserver(obj, 'foo', target, target.method); + _emberMetalObserver.addObserver(obj, 'foo', otherTarget, otherTarget.method); + + function callback() { + /*jshint validthis:true */ + equal(this, target); + + set(obj, 'foo', '2'); + + return 'result'; + } + + set(obj, 'foo', '1'); + + _emberMetalProperty_events.beginPropertyChanges(); + equal(_emberMetalObserver._suspendObservers(obj, ['foo'], target, target.method, callback), 'result'); + _emberMetalProperty_events.endPropertyChanges(); + + set(obj, 'foo', '3'); + + deepEqual(target.values, ['1', '3'], 'should invoke'); + deepEqual(otherTarget.values, ['1', '2', '3'], 'should invoke'); + }); + + _internalTestHelpers.testBoth('deferring property change notifications', function (get, set) { + var obj = { foo: 'foo' }; + var fooCount = 0; + + _emberMetalObserver.addObserver(obj, 'foo', function () { + fooCount++; + }); + + _emberMetalProperty_events.beginPropertyChanges(obj); + set(obj, 'foo', 'BIFF'); + set(obj, 'foo', 'BAZ'); + _emberMetalProperty_events.endPropertyChanges(obj); + + equal(fooCount, 1, 'foo should have fired once'); + }); + + _internalTestHelpers.testBoth('deferring property change notifications safely despite exceptions', function (get, set) { + var obj = { foo: 'foo' }; + var fooCount = 0; + var exc = new Error('Something unexpected happened!'); + + expect(2); + _emberMetalObserver.addObserver(obj, 'foo', function () { + fooCount++; + }); + + try { + _emberMetalProperty_events.changeProperties(function () { + set(obj, 'foo', 'BIFF'); + set(obj, 'foo', 'BAZ'); + throw exc; + }); + } catch (err) { + if (err !== exc) { + throw err; + } + } + + equal(fooCount, 1, 'foo should have fired once'); + + _emberMetalProperty_events.changeProperties(function () { + set(obj, 'foo', 'BIFF2'); + set(obj, 'foo', 'BAZ2'); + }); + + equal(fooCount, 2, 'foo should have fired again once'); + }); + + _internalTestHelpers.testBoth('deferring property change notifications will not defer before observers', function (get, set) { + var obj = { foo: 'foo' }; + var fooCount = 0; + + _emberMetalObserver._addBeforeObserver(obj, 'foo', function () { + fooCount++; + }); + + _emberMetalProperty_events.beginPropertyChanges(obj); + set(obj, 'foo', 'BIFF'); + equal(fooCount, 1, 'should fire before observer immediately'); + set(obj, 'foo', 'BAZ'); + _emberMetalProperty_events.endPropertyChanges(obj); + + equal(fooCount, 1, 'should not fire before observer twice'); + }); + + _internalTestHelpers.testBoth('addObserver should propagate through prototype', function (get, set) { + var obj = { foo: 'foo', count: 0 }; + var obj2 = undefined; + + _emberMetalObserver.addObserver(obj, 'foo', function () { + this.count++; + }); + obj2 = Object.create(obj); + + set(obj2, 'foo', 'bar'); + + equal(obj2.count, 1, 'should have invoked observer on inherited'); + equal(obj.count, 0, 'should not have invoked observer on parent'); + + obj2.count = 0; + set(obj, 'foo', 'baz'); + equal(obj.count, 1, 'should have invoked observer on parent'); + equal(obj2.count, 0, 'should not have invoked observer on inherited'); + }); + + _internalTestHelpers.testBoth('addObserver should respect targets with methods', function (get, set) { + var observed = { foo: 'foo' }; + + var target1 = { + count: 0, + + didChange: function (obj, keyName) { + var value = get(obj, keyName); + equal(this, target1, 'should invoke with this'); + equal(obj, observed, 'param1 should be observed object'); + equal(keyName, 'foo', 'param2 should be keyName'); + equal(value, 'BAZ', 'param3 should new value'); + this.count++; + } + }; + + var target2 = { + count: 0, + + didChange: function (obj, keyName) { + var value = get(obj, keyName); + equal(this, target2, 'should invoke with this'); + equal(obj, observed, 'param1 should be observed object'); + equal(keyName, 'foo', 'param2 should be keyName'); + equal(value, 'BAZ', 'param3 should new value'); + this.count++; + } + }; + + _emberMetalObserver.addObserver(observed, 'foo', target1, 'didChange'); + _emberMetalObserver.addObserver(observed, 'foo', target2, target2.didChange); + + set(observed, 'foo', 'BAZ'); + equal(target1.count, 1, 'target1 observer should have fired'); + equal(target2.count, 1, 'target2 observer should have fired'); + }); + + _internalTestHelpers.testBoth('addObserver should allow multiple objects to observe a property', function (get, set) { + var observed = { foo: 'foo' }; + + var target1 = { + count: 0, + + didChange: function (obj, keyName, value) { + this.count++; + } + }; + + var target2 = { + count: 0, + + didChange: function (obj, keyName, value) { + this.count++; + } + }; + + _emberMetalObserver.addObserver(observed, 'foo', target1, 'didChange'); + _emberMetalObserver.addObserver(observed, 'foo', target2, 'didChange'); + + set(observed, 'foo', 'BAZ'); + equal(target1.count, 1, 'target1 observer should have fired'); + equal(target2.count, 1, 'target2 observer should have fired'); + }); + + // .......................................................... + // REMOVE OBSERVER + // + + QUnit.module('removeObserver'); + + _internalTestHelpers.testBoth('removing observer should stop firing', function (get, set) { + var obj = {}; + var count = 0; + function F() { + count++; + } + _emberMetalObserver.addObserver(obj, 'foo', F); + + set(obj, 'foo', 'bar'); + equal(count, 1, 'should have invoked observer'); + + _emberMetalObserver.removeObserver(obj, 'foo', F); + + set(obj, 'foo', 'baz'); + equal(count, 1, 'removed observer shouldn\'t fire'); + }); + + _internalTestHelpers.testBoth('local observers can be removed', function (get, set) { + var barObserved = 0; + + var MyMixin = _emberMetalMixin.Mixin.create({ + foo1: _emberMetalMixin.observer('bar', function () { + barObserved++; + }), + + foo2: _emberMetalMixin.observer('bar', function () { + barObserved++; + }) + }); + + var obj = {}; + MyMixin.apply(obj); + + set(obj, 'bar', 'HI!'); + equal(barObserved, 2, 'precond - observers should be fired'); + + _emberMetalObserver.removeObserver(obj, 'bar', null, 'foo1'); + + barObserved = 0; + set(obj, 'bar', 'HI AGAIN!'); + + equal(barObserved, 1, 'removed observers should not be called'); + }); + + _internalTestHelpers.testBoth('removeObserver should respect targets with methods', function (get, set) { + var observed = { foo: 'foo' }; + + var target1 = { + count: 0, + + didChange: function () { + this.count++; + } + }; + + var target2 = { + count: 0, + + didChange: function () { + this.count++; + } + }; + + _emberMetalObserver.addObserver(observed, 'foo', target1, 'didChange'); + _emberMetalObserver.addObserver(observed, 'foo', target2, target2.didChange); + + set(observed, 'foo', 'BAZ'); + equal(target1.count, 1, 'target1 observer should have fired'); + equal(target2.count, 1, 'target2 observer should have fired'); + + _emberMetalObserver.removeObserver(observed, 'foo', target1, 'didChange'); + _emberMetalObserver.removeObserver(observed, 'foo', target2, target2.didChange); + + target1.count = target2.count = 0; + set(observed, 'foo', 'BAZ'); + equal(target1.count, 0, 'target1 observer should not fire again'); + equal(target2.count, 0, 'target2 observer should not fire again'); + }); + + // .......................................................... + // BEFORE OBSERVER + // + + QUnit.module('_addBeforeObserver'); + + _internalTestHelpers.testBoth('observer should fire before a property is modified', function (get, set) { + var obj = { foo: 'foo' }; + var count = 0; + + _emberMetalObserver._addBeforeObserver(obj, 'foo', function () { + equal(get(obj, 'foo'), 'foo', 'should invoke before value changed'); + count++; + }); + + set(obj, 'foo', 'bar'); + equal(count, 1, 'should have invoked observer'); + }); + + _internalTestHelpers.testBoth('observer should fire before dependent property is modified', function (get, set) { + var obj = { bar: 'bar' }; + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed(function () { + return get(this, 'bar').toUpperCase(); + }).property('bar')); + + get(obj, 'foo'); + + var count = 0; + _emberMetalObserver._addBeforeObserver(obj, 'foo', function () { + equal(get(obj, 'foo'), 'BAR', 'should have invoked after prop change'); + count++; + }); + + set(obj, 'bar', 'baz'); + equal(count, 1, 'should have invoked observer'); + }); + + _internalTestHelpers.testBoth('before observer watching multiple properties via brace expansion should fire when properties change', function (get, set) { + var obj = {}; + var count = 0; + + _emberMetalMixin.mixin(obj, { + fooAndBarWatcher: _emberMetalMixin._beforeObserver('{foo,bar}', function () { + count++; + }) + }); + + set(obj, 'foo', 'foo'); + equal(count, 1, 'observer specified via brace expansion invoked on property change'); + + set(obj, 'bar', 'bar'); + equal(count, 2, 'observer specified via brace expansion invoked on property change'); + + set(obj, 'baz', 'baz'); + equal(count, 2, 'observer not invoked on unspecified property'); + }); + + _internalTestHelpers.testBoth('before observer watching multiple properties via brace expansion should fire when dependent property changes', function (get, set) { + var obj = { baz: 'Initial' }; + var count = 0; + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed(function () { + return get(this, 'bar').toLowerCase(); + }).property('bar')); + + _emberMetalProperties.defineProperty(obj, 'bar', _emberMetalComputed.computed(function () { + return get(this, 'baz').toUpperCase(); + }).property('baz')); + + _emberMetalMixin.mixin(obj, { + fooAndBarWatcher: _emberMetalMixin._beforeObserver('{foo,bar}', function () { + count++; + }) + }); + + get(obj, 'foo'); + set(obj, 'baz', 'Baz'); + // fire once for foo, once for bar + equal(count, 2, 'observer specified via brace expansion invoked on dependent property change'); + + set(obj, 'quux', 'Quux'); + equal(count, 2, 'observer not fired on unspecified property'); + }); + + _internalTestHelpers.testBoth('_addBeforeObserver should propagate through prototype', function (get, set) { + var obj = { foo: 'foo', count: 0 }; + var obj2 = undefined; + + _emberMetalObserver._addBeforeObserver(obj, 'foo', function () { + this.count++; + }); + obj2 = Object.create(obj); + + set(obj2, 'foo', 'bar'); + equal(obj2.count, 1, 'should have invoked observer on inherited'); + equal(obj.count, 0, 'should not have invoked observer on parent'); + + obj2.count = 0; + set(obj, 'foo', 'baz'); + equal(obj.count, 1, 'should have invoked observer on parent'); + equal(obj2.count, 0, 'should not have invoked observer on inherited'); + }); + + _internalTestHelpers.testBoth('_addBeforeObserver should respect targets with methods', function (get, set) { + var observed = { foo: 'foo' }; + + var target1 = { + count: 0, + + willChange: function (obj, keyName) { + var value = get(obj, keyName); + equal(this, target1, 'should invoke with this'); + equal(obj, observed, 'param1 should be observed object'); + equal(keyName, 'foo', 'param2 should be keyName'); + equal(value, 'foo', 'param3 should old value'); + this.count++; + } + }; + + var target2 = { + count: 0, + + willChange: function (obj, keyName) { + var value = get(obj, keyName); + equal(this, target2, 'should invoke with this'); + equal(obj, observed, 'param1 should be observed object'); + equal(keyName, 'foo', 'param2 should be keyName'); + equal(value, 'foo', 'param3 should old value'); + this.count++; + } + }; + + _emberMetalObserver._addBeforeObserver(observed, 'foo', target1, 'willChange'); + _emberMetalObserver._addBeforeObserver(observed, 'foo', target2, target2.willChange); + + set(observed, 'foo', 'BAZ'); + equal(target1.count, 1, 'target1 observer should have fired'); + equal(target2.count, 1, 'target2 observer should have fired'); + }); + + // .......................................................... + // CHAINED OBSERVERS + // + + var obj = undefined, + count = undefined; + + QUnit.module('addObserver - dependentkey with chained properties', { + setup: function () { + obj = { + foo: { + bar: { + baz: { + biff: 'BIFF' + } + } + }, + Capital: { + foo: { + bar: { + baz: { + biff: 'BIFF' + } + } + } + } + }; + + count = 0; + }, + + teardown: function () { + obj = count = null; + } + }); + + _internalTestHelpers.testBoth('depending on a chain with a computed property', function (get, set) { + _emberMetalProperties.defineProperty(obj, 'computed', _emberMetalComputed.computed(function () { + return { foo: 'bar' }; + })); + + var changed = 0; + _emberMetalObserver.addObserver(obj, 'computed.foo', function () { + changed++; + }); + + equal(_emberMetalComputed.cacheFor(obj, 'computed'), undefined, 'addObserver should not compute CP'); + + set(obj, 'computed.foo', 'baz'); + + equal(changed, 1, 'should fire observer'); + }); + + _internalTestHelpers.testBoth('depending on a simple chain', function (get, set) { + var val = undefined; + _emberMetalObserver.addObserver(obj, 'foo.bar.baz.biff', function (target, key) { + val = get(target, key); + count++; + }); + + set(get(obj, 'foo.bar.baz'), 'biff', 'BUZZ'); + equal(val, 'BUZZ'); + equal(count, 1); + + set(get(obj, 'foo.bar'), 'baz', { biff: 'BLARG' }); + equal(val, 'BLARG'); + equal(count, 2); + + set(get(obj, 'foo'), 'bar', { baz: { biff: 'BOOM' } }); + equal(val, 'BOOM'); + equal(count, 3); + + set(obj, 'foo', { bar: { baz: { biff: 'BLARG' } } }); + equal(val, 'BLARG'); + equal(count, 4); + + set(get(obj, 'foo.bar.baz'), 'biff', 'BUZZ'); + equal(val, 'BUZZ'); + equal(count, 5); + + var foo = get(obj, 'foo'); + + set(obj, 'foo', 'BOO'); + equal(val, undefined); + equal(count, 6); + + set(foo.bar.baz, 'biff', 'BOOM'); + equal(count, 6, 'should be not have invoked observer'); + }); + + _internalTestHelpers.testBoth('depending on a chain with a capitalized first key', function (get, set) { + var val = undefined; + + _emberMetalObserver.addObserver(obj, 'Capital.foo.bar.baz.biff', function (target, key) { + val = get(obj, key); + count++; + }); + + set(get(obj, 'Capital.foo.bar.baz'), 'biff', 'BUZZ'); + equal(val, 'BUZZ'); + equal(count, 1); + + set(get(obj, 'Capital.foo.bar'), 'baz', { biff: 'BLARG' }); + equal(val, 'BLARG'); + equal(count, 2); + + set(get(obj, 'Capital.foo'), 'bar', { baz: { biff: 'BOOM' } }); + equal(val, 'BOOM'); + equal(count, 3); + + set(obj, 'Capital.foo', { bar: { baz: { biff: 'BLARG' } } }); + equal(val, 'BLARG'); + equal(count, 4); + + set(get(obj, 'Capital.foo.bar.baz'), 'biff', 'BUZZ'); + equal(val, 'BUZZ'); + equal(count, 5); + + var foo = get(obj, 'foo'); + + set(obj, 'Capital.foo', 'BOO'); + equal(val, undefined); + equal(count, 6); + + set(foo.bar.baz, 'biff', 'BOOM'); + equal(count, 6, 'should be not have invoked observer'); + }); + + QUnit.module('_removeBeforeObserver'); + + // .......................................................... + // SETTING IDENTICAL VALUES + // + + QUnit.module('props/observer_test - setting identical values'); + + _internalTestHelpers.testBoth('setting simple prop should not trigger', function (get, set) { + var obj = { foo: 'bar' }; + var count = 0; + + _emberMetalObserver.addObserver(obj, 'foo', function () { + count++; + }); + + set(obj, 'foo', 'bar'); + equal(count, 0, 'should not trigger observer'); + + set(obj, 'foo', 'baz'); + equal(count, 1, 'should trigger observer'); + + set(obj, 'foo', 'baz'); + equal(count, 1, 'should not trigger observer again'); + }); + + // The issue here is when a computed property is directly set with a value, then has a + // dependent key change (which triggers a cache expiration and recomputation), observers will + // not be fired if the CP setter is called with the last set value. + _internalTestHelpers.testBoth('setting a cached computed property whose value has changed should trigger', function (get, set) { + var obj = {}; + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed({ + get: function () { + return get(this, 'baz'); + }, + set: function (key, value) { + return value; + } + }).property('baz')); + + var count = 0; + + _emberMetalObserver.addObserver(obj, 'foo', function () { + count++; + }); + + set(obj, 'foo', 'bar'); + equal(count, 1); + equal(get(obj, 'foo'), 'bar'); + + set(obj, 'baz', 'qux'); + equal(count, 2); + equal(get(obj, 'foo'), 'qux'); + + get(obj, 'foo'); + set(obj, 'foo', 'bar'); + equal(count, 3); + equal(get(obj, 'foo'), 'bar'); + }); + + QUnit.module('Ember.immediateObserver (Deprecated)'); + + _internalTestHelpers.testBoth('immediate observers should fire synchronously', function (get, set) { + expectDeprecation(/Usage of `Ember.immediateObserver` is deprecated, use `Ember.observer` instead./); + var obj = {}; + var observerCalled = 0; + var mixin = undefined; + + // explicitly create a run loop so we do not inadvertently + // trigger deferred behavior + _emberMetalRun_loop.default(function () { + mixin = _emberMetalMixin.Mixin.create({ + fooDidChange: _emberMetalMixin._immediateObserver('foo', function () { + observerCalled++; + equal(get(this, 'foo'), 'barbaz', 'newly set value is immediately available'); + }) + }); + + mixin.apply(obj); + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed({ + get: function () { + return 'yes hello this is foo'; + }, + set: function (key, value) { + return value; + } + })); + + equal(get(obj, 'foo'), 'yes hello this is foo', 'precond - computed property returns a value'); + equal(observerCalled, 0, 'observer has not yet been called'); + + set(obj, 'foo', 'barbaz'); + + equal(observerCalled, 1, 'observer was called once'); + }); + }); + + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.Function) { + _internalTestHelpers.testBoth('immediate observers added declaratively via brace expansion fire synchronously', function (get, set) { + var obj = {}; + var observerCalled = 0; + var mixin = undefined; + + // explicitly create a run loop so we do not inadvertently + // trigger deferred behavior + _emberMetalRun_loop.default(function () { + expectDeprecation(function () { + mixin = _emberMetalMixin.Mixin.create({ + fooDidChange: (function () { + observerCalled++; + equal(get(this, 'foo'), 'barbaz', 'newly set value is immediately available'); + }).observesImmediately('{foo,bar}') + }); + }, /Function#observesImmediately is deprecated. Use Function#observes instead/); + + mixin.apply(obj); + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed({ + get: function (key) { + return 'yes hello this is foo'; + }, + set: function (key, value) { + return value; + } + })); + + equal(get(obj, 'foo'), 'yes hello this is foo', 'precond - computed property returns a value'); + equal(observerCalled, 0, 'observer has not yet been called'); + + set(obj, 'foo', 'barbaz'); + + equal(observerCalled, 1, 'observer was called once'); + }); + }); + } + + _internalTestHelpers.testBoth('immediate observers watching multiple properties via brace expansion fire synchronously', function (get, set) { + expectDeprecation(/Usage of `Ember.immediateObserver` is deprecated, use `Ember.observer` instead./); + var obj = {}; + var observerCalled = 0; + var mixin = undefined; + + // explicitly create a run loop so we do not inadvertently + // trigger deferred behavior + _emberMetalRun_loop.default(function () { + mixin = _emberMetalMixin.Mixin.create({ + fooDidChange: _emberMetalMixin._immediateObserver('{foo,bar}', function () { + observerCalled++; + equal(get(this, 'foo'), 'barbaz', 'newly set value is immediately available'); + }) + }); + + mixin.apply(obj); + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed({ + get: function () { + return 'yes hello this is foo'; + }, + set: function (key, value) { + return value; + } + })); + + equal(get(obj, 'foo'), 'yes hello this is foo', 'precond - computed property returns a value'); + equal(observerCalled, 0, 'observer has not yet been called'); + + set(obj, 'foo', 'barbaz'); + + equal(observerCalled, 1, 'observer was called once'); + }); + }); + + _internalTestHelpers.testBoth('immediate observers are for internal properties only', function (get, set) { + expectDeprecation(/Usage of `Ember.immediateObserver` is deprecated, use `Ember.observer` instead./); + expectAssertion(function () { + _emberMetalMixin._immediateObserver('foo.bar', function () { + return this; + }); + }, 'Immediate observers must observe internal properties only, not properties on other objects.'); + }); + + QUnit.module('changeProperties'); + + _internalTestHelpers.testBoth('observers added/removed during changeProperties should do the right thing.', function (get, set) { + var obj = { + foo: 0 + }; + function Observer() { + this.willChangeCount = 0; + this.didChangeCount = 0; + } + Observer.prototype = { + add: function () { + _emberMetalObserver._addBeforeObserver(obj, 'foo', this, 'willChange'); + _emberMetalObserver.addObserver(obj, 'foo', this, 'didChange'); + }, + remove: function () { + _emberMetalObserver._removeBeforeObserver(obj, 'foo', this, 'willChange'); + _emberMetalObserver.removeObserver(obj, 'foo', this, 'didChange'); + }, + willChange: function () { + this.willChangeCount++; + }, + didChange: function () { + this.didChangeCount++; + } + }; + var addedBeforeFirstChangeObserver = new Observer(); + var addedAfterFirstChangeObserver = new Observer(); + var addedAfterLastChangeObserver = new Observer(); + var removedBeforeFirstChangeObserver = new Observer(); + var removedBeforeLastChangeObserver = new Observer(); + var removedAfterLastChangeObserver = new Observer(); + removedBeforeFirstChangeObserver.add(); + removedBeforeLastChangeObserver.add(); + removedAfterLastChangeObserver.add(); + _emberMetalProperty_events.changeProperties(function () { + removedBeforeFirstChangeObserver.remove(); + addedBeforeFirstChangeObserver.add(); + + set(obj, 'foo', 1); + + equal(addedBeforeFirstChangeObserver.willChangeCount, 1, '_addBeforeObserver called before the first change invoked immediately'); + equal(addedBeforeFirstChangeObserver.didChangeCount, 0, 'addObserver called before the first change is deferred'); + + addedAfterFirstChangeObserver.add(); + removedBeforeLastChangeObserver.remove(); + + set(obj, 'foo', 2); + + equal(addedAfterFirstChangeObserver.willChangeCount, 1, '_addBeforeObserver called after the first change invoked immediately'); + equal(addedAfterFirstChangeObserver.didChangeCount, 0, 'addObserver called after the first change is deferred'); + + addedAfterLastChangeObserver.add(); + removedAfterLastChangeObserver.remove(); + }); + + equal(removedBeforeFirstChangeObserver.willChangeCount, 0, '_removeBeforeObserver called before the first change sees none'); + equal(removedBeforeFirstChangeObserver.didChangeCount, 0, 'removeObserver called before the first change sees none'); + equal(addedBeforeFirstChangeObserver.willChangeCount, 1, '_addBeforeObserver called before the first change sees only 1'); + equal(addedBeforeFirstChangeObserver.didChangeCount, 1, 'addObserver called before the first change sees only 1'); + equal(addedAfterFirstChangeObserver.willChangeCount, 1, '_addBeforeObserver called after the first change sees 1'); + equal(addedAfterFirstChangeObserver.didChangeCount, 1, 'addObserver called after the first change sees 1'); + equal(addedAfterLastChangeObserver.willChangeCount, 0, '_addBeforeObserver called after the last change sees none'); + equal(addedAfterLastChangeObserver.didChangeCount, 0, 'addObserver called after the last change sees none'); + equal(removedBeforeLastChangeObserver.willChangeCount, 1, '_removeBeforeObserver called before the last change still sees 1'); + equal(removedBeforeLastChangeObserver.didChangeCount, 1, 'removeObserver called before the last change still sees 1'); + equal(removedAfterLastChangeObserver.willChangeCount, 1, '_removeBeforeObserver called after the last change still sees 1'); + equal(removedAfterLastChangeObserver.didChangeCount, 1, 'removeObserver called after the last change still sees 1'); + }); + + QUnit.module('Keys behavior with observers'); + + _internalTestHelpers.testBoth('should not leak properties on the prototype', function () { + function Beer() {} + Beer.prototype.type = 'ipa'; + + var beer = new Beer(); + + _emberMetalObserver.addObserver(beer, 'type', K); + deepEqual(Object.keys(beer), []); + _emberMetalObserver.removeObserver(beer, 'type', K); + }); + + _internalTestHelpers.testBoth('observing a non existent property', function (get, set) { + function Beer() {} + Beer.prototype.type = 'ipa'; + + var beer = new Beer(); + + _emberMetalObserver.addObserver(beer, 'brand', K); + + deepEqual(Object.keys(beer), []); + + set(beer, 'brand', 'Corona'); + deepEqual(Object.keys(beer), ['brand']); + + _emberMetalObserver.removeObserver(beer, 'brand', K); + }); + + _internalTestHelpers.testBoth('with observers switched on and off', function (get, set) { + function Beer() {} + Beer.prototype.type = 'ipa'; + + var beer = new Beer(); + + _emberMetalObserver.addObserver(beer, 'type', K); + _emberMetalObserver.removeObserver(beer, 'type', K); + + deepEqual(Object.keys(beer), []); + }); + + _internalTestHelpers.testBoth('observers switched on and off with setter in between', function (get, set) { + function Beer() {} + Beer.prototype.type = 'ipa'; + + var beer = new Beer(); + + _emberMetalObserver.addObserver(beer, 'type', K); + set(beer, 'type', 'ale'); + _emberMetalObserver.removeObserver(beer, 'type', K); + + deepEqual(Object.keys(beer), ['type']); + }); + + _internalTestHelpers.testBoth('observer switched on and off and then setter', function (get, set) { + function Beer() {} + Beer.prototype.type = 'ipa'; + + var beer = new Beer(); + + _emberMetalObserver.addObserver(beer, 'type', K); + _emberMetalObserver.removeObserver(beer, 'type', K); + set(beer, 'type', 'ale'); + + deepEqual(Object.keys(beer), ['type']); + }); + + _internalTestHelpers.testBoth('observers switched on and off with setter in between (observed property is not shadowing)', function (get, set) { + function Beer() {} + + var beer = new Beer(); + set(beer, 'type', 'ale'); + deepEqual(Object.keys(beer), ['type'], 'only set'); + + var otherBeer = new Beer(); + _emberMetalObserver.addObserver(otherBeer, 'type', K); + set(otherBeer, 'type', 'ale'); + deepEqual(Object.keys(otherBeer), ['type'], 'addObserver -> set'); + + var yetAnotherBeer = new Beer(); + _emberMetalObserver.addObserver(yetAnotherBeer, 'type', K); + set(yetAnotherBeer, 'type', 'ale'); + _emberMetalObserver.removeObserver(beer, 'type', K); + deepEqual(Object.keys(yetAnotherBeer), ['type'], 'addObserver -> set -> removeObserver'); + + var itsMyLastBeer = new Beer(); + set(itsMyLastBeer, 'type', 'ale'); + _emberMetalObserver.removeObserver(beer, 'type', K); + deepEqual(Object.keys(itsMyLastBeer), ['type'], 'set -> removeObserver'); + }); + + _internalTestHelpers.testBoth('observers switched on and off with setter in between (observed property is shadowing one on the prototype)', function (get, set) { + function Beer() {} + Beer.prototype.type = 'ipa'; + + var beer = new Beer(); + set(beer, 'type', 'ale'); + deepEqual(Object.keys(beer), ['type'], 'after set'); + + var otherBeer = new Beer(); + _emberMetalObserver.addObserver(otherBeer, 'type', K); + set(otherBeer, 'type', 'ale'); + deepEqual(Object.keys(otherBeer), ['type'], 'addObserver -> set'); + + var yetAnotherBeer = new Beer(); + _emberMetalObserver.addObserver(yetAnotherBeer, 'type', K); + set(yetAnotherBeer, 'type', 'ale'); + _emberMetalObserver.removeObserver(beer, 'type', K); + deepEqual(Object.keys(yetAnotherBeer), ['type'], 'addObserver -> set -> removeObserver'); + + var itsMyLastBeer = new Beer(); + set(itsMyLastBeer, 'type', 'ale'); + _emberMetalObserver.removeObserver(beer, 'type', K); + deepEqual(Object.keys(itsMyLastBeer), ['type'], 'set -> removeObserver'); + }); +}); +enifed('ember-metal/tests/observer_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/observer_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/observer_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/observer_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/observer_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/observer_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/performance_test', ['exports', 'ember-metal/property_set', 'ember-metal/property_get', 'ember-metal/computed', 'ember-metal/properties', 'ember-metal/property_events', 'ember-metal/observer'], function (exports, _emberMetalProperty_set, _emberMetalProperty_get, _emberMetalComputed, _emberMetalProperties, _emberMetalProperty_events, _emberMetalObserver) { + 'use strict'; + + /* + This test file is designed to capture performance regressions related to + deferred computation. Things like run loops, computed properties, and bindings + should run the minimum amount of times to achieve best performance, so any + bugs that cause them to get evaluated more than necessary should be put here. + */ + + QUnit.module('Computed Properties - Number of times evaluated'); + + QUnit.test('computed properties that depend on multiple properties should run only once per run loop', function () { + var obj = { a: 'a', b: 'b', c: 'c' }; + var cpCount = 0; + var obsCount = 0; + + _emberMetalProperties.defineProperty(obj, 'abc', _emberMetalComputed.computed(function (key) { + cpCount++; + return 'computed ' + key; + }).property('a', 'b', 'c')); + + _emberMetalProperty_get.get(obj, 'abc'); + + cpCount = 0; + + _emberMetalObserver.addObserver(obj, 'abc', function () { + obsCount++; + }); + + _emberMetalProperty_events.beginPropertyChanges(); + _emberMetalProperty_set.set(obj, 'a', 'aa'); + _emberMetalProperty_set.set(obj, 'b', 'bb'); + _emberMetalProperty_set.set(obj, 'c', 'cc'); + _emberMetalProperty_events.endPropertyChanges(); + + _emberMetalProperty_get.get(obj, 'abc'); + + equal(cpCount, 1, 'The computed property is only invoked once'); + equal(obsCount, 1, 'The observer is only invoked once'); + }); + + QUnit.test('computed properties are not executed if they are the last segment of an observer chain pain', function () { + var foo = { bar: { baz: {} } }; + + var count = 0; + + _emberMetalProperties.defineProperty(foo.bar.baz, 'bam', _emberMetalComputed.computed(function () { + count++; + })); + + _emberMetalObserver.addObserver(foo, 'bar.baz.bam', function () {}); + + _emberMetalProperty_events.propertyDidChange(_emberMetalProperty_get.get(foo, 'bar.baz'), 'bam'); + + equal(count, 0, 'should not have recomputed property'); + }); +}); +enifed('ember-metal/tests/performance_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/performance_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/performance_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/performance_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/performance_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/performance_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/properties_test', ['exports', 'ember-metal/computed', 'ember-metal/properties', 'ember-metal/deprecate_property'], function (exports, _emberMetalComputed, _emberMetalProperties, _emberMetalDeprecate_property) { + 'use strict'; + + QUnit.module('Ember.defineProperty'); + + QUnit.test('toString', function () { + var obj = {}; + _emberMetalProperties.defineProperty(obj, 'toString', undefined, function () { + return 'FOO'; + }); + equal(obj.toString(), 'FOO', 'should replace toString'); + }); + + QUnit.test('for data properties, didDefineProperty hook should be called if implemented', function () { + expect(2); + + var obj = { + didDefineProperty: function (obj, keyName, value) { + equal(keyName, 'foo', 'key name should be foo'); + equal(value, 'bar', 'value should be bar'); + } + }; + + _emberMetalProperties.defineProperty(obj, 'foo', undefined, 'bar'); + }); + + QUnit.test('for computed properties, didDefineProperty hook should be called if implemented', function () { + expect(2); + + var computedProperty = _emberMetalComputed.computed(function () { + return this; + }); + + var obj = { + didDefineProperty: function (obj, keyName, value) { + equal(keyName, 'foo', 'key name should be foo'); + strictEqual(value, computedProperty, 'value should be passed as computed property'); + } + }; + + _emberMetalProperties.defineProperty(obj, 'foo', computedProperty); + }); + + QUnit.test('for descriptor properties, didDefineProperty hook should be called if implemented', function () { + expect(2); + + var descriptor = { + writable: true, + configurable: false, + enumerable: true, + value: 42 + }; + + var obj = { + didDefineProperty: function (obj, keyName, value) { + equal(keyName, 'answer', 'key name should be answer'); + strictEqual(value, descriptor, 'value should be passed as descriptor'); + } + }; + + _emberMetalProperties.defineProperty(obj, 'answer', descriptor); + }); + + QUnit.module('Ember.deprecateProperty'); + + QUnit.test('enables access to deprecated property and returns the value of the new property', function () { + expect(3); + var obj = { foo: 'bar' }; + + _emberMetalDeprecate_property.deprecateProperty(obj, 'baz', 'foo'); + + expectDeprecation(); + equal(obj.baz, obj.foo, 'baz and foo are equal'); + + obj.foo = 'blammo'; + equal(obj.baz, obj.foo, 'baz and foo are equal'); + }); + + QUnit.test('deprecatedKey is not enumerable', function () { + expect(2); + var obj = { foo: 'bar', blammo: 'whammy' }; + + _emberMetalDeprecate_property.deprecateProperty(obj, 'baz', 'foo'); + + for (var prop in obj) { + if (obj.hasOwnProperty(prop)) { + notEqual(prop, 'baz'); + } + } + }); + + QUnit.test('enables setter to deprecated property and updates the value of the new property', function () { + expect(3); + var obj = { foo: 'bar' }; + + _emberMetalDeprecate_property.deprecateProperty(obj, 'baz', 'foo'); + + expectDeprecation(); + obj.baz = 'bloop'; + equal(obj.foo, 'bloop', 'updating baz updates foo'); + equal(obj.baz, obj.foo, 'baz and foo are equal'); + }); +}); +enifed('ember-metal/tests/properties_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/properties_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/properties_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/properties_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/properties_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/properties_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/property_did_change_hook', ['exports', 'internal-test-helpers', 'ember-metal/property_events', 'ember-metal/watching', 'ember-metal/properties', 'ember-metal/alias', 'ember-metal/computed'], function (exports, _internalTestHelpers, _emberMetalProperty_events, _emberMetalWatching, _emberMetalProperties, _emberMetalAlias, _emberMetalComputed) { + 'use strict'; + + QUnit.module('PROPERTY_DID_CHANGE'); + + _internalTestHelpers.testBoth('alias and cp', function (get, set) { + var _obj; + + var counts = {}; + var obj = (_obj = { + child: {} + }, _obj[_emberMetalProperty_events.PROPERTY_DID_CHANGE] = function (keyName) { + counts[keyName] = (counts[keyName] || 0) + 1; + }, _obj); + + _emberMetalProperties.defineProperty(obj, 'cost', _emberMetalAlias.default('child.cost')); + _emberMetalProperties.defineProperty(obj, 'tax', _emberMetalAlias.default('child.tax')); + + _emberMetalProperties.defineProperty(obj, 'total', _emberMetalComputed.computed('cost', 'tax', { + get: function () { + return get(this, 'cost') + get(this, 'tax'); + } + })); + + ok(!_emberMetalWatching.isWatching(obj, 'child.cost'), 'precond alias target `child.cost` is not watched'); + equal(get(obj, 'cost'), undefined); + // this is how PROPERTY_DID_CHANGE will get notified + ok(_emberMetalWatching.isWatching(obj, 'child.cost'), 'alias target `child.cost` is watched after consumption'); + + ok(!_emberMetalWatching.isWatching(obj, 'child.tax'), 'precond alias target `child.tax` is not watched'); + equal(get(obj, 'tax'), undefined); + // this is how PROPERTY_DID_CHANGE will get notified + ok(_emberMetalWatching.isWatching(obj, 'child.tax'), 'alias target `child.cost` is watched after consumption'); + + // increments the watching count on the alias itself to 1 + ok(isNaN(get(obj, 'total')), 'total is initialized'); + + // decrements the watching count on the alias itself to 0 + set(obj, 'child', { + cost: 399.00, + tax: 32.93 + }); + + // this should have called PROPERTY_DID_CHANGE for all of them + equal(counts['cost'], 1, 'PROPERTY_DID_CHANGE called with cost'); + equal(counts['tax'], 1, 'PROPERTY_DID_CHANGE called with tax'); + equal(counts['total'], 1, 'PROPERTY_DID_CHANGE called with total'); + + // we should still have a dependency installed + ok(_emberMetalWatching.isWatching(obj, 'child.cost'), 'watching child.cost'); + ok(_emberMetalWatching.isWatching(obj, 'child.tax'), 'watching child.tax'); + + set(obj, 'child', { + cost: 100.00, + tax: 10.00 + }); + + equal(counts['cost'], 2, 'PROPERTY_DID_CHANGE called with cost'); + equal(counts['tax'], 2, 'PROPERTY_DID_CHANGE called with tax'); + equal(counts['total'], 1, 'PROPERTY_DID_CHANGE called with total'); + }); +}); +enifed('ember-metal/tests/property_did_change_hook.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/property_did_change_hook.js should pass jscs', function () { + ok(true, 'ember-metal/tests/property_did_change_hook.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/property_did_change_hook.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/property_did_change_hook.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/property_did_change_hook.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/run_loop/add_queue_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { + 'use strict'; + + var originalQueues = _emberMetalRun_loop.default.queues; + var queues = undefined; + + QUnit.module('system/run_loop/add_queue_test', { + setup: function () { + _emberMetalRun_loop.default.queues = queues = ['blork', 'bleep']; + }, + teardown: function () { + _emberMetalRun_loop.default.queues = originalQueues; + } + }); + + QUnit.test('adds a queue after a specified one', function () { + _emberMetalRun_loop.default._addQueue('testeroo', 'blork'); + + equal(queues.indexOf('testeroo'), 1, 'new queue was added after specified queue'); + }); + + QUnit.test('does not add the queue if it already exists', function () { + _emberMetalRun_loop.default._addQueue('testeroo', 'blork'); + _emberMetalRun_loop.default._addQueue('testeroo', 'blork'); + + equal(queues.length, 3, 'queue was not added twice'); + }); +}); +enifed('ember-metal/tests/run_loop/add_queue_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/run_loop'); + test('ember-metal/tests/run_loop/add_queue_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/run_loop/add_queue_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/run_loop/add_queue_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/run_loop'); + QUnit.test('ember-metal/tests/run_loop/add_queue_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/run_loop/add_queue_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/run_loop/debounce_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { + 'use strict'; + + var originalDebounce = _emberMetalRun_loop.default.backburner.debounce; + var wasCalled = false; + + QUnit.module('Ember.run.debounce', { + setup: function () { + _emberMetalRun_loop.default.backburner.debounce = function () { + wasCalled = true; + }; + }, + teardown: function () { + _emberMetalRun_loop.default.backburner.debounce = originalDebounce; + } + }); + + QUnit.test('Ember.run.debounce uses Backburner.debounce', function () { + _emberMetalRun_loop.default.debounce(function () {}); + ok(wasCalled, 'Ember.run.debounce used'); + }); +}); +enifed('ember-metal/tests/run_loop/debounce_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/run_loop'); + test('ember-metal/tests/run_loop/debounce_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/run_loop/debounce_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/run_loop/debounce_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/run_loop'); + QUnit.test('ember-metal/tests/run_loop/debounce_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/run_loop/debounce_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/run_loop/later_test', ['exports', 'ember-metal/is_none', 'ember-metal/run_loop'], function (exports, _emberMetalIs_none, _emberMetalRun_loop) { + 'use strict'; + + var originalSetTimeout = window.setTimeout; + var originalDateValueOf = Date.prototype.valueOf; + var originalPlatform = _emberMetalRun_loop.default.backburner._platform; + + function wait(callback, maxWaitCount) { + maxWaitCount = _emberMetalIs_none.default(maxWaitCount) ? 100 : maxWaitCount; + + originalSetTimeout(function () { + if (maxWaitCount > 0 && (_emberMetalRun_loop.default.hasScheduledTimers() || _emberMetalRun_loop.default.currentRunLoop)) { + wait(callback, maxWaitCount - 1); + + return; + } + + callback(); + }, 10); + } + + // Synchronous "sleep". This simulates work being done + // after run.later was called but before the run loop + // has flushed. In previous versions, this would have + // caused the run.later callback to have run from + // within the run loop flush, since by the time the + // run loop has to flush, it would have considered + // the timer already expired. + function pauseUntil(time) { + // jscs:disable + while (+new Date() < time) {} /* do nothing - sleeping */ + // jscs:enable + } + + QUnit.module('run.later', { + teardown: function () { + _emberMetalRun_loop.default.backburner._platform = originalPlatform; + window.setTimeout = originalSetTimeout; + Date.prototype.valueOf = originalDateValueOf; + } + }); + + asyncTest('should invoke after specified period of time - function only', function () { + var invoked = false; + + _emberMetalRun_loop.default(function () { + _emberMetalRun_loop.default.later(function () { + return invoked = true; + }, 100); + }); + + wait(function () { + QUnit.start(); + equal(invoked, true, 'should have invoked later item'); + }); + }); + + asyncTest('should invoke after specified period of time - target/method', function () { + var obj = { invoked: false }; + + _emberMetalRun_loop.default(function () { + _emberMetalRun_loop.default.later(obj, function () { + this.invoked = true; + }, 100); + }); + + wait(function () { + QUnit.start(); + equal(obj.invoked, true, 'should have invoked later item'); + }); + }); + + asyncTest('should invoke after specified period of time - target/method/args', function () { + var obj = { invoked: 0 }; + + _emberMetalRun_loop.default(function () { + _emberMetalRun_loop.default.later(obj, function (amt) { + this.invoked += amt; + }, 10, 100); + }); + + wait(function () { + QUnit.start(); + equal(obj.invoked, 10, 'should have invoked later item'); + }); + }); + + asyncTest('should always invoke within a separate runloop', function () { + var obj = { invoked: 0 }; + var firstRunLoop = undefined, + secondRunLoop = undefined; + + _emberMetalRun_loop.default(function () { + firstRunLoop = _emberMetalRun_loop.default.currentRunLoop; + + _emberMetalRun_loop.default.later(obj, function (amt) { + this.invoked += amt; + secondRunLoop = _emberMetalRun_loop.default.currentRunLoop; + }, 10, 1); + + pauseUntil(+new Date() + 100); + }); + + ok(firstRunLoop, 'first run loop captured'); + ok(!_emberMetalRun_loop.default.currentRunLoop, 'shouldn\'t be in a run loop after flush'); + equal(obj.invoked, 0, 'shouldn\'t have invoked later item yet'); + + wait(function () { + QUnit.start(); + equal(obj.invoked, 10, 'should have invoked later item'); + ok(secondRunLoop, 'second run loop took place'); + ok(secondRunLoop !== firstRunLoop, 'two different run loops took place'); + }); + }); + + // Our current implementation doesn't allow us to correctly enforce this ordering. + // We should probably implement a queue to provide this guarantee. + // See https://github.com/emberjs/ember.js/issues/3526 for more information. + + // asyncTest('callback order', function() { + // let array = []; + // function fn(val) { array.push(val); } + + // run(function() { + // run.later(this, fn, 4, 5); + // run.later(this, fn, 1, 1); + // run.later(this, fn, 5, 10); + // run.later(this, fn, 2, 3); + // run.later(this, fn, 3, 3); + // }); + + // deepEqual(array, []); + + // wait(function() { + // QUnit.start(); + // deepEqual(array, [1,2,3,4,5], 'callbacks were called in expected order'); + // }); + // }); + + // Out current implementation doesn't allow us to properly enforce what is tested here. + // We should probably fix it, but it's not technically a bug right now. + // See https://github.com/emberjs/ember.js/issues/3522 for more information. + + // asyncTest('callbacks coalesce into same run loop if expiring at the same time', function() { + // let array = []; + // function fn(val) { array.push(run.currentRunLoop); } + + // run(function() { + + // // Force +new Date to return the same result while scheduling + // // run.later timers. Otherwise: non-determinism! + // let now = +new Date(); + // Date.prototype.valueOf = function() { return now; }; + + // run.later(this, fn, 10); + // run.later(this, fn, 200); + // run.later(this, fn, 200); + + // Date.prototype.valueOf = originalDateValueOf; + // }); + + // deepEqual(array, []); + + // wait(function() { + // QUnit.start(); + // equal(array.length, 3, 'all callbacks called'); + // ok(array[0] !== array[1], 'first two callbacks have different run loops'); + // ok(array[0], 'first runloop present'); + // ok(array[1], 'second runloop present'); + // equal(array[1], array[2], 'last two callbacks got the same run loop'); + // }); + // }); + + asyncTest('inception calls to run.later should run callbacks in separate run loops', function () { + var runLoop = undefined, + finished = undefined; + + _emberMetalRun_loop.default(function () { + runLoop = _emberMetalRun_loop.default.currentRunLoop; + ok(runLoop); + + _emberMetalRun_loop.default.later(function () { + ok(_emberMetalRun_loop.default.currentRunLoop && _emberMetalRun_loop.default.currentRunLoop !== runLoop, 'first later callback has own run loop'); + runLoop = _emberMetalRun_loop.default.currentRunLoop; + + _emberMetalRun_loop.default.later(function () { + ok(_emberMetalRun_loop.default.currentRunLoop && _emberMetalRun_loop.default.currentRunLoop !== runLoop, 'second later callback has own run loop'); + finished = true; + }, 40); + }, 40); + }); + + wait(function () { + QUnit.start(); + ok(finished, 'all .later callbacks run'); + }); + }); + + asyncTest('setTimeout should never run with a negative wait', function () { + // Rationale: The old run loop code was susceptible to an occasional + // bug where invokeLaterTimers would be scheduled with a setTimeout + // with a negative wait. Modern browsers normalize this to 0, but + // older browsers (IE <= 8) break with a negative wait, which + // happens when an expired timer callback takes a while to run, + // which is what we simulate here. + var newSetTimeoutUsed = undefined; + _emberMetalRun_loop.default.backburner._platform = { + setTimeout: function () { + var wait = arguments[arguments.length - 1]; + newSetTimeoutUsed = true; + ok(!isNaN(wait) && wait >= 0, 'wait is a non-negative number'); + + return originalPlatform.setTimeout.apply(originalPlatform, arguments); + } + }; + + var count = 0; + _emberMetalRun_loop.default(function () { + _emberMetalRun_loop.default.later(function () { + count++; + + // This will get run first. Waste some time. + // This is intended to break invokeLaterTimers code by taking a + // long enough time that other timers should technically expire. It's + // fine that they're not called in this run loop; just need to + // make sure that invokeLaterTimers doesn't end up scheduling + // a negative setTimeout. + pauseUntil(+new Date() + 60); + }, 1); + + _emberMetalRun_loop.default.later(function () { + equal(count, 1, 'callbacks called in order'); + }, 50); + }); + + wait(function () { + QUnit.start(); + ok(newSetTimeoutUsed, 'stub setTimeout was used'); + }); + }); +}); +enifed('ember-metal/tests/run_loop/later_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/run_loop'); + test('ember-metal/tests/run_loop/later_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/run_loop/later_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/run_loop/later_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/run_loop'); + QUnit.test('ember-metal/tests/run_loop/later_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/run_loop/later_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/run_loop/next_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { + 'use strict'; + + QUnit.module('run.next'); + + asyncTest('should invoke immediately on next timeout', function () { + var invoked = false; + + _emberMetalRun_loop.default(function () { + return _emberMetalRun_loop.default.next(function () { + return invoked = true; + }); + }); + + equal(invoked, false, 'should not have invoked yet'); + + setTimeout(function () { + QUnit.start(); + equal(invoked, true, 'should have invoked later item'); + }, 20); + }); + + asyncTest('callback should be called from within separate loop', function () { + var firstRunLoop = undefined, + secondRunLoop = undefined; + _emberMetalRun_loop.default(function () { + firstRunLoop = _emberMetalRun_loop.default.currentRunLoop; + _emberMetalRun_loop.default.next(function () { + return secondRunLoop = _emberMetalRun_loop.default.currentRunLoop; + }); + }); + + setTimeout(function () { + QUnit.start(); + ok(secondRunLoop, 'callback was called from within run loop'); + ok(firstRunLoop && secondRunLoop !== firstRunLoop, 'two separate run loops were invoked'); + }, 20); + }); + + asyncTest('multiple calls to run.next share coalesce callbacks into same run loop', function () { + var firstRunLoop = undefined, + secondRunLoop = undefined, + thirdRunLoop = undefined; + _emberMetalRun_loop.default(function () { + firstRunLoop = _emberMetalRun_loop.default.currentRunLoop; + _emberMetalRun_loop.default.next(function () { + return secondRunLoop = _emberMetalRun_loop.default.currentRunLoop; + }); + _emberMetalRun_loop.default.next(function () { + return thirdRunLoop = _emberMetalRun_loop.default.currentRunLoop; + }); + }); + + setTimeout(function () { + QUnit.start(); + ok(secondRunLoop && secondRunLoop === thirdRunLoop, 'callbacks coalesced into same run loop'); + }, 20); + }); +}); +enifed('ember-metal/tests/run_loop/next_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/run_loop'); + test('ember-metal/tests/run_loop/next_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/run_loop/next_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/run_loop/next_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/run_loop'); + QUnit.test('ember-metal/tests/run_loop/next_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/run_loop/next_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/run_loop/once_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { + 'use strict'; + + QUnit.module('system/run_loop/once_test'); + + QUnit.test('calling invokeOnce more than once invokes only once', function () { + var count = 0; + _emberMetalRun_loop.default(function () { + function F() { + count++; + } + _emberMetalRun_loop.default.once(F); + _emberMetalRun_loop.default.once(F); + _emberMetalRun_loop.default.once(F); + }); + + equal(count, 1, 'should have invoked once'); + }); + + QUnit.test('should differentiate based on target', function () { + var A = { count: 0 }; + var B = { count: 0 }; + _emberMetalRun_loop.default(function () { + function F() { + this.count++; + } + _emberMetalRun_loop.default.once(A, F); + _emberMetalRun_loop.default.once(B, F); + _emberMetalRun_loop.default.once(A, F); + _emberMetalRun_loop.default.once(B, F); + }); + + equal(A.count, 1, 'should have invoked once on A'); + equal(B.count, 1, 'should have invoked once on B'); + }); + + QUnit.test('should ignore other arguments - replacing previous ones', function () { + var A = { count: 0 }; + var B = { count: 0 }; + + _emberMetalRun_loop.default(function () { + function F(amt) { + this.count += amt; + } + _emberMetalRun_loop.default.once(A, F, 10); + _emberMetalRun_loop.default.once(B, F, 20); + _emberMetalRun_loop.default.once(A, F, 30); + _emberMetalRun_loop.default.once(B, F, 40); + }); + + equal(A.count, 30, 'should have invoked once on A'); + equal(B.count, 40, 'should have invoked once on B'); + }); + + QUnit.test('should be inside of a runloop when running', function () { + _emberMetalRun_loop.default(function () { + _emberMetalRun_loop.default.once(function () { + return ok(!!_emberMetalRun_loop.default.currentRunLoop, 'should have a runloop'); + }); + }); + }); +}); +enifed('ember-metal/tests/run_loop/once_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/run_loop'); + test('ember-metal/tests/run_loop/once_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/run_loop/once_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/run_loop/once_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/run_loop'); + QUnit.test('ember-metal/tests/run_loop/once_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/run_loop/once_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/run_loop/onerror_test', ['exports', 'ember-metal/run_loop', 'ember-metal/error_handler'], function (exports, _emberMetalRun_loop, _emberMetalError_handler) { + 'use strict'; + + QUnit.module('system/run_loop/onerror_test'); + + QUnit.test('With Ember.onerror undefined, errors in Ember.run are thrown', function () { + var thrown = new Error('Boom!'); + var original = _emberMetalError_handler.getOnerror(); + + var caught = undefined; + _emberMetalError_handler.setOnerror(undefined); + try { + _emberMetalRun_loop.default(function () { + throw thrown; + }); + } catch (error) { + caught = error; + } finally { + _emberMetalError_handler.setOnerror(original); + } + + deepEqual(caught, thrown); + }); + + QUnit.test('With Ember.onerror set, errors in Ember.run are caught', function () { + var thrown = new Error('Boom!'); + var original = _emberMetalError_handler.getOnerror(); + + var caught = undefined; + _emberMetalError_handler.setOnerror(function (error) { + caught = error; + }); + try { + _emberMetalRun_loop.default(function () { + throw thrown; + }); + } finally { + _emberMetalError_handler.setOnerror(original); + } + + deepEqual(caught, thrown); + }); +}); +enifed('ember-metal/tests/run_loop/onerror_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/run_loop'); + test('ember-metal/tests/run_loop/onerror_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/run_loop/onerror_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/run_loop/onerror_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/run_loop'); + QUnit.test('ember-metal/tests/run_loop/onerror_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/run_loop/onerror_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/run_loop/run_bind_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { + 'use strict'; + + QUnit.module('system/run_loop/run_bind_test'); + + QUnit.test('Ember.run.bind builds a run-loop wrapped callback handler', function () { + expect(3); + + var obj = { + value: 0, + increment: function (increment) { + ok(_emberMetalRun_loop.default.currentRunLoop, 'expected a run-loop'); + return this.value += increment; + } + }; + + var proxiedFunction = _emberMetalRun_loop.default.bind(obj, obj.increment, 1); + equal(proxiedFunction(), 1); + equal(obj.value, 1); + }); + + QUnit.test('Ember.run.bind keeps the async callback arguments', function () { + expect(4); + + function asyncCallback(increment, increment2, increment3) { + ok(_emberMetalRun_loop.default.currentRunLoop, 'expected a run-loop'); + equal(increment, 1); + equal(increment2, 2); + equal(increment3, 3); + } + + function asyncFunction(fn) { + fn(2, 3); + } + + asyncFunction(_emberMetalRun_loop.default.bind(asyncCallback, asyncCallback, 1)); + }); +}); +enifed('ember-metal/tests/run_loop/run_bind_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/run_loop'); + test('ember-metal/tests/run_loop/run_bind_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/run_loop/run_bind_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/run_loop/run_bind_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/run_loop'); + QUnit.test('ember-metal/tests/run_loop/run_bind_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/run_loop/run_bind_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/run_loop/run_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { + 'use strict'; + + QUnit.module('system/run_loop/run_test'); + + QUnit.test('Ember.run invokes passed function, returning value', function () { + var obj = { + foo: function () { + return [this.bar, 'FOO']; + }, + bar: 'BAR', + checkArgs: function (arg1, arg2) { + return [arg1, this.bar, arg2]; + } + }; + + equal(_emberMetalRun_loop.default(function () { + return 'FOO'; + }), 'FOO', 'pass function only'); + deepEqual(_emberMetalRun_loop.default(obj, obj.foo), ['BAR', 'FOO'], 'pass obj and obj.method'); + deepEqual(_emberMetalRun_loop.default(obj, 'foo'), ['BAR', 'FOO'], 'pass obj and "method"'); + deepEqual(_emberMetalRun_loop.default(obj, obj.checkArgs, 'hello', 'world'), ['hello', 'BAR', 'world'], 'pass obj, obj.method, and extra arguments'); + }); +}); +enifed('ember-metal/tests/run_loop/run_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/run_loop'); + test('ember-metal/tests/run_loop/run_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/run_loop/run_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/run_loop/run_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/run_loop'); + QUnit.test('ember-metal/tests/run_loop/run_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/run_loop/run_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/run_loop/schedule_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { + 'use strict'; + + QUnit.module('system/run_loop/schedule_test'); + + QUnit.test('scheduling item in queue should defer until finished', function () { + var cnt = 0; + + _emberMetalRun_loop.default(function () { + _emberMetalRun_loop.default.schedule('actions', function () { + return cnt++; + }); + _emberMetalRun_loop.default.schedule('actions', function () { + return cnt++; + }); + equal(cnt, 0, 'should not run action yet'); + }); + + equal(cnt, 2, 'should flush actions now'); + }); + + QUnit.test('a scheduled item can be canceled', function (assert) { + var hasRan = false; + + _emberMetalRun_loop.default(function () { + var cancelId = _emberMetalRun_loop.default.schedule('actions', function () { + return hasRan = true; + }); + _emberMetalRun_loop.default.cancel(cancelId); + }); + + assert.notOk(hasRan, 'should not have ran callback run'); + }); + + QUnit.test('nested runs should queue each phase independently', function () { + var cnt = 0; + + _emberMetalRun_loop.default(function () { + _emberMetalRun_loop.default.schedule('actions', function () { + return cnt++; + }); + equal(cnt, 0, 'should not run action yet'); + + _emberMetalRun_loop.default(function () { + _emberMetalRun_loop.default.schedule('actions', function () { + return cnt++; + }); + }); + equal(cnt, 1, 'should not run action yet'); + }); + + equal(cnt, 2, 'should flush actions now'); + }); + + QUnit.test('prior queues should be flushed before moving on to next queue', function () { + var order = []; + + _emberMetalRun_loop.default(function () { + var runLoop = _emberMetalRun_loop.default.currentRunLoop; + ok(runLoop, 'run loop present'); + + _emberMetalRun_loop.default.schedule('sync', function () { + order.push('sync'); + equal(runLoop, _emberMetalRun_loop.default.currentRunLoop, 'same run loop used'); + }); + + _emberMetalRun_loop.default.schedule('actions', function () { + order.push('actions'); + equal(runLoop, _emberMetalRun_loop.default.currentRunLoop, 'same run loop used'); + + _emberMetalRun_loop.default.schedule('actions', function () { + order.push('actions'); + equal(runLoop, _emberMetalRun_loop.default.currentRunLoop, 'same run loop used'); + }); + + _emberMetalRun_loop.default.schedule('sync', function () { + order.push('sync'); + equal(runLoop, _emberMetalRun_loop.default.currentRunLoop, 'same run loop used'); + }); + }); + + _emberMetalRun_loop.default.schedule('destroy', function () { + order.push('destroy'); + equal(runLoop, _emberMetalRun_loop.default.currentRunLoop, 'same run loop used'); + }); + }); + + deepEqual(order, ['sync', 'actions', 'sync', 'actions', 'destroy']); + }); + + QUnit.test('makes sure it does not trigger an autorun during testing', function () { + expectAssertion(function () { + return _emberMetalRun_loop.default.schedule('actions', function () {}); + }, /wrap any code with asynchronous side-effects in a run/); + + // make sure not just the first violation is asserted. + expectAssertion(function () { + return _emberMetalRun_loop.default.schedule('actions', function () {}); + }, /wrap any code with asynchronous side-effects in a run/); + }); +}); +enifed('ember-metal/tests/run_loop/schedule_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/run_loop'); + test('ember-metal/tests/run_loop/schedule_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/run_loop/schedule_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/run_loop/schedule_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/run_loop'); + QUnit.test('ember-metal/tests/run_loop/schedule_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/run_loop/schedule_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/run_loop/sync_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { + 'use strict'; + + QUnit.module('system/run_loop/sync_test'); + + QUnit.test('sync() will immediately flush the sync queue only', function () { + var cnt = 0; + + _emberMetalRun_loop.default(function () { + function cntup() { + cnt++; + } + + function syncfunc() { + if (++cnt < 5) { + _emberMetalRun_loop.default.schedule('sync', syncfunc); + } + _emberMetalRun_loop.default.schedule('actions', cntup); + } + + syncfunc(); + + equal(cnt, 1, 'should not run action yet'); + _emberMetalRun_loop.default.sync(); + + equal(cnt, 5, 'should have run sync queue continuously'); + }); + + equal(cnt, 10, 'should flush actions now too'); + }); + + QUnit.test('calling sync() outside a run loop does not cause an error', function () { + expect(0); + + _emberMetalRun_loop.default.sync(); + }); +}); +enifed('ember-metal/tests/run_loop/sync_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/run_loop'); + test('ember-metal/tests/run_loop/sync_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/run_loop/sync_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/run_loop/sync_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/run_loop'); + QUnit.test('ember-metal/tests/run_loop/sync_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/run_loop/sync_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/run_loop/unwind_test', ['exports', 'ember-metal/run_loop', 'ember-metal/error'], function (exports, _emberMetalRun_loop, _emberMetalError) { + 'use strict'; + + QUnit.module('system/run_loop/unwind_test'); + + QUnit.test('RunLoop unwinds despite unhandled exception', function () { + var initialRunLoop = _emberMetalRun_loop.default.currentRunLoop; + + throws(function () { + _emberMetalRun_loop.default(function () { + _emberMetalRun_loop.default.schedule('actions', function () { + throw new _emberMetalError.default('boom!'); + }); + }); + }, Error, 'boom!'); + + // The real danger at this point is that calls to autorun will stick + // tasks into the already-dead runloop, which will never get + // flushed. I can't easily demonstrate this in a unit test because + // autorun explicitly doesn't work in test mode. - ef4 + equal(_emberMetalRun_loop.default.currentRunLoop, initialRunLoop, 'Previous run loop should be cleaned up despite exception'); + + // Prevent a failure in this test from breaking subsequent tests. + _emberMetalRun_loop.default.currentRunLoop = initialRunLoop; + }); + + QUnit.test('run unwinds despite unhandled exception', function () { + var initialRunLoop = _emberMetalRun_loop.default.currentRunLoop; + + throws(function () { + _emberMetalRun_loop.default(function () { + throw new _emberMetalError.default('boom!'); + }); + }, _emberMetalError.default, 'boom!'); + + equal(_emberMetalRun_loop.default.currentRunLoop, initialRunLoop, 'Previous run loop should be cleaned up despite exception'); + + // Prevent a failure in this test from breaking subsequent tests. + _emberMetalRun_loop.default.currentRunLoop = initialRunLoop; + }); +}); +enifed('ember-metal/tests/run_loop/unwind_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/run_loop'); + test('ember-metal/tests/run_loop/unwind_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/run_loop/unwind_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/run_loop/unwind_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/run_loop'); + QUnit.test('ember-metal/tests/run_loop/unwind_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/run_loop/unwind_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/set_properties_test', ['exports', 'ember-metal/set_properties'], function (exports, _emberMetalSet_properties) { + 'use strict'; + + QUnit.module('Ember.setProperties'); + + QUnit.test('supports setting multiple attributes at once', function () { + deepEqual(_emberMetalSet_properties.default(null, null), null, 'noop for null properties and null object'); + deepEqual(_emberMetalSet_properties.default(undefined, undefined), undefined, 'noop for undefined properties and undefined object'); + + deepEqual(_emberMetalSet_properties.default({}), undefined, 'noop for no properties'); + deepEqual(_emberMetalSet_properties.default({}, undefined), undefined, 'noop for undefined'); + deepEqual(_emberMetalSet_properties.default({}, null), null, 'noop for null'); + deepEqual(_emberMetalSet_properties.default({}, NaN), NaN, 'noop for NaN'); + deepEqual(_emberMetalSet_properties.default({}, {}), {}, 'meh'); + + deepEqual(_emberMetalSet_properties.default({}, { foo: 1 }), { foo: 1 }, 'Set a single property'); + + deepEqual(_emberMetalSet_properties.default({}, { foo: 1, bar: 1 }), { foo: 1, bar: 1 }, 'Set multiple properties'); + + deepEqual(_emberMetalSet_properties.default({ foo: 2, baz: 2 }, { foo: 1 }), { foo: 1 }, 'Set one of multiple properties'); + + deepEqual(_emberMetalSet_properties.default({ foo: 2, baz: 2 }, { bar: 2 }), { + bar: 2 + }, 'Set an additional, previously unset property'); + }); +}); +enifed('ember-metal/tests/set_properties_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/set_properties_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/set_properties_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/set_properties_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/set_properties_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/set_properties_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/watching/is_watching_test', ['exports', 'ember-metal/computed', 'ember-metal/property_get', 'ember-metal/properties', 'ember-metal/mixin', 'ember-metal/observer', 'ember-metal/watching'], function (exports, _emberMetalComputed, _emberMetalProperty_get, _emberMetalProperties, _emberMetalMixin, _emberMetalObserver, _emberMetalWatching) { + 'use strict'; + + QUnit.module('isWatching'); + + function testObserver(setup, teardown) { + var key = arguments.length <= 2 || arguments[2] === undefined ? 'key' : arguments[2]; + + var obj = {}; + function fn() {} + + equal(_emberMetalWatching.isWatching(obj, key), false, 'precond - isWatching is false by default'); + setup(obj, key, fn); + equal(_emberMetalWatching.isWatching(obj, key), true, 'isWatching is true when observers are added'); + teardown(obj, key, fn); + equal(_emberMetalWatching.isWatching(obj, key), false, 'isWatching is false after observers are removed'); + } + + QUnit.test('isWatching is true for regular local observers', function () { + testObserver(function (obj, key, fn) { + _emberMetalMixin.Mixin.create({ + didChange: _emberMetalMixin.observer(key, fn) + }).apply(obj); + }, function (obj, key, fn) { + return _emberMetalObserver.removeObserver(obj, key, obj, fn); + }); + }); + + QUnit.test('isWatching is true for nonlocal observers', function () { + testObserver(function (obj, key, fn) { + _emberMetalObserver.addObserver(obj, key, obj, fn); + }, function (obj, key, fn) { + return _emberMetalObserver.removeObserver(obj, key, obj, fn); + }); + }); + + QUnit.test('isWatching is true for chained observers', function () { + testObserver(function (obj, key, fn) { + _emberMetalObserver.addObserver(obj, key + '.bar', obj, fn); + }, function (obj, key, fn) { + _emberMetalObserver.removeObserver(obj, key + '.bar', obj, fn); + }); + }); + + QUnit.test('isWatching is true for computed properties', function () { + testObserver(function (obj, key, fn) { + _emberMetalProperties.defineProperty(obj, 'computed', _emberMetalComputed.computed(fn).property(key)); + _emberMetalProperty_get.get(obj, 'computed'); + }, function (obj, key, fn) { + return _emberMetalProperties.defineProperty(obj, 'computed', null); + }); + }); + + QUnit.test('isWatching is true for chained computed properties', function () { + testObserver(function (obj, key, fn) { + _emberMetalProperties.defineProperty(obj, 'computed', _emberMetalComputed.computed(fn).property(key + '.bar')); + _emberMetalProperty_get.get(obj, 'computed'); + }, function (obj, key, fn) { + return _emberMetalProperties.defineProperty(obj, 'computed', null); + }); + }); + + // can't watch length on Array - it is special... + // But you should be able to watch a length property of an object + QUnit.test('isWatching is true for \'length\' property on object', function () { + testObserver(function (obj, key, fn) { + _emberMetalProperties.defineProperty(obj, 'length', null, '26.2 miles'); + _emberMetalObserver.addObserver(obj, 'length', obj, fn); + }, function (obj, key, fn) { + return _emberMetalObserver.removeObserver(obj, 'length', obj, fn); + }, 'length'); + }); +}); +enifed('ember-metal/tests/watching/is_watching_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/watching'); + test('ember-metal/tests/watching/is_watching_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/watching/is_watching_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/watching/is_watching_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/watching'); + QUnit.test('ember-metal/tests/watching/is_watching_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/watching/is_watching_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/watching/unwatch_test', ['exports', 'internal-test-helpers', 'ember-metal/watching', 'ember-metal/properties', 'ember-metal/events', 'ember-metal/computed', 'ember-metal/property_set'], function (exports, _internalTestHelpers, _emberMetalWatching, _emberMetalProperties, _emberMetalEvents, _emberMetalComputed, _emberMetalProperty_set) { + 'use strict'; + + var willCount = undefined, + didCount = undefined; + + QUnit.module('unwatch', { + setup: function () { + willCount = didCount = 0; + } + }); + + function addListeners(obj, keyPath) { + _emberMetalEvents.addListener(obj, keyPath + ':before', function () { + return willCount++; + }); + _emberMetalEvents.addListener(obj, keyPath + ':change', function () { + return didCount++; + }); + } + + _internalTestHelpers.testBoth('unwatching a computed property - regular get/set', function (get, set) { + var obj = {}; + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed({ + get: function () { + return this.__foo; + }, + set: function (keyName, value) { + this.__foo = value; + return this.__foo; + } + })); + addListeners(obj, 'foo'); + + _emberMetalWatching.watch(obj, 'foo'); + set(obj, 'foo', 'bar'); + equal(willCount, 1, 'should have invoked willCount'); + equal(didCount, 1, 'should have invoked didCount'); + + _emberMetalWatching.unwatch(obj, 'foo'); + willCount = didCount = 0; + set(obj, 'foo', 'BAZ'); + equal(willCount, 0, 'should NOT have invoked willCount'); + equal(didCount, 0, 'should NOT have invoked didCount'); + }); + + _internalTestHelpers.testBoth('unwatching a regular property - regular get/set', function (get, set) { + var obj = { foo: 'BIFF' }; + addListeners(obj, 'foo'); + + _emberMetalWatching.watch(obj, 'foo'); + set(obj, 'foo', 'bar'); + equal(willCount, 1, 'should have invoked willCount'); + equal(didCount, 1, 'should have invoked didCount'); + + _emberMetalWatching.unwatch(obj, 'foo'); + willCount = didCount = 0; + set(obj, 'foo', 'BAZ'); + equal(willCount, 0, 'should NOT have invoked willCount'); + equal(didCount, 0, 'should NOT have invoked didCount'); + }); + + QUnit.test('unwatching should be nested', function () { + var obj = { foo: 'BIFF' }; + addListeners(obj, 'foo'); + + _emberMetalWatching.watch(obj, 'foo'); + _emberMetalWatching.watch(obj, 'foo'); + _emberMetalProperty_set.set(obj, 'foo', 'bar'); + equal(willCount, 1, 'should have invoked willCount'); + equal(didCount, 1, 'should have invoked didCount'); + + _emberMetalWatching.unwatch(obj, 'foo'); + willCount = didCount = 0; + _emberMetalProperty_set.set(obj, 'foo', 'BAZ'); + equal(willCount, 1, 'should NOT have invoked willCount'); + equal(didCount, 1, 'should NOT have invoked didCount'); + + _emberMetalWatching.unwatch(obj, 'foo'); + willCount = didCount = 0; + _emberMetalProperty_set.set(obj, 'foo', 'BAZ'); + equal(willCount, 0, 'should NOT have invoked willCount'); + equal(didCount, 0, 'should NOT have invoked didCount'); + }); + + _internalTestHelpers.testBoth('unwatching "length" property on an object', function (get, set) { + var obj = { foo: 'RUN' }; + addListeners(obj, 'length'); + + // Can watch length when it is undefined + _emberMetalWatching.watch(obj, 'length'); + set(obj, 'length', '10k'); + equal(willCount, 1, 'should have invoked willCount'); + equal(didCount, 1, 'should have invoked didCount'); + + // Should stop watching despite length now being defined (making object 'array-like') + _emberMetalWatching.unwatch(obj, 'length'); + willCount = didCount = 0; + set(obj, 'length', '5k'); + equal(willCount, 0, 'should NOT have invoked willCount'); + equal(didCount, 0, 'should NOT have invoked didCount'); + }); + + _internalTestHelpers.testBoth('unwatching should not destroy non MANDATORY_SETTER descriptor', function (get, set) { + var obj = { get foo() { + return 'RUN'; + } }; + + equal(obj.foo, 'RUN', 'obj.foo'); + _emberMetalWatching.watch(obj, 'foo'); + equal(obj.foo, 'RUN', 'obj.foo after watch'); + _emberMetalWatching.unwatch(obj, 'foo'); + equal(obj.foo, 'RUN', 'obj.foo after unwatch'); + }); +}); +enifed('ember-metal/tests/watching/unwatch_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/watching'); + test('ember-metal/tests/watching/unwatch_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/watching/unwatch_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/watching/unwatch_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/watching'); + QUnit.test('ember-metal/tests/watching/unwatch_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/watching/unwatch_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/watching/watch_test', ['exports', 'ember-environment', 'ember-metal/meta', 'ember-metal/property_set', 'ember-metal/property_get', 'ember-metal/computed', 'ember-metal/properties', 'internal-test-helpers', 'ember-metal/events', 'ember-metal/watching'], function (exports, _emberEnvironment, _emberMetalMeta, _emberMetalProperty_set, _emberMetalProperty_get, _emberMetalComputed, _emberMetalProperties, _internalTestHelpers, _emberMetalEvents, _emberMetalWatching) { + 'use strict'; + + var willCount = undefined, + didCount = undefined, + willKeys = undefined, + didKeys = undefined, + originalLookup = undefined, + lookup = undefined; + + QUnit.module('watch', { + setup: function () { + willCount = didCount = 0; + willKeys = []; + didKeys = []; + + originalLookup = _emberEnvironment.context.lookup; + _emberEnvironment.context.lookup = lookup = {}; + }, + + teardown: function () { + _emberEnvironment.context.lookup = originalLookup; + } + }); + + function addListeners(obj, keyPath) { + _emberMetalEvents.addListener(obj, keyPath + ':before', function () { + willCount++; + willKeys.push(keyPath); + }); + _emberMetalEvents.addListener(obj, keyPath + ':change', function () { + didCount++; + didKeys.push(keyPath); + }); + } + + _internalTestHelpers.testBoth('watching a computed property', function (get, set) { + var obj = {}; + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.computed({ + get: function () { + return this.__foo; + }, + set: function (keyName, value) { + if (value !== undefined) { + this.__foo = value; + } + return this.__foo; + } + })); + addListeners(obj, 'foo'); + + _emberMetalWatching.watch(obj, 'foo'); + set(obj, 'foo', 'bar'); + equal(willCount, 1, 'should have invoked willCount'); + equal(didCount, 1, 'should have invoked didCount'); + }); + + _internalTestHelpers.testBoth('watching a regular defined property', function (get, set) { + var obj = { foo: 'baz' }; + addListeners(obj, 'foo'); + + _emberMetalWatching.watch(obj, 'foo'); + equal(get(obj, 'foo'), 'baz', 'should have original prop'); + + set(obj, 'foo', 'bar'); + equal(willCount, 1, 'should have invoked willCount'); + equal(didCount, 1, 'should have invoked didCount'); + + equal(get(obj, 'foo'), 'bar', 'should get new value'); + equal(obj.foo, 'bar', 'property should be accessible on obj'); + }); + + _internalTestHelpers.testBoth('watching a regular undefined property', function (get, set) { + var obj = {}; + addListeners(obj, 'foo'); + + _emberMetalWatching.watch(obj, 'foo'); + + equal('foo' in obj, false, 'precond undefined'); + + set(obj, 'foo', 'bar'); + + equal(willCount, 1, 'should have invoked willCount'); + equal(didCount, 1, 'should have invoked didCount'); + + equal(get(obj, 'foo'), 'bar', 'should get new value'); + equal(obj.foo, 'bar', 'property should be accessible on obj'); + }); + + _internalTestHelpers.testBoth('watches should inherit', function (get, set) { + var obj = { foo: 'baz' }; + var objB = Object.create(obj); + + addListeners(obj, 'foo'); + _emberMetalWatching.watch(obj, 'foo'); + equal(get(obj, 'foo'), 'baz', 'should have original prop'); + + set(obj, 'foo', 'bar'); + set(objB, 'foo', 'baz'); + equal(willCount, 2, 'should have invoked willCount once only'); + equal(didCount, 2, 'should have invoked didCount once only'); + }); + + QUnit.test('watching an object THEN defining it should work also', function () { + var obj = {}; + addListeners(obj, 'foo'); + + _emberMetalWatching.watch(obj, 'foo'); + + _emberMetalProperties.defineProperty(obj, 'foo'); + _emberMetalProperty_set.set(obj, 'foo', 'bar'); + + equal(_emberMetalProperty_get.default(obj, 'foo'), 'bar', 'should have set'); + equal(willCount, 1, 'should have invoked willChange once'); + equal(didCount, 1, 'should have invoked didChange once'); + }); + + QUnit.test('watching a chain then defining the property', function () { + var obj = {}; + var foo = { bar: 'bar' }; + addListeners(obj, 'foo.bar'); + addListeners(foo, 'bar'); + + _emberMetalWatching.watch(obj, 'foo.bar'); + + _emberMetalProperties.defineProperty(obj, 'foo', undefined, foo); + _emberMetalProperty_set.set(foo, 'bar', 'baz'); + + deepEqual(willKeys, ['foo.bar', 'bar'], 'should have invoked willChange with bar, foo.bar'); + deepEqual(didKeys, ['foo.bar', 'bar'], 'should have invoked didChange with bar, foo.bar'); + equal(willCount, 2, 'should have invoked willChange twice'); + equal(didCount, 2, 'should have invoked didChange twice'); + }); + + QUnit.test('watching a chain then defining the nested property', function () { + var bar = {}; + var obj = { foo: bar }; + var baz = { baz: 'baz' }; + addListeners(obj, 'foo.bar.baz'); + addListeners(baz, 'baz'); + + _emberMetalWatching.watch(obj, 'foo.bar.baz'); + + _emberMetalProperties.defineProperty(bar, 'bar', undefined, baz); + _emberMetalProperty_set.set(baz, 'baz', 'BOO'); + + deepEqual(willKeys, ['foo.bar.baz', 'baz'], 'should have invoked willChange with bar, foo.bar'); + deepEqual(didKeys, ['foo.bar.baz', 'baz'], 'should have invoked didChange with bar, foo.bar'); + equal(willCount, 2, 'should have invoked willChange twice'); + equal(didCount, 2, 'should have invoked didChange twice'); + }); + + _internalTestHelpers.testBoth('watching an object value then unwatching should restore old value', function (get, set) { + var obj = { foo: { bar: { baz: { biff: 'BIFF' } } } }; + addListeners(obj, 'foo.bar.baz.biff'); + + _emberMetalWatching.watch(obj, 'foo.bar.baz.biff'); + + var foo = get(obj, 'foo'); + equal(get(get(get(foo, 'bar'), 'baz'), 'biff'), 'BIFF', 'biff should exist'); + + _emberMetalWatching.unwatch(obj, 'foo.bar.baz.biff'); + equal(get(get(get(foo, 'bar'), 'baz'), 'biff'), 'BIFF', 'biff should exist'); + }); + + QUnit.test('when watching another object, destroy should remove chain watchers from the other object', function () { + var objA = {}; + var objB = { foo: 'bar' }; + objA.b = objB; + addListeners(objA, 'b.foo'); + + _emberMetalWatching.watch(objA, 'b.foo'); + + var meta_objB = _emberMetalMeta.meta(objB); + var chainNode = _emberMetalMeta.meta(objA).readableChains()._chains.b._chains.foo; + + equal(meta_objB.peekWatching('foo'), 1, 'should be watching foo'); + equal(meta_objB.readableChainWatchers().has('foo', chainNode), true, 'should have chain watcher'); + + _emberMetalWatching.destroy(objA); + + equal(meta_objB.peekWatching('foo'), 0, 'should not be watching foo'); + equal(meta_objB.readableChainWatchers().has('foo', chainNode), false, 'should not have chain watcher'); + }); + + // TESTS for length property + + _internalTestHelpers.testBoth('watching "length" property on an object', function (get, set) { + var obj = { length: '26.2 miles' }; + addListeners(obj, 'length'); + + _emberMetalWatching.watch(obj, 'length'); + equal(get(obj, 'length'), '26.2 miles', 'should have original prop'); + + set(obj, 'length', '10k'); + equal(willCount, 1, 'should have invoked willCount'); + equal(didCount, 1, 'should have invoked didCount'); + + equal(get(obj, 'length'), '10k', 'should get new value'); + equal(obj.length, '10k', 'property should be accessible on obj'); + }); + + _internalTestHelpers.testBoth('watching "length" property on an array', function (get, set) { + var arr = []; + addListeners(arr, 'length'); + + _emberMetalWatching.watch(arr, 'length'); + equal(get(arr, 'length'), 0, 'should have original prop'); + + set(arr, 'length', '10'); + equal(willCount, 1, 'should NOT have invoked willCount'); + equal(didCount, 1, 'should NOT have invoked didCount'); + + equal(get(arr, 'length'), 10, 'should get new value'); + equal(arr.length, 10, 'property should be accessible on arr'); + }); + + _internalTestHelpers.testBoth('watch + ES5 getter', function (get) { + var parent = { b: 1 }; + var child = { + get b() { + return parent.b; + } + }; + + equal(parent.b, 1, 'parent.b should be 1'); + equal(child.b, 1, 'child.b should be 1'); + equal(get(child, 'b'), 1, 'Ember.get(child, "b") should be 1'); + + _emberMetalWatching.watch(child, 'b'); + + equal(parent.b, 1, 'parent.b should be 1 (after watch)'); + equal(child.b, 1, 'child.b should be 1 (after watch)'); + + equal(get(child, 'b'), 1, 'Ember.get(child, "b") should be 1 (after watch)'); + }); + + _internalTestHelpers.testBoth('watch + Ember.set + no-descriptor', function (get, set) { + var child = {}; + + equal(child.b, undefined, 'child.b '); + equal(get(child, 'b'), undefined, 'Ember.get(child, "b")'); + + _emberMetalWatching.watch(child, 'b'); + set(child, 'b', 1); + + equal(child.b, 1, 'child.b (after watch)'); + equal(get(child, 'b'), 1, 'Ember.get(child, "b") (after watch)'); + }); +}); +enifed('ember-metal/tests/watching/watch_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests/watching'); + test('ember-metal/tests/watching/watch_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/watching/watch_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/watching/watch_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests/watching'); + QUnit.test('ember-metal/tests/watching/watch_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/watching/watch_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/tests/weak_map_test', ['exports', 'ember-metal/weak_map'], function (exports, _emberMetalWeak_map) { + 'use strict'; + + QUnit.module('Ember.WeakMap'); + + QUnit.test('has weakMap like qualities', function (assert) { + var map = new _emberMetalWeak_map.default(); + var map2 = new _emberMetalWeak_map.default(); + + var a = {}; + var b = {}; + var c = {}; + + assert.strictEqual(map.get(a), undefined); + assert.strictEqual(map.get(b), undefined); + assert.strictEqual(map.get(c), undefined); + + assert.strictEqual(map2.get(a), undefined); + assert.strictEqual(map2.get(b), undefined); + assert.strictEqual(map2.get(c), undefined); + + assert.strictEqual(map.set(a, 1), map, 'map.set should return itself'); + assert.strictEqual(map.get(a), 1); + assert.strictEqual(map.set(b, undefined), map); + assert.strictEqual(map.set(a, 2), map); + assert.strictEqual(map.get(a), 2); + assert.strictEqual(map.set(b, undefined), map); + + assert.strictEqual(map2.get(a), undefined); + assert.strictEqual(map2.get(b), undefined); + assert.strictEqual(map2.get(c), undefined); + + assert.strictEqual(map.set(c, 1), map); + assert.strictEqual(map.get(c), 1); + assert.strictEqual(map.get(a), 2); + assert.strictEqual(map.get(b), undefined); + + assert.strictEqual(map2.set(a, 3), map2); + assert.strictEqual(map2.set(b, 4), map2); + assert.strictEqual(map2.set(c, 5), map2); + + assert.strictEqual(map2.get(a), 3); + assert.strictEqual(map2.get(b), 4); + assert.strictEqual(map2.get(c), 5); + + assert.strictEqual(map.get(c), 1); + assert.strictEqual(map.get(a), 2); + assert.strictEqual(map.get(b), undefined); + }); + + QUnit.test('WeakMap constructor requres new', function (assert) { + var expectedError = new TypeError('Constructor WeakMap requires \'new\''); + + assert.throws(function () { + // jshint newcap: false + _emberMetalWeak_map.default(); + }, expectedError); + }); + + QUnit.test('constructing a WeakMap with an invalid iterator throws an error', function (assert) { + var expectedError = new TypeError('The weak map constructor polyfill only supports an array argument'); + + assert.throws(function () { + new _emberMetalWeak_map.default({ a: 1 }); + }, expectedError); + }); + + QUnit.test('constructing a WeakMap with a valid iterator inserts the entries', function (assert) { + var a = {}; + var b = {}; + var c = {}; + + var map = new _emberMetalWeak_map.default([[a, 1], [b, 2], [c, 3]]); + + assert.strictEqual(map.get(a), 1); + assert.strictEqual(map.get(b), 2); + assert.strictEqual(map.get(c), 3); + }); + + QUnit.test('that error is thrown when using a primitive key', function (assert) { + var expectedError = new TypeError('Invalid value used as weak map key'); + var map = new _emberMetalWeak_map.default(); + + assert.throws(function () { + return map.set('a', 1); + }, expectedError); + assert.throws(function () { + return map.set(1, 1); + }, expectedError); + assert.throws(function () { + return map.set(true, 1); + }, expectedError); + assert.throws(function () { + return map.set(null, 1); + }, expectedError); + assert.throws(function () { + return map.set(undefined, 1); + }, expectedError); + }); + + QUnit.test('that .has and .delete work as expected', function (assert) { + var map = new _emberMetalWeak_map.default(); + var a = {}; + var b = {}; + var foo = { id: 1, name: 'My file', progress: 0 }; + + assert.strictEqual(map.set(a, foo), map); + assert.strictEqual(map.get(a), foo); + assert.strictEqual(map.has(a), true); + assert.strictEqual(map.has(b), false); + assert.strictEqual(map.delete(a), true); + assert.strictEqual(map.has(a), false); + assert.strictEqual(map.delete(a), false); + assert.strictEqual(map.set(a, undefined), map); + assert.strictEqual(map.has(a), true); + assert.strictEqual(map.delete(a), true); + assert.strictEqual(map.delete(a), false); + assert.strictEqual(map.has(a), false); + }); + + QUnit.test('that .toString works as expected', function (assert) { + var map = new _emberMetalWeak_map.default(); + + assert.strictEqual(map.toString(), '[object WeakMap]'); + }); +}); +enifed('ember-metal/tests/weak_map_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal/tests'); + test('ember-metal/tests/weak_map_test.js should pass jscs', function () { + ok(true, 'ember-metal/tests/weak_map_test.js should pass jscs.'); + }); +}); +enifed('ember-metal/tests/weak_map_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal/tests'); + QUnit.test('ember-metal/tests/weak_map_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tests/weak_map_test.js should pass jshint.'); + }); +}); +enifed('ember-metal/transaction.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/transaction.js should pass jscs', function () { + ok(true, 'ember-metal/transaction.js should pass jscs.'); + }); +}); +enifed('ember-metal/transaction.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/transaction.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/transaction.js should pass jshint.'); + }); +}); +enifed('ember-metal/watch_key.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/watch_key.js should pass jscs', function () { + ok(true, 'ember-metal/watch_key.js should pass jscs.'); + }); +}); +enifed('ember-metal/watch_key.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/watch_key.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/watch_key.js should pass jshint.'); + }); +}); +enifed('ember-metal/watch_path.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/watch_path.js should pass jscs', function () { + ok(true, 'ember-metal/watch_path.js should pass jscs.'); + }); +}); +enifed('ember-metal/watch_path.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/watch_path.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/watch_path.js should pass jshint.'); + }); +}); +enifed('ember-metal/watching.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/watching.js should pass jscs', function () { + ok(true, 'ember-metal/watching.js should pass jscs.'); + }); +}); +enifed('ember-metal/watching.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/watching.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/watching.js should pass jshint.'); + }); +}); +enifed('ember-metal/weak_map.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-metal'); + test('ember-metal/weak_map.js should pass jscs', function () { + ok(true, 'ember-metal/weak_map.js should pass jscs.'); + }); +}); +enifed('ember-metal/weak_map.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-metal'); + QUnit.test('ember-metal/weak_map.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/weak_map.js should pass jshint.'); + }); +}); +enifed('ember-routing/ext/controller.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/ext'); + test('ember-routing/ext/controller.js should pass jscs', function () { + ok(true, 'ember-routing/ext/controller.js should pass jscs.'); + }); +}); +enifed('ember-routing/ext/controller.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/ext'); + QUnit.test('ember-routing/ext/controller.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/ext/controller.js should pass jshint.'); + }); +}); +enifed('ember-routing/ext/run_loop.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/ext'); + test('ember-routing/ext/run_loop.js should pass jscs', function () { + ok(true, 'ember-routing/ext/run_loop.js should pass jscs.'); + }); +}); +enifed('ember-routing/ext/run_loop.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/ext'); + QUnit.test('ember-routing/ext/run_loop.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/ext/run_loop.js should pass jshint.'); + }); +}); +enifed('ember-routing/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing'); + test('ember-routing/index.js should pass jscs', function () { + ok(true, 'ember-routing/index.js should pass jscs.'); + }); +}); +enifed('ember-routing/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing'); + QUnit.test('ember-routing/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/index.js should pass jshint.'); + }); +}); +enifed('ember-routing/location/api.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/location'); + test('ember-routing/location/api.js should pass jscs', function () { + ok(true, 'ember-routing/location/api.js should pass jscs.'); + }); +}); +enifed('ember-routing/location/api.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/location'); + QUnit.test('ember-routing/location/api.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/location/api.js should pass jshint.'); + }); +}); +enifed('ember-routing/location/auto_location.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/location'); + test('ember-routing/location/auto_location.js should pass jscs', function () { + ok(true, 'ember-routing/location/auto_location.js should pass jscs.'); + }); +}); +enifed('ember-routing/location/auto_location.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/location'); + QUnit.test('ember-routing/location/auto_location.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/location/auto_location.js should pass jshint.'); + }); +}); +enifed('ember-routing/location/hash_location.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/location'); + test('ember-routing/location/hash_location.js should pass jscs', function () { + ok(true, 'ember-routing/location/hash_location.js should pass jscs.'); + }); +}); +enifed('ember-routing/location/hash_location.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/location'); + QUnit.test('ember-routing/location/hash_location.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/location/hash_location.js should pass jshint.'); + }); +}); +enifed('ember-routing/location/history_location.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/location'); + test('ember-routing/location/history_location.js should pass jscs', function () { + ok(true, 'ember-routing/location/history_location.js should pass jscs.'); + }); +}); +enifed('ember-routing/location/history_location.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/location'); + QUnit.test('ember-routing/location/history_location.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/location/history_location.js should pass jshint.'); + }); +}); +enifed('ember-routing/location/none_location.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/location'); + test('ember-routing/location/none_location.js should pass jscs', function () { + ok(true, 'ember-routing/location/none_location.js should pass jscs.'); + }); +}); +enifed('ember-routing/location/none_location.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/location'); + QUnit.test('ember-routing/location/none_location.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/location/none_location.js should pass jshint.'); + }); +}); +enifed('ember-routing/location/util.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/location'); + test('ember-routing/location/util.js should pass jscs', function () { + ok(true, 'ember-routing/location/util.js should pass jscs.'); + }); +}); +enifed('ember-routing/location/util.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/location'); + QUnit.test('ember-routing/location/util.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/location/util.js should pass jshint.'); + }); +}); +enifed('ember-routing/services/routing.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/services'); + test('ember-routing/services/routing.js should pass jscs', function () { + ok(true, 'ember-routing/services/routing.js should pass jscs.'); + }); +}); +enifed('ember-routing/services/routing.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/services'); + QUnit.test('ember-routing/services/routing.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/services/routing.js should pass jshint.'); + }); +}); +enifed('ember-routing/system/cache.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/system'); + test('ember-routing/system/cache.js should pass jscs', function () { + ok(true, 'ember-routing/system/cache.js should pass jscs.'); + }); +}); +enifed('ember-routing/system/cache.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/system'); + QUnit.test('ember-routing/system/cache.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/system/cache.js should pass jshint.'); + }); +}); +enifed('ember-routing/system/controller_for.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/system'); + test('ember-routing/system/controller_for.js should pass jscs', function () { + ok(true, 'ember-routing/system/controller_for.js should pass jscs.'); + }); +}); +enifed('ember-routing/system/controller_for.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/system'); + QUnit.test('ember-routing/system/controller_for.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/system/controller_for.js should pass jshint.'); + }); +}); +enifed('ember-routing/system/dsl.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/system'); + test('ember-routing/system/dsl.js should pass jscs', function () { + ok(true, 'ember-routing/system/dsl.js should pass jscs.'); + }); +}); +enifed('ember-routing/system/dsl.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/system'); + QUnit.test('ember-routing/system/dsl.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/system/dsl.js should pass jshint.'); + }); +}); +enifed('ember-routing/system/generate_controller.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/system'); + test('ember-routing/system/generate_controller.js should pass jscs', function () { + ok(true, 'ember-routing/system/generate_controller.js should pass jscs.'); + }); +}); +enifed('ember-routing/system/generate_controller.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/system'); + QUnit.test('ember-routing/system/generate_controller.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/system/generate_controller.js should pass jshint.'); + }); +}); +enifed('ember-routing/system/query_params.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/system'); + test('ember-routing/system/query_params.js should pass jscs', function () { + ok(true, 'ember-routing/system/query_params.js should pass jscs.'); + }); +}); +enifed('ember-routing/system/query_params.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/system'); + QUnit.test('ember-routing/system/query_params.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/system/query_params.js should pass jshint.'); + }); +}); +enifed('ember-routing/system/route.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/system'); + test('ember-routing/system/route.js should pass jscs', function () { + ok(true, 'ember-routing/system/route.js should pass jscs.'); + }); +}); +enifed('ember-routing/system/route.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/system'); + QUnit.test('ember-routing/system/route.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/system/route.js should pass jshint.'); + }); +}); +enifed('ember-routing/system/router.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/system'); + test('ember-routing/system/router.js should pass jscs', function () { + ok(true, 'ember-routing/system/router.js should pass jscs.'); + }); +}); +enifed('ember-routing/system/router.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/system'); + QUnit.test('ember-routing/system/router.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/system/router.js should pass jshint.'); + }); +}); +enifed('ember-routing/system/router_state.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/system'); + test('ember-routing/system/router_state.js should pass jscs', function () { + ok(true, 'ember-routing/system/router_state.js should pass jscs.'); + }); +}); +enifed('ember-routing/system/router_state.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/system'); + QUnit.test('ember-routing/system/router_state.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/system/router_state.js should pass jshint.'); + }); +}); +enifed('ember-routing/tests/ext/controller_test', ['exports', 'ember-utils', 'internal-test-helpers', 'ember-runtime'], function (exports, _emberUtils, _internalTestHelpers, _emberRuntime) { + 'use strict'; + + QUnit.module('ember-routing/ext/controller'); + + QUnit.test('transitionToRoute considers an engine\'s mountPoint', function () { + expect(4); + + var router = { + transitionTo: function (route) { + return route; + } + }; + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { + routable: true, + mountPoint: 'foo.bar' + } + }); + + var controller = _emberRuntime.Controller.create({ target: router }); + _emberUtils.setOwner(controller, engineInstance); + + strictEqual(controller.transitionToRoute('application'), 'foo.bar.application', 'properly prefixes application route'); + strictEqual(controller.transitionToRoute('posts'), 'foo.bar.posts', 'properly prefixes child routes'); + throws(function () { + return controller.transitionToRoute('/posts'); + }, 'throws when trying to use a url'); + + var queryParams = {}; + strictEqual(controller.transitionToRoute(queryParams), queryParams, 'passes query param only transitions through'); + }); +}); +enifed('ember-routing/tests/ext/controller_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/tests/ext'); + test('ember-routing/tests/ext/controller_test.js should pass jscs', function () { + ok(true, 'ember-routing/tests/ext/controller_test.js should pass jscs.'); + }); +}); +enifed('ember-routing/tests/ext/controller_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/tests/ext'); + QUnit.test('ember-routing/tests/ext/controller_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/tests/ext/controller_test.js should pass jshint.'); + }); +}); +enifed('ember-routing/tests/location/auto_location_test', ['exports', 'ember-utils', 'ember-environment', 'ember-metal', 'ember-routing/location/auto_location', 'ember-routing/location/history_location', 'ember-routing/location/hash_location', 'ember-routing/location/none_location', 'internal-test-helpers'], function (exports, _emberUtils, _emberEnvironment, _emberMetal, _emberRoutingLocationAuto_location, _emberRoutingLocationHistory_location, _emberRoutingLocationHash_location, _emberRoutingLocationNone_location, _internalTestHelpers) { + 'use strict'; + + function mockBrowserLocation(overrides) { + return _emberUtils.assign({ + href: 'http://test.com/', + pathname: '/', + hash: '', + search: '', + replace: function () { + ok(false, 'location.replace should not be called during testing'); + } + }, overrides); + } + + function mockBrowserHistory(overrides) { + return _emberUtils.assign({ + pushState: function () { + ok(false, 'history.pushState should not be called during testing'); + }, + replaceState: function () { + ok(false, 'history.replaceState should not be called during testing'); + } + }, overrides); + } + + function createLocation(location, history) { + var _AutoLocation$create; + + var owner = _internalTestHelpers.buildOwner(); + + owner.register('location:history', _emberRoutingLocationHistory_location.default); + owner.register('location:hash', _emberRoutingLocationHash_location.default); + owner.register('location:none', _emberRoutingLocationNone_location.default); + + var autolocation = _emberRoutingLocationAuto_location.default.create((_AutoLocation$create = {}, _AutoLocation$create[_emberUtils.OWNER] = owner, _AutoLocation$create.location = location, _AutoLocation$create.history = history, _AutoLocation$create.global = {}, _AutoLocation$create)); + + return autolocation; + } + + var location = undefined; + + QUnit.module('Ember.AutoLocation', { + teardown: function () { + if (location) { + _emberMetal.run(location, 'destroy'); + } + } + }); + + QUnit.test('AutoLocation should have the `global`', function (assert) { + var location = _emberRoutingLocationAuto_location.default.create(); + + assert.ok(location.global, 'has a global defined'); + assert.strictEqual(location.global, _emberEnvironment.environment.window, 'has the environments window global'); + }); + + QUnit.test('AutoLocation should return concrete implementation\'s value for `getURL`', function () { + expect(1); + + var browserLocation = mockBrowserLocation(); + var browserHistory = mockBrowserHistory(); + + location = createLocation(browserLocation, browserHistory); + location.detect(); + + var concreteImplementation = _emberMetal.get(location, 'concreteImplementation'); + + concreteImplementation.getURL = function () { + return '/lincoln/park'; + }; + + equal(location.getURL(), '/lincoln/park'); + }); + + QUnit.test('AutoLocation should use a HistoryLocation instance when pushStates is supported', function () { + expect(1); + + var browserLocation = mockBrowserLocation(); + var browserHistory = mockBrowserHistory(); + + location = createLocation(browserLocation, browserHistory); + location.detect(); + + ok(_emberMetal.get(location, 'concreteImplementation') instanceof _emberRoutingLocationHistory_location.default); + }); + + QUnit.test('AutoLocation should use a HashLocation instance when pushStates are not supported, but hashchange events are and the URL is already in the HashLocation format', function () { + expect(1); + + var browserLocation = mockBrowserLocation({ + hash: '#/testd' + }); + + location = createLocation(browserLocation); + location.global = { + onhashchange: function () {} + }; + + location.detect(); + ok(_emberMetal.get(location, 'concreteImplementation') instanceof _emberRoutingLocationHash_location.default); + }); + + QUnit.test('AutoLocation should use a NoneLocation instance when neither history nor hashchange are supported.', function () { + expect(1); + + location = createLocation(mockBrowserLocation()); + location.detect(); + + ok(_emberMetal.get(location, 'concreteImplementation') instanceof _emberRoutingLocationNone_location.default); + }); + + QUnit.test('AutoLocation should use an index path (i.e. \'/\') without any location.hash as OK for HashLocation', function () { + expect(1); + + var browserLocation = mockBrowserLocation({ + href: 'http://test.com/', + pathname: '/', + hash: '', + search: '', + replace: function (path) { + ok(false, 'location.replace should not be called'); + } + }); + + location = createLocation(browserLocation); + location.global = { + onhashchange: function () {} + }; + + location.detect(); + + ok(_emberMetal.get(location, 'concreteImplementation') instanceof _emberRoutingLocationHash_location.default, 'uses a HashLocation'); + }); + + QUnit.test('AutoLocation should transform the URL for hashchange-only browsers viewing a HistoryLocation-formatted path', function () { + expect(3); + + var browserLocation = mockBrowserLocation({ + hash: '', + hostname: 'test.com', + href: 'http://test.com/test', + pathname: '/test', + protocol: 'http:', + port: '', + search: '', + + replace: function (path) { + equal(path, 'http://test.com/#/test', 'location.replace should be called with normalized HashLocation path'); + } + }); + + var location = createLocation(browserLocation); + location.global = { + onhashchange: function () {} + }; + + location.detect(); + + ok(_emberMetal.get(location, 'concreteImplementation') instanceof _emberRoutingLocationNone_location.default, 'NoneLocation should be used while we attempt to location.replace()'); + equal(_emberMetal.get(location, 'cancelRouterSetup'), true, 'cancelRouterSetup should be set so the router knows.'); + }); + + QUnit.test('AutoLocation should replace the URL for pushState-supported browsers viewing a HashLocation-formatted url', function () { + expect(2); + + var browserLocation = mockBrowserLocation({ + hash: '#/test', + hostname: 'test.com', + href: 'http://test.com/#/test', + pathname: '/', + protocol: 'http:', + port: '', + search: '' + }); + + var browserHistory = mockBrowserHistory({ + replaceState: function (state, title, path) { + equal(path, '/test', 'history.replaceState should be called with normalized HistoryLocation url'); + } + }); + + var location = createLocation(browserLocation, browserHistory); + location.detect(); + + ok(_emberMetal.get(location, 'concreteImplementation'), _emberRoutingLocationHistory_location.default); + }); + + QUnit.test('AutoLocation requires any rootURL given to end in a trailing forward slash', function () { + expect(3); + var browserLocation = mockBrowserLocation(); + var expectedMsg = /rootURL must end with a trailing forward slash e.g. "\/app\/"/; + + location = createLocation(browserLocation); + location.rootURL = 'app'; + + expectAssertion(function () { + location.detect(); + }, expectedMsg); + + location.rootURL = '/app'; + expectAssertion(function () { + location.detect(); + }, expectedMsg); + + // Note the trailing whitespace + location.rootURL = '/app/ '; + expectAssertion(function () { + location.detect(); + }, expectedMsg); + }); + + QUnit.test('AutoLocation provides its rootURL to the concreteImplementation', function () { + expect(1); + var browserLocation = mockBrowserLocation({ + pathname: '/some/subdir/derp' + }); + var browserHistory = mockBrowserHistory(); + + location = createLocation(browserLocation, browserHistory); + location.rootURL = '/some/subdir/'; + + location.detect(); + + var concreteLocation = _emberMetal.get(location, 'concreteImplementation'); + equal(location.rootURL, concreteLocation.rootURL); + }); + + QUnit.test('getHistoryPath() should return a normalized, HistoryLocation-supported path', function () { + expect(3); + + var browserLocation = mockBrowserLocation({ + href: 'http://test.com/app/about?foo=bar#foo', + pathname: '/app/about', + search: '?foo=bar', + hash: '#foo' + }); + + equal(_emberRoutingLocationAuto_location.getHistoryPath('/app/', browserLocation), '/app/about?foo=bar#foo', 'URLs already in HistoryLocation form should come out the same'); + + browserLocation = mockBrowserLocation({ + href: 'http://test.com/app/#/about?foo=bar#foo', + pathname: '/app/', + search: '', + hash: '#/about?foo=bar#foo' + }); + equal(_emberRoutingLocationAuto_location.getHistoryPath('/app/', browserLocation), '/app/about?foo=bar#foo', 'HashLocation formed URLs should be normalized'); + + browserLocation = mockBrowserLocation({ + href: 'http://test.com/app/#about?foo=bar#foo', + pathname: '/app/', + search: '', + hash: '#about?foo=bar#foo' + }); + equal(_emberRoutingLocationAuto_location.getHistoryPath('/app', browserLocation), '/app/#about?foo=bar#foo', 'URLs with a hash not following #/ convention shouldn\'t be normalized as a route'); + }); + + QUnit.test('getHashPath() should return a normalized, HashLocation-supported path', function () { + expect(3); + + var browserLocation = mockBrowserLocation({ + href: 'http://test.com/app/#/about?foo=bar#foo', + pathname: '/app/', + search: '', + hash: '#/about?foo=bar#foo' + }); + equal(_emberRoutingLocationAuto_location.getHashPath('/app/', browserLocation), '/app/#/about?foo=bar#foo', 'URLs already in HistoryLocation form should come out the same'); + + browserLocation = mockBrowserLocation({ + href: 'http://test.com/app/about?foo=bar#foo', + pathname: '/app/about', + search: '?foo=bar', + hash: '#foo' + }); + equal(_emberRoutingLocationAuto_location.getHashPath('/app/', browserLocation), '/app/#/about?foo=bar#foo', 'HistoryLocation formed URLs should be normalized'); + + browserLocation = mockBrowserLocation({ + href: 'http://test.com/app/#about?foo=bar#foo', + pathname: '/app/', + search: '', + hash: '#about?foo=bar#foo' + }); + + equal(_emberRoutingLocationAuto_location.getHashPath('/app/', browserLocation), '/app/#/#about?foo=bar#foo', 'URLs with a hash not following #/ convention shouldn\'t be normalized as a route'); + }); +}); +enifed('ember-routing/tests/location/auto_location_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/tests/location'); + test('ember-routing/tests/location/auto_location_test.js should pass jscs', function () { + ok(true, 'ember-routing/tests/location/auto_location_test.js should pass jscs.'); + }); +}); +enifed('ember-routing/tests/location/auto_location_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/tests/location'); + QUnit.test('ember-routing/tests/location/auto_location_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/tests/location/auto_location_test.js should pass jshint.'); + }); +}); +enifed('ember-routing/tests/location/hash_location_test', ['exports', 'ember-metal', 'ember-routing/location/hash_location'], function (exports, _emberMetal, _emberRoutingLocationHash_location) { + 'use strict'; + + var HashTestLocation = undefined, + location = undefined; + + function createLocation(options) { + if (!options) { + options = {}; + } + location = HashTestLocation.create(options); + } + + function mockBrowserLocation(path) { + // This is a neat trick to auto-magically extract the hostname from any + // url by letting the browser do the work ;) + var tmp = document.createElement('a'); + tmp.href = path; + + var protocol = !tmp.protocol || tmp.protocol === ':' ? 'http' : tmp.protocol; + var pathname = tmp.pathname.match(/^\//) ? tmp.pathname : '/' + tmp.pathname; + + return { + hash: tmp.hash, + host: tmp.host || 'localhost', + hostname: tmp.hostname || 'localhost', + href: tmp.href, + pathname: pathname, + port: tmp.port || '', + protocol: protocol, + search: tmp.search + }; + } + + function triggerHashchange() { + var event = document.createEvent('HTMLEvents'); + event.initEvent('hashchange', true, false); + window.dispatchEvent(event); + } + + QUnit.module('Ember.HashLocation', { + setup: function () { + HashTestLocation = _emberRoutingLocationHash_location.default.extend({ + _location: { + href: 'http://test.com/', + pathname: '/', + hash: '', + search: '', + replace: function () { + ok(false, 'location.replace should not be called during testing'); + } + } + }); + }, + + teardown: function () { + _emberMetal.run(function () { + if (location) { + location.destroy(); + } + }); + } + }); + + QUnit.test('HashLocation.getURL() returns the current url', function () { + expect(1); + + createLocation({ + _location: mockBrowserLocation('/#/foo/bar') + }); + + equal(location.getURL(), '/foo/bar'); + }); + + QUnit.test('HashLocation.getURL() includes extra hashes', function () { + expect(1); + + createLocation({ + _location: mockBrowserLocation('/#/foo#bar#car') + }); + + equal(location.getURL(), '/foo#bar#car'); + }); + + QUnit.test('HashLocation.getURL() assumes location.hash without #/ prefix is not a route path', function () { + expect(1); + + createLocation({ + _location: mockBrowserLocation('/#foo#bar') + }); + + equal(location.getURL(), '/#foo#bar'); + }); + + QUnit.test('HashLocation.getURL() returns a normal forward slash when there is no location.hash', function () { + expect(1); + + createLocation({ + _location: mockBrowserLocation('/') + }); + + equal(location.getURL(), '/'); + }); + + QUnit.test('HashLocation.setURL() correctly sets the url', function () { + expect(2); + + createLocation(); + + location.setURL('/bar'); + + equal(_emberMetal.get(location, 'location.hash'), '/bar'); + equal(_emberMetal.get(location, 'lastSetURL'), '/bar'); + }); + + QUnit.test('HashLocation.replaceURL() correctly replaces to the path with a page reload', function () { + expect(2); + + createLocation({ + _location: { + replace: function (path) { + equal(path, '#/foo'); + } + } + }); + + location.replaceURL('/foo'); + + equal(_emberMetal.get(location, 'lastSetURL'), '/foo'); + }); + + QUnit.test('HashLocation.onUpdateURL callback executes as expected', function () { + expect(1); + + createLocation({ + _location: mockBrowserLocation('/#/foo/bar') + }); + + var callback = function (param) { + equal(param, '/foo/bar', 'path is passed as param'); + }; + + location.onUpdateURL(callback); + + triggerHashchange(); + }); + + QUnit.test('HashLocation.onUpdateURL doesn\'t execute callback if lastSetURL === path', function () { + expect(0); + + createLocation({ + _location: { + href: '/#/foo/bar' + }, + lastSetURL: '/foo/bar' + }); + + var callback = function (param) { + ok(false, 'callback should not be called'); + }; + + location.onUpdateURL(callback); + + triggerHashchange(); + }); + + QUnit.test('HashLocation.formatURL() prepends a # to the provided string', function () { + expect(1); + + createLocation(); + + equal(location.formatURL('/foo#bar'), '#/foo#bar'); + }); + + QUnit.test('HashLocation.willDestroy() cleans up hashchange event listener', function () { + expect(1); + + createLocation(); + + var callback = function (param) { + ok(true, 'should invoke callback once'); + }; + + location.onUpdateURL(callback); + + triggerHashchange(); + + _emberMetal.run(location, 'destroy'); + location = null; + + triggerHashchange(); + }); +}); +enifed('ember-routing/tests/location/hash_location_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/tests/location'); + test('ember-routing/tests/location/hash_location_test.js should pass jscs', function () { + ok(true, 'ember-routing/tests/location/hash_location_test.js should pass jscs.'); + }); +}); +enifed('ember-routing/tests/location/hash_location_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/tests/location'); + QUnit.test('ember-routing/tests/location/hash_location_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/tests/location/hash_location_test.js should pass jshint.'); + }); +}); +enifed('ember-routing/tests/location/history_location_test', ['exports', 'ember-metal', 'ember-routing/location/history_location'], function (exports, _emberMetal, _emberRoutingLocationHistory_location) { + 'use strict'; + + var FakeHistory = undefined, + HistoryTestLocation = undefined, + location = undefined; + + function createLocation(options) { + if (!options) { + options = {}; + } + location = HistoryTestLocation.create(options); + } + + function mockBrowserLocation(path) { + // This is a neat trick to auto-magically extract the hostname from any + // url by letting the browser do the work ;) + var tmp = document.createElement('a'); + tmp.href = path; + + var protocol = !tmp.protocol || tmp.protocol === ':' ? 'http' : tmp.protocol; + var pathname = tmp.pathname.match(/^\//) ? tmp.pathname : '/' + tmp.pathname; + + return { + hash: tmp.hash, + host: tmp.host || 'localhost', + hostname: tmp.hostname || 'localhost', + href: tmp.href, + pathname: pathname, + port: tmp.port || '', + protocol: protocol, + search: tmp.search + }; + } + + QUnit.module('Ember.HistoryLocation', { + setup: function () { + FakeHistory = { + state: null, + _states: [], + replaceState: function (state, title, url) { + this.state = state; + this._states[0] = state; + }, + pushState: function (state, title, url) { + this.state = state; + this._states.unshift(state); + } + }; + + HistoryTestLocation = _emberRoutingLocationHistory_location.default.extend({ + history: FakeHistory + }); + }, + + teardown: function () { + _emberMetal.run(function () { + if (location) { + location.destroy(); + } + }); + } + }); + + QUnit.test('HistoryLocation initState does not get fired on init', function () { + expect(1); + + HistoryTestLocation.reopen({ + init: function () { + ok(true, 'init was called'); + this._super.apply(this, arguments); + }, + initState: function () { + ok(false, 'initState() should not be called automatically'); + } + }); + + createLocation(); + }); + + QUnit.test('webkit doesn\'t fire popstate on page load', function () { + expect(1); + + HistoryTestLocation.reopen({ + initState: function () { + this._super.apply(this, arguments); + // these two should be equal to be able + // to successfully detect webkit initial popstate + equal(this._previousURL, this.getURL()); + } + }); + + createLocation(); + location.initState(); + }); + + QUnit.test('base URL is removed when retrieving the current pathname', function () { + expect(1); + + HistoryTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + + _emberMetal.set(this, 'location', mockBrowserLocation('/base/foo/bar')); + _emberMetal.set(this, 'baseURL', '/base/'); + }, + + initState: function () { + this._super.apply(this, arguments); + + equal(this.getURL(), '/foo/bar'); + } + }); + + createLocation(); + location.initState(); + }); + + QUnit.test('base URL is preserved when moving around', function () { + expect(1); + + HistoryTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + + _emberMetal.set(this, 'location', mockBrowserLocation('/base/foo/bar')); + _emberMetal.set(this, 'baseURL', '/base/'); + } + }); + + createLocation(); + location.initState(); + location.setURL('/one/two'); + + equal(location._historyState.path, '/base/one/two'); + }); + + QUnit.test('setURL continues to set even with a null state (iframes may set this)', function () { + expect(1); + + createLocation(); + location.initState(); + + FakeHistory.pushState(null); + location.setURL('/three/four'); + + equal(location._historyState.path, '/three/four'); + }); + + QUnit.test('replaceURL continues to set even with a null state (iframes may set this)', function () { + expect(1); + + createLocation(); + location.initState(); + + FakeHistory.pushState(null); + location.replaceURL('/three/four'); + + equal(location._historyState.path, '/three/four'); + }); + + QUnit.test('HistoryLocation.getURL() returns the current url, excluding both rootURL and baseURL', function () { + expect(1); + + HistoryTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + + _emberMetal.set(this, 'location', mockBrowserLocation('/base/foo/bar')); + _emberMetal.set(this, 'rootURL', '/app/'); + _emberMetal.set(this, 'baseURL', '/base/'); + } + }); + + createLocation(); + + equal(location.getURL(), '/foo/bar'); + }); + + QUnit.test('HistoryLocation.getURL() returns the current url, does not remove rootURL if its not at start of url', function () { + expect(1); + + HistoryTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + + _emberMetal.set(this, 'location', mockBrowserLocation('/foo/bar/baz')); + _emberMetal.set(this, 'rootURL', '/bar/'); + } + }); + + createLocation(); + + equal(location.getURL(), '/foo/bar/baz'); + }); + + QUnit.test('HistoryLocation.getURL() will not remove the rootURL when only a partial match', function () { + expect(1); + + HistoryTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + _emberMetal.set(this, 'location', mockBrowserLocation('/bars/baz')); + _emberMetal.set(this, 'rootURL', '/bar/'); + } + }); + + createLocation(); + + equal(location.getURL(), '/bars/baz'); + }); + + QUnit.test('HistoryLocation.getURL() returns the current url, does not remove baseURL if its not at start of url', function () { + expect(1); + + HistoryTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + + _emberMetal.set(this, 'location', mockBrowserLocation('/foo/bar/baz')); + _emberMetal.set(this, 'baseURL', '/bar/'); + } + }); + + createLocation(); + + equal(location.getURL(), '/foo/bar/baz'); + }); + + QUnit.test('HistoryLocation.getURL() will not remove the baseURL when only a partial match', function () { + expect(1); + + HistoryTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + _emberMetal.set(this, 'location', mockBrowserLocation('/bars/baz')); + _emberMetal.set(this, 'baseURL', '/bar/'); + } + }); + + createLocation(); + + equal(location.getURL(), '/bars/baz'); + }); + + QUnit.test('HistoryLocation.getURL() includes location.search', function () { + expect(1); + + HistoryTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + _emberMetal.set(this, 'location', mockBrowserLocation('/foo/bar?time=morphin')); + } + }); + + createLocation(); + + equal(location.getURL(), '/foo/bar?time=morphin'); + }); + + QUnit.test('HistoryLocation.getURL() includes location.hash', function () { + expect(1); + + HistoryTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + _emberMetal.set(this, 'location', mockBrowserLocation('/foo/bar#pink-power-ranger')); + } + }); + + createLocation(); + + equal(location.getURL(), '/foo/bar#pink-power-ranger'); + }); + + QUnit.test('HistoryLocation.getURL() includes location.hash and location.search', function () { + expect(1); + + HistoryTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + _emberMetal.set(this, 'location', mockBrowserLocation('/foo/bar?time=morphin#pink-power-ranger')); + } + }); + + createLocation(); + + equal(location.getURL(), '/foo/bar?time=morphin#pink-power-ranger'); + }); +}); +enifed('ember-routing/tests/location/history_location_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/tests/location'); + test('ember-routing/tests/location/history_location_test.js should pass jscs', function () { + ok(true, 'ember-routing/tests/location/history_location_test.js should pass jscs.'); + }); +}); +enifed('ember-routing/tests/location/history_location_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/tests/location'); + QUnit.test('ember-routing/tests/location/history_location_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/tests/location/history_location_test.js should pass jshint.'); + }); +}); +enifed('ember-routing/tests/location/none_location_test', ['exports', 'ember-metal', 'ember-routing/location/none_location'], function (exports, _emberMetal, _emberRoutingLocationNone_location) { + 'use strict'; + + var NoneTestLocation = undefined, + location = undefined; + + function createLocation(options) { + if (!options) { + options = {}; + } + location = NoneTestLocation.create(options); + } + + QUnit.module('Ember.NoneLocation', { + setup: function () { + NoneTestLocation = _emberRoutingLocationNone_location.default.extend({}); + }, + + teardown: function () { + _emberMetal.run(function () { + if (location) { + location.destroy(); + } + }); + } + }); + + QUnit.test('NoneLocation.formatURL() returns the current url always appending rootURL', function () { + expect(1); + + NoneTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + _emberMetal.set(this, 'rootURL', '/en/'); + } + }); + + createLocation(); + + equal(location.formatURL('/foo/bar'), '/en/foo/bar'); + }); + + QUnit.test('NoneLocation.getURL() returns the current path minus rootURL', function () { + expect(1); + + NoneTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + _emberMetal.set(this, 'rootURL', '/foo/'); + _emberMetal.set(this, 'path', '/foo/bar'); + } + }); + + createLocation(); + + equal(location.getURL(), '/bar'); + }); + + QUnit.test('NoneLocation.getURL() will remove the rootURL only from the beginning of a url', function () { + expect(1); + + NoneTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + _emberMetal.set(this, 'rootURL', '/bar/'); + _emberMetal.set(this, 'path', '/foo/bar/baz'); + } + }); + + createLocation(); + + equal(location.getURL(), '/foo/bar/baz'); + }); + + QUnit.test('NoneLocation.getURL() will not remove the rootURL when only a partial match', function () { + expect(1); + + NoneTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); + _emberMetal.set(this, 'rootURL', '/bar/'); + _emberMetal.set(this, 'path', '/bars/baz'); + } + }); + + createLocation(); + + equal(location.getURL(), '/bars/baz'); + }); +}); +enifed('ember-routing/tests/location/none_location_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/tests/location'); + test('ember-routing/tests/location/none_location_test.js should pass jscs', function () { + ok(true, 'ember-routing/tests/location/none_location_test.js should pass jscs.'); + }); +}); +enifed('ember-routing/tests/location/none_location_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/tests/location'); + QUnit.test('ember-routing/tests/location/none_location_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/tests/location/none_location_test.js should pass jshint.'); + }); +}); +enifed('ember-routing/tests/location/util_test', ['exports', 'ember-utils', 'ember-routing/location/util'], function (exports, _emberUtils, _emberRoutingLocationUtil) { + 'use strict'; + + function mockBrowserLocation(overrides) { + return _emberUtils.assign({ + href: 'http://test.com/', + pathname: '/', + hash: '', + search: '', + replace: function () { + ok(false, 'location.replace should not be called during testing'); + } + }, overrides); + } + + QUnit.module('Location Utilities'); + + QUnit.test('replacePath cannot be used to redirect to a different origin', function () { + expect(1); + + var expectedURL = undefined; + + var location = { + protocol: 'http:', + hostname: 'emberjs.com', + port: '1337', + + replace: function (url) { + equal(url, expectedURL); + } + }; + + expectedURL = 'http://emberjs.com:1337//google.com'; + _emberRoutingLocationUtil.replacePath(location, '//google.com'); + }); + + QUnit.test('getPath() should normalize location.pathname, making sure it always returns a leading slash', function () { + expect(2); + + var location = mockBrowserLocation({ pathname: 'test' }); + equal(_emberRoutingLocationUtil.getPath(location), '/test', 'When there is no leading slash, one is added.'); + + location = mockBrowserLocation({ pathname: '/test' }); + equal(_emberRoutingLocationUtil.getPath(location), '/test', 'When a leading slash is already there, it isn\'t added again'); + }); + + QUnit.test('getQuery() should return location.search as-is', function () { + expect(1); + + var location = mockBrowserLocation({ search: '?foo=bar' }); + equal(_emberRoutingLocationUtil.getQuery(location), '?foo=bar'); + }); + + QUnit.test('getFullPath() should return full pathname including query and hash', function () { + expect(1); + + var location = mockBrowserLocation({ + href: 'http://test.com/about?foo=bar#foo', + pathname: '/about', + search: '?foo=bar', + hash: '#foo' + }); + + equal(_emberRoutingLocationUtil.getFullPath(location), '/about?foo=bar#foo'); + }); + + QUnit.test('Feature-Detecting onhashchange', function () { + equal(_emberRoutingLocationUtil.supportsHashChange(undefined, { onhashchange: function () {} }), true, 'When not in IE, use onhashchange existence as evidence of the feature'); + equal(_emberRoutingLocationUtil.supportsHashChange(undefined, {}), false, 'When not in IE, use onhashchange absence as evidence of the feature absence'); + equal(_emberRoutingLocationUtil.supportsHashChange(7, { onhashchange: function () {} }), false, 'When in IE7 compatibility mode, never report existence of the feature'); + equal(_emberRoutingLocationUtil.supportsHashChange(8, { onhashchange: function () {} }), true, 'When in IE8+, use onhashchange existence as evidence of the feature'); + }); + + // jscs:disable + QUnit.test("Feature-detecting the history API", function () { + equal(_emberRoutingLocationUtil.supportsHistory("", { pushState: true }), true, "returns true if not Android Gingerbread and history.pushState exists"); + equal(_emberRoutingLocationUtil.supportsHistory("", {}), false, "returns false if history.pushState doesn't exist"); + equal(_emberRoutingLocationUtil.supportsHistory("", undefined), false, "returns false if history doesn't exist"); + + equal(_emberRoutingLocationUtil.supportsHistory("Mozilla/5.0 (Linux; U; Android 2.3.5; en-us; HTC Vision Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", { pushState: true }), false, "returns false if Android 2.x stock browser (not Chrome) claiming to support pushState"); + + equal(_emberRoutingLocationUtil.supportsHistory("Mozilla/5.0 (Linux; U; Android 4.0.3; nl-nl; GT-N7000 Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30", { pushState: true }), false, "returns false for Android 4.0.x stock browser (not Chrome) claiming to support pushState"); + + equal(_emberRoutingLocationUtil.supportsHistory("Mozilla/5.0 (Linux; U; Android 20.3.5; en-us; HTC Vision Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", { pushState: true }), true, "returns true if Android version begins with 2, but is greater than 2"); + + equal(_emberRoutingLocationUtil.supportsHistory("Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19", { pushState: true }), true, "returns true for Chrome (not stock browser) on Android 4.0.x"); + + // Windows Phone UA and History API: https://github.com/Modernizr/Modernizr/issues/1471 + equal(_emberRoutingLocationUtil.supportsHistory("Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; Microsoft; Virtual) like iPhone OS 7_0_3 Mac OS X AppleWebKit/537 (KHTML, like Gecko) Mobile Safari/537", { pushState: true }), true, "returns true for Windows Phone 8.1 with misleading user agent string"); + }); + // jscs:enable +}); +enifed('ember-routing/tests/location/util_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/tests/location'); + test('ember-routing/tests/location/util_test.js should pass jscs', function () { + ok(true, 'ember-routing/tests/location/util_test.js should pass jscs.'); + }); +}); +enifed('ember-routing/tests/location/util_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/tests/location'); + QUnit.test('ember-routing/tests/location/util_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/tests/location/util_test.js should pass jshint.'); + }); +}); +enifed('ember-routing/tests/system/cache_test', ['exports', 'ember-routing/system/cache'], function (exports, _emberRoutingSystemCache) { + 'use strict'; + + QUnit.module('BucketCache', { + setup: function () { + this.cache = _emberRoutingSystemCache.default.create(); + } + }); + + QUnit.test('has - returns false when bucket is not in cache', function (assert) { + assert.strictEqual(this.cache.has('foo'), false); + assert.strictEqual(this.cache.has('constructor'), false); + }); + + QUnit.test('has - returns true when bucket is in cache', function (assert) { + var token = {}; + + this.cache.stash('foo', 'bar', token); + this.cache.stash('constructor', 'bar', token); + + assert.strictEqual(this.cache.has('foo'), true); + assert.strictEqual(this.cache.has('constructor'), true); + }); + + QUnit.test('lookup - returns stashed value if key does exist in bucket', function (assert) { + var token = {}; + var defaultValue = {}; + + this.cache.stash('foo', 'bar', token); + + assert.strictEqual(this.cache.lookup('foo', 'bar', defaultValue), token); + }); + + QUnit.test('lookup - returns default value if key does not exist in bucket', function (assert) { + var token = {}; + var defaultValue = {}; + + this.cache.stash('foo', 'bar', token); + + assert.strictEqual(this.cache.lookup('foo', 'boo', defaultValue), defaultValue); + assert.strictEqual(this.cache.lookup('foo', 'constructor', defaultValue), defaultValue); + }); + + QUnit.test('lookup - returns default value if bucket does not exist', function (assert) { + var defaultValue = {}; + + assert.strictEqual(this.cache.lookup('boo', 'bar', defaultValue), defaultValue); + assert.strictEqual(this.cache.lookup('constructor', 'bar', defaultValue), defaultValue); + }); +}); +enifed('ember-routing/tests/system/cache_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/tests/system'); + test('ember-routing/tests/system/cache_test.js should pass jscs', function () { + ok(true, 'ember-routing/tests/system/cache_test.js should pass jscs.'); + }); +}); +enifed('ember-routing/tests/system/cache_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/tests/system'); + QUnit.test('ember-routing/tests/system/cache_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/tests/system/cache_test.js should pass jshint.'); + }); +}); +enifed('ember-routing/tests/system/controller_for_test', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/system/controller_for', 'ember-routing/system/generate_controller', 'internal-test-helpers'], function (exports, _emberMetal, _emberRuntime, _emberRoutingSystemController_for, _emberRoutingSystemGenerate_controller, _internalTestHelpers) { + 'use strict'; + + function buildInstance(namespace) { + var owner = _internalTestHelpers.buildOwner(); + + owner.__registry__.resolver = resolverFor(namespace); + owner.registerOptionsForType('view', { singleton: false }); + + owner.register('application:main', namespace, { instantiate: false }); + + owner.register('controller:basic', _emberRuntime.Controller, { instantiate: false }); + + return owner; + } + + function resolverFor(namespace) { + return { + resolve: function (fullName) { + var nameParts = fullName.split(':'); + var type = nameParts[0]; + var name = nameParts[1]; + + if (name === 'basic') { + name = ''; + } + var className = _emberRuntime.String.classify(name) + _emberRuntime.String.classify(type); + var factory = _emberMetal.get(namespace, className); + + if (factory) { + return factory; + } + } + }; + } + + var appInstance = undefined, + appController = undefined, + namespace = undefined; + + QUnit.module('Ember.controllerFor', { + setup: function () { + namespace = _emberRuntime.Namespace.create(); + appInstance = buildInstance(namespace); + appInstance.register('controller:app', _emberRuntime.Controller.extend()); + appController = appInstance.lookup('controller:app'); + }, + teardown: function () { + _emberMetal.run(function () { + appInstance.destroy(); + namespace.destroy(); + }); + } + }); + + QUnit.test('controllerFor should lookup for registered controllers', function () { + var controller = _emberRoutingSystemController_for.default(appInstance, 'app'); + + equal(appController, controller, 'should find app controller'); + }); + + QUnit.module('Ember.generateController', { + setup: function () { + namespace = _emberRuntime.Namespace.create(); + appInstance = buildInstance(namespace); + }, + teardown: function () { + _emberMetal.run(function () { + appInstance.destroy(); + namespace.destroy(); + }); + } + }); + + QUnit.test('generateController should create Ember.Controller', function () { + var controller = _emberRoutingSystemGenerate_controller.default(appInstance, 'home'); + + ok(controller instanceof _emberRuntime.Controller, 'should create controller'); + }); + + QUnit.test('generateController should create App.Controller if provided', function () { + var controller = undefined; + namespace.Controller = _emberRuntime.Controller.extend(); + + controller = _emberRoutingSystemGenerate_controller.default(appInstance, 'home'); + + ok(controller instanceof namespace.Controller, 'should create controller'); + }); +}); +// A +enifed('ember-routing/tests/system/controller_for_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/tests/system'); + test('ember-routing/tests/system/controller_for_test.js should pass jscs', function () { + ok(true, 'ember-routing/tests/system/controller_for_test.js should pass jscs.'); + }); +}); +enifed('ember-routing/tests/system/controller_for_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/tests/system'); + QUnit.test('ember-routing/tests/system/controller_for_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/tests/system/controller_for_test.js should pass jshint.'); + }); +}); +enifed('ember-routing/tests/system/dsl_test', ['exports', 'ember-utils', 'ember-routing/system/router', 'internal-test-helpers'], function (exports, _emberUtils, _emberRoutingSystemRouter, _internalTestHelpers) { + 'use strict'; + + var Router = undefined; + + function setup() { + Router = _emberRoutingSystemRouter.default.extend(); + } + + function teardown() { + Router = null; + } + + QUnit.module('Ember Router DSL', { + setup: setup, + teardown: teardown + }); + + QUnit.test('should fail when using a reserved route name', function () { + expectDeprecation('this.resource() is deprecated. Use this.route(\'name\', { resetNamespace: true }, function () {}) instead.'); + var reservedNames = ['array', 'basic', 'object', 'application']; + + expect(reservedNames.length * 2 + 1); + + reservedNames.forEach(function (reservedName) { + expectAssertion(function () { + Router = _emberRoutingSystemRouter.default.extend(); + + Router.map(function () { + this.route(reservedName); + }); + + var router = Router.create(); + router._initRouterJs(); + }, '\'' + reservedName + '\' cannot be used as a route name.'); + + expectAssertion(function () { + Router = _emberRoutingSystemRouter.default.extend(); + + Router.map(function () { + this.resource(reservedName); + }); + + var router = Router.create(); + router._initRouterJs(); + }, '\'' + reservedName + '\' cannot be used as a route name.'); + }); + }); + + QUnit.test('should reset namespace if nested with resource', function () { + expectDeprecation('this.resource() is deprecated. Use this.route(\'name\', { resetNamespace: true }, function () {}) instead.'); + + Router = Router.map(function () { + this.resource('bleep', function () { + this.resource('bloop', function () { + this.resource('blork'); + }); + }); + }); + + var router = Router.create(); + router._initRouterJs(); + + ok(router.router.recognizer.names['bleep'], 'nested resources do not contain parent name'); + ok(router.router.recognizer.names['bloop'], 'nested resources do not contain parent name'); + ok(router.router.recognizer.names['blork'], 'nested resources do not contain parent name'); + }); + + QUnit.test('should retain resource namespace if nested with routes', function () { + Router = Router.map(function () { + this.route('bleep', function () { + this.route('bloop', function () { + this.route('blork'); + }); + }); + }); + + var router = Router.create(); + router._initRouterJs(); + + ok(router.router.recognizer.names['bleep'], 'parent name was used as base of nested routes'); + ok(router.router.recognizer.names['bleep.bloop'], 'parent name was used as base of nested routes'); + ok(router.router.recognizer.names['bleep.bloop.blork'], 'parent name was used as base of nested routes'); + }); + + QUnit.test('should add loading and error routes if _isRouterMapResult is true', function () { + Router.map(function () { + this.route('blork'); + }); + + var router = Router.create({ + _hasModuleBasedResolver: function () { + return true; + } + }); + + router._initRouterJs(); + + ok(router.router.recognizer.names['blork'], 'main route was created'); + ok(router.router.recognizer.names['blork_loading'], 'loading route was added'); + ok(router.router.recognizer.names['blork_error'], 'error route was added'); + }); + + QUnit.test('should not add loading and error routes if _isRouterMapResult is false', function () { + Router.map(function () { + this.route('blork'); + }); + + var router = Router.create(); + router._initRouterJs(false); + + ok(router.router.recognizer.names['blork'], 'main route was created'); + ok(!router.router.recognizer.names['blork_loading'], 'loading route was not added'); + ok(!router.router.recognizer.names['blork_error'], 'error route was not added'); + }); + + QUnit.test('should reset namespace of loading and error routes for routes with resetNamespace', function () { + Router.map(function () { + this.route('blork', function () { + this.route('blorp'); + this.route('bleep', { resetNamespace: true }); + }); + }); + + var router = Router.create({ + _hasModuleBasedResolver: function () { + return true; + } + }); + + router._initRouterJs(); + + ok(router.router.recognizer.names['blork.blorp'], 'nested route was created'); + ok(router.router.recognizer.names['blork.blorp_loading'], 'nested loading route was added'); + ok(router.router.recognizer.names['blork.blorp_error'], 'nested error route was added'); + + ok(router.router.recognizer.names['bleep'], 'reset route was created'); + ok(router.router.recognizer.names['bleep_loading'], 'reset loading route was added'); + ok(router.router.recognizer.names['bleep_error'], 'reset error route was added'); + + ok(!router.router.recognizer.names['blork.bleep'], 'nested reset route was not created'); + ok(!router.router.recognizer.names['blork.bleep_loading'], 'nested reset loading route was not added'); + ok(!router.router.recognizer.names['blork.bleep_error'], 'nested reset error route was not added'); + }); + + QUnit.test('should throw an error when defining a route serializer outside an engine', function () { + Router.map(function () { + var _this = this; + + throws(function () { + _this.route('posts', { serialize: function () {} }); + }, /Defining a route serializer on route 'posts' outside an Engine is not allowed/); + }); + + Router.create()._initRouterJs(); + }); + + QUnit.module('Ember Router DSL with engines', { + setup: setup, + teardown: teardown + }); + + QUnit.test('should allow mounting of engines', function (assert) { + assert.expect(3); + + Router = Router.map(function () { + this.route('bleep', function () { + this.route('bloop', function () { + this.mount('chat'); + }); + }); + }); + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { routable: true } + }); + + var router = Router.create(); + _emberUtils.setOwner(router, engineInstance); + router._initRouterJs(); + + assert.ok(router.router.recognizer.names['bleep'], 'parent name was used as base of nested routes'); + assert.ok(router.router.recognizer.names['bleep.bloop'], 'parent name was used as base of nested routes'); + assert.ok(router.router.recognizer.names['bleep.bloop.chat'], 'parent name was used as base of mounted engine'); + }); + + QUnit.test('should allow mounting of engines at a custom path', function (assert) { + assert.expect(1); + + Router = Router.map(function () { + this.route('bleep', function () { + this.route('bloop', function () { + this.mount('chat', { path: 'custom-chat' }); + }); + }); + }); + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { routable: true } + }); + + var router = Router.create(); + _emberUtils.setOwner(router, engineInstance); + router._initRouterJs(); + + assert.deepEqual(router.router.recognizer.names['bleep.bloop.chat'].segments.slice(1, 4).map(function (s) { + return s.string; + }), ['bleep', 'bloop', 'custom-chat'], 'segments are properly associated with mounted engine'); + }); + + QUnit.test('should allow aliasing of engine names with `as`', function (assert) { + assert.expect(1); + + Router = Router.map(function () { + this.route('bleep', function () { + this.route('bloop', function () { + this.mount('chat', { as: 'blork' }); + }); + }); + }); + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { routable: true } + }); + + var router = Router.create(); + _emberUtils.setOwner(router, engineInstance); + router._initRouterJs(); + + assert.deepEqual(router.router.recognizer.names['bleep.bloop.blork'].segments.slice(1, 4).map(function (s) { + return s.string; + }), ['bleep', 'bloop', 'blork'], 'segments are properly associated with mounted engine with aliased name'); + }); + + QUnit.test('should add loading and error routes to a mount if _isRouterMapResult is true', function () { + Router.map(function () { + this.mount('chat'); + }); + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { routable: true } + }); + + var router = Router.create({ + _hasModuleBasedResolver: function () { + return true; + } + }); + _emberUtils.setOwner(router, engineInstance); + router._initRouterJs(); + + ok(router.router.recognizer.names['chat'], 'main route was created'); + ok(router.router.recognizer.names['chat_loading'], 'loading route was added'); + ok(router.router.recognizer.names['chat_error'], 'error route was added'); + }); + + QUnit.test('should add loading and error routes to a mount alias if _isRouterMapResult is true', function () { + Router.map(function () { + this.mount('chat', { as: 'shoutbox' }); + }); + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { routable: true } + }); + + var router = Router.create({ + _hasModuleBasedResolver: function () { + return true; + } + }); + _emberUtils.setOwner(router, engineInstance); + router._initRouterJs(); + + ok(router.router.recognizer.names['shoutbox'], 'main route was created'); + ok(router.router.recognizer.names['shoutbox_loading'], 'loading route was added'); + ok(router.router.recognizer.names['shoutbox_error'], 'error route was added'); + }); + + QUnit.test('should not add loading and error routes to a mount if _isRouterMapResult is false', function () { + Router.map(function () { + this.mount('chat'); + }); + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { routable: true } + }); + + var router = Router.create(); + _emberUtils.setOwner(router, engineInstance); + router._initRouterJs(false); + + ok(router.router.recognizer.names['chat'], 'main route was created'); + ok(!router.router.recognizer.names['chat_loading'], 'loading route was not added'); + ok(!router.router.recognizer.names['chat_error'], 'error route was not added'); + }); + + QUnit.test('should reset namespace of loading and error routes for mounts with resetNamespace', function () { + Router.map(function () { + this.route('news', function () { + this.mount('chat'); + this.mount('blog', { resetNamespace: true }); + }); + }); + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { routable: true } + }); + + var router = Router.create({ + _hasModuleBasedResolver: function () { + return true; + } + }); + _emberUtils.setOwner(router, engineInstance); + router._initRouterJs(); + + ok(router.router.recognizer.names['news.chat'], 'nested route was created'); + ok(router.router.recognizer.names['news.chat_loading'], 'nested loading route was added'); + ok(router.router.recognizer.names['news.chat_error'], 'nested error route was added'); + + ok(router.router.recognizer.names['blog'], 'reset route was created'); + ok(router.router.recognizer.names['blog_loading'], 'reset loading route was added'); + ok(router.router.recognizer.names['blog_error'], 'reset error route was added'); + + ok(!router.router.recognizer.names['news.blog'], 'nested reset route was not created'); + ok(!router.router.recognizer.names['news.blog_loading'], 'nested reset loading route was not added'); + ok(!router.router.recognizer.names['news.blog_error'], 'nested reset error route was not added'); + }); +}); +enifed('ember-routing/tests/system/dsl_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/tests/system'); + test('ember-routing/tests/system/dsl_test.js should pass jscs', function () { + ok(true, 'ember-routing/tests/system/dsl_test.js should pass jscs.'); + }); +}); +enifed('ember-routing/tests/system/dsl_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/tests/system'); + QUnit.test('ember-routing/tests/system/dsl_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/tests/system/dsl_test.js should pass jshint.'); + }); +}); +enifed('ember-routing/tests/system/route_test', ['exports', 'ember-utils', 'internal-test-helpers', 'ember-runtime', 'ember-routing/system/route'], function (exports, _emberUtils, _internalTestHelpers, _emberRuntime, _emberRoutingSystemRoute) { + 'use strict'; + + var route = undefined, + routeOne = undefined, + routeTwo = undefined, + lookupHash = undefined; + + function setup() { + route = _emberRoutingSystemRoute.default.create(); + } + + function teardown() { + _internalTestHelpers.runDestroy(route); + } + + QUnit.module('Ember.Route', { + setup: setup, + teardown: teardown + }); + + QUnit.test('default store utilizes the container to acquire the model factory', function () { + expect(4); + + var Post = _emberRuntime.Object.extend(); + var post = {}; + + Post.reopenClass({ + find: function (id) { + return post; + } + }); + + _emberUtils.setOwner(route, _internalTestHelpers.buildOwner({ + ownerOptions: { + hasRegistration: function () { + return true; + }, + + _lookupFactory: function (fullName) { + equal(fullName, 'model:post', 'correct factory was looked up'); + + return Post; + } + } + })); + + route.set('_qp', null); + + equal(route.model({ post_id: 1 }), post); + equal(route.findModel('post', 1), post, '#findModel returns the correct post'); + }); + + QUnit.test('\'store\' can be injected by data persistence frameworks', function () { + expect(8); + _internalTestHelpers.runDestroy(route); + + var owner = _internalTestHelpers.buildOwner(); + + var post = { + id: 1 + }; + + var Store = _emberRuntime.Object.extend({ + find: function (type, value) { + ok(true, 'injected model was called'); + equal(type, 'post', 'correct type was called'); + equal(value, 1, 'correct value was called'); + return post; + } + }); + + owner.register('route:index', _emberRoutingSystemRoute.default); + owner.register('store:main', Store); + + owner.inject('route', 'store', 'store:main'); + + route = owner.lookup('route:index'); + + equal(route.model({ post_id: 1 }), post, '#model returns the correct post'); + equal(route.findModel('post', 1), post, '#findModel returns the correct post'); + }); + + QUnit.test('assert if \'store.find\' method is not found', function () { + expect(1); + _internalTestHelpers.runDestroy(route); + + var owner = _internalTestHelpers.buildOwner(); + var Post = _emberRuntime.Object.extend(); + + owner.register('route:index', _emberRoutingSystemRoute.default); + owner.register('model:post', Post); + + route = owner.lookup('route:index'); + + expectAssertion(function () { + route.findModel('post', 1); + }, 'Post has no method `find`.'); + }); + + QUnit.test('asserts if model class is not found', function () { + expect(1); + _internalTestHelpers.runDestroy(route); + + var owner = _internalTestHelpers.buildOwner(); + owner.register('route:index', _emberRoutingSystemRoute.default); + + route = owner.lookup('route:index'); + + expectAssertion(function () { + route.model({ post_id: 1 }); + }, /You used the dynamic segment post_id in your route undefined, but .Post did not exist and you did not override your route\'s `model` hook./); + }); + + QUnit.test('\'store\' does not need to be injected', function () { + expect(1); + + _internalTestHelpers.runDestroy(route); + + var owner = _internalTestHelpers.buildOwner(); + + owner.register('route:index', _emberRoutingSystemRoute.default); + + route = owner.lookup('route:index'); + + ignoreAssertion(function () { + route.model({ post_id: 1 }); + }); + + ok(true, 'no error was raised'); + }); + + QUnit.test('modelFor doesn\'t require the router', function () { + expect(1); + + var owner = _internalTestHelpers.buildOwner(); + _emberUtils.setOwner(route, owner); + + var foo = { name: 'foo' }; + + var FooRoute = _emberRoutingSystemRoute.default.extend({ + currentModel: foo + }); + + owner.register('route:foo', FooRoute); + + strictEqual(route.modelFor('foo'), foo); + }); + + QUnit.test('.send just calls an action if the router is absent', function () { + expect(7); + var route = _emberRoutingSystemRoute.default.extend({ + actions: { + returnsTrue: function (foo, bar) { + equal(foo, 1); + equal(bar, 2); + equal(this, route); + return true; + }, + + returnsFalse: function () { + ok(true, 'returnsFalse was called'); + return false; + } + } + }).create(); + + equal(true, route.send('returnsTrue', 1, 2)); + equal(false, route.send('returnsFalse')); + equal(undefined, route.send('nonexistent', 1, 2, 3)); + }); + + QUnit.test('.send just calls an action if the routers internal router property is absent', function () { + expect(7); + var route = _emberRoutingSystemRoute.default.extend({ + router: {}, + actions: { + returnsTrue: function (foo, bar) { + equal(foo, 1); + equal(bar, 2); + equal(this, route); + return true; + }, + + returnsFalse: function () { + ok(true, 'returnsFalse was called'); + return false; + } + } + }).create(); + + equal(true, route.send('returnsTrue', 1, 2)); + equal(false, route.send('returnsFalse')); + equal(undefined, route.send('nonexistent', 1, 2, 3)); + }); + + QUnit.test('can access `actions` hash via `_actions` [DEPRECATED]', function () { + expect(2); + + var route = _emberRoutingSystemRoute.default.extend({ + actions: { + foo: function () { + ok(true, 'called foo action'); + } + } + }).create(); + + expectDeprecation(function () { + route._actions.foo(); + }, 'Usage of `_actions` is deprecated, use `actions` instead.'); + }); + + QUnit.test('actions in both `_actions` and `actions` results in an assertion', function () { + expectAssertion(function () { + _emberRoutingSystemRoute.default.extend({ + _actions: {}, + actions: {} + }).create(); + }, 'Specifying `_actions` and `actions` in the same mixin is not supported.'); + }); + + QUnit.test('actions added via `_actions` can be used [DEPRECATED]', function () { + expect(3); + + var route = undefined; + expectDeprecation(function () { + route = _emberRoutingSystemRoute.default.extend({ + _actions: { + bar: function () { + ok(true, 'called bar action'); + } + } + }, { + actions: { + foo: function () { + ok(true, 'called foo action'); + } + } + }).create(); + }, 'Specifying actions in `_actions` is deprecated, please use `actions` instead.'); + + route.send('foo'); + route.send('bar'); + }); + + QUnit.module('Ember.Route serialize', { + setup: setup, + teardown: teardown + }); + + QUnit.test('returns the models properties if params does not include *_id', function () { + var model = { id: 2, firstName: 'Ned', lastName: 'Ryerson' }; + + deepEqual(route.serialize(model, ['firstName', 'lastName']), { firstName: 'Ned', lastName: 'Ryerson' }, 'serialized correctly'); + }); + + QUnit.test('returns model.id if params include *_id', function () { + var model = { id: 2 }; + + deepEqual(route.serialize(model, ['post_id']), { post_id: 2 }, 'serialized correctly'); + }); + + QUnit.test('returns checks for existence of model.post_id before trying model.id', function () { + var model = { post_id: 3 }; + + deepEqual(route.serialize(model, ['post_id']), { post_id: 3 }, 'serialized correctly'); + }); + + QUnit.test('returns undefined if model is not set', function () { + equal(route.serialize(undefined, ['post_id']), undefined, 'serialized correctly'); + }); + + QUnit.module('Ember.Route interaction', { + setup: function () { + var owner = { + lookup: function (fullName) { + return lookupHash[fullName]; + } + }; + + routeOne = _emberRoutingSystemRoute.default.create({ routeName: 'one' }); + routeTwo = _emberRoutingSystemRoute.default.create({ routeName: 'two' }); + + _emberUtils.setOwner(routeOne, owner); + _emberUtils.setOwner(routeTwo, owner); + + lookupHash = { + 'route:one': routeOne, + 'route:two': routeTwo + }; + }, + + teardown: function () { + _internalTestHelpers.runDestroy(routeOne); + _internalTestHelpers.runDestroy(routeTwo); + } + }); + + QUnit.test('controllerFor uses route\'s controllerName if specified', function () { + var testController = {}; + lookupHash['controller:test'] = testController; + + routeOne.controllerName = 'test'; + + equal(routeTwo.controllerFor('one'), testController); + }); + + QUnit.module('Route injected properties'); + + QUnit.test('services can be injected into routes', function () { + var owner = _internalTestHelpers.buildOwner(); + + owner.register('route:application', _emberRoutingSystemRoute.default.extend({ + authService: _emberRuntime.inject.service('auth') + })); + + owner.register('service:auth', _emberRuntime.Service.extend()); + + var appRoute = owner.lookup('route:application'); + var authService = owner.lookup('service:auth'); + + equal(authService, appRoute.get('authService'), 'service.auth is injected'); + }); + + QUnit.module('Ember.Route with engines'); + + QUnit.test('paramsFor considers an engine\'s mountPoint', function (assert) { + expect(2); + + var router = { + _deserializeQueryParams: function () {}, + router: { + state: { + handlerInfos: [{ name: 'posts' }], + params: { + 'foo.bar': { a: 'b' }, + 'foo.bar.posts': { c: 'd' } + } + } + } + }; + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { + routable: true, + + mountPoint: 'foo.bar', + + lookup: function (name) { + if (name === 'route:posts') { + return postsRoute; + } else if (name === 'route:application') { + return applicationRoute; + } + } + } + }); + + var applicationRoute = _emberRoutingSystemRoute.default.create({ router: router, routeName: 'application', fullRouteName: 'foo.bar' }); + var postsRoute = _emberRoutingSystemRoute.default.create({ router: router, routeName: 'posts', fullRouteName: 'foo.bar.posts' }); + var route = _emberRoutingSystemRoute.default.create({ router: router }); + + _emberUtils.setOwner(applicationRoute, engineInstance); + _emberUtils.setOwner(postsRoute, engineInstance); + _emberUtils.setOwner(route, engineInstance); + + assert.deepEqual(route.paramsFor('application'), { a: 'b' }, 'params match for root `application` route in engine'); + assert.deepEqual(route.paramsFor('posts'), { c: 'd' }, 'params match for `posts` route in engine'); + }); + + QUnit.test('modelFor considers an engine\'s mountPoint', function () { + expect(2); + + var applicationModel = { id: '1' }; + var postsModel = { id: '2' }; + + var router = { + router: { + activeTransition: { + resolvedModels: { + 'foo.bar': applicationModel, + 'foo.bar.posts': postsModel + } + } + } + }; + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { + routable: true, + + mountPoint: 'foo.bar', + + lookup: function (name) { + if (name === 'route:posts') { + return postsRoute; + } else if (name === 'route:application') { + return applicationRoute; + } + } + } + }); + + var applicationRoute = _emberRoutingSystemRoute.default.create({ router: router, routeName: 'application' }); + var postsRoute = _emberRoutingSystemRoute.default.create({ router: router, routeName: 'posts' }); + var route = _emberRoutingSystemRoute.default.create({ router: router }); + + _emberUtils.setOwner(applicationRoute, engineInstance); + _emberUtils.setOwner(postsRoute, engineInstance); + _emberUtils.setOwner(route, engineInstance); + + strictEqual(route.modelFor('application'), applicationModel); + strictEqual(route.modelFor('posts'), postsModel); + }); + + QUnit.test('transitionTo considers an engine\'s mountPoint', function () { + expect(4); + + var router = { + transitionTo: function (route) { + return route; + } + }; + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { + routable: true, + mountPoint: 'foo.bar' + } + }); + + var route = _emberRoutingSystemRoute.default.create({ router: router }); + _emberUtils.setOwner(route, engineInstance); + + strictEqual(route.transitionTo('application'), 'foo.bar.application', 'properly prefixes application route'); + strictEqual(route.transitionTo('posts'), 'foo.bar.posts', 'properly prefixes child routes'); + throws(function () { + return route.transitionTo('/posts'); + }, 'throws when trying to use a url'); + + var queryParams = {}; + strictEqual(route.transitionTo(queryParams), queryParams, 'passes query param only transitions through'); + }); + + QUnit.test('intermediateTransitionTo considers an engine\'s mountPoint', function () { + expect(4); + + var lastRoute = undefined; + var router = { + intermediateTransitionTo: function (route) { + lastRoute = route; + } + }; + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { + routable: true, + mountPoint: 'foo.bar' + } + }); + + var route = _emberRoutingSystemRoute.default.create({ router: router }); + _emberUtils.setOwner(route, engineInstance); + + route.intermediateTransitionTo('application'); + strictEqual(lastRoute, 'foo.bar.application', 'properly prefixes application route'); + + route.intermediateTransitionTo('posts'); + strictEqual(lastRoute, 'foo.bar.posts', 'properly prefixes child routes'); + + throws(function () { + return route.intermediateTransitionTo('/posts'); + }, 'throws when trying to use a url'); + + var queryParams = {}; + route.intermediateTransitionTo(queryParams); + strictEqual(lastRoute, queryParams, 'passes query param only transitions through'); + }); + + QUnit.test('replaceWith considers an engine\'s mountPoint', function () { + expect(4); + + var router = { + replaceWith: function (route) { + return route; + } + }; + + var engineInstance = _internalTestHelpers.buildOwner({ + ownerOptions: { + routable: true, + mountPoint: 'foo.bar' + } + }); + + var route = _emberRoutingSystemRoute.default.create({ router: router }); + _emberUtils.setOwner(route, engineInstance); + + strictEqual(route.replaceWith('application'), 'foo.bar.application', 'properly prefixes application route'); + strictEqual(route.replaceWith('posts'), 'foo.bar.posts', 'properly prefixes child routes'); + throws(function () { + return route.replaceWith('/posts'); + }, 'throws when trying to use a url'); + + var queryParams = {}; + strictEqual(route.replaceWith(queryParams), queryParams, 'passes query param only transitions through'); + }); +}); +enifed('ember-routing/tests/system/route_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/tests/system'); + test('ember-routing/tests/system/route_test.js should pass jscs', function () { + ok(true, 'ember-routing/tests/system/route_test.js should pass jscs.'); + }); +}); +enifed('ember-routing/tests/system/route_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/tests/system'); + QUnit.test('ember-routing/tests/system/route_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/tests/system/route_test.js should pass jshint.'); + }); +}); +enifed('ember-routing/tests/system/router_test', ['exports', 'ember-utils', 'ember-routing/location/hash_location', 'ember-routing/location/history_location', 'ember-routing/location/auto_location', 'ember-routing/location/none_location', 'ember-routing/system/router', 'internal-test-helpers'], function (exports, _emberUtils, _emberRoutingLocationHash_location, _emberRoutingLocationHistory_location, _emberRoutingLocationAuto_location, _emberRoutingLocationNone_location, _emberRoutingSystemRouter, _internalTestHelpers) { + 'use strict'; + + var owner = undefined; + + function createRouter(settings) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + var CustomRouter = _emberRoutingSystemRouter.default.extend(); + var router = CustomRouter.create(settings); + + if (!options.skipOwner) { + _emberUtils.setOwner(router, owner); + } + + if (!options.disableSetup) { + router.setupRouter(); + } + + return router; + } + + QUnit.module('Ember Router', { + setup: function () { + owner = _internalTestHelpers.buildOwner(); + + //register the HashLocation (the default) + owner.register('location:hash', _emberRoutingLocationHash_location.default); + owner.register('location:history', _emberRoutingLocationHistory_location.default); + owner.register('location:auto', _emberRoutingLocationAuto_location.default); + owner.register('location:none', _emberRoutingLocationNone_location.default); + }, + teardown: function () { + _internalTestHelpers.runDestroy(owner); + owner = null; + } + }); + + QUnit.test('can create a router without an owner', function () { + createRouter(null, { disableSetup: true, skipOwner: true }); + + ok(true, 'no errors were thrown when creating without a container'); + }); + + QUnit.test('should not create a router.js instance upon init', function () { + var router = createRouter(null, { disableSetup: true }); + + ok(!router.router); + }); + + QUnit.test('should not reify location until setupRouter is called', function () { + var router = createRouter(null, { disableSetup: true }); + equal(typeof router.location, 'string', 'location is specified as a string'); + + router.setupRouter(); + + equal(typeof router.location, 'object', 'location is reified into an object'); + }); + + QUnit.test('should destroy its location upon destroying the routers owner.', function () { + var router = createRouter(); + var location = router.get('location'); + + _internalTestHelpers.runDestroy(owner); + + ok(location.isDestroyed, 'location should be destroyed'); + }); + + QUnit.test('should instantiate its location with its `rootURL`', function () { + var router = createRouter({ + rootURL: '/rootdir/' + }); + var location = router.get('location'); + + equal(location.get('rootURL'), '/rootdir/'); + }); + + QUnit.test('replacePath should be called with the right path', function () { + expect(1); + + var location = owner.lookup('location:auto'); + + var browserLocation = { + href: 'http://test.com/rootdir/welcome', + origin: 'http://test.com', + pathname: '/rootdir/welcome', + hash: '', + search: '', + replace: function (url) { + equal(url, 'http://test.com/rootdir/#/welcome'); + } + }; + + location.location = browserLocation; + location.global = { onhashchange: function () {} }; + location.history = null; + + createRouter({ + location: 'auto', + rootURL: '/rootdir/' + }); + }); + + QUnit.test('Ember.Router._routePath should consume identical prefixes', function () { + createRouter(); + + expect(8); + + function routePath(s1, s2, s3) { + var handlerInfos = Array.prototype.slice.call(arguments).map(function (s) { + return { name: s }; + }); + handlerInfos.unshift({ name: 'ignored' }); + + return _emberRoutingSystemRouter.default._routePath(handlerInfos); + } + + equal(routePath('foo'), 'foo'); + equal(routePath('foo', 'bar', 'baz'), 'foo.bar.baz'); + equal(routePath('foo', 'foo.bar'), 'foo.bar'); + equal(routePath('foo', 'foo.bar', 'foo.bar.baz'), 'foo.bar.baz'); + equal(routePath('foo', 'foo.bar', 'foo.bar.baz.wow'), 'foo.bar.baz.wow'); + equal(routePath('foo', 'foo.bar.baz.wow'), 'foo.bar.baz.wow'); + equal(routePath('foo.bar', 'bar.baz.wow'), 'foo.bar.baz.wow'); + + // This makes no sense, not trying to handle it, just + // making sure it doesn't go boom. + equal(routePath('foo.bar.baz', 'foo'), 'foo.bar.baz.foo'); + }); + + QUnit.test('Router should cancel routing setup when the Location class says so via cancelRouterSetup', function () { + expect(0); + + var router = undefined; + var FakeLocation = { + cancelRouterSetup: true, + create: function () { + return this; + } + }; + + owner.register('location:fake', FakeLocation); + + router = createRouter({ + location: 'fake', + + _setupRouter: function () { + ok(false, '_setupRouter should not be called'); + } + }); + + router.startRouting(); + }); + + QUnit.test('AutoLocation should replace the url when it\'s not in the preferred format', function () { + expect(1); + + var location = owner.lookup('location:auto'); + + location.location = { + href: 'http://test.com/rootdir/welcome', + origin: 'http://test.com', + pathname: '/rootdir/welcome', + hash: '', + search: '', + replace: function (url) { + equal(url, 'http://test.com/rootdir/#/welcome'); + } + }; + location.history = null; + location.global = { + onhashchange: function () {} + }; + + createRouter({ + location: 'auto', + rootURL: '/rootdir/' + }); + }); + + QUnit.test('Router#handleURL should remove any #hashes before doing URL transition', function () { + expect(2); + + var router = createRouter({ + _doURLTransition: function (routerJsMethod, url) { + equal(routerJsMethod, 'handleURL'); + equal(url, '/foo/bar?time=morphin'); + } + }); + + router.handleURL('/foo/bar?time=morphin#pink-power-ranger'); + }); + + QUnit.test('Router#triggerEvent allows actions to bubble when returning true', function (assert) { + assert.expect(2); + + var handlerInfos = [{ + name: 'application', + handler: { + actions: { + loading: function () { + assert.ok(false, 'loading not handled by application route'); + } + } + } + }, { + name: 'about', + handler: { + actions: { + loading: function () { + assert.ok(true, 'loading handled by about route'); + return false; + } + } + } + }, { + name: 'about.me', + handler: { + actions: { + loading: function () { + assert.ok(true, 'loading handled by about.me route'); + return true; + } + } + } + }]; + + _emberRoutingSystemRouter.triggerEvent(handlerInfos, false, ['loading']); + }); + + QUnit.test('Router#triggerEvent ignores handlers that have not loaded yet', function (assert) { + assert.expect(1); + + var handlerInfos = [{ + name: 'about', + handler: { + actions: { + loading: function () { + assert.ok(true, 'loading handled by about route'); + } + } + } + }, { + name: 'about.me', + handler: undefined + }]; + + _emberRoutingSystemRouter.triggerEvent(handlerInfos, false, ['loading']); + }); +}); +enifed('ember-routing/tests/system/router_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/tests/system'); + test('ember-routing/tests/system/router_test.js should pass jscs', function () { + ok(true, 'ember-routing/tests/system/router_test.js should pass jscs.'); + }); +}); +enifed('ember-routing/tests/system/router_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/tests/system'); + QUnit.test('ember-routing/tests/system/router_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/tests/system/router_test.js should pass jshint.'); + }); +}); +enifed('ember-routing/tests/utils_test', ['exports', 'ember-routing/utils'], function (exports, _emberRoutingUtils) { + 'use strict'; + + QUnit.module('Routing query parameter utils - normalizeControllerQueryParams'); + + QUnit.test('returns the cached value if that has been previously set', function (assert) { + var cached = {}; + var params = ['foo']; + params._qpMap = cached; + + var normalized = _emberRoutingUtils.normalizeControllerQueryParams(params); + equal(cached, normalized, 'cached value returned if previously set'); + }); + + QUnit.test('converts array style into verbose object style', function (assert) { + var paramName = 'foo'; + var params = [paramName]; + var normalized = _emberRoutingUtils.normalizeControllerQueryParams(params); + + ok(normalized[paramName], 'turns the query param name into key'); + equal(normalized[paramName].as, null, 'includes a blank alias in \'as\' key'); + equal(normalized[paramName].scope, 'model', 'defaults scope to model'); + }); + + QUnit.test('converts object stlye [{foo: \'an_alias\'}]', function (assert) { + var paramName = 'foo'; + var params = [{ 'foo': 'an_alias' }]; + var normalized = _emberRoutingUtils.normalizeControllerQueryParams(params); + + ok(normalized[paramName], 'retains the query param name as key'); + equal(normalized[paramName].as, 'an_alias', 'includes the provided alias in \'as\' key'); + equal(normalized[paramName].scope, 'model', 'defaults scope to model'); + }); + + QUnit.test('retains maximally verbose object stlye [{foo: {as: \'foo\'}}]', function (assert) { + var paramName = 'foo'; + var params = [{ 'foo': { as: 'an_alias' } }]; + var normalized = _emberRoutingUtils.normalizeControllerQueryParams(params); + + ok(normalized[paramName], 'retains the query param name as key'); + equal(normalized[paramName].as, 'an_alias', 'includes the provided alias in \'as\' key'); + equal(normalized[paramName].scope, 'model', 'defaults scope to model'); + }); +}); +enifed('ember-routing/tests/utils_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing/tests'); + test('ember-routing/tests/utils_test.js should pass jscs', function () { + ok(true, 'ember-routing/tests/utils_test.js should pass jscs.'); + }); +}); +enifed('ember-routing/tests/utils_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing/tests'); + QUnit.test('ember-routing/tests/utils_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/tests/utils_test.js should pass jshint.'); + }); +}); +enifed('ember-routing/utils.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-routing'); + test('ember-routing/utils.js should pass jscs', function () { + ok(true, 'ember-routing/utils.js should pass jscs.'); + }); +}); +enifed('ember-routing/utils.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-routing'); + QUnit.test('ember-routing/utils.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/utils.js should pass jshint.'); + }); +}); +enifed('ember-runtime/compare.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime'); + test('ember-runtime/compare.js should pass jscs', function () { + ok(true, 'ember-runtime/compare.js should pass jscs.'); + }); +}); +enifed('ember-runtime/compare.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime'); + QUnit.test('ember-runtime/compare.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/compare.js should pass jshint.'); + }); +}); +enifed('ember-runtime/computed/computed_macros.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/computed'); + test('ember-runtime/computed/computed_macros.js should pass jscs', function () { + ok(true, 'ember-runtime/computed/computed_macros.js should pass jscs.'); + }); +}); +enifed('ember-runtime/computed/computed_macros.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/computed'); + QUnit.test('ember-runtime/computed/computed_macros.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/computed/computed_macros.js should pass jshint.'); + }); +}); +enifed('ember-runtime/computed/reduce_computed_macros.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/computed'); + test('ember-runtime/computed/reduce_computed_macros.js should pass jscs', function () { + ok(true, 'ember-runtime/computed/reduce_computed_macros.js should pass jscs.'); + }); +}); +enifed('ember-runtime/computed/reduce_computed_macros.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/computed'); + QUnit.test('ember-runtime/computed/reduce_computed_macros.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/computed/reduce_computed_macros.js should pass jshint.'); + }); +}); +enifed('ember-runtime/controllers/controller.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/controllers'); + test('ember-runtime/controllers/controller.js should pass jscs', function () { + ok(true, 'ember-runtime/controllers/controller.js should pass jscs.'); + }); +}); +enifed('ember-runtime/controllers/controller.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/controllers'); + QUnit.test('ember-runtime/controllers/controller.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/controllers/controller.js should pass jshint.'); + }); +}); +enifed('ember-runtime/copy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime'); + test('ember-runtime/copy.js should pass jscs', function () { + ok(true, 'ember-runtime/copy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/copy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime'); + QUnit.test('ember-runtime/copy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/copy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/ext/function.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/ext'); + test('ember-runtime/ext/function.js should pass jscs', function () { + ok(true, 'ember-runtime/ext/function.js should pass jscs.'); + }); +}); +enifed('ember-runtime/ext/function.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/ext'); + QUnit.test('ember-runtime/ext/function.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/ext/function.js should pass jshint.'); + }); +}); +enifed("ember-runtime/ext/rsvp.jscs-test", ["exports"], function (exports) { + "use strict"; +}); +enifed('ember-runtime/ext/rsvp.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/ext'); + QUnit.test('ember-runtime/ext/rsvp.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/ext/rsvp.js should pass jshint.'); + }); +}); +enifed('ember-runtime/ext/string.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/ext'); + test('ember-runtime/ext/string.js should pass jscs', function () { + ok(true, 'ember-runtime/ext/string.js should pass jscs.'); + }); +}); +enifed('ember-runtime/ext/string.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/ext'); + QUnit.test('ember-runtime/ext/string.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/ext/string.js should pass jshint.'); + }); +}); +enifed('ember-runtime/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime'); + test('ember-runtime/index.js should pass jscs', function () { + ok(true, 'ember-runtime/index.js should pass jscs.'); + }); +}); +enifed('ember-runtime/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime'); + QUnit.test('ember-runtime/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/index.js should pass jshint.'); + }); +}); +enifed('ember-runtime/inject.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime'); + test('ember-runtime/inject.js should pass jscs', function () { + ok(true, 'ember-runtime/inject.js should pass jscs.'); + }); +}); +enifed('ember-runtime/inject.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime'); + QUnit.test('ember-runtime/inject.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/inject.js should pass jshint.'); + }); +}); +enifed('ember-runtime/is-equal.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime'); + test('ember-runtime/is-equal.js should pass jscs', function () { + ok(true, 'ember-runtime/is-equal.js should pass jscs.'); + }); +}); +enifed('ember-runtime/is-equal.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime'); + QUnit.test('ember-runtime/is-equal.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/is-equal.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/-proxy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/-proxy.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/-proxy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/-proxy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/-proxy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/-proxy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/action_handler.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/action_handler.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/action_handler.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/action_handler.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/action_handler.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/action_handler.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/array.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/array.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/array.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/array.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/array.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/array.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/comparable.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/comparable.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/comparable.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/comparable.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/comparable.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/comparable.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/container_proxy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/container_proxy.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/container_proxy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/container_proxy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/container_proxy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/container_proxy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/controller.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/controller.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/controller.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/controller.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/controller.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/controller.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/controller_content_model_alias_deprecation.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/controller_content_model_alias_deprecation.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/controller_content_model_alias_deprecation.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/controller_content_model_alias_deprecation.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/controller_content_model_alias_deprecation.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/controller_content_model_alias_deprecation.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/copyable.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/copyable.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/copyable.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/copyable.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/copyable.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/copyable.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/enumerable.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/enumerable.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/enumerable.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/enumerable.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/enumerable.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/enumerable.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/evented.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/evented.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/evented.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/evented.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/evented.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/evented.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/freezable.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/freezable.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/freezable.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/freezable.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/freezable.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/freezable.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/mutable_array.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/mutable_array.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/mutable_array.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/mutable_array.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/mutable_array.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/mutable_array.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/mutable_enumerable.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/mutable_enumerable.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/mutable_enumerable.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/mutable_enumerable.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/mutable_enumerable.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/mutable_enumerable.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/observable.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/observable.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/observable.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/observable.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/observable.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/observable.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/promise_proxy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/promise_proxy.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/promise_proxy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/promise_proxy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/promise_proxy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/promise_proxy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/registry_proxy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/registry_proxy.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/registry_proxy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/registry_proxy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/registry_proxy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/registry_proxy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/mixins/target_action_support.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/mixins'); + test('ember-runtime/mixins/target_action_support.js should pass jscs', function () { + ok(true, 'ember-runtime/mixins/target_action_support.js should pass jscs.'); + }); +}); +enifed('ember-runtime/mixins/target_action_support.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/mixins'); + QUnit.test('ember-runtime/mixins/target_action_support.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/mixins/target_action_support.js should pass jshint.'); + }); +}); +enifed('ember-runtime/string_registry.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime'); + test('ember-runtime/string_registry.js should pass jscs', function () { + ok(true, 'ember-runtime/string_registry.js should pass jscs.'); + }); +}); +enifed('ember-runtime/string_registry.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime'); + QUnit.test('ember-runtime/string_registry.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/string_registry.js should pass jshint.'); + }); +}); +enifed('ember-runtime/system/application.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/system'); + test('ember-runtime/system/application.js should pass jscs', function () { + ok(true, 'ember-runtime/system/application.js should pass jscs.'); + }); +}); +enifed('ember-runtime/system/application.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/system'); + QUnit.test('ember-runtime/system/application.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/system/application.js should pass jshint.'); + }); +}); +enifed('ember-runtime/system/array_proxy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/system'); + test('ember-runtime/system/array_proxy.js should pass jscs', function () { + ok(true, 'ember-runtime/system/array_proxy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/system/array_proxy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/system'); + QUnit.test('ember-runtime/system/array_proxy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/system/array_proxy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/system/core_object.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/system'); + test('ember-runtime/system/core_object.js should pass jscs', function () { + ok(true, 'ember-runtime/system/core_object.js should pass jscs.'); + }); +}); +enifed('ember-runtime/system/core_object.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/system'); + QUnit.test('ember-runtime/system/core_object.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/system/core_object.js should pass jshint.'); + }); +}); +enifed('ember-runtime/system/each_proxy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/system'); + test('ember-runtime/system/each_proxy.js should pass jscs', function () { + ok(true, 'ember-runtime/system/each_proxy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/system/each_proxy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/system'); + QUnit.test('ember-runtime/system/each_proxy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/system/each_proxy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/system/lazy_load.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/system'); + test('ember-runtime/system/lazy_load.js should pass jscs', function () { + ok(true, 'ember-runtime/system/lazy_load.js should pass jscs.'); + }); +}); +enifed('ember-runtime/system/lazy_load.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/system'); + QUnit.test('ember-runtime/system/lazy_load.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/system/lazy_load.js should pass jshint.'); + }); +}); +enifed('ember-runtime/system/namespace.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/system'); + test('ember-runtime/system/namespace.js should pass jscs', function () { + ok(true, 'ember-runtime/system/namespace.js should pass jscs.'); + }); +}); +enifed('ember-runtime/system/namespace.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/system'); + QUnit.test('ember-runtime/system/namespace.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/system/namespace.js should pass jshint.'); + }); +}); +enifed('ember-runtime/system/native_array.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/system'); + test('ember-runtime/system/native_array.js should pass jscs', function () { + ok(true, 'ember-runtime/system/native_array.js should pass jscs.'); + }); +}); +enifed('ember-runtime/system/native_array.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/system'); + QUnit.test('ember-runtime/system/native_array.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/system/native_array.js should pass jshint.'); + }); +}); +enifed('ember-runtime/system/object.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/system'); + test('ember-runtime/system/object.js should pass jscs', function () { + ok(true, 'ember-runtime/system/object.js should pass jscs.'); + }); +}); +enifed('ember-runtime/system/object.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/system'); + QUnit.test('ember-runtime/system/object.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/system/object.js should pass jshint.'); + }); +}); +enifed('ember-runtime/system/object_proxy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/system'); + test('ember-runtime/system/object_proxy.js should pass jscs', function () { + ok(true, 'ember-runtime/system/object_proxy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/system/object_proxy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/system'); + QUnit.test('ember-runtime/system/object_proxy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/system/object_proxy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/system/service.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/system'); + test('ember-runtime/system/service.js should pass jscs', function () { + ok(true, 'ember-runtime/system/service.js should pass jscs.'); + }); +}); +enifed('ember-runtime/system/service.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/system'); + QUnit.test('ember-runtime/system/service.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/system/service.js should pass jshint.'); + }); +}); +enifed('ember-runtime/system/string.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/system'); + test('ember-runtime/system/string.js should pass jscs', function () { + ok(true, 'ember-runtime/system/string.js should pass jscs.'); + }); +}); +enifed('ember-runtime/system/string.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/system'); + QUnit.test('ember-runtime/system/string.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/system/string.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/computed/computed_macros_test', ['exports', 'ember-metal', 'ember-runtime/computed/computed_macros', 'internal-test-helpers', 'ember-runtime/system/object', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeComputedComputed_macros, _internalTestHelpers, _emberRuntimeSystemObject, _emberRuntimeSystemNative_array) { + 'use strict'; + + QUnit.module('CP macros'); + + _internalTestHelpers.testBoth('Ember.computed.empty', function (get, set) { + var obj = _emberRuntimeSystemObject.default.extend({ + bestLannister: null, + lannisters: null, + + bestLannisterUnspecified: _emberRuntimeComputedComputed_macros.empty('bestLannister'), + noLannistersKnown: _emberRuntimeComputedComputed_macros.empty('lannisters') + }).create({ + lannisters: _emberRuntimeSystemNative_array.A() + }); + + equal(get(obj, 'bestLannisterUnspecified'), true, 'bestLannister initially empty'); + equal(get(obj, 'noLannistersKnown'), true, 'lannisters initially empty'); + + get(obj, 'lannisters').pushObject('Tyrion'); + set(obj, 'bestLannister', 'Tyrion'); + + equal(get(obj, 'bestLannisterUnspecified'), false, 'empty respects strings'); + equal(get(obj, 'noLannistersKnown'), false, 'empty respects array mutations'); + }); + + _internalTestHelpers.testBoth('Ember.computed.notEmpty', function (get, set) { + var obj = _emberRuntimeSystemObject.default.extend({ + bestLannister: null, + lannisters: null, + + bestLannisterSpecified: _emberRuntimeComputedComputed_macros.notEmpty('bestLannister'), + LannistersKnown: _emberRuntimeComputedComputed_macros.notEmpty('lannisters') + }).create({ + lannisters: _emberRuntimeSystemNative_array.A() + }); + + equal(get(obj, 'bestLannisterSpecified'), false, 'bestLannister initially empty'); + equal(get(obj, 'LannistersKnown'), false, 'lannisters initially empty'); + + get(obj, 'lannisters').pushObject('Tyrion'); + set(obj, 'bestLannister', 'Tyrion'); + + equal(get(obj, 'bestLannisterSpecified'), true, 'empty respects strings'); + equal(get(obj, 'LannistersKnown'), true, 'empty respects array mutations'); + }); + + _internalTestHelpers.testBoth('computed.not', function (get, set) { + var obj = { foo: true }; + _emberMetal.defineProperty(obj, 'notFoo', _emberRuntimeComputedComputed_macros.not('foo')); + equal(get(obj, 'notFoo'), false); + + obj = { foo: { bar: true } }; + _emberMetal.defineProperty(obj, 'notFoo', _emberRuntimeComputedComputed_macros.not('foo.bar')); + equal(get(obj, 'notFoo'), false); + }); + + _internalTestHelpers.testBoth('computed.empty', function (get, set) { + var obj = { foo: [], bar: undefined, baz: null, quz: '' }; + _emberMetal.defineProperty(obj, 'fooEmpty', _emberRuntimeComputedComputed_macros.empty('foo')); + _emberMetal.defineProperty(obj, 'barEmpty', _emberRuntimeComputedComputed_macros.empty('bar')); + _emberMetal.defineProperty(obj, 'bazEmpty', _emberRuntimeComputedComputed_macros.empty('baz')); + _emberMetal.defineProperty(obj, 'quzEmpty', _emberRuntimeComputedComputed_macros.empty('quz')); + + equal(get(obj, 'fooEmpty'), true); + set(obj, 'foo', [1]); + equal(get(obj, 'fooEmpty'), false); + equal(get(obj, 'barEmpty'), true); + equal(get(obj, 'bazEmpty'), true); + equal(get(obj, 'quzEmpty'), true); + set(obj, 'quz', 'asdf'); + equal(get(obj, 'quzEmpty'), false); + }); + + _internalTestHelpers.testBoth('computed.bool', function (get, set) { + var obj = { foo: function () {}, bar: 'asdf', baz: null, quz: false }; + _emberMetal.defineProperty(obj, 'fooBool', _emberRuntimeComputedComputed_macros.bool('foo')); + _emberMetal.defineProperty(obj, 'barBool', _emberRuntimeComputedComputed_macros.bool('bar')); + _emberMetal.defineProperty(obj, 'bazBool', _emberRuntimeComputedComputed_macros.bool('baz')); + _emberMetal.defineProperty(obj, 'quzBool', _emberRuntimeComputedComputed_macros.bool('quz')); + equal(get(obj, 'fooBool'), true); + equal(get(obj, 'barBool'), true); + equal(get(obj, 'bazBool'), false); + equal(get(obj, 'quzBool'), false); + }); + + _internalTestHelpers.testBoth('computed.alias', function (get, set) { + var obj = { bar: 'asdf', baz: null, quz: false }; + _emberMetal.defineProperty(obj, 'bay', _emberMetal.computed(function (key) { + return 'apple'; + })); + + _emberMetal.defineProperty(obj, 'barAlias', _emberMetal.alias('bar')); + _emberMetal.defineProperty(obj, 'bazAlias', _emberMetal.alias('baz')); + _emberMetal.defineProperty(obj, 'quzAlias', _emberMetal.alias('quz')); + _emberMetal.defineProperty(obj, 'bayAlias', _emberMetal.alias('bay')); + + equal(get(obj, 'barAlias'), 'asdf'); + equal(get(obj, 'bazAlias'), null); + equal(get(obj, 'quzAlias'), false); + equal(get(obj, 'bayAlias'), 'apple'); + + set(obj, 'barAlias', 'newBar'); + set(obj, 'bazAlias', 'newBaz'); + set(obj, 'quzAlias', null); + + equal(get(obj, 'barAlias'), 'newBar'); + equal(get(obj, 'bazAlias'), 'newBaz'); + equal(get(obj, 'quzAlias'), null); + + equal(get(obj, 'bar'), 'newBar'); + equal(get(obj, 'baz'), 'newBaz'); + equal(get(obj, 'quz'), null); + }); + + _internalTestHelpers.testBoth('computed.alias set', function (get, set) { + var obj = {}; + var constantValue = 'always `a`'; + + _emberMetal.defineProperty(obj, 'original', _emberMetal.computed({ + get: function (key) { + return constantValue; + }, + set: function (key, value) { + return constantValue; + } + })); + _emberMetal.defineProperty(obj, 'aliased', _emberMetal.alias('original')); + + equal(get(obj, 'original'), constantValue); + equal(get(obj, 'aliased'), constantValue); + + set(obj, 'aliased', 'should not set to this value'); + + equal(get(obj, 'original'), constantValue); + equal(get(obj, 'aliased'), constantValue); + }); + + _internalTestHelpers.testBoth('computed.match', function (get, set) { + var obj = { name: 'Paul' }; + _emberMetal.defineProperty(obj, 'isPaul', _emberRuntimeComputedComputed_macros.match('name', /Paul/)); + + equal(get(obj, 'isPaul'), true, 'is Paul'); + + set(obj, 'name', 'Pierre'); + + equal(get(obj, 'isPaul'), false, 'is not Paul anymore'); + }); + + _internalTestHelpers.testBoth('computed.notEmpty', function (get, set) { + var obj = { items: [1] }; + _emberMetal.defineProperty(obj, 'hasItems', _emberRuntimeComputedComputed_macros.notEmpty('items')); + + equal(get(obj, 'hasItems'), true, 'is not empty'); + + set(obj, 'items', []); + + equal(get(obj, 'hasItems'), false, 'is empty'); + }); + + _internalTestHelpers.testBoth('computed.equal', function (get, set) { + var obj = { name: 'Paul' }; + _emberMetal.defineProperty(obj, 'isPaul', _emberRuntimeComputedComputed_macros.equal('name', 'Paul')); + + equal(get(obj, 'isPaul'), true, 'is Paul'); + + set(obj, 'name', 'Pierre'); + + equal(get(obj, 'isPaul'), false, 'is not Paul anymore'); + }); + + _internalTestHelpers.testBoth('computed.gt', function (get, set) { + var obj = { number: 2 }; + _emberMetal.defineProperty(obj, 'isGreaterThenOne', _emberRuntimeComputedComputed_macros.gt('number', 1)); + + equal(get(obj, 'isGreaterThenOne'), true, 'is gt'); + + set(obj, 'number', 1); + + equal(get(obj, 'isGreaterThenOne'), false, 'is not gt'); + + set(obj, 'number', 0); + + equal(get(obj, 'isGreaterThenOne'), false, 'is not gt'); + }); + + _internalTestHelpers.testBoth('computed.gte', function (get, set) { + var obj = { number: 2 }; + _emberMetal.defineProperty(obj, 'isGreaterOrEqualThenOne', _emberRuntimeComputedComputed_macros.gte('number', 1)); + + equal(get(obj, 'isGreaterOrEqualThenOne'), true, 'is gte'); + + set(obj, 'number', 1); + + equal(get(obj, 'isGreaterOrEqualThenOne'), true, 'is gte'); + + set(obj, 'number', 0); + + equal(get(obj, 'isGreaterOrEqualThenOne'), false, 'is not gte'); + }); + + _internalTestHelpers.testBoth('computed.lt', function (get, set) { + var obj = { number: 0 }; + _emberMetal.defineProperty(obj, 'isLesserThenOne', _emberRuntimeComputedComputed_macros.lt('number', 1)); + + equal(get(obj, 'isLesserThenOne'), true, 'is lt'); + + set(obj, 'number', 1); + + equal(get(obj, 'isLesserThenOne'), false, 'is not lt'); + + set(obj, 'number', 2); + + equal(get(obj, 'isLesserThenOne'), false, 'is not lt'); + }); + + _internalTestHelpers.testBoth('computed.lte', function (get, set) { + var obj = { number: 0 }; + _emberMetal.defineProperty(obj, 'isLesserOrEqualThenOne', _emberRuntimeComputedComputed_macros.lte('number', 1)); + + equal(get(obj, 'isLesserOrEqualThenOne'), true, 'is lte'); + + set(obj, 'number', 1); + + equal(get(obj, 'isLesserOrEqualThenOne'), true, 'is lte'); + + set(obj, 'number', 2); + + equal(get(obj, 'isLesserOrEqualThenOne'), false, 'is not lte'); + }); + + _internalTestHelpers.testBoth('computed.and two properties', function (get, set) { + var obj = { one: true, two: true }; + _emberMetal.defineProperty(obj, 'oneAndTwo', _emberRuntimeComputedComputed_macros.and('one', 'two')); + + equal(get(obj, 'oneAndTwo'), true, 'one and two'); + + set(obj, 'one', false); + + equal(get(obj, 'oneAndTwo'), false, 'one and not two'); + + set(obj, 'one', null); + set(obj, 'two', 'Yes'); + + equal(get(obj, 'oneAndTwo'), null, 'returns falsy value as in &&'); + + set(obj, 'one', true); + set(obj, 'two', 2); + + equal(get(obj, 'oneAndTwo'), 2, 'returns truthy value as in &&'); + }); + + _internalTestHelpers.testBoth('computed.and three properties', function (get, set) { + var obj = { one: true, two: true, three: true }; + _emberMetal.defineProperty(obj, 'oneTwoThree', _emberRuntimeComputedComputed_macros.and('one', 'two', 'three')); + + equal(get(obj, 'oneTwoThree'), true, 'one and two and three'); + + set(obj, 'one', false); + + equal(get(obj, 'oneTwoThree'), false, 'one and not two and not three'); + + set(obj, 'one', true); + set(obj, 'two', 2); + set(obj, 'three', 3); + + equal(get(obj, 'oneTwoThree'), 3, 'returns truthy value as in &&'); + }); + + _internalTestHelpers.testBoth('computed.and expand properties', function (get, set) { + var obj = { one: true, two: true, three: true }; + _emberMetal.defineProperty(obj, 'oneTwoThree', _emberRuntimeComputedComputed_macros.and('{one,two,three}')); + + equal(get(obj, 'oneTwoThree'), true, 'one and two and three'); + + set(obj, 'one', false); + + equal(get(obj, 'oneTwoThree'), false, 'one and not two and not three'); + + set(obj, 'one', true); + set(obj, 'two', 2); + set(obj, 'three', 3); + + equal(get(obj, 'oneTwoThree'), 3, 'returns truthy value as in &&'); + }); + + _internalTestHelpers.testBoth('computed.or two properties', function (get, set) { + var obj = { one: true, two: true }; + _emberMetal.defineProperty(obj, 'oneOrTwo', _emberRuntimeComputedComputed_macros.or('one', 'two')); + + equal(get(obj, 'oneOrTwo'), true, 'one or two'); + + set(obj, 'one', false); + + equal(get(obj, 'oneOrTwo'), true, 'one or two'); + + set(obj, 'two', false); + + equal(get(obj, 'oneOrTwo'), false, 'nor one nor two'); + + set(obj, 'two', null); + + equal(get(obj, 'oneOrTwo'), null, 'returns last falsy value as in ||'); + + set(obj, 'two', true); + + equal(get(obj, 'oneOrTwo'), true, 'one or two'); + + set(obj, 'one', 1); + + equal(get(obj, 'oneOrTwo'), 1, 'returns truthy value as in ||'); + }); + + _internalTestHelpers.testBoth('computed.or three properties', function (get, set) { + var obj = { one: true, two: true, three: true }; + _emberMetal.defineProperty(obj, 'oneTwoThree', _emberRuntimeComputedComputed_macros.or('one', 'two', 'three')); + + equal(get(obj, 'oneTwoThree'), true, 'one or two or three'); + + set(obj, 'one', false); + + equal(get(obj, 'oneTwoThree'), true, 'one or two or three'); + + set(obj, 'two', false); + + equal(get(obj, 'oneTwoThree'), true, 'one or two or three'); + + set(obj, 'three', false); + + equal(get(obj, 'oneTwoThree'), false, 'one or two or three'); + + set(obj, 'three', null); + + equal(get(obj, 'oneTwoThree'), null, 'returns last falsy value as in ||'); + + set(obj, 'two', true); + + equal(get(obj, 'oneTwoThree'), true, 'one or two or three'); + + set(obj, 'one', 1); + + equal(get(obj, 'oneTwoThree'), 1, 'returns truthy value as in ||'); + }); + + _internalTestHelpers.testBoth('computed.or expand properties', function (get, set) { + var obj = { one: true, two: true, three: true }; + _emberMetal.defineProperty(obj, 'oneTwoThree', _emberRuntimeComputedComputed_macros.or('{one,two,three}')); + + equal(get(obj, 'oneTwoThree'), true, 'one or two or three'); + + set(obj, 'one', false); + + equal(get(obj, 'oneTwoThree'), true, 'one or two or three'); + + set(obj, 'two', false); + + equal(get(obj, 'oneTwoThree'), true, 'one or two or three'); + + set(obj, 'three', false); + + equal(get(obj, 'oneTwoThree'), false, 'one or two or three'); + + set(obj, 'three', null); + + equal(get(obj, 'oneTwoThree'), null, 'returns last falsy value as in ||'); + + set(obj, 'two', true); + + equal(get(obj, 'oneTwoThree'), true, 'one or two or three'); + + set(obj, 'one', 1); + + equal(get(obj, 'oneTwoThree'), 1, 'returns truthy value as in ||'); + }); + + _internalTestHelpers.testBoth('computed.or and computed.and warn about dependent keys with spaces', function (get, set) { + var obj = { one: true, two: true }; + expectAssertion(function () { + _emberMetal.defineProperty(obj, 'oneOrTwo', _emberRuntimeComputedComputed_macros.or('one', 'two three')); + }, /Dependent keys passed to Ember\.computed\.or\(\) can't have spaces\./); + + expectAssertion(function () { + _emberMetal.defineProperty(obj, 'oneAndTwo', _emberRuntimeComputedComputed_macros.and('one', 'two three')); + }, /Dependent keys passed to Ember\.computed\.and\(\) can't have spaces\./); + }); + + _internalTestHelpers.testBoth('computed.oneWay', function (get, set) { + var obj = { + firstName: 'Teddy', + lastName: 'Zeenny' + }; + + _emberMetal.defineProperty(obj, 'nickName', _emberRuntimeComputedComputed_macros.oneWay('firstName')); + + equal(get(obj, 'firstName'), 'Teddy'); + equal(get(obj, 'lastName'), 'Zeenny'); + equal(get(obj, 'nickName'), 'Teddy'); + + set(obj, 'nickName', 'TeddyBear'); + + equal(get(obj, 'firstName'), 'Teddy'); + equal(get(obj, 'lastName'), 'Zeenny'); + + equal(get(obj, 'nickName'), 'TeddyBear'); + + set(obj, 'firstName', 'TEDDDDDDDDYYY'); + + equal(get(obj, 'nickName'), 'TeddyBear'); + }); + + _internalTestHelpers.testBoth('computed.readOnly', function (get, set) { + var obj = { + firstName: 'Teddy', + lastName: 'Zeenny' + }; + + _emberMetal.defineProperty(obj, 'nickName', _emberRuntimeComputedComputed_macros.readOnly('firstName')); + + equal(get(obj, 'firstName'), 'Teddy'); + equal(get(obj, 'lastName'), 'Zeenny'); + equal(get(obj, 'nickName'), 'Teddy'); + + throws(function () { + set(obj, 'nickName', 'TeddyBear'); + }, / /); + + equal(get(obj, 'firstName'), 'Teddy'); + equal(get(obj, 'lastName'), 'Zeenny'); + + equal(get(obj, 'nickName'), 'Teddy'); + + set(obj, 'firstName', 'TEDDDDDDDDYYY'); + + equal(get(obj, 'nickName'), 'TEDDDDDDDDYYY'); + }); + + _internalTestHelpers.testBoth('computed.deprecatingAlias', function (get, set) { + var obj = { bar: 'asdf', baz: null, quz: false }; + _emberMetal.defineProperty(obj, 'bay', _emberMetal.computed(function (key) { + return 'apple'; + })); + + _emberMetal.defineProperty(obj, 'barAlias', _emberRuntimeComputedComputed_macros.deprecatingAlias('bar')); + _emberMetal.defineProperty(obj, 'bazAlias', _emberRuntimeComputedComputed_macros.deprecatingAlias('baz')); + _emberMetal.defineProperty(obj, 'quzAlias', _emberRuntimeComputedComputed_macros.deprecatingAlias('quz')); + _emberMetal.defineProperty(obj, 'bayAlias', _emberRuntimeComputedComputed_macros.deprecatingAlias('bay')); + + expectDeprecation(function () { + equal(get(obj, 'barAlias'), 'asdf'); + }, 'Usage of `barAlias` is deprecated, use `bar` instead.'); + + expectDeprecation(function () { + equal(get(obj, 'bazAlias'), null); + }, 'Usage of `bazAlias` is deprecated, use `baz` instead.'); + + expectDeprecation(function () { + equal(get(obj, 'quzAlias'), false); + }, 'Usage of `quzAlias` is deprecated, use `quz` instead.'); + + expectDeprecation(function () { + equal(get(obj, 'bayAlias'), 'apple'); + }, 'Usage of `bayAlias` is deprecated, use `bay` instead.'); + + expectDeprecation(function () { + set(obj, 'barAlias', 'newBar'); + }, 'Usage of `barAlias` is deprecated, use `bar` instead.'); + + expectDeprecation(function () { + set(obj, 'bazAlias', 'newBaz'); + }, 'Usage of `bazAlias` is deprecated, use `baz` instead.'); + + expectDeprecation(function () { + set(obj, 'quzAlias', null); + }, 'Usage of `quzAlias` is deprecated, use `quz` instead.'); + + equal(get(obj, 'barAlias'), 'newBar'); + equal(get(obj, 'bazAlias'), 'newBaz'); + equal(get(obj, 'quzAlias'), null); + + equal(get(obj, 'bar'), 'newBar'); + equal(get(obj, 'baz'), 'newBaz'); + equal(get(obj, 'quz'), null); + }); +}); +enifed('ember-runtime/tests/computed/computed_macros_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/computed'); + test('ember-runtime/tests/computed/computed_macros_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/computed/computed_macros_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/computed/computed_macros_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/computed'); + QUnit.test('ember-runtime/tests/computed/computed_macros_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/computed/computed_macros_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/computed/reduce_computed_macros_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object', 'ember-runtime/system/object_proxy', 'ember-runtime/computed/reduce_computed_macros', 'ember-runtime/utils', 'ember-runtime/system/native_array', 'ember-runtime/mixins/mutable_array'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject, _emberRuntimeSystemObject_proxy, _emberRuntimeComputedReduce_computed_macros, _emberRuntimeUtils, _emberRuntimeSystemNative_array, _emberRuntimeMixinsMutable_array) { + 'use strict'; + + var obj = undefined; + QUnit.module('map', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + mapped: _emberRuntimeComputedReduce_computed_macros.map('array.@each.v', function (item) { + return item.v; + }), + mappedObjects: _emberRuntimeComputedReduce_computed_macros.map('arrayObjects.@each.v', function (item) { + return { name: item.v.name }; + }) + }).create({ + arrayObjects: _emberRuntimeSystemNative_array.A([{ v: { name: 'Robert' } }, { v: { name: 'Leanna' } }]), + + array: _emberRuntimeSystemNative_array.A([{ v: 1 }, { v: 3 }, { v: 2 }, { v: 1 }]) + }); + }, + + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('map is readOnly', function () { + QUnit.throws(function () { + obj.set('mapped', 1); + }, /Cannot set read-only property "mapped" on object:/); + }); + + QUnit.test('it maps simple properties', function () { + deepEqual(obj.get('mapped'), [1, 3, 2, 1]); + + obj.get('array').pushObject({ v: 5 }); + + deepEqual(obj.get('mapped'), [1, 3, 2, 1, 5]); + + _emberRuntimeMixinsMutable_array.removeAt(obj.get('array'), 3); + + deepEqual(obj.get('mapped'), [1, 3, 2, 5]); + }); + + QUnit.test('it maps simple unshifted properties', function () { + var array = _emberRuntimeSystemNative_array.A(); + + obj = _emberRuntimeSystemObject.default.extend({ + mapped: _emberRuntimeComputedReduce_computed_macros.map('array', function (item) { + return item.toUpperCase(); + }) + }).create({ + array: array + }); + + array.unshiftObject('c'); + array.unshiftObject('b'); + array.unshiftObject('a'); + + array.popObject(); + + deepEqual(obj.get('mapped'), ['A', 'B'], 'properties unshifted in sequence are mapped correctly'); + }); + + QUnit.test('it has the correct `this`', function () { + obj = _emberRuntimeSystemObject.default.extend({ + mapped: _emberRuntimeComputedReduce_computed_macros.map('array', function (item) { + equal(this, obj, 'should have correct context'); + return this.upperCase(item); + }), + upperCase: function (string) { + return string.toUpperCase(); + } + }).create({ + array: ['a', 'b', 'c'] + }); + + deepEqual(obj.get('mapped'), ['A', 'B', 'C'], 'properties unshifted in sequence are mapped correctly'); + }); + + QUnit.test('it passes the index to the callback', function () { + var array = ['a', 'b', 'c']; + + obj = _emberRuntimeSystemObject.default.extend({ + mapped: _emberRuntimeComputedReduce_computed_macros.map('array', function (item, index) { + return index; + }) + }).create({ + array: array + }); + + deepEqual(obj.get('mapped'), [0, 1, 2], 'index is passed to callback correctly'); + }); + + QUnit.test('it maps objects', function () { + deepEqual(obj.get('mappedObjects'), [{ name: 'Robert' }, { name: 'Leanna' }]); + + obj.get('arrayObjects').pushObject({ + v: { name: 'Eddard' } + }); + + deepEqual(obj.get('mappedObjects'), [{ name: 'Robert' }, { name: 'Leanna' }, { name: 'Eddard' }]); + + _emberRuntimeMixinsMutable_array.removeAt(obj.get('arrayObjects'), 1); + + deepEqual(obj.get('mappedObjects'), [{ name: 'Robert' }, { name: 'Eddard' }]); + + _emberMetal.set(obj.get('arrayObjects')[0], 'v', { name: 'Stannis' }); + + deepEqual(obj.get('mappedObjects'), [{ name: 'Stannis' }, { name: 'Eddard' }]); + }); + + QUnit.test('it maps unshifted objects with property observers', function () { + var array = _emberRuntimeSystemNative_array.A(); + var cObj = { v: 'c' }; + + obj = _emberRuntimeSystemObject.default.extend({ + mapped: _emberRuntimeComputedReduce_computed_macros.map('array.@each.v', function (item) { + return _emberMetal.get(item, 'v').toUpperCase(); + }) + }).create({ + array: array + }); + + array.unshiftObject(cObj); + array.unshiftObject({ v: 'b' }); + array.unshiftObject({ v: 'a' }); + + _emberMetal.set(cObj, 'v', 'd'); + + deepEqual(array.mapBy('v'), ['a', 'b', 'd'], 'precond - unmapped array is correct'); + deepEqual(obj.get('mapped'), ['A', 'B', 'D'], 'properties unshifted in sequence are mapped correctly'); + }); + + QUnit.module('mapBy', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + mapped: _emberRuntimeComputedReduce_computed_macros.mapBy('array', 'v') + }).create({ + array: _emberRuntimeSystemNative_array.A([{ v: 1 }, { v: 3 }, { v: 2 }, { v: 1 }]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('mapBy is readOnly', function () { + QUnit.throws(function () { + obj.set('mapped', 1); + }, /Cannot set read-only property "mapped" on object:/); + }); + + QUnit.test('it maps properties', function () { + deepEqual(obj.get('mapped'), [1, 3, 2, 1]); + + obj.get('array').pushObject({ v: 5 }); + + deepEqual(obj.get('mapped'), [1, 3, 2, 1, 5]); + + _emberRuntimeMixinsMutable_array.removeAt(obj.get('array'), 3); + + deepEqual(obj.get('mapped'), [1, 3, 2, 5]); + }); + + QUnit.test('it is observable', function () { + var calls = 0; + + deepEqual(obj.get('mapped'), [1, 3, 2, 1]); + + _emberMetal.addObserver(obj, 'mapped.@each', function () { + return calls++; + }); + + obj.get('array').pushObject({ v: 5 }); + + equal(calls, 1, 'mapBy is observable'); + }); + + QUnit.module('filter', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + filtered: _emberRuntimeComputedReduce_computed_macros.filter('array', function (item) { + return item % 2 === 0; + }) + }).create({ + array: _emberRuntimeSystemNative_array.A([1, 2, 3, 4, 5, 6, 7, 8]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('filter is readOnly', function () { + QUnit.throws(function () { + obj.set('filtered', 1); + }, /Cannot set read-only property "filtered" on object:/); + }); + + QUnit.test('it filters according to the specified filter function', function () { + deepEqual(obj.get('filtered'), [2, 4, 6, 8], 'filter filters by the specified function'); + }); + + QUnit.test('it passes the index to the callback', function () { + obj = _emberRuntimeSystemObject.default.extend({ + filtered: _emberRuntimeComputedReduce_computed_macros.filter('array', function (item, index) { + return index === 1; + }) + }).create({ + array: ['a', 'b', 'c'] + }); + + deepEqual(_emberMetal.get(obj, 'filtered'), ['b'], 'index is passed to callback correctly'); + }); + + QUnit.test('it has the correct `this`', function () { + obj = _emberRuntimeSystemObject.default.extend({ + filtered: _emberRuntimeComputedReduce_computed_macros.filter('array', function (item, index) { + equal(this, obj); + return this.isOne(index); + }), + isOne: function (value) { + return value === 1; + } + }).create({ + array: ['a', 'b', 'c'] + }); + + deepEqual(_emberMetal.get(obj, 'filtered'), ['b'], 'index is passed to callback correctly'); + }); + + QUnit.test('it passes the array to the callback', function () { + obj = _emberRuntimeSystemObject.default.extend({ + filtered: _emberRuntimeComputedReduce_computed_macros.filter('array', function (item, index, array) { + return index === _emberMetal.get(array, 'length') - 2; + }) + }).create({ + array: _emberRuntimeSystemNative_array.A(['a', 'b', 'c']) + }); + + deepEqual(obj.get('filtered'), ['b'], 'array is passed to callback correctly'); + }); + + QUnit.test('it caches properly', function () { + var array = obj.get('array'); + + var filtered = obj.get('filtered'); + ok(filtered === obj.get('filtered')); + + array.addObject(11); + var newFiltered = obj.get('filtered'); + + ok(filtered !== newFiltered); + + ok(obj.get('filtered') === newFiltered); + }); + + QUnit.test('it updates as the array is modified', function () { + var array = obj.get('array'); + + deepEqual(obj.get('filtered'), [2, 4, 6, 8], 'precond - filtered array is initially correct'); + + array.addObject(11); + deepEqual(obj.get('filtered'), [2, 4, 6, 8], 'objects not passing the filter are not added'); + + array.addObject(12); + deepEqual(obj.get('filtered'), [2, 4, 6, 8, 12], 'objects passing the filter are added'); + + array.removeObject(3); + array.removeObject(4); + + deepEqual(obj.get('filtered'), [2, 6, 8, 12], 'objects removed from the dependent array are removed from the computed array'); + }); + + QUnit.test('the dependent array can be cleared one at a time', function () { + var array = _emberMetal.get(obj, 'array'); + + deepEqual(obj.get('filtered'), [2, 4, 6, 8], 'precond - filtered array is initially correct'); + + // clear 1-8 but in a random order + array.removeObject(3); + array.removeObject(1); + array.removeObject(2); + array.removeObject(4); + array.removeObject(8); + array.removeObject(6); + array.removeObject(5); + array.removeObject(7); + + deepEqual(obj.get('filtered'), [], 'filtered array cleared correctly'); + }); + + QUnit.test('the dependent array can be `clear`ed directly (#3272)', function () { + deepEqual(obj.get('filtered'), [2, 4, 6, 8], 'precond - filtered array is initially correct'); + + obj.get('array').clear(); + + deepEqual(obj.get('filtered'), [], 'filtered array cleared correctly'); + }); + + QUnit.test('it updates as the array is replaced', function () { + deepEqual(obj.get('filtered'), [2, 4, 6, 8], 'precond - filtered array is initially correct'); + + obj.set('array', [20, 21, 22, 23, 24]); + + deepEqual(obj.get('filtered'), [20, 22, 24], 'computed array is updated when array is changed'); + }); + + QUnit.module('filterBy', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + a1s: _emberRuntimeComputedReduce_computed_macros.filterBy('array', 'a', 1), + as: _emberRuntimeComputedReduce_computed_macros.filterBy('array', 'a'), + bs: _emberRuntimeComputedReduce_computed_macros.filterBy('array', 'b') + }).create({ + array: _emberRuntimeSystemNative_array.A([{ name: 'one', a: 1, b: false }, { name: 'two', a: 2, b: false }, { name: 'three', a: 1, b: true }, { name: 'four', b: true }]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('filterBy is readOnly', function () { + QUnit.throws(function () { + obj.set('as', 1); + }, /Cannot set read-only property "as" on object:/); + }); + + QUnit.test('properties can be filtered by truthiness', function () { + deepEqual(obj.get('as').mapBy('name'), ['one', 'two', 'three'], 'properties can be filtered by existence'); + deepEqual(obj.get('bs').mapBy('name'), ['three', 'four'], 'booleans can be filtered'); + + _emberMetal.set(obj.get('array')[0], 'a', undefined); + _emberMetal.set(obj.get('array')[3], 'a', true); + + _emberMetal.set(obj.get('array')[0], 'b', true); + _emberMetal.set(obj.get('array')[3], 'b', false); + + deepEqual(obj.get('as').mapBy('name'), ['two', 'three', 'four'], 'arrays computed by filter property respond to property changes'); + deepEqual(obj.get('bs').mapBy('name'), ['one', 'three'], 'arrays computed by filtered property respond to property changes'); + + obj.get('array').pushObject({ name: 'five', a: 6, b: true }); + + deepEqual(obj.get('as').mapBy('name'), ['two', 'three', 'four', 'five'], 'arrays computed by filter property respond to added objects'); + deepEqual(obj.get('bs').mapBy('name'), ['one', 'three', 'five'], 'arrays computed by filtered property respond to added objects'); + + obj.get('array').popObject(); + + deepEqual(obj.get('as').mapBy('name'), ['two', 'three', 'four'], 'arrays computed by filter property respond to removed objects'); + deepEqual(obj.get('bs').mapBy('name'), ['one', 'three'], 'arrays computed by filtered property respond to removed objects'); + + obj.set('array', [{ name: 'six', a: 12, b: true }]); + + deepEqual(obj.get('as').mapBy('name'), ['six'], 'arrays computed by filter property respond to array changes'); + deepEqual(obj.get('bs').mapBy('name'), ['six'], 'arrays computed by filtered property respond to array changes'); + }); + + QUnit.test('properties can be filtered by values', function () { + deepEqual(obj.get('a1s').mapBy('name'), ['one', 'three'], 'properties can be filtered by matching value'); + + obj.get('array').pushObject({ name: 'five', a: 1 }); + + deepEqual(obj.get('a1s').mapBy('name'), ['one', 'three', 'five'], 'arrays computed by matching value respond to added objects'); + + obj.get('array').popObject(); + + deepEqual(obj.get('a1s').mapBy('name'), ['one', 'three'], 'arrays computed by matching value respond to removed objects'); + + _emberMetal.set(obj.get('array')[1], 'a', 1); + _emberMetal.set(obj.get('array')[2], 'a', 2); + + deepEqual(obj.get('a1s').mapBy('name'), ['one', 'two'], 'arrays computed by matching value respond to modified properties'); + }); + + QUnit.test('properties values can be replaced', function () { + obj = _emberRuntimeSystemObject.default.extend({ + a1s: _emberRuntimeComputedReduce_computed_macros.filterBy('array', 'a', 1), + a1bs: _emberRuntimeComputedReduce_computed_macros.filterBy('a1s', 'b') + }).create({ + array: [] + }); + + deepEqual(obj.get('a1bs').mapBy('name'), [], 'properties can be filtered by matching value'); + + _emberMetal.set(obj, 'array', [{ name: 'item1', a: 1, b: true }]); + + deepEqual(obj.get('a1bs').mapBy('name'), ['item1'], 'properties can be filtered by matching value'); + }); + + [['uniq', _emberRuntimeComputedReduce_computed_macros.uniq], ['union', _emberRuntimeComputedReduce_computed_macros.union]].forEach(function (tuple) { + var name = tuple[0]; + var macro = tuple[1]; + + QUnit.module('computed.' + name, { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + union: macro('array', 'array2', 'array3') + }).create({ + array: _emberRuntimeSystemNative_array.A([1, 2, 3, 4, 5, 6]), + array2: _emberRuntimeSystemNative_array.A([4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9]), + array3: _emberRuntimeSystemNative_array.A([1, 8, 10]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test(name + ' is readOnly', function () { + QUnit.throws(function () { + obj.set('union', 1); + }, /Cannot set read-only property "union" on object:/); + }); + + QUnit.test('does not include duplicates', function () { + var array = obj.get('array'); + var array2 = obj.get('array2'); + + deepEqual(obj.get('union').sort(function (x, y) { + return x - y; + }), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], name + ' does not include duplicates'); + + array.pushObject(8); + + deepEqual(obj.get('union').sort(function (x, y) { + return x - y; + }), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], name + ' does not add existing items'); + + array.pushObject(11); + + deepEqual(obj.get('union').sort(function (x, y) { + return x - y; + }), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], name + ' adds new items'); + + _emberRuntimeMixinsMutable_array.removeAt(array2, 6); // remove 7 + + deepEqual(obj.get('union').sort(function (x, y) { + return x - y; + }), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], name + ' does not remove items that are still in the dependent array'); + + array2.removeObject(7); + + deepEqual(obj.get('union').sort(function (x, y) { + return x - y; + }), [1, 2, 3, 4, 5, 6, 8, 9, 10, 11], name + ' removes items when their last instance is gone'); + }); + + QUnit.test('has set-union semantics', function () { + var array = obj.get('array'); + + deepEqual(obj.get('union').sort(function (x, y) { + return x - y; + }), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], name + ' is initially correct'); + + array.removeObject(6); + + deepEqual(obj.get('union').sort(function (x, y) { + return x - y; + }), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 'objects are not removed if they exist in other dependent arrays'); + + array.clear(); + + deepEqual(obj.get('union').sort(function (x, y) { + return x - y; + }), [1, 4, 5, 6, 7, 8, 9, 10], 'objects are removed when they are no longer in any dependent array'); + }); + }); + + if (true) { + QUnit.module('computed.uniqBy', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + list: null, + uniqueById: _emberRuntimeComputedReduce_computed_macros.uniqBy('list', 'id') + }).create({ + list: _emberRuntimeSystemNative_array.A([{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 1, value: 'one' }]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('uniqBy is readOnly', function () { + QUnit.throws(function () { + obj.set('uniqueById', 1); + }, /Cannot set read-only property "uniqueById" on object:/); + }); + QUnit.test('does not include duplicates', function () { + deepEqual(obj.get('uniqueById'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }]); + }); + + QUnit.test('it does not share state among instances', function () { + var MyObject = _emberRuntimeSystemObject.default.extend({ + list: [], + uniqueByName: _emberRuntimeComputedReduce_computed_macros.uniqBy('list', 'name') + }); + var a = MyObject.create({ list: [{ name: 'bob' }, { name: 'mitch' }, { name: 'mitch' }] }); + var b = MyObject.create({ list: [{ name: 'warren' }, { name: 'mitch' }] }); + + deepEqual(a.get('uniqueByName'), [{ name: 'bob' }, { name: 'mitch' }]); + // Making sure that 'mitch' appears + deepEqual(b.get('uniqueByName'), [{ name: 'warren' }, { name: 'mitch' }]); + }); + + QUnit.test('it handles changes to the dependent array', function () { + obj.get('list').pushObject({ id: 3, value: 'three' }); + + deepEqual(obj.get('uniqueById'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 3, value: 'three' }], 'The list includes three'); + + obj.get('list').pushObject({ id: 3, value: 'three' }); + + deepEqual(obj.get('uniqueById'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 3, value: 'three' }], 'The list does not include a duplicate three'); + }); + + QUnit.test('it returns an empty array when computed on a non-array', function () { + var MyObject = _emberRuntimeSystemObject.default.extend({ + list: null, + uniq: _emberRuntimeComputedReduce_computed_macros.uniqBy('list', 'name') + }); + var a = MyObject.create({ list: 'not an array' }); + + deepEqual(a.get('uniq'), []); + }); + } + + QUnit.module('computed.intersect', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + intersection: _emberRuntimeComputedReduce_computed_macros.intersect('array', 'array2', 'array3') + }).create({ + array: _emberRuntimeSystemNative_array.A([1, 2, 3, 4, 5, 6]), + array2: _emberRuntimeSystemNative_array.A([3, 3, 3, 4, 5]), + array3: _emberRuntimeSystemNative_array.A([3, 5, 6, 7, 8]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('intersect is readOnly', function () { + QUnit.throws(function () { + obj.set('intersection', 1); + }, /Cannot set read-only property "intersection" on object:/); + }); + + QUnit.test('it has set-intersection semantics', function () { + var array2 = obj.get('array2'); + var array3 = obj.get('array3'); + + deepEqual(obj.get('intersection').sort(function (x, y) { + return x - y; + }), [3, 5], 'intersection is initially correct'); + + array2.shiftObject(); + + deepEqual(obj.get('intersection').sort(function (x, y) { + return x - y; + }), [3, 5], 'objects are not removed when they are still in all dependent arrays'); + + array2.shiftObject(); + + deepEqual(obj.get('intersection').sort(function (x, y) { + return x - y; + }), [3, 5], 'objects are not removed when they are still in all dependent arrays'); + + array2.shiftObject(); + + deepEqual(obj.get('intersection'), [5], 'objects are removed once they are gone from all dependent arrays'); + + array2.pushObject(1); + + deepEqual(obj.get('intersection'), [5], 'objects are not added as long as they are missing from any dependent array'); + + array3.pushObject(1); + + deepEqual(obj.get('intersection').sort(function (x, y) { + return x - y; + }), [1, 5], 'objects added once they belong to all dependent arrays'); + }); + + QUnit.module('setDiff', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + diff: _emberRuntimeComputedReduce_computed_macros.setDiff('array', 'array2') + }).create({ + array: _emberRuntimeSystemNative_array.A([1, 2, 3, 4, 5, 6, 7]), + array2: _emberRuntimeSystemNative_array.A([3, 4, 5, 10]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('setDiff is readOnly', function () { + QUnit.throws(function () { + obj.set('diff', 1); + }, /Cannot set read-only property "diff" on object:/); + }); + + QUnit.test('it throws an error if given fewer or more than two dependent properties', function () { + throws(function () { + _emberRuntimeSystemObject.default.extend({ + diff: _emberRuntimeComputedReduce_computed_macros.setDiff('array') + }).create({ + array: _emberRuntimeSystemNative_array.A([1, 2, 3, 4, 5, 6, 7]), + array2: _emberRuntimeSystemNative_array.A([3, 4, 5]) + }); + }, /requires exactly two dependent arrays/, 'setDiff requires two dependent arrays'); + + throws(function () { + _emberRuntimeSystemObject.default.extend({ + diff: _emberRuntimeComputedReduce_computed_macros.setDiff('array', 'array2', 'array3') + }).create({ + array: _emberRuntimeSystemNative_array.A([1, 2, 3, 4, 5, 6, 7]), + array2: _emberRuntimeSystemNative_array.A([3, 4, 5]), + array3: _emberRuntimeSystemNative_array.A([7]) + }); + }, /requires exactly two dependent arrays/, 'setDiff requires two dependent arrays'); + }); + + QUnit.test('it has set-diff semantics', function () { + var array1 = obj.get('array'); + var array2 = obj.get('array2'); + + deepEqual(obj.get('diff').sort(function (x, y) { + return x - y; + }), [1, 2, 6, 7], 'set-diff is initially correct'); + + array2.popObject(); + + deepEqual(obj.get('diff').sort(function (x, y) { + return x - y; + }), [1, 2, 6, 7], 'removing objects from the remove set has no effect if the object is not in the keep set'); + + array2.shiftObject(); + + deepEqual(obj.get('diff').sort(function (x, y) { + return x - y; + }), [1, 2, 3, 6, 7], 'removing objects from the remove set adds them if they\'re in the keep set'); + + array1.removeObject(3); + + deepEqual(obj.get('diff').sort(function (x, y) { + return x - y; + }), [1, 2, 6, 7], 'removing objects from the keep array removes them from the computed array'); + + array1.pushObject(5); + + deepEqual(obj.get('diff').sort(function (x, y) { + return x - y; + }), [1, 2, 6, 7], 'objects added to the keep array that are in the remove array are not added to the computed array'); + + array1.pushObject(22); + + deepEqual(obj.get('diff').sort(function (x, y) { + return x - y; + }), [1, 2, 6, 7, 22], 'objects added to the keep array not in the remove array are added to the computed array'); + }); + + function commonSortTests() { + QUnit.test('arrays are initially sorted', function () { + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'array is initially sorted'); + }); + + QUnit.test('default sort order is correct', function () { + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'array is initially sorted'); + }); + + QUnit.test('changing the dependent array updates the sorted array', function () { + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + obj.set('items', [{ fname: 'Roose', lname: 'Bolton' }, { fname: 'Theon', lname: 'Greyjoy' }, { fname: 'Ramsey', lname: 'Bolton' }, { fname: 'Stannis', lname: 'Baratheon' }]); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Stannis', 'Ramsey', 'Roose', 'Theon'], 'changing dependent array updates sorted array'); + }); + + QUnit.test('adding to the dependent array updates the sorted array', function () { + var items = obj.get('items'); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + items.pushObject({ + fname: 'Tyrion', + lname: 'Lannister' + }); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Tyrion', 'Bran', 'Robb'], 'Adding to the dependent array updates the sorted array'); + }); + + QUnit.test('removing from the dependent array updates the sorted array', function () { + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + obj.get('items').popObject(); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Robb'], 'Removing from the dependent array updates the sorted array'); + }); + + QUnit.test('distinct items may be sort-equal, although their relative order will not be guaranteed', function () { + // We recreate jaime and "Cersei" here only for test stability: we want + // their guid-ordering to be deterministic + var jaimeInDisguise = { + fname: 'Cersei', + lname: 'Lannister', + age: 34 + }; + + var jaime = { + fname: 'Jaime', + lname: 'Lannister', + age: 34 + }; + + var items = obj.get('items'); + + items.replace(0, 1, jaime); + items.replace(1, 1, jaimeInDisguise); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + _emberMetal.set(jaimeInDisguise, 'fname', 'Jaime'); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Jaime', 'Jaime', 'Bran', 'Robb'], 'sorted array is updated'); + + _emberMetal.set(jaimeInDisguise, 'fname', 'Cersei'); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'sorted array is updated'); + }); + + QUnit.test('guid sort-order fallback with a search proxy is not confused by non-search ObjectProxys', function () { + var tyrion = { + fname: 'Tyrion', + lname: 'Lannister' + }; + + var tyrionInDisguise = _emberRuntimeSystemObject_proxy.default.create({ + fname: 'Yollo', + lname: '', + content: tyrion + }); + + var items = obj.get('items'); + + items.pushObject(tyrion); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Tyrion', 'Bran', 'Robb']); + + items.pushObject(tyrionInDisguise); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Yollo', 'Cersei', 'Jaime', 'Tyrion', 'Bran', 'Robb']); + }); + } + + QUnit.module('sort - sortProperties', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + sortedItems: _emberRuntimeComputedReduce_computed_macros.sort('items', 'itemSorting') + }).create({ + itemSorting: _emberRuntimeSystemNative_array.A(['lname', 'fname']), + items: _emberRuntimeSystemNative_array.A([{ fname: 'Jaime', lname: 'Lannister', age: 34 }, { fname: 'Cersei', lname: 'Lannister', age: 34 }, { fname: 'Robb', lname: 'Stark', age: 16 }, { fname: 'Bran', lname: 'Stark', age: 8 }]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('sort is readOnly', function () { + QUnit.throws(function () { + obj.set('sortedItems', 1); + }, /Cannot set read-only property "sortedItems" on object:/); + }); + + commonSortTests(); + + QUnit.test('updating sort properties detaches observers for old sort properties', function () { + var objectToRemove = obj.get('items')[3]; + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + obj.set('itemSorting', _emberRuntimeSystemNative_array.A(['fname:desc'])); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Robb', 'Jaime', 'Cersei', 'Bran'], 'after updating sort properties array is updated'); + + obj.get('items').removeObject(objectToRemove); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Robb', 'Jaime', 'Cersei'], 'after removing item array is updated'); + + _emberMetal.set(objectToRemove, 'lname', 'Updated-Stark'); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Robb', 'Jaime', 'Cersei'], 'after changing removed item array is not updated'); + }); + + QUnit.test('updating sort properties updates the sorted array', function () { + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + obj.set('itemSorting', _emberRuntimeSystemNative_array.A(['fname:desc'])); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Robb', 'Jaime', 'Cersei', 'Bran'], 'after updating sort properties array is updated'); + }); + + QUnit.test('updating sort properties invalidates the sorted array', function () { + var sortProps = obj.get('itemSorting'); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + sortProps.clear(); + sortProps.pushObject('fname'); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Bran', 'Cersei', 'Jaime', 'Robb'], 'after updating sort properties array is updated'); + }); + + QUnit.test('updating new sort properties invalidates the sorted array', function () { + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + obj.set('itemSorting', _emberRuntimeSystemNative_array.A(['age:desc', 'fname:asc'])); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Robb', 'Bran'], 'precond - array is correct after item sorting is changed'); + + _emberMetal.set(obj.get('items')[1], 'age', 29); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Jaime', 'Cersei', 'Robb', 'Bran'], 'after updating sort properties array is updated'); + }); + + QUnit.test('sort direction defaults to ascending', function () { + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb']); + }); + + QUnit.test('sort direction defaults to ascending (with sort property change)', function () { + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + obj.set('itemSorting', _emberRuntimeSystemNative_array.A(['fname'])); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Bran', 'Cersei', 'Jaime', 'Robb'], 'sort direction defaults to ascending'); + }); + + QUnit.test('updating an item\'s sort properties updates the sorted array', function () { + var tyrionInDisguise = obj.get('items')[1]; + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + _emberMetal.set(tyrionInDisguise, 'fname', 'Tyrion'); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Jaime', 'Tyrion', 'Bran', 'Robb'], 'updating an item\'s sort properties updates the sorted array'); + }); + + QUnit.test('updating several of an item\'s sort properties updated the sorted array', function () { + var sansaInDisguise = obj.get('items')[1]; + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + _emberMetal.setProperties(sansaInDisguise, { + fname: 'Sansa', + lname: 'Stark' + }); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Jaime', 'Bran', 'Robb', 'Sansa'], 'updating an item\'s sort properties updates the sorted array'); + }); + + QUnit.test('updating an item\'s sort properties does not error when binary search does a self compare (#3273)', function () { + var jaime = { + name: 'Jaime', + status: 1 + }; + + var cersei = { + name: 'Cersei', + status: 2 + }; + + var obj = _emberRuntimeSystemObject.default.extend({ + sortProps: ['status'], + sortedPeople: _emberRuntimeComputedReduce_computed_macros.sort('people', 'sortProps') + }).create({ + people: [jaime, cersei] + }); + + deepEqual(obj.get('sortedPeople'), [jaime, cersei], 'precond - array is initially sorted'); + + _emberMetal.set(cersei, 'status', 3); + + deepEqual(obj.get('sortedPeople'), [jaime, cersei], 'array is sorted correctly'); + + _emberMetal.set(cersei, 'status', 2); + + deepEqual(obj.get('sortedPeople'), [jaime, cersei], 'array is sorted correctly'); + }); + + QUnit.test('array observers do not leak', function () { + var daria = { name: 'Daria' }; + var jane = { name: 'Jane' }; + + var sisters = [jane, daria]; + + var sortProps = _emberRuntimeSystemNative_array.A(['name']); + var jaime = _emberRuntimeSystemObject.default.extend({ + sortedPeople: _emberRuntimeComputedReduce_computed_macros.sort('sisters', 'sortProps'), + sortProps: sortProps + }).create({ + sisters: sisters + }); + + jaime.get('sortedPeople'); + _emberMetal.run(jaime, 'destroy'); + + try { + sortProps.pushObject({ + name: 'Anna' + }); + ok(true); + } catch (e) { + ok(false, e); + } + }); + + QUnit.test('property paths in sort properties update the sorted array', function () { + var jaime = { + relatedObj: { status: 1, firstName: 'Jaime', lastName: 'Lannister' } + }; + + var cersei = { + relatedObj: { status: 2, firstName: 'Cersei', lastName: 'Lannister' } + }; + + var sansa = _emberRuntimeSystemObject.default.create({ + relatedObj: { status: 3, firstName: 'Sansa', lastName: 'Stark' } + }); + + var obj = _emberRuntimeSystemObject.default.extend({ + sortProps: ['relatedObj.status'], + sortedPeople: _emberRuntimeComputedReduce_computed_macros.sort('people', 'sortProps') + }).create({ + people: [jaime, cersei, sansa] + }); + + deepEqual(obj.get('sortedPeople'), [jaime, cersei, sansa], 'precond - array is initially sorted'); + + _emberMetal.set(cersei, 'status', 3); + + deepEqual(obj.get('sortedPeople'), [jaime, cersei, sansa], 'array is sorted correctly'); + + _emberMetal.set(cersei, 'status', 1); + + deepEqual(obj.get('sortedPeople'), [jaime, cersei, sansa], 'array is sorted correctly'); + + sansa.set('status', 1); + + deepEqual(obj.get('sortedPeople'), [jaime, cersei, sansa], 'array is sorted correctly'); + + obj.set('sortProps', ['relatedObj.firstName']); + + deepEqual(obj.get('sortedPeople'), [cersei, jaime, sansa], 'array is sorted correctly'); + }); + + QUnit.test('if the dependentKey is neither an array nor object, it will return an empty array', function () { + _emberMetal.set(obj, 'items', null); + ok(_emberRuntimeUtils.isArray(obj.get('sortedItems')), 'returns an empty arrays'); + + _emberMetal.set(obj, 'array', undefined); + ok(_emberRuntimeUtils.isArray(obj.get('sortedItems')), 'returns an empty arrays'); + + _emberMetal.set(obj, 'array', 'not an array'); + ok(_emberRuntimeUtils.isArray(obj.get('sortedItems')), 'returns an empty arrays'); + }); + + function sortByLnameFname(a, b) { + var lna = _emberMetal.get(a, 'lname'); + var lnb = _emberMetal.get(b, 'lname'); + + if (lna !== lnb) { + return lna > lnb ? 1 : -1; + } + + return sortByFnameAsc(a, b); + } + + function sortByFnameAsc(a, b) { + var fna = _emberMetal.get(a, 'fname'); + var fnb = _emberMetal.get(b, 'fname'); + + if (fna === fnb) { + return 0; + } + return fna > fnb ? 1 : -1; + } + + QUnit.module('sort - sort function', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + sortedItems: _emberRuntimeComputedReduce_computed_macros.sort('items.@each.fname', sortByLnameFname) + }).create({ + items: _emberRuntimeSystemNative_array.A([{ fname: 'Jaime', lname: 'Lannister', age: 34 }, { fname: 'Cersei', lname: 'Lannister', age: 34 }, { fname: 'Robb', lname: 'Stark', age: 16 }, { fname: 'Bran', lname: 'Stark', age: 8 }]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('sort has correct `this`', function () { + var obj = _emberRuntimeSystemObject.default.extend({ + sortedItems: _emberRuntimeComputedReduce_computed_macros.sort('items.@each.fname', function (a, b) { + equal(this, obj, 'expected the object to be `this`'); + return this.sortByLastName(a, b); + }), + sortByLastName: function (a, b) { + return sortByFnameAsc(a, b); + } + }).create({ + items: _emberRuntimeSystemNative_array.A([{ fname: 'Jaime', lname: 'Lannister', age: 34 }, { fname: 'Cersei', lname: 'Lannister', age: 34 }, { fname: 'Robb', lname: 'Stark', age: 16 }, { fname: 'Bran', lname: 'Stark', age: 8 }]) + }); + + obj.get('sortedItems'); + }); + + QUnit.test('sort (with function) is readOnly', function () { + QUnit.throws(function () { + obj.set('sortedItems', 1); + }, /Cannot set read-only property "sortedItems" on object:/); + }); + + commonSortTests(); + + QUnit.test('changing item properties specified via @each triggers a resort of the modified item', function () { + var items = _emberMetal.get(obj, 'items'); + + var tyrionInDisguise = items[1]; + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + _emberMetal.set(tyrionInDisguise, 'fname', 'Tyrion'); + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Jaime', 'Tyrion', 'Bran', 'Robb'], 'updating a specified property on an item resorts it'); + }); + + QUnit.test('changing item properties not specified via @each does not trigger a resort', function () { + var items = obj.get('items'); + var cersei = items[1]; + + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'precond - array is initially sorted'); + + _emberMetal.set(cersei, 'lname', 'Stark'); // plot twist! (possibly not canon) + + // The array has become unsorted. If your sort function is sensitive to + // properties, they *must* be specified as dependent item property keys or + // we'll be doing binary searches on unsorted arrays. + deepEqual(obj.get('sortedItems').mapBy('fname'), ['Cersei', 'Jaime', 'Bran', 'Robb'], 'updating an unspecified property on an item does not resort it'); + }); + + QUnit.module('sort - stability', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + sortProps: ['count', 'name'], + sortedItems: _emberRuntimeComputedReduce_computed_macros.sort('items', 'sortProps') + }).create({ + items: [{ name: 'A', count: 1, thing: 4 }, { name: 'B', count: 1, thing: 3 }, { name: 'C', count: 1, thing: 2 }, { name: 'D', count: 1, thing: 4 }] + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('sorts correctly as only one property changes', function () { + deepEqual(obj.get('sortedItems').mapBy('name'), ['A', 'B', 'C', 'D'], 'initial'); + + _emberMetal.set(obj.get('items')[3], 'count', 2); + + deepEqual(obj.get('sortedItems').mapBy('name'), ['A', 'B', 'C', 'D'], 'final'); + }); + + var klass = undefined; + QUnit.module('sort - concurrency', { + setup: function () { + klass = _emberRuntimeSystemObject.default.extend({ + sortProps: ['count'], + sortedItems: _emberRuntimeComputedReduce_computed_macros.sort('items', 'sortProps'), + customSortedItems: _emberRuntimeComputedReduce_computed_macros.sort('items.@each.count', function (a, b) { + return a.count - b.count; + }) + }); + obj = klass.create({ + items: _emberRuntimeSystemNative_array.A([{ name: 'A', count: 1, thing: 4, id: 1 }, { name: 'B', count: 2, thing: 3, id: 2 }, { name: 'C', count: 3, thing: 2, id: 3 }, { name: 'D', count: 4, thing: 1, id: 4 }]) + }); + }, + + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('sorts correctly after mutation to the sort properties', function () { + var sorted = obj.get('sortedItems'); + deepEqual(sorted.mapBy('name'), ['A', 'B', 'C', 'D'], 'initial'); + + _emberMetal.set(obj.get('items')[1], 'count', 5); + _emberMetal.set(obj.get('items')[2], 'count', 6); + + deepEqual(obj.get('sortedItems').mapBy('name'), ['A', 'D', 'B', 'C'], 'final'); + }); + + QUnit.test('sort correctly after mutation to the sort', function () { + deepEqual(obj.get('customSortedItems').mapBy('name'), ['A', 'B', 'C', 'D'], 'initial'); + + _emberMetal.set(obj.get('items')[1], 'count', 5); + _emberMetal.set(obj.get('items')[2], 'count', 6); + + deepEqual(obj.get('customSortedItems').mapBy('name'), ['A', 'D', 'B', 'C'], 'final'); + + deepEqual(obj.get('sortedItems').mapBy('name'), ['A', 'D', 'B', 'C'], 'final'); + }); + + QUnit.test('sort correctly on multiple instances of the same class', function () { + var obj2 = klass.create({ + items: _emberRuntimeSystemNative_array.A([{ name: 'W', count: 23, thing: 4 }, { name: 'X', count: 24, thing: 3 }, { name: 'Y', count: 25, thing: 2 }, { name: 'Z', count: 26, thing: 1 }]) + }); + + deepEqual(obj2.get('sortedItems').mapBy('name'), ['W', 'X', 'Y', 'Z'], 'initial'); + deepEqual(obj.get('sortedItems').mapBy('name'), ['A', 'B', 'C', 'D'], 'initial'); + + _emberMetal.set(obj.get('items')[1], 'count', 5); + _emberMetal.set(obj.get('items')[2], 'count', 6); + _emberMetal.set(obj2.get('items')[1], 'count', 27); + _emberMetal.set(obj2.get('items')[2], 'count', 28); + + deepEqual(obj.get('sortedItems').mapBy('name'), ['A', 'D', 'B', 'C'], 'final'); + deepEqual(obj2.get('sortedItems').mapBy('name'), ['W', 'Z', 'X', 'Y'], 'final'); + + obj.set('sortProps', ['thing']); + + deepEqual(obj.get('sortedItems').mapBy('name'), ['D', 'C', 'B', 'A'], 'final'); + + obj2.notifyPropertyChange('sortedItems'); // invalidate to flush, to get DK refreshed + obj2.get('sortedItems'); // flush to get updated DK + + obj2.set('items.firstObject.count', 9999); + + deepEqual(obj2.get('sortedItems').mapBy('name'), ['Z', 'X', 'Y', 'W'], 'final'); + }); + + QUnit.test('sort correctly when multiple sorts are chained on the same instance of a class', function () { + var obj2 = klass.extend({ + items: _emberMetal.computed('sibling.sortedItems.[]', function () { + return this.get('sibling.sortedItems'); + }), + asdf: _emberMetal.observer('sibling.sortedItems.[]', function () { + this.get('sibling.sortedItems'); + }) + }).create({ + sibling: obj + }); + + /* + ┌───────────┐ ┌────────────┐ + │sortedProps│ │sortedProps2│ + └───────────┘ └────────────┘ + ▲ ▲ + │ ╔═══════════╗ │ + │─ ─ ─ ─ ─ ─ ─ ▶║ CP (sort) ║◀─ ─ ─ ─ ─ ─ ─ ┤ + │ ╚═══════════╝ │ + │ │ + ┌───────────┐ ┏━━━━━━━━━━━┓ ┏━━━━━━━━━━━━┓ + │ │ ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┃ ┃ ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┃ ┃ + │ items │◀── items.@each.count │◀──┃sortedItems┃◀─── items.@each.count │◀───┃sortedItems2┃ + │ │ └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┃ ┃ └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┃ ┃ + └───────────┘ ┗━━━━━━━━━━━┛ ┗━━━━━━━━━━━━┛ + */ + + deepEqual(obj.get('sortedItems').mapBy('name'), ['A', 'B', 'C', 'D'], 'obj.sortedItems.name should be sorted alpha'); + deepEqual(obj2.get('sortedItems').mapBy('name'), ['A', 'B', 'C', 'D'], 'obj2.sortedItems.name should be sorted alpha'); + + _emberMetal.set(obj.get('items')[1], 'count', 5); + _emberMetal.set(obj.get('items')[2], 'count', 6); + + deepEqual(obj.get('sortedItems').mapBy('name'), ['A', 'D', 'B', 'C'], 'obj.sortedItems.name should now have changed'); + deepEqual(obj2.get('sortedItems').mapBy('name'), ['A', 'D', 'B', 'C'], 'obj2.sortedItems.name should still mirror sortedItems2'); + + obj.set('sortProps', ['thing']); + obj2.set('sortProps', ['id']); + + deepEqual(obj2.get('sortedItems').mapBy('name'), ['A', 'B', 'C', 'D'], 'we now sort obj2 by id, so we expect a b c d'); + deepEqual(obj.get('sortedItems').mapBy('name'), ['D', 'C', 'B', 'A'], 'we now sort obj by thing'); + }); + + QUnit.module('max', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + max: _emberRuntimeComputedReduce_computed_macros.max('items') + }).create({ + items: _emberRuntimeSystemNative_array.A([1, 2, 3]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('max is readOnly', function () { + QUnit.throws(function () { + obj.set('max', 1); + }, /Cannot set read-only property "max" on object:/); + }); + + QUnit.test('max tracks the max number as objects are added', function () { + equal(obj.get('max'), 3, 'precond - max is initially correct'); + + var items = obj.get('items'); + + items.pushObject(5); + + equal(obj.get('max'), 5, 'max updates when a larger number is added'); + + items.pushObject(2); + + equal(obj.get('max'), 5, 'max does not update when a smaller number is added'); + }); + + QUnit.test('max recomputes when the current max is removed', function () { + equal(obj.get('max'), 3, 'precond - max is initially correct'); + + obj.get('items').removeObject(2); + + equal(obj.get('max'), 3, 'max is unchanged when a non-max item is removed'); + + obj.get('items').removeObject(3); + + equal(obj.get('max'), 1, 'max is recomputed when the current max is removed'); + }); + + QUnit.module('min', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + min: _emberRuntimeComputedReduce_computed_macros.min('items') + }).create({ + items: _emberRuntimeSystemNative_array.A([1, 2, 3]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('min is readOnly', function () { + QUnit.throws(function () { + obj.set('min', 1); + }, /Cannot set read-only property "min" on object:/); + }); + + QUnit.test('min tracks the min number as objects are added', function () { + equal(obj.get('min'), 1, 'precond - min is initially correct'); + + obj.get('items').pushObject(-2); + + equal(obj.get('min'), -2, 'min updates when a smaller number is added'); + + obj.get('items').pushObject(2); + + equal(obj.get('min'), -2, 'min does not update when a larger number is added'); + }); + + QUnit.test('min recomputes when the current min is removed', function () { + var items = obj.get('items'); + + equal(obj.get('min'), 1, 'precond - min is initially correct'); + + items.removeObject(2); + + equal(obj.get('min'), 1, 'min is unchanged when a non-min item is removed'); + + items.removeObject(1); + + equal(obj.get('min'), 3, 'min is recomputed when the current min is removed'); + }); + + QUnit.module('Ember.arrayComputed - mixed sugar', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + lannisters: _emberRuntimeComputedReduce_computed_macros.filterBy('items', 'lname', 'Lannister'), + lannisterSorting: _emberRuntimeSystemNative_array.A(['fname']), + sortedLannisters: _emberRuntimeComputedReduce_computed_macros.sort('lannisters', 'lannisterSorting'), + + starks: _emberRuntimeComputedReduce_computed_macros.filterBy('items', 'lname', 'Stark'), + starkAges: _emberRuntimeComputedReduce_computed_macros.mapBy('starks', 'age'), + oldestStarkAge: _emberRuntimeComputedReduce_computed_macros.max('starkAges') + }).create({ + items: _emberRuntimeSystemNative_array.A([{ fname: 'Jaime', lname: 'Lannister', age: 34 }, { fname: 'Cersei', lname: 'Lannister', age: 34 }, { fname: 'Robb', lname: 'Stark', age: 16 }, { fname: 'Bran', lname: 'Stark', age: 8 }]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('filtering and sorting can be combined', function () { + var items = obj.get('items'); + + deepEqual(obj.get('sortedLannisters').mapBy('fname'), ['Cersei', 'Jaime'], 'precond - array is initially filtered and sorted'); + + items.pushObject({ fname: 'Tywin', lname: 'Lannister' }); + items.pushObject({ fname: 'Lyanna', lname: 'Stark' }); + items.pushObject({ fname: 'Gerion', lname: 'Lannister' }); + + deepEqual(obj.get('sortedLannisters').mapBy('fname'), ['Cersei', 'Gerion', 'Jaime', 'Tywin'], 'updates propagate to array'); + }); + + QUnit.test('filtering, sorting and reduce (max) can be combined', function () { + var items = obj.get('items'); + + equal(16, obj.get('oldestStarkAge'), 'precond - end of chain is initially correct'); + + items.pushObject({ fname: 'Rickon', lname: 'Stark', age: 5 }); + + equal(16, obj.get('oldestStarkAge'), 'chain is updated correctly'); + + items.pushObject({ fname: 'Eddard', lname: 'Stark', age: 35 }); + + equal(35, obj.get('oldestStarkAge'), 'chain is updated correctly'); + }); + + function todo(name, priority) { + return _emberRuntimeSystemObject.default.create({ name: name, priority: priority }); + } + + function priorityComparator(todoA, todoB) { + var pa = parseInt(_emberMetal.get(todoA, 'priority'), 10); + var pb = parseInt(_emberMetal.get(todoB, 'priority'), 10); + + return pa - pb; + } + + function evenPriorities(todo) { + var p = parseInt(_emberMetal.get(todo, 'priority'), 10); + + return p % 2 === 0; + } + + QUnit.module('Ember.arrayComputed - chains', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + sorted: _emberRuntimeComputedReduce_computed_macros.sort('todos.@each.priority', priorityComparator), + filtered: _emberRuntimeComputedReduce_computed_macros.filter('sorted.@each.priority', evenPriorities) + }).create({ + todos: _emberRuntimeSystemNative_array.A([todo('E', 4), todo('D', 3), todo('C', 2), todo('B', 1), todo('A', 0)]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('it can filter and sort when both depend on the same item property', function () { + deepEqual(obj.get('todos').mapBy('name'), ['E', 'D', 'C', 'B', 'A'], 'precond - todos initially correct'); + deepEqual(obj.get('sorted').mapBy('name'), ['A', 'B', 'C', 'D', 'E'], 'precond - sorted initially correct'); + deepEqual(obj.get('filtered').mapBy('name'), ['A', 'C', 'E'], 'precond - filtered initially correct'); + + _emberMetal.set(obj.get('todos')[1], 'priority', 6); + + deepEqual(obj.get('todos').mapBy('name'), ['E', 'D', 'C', 'B', 'A'], 'precond - todos remain correct'); + deepEqual(obj.get('sorted').mapBy('name'), ['A', 'B', 'C', 'E', 'D'], 'precond - sorted updated correctly'); + deepEqual(obj.get('filtered').mapBy('name'), ['A', 'C', 'E', 'D'], 'filtered updated correctly'); + }); + + var userFnCalls = undefined; + QUnit.module('Chaining array and reduced CPs', { + setup: function () { + userFnCalls = 0; + obj = _emberRuntimeSystemObject.default.extend({ + mapped: _emberRuntimeComputedReduce_computed_macros.mapBy('array', 'v'), + max: _emberRuntimeComputedReduce_computed_macros.max('mapped'), + maxDidChange: _emberMetal.observer('max', function () { + return userFnCalls++; + }) + }).create({ + array: _emberRuntimeSystemNative_array.A([{ v: 1 }, { v: 3 }, { v: 2 }, { v: 1 }]) + }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('it computes interdependent array computed properties', function () { + equal(obj.get('max'), 3, 'sanity - it properly computes the maximum value'); + + var calls = 0; + + _emberMetal.addObserver(obj, 'max', function () { + return calls++; + }); + + obj.get('array').pushObject({ v: 5 }); + + equal(obj.get('max'), 5, 'maximum value is updated correctly'); + equal(userFnCalls, 1, 'object defined observers fire'); + equal(calls, 1, 'runtime created observers fire'); + }); + + QUnit.module('sum', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + total: _emberRuntimeComputedReduce_computed_macros.sum('array') + }).create({ + array: _emberRuntimeSystemNative_array.A([1, 2, 3]) + }); + }, + + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('sum is readOnly', function () { + QUnit.throws(function () { + obj.set('total', 1); + }, /Cannot set read-only property "total" on object:/); + }); + QUnit.test('sums the values in the dependentKey', function () { + equal(obj.get('total'), 6, 'sums the values'); + }); + + QUnit.test('if the dependentKey is neither an array nor object, it will return `0`', function () { + _emberMetal.set(obj, 'array', null); + equal(_emberMetal.get(obj, 'total'), 0, 'returns 0'); + + _emberMetal.set(obj, 'array', undefined); + equal(_emberMetal.get(obj, 'total'), 0, 'returns 0'); + + _emberMetal.set(obj, 'array', 'not an array'); + equal(_emberMetal.get(obj, 'total'), 0, 'returns 0'); + }); + + QUnit.test('updates when array is modified', function () { + obj.get('array').pushObject(1); + + equal(obj.get('total'), 7, 'recomputed when elements are added'); + + obj.get('array').popObject(); + + equal(obj.get('total'), 6, 'recomputes when elements are removed'); + }); + + QUnit.module('collect'); + + _internalTestHelpers.testBoth('works', function (get, set) { + var obj = { one: 'foo', two: 'bar', three: null }; + _emberMetal.defineProperty(obj, 'all', _emberRuntimeComputedReduce_computed_macros.collect('one', 'two', 'three', 'four')); + + deepEqual(get(obj, 'all'), ['foo', 'bar', null, null], 'have all of them'); + + set(obj, 'four', true); + + deepEqual(get(obj, 'all'), ['foo', 'bar', null, true], 'have all of them'); + + var a = []; + set(obj, 'one', 0); + set(obj, 'three', a); + + deepEqual(get(obj, 'all'), [0, 'bar', a, true], 'have all of them'); + }); +}); +enifed('ember-runtime/tests/computed/reduce_computed_macros_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/computed'); + test('ember-runtime/tests/computed/reduce_computed_macros_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/computed/reduce_computed_macros_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/computed/reduce_computed_macros_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/computed'); + QUnit.test('ember-runtime/tests/computed/reduce_computed_macros_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/computed/reduce_computed_macros_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/controllers/controller_test', ['exports', 'ember-runtime/controllers/controller', 'ember-runtime/system/service', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/inject', 'internal-test-helpers'], function (exports, _emberRuntimeControllersController, _emberRuntimeSystemService, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeInject, _internalTestHelpers) { + /* global EmberDev */ + + 'use strict'; + + QUnit.module('Controller event handling'); + + QUnit.test('can access `actions` hash via `_actions` [DEPRECATED]', function () { + expect(2); + + var controller = _emberRuntimeControllersController.default.extend({ + actions: { + foo: function () { + ok(true, 'called foo action'); + } + } + }).create(); + + expectDeprecation(function () { + controller._actions.foo(); + }, 'Usage of `_actions` is deprecated, use `actions` instead.'); + }); + + QUnit.test('Action can be handled by a function on actions object', function () { + expect(1); + var TestController = _emberRuntimeControllersController.default.extend({ + actions: { + poke: function () { + ok(true, 'poked'); + } + } + }); + var controller = TestController.create(); + controller.send('poke'); + }); + + QUnit.test('A handled action can be bubbled to the target for continued processing', function () { + expect(2); + var TestController = _emberRuntimeControllersController.default.extend({ + actions: { + poke: function () { + ok(true, 'poked 1'); + return true; + } + } + }); + + var controller = TestController.create({ + target: _emberRuntimeControllersController.default.extend({ + actions: { + poke: function () { + ok(true, 'poked 2'); + } + } + }).create() + }); + controller.send('poke'); + }); + + QUnit.test('Action can be handled by a superclass\' actions object', function () { + expect(4); + + var SuperController = _emberRuntimeControllersController.default.extend({ + actions: { + foo: function () { + ok(true, 'foo'); + }, + bar: function (msg) { + equal(msg, 'HELLO'); + } + } + }); + + var BarControllerMixin = _emberMetal.Mixin.create({ + actions: { + bar: function (msg) { + equal(msg, 'HELLO'); + this._super(msg); + } + } + }); + + var IndexController = SuperController.extend(BarControllerMixin, { + actions: { + baz: function () { + ok(true, 'baz'); + } + } + }); + + var controller = IndexController.create({}); + controller.send('foo'); + controller.send('bar', 'HELLO'); + controller.send('baz'); + }); + + QUnit.module('Controller deprecations'); + + QUnit.module('Controller Content -> Model Alias'); + + QUnit.test('`model` is aliased as `content`', function () { + expect(1); + var controller = _emberRuntimeControllersController.default.extend({ + model: 'foo-bar' + }).create(); + + equal(controller.get('content'), 'foo-bar', 'content is an alias of model'); + }); + + QUnit.test('`content` is moved to `model` when `model` is unset', function () { + expect(2); + var controller = undefined; + + ignoreDeprecation(function () { + controller = _emberRuntimeControllersController.default.extend({ + content: 'foo-bar' + }).create(); + }); + + equal(controller.get('model'), 'foo-bar', 'model is set properly'); + equal(controller.get('content'), 'foo-bar', 'content is set properly'); + }); + + QUnit.test('specifying `content` (without `model` specified) results in deprecation', function () { + expect(1); + var controller = undefined; + + expectDeprecation(function () { + controller = _emberRuntimeControllersController.default.extend({ + content: 'foo-bar' + }).create(); + }, 'Do not specify `content` on a Controller, use `model` instead.'); + }); + + QUnit.test('specifying `content` (with `model` specified) does not result in deprecation', function () { + expect(3); + expectNoDeprecation(); + + var controller = _emberRuntimeControllersController.default.extend({ + content: 'foo-bar', + model: 'blammo' + }).create(); + + equal(_emberMetal.get(controller, 'content'), 'foo-bar'); + equal(_emberMetal.get(controller, 'model'), 'blammo'); + }); + + QUnit.module('Controller injected properties'); + + if (!EmberDev.runningProdBuild) { + QUnit.test('defining a controller on a non-controller should fail assertion', function () { + expectAssertion(function () { + var owner = _internalTestHelpers.buildOwner(); + + var AnObject = _emberRuntimeSystemObject.default.extend({ + foo: _emberRuntimeInject.default.controller('bar') + }); + + owner.register('foo:main', AnObject); + + owner._lookupFactory('foo:main'); + }, /Defining an injected controller property on a non-controller is not allowed./); + }); + } + + QUnit.test('controllers can be injected into controllers', function () { + var owner = _internalTestHelpers.buildOwner(); + + owner.register('controller:post', _emberRuntimeControllersController.default.extend({ + postsController: _emberRuntimeInject.default.controller('posts') + })); + + owner.register('controller:posts', _emberRuntimeControllersController.default.extend()); + + var postController = owner.lookup('controller:post'); + var postsController = owner.lookup('controller:posts'); + + equal(postsController, postController.get('postsController'), 'controller.posts is injected'); + }); + + QUnit.test('services can be injected into controllers', function () { + var owner = _internalTestHelpers.buildOwner(); + + owner.register('controller:application', _emberRuntimeControllersController.default.extend({ + authService: _emberRuntimeInject.default.service('auth') + })); + + owner.register('service:auth', _emberRuntimeSystemService.default.extend()); + + var appController = owner.lookup('controller:application'); + var authService = owner.lookup('service:auth'); + + equal(authService, appController.get('authService'), 'service.auth is injected'); + }); +}); +enifed('ember-runtime/tests/controllers/controller_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/controllers'); + test('ember-runtime/tests/controllers/controller_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/controllers/controller_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/controllers/controller_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/controllers'); + QUnit.test('ember-runtime/tests/controllers/controller_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/controllers/controller_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/core/compare_test', ['exports', 'ember-runtime/utils', 'ember-runtime/system/object', 'ember-runtime/compare', 'ember-runtime/mixins/comparable'], function (exports, _emberRuntimeUtils, _emberRuntimeSystemObject, _emberRuntimeCompare, _emberRuntimeMixinsComparable) { + 'use strict'; + + var data = []; + var Comp = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsComparable.default); + + Comp.reopenClass({ + compare: function (obj) { + return obj.get('val'); + } + }); + + QUnit.module('Ember.compare()', { + setup: function () { + data[0] = null; + data[1] = false; + data[2] = true; + data[3] = -12; + data[4] = 3.5; + data[5] = 'a string'; + data[6] = 'another string'; + data[7] = 'last string'; + data[8] = [1, 2]; + data[9] = [1, 2, 3]; + data[10] = [1, 3]; + data[11] = { a: 'hash' }; + data[12] = _emberRuntimeSystemObject.default.create(); + data[13] = function (a) { + return a; + }; + data[14] = new Date('2012/01/01'); + data[15] = new Date('2012/06/06'); + } + }); + + QUnit.test('ordering should work', function () { + var suspect = undefined, + comparable = undefined, + failureMessage = undefined, + suspectIndex = undefined, + comparableIndex = undefined; + + for (suspectIndex = 0; suspectIndex < data.length; suspectIndex++) { + suspect = data[suspectIndex]; + + equal(_emberRuntimeCompare.default(suspect, suspect), 0, suspectIndex + ' should equal itself'); + + for (comparableIndex = suspectIndex + 1; comparableIndex < data.length; comparableIndex++) { + comparable = data[comparableIndex]; + + failureMessage = 'data[' + suspectIndex + '] (' + _emberRuntimeUtils.typeOf(suspect) + ') should be smaller than data[' + comparableIndex + '] (' + _emberRuntimeUtils.typeOf(comparable) + ')'; + + equal(_emberRuntimeCompare.default(suspect, comparable), -1, failureMessage); + } + } + }); + + QUnit.test('comparables should return values in the range of -1, 0, 1', function () { + var negOne = Comp.create({ + val: -1 + }); + + var zero = Comp.create({ + val: 0 + }); + + var one = Comp.create({ + val: 1 + }); + + equal(_emberRuntimeCompare.default(negOne, 'a'), -1, 'First item comparable - returns -1 (not negated)'); + equal(_emberRuntimeCompare.default(zero, 'b'), 0, 'First item comparable - returns 0 (not negated)'); + equal(_emberRuntimeCompare.default(one, 'c'), 1, 'First item comparable - returns 1 (not negated)'); + + equal(_emberRuntimeCompare.default('a', negOne), 1, 'Second item comparable - returns -1 (negated)'); + equal(_emberRuntimeCompare.default('b', zero), 0, 'Second item comparable - returns 0 (negated)'); + equal(_emberRuntimeCompare.default('c', one), -1, 'Second item comparable - returns 1 (negated)'); + }); +}); +enifed('ember-runtime/tests/core/compare_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/core'); + test('ember-runtime/tests/core/compare_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/core/compare_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/core/compare_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/core'); + QUnit.test('ember-runtime/tests/core/compare_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/core/compare_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/core/copy_test', ['exports', 'ember-runtime/copy'], function (exports, _emberRuntimeCopy) { + 'use strict'; + + QUnit.module('Ember Copy Method'); + + QUnit.test('Ember.copy null', function () { + var obj = { field: null }; + + equal(_emberRuntimeCopy.default(obj, true).field, null, 'null should still be null'); + }); + + QUnit.test('Ember.copy date', function () { + var date = new Date(2014, 7, 22); + var dateCopy = _emberRuntimeCopy.default(date); + + equal(date.getTime(), dateCopy.getTime(), 'dates should be equivalent'); + }); + + QUnit.test('Ember.copy null prototype object', function () { + var obj = Object.create(null); + + obj.foo = 'bar'; + + equal(_emberRuntimeCopy.default(obj).foo, 'bar', 'bar should still be bar'); + }); + + QUnit.test('Ember.copy Array', function () { + var array = [1, null, new Date(2015, 9, 9), 'four']; + var arrayCopy = _emberRuntimeCopy.default(array); + + deepEqual(array, arrayCopy, 'array content cloned successfully in new array'); + }); +}); +enifed('ember-runtime/tests/core/copy_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/core'); + test('ember-runtime/tests/core/copy_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/core/copy_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/core/copy_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/core'); + QUnit.test('ember-runtime/tests/core/copy_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/core/copy_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/core/isEqual_test', ['exports', 'ember-runtime/is-equal'], function (exports, _emberRuntimeIsEqual) { + 'use strict'; + + QUnit.module('isEqual'); + + QUnit.test('undefined and null', function () { + ok(_emberRuntimeIsEqual.default(undefined, undefined), 'undefined is equal to undefined'); + ok(!_emberRuntimeIsEqual.default(undefined, null), 'undefined is not equal to null'); + ok(_emberRuntimeIsEqual.default(null, null), 'null is equal to null'); + ok(!_emberRuntimeIsEqual.default(null, undefined), 'null is not equal to undefined'); + }); + + QUnit.test('strings should be equal', function () { + ok(!_emberRuntimeIsEqual.default('Hello', 'Hi'), 'different Strings are unequal'); + ok(_emberRuntimeIsEqual.default('Hello', 'Hello'), 'same Strings are equal'); + }); + + QUnit.test('numericals should be equal', function () { + ok(_emberRuntimeIsEqual.default(24, 24), 'same numbers are equal'); + ok(!_emberRuntimeIsEqual.default(24, 21), 'different numbers are inequal'); + }); + + QUnit.test('dates should be equal', function () { + ok(_emberRuntimeIsEqual.default(new Date(1985, 7, 22), new Date(1985, 7, 22)), 'same dates are equal'); + ok(!_emberRuntimeIsEqual.default(new Date(2014, 7, 22), new Date(1985, 7, 22)), 'different dates are not equal'); + }); + + QUnit.test('array should be equal', function () { + // NOTE: We don't test for array contents -- that would be too expensive. + ok(!_emberRuntimeIsEqual.default([1, 2], [1, 2]), 'two array instances with the same values should not be equal'); + ok(!_emberRuntimeIsEqual.default([1, 2], [1]), 'two array instances with different values should not be equal'); + }); + + QUnit.test('first object implements isEqual should use it', function () { + ok(_emberRuntimeIsEqual.default({ isEqual: function () { + return true; + } }, null), 'should return true always'); + + var obj = { isEqual: function () { + return false; + } }; + equal(_emberRuntimeIsEqual.default(obj, obj), false, 'should return false because isEqual returns false'); + }); +}); +enifed('ember-runtime/tests/core/isEqual_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/core'); + test('ember-runtime/tests/core/isEqual_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/core/isEqual_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/core/isEqual_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/core'); + QUnit.test('ember-runtime/tests/core/isEqual_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/core/isEqual_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/core/is_array_test', ['exports', 'ember-runtime/utils', 'ember-runtime/system/native_array', 'ember-runtime/system/array_proxy', 'ember-environment'], function (exports, _emberRuntimeUtils, _emberRuntimeSystemNative_array, _emberRuntimeSystemArray_proxy, _emberEnvironment) { + 'use strict'; + + QUnit.module('Ember Type Checking'); + + var global = undefined; + + QUnit.test('Ember.isArray', function () { + var numarray = [1, 2, 3]; + var number = 23; + var strarray = ['Hello', 'Hi']; + var string = 'Hello'; + var object = {}; + var length = { length: 12 }; + var fn = function () {}; + var arrayProxy = _emberRuntimeSystemArray_proxy.default.create({ content: _emberRuntimeSystemNative_array.A() }); + + equal(_emberRuntimeUtils.isArray(numarray), true, '[1,2,3]'); + equal(_emberRuntimeUtils.isArray(number), false, '23'); + equal(_emberRuntimeUtils.isArray(strarray), true, '["Hello", "Hi"]'); + equal(_emberRuntimeUtils.isArray(string), false, '"Hello"'); + equal(_emberRuntimeUtils.isArray(object), false, '{}'); + equal(_emberRuntimeUtils.isArray(length), true, '{ length: 12 }'); + equal(_emberRuntimeUtils.isArray(global), false, 'global'); + equal(_emberRuntimeUtils.isArray(fn), false, 'function() {}'); + equal(_emberRuntimeUtils.isArray(arrayProxy), true, '[]'); + }); + + if (_emberEnvironment.environment.window && typeof _emberEnvironment.environment.window.FileList === 'function') { + QUnit.test('Ember.isArray(fileList)', function () { + var fileListElement = document.createElement('input'); + fileListElement.type = 'file'; + var fileList = fileListElement.files; + equal(_emberRuntimeUtils.isArray(fileList), false, 'fileList'); + }); + } +}); +enifed('ember-runtime/tests/core/is_array_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/core'); + test('ember-runtime/tests/core/is_array_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/core/is_array_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/core/is_array_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/core'); + QUnit.test('ember-runtime/tests/core/is_array_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/core/is_array_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/core/is_empty_test', ['exports', 'ember-metal', 'ember-runtime/system/array_proxy', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemNative_array) { + 'use strict'; + + QUnit.module('Ember.isEmpty'); + + QUnit.test('Ember.isEmpty', function () { + var arrayProxy = _emberRuntimeSystemArray_proxy.default.create({ content: _emberRuntimeSystemNative_array.A() }); + + equal(true, _emberMetal.isEmpty(arrayProxy), 'for an ArrayProxy that has empty content'); + }); +}); +enifed('ember-runtime/tests/core/is_empty_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/core'); + test('ember-runtime/tests/core/is_empty_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/core/is_empty_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/core/is_empty_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/core'); + QUnit.test('ember-runtime/tests/core/is_empty_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/core/is_empty_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/core/type_of_test', ['exports', 'ember-runtime/utils', 'ember-runtime/system/object', 'ember-environment'], function (exports, _emberRuntimeUtils, _emberRuntimeSystemObject, _emberEnvironment) { + 'use strict'; + + QUnit.module('Ember Type Checking'); + + QUnit.test('Ember.typeOf', function () { + var MockedDate = function () {}; + MockedDate.prototype = new Date(); + + var mockedDate = new MockedDate(); + var date = new Date(); + var error = new Error('boum'); + var object = { a: 'b' }; + var a = null; + var arr = [1, 2, 3]; + var obj = {}; + var instance = _emberRuntimeSystemObject.default.create({ method: function () {} }); + + equal(_emberRuntimeUtils.typeOf(), 'undefined', 'undefined'); + equal(_emberRuntimeUtils.typeOf(null), 'null', 'null'); + equal(_emberRuntimeUtils.typeOf('Cyril'), 'string', 'Cyril'); + equal(_emberRuntimeUtils.typeOf(101), 'number', '101'); + equal(_emberRuntimeUtils.typeOf(true), 'boolean', 'true'); + equal(_emberRuntimeUtils.typeOf([1, 2, 90]), 'array', '[1,2,90]'); + equal(_emberRuntimeUtils.typeOf(/abc/), 'regexp', '/abc/'); + equal(_emberRuntimeUtils.typeOf(date), 'date', 'new Date()'); + equal(_emberRuntimeUtils.typeOf(mockedDate), 'date', 'mocked date'); + equal(_emberRuntimeUtils.typeOf(error), 'error', 'error'); + equal(_emberRuntimeUtils.typeOf(object), 'object', 'object'); + equal(_emberRuntimeUtils.typeOf(undefined), 'undefined', 'item of type undefined'); + equal(_emberRuntimeUtils.typeOf(a), 'null', 'item of type null'); + equal(_emberRuntimeUtils.typeOf(arr), 'array', 'item of type array'); + equal(_emberRuntimeUtils.typeOf(obj), 'object', 'item of type object'); + equal(_emberRuntimeUtils.typeOf(instance), 'instance', 'item of type instance'); + equal(_emberRuntimeUtils.typeOf(instance.method), 'function', 'item of type function'); + equal(_emberRuntimeUtils.typeOf(_emberRuntimeSystemObject.default.extend()), 'class', 'item of type class'); + equal(_emberRuntimeUtils.typeOf(new Error()), 'error', 'item of type error'); + }); + + if (_emberEnvironment.environment.window && typeof _emberEnvironment.environment.window.FileList === 'function') { + QUnit.test('Ember.typeOf(fileList)', function () { + var fileListElement = document.createElement('input'); + fileListElement.type = 'file'; + var fileList = fileListElement.files; + equal(_emberRuntimeUtils.typeOf(fileList), 'filelist', 'item of type filelist'); + }); + } +}); +enifed('ember-runtime/tests/core/type_of_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/core'); + test('ember-runtime/tests/core/type_of_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/core/type_of_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/core/type_of_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/core'); + QUnit.test('ember-runtime/tests/core/type_of_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/core/type_of_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/ext/function_test', ['exports', 'ember-environment', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object', 'ember-runtime/mixins/evented'], function (exports, _emberEnvironment, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject, _emberRuntimeMixinsEvented) { + 'use strict'; + + QUnit.module('Function.prototype.observes() helper'); + + _internalTestHelpers.testBoth('global observer helper takes multiple params', function (get, set) { + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.Function) { + ok('undefined' === typeof Function.prototype.observes, 'Function.prototype helper disabled'); + return; + } + + var MyMixin = _emberMetal.Mixin.create({ + + count: 0, + + foo: (function () { + set(this, 'count', get(this, 'count') + 1); + }).observes('bar', 'baz') + + }); + + var obj = _emberMetal.mixin({}, MyMixin); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj, 'bar', 'BAZ'); + set(obj, 'baz', 'BAZ'); + equal(get(obj, 'count'), 2, 'should invoke observer after change'); + }); + + QUnit.module('Function.prototype.on() helper'); + + _internalTestHelpers.testBoth('sets up an event listener, and can trigger the function on multiple events', function (get, set) { + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.Function) { + ok('undefined' === typeof Function.prototype.on, 'Function.prototype helper disabled'); + return; + } + + var MyMixin = _emberMetal.Mixin.create({ + + count: 0, + + foo: (function () { + set(this, 'count', get(this, 'count') + 1); + }).on('bar', 'baz') + + }); + + var obj = _emberMetal.mixin({}, _emberRuntimeMixinsEvented.default, MyMixin); + equal(get(obj, 'count'), 0, 'should not invoke listener immediately'); + + obj.trigger('bar'); + obj.trigger('baz'); + equal(get(obj, 'count'), 2, 'should invoke listeners when events trigger'); + }); + + _internalTestHelpers.testBoth('can be chained with observes', function (get, set) { + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.Function) { + ok('Function.prototype helper disabled'); + return; + } + + var MyMixin = _emberMetal.Mixin.create({ + + count: 0, + bay: 'bay', + foo: (function () { + set(this, 'count', get(this, 'count') + 1); + }).observes('bay').on('bar') + }); + + var obj = _emberMetal.mixin({}, _emberRuntimeMixinsEvented.default, MyMixin); + equal(get(obj, 'count'), 0, 'should not invoke listener immediately'); + + set(obj, 'bay', 'BAY'); + obj.trigger('bar'); + equal(get(obj, 'count'), 2, 'should invoke observer and listener'); + }); + + QUnit.module('Function.prototype.property() helper'); + + _internalTestHelpers.testBoth('sets up a ComputedProperty', function (get, set) { + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.Function) { + ok('undefined' === typeof Function.prototype.property, 'Function.prototype helper disabled'); + return; + } + + var MyClass = _emberRuntimeSystemObject.default.extend({ + firstName: null, + lastName: null, + fullName: (function () { + return get(this, 'firstName') + ' ' + get(this, 'lastName'); + }).property('firstName', 'lastName') + }); + + var obj = MyClass.create({ firstName: 'Fred', lastName: 'Flinstone' }); + equal(get(obj, 'fullName'), 'Fred Flinstone', 'should return the computed value'); + + set(obj, 'firstName', 'Wilma'); + equal(get(obj, 'fullName'), 'Wilma Flinstone', 'should return the new computed value'); + + set(obj, 'lastName', ''); + equal(get(obj, 'fullName'), 'Wilma ', 'should return the new computed value'); + }); +}); +enifed('ember-runtime/tests/ext/function_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/ext'); + test('ember-runtime/tests/ext/function_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/ext/function_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/ext/function_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/ext'); + QUnit.test('ember-runtime/tests/ext/function_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/ext/function_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/ext/mixin_test', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; + + QUnit.module('system/mixin/binding_test'); + + QUnit.test('Defining a property ending in Binding should setup binding when applied', function () { + var MyMixin = _emberMetal.Mixin.create({ + fooBinding: 'bar.baz' + }); + + var obj = { bar: { baz: 'BIFF' } }; + + _emberMetal.run(function () { + var deprecationMessage = /`Ember.Binding` is deprecated/; + + expectDeprecation(function () { + MyMixin.apply(obj); + }, deprecationMessage); + }); + + ok(_emberMetal.get(obj, 'fooBinding') instanceof _emberMetal.Binding, 'should be a binding object'); + equal(_emberMetal.get(obj, 'foo'), 'BIFF', 'binding should be created and synced'); + }); + + QUnit.test('Defining a property ending in Binding should apply to prototype children', function () { + var MyMixin = _emberMetal.run(function () { + return _emberMetal.Mixin.create({ + fooBinding: 'bar.baz' + }); + }); + + var obj = { bar: { baz: 'BIFF' } }; + + _emberMetal.run(function () { + var deprecationMessage = /`Ember.Binding` is deprecated/; + + expectDeprecation(function () { + MyMixin.apply(obj); + }, deprecationMessage); + }); + + var obj2 = Object.create(obj); + _emberMetal.run(function () { + return _emberMetal.set(_emberMetal.get(obj2, 'bar'), 'baz', 'BARG'); + }); + + ok(_emberMetal.get(obj2, 'fooBinding') instanceof _emberMetal.Binding, 'should be a binding object'); + equal(_emberMetal.get(obj2, 'foo'), 'BARG', 'binding should be created and synced'); + }); +}); +enifed('ember-runtime/tests/ext/mixin_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/ext'); + test('ember-runtime/tests/ext/mixin_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/ext/mixin_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/ext/mixin_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/ext'); + QUnit.test('ember-runtime/tests/ext/mixin_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/ext/mixin_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/ext/rsvp_test', ['exports', 'ember-metal', 'ember-runtime/ext/rsvp'], function (exports, _emberMetal, _emberRuntimeExtRsvp) { + 'use strict'; + + var ORIGINAL_ONERROR = _emberMetal.getOnerror(); + + QUnit.module('Ember.RSVP', { + teardown: function () { + _emberMetal.setOnerror(ORIGINAL_ONERROR); + } + }); + + QUnit.test('Ensure that errors thrown from within a promise are sent to the console', function () { + var error = new Error('Error thrown in a promise for testing purposes.'); + + try { + _emberMetal.run(function () { + new _emberRuntimeExtRsvp.default.Promise(function (resolve, reject) { + throw error; + }); + }); + ok(false, 'expected assertion to be thrown'); + } catch (e) { + equal(e, error, 'error was re-thrown'); + } + }); + + QUnit.test('TransitionAborted errors are not re-thrown', function () { + expect(1); + var fakeTransitionAbort = { name: 'TransitionAborted' }; + + _emberMetal.run(_emberRuntimeExtRsvp.default, 'reject', fakeTransitionAbort); + + ok(true, 'did not throw an error when dealing with TransitionAborted'); + }); + + QUnit.test('Can reject with non-Error object', function (assert) { + var wasEmberTesting = _emberMetal.isTesting(); + _emberMetal.setTesting(false); + expect(1); + + try { + _emberMetal.run(_emberRuntimeExtRsvp.default, 'reject', 'foo'); + } catch (e) { + ok(false, 'should not throw'); + } finally { + _emberMetal.setTesting(wasEmberTesting); + } + + ok(true); + }); + + QUnit.test('Can reject with no arguments', function (assert) { + var wasEmberTesting = _emberMetal.isTesting(); + _emberMetal.setTesting(false); + expect(1); + + try { + _emberMetal.run(_emberRuntimeExtRsvp.default, 'reject'); + } catch (e) { + ok(false, 'should not throw'); + } finally { + _emberMetal.setTesting(wasEmberTesting); + } + + ok(true); + }); + + QUnit.test('rejections like jqXHR which have errorThrown property work', function () { + expect(2); + + var wasEmberTesting = _emberMetal.isTesting(); + var wasOnError = _emberMetal.getOnerror(); + + try { + (function () { + _emberMetal.setTesting(false); + _emberMetal.setOnerror(function (error) { + equal(error, actualError, 'expected the real error on the jqXHR'); + equal(error.__reason_with_error_thrown__, jqXHR, 'also retains a helpful reference to the rejection reason'); + }); + + var actualError = new Error('OMG what really happened'); + var jqXHR = { + errorThrown: actualError + }; + + _emberMetal.run(_emberRuntimeExtRsvp.default, 'reject', jqXHR); + })(); + } finally { + _emberMetal.setOnerror(wasOnError); + _emberMetal.setTesting(wasEmberTesting); + } + }); + + QUnit.test('rejections where the errorThrown is a string should wrap the sting in an error object', function () { + expect(2); + + var wasEmberTesting = _emberMetal.isTesting(); + var wasOnError = _emberMetal.getOnerror(); + + try { + (function () { + _emberMetal.setTesting(false); + _emberMetal.setOnerror(function (error) { + equal(error.message, actualError, 'expected the real error on the jqXHR'); + equal(error.__reason_with_error_thrown__, jqXHR, 'also retains a helpful reference to the rejection reason'); + }); + + var actualError = 'OMG what really happened'; + var jqXHR = { + errorThrown: actualError + }; + + _emberMetal.run(_emberRuntimeExtRsvp.default, 'reject', jqXHR); + })(); + } finally { + _emberMetal.setOnerror(wasOnError); + _emberMetal.setTesting(wasEmberTesting); + } + }); + + QUnit.test('rejections can be serialized to JSON', function (assert) { + expect(2); + + var wasEmberTesting = _emberMetal.isTesting(); + var wasOnError = _emberMetal.getOnerror(); + + try { + _emberMetal.setTesting(false); + _emberMetal.setOnerror(function (error) { + assert.equal(error.message, 'a fail'); + assert.ok(JSON.stringify(error), 'Error can be serialized'); + }); + + var jqXHR = { + errorThrown: new Error('a fail') + }; + + _emberMetal.run(_emberRuntimeExtRsvp.default, 'reject', jqXHR); + } finally { + _emberMetal.setOnerror(wasOnError); + _emberMetal.setTesting(wasEmberTesting); + } + }); + + var reason = 'i failed'; + QUnit.module('Ember.test: rejection assertions'); + + function ajax(something) { + return _emberRuntimeExtRsvp.default.Promise(function (resolve) { + QUnit.stop(); + setTimeout(function () { + QUnit.start(); + resolve(); + }, 0); // fake true / foreign async + }); + } + + QUnit.test('unambigiously unhandled rejection', function () { + QUnit.throws(function () { + _emberMetal.run(function () { + _emberRuntimeExtRsvp.default.Promise.reject(reason); + }); // something is funky, we should likely assert + }, reason); + }); + + QUnit.test('sync handled', function () { + _emberMetal.run(function () { + _emberRuntimeExtRsvp.default.Promise.reject(reason).catch(function () {}); + }); // handled, we shouldn't need to assert. + ok(true, 'reached end of test'); + }); + + QUnit.test('handled within the same micro-task (via Ember.RVP.Promise)', function () { + _emberMetal.run(function () { + var rejection = _emberRuntimeExtRsvp.default.Promise.reject(reason); + _emberRuntimeExtRsvp.default.Promise.resolve(1).then(function () { + return rejection.catch(function () {}); + }); + }); // handled, we shouldn't need to assert. + ok(true, 'reached end of test'); + }); + + QUnit.test('handled within the same micro-task (via direct run-loop)', function () { + _emberMetal.run(function () { + var rejection = _emberRuntimeExtRsvp.default.Promise.reject(reason); + _emberMetal.run.schedule('afterRender', function () { + return rejection.catch(function () {}); + }); + }); // handled, we shouldn't need to assert. + ok(true, 'reached end of test'); + }); + + QUnit.test('handled in the next microTask queue flush (run.next)', function () { + expect(2); + + QUnit.throws(function () { + _emberMetal.run(function () { + var rejection = _emberRuntimeExtRsvp.default.Promise.reject(reason); + + QUnit.stop(); + _emberMetal.run.next(function () { + QUnit.start(); + rejection.catch(function () {}); + ok(true, 'reached end of test'); + }); + }); + }, reason); + + // a promise rejection survived a full flush of the run-loop without being handled + // this is very likely an issue. + }); + + QUnit.test('handled in the same microTask Queue flush do to data locality', function () { + // an ambiguous scenario, this may or may not assert + // it depends on the locality of `user#1` + var store = { + find: function () { + return _emberRuntimeExtRsvp.default.Promise.resolve(1); + } + }; + _emberMetal.run(function () { + var rejection = _emberRuntimeExtRsvp.default.Promise.reject(reason); + store.find('user', 1).then(function () { + return rejection.catch(function () {}); + }); + }); + + ok(true, 'reached end of test'); + }); + + QUnit.test('handled in a different microTask Queue flush do to data locality', function () { + // an ambiguous scenario, this may or may not assert + // it depends on the locality of `user#1` + var store = { + find: function () { + return ajax(); + } + }; + QUnit.throws(function () { + _emberMetal.run(function () { + var rejection = _emberRuntimeExtRsvp.default.Promise.reject(reason); + store.find('user', 1).then(function () { + rejection.catch(function () {}); + ok(true, 'reached end of test'); + }); + }); + }, reason); + }); + + QUnit.test('handled in the next microTask queue flush (ajax example)', function () { + QUnit.throws(function () { + _emberMetal.run(function () { + var rejection = _emberRuntimeExtRsvp.default.Promise.reject(reason); + ajax('/something/').then(function () { + rejection.catch(function () {}); + ok(true, 'reached end of test'); + }); + }); + }, reason); + }); +}); +enifed('ember-runtime/tests/ext/rsvp_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/ext'); + test('ember-runtime/tests/ext/rsvp_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/ext/rsvp_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/ext/rsvp_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/ext'); + QUnit.test('ember-runtime/tests/ext/rsvp_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/ext/rsvp_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/inject_test', ['exports', 'ember-metal', 'ember-runtime/inject', 'ember-runtime/system/object', 'internal-test-helpers'], function (exports, _emberMetal, _emberRuntimeInject, _emberRuntimeSystemObject, _internalTestHelpers) { + /* global EmberDev */ + + 'use strict'; + + QUnit.module('inject'); + + QUnit.test('calling `inject` directly should error', function () { + expectAssertion(function () { + _emberRuntimeInject.default('foo'); + }, /Injected properties must be created through helpers/); + }); + + if (!EmberDev.runningProdBuild) { + // this check is done via an assertion which is stripped from + // production builds + QUnit.test('injection type validation is run when first looked up', function () { + expect(1); + + _emberRuntimeInject.createInjectionHelper('foo', function () { + ok(true, 'should call validation method'); + }); + + var owner = _internalTestHelpers.buildOwner(); + + var AnObject = _emberRuntimeSystemObject.default.extend({ + bar: _emberRuntimeInject.default.foo(), + baz: _emberRuntimeInject.default.foo() + }); + + owner.register('foo:main', AnObject); + owner._lookupFactory('foo:main'); + }); + + QUnit.test('attempting to inject a nonexistent container key should error', function () { + var owner = _internalTestHelpers.buildOwner(); + var AnObject = _emberRuntimeSystemObject.default.extend({ + foo: new _emberMetal.InjectedProperty('bar', 'baz') + }); + + owner.register('foo:main', AnObject); + + throws(function () { + owner.lookup('foo:main'); + }, /Attempting to inject an unknown injection: 'bar:baz'/); + }); + } + + QUnit.test('factories should return a list of lazy injection full names', function () { + var AnObject = _emberRuntimeSystemObject.default.extend({ + foo: new _emberMetal.InjectedProperty('foo', 'bar'), + bar: new _emberMetal.InjectedProperty('quux') + }); + + deepEqual(AnObject._lazyInjections(), { 'foo': 'foo:bar', 'bar': 'quux:bar' }, 'should return injected container keys'); + }); +}); +enifed('ember-runtime/tests/inject_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests'); + test('ember-runtime/tests/inject_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/inject_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/inject_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests'); + QUnit.test('ember-runtime/tests/inject_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/inject_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/mixins/observable/chained_test', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeSystemNative_array) { + 'use strict'; + + /* + NOTE: This test is adapted from the 1.x series of unit tests. The tests + are the same except for places where we intend to break the API we instead + validate that we warn the developer appropriately. + + CHANGES FROM 1.6: + + * changed obj.set() and obj.get() to Ember.set() and Ember.get() + * changed obj.addObserver() to addObserver() + */ + + QUnit.module('Ember.Observable - Observing with @each'); + + QUnit.test('chained observers on enumerable properties are triggered when the observed property of any item changes', function () { + var family = _emberRuntimeSystemObject.default.create({ momma: null }); + var momma = _emberRuntimeSystemObject.default.create({ children: [] }); + + var child1 = _emberRuntimeSystemObject.default.create({ name: 'Bartholomew' }); + var child2 = _emberRuntimeSystemObject.default.create({ name: 'Agnes' }); + var child3 = _emberRuntimeSystemObject.default.create({ name: 'Dan' }); + var child4 = _emberRuntimeSystemObject.default.create({ name: 'Nancy' }); + + _emberMetal.set(family, 'momma', momma); + _emberMetal.set(momma, 'children', _emberRuntimeSystemNative_array.A([child1, child2, child3])); + + var observerFiredCount = 0; + _emberMetal.addObserver(family, 'momma.children.@each.name', this, function () { + observerFiredCount++; + }); + + observerFiredCount = 0; + _emberMetal.run(function () { + return _emberMetal.get(momma, 'children').setEach('name', 'Juan'); + }); + equal(observerFiredCount, 3, 'observer fired after changing child names'); + + observerFiredCount = 0; + _emberMetal.run(function () { + return _emberMetal.get(momma, 'children').pushObject(child4); + }); + equal(observerFiredCount, 1, 'observer fired after adding a new item'); + + observerFiredCount = 0; + _emberMetal.run(function () { + return _emberMetal.set(child4, 'name', 'Herbert'); + }); + equal(observerFiredCount, 1, 'observer fired after changing property on new object'); + + _emberMetal.set(momma, 'children', []); + + observerFiredCount = 0; + _emberMetal.run(function () { + return _emberMetal.set(child1, 'name', 'Hanna'); + }); + equal(observerFiredCount, 0, 'observer did not fire after removing changing property on a removed object'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/mixins/observable/chained_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/legacy_1x/mixins/observable'); + test('ember-runtime/tests/legacy_1x/mixins/observable/chained_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/chained_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/mixins/observable/chained_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/legacy_1x/mixins/observable'); + QUnit.test('ember-runtime/tests/legacy_1x/mixins/observable/chained_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/chained_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/mixins/observable/observable_test', ['exports', 'ember-environment', 'ember-metal', 'ember-runtime/system/string', 'ember-runtime/system/object', 'ember-runtime/mixins/observable', 'ember-runtime/system/native_array'], function (exports, _emberEnvironment, _emberMetal, _emberRuntimeSystemString, _emberRuntimeSystemObject, _emberRuntimeMixinsObservable, _emberRuntimeSystemNative_array) { + 'use strict'; + + /* + NOTE: This test is adapted from the 1.x series of unit tests. The tests + are the same except for places where we intend to break the API we instead + validate that we warn the developer appropriately. + + CHANGES FROM 1.6: + + * Added ObservableObject which applies the Ember.Observable mixin. + * Changed reference to Ember.T_FUNCTION to 'function' + * Changed all references to sc_super to this._super(...arguments) + * Changed Ember.objectForPropertyPath() to Ember.getPath() + * Removed allPropertiesDidChange test - no longer supported + * Changed test that uses 'ObjectE' as path to 'objectE' to reflect new + rule on using capital letters for property paths. + * Removed test passing context to addObserver. context param is no longer + supported. + * Changed calls to Ember.Binding.flushPendingChanges() -> run.sync() + * removed test in observer around line 862 that expected key/value to be + the last item in the chained path. Should be root and chained path + + */ + + // ======================================================================== + // Ember.Observable Tests + // ======================================================================== + + var object, ObjectC, ObjectD, objectA, objectB, lookup; + + var ObservableObject = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsObservable.default); + var originalLookup = _emberEnvironment.context.lookup; + + // .......................................................... + // GET() + // + + QUnit.module('object.get()', { + + setup: function () { + object = ObservableObject.extend(_emberRuntimeMixinsObservable.default, { + computed: _emberMetal.computed(function () { + return 'value'; + }).volatile(), + method: function () { + return 'value'; + }, + unknownProperty: function (key, value) { + this.lastUnknownProperty = key; + return 'unknown'; + } + }).create({ + normal: 'value', + numberVal: 24, + toggleVal: true, + nullProperty: null + }); + } + + }); + + QUnit.test('should get normal properties', function () { + equal(object.get('normal'), 'value'); + }); + + QUnit.test('should call computed properties and return their result', function () { + equal(object.get('computed'), 'value'); + }); + + QUnit.test('should return the function for a non-computed property', function () { + var value = object.get('method'); + equal(typeof value, 'function'); + }); + + QUnit.test('should return null when property value is null', function () { + equal(object.get('nullProperty'), null); + }); + + QUnit.test('should call unknownProperty when value is undefined', function () { + equal(object.get('unknown'), 'unknown'); + equal(object.lastUnknownProperty, 'unknown'); + }); + + // .......................................................... + // Ember.GET() + // + QUnit.module('Ember.get()', { + setup: function () { + objectA = ObservableObject.extend({ + computed: _emberMetal.computed(function () { + return 'value'; + }).volatile(), + method: function () { + return 'value'; + }, + unknownProperty: function (key, value) { + this.lastUnknownProperty = key; + return 'unknown'; + } + }).create({ + normal: 'value', + numberVal: 24, + toggleVal: true, + nullProperty: null + }); + + objectB = { + normal: 'value', + nullProperty: null + }; + } + }); + + QUnit.test('should get normal properties on Ember.Observable', function () { + equal(_emberMetal.get(objectA, 'normal'), 'value'); + }); + + QUnit.test('should call computed properties on Ember.Observable and return their result', function () { + equal(_emberMetal.get(objectA, 'computed'), 'value'); + }); + + QUnit.test('should return the function for a non-computed property on Ember.Observable', function () { + var value = _emberMetal.get(objectA, 'method'); + equal(typeof value, 'function'); + }); + + QUnit.test('should return null when property value is null on Ember.Observable', function () { + equal(_emberMetal.get(objectA, 'nullProperty'), null); + }); + + QUnit.test('should call unknownProperty when value is undefined on Ember.Observable', function () { + equal(_emberMetal.get(objectA, 'unknown'), 'unknown'); + equal(objectA.lastUnknownProperty, 'unknown'); + }); + + QUnit.test('should get normal properties on standard objects', function () { + equal(_emberMetal.get(objectB, 'normal'), 'value'); + }); + + QUnit.test('should return null when property is null on standard objects', function () { + equal(_emberMetal.get(objectB, 'nullProperty'), null); + }); + + /* + QUnit.test("raise if the provided object is null", function() { + throws(function() { + get(null, 'key'); + }); + }); + */ + + QUnit.test('raise if the provided object is undefined', function () { + expectAssertion(function () { + _emberMetal.get(undefined, 'key'); + }, /Cannot call get with 'key' on an undefined object/i); + }); + + QUnit.module('Ember.get() with paths'); + + QUnit.test('should return a property at a given path relative to the passed object', function () { + var foo = ObservableObject.create({ + bar: ObservableObject.extend({ + baz: _emberMetal.computed(function () { + return 'blargh'; + }).volatile() + }).create() + }); + + equal(_emberMetal.get(foo, 'bar.baz'), 'blargh'); + }); + + QUnit.test('should return a property at a given path relative to the passed object - JavaScript hash', function () { + var foo = { + bar: { + baz: 'blargh' + } + }; + + equal(_emberMetal.get(foo, 'bar.baz'), 'blargh'); + }); + + // .......................................................... + // SET() + // + + QUnit.module('object.set()', { + + setup: function () { + object = ObservableObject.extend({ + computed: _emberMetal.computed({ + get: function (key) { + return this._computed; + }, + set: function (key, value) { + this._computed = value; + return this._computed; + } + }).volatile(), + + method: function (key, value) { + if (value !== undefined) { + this._method = value; + } + return this._method; + }, + + unknownProperty: function (key) { + return this._unknown; + }, + + setUnknownProperty: function (key, value) { + this._unknown = value; + return this._unknown; + }, + + // normal property + normal: 'value', + + // computed property + _computed: 'computed', + // method, but not a property + _method: 'method', + // null property + nullProperty: null, + + // unknown property + _unknown: 'unknown' + }).create(); + } + + }); + + QUnit.test('should change normal properties and return the value', function () { + var ret = object.set('normal', 'changed'); + equal(object.get('normal'), 'changed'); + equal(ret, 'changed'); + }); + + QUnit.test('should call computed properties passing value and return the value', function () { + var ret = object.set('computed', 'changed'); + equal(object.get('_computed'), 'changed'); + equal(ret, 'changed'); + }); + + QUnit.test('should change normal properties when passing undefined', function () { + var ret = object.set('normal', undefined); + equal(object.get('normal'), undefined); + equal(ret, undefined); + }); + + QUnit.test('should replace the function for a non-computed property and return the value', function () { + var ret = object.set('method', 'changed'); + equal(object.get('_method'), 'method'); // make sure this was NOT run + ok(typeof object.get('method') !== 'function'); + equal(ret, 'changed'); + }); + + QUnit.test('should replace prover when property value is null', function () { + var ret = object.set('nullProperty', 'changed'); + equal(object.get('nullProperty'), 'changed'); + equal(ret, 'changed'); + }); + + QUnit.test('should call unknownProperty with value when property is undefined', function () { + var ret = object.set('unknown', 'changed'); + equal(object.get('_unknown'), 'changed'); + equal(ret, 'changed'); + }); + + // .......................................................... + // COMPUTED PROPERTIES + // + + QUnit.module('Computed properties', { + setup: function () { + lookup = _emberEnvironment.context.lookup = {}; + + object = ObservableObject.extend({ + computed: _emberMetal.computed({ + get: function () { + this.computedCalls.push('getter-called'); + return 'computed'; + }, + set: function (key, value) { + this.computedCalls.push(value); + } + }).volatile(), + + computedCached: _emberMetal.computed({ + get: function () { + this.computedCachedCalls.push('getter-called'); + return 'computedCached'; + }, + set: function (key, value) { + this.computedCachedCalls.push(value); + } + }), + + dependent: _emberMetal.computed({ + get: function () { + this.dependentCalls.push('getter-called'); + return 'dependent'; + }, + set: function (key, value) { + this.dependentCalls.push(value); + } + }).property('changer').volatile(), + dependentFront: _emberMetal.computed('changer', { + get: function () { + this.dependentFrontCalls.push('getter-called'); + return 'dependentFront'; + }, + set: function (key, value) { + this.dependentFrontCalls.push(value); + } + }).volatile(), + dependentCached: _emberMetal.computed({ + get: function () { + this.dependentCachedCalls.push('getter-called!'); + return 'dependentCached'; + }, + set: function (key, value) { + this.dependentCachedCalls.push(value); + } + }).property('changer'), + + inc: _emberMetal.computed('changer', function () { + return this.incCallCount++; + }), + + nestedInc: _emberMetal.computed(function (key) { + _emberMetal.get(this, 'inc'); + return this.nestedIncCallCount++; + }).property('inc'), + + isOn: _emberMetal.computed({ + get: function () { + return this.get('state') === 'on'; + }, + set: function (key, value) { + this.set('state', 'on'); + return this.get('state') === 'on'; + } + }).property('state').volatile(), + + isOff: _emberMetal.computed({ + get: function () { + return this.get('state') === 'off'; + }, + set: function (key, value) { + this.set('state', 'off'); + return this.get('state') === 'off'; + } + }).property('state').volatile() + + }).create({ + computedCalls: [], + computedCachedCalls: [], + changer: 'foo', + dependentCalls: [], + dependentFrontCalls: [], + dependentCachedCalls: [], + incCallCount: 0, + nestedIncCallCount: 0, + state: 'on' + }); + }, + teardown: function () { + _emberEnvironment.context.lookup = originalLookup; + } + }); + + QUnit.test('getting values should call function return value', function () { + // get each property twice. Verify return. + var keys = _emberRuntimeSystemString.w('computed computedCached dependent dependentFront dependentCached'); + + keys.forEach(function (key) { + equal(object.get(key), key, 'Try #1: object.get(' + key + ') should run function'); + equal(object.get(key), key, 'Try #2: object.get(' + key + ') should run function'); + }); + + // verify each call count. cached should only be called once + _emberRuntimeSystemString.w('computedCalls dependentFrontCalls dependentCalls').forEach(function (key) { + equal(object[key].length, 2, 'non-cached property ' + key + ' should be called 2x'); + }); + + _emberRuntimeSystemString.w('computedCachedCalls dependentCachedCalls').forEach(function (key) { + equal(object[key].length, 1, 'non-cached property ' + key + ' should be called 1x'); + }); + }); + + QUnit.test('setting values should call function return value', function () { + // get each property twice. Verify return. + var keys = _emberRuntimeSystemString.w('computed dependent dependentFront computedCached dependentCached'); + var values = _emberRuntimeSystemString.w('value1 value2'); + + keys.forEach(function (key) { + equal(object.set(key, values[0]), values[0], 'Try #1: object.set(' + key + ', ' + values[0] + ') should run function'); + + equal(object.set(key, values[1]), values[1], 'Try #2: object.set(' + key + ', ' + values[1] + ') should run function'); + + equal(object.set(key, values[1]), values[1], 'Try #3: object.set(' + key + ', ' + values[1] + ') should not run function since it is setting same value as before'); + }); + + // verify each call count. cached should only be called once + keys.forEach(function (key) { + var calls = object[key + 'Calls']; + var idx, expectedLength; + + // Cached properties first check their cached value before setting the + // property. Other properties blindly call set. + expectedLength = 3; + equal(calls.length, expectedLength, 'set(' + key + ') should be called the right amount of times'); + for (idx = 0; idx < 2; idx++) { + equal(calls[idx], values[idx], 'call #' + (idx + 1) + ' to set(' + key + ') should have passed value ' + values[idx]); + } + }); + }); + + QUnit.test('notify change should clear cache', function () { + // call get several times to collect call count + object.get('computedCached'); // should run func + object.get('computedCached'); // should not run func + + object.propertyWillChange('computedCached').propertyDidChange('computedCached'); + + object.get('computedCached'); // should run again + equal(object.computedCachedCalls.length, 2, 'should have invoked method 2x'); + }); + + QUnit.test('change dependent should clear cache', function () { + // call get several times to collect call count + var ret1 = object.get('inc'); // should run func + equal(object.get('inc'), ret1, 'multiple calls should not run cached prop'); + + object.set('changer', 'bar'); + + equal(object.get('inc'), ret1 + 1, 'should increment after dependent key changes'); // should run again + }); + + QUnit.test('just notifying change of dependent should clear cache', function () { + // call get several times to collect call count + var ret1 = object.get('inc'); // should run func + equal(object.get('inc'), ret1, 'multiple calls should not run cached prop'); + + object.notifyPropertyChange('changer'); + + equal(object.get('inc'), ret1 + 1, 'should increment after dependent key changes'); // should run again + }); + + QUnit.test('changing dependent should clear nested cache', function () { + // call get several times to collect call count + var ret1 = object.get('nestedInc'); // should run func + equal(object.get('nestedInc'), ret1, 'multiple calls should not run cached prop'); + + object.set('changer', 'bar'); + + equal(object.get('nestedInc'), ret1 + 1, 'should increment after dependent key changes'); // should run again + }); + + QUnit.test('just notifying change of dependent should clear nested cache', function () { + // call get several times to collect call count + var ret1 = object.get('nestedInc'); // should run func + equal(object.get('nestedInc'), ret1, 'multiple calls should not run cached prop'); + + object.notifyPropertyChange('changer'); + + equal(object.get('nestedInc'), ret1 + 1, 'should increment after dependent key changes'); // should run again + }); + + // This verifies a specific bug encountered where observers for computed + // properties would fire before their prop caches were cleared. + QUnit.test('change dependent should clear cache when observers of dependent are called', function () { + // call get several times to collect call count + var ret1 = object.get('inc'); // should run func + equal(object.get('inc'), ret1, 'multiple calls should not run cached prop'); + + // add observer to verify change... + object.addObserver('inc', this, function () { + equal(object.get('inc'), ret1 + 1, 'should increment after dependent key changes'); // should run again + }); + + // now run + object.set('changer', 'bar'); + }); + + QUnit.test('setting one of two computed properties that depend on a third property should clear the kvo cache', function () { + // we have to call set twice to fill up the cache + object.set('isOff', true); + object.set('isOn', true); + + // setting isOff to true should clear the kvo cache + object.set('isOff', true); + equal(object.get('isOff'), true, 'object.isOff should be true'); + equal(object.get('isOn'), false, 'object.isOn should be false'); + }); + + QUnit.test('dependent keys should be able to be specified as property paths', function () { + var depObj = ObservableObject.extend({ + menuPrice: _emberMetal.computed(function () { + return this.get('menu.price'); + }).property('menu.price') + }).create({ + menu: ObservableObject.create({ + price: 5 + }) + }); + + equal(depObj.get('menuPrice'), 5, 'precond - initial value returns 5'); + + depObj.set('menu.price', 6); + + equal(depObj.get('menuPrice'), 6, 'cache is properly invalidated after nested property changes'); + }); + + QUnit.test('nested dependent keys should propagate after they update', function () { + var bindObj; + _emberMetal.run(function () { + lookup.DepObj = ObservableObject.extend({ + price: _emberMetal.computed(function () { + return this.get('restaurant.menu.price'); + }).property('restaurant.menu.price') + }).create({ + restaurant: ObservableObject.create({ + menu: ObservableObject.create({ + price: 5 + }) + }) + }); + + expectDeprecation(function () { + bindObj = ObservableObject.extend({ + priceBinding: 'DepObj.price' + }).create(); + }, /`Ember.Binding` is deprecated/); + }); + + equal(bindObj.get('price'), 5, 'precond - binding propagates'); + + _emberMetal.run(function () { + lookup.DepObj.set('restaurant.menu.price', 10); + }); + + equal(bindObj.get('price'), 10, 'binding propagates after a nested dependent keys updates'); + + _emberMetal.run(function () { + lookup.DepObj.set('restaurant.menu', ObservableObject.create({ + price: 15 + })); + }); + + equal(bindObj.get('price'), 15, 'binding propagates after a middle dependent keys updates'); + }); + + QUnit.test('cacheable nested dependent keys should clear after their dependencies update', function () { + ok(true); + + var DepObj; + + _emberMetal.run(function () { + lookup.DepObj = DepObj = ObservableObject.extend({ + price: _emberMetal.computed('restaurant.menu.price', function () { + return this.get('restaurant.menu.price'); + }) + }).create({ + restaurant: ObservableObject.create({ + menu: ObservableObject.create({ + price: 5 + }) + }) + }); + }); + + equal(DepObj.get('price'), 5, 'precond - computed property is correct'); + + _emberMetal.run(function () { + DepObj.set('restaurant.menu.price', 10); + }); + equal(DepObj.get('price'), 10, 'cacheable computed properties are invalidated even if no run loop occurred'); + + _emberMetal.run(function () { + DepObj.set('restaurant.menu.price', 20); + }); + equal(DepObj.get('price'), 20, 'cacheable computed properties are invalidated after a second get before a run loop'); + equal(DepObj.get('price'), 20, 'precond - computed properties remain correct after a run loop'); + + _emberMetal.run(function () { + DepObj.set('restaurant.menu', ObservableObject.create({ + price: 15 + })); + }); + + equal(DepObj.get('price'), 15, 'cacheable computed properties are invalidated after a middle property changes'); + + _emberMetal.run(function () { + DepObj.set('restaurant.menu', ObservableObject.create({ + price: 25 + })); + }); + + equal(DepObj.get('price'), 25, 'cacheable computed properties are invalidated after a middle property changes again, before a run loop'); + }); + + // .......................................................... + // OBSERVABLE OBJECTS + // + + QUnit.module('Observable objects & object properties ', { + setup: function () { + object = ObservableObject.extend({ + getEach: function () { + var keys = ['normal', 'abnormal']; + var ret = []; + for (var idx = 0; idx < keys.length; idx++) { + ret[ret.length] = this.get(keys[idx]); + } + return ret; + }, + + newObserver: function () { + this.abnormal = 'changedValueObserved'; + }, + + testObserver: _emberMetal.observer('normal', function () { + this.abnormal = 'removedObserver'; + }), + + testArrayObserver: _emberMetal.observer('normalArray.[]', function () { + this.abnormal = 'notifiedObserver'; + }) + }).create({ + normal: 'value', + abnormal: 'zeroValue', + numberVal: 24, + toggleVal: true, + observedProperty: 'beingWatched', + testRemove: 'observerToBeRemoved', + normalArray: _emberRuntimeSystemNative_array.A([1, 2, 3, 4, 5]) + }); + } + }); + + QUnit.test('incrementProperty and decrementProperty', function () { + var newValue = object.incrementProperty('numberVal'); + + equal(25, newValue, 'numerical value incremented'); + object.numberVal = 24; + newValue = object.decrementProperty('numberVal'); + equal(23, newValue, 'numerical value decremented'); + object.numberVal = 25; + newValue = object.incrementProperty('numberVal', 5); + equal(30, newValue, 'numerical value incremented by specified increment'); + object.numberVal = 25; + newValue = object.incrementProperty('numberVal', -5); + equal(20, newValue, 'minus numerical value incremented by specified increment'); + object.numberVal = 25; + newValue = object.incrementProperty('numberVal', 0); + equal(25, newValue, 'zero numerical value incremented by specified increment'); + + expectAssertion(function () { + newValue = object.incrementProperty('numberVal', 0 - void 0); // Increment by NaN + }, /Must pass a numeric value to incrementProperty/i); + + expectAssertion(function () { + newValue = object.incrementProperty('numberVal', 'Ember'); // Increment by non-numeric String + }, /Must pass a numeric value to incrementProperty/i); + + expectAssertion(function () { + newValue = object.incrementProperty('numberVal', 1 / 0); // Increment by Infinity + }, /Must pass a numeric value to incrementProperty/i); + + equal(25, newValue, 'Attempting to increment by non-numeric values should not increment value'); + + object.numberVal = 25; + newValue = object.decrementProperty('numberVal', 5); + equal(20, newValue, 'numerical value decremented by specified increment'); + object.numberVal = 25; + newValue = object.decrementProperty('numberVal', -5); + equal(30, newValue, 'minus numerical value decremented by specified increment'); + object.numberVal = 25; + newValue = object.decrementProperty('numberVal', 0); + equal(25, newValue, 'zero numerical value decremented by specified increment'); + + expectAssertion(function () { + newValue = object.decrementProperty('numberVal', 0 - void 0); // Decrement by NaN + }, /Must pass a numeric value to decrementProperty/i); + + expectAssertion(function () { + newValue = object.decrementProperty('numberVal', 'Ember'); // Decrement by non-numeric String + }, /Must pass a numeric value to decrementProperty/i); + + expectAssertion(function () { + newValue = object.decrementProperty('numberVal', 1 / 0); // Decrement by Infinity + }, /Must pass a numeric value to decrementProperty/i); + + equal(25, newValue, 'Attempting to decrement by non-numeric values should not decrement value'); + }); + + QUnit.test('toggle function, should be boolean', function () { + equal(object.toggleProperty('toggleVal', true, false), object.get('toggleVal')); + equal(object.toggleProperty('toggleVal', true, false), object.get('toggleVal')); + equal(object.toggleProperty('toggleVal', undefined, undefined), object.get('toggleVal')); + }); + + QUnit.test('should notify array observer when array changes', function () { + _emberMetal.get(object, 'normalArray').replace(0, 0, 6); + equal(object.abnormal, 'notifiedObserver', 'observer should be notified'); + }); + + QUnit.module('object.addObserver()', { + setup: function () { + ObjectC = ObservableObject.create({ + objectE: ObservableObject.create({ + propertyVal: 'chainedProperty' + }), + + normal: 'value', + normal1: 'zeroValue', + normal2: 'dependentValue', + incrementor: 10, + + action: function () { + this.normal1 = 'newZeroValue'; + }, + + observeOnceAction: function () { + this.incrementor = this.incrementor + 1; + }, + + chainedObserver: function () { + this.normal2 = 'chainedPropertyObserved'; + } + }); + } + }); + + QUnit.test('should register an observer for a property', function () { + ObjectC.addObserver('normal', ObjectC, 'action'); + ObjectC.set('normal', 'newValue'); + equal(ObjectC.normal1, 'newZeroValue'); + }); + + QUnit.test('should register an observer for a property - Special case of chained property', function () { + ObjectC.addObserver('objectE.propertyVal', ObjectC, 'chainedObserver'); + ObjectC.objectE.set('propertyVal', 'chainedPropertyValue'); + equal('chainedPropertyObserved', ObjectC.normal2); + ObjectC.normal2 = 'dependentValue'; + ObjectC.set('objectE', ''); + equal('chainedPropertyObserved', ObjectC.normal2); + }); + + QUnit.module('object.removeObserver()', { + setup: function () { + ObjectD = ObservableObject.create({ + objectF: ObservableObject.create({ + propertyVal: 'chainedProperty' + }), + + normal: 'value', + normal1: 'zeroValue', + normal2: 'dependentValue', + ArrayKeys: ['normal', 'normal1'], + + addAction: function () { + this.normal1 = 'newZeroValue'; + }, + removeAction: function () { + this.normal2 = 'newDependentValue'; + }, + removeChainedObserver: function () { + this.normal2 = 'chainedPropertyObserved'; + }, + + observableValue: 'hello world', + + observer1: function () { + // Just an observer + }, + observer2: function () { + this.removeObserver('observableValue', null, 'observer1'); + this.removeObserver('observableValue', null, 'observer2'); + this.hasObserverFor('observableValue'); // Tickle 'getMembers()' + this.removeObserver('observableValue', null, 'observer3'); + }, + observer3: function () { + // Just an observer + } + }); + } + }); + + QUnit.test('should unregister an observer for a property', function () { + ObjectD.addObserver('normal', ObjectD, 'addAction'); + ObjectD.set('normal', 'newValue'); + equal(ObjectD.normal1, 'newZeroValue'); + + ObjectD.set('normal1', 'zeroValue'); + + ObjectD.removeObserver('normal', ObjectD, 'addAction'); + ObjectD.set('normal', 'newValue'); + equal(ObjectD.normal1, 'zeroValue'); + }); + + QUnit.test('should unregister an observer for a property - special case when key has a \'.\' in it.', function () { + ObjectD.addObserver('objectF.propertyVal', ObjectD, 'removeChainedObserver'); + ObjectD.objectF.set('propertyVal', 'chainedPropertyValue'); + ObjectD.removeObserver('objectF.propertyVal', ObjectD, 'removeChainedObserver'); + ObjectD.normal2 = 'dependentValue'; + ObjectD.objectF.set('propertyVal', 'removedPropertyValue'); + equal('dependentValue', ObjectD.normal2); + ObjectD.set('objectF', ''); + equal('dependentValue', ObjectD.normal2); + }); + + QUnit.test('removing an observer inside of an observer shouldn’t cause any problems', function () { + // The observable system should be protected against clients removing + // observers in the middle of observer notification. + var encounteredError = false; + try { + ObjectD.addObserver('observableValue', null, 'observer1'); + ObjectD.addObserver('observableValue', null, 'observer2'); + ObjectD.addObserver('observableValue', null, 'observer3'); + _emberMetal.run(function () { + ObjectD.set('observableValue', 'hi world'); + }); + } catch (e) { + encounteredError = true; + } + equal(encounteredError, false); + }); + + QUnit.module('Bind function', { + setup: function () { + objectA = ObservableObject.create({ + name: 'Sproutcore', + location: 'Timbaktu' + }); + + objectB = ObservableObject.create({ + normal: 'value', + computed: function () { + this.normal = 'newValue'; + } + }); + + lookup = _emberEnvironment.context.lookup = { + 'Namespace': { + objectA: objectA, + objectB: objectB + } + }; + }, + + teardown: function () { + _emberEnvironment.context.lookup = originalLookup; + } + }); + + QUnit.test('should bind property with method parameter as undefined', function () { + // creating binding + _emberMetal.run(function () { + expectDeprecation(function () { + objectA.bind('name', 'Namespace.objectB.normal', undefined); + }, /`Ember.Binding` is deprecated/); + }); + + // now make a change to see if the binding triggers. + _emberMetal.run(function () { + objectB.set('normal', 'changedValue'); + }); + + // support new-style bindings if available + equal('changedValue', objectA.get('name'), 'objectA.name is bound'); + }); + + // .......................................................... + // SPECIAL CASES + // + + QUnit.test('changing chained observer object to null should not raise exception', function () { + var obj = ObservableObject.create({ + foo: ObservableObject.create({ + bar: ObservableObject.create({ bat: 'BAT' }) + }) + }); + + var callCount = 0; + obj.foo.addObserver('bar.bat', obj, function (target, key, value) { + callCount++; + }); + + _emberMetal.run(function () { + obj.foo.set('bar', null); + }); + + equal(callCount, 1, 'changing bar should trigger observer'); + expect(1); + }); +}); +enifed('ember-runtime/tests/legacy_1x/mixins/observable/observable_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/legacy_1x/mixins/observable'); + test('ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/mixins/observable/observable_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/legacy_1x/mixins/observable'); + QUnit.test('ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/mixins/observable'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeMixinsObservable) { + /* + NOTE: This test is adapted from the 1.x series of unit tests. The tests + are the same except for places where we intend to break the API we instead + validate that we warn the developer appropriately. + + CHANGES FROM 1.6: + + * Create ObservableObject which includes Ember.Observable + */ + + // ======================================================================== + // Ember.Observable Tests + // ======================================================================== + + 'use strict'; + + var ObservableObject = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsObservable.default); + + // .......................................................... + // GET() + // + + QUnit.module('object.observesForKey()'); + + QUnit.test('should get observers', function () { + var o1 = ObservableObject.create({ foo: 100 }); + var o2 = ObservableObject.create({ func: function () {} }); + var o3 = ObservableObject.create({ func: function () {} }); + var observers = null; + + equal(_emberMetal.get(o1.observersForKey('foo'), 'length'), 0, 'o1.observersForKey should return empty array'); + + o1.addObserver('foo', o2, o2.func); + o1.addObserver('foo', o3, o3.func); + + observers = o1.observersForKey('foo'); + + equal(_emberMetal.get(observers, 'length'), 2, 'o2.observersForKey should return an array with length 2'); + equal(observers[0][0], o2, 'first item in observers array should be o2'); + equal(observers[1][0], o3, 'second item in observers array should be o3'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/legacy_1x/mixins/observable'); + test('ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/legacy_1x/mixins/observable'); + QUnit.test('ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test', ['exports', 'ember-runtime/system/object', 'ember-runtime/mixins/observable', 'ember-metal'], function (exports, _emberRuntimeSystemObject, _emberRuntimeMixinsObservable, _emberMetal) { + /* + NOTE: This test is adapted from the 1.x series of unit tests. The tests + are the same except for places where we intend to break the API we instead + validate that we warn the developer appropriately. + + CHANGES FROM 1.6: + + * Create ObservableObject which includes Ember.Observable + * Remove test that tests internal _kvo_changeLevel property. This is an + implementation detail. + * Remove test for allPropertiesDidChange + * Removed star observer test. no longer supported + * Removed property revision test. no longer supported + */ + + // ======================================================================== + // Ember.Observable Tests + // ======================================================================== + + 'use strict'; + + var ObservableObject = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsObservable.default); + + var revMatches = false; + var ObjectA = undefined; + + QUnit.module('object.propertyChanges', { + setup: function () { + ObjectA = ObservableObject.extend({ + action: _emberMetal.observer('foo', function () { + this.set('prop', 'changedPropValue'); + }), + notifyAction: _emberMetal.observer('newFoo', function () { + this.set('newProp', 'changedNewPropValue'); + }), + + notifyAllAction: _emberMetal.observer('prop', function () { + this.set('newFoo', 'changedNewFooValue'); + }), + + starObserver: function (target, key, value, rev) { + revMatches = rev === target.propertyRevision; + this.starProp = key; + } + }).create({ + starProp: null, + + foo: 'fooValue', + prop: 'propValue', + + newFoo: 'newFooValue', + newProp: 'newPropValue' + }); + } + }); + + QUnit.test('should observe the changes within the nested begin / end property changes', function () { + //start the outer nest + ObjectA.beginPropertyChanges(); + + // Inner nest + ObjectA.beginPropertyChanges(); + ObjectA.set('foo', 'changeFooValue'); + + equal(ObjectA.prop, 'propValue'); + ObjectA.endPropertyChanges(); + + //end inner nest + ObjectA.set('prop', 'changePropValue'); + equal(ObjectA.newFoo, 'newFooValue'); + + //close the outer nest + ObjectA.endPropertyChanges(); + + equal(ObjectA.prop, 'changedPropValue'); + equal(ObjectA.newFoo, 'changedNewFooValue'); + }); + + QUnit.test('should observe the changes within the begin and end property changes', function () { + ObjectA.beginPropertyChanges(); + ObjectA.set('foo', 'changeFooValue'); + + equal(ObjectA.prop, 'propValue'); + ObjectA.endPropertyChanges(); + + equal(ObjectA.prop, 'changedPropValue'); + }); + + QUnit.test('should indicate that the property of an object has just changed', function () { + // indicate that property of foo will change to its subscribers + ObjectA.propertyWillChange('foo'); + + //Value of the prop is unchanged yet as this will be changed when foo changes + equal(ObjectA.prop, 'propValue'); + + //change the value of foo. + ObjectA.set('foo', 'changeFooValue'); + + // Indicate the subscribers of foo that the value has just changed + ObjectA.propertyDidChange('foo', null); + + // Values of prop has just changed + equal(ObjectA.prop, 'changedPropValue'); + }); + + QUnit.test('should notify that the property of an object has changed', function () { + // Notify to its subscriber that the values of 'newFoo' will be changed. In this + // case the observer is "newProp". Therefore this will call the notifyAction function + // and value of "newProp" will be changed. + ObjectA.notifyPropertyChange('newFoo', 'fooValue'); + + //value of newProp changed. + equal(ObjectA.newProp, 'changedNewPropValue'); + }); + + QUnit.test('should invalidate function property cache when notifyPropertyChange is called', function () { + var a = ObservableObject.extend({ + b: _emberMetal.computed({ + get: function () { + return this._b; + }, + set: function (key, value) { + this._b = value; + return this; + } + }).volatile() + }).create({ + _b: null + }); + + a.set('b', 'foo'); + equal(a.get('b'), 'foo', 'should have set the correct value for property b'); + + a._b = 'bar'; + a.notifyPropertyChange('b'); + a.set('b', 'foo'); + equal(a.get('b'), 'foo', 'should have invalidated the cache so that the newly set value is actually set'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/legacy_1x/mixins/observable'); + test('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/legacy_1x/mixins/observable'); + QUnit.test('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/binding_test', ['exports', 'ember-environment', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberEnvironment, _emberMetal, _emberRuntimeSystemObject) { + 'use strict'; + + /* + NOTE: This test is adapted from the 1.x series of unit tests. The tests + are the same except for places where we intend to break the API we instead + validate that we warn the developer appropriately. + + CHANGES FROM 1.6: + + * All calls to run.sync() were changed to + run.sync() + + * Bindings no longer accept a root object as their second param. Instead + our test binding objects were put under a single object they could + originate from. + + * tests that inspected internal properties were removed. + + * converted foo.get/foo.set to use get/Ember.set + + * Removed tests for Binding.isConnected. Since binding instances are now + shared this property no longer makes sense. + + * Changed call calls for obj.bind(...) to bind(obj, ...); + + * Changed all calls to sc_super() to this._super(...arguments) + + * Changed all calls to disconnect() to pass the root object. + + * removed calls to Binding.destroy() as that method is no longer useful + (or defined) + + * changed use of T_STRING to 'string' + */ + + // ======================================================================== + // Binding Tests + // ======================================================================== + + var TestNamespace = undefined, + fromObject = undefined, + toObject = undefined, + binding = undefined, + Bon1 = undefined, + bon2 = undefined, + root = undefined; // global variables + var originalLookup = _emberEnvironment.context.lookup; + var lookup = undefined; + + QUnit.module('basic object binding', { + setup: function () { + fromObject = _emberRuntimeSystemObject.default.create({ value: 'start' }); + toObject = _emberRuntimeSystemObject.default.create({ value: 'end' }); + root = { fromObject: fromObject, toObject: toObject }; + _emberMetal.run(function () { + expectDeprecation(function () { + binding = _emberMetal.bind(root, 'toObject.value', 'fromObject.value'); + }, /`Ember\.Binding` is deprecated./); + }); + } + }); + + QUnit.test('binding should have synced on connect', function () { + equal(_emberMetal.get(toObject, 'value'), 'start', 'toObject.value should match fromObject.value'); + }); + + QUnit.test('fromObject change should propagate to toObject only after flush', function () { + _emberMetal.run(function () { + _emberMetal.set(fromObject, 'value', 'change'); + equal(_emberMetal.get(toObject, 'value'), 'start'); + }); + equal(_emberMetal.get(toObject, 'value'), 'change'); + }); + + QUnit.test('toObject change should propagate to fromObject only after flush', function () { + _emberMetal.run(function () { + _emberMetal.set(toObject, 'value', 'change'); + equal(_emberMetal.get(fromObject, 'value'), 'start'); + }); + equal(_emberMetal.get(fromObject, 'value'), 'change'); + }); + + QUnit.test('deferred observing during bindings', function () { + // setup special binding + fromObject = _emberRuntimeSystemObject.default.create({ + value1: 'value1', + value2: 'value2' + }); + + toObject = _emberRuntimeSystemObject.default.extend({ + observer: _emberMetal.observer('value1', 'value2', function () { + equal(_emberMetal.get(this, 'value1'), 'CHANGED', 'value1 when observer fires'); + equal(_emberMetal.get(this, 'value2'), 'CHANGED', 'value2 when observer fires'); + this.callCount++; + }) + }).create({ + value1: 'value1', + value2: 'value2', + + callCount: 0 + }); + + var root = { fromObject: fromObject, toObject: toObject }; + _emberMetal.run(function () { + expectDeprecation(function () { + _emberMetal.bind(root, 'toObject.value1', 'fromObject.value1'); + }, /`Ember\.Binding` is deprecated./); + + expectDeprecation(function () { + _emberMetal.bind(root, 'toObject.value2', 'fromObject.value2'); + }, /`Ember\.Binding` is deprecated./); + + // change both value1 + value2, then flush bindings. observer should only + // fire after bindings are done flushing. + _emberMetal.set(fromObject, 'value1', 'CHANGED'); + _emberMetal.set(fromObject, 'value2', 'CHANGED'); + }); + + equal(toObject.callCount, 2, 'should call observer twice'); + }); + + QUnit.test('binding disconnection actually works', function () { + binding.disconnect(root); + _emberMetal.run(function () { + _emberMetal.set(fromObject, 'value', 'change'); + }); + equal(_emberMetal.get(toObject, 'value'), 'start'); + }); + + var first = undefined, + second = undefined, + third = undefined, + binding1 = undefined, + binding2 = undefined; // global variables + + // .......................................................... + // chained binding + // + + QUnit.module('chained binding', { + + setup: function () { + _emberMetal.run(function () { + first = _emberRuntimeSystemObject.default.create({ output: 'first' }); + + second = _emberRuntimeSystemObject.default.extend({ + inputDidChange: _emberMetal.observer('input', function () { + _emberMetal.set(this, 'output', _emberMetal.get(this, 'input')); + }) + }).create({ + input: 'second', + output: 'second' + }); + + third = _emberRuntimeSystemObject.default.create({ input: 'third' }); + + root = { first: first, second: second, third: third }; + + expectDeprecation(function () { + binding1 = _emberMetal.bind(root, 'second.input', 'first.output'); + }, /`Ember\.Binding` is deprecated./); + + expectDeprecation(function () { + binding2 = _emberMetal.bind(root, 'second.output', 'third.input'); + }, /`Ember\.Binding` is deprecated./); + }); + }, + teardown: function () { + _emberMetal.run.cancelTimers(); + } + }); + + QUnit.test('changing first output should propagate to third after flush', function () { + _emberMetal.run(function () { + _emberMetal.set(first, 'output', 'change'); + equal('change', _emberMetal.get(first, 'output'), 'first.output'); + ok('change' !== _emberMetal.get(third, 'input'), 'third.input'); + }); + + equal('change', _emberMetal.get(first, 'output'), 'first.output'); + equal('change', _emberMetal.get(second, 'input'), 'second.input'); + equal('change', _emberMetal.get(second, 'output'), 'second.output'); + equal('change', _emberMetal.get(third, 'input'), 'third.input'); + }); + + // .......................................................... + // Custom Binding + // + + QUnit.module('Custom Binding', { + setup: function () { + _emberEnvironment.context.lookup = lookup = {}; + + Bon1 = _emberRuntimeSystemObject.default.extend({ + value1: 'hi', + value2: 83, + array1: [] + }); + + bon2 = _emberRuntimeSystemObject.default.create({ + val1: 'hello', + val2: 25, + arr: [1, 2, 3, 4] + }); + + _emberEnvironment.context.lookup['TestNamespace'] = TestNamespace = { + bon2: bon2, + Bon1: Bon1 + }; + }, + teardown: function () { + _emberEnvironment.context.lookup = originalLookup; + Bon1 = bon2 = TestNamespace = null; + _emberMetal.run.cancelTimers(); + } + }); + + QUnit.test('two bindings to the same value should sync in the order they are initialized', function () { + _emberMetal.run.begin(); + + var a = _emberRuntimeSystemObject.default.create({ + foo: 'bar' + }); + + var b = _emberRuntimeSystemObject.default.extend({ + C: _emberRuntimeSystemObject.default.extend({ + foo: 'bee', + fooBinding: 'owner.foo' + }), + + init: function () { + this._super.apply(this, arguments); + _emberMetal.set(this, 'c', this.C.create({ owner: this })); + } + }); + + expectDeprecation(function () { + b = b.create({ + foo: 'baz', + fooBinding: 'a.foo', + a: a + }); + }, /`Ember\.Binding` is deprecated./); + + _emberMetal.run.end(); + + equal(_emberMetal.get(a, 'foo'), 'bar', 'a.foo should not change'); + equal(_emberMetal.get(b, 'foo'), 'bar', 'a.foo should propagate up to b.foo'); + equal(_emberMetal.get(b.c, 'foo'), 'bar', 'a.foo should propagate up to b.c.foo'); + }); + + // .......................................................... + // propertyNameBinding with longhand + // + + QUnit.module('propertyNameBinding with longhand', { + setup: function () { + _emberEnvironment.context.lookup = lookup = {}; + + lookup['TestNamespace'] = TestNamespace = {}; + _emberMetal.run(function () { + TestNamespace.fromObject = _emberRuntimeSystemObject.default.create({ + value: 'originalValue' + }); + + expectDeprecation(function () { + TestNamespace.toObject = _emberRuntimeSystemObject.default.extend({ + valueBinding: _emberMetal.Binding.from('TestNamespace.fromObject.value'), + relativeBinding: _emberMetal.Binding.from('localValue') + }).create({ + localValue: 'originalLocal' + }); + }, /`Ember\.Binding` is deprecated./); + }); + }, + teardown: function () { + TestNamespace = undefined; + _emberEnvironment.context.lookup = originalLookup; + } + }); + + QUnit.test('works with full path', function () { + _emberMetal.run(function () { + return _emberMetal.set(TestNamespace.fromObject, 'value', 'updatedValue'); + }); + + equal(_emberMetal.get(TestNamespace.toObject, 'value'), 'updatedValue'); + + _emberMetal.run(function () { + return _emberMetal.set(TestNamespace.fromObject, 'value', 'newerValue'); + }); + + equal(_emberMetal.get(TestNamespace.toObject, 'value'), 'newerValue'); + }); + + QUnit.test('works with local path', function () { + _emberMetal.run(function () { + return _emberMetal.set(TestNamespace.toObject, 'localValue', 'updatedValue'); + }); + + equal(_emberMetal.get(TestNamespace.toObject, 'relative'), 'updatedValue'); + + _emberMetal.run(function () { + return _emberMetal.set(TestNamespace.toObject, 'localValue', 'newerValue'); + }); + + equal(_emberMetal.get(TestNamespace.toObject, 'relative'), 'newerValue'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/binding_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/legacy_1x/system'); + test('ember-runtime/tests/legacy_1x/system/binding_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/legacy_1x/system/binding_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/binding_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/legacy_1x/system'); + QUnit.test('ember-runtime/tests/legacy_1x/system/binding_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/legacy_1x/system/binding_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/object/base_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { + 'use strict'; + + /* + NOTE: This test is adapted from the 1.x series of unit tests. The tests + are the same except for places where we intend to break the API we instead + validate that we warn the developer appropriately. + + CHANGES FROM 1.6: + + * Changed get(obj, ) and set(obj, ) to Ember.get() and Ember.set() + * Removed obj.instanceOf() and obj.kindOf() tests. use obj instanceof Foo + instead + * Removed respondsTo() and tryToPerform() tests. Can be brought back in a + utils package. + * Removed destroy() test. You can impl yourself but not built in + * Changed Class.subclassOf() test to Class.detect() + * Remove broken test for 'superclass' property. + * Removed obj.didChangeFor() + */ + + // ======================================================================== + // EmberObject Base Tests + // ======================================================================== + + var obj = undefined, + obj1 = undefined, + don = undefined; // global variables + + QUnit.module('A new EmberObject instance', { + + setup: function () { + obj = _emberRuntimeSystemObject.default.create({ + foo: 'bar', + total: 12345, + aMethodThatExists: function () {}, + aMethodThatReturnsTrue: function () { + return true; + }, + aMethodThatReturnsFoobar: function () { + return 'Foobar'; + }, + aMethodThatReturnsFalse: function () { + return false; + } + }); + }, + + teardown: function () { + obj = undefined; + } + + }); + + QUnit.test('Should return its properties when requested using EmberObject#get', function () { + equal(_emberMetal.get(obj, 'foo'), 'bar'); + equal(_emberMetal.get(obj, 'total'), 12345); + }); + + QUnit.test('Should allow changing of those properties by calling EmberObject#set', function () { + equal(_emberMetal.get(obj, 'foo'), 'bar'); + equal(_emberMetal.get(obj, 'total'), 12345); + + _emberMetal.set(obj, 'foo', 'Chunky Bacon'); + _emberMetal.set(obj, 'total', 12); + + equal(_emberMetal.get(obj, 'foo'), 'Chunky Bacon'); + equal(_emberMetal.get(obj, 'total'), 12); + }); + + QUnit.module('EmberObject superclass and subclasses', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + method1: function () { + return 'hello'; + } + }); + obj1 = obj.extend(); + don = obj1.create({ + method2: function () { + return this.superclass(); + } + }); + }, + + teardown: function () { + obj = undefined; + obj1 = undefined; + don = undefined; + } + }); + + QUnit.test('Checking the detect() function on an object and its subclass', function () { + equal(obj.detect(obj1), true); + equal(obj1.detect(obj), false); + }); + + QUnit.test('Checking the detectInstance() function on an object and its subclass', function () { + ok(_emberRuntimeSystemObject.default.detectInstance(obj.create())); + ok(obj.detectInstance(obj.create())); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/object/base_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/legacy_1x/system/object'); + test('ember-runtime/tests/legacy_1x/system/object/base_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/legacy_1x/system/object/base_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/object/base_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/legacy_1x/system/object'); + QUnit.test('ember-runtime/tests/legacy_1x/system/object/base_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/legacy_1x/system/object/base_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test', ['exports', 'ember-environment', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberEnvironment, _emberMetal, _emberRuntimeSystemObject) { + 'use strict'; + + /* + NOTE: This test is adapted from the 1.x series of unit tests. The tests + are the same except for places where we intend to break the API we instead + validate that we warn the developer appropriately. + + CHANGES FROM 1.6: + + * changed Ember.Bending.flushPendingChanges() -> run.sync(); + * changes obj.set() and obj.get() to Ember.set() and Ember.get() + * Fixed an actual bug in unit tests around line 133 + * fixed 'bindings should disconnect on destroy' test to use destroy. + */ + + // ======================================================================== + // EmberObject bindings Tests + // ======================================================================== + + var originalLookup = _emberEnvironment.context.lookup; + var testObject = undefined, + fromObject = undefined, + extraObject = undefined, + TestObject = undefined; + var TestNamespace = undefined, + lookup = undefined; + + QUnit.module('bind() method', { + setup: function () { + _emberEnvironment.context.lookup = lookup = {}; + + testObject = _emberRuntimeSystemObject.default.create({ + foo: 'bar', + bar: 'foo', + extraObject: null + }); + + fromObject = _emberRuntimeSystemObject.default.create({ + bar: 'foo', + extraObject: null + }); + + extraObject = _emberRuntimeSystemObject.default.create({ + foo: 'extraObjectValue' + }); + + lookup['TestNamespace'] = TestNamespace = { + fromObject: fromObject, + testObject: testObject + }; + }, + + teardown: function () { + testObject = fromObject = extraObject = null; + _emberEnvironment.context.lookup = originalLookup; + } + }); + + QUnit.test('bind(TestNamespace.fromObject.bar) should follow absolute path', function () { + _emberMetal.run(function () { + expectDeprecation(function () { + // create binding + testObject.bind('foo', 'TestNamespace.fromObject.bar'); + }, /`Ember.Binding` is deprecated/); + + // now make a change to see if the binding triggers. + _emberMetal.set(fromObject, 'bar', 'changedValue'); + }); + + equal('changedValue', _emberMetal.get(testObject, 'foo'), 'testObject.foo'); + }); + + QUnit.test('bind(.bar) should bind to relative path', function () { + _emberMetal.run(function () { + expectDeprecation(function () { + // create binding + testObject.bind('foo', 'bar'); + }, /`Ember.Binding` is deprecated/); + + // now make a change to see if the binding triggers. + _emberMetal.set(testObject, 'bar', 'changedValue'); + }); + + equal('changedValue', _emberMetal.get(testObject, 'foo'), 'testObject.foo'); + }); + + QUnit.module('fooBinding method', { + setup: function () { + _emberEnvironment.context.lookup = lookup = {}; + + TestObject = _emberRuntimeSystemObject.default.extend({ + foo: 'bar', + bar: 'foo', + extraObject: null + }); + + fromObject = _emberRuntimeSystemObject.default.create({ + bar: 'foo', + extraObject: null + }); + + extraObject = _emberRuntimeSystemObject.default.create({ + foo: 'extraObjectValue' + }); + + lookup['TestNamespace'] = TestNamespace = { + fromObject: fromObject, + testObject: TestObject + }; + }, + + teardown: function () { + _emberEnvironment.context.lookup = originalLookup; + TestObject = fromObject = extraObject = null; + // delete TestNamespace; + } + }); + + var deprecationMessage = /`Ember.Binding` is deprecated/; + + QUnit.test('fooBinding: TestNamespace.fromObject.bar should follow absolute path', function () { + _emberMetal.run(function () { + expectDeprecation(function () { + // create binding + testObject = TestObject.extend({ + fooBinding: 'TestNamespace.fromObject.bar' + }).create(); + }, deprecationMessage); + + // now make a change to see if the binding triggers. + _emberMetal.set(fromObject, 'bar', 'changedValue'); + }); + + equal('changedValue', _emberMetal.get(testObject, 'foo'), 'testObject.foo'); + }); + + QUnit.test('fooBinding: .bar should bind to relative path', function () { + _emberMetal.run(function () { + expectDeprecation(function () { + // create binding + testObject = TestObject.extend({ + fooBinding: 'bar' + }).create(); + }, deprecationMessage); + + // now make a change to see if the binding triggers. + _emberMetal.set(testObject, 'bar', 'changedValue'); + }); + + equal('changedValue', _emberMetal.get(testObject, 'foo'), 'testObject.foo'); + }); + + QUnit.test('fooBinding: should disconnect bindings when destroyed', function () { + _emberMetal.run(function () { + expectDeprecation(function () { + // create binding + testObject = TestObject.extend({ + fooBinding: 'TestNamespace.fromObject.bar' + }).create(); + }, deprecationMessage); + + _emberMetal.set(TestNamespace.fromObject, 'bar', 'BAZ'); + }); + + equal(_emberMetal.get(testObject, 'foo'), 'BAZ', 'binding should have synced'); + + _emberMetal.run(function () { + return testObject.destroy(); + }); + + _emberMetal.run(function () { + return _emberMetal.set(TestNamespace.fromObject, 'bar', 'BIFF'); + }); + + ok(_emberMetal.get(testObject, 'foo') !== 'bar', 'binding should not have synced'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/legacy_1x/system/object'); + test('ember-runtime/tests/legacy_1x/system/object/bindings_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/legacy_1x/system/object/bindings_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/legacy_1x/system/object'); + QUnit.test('ember-runtime/tests/legacy_1x/system/object/bindings_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/legacy_1x/system/object/bindings_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/object/concatenated_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { + 'use strict'; + + /* + NOTE: This test is adapted from the 1.x series of unit tests. The tests + are the same except for places where we intend to break the API we instead + validate that we warn the developer appropriately. + + CHANGES FROM 1.6: + + * changed get(obj, ) and set(obj, ) to Ember.get() and Ember.set() + * converted uses of obj.isEqual() to use deepEqual() test since isEqual is not + always defined + */ + + function K() { + return this; + } + + var klass = undefined; + + QUnit.module('EmberObject Concatenated Properties', { + setup: function () { + klass = _emberRuntimeSystemObject.default.extend({ + concatenatedProperties: ['values', 'functions'], + values: ['a', 'b', 'c'], + functions: [K] + }); + } + }); + + QUnit.test('concatenates instances', function () { + var obj = klass.create({ + values: ['d', 'e', 'f'] + }); + + var values = _emberMetal.get(obj, 'values'); + var expected = ['a', 'b', 'c', 'd', 'e', 'f']; + + deepEqual(values, expected, 'should concatenate values property (expected: ' + expected + ', got: ' + values + ')'); + }); + + QUnit.test('concatenates subclasses', function () { + var subKlass = klass.extend({ + values: ['d', 'e', 'f'] + }); + var obj = subKlass.create(); + + var values = _emberMetal.get(obj, 'values'); + var expected = ['a', 'b', 'c', 'd', 'e', 'f']; + + deepEqual(values, expected, 'should concatenate values property (expected: ' + expected + ', got: ' + values + ')'); + }); + + QUnit.test('concatenates reopen', function () { + klass.reopen({ + values: ['d', 'e', 'f'] + }); + var obj = klass.create(); + + var values = _emberMetal.get(obj, 'values'); + var expected = ['a', 'b', 'c', 'd', 'e', 'f']; + + deepEqual(values, expected, 'should concatenate values property (expected: ' + expected + ', got: ' + values + ')'); + }); + + QUnit.test('concatenates mixin', function () { + var mixin = { + values: ['d', 'e'] + }; + var subKlass = klass.extend(mixin, { + values: ['f'] + }); + var obj = subKlass.create(); + + var values = _emberMetal.get(obj, 'values'); + var expected = ['a', 'b', 'c', 'd', 'e', 'f']; + + deepEqual(values, expected, 'should concatenate values property (expected: ' + expected + ', got: ' + values + ')'); + }); + + QUnit.test('concatenates reopen, subclass, and instance', function () { + klass.reopen({ values: ['d'] }); + var subKlass = klass.extend({ values: ['e'] }); + var obj = subKlass.create({ values: ['f'] }); + + var values = _emberMetal.get(obj, 'values'); + var expected = ['a', 'b', 'c', 'd', 'e', 'f']; + + deepEqual(values, expected, 'should concatenate values property (expected: ' + expected + ', got: ' + values + ')'); + }); + + QUnit.test('concatenates subclasses when the values are functions', function () { + var subKlass = klass.extend({ + functions: K + }); + var obj = subKlass.create(); + + var values = _emberMetal.get(obj, 'functions'); + var expected = [K, K]; + + deepEqual(values, expected, 'should concatenate functions property (expected: ' + expected + ', got: ' + values + ')'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/object/concatenated_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/legacy_1x/system/object'); + test('ember-runtime/tests/legacy_1x/system/object/concatenated_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/legacy_1x/system/object/concatenated_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/object/concatenated_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/legacy_1x/system/object'); + QUnit.test('ember-runtime/tests/legacy_1x/system/object/concatenated_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/legacy_1x/system/object/concatenated_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/run_loop_test', ['exports', 'ember-metal', 'ember-runtime/mixins/observable', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeMixinsObservable, _emberRuntimeSystemObject) { + 'use strict'; + + /* + NOTE: This test is adapted from the 1.x series of unit tests. The tests + are the same except for places where we intend to break the API we instead + validate that we warn the developer appropriately. + + CHANGES FROM 1.6: + + * Updated the API usage for setting up and syncing Binding since these + are not the APIs this file is testing. + + * Disabled a call to invokeOnce() around line 127 because it appeared to be + broken anyway. I don't think it ever even worked. + */ + + var MyApp = undefined, + binding1 = undefined, + binding2 = undefined; + + QUnit.module('System:run_loop() - chained binding', { + setup: function () { + MyApp = {}; + MyApp.first = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsObservable.default).create({ + output: 'MyApp.first' + }); + + MyApp.second = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsObservable.default, { + inputDidChange: _emberMetal.observer('input', function () { + this.set('output', this.get('input')); + }) + }).create({ + input: 'MyApp.second', + output: 'MyApp.second' + }); + + MyApp.third = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsObservable.default).create({ + input: 'MyApp.third' + }); + } + }); + + var deprecationMessage = /`Ember.Binding` is deprecated/; + + QUnit.test('Should propagate bindings after the RunLoop completes (using Ember.RunLoop)', function () { + _emberMetal.run(function () { + //Binding of output of MyApp.first object to input of MyApp.second object + expectDeprecation(function () { + binding1 = _emberMetal.Binding.from('first.output').to('second.input').connect(MyApp); + }, deprecationMessage); + + //Binding of output of MyApp.second object to input of MyApp.third object + expectDeprecation(function () { + binding2 = _emberMetal.Binding.from('second.output').to('third.input').connect(MyApp); + }, deprecationMessage); + }); + + _emberMetal.run(function () { + // Based on the above binding if you change the output of MyApp.first + // object it should change the all the variable of + // MyApp.first,MyApp.second and MyApp.third object + MyApp.first.set('output', 'change'); + + //Changes the output of the MyApp.first object + equal(MyApp.first.get('output'), 'change'); + + //since binding has not taken into effect the value still remains as change. + equal(MyApp.second.get('output'), 'MyApp.first'); + }); // allows bindings to trigger... + + //Value of the output variable changed to 'change' + equal(MyApp.first.get('output'), 'change'); + + //Since binding triggered after the end loop the value changed to 'change'. + equal(MyApp.second.get('output'), 'change'); + }); + + QUnit.test('Should propagate bindings after the RunLoop completes', function () { + _emberMetal.run(function () { + //Binding of output of MyApp.first object to input of MyApp.second object + expectDeprecation(function () { + binding1 = _emberMetal.Binding.from('first.output').to('second.input').connect(MyApp); + }, deprecationMessage); + + //Binding of output of MyApp.second object to input of MyApp.third object + expectDeprecation(function () { + binding2 = _emberMetal.Binding.from('second.output').to('third.input').connect(MyApp); + }, deprecationMessage); + }); + + _emberMetal.run(function () { + //Based on the above binding if you change the output of MyApp.first object it should + //change the all the variable of MyApp.first,MyApp.second and MyApp.third object + MyApp.first.set('output', 'change'); + + //Changes the output of the MyApp.first object + equal(MyApp.first.get('output'), 'change'); + + //since binding has not taken into effect the value still remains as change. + equal(MyApp.second.get('output'), 'MyApp.first'); + }); + + //Value of the output variable changed to 'change' + equal(MyApp.first.get('output'), 'change'); + + //Since binding triggered after the end loop the value changed to 'change'. + equal(MyApp.second.get('output'), 'change'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/run_loop_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/legacy_1x/system'); + test('ember-runtime/tests/legacy_1x/system/run_loop_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/legacy_1x/system/run_loop_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/legacy_1x/system/run_loop_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/legacy_1x/system'); + QUnit.test('ember-runtime/tests/legacy_1x/system/run_loop_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/legacy_1x/system/run_loop_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/main_test', ['exports', 'ember-runtime/index'], function (exports, _emberRuntimeIndex) { + 'use strict'; + + QUnit.module('ember-runtime/main'); + + QUnit.test('Ember.computed.collect', function () { + var MyObj = _emberRuntimeIndex.Object.extend({ + props: _emberRuntimeIndex.collect('foo', 'bar', 'baz') + }); + + var myObj = MyObj.create({ + foo: 3, + bar: 5, + baz: 'asdf' + }); + + var propsValue = myObj.get('props'); + + deepEqual(propsValue, [3, 5, 'asdf']); + }); +}); +enifed('ember-runtime/tests/main_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests'); + test('ember-runtime/tests/main_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/main_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/main_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests'); + QUnit.test('ember-runtime/tests/main_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/main_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/mixins/array_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/tests/suites/array', 'ember-runtime/system/object', 'ember-runtime/mixins/array', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeTestsSuitesArray, _emberRuntimeSystemObject, _emberRuntimeMixinsArray, _emberRuntimeSystemNative_array) { + 'use strict'; + + /* + Implement a basic fake mutable array. This validates that any non-native + enumerable can impl this API. + */ + var TestArray = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsArray.default, { + _content: null, + + init: function () { + var ary = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; + + this._content = ary; + }, + + // some methods to modify the array so we can test changes. Note that + // arrays can be modified even if they don't implement MutableArray. The + // MutableArray is just a standard API for mutation but not required. + addObject: function (obj) { + var idx = this._content.length; + _emberRuntimeMixinsArray.arrayContentWillChange(this, idx, 0, 1); + this._content.push(obj); + _emberRuntimeMixinsArray.arrayContentDidChange(this, idx, 0, 1); + }, + + removeFirst: function (idx) { + _emberRuntimeMixinsArray.arrayContentWillChange(this, 0, 1, 0); + this._content.shift(); + _emberRuntimeMixinsArray.arrayContentDidChange(this, 0, 1, 0); + }, + + objectAt: function (idx) { + return this._content[idx]; + }, + + length: _emberMetal.computed(function () { + return this._content.length; + }) + }); + + _emberRuntimeTestsSuitesArray.ArrayTests.extend({ + + name: 'Basic Mutable Array', + + newObject: function (ary) { + ary = ary ? ary.slice() : this.newFixture(3); + return new TestArray(ary); + }, + + // allows for testing of the basic enumerable after an internal mutation + mutate: function (obj) { + obj.addObject(this.getFixture(1)[0]); + }, + + toArray: function (obj) { + return obj.slice(); + } + + }).run(); + + QUnit.test('the return value of slice has Ember.Array applied', function () { + var x = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsArray.default).create({ + length: 0 + }); + var y = x.slice(1); + equal(_emberRuntimeMixinsArray.default.detect(y), true, 'mixin should be applied'); + }); + + QUnit.test('slice supports negative index arguments', function () { + var testArray = new TestArray([1, 2, 3, 4]); + + deepEqual(testArray.slice(-2), [3, 4], 'slice(-2)'); + deepEqual(testArray.slice(-2, -1), [3], 'slice(-2, -1'); + deepEqual(testArray.slice(-2, -2), [], 'slice(-2, -2)'); + deepEqual(testArray.slice(-1, -2), [], 'slice(-1, -2)'); + + deepEqual(testArray.slice(-4, 1), [1], 'slice(-4, 1)'); + deepEqual(testArray.slice(-4, 5), [1, 2, 3, 4], 'slice(-4, 5)'); + deepEqual(testArray.slice(-4), [1, 2, 3, 4], 'slice(-4)'); + + deepEqual(testArray.slice(0, -1), [1, 2, 3], 'slice(0, -1)'); + deepEqual(testArray.slice(0, -4), [], 'slice(0, -4)'); + deepEqual(testArray.slice(0, -3), [1], 'slice(0, -3)'); + }); + + // .......................................................... + // CONTENT DID CHANGE + // + + var DummyArray = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsArray.default, { + nextObject: function () {}, + length: 0, + objectAt: function (idx) { + return 'ITEM-' + idx; + } + }); + + var obj = undefined, + observer = undefined; + + // .......................................................... + // NOTIFY ARRAY OBSERVERS + // + + QUnit.module('mixins/array/arrayContent[Will|Did]Change'); + + QUnit.test('should notify observers of []', function () { + obj = DummyArray.extend({ + enumerablePropertyDidChange: _emberMetal.observer('[]', function () { + this._count++; + }) + }).create({ + _count: 0 + }); + + equal(obj._count, 0, 'should not have invoked yet'); + + _emberRuntimeMixinsArray.arrayContentWillChange(obj, 0, 1, 1); + _emberRuntimeMixinsArray.arrayContentDidChange(obj, 0, 1, 1); + + equal(obj._count, 1, 'should have invoked'); + }); + + // .......................................................... + // NOTIFY CHANGES TO LENGTH + // + + QUnit.module('notify observers of length', { + setup: function () { + obj = DummyArray.extend({ + lengthDidChange: _emberMetal.observer('length', function () { + this._after++; + }) + }).create({ + _after: 0 + }); + + equal(obj._after, 0, 'should not have fired yet'); + }, + + teardown: function () { + obj = null; + } + }); + + QUnit.test('should notify observers when call with no params', function () { + _emberRuntimeMixinsArray.arrayContentWillChange(obj); + equal(obj._after, 0); + + _emberRuntimeMixinsArray.arrayContentDidChange(obj); + equal(obj._after, 1); + }); + + // API variation that included items only + QUnit.test('should not notify when passed lengths are same', function () { + _emberRuntimeMixinsArray.arrayContentWillChange(obj, 0, 1, 1); + equal(obj._after, 0); + + _emberRuntimeMixinsArray.arrayContentDidChange(obj, 0, 1, 1); + equal(obj._after, 0); + }); + + QUnit.test('should notify when passed lengths are different', function () { + _emberRuntimeMixinsArray.arrayContentWillChange(obj, 0, 1, 2); + equal(obj._after, 0); + + _emberRuntimeMixinsArray.arrayContentDidChange(obj, 0, 1, 2); + equal(obj._after, 1); + }); + + // .......................................................... + // NOTIFY ARRAY OBSERVER + // + + QUnit.module('notify array observers', { + setup: function () { + obj = DummyArray.create(); + + observer = _emberRuntimeSystemObject.default.extend({ + arrayWillChange: function () { + equal(this._before, null); // should only call once + this._before = Array.prototype.slice.call(arguments); + }, + + arrayDidChange: function () { + equal(this._after, null); // should only call once + this._after = Array.prototype.slice.call(arguments); + } + }).create({ + _before: null, + _after: null + }); + + _emberRuntimeMixinsArray.addArrayObserver(obj, observer); + }, + + teardown: function () { + obj = observer = null; + } + }); + + QUnit.test('should notify enumerable observers when called with no params', function () { + _emberRuntimeMixinsArray.arrayContentWillChange(obj); + deepEqual(observer._before, [obj, 0, -1, -1]); + + _emberRuntimeMixinsArray.arrayContentDidChange(obj); + deepEqual(observer._after, [obj, 0, -1, -1]); + }); + + // API variation that included items only + QUnit.test('should notify when called with same length items', function () { + _emberRuntimeMixinsArray.arrayContentWillChange(obj, 0, 1, 1); + deepEqual(observer._before, [obj, 0, 1, 1]); + + _emberRuntimeMixinsArray.arrayContentDidChange(obj, 0, 1, 1); + deepEqual(observer._after, [obj, 0, 1, 1]); + }); + + QUnit.test('should notify when called with diff length items', function () { + _emberRuntimeMixinsArray.arrayContentWillChange(obj, 0, 2, 1); + deepEqual(observer._before, [obj, 0, 2, 1]); + + _emberRuntimeMixinsArray.arrayContentDidChange(obj, 0, 2, 1); + deepEqual(observer._after, [obj, 0, 2, 1]); + }); + + QUnit.test('removing enumerable observer should disable', function () { + _emberRuntimeMixinsArray.removeArrayObserver(obj, observer); + _emberRuntimeMixinsArray.arrayContentWillChange(obj); + deepEqual(observer._before, null); + + _emberRuntimeMixinsArray.arrayContentDidChange(obj); + deepEqual(observer._after, null); + }); + + // .......................................................... + // NOTIFY ENUMERABLE OBSERVER + // + + QUnit.module('notify enumerable observers as well', { + setup: function () { + obj = DummyArray.create(); + + observer = _emberRuntimeSystemObject.default.extend({ + enumerableWillChange: function () { + equal(this._before, null); // should only call once + this._before = Array.prototype.slice.call(arguments); + }, + + enumerableDidChange: function () { + equal(this._after, null); // should only call once + this._after = Array.prototype.slice.call(arguments); + } + }).create({ + _before: null, + _after: null + }); + + obj.addEnumerableObserver(observer); + }, + + teardown: function () { + obj = observer = null; + } + }); + + QUnit.test('should notify enumerable observers when called with no params', function () { + _emberRuntimeMixinsArray.arrayContentWillChange(obj); + deepEqual(observer._before, [obj, null, null], 'before'); + + _emberRuntimeMixinsArray.arrayContentDidChange(obj); + deepEqual(observer._after, [obj, null, null], 'after'); + }); + + // API variation that included items only + QUnit.test('should notify when called with same length items', function () { + _emberRuntimeMixinsArray.arrayContentWillChange(obj, 0, 1, 1); + deepEqual(observer._before, [obj, ['ITEM-0'], 1], 'before'); + + _emberRuntimeMixinsArray.arrayContentDidChange(obj, 0, 1, 1); + deepEqual(observer._after, [obj, 1, ['ITEM-0']], 'after'); + }); + + QUnit.test('should notify when called with diff length items', function () { + _emberRuntimeMixinsArray.arrayContentWillChange(obj, 0, 2, 1); + deepEqual(observer._before, [obj, ['ITEM-0', 'ITEM-1'], 1], 'before'); + + _emberRuntimeMixinsArray.arrayContentDidChange(obj, 0, 2, 1); + deepEqual(observer._after, [obj, 2, ['ITEM-0']], 'after'); + }); + + QUnit.test('removing enumerable observer should disable', function () { + obj.removeEnumerableObserver(observer); + _emberRuntimeMixinsArray.arrayContentWillChange(obj); + deepEqual(observer._before, null, 'before'); + + _emberRuntimeMixinsArray.arrayContentDidChange(obj); + deepEqual(observer._after, null, 'after'); + }); + + // .......................................................... + // @each + // + + var ary = undefined; + + QUnit.module('EmberArray.@each support', { + setup: function () { + ary = new TestArray([{ isDone: true, desc: 'Todo 1' }, { isDone: false, desc: 'Todo 2' }, { isDone: true, desc: 'Todo 3' }, { isDone: false, desc: 'Todo 4' }]); + }, + + teardown: function () { + ary = null; + } + }); + + QUnit.test('adding an object should notify (@each.isDone)', function () { + var called = 0; + + var observerObject = _emberRuntimeSystemObject.default.create({ + wasCalled: function () { + called++; + } + }); + + _emberMetal.addObserver(ary, '@each.isDone', observerObject, 'wasCalled'); + + ary.addObject(_emberRuntimeSystemObject.default.create({ + desc: 'foo', + isDone: false + })); + + equal(called, 1, 'calls observer when object is pushed'); + }); + + QUnit.test('@each is readOnly', function () { + expect(1); + + throws(function () { + _emberMetal.set(ary, '@each', 'foo'); + }, /Cannot set read-only property "@each"/); + }); + + QUnit.test('using @each to observe arrays that does not return objects raise error', function () { + var called = 0; + + var observerObject = _emberRuntimeSystemObject.default.create({ + wasCalled: function () { + called++; + } + }); + + ary = TestArray.create({ + objectAt: function (idx) { + return _emberMetal.get(this._content[idx], 'desc'); + } + }); + + _emberMetal.addObserver(ary, '@each.isDone', observerObject, 'wasCalled'); + + expectAssertion(function () { + ary.addObject(_emberRuntimeSystemObject.default.create({ + desc: 'foo', + isDone: false + })); + }, /When using @each to observe the array/); + + equal(called, 0, 'not calls observer when object is pushed'); + }); + + QUnit.test('modifying the array should also indicate the isDone prop itself has changed', function () { + // NOTE: we never actually get the '@each.isDone' property here. This is + // important because it tests the case where we don't have an isDone + // EachArray materialized but just want to know when the property has + // changed. + + var each = _emberMetal.get(ary, '@each'); + var count = 0; + + _emberMetal.addObserver(each, 'isDone', function () { + return count++; + }); + + count = 0; + var item = _emberRuntimeMixinsArray.objectAt(ary, 2); + _emberMetal.set(item, 'isDone', !_emberMetal.get(item, 'isDone')); + equal(count, 1, '@each.isDone should have notified'); + }); + + QUnit.test('`objectAt` returns correct object', function () { + var arr = ['first', 'second', 'third', 'fourth']; + equal(_emberRuntimeMixinsArray.objectAt(arr, 2), 'third'); + equal(_emberRuntimeMixinsArray.objectAt(arr, 4), undefined); + }); + + _internalTestHelpers.testBoth('should be clear caches for computed properties that have dependent keys on arrays that are changed after object initialization', function (get, set) { + var obj = _emberRuntimeSystemObject.default.extend({ + init: function () { + this._super.apply(this, arguments); + set(this, 'resources', _emberRuntimeSystemNative_array.A()); + }, + + common: _emberMetal.computed('resources.@each.common', function () { + return get(_emberRuntimeMixinsArray.objectAt(get(this, 'resources'), 0), 'common'); + }) + }).create(); + + get(obj, 'resources').pushObject(_emberRuntimeSystemObject.default.create({ common: 'HI!' })); + equal('HI!', get(obj, 'common')); + + set(_emberRuntimeMixinsArray.objectAt(get(obj, 'resources'), 0), 'common', 'BYE!'); + equal('BYE!', get(obj, 'common')); + }); + + _internalTestHelpers.testBoth('observers that contain @each in the path should fire only once the first time they are accessed', function (get, set) { + var count = 0; + + var obj = _emberRuntimeSystemObject.default.extend({ + init: function () { + this._super.apply(this, arguments); + // Observer does not fire on init + set(this, 'resources', _emberRuntimeSystemNative_array.A()); + }, + + commonDidChange: _emberMetal.observer('resources.@each.common', function () { + return count++; + }) + }).create(); + + // Observer fires second time when new object is added + get(obj, 'resources').pushObject(_emberRuntimeSystemObject.default.create({ common: 'HI!' })); + // Observer fires third time when property on an object is changed + set(_emberRuntimeMixinsArray.objectAt(get(obj, 'resources'), 0), 'common', 'BYE!'); + + equal(count, 2, 'observers should only be called once'); + }); +}); +enifed('ember-runtime/tests/mixins/array_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/mixins'); + test('ember-runtime/tests/mixins/array_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/mixins/array_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/mixins/array_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/mixins'); + QUnit.test('ember-runtime/tests/mixins/array_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/mixins/array_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/mixins/comparable_test', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/compare', 'ember-runtime/mixins/comparable'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeCompare, _emberRuntimeMixinsComparable) { + 'use strict'; + + var Rectangle = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsComparable.default, { + length: 0, + width: 0, + + area: function () { + return _emberMetal.get(this, 'length') * _emberMetal.get(this, 'width'); + }, + + compare: function (a, b) { + return _emberRuntimeCompare.default(a.area(), b.area()); + } + + }); + + var r1 = undefined, + r2 = undefined; + + QUnit.module('Comparable', { + setup: function () { + r1 = Rectangle.create({ length: 6, width: 12 }); + r2 = Rectangle.create({ length: 6, width: 13 }); + } + }); + + QUnit.test('should be comparable and return the correct result', function () { + equal(_emberRuntimeMixinsComparable.default.detect(r1), true); + equal(_emberRuntimeCompare.default(r1, r1), 0); + equal(_emberRuntimeCompare.default(r1, r2), -1); + equal(_emberRuntimeCompare.default(r2, r1), 1); + }); +}); +enifed('ember-runtime/tests/mixins/comparable_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/mixins'); + test('ember-runtime/tests/mixins/comparable_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/mixins/comparable_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/mixins/comparable_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/mixins'); + QUnit.test('ember-runtime/tests/mixins/comparable_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/mixins/comparable_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/mixins/container_proxy_test', ['exports', 'ember-utils', 'container', 'ember-runtime/mixins/container_proxy', 'ember-runtime/system/object'], function (exports, _emberUtils, _container, _emberRuntimeMixinsContainer_proxy, _emberRuntimeSystemObject) { + 'use strict'; + + QUnit.module('ember-runtime/mixins/container_proxy', { + setup: function () { + this.Owner = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsContainer_proxy.default); + this.instance = this.Owner.create(); + + var registry = new _container.Registry(); + + this.instance.__container__ = new _container.Container(registry, { + owner: this.instance + }); + } + }); + + QUnit.test('provides ownerInjection helper method', function (assert) { + var result = this.instance.ownerInjection(); + + assert.equal(result[_emberUtils.OWNER], this.instance, 'returns an object with the OWNER symbol'); + }); +}); +enifed('ember-runtime/tests/mixins/container_proxy_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/mixins'); + test('ember-runtime/tests/mixins/container_proxy_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/mixins/container_proxy_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/mixins/container_proxy_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/mixins'); + QUnit.test('ember-runtime/tests/mixins/container_proxy_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/mixins/container_proxy_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/mixins/copyable_test', ['exports', 'ember-utils', 'ember-runtime/tests/suites/copyable', 'ember-runtime/mixins/copyable', 'ember-runtime/mixins/freezable', 'ember-runtime/system/object', 'ember-metal'], function (exports, _emberUtils, _emberRuntimeTestsSuitesCopyable, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsFreezable, _emberRuntimeSystemObject, _emberMetal) { + 'use strict'; + + QUnit.module('Ember.Copyable.frozenCopy'); + + QUnit.test('should be deprecated', function () { + expectDeprecation('`frozenCopy` is deprecated, use `Object.freeze` instead.'); + + var Obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsFreezable.Freezable, _emberRuntimeMixinsCopyable.default, { + copy: function () { + return Obj.create(); + } + }); + + Obj.create().frozenCopy(); + }); + + var CopyableObject = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsCopyable.default, { + id: null, + + init: function () { + this._super.apply(this, arguments); + _emberMetal.set(this, 'id', _emberUtils.generateGuid()); + }, + + copy: function () { + var ret = new CopyableObject(); + _emberMetal.set(ret, 'id', _emberMetal.get(this, 'id')); + return ret; + } + }); + + _emberRuntimeTestsSuitesCopyable.default.extend({ + + name: 'Copyable Basic Test', + + newObject: function () { + return new CopyableObject(); + }, + + isEqual: function (a, b) { + if (!(a instanceof CopyableObject) || !(b instanceof CopyableObject)) { + return false; + } + + return _emberMetal.get(a, 'id') === _emberMetal.get(b, 'id'); + } + }).run(); +}); +enifed('ember-runtime/tests/mixins/copyable_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/mixins'); + test('ember-runtime/tests/mixins/copyable_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/mixins/copyable_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/mixins/copyable_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/mixins'); + QUnit.test('ember-runtime/tests/mixins/copyable_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/mixins/copyable_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/mixins/enumerable_test', ['exports', 'ember-runtime/tests/suites/enumerable', 'ember-runtime/system/object', 'ember-runtime/mixins/enumerable', 'ember-runtime/mixins/array', 'ember-runtime/system/native_array', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesEnumerable, _emberRuntimeSystemObject, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsArray, _emberRuntimeSystemNative_array, _emberMetal) { + 'use strict'; + + function K() { + return this; + } + + /* + Implement a basic fake enumerable. This validates that any non-native + enumerable can impl this API. + */ + var TestEnumerable = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default, { + _content: null, + + init: function () { + var ary = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; + + this._content = ary; + }, + + addObject: function (obj) { + if (this._content.indexOf(obj) >= 0) { + return this; + } + + this._content.push(obj); + this.enumerableContentDidChange(); + }, + + nextObject: function (idx) { + return idx >= _emberMetal.get(this, 'length') ? undefined : this._content[idx]; + }, + + length: _emberMetal.computed(function () { + return this._content.length; + }), + + slice: function () { + return this._content.slice(); + } + + }); + + _emberRuntimeTestsSuitesEnumerable.default.extend({ + name: 'Basic Enumerable', + + newObject: function (ary) { + ary = ary ? ary.slice() : this.newFixture(3); + return new TestEnumerable(ary); + }, + + // allows for testing of the basic enumerable after an internal mutation + mutate: function (obj) { + obj.addObject(obj._content.length + 1); + }, + + toArray: function (obj) { + return obj.slice(); + } + + }).run(); + + QUnit.module('Ember.Enumerable'); + + QUnit.test('should apply Ember.Array to return value of map', function () { + var x = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default).create(); + var y = x.map(K); + equal(_emberRuntimeMixinsArray.default.detect(y), true, 'should have mixin applied'); + }); + + QUnit.test('should apply Ember.Array to return value of filter', function () { + var x = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default).create(); + var y = x.filter(K); + equal(_emberRuntimeMixinsArray.default.detect(y), true, 'should have mixin applied'); + }); + + QUnit.test('should apply Ember.Array to return value of invoke', function () { + var x = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default).create(); + var y = x.invoke(K); + equal(_emberRuntimeMixinsArray.default.detect(y), true, 'should have mixin applied'); + }); + + QUnit.test('should apply Ember.Array to return value of toArray', function () { + var x = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default).create(); + var y = x.toArray(K); + equal(_emberRuntimeMixinsArray.default.detect(y), true, 'should have mixin applied'); + }); + + QUnit.test('should apply Ember.Array to return value of without', function () { + var X = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default, { + contains: function () { + return true; + } + }); + + if (true) { + X.reopen({ + includes: function () { + return true; + } + }); + } + + var x = X.create(); + var y = x.without(K); + equal(_emberRuntimeMixinsArray.default.detect(y), true, 'should have mixin applied'); + }); + + QUnit.test('should apply Ember.Array to return value of uniq', function () { + var x = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default).create(); + var y = x.uniq(K); + equal(_emberRuntimeMixinsArray.default.detect(y), true, 'should have mixin applied'); + }); + + QUnit.test('any', function () { + var kittens = _emberRuntimeSystemNative_array.A([{ + color: 'white' + }, { + color: 'black' + }, { + color: 'white' + }]); + var foundWhite = kittens.any(function (kitten) { + return kitten.color === 'white'; + }); + var foundWhite2 = kittens.isAny('color', 'white'); + + equal(foundWhite, true); + equal(foundWhite2, true); + }); + + QUnit.test('any with NaN', function () { + var numbers = _emberRuntimeSystemNative_array.A([1, 2, NaN, 4]); + + var hasNaN = numbers.any(function (n) { + return isNaN(n); + }); + + equal(hasNaN, true, 'works when matching NaN'); + }); + + QUnit.test('every', function () { + var allColorsKittens = _emberRuntimeSystemNative_array.A([{ + color: 'white' + }, { + color: 'black' + }, { + color: 'white' + }]); + var allWhiteKittens = _emberRuntimeSystemNative_array.A([{ + color: 'white' + }, { + color: 'white' + }, { + color: 'white' + }]); + var allWhite = false; + var whiteKittenPredicate = function (kitten) { + return kitten.color === 'white'; + }; + + allWhite = allColorsKittens.every(whiteKittenPredicate); + equal(allWhite, false); + + allWhite = allWhiteKittens.every(whiteKittenPredicate); + equal(allWhite, true); + + allWhite = allColorsKittens.isEvery('color', 'white'); + equal(allWhite, false); + + allWhite = allWhiteKittens.isEvery('color', 'white'); + equal(allWhite, true); + }); + + if (true) { + QUnit.test('should throw an error passing a second argument to includes', function () { + var x = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default).create(); + + equal(x.includes('any'), false); + expectAssertion(function () { + x.includes('any', 1); + }, /Enumerable#includes cannot accept a second argument "startAt" as enumerable items are unordered./); + }); + } + + // .......................................................... + // CONTENT DID CHANGE + // + + var DummyEnum = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default, { + nextObject: function () {}, + length: 0 + }); + + var obj = undefined, + observer = undefined; + + // .......................................................... + // NOTIFY ENUMERABLE PROPERTY + // + + QUnit.module('mixins/enumerable/enumerableContentDidChange'); + + QUnit.test('should notify observers of []', function () { + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default, { + nextObject: function () {}, // avoid exceptions + + enumerablePropertyDidChange: _emberMetal.observer('[]', function () { + this._count++; + }) + }).create({ + _count: 0 + }); + + equal(obj._count, 0, 'should not have invoked yet'); + obj.enumerableContentWillChange(); + obj.enumerableContentDidChange(); + equal(obj._count, 1, 'should have invoked'); + }); + + // .......................................................... + // NOTIFY CHANGES TO LENGTH + // + + QUnit.module('notify observers of length', { + setup: function () { + obj = DummyEnum.extend({ + lengthDidChange: _emberMetal.observer('length', function () { + this._after++; + }) + }).create({ + _after: 0 + }); + + equal(obj._after, 0, 'should not have fired yet'); + }, + + teardown: function () { + obj = null; + } + }); + + QUnit.test('should notify observers when call with no params', function () { + obj.enumerableContentWillChange(); + equal(obj._after, 0); + + obj.enumerableContentDidChange(); + equal(obj._after, 1); + }); + + // API variation that included items only + QUnit.test('should not notify when passed arrays of same length', function () { + var added = ['foo']; + var removed = ['bar']; + + obj.enumerableContentWillChange(removed, added); + equal(obj._after, 0); + + obj.enumerableContentDidChange(removed, added); + equal(obj._after, 0); + }); + + QUnit.test('should notify when passed arrays of different length', function () { + var added = ['foo']; + var removed = ['bar', 'baz']; + + obj.enumerableContentWillChange(removed, added); + equal(obj._after, 0); + + obj.enumerableContentDidChange(removed, added); + equal(obj._after, 1); + }); + + // API variation passes indexes only + QUnit.test('should not notify when passed with indexes', function () { + obj.enumerableContentWillChange(1, 1); + equal(obj._after, 0); + + obj.enumerableContentDidChange(1, 1); + equal(obj._after, 0); + }); + + QUnit.test('should notify when passed old index API with delta', function () { + obj.enumerableContentWillChange(1, 2); + equal(obj._after, 0); + + obj.enumerableContentDidChange(1, 2); + equal(obj._after, 1); + }); + + // .......................................................... + // NOTIFY ENUMERABLE OBSERVER + // + + QUnit.module('notify enumerable observers', { + setup: function () { + obj = DummyEnum.create(); + + observer = _emberRuntimeSystemObject.default.extend({ + enumerableWillChange: function () { + equal(this._before, null); // should only call once + this._before = Array.prototype.slice.call(arguments); + }, + + enumerableDidChange: function () { + equal(this._after, null); // should only call once + this._after = Array.prototype.slice.call(arguments); + } + }).create({ + _before: null, + _after: null + }); + + obj.addEnumerableObserver(observer); + }, + + teardown: function () { + obj = observer = null; + } + }); + + QUnit.test('should notify enumerable observers when called with no params', function () { + obj.enumerableContentWillChange(); + deepEqual(observer._before, [obj, null, null]); + + obj.enumerableContentDidChange(); + deepEqual(observer._after, [obj, null, null]); + }); + + // API variation that included items only + QUnit.test('should notify when called with same length items', function () { + var added = ['foo']; + var removed = ['bar']; + + obj.enumerableContentWillChange(removed, added); + deepEqual(observer._before, [obj, removed, added]); + + obj.enumerableContentDidChange(removed, added); + deepEqual(observer._after, [obj, removed, added]); + }); + + QUnit.test('should notify when called with diff length items', function () { + var added = ['foo', 'baz']; + var removed = ['bar']; + + obj.enumerableContentWillChange(removed, added); + deepEqual(observer._before, [obj, removed, added]); + + obj.enumerableContentDidChange(removed, added); + deepEqual(observer._after, [obj, removed, added]); + }); + + QUnit.test('should not notify when passed with indexes only', function () { + obj.enumerableContentWillChange(1, 2); + deepEqual(observer._before, [obj, 1, 2]); + + obj.enumerableContentDidChange(1, 2); + deepEqual(observer._after, [obj, 1, 2]); + }); + + QUnit.test('removing enumerable observer should disable', function () { + obj.removeEnumerableObserver(observer); + obj.enumerableContentWillChange(); + deepEqual(observer._before, null); + + obj.enumerableContentDidChange(); + deepEqual(observer._after, null); + }); +}); +enifed('ember-runtime/tests/mixins/enumerable_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/mixins'); + test('ember-runtime/tests/mixins/enumerable_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/mixins/enumerable_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/mixins/enumerable_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/mixins'); + QUnit.test('ember-runtime/tests/mixins/enumerable_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/mixins/enumerable_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/mixins/freezable_test', ['exports', 'ember-runtime/system/object', 'ember-runtime/mixins/freezable'], function (exports, _emberRuntimeSystemObject, _emberRuntimeMixinsFreezable) { + 'use strict'; + + QUnit.module('Ember.Freezable'); + + QUnit.test('should be deprecated', function () { + expectDeprecation('`Ember.Freezable` is deprecated, use `Object.freeze` instead.'); + _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsFreezable.Freezable).create(); + }); +}); +enifed('ember-runtime/tests/mixins/freezable_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/mixins'); + test('ember-runtime/tests/mixins/freezable_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/mixins/freezable_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/mixins/freezable_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/mixins'); + QUnit.test('ember-runtime/tests/mixins/freezable_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/mixins/freezable_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/mixins/mutable_array_test', ['exports', 'ember-metal', 'ember-runtime/tests/suites/mutable_array', 'ember-runtime/mixins/mutable_array', 'ember-runtime/system/object', 'ember-runtime/system/native_array', 'ember-runtime/mixins/array'], function (exports, _emberMetal, _emberRuntimeTestsSuitesMutable_array, _emberRuntimeMixinsMutable_array, _emberRuntimeSystemObject, _emberRuntimeSystemNative_array, _emberRuntimeMixinsArray) { + 'use strict'; + + /* + Implement a basic fake mutable array. This validates that any non-native + enumerable can impl this API. + */ + var TestMutableArray = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsMutable_array.default, { + + _content: null, + + init: function () { + var ary = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; + + this._content = _emberRuntimeSystemNative_array.A(ary); + }, + + replace: function (idx, amt, objects) { + var args = objects ? objects.slice() : []; + var removeAmt = amt; + var addAmt = args.length; + + _emberRuntimeMixinsArray.arrayContentWillChange(this, idx, removeAmt, addAmt); + + args.unshift(amt); + args.unshift(idx); + this._content.splice.apply(this._content, args); + _emberRuntimeMixinsArray.arrayContentDidChange(this, idx, removeAmt, addAmt); + return this; + }, + + objectAt: function (idx) { + return this._content[idx]; + }, + + length: _emberMetal.computed(function () { + return this._content.length; + }), + + slice: function () { + return this._content.slice(); + } + + }); + + _emberRuntimeTestsSuitesMutable_array.default.extend({ + + name: 'Basic Mutable Array', + + newObject: function (ary) { + ary = ary ? ary.slice() : this.newFixture(3); + return new TestMutableArray(ary); + }, + + // allows for testing of the basic enumerable after an internal mutation + mutate: function (obj) { + obj.addObject(this.getFixture(1)[0]); + }, + + toArray: function (obj) { + return obj.slice(); + } + + }).run(); +}); +enifed('ember-runtime/tests/mixins/mutable_array_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/mixins'); + test('ember-runtime/tests/mixins/mutable_array_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/mixins/mutable_array_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/mixins/mutable_array_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/mixins'); + QUnit.test('ember-runtime/tests/mixins/mutable_array_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/mixins/mutable_array_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/mixins/mutable_enumerable_test', ['exports', 'ember-runtime/tests/suites/mutable_enumerable', 'ember-runtime/mixins/mutable_enumerable', 'ember-runtime/system/object', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesMutable_enumerable, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeSystemObject, _emberMetal) { + 'use strict'; + + /* + Implement a basic fake mutable array. This validates that any non-native + enumerable can impl this API. + */ + var TestMutableEnumerable = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsMutable_enumerable.default, { + _content: null, + + addObject: function (obj) { + if (this._content.indexOf(obj) >= 0) { + return this; + } + + this.enumerableContentWillChange(null, [obj]); + this._content.push(obj); + this.enumerableContentDidChange(null, [obj]); + }, + + removeObject: function (obj) { + var idx = this._content.indexOf(obj); + if (idx < 0) { + return this; + } + + this.enumerableContentWillChange([obj], null); + this._content.splice(idx, 1); + this.enumerableContentDidChange([obj], null); + return this; + }, + + init: function (ary) { + this._content = ary || []; + }, + + nextObject: function (idx) { + return idx >= _emberMetal.get(this, 'length') ? undefined : this._content[idx]; + }, + + length: _emberMetal.computed(function () { + return this._content.length; + }), + + slice: function () { + return this._content.slice(); + } + }); + + _emberRuntimeTestsSuitesMutable_enumerable.default.extend({ + name: 'Basic Mutable Array', + + newObject: function (ary) { + ary = ary ? ary.slice() : this.newFixture(3); + return new TestMutableEnumerable(ary); + }, + + // allows for testing of the basic enumerable after an internal mutation + mutate: function (obj) { + obj.addObject(this.getFixture(1)[0]); + }, + + toArray: function (obj) { + return obj.slice(); + } + }).run(); +}); +enifed('ember-runtime/tests/mixins/mutable_enumerable_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/mixins'); + test('ember-runtime/tests/mixins/mutable_enumerable_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/mixins/mutable_enumerable_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/mixins/mutable_enumerable_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/mixins'); + QUnit.test('ember-runtime/tests/mixins/mutable_enumerable_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/mixins/mutable_enumerable_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/mixins/observable_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject) { + 'use strict'; + + QUnit.module('mixins/observable'); + + QUnit.test('should be able to use getProperties to get a POJO of provided keys', function () { + var obj = _emberRuntimeSystemObject.default.create({ + firstName: 'Steve', + lastName: 'Jobs', + companyName: 'Apple, Inc.' + }); + + var pojo = obj.getProperties('firstName', 'lastName'); + equal('Steve', pojo.firstName); + equal('Jobs', pojo.lastName); + }); + + QUnit.test('should be able to use getProperties with array parameter to get a POJO of provided keys', function () { + var obj = _emberRuntimeSystemObject.default.create({ + firstName: 'Steve', + lastName: 'Jobs', + companyName: 'Apple, Inc.' + }); + + var pojo = obj.getProperties(['firstName', 'lastName']); + equal('Steve', pojo.firstName); + equal('Jobs', pojo.lastName); + }); + + QUnit.test('should be able to use setProperties to set multiple properties at once', function () { + var obj = _emberRuntimeSystemObject.default.create({ + firstName: 'Steve', + lastName: 'Jobs', + companyName: 'Apple, Inc.' + }); + + obj.setProperties({ firstName: 'Tim', lastName: 'Cook' }); + equal('Tim', obj.get('firstName')); + equal('Cook', obj.get('lastName')); + }); + + _internalTestHelpers.testBoth('calling setProperties completes safely despite exceptions', function (get, set) { + var exc = new Error('Something unexpected happened!'); + var obj = _emberRuntimeSystemObject.default.extend({ + companyName: _emberMetal.computed({ + get: function () { + return 'Apple, Inc.'; + }, + set: function (key, value) { + throw exc; + } + }) + }).create({ + firstName: 'Steve', + lastName: 'Jobs' + }); + + var firstNameChangedCount = 0; + + _emberMetal.addObserver(obj, 'firstName', function () { + return firstNameChangedCount++; + }); + + try { + obj.setProperties({ + firstName: 'Tim', + lastName: 'Cook', + companyName: 'Fruit Co., Inc.' + }); + } catch (err) { + if (err !== exc) { + throw err; + } + } + + equal(firstNameChangedCount, 1, 'firstName should have fired once'); + }); + + _internalTestHelpers.testBoth('should be able to retrieve cached values of computed properties without invoking the computed property', function (get) { + var obj = _emberRuntimeSystemObject.default.extend({ + foo: _emberMetal.computed(function () { + return 'foo'; + }) + }).create({ + bar: 'bar' + }); + + equal(obj.cacheFor('foo'), undefined, 'should return undefined if no value has been cached'); + get(obj, 'foo'); + + equal(get(obj, 'foo'), 'foo', 'precond - should cache the value'); + equal(obj.cacheFor('foo'), 'foo', 'should return the cached value after it is invoked'); + + equal(obj.cacheFor('bar'), undefined, 'returns undefined if the value is not a computed property'); + }); + + QUnit.test('incrementProperty should work even if value is number in string', function () { + var obj = _emberRuntimeSystemObject.default.create({ + age: '24' + }); + obj.incrementProperty('age'); + equal(25, obj.get('age')); + }); +}); +enifed('ember-runtime/tests/mixins/observable_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/mixins'); + test('ember-runtime/tests/mixins/observable_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/mixins/observable_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/mixins/observable_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/mixins'); + QUnit.test('ember-runtime/tests/mixins/observable_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/mixins/observable_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/mixins/promise_proxy_test', ['exports', 'ember-metal', 'ember-runtime/system/object_proxy', 'ember-runtime/mixins/promise_proxy', 'ember-runtime/ext/rsvp', 'rsvp'], function (exports, _emberMetal, _emberRuntimeSystemObject_proxy, _emberRuntimeMixinsPromise_proxy, _emberRuntimeExtRsvp, _rsvp) { + 'use strict'; + + var ObjectPromiseProxy = undefined; + + QUnit.test('present on ember namespace', function () { + ok(_emberRuntimeMixinsPromise_proxy.default, 'expected PromiseProxyMixin to exist'); + }); + + QUnit.module('Ember.PromiseProxy - ObjectProxy', { + setup: function () { + ObjectPromiseProxy = _emberRuntimeSystemObject_proxy.default.extend(_emberRuntimeMixinsPromise_proxy.default); + }, + + teardown: function () { + _rsvp.on('error', _emberRuntimeExtRsvp.onerrorDefault); + } + }); + + QUnit.test('no promise, invoking then should raise', function () { + var proxy = ObjectPromiseProxy.create(); + + throws(function () { + proxy.then(function () { + return this; + }, function () { + return this; + }); + }, new RegExp('PromiseProxy\'s promise must be set')); + }); + + QUnit.test('fulfillment', function () { + var value = { + firstName: 'stef', + lastName: 'penner' + }; + + var deferred = _rsvp.defer(); + + var proxy = ObjectPromiseProxy.create({ + promise: deferred.promise + }); + + var didFulfillCount = 0; + var didRejectCount = 0; + + proxy.then(function () { + return didFulfillCount++; + }, function () { + return didRejectCount++; + }); + + equal(_emberMetal.get(proxy, 'content'), undefined, 'expects the proxy to have no content'); + equal(_emberMetal.get(proxy, 'reason'), undefined, 'expects the proxy to have no reason'); + equal(_emberMetal.get(proxy, 'isPending'), true, 'expects the proxy to indicate that it is loading'); + equal(_emberMetal.get(proxy, 'isSettled'), false, 'expects the proxy to indicate that it is not settled'); + equal(_emberMetal.get(proxy, 'isRejected'), false, 'expects the proxy to indicate that it is not rejected'); + equal(_emberMetal.get(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled'); + + equal(didFulfillCount, 0, 'should not yet have been fulfilled'); + equal(didRejectCount, 0, 'should not yet have been rejected'); + + _emberMetal.run(deferred, 'resolve', value); + + equal(didFulfillCount, 1, 'should have been fulfilled'); + equal(didRejectCount, 0, 'should not have been rejected'); + + equal(_emberMetal.get(proxy, 'content'), value, 'expects the proxy to have content'); + equal(_emberMetal.get(proxy, 'reason'), undefined, 'expects the proxy to still have no reason'); + equal(_emberMetal.get(proxy, 'isPending'), false, 'expects the proxy to indicate that it is no longer loading'); + equal(_emberMetal.get(proxy, 'isSettled'), true, 'expects the proxy to indicate that it is settled'); + equal(_emberMetal.get(proxy, 'isRejected'), false, 'expects the proxy to indicate that it is not rejected'); + equal(_emberMetal.get(proxy, 'isFulfilled'), true, 'expects the proxy to indicate that it is fulfilled'); + + _emberMetal.run(deferred, 'resolve', value); + + equal(didFulfillCount, 1, 'should still have been only fulfilled once'); + equal(didRejectCount, 0, 'should still not have been rejected'); + + _emberMetal.run(deferred, 'reject', value); + + equal(didFulfillCount, 1, 'should still have been only fulfilled once'); + equal(didRejectCount, 0, 'should still not have been rejected'); + + equal(_emberMetal.get(proxy, 'content'), value, 'expects the proxy to have still have same content'); + equal(_emberMetal.get(proxy, 'reason'), undefined, 'expects the proxy still to have no reason'); + equal(_emberMetal.get(proxy, 'isPending'), false, 'expects the proxy to indicate that it is no longer loading'); + equal(_emberMetal.get(proxy, 'isSettled'), true, 'expects the proxy to indicate that it is settled'); + equal(_emberMetal.get(proxy, 'isRejected'), false, 'expects the proxy to indicate that it is not rejected'); + equal(_emberMetal.get(proxy, 'isFulfilled'), true, 'expects the proxy to indicate that it is fulfilled'); + + // rest of the promise semantics are tested in directly in RSVP + }); + + QUnit.test('rejection', function () { + var reason = new Error('failure'); + var deferred = _rsvp.defer(); + var proxy = ObjectPromiseProxy.create({ + promise: deferred.promise + }); + + var didFulfillCount = 0; + var didRejectCount = 0; + + proxy.then(function () { + return didFulfillCount++; + }, function () { + return didRejectCount++; + }); + + equal(_emberMetal.get(proxy, 'content'), undefined, 'expects the proxy to have no content'); + equal(_emberMetal.get(proxy, 'reason'), undefined, 'expects the proxy to have no reason'); + equal(_emberMetal.get(proxy, 'isPending'), true, 'expects the proxy to indicate that it is loading'); + equal(_emberMetal.get(proxy, 'isSettled'), false, 'expects the proxy to indicate that it is not settled'); + equal(_emberMetal.get(proxy, 'isRejected'), false, 'expects the proxy to indicate that it is not rejected'); + equal(_emberMetal.get(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled'); + + equal(didFulfillCount, 0, 'should not yet have been fulfilled'); + equal(didRejectCount, 0, 'should not yet have been rejected'); + + _emberMetal.run(deferred, 'reject', reason); + + equal(didFulfillCount, 0, 'should not yet have been fulfilled'); + equal(didRejectCount, 1, 'should have been rejected'); + + equal(_emberMetal.get(proxy, 'content'), undefined, 'expects the proxy to have no content'); + equal(_emberMetal.get(proxy, 'reason'), reason, 'expects the proxy to have a reason'); + equal(_emberMetal.get(proxy, 'isPending'), false, 'expects the proxy to indicate that it is not longer loading'); + equal(_emberMetal.get(proxy, 'isSettled'), true, 'expects the proxy to indicate that it is settled'); + equal(_emberMetal.get(proxy, 'isRejected'), true, 'expects the proxy to indicate that it is rejected'); + equal(_emberMetal.get(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled'); + + _emberMetal.run(deferred, 'reject', reason); + + equal(didFulfillCount, 0, 'should stll not yet have been fulfilled'); + equal(didRejectCount, 1, 'should still remain rejected'); + + _emberMetal.run(deferred, 'resolve', 1); + + equal(didFulfillCount, 0, 'should stll not yet have been fulfilled'); + equal(didRejectCount, 1, 'should still remain rejected'); + + equal(_emberMetal.get(proxy, 'content'), undefined, 'expects the proxy to have no content'); + equal(_emberMetal.get(proxy, 'reason'), reason, 'expects the proxy to have a reason'); + equal(_emberMetal.get(proxy, 'isPending'), false, 'expects the proxy to indicate that it is not longer loading'); + equal(_emberMetal.get(proxy, 'isSettled'), true, 'expects the proxy to indicate that it is settled'); + equal(_emberMetal.get(proxy, 'isRejected'), true, 'expects the proxy to indicate that it is rejected'); + equal(_emberMetal.get(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled'); + }); + + QUnit.test('unhandled rejects still propagate to RSVP.on(\'error\', ...) ', function () { + expect(1); + + _rsvp.on('error', onerror); + _rsvp.off('error', _emberRuntimeExtRsvp.onerrorDefault); + + var expectedReason = new Error('failure'); + var deferred = _rsvp.defer(); + + var proxy = ObjectPromiseProxy.create({ + promise: deferred.promise + }); + + proxy.get('promise'); + + function onerror(reason) { + equal(reason, expectedReason, 'expected reason'); + } + + _rsvp.on('error', onerror); + _rsvp.off('error', _emberRuntimeExtRsvp.onerrorDefault); + + _emberMetal.run(deferred, 'reject', expectedReason); + + _rsvp.on('error', _emberRuntimeExtRsvp.onerrorDefault); + _rsvp.off('error', onerror); + + _emberMetal.run(deferred, 'reject', expectedReason); + + _rsvp.on('error', _emberRuntimeExtRsvp.onerrorDefault); + _rsvp.off('error', onerror); + }); + + QUnit.test('should work with promise inheritance', function () { + function PromiseSubclass() { + _rsvp.Promise.apply(this, arguments); + } + + PromiseSubclass.prototype = Object.create(_rsvp.Promise.prototype); + PromiseSubclass.prototype.constructor = PromiseSubclass; + PromiseSubclass.cast = _rsvp.Promise.cast; + + var proxy = ObjectPromiseProxy.create({ + promise: new PromiseSubclass(function () {}) + }); + + ok(proxy.then() instanceof PromiseSubclass, 'promise proxy respected inheritance'); + }); + + QUnit.test('should reset isFulfilled and isRejected when promise is reset', function () { + var deferred = _emberRuntimeExtRsvp.default.defer(); + + var proxy = ObjectPromiseProxy.create({ + promise: deferred.promise + }); + + equal(_emberMetal.get(proxy, 'isPending'), true, 'expects the proxy to indicate that it is loading'); + equal(_emberMetal.get(proxy, 'isSettled'), false, 'expects the proxy to indicate that it is not settled'); + equal(_emberMetal.get(proxy, 'isRejected'), false, 'expects the proxy to indicate that it is not rejected'); + equal(_emberMetal.get(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled'); + + _emberMetal.run(deferred, 'resolve'); + + equal(_emberMetal.get(proxy, 'isPending'), false, 'expects the proxy to indicate that it is no longer loading'); + equal(_emberMetal.get(proxy, 'isSettled'), true, 'expects the proxy to indicate that it is settled'); + equal(_emberMetal.get(proxy, 'isRejected'), false, 'expects the proxy to indicate that it is not rejected'); + equal(_emberMetal.get(proxy, 'isFulfilled'), true, 'expects the proxy to indicate that it is fulfilled'); + + var anotherDeferred = _emberRuntimeExtRsvp.default.defer(); + proxy.set('promise', anotherDeferred.promise); + + equal(_emberMetal.get(proxy, 'isPending'), true, 'expects the proxy to indicate that it is loading'); + equal(_emberMetal.get(proxy, 'isSettled'), false, 'expects the proxy to indicate that it is not settled'); + equal(_emberMetal.get(proxy, 'isRejected'), false, 'expects the proxy to indicate that it is not rejected'); + equal(_emberMetal.get(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled'); + + _emberMetal.run(anotherDeferred, 'reject'); + + equal(_emberMetal.get(proxy, 'isPending'), false, 'expects the proxy to indicate that it is not longer loading'); + equal(_emberMetal.get(proxy, 'isSettled'), true, 'expects the proxy to indicate that it is settled'); + equal(_emberMetal.get(proxy, 'isRejected'), true, 'expects the proxy to indicate that it is rejected'); + equal(_emberMetal.get(proxy, 'isFulfilled'), false, 'expects the proxy to indicate that it is not fulfilled'); + }); + + QUnit.test('should have content when isFulfilled is set', function () { + var deferred = _emberRuntimeExtRsvp.default.defer(); + + var proxy = ObjectPromiseProxy.create({ + promise: deferred.promise + }); + + proxy.addObserver('isFulfilled', function () { + return equal(_emberMetal.get(proxy, 'content'), true); + }); + + _emberMetal.run(deferred, 'resolve', true); + }); + + QUnit.test('should have reason when isRejected is set', function () { + var error = new Error('Y U REJECT?!?'); + var deferred = _emberRuntimeExtRsvp.default.defer(); + + var proxy = ObjectPromiseProxy.create({ + promise: deferred.promise + }); + + proxy.addObserver('isRejected', function () { + return equal(_emberMetal.get(proxy, 'reason'), error); + }); + + try { + _emberMetal.run(deferred, 'reject', error); + } catch (e) { + equal(e, error); + } + }); + + QUnit.test('should not error if promise is resolved after proxy has been destroyed', function () { + var deferred = _emberRuntimeExtRsvp.default.defer(); + + var proxy = ObjectPromiseProxy.create({ + promise: deferred.promise + }); + + proxy.then(function () {}, function () {}); + + _emberMetal.run(proxy, 'destroy'); + + _emberMetal.run(deferred, 'resolve', true); + + ok(true, 'resolving the promise after the proxy has been destroyed does not raise an error'); + }); + + QUnit.test('should not error if promise is rejected after proxy has been destroyed', function () { + var deferred = _emberRuntimeExtRsvp.default.defer(); + + var proxy = ObjectPromiseProxy.create({ + promise: deferred.promise + }); + + proxy.then(function () {}, function () {}); + + _emberMetal.run(proxy, 'destroy'); + + _emberMetal.run(deferred, 'reject', 'some reason'); + + ok(true, 'rejecting the promise after the proxy has been destroyed does not raise an error'); + }); + + QUnit.test('promise chain is not broken if promised is resolved after proxy has been destroyed', function () { + var deferred = _emberRuntimeExtRsvp.default.defer(); + var expectedValue = {}; + var receivedValue = undefined; + var didResolveCount = 0; + + var proxy = ObjectPromiseProxy.create({ + promise: deferred.promise + }); + + proxy.then(function (value) { + receivedValue = value; + didResolveCount++; + }, function () {}); + + _emberMetal.run(proxy, 'destroy'); + + _emberMetal.run(deferred, 'resolve', expectedValue); + + equal(didResolveCount, 1, 'callback called'); + equal(receivedValue, expectedValue, 'passed value is the value the promise was resolved with'); + }); + + QUnit.test('promise chain is not broken if promised is rejected after proxy has been destroyed', function () { + var deferred = _emberRuntimeExtRsvp.default.defer(); + var expectedReason = 'some reason'; + var receivedReason = undefined; + var didRejectCount = 0; + + var proxy = ObjectPromiseProxy.create({ + promise: deferred.promise + }); + + proxy.then(function () {}, function (reason) { + receivedReason = reason; + didRejectCount++; + }); + + _emberMetal.run(proxy, 'destroy'); + + _emberMetal.run(deferred, 'reject', expectedReason); + + equal(didRejectCount, 1, 'callback called'); + equal(receivedReason, expectedReason, 'passed reason is the reason the promise was rejected for'); + }); +}); +enifed('ember-runtime/tests/mixins/promise_proxy_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/mixins'); + test('ember-runtime/tests/mixins/promise_proxy_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/mixins/promise_proxy_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/mixins/promise_proxy_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/mixins'); + QUnit.test('ember-runtime/tests/mixins/promise_proxy_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/mixins/promise_proxy_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/mixins/target_action_support_test', ['exports', 'ember-environment', 'ember-runtime/system/object', 'ember-runtime/mixins/target_action_support'], function (exports, _emberEnvironment, _emberRuntimeSystemObject, _emberRuntimeMixinsTarget_action_support) { + 'use strict'; + + var originalLookup = _emberEnvironment.context.lookup; + var lookup = undefined; + + QUnit.module('TargetActionSupport', { + setup: function () { + _emberEnvironment.context.lookup = lookup = {}; + }, + teardown: function () { + _emberEnvironment.context.lookup = originalLookup; + } + }); + + QUnit.test('it should return false if no target or action are specified', function () { + expect(1); + + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsTarget_action_support.default).create(); + + ok(false === obj.triggerAction(), 'no target or action was specified'); + }); + + QUnit.test('it should support actions specified as strings', function () { + expect(2); + + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsTarget_action_support.default).create({ + target: _emberRuntimeSystemObject.default.create({ + anEvent: function () { + ok(true, 'anEvent method was called'); + } + }), + + action: 'anEvent' + }); + + ok(true === obj.triggerAction(), 'a valid target and action were specified'); + }); + + QUnit.test('it should invoke the send() method on objects that implement it', function () { + expect(3); + + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsTarget_action_support.default).create({ + target: _emberRuntimeSystemObject.default.create({ + send: function (evt, context) { + equal(evt, 'anEvent', 'send() method was invoked with correct event name'); + equal(context, obj, 'send() method was invoked with correct context'); + } + }), + + action: 'anEvent' + }); + + ok(true === obj.triggerAction(), 'a valid target and action were specified'); + }); + + QUnit.test('it should find targets specified using a property path', function () { + expect(2); + + var Test = {}; + lookup.Test = Test; + + Test.targetObj = _emberRuntimeSystemObject.default.create({ + anEvent: function () { + ok(true, 'anEvent method was called on global object'); + } + }); + + var myObj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsTarget_action_support.default).create({ + target: 'Test.targetObj', + action: 'anEvent' + }); + + ok(true === myObj.triggerAction(), 'a valid target and action were specified'); + }); + + QUnit.test('it should use an actionContext object specified as a property on the object', function () { + expect(2); + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsTarget_action_support.default).create({ + action: 'anEvent', + actionContext: {}, + target: _emberRuntimeSystemObject.default.create({ + anEvent: function (ctx) { + ok(obj.actionContext === ctx, 'anEvent method was called with the expected context'); + } + }) + }); + ok(true === obj.triggerAction(), 'a valid target and action were specified'); + }); + + QUnit.test('it should find an actionContext specified as a property path', function () { + expect(2); + + var Test = {}; + lookup.Test = Test; + Test.aContext = {}; + + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsTarget_action_support.default).create({ + action: 'anEvent', + actionContext: 'Test.aContext', + target: _emberRuntimeSystemObject.default.create({ + anEvent: function (ctx) { + ok(Test.aContext === ctx, 'anEvent method was called with the expected context'); + } + }) + }); + + ok(true === obj.triggerAction(), 'a valid target and action were specified'); + }); + + QUnit.test('it should use the target specified in the argument', function () { + expect(2); + var targetObj = _emberRuntimeSystemObject.default.create({ + anEvent: function () { + ok(true, 'anEvent method was called'); + } + }); + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsTarget_action_support.default).create({ + action: 'anEvent' + }); + + ok(true === obj.triggerAction({ target: targetObj }), 'a valid target and action were specified'); + }); + + QUnit.test('it should use the action specified in the argument', function () { + expect(2); + + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsTarget_action_support.default).create({ + target: _emberRuntimeSystemObject.default.create({ + anEvent: function () { + ok(true, 'anEvent method was called'); + } + }) + }); + ok(true === obj.triggerAction({ action: 'anEvent' }), 'a valid target and action were specified'); + }); + + QUnit.test('it should use the actionContext specified in the argument', function () { + expect(2); + var context = {}; + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsTarget_action_support.default).create({ + target: _emberRuntimeSystemObject.default.create({ + anEvent: function (ctx) { + ok(context === ctx, 'anEvent method was called with the expected context'); + } + }), + action: 'anEvent' + }); + + ok(true === obj.triggerAction({ actionContext: context }), 'a valid target and action were specified'); + }); + + QUnit.test('it should allow multiple arguments from actionContext', function () { + expect(3); + var param1 = 'someParam'; + var param2 = 'someOtherParam'; + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsTarget_action_support.default).create({ + target: _emberRuntimeSystemObject.default.create({ + anEvent: function (first, second) { + ok(first === param1, 'anEvent method was called with the expected first argument'); + ok(second === param2, 'anEvent method was called with the expected second argument'); + } + }), + action: 'anEvent' + }); + + ok(true === obj.triggerAction({ actionContext: [param1, param2] }), 'a valid target and action were specified'); + }); + + QUnit.test('it should use a null value specified in the actionContext argument', function () { + expect(2); + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsTarget_action_support.default).create({ + target: _emberRuntimeSystemObject.default.create({ + anEvent: function (ctx) { + ok(null === ctx, 'anEvent method was called with the expected context (null)'); + } + }), + action: 'anEvent' + }); + ok(true === obj.triggerAction({ actionContext: null }), 'a valid target and action were specified'); + }); +}); +enifed('ember-runtime/tests/mixins/target_action_support_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/mixins'); + test('ember-runtime/tests/mixins/target_action_support_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/mixins/target_action_support_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/mixins/target_action_support_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/mixins'); + QUnit.test('ember-runtime/tests/mixins/target_action_support_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/mixins/target_action_support_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/array', ['exports', 'ember-runtime/tests/suites/enumerable', 'ember-runtime/tests/suites/array/indexOf', 'ember-runtime/tests/suites/array/lastIndexOf', 'ember-runtime/tests/suites/array/objectAt', 'ember-runtime/tests/suites/array/includes', 'ember-runtime/mixins/array', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesEnumerable, _emberRuntimeTestsSuitesArrayIndexOf, _emberRuntimeTestsSuitesArrayLastIndexOf, _emberRuntimeTestsSuitesArrayObjectAt, _emberRuntimeTestsSuitesArrayIncludes, _emberRuntimeMixinsArray, _emberMetal) { + 'use strict'; + + var ObserverClass = _emberRuntimeTestsSuitesEnumerable.ObserverClass.extend({ + observeArray: function (obj) { + _emberRuntimeMixinsArray.addArrayObserver(obj, this); + return this; + }, + + stopObserveArray: function (obj) { + _emberRuntimeMixinsArray.removeArrayObserver(obj, this); + return this; + }, + + arrayWillChange: function () { + equal(this._before, null, 'should only call once'); + this._before = Array.prototype.slice.call(arguments); + }, + + arrayDidChange: function () { + equal(this._after, null, 'should only call once'); + this._after = Array.prototype.slice.call(arguments); + } + }); + + var ArrayTests = _emberRuntimeTestsSuitesEnumerable.EnumerableTests.extend({ + observerClass: ObserverClass + }); + + ArrayTests.ObserverClass = ObserverClass; + + ArrayTests.importModuleTests(_emberRuntimeTestsSuitesArrayIndexOf.default); + ArrayTests.importModuleTests(_emberRuntimeTestsSuitesArrayLastIndexOf.default); + ArrayTests.importModuleTests(_emberRuntimeTestsSuitesArrayObjectAt.default); + + if (true) { + ArrayTests.importModuleTests(_emberRuntimeTestsSuitesArrayIncludes.default); + } + + exports.ArrayTests = ArrayTests; + exports.ObserverClass = ObserverClass; +}); +enifed('ember-runtime/tests/suites/array.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites'); + test('ember-runtime/tests/suites/array.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/array.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/array.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites'); + QUnit.test('ember-runtime/tests/suites/array.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/array.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/array/includes', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('includes'); + + suite.test('includes returns correct value if startAt is positive', function () { + var data = this.newFixture(3); + var obj = this.newObject(data); + + equal(obj.includes(data[1], 1), true, 'should return true if included'); + equal(obj.includes(data[0], 1), false, 'should return false if not included'); + }); + + suite.test('includes returns correct value if startAt is negative', function () { + var data = this.newFixture(3); + var obj = this.newObject(data); + + equal(obj.includes(data[1], -2), true, 'should return true if included'); + equal(obj.includes(data[0], -2), false, 'should return false if not included'); + }); + + suite.test('includes returns true if startAt + length is still negative', function () { + var data = this.newFixture(1); + var obj = this.newObject(data); + + equal(obj.includes(data[0], -2), true, 'should return true if included'); + equal(obj.includes(this.newFixture(1), -2), false, 'should return false if not included'); + }); + + suite.test('includes returns false if startAt out of bounds', function () { + var data = this.newFixture(1); + var obj = this.newObject(data); + + equal(obj.includes(data[0], 2), false, 'should return false if startAt >= length'); + equal(obj.includes(this.newFixture(1), 2), false, 'should return false if startAt >= length'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/array/includes.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/array'); + test('ember-runtime/tests/suites/array/includes.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/array/includes.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/array/includes.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/array'); + QUnit.test('ember-runtime/tests/suites/array/includes.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/array/includes.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/array/indexOf', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('indexOf'); + + suite.test('should return index of object', function () { + var expected = this.newFixture(3); + var obj = this.newObject(expected); + var len = 3; + + for (var idx = 0; idx < len; idx++) { + equal(obj.indexOf(expected[idx]), idx, 'obj.indexOf(' + expected[idx] + ') should match idx'); + } + }); + + suite.test('should return -1 when requesting object not in index', function () { + var obj = this.newObject(this.newFixture(3)); + var foo = {}; + + equal(obj.indexOf(foo), -1, 'obj.indexOf(foo) should be < 0'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/array/indexOf.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/array'); + test('ember-runtime/tests/suites/array/indexOf.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/array/indexOf.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/array/indexOf.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/array'); + QUnit.test('ember-runtime/tests/suites/array/indexOf.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/array/indexOf.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/array/lastIndexOf', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('lastIndexOf'); + + suite.test('should return index of object\'s last occurrence', function () { + var expected = this.newFixture(3); + var obj = this.newObject(expected); + var len = 3; + + for (var idx = 0; idx < len; idx++) { + equal(obj.lastIndexOf(expected[idx]), idx, 'obj.lastIndexOf(' + expected[idx] + ') should match idx'); + } + }); + + suite.test('should return index of object\'s last occurrence even startAt search location is equal to length', function () { + var expected = this.newFixture(3); + var obj = this.newObject(expected); + var len = 3; + + for (var idx = 0; idx < len; idx++) { + equal(obj.lastIndexOf(expected[idx], len), idx, 'obj.lastIndexOfs(' + expected[idx] + ') should match idx'); + } + }); + + suite.test('should return index of object\'s last occurrence even startAt search location is greater than length', function () { + var expected = this.newFixture(3); + var obj = this.newObject(expected); + var len = 3; + + for (var idx = 0; idx < len; idx++) { + equal(obj.lastIndexOf(expected[idx], len + 1), idx, 'obj.lastIndexOf(' + expected[idx] + ') should match idx'); + } + }); + + suite.test('should return -1 when no match is found', function () { + var obj = this.newObject(this.newFixture(3)); + var foo = {}; + + equal(obj.lastIndexOf(foo), -1, 'obj.lastIndexOf(foo) should be -1'); + }); + + suite.test('should return -1 when no match is found even startAt search location is equal to length', function () { + var obj = this.newObject(this.newFixture(3)); + var foo = {}; + + equal(obj.lastIndexOf(foo, obj.length), -1, 'obj.lastIndexOf(foo) should be -1'); + }); + + suite.test('should return -1 when no match is found even startAt search location is greater than length', function () { + var obj = this.newObject(this.newFixture(3)); + var foo = {}; + + equal(obj.lastIndexOf(foo, obj.length + 1), -1, 'obj.lastIndexOf(foo) should be -1'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/array/lastIndexOf.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/array'); + test('ember-runtime/tests/suites/array/lastIndexOf.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/array/lastIndexOf.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/array/lastIndexOf.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/array'); + QUnit.test('ember-runtime/tests/suites/array/lastIndexOf.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/array/lastIndexOf.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/array/objectAt', ['exports', 'ember-runtime/tests/suites/suite', 'ember-runtime/mixins/array'], function (exports, _emberRuntimeTestsSuitesSuite, _emberRuntimeMixinsArray) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('objectAt'); + + suite.test('should return object at specified index', function () { + var expected = this.newFixture(3); + var obj = this.newObject(expected); + var len = expected.length; + + for (var idx = 0; idx < len; idx++) { + equal(_emberRuntimeMixinsArray.objectAt(obj, idx), expected[idx], 'obj.objectAt(' + idx + ') should match'); + } + }); + + suite.test('should return undefined when requesting objects beyond index', function () { + var obj = undefined; + + obj = this.newObject(this.newFixture(3)); + equal(_emberRuntimeMixinsArray.objectAt(obj, 5), undefined, 'should return undefined for obj.objectAt(5) when len = 3'); + + obj = this.newObject([]); + equal(_emberRuntimeMixinsArray.objectAt(obj, 0), undefined, 'should return undefined for obj.objectAt(0) when len = 0'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/array/objectAt.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/array'); + test('ember-runtime/tests/suites/array/objectAt.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/array/objectAt.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/array/objectAt.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/array'); + QUnit.test('ember-runtime/tests/suites/array/objectAt.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/array/objectAt.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/copyable', ['exports', 'ember-runtime/tests/suites/suite', 'ember-runtime/tests/suites/copyable/copy', 'ember-runtime/tests/suites/copyable/frozenCopy'], function (exports, _emberRuntimeTestsSuitesSuite, _emberRuntimeTestsSuitesCopyableCopy, _emberRuntimeTestsSuitesCopyableFrozenCopy) { + 'use strict'; + + var CopyableTests = _emberRuntimeTestsSuitesSuite.Suite.extend({ + + /* + __Required.__ You must implement this method to apply this mixin. + Must be able to create a new object for testing. + @returns {Object} object + */ + newObject: null, + + /* + __Required.__ You must implement this method to apply this mixin. + Compares the two passed in objects. Returns true if the two objects + are logically equivalent. + @param {Object} a + First object + @param {Object} b + Second object + @returns {Boolean} + */ + isEqual: null, + + /* + Set this to true if you expect the objects you test to be freezable. + The suite will verify that your objects actually match this. (i.e. if + you say you can't test freezable it will verify that your objects really + aren't freezable.) + @type Boolean + */ + shouldBeFreezable: false + + }); + + CopyableTests.importModuleTests(_emberRuntimeTestsSuitesCopyableCopy.default); + CopyableTests.importModuleTests(_emberRuntimeTestsSuitesCopyableFrozenCopy.default); + + exports.default = CopyableTests; +}); +enifed('ember-runtime/tests/suites/copyable.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites'); + test('ember-runtime/tests/suites/copyable.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/copyable.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/copyable.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites'); + QUnit.test('ember-runtime/tests/suites/copyable.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/copyable.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/copyable/copy', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('copy'); + + suite.test('should return an equivalent copy', function () { + var obj = this.newObject(); + var copy = obj.copy(); + ok(this.isEqual(obj, copy), 'old object and new object should be equivalent'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/copyable/copy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/copyable'); + test('ember-runtime/tests/suites/copyable/copy.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/copyable/copy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/copyable/copy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/copyable'); + QUnit.test('ember-runtime/tests/suites/copyable/copy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/copyable/copy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/copyable/frozenCopy', ['exports', 'ember-runtime/tests/suites/suite', 'ember-runtime/mixins/freezable', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberRuntimeMixinsFreezable, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('frozenCopy'); + + suite.test('frozen objects should return same instance', function () { + var obj = undefined, + copy = undefined; + + obj = this.newObject(); + if (_emberMetal.get(this, 'shouldBeFreezable')) { + expectDeprecation('`frozenCopy` is deprecated, use Object.freeze instead.'); + + ok(!_emberRuntimeMixinsFreezable.Freezable || _emberRuntimeMixinsFreezable.Freezable.detect(obj), 'object should be freezable'); + + copy = obj.frozenCopy(); + ok(this.isEqual(obj, copy), 'new copy should be equal'); + ok(_emberMetal.get(copy, 'isFrozen'), 'returned value should be frozen'); + + copy = obj.freeze().frozenCopy(); + equal(copy, obj, 'returns frozen object should be same'); + ok(_emberMetal.get(copy, 'isFrozen'), 'returned object should be frozen'); + } else { + ok(!_emberRuntimeMixinsFreezable.Freezable || !_emberRuntimeMixinsFreezable.Freezable.detect(obj), 'object should not be freezable'); + } + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/copyable/frozenCopy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/copyable'); + test('ember-runtime/tests/suites/copyable/frozenCopy.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/copyable/frozenCopy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/copyable/frozenCopy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/copyable'); + QUnit.test('ember-runtime/tests/suites/copyable/frozenCopy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/copyable/frozenCopy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable', ['exports', 'ember-utils', 'ember-runtime/tests/suites/suite', 'ember-runtime/system/object', 'ember-metal', 'ember-runtime/tests/suites/enumerable/any', 'ember-runtime/tests/suites/enumerable/is_any', 'ember-runtime/tests/suites/enumerable/compact', 'ember-runtime/tests/suites/enumerable/contains', 'ember-runtime/tests/suites/enumerable/includes', 'ember-runtime/tests/suites/enumerable/every', 'ember-runtime/tests/suites/enumerable/filter', 'ember-runtime/tests/suites/enumerable/find', 'ember-runtime/tests/suites/enumerable/firstObject', 'ember-runtime/tests/suites/enumerable/forEach', 'ember-runtime/tests/suites/enumerable/mapBy', 'ember-runtime/tests/suites/enumerable/invoke', 'ember-runtime/tests/suites/enumerable/lastObject', 'ember-runtime/tests/suites/enumerable/map', 'ember-runtime/tests/suites/enumerable/reduce', 'ember-runtime/tests/suites/enumerable/reject', 'ember-runtime/tests/suites/enumerable/sortBy', 'ember-runtime/tests/suites/enumerable/toArray', 'ember-runtime/tests/suites/enumerable/uniq', 'ember-runtime/tests/suites/enumerable/uniqBy', 'ember-runtime/tests/suites/enumerable/without'], function (exports, _emberUtils, _emberRuntimeTestsSuitesSuite, _emberRuntimeSystemObject, _emberMetal, _emberRuntimeTestsSuitesEnumerableAny, _emberRuntimeTestsSuitesEnumerableIs_any, _emberRuntimeTestsSuitesEnumerableCompact, _emberRuntimeTestsSuitesEnumerableContains, _emberRuntimeTestsSuitesEnumerableIncludes, _emberRuntimeTestsSuitesEnumerableEvery, _emberRuntimeTestsSuitesEnumerableFilter, _emberRuntimeTestsSuitesEnumerableFind, _emberRuntimeTestsSuitesEnumerableFirstObject, _emberRuntimeTestsSuitesEnumerableForEach, _emberRuntimeTestsSuitesEnumerableMapBy, _emberRuntimeTestsSuitesEnumerableInvoke, _emberRuntimeTestsSuitesEnumerableLastObject, _emberRuntimeTestsSuitesEnumerableMap, _emberRuntimeTestsSuitesEnumerableReduce, _emberRuntimeTestsSuitesEnumerableReject, _emberRuntimeTestsSuitesEnumerableSortBy, _emberRuntimeTestsSuitesEnumerableToArray, _emberRuntimeTestsSuitesEnumerableUniq, _emberRuntimeTestsSuitesEnumerableUniqBy, _emberRuntimeTestsSuitesEnumerableWithout) { + 'use strict'; + + var ObserverClass = _emberRuntimeSystemObject.default.extend({ + _keysBefore: null, + _keys: null, + _values: null, + _before: null, + _after: null, + + isEnabled: true, + + init: function () { + this._super.apply(this, arguments); + this.reset(); + }, + + propertyWillChange: function (target, key) { + if (this._keysBefore[key] === undefined) { + this._keysBefore[key] = 0; + } + this._keysBefore[key]++; + }, + + /* + Invoked when the property changes. Just records the parameters for + later analysis. + */ + propertyDidChange: function (target, key, value) { + if (this._keys[key] === undefined) { + this._keys[key] = 0; + } + this._keys[key]++; + this._values[key] = value; + }, + + /* + Resets the recorded results for another run. + @returns {Object} receiver + */ + reset: function () { + this._keysBefore = {}; + this._keys = {}; + this._values = {}; + this._before = null; + this._after = null; + return this; + }, + + observeBefore: function (obj) { + var keys = Array.prototype.slice.call(arguments, 1); + var loc = keys.length; + while (--loc >= 0) { + _emberMetal._addBeforeObserver(obj, keys[loc], this, 'propertyWillChange'); + } + + return this; + }, + + /* + Begins observing the passed key names on the passed object. Any changes + on the named properties will be recorded. + @param {Ember.Enumerable} obj + The enumerable to observe. + @returns {Object} receiver + */ + observe: function (obj) { + if (obj.addObserver) { + var keys = Array.prototype.slice.call(arguments, 1); + var loc = keys.length; + + while (--loc >= 0) { + obj.addObserver(keys[loc], this, 'propertyDidChange'); + } + } else { + this.isEnabled = false; + } + return this; + }, + + /* + Returns true if the passed key was invoked. If you pass a value as + well then validates that the values match. + @param {String} key + Key to validate + @param {Object} value + (Optional) value + @returns {Boolean} + */ + validate: function (key, value) { + if (!this.isEnabled) { + return true; + } + + if (!this._keys[key]) { + return false; + } + + if (arguments.length > 1) { + return this._values[key] === value; + } else { + return true; + } + }, + + /* + Returns times the before observer as invoked. + @param {String} key + Key to check + */ + timesCalledBefore: function (key) { + return this._keysBefore[key] || 0; + }, + + /* + Returns times the observer as invoked. + @param {String} key + Key to check + */ + timesCalled: function (key) { + return this._keys[key] || 0; + }, + + /* + begins acting as an enumerable observer. + */ + observeEnumerable: function (obj) { + obj.addEnumerableObserver(this); + return this; + }, + + stopObserveEnumerable: function (obj) { + obj.removeEnumerableObserver(this); + return this; + }, + + enumerableWillChange: function () { + equal(this._before, null, 'should only call once'); + this._before = Array.prototype.slice.call(arguments); + }, + + enumerableDidChange: function () { + equal(this._after, null, 'should only call once'); + this._after = Array.prototype.slice.call(arguments); + } + }); + + var EnumerableTests = _emberRuntimeTestsSuitesSuite.Suite.extend({ + /* + __Required.__ You must implement this method to apply this mixin. + Implement to return a new enumerable object for testing. Should accept + either no parameters, a single number (indicating the desired length of + the collection) or an array of objects. + @param {Array} content + An array of items to include in the enumerable optionally. + @returns {Ember.Enumerable} a new enumerable + */ + newObject: null, + + /* + Implement to return a set of new fixture strings that can be applied to + the enumerable. This may be passed into the newObject method. + @param {Number} count + The number of items required. + @returns {Array} array of strings + */ + newFixture: function (cnt) { + var ret = []; + while (--cnt >= 0) { + ret.push(_emberUtils.generateGuid()); + } + + return ret; + }, + + /* + Implement to return a set of new fixture objects that can be applied to + the enumerable. This may be passed into the newObject method. + @param {Number} cnt + The number of items required. + @returns {Array} array of objects + */ + newObjectsFixture: function (cnt) { + var ret = []; + var item = undefined; + while (--cnt >= 0) { + item = {}; + _emberUtils.guidFor(item); + ret.push(item); + } + return ret; + }, + + /* + __Required.__ You must implement this method to apply this mixin. + Implement accept an instance of the enumerable and return an array + containing the objects in the enumerable. This is used only for testing + so performance is not important. + @param {Ember.Enumerable} enumerable + The enumerable to convert. + @returns {Array} array of items + */ + toArray: null, + + /* + Implement this method if your object can mutate internally (even if it + does not support the MutableEnumerable API). The method should accept + an object of your desired type and modify it somehow. Suite tests will + use this to ensure that all appropriate caches, etc. clear when the + mutation occurs. + If you do not define this optional method, then mutation-related tests + will be skipped. + @param {Ember.Enumerable} enumerable + The enumerable to mutate + @returns {void} + */ + mutate: function () {}, + + /* + Becomes true when you define a new mutate() method, indicating that + mutation tests should run. This is calculated automatically. + @type Boolean + */ + canTestMutation: _emberMetal.computed(function () { + return this.mutate !== EnumerableTests.prototype.mutate; + }), + + /* + Invoked to actually run the test - overridden by mixins + */ + run: function () {}, + + /* + Creates a new observer object for testing. You can add this object as an + observer on an array and it will record results anytime it is invoked. + After running the test, call the validate() method on the observer to + validate the results. + */ + newObserver: function (obj) { + var ret = _emberMetal.get(this, 'observerClass').create(); + if (arguments.length > 0) { + ret.observeBefore.apply(ret, arguments); + } + + if (arguments.length > 0) { + ret.observe.apply(ret, arguments); + } + + return ret; + }, + + observerClass: ObserverClass + }); + + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableAny.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableIs_any.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableCompact.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableContains.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableEvery.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableFilter.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableFind.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableFirstObject.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableForEach.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableMapBy.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableInvoke.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableLastObject.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableMap.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableReduce.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableReject.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableSortBy.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableToArray.default); + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableUniq.default); + + if (true) { + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableUniqBy.default); + } + + if (true) { + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableIncludes.default); + } + + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableWithout.default); + + exports.default = EnumerableTests; + exports.EnumerableTests = EnumerableTests; + exports.ObserverClass = ObserverClass; +}); +enifed('ember-runtime/tests/suites/enumerable.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites'); + test('ember-runtime/tests/suites/enumerable.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites'); + QUnit.test('ember-runtime/tests/suites/enumerable.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/any', ['exports', 'ember-runtime/tests/suites/suite', 'ember-runtime/system/native_array'], function (exports, _emberRuntimeTestsSuitesSuite, _emberRuntimeSystemNative_array) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + // .......................................................... + // any() + // + + suite.module('any'); + + suite.test('any should should invoke callback on each item as long as you return false', function () { + var obj = this.newObject(); + var ary = this.toArray(obj); + var found = []; + var result = undefined; + + result = obj.any(function (i) { + found.push(i); + return false; + }); + equal(result, false, 'return value of obj.any'); + deepEqual(found, ary, 'items passed during any() should match'); + }); + + suite.test('any should stop invoking when you return true', function () { + var obj = this.newObject(); + var ary = this.toArray(obj); + var cnt = ary.length - 2; + var exp = cnt; + var found = []; + var result = undefined; + + result = obj.any(function (i) { + found.push(i); + return --cnt <= 0; + }); + equal(result, true, 'return value of obj.any'); + equal(found.length, exp, 'should invoke proper number of times'); + deepEqual(found, ary.slice(0, -2), 'items passed during any() should match'); + }); + + suite.test('any should return true if any object matches the callback', function () { + var obj = _emberRuntimeSystemNative_array.A([0, 1, 2]); + var result = undefined; + + result = obj.any(function (i) { + return !!i; + }); + equal(result, true, 'return value of obj.any'); + }); + + suite.test('any should return false if no object matches the callback', function () { + var obj = _emberRuntimeSystemNative_array.A([0, null, false]); + var result = undefined; + + result = obj.any(function (i) { + return !!i; + }); + equal(result, false, 'return value of obj.any'); + }); + + suite.test('any should produce correct results even if the matching element is undefined', function () { + var obj = _emberRuntimeSystemNative_array.A([undefined]); + var result = undefined; + + result = obj.any(function (i) { + return true; + }); + equal(result, true, 'return value of obj.any'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/any.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/any.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/any.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/any.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/any.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/any.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/compact', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('compact'); + + suite.test('removes null and undefined values from enumerable', function () { + var obj = this.newObject([null, 1, false, '', undefined, 0, null]); + var ary = obj.compact(); + deepEqual(ary, [1, false, '', 0]); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/compact.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/compact.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/compact.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/compact.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/compact.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/compact.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/contains', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('contains'); + + suite.test('contains returns true if item is in enumerable', function () { + var data = this.newFixture(3); + var obj = this.newObject(data); + + if (true) { + expectDeprecation('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.'); + } + equal(obj.contains(data[1]), true, 'should return true if contained'); + }); + + suite.test('contains returns false if item is not in enumerable', function () { + var data = this.newFixture(1); + var obj = this.newObject(this.newFixture(3)); + + if (true) { + expectDeprecation('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.'); + } + equal(obj.contains(data[0]), false, 'should return false if not contained'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/contains.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/contains.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/contains.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/contains.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/contains.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/contains.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/every', ['exports', 'ember-runtime/system/object', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeSystemObject, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + // .......................................................... + // every() + // + + suite.module('every'); + + suite.test('every should should invoke callback on each item as long as you return true', function () { + var obj = this.newObject(); + var ary = this.toArray(obj); + var found = []; + var result = undefined; + + result = obj.every(function (i) { + found.push(i); + return true; + }); + equal(result, true, 'return value of obj.every'); + deepEqual(found, ary, 'items passed during every() should match'); + }); + + suite.test('every should stop invoking when you return false', function () { + var obj = this.newObject(); + var ary = this.toArray(obj); + var cnt = ary.length - 2; + var exp = cnt; + var found = []; + var result = undefined; + + result = obj.every(function (i) { + found.push(i); + return --cnt > 0; + }); + equal(result, false, 'return value of obj.every'); + equal(found.length, exp, 'should invoke proper number of times'); + deepEqual(found, ary.slice(0, -2), 'items passed during every() should match'); + }); + + // .......................................................... + // isEvery() + // + + suite.module('isEvery'); + + suite.test('should return true of every property matches', function () { + var obj = this.newObject([{ foo: 'foo', bar: 'BAZ' }, _emberRuntimeSystemObject.default.create({ foo: 'foo', bar: 'bar' })]); + + equal(obj.isEvery('foo', 'foo'), true, 'isEvery(foo)'); + equal(obj.isEvery('bar', 'bar'), false, 'isEvery(bar)'); + }); + + suite.test('should return true of every property is true', function () { + var obj = this.newObject([{ foo: 'foo', bar: true }, _emberRuntimeSystemObject.default.create({ foo: 'bar', bar: false })]); + + // different values - all eval to true + equal(obj.isEvery('foo'), true, 'isEvery(foo)'); + equal(obj.isEvery('bar'), false, 'isEvery(bar)'); + }); + + suite.test('should return true if every property matches null', function () { + var obj = this.newObject([{ foo: null, bar: 'BAZ' }, _emberRuntimeSystemObject.default.create({ foo: null, bar: null })]); + + equal(obj.isEvery('foo', null), true, 'isEvery(\'foo\', null)'); + equal(obj.isEvery('bar', null), false, 'isEvery(\'bar\', null)'); + }); + + suite.test('should return true if every property is undefined', function () { + var obj = this.newObject([{ foo: undefined, bar: 'BAZ' }, _emberRuntimeSystemObject.default.create({ bar: undefined })]); + + equal(obj.isEvery('foo', undefined), true, 'isEvery(\'foo\', undefined)'); + equal(obj.isEvery('bar', undefined), false, 'isEvery(\'bar\', undefined)'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/every.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/every.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/every.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/every.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/every.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/every.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/filter', ['exports', 'ember-runtime/system/object', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeSystemObject, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + // .......................................................... + // filter() + // + + suite.module('filter'); + + suite.test('filter should invoke on each item', function () { + var obj = this.newObject(); + var ary = this.toArray(obj); + var cnt = ary.length - 2; + var found = []; + var result = undefined; + + // return true on all but the last two + result = obj.filter(function (i) { + found.push(i); + return --cnt >= 0; + }); + deepEqual(found, ary, 'should have invoked on each item'); + deepEqual(result, ary.slice(0, -2), 'filtered array should exclude items'); + }); + + // .......................................................... + // filterBy() + // + + suite.module('filterBy'); + + suite.test('should filter based on object', function () { + var obj = undefined, + ary = undefined; + + ary = [{ foo: 'foo', bar: 'BAZ' }, _emberRuntimeSystemObject.default.create({ foo: 'foo', bar: 'bar' })]; + + obj = this.newObject(ary); + + deepEqual(obj.filterBy('foo', 'foo'), ary, 'filterBy(foo)'); + deepEqual(obj.filterBy('bar', 'bar'), [ary[1]], 'filterBy(bar)'); + }); + + suite.test('should include in result if property is true', function () { + var obj = undefined, + ary = undefined; + + ary = [{ foo: 'foo', bar: true }, _emberRuntimeSystemObject.default.create({ foo: 'bar', bar: false })]; + + obj = this.newObject(ary); + + // different values - all eval to true + deepEqual(obj.filterBy('foo'), ary, 'filterBy(foo)'); + deepEqual(obj.filterBy('bar'), [ary[0]], 'filterBy(bar)'); + }); + + suite.test('should filter on second argument if provided', function () { + var obj = undefined, + ary = undefined; + + ary = [{ name: 'obj1', foo: 3 }, _emberRuntimeSystemObject.default.create({ name: 'obj2', foo: 2 }), { name: 'obj3', foo: 2 }, _emberRuntimeSystemObject.default.create({ name: 'obj4', foo: 3 })]; + + obj = this.newObject(ary); + + deepEqual(obj.filterBy('foo', 3), [ary[0], ary[3]], 'filterBy(\'foo\', 3)\')'); + }); + + suite.test('should correctly filter null second argument', function () { + var obj = undefined, + ary = undefined; + + ary = [{ name: 'obj1', foo: 3 }, _emberRuntimeSystemObject.default.create({ name: 'obj2', foo: null }), { name: 'obj3', foo: null }, _emberRuntimeSystemObject.default.create({ name: 'obj4', foo: 3 })]; + + obj = this.newObject(ary); + + deepEqual(obj.filterBy('foo', null), [ary[1], ary[2]], 'filterBy(\'foo\', 3)\')'); + }); + + suite.test('should not return all objects on undefined second argument', function () { + var obj = undefined, + ary = undefined; + + ary = [{ name: 'obj1', foo: 3 }, _emberRuntimeSystemObject.default.create({ name: 'obj2', foo: 2 })]; + + obj = this.newObject(ary); + + deepEqual(obj.filterBy('foo', undefined), [], 'filterBy(\'foo\', 3)\')'); + }); + + suite.test('should correctly filter explicit undefined second argument', function () { + var obj = undefined, + ary = undefined; + + ary = [{ name: 'obj1', foo: 3 }, _emberRuntimeSystemObject.default.create({ name: 'obj2', foo: 3 }), { name: 'obj3', foo: undefined }, _emberRuntimeSystemObject.default.create({ name: 'obj4', foo: undefined }), { name: 'obj5' }, _emberRuntimeSystemObject.default.create({ name: 'obj6' })]; + + obj = this.newObject(ary); + + deepEqual(obj.filterBy('foo', undefined), ary.slice(2), 'filterBy(\'foo\', 3)\')'); + }); + + suite.test('should not match undefined properties without second argument', function () { + var obj = undefined, + ary = undefined; + + ary = [{ name: 'obj1', foo: 3 }, _emberRuntimeSystemObject.default.create({ name: 'obj2', foo: 3 }), { name: 'obj3', foo: undefined }, _emberRuntimeSystemObject.default.create({ name: 'obj4', foo: undefined }), { name: 'obj5' }, _emberRuntimeSystemObject.default.create({ name: 'obj6' })]; + + obj = this.newObject(ary); + + deepEqual(obj.filterBy('foo'), ary.slice(0, 2), 'filterBy(\'foo\', 3)\')'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/filter.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/filter.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/filter.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/filter.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/filter.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/filter.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/find', ['exports', 'ember-runtime/system/object', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeSystemObject, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + // .......................................................... + // find() + // + + suite.module('find'); + + suite.test('find should invoke callback on each item as long as you return false', function () { + var obj = this.newObject(); + var ary = this.toArray(obj); + var found = []; + var result = undefined; + + result = obj.find(function (i) { + found.push(i); + return false; + }); + equal(result, undefined, 'return value of obj.find'); + deepEqual(found, ary, 'items passed during find() should match'); + }); + + suite.test('every should stop invoking when you return true', function () { + var obj = this.newObject(); + var ary = this.toArray(obj); + var cnt = ary.length - 2; + var exp = cnt; + var found = []; + var result = undefined; + + result = obj.find(function (i) { + found.push(i); + return --cnt >= 0; + }); + equal(result, ary[exp - 1], 'return value of obj.find'); + equal(found.length, exp, 'should invoke proper number of times'); + deepEqual(found, ary.slice(0, -2), 'items passed during find() should match'); + }); + + // .......................................................... + // findBy() + // + + suite.module('findBy'); + + suite.test('should return first object of property matches', function () { + var ary = undefined, + obj = undefined; + + ary = [{ foo: 'foo', bar: 'BAZ' }, _emberRuntimeSystemObject.default.create({ foo: 'foo', bar: 'bar' })]; + + obj = this.newObject(ary); + + equal(obj.findBy('foo', 'foo'), ary[0], 'findBy(foo)'); + equal(obj.findBy('bar', 'bar'), ary[1], 'findBy(bar)'); + }); + + suite.test('should return first object with truthy prop', function () { + var ary = undefined, + obj = undefined; + + ary = [{ foo: 'foo', bar: false }, _emberRuntimeSystemObject.default.create({ foo: 'bar', bar: true })]; + + obj = this.newObject(ary); + + // different values - all eval to true + equal(obj.findBy('foo'), ary[0], 'findBy(foo)'); + equal(obj.findBy('bar'), ary[1], 'findBy(bar)'); + }); + + suite.test('should return first null property match', function () { + var ary = undefined, + obj = undefined; + + ary = [{ foo: null, bar: 'BAZ' }, _emberRuntimeSystemObject.default.create({ foo: null, bar: null })]; + + obj = this.newObject(ary); + + equal(obj.findBy('foo', null), ary[0], 'findBy(\'foo\', null)'); + equal(obj.findBy('bar', null), ary[1], 'findBy(\'bar\', null)'); + }); + + suite.test('should return first undefined property match', function () { + var ary = undefined, + obj = undefined; + + ary = [{ foo: undefined, bar: 'BAZ' }, _emberRuntimeSystemObject.default.create({})]; + + obj = this.newObject(ary); + + equal(obj.findBy('foo', undefined), ary[0], 'findBy(\'foo\', undefined)'); + equal(obj.findBy('bar', undefined), ary[1], 'findBy(\'bar\', undefined)'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/find.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/find.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/find.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/find.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/find.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/find.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/firstObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('firstObject'); + + suite.test('returns first item in enumerable', function () { + var obj = this.newObject(); + equal(_emberMetal.get(obj, 'firstObject'), this.toArray(obj)[0]); + }); + + suite.test('returns undefined if enumerable is empty', function () { + var obj = this.newObject([]); + equal(_emberMetal.get(obj, 'firstObject'), undefined); + }); + + suite.test('can not be set', function () { + var obj = this.newObject([]); + + equal(_emberMetal.get(obj, 'firstObject'), this.toArray(obj)[0]); + + throws(function () { + _emberMetal.set(obj, 'firstObject', 'foo!'); + }, /Cannot set read-only property "firstObject" on object/); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/firstObject.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/firstObject.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/firstObject.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/firstObject.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/firstObject.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/firstObject.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/forEach', ['exports', 'ember-utils', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberUtils, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('forEach'); + + suite.test('forEach should iterate over list', function () { + var obj = this.newObject(); + var ary = this.toArray(obj); + var found = []; + + obj.forEach(function (i) { + return found.push(i); + }); + deepEqual(found, ary, 'items passed during forEach should match'); + }); + + suite.test('forEach should iterate over list after mutation', function () { + if (_emberMetal.get(this, 'canTestMutation')) { + expect(0); + return; + } + + var obj = this.newObject(); + var ary = this.toArray(obj); + var found = []; + + obj.forEach(function (i) { + return found.push(i); + }); + deepEqual(found, ary, 'items passed during forEach should match'); + + this.mutate(obj); + ary = this.toArray(obj); + found = []; + + obj.forEach(function (i) { + return found.push(i); + }); + deepEqual(found, ary, 'items passed during forEach should match'); + }); + + suite.test('2nd target parameter', function () { + var _this = this; + + var obj = this.newObject(); + var target = this; + + obj.forEach(function () { + // ES6TODO: When transpiled we will end up with "use strict" which disables automatically binding to the global context. + // Therefore, the following test can never pass in strict mode unless we modify the `map` function implementation to + // use `Ember.lookup` if target is not specified. + // + // equal(guidFor(this), guidFor(global), 'should pass the global object as this if no context'); + }); + + obj.forEach(function () { + equal(_emberUtils.guidFor(_this), _emberUtils.guidFor(target), 'should pass target as this if context'); + }, target); + }); + + suite.test('callback params', function () { + var obj = this.newObject(); + var ary = this.toArray(obj); + var loc = 0; + + obj.forEach(function (item, idx, enumerable) { + equal(item, ary[loc], 'item param'); + equal(idx, loc, 'idx param'); + equal(_emberUtils.guidFor(enumerable), _emberUtils.guidFor(obj), 'enumerable param'); + loc++; + }); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/forEach.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/forEach.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/forEach.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/forEach.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/forEach.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/forEach.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/includes', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('includes'); + + suite.test('includes returns true if item is in enumerable', function () { + var data = this.newFixture(1); + var obj = this.newObject([].concat(data, [NaN, undefined, null])); + + equal(obj.includes(data[0]), true, 'should return true if included'); + equal(obj.includes(NaN), true, 'should return true if NaN included'); + equal(obj.includes(undefined), true, 'should return true if undefined included'); + equal(obj.includes(null), true, 'should return true if null included'); + }); + + suite.test('includes returns false if item is not in enumerable', function () { + var data = this.newFixture(1); + var obj = this.newObject([].concat(this.newFixture(3), [null])); + + equal(obj.includes(data[0]), false, 'should return false if not included'); + equal(obj.includes(undefined), false, 'should return false if undefined not included but null is included'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/includes.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/includes.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/includes.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/includes.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/includes.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/includes.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/invoke', ['exports', 'ember-runtime/system/object', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeSystemObject, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('invoke'); + + suite.test('invoke should call on each object that implements', function () { + var cnt = undefined, + ary = undefined, + obj = undefined; + + function F(amt) { + cnt += amt === undefined ? 1 : amt; + } + cnt = 0; + ary = [{ foo: F }, _emberRuntimeSystemObject.default.create({ foo: F }), + + // NOTE: does not impl foo - invoke should just skip + _emberRuntimeSystemObject.default.create({ bar: F }), { foo: F }]; + + obj = this.newObject(ary); + obj.invoke('foo'); + equal(cnt, 3, 'should have invoked 3 times'); + + cnt = 0; + obj.invoke('foo', 2); + equal(cnt, 6, 'should have invoked 3 times, passing param'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/invoke.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/invoke.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/invoke.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/invoke.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/invoke.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/invoke.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/is_any', ['exports', 'ember-runtime/system/object', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeSystemObject, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + // .......................................................... + // isAny() + // + + suite.module('isAny'); + + suite.test('should return true of any property matches', function () { + var obj = this.newObject([{ foo: 'foo', bar: 'BAZ' }, _emberRuntimeSystemObject.default.create({ foo: 'foo', bar: 'bar' })]); + + equal(obj.isAny('foo', 'foo'), true, 'isAny(foo)'); + equal(obj.isAny('bar', 'bar'), true, 'isAny(bar)'); + equal(obj.isAny('bar', 'BIFF'), false, 'isAny(BIFF)'); + }); + + suite.test('should return true of any property is true', function () { + var obj = this.newObject([{ foo: 'foo', bar: true }, _emberRuntimeSystemObject.default.create({ foo: 'bar', bar: false })]); + + // different values - all eval to true + equal(obj.isAny('foo'), true, 'isAny(foo)'); + equal(obj.isAny('bar'), true, 'isAny(bar)'); + equal(obj.isAny('BIFF'), false, 'isAny(biff)'); + }); + + suite.test('should return true if any property matches null', function () { + var obj = this.newObject([{ foo: null, bar: 'bar' }, _emberRuntimeSystemObject.default.create({ foo: 'foo', bar: null })]); + + equal(obj.isAny('foo', null), true, 'isAny(\'foo\', null)'); + equal(obj.isAny('bar', null), true, 'isAny(\'bar\', null)'); + }); + + suite.test('should return true if any property is undefined', function () { + var obj = this.newObject([{ foo: undefined, bar: 'bar' }, _emberRuntimeSystemObject.default.create({ foo: 'foo' })]); + + equal(obj.isAny('foo', undefined), true, 'isAny(\'foo\', undefined)'); + equal(obj.isAny('bar', undefined), true, 'isAny(\'bar\', undefined)'); + }); + + suite.test('should not match undefined properties without second argument', function () { + var obj = this.newObject([{ foo: undefined }, _emberRuntimeSystemObject.default.create({})]); + + equal(obj.isAny('foo'), false, 'isAny(\'foo\', undefined)'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/is_any.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/is_any.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/is_any.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/is_any.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/is_any.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/is_any.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/lastObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('lastObject'); + + suite.test('returns last item in enumerable', function () { + var obj = this.newObject(); + var ary = this.toArray(obj); + + equal(_emberMetal.get(obj, 'lastObject'), ary[ary.length - 1]); + }); + + suite.test('returns undefined if enumerable is empty', function () { + var obj = this.newObject([]); + + equal(_emberMetal.get(obj, 'lastObject'), undefined); + }); + + suite.test('can not be set', function () { + var obj = this.newObject(); + var ary = this.toArray(obj); + + equal(_emberMetal.get(obj, 'lastObject'), ary[ary.length - 1]); + + throws(function () { + _emberMetal.set(obj, 'lastObject', 'foo!'); + }, /Cannot set read-only property "lastObject" on object/); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/lastObject.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/lastObject.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/lastObject.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/lastObject.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/lastObject.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/lastObject.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/map', ['exports', 'ember-utils', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberUtils, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('map'); + + var mapFunc = function (item) { + return item ? item.toString() : null; + }; + + suite.test('map should iterate over list', function () { + var obj = this.newObject(); + var ary = this.toArray(obj).map(mapFunc); + var found = []; + + found = obj.map(mapFunc); + deepEqual(found, ary, 'mapped arrays should match'); + }); + + suite.test('map should iterate over list after mutation', function () { + if (_emberMetal.get(this, 'canTestMutation')) { + expect(0); + return; + } + + var obj = this.newObject(); + var ary = this.toArray(obj).map(mapFunc); + var found = undefined; + + found = obj.map(mapFunc); + deepEqual(found, ary, 'items passed during forEach should match'); + + this.mutate(obj); + ary = this.toArray(obj).map(mapFunc); + found = obj.map(mapFunc); + deepEqual(found, ary, 'items passed during forEach should match'); + }); + + suite.test('2nd target parameter', function () { + var _this = this; + + var obj = this.newObject(); + var target = this; + + obj.map(function () { + // ES6TODO: When transpiled we will end up with "use strict" which disables automatically binding to the global context. + // Therefore, the following test can never pass in strict mode unless we modify the `map` function implementation to + // use `Ember.lookup` if target is not specified. + // + // equal(guidFor(this), guidFor(global), 'should pass the global object as this if no context'); + }); + + obj.map(function () { + equal(_emberUtils.guidFor(_this), _emberUtils.guidFor(target), 'should pass target as this if context'); + }, target); + }); + + suite.test('callback params', function () { + var obj = this.newObject(); + var ary = this.toArray(obj); + var loc = 0; + + obj.map(function (item, idx, enumerable) { + equal(item, ary[loc], 'item param'); + equal(idx, loc, 'idx param'); + equal(_emberUtils.guidFor(enumerable), _emberUtils.guidFor(obj), 'enumerable param'); + loc++; + }); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/map.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/map.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/map.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/map.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/map.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/map.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/mapBy', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('mapBy'); + + suite.test('get value of each property', function () { + var obj = this.newObject([{ a: 1 }, { a: 2 }]); + equal(obj.mapBy('a').join(''), '12'); + }); + + suite.test('should work also through getEach alias', function () { + var obj = this.newObject([{ a: 1 }, { a: 2 }]); + equal(obj.getEach('a').join(''), '12'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/mapBy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/mapBy.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/mapBy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/mapBy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/mapBy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/mapBy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/reduce', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('reduce'); + + suite.test('collects a summary value from an enumeration', function () { + var obj = this.newObject([1, 2, 3]); + var res = obj.reduce(function (previousValue, item, index, enumerable) { + return previousValue + item; + }, 0); + equal(res, 6); + }); + + suite.test('passes index of item to callback', function () { + var obj = this.newObject([1, 2, 3]); + var res = obj.reduce(function (previousValue, item, index, enumerable) { + return previousValue + index; + }, 0); + equal(res, 3); + }); + + suite.test('passes enumerable object to callback', function () { + var obj = this.newObject([1, 2, 3]); + var res = obj.reduce(function (previousValue, item, index, enumerable) { + return enumerable; + }, 0); + equal(res, obj); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/reduce.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/reduce.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/reduce.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/reduce.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/reduce.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/reduce.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/reject', ['exports', 'ember-runtime/system/object', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeSystemObject, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + // .......................................................... + // reject() + // + + suite.module('reject'); + + suite.test('should reject any item that does not meet the condition', function () { + var obj = this.newObject([1, 2, 3, 4]); + var result = undefined; + + result = obj.reject(function (i) { + return i < 3; + }); + deepEqual(result, [3, 4], 'reject the correct items'); + }); + + suite.test('should be the inverse of filter', function () { + var obj = this.newObject([1, 2, 3, 4]); + var isEven = function (i) { + return i % 2 === 0; + }; + var filtered = undefined, + rejected = undefined; + + filtered = obj.filter(isEven); + rejected = obj.reject(isEven); + + deepEqual(filtered, [2, 4], 'filtered evens'); + deepEqual(rejected, [1, 3], 'rejected evens'); + }); + + // .......................................................... + // rejectBy() + // + + suite.module('rejectBy'); + + suite.test('should reject based on object', function () { + var obj = undefined, + ary = undefined; + + ary = [{ foo: 'foo', bar: 'BAZ' }, _emberRuntimeSystemObject.default.create({ foo: 'foo', bar: 'bar' })]; + + obj = this.newObject(ary); + + deepEqual(obj.rejectBy('foo', 'foo'), [], 'rejectBy(foo)'); + deepEqual(obj.rejectBy('bar', 'bar'), [ary[0]], 'rejectBy(bar)'); + }); + + suite.test('should include in result if property is false', function () { + var obj = undefined, + ary = undefined; + + ary = [{ foo: false, bar: true }, _emberRuntimeSystemObject.default.create({ foo: false, bar: false })]; + + obj = this.newObject(ary); + + deepEqual(obj.rejectBy('foo'), ary, 'rejectBy(foo)'); + deepEqual(obj.rejectBy('bar'), [ary[1]], 'rejectBy(bar)'); + }); + + suite.test('should reject on second argument if provided', function () { + var obj = undefined, + ary = undefined; + + ary = [{ name: 'obj1', foo: 3 }, _emberRuntimeSystemObject.default.create({ name: 'obj2', foo: 2 }), { name: 'obj3', foo: 2 }, _emberRuntimeSystemObject.default.create({ name: 'obj4', foo: 3 })]; + + obj = this.newObject(ary); + + deepEqual(obj.rejectBy('foo', 3), [ary[1], ary[2]], 'rejectBy(\'foo\', 3)\')'); + }); + + suite.test('should correctly reject null second argument', function () { + var obj = undefined, + ary = undefined; + + ary = [{ name: 'obj1', foo: 3 }, _emberRuntimeSystemObject.default.create({ name: 'obj2', foo: null }), { name: 'obj3', foo: null }, _emberRuntimeSystemObject.default.create({ name: 'obj4', foo: 3 })]; + + obj = this.newObject(ary); + + deepEqual(obj.rejectBy('foo', null), [ary[0], ary[3]], 'rejectBy(\'foo\', null)\')'); + }); + + suite.test('should correctly reject undefined second argument', function () { + var obj = undefined, + ary = undefined; + + ary = [{ name: 'obj1', foo: 3 }, _emberRuntimeSystemObject.default.create({ name: 'obj2', foo: 2 })]; + + obj = this.newObject(ary); + + deepEqual(obj.rejectBy('bar', undefined), [], 'rejectBy(\'bar\', undefined)\')'); + }); + + suite.test('should correctly reject explicit undefined second argument', function () { + var obj = undefined, + ary = undefined; + + ary = [{ name: 'obj1', foo: 3 }, _emberRuntimeSystemObject.default.create({ name: 'obj2', foo: 3 }), { name: 'obj3', foo: undefined }, _emberRuntimeSystemObject.default.create({ name: 'obj4', foo: undefined }), { name: 'obj5' }, _emberRuntimeSystemObject.default.create({ name: 'obj6' })]; + + obj = this.newObject(ary); + + deepEqual(obj.rejectBy('foo', undefined), ary.slice(0, 2), 'rejectBy(\'foo\', undefined)\')'); + }); + + suite.test('should match undefined, null, or false properties without second argument', function () { + var obj = undefined, + ary = undefined; + + ary = [{ name: 'obj1', foo: 3 }, _emberRuntimeSystemObject.default.create({ name: 'obj2', foo: 3 }), { name: 'obj3', foo: undefined }, _emberRuntimeSystemObject.default.create({ name: 'obj4', foo: undefined }), { name: 'obj5' }, _emberRuntimeSystemObject.default.create({ name: 'obj6' }), { name: 'obj7', foo: null }, _emberRuntimeSystemObject.default.create({ name: 'obj8', foo: null }), { name: 'obj9', foo: false }, _emberRuntimeSystemObject.default.create({ name: 'obj10', foo: false })]; + + obj = this.newObject(ary); + + deepEqual(obj.rejectBy('foo'), ary.slice(2), 'rejectBy(\'foo\')\')'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/reject.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/reject.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/reject.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/reject.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/reject.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/reject.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/sortBy', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('sortBy'); + + suite.test('sort by value of property', function () { + var obj = this.newObject([{ a: 2 }, { a: 1 }]); + var sorted = obj.sortBy('a'); + + equal(_emberMetal.get(sorted[0], 'a'), 1); + equal(_emberMetal.get(sorted[1], 'a'), 2); + }); + + suite.test('supports multiple propertyNames', function () { + var obj = this.newObject([{ a: 1, b: 2 }, { a: 1, b: 1 }]); + var sorted = obj.sortBy('a', 'b'); + + equal(_emberMetal.get(sorted[0], 'b'), 1); + equal(_emberMetal.get(sorted[1], 'b'), 2); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/sortBy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/sortBy.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/sortBy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/sortBy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/sortBy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/sortBy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/toArray', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('toArray'); + + suite.test('toArray should convert to an array', function () { + var obj = this.newObject(); + deepEqual(obj.toArray(), this.toArray(obj)); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/toArray.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/toArray.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/toArray.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/toArray.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/toArray.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/toArray.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/uniq', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('uniq'); + + suite.test('should return new instance with duplicates removed', function () { + var before = undefined, + after = undefined, + obj = undefined, + ret = undefined; + + after = this.newFixture(3); + before = [after[0], after[1], after[2], after[1], after[0]]; + obj = this.newObject(before); + before = obj.toArray(); // in case of set before will be different... + + ret = obj.uniq(); + deepEqual(this.toArray(ret), after, 'should have removed item'); + deepEqual(this.toArray(obj), before, 'should not have changed original'); + }); + + suite.test('should return duplicate of same content if no duplicates found', function () { + var item = undefined, + obj = undefined, + ret = undefined; + obj = this.newObject(this.newFixture(3)); + ret = obj.uniq(item); + ok(ret !== obj, 'should not be same object'); + deepEqual(this.toArray(ret), this.toArray(obj), 'should be the same content'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/uniq.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/uniq.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/uniq.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/uniq.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/uniq.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/uniq.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/uniqBy', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('uniqBy'); + + if (true) { + suite.test('should return new instance with duplicates removed', function () { + var numbers = this.newObject([{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 1, value: 'one' }]); + deepEqual(numbers.uniqBy('id'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }]); + }); + } + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/uniqBy.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/uniqBy.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/uniqBy.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/uniqBy.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/uniqBy.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/uniqBy.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/without', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('without'); + + suite.test('should return new instance with item removed', function () { + var before = undefined, + after = undefined, + obj = undefined, + ret = undefined; + + before = this.newFixture(3); + after = [before[0], before[2]]; + obj = this.newObject(before); + + ret = obj.without(before[1]); + deepEqual(this.toArray(ret), after, 'should have removed item'); + deepEqual(this.toArray(obj), before, 'should not have changed original'); + }); + + if (true) { + suite.test('should remove NaN value', function () { + var before = undefined, + after = undefined, + obj = undefined, + ret = undefined; + + before = [].concat(this.newFixture(2), [NaN]); + after = [before[0], before[1]]; + obj = this.newObject(before); + + ret = obj.without(NaN); + deepEqual(this.toArray(ret), after, 'should have removed item'); + }); + } + + suite.test('should return same instance if object not found', function () { + var item = undefined, + obj = undefined, + ret = undefined; + + item = this.newFixture(1)[0]; + obj = this.newObject(this.newFixture(3)); + + ret = obj.without(item); + equal(ret, obj, 'should be same instance'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/enumerable/without.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/enumerable'); + test('ember-runtime/tests/suites/enumerable/without.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/enumerable/without.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/enumerable/without.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); + QUnit.test('ember-runtime/tests/suites/enumerable/without.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/without.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array', ['exports', 'ember-runtime/tests/suites/array', 'ember-runtime/tests/suites/mutable_array/insertAt', 'ember-runtime/tests/suites/mutable_array/popObject', 'ember-runtime/tests/suites/mutable_array/pushObject', 'ember-runtime/tests/suites/mutable_array/pushObjects', 'ember-runtime/tests/suites/mutable_array/removeAt', 'ember-runtime/tests/suites/mutable_array/replace', 'ember-runtime/tests/suites/mutable_array/shiftObject', 'ember-runtime/tests/suites/mutable_array/unshiftObject', 'ember-runtime/tests/suites/mutable_array/reverseObjects'], function (exports, _emberRuntimeTestsSuitesArray, _emberRuntimeTestsSuitesMutable_arrayInsertAt, _emberRuntimeTestsSuitesMutable_arrayPopObject, _emberRuntimeTestsSuitesMutable_arrayPushObject, _emberRuntimeTestsSuitesMutable_arrayPushObjects, _emberRuntimeTestsSuitesMutable_arrayRemoveAt, _emberRuntimeTestsSuitesMutable_arrayReplace, _emberRuntimeTestsSuitesMutable_arrayShiftObject, _emberRuntimeTestsSuitesMutable_arrayUnshiftObject, _emberRuntimeTestsSuitesMutable_arrayReverseObjects) { + 'use strict'; + + var MutableArrayTests = _emberRuntimeTestsSuitesArray.ArrayTests.extend(); + MutableArrayTests.importModuleTests(_emberRuntimeTestsSuitesMutable_arrayInsertAt.default); + MutableArrayTests.importModuleTests(_emberRuntimeTestsSuitesMutable_arrayPopObject.default); + MutableArrayTests.importModuleTests(_emberRuntimeTestsSuitesMutable_arrayPushObject.default); + MutableArrayTests.importModuleTests(_emberRuntimeTestsSuitesMutable_arrayPushObjects.default); + MutableArrayTests.importModuleTests(_emberRuntimeTestsSuitesMutable_arrayRemoveAt.default); + MutableArrayTests.importModuleTests(_emberRuntimeTestsSuitesMutable_arrayReplace.default); + MutableArrayTests.importModuleTests(_emberRuntimeTestsSuitesMutable_arrayShiftObject.default); + MutableArrayTests.importModuleTests(_emberRuntimeTestsSuitesMutable_arrayUnshiftObject.default); + MutableArrayTests.importModuleTests(_emberRuntimeTestsSuitesMutable_arrayReverseObjects.default); + + exports.default = MutableArrayTests; +}); +enifed('ember-runtime/tests/suites/mutable_array.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites'); + test('ember-runtime/tests/suites/mutable_array.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites'); + QUnit.test('ember-runtime/tests/suites/mutable_array.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/addObject', ['exports', 'ember-metal', 'ember-runtime/tests/suites/suite'], function (exports, _emberMetal, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('addObject'); + + suite.test('should return receiver', function () { + var before = this.newFixture(3); + var obj = this.newObject(before); + equal(obj.addObject(before[1]), obj, 'should return receiver'); + }); + + suite.test('[A,B].addObject(C) => [A,B,C] + notify', function () { + var before = this.newFixture(2); + var item = this.newFixture(1)[0]; + var after = [before[0], before[1], item]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.addObject(item); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + } + }); + + suite.test('[A,B,C].addObject(A) => [A,B,C] + NO notify', function () { + var before = this.newFixture(3); + var after = before; + var item = before[0]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.addObject(item); // note: item in set + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.validate('[]'), false, 'should NOT have notified []'); + equal(observer.validate('@each'), false, 'should NOT have notified @each'); + equal(observer.validate('length'), false, 'should NOT have notified length'); + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once'); + } + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/addObject.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/addObject.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/addObject.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/addObject.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/addObject.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/addObject.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/clear', ['exports', 'ember-metal', 'ember-runtime/tests/suites/suite'], function (exports, _emberMetal, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('clear'); + + suite.test('[].clear() => [] + notify', function () { + var before = []; + var after = []; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(obj.clear(), obj, 'return self'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.validate('[]'), false, 'should NOT have notified [] once'); + equal(observer.validate('@each'), false, 'should NOT have notified @each once'); + equal(observer.validate('length'), false, 'should NOT have notified length once'); + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once'); + }); + + suite.test('[X].clear() => [] + notify', function () { + var obj, before, after, observer; + + before = this.newFixture(1); + after = []; + obj = this.newObject(before); + observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(obj.clear(), obj, 'return self'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/clear.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/clear.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/clear.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/clear.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/clear.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/clear.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/insertAt', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('insertAt'); + + suite.test('[].insertAt(0, X) => [X] + notify', function () { + var after = this.newFixture(1); + var obj = this.newObject([]); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.insertAt(0, after[0]); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalledBefore('[]'), 1, 'should have notified [] will change once'); + equal(observer.timesCalledBefore('@each'), 0, 'should not have notified @each will change once'); + equal(observer.timesCalledBefore('length'), 1, 'should have notified length will change once'); + equal(observer.timesCalledBefore('firstObject'), 1, 'should have notified firstObject will change once'); + equal(observer.timesCalledBefore('lastObject'), 1, 'should have notified lastObject will change once'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] did change once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each did change once'); + equal(observer.timesCalled('length'), 1, 'should have notified length did change once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject did change once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject did change once'); + }); + + suite.test('[].insertAt(200,X) => OUT_OF_RANGE_EXCEPTION exception', function () { + var obj = this.newObject([]); + var that = this; + + throws(function () { + return obj.insertAt(200, that.newFixture(1)[0]); + }, Error); + }); + + suite.test('[A].insertAt(0, X) => [X,A] + notify', function () { + var item = this.newFixture(1)[0]; + var before = this.newFixture(1); + var after = [item, before[0]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.insertAt(0, item); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalledBefore('[]'), 1, 'should have notified [] will change once'); + equal(observer.timesCalledBefore('@each'), 0, 'should not have notified @each will change once'); + equal(observer.timesCalledBefore('length'), 1, 'should have notified length will change once'); + equal(observer.timesCalledBefore('firstObject'), 1, 'should have notified firstObject will change once'); + equal(observer.timesCalledBefore('lastObject'), 0, 'should NOT have notified lastObject will change once'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + }); + + suite.test('[A].insertAt(1, X) => [A,X] + notify', function () { + var item = this.newFixture(1)[0]; + var before = this.newFixture(1); + var after = [before[0], item]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.insertAt(1, item); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalledBefore('[]'), 1, 'should have notified [] will change once'); + equal(observer.timesCalledBefore('@each'), 0, 'should not have notified @each will change once'); + equal(observer.timesCalledBefore('length'), 1, 'should have notified length will change once'); + equal(observer.timesCalledBefore('firstObject'), 0, 'should NOT have notified firstObject will change once'); + equal(observer.timesCalledBefore('lastObject'), 1, 'should have notified lastObject will change once'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + }); + + suite.test('[A].insertAt(200,X) => OUT_OF_RANGE exception', function () { + var obj = this.newObject(this.newFixture(1)); + var that = this; + + throws(function () { + return obj.insertAt(200, that.newFixture(1)[0]); + }, Error); + }); + + suite.test('[A,B,C].insertAt(0,X) => [X,A,B,C] + notify', function () { + var item = this.newFixture(1)[0]; + var before = this.newFixture(3); + var after = [item, before[0], before[1], before[2]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.insertAt(0, item); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalledBefore('[]'), 1, 'should have notified [] will change once'); + equal(observer.timesCalledBefore('@each'), 0, 'should not have notified @each will change once'); + equal(observer.timesCalledBefore('length'), 1, 'should have notified length will change once'); + equal(observer.timesCalledBefore('firstObject'), 1, 'should have notified firstObject will change once'); + equal(observer.timesCalledBefore('lastObject'), 0, 'should NOT have notified lastObject will change once'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + }); + + suite.test('[A,B,C].insertAt(1,X) => [A,X,B,C] + notify', function () { + var item = this.newFixture(1)[0]; + var before = this.newFixture(3); + var after = [before[0], item, before[1], before[2]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.insertAt(1, item); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalledBefore('[]'), 1, 'should have notified [] will change once'); + equal(observer.timesCalledBefore('@each'), 0, 'should not have notified @each will change once'); + equal(observer.timesCalledBefore('length'), 1, 'should have notified length will change once'); + equal(observer.timesCalledBefore('firstObject'), 0, 'should NOT have notified firstObject will change once'); + equal(observer.timesCalledBefore('lastObject'), 0, 'should NOT have notified lastObject will change once'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + }); + + suite.test('[A,B,C].insertAt(3,X) => [A,B,C,X] + notify', function () { + var item = this.newFixture(1)[0]; + var before = this.newFixture(3); + var after = [before[0], before[1], before[2], item]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.insertAt(3, item); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalledBefore('[]'), 1, 'should have notified [] will change once'); + equal(observer.timesCalledBefore('@each'), 0, 'should not have notified @each will change once'); + equal(observer.timesCalledBefore('length'), 1, 'should have notified length will change once'); + equal(observer.timesCalledBefore('firstObject'), 0, 'should NOT have notified firstObject will change once'); + equal(observer.timesCalledBefore('lastObject'), 1, 'should have notified lastObject will change once'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/insertAt.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/insertAt.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/insertAt.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/insertAt.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/insertAt.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/insertAt.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/popObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('popObject'); + + suite.test('[].popObject() => [] + returns undefined + NO notify', function () { + var obj = this.newObject([]); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(obj.popObject(), undefined, 'popObject results'); + + deepEqual(this.toArray(obj), [], 'post item results'); + + equal(observer.validate('[]'), false, 'should NOT have notified []'); + equal(observer.validate('@each'), false, 'should NOT have notified @each'); + equal(observer.validate('length'), false, 'should NOT have notified length'); + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + }); + + suite.test('[X].popObject() => [] + notify', function () { + var before = this.newFixture(1); + var after = []; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + var ret = obj.popObject(); + + equal(ret, before[0], 'return object'); + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + }); + + suite.test('[A,B,C].popObject() => [A,B] + notify', function () { + var before = this.newFixture(3); + var after = [before[0], before[1]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + var ret = obj.popObject(); + + equal(ret, before[2], 'return object'); + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/popObject.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/popObject.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/popObject.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/popObject.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/popObject.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/popObject.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/pushObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('pushObject'); + + suite.test('returns pushed object', function () { + var exp = this.newFixture(1)[0]; + var obj = this.newObject([]); + + equal(obj.pushObject(exp), exp, 'should return pushed object'); + }); + + suite.test('[].pushObject(X) => [X] + notify', function () { + var before = []; + var after = this.newFixture(1); + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.pushObject(after[0]); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + }); + + suite.test('[A,B,C].pushObject(X) => [A,B,C,X] + notify', function () { + var before = this.newFixture(3); + var item = this.newFixture(1)[0]; + var after = [before[0], before[1], before[2], item]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.pushObject(item); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/pushObject.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/pushObject.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/pushObject.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/pushObject.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/pushObject.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/pushObject.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/pushObjects', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('pushObjects'); + + suite.test('should raise exception if not Ember.Enumerable is passed to pushObjects', function () { + var obj = this.newObject([]); + + throws(function () { + return obj.pushObjects('string'); + }); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/pushObjects.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/pushObjects.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/pushObjects.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/pushObjects.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/pushObjects.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/pushObjects.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/removeAt', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal', 'ember-runtime/mixins/mutable_array'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal, _emberRuntimeMixinsMutable_array) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('removeAt'); + + suite.test('removeAt([X], 0) => [] + notify', function () { + var before = this.newFixture(1); + var after = []; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(_emberRuntimeMixinsMutable_array.removeAt(obj, 0), obj, 'return self'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + }); + + suite.test('removeAt([], 200) => OUT_OF_RANGE_EXCEPTION exception', function () { + var obj = this.newObject([]); + throws(function () { + return _emberRuntimeMixinsMutable_array.removeAt(obj, 200); + }, Error); + }); + + suite.test('removeAt([A,B], 0) => [B] + notify', function () { + var before = this.newFixture(2); + var after = [before[1]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(_emberRuntimeMixinsMutable_array.removeAt(obj, 0), obj, 'return self'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + }); + + suite.test('removeAt([A,B], 1) => [A] + notify', function () { + var before = this.newFixture(2); + var after = [before[0]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(_emberRuntimeMixinsMutable_array.removeAt(obj, 1), obj, 'return self'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + }); + + suite.test('removeAt([A,B,C], 1) => [A,C] + notify', function () { + var before = this.newFixture(3); + var after = [before[0], before[2]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(_emberRuntimeMixinsMutable_array.removeAt(obj, 1), obj, 'return self'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once'); + }); + + suite.test('removeAt([A,B,C,D], 1,2) => [A,D] + notify', function () { + var before = this.newFixture(4); + var after = [before[0], before[3]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(_emberRuntimeMixinsMutable_array.removeAt(obj, 1, 2), obj, 'return self'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once'); + }); + + suite.test('[A,B,C,D].removeAt(1,2) => [A,D] + notify', function () { + var obj, before, after, observer; + + before = this.newFixture(4); + after = [before[0], before[3]]; + obj = this.newObject(before); + observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(obj.removeAt(1, 2), obj, 'return self'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/removeAt.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/removeAt.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/removeAt.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/removeAt.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/removeAt.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/removeAt.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/removeObject', ['exports', 'ember-metal', 'ember-runtime/tests/suites/suite'], function (exports, _emberMetal, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('removeObject'); + + suite.test('should return receiver', function () { + var before = this.newFixture(3); + var obj = this.newObject(before); + + equal(obj.removeObject(before[1]), obj, 'should return receiver'); + }); + + suite.test('[A,B,C].removeObject(B) => [A,C] + notify', function () { + var before = this.newFixture(3); + var after = [before[0], before[2]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.removeObject(before[1]); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once'); + } + }); + + suite.test('[A,B,C].removeObject(D) => [A,B,C]', function () { + var before = this.newFixture(3); + var after = before; + var item = this.newFixture(1)[0]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.removeObject(item); // note: item not in set + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.validate('[]'), false, 'should NOT have notified []'); + equal(observer.validate('@each'), false, 'should NOT have notified @each'); + equal(observer.validate('length'), false, 'should NOT have notified length'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once'); + } + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/removeObject.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/removeObject.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/removeObject.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/removeObject.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/removeObject.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/removeObject.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/replace', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('replace'); + + suite.test('[].replace(0,0,\'X\') => [\'X\'] + notify', function () { + var exp = this.newFixture(1); + var obj = this.newObject([]); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.replace(0, 0, exp); + + deepEqual(this.toArray(obj), exp, 'post item results'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + }); + + suite.test('[].replace(0,0,"X") => ["X"] + avoid calling objectAt and notifying fistObject/lastObject when not in cache', function () { + var obj, exp, observer; + var called = 0; + exp = this.newFixture(1); + obj = this.newObject([]); + obj.objectAt = function () { + called++; + }; + observer = this.newObserver(obj, 'firstObject', 'lastObject'); + + obj.replace(0, 0, exp); + + equal(called, 0, 'should NOT have called objectAt upon replace when firstObject/lastObject are not cached'); + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject since not cached'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject since not cached'); + }); + + suite.test('[A,B,C,D].replace(1,2,X) => [A,X,D] + notify', function () { + var before = this.newFixture(4); + var replace = this.newFixture(1); + var after = [before[0], replace[0], before[3]]; + + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.replace(1, 2, replace); + + deepEqual(this.toArray(obj), after, 'post item results'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once'); + }); + + suite.test('[A,B,C,D].replace(1,2,[X,Y]) => [A,X,Y,D] + notify', function () { + var before = this.newFixture(4); + var replace = this.newFixture(2); + var after = [before[0], replace[0], replace[1], before[3]]; + + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.replace(1, 2, replace); + + deepEqual(this.toArray(obj), after, 'post item results'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.validate('length'), false, 'should NOT have notified length'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once'); + }); + + suite.test('[A,B].replace(1,0,[X,Y]) => [A,X,Y,B] + notify', function () { + var before = this.newFixture(2); + var replace = this.newFixture(2); + var after = [before[0], replace[0], replace[1], before[1]]; + + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.replace(1, 0, replace); + + deepEqual(this.toArray(obj), after, 'post item results'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once'); + }); + + suite.test('[A,B,C,D].replace(2,2) => [A,B] + notify', function () { + var before = this.newFixture(4); + var after = [before[0], before[1]]; + + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.replace(2, 2); + + deepEqual(this.toArray(obj), after, 'post item results'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + }); + + suite.test('Adding object should notify enumerable observer', function () { + var fixtures = this.newFixture(4); + var obj = this.newObject(fixtures); + var observer = this.newObserver(obj).observeEnumerable(obj); + var item = this.newFixture(1)[0]; + + obj.replace(2, 2, [item]); + + deepEqual(observer._before, [obj, [fixtures[2], fixtures[3]], 1], 'before'); + deepEqual(observer._after, [obj, 2, [item]], 'after'); + }); + + suite.test('Adding object should notify array observer', function () { + var fixtures = this.newFixture(4); + var obj = this.newObject(fixtures); + var observer = this.newObserver(obj).observeArray(obj); + var item = this.newFixture(1)[0]; + + obj.replace(2, 2, [item]); + + deepEqual(observer._before, [obj, 2, 2, 1], 'before'); + deepEqual(observer._after, [obj, 2, 2, 1], 'after'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/replace.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/replace.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/replace.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/replace.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/replace.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/replace.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/reverseObjects', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('reverseObjects'); + + suite.test('[A,B,C].reverseObjects() => [] + notify', function () { + var before = this.newFixture(3); + var after = [before[2], before[1], before[0]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(obj.reverseObjects(), obj, 'return self'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 0, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/reverseObjects.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/reverseObjects.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/reverseObjects.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/reverseObjects.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/reverseObjects.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/reverseObjects.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/setObjects', ['exports', 'ember-metal', 'ember-runtime/tests/suites/suite'], function (exports, _emberMetal, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('setObjects'); + + suite.test('[A,B,C].setObjects([]) = > [] + notify', function () { + var before = this.newFixture(3); + var after = []; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(obj.setObjects(after), obj, 'return self'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + }); + + suite.test('[A,B,C].setObjects([D, E, F, G]) = > [D, E, F, G] + notify', function () { + var before = this.newFixture(3); + var after = this.newFixture(4); + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(obj.setObjects(after), obj, 'return self'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/setObjects.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/setObjects.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/setObjects.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/setObjects.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/setObjects.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/setObjects.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/shiftObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('shiftObject'); + + suite.test('[].shiftObject() => [] + returns undefined + NO notify', function () { + var before = []; + var after = []; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(obj.shiftObject(), undefined); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.validate('[]', undefined, 1), false, 'should NOT have notified [] once'); + equal(observer.validate('@each', undefined, 1), false, 'should NOT have notified @each once'); + equal(observer.validate('length', undefined, 1), false, 'should NOT have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject once'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once'); + }); + + suite.test('[X].shiftObject() => [] + notify', function () { + var before = this.newFixture(1); + var after = []; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(obj.shiftObject(), before[0], 'should return object'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + }); + + suite.test('[A,B,C].shiftObject() => [B,C] + notify', function () { + var before = this.newFixture(3); + var after = [before[1], before[2]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + equal(obj.shiftObject(), before[0], 'should return object'); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject once'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/shiftObject.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/shiftObject.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/shiftObject.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/shiftObject.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/shiftObject.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/shiftObject.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/unshiftObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('unshiftObject'); + + suite.test('returns unshifted object', function () { + var obj = this.newObject([]); + var item = this.newFixture(1)[0]; + + equal(obj.unshiftObject(item), item, 'should return unshifted object'); + }); + + suite.test('[].unshiftObject(X) => [X] + notify', function () { + var before = []; + var item = this.newFixture(1)[0]; + var after = [item]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.unshiftObject(item); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + }); + + suite.test('[A,B,C].unshiftObject(X) => [X,A,B,C] + notify', function () { + var before = this.newFixture(3); + var item = this.newFixture(1)[0]; + var after = [item, before[0], before[1], before[2]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.unshiftObject(item); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + }); + + suite.test('[A,B,C].unshiftObject(A) => [A,A,B,C] + notify', function () { + var before = this.newFixture(3); + var item = before[0]; // note same object as current head. should end up twice + var after = [item, before[0], before[1], before[2]]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.unshiftObject(item); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/unshiftObject.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/unshiftObject.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/unshiftObject.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/unshiftObject.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/unshiftObject.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/unshiftObject.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/unshiftObjects', ['exports', 'ember-metal', 'ember-runtime/tests/suites/suite'], function (exports, _emberMetal, _emberRuntimeTestsSuitesSuite) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('unshiftObjects'); + + suite.test('returns receiver', function () { + var obj = this.newObject([]); + var items = this.newFixture(3); + + equal(obj.unshiftObjects(items), obj, 'should return receiver'); + }); + + suite.test('[].unshiftObjects([A,B,C]) => [A,B,C] + notify', function () { + var before = []; + var items = this.newFixture(3); + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.unshiftObjects(items); + + deepEqual(this.toArray(obj), items, 'post item results'); + equal(_emberMetal.get(obj, 'length'), items.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + }); + + suite.test('[A,B,C].unshiftObjects([X,Y]) => [X,Y,A,B,C] + notify', function () { + var before = this.newFixture(3); + var items = this.newFixture(2); + var after = items.concat(before); + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.unshiftObjects(items); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + }); + + suite.test('[A,B,C].unshiftObjects([A,B]) => [A,B,A,B,C] + notify', function () { + var before = this.newFixture(3); + var items = [before[0], before[1]]; // note same object as current head. should end up twice + var after = items.concat(before); + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', '@each', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); /* Prime the cache */ + + obj.unshiftObjects(items); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('@each'), 0, 'should not have notified @each once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_array/unshiftObjects.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_array'); + test('ember-runtime/tests/suites/mutable_array/unshiftObjects.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_array/unshiftObjects.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_array/unshiftObjects.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); + QUnit.test('ember-runtime/tests/suites/mutable_array/unshiftObjects.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/unshiftObjects.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_enumerable', ['exports', 'ember-runtime/tests/suites/enumerable', 'ember-runtime/tests/suites/mutable_enumerable/addObject', 'ember-runtime/tests/suites/mutable_enumerable/removeObject', 'ember-runtime/tests/suites/mutable_enumerable/removeObjects'], function (exports, _emberRuntimeTestsSuitesEnumerable, _emberRuntimeTestsSuitesMutable_enumerableAddObject, _emberRuntimeTestsSuitesMutable_enumerableRemoveObject, _emberRuntimeTestsSuitesMutable_enumerableRemoveObjects) { + 'use strict'; + + var MutableEnumerableTests = _emberRuntimeTestsSuitesEnumerable.EnumerableTests.extend(); + MutableEnumerableTests.importModuleTests(_emberRuntimeTestsSuitesMutable_enumerableAddObject.default); + MutableEnumerableTests.importModuleTests(_emberRuntimeTestsSuitesMutable_enumerableRemoveObject.default); + MutableEnumerableTests.importModuleTests(_emberRuntimeTestsSuitesMutable_enumerableRemoveObjects.default); + + exports.default = MutableEnumerableTests; +}); +enifed('ember-runtime/tests/suites/mutable_enumerable.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites'); + test('ember-runtime/tests/suites/mutable_enumerable.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_enumerable.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_enumerable.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites'); + QUnit.test('ember-runtime/tests/suites/mutable_enumerable.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_enumerable.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_enumerable/addObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('addObject'); + + suite.test('should return receiver', function () { + var before = this.newFixture(3); + var obj = this.newObject(before); + + equal(obj.addObject(before[1]), obj, 'should return receiver'); + }); + + suite.test('[A,B].addObject(C) => [A,B,C] + notify', function () { + var before = this.newFixture(2); + var item = this.newFixture(1)[0]; + var after = [before[0], before[1], item]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject'); + + _emberMetal.get(obj, 'firstObject'); + _emberMetal.get(obj, 'lastObject'); + + obj.addObject(item); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject once'); + // This gets called since MutableEnumerable is naive about changes + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject once'); + } + }); + + suite.test('[A,B,C].addObject(A) => [A,B,C] + NO notify', function () { + var before = this.newFixture(3); + var after = before; + var item = before[0]; + var obj = this.newObject(before); + var observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject'); + + obj.addObject(item); // note: item in set + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.validate('[]'), false, 'should NOT have notified []'); + equal(observer.validate('length'), false, 'should NOT have notified length'); + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + } + }); + + suite.test('Adding object should notify enumerable observer', function () { + var obj = this.newObject(this.newFixture(3)); + var observer = this.newObserver(obj).observeEnumerable(obj); + var item = this.newFixture(1)[0]; + + obj.addObject(item); + + deepEqual(observer._before, [obj, null, [item]]); + deepEqual(observer._after, [obj, null, [item]]); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_enumerable/addObject.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_enumerable'); + test('ember-runtime/tests/suites/mutable_enumerable/addObject.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_enumerable/addObject.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_enumerable/addObject.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_enumerable'); + QUnit.test('ember-runtime/tests/suites/mutable_enumerable/addObject.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_enumerable/addObject.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_enumerable/removeObject', ['exports', 'ember-metal', 'ember-runtime/tests/suites/suite', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeTestsSuitesSuite, _emberRuntimeSystemNative_array) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('removeObject'); + + suite.test('should return receiver', function () { + var before = this.newFixture(3); + var obj = this.newObject(before); + + equal(obj.removeObject(before[1]), obj, 'should return receiver'); + }); + + suite.test('[A,B,C].removeObject(B) => [A,C] + notify', function () { + var before = _emberRuntimeSystemNative_array.A(this.newFixture(3)); + var after = [before[0], before[2]]; + var obj = before; + var observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); // Prime the cache + + obj.removeObject(before[1]); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + } + }); + + suite.test('[A,B,C].removeObject(D) => [A,B,C]', function () { + var before = _emberRuntimeSystemNative_array.A(this.newFixture(3)); + var after = before; + var item = this.newFixture(1)[0]; + var obj = before; + var observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); // Prime the cache + + obj.removeObject(item); // Note: item not in set + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.validate('[]'), false, 'should NOT have notified []'); + equal(observer.validate('length'), false, 'should NOT have notified length'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + } + }); + + suite.test('Removing object should notify enumerable observer', function () { + var fixtures = this.newFixture(3); + var obj = this.newObject(fixtures); + var observer = this.newObserver(obj).observeEnumerable(obj); + var item = fixtures[1]; + + obj.removeObject(item); + + deepEqual(observer._before, [obj, [item], null]); + deepEqual(observer._after, [obj, [item], null]); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_enumerable/removeObject.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_enumerable'); + test('ember-runtime/tests/suites/mutable_enumerable/removeObject.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_enumerable/removeObject.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_enumerable/removeObject.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_enumerable'); + QUnit.test('ember-runtime/tests/suites/mutable_enumerable/removeObject.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_enumerable/removeObject.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_enumerable/removeObjects', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal', 'ember-runtime/system/native_array'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal, _emberRuntimeSystemNative_array) { + 'use strict'; + + var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); + + suite.module('removeObjects'); + + suite.test('should return receiver', function () { + var before = _emberRuntimeSystemNative_array.A(this.newFixture(3)); + var obj = before; + + equal(obj.removeObjects(before[1]), obj, 'should return receiver'); + }); + + suite.test('[A,B,C].removeObjects([B]) => [A,C] + notify', function () { + var before = _emberRuntimeSystemNative_array.A(this.newFixture(3)); + var after = [before[0], before[2]]; + var obj = before; + var observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); // Prime the cache + + obj.removeObjects([before[1]]); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + } + }); + + suite.test('[{A},{B},{C}].removeObjects([{B}]) => [{A},{C}] + notify', function () { + var before = _emberRuntimeSystemNative_array.A(this.newObjectsFixture(3)); + var after = [before[0], before[2]]; + var obj = before; + var observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); // Prime the cache + + obj.removeObjects([before[1]]); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + } + }); + + suite.test('[A,B,C].removeObjects([A,B]) => [C] + notify', function () { + var before = _emberRuntimeSystemNative_array.A(this.newFixture(3)); + var after = [before[2]]; + var obj = before; + var observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); // Prime the cache + + obj.removeObjects([before[0], before[1]]); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + } + }); + + suite.test('[{A},{B},{C}].removeObjects([{A},{B}]) => [{C}] + notify', function () { + var before = _emberRuntimeSystemNative_array.A(this.newObjectsFixture(3)); + var after = [before[2]]; + var obj = before; + var observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); // Prime the cache + + obj.removeObjects([before[0], before[1]]); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + } + }); + + suite.test('[A,B,C].removeObjects([A,B,C]) => [] + notify', function () { + var before = _emberRuntimeSystemNative_array.A(this.newFixture(3)); + var after = []; + var obj = before; + var observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); // Prime the cache + + obj.removeObjects([before[0], before[1], before[2]]); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject'); + equal(observer.timesCalled('lastObject'), 1, 'should have notified lastObject'); + } + }); + + suite.test('[{A},{B},{C}].removeObjects([{A},{B},{C}]) => [] + notify', function () { + var before = _emberRuntimeSystemNative_array.A(this.newObjectsFixture(3)); + var after = []; + var obj = before; + var observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); // Prime the cache + + obj.removeObjects(before); + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.timesCalled('[]'), 1, 'should have notified [] once'); + equal(observer.timesCalled('length'), 1, 'should have notified length once'); + + equal(observer.timesCalled('firstObject'), 1, 'should have notified firstObject'); + equal(observer.validate('lastObject'), 1, 'should have notified lastObject'); + } + }); + + suite.test('[A,B,C].removeObjects([D]) => [A,B,C]', function () { + var before = _emberRuntimeSystemNative_array.A(this.newFixture(3)); + var after = before; + var item = this.newFixture(1)[0]; + var obj = before; + var observer = this.newObserver(obj, '[]', 'length', 'firstObject', 'lastObject'); + + obj.getProperties('firstObject', 'lastObject'); // Prime the cache + + obj.removeObjects([item]); // Note: item not in set + + deepEqual(this.toArray(obj), after, 'post item results'); + equal(_emberMetal.get(obj, 'length'), after.length, 'length'); + + if (observer.isEnabled) { + equal(observer.validate('[]'), false, 'should NOT have notified []'); + equal(observer.validate('length'), false, 'should NOT have notified length'); + + equal(observer.validate('firstObject'), false, 'should NOT have notified firstObject'); + equal(observer.validate('lastObject'), false, 'should NOT have notified lastObject'); + } + }); + + suite.test('Removing objects should notify enumerable observer', function () { + var fixtures = this.newFixture(3); + var obj = this.newObject(fixtures); + var observer = this.newObserver(obj).observeEnumerable(obj); + var item = fixtures[1]; + + obj.removeObjects([item]); + + deepEqual(observer._before, [obj, [item], null]); + deepEqual(observer._after, [obj, [item], null]); + }); + + exports.default = suite; +}); +enifed('ember-runtime/tests/suites/mutable_enumerable/removeObjects.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites/mutable_enumerable'); + test('ember-runtime/tests/suites/mutable_enumerable/removeObjects.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/mutable_enumerable/removeObjects.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/mutable_enumerable/removeObjects.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites/mutable_enumerable'); + QUnit.test('ember-runtime/tests/suites/mutable_enumerable/removeObjects.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/mutable_enumerable/removeObjects.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/suites/suite', ['exports', 'ember-utils', 'ember-runtime/system/object', 'ember-metal'], function (exports, _emberUtils, _emberRuntimeSystemObject, _emberMetal) { + 'use strict'; + + /* + @class + A Suite can be used to define a reusable set of unit tests that can be + applied to any object. Suites are most useful for defining tests that + work against a mixin or plugin API. Developers implementing objects that + use the mixin or support the API can then run these tests against their + own code to verify compliance. + + To define a suite, you need to define the tests themselves as well as a + callback API implementers can use to tie your tests to their specific class. + + ## Defining a Callback API + + To define the callback API, just extend this class and add your properties + or methods that must be provided. + + ## Defining Unit Tests + + To add unit tests, use the suite.module() or suite.test() methods instead + of a regular module() or test() method when defining your tests. This will + add the tests to the suite. + + ## Using a Suite + + To use a Suite to test your own objects, extend the suite subclass and + define any required methods. Then call run() on the new subclass. This + will create an instance of your class and then defining the unit tests. + + @extends Ember.Object + @private + */ + var Suite = _emberRuntimeSystemObject.default.extend({ + + /* + __Required.__ You must implement this method to apply this mixin. + Define a name for these tests - all modules are prefixed w/ it. + @type String + */ + name: null, + + /* + Invoked to actually run the test - overridden by mixins + */ + run: function () {} + + }); + + Suite.reopenClass({ + + plan: null, + + run: function () { + var C = this; + return new C().run(); + }, + + module: function (desc, opts) { + if (!opts) { + opts = {}; + } + + var setup = opts.setup; + var teardown = opts.teardown; + this.reopen({ + run: function () { + this._super.apply(this, arguments); + var title = _emberMetal.get(this, 'name') + ': ' + desc; + var ctx = this; + QUnit.module(title, { + setup: function () { + if (setup) { + setup.call(ctx); + } + }, + + teardown: function () { + if (teardown) { + teardown.call(ctx); + } + } + }); + } + }); + }, + + test: function (name, func) { + this.reopen({ + run: function () { + this._super.apply(this, arguments); + var ctx = this; + + if (!func) { + QUnit.test(name); // output warning + } else { + QUnit.test(name, function () { + return func.call(ctx); + }); + } + } + }); + }, + + // convert to guids to minimize logging. + same: function (actual, exp, message) { + actual = actual && actual.map ? actual.map(function (x) { + return _emberUtils.guidFor(x); + }) : actual; + exp = exp && exp.map ? exp.map(function (x) { + return _emberUtils.guidFor(x); + }) : exp; + return deepEqual(actual, exp, message); + }, + + // easy way to disable tests + notest: function () {}, + + importModuleTests: function (builder) { + var _this = this; + + this.module(builder._module); + + builder._tests.forEach(function (descAndFunc) { + _this.test.apply(_this, descAndFunc); + }); + } + }); + + var SuiteModuleBuilder = _emberRuntimeSystemObject.default.extend({ + _module: null, + _tests: null, + + init: function () { + this._tests = []; + }, + + module: function (name) { + this._module = name; + }, + + test: function (name, func) { + this._tests.push([name, func]); + } + }); + + exports.SuiteModuleBuilder = SuiteModuleBuilder; + exports.Suite = Suite; + exports.default = Suite; +}); +enifed('ember-runtime/tests/suites/suite.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/suites'); + test('ember-runtime/tests/suites/suite.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/suites/suite.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/suites/suite.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/suites'); + QUnit.test('ember-runtime/tests/suites/suite.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/suites/suite.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/application/base_test', ['exports', 'ember-runtime/system/namespace', 'ember-runtime/system/application'], function (exports, _emberRuntimeSystemNamespace, _emberRuntimeSystemApplication) { + 'use strict'; + + QUnit.module('Ember.Application'); + + QUnit.test('Ember.Application should be a subclass of Ember.Namespace', function () { + ok(_emberRuntimeSystemNamespace.default.detect(_emberRuntimeSystemApplication.default), 'Ember.Application subclass of Ember.Namespace'); + }); +}); +enifed('ember-runtime/tests/system/application/base_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/application'); + test('ember-runtime/tests/system/application/base_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/application/base_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/application/base_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/application'); + QUnit.test('ember-runtime/tests/system/application/base_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/application/base_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/arranged_content_test', ['exports', 'ember-metal', 'ember-runtime/system/array_proxy', 'ember-runtime/system/native_array', 'ember-runtime/mixins/array'], function (exports, _emberMetal, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemNative_array, _emberRuntimeMixinsArray) { + 'use strict'; + + var array = undefined; + + QUnit.module('ArrayProxy - arrangedContent', { + setup: function () { + _emberMetal.run(function () { + array = _emberRuntimeSystemArray_proxy.default.extend({ + arrangedContent: _emberMetal.computed('content.[]', function () { + var content = this.get('content'); + return content && _emberRuntimeSystemNative_array.A(content.slice().sort(function (a, b) { + if (a == null) { + a = -1; + } + if (b == null) { + b = -1; + } + return b - a; + })); + }) + }).create({ + content: _emberRuntimeSystemNative_array.A([1, 2, 4, 5]) + }); + }); + }, + teardown: function () { + _emberMetal.run(function () { + return array.destroy(); + }); + } + }); + + QUnit.test('addObject - adds to end of \'content\' if not present', function () { + _emberMetal.run(function () { + return array.addObject(3); + }); + + deepEqual(array.get('content'), [1, 2, 4, 5, 3], 'adds to end of content'); + deepEqual(array.get('arrangedContent'), [5, 4, 3, 2, 1], 'arrangedContent stays sorted'); + + _emberMetal.run(function () { + return array.addObject(1); + }); + + deepEqual(array.get('content'), [1, 2, 4, 5, 3], 'does not add existing number to content'); + }); + + QUnit.test('addObjects - adds to end of \'content\' if not present', function () { + _emberMetal.run(function () { + return array.addObjects([1, 3, 6]); + }); + + deepEqual(array.get('content'), [1, 2, 4, 5, 3, 6], 'adds to end of content'); + deepEqual(array.get('arrangedContent'), [6, 5, 4, 3, 2, 1], 'arrangedContent stays sorted'); + }); + + QUnit.test('compact - returns arrangedContent without nulls and undefined', function () { + _emberMetal.run(function () { + return array.set('content', _emberRuntimeSystemNative_array.A([1, 3, null, 2, undefined])); + }); + + deepEqual(array.compact(), [3, 2, 1]); + }); + + QUnit.test('indexOf - returns index of object in arrangedContent', function () { + equal(array.indexOf(4), 1, 'returns arranged index'); + }); + + QUnit.test('insertAt - raises, indeterminate behavior', function () { + throws(function () { + return _emberMetal.run(function () { + return array.insertAt(2, 3); + }); + }); + }); + + QUnit.test('lastIndexOf - returns last index of object in arrangedContent', function () { + _emberMetal.run(function () { + return array.pushObject(4); + }); + + equal(array.lastIndexOf(4), 2, 'returns last arranged index'); + }); + + QUnit.test('nextObject - returns object at index in arrangedContent', function () { + equal(array.nextObject(1), 4, 'returns object at index'); + }); + + QUnit.test('objectAt - returns object at index in arrangedContent', function () { + equal(_emberRuntimeMixinsArray.objectAt(array, 1), 4, 'returns object at index'); + }); + + // Not sure if we need a specific test for it, since it's internal + QUnit.test('objectAtContent - returns object at index in arrangedContent', function () { + equal(array.objectAtContent(1), 4, 'returns object at index'); + }); + + QUnit.test('objectsAt - returns objects at indices in arrangedContent', function () { + deepEqual(array.objectsAt([0, 2, 4]), [5, 2, undefined], 'returns objects at indices'); + }); + + QUnit.test('popObject - removes last object in arrangedContent', function () { + var popped = undefined; + _emberMetal.run(function () { + return popped = array.popObject(); + }); + equal(popped, 1, 'returns last object'); + deepEqual(array.get('content'), [2, 4, 5], 'removes from content'); + }); + + QUnit.test('pushObject - adds to end of content even if it already exists', function () { + _emberMetal.run(function () { + return array.pushObject(1); + }); + deepEqual(array.get('content'), [1, 2, 4, 5, 1], 'adds to end of content'); + }); + + QUnit.test('pushObjects - adds multiple to end of content even if it already exists', function () { + _emberMetal.run(function () { + return array.pushObjects([1, 2, 4]); + }); + deepEqual(array.get('content'), [1, 2, 4, 5, 1, 2, 4], 'adds to end of content'); + }); + + QUnit.test('removeAt - removes from index in arrangedContent', function () { + _emberMetal.run(function () { + return array.removeAt(1, 2); + }); + deepEqual(array.get('content'), [1, 5]); + }); + + QUnit.test('removeObject - removes object from content', function () { + _emberMetal.run(function () { + return array.removeObject(2); + }); + deepEqual(array.get('content'), [1, 4, 5]); + }); + + QUnit.test('removeObjects - removes objects from content', function () { + _emberMetal.run(function () { + return array.removeObjects([2, 4, 6]); + }); + deepEqual(array.get('content'), [1, 5]); + }); + + QUnit.test('replace - raises, indeterminate behavior', function () { + throws(function () { + return _emberMetal.run(function () { + return array.replace(1, 2, [3]); + }); + }); + }); + + QUnit.test('replaceContent - does a standard array replace on content', function () { + _emberMetal.run(function () { + return array.replaceContent(1, 2, [3]); + }); + deepEqual(array.get('content'), [1, 3, 5]); + }); + + QUnit.test('reverseObjects - raises, use Sortable#sortAscending', function () { + throws(function () { + return _emberMetal.run(function () { + return array.reverseObjects(); + }); + }); + }); + + QUnit.test('setObjects - replaces entire content', function () { + _emberMetal.run(function () { + return array.setObjects([6, 7, 8]); + }); + deepEqual(array.get('content'), [6, 7, 8], 'replaces content'); + }); + + QUnit.test('shiftObject - removes from start of arrangedContent', function () { + var shifted = _emberMetal.run(function () { + return array.shiftObject(); + }); + + equal(shifted, 5, 'returns first object'); + deepEqual(array.get('content'), [1, 2, 4], 'removes object from content'); + }); + + QUnit.test('slice - returns a slice of the arrangedContent', function () { + deepEqual(array.slice(1, 3), [4, 2], 'returns sliced arrangedContent'); + }); + + QUnit.test('toArray - returns copy of arrangedContent', function () { + deepEqual(array.toArray(), [5, 4, 2, 1]); + }); + + QUnit.test('unshiftObject - adds to start of content', function () { + _emberMetal.run(function () { + return array.unshiftObject(6); + }); + deepEqual(array.get('content'), [6, 1, 2, 4, 5], 'adds to start of content'); + }); + + QUnit.test('unshiftObjects - adds to start of content', function () { + _emberMetal.run(function () { + array.unshiftObjects([6, 7]); + }); + deepEqual(array.get('content'), [6, 7, 1, 2, 4, 5], 'adds to start of content'); + }); + + QUnit.test('without - returns arrangedContent without object', function () { + deepEqual(array.without(2), [5, 4, 1], 'returns arranged without object'); + }); + + QUnit.test('lastObject - returns last arranged object', function () { + equal(array.get('lastObject'), 1, 'returns last arranged object'); + }); + + QUnit.test('firstObject - returns first arranged object', function () { + equal(array.get('firstObject'), 5, 'returns first arranged object'); + }); + + QUnit.module('ArrayProxy - arrangedContent matching content', { + setup: function () { + _emberMetal.run(function () { + array = _emberRuntimeSystemArray_proxy.default.create({ + content: _emberRuntimeSystemNative_array.A([1, 2, 4, 5]) + }); + }); + }, + teardown: function () { + _emberMetal.run(function () { + array.destroy(); + }); + } + }); + + QUnit.test('insertAt - inserts object at specified index', function () { + _emberMetal.run(function () { + array.insertAt(2, 3); + }); + deepEqual(array.get('content'), [1, 2, 3, 4, 5]); + }); + + QUnit.test('replace - does a standard array replace', function () { + _emberMetal.run(function () { + array.replace(1, 2, [3]); + }); + deepEqual(array.get('content'), [1, 3, 5]); + }); + + QUnit.test('reverseObjects - reverses content', function () { + _emberMetal.run(function () { + array.reverseObjects(); + }); + deepEqual(array.get('content'), [5, 4, 2, 1]); + }); + + QUnit.module('ArrayProxy - arrangedContent with transforms', { + setup: function () { + _emberMetal.run(function () { + array = _emberRuntimeSystemArray_proxy.default.extend({ + arrangedContent: _emberMetal.computed(function () { + var content = this.get('content'); + return content && _emberRuntimeSystemNative_array.A(content.slice().sort(function (a, b) { + if (a == null) { + a = -1; + } + if (b == null) { + b = -1; + } + return b - a; + })); + }).property('content.[]'), + + objectAtContent: function (idx) { + var obj = _emberRuntimeMixinsArray.objectAt(this.get('arrangedContent'), idx); + return obj && obj.toString(); + } + }).create({ + content: _emberRuntimeSystemNative_array.A([1, 2, 4, 5]) + }); + }); + }, + teardown: function () { + _emberMetal.run(function () { + array.destroy(); + }); + } + }); + + QUnit.test('indexOf - returns index of object in arrangedContent', function () { + equal(array.indexOf('4'), 1, 'returns arranged index'); + }); + + QUnit.test('lastIndexOf - returns last index of object in arrangedContent', function () { + _emberMetal.run(function () { + array.pushObject(4); + }); + equal(array.lastIndexOf('4'), 2, 'returns last arranged index'); + }); + + QUnit.test('nextObject - returns object at index in arrangedContent', function () { + equal(array.nextObject(1), '4', 'returns object at index'); + }); + + QUnit.test('objectAt - returns object at index in arrangedContent', function () { + equal(_emberRuntimeMixinsArray.objectAt(array, 1), '4', 'returns object at index'); + }); + + // Not sure if we need a specific test for it, since it's internal + QUnit.test('objectAtContent - returns object at index in arrangedContent', function () { + equal(array.objectAtContent(1), '4', 'returns object at index'); + }); + + QUnit.test('objectsAt - returns objects at indices in arrangedContent', function () { + deepEqual(array.objectsAt([0, 2, 4]), ['5', '2', undefined], 'returns objects at indices'); + }); + + QUnit.test('popObject - removes last object in arrangedContent', function () { + var popped = undefined; + _emberMetal.run(function () { + popped = array.popObject(); + }); + equal(popped, '1', 'returns last object'); + deepEqual(array.get('content'), [2, 4, 5], 'removes from content'); + }); + + QUnit.test('removeObject - removes object from content', function () { + _emberMetal.run(function () { + array.removeObject('2'); + }); + deepEqual(array.get('content'), [1, 4, 5]); + }); + + QUnit.test('removeObjects - removes objects from content', function () { + _emberMetal.run(function () { + array.removeObjects(['2', '4', '6']); + }); + deepEqual(array.get('content'), [1, 5]); + }); + + QUnit.test('shiftObject - removes from start of arrangedContent', function () { + var shifted = undefined; + _emberMetal.run(function () { + shifted = array.shiftObject(); + }); + equal(shifted, '5', 'returns first object'); + deepEqual(array.get('content'), [1, 2, 4], 'removes object from content'); + }); + + QUnit.test('slice - returns a slice of the arrangedContent', function () { + deepEqual(array.slice(1, 3), ['4', '2'], 'returns sliced arrangedContent'); + }); + + QUnit.test('toArray - returns copy of arrangedContent', function () { + deepEqual(array.toArray(), ['5', '4', '2', '1']); + }); + + QUnit.test('without - returns arrangedContent without object', function () { + deepEqual(array.without('2'), ['5', '4', '1'], 'returns arranged without object'); + }); + + QUnit.test('lastObject - returns last arranged object', function () { + equal(array.get('lastObject'), '1', 'returns last arranged object'); + }); + + QUnit.test('firstObject - returns first arranged object', function () { + equal(array.get('firstObject'), '5', 'returns first arranged object'); + }); + + QUnit.test('arrangedContentArray{Will,Did}Change are called when the arranged content changes', function () { + // The behaviour covered by this test may change in the future if we decide + // that built-in array methods are not overridable. + + var willChangeCallCount = 0; + var didChangeCallCount = 0; + + var content = _emberRuntimeSystemNative_array.A([1, 2, 3]); + _emberRuntimeSystemArray_proxy.default.extend({ + arrangedContentArrayWillChange: function () { + willChangeCallCount++; + this._super.apply(this, arguments); + }, + arrangedContentArrayDidChange: function () { + didChangeCallCount++; + this._super.apply(this, arguments); + } + }).create({ content: content }); + + equal(willChangeCallCount, 0); + equal(didChangeCallCount, 0); + + content.pushObject(4); + content.pushObject(5); + + equal(willChangeCallCount, 2); + equal(didChangeCallCount, 2); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/arranged_content_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/array_proxy'); + test('ember-runtime/tests/system/array_proxy/arranged_content_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/array_proxy/arranged_content_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/arranged_content_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/array_proxy'); + QUnit.test('ember-runtime/tests/system/array_proxy/arranged_content_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/array_proxy/arranged_content_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/content_change_test', ['exports', 'ember-metal', 'ember-runtime/computed/computed_macros', 'ember-runtime/system/array_proxy', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeComputedComputed_macros, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemNative_array) { + 'use strict'; + + QUnit.module('ArrayProxy - content change'); + + QUnit.test('should update length for null content', function () { + var proxy = _emberRuntimeSystemArray_proxy.default.create({ + content: _emberRuntimeSystemNative_array.A([1, 2, 3]) + }); + + equal(proxy.get('length'), 3, 'precond - length is 3'); + + proxy.set('content', null); + + equal(proxy.get('length'), 0, 'length updates'); + }); + + QUnit.test('should update length for null content when there is a computed property watching length', function () { + var proxy = _emberRuntimeSystemArray_proxy.default.extend({ + isEmpty: _emberRuntimeComputedComputed_macros.not('length') + }).create({ + content: _emberRuntimeSystemNative_array.A([1, 2, 3]) + }); + + equal(proxy.get('length'), 3, 'precond - length is 3'); + + // Consume computed property that depends on length + proxy.get('isEmpty'); + + // update content + proxy.set('content', null); + + equal(proxy.get('length'), 0, 'length updates'); + }); + + QUnit.test('The `arrangedContentWillChange` method is invoked before `content` is changed.', function () { + var callCount = 0; + var expectedLength = undefined; + + var proxy = _emberRuntimeSystemArray_proxy.default.extend({ + arrangedContentWillChange: function () { + equal(this.get('arrangedContent.length'), expectedLength, 'hook should be invoked before array has changed'); + callCount++; + } + }).create({ content: _emberRuntimeSystemNative_array.A([1, 2, 3]) }); + + proxy.pushObject(4); + equal(callCount, 0, 'pushing content onto the array doesn\'t trigger it'); + + proxy.get('content').pushObject(5); + equal(callCount, 0, 'pushing content onto the content array doesn\'t trigger it'); + + expectedLength = 5; + proxy.set('content', _emberRuntimeSystemNative_array.A(['a', 'b'])); + equal(callCount, 1, 'replacing the content array triggers the hook'); + }); + + QUnit.test('The `arrangedContentDidChange` method is invoked after `content` is changed.', function () { + var callCount = 0; + var expectedLength = undefined; + + var proxy = _emberRuntimeSystemArray_proxy.default.extend({ + arrangedContentDidChange: function () { + equal(this.get('arrangedContent.length'), expectedLength, 'hook should be invoked after array has changed'); + callCount++; + } + }).create({ + content: _emberRuntimeSystemNative_array.A([1, 2, 3]) + }); + + equal(callCount, 0, 'hook is not called after creating the object'); + + proxy.pushObject(4); + equal(callCount, 0, 'pushing content onto the array doesn\'t trigger it'); + + proxy.get('content').pushObject(5); + equal(callCount, 0, 'pushing content onto the content array doesn\'t trigger it'); + + expectedLength = 2; + proxy.set('content', _emberRuntimeSystemNative_array.A(['a', 'b'])); + equal(callCount, 1, 'replacing the content array triggers the hook'); + }); + + QUnit.test('The ArrayProxy doesn\'t explode when assigned a destroyed object', function () { + var proxy1 = _emberRuntimeSystemArray_proxy.default.create(); + var proxy2 = _emberRuntimeSystemArray_proxy.default.create(); + + _emberMetal.run(function () { + return proxy1.destroy(); + }); + + _emberMetal.set(proxy2, 'content', proxy1); + + ok(true, 'No exception was raised'); + }); + + QUnit.test('arrayContent{Will,Did}Change are called when the content changes', function () { + // The behaviour covered by this test may change in the future if we decide + // that built-in array methods are not overridable. + + var willChangeCallCount = 0; + var didChangeCallCount = 0; + + var content = _emberRuntimeSystemNative_array.A([1, 2, 3]); + _emberRuntimeSystemArray_proxy.default.extend({ + arrayContentWillChange: function () { + willChangeCallCount++; + this._super.apply(this, arguments); + }, + arrayContentDidChange: function () { + didChangeCallCount++; + this._super.apply(this, arguments); + } + }).create({ content: content }); + + equal(willChangeCallCount, 0); + equal(didChangeCallCount, 0); + + content.pushObject(4); + content.pushObject(5); + + equal(willChangeCallCount, 2); + equal(didChangeCallCount, 2); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/content_change_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/array_proxy'); + test('ember-runtime/tests/system/array_proxy/content_change_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/array_proxy/content_change_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/content_change_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/array_proxy'); + QUnit.test('ember-runtime/tests/system/array_proxy/content_change_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/array_proxy/content_change_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/content_update_test', ['exports', 'ember-metal', 'ember-runtime/system/array_proxy', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemNative_array) { + 'use strict'; + + QUnit.module('Ember.ArrayProxy - content update'); + + QUnit.test('The `contentArrayDidChange` method is invoked after `content` is updated.', function () { + var observerCalled = false; + var proxy = _emberRuntimeSystemArray_proxy.default.extend({ + arrangedContent: _emberMetal.computed('content', function (key) { + return _emberRuntimeSystemNative_array.A(this.get('content').slice()); + }), + + contentArrayDidChange: function (array, idx, removedCount, addedCount) { + observerCalled = true; + return this._super(array, idx, removedCount, addedCount); + } + }).create({ + content: _emberRuntimeSystemNative_array.A() + }); + + proxy.pushObject(1); + + ok(observerCalled, 'contentArrayDidChange is invoked'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/content_update_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/array_proxy'); + test('ember-runtime/tests/system/array_proxy/content_update_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/array_proxy/content_update_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/content_update_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/array_proxy'); + QUnit.test('ember-runtime/tests/system/array_proxy/content_update_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/array_proxy/content_update_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/length_test', ['exports', 'ember-runtime/system/array_proxy', 'ember-runtime/system/object', 'ember-metal', 'ember-runtime/system/native_array'], function (exports, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemObject, _emberMetal, _emberRuntimeSystemNative_array) { + 'use strict'; + + QUnit.module('Ember.ArrayProxy - content change (length)'); + + QUnit.test('array proxy + aliasedProperty complex test', function () { + var aCalled = undefined, + bCalled = undefined, + cCalled = undefined, + dCalled = undefined, + eCalled = undefined; + + aCalled = bCalled = cCalled = dCalled = eCalled = 0; + + var obj = _emberRuntimeSystemObject.default.extend({ + colors: _emberMetal.computed.reads('model'), + length: _emberMetal.computed.reads('colors.length'), + + a: _emberMetal.observer('length', function () { + return aCalled++; + }), + b: _emberMetal.observer('colors.length', function () { + return bCalled++; + }), + c: _emberMetal.observer('colors.content.length', function () { + return cCalled++; + }), + d: _emberMetal.observer('colors.[]', function () { + return dCalled++; + }), + e: _emberMetal.observer('colors.content.[]', function () { + return eCalled++; + }) + }).create(); + + obj.set('model', _emberRuntimeSystemArray_proxy.default.create({ + content: _emberRuntimeSystemNative_array.A(['red', 'yellow', 'blue']) + })); + + equal(obj.get('colors.content.length'), 3); + equal(obj.get('colors.length'), 3); + equal(obj.get('length'), 3); + + equal(aCalled, 1, 'expected observer `length` to be called ONCE'); + equal(bCalled, 1, 'expected observer `colors.length` to be called ONCE'); + equal(cCalled, 1, 'expected observer `colors.content.length` to be called ONCE'); + equal(dCalled, 1, 'expected observer `colors.[]` to be called ONCE'); + equal(eCalled, 1, 'expected observer `colors.content.[]` to be called ONCE'); + + obj.get('colors').pushObjects(['green', 'red']); + + equal(obj.get('colors.content.length'), 5); + equal(obj.get('colors.length'), 5); + equal(obj.get('length'), 5); + + equal(aCalled, 2, 'expected observer `length` to be called TWICE'); + equal(bCalled, 2, 'expected observer `colors.length` to be called TWICE'); + equal(cCalled, 2, 'expected observer `colors.content.length` to be called TWICE'); + equal(dCalled, 2, 'expected observer `colors.[]` to be called TWICE'); + equal(eCalled, 2, 'expected observer `colors.content.[]` to be called TWICE'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/length_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/array_proxy'); + test('ember-runtime/tests/system/array_proxy/length_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/array_proxy/length_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/length_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/array_proxy'); + QUnit.test('ember-runtime/tests/system/array_proxy/length_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/array_proxy/length_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/suite_test', ['exports', 'ember-runtime/tests/suites/mutable_array', 'ember-runtime/system/array_proxy', 'ember-metal', 'ember-runtime/system/native_array'], function (exports, _emberRuntimeTestsSuitesMutable_array, _emberRuntimeSystemArray_proxy, _emberMetal, _emberRuntimeSystemNative_array) { + 'use strict'; + + _emberRuntimeTestsSuitesMutable_array.default.extend({ + name: 'Ember.ArrayProxy', + + newObject: function (ary) { + var ret = ary ? ary.slice() : this.newFixture(3); + return _emberRuntimeSystemArray_proxy.default.create({ content: _emberRuntimeSystemNative_array.A(ret) }); + }, + + mutate: function (obj) { + obj.pushObject(_emberMetal.get(obj, 'length') + 1); + }, + + toArray: function (obj) { + return obj.toArray ? obj.toArray() : obj.slice(); + } + }).run(); +}); +enifed('ember-runtime/tests/system/array_proxy/suite_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/array_proxy'); + test('ember-runtime/tests/system/array_proxy/suite_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/array_proxy/suite_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/suite_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/array_proxy'); + QUnit.test('ember-runtime/tests/system/array_proxy/suite_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/array_proxy/suite_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/watching_and_listening_test', ['exports', 'ember-metal', 'ember-runtime/system/array_proxy', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemNative_array) { + 'use strict'; + + function sortedListenersFor(obj, eventName) { + return _emberMetal.listenersFor(obj, eventName).sort(function (listener1, listener2) { + return listener1[1] > listener2[1] ? -1 : 1; + }); + } + + QUnit.module('ArrayProxy - watching and listening'); + + QUnit.test('setting \'content\' adds listeners correctly', function () { + var content = _emberRuntimeSystemNative_array.A(); + var proxy = _emberRuntimeSystemArray_proxy.default.create(); + + deepEqual(sortedListenersFor(content, '@array:before'), []); + deepEqual(sortedListenersFor(content, '@array:change'), []); + + proxy.set('content', content); + + deepEqual(sortedListenersFor(content, '@array:before'), [[proxy, 'contentArrayWillChange'], [proxy, 'arrangedContentArrayWillChange']]); + deepEqual(sortedListenersFor(content, '@array:change'), [[proxy, 'contentArrayDidChange'], [proxy, 'arrangedContentArrayDidChange']]); + }); + + QUnit.test('changing \'content\' adds and removes listeners correctly', function () { + var content1 = _emberRuntimeSystemNative_array.A(); + var content2 = _emberRuntimeSystemNative_array.A(); + var proxy = _emberRuntimeSystemArray_proxy.default.create({ content: content1 }); + + deepEqual(sortedListenersFor(content1, '@array:before'), [[proxy, 'contentArrayWillChange'], [proxy, 'arrangedContentArrayWillChange']]); + deepEqual(sortedListenersFor(content1, '@array:change'), [[proxy, 'contentArrayDidChange'], [proxy, 'arrangedContentArrayDidChange']]); + + proxy.set('content', content2); + + deepEqual(sortedListenersFor(content1, '@array:before'), []); + deepEqual(sortedListenersFor(content1, '@array:change'), []); + deepEqual(sortedListenersFor(content2, '@array:before'), [[proxy, 'contentArrayWillChange'], [proxy, 'arrangedContentArrayWillChange']]); + deepEqual(sortedListenersFor(content2, '@array:change'), [[proxy, 'contentArrayDidChange'], [proxy, 'arrangedContentArrayDidChange']]); + }); + + QUnit.test('regression test for https://github.com/emberjs/ember.js/issues/12475', function () { + var item1a = { id: 1 }; + var item1b = { id: 2 }; + var item1c = { id: 3 }; + var content1 = _emberRuntimeSystemNative_array.A([item1a, item1b, item1c]); + + var proxy = _emberRuntimeSystemArray_proxy.default.create({ content: content1 }); + var obj = { proxy: proxy }; + + _emberMetal.defineProperty(obj, 'ids', _emberMetal.computed('proxy.@each.id', function () { + return _emberMetal.get(this, 'proxy').mapBy('id'); + })); + + // These manually added observers are to simulate the observers added by the + // rendering process in a template like: + // + // {{#each items as |item|}} + // {{item.id}} + // {{/each}} + _emberMetal.addObserver(item1a, 'id', function () {}); + _emberMetal.addObserver(item1b, 'id', function () {}); + _emberMetal.addObserver(item1c, 'id', function () {}); + + // The EachProxy has not yet been consumed. Only the manually added + // observers are watching. + equal(_emberMetal.watcherCount(item1a, 'id'), 1); + equal(_emberMetal.watcherCount(item1b, 'id'), 1); + equal(_emberMetal.watcherCount(item1c, 'id'), 1); + + // Consume the each proxy. This causes the EachProxy to add two observers + // per item: one for "before" events and one for "after" events. + deepEqual(_emberMetal.get(obj, 'ids'), [1, 2, 3]); + + // For each item, the two each proxy observers and one manual added observer + // are watching. + equal(_emberMetal.watcherCount(item1a, 'id'), 3); + equal(_emberMetal.watcherCount(item1b, 'id'), 3); + equal(_emberMetal.watcherCount(item1c, 'id'), 3); + + // This should be a no-op because observers do not fire if the value + // 1. is an object and 2. is the same as the old value. + proxy.set('content', content1); + + equal(_emberMetal.watcherCount(item1a, 'id'), 3); + equal(_emberMetal.watcherCount(item1b, 'id'), 3); + equal(_emberMetal.watcherCount(item1c, 'id'), 3); + + // This is repeated to catch the regression. It should still be a no-op. + proxy.set('content', content1); + + equal(_emberMetal.watcherCount(item1a, 'id'), 3); + equal(_emberMetal.watcherCount(item1b, 'id'), 3); + equal(_emberMetal.watcherCount(item1c, 'id'), 3); + + // Set the content to a new array with completely different items and + // repeat the process. + var item2a = { id: 4 }; + var item2b = { id: 5 }; + var item2c = { id: 6 }; + var content2 = _emberRuntimeSystemNative_array.A([item2a, item2b, item2c]); + + _emberMetal.addObserver(item2a, 'id', function () {}); + _emberMetal.addObserver(item2b, 'id', function () {}); + _emberMetal.addObserver(item2c, 'id', function () {}); + + proxy.set('content', content2); + + deepEqual(_emberMetal.get(obj, 'ids'), [4, 5, 6]); + + equal(_emberMetal.watcherCount(item2a, 'id'), 3); + equal(_emberMetal.watcherCount(item2b, 'id'), 3); + equal(_emberMetal.watcherCount(item2c, 'id'), 3); + + // Ensure that the observers added by the EachProxy on all items in the + // first content array have been torn down. + equal(_emberMetal.watcherCount(item1a, 'id'), 1); + equal(_emberMetal.watcherCount(item1b, 'id'), 1); + equal(_emberMetal.watcherCount(item1c, 'id'), 1); + + proxy.set('content', content2); + + equal(_emberMetal.watcherCount(item2a, 'id'), 3); + equal(_emberMetal.watcherCount(item2b, 'id'), 3); + equal(_emberMetal.watcherCount(item2c, 'id'), 3); + + proxy.set('content', content2); + + equal(_emberMetal.watcherCount(item2a, 'id'), 3); + equal(_emberMetal.watcherCount(item2b, 'id'), 3); + equal(_emberMetal.watcherCount(item2c, 'id'), 3); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/watching_and_listening_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/array_proxy'); + test('ember-runtime/tests/system/array_proxy/watching_and_listening_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/array_proxy/watching_and_listening_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/array_proxy/watching_and_listening_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/array_proxy'); + QUnit.test('ember-runtime/tests/system/array_proxy/watching_and_listening_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/array_proxy/watching_and_listening_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/core_object_test', ['exports', 'ember-runtime/system/core_object', 'ember-metal/property_set', 'ember-metal/mixin'], function (exports, _emberRuntimeSystemCore_object, _emberMetalProperty_set, _emberMetalMixin) { + 'use strict'; + + QUnit.module('Ember.CoreObject'); + + QUnit.test('works with new (one arg)', function () { + var obj = new _emberRuntimeSystemCore_object.default({ + firstName: 'Stef', + lastName: 'Penner' + }); + + equal(obj.firstName, 'Stef'); + equal(obj.lastName, 'Penner'); + }); + + QUnit.test('works with new (> 1 arg)', function () { + var obj = new _emberRuntimeSystemCore_object.default({ + firstName: 'Stef', + lastName: 'Penner' + }, { + other: 'name' + }); + + equal(obj.firstName, 'Stef'); + equal(obj.lastName, 'Penner'); + + equal(obj.other, undefined); // doesn't support multiple pojo' to the constructor + }); + + QUnit.test('toString should be not be added as a property when calling toString()', function () { + var obj = new _emberRuntimeSystemCore_object.default({ + firstName: 'Foo', + lastName: 'Bar' + }); + + obj.toString(); + + notOk(obj.hasOwnProperty('toString'), 'Calling toString() should not create a toString class property'); + }); + + QUnit.test('[POST_INIT] invoked during construction', function (assert) { + var _CoreObject$extend; + + var callCount = 0; + var Obj = _emberRuntimeSystemCore_object.default.extend((_CoreObject$extend = {}, _CoreObject$extend[_emberRuntimeSystemCore_object.POST_INIT] = function () { + callCount++; + }, _CoreObject$extend)); + + equal(callCount, 0); + + Obj.create(); + + equal(callCount, 1); + }); + + QUnit.test('[POST_INIT] invoked before finishChains', function (assert) { + var _CoreObject$extend2; + + var callCount = 0; + + var Obj = _emberRuntimeSystemCore_object.default.extend((_CoreObject$extend2 = {}, _CoreObject$extend2[_emberRuntimeSystemCore_object.POST_INIT] = function () { + _emberMetalProperty_set.set(this, 'hi', 1); + }, _CoreObject$extend2.hiDidChange = _emberMetalMixin.observer('hi', function () { + callCount++; + }), _CoreObject$extend2)); + + equal(callCount, 0); + + var obj = Obj.create(); + + equal(callCount, 0); + + _emberMetalProperty_set.set(obj, 'hi', 2); + + equal(callCount, 1); + }); +}); +enifed('ember-runtime/tests/system/core_object_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system'); + test('ember-runtime/tests/system/core_object_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/core_object_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/core_object_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system'); + QUnit.test('ember-runtime/tests/system/core_object_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/core_object_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/lazy_load_test', ['exports', 'ember-metal', 'ember-runtime/system/lazy_load'], function (exports, _emberMetal, _emberRuntimeSystemLazy_load) { + 'use strict'; + + QUnit.module('Lazy Loading', { + teardown: function () { + var keys = Object.keys(_emberRuntimeSystemLazy_load._loaded); + for (var i = 0; i < keys.length; i++) { + delete _emberRuntimeSystemLazy_load._loaded[keys[i]]; + } + } + }); + + QUnit.test('if a load hook is registered, it is executed when runLoadHooks are exected', function () { + var count = 0; + + _emberMetal.run(function () { + _emberRuntimeSystemLazy_load.onLoad('__test_hook__', function (object) { + count += object; + }); + }); + + _emberMetal.run(function () { + _emberRuntimeSystemLazy_load.runLoadHooks('__test_hook__', 1); + }); + + equal(count, 1, 'the object was passed into the load hook'); + }); + + QUnit.test('if runLoadHooks was already run, it executes newly added hooks immediately', function () { + var count = 0; + _emberMetal.run(function () { + _emberRuntimeSystemLazy_load.onLoad('__test_hook__', function (object) { + return count += object; + }); + }); + + _emberMetal.run(function () { + return _emberRuntimeSystemLazy_load.runLoadHooks('__test_hook__', 1); + }); + + count = 0; + _emberMetal.run(function () { + _emberRuntimeSystemLazy_load.onLoad('__test_hook__', function (object) { + return count += object; + }); + }); + + equal(count, 1, 'the original object was passed into the load hook'); + }); + + QUnit.test('hooks in ENV.EMBER_LOAD_HOOKS[\'hookName\'] get executed', function () { + // Note that the necessary code to perform this test is run before + // the Ember lib is loaded in tests/index.html + + _emberMetal.run(function () { + _emberRuntimeSystemLazy_load.runLoadHooks('__before_ember_test_hook__', 1); + }); + + equal(window.ENV.__test_hook_count__, 1, 'the object was passed into the load hook'); + }); + + if (typeof window === 'object' && typeof window.dispatchEvent === 'function' && typeof CustomEvent === 'function') { + QUnit.test('load hooks trigger a custom event', function () { + var eventObject = 'super duper awesome events'; + + window.addEventListener('__test_hook_for_events__', function (e) { + ok(true, 'custom event was fired'); + equal(e.detail, eventObject, 'event details are provided properly'); + }); + + _emberMetal.run(function () { + _emberRuntimeSystemLazy_load.runLoadHooks('__test_hook_for_events__', eventObject); + }); + }); + } +}); +enifed('ember-runtime/tests/system/lazy_load_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system'); + test('ember-runtime/tests/system/lazy_load_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/lazy_load_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/lazy_load_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system'); + QUnit.test('ember-runtime/tests/system/lazy_load_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/lazy_load_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/namespace/base_test', ['exports', 'ember-environment', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/system/namespace'], function (exports, _emberEnvironment, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeSystemNamespace) { + 'use strict'; + + var originalLookup = _emberEnvironment.context.lookup; + var lookup = undefined; + + QUnit.module('Namespace', { + setup: function () { + _emberRuntimeSystemNamespace.setSearchDisabled(false); + + lookup = _emberEnvironment.context.lookup = {}; + }, + teardown: function () { + _emberRuntimeSystemNamespace.setSearchDisabled(false); + + for (var prop in lookup) { + if (lookup[prop]) { + _emberMetal.run(lookup[prop], 'destroy'); + } + } + + _emberEnvironment.context.lookup = originalLookup; + } + }); + + QUnit.test('Namespace should be a subclass of EmberObject', function () { + ok(_emberRuntimeSystemObject.default.detect(_emberRuntimeSystemNamespace.default)); + }); + + QUnit.test('Namespace should be duck typed', function () { + ok(_emberMetal.get(_emberRuntimeSystemNamespace.default.create(), 'isNamespace'), 'isNamespace property is true'); + }); + + QUnit.test('Namespace is found and named', function () { + var nsA = lookup.NamespaceA = _emberRuntimeSystemNamespace.default.create(); + equal(nsA.toString(), 'NamespaceA', 'namespaces should have a name if they are on lookup'); + + var nsB = lookup.NamespaceB = _emberRuntimeSystemNamespace.default.create(); + equal(nsB.toString(), 'NamespaceB', 'namespaces work if created after the first namespace processing pass'); + }); + + QUnit.test('Classes under an Namespace are properly named', function () { + var nsA = lookup.NamespaceA = _emberRuntimeSystemNamespace.default.create(); + nsA.Foo = _emberRuntimeSystemObject.default.extend(); + equal(nsA.Foo.toString(), 'NamespaceA.Foo', 'Classes pick up their parent namespace'); + + nsA.Bar = _emberRuntimeSystemObject.default.extend(); + equal(nsA.Bar.toString(), 'NamespaceA.Bar', 'New Classes get the naming treatment too'); + + var nsB = lookup.NamespaceB = _emberRuntimeSystemNamespace.default.create(); + nsB.Foo = _emberRuntimeSystemObject.default.extend(); + equal(nsB.Foo.toString(), 'NamespaceB.Foo', 'Classes in new namespaces get the naming treatment'); + }); + + //test("Classes under Ember are properly named", function() { + // // ES6TODO: This test does not work reliably when running independent package build with Broccoli config. + // Ember.TestObject = EmberObject.extend({}); + // equal(Ember.TestObject.toString(), "Ember.TestObject", "class under Ember is given a string representation"); + //}); + + QUnit.test('Lowercase namespaces are no longer supported', function () { + var nsC = lookup.namespaceC = _emberRuntimeSystemNamespace.default.create(); + equal(nsC.toString(), undefined); + }); + + QUnit.test('A namespace can be assigned a custom name', function () { + var nsA = _emberRuntimeSystemNamespace.default.create({ + name: 'NamespaceA' + }); + + var nsB = lookup.NamespaceB = _emberRuntimeSystemNamespace.default.create({ + name: 'CustomNamespaceB' + }); + + nsA.Foo = _emberRuntimeSystemObject.default.extend(); + nsB.Foo = _emberRuntimeSystemObject.default.extend(); + + equal(nsA.Foo.toString(), 'NamespaceA.Foo', 'The namespace\'s name is used when the namespace is not in the lookup object'); + equal(nsB.Foo.toString(), 'CustomNamespaceB.Foo', 'The namespace\'s name is used when the namespace is in the lookup object'); + }); + + QUnit.test('Calling namespace.nameClasses() eagerly names all classes', function () { + _emberRuntimeSystemNamespace.setSearchDisabled(true); + + var namespace = lookup.NS = _emberRuntimeSystemNamespace.default.create(); + + namespace.ClassA = _emberRuntimeSystemObject.default.extend(); + namespace.ClassB = _emberRuntimeSystemObject.default.extend(); + + _emberRuntimeSystemNamespace.default.processAll(); + + equal(namespace.ClassA.toString(), 'NS.ClassA'); + equal(namespace.ClassB.toString(), 'NS.ClassB'); + }); + + QUnit.test('A namespace can be looked up by its name', function () { + var NS = lookup.NS = _emberRuntimeSystemNamespace.default.create(); + var UI = lookup.UI = _emberRuntimeSystemNamespace.default.create(); + var CF = lookup.CF = _emberRuntimeSystemNamespace.default.create(); + + equal(_emberRuntimeSystemNamespace.default.byName('NS'), NS); + equal(_emberRuntimeSystemNamespace.default.byName('UI'), UI); + equal(_emberRuntimeSystemNamespace.default.byName('CF'), CF); + }); + + QUnit.test('A nested namespace can be looked up by its name', function () { + var UI = lookup.UI = _emberRuntimeSystemNamespace.default.create(); + UI.Nav = _emberRuntimeSystemNamespace.default.create(); + + equal(_emberRuntimeSystemNamespace.default.byName('UI.Nav'), UI.Nav); + }); + + QUnit.test('Destroying a namespace before caching lookup removes it from the list of namespaces', function () { + var CF = lookup.CF = _emberRuntimeSystemNamespace.default.create(); + + _emberMetal.run(CF, 'destroy'); + equal(_emberRuntimeSystemNamespace.default.byName('CF'), undefined, 'namespace can not be found after destroyed'); + }); + + QUnit.test('Destroying a namespace after looking up removes it from the list of namespaces', function () { + var CF = lookup.CF = _emberRuntimeSystemNamespace.default.create(); + + equal(_emberRuntimeSystemNamespace.default.byName('CF'), CF, 'precondition - namespace can be looked up by name'); + + _emberMetal.run(CF, 'destroy'); + equal(_emberRuntimeSystemNamespace.default.byName('CF'), undefined, 'namespace can not be found after destroyed'); + }); +}); +enifed('ember-runtime/tests/system/namespace/base_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/namespace'); + test('ember-runtime/tests/system/namespace/base_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/namespace/base_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/namespace/base_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/namespace'); + QUnit.test('ember-runtime/tests/system/namespace/base_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/namespace/base_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/native_array/a_test', ['exports', 'ember-runtime/mixins/array', 'ember-runtime/system/native_array'], function (exports, _emberRuntimeMixinsArray, _emberRuntimeSystemNative_array) { + 'use strict'; + + QUnit.module('Ember.A'); + + QUnit.test('Ember.A', function () { + deepEqual(_emberRuntimeSystemNative_array.A([1, 2]), [1, 2], 'array values were not be modified'); + deepEqual(_emberRuntimeSystemNative_array.A(), [], 'returned an array with no arguments'); + deepEqual(_emberRuntimeSystemNative_array.A(null), [], 'returned an array with a null argument'); + ok(_emberRuntimeMixinsArray.default.detect(_emberRuntimeSystemNative_array.A()), 'returned an ember array'); + ok(_emberRuntimeMixinsArray.default.detect(_emberRuntimeSystemNative_array.A([1, 2])), 'returned an ember array'); + }); +}); +enifed('ember-runtime/tests/system/native_array/a_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/native_array'); + test('ember-runtime/tests/system/native_array/a_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/native_array/a_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/native_array/a_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/native_array'); + QUnit.test('ember-runtime/tests/system/native_array/a_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/native_array/a_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/native_array/copyable_suite_test', ['exports', 'ember-utils', 'ember-runtime/system/native_array', 'ember-runtime/tests/suites/copyable'], function (exports, _emberUtils, _emberRuntimeSystemNative_array, _emberRuntimeTestsSuitesCopyable) { + 'use strict'; + + _emberRuntimeTestsSuitesCopyable.default.extend({ + name: 'NativeArray Copyable', + + newObject: function () { + return _emberRuntimeSystemNative_array.A([_emberUtils.generateGuid()]); + }, + + isEqual: function (a, b) { + if (!(a instanceof Array)) { + return false; + } + + if (!(b instanceof Array)) { + return false; + } + + if (a.length !== b.length) { + return false; + } + + return a[0] === b[0]; + }, + + shouldBeFreezable: false + }).run(); + + QUnit.module('NativeArray Copyable'); + + QUnit.test('deep copy is respected', function () { + var array = _emberRuntimeSystemNative_array.A([{ id: 1 }, { id: 2 }, { id: 3 }]); + + var copiedArray = array.copy(true); + + deepEqual(copiedArray, array, 'copied array is equivalent'); + ok(copiedArray[0] !== array[0], 'objects inside should be unique'); + }); +}); +enifed('ember-runtime/tests/system/native_array/copyable_suite_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/native_array'); + test('ember-runtime/tests/system/native_array/copyable_suite_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/native_array/copyable_suite_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/native_array/copyable_suite_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/native_array'); + QUnit.test('ember-runtime/tests/system/native_array/copyable_suite_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/native_array/copyable_suite_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/native_array/suite_test', ['exports', 'ember-runtime/system/native_array', 'ember-runtime/tests/suites/mutable_array'], function (exports, _emberRuntimeSystemNative_array, _emberRuntimeTestsSuitesMutable_array) { + 'use strict'; + + _emberRuntimeTestsSuitesMutable_array.default.extend({ + name: 'Native Array', + + newObject: function (ary) { + return _emberRuntimeSystemNative_array.A(ary ? ary.slice() : this.newFixture(3)); + }, + + mutate: function (obj) { + obj.pushObject(obj.length + 1); + }, + + toArray: function (obj) { + return obj.slice(); // make a copy. + } + }).run(); +}); +enifed('ember-runtime/tests/system/native_array/suite_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/native_array'); + test('ember-runtime/tests/system/native_array/suite_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/native_array/suite_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/native_array/suite_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/native_array'); + QUnit.test('ember-runtime/tests/system/native_array/suite_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/native_array/suite_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/computed_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject) { + 'use strict'; + + function K() { + return this; + } + + QUnit.module('EmberObject computed property'); + + _internalTestHelpers.testWithDefault('computed property on instance', function (get, set) { + var MyClass = _emberRuntimeSystemObject.default.extend({ + foo: _emberMetal.computed(function () { + return 'FOO'; + }) + }); + + equal(get(new MyClass(), 'foo'), 'FOO'); + }); + + _internalTestHelpers.testWithDefault('computed property on subclass', function (get, set) { + var MyClass = _emberRuntimeSystemObject.default.extend({ + foo: _emberMetal.computed(function () { + return 'FOO'; + }) + }); + + var Subclass = MyClass.extend({ + foo: _emberMetal.computed(function () { + return 'BAR'; + }) + }); + + equal(get(new Subclass(), 'foo'), 'BAR'); + }); + + _internalTestHelpers.testWithDefault('replacing computed property with regular val', function (get, set) { + var MyClass = _emberRuntimeSystemObject.default.extend({ + foo: _emberMetal.computed(function () { + return 'FOO'; + }) + }); + + var Subclass = MyClass.extend({ + foo: 'BAR' + }); + + equal(get(new Subclass(), 'foo'), 'BAR'); + }); + + _internalTestHelpers.testWithDefault('complex depndent keys', function (get, set) { + var MyClass = _emberRuntimeSystemObject.default.extend({ + + init: function () { + this._super.apply(this, arguments); + set(this, 'bar', { baz: 'BIFF' }); + }, + + count: 0, + + foo: _emberMetal.computed(function () { + set(this, 'count', get(this, 'count') + 1); + return _emberMetal.get(get(this, 'bar'), 'baz') + ' ' + get(this, 'count'); + }).property('bar.baz') + + }); + + var Subclass = MyClass.extend({ + count: 20 + }); + + var obj1 = new MyClass(); + var obj2 = new Subclass(); + + equal(get(obj1, 'foo'), 'BIFF 1'); + equal(get(obj2, 'foo'), 'BIFF 21'); + + set(get(obj1, 'bar'), 'baz', 'BLARG'); + + equal(get(obj1, 'foo'), 'BLARG 2'); + equal(get(obj2, 'foo'), 'BIFF 21'); + + set(get(obj2, 'bar'), 'baz', 'BOOM'); + + equal(get(obj1, 'foo'), 'BLARG 2'); + equal(get(obj2, 'foo'), 'BOOM 22'); + }); + + _internalTestHelpers.testWithDefault('complex dependent keys changing complex dependent keys', function (get, set) { + var MyClass = _emberRuntimeSystemObject.default.extend({ + init: function () { + this._super.apply(this, arguments); + set(this, 'bar', { baz: 'BIFF' }); + }, + + count: 0, + + foo: _emberMetal.computed(function () { + set(this, 'count', get(this, 'count') + 1); + return _emberMetal.get(get(this, 'bar'), 'baz') + ' ' + get(this, 'count'); + }).property('bar.baz') + }); + + var Subclass = MyClass.extend({ + init: function () { + this._super.apply(this, arguments); + set(this, 'bar2', { baz: 'BIFF2' }); + }, + + count: 0, + + foo: _emberMetal.computed(function () { + set(this, 'count', get(this, 'count') + 1); + return _emberMetal.get(get(this, 'bar2'), 'baz') + ' ' + get(this, 'count'); + }).property('bar2.baz') + }); + + var obj2 = new Subclass(); + + equal(get(obj2, 'foo'), 'BIFF2 1'); + + set(get(obj2, 'bar'), 'baz', 'BLARG'); + equal(get(obj2, 'foo'), 'BIFF2 1', 'should not invalidate property'); + + set(get(obj2, 'bar2'), 'baz', 'BLARG'); + equal(get(obj2, 'foo'), 'BLARG 2', 'should invalidate property'); + }); + + QUnit.test('can retrieve metadata for a computed property', function () { + var MyClass = _emberRuntimeSystemObject.default.extend({ + computedProperty: _emberMetal.computed(function () {}).meta({ key: 'keyValue' }) + }); + + equal(_emberMetal.get(MyClass.metaForProperty('computedProperty'), 'key'), 'keyValue', 'metadata saved on the computed property can be retrieved'); + + var ClassWithNoMetadata = _emberRuntimeSystemObject.default.extend({ + computedProperty: _emberMetal.computed(function () {}).volatile(), + + staticProperty: 12 + }); + + equal(typeof ClassWithNoMetadata.metaForProperty('computedProperty'), 'object', 'returns empty hash if no metadata has been saved'); + + expectAssertion(function () { + ClassWithNoMetadata.metaForProperty('nonexistentProperty'); + }, 'metaForProperty() could not find a computed property with key \'nonexistentProperty\'.'); + + expectAssertion(function () { + ClassWithNoMetadata.metaForProperty('staticProperty'); + }, 'metaForProperty() could not find a computed property with key \'staticProperty\'.'); + }); + + QUnit.test('can iterate over a list of computed properties for a class', function () { + var MyClass = _emberRuntimeSystemObject.default.extend({ + foo: _emberMetal.computed(function () {}), + + fooDidChange: _emberMetal.observer('foo', function () {}), + + bar: _emberMetal.computed(function () {}), + + qux: _emberMetal.alias('foo') + }); + + var SubClass = MyClass.extend({ + baz: _emberMetal.computed(function () {}) + }); + + SubClass.reopen({ + bat: _emberMetal.computed(function () {}).meta({ iAmBat: true }) + }); + + var list = []; + + MyClass.eachComputedProperty(function (name) { + list.push(name); + }); + + deepEqual(list.sort(), ['bar', 'foo', 'qux'], 'watched and unwatched computed properties are iterated'); + + list = []; + + SubClass.eachComputedProperty(function (name, meta) { + list.push(name); + + if (name === 'bat') { + deepEqual(meta, { iAmBat: true }); + } else { + deepEqual(meta, {}); + } + }); + + deepEqual(list.sort(), ['bar', 'bat', 'baz', 'foo', 'qux'], 'all inherited properties are included'); + }); + + QUnit.test('list of properties updates when an additional property is added (such cache busting)', function () { + var MyClass = _emberRuntimeSystemObject.default.extend({ + foo: _emberMetal.computed(K), + + fooDidChange: _emberMetal.observer('foo', function () {}), + + bar: _emberMetal.computed(K) + }); + + var list = []; + + MyClass.eachComputedProperty(function (name) { + list.push(name); + }); + + deepEqual(list.sort(), ['bar', 'foo'].sort(), 'expected two computed properties'); + + MyClass.reopen({ + baz: _emberMetal.computed(K) + }); + + MyClass.create(); // force apply mixins + + list = []; + + MyClass.eachComputedProperty(function (name) { + list.push(name); + }); + + deepEqual(list.sort(), ['bar', 'foo', 'baz'].sort(), 'expected three computed properties'); + }); + + QUnit.test('Calling _super in call outside the immediate function of a CP getter works', function () { + function macro(callback) { + return _emberMetal.computed(function () { + return callback.call(this); + }); + } + + var MyClass = _emberRuntimeSystemObject.default.extend({ + foo: _emberMetal.computed(function () { + return 'FOO'; + }) + }); + + var SubClass = MyClass.extend({ + foo: macro(function () { + return this._super(); + }) + }); + + ok(_emberMetal.get(SubClass.create(), 'foo'), 'FOO', 'super value is fetched'); + }); + + QUnit.test('Calling _super in apply outside the immediate function of a CP getter works', function () { + function macro(callback) { + return _emberMetal.computed(function () { + return callback.apply(this); + }); + } + + var MyClass = _emberRuntimeSystemObject.default.extend({ + foo: _emberMetal.computed(function () { + return 'FOO'; + }) + }); + + var SubClass = MyClass.extend({ + foo: macro(function () { + return this._super(); + }) + }); + + ok(_emberMetal.get(SubClass.create(), 'foo'), 'FOO', 'super value is fetched'); + }); +}); +enifed('ember-runtime/tests/system/object/computed_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/computed_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/computed_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/computed_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/computed_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/computed_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/create_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { + 'use strict'; + + QUnit.module('EmberObject.create', {}); + + QUnit.test('simple properties are set', function () { + var o = _emberRuntimeSystemObject.default.create({ ohai: 'there' }); + equal(o.get('ohai'), 'there'); + }); + + QUnit.test('calls computed property setters', function () { + var MyClass = _emberRuntimeSystemObject.default.extend({ + foo: _emberMetal.computed({ + get: function () { + return 'this is not the value you\'re looking for'; + }, + set: function (key, value) { + return value; + } + }) + }); + + var o = MyClass.create({ foo: 'bar' }); + equal(o.get('foo'), 'bar'); + }); + + if (false) { + QUnit.test('sets up mandatory setters for watched simple properties', function () { + var MyClass = _emberRuntimeSystemObject.default.extend({ + foo: null, + bar: null, + fooDidChange: _emberMetal.observer('foo', function () {}) + }); + + var o = MyClass.create({ foo: 'bar', bar: 'baz' }); + equal(o.get('foo'), 'bar'); + + var descriptor = Object.getOwnPropertyDescriptor(o, 'foo'); + ok(descriptor.set, 'Mandatory setter was setup'); + + descriptor = Object.getOwnPropertyDescriptor(o, 'bar'); + ok(!descriptor.set, 'Mandatory setter was not setup'); + }); + } + + QUnit.test('allows bindings to be defined', function () { + var obj = undefined; + + var deprecationMessage = /`Ember.Binding` is deprecated/; + + expectDeprecation(function () { + obj = _emberRuntimeSystemObject.default.create({ + foo: 'foo', + barBinding: 'foo' + }); + }, deprecationMessage); + + equal(obj.get('bar'), 'foo', 'The binding value is correct'); + }); + + QUnit.test('calls setUnknownProperty if defined', function () { + var setUnknownPropertyCalled = false; + + var MyClass = _emberRuntimeSystemObject.default.extend({ + setUnknownProperty: function (key, value) { + setUnknownPropertyCalled = true; + } + }); + + MyClass.create({ foo: 'bar' }); + ok(setUnknownPropertyCalled, 'setUnknownProperty was called'); + }); + + QUnit.test('throws if you try to define a computed property', function () { + expectAssertion(function () { + _emberRuntimeSystemObject.default.create({ + foo: _emberMetal.computed(function () {}) + }); + }, 'Ember.Object.create no longer supports defining computed properties. Define computed properties using extend() or reopen() before calling create().'); + }); + + QUnit.test('throws if you try to call _super in a method', function () { + expectAssertion(function () { + _emberRuntimeSystemObject.default.create({ + foo: function () { + this._super.apply(this, arguments); + } + }); + }, 'Ember.Object.create no longer supports defining methods that call _super.'); + }); + + QUnit.test('throws if you try to \'mixin\' a definition', function () { + var myMixin = _emberMetal.Mixin.create({ + adder: function (arg1, arg2) { + return arg1 + arg2; + } + }); + + expectAssertion(function () { + _emberRuntimeSystemObject.default.create(myMixin); + }, 'Ember.Object.create no longer supports mixing in other definitions, use .extend & .create separately instead.'); + }); + + // This test is for IE8. + QUnit.test('property name is the same as own prototype property', function () { + var MyClass = _emberRuntimeSystemObject.default.extend({ + toString: function () { + return 'MyClass'; + } + }); + + equal(MyClass.create().toString(), 'MyClass', 'should inherit property from the arguments of `EmberObject.create`'); + }); + + QUnit.test('inherits properties from passed in EmberObject', function () { + var baseObj = _emberRuntimeSystemObject.default.create({ foo: 'bar' }); + var secondaryObj = _emberRuntimeSystemObject.default.create(baseObj); + + equal(secondaryObj.foo, baseObj.foo, 'Em.O.create inherits properties from EmberObject parameter'); + }); + + QUnit.test('throws if you try to pass anything a string as a parameter', function () { + var expected = 'EmberObject.create only accepts an objects.'; + + throws(function () { + return _emberRuntimeSystemObject.default.create('some-string'); + }, expected); + }); + + QUnit.test('EmberObject.create can take undefined as a parameter', function () { + var o = _emberRuntimeSystemObject.default.create(undefined); + deepEqual(_emberRuntimeSystemObject.default.create(), o); + }); + + QUnit.test('EmberObject.create can take null as a parameter', function () { + var o = _emberRuntimeSystemObject.default.create(null); + deepEqual(_emberRuntimeSystemObject.default.create(), o); + }); + + QUnit.test('EmberObject.create avoids allocating a binding map when not necessary', function () { + var o = _emberRuntimeSystemObject.default.create(); + var m = _emberMetal.meta(o); + ok(!m.peekBindings(), 'A binding map is not allocated'); + }); +}); +enifed('ember-runtime/tests/system/object/create_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/create_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/create_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/create_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/create_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/create_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/destroy_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject) { + 'use strict'; + + QUnit.module('ember-runtime/system/object/destroy_test'); + + _internalTestHelpers.testBoth('should schedule objects to be destroyed at the end of the run loop', function (get, set) { + var obj = _emberRuntimeSystemObject.default.create(); + var meta = undefined; + + _emberMetal.run(function () { + obj.destroy(); + meta = _emberMetal.peekMeta(obj); + ok(meta, 'meta is not destroyed immediately'); + ok(get(obj, 'isDestroying'), 'object is marked as destroying immediately'); + ok(!get(obj, 'isDestroyed'), 'object is not destroyed immediately'); + }); + + meta = _emberMetal.peekMeta(obj); + ok(get(obj, 'isDestroyed'), 'object is destroyed after run loop finishes'); + }); + + if (false) { + // MANDATORY_SETTER moves value to meta.values + // a destroyed object removes meta but leaves the accessor + // that looks it up + QUnit.test('should raise an exception when modifying watched properties on a destroyed object', function () { + var obj = _emberRuntimeSystemObject.default.extend({ + fooDidChange: _emberMetal.observer('foo', function () {}) + }).create({ + foo: 'bar' + }); + + _emberMetal.run(function () { + return obj.destroy(); + }); + + throws(function () { + return _emberMetal.set(obj, 'foo', 'baz'); + }, Error, 'raises an exception'); + }); + } + + QUnit.test('observers should not fire after an object has been destroyed', function () { + var count = 0; + var obj = _emberRuntimeSystemObject.default.extend({ + fooDidChange: _emberMetal.observer('foo', function () { + count++; + }) + }).create(); + + obj.set('foo', 'bar'); + + equal(count, 1, 'observer was fired once'); + + _emberMetal.run(function () { + _emberMetal.beginPropertyChanges(); + obj.set('foo', 'quux'); + obj.destroy(); + _emberMetal.endPropertyChanges(); + }); + + equal(count, 1, 'observer was not called after object was destroyed'); + }); + + QUnit.test('destroyed objects should not see each others changes during teardown but a long lived object should', function () { + var shouldChange = 0; + var shouldNotChange = 0; + + var objs = {}; + + var A = _emberRuntimeSystemObject.default.extend({ + objs: objs, + isAlive: true, + willDestroy: function () { + this.set('isAlive', false); + }, + bDidChange: _emberMetal.observer('objs.b.isAlive', function () { + shouldNotChange++; + }), + cDidChange: _emberMetal.observer('objs.c.isAlive', function () { + shouldNotChange++; + }) + }); + + var B = _emberRuntimeSystemObject.default.extend({ + objs: objs, + isAlive: true, + willDestroy: function () { + this.set('isAlive', false); + }, + aDidChange: _emberMetal.observer('objs.a.isAlive', function () { + shouldNotChange++; + }), + cDidChange: _emberMetal.observer('objs.c.isAlive', function () { + shouldNotChange++; + }) + }); + + var C = _emberRuntimeSystemObject.default.extend({ + objs: objs, + isAlive: true, + willDestroy: function () { + this.set('isAlive', false); + }, + aDidChange: _emberMetal.observer('objs.a.isAlive', function () { + shouldNotChange++; + }), + bDidChange: _emberMetal.observer('objs.b.isAlive', function () { + shouldNotChange++; + }) + }); + + var LongLivedObject = _emberRuntimeSystemObject.default.extend({ + objs: objs, + isAliveDidChange: _emberMetal.observer('objs.a.isAlive', function () { + shouldChange++; + }) + }); + + objs.a = new A(); + + objs.b = new B(); + + objs.c = new C(); + + new LongLivedObject(); + + _emberMetal.run(function () { + var keys = Object.keys(objs); + for (var i = 0; i < keys.length; i++) { + objs[keys[i]].destroy(); + } + }); + + equal(shouldNotChange, 0, 'destroyed graph objs should not see change in willDestroy'); + equal(shouldChange, 1, 'long lived should see change in willDestroy'); + }); + + QUnit.test('bindings should be synced when are updated in the willDestroy hook', function () { + var bar = _emberRuntimeSystemObject.default.create({ + value: false, + willDestroy: function () { + this.set('value', true); + } + }); + + var foo = _emberRuntimeSystemObject.default.create({ + value: null, + bar: bar + }); + + _emberMetal.run(function () { + var deprecationMessage = /`Ember.Binding` is deprecated/; + + expectDeprecation(function () { + _emberMetal.bind(foo, 'value', 'bar.value'); + }, deprecationMessage); + }); + + ok(bar.get('value') === false, 'the initial value has been bound'); + + _emberMetal.run(function () { + return bar.destroy(); + }); + + ok(foo.get('value'), 'foo is synced when the binding is updated in the willDestroy hook'); + }); +}); +enifed('ember-runtime/tests/system/object/destroy_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/destroy_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/destroy_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/destroy_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/destroy_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/destroy_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/detectInstance_test', ['exports', 'ember-runtime/system/object'], function (exports, _emberRuntimeSystemObject) { + 'use strict'; + + QUnit.module('system/object/detectInstance'); + + QUnit.test('detectInstance detects instances correctly', function () { + var A = _emberRuntimeSystemObject.default.extend(); + var B = A.extend(); + var C = A.extend(); + + var o = _emberRuntimeSystemObject.default.create(); + var a = A.create(); + var b = B.create(); + var c = C.create(); + + ok(_emberRuntimeSystemObject.default.detectInstance(o), 'o is an instance of EmberObject'); + ok(_emberRuntimeSystemObject.default.detectInstance(a), 'a is an instance of EmberObject'); + ok(_emberRuntimeSystemObject.default.detectInstance(b), 'b is an instance of EmberObject'); + ok(_emberRuntimeSystemObject.default.detectInstance(c), 'c is an instance of EmberObject'); + + ok(!A.detectInstance(o), 'o is not an instance of A'); + ok(A.detectInstance(a), 'a is an instance of A'); + ok(A.detectInstance(b), 'b is an instance of A'); + ok(A.detectInstance(c), 'c is an instance of A'); + + ok(!B.detectInstance(o), 'o is not an instance of B'); + ok(!B.detectInstance(a), 'a is not an instance of B'); + ok(B.detectInstance(b), 'b is an instance of B'); + ok(!B.detectInstance(c), 'c is not an instance of B'); + + ok(!C.detectInstance(o), 'o is not an instance of C'); + ok(!C.detectInstance(a), 'a is not an instance of C'); + ok(!C.detectInstance(b), 'b is not an instance of C'); + ok(C.detectInstance(c), 'c is an instance of C'); + }); +}); +enifed('ember-runtime/tests/system/object/detectInstance_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/detectInstance_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/detectInstance_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/detectInstance_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/detectInstance_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/detectInstance_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/detect_test', ['exports', 'ember-runtime/system/object'], function (exports, _emberRuntimeSystemObject) { + 'use strict'; + + QUnit.module('system/object/detect'); + + QUnit.test('detect detects classes correctly', function () { + var A = _emberRuntimeSystemObject.default.extend(); + var B = A.extend(); + var C = A.extend(); + + ok(_emberRuntimeSystemObject.default.detect(_emberRuntimeSystemObject.default), 'EmberObject is an EmberObject class'); + ok(_emberRuntimeSystemObject.default.detect(A), 'A is an EmberObject class'); + ok(_emberRuntimeSystemObject.default.detect(B), 'B is an EmberObject class'); + ok(_emberRuntimeSystemObject.default.detect(C), 'C is an EmberObject class'); + + ok(!A.detect(_emberRuntimeSystemObject.default), 'EmberObject is not an A class'); + ok(A.detect(A), 'A is an A class'); + ok(A.detect(B), 'B is an A class'); + ok(A.detect(C), 'C is an A class'); + + ok(!B.detect(_emberRuntimeSystemObject.default), 'EmberObject is not a B class'); + ok(!B.detect(A), 'A is not a B class'); + ok(B.detect(B), 'B is a B class'); + ok(!B.detect(C), 'C is not a B class'); + + ok(!C.detect(_emberRuntimeSystemObject.default), 'EmberObject is not a C class'); + ok(!C.detect(A), 'A is not a C class'); + ok(!C.detect(B), 'B is not a C class'); + ok(C.detect(C), 'C is a C class'); + }); +}); +enifed('ember-runtime/tests/system/object/detect_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/detect_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/detect_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/detect_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/detect_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/detect_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/events_test', ['exports', 'ember-runtime/system/object', 'ember-runtime/mixins/evented'], function (exports, _emberRuntimeSystemObject, _emberRuntimeMixinsEvented) { + 'use strict'; + + QUnit.module('Object events'); + + QUnit.test('a listener can be added to an object', function () { + var count = 0; + var F = function () { + count++; + }; + + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEvented.default).create(); + + obj.on('event!', F); + obj.trigger('event!'); + + equal(count, 1, 'the event was triggered'); + + obj.trigger('event!'); + + equal(count, 2, 'the event was triggered'); + }); + + QUnit.test('a listener can be added and removed automatically the first time it is triggered', function () { + var count = 0; + var F = function () { + count++; + }; + + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEvented.default).create(); + + obj.one('event!', F); + obj.trigger('event!'); + + equal(count, 1, 'the event was triggered'); + + obj.trigger('event!'); + + equal(count, 1, 'the event was not triggered again'); + }); + + QUnit.test('triggering an event can have arguments', function () { + var self = undefined, + args = undefined; + + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEvented.default).create(); + + obj.on('event!', function () { + args = [].slice.call(arguments); + self = this; + }); + + obj.trigger('event!', 'foo', 'bar'); + + deepEqual(args, ['foo', 'bar']); + equal(self, obj); + }); + + QUnit.test('a listener can be added and removed automatically and have arguments', function () { + var self = undefined, + args = undefined; + var count = 0; + + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEvented.default).create(); + + obj.one('event!', function () { + args = [].slice.call(arguments); + self = this; + count++; + }); + + obj.trigger('event!', 'foo', 'bar'); + + deepEqual(args, ['foo', 'bar']); + equal(self, obj); + equal(count, 1, 'the event is triggered once'); + + obj.trigger('event!', 'baz', 'bat'); + + deepEqual(args, ['foo', 'bar']); + equal(count, 1, 'the event was not triggered again'); + equal(self, obj); + }); + + QUnit.test('binding an event can specify a different target', function () { + var self = undefined, + args = undefined; + + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEvented.default).create(); + var target = {}; + + obj.on('event!', target, function () { + args = [].slice.call(arguments); + self = this; + }); + + obj.trigger('event!', 'foo', 'bar'); + + deepEqual(args, ['foo', 'bar']); + equal(self, target); + }); + + QUnit.test('a listener registered with one can take method as string and can be added with different target', function () { + var count = 0; + var target = {}; + target.fn = function () { + count++; + }; + + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEvented.default).create(); + + obj.one('event!', target, 'fn'); + obj.trigger('event!'); + + equal(count, 1, 'the event was triggered'); + + obj.trigger('event!'); + + equal(count, 1, 'the event was not triggered again'); + }); + + QUnit.test('a listener registered with one can be removed with off', function () { + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEvented.default, { + F: function () {} + }).create(); + var F = function () {}; + + obj.one('event!', F); + obj.one('event!', obj, 'F'); + + equal(obj.has('event!'), true, 'has events'); + + obj.off('event!', F); + obj.off('event!', obj, 'F'); + + equal(obj.has('event!'), false, 'has no more events'); + }); + + QUnit.test('adding and removing listeners should be chainable', function () { + var obj = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEvented.default).create(); + var F = function () {}; + + var ret = obj.on('event!', F); + equal(ret, obj, '#on returns self'); + + ret = obj.off('event!', F); + equal(ret, obj, '#off returns self'); + + ret = obj.one('event!', F); + equal(ret, obj, '#one returns self'); + }); +}); +enifed('ember-runtime/tests/system/object/events_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/events_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/events_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/events_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/events_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/events_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/extend_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { + 'use strict'; + + QUnit.module('EmberObject.extend'); + + QUnit.test('Basic extend', function () { + var SomeClass = _emberRuntimeSystemObject.default.extend({ foo: 'BAR' }); + ok(SomeClass.isClass, 'A class has isClass of true'); + var obj = new SomeClass(); + equal(obj.foo, 'BAR'); + }); + + QUnit.test('Sub-subclass', function () { + var SomeClass = _emberRuntimeSystemObject.default.extend({ foo: 'BAR' }); + var AnotherClass = SomeClass.extend({ bar: 'FOO' }); + var obj = new AnotherClass(); + equal(obj.foo, 'BAR'); + equal(obj.bar, 'FOO'); + }); + + QUnit.test('Overriding a method several layers deep', function () { + var SomeClass = _emberRuntimeSystemObject.default.extend({ + fooCnt: 0, + foo: function () { + this.fooCnt++; + }, + + barCnt: 0, + bar: function () { + this.barCnt++; + } + }); + + var AnotherClass = SomeClass.extend({ + barCnt: 0, + bar: function () { + this.barCnt++; + this._super.apply(this, arguments); + } + }); + + var FinalClass = AnotherClass.extend({ + fooCnt: 0, + foo: function () { + this.fooCnt++; + this._super.apply(this, arguments); + } + }); + + var obj = new FinalClass(); + obj.foo(); + obj.bar(); + equal(obj.fooCnt, 2, 'should invoke both'); + equal(obj.barCnt, 2, 'should invoke both'); + + // Try overriding on create also + obj = FinalClass.extend({ + foo: function () { + this.fooCnt++; + this._super.apply(this, arguments); + } + }).create(); + + obj.foo(); + obj.bar(); + equal(obj.fooCnt, 3, 'should invoke final as well'); + equal(obj.barCnt, 2, 'should invoke both'); + }); + + QUnit.test('With concatenatedProperties', function () { + var SomeClass = _emberRuntimeSystemObject.default.extend({ things: 'foo', concatenatedProperties: ['things'] }); + var AnotherClass = SomeClass.extend({ things: 'bar' }); + var YetAnotherClass = SomeClass.extend({ things: 'baz' }); + var some = new SomeClass(); + var another = new AnotherClass(); + var yetAnother = new YetAnotherClass(); + deepEqual(some.get('things'), ['foo'], 'base class should have just its value'); + deepEqual(another.get('things'), ['foo', 'bar'], 'subclass should have base class\' and its own'); + deepEqual(yetAnother.get('things'), ['foo', 'baz'], 'subclass should have base class\' and its own'); + }); + + QUnit.test('With concatenatedProperties class properties', function () { + var SomeClass = _emberRuntimeSystemObject.default.extend(); + SomeClass.reopenClass({ + concatenatedProperties: ['things'], + things: 'foo' + }); + var AnotherClass = SomeClass.extend(); + AnotherClass.reopenClass({ things: 'bar' }); + var YetAnotherClass = SomeClass.extend(); + YetAnotherClass.reopenClass({ things: 'baz' }); + var some = new SomeClass(); + var another = new AnotherClass(); + var yetAnother = new YetAnotherClass(); + deepEqual(_emberMetal.get(some.constructor, 'things'), ['foo'], 'base class should have just its value'); + deepEqual(_emberMetal.get(another.constructor, 'things'), ['foo', 'bar'], 'subclass should have base class\' and its own'); + deepEqual(_emberMetal.get(yetAnother.constructor, 'things'), ['foo', 'baz'], 'subclass should have base class\' and its own'); + }); +}); +enifed('ember-runtime/tests/system/object/extend_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/extend_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/extend_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/extend_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/extend_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/extend_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/observer_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject) { + 'use strict'; + + QUnit.module('EmberObject observer'); + + _internalTestHelpers.testBoth('observer on class', function (get, set) { + var MyClass = _emberRuntimeSystemObject.default.extend({ + count: 0, + + foo: _emberMetal.observer('bar', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }); + + var obj = new MyClass(); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj, 'bar', 'BAZ'); + equal(get(obj, 'count'), 1, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('observer on subclass', function (get, set) { + var MyClass = _emberRuntimeSystemObject.default.extend({ + count: 0, + + foo: _emberMetal.observer('bar', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }); + + var Subclass = MyClass.extend({ + foo: _emberMetal.observer('baz', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }); + + var obj = new Subclass(); + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj, 'bar', 'BAZ'); + equal(get(obj, 'count'), 0, 'should not invoke observer after change'); + + set(obj, 'baz', 'BAZ'); + equal(get(obj, 'count'), 1, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('observer on instance', function (get, set) { + var obj = _emberRuntimeSystemObject.default.extend({ + foo: _emberMetal.observer('bar', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }).create({ + count: 0 + }); + + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj, 'bar', 'BAZ'); + equal(get(obj, 'count'), 1, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('observer on instance overriding class', function (get, set) { + var MyClass = _emberRuntimeSystemObject.default.extend({ + count: 0, + + foo: _emberMetal.observer('bar', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }); + + var obj = MyClass.extend({ + foo: _emberMetal.observer('baz', function () { + // <-- change property we observe + set(this, 'count', get(this, 'count') + 1); + }) + }).create(); + + equal(get(obj, 'count'), 0, 'should not invoke observer immediately'); + + set(obj, 'bar', 'BAZ'); + equal(get(obj, 'count'), 0, 'should not invoke observer after change'); + + set(obj, 'baz', 'BAZ'); + equal(get(obj, 'count'), 1, 'should invoke observer after change'); + }); + + _internalTestHelpers.testBoth('observer should not fire after being destroyed', function (get, set) { + var obj = _emberRuntimeSystemObject.default.extend({ + count: 0, + foo: _emberMetal.observer('bar', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }).create(); + + equal(get(obj, 'count'), 0, 'precond - should not invoke observer immediately'); + + _emberMetal.run(function () { + return obj.destroy(); + }); + + expectAssertion(function () { + set(obj, 'bar', 'BAZ'); + }, 'calling set on destroyed object: ' + obj + '.bar = BAZ'); + + equal(get(obj, 'count'), 0, 'should not invoke observer after change'); + }); + // .......................................................... + // COMPLEX PROPERTIES + // + + _internalTestHelpers.testBoth('chain observer on class', function (get, set) { + var MyClass = _emberRuntimeSystemObject.default.extend({ + count: 0, + + foo: _emberMetal.observer('bar.baz', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }); + + var obj1 = MyClass.create({ + bar: { baz: 'biff' } + }); + + var obj2 = MyClass.create({ + bar: { baz: 'biff2' } + }); + + equal(get(obj1, 'count'), 0, 'should not invoke yet'); + equal(get(obj2, 'count'), 0, 'should not invoke yet'); + + set(get(obj1, 'bar'), 'baz', 'BIFF1'); + equal(get(obj1, 'count'), 1, 'should invoke observer on obj1'); + equal(get(obj2, 'count'), 0, 'should not invoke yet'); + + set(get(obj2, 'bar'), 'baz', 'BIFF2'); + equal(get(obj1, 'count'), 1, 'should not invoke again'); + equal(get(obj2, 'count'), 1, 'should invoke observer on obj2'); + }); + + _internalTestHelpers.testBoth('chain observer on class', function (get, set) { + var MyClass = _emberRuntimeSystemObject.default.extend({ + count: 0, + + foo: _emberMetal.observer('bar.baz', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }); + + var obj1 = MyClass.extend().create({ + bar: { baz: 'biff' } + }); + + var obj2 = MyClass.extend({ + foo: _emberMetal.observer('bar2.baz', function () { + set(this, 'count', get(this, 'count') + 1); + }) + }).create({ + bar: { baz: 'biff2' }, + bar2: { baz: 'biff3' } + }); + + equal(get(obj1, 'count'), 0, 'should not invoke yet'); + equal(get(obj2, 'count'), 0, 'should not invoke yet'); + + set(get(obj1, 'bar'), 'baz', 'BIFF1'); + equal(get(obj1, 'count'), 1, 'should invoke observer on obj1'); + equal(get(obj2, 'count'), 0, 'should not invoke yet'); + + set(get(obj2, 'bar'), 'baz', 'BIFF2'); + equal(get(obj1, 'count'), 1, 'should not invoke again'); + equal(get(obj2, 'count'), 0, 'should not invoke yet'); + + set(get(obj2, 'bar2'), 'baz', 'BIFF3'); + equal(get(obj1, 'count'), 1, 'should not invoke again'); + equal(get(obj2, 'count'), 1, 'should invoke observer on obj2'); + }); + + _internalTestHelpers.testBoth('chain observer on class that has a reference to an uninitialized object will finish chains that reference it', function (get, set) { + var changed = false; + + var ChildClass = _emberRuntimeSystemObject.default.extend({ + parent: null, + parentOneTwoDidChange: _emberMetal.observer('parent.one.two', function () { + changed = true; + }) + }); + + var ParentClass = _emberRuntimeSystemObject.default.extend({ + one: { + two: 'old' + }, + init: function () { + this.child = ChildClass.create({ + parent: this + }); + } + }); + + var parent = new ParentClass(); + + equal(changed, false, 'precond'); + + parent.set('one.two', 'new'); + + equal(changed, true, 'child should have been notified of change to path'); + + parent.set('one', { two: 'newer' }); + + equal(changed, true, 'child should have been notified of change to path'); + }); +}); +enifed('ember-runtime/tests/system/object/observer_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/observer_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/observer_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/observer_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/observer_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/observer_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/reopenClass_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { + 'use strict'; + + QUnit.module('system/object/reopenClass'); + + QUnit.test('adds new properties to subclass', function () { + var Subclass = _emberRuntimeSystemObject.default.extend(); + Subclass.reopenClass({ + foo: function () { + return 'FOO'; + }, + bar: 'BAR' + }); + + equal(Subclass.foo(), 'FOO', 'Adds method'); + equal(_emberMetal.get(Subclass, 'bar'), 'BAR', 'Adds property'); + }); + + QUnit.test('class properties inherited by subclasses', function () { + var Subclass = _emberRuntimeSystemObject.default.extend(); + Subclass.reopenClass({ + foo: function () { + return 'FOO'; + }, + bar: 'BAR' + }); + + var SubSub = Subclass.extend(); + + equal(SubSub.foo(), 'FOO', 'Adds method'); + equal(_emberMetal.get(SubSub, 'bar'), 'BAR', 'Adds property'); + }); +}); +enifed('ember-runtime/tests/system/object/reopenClass_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/reopenClass_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/reopenClass_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/reopenClass_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/reopenClass_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/reopenClass_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/reopen_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { + 'use strict'; + + QUnit.module('system/core_object/reopen'); + + QUnit.test('adds new properties to subclass instance', function () { + var Subclass = _emberRuntimeSystemObject.default.extend(); + Subclass.reopen({ + foo: function () { + return 'FOO'; + }, + bar: 'BAR' + }); + + equal(new Subclass().foo(), 'FOO', 'Adds method'); + equal(_emberMetal.get(new Subclass(), 'bar'), 'BAR', 'Adds property'); + }); + + QUnit.test('reopened properties inherited by subclasses', function () { + var Subclass = _emberRuntimeSystemObject.default.extend(); + var SubSub = Subclass.extend(); + + Subclass.reopen({ + foo: function () { + return 'FOO'; + }, + bar: 'BAR' + }); + + equal(new SubSub().foo(), 'FOO', 'Adds method'); + equal(_emberMetal.get(new SubSub(), 'bar'), 'BAR', 'Adds property'); + }); + + QUnit.test('allows reopening already instantiated classes', function () { + var Subclass = _emberRuntimeSystemObject.default.extend(); + + Subclass.create(); + + Subclass.reopen({ + trololol: true + }); + + equal(Subclass.create().get('trololol'), true, 'reopen works'); + }); +}); +enifed('ember-runtime/tests/system/object/reopen_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/reopen_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/reopen_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/reopen_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/reopen_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/reopen_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/strict-mode-test', ['exports', 'ember-runtime/system/object'], function (exports, _emberRuntimeSystemObject) { + 'use strict'; + + QUnit.module('strict mode tests'); + + QUnit.test('__superWrapper does not throw errors in strict mode', function () { + var Foo = _emberRuntimeSystemObject.default.extend({ + blah: function () { + return 'foo'; + } + }); + + var Bar = Foo.extend({ + blah: function () { + return 'bar'; + }, + + callBlah: function () { + var blah = this.blah; + + return blah(); + } + }); + + var bar = Bar.create(); + + equal(bar.callBlah(), 'bar', 'can call local function without call/apply'); + }); +}); +enifed('ember-runtime/tests/system/object/strict-mode-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/strict-mode-test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/strict-mode-test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/strict-mode-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/strict-mode-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/strict-mode-test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/subclasses_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { + 'use strict'; + + QUnit.module('system/object/subclasses'); + + QUnit.test('chains should copy forward to subclasses when prototype created', function () { + var ObjectWithChains = undefined, + objWithChains = undefined, + SubWithChains = undefined, + SubSub = undefined, + subSub = undefined; + _emberMetal.run(function () { + ObjectWithChains = _emberRuntimeSystemObject.default.extend({ + obj: { + a: 'a', + hi: 'hi' + }, + aBinding: 'obj.a' // add chain + }); + + var deprecationMessage = /`Ember.Binding` is deprecated/; + + expectDeprecation(function () { + // realize prototype + objWithChains = ObjectWithChains.create(); + }, deprecationMessage); + + // should not copy chains from parent yet + SubWithChains = ObjectWithChains.extend({ + hiBinding: 'obj.hi', // add chain + hello: _emberMetal.computed(function () { + return this.get('obj.hi') + ' world'; + }).property('hi'), // observe chain + greetingBinding: 'hello' + }); + + SubSub = SubWithChains.extend(); + + expectDeprecation(function () { + // should realize prototypes and copy forward chains + subSub = SubSub.create(); + }, deprecationMessage); + }); + equal(subSub.get('greeting'), 'hi world'); + _emberMetal.run(function () { + return objWithChains.set('obj.hi', 'hello'); + }); + equal(subSub.get('greeting'), 'hello world'); + }); +}); +enifed('ember-runtime/tests/system/object/subclasses_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/subclasses_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/subclasses_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/subclasses_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/subclasses_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/subclasses_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object/toString_test', ['exports', 'ember-utils', 'ember-environment', 'ember-runtime/system/object', 'ember-runtime/system/namespace'], function (exports, _emberUtils, _emberEnvironment, _emberRuntimeSystemObject, _emberRuntimeSystemNamespace) { + 'use strict'; + + var originalLookup = _emberEnvironment.context.lookup; + var lookup = undefined; + + QUnit.module('system/object/toString', { + setup: function () { + _emberEnvironment.context.lookup = lookup = {}; + }, + teardown: function () { + _emberEnvironment.context.lookup = originalLookup; + } + }); + + QUnit.test('toString() returns the same value if called twice', function () { + var Foo = _emberRuntimeSystemNamespace.default.create(); + Foo.toString = function () { + return 'Foo'; + }; + + Foo.Bar = _emberRuntimeSystemObject.default.extend(); + + equal(Foo.Bar.toString(), 'Foo.Bar'); + equal(Foo.Bar.toString(), 'Foo.Bar'); + + var obj = Foo.Bar.create(); + + equal(obj.toString(), ''); + equal(obj.toString(), ''); + + equal(Foo.Bar.toString(), 'Foo.Bar'); + }); + + QUnit.test('toString on a class returns a useful value when nested in a namespace', function () { + var obj = undefined; + + var Foo = _emberRuntimeSystemNamespace.default.create(); + Foo.toString = function () { + return 'Foo'; + }; + + Foo.Bar = _emberRuntimeSystemObject.default.extend(); + equal(Foo.Bar.toString(), 'Foo.Bar'); + + obj = Foo.Bar.create(); + equal(obj.toString(), ''); + + Foo.Baz = Foo.Bar.extend(); + equal(Foo.Baz.toString(), 'Foo.Baz'); + + obj = Foo.Baz.create(); + equal(obj.toString(), ''); + + obj = Foo.Bar.create(); + equal(obj.toString(), ''); + }); + + QUnit.test('toString on a namespace finds the namespace in lookup', function () { + var Foo = lookup.Foo = _emberRuntimeSystemNamespace.default.create(); + + equal(Foo.toString(), 'Foo'); + }); + + QUnit.test('toString on a namespace finds the namespace in lookup', function () { + var Foo = lookup.Foo = _emberRuntimeSystemNamespace.default.create(); + var obj = undefined; + + Foo.Bar = _emberRuntimeSystemObject.default.extend(); + + equal(Foo.Bar.toString(), 'Foo.Bar'); + + obj = Foo.Bar.create(); + equal(obj.toString(), ''); + }); + + QUnit.test('toString on a namespace falls back to modulePrefix, if defined', function () { + var Foo = _emberRuntimeSystemNamespace.default.create({ modulePrefix: 'foo' }); + + equal(Foo.toString(), 'foo'); + }); + + QUnit.test('toString includes toStringExtension if defined', function () { + var Foo = _emberRuntimeSystemObject.default.extend({ + toStringExtension: function () { + return 'fooey'; + } + }); + var foo = Foo.create(); + var Bar = _emberRuntimeSystemObject.default.extend({}); + var bar = Bar.create(); + + // simulate these classes being defined on a Namespace + Foo[_emberUtils.GUID_KEY + '_name'] = 'Foo'; + Bar[_emberUtils.GUID_KEY + '_name'] = 'Bar'; + + equal(bar.toString(), '', 'does not include toStringExtension part'); + equal(foo.toString(), '', 'Includes toStringExtension result'); + }); +}); +enifed('ember-runtime/tests/system/object/toString_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/object'); + test('ember-runtime/tests/system/object/toString_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object/toString_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object/toString_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/object'); + QUnit.test('ember-runtime/tests/system/object/toString_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/toString_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/object_proxy_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object_proxy'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject_proxy) { + 'use strict'; + + QUnit.module('ObjectProxy'); + + _internalTestHelpers.testBoth('should not proxy properties passed to create', function (get, set) { + var Proxy = _emberRuntimeSystemObject_proxy.default.extend({ + cp: _emberMetal.computed({ + get: function (key) { + return this._cp; + }, + set: function (key, value) { + this._cp = value; + return this._cp; + } + }) + }); + var proxy = Proxy.create({ + prop: 'Foo', + cp: 'Bar' + }); + + equal(get(proxy, 'prop'), 'Foo', 'should not have tried to proxy set'); + equal(proxy._cp, 'Bar', 'should use CP setter'); + }); + + _internalTestHelpers.testBoth('should proxy properties to content', function (get, set) { + var content = { + firstName: 'Tom', + lastName: 'Dale', + unknownProperty: function (key) { + return key + ' unknown'; + } + }; + var proxy = _emberRuntimeSystemObject_proxy.default.create(); + + equal(get(proxy, 'firstName'), undefined, 'get on proxy without content should return undefined'); + expectAssertion(function () { + set(proxy, 'firstName', 'Foo'); + }, /Cannot delegate set\('firstName', Foo\) to the 'content'/i); + + set(proxy, 'content', content); + + equal(get(proxy, 'firstName'), 'Tom', 'get on proxy with content should forward to content'); + equal(get(proxy, 'lastName'), 'Dale', 'get on proxy with content should forward to content'); + equal(get(proxy, 'foo'), 'foo unknown', 'get on proxy with content should forward to content'); + + set(proxy, 'lastName', 'Huda'); + + equal(get(content, 'lastName'), 'Huda', 'content should have new value from set on proxy'); + equal(get(proxy, 'lastName'), 'Huda', 'proxy should have new value from set on proxy'); + + set(proxy, 'content', { firstName: 'Yehuda', lastName: 'Katz' }); + + equal(get(proxy, 'firstName'), 'Yehuda', 'proxy should reflect updated content'); + equal(get(proxy, 'lastName'), 'Katz', 'proxy should reflect updated content'); + }); + + _internalTestHelpers.testBoth('should work with watched properties', function (get, set) { + var content1 = { firstName: 'Tom', lastName: 'Dale' }; + var content2 = { firstName: 'Yehuda', lastName: 'Katz' }; + var count = 0; + var last = undefined; + + var Proxy = _emberRuntimeSystemObject_proxy.default.extend({ + fullName: _emberMetal.computed(function () { + var firstName = this.get('firstName'); + var lastName = this.get('lastName'); + + if (firstName && lastName) { + return firstName + ' ' + lastName; + } + return firstName || lastName; + }).property('firstName', 'lastName') + }); + + var proxy = Proxy.create(); + + _emberMetal.addObserver(proxy, 'fullName', function () { + last = get(proxy, 'fullName'); + count++; + }); + + // proxy without content returns undefined + equal(get(proxy, 'fullName'), undefined); + + // setting content causes all watched properties to change + set(proxy, 'content', content1); + // both dependent keys changed + equal(count, 2); + equal(last, 'Tom Dale'); + + // setting property in content causes proxy property to change + set(content1, 'lastName', 'Huda'); + equal(count, 3); + equal(last, 'Tom Huda'); + + // replacing content causes all watched properties to change + set(proxy, 'content', content2); + // both dependent keys changed + equal(count, 5); + equal(last, 'Yehuda Katz'); + // content1 is no longer watched + ok(!_emberMetal.isWatching(content1, 'firstName'), 'not watching firstName'); + ok(!_emberMetal.isWatching(content1, 'lastName'), 'not watching lastName'); + + // setting property in new content + set(content2, 'firstName', 'Tomhuda'); + equal(last, 'Tomhuda Katz'); + equal(count, 6); + + // setting property in proxy syncs with new content + set(proxy, 'lastName', 'Katzdale'); + equal(count, 7); + equal(last, 'Tomhuda Katzdale'); + equal(get(content2, 'firstName'), 'Tomhuda'); + equal(get(content2, 'lastName'), 'Katzdale'); + }); + + QUnit.test('set and get should work with paths', function () { + var content = { foo: { bar: 'baz' } }; + var proxy = _emberRuntimeSystemObject_proxy.default.create({ content: content }); + var count = 0; + + proxy.set('foo.bar', 'hello'); + equal(proxy.get('foo.bar'), 'hello'); + equal(proxy.get('content.foo.bar'), 'hello'); + + proxy.addObserver('foo.bar', function () { + count++; + }); + + proxy.set('foo.bar', 'bye'); + + equal(count, 1); + equal(proxy.get('foo.bar'), 'bye'); + equal(proxy.get('content.foo.bar'), 'bye'); + }); + + _internalTestHelpers.testBoth('should transition between watched and unwatched strategies', function (get, set) { + var content = { foo: 'foo' }; + var proxy = _emberRuntimeSystemObject_proxy.default.create({ content: content }); + var count = 0; + + function observer() { + count++; + } + + equal(get(proxy, 'foo'), 'foo'); + + set(content, 'foo', 'bar'); + + equal(get(proxy, 'foo'), 'bar'); + + set(proxy, 'foo', 'foo'); + + equal(get(content, 'foo'), 'foo'); + equal(get(proxy, 'foo'), 'foo'); + + _emberMetal.addObserver(proxy, 'foo', observer); + + equal(count, 0); + equal(get(proxy, 'foo'), 'foo'); + + set(content, 'foo', 'bar'); + + equal(count, 1); + equal(get(proxy, 'foo'), 'bar'); + + set(proxy, 'foo', 'foo'); + + equal(count, 2); + equal(get(content, 'foo'), 'foo'); + equal(get(proxy, 'foo'), 'foo'); + + _emberMetal.removeObserver(proxy, 'foo', observer); + + set(content, 'foo', 'bar'); + + equal(get(proxy, 'foo'), 'bar'); + + set(proxy, 'foo', 'foo'); + + equal(get(content, 'foo'), 'foo'); + equal(get(proxy, 'foo'), 'foo'); + }); + + _internalTestHelpers.testBoth('setting `undefined` to a proxied content property should override its existing value', function (get, set) { + var proxyObject = _emberRuntimeSystemObject_proxy.default.create({ + content: { + prop: 'emberjs' + } + }); + set(proxyObject, 'prop', undefined); + equal(get(proxyObject, 'prop'), undefined, 'sets the `undefined` value to the proxied content'); + }); +}); +enifed('ember-runtime/tests/system/object_proxy_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system'); + test('ember-runtime/tests/system/object_proxy_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/object_proxy_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/object_proxy_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system'); + QUnit.test('ember-runtime/tests/system/object_proxy_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object_proxy_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/string/camelize_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { + 'use strict'; + + QUnit.module('EmberStringUtils.camelize'); + + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + QUnit.test('String.prototype.camelize is not modified without EXTEND_PROTOTYPES', function () { + ok('undefined' === typeof String.prototype.camelize, 'String.prototype helper disabled'); + }); + } + + QUnit.test('camelize normal string', function () { + deepEqual(_emberRuntimeSystemString.camelize('my favorite items'), 'myFavoriteItems'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('my favorite items'.camelize(), 'myFavoriteItems'); + } + }); + + QUnit.test('camelize capitalized string', function () { + deepEqual(_emberRuntimeSystemString.camelize('I Love Ramen'), 'iLoveRamen'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('I Love Ramen'.camelize(), 'iLoveRamen'); + } + }); + + QUnit.test('camelize dasherized string', function () { + deepEqual(_emberRuntimeSystemString.camelize('css-class-name'), 'cssClassName'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('css-class-name'.camelize(), 'cssClassName'); + } + }); + + QUnit.test('camelize underscored string', function () { + deepEqual(_emberRuntimeSystemString.camelize('action_name'), 'actionName'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('action_name'.camelize(), 'actionName'); + } + }); + + QUnit.test('camelize dot notation string', function () { + deepEqual(_emberRuntimeSystemString.camelize('action.name'), 'actionName'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('action.name'.camelize(), 'actionName'); + } + }); + + QUnit.test('does nothing with camelcased string', function () { + deepEqual(_emberRuntimeSystemString.camelize('innerHTML'), 'innerHTML'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('innerHTML'.camelize(), 'innerHTML'); + } + }); + + QUnit.test('camelize namespaced classified string', function () { + deepEqual(_emberRuntimeSystemString.camelize('PrivateDocs/OwnerInvoice'), 'privateDocs/ownerInvoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('PrivateDocs/OwnerInvoice'.camelize(), 'privateDocs/ownerInvoice'); + } + }); + + QUnit.test('camelize namespaced underscored string', function () { + deepEqual(_emberRuntimeSystemString.camelize('private_docs/owner_invoice'), 'privateDocs/ownerInvoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('private_docs/owner_invoice'.camelize(), 'privateDocs/ownerInvoice'); + } + }); + + QUnit.test('camelize namespaced dasherized string', function () { + deepEqual(_emberRuntimeSystemString.camelize('private-docs/owner-invoice'), 'privateDocs/ownerInvoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('private-docs/owner-invoice'.camelize(), 'privateDocs/ownerInvoice'); + } + }); +}); +enifed('ember-runtime/tests/system/string/camelize_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/string'); + test('ember-runtime/tests/system/string/camelize_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/string/camelize_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/string/camelize_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/string'); + QUnit.test('ember-runtime/tests/system/string/camelize_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/string/camelize_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/string/capitalize_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { + 'use strict'; + + QUnit.module('EmberStringUtils.capitalize'); + + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + QUnit.test('String.prototype.capitalize is not modified without EXTEND_PROTOTYPES', function () { + ok('undefined' === typeof String.prototype.capitalize, 'String.prototype helper disabled'); + }); + } + + QUnit.test('capitalize normal string', function () { + deepEqual(_emberRuntimeSystemString.capitalize('my favorite items'), 'My favorite items'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('my favorite items'.capitalize(), 'My favorite items'); + } + }); + + QUnit.test('capitalize dasherized string', function () { + deepEqual(_emberRuntimeSystemString.capitalize('css-class-name'), 'Css-class-name'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('css-class-name'.capitalize(), 'Css-class-name'); + } + }); + + QUnit.test('capitalize underscored string', function () { + deepEqual(_emberRuntimeSystemString.capitalize('action_name'), 'Action_name'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('action_name'.capitalize(), 'Action_name'); + } + }); + + QUnit.test('capitalize camelcased string', function () { + deepEqual(_emberRuntimeSystemString.capitalize('innerHTML'), 'InnerHTML'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('innerHTML'.capitalize(), 'InnerHTML'); + } + }); + + QUnit.test('does nothing with capitalized string', function () { + deepEqual(_emberRuntimeSystemString.capitalize('Capitalized string'), 'Capitalized string'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('Capitalized string'.capitalize(), 'Capitalized string'); + } + }); + + QUnit.test('capitalize namespaced camelized string', function () { + deepEqual(_emberRuntimeSystemString.capitalize('privateDocs/ownerInvoice'), 'PrivateDocs/OwnerInvoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('privateDocs/ownerInvoice'.capitalize(), 'PrivateDocs/OwnerInvoice'); + } + }); + + QUnit.test('capitalize namespaced underscored string', function () { + deepEqual(_emberRuntimeSystemString.capitalize('private_docs/owner_invoice'), 'Private_docs/Owner_invoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('private_docs/owner_invoice'.capitalize(), 'Private_docs/Owner_invoice'); + } + }); + + QUnit.test('capitalize namespaced dasherized string', function () { + deepEqual(_emberRuntimeSystemString.capitalize('private-docs/owner-invoice'), 'Private-docs/Owner-invoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('private-docs/owner-invoice'.capitalize(), 'Private-docs/Owner-invoice'); + } + }); +}); +enifed('ember-runtime/tests/system/string/capitalize_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/string'); + test('ember-runtime/tests/system/string/capitalize_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/string/capitalize_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/string/capitalize_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/string'); + QUnit.test('ember-runtime/tests/system/string/capitalize_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/string/capitalize_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/string/classify_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { + 'use strict'; + + QUnit.module('EmberStringUtils.classify'); + + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + QUnit.test('String.prototype.classify is not modified without EXTEND_PROTOTYPES', function () { + ok('undefined' === typeof String.prototype.classify, 'String.prototype helper disabled'); + }); + } + + function test(given, expected, description) { + QUnit.test(description, function () { + deepEqual(_emberRuntimeSystemString.classify(given), expected); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual(given.classify(), expected); + } + }); + } + + test('my favorite items', 'MyFavoriteItems', 'classify normal string'); + test('css-class-name', 'CssClassName', 'classify dasherized string'); + test('action_name', 'ActionName', 'classify underscored string'); + test('privateDocs/ownerInvoice', 'PrivateDocs/OwnerInvoice', 'classify namespaced camelized string'); + test('private_docs/owner_invoice', 'PrivateDocs/OwnerInvoice', 'classify namespaced underscored string'); + test('private-docs/owner-invoice', 'PrivateDocs/OwnerInvoice', 'classify namespaced dasherized string'); + test('-view-registry', '_ViewRegistry', 'classify prefixed dasherized string'); + test('components/-text-field', 'Components/_TextField', 'classify namespaced prefixed dasherized string'); + test('_Foo_Bar', '_FooBar', 'classify underscore-prefixed underscored string'); + test('_Foo-Bar', '_FooBar', 'classify underscore-prefixed dasherized string'); + test('_foo/_bar', '_Foo/_Bar', 'classify underscore-prefixed-namespaced underscore-prefixed string'); + test('-foo/_bar', '_Foo/_Bar', 'classify dash-prefixed-namespaced underscore-prefixed string'); + test('-foo/-bar', '_Foo/_Bar', 'classify dash-prefixed-namespaced dash-prefixed string'); + test('InnerHTML', 'InnerHTML', 'does nothing with classified string'); + test('_FooBar', '_FooBar', 'does nothing with classified prefixed string'); +}); +enifed('ember-runtime/tests/system/string/classify_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/string'); + test('ember-runtime/tests/system/string/classify_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/string/classify_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/string/classify_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/string'); + QUnit.test('ember-runtime/tests/system/string/classify_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/string/classify_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/string/dasherize_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { + 'use strict'; + + QUnit.module('EmberStringUtils.dasherize'); + + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + QUnit.test('String.prototype.dasherize is not modified without EXTEND_PROTOTYPES', function () { + ok('undefined' === typeof String.prototype.dasherize, 'String.prototype helper disabled'); + }); + } + + QUnit.test('dasherize normal string', function () { + deepEqual(_emberRuntimeSystemString.dasherize('my favorite items'), 'my-favorite-items'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('my favorite items'.dasherize(), 'my-favorite-items'); + } + }); + + QUnit.test('does nothing with dasherized string', function () { + deepEqual(_emberRuntimeSystemString.dasherize('css-class-name'), 'css-class-name'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('css-class-name'.dasherize(), 'css-class-name'); + } + }); + + QUnit.test('dasherize underscored string', function () { + deepEqual(_emberRuntimeSystemString.dasherize('action_name'), 'action-name'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('action_name'.dasherize(), 'action-name'); + } + }); + + QUnit.test('dasherize camelcased string', function () { + deepEqual(_emberRuntimeSystemString.dasherize('innerHTML'), 'inner-html'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('innerHTML'.dasherize(), 'inner-html'); + } + }); + + QUnit.test('dasherize string that is the property name of Object.prototype', function () { + deepEqual(_emberRuntimeSystemString.dasherize('toString'), 'to-string'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('toString'.dasherize(), 'to-string'); + } + }); + + QUnit.test('dasherize namespaced classified string', function () { + deepEqual(_emberRuntimeSystemString.dasherize('PrivateDocs/OwnerInvoice'), 'private-docs/owner-invoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('PrivateDocs/OwnerInvoice'.dasherize(), 'private-docs/owner-invoice'); + } + }); + + QUnit.test('dasherize namespaced camelized string', function () { + deepEqual(_emberRuntimeSystemString.dasherize('privateDocs/ownerInvoice'), 'private-docs/owner-invoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('privateDocs/ownerInvoice'.dasherize(), 'private-docs/owner-invoice'); + } + }); + + QUnit.test('dasherize namespaced underscored string', function () { + deepEqual(_emberRuntimeSystemString.dasherize('private_docs/owner_invoice'), 'private-docs/owner-invoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('private_docs/owner_invoice'.dasherize(), 'private-docs/owner-invoice'); + } + }); +}); +enifed('ember-runtime/tests/system/string/dasherize_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/string'); + test('ember-runtime/tests/system/string/dasherize_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/string/dasherize_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/string/dasherize_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/string'); + QUnit.test('ember-runtime/tests/system/string/dasherize_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/string/dasherize_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/string/decamelize_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { + 'use strict'; + + QUnit.module('EmberStringUtils.decamelize'); + + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + QUnit.test('String.prototype.decamelize is not modified without EXTEND_PROTOTYPES', function () { + ok('undefined' === typeof String.prototype.decamelize, 'String.prototype helper disabled'); + }); + } + + QUnit.test('does nothing with normal string', function () { + deepEqual(_emberRuntimeSystemString.decamelize('my favorite items'), 'my favorite items'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('my favorite items'.decamelize(), 'my favorite items'); + } + }); + + QUnit.test('does nothing with dasherized string', function () { + deepEqual(_emberRuntimeSystemString.decamelize('css-class-name'), 'css-class-name'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('css-class-name'.decamelize(), 'css-class-name'); + } + }); + + QUnit.test('does nothing with underscored string', function () { + deepEqual(_emberRuntimeSystemString.decamelize('action_name'), 'action_name'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('action_name'.decamelize(), 'action_name'); + } + }); + + QUnit.test('converts a camelized string into all lower case separated by underscores.', function () { + deepEqual(_emberRuntimeSystemString.decamelize('innerHTML'), 'inner_html'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('innerHTML'.decamelize(), 'inner_html'); + } + }); + + QUnit.test('decamelizes strings with numbers', function () { + deepEqual(_emberRuntimeSystemString.decamelize('size160Url'), 'size160_url'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('size160Url'.decamelize(), 'size160_url'); + } + }); + + QUnit.test('decamelize namespaced classified string', function () { + deepEqual(_emberRuntimeSystemString.decamelize('PrivateDocs/OwnerInvoice'), 'private_docs/owner_invoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('PrivateDocs/OwnerInvoice'.decamelize(), 'private_docs/owner_invoice'); + } + }); + + QUnit.test('decamelize namespaced camelized string', function () { + deepEqual(_emberRuntimeSystemString.decamelize('privateDocs/ownerInvoice'), 'private_docs/owner_invoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('privateDocs/ownerInvoice'.decamelize(), 'private_docs/owner_invoice'); + } + }); +}); +enifed('ember-runtime/tests/system/string/decamelize_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/string'); + test('ember-runtime/tests/system/string/decamelize_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/string/decamelize_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/string/decamelize_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/string'); + QUnit.test('ember-runtime/tests/system/string/decamelize_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/string/decamelize_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/string/fmt_string_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { + 'use strict'; + + QUnit.module('EmberStringUtils.fmt'); + + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + QUnit.test('String.prototype.fmt is not modified without EXTEND_PROTOTYPES', function () { + ok('undefined' === typeof String.prototype.fmt, 'String.prototype helper disabled'); + }); + } + + QUnit.test('\'Hello %@ %@\'.fmt(\'John\', \'Doe\') => \'Hello John Doe\'', function () { + expectDeprecation('Ember.String.fmt is deprecated, use ES6 template strings instead.'); + equal(_emberRuntimeSystemString.fmt('Hello %@ %@', ['John', 'Doe']), 'Hello John Doe'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + equal('Hello %@ %@'.fmt('John', 'Doe'), 'Hello John Doe'); + } + }); + + QUnit.test('\'Hello %@2 %@1\'.fmt(\'John\', \'Doe\') => \'Hello Doe John\'', function () { + expectDeprecation('Ember.String.fmt is deprecated, use ES6 template strings instead.'); + equal(_emberRuntimeSystemString.fmt('Hello %@2 %@1', ['John', 'Doe']), 'Hello Doe John'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + equal('Hello %@2 %@1'.fmt('John', 'Doe'), 'Hello Doe John'); + } + }); + + QUnit.test('\'%@08 %@07 %@06 %@05 %@04 %@03 %@02 %@01\'.fmt(\'One\', \'Two\', \'Three\', \'Four\', \'Five\', \'Six\', \'Seven\', \'Eight\') => \'Eight Seven Six Five Four Three Two One\'', function () { + expectDeprecation('Ember.String.fmt is deprecated, use ES6 template strings instead.'); + equal(_emberRuntimeSystemString.fmt('%@08 %@07 %@06 %@05 %@04 %@03 %@02 %@01', ['One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight']), 'Eight Seven Six Five Four Three Two One'); + + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + equal('%@08 %@07 %@06 %@05 %@04 %@03 %@02 %@01'.fmt('One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight'), 'Eight Seven Six Five Four Three Two One'); + } + }); + + QUnit.test('\'data: %@\'.fmt({ id: 3 }) => \'data: {id: 3}\'', function () { + expectDeprecation('Ember.String.fmt is deprecated, use ES6 template strings instead.'); + equal(_emberRuntimeSystemString.fmt('data: %@', [{ id: 3 }]), 'data: {id: 3}'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + equal('data: %@'.fmt({ id: 3 }), 'data: {id: 3}'); + } + }); + + QUnit.test('works with argument form', function () { + expectDeprecation('Ember.String.fmt is deprecated, use ES6 template strings instead.'); + equal(_emberRuntimeSystemString.fmt('%@', 'John'), 'John'); + equal(_emberRuntimeSystemString.fmt('%@ %@', ['John'], 'Doe'), '[John] Doe'); + }); +}); +enifed('ember-runtime/tests/system/string/fmt_string_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/string'); + test('ember-runtime/tests/system/string/fmt_string_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/string/fmt_string_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/string/fmt_string_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/string'); + QUnit.test('ember-runtime/tests/system/string/fmt_string_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/string/fmt_string_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/string/loc_test', ['exports', 'ember-metal', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberMetal, _emberEnvironment, _emberRuntimeSystemString) { + 'use strict'; + + var oldString = undefined; + + QUnit.module('EmberStringUtils.loc', { + setup: function () { + oldString = _emberMetal.default.STRINGS; + _emberMetal.default.STRINGS = { + '_Hello World': 'Bonjour le monde', + '_Hello %@': 'Bonjour %@', + '_Hello %@ %@': 'Bonjour %@ %@', + '_Hello %@# %@#': 'Bonjour %@2 %@1' + }; + }, + + teardown: function () { + _emberMetal.default.STRINGS = oldString; + } + }); + + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + QUnit.test('String.prototype.loc is not available without EXTEND_PROTOTYPES', function () { + ok('undefined' === typeof String.prototype.loc, 'String.prototype helper disabled'); + }); + } + + QUnit.test('\'_Hello World\'.loc() => \'Bonjour le monde\'', function () { + equal(_emberRuntimeSystemString.loc('_Hello World'), 'Bonjour le monde'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + equal('_Hello World'.loc(), 'Bonjour le monde'); + } + }); + + QUnit.test('\'_Hello %@ %@\'.loc(\'John\', \'Doe\') => \'Bonjour John Doe\'', function () { + equal(_emberRuntimeSystemString.loc('_Hello %@ %@', ['John', 'Doe']), 'Bonjour John Doe'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + equal('_Hello %@ %@'.loc('John', 'Doe'), 'Bonjour John Doe'); + } + }); + + QUnit.test('\'_Hello %@# %@#\'.loc(\'John\', \'Doe\') => \'Bonjour Doe John\'', function () { + equal(_emberRuntimeSystemString.loc('_Hello %@# %@#', ['John', 'Doe']), 'Bonjour Doe John'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + equal('_Hello %@# %@#'.loc('John', 'Doe'), 'Bonjour Doe John'); + } + }); + + QUnit.test('\'_Not In Strings\'.loc() => \'_Not In Strings\'', function () { + equal(_emberRuntimeSystemString.loc('_Not In Strings'), '_Not In Strings'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + equal('_Not In Strings'.loc(), '_Not In Strings'); + } + }); + + QUnit.test('works with argument form', function () { + equal(_emberRuntimeSystemString.loc('_Hello %@', 'John'), 'Bonjour John'); + equal(_emberRuntimeSystemString.loc('_Hello %@ %@', ['John'], 'Doe'), 'Bonjour [John] Doe'); + }); +}); +// ES6TODO Ember.STRINGS +enifed('ember-runtime/tests/system/string/loc_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/string'); + test('ember-runtime/tests/system/string/loc_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/string/loc_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/string/loc_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/string'); + QUnit.test('ember-runtime/tests/system/string/loc_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/string/loc_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/string/underscore_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { + 'use strict'; + + QUnit.module('EmberStringUtils.underscore'); + + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + QUnit.test('String.prototype.underscore is not available without EXTEND_PROTOTYPES', function () { + ok('undefined' === typeof String.prototype.underscore, 'String.prototype helper disabled'); + }); + } + + QUnit.test('with normal string', function () { + deepEqual(_emberRuntimeSystemString.underscore('my favorite items'), 'my_favorite_items'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('my favorite items'.underscore(), 'my_favorite_items'); + } + }); + + QUnit.test('with dasherized string', function () { + deepEqual(_emberRuntimeSystemString.underscore('css-class-name'), 'css_class_name'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('css-class-name'.underscore(), 'css_class_name'); + } + }); + + QUnit.test('does nothing with underscored string', function () { + deepEqual(_emberRuntimeSystemString.underscore('action_name'), 'action_name'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('action_name'.underscore(), 'action_name'); + } + }); + + QUnit.test('with camelcased string', function () { + deepEqual(_emberRuntimeSystemString.underscore('innerHTML'), 'inner_html'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('innerHTML'.underscore(), 'inner_html'); + } + }); + + QUnit.test('underscore namespaced classified string', function () { + deepEqual(_emberRuntimeSystemString.underscore('PrivateDocs/OwnerInvoice'), 'private_docs/owner_invoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('PrivateDocs/OwnerInvoice'.underscore(), 'private_docs/owner_invoice'); + } + }); + + QUnit.test('underscore namespaced camelized string', function () { + deepEqual(_emberRuntimeSystemString.underscore('privateDocs/ownerInvoice'), 'private_docs/owner_invoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('privateDocs/ownerInvoice'.underscore(), 'private_docs/owner_invoice'); + } + }); + + QUnit.test('underscore namespaced dasherized string', function () { + deepEqual(_emberRuntimeSystemString.underscore('private-docs/owner-invoice'), 'private_docs/owner_invoice'); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('private-docs/owner-invoice'.underscore(), 'private_docs/owner_invoice'); + } + }); +}); +enifed('ember-runtime/tests/system/string/underscore_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/string'); + test('ember-runtime/tests/system/string/underscore_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/string/underscore_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/string/underscore_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/string'); + QUnit.test('ember-runtime/tests/system/string/underscore_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/string/underscore_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/tests/system/string/w_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { + 'use strict'; + + QUnit.module('EmberStringUtils.w'); + + if (!_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + QUnit.test('String.prototype.w is not available without EXTEND_PROTOTYPES', function () { + ok('undefined' === typeof String.prototype.w, 'String.prototype helper disabled'); + }); + } + + QUnit.test('\'one two three\'.w() => [\'one\',\'two\',\'three\']', function () { + deepEqual(_emberRuntimeSystemString.w('one two three'), ['one', 'two', 'three']); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('one two three'.w(), ['one', 'two', 'three']); + } + }); + + QUnit.test('\'one two three\'.w() with extra spaces between words => [\'one\',\'two\',\'three\']', function () { + deepEqual(_emberRuntimeSystemString.w('one two three'), ['one', 'two', 'three']); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('one two three'.w(), ['one', 'two', 'three']); + } + }); + + QUnit.test('\'one two three\'.w() with tabs', function () { + deepEqual(_emberRuntimeSystemString.w('one\ttwo three'), ['one', 'two', 'three']); + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { + deepEqual('one\ttwo three'.w(), ['one', 'two', 'three']); + } + }); +}); +enifed('ember-runtime/tests/system/string/w_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime/tests/system/string'); + test('ember-runtime/tests/system/string/w_test.js should pass jscs', function () { + ok(true, 'ember-runtime/tests/system/string/w_test.js should pass jscs.'); + }); +}); +enifed('ember-runtime/tests/system/string/w_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime/tests/system/string'); + QUnit.test('ember-runtime/tests/system/string/w_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/string/w_test.js should pass jshint.'); + }); +}); +enifed('ember-runtime/utils.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-runtime'); + test('ember-runtime/utils.js should pass jscs', function () { + ok(true, 'ember-runtime/utils.js should pass jscs.'); + }); +}); +enifed('ember-runtime/utils.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-runtime'); + QUnit.test('ember-runtime/utils.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/utils.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/compat.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler'); + test('ember-template-compiler/compat.js should pass jscs', function () { + ok(true, 'ember-template-compiler/compat.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/compat.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler'); + QUnit.test('ember-template-compiler/compat.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/compat.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler'); + test('ember-template-compiler/index.js should pass jscs', function () { + ok(true, 'ember-template-compiler/index.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler'); + QUnit.test('ember-template-compiler/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/index.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/assert-reserved-named-arguments.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/assert-reserved-named-arguments.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/assert-reserved-named-arguments.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/assert-reserved-named-arguments.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/assert-reserved-named-arguments.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/assert-reserved-named-arguments.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/deprecate-render-model.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/deprecate-render-model.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/deprecate-render-model.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/deprecate-render-model.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/deprecate-render-model.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/deprecate-render-model.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/index.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/index.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/index.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-action-syntax.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-action-syntax.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-action-syntax.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-action-syntax.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-action-syntax.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-action-syntax.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-angle-bracket-components.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-angle-bracket-components.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-angle-bracket-components.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-angle-bracket-components.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-angle-bracket-components.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-angle-bracket-components.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-attrs-into-args.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-attrs-into-args.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-attrs-into-args.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-attrs-into-args.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-attrs-into-args.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-attrs-into-args.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-each-in-into-each.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-each-in-into-each.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-each-in-into-each.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-each-in-into-each.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-each-in-into-each.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-each-in-into-each.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-has-block-syntax.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-has-block-syntax.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-has-block-syntax.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-has-block-syntax.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-has-block-syntax.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-has-block-syntax.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-inline-link-to.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-inline-link-to.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-inline-link-to.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-inline-link-to.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-inline-link-to.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-inline-link-to.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-input-on-to-onEvent.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-input-on-to-onEvent.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-input-on-to-onEvent.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-input-on-to-onEvent.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-input-on-to-onEvent.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-input-on-to-onEvent.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-input-type-syntax.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-input-type-syntax.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-input-type-syntax.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-input-type-syntax.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-input-type-syntax.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-input-type-syntax.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-item-class.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-item-class.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-item-class.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-item-class.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-item-class.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-item-class.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-old-binding-syntax.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-old-binding-syntax.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-old-binding-syntax.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-old-binding-syntax.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-old-binding-syntax.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-old-binding-syntax.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-old-class-binding-syntax.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-old-class-binding-syntax.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-old-class-binding-syntax.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-old-class-binding-syntax.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-old-class-binding-syntax.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-old-class-binding-syntax.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-top-level-components.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/plugins'); + test('ember-template-compiler/plugins/transform-top-level-components.js should pass jscs', function () { + ok(true, 'ember-template-compiler/plugins/transform-top-level-components.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/plugins/transform-top-level-components.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/plugins'); + QUnit.test('ember-template-compiler/plugins/transform-top-level-components.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/plugins/transform-top-level-components.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/system/bootstrap.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/system'); + test('ember-template-compiler/system/bootstrap.js should pass jscs', function () { + ok(true, 'ember-template-compiler/system/bootstrap.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/system/bootstrap.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/system'); + QUnit.test('ember-template-compiler/system/bootstrap.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/system/bootstrap.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/system/calculate-location-display.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/system'); + test('ember-template-compiler/system/calculate-location-display.js should pass jscs', function () { + ok(true, 'ember-template-compiler/system/calculate-location-display.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/system/calculate-location-display.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/system'); + QUnit.test('ember-template-compiler/system/calculate-location-display.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/system/calculate-location-display.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/system/compile-options.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/system'); + test('ember-template-compiler/system/compile-options.js should pass jscs', function () { + ok(true, 'ember-template-compiler/system/compile-options.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/system/compile-options.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/system'); + QUnit.test('ember-template-compiler/system/compile-options.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/system/compile-options.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/system/compile.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/system'); + test('ember-template-compiler/system/compile.js should pass jscs', function () { + ok(true, 'ember-template-compiler/system/compile.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/system/compile.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/system'); + QUnit.test('ember-template-compiler/system/compile.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/system/compile.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/system/precompile.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/system'); + test('ember-template-compiler/system/precompile.js should pass jscs', function () { + ok(true, 'ember-template-compiler/system/precompile.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/system/precompile.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/system'); + QUnit.test('ember-template-compiler/system/precompile.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/system/precompile.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test', ['exports', 'ember-template-compiler/index'], function (exports, _emberTemplateCompilerIndex) { + 'use strict'; + + QUnit.module('ember-template-compiler: assert-reserved-named-arguments'); + + QUnit.test('Paths beginning with @ are not valid', function () { + expect(3); + + expectAssertion(function () { + _emberTemplateCompilerIndex.compile('{{@foo}}', { + moduleName: 'baz/foo-bar' + }); + }, '\'@foo\' is not a valid path. (\'baz/foo-bar\' @ L1:C2) '); + + expectAssertion(function () { + _emberTemplateCompilerIndex.compile('{{#if @foo}}Yup{{/if}}', { + moduleName: 'baz/foo-bar' + }); + }, '\'@foo\' is not a valid path. (\'baz/foo-bar\' @ L1:C6) '); + + expectAssertion(function () { + _emberTemplateCompilerIndex.compile('{{input type=(if @foo "bar" "baz")}}', { + moduleName: 'baz/foo-bar' + }); + }, '\'@foo\' is not a valid path. (\'baz/foo-bar\' @ L1:C17) '); + }); +}); +enifed('ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/tests/plugins'); + test('ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.js should pass jscs', function () { + ok(true, 'ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/tests/plugins'); + QUnit.test('ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/tests/plugins/deprecate-render-model-test', ['exports', 'ember-template-compiler/index'], function (exports, _emberTemplateCompilerIndex) { + 'use strict'; + + QUnit.module('ember-template-compiler: deprecate-model-render'); + + QUnit.test('Using `{{render` with model provides a deprecation', function () { + expect(1); + + var expectedMessage = 'Please refactor `{{render "foo-bar" coolModel}}` to a component and' + ' invoke via `{{foo-bar model=coolModel}}`. (\'baz/foo-bar\' @ L1:C0) '; + + expectDeprecation(function () { + _emberTemplateCompilerIndex.compile('{{render "foo-bar" coolModel}}', { + moduleName: 'baz/foo-bar' + }); + }, expectedMessage); + }); +}); +enifed('ember-template-compiler/tests/plugins/deprecate-render-model-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/tests/plugins'); + test('ember-template-compiler/tests/plugins/deprecate-render-model-test.js should pass jscs', function () { + ok(true, 'ember-template-compiler/tests/plugins/deprecate-render-model-test.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/tests/plugins/deprecate-render-model-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/tests/plugins'); + QUnit.test('ember-template-compiler/tests/plugins/deprecate-render-model-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/tests/plugins/deprecate-render-model-test.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/tests/plugins/transform-inline-link-to-test', ['exports', 'ember-template-compiler/index'], function (exports, _emberTemplateCompilerIndex) { + 'use strict'; + + QUnit.module('ember-template-compiler: assert-no-view-and-controller-paths without legacy view support'); + + QUnit.test('Can transform an inline {{link-to}} without error', function () { + expect(0); + + _emberTemplateCompilerIndex.compile('{{link-to \'foo\' \'index\'}}', { + moduleName: 'foo/bar/baz' + }); + }); +}); +enifed('ember-template-compiler/tests/plugins/transform-inline-link-to-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/tests/plugins'); + test('ember-template-compiler/tests/plugins/transform-inline-link-to-test.js should pass jscs', function () { + ok(true, 'ember-template-compiler/tests/plugins/transform-inline-link-to-test.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/tests/plugins/transform-inline-link-to-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/tests/plugins'); + QUnit.test('ember-template-compiler/tests/plugins/transform-inline-link-to-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/tests/plugins/transform-inline-link-to-test.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/tests/plugins/transform-input-on-test', ['exports', 'ember-template-compiler/index'], function (exports, _emberTemplateCompilerIndex) { + 'use strict'; + + QUnit.module('ember-template-compiler: transform-input-on'); + + QUnit.test('Using `action` without `on` provides a deprecation', function () { + expect(1); + + expectDeprecation(function () { + _emberTemplateCompilerIndex.compile('{{input action="foo"}}', { + moduleName: 'foo/bar/baz' + }); + }, 'Using \'{{input action="foo"}}\' (\'foo/bar/baz\' @ L1:C0) is deprecated. Please use \'{{input enter="foo"}}\' instead.'); + }); + + QUnit.test('Using `action` with `on` provides a deprecation', function () { + expect(1); + + expectDeprecation(function () { + _emberTemplateCompilerIndex.compile('{{input on="focus-in" action="foo"}}', { + moduleName: 'foo/bar/baz' + }); + }, 'Using \'{{input on="focus-in" action="foo"}}\' (\'foo/bar/baz\' @ L1:C0) is deprecated. Please use \'{{input focus-in="foo"}}\' instead.'); + }); + + QUnit.test('Using `on=\'keyPress\'` does not clobber `keyPress`', function () { + expect(1); + + expectDeprecation(function () { + _emberTemplateCompilerIndex.compile('{{input on="keyPress" action="foo"}}', { + moduleName: 'foo/bar/baz' + }); + }, 'Using \'{{input on="keyPress" action="foo"}}\' (\'foo/bar/baz\' @ L1:C0) is deprecated. Please use \'{{input key-press="foo"}}\' instead.'); + }); + + QUnit.test('Using `on=\'foo\'` without `action=\'asdf\'` raises specific deprecation', function () { + expect(1); + + expectDeprecation(function () { + _emberTemplateCompilerIndex.compile('{{input on="asdf"}}', { + moduleName: 'foo/bar/baz' + }); + }, 'Using \'{{input on="asdf" ...}}\' without specifying an action (\'foo/bar/baz\' @ L1:C0) will do nothing.'); + }); +}); +enifed('ember-template-compiler/tests/plugins/transform-input-on-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/tests/plugins'); + test('ember-template-compiler/tests/plugins/transform-input-on-test.js should pass jscs', function () { + ok(true, 'ember-template-compiler/tests/plugins/transform-input-on-test.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/tests/plugins/transform-input-on-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/tests/plugins'); + QUnit.test('ember-template-compiler/tests/plugins/transform-input-on-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/tests/plugins/transform-input-on-test.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/tests/system/bootstrap-test', ['exports', 'ember-metal', 'ember-views', 'ember-glimmer', 'ember-template-compiler/system/bootstrap', 'internal-test-helpers'], function (exports, _emberMetal, _emberViews, _emberGlimmer, _emberTemplateCompilerSystemBootstrap, _internalTestHelpers) { + 'use strict'; + + var trim = _emberViews.jQuery.trim; + + var component = undefined, + fixture = undefined; + + function checkTemplate(templateName) { + _emberMetal.run(function () { + return _emberTemplateCompilerSystemBootstrap.default({ context: fixture, hasTemplate: _emberGlimmer.hasTemplate, setTemplate: _emberGlimmer.setTemplate }); + }); + + var template = _emberGlimmer.getTemplate(templateName); + + ok(template, 'template is available on Ember.TEMPLATES'); + equal(_emberViews.jQuery('#qunit-fixture script').length, 0, 'script removed'); + + var owner = _internalTestHelpers.buildOwner(); + owner.register('template:-top-level', template); + owner.register('component:-top-level', _emberGlimmer.Component.extend({ + layoutName: '-top-level', + firstName: 'Tobias', + drug: 'teamocil' + })); + + component = owner.lookup('component:-top-level'); + _internalTestHelpers.runAppend(component); + + equal(_emberViews.jQuery('#qunit-fixture').text().trim(), 'Tobias takes teamocil', 'template works'); + _internalTestHelpers.runDestroy(component); + } + + QUnit.module('ember-templates: bootstrap', { + setup: function () { + fixture = document.getElementById('qunit-fixture'); + }, + teardown: function () { + _emberGlimmer.setTemplates({}); + _internalTestHelpers.runDestroy(component); + } + }); + + QUnit.test('template with data-template-name should add a new template to Ember.TEMPLATES', function () { + _emberViews.jQuery('#qunit-fixture').html(''); + + checkTemplate('funkyTemplate'); + }); + + QUnit.test('template with id instead of data-template-name should add a new template to Ember.TEMPLATES', function () { + _emberViews.jQuery('#qunit-fixture').html(''); + + checkTemplate('funkyTemplate'); + }); + + QUnit.test('template without data-template-name or id should default to application', function () { + _emberViews.jQuery('#qunit-fixture').html(''); + + checkTemplate('application'); + }); + + if (typeof Handlebars === 'object') { + QUnit.test('template with type text/x-raw-handlebars should be parsed', function () { + _emberViews.jQuery('#qunit-fixture').html(''); + + _emberMetal.run(function () { + return _emberTemplateCompilerSystemBootstrap.default({ context: fixture, hasTemplate: _emberGlimmer.hasTemplate, setTemplate: _emberGlimmer.setTemplate }); + }); + + var template = _emberGlimmer.getTemplate('funkyTemplate'); + + ok(template, 'template with name funkyTemplate available'); + + // This won't even work with Ember templates + equal(trim(template({ name: 'Tobias' })), 'Tobias'); + }); + } + + QUnit.test('duplicated default application templates should throw exception', function () { + _emberViews.jQuery('#qunit-fixture').html(''); + + throws(function () { + return _emberTemplateCompilerSystemBootstrap.default({ context: fixture, hasTemplate: _emberGlimmer.hasTemplate, setTemplate: _emberGlimmer.setTemplate }); + }, /Template named "[^"]+" already exists\./, 'duplicate templates should not be allowed'); + }); + + QUnit.test('default application template and id application template present should throw exception', function () { + _emberViews.jQuery('#qunit-fixture').html(''); + + throws(function () { + return _emberTemplateCompilerSystemBootstrap.default({ context: fixture, hasTemplate: _emberGlimmer.hasTemplate, setTemplate: _emberGlimmer.setTemplate }); + }, /Template named "[^"]+" already exists\./, 'duplicate templates should not be allowed'); + }); + + QUnit.test('default application template and data-template-name application template present should throw exception', function () { + _emberViews.jQuery('#qunit-fixture').html(''); + + throws(function () { + return _emberTemplateCompilerSystemBootstrap.default({ context: fixture, hasTemplate: _emberGlimmer.hasTemplate, setTemplate: _emberGlimmer.setTemplate }); + }, /Template named "[^"]+" already exists\./, 'duplicate templates should not be allowed'); + }); + + QUnit.test('duplicated template id should throw exception', function () { + _emberViews.jQuery('#qunit-fixture').html(''); + + throws(function () { + return _emberTemplateCompilerSystemBootstrap.default({ context: fixture, hasTemplate: _emberGlimmer.hasTemplate, setTemplate: _emberGlimmer.setTemplate }); + }, /Template named "[^"]+" already exists\./, 'duplicate templates should not be allowed'); + }); + + QUnit.test('duplicated template data-template-name should throw exception', function () { + _emberViews.jQuery('#qunit-fixture').html(''); + + throws(function () { + return _emberTemplateCompilerSystemBootstrap.default({ context: fixture, hasTemplate: _emberGlimmer.hasTemplate, setTemplate: _emberGlimmer.setTemplate }); + }, /Template named "[^"]+" already exists\./, 'duplicate templates should not be allowed'); + }); +}); +enifed('ember-template-compiler/tests/system/bootstrap-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/tests/system'); + test('ember-template-compiler/tests/system/bootstrap-test.js should pass jscs', function () { + ok(true, 'ember-template-compiler/tests/system/bootstrap-test.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/tests/system/bootstrap-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/tests/system'); + QUnit.test('ember-template-compiler/tests/system/bootstrap-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/tests/system/bootstrap-test.js should pass jshint.'); + }); +}); +enifed('ember-template-compiler/tests/system/compile_options_test', ['exports', 'ember-template-compiler/index'], function (exports, _emberTemplateCompilerIndex) { + 'use strict'; + + QUnit.module('ember-template-compiler: default compile options'); + + QUnit.test('default options are a new copy', function () { + notEqual(_emberTemplateCompilerIndex.compileOptions(), _emberTemplateCompilerIndex.compileOptions()); + }); + + QUnit.test('has default AST plugins', function (assert) { + assert.expect(_emberTemplateCompilerIndex.defaultPlugins.length); + + var plugins = _emberTemplateCompilerIndex.compileOptions().plugins.ast; + + for (var i = 0; i < _emberTemplateCompilerIndex.defaultPlugins.length; i++) { + var plugin = _emberTemplateCompilerIndex.defaultPlugins[i]; + assert.ok(plugins.indexOf(plugin) > -1, 'includes ' + plugin); + } + }); +}); +enifed('ember-template-compiler/tests/system/compile_options_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-template-compiler/tests/system'); + test('ember-template-compiler/tests/system/compile_options_test.js should pass jscs', function () { + ok(true, 'ember-template-compiler/tests/system/compile_options_test.js should pass jscs.'); + }); +}); +enifed('ember-template-compiler/tests/system/compile_options_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-template-compiler/tests/system'); + QUnit.test('ember-template-compiler/tests/system/compile_options_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/tests/system/compile_options_test.js should pass jshint.'); + }); +}); +enifed('ember-testing/adapters/adapter.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/adapters'); + test('ember-testing/adapters/adapter.js should pass jscs', function () { + ok(true, 'ember-testing/adapters/adapter.js should pass jscs.'); + }); +}); +enifed('ember-testing/adapters/adapter.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/adapters'); + QUnit.test('ember-testing/adapters/adapter.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/adapters/adapter.js should pass jshint.'); + }); +}); +enifed('ember-testing/adapters/qunit.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/adapters'); + test('ember-testing/adapters/qunit.js should pass jscs', function () { + ok(true, 'ember-testing/adapters/qunit.js should pass jscs.'); + }); +}); +enifed('ember-testing/adapters/qunit.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/adapters'); + QUnit.test('ember-testing/adapters/qunit.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/adapters/qunit.js should pass jshint.'); + }); +}); +enifed('ember-testing/events.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing'); + test('ember-testing/events.js should pass jscs', function () { + ok(true, 'ember-testing/events.js should pass jscs.'); + }); +}); +enifed('ember-testing/events.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing'); + QUnit.test('ember-testing/events.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/events.js should pass jshint.'); + }); +}); +enifed('ember-testing/ext/application.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/ext'); + test('ember-testing/ext/application.js should pass jscs', function () { + ok(true, 'ember-testing/ext/application.js should pass jscs.'); + }); +}); +enifed('ember-testing/ext/application.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/ext'); + QUnit.test('ember-testing/ext/application.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/ext/application.js should pass jshint.'); + }); +}); +enifed('ember-testing/ext/rsvp.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/ext'); + test('ember-testing/ext/rsvp.js should pass jscs', function () { + ok(true, 'ember-testing/ext/rsvp.js should pass jscs.'); + }); +}); +enifed('ember-testing/ext/rsvp.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/ext'); + QUnit.test('ember-testing/ext/rsvp.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/ext/rsvp.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing'); + test('ember-testing/helpers.js should pass jscs', function () { + ok(true, 'ember-testing/helpers.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing'); + QUnit.test('ember-testing/helpers.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/and_then.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/and_then.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/and_then.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/and_then.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/and_then.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/and_then.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/click.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/click.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/click.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/click.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/click.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/click.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/current_path.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/current_path.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/current_path.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/current_path.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/current_path.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/current_path.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/current_route_name.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/current_route_name.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/current_route_name.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/current_route_name.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/current_route_name.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/current_route_name.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/current_url.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/current_url.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/current_url.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/current_url.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/current_url.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/current_url.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/fill_in.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/fill_in.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/fill_in.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/fill_in.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/fill_in.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/fill_in.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/find.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/find.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/find.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/find.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/find.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/find.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/find_with_assert.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/find_with_assert.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/find_with_assert.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/find_with_assert.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/find_with_assert.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/find_with_assert.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/key_event.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/key_event.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/key_event.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/key_event.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/key_event.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/key_event.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/pause_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/pause_test.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/pause_test.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/pause_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/pause_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/pause_test.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/trigger_event.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/trigger_event.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/trigger_event.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/trigger_event.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/trigger_event.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/trigger_event.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/visit.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/visit.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/visit.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/visit.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/visit.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/visit.js should pass jshint.'); + }); +}); +enifed('ember-testing/helpers/wait.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/helpers'); + test('ember-testing/helpers/wait.js should pass jscs', function () { + ok(true, 'ember-testing/helpers/wait.js should pass jscs.'); + }); +}); +enifed('ember-testing/helpers/wait.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/helpers'); + QUnit.test('ember-testing/helpers/wait.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/helpers/wait.js should pass jshint.'); + }); +}); +enifed('ember-testing/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing'); + test('ember-testing/index.js should pass jscs', function () { + ok(true, 'ember-testing/index.js should pass jscs.'); + }); +}); +enifed('ember-testing/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing'); + QUnit.test('ember-testing/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/index.js should pass jshint.'); + }); +}); +enifed('ember-testing/initializers.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing'); + test('ember-testing/initializers.js should pass jscs', function () { + ok(true, 'ember-testing/initializers.js should pass jscs.'); + }); +}); +enifed('ember-testing/initializers.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing'); + QUnit.test('ember-testing/initializers.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/initializers.js should pass jshint.'); + }); +}); +enifed('ember-testing/setup_for_testing.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing'); + test('ember-testing/setup_for_testing.js should pass jscs', function () { + ok(true, 'ember-testing/setup_for_testing.js should pass jscs.'); + }); +}); +enifed('ember-testing/setup_for_testing.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing'); + QUnit.test('ember-testing/setup_for_testing.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/setup_for_testing.js should pass jshint.'); + }); +}); +enifed('ember-testing/support.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing'); + test('ember-testing/support.js should pass jscs', function () { + ok(true, 'ember-testing/support.js should pass jscs.'); + }); +}); +enifed('ember-testing/support.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing'); + QUnit.test('ember-testing/support.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/support.js should pass jshint.'); + }); +}); +enifed('ember-testing/test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing'); + test('ember-testing/test.js should pass jscs', function () { + ok(true, 'ember-testing/test.js should pass jscs.'); + }); +}); +enifed('ember-testing/test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing'); + QUnit.test('ember-testing/test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/test.js should pass jshint.'); + }); +}); +enifed('ember-testing/test/adapter.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/test'); + test('ember-testing/test/adapter.js should pass jscs', function () { + ok(true, 'ember-testing/test/adapter.js should pass jscs.'); + }); +}); +enifed('ember-testing/test/adapter.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/test'); + QUnit.test('ember-testing/test/adapter.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/test/adapter.js should pass jshint.'); + }); +}); +enifed('ember-testing/test/helpers.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/test'); + test('ember-testing/test/helpers.js should pass jscs', function () { + ok(true, 'ember-testing/test/helpers.js should pass jscs.'); + }); +}); +enifed('ember-testing/test/helpers.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/test'); + QUnit.test('ember-testing/test/helpers.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/test/helpers.js should pass jshint.'); + }); +}); +enifed('ember-testing/test/on_inject_helpers.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/test'); + test('ember-testing/test/on_inject_helpers.js should pass jscs', function () { + ok(true, 'ember-testing/test/on_inject_helpers.js should pass jscs.'); + }); +}); +enifed('ember-testing/test/on_inject_helpers.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/test'); + QUnit.test('ember-testing/test/on_inject_helpers.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/test/on_inject_helpers.js should pass jshint.'); + }); +}); +enifed('ember-testing/test/pending_requests.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/test'); + test('ember-testing/test/pending_requests.js should pass jscs', function () { + ok(true, 'ember-testing/test/pending_requests.js should pass jscs.'); + }); +}); +enifed('ember-testing/test/pending_requests.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/test'); + QUnit.test('ember-testing/test/pending_requests.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/test/pending_requests.js should pass jshint.'); + }); +}); +enifed('ember-testing/test/promise.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/test'); + test('ember-testing/test/promise.js should pass jscs', function () { + ok(true, 'ember-testing/test/promise.js should pass jscs.'); + }); +}); +enifed('ember-testing/test/promise.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/test'); + QUnit.test('ember-testing/test/promise.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/test/promise.js should pass jshint.'); + }); +}); +enifed('ember-testing/test/run.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/test'); + test('ember-testing/test/run.js should pass jscs', function () { + ok(true, 'ember-testing/test/run.js should pass jscs.'); + }); +}); +enifed('ember-testing/test/run.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/test'); + QUnit.test('ember-testing/test/run.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/test/run.js should pass jshint.'); + }); +}); +enifed('ember-testing/test/waiters.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/test'); + test('ember-testing/test/waiters.js should pass jscs', function () { + ok(true, 'ember-testing/test/waiters.js should pass jscs.'); + }); +}); +enifed('ember-testing/test/waiters.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/test'); + QUnit.test('ember-testing/test/waiters.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/test/waiters.js should pass jshint.'); + }); +}); +enifed('ember-testing/tests/acceptance_test', ['exports', 'ember-metal', 'ember-views', 'ember-testing/test', 'ember-testing/adapters/qunit', 'ember-testing/initializers', 'ember-application', 'ember-routing', 'ember-template-compiler', 'ember-runtime', 'ember-glimmer'], function (exports, _emberMetal, _emberViews, _emberTestingTest, _emberTestingAdaptersQunit, _emberTestingInitializers, _emberApplication, _emberRouting, _emberTemplateCompiler, _emberRuntime, _emberGlimmer) { + 'use strict'; + + //ES6TODO: we need {{link-to}} and {{outlet}} to exist here + + var App, find, click, fillIn, currentRoute, currentURL, visit, originalAdapter, andThen, indexHitCount; + + QUnit.module('ember-testing Acceptance', { + setup: function () { + _emberViews.jQuery('').appendTo('head'); + _emberViews.jQuery('
    ').appendTo('body'); + + originalAdapter = _emberTestingTest.default.adapter; + + _emberMetal.run(function () { + indexHitCount = 0; + + App = _emberApplication.Application.create({ + rootElement: '#ember-testing' + }); + + App.Router.map(function () { + this.route('posts'); + this.route('comments'); + + this.route('abort_transition'); + + this.route('redirect'); + }); + + App.IndexRoute = _emberRouting.Route.extend({ + model: function () { + indexHitCount += 1; + } + }); + + App.PostsRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + currentRoute = 'posts'; + this._super.apply(this, arguments); + } + }); + + _emberGlimmer.setTemplate('posts', _emberTemplateCompiler.compile('
    ')); + + App.CommentsRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + currentRoute = 'comments'; + this._super.apply(this, arguments); + } + }); + + _emberGlimmer.setTemplate('comments', _emberTemplateCompiler.compile('
    {{input type="text"}}
    ')); + + App.AbortTransitionRoute = _emberRouting.Route.extend({ + beforeModel: function (transition) { + transition.abort(); + } + }); + + App.RedirectRoute = _emberRouting.Route.extend({ + beforeModel: function () { + this.transitionTo('comments'); + } + }); + + App.setupForTesting(); + }); + + _emberTestingTest.default.registerAsyncHelper('slowHelper', function () { + return new _emberRuntime.RSVP.Promise(function (resolve) { + setTimeout(resolve, 10); + }); + }); + + App.injectTestHelpers(); + + find = window.find; + click = window.click; + fillIn = window.fillIn; + visit = window.visit; + andThen = window.andThen; + currentURL = window.currentURL; + }, + + teardown: function () { + _emberTestingTest.default.unregisterHelper('slowHelper'); + _emberGlimmer.setTemplates({}); + _emberViews.jQuery('#ember-testing-container, #ember-testing').remove(); + _emberMetal.run(App, App.destroy); + App = null; + _emberTestingTest.default.adapter = originalAdapter; + indexHitCount = 0; + } + }); + + QUnit.test('helpers can be chained with then', function () { + expect(6); + + currentRoute = 'index'; + + visit('/posts').then(function () { + equal(currentRoute, 'posts', 'Successfully visited posts route'); + equal(currentURL(), '/posts', 'posts URL is correct'); + return click('a:contains("Comments")'); + }).then(function () { + equal(currentRoute, 'comments', 'visit chained with click'); + return fillIn('.ember-text-field', 'yeah'); + }).then(function () { + equal(_emberViews.jQuery('.ember-text-field').val(), 'yeah', 'chained with fillIn'); + return fillIn('.ember-text-field', '#ember-testing-container', 'context working'); + }).then(function () { + equal(_emberViews.jQuery('.ember-text-field').val(), 'context working', 'chained with fillIn'); + return click('.does-not-exist'); + }).then(null, function (e) { + equal(e.message, 'Element .does-not-exist not found.', 'Non-existent click exception caught'); + }); + }); + + // Keep this for backwards compatibility + + QUnit.test('helpers can be chained to each other', function () { + expect(7); + + currentRoute = 'index'; + + visit('/posts').click('a:first', '#comments-link').fillIn('.ember-text-field', 'hello').then(function () { + equal(currentRoute, 'comments', 'Successfully visited comments route'); + equal(currentURL(), '/comments', 'Comments URL is correct'); + equal(_emberViews.jQuery('.ember-text-field').val(), 'hello', 'Fillin successfully works'); + find('.ember-text-field').one('keypress', function (e) { + equal(e.keyCode, 13, 'keyevent chained with correct keyCode.'); + equal(e.which, 13, 'keyevent chained with correct which.'); + }); + }).keyEvent('.ember-text-field', 'keypress', 13).visit('/posts').then(function () { + equal(currentRoute, 'posts', 'Thens can also be chained to helpers'); + equal(currentURL(), '/posts', 'URL is set correct on chained helpers'); + }); + }); + + QUnit.test('helpers don\'t need to be chained', function () { + expect(5); + + currentRoute = 'index'; + + visit('/posts'); + + click('a:first', '#comments-link'); + + fillIn('.ember-text-field', 'hello'); + + andThen(function () { + equal(currentRoute, 'comments', 'Successfully visited comments route'); + equal(currentURL(), '/comments', 'Comments URL is correct'); + equal(find('.ember-text-field').val(), 'hello', 'Fillin successfully works'); + }); + + visit('/posts'); + + andThen(function () { + equal(currentRoute, 'posts'); + equal(currentURL(), '/posts'); + }); + }); + + QUnit.test('Nested async helpers', function () { + expect(5); + + currentRoute = 'index'; + + visit('/posts'); + + andThen(function () { + click('a:first', '#comments-link'); + + fillIn('.ember-text-field', 'hello'); + }); + + andThen(function () { + equal(currentRoute, 'comments', 'Successfully visited comments route'); + equal(currentURL(), '/comments', 'Comments URL is correct'); + equal(find('.ember-text-field').val(), 'hello', 'Fillin successfully works'); + }); + + visit('/posts'); + + andThen(function () { + equal(currentRoute, 'posts'); + equal(currentURL(), '/posts'); + }); + }); + + QUnit.test('Multiple nested async helpers', function () { + expect(3); + + visit('/posts'); + + andThen(function () { + click('a:first', '#comments-link'); + + fillIn('.ember-text-field', 'hello'); + fillIn('.ember-text-field', 'goodbye'); + }); + + andThen(function () { + equal(find('.ember-text-field').val(), 'goodbye', 'Fillin successfully works'); + equal(currentRoute, 'comments', 'Successfully visited comments route'); + equal(currentURL(), '/comments', 'Comments URL is correct'); + }); + }); + + QUnit.test('Helpers nested in thens', function () { + expect(5); + + currentRoute = 'index'; + + visit('/posts').then(function () { + click('a:first', '#comments-link'); + }); + + andThen(function () { + fillIn('.ember-text-field', 'hello'); + }); + + andThen(function () { + equal(currentRoute, 'comments', 'Successfully visited comments route'); + equal(currentURL(), '/comments', 'Comments URL is correct'); + equal(find('.ember-text-field').val(), 'hello', 'Fillin successfully works'); + }); + + visit('/posts'); + + andThen(function () { + equal(currentRoute, 'posts'); + equal(currentURL(), '/posts', 'Posts URL is correct'); + }); + }); + + QUnit.test('Aborted transitions are not logged via Ember.Test.adapter#exception', function () { + expect(0); + + _emberTestingTest.default.adapter = _emberTestingAdaptersQunit.default.create({ + exception: function (error) { + ok(false, 'aborted transitions are not logged'); + } + }); + + visit('/abort_transition'); + }); + + QUnit.test('Unhandled exceptions are logged via Ember.Test.adapter#exception', function () { + expect(2); + + var asyncHandled; + _emberTestingTest.default.adapter = _emberTestingAdaptersQunit.default.create({ + exception: function (error) { + equal(error.message, 'Element .does-not-exist not found.', 'Exception successfully caught and passed to Ember.Test.adapter.exception'); + asyncHandled['catch'](function () {}); // handle the rejection so it doesn't leak later. + } + }); + + visit('/posts'); + + click('.invalid-element').then(null, function (error) { + equal(error.message, 'Element .invalid-element not found.', 'Exception successfully handled in the rejection handler'); + }); + + asyncHandled = click('.does-not-exist'); + }); + + QUnit.test('Unhandled exceptions in `andThen` are logged via Ember.Test.adapter#exception', function () { + expect(1); + + _emberTestingTest.default.adapter = _emberTestingAdaptersQunit.default.create({ + exception: function (error) { + equal(error.message, 'Catch me', 'Exception successfully caught and passed to Ember.Test.adapter.exception'); + } + }); + + visit('/posts'); + + andThen(function () { + throw new Error('Catch me'); + }); + }); + + QUnit.test('should not start routing on the root URL when visiting another', function () { + expect(4); + + visit('/posts'); + + andThen(function () { + ok(find('#comments-link'), 'found comments-link'); + equal(currentRoute, 'posts', 'Successfully visited posts route'); + equal(currentURL(), '/posts', 'Posts URL is correct'); + equal(indexHitCount, 0, 'should not hit index route when visiting another route'); + }); + }); + + QUnit.test('only enters the index route once when visiting /', function () { + expect(1); + + visit('/'); + + andThen(function () { + equal(indexHitCount, 1, 'should hit index once when visiting /'); + }); + }); + + QUnit.test('test must not finish while asyncHelpers are pending', function () { + expect(2); + + var async = 0; + var innerRan = false; + + _emberTestingTest.default.adapter = _emberTestingAdaptersQunit.default.extend({ + asyncStart: function () { + async++; + this._super(); + }, + asyncEnd: function () { + async--; + this._super(); + } + }).create(); + + App.testHelpers.slowHelper(); + andThen(function () { + innerRan = true; + }); + + equal(innerRan, false, 'should not have run yet'); + ok(async > 0, 'should have told the adapter to pause'); + + if (async === 0) { + // If we failed the test, prevent zalgo from escaping and breaking + // our other tests. + _emberTestingTest.default.adapter.asyncStart(); + _emberTestingTest.default.resolve().then(function () { + _emberTestingTest.default.adapter.asyncEnd(); + }); + } + }); + + QUnit.test('visiting a URL that causes another transition should yield the correct URL', function () { + expect(1); + + visit('/redirect'); + + andThen(function () { + equal(currentURL(), '/comments', 'Redirected to Comments URL'); + }); + }); + + QUnit.test('visiting a URL and then visiting a second URL with a transition should yield the correct URL', function () { + expect(2); + + visit('/posts'); + + andThen(function () { + equal(currentURL(), '/posts', 'First visited URL is correct'); + }); + + visit('/redirect'); + + andThen(function () { + equal(currentURL(), '/comments', 'Redirected to Comments URL'); + }); + }); + + QUnit.module('ember-testing Acceptance – teardown'); + + QUnit.test('that the setup/teardown happens correct', function () { + expect(2); + + _emberViews.jQuery('').appendTo('head'); + _emberViews.jQuery('
    ').appendTo('body'); + + _emberMetal.run(function () { + indexHitCount = 0; + App = _emberApplication.Application.create({ + rootElement: '#ember-testing' + }); + }); + App.injectTestHelpers(); + + _emberViews.jQuery('#ember-testing-container, #ember-testing').remove(); + ok(typeof _emberTestingTest.default.Promise.prototype.click === 'function'); + _emberMetal.run(App, App.destroy); + equal(_emberTestingTest.default.Promise.prototype.click, undefined); + App = null; + _emberTestingTest.default.adapter = originalAdapter; + indexHitCount = 0; + }); +}); +// ensure the initializer is setup +enifed('ember-testing/tests/acceptance_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/tests'); + test('ember-testing/tests/acceptance_test.js should pass jscs', function () { + ok(true, 'ember-testing/tests/acceptance_test.js should pass jscs.'); + }); +}); +enifed('ember-testing/tests/acceptance_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/tests'); + QUnit.test('ember-testing/tests/acceptance_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/tests/acceptance_test.js should pass jshint.'); + }); +}); +enifed('ember-testing/tests/adapters/adapter_test', ['exports', 'ember-metal', 'ember-testing/adapters/adapter'], function (exports, _emberMetal, _emberTestingAdaptersAdapter) { + 'use strict'; + + var adapter; + + QUnit.module('ember-testing Adapter', { + setup: function () { + adapter = new _emberTestingAdaptersAdapter.default(); + }, + teardown: function () { + _emberMetal.run(adapter, adapter.destroy); + } + }); + + // Can't test these this way anymore since we have nothing to compare to + // test("asyncStart is a noop", function() { + // equal(adapter.asyncStart, K); + // }); + + // test("asyncEnd is a noop", function() { + // equal(adapter.asyncEnd, K); + // }); + + QUnit.test('exception throws', function () { + var error = 'Hai'; + var thrown; + + try { + adapter.exception(error); + } catch (e) { + thrown = e; + } + equal(thrown, error); + }); +}); +enifed('ember-testing/tests/adapters/adapter_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/tests/adapters'); + test('ember-testing/tests/adapters/adapter_test.js should pass jscs', function () { + ok(true, 'ember-testing/tests/adapters/adapter_test.js should pass jscs.'); + }); +}); +enifed('ember-testing/tests/adapters/adapter_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/tests/adapters'); + QUnit.test('ember-testing/tests/adapters/adapter_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/tests/adapters/adapter_test.js should pass jshint.'); + }); +}); +enifed('ember-testing/tests/adapters/qunit_test', ['exports', 'ember-metal', 'ember-testing/adapters/qunit'], function (exports, _emberMetal, _emberTestingAdaptersQunit) { + 'use strict'; + + var adapter; + + QUnit.module('ember-testing QUnitAdapter', { + setup: function () { + adapter = new _emberTestingAdaptersQunit.default(); + }, + teardown: function () { + _emberMetal.run(adapter, adapter.destroy); + } + }); + + QUnit.test('asyncStart calls stop', function () { + var originalStop = QUnit.stop; + try { + QUnit.stop = function () { + ok(true, 'stop called'); + }; + adapter.asyncStart(); + } finally { + QUnit.stop = originalStop; + } + }); + + QUnit.test('asyncEnd calls start', function () { + var originalStart = QUnit.start; + try { + QUnit.start = function () { + ok(true, 'start called'); + }; + adapter.asyncEnd(); + } finally { + QUnit.start = originalStart; + } + }); + + QUnit.test('exception causes a failing assertion', function () { + var error = { err: 'hai' }; + var originalOk = window.ok; + try { + window.ok = function (val, msg) { + originalOk(!val, 'ok is called with false'); + originalOk(msg, '{err: "hai"}'); + }; + adapter.exception(error); + } finally { + window.ok = originalOk; + } + }); +}); +enifed('ember-testing/tests/adapters/qunit_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/tests/adapters'); + test('ember-testing/tests/adapters/qunit_test.js should pass jscs', function () { + ok(true, 'ember-testing/tests/adapters/qunit_test.js should pass jscs.'); + }); +}); +enifed('ember-testing/tests/adapters/qunit_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/tests/adapters'); + QUnit.test('ember-testing/tests/adapters/qunit_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/tests/adapters/qunit_test.js should pass jshint.'); + }); +}); +enifed('ember-testing/tests/adapters_test', ['exports', 'ember-metal', 'ember-testing/test', 'ember-testing/adapters/adapter', 'ember-testing/adapters/qunit', 'ember-application'], function (exports, _emberMetal, _emberTestingTest, _emberTestingAdaptersAdapter, _emberTestingAdaptersQunit, _emberApplication) { + 'use strict'; + + var App, originalAdapter; + + QUnit.module('ember-testing Adapters', { + setup: function () { + originalAdapter = _emberTestingTest.default.adapter; + }, + teardown: function () { + _emberMetal.run(App, App.destroy); + App.removeTestHelpers(); + App = null; + + _emberTestingTest.default.adapter = originalAdapter; + } + }); + + QUnit.test('Setting a test adapter manually', function () { + expect(1); + var CustomAdapter; + + CustomAdapter = _emberTestingAdaptersAdapter.default.extend({ + asyncStart: function () { + ok(true, 'Correct adapter was used'); + } + }); + + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + _emberTestingTest.default.adapter = CustomAdapter.create(); + App.setupForTesting(); + }); + + _emberTestingTest.default.adapter.asyncStart(); + }); + + QUnit.test('QUnitAdapter is used by default', function () { + expect(1); + + _emberTestingTest.default.adapter = null; + + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.setupForTesting(); + }); + + ok(_emberTestingTest.default.adapter instanceof _emberTestingAdaptersQunit.default); + }); +}); +enifed('ember-testing/tests/adapters_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/tests'); + test('ember-testing/tests/adapters_test.js should pass jscs', function () { + ok(true, 'ember-testing/tests/adapters_test.js should pass jscs.'); + }); +}); +enifed('ember-testing/tests/adapters_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/tests'); + QUnit.test('ember-testing/tests/adapters_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/tests/adapters_test.js should pass jshint.'); + }); +}); +enifed('ember-testing/tests/ext/rsvp_test', ['exports', 'ember-testing/ext/rsvp', 'ember-testing/test/adapter', 'ember-metal'], function (exports, _emberTestingExtRsvp, _emberTestingTestAdapter, _emberMetal) { + 'use strict'; + + var originalTestAdapter = _emberTestingTestAdapter.getAdapter(); + var originalTestingFlag = _emberMetal.isTesting(); + + var asyncStarted = 0; + var asyncEnded = 0; + + QUnit.module('ember-testing RSVP', { + setup: function () { + _emberMetal.setTesting(true); + _emberTestingTestAdapter.setAdapter({ + asyncStart: function () { + asyncStarted++; + QUnit.stop(); + }, + asyncEnd: function () { + asyncEnded++; + QUnit.start(); + } + }); + }, + teardown: function () { + asyncStarted = 0; + asyncEnded = 0; + _emberTestingTestAdapter.setAdapter(originalTestAdapter); + _emberMetal.setTesting(originalTestingFlag); + } + }); + + QUnit.test('given `Ember.testing = true`, correctly informs the test suite about async steps', function () { + expect(19); + + ok(!_emberMetal.run.currentRunLoop, 'expect no run-loop'); + + _emberMetal.setTesting(true); + + equal(asyncStarted, 0); + equal(asyncEnded, 0); + + var user = _emberTestingExtRsvp.default.Promise.resolve({ + name: 'tomster' + }); + + equal(asyncStarted, 0); + equal(asyncEnded, 0); + + user.then(function (user) { + equal(asyncStarted, 1); + equal(asyncEnded, 1); + + equal(user.name, 'tomster'); + + return _emberTestingExtRsvp.default.Promise.resolve(1).then(function () { + equal(asyncStarted, 1); + equal(asyncEnded, 1); + }); + }).then(function () { + equal(asyncStarted, 1); + equal(asyncEnded, 1); + + return new _emberTestingExtRsvp.default.Promise(function (resolve) { + QUnit.stop(); // raw async, we must inform the test framework manually + setTimeout(function () { + QUnit.start(); // raw async, we must inform the test framework manually + + equal(asyncStarted, 1); + equal(asyncEnded, 1); + + resolve({ + name: 'async tomster' + }); + + equal(asyncStarted, 2); + equal(asyncEnded, 1); + }, 0); + }); + }).then(function (user) { + equal(user.name, 'async tomster'); + equal(asyncStarted, 2); + equal(asyncEnded, 2); + }); + }); +}); +enifed('ember-testing/tests/ext/rsvp_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/tests/ext'); + test('ember-testing/tests/ext/rsvp_test.js should pass jscs', function () { + ok(true, 'ember-testing/tests/ext/rsvp_test.js should pass jscs.'); + }); +}); +enifed('ember-testing/tests/ext/rsvp_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/tests/ext'); + QUnit.test('ember-testing/tests/ext/rsvp_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/tests/ext/rsvp_test.js should pass jshint.'); + }); +}); +enifed('ember-testing/tests/helper_registration_test', ['exports', 'ember-metal', 'ember-testing/test', 'ember-application'], function (exports, _emberMetal, _emberTestingTest, _emberApplication) { + 'use strict'; + + var App, appBooted, helperContainer; + + function registerHelper() { + _emberTestingTest.default.registerHelper('boot', function (app) { + _emberMetal.run(app, app.advanceReadiness); + appBooted = true; + return app.testHelpers.wait(); + }); + } + + function unregisterHelper() { + _emberTestingTest.default.unregisterHelper('boot'); + } + + var originalAdapter = _emberTestingTest.default.adapter; + + function setupApp() { + appBooted = false; + helperContainer = {}; + + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.setupForTesting(); + App.injectTestHelpers(helperContainer); + }); + } + + function destroyApp() { + if (App) { + _emberMetal.run(App, 'destroy'); + App = null; + } + } + + QUnit.module('Test - registerHelper/unregisterHelper', { + teardown: function () { + _emberTestingTest.default.adapter = originalAdapter; + destroyApp(); + } + }); + + QUnit.test('Helper gets registered', function () { + expect(2); + + registerHelper(); + setupApp(); + + ok(App.testHelpers.boot); + ok(helperContainer.boot); + }); + + QUnit.test('Helper is ran when called', function (assert) { + var done = assert.async(); + assert.expect(1); + + registerHelper(); + setupApp(); + + App.testHelpers.boot().then(function () { + assert.ok(appBooted); + }).finally(done); + }); + + QUnit.test('Helper can be unregistered', function () { + expect(4); + + registerHelper(); + setupApp(); + + ok(App.testHelpers.boot); + ok(helperContainer.boot); + + unregisterHelper(); + + setupApp(); + + ok(!App.testHelpers.boot, 'once unregistered the helper is not added to App.testHelpers'); + ok(!helperContainer.boot, 'once unregistered the helper is not added to the helperContainer'); + }); +}); +enifed('ember-testing/tests/helper_registration_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/tests'); + test('ember-testing/tests/helper_registration_test.js should pass jscs', function () { + ok(true, 'ember-testing/tests/helper_registration_test.js should pass jscs.'); + }); +}); +enifed('ember-testing/tests/helper_registration_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/tests'); + QUnit.test('ember-testing/tests/helper_registration_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/tests/helper_registration_test.js should pass jshint.'); + }); +}); +enifed('ember-testing/tests/helpers_test', ['exports', 'ember-routing', 'ember-runtime', 'ember-metal', 'ember-views', 'ember-glimmer', 'ember-testing/test', 'ember-testing/helpers', 'ember-testing/initializers', 'ember-testing/setup_for_testing', 'ember-application', 'ember-template-compiler', 'ember-testing/test/pending_requests', 'ember-testing/test/adapter', 'ember-testing/test/waiters'], function (exports, _emberRouting, _emberRuntime, _emberMetal, _emberViews, _emberGlimmer, _emberTestingTest, _emberTestingHelpers, _emberTestingInitializers, _emberTestingSetup_for_testing, _emberApplication, _emberTemplateCompiler, _emberTestingTestPending_requests, _emberTestingTestAdapter, _emberTestingTestWaiters) { + 'use strict'; + + var App; + var originalAdapter = _emberTestingTestAdapter.getAdapter(); + + function cleanup() { + // Teardown setupForTesting + + _emberTestingTestAdapter.setAdapter(originalAdapter); + _emberMetal.run(function () { + _emberViews.jQuery(document).off('ajaxSend'); + _emberViews.jQuery(document).off('ajaxComplete'); + }); + _emberTestingTestPending_requests.clearPendingRequests(); + // Test.waiters = null; + + // Other cleanup + + if (App) { + _emberMetal.run(App, App.destroy); + App.removeTestHelpers(); + App = null; + } + + _emberGlimmer.setTemplates({}); + } + + function assertHelpers(application, helperContainer, expected) { + if (!helperContainer) { + helperContainer = window; + } + if (expected === undefined) { + expected = true; + } + + function checkHelperPresent(helper, expected) { + var presentInHelperContainer = !!helperContainer[helper]; + var presentInTestHelpers = !!application.testHelpers[helper]; + + ok(presentInHelperContainer === expected, 'Expected \'' + helper + '\' to be present in the helper container (defaults to window).'); + ok(presentInTestHelpers === expected, 'Expected \'' + helper + '\' to be present in App.testHelpers.'); + } + + checkHelperPresent('visit', expected); + checkHelperPresent('click', expected); + checkHelperPresent('keyEvent', expected); + checkHelperPresent('fillIn', expected); + checkHelperPresent('wait', expected); + checkHelperPresent('triggerEvent', expected); + } + + function assertNoHelpers(application, helperContainer) { + assertHelpers(application, helperContainer, false); + } + + function currentRouteName(app) { + return app.testHelpers.currentRouteName(); + } + + function currentPath(app) { + return app.testHelpers.currentPath(); + } + + function currentURL(app) { + return app.testHelpers.currentURL(); + } + + function setupApp() { + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.setupForTesting(); + + App.injectTestHelpers(); + }); + } + + QUnit.module('ember-testing: Helper setup', { + setup: function () { + cleanup(); + }, + teardown: function () { + cleanup(); + } + }); + + function registerHelper() { + _emberTestingTest.default.registerHelper('LeakyMcLeakLeak', function (app) {}); + } + + QUnit.test('Ember.Application#injectTestHelpers/#removeTestHelpers', function () { + App = _emberMetal.run(_emberApplication.Application, _emberApplication.Application.create); + assertNoHelpers(App); + + registerHelper(); + + App.injectTestHelpers(); + assertHelpers(App); + ok(_emberTestingTest.default.Promise.prototype.LeakyMcLeakLeak, 'helper in question SHOULD be present'); + + App.removeTestHelpers(); + assertNoHelpers(App); + + equal(_emberTestingTest.default.Promise.prototype.LeakyMcLeakLeak, undefined, 'should NOT leak test promise extensions'); + }); + + QUnit.test('Ember.Application#setupForTesting', function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.setupForTesting(); + }); + + equal(App.__container__.lookup('router:main').location, 'none'); + }); + + QUnit.test('Ember.Application.setupForTesting sets the application to `testing`.', function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.setupForTesting(); + }); + + equal(App.testing, true, 'Application instance is set to testing.'); + }); + + QUnit.test('Ember.Application.setupForTesting leaves the system in a deferred state.', function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.setupForTesting(); + }); + + equal(App._readinessDeferrals, 1, 'App is in deferred state after setupForTesting.'); + }); + + QUnit.test('App.reset() after Application.setupForTesting leaves the system in a deferred state.', function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.setupForTesting(); + }); + + equal(App._readinessDeferrals, 1, 'App is in deferred state after setupForTesting.'); + + App.reset(); + equal(App._readinessDeferrals, 1, 'App is in deferred state after setupForTesting.'); + }); + + QUnit.test('Ember.Application#setupForTesting attaches ajax listeners', function () { + var documentEvents; + + documentEvents = _emberViews.jQuery._data(document, 'events'); + + if (!documentEvents) { + documentEvents = {}; + } + + ok(documentEvents['ajaxSend'] === undefined, 'there are no ajaxSend listers setup prior to calling injectTestHelpers'); + ok(documentEvents['ajaxComplete'] === undefined, 'there are no ajaxComplete listers setup prior to calling injectTestHelpers'); + + _emberMetal.run(function () { + _emberTestingSetup_for_testing.default(); + }); + + documentEvents = _emberViews.jQuery._data(document, 'events'); + + equal(documentEvents['ajaxSend'].length, 1, 'calling injectTestHelpers registers an ajaxSend handler'); + equal(documentEvents['ajaxComplete'].length, 1, 'calling injectTestHelpers registers an ajaxComplete handler'); + }); + + QUnit.test('Ember.Application#setupForTesting attaches ajax listeners only once', function () { + var documentEvents; + + documentEvents = _emberViews.jQuery._data(document, 'events'); + + if (!documentEvents) { + documentEvents = {}; + } + + ok(documentEvents['ajaxSend'] === undefined, 'there are no ajaxSend listeners setup prior to calling injectTestHelpers'); + ok(documentEvents['ajaxComplete'] === undefined, 'there are no ajaxComplete listeners setup prior to calling injectTestHelpers'); + + _emberMetal.run(function () { + _emberTestingSetup_for_testing.default(); + }); + _emberMetal.run(function () { + _emberTestingSetup_for_testing.default(); + }); + + documentEvents = _emberViews.jQuery._data(document, 'events'); + + equal(documentEvents['ajaxSend'].length, 1, 'calling injectTestHelpers registers an ajaxSend handler'); + equal(documentEvents['ajaxComplete'].length, 1, 'calling injectTestHelpers registers an ajaxComplete handler'); + }); + + QUnit.test('Ember.Application#injectTestHelpers calls callbacks registered with onInjectHelpers', function () { + var injected = 0; + + _emberTestingTest.default.onInjectHelpers(function () { + injected++; + }); + + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.setupForTesting(); + }); + + equal(injected, 0, 'onInjectHelpers are not called before injectTestHelpers'); + + App.injectTestHelpers(); + + equal(injected, 1, 'onInjectHelpers are called after injectTestHelpers'); + }); + + QUnit.test('Ember.Application#injectTestHelpers adds helpers to provided object.', function () { + var helpers = {}; + + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.setupForTesting(); + }); + + App.injectTestHelpers(helpers); + assertHelpers(App, helpers); + + App.removeTestHelpers(); + assertNoHelpers(App, helpers); + }); + + QUnit.test('Ember.Application#removeTestHelpers resets the helperContainer\'s original values', function () { + var helpers = { visit: 'snazzleflabber' }; + + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.setupForTesting(); + }); + + App.injectTestHelpers(helpers); + + ok(helpers.visit !== 'snazzleflabber', 'helper added to container'); + App.removeTestHelpers(); + + ok(helpers.visit === 'snazzleflabber', 'original value added back to container'); + }); + + QUnit.module('ember-testing: Helper methods', { + setup: function () { + setupApp(); + }, + teardown: function () { + cleanup(); + } + }); + + QUnit.test('`wait` respects registerWaiters', function (assert) { + assert.expect(3); + + var done = assert.async(); + + var counter = 0; + function waiter() { + return ++counter > 2; + } + + var other = 0; + function otherWaiter() { + return ++other > 2; + } + + _emberMetal.run(App, App.advanceReadiness); + _emberTestingTestWaiters.registerWaiter(waiter); + _emberTestingTestWaiters.registerWaiter(otherWaiter); + + App.testHelpers.wait().then(function () { + equal(waiter(), true, 'should not resolve until our waiter is ready'); + _emberTestingTestWaiters.unregisterWaiter(waiter); + counter = 0; + return App.testHelpers.wait(); + }).then(function () { + equal(counter, 0, 'unregistered waiter was not checked'); + equal(otherWaiter(), true, 'other waiter is still registered'); + }).finally(function () { + _emberTestingTestWaiters.unregisterWaiter(otherWaiter); + done(); + }); + }); + + QUnit.test('`visit` advances readiness.', function () { + expect(2); + + equal(App._readinessDeferrals, 1, 'App is in deferred state after setupForTesting.'); + + return App.testHelpers.visit('/').then(function () { + equal(App._readinessDeferrals, 0, 'App\'s readiness was advanced by visit.'); + }); + }); + + QUnit.test('`wait` helper can be passed a resolution value', function () { + expect(4); + + var promise, wait; + + promise = new _emberRuntime.RSVP.Promise(function (resolve) { + _emberMetal.run(null, resolve, 'promise'); + }); + + _emberMetal.run(App, App.advanceReadiness); + + wait = App.testHelpers.wait; + + return wait('text').then(function (val) { + equal(val, 'text', 'can resolve to a string'); + return wait(1); + }).then(function (val) { + equal(val, 1, 'can resolve to an integer'); + return wait({ age: 10 }); + }).then(function (val) { + deepEqual(val, { age: 10 }, 'can resolve to an object'); + return wait(promise); + }).then(function (val) { + equal(val, 'promise', 'can resolve to a promise resolution value'); + }); + }); + + QUnit.test('`click` triggers appropriate events in order', function () { + expect(5); + + var click, wait, events; + + App.IndexWrapperComponent = _emberGlimmer.Component.extend({ + classNames: 'index-wrapper', + + didInsertElement: function () { + this.$().on('mousedown focusin mouseup click', function (e) { + events.push(e.type); + }); + } + }); + + App.XCheckboxComponent = _emberGlimmer.Component.extend({ + tagName: 'input', + attributeBindings: ['type'], + type: 'checkbox', + click: function () { + events.push('click:' + this.get('checked')); + }, + change: function () { + events.push('change:' + this.get('checked')); + } + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#index-wrapper}}{{input type="text"}} {{x-checkbox type="checkbox"}} {{textarea}}
    {{/index-wrapper}}')); + + _emberMetal.run(App, App.advanceReadiness); + + click = App.testHelpers.click; + wait = App.testHelpers.wait; + + return wait().then(function () { + events = []; + return click('.index-wrapper'); + }).then(function () { + deepEqual(events, ['mousedown', 'mouseup', 'click'], 'fires events in order'); + }).then(function () { + events = []; + return click('.index-wrapper input[type=text]'); + }).then(function () { + deepEqual(events, ['mousedown', 'focusin', 'mouseup', 'click'], 'fires focus events on inputs'); + }).then(function () { + events = []; + return click('.index-wrapper textarea'); + }).then(function () { + deepEqual(events, ['mousedown', 'focusin', 'mouseup', 'click'], 'fires focus events on textareas'); + }).then(function () { + events = []; + return click('.index-wrapper div'); + }).then(function () { + deepEqual(events, ['mousedown', 'focusin', 'mouseup', 'click'], 'fires focus events on contenteditable'); + }).then(function () { + events = []; + return click('.index-wrapper input[type=checkbox]'); + }).then(function () { + // i.e. mousedown, mouseup, change:true, click, click:true + // Firefox differs so we can't assert the exact ordering here. + // See https://bugzilla.mozilla.org/show_bug.cgi?id=843554. + equal(events.length, 5, 'fires click and change on checkboxes'); + }); + }); + + QUnit.test('`click` triggers native events with simulated X/Y coordinates', function () { + expect(15); + + var click, wait, events; + + App.IndexWrapperComponent = _emberGlimmer.Component.extend({ + classNames: 'index-wrapper', + + didInsertElement: function () { + var pushEvent = function (e) { + return events.push(e); + }; + this.element.addEventListener('mousedown', pushEvent); + this.element.addEventListener('mouseup', pushEvent); + this.element.addEventListener('click', pushEvent); + } + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#index-wrapper}}some text{{/index-wrapper}}')); + + _emberMetal.run(App, App.advanceReadiness); + + click = App.testHelpers.click; + wait = App.testHelpers.wait; + + return wait().then(function () { + events = []; + return click('.index-wrapper'); + }).then(function () { + events.forEach(function (e) { + ok(e instanceof window.Event, 'The event is an instance of MouseEvent'); + ok(typeof e.screenX === 'number' && e.screenX > 0, 'screenX is correct'); + ok(typeof e.screenY === 'number' && e.screenY > 0, 'screenY is correct'); + ok(typeof e.clientX === 'number' && e.clientX > 0, 'clientX is correct'); + ok(typeof e.clientY === 'number' && e.clientY > 0, 'clientY is correct'); + }); + }); + }); + + QUnit.test('`triggerEvent` with mouseenter triggers native events with simulated X/Y coordinates', function () { + expect(5); + + var triggerEvent, wait, evt; + + App.IndexWrapperComponent = _emberGlimmer.Component.extend({ + classNames: 'index-wrapper', + + didInsertElement: function () { + this.element.addEventListener('mouseenter', function (e) { + return evt = e; + }); + } + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#index-wrapper}}some text{{/index-wrapper}}')); + + _emberMetal.run(App, App.advanceReadiness); + + triggerEvent = App.testHelpers.triggerEvent; + wait = App.testHelpers.wait; + + return wait().then(function () { + return triggerEvent('.index-wrapper', 'mouseenter'); + }).then(function () { + ok(evt instanceof window.Event, 'The event is an instance of MouseEvent'); + ok(typeof evt.screenX === 'number' && evt.screenX > 0, 'screenX is correct'); + ok(typeof evt.screenY === 'number' && evt.screenY > 0, 'screenY is correct'); + ok(typeof evt.clientX === 'number' && evt.clientX > 0, 'clientX is correct'); + ok(typeof evt.clientY === 'number' && evt.clientY > 0, 'clientY is correct'); + }); + }); + + QUnit.test('`wait` waits for outstanding timers', function () { + expect(1); + + var wait_done = false; + + _emberMetal.run(App, App.advanceReadiness); + + _emberMetal.run.later(this, function () { + wait_done = true; + }, 500); + + return App.testHelpers.wait().then(function () { + equal(wait_done, true, 'should wait for the timer to be fired.'); + }); + }); + + QUnit.test('`wait` respects registerWaiters with optional context', function () { + expect(3); + + var obj = { + counter: 0, + ready: function () { + return ++this.counter > 2; + } + }; + + var other = 0; + function otherWaiter() { + return ++other > 2; + } + + _emberMetal.run(App, App.advanceReadiness); + _emberTestingTestWaiters.registerWaiter(obj, obj.ready); + _emberTestingTestWaiters.registerWaiter(otherWaiter); + + return App.testHelpers.wait().then(function () { + equal(obj.ready(), true, 'should not resolve until our waiter is ready'); + _emberTestingTestWaiters.unregisterWaiter(obj, obj.ready); + obj.counter = 0; + return App.testHelpers.wait(); + }).then(function () { + equal(obj.counter, 0, 'the unregistered waiter should still be at 0'); + equal(otherWaiter(), true, 'other waiter should still be registered'); + }).finally(function () { + _emberTestingTestWaiters.unregisterWaiter(otherWaiter); + }); + }); + + QUnit.test('`wait` does not error if routing has not begun', function () { + expect(1); + + return App.testHelpers.wait().then(function () { + ok(true, 'should not error without `visit`'); + }); + }); + + QUnit.test('`triggerEvent accepts an optional options hash without context', function () { + expect(3); + + var triggerEvent, wait, event; + + App.IndexWrapperComponent = _emberGlimmer.Component.extend({ + didInsertElement: function () { + this.$('.input').on('keydown change', function (e) { + event = e; + }); + } + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{index-wrapper}}')); + _emberGlimmer.setTemplate('components/index-wrapper', _emberTemplateCompiler.compile('{{input type="text" id="scope" class="input"}}')); + + _emberMetal.run(App, App.advanceReadiness); + + triggerEvent = App.testHelpers.triggerEvent; + wait = App.testHelpers.wait; + + return wait().then(function () { + return triggerEvent('.input', 'keydown', { keyCode: 13 }); + }).then(function () { + equal(event.keyCode, 13, 'options were passed'); + equal(event.type, 'keydown', 'correct event was triggered'); + equal(event.target.getAttribute('id'), 'scope', 'triggered on the correct element'); + }); + }); + + QUnit.test('`triggerEvent can limit searching for a selector to a scope', function () { + expect(2); + + var triggerEvent, wait, event; + + App.IndexWrapperComponent = _emberGlimmer.Component.extend({ + + didInsertElement: function () { + this.$('.input').on('blur change', function (e) { + event = e; + }); + } + }); + + _emberGlimmer.setTemplate('components/index-wrapper', _emberTemplateCompiler.compile('{{input type="text" id="outside-scope" class="input"}}
    {{input type="text" id="inside-scope" class="input"}}
    ')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{index-wrapper}}')); + + _emberMetal.run(App, App.advanceReadiness); + + triggerEvent = App.testHelpers.triggerEvent; + wait = App.testHelpers.wait; + + return wait().then(function () { + return triggerEvent('.input', '#limited', 'blur'); + }).then(function () { + equal(event.type, 'blur', 'correct event was triggered'); + equal(event.target.getAttribute('id'), 'inside-scope', 'triggered on the correct element'); + }); + }); + + QUnit.test('`triggerEvent` can be used to trigger arbitrary events', function () { + expect(2); + + var triggerEvent, wait, event; + + App.IndexWrapperComponent = _emberGlimmer.Component.extend({ + didInsertElement: function () { + this.$('#foo').on('blur change', function (e) { + event = e; + }); + } + }); + + _emberGlimmer.setTemplate('components/index-wrapper', _emberTemplateCompiler.compile('{{input type="text" id="foo"}}')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{index-wrapper}}')); + + _emberMetal.run(App, App.advanceReadiness); + + triggerEvent = App.testHelpers.triggerEvent; + wait = App.testHelpers.wait; + + return wait().then(function () { + return triggerEvent('#foo', 'blur'); + }).then(function () { + equal(event.type, 'blur', 'correct event was triggered'); + equal(event.target.getAttribute('id'), 'foo', 'triggered on the correct element'); + }); + }); + + QUnit.test('`fillIn` takes context into consideration', function () { + expect(2); + var fillIn, find, visit, andThen, wait; + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('
    {{input type="text" id="first" class="current"}}
    {{input type="text" id="second" class="current"}}')); + + _emberMetal.run(App, App.advanceReadiness); + + fillIn = App.testHelpers.fillIn; + find = App.testHelpers.find; + visit = App.testHelpers.visit; + andThen = App.testHelpers.andThen; + wait = App.testHelpers.wait; + + visit('/'); + fillIn('.current', '#parent', 'current value'); + + return andThen(function () { + equal(find('#first').val(), 'current value'); + equal(find('#second').val(), ''); + }); + }); + + QUnit.test('`fillIn` focuses on the element', function () { + expect(2); + var fillIn, find, visit, andThen, wait; + + App.ApplicationRoute = _emberRouting.Route.extend({ + actions: { + wasFocused: function () { + ok(true, 'focusIn event was triggered'); + } + } + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('
    {{input type="text" id="first" focus-in="wasFocused"}}
    ')); + + _emberMetal.run(App, App.advanceReadiness); + + fillIn = App.testHelpers.fillIn; + find = App.testHelpers.find; + visit = App.testHelpers.visit; + andThen = App.testHelpers.andThen; + wait = App.testHelpers.wait; + + visit('/'); + fillIn('#first', 'current value'); + andThen(function () { + equal(find('#first').val(), 'current value'); + }); + + return wait(); + }); + + QUnit.test('`fillIn` fires `input` and `change` events in the proper order', function () { + expect(1); + + var fillIn, visit, andThen, wait; + var events = []; + App.IndexController = _emberRuntime.Controller.extend({ + actions: { + oninputHandler: function (e) { + events.push(e.type); + }, + onchangeHandler: function (e) { + events.push(e.type); + } + } + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('')); + + _emberMetal.run(App, App.advanceReadiness); + + fillIn = App.testHelpers.fillIn; + visit = App.testHelpers.visit; + andThen = App.testHelpers.andThen; + wait = App.testHelpers.wait; + + visit('/'); + fillIn('#first', 'current value'); + andThen(function () { + deepEqual(events, ['input', 'change'], '`input` and `change` events are fired in the proper order'); + }); + + return wait(); + }); + + QUnit.test('`fillIn` only sets the value in the first matched element', function () { + var fillIn = undefined, + find = undefined, + visit = undefined, + andThen = undefined, + wait = undefined; + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('')); + _emberMetal.run(App, App.advanceReadiness); + + fillIn = App.testHelpers.fillIn; + find = App.testHelpers.find; + visit = App.testHelpers.visit; + andThen = App.testHelpers.andThen; + wait = App.testHelpers.wait; + + visit('/'); + fillIn('input.in-test', 'new value'); + andThen(function () { + equal(find('#first').val(), 'new value'); + equal(find('#second').val(), ''); + }); + + return wait(); + }); + + QUnit.test('`triggerEvent accepts an optional options hash and context', function () { + expect(3); + + var triggerEvent, wait, event; + + App.IndexWrapperComponent = _emberGlimmer.Component.extend({ + didInsertElement: function () { + this.$('.input').on('keydown change', function (e) { + event = e; + }); + } + }); + + _emberGlimmer.setTemplate('components/index-wrapper', _emberTemplateCompiler.compile('{{input type="text" id="outside-scope" class="input"}}
    {{input type="text" id="inside-scope" class="input"}}
    ')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{index-wrapper}}')); + + _emberMetal.run(App, App.advanceReadiness); + + triggerEvent = App.testHelpers.triggerEvent; + wait = App.testHelpers.wait; + + return wait().then(function () { + return triggerEvent('.input', '#limited', 'keydown', { keyCode: 13 }); + }).then(function () { + equal(event.keyCode, 13, 'options were passed'); + equal(event.type, 'keydown', 'correct event was triggered'); + equal(event.target.getAttribute('id'), 'inside-scope', 'triggered on the correct element'); + }); + }); + + QUnit.module('ember-testing debugging helpers', { + setup: function () { + setupApp(); + + _emberMetal.run(function () { + App.Router = _emberRouting.Router.extend({ + location: 'none' + }); + }); + + _emberMetal.run(App, 'advanceReadiness'); + }, + + teardown: function () { + cleanup(); + } + }); + + QUnit.test('pauseTest pauses', function () { + expect(1); + + function fakeAdapterAsyncStart() { + ok(true, 'Async start should be called after waiting for other helpers'); + } + + App.testHelpers.andThen(function () { + _emberTestingTest.default.adapter.asyncStart = fakeAdapterAsyncStart; + }); + + App.testHelpers.pauseTest(); + }); + + if (false) { + QUnit.test('resumeTest resumes paused tests', function () { + expect(1); + + var pausePromise = App.testHelpers.pauseTest(); + setTimeout(function () { + return App.testHelpers.resumeTest(); + }, 0); + + return pausePromise.then(function () { + return ok(true, 'pauseTest promise was resolved'); + }); + }); + + QUnit.test('resumeTest throws if nothing to resume', function () { + expect(1); + + throws(function () { + return App.testHelpers.resumeTest(); + }, /Testing has not been paused. There is nothing to resume./); + }); + } + + QUnit.module('ember-testing routing helpers', { + setup: function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.setupForTesting(); + + App.injectTestHelpers(); + + App.Router = _emberRouting.Router.extend({ + location: 'none' + }); + + App.Router.map(function () { + this.route('posts', { resetNamespace: true }, function () { + this.route('new'); + }); + }); + }); + + _emberMetal.run(App, 'advanceReadiness'); + }, + + teardown: function () { + cleanup(); + } + }); + + QUnit.test('currentRouteName for \'/\'', function () { + expect(3); + + return App.testHelpers.visit('/').then(function () { + equal(App.testHelpers.currentRouteName(), 'index', 'should equal \'index\'.'); + equal(App.testHelpers.currentPath(), 'index', 'should equal \'index\'.'); + equal(App.testHelpers.currentURL(), '/', 'should equal \'/\'.'); + }); + }); + + QUnit.test('currentRouteName for \'/posts\'', function () { + expect(3); + + return App.testHelpers.visit('/posts').then(function () { + equal(App.testHelpers.currentRouteName(), 'posts.index', 'should equal \'posts.index\'.'); + equal(App.testHelpers.currentPath(), 'posts.index', 'should equal \'posts.index\'.'); + equal(App.testHelpers.currentURL(), '/posts', 'should equal \'/posts\'.'); + }); + }); + + QUnit.test('currentRouteName for \'/posts/new\'', function () { + expect(3); + + return App.testHelpers.visit('/posts/new').then(function () { + equal(App.testHelpers.currentRouteName(), 'posts.new', 'should equal \'posts.new\'.'); + equal(App.testHelpers.currentPath(), 'posts.new', 'should equal \'posts.new\'.'); + equal(App.testHelpers.currentURL(), '/posts/new', 'should equal \'/posts/new\'.'); + }); + }); + + QUnit.module('ember-testing pendingRequests', { + setup: function () { + setupApp(); + }, + + teardown: function () { + cleanup(); + } + }); + + QUnit.test('pendingRequests is maintained for ajaxSend and ajaxComplete events', function () { + equal(_emberTestingTestPending_requests.pendingRequests(), 0); + var xhr = { some: 'xhr' }; + _emberViews.jQuery(document).trigger('ajaxSend', xhr); + equal(_emberTestingTestPending_requests.pendingRequests(), 1, 'Ember.Test.pendingRequests was incremented'); + _emberViews.jQuery(document).trigger('ajaxComplete', xhr); + equal(_emberTestingTestPending_requests.pendingRequests(), 0, 'Ember.Test.pendingRequests was decremented'); + }); + + QUnit.test('pendingRequests is ignores ajaxComplete events from past setupForTesting calls', function () { + equal(_emberTestingTestPending_requests.pendingRequests(), 0); + var xhr = { some: 'xhr' }; + _emberViews.jQuery(document).trigger('ajaxSend', xhr); + equal(_emberTestingTestPending_requests.pendingRequests(), 1, 'Ember.Test.pendingRequests was incremented'); + + _emberMetal.run(function () { + _emberTestingSetup_for_testing.default(); + }); + equal(_emberTestingTestPending_requests.pendingRequests(), 0, 'Ember.Test.pendingRequests was reset'); + + var altXhr = { some: 'more xhr' }; + _emberViews.jQuery(document).trigger('ajaxSend', altXhr); + equal(_emberTestingTestPending_requests.pendingRequests(), 1, 'Ember.Test.pendingRequests was incremented'); + _emberViews.jQuery(document).trigger('ajaxComplete', xhr); + equal(_emberTestingTestPending_requests.pendingRequests(), 1, 'Ember.Test.pendingRequests is not impressed with your unexpected complete'); + }); + + QUnit.test('pendingRequests is reset by setupForTesting', function () { + _emberTestingTestPending_requests.incrementPendingRequests(); + _emberMetal.run(function () { + _emberTestingSetup_for_testing.default(); + }); + equal(_emberTestingTestPending_requests.pendingRequests(), 0, 'pendingRequests is reset'); + }); + + QUnit.module('ember-testing async router', { + setup: function () { + cleanup(); + + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.Router = _emberRouting.Router.extend({ + location: 'none' + }); + + App.Router.map(function () { + this.route('user', { resetNamespace: true }, function () { + this.route('profile'); + this.route('edit'); + }); + }); + + App.UserRoute = _emberRouting.Route.extend({ + model: function () { + return resolveLater(); + } + }); + + App.UserProfileRoute = _emberRouting.Route.extend({ + beforeModel: function () { + var self = this; + return resolveLater().then(function () { + self.transitionTo('user.edit'); + }); + } + }); + + // Emulates a long-running unscheduled async operation. + function resolveLater() { + var promise; + + _emberMetal.run(function () { + promise = new _emberRuntime.RSVP.Promise(function (resolve) { + // The wait() helper has a 10ms tick. We should resolve() after at least one tick + // to test whether wait() held off while the async router was still loading. 20ms + // should be enough. + setTimeout(function () { + _emberMetal.run(function () { + resolve(_emberRuntime.Object.create({ firstName: 'Tom' })); + }); + }, 20); + }); + }); + + return promise; + } + + App.setupForTesting(); + }); + + App.injectTestHelpers(); + _emberMetal.run(App, 'advanceReadiness'); + }, + + teardown: function () { + cleanup(); + } + }); + + QUnit.test('currentRouteName for \'/user\'', function () { + expect(4); + + return App.testHelpers.visit('/user').then(function () { + equal(currentRouteName(App), 'user.index', 'should equal \'user.index\'.'); + equal(currentPath(App), 'user.index', 'should equal \'user.index\'.'); + equal(currentURL(App), '/user', 'should equal \'/user\'.'); + equal(App.__container__.lookup('route:user').get('controller.model.firstName'), 'Tom', 'should equal \'Tom\'.'); + }); + }); + + QUnit.test('currentRouteName for \'/user/profile\'', function () { + expect(4); + + return App.testHelpers.visit('/user/profile').then(function () { + equal(currentRouteName(App), 'user.edit', 'should equal \'user.edit\'.'); + equal(currentPath(App), 'user.edit', 'should equal \'user.edit\'.'); + equal(currentURL(App), '/user/edit', 'should equal \'/user/edit\'.'); + equal(App.__container__.lookup('route:user').get('controller.model.firstName'), 'Tom', 'should equal \'Tom\'.'); + }); + }); + + var originalVisitHelper, originalFindHelper, originalWaitHelper; + + QUnit.module('can override built-in helpers', { + setup: function () { + originalVisitHelper = _emberTestingTest.default._helpers.visit; + originalFindHelper = _emberTestingTest.default._helpers.find; + originalWaitHelper = _emberTestingTest.default._helpers.wait; + + _emberViews.jQuery('').appendTo('head'); + _emberViews.jQuery('
    ').appendTo('body'); + _emberMetal.run(function () { + App = _emberApplication.Application.create({ + rootElement: '#ember-testing' + }); + + App.setupForTesting(); + }); + }, + + teardown: function () { + cleanup(); + + _emberTestingTest.default._helpers.visit = originalVisitHelper; + _emberTestingTest.default._helpers.find = originalFindHelper; + _emberTestingTest.default._helpers.wait = originalWaitHelper; + } + }); + + QUnit.test('can override visit helper', function () { + expect(1); + + _emberTestingTest.default.registerHelper('visit', function () { + ok(true, 'custom visit helper was called'); + }); + + App.injectTestHelpers(); + + return App.testHelpers.visit(); + }); + + QUnit.test('can override find helper', function () { + expect(1); + + _emberTestingTest.default.registerHelper('find', function () { + ok(true, 'custom find helper was called'); + + return ['not empty array']; + }); + + App.injectTestHelpers(); + + return App.testHelpers.findWithAssert('.who-cares'); + }); +}); +// ensure that the helpers are loaded +// ensure the initializer is setup +enifed('ember-testing/tests/helpers_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/tests'); + test('ember-testing/tests/helpers_test.js should pass jscs', function () { + ok(true, 'ember-testing/tests/helpers_test.js should pass jscs.'); + }); +}); +enifed('ember-testing/tests/helpers_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/tests'); + QUnit.test('ember-testing/tests/helpers_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/tests/helpers_test.js should pass jshint.'); + }); +}); +enifed('ember-testing/tests/integration_test', ['exports', 'ember-metal', 'ember-runtime', 'ember-views', 'ember-testing/test', 'ember-routing', 'ember-application', 'ember-template-compiler', 'ember-glimmer'], function (exports, _emberMetal, _emberRuntime, _emberViews, _emberTestingTest, _emberRouting, _emberApplication, _emberTemplateCompiler, _emberGlimmer) { + 'use strict'; + + var App, find, visit; + var originalAdapter = _emberTestingTest.default.adapter; + + QUnit.module('ember-testing Integration', { + setup: function () { + _emberViews.jQuery('
    ').appendTo('body'); + _emberMetal.run(function () { + _emberGlimmer.setTemplate('people', _emberTemplateCompiler.compile('
    {{#each model as |person|}}
    {{person.firstName}}
    {{/each}}
    ')); + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet}}')); + + App = _emberApplication.Application.create({ + rootElement: '#ember-testing' + }); + + App.Router.map(function () { + this.route('people', { path: '/' }); + }); + + App.PeopleRoute = _emberRouting.Route.extend({ + model: function () { + return App.Person.find(); + } + }); + + App.PeopleController = _emberRuntime.Controller.extend({}); + + App.Person = _emberRuntime.Object.extend({ + firstName: '' + }); + + App.Person.reopenClass({ + find: function () { + return _emberRuntime.A(); + } + }); + + App.setupForTesting(); + }); + + _emberMetal.run(function () { + App.reset(); + }); + + App.injectTestHelpers(); + + find = window.find; + visit = window.visit; + }, + + teardown: function () { + App.removeTestHelpers(); + _emberGlimmer.setTemplates({}); + _emberViews.jQuery('#ember-testing-container, #ember-testing').remove(); + _emberMetal.run(App, App.destroy); + App = null; + _emberTestingTest.default.adapter = originalAdapter; + } + }); + + QUnit.test('template is bound to empty array of people', function () { + App.Person.find = function () { + return _emberRuntime.A(); + }; + _emberMetal.run(App, 'advanceReadiness'); + visit('/').then(function () { + var rows = find('.name').length; + equal(rows, 0, 'successfully stubbed an empty array of people'); + }); + }); + + QUnit.test('template is bound to array of 2 people', function () { + App.Person.find = function () { + var people = _emberRuntime.A(); + var first = App.Person.create({ firstName: 'x' }); + var last = App.Person.create({ firstName: 'y' }); + _emberMetal.run(people, people.pushObject, first); + _emberMetal.run(people, people.pushObject, last); + return people; + }; + _emberMetal.run(App, 'advanceReadiness'); + visit('/').then(function () { + var rows = find('.name').length; + equal(rows, 2, 'successfully stubbed a non empty array of people'); + }); + }); + + QUnit.test('template is again bound to empty array of people', function () { + App.Person.find = function () { + return _emberRuntime.A(); + }; + _emberMetal.run(App, 'advanceReadiness'); + visit('/').then(function () { + var rows = find('.name').length; + equal(rows, 0, 'successfully stubbed another empty array of people'); + }); + }); + + QUnit.test('`visit` can be called without advancedReadiness.', function () { + App.Person.find = function () { + return _emberRuntime.A(); + }; + + visit('/').then(function () { + var rows = find('.name').length; + equal(rows, 0, 'stubbed an empty array of people without calling advancedReadiness.'); + }); + }); +}); +enifed('ember-testing/tests/integration_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/tests'); + test('ember-testing/tests/integration_test.js should pass jscs', function () { + ok(true, 'ember-testing/tests/integration_test.js should pass jscs.'); + }); +}); +enifed('ember-testing/tests/integration_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/tests'); + QUnit.test('ember-testing/tests/integration_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/tests/integration_test.js should pass jshint.'); + }); +}); +enifed('ember-testing/tests/reexports_test', ['exports', 'ember', 'internal-test-helpers'], function (exports, _ember, _internalTestHelpers) { + 'use strict'; + + QUnit.module('ember-testing reexports'); + + [ + // ember-testing + ['Test', 'ember-testing'], ['Test.Adapter', 'ember-testing', 'Adapter'], ['Test.QUnitAdapter', 'ember-testing', 'QUnitAdapter'], ['setupForTesting', 'ember-testing']].forEach(function (reexport) { + var path = reexport[0]; + var moduleId = reexport[1]; + var exportName = reexport[2]; + + // default path === exportName if none present + if (!exportName) { + exportName = path; + } + + QUnit.test('Ember.' + path + ' exports correctly', function (assert) { + _internalTestHelpers.confirmExport(_ember.default, assert, path, moduleId, exportName); + }); + }); +}); +enifed('ember-testing/tests/reexports_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/tests'); + test('ember-testing/tests/reexports_test.js should pass jscs', function () { + ok(true, 'ember-testing/tests/reexports_test.js should pass jscs.'); + }); +}); +enifed('ember-testing/tests/reexports_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/tests'); + QUnit.test('ember-testing/tests/reexports_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/tests/reexports_test.js should pass jshint.'); + }); +}); +enifed('ember-testing/tests/simple_setup', ['exports', 'ember-metal', 'ember-views'], function (exports, _emberMetal, _emberViews) { + 'use strict'; + + var App; + + QUnit.module('Simple Testing Setup', { + teardown: function () { + if (App) { + App.removeTestHelpers(); + _emberViews.jQuery('#ember-testing-container, #ember-testing').remove(); + _emberMetal.run(App, 'destroy'); + App = null; + } + } + }); +}); +enifed('ember-testing/tests/simple_setup.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/tests'); + test('ember-testing/tests/simple_setup.js should pass jscs', function () { + ok(true, 'ember-testing/tests/simple_setup.js should pass jscs.'); + }); +}); +enifed('ember-testing/tests/simple_setup.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/tests'); + QUnit.test('ember-testing/tests/simple_setup.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/tests/simple_setup.js should pass jshint.'); + }); +}); +enifed('ember-testing/tests/test/waiters-test', ['exports', 'ember-metal', 'ember-testing/test/waiters'], function (exports, _emberMetal, _emberTestingTestWaiters) { + 'use strict'; + + var Waiters = (function () { + function Waiters() { + this._waiters = []; + } + + Waiters.prototype.add = function add() { + this._waiters.push([].concat(babelHelpers.slice.call(arguments))); + }; + + Waiters.prototype.register = function register() { + this.forEach(function () { + _emberTestingTestWaiters.registerWaiter.apply(undefined, arguments); + }); + }; + + Waiters.prototype.unregister = function unregister() { + this.forEach(function () { + _emberTestingTestWaiters.unregisterWaiter.apply(undefined, arguments); + }); + }; + + Waiters.prototype.forEach = function forEach(callback) { + for (var i = 0; i < this._waiters.length; i++) { + var args = this._waiters[i]; + + callback.apply(undefined, args); + } + }; + + Waiters.prototype.check = function check() { + this.register(); + var result = _emberTestingTestWaiters.checkWaiters(); + this.unregister(); + + return result; + }; + + return Waiters; + })(); + + QUnit.module('ember-testing: waiters', { + setup: function () { + this.waiters = new Waiters(); + }, + + teardown: function () { + this.waiters.unregister(); + } + }); + + QUnit.test('registering a waiter', function (assert) { + assert.expect(2); + + var obj = { foo: true }; + + this.waiters.add(obj, function () { + assert.ok(this.foo, 'has proper `this` context'); + return true; + }); + + this.waiters.add(function () { + assert.ok(true, 'is called'); + return true; + }); + + this.waiters.check(); + }); + + QUnit.test('unregistering a waiter', function (assert) { + assert.expect(2); + + var obj = { foo: true }; + + this.waiters.add(obj, function () { + assert.ok(true, 'precond - waiter with context is registered'); + return true; + }); + + this.waiters.add(function () { + assert.ok(true, 'precond - waiter without context is registered'); + return true; + }); + + this.waiters.check(); + this.waiters.unregister(); + + _emberTestingTestWaiters.checkWaiters(); + }); + + QUnit.test('checkWaiters returns false if all waiters return true', function (assert) { + assert.expect(3); + + this.waiters.add(function () { + assert.ok(true, 'precond - waiter is registered'); + + return true; + }); + + this.waiters.add(function () { + assert.ok(true, 'precond - waiter is registered'); + + return true; + }); + + assert.notOk(this.waiters.check(), 'checkWaiters returns true if all waiters return true'); + }); + + QUnit.test('checkWaiters returns true if any waiters return false', function (assert) { + assert.expect(3); + + this.waiters.add(function () { + assert.ok(true, 'precond - waiter is registered'); + + return true; + }); + + this.waiters.add(function () { + assert.ok(true, 'precond - waiter is registered'); + + return false; + }); + + assert.ok(this.waiters.check(), 'checkWaiters returns false if any waiters return false'); + }); + + QUnit.test('checkWaiters short circuits after first falsey waiter', function (assert) { + assert.expect(2); + + this.waiters.add(function () { + assert.ok(true, 'precond - waiter is registered'); + + return false; + }); + + this.waiters.add(function () { + assert.notOk(true, 'waiter should not be called'); + }); + + assert.ok(this.waiters.check(), 'checkWaiters returns false if any waiters return false'); + }); + + QUnit.test('generateDeprecatedWaitersArray provides deprecated access to waiters array', function (assert) { + var waiter1 = function () {}; + var waiter2 = function () {}; + + this.waiters.add(waiter1); + this.waiters.add(waiter2); + + this.waiters.register(); + + var waiters = undefined; + if (true) { + expectDeprecation(function () { + waiters = _emberTestingTestWaiters.generateDeprecatedWaitersArray(); + }, /Usage of `Ember.Test.waiters` is deprecated/); + } else { + waiters = _emberTestingTestWaiters.generateDeprecatedWaitersArray(); + } + + assert.deepEqual(waiters, [[null, waiter1], [null, waiter2]]); + }); +}); +enifed('ember-testing/tests/test/waiters-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-testing/tests/test'); + test('ember-testing/tests/test/waiters-test.js should pass jscs', function () { + ok(true, 'ember-testing/tests/test/waiters-test.js should pass jscs.'); + }); +}); +enifed('ember-testing/tests/test/waiters-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-testing/tests/test'); + QUnit.test('ember-testing/tests/test/waiters-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-testing/tests/test/waiters-test.js should pass jshint.'); + }); +}); +enifed('ember-utils/apply-str.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/apply-str.js should pass jscs', function () { + ok(true, 'ember-utils/apply-str.js should pass jscs.'); + }); +}); +enifed('ember-utils/apply-str.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/apply-str.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/apply-str.js should pass jshint.'); + }); +}); +enifed('ember-utils/assign.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/assign.js should pass jscs', function () { + ok(true, 'ember-utils/assign.js should pass jscs.'); + }); +}); +enifed('ember-utils/assign.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/assign.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/assign.js should pass jshint.'); + }); +}); +enifed('ember-utils/dictionary.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/dictionary.js should pass jscs', function () { + ok(true, 'ember-utils/dictionary.js should pass jscs.'); + }); +}); +enifed('ember-utils/dictionary.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/dictionary.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/dictionary.js should pass jshint.'); + }); +}); +enifed('ember-utils/empty-object.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/empty-object.js should pass jscs', function () { + ok(true, 'ember-utils/empty-object.js should pass jscs.'); + }); +}); +enifed('ember-utils/empty-object.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/empty-object.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/empty-object.js should pass jshint.'); + }); +}); +enifed('ember-utils/guid.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/guid.js should pass jscs', function () { + ok(true, 'ember-utils/guid.js should pass jscs.'); + }); +}); +enifed('ember-utils/guid.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/guid.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/guid.js should pass jshint.'); + }); +}); +enifed('ember-utils/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/index.js should pass jscs', function () { + ok(true, 'ember-utils/index.js should pass jscs.'); + }); +}); +enifed('ember-utils/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/index.js should pass jshint.'); + }); +}); +enifed('ember-utils/inspect.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/inspect.js should pass jscs', function () { + ok(true, 'ember-utils/inspect.js should pass jscs.'); + }); +}); +enifed('ember-utils/inspect.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/inspect.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/inspect.js should pass jshint.'); + }); +}); +enifed('ember-utils/intern.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/intern.js should pass jscs', function () { + ok(true, 'ember-utils/intern.js should pass jscs.'); + }); +}); +enifed('ember-utils/intern.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/intern.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/intern.js should pass jshint.'); + }); +}); +enifed('ember-utils/invoke.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/invoke.js should pass jscs', function () { + ok(true, 'ember-utils/invoke.js should pass jscs.'); + }); +}); +enifed('ember-utils/invoke.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/invoke.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/invoke.js should pass jshint.'); + }); +}); +enifed('ember-utils/lookup-descriptor.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/lookup-descriptor.js should pass jscs', function () { + ok(true, 'ember-utils/lookup-descriptor.js should pass jscs.'); + }); +}); +enifed('ember-utils/lookup-descriptor.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/lookup-descriptor.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/lookup-descriptor.js should pass jshint.'); + }); +}); +enifed('ember-utils/make-array.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/make-array.js should pass jscs', function () { + ok(true, 'ember-utils/make-array.js should pass jscs.'); + }); +}); +enifed('ember-utils/make-array.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/make-array.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/make-array.js should pass jshint.'); + }); +}); +enifed('ember-utils/owner.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/owner.js should pass jscs', function () { + ok(true, 'ember-utils/owner.js should pass jscs.'); + }); +}); +enifed('ember-utils/owner.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/owner.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/owner.js should pass jshint.'); + }); +}); +enifed('ember-utils/super.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/super.js should pass jscs', function () { + ok(true, 'ember-utils/super.js should pass jscs.'); + }); +}); +enifed('ember-utils/super.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/super.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/super.js should pass jshint.'); + }); +}); +enifed('ember-utils/symbol.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/symbol.js should pass jscs', function () { + ok(true, 'ember-utils/symbol.js should pass jscs.'); + }); +}); +enifed('ember-utils/symbol.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/symbol.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/symbol.js should pass jshint.'); + }); +}); +enifed('ember-utils/tests/assign_test', ['exports', 'ember-utils/assign'], function (exports, _emberUtilsAssign) { + 'use strict'; + + QUnit.module('Ember.assign'); + + QUnit.test('Ember.assign', function () { + var a = { a: 1 }; + var b = { b: 2 }; + var c = { c: 3 }; + var a2 = { a: 4 }; + + _emberUtilsAssign.default(a, b, c, a2); + + deepEqual(a, { a: 4, b: 2, c: 3 }); + deepEqual(b, { b: 2 }); + deepEqual(c, { c: 3 }); + deepEqual(a2, { a: 4 }); + }); +}); +enifed('ember-utils/tests/assign_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils/tests'); + test('ember-utils/tests/assign_test.js should pass jscs', function () { + ok(true, 'ember-utils/tests/assign_test.js should pass jscs.'); + }); +}); +enifed('ember-utils/tests/assign_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils/tests'); + QUnit.test('ember-utils/tests/assign_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/tests/assign_test.js should pass jshint.'); + }); +}); +enifed('ember-utils/tests/can_invoke_test', ['exports', 'ember-utils/index'], function (exports, _emberUtilsIndex) { + 'use strict'; + + var obj = undefined; + + QUnit.module('Ember.canInvoke', { + setup: function () { + obj = { + foobar: 'foobar', + aMethodThatExists: function () {} + }; + }, + + teardown: function () { + obj = undefined; + } + }); + + QUnit.test('should return false if the object doesn\'t exist', function () { + equal(_emberUtilsIndex.canInvoke(undefined, 'aMethodThatDoesNotExist'), false); + }); + + QUnit.test('should return true if the method exists on the object', function () { + equal(_emberUtilsIndex.canInvoke(obj, 'aMethodThatExists'), true); + }); + + QUnit.test('should return false if the method doesn\'t exist on the object', function () { + equal(_emberUtilsIndex.canInvoke(obj, 'aMethodThatDoesNotExist'), false); + }); + + QUnit.test('should return false if the property exists on the object but is a non-function', function () { + equal(_emberUtilsIndex.canInvoke(obj, 'foobar'), false); + }); +}); +enifed('ember-utils/tests/can_invoke_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils/tests'); + test('ember-utils/tests/can_invoke_test.js should pass jscs', function () { + ok(true, 'ember-utils/tests/can_invoke_test.js should pass jscs.'); + }); +}); +enifed('ember-utils/tests/can_invoke_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils/tests'); + QUnit.test('ember-utils/tests/can_invoke_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/tests/can_invoke_test.js should pass jshint.'); + }); +}); +enifed('ember-utils/tests/checkHasSuper_test', ['exports', 'ember-environment', 'ember-utils/index'], function (exports, _emberEnvironment, _emberUtilsIndex) { + 'use strict'; + + QUnit.module('checkHasSuper'); + + // Only run this test on browsers that we are certain should have function + // source available. This allows the test suite to continue to pass on other + // platforms that correctly (for them) fall back to the "always wrap" code. + if (_emberEnvironment.environment.isPhantom || _emberEnvironment.environment.isChrome || _emberEnvironment.environment.isFirefox) { + QUnit.test('does not super wrap needlessly [GH #12462]', function (assert) { + assert.notOk(_emberUtilsIndex.checkHasSuper(function () {}), 'empty function does not have super'); + }); + } +}); +enifed('ember-utils/tests/checkHasSuper_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils/tests'); + test('ember-utils/tests/checkHasSuper_test.js should pass jscs', function () { + ok(true, 'ember-utils/tests/checkHasSuper_test.js should pass jscs.'); + }); +}); +enifed('ember-utils/tests/checkHasSuper_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils/tests'); + QUnit.test('ember-utils/tests/checkHasSuper_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/tests/checkHasSuper_test.js should pass jshint.'); + }); +}); +enifed('ember-utils/tests/generate_guid_test', ['exports', 'ember-utils/index'], function (exports, _emberUtilsIndex) { + 'use strict'; + + QUnit.module('Ember.generateGuid'); + + QUnit.test('Prefix', function () { + var a = {}; + + ok(_emberUtilsIndex.generateGuid(a, 'tyrell').indexOf('tyrell') > -1, 'guid can be prefixed'); + }); +}); +enifed('ember-utils/tests/generate_guid_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils/tests'); + test('ember-utils/tests/generate_guid_test.js should pass jscs', function () { + ok(true, 'ember-utils/tests/generate_guid_test.js should pass jscs.'); + }); +}); +enifed('ember-utils/tests/generate_guid_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils/tests'); + QUnit.test('ember-utils/tests/generate_guid_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/tests/generate_guid_test.js should pass jshint.'); + }); +}); +enifed('ember-utils/tests/guid_for_test', ['exports', 'ember-utils/index'], function (exports, _emberUtilsIndex) { + 'use strict'; + + QUnit.module('guidFor'); + + function sameGuid(a, b, message) { + equal(_emberUtilsIndex.guidFor(a), _emberUtilsIndex.guidFor(b), message); + } + + function diffGuid(a, b, message) { + ok(_emberUtilsIndex.guidFor(a) !== _emberUtilsIndex.guidFor(b), message); + } + + function nanGuid(obj) { + var type = typeof obj; + ok(isNaN(parseInt(_emberUtilsIndex.guidFor(obj), 0)), 'guids for ' + type + 'don\'t parse to numbers'); + } + + QUnit.test('Object', function () { + var a = {}; + var b = {}; + + sameGuid(a, a, 'same object always yields same guid'); + diffGuid(a, b, 'different objects yield different guids'); + nanGuid(a); + }); + + QUnit.test('strings', function () { + var a = 'string A'; + var aprime = 'string A'; + var b = 'String B'; + + sameGuid(a, a, 'same string always yields same guid'); + sameGuid(a, aprime, 'identical strings always yield the same guid'); + diffGuid(a, b, 'different strings yield different guids'); + nanGuid(a); + }); + + QUnit.test('numbers', function () { + var a = 23; + var aprime = 23; + var b = 34; + + sameGuid(a, a, 'same numbers always yields same guid'); + sameGuid(a, aprime, 'identical numbers always yield the same guid'); + diffGuid(a, b, 'different numbers yield different guids'); + nanGuid(a); + }); + + QUnit.test('numbers', function () { + var a = true; + var aprime = true; + var b = false; + + sameGuid(a, a, 'same booleans always yields same guid'); + sameGuid(a, aprime, 'identical booleans always yield the same guid'); + diffGuid(a, b, 'different boolean yield different guids'); + nanGuid(a); + nanGuid(b); + }); + + QUnit.test('null and undefined', function () { + var a = null; + var aprime = null; + var b = undefined; + + sameGuid(a, a, 'null always returns the same guid'); + sameGuid(b, b, 'undefined always returns the same guid'); + sameGuid(a, aprime, 'different nulls return the same guid'); + diffGuid(a, b, 'null and undefined return different guids'); + nanGuid(a); + nanGuid(b); + }); + + QUnit.test('arrays', function () { + var a = ['a', 'b', 'c']; + var aprime = ['a', 'b', 'c']; + var b = ['1', '2', '3']; + + sameGuid(a, a, 'same instance always yields same guid'); + diffGuid(a, aprime, 'identical arrays always yield the same guid'); + diffGuid(a, b, 'different arrays yield different guids'); + nanGuid(a); + }); +}); +enifed('ember-utils/tests/guid_for_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils/tests'); + test('ember-utils/tests/guid_for_test.js should pass jscs', function () { + ok(true, 'ember-utils/tests/guid_for_test.js should pass jscs.'); + }); +}); +enifed('ember-utils/tests/guid_for_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils/tests'); + QUnit.test('ember-utils/tests/guid_for_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/tests/guid_for_test.js should pass jshint.'); + }); +}); +enifed('ember-utils/tests/inspect_test', ['exports', 'ember-utils/index'], function (exports, _emberUtilsIndex) { + 'use strict'; + + // Symbol is not defined on pre-ES2015 runtimes, so this let's us safely test + // for it's existence (where a simple `if (Symbol)` would ReferenceError) + var HAS_NATIVE_SYMBOL = typeof Symbol === 'function'; + + QUnit.module('Ember.inspect'); + + QUnit.test('strings', function () { + equal(_emberUtilsIndex.inspect('foo'), 'foo'); + }); + + QUnit.test('numbers', function () { + equal(_emberUtilsIndex.inspect(2.6), '2.6'); + }); + + QUnit.test('null', function () { + equal(_emberUtilsIndex.inspect(null), 'null'); + }); + + QUnit.test('undefined', function () { + equal(_emberUtilsIndex.inspect(undefined), 'undefined'); + }); + + QUnit.test('true', function () { + equal(_emberUtilsIndex.inspect(true), 'true'); + }); + + QUnit.test('false', function () { + equal(_emberUtilsIndex.inspect(false), 'false'); + }); + + QUnit.test('object', function () { + equal(_emberUtilsIndex.inspect({}), '{}'); + equal(_emberUtilsIndex.inspect({ foo: 'bar' }), '{foo: bar}'); + equal(_emberUtilsIndex.inspect({ foo: function () { + return this; + } }), '{foo: function() { ... }}'); + }); + + QUnit.test('objects without a prototype', function () { + var prototypelessObj = Object.create(null); + equal(_emberUtilsIndex.inspect({ foo: prototypelessObj }), '{foo: [object Object]}'); + }); + + QUnit.test('array', function () { + equal(_emberUtilsIndex.inspect([1, 2, 3]), '[1,2,3]'); + }); + + QUnit.test('regexp', function () { + equal(_emberUtilsIndex.inspect(/regexp/), '/regexp/'); + }); + + QUnit.test('date', function () { + var inspected = _emberUtilsIndex.inspect(new Date('Sat Apr 30 2011 13:24:11')); + ok(inspected.match(/Sat Apr 30/), 'The inspected date has its date'); + ok(inspected.match(/2011/), 'The inspected date has its year'); + ok(inspected.match(/13:24:11/), 'The inspected date has its time'); + }); + + QUnit.test('inspect outputs the toString() representation of Symbols', function () { + if (HAS_NATIVE_SYMBOL) { + var symbol = Symbol('test'); + equal(_emberUtilsIndex.inspect(symbol), 'Symbol(test)'); + } else { + expect(0); + } + }); +}); +enifed('ember-utils/tests/inspect_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils/tests'); + test('ember-utils/tests/inspect_test.js should pass jscs', function () { + ok(true, 'ember-utils/tests/inspect_test.js should pass jscs.'); + }); +}); +enifed('ember-utils/tests/inspect_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils/tests'); + QUnit.test('ember-utils/tests/inspect_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/tests/inspect_test.js should pass jshint.'); + }); +}); +enifed('ember-utils/tests/to-string-test', ['exports', 'ember-utils/index'], function (exports, _emberUtilsIndex) { + 'use strict'; + + QUnit.module('ember-utils toString'); + + QUnit.test('toString uses an object\'s toString method when available', function () { + var obj = { + toString: function () { + return 'bob'; + } + }; + + strictEqual(_emberUtilsIndex.toString(obj), 'bob'); + }); + + QUnit.test('toString falls back to Object.prototype.toString', function () { + var obj = Object.create(null); + + strictEqual(_emberUtilsIndex.toString(obj), ({}).toString()); + }); +}); +enifed('ember-utils/tests/to-string-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils/tests'); + test('ember-utils/tests/to-string-test.js should pass jscs', function () { + ok(true, 'ember-utils/tests/to-string-test.js should pass jscs.'); + }); +}); +enifed('ember-utils/tests/to-string-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils/tests'); + QUnit.test('ember-utils/tests/to-string-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/tests/to-string-test.js should pass jshint.'); + }); +}); +enifed('ember-utils/tests/try_invoke_test', ['exports', 'ember-utils/index'], function (exports, _emberUtilsIndex) { + 'use strict'; + + var obj = undefined; + + QUnit.module('Ember.tryInvoke', { + setup: function () { + obj = { + aMethodThatExists: function () { + return true; + }, + aMethodThatTakesArguments: function (arg1, arg2) { + return arg1 === arg2; + } + }; + }, + + teardown: function () { + obj = undefined; + } + }); + + QUnit.test('should return undefined when the object doesn\'t exist', function () { + equal(_emberUtilsIndex.tryInvoke(undefined, 'aMethodThatDoesNotExist'), undefined); + }); + + QUnit.test('should return undefined when asked to perform a method that doesn\'t exist on the object', function () { + equal(_emberUtilsIndex.tryInvoke(obj, 'aMethodThatDoesNotExist'), undefined); + }); + + QUnit.test('should return what the method returns when asked to perform a method that exists on the object', function () { + equal(_emberUtilsIndex.tryInvoke(obj, 'aMethodThatExists'), true); + }); + + QUnit.test('should return what the method returns when asked to perform a method that takes arguments and exists on the object', function () { + equal(_emberUtilsIndex.tryInvoke(obj, 'aMethodThatTakesArguments', [true, true]), true); + }); +}); +enifed('ember-utils/tests/try_invoke_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils/tests'); + test('ember-utils/tests/try_invoke_test.js should pass jscs', function () { + ok(true, 'ember-utils/tests/try_invoke_test.js should pass jscs.'); + }); +}); +enifed('ember-utils/tests/try_invoke_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils/tests'); + QUnit.test('ember-utils/tests/try_invoke_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/tests/try_invoke_test.js should pass jshint.'); + }); +}); +enifed('ember-utils/to-string.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-utils'); + test('ember-utils/to-string.js should pass jscs', function () { + ok(true, 'ember-utils/to-string.js should pass jscs.'); + }); +}); +enifed('ember-utils/to-string.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-utils'); + QUnit.test('ember-utils/to-string.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/to-string.js should pass jshint.'); + }); +}); +enifed('ember-views/compat/attrs.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/compat'); + test('ember-views/compat/attrs.js should pass jscs', function () { + ok(true, 'ember-views/compat/attrs.js should pass jscs.'); + }); +}); +enifed('ember-views/compat/attrs.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/compat'); + QUnit.test('ember-views/compat/attrs.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/compat/attrs.js should pass jshint.'); + }); +}); +enifed('ember-views/compat/fallback-view-registry.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/compat'); + test('ember-views/compat/fallback-view-registry.js should pass jscs', function () { + ok(true, 'ember-views/compat/fallback-view-registry.js should pass jscs.'); + }); +}); +enifed('ember-views/compat/fallback-view-registry.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/compat'); + QUnit.test('ember-views/compat/fallback-view-registry.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/compat/fallback-view-registry.js should pass jshint.'); + }); +}); +enifed('ember-views/component_lookup.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views'); + test('ember-views/component_lookup.js should pass jscs', function () { + ok(true, 'ember-views/component_lookup.js should pass jscs.'); + }); +}); +enifed('ember-views/component_lookup.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views'); + QUnit.test('ember-views/component_lookup.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/component_lookup.js should pass jshint.'); + }); +}); +enifed('ember-views/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views'); + test('ember-views/index.js should pass jscs', function () { + ok(true, 'ember-views/index.js should pass jscs.'); + }); +}); +enifed('ember-views/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views'); + QUnit.test('ember-views/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/index.js should pass jshint.'); + }); +}); +enifed('ember-views/mixins/action_support.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/mixins'); + test('ember-views/mixins/action_support.js should pass jscs', function () { + ok(true, 'ember-views/mixins/action_support.js should pass jscs.'); + }); +}); +enifed('ember-views/mixins/action_support.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/mixins'); + QUnit.test('ember-views/mixins/action_support.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/mixins/action_support.js should pass jshint.'); + }); +}); +enifed('ember-views/mixins/child_views_support.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/mixins'); + test('ember-views/mixins/child_views_support.js should pass jscs', function () { + ok(true, 'ember-views/mixins/child_views_support.js should pass jscs.'); + }); +}); +enifed('ember-views/mixins/child_views_support.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/mixins'); + QUnit.test('ember-views/mixins/child_views_support.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/mixins/child_views_support.js should pass jshint.'); + }); +}); +enifed('ember-views/mixins/class_names_support.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/mixins'); + test('ember-views/mixins/class_names_support.js should pass jscs', function () { + ok(true, 'ember-views/mixins/class_names_support.js should pass jscs.'); + }); +}); +enifed('ember-views/mixins/class_names_support.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/mixins'); + QUnit.test('ember-views/mixins/class_names_support.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/mixins/class_names_support.js should pass jshint.'); + }); +}); +enifed('ember-views/mixins/text_support.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/mixins'); + test('ember-views/mixins/text_support.js should pass jscs', function () { + ok(true, 'ember-views/mixins/text_support.js should pass jscs.'); + }); +}); +enifed('ember-views/mixins/text_support.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/mixins'); + QUnit.test('ember-views/mixins/text_support.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/mixins/text_support.js should pass jshint.'); + }); +}); +enifed('ember-views/mixins/view_state_support.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/mixins'); + test('ember-views/mixins/view_state_support.js should pass jscs', function () { + ok(true, 'ember-views/mixins/view_state_support.js should pass jscs.'); + }); +}); +enifed('ember-views/mixins/view_state_support.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/mixins'); + QUnit.test('ember-views/mixins/view_state_support.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/mixins/view_state_support.js should pass jshint.'); + }); +}); +enifed('ember-views/mixins/view_support.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/mixins'); + test('ember-views/mixins/view_support.js should pass jscs', function () { + ok(true, 'ember-views/mixins/view_support.js should pass jscs.'); + }); +}); +enifed('ember-views/mixins/view_support.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/mixins'); + QUnit.test('ember-views/mixins/view_support.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/mixins/view_support.js should pass jshint.'); + }); +}); +enifed('ember-views/system/action_manager.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/system'); + test('ember-views/system/action_manager.js should pass jscs', function () { + ok(true, 'ember-views/system/action_manager.js should pass jscs.'); + }); +}); +enifed('ember-views/system/action_manager.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/system'); + QUnit.test('ember-views/system/action_manager.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/system/action_manager.js should pass jshint.'); + }); +}); +enifed('ember-views/system/event_dispatcher.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/system'); + test('ember-views/system/event_dispatcher.js should pass jscs', function () { + ok(true, 'ember-views/system/event_dispatcher.js should pass jscs.'); + }); +}); +enifed('ember-views/system/event_dispatcher.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/system'); + QUnit.test('ember-views/system/event_dispatcher.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/system/event_dispatcher.js should pass jshint.'); + }); +}); +enifed('ember-views/system/ext.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/system'); + test('ember-views/system/ext.js should pass jscs', function () { + ok(true, 'ember-views/system/ext.js should pass jscs.'); + }); +}); +enifed('ember-views/system/ext.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/system'); + QUnit.test('ember-views/system/ext.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/system/ext.js should pass jshint.'); + }); +}); +enifed('ember-views/system/jquery.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/system'); + test('ember-views/system/jquery.js should pass jscs', function () { + ok(true, 'ember-views/system/jquery.js should pass jscs.'); + }); +}); +enifed('ember-views/system/jquery.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/system'); + QUnit.test('ember-views/system/jquery.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/system/jquery.js should pass jshint.'); + }); +}); +enifed('ember-views/system/lookup_partial.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/system'); + test('ember-views/system/lookup_partial.js should pass jscs', function () { + ok(true, 'ember-views/system/lookup_partial.js should pass jscs.'); + }); +}); +enifed('ember-views/system/lookup_partial.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/system'); + QUnit.test('ember-views/system/lookup_partial.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/system/lookup_partial.js should pass jshint.'); + }); +}); +enifed('ember-views/system/utils.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/system'); + test('ember-views/system/utils.js should pass jscs', function () { + ok(true, 'ember-views/system/utils.js should pass jscs.'); + }); +}); +enifed('ember-views/system/utils.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/system'); + QUnit.test('ember-views/system/utils.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/system/utils.js should pass jshint.'); + }); +}); +enifed('ember-views/utils/lookup-component.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/utils'); + test('ember-views/utils/lookup-component.js should pass jscs', function () { + ok(true, 'ember-views/utils/lookup-component.js should pass jscs.'); + }); +}); +enifed('ember-views/utils/lookup-component.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/utils'); + QUnit.test('ember-views/utils/lookup-component.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/utils/lookup-component.js should pass jshint.'); + }); +}); +enifed('ember-views/views/core_view.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/views'); + test('ember-views/views/core_view.js should pass jscs', function () { + ok(true, 'ember-views/views/core_view.js should pass jscs.'); + }); +}); +enifed('ember-views/views/core_view.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/views'); + QUnit.test('ember-views/views/core_view.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/views/core_view.js should pass jshint.'); + }); +}); +enifed('ember-views/views/states.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/views'); + test('ember-views/views/states.js should pass jscs', function () { + ok(true, 'ember-views/views/states.js should pass jscs.'); + }); +}); +enifed('ember-views/views/states.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/views'); + QUnit.test('ember-views/views/states.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/views/states.js should pass jshint.'); + }); +}); +enifed('ember-views/views/states/default.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/views/states'); + test('ember-views/views/states/default.js should pass jscs', function () { + ok(true, 'ember-views/views/states/default.js should pass jscs.'); + }); +}); +enifed('ember-views/views/states/default.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/views/states'); + QUnit.test('ember-views/views/states/default.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/views/states/default.js should pass jshint.'); + }); +}); +enifed('ember-views/views/states/destroying.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/views/states'); + test('ember-views/views/states/destroying.js should pass jscs', function () { + ok(true, 'ember-views/views/states/destroying.js should pass jscs.'); + }); +}); +enifed('ember-views/views/states/destroying.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/views/states'); + QUnit.test('ember-views/views/states/destroying.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/views/states/destroying.js should pass jshint.'); + }); +}); +enifed('ember-views/views/states/has_element.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/views/states'); + test('ember-views/views/states/has_element.js should pass jscs', function () { + ok(true, 'ember-views/views/states/has_element.js should pass jscs.'); + }); +}); +enifed('ember-views/views/states/has_element.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/views/states'); + QUnit.test('ember-views/views/states/has_element.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/views/states/has_element.js should pass jshint.'); + }); +}); +enifed('ember-views/views/states/in_dom.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/views/states'); + test('ember-views/views/states/in_dom.js should pass jscs', function () { + ok(true, 'ember-views/views/states/in_dom.js should pass jscs.'); + }); +}); +enifed('ember-views/views/states/in_dom.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/views/states'); + QUnit.test('ember-views/views/states/in_dom.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/views/states/in_dom.js should pass jshint.'); + }); +}); +enifed('ember-views/views/states/pre_render.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/views/states'); + test('ember-views/views/states/pre_render.js should pass jscs', function () { + ok(true, 'ember-views/views/states/pre_render.js should pass jscs.'); + }); +}); +enifed('ember-views/views/states/pre_render.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/views/states'); + QUnit.test('ember-views/views/states/pre_render.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/views/states/pre_render.js should pass jshint.'); + }); +}); +enifed('ember-views/views/view.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember-views/views'); + test('ember-views/views/view.js should pass jscs', function () { + ok(true, 'ember-views/views/view.js should pass jscs.'); + }); +}); +enifed('ember-views/views/view.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember-views/views'); + QUnit.test('ember-views/views/view.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/views/view.js should pass jshint.'); + }); +}); +enifed('ember/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember'); + test('ember/index.js should pass jscs', function () { + ok(true, 'ember/index.js should pass jscs.'); + }); +}); +enifed('ember/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember'); + QUnit.test('ember/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/index.js should pass jshint.'); + }); +}); +enifed('ember/tests/application_lifecycle_test', ['exports', 'ember-application', 'ember-routing', 'ember-metal', 'ember-glimmer', 'ember-views', 'ember-template-compiler'], function (exports, _emberApplication, _emberRouting, _emberMetal, _emberGlimmer, _emberViews, _emberTemplateCompiler) { + 'use strict'; + + var App = undefined, + TEMPLATES = undefined, + appInstance = undefined, + router = undefined; + + function setupApp(klass) { + _emberMetal.run(function () { + App = klass.create({ + rootElement: '#qunit-fixture' + }); + + App.Router = App.Router.extend({ + location: 'none' + }); + + App.deferReadiness(); + + appInstance = App.__deprecatedInstance__; + }); + } + + QUnit.module('Application Lifecycle', { + setup: function () { + TEMPLATES = _emberGlimmer.getTemplates(); + setupApp(_emberApplication.Application.extend()); + }, + + teardown: function () { + router = null; + _emberMetal.run(App, 'destroy'); + _emberGlimmer.setTemplates({}); + } + }); + + function handleURL(path) { + router = appInstance.lookup('router:main'); + return _emberMetal.run(function () { + return router.handleURL(path).then(function (value) { + ok(true, 'url: `' + path + '` was handled'); + return value; + }, function (reason) { + ok(false, reason); + throw reason; + }); + }); + } + + QUnit.test('Resetting the application allows controller properties to be set when a route deactivates', function () { + App.Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + setupController: function () { + this.controllerFor('home').set('selectedMenuItem', 'home'); + }, + deactivate: function () { + this.controllerFor('home').set('selectedMenuItem', null); + } + }); + App.ApplicationRoute = _emberRouting.Route.extend({ + setupController: function () { + this.controllerFor('application').set('selectedMenuItem', 'home'); + }, + deactivate: function () { + this.controllerFor('application').set('selectedMenuItem', null); + } + }); + + appInstance.lookup('router:main'); + + _emberMetal.run(App, 'advanceReadiness'); + + handleURL('/'); + + equal(_emberRouting.controllerFor(appInstance, 'home').get('selectedMenuItem'), 'home'); + equal(_emberRouting.controllerFor(appInstance, 'application').get('selectedMenuItem'), 'home'); + + App.reset(); + + equal(_emberRouting.controllerFor(appInstance, 'home').get('selectedMenuItem'), null); + equal(_emberRouting.controllerFor(appInstance, 'application').get('selectedMenuItem'), null); + }); + + QUnit.test('Destroying the application resets the router before the appInstance is destroyed', function () { + App.Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + setupController: function () { + this.controllerFor('home').set('selectedMenuItem', 'home'); + }, + deactivate: function () { + this.controllerFor('home').set('selectedMenuItem', null); + } + }); + App.ApplicationRoute = _emberRouting.Route.extend({ + setupController: function () { + this.controllerFor('application').set('selectedMenuItem', 'home'); + }, + deactivate: function () { + this.controllerFor('application').set('selectedMenuItem', null); + } + }); + + appInstance.lookup('router:main'); + + _emberMetal.run(App, 'advanceReadiness'); + + handleURL('/'); + + equal(_emberRouting.controllerFor(appInstance, 'home').get('selectedMenuItem'), 'home'); + equal(_emberRouting.controllerFor(appInstance, 'application').get('selectedMenuItem'), 'home'); + + _emberMetal.run(App, 'destroy'); + + equal(_emberRouting.controllerFor(appInstance, 'home').get('selectedMenuItem'), null); + equal(_emberRouting.controllerFor(appInstance, 'application').get('selectedMenuItem'), null); + }); + + QUnit.test('Destroying a route after the router does create an undestroyed `toplevelView`', function () { + App.Router.map(function () { + this.route('home', { path: '/' }); + }); + + _emberGlimmer.setTemplates({ + index: _emberTemplateCompiler.compile('Index!'), + application: _emberTemplateCompiler.compile('Application! {{outlet}}') + }); + + App.IndexRoute = _emberRouting.Route.extend(); + _emberMetal.run(App, 'advanceReadiness'); + + handleURL('/'); + + var router = appInstance.lookup('router:main'); + var route = appInstance.lookup('route:index'); + + _emberMetal.run(router, 'destroy'); + equal(router._toplevelView, null, 'the toplevelView was cleared'); + + _emberMetal.run(route, 'destroy'); + equal(router._toplevelView, null, 'the toplevelView was not reinitialized'); + + _emberMetal.run(App, 'destroy'); + equal(router._toplevelView, null, 'the toplevelView was not reinitialized'); + }); + + QUnit.test('initializers can augment an applications customEvents hash', function (assert) { + assert.expect(1); + + _emberMetal.run(App, 'destroy'); + + var ApplicationSubclass = _emberApplication.Application.extend(); + + ApplicationSubclass.initializer({ + name: 'customize-things', + initialize: function (application) { + application.customEvents = { + wowza: 'wowza' + }; + } + }); + + setupApp(ApplicationSubclass); + + App.FooBarComponent = _emberGlimmer.Component.extend({ + wowza: function () { + assert.ok(true, 'fired the event!'); + } + }); + + TEMPLATES['application'] = _emberTemplateCompiler.compile('{{foo-bar}}'); + TEMPLATES['components/foo-bar'] = _emberTemplateCompiler.compile('
    '); + + _emberMetal.run(App, 'advanceReadiness'); + + _emberMetal.run(function () { + return _emberViews.jQuery('#wowza-thingy').trigger('wowza'); + }); + }); + + QUnit.test('instanceInitializers can augment an the customEvents hash', function (assert) { + assert.expect(1); + + _emberMetal.run(App, 'destroy'); + + var ApplicationSubclass = _emberApplication.Application.extend(); + + ApplicationSubclass.instanceInitializer({ + name: 'customize-things', + initialize: function (application) { + application.customEvents = { + herky: 'jerky' + }; + } + }); + + setupApp(ApplicationSubclass); + + App.FooBarComponent = _emberGlimmer.Component.extend({ + jerky: function () { + assert.ok(true, 'fired the event!'); + } + }); + + TEMPLATES['application'] = _emberTemplateCompiler.compile('{{foo-bar}}'); + TEMPLATES['components/foo-bar'] = _emberTemplateCompiler.compile('
    '); + + _emberMetal.run(App, 'advanceReadiness'); + + _emberMetal.run(function () { + return _emberViews.jQuery('#herky-thingy').trigger('herky'); + }); + }); +}); +enifed('ember/tests/application_lifecycle_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests'); + test('ember/tests/application_lifecycle_test.js should pass jscs', function () { + ok(true, 'ember/tests/application_lifecycle_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/application_lifecycle_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests'); + QUnit.test('ember/tests/application_lifecycle_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/application_lifecycle_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/component_registration_test', ['exports', 'ember-runtime', 'ember-metal', 'ember-application', 'ember-routing', 'ember-template-compiler', 'ember-glimmer', 'ember-views'], function (exports, _emberRuntime, _emberMetal, _emberApplication, _emberRouting, _emberTemplateCompiler, _emberGlimmer, _emberViews) { + 'use strict'; + + var App = undefined, + appInstance = undefined; + + function prepare() { + _emberGlimmer.setTemplate('components/expand-it', _emberTemplateCompiler.compile('

    hello {{yield}}

    ')); + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('Hello world {{#expand-it}}world{{/expand-it}}')); + } + + function cleanup() { + _emberMetal.run(function () { + try { + if (App) { + App.destroy(); + } + App = appInstance = null; + } finally { + _emberGlimmer.setTemplates({}); + } + }); + } + + QUnit.module('Application Lifecycle - Component Registration', { + setup: prepare, + teardown: cleanup + }); + + function boot(callback) { + var startURL = arguments.length <= 1 || arguments[1] === undefined ? '/' : arguments[1]; + + _emberMetal.run(function () { + App = _emberApplication.Application.create({ + name: 'App', + rootElement: '#qunit-fixture' + }); + + App.deferReadiness(); + + App.Router = _emberRouting.Router.extend({ + location: 'none' + }); + + appInstance = App.__deprecatedInstance__; + + if (callback) { + callback(); + } + }); + + var router = appInstance.lookup('router:main'); + + _emberMetal.run(App, 'advanceReadiness'); + _emberMetal.run(function () { + return router.handleURL(startURL); + }); + } + + QUnit.test('The helper becomes the body of the component', function () { + boot(); + equal(_emberViews.jQuery('div.ember-view > div.ember-view', '#qunit-fixture').text(), 'hello world', 'The component is composed correctly'); + }); + + QUnit.test('If a component is registered, it is used', function () { + boot(function () { + appInstance.register('component:expand-it', _emberGlimmer.Component.extend({ + classNames: 'testing123' + })); + }); + + equal(_emberViews.jQuery('div.testing123', '#qunit-fixture').text(), 'hello world', 'The component is composed correctly'); + }); + + QUnit.test('Late-registered components can be rendered with custom `layout` property', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    there goes {{my-hero}}
    ')); + + boot(function () { + appInstance.register('component:my-hero', _emberGlimmer.Component.extend({ + classNames: 'testing123', + layout: _emberTemplateCompiler.compile('watch him as he GOES') + })); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'there goes watch him as he GOES', 'The component is composed correctly'); + }); + + QUnit.test('Late-registered components can be rendered with template registered on the container', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    hello world {{sally-rutherford}}-{{#sally-rutherford}}!!!{{/sally-rutherford}}
    ')); + + boot(function () { + appInstance.register('template:components/sally-rutherford', _emberTemplateCompiler.compile('funkytowny{{yield}}')); + appInstance.register('component:sally-rutherford', _emberGlimmer.Component); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'hello world funkytowny-funkytowny!!!', 'The component is composed correctly'); + }); + + QUnit.test('Late-registered components can be rendered with ONLY the template registered on the container', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    hello world {{borf-snorlax}}-{{#borf-snorlax}}!!!{{/borf-snorlax}}
    ')); + + boot(function () { + appInstance.register('template:components/borf-snorlax', _emberTemplateCompiler.compile('goodfreakingTIMES{{yield}}')); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'hello world goodfreakingTIMES-goodfreakingTIMES!!!', 'The component is composed correctly'); + }); + + QUnit.test('Assigning layoutName to a component should setup the template as a layout', function () { + expect(1); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{#my-component}}{{text}}{{/my-component}}
    ')); + _emberGlimmer.setTemplate('foo-bar-baz', _emberTemplateCompiler.compile('{{text}}-{{yield}}')); + + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + 'text': 'outer' + })); + + appInstance.register('component:my-component', _emberGlimmer.Component.extend({ + text: 'inner', + layoutName: 'foo-bar-baz' + })); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'inner-outer', 'The component is composed correctly'); + }); + + QUnit.test('Assigning layoutName and layout to a component should use the `layout` value', function () { + expect(1); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{#my-component}}{{text}}{{/my-component}}
    ')); + _emberGlimmer.setTemplate('foo-bar-baz', _emberTemplateCompiler.compile('No way!')); + + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + 'text': 'outer' + })); + + appInstance.register('component:my-component', _emberGlimmer.Component.extend({ + text: 'inner', + layoutName: 'foo-bar-baz', + layout: _emberTemplateCompiler.compile('{{text}}-{{yield}}') + })); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'inner-outer', 'The component is composed correctly'); + }); + + QUnit.test('Assigning defaultLayout to a component should set it up as a layout if no layout was found [DEPRECATED]', function () { + expect(2); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{#my-component}}{{text}}{{/my-component}}
    ')); + + expectDeprecation(function () { + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + 'text': 'outer' + })); + + appInstance.register('component:my-component', _emberGlimmer.Component.extend({ + text: 'inner', + defaultLayout: _emberTemplateCompiler.compile('{{text}}-{{yield}}') + })); + }); + }, /Specifying `defaultLayout` to .+ is deprecated\./); + + equal(_emberViews.jQuery('#wrapper').text(), 'inner-outer', 'The component is composed correctly'); + }); + + QUnit.test('Assigning defaultLayout to a component should set it up as a layout if layout was found [DEPRECATED]', function () { + expect(2); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{#my-component}}{{text}}{{/my-component}}
    ')); + _emberGlimmer.setTemplate('components/my-component', _emberTemplateCompiler.compile('{{text}}-{{yield}}')); + + expectDeprecation(function () { + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + 'text': 'outer' + })); + + appInstance.register('component:my-component', _emberGlimmer.Component.extend({ + text: 'inner', + defaultLayout: _emberTemplateCompiler.compile('should not see this!') + })); + }); + }, /Specifying `defaultLayout` to .+ is deprecated\./); + + equal(_emberViews.jQuery('#wrapper').text(), 'inner-outer', 'The component is composed correctly'); + }); + + QUnit.test('Using name of component that does not exist', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{#no-good}} {{/no-good}}
    ')); + + expectAssertion(function () { + return boot(); + }, /.* named "no-good" .*/); + }); + + QUnit.module('Application Lifecycle - Component Context', { + setup: prepare, + teardown: cleanup + }); + + QUnit.test('Components with a block should have the proper content when a template is provided', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{#my-component}}{{text}}{{/my-component}}
    ')); + _emberGlimmer.setTemplate('components/my-component', _emberTemplateCompiler.compile('{{text}}-{{yield}}')); + + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + 'text': 'outer' + })); + + appInstance.register('component:my-component', _emberGlimmer.Component.extend({ + text: 'inner' + })); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'inner-outer', 'The component is composed correctly'); + }); + + QUnit.test('Components with a block should yield the proper content without a template provided', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{#my-component}}{{text}}{{/my-component}}
    ')); + + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + 'text': 'outer' + })); + + appInstance.register('component:my-component', _emberGlimmer.Component.extend({ + text: 'inner' + })); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'outer', 'The component is composed correctly'); + }); + + QUnit.test('Components without a block should have the proper content when a template is provided', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{my-component}}
    ')); + _emberGlimmer.setTemplate('components/my-component', _emberTemplateCompiler.compile('{{text}}')); + + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + 'text': 'outer' + })); + + appInstance.register('component:my-component', _emberGlimmer.Component.extend({ + text: 'inner' + })); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'inner', 'The component is composed correctly'); + }); + + QUnit.test('Components without a block should have the proper content', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{my-component}}
    ')); + + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + 'text': 'outer' + })); + + appInstance.register('component:my-component', _emberGlimmer.Component.extend({ + didInsertElement: function () { + this.$().html('Some text inserted by jQuery'); + } + })); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'Some text inserted by jQuery', 'The component is composed correctly'); + }); + + // The test following this one is the non-deprecated version + QUnit.test('properties of a component without a template should not collide with internal structures [DEPRECATED]', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{my-component data=foo}}
    ')); + + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + 'text': 'outer', + 'foo': 'Some text inserted by jQuery' + })); + + appInstance.register('component:my-component', _emberGlimmer.Component.extend({ + didInsertElement: function () { + this.$().html(this.get('data')); + } + })); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'Some text inserted by jQuery', 'The component is composed correctly'); + }); + + QUnit.test('attrs property of a component without a template should not collide with internal structures', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{my-component attrs=foo}}
    ')); + + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + 'text': 'outer', + 'foo': 'Some text inserted by jQuery' + })); + + appInstance.register('component:my-component', _emberGlimmer.Component.extend({ + didInsertElement: function () { + // FIXME: I'm unsure if this is even the right way to access attrs + this.$().html(this.get('attrs.attrs.value')); + } + })); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'Some text inserted by jQuery', 'The component is composed correctly'); + }); + + QUnit.test('Components trigger actions in the parents context when called from within a block', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{#my-component}}Fizzbuzz{{/my-component}}
    ')); + + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + actions: { + fizzbuzz: function () { + ok(true, 'action triggered on parent'); + } + } + })); + + appInstance.register('component:my-component', _emberGlimmer.Component.extend()); + }); + + _emberMetal.run(function () { + _emberViews.jQuery('#fizzbuzz', '#wrapper').click(); + }); + }); + + QUnit.test('Components trigger actions in the components context when called from within its template', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{#my-component}}{{text}}{{/my-component}}
    ')); + _emberGlimmer.setTemplate('components/my-component', _emberTemplateCompiler.compile('Fizzbuzz')); + + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + actions: { + fizzbuzz: function () { + ok(false, 'action triggered on the wrong context'); + } + } + })); + + appInstance.register('component:my-component', _emberGlimmer.Component.extend({ + actions: { + fizzbuzz: function () { + ok(true, 'action triggered on component'); + } + } + })); + }); + + _emberViews.jQuery('#fizzbuzz', '#wrapper').click(); + }); +}); +enifed('ember/tests/component_registration_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests'); + test('ember/tests/component_registration_test.js should pass jscs', function () { + ok(true, 'ember/tests/component_registration_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/component_registration_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests'); + QUnit.test('ember/tests/component_registration_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/component_registration_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/controller_test', ['exports', 'ember-runtime', 'ember-routing', 'ember-metal', 'ember-template-compiler', 'ember-application', 'ember-glimmer', 'ember-views'], function (exports, _emberRuntime, _emberRouting, _emberMetal, _emberTemplateCompiler, _emberApplication, _emberGlimmer, _emberViews) { + 'use strict'; + + /* + In Ember 1.x, controllers subtly affect things like template scope + and action targets in exciting and often inscrutable ways. This test + file contains integration tests that verify the correct behavior of + the many parts of the system that change and rely upon controller scope, + from the runtime up to the templating layer. + */ + + var App = undefined, + $fixture = undefined; + + QUnit.module('Template scoping examples', { + setup: function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create({ + name: 'App', + rootElement: '#qunit-fixture' + }); + App.deferReadiness(); + + App.Router.reopen({ + location: 'none' + }); + + App.LoadingRoute = _emberRouting.Route.extend(); + }); + + $fixture = _emberViews.jQuery('#qunit-fixture'); + }, + + teardown: function () { + _emberMetal.run(function () { + return App.destroy(); + }); + + App = null; + + _emberGlimmer.setTemplates({}); + } + }); + + QUnit.test('Actions inside an outlet go to the associated controller', function () { + expect(1); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{component-with-action action=\'componentAction\'}}')); + + App.IndexController = _emberRuntime.Controller.extend({ + actions: { + componentAction: function () { + ok(true, 'received the click'); + } + } + }); + + App.ComponentWithActionComponent = _emberGlimmer.Component.extend({ + classNames: ['component-with-action'], + click: function () { + this.sendAction(); + } + }); + + bootApp(); + + $fixture.find('.component-with-action').click(); + }); + + function bootApp() { + _emberMetal.run(App, 'advanceReadiness'); + } +}); +enifed('ember/tests/controller_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests'); + test('ember/tests/controller_test.js should pass jscs', function () { + ok(true, 'ember/tests/controller_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/controller_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests'); + QUnit.test('ember/tests/controller_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/controller_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/global-api-test', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { + 'use strict'; + + QUnit.module('Global API Tests'); + + function confirmExport(property, internal) { + QUnit.test('confirm ' + property + ' is exported', function () { + var theExport = _emberMetal.get(window, property); + ok(theExport + ' is exported'); + if (internal !== undefined) { + equal(theExport, internal, theExport + ' is exported properly'); + } + }); + } + + confirmExport('Ember.DefaultResolver'); + confirmExport('Ember.generateController'); + confirmExport('Ember.Helper'); + confirmExport('Ember.Helper.helper'); + confirmExport('Ember.isArray', _emberRuntime.isArray); +}); +enifed('ember/tests/global-api-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests'); + test('ember/tests/global-api-test.js should pass jscs', function () { + ok(true, 'ember/tests/global-api-test.js should pass jscs.'); + }); +}); +enifed('ember/tests/global-api-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests'); + QUnit.test('ember/tests/global-api-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/global-api-test.js should pass jshint.'); + }); +}); +enifed('ember/tests/helpers/helper_registration_test', ['exports', 'ember-runtime', 'ember-metal', 'ember-template-compiler', 'ember-glimmer', 'ember-application', 'ember-routing', 'ember-views'], function (exports, _emberRuntime, _emberMetal, _emberTemplateCompiler, _emberGlimmer, _emberApplication, _emberRouting, _emberViews) { + 'use strict'; + + var App = undefined, + appInstance = undefined; + + QUnit.module('Application Lifecycle - Helper Registration', { + teardown: function () { + _emberMetal.run(function () { + if (App) { + App.destroy(); + } + + App = appInstance = null; + _emberGlimmer.setTemplates({}); + }); + } + }); + + function boot(callback) { + _emberMetal.run(function () { + App = _emberApplication.Application.create({ + name: 'App', + rootElement: '#qunit-fixture' + }); + + App.deferReadiness(); + + App.Router = _emberRouting.Router.extend({ + location: 'none' + }); + + appInstance = App.__deprecatedInstance__; + + if (callback) { + callback(); + } + }); + + var router = appInstance.lookup('router:main'); + + _emberMetal.run(App, 'advanceReadiness'); + _emberMetal.run(function () { + return router.handleURL('/'); + }); + } + + QUnit.test('Unbound dashed helpers registered on the container can be late-invoked', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{x-borf}} {{x-borf \'YES\'}}
    ')); + var myHelper = _emberGlimmer.helper(function (params) { + return params[0] || 'BORF'; + }); + + boot(function () { + App.register('helper:x-borf', myHelper); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'BORF YES', 'The helper was invoked from the container'); + }); + + QUnit.test('Bound helpers registered on the container can be late-invoked', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{x-reverse}} {{x-reverse foo}}
    ')); + + boot(function () { + appInstance.register('controller:application', _emberRuntime.Controller.extend({ + foo: 'alex' + })); + + appInstance.register('helper:x-reverse', _emberGlimmer.helper(function (_ref) { + var value = _ref[0]; + + return value ? value.split('').reverse().join('') : '--'; + })); + }); + + equal(_emberViews.jQuery('#wrapper').text(), '-- xela', 'The bound helper was invoked from the container'); + }); + + QUnit.test('Undashed helpers registered on the container can be invoked', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{omg}}|{{yorp \'boo\'}}|{{yorp \'ya\'}}
    ')); + + boot(function () { + appInstance.register('helper:omg', _emberGlimmer.helper(function () { + return 'OMG'; + })); + + appInstance.register('helper:yorp', _emberGlimmer.helper(function (_ref2) { + var value = _ref2[0]; + return value; + })); + }); + + equal(_emberViews.jQuery('#wrapper').text(), 'OMG|boo|ya', 'The helper was invoked from the container'); + }); + + QUnit.test('Helpers can receive injections', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{full-name}}
    ')); + + var serviceCalled = false; + boot(function () { + appInstance.register('service:name-builder', _emberRuntime.Service.extend({ + build: function () { + serviceCalled = true; + } + })); + appInstance.register('helper:full-name', _emberGlimmer.Helper.extend({ + nameBuilder: _emberRuntime.inject.service('name-builder'), + compute: function () { + this.get('nameBuilder').build(); + } + })); + }); + + ok(serviceCalled, 'service was injected, method called'); + }); +}); +enifed('ember/tests/helpers/helper_registration_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/helpers'); + test('ember/tests/helpers/helper_registration_test.js should pass jscs', function () { + ok(true, 'ember/tests/helpers/helper_registration_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/helpers/helper_registration_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/helpers'); + QUnit.test('ember/tests/helpers/helper_registration_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/helpers/helper_registration_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/helpers/link_to_test', ['exports', 'ember-console', 'ember-runtime', 'ember-metal', 'ember-routing', 'ember-application', 'ember-views', 'ember-template-compiler', 'ember-glimmer'], function (exports, _emberConsole, _emberRuntime, _emberMetal, _emberRouting, _emberApplication, _emberViews, _emberTemplateCompiler, _emberGlimmer) { + 'use strict'; + + var Router = undefined, + App = undefined, + router = undefined, + appInstance = undefined; + + function bootApplication() { + router = appInstance.lookup('router:main'); + _emberMetal.run(App, 'advanceReadiness'); + } + + // IE includes the host name + function normalizeUrl(url) { + return url.replace(/https?:\/\/[^\/]+/, ''); + } + + function shouldNotBeActive(selector) { + checkActive(selector, false); + } + + function shouldBeActive(selector) { + checkActive(selector, true); + } + + function checkActive(selector, active) { + var classList = _emberViews.jQuery(selector, '#qunit-fixture')[0].className; + equal(classList.indexOf('active') > -1, active, selector + ' active should be ' + active.toString()); + } + + var updateCount = undefined, + replaceCount = undefined; + + function sharedSetup() { + App = _emberApplication.Application.create({ + name: 'App', + rootElement: '#qunit-fixture' + }); + + App.deferReadiness(); + + updateCount = replaceCount = 0; + App.Router.reopen({ + location: _emberRouting.NoneLocation.create({ + setURL: function (path) { + updateCount++; + _emberMetal.set(this, 'path', path); + }, + + replaceURL: function (path) { + replaceCount++; + _emberMetal.set(this, 'path', path); + } + }) + }); + + Router = App.Router; + appInstance = App.__deprecatedInstance__; + } + + function sharedTeardown() { + _emberMetal.run(function () { + return App.destroy(); + }); + _emberGlimmer.setTemplates({}); + _emberMetal.instrumentationReset(); + } + + QUnit.module('The {{link-to}} helper', { + setup: function () { + _emberMetal.run(function () { + sharedSetup(); + + _emberGlimmer.setTemplate('app', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Home

    {{#link-to \'about\' id=\'about-link\'}}About{{/link-to}}{{#link-to \'index\' id=\'self-link\'}}Self{{/link-to}}')); + _emberGlimmer.setTemplate('about', _emberTemplateCompiler.compile('

    About

    {{#link-to \'index\' id=\'home-link\'}}Home{{/link-to}}{{#link-to \'about\' id=\'self-link\'}}Self{{/link-to}}')); + _emberGlimmer.setTemplate('item', _emberTemplateCompiler.compile('

    Item

    {{model.name}}

    {{#link-to \'index\' id=\'home-link\'}}Home{{/link-to}}')); + + appInstance.unregister('router:main'); + appInstance.register('router:main', Router); + }); + }, + + teardown: sharedTeardown + }); + + QUnit.test('The {{link-to}} helper moves into the named route', function () { + Router.map(function (match) { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + equal(_emberViews.jQuery('h3:contains(Home)', '#qunit-fixture').length, 1, 'The home template was rendered'); + equal(_emberViews.jQuery('#self-link.active', '#qunit-fixture').length, 1, 'The self-link was rendered with active class'); + equal(_emberViews.jQuery('#about-link:not(.active)', '#qunit-fixture').length, 1, 'The other link was rendered without active class'); + + _emberMetal.run(function () { + return _emberViews.jQuery('#about-link', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('h3:contains(About)', '#qunit-fixture').length, 1, 'The about template was rendered'); + equal(_emberViews.jQuery('#self-link.active', '#qunit-fixture').length, 1, 'The self-link was rendered with active class'); + equal(_emberViews.jQuery('#home-link:not(.active)', '#qunit-fixture').length, 1, 'The other link was rendered without active class'); + }); + + if (false) { + QUnit.test('The {{link-to}} helper fires an interaction event', function (assert) { + assert.expect(2); + Router.map(function (match) { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + _emberMetal.instrumentationSubscribe('interaction.link-to', { + before: function () { + assert.ok(true, 'instrumentation subscriber was called'); + }, + after: function () { + assert.ok(true, 'instrumentation subscriber was called'); + } + }); + + _emberViews.jQuery('#about-link', '#qunit-fixture').click(); + }); + + QUnit.test('The {{link-to}} helper interaction event includes the route name', function (assert) { + assert.expect(2); + Router.map(function (match) { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + _emberMetal.instrumentationSubscribe('interaction.link-to', { + before: function (name, timestamp, _ref) { + var routeName = _ref.routeName; + + assert.equal(routeName, 'about', 'instrumentation subscriber was passed route name'); + }, + after: function (name, timestamp, _ref2) { + var routeName = _ref2.routeName; + + assert.equal(routeName, 'about', 'instrumentation subscriber was passed route name'); + } + }); + + _emberViews.jQuery('#about-link', '#qunit-fixture').click(); + }); + + QUnit.test('The {{link-to}} helper interaction event includes the transition in the after hook', function (assert) { + assert.expect(1); + Router.map(function (match) { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + _emberMetal.instrumentationSubscribe('interaction.link-to', { + before: function () {}, + after: function (name, timestamp, _ref3) { + var transition = _ref3.transition; + + assert.equal(transition.targetName, 'about', 'instrumentation subscriber was passed route name'); + } + }); + + _emberViews.jQuery('#about-link', '#qunit-fixture').click(); + }); + } + + QUnit.test('The {{link-to}} helper supports URL replacement', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Home

    {{#link-to \'about\' id=\'about-link\' replace=true}}About{{/link-to}}')); + + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + equal(updateCount, 0, 'precond: setURL has not been called'); + equal(replaceCount, 0, 'precond: replaceURL has not been called'); + + _emberMetal.run(function () { + return _emberViews.jQuery('#about-link', '#qunit-fixture').click(); + }); + + equal(updateCount, 0, 'setURL should not be called'); + equal(replaceCount, 1, 'replaceURL should be called once'); + }); + + QUnit.test('The {{link-to}} helper supports URL replacement via replace=boundTruthyThing', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Home

    {{#link-to \'about\' id=\'about-link\' replace=boundTruthyThing}}About{{/link-to}}')); + + App.IndexController = _emberRuntime.Controller.extend({ + boundTruthyThing: true + }); + + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + equal(updateCount, 0, 'precond: setURL has not been called'); + equal(replaceCount, 0, 'precond: replaceURL has not been called'); + + _emberMetal.run(function () { + return _emberViews.jQuery('#about-link', '#qunit-fixture').click(); + }); + + equal(updateCount, 0, 'setURL should not be called'); + equal(replaceCount, 1, 'replaceURL should be called once'); + }); + + QUnit.test('The {{link-to}} helper supports setting replace=boundFalseyThing', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Home

    {{#link-to \'about\' id=\'about-link\' replace=boundFalseyThing}}About{{/link-to}}')); + + App.IndexController = _emberRuntime.Controller.extend({ + boundFalseyThing: false + }); + + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + equal(updateCount, 0, 'precond: setURL has not been called'); + equal(replaceCount, 0, 'precond: replaceURL has not been called'); + + _emberMetal.run(function () { + return _emberViews.jQuery('#about-link', '#qunit-fixture').click(); + }); + + equal(updateCount, 1, 'setURL should be called'); + equal(replaceCount, 0, 'replaceURL should not be called'); + }); + + // jscs:disable + + QUnit.test("the {{link-to}} helper doesn't add an href when the tagName isn't 'a'", function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to \'about\' id=\'about-link\' tagName=\'div\'}}About{{/link-to}}')); + + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + equal(_emberViews.jQuery('#about-link').attr('href'), undefined, 'there is no href attribute'); + }); + + QUnit.test("the {{link-to}} applies a 'disabled' class when disabled", function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('\n {{#link-to "about" id="about-link-static" disabledWhen="shouldDisable"}}About{{/link-to}}\n {{#link-to "about" id="about-link-dynamic" disabledWhen=dynamicDisabledWhen}}About{{/link-to}}\n ')); + + App.IndexController = _emberRuntime.Controller.extend({ + shouldDisable: true, + dynamicDisabledWhen: 'shouldDisable' + }); + + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + equal(_emberViews.jQuery('#about-link-static.disabled', '#qunit-fixture').length, 1, 'The static link is disabled when its disabledWhen is true'); + equal(_emberViews.jQuery('#about-link-dynamic.disabled', '#qunit-fixture').length, 1, 'The dynamic link is disabled when its disabledWhen is true'); + + _emberMetal.run(function () { + return _emberMetal.set(appInstance.lookup('controller:index'), 'dynamicDisabledWhen', false); + }); + + equal(_emberViews.jQuery('#about-link-dynamic.disabled', '#qunit-fixture').length, 0, 'The dynamic link is re-enabled when its disabledWhen becomes false'); + }); + + QUnit.test("the {{link-to}} doesn't apply a 'disabled' class if disabledWhen is not provided", function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to "about" id="about-link"}}About{{/link-to}}')); + + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + ok(!_emberViews.jQuery('#about-link', '#qunit-fixture').hasClass('disabled'), 'The link is not disabled if disabledWhen not provided'); + }); + + QUnit.test('the {{link-to}} helper supports a custom disabledClass', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to "about" id="about-link" disabledWhen=true disabledClass="do-not-want"}}About{{/link-to}}')); + + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + equal(_emberViews.jQuery('#about-link.do-not-want', '#qunit-fixture').length, 1, 'The link can apply a custom disabled class'); + }); + + QUnit.test('the {{link-to}} helper supports a custom disabledClass set via bound param', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to "about" id="about-link" disabledWhen=true disabledClass=disabledClass}}About{{/link-to}}')); + + Router.map(function () { + this.route('about'); + }); + + App.IndexController = _emberRuntime.Controller.extend({ + disabledClass: 'do-not-want' + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + equal(_emberViews.jQuery('#about-link.do-not-want', '#qunit-fixture').length, 1, 'The link can apply a custom disabled class via bound param'); + }); + + QUnit.test('the {{link-to}} helper does not respond to clicks when disabled', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to "about" id="about-link" disabledWhen=true}}About{{/link-to}}')); + + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + _emberMetal.run(function () { + return _emberViews.jQuery('#about-link', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('h3:contains(About)', '#qunit-fixture').length, 0, 'Transitioning did not occur'); + }); + + QUnit.test('the {{link-to}} helper responds to clicks according to its disabledWhen bound param', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to "about" id="about-link" disabledWhen=disabledWhen}}About{{/link-to}}')); + + Router.map(function () { + this.route('about'); + }); + + App.IndexController = _emberRuntime.Controller.extend({ + disabledWhen: true + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + _emberMetal.run(function () { + return _emberViews.jQuery('#about-link', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('h3:contains(About)', '#qunit-fixture').length, 0, 'Transitioning did not occur'); + + _emberMetal.run(function () { + return _emberMetal.set(appInstance.lookup('controller:index'), 'disabledWhen', false); + }); + _emberMetal.run(function () { + return _emberViews.jQuery('#about-link', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('h3:contains(About)', '#qunit-fixture').length, 1, 'Transitioning did occur when disabledWhen became false'); + }); + + QUnit.test('The {{link-to}} helper supports a custom activeClass', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("

    Home

    {{#link-to 'about' id='about-link'}}About{{/link-to}}{{#link-to 'index' id='self-link' activeClass='zomg-active'}}Self{{/link-to}}")); + + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + equal(_emberViews.jQuery('h3:contains(Home)', '#qunit-fixture').length, 1, 'The home template was rendered'); + equal(_emberViews.jQuery('#self-link.zomg-active', '#qunit-fixture').length, 1, 'The self-link was rendered with active class'); + equal(_emberViews.jQuery('#about-link:not(.active)', '#qunit-fixture').length, 1, 'The other link was rendered without active class'); + }); + + QUnit.test('The {{link-to}} helper supports a custom activeClass from a bound param', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Home

    {{#link-to \'about\' id=\'about-link\'}}About{{/link-to}}{{#link-to \'index\' id=\'self-link\' activeClass=activeClass}}Self{{/link-to}}')); + + Router.map(function () { + this.route('about'); + }); + + App.IndexController = _emberRuntime.Controller.extend({ + activeClass: 'zomg-active' + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + equal(_emberViews.jQuery('h3:contains(Home)', '#qunit-fixture').length, 1, 'The home template was rendered'); + equal(_emberViews.jQuery('#self-link.zomg-active', '#qunit-fixture').length, 1, 'The self-link was rendered with active class'); + equal(_emberViews.jQuery('#about-link:not(.active)', '#qunit-fixture').length, 1, 'The other link was rendered without active class'); + }); + + QUnit.test("The {{link-to}} helper supports 'classNameBindings' with custom values [GH #11699]", function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Home

    {{#link-to \'about\' id=\'about-link\' classNameBindings=\'foo:foo-is-true:foo-is-false\'}}About{{/link-to}}')); + + Router.map(function () { + this.route('about'); + }); + + App.IndexController = _emberRuntime.Controller.extend({ + foo: false + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + equal(_emberViews.jQuery('#about-link.foo-is-false', '#qunit-fixture').length, 1, 'The about-link was rendered with the falsy class'); + + var controller = appInstance.lookup('controller:index'); + + _emberMetal.run(function () { + return controller.set('foo', true); + }); + + equal(_emberViews.jQuery('#about-link.foo-is-true', '#qunit-fixture').length, 1, 'The about-link was rendered with the truthy class after toggling the property'); + }); + + QUnit.test('The {{link-to}} helper supports leaving off .index for nested routes', function () { + Router.map(function () { + this.route('about', function () { + this.route('item'); + }); + }); + + _emberGlimmer.setTemplate('about', _emberTemplateCompiler.compile('

    About

    {{outlet}}')); + _emberGlimmer.setTemplate('about/index', _emberTemplateCompiler.compile("
    Index
    ")); + _emberGlimmer.setTemplate('about/item', _emberTemplateCompiler.compile("
    {{#link-to 'about'}}About{{/link-to}}
    ")); + + bootApplication(); + + _emberMetal.run(router, 'handleURL', '/about/item'); + + equal(normalizeUrl(_emberViews.jQuery('#item a', '#qunit-fixture').attr('href')), '/about'); + }); + + QUnit.test('The {{link-to}} helper supports currentWhen (DEPRECATED)', function () { + expectDeprecation('Usage of `currentWhen` is deprecated, use `current-when` instead.'); + + Router.map(function (match) { + this.route('index', { path: '/' }, function () { + this.route('about'); + }); + + this.route('item'); + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Home

    {{outlet}}')); + _emberGlimmer.setTemplate('index/about', _emberTemplateCompiler.compile("{{#link-to 'item' id='other-link' currentWhen='index'}}ITEM{{/link-to}}")); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/about'); + }); + + equal(_emberViews.jQuery('#other-link.active', '#qunit-fixture').length, 1, 'The link is active since current-when is a parent route'); + }); + + QUnit.test('The {{link-to}} helper supports custom, nested, current-when', function () { + Router.map(function (match) { + this.route('index', { path: '/' }, function () { + this.route('about'); + }); + + this.route('item'); + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Home

    {{outlet}}')); + _emberGlimmer.setTemplate('index/about', _emberTemplateCompiler.compile("{{#link-to 'item' id='other-link' current-when='index'}}ITEM{{/link-to}}")); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/about'); + }); + + equal(_emberViews.jQuery('#other-link.active', '#qunit-fixture').length, 1, 'The link is active since current-when is a parent route'); + }); + + QUnit.test('The {{link-to}} helper does not disregard current-when when it is given explicitly for a route', function () { + Router.map(function (match) { + this.route('index', { path: '/' }, function () { + this.route('about'); + }); + + this.route('items', function () { + this.route('item'); + }); + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Home

    {{outlet}}')); + _emberGlimmer.setTemplate('index/about', _emberTemplateCompiler.compile("{{#link-to 'items' id='other-link' current-when='index'}}ITEM{{/link-to}}")); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/about'); + }); + + equal(_emberViews.jQuery('#other-link.active', '#qunit-fixture').length, 1, 'The link is active when current-when is given for explicitly for a route'); + }); + + QUnit.test('The {{link-to}} helper does not disregard current-when when it is set via a bound param', function () { + Router.map(function (match) { + this.route('index', { path: '/' }, function () { + this.route('about'); + }); + + this.route('items', function () { + this.route('item'); + }); + }); + + App.IndexAboutController = _emberRuntime.Controller.extend({ + currentWhen: 'index' + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Home

    {{outlet}}')); + _emberGlimmer.setTemplate('index/about', _emberTemplateCompiler.compile("{{#link-to 'items' id='other-link' current-when=currentWhen}}ITEM{{/link-to}}")); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/about'); + }); + + equal(_emberViews.jQuery('#other-link.active', '#qunit-fixture').length, 1, 'The link is active when current-when is given for explicitly for a route'); + }); + + QUnit.test('The {{link-to}} helper supports multiple current-when routes', function () { + Router.map(function (match) { + this.route('index', { path: '/' }, function () { + this.route('about'); + }); + this.route('item'); + this.route('foo'); + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Home

    {{outlet}}')); + _emberGlimmer.setTemplate('index/about', _emberTemplateCompiler.compile("{{#link-to 'item' id='link1' current-when='item index'}}ITEM{{/link-to}}")); + _emberGlimmer.setTemplate('item', _emberTemplateCompiler.compile("{{#link-to 'item' id='link2' current-when='item index'}}ITEM{{/link-to}}")); + _emberGlimmer.setTemplate('foo', _emberTemplateCompiler.compile("{{#link-to 'item' id='link3' current-when='item index'}}ITEM{{/link-to}}")); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/about'); + }); + + equal(_emberViews.jQuery('#link1.active', '#qunit-fixture').length, 1, 'The link is active since current-when contains the parent route'); + + _emberMetal.run(function () { + return router.handleURL('/item'); + }); + + equal(_emberViews.jQuery('#link2.active', '#qunit-fixture').length, 1, 'The link is active since you are on the active route'); + + _emberMetal.run(function () { + return router.handleURL('/foo'); + }); + + equal(_emberViews.jQuery('#link3.active', '#qunit-fixture').length, 0, 'The link is not active since current-when does not contain the active route'); + }); + + QUnit.test('The {{link-to}} helper defaults to bubbling', function () { + _emberGlimmer.setTemplate('about', _emberTemplateCompiler.compile("
    {{#link-to 'about.contact' id='about-contact'}}About{{/link-to}}
    {{outlet}}")); + _emberGlimmer.setTemplate('about/contact', _emberTemplateCompiler.compile("

    Contact

    ")); + + Router.map(function () { + this.route('about', function () { + this.route('contact'); + }); + }); + + var hidden = 0; + + App.AboutRoute = _emberRouting.Route.extend({ + actions: { + hide: function () { + hidden++; + } + } + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/about'); + }); + + _emberMetal.run(function () { + return _emberViews.jQuery('#about-contact', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('#contact', '#qunit-fixture').text(), 'Contact', 'precond - the link worked'); + + equal(hidden, 1, 'The link bubbles'); + }); + + QUnit.test('The {{link-to}} helper supports bubbles=false', function () { + _emberGlimmer.setTemplate('about', _emberTemplateCompiler.compile("
    {{#link-to 'about.contact' id='about-contact' bubbles=false}}About{{/link-to}}
    {{outlet}}")); + _emberGlimmer.setTemplate('about/contact', _emberTemplateCompiler.compile("

    Contact

    ")); + + Router.map(function () { + this.route('about', function () { + this.route('contact'); + }); + }); + + var hidden = 0; + + App.AboutRoute = _emberRouting.Route.extend({ + actions: { + hide: function () { + hidden++; + } + } + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/about'); + }); + + _emberMetal.run(function () { + return _emberViews.jQuery('#about-contact', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('#contact', '#qunit-fixture').text(), 'Contact', 'precond - the link worked'); + + equal(hidden, 0, "The link didn't bubble"); + }); + + QUnit.test('The {{link-to}} helper supports bubbles=boundFalseyThing', function () { + _emberGlimmer.setTemplate('about', _emberTemplateCompiler.compile("
    {{#link-to 'about.contact' id='about-contact' bubbles=boundFalseyThing}}About{{/link-to}}
    {{outlet}}")); + _emberGlimmer.setTemplate('about/contact', _emberTemplateCompiler.compile("

    Contact

    ")); + + App.AboutController = _emberRuntime.Controller.extend({ + boundFalseyThing: false + }); + + Router.map(function () { + this.route('about', function () { + this.route('contact'); + }); + }); + + var hidden = 0; + + App.AboutRoute = _emberRouting.Route.extend({ + actions: { + hide: function () { + hidden++; + } + } + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/about'); + }); + _emberMetal.run(function () { + return _emberViews.jQuery('#about-contact', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('#contact', '#qunit-fixture').text(), 'Contact', 'precond - the link worked'); + + equal(hidden, 0, "The link didn't bubble"); + }); + + QUnit.test('The {{link-to}} helper moves into the named route with context', function () { + Router.map(function (match) { + this.route('about'); + this.route('item', { path: '/item/:id' }); + }); + + _emberGlimmer.setTemplate('about', _emberTemplateCompiler.compile("

    List

      {{#each model as |person|}}
    • {{#link-to 'item' person}}{{person.name}}{{/link-to}}
    • {{/each}}
    {{#link-to 'index' id='home-link'}}Home{{/link-to}}")); + + App.AboutRoute = _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.A([{ id: 'yehuda', name: 'Yehuda Katz' }, { id: 'tom', name: 'Tom Dale' }, { id: 'erik', name: 'Erik Brynroflsson' }]); + } + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/about'); + }); + + equal(_emberViews.jQuery('h3:contains(List)', '#qunit-fixture').length, 1, 'The home template was rendered'); + equal(normalizeUrl(_emberViews.jQuery('#home-link').attr('href')), '/', 'The home link points back at /'); + + _emberMetal.run(function () { + return _emberViews.jQuery('li a:contains(Yehuda)', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('h3:contains(Item)', '#qunit-fixture').length, 1, 'The item template was rendered'); + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'Yehuda Katz', 'The name is correct'); + + _emberMetal.run(function () { + return _emberViews.jQuery('#home-link').click(); + }); + _emberMetal.run(function () { + return _emberViews.jQuery('#about-link').click(); + }); + + equal(normalizeUrl(_emberViews.jQuery('li a:contains(Yehuda)').attr('href')), '/item/yehuda'); + equal(normalizeUrl(_emberViews.jQuery('li a:contains(Tom)').attr('href')), '/item/tom'); + equal(normalizeUrl(_emberViews.jQuery('li a:contains(Erik)').attr('href')), '/item/erik'); + + _emberMetal.run(function () { + return _emberViews.jQuery('li a:contains(Erik)', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('h3:contains(Item)', '#qunit-fixture').length, 1, 'The item template was rendered'); + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'Erik Brynroflsson', 'The name is correct'); + }); + + QUnit.test('The {{link-to}} helper binds some anchor html tag common attributes', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("

    Home

    {{#link-to 'index' id='self-link' title='title-attr' rel='rel-attr' tabindex='-1'}}Self{{/link-to}}")); + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + var link = _emberViews.jQuery('#self-link', '#qunit-fixture'); + equal(link.attr('title'), 'title-attr', 'The self-link contains title attribute'); + equal(link.attr('rel'), 'rel-attr', 'The self-link contains rel attribute'); + equal(link.attr('tabindex'), '-1', 'The self-link contains tabindex attribute'); + }); + + QUnit.test('The {{link-to}} helper supports `target` attribute', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("

    Home

    {{#link-to 'index' id='self-link' target='_blank'}}Self{{/link-to}}")); + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + var link = _emberViews.jQuery('#self-link', '#qunit-fixture'); + equal(link.attr('target'), '_blank', 'The self-link contains `target` attribute'); + }); + + QUnit.test('The {{link-to}} helper supports `target` attribute specified as a bound param', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("

    Home

    {{#link-to 'index' id='self-link' target=boundLinkTarget}}Self{{/link-to}}")); + + App.IndexController = _emberRuntime.Controller.extend({ + boundLinkTarget: '_blank' + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + var link = _emberViews.jQuery('#self-link', '#qunit-fixture'); + equal(link.attr('target'), '_blank', 'The self-link contains `target` attribute'); + }); + + QUnit.test('The {{link-to}} helper does not call preventDefault if `target` attribute is provided', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("

    Home

    {{#link-to 'index' id='self-link' target='_blank'}}Self{{/link-to}}")); + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + var event = _emberViews.jQuery.Event('click'); + _emberViews.jQuery('#self-link', '#qunit-fixture').trigger(event); + + equal(event.isDefaultPrevented(), false, 'should not preventDefault when target attribute is specified'); + }); + + QUnit.test('The {{link-to}} helper should preventDefault when `target = _self`', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("

    Home

    {{#link-to 'index' id='self-link' target='_self'}}Self{{/link-to}}")); + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + var event = _emberViews.jQuery.Event('click'); + _emberViews.jQuery('#self-link', '#qunit-fixture').trigger(event); + + equal(event.isDefaultPrevented(), true, 'should preventDefault when target attribute is `_self`'); + }); + + QUnit.test('The {{link-to}} helper should not transition if target is not equal to _self or empty', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("{{#link-to 'about' id='about-link' replace=true target='_blank'}}About{{/link-to}}")); + + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + _emberMetal.run(function () { + return _emberViews.jQuery('#about-link', '#qunit-fixture').click(); + }); + + notEqual(appInstance.lookup('controller:application').get('currentRouteName'), 'about', 'link-to should not transition if target is not equal to _self or empty'); + }); + + QUnit.test('The {{link-to}} helper accepts string/numeric arguments', function () { + Router.map(function () { + this.route('filter', { path: '/filters/:filter' }); + this.route('post', { path: '/post/:post_id' }); + this.route('repo', { path: '/repo/:owner/:name' }); + }); + + App.FilterController = _emberRuntime.Controller.extend({ + filter: 'unpopular', + repo: _emberRuntime.Object.create({ owner: 'ember', name: 'ember.js' }), + post_id: 123 + }); + _emberGlimmer.setTemplate('filter', _emberTemplateCompiler.compile('

    {{filter}}

    {{#link-to "filter" "unpopular" id="link"}}Unpopular{{/link-to}}{{#link-to "filter" filter id="path-link"}}Unpopular{{/link-to}}{{#link-to "post" post_id id="post-path-link"}}Post{{/link-to}}{{#link-to "post" 123 id="post-number-link"}}Post{{/link-to}}{{#link-to "repo" repo id="repo-object-link"}}Repo{{/link-to}}')); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile(' ')); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/filters/popular'); + }); + + equal(normalizeUrl(_emberViews.jQuery('#link', '#qunit-fixture').attr('href')), '/filters/unpopular'); + equal(normalizeUrl(_emberViews.jQuery('#path-link', '#qunit-fixture').attr('href')), '/filters/unpopular'); + equal(normalizeUrl(_emberViews.jQuery('#post-path-link', '#qunit-fixture').attr('href')), '/post/123'); + equal(normalizeUrl(_emberViews.jQuery('#post-number-link', '#qunit-fixture').attr('href')), '/post/123'); + equal(normalizeUrl(_emberViews.jQuery('#repo-object-link', '#qunit-fixture').attr('href')), '/repo/ember/ember.js'); + }); + + QUnit.test("Issue 4201 - Shorthand for route.index shouldn't throw errors about context arguments", function () { + expect(2); + Router.map(function () { + this.route('lobby', function () { + this.route('index', { path: ':lobby_id' }); + this.route('list'); + }); + }); + + App.LobbyIndexRoute = _emberRouting.Route.extend({ + model: function (params) { + equal(params.lobby_id, 'foobar'); + return params.lobby_id; + } + }); + + _emberGlimmer.setTemplate('lobby/index', _emberTemplateCompiler.compile("{{#link-to 'lobby' 'foobar' id='lobby-link'}}Lobby{{/link-to}}")); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('')); + _emberGlimmer.setTemplate('lobby/list', _emberTemplateCompiler.compile("{{#link-to 'lobby' 'foobar' id='lobby-link'}}Lobby{{/link-to}}")); + bootApplication(); + _emberMetal.run(router, 'handleURL', '/lobby/list'); + _emberMetal.run(_emberViews.jQuery('#lobby-link'), 'click'); + shouldBeActive('#lobby-link'); + }); + + QUnit.test('Quoteless route param performs property lookup', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("{{#link-to 'index' id='string-link'}}string{{/link-to}}{{#link-to foo id='path-link'}}path{{/link-to}}")); + + function assertEquality(href) { + equal(normalizeUrl(_emberViews.jQuery('#string-link', '#qunit-fixture').attr('href')), '/'); + equal(normalizeUrl(_emberViews.jQuery('#path-link', '#qunit-fixture').attr('href')), href); + } + + App.IndexController = _emberRuntime.Controller.extend({ + foo: 'index' + }); + + App.Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(router, 'handleURL', '/'); + + assertEquality('/'); + + var controller = appInstance.lookup('controller:index'); + _emberMetal.run(function () { + return controller.set('foo', 'about'); + }); + + assertEquality('/about'); + }); + + QUnit.test('link-to with null/undefined dynamic parameters are put in a loading state', function () { + expect(19); + + var oldWarn = _emberConsole.default.warn; + var warnCalled = false; + _emberConsole.default.warn = function () { + warnCalled = true; + }; + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("{{#link-to destinationRoute routeContext loadingClass='i-am-loading' id='context-link'}}string{{/link-to}}{{#link-to secondRoute loadingClass=loadingClass id='static-link'}}string{{/link-to}}")); + + var thing = _emberRuntime.Object.create({ id: 123 }); + + App.IndexController = _emberRuntime.Controller.extend({ + destinationRoute: null, + routeContext: null, + loadingClass: 'i-am-loading' + }); + + App.AboutRoute = _emberRouting.Route.extend({ + activate: function () { + ok(true, 'About was entered'); + } + }); + + App.Router.map(function () { + this.route('thing', { path: '/thing/:thing_id' }); + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(router, 'handleURL', '/'); + + function assertLinkStatus($link, url) { + if (url) { + equal(normalizeUrl($link.attr('href')), url, 'loaded link-to has expected href'); + ok(!$link.hasClass('i-am-loading'), 'loaded linkComponent has no loadingClass'); + } else { + equal(normalizeUrl($link.attr('href')), '#', "unloaded link-to has href='#'"); + ok($link.hasClass('i-am-loading'), 'loading linkComponent has loadingClass'); + } + } + + var $contextLink = _emberViews.jQuery('#context-link', '#qunit-fixture'); + var $staticLink = _emberViews.jQuery('#static-link', '#qunit-fixture'); + var controller = appInstance.lookup('controller:index'); + + assertLinkStatus($contextLink); + assertLinkStatus($staticLink); + + _emberMetal.run(function () { + warnCalled = false; + $contextLink.click(); + ok(warnCalled, 'Logger.warn was called from clicking loading link'); + }); + + // Set the destinationRoute (context is still null). + _emberMetal.run(controller, 'set', 'destinationRoute', 'thing'); + assertLinkStatus($contextLink); + + // Set the routeContext to an id + _emberMetal.run(controller, 'set', 'routeContext', '456'); + assertLinkStatus($contextLink, '/thing/456'); + + // Test that 0 isn't interpreted as falsy. + _emberMetal.run(controller, 'set', 'routeContext', 0); + assertLinkStatus($contextLink, '/thing/0'); + + // Set the routeContext to an object + _emberMetal.run(controller, 'set', 'routeContext', thing); + assertLinkStatus($contextLink, '/thing/123'); + + // Set the destinationRoute back to null. + _emberMetal.run(controller, 'set', 'destinationRoute', null); + assertLinkStatus($contextLink); + + _emberMetal.run(function () { + warnCalled = false; + $staticLink.click(); + ok(warnCalled, 'Logger.warn was called from clicking loading link'); + }); + + _emberMetal.run(controller, 'set', 'secondRoute', 'about'); + assertLinkStatus($staticLink, '/about'); + + // Click the now-active link + _emberMetal.run($staticLink, 'click'); + + _emberConsole.default.warn = oldWarn; + }); + + QUnit.test('The {{link-to}} helper refreshes href element when one of params changes', function () { + Router.map(function () { + this.route('post', { path: '/posts/:post_id' }); + }); + + var post = _emberRuntime.Object.create({ id: '1' }); + var secondPost = _emberRuntime.Object.create({ id: '2' }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to "post" post id="post"}}post{{/link-to}}')); + + App.IndexController = _emberRuntime.Controller.extend(); + var indexController = appInstance.lookup('controller:index'); + + _emberMetal.run(function () { + return indexController.set('post', post); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + equal(normalizeUrl(_emberViews.jQuery('#post', '#qunit-fixture').attr('href')), '/posts/1', 'precond - Link has rendered href attr properly'); + + _emberMetal.run(function () { + return indexController.set('post', secondPost); + }); + + equal(_emberViews.jQuery('#post', '#qunit-fixture').attr('href'), '/posts/2', 'href attr was updated after one of the params had been changed'); + + _emberMetal.run(function () { + return indexController.set('post', null); + }); + + equal(_emberViews.jQuery('#post', '#qunit-fixture').attr('href'), '#', 'href attr becomes # when one of the arguments in nullified'); + }); + + QUnit.test('The {{link-to}} helper is active when a route is active', function () { + Router.map(function () { + this.route('about', function () { + this.route('item'); + }); + }); + + _emberGlimmer.setTemplate('about', _emberTemplateCompiler.compile("
    {{#link-to 'about' id='about-link'}}About{{/link-to}} {{#link-to 'about.item' id='item-link'}}Item{{/link-to}} {{outlet}}
    ")); + _emberGlimmer.setTemplate('about/item', _emberTemplateCompiler.compile(' ')); + _emberGlimmer.setTemplate('about/index', _emberTemplateCompiler.compile(' ')); + + bootApplication(); + + _emberMetal.run(router, 'handleURL', '/about'); + + equal(_emberViews.jQuery('#about-link.active', '#qunit-fixture').length, 1, 'The about route link is active'); + equal(_emberViews.jQuery('#item-link.active', '#qunit-fixture').length, 0, 'The item route link is inactive'); + + _emberMetal.run(router, 'handleURL', '/about/item'); + + equal(_emberViews.jQuery('#about-link.active', '#qunit-fixture').length, 1, 'The about route link is active'); + equal(_emberViews.jQuery('#item-link.active', '#qunit-fixture').length, 1, 'The item route link is active'); + }); + + QUnit.test("The {{link-to}} helper works in an #each'd array of string route names", function () { + Router.map(function () { + this.route('foo'); + this.route('bar'); + this.route('rar'); + }); + + App.IndexController = _emberRuntime.Controller.extend({ + routeNames: _emberRuntime.A(['foo', 'bar', 'rar']), + route1: 'bar', + route2: 'foo' + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#each routeNames as |routeName|}}{{#link-to routeName}}{{routeName}}{{/link-to}}{{/each}}{{#each routeNames as |r|}}{{#link-to r}}{{r}}{{/link-to}}{{/each}}{{#link-to route1}}a{{/link-to}}{{#link-to route2}}b{{/link-to}}')); + + bootApplication(); + + function linksEqual($links, expected) { + equal($links.length, expected.length, 'Has correct number of links'); + + var idx = undefined; + for (idx = 0; idx < $links.length; idx++) { + var href = _emberViews.jQuery($links[idx]).attr('href'); + // Old IE includes the whole hostname as well + equal(href.slice(-expected[idx].length), expected[idx], 'Expected link to be \'' + expected[idx] + '\', but was \'' + href + '\''); + } + } + + linksEqual(_emberViews.jQuery('a', '#qunit-fixture'), ['/foo', '/bar', '/rar', '/foo', '/bar', '/rar', '/bar', '/foo']); + + var indexController = appInstance.lookup('controller:index'); + _emberMetal.run(indexController, 'set', 'route1', 'rar'); + + linksEqual(_emberViews.jQuery('a', '#qunit-fixture'), ['/foo', '/bar', '/rar', '/foo', '/bar', '/rar', '/rar', '/foo']); + + _emberMetal.run(indexController.routeNames, 'shiftObject'); + + linksEqual(_emberViews.jQuery('a', '#qunit-fixture'), ['/bar', '/rar', '/bar', '/rar', '/rar', '/foo']); + }); + + QUnit.test('The non-block form {{link-to}} helper moves into the named route', function () { + expect(3); + Router.map(function (match) { + this.route('contact'); + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("

    Home

    {{link-to 'Contact us' 'contact' id='contact-link'}}{{#link-to 'index' id='self-link'}}Self{{/link-to}}")); + _emberGlimmer.setTemplate('contact', _emberTemplateCompiler.compile("

    Contact

    {{link-to 'Home' 'index' id='home-link'}}{{link-to 'Self' 'contact' id='self-link'}}")); + + bootApplication(); + + _emberMetal.run(function () { + return _emberViews.jQuery('#contact-link', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('h3:contains(Contact)', '#qunit-fixture').length, 1, 'The contact template was rendered'); + equal(_emberViews.jQuery('#self-link.active', '#qunit-fixture').length, 1, 'The self-link was rendered with active class'); + equal(_emberViews.jQuery('#home-link:not(.active)', '#qunit-fixture').length, 1, 'The other link was rendered without active class'); + }); + + QUnit.test('The non-block form {{link-to}} helper updates the link text when it is a binding', function () { + expect(8); + Router.map(function (match) { + this.route('contact'); + }); + + App.IndexController = _emberRuntime.Controller.extend({ + contactName: 'Jane' + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("

    Home

    {{link-to contactName 'contact' id='contact-link'}}{{#link-to 'index' id='self-link'}}Self{{/link-to}}")); + _emberGlimmer.setTemplate('contact', _emberTemplateCompiler.compile("

    Contact

    {{link-to 'Home' 'index' id='home-link'}}{{link-to 'Self' 'contact' id='self-link'}}")); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + var controller = appInstance.lookup('controller:index'); + + equal(_emberViews.jQuery('#contact-link:contains(Jane)', '#qunit-fixture').length, 1, 'The link title is correctly resolved'); + + _emberMetal.run(function () { + return controller.set('contactName', 'Joe'); + }); + + equal(_emberViews.jQuery('#contact-link:contains(Joe)', '#qunit-fixture').length, 1, 'The link title is correctly updated when the bound property changes'); + + _emberMetal.run(function () { + return controller.set('contactName', 'Robert'); + }); + + equal(_emberViews.jQuery('#contact-link:contains(Robert)', '#qunit-fixture').length, 1, 'The link title is correctly updated when the bound property changes a second time'); + + _emberMetal.run(function () { + return _emberViews.jQuery('#contact-link', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('h3:contains(Contact)', '#qunit-fixture').length, 1, 'The contact template was rendered'); + equal(_emberViews.jQuery('#self-link.active', '#qunit-fixture').length, 1, 'The self-link was rendered with active class'); + equal(_emberViews.jQuery('#home-link:not(.active)', '#qunit-fixture').length, 1, 'The other link was rendered without active class'); + + _emberMetal.run(function () { + return _emberViews.jQuery('#home-link', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('h3:contains(Home)', '#qunit-fixture').length, 1, 'The index template was rendered'); + equal(_emberViews.jQuery('#contact-link:contains(Robert)', '#qunit-fixture').length, 1, 'The link title is correctly updated when the route changes'); + }); + + QUnit.test('The non-block form {{link-to}} helper moves into the named route with context', function () { + expect(5); + + Router.map(function (match) { + this.route('item', { path: '/item/:id' }); + }); + + App.IndexRoute = _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.A([{ id: 'yehuda', name: 'Yehuda Katz' }, { id: 'tom', name: 'Tom Dale' }, { id: 'erik', name: 'Erik Brynroflsson' }]); + } + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("

    Home

      {{#each model as |person|}}
    • {{link-to person.name 'item' person}}
    • {{/each}}
    ")); + _emberGlimmer.setTemplate('item', _emberTemplateCompiler.compile("

    Item

    {{model.name}}

    {{#link-to 'index' id='home-link'}}Home{{/link-to}}")); + + bootApplication(); + + _emberMetal.run(function () { + return _emberViews.jQuery('li a:contains(Yehuda)', '#qunit-fixture').click(); + }); + + equal(_emberViews.jQuery('h3:contains(Item)', '#qunit-fixture').length, 1, 'The item template was rendered'); + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'Yehuda Katz', 'The name is correct'); + + _emberMetal.run(function () { + return _emberViews.jQuery('#home-link').click(); + }); + + equal(normalizeUrl(_emberViews.jQuery('li a:contains(Yehuda)').attr('href')), '/item/yehuda'); + equal(normalizeUrl(_emberViews.jQuery('li a:contains(Tom)').attr('href')), '/item/tom'); + equal(normalizeUrl(_emberViews.jQuery('li a:contains(Erik)').attr('href')), '/item/erik'); + }); + + QUnit.test('The non-block form {{link-to}} performs property lookup', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("{{link-to 'string' 'index' id='string-link'}}{{link-to path foo id='path-link'}}")); + + function assertEquality(href) { + equal(normalizeUrl(_emberViews.jQuery('#string-link', '#qunit-fixture').attr('href')), '/'); + equal(normalizeUrl(_emberViews.jQuery('#path-link', '#qunit-fixture').attr('href')), href); + } + + App.IndexController = _emberRuntime.Controller.extend({ + foo: 'index' + }); + + App.Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(router, 'handleURL', '/'); + + assertEquality('/'); + + var controller = appInstance.lookup('controller:index'); + _emberMetal.run(function () { + return controller.set('foo', 'about'); + }); + + assertEquality('/about'); + }); + + QUnit.test('The non-block form {{link-to}} protects against XSS', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile("{{link-to display 'index' id='link'}}")); + + App.ApplicationController = _emberRuntime.Controller.extend({ + display: 'blahzorz' + }); + + bootApplication(); + + _emberMetal.run(router, 'handleURL', '/'); + + var controller = appInstance.lookup('controller:application'); + + equal(_emberViews.jQuery('#link', '#qunit-fixture').text(), 'blahzorz'); + _emberMetal.run(function () { + return controller.set('display', 'BLAMMO'); + }); + + equal(_emberViews.jQuery('#link', '#qunit-fixture').text(), 'BLAMMO'); + equal(_emberViews.jQuery('b', '#qunit-fixture').length, 0); + }); + + QUnit.test('the {{link-to}} helper calls preventDefault', function () { + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(router, 'handleURL', '/'); + + var event = _emberViews.jQuery.Event('click'); + _emberViews.jQuery('#about-link', '#qunit-fixture').trigger(event); + + equal(event.isDefaultPrevented(), true, 'should preventDefault'); + }); + + QUnit.test('the {{link-to}} helper does not call preventDefault if `preventDefault=false` is passed as an option', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("{{#link-to 'about' id='about-link' preventDefault=false}}About{{/link-to}}")); + + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(router, 'handleURL', '/'); + + var event = _emberViews.jQuery.Event('click'); + _emberViews.jQuery('#about-link', '#qunit-fixture').trigger(event); + + equal(event.isDefaultPrevented(), false, 'should not preventDefault'); + }); + + QUnit.test('the {{link-to}} helper does not call preventDefault if `preventDefault=boundFalseyThing` is passed as an option', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("{{#link-to 'about' id='about-link' preventDefault=boundFalseyThing}}About{{/link-to}}")); + + App.IndexController = _emberRuntime.Controller.extend({ + boundFalseyThing: false + }); + + Router.map(function () { + this.route('about'); + }); + + bootApplication(); + + _emberMetal.run(router, 'handleURL', '/'); + + var event = _emberViews.jQuery.Event('click'); + _emberViews.jQuery('#about-link', '#qunit-fixture').trigger(event); + + equal(event.isDefaultPrevented(), false, 'should not preventDefault'); + }); + + QUnit.test('the {{link-to}} helper throws a useful error if you invoke it wrong', function () { + expect(1); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile("{{#link-to 'post'}}Post{{/link-to}}")); + + Router.map(function () { + this.route('post', { path: 'post/:post_id' }); + }); + + QUnit.throws(function () { + bootApplication(); + }, /(You attempted to define a `\{\{link-to "post"\}\}` but did not pass the parameters required for generating its dynamic segments.|You must provide param `post_id` to `generate`)/); + }); + + QUnit.test('the {{link-to}} helper does not throw an error if its route has exited', function () { + expect(0); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile("{{#link-to 'index' id='home-link'}}Home{{/link-to}}{{#link-to 'post' defaultPost id='default-post-link'}}Default Post{{/link-to}}{{#if currentPost}}{{#link-to 'post' currentPost id='current-post-link'}}Current Post{{/link-to}}{{/if}}")); + + App.ApplicationController = _emberRuntime.Controller.extend({ + defaultPost: { id: 1 }, + postController: _emberRuntime.inject.controller('post'), + currentPost: _emberMetal.alias('postController.model') + }); + + App.PostController = _emberRuntime.Controller.extend(); + + App.PostRoute = _emberRouting.Route.extend({ + model: function () { + return { id: 2 }; + }, + serialize: function (model) { + return { post_id: model.id }; + } + }); + + Router.map(function () { + this.route('post', { path: 'post/:post_id' }); + }); + + bootApplication(); + + _emberMetal.run(router, 'handleURL', '/'); + + _emberMetal.run(function () { + return _emberViews.jQuery('#default-post-link', '#qunit-fixture').click(); + }); + _emberMetal.run(function () { + return _emberViews.jQuery('#home-link', '#qunit-fixture').click(); + }); + _emberMetal.run(function () { + return _emberViews.jQuery('#current-post-link', '#qunit-fixture').click(); + }); + _emberMetal.run(function () { + return _emberViews.jQuery('#home-link', '#qunit-fixture').click(); + }); + }); + + QUnit.test('{{link-to}} active property respects changing parent route context', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile("{{link-to 'OMG' 'things' 'omg' id='omg-link'}} " + "{{link-to 'LOL' 'things' 'lol' id='lol-link'}} ")); + + Router.map(function () { + this.route('things', { path: '/things/:name' }, function () { + this.route('other'); + }); + }); + + bootApplication(); + + _emberMetal.run(router, 'handleURL', '/things/omg'); + shouldBeActive('#omg-link'); + shouldNotBeActive('#lol-link'); + + _emberMetal.run(router, 'handleURL', '/things/omg/other'); + shouldBeActive('#omg-link'); + shouldNotBeActive('#lol-link'); + }); + + QUnit.test('{{link-to}} populates href with default query param values even without query-params object', function () { + App.IndexController = _emberRuntime.Controller.extend({ + queryParams: ['foo'], + foo: '123' + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("{{#link-to 'index' id='the-link'}}Index{{/link-to}}")); + bootApplication(); + equal(_emberViews.jQuery('#the-link').attr('href'), '/', 'link has right href'); + }); + + QUnit.test('{{link-to}} populates href with default query param values with empty query-params object', function () { + App.IndexController = _emberRuntime.Controller.extend({ + queryParams: ['foo'], + foo: '123' + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile("{{#link-to 'index' (query-params) id='the-link'}}Index{{/link-to}}")); + bootApplication(); + equal(_emberViews.jQuery('#the-link').attr('href'), '/', 'link has right href'); + }); + + QUnit.test('{{link-to}} with only query-params and a block updates when route changes', function () { + Router.map(function () { + this.route('about'); + }); + + App.ApplicationController = _emberRuntime.Controller.extend({ + queryParams: ['foo', 'bar'], + foo: '123', + bar: 'yes' + }); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{#link-to (query-params foo=\'456\' bar=\'NAW\') id=\'the-link\'}}Index{{/link-to}}')); + bootApplication(); + equal(_emberViews.jQuery('#the-link').attr('href'), '/?bar=NAW&foo=456', 'link has right href'); + + _emberMetal.run(function () { + return router.handleURL('/about'); + }); + + equal(_emberViews.jQuery('#the-link').attr('href'), '/about?bar=NAW&foo=456', 'link has right href'); + }); + + QUnit.test('Block-less {{link-to}} with only query-params updates when route changes', function () { + Router.map(function () { + this.route('about'); + }); + + App.ApplicationController = _emberRuntime.Controller.extend({ + queryParams: ['foo', 'bar'], + foo: '123', + bar: 'yes' + }); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{link-to "Index" (query-params foo=\'456\' bar=\'NAW\') id=\'the-link\'}}')); + bootApplication(); + equal(_emberViews.jQuery('#the-link').attr('href'), '/?bar=NAW&foo=456', 'link has right href'); + + _emberMetal.run(function () { + return router.handleURL('/about'); + }); + + equal(_emberViews.jQuery('#the-link').attr('href'), '/about?bar=NAW&foo=456', 'link has right href'); + }); + + QUnit.test('The {{link-to}} helper can use dynamic params', function () { + Router.map(function (match) { + this.route('foo', { path: 'foo/:some/:thing' }); + this.route('bar', { path: 'bar/:some/:thing/:else' }); + }); + + var controller = undefined; + App.IndexController = _emberRuntime.Controller.extend({ + init: function () { + this._super.apply(this, arguments); + + controller = this; + + this.dynamicLinkParams = ['foo', 'one', 'two']; + } + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('\n

    Home

    \n\n {{#link-to params=dynamicLinkParams id="dynamic-link"}}Dynamic{{/link-to}}\n ')); + + bootApplication(); + + _emberMetal.run(function () { + return router.handleURL('/'); + }); + + var link = _emberViews.jQuery('#dynamic-link', '#qunit-fixture'); + + equal(link.attr('href'), '/foo/one/two'); + + _emberMetal.run(function () { + controller.set('dynamicLinkParams', ['bar', 'one', 'two', 'three']); + }); + + equal(link.attr('href'), '/bar/one/two/three'); + }); + + QUnit.test('GJ: {{link-to}} to a parent root model hook which performs a `transitionTo` has correct active class #13256', function () { + expect(1); + + Router.map(function () { + this.route('parent', function () { + this.route('child'); + }); + }); + + App.ParentRoute = _emberRouting.Route.extend({ + afterModel: function (transition) { + this.transitionTo('parent.child'); + } + }); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('\n {{link-to \'Parent\' \'parent\' id=\'parent-link\'}}\n ')); + + bootApplication(); + + _emberMetal.run(_emberViews.jQuery('#parent-link'), 'click'); + + shouldBeActive('#parent-link'); + }); +}); +enifed('ember/tests/helpers/link_to_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/helpers'); + test('ember/tests/helpers/link_to_test.js should pass jscs', function () { + ok(true, 'ember/tests/helpers/link_to_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/helpers/link_to_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/helpers'); + QUnit.test('ember/tests/helpers/link_to_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/helpers/link_to_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test', ['exports', 'ember-runtime', 'ember-routing', 'ember-metal', 'ember-template-compiler', 'ember-application', 'ember-views', 'ember-glimmer'], function (exports, _emberRuntime, _emberRouting, _emberMetal, _emberTemplateCompiler, _emberApplication, _emberViews, _emberGlimmer) { + 'use strict'; + + var Router = undefined, + App = undefined, + router = undefined, + registry = undefined, + container = undefined; + + var aboutDefer = undefined, + otherDefer = undefined; + + function bootApplication() { + router = container.lookup('router:main'); + _emberMetal.run(App, 'advanceReadiness'); + } + + function assertHasClass(className) { + var i = 1; + while (i < arguments.length) { + var $a = arguments[i]; + var shouldHaveClass = arguments[i + 1]; + equal($a.hasClass(className), shouldHaveClass, $a.attr('id') + ' should ' + (shouldHaveClass ? '' : 'not ') + 'have class ' + className); + i += 2; + } + } + + var updateCount = undefined, + replaceCount = undefined; + + function sharedSetup() { + App = _emberApplication.Application.create({ + name: 'App', + rootElement: '#qunit-fixture' + }); + + App.deferReadiness(); + + updateCount = replaceCount = 0; + App.Router.reopen({ + location: _emberRouting.NoneLocation.create({ + setURL: function (path) { + updateCount++; + _emberMetal.set(this, 'path', path); + }, + + replaceURL: function (path) { + replaceCount++; + _emberMetal.set(this, 'path', path); + } + }) + }); + + Router = App.Router; + registry = App.__registry__; + container = App.__container__; + } + + function sharedTeardown() { + _emberMetal.run(function () { + return App.destroy(); + }); + _emberGlimmer.setTemplates({}); + } + + QUnit.module('The {{link-to}} helper: .transitioning-in .transitioning-out CSS classes', { + setup: function () { + _emberMetal.run(function () { + sharedSetup(); + + registry.unregister('router:main'); + registry.register('router:main', Router); + + Router.map(function () { + this.route('about'); + this.route('other'); + }); + + App.AboutRoute = _emberRouting.Route.extend({ + model: function () { + aboutDefer = _emberRuntime.RSVP.defer(); + return aboutDefer.promise; + } + }); + + App.OtherRoute = _emberRouting.Route.extend({ + model: function () { + otherDefer = _emberRuntime.RSVP.defer(); + return otherDefer.promise; + } + }); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet}}{{link-to \'Index\' \'index\' id=\'index-link\'}}{{link-to \'About\' \'about\' id=\'about-link\'}}{{link-to \'Other\' \'other\' id=\'other-link\'}}')); + }); + }, + + teardown: function () { + sharedTeardown(); + aboutDefer = null; + } + }); + + QUnit.test('while a transition is underway', function () { + expect(18); + bootApplication(); + + var $index = _emberViews.jQuery('#index-link'); + var $about = _emberViews.jQuery('#about-link'); + var $other = _emberViews.jQuery('#other-link'); + + _emberMetal.run($about, 'click'); + + assertHasClass('active', $index, true, $about, false, $other, false); + assertHasClass('ember-transitioning-in', $index, false, $about, true, $other, false); + assertHasClass('ember-transitioning-out', $index, true, $about, false, $other, false); + + _emberMetal.run(aboutDefer, 'resolve'); + + assertHasClass('active', $index, false, $about, true, $other, false); + assertHasClass('ember-transitioning-in', $index, false, $about, false, $other, false); + assertHasClass('ember-transitioning-out', $index, false, $about, false, $other, false); + }); + + QUnit.test('while a transition is underway with nested link-to\'s', function () { + expect(54); + + Router.map(function () { + this.route('parent-route', function () { + this.route('about'); + this.route('other'); + }); + }); + + App.ParentRouteAboutRoute = _emberRouting.Route.extend({ + model: function () { + aboutDefer = _emberRuntime.RSVP.defer(); + return aboutDefer.promise; + } + }); + + App.ParentRouteOtherRoute = _emberRouting.Route.extend({ + model: function () { + otherDefer = _emberRuntime.RSVP.defer(); + return otherDefer.promise; + } + }); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('\n {{outlet}}\n {{#link-to \'index\' tagName=\'li\'}}\n {{link-to \'Index\' \'index\' id=\'index-link\'}}\n {{/link-to}}\n {{#link-to \'parent-route.about\' tagName=\'li\'}}\n {{link-to \'About\' \'parent-route.about\' id=\'about-link\'}}\n {{/link-to}}\n {{#link-to \'parent-route.other\' tagName=\'li\'}}\n {{link-to \'Other\' \'parent-route.other\' id=\'other-link\'}}\n {{/link-to}}\n ')); + + bootApplication(); + + var $index = _emberViews.jQuery('#index-link'); + var $about = _emberViews.jQuery('#about-link'); + var $other = _emberViews.jQuery('#other-link'); + + _emberMetal.run($about, 'click'); + + assertHasClass('active', $index, true, $about, false, $other, false); + assertHasClass('ember-transitioning-in', $index, false, $about, true, $other, false); + assertHasClass('ember-transitioning-out', $index, true, $about, false, $other, false); + + _emberMetal.run(aboutDefer, 'resolve'); + + assertHasClass('active', $index, false, $about, true, $other, false); + assertHasClass('ember-transitioning-in', $index, false, $about, false, $other, false); + assertHasClass('ember-transitioning-out', $index, false, $about, false, $other, false); + + _emberMetal.run($other, 'click'); + + assertHasClass('active', $index, false, $about, true, $other, false); + assertHasClass('ember-transitioning-in', $index, false, $about, false, $other, true); + assertHasClass('ember-transitioning-out', $index, false, $about, true, $other, false); + + _emberMetal.run(otherDefer, 'resolve'); + + assertHasClass('active', $index, false, $about, false, $other, true); + assertHasClass('ember-transitioning-in', $index, false, $about, false, $other, false); + assertHasClass('ember-transitioning-out', $index, false, $about, false, $other, false); + + _emberMetal.run($about, 'click'); + + assertHasClass('active', $index, false, $about, false, $other, true); + assertHasClass('ember-transitioning-in', $index, false, $about, true, $other, false); + assertHasClass('ember-transitioning-out', $index, false, $about, false, $other, true); + + _emberMetal.run(aboutDefer, 'resolve'); + + assertHasClass('active', $index, false, $about, true, $other, false); + assertHasClass('ember-transitioning-in', $index, false, $about, false, $other, false); + assertHasClass('ember-transitioning-out', $index, false, $about, false, $other, false); + }); +}); +enifed('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/helpers/link_to_test'); + test('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js should pass jscs', function () { + ok(true, 'ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/helpers/link_to_test'); + QUnit.test('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/helpers/link_to_test/link_to_with_query_params_test', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing', 'ember-template-compiler', 'ember-application', 'ember-views', 'ember-glimmer'], function (exports, _emberMetal, _emberRuntime, _emberRouting, _emberTemplateCompiler, _emberApplication, _emberViews, _emberGlimmer) { + 'use strict'; + + var Router = undefined, + App = undefined, + router = undefined, + registry = undefined, + container = undefined; + + function bootApplication() { + router = container.lookup('router:main'); + _emberMetal.run(App, 'advanceReadiness'); + } + + function shouldNotBeActive(selector) { + checkActive(selector, false); + } + + function shouldBeActive(selector) { + checkActive(selector, true); + } + + function checkActive(selector, active) { + var classList = _emberViews.jQuery(selector, '#qunit-fixture')[0].className; + equal(classList.indexOf('active') > -1, active, selector + ' active should be ' + active.toString()); + } + + var updateCount = undefined, + replaceCount = undefined; + + function sharedSetup() { + App = _emberApplication.Application.create({ + name: 'App', + rootElement: '#qunit-fixture' + }); + + App.deferReadiness(); + + updateCount = replaceCount = 0; + App.Router.reopen({ + location: _emberRouting.NoneLocation.create({ + setURL: function (path) { + updateCount++; + _emberMetal.set(this, 'path', path); + }, + + replaceURL: function (path) { + replaceCount++; + _emberMetal.set(this, 'path', path); + } + }) + }); + + Router = App.Router; + registry = App.__registry__; + container = App.__container__; + } + + function sharedTeardown() { + _emberMetal.run(function () { + return App.destroy(); + }); + _emberGlimmer.setTemplates({}); + } + + QUnit.module('The {{link-to}} helper: invoking with query params', { + setup: function () { + _emberMetal.run(function () { + sharedSetup(); + + App.IndexController = _emberRuntime.Controller.extend({ + queryParams: ['foo', 'bar', 'abool'], + foo: '123', + bar: 'abc', + boundThing: 'OMG', + abool: true + }); + + App.AboutController = _emberRuntime.Controller.extend({ + queryParams: ['baz', 'bat'], + baz: 'alex', + bat: 'borf' + }); + + registry.unregister('router:main'); + registry.register('router:main', Router); + }); + }, + + teardown: sharedTeardown + }); + + QUnit.test('doesn\'t update controller QP properties on current route when invoked', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to \'index\' id=\'the-link\'}}Index{{/link-to}}')); + bootApplication(); + + _emberMetal.run(_emberViews.jQuery('#the-link'), 'click'); + var indexController = container.lookup('controller:index'); + deepEqual(indexController.getProperties('foo', 'bar'), { foo: '123', bar: 'abc' }, 'controller QP properties not'); + }); + + QUnit.test('doesn\'t update controller QP properties on current route when invoked (empty query-params obj)', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to \'index\' (query-params) id=\'the-link\'}}Index{{/link-to}}')); + bootApplication(); + + _emberMetal.run(_emberViews.jQuery('#the-link'), 'click'); + var indexController = container.lookup('controller:index'); + deepEqual(indexController.getProperties('foo', 'bar'), { foo: '123', bar: 'abc' }, 'controller QP properties not'); + }); + + QUnit.test('link-to with no params throws', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to id=\'the-link\'}}Index{{/link-to}}')); + expectAssertion(function () { + return bootApplication(); + }, /one or more/); + }); + + QUnit.test('doesn\'t update controller QP properties on current route when invoked (empty query-params obj, inferred route)', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to (query-params) id=\'the-link\'}}Index{{/link-to}}')); + bootApplication(); + + _emberMetal.run(_emberViews.jQuery('#the-link'), 'click'); + var indexController = container.lookup('controller:index'); + deepEqual(indexController.getProperties('foo', 'bar'), { foo: '123', bar: 'abc' }, 'controller QP properties not'); + }); + + QUnit.test('updates controller QP properties on current route when invoked', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to \'index\' (query-params foo=\'456\') id=\'the-link\'}}Index{{/link-to}}')); + bootApplication(); + + _emberMetal.run(_emberViews.jQuery('#the-link'), 'click'); + var indexController = container.lookup('controller:index'); + deepEqual(indexController.getProperties('foo', 'bar'), { foo: '456', bar: 'abc' }, 'controller QP properties updated'); + }); + + QUnit.test('updates controller QP properties on current route when invoked (inferred route)', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to (query-params foo=\'456\') id=\'the-link\'}}Index{{/link-to}}')); + bootApplication(); + + _emberMetal.run(_emberViews.jQuery('#the-link'), 'click'); + var indexController = container.lookup('controller:index'); + deepEqual(indexController.getProperties('foo', 'bar'), { foo: '456', bar: 'abc' }, 'controller QP properties updated'); + }); + + QUnit.test('updates controller QP properties on other route after transitioning to that route', function () { + Router.map(function () { + this.route('about'); + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to \'about\' (query-params baz=\'lol\') id=\'the-link\'}}About{{/link-to}}')); + bootApplication(); + + equal(_emberViews.jQuery('#the-link').attr('href'), '/about?baz=lol'); + _emberMetal.run(_emberViews.jQuery('#the-link'), 'click'); + var aboutController = container.lookup('controller:about'); + deepEqual(aboutController.getProperties('baz', 'bat'), { baz: 'lol', bat: 'borf' }, 'about controller QP properties updated'); + + equal(container.lookup('controller:application').get('currentPath'), 'about'); + }); + + QUnit.test('supplied QP properties can be bound', function () { + var indexController = container.lookup('controller:index'); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to (query-params foo=boundThing) id=\'the-link\'}}Index{{/link-to}}')); + + bootApplication(); + + equal(_emberViews.jQuery('#the-link').attr('href'), '/?foo=OMG'); + _emberMetal.run(indexController, 'set', 'boundThing', 'ASL'); + equal(_emberViews.jQuery('#the-link').attr('href'), '/?foo=ASL'); + }); + + QUnit.test('supplied QP properties can be bound (booleans)', function () { + var indexController = container.lookup('controller:index'); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to (query-params abool=boundThing) id=\'the-link\'}}Index{{/link-to}}')); + + bootApplication(); + + equal(_emberViews.jQuery('#the-link').attr('href'), '/?abool=OMG'); + _emberMetal.run(indexController, 'set', 'boundThing', false); + equal(_emberViews.jQuery('#the-link').attr('href'), '/?abool=false'); + + _emberMetal.run(_emberViews.jQuery('#the-link'), 'click'); + + deepEqual(indexController.getProperties('foo', 'bar', 'abool'), { foo: '123', bar: 'abc', abool: false }); + }); + + QUnit.test('href updates when unsupplied controller QP props change', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#link-to (query-params foo=\'lol\') id=\'the-link\'}}Index{{/link-to}}')); + + bootApplication(); + var indexController = container.lookup('controller:index'); + + equal(_emberViews.jQuery('#the-link').attr('href'), '/?foo=lol'); + _emberMetal.run(indexController, 'set', 'bar', 'BORF'); + equal(_emberViews.jQuery('#the-link').attr('href'), '/?bar=BORF&foo=lol'); + _emberMetal.run(indexController, 'set', 'foo', 'YEAH'); + equal(_emberViews.jQuery('#the-link').attr('href'), '/?bar=BORF&foo=lol'); + }); + + QUnit.test('The {{link-to}} with only query params always transitions to the current route with the query params applied', function () { + // Test harness for bug #12033 + + _emberGlimmer.setTemplate('cars', _emberTemplateCompiler.compile('\n {{#link-to \'cars.create\' id=\'create-link\'}}Create new car{{/link-to}}\n {{#link-to (query-params page=\'2\') id=\'page2-link\'}}Page 2{{/link-to}}\n {{outlet}}\n ')); + + _emberGlimmer.setTemplate('cars/create', _emberTemplateCompiler.compile('{{#link-to \'cars\' id=\'close-link\'}}Close create form{{/link-to}}')); + + Router.map(function () { + this.route('cars', function () { + this.route('create'); + }); + }); + + App.CarsController = _emberRuntime.Controller.extend({ + queryParams: ['page'], + page: 1 + }); + + bootApplication(); + + var carsController = container.lookup('controller:cars'); + + _emberMetal.run(function () { + return router.handleURL('/cars/create'); + }); + + _emberMetal.run(function () { + equal(router.currentRouteName, 'cars.create'); + _emberViews.jQuery('#close-link').click(); + }); + + _emberMetal.run(function () { + equal(router.currentRouteName, 'cars.index'); + equal(router.get('url'), '/cars'); + equal(carsController.get('page'), 1, 'The page query-param is 1'); + _emberViews.jQuery('#page2-link').click(); + }); + + _emberMetal.run(function () { + equal(router.currentRouteName, 'cars.index', 'The active route is still cars'); + equal(router.get('url'), '/cars?page=2', 'The url has been updated'); + equal(carsController.get('page'), 2, 'The query params have been updated'); + }); + }); + + QUnit.test('The {{link-to}} applies activeClass when query params are not changed', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('\n {{#link-to (query-params foo=\'cat\') id=\'cat-link\'}}Index{{/link-to}}\n {{#link-to (query-params foo=\'dog\') id=\'dog-link\'}}Index{{/link-to}}\n {{#link-to \'index\' id=\'change-nothing\'}}Index{{/link-to}}\n ')); + + _emberGlimmer.setTemplate('search', _emberTemplateCompiler.compile('\n {{#link-to (query-params search=\'same\') id=\'same-search\'}}Index{{/link-to}}\n {{#link-to (query-params search=\'change\') id=\'change-search\'}}Index{{/link-to}}\n {{#link-to (query-params search=\'same\' archive=true) id=\'same-search-add-archive\'}}Index{{/link-to}}\n {{#link-to (query-params archive=true) id=\'only-add-archive\'}}Index{{/link-to}}\n {{#link-to (query-params search=\'same\' archive=true) id=\'both-same\'}}Index{{/link-to}}\n {{#link-to (query-params search=\'different\' archive=true) id=\'change-one\'}}Index{{/link-to}}\n {{#link-to (query-params search=\'different\' archive=false) id=\'remove-one\'}}Index{{/link-to}}\n {{outlet}}\n ')); + + _emberGlimmer.setTemplate('search/results', _emberTemplateCompiler.compile('\n {{#link-to (query-params sort=\'title\') id=\'same-sort-child-only\'}}Index{{/link-to}}\n {{#link-to (query-params search=\'same\') id=\'same-search-parent-only\'}}Index{{/link-to}}\n {{#link-to (query-params search=\'change\') id=\'change-search-parent-only\'}}Index{{/link-to}}\n {{#link-to (query-params search=\'same\' sort=\'title\') id=\'same-search-same-sort-child-and-parent\'}}Index{{/link-to}}\n {{#link-to (query-params search=\'same\' sort=\'author\') id=\'same-search-different-sort-child-and-parent\'}}Index{{/link-to}}\n {{#link-to (query-params search=\'change\' sort=\'title\') id=\'change-search-same-sort-child-and-parent\'}}Index{{/link-to}}\n {{#link-to (query-params foo=\'dog\') id=\'dog-link\'}}Index{{/link-to}}\n ')); + + Router.map(function () { + this.route('search', function () { + this.route('results'); + }); + }); + + App.SearchController = _emberRuntime.Controller.extend({ + queryParams: ['search', 'archive'], + search: '', + archive: false + }); + + App.SearchResultsController = _emberRuntime.Controller.extend({ + queryParams: ['sort', 'showDetails'], + sort: 'title', + showDetails: true + }); + + bootApplication(); + + //Basic tests + shouldNotBeActive('#cat-link'); + shouldNotBeActive('#dog-link'); + _emberMetal.run(router, 'handleURL', '/?foo=cat'); + shouldBeActive('#cat-link'); + shouldNotBeActive('#dog-link'); + _emberMetal.run(router, 'handleURL', '/?foo=dog'); + shouldBeActive('#dog-link'); + shouldNotBeActive('#cat-link'); + shouldBeActive('#change-nothing'); + + //Multiple params + _emberMetal.run(function () { + return router.handleURL('/search?search=same'); + }); + shouldBeActive('#same-search'); + shouldNotBeActive('#change-search'); + shouldNotBeActive('#same-search-add-archive'); + shouldNotBeActive('#only-add-archive'); + shouldNotBeActive('#remove-one'); + + _emberMetal.run(function () { + return router.handleURL('/search?search=same&archive=true'); + }); + + shouldBeActive('#both-same'); + shouldNotBeActive('#change-one'); + + //Nested Controllers + _emberMetal.run(function () { + // Note: this is kind of a strange case; sort's default value is 'title', + // so this URL shouldn't have been generated in the first place, but + // we should also be able to gracefully handle these cases. + router.handleURL('/search/results?search=same&sort=title&showDetails=true'); + }); + //shouldBeActive('#same-sort-child-only'); + shouldBeActive('#same-search-parent-only'); + shouldNotBeActive('#change-search-parent-only'); + shouldBeActive('#same-search-same-sort-child-and-parent'); + shouldNotBeActive('#same-search-different-sort-child-and-parent'); + shouldNotBeActive('#change-search-same-sort-child-and-parent'); + }); + + QUnit.test('The {{link-to}} applies active class when query-param is number', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('\n {{#link-to (query-params page=pageNumber) id=\'page-link\'}}Index{{/link-to}}\n ')); + + App.IndexController = _emberRuntime.Controller.extend({ + queryParams: ['page'], + page: 1, + pageNumber: 5 + }); + + bootApplication(); + + shouldNotBeActive('#page-link'); + _emberMetal.run(router, 'handleURL', '/?page=5'); + shouldBeActive('#page-link'); + }); + + QUnit.test('The {{link-to}} applies active class when query-param is array', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('\n {{#link-to (query-params pages=pagesArray) id=\'array-link\'}}Index{{/link-to}}\n {{#link-to (query-params pages=biggerArray) id=\'bigger-link\'}}Index{{/link-to}}\n {{#link-to (query-params pages=emptyArray) id=\'empty-link\'}}Index{{/link-to}}\n ')); + + App.IndexController = _emberRuntime.Controller.extend({ + queryParams: ['pages'], + pages: [], + pagesArray: [1, 2], + biggerArray: [1, 2, 3], + emptyArray: [] + }); + + bootApplication(); + + shouldNotBeActive('#array-link'); + _emberMetal.run(router, 'handleURL', '/?pages=%5B1%2C2%5D'); + shouldBeActive('#array-link'); + shouldNotBeActive('#bigger-link'); + shouldNotBeActive('#empty-link'); + _emberMetal.run(router, 'handleURL', '/?pages=%5B2%2C1%5D'); + shouldNotBeActive('#array-link'); + shouldNotBeActive('#bigger-link'); + shouldNotBeActive('#empty-link'); + _emberMetal.run(router, 'handleURL', '/?pages=%5B1%2C2%2C3%5D'); + shouldBeActive('#bigger-link'); + shouldNotBeActive('#array-link'); + shouldNotBeActive('#empty-link'); + }); + + QUnit.test('The {{link-to}} helper applies active class to parent route', function () { + App.Router.map(function () { + this.route('parent', function () { + this.route('child'); + }); + }); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('\n {{#link-to \'parent\' id=\'parent-link\'}}Parent{{/link-to}}\n {{#link-to \'parent.child\' id=\'parent-child-link\'}}Child{{/link-to}}\n {{#link-to \'parent\' (query-params foo=cat) id=\'parent-link-qp\'}}Parent{{/link-to}}\n {{outlet}}\n ')); + + App.ParentChildController = _emberRuntime.Controller.extend({ + queryParams: ['foo'], + foo: 'bar' + }); + + bootApplication(); + shouldNotBeActive('#parent-link'); + shouldNotBeActive('#parent-child-link'); + shouldNotBeActive('#parent-link-qp'); + _emberMetal.run(router, 'handleURL', '/parent/child?foo=dog'); + shouldBeActive('#parent-link'); + shouldNotBeActive('#parent-link-qp'); + }); + + QUnit.test('The {{link-to}} helper disregards query-params in activeness computation when current-when specified', function () { + App.Router.map(function () { + this.route('parent'); + }); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('\n {{#link-to \'parent\' (query-params page=1) current-when=\'parent\' id=\'app-link\'}}Parent{{/link-to}} {{outlet}}\n ')); + _emberGlimmer.setTemplate('parent', _emberTemplateCompiler.compile('\n {{#link-to \'parent\' (query-params page=1) current-when=\'parent\' id=\'parent-link\'}}Parent{{/link-to}} {{outlet}}\n ')); + + App.ParentController = _emberRuntime.Controller.extend({ + queryParams: ['page'], + page: 1 + }); + + bootApplication(); + equal(_emberViews.jQuery('#app-link').attr('href'), '/parent'); + shouldNotBeActive('#app-link'); + + _emberMetal.run(router, 'handleURL', '/parent?page=2'); + equal(_emberViews.jQuery('#app-link').attr('href'), '/parent'); + shouldBeActive('#app-link'); + equal(_emberViews.jQuery('#parent-link').attr('href'), '/parent'); + shouldBeActive('#parent-link'); + + var parentController = container.lookup('controller:parent'); + equal(parentController.get('page'), 2); + _emberMetal.run(parentController, 'set', 'page', 3); + equal(router.get('location.path'), '/parent?page=3'); + shouldBeActive('#app-link'); + shouldBeActive('#parent-link'); + + _emberViews.jQuery('#app-link').click(); + equal(router.get('location.path'), '/parent'); + }); + + QUnit.test('link-to default query params while in active transition regression test', function () { + App.Router.map(function () { + this.route('foos'); + this.route('bars'); + }); + var foos = _emberRuntime.RSVP.defer(); + var bars = _emberRuntime.RSVP.defer(); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('\n {{link-to \'Foos\' \'foos\' id=\'foos-link\'}}\n {{link-to \'Baz Foos\' \'foos\' (query-params baz=true) id=\'baz-foos-link\'}}\n {{link-to \'Quux Bars\' \'bars\' (query-params quux=true) id=\'bars-link\'}}\n ')); + + App.FoosController = _emberRuntime.Controller.extend({ + queryParams: ['status'], + baz: false + }); + + App.FoosRoute = _emberRouting.Route.extend({ + model: function () { + return foos.promise; + } + }); + + App.BarsController = _emberRuntime.Controller.extend({ + queryParams: ['status'], + quux: false + }); + + App.BarsRoute = _emberRouting.Route.extend({ + model: function () { + return bars.promise; + } + }); + + bootApplication(); + equal(_emberViews.jQuery('#foos-link').attr('href'), '/foos'); + equal(_emberViews.jQuery('#baz-foos-link').attr('href'), '/foos?baz=true'); + equal(_emberViews.jQuery('#bars-link').attr('href'), '/bars?quux=true'); + + equal(router.get('location.path'), ''); + + shouldNotBeActive('#foos-link'); + shouldNotBeActive('#baz-foos-link'); + shouldNotBeActive('#bars-link'); + + _emberMetal.run(_emberViews.jQuery('#bars-link'), 'click'); + shouldNotBeActive('#bars-link'); + + _emberMetal.run(_emberViews.jQuery('#foos-link'), 'click'); + shouldNotBeActive('#foos-link'); + + _emberMetal.run(foos, 'resolve'); + + equal(router.get('location.path'), '/foos'); + shouldBeActive('#foos-link'); + }); +}); +enifed('ember/tests/helpers/link_to_test/link_to_with_query_params_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/helpers/link_to_test'); + test('ember/tests/helpers/link_to_test/link_to_with_query_params_test.js should pass jscs', function () { + ok(true, 'ember/tests/helpers/link_to_test/link_to_with_query_params_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/helpers/link_to_test/link_to_with_query_params_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/helpers/link_to_test'); + QUnit.test('ember/tests/helpers/link_to_test/link_to_with_query_params_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/helpers/link_to_test/link_to_with_query_params_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/homepage_example_test', ['exports', 'ember-routing', 'ember-metal', 'ember-application', 'ember-runtime', 'ember-template-compiler', 'ember-views', 'ember-glimmer'], function (exports, _emberRouting, _emberMetal, _emberApplication, _emberRuntime, _emberTemplateCompiler, _emberViews, _emberGlimmer) { + 'use strict'; + + var App = undefined, + $fixture = undefined; + + function setupExample() { + // setup templates + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    People

      {{#each model as |person|}}
    • Hello, {{person.fullName}}!
    • {{/each}}
    ')); + + App.Person = _emberRuntime.Object.extend({ + firstName: null, + lastName: null, + + fullName: _emberMetal.computed('firstName', 'lastName', function () { + return this.get('firstName') + ' ' + this.get('lastName'); + }) + }); + + App.IndexRoute = _emberRouting.Route.extend({ + model: function () { + var people = _emberRuntime.A([App.Person.create({ + firstName: 'Tom', + lastName: 'Dale' + }), App.Person.create({ + firstName: 'Yehuda', + lastName: 'Katz' + })]); + return people; + } + }); + } + + QUnit.module('Homepage Example', { + setup: function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create({ + name: 'App', + rootElement: '#qunit-fixture' + }); + App.deferReadiness(); + + App.Router.reopen({ + location: 'none' + }); + + App.LoadingRoute = _emberRouting.Route.extend(); + }); + + $fixture = _emberViews.jQuery('#qunit-fixture'); + setupExample(); + }, + + teardown: function () { + _emberMetal.run(function () { + return App.destroy(); + }); + + App = null; + + _emberGlimmer.setTemplates({}); + } + }); + + QUnit.test('The example renders correctly', function () { + _emberMetal.run(App, 'advanceReadiness'); + + equal($fixture.find('h1:contains(People)').length, 1); + equal($fixture.find('li').length, 2); + equal($fixture.find('li:nth-of-type(1)').text(), 'Hello, Tom Dale!'); + equal($fixture.find('li:nth-of-type(2)').text(), 'Hello, Yehuda Katz!'); + }); +}); +enifed('ember/tests/homepage_example_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests'); + test('ember/tests/homepage_example_test.js should pass jscs', function () { + ok(true, 'ember/tests/homepage_example_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/homepage_example_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests'); + QUnit.test('ember/tests/homepage_example_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/homepage_example_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/integration/multiple-app-test', ['exports', 'ember-metal', 'ember-template-compiler', 'ember-application', 'ember-glimmer', 'ember-views'], function (exports, _emberMetal, _emberTemplateCompiler, _emberApplication, _emberGlimmer, _emberViews) { + 'use strict'; + + var App1 = undefined, + App2 = undefined, + actions = undefined; + + function startApp(rootElement) { + var application = undefined; + + _emberMetal.run(function () { + application = _emberApplication.Application.create({ + rootElement: rootElement + }); + application.deferReadiness(); + + application.Router.reopen({ + location: 'none' + }); + + var registry = application.__registry__; + + registry.register('component:special-button', _emberGlimmer.Component.extend({ + actions: { + doStuff: function () { + actions.push(rootElement); + } + } + })); + registry.register('template:application', _emberTemplateCompiler.compile('{{outlet}}', { moduleName: 'application' })); + registry.register('template:index', _emberTemplateCompiler.compile('

    Node 1

    {{special-button}}', { moduleName: 'index' })); + registry.register('template:components/special-button', _emberTemplateCompiler.compile('', { moduleName: 'components/special-button' })); + }); + + return application; + } + + function handleURL(application, path) { + var router = application.__container__.lookup('router:main'); + return _emberMetal.run(router, 'handleURL', path); + } + + QUnit.module('View Integration', { + setup: function () { + actions = []; + _emberViews.jQuery('#qunit-fixture').html('
    '); + App1 = startApp('#app-1'); + App2 = startApp('#app-2'); + }, + + teardown: function () { + _emberMetal.run(App1, 'destroy'); + _emberMetal.run(App2, 'destroy'); + App1 = App2 = null; + } + }); + + QUnit.test('booting multiple applications can properly handle events', function (assert) { + _emberMetal.run(App1, 'advanceReadiness'); + _emberMetal.run(App2, 'advanceReadiness'); + + handleURL(App1, '/'); + handleURL(App2, '/'); + + _emberViews.jQuery('#app-2 .do-stuff').click(); + _emberViews.jQuery('#app-1 .do-stuff').click(); + + assert.deepEqual(actions, ['#app-2', '#app-1']); + }); +}); +enifed('ember/tests/integration/multiple-app-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/integration'); + test('ember/tests/integration/multiple-app-test.js should pass jscs', function () { + ok(true, 'ember/tests/integration/multiple-app-test.js should pass jscs.'); + }); +}); +enifed('ember/tests/integration/multiple-app-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/integration'); + QUnit.test('ember/tests/integration/multiple-app-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/integration/multiple-app-test.js should pass jshint.'); + }); +}); +enifed('ember/tests/reexports_test', ['exports', 'ember/index', 'internal-test-helpers', 'ember-metal'], function (exports, _emberIndex, _internalTestHelpers, _emberMetal) { + 'use strict'; + + QUnit.module('ember reexports'); + + [ + // ember-utils + ['getOwner', 'ember-utils', 'getOwner'], ['setOwner', 'ember-utils', 'setOwner'], + // ['assign', 'ember-metal'], TODO: fix this test, we use `Object.assign` if present + ['GUID_KEY', 'ember-utils'], ['uuid', 'ember-utils'], ['generateGuid', 'ember-utils'], ['guidFor', 'ember-utils'], ['inspect', 'ember-utils'], ['makeArray', 'ember-utils'], ['canInvoke', 'ember-utils'], ['tryInvoke', 'ember-utils'], ['wrap', 'ember-utils'], ['applyStr', 'ember-utils'], + + // ember-environment + // ['ENV', 'ember-environment', 'ENV'], TODO: fix this, its failing because we are hitting the getter + + // container + ['Registry', 'container', 'Registry'], ['Container', 'container', 'Container'], + + // ember-metal + ['computed', 'ember-metal'], ['computed.alias', 'ember-metal', 'alias'], ['ComputedProperty', 'ember-metal'], ['cacheFor', 'ember-metal'], ['deprecate', 'ember-metal'], ['deprecateFunc', 'ember-metal'], ['assert', 'ember-metal'], ['warn', 'ember-metal'], ['debug', 'ember-metal'], ['runInDebug', 'ember-metal'], ['merge', 'ember-metal'], ['instrument', 'ember-metal'], ['Instrumentation.instrument', 'ember-metal', 'instrument'], ['Instrumentation.subscribe', 'ember-metal', 'instrumentationSubscribe'], ['Instrumentation.unsubscribe', 'ember-metal', 'instrumentationUnsubscribe'], ['Instrumentation.reset', 'ember-metal', 'instrumentationReset'], ['testing', 'ember-metal', { get: 'isTesting', set: 'setTesting' }], ['onerror', 'ember-metal', { get: 'getOnerror', set: 'setOnerror' }], + // ['create'], TODO: figure out what to do here + // ['keys'], TODO: figure out what to do here + ['FEATURES', 'ember-metal'], ['FEATURES.isEnabled', 'ember-metal', 'isFeatureEnabled'], ['Error', 'ember-metal'], ['META_DESC', 'ember-metal'], ['meta', 'ember-metal'], ['get', 'ember-metal'], ['set', 'ember-metal'], ['_getPath', 'ember-metal'], ['getWithDefault', 'ember-metal'], ['trySet', 'ember-metal'], ['_Cache', 'ember-metal', 'Cache'], ['on', 'ember-metal'], ['addListener', 'ember-metal'], ['removeListener', 'ember-metal'], ['_suspendListener', 'ember-metal', 'suspendListener'], ['_suspendListeners', 'ember-metal', 'suspendListeners'], ['sendEvent', 'ember-metal'], ['hasListeners', 'ember-metal'], ['watchedEvents', 'ember-metal'], ['listenersFor', 'ember-metal'], ['accumulateListeners', 'ember-metal'], ['isNone', 'ember-metal'], ['isEmpty', 'ember-metal'], ['isBlank', 'ember-metal'], ['isPresent', 'ember-metal'], ['_Backburner', 'backburner', 'default'], ['run', 'ember-metal'], ['_ObserverSet', 'ember-metal', 'ObserverSet'], ['propertyWillChange', 'ember-metal'], ['propertyDidChange', 'ember-metal'], ['overrideChains', 'ember-metal'], ['beginPropertyChanges', 'ember-metal'], ['beginPropertyChanges', 'ember-metal'], ['endPropertyChanges', 'ember-metal'], ['changeProperties', 'ember-metal'], ['defineProperty', 'ember-metal'], ['watchKey', 'ember-metal'], ['unwatchKey', 'ember-metal'], ['removeChainWatcher', 'ember-metal'], ['_ChainNode', 'ember-metal', 'ChainNode'], ['finishChains', 'ember-metal'], ['watchPath', 'ember-metal'], ['unwatchPath', 'ember-metal'], ['watch', 'ember-metal'], ['isWatching', 'ember-metal'], ['unwatch', 'ember-metal'], ['destroy', 'ember-metal'], ['libraries', 'ember-metal'], ['OrderedSet', 'ember-metal'], ['Map', 'ember-metal'], ['MapWithDefault', 'ember-metal'], ['getProperties', 'ember-metal'], ['setProperties', 'ember-metal'], ['expandProperties', 'ember-metal'], ['NAME_KEY', 'ember-metal'], ['addObserver', 'ember-metal'], ['observersFor', 'ember-metal'], ['removeObserver', 'ember-metal'], ['_suspendObserver', 'ember-metal'], ['_suspendObservers', 'ember-metal'], ['required', 'ember-metal'], ['aliasMethod', 'ember-metal'], ['observer', 'ember-metal'], ['immediateObserver', 'ember-metal', '_immediateObserver'], ['mixin', 'ember-metal'], ['Mixin', 'ember-metal'], ['bind', 'ember-metal'], ['Binding', 'ember-metal'], ['isGlobalPath', 'ember-metal'], + + // ember-views + ['$', 'ember-views', 'jQuery'], ['ViewUtils.isSimpleClick', 'ember-views', 'isSimpleClick'], ['ViewUtils.getViewElement', 'ember-views', 'getViewElement'], ['ViewUtils.getViewBounds', 'ember-views', 'getViewBounds'], ['ViewUtils.getViewClientRects', 'ember-views', 'getViewClientRects'], ['ViewUtils.getViewBoundingClientRect', 'ember-views', 'getViewBoundingClientRect'], ['ViewUtils.getRootViews', 'ember-views', 'getRootViews'], ['ViewUtils.getChildViews', 'ember-views', 'getChildViews'], ['TextSupport', 'ember-views'], ['ComponentLookup', 'ember-views'], ['EventDispatcher', 'ember-views'], + + // ember-glimmer + ['Component', 'ember-glimmer', 'Component'], ['Helper', 'ember-glimmer', 'Helper'], ['Helper.helper', 'ember-glimmer', 'helper'], ['Checkbox', 'ember-glimmer', 'Checkbox'], ['LinkComponent', 'ember-glimmer', 'LinkComponent'], ['TextArea', 'ember-glimmer', 'TextArea'], ['TextField', 'ember-glimmer', 'TextField'], ['TEMPLATES', 'ember-glimmer', { get: 'getTemplates', set: 'setTemplates' }], ['Handlebars.template', 'ember-glimmer', 'template'], ['Handlebars.SafeString', 'ember-glimmer', { get: '_getSafeString' }], ['Handlebars.Utils.escapeExpression', 'ember-glimmer', 'escapeExpression'], ['String.htmlSafe', 'ember-glimmer', 'htmlSafe'], ['HTMLBars.makeBoundHelper', 'ember-glimmer', 'makeBoundHelper'], + + // ember-runtime + ['_RegistryProxyMixin', 'ember-runtime', 'RegistryProxyMixin'], ['_ContainerProxyMixin', 'ember-runtime', 'ContainerProxyMixin'], ['Object', 'ember-runtime'], ['String', 'ember-runtime'], ['compare', 'ember-runtime'], ['copy', 'ember-runtime'], ['isEqual', 'ember-runtime'], ['inject', 'ember-runtime'], ['Array', 'ember-runtime'], ['Comparable', 'ember-runtime'], ['Namespace', 'ember-runtime'], ['Enumerable', 'ember-runtime'], ['ArrayProxy', 'ember-runtime'], ['ObjectProxy', 'ember-runtime'], ['ActionHandler', 'ember-runtime'], ['CoreObject', 'ember-runtime'], ['NativeArray', 'ember-runtime'], ['Copyable', 'ember-runtime'], ['Freezable', 'ember-runtime'], ['FROZEN_ERROR', 'ember-runtime'], ['MutableEnumerable', 'ember-runtime'], ['MutableArray', 'ember-runtime'], ['TargetActionSupport', 'ember-runtime'], ['Evented', 'ember-runtime'], ['PromiseProxyMixin', 'ember-runtime'], ['Observable', 'ember-runtime'], ['typeOf', 'ember-runtime'], ['isArray', 'ember-runtime'], ['Object', 'ember-runtime'], ['onLoad', 'ember-runtime'], ['runLoadHooks', 'ember-runtime'], ['Controller', 'ember-runtime'], ['ControllerMixin', 'ember-runtime'], ['Service', 'ember-runtime'], ['_ProxyMixin', 'ember-runtime'], ['RSVP', 'ember-runtime'], ['STRINGS', 'ember-runtime', { get: 'getStrings', set: 'setStrings' }], ['BOOTED', 'ember-runtime', { get: 'isNamespaceSearchDisabled', set: 'setNamespaceSearchDisabled' }], + + // ember-routing + ['Location', 'ember-routing'], ['AutoLocation', 'ember-routing'], ['HashLocation', 'ember-routing'], ['HistoryLocation', 'ember-routing'], ['NoneLocation', 'ember-routing'], ['controllerFor', 'ember-routing'], ['generateControllerFactory', 'ember-routing'], ['generateController', 'ember-routing'], ['RouterDSL', 'ember-routing'], ['Router', 'ember-routing'], ['Route', 'ember-routing'], + + // ember-application + ['Application', 'ember-application'], ['ApplicationInstance', 'ember-application'], ['Engine', 'ember-application'], ['EngineInstance', 'ember-application'], ['Resolver', 'ember-application'], ['DefaultResolver', 'ember-application', 'Resolver'], + + // ember-extension-support + ['DataAdapter', 'ember-extension-support'], ['ContainerDebugAdapter', 'ember-extension-support']].forEach(function (reexport) { + var path = reexport[0]; + var moduleId = reexport[1]; + var exportName = reexport[2]; + + // default path === exportName if none present + if (!exportName) { + exportName = path; + } + + QUnit.test('Ember.' + path + ' exports correctly', function (assert) { + _internalTestHelpers.confirmExport(_emberIndex.default, assert, path, moduleId, exportName); + }); + }); + + if (true) { + QUnit.test('Ember.String.isHTMLSafe exports correctly', function (assert) { + _internalTestHelpers.confirmExport(_emberIndex.default, assert, 'String.isHTMLSafe', 'ember-glimmer', 'isHTMLSafe'); + }); + } + + if (false) { + QUnit.test('Ember.WeakMap exports correctly', function (assert) { + _internalTestHelpers.confirmExport(_emberIndex.default, assert, 'WeakMap', 'ember-metal', 'WeakMap'); + }); + } +}); +enifed('ember/tests/reexports_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests'); + test('ember/tests/reexports_test.js should pass jscs', function () { + ok(true, 'ember/tests/reexports_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/reexports_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests'); + QUnit.test('ember/tests/reexports_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/reexports_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-console', 'ember-runtime', 'ember-routing', 'ember-metal', 'ember-glimmer', 'ember-views', 'ember-template-compiler', 'ember-application', 'router'], function (exports, _emberUtils, _emberConsole, _emberRuntime, _emberRouting, _emberMetal, _emberGlimmer, _emberViews, _emberTemplateCompiler, _emberApplication, _router) { + 'use strict'; + + var trim = _emberViews.jQuery.trim; + + var Router = undefined, + App = undefined, + router = undefined, + registry = undefined, + container = undefined, + originalLoggerError = undefined; + + function bootApplication() { + router = container.lookup('router:main'); + _emberMetal.run(App, 'advanceReadiness'); + } + + function handleURL(path) { + return _emberMetal.run(function () { + return router.handleURL(path).then(function (value) { + ok(true, 'url: `' + path + '` was handled'); + return value; + }, function (reason) { + ok(false, 'failed to visit:`' + path + '` reason: `' + QUnit.jsDump.parse(reason)); + throw reason; + }); + }); + } + + function handleURLAborts(path) { + _emberMetal.run(function () { + router.handleURL(path).then(function (value) { + ok(false, 'url: `' + path + '` was NOT to be handled'); + }, function (reason) { + ok(reason && reason.message === 'TransitionAborted', 'url: `' + path + '` was to be aborted'); + }); + }); + } + + function handleURLRejectsWith(path, expectedReason) { + _emberMetal.run(function () { + router.handleURL(path).then(function (value) { + ok(false, 'expected handleURLing: `' + path + '` to fail'); + }, function (reason) { + equal(reason, expectedReason); + }); + }); + } + + QUnit.module('Basic Routing', { + setup: function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create({ + name: 'App', + rootElement: '#qunit-fixture' + }); + + App.deferReadiness(); + + App.Router.reopen({ + location: 'none' + }); + + Router = App.Router; + + App.LoadingRoute = _emberRouting.Route.extend({}); + + registry = App.__registry__; + container = App.__container__; + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('home', _emberTemplateCompiler.compile('

    Hours

    ')); + _emberGlimmer.setTemplate('homepage', _emberTemplateCompiler.compile('

    Megatroll

    {{model.home}}

    ')); + _emberGlimmer.setTemplate('camelot', _emberTemplateCompiler.compile('

    Is a silly place

    ')); + + originalLoggerError = _emberConsole.default.error; + }); + }, + + teardown: function () { + _emberMetal.run(function () { + App.destroy(); + App = null; + + _emberGlimmer.setTemplates({}); + _emberConsole.default.error = originalLoggerError; + }); + } + }); + + QUnit.test('warn on URLs not included in the route set', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + bootApplication(); + + expectAssertion(function () { + return _emberMetal.run(function () { + return router.handleURL('/what-is-this-i-dont-even'); + }); + }, 'The URL \'/what-is-this-i-dont-even\' did not match any routes in your application'); + }); + + QUnit.test('The Homepage', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({}); + + var currentPath = undefined; + + App.ApplicationController = _emberRuntime.Controller.extend({ + currentPathDidChange: _emberMetal.observer('currentPath', function () { + currentPath = _emberMetal.get(this, 'currentPath'); + }) + }); + + bootApplication(); + + equal(currentPath, 'home'); + equal(_emberViews.jQuery('h3:contains(Hours)', '#qunit-fixture').length, 1, 'The home template was rendered'); + }); + + QUnit.test('The Home page and the Camelot page with multiple Router.map calls', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + Router.map(function () { + this.route('camelot', { path: '/camelot' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({}); + + App.CamelotRoute = _emberRouting.Route.extend({}); + + var currentPath = undefined; + + App.ApplicationController = _emberRuntime.Controller.extend({ + currentPathDidChange: _emberMetal.observer('currentPath', function () { + currentPath = _emberMetal.get(this, 'currentPath'); + }) + }); + + App.CamelotController = _emberRuntime.Controller.extend({ + currentPathDidChange: _emberMetal.observer('currentPath', function () { + currentPath = _emberMetal.get(this, 'currentPath'); + }) + }); + + bootApplication(); + + handleURL('/camelot'); + + equal(currentPath, 'camelot'); + equal(_emberViews.jQuery('h3:contains(silly)', '#qunit-fixture').length, 1, 'The camelot template was rendered'); + + handleURL('/'); + + equal(currentPath, 'home'); + equal(_emberViews.jQuery('h3:contains(Hours)', '#qunit-fixture').length, 1, 'The home template was rendered'); + }); + + QUnit.test('The Homepage with explicit template name in renderTemplate', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render('homepage'); + } + }); + + bootApplication(); + + equal(_emberViews.jQuery('h3:contains(Megatroll)', '#qunit-fixture').length, 1, 'The homepage template was rendered'); + }); + + QUnit.test('An alternate template will pull in an alternate controller', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render('homepage'); + } + }); + + App.HomepageController = _emberRuntime.Controller.extend({ + model: { + home: 'Comes from homepage' + } + }); + + bootApplication(); + + equal(_emberViews.jQuery('h3:contains(Megatroll) + p:contains(Comes from homepage)', '#qunit-fixture').length, 1, 'The homepage template was rendered'); + }); + + QUnit.test('An alternate template will pull in an alternate controller instead of controllerName', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + controllerName: 'foo', + renderTemplate: function () { + this.render('homepage'); + } + }); + + App.FooController = _emberRuntime.Controller.extend({ + model: { + home: 'Comes from Foo' + } + }); + + App.HomepageController = _emberRuntime.Controller.extend({ + model: { + home: 'Comes from homepage' + } + }); + + bootApplication(); + + equal(_emberViews.jQuery('h3:contains(Megatroll) + p:contains(Comes from homepage)', '#qunit-fixture').length, 1, 'The homepage template was rendered'); + }); + + QUnit.test('The template will pull in an alternate controller via key/value', function () { + Router.map(function () { + this.route('homepage', { path: '/' }); + }); + + App.HomepageRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render({ controller: 'home' }); + } + }); + + App.HomeController = _emberRuntime.Controller.extend({ + model: { + home: 'Comes from home.' + } + }); + + bootApplication(); + + equal(_emberViews.jQuery('h3:contains(Megatroll) + p:contains(Comes from home.)', '#qunit-fixture').length, 1, 'The homepage template was rendered from data from the HomeController'); + }); + + QUnit.test('The Homepage with explicit template name in renderTemplate and controller', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeController = _emberRuntime.Controller.extend({ + model: { + home: 'YES I AM HOME' + } + }); + + App.HomeRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render('homepage'); + } + }); + + bootApplication(); + + equal(_emberViews.jQuery('h3:contains(Megatroll) + p:contains(YES I AM HOME)', '#qunit-fixture').length, 1, 'The homepage template was rendered'); + }); + + QUnit.test('Model passed via renderTemplate model is set as controller\'s model', function () { + _emberGlimmer.setTemplate('bio', _emberTemplateCompiler.compile('

    {{model.name}}

    ')); + + App.BioController = _emberRuntime.Controller.extend(); + + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render('bio', { + model: { name: 'emberjs' } + }); + } + }); + + bootApplication(); + + equal(_emberViews.jQuery('p:contains(emberjs)', '#qunit-fixture').length, 1, 'Passed model was set as controllers model'); + }); + + QUnit.test('render uses templateName from route', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + _emberGlimmer.setTemplate('the_real_home_template', _emberTemplateCompiler.compile('

    THIS IS THE REAL HOME

    ')); + + App.HomeController = _emberRuntime.Controller.extend(); + App.HomeRoute = _emberRouting.Route.extend({ + templateName: 'the_real_home_template' + }); + + bootApplication(); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'THIS IS THE REAL HOME', 'The homepage template was rendered'); + }); + + QUnit.test('defining templateName allows other templates to be rendered', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + _emberGlimmer.setTemplate('alert', _emberTemplateCompiler.compile('
    Invader!
    ')); + _emberGlimmer.setTemplate('the_real_home_template', _emberTemplateCompiler.compile('

    THIS IS THE REAL HOME

    {{outlet \'alert\'}}')); + + App.HomeController = _emberRuntime.Controller.extend(); + App.HomeRoute = _emberRouting.Route.extend({ + templateName: 'the_real_home_template', + actions: { + showAlert: function () { + this.render('alert', { + into: 'home', + outlet: 'alert' + }); + } + } + }); + + bootApplication(); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'THIS IS THE REAL HOME', 'The homepage template was rendered'); + + _emberMetal.run(function () { + return router.send('showAlert'); + }); + + equal(_emberViews.jQuery('.alert-box', '#qunit-fixture').text(), 'Invader!', 'Template for alert was render into outlet'); + }); + + QUnit.test('templateName is still used when calling render with no name and options', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + _emberGlimmer.setTemplate('alert', _emberTemplateCompiler.compile('
    Invader!
    ')); + _emberGlimmer.setTemplate('home', _emberTemplateCompiler.compile('

    THIS IS THE REAL HOME

    {{outlet \'alert\'}}')); + + App.HomeRoute = _emberRouting.Route.extend({ + templateName: 'alert', + renderTemplate: function () { + this.render({}); + } + }); + + bootApplication(); + + equal(_emberViews.jQuery('.alert-box', '#qunit-fixture').text(), 'Invader!', 'default templateName was rendered into outlet'); + }); + + QUnit.test('The Homepage with a `setupController` hook', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + setupController: function (controller) { + _emberMetal.set(controller, 'hours', _emberRuntime.A(['Monday through Friday: 9am to 5pm', 'Saturday: Noon to Midnight', 'Sunday: Noon to 6pm'])); + } + }); + + _emberGlimmer.setTemplate('home', _emberTemplateCompiler.compile('
      {{#each hours as |entry|}}
    • {{entry}}
    • {{/each}}
    ')); + + bootApplication(); + + equal(_emberViews.jQuery('ul li', '#qunit-fixture').eq(2).text(), 'Sunday: Noon to 6pm', 'The template was rendered with the hours context'); + }); + + QUnit.test('The route controller is still set when overriding the setupController hook', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + setupController: function (controller) { + // no-op + // importantly, we are not calling this._super here + } + }); + + registry.register('controller:home', _emberRuntime.Controller.extend()); + + bootApplication(); + + deepEqual(container.lookup('route:home').controller, container.lookup('controller:home'), 'route controller is the home controller'); + }); + + QUnit.test('The route controller can be specified via controllerName', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + _emberGlimmer.setTemplate('home', _emberTemplateCompiler.compile('

    {{myValue}}

    ')); + + App.HomeRoute = _emberRouting.Route.extend({ + controllerName: 'myController' + }); + + registry.register('controller:myController', _emberRuntime.Controller.extend({ + myValue: 'foo' + })); + + bootApplication(); + + deepEqual(container.lookup('route:home').controller, container.lookup('controller:myController'), 'route controller is set by controllerName'); + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'foo', 'The homepage template was rendered with data from the custom controller'); + }); + + QUnit.test('The route controller specified via controllerName is used in render', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + _emberGlimmer.setTemplate('alternative_home', _emberTemplateCompiler.compile('

    alternative home: {{myValue}}

    ')); + + App.HomeRoute = _emberRouting.Route.extend({ + controllerName: 'myController', + renderTemplate: function () { + this.render('alternative_home'); + } + }); + + registry.register('controller:myController', _emberRuntime.Controller.extend({ + myValue: 'foo' + })); + + bootApplication(); + + deepEqual(container.lookup('route:home').controller, container.lookup('controller:myController'), 'route controller is set by controllerName'); + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'alternative home: foo', 'The homepage template was rendered with data from the custom controller'); + }); + + QUnit.test('The route controller specified via controllerName is used in render even when a controller with the routeName is available', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + _emberGlimmer.setTemplate('home', _emberTemplateCompiler.compile('

    home: {{myValue}}

    ')); + + App.HomeRoute = _emberRouting.Route.extend({ + controllerName: 'myController' + }); + + registry.register('controller:home', _emberRuntime.Controller.extend({ + myValue: 'home' + })); + + registry.register('controller:myController', _emberRuntime.Controller.extend({ + myValue: 'myController' + })); + + bootApplication(); + + deepEqual(container.lookup('route:home').controller, container.lookup('controller:myController'), 'route controller is set by controllerName'); + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'home: myController', 'The homepage template was rendered with data from the custom controller'); + }); + + QUnit.test('The Homepage with a `setupController` hook modifying other controllers', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + setupController: function (controller) { + _emberMetal.set(this.controllerFor('home'), 'hours', _emberRuntime.A(['Monday through Friday: 9am to 5pm', 'Saturday: Noon to Midnight', 'Sunday: Noon to 6pm'])); + } + }); + + _emberGlimmer.setTemplate('home', _emberTemplateCompiler.compile('
      {{#each hours as |entry|}}
    • {{entry}}
    • {{/each}}
    ')); + + bootApplication(); + + equal(_emberViews.jQuery('ul li', '#qunit-fixture').eq(2).text(), 'Sunday: Noon to 6pm', 'The template was rendered with the hours context'); + }); + + QUnit.test('The Homepage with a computed context that does not get overridden', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeController = _emberRuntime.Controller.extend({ + model: _emberMetal.computed(function () { + return _emberRuntime.A(['Monday through Friday: 9am to 5pm', 'Saturday: Noon to Midnight', 'Sunday: Noon to 6pm']); + }) + }); + + _emberGlimmer.setTemplate('home', _emberTemplateCompiler.compile('
      {{#each model as |passage|}}
    • {{passage}}
    • {{/each}}
    ')); + + bootApplication(); + + equal(_emberViews.jQuery('ul li', '#qunit-fixture').eq(2).text(), 'Sunday: Noon to 6pm', 'The template was rendered with the context intact'); + }); + + QUnit.test('The Homepage getting its controller context via model', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.A(['Monday through Friday: 9am to 5pm', 'Saturday: Noon to Midnight', 'Sunday: Noon to 6pm']); + }, + + setupController: function (controller, model) { + equal(this.controllerFor('home'), controller); + + _emberMetal.set(this.controllerFor('home'), 'hours', model); + } + }); + + _emberGlimmer.setTemplate('home', _emberTemplateCompiler.compile('
      {{#each hours as |entry|}}
    • {{entry}}
    • {{/each}}
    ')); + + bootApplication(); + + equal(_emberViews.jQuery('ul li', '#qunit-fixture').eq(2).text(), 'Sunday: Noon to 6pm', 'The template was rendered with the hours context'); + }); + + QUnit.test('The Specials Page getting its controller context by deserializing the params hash', function () { + Router.map(function () { + this.route('home', { path: '/' }); + this.route('special', { path: '/specials/:menu_item_id' }); + }); + + App.SpecialRoute = _emberRouting.Route.extend({ + model: function (params) { + return _emberRuntime.Object.create({ + menuItemId: params.menu_item_id + }); + }, + + setupController: function (controller, model) { + _emberMetal.set(controller, 'model', model); + } + }); + + _emberGlimmer.setTemplate('special', _emberTemplateCompiler.compile('

    {{model.menuItemId}}

    ')); + + bootApplication(); + + registry.register('controller:special', _emberRuntime.Controller.extend()); + + handleURL('/specials/1'); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), '1', 'The model was used to render the template'); + }); + + QUnit.test('The Specials Page defaults to looking models up via `find`', function () { + Router.map(function () { + this.route('home', { path: '/' }); + this.route('special', { path: '/specials/:menu_item_id' }); + }); + + App.MenuItem = _emberRuntime.Object.extend(); + App.MenuItem.reopenClass({ + find: function (id) { + return App.MenuItem.create({ + id: id + }); + } + }); + + App.SpecialRoute = _emberRouting.Route.extend({ + setupController: function (controller, model) { + _emberMetal.set(controller, 'model', model); + } + }); + + _emberGlimmer.setTemplate('special', _emberTemplateCompiler.compile('

    {{model.id}}

    ')); + + bootApplication(); + + registry.register('controller:special', _emberRuntime.Controller.extend()); + + handleURL('/specials/1'); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), '1', 'The model was used to render the template'); + }); + + QUnit.test('The Special Page returning a promise puts the app into a loading state until the promise is resolved', function () { + Router.map(function () { + this.route('home', { path: '/' }); + this.route('special', { path: '/specials/:menu_item_id' }); + }); + + var menuItem = undefined, + resolve = undefined; + + App.MenuItem = _emberRuntime.Object.extend(); + App.MenuItem.reopenClass({ + find: function (id) { + menuItem = App.MenuItem.create({ id: id }); + + return new _emberRuntime.RSVP.Promise(function (res) { + resolve = res; + }); + } + }); + + App.LoadingRoute = _emberRouting.Route.extend({}); + + App.SpecialRoute = _emberRouting.Route.extend({ + setupController: function (controller, model) { + _emberMetal.set(controller, 'model', model); + } + }); + + _emberGlimmer.setTemplate('special', _emberTemplateCompiler.compile('

    {{model.id}}

    ')); + + _emberGlimmer.setTemplate('loading', _emberTemplateCompiler.compile('

    LOADING!

    ')); + + bootApplication(); + + registry.register('controller:special', _emberRuntime.Controller.extend()); + + handleURL('/specials/1'); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'LOADING!', 'The app is in the loading state'); + + _emberMetal.run(function () { + return resolve(menuItem); + }); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), '1', 'The app is now in the specials state'); + }); + + QUnit.test('The loading state doesn\'t get entered for promises that resolve on the same run loop', function () { + Router.map(function () { + this.route('home', { path: '/' }); + this.route('special', { path: '/specials/:menu_item_id' }); + }); + + App.MenuItem = _emberRuntime.Object.extend(); + App.MenuItem.reopenClass({ + find: function (id) { + return { id: id }; + } + }); + + App.LoadingRoute = _emberRouting.Route.extend({ + enter: function () { + ok(false, 'LoadingRoute shouldn\'t have been entered.'); + } + }); + + App.SpecialRoute = _emberRouting.Route.extend({ + setupController: function (controller, model) { + _emberMetal.set(controller, 'model', model); + } + }); + + _emberGlimmer.setTemplate('special', _emberTemplateCompiler.compile('

    {{model.id}}

    ')); + + _emberGlimmer.setTemplate('loading', _emberTemplateCompiler.compile('

    LOADING!

    ')); + + bootApplication(); + + registry.register('controller:special', _emberRuntime.Controller.extend()); + + handleURL('/specials/1'); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), '1', 'The app is now in the specials state'); + }); + + /* + asyncTest("The Special page returning an error fires the error hook on SpecialRoute", function() { + Router.map(function() { + this.route("home", { path: "/" }); + this.route("special", { path: "/specials/:menu_item_id" }); + }); + + let menuItem; + + App.MenuItem = Ember.Object.extend(); + App.MenuItem.reopenClass({ + find: function(id) { + menuItem = App.MenuItem.create({ id: id }); + run.later(function() { menuItem.resolve(menuItem); }, 1); + return menuItem; + } + }); + + App.SpecialRoute = Route.extend({ + setup: function() { + throw 'Setup error'; + }, + actions: { + error: function(reason) { + equal(reason, 'Setup error'); + QUnit.start(); + } + } + }); + + bootApplication(); + + handleURLRejectsWith('/specials/1', 'Setup error'); + }); + */ + + QUnit.test('The Special page returning an error invokes SpecialRoute\'s error handler', function () { + Router.map(function () { + this.route('home', { path: '/' }); + this.route('special', { path: '/specials/:menu_item_id' }); + }); + + var menuItem = undefined, + promise = undefined, + resolve = undefined; + + App.MenuItem = _emberRuntime.Object.extend(); + App.MenuItem.reopenClass({ + find: function (id) { + menuItem = App.MenuItem.create({ id: id }); + promise = new _emberRuntime.RSVP.Promise(function (res) { + resolve = res; + }); + + return promise; + } + }); + + App.SpecialRoute = _emberRouting.Route.extend({ + setup: function () { + throw 'Setup error'; + }, + actions: { + error: function (reason) { + equal(reason, 'Setup error', 'SpecialRoute#error received the error thrown from setup'); + return true; + } + } + }); + + bootApplication(); + + handleURLRejectsWith('/specials/1', 'Setup error'); + + _emberMetal.run(function () { + return resolve(menuItem); + }); + }); + + var testOverridableErrorHandler = function (handlersName) { + expect(2); + + Router.map(function () { + this.route('home', { path: '/' }); + this.route('special', { path: '/specials/:menu_item_id' }); + }); + + var menuItem = undefined, + resolve = undefined; + + App.MenuItem = _emberRuntime.Object.extend(); + App.MenuItem.reopenClass({ + find: function (id) { + menuItem = App.MenuItem.create({ id: id }); + return new _emberRuntime.RSVP.Promise(function (res) { + resolve = res; + }); + } + }); + + var attrs = {}; + attrs[handlersName] = { + error: function (reason) { + equal(reason, 'Setup error', 'error was correctly passed to custom ApplicationRoute handler'); + return true; + } + }; + + App.ApplicationRoute = _emberRouting.Route.extend(attrs); + + App.SpecialRoute = _emberRouting.Route.extend({ + setup: function () { + throw 'Setup error'; + } + }); + + bootApplication(); + + handleURLRejectsWith('/specials/1', 'Setup error'); + + _emberMetal.run(function () { + return resolve(menuItem); + }); + }; + + QUnit.test('ApplicationRoute\'s default error handler can be overridden', function () { + testOverridableErrorHandler('actions'); + }); + + QUnit.asyncTest('Moving from one page to another triggers the correct callbacks', function () { + expect(3); + + Router.map(function () { + this.route('home', { path: '/' }); + this.route('special', { path: '/specials/:menu_item_id' }); + }); + + App.MenuItem = _emberRuntime.Object.extend(); + + App.SpecialRoute = _emberRouting.Route.extend({ + setupController: function (controller, model) { + _emberMetal.set(controller, 'model', model); + } + }); + + _emberGlimmer.setTemplate('home', _emberTemplateCompiler.compile('

    Home

    ')); + + _emberGlimmer.setTemplate('special', _emberTemplateCompiler.compile('

    {{model.id}}

    ')); + + bootApplication(); + + registry.register('controller:special', _emberRuntime.Controller.extend()); + + var transition = handleURL('/'); + + _emberMetal.run(function () { + transition.then(function () { + equal(_emberViews.jQuery('h3', '#qunit-fixture').text(), 'Home', 'The app is now in the initial state'); + + var promiseContext = App.MenuItem.create({ id: 1 }); + _emberMetal.run.later(function () { + return _emberRuntime.RSVP.resolve(promiseContext); + }, 1); + + return router.transitionTo('special', promiseContext); + }).then(function (result) { + deepEqual(router.location.path, '/specials/1'); + QUnit.start(); + }); + }); + }); + + QUnit.asyncTest('Nested callbacks are not exited when moving to siblings', function () { + Router.map(function () { + this.route('root', { path: '/' }, function () { + this.route('special', { path: '/specials/:menu_item_id', resetNamespace: true }); + }); + }); + + App.RootRoute = _emberRouting.Route.extend({ + model: function () { + rootModel++; + return this._super.apply(this, arguments); + }, + + setupController: function () { + rootSetup++; + }, + + renderTemplate: function () { + rootRender++; + }, + + serialize: function () { + rootSerialize++; + return this._super.apply(this, arguments); + } + }); + + var currentPath = undefined; + + App.ApplicationController = _emberRuntime.Controller.extend({ + currentPathDidChange: _emberMetal.observer('currentPath', function () { + currentPath = _emberMetal.get(this, 'currentPath'); + }) + }); + + var menuItem = undefined; + + App.MenuItem = _emberRuntime.Object.extend(); + App.MenuItem.reopenClass({ + find: function (id) { + menuItem = App.MenuItem.create({ id: id }); + return menuItem; + } + }); + + App.LoadingRoute = _emberRouting.Route.extend({}); + + App.HomeRoute = _emberRouting.Route.extend({}); + + App.SpecialRoute = _emberRouting.Route.extend({ + setupController: function (controller, model) { + _emberMetal.set(controller, 'model', model); + } + }); + + _emberGlimmer.setTemplate('root/index', _emberTemplateCompiler.compile('

    Home

    ')); + + _emberGlimmer.setTemplate('special', _emberTemplateCompiler.compile('

    {{model.id}}

    ')); + + _emberGlimmer.setTemplate('loading', _emberTemplateCompiler.compile('

    LOADING!

    ')); + + var rootSetup = 0; + var rootRender = 0; + var rootModel = 0; + var rootSerialize = 0; + + bootApplication(); + + registry.register('controller:special', _emberRuntime.Controller.extend()); + + equal(_emberViews.jQuery('h3', '#qunit-fixture').text(), 'Home', 'The app is now in the initial state'); + equal(rootSetup, 1, 'The root setup was triggered'); + equal(rootRender, 1, 'The root render was triggered'); + equal(rootSerialize, 0, 'The root serialize was not called'); + equal(rootModel, 1, 'The root model was called'); + + router = container.lookup('router:main'); + + _emberMetal.run(function () { + var menuItem = App.MenuItem.create({ id: 1 }); + _emberMetal.run.later(function () { + return _emberRuntime.RSVP.resolve(menuItem); + }, 1); + + router.transitionTo('special', menuItem).then(function (result) { + equal(rootSetup, 1, 'The root setup was not triggered again'); + equal(rootRender, 1, 'The root render was not triggered again'); + equal(rootSerialize, 0, 'The root serialize was not called'); + + // TODO: Should this be changed? + equal(rootModel, 1, 'The root model was called again'); + + deepEqual(router.location.path, '/specials/1'); + equal(currentPath, 'root.special'); + + QUnit.start(); + }); + }); + }); + + QUnit.asyncTest('Events are triggered on the controller if a matching action name is implemented', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + var model = { name: 'Tom Dale' }; + var stateIsNotCalled = true; + + App.HomeRoute = _emberRouting.Route.extend({ + model: function () { + return model; + }, + + actions: { + showStuff: function (obj) { + stateIsNotCalled = false; + } + } + }); + + _emberGlimmer.setTemplate('home', _emberTemplateCompiler.compile('{{name}}')); + + var controller = _emberRuntime.Controller.extend({ + actions: { + showStuff: function (context) { + ok(stateIsNotCalled, 'an event on the state is not triggered'); + deepEqual(context, { name: 'Tom Dale' }, 'an event with context is passed'); + QUnit.start(); + } + } + }); + + registry.register('controller:home', controller); + + bootApplication(); + + _emberViews.jQuery('#qunit-fixture a').click(); + }); + + QUnit.asyncTest('Events are triggered on the current state when defined in `actions` object', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + var model = { name: 'Tom Dale' }; + + App.HomeRoute = _emberRouting.Route.extend({ + model: function () { + return model; + }, + + actions: { + showStuff: function (obj) { + ok(this instanceof App.HomeRoute, 'the handler is an App.HomeRoute'); + // Using Ember.copy removes any private Ember vars which older IE would be confused by + deepEqual(_emberRuntime.copy(obj, true), { name: 'Tom Dale' }, 'the context is correct'); + QUnit.start(); + } + } + }); + + _emberGlimmer.setTemplate('home', _emberTemplateCompiler.compile('{{model.name}}')); + + bootApplication(); + + _emberViews.jQuery('#qunit-fixture a').click(); + }); + + QUnit.asyncTest('Events defined in `actions` object are triggered on the current state when routes are nested', function () { + Router.map(function () { + this.route('root', { path: '/' }, function () { + this.route('index', { path: '/' }); + }); + }); + + var model = { name: 'Tom Dale' }; + + App.RootRoute = _emberRouting.Route.extend({ + actions: { + showStuff: function (obj) { + ok(this instanceof App.RootRoute, 'the handler is an App.HomeRoute'); + // Using Ember.copy removes any private Ember vars which older IE would be confused by + deepEqual(_emberRuntime.copy(obj, true), { name: 'Tom Dale' }, 'the context is correct'); + QUnit.start(); + } + } + }); + + App.RootIndexRoute = _emberRouting.Route.extend({ + model: function () { + return model; + } + }); + + _emberGlimmer.setTemplate('root/index', _emberTemplateCompiler.compile('{{model.name}}')); + + bootApplication(); + + _emberViews.jQuery('#qunit-fixture a').click(); + }); + + QUnit.test('Events can be handled by inherited event handlers', function () { + expect(4); + + App.SuperRoute = _emberRouting.Route.extend({ + actions: { + foo: function () { + ok(true, 'foo'); + }, + bar: function (msg) { + equal(msg, 'HELLO'); + } + } + }); + + App.RouteMixin = _emberMetal.Mixin.create({ + actions: { + bar: function (msg) { + equal(msg, 'HELLO'); + this._super(msg); + } + } + }); + + App.IndexRoute = App.SuperRoute.extend(App.RouteMixin, { + actions: { + baz: function () { + ok(true, 'baz'); + } + } + }); + + bootApplication(); + + router.send('foo'); + router.send('bar', 'HELLO'); + router.send('baz'); + }); + + QUnit.asyncTest('Actions are not triggered on the controller if a matching action name is implemented as a method', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + var model = { name: 'Tom Dale' }; + var stateIsNotCalled = true; + + App.HomeRoute = _emberRouting.Route.extend({ + model: function () { + return model; + }, + + actions: { + showStuff: function (context) { + ok(stateIsNotCalled, 'an event on the state is not triggered'); + deepEqual(context, { name: 'Tom Dale' }, 'an event with context is passed'); + QUnit.start(); + } + } + }); + + _emberGlimmer.setTemplate('home', _emberTemplateCompiler.compile('{{name}}')); + + var controller = _emberRuntime.Controller.extend({ + showStuff: function (context) { + stateIsNotCalled = false; + ok(stateIsNotCalled, 'an event on the state is not triggered'); + } + }); + + registry.register('controller:home', controller); + + bootApplication(); + + _emberViews.jQuery('#qunit-fixture a').click(); + }); + + QUnit.asyncTest('actions can be triggered with multiple arguments', function () { + Router.map(function () { + this.route('root', { path: '/' }, function () { + this.route('index', { path: '/' }); + }); + }); + + var model1 = { name: 'Tilde' }; + var model2 = { name: 'Tom Dale' }; + + App.RootRoute = _emberRouting.Route.extend({ + actions: { + showStuff: function (obj1, obj2) { + ok(this instanceof App.RootRoute, 'the handler is an App.HomeRoute'); + // Using Ember.copy removes any private Ember vars which older IE would be confused by + deepEqual(_emberRuntime.copy(obj1, true), { name: 'Tilde' }, 'the first context is correct'); + deepEqual(_emberRuntime.copy(obj2, true), { name: 'Tom Dale' }, 'the second context is correct'); + QUnit.start(); + } + } + }); + + App.RootIndexController = _emberRuntime.Controller.extend({ + model1: model1, + model2: model2 + }); + + _emberGlimmer.setTemplate('root/index', _emberTemplateCompiler.compile('{{model1.name}}')); + + bootApplication(); + + _emberViews.jQuery('#qunit-fixture a').click(); + }); + + QUnit.test('transitioning multiple times in a single run loop only sets the URL once', function () { + Router.map(function () { + this.route('root', { path: '/' }); + this.route('foo'); + this.route('bar'); + }); + + bootApplication(); + + var urlSetCount = 0; + + router.get('location').setURL = function (path) { + urlSetCount++; + _emberMetal.set(this, 'path', path); + }; + + equal(urlSetCount, 0); + + _emberMetal.run(function () { + router.transitionTo('foo'); + router.transitionTo('bar'); + }); + + equal(urlSetCount, 1); + equal(router.get('location').getURL(), '/bar'); + }); + + QUnit.test('navigating away triggers a url property change', function () { + expect(3); + + Router.map(function () { + this.route('root', { path: '/' }); + this.route('foo', { path: '/foo' }); + this.route('bar', { path: '/bar' }); + }); + + bootApplication(); + + _emberMetal.run(function () { + _emberMetal.addObserver(router, 'url', function () { + ok(true, 'url change event was fired'); + }); + }); + + ['foo', 'bar', '/foo'].forEach(function (destination) { + return _emberMetal.run(router, 'transitionTo', destination); + }); + }); + + QUnit.test('using replaceWith calls location.replaceURL if available', function () { + var setCount = 0; + var replaceCount = 0; + + Router.reopen({ + location: _emberRouting.NoneLocation.create({ + setURL: function (path) { + setCount++; + _emberMetal.set(this, 'path', path); + }, + + replaceURL: function (path) { + replaceCount++; + _emberMetal.set(this, 'path', path); + } + }) + }); + + Router.map(function () { + this.route('root', { path: '/' }); + this.route('foo'); + }); + + bootApplication(); + + equal(setCount, 0); + equal(replaceCount, 0); + + _emberMetal.run(function () { + return router.replaceWith('foo'); + }); + + equal(setCount, 0, 'should not call setURL'); + equal(replaceCount, 1, 'should call replaceURL once'); + equal(router.get('location').getURL(), '/foo'); + }); + + QUnit.test('using replaceWith calls setURL if location.replaceURL is not defined', function () { + var setCount = 0; + + Router.reopen({ + location: _emberRouting.NoneLocation.create({ + setURL: function (path) { + setCount++; + _emberMetal.set(this, 'path', path); + } + }) + }); + + Router.map(function () { + this.route('root', { path: '/' }); + this.route('foo'); + }); + + bootApplication(); + + equal(setCount, 0); + + _emberMetal.run(function () { + return router.replaceWith('foo'); + }); + + equal(setCount, 1, 'should call setURL once'); + equal(router.get('location').getURL(), '/foo'); + }); + + QUnit.test('Route inherits model from parent route', function () { + expect(9); + + Router.map(function () { + this.route('the_post', { path: '/posts/:post_id' }, function () { + this.route('comments'); + + this.route('shares', { path: '/shares/:share_id', resetNamespace: true }, function () { + this.route('share'); + }); + }); + }); + + var post1 = {}; + var post2 = {}; + var post3 = {}; + var currentPost = undefined; + var share1 = {}; + var share2 = {}; + var share3 = {}; + + var posts = { + 1: post1, + 2: post2, + 3: post3 + }; + var shares = { + 1: share1, + 2: share2, + 3: share3 + }; + + App.ThePostRoute = _emberRouting.Route.extend({ + model: function (params) { + return posts[params.post_id]; + } + }); + + App.ThePostCommentsRoute = _emberRouting.Route.extend({ + afterModel: function (post, transition) { + var parent_model = this.modelFor('thePost'); + + equal(post, parent_model); + } + }); + + App.SharesRoute = _emberRouting.Route.extend({ + model: function (params) { + return shares[params.share_id]; + } + }); + + App.SharesShareRoute = _emberRouting.Route.extend({ + afterModel: function (share, transition) { + var parent_model = this.modelFor('shares'); + + equal(share, parent_model); + } + }); + + bootApplication(); + + currentPost = post1; + handleURL('/posts/1/comments'); + handleURL('/posts/1/shares/1'); + + currentPost = post2; + handleURL('/posts/2/comments'); + handleURL('/posts/2/shares/2'); + + currentPost = post3; + handleURL('/posts/3/comments'); + handleURL('/posts/3/shares/3'); + }); + + QUnit.test('Routes with { resetNamespace: true } inherits model from parent route', function () { + expect(6); + + Router.map(function () { + this.route('the_post', { path: '/posts/:post_id' }, function () { + this.route('comments', { resetNamespace: true }, function () {}); + }); + }); + + var post1 = {}; + var post2 = {}; + var post3 = {}; + var currentPost = undefined; + + var posts = { + 1: post1, + 2: post2, + 3: post3 + }; + + App.ThePostRoute = _emberRouting.Route.extend({ + model: function (params) { + return posts[params.post_id]; + } + }); + + App.CommentsRoute = _emberRouting.Route.extend({ + afterModel: function (post, transition) { + var parent_model = this.modelFor('thePost'); + + equal(post, parent_model); + } + }); + + bootApplication(); + + currentPost = post1; + handleURL('/posts/1/comments'); + + currentPost = post2; + handleURL('/posts/2/comments'); + + currentPost = post3; + handleURL('/posts/3/comments'); + }); + + QUnit.test('It is possible to get the model from a parent route', function () { + expect(9); + + Router.map(function () { + this.route('the_post', { path: '/posts/:post_id' }, function () { + this.route('comments', { resetNamespace: true }); + }); + }); + + var post1 = {}; + var post2 = {}; + var post3 = {}; + var currentPost = undefined; + + var posts = { + 1: post1, + 2: post2, + 3: post3 + }; + + App.ThePostRoute = _emberRouting.Route.extend({ + model: function (params) { + return posts[params.post_id]; + } + }); + + App.CommentsRoute = _emberRouting.Route.extend({ + model: function () { + // Allow both underscore / camelCase format. + equal(this.modelFor('thePost'), currentPost); + equal(this.modelFor('the_post'), currentPost); + } + }); + + bootApplication(); + + currentPost = post1; + handleURL('/posts/1/comments'); + + currentPost = post2; + handleURL('/posts/2/comments'); + + currentPost = post3; + handleURL('/posts/3/comments'); + }); + + QUnit.test('A redirection hook is provided', function () { + Router.map(function () { + this.route('choose', { path: '/' }); + this.route('home'); + }); + + var chooseFollowed = 0; + var destination = undefined; + + App.ChooseRoute = _emberRouting.Route.extend({ + redirect: function () { + if (destination) { + this.transitionTo(destination); + } + }, + + setupController: function () { + chooseFollowed++; + } + }); + + destination = 'home'; + + bootApplication(); + + equal(chooseFollowed, 0, 'The choose route wasn\'t entered since a transition occurred'); + equal(_emberViews.jQuery('h3:contains(Hours)', '#qunit-fixture').length, 1, 'The home template was rendered'); + equal(_emberUtils.getOwner(router).lookup('controller:application').get('currentPath'), 'home'); + }); + + QUnit.test('Redirecting from the middle of a route aborts the remainder of the routes', function () { + expect(3); + + Router.map(function () { + this.route('home'); + this.route('foo', function () { + this.route('bar', { resetNamespace: true }, function () { + this.route('baz'); + }); + }); + }); + + App.BarRoute = _emberRouting.Route.extend({ + redirect: function () { + this.transitionTo('home'); + }, + setupController: function () { + ok(false, 'Should transition before setupController'); + } + }); + + App.BarBazRoute = _emberRouting.Route.extend({ + enter: function () { + ok(false, 'Should abort transition getting to next route'); + } + }); + + bootApplication(); + + handleURLAborts('/foo/bar/baz'); + + equal(_emberUtils.getOwner(router).lookup('controller:application').get('currentPath'), 'home'); + equal(router.get('location').getURL(), '/home'); + }); + + QUnit.test('Redirecting to the current target in the middle of a route does not abort initial routing', function () { + expect(5); + + Router.map(function () { + this.route('home'); + this.route('foo', function () { + this.route('bar', { resetNamespace: true }, function () { + this.route('baz'); + }); + }); + }); + + var successCount = 0; + App.BarRoute = _emberRouting.Route.extend({ + redirect: function () { + this.transitionTo('bar.baz').then(function () { + successCount++; + }); + }, + + setupController: function () { + ok(true, 'Should still invoke bar\'s setupController'); + } + }); + + App.BarBazRoute = _emberRouting.Route.extend({ + setupController: function () { + ok(true, 'Should still invoke bar.baz\'s setupController'); + } + }); + + bootApplication(); + + handleURL('/foo/bar/baz'); + + equal(_emberUtils.getOwner(router).lookup('controller:application').get('currentPath'), 'foo.bar.baz'); + equal(successCount, 1, 'transitionTo success handler was called once'); + }); + + QUnit.test('Redirecting to the current target with a different context aborts the remainder of the routes', function () { + expect(4); + + Router.map(function () { + this.route('home'); + this.route('foo', function () { + this.route('bar', { path: 'bar/:id', resetNamespace: true }, function () { + this.route('baz'); + }); + }); + }); + + var model = { id: 2 }; + + var count = 0; + + App.BarRoute = _emberRouting.Route.extend({ + afterModel: function (context) { + if (count++ > 10) { + ok(false, 'infinite loop'); + } else { + this.transitionTo('bar.baz', model); + } + } + }); + + App.BarBazRoute = _emberRouting.Route.extend({ + setupController: function () { + ok(true, 'Should still invoke setupController'); + } + }); + + bootApplication(); + + handleURLAborts('/foo/bar/1/baz'); + + equal(_emberUtils.getOwner(router).lookup('controller:application').get('currentPath'), 'foo.bar.baz'); + equal(router.get('location').getURL(), '/foo/bar/2/baz'); + }); + + QUnit.test('Transitioning from a parent event does not prevent currentPath from being set', function () { + Router.map(function () { + this.route('foo', function () { + this.route('bar', { resetNamespace: true }, function () { + this.route('baz'); + }); + this.route('qux'); + }); + }); + + App.FooRoute = _emberRouting.Route.extend({ + actions: { + goToQux: function () { + this.transitionTo('foo.qux'); + } + } + }); + + bootApplication(); + + var applicationController = _emberUtils.getOwner(router).lookup('controller:application'); + + handleURL('/foo/bar/baz'); + + equal(applicationController.get('currentPath'), 'foo.bar.baz'); + + _emberMetal.run(function () { + return router.send('goToQux'); + }); + + equal(applicationController.get('currentPath'), 'foo.qux'); + equal(router.get('location').getURL(), '/foo/qux'); + }); + + QUnit.test('Generated names can be customized when providing routes with dot notation', function () { + expect(4); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('
    Index
    ')); + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('

    Home

    {{outlet}}
    ')); + _emberGlimmer.setTemplate('foo', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); + _emberGlimmer.setTemplate('bar', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); + _emberGlimmer.setTemplate('bar/baz', _emberTemplateCompiler.compile('

    {{name}}Bottom!

    ')); + + Router.map(function () { + this.route('foo', { path: '/top' }, function () { + this.route('bar', { path: '/middle', resetNamespace: true }, function () { + this.route('baz', { path: '/bottom' }); + }); + }); + }); + + App.FooRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + ok(true, 'FooBarRoute was called'); + return this._super.apply(this, arguments); + } + }); + + App.BarBazRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + ok(true, 'BarBazRoute was called'); + return this._super.apply(this, arguments); + } + }); + + App.BarController = _emberRuntime.Controller.extend({ + name: 'Bar' + }); + + App.BarBazController = _emberRuntime.Controller.extend({ + name: 'BarBaz' + }); + + bootApplication(); + + handleURL('/top/middle/bottom'); + + equal(_emberViews.jQuery('.main .middle .bottom p', '#qunit-fixture').text(), 'BarBazBottom!', 'The templates were rendered into their appropriate parents'); + }); + + QUnit.test('Child routes render into their parent route\'s template by default', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('
    Index
    ')); + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('

    Home

    {{outlet}}
    ')); + _emberGlimmer.setTemplate('top', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); + _emberGlimmer.setTemplate('middle', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); + _emberGlimmer.setTemplate('middle/bottom', _emberTemplateCompiler.compile('

    Bottom!

    ')); + + Router.map(function () { + this.route('top', function () { + this.route('middle', { resetNamespace: true }, function () { + this.route('bottom'); + }); + }); + }); + + bootApplication(); + + handleURL('/top/middle/bottom'); + + equal(_emberViews.jQuery('.main .middle .bottom p', '#qunit-fixture').text(), 'Bottom!', 'The templates were rendered into their appropriate parents'); + }); + + QUnit.test('Child routes render into specified template', function () { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('
    Index
    ')); + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('

    Home

    {{outlet}}
    ')); + _emberGlimmer.setTemplate('top', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); + _emberGlimmer.setTemplate('middle', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); + _emberGlimmer.setTemplate('middle/bottom', _emberTemplateCompiler.compile('

    Bottom!

    ')); + + Router.map(function () { + this.route('top', function () { + this.route('middle', { resetNamespace: true }, function () { + this.route('bottom'); + }); + }); + }); + + App.MiddleBottomRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render('middle/bottom', { into: 'top' }); + } + }); + + bootApplication(); + + handleURL('/top/middle/bottom'); + + equal(_emberViews.jQuery('.main .middle .bottom p', '#qunit-fixture').length, 0, 'should not render into the middle template'); + equal(_emberViews.jQuery('.main .middle > p', '#qunit-fixture').text(), 'Bottom!', 'The template was rendered into the top template'); + }); + + QUnit.test('Rendering into specified template with slash notation', function () { + _emberGlimmer.setTemplate('person/profile', _emberTemplateCompiler.compile('profile {{outlet}}')); + _emberGlimmer.setTemplate('person/details', _emberTemplateCompiler.compile('details!')); + + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render('person/profile'); + this.render('person/details', { into: 'person/profile' }); + } + }); + + bootApplication(); + + equal(_emberViews.jQuery('#qunit-fixture:contains(profile details!)').length, 1, 'The templates were rendered'); + }); + + QUnit.test('Parent route context change', function () { + var editCount = 0; + var editedPostIds = _emberRuntime.A(); + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('posts', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('post', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('post/index', _emberTemplateCompiler.compile('showing')); + _emberGlimmer.setTemplate('post/edit', _emberTemplateCompiler.compile('editing')); + + Router.map(function () { + this.route('posts', function () { + this.route('post', { path: '/:postId', resetNamespace: true }, function () { + this.route('edit'); + }); + }); + }); + + App.PostsRoute = _emberRouting.Route.extend({ + actions: { + showPost: function (context) { + this.transitionTo('post', context); + } + } + }); + + App.PostRoute = _emberRouting.Route.extend({ + model: function (params) { + return { id: params.postId }; + }, + + serialize: function (model) { + return { postId: model.id }; + }, + + actions: { + editPost: function (context) { + this.transitionTo('post.edit'); + } + } + }); + + App.PostEditRoute = _emberRouting.Route.extend({ + model: function (params) { + var postId = this.modelFor('post').id; + editedPostIds.push(postId); + return null; + }, + setup: function () { + this._super.apply(this, arguments); + editCount++; + } + }); + + bootApplication(); + + handleURL('/posts/1'); + + _emberMetal.run(function () { + return router.send('editPost'); + }); + _emberMetal.run(function () { + return router.send('showPost', { id: '2' }); + }); + _emberMetal.run(function () { + return router.send('editPost'); + }); + + equal(editCount, 2, 'set up the edit route twice without failure'); + deepEqual(editedPostIds, ['1', '2'], 'modelFor posts.post returns the right context'); + }); + + QUnit.test('Router accounts for rootURL on page load when using history location', function () { + var rootURL = window.location.pathname + '/app'; + var postsTemplateRendered = false; + var setHistory = undefined, + HistoryTestLocation = undefined; + + setHistory = function (obj, path) { + obj.set('history', { state: { path: path } }); + }; + + // Create new implementation that extends HistoryLocation + // and set current location to rootURL + '/posts' + HistoryTestLocation = _emberRouting.HistoryLocation.extend({ + initState: function () { + var path = rootURL + '/posts'; + + setHistory(this, path); + this.set('location', { + pathname: path, + href: 'http://localhost/' + path + }); + }, + + replaceState: function (path) { + setHistory(this, path); + }, + + pushState: function (path) { + setHistory(this, path); + } + }); + + registry.register('location:historyTest', HistoryTestLocation); + + Router.reopen({ + location: 'historyTest', + rootURL: rootURL + }); + + Router.map(function () { + this.route('posts', { path: '/posts' }); + }); + + App.PostsRoute = _emberRouting.Route.extend({ + model: function () {}, + renderTemplate: function () { + postsTemplateRendered = true; + } + }); + + bootApplication(); + + ok(postsTemplateRendered, 'Posts route successfully stripped from rootURL'); + }); + + QUnit.test('The rootURL is passed properly to the location implementation', function () { + expect(1); + var rootURL = '/blahzorz'; + var HistoryTestLocation = undefined; + + HistoryTestLocation = _emberRouting.HistoryLocation.extend({ + rootURL: 'this is not the URL you are looking for', + initState: function () { + equal(this.get('rootURL'), rootURL); + } + }); + + registry.register('location:history-test', HistoryTestLocation); + + Router.reopen({ + location: 'history-test', + rootURL: rootURL, + // if we transition in this test we will receive failures + // if the tests are run from a static file + _doURLTransition: function () {} + }); + + bootApplication(); + }); + + QUnit.test('Only use route rendered into main outlet for default into property on child', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet \'menu\'}}{{outlet}}')); + _emberGlimmer.setTemplate('posts', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('posts/index', _emberTemplateCompiler.compile('

    postsIndex

    ')); + _emberGlimmer.setTemplate('posts/menu', _emberTemplateCompiler.compile('
    postsMenu
    ')); + + Router.map(function () { + this.route('posts', function () {}); + }); + + App.PostsRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render(); + this.render('posts/menu', { + into: 'application', + outlet: 'menu' + }); + } + }); + + bootApplication(); + + handleURL('/posts'); + + equal(_emberViews.jQuery('div.posts-menu:contains(postsMenu)', '#qunit-fixture').length, 1, 'The posts/menu template was rendered'); + equal(_emberViews.jQuery('p.posts-index:contains(postsIndex)', '#qunit-fixture').length, 1, 'The posts/index template was rendered'); + }); + + QUnit.test('Generating a URL should not affect currentModel', function () { + Router.map(function () { + this.route('post', { path: '/posts/:post_id' }); + }); + + var posts = { + 1: { id: 1 }, + 2: { id: 2 } + }; + + App.PostRoute = _emberRouting.Route.extend({ + model: function (params) { + return posts[params.post_id]; + } + }); + + bootApplication(); + + handleURL('/posts/1'); + + var route = container.lookup('route:post'); + equal(route.modelFor('post'), posts[1]); + + var url = router.generate('post', posts[2]); + equal(url, '/posts/2'); + + equal(route.modelFor('post'), posts[1]); + }); + + QUnit.test('Generated route should be an instance of App.Route if provided', function () { + var generatedRoute = undefined; + + Router.map(function () { + this.route('posts'); + }); + + App.Route = _emberRouting.Route.extend(); + + bootApplication(); + + handleURL('/posts'); + + generatedRoute = container.lookup('route:posts'); + + ok(generatedRoute instanceof App.Route, 'should extend the correct route'); + }); + + QUnit.test('Nested index route is not overriden by parent\'s implicit index route', function () { + Router.map(function () { + this.route('posts', function () { + this.route('index', { path: ':category' }); + }); + }); + + bootApplication(); + + _emberMetal.run(function () { + return router.transitionTo('posts', { category: 'emberjs' }); + }); + + deepEqual(router.location.path, '/posts/emberjs'); + }); + + QUnit.test('Application template does not duplicate when re-rendered', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('

    I Render Once

    {{outlet}}')); + + Router.map(function () { + this.route('posts'); + }); + + App.ApplicationRoute = _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.A(); + } + }); + + bootApplication(); + + // should cause application template to re-render + handleURL('/posts'); + + equal(_emberViews.jQuery('h3:contains(I Render Once)').length, 1); + }); + + QUnit.test('Child routes should render inside the application template if the application template causes a redirect', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('

    App

    {{outlet}}')); + _emberGlimmer.setTemplate('posts', _emberTemplateCompiler.compile('posts')); + + Router.map(function () { + this.route('posts'); + this.route('photos'); + }); + + App.ApplicationRoute = _emberRouting.Route.extend({ + afterModel: function () { + this.transitionTo('posts'); + } + }); + + bootApplication(); + + equal(_emberViews.jQuery('#qunit-fixture > div').text(), 'App posts'); + }); + + QUnit.test('The template is not re-rendered when the route\'s context changes', function () { + Router.map(function () { + this.route('page', { path: '/page/:name' }); + }); + + App.PageRoute = _emberRouting.Route.extend({ + model: function (params) { + return _emberRuntime.Object.create({ name: params.name }); + } + }); + + var insertionCount = 0; + App.FooBarComponent = _emberGlimmer.Component.extend({ + didInsertElement: function () { + insertionCount += 1; + } + }); + + _emberGlimmer.setTemplate('page', _emberTemplateCompiler.compile('

    {{model.name}}{{foo-bar}}

    ')); + + bootApplication(); + + handleURL('/page/first'); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'first'); + equal(insertionCount, 1); + + handleURL('/page/second'); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'second'); + equal(insertionCount, 1, 'view should have inserted only once'); + + _emberMetal.run(function () { + return router.transitionTo('page', _emberRuntime.Object.create({ name: 'third' })); + }); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'third'); + equal(insertionCount, 1, 'view should still have inserted only once'); + }); + + QUnit.test('The template is not re-rendered when two routes present the exact same template & controller', function () { + Router.map(function () { + this.route('first'); + this.route('second'); + this.route('third'); + this.route('fourth'); + }); + + // Note add a component to test insertion + + var insertionCount = 0; + App.XInputComponent = _emberGlimmer.Component.extend({ + didInsertElement: function () { + insertionCount += 1; + } + }); + + App.SharedRoute = _emberRouting.Route.extend({ + setupController: function (controller) { + this.controllerFor('shared').set('message', 'This is the ' + this.routeName + ' message'); + }, + + renderTemplate: function (controller, context) { + this.render('shared', { controller: 'shared' }); + } + }); + + App.FirstRoute = App.SharedRoute.extend(); + App.SecondRoute = App.SharedRoute.extend(); + App.ThirdRoute = App.SharedRoute.extend(); + App.FourthRoute = App.SharedRoute.extend(); + + App.SharedController = _emberRuntime.Controller.extend(); + + _emberGlimmer.setTemplate('shared', _emberTemplateCompiler.compile('

    {{message}}{{x-input}}

    ')); + + bootApplication(); + + handleURL('/first'); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'This is the first message'); + equal(insertionCount, 1, 'expected one assertion'); + + // Transition by URL + handleURL('/second'); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'This is the second message'); + equal(insertionCount, 1, 'expected one assertion'); + + // Then transition directly by route name + _emberMetal.run(function () { + router.transitionTo('third').then(function (value) { + ok(true, 'expected transition'); + }, function (reason) { + ok(false, 'unexpected transition failure: ', QUnit.jsDump.parse(reason)); + }); + }); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'This is the third message'); + equal(insertionCount, 1, 'expected one assertion'); + + // Lastly transition to a different view, with the same controller and template + handleURL('/fourth'); + equal(insertionCount, 1, 'expected one assertion'); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'This is the fourth message'); + }); + + QUnit.test('ApplicationRoute with model does not proxy the currentPath', function () { + var model = {}; + var currentPath = undefined; + + App.ApplicationRoute = _emberRouting.Route.extend({ + model: function () { + return model; + } + }); + + App.ApplicationController = _emberRuntime.Controller.extend({ + currentPathDidChange: _emberMetal.observer('currentPath', function () { + currentPath = _emberMetal.get(this, 'currentPath'); + }) + }); + + bootApplication(); + + equal(currentPath, 'index', 'currentPath is index'); + equal('currentPath' in model, false, 'should have defined currentPath on controller'); + }); + + QUnit.test('Promises encountered on app load put app into loading state until resolved', function () { + expect(2); + + var deferred = _emberRuntime.RSVP.defer(); + + App.IndexRoute = _emberRouting.Route.extend({ + model: function () { + return deferred.promise; + } + }); + + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    INDEX

    ')); + _emberGlimmer.setTemplate('loading', _emberTemplateCompiler.compile('

    LOADING

    ')); + + bootApplication(); + + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'LOADING', 'The loading state is displaying.'); + _emberMetal.run(deferred.resolve); + equal(_emberViews.jQuery('p', '#qunit-fixture').text(), 'INDEX', 'The index route is display.'); + }); + + QUnit.test('Route should tear down multiple outlets', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet \'menu\'}}{{outlet}}{{outlet \'footer\'}}')); + _emberGlimmer.setTemplate('posts', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('users', _emberTemplateCompiler.compile('users')); + _emberGlimmer.setTemplate('posts/index', _emberTemplateCompiler.compile('

    postsIndex

    ')); + _emberGlimmer.setTemplate('posts/menu', _emberTemplateCompiler.compile('
    postsMenu
    ')); + _emberGlimmer.setTemplate('posts/footer', _emberTemplateCompiler.compile('')); + + Router.map(function () { + this.route('posts', function () {}); + this.route('users', function () {}); + }); + + App.PostsRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render('posts/menu', { + into: 'application', + outlet: 'menu' + }); + + this.render(); + + this.render('posts/footer', { + into: 'application', + outlet: 'footer' + }); + } + }); + + bootApplication(); + + handleURL('/posts'); + + equal(_emberViews.jQuery('div.posts-menu:contains(postsMenu)', '#qunit-fixture').length, 1, 'The posts/menu template was rendered'); + equal(_emberViews.jQuery('p.posts-index:contains(postsIndex)', '#qunit-fixture').length, 1, 'The posts/index template was rendered'); + equal(_emberViews.jQuery('div.posts-footer:contains(postsFooter)', '#qunit-fixture').length, 1, 'The posts/footer template was rendered'); + + handleURL('/users'); + + equal(_emberViews.jQuery('div.posts-menu:contains(postsMenu)', '#qunit-fixture').length, 0, 'The posts/menu template was removed'); + equal(_emberViews.jQuery('p.posts-index:contains(postsIndex)', '#qunit-fixture').length, 0, 'The posts/index template was removed'); + equal(_emberViews.jQuery('div.posts-footer:contains(postsFooter)', '#qunit-fixture').length, 0, 'The posts/footer template was removed'); + }); + + QUnit.test('Route will assert if you try to explicitly render {into: ...} a missing template', function () { + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render({ into: 'nonexistent' }); + } + }); + + expectAssertion(function () { + return bootApplication(); + }, 'You attempted to render into \'nonexistent\' but it was not found'); + }); + + QUnit.test('Route supports clearing outlet explicitly', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet}}{{outlet \'modal\'}}')); + _emberGlimmer.setTemplate('posts', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('users', _emberTemplateCompiler.compile('users')); + _emberGlimmer.setTemplate('posts/index', _emberTemplateCompiler.compile('
    postsIndex {{outlet}}
    ')); + _emberGlimmer.setTemplate('posts/modal', _emberTemplateCompiler.compile('
    postsModal
    ')); + _emberGlimmer.setTemplate('posts/extra', _emberTemplateCompiler.compile('
    postsExtra
    ')); + + Router.map(function () { + this.route('posts', function () {}); + this.route('users', function () {}); + }); + + App.PostsRoute = _emberRouting.Route.extend({ + actions: { + showModal: function () { + this.render('posts/modal', { + into: 'application', + outlet: 'modal' + }); + }, + hideModal: function () { + this.disconnectOutlet({ outlet: 'modal', parentView: 'application' }); + } + } + }); + + App.PostsIndexRoute = _emberRouting.Route.extend({ + actions: { + showExtra: function () { + this.render('posts/extra', { + into: 'posts/index' + }); + }, + hideExtra: function () { + this.disconnectOutlet({ parentView: 'posts/index' }); + } + } + }); + + bootApplication(); + + handleURL('/posts'); + + equal(_emberViews.jQuery('div.posts-index:contains(postsIndex)', '#qunit-fixture').length, 1, 'The posts/index template was rendered'); + + _emberMetal.run(function () { + return router.send('showModal'); + }); + + equal(_emberViews.jQuery('div.posts-modal:contains(postsModal)', '#qunit-fixture').length, 1, 'The posts/modal template was rendered'); + + _emberMetal.run(function () { + return router.send('showExtra'); + }); + + equal(_emberViews.jQuery('div.posts-extra:contains(postsExtra)', '#qunit-fixture').length, 1, 'The posts/extra template was rendered'); + + _emberMetal.run(function () { + return router.send('hideModal'); + }); + + equal(_emberViews.jQuery('div.posts-modal:contains(postsModal)', '#qunit-fixture').length, 0, 'The posts/modal template was removed'); + + _emberMetal.run(function () { + return router.send('hideExtra'); + }); + + equal(_emberViews.jQuery('div.posts-extra:contains(postsExtra)', '#qunit-fixture').length, 0, 'The posts/extra template was removed'); + _emberMetal.run(function () { + router.send('showModal'); + }); + equal(_emberViews.jQuery('div.posts-modal:contains(postsModal)', '#qunit-fixture').length, 1, 'The posts/modal template was rendered'); + _emberMetal.run(function () { + router.send('showExtra'); + }); + equal(_emberViews.jQuery('div.posts-extra:contains(postsExtra)', '#qunit-fixture').length, 1, 'The posts/extra template was rendered'); + + handleURL('/users'); + + equal(_emberViews.jQuery('div.posts-index:contains(postsIndex)', '#qunit-fixture').length, 0, 'The posts/index template was removed'); + equal(_emberViews.jQuery('div.posts-modal:contains(postsModal)', '#qunit-fixture').length, 0, 'The posts/modal template was removed'); + equal(_emberViews.jQuery('div.posts-extra:contains(postsExtra)', '#qunit-fixture').length, 0, 'The posts/extra template was removed'); + }); + + QUnit.test('Route supports clearing outlet using string parameter', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet}}{{outlet \'modal\'}}')); + _emberGlimmer.setTemplate('posts', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('users', _emberTemplateCompiler.compile('users')); + _emberGlimmer.setTemplate('posts/index', _emberTemplateCompiler.compile('
    postsIndex {{outlet}}
    ')); + _emberGlimmer.setTemplate('posts/modal', _emberTemplateCompiler.compile('
    postsModal
    ')); + + Router.map(function () { + this.route('posts', function () {}); + this.route('users', function () {}); + }); + + App.PostsRoute = _emberRouting.Route.extend({ + actions: { + showModal: function () { + this.render('posts/modal', { + into: 'application', + outlet: 'modal' + }); + }, + hideModal: function () { + this.disconnectOutlet('modal'); + } + } + }); + + bootApplication(); + + handleURL('/posts'); + + equal(_emberViews.jQuery('div.posts-index:contains(postsIndex)', '#qunit-fixture').length, 1, 'The posts/index template was rendered'); + + _emberMetal.run(function () { + return router.send('showModal'); + }); + + equal(_emberViews.jQuery('div.posts-modal:contains(postsModal)', '#qunit-fixture').length, 1, 'The posts/modal template was rendered'); + + _emberMetal.run(function () { + return router.send('hideModal'); + }); + + equal(_emberViews.jQuery('div.posts-modal:contains(postsModal)', '#qunit-fixture').length, 0, 'The posts/modal template was removed'); + + handleURL('/users'); + + equal(_emberViews.jQuery('div.posts-index:contains(postsIndex)', '#qunit-fixture').length, 0, 'The posts/index template was removed'); + equal(_emberViews.jQuery('div.posts-modal:contains(postsModal)', '#qunit-fixture').length, 0, 'The posts/modal template was removed'); + }); + + QUnit.test('Route silently fails when cleaning an outlet from an inactive view', function () { + expect(1); // handleURL + + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('posts', _emberTemplateCompiler.compile('{{outlet \'modal\'}}')); + _emberGlimmer.setTemplate('modal', _emberTemplateCompiler.compile('A Yo.')); + + Router.map(function () { + this.route('posts'); + }); + + App.PostsRoute = _emberRouting.Route.extend({ + actions: { + hideSelf: function () { + this.disconnectOutlet({ outlet: 'main', parentView: 'application' }); + }, + showModal: function () { + this.render('modal', { into: 'posts', outlet: 'modal' }); + }, + hideModal: function () { + this.disconnectOutlet({ outlet: 'modal', parentView: 'posts' }); + } + } + }); + + bootApplication(); + + handleURL('/posts'); + + _emberMetal.run(function () { + return router.send('showModal'); + }); + _emberMetal.run(function () { + return router.send('hideSelf'); + }); + _emberMetal.run(function () { + return router.send('hideModal'); + }); + }); + + QUnit.test('Router `willTransition` hook passes in cancellable transition', function () { + // Should hit willTransition 3 times, once for the initial route, and then 2 more times + // for the two handleURL calls below + expect(3); + + Router.map(function () { + this.route('nork'); + this.route('about'); + }); + + Router.reopen({ + init: function () { + this._super(); + this.on('willTransition', this.testWillTransitionHook); + }, + testWillTransitionHook: function (transition, url) { + ok(true, 'willTransition was called ' + url); + transition.abort(); + } + }); + + App.LoadingRoute = _emberRouting.Route.extend({ + activate: function () { + ok(false, 'LoadingRoute was not entered'); + } + }); + + App.NorkRoute = _emberRouting.Route.extend({ + activate: function () { + ok(false, 'NorkRoute was not entered'); + } + }); + + App.AboutRoute = _emberRouting.Route.extend({ + activate: function () { + ok(false, 'AboutRoute was not entered'); + } + }); + + bootApplication(); + + // Attempted transitions out of index should abort. + _emberMetal.run(router, 'handleURL', '/nork'); + _emberMetal.run(router, 'handleURL', '/about'); + }); + + QUnit.test('Aborting/redirecting the transition in `willTransition` prevents LoadingRoute from being entered', function () { + expect(8); + + Router.map(function () { + this.route('nork'); + this.route('about'); + }); + + var redirect = false; + + App.IndexRoute = _emberRouting.Route.extend({ + actions: { + willTransition: function (transition) { + ok(true, 'willTransition was called'); + if (redirect) { + // router.js won't refire `willTransition` for this redirect + this.transitionTo('about'); + } else { + transition.abort(); + } + } + } + }); + + var deferred = null; + + App.LoadingRoute = _emberRouting.Route.extend({ + activate: function () { + ok(deferred, 'LoadingRoute should be entered at this time'); + }, + deactivate: function () { + ok(true, 'LoadingRoute was exited'); + } + }); + + App.NorkRoute = _emberRouting.Route.extend({ + activate: function () { + ok(true, 'NorkRoute was entered'); + } + }); + + App.AboutRoute = _emberRouting.Route.extend({ + activate: function () { + ok(true, 'AboutRoute was entered'); + }, + model: function () { + if (deferred) { + return deferred.promise; + } + } + }); + + bootApplication(); + + // Attempted transitions out of index should abort. + _emberMetal.run(router, 'transitionTo', 'nork'); + _emberMetal.run(router, 'handleURL', '/nork'); + + // Attempted transitions out of index should redirect to about + redirect = true; + _emberMetal.run(router, 'transitionTo', 'nork'); + _emberMetal.run(router, 'transitionTo', 'index'); + + // Redirected transitions out of index to a route with a + // promise model should pause the transition and + // activate LoadingRoute + deferred = _emberRuntime.RSVP.defer(); + _emberMetal.run(router, 'transitionTo', 'nork'); + _emberMetal.run(deferred.resolve); + }); + + QUnit.test('`didTransition` event fires on the router', function () { + expect(3); + + Router.map(function () { + this.route('nork'); + }); + + router = container.lookup('router:main'); + + router.one('didTransition', function () { + ok(true, 'didTransition fired on initial routing'); + }); + + bootApplication(); + + router.one('didTransition', function () { + ok(true, 'didTransition fired on the router'); + equal(router.get('url'), '/nork', 'The url property is updated by the time didTransition fires'); + }); + + _emberMetal.run(router, 'transitionTo', 'nork'); + }); + QUnit.test('`didTransition` can be reopened', function () { + expect(1); + + Router.map(function () { + this.route('nork'); + }); + + Router.reopen({ + didTransition: function () { + this._super.apply(this, arguments); + ok(true, 'reopened didTransition was called'); + } + }); + + bootApplication(); + }); + + QUnit.test('`activate` event fires on the route', function () { + expect(2); + + var eventFired = 0; + + Router.map(function () { + this.route('nork'); + }); + + App.NorkRoute = _emberRouting.Route.extend({ + init: function () { + this._super.apply(this, arguments); + + this.on('activate', function () { + equal(++eventFired, 1, 'activate event is fired once'); + }); + }, + + activate: function () { + ok(true, 'activate hook is called'); + } + }); + + bootApplication(); + + _emberMetal.run(router, 'transitionTo', 'nork'); + }); + + QUnit.test('`deactivate` event fires on the route', function () { + expect(2); + + var eventFired = 0; + + Router.map(function () { + this.route('nork'); + this.route('dork'); + }); + + App.NorkRoute = _emberRouting.Route.extend({ + init: function () { + this._super.apply(this, arguments); + + this.on('deactivate', function () { + equal(++eventFired, 1, 'deactivate event is fired once'); + }); + }, + + deactivate: function () { + ok(true, 'deactivate hook is called'); + } + }); + + bootApplication(); + + _emberMetal.run(router, 'transitionTo', 'nork'); + _emberMetal.run(router, 'transitionTo', 'dork'); + }); + + QUnit.test('Actions can be handled by inherited action handlers', function () { + expect(4); + + App.SuperRoute = _emberRouting.Route.extend({ + actions: { + foo: function () { + ok(true, 'foo'); + }, + bar: function (msg) { + equal(msg, 'HELLO'); + } + } + }); + + App.RouteMixin = _emberMetal.Mixin.create({ + actions: { + bar: function (msg) { + equal(msg, 'HELLO'); + this._super(msg); + } + } + }); + + App.IndexRoute = App.SuperRoute.extend(App.RouteMixin, { + actions: { + baz: function () { + ok(true, 'baz'); + } + } + }); + + bootApplication(); + + router.send('foo'); + router.send('bar', 'HELLO'); + router.send('baz'); + }); + + QUnit.test('transitionTo returns Transition when passed a route name', function () { + expect(1); + Router.map(function () { + this.route('root', { path: '/' }); + this.route('bar'); + }); + + bootApplication(); + + var transition = _emberMetal.run(function () { + return router.transitionTo('bar'); + }); + + equal(transition instanceof _router.Transition, true); + }); + + QUnit.test('transitionTo returns Transition when passed a url', function () { + expect(1); + Router.map(function () { + this.route('root', { path: '/' }); + this.route('bar', function () { + this.route('baz'); + }); + }); + + bootApplication(); + + var transition = _emberMetal.run(function () { + return router.transitionTo('/bar/baz'); + }); + + equal(transition instanceof _router.Transition, true); + }); + + QUnit.test('currentRouteName is a property installed on ApplicationController that can be used in transitionTo', function () { + expect(24); + + Router.map(function () { + this.route('be', function () { + this.route('excellent', { resetNamespace: true }, function () { + this.route('to', { resetNamespace: true }, function () { + this.route('each', { resetNamespace: true }, function () { + this.route('other'); + }); + }); + }); + }); + }); + + bootApplication(); + + var appController = _emberUtils.getOwner(router).lookup('controller:application'); + + function transitionAndCheck(path, expectedPath, expectedRouteName) { + if (path) { + _emberMetal.run(router, 'transitionTo', path); + } + equal(appController.get('currentPath'), expectedPath); + equal(appController.get('currentRouteName'), expectedRouteName); + } + + transitionAndCheck(null, 'index', 'index'); + transitionAndCheck('/be', 'be.index', 'be.index'); + transitionAndCheck('/be/excellent', 'be.excellent.index', 'excellent.index'); + transitionAndCheck('/be/excellent/to', 'be.excellent.to.index', 'to.index'); + transitionAndCheck('/be/excellent/to/each', 'be.excellent.to.each.index', 'each.index'); + transitionAndCheck('/be/excellent/to/each/other', 'be.excellent.to.each.other', 'each.other'); + + transitionAndCheck('index', 'index', 'index'); + transitionAndCheck('be', 'be.index', 'be.index'); + transitionAndCheck('excellent', 'be.excellent.index', 'excellent.index'); + transitionAndCheck('to.index', 'be.excellent.to.index', 'to.index'); + transitionAndCheck('each', 'be.excellent.to.each.index', 'each.index'); + transitionAndCheck('each.other', 'be.excellent.to.each.other', 'each.other'); + }); + + QUnit.test('Route model hook finds the same model as a manual find', function () { + var Post = undefined; + App.Post = _emberRuntime.Object.extend(); + App.Post.reopenClass({ + find: function () { + Post = this; + return {}; + } + }); + + Router.map(function () { + this.route('post', { path: '/post/:post_id' }); + }); + + bootApplication(); + + handleURL('/post/1'); + + equal(App.Post, Post); + }); + + QUnit.test('Routes can refresh themselves causing their model hooks to be re-run', function () { + Router.map(function () { + this.route('parent', { path: '/parent/:parent_id' }, function () { + this.route('child'); + }); + }); + + var appcount = 0; + App.ApplicationRoute = _emberRouting.Route.extend({ + model: function () { + ++appcount; + } + }); + + var parentcount = 0; + App.ParentRoute = _emberRouting.Route.extend({ + model: function (params) { + equal(params.parent_id, '123'); + ++parentcount; + }, + actions: { + refreshParent: function () { + this.refresh(); + } + } + }); + + var childcount = 0; + App.ParentChildRoute = _emberRouting.Route.extend({ + model: function () { + ++childcount; + } + }); + + bootApplication(); + + equal(appcount, 1); + equal(parentcount, 0); + equal(childcount, 0); + + _emberMetal.run(router, 'transitionTo', 'parent.child', '123'); + + equal(appcount, 1); + equal(parentcount, 1); + equal(childcount, 1); + + _emberMetal.run(router, 'send', 'refreshParent'); + + equal(appcount, 1); + equal(parentcount, 2); + equal(childcount, 2); + }); + + QUnit.test('Specifying non-existent controller name in route#render throws', function () { + expect(1); + + Router.map(function () { + this.route('home', { path: '/' }); + }); + + App.HomeRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + try { + this.render('homepage', { controller: 'stefanpenneristhemanforme' }); + } catch (e) { + equal(e.message, 'You passed `controller: \'stefanpenneristhemanforme\'` into the `render` method, but no such controller could be found.'); + } + } + }); + + bootApplication(); + }); + + QUnit.test('Redirecting with null model doesn\'t error out', function () { + Router.map(function () { + this.route('home', { path: '/' }); + this.route('about', { path: '/about/:hurhurhur' }); + }); + + App.AboutRoute = _emberRouting.Route.extend({ + serialize: function (model) { + if (model === null) { + return { hurhurhur: 'TreeklesMcGeekles' }; + } + } + }); + + App.HomeRoute = _emberRouting.Route.extend({ + beforeModel: function () { + this.transitionTo('about', null); + } + }); + + bootApplication(); + + equal(router.get('location.path'), '/about/TreeklesMcGeekles'); + }); + + QUnit.test('rejecting the model hooks promise with a non-error prints the `message` property', function () { + expect(5); + + var rejectedMessage = 'OMG!! SOOOOOO BAD!!!!'; + var rejectedStack = 'Yeah, buddy: stack gets printed too.'; + + Router.map(function () { + this.route('yippie', { path: '/' }); + }); + + _emberConsole.default.error = function (initialMessage, errorMessage, errorStack) { + equal(initialMessage, 'Error while processing route: yippie', 'a message with the current route name is printed'); + equal(errorMessage, rejectedMessage, 'the rejected reason\'s message property is logged'); + equal(errorStack, rejectedStack, 'the rejected reason\'s stack property is logged'); + }; + + App.YippieRoute = _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.RSVP.reject({ message: rejectedMessage, stack: rejectedStack }); + } + }); + + throws(function () { + bootApplication(); + }, function (err) { + equal(err.message, rejectedMessage); + return true; + }, 'expected an exception'); + }); + + QUnit.test('rejecting the model hooks promise with an error with `errorThrown` property prints `errorThrown.message` property', function () { + expect(5); + var rejectedMessage = 'OMG!! SOOOOOO BAD!!!!'; + var rejectedStack = 'Yeah, buddy: stack gets printed too.'; + + Router.map(function () { + this.route('yippie', { path: '/' }); + }); + + _emberConsole.default.error = function (initialMessage, errorMessage, errorStack) { + equal(initialMessage, 'Error while processing route: yippie', 'a message with the current route name is printed'); + equal(errorMessage, rejectedMessage, 'the rejected reason\'s message property is logged'); + equal(errorStack, rejectedStack, 'the rejected reason\'s stack property is logged'); + }; + + App.YippieRoute = _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.RSVP.reject({ + errorThrown: { message: rejectedMessage, stack: rejectedStack } + }); + } + }); + + throws(function () { + return bootApplication(); + }, function (err) { + equal(err.message, rejectedMessage); + return true; + }, 'expected an exception'); + }); + + QUnit.test('rejecting the model hooks promise with no reason still logs error', function () { + Router.map(function () { + this.route('wowzers', { path: '/' }); + }); + + _emberConsole.default.error = function (initialMessage) { + equal(initialMessage, 'Error while processing route: wowzers', 'a message with the current route name is printed'); + }; + + App.WowzersRoute = _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.RSVP.reject(); + } + }); + + bootApplication(); + }); + + QUnit.test('rejecting the model hooks promise with a string shows a good error', function () { + expect(3); + var originalLoggerError = _emberConsole.default.error; + var rejectedMessage = 'Supercalifragilisticexpialidocious'; + + Router.map(function () { + this.route('yondo', { path: '/' }); + }); + + _emberConsole.default.error = function (initialMessage, errorMessage) { + equal(initialMessage, 'Error while processing route: yondo', 'a message with the current route name is printed'); + equal(errorMessage, rejectedMessage, 'the rejected reason\'s message property is logged'); + }; + + App.YondoRoute = _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.RSVP.reject(rejectedMessage); + } + }); + + throws(function () { + return bootApplication(); + }, rejectedMessage, 'expected an exception'); + + _emberConsole.default.error = originalLoggerError; + }); + + QUnit.test('willLeave, willChangeContext, willChangeModel actions don\'t fire unless feature flag enabled', function () { + expect(1); + + App.Router.map(function () { + this.route('about'); + }); + + function shouldNotFire() { + ok(false, 'this action shouldn\'t have been received'); + } + + App.IndexRoute = _emberRouting.Route.extend({ + actions: { + willChangeModel: shouldNotFire, + willChangeContext: shouldNotFire, + willLeave: shouldNotFire + } + }); + + App.AboutRoute = _emberRouting.Route.extend({ + setupController: function () { + ok(true, 'about route was entered'); + } + }); + + bootApplication(); + _emberMetal.run(router, 'transitionTo', 'about'); + }); + + QUnit.test('Errors in transitionTo within redirect hook are logged', function () { + expect(4); + var actual = []; + + Router.map(function () { + this.route('yondo', { path: '/' }); + this.route('stink-bomb'); + }); + + App.YondoRoute = _emberRouting.Route.extend({ + redirect: function () { + this.transitionTo('stink-bomb', { something: 'goes boom' }); + } + }); + + _emberConsole.default.error = function () { + // push the arguments onto an array so we can detect if the error gets logged twice + actual.push(arguments); + }; + + throws(function () { + return bootApplication(); + }, /More context objects were passed/); + + equal(actual.length, 1, 'the error is only logged once'); + equal(actual[0][0], 'Error while processing route: yondo', 'source route is printed'); + ok(actual[0][1].match(/More context objects were passed than there are dynamic segments for the route: stink-bomb/), 'the error is printed'); + }); + + QUnit.test('Errors in transition show error template if available', function () { + _emberGlimmer.setTemplate('error', _emberTemplateCompiler.compile('
    Error!
    ')); + + Router.map(function () { + this.route('yondo', { path: '/' }); + this.route('stink-bomb'); + }); + + App.YondoRoute = _emberRouting.Route.extend({ + redirect: function () { + this.transitionTo('stink-bomb', { something: 'goes boom' }); + } + }); + + throws(function () { + return bootApplication(); + }, /More context objects were passed/); + + equal(_emberViews.jQuery('#error').length, 1, 'Error template was rendered.'); + }); + + QUnit.test('Route#resetController gets fired when changing models and exiting routes', function () { + expect(4); + + Router.map(function () { + this.route('a', function () { + this.route('b', { path: '/b/:id', resetNamespace: true }, function () {}); + this.route('c', { path: '/c/:id', resetNamespace: true }, function () {}); + }); + this.route('out'); + }); + + var calls = []; + + var SpyRoute = _emberRouting.Route.extend({ + setupController: function (controller, model, transition) { + calls.push(['setup', this.routeName]); + }, + + resetController: function (controller) { + calls.push(['reset', this.routeName]); + } + }); + + App.ARoute = SpyRoute.extend(); + App.BRoute = SpyRoute.extend(); + App.CRoute = SpyRoute.extend(); + App.OutRoute = SpyRoute.extend(); + + bootApplication(); + deepEqual(calls, []); + + _emberMetal.run(router, 'transitionTo', 'b', 'b-1'); + deepEqual(calls, [['setup', 'a'], ['setup', 'b']]); + calls.length = 0; + + _emberMetal.run(router, 'transitionTo', 'c', 'c-1'); + deepEqual(calls, [['reset', 'b'], ['setup', 'c']]); + calls.length = 0; + + _emberMetal.run(router, 'transitionTo', 'out'); + deepEqual(calls, [['reset', 'c'], ['reset', 'a'], ['setup', 'out']]); + }); + + QUnit.test('Exception during initialization of non-initial route is not swallowed', function () { + Router.map(function () { + this.route('boom'); + }); + App.BoomRoute = _emberRouting.Route.extend({ + init: function () { + throw new Error('boom!'); + } + }); + bootApplication(); + throws(function () { + return _emberMetal.run(router, 'transitionTo', 'boom'); + }, /\bboom\b/); + }); + + QUnit.test('Exception during load of non-initial route is not swallowed', function () { + Router.map(function () { + this.route('boom'); + }); + var lookup = container.lookup; + container.lookup = function () { + if (arguments[0] === 'route:boom') { + throw new Error('boom!'); + } + return lookup.apply(this, arguments); + }; + App.BoomRoute = _emberRouting.Route.extend({ + init: function () { + throw new Error('boom!'); + } + }); + bootApplication(); + throws(function () { + return _emberMetal.run(router, 'transitionTo', 'boom'); + }); + }); + + QUnit.test('Exception during initialization of initial route is not swallowed', function () { + Router.map(function () { + this.route('boom', { path: '/' }); + }); + App.BoomRoute = _emberRouting.Route.extend({ + init: function () { + throw new Error('boom!'); + } + }); + throws(function () { + return bootApplication(); + }, /\bboom\b/); + }); + + QUnit.test('Exception during load of initial route is not swallowed', function () { + Router.map(function () { + this.route('boom', { path: '/' }); + }); + var lookup = container.lookup; + container.lookup = function () { + if (arguments[0] === 'route:boom') { + throw new Error('boom!'); + } + return lookup.apply(this, arguments); + }; + App.BoomRoute = _emberRouting.Route.extend({ + init: function () { + throw new Error('boom!'); + } + }); + throws(function () { + return bootApplication(); + }, /\bboom\b/); + }); + + QUnit.test('{{outlet}} works when created after initial render', function () { + _emberGlimmer.setTemplate('sample', _emberTemplateCompiler.compile('Hi{{#if showTheThing}}{{outlet}}{{/if}}Bye')); + _emberGlimmer.setTemplate('sample/inner', _emberTemplateCompiler.compile('Yay')); + _emberGlimmer.setTemplate('sample/inner2', _emberTemplateCompiler.compile('Boo')); + Router.map(function () { + this.route('sample', { path: '/' }, function () { + this.route('inner', { path: '/' }); + this.route('inner2', { path: '/2' }); + }); + }); + + bootApplication(); + + equal(_emberViews.jQuery('#qunit-fixture').text(), 'HiBye', 'initial render'); + + _emberMetal.run(function () { + return container.lookup('controller:sample').set('showTheThing', true); + }); + + equal(_emberViews.jQuery('#qunit-fixture').text(), 'HiYayBye', 'second render'); + + handleURL('/2'); + + equal(_emberViews.jQuery('#qunit-fixture').text(), 'HiBooBye', 'third render'); + }); + + QUnit.test('Can render into a named outlet at the top level', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('A-{{outlet}}-B-{{outlet "other"}}-C')); + _emberGlimmer.setTemplate('modal', _emberTemplateCompiler.compile('Hello world')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('The index')); + + registry.register('route:application', _emberRouting.Route.extend({ + renderTemplate: function () { + this.render(); + this.render('modal', { + into: 'application', + outlet: 'other' + }); + } + })); + + bootApplication(); + + equal(_emberViews.jQuery('#qunit-fixture').text(), 'A-The index-B-Hello world-C', 'initial render'); + }); + + QUnit.test('Can disconnect a named outlet at the top level', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('A-{{outlet}}-B-{{outlet "other"}}-C')); + _emberGlimmer.setTemplate('modal', _emberTemplateCompiler.compile('Hello world')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('The index')); + + registry.register('route:application', _emberRouting.Route.extend({ + renderTemplate: function () { + this.render(); + this.render('modal', { + into: 'application', + outlet: 'other' + }); + }, + actions: { + banish: function () { + this.disconnectOutlet({ + parentView: 'application', + outlet: 'other' + }); + } + } + })); + + bootApplication(); + + equal(_emberViews.jQuery('#qunit-fixture').text(), 'A-The index-B-Hello world-C', 'initial render'); + + _emberMetal.run(router, 'send', 'banish'); + + equal(_emberViews.jQuery('#qunit-fixture').text(), 'A-The index-B--C', 'second render'); + }); + + QUnit.test('Can render into a named outlet at the top level, with empty main outlet', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('A-{{outlet}}-B-{{outlet "other"}}-C')); + _emberGlimmer.setTemplate('modal', _emberTemplateCompiler.compile('Hello world')); + + Router.map(function () { + this.route('hasNoTemplate', { path: '/' }); + }); + + registry.register('route:application', _emberRouting.Route.extend({ + renderTemplate: function () { + this.render(); + this.render('modal', { + into: 'application', + outlet: 'other' + }); + } + })); + + bootApplication(); + + equal(_emberViews.jQuery('#qunit-fixture').text(), 'A--B-Hello world-C', 'initial render'); + }); + + QUnit.test('Can render into a named outlet at the top level, later', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('A-{{outlet}}-B-{{outlet "other"}}-C')); + _emberGlimmer.setTemplate('modal', _emberTemplateCompiler.compile('Hello world')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('The index')); + + registry.register('route:application', _emberRouting.Route.extend({ + actions: { + launch: function () { + this.render('modal', { + into: 'application', + outlet: 'other' + }); + } + } + })); + + bootApplication(); + + equal(_emberViews.jQuery('#qunit-fixture').text(), 'A-The index-B--C', 'initial render'); + + _emberMetal.run(router, 'send', 'launch'); + + equal(_emberViews.jQuery('#qunit-fixture').text(), 'A-The index-B-Hello world-C', 'second render'); + }); + + QUnit.test('Can render routes with no \'main\' outlet and their children', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{outlet "app"}}
    ')); + _emberGlimmer.setTemplate('app', _emberTemplateCompiler.compile('
    {{outlet "common"}}
    {{outlet "sub"}}
    ')); + _emberGlimmer.setTemplate('common', _emberTemplateCompiler.compile('
    ')); + _emberGlimmer.setTemplate('sub', _emberTemplateCompiler.compile('
    ')); + + Router.map(function () { + this.route('app', { path: '/app' }, function () { + this.route('sub', { path: '/sub', resetNamespace: true }); + }); + }); + + App.AppRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render('app', { + outlet: 'app', + into: 'application' + }); + this.render('common', { + outlet: 'common', + into: 'app' + }); + } + }); + + App.SubRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render('sub', { + outlet: 'sub', + into: 'app' + }); + } + }); + + bootApplication(); + handleURL('/app'); + equal(_emberViews.jQuery('#app-common #common').length, 1, 'Finds common while viewing /app'); + handleURL('/app/sub'); + equal(_emberViews.jQuery('#app-common #common').length, 1, 'Finds common while viewing /app/sub'); + equal(_emberViews.jQuery('#app-sub #sub').length, 1, 'Finds sub while viewing /app/sub'); + }); + + QUnit.test('Tolerates stacked renders', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet}}{{outlet "modal"}}')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('hi')); + _emberGlimmer.setTemplate('layer', _emberTemplateCompiler.compile('layer')); + App.ApplicationRoute = _emberRouting.Route.extend({ + actions: { + openLayer: function () { + this.render('layer', { + into: 'application', + outlet: 'modal' + }); + }, + close: function () { + this.disconnectOutlet({ + outlet: 'modal', + parentView: 'application' + }); + } + } + }); + bootApplication(); + equal(trim(_emberViews.jQuery('#qunit-fixture').text()), 'hi'); + _emberMetal.run(router, 'send', 'openLayer'); + equal(trim(_emberViews.jQuery('#qunit-fixture').text()), 'hilayer'); + _emberMetal.run(router, 'send', 'openLayer'); + equal(trim(_emberViews.jQuery('#qunit-fixture').text()), 'hilayer'); + _emberMetal.run(router, 'send', 'close'); + equal(trim(_emberViews.jQuery('#qunit-fixture').text()), 'hi'); + }); + + QUnit.test('Renders child into parent with non-default template name', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); + _emberGlimmer.setTemplate('exports/root', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); + _emberGlimmer.setTemplate('exports/index', _emberTemplateCompiler.compile('
    ')); + + Router.map(function () { + this.route('root', function () {}); + }); + + App.RootRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render('exports/root'); + } + }); + + App.RootIndexRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render('exports/index'); + } + }); + + bootApplication(); + handleURL('/root'); + equal(_emberViews.jQuery('#qunit-fixture .a .b .c').length, 1); + }); + + QUnit.test('Allows any route to disconnectOutlet another route\'s templates', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet}}{{outlet "modal"}}')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('hi')); + _emberGlimmer.setTemplate('layer', _emberTemplateCompiler.compile('layer')); + App.ApplicationRoute = _emberRouting.Route.extend({ + actions: { + openLayer: function () { + this.render('layer', { + into: 'application', + outlet: 'modal' + }); + } + } + }); + App.IndexRoute = _emberRouting.Route.extend({ + actions: { + close: function () { + this.disconnectOutlet({ + parentView: 'application', + outlet: 'modal' + }); + } + } + }); + bootApplication(); + equal(trim(_emberViews.jQuery('#qunit-fixture').text()), 'hi'); + _emberMetal.run(router, 'send', 'openLayer'); + equal(trim(_emberViews.jQuery('#qunit-fixture').text()), 'hilayer'); + _emberMetal.run(router, 'send', 'close'); + equal(trim(_emberViews.jQuery('#qunit-fixture').text()), 'hi'); + }); + + QUnit.test('Can this.render({into:...}) the render helper', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('other')); + _emberGlimmer.setTemplate('bar', _emberTemplateCompiler.compile('bar')); + + App.IndexRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render({ into: 'sidebar' }); + }, + actions: { + changeToBar: function () { + this.disconnectOutlet({ + parentView: 'sidebar', + outlet: 'main' + }); + this.render('bar', { into: 'sidebar' }); + } + } + }); + + bootApplication(); + equal(_emberViews.jQuery('#qunit-fixture .sidebar').text(), 'other'); + _emberMetal.run(router, 'send', 'changeToBar'); + equal(_emberViews.jQuery('#qunit-fixture .sidebar').text(), 'bar'); + }); + + QUnit.test('Can disconnect from the render helper', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('other')); + + App.IndexRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render({ into: 'sidebar' }); + }, + actions: { + disconnect: function () { + this.disconnectOutlet({ + parentView: 'sidebar', + outlet: 'main' + }); + } + } + }); + + bootApplication(); + equal(_emberViews.jQuery('#qunit-fixture .sidebar').text(), 'other'); + _emberMetal.run(router, 'send', 'disconnect'); + equal(_emberViews.jQuery('#qunit-fixture .sidebar').text(), ''); + }); + + QUnit.test('Can this.render({into:...}) the render helper\'s children', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); + _emberGlimmer.setTemplate('other', _emberTemplateCompiler.compile('other')); + _emberGlimmer.setTemplate('bar', _emberTemplateCompiler.compile('bar')); + + App.IndexRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render({ into: 'sidebar' }); + this.render('other', { into: 'index' }); + }, + actions: { + changeToBar: function () { + this.disconnectOutlet({ + parentView: 'index', + outlet: 'main' + }); + this.render('bar', { into: 'index' }); + } + } + }); + + bootApplication(); + equal(_emberViews.jQuery('#qunit-fixture .sidebar .index').text(), 'other'); + _emberMetal.run(router, 'send', 'changeToBar'); + equal(_emberViews.jQuery('#qunit-fixture .sidebar .index').text(), 'bar'); + }); + + QUnit.test('Can disconnect from the render helper\'s children', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); + _emberGlimmer.setTemplate('other', _emberTemplateCompiler.compile('other')); + + App.IndexRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render({ into: 'sidebar' }); + this.render('other', { into: 'index' }); + }, + actions: { + disconnect: function () { + this.disconnectOutlet({ + parentView: 'index', + outlet: 'main' + }); + } + } + }); + + bootApplication(); + equal(_emberViews.jQuery('#qunit-fixture .sidebar .index').text(), 'other'); + _emberMetal.run(router, 'send', 'disconnect'); + equal(_emberViews.jQuery('#qunit-fixture .sidebar .index').text(), ''); + }); + + QUnit.test('Can this.render({into:...}) nested render helpers', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); + _emberGlimmer.setTemplate('cart', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('other')); + _emberGlimmer.setTemplate('baz', _emberTemplateCompiler.compile('baz')); + + App.IndexRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render({ into: 'cart' }); + }, + actions: { + changeToBaz: function () { + this.disconnectOutlet({ + parentView: 'cart', + outlet: 'main' + }); + this.render('baz', { into: 'cart' }); + } + } + }); + + bootApplication(); + equal(_emberViews.jQuery('#qunit-fixture .cart').text(), 'other'); + _emberMetal.run(router, 'send', 'changeToBaz'); + equal(_emberViews.jQuery('#qunit-fixture .cart').text(), 'baz'); + }); + + QUnit.test('Can disconnect from nested render helpers', function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); + _emberGlimmer.setTemplate('cart', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('other')); + + App.IndexRoute = _emberRouting.Route.extend({ + renderTemplate: function () { + this.render({ into: 'cart' }); + }, + actions: { + disconnect: function () { + this.disconnectOutlet({ + parentView: 'cart', + outlet: 'main' + }); + } + } + }); + + bootApplication(); + equal(_emberViews.jQuery('#qunit-fixture .cart').text(), 'other'); + _emberMetal.run(router, 'send', 'disconnect'); + equal(_emberViews.jQuery('#qunit-fixture .cart').text(), ''); + }); + + QUnit.test('Components inside an outlet have their didInsertElement hook invoked when the route is displayed', function (assert) { + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('{{#if showFirst}}{{my-component}}{{else}}{{other-component}}{{/if}}')); + + var myComponentCounter = 0; + var otherComponentCounter = 0; + var indexController = undefined; + + App.IndexController = _emberRuntime.Controller.extend({ + showFirst: true + }); + + App.IndexRoute = _emberRouting.Route.extend({ + setupController: function (controller) { + indexController = controller; + } + }); + + App.MyComponentComponent = _emberGlimmer.Component.extend({ + didInsertElement: function () { + myComponentCounter++; + } + }); + + App.OtherComponentComponent = _emberGlimmer.Component.extend({ + didInsertElement: function () { + otherComponentCounter++; + } + }); + + bootApplication(); + + assert.strictEqual(myComponentCounter, 1, 'didInsertElement invoked on displayed component'); + assert.strictEqual(otherComponentCounter, 0, 'didInsertElement not invoked on displayed component'); + + _emberMetal.run(function () { + return indexController.set('showFirst', false); + }); + + assert.strictEqual(myComponentCounter, 1, 'didInsertElement not invoked on displayed component'); + assert.strictEqual(otherComponentCounter, 1, 'didInsertElement invoked on displayed component'); + }); + + QUnit.test('Doesnt swallow exception thrown from willTransition', function () { + expect(1); + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('index')); + _emberGlimmer.setTemplate('other', _emberTemplateCompiler.compile('other')); + + Router.map(function () { + this.route('other', function () {}); + }); + + App.IndexRoute = _emberRouting.Route.extend({ + actions: { + willTransition: function () { + throw new Error('boom'); + } + } + }); + + bootApplication(); + + throws(function () { + _emberMetal.run(function () { + return router.handleURL('/other'); + }); + }, /boom/, 'expected an exception that didnt happen'); + }); + + QUnit.test('Exception if outlet name is undefined in render and disconnectOutlet', function (assert) { + App.ApplicationRoute = _emberRouting.Route.extend({ + actions: { + showModal: function () { + this.render({ + outlet: undefined, + parentView: 'application' + }); + }, + hideModal: function () { + this.disconnectOutlet({ + outlet: undefined, + parentView: 'application' + }); + } + } + }); + + bootApplication(); + + throws(function () { + _emberMetal.run(function () { + return router.send('showModal'); + }); + }, /You passed undefined as the outlet name/); + + throws(function () { + _emberMetal.run(function () { + return router.send('hideModal'); + }); + }, /You passed undefined as the outlet name/); + }); + + QUnit.test('Route serializers work for Engines', function () { + expect(2); + + // Register engine + var BlogEngine = _emberApplication.Engine.extend(); + registry.register('engine:blog', BlogEngine); + + // Register engine route map + var postSerialize = function (params) { + ok(true, 'serialize hook runs'); + return { + post_id: params.id + }; + }; + var BlogMap = function () { + this.route('post', { path: '/post/:post_id', serialize: postSerialize }); + }; + registry.register('route-map:blog', BlogMap); + + Router.map(function () { + this.mount('blog'); + }); + + bootApplication(); + + equal(router.router.generate('blog.post', { id: '13' }), '/blog/post/13', 'url is generated properly'); + }); + + QUnit.test('Defining a Route#serialize method in an Engine throws an error', function () { + expect(1); + + // Register engine + var BlogEngine = _emberApplication.Engine.extend(); + registry.register('engine:blog', BlogEngine); + + // Register engine route map + var BlogMap = function () { + this.route('post'); + }; + registry.register('route-map:blog', BlogMap); + + Router.map(function () { + this.mount('blog'); + }); + + bootApplication(); + + var PostRoute = _emberRouting.Route.extend({ serialize: function () {} }); + container.lookup('engine:blog').register('route:post', PostRoute); + + throws(function () { + return router.transitionTo('blog.post'); + }, /Defining a custom serialize method on an Engine route is not supported/); + }); + + QUnit.test('App.destroy does not leave undestroyed views after clearing engines', function () { + expect(4); + + var engineInstance = undefined; + // Register engine + var BlogEngine = _emberApplication.Engine.extend(); + registry.register('engine:blog', BlogEngine); + var EngineIndexRoute = _emberRouting.Route.extend({ + init: function () { + this._super.apply(this, arguments); + engineInstance = _emberUtils.getOwner(this); + } + }); + + // Register engine route map + var BlogMap = function () { + this.route('post'); + }; + registry.register('route-map:blog', BlogMap); + + Router.map(function () { + this.mount('blog'); + }); + + bootApplication(); + + var engine = container.lookup('engine:blog'); + engine.register('route:index', EngineIndexRoute); + engine.register('template:index', _emberTemplateCompiler.compile('Engine Post!')); + + handleURL('/blog'); + + var route = engineInstance.lookup('route:index'); + + _emberMetal.run(router, 'destroy'); + equal(router._toplevelView, null, 'the toplevelView was cleared'); + + _emberMetal.run(route, 'destroy'); + equal(router._toplevelView, null, 'the toplevelView was not reinitialized'); + + _emberMetal.run(App, 'destroy'); + equal(router._toplevelView, null, 'the toplevelView was not reinitialized'); + }); +}); +enifed('ember/tests/routing/basic_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/routing'); + test('ember/tests/routing/basic_test.js should pass jscs', function () { + ok(true, 'ember/tests/routing/basic_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/routing/basic_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/routing'); + QUnit.test('ember/tests/routing/basic_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/basic_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'ember-metal', 'ember-routing', 'ember-views', 'internal-test-helpers'], function (exports, _emberRuntime, _emberMetal, _emberRouting, _emberViews, _internalTestHelpers) { + 'use strict'; + + _internalTestHelpers.moduleFor('Query Params - main', (function (_QueryParamTestCase) { + babelHelpers.inherits(_class, _QueryParamTestCase); + + function _class() { + _QueryParamTestCase.apply(this, arguments); + } + + _class.prototype.refreshModelWhileLoadingTest = function refreshModelWhileLoadingTest(loadingReturn) { + var _actions, + _this = this; + + var assert = this.assert; + + assert.expect(9); + + var appModelCount = 0; + var promiseResolve = undefined; + + this.registerRoute('application', _emberRouting.Route.extend({ + queryParams: { + appomg: { + defaultValue: 'applol' + } + }, + model: function (params) { + appModelCount++; + } + })); + + this.setSingleQPController('index', 'omg', undefined, { + omg: undefined + }); + + var actionName = typeof loadingReturn !== 'undefined' ? 'loading' : 'ignore'; + var indexModelCount = 0; + this.registerRoute('index', _emberRouting.Route.extend({ + queryParams: { + omg: { + refreshModel: true + } + }, + actions: (_actions = {}, _actions[actionName] = function () { + return loadingReturn; + }, _actions), + model: function (params) { + indexModelCount++; + if (indexModelCount === 2) { + assert.deepEqual(params, { omg: 'lex' }); + return new _emberRuntime.RSVP.Promise(function (resolve) { + promiseResolve = resolve; + return; + }); + } else if (indexModelCount === 3) { + assert.deepEqual(params, { omg: 'hello' }, 'Model hook reruns even if the previous one didnt finish'); + } + } + })); + + return this.visit('/').then(function () { + assert.equal(appModelCount, 1, 'appModelCount is 1'); + assert.equal(indexModelCount, 1); + + var indexController = _this.getController('index'); + _this.setAndFlush(indexController, 'omg', 'lex'); + + assert.equal(appModelCount, 1, 'appModelCount is 1'); + assert.equal(indexModelCount, 2); + + _this.setAndFlush(indexController, 'omg', 'hello'); + assert.equal(appModelCount, 1, 'appModelCount is 1'); + assert.equal(indexModelCount, 3); + + _emberMetal.run(function () { + promiseResolve(); + }); + + assert.equal(_emberMetal.get(indexController, 'omg'), 'hello', 'At the end last value prevails'); + }); + }; + + _class.prototype['@test No replaceURL occurs on startup because default values don\'t show up in URL'] = function testNoReplaceURLOccursOnStartupBecauseDefaultValuesDonTShowUpInURL(assert) { + assert.expect(1); + + this.setSingleQPController('index'); + + return this.visitAndAssert('/'); + }; + + _class.prototype['@test Calling transitionTo does not lose query params already on the activeTransition'] = function testCallingTransitionToDoesNotLoseQueryParamsAlreadyOnTheActiveTransition(assert) { + var _this2 = this; + + assert.expect(2); + + this.router.map(function () { + this.route('parent', function () { + this.route('child'); + this.route('sibling'); + }); + }); + + this.registerRoute('parent.child', _emberRouting.Route.extend({ + afterModel: function () { + this.transitionTo('parent.sibling'); + } + })); + + this.setSingleQPController('parent'); + + return this.visit('/parent/child?foo=lol').then(function () { + _this2.assertCurrentPath('/parent/sibling?foo=lol', 'redirected to the sibling route, instead of child route'); + assert.equal(_this2.getController('parent').get('foo'), 'lol', 'controller has value from the active transition'); + }); + }; + + _class.prototype['@test Single query params can be set on the controller and reflected in the url'] = function testSingleQueryParamsCanBeSetOnTheControllerAndReflectedInTheUrl(assert) { + var _this3 = this; + + assert.expect(3); + + this.router.map(function () { + this.route('home', { path: '/' }); + }); + + this.setSingleQPController('home'); + + return this.visitAndAssert('/').then(function () { + var controller = _this3.getController('home'); + + _this3.setAndFlush(controller, 'foo', '456'); + _this3.assertCurrentPath('/?foo=456'); + + _this3.setAndFlush(controller, 'foo', '987'); + _this3.assertCurrentPath('/?foo=987'); + }); + }; + + _class.prototype['@test Query params can map to different url keys configured on the controller'] = function testQueryParamsCanMapToDifferentUrlKeysConfiguredOnTheController(assert) { + var _this4 = this; + + assert.expect(6); + + this.registerController('index', _emberRuntime.Controller.extend({ + queryParams: [{ foo: 'other_foo', bar: { as: 'other_bar' } }], + foo: 'FOO', + bar: 'BAR' + })); + + return this.visitAndAssert('/').then(function () { + var controller = _this4.getController('index'); + + _this4.setAndFlush(controller, 'foo', 'LEX'); + _this4.assertCurrentPath('/?other_foo=LEX', 'QP mapped correctly without \'as\''); + + _this4.setAndFlush(controller, 'foo', 'WOO'); + _this4.assertCurrentPath('/?other_foo=WOO', 'QP updated correctly without \'as\''); + + _this4.transitionTo('/?other_foo=NAW'); + assert.equal(controller.get('foo'), 'NAW', 'QP managed correctly on URL transition'); + + _this4.setAndFlush(controller, 'bar', 'NERK'); + _this4.assertCurrentPath('/?other_bar=NERK&other_foo=NAW', 'QP mapped correctly with \'as\''); + + _this4.setAndFlush(controller, 'bar', 'NUKE'); + _this4.assertCurrentPath('/?other_bar=NUKE&other_foo=NAW', 'QP updated correctly with \'as\''); + }); + }; + + _class.prototype['@test Routes have a private overridable serializeQueryParamKey hook'] = function testRoutesHaveAPrivateOverridableSerializeQueryParamKeyHook(assert) { + var _this5 = this; + + assert.expect(2); + + this.registerRoute('index', _emberRouting.Route.extend({ + serializeQueryParamKey: _emberRuntime.String.dasherize + })); + + this.setSingleQPController('index', 'funTimes', ''); + + return this.visitAndAssert('/').then(function () { + var controller = _this5.getController('index'); + + _this5.setAndFlush(controller, 'funTimes', 'woot'); + _this5.assertCurrentPath('/?fun-times=woot'); + }); + }; + + _class.prototype['@test Can override inherited QP behavior by specifying queryParams as a computed property'] = function testCanOverrideInheritedQPBehaviorBySpecifyingQueryParamsAsAComputedProperty(assert) { + var _this6 = this; + + assert.expect(3); + + this.setSingleQPController('index', 'a', 0, { + queryParams: _emberMetal.computed(function () { + return ['c']; + }), + c: true + }); + + return this.visitAndAssert('/').then(function () { + var indexController = _this6.getController('index'); + + _this6.setAndFlush(indexController, 'a', 1); + _this6.assertCurrentPath('/', 'QP did not update due to being overriden'); + + _this6.setAndFlush(indexController, 'c', false); + _this6.assertCurrentPath('/?c=false', 'QP updated with overriden param'); + }); + }; + + _class.prototype['@test Can concatenate inherited QP behavior by specifying queryParams as an array'] = function testCanConcatenateInheritedQPBehaviorBySpecifyingQueryParamsAsAnArray(assert) { + var _this7 = this; + + assert.expect(3); + + this.setSingleQPController('index', 'a', 0, { + queryParams: ['c'], + c: true + }); + + return this.visitAndAssert('/').then(function () { + var indexController = _this7.getController('index'); + + _this7.setAndFlush(indexController, 'a', 1); + _this7.assertCurrentPath('/?a=1', 'Inherited QP did update'); + + _this7.setAndFlush(indexController, 'c', false); + _this7.assertCurrentPath('/?a=1&c=false', 'New QP did update'); + }); + }; + + _class.prototype['@test model hooks receives query params'] = function testModelHooksReceivesQueryParams(assert) { + assert.expect(2); + + this.setSingleQPController('index'); + + this.registerRoute('index', _emberRouting.Route.extend({ + model: function (params) { + assert.deepEqual(params, { foo: 'bar' }); + } + })); + + return this.visitAndAssert('/'); + }; + + _class.prototype['@test model hooks receives query params with dynamic segment params'] = function testModelHooksReceivesQueryParamsWithDynamicSegmentParams(assert) { + assert.expect(2); + + this.router.map(function () { + this.route('index', { path: '/:id' }); + }); + + this.setSingleQPController('index'); + + this.registerRoute('index', _emberRouting.Route.extend({ + model: function (params) { + assert.deepEqual(params, { foo: 'bar', id: 'baz' }); + } + })); + + return this.visitAndAssert('/baz'); + }; + + _class.prototype['@test model hooks receives query params (overridden by incoming url value)'] = function testModelHooksReceivesQueryParamsOverriddenByIncomingUrlValue(assert) { + assert.expect(2); + + this.router.map(function () { + this.route('index', { path: '/:id' }); + }); + + this.setSingleQPController('index'); + + this.registerRoute('index', _emberRouting.Route.extend({ + model: function (params) { + assert.deepEqual(params, { foo: 'baz', id: 'boo' }); + } + })); + + return this.visitAndAssert('/boo?foo=baz'); + }; + + _class.prototype['@test error is thrown if dynamic segment and query param have same name'] = function testErrorIsThrownIfDynamicSegmentAndQueryParamHaveSameName(assert) { + var _this8 = this; + + assert.expect(1); + + this.router.map(function () { + this.route('index', { path: '/:foo' }); + }); + + this.setSingleQPController('index'); + + expectAssertion(function () { + _this8.visitAndAssert('/boo?foo=baz'); + }, 'The route \'index\' has both a dynamic segment and query param with name \'foo\'. Please rename one to avoid collisions.'); + }; + + _class.prototype['@test controllers won\'t be eagerly instantiated by internal query params logic'] = function testControllersWonTBeEagerlyInstantiatedByInternalQueryParamsLogic(assert) { + var _this9 = this; + + assert.expect(10); + + this.router.map(function () { + this.route('cats', function () { + this.route('index', { path: '/' }); + }); + this.route('home', { path: '/' }); + this.route('about'); + }); + + this.registerTemplate('home', '

    {{link-to \'About\' \'about\' (query-params lol=\'wat\') id=\'link-to-about\'}}

    '); + this.registerTemplate('about', '

    {{link-to \'Home\' \'home\' (query-params foo=\'naw\')}}

    '); + this.registerTemplate('cats.index', '

    {{link-to \'Cats\' \'cats\' (query-params name=\'domino\') id=\'cats-link\'}}

    '); + + var homeShouldBeCreated = false; + var aboutShouldBeCreated = false; + var catsIndexShouldBeCreated = false; + + this.registerRoute('home', _emberRouting.Route.extend({ + setup: function () { + homeShouldBeCreated = true; + this._super.apply(this, arguments); + } + })); + + this.setSingleQPController('home', 'foo', '123', { + init: function () { + this._super.apply(this, arguments); + assert.ok(homeShouldBeCreated, 'HomeController should be created at this time'); + } + }); + + this.registerRoute('about', _emberRouting.Route.extend({ + setup: function () { + aboutShouldBeCreated = true; + this._super.apply(this, arguments); + } + })); + + this.setSingleQPController('about', 'lol', 'haha', { + init: function () { + this._super.apply(this, arguments); + assert.ok(aboutShouldBeCreated, 'AboutController should be created at this time'); + } + }); + + this.registerRoute('cats.index', _emberRouting.Route.extend({ + model: function () { + return []; + }, + setup: function () { + catsIndexShouldBeCreated = true; + this._super.apply(this, arguments); + }, + setupController: function (controller, context) { + controller.set('model', context); + } + })); + + this.registerController('cats.index', _emberRuntime.Controller.extend({ + queryParams: ['breed', 'name'], + breed: 'Golden', + name: null, + init: function () { + this._super.apply(this, arguments); + assert.ok(catsIndexShouldBeCreated, 'CatsIndexController should be created at this time'); + } + })); + + return this.visitAndAssert('/').then(function () { + var controller = _this9.getController('home'); + + _this9.setAndFlush(controller, 'foo', '456'); + _this9.assertCurrentPath('/?foo=456'); + assert.equal(_emberViews.jQuery('#link-to-about').attr('href'), '/about?lol=wat', 'link to about is correct'); + + _this9.transitionTo('about'); + _this9.assertCurrentPath('/about'); + + _this9.transitionTo('cats'); + _this9.assertCurrentPath('/cats'); + assert.equal(_emberViews.jQuery('#cats-link').attr('href'), '/cats?name=domino', 'link to cats is correct'); + + _emberMetal.run(_emberViews.jQuery('#cats-link'), 'click'); + _this9.assertCurrentPath('/cats?name=domino'); + }); + }; + + _class.prototype['@test query params have been set by the time setupController is called'] = function testQueryParamsHaveBeenSetByTheTimeSetupControllerIsCalled(assert) { + assert.expect(2); + + this.setSingleQPController('application'); + + this.registerRoute('application', _emberRouting.Route.extend({ + setupController: function (controller) { + assert.equal(controller.get('foo'), 'YEAH', 'controller\'s foo QP property set before setupController called'); + } + })); + + return this.visitAndAssert('/?foo=YEAH'); + }; + + _class.prototype['@test mapped query params have been set by the time setupController is called'] = function testMappedQueryParamsHaveBeenSetByTheTimeSetupControllerIsCalled(assert) { + assert.expect(2); + + this.setSingleQPController('application', { faz: 'foo' }); + + this.registerRoute('application', _emberRouting.Route.extend({ + setupController: function (controller) { + assert.equal(controller.get('faz'), 'YEAH', 'controller\'s foo QP property set before setupController called'); + } + })); + + return this.visitAndAssert('/?foo=YEAH'); + }; + + _class.prototype['@test Route#paramsFor fetches query params with default value'] = function testRouteParamsForFetchesQueryParamsWithDefaultValue(assert) { + assert.expect(2); + + this.router.map(function () { + this.route('index', { path: '/:something' }); + }); + + this.setSingleQPController('index'); + + this.registerRoute('index', _emberRouting.Route.extend({ + model: function (params, transition) { + assert.deepEqual(this.paramsFor('index'), { something: 'baz', foo: 'bar' }, 'could retrieve params for index'); + } + })); + + return this.visitAndAssert('/baz'); + }; + + _class.prototype['@test Route#paramsFor fetches query params with non-default value'] = function testRouteParamsForFetchesQueryParamsWithNonDefaultValue(assert) { + assert.expect(2); + + this.router.map(function () { + this.route('index', { path: '/:something' }); + }); + + this.setSingleQPController('index'); + + this.registerRoute('index', _emberRouting.Route.extend({ + model: function (params, transition) { + assert.deepEqual(this.paramsFor('index'), { something: 'baz', foo: 'boo' }, 'could retrieve params for index'); + } + })); + + return this.visitAndAssert('/baz?foo=boo'); + }; + + _class.prototype['@test Route#paramsFor fetches default falsy query params'] = function testRouteParamsForFetchesDefaultFalsyQueryParams(assert) { + assert.expect(2); + + this.router.map(function () { + this.route('index', { path: '/:something' }); + }); + + this.setSingleQPController('index', 'foo', false); + + this.registerRoute('index', _emberRouting.Route.extend({ + model: function (params, transition) { + assert.deepEqual(this.paramsFor('index'), { something: 'baz', foo: false }, 'could retrieve params for index'); + } + })); + + return this.visitAndAssert('/baz'); + }; + + _class.prototype['@test Route#paramsFor fetches non-default falsy query params'] = function testRouteParamsForFetchesNonDefaultFalsyQueryParams(assert) { + assert.expect(2); + + this.router.map(function () { + this.route('index', { path: '/:something' }); + }); + + this.setSingleQPController('index', 'foo', true); + + this.registerRoute('index', _emberRouting.Route.extend({ + model: function (params, transition) { + assert.deepEqual(this.paramsFor('index'), { something: 'baz', foo: false }, 'could retrieve params for index'); + } + })); + + return this.visitAndAssert('/baz?foo=false'); + }; + + _class.prototype['@test model hook can query prefix-less application params'] = function testModelHookCanQueryPrefixLessApplicationParams(assert) { + assert.expect(4); + + this.setSingleQPController('application', 'appomg', 'applol'); + this.setSingleQPController('index', 'omg', 'lol'); + + this.registerRoute('application', _emberRouting.Route.extend({ + model: function (params) { + assert.deepEqual(params, { appomg: 'applol' }); + } + })); + + this.registerRoute('index', _emberRouting.Route.extend({ + model: function (params) { + assert.deepEqual(params, { omg: 'lol' }); + assert.deepEqual(this.paramsFor('application'), { appomg: 'applol' }); + } + })); + + return this.visitAndAssert('/'); + }; + + _class.prototype['@test model hook can query prefix-less application params (overridden by incoming url value)'] = function testModelHookCanQueryPrefixLessApplicationParamsOverriddenByIncomingUrlValue(assert) { + assert.expect(4); + + this.setSingleQPController('application', 'appomg', 'applol'); + this.setSingleQPController('index', 'omg', 'lol'); + + this.registerRoute('application', _emberRouting.Route.extend({ + model: function (params) { + assert.deepEqual(params, { appomg: 'appyes' }); + } + })); + + this.registerRoute('index', _emberRouting.Route.extend({ + model: function (params) { + assert.deepEqual(params, { omg: 'yes' }); + assert.deepEqual(this.paramsFor('application'), { appomg: 'appyes' }); + } + })); + + return this.visitAndAssert('/?appomg=appyes&omg=yes'); + }; + + _class.prototype['@test can opt into full transition by setting refreshModel in route queryParams'] = function testCanOptIntoFullTransitionBySettingRefreshModelInRouteQueryParams(assert) { + var _this10 = this; + + assert.expect(7); + + this.setSingleQPController('application', 'appomg', 'applol'); + this.setSingleQPController('index', 'omg', 'lol'); + + var appModelCount = 0; + this.registerRoute('application', _emberRouting.Route.extend({ + model: function (params) { + appModelCount++; + } + })); + + var indexModelCount = 0; + this.registerRoute('index', _emberRouting.Route.extend({ + queryParams: { + omg: { + refreshModel: true + } + }, + model: function (params) { + indexModelCount++; + + if (indexModelCount === 1) { + assert.deepEqual(params, { omg: 'lol' }, 'params are correct on first pass'); + } else if (indexModelCount === 2) { + assert.deepEqual(params, { omg: 'lex' }, 'params are correct on second pass'); + } + } + })); + + return this.visitAndAssert('/').then(function () { + assert.equal(appModelCount, 1, 'app model hook ran'); + assert.equal(indexModelCount, 1, 'index model hook ran'); + + var indexController = _this10.getController('index'); + _this10.setAndFlush(indexController, 'omg', 'lex'); + + assert.equal(appModelCount, 1, 'app model hook did not run again'); + assert.equal(indexModelCount, 2, 'index model hook ran again due to refreshModel'); + }); + }; + + _class.prototype['@test refreshModel does not cause a second transition during app boot '] = function testRefreshModelDoesNotCauseASecondTransitionDuringAppBoot(assert) { + assert.expect(1); + + this.setSingleQPController('application', 'appomg', 'applol'); + this.setSingleQPController('index', 'omg', 'lol'); + + this.registerRoute('index', _emberRouting.Route.extend({ + queryParams: { + omg: { + refreshModel: true + } + }, + refresh: function () { + assert.ok(false); + } + })); + + return this.visitAndAssert('/?appomg=hello&omg=world'); + }; + + _class.prototype['@test queryParams are updated when a controller property is set and the route is refreshed. Issue #13263 '] = function testQueryParamsAreUpdatedWhenAControllerPropertyIsSetAndTheRouteIsRefreshedIssue13263(assert) { + var _this11 = this; + + this.registerTemplate('application', '{{foo}}{{outlet}}'); + + this.setSingleQPController('application', 'foo', 1, { + actions: { + increment: function () { + this.incrementProperty('foo'); + this.send('refreshRoute'); + } + } + }); + + this.registerRoute('application', _emberRouting.Route.extend({ + actions: { + refreshRoute: function () { + this.refresh(); + } + } + })); + + return this.visitAndAssert('/').then(function () { + assert.equal(_emberViews.jQuery('#test-value').text().trim(), '1'); + + _emberMetal.run(_emberViews.jQuery('#test-button'), 'click'); + assert.equal(_emberViews.jQuery('#test-value').text().trim(), '2'); + _this11.assertCurrentPath('/?foo=2'); + + _emberMetal.run(_emberViews.jQuery('#test-button'), 'click'); + assert.equal(_emberViews.jQuery('#test-value').text().trim(), '3'); + _this11.assertCurrentPath('/?foo=3'); + }); + }; + + _class.prototype['@test Use Ember.get to retrieve query params \'refreshModel\' configuration'] = function testUseEmberGetToRetrieveQueryParamsRefreshModelConfiguration(assert) { + var _this12 = this; + + assert.expect(7); + + this.setSingleQPController('application', 'appomg', 'applol'); + this.setSingleQPController('index', 'omg', 'lol'); + + var appModelCount = 0; + this.registerRoute('application', _emberRouting.Route.extend({ + model: function (params) { + appModelCount++; + } + })); + + var indexModelCount = 0; + this.registerRoute('index', _emberRouting.Route.extend({ + queryParams: _emberRuntime.Object.create({ + unknownProperty: function (keyName) { + return { refreshModel: true }; + } + }), + model: function (params) { + indexModelCount++; + + if (indexModelCount === 1) { + assert.deepEqual(params, { omg: 'lol' }); + } else if (indexModelCount === 2) { + assert.deepEqual(params, { omg: 'lex' }); + } + } + })); + + return this.visitAndAssert('/').then(function () { + assert.equal(appModelCount, 1); + assert.equal(indexModelCount, 1); + + var indexController = _this12.getController('index'); + _this12.setAndFlush(indexController, 'omg', 'lex'); + + assert.equal(appModelCount, 1); + assert.equal(indexModelCount, 2); + }); + }; + + _class.prototype['@test can use refreshModel even with URL changes that remove QPs from address bar'] = function testCanUseRefreshModelEvenWithURLChangesThatRemoveQPsFromAddressBar(assert) { + var _this13 = this; + + assert.expect(4); + + this.setSingleQPController('index', 'omg', 'lol'); + + var indexModelCount = 0; + this.registerRoute('index', _emberRouting.Route.extend({ + queryParams: { + omg: { + refreshModel: true + } + }, + model: function (params) { + indexModelCount++; + + var data = undefined; + if (indexModelCount === 1) { + data = 'foo'; + } else if (indexModelCount === 2) { + data = 'lol'; + } + + assert.deepEqual(params, { omg: data }, 'index#model receives right data'); + } + })); + + return this.visitAndAssert('/?omg=foo').then(function () { + _this13.transitionTo('/'); + + var indexController = _this13.getController('index'); + assert.equal(indexController.get('omg'), 'lol'); + }); + }; + + _class.prototype['@test can opt into a replace query by specifying replace:true in the Route config hash'] = function testCanOptIntoAReplaceQueryBySpecifyingReplaceTrueInTheRouteConfigHash(assert) { + var _this14 = this; + + assert.expect(2); + + this.setSingleQPController('application', 'alex', 'matchneer'); + + this.registerRoute('application', _emberRouting.Route.extend({ + queryParams: { + alex: { + replace: true + } + } + })); + + return this.visitAndAssert('/').then(function () { + var appController = _this14.getController('application'); + _this14.expectedReplaceURL = '/?alex=wallace'; + _this14.setAndFlush(appController, 'alex', 'wallace'); + }); + }; + + _class.prototype['@test Route query params config can be configured using property name instead of URL key'] = function testRouteQueryParamsConfigCanBeConfiguredUsingPropertyNameInsteadOfURLKey(assert) { + var _this15 = this; + + assert.expect(2); + + this.registerController('application', _emberRuntime.Controller.extend({ + queryParams: [{ commitBy: 'commit_by' }] + })); + + this.registerRoute('application', _emberRouting.Route.extend({ + queryParams: { + commitBy: { + replace: true + } + } + })); + + return this.visitAndAssert('/').then(function () { + var appController = _this15.getController('application'); + _this15.expectedReplaceURL = '/?commit_by=igor_seb'; + _this15.setAndFlush(appController, 'commitBy', 'igor_seb'); + }); + }; + + _class.prototype['@test An explicit replace:false on a changed QP always wins and causes a pushState'] = function testAnExplicitReplaceFalseOnAChangedQPAlwaysWinsAndCausesAPushState(assert) { + var _this16 = this; + + assert.expect(3); + + this.registerController('application', _emberRuntime.Controller.extend({ + queryParams: ['alex', 'steely'], + alex: 'matchneer', + steely: 'dan' + })); + + this.registerRoute('application', _emberRouting.Route.extend({ + queryParams: { + alex: { + replace: true + }, + steely: { + replace: false + } + } + })); + + return this.visit('/').then(function () { + var appController = _this16.getController('application'); + _this16.expectedPushURL = '/?alex=wallace&steely=jan'; + _emberMetal.run(appController, 'setProperties', { alex: 'wallace', steely: 'jan' }); + + _this16.expectedPushURL = '/?alex=wallace&steely=fran'; + _emberMetal.run(appController, 'setProperties', { steely: 'fran' }); + + _this16.expectedReplaceURL = '/?alex=sriracha&steely=fran'; + _emberMetal.run(appController, 'setProperties', { alex: 'sriracha' }); + }); + }; + + _class.prototype['@test can opt into full transition by setting refreshModel in route queryParams when transitioning from child to parent'] = function testCanOptIntoFullTransitionBySettingRefreshModelInRouteQueryParamsWhenTransitioningFromChildToParent(assert) { + this.registerTemplate('parent', '{{outlet}}'); + this.registerTemplate('parent.child', '{{link-to \'Parent\' \'parent\' (query-params foo=\'change\') id=\'parent-link\'}}'); + + this.router.map(function () { + this.route('parent', function () { + this.route('child'); + }); + }); + + var parentModelCount = 0; + this.registerRoute('parent', _emberRouting.Route.extend({ + model: function () { + parentModelCount++; + }, + queryParams: { + foo: { + refreshModel: true + } + } + })); + + this.setSingleQPController('parent', 'foo', 'abc'); + + return this.visit('/parent/child?foo=lol').then(function () { + assert.equal(parentModelCount, 1); + + _emberMetal.run(_emberViews.jQuery('#parent-link'), 'click'); + assert.equal(parentModelCount, 2); + }); + }; + + _class.prototype['@test Use Ember.get to retrieve query params \'replace\' configuration'] = function testUseEmberGetToRetrieveQueryParamsReplaceConfiguration(assert) { + var _this17 = this; + + assert.expect(2); + + this.setSingleQPController('application', 'alex', 'matchneer'); + + this.registerRoute('application', _emberRouting.Route.extend({ + queryParams: _emberRuntime.Object.create({ + unknownProperty: function (keyName) { + // We are simulating all qps requiring refresh + return { replace: true }; + } + }) + })); + + return this.visitAndAssert('/').then(function () { + var appController = _this17.getController('application'); + _this17.expectedReplaceURL = '/?alex=wallace'; + _this17.setAndFlush(appController, 'alex', 'wallace'); + }); + }; + + _class.prototype['@test can override incoming QP values in setupController'] = function testCanOverrideIncomingQPValuesInSetupController(assert) { + var _this18 = this; + + assert.expect(3); + + this.router.map(function () { + this.route('about'); + }); + + this.setSingleQPController('index', 'omg', 'lol'); + + this.registerRoute('index', _emberRouting.Route.extend({ + setupController: function (controller) { + assert.ok(true, 'setupController called'); + controller.set('omg', 'OVERRIDE'); + }, + actions: { + queryParamsDidChange: function () { + assert.ok(false, 'queryParamsDidChange shouldn\'t fire'); + } + } + })); + + return this.visitAndAssert('/about').then(function () { + _this18.transitionTo('index'); + _this18.assertCurrentPath('/?omg=OVERRIDE'); + }); + }; + + _class.prototype['@test can override incoming QP array values in setupController'] = function testCanOverrideIncomingQPArrayValuesInSetupController(assert) { + var _this19 = this; + + assert.expect(3); + + this.router.map(function () { + this.route('about'); + }); + + this.setSingleQPController('index', 'omg', ['lol']); + + this.registerRoute('index', _emberRouting.Route.extend({ + setupController: function (controller) { + assert.ok(true, 'setupController called'); + controller.set('omg', ['OVERRIDE']); + }, + actions: { + queryParamsDidChange: function () { + assert.ok(false, 'queryParamsDidChange shouldn\'t fire'); + } + } + })); + + return this.visitAndAssert('/about').then(function () { + _this19.transitionTo('index'); + _this19.assertCurrentPath('/?omg=' + encodeURIComponent(JSON.stringify(['OVERRIDE']))); + }); + }; + + _class.prototype['@test URL transitions that remove QPs still register as QP changes'] = function testURLTransitionsThatRemoveQPsStillRegisterAsQPChanges(assert) { + var _this20 = this; + + assert.expect(2); + + this.setSingleQPController('index', 'omg', 'lol'); + + return this.visit('/?omg=borf').then(function () { + var indexController = _this20.getController('index'); + assert.equal(indexController.get('omg'), 'borf'); + + _this20.transitionTo('/'); + assert.equal(indexController.get('omg'), 'lol'); + }); + }; + + _class.prototype['@test Subresource naming style is supported'] = function testSubresourceNamingStyleIsSupported(assert) { + var _this21 = this; + + assert.expect(5); + + this.router.map(function () { + this.route('abc.def', { path: '/abcdef' }, function () { + this.route('zoo'); + }); + }); + + this.registerTemplate('application', '{{link-to \'A\' \'abc.def\' (query-params foo=\'123\') id=\'one\'}}{{link-to \'B\' \'abc.def.zoo\' (query-params foo=\'123\' bar=\'456\') id=\'two\'}}{{outlet}}'); + + this.setSingleQPController('abc.def', 'foo', 'lol'); + this.setSingleQPController('abc.def.zoo', 'bar', 'haha'); + + return this.visitAndAssert('/').then(function () { + assert.equal(_emberViews.jQuery('#one').attr('href'), '/abcdef?foo=123'); + assert.equal(_emberViews.jQuery('#two').attr('href'), '/abcdef/zoo?bar=456&foo=123'); + + _emberMetal.run(_emberViews.jQuery('#one'), 'click'); + _this21.assertCurrentPath('/abcdef?foo=123'); + + _emberMetal.run(_emberViews.jQuery('#two'), 'click'); + _this21.assertCurrentPath('/abcdef/zoo?bar=456&foo=123'); + }); + }; + + _class.prototype['@test transitionTo supports query params'] = function testTransitionToSupportsQueryParams(assert) { + var _this22 = this; + + this.setSingleQPController('index', 'foo', 'lol'); + + return this.visitAndAssert('/').then(function () { + _this22.transitionTo({ queryParams: { foo: 'borf' } }); + _this22.assertCurrentPath('/?foo=borf', 'shorthand supported'); + + _this22.transitionTo({ queryParams: { 'index:foo': 'blaf' } }); + _this22.assertCurrentPath('/?foo=blaf', 'longform supported'); + + _this22.transitionTo({ queryParams: { 'index:foo': false } }); + _this22.assertCurrentPath('/?foo=false', 'longform supported (bool)'); + + _this22.transitionTo({ queryParams: { foo: false } }); + _this22.assertCurrentPath('/?foo=false', 'shorhand supported (bool)'); + }); + }; + + _class.prototype['@test transitionTo supports query params (multiple)'] = function testTransitionToSupportsQueryParamsMultiple(assert) { + var _this23 = this; + + this.registerController('index', _emberRuntime.Controller.extend({ + queryParams: ['foo', 'bar'], + foo: 'lol', + bar: 'wat' + })); + + return this.visitAndAssert('/').then(function () { + _this23.transitionTo({ queryParams: { foo: 'borf' } }); + _this23.assertCurrentPath('/?foo=borf', 'shorthand supported'); + + _this23.transitionTo({ queryParams: { 'index:foo': 'blaf' } }); + _this23.assertCurrentPath('/?foo=blaf', 'longform supported'); + + _this23.transitionTo({ queryParams: { 'index:foo': false } }); + _this23.assertCurrentPath('/?foo=false', 'longform supported (bool)'); + + _this23.transitionTo({ queryParams: { foo: false } }); + _this23.assertCurrentPath('/?foo=false', 'shorhand supported (bool)'); + }); + }; + + _class.prototype['@test setting controller QP to empty string doesn\'t generate null in URL'] = function testSettingControllerQPToEmptyStringDoesnTGenerateNullInURL(assert) { + var _this24 = this; + + assert.expect(1); + + this.setSingleQPController('index', 'foo', '123'); + + return this.visit('/').then(function () { + var controller = _this24.getController('index'); + + _this24.expectedPushURL = '/?foo='; + _this24.setAndFlush(controller, 'foo', ''); + }); + }; + + _class.prototype['@test setting QP to empty string doesn\'t generate null in URL'] = function testSettingQPToEmptyStringDoesnTGenerateNullInURL(assert) { + var _this25 = this; + + assert.expect(1); + + this.registerRoute('index', _emberRouting.Route.extend({ + queryParams: { + foo: { + defaultValue: '123' + } + } + })); + + return this.visit('/').then(function () { + var controller = _this25.getController('index'); + + _this25.expectedPushURL = '/?foo='; + _this25.setAndFlush(controller, 'foo', ''); + }); + }; + + _class.prototype['@test A default boolean value deserializes QPs as booleans rather than strings'] = function testADefaultBooleanValueDeserializesQPsAsBooleansRatherThanStrings(assert) { + var _this26 = this; + + assert.expect(3); + + this.setSingleQPController('index', 'foo', false); + + this.registerRoute('index', _emberRouting.Route.extend({ + model: function (params) { + assert.equal(params.foo, true, 'model hook received foo as boolean true'); + } + })); + + return this.visit('/?foo=true').then(function () { + var controller = _this26.getController('index'); + assert.equal(controller.get('foo'), true); + + _this26.transitionTo('/?foo=false'); + assert.equal(controller.get('foo'), false); + }); + }; + + _class.prototype['@test Query param without value are empty string'] = function testQueryParamWithoutValueAreEmptyString(assert) { + var _this27 = this; + + assert.expect(1); + + this.registerController('index', _emberRuntime.Controller.extend({ + queryParams: ['foo'], + foo: '' + })); + + return this.visit('/?foo=').then(function () { + var controller = _this27.getController('index'); + assert.equal(controller.get('foo'), ''); + }); + }; + + _class.prototype['@test Array query params can be set'] = function testArrayQueryParamsCanBeSet(assert) { + var _this28 = this; + + assert.expect(2); + + this.router.map(function () { + this.route('home', { path: '/' }); + }); + + this.setSingleQPController('home', 'foo', []); + + return this.visit('/').then(function () { + var controller = _this28.getController('home'); + + _this28.setAndFlush(controller, 'foo', [1, 2]); + _this28.assertCurrentPath('/?foo=%5B1%2C2%5D'); + + _this28.setAndFlush(controller, 'foo', [3, 4]); + _this28.assertCurrentPath('/?foo=%5B3%2C4%5D'); + }); + }; + + _class.prototype['@test (de)serialization: arrays'] = function testDeSerializationArrays(assert) { + var _this29 = this; + + assert.expect(4); + + this.setSingleQPController('index', 'foo', [1]); + + return this.visitAndAssert('/').then(function () { + _this29.transitionTo({ queryParams: { foo: [2, 3] } }); + _this29.assertCurrentPath('/?foo=%5B2%2C3%5D', 'shorthand supported'); + _this29.transitionTo({ queryParams: { 'index:foo': [4, 5] } }); + _this29.assertCurrentPath('/?foo=%5B4%2C5%5D', 'longform supported'); + _this29.transitionTo({ queryParams: { foo: [] } }); + _this29.assertCurrentPath('/?foo=%5B%5D', 'longform supported'); + }); + }; + + _class.prototype['@test Url with array query param sets controller property to array'] = function testUrlWithArrayQueryParamSetsControllerPropertyToArray(assert) { + var _this30 = this; + + assert.expect(1); + + this.setSingleQPController('index', 'foo', ''); + + return this.visit('/?foo[]=1&foo[]=2&foo[]=3').then(function () { + var controller = _this30.getController('index'); + assert.deepEqual(controller.get('foo'), ['1', '2', '3']); + }); + }; + + _class.prototype['@test Array query params can be pushed/popped'] = function testArrayQueryParamsCanBePushedPopped(assert) { + var _this31 = this; + + assert.expect(17); + + this.router.map(function () { + this.route('home', { path: '/' }); + }); + + this.setSingleQPController('home', 'foo', _emberRuntime.A()); + + return this.visitAndAssert('/').then(function () { + var controller = _this31.getController('home'); + + _emberMetal.run(controller.foo, 'pushObject', 1); + _this31.assertCurrentPath('/?foo=%5B1%5D'); + assert.deepEqual(controller.foo, [1]); + + _emberMetal.run(controller.foo, 'popObject'); + _this31.assertCurrentPath('/'); + assert.deepEqual(controller.foo, []); + + _emberMetal.run(controller.foo, 'pushObject', 1); + _this31.assertCurrentPath('/?foo=%5B1%5D'); + assert.deepEqual(controller.foo, [1]); + + _emberMetal.run(controller.foo, 'popObject'); + _this31.assertCurrentPath('/'); + assert.deepEqual(controller.foo, []); + + _emberMetal.run(controller.foo, 'pushObject', 1); + _this31.assertCurrentPath('/?foo=%5B1%5D'); + assert.deepEqual(controller.foo, [1]); + + _emberMetal.run(controller.foo, 'pushObject', 2); + _this31.assertCurrentPath('/?foo=%5B1%2C2%5D'); + assert.deepEqual(controller.foo, [1, 2]); + + _emberMetal.run(controller.foo, 'popObject'); + _this31.assertCurrentPath('/?foo=%5B1%5D'); + assert.deepEqual(controller.foo, [1]); + + _emberMetal.run(controller.foo, 'unshiftObject', 'lol'); + _this31.assertCurrentPath('/?foo=%5B%22lol%22%2C1%5D'); + assert.deepEqual(controller.foo, ['lol', 1]); + }); + }; + + _class.prototype['@test Overwriting with array with same content shouldn\'t refire update'] = function testOverwritingWithArrayWithSameContentShouldnTRefireUpdate(assert) { + var _this32 = this; + + assert.expect(4); + + this.router.map(function () { + this.route('home', { path: '/' }); + }); + + var modelCount = 0; + this.registerRoute('home', _emberRouting.Route.extend({ + model: function () { + modelCount++; + } + })); + + this.setSingleQPController('home', 'foo', _emberRuntime.A([1])); + + return this.visitAndAssert('/').then(function () { + assert.equal(modelCount, 1); + + var controller = _this32.getController('home'); + _this32.setAndFlush(controller, 'model', _emberRuntime.A([1])); + + assert.equal(modelCount, 1); + _this32.assertCurrentPath('/'); + }); + }; + + _class.prototype['@test Defaulting to params hash as the model should not result in that params object being watched'] = function testDefaultingToParamsHashAsTheModelShouldNotResultInThatParamsObjectBeingWatched(assert) { + var _this33 = this; + + assert.expect(1); + + this.router.map(function () { + this.route('other'); + }); + + // This causes the params hash, which is returned as a route's + // model if no other model could be resolved given the provided + // params (and no custom model hook was defined), to be watched, + // unless we return a copy of the params hash. + this.setSingleQPController('application', 'woot', 'wat'); + + this.registerRoute('other', _emberRouting.Route.extend({ + model: function (p, trans) { + var m = _emberMetal.meta(trans.params.application); + assert.ok(!m.peekWatching('woot'), 'A meta object isn\'t constructed for this params POJO'); + } + })); + + return this.visit('/').then(function () { + _this33.transitionTo('other'); + }); + }; + + _class.prototype['@test A child of a resource route still defaults to parent route\'s model even if the child route has a query param'] = function testAChildOfAResourceRouteStillDefaultsToParentRouteSModelEvenIfTheChildRouteHasAQueryParam(assert) { + assert.expect(2); + + this.setSingleQPController('index', 'woot', undefined, { + woot: undefined + }); + + this.registerRoute('application', _emberRouting.Route.extend({ + model: function (p, trans) { + return { woot: true }; + } + })); + + this.registerRoute('index', _emberRouting.Route.extend({ + setupController: function (controller, model) { + assert.deepEqual(model, { woot: true }, 'index route inherited model route from parent route'); + } + })); + + return this.visitAndAssert('/'); + }; + + _class.prototype['@test opting into replace does not affect transitions between routes'] = function testOptingIntoReplaceDoesNotAffectTransitionsBetweenRoutes(assert) { + var _this34 = this; + + assert.expect(5); + + this.registerTemplate('application', '{{link-to \'Foo\' \'foo\' id=\'foo-link\'}}{{link-to \'Bar\' \'bar\' id=\'bar-no-qp-link\'}}{{link-to \'Bar\' \'bar\' (query-params raytiley=\'isthebest\') id=\'bar-link\'}}{{outlet}}'); + + this.router.map(function () { + this.route('foo'); + this.route('bar'); + }); + + this.setSingleQPController('bar', 'raytiley', 'israd'); + + this.registerRoute('bar', _emberRouting.Route.extend({ + queryParams: { + raytiley: { + replace: true + } + } + })); + + return this.visit('/').then(function () { + var controller = _this34.getController('bar'); + + _this34.expectedPushURL = '/foo'; + _emberMetal.run(_emberViews.jQuery('#foo-link'), 'click'); + + _this34.expectedPushURL = '/bar'; + _emberMetal.run(_emberViews.jQuery('#bar-no-qp-link'), 'click'); + + _this34.expectedReplaceURL = '/bar?raytiley=woot'; + _this34.setAndFlush(controller, 'raytiley', 'woot'); + + _this34.expectedPushURL = '/foo'; + _emberMetal.run(_emberViews.jQuery('#foo-link'), 'click'); + + _this34.expectedPushURL = '/bar?raytiley=isthebest'; + _emberMetal.run(_emberViews.jQuery('#bar-link'), 'click'); + }); + }; + + _class.prototype['@test undefined isn\'t serialized or deserialized into a string'] = function testUndefinedIsnTSerializedOrDeserializedIntoAString(assert) { + var _this35 = this; + + assert.expect(4); + + this.router.map(function () { + this.route('example'); + }); + + this.registerTemplate('application', '{{link-to \'Example\' \'example\' (query-params foo=undefined) id=\'the-link\'}}'); + + this.setSingleQPController('example', 'foo', undefined, { + foo: undefined + }); + + this.registerRoute('example', _emberRouting.Route.extend({ + model: function (params) { + assert.deepEqual(params, { foo: undefined }); + } + })); + + return this.visitAndAssert('/').then(function () { + assert.equal(_this35.$('#the-link').attr('href'), '/example', 'renders without undefined qp serialized'); + + return _this35.transitionTo('example', { queryParams: { foo: undefined } }).then(function () { + _this35.assertCurrentPath('/example'); + }); + }); + }; + + _class.prototype['@test when refreshModel is true and loading hook is undefined, model hook will rerun when QPs change even if previous did not finish'] = function testWhenRefreshModelIsTrueAndLoadingHookIsUndefinedModelHookWillRerunWhenQPsChangeEvenIfPreviousDidNotFinish(assert) { + return this.refreshModelWhileLoadingTest(); + }; + + _class.prototype['@test when refreshModel is true and loading hook returns false, model hook will rerun when QPs change even if previous did not finish'] = function testWhenRefreshModelIsTrueAndLoadingHookReturnsFalseModelHookWillRerunWhenQPsChangeEvenIfPreviousDidNotFinish(assert) { + return this.refreshModelWhileLoadingTest(false); + }; + + _class.prototype['@test when refreshModel is true and loading hook returns true, model hook will rerun when QPs change even if previous did not finish'] = function testWhenRefreshModelIsTrueAndLoadingHookReturnsTrueModelHookWillRerunWhenQPsChangeEvenIfPreviousDidNotFinish(assert) { + return this.refreshModelWhileLoadingTest(true); + }; + + _class.prototype['@test warn user that Route\'s queryParams configuration must be an Object, not an Array'] = function testWarnUserThatRouteSQueryParamsConfigurationMustBeAnObjectNotAnArray(assert) { + var _this36 = this; + + assert.expect(1); + + this.registerRoute('application', _emberRouting.Route.extend({ + queryParams: [{ commitBy: { replace: true } }] + })); + + expectAssertion(function () { + _this36.visit('/'); + }, 'You passed in `[{"commitBy":{"replace":true}}]` as the value for `queryParams` but `queryParams` cannot be an Array'); + }; + + _class.prototype['@test handle route names that clash with Object.prototype properties'] = function testHandleRouteNamesThatClashWithObjectPrototypeProperties(assert) { + var _this37 = this; + + assert.expect(1); + + this.router.map(function () { + this.route('constructor'); + }); + + this.registerRoute('constructor', _emberRouting.Route.extend({ + queryParams: { + foo: { + defaultValue: '123' + } + } + })); + + return this.visit('/').then(function () { + _this37.transitionTo('constructor', { queryParams: { foo: '999' } }); + var controller = _this37.getController('constructor'); + assert.equal(_emberMetal.get(controller, 'foo'), '999'); + }); + }; + + return _class; + })(_internalTestHelpers.QueryParamTestCase)); +}); +enifed('ember/tests/routing/query_params_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/routing'); + test('ember/tests/routing/query_params_test.js should pass jscs', function () { + ok(true, 'ember/tests/routing/query_params_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/routing/query_params_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/routing'); + QUnit.test('ember/tests/routing/query_params_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/query_params_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test', ['exports', 'ember-runtime', 'ember-routing', 'ember-metal', 'ember-views', 'internal-test-helpers'], function (exports, _emberRuntime, _emberRouting, _emberMetal, _emberViews, _internalTestHelpers) { + 'use strict'; + + var ModelDependentQPTestCase = (function (_QueryParamTestCase) { + babelHelpers.inherits(ModelDependentQPTestCase, _QueryParamTestCase); + + function ModelDependentQPTestCase() { + _QueryParamTestCase.apply(this, arguments); + } + + ModelDependentQPTestCase.prototype.boot = function boot() { + this.setupApplication(); + return this.visitApplication(); + }; + + ModelDependentQPTestCase.prototype.teardown = function teardown() { + var _QueryParamTestCase$prototype$teardown; + + (_QueryParamTestCase$prototype$teardown = _QueryParamTestCase.prototype.teardown).call.apply(_QueryParamTestCase$prototype$teardown, [this].concat(babelHelpers.slice.call(arguments))); + this.assert.ok(!this.expectedModelHookParams, 'there should be no pending expectation of expected model hook params'); + }; + + ModelDependentQPTestCase.prototype.reopenController = function reopenController(name, options) { + this.application.resolveRegistration('controller:' + name).reopen(options); + }; + + ModelDependentQPTestCase.prototype.reopenRoute = function reopenRoute(name, options) { + this.application.resolveRegistration('route:' + name).reopen(options); + }; + + ModelDependentQPTestCase.prototype.queryParamsStickyTest1 = function queryParamsStickyTest1(urlPrefix) { + var _this = this; + + var assert = this.assert; + + assert.expect(14); + + return this.boot().then(function () { + _emberMetal.run(_this.$link1, 'click'); + _this.assertCurrentPath(urlPrefix + '/a-1'); + + _this.setAndFlush(_this.controller, 'q', 'lol'); + + assert.equal(_this.$link1.attr('href'), urlPrefix + '/a-1?q=lol'); + assert.equal(_this.$link2.attr('href'), urlPrefix + '/a-2'); + assert.equal(_this.$link3.attr('href'), urlPrefix + '/a-3'); + + _emberMetal.run(_this.$link2, 'click'); + + assert.equal(_this.controller.get('q'), 'wat'); + assert.equal(_this.controller.get('z'), 0); + assert.deepEqual(_this.controller.get('model'), { id: 'a-2' }); + assert.equal(_this.$link1.attr('href'), urlPrefix + '/a-1?q=lol'); + assert.equal(_this.$link2.attr('href'), urlPrefix + '/a-2'); + assert.equal(_this.$link3.attr('href'), urlPrefix + '/a-3'); + }); + }; + + ModelDependentQPTestCase.prototype.queryParamsStickyTest2 = function queryParamsStickyTest2(urlPrefix) { + var _this2 = this; + + var assert = this.assert; + + assert.expect(24); + + return this.boot().then(function () { + _this2.expectedModelHookParams = { id: 'a-1', q: 'lol', z: 0 }; + _this2.transitionTo(urlPrefix + '/a-1?q=lol'); + + assert.deepEqual(_this2.controller.get('model'), { id: 'a-1' }); + assert.equal(_this2.controller.get('q'), 'lol'); + assert.equal(_this2.controller.get('z'), 0); + assert.equal(_this2.$link1.attr('href'), urlPrefix + '/a-1?q=lol'); + assert.equal(_this2.$link2.attr('href'), urlPrefix + '/a-2'); + assert.equal(_this2.$link3.attr('href'), urlPrefix + '/a-3'); + + _this2.expectedModelHookParams = { id: 'a-2', q: 'lol', z: 0 }; + _this2.transitionTo(urlPrefix + '/a-2?q=lol'); + + assert.deepEqual(_this2.controller.get('model'), { id: 'a-2' }, 'controller\'s model changed to a-2'); + assert.equal(_this2.controller.get('q'), 'lol'); + assert.equal(_this2.controller.get('z'), 0); + assert.equal(_this2.$link1.attr('href'), urlPrefix + '/a-1?q=lol'); + assert.equal(_this2.$link2.attr('href'), urlPrefix + '/a-2?q=lol'); // fail + assert.equal(_this2.$link3.attr('href'), urlPrefix + '/a-3'); + + _this2.expectedModelHookParams = { id: 'a-3', q: 'lol', z: 123 }; + _this2.transitionTo(urlPrefix + '/a-3?q=lol&z=123'); + + assert.equal(_this2.controller.get('q'), 'lol'); + assert.equal(_this2.controller.get('z'), 123); + assert.equal(_this2.$link1.attr('href'), urlPrefix + '/a-1?q=lol'); + assert.equal(_this2.$link2.attr('href'), urlPrefix + '/a-2?q=lol'); + assert.equal(_this2.$link3.attr('href'), urlPrefix + '/a-3?q=lol&z=123'); + }); + }; + + ModelDependentQPTestCase.prototype.queryParamsStickyTest3 = function queryParamsStickyTest3(urlPrefix, articleLookup) { + var _this3 = this; + + var assert = this.assert; + + assert.expect(32); + + this.registerTemplate('application', '{{#each articles as |a|}} {{link-to \'Article\' \'' + articleLookup + '\' a.id id=a.id}} {{/each}}'); + + return this.boot().then(function () { + _this3.expectedModelHookParams = { id: 'a-1', q: 'wat', z: 0 }; + _this3.transitionTo(articleLookup, 'a-1'); + + assert.deepEqual(_this3.controller.get('model'), { id: 'a-1' }); + assert.equal(_this3.controller.get('q'), 'wat'); + assert.equal(_this3.controller.get('z'), 0); + assert.equal(_this3.$link1.attr('href'), urlPrefix + '/a-1'); + assert.equal(_this3.$link2.attr('href'), urlPrefix + '/a-2'); + assert.equal(_this3.$link3.attr('href'), urlPrefix + '/a-3'); + + _this3.expectedModelHookParams = { id: 'a-2', q: 'lol', z: 0 }; + _this3.transitionTo(articleLookup, 'a-2', { queryParams: { q: 'lol' } }); + + assert.deepEqual(_this3.controller.get('model'), { id: 'a-2' }); + assert.equal(_this3.controller.get('q'), 'lol'); + assert.equal(_this3.controller.get('z'), 0); + assert.equal(_this3.$link1.attr('href'), urlPrefix + '/a-1'); + assert.equal(_this3.$link2.attr('href'), urlPrefix + '/a-2?q=lol'); + assert.equal(_this3.$link3.attr('href'), urlPrefix + '/a-3'); + + _this3.expectedModelHookParams = { id: 'a-3', q: 'hay', z: 0 }; + _this3.transitionTo(articleLookup, 'a-3', { queryParams: { q: 'hay' } }); + + assert.deepEqual(_this3.controller.get('model'), { id: 'a-3' }); + assert.equal(_this3.controller.get('q'), 'hay'); + assert.equal(_this3.controller.get('z'), 0); + assert.equal(_this3.$link1.attr('href'), urlPrefix + '/a-1'); + assert.equal(_this3.$link2.attr('href'), urlPrefix + '/a-2?q=lol'); + assert.equal(_this3.$link3.attr('href'), urlPrefix + '/a-3?q=hay'); + + _this3.expectedModelHookParams = { id: 'a-2', q: 'lol', z: 1 }; + _this3.transitionTo(articleLookup, 'a-2', { queryParams: { z: 1 } }); + + assert.deepEqual(_this3.controller.get('model'), { id: 'a-2' }); + assert.equal(_this3.controller.get('q'), 'lol'); + assert.equal(_this3.controller.get('z'), 1); + assert.equal(_this3.$link1.attr('href'), urlPrefix + '/a-1'); + assert.equal(_this3.$link2.attr('href'), urlPrefix + '/a-2?q=lol&z=1'); + assert.equal(_this3.$link3.attr('href'), urlPrefix + '/a-3?q=hay'); + }); + }; + + ModelDependentQPTestCase.prototype.queryParamsStickyTest4 = function queryParamsStickyTest4(urlPrefix, articleLookup) { + var _this4 = this; + + var assert = this.assert; + + assert.expect(24); + + this.setupApplication(); + + this.reopenController(articleLookup, { + queryParams: { q: { scope: 'controller' } } + }); + + return this.visitApplication().then(function () { + _emberMetal.run(_this4.$link1, 'click'); + _this4.assertCurrentPath(urlPrefix + '/a-1'); + + _this4.setAndFlush(_this4.controller, 'q', 'lol'); + + assert.equal(_this4.$link1.attr('href'), urlPrefix + '/a-1?q=lol'); + assert.equal(_this4.$link2.attr('href'), urlPrefix + '/a-2?q=lol'); + assert.equal(_this4.$link3.attr('href'), urlPrefix + '/a-3?q=lol'); + + _emberMetal.run(_this4.$link2, 'click'); + + assert.equal(_this4.controller.get('q'), 'lol'); + assert.equal(_this4.controller.get('z'), 0); + assert.deepEqual(_this4.controller.get('model'), { id: 'a-2' }); + + assert.equal(_this4.$link1.attr('href'), urlPrefix + '/a-1?q=lol'); + assert.equal(_this4.$link2.attr('href'), urlPrefix + '/a-2?q=lol'); + assert.equal(_this4.$link3.attr('href'), urlPrefix + '/a-3?q=lol'); + + _this4.expectedModelHookParams = { id: 'a-3', q: 'haha', z: 123 }; + _this4.transitionTo(urlPrefix + '/a-3?q=haha&z=123'); + + assert.deepEqual(_this4.controller.get('model'), { id: 'a-3' }); + assert.equal(_this4.controller.get('q'), 'haha'); + assert.equal(_this4.controller.get('z'), 123); + + assert.equal(_this4.$link1.attr('href'), urlPrefix + '/a-1?q=haha'); + assert.equal(_this4.$link2.attr('href'), urlPrefix + '/a-2?q=haha'); + assert.equal(_this4.$link3.attr('href'), urlPrefix + '/a-3?q=haha&z=123'); + + _this4.setAndFlush(_this4.controller, 'q', 'woot'); + + assert.equal(_this4.$link1.attr('href'), urlPrefix + '/a-1?q=woot'); + assert.equal(_this4.$link2.attr('href'), urlPrefix + '/a-2?q=woot'); + assert.equal(_this4.$link3.attr('href'), urlPrefix + '/a-3?q=woot&z=123'); + }); + }; + + ModelDependentQPTestCase.prototype.queryParamsStickyTest5 = function queryParamsStickyTest5(urlPrefix, commentsLookupKey) { + var _this5 = this; + + var assert = this.assert; + + assert.expect(12); + + return this.boot().then(function () { + _this5.transitionTo(commentsLookupKey, 'a-1'); + + var commentsCtrl = _this5.getController(commentsLookupKey); + assert.equal(commentsCtrl.get('page'), 1); + _this5.assertCurrentPath(urlPrefix + '/a-1/comments'); + + _this5.setAndFlush(commentsCtrl, 'page', 2); + _this5.assertCurrentPath(urlPrefix + '/a-1/comments?page=2'); + + _this5.setAndFlush(commentsCtrl, 'page', 3); + _this5.assertCurrentPath(urlPrefix + '/a-1/comments?page=3'); + + _this5.transitionTo(commentsLookupKey, 'a-2'); + assert.equal(commentsCtrl.get('page'), 1); + _this5.assertCurrentPath(urlPrefix + '/a-2/comments'); + + _this5.transitionTo(commentsLookupKey, 'a-1'); + assert.equal(commentsCtrl.get('page'), 3); + _this5.assertCurrentPath(urlPrefix + '/a-1/comments?page=3'); + }); + }; + + ModelDependentQPTestCase.prototype.queryParamsStickyTest6 = function queryParamsStickyTest6(urlPrefix, articleLookup, commentsLookup) { + var _this6 = this; + + var assert = this.assert; + + assert.expect(13); + + this.setupApplication(); + + this.reopenRoute(articleLookup, { + resetController: function (controller, isExiting) { + this.controllerFor(commentsLookup).set('page', 1); + if (isExiting) { + controller.set('q', 'imdone'); + } + } + }); + + this.registerTemplate('about', '{{link-to \'A\' \'' + commentsLookup + '\' \'a-1\' id=\'one\'}} {{link-to \'B\' \'' + commentsLookup + '\' \'a-2\' id=\'two\'}}'); + + return this.visitApplication().then(function () { + _this6.transitionTo(commentsLookup, 'a-1'); + + var commentsCtrl = _this6.getController(commentsLookup); + assert.equal(commentsCtrl.get('page'), 1); + _this6.assertCurrentPath(urlPrefix + '/a-1/comments'); + + _this6.setAndFlush(commentsCtrl, 'page', 2); + _this6.assertCurrentPath(urlPrefix + '/a-1/comments?page=2'); + + _this6.transitionTo(commentsLookup, 'a-2'); + assert.equal(commentsCtrl.get('page'), 1); + assert.equal(_this6.controller.get('q'), 'wat'); + + _this6.transitionTo(commentsLookup, 'a-1'); + + _this6.assertCurrentPath(urlPrefix + '/a-1/comments'); + assert.equal(commentsCtrl.get('page'), 1); + + _this6.transitionTo('about'); + assert.equal(_emberViews.jQuery('#one').attr('href'), urlPrefix + '/a-1/comments?q=imdone'); + assert.equal(_emberViews.jQuery('#two').attr('href'), urlPrefix + '/a-2/comments'); + }); + }; + + return ModelDependentQPTestCase; + })(_internalTestHelpers.QueryParamTestCase); + + _internalTestHelpers.moduleFor('Query Params - model-dependent state', (function (_ModelDependentQPTestCase) { + babelHelpers.inherits(_class, _ModelDependentQPTestCase); + + function _class() { + _ModelDependentQPTestCase.apply(this, arguments); + } + + _class.prototype.setupApplication = function setupApplication() { + this.router.map(function () { + this.route('article', { path: '/a/:id' }, function () { + this.route('comments', { resetNamespace: true }); + }); + this.route('about'); + }); + + var articles = _emberRuntime.A([{ id: 'a-1' }, { id: 'a-2' }, { id: 'a-3' }]); + + this.registerController('application', _emberRuntime.Controller.extend({ + articles: articles + })); + + var self = this; + var assert = this.assert; + this.registerRoute('article', _emberRouting.Route.extend({ + model: function (params) { + if (self.expectedModelHookParams) { + assert.deepEqual(params, self.expectedModelHookParams, 'the ArticleRoute model hook received the expected merged dynamic segment + query params hash'); + self.expectedModelHookParams = null; + } + return articles.findBy('id', params.id); + } + })); + + this.registerController('article', _emberRuntime.Controller.extend({ + queryParams: ['q', 'z'], + q: 'wat', + z: 0 + })); + + this.registerController('comments', _emberRuntime.Controller.extend({ + queryParams: 'page', + page: 1 + })); + + this.registerTemplate('application', '{{#each articles as |a|}} 1{{link-to \'Article\' \'article\' a id=a.id}} {{/each}} {{outlet}}'); + }; + + _class.prototype.visitApplication = function visitApplication() { + var _this7 = this; + + return this.visit('/').then(function () { + var assert = _this7.assert; + + _this7.$link1 = _emberViews.jQuery('#a-1'); + _this7.$link2 = _emberViews.jQuery('#a-2'); + _this7.$link3 = _emberViews.jQuery('#a-3'); + + assert.equal(_this7.$link1.attr('href'), '/a/a-1'); + assert.equal(_this7.$link2.attr('href'), '/a/a-2'); + assert.equal(_this7.$link3.attr('href'), '/a/a-3'); + + _this7.controller = _this7.getController('article'); + }); + }; + + _class.prototype['@test query params have \'model\' stickiness by default'] = function testQueryParamsHaveModelStickinessByDefault() { + return this.queryParamsStickyTest1('/a'); + }; + + _class.prototype['@test query params have \'model\' stickiness by default (url changes)'] = function testQueryParamsHaveModelStickinessByDefaultUrlChanges() { + return this.queryParamsStickyTest2('/a'); + }; + + _class.prototype['@test query params have \'model\' stickiness by default (params-based transitions)'] = function testQueryParamsHaveModelStickinessByDefaultParamsBasedTransitions() { + return this.queryParamsStickyTest3('/a', 'article'); + }; + + _class.prototype['@test \'controller\' stickiness shares QP state between models'] = function testControllerStickinessSharesQPStateBetweenModels() { + return this.queryParamsStickyTest4('/a', 'article'); + }; + + _class.prototype['@test \'model\' stickiness is scoped to current or first dynamic parent route'] = function testModelStickinessIsScopedToCurrentOrFirstDynamicParentRoute() { + return this.queryParamsStickyTest5('/a', 'comments'); + }; + + _class.prototype['@test can reset query params using the resetController hook'] = function testCanResetQueryParamsUsingTheResetControllerHook() { + return this.queryParamsStickyTest6('/a', 'article', 'comments'); + }; + + return _class; + })(ModelDependentQPTestCase)); + + _internalTestHelpers.moduleFor('Query Params - model-dependent state (nested)', (function (_ModelDependentQPTestCase2) { + babelHelpers.inherits(_class2, _ModelDependentQPTestCase2); + + function _class2() { + _ModelDependentQPTestCase2.apply(this, arguments); + } + + _class2.prototype.setupApplication = function setupApplication() { + this.router.map(function () { + this.route('site', function () { + this.route('article', { path: '/a/:id' }, function () { + this.route('comments'); + }); + }); + this.route('about'); + }); + + var site_articles = _emberRuntime.A([{ id: 'a-1' }, { id: 'a-2' }, { id: 'a-3' }]); + + this.registerController('application', _emberRuntime.Controller.extend({ + articles: site_articles + })); + + var self = this; + var assert = this.assert; + this.registerRoute('site.article', _emberRouting.Route.extend({ + model: function (params) { + if (self.expectedModelHookParams) { + assert.deepEqual(params, self.expectedModelHookParams, 'the ArticleRoute model hook received the expected merged dynamic segment + query params hash'); + self.expectedModelHookParams = null; + } + return site_articles.findBy('id', params.id); + } + })); + + this.registerController('site.article', _emberRuntime.Controller.extend({ + queryParams: ['q', 'z'], + q: 'wat', + z: 0 + })); + + this.registerController('site.article.comments', _emberRuntime.Controller.extend({ + queryParams: 'page', + page: 1 + })); + + this.registerTemplate('application', '{{#each articles as |a|}} {{link-to \'Article\' \'site.article\' a id=a.id}} {{/each}} {{outlet}}'); + }; + + _class2.prototype.visitApplication = function visitApplication() { + var _this8 = this; + + return this.visit('/').then(function () { + var assert = _this8.assert; + + _this8.$link1 = _emberViews.jQuery('#a-1'); + _this8.$link2 = _emberViews.jQuery('#a-2'); + _this8.$link3 = _emberViews.jQuery('#a-3'); + + assert.equal(_this8.$link1.attr('href'), '/site/a/a-1'); + assert.equal(_this8.$link2.attr('href'), '/site/a/a-2'); + assert.equal(_this8.$link3.attr('href'), '/site/a/a-3'); + + _this8.controller = _this8.getController('site.article'); + }); + }; + + _class2.prototype['@test query params have \'model\' stickiness by default'] = function testQueryParamsHaveModelStickinessByDefault() { + return this.queryParamsStickyTest1('/site/a'); + }; + + _class2.prototype['@test query params have \'model\' stickiness by default (url changes)'] = function testQueryParamsHaveModelStickinessByDefaultUrlChanges() { + return this.queryParamsStickyTest2('/site/a'); + }; + + _class2.prototype['@test query params have \'model\' stickiness by default (params-based transitions)'] = function testQueryParamsHaveModelStickinessByDefaultParamsBasedTransitions() { + return this.queryParamsStickyTest3('/site/a', 'site.article'); + }; + + _class2.prototype['@test \'controller\' stickiness shares QP state between models'] = function testControllerStickinessSharesQPStateBetweenModels() { + return this.queryParamsStickyTest4('/site/a', 'site.article'); + }; + + _class2.prototype['@test \'model\' stickiness is scoped to current or first dynamic parent route'] = function testModelStickinessIsScopedToCurrentOrFirstDynamicParentRoute() { + return this.queryParamsStickyTest5('/site/a', 'site.article.comments'); + }; + + _class2.prototype['@test can reset query params using the resetController hook'] = function testCanResetQueryParamsUsingTheResetControllerHook() { + return this.queryParamsStickyTest6('/site/a', 'site.article', 'site.article.comments'); + }; + + return _class2; + })(ModelDependentQPTestCase)); + + _internalTestHelpers.moduleFor('Query Params - model-dependent state (nested & more than 1 dynamic segment)', (function (_ModelDependentQPTestCase3) { + babelHelpers.inherits(_class3, _ModelDependentQPTestCase3); + + function _class3() { + _ModelDependentQPTestCase3.apply(this, arguments); + } + + _class3.prototype.setupApplication = function setupApplication() { + this.router.map(function () { + this.route('site', { path: '/site/:site_id' }, function () { + this.route('article', { path: '/a/:article_id' }, function () { + this.route('comments'); + }); + }); + }); + + var sites = _emberRuntime.A([{ id: 's-1' }, { id: 's-2' }, { id: 's-3' }]); + var site_articles = _emberRuntime.A([{ id: 'a-1' }, { id: 'a-2' }, { id: 'a-3' }]); + + this.registerController('application', _emberRuntime.Controller.extend({ + siteArticles: site_articles, + sites: sites, + allSitesAllArticles: _emberMetal.computed({ + get: function () { + var ret = []; + var siteArticles = this.siteArticles; + var sites = this.sites; + sites.forEach(function (site) { + ret = ret.concat(siteArticles.map(function (article) { + return { id: site.id + '-' + article.id, site_id: site.id, article_id: article.id }; + })); + }); + return ret; + } + }) + })); + + var self = this; + var assert = this.assert; + this.registerRoute('site', _emberRouting.Route.extend({ + model: function (params) { + if (self.expectedSiteModelHookParams) { + assert.deepEqual(params, self.expectedSiteModelHookParams, 'the SiteRoute model hook received the expected merged dynamic segment + query params hash'); + self.expectedSiteModelHookParams = null; + } + return sites.findBy('id', params.site_id); + } + })); + + this.registerRoute('site.article', _emberRouting.Route.extend({ + model: function (params) { + if (self.expectedArticleModelHookParams) { + assert.deepEqual(params, self.expectedArticleModelHookParams, 'the SiteArticleRoute model hook received the expected merged dynamic segment + query params hash'); + self.expectedArticleModelHookParams = null; + } + return site_articles.findBy('id', params.article_id); + } + })); + + this.registerController('site', _emberRuntime.Controller.extend({ + queryParams: ['country'], + country: 'au' + })); + + this.registerController('site.article', _emberRuntime.Controller.extend({ + queryParams: ['q', 'z'], + q: 'wat', + z: 0 + })); + + this.registerController('site.article.comments', _emberRuntime.Controller.extend({ + queryParams: ['page'], + page: 1 + })); + + this.registerTemplate('application', '{{#each allSitesAllArticles as |a|}} {{#link-to \'site.article\' a.site_id a.article_id id=a.id}}Article [{{a.site_id}}] [{{a.article_id}}]{{/link-to}} {{/each}} {{outlet}}'); + }; + + _class3.prototype.visitApplication = function visitApplication() { + var _this9 = this; + + return this.visit('/').then(function () { + var assert = _this9.assert; + + _this9.links = {}; + _this9.links['s-1-a-1'] = _emberViews.jQuery('#s-1-a-1'); + _this9.links['s-1-a-2'] = _emberViews.jQuery('#s-1-a-2'); + _this9.links['s-1-a-3'] = _emberViews.jQuery('#s-1-a-3'); + _this9.links['s-2-a-1'] = _emberViews.jQuery('#s-2-a-1'); + _this9.links['s-2-a-2'] = _emberViews.jQuery('#s-2-a-2'); + _this9.links['s-2-a-3'] = _emberViews.jQuery('#s-2-a-3'); + _this9.links['s-3-a-1'] = _emberViews.jQuery('#s-3-a-1'); + _this9.links['s-3-a-2'] = _emberViews.jQuery('#s-3-a-2'); + _this9.links['s-3-a-3'] = _emberViews.jQuery('#s-3-a-3'); + + assert.equal(_this9.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1'); + assert.equal(_this9.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2'); + assert.equal(_this9.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3'); + assert.equal(_this9.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1'); + assert.equal(_this9.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2'); + assert.equal(_this9.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3'); + assert.equal(_this9.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1'); + assert.equal(_this9.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2'); + assert.equal(_this9.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3'); + + _this9.site_controller = _this9.getController('site'); + _this9.article_controller = _this9.getController('site.article'); + }); + }; + + _class3.prototype['@test query params have \'model\' stickiness by default'] = function testQueryParamsHaveModelStickinessByDefault(assert) { + var _this10 = this; + + assert.expect(59); // Insane. + + return this.boot().then(function () { + _emberMetal.run(_this10.links['s-1-a-1'], 'click'); + assert.deepEqual(_this10.site_controller.get('model'), { id: 's-1' }); + assert.deepEqual(_this10.article_controller.get('model'), { id: 'a-1' }); + _this10.assertCurrentPath('/site/s-1/a/a-1'); + + _this10.setAndFlush(_this10.article_controller, 'q', 'lol'); + + assert.equal(_this10.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1?q=lol'); + assert.equal(_this10.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2'); + assert.equal(_this10.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3'); + assert.equal(_this10.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1?q=lol'); + assert.equal(_this10.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2'); + assert.equal(_this10.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3'); + assert.equal(_this10.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1?q=lol'); + assert.equal(_this10.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2'); + assert.equal(_this10.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3'); + + _this10.setAndFlush(_this10.site_controller, 'country', 'us'); + + assert.equal(_this10.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1?country=us&q=lol'); + assert.equal(_this10.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2?country=us'); + assert.equal(_this10.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3?country=us'); + assert.equal(_this10.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1?q=lol'); + assert.equal(_this10.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2'); + assert.equal(_this10.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3'); + assert.equal(_this10.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1?q=lol'); + assert.equal(_this10.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2'); + assert.equal(_this10.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3'); + + _emberMetal.run(_this10.links['s-1-a-2'], 'click'); + + assert.equal(_this10.site_controller.get('country'), 'us'); + assert.equal(_this10.article_controller.get('q'), 'wat'); + assert.equal(_this10.article_controller.get('z'), 0); + assert.deepEqual(_this10.site_controller.get('model'), { id: 's-1' }); + assert.deepEqual(_this10.article_controller.get('model'), { id: 'a-2' }); + assert.equal(_this10.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1?country=us&q=lol'); + assert.equal(_this10.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2?country=us'); + assert.equal(_this10.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3?country=us'); + assert.equal(_this10.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1?q=lol'); + assert.equal(_this10.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2'); + assert.equal(_this10.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3'); + assert.equal(_this10.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1?q=lol'); + assert.equal(_this10.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2'); + assert.equal(_this10.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3'); + + _emberMetal.run(_this10.links['s-2-a-2'], 'click'); + + assert.equal(_this10.site_controller.get('country'), 'au'); + assert.equal(_this10.article_controller.get('q'), 'wat'); + assert.equal(_this10.article_controller.get('z'), 0); + assert.deepEqual(_this10.site_controller.get('model'), { id: 's-2' }); + assert.deepEqual(_this10.article_controller.get('model'), { id: 'a-2' }); + assert.equal(_this10.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1?country=us&q=lol'); + assert.equal(_this10.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2?country=us'); + assert.equal(_this10.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3?country=us'); + assert.equal(_this10.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1?q=lol'); + assert.equal(_this10.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2'); + assert.equal(_this10.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3'); + assert.equal(_this10.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1?q=lol'); + assert.equal(_this10.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2'); + assert.equal(_this10.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3'); + }); + }; + + _class3.prototype['@test query params have \'model\' stickiness by default (url changes)'] = function testQueryParamsHaveModelStickinessByDefaultUrlChanges(assert) { + var _this11 = this; + + assert.expect(88); // INSANE. + + return this.boot().then(function () { + _this11.expectedSiteModelHookParams = { site_id: 's-1', country: 'au' }; + _this11.expectedArticleModelHookParams = { article_id: 'a-1', q: 'lol', z: 0 }; + _this11.transitionTo('/site/s-1/a/a-1?q=lol'); + + assert.deepEqual(_this11.site_controller.get('model'), { id: 's-1' }, 'site controller\'s model is s-1'); + assert.deepEqual(_this11.article_controller.get('model'), { id: 'a-1' }, 'article controller\'s model is a-1'); + assert.equal(_this11.site_controller.get('country'), 'au'); + assert.equal(_this11.article_controller.get('q'), 'lol'); + assert.equal(_this11.article_controller.get('z'), 0); + assert.equal(_this11.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1?q=lol'); + assert.equal(_this11.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2'); + assert.equal(_this11.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3'); + assert.equal(_this11.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1?q=lol'); + assert.equal(_this11.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2'); + assert.equal(_this11.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3'); + assert.equal(_this11.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1?q=lol'); + assert.equal(_this11.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2'); + assert.equal(_this11.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3'); + + _this11.expectedSiteModelHookParams = { site_id: 's-2', country: 'us' }; + _this11.expectedArticleModelHookParams = { article_id: 'a-1', q: 'lol', z: 0 }; + _this11.transitionTo('/site/s-2/a/a-1?country=us&q=lol'); + + assert.deepEqual(_this11.site_controller.get('model'), { id: 's-2' }, 'site controller\'s model is s-2'); + assert.deepEqual(_this11.article_controller.get('model'), { id: 'a-1' }, 'article controller\'s model is a-1'); + assert.equal(_this11.site_controller.get('country'), 'us'); + assert.equal(_this11.article_controller.get('q'), 'lol'); + assert.equal(_this11.article_controller.get('z'), 0); + assert.equal(_this11.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1?q=lol'); + assert.equal(_this11.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2'); + assert.equal(_this11.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3'); + assert.equal(_this11.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1?country=us&q=lol'); + assert.equal(_this11.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2?country=us'); + assert.equal(_this11.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3?country=us'); + assert.equal(_this11.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1?q=lol'); + assert.equal(_this11.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2'); + assert.equal(_this11.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3'); + + _this11.expectedSiteModelHookParams = { site_id: 's-2', country: 'us' }; + _this11.expectedArticleModelHookParams = { article_id: 'a-2', q: 'lol', z: 0 }; + _this11.transitionTo('/site/s-2/a/a-2?country=us&q=lol'); + + assert.deepEqual(_this11.site_controller.get('model'), { id: 's-2' }, 'site controller\'s model is s-2'); + assert.deepEqual(_this11.article_controller.get('model'), { id: 'a-2' }, 'article controller\'s model is a-2'); + assert.equal(_this11.site_controller.get('country'), 'us'); + assert.equal(_this11.article_controller.get('q'), 'lol'); + assert.equal(_this11.article_controller.get('z'), 0); + assert.equal(_this11.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1?q=lol'); + assert.equal(_this11.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2?q=lol'); + assert.equal(_this11.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3'); + assert.equal(_this11.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1?country=us&q=lol'); + assert.equal(_this11.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2?country=us&q=lol'); + assert.equal(_this11.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3?country=us'); + assert.equal(_this11.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1?q=lol'); + assert.equal(_this11.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2?q=lol'); + assert.equal(_this11.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3'); + + _this11.expectedSiteModelHookParams = { site_id: 's-2', country: 'us' }; + _this11.expectedArticleModelHookParams = { article_id: 'a-3', q: 'lol', z: 123 }; + _this11.transitionTo('/site/s-2/a/a-3?country=us&q=lol&z=123'); + + assert.deepEqual(_this11.site_controller.get('model'), { id: 's-2' }, 'site controller\'s model is s-2'); + assert.deepEqual(_this11.article_controller.get('model'), { id: 'a-3' }, 'article controller\'s model is a-3'); + assert.equal(_this11.site_controller.get('country'), 'us'); + assert.equal(_this11.article_controller.get('q'), 'lol'); + assert.equal(_this11.article_controller.get('z'), 123); + assert.equal(_this11.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1?q=lol'); + assert.equal(_this11.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2?q=lol'); + assert.equal(_this11.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3?q=lol&z=123'); + assert.equal(_this11.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1?country=us&q=lol'); + assert.equal(_this11.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2?country=us&q=lol'); + assert.equal(_this11.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3?country=us&q=lol&z=123'); + assert.equal(_this11.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1?q=lol'); + assert.equal(_this11.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2?q=lol'); + assert.equal(_this11.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3?q=lol&z=123'); + + _this11.expectedSiteModelHookParams = { site_id: 's-3', country: 'nz' }; + _this11.expectedArticleModelHookParams = { article_id: 'a-3', q: 'lol', z: 123 }; + _this11.transitionTo('/site/s-3/a/a-3?country=nz&q=lol&z=123'); + + assert.deepEqual(_this11.site_controller.get('model'), { id: 's-3' }, 'site controller\'s model is s-3'); + assert.deepEqual(_this11.article_controller.get('model'), { id: 'a-3' }, 'article controller\'s model is a-3'); + assert.equal(_this11.site_controller.get('country'), 'nz'); + assert.equal(_this11.article_controller.get('q'), 'lol'); + assert.equal(_this11.article_controller.get('z'), 123); + assert.equal(_this11.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1?q=lol'); + assert.equal(_this11.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2?q=lol'); + assert.equal(_this11.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3?q=lol&z=123'); + assert.equal(_this11.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1?country=us&q=lol'); + assert.equal(_this11.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2?country=us&q=lol'); + assert.equal(_this11.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3?country=us&q=lol&z=123'); + assert.equal(_this11.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1?country=nz&q=lol'); + assert.equal(_this11.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2?country=nz&q=lol'); + assert.equal(_this11.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3?country=nz&q=lol&z=123'); + }); + }; + + _class3.prototype['@test query params have \'model\' stickiness by default (params-based transitions)'] = function testQueryParamsHaveModelStickinessByDefaultParamsBasedTransitions(assert) { + var _this12 = this; + + assert.expect(118); // <-- INSANE! Like why is this even a thing? + + return this.boot().then(function () { + _this12.expectedSiteModelHookParams = { site_id: 's-1', country: 'au' }; + _this12.expectedArticleModelHookParams = { article_id: 'a-1', q: 'wat', z: 0 }; + _this12.transitionTo('site.article', 's-1', 'a-1'); + + assert.deepEqual(_this12.site_controller.get('model'), { id: 's-1' }); + assert.deepEqual(_this12.article_controller.get('model'), { id: 'a-1' }); + assert.equal(_this12.site_controller.get('country'), 'au'); + assert.equal(_this12.article_controller.get('q'), 'wat'); + assert.equal(_this12.article_controller.get('z'), 0); + assert.equal(_this12.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1'); + assert.equal(_this12.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2'); + assert.equal(_this12.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3'); + assert.equal(_this12.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1'); + assert.equal(_this12.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2'); + assert.equal(_this12.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3'); + assert.equal(_this12.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1'); + assert.equal(_this12.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2'); + assert.equal(_this12.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3'); + + _this12.expectedSiteModelHookParams = { site_id: 's-1', country: 'au' }; + _this12.expectedArticleModelHookParams = { article_id: 'a-2', q: 'lol', z: 0 }; + _this12.transitionTo('site.article', 's-1', 'a-2', { queryParams: { q: 'lol' } }); + + assert.deepEqual(_this12.site_controller.get('model'), { id: 's-1' }); + assert.deepEqual(_this12.article_controller.get('model'), { id: 'a-2' }); + assert.equal(_this12.site_controller.get('country'), 'au'); + assert.equal(_this12.article_controller.get('q'), 'lol'); + assert.equal(_this12.article_controller.get('z'), 0); + assert.equal(_this12.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1'); + assert.equal(_this12.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2?q=lol'); + assert.equal(_this12.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3'); + assert.equal(_this12.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1'); + assert.equal(_this12.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2?q=lol'); + assert.equal(_this12.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3'); + assert.equal(_this12.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1'); + assert.equal(_this12.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2?q=lol'); + assert.equal(_this12.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3'); + + _this12.expectedSiteModelHookParams = { site_id: 's-1', country: 'au' }; + _this12.expectedArticleModelHookParams = { article_id: 'a-3', q: 'hay', z: 0 }; + _this12.transitionTo('site.article', 's-1', 'a-3', { queryParams: { q: 'hay' } }); + + assert.deepEqual(_this12.site_controller.get('model'), { id: 's-1' }); + assert.deepEqual(_this12.article_controller.get('model'), { id: 'a-3' }); + assert.equal(_this12.site_controller.get('country'), 'au'); + assert.equal(_this12.article_controller.get('q'), 'hay'); + assert.equal(_this12.article_controller.get('z'), 0); + assert.equal(_this12.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1'); + assert.equal(_this12.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2?q=lol'); + assert.equal(_this12.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3?q=hay'); + assert.equal(_this12.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1'); + assert.equal(_this12.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2?q=lol'); + assert.equal(_this12.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3?q=hay'); + assert.equal(_this12.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1'); + assert.equal(_this12.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2?q=lol'); + assert.equal(_this12.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3?q=hay'); + + _this12.expectedSiteModelHookParams = { site_id: 's-1', country: 'au' }; + _this12.expectedArticleModelHookParams = { article_id: 'a-2', q: 'lol', z: 1 }; + _this12.transitionTo('site.article', 's-1', 'a-2', { queryParams: { z: 1 } }); + + assert.deepEqual(_this12.site_controller.get('model'), { id: 's-1' }); + assert.deepEqual(_this12.article_controller.get('model'), { id: 'a-2' }); + assert.equal(_this12.site_controller.get('country'), 'au'); + assert.equal(_this12.article_controller.get('q'), 'lol'); + assert.equal(_this12.article_controller.get('z'), 1); + assert.equal(_this12.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1'); + assert.equal(_this12.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2?q=lol&z=1'); + assert.equal(_this12.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3?q=hay'); + assert.equal(_this12.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1'); + assert.equal(_this12.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2?q=lol&z=1'); + assert.equal(_this12.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3?q=hay'); + assert.equal(_this12.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1'); + assert.equal(_this12.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2?q=lol&z=1'); + assert.equal(_this12.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3?q=hay'); + + _this12.expectedSiteModelHookParams = { site_id: 's-2', country: 'us' }; + _this12.expectedArticleModelHookParams = { article_id: 'a-2', q: 'lol', z: 1 }; + _this12.transitionTo('site.article', 's-2', 'a-2', { queryParams: { country: 'us' } }); + + assert.deepEqual(_this12.site_controller.get('model'), { id: 's-2' }); + assert.deepEqual(_this12.article_controller.get('model'), { id: 'a-2' }); + assert.equal(_this12.site_controller.get('country'), 'us'); + assert.equal(_this12.article_controller.get('q'), 'lol'); + assert.equal(_this12.article_controller.get('z'), 1); + assert.equal(_this12.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1'); + assert.equal(_this12.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2?q=lol&z=1'); + assert.equal(_this12.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3?q=hay'); + assert.equal(_this12.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1?country=us'); + assert.equal(_this12.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2?country=us&q=lol&z=1'); + assert.equal(_this12.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3?country=us&q=hay'); + assert.equal(_this12.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1'); + assert.equal(_this12.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2?q=lol&z=1'); + assert.equal(_this12.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3?q=hay'); + + _this12.expectedSiteModelHookParams = { site_id: 's-2', country: 'us' }; + _this12.expectedArticleModelHookParams = { article_id: 'a-1', q: 'yeah', z: 0 }; + _this12.transitionTo('site.article', 's-2', 'a-1', { queryParams: { q: 'yeah' } }); + + assert.deepEqual(_this12.site_controller.get('model'), { id: 's-2' }); + assert.deepEqual(_this12.article_controller.get('model'), { id: 'a-1' }); + assert.equal(_this12.site_controller.get('country'), 'us'); + assert.equal(_this12.article_controller.get('q'), 'yeah'); + assert.equal(_this12.article_controller.get('z'), 0); + assert.equal(_this12.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1?q=yeah'); + assert.equal(_this12.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2?q=lol&z=1'); + assert.equal(_this12.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3?q=hay'); + assert.equal(_this12.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1?country=us&q=yeah'); + assert.equal(_this12.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2?country=us&q=lol&z=1'); + assert.equal(_this12.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3?country=us&q=hay'); + assert.equal(_this12.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1?q=yeah'); + assert.equal(_this12.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2?q=lol&z=1'); + assert.equal(_this12.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3?q=hay'); + + _this12.expectedSiteModelHookParams = { site_id: 's-3', country: 'nz' }; + _this12.expectedArticleModelHookParams = { article_id: 'a-3', q: 'hay', z: 3 }; + _this12.transitionTo('site.article', 's-3', 'a-3', { queryParams: { country: 'nz', z: 3 } }); + + assert.deepEqual(_this12.site_controller.get('model'), { id: 's-3' }); + assert.deepEqual(_this12.article_controller.get('model'), { id: 'a-3' }); + assert.equal(_this12.site_controller.get('country'), 'nz'); + assert.equal(_this12.article_controller.get('q'), 'hay'); + assert.equal(_this12.article_controller.get('z'), 3); + assert.equal(_this12.links['s-1-a-1'].attr('href'), '/site/s-1/a/a-1?q=yeah'); + assert.equal(_this12.links['s-1-a-2'].attr('href'), '/site/s-1/a/a-2?q=lol&z=1'); + assert.equal(_this12.links['s-1-a-3'].attr('href'), '/site/s-1/a/a-3?q=hay&z=3'); + assert.equal(_this12.links['s-2-a-1'].attr('href'), '/site/s-2/a/a-1?country=us&q=yeah'); + assert.equal(_this12.links['s-2-a-2'].attr('href'), '/site/s-2/a/a-2?country=us&q=lol&z=1'); + assert.equal(_this12.links['s-2-a-3'].attr('href'), '/site/s-2/a/a-3?country=us&q=hay&z=3'); + assert.equal(_this12.links['s-3-a-1'].attr('href'), '/site/s-3/a/a-1?country=nz&q=yeah'); + assert.equal(_this12.links['s-3-a-2'].attr('href'), '/site/s-3/a/a-2?country=nz&q=lol&z=1'); + assert.equal(_this12.links['s-3-a-3'].attr('href'), '/site/s-3/a/a-3?country=nz&q=hay&z=3'); + }); + }; + + return _class3; + })(ModelDependentQPTestCase)); +}); +enifed('ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/routing/query_params_test'); + test('ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js should pass jscs', function () { + ok(true, 'ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/routing/query_params_test'); + QUnit.test('ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/routing/query_params_test/overlapping_query_params_test', ['exports', 'ember-runtime', 'ember-metal', 'internal-test-helpers'], function (exports, _emberRuntime, _emberMetal, _internalTestHelpers) { + 'use strict'; + + _internalTestHelpers.moduleFor('Query Params - overlapping query param property names', (function (_QueryParamTestCase) { + babelHelpers.inherits(_class, _QueryParamTestCase); + + function _class() { + _QueryParamTestCase.apply(this, arguments); + } + + _class.prototype.setupBase = function setupBase() { + this.router.map(function () { + this.route('parent', function () { + this.route('child'); + }); + }); + + return this.visit('/parent/child'); + }; + + _class.prototype['@test can remap same-named qp props'] = function testCanRemapSameNamedQpProps(assert) { + var _this = this; + + assert.expect(7); + + this.setMappedQPController('parent'); + this.setMappedQPController('parent.child', 'page', 'childPage'); + + return this.setupBase().then(function () { + _this.assertCurrentPath('/parent/child'); + + var parentController = _this.getController('parent'); + var parentChildController = _this.getController('parent.child'); + + _this.setAndFlush(parentController, 'page', 2); + _this.assertCurrentPath('/parent/child?parentPage=2'); + _this.setAndFlush(parentController, 'page', 1); + _this.assertCurrentPath('/parent/child'); + + _this.setAndFlush(parentChildController, 'page', 2); + _this.assertCurrentPath('/parent/child?childPage=2'); + _this.setAndFlush(parentChildController, 'page', 1); + _this.assertCurrentPath('/parent/child'); + + _emberMetal.run(function () { + parentController.set('page', 2); + parentChildController.set('page', 2); + }); + + _this.assertCurrentPath('/parent/child?childPage=2&parentPage=2'); + + _emberMetal.run(function () { + parentController.set('page', 1); + parentChildController.set('page', 1); + }); + + _this.assertCurrentPath('/parent/child'); + }); + }; + + _class.prototype['@test query params can be either controller property or url key'] = function testQueryParamsCanBeEitherControllerPropertyOrUrlKey(assert) { + var _this2 = this; + + assert.expect(3); + + this.setMappedQPController('parent'); + + return this.setupBase().then(function () { + _this2.assertCurrentPath('/parent/child'); + + _this2.transitionTo('parent.child', { queryParams: { page: 2 } }); + _this2.assertCurrentPath('/parent/child?parentPage=2'); + + _this2.transitionTo('parent.child', { queryParams: { parentPage: 3 } }); + _this2.assertCurrentPath('/parent/child?parentPage=3'); + }); + }; + + _class.prototype['@test query param matching a url key and controller property'] = function testQueryParamMatchingAUrlKeyAndControllerProperty(assert) { + var _this3 = this; + + assert.expect(3); + + this.setMappedQPController('parent', 'page', 'parentPage'); + this.setMappedQPController('parent.child', 'index', 'page'); + + return this.setupBase().then(function () { + _this3.transitionTo('parent.child', { queryParams: { page: 2 } }); + _this3.assertCurrentPath('/parent/child?parentPage=2'); + + _this3.transitionTo('parent.child', { queryParams: { parentPage: 3 } }); + _this3.assertCurrentPath('/parent/child?parentPage=3'); + + _this3.transitionTo('parent.child', { queryParams: { index: 2, page: 2 } }); + _this3.assertCurrentPath('/parent/child?page=2&parentPage=2'); + }); + }; + + _class.prototype['@test query param matching same property on two controllers use the urlKey higher in the chain'] = function testQueryParamMatchingSamePropertyOnTwoControllersUseTheUrlKeyHigherInTheChain(assert) { + var _this4 = this; + + assert.expect(4); + + this.setMappedQPController('parent', 'page', 'parentPage'); + this.setMappedQPController('parent.child', 'page', 'childPage'); + + return this.setupBase().then(function () { + _this4.transitionTo('parent.child', { queryParams: { page: 2 } }); + _this4.assertCurrentPath('/parent/child?parentPage=2'); + + _this4.transitionTo('parent.child', { queryParams: { parentPage: 3 } }); + _this4.assertCurrentPath('/parent/child?parentPage=3'); + + _this4.transitionTo('parent.child', { queryParams: { childPage: 2, page: 2 } }); + _this4.assertCurrentPath('/parent/child?childPage=2&parentPage=2'); + + _this4.transitionTo('parent.child', { queryParams: { childPage: 3, parentPage: 4 } }); + _this4.assertCurrentPath('/parent/child?childPage=3&parentPage=4'); + }); + }; + + _class.prototype['@test query params in the same route hierarchy with the same url key get auto-scoped'] = function testQueryParamsInTheSameRouteHierarchyWithTheSameUrlKeyGetAutoScoped(assert) { + var _this5 = this; + + assert.expect(1); + + this.setMappedQPController('parent'); + this.setMappedQPController('parent.child'); + + expectAssertion(function () { + _this5.setupBase(); + }, 'You\'re not allowed to have more than one controller property map to the same query param key, but both `parent:page` and `parent.child:page` map to `parentPage`. You can fix this by mapping one of the controller properties to a different query param key via the `as` config option, e.g. `page: { as: \'other-page\' }`'); + }; + + _class.prototype['@test Support shared but overridable mixin pattern'] = function testSupportSharedButOverridableMixinPattern(assert) { + var _this6 = this; + + assert.expect(7); + + var HasPage = _emberMetal.Mixin.create({ + queryParams: 'page', + page: 1 + }); + + this.registerController('parent', _emberRuntime.Controller.extend(HasPage, { + queryParams: { page: 'yespage' } + })); + + this.registerController('parent.child', _emberRuntime.Controller.extend(HasPage)); + + return this.setupBase().then(function () { + _this6.assertCurrentPath('/parent/child'); + + var parentController = _this6.getController('parent'); + var parentChildController = _this6.getController('parent.child'); + + _this6.setAndFlush(parentChildController, 'page', 2); + _this6.assertCurrentPath('/parent/child?page=2'); + assert.equal(parentController.get('page'), 1); + assert.equal(parentChildController.get('page'), 2); + + _this6.setAndFlush(parentController, 'page', 2); + _this6.assertCurrentPath('/parent/child?page=2&yespage=2'); + assert.equal(parentController.get('page'), 2); + assert.equal(parentChildController.get('page'), 2); + }); + }; + + return _class; + })(_internalTestHelpers.QueryParamTestCase)); +}); +enifed('ember/tests/routing/query_params_test/overlapping_query_params_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/routing/query_params_test'); + test('ember/tests/routing/query_params_test/overlapping_query_params_test.js should pass jscs', function () { + ok(true, 'ember/tests/routing/query_params_test/overlapping_query_params_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/routing/query_params_test/overlapping_query_params_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/routing/query_params_test'); + QUnit.test('ember/tests/routing/query_params_test/overlapping_query_params_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/query_params_test/overlapping_query_params_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/routing/query_params_test/query_param_async_get_handler_test', ['exports', 'ember-runtime', 'ember-routing', 'internal-test-helpers'], function (exports, _emberRuntime, _emberRouting, _internalTestHelpers) { + 'use strict'; + + // These tests mimic what happens with lazily loaded Engines. + _internalTestHelpers.moduleFor('Query Params - async get handler', (function (_QueryParamTestCase) { + babelHelpers.inherits(_class, _QueryParamTestCase); + + function _class() { + _QueryParamTestCase.apply(this, arguments); + } + + _class.prototype['@test can render a link to an asynchronously loaded route without fetching the route'] = function testCanRenderALinkToAnAsynchronouslyLoadedRouteWithoutFetchingTheRoute(assert) { + var _this = this; + + assert.expect(4); + + this.router.map(function () { + this.route('post', { path: '/post/:id' }); + }); + + this.setSingleQPController('post'); + + var setupAppTemplate = function () { + _this.registerTemplate('application', '\n {{link-to \'Post\' \'post\' 1337 (query-params foo=\'bar\') class=\'post-link\'}}\n {{link-to \'Post\' \'post\' 7331 (query-params foo=\'boo\') class=\'post-link\'}}\n {{outlet}}\n '); + }; + + setupAppTemplate(); + + return this.visitAndAssert('/').then(function () { + assert.equal(_this.$('.post-link').eq(0).attr('href'), '/post/1337?foo=bar', 'renders correctly with default QP value'); + assert.equal(_this.$('.post-link').eq(1).attr('href'), '/post/7331?foo=boo', 'renders correctly with non-default QP value'); + assert.deepEqual(_this.fetchedHandlers, ['application', 'index'], 'only fetched the handlers for the route we\'re on'); + }); + }; + + _class.prototype['@test can transitionTo to an asynchronously loaded route with simple query params'] = function testCanTransitionToToAnAsynchronouslyLoadedRouteWithSimpleQueryParams(assert) { + var _this2 = this; + + assert.expect(6); + + this.router.map(function () { + this.route('post', { path: '/post/:id' }); + this.route('posts'); + }); + + this.setSingleQPController('post'); + + var postController = undefined; + return this.visitAndAssert('/').then(function () { + postController = _this2.getController('post'); + + return _this2.transitionTo('posts').then(function () { + _this2.assertCurrentPath('/posts'); + }); + }).then(function () { + return _this2.transitionTo('post', 1337, { queryParams: { foo: 'boo' } }).then(function () { + assert.equal(postController.get('foo'), 'boo', 'simple QP is correctly set on controller'); + _this2.assertCurrentPath('/post/1337?foo=boo'); + }); + }).then(function () { + return _this2.transitionTo('post', 1337, { queryParams: { foo: 'bar' } }).then(function () { + assert.equal(postController.get('foo'), 'bar', 'simple QP is correctly set with default value'); + _this2.assertCurrentPath('/post/1337'); + }); + }); + }; + + _class.prototype['@test can transitionTo to an asynchronously loaded route with array query params'] = function testCanTransitionToToAnAsynchronouslyLoadedRouteWithArrayQueryParams(assert) { + var _this3 = this; + + assert.expect(5); + + this.router.map(function () { + this.route('post', { path: '/post/:id' }); + }); + + this.setSingleQPController('post', 'comments', []); + + var postController = undefined; + return this.visitAndAssert('/').then(function () { + postController = _this3.getController('post'); + return _this3.transitionTo('post', 1337, { queryParams: { comments: [1, 2] } }).then(function () { + assert.deepEqual(postController.get('comments'), [1, 2], 'array QP is correctly set with default value'); + _this3.assertCurrentPath('/post/1337?comments=%5B1%2C2%5D'); + }); + }).then(function () { + return _this3.transitionTo('post', 1338).then(function () { + assert.deepEqual(postController.get('comments'), [], 'array QP is correctly set on controller'); + _this3.assertCurrentPath('/post/1338'); + }); + }); + }; + + _class.prototype['@test can transitionTo to an asynchronously loaded route with mapped query params'] = function testCanTransitionToToAnAsynchronouslyLoadedRouteWithMappedQueryParams(assert) { + var _this4 = this; + + assert.expect(7); + + this.router.map(function () { + this.route('post', { path: '/post/:id' }, function () { + this.route('index', { path: '/' }); + }); + }); + + this.setSingleQPController('post'); + this.setMappedQPController('post.index', 'comment', 'note'); + + var postController = undefined; + var postIndexController = undefined; + + return this.visitAndAssert('/').then(function () { + postController = _this4.getController('post'); + postIndexController = _this4.getController('post.index'); + + return _this4.transitionTo('post.index', 1337, { queryParams: { note: 6, foo: 'boo' } }).then(function () { + assert.equal(postController.get('foo'), 'boo', 'simple QP is correctly set on controller'); + assert.equal(postIndexController.get('comment'), 6, 'mapped QP is correctly set on controller'); + _this4.assertCurrentPath('/post/1337?foo=boo¬e=6'); + }); + }).then(function () { + return _this4.transitionTo('post', 1337, { queryParams: { foo: 'bar' } }).then(function () { + assert.equal(postController.get('foo'), 'bar', 'simple QP is correctly set with default value'); + assert.equal(postIndexController.get('comment'), 6, 'mapped QP retains value scoped to model'); + _this4.assertCurrentPath('/post/1337?note=6'); + }); + }); + }; + + _class.prototype['@test can transitionTo with a URL'] = function testCanTransitionToWithAURL(assert) { + var _this5 = this; + + assert.expect(7); + + this.router.map(function () { + this.route('post', { path: '/post/:id' }, function () { + this.route('index', { path: '/' }); + }); + }); + + this.setSingleQPController('post'); + this.setMappedQPController('post.index', 'comment', 'note'); + + var postController = undefined; + var postIndexController = undefined; + + return this.visitAndAssert('/').then(function () { + postController = _this5.getController('post'); + postIndexController = _this5.getController('post.index'); + + return _this5.transitionTo('/post/1337?foo=boo¬e=6').then(function () { + assert.equal(postController.get('foo'), 'boo', 'simple QP is correctly deserialized on controller'); + assert.equal(postIndexController.get('comment'), 6, 'mapped QP is correctly deserialized on controller'); + _this5.assertCurrentPath('/post/1337?foo=boo¬e=6'); + }); + }).then(function () { + return _this5.transitionTo('/post/1337?note=6').then(function () { + assert.equal(postController.get('foo'), 'bar', 'simple QP is correctly deserialized with default value'); + assert.equal(postIndexController.get('comment'), 6, 'mapped QP retains value scoped to model'); + _this5.assertCurrentPath('/post/1337?note=6'); + }); + }); + }; + + _class.prototype['@test undefined isn\'t serialized or deserialized into a string'] = function testUndefinedIsnTSerializedOrDeserializedIntoAString(assert) { + var _this6 = this; + + assert.expect(4); + + this.router.map(function () { + this.route('example'); + }); + + this.registerTemplate('application', '{{link-to \'Example\' \'example\' (query-params foo=undefined) id=\'the-link\'}}'); + + this.setSingleQPController('example', 'foo', undefined, { + foo: undefined + }); + + this.registerRoute('example', _emberRouting.Route.extend({ + model: function (params) { + assert.deepEqual(params, { foo: undefined }); + } + })); + + return this.visitAndAssert('/').then(function () { + assert.equal(_this6.$('#the-link').attr('href'), '/example', 'renders without undefined qp serialized'); + + return _this6.transitionTo('example', { queryParams: { foo: undefined } }).then(function () { + _this6.assertCurrentPath('/example'); + }); + }); + }; + + babelHelpers.createClass(_class, [{ + key: 'routerOptions', + get: function () { + var fetchedHandlers = this.fetchedHandlers = []; + + return { + location: 'test', + + _getQPMeta: function (handlerInfo) { + return this._bucketCache.lookup('route-meta', handlerInfo.name); + }, + + _getHandlerFunction: function () { + var getHandler = this._super.apply(this, arguments); + var cache = {}; + + return function (routeName) { + fetchedHandlers.push(routeName); + + // Cache the returns so we don't have more than one Promise for a + // given handler. + return cache[routeName] || (cache[routeName] = new _emberRuntime.RSVP.Promise(function (resolve) { + setTimeout(function () { + return resolve(getHandler(routeName)); + }, 10); + })); + }; + } + }; + } + }]); + return _class; + })(_internalTestHelpers.QueryParamTestCase)); +}); +enifed('ember/tests/routing/query_params_test/query_param_async_get_handler_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/routing/query_params_test'); + test('ember/tests/routing/query_params_test/query_param_async_get_handler_test.js should pass jscs', function () { + ok(true, 'ember/tests/routing/query_params_test/query_param_async_get_handler_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/routing/query_params_test/query_param_async_get_handler_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/routing/query_params_test'); + QUnit.test('ember/tests/routing/query_params_test/query_param_async_get_handler_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/query_params_test/query_param_async_get_handler_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/routing/query_params_test/query_params_paramless_link_to_test', ['exports', 'ember-runtime', 'ember-views', 'internal-test-helpers'], function (exports, _emberRuntime, _emberViews, _internalTestHelpers) { + 'use strict'; + + _internalTestHelpers.moduleFor('Query Params - paramless link-to', (function (_QueryParamTestCase) { + babelHelpers.inherits(_class, _QueryParamTestCase); + + function _class() { + _QueryParamTestCase.apply(this, arguments); + } + + _class.prototype.testParamlessLinks = function testParamlessLinks(assert, routeName) { + assert.expect(1); + + this.registerTemplate(routeName, '{{link-to \'index\' \'index\' id=\'index-link\'}}'); + + this.registerController(routeName, _emberRuntime.Controller.extend({ + queryParams: ['foo'], + foo: 'wat' + })); + + return this.visit('/?foo=YEAH').then(function () { + assert.equal(_emberViews.jQuery('#index-link').attr('href'), '/?foo=YEAH'); + }); + }; + + _class.prototype['@test param-less links in an app booted with query params in the URL don\'t reset the query params: application'] = function testParamLessLinksInAnAppBootedWithQueryParamsInTheURLDonTResetTheQueryParamsApplication(assert) { + return this.testParamlessLinks(assert, 'application'); + }; + + _class.prototype['@test param-less links in an app booted with query params in the URL don\'t reset the query params: index'] = function testParamLessLinksInAnAppBootedWithQueryParamsInTheURLDonTResetTheQueryParamsIndex(assert) { + return this.testParamlessLinks(assert, 'index'); + }; + + return _class; + })(_internalTestHelpers.QueryParamTestCase)); +}); +enifed('ember/tests/routing/query_params_test/query_params_paramless_link_to_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/routing/query_params_test'); + test('ember/tests/routing/query_params_test/query_params_paramless_link_to_test.js should pass jscs', function () { + ok(true, 'ember/tests/routing/query_params_test/query_params_paramless_link_to_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/routing/query_params_test/query_params_paramless_link_to_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/routing/query_params_test'); + QUnit.test('ember/tests/routing/query_params_test/query_params_paramless_link_to_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/query_params_test/query_params_paramless_link_to_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/routing/query_params_test/shared_state_test', ['exports', 'ember-runtime', 'ember', 'ember-metal', 'ember-views', 'internal-test-helpers'], function (exports, _emberRuntime, _ember, _emberMetal, _emberViews, _internalTestHelpers) { + 'use strict'; + + _internalTestHelpers.moduleFor('Query Params - shared service state', (function (_QueryParamTestCase) { + babelHelpers.inherits(_class, _QueryParamTestCase); + + function _class() { + _QueryParamTestCase.apply(this, arguments); + } + + _class.prototype.boot = function boot() { + this.setupApplication(); + return this.visitApplication(); + }; + + _class.prototype.setupApplication = function setupApplication() { + this.router.map(function () { + this.route('home', { path: '/' }); + this.route('dashboard'); + }); + + this.application.register('service:filters', _emberRuntime.Service.extend({ + shared: true + })); + + this.registerController('home', _emberRuntime.Controller.extend({ + filters: _ember.default.inject.service() + })); + + this.registerController('dashboard', _emberRuntime.Controller.extend({ + filters: _ember.default.inject.service(), + queryParams: [{ 'filters.shared': 'shared' }] + })); + + this.registerTemplate('application', '{{link-to \'Home\' \'home\' }}
    {{outlet}}
    '); + this.registerTemplate('home', '{{link-to \'Dashboard\' \'dashboard\' }}{{input type="checkbox" id=\'filters-checkbox\' checked=(mut filters.shared) }}'); + this.registerTemplate('dashboard', '{{link-to \'Home\' \'home\' }}'); + }; + + _class.prototype.visitApplication = function visitApplication() { + return this.visit('/'); + }; + + _class.prototype['@test can modify shared state before transition'] = function testCanModifySharedStateBeforeTransition(assert) { + var _this = this; + + assert.expect(1); + + return this.boot().then(function () { + _this.$input = _emberViews.jQuery('#filters-checkbox'); + + // click the checkbox once to set filters.shared to false + _emberMetal.run(_this.$input, 'click'); + + return _this.visit('/dashboard').then(function () { + assert.ok(true, 'expecting navigating to dashboard to succeed'); + }); + }); + }; + + _class.prototype['@test can modify shared state back to the default value before transition'] = function testCanModifySharedStateBackToTheDefaultValueBeforeTransition(assert) { + var _this2 = this; + + assert.expect(1); + + return this.boot().then(function () { + _this2.$input = _emberViews.jQuery('#filters-checkbox'); + + // click the checkbox twice to set filters.shared to false and back to true + _emberMetal.run(_this2.$input, 'click'); + _emberMetal.run(_this2.$input, 'click'); + + return _this2.visit('/dashboard').then(function () { + assert.ok(true, 'expecting navigating to dashboard to succeed'); + }); + }); + }; + + return _class; + })(_internalTestHelpers.QueryParamTestCase)); +}); +enifed('ember/tests/routing/query_params_test/shared_state_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/routing/query_params_test'); + test('ember/tests/routing/query_params_test/shared_state_test.js should pass jscs', function () { + ok(true, 'ember/tests/routing/query_params_test/shared_state_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/routing/query_params_test/shared_state_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/routing/query_params_test'); + QUnit.test('ember/tests/routing/query_params_test/shared_state_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/query_params_test/shared_state_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/routing/router_map_test', ['exports', 'ember-metal', 'ember-template-compiler', 'ember-application', 'ember-routing', 'ember-views', 'ember-glimmer'], function (exports, _emberMetal, _emberTemplateCompiler, _emberApplication, _emberRouting, _emberViews, _emberGlimmer) { + 'use strict'; + + var router = undefined, + App = undefined, + container = undefined; + + function bootApplication() { + router = container.lookup('router:main'); + _emberMetal.run(App, 'advanceReadiness'); + } + + function handleURL(path) { + return _emberMetal.run(function () { + return router.handleURL(path).then(function (value) { + ok(true, 'url: `' + path + '` was handled'); + return value; + }, function (reason) { + ok(false, 'failed to visit:`' + path + '` reason: `' + QUnit.jsDump.parse(reason)); + throw reason; + }); + }); + } + + QUnit.module('Router.map', { + setup: function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create({ + name: 'App', + rootElement: '#qunit-fixture' + }); + + App.deferReadiness(); + + App.Router.reopen({ + location: 'none' + }); + + container = App.__container__; + }); + }, + + teardown: function () { + _emberMetal.run(function () { + App.destroy(); + App = null; + + _emberGlimmer.setTemplates({}); + }); + } + }); + + QUnit.test('Router.map returns an Ember Router class', function () { + expect(1); + + var ret = App.Router.map(function () { + this.route('hello'); + }); + + ok(_emberRouting.Router.detect(ret)); + }); + + QUnit.test('Router.map can be called multiple times', function () { + expect(4); + + _emberGlimmer.setTemplate('hello', _emberTemplateCompiler.compile('Hello!')); + _emberGlimmer.setTemplate('goodbye', _emberTemplateCompiler.compile('Goodbye!')); + + App.Router.map(function () { + this.route('hello'); + }); + + App.Router.map(function () { + this.route('goodbye'); + }); + + bootApplication(); + + handleURL('/hello'); + + equal(_emberViews.jQuery('#qunit-fixture').text(), 'Hello!', 'The hello template was rendered'); + + handleURL('/goodbye'); + + equal(_emberViews.jQuery('#qunit-fixture').text(), 'Goodbye!', 'The goodbye template was rendered'); + }); +}); +enifed('ember/tests/routing/router_map_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/routing'); + test('ember/tests/routing/router_map_test.js should pass jscs', function () { + ok(true, 'ember/tests/routing/router_map_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/routing/router_map_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/routing'); + QUnit.test('ember/tests/routing/router_map_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/router_map_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/routing/substates_test', ['exports', 'ember-runtime', 'ember-routing', 'ember-metal', 'ember-template-compiler', 'ember-application', 'ember-views', 'ember-glimmer'], function (exports, _emberRuntime, _emberRouting, _emberMetal, _emberTemplateCompiler, _emberApplication, _emberViews, _emberGlimmer) { + 'use strict'; + + var Router = undefined, + App = undefined, + templates = undefined, + router = undefined, + container = undefined, + registry = undefined, + counter = undefined; + + function step(expectedValue, description) { + equal(counter, expectedValue, 'Step ' + expectedValue + ': ' + description); + counter++; + } + + function bootApplication(startingURL) { + for (var _name in templates) { + _emberGlimmer.setTemplate(_name, _emberTemplateCompiler.compile(templates[_name])); + } + + if (startingURL) { + _emberRouting.NoneLocation.reopen({ + path: startingURL + }); + } + + startingURL = startingURL || ''; + router = container.lookup('router:main'); + _emberMetal.run(App, 'advanceReadiness'); + } + + QUnit.module('Loading/Error Substates', { + setup: function () { + counter = 1; + + _emberMetal.run(function () { + App = _emberApplication.Application.create({ + name: 'App', + rootElement: '#qunit-fixture', + // fake a modules resolver + Resolver: _emberApplication.Resolver.extend({ moduleBasedResolver: true }) + }); + + App.deferReadiness(); + + App.Router.reopen({ + location: 'none' + }); + + Router = App.Router; + + container = App.__container__; + registry = App.__registry__; + + templates = { + application: '
    {{outlet}}
    ', + index: 'INDEX', + loading: 'LOADING', + bro: 'BRO', + sis: 'SIS' + }; + }); + }, + + teardown: function () { + _emberMetal.run(function () { + App.destroy(); + App = null; + + _emberGlimmer.setTemplates({}); + }); + + _emberRouting.NoneLocation.reopen({ + path: '' + }); + } + }); + + QUnit.test('Slow promise from a child route of application enters nested loading state', function () { + var broModel = {}; + var broDeferred = _emberRuntime.RSVP.defer(); + + Router.map(function () { + this.route('bro'); + }); + + App.ApplicationRoute = _emberRouting.Route.extend({ + setupController: function () { + step(2, 'ApplicationRoute#setup'); + } + }); + + App.BroRoute = _emberRouting.Route.extend({ + model: function () { + step(1, 'BroRoute#model'); + return broDeferred.promise; + } + }); + + bootApplication('/bro'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'LOADING', 'The Loading template is nested in application template\'s outlet'); + + _emberMetal.run(broDeferred, 'resolve', broModel); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'BRO', 'bro template has loaded and replaced loading template'); + }); + + QUnit.test('Slow promises waterfall on startup', function () { + expect(7); + + var grandmaDeferred = _emberRuntime.RSVP.defer(); + var sallyDeferred = _emberRuntime.RSVP.defer(); + + Router.map(function () { + this.route('grandma', function () { + this.route('mom', { resetNamespace: true }, function () { + this.route('sally'); + }); + }); + }); + + templates.grandma = 'GRANDMA {{outlet}}'; + templates.mom = 'MOM {{outlet}}'; + templates['mom/loading'] = 'MOMLOADING'; + templates['mom/sally'] = 'SALLY'; + + App.GrandmaRoute = _emberRouting.Route.extend({ + model: function () { + step(1, 'GrandmaRoute#model'); + return grandmaDeferred.promise; + } + }); + + App.MomRoute = _emberRouting.Route.extend({ + model: function () { + step(2, 'Mom#model'); + return {}; + } + }); + + App.MomSallyRoute = _emberRouting.Route.extend({ + model: function () { + step(3, 'SallyRoute#model'); + return sallyDeferred.promise; + }, + setupController: function () { + step(4, 'SallyRoute#setupController'); + } + }); + + bootApplication('/grandma/mom/sally'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'LOADING', 'The Loading template is nested in application template\'s outlet'); + + _emberMetal.run(grandmaDeferred, 'resolve', {}); + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'GRANDMA MOM MOMLOADING', 'Mom\'s child loading route is displayed due to sally\'s slow promise'); + + _emberMetal.run(sallyDeferred, 'resolve', {}); + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'GRANDMA MOM SALLY', 'Sally template displayed'); + }); + + QUnit.test('ApplicationRoute#currentPath reflects loading state path', function () { + expect(4); + + var momDeferred = _emberRuntime.RSVP.defer(); + + Router.map(function () { + this.route('grandma', function () { + this.route('mom'); + }); + }); + + templates.grandma = 'GRANDMA {{outlet}}'; + templates['grandma/loading'] = 'GRANDMALOADING'; + templates['grandma/mom'] = 'MOM'; + + App.GrandmaMomRoute = _emberRouting.Route.extend({ + model: function () { + return momDeferred.promise; + } + }); + + bootApplication('/grandma/mom'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'GRANDMA GRANDMALOADING'); + + var appController = container.lookup('controller:application'); + equal(appController.get('currentPath'), 'grandma.loading', 'currentPath reflects loading state'); + + _emberMetal.run(momDeferred, 'resolve', {}); + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'GRANDMA MOM'); + equal(appController.get('currentPath'), 'grandma.mom', 'currentPath reflects final state'); + }); + + QUnit.test('Slow promises returned from ApplicationRoute#model don\'t enter LoadingRoute', function () { + expect(2); + + var appDeferred = _emberRuntime.RSVP.defer(); + + App.ApplicationRoute = _emberRouting.Route.extend({ + model: function () { + return appDeferred.promise; + } + }); + + App.LoadingRoute = _emberRouting.Route.extend({ + setupController: function () { + ok(false, 'shouldn\'t get here'); + } + }); + + bootApplication(); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), '', 'nothing has been rendered yet'); + + _emberMetal.run(appDeferred, 'resolve', {}); + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'INDEX'); + }); + + QUnit.test('Don\'t enter loading route unless either route or template defined', function () { + delete templates.loading; + + expect(2); + + var indexDeferred = _emberRuntime.RSVP.defer(); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.IndexRoute = _emberRouting.Route.extend({ + model: function () { + return indexDeferred.promise; + } + }); + + bootApplication(); + + var appController = container.lookup('controller:application'); + ok(appController.get('currentPath') !== 'loading', 'loading state not entered'); + + _emberMetal.run(indexDeferred, 'resolve', {}); + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'INDEX'); + }); + + QUnit.test('Enter loading route if only LoadingRoute defined', function () { + delete templates.loading; + + expect(4); + + var indexDeferred = _emberRuntime.RSVP.defer(); + + App.IndexRoute = _emberRouting.Route.extend({ + model: function () { + step(1, 'IndexRoute#model'); + return indexDeferred.promise; + } + }); + + App.LoadingRoute = _emberRouting.Route.extend({ + setupController: function () { + step(2, 'LoadingRoute#setupController'); + } + }); + + bootApplication(); + + var appController = container.lookup('controller:application'); + equal(appController.get('currentPath'), 'loading', 'loading state entered'); + + _emberMetal.run(indexDeferred, 'resolve', {}); + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'INDEX'); + }); + + QUnit.test('Enter child loading state of pivot route', function () { + expect(4); + + var deferred = _emberRuntime.RSVP.defer(); + + Router.map(function () { + this.route('grandma', function () { + this.route('mom', { resetNamespace: true }, function () { + this.route('sally'); + }); + this.route('smells'); + }); + }); + + templates['grandma/loading'] = 'GMONEYLOADING'; + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.MomSallyRoute = _emberRouting.Route.extend({ + setupController: function () { + step(1, 'SallyRoute#setupController'); + } + }); + + App.GrandmaSmellsRoute = _emberRouting.Route.extend({ + model: function () { + return deferred.promise; + } + }); + + bootApplication('/grandma/mom/sally'); + + var appController = container.lookup('controller:application'); + equal(appController.get('currentPath'), 'grandma.mom.sally', 'Initial route fully loaded'); + + _emberMetal.run(router, 'transitionTo', 'grandma.smells'); + equal(appController.get('currentPath'), 'grandma.loading', 'in pivot route\'s child loading state'); + + _emberMetal.run(deferred, 'resolve', {}); + + equal(appController.get('currentPath'), 'grandma.smells', 'Finished transition'); + }); + + QUnit.test('Loading actions bubble to root, but don\'t enter substates above pivot', function () { + expect(6); + + delete templates.loading; + + var sallyDeferred = _emberRuntime.RSVP.defer(); + var smellsDeferred = _emberRuntime.RSVP.defer(); + + Router.map(function () { + this.route('grandma', function () { + this.route('mom', { resetNamespace: true }, function () { + this.route('sally'); + }); + this.route('smells'); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.ApplicationRoute = _emberRouting.Route.extend({ + actions: { + loading: function (transition, route) { + ok(true, 'loading action received on ApplicationRoute'); + } + } + }); + + App.MomSallyRoute = _emberRouting.Route.extend({ + model: function () { + return sallyDeferred.promise; + } + }); + + App.GrandmaSmellsRoute = _emberRouting.Route.extend({ + model: function () { + return smellsDeferred.promise; + } + }); + + bootApplication('/grandma/mom/sally'); + + var appController = container.lookup('controller:application'); + ok(!appController.get('currentPath'), 'Initial route fully loaded'); + _emberMetal.run(sallyDeferred, 'resolve', {}); + + equal(appController.get('currentPath'), 'grandma.mom.sally', 'transition completed'); + + _emberMetal.run(router, 'transitionTo', 'grandma.smells'); + equal(appController.get('currentPath'), 'grandma.mom.sally', 'still in initial state because the only loading state is above the pivot route'); + + _emberMetal.run(smellsDeferred, 'resolve', {}); + + equal(appController.get('currentPath'), 'grandma.smells', 'Finished transition'); + }); + + QUnit.test('Default error event moves into nested route', function () { + expect(6); + + templates['grandma'] = 'GRANDMA {{outlet}}'; + templates['grandma/error'] = 'ERROR: {{model.msg}}'; + + Router.map(function () { + this.route('grandma', function () { + this.route('mom', { resetNamespace: true }, function () { + this.route('sally'); + }); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.MomSallyRoute = _emberRouting.Route.extend({ + model: function () { + step(1, 'MomSallyRoute#model'); + + return _emberRuntime.RSVP.reject({ + msg: 'did it broke?' + }); + }, + actions: { + error: function () { + step(2, 'MomSallyRoute#actions.error'); + return true; + } + } + }); + + throws(function () { + bootApplication('/grandma/mom/sally'); + }, function (err) { + return err.msg === 'did it broke?'; + }); + + step(3, 'App finished booting'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'GRANDMA ERROR: did it broke?', 'error bubbles'); + + var appController = container.lookup('controller:application'); + equal(appController.get('currentPath'), 'grandma.error', 'Initial route fully loaded'); + }); + + QUnit.test('Error events that aren\'t bubbled don\t throw application assertions', function () { + expect(2); + + templates['grandma'] = 'GRANDMA {{outlet}}'; + + Router.map(function () { + this.route('grandma', function () { + this.route('mom', { resetNamespace: true }, function () { + this.route('sally'); + }); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.MomSallyRoute = _emberRouting.Route.extend({ + model: function () { + step(1, 'MomSallyRoute#model'); + + return _emberRuntime.RSVP.reject({ + msg: 'did it broke?' + }); + }, + actions: { + error: function (err) { + equal(err.msg, 'did it broke?'); + return false; + } + } + }); + + bootApplication('/grandma/mom/sally'); + }); + + QUnit.test('Non-bubbled errors that re-throw aren\'t swallowed', function () { + expect(2); + + templates['grandma'] = 'GRANDMA {{outlet}}'; + + Router.map(function () { + this.route('grandma', function () { + this.route('mom', { resetNamespace: true }, function () { + this.route('sally'); + }); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.MomSallyRoute = _emberRouting.Route.extend({ + model: function () { + step(1, 'MomSallyRoute#model'); + + return _emberRuntime.RSVP.reject({ + msg: 'did it broke?' + }); + }, + actions: { + error: function (err) { + // returns undefined which is falsey + throw err; + } + } + }); + + throws(function () { + bootApplication('/grandma/mom/sally'); + }, function (err) { + return err.msg === 'did it broke?'; + }); + }); + + QUnit.test('Handled errors that re-throw aren\'t swallowed', function () { + expect(4); + + var handledError = undefined; + + templates['grandma'] = 'GRANDMA {{outlet}}'; + + Router.map(function () { + this.route('grandma', function () { + this.route('mom', { resetNamespace: true }, function () { + this.route('sally'); + this.route('this-route-throws'); + }); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.MomSallyRoute = _emberRouting.Route.extend({ + model: function () { + step(1, 'MomSallyRoute#model'); + + return _emberRuntime.RSVP.reject({ + msg: 'did it broke?' + }); + }, + actions: { + error: function (err) { + step(2, 'MomSallyRoute#error'); + + handledError = err; + + this.transitionTo('mom.this-route-throws'); + + // Marks error as handled + return false; + } + } + }); + + App.MomThisRouteThrowsRoute = _emberRouting.Route.extend({ + model: function () { + step(3, 'MomThisRouteThrows#model'); + + throw handledError; + } + }); + + throws(function () { + bootApplication('/grandma/mom/sally'); + }, function (err) { + return err.msg === 'did it broke?'; + }); + }); + + QUnit.test('Handled errors that bubble can be handled at a higher level', function () { + expect(4); + + var handledError = undefined; + + templates['grandma'] = 'GRANDMA {{outlet}}'; + + Router.map(function () { + this.route('grandma', function () { + this.route('mom', { resetNamespace: true }, function () { + this.route('sally'); + }); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.MomRoute = _emberRouting.Route.extend({ + actions: { + error: function (err) { + step(3, 'MomRoute#error'); + + equal(err, handledError, 'error handled and rebubbled is handleable at heigher route'); + } + } + }); + + App.MomSallyRoute = _emberRouting.Route.extend({ + model: function () { + step(1, 'MomSallyRoute#model'); + + return _emberRuntime.RSVP.reject({ + msg: 'did it broke?' + }); + }, + + actions: { + error: function (err) { + step(2, 'MomSallyRoute#error'); + + handledError = err; + + return true; + } + } + }); + + bootApplication('/grandma/mom/sally'); + }); + + QUnit.test('errors that are bubbled are thrown at a higher level if not handled', function () { + expect(3); + + var handledError = undefined; + + templates['grandma'] = 'GRANDMA {{outlet}}'; + + Router.map(function () { + this.route('grandma', function () { + this.route('mom', { resetNamespace: true }, function () { + this.route('sally'); + }); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.MomSallyRoute = _emberRouting.Route.extend({ + model: function () { + step(1, 'MomSallyRoute#model'); + + return _emberRuntime.RSVP.reject({ + msg: 'did it broke?' + }); + }, + + actions: { + error: function (err) { + step(2, 'MomSallyRoute#error'); + + handledError = err; + + return true; + } + } + }); + + throws(function () { + bootApplication('/grandma/mom/sally'); + }, function (err) { + return err.msg === 'did it broke?'; + }, 'Correct error was thrown'); + }); + + QUnit.test('Handled errors that are thrown through rejection aren\'t swallowed', function () { + expect(4); + + var handledError = undefined; + + templates['grandma'] = 'GRANDMA {{outlet}}'; + + Router.map(function () { + this.route('grandma', function () { + this.route('mom', { resetNamespace: true }, function () { + this.route('sally'); + this.route('this-route-throws'); + }); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.MomSallyRoute = _emberRouting.Route.extend({ + model: function () { + step(1, 'MomSallyRoute#model'); + + return _emberRuntime.RSVP.reject({ + msg: 'did it broke?' + }); + }, + actions: { + error: function (err) { + step(2, 'MomSallyRoute#error'); + + handledError = err; + + this.transitionTo('mom.this-route-throws'); + + // Marks error as handled + return false; + } + } + }); + + App.MomThisRouteThrowsRoute = _emberRouting.Route.extend({ + model: function () { + step(3, 'MomThisRouteThrows#model'); + + return _emberRuntime.RSVP.reject(handledError); + } + }); + + throws(function () { + bootApplication('/grandma/mom/sally'); + }, function (err) { + return err.msg === 'did it broke?'; + }); + }); + + QUnit.test('Setting a query param during a slow transition should work', function () { + var deferred = _emberRuntime.RSVP.defer(); + + Router.map(function () { + this.route('grandma', { path: '/grandma/:seg' }, function () {}); + }); + + templates['grandma/loading'] = 'GMONEYLOADING'; + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.IndexRoute = _emberRouting.Route.extend({ + beforeModel: function () { + this.transitionTo('grandma', 1); + } + }); + + App.GrandmaRoute = _emberRouting.Route.extend({ + queryParams: { + test: { defaultValue: 1 } + } + }); + + App.GrandmaIndexRoute = _emberRouting.Route.extend({ + model: function () { + return deferred.promise; + } + }); + + bootApplication('/'); + + var appController = container.lookup('controller:application'); + var grandmaController = container.lookup('controller:grandma'); + + equal(appController.get('currentPath'), 'grandma.loading', 'Initial route should be loading'); + + _emberMetal.run(function () { + grandmaController.set('test', 3); + }); + + equal(appController.get('currentPath'), 'grandma.loading', 'Route should still be loading'); + equal(grandmaController.get('test'), 3, 'Controller query param value should have changed'); + + _emberMetal.run(deferred, 'resolve', {}); + + equal(appController.get('currentPath'), 'grandma.index', 'Transition should be complete'); + }); + + QUnit.test('Slow promises returned from ApplicationRoute#model enter ApplicationLoadingRoute if present', function () { + expect(2); + + var appDeferred = _emberRuntime.RSVP.defer(); + + App.ApplicationRoute = _emberRouting.Route.extend({ + model: function () { + return appDeferred.promise; + } + }); + + var loadingRouteEntered = false; + App.ApplicationLoadingRoute = _emberRouting.Route.extend({ + setupController: function () { + loadingRouteEntered = true; + } + }); + + bootApplication(); + + ok(loadingRouteEntered, 'ApplicationLoadingRoute was entered'); + + _emberMetal.run(appDeferred, 'resolve', {}); + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'INDEX'); + }); + + QUnit.test('Slow promises returned from ApplicationRoute#model enter application_loading if template present', function () { + expect(3); + + templates['application_loading'] = '
    TOPLEVEL LOADING
    '; + + var appDeferred = _emberRuntime.RSVP.defer(); + App.ApplicationRoute = _emberRouting.Route.extend({ + model: function () { + return appDeferred.promise; + } + }); + + bootApplication(); + + equal(_emberViews.jQuery('#qunit-fixture #toplevel-loading').text(), 'TOPLEVEL LOADING'); + + _emberMetal.run(appDeferred, 'resolve', {}); + + equal(_emberViews.jQuery('#toplevel-loading', '#qunit-fixture').length, 0, 'top-level loading View has been entirely removed from DOM'); + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'INDEX'); + }); + + QUnit.test('Default error event moves into nested route, prioritizing more specifically named error route', function () { + expect(6); + + templates['grandma'] = 'GRANDMA {{outlet}}'; + templates['grandma/error'] = 'ERROR: {{model.msg}}'; + templates['mom_error'] = 'MOM ERROR: {{model.msg}}'; + + Router.map(function () { + this.route('grandma', function () { + this.route('mom', { resetNamespace: true }, function () { + this.route('sally'); + }); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.MomSallyRoute = _emberRouting.Route.extend({ + model: function () { + step(1, 'MomSallyRoute#model'); + + return _emberRuntime.RSVP.reject({ + msg: 'did it broke?' + }); + }, + actions: { + error: function () { + step(2, 'MomSallyRoute#actions.error'); + return true; + } + } + }); + + throws(function () { + bootApplication('/grandma/mom/sally'); + }, function (err) { + return err.msg === 'did it broke?'; + }); + + step(3, 'App finished booting'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'GRANDMA MOM ERROR: did it broke?', 'the more specifically-named mom error substate was entered over the other error route'); + + var appController = container.lookup('controller:application'); + equal(appController.get('currentPath'), 'grandma.mom_error', 'Initial route fully loaded'); + }); + + QUnit.test('Prioritized substate entry works with preserved-namespace nested routes', function () { + expect(2); + + templates['foo/bar_loading'] = 'FOOBAR LOADING'; + templates['foo/bar/index'] = 'YAY'; + + Router.map(function () { + this.route('foo', function () { + this.route('bar', { path: '/bar' }, function () {}); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + var deferred = _emberRuntime.RSVP.defer(); + App.FooBarRoute = _emberRouting.Route.extend({ + model: function () { + return deferred.promise; + } + }); + + bootApplication('/foo/bar'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'FOOBAR LOADING', 'foo.bar_loading was entered (as opposed to something like foo/foo/bar_loading)'); + + _emberMetal.run(deferred, 'resolve'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'YAY'); + }); + + QUnit.test('Prioritized substate entry works with reset-namespace nested routes', function () { + expect(2); + + templates['bar_loading'] = 'BAR LOADING'; + templates['bar/index'] = 'YAY'; + + Router.map(function () { + this.route('foo', function () { + this.route('bar', { path: '/bar', resetNamespace: true }, function () {}); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + var deferred = _emberRuntime.RSVP.defer(); + App.BarRoute = _emberRouting.Route.extend({ + model: function () { + return deferred.promise; + } + }); + + bootApplication('/foo/bar'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'BAR LOADING', 'foo.bar_loading was entered (as opposed to something like foo/foo/bar_loading)'); + + _emberMetal.run(deferred, 'resolve'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'YAY'); + }); + + QUnit.test('Prioritized loading substate entry works with preserved-namespace nested routes', function () { + expect(2); + + templates['foo/bar_loading'] = 'FOOBAR LOADING'; + templates['foo/bar'] = 'YAY'; + + Router.map(function () { + this.route('foo', function () { + this.route('bar'); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + var deferred = _emberRuntime.RSVP.defer(); + App.FooBarRoute = _emberRouting.Route.extend({ + model: function () { + return deferred.promise; + } + }); + + bootApplication('/foo/bar'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'FOOBAR LOADING', 'foo.bar_loading was entered (as opposed to something like foo/foo/bar_loading)'); + + _emberMetal.run(deferred, 'resolve'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'YAY'); + }); + + QUnit.test('Prioritized error substate entry works with preserved-namespace nested routes', function () { + expect(2); + + templates['foo/bar_error'] = 'FOOBAR ERROR: {{model.msg}}'; + templates['foo/bar'] = 'YAY'; + + Router.map(function () { + this.route('foo', function () { + this.route('bar'); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.FooBarRoute = _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.RSVP.reject({ + msg: 'did it broke?' + }); + } + }); + + throws(function () { + bootApplication('/foo/bar'); + }, function (err) { + return err.msg === 'did it broke?'; + }); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'FOOBAR ERROR: did it broke?', 'foo.bar_error was entered (as opposed to something like foo/foo/bar_error)'); + }); + + QUnit.test('Prioritized loading substate entry works with auto-generated index routes', function () { + expect(2); + + templates['foo/index_loading'] = 'FOO LOADING'; + templates['foo/index'] = 'YAY'; + templates['foo'] = '{{outlet}}'; + + Router.map(function () { + this.route('foo', function () { + this.route('bar'); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + var deferred = _emberRuntime.RSVP.defer(); + App.FooIndexRoute = _emberRouting.Route.extend({ + model: function () { + return deferred.promise; + } + }); + App.FooRoute = _emberRouting.Route.extend({ + model: function () { + return true; + } + }); + + bootApplication('/foo'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'FOO LOADING', 'foo.index_loading was entered'); + + _emberMetal.run(deferred, 'resolve'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'YAY'); + }); + + QUnit.test('Prioritized error substate entry works with auto-generated index routes', function () { + expect(2); + + templates['foo/index_error'] = 'FOO ERROR: {{model.msg}}'; + templates['foo/index'] = 'YAY'; + templates['foo'] = '{{outlet}}'; + + Router.map(function () { + this.route('foo', function () { + this.route('bar'); + }); + }); + + App.ApplicationController = _emberRuntime.Controller.extend(); + + App.FooIndexRoute = _emberRouting.Route.extend({ + model: function () { + return _emberRuntime.RSVP.reject({ + msg: 'did it broke?' + }); + } + }); + App.FooRoute = _emberRouting.Route.extend({ + model: function () { + return true; + } + }); + + throws(function () { + return bootApplication('/foo'); + }, function (err) { + return err.msg === 'did it broke?'; + }); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'FOO ERROR: did it broke?', 'foo.index_error was entered'); + }); + + QUnit.test('Rejected promises returned from ApplicationRoute transition into top-level application_error', function () { + expect(3); + + templates['application_error'] = '

    TOPLEVEL ERROR: {{model.msg}}

    '; + + var reject = true; + App.ApplicationRoute = _emberRouting.Route.extend({ + model: function () { + if (reject) { + return _emberRuntime.RSVP.reject({ msg: 'BAD NEWS BEARS' }); + } else { + return {}; + } + } + }); + + throws(function () { + return bootApplication(); + }, function (err) { + return err.msg === 'BAD NEWS BEARS'; + }); + + equal(_emberViews.jQuery('#toplevel-error', '#qunit-fixture').text(), 'TOPLEVEL ERROR: BAD NEWS BEARS'); + + reject = false; + _emberMetal.run(router, 'transitionTo', 'index'); + + equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'INDEX'); + }); +}); +enifed('ember/tests/routing/substates_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/routing'); + test('ember/tests/routing/substates_test.js should pass jscs', function () { + ok(true, 'ember/tests/routing/substates_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/routing/substates_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/routing'); + QUnit.test('ember/tests/routing/substates_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/substates_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/routing/toplevel_dom_test', ['exports', 'ember-metal', 'ember-template-compiler', 'ember-application', 'ember-views', 'ember-routing', 'ember-glimmer'], function (exports, _emberMetal, _emberTemplateCompiler, _emberApplication, _emberViews, _emberRouting, _emberGlimmer) { + 'use strict'; + + var App = undefined, + templates = undefined, + router = undefined, + container = undefined; + + function bootApplication() { + for (var _name in templates) { + _emberGlimmer.setTemplate(_name, _emberTemplateCompiler.compile(templates[_name])); + } + router = container.lookup('router:main'); + _emberMetal.run(App, 'advanceReadiness'); + } + + QUnit.module('Top Level DOM Structure', { + setup: function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create({ + name: 'App', + rootElement: '#qunit-fixture' + }); + + App.deferReadiness(); + + App.Router.reopen({ + location: 'none' + }); + + container = App.__container__; + + templates = { + application: 'hello world' + }; + }); + }, + + teardown: function () { + _emberMetal.run(function () { + App.destroy(); + App = null; + _emberGlimmer.setTemplates({}); + }); + + _emberRouting.NoneLocation.reopen({ + path: '' + }); + } + }); + + QUnit.test('Topmost template always get an element', function () { + bootApplication(); + equal(_emberViews.jQuery('#qunit-fixture > .ember-view').text(), 'hello world'); + }); +}); +enifed('ember/tests/routing/toplevel_dom_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests/routing'); + test('ember/tests/routing/toplevel_dom_test.js should pass jscs', function () { + ok(true, 'ember/tests/routing/toplevel_dom_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/routing/toplevel_dom_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests/routing'); + QUnit.test('ember/tests/routing/toplevel_dom_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/toplevel_dom_test.js should pass jshint.'); + }); +}); +enifed('ember/tests/view_instrumentation_test', ['exports', 'ember-metal', 'ember-views', 'ember-application', 'ember-template-compiler', 'ember-glimmer'], function (exports, _emberMetal, _emberViews, _emberApplication, _emberTemplateCompiler, _emberGlimmer) { + 'use strict'; + + var App = undefined, + $fixture = undefined; + + function setupExample() { + // setup templates + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{outlet}}')); + _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('

    Index

    ')); + _emberGlimmer.setTemplate('posts', _emberTemplateCompiler.compile('

    Posts

    ')); + + App.Router.map(function () { + this.route('posts'); + }); + } + + function handleURL(path) { + var router = App.__container__.lookup('router:main'); + return _emberMetal.run(router, 'handleURL', path); + } + + QUnit.module('View Instrumentation', { + setup: function () { + _emberMetal.run(function () { + App = _emberApplication.Application.create({ + rootElement: '#qunit-fixture' + }); + App.deferReadiness(); + + App.Router.reopen({ + location: 'none' + }); + }); + + $fixture = _emberViews.jQuery('#qunit-fixture'); + setupExample(); + }, + + teardown: function () { + _emberMetal.instrumentationReset(); + _emberMetal.run(App, 'destroy'); + App = null; + _emberGlimmer.setTemplates({}); + } + }); + + QUnit.test('Nodes without view instances are instrumented', function (assert) { + var called = false; + _emberMetal.instrumentationSubscribe('render', { + before: function () { + called = true; + }, + after: function () {} + }); + _emberMetal.run(App, 'advanceReadiness'); + assert.equal($fixture.text(), 'Index', 'It rendered the right template'); + assert.ok(called, 'Instrumentation called on first render'); + called = false; + handleURL('/posts'); + assert.equal($fixture.text(), 'Posts', 'It rendered the right template'); + assert.ok(called, 'instrumentation called on transition to non-view backed route'); + }); +}); +enifed('ember/tests/view_instrumentation_test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - ember/tests'); + test('ember/tests/view_instrumentation_test.js should pass jscs', function () { + ok(true, 'ember/tests/view_instrumentation_test.js should pass jscs.'); + }); +}); +enifed('ember/tests/view_instrumentation_test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - ember/tests'); + QUnit.test('ember/tests/view_instrumentation_test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/view_instrumentation_test.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/apply-mixins.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers'); + test('internal-test-helpers/apply-mixins.js should pass jscs', function () { + ok(true, 'internal-test-helpers/apply-mixins.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/apply-mixins.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers'); + QUnit.test('internal-test-helpers/apply-mixins.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/apply-mixins.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/build-owner.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers'); + test('internal-test-helpers/build-owner.js should pass jscs', function () { + ok(true, 'internal-test-helpers/build-owner.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/build-owner.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers'); + QUnit.test('internal-test-helpers/build-owner.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/build-owner.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/confirm-export.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers'); + test('internal-test-helpers/confirm-export.js should pass jscs', function () { + ok(true, 'internal-test-helpers/confirm-export.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/confirm-export.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers'); + QUnit.test('internal-test-helpers/confirm-export.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/confirm-export.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/equal-inner-html.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers'); + test('internal-test-helpers/equal-inner-html.js should pass jscs', function () { + ok(true, 'internal-test-helpers/equal-inner-html.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/equal-inner-html.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers'); + QUnit.test('internal-test-helpers/equal-inner-html.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/equal-inner-html.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/equal-tokens.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers'); + test('internal-test-helpers/equal-tokens.js should pass jscs', function () { + ok(true, 'internal-test-helpers/equal-tokens.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/equal-tokens.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers'); + QUnit.test('internal-test-helpers/equal-tokens.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/equal-tokens.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/factory.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers'); + test('internal-test-helpers/factory.js should pass jscs', function () { + ok(true, 'internal-test-helpers/factory.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/factory.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers'); + QUnit.test('internal-test-helpers/factory.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/factory.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/index.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers'); + test('internal-test-helpers/index.js should pass jscs', function () { + ok(true, 'internal-test-helpers/index.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/index.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers'); + QUnit.test('internal-test-helpers/index.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/index.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/matchers.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers'); + test('internal-test-helpers/matchers.js should pass jscs', function () { + ok(true, 'internal-test-helpers/matchers.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/matchers.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers'); + QUnit.test('internal-test-helpers/matchers.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/matchers.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/module-for.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers'); + test('internal-test-helpers/module-for.js should pass jscs', function () { + ok(true, 'internal-test-helpers/module-for.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/module-for.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers'); + QUnit.test('internal-test-helpers/module-for.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/module-for.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/run.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers'); + test('internal-test-helpers/run.js should pass jscs', function () { + ok(true, 'internal-test-helpers/run.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/run.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers'); + QUnit.test('internal-test-helpers/run.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/run.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/strip.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers'); + test('internal-test-helpers/strip.js should pass jscs', function () { + ok(true, 'internal-test-helpers/strip.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/strip.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers'); + QUnit.test('internal-test-helpers/strip.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/strip.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/test-cases/abstract-application.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers/test-cases'); + test('internal-test-helpers/test-cases/abstract-application.js should pass jscs', function () { + ok(true, 'internal-test-helpers/test-cases/abstract-application.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/test-cases/abstract-application.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers/test-cases'); + QUnit.test('internal-test-helpers/test-cases/abstract-application.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/test-cases/abstract-application.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/test-cases/abstract-rendering.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers/test-cases'); + test('internal-test-helpers/test-cases/abstract-rendering.js should pass jscs', function () { + ok(true, 'internal-test-helpers/test-cases/abstract-rendering.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/test-cases/abstract-rendering.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers/test-cases'); + QUnit.test('internal-test-helpers/test-cases/abstract-rendering.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/test-cases/abstract-rendering.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/test-cases/abstract.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers/test-cases'); + test('internal-test-helpers/test-cases/abstract.js should pass jscs', function () { + ok(true, 'internal-test-helpers/test-cases/abstract.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/test-cases/abstract.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers/test-cases'); + QUnit.test('internal-test-helpers/test-cases/abstract.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/test-cases/abstract.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/test-cases/application.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers/test-cases'); + test('internal-test-helpers/test-cases/application.js should pass jscs', function () { + ok(true, 'internal-test-helpers/test-cases/application.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/test-cases/application.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers/test-cases'); + QUnit.test('internal-test-helpers/test-cases/application.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/test-cases/application.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/test-cases/query-param.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers/test-cases'); + test('internal-test-helpers/test-cases/query-param.js should pass jscs', function () { + ok(true, 'internal-test-helpers/test-cases/query-param.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/test-cases/query-param.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers/test-cases'); + QUnit.test('internal-test-helpers/test-cases/query-param.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/test-cases/query-param.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/test-cases/rendering.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers/test-cases'); + test('internal-test-helpers/test-cases/rendering.js should pass jscs', function () { + ok(true, 'internal-test-helpers/test-cases/rendering.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/test-cases/rendering.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers/test-cases'); + QUnit.test('internal-test-helpers/test-cases/rendering.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/test-cases/rendering.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/test-groups.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers'); + test('internal-test-helpers/test-groups.js should pass jscs', function () { + ok(true, 'internal-test-helpers/test-groups.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/test-groups.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers'); + QUnit.test('internal-test-helpers/test-groups.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/test-groups.js should pass jshint.'); + }); +}); +enifed('internal-test-helpers/tests/index-test', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('internal-test-helpers'); + + QUnit.test('module present', function (assert) { + assert.ok(true, 'each package needs at least one test to be able to run through `npm test`'); + }); +}); +enifed('internal-test-helpers/tests/index-test.jscs-test', ['exports'], function (exports) { + 'use strict'; + + module('JSCS - internal-test-helpers/tests'); + test('internal-test-helpers/tests/index-test.js should pass jscs', function () { + ok(true, 'internal-test-helpers/tests/index-test.js should pass jscs.'); + }); +}); +enifed('internal-test-helpers/tests/index-test.jshint', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('JSHint - internal-test-helpers/tests'); + QUnit.test('internal-test-helpers/tests/index-test.js should pass jshint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/tests/index-test.js should pass jshint.'); + }); +}); +}()); diff --git a/ember.debug.js b/ember.debug.js index 066dd3dbd..d007629de 100644 --- a/ember.debug.js +++ b/ember.debug.js @@ -6,10 +6,11 @@ * 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.11.0-beta.2 + * @version 2.10.2-with-backtracking */ var enifed, requireModule, Ember; +var mainContext = this; (function() { var isNode = typeof window === 'undefined' && @@ -111,6 +112,8 @@ var enifed, requireModule, Ember; } })(); +var babelHelpers; + function classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); @@ -1469,7 +1472,7 @@ enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'e var factoryInjections = factoryInjectionsFor(container, fullName); var cacheable = !areInjectionsDynamic(injections) && !areInjectionsDynamic(factoryInjections); - factoryInjections[_emberUtils.NAME_KEY] = registry.makeToString(factory, fullName); + factoryInjections._toString = registry.makeToString(factory, fullName); var injectedFactory = factory.extend(injections); @@ -2481,11 +2484,10 @@ enifed('container/registry', ['exports', 'ember-utils', 'ember-metal', 'containe enifed('dag-map', ['exports'], function (exports) { 'use strict'; /** - * A map of key/value pairs with dependencies contraints that can be traversed - * in topological order and is checked for cycles. + * A topologically ordered map of key/value pairs with a simple API for adding constraints. * - * @class DAG - * @constructor + * Edges can forward reference keys that have not been added yet (the forward reference will + * map the key to undefined). */ var DAG = (function () { function DAG() { @@ -2495,15 +2497,16 @@ var DAG = (function () { * Adds a key/value pair with dependencies on other key/value pairs. * * @public - * @method addEdges - * @param {string[]} key The key of the vertex to be added. - * @param {any} value The value of that vertex. - * @param {string[]|string|undefined} before A key or array of keys of the vertices that must - * be visited before this vertex. - * @param {string[]|string|undefined} after An string or array of strings with the keys of the - * vertices that must be after this vertex is visited. + * @param key The key of the vertex to be added. + * @param value The value of that vertex. + * @param before A key or array of keys of the vertices that must + * be visited before this vertex. + * @param after An string or array of strings with the keys of the + * vertices that must be after this vertex is visited. */ DAG.prototype.add = function (key, value, before, after) { + if (!key) + throw new Error('argument `key` is required'); var vertices = this._vertices; var v = vertices.add(key); v.val = value; @@ -2528,83 +2531,88 @@ var DAG = (function () { } } }; + /** + * @deprecated please use add. + */ + DAG.prototype.addEdges = function (key, value, before, after) { + this.add(key, value, before, after); + }; /** * Visits key/value pairs in topological order. * * @public - * @method topsort - * @param {Function} fn The function to be invoked with each key/value. + * @param callback The function to be invoked with each key/value. + */ + DAG.prototype.each = function (callback) { + this._vertices.walk(callback); + }; + /** + * @deprecated please use each. */ DAG.prototype.topsort = function (callback) { - this._vertices.topsort(callback); + this.each(callback); }; return DAG; }()); +/** @private */ var Vertices = (function () { function Vertices() { + this.length = 0; this.stack = new IntStack(); + this.path = new IntStack(); this.result = new IntStack(); - this.vertices = []; } Vertices.prototype.add = function (key) { if (!key) throw new Error("missing key"); - var vertices = this.vertices; - var i = 0; + var l = this.length | 0; var vertex; - for (; i < vertices.length; i++) { - vertex = vertices[i]; + for (var i = 0; i < l; i++) { + vertex = this[i]; if (vertex.key === key) return vertex; } - return vertices[i] = { - id: i, + this.length = l + 1; + return this[l] = { + idx: l, key: key, - val: null, - inc: null, + val: undefined, out: false, - mark: false + flag: false, + length: 0 }; }; Vertices.prototype.addEdge = function (v, w) { this.check(v, w.key); - var inc = w.inc; - if (!inc) { - w.inc = [v.id]; - } - else { - var i = 0; - for (; i < inc.length; i++) { - if (inc[i] === v.id) - return; - } - inc[i] = v.id; + var l = w.length | 0; + for (var i = 0; i < l; i++) { + if (w[i] === v.idx) + return; } + w.length = l + 1; + w[l] = v.idx; v.out = true; }; - Vertices.prototype.topsort = function (cb) { + Vertices.prototype.walk = function (cb) { this.reset(); - var vertices = this.vertices; - for (var i = 0; i < vertices.length; i++) { - var vertex = vertices[i]; + for (var i = 0; i < this.length; i++) { + var vertex = this[i]; if (vertex.out) continue; - this.visit(vertex, undefined); + this.visit(vertex, ""); } - this.each(cb); + this.each(this.result, cb); }; Vertices.prototype.check = function (v, w) { if (v.key === w) { throw new Error("cycle detected: " + w + " <- " + w); } - var inc = v.inc; // quick check - if (!inc || inc.length === 0) + if (v.length === 0) return; - var vertices = this.vertices; // shallow check - for (var i = 0; i < inc.length; i++) { - var key = vertices[inc[i]].key; + for (var i = 0; i < v.length; i++) { + var key = this[v[i]].key; if (key === w) { throw new Error("cycle detected: " + w + " <- " + v.key + " <- " + w); } @@ -2612,82 +2620,74 @@ var Vertices = (function () { // deep check this.reset(); this.visit(v, w); - if (this.result.len > 0) { + if (this.path.length > 0) { var msg_1 = "cycle detected: " + w; - this.each(function (key) { + this.each(this.path, function (key) { msg_1 += " <- " + key; }); throw new Error(msg_1); } }; - Vertices.prototype.each = function (cb) { - var _a = this, result = _a.result, vertices = _a.vertices; - for (var i = 0; i < result.len; i++) { - var vertex = vertices[result.stack[i]]; - cb(vertex.key, vertex.val); - } - }; - // reuse between cycle check and topsort Vertices.prototype.reset = function () { - this.stack.len = 0; - this.result.len = 0; - var vertices = this.vertices; - for (var i = 0; i < vertices.length; i++) { - vertices[i].mark = false; + this.stack.length = 0; + this.path.length = 0; + this.result.length = 0; + for (var i = 0, l = this.length; i < l; i++) { + this[i].flag = false; } }; Vertices.prototype.visit = function (start, search) { - var _a = this, stack = _a.stack, result = _a.result, vertices = _a.vertices; - stack.push(start.id); - while (stack.len) { - var index = stack.pop(); - if (index < 0) { - index = ~index; - if (search) { - result.pop(); - } - else { - result.push(index); - } - } - else { - var vertex = vertices[index]; - if (vertex.mark) { + var _a = this, stack = _a.stack, path = _a.path, result = _a.result; + stack.push(start.idx); + while (stack.length) { + var index = stack.pop() | 0; + if (index >= 0) { + // enter + var vertex = this[index]; + if (vertex.flag) continue; - } - if (search) { - result.push(index); - if (search === vertex.key) { - return; - } - } - vertex.mark = true; + vertex.flag = true; + path.push(index); + if (search === vertex.key) + break; + // push exit stack.push(~index); - var incoming = vertex.inc; - if (incoming) { - var i = incoming.length; - while (i--) { - index = incoming[i]; - if (!vertices[index].mark) { - stack.push(index); - } - } - } + this.pushIncoming(vertex); + } + else { + // exit + path.pop(); + result.push(~index); + } + } + }; + Vertices.prototype.pushIncoming = function (incomming) { + var stack = this.stack; + for (var i = incomming.length - 1; i >= 0; i--) { + var index = incomming[i]; + if (!this[index].flag) { + stack.push(index); } } }; + Vertices.prototype.each = function (indices, cb) { + for (var i = 0, l = indices.length; i < l; i++) { + var vertex = this[indices[i]]; + cb(vertex.key, vertex.val); + } + }; return Vertices; }()); +/** @private */ var IntStack = (function () { function IntStack() { - this.stack = [0, 0, 0, 0, 0, 0]; - this.len = 0; + this.length = 0; } IntStack.prototype.push = function (n) { - this.stack[this.len++] = n; + this[this.length++] = n | 0; }; IntStack.prototype.pop = function () { - return this.stack[--this.len]; + return this[--this.length] | 0; }; return IntStack; }()); @@ -3233,10 +3233,22 @@ enifed('ember-application/system/application', ['exports', 'ember-utils', 'ember */ 'use strict'; + exports._resetLegacyAddonWarnings = _resetLegacyAddonWarnings; + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); var librariesRegistered = false; + var warnedAboutLegacyViewAddon = false; + var warnedAboutLegacyControllerAddon = false; + + // For testing + + function _resetLegacyAddonWarnings() { + warnedAboutLegacyViewAddon = false; + warnedAboutLegacyControllerAddon = false; + } + /** An instance of `Ember.Application` is the starting point for every Ember application. It helps to instantiate, initialize and coordinate the many @@ -5594,6 +5606,7 @@ enifed('ember-debug/deprecate', ['exports', 'ember-metal', 'ember-console', 'emb emberjs.com website. @for Ember @public + @since 1.0.0 */ function deprecate(message, test, options) { @@ -5692,6 +5705,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'emb @param {Boolean} test Must be truthy for the assertion to pass. If falsy, an exception will be thrown. @public + @since 1.0.0 */ _emberMetal.setDebugFunction('assert', function assert(desc, test) { if (!test) { @@ -6014,6 +6028,7 @@ enifed('ember-debug/warn', ['exports', 'ember-console', 'ember-metal', 'ember-de The `id` should be namespaced by dots, e.g. "ember-debug.feature-flag-with-features-stripped" @for Ember @public + @since 1.0.0 */ function warn(message, test, options) { @@ -7144,7 +7159,7 @@ enifed('ember-glimmer/component', ['exports', 'ember-utils', 'ember-views', 'emb @default null @public */ - Component[_emberUtils.NAME_KEY] = 'Ember.Component'; + Component[_emberMetal.NAME_KEY] = 'Ember.Component'; Component.reopenClass({ isComponentFactory: true, @@ -9079,14 +9094,13 @@ enifed('ember-glimmer/helpers/-normalize-class', ['exports', 'ember-glimmer/util return new _emberGlimmerUtilsReferences.InternalHelperReference(normalizeClass, args); }; }); -enifed('ember-glimmer/helpers/action', ['exports', 'ember-utils', 'ember-glimmer/utils/references', 'ember-metal'], function (exports, _emberUtils, _emberGlimmerUtilsReferences, _emberMetal) { +enifed('ember-glimmer/helpers/action', ['exports', 'ember-utils', 'ember-metal', 'ember-glimmer/utils/references', 'glimmer-runtime', 'glimmer-reference'], function (exports, _emberUtils, _emberMetal, _emberGlimmerUtilsReferences, _glimmerRuntime, _glimmerReference) { /** @module ember @submodule ember-glimmer */ 'use strict'; - exports.createClosureAction = createClosureAction; var INVOKE = _emberUtils.symbol('INVOKE'); exports.INVOKE = INVOKE; var ACTION = _emberUtils.symbol('ACTION'); @@ -9339,140 +9353,128 @@ enifed('ember-glimmer/helpers/action', ['exports', 'ember-utils', 'ember-glimmer @public */ - var ClosureActionReference = (function (_CachedReference) { - babelHelpers.inherits(ClosureActionReference, _CachedReference); + exports.default = function (vm, args) { + var named = args.named; + var positional = args.positional; - ClosureActionReference.create = function create(args) { - // TODO: Const reference optimization. - return new ClosureActionReference(args); - }; + // The first two argument slots are reserved. + // pos[0] is the context (or `this`) + // pos[1] is the action name or function + // Anything else is an action argument. + var context = positional.at(0); + var action = positional.at(1); - function ClosureActionReference(args) { - babelHelpers.classCallCheck(this, ClosureActionReference); + // TODO: Is there a better way of doing this? + var debugKey = action._propertyKey; - _CachedReference.call(this); + var restArgs = undefined; - this.args = args; - this.tag = args.tag; + if (positional.length === 2) { + restArgs = _glimmerRuntime.EvaluatedPositionalArgs.empty(); + } else { + restArgs = _glimmerRuntime.EvaluatedPositionalArgs.create(positional.values.slice(2)); } - ClosureActionReference.prototype.compute = function compute() { - var _args = this.args; - var named = _args.named; - var positional = _args.positional; + var target = named.has('target') ? named.get('target') : context; + var processArgs = makeArgsProcessor(named.has('value') && named.get('value'), restArgs); - var positionalValues = positional.value(); + var fn = undefined; - var target = positionalValues[0]; - var rawActionRef = positional.at(1); - var rawAction = positionalValues[1]; - - // The first two argument slots are reserved. - // pos[0] is the context (or `this`) - // pos[1] is the action name or function - // Anything else is an action argument. - var actionArgs = positionalValues.slice(2); - - // on-change={{action setName}} - // element-space actions look to "controller" then target. Here we only - // look to "target". - var actionType = typeof rawAction; - var action = rawAction; - - if (rawActionRef[INVOKE]) { - target = rawActionRef; - action = rawActionRef[INVOKE]; - } else if (_emberMetal.isNone(rawAction)) { - throw new _emberMetal.Error('Action passed is null or undefined in (action) from ' + target + '.'); - } else if (actionType === 'string') { - // on-change={{action 'setName'}} - var actionName = rawAction; - - action = null; + if (typeof action[INVOKE] === 'function') { + fn = makeClosureAction(action, action, action[INVOKE], processArgs, debugKey); + } else if (_glimmerReference.isConst(target) && _glimmerReference.isConst(action)) { + fn = makeClosureAction(context.value(), target.value(), action.value(), processArgs, debugKey); + } else { + fn = makeDynamicClosureAction(context.value(), target, action, processArgs, debugKey); + } - if (named.has('target')) { - // on-change={{action 'setName' target=alternativeComponent}} - target = named.get('target').value(); - } + fn[ACTION] = true; - if (target['actions']) { - action = target.actions[actionName]; - } + return new _emberGlimmerUtilsReferences.UnboundReference(fn); + }; - if (!action) { - throw new _emberMetal.Error('An action named \'' + actionName + '\' was not found in ' + target); - } - } else if (action && typeof action[INVOKE] === 'function') { - target = action; - action = action[INVOKE]; - } else if (actionType !== 'function') { - // TODO: Is there a better way of doing this? - var rawActionLabel = rawActionRef._propertyKey || rawAction; - throw new _emberMetal.Error('An action could not be made for `' + rawActionLabel + '` in ' + target + '. Please confirm that you are using either a quoted action name (i.e. `(action \'' + rawActionLabel + '\')`) or a function available in ' + target + '.'); - } + function NOOP(args) { + return args; + } - var valuePath = named.get('value').value(); + function makeArgsProcessor(valuePathRef, actionArgsRef) { + var mergeArgs = null; - return createClosureAction(target, action, valuePath, actionArgs); - }; + if (actionArgsRef.length > 0) { + mergeArgs = function (args) { + return actionArgsRef.value().concat(args); + }; + } - return ClosureActionReference; - })(_emberGlimmerUtilsReferences.CachedReference); + var readValue = null; - exports.ClosureActionReference = ClosureActionReference; + if (valuePathRef) { + readValue = function (args) { + var valuePath = valuePathRef.value(); - exports.default = function (vm, args) { - return ClosureActionReference.create(args); - }; + if (valuePath && args.length > 0) { + args[0] = _emberMetal.get(args[0], valuePath); + } - function createClosureAction(target, action, valuePath, actionArgs) { - var closureAction = undefined; - var actionArgLength = actionArgs.length; + return args; + }; + } - if (actionArgLength > 0) { - closureAction = function () { - for (var _len = arguments.length, passedArguments = Array(_len), _key = 0; _key < _len; _key++) { - passedArguments[_key] = arguments[_key]; - } + if (mergeArgs && readValue) { + return function (args) { + return readValue(mergeArgs(args)); + }; + } else { + return mergeArgs || readValue || NOOP; + } + } - var args = new Array(actionArgLength + passedArguments.length); + function makeDynamicClosureAction(context, targetRef, actionRef, processArgs, debugKey) { + // We don't allow undefined/null values, so this creates a throw-away action to trigger the assertions + _emberMetal.runInDebug(function () { + makeClosureAction(context, targetRef.value(), actionRef.value(), processArgs, debugKey); + }); - for (var i = 0; i < actionArgLength; i++) { - args[i] = actionArgs[i]; - } + return function () { + return makeClosureAction(context, targetRef.value(), actionRef.value(), processArgs, debugKey).apply(undefined, arguments); + }; + } - for (var i = 0; i < passedArguments.length; i++) { - args[i + actionArgLength] = passedArguments[i]; - } + function makeClosureAction(context, target, action, processArgs, debugKey) { + var self = undefined, + fn = undefined; - if (valuePath && args.length > 0) { - args[0] = _emberMetal.get(args[0], valuePath); - } + _emberMetal.assert('Action passed is null or undefined in (action) from ' + target + '.', !_emberMetal.isNone(action)); - var payload = { target: target, args: args, label: 'glimmer-closure-action' }; - return _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { - return _emberMetal.run.join.apply(_emberMetal.run, [target, action].concat(args)); - }); - }; + if (typeof action[INVOKE] === 'function') { + self = action; + fn = action[INVOKE]; } else { - closureAction = function () { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } + var typeofAction = typeof action; - if (valuePath && args.length > 0) { - args[0] = _emberMetal.get(args[0], valuePath); - } + if (typeofAction === 'string') { + self = target; + fn = target.actions && target.actions[action]; - var payload = { target: target, args: args, label: 'glimmer-closure-action' }; - return _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { - return _emberMetal.run.join.apply(_emberMetal.run, [target, action].concat(args)); - }); - }; + _emberMetal.assert('An action named \'' + action + '\' was not found in ' + target, fn); + } else if (typeofAction === 'function') { + self = context; + fn = action; + } else { + _emberMetal.assert('An action could not be made for `' + (debugKey || action) + '` in ' + target + '. Please confirm that you are using either a quoted action name (i.e. `(action \'' + (debugKey || 'myAction') + '\')`) or a function available in ' + target + '.', false); + } } - closureAction[ACTION] = true; - return closureAction; + return function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var payload = { target: self, args: args, label: 'glimmer-closure-action' }; + return _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { + return _emberMetal.run.join.apply(_emberMetal.run, [self, fn].concat(processArgs(args))); + }); + }; } }); enifed('ember-glimmer/helpers/component', ['exports', 'ember-utils', 'ember-glimmer/utils/references', 'ember-glimmer/syntax/curly-component', 'glimmer-runtime', 'ember-metal'], function (exports, _emberUtils, _emberGlimmerUtilsReferences, _emberGlimmerSyntaxCurlyComponent, _glimmerRuntime, _emberMetal) { @@ -9488,19 +9490,17 @@ enifed('ember-glimmer/helpers/component', ['exports', 'ember-utils', 'ember-glim additional information on how a `Component` functions. `{{component}}`'s primary use is for cases where you want to dynamically change which type of component is rendered as the state of your application - changes. This helper has three modes: inline, block, and nested. - - ### Inline Form + changes. The provided block will be applied as the template for the component. + Given an empty `` the following template: - Given the following template: - - ```app/application.hbs + ```handlebars + {{! application.hbs }} {{component infographicComponentName}} ``` And the following application code: - ```app/controllers/application.js + ```javascript export default Ember.Controller.extend({ infographicComponentName: computed('isMarketOpen', { get() { @@ -9521,87 +9521,33 @@ enifed('ember-glimmer/helpers/component', ['exports', 'ember-utils', 'ember-glim Note: You should not use this helper when you are consistently rendering the same component. In that case, use standard component syntax, for example: - ```app/templates/application.hbs + ```handlebars + {{! application.hbs }} {{live-updating-chart}} ``` - ### Block Form - - Using the block form of this helper is similar to using the block form - of a component. Given the following application template: - - ```app/templates/application.hbs - {{#component infographicComponentName}} - Last update: {{lastUpdateTimestamp}} - {{/component}} - ``` - - The following controller code: - - ```app/controllers/application.js - export default Ember.Controller.extend({ - lastUpdateTimestamp: computed(function() { - return new Date(); - }), - - infographicComponentName: computed('isMarketOpen', { - get() { - if (this.get('isMarketOpen')) { - return 'live-updating-chart'; - } else { - return 'market-close-summary'; - } - } - }) - }); - ``` - - And the following component template: - - ```app/templates/components/live-updating-chart.hbs - {{! chart }} - {{yield}} - ``` - - The `Last Update: {{lastUpdateTimestamp}}` will be rendered in place of the `{{yield}}`. - - ### Nested Usage + ## Nested Usage The `component` helper can be used to package a component path with initial attrs. The included attrs can then be merged during the final invocation. For example, given a `person-form` component with the following template: - ```app/templates/components/person-form.hbs + ```handlebars {{yield (hash - nameInput=(component "my-input-component" value=model.name placeholder="First Name") - )}} + nameInput=(component "my-input-component" value=model.name placeholder="First Name"))}} ``` - When yielding the component via the `hash` helper, the component is invocked directly. - See the following snippet: + The following snippet: ``` {{#person-form as |form|}} - {{form.nameInput placeholder="Username"}} + {{component form.nameInput placeholder="Username"}} {{/person-form}} ``` - Which outputs an input whose value is already bound to `model.name` and `placeholder` + would output an input whose value is already bound to `model.name` and `placeholder` is "Username". - When yielding the component without the hash helper use the `component` helper. - For example, below is a `full-name` component template: - - ```handlebars - {{yield (component "my-input-component" value=model.name placeholder="Name")}} - ``` - - ``` - {{#full-name as |field|}} - {{component field placeholder="Full name"}} - {{/full-name}} - ``` - @method component @since 1.11.0 @for Ember.Templates.helpers @@ -10027,8 +9973,8 @@ enifed('ember-glimmer/helpers/get', ['exports', 'ember-metal', 'ember-glimmer/ut ```handlebars {{get person factName}} - - + + ``` The `{{get}}` helper can also respect mutable values itself. For example: @@ -10443,9 +10389,6 @@ enifed('ember-glimmer/helpers/mut', ['exports', 'ember-utils', 'ember-metal', 'e }); ``` - Note that for curly components (`{{my-component}}`) the bindings are already mutable, - making the `mut` unnecessary. - Additionally, the `mut` helper can be combined with the `action` helper to mutate a value. For example: @@ -10459,7 +10402,7 @@ enifed('ember-glimmer/helpers/mut', ['exports', 'ember-utils', 'ember-metal', 'e // my-child.js export default Component.extend({ click() { - this.get('click-count-change')(this.get('childClickCount') + 1); + this.get('clickCountChange')(this.get('childClickCount') + 1); } }); ``` @@ -11327,7 +11270,7 @@ enifed('ember-glimmer/renderer', ['exports', 'ember-glimmer/utils/references', ' var runInTransaction = undefined; - if (true || false) { + if (true || true) { runInTransaction = _emberMetal.runInTransaction; } else { runInTransaction = function (context, methodName) { @@ -14258,7 +14201,7 @@ enifed('ember-glimmer/utils/references', ['exports', 'ember-utils', 'ember-metal var TwoWayFlushDetectionTag = undefined; - if (true || false) { + if (true || true) { TwoWayFlushDetectionTag = (function () { function _class(tag, key, ref) { babelHelpers.classCallCheck(this, _class); @@ -14332,7 +14275,7 @@ enifed('ember-glimmer/utils/references', ['exports', 'ember-utils', 'ember-metal this._parentValue = parentValue; this._propertyKey = propertyKey; - if (true || false) { + if (true || true) { this.tag = new TwoWayFlushDetectionTag(_emberMetal.tagForProperty(parentValue, propertyKey), propertyKey, this); } else { this.tag = _emberMetal.tagForProperty(parentValue, propertyKey); @@ -14347,7 +14290,7 @@ enifed('ember-glimmer/utils/references', ['exports', 'ember-utils', 'ember-metal var _parentValue = this._parentValue; var _propertyKey = this._propertyKey; - if (true || false) { + if (true || true) { this.tag.didCompute(_parentValue); } @@ -14378,7 +14321,7 @@ enifed('ember-glimmer/utils/references', ['exports', 'ember-utils', 'ember-metal this._parentObjectTag = parentObjectTag; this._propertyKey = propertyKey; - if (true || false) { + if (true || true) { var tag = _glimmerReference.combine([parentReferenceTag, parentObjectTag]); this.tag = new TwoWayFlushDetectionTag(tag, propertyKey, this); } else { @@ -14404,7 +14347,7 @@ enifed('ember-glimmer/utils/references', ['exports', 'ember-utils', 'ember-metal _emberMetal.watchKey(parentValue, _propertyKey); } - if (true || false) { + if (true || true) { this.tag.didCompute(parentValue); } @@ -15030,6 +14973,8 @@ enifed('ember-metal/alias', ['exports', 'ember-utils', 'ember-metal/debug', 'emb exports.default = alias; exports.AliasedProperty = AliasedProperty; + var CONSUMED = {}; + function alias(altKey) { return new AliasedProperty(altKey); } @@ -15050,28 +14995,30 @@ enifed('ember-metal/alias', ['exports', 'ember-utils', 'ember-metal/debug', 'emb } }; - AliasedProperty.prototype._addDependentKeyIfMissing = function (obj, keyName) { + AliasedProperty.prototype.teardown = function (obj, keyName) { var meta = _emberMetalMeta.meta(obj); - if (!meta.peekDeps(this.altKey, keyName)) { - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); + if (meta.peekWatching(keyName)) { + _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); } }; - AliasedProperty.prototype._removeDependentKeyIfAdded = function (obj, keyName) { - var meta = _emberMetalMeta.meta(obj); - if (meta.peekDeps(this.altKey, keyName)) { - _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); - } + AliasedProperty.prototype.willWatch = function (obj, keyName) { + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); }; - AliasedProperty.prototype.willWatch = AliasedProperty.prototype._addDependentKeyIfMissing; - AliasedProperty.prototype.didUnwatch = AliasedProperty.prototype._removeDependentKeyIfAdded; - AliasedProperty.prototype.teardown = AliasedProperty.prototype._removeDependentKeyIfAdded; + AliasedProperty.prototype.didUnwatch = function (obj, keyName) { + _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); + }; AliasedProperty.prototype.get = function AliasedProperty_get(obj, keyName) { - this._addDependentKeyIfMissing(obj, keyName); - - return _emberMetalProperty_get.get(obj, this.altKey); + var ret = _emberMetalProperty_get.get(obj, this.altKey); + var meta = _emberMetalMeta.meta(obj); + var cache = meta.writableCache(); + if (cache[keyName] !== CONSUMED) { + cache[keyName] = CONSUMED; + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); + } + return ret; }; AliasedProperty.prototype.set = function AliasedProperty_set(obj, keyName, value) { @@ -17588,6 +17535,7 @@ enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-me exports.removeObserver = _emberMetalObserver.removeObserver; exports._addBeforeObserver = _emberMetalObserver._addBeforeObserver; exports._removeBeforeObserver = _emberMetalObserver._removeBeforeObserver; + exports.NAME_KEY = _emberMetalMixin.NAME_KEY; exports.Mixin = _emberMetalMixin.Mixin; exports.aliasMethod = _emberMetalMixin.aliasMethod; exports._immediateObserver = _emberMetalMixin._immediateObserver; @@ -18788,7 +18736,7 @@ enifed('ember-metal/meta', ['exports', 'ember-utils', 'ember-metal/features', 'e var META_DESTROYED = 1 << 3; var IS_PROXY = 1 << 4; - if (true || false) { + if (true || true) { members.lastRendered = ownMap; members.lastRenderedFrom = ownMap; // FIXME: not used in production, remove me from prod builds } @@ -18830,7 +18778,7 @@ enifed('ember-metal/meta', ['exports', 'ember-utils', 'ember-metal/features', 'e // inherited, and we can optimize it much better than JS runtimes. this.parent = parentMeta; - if (true || false) { + if (true || true) { this._lastRendered = undefined; this._lastRenderedFrom = undefined; // FIXME: not used in production, remove me from prod builds } @@ -19626,32 +19574,20 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb function applyConcatenatedProperties(obj, key, value, values) { var baseValue = values[key] || obj[key]; - var ret = undefined; if (baseValue) { if ('function' === typeof baseValue.concat) { if (value === null || value === undefined) { - ret = baseValue; + return baseValue; } else { - ret = baseValue.concat(value); + return baseValue.concat(value); } } else { - ret = _emberUtils.makeArray(baseValue).concat(value); + return _emberUtils.makeArray(baseValue).concat(value); } } else { - ret = _emberUtils.makeArray(value); + return _emberUtils.makeArray(value); } - - _emberMetalDebug.runInDebug(function () { - // it is possible to use concatenatedProperties with strings (which cannot be frozen) - // only freeze objects... - if (typeof ret === 'object' && ret !== null) { - // prevent mutating `concatenatedProperties` array after it is applied - Object.freeze(ret); - } - }); - - return ret; } function applyMergedProperties(obj, key, value, values) { @@ -19927,6 +19863,9 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb return obj; } + var NAME_KEY = _emberUtils.GUID_KEY + '_name'; + + exports.NAME_KEY = NAME_KEY; /** The `Ember.Mixin` class allows you to create mixins, whose properties can be added to other classes. For instance, @@ -20009,7 +19948,7 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb this.ownerConstructor = undefined; this._without = undefined; this[_emberUtils.GUID_KEY] = null; - this[_emberUtils.NAME_KEY] = null; + this[NAME_KEY] = null; _emberMetalDebug.debugSeal(this); } @@ -21002,7 +20941,7 @@ enifed('ember-metal/property_events', ['exports', 'ember-utils', 'ember-metal/me _emberMetalTags.markObjectAsDirty(meta, keyName); - if (true || false) { + if (true || true) { _emberMetalTransaction.assertNotRendered(obj, keyName, meta); } } @@ -22331,20 +22270,20 @@ enifed('ember-metal/transaction', ['exports', 'ember-metal/meta', 'ember-metal/d assertNotRendered = undefined; var raise = _emberMetalDebug.assert; - if (false) { + if (true) { raise = function (message, test) { _emberMetalDebug.deprecate(message, test, { id: 'ember-views.render-double-modify', until: '3.0.0' }); }; } var implication = undefined; - if (false) { + if (true) { implication = 'will be removed in Ember 3.0.'; } else if (true) { implication = 'is no longer supported. See https://github.com/emberjs/ember.js/issues/13948 for more details.'; } - if (true || false) { + if (true || true) { (function () { var counter = 0; var inTransaction = false; @@ -22396,7 +22335,7 @@ enifed('ember-metal/transaction', ['exports', 'ember-metal/meta', 'ember-metal/d label = 'the same value'; } - return 'You modified ' + label + ' twice on ' + object + ' in a single render. This was unreliable and slow in Ember 1.x and ' + implication; + return 'You modified ' + parts.join('.') + ' twice on ' + object + ' in a single render. This was unreliable and slow in Ember 1.x and ' + implication; })(), false); shouldReflush = true; @@ -24690,8 +24629,9 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** The name of the route, dot-delimited. - For example, a route found at `app/routes/posts/post.js` will have - a `routeName` of `posts.post`. + 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 @@ -24907,23 +24847,18 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** Returns a hash containing the parameters of an ancestor route. Example - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('member', { path: ':name' }, function() { this.route('interest', { path: ':interest' }); }); }); - ``` - ```app/routes/member.js - export default Ember.Route.extend({ + App.MemberRoute = Ember.Route.extend({ queryParams: { memberQp: { refreshModel: true } } }); - ``` - ```app/routes/member/interest.js - export default Ember.Route.extend({ + App.MemberInterestRoute = Ember.Route.extend({ queryParams: { interestQp: { refreshModel: true } }, @@ -25016,10 +24951,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** A hook you can use to reset controller values either when the model changes or the route is exiting. - ```app/routes/articles.js - import Ember from 'ember'; - export default Ember.Route.extend({ - resetController(controller, isExiting, transition) { + ```javascript + App.ArticlesRoute = Ember.Route.extend({ + // ... + resetController: function(controller, isExiting, transition) { if (isExiting) { controller.set('page', 1); } @@ -25070,19 +25005,12 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** The name of the template to use by default when rendering this routes template. - ```app/routes/posts/list.js - import Ember from 'ember'; - export default Ember.Route.extend({ + ```javascript + let PostsList = Ember.Route.extend({ templateName: 'posts/list' }); - ``` - ```app/routes/posts/index.js - import PostsList from '../posts/list'; - export default PostsList.extend(); - ``` - ```app/routes/posts/archived.js - import PostsList from '../posts/list'; - export default PostsList.extend(); + App.PostsIndexRoute = PostsList.extend(); + App.PostsArchivedRoute = PostsList.extend(); ``` @property templateName @type String @@ -25117,11 +25045,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' or decorating the transition from the currently active routes. A good example is preventing navigation when a form is half-filled out: - ```app/routes/contact-form.js - import Ember from 'ember'; - export default Ember.Route.extend({ + ```javascript + App.ContactFormRoute = Ember.Route.extend({ actions: { - willTransition(transition) { + willTransition: function(transition) { if (this.controller.get('userHasEnteredData')) { this.controller.displayNavigationConfirm(); transition.abort(); @@ -25155,11 +25082,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' have resolved. The `didTransition` action has no arguments, however, it can be useful for tracking page views or resetting state on the controller. - ```app/routes/login.js - import Ember from 'ember'; - export default Ember.Route.extend({ + ```javascript + App.LoginRoute = Ember.Route.extend({ actions: { - didTransition() { + didTransition: function() { this.controller.get('errors.base').clear(); return true; // Bubble the didTransition event } @@ -25176,10 +25102,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' hook returns a promise that is not already resolved. The current `Transition` object is the first parameter and the route that triggered the loading event is the second parameter. - ```app/routes/application.js - export default Ember.Route.extend({ + ```javascript + App.ApplicationRoute = Ember.Route.extend({ actions: { - loading(transition, route) { + loading: function(transition, route) { let controller = this.controllerFor('foo'); controller.set('currentlyLoading', true); transition.finally(function() { @@ -25205,14 +25131,13 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' Here is an example of an error handler that will be invoked for rejected promises from the various hooks on the route, as well as any unhandled errors from child routes: - ```app/routes/admin.js - import Ember from 'ember'; - export default Ember.Route.extend({ - beforeModel() { + ```javascript + App.AdminRoute = Ember.Route.extend({ + beforeModel: function() { return Ember.RSVP.reject('bad things!'); }, actions: { - error(error, transition) { + error: function(error, transition) { // Assuming we got here due to the error in `beforeModel`, // we can expect that error === "bad things!", // but a promise model rejecting would also @@ -25230,11 +25155,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' will fire a default error handler that logs the error. You can specify your own global default error handler by overriding the `error` handler on `ApplicationRoute`: - ```app/routes/application.js - import Ember from 'ember'; - export default Ember.Route.extend({ + ```javascript + App.ApplicationRoute = Ember.Route.extend({ actions: { - error(error, transition) { + error: function(error, transition) { this.controllerFor('banner').displayError(error.message); } } @@ -25250,12 +25174,11 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** This event is triggered when the router enters the route. It is not executed when the model for the route changes. - ```app/routes/application.js - import Ember from 'ember'; - export default Ember.Route.extend({ - collectAnalytics: Ember.on('activate', function(){ + ```javascript + App.ApplicationRoute = Ember.Route.extend({ + collectAnalytics: function(){ collectAnalytics(); - }) + }.on('activate') }); ``` @event activate @@ -25266,12 +25189,11 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** This event is triggered when the router completely exits this route. It is not executed when the model for the route changes. - ```app/routes/index.js - import Ember from 'ember'; - export default Ember.Route.extend({ - trackPageLeaveAnalytics: Ember.on('deactivate', function(){ + ```javascript + App.IndexRoute = Ember.Route.extend({ + trackPageLeaveAnalytics: function(){ trackPageLeaveAnalytics(); - }) + }.on('deactivate') }); ``` @event deactivate @@ -25282,11 +25204,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** The controller associated with this route. Example - ```app/routes/form.js - import Ember from 'ember'; - export default Ember.Route.extend({ + ```javascript + App.FormRoute = Ember.Route.extend({ actions: { - willTransition(transition) { + willTransition: function(transition) { if (this.controller.get('userHasEnteredData') && !confirm('Are you sure you want to abandon progress?')) { transition.abort(); @@ -25458,17 +25379,13 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' ``` Multiple models will be applied last to first recursively up the route tree. - ```app/routes.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('blogPost', { path:':blogPostId' }, function() { - this.route('blogComment', { path: ':blogCommentId' }); + this.route('blogComment', { path: ':blogCommentId', resetNamespace: true }); }); }); - export default Router; - ``` - ```javascript - this.transitionTo('blogComment', aPost, aComment); + this.transitionTo('blogComment', aPost, aComment); this.transitionTo('blogComment', 1, 13); ``` It is also possible to pass a URL (a string that starts with a @@ -25490,20 +25407,15 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' ``` See also [replaceWith](#method_replaceWith). Simple Transition Example - ```app/routes.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('index'); this.route('secret'); this.route('fourOhFour', { path: '*:' }); }); - export default Router; - ``` - ```app/routes/index.js - import Ember from 'ember': - export Ember.Route.extend({ + App.IndexRoute = Ember.Route.extend({ actions: { - moveToSecret(context) { + moveToSecret: function(context) { if (authorized()) { this.transitionTo('secret', context); } else { @@ -25514,63 +25426,48 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' }); ``` Transition to a nested route - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('articles', { path: '/articles' }, function() { this.route('new'); }); }); - export default Router; - ``` - ```app/routes/index.js - import Ember from 'ember'; - export default Ember.Route.extend({ + App.IndexRoute = Ember.Route.extend({ actions: { - transitionToNewArticle() { + transitionToNewArticle: function() { this.transitionTo('articles.new'); } } }); ``` Multiple Models Example - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('index'); this.route('breakfast', { path: ':breakfastId' }, function() { - this.route('cereal', { path: ':cerealId' }); + this.route('cereal', { path: ':cerealId', resetNamespace: true }); }); }); - export default Router; - ``` - ```app/routes/index.js - import Ember from 'ember'; - export default Ember.Route.extend({ + App.IndexRoute = Ember.Route.extend({ actions: { - moveToChocolateCereal() { + moveToChocolateCereal: function() { let cereal = { cerealId: 'ChocolateYumminess' }; let breakfast = { breakfastId: 'CerealAndMilk' }; - this.transitionTo('breakfast.cereal', breakfast, cereal); + this.transitionTo('cereal', breakfast, cereal); } } }); ``` Nested Route with Query String Example - ```app/routes.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('fruits', function() { this.route('apples'); }); }); - export default Router; - ``` - ```app/routes/index.js - import Ember from 'ember'; - export default Ember.Route.extend({ + App.IndexRoute = Ember.Route.extend({ actions: { - transitionToApples() { + transitionToApples: function() { this.transitionTo('fruits.apples', { queryParams: { color: 'red' } }); } } @@ -25641,18 +25538,13 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' Beside that, it is identical to `transitionTo` in all other respects. See 'transitionTo' for additional information regarding multiple models. Example - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('index'); this.route('secret'); }); - export default Router; - ``` - ```app/routes/secret.js - import Ember from 'ember'; - export default Ember.Route.extend({ - afterModel() { + App.SecretRoute = Ember.Route.extend({ + afterModel: function() { if (!authorized()){ this.replaceWith('index'); } @@ -25677,28 +25569,20 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' Sends an action to the router, which will delegate it to the currently active route hierarchy per the bubbling rules explained under `actions`. Example - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('index'); }); - export default Router; - ``` - ```app/routes/application.js - import Ember from 'ember'; - export default Ember.Route.extend({ + App.ApplicationRoute = Ember.Route.extend({ actions: { - track(arg) { + track: function(arg) { console.log(arg, 'was clicked'); } } }); - ``` - ```app/routes/index.js - import Ember from 'ember'; - export default Ember.Route.extend({ + App.IndexRoute = Ember.Route.extend({ actions: { - trackIfDebug(arg) { + trackIfDebug: function(arg) { if (debug) { this.send('track', arg); } @@ -25817,7 +25701,6 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' cache.stash(cacheKey, prop, value); } }, - /** This hook is the first of the route entry validation hooks called when an attempt is made to transition into a route @@ -25837,6 +25720,46 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' transition until the promise resolves (or rejects). This could be useful, for instance, for retrieving async code from the server that is required to enter a route. + ```javascript + App.PostRoute = Ember.Route.extend({ + beforeModel: function(transition) { + if (!App.Post) { + return Ember.$.getScript('/models/post.js'); + } + } + }); + ``` + If `App.Post` doesn't exist in the above example, + `beforeModel` will use jQuery's `getScript`, which + returns a promise that resolves after the server has + successfully retrieved and executed the code from the + server. Note that if an error were to occur, it would + be passed to the `error` hook on `Ember.Route`, but + it's also possible to handle errors specific to + `beforeModel` right from within the hook (to distinguish + from the shared error handling behavior of the `error` + hook): + ```javascript + App.PostRoute = Ember.Route.extend({ + beforeModel: function(transition) { + if (!App.Post) { + let self = this; + return Ember.$.getScript('post.js').then(null, function(e) { + self.transitionTo('help'); + // Note that the above transitionTo will implicitly + // halt the transition. If you were to return + // nothing from this promise reject handler, + // according to promise semantics, that would + // convert the reject into a resolve and the + // transition would continue. To propagate the + // error so that it'd be handled by the `error` + // hook, you would have to + return Ember.RSVP.reject(e); + }); + } + } + }); + ``` @method beforeModel @param {Transition} transition @return {Promise} if the value returned from this hook is @@ -25855,10 +25778,9 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' the `transition`, and is therefore suited to performing logic that can only take place after the model has already resolved. - ```app/routes/posts.js - import Ember from 'ember'; - export default Ember.Route.extend({ - afterModel(posts, transition) { + ```javascript + App.PostsRoute = Ember.Route.extend({ + afterModel: function(posts, transition) { if (posts.get('length') === 1) { this.transitionTo('post.show', posts.get('firstObject')); } @@ -25918,12 +25840,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** A hook you can implement to convert the URL into the model for this route. - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('post', { path: '/posts/:post_id' }); }); - export default Router; ``` The model for the `post` route is `store.findRecord('post', params.post_id)`. By default, if your route has a dynamic segment ending in `_id`: @@ -25957,10 +25877,9 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' if a promise returned from `model` fails, the error will be handled by the `error` hook on `Ember.Route`. Example - ```app/routes/post.js - import Ember from 'ember'; - export default Ember.Route.extend({ - model(params) { + ```javascript + App.PostRoute = Ember.Route.extend({ + model: function(params) { return this.store.findRecord('post', params.post_id); } }); @@ -25976,7 +25895,8 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' @public */ model: function (params, transition) { - var name = undefined, + var match = undefined, + name = undefined, sawParams = undefined, value = undefined; var queryParams = _emberMetal.get(this, '_qp.map'); @@ -25986,8 +25906,7 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' continue; } - var match = prop.match(/^(.*)_id$/); - if (match) { + if (match = prop.match(/^(.*)_id$/)) { name = match[1]; value = params[prop]; } @@ -26067,20 +25986,16 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** A hook you can implement to convert the route's model into parameters for the URL. - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('post', { path: '/posts/:post_id' }); }); - ``` - ```app/routes/post.js - import Ember from 'ember'; - export default Ember.Route.extend({ - model(params) { + App.PostRoute = Ember.Route.extend({ + model: function(params) { // the server returns `{ id: 12 }` return Ember.$.getJSON('/posts/' + params.post_id); }, - serialize(model) { + serialize: function(model) { // this will make the URL `/posts/12` return { post_id: model.id }; } @@ -26112,13 +26027,12 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' prevent this default behavior. If you want to preserve that behavior when implementing your `setupController` function, make sure to call `_super`: - ```app/routes/photos.js - import Ember from 'ebmer'; - export default Ember.Route.extend({ - model() { + ```javascript + App.PhotosRoute = Ember.Route.extend({ + model: function() { return this.store.findAll('photo'); }, - setupController(controller, model) { + setupController: function(controller, model) { // Call _super for default behavior this._super(controller, model); // Implement your custom setup after @@ -26130,21 +26044,18 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' of this route. If no explicit controller is defined, Ember will automatically create one. As an example, consider the router: - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('post', { path: '/posts/:post_id' }); }); - export default Router; ``` For the `post` route, a controller named `App.PostController` would be used if it is defined. If it is not defined, a basic `Ember.Controller` instance would be used. Example - ```app/routes/post.js - import Ember from 'ember'; - export default Ember.Route.extend({ - setupController(controller, model) { + ```javascript + App.PostRoute = Ember.Route.extend({ + setupController: function(controller, model) { controller.set('model', model); } }); @@ -26162,14 +26073,12 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' }, /** - Returns the resolved model of the current route, or a parent (or any ancestor) - route in a route hierarchy. + Returns the controller for a particular route or name. The controller instance must already have been created, either through entering the associated route or using `generateController`. - ```app/routes/post.js - import Ember from 'ember'; - export default Ember.Route.extend({ - setupController(controller, post) { + ```javascript + App.PostRoute = Ember.Route.extend({ + setupController: function(controller, post) { this._super(controller, post); this.controllerFor('posts').set('currentPost', post); } @@ -26203,10 +26112,9 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** Generates a controller for a route. Example - ```app/routes/post.js - import Ember from 'ember'; - export default Ember.Route.extend({ - setupController(controller, post) { + ```javascript + App.PostRoute = Ember.Route.extend({ + setupController: function(controller, post) { this._super(controller, post); this.generateController('posts'); } @@ -26232,19 +26140,14 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' retrieve it. If the ancestor route's model was a promise, its resolved result is returned. Example - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('post', { path: '/post/:post_id' }, function() { this.route('comments', { resetNamespace: true }); }); }); - export default Router; - ``` - ```app/routes/comments.js - import Ember from 'ember'; - export default Ember.Route.extend({ - afterModel() { + App.CommentsRoute = Ember.Route.extend({ + afterModel: function() { this.set('post', this.modelFor('post')); } }); @@ -26289,10 +26192,9 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' template, configured with the controller for the route. This method can be overridden to set up and render additional or alternative templates. - ```app/routes/posts.js - import Ember from 'ember'; - export default Ember.Route.extend({ - renderTemplate(controller, model) { + ```javascript + App.PostsRoute = Ember.Route.extend({ + renderTemplate: function(controller, model) { let favController = this.controllerFor('favoritePost'); // Render the `favoritePost` template into // the outlet `posts`, and display the `favoritePost` @@ -26320,12 +26222,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' phase of routing (via the `renderTemplate` hook) and later in response to user interaction. For example, given the following minimal router and templates: - ```app/router.js - // ... - Router.map(function() { + ```javascript + Router.map(function() { this.route('photos'); }); - export default Router; ``` ```handlebars @@ -26339,10 +26239,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' ``` You can render `photos.hbs` into the `"anOutletName"` outlet of `application.hbs` by calling `render`: - ```app/routes/post.js - import Ember from 'ember'; - export default Ember.Route.extend({ - renderTemplate() { + ```javascript + // posts route + Ember.Route.extend({ + renderTemplate: function() { this.render('photos', { into: 'application', outlet: 'anOutletName' @@ -26352,10 +26252,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' ``` `render` additionally allows you to supply which `controller` and `model` objects should be loaded and associated with the rendered template. - ```app/routes/posts.js - import Ember from 'ember'; - export default Ember.Route.extend({ - renderTemplate(controller, model){ + ```javascript + // posts route + Ember.Route.extend({ + renderTemplate: function(controller, model){ this.render('posts', { // the template to render, referenced by name into: 'application', // the template to render into, referenced by name outlet: 'anOutletName', // the outlet inside `options.template` to render into. @@ -26374,26 +26274,26 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' based on the name of the route specified in the router or the Route's `controllerName` and `templateName` properties. For example: - ```app/router.js - // ... - Router.map(function() { + ```javascript + // router + Router.map(function() { this.route('index'); this.route('post', { path: '/posts/:post_id' }); }); - export default Router; ``` - ```app/routes/post.js - import Ember from 'ember'; - export default Ember.Route.extend({ - renderTemplate() { + ```javascript + // post route + PostRoute = App.Route.extend({ + renderTemplate: function() { this.render(); // all defaults apply } }); ``` - The name of the route, defined by the router, is `post`. + The name of the `PostRoute`, defined by the router, is `post`. The following equivalent default options will be applied when the Route calls `render`: ```javascript + // this.render('post', { // the template name associated with 'post' Route into: 'application', // the parent route to 'post' Route outlet: 'main', // {{outlet}} and {{outlet 'main'}} are synonymous, @@ -26442,17 +26342,16 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' * `parentView`: the name of the view containing the outlet to clear (default: the view rendered by the parent route) Example: - ```app/routes/application.js - import Ember from 'ember'; - export default App.Route.extend({ + ```javascript + App.ApplicationRoute = App.Route.extend({ actions: { - showModal(evt) { + showModal: function(evt) { this.render(evt.modalName, { outlet: 'modal', into: 'application' }); }, - hideModal(evt) { + hideModal: function(evt) { this.disconnectOutlet({ outlet: 'modal', parentView: 'application' @@ -26463,18 +26362,11 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' ``` Alternatively, you can pass the `outlet` name directly as a string. Example: - ```app/routes/application.js - import Ember from 'ember'; - export default App.Route.extend({ - actions: { - showModal(evt) { - // ... - }, - hideModal(evt) { - this.disconnectOutlet('modal'); - } - } - }); + ```javascript + hideModal: function(evt) { + this.disconnectOutlet('modal'); + } + ``` @method disconnectOutlet @param {Object|String} options the options hash or outlet name @since 1.0.0 @@ -26618,7 +26510,7 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' var template = owner.lookup('template:' + templateName); var parent = undefined; - if (into && (parent = parentRoute(route)) && into === parent.routeName) { + if (into && (parent = parentRoute(route)) && into === parentRoute(route).routeName) { into = undefined; } @@ -28200,12 +28092,6 @@ enifed('ember-routing/system/router', ['exports', 'ember-utils', 'ember-console' _emberMetal.set(target.outlets, renderOptions.outlet, myState); } else { if (renderOptions.into) { - _emberMetal.deprecate('Rendering into a {{render}} helper that resolves to an {{outlet}} is deprecated.', false, { - id: 'ember-routing.top-level-render-helper', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_rendering-into-a-render-helper-that-resolves-to-an-outlet' - }); - // Megahax time. Post-3.0-breaking-changes, we will just assert // right here that the user tried to target a nonexistent // thing. But for now we still need to support the `render` @@ -28451,7 +28337,11 @@ enifed('ember-routing/utils', ['exports', 'ember-utils', 'ember-metal'], functio */ function normalizeControllerQueryParams(queryParams) { - var qpMap = {}; + if (queryParams._qpMap) { + return queryParams._qpMap; + } + + var qpMap = queryParams._qpMap = {}; for (var i = 0; i < queryParams.length; ++i) { accumulateQueryParamDescriptors(queryParams[i], qpMap); @@ -31152,6 +31042,8 @@ enifed('ember-runtime/mixins/action_handler', ['exports', 'ember-metal'], functi args[_key - 1] = arguments[_key]; } + var target = undefined; + if (this.actions && this.actions[actionName]) { var shouldBubble = this.actions[actionName].apply(this, args) === true; if (!shouldBubble) { @@ -31159,10 +31051,11 @@ enifed('ember-runtime/mixins/action_handler', ['exports', 'ember-metal'], functi } } - var target = _emberMetal.get(this, 'target'); - if (target) { + if (target = _emberMetal.get(this, 'target')) { + var _target; + _emberMetal.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); } }, @@ -31583,7 +31476,7 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-utils', 'ember-metal', ' /** This returns the objects at the specified indexes, using `objectAt`. ```javascript - let arr = ['a', 'b', 'c', 'd']; + let arr = ['a', 'b', 'c', 'd']; arr.objectsAt([0, 1, 2]); // ['a', 'b', 'c'] arr.objectsAt([2, 3, 4]); // ['c', 'd', undefined] ``` @@ -32523,8 +32416,7 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-utils', 'ember-meta for (var idx = 0; idx < len && !found; idx++) { next = this.nextObject(idx, last, context); - found = callback.call(target, next, idx, this); - if (found) { + if (found = callback.call(target, next, idx, this)) { ret = next; } @@ -35317,7 +35209,7 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met // using ember-metal/lib/main here to ensure that ember-debug is setup // if present - var _Mixin$create, _ClassMixinProps; + var _Mixin$create; var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['.'], ['.']); @@ -35576,7 +35468,7 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met CoreObject.__super__ = null; - var ClassMixinProps = (_ClassMixinProps = { + var ClassMixinProps = { ClassMixin: _emberMetal.REQUIRED, @@ -35584,95 +35476,310 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met isClass: true, - isMethod: false - }, _ClassMixinProps[_emberUtils.NAME_KEY] = null, _ClassMixinProps[_emberUtils.GUID_KEY] = null, _ClassMixinProps.extend = function () { - var Class = makeCtor(); - var proto; - Class.ClassMixin = _emberMetal.Mixin.create(this.ClassMixin); - Class.PrototypeMixin = _emberMetal.Mixin.create(this.PrototypeMixin); + isMethod: false, + /** + Creates a new subclass. + ```javascript + const Person = Ember.Object.extend({ + say(thing) { + alert(thing); + } + }); + ``` + This defines a new subclass of Ember.Object: `Person`. It contains one method: `say()`. + You can also create a subclass from any existing class by calling its `extend()` method. + For example, you might want to create a subclass of Ember's built-in `Ember.Component` class: + ```javascript + const PersonComponent = Ember.Component.extend({ + tagName: 'li', + classNameBindings: ['isAdministrator'] + }); + ``` + When defining a subclass, you can override methods but still access the + implementation of your parent class by calling the special `_super()` method: + ```javascript + const Person = Ember.Object.extend({ + say(thing) { + var name = this.get('name'); + alert(`${name} says: ${thing}`); + } + }); + const Soldier = Person.extend({ + say(thing) { + this._super(`${thing}, sir!`); + }, + march(numberOfHours) { + alert(`${this.get('name')} marches for ${numberOfHours} hours.`); + } + }); + let yehuda = Soldier.create({ + name: "Yehuda Katz" + }); + yehuda.say("Yes"); // alerts "Yehuda Katz says: Yes, sir!" + ``` + The `create()` on line #17 creates an *instance* of the `Soldier` class. + The `extend()` on line #8 creates a *subclass* of `Person`. Any instance + of the `Person` class will *not* have the `march()` method. + You can also pass `Mixin` classes to add additional properties to the subclass. + ```javascript + const Person = Ember.Object.extend({ + say(thing) { + alert(`${this.get('name')} says: ${thing}`); + } + }); + const SingingMixin = Mixin.create({ + sing(thing){ + alert(`${this.get('name')} sings: la la la ${thing}`); + } + }); + const BroadwayStar = Person.extend(SingingMixin, { + dance() { + alert(`${this.get('name')} dances: tap tap tap tap `); + } + }); + ``` + The `BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`. + @method extend + @static + @param {Mixin} [mixins]* One or more Mixin classes + @param {Object} [arguments]* Object containing values to use within the new class + @public + */ + extend: function () { + var Class = makeCtor(); + var proto; + Class.ClassMixin = _emberMetal.Mixin.create(this.ClassMixin); + Class.PrototypeMixin = _emberMetal.Mixin.create(this.PrototypeMixin); - Class.ClassMixin.ownerConstructor = Class; - Class.PrototypeMixin.ownerConstructor = Class; + Class.ClassMixin.ownerConstructor = Class; + Class.PrototypeMixin.ownerConstructor = Class; - reopen.apply(Class.PrototypeMixin, arguments); + reopen.apply(Class.PrototypeMixin, arguments); - Class.superclass = this; - Class.__super__ = this.prototype; + Class.superclass = this; + Class.__super__ = this.prototype; - proto = Class.prototype = Object.create(this.prototype); - proto.constructor = Class; - _emberUtils.generateGuid(proto); - _emberMetal.meta(proto).proto = proto; // this will disable observers on prototype + proto = Class.prototype = Object.create(this.prototype); + proto.constructor = Class; + _emberUtils.generateGuid(proto); + _emberMetal.meta(proto).proto = proto; // this will disable observers on prototype - Class.ClassMixin.apply(Class); - return Class; - }, _ClassMixinProps.create = function () { - var C = this; + Class.ClassMixin.apply(Class); + return Class; + }, - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } + /** + Creates an instance of a class. Accepts either no arguments, or an object + containing values to initialize the newly instantiated object with. + ```javascript + const Person = Ember.Object.extend({ + helloWorld() { + alert(`Hi, my name is ${this.get('name')}`); + } + }); + let tom = Person.create({ + name: 'Tom Dale' + }); + tom.helloWorld(); // alerts "Hi, my name is Tom Dale". + ``` + `create` will call the `init` function if defined during + `Ember.AnyObject.extend` + If no arguments are passed to `create`, it will not set values to the new + instance during initialization: + ```javascript + let noName = Person.create(); + noName.helloWorld(); // alerts undefined + ``` + NOTE: For performance reasons, you cannot declare methods or computed + properties during `create`. You should instead declare methods and computed + properties when using `extend`. + @method create + @static + @param [arguments]* + @public + */ + create: function () { + var C = this; - if (args.length > 0) { - this._initProperties(args); - } - return new C(); - }, _ClassMixinProps.reopen = function () { - this.willReopen(); - reopen.apply(this.PrototypeMixin, arguments); - return this; - }, _ClassMixinProps.reopenClass = function () { - reopen.apply(this.ClassMixin, arguments); - applyMixin(this, arguments, false); - return this; - }, _ClassMixinProps.detect = function (obj) { - if ('function' !== typeof obj) { - return false; - } - while (obj) { - if (obj === this) { - return true; + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; } - obj = obj.superclass; - } - return false; - }, _ClassMixinProps.detectInstance = function (obj) { - return obj instanceof this; - }, _ClassMixinProps.metaForProperty = function (key) { - var proto = this.proto(); - var possibleDesc = proto[key]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - _emberMetal.assert('metaForProperty() could not find a computed property ' + 'with key \'' + key + '\'.', !!desc && desc instanceof _emberMetal.ComputedProperty); - return desc._meta || {}; - }, _ClassMixinProps._computedProperties = _emberMetal.computed(function () { - hasCachedComputedProperties = true; - var proto = this.proto(); - var property; - var properties = []; + if (args.length > 0) { + this._initProperties(args); + } + return new C(); + }, + + /** + Augments a constructor's prototype with additional + properties and functions: + ```javascript + const MyObject = Ember.Object.extend({ + name: 'an object' + }); + o = MyObject.create(); + o.get('name'); // 'an object' + MyObject.reopen({ + say(msg){ + console.log(msg); + } + }) + o2 = MyObject.create(); + o2.say("hello"); // logs "hello" + o.say("goodbye"); // logs "goodbye" + ``` + To add functions and properties to the constructor itself, + see `reopenClass` + @method reopen + @public + */ + reopen: function () { + this.willReopen(); + reopen.apply(this.PrototypeMixin, arguments); + return this; + }, - for (var name in proto) { - property = proto[name]; + /** + Augments a constructor's own properties and functions: + ```javascript + const MyObject = Ember.Object.extend({ + name: 'an object' + }); + MyObject.reopenClass({ + canBuild: false + }); + MyObject.canBuild; // false + o = MyObject.create(); + ``` + In other words, this creates static properties and functions for the class. + These are only available on the class and not on any instance of that class. + ```javascript + const Person = Ember.Object.extend({ + name: "", + sayHello() { + alert("Hello. My name is " + this.get('name')); + } + }); + Person.reopenClass({ + species: "Homo sapiens", + createPerson(newPersonsName){ + return Person.create({ + name:newPersonsName + }); + } + }); + let tom = Person.create({ + name: "Tom Dale" + }); + let yehuda = Person.createPerson("Yehuda Katz"); + tom.sayHello(); // "Hello. My name is Tom Dale" + yehuda.sayHello(); // "Hello. My name is Yehuda Katz" + alert(Person.species); // "Homo sapiens" + ``` + Note that `species` and `createPerson` are *not* valid on the `tom` and `yehuda` + variables. They are only valid on `Person`. + To add functions and properties to instances of + a constructor by extending the constructor's prototype + see `reopen` + @method reopenClass + @public + */ + reopenClass: function () { + reopen.apply(this.ClassMixin, arguments); + applyMixin(this, arguments, false); + return this; + }, - if (property && property.isDescriptor) { - properties.push({ - name: name, - meta: property._meta - }); + detect: function (obj) { + if ('function' !== typeof obj) { + return false; } - } - return properties; - }).readOnly(), _ClassMixinProps.eachComputedProperty = function (callback, binding) { - var property; - var empty = {}; + while (obj) { + if (obj === this) { + return true; + } + obj = obj.superclass; + } + return false; + }, - var properties = _emberMetal.get(this, '_computedProperties'); + detectInstance: function (obj) { + return obj instanceof this; + }, - for (var i = 0; i < properties.length; i++) { - property = properties[i]; - callback.call(binding || this, property.name, property.meta || empty); + /** + In some cases, you may want to annotate computed properties with additional + metadata about how they function or what values they operate on. For + example, computed property functions may close over variables that are then + no longer available for introspection. + You can pass a hash of these values to a computed property like this: + ```javascript + person: Ember.computed(function() { + var personId = this.get('personId'); + return Person.create({ id: personId }); + }).meta({ type: Person }) + ``` + Once you've done this, you can retrieve the values saved to the computed + property from your class like this: + ```javascript + MyClass.metaForProperty('person'); + ``` + This will return the original hash that was passed to `meta()`. + @static + @method metaForProperty + @param key {String} property name + @private + */ + metaForProperty: function (key) { + var proto = this.proto(); + var possibleDesc = proto[key]; + var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; + + _emberMetal.assert('metaForProperty() could not find a computed property ' + 'with key \'' + key + '\'.', !!desc && desc instanceof _emberMetal.ComputedProperty); + return desc._meta || {}; + }, + + _computedProperties: _emberMetal.computed(function () { + hasCachedComputedProperties = true; + var proto = this.proto(); + var property; + var properties = []; + + for (var name in proto) { + property = proto[name]; + + if (property && property.isDescriptor) { + properties.push({ + name: name, + meta: property._meta + }); + } + } + return properties; + }).readOnly(), + + /** + Iterate over each computed property for the class, passing its name + and any associated metadata (see `metaForProperty`) to the callback. + @static + @method eachComputedProperty + @param {Function} callback + @param {Object} binding + @private + */ + eachComputedProperty: function (callback, binding) { + var property; + var empty = {}; + + var properties = _emberMetal.get(this, '_computedProperties'); + + for (var i = 0; i < properties.length; i++) { + property = properties[i]; + callback.call(binding || this, property.name, property.meta || empty); + } } - }, _ClassMixinProps); + }; function injectedPropertyAssertion() { _emberMetal.assert('Injected properties are invalid', _emberRuntimeInject.validatePropertyInjections(this)); @@ -35930,210 +36037,6 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met @return {String} string representation @public */ - -/** - Creates a new subclass. - ```javascript - const Person = Ember.Object.extend({ - say(thing) { - alert(thing); - } - }); - ``` - This defines a new subclass of Ember.Object: `Person`. It contains one method: `say()`. - You can also create a subclass from any existing class by calling its `extend()` method. - For example, you might want to create a subclass of Ember's built-in `Ember.Component` class: - ```javascript - const PersonComponent = Ember.Component.extend({ - tagName: 'li', - classNameBindings: ['isAdministrator'] - }); - ``` - When defining a subclass, you can override methods but still access the - implementation of your parent class by calling the special `_super()` method: - ```javascript - const Person = Ember.Object.extend({ - say(thing) { - var name = this.get('name'); - alert(`${name} says: ${thing}`); - } - }); - const Soldier = Person.extend({ - say(thing) { - this._super(`${thing}, sir!`); - }, - march(numberOfHours) { - alert(`${this.get('name')} marches for ${numberOfHours} hours.`); - } - }); - let yehuda = Soldier.create({ - name: "Yehuda Katz" - }); - yehuda.say("Yes"); // alerts "Yehuda Katz says: Yes, sir!" - ``` - The `create()` on line #17 creates an *instance* of the `Soldier` class. - The `extend()` on line #8 creates a *subclass* of `Person`. Any instance - of the `Person` class will *not* have the `march()` method. - You can also pass `Mixin` classes to add additional properties to the subclass. - ```javascript - const Person = Ember.Object.extend({ - say(thing) { - alert(`${this.get('name')} says: ${thing}`); - } - }); - const SingingMixin = Mixin.create({ - sing(thing){ - alert(`${this.get('name')} sings: la la la ${thing}`); - } - }); - const BroadwayStar = Person.extend(SingingMixin, { - dance() { - alert(`${this.get('name')} dances: tap tap tap tap `); - } - }); - ``` - The `BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`. - @method extend - @static - @param {Mixin} [mixins]* One or more Mixin classes - @param {Object} [arguments]* Object containing values to use within the new class - @public -*/ - -/** - Creates an instance of a class. Accepts either no arguments, or an object - containing values to initialize the newly instantiated object with. - ```javascript - const Person = Ember.Object.extend({ - helloWorld() { - alert(`Hi, my name is ${this.get('name')}`); - } - }); - let tom = Person.create({ - name: 'Tom Dale' - }); - tom.helloWorld(); // alerts "Hi, my name is Tom Dale". - ``` - `create` will call the `init` function if defined during - `Ember.AnyObject.extend` - If no arguments are passed to `create`, it will not set values to the new - instance during initialization: - ```javascript - let noName = Person.create(); - noName.helloWorld(); // alerts undefined - ``` - NOTE: For performance reasons, you cannot declare methods or computed - properties during `create`. You should instead declare methods and computed - properties when using `extend`. - @method create - @static - @param [arguments]* - @public -*/ - -/** - Augments a constructor's prototype with additional - properties and functions: - ```javascript - const MyObject = Ember.Object.extend({ - name: 'an object' - }); - o = MyObject.create(); - o.get('name'); // 'an object' - MyObject.reopen({ - say(msg){ - console.log(msg); - } - }) - o2 = MyObject.create(); - o2.say("hello"); // logs "hello" - o.say("goodbye"); // logs "goodbye" - ``` - To add functions and properties to the constructor itself, - see `reopenClass` - @method reopen - @public -*/ - -/** - Augments a constructor's own properties and functions: - ```javascript - const MyObject = Ember.Object.extend({ - name: 'an object' - }); - MyObject.reopenClass({ - canBuild: false - }); - MyObject.canBuild; // false - o = MyObject.create(); - ``` - In other words, this creates static properties and functions for the class. - These are only available on the class and not on any instance of that class. - ```javascript - const Person = Ember.Object.extend({ - name: "", - sayHello() { - alert("Hello. My name is " + this.get('name')); - } - }); - Person.reopenClass({ - species: "Homo sapiens", - createPerson(newPersonsName){ - return Person.create({ - name:newPersonsName - }); - } - }); - let tom = Person.create({ - name: "Tom Dale" - }); - let yehuda = Person.createPerson("Yehuda Katz"); - tom.sayHello(); // "Hello. My name is Tom Dale" - yehuda.sayHello(); // "Hello. My name is Yehuda Katz" - alert(Person.species); // "Homo sapiens" - ``` - Note that `species` and `createPerson` are *not* valid on the `tom` and `yehuda` - variables. They are only valid on `Person`. - To add functions and properties to instances of - a constructor by extending the constructor's prototype - see `reopen` - @method reopenClass - @public -*/ - -/** - In some cases, you may want to annotate computed properties with additional - metadata about how they function or what values they operate on. For - example, computed property functions may close over variables that are then - no longer available for introspection. - You can pass a hash of these values to a computed property like this: - ```javascript - person: Ember.computed(function() { - var personId = this.get('personId'); - return Person.create({ id: personId }); - }).meta({ type: Person }) - ``` - Once you've done this, you can retrieve the values saved to the computed - property from your class like this: - ```javascript - MyClass.metaForProperty('person'); - ``` - This will return the original hash that was passed to `meta()`. - @static - @method metaForProperty - @param key {String} property name - @private -*/ - -/** - Iterate over each computed property for the class, passing its name - and any associated metadata (see `metaForProperty`) to the callback. - @static - @method eachComputedProperty - @param {Function} callback - @param {Object} binding - @private -*/ enifed('ember-runtime/system/each_proxy', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/mixins/array'], function (exports, _emberUtils, _emberMetal, _emberRuntimeMixinsArray) { 'use strict'; @@ -36386,7 +36289,7 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal } findNamespaces(); - return this[_emberUtils.NAME_KEY]; + return this[_emberMetal.NAME_KEY]; }, nameClasses: function () { @@ -36446,10 +36349,10 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal paths[idx] = key; // If we have found an unprocessed class - if (obj && obj.toString === classToString && !obj[_emberUtils.NAME_KEY]) { + if (obj && obj.toString === classToString && !obj[_emberMetal.NAME_KEY]) { // Replace the class' `toString` with the dot-separated path // and set its `NAME_KEY` - obj[_emberUtils.NAME_KEY] = paths.join('.'); + obj[_emberMetal.NAME_KEY] = paths.join('.'); // Support nested namespaces } else if (obj && obj.isNamespace) { @@ -36495,7 +36398,7 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal } var obj = tryIsNamespace(lookup, key); if (obj) { - obj[_emberUtils.NAME_KEY] = key; + obj[_emberMetal.NAME_KEY] = key; } } } @@ -36503,41 +36406,35 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal function superClassString(mixin) { var superclass = mixin.superclass; if (superclass) { - if (superclass[_emberUtils.NAME_KEY]) { - return superclass[_emberUtils.NAME_KEY]; + if (superclass[_emberMetal.NAME_KEY]) { + return superclass[_emberMetal.NAME_KEY]; } return superClassString(superclass); } } - function calculateToString(target) { - var str = undefined; - - if (!searchDisabled) { + function classToString() { + if (!searchDisabled && !this[_emberMetal.NAME_KEY]) { processAllNamespaces(); - // can also be set by processAllNamespaces - str = target[_emberUtils.NAME_KEY]; + } + + var ret = undefined; + + if (this[_emberMetal.NAME_KEY]) { + ret = this[_emberMetal.NAME_KEY]; + } else if (this._toString) { + ret = this._toString; + } else { + var str = superClassString(this); if (str) { - return str; + ret = '(subclass of ' + str + ')'; } else { - str = superClassString(target); - str = str ? '(subclass of ' + str + ')' : str; + ret = '(unknown mixin)'; } - } - if (str) { - return str; - } else { - return '(unknown mixin)'; - } - } - - function classToString() { - var name = this[_emberUtils.NAME_KEY]; - if (name) { - return name; + this.toString = makeToString(ret); } - return this[_emberUtils.NAME_KEY] = calculateToString(this); + return ret; } function processAllNamespaces() { @@ -36562,6 +36459,12 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal } } + function makeToString(ret) { + return function () { + return ret; + }; + } + _emberMetal.Mixin.prototype.toString = classToString; // ES6TODO: altering imported objects. SBB. exports.default = Namespace; @@ -38283,6 +38186,7 @@ enifed('ember-testing/helpers/wait', ['exports', 'ember-testing/test/waiters', ' @param {Object} value The value to be returned. @return {RSVP.Promise} @public + @since 1.0.0 */ function wait(app, value) { @@ -38356,9 +38260,7 @@ enifed('ember-testing/initializers', ['exports', 'ember-runtime'], function (exp } }); }); -enifed('ember-testing/setup_for_testing', ['exports', 'ember-metal', 'ember-views', 'ember-testing/test/adapter', 'ember-testing/test/pending_requests', 'ember-testing/adapters/adapter', 'ember-testing/adapters/qunit'], function (exports, _emberMetal, _emberViews, _emberTestingTestAdapter, _emberTestingTestPending_requests, _emberTestingAdaptersAdapter, _emberTestingAdaptersQunit) { - /* global self */ - +enifed('ember-testing/setup_for_testing', ['exports', 'ember-metal', 'ember-views', 'ember-testing/test/adapter', 'ember-testing/test/pending_requests', 'ember-testing/adapters/qunit'], function (exports, _emberMetal, _emberViews, _emberTestingTestAdapter, _emberTestingTestPending_requests, _emberTestingAdaptersQunit) { 'use strict'; exports.default = setupForTesting; @@ -38382,7 +38284,7 @@ enifed('ember-testing/setup_for_testing', ['exports', 'ember-metal', 'ember-view var adapter = _emberTestingTestAdapter.getAdapter(); // if adapter is not manually set default to QUnit if (!adapter) { - _emberTestingTestAdapter.setAdapter(typeof self.QUnit === 'undefined' ? new _emberTestingAdaptersAdapter.default() : new _emberTestingAdaptersQunit.default()); + _emberTestingTestAdapter.setAdapter(new _emberTestingAdaptersQunit.default()); } _emberViews.jQuery(document).off('ajaxSend', _emberTestingTestPending_requests.incrementPendingRequests); @@ -39324,7 +39226,7 @@ enifed('ember-utils/guid', ['exports', 'ember-utils/intern'], function (exports, } } }); -enifed('ember-utils/index', ['exports', 'ember-utils/symbol', 'ember-utils/owner', 'ember-utils/assign', 'ember-utils/empty-object', 'ember-utils/dictionary', 'ember-utils/guid', 'ember-utils/intern', 'ember-utils/super', 'ember-utils/inspect', 'ember-utils/lookup-descriptor', 'ember-utils/invoke', 'ember-utils/make-array', 'ember-utils/apply-str', 'ember-utils/name', 'ember-utils/to-string'], function (exports, _emberUtilsSymbol, _emberUtilsOwner, _emberUtilsAssign, _emberUtilsEmptyObject, _emberUtilsDictionary, _emberUtilsGuid, _emberUtilsIntern, _emberUtilsSuper, _emberUtilsInspect, _emberUtilsLookupDescriptor, _emberUtilsInvoke, _emberUtilsMakeArray, _emberUtilsApplyStr, _emberUtilsName, _emberUtilsToString) { +enifed('ember-utils/index', ['exports', 'ember-utils/symbol', 'ember-utils/owner', 'ember-utils/assign', 'ember-utils/empty-object', 'ember-utils/dictionary', 'ember-utils/guid', 'ember-utils/intern', 'ember-utils/super', 'ember-utils/inspect', 'ember-utils/lookup-descriptor', 'ember-utils/invoke', 'ember-utils/make-array', 'ember-utils/apply-str', 'ember-utils/to-string'], function (exports, _emberUtilsSymbol, _emberUtilsOwner, _emberUtilsAssign, _emberUtilsEmptyObject, _emberUtilsDictionary, _emberUtilsGuid, _emberUtilsIntern, _emberUtilsSuper, _emberUtilsInspect, _emberUtilsLookupDescriptor, _emberUtilsInvoke, _emberUtilsMakeArray, _emberUtilsApplyStr, _emberUtilsToString) { /* This package will be eagerly parsed and should have no dependencies on external packages. @@ -39360,7 +39262,6 @@ enifed('ember-utils/index', ['exports', 'ember-utils/symbol', 'ember-utils/owner exports.tryInvoke = _emberUtilsInvoke.tryInvoke; exports.makeArray = _emberUtilsMakeArray.default; exports.applyStr = _emberUtilsApplyStr.default; - exports.NAME_KEY = _emberUtilsName.default; exports.toString = _emberUtilsToString.default; }); enifed('ember-utils/inspect', ['exports'], function (exports) { @@ -39593,11 +39494,6 @@ enifed("ember-utils/make-array", ["exports"], function (exports) { return Array.isArray(obj) ? obj : [obj]; } }); -enifed('ember-utils/name', ['exports', 'ember-utils/symbol'], function (exports, _emberUtilsSymbol) { - 'use strict'; - - exports.default = _emberUtilsSymbol.default('NAME_KEY'); -}); enifed('ember-utils/owner', ['exports', 'ember-utils/symbol'], function (exports, _emberUtilsSymbol) { /** @module ember @@ -39756,12 +39652,12 @@ enifed('ember-utils/symbol', ['exports', 'ember-utils/guid', 'ember-utils/intern // TODO: Investigate using platform symbols, but we do not // want to require non-enumerability for this API, which // would introduce a large cost. - - return _emberUtilsIntern.default(debugName + ' [id=' + _emberUtilsGuid.GUID_KEY + Math.floor(Math.random() * new Date()) + ']'); + var id = _emberUtilsGuid.GUID_KEY + Math.floor(Math.random() * new Date()); + return _emberUtilsIntern.default('__' + debugName + '__ [id=' + id + ']'); } }); -enifed('ember-utils/to-string', ['exports'], function (exports) { - 'use strict'; +enifed("ember-utils/to-string", ["exports"], function (exports) { + "use strict"; exports.default = toString; var objectToString = Object.prototype.toString; @@ -39772,7 +39668,7 @@ enifed('ember-utils/to-string', ['exports'], function (exports) { */ function toString(obj) { - if (obj && typeof obj.toString === 'function') { + if (obj && obj.toString) { return obj.toString(); } else { return objectToString.call(obj); @@ -39970,6 +39866,7 @@ enifed('ember-views/mixins/action_support', ['exports', 'ember-utils', 'ember-me args[_key2 - 1] = arguments[_key2]; } + var target = undefined; var action = this.actions && this.actions[actionName]; if (action) { @@ -39979,10 +39876,13 @@ enifed('ember-views/mixins/action_support', ['exports', 'ember-utils', 'ember-me } } - var target = _emberMetal.get(this, 'target'); + target = _emberMetal.get(this, 'target'); + if (target) { + var _target; + _emberMetal.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 { _emberMetal.assert(_emberUtils.inspect(this) + ' had no action handler for: ' + actionName, action); } @@ -40051,7 +39951,10 @@ enifed('ember-views/mixins/class_names_support', ['exports', 'ember-metal'], fun this._super.apply(this, arguments); _emberMetal.assert('Only arrays are allowed for \'classNameBindings\'', Array.isArray(this.classNameBindings)); + this.classNameBindings = this.classNameBindings.slice(); + _emberMetal.assert('Only arrays of static class strings are allowed for \'classNames\'. For dynamic classes, use \'classNameBindings\'.', Array.isArray(this.classNames)); + this.classNames = this.classNames.slice(); }, /** @@ -40495,7 +40398,9 @@ enifed('ember-views/mixins/view_support', ['exports', 'ember-utils', 'ember-meta } }), _Mixin$create.$ = function (sel) { _emberMetal.assert('You cannot access this.$() on a component with `tagName: \'\'` specified.', this.tagName !== ''); - return this._currentState.$(this, sel); + if (this.element) { + return sel ? _emberViewsSystemJquery.default(sel, this.element) : _emberViewsSystemJquery.default(this.element); + } }, _Mixin$create.appendTo = function (selector) { var env = this._environment || _emberEnvironment.environment; var target = undefined; @@ -40530,12 +40435,6 @@ enifed('ember-views/mixins/view_support', ['exports', 'ember-utils', 'ember-meta }, _Mixin$create.renderToElement = function (tagName) { tagName = tagName || 'body'; - _emberMetal.deprecate('Using the `renderToElement` is deprecated in favor of `appendTo`. Called in ' + this.toString(), false, { - id: 'ember-views.render-to-element', - until: '2.12.0', - url: 'http://emberjs.com/deprecations/v2.x#toc_code-rendertoelement-code' - }); - var element = this.renderer.createElement(tagName); this.renderer.appendTo(this, element); @@ -40687,7 +40586,6 @@ enifed('ember-views/mixins/view_support', ['exports', 'ember-utils', 'ember-meta @method renderToElement @param {String} tagName The tag of the element to create and render into. Defaults to "body". @return {HTMLBodyElement} element - @deprecated Use appendTo instead. @private */ @@ -41628,10 +41526,6 @@ enifed('ember-views/views/states/default', ['exports', 'ember-metal'], function throw new _emberMetal.Error('You can\'t use appendChild outside of the rendering process'); }, - $: function () { - return undefined; - }, - // Handle events from `Ember.EventDispatcher` handleEvent: function () { return true; // continue event propagation @@ -41663,16 +41557,12 @@ enifed('ember-views/views/states/destroying', ['exports', 'ember-utils', 'ember- exports.default = destroying; }); -enifed('ember-views/views/states/has_element', ['exports', 'ember-utils', 'ember-views/views/states/default', 'ember-metal', 'ember-views/system/jquery'], function (exports, _emberUtils, _emberViewsViewsStatesDefault, _emberMetal, _emberViewsSystemJquery) { +enifed('ember-views/views/states/has_element', ['exports', 'ember-utils', 'ember-views/views/states/default', 'ember-metal'], function (exports, _emberUtils, _emberViewsViewsStatesDefault, _emberMetal) { 'use strict'; var hasElement = Object.create(_emberViewsViewsStatesDefault.default); _emberUtils.assign(hasElement, { - $: function (view, sel) { - var elem = view.element; - return sel ? _emberViewsSystemJquery.default(sel, elem) : _emberViewsSystemJquery.default(elem); - }, rerender: function (view) { view.renderer.rerender(view); @@ -42235,7 +42125,7 @@ enifed("ember-views/views/view", ["exports"], function (exports) { enifed("ember/features", ["exports"], function (exports) { "use strict"; - exports.default = { "features-stripped-test": false, "ember-libraries-isregistered": false, "ember-runtime-computed-uniq-by": true, "ember-improved-instrumentation": false, "ember-runtime-enumerable-includes": true, "ember-string-ishtmlsafe": true, "ember-testing-check-waiters": true, "ember-metal-weakmap": false, "ember-glimmer-allow-backtracking-rerender": false, "ember-testing-resume-test": false, "mandatory-setter": true, "ember-glimmer-detect-backtracking-rerender": true }; + exports.default = { "features-stripped-test": false, "ember-libraries-isregistered": false, "ember-runtime-computed-uniq-by": true, "ember-improved-instrumentation": false, "ember-runtime-enumerable-includes": true, "ember-string-ishtmlsafe": true, "ember-testing-check-waiters": true, "ember-metal-weakmap": false, "ember-glimmer-allow-backtracking-rerender": true, "ember-testing-resume-test": false, "ember-glimmer-detect-backtracking-rerender": true, "mandatory-setter": true }; }); enifed('ember/index', ['exports', 'require', 'ember-environment', 'ember-utils', 'container', 'ember-metal', 'backburner', 'ember-console', 'ember-runtime', 'ember-glimmer', 'ember/version', 'ember-views', 'ember-routing', 'ember-application', 'ember-extension-support'], function (exports, _require, _emberEnvironment, _emberUtils, _container, _emberMetal, _backburner, _emberConsole, _emberRuntime, _emberGlimmer, _emberVersion, _emberViews, _emberRouting, _emberApplication, _emberExtensionSupport) { 'use strict'; @@ -42341,7 +42231,7 @@ enifed('ember/index', ['exports', 'require', 'ember-environment', 'ember-utils', _emberMetal.default.getProperties = _emberMetal.getProperties; _emberMetal.default.setProperties = _emberMetal.setProperties; _emberMetal.default.expandProperties = _emberMetal.expandProperties; - _emberMetal.default.NAME_KEY = _emberUtils.NAME_KEY; + _emberMetal.default.NAME_KEY = _emberMetal.NAME_KEY; _emberMetal.default.addObserver = _emberMetal.addObserver; _emberMetal.default.observersFor = _emberMetal.observersFor; _emberMetal.default.removeObserver = _emberMetal.removeObserver; @@ -42770,7 +42660,7 @@ enifed('ember/index', ['exports', 'require', 'ember-environment', 'ember-utils', enifed("ember/version", ["exports"], function (exports) { "use strict"; - exports.default = "2.11.0-beta.2"; + exports.default = "2.10.2-with-backtracking"; }); enifed('internal-test-helpers/apply-mixins', ['exports', 'ember-utils'], function (exports, _emberUtils) { 'use strict'; @@ -43950,7 +43840,7 @@ enifed('glimmer-node/index', ['exports', 'glimmer-node/lib/node-dom-helper'], fu exports.NodeDOMTreeConstruction = _glimmerNodeLibNodeDomHelper.default; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItbm9kZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7VUFBb0IsdUJBQXVCLGdDQUFsQyxPQUFPIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgZGVmYXVsdCBhcyBOb2RlRE9NVHJlZUNvbnN0cnVjdGlvbiB9IGZyb20gJy4vbGliL25vZGUtZG9tLWhlbHBlcic7XG4iXX0= + enifed('glimmer-node/lib/node-dom-helper', ['exports', 'glimmer-runtime'], function (exports, _glimmerRuntime) { 'use strict'; @@ -43991,7 +43881,7 @@ enifed('glimmer-node/lib/node-dom-helper', ['exports', 'glimmer-runtime'], funct exports.default = NodeDOMTreeConstruction; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItbm9kZS9saWIvbm9kZS1kb20taGVscGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQUlBLHVCQUFBOzhCQUFBLHVCQUFBOztBQUVFLGlCQUZGLH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dGlvbihodG1sKTtcbiAgICBwYXJlbnQuaW5zZXJ0QmVmb3JlKHJhdywgcmVmZXJlbmNlKTtcblxuICAgIGxldCBmaXJzdCA9IHByZXYgPyBwcmV2Lm5leHRTaWJsaW5nIDogcGFyZW50LmZpcnN0Q2hpbGQ7XG4gICAgbGV0IGxhc3QgPSByZWZlcmVuY2UgPyByZWZlcmVuY2UucHJldmlvdXNTaWJsaW5nIDogcGFyZW50Lmxhc3RDaGlsZDtcblxuICAgIHJldHVybiBuZXcgQ29uY3JldGVCb3VuZHMocGFyZW50LCBmaXJzdCwgbGFzdCk7XG4gIH1cblxuICAvLyBvdmVycmlkZSB0byBhdm9pZCBTVkcgZGV0ZWN0aW9uL3dvcmsgd2hlbiBpbiBub2RlICh0aGlzIGlzIG5vdCBuZWVkZWQgaW4gU1NSKVxuICBjcmVhdGVFbGVtZW50KHRhZzogc3RyaW5nKSB7XG4gICAgcmV0dXJuIHRoaXMuZG9jdW1lbnQuY3JlYXRlRWxlbWVudCh0YWcpO1xuICB9XG5cbiAgLy8gb3ZlcnJpZGUgdG8gYXZvaWQgbmFtZXNwYWNlIHNoZW5hbmlnYW5zIHdoZW4gaW4gbm9kZSAodGhpcyBpcyBub3QgbmVlZGVkIGluIFNTUilcbiAgc2V0QXR0cmlidXRlKGVsZW1lbnQ6IEVsZW1lbnQsIG5hbWU6IHN0cmluZywgdmFsdWU6IHN0cmluZykge1xuICAgIGVsZW1lbnQuc2V0QXR0cmlidXRlKG5hbWUsIHZhbHVlKTtcbiAgfVxufVxuIl19 + enifed('glimmer-reference/index', ['exports', 'glimmer-reference/lib/reference', 'glimmer-reference/lib/const', 'glimmer-reference/lib/validators', 'glimmer-reference/lib/utils', 'glimmer-reference/lib/iterable'], function (exports, _glimmerReferenceLibReference, _glimmerReferenceLibConst, _glimmerReferenceLibValidators, _glimmerReferenceLibUtils, _glimmerReferenceLibIterable) { 'use strict'; @@ -44015,7 +43905,7 @@ enifed('glimmer-reference/index', ['exports', 'glimmer-reference/lib/reference', exports.IteratorSynchronizer = _glimmerReferenceLibIterable.IteratorSynchronizer; exports.IteratorSynchronizerDelegate = _glimmerReferenceLibIterable.IteratorSynchronizerDelegate; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztVQUNlLGNBQWMsaUNBQTNCLFNBQVM7VUFDUSxrQkFBa0IsaUNBQW5DLGFBQWE7VUFJYixjQUFjLDZCQUFkLGNBQWM7VUFDZCxPQUFPLDZCQUFQLE9BQU87O1VBTWUsU0FBUyxrQ0FBL0Isa0JBQWtCO1VBQ1EsYUFBYSxrQ0FBdkMsc0JBQXNCO1VBSXRCLGtCQUFrQiw2QkFBbEIsa0JBQWtCO1VBSWxCLGFBQWEsZ0NBQWIsYUFBYTtVQUNiLFFBQVEsZ0NBQVIsUUFBUTtVQUNSLFFBQVEsZ0NBQVIsUUFBUTtVQUNSLGNBQWMsZ0NBQWQsY0FBYztVQUNkLGNBQWMsZ0NBQWQsY0FBYztVQUNkLGdCQUFnQixnQ0FBaEIsZ0JBQWdCO1VBQ2hCLGdCQUFnQixnQ0FBaEIsZ0JBQWdCO1VBQ2hCLGtCQUFrQixnQ0FBbEIsa0JBQWtCO1VBQ2xCLGlCQUFpQixnQ0FBakIsaUJBQWlCO1VBQ2pCLG9CQUFvQixnQ0FBcEIsb0JBQW9CO1VBQ3BCLDRCQUE0QixnQ0FBNUIsNEJBQTRCIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHtcbiAgUmVmZXJlbmNlIGFzIEJhc2ljUmVmZXJlbmNlLFxuICBQYXRoUmVmZXJlbmNlIGFzIEJhc2ljUGF0aFJlZmVyZW5jZVxufSBmcm9tICcuL2xpYi9yZWZlcmVuY2UnO1xuXG5leHBvcnQge1xuICBDb25zdFJlZmVyZW5jZSxcbiAgaXNDb25zdFxufSBmcm9tICcuL2xpYi9jb25zdCc7XG5cbmV4cG9ydCAqIGZyb20gJy4vbGliL3ZhbGlkYXRvcnMnO1xuXG5leHBvcnQge1xuICBWZXJzaW9uZWRSZWZlcmVuY2UgYXMgUmVmZXJlbmNlLFxuICBWZXJzaW9uZWRQYXRoUmVmZXJlbmNlIGFzIFBhdGhSZWZlcmVuY2Vcbn0gZnJvbSAnLi9saWIvdmFsaWRhdG9ycyc7XG5cbmV4cG9ydCB7XG4gIHJlZmVyZW5jZUZyb21QYXJ0c1xufSBmcm9tICcuL2xpYi91dGlscyc7XG5cbmV4cG9ydCB7XG4gIEl0ZXJhdGlvbkl0ZW0sXG4gIEl0ZXJhdG9yLFxuICBJdGVyYWJsZSxcbiAgT3BhcXVlSXRlcmF0b3IsXG4gIE9wYXF1ZUl0ZXJhYmxlLFxuICBBYnN0cmFjdEl0ZXJhdG9yLFxuICBBYnN0cmFjdEl0ZXJhYmxlLFxuICBJdGVyYXRpb25BcnRpZmFjdHMsXG4gIFJlZmVyZW5jZUl0ZXJhdG9yLFxuICBJdGVyYXRvclN5bmNocm9uaXplcixcbiAgSXRlcmF0b3JTeW5jaHJvbml6ZXJEZWxlZ2F0ZVxufSBmcm9tICcuL2xpYi9pdGVyYWJsZSc7XG4iXX0= + enifed('glimmer-reference/lib/const', ['exports', 'glimmer-reference/lib/validators'], function (exports, _glimmerReferenceLibValidators) { 'use strict'; @@ -44040,7 +43930,7 @@ enifed('glimmer-reference/lib/const', ['exports', 'glimmer-reference/lib/validat return reference.tag === _glimmerReferenceLibValidators.CONSTANT_TAG; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2xpYi9jb25zdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztRQUdBLGNBQUE7QUFHRSxpQkFIRixjQUFBLENBR3dCLEtBQVEsRUFBQTtBQUFSLGdCQUFBLENBQUEsS0FBSyxHQUFMLEtBQUssQ0FBRztBQUZ2QixnQkFBQSxDQUFBLEdBQUcsa0NBSkgsWUFBWSxBQUltQixDQUFDO1NBRUo7O0FBSHJDLHNCQUFBLFdBS0UsS0FBSyxHQUFBLGlCQUFBO0FBQVEsbUJBQU8sSUFBSSxDQUFDLEtBQUssQ0FBQztTQUFFOztlQUxuQyxjQUFBOzs7OztBQVFBLGFBQUEsT0FBQSxDQUF3QixTQUFxQyxFQUFBO0FBQzNELGVBQU8sU0FBUyxDQUFDLEdBQUcsb0NBWmIsWUFBWSxBQVlrQixDQUFDO0tBQ3ZDIiwiZmlsZSI6ImNvbnN0LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQ09OU1RBTlRfVEFHLCBWZXJzaW9uZWRSZWZlcmVuY2UsIFJldmlzaW9uVGFnIH0gZnJvbSAnLi92YWxpZGF0b3JzJztcbmltcG9ydCB7IE9wYXF1ZSB9IGZyb20gJ2dsaW1tZXItdXRpbCc7XG5cbmV4cG9ydCBjbGFzcyBDb25zdFJlZmVyZW5jZTxUPiBpbXBsZW1lbnRzIFZlcnNpb25lZFJlZmVyZW5jZTxUPiB7XG4gIHB1YmxpYyB0YWc6IFJldmlzaW9uVGFnID0gQ09OU1RBTlRfVEFHO1xuXG4gIGNvbnN0cnVjdG9yKHByb3RlY3RlZCBpbm5lcjogVCkgeyB9XG5cbiAgdmFsdWUoKTogVCB7IHJldHVybiB0aGlzLmlubmVyOyB9XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBpc0NvbnN0KHJlZmVyZW5jZTogVmVyc2lvbmVkUmVmZXJlbmNlPE9wYXF1ZT4pOiBib29sZWFuIHtcbiAgcmV0dXJuIHJlZmVyZW5jZS50YWcgPT09IENPTlNUQU5UX1RBRztcbn1cbiJdfQ== + enifed("glimmer-reference/lib/iterable", ["exports", "glimmer-util"], function (exports, _glimmerUtil) { "use strict"; @@ -44316,11 +44206,11 @@ enifed("glimmer-reference/lib/iterable", ["exports", "glimmer-util"], function ( exports.IteratorSynchronizer = IteratorSynchronizer; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2xpYi9pdGVyYWJsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFrQ0EsUUFBQTs4QkFBQSxRQUFBOztBQU9FLGlCQVBGLFFBQUEsQ0FPYyxRQUF3QixFQUFFLE1BQTJCLEVBQUE7QUFDL0QsaUNBQU0sUUFBUSxDQUFDLGlCQUFpQixDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUM7QUFMckMsZ0JBQUEsQ0FBQSxRQUFRLEdBQVksS0FBSyxDQUFDO0FBQzFCLGdCQUFBLENBQUEsSUFBSSxHQUFZLEtBQUssQ0FBQztBQUszQixnQkFBSSxDQUFDLEdBQUcsR0FBRyxNQUFNLENBQUMsR0FBRyxDQUFDO0FBQ3RCLGdCQUFJLENBQUMsUUFBUSxHQUFHLFFBQVEsQ0FBQztBQUN6QixnQkFBSSxDQUFDLElBQUksR0FBRyxRQUFRLENBQUMsZ0JBQWdCLENBQUMsTUFBTSxDQUFDLENBQUM7U0FDL0M7O0FBWkgsZ0JBQUEsV0FjRSxNQUFNLEdBQUEsZ0JBQUMsSUFBeUIsRUFBQTtBQUM5QixnQkFBSSxDQUFDLFFBQVEsR0FBRyxJQUFJLENBQUM7QUFDckIsZ0JBQUksQ0FBQyxRQUFRLENBQUMsb0JBQW9CLENBQUMsSUFBSSxDQUFDLEtBQUssRUFBRSxJQUFJLENBQUMsQ0FBQztBQUNyRCxnQkFBSSxDQUFDLFFBQVEsQ0FBQyxtQkFBbUIsQ0FBQyxJQUFJLENBQUMsSUFBSSxFQUFFLElBQUksQ0FBQyxDQUFDO1NBQ3BEOztBQWxCSCxnQkFBQSxXQW9CRSxZQUFZLEdBQUEsd0JBQUE7QUFDVixtQkFBTyxDQUFD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G5vZGUgPSBhcnRpZmFjdHMuaW5zZXJ0QmVmb3JlKGl0ZW0sIGN1cnJlbnQpO1xuICAgIHRhcmdldC5pbnNlcnQobm9kZS5rZXksIG5vZGUudmFsdWUsIG5vZGUubWVtbywgY3VycmVudCA/IGN1cnJlbnQua2V5IDogbnVsbCk7XG4gIH1cblxuICBwcml2YXRlIHN0YXJ0UHJ1bmUoKTogUGhhc2Uge1xuICAgIHRoaXMuY3VycmVudCA9IHRoaXMuYXJ0aWZhY3RzLmhlYWQoKTtcbiAgICByZXR1cm4gUGhhc2UuUHJ1bmU7XG4gIH1cblxuICBwcml2YXRlIG5leHRQcnVuZSgpOiBQaGFzZSB7XG4gICAgbGV0IHsgYXJ0aWZhY3RzLCB0YXJnZXQsIGN1cnJlbnQgfSA9IHRoaXM7XG5cbiAgICBpZiAoY3VycmVudCA9PT0gbnVsbCkge1xuICAgICAgcmV0dXJuIFBoYXNlLkRvbmU7XG4gICAgfVxuXG4gICAgbGV0IG5vZGUgPSBjdXJyZW50O1xuICAgIHRoaXMuY3VycmVudCA9IGFydGlmYWN0cy5uZXh0Tm9kZShub2RlKTtcblxuICAgIGlmIChub2RlLnNob3VsZFJlbW92ZSgpKSB7XG4gICAgICBhcnRpZmFjdHMucmVtb3ZlKG5vZGUpO1xuICAgICAgdGFyZ2V0LmRlbGV0ZShub2RlLmtleSk7XG4gICAgfSBlbHNlIHtcbiAgICAgIG5vZGUucmVzZXQoKTtcbiAgICB9XG5cbiAgICByZXR1cm4gUGhhc2UuUHJ1bmU7XG4gIH1cblxuICBwcml2YXRlIG5leHREb25lKCkge1xuICAgIHRoaXMudGFyZ2V0LmRvbmUoKTtcbiAgfVxufVxuIl19 + enifed("glimmer-reference/lib/reference", ["exports"], function (exports) { "use strict"; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2xpYi9yZWZlcmVuY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJyZWZlcmVuY2UuanMiLCJzb3VyY2VzQ29udGVudCI6W119 + enifed("glimmer-reference/lib/utils", ["exports"], function (exports) { "use strict"; @@ -44334,7 +44224,7 @@ enifed("glimmer-reference/lib/utils", ["exports"], function (exports) { return reference; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2xpYi91dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUdBLGFBQUEsa0JBQUEsQ0FBbUMsSUFBb0MsRUFBRSxLQUFlLEVBQUE7QUFDdEYsWUFBSSxTQUFTLEdBQUcsSUFBSSxDQUFDO0FBRXJCLGFBQUssSUFBSSxDQUFDLEdBQUMsQ0FBQyxFQUFFLENBQUMsR0FBQyxLQUFLLENBQUMsTUFBTSxFQUFFLENBQUMsRUFBRSxFQUFFO0FBQ2pDLHFCQUFTLEdBQUcsU0FBUyxDQUFDLEdBQUcsQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztTQUNyQztBQUVELGVBQU8sU0FBUyxDQUFDO0tBQ2xCIiwiZmlsZSI6InV0aWxzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgVmVyc2lvbmVkUGF0aFJlZmVyZW5jZSB9IGZyb20gJy4vdmFsaWRhdG9ycyc7XG5pbXBvcnQgeyBPcGFxdWUgfSBmcm9tICdnbGltbWVyLXV0aWwnO1xuXG5leHBvcnQgZnVuY3Rpb24gcmVmZXJlbmNlRnJvbVBhcnRzKHJvb3Q6IFZlcnNpb25lZFBhdGhSZWZlcmVuY2U8T3BhcXVlPiwgcGFydHM6IHN0cmluZ1tdKTogVmVyc2lvbmVkUGF0aFJlZmVyZW5jZTxPcGFxdWU+IHtcbiAgbGV0IHJlZmVyZW5jZSA9IHJvb3Q7XG5cbiAgZm9yIChsZXQgaT0wOyBpPHBhcnRzLmxlbmd0aDsgaSsrKSB7XG4gICAgcmVmZXJlbmNlID0gcmVmZXJlbmNlLmdldChwYXJ0c1tpXSk7XG4gIH1cblxuICByZXR1cm4gcmVmZXJlbmNlO1xufVxuIl19 + enifed("glimmer-reference/lib/validators", ["exports"], function (exports) { "use strict"; @@ -44679,7 +44569,7 @@ enifed("glimmer-reference/lib/validators", ["exports"], function (exports) { return value !== NOT_MODIFIED; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2xpYi92YWxpZGF0b3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O0FBa0JPLFFBQU0sUUFBUSxHQUFhLENBQUMsQ0FBQzs7QUFDN0IsUUFBTSxPQUFPLEdBQWMsQ0FBQyxDQUFDOztBQUM3QixRQUFNLFFBQVEsR0FBYSxHQUFHLENBQUM7OztRQUV0QyxXQUFBO2lCQUFBLFdBQUE7O0FBQUEsbUJBQUEsV0FHRSxRQUFRLEdBQUEsa0JBQUMsUUFBa0IsRUFBQTtBQUN6QixtQkFBTyxJQUFJLENBQUMsS0FBSyxFQUFFLEtBQUssUUFBUSxDQUFDO1NBQ2xDOztlQUxILFdBQUE7Ozs7O0FBUUEsUUFBSSxTQUFTLEdBQUcsT0FBTyxDQUFDOztRQUV4QixZQUFBOzhCQUFBLFlBQUE7O0FBR0UsaUJBSEYsWUFBQSxHQUdrQztnQkFBcEIsUUFBUSx5REFBRyxTQUFTOztBQUM5QixtQ0FBTyxDQUFDO0FBQ1IsZ0JBQUksQ0FBQyxRQUFRLEdBQUcsUUFBUSxDQUFDO1NBQzFCOztBQU5ILG9CQUFBLFdBUUUsS0FBSyxHQUFBLGlCQUFBO0FBQ0gsbUJBQU8sSUFBSSxDQUFDLFFBQVEsQ0FBQztTQUN0Qjs7QUFWSCxvQkFBQSxXQVlFLEtBQUssR0FBQSxpQkFBQTtB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25zdCBOT1RfTU9ESUZJRUQ6IE5vdE1vZGlmaWVkID0gXCJhZGIzYjc4ZS0zZDIyLTRlNGItODc3YS02MzE3YzJjNWMxNDVcIjtcblxuZXhwb3J0IGZ1bmN0aW9uIGlzTW9kaWZpZWQ8VD4odmFsdWU6IFZhbGlkYXRpb248VD4pOiB2YWx1ZSBpcyBUIHtcbiAgcmV0dXJuIHZhbHVlICE9PSBOT1RfTU9ESUZJRUQ7XG59XG4iXX0= + enifed('glimmer-runtime/index', ['exports', 'glimmer-runtime/lib/dom/interfaces', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/template', 'glimmer-runtime/lib/symbol-table', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/syntax/core', 'glimmer-runtime/lib/compiled/opcodes/builder', 'glimmer-runtime/lib/compiler', 'glimmer-runtime/lib/opcode-builder', 'glimmer-runtime/lib/compiled/blocks', 'glimmer-runtime/lib/dom/attribute-managers', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/compiled/expressions/function', 'glimmer-runtime/lib/helpers/get-dynamic-var', 'glimmer-runtime/lib/syntax/builtins/with-dynamic-vars', 'glimmer-runtime/lib/syntax/builtins/in-element', 'glimmer-runtime/lib/vm', 'glimmer-runtime/lib/upsert', 'glimmer-runtime/lib/environment', 'glimmer-runtime/lib/partial', 'glimmer-runtime/lib/component/interfaces', 'glimmer-runtime/lib/modifier/interfaces', 'glimmer-runtime/lib/dom/helper', 'glimmer-runtime/lib/builder', 'glimmer-runtime/lib/bounds'], function (exports, _glimmerRuntimeLibDomInterfaces, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibTemplate, _glimmerRuntimeLibSymbolTable, _glimmerRuntimeLibReferences, _glimmerRuntimeLibSyntaxCore, _glimmerRuntimeLibCompiledOpcodesBuilder, _glimmerRuntimeLibCompiler, _glimmerRuntimeLibOpcodeBuilder, _glimmerRuntimeLibCompiledBlocks, _glimmerRuntimeLibDomAttributeManagers, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerRuntimeLibCompiledExpressions, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibCompiledExpressionsFunction, _glimmerRuntimeLibHelpersGetDynamicVar, _glimmerRuntimeLibSyntaxBuiltinsWithDynamicVars, _glimmerRuntimeLibSyntaxBuiltinsInElement, _glimmerRuntimeLibVm, _glimmerRuntimeLibUpsert, _glimmerRuntimeLibEnvironment, _glimmerRuntimeLibPartial, _glimmerRuntimeLibComponentInterfaces, _glimmerRuntimeLibModifierInterfaces, _glimmerRuntimeLibDomHelper, _glimmerRuntimeLibBuilder, _glimmerRuntimeLibBounds) { 'use strict'; @@ -44780,7 +44670,7 @@ enifed('glimmer-runtime/index', ['exports', 'glimmer-runtime/lib/dom/interfaces' exports.Bounds = _glimmerRuntimeLibBounds.default; exports.ConcreteBounds = _glimmerRuntimeLibBounds.ConcreteBounds; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7VUFDZSxnQkFBZ0IsNEJBQTdCLFNBQVM7VUFDSSxlQUFlLDRCQUE1QixTQUFTO1VBQ0ssZ0JBQWdCLDRCQUE5QixVQUFVO1VBQ0csZUFBZSw0QkFBNUIsU0FBUztVQUNULDBCQUEwQiw0QkFBMUIsMEJBQTBCO1VBQzFCLFlBQVksNEJBQVosWUFBWTtVQUNaLFdBQVcsNEJBQVgsV0FBVztVQUNYLFdBQVcsNEJBQVgsV0FBVztVQUdPLGVBQWUsOEJBQTFCLE9BQU87VUFBcUIsZUFBZSw4QkFBZixlQUFlO1VBQUUsUUFBUSw4QkFBUixRQUFRO1VBRTFDLFdBQVcsaUNBQXRCLE9BQU87VUFFUCxjQUFjLGdDQUFkLGNBQWM7VUFBRSxtQkFBbUIsZ0NBQ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CdWlsZGVyLFxuICBpc0NvbXBvbmVudERlZmluaXRpb25cbn0gZnJvbSAnLi9saWIvY29tcG9uZW50L2ludGVyZmFjZXMnO1xuXG5leHBvcnQge1xuICBNb2RpZmllck1hbmFnZXJcbn0gZnJvbSAnLi9saWIvbW9kaWZpZXIvaW50ZXJmYWNlcyc7XG5cbmV4cG9ydCB7IGRlZmF1bHQgYXMgRE9NQ2hhbmdlcywgRE9NQ2hhbmdlcyBhcyBJRE9NQ2hhbmdlcywgRE9NVHJlZUNvbnN0cnVjdGlvbiwgaXNXaGl0ZXNwYWNlLCBpbnNlcnRIVE1MQmVmb3JlIH0gZnJvbSAnLi9saWIvZG9tL2hlbHBlcic7XG5pbXBvcnQgICogYXMgU2ltcGxlIGZyb20gJy4vbGliL2RvbS9pbnRlcmZhY2VzJztcbmV4cG9ydCB7IFNpbXBsZSB9O1xuZXhwb3J0IHsgRWxlbWVudFN0YWNrLCBFbGVtZW50T3BlcmF0aW9ucyB9IGZyb20gJy4vbGliL2J1aWxkZXInO1xuZXhwb3J0IHsgZGVmYXVsdCBhcyBCb3VuZHMsIENvbmNyZXRlQm91bmRzIH0gZnJvbSAnLi9saWIvYm91bmRzJztcbiJdfQ== + enifed("glimmer-runtime/lib/bounds", ["exports"], function (exports) { "use strict"; @@ -44901,7 +44791,7 @@ enifed("glimmer-runtime/lib/bounds", ["exports"], function (exports) { return null; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvYm91bmRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O1FBVUEsTUFBQSxHQUNFLFNBREYsTUFBQSxDQUNxQixPQUF1QixFQUFTLFdBQXdCLEVBQUE7QUFBeEQsWUFBQSxDQUFBLE9BQU8sR0FBUCxPQUFPLENBQWdCO0FBQVMsWUFBQSxDQUFBLFdBQVcsR0FBWCxXQUFXLENBQWE7S0FBSTs7Ozt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uXG5leHBvcnQgZnVuY3Rpb24gbW92ZShib3VuZHM6IEJvdW5kcywgcmVmZXJlbmNlOiBTaW1wbGUuTm9kZSkge1xuICBsZXQgcGFyZW50ID0gYm91bmRzLnBhcmVudEVsZW1lbnQoKTtcbiAgbGV0IGZpcnN0ID0gYm91bmRzLmZpcnN0Tm9kZSgpO1xuICBsZXQgbGFzdCA9IGJvdW5kcy5sYXN0Tm9kZSgpO1xuXG4gIGxldCBub2RlID0gZmlyc3Q7XG5cbiAgd2hpbGUgKG5vZGUpIHtcbiAgICBsZXQgbmV4dCA9IG5vZGUubmV4dFNpYmxpbmc7XG4gICAgcGFyZW50Lmluc2VydEJlZm9yZShub2RlLCByZWZlcmVuY2UpO1xuICAgIGlmIChub2RlID09PSBsYXN0KSByZXR1cm4gbmV4dDtcbiAgICBub2RlID0gbmV4dDtcbiAgfVxuXG4gIHJldHVybiBudWxsO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gY2xlYXIoYm91bmRzOiBCb3VuZHMpOiBTaW1wbGUuTm9kZSB7XG4gIGxldCBwYXJlbnQgPSBib3VuZHMucGFyZW50RWxlbWVudCgpO1xuICBsZXQgZmlyc3QgPSBib3VuZHMuZmlyc3ROb2RlKCk7XG4gIGxldCBsYXN0ID0gYm91bmRzLmxhc3ROb2RlKCk7XG5cbiAgbGV0IG5vZGUgPSBmaXJzdDtcblxuICB3aGlsZSAobm9kZSkge1xuICAgIGxldCBuZXh0ID0gbm9kZS5uZXh0U2libGluZztcbiAgICBwYXJlbnQucmVtb3ZlQ2hpbGQobm9kZSk7XG4gICAgaWYgKG5vZGUgPT09IGxhc3QpIHJldHVybiBuZXh0O1xuICAgIG5vZGUgPSBuZXh0O1xuICB9XG5cbiAgcmV0dXJuIG51bGw7XG59XG4iXX0= + enifed('glimmer-runtime/lib/builder', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-util', 'glimmer-runtime/lib/compiled/opcodes/dom'], function (exports, _glimmerRuntimeLibBounds, _glimmerUtil, _glimmerRuntimeLibCompiledOpcodesDom) { 'use strict'; @@ -45290,7 +45180,7 @@ enifed('glimmer-runtime/lib/builder', ['exports', 'glimmer-runtime/lib/bounds', return BlockListTracker; })(); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvYnVpbGRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUE0QkEsS0FBQTtBQUNFLGlCQURGLEtBQUEsQ0FDc0IsSUFBVSxFQUFBO0FBQVYsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFNO1NBQUs7O0FBRHJDLGFBQUEsV0FHRSxTQUFTLEdBQUEscUJBQUE7QUFDUCxtQkFBTyxJQUFJLENBQUMsSUFBSSxDQUFDO1NBQ2xCOztlQUxILEtBQUE7OztRQVFBLElBQUE7QUFDRSxpQkFERixJQUFBLENBQ3NCLElBQVUsRUFBQTtBQUFWLGdCQUFBLENBQUEsSUFBSSxHQUFKLElBQUksQ0FBTTtTQUFLOztBQURyQyxZQUFBLFdBR0UsUUFBUSxHQUFBLG9CQUFBO0FBQ04sbUJBQU8sSUFBSSxDQUFDLElBQUksQ0FBQztTQUNsQjs7ZUFMSCxJQUFBOzs7UUFnQkEsUUFBQTtBQUdFLGlCQUhGLFFBQUEsQ0FHYyxNQUFjLEVBQUE7QUFDeEIsZ0JBQUksQ0FBQyxNQUFNLEdBQUcsTUFBTSxDQUFDO1NBQ3RCOztBQUxILGdCQUFBLFdBT0UsYUFBYSxHQUFBLHlCQUFBO0FBQ1gsbUJBQU8sSUFBSSxDQUFDLE1BQU0sQ0FBQyxhQUFhLEVBQUUsQ0FBQztTQUNwQzs7QUFUSCxnQkFBQSxXQVdFLFNBQVMsR0FBQSxxQkFBQTtBQUNQLG1CQUFPLElBQUksQ0FBQyxNQUFNLENBQUMsU0FBUyxFQUFFLENBQUM7U0FDaEM7O0FBYkgsZ0JBQUEsV0F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aXMuYm91bmRMaXN0LmhlYWQoKS5maXJzdE5vZGUoKTtcbiAgfVxuXG4gIGxhc3ROb2RlKCkge1xuICAgIHJldHVybiB0aGlzLmJvdW5kTGlzdC50YWlsKCkubGFzdE5vZGUoKTtcbiAgfVxuXG4gIG9wZW5FbGVtZW50KGVsZW1lbnQ6IEVsZW1lbnQpIHtcbiAgICBhc3NlcnQoZmFsc2UsICdDYW5ub3Qgb3BlbkVsZW1lbnQgZGlyZWN0bHkgaW5zaWRlIGEgYmxvY2sgbGlzdCcpO1xuICB9XG5cbiAgY2xvc2VFbGVtZW50KCkge1xuICAgIGFzc2VydChmYWxzZSwgJ0Nhbm5vdCBjbG9zZUVsZW1lbnQgZGlyZWN0bHkgaW5zaWRlIGEgYmxvY2sgbGlzdCcpO1xuICB9XG5cbiAgbmV3Tm9kZShub2RlOiBOb2RlKSB7XG4gICAgYXNzZXJ0KGZhbHNlLCAnQ2Fubm90IGNyZWF0ZSBhIG5ldyBub2RlIGRpcmVjdGx5IGluc2lkZSBhIGJsb2NrIGxpc3QnKTtcbiAgfVxuXG4gIG5ld0JvdW5kcyhib3VuZHM6IEJvdW5kcykge1xuICB9XG5cbiAgbmV3RGVzdHJveWFibGUoZDogRGVzdHJveWFibGUpIHtcbiAgfVxuXG4gIGZpbmFsaXplKHN0YWNrOiBFbGVtZW50U3RhY2spIHtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compat/inner-html-fix', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/dom/helper'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibDomHelper) { 'use strict'; @@ -45399,7 +45289,7 @@ enifed('glimmer-runtime/lib/compat/inner-html-fix', ['exports', 'glimmer-runtime return true; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGF0L2lubmVyLWh0bWwtZml4LnRzIl0sIm5hbWVzIjpbXS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GJvZHk+PC90Ym9keT4nO1xuICB9IGNhdGNoIChlKSB7XG4gIH0gZmluYWxseSB7XG4gICAgaWYgKHRhYmxlLmNoaWxkTm9kZXMubGVuZ3RoICE9PSAwKSB7XG4gICAgICAvLyBJdCB3b3JrZWQgYXMgZXhwZWN0ZWQsIG5vIGZpeCByZXF1aXJlZFxuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgfVxuXG4gIHJldHVybiB0cnVlO1xufVxuIl19 + enifed('glimmer-runtime/lib/compat/svg-inner-html-fix', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/dom/helper'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibDomHelper) { 'use strict'; @@ -45501,7 +45391,7 @@ enifed('glimmer-runtime/lib/compat/svg-inner-html-fix', ['exports', 'glimmer-run } } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGF0L3N2Zy1pbm5lci1odG1sLWZpeC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFHQSxRQUFNLGFBQWEsR0FBRyw0QkFBNEIsQ0FBQzs7Ozs7Ozs7Ozs7OztBQWFuRCxhQUFBLFVBQUEsQ0FBMkIsUUFBa0IsRUFBRSxlQUFrQyxFQUFFLFlBQW9CLEVBQUE7QUFDckcsWUFBSSxDQUFDLFFBQVEsRUFBRSxPQUFPLGVBQWUsQ0FBQztBQUV0QyxZQUFJLENBQUMsY0FBYyxDQUFDLFFBQVEsRUFBRSxZQUFZLENBQUMsRUFBRTtBQUMzQyxtQkFBTyxlQUFlLENBQUM7U0FDeEI7QUFFRCxZQUFJLEdBQUcsR0FBRyxRQUFRLENBQUMsYUFBYSxDQUFDLEtBQUssQ0FBQyxDQUFDO0FBRXhDO2tDQUFPLDZCQUFBOztxQkFBQSw2QkFBQTs7OztBQUFBLHlDQUFBLFdBQ0wsZ0JB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VyZW5jZSk7XG4gIHJldHVybiBuZXcgQ29uY3JldGVCb3VuZHMocGFyZW50LCBmaXJzdCwgbGFzdCk7XG59XG5cbmZ1bmN0aW9uIHNob3VsZEFwcGx5Rml4KGRvY3VtZW50LCBzdmdOYW1lc3BhY2UpIHtcbiAgbGV0IHN2ZyA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnROUyhzdmdOYW1lc3BhY2UsICdzdmcnKTtcblxuICB0cnkge1xuICAgIHN2Z1snaW5zZXJ0QWRqYWNlbnRIVE1MJ10oJ2JlZm9yZUVuZCcsICc8Y2lyY2xlPjwvY2lyY2xlPicpO1xuICB9IGNhdGNoIChlKSB7XG4gICAgLy8gSUUsIEVkZ2U6IFdpbGwgdGhyb3csIGluc2VydEFkamFjZW50SFRNTCBpcyB1bnN1cHBvcnRlZCBvbiBTVkdcbiAgICAvLyBTYWZhcmk6IFdpbGwgdGhyb3csIGluc2VydEFkamFjZW50SFRNTCBpcyBub3QgcHJlc2VudCBvbiBTVkdcbiAgfSBmaW5hbGx5IHtcbiAgICAvLyBGRjogT2xkIHZlcnNpb25zIHdpbGwgY3JlYXRlIGEgbm9kZSBpbiB0aGUgd3JvbmcgbmFtZXNwYWNlXG4gICAgaWYgKHN2Zy5jaGlsZE5vZGVzLmxlbmd0aCA9PT0gMSAmJiBzdmcuZmlyc3RDaGlsZC5uYW1lc3BhY2VVUkkgPT09IFNWR19OQU1FU1BBQ0UpIHtcbiAgICAgIC8vIFRoZSB0ZXN0IHdvcmtlZCBhcyBleHBlY3RlZCwgbm8gZml4IHJlcXVpcmVkXG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICAgIHN2ZyA9IG51bGw7XG5cbiAgICByZXR1cm4gdHJ1ZTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compat/text-node-merging-fix', ['exports'], function (exports) { // Patch: Adjacent text node merging fix // Browsers: IE, Edge, Firefox w/o inspector open @@ -45601,7 +45491,7 @@ enifed('glimmer-runtime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JlbnQsIGh0bWwsIHJlZmVyZW5jZSk7XG5cbiAgICAgIGlmIChkaWRTZXRVc2VsZXNzQ29tbWVudCkge1xuICAgICAgICBwYXJlbnQucmVtb3ZlQ2hpbGQodGhpcy51c2VsZXNzQ29tbWVudCk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBib3VuZHM7XG4gICAgfVxuICB9O1xufVxuXG5mdW5jdGlvbiBzaG91bGRBcHBseUZpeChkb2N1bWVudCkge1xuICBsZXQgbWVyZ2luZ1RleHREaXYgPSA8SFRNTEVsZW1lbnQ+IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2RpdicpO1xuXG4gIG1lcmdpbmdUZXh0RGl2LmlubmVySFRNTCA9ICdmaXJzdCc7XG4gIG1lcmdpbmdUZXh0RGl2Lmluc2VydEFkamFjZW50SFRNTCgnYmVmb3JlRW5kJywgJ3NlY29uZCcpO1xuXG4gIGlmIChtZXJnaW5nVGV4dERpdi5jaGlsZE5vZGVzLmxlbmd0aCA9PT0gMikge1xuICAgIG1lcmdpbmdUZXh0RGl2ID0gbnVsbDtcbiAgICAvLyBJdCB3b3JrZWQgYXMgZXhwZWN0ZWQsIG5vIGZpeCByZXF1aXJlZFxuICAgIHJldHVybiBmYWxzZTtcbiAgfVxuXG4gIG1lcmdpbmdUZXh0RGl2ID0gbnVsbDtcblxuICByZXR1cm4gdHJ1ZTtcbn1cbiJdfQ== + enifed('glimmer-runtime/lib/compiled/blocks', ['exports', 'glimmer-runtime/lib/utils', 'glimmer-runtime/lib/compiler'], function (exports, _glimmerRuntimeLibUtils, _glimmerRuntimeLibCompiler) { 'use strict'; @@ -45707,7 +45597,7 @@ enifed('glimmer-runtime/lib/compiled/blocks', ['exports', 'glimmer-runtime/lib/u exports.Layout = Layout; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvYmxvY2tzLnRzIl0sIm5hbWV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5kcyBUb3BMZXZlbFRlbXBsYXRlIHtcbiAgY29tcGlsZShlbnY6IEVudmlyb25tZW50KSB7XG4gICAgbGV0IGNvbXBpbGVkID0gdGhpcy5jb21waWxlZDtcbiAgICBpZiAoY29tcGlsZWQpIHJldHVybiBjb21waWxlZDtcblxuICAgIGxldCBvcHMgPSBuZXcgRW50cnlQb2ludENvbXBpbGVyKHRoaXMsIGVudikuY29tcGlsZSgpO1xuICAgIHJldHVybiB0aGlzLmNvbXBpbGVkID0gbmV3IENvbXBpbGVkQmxvY2sob3BzLCB0aGlzLnN5bWJvbFRhYmxlLnNpemUpO1xuICB9XG59XG5cbmV4cG9ydCBjbGFzcyBMYXlvdXQgZXh0ZW5kcyBUb3BMZXZlbFRlbXBsYXRlIHtcbiAgcHVibGljIGhhc05hbWVkUGFyYW1ldGVyczogYm9vbGVhbjtcbiAgcHVibGljIGhhc1lpZWxkczogYm9vbGVhbjtcbiAgY29uc3RydWN0b3IocHJvZ3JhbTogUHJvZ3JhbSwgc3ltYm9sVGFibGU6IFN5bWJvbFRhYmxlLCBwdWJsaWMgbmFtZWQ6IHN0cmluZ1tdLCBwdWJsaWMgeWllbGRzOiBzdHJpbmdbXSwgcHVibGljIGhhc1BhcnRpYWxzOiBib29sZWFuKSB7XG4gICAgc3VwZXIocHJvZ3JhbSwgc3ltYm9sVGFibGUpO1xuICAgIHRoaXMuaGFzTmFtZWRQYXJhbWV0ZXJzID0gISF0aGlzLm5hbWVkLmxlbmd0aDtcbiAgICB0aGlzLmhhc1lpZWxkcyA9ICEhdGhpcy55aWVsZHMubGVuZ3RoOztcbiAgfVxufVxuIl19 + enifed("glimmer-runtime/lib/compiled/expressions", ["exports"], function (exports) { "use strict"; @@ -45723,7 +45613,7 @@ enifed("glimmer-runtime/lib/compiled/expressions", ["exports"], function (export exports.CompiledExpression = CompiledExpression; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBR0Esa0JBQUE7aUJBQUEsa0JBQUE7O0FBQUEsMEJBQUEsV0FJRSxNQUFNLEdBQUEsa0JBQUE7QUFDSixnQ0FBa0IsSUFBSSxDQUFDLElBQUksQ0FBQyxXQUFXLEVBQUUsQ0FBRztTQUM3Qzs7ZUFOSCxrQkFBQSIsImZpbGUiOiJleHByZXNzaW9ucy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBWTSBmcm9tICcuLi92bS9hcHBlbmQnO1xuaW1wb3J0IHsgUGF0aFJlZmVyZW5jZSB9IGZyb20gJ2dsaW1tZXItcmVmZXJlbmNlJztcblxuZXhwb3J0IGFic3RyYWN0IGNsYXNzIENvbXBpbGVkRXhwcmVzc2lvbjxUPiB7XG4gIHR5cGU6IHN0cmluZztcbiAgYWJzdHJhY3QgZXZhbHVhdGUodm06IFZNKTogUGF0aFJlZmVyZW5jZTxUPjtcblxuICB0b0pTT04oKTogc3RyaW5nIHtcbiAgICByZXR1cm4gYFVOSU1QTDogJHt0aGlzLnR5cGUudG9VcHBlckNhc2UoKX1gO1xuICB9XG59XG4iXX0= + enifed('glimmer-runtime/lib/compiled/expressions/args', ['exports', 'glimmer-runtime/lib/compiled/expressions/positional-args', 'glimmer-runtime/lib/compiled/expressions/named-args', 'glimmer-runtime/lib/syntax/core', 'glimmer-reference'], function (exports, _glimmerRuntimeLibCompiledExpressionsPositionalArgs, _glimmerRuntimeLibCompiledExpressionsNamedArgs, _glimmerRuntimeLibSyntaxCore, _glimmerReference) { 'use strict'; @@ -45812,7 +45702,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/args', ['exports', 'glimmer-run exports.CompiledNamedArgs = _glimmerRuntimeLibCompiledExpressionsNamedArgs.CompiledNamedArgs; exports.EvaluatedNamedArgs = _glimmerRuntimeLibCompiledExpressionsNamedArgs.EvaluatedNamedArgs; });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7IENvbXBpbGVkUG9zaXRpb25hbEFyZ3MsIEV2YWx1YXRlZFBvc2l0aW9uYWxBcmdzLCBDb21waWxlZE5hbWVkQXJncywgRXZhbHVhdGVkTmFtZWRBcmdzIH07XG4iXX0= + enifed("glimmer-runtime/lib/compiled/expressions/concat", ["exports", "glimmer-reference"], function (exports, _glimmerReference) { "use strict"; @@ -45874,7 +45764,7 @@ enifed("glimmer-runtime/lib/compiled/expressions/concat", ["exports", "glimmer-r return String(value); } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvY29uY2F0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQU1BLGNBQUE7QUFHRSxpQkFIRixjQUFBLENBR3NCLEtBQW1DLEVBQUE7QUFBbkMsZ0JBQUEsQ0FBQSxLQUFLLEdBQUwsS0FBSyxDQUE4QjtBQUZoRCxnQkFBQSxDQUFBLElBQUksR0FBRyxRQUFRLENBQUM7U0FFb0M7O0FBSDdELHNCQUFBLFdBS0UsUUFBUSxHQUFBLGtCQUFDLEVBQU0sRUFBQTtBQUNiLGdCQUFJLEtBQUssR0FBNEIsSUFBSSxLQUFLLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQztBQUNsRSxpQkFBSyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUMsTUFBTSxFQUFFLENBQUMsRUFBRSxFQUFFO0FBQzFDLHFCQUFLLENBQUMsQ0FBQyxDQUFDLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxRQUFRLENBQUMsRUFBRSxDQUFDLENBQUM7YUFDdkM7QUFDRCxtQkFBTyxJQUFJLGVBQWUsQ0FBQyxLQUFLLENBQUMsQ0FBQztTQUNu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N5IHZhbHVlcyB0byBzdHJpbmdzJz47XG4gICAgICB9XG4gICAgfVxuXG4gICAgaWYgKHBhcnRzLmxlbmd0aCA+IDApIHtcbiAgICAgIHJldHVybiBwYXJ0cy5qb2luKCcnKTtcbiAgICB9XG5cbiAgICByZXR1cm4gbnVsbDtcbiAgfVxufVxuXG5mdW5jdGlvbiBjYXN0VG9TdHJpbmcodmFsdWUpIHtcbiAgaWYgKHR5cGVvZiB2YWx1ZVsndG9TdHJpbmcnXSAhPT0gJ2Z1bmN0aW9uJykge1xuICAgIHJldHVybiAnJztcbiAgfVxuXG4gIHJldHVybiBTdHJpbmcodmFsdWUpO1xufVxuIl19 + enifed('glimmer-runtime/lib/compiled/expressions/function', ['exports', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/compiled/expressions'], function (exports, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibCompiledExpressions) { 'use strict'; @@ -45931,7 +45821,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/function', ['exports', 'glimmer return CompiledFunctionExpression; })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvZnVuY3Rpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O3NCQVFBLElBQUE7O0FBQUEsYUFBQSxJQUFBLENBQWdDLElBQTJCLEVBQUE7QUFDekQsZUFBTyxJQUFJLHdCQUF3QixDQUFDLElBQUksQ0FBQyxDQUFDO0tBQzNDOztRQUVELHdCQUFBOzhCQUFBLHdCQUFBOztBQUlFLGlCQUpGLHdCQUFBLENBSWMsSUFBMkIsRUFBQTtBQUNyQyx3Q0FBTyxDQUFDO0FBSkgsZ0JBQUEsQ0FBQSxJQUFJLEdBQUcscUJBQXFCLENBQUM7QUFLbEMsZ0JBQUksQ0FBQyxJQUFJLEdBQU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UYWJsZTogU3ltYm9sVGFibGUpOiBDb21waWxlZEV4cHJlc3Npb248VD4ge1xuICAgIHJldHVybiBuZXcgQ29tcGlsZWRGdW5jdGlvbkV4cHJlc3Npb24odGhpcy5mdW5jLCBzeW1ib2xUYWJsZSk7XG4gIH1cbn1cblxuY2xhc3MgQ29tcGlsZWRGdW5jdGlvbkV4cHJlc3Npb248VD4gZXh0ZW5kcyBDb21waWxlZEV4cHJlc3Npb248VD4ge1xuICBwdWJsaWMgdHlwZSA9IFwiZnVuY3Rpb25cIjtcblxuICBjb25zdHJ1Y3Rvcihwcml2YXRlIGZ1bmM6IEZ1bmN0aW9uRXhwcmVzc2lvbjxUPiwgcHJpdmF0ZSBzeW1ib2xUYWJsZTogU3ltYm9sVGFibGUpIHtcbiAgICBzdXBlcigpO1xuICAgIHRoaXMuZnVuYyA9IGZ1bmM7XG4gIH1cblxuICBldmFsdWF0ZSh2bTogVk0pOiBQYXRoUmVmZXJlbmNlPFQ+IHtcbiAgICBsZXQgeyBmdW5jLCBzeW1ib2xUYWJsZSB9ID0gdGhpcztcbiAgICByZXR1cm4gZnVuYyh2bSwgc3ltYm9sVGFibGUpO1xuICB9XG5cbiAgdG9KU09OKCk6IHN0cmluZyB7XG4gICAgbGV0IHsgZnVuYyB9ID0gdGhpcztcblxuICAgIGlmIChmdW5jLm5hbWUpIHtcbiAgICAgIHJldHVybiBgXFxgJHtmdW5jLm5hbWV9KC4uLilcXGBgO1xuICAgIH0gZWxzZSB7XG4gICAgICByZXR1cm4gXCJgZnVuYyguLi4pYFwiO1xuICAgIH1cbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compiled/expressions/has-block', ['exports', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-runtime/lib/references'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerRuntimeLibReferences) { 'use strict'; @@ -46023,7 +45913,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/has-block', ['exports', 'glimme exports.CompiledInPartialGetBlock = Comp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xhc3MgQ29tcGlsZWRHZXRCbG9ja0J5U3ltYm9sIGltcGxlbWVudHMgQ29tcGlsZWRHZXRCbG9jayB7XG4gIGNvbnN0cnVjdG9yKHByaXZhdGUgc3ltYm9sOiBudW1iZXIsIHByaXZhdGUgZGVidWc6IHN0cmluZykge1xuICB9XG5cbiAgZXZhbHVhdGUodm06IFZNKTogSW5saW5lQmxvY2sge1xuICAgIHJldHVybiB2bS5zY29wZSgpLmdldEJsb2NrKHRoaXMuc3ltYm9sKTtcbiAgfVxuXG4gIHRvSlNPTigpOiBzdHJpbmcge1xuICAgIHJldHVybiBgZ2V0LWJsb2NrKCQke3RoaXMuc3ltYm9sfSgke3RoaXMuZGVidWd9KSlgO1xuICB9XG59XG5cbmV4cG9ydCBjbGFzcyBDb21waWxlZEluUGFydGlhbEdldEJsb2NrIGltcGxlbWVudHMgQ29tcGlsZWRHZXRCbG9jayB7XG4gIGNvbnN0cnVjdG9yKHByaXZhdGUgc3ltYm9sOiBudW1iZXIsIHByaXZhdGUgbmFtZTogc3RyaW5nKSB7XG4gIH1cblxuICBldmFsdWF0ZSh2bTogVk0pOiBJbmxpbmVCbG9jayB7XG4gICAgbGV0IHsgc3ltYm9sLCBuYW1lIH0gPSB0aGlzO1xuICAgIGxldCBhcmdzID0gdm0uc2NvcGUoKS5nZXRQYXJ0aWFsQXJncyhzeW1ib2wpO1xuICAgIHJldHVybiBhcmdzLmJsb2Nrc1tuYW1lXTtcbiAgfVxuXG4gIHRvSlNPTigpOiBzdHJpbmcge1xuICAgIHJldHVybiBgZ2V0LWJsb2NrKCQke3RoaXMuc3ltYm9sfSgkQVJHUykuJHt0aGlzLm5hbWV9KSlgO1xuICB9XG59XG4iXX0= + enifed('glimmer-runtime/lib/compiled/expressions/helper', ['exports', 'glimmer-runtime/lib/compiled/expressions'], function (exports, _glimmerRuntimeLibCompiledExpressions) { 'use strict'; @@ -46054,7 +45944,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/helper', ['exports', 'glimmer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er-runtime/lib/compiled/expressions', 'glimmer-reference'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerReference) { 'use strict'; @@ -46160,7 +46050,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/lookups', ['exports', 'glimmer- exports.CompiledInPartialName = CompiledInPartialName; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvbG9va3Vwcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFNQSxjQUFBOzhCQUFBLGNBQUE7O0FBV0UsaUJBWEYsY0FBQSxDQVlZLElBQWdDLEVBQ2hDLElBQWMsRUFBQTtBQUV0QiwwQ0FBTyxDQUFDO0FBSEEsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUE0QjtBQUNoQyxnQkFBQSxDQUFBLElBQUksR0FBSixJQUFJLENBQVU7QUFaakIsZ0JBQUEsQ0FBQSxJQUFJLEdBQUcsUUFBUSxDQUFDO1NBZXRCOztBQWhCSCxzQkFBQSxDQUdTLE1BQU0sR0FBQSxnQkFBQyxJQUFnQyxFQUFFLElBQWMsRUFBQTtBQUM1RCxnQkFBSSxJQUFJLENBQUMsTUFBTSxLQUFLLENBQUMsRUFBRTtBQUNyQix1QkFBTyxJQUFJLENBQUM7YUFDYixNQUFNO0FBQ0wsdUJBQU8sSUFBSSxJQUFJLENBQUMsSUFBSSxFQUFFLElBQUksQ0FBQyxDQUFDO2FBQzdCO1NBQ0Y7O0FBVEgsc0JBQUEsV0FrQkUsUUFBUSxHQUFBLGtCQUFDLEVBQU0sRUFBQTtnQkFDUCxJQUFJLEdBQVcsSUFBSSxDQUFuQixJQUFJO2dCQUFFLElBQUksR0FBSyxJQUFJLENBQWIsSUFBSTs7QUFDaEIsbUJBQU8sa0JBdEJGLGtCQUFrQixDQXNCRyxJQUFJLENBQUMsUUFBUSxDQUF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VJHUykuJHt0aGlzLm5hbWV9YDtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compiled/expressions/named-args', ['exports', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/utils', 'glimmer-reference', 'glimmer-util'], function (exports, _glimmerRuntimeLibReferences, _glimmerRuntimeLibUtils, _glimmerReference, _glimmerUtil) { 'use strict'; @@ -46336,7 +46226,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/named-args', ['exports', 'glimm })(EvaluatedNamedArgs))(); exports.EVALUATED_EMPTY_NAMED_ARGS = EVALUATED_EMPTY_NAMED_ARGS; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvbmFtZWQtYXJncy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFPQSxpQkFBQTtBQXdCRSxpQkF4QkYsaUJBQUEsQ0F5QlcsSUFBYyxFQUNkLE1BQW9DLEVBQUE7QUFEcEMsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFVO0FBQ2QsZ0JBQUEsQ0FBQSxNQUFNLEdBQU4sTUFBTSxDQUE4QjtBQUUzQyxnQkFBSSxDQUFDLE1BQU0sR0FBRyxJQUFJLENBQUMsTUFBTSxDQUFDO0FBQzFCLHlCQS9CbUIsTUFBTSxDQStCbEIsSUFBSSxDQUFDLE1BQU0sS0FBSyxNQUFNLENBQUMsTUFBTSxFQUFFLDZDQUE2QyxDQUFDLENBQUM7U0FDdEY7O0FBOUJILHlCQUFBLENBQ1MsS0FBSyxHQUFBLGlCQUFBO0FBQ1YsbUJBQU8seUJBQXlCLENBQUM7U0FDbEM7O0FBSEgseUJBQUEsQ0FLUyxNQUFNLEdBQUEsZ0JBQUMsR0FBcUMsRUFBQTtBQUNqRCxnQkFBSSxJQUFJLEdBQUcsTUFBTSxDQUFDLElBQUksQ0FBQy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AgIHJldHVybiB0aGlzLmtleXMuaW5kZXhPZihrZXkpICE9PSAtMTtcbiAgfVxuXG4gIHZhbHVlKCk6IERpY3Q8T3BhcXVlPiB7XG4gICAgbGV0IHsga2V5cywgdmFsdWVzIH0gPSB0aGlzO1xuXG4gICAgbGV0IG91dCA9IGRpY3Q8T3BhcXVlPigpO1xuXG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICBsZXQga2V5ID0ga2V5c1tpXTtcbiAgICAgIGxldCByZWYgPSB2YWx1ZXNbaV07XG4gICAgICBvdXRba2V5XSA9IHJlZi52YWx1ZSgpO1xuICAgIH1cblxuICAgIHJldHVybiBvdXQ7XG4gIH1cbn1cblxuZXhwb3J0IGNvbnN0IEVWQUxVQVRFRF9FTVBUWV9OQU1FRF9BUkdTOiBFdmFsdWF0ZWROYW1lZEFyZ3MgPSBuZXcgKGNsYXNzIGV4dGVuZHMgRXZhbHVhdGVkTmFtZWRBcmdzIHtcbiAgY29uc3RydWN0b3IoKSB7XG4gICAgc3VwZXIoRU1QVFlfQVJSQVksIEVNUFRZX0FSUkFZLCBFTVBUWV9ESUNUKTtcbiAgfVxuXG4gIGdldCgpOiBQYXRoUmVmZXJlbmNlPE9wYXF1ZT4ge1xuICAgIHJldHVybiBVTkRFRklORURfUkVGRVJFTkNFO1xuICB9XG5cbiAgaGFzKGtleTogc3RyaW5nKTogYm9vbGVhbiB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG5cbiAgdmFsdWUoKTogRGljdDxPcGFxdWU+IHtcbiAgICByZXR1cm4gRU1QVFlfRElDVDtcbiAgfVxufSk7XG4iXX0= + enifed('glimmer-runtime/lib/compiled/expressions/positional-args', ['exports', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/utils', 'glimmer-reference'], function (exports, _glimmerRuntimeLibReferences, _glimmerRuntimeLibUtils, _glimmerReference) { 'use strict'; @@ -46454,7 +46344,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/positional-args', ['exports', ' })(EvaluatedPositionalArgs))(); exports.EVALUATED_EMPTY_POSITIONAL_ARGS = EVALUATED_EMPTY_POSITIONAL_ARGS; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvcG9zaXRpb25hbC1hcmdzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQU9BLHNCQUFBO0FBZUUsaUJBZkYsc0JBQUEsQ0FlcUIsTUFBb0MsRUFBQTtBQUFwQyxnQkFBQSxDQUFBLE1BQU0sR0FBTixNQUFNLENBQThCO0FBQ3JELGdCQUFJLENBQUMsTUFBTSxHQUFHLE1BQU0sQ0FBQyxNQUFNLENBQUM7U0FDN0I7O0FBakJILDhCQUFBLENBQ1MsTUFBTSxHQUFBLGdCQUFDLE1BQW9DLEVBQUE7QUFDaEQsZ0JBQUksTUFBTSxDQUFDLE1BQU0sRUFBRTtBQUNqQix1QkFBTyxJQUFJLElBQUksQ0FBQyxNQUFNLENBQUMsQ0FBQzthQUN6QixNQUFNO0FBQ0wsdUJBQU8sOEJBQThCLENBQUM7YUFDdkM7U0FDRjs7QUFQSCw4QkFBQSxDQVNTLEtBQUssR0FBQSxpQkFBQTtBQUNWLG1CQUFPLDhCQUE4QixDQUFDO1NBQ3ZDOztBQVhILDhCQUFBLFdBbUJFLFFBQVEsR0FBQSxrQkFBQyxFQUFNLEVBQUE7Z0JBQ1AsTUFBTSxHQUFhLElBQUksQ0FBdkIsTUFBTTtnQkFBRSxNQUFNLEdBQUssSUFBSSxDQUFmLE1BQU07O0FBQ3BCLGdCQUFJLFVBQVUsR0FBNEIsSUFBSSxLQUFLLENBQUMsTUFBTSxDQUFDLENBQUM7QUFFNUQsaUJBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsR0FBRyxNQUFNLEVBQU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1cblxuZXhwb3J0IGNvbnN0IEVWQUxVQVRFRF9FTVBUWV9QT1NJVElPTkFMX0FSR1M6IEV2YWx1YXRlZFBvc2l0aW9uYWxBcmdzID0gbmV3IChjbGFzcyBleHRlbmRzIEV2YWx1YXRlZFBvc2l0aW9uYWxBcmdzIHtcbiAgY29uc3RydWN0b3IoKSB7XG4gICAgc3VwZXIoRU1QVFlfQVJSQVkpO1xuICB9XG5cbiAgYXQoKTogUGF0aFJlZmVyZW5jZTxPcGFxdWU+IHtcbiAgICByZXR1cm4gVU5ERUZJTkVEX1JFRkVSRU5DRTtcbiAgfVxuXG4gIHZhbHVlKCk6IE9wYXF1ZVtdIHtcbiAgICByZXR1cm4gdGhpcy52YWx1ZXM7XG4gIH1cbn0pO1xuIl19 + enifed('glimmer-runtime/lib/compiled/expressions/value', ['exports', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-runtime/lib/references'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerRuntimeLibReferences) { 'use strict'; @@ -46480,7 +46370,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/value', ['exports', 'glimmer-ru exports.default = CompiledValue; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvdmFsdWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBSUEsYUFBQTs4QkFBQSxhQUFBOztBQUlFLGlCQUpGLGFBQUEsQ0FJYyxLQUFRLEVBQUE7QUFDbEIsMENBQU8sQ0FBQztBQUpILGdCQUFBLENBQUEsSUFBSSxHQUFHLE9BQU8sQ0FBQztBQUtwQixnQkFBSSxDQUFDLFNBQVMsR0FBRyw2QkFSRCxrQkFBa0IsQ0FRRSxNQUFNLENBQUMsS0FBWSxDQUFDLENBQUM7U0FDMUQ7O0FBUEgscUJBQUEsV0FTRSxRQUFRLEdBQUEsa0JBQUMsR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WZ5KHRoaXMucmVmZXJlbmNlLnZhbHVlKCkpO1xuICB9XG59XG4iXX0= + enifed('glimmer-runtime/lib/compiled/opcodes/builder', ['exports', 'glimmer-runtime/lib/compiled/opcodes/component', 'glimmer-runtime/lib/compiled/opcodes/partial', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-runtime/lib/compiled/opcodes/dom', 'glimmer-runtime/lib/compiled/opcodes/lists', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-util', 'glimmer-runtime/lib/utils'], function (exports, _glimmerRuntimeLibCompiledOpcodesComponent, _glimmerRuntimeLibCompiledOpcodesPartial, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerRuntimeLibCompiledOpcodesDom, _glimmerRuntimeLibCompiledOpcodesLists, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerUtil, _glimmerRuntimeLibUtils) { 'use strict'; @@ -46885,7 +46775,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/builder', ['exports', 'glimmer-runt exports.default = OpcodeBuilder; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy9idWlsZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQXlCQSwrQkFBQTtBQUVFLGlCQUZGLCtCQUFBLENBRXdCLEtBQWlDLEVBQUE7QUFBakMsZ0JBQUEsQ0FBQSxLQUFLLEdBQUwsS0FBSyxDQUE0QjtTQUFJOztBQUY3RCx1Q0FBQSxXQVFFLE9BQU8sR0FBQSxtQkFBQTtBQUNMLG1CQUFPLElBQUksQ0FBQyxLQUFLLENBQUMsT0FBTyxFQUFFLENBQUM7U0FDN0I7O0FBVkgsdUNBQUEsV0FZRSxNQUFNLEdBQUEsZ0JBQW1CLE1BQVMsRUFBQTtBQUNoQyxnQkFBSSxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsTUFBTSx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QnVpbGRlcikgPT4gdm9pZCkge1xuICAgIHRoaXMuc3RhcnRMYWJlbHMoKTtcbiAgICBjYWxsYmFjayh0aGlzKTtcbiAgICB0aGlzLnN0b3BMYWJlbHMoKTtcbiAgfVxufVxuXG5leHBvcnQgdHlwZSBCbG9ja0NhbGxiYWNrID0gKGRzbDogT3Bjb2RlQnVpbGRlciwgQkVHSU46IExhYmVsLCBFTkQ6IExhYmVsKSA9PiB2b2lkO1xuIl19 + enifed('glimmer-runtime/lib/compiled/opcodes/component', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-reference'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerReference) { 'use strict'; @@ -47163,7 +47053,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/component', ['exports', 'glimmer-ru exports.CloseComponentOpcode = CloseComponentOpcode; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy9jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBVUEsbUNBQUE7OEJBQUEsbUNBQUE7O0FBQUEsaUJBQUEsbUNBQUEsR0FBQTtBQUF5RCxnQ0FBQSxTQUFBLENBQUEsQ0FBTTtBQUN0RCxnQkFBQSxDQUFBLElBQUksR0FBRyxrQ0FBa0MsQ0FBQztTQXFCbEQ7O0FBdEJELDJDQUFBLFdBR0UsUUFBUSxHQUFBLGtCQUFDLEVBQU0sRUFBQTtBQUNiLGdCQUFJLFNBQVMsR0FBRyxFQUFFLENBQUMsS0FBSyxDQUFDLFVBQVUsRUFBa0MsQ0FBQztBQUN0RSxnQkFBSSxLQUFLLEdBQUcsa0JBUitDLE9BQU8sQ0FROUMsU0FBUyxDQUFDLEdBQUcsU0FBUyxHQUFHLHNCQVJYLGNBQWMsQ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IFVwZGF0aW5nVk0pIHtcbiAgICBsZXQgeyBtYW5hZ2VyLCBjb21wb25lbnQsIGJvdW5kcyB9ID0gdGhpcztcblxuICAgIG1hbmFnZXIuZGlkVXBkYXRlTGF5b3V0KGNvbXBvbmVudCwgYm91bmRzKTtcblxuICAgIHZtLmVudi5kaWRVcGRhdGUoY29tcG9uZW50LCBtYW5hZ2VyKTtcbiAgfVxufVxuXG5leHBvcnQgY2xhc3MgQ2xvc2VDb21wb25lbnRPcGNvZGUgZXh0ZW5kcyBPcGNvZGUge1xuICBwdWJsaWMgdHlwZSA9IFwiY2xvc2UtY29tcG9uZW50XCI7XG5cbiAgZXZhbHVhdGUodm06IFZNKSB7XG4gICAgdm0ucG9wU2NvcGUoKTtcbiAgICB2bS5wb3BEeW5hbWljU2NvcGUoKTtcbiAgICB2bS5jb21taXRDYWNoZUdyb3VwKCk7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/compiled/opcodes/content', ['exports', 'glimmer-runtime/lib/upsert', 'glimmer-runtime/lib/component/interfaces', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/vm/update', 'glimmer-reference', 'glimmer-util', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/builder', 'glimmer-runtime/lib/compiler', 'glimmer-runtime/lib/compiled/opcodes/builder', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/syntax/core'], function (exports, _glimmerRuntimeLibUpsert, _glimmerRuntimeLibComponentInterfaces, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibVmUpdate, _glimmerReference, _glimmerUtil, _glimmerRuntimeLibBounds, _glimmerRuntimeLibBuilder, _glimmerRuntimeLibCompiler, _glimmerRuntimeLibCompiledOpcodesBuilder, _glimmerRuntimeLibReferences, _glimmerRuntimeLibSyntaxCore) { 'use strict'; @@ -47691,7 +47581,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/content', ['exports', 'glimmer-runt return GuardedTrustingUpdateOpcode; })(GuardedUpdateOpcode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GNhY2hlOiBSZWZlcmVuY2VDYWNoZTxUcnVzdGluZ0luc2VydGlvbj4sIGJvdW5kczogRnJhZ21lbnQsIHVwc2VydDogVXBzZXJ0KTogVXBkYXRpbmdPcGNvZGUge1xuICAgIHJldHVybiBuZXcgR3VhcmRlZFRydXN0aW5nVXBkYXRlT3Bjb2RlKHJlZmVyZW5jZSwgY2FjaGUsIGJvdW5kcywgdXBzZXJ0LCB0aGlzLCB2bS5jYXB0dXJlKCkpO1xuICB9XG59XG5cbmNsYXNzIEd1YXJkZWRUcnVzdGluZ1VwZGF0ZU9wY29kZSBleHRlbmRzIEd1YXJkZWRVcGRhdGVPcGNvZGU8VHJ1c3RpbmdJbnNlcnRpb24+IHtcbiAgdHlwZSA9ICd0cnVzdGluZy11cGRhdGUnO1xuXG4gIHByb3RlY3RlZCBpbnNlcnQoZG9tOiBET01UcmVlQ29uc3RydWN0aW9uLCBjdXJzb3I6IEN1cnNvciwgdmFsdWU6IFRydXN0aW5nSW5zZXJ0aW9uKTogVXBzZXJ0IHtcbiAgICByZXR1cm4gdHJ1c3RpbmdJbnNlcnQoZG9tLCBjdXJzb3IsIHZhbHVlKTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compiled/opcodes/dom', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/compiled/opcodes/vm'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibReferences, _glimmerRuntimeLibCompiledOpcodesVm) { 'use strict'; @@ -48475,7 +48365,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/dom', ['exports', 'glimmer-runtime/ exports.CommentOpcode = CommentOpcode; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy9kb20udHMiXSwibmFtZXMiOltdLC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R5cGUsXG4gICAgICBkZXRhaWxzOiBvcGVyYXRpb24udG9KU09OKClcbiAgICB9O1xuICB9XG59XG5cbmV4cG9ydCBjbGFzcyBDb21tZW50T3Bjb2RlIGV4dGVuZHMgT3Bjb2RlIHtcbiAgcHVibGljIHR5cGUgPSBcImNvbW1lbnRcIjtcblxuICBjb25zdHJ1Y3RvcihwdWJsaWMgY29tbWVudDogc3RyaW5nKSB7XG4gICAgc3VwZXIoKTtcbiAgfVxuXG4gIGV2YWx1YXRlKHZtOiBWTSkge1xuICAgIHZtLnN0YWNrKCkuYXBwZW5kQ29tbWVudCh0aGlzLmNvbW1lbnQpO1xuICB9XG5cbiAgdG9KU09OKCk6IE9wY29kZUpTT04ge1xuICAgIHJldHVybiB7XG4gICAgICBndWlkOiB0aGlzLl9ndWlkLFxuICAgICAgdHlwZTogdGhpcy50eXBlLFxuICAgICAgYXJnczogW0pTT04uc3RyaW5naWZ5KHRoaXMuY29tbWVudCldXG4gICAgfTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compiled/opcodes/lists', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-util', 'glimmer-reference'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerUtil, _glimmerReference) { 'use strict'; @@ -48625,7 +48515,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/lists', ['exports', 'glimmer-runtim exports.NextIterOpcode = NextIterOpcode; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy9saXN0cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFPQSx5QkFBQTtBQUlFLGlCQUpGLHlCQUFBLENBSWMsU0FBNkIsRUFBQTtBQUN2QyxnQkFBSSxDQUFDLEdBQUcsR0FBRyxTQUFTLENB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9wZXJhbmQoaXRlbS52YWx1ZSk7XG4gICAgICB2bS5mcmFtZS5zZXRBcmdzKEV2YWx1YXRlZEFyZ3MucG9zaXRpb25hbChbaXRlbS52YWx1ZSwgaXRlbS5tZW1vXSkpO1xuICAgIH0gZWxzZSB7XG4gICAgICB2bS5mcmFtZS5zZXRDb25kaXRpb24oRkFMU0VfUkVGKTtcbiAgICAgIHZtLmdvdG8odGhpcy5lbmQpO1xuICAgIH1cbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compiled/opcodes/partial', ['exports', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/opcodes/vm'], function (exports, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledOpcodesVm) { 'use strict'; @@ -48732,7 +48622,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/partial', ['exports', 'glimmer-util exports.EvaluatePartialOpcode = EvaluatePartialOpcode; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy9wYXJ0aWFsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQVNBLGlDQUFBOzhCQUFBLGlDQUFBOztBQUdFLGlCQUhGLGlDQUFBLENBR3NCLFdBQXdCLEVBQUE7QUFDMUMsOEJBQU8sQ0FBQztBQURVLGdCQUFBLENBQUEsV0FBVyxHQUFYLFdBQVcsQ0FBYTtBQUZyQyxnQkFBQSxDQUFBLElBQUksR0FBRyxnQ0FBZ0MsQ0FBQztTQUk5Qzs7QUFMSCx5Q0FBQSxXQU9FLFFBQVEsR0FBQSxrQkFBQyxFQUFNLEVBQUE7QUFDYixnQkFBSSxHQUFHLEdBQUcsRUFBRSxDQUFDLEdBQUcsQ0FBQztnQkFDWCxXQUFXLEdBQUssSUFBSSxDQUFwQixXQUFXOztBQU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ljIHR5cGUgPSBcImV2YWx1YXRlLXBhcnRpYWxcIjtcbiAgcHJpdmF0ZSBjYWNoZSA9IGRpY3Q8UGFydGlhbEJsb2NrPigpO1xuXG4gIGNvbnN0cnVjdG9yKHByaXZhdGUgc3ltYm9sVGFibGU6IFN5bWJvbFRhYmxlKSB7XG4gICAgc3VwZXIoKTtcbiAgfVxuXG4gIGV2YWx1YXRlKHZtOiBWTSkge1xuICAgIGxldCB7IHRlbXBsYXRlIH0gPSB2bS5mcmFtZS5nZXRJbW1lZGlhdGU8UGFydGlhbERlZmluaXRpb248T3BhcXVlPj4oKTtcblxuICAgIGxldCBibG9jayA9IHRoaXMuY2FjaGVbdGVtcGxhdGUuaWRdO1xuXG4gICAgaWYgKCFibG9jaykge1xuICAgICAgYmxvY2sgPSB0ZW1wbGF0ZS5hc1BhcnRpYWwodGhpcy5zeW1ib2xUYWJsZSk7XG4gICAgfVxuXG4gICAgdm0uaW52b2tlUGFydGlhbChibG9jayk7XG4gIH1cblxuICB0b0pTT04oKTogT3Bjb2RlSlNPTiB7XG4gICAgcmV0dXJuIHtcbiAgICAgIGd1aWQ6IHRoaXMuX2d1aWQsXG4gICAgICB0eXBlOiB0aGlzLnR5cGUsXG4gICAgICBhcmdzOiBbXCIkT1BFUkFORFwiXVxuICAgIH07XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/compiled/opcodes/vm', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/references', 'glimmer-reference', 'glimmer-util'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibReferences, _glimmerReference, _glimmerUtil) { 'use strict'; @@ -49394,7 +49284,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/vm', ['exports', 'glimmer-runtime/l exports.DidModifyOpcode = DidModifyOpcode; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb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lcIjtcblxuICBjb25zdHJ1Y3Rvcihwcml2YXRlIHRhcmdldDogSnVtcElmTm90TW9kaWZpZWRPcGNvZGUpIHtcbiAgICBzdXBlcigpO1xuICAgIHRoaXMudGFnID0gQ09OU1RBTlRfVEFHO1xuICB9XG5cbiAgZXZhbHVhdGUoKSB7XG4gICAgdGhpcy50YXJnZXQuZGlkTW9kaWZ5KCk7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/compiler', ['exports', 'glimmer-util', 'glimmer-runtime/lib/utils', 'glimmer-runtime/lib/syntax/core', 'glimmer-runtime/lib/compiled/blocks', 'glimmer-runtime/lib/compiled/expressions/function', 'glimmer-runtime/lib/compiled/opcodes/builder'], function (exports, _glimmerUtil, _glimmerRuntimeLibUtils, _glimmerRuntimeLibSyntaxCore, _glimmerRuntimeLibCompiledBlocks, _glimmerRuntimeLibCompiledExpressionsFunction, _glimmerRuntimeLibCompiledOpcodesBuilder) { 'use strict'; @@ -49826,7 +49716,7 @@ enifed('glimmer-runtime/lib/compiler', ['exports', 'glimmer-util', 'glimmer-runt exports.CompileIntoList = CompileIntoList; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7UUFrQ0EsUUFBQTtBQUlFLGlCQUpGLFFBQUEsQ0FJd0IsS0FBWSxFQUFTLEdBQWdCLEVBQUE7QUFBckMsZ0JBQUEsQ0FBQSxLQUFLLEdBQUwsS0FBSyxDQUFPO0FBQVMsZ0JBQUEsQ0FBQSxHQUFHLEdBQUgsR0FBRyxDQUFhO0FBQ3pELGdCQUFJLENBQUMsT0FBTyxHQUFHLEtBQUssQ0FBQyxPQUFPLENBQUMsSUFBSSxFQUFFLENBQUM7QUFDcEMsZ0JBQUksQ0FBQyxXQUFXLEdBQUcsS0FBSyxDQUFDLFdBQVcsQ0F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251bWJlcic7XG4gIH1cblxuICB0b09wU2VxKCk6IE9wU2VxIHtcbiAgICByZXR1cm4gdGhpcztcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/component/interfaces', ['exports'], function (exports) { 'use strict'; @@ -49846,7 +49736,7 @@ enifed('glimmer-runtime/lib/component/interfaces', ['exports'], function (export exports.ComponentDefinition = ComponentDefinition; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcG9uZW50L2ludGVyZmFjZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQXFHQSxRQUFNLDBCQUEwQixHQUFHLGdFQUFnRSxDQUFDOztBQUVwRyxhQUFBLHFCQUFBLENBQXNDLEdBQVEsRUFBQTtBQUM1QyxlQUFPLE9BQU8sR0FBRyxLQUFLLFFBQVEsSUFBSSxHQUFHLElBQUksR0FBRyxDQUFDLDBCQUEwQixDQUFDLENBQUM7S0FDMUU7O1FBRUQsbUJBQUEsR0FPRSxTQVBGLG1CQUFBLENBT2MsSUFBWSxFQUFFLE9BQTRCLEVBQUUsY0FBOEIsRUFBQTtBQUY5RSxZQUFBLENBQUMsZ0VBQWdFLENBQUMsR0FBRyxJQUFJLENBQUM7QUFHaEYsWUFBSSxDQUFDLElBQUksR0FBRyxJQUFJLENBQUM7QUFDakIsWUFBSSxDQUFDLE9BQU8sR0FBRyxPQUFPLENBQUM7QUFDdkIsWUFBSSxDQUFDLGNBQWMsR0FBRyxjQUFjLENBQUM7S0FDdEMiLCJmaWxlIjoiaW50ZXJmYWNlcy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEV2YWx1YXRlZEFyZ3MgfSBmcm9tICcuLi9jb21waWxlZC9leHByZXNzaW9ucy9hcmdzJztcbmltcG9ydCB7IEZ1bmN0aW9uRXhwcmVzc2lvbiB9IGZyb20gJy4uL2NvbXBpbGVkL2V4cHJlc3Npb25z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zO1xuXG4gIHByaXZhdGUgWydDT01QT05FTlQgREVGSU5JVElPTiBbaWQ9ZTU5Yzc1NGUtNjFlYi00MzkyLThjNGEtMmMwYWM3MmJmY2Q0XSddID0gdHJ1ZTtcblxuICBjb25zdHJ1Y3RvcihuYW1lOiBzdHJpbmcsIG1hbmFnZXI6IENvbXBvbmVudE1hbmFnZXI8VD4sIENvbXBvbmVudENsYXNzOiBDb21wb25lbnRDbGFzcykge1xuICAgIHRoaXMubmFtZSA9IG5hbWU7XG4gICAgdGhpcy5tYW5hZ2VyID0gbWFuYWdlcjtcbiAgICB0aGlzLkNvbXBvbmVudENsYXNzID0gQ29tcG9uZW50Q2xhc3M7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/dom/attribute-managers', ['exports', 'glimmer-runtime/lib/dom/sanitized-values', 'glimmer-runtime/lib/dom/props', 'glimmer-runtime/lib/dom/helper', 'glimmer-runtime/lib/compiled/opcodes/content'], function (exports, _glimmerRuntimeLibDomSanitizedValues, _glimmerRuntimeLibDomProps, _glimmerRuntimeLibDomHelper, _glimmerRuntimeLibCompiledOpcodesContent) { 'use strict'; @@ -50102,7 +49992,7 @@ enifed('glimmer-runtime/lib/dom/attribute-managers', ['exports', 'glimmer-runtim return SafeAttributeManager; })(AttributeManager); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL2F0dHJpYnV0ZS1tYW5hZ2Vycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7OztBQVlBLGFBQUEsZUFBQSxDQUFnQyxPQUF1QixFQUFFLElBQVksRUFBRSxVQUFtQixFQUFFLFNBQWlCLEVBQUE7QUFDM0csWUFBSSxPQUFPLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQztBQUM5QixZQUFJLEtBQUssR0FBRyxPQUFPLENBQUMsWUFBWSxpQ0FOekIsYUFBYSxBQU04Q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BFbGVtZW50LCB2YWx1ZTogT3BhcXVlKSB7XG4gICAgc3VwZXIuc2V0QXR0cmlidXRlKGVudiwgZWxlbWVudCwgc2FuaXRpemVBdHRyaWJ1dGVWYWx1ZShlbnYsIGVsZW1lbnQsIHRoaXMuYXR0ciwgdmFsdWUpKTtcbiAgfVxuXG4gIHVwZGF0ZUF0dHJpYnV0ZShlbnY6IEVudmlyb25tZW50LCBlbGVtZW50OiBFbGVtZW50LCB2YWx1ZTogT3BhcXVlLCBuYW1lc3BhY2U/OiBET01OYW1lc3BhY2UpIHtcbiAgICBzdXBlci51cGRhdGVBdHRyaWJ1dGUoZW52LCBlbGVtZW50LCBzYW5pdGl6ZUF0dHJpYnV0ZVZhbHVlKGVudiwgZWxlbWVudCwgdGhpcy5hdHRyLCB2YWx1ZSkpO1xuICB9XG59XG4iXX0= + enifed('glimmer-runtime/lib/dom/helper', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/compat/inner-html-fix', 'glimmer-runtime/lib/compat/svg-inner-html-fix', 'glimmer-runtime/lib/compat/text-node-merging-fix', 'glimmer-runtime/lib/dom/interfaces'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibCompatInnerHtmlFix, _glimmerRuntimeLibCompatSvgInnerHtmlFix, _glimmerRuntimeLibCompatTextNodeMergingFix, _glimmerRuntimeLibDomInterfaces) { 'use strict'; @@ -50355,7 +50245,7 @@ enifed('glimmer-runtime/lib/dom/helper', ['exports', 'glimmer-runtime/lib/bounds exports.DOMTreeConstruction = DOMTreeConstruction; exports.DOMNamespace = _glimmerRuntimeLibDomInterfaces.Namespace; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL2hlbHBlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFlTyxRQUFNLGFBQWEsR0FBRyw0QkFBNEIsQ0FBQzs7O0FBRzFEL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hlbHBlciwgU1ZHX05BTUVTUEFDRSk7XG5cbmV4cG9ydCBkZWZhdWx0IGhlbHBlcjtcbmV4cG9ydCBjb25zdCBET01UcmVlQ29uc3RydWN0aW9uID0gRE9NLkRPTVRyZWVDb25zdHJ1Y3Rpb247XG5leHBvcnQgdHlwZSBET01UcmVlQ29uc3RydWN0aW9uID0gRE9NLkRPTVRyZWVDb25zdHJ1Y3Rpb247XG5leHBvcnQgeyBOYW1lc3BhY2UgYXMgRE9NTmFtZXNwYWNlIH0gZnJvbSAnLi9pbnRlcmZhY2VzJztcbiJdfQ== + enifed("glimmer-runtime/lib/dom/interfaces", ["exports"], function (exports) { "use strict"; @@ -50376,7 +50266,7 @@ enifed("glimmer-runtime/lib/dom/interfaces", ["exports"], function (exports) { NodeType[NodeType["Notation"] = 11] = "Notation"; })(NodeType || (exports.NodeType = NodeType = {})); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL2ludGVyZmFjZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBV0EsUUFBWSxRQWFYLENBQUE7O0FBYkQsS0FBQSxVQUFZLFFBQVEsRUFBQTtBQUNsQixnQkFBQSxDQUFBLFFBQUEsQ0FBQSxTQUFBLENBQUEsR0FBQSxDQUFBLENBQUEsR0FBQSxTQUFPLENBQUE7QUFDUCxnQkFBQSxDQUFBLFFBQUEsQ0FBQSxXQUFBLENBQUEsR0FBQSxDQUFBLENBQUEsR0FBQSxXQUFTLENBQUE7QUFDVCxnQkFBQSxDQUFBLFFBQUEsQ0FBQSxNQUFBLENBQUEsR0FBQSxDQUFBLENBQUEsR0FBQSxNQUFJLENBQUE7QUFDSixnQkFBQSxDQUFBLFFBQUEsQ0FBQSxjQUFBLENBQUEsR0FBQSxDQUFBLENBQUEsR0FBQSxjQUFZLENBQUE7QUFDWixnQkFBQSxDQUFBLFFBQUEsQ0FBQSx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ogTm9kZSk6IHZvaWQ7XG4gIHJlbW92ZUNoaWxkKG5vZGU6IE5vZGUpOiB2b2lkO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIFNWR0VsZW1lbnQgZXh0ZW5kcyBFbGVtZW50IHt9XG5cbmV4cG9ydCBpbnRlcmZhY2UgSFRNTEVsZW1lbnQgZXh0ZW5kcyBFbGVtZW50IHt9XG4iXX0= + enifed('glimmer-runtime/lib/dom/props', ['exports'], function (exports) { /* * @method normalizeProperty @@ -50433,7 +50323,10 @@ enifed('glimmer-runtime/lib/dom/props', ['exports'], function (exports) { // Chrome 46.0.2464.0: 'autocorrect' in document.createElement('input') === false // Safari 8.0.7: 'autocorrect' in document.createElement('input') === false // Mobile Safari (iOS 8.4 simulator): 'autocorrect' in document.createElement('input') === true - autocorrect: true + autocorrect: true, + // Chrome 54.0.2840.98: 'list' in document.createElement('input') === true + // Safari 9.1.3: 'list' in document.createElement('input') === false + list: true }, // element.form is actually a legitimate readOnly property, that is to be // mutated, but must be mutated by setAttribute... @@ -50450,7 +50343,7 @@ enifed('glimmer-runtime/lib/dom/props', ['exports'], function (exports) { return tag && tag[propName.toLowerCase()] || false; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL3Byb3BzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztBQU1BLGFBQUEsaUJBQUEsQ0FBa0MsT0FBTyxFQUFFLFFBQVEsRUFBQTtBQUNqRCxZQUFJLElBQUksWUFBQTtZQUFFLFVBQVUsWUFBQSxDQUFDO0FBRXJCLFlBQUksUUFBUSxJQUFJLE9BQU8sRUFBRTtBQUN2QixzQkFBVSxHQUFHLFFBQVEsQ0FBQztBQUN0QixnQkFBSSxHQUFHLE1BQU0sQ0FBQztTQUNmLE1BQU07QUFDTCxnQkFBSSxLQUFLLEdBQUcsUUFBUSxDQUFDLF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LnRvVXBwZXJDYXNlKCldO1xuICByZXR1cm4gdGFnICYmIHRhZ1twcm9wTmFtZS50b0xvd2VyQ2FzZSgpXSB8fCBmYWxzZTtcbn1cbiJdfQ== + enifed('glimmer-runtime/lib/dom/sanitized-values', ['exports', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-runtime/lib/upsert'], function (exports, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerRuntimeLibUpsert) { 'use strict'; @@ -50502,7 +50395,7 @@ enifed('glimmer-runtime/lib/dom/sanitized-values', ['exports', 'glimmer-runtime/ return str; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL3Nhbml0aXplZC12YWx1ZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBTUEsUUFBTSxZQUFZLEdBQUcsQ0FDbkIsYUFBYSxFQUNiLFdBQVcsQ0FDWixDQUFDO0FBRUYsUUFBTSxPQUFPLEdBQUcsQ0FDZCxHQUFHLEVBQ0gsTUFBTSxFQUNOLE1BQU0sRUFDTixLQUFLLEVBQ0wsUUFBUSxFQUNSLE1BQU0sRUFDTixNQUFNLENBQ1AsQ0FBQztBQUVGLFFBQU0saUJBQWlCLEdBQUcsQ0FDeEIsT0FBTyxDQUNSLENBQUM7QUFFRixRQUFNLGFBQWEsR0FBRyxDQUNwQixNQUFNLEVBQ04sS0FBSyxFQUNMLFlBQVksRUFDWixRQUFRLENBQ1QsQ0FBQztBQUVGLFFBQU0sdUJBQXVCLEdBQUcsQ0FDOUIsS0FBSyxDQUNOLENBQUM7QUFFRixhQUFBLEdBQUEsQ0FBYSxLQUFvQixFQUFFLElBQVksRUFBQTtBQUM3QyxlQUFPLEtBQUssQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUM7S0FDbkM7QUFFRCxhQUFBLFFBQUEsQ0FBa0I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hbHVlKGVudjogRW52aXJvbm1lbnQsIGVsZW1lbnQ6IFNpbXBsZS5FbGVtZW50LCBhdHRyaWJ1dGU6IHN0cmluZywgdmFsdWU6IE9wYXF1ZSk6IE9wYXF1ZSB7XG4gIGxldCB0YWdOYW1lO1xuXG4gIGlmICh2YWx1ZSA9PT0gbnVsbCB8fCB2YWx1ZSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgcmV0dXJuIHZhbHVlO1xuICB9XG5cbiAgaWYgKGlzU2FmZVN0cmluZyh2YWx1ZSkpIHtcbiAgICByZXR1cm4gdmFsdWUudG9IVE1MKCk7XG4gIH1cblxuICBpZiAoIWVsZW1lbnQpIHtcbiAgICB0YWdOYW1lID0gbnVsbDtcbiAgfSBlbHNlIHtcbiAgICB0YWdOYW1lID0gZWxlbWVudC50YWdOYW1lLnRvVXBwZXJDYXNlKCk7XG4gIH1cblxuICBsZXQgc3RyID0gbm9ybWFsaXplVGV4dFZhbHVlKHZhbHVlKTtcblxuICBpZiAoY2hlY2tVUkkodGFnTmFtZSwgYXR0cmlidXRlKSkge1xuICAgIGxldCBwcm90b2NvbCA9IGVudi5wcm90b2NvbEZvclVSTChzdHIpO1xuICAgIGlmIChoYXMoYmFkUHJvdG9jb2xzLCBwcm90b2NvbCkpIHtcbiAgICAgIHJldHVybiBgdW5zYWZlOiR7c3RyfWA7XG4gICAgfVxuICB9XG5cbiAgaWYgKGNoZWNrRGF0YVVSSSh0YWdOYW1lLCBhdHRyaWJ1dGUpKSB7XG4gICAgcmV0dXJuIGB1bnNhZmU6JHtzdHJ9YDtcbiAgfVxuXG4gIHJldHVybiBzdHI7XG59XG4iXX0= + enifed('glimmer-runtime/lib/environment', ['exports', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/dom/attribute-managers', 'glimmer-util', 'glimmer-runtime/lib/syntax/core', 'glimmer-runtime/lib/syntax/builtins/if', 'glimmer-runtime/lib/syntax/builtins/unless', 'glimmer-runtime/lib/syntax/builtins/with', 'glimmer-runtime/lib/syntax/builtins/each'], function (exports, _glimmerRuntimeLibReferences, _glimmerRuntimeLibDomAttributeManagers, _glimmerUtil, _glimmerRuntimeLibSyntaxCore, _glimmerRuntimeLibSyntaxBuiltinsIf, _glimmerRuntimeLibSyntaxBuiltinsUnless, _glimmerRuntimeLibSyntaxBuiltinsWith, _glimmerRuntimeLibSyntaxBuiltinsEach) { 'use strict'; @@ -50758,7 +50651,7 @@ enifed('glimmer-runtime/lib/environment', ['exports', 'glimmer-runtime/lib/refer }; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZW52aXJvbm1lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBMkRBLEtBQUE7QUFlRSxpQkFmRixLQUFBLENBZWMsVUFBdUIsRUFBMkI7Z0JBQXpCLFdBQVcseURBQVUsSUFBSTs7QUFGdEQsZ0JBQUEsQ0FBQSxXQUFXLEdBQVUsSUFBSSxDQUFDO0FBR2hDLGdCQUFJLENBQUMsS0FBSyxHQUFHLFVBQVUsQ0FBQztBQUN4QixnQkFBSSxDQUFDLFdBQVcsR0FBRyxXQUFXLENBQUM7U0FDaEM7O0FBbEJILGFBQUEsQ0FDUyxJQUFJLEdBQUEsY0FBQyxJQUEyQixFQUFVO2dCQUFSLElBQUkseURBQUcsQ0FBQzs7QUFDL0MsZ0JBQUksSUFBSSxHQUE0QixJQUFJLEtBQUssQ0FBQyxJQUFJLEdBQUcsQ0FBQyxDQUFDLENBQUM7QUFFeEQsaUJBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsSUFBSSxJQUFJLEVBQUUsQ0FBQyxFQUFFLEVBQUU7QUFDOUIsb0JBQUksQ0FBQyxDQUFDLENBQUMsZ0NBekRKLG1CQUFtQixBQXlETyxDQUFDO2FBQy9CO0FBRUQsbUJBQU8sSUFBSSxLQUFLLENBQUMsSUFBSSxDQUFDLEN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BlbmQudmFsdWU7XG4gICAgICBhcmdzID0gU3ludGF4LkFyZ3MuZW1wdHkoKTtcbiAgICAgIHBhdGggPSBhcHBlbmRWYWx1ZS5yZWYucGFydHM7XG4gICAgfSBlbHNlIGlmIChhcHBlbmQgJiYgYXBwZW5kLnZhbHVlLnR5cGUgPT09ICdoZWxwZXInKSB7XG4gICAgICBsZXQgaGVscGVyID0gPFN5bnRheC5IZWxwZXI+YXBwZW5kLnZhbHVlO1xuICAgICAgYXJncyA9IGhlbHBlci5hcmdzO1xuICAgICAgcGF0aCA9IGhlbHBlci5yZWYucGFydHM7XG4gICAgfSBlbHNlIGlmIChtb2RpZmllcikge1xuICAgICAgcGF0aCA9IG1vZGlmaWVyLnBhdGg7XG4gICAgICBhcmdzID0gbW9kaWZpZXIuYXJncztcbiAgICB9XG5cbiAgICBsZXQga2V5OiBzdHJpbmcsIGlzU2ltcGxlOiBib29sZWFuO1xuXG4gICAgaWYgKHBhdGgpIHtcbiAgICAgIGlzU2ltcGxlID0gcGF0aC5sZW5ndGggPT09IDE7XG4gICAgICBrZXkgPSBwYXRoWzBdO1xuICAgIH1cblxuICAgIHJldHVybiB7XG4gICAgICBpc1NpbXBsZSxcbiAgICAgIHBhdGgsXG4gICAgICBrZXksXG4gICAgICBhcmdzLFxuICAgICAgYXBwZW5kVHlwZSxcbiAgICAgIG9yaWdpbmFsOiBzdGF0ZW1lbnQsXG4gICAgICBpc0lubGluZTogISFhcHBlbmQsXG4gICAgICBpc0Jsb2NrOiAhIWJsb2NrLFxuICAgICAgaXNNb2RpZmllcjogISFtb2RpZmllclxuICAgIH07XG59XG4iXX0= + enifed('glimmer-runtime/lib/helpers/get-dynamic-var', ['exports', 'glimmer-reference'], function (exports, _glimmerReference) { 'use strict'; @@ -50795,15 +50688,15 @@ enifed('glimmer-runtime/lib/helpers/get-dynamic-var', ['exports', 'glimmer-refer } exports.default = getDynamicVar; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb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29wZSwgbmFtZVJlZik7XG59XG5cbmV4cG9ydCBkZWZhdWx0IChnZXREeW5hbWljVmFyIGFzIEhlbHBlcik7XG4iXX0= + enifed("glimmer-runtime/lib/modifier/interfaces", ["exports"], function (exports) { "use strict"; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvbW9kaWZpZXIvaW50ZXJmYWNlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwiZmlsZSI6ImludGVyZmFjZXMuanMiLCJzb3VyY2VzQ29udGVudCI6W119 + enifed("glimmer-runtime/lib/opcode-builder", ["exports"], function (exports) { "use strict"; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvb3Bjb2RlLWJ1aWxkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJvcGNvZGUtYnVpbGRlci5qcyIsInNvdXJjZXNDb250ZW50IjpbXX0= + enifed('glimmer-runtime/lib/opcodes', ['exports', 'glimmer-util'], function (exports, _glimmerUtil) { 'use strict'; @@ -50892,7 +50785,7 @@ enifed('glimmer-runtime/lib/opcodes', ['exports', 'glimmer-util'], function (exp } } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvb3Bjb2Rlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztRQWFBLGNBQUE7QUFPRSxpQkFQRixjQUFBLEdBT0U7QUFDRSx5QkFyQjhDLGNBQWMsQ0FxQjdDLElBQUksQ0FBQyxDQUFDO1NBQ3RCOztBQVRILHNCQUFBLFdBV0UsTUFBTSxHQUFBLGtCQUFBO0FBQ0osbUJBQU8sRUFBRSxJQUFJLEVBQUUsSUFBSSxDQUFDLEtBQUssRUFBRSxJQUFJ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ICBpZiAoa2V5cy5sZW5ndGgpIHtcbiAgICAgICAgaWYgKG9wY29kZS5hcmdzICYmIG9wY29kZS5hcmdzLmxlbmd0aCkge1xuICAgICAgICAgIGJ1ZmZlci5wdXNoKCcsICcpO1xuICAgICAgICB9XG5cbiAgICAgICAgYnVmZmVyLnB1c2goa2V5cy5tYXAoa2V5ID0+IGAke2tleX09JHtvcGNvZGUuZGV0YWlsc1trZXldfWApLmpvaW4oJywgJykpO1xuICAgICAgfVxuICAgIH1cblxuICAgIGJ1ZmZlci5wdXNoKCcpJyk7XG4gIH1cblxuICBidWZmZXIucHVzaCgnXFxuJyk7XG5cbiAgaWYgKG9wY29kZS5jaGlsZHJlbiAmJiBvcGNvZGUuY2hpbGRyZW4ubGVuZ3RoKSB7XG4gICAgZm9yIChsZXQgaT0wOyBpPG9wY29kZS5jaGlsZHJlbi5sZW5ndGg7IGkrKykge1xuICAgICAgX2luc3BlY3Qob3Bjb2RlLmNoaWxkcmVuW2ldLCBidWZmZXIsIGxldmVsKzEsIGkpO1xuICAgIH1cbiAgfVxufVxuIl19 + enifed("glimmer-runtime/lib/partial", ["exports"], function (exports) { "use strict"; @@ -50903,7 +50796,7 @@ enifed("glimmer-runtime/lib/partial", ["exports"], function (exports) { exports.PartialDefinition = PartialDefinition; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvcGFydGlhbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFFQSxpQkFBQSxHQUlFLFNBSkYsaUJBQUEsQ0FJYyxJQUFZLEVBQUUsUUFBcUIsRUFBQTtBQUM3QyxZQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQztBQUNqQixZQUFJLENBQUMsUUFBUSxHQUFHLFFBQVEsQ0FBQztLQUMxQiIsImZpbGUiOiJwYXJ0aWFsLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgVGVtcGxhdGUgfSBmcm9tICcuL3RlbXBsYXRlJztcblxuZXhwb3J0IGNsYXNzIFBhcnRpYWxEZWZpbml0aW9uPFQ+IHtcbiAgbmFtZTogc3RyaW5nOyAvLyBmb3IgZGVidWdnaW5nXG4gIHRlbXBsYXRlOiBUZW1wbGF0ZTxUPjtcblxuICBjb25zdHJ1Y3RvcihuYW1lOiBzdHJpbmcsIHRlbXBsYXRlOiBUZW1wbGF0ZTxUPikge1xuICAgIHRoaXMubmFtZSA9IG5hbWU7XG4gICAgdGhpcy50ZW1wbGF0ZSA9IHRlbXBsYXRlO1xuICB9XG59XG4iXX0= + enifed('glimmer-runtime/lib/references', ['exports', 'glimmer-reference'], function (exports, _glimmerReference) { 'use strict'; @@ -50999,7 +50892,7 @@ enifed('glimmer-runtime/lib/references', ['exports', 'glimmer-reference'], funct exports.ConditionalReference = ConditionalReference; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvcmVmZXJlbmNlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFLQSxrQkFBQTs4QkFBQSxrQkFBQTs7QUFzQkUsaUJBdEJGLGtCQUFBLENBc0J3QixLQUFRLEVBQUE7QUFDNUIsdUNBQU0sS0FBSyxDQUFDLENBQUM7U0FDZDs7QUF4QkgsMEJBQUEsQ0FNUyxNQUFNLEdBQUEsZ0JBQUMsS0FBZ0IsRUFBQTtBQUM1QixnQkFBSSxLQUFLLEtBQUssU0FBUyxFQUFFO0FBQ3ZCLHVCQUFPLG1CQUFtQixDQUFDO2FBQzVCLE1BQU0sSUFBSSxLQUFLLEtBQUssSUFBSSxFQUFFO0FBQ3pCLHVCQUFPLGNBQWMsQ0FBQzthQUN2QixNQUFNLElBQUksS0FBSyxLQUFLLElBQUksRUFBRTtBQUN6Qix1QkFBTyxjQUFjLENBQUM7YUFDdkIsTUFBTSxJQUFJLEtBQUssS0FBS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KCkpO1xuICB9XG5cbiAgcHJvdGVjdGVkIHRvQm9vbCh2YWx1ZTogT3BhcXVlKTogYm9vbGVhbiB7XG4gICAgcmV0dXJuICEhdmFsdWU7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/scanner', ['exports', 'glimmer-runtime/lib/syntax/statements', 'glimmer-runtime/lib/compiled/blocks', 'glimmer-util', 'glimmer-runtime/lib/symbol-table'], function (exports, _glimmerRuntimeLibSyntaxStatements, _glimmerRuntimeLibCompiledBlocks, _glimmerUtil, _glimmerRuntimeLibSymbolTable) { 'use strict'; @@ -51154,7 +51047,7 @@ enifed('glimmer-runtime/lib/scanner', ['exports', 'glimmer-runtime/lib/syntax/st return SyntaxReader; })(); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc2Nhbm5lci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFRQSxPQUFBO0FBQ0UsaUJBREYsT0FBQSxDQUNzQixLQUE4QixFQUFVLElBQWtCLEVBQVUsR0FBZ0IsRUFBQTtBQUFwRixnQkFBQSxDQUFBLEtBQUssR0FBTCxLQUFLLENBQXlCO0FBQVUsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFjO0FBQVUsZ0JBQUEsQ0FBQSxHQUFHLEdBQUgsR0FBRyxDQUFhO1NBQ3ZHOztBQUZILGVBQUEsV0FJRSxjQUFjLEdBQUEsMEJBQUE7Z0JBQ04sS0FBSyxHQUFXLElBQUksQ0FBcEIsS0FBSztnQkFBRSxJQUFJLEdBQUssSUFBSSxDQUFiLElBQUk7O0FBRWpCLGdCQUFJLFdBQVcsR0FBRyxzQ0FBWSxhQUFhLENBQUMsSUFBSSxDQUFDLENBQUM7QUFDbEQsZ0JBQUksT0FBTyxHQUFHLGVBQWUsQ0FBQyxLQUFLLEVBQUUsS0FBSyxDQUFDLE1BQU0sRUFBRSxX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DtcblxuICBjb25zdHJ1Y3Rvcihwcml2YXRlIHN0YXRlbWVudHM6IFNlcmlhbGl6ZWRTdGF0ZW1lbnRbXSwgcHJpdmF0ZSBzeW1ib2xUYWJsZTogU3ltYm9sVGFibGUsIHByaXZhdGUgc2Nhbm5lcjogQmxvY2tTY2FubmVyKSB7fVxuXG4gIG5leHQoKTogU3RhdGVtZW50U3ludGF4IHtcbiAgICBsZXQgbGFzdCA9IHRoaXMubGFzdDtcbiAgICBpZiAobGFzdCkge1xuICAgICAgdGhpcy5sYXN0ID0gbnVsbDtcbiAgICAgIHJldHVybiBsYXN0O1xuICAgIH0gZWxzZSBpZiAodGhpcy5jdXJyZW50ID09PSB0aGlzLnN0YXRlbWVudHMubGVuZ3RoKSB7XG4gICAgICByZXR1cm4gbnVsbDtcbiAgICB9XG5cbiAgICBsZXQgc2V4cCA9IHRoaXMuc3RhdGVtZW50c1t0aGlzLmN1cnJlbnQrK107XG4gICAgcmV0dXJuIGJ1aWxkU3RhdGVtZW50KHNleHAsIHRoaXMuc3ltYm9sVGFibGUsIHRoaXMuc2Nhbm5lcik7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/symbol-table', ['exports', 'glimmer-util'], function (exports, _glimmerUtil) { 'use strict'; @@ -51288,7 +51181,7 @@ enifed('glimmer-runtime/lib/symbol-table', ['exports', 'glimmer-util'], function exports.default = SymbolTable; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ltYm9sLXRhYmxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQUdBLFdBQUE7QUFvQkUsaUJBcEJGLFdBQUEsQ0FvQnNCLE1BQW1CLEVBQW1DO2dCQUF6QixJQUFJLHlEQUFpQixJQUFJOztBQUF0RCxnQkFBQSxDQUFBLE1BQU0sR0FBTixNQUFNLENBQWE7QUFBVSxnQkFBQSxDQUFBLElBQUksR0FB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Y2FsKG5hbWU6IHN0cmluZyk6IG51bWJlciB7XG4gICAgbGV0IHsgbG9jYWxzLCBwYXJlbnQgfSA9IHRoaXM7XG5cbiAgICBsZXQgc3ltYm9sID0gbG9jYWxzW25hbWVdO1xuXG4gICAgaWYgKCFzeW1ib2wgJiYgcGFyZW50KSB7XG4gICAgICBzeW1ib2wgPSBwYXJlbnQuZ2V0TG9jYWwobmFtZSk7XG4gICAgfVxuXG4gICAgcmV0dXJuIHN5bWJvbDtcbiAgfVxuXG4gIGdldFBhcnRpYWxBcmdzKCk6IG51bWJlciB7XG4gICAgcmV0dXJuIHRoaXMudG9wLnBhcnRpYWxBcmdzO1xuICB9XG5cbiAgaXNUb3AoKTogYm9vbGVhbiB7XG4gICAgcmV0dXJuIHRoaXMudG9wID09PSB0aGlzO1xuICB9XG59XG4iXX0= + enifed("glimmer-runtime/lib/syntax", ["exports"], function (exports) { "use strict"; @@ -51365,7 +51258,7 @@ enifed("glimmer-runtime/lib/syntax", ["exports"], function (exports) { return value && value[ATTRIBUTE] === true; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O1FBbUJBLFNBQUE7QUFBQSxpQkFBQSxTQUFBLEdBQUE7QUFNUyxnQkFBQSxDQUFBLElBQUksR0FBYyxJQUFJLENBQUM7QUFDdkIsZ0JBQUEsQ0FBQSxJQUFJLEdBQWMsSUFBSSxDQUFDO1NBYS9COztBQXBCRCxpQkFBQSxDQUNTLFFBQVEsR0FBQSxrQkFBZ0MsSUFBTyxFQUFFLFdBQXdCLEVBQUUsT0FBc0IsRUFBQTtBQUN0RyxrQkFBTSxJQUFJLEtBQUssd0NBQXNDLElBQUksQ0FBRyxDQUFDO1NBQzlEOztBQUhILGlCQUFBLFdBU0UsS0FBSyxHQUFBLGlCQUFBOzs7QUFHSCxtQk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uZXhwb3J0IGZ1bmN0aW9uIGlzQXR0cmlidXRlKHZhbHVlOiBTdGF0ZW1lbnQpOiB2YWx1ZSBpcyBBdHRyaWJ1dGU8YW55PiB7XG4gIHJldHVybiB2YWx1ZSAmJiB2YWx1ZVtBVFRSSUJVVEVdID09PSB0cnVlO1xufVxuIl19 + enifed('glimmer-runtime/lib/syntax/builtins/each', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; @@ -51428,7 +51321,7 @@ enifed('glimmer-runtime/lib/syntax/builtins/each', ['exports', 'glimmer-runtime/ exports.default = EachSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL2VhY2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBVUEsVUFBQTs4QkFBQSxVQUFBOztBQUdFLGlCQUhGLFVBQUEsQ0FHcUIsSUFBaUIsRUFBQTtBQUNsQyx1Q0FBTyxDQUFDO0FBRFMsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFhO0FBRnBDLGdCQUFBLENBQUEsSUFBSSxHQUFHLGdCQUFnQixDQUFDO1NBSXZCOztBQUxILGtCQUFBLFdBT0UsT0FBTyxHQUFBLGlCQUFDLEdBQXFCLEVBQUUsR0FBZ0IsRUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O2dCQXlCdkMsSUFBSSxHQUF1QixJQUFJLENBQS9CLElBQUk7Z0JBQVUsTUFBTSxHQUFPLElBQUksQ0FBekIsSUFBSSxDQUFJLE1BQU07O0FBRTFCLGVBQUcsQ0FBQyxLQUFLLENBQUMsSUFBSSxFQUFFLFVBQUMsR0FBRyxFQUFFLEtBQUssRUFBRSxHQUFHLEVBQUE7QUFDOUIsbUJBQUcsQ0FBQyxXQUFXLEVBQUUsQ0FBQztBQUVsQ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N5bnRheCBleHRlbmRzIFN0YXRlbWVudFN5bnRheCB7XG4gIHR5cGUgPSBcImVhY2gtc3RhdGVtZW50XCI7XG5cbiAgY29uc3RydWN0b3IocHVibGljIGFyZ3M6IFN5bnRheC5BcmdzKSB7XG4gICAgc3VwZXIoKTtcbiAgfVxuXG4gIGNvbXBpbGUoZHNsOiBPcGNvZGVCdWlsZGVyRFNMLCBlbnY6IEVudmlyb25tZW50KSB7XG4gICAgLy8gICAgICAgICBFbnRlcihCRUdJTiwgRU5EKVxuICAgIC8vIEJFR0lOOiAgTm9vcFxuICAgIC8vICAgICAgICAgUHV0QXJnc1xuICAgIC8vICAgICAgICAgUHV0SXRlcmFibGVcbiAgICAvLyAgICAgICAgIEp1bXBVbmxlc3MoRUxTRSlcbiAgICAvLyAgICAgICAgIEVudGVyTGlzdChCRUdJTjIsIEVORDIpXG4gICAgLy8gSVRFUjogICBOb29wXG4gICAgLy8gICAgICAgICBOZXh0SXRlcihCUkVBSylcbiAgICAvLyAgICAgICAgIEVudGVyV2l0aEtleShCRUdJTjIsIEVORDIpXG4gICAgLy8gQkVHSU4yOiBOb29wXG4gICAgLy8gICAgICAgICBQdXNoQ2hpbGRTY29wZVxuICAgIC8vICAgICAgICAgRXZhbHVhdGUoZGVmYXVsdClcbiAgICAvLyAgICAgICAgIFBvcFNjb3BlXG4gICAgLy8gRU5EMjogICBOb29wXG4gICAgLy8gICAgICAgICBFeGl0XG4gICAgLy8gICAgICAgICBKdW1wKElURVIpXG4gICAgLy8gQlJFQUs6ICBOb29wXG4gICAgLy8gICAgICAgICBFeGl0TGlzdFxuICAgIC8vICAgICAgICAgSnVtcChFTkQpXG4gICAgLy8gRUxTRTogICBOb29wXG4gICAgLy8gICAgICAgICBFdmFsdWxhdGUoaW52ZXJzZSlcbiAgICAvLyBFTkQ6ICAgIE5vb3BcbiAgICAvLyAgICAgICAgIEV4aXRcblxuICAgIGxldCB7IGFyZ3MsIGFyZ3M6IHsgYmxvY2tzIH0gfSA9IHRoaXM7XG5cbiAgICBkc2wuYmxvY2soYXJncywgKGRzbCwgQkVHSU4sIEVORCkgPT4ge1xuICAgICAgZHNsLnB1dEl0ZXJhdG9yKCk7XG5cbiAgICAgIGlmIChibG9ja3MuaW52ZXJzZSkge1xuICAgICAgICBkc2wuanVtcFVubGVzcygnRUxTRScpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgZHNsLmp1bXBVbmxlc3MoRU5EKTtcbiAgICAgIH1cblxuICAgICAgZHNsLml0ZXIoKGRzbCwgQkVHSU4sIEVORCkgPT4ge1xuICAgICAgICBkc2wuZXZhbHVhdGUoJ2RlZmF1bHQnLCBibG9ja3MuZGVmYXVsdCk7XG4gICAgICB9KTtcblxuICAgICAgaWYgKGJsb2Nrcy5pbnZlcnNlKSB7XG4gICAgICAgIGRzbC5qdW1wKEVORCk7XG4gICAgICAgIGRzbC5sYWJlbCgnRUxTRScpO1xuICAgICAgICBkc2wuZXZhbHVhdGUoJ2ludmVyc2UnLCBibG9ja3MuaW52ZXJzZSk7XG4gICAgICB9XG4gICAgfSk7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/syntax/builtins/if', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; @@ -51477,7 +51370,7 @@ enifed('glimmer-runtime/lib/syntax/builtins/if', ['exports', 'glimmer-runtime/li exports.default = IfSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL2lmLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQVFBLFFBQUE7OEJBQUEsUUFBQTs7QUFHRSxpQkFIRixRQUFBLENBR3FCLElBQWlCLEVBQUE7QUFDbEMsdUNBQU8sQ0FBQztBQURTLGdCQUFBLENBQUEsSUFBSSxHQUFKLElBQUksQ0FBYTtBQUZwQyxnQkFBQSx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ORCkgPT4ge1xuICAgICAgaWYgKGJsb2Nrcy5pbnZlcnNlKSB7XG4gICAgICAgIGRzbC5qdW1wVW5sZXNzKCdFTFNFJyk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgICAgZHNsLmp1bXAoRU5EKTtcbiAgICAgICAgZHNsLmxhYmVsKCdFTFNFJyk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnaW52ZXJzZScsIGJsb2Nrcy5pbnZlcnNlKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGRzbC5qdW1wVW5sZXNzKEVORCk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgIH1cbiAgICB9KTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/syntax/builtins/in-element', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; @@ -51509,7 +51402,7 @@ enifed('glimmer-runtime/lib/syntax/builtins/in-element', ['exports', 'glimmer-ru exports.default = InElementSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL2luLWVsZW1lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBUUEsZUFBQTs4QkFBQSxlQUFBOztBQUdFLGlCQUhGLGVBQUEsQ0FHc0IsSUFBaUIsRUFBQTtBQUNuQyx1Q0FBTyxDQUFDO0FBRFUsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFhO0FBRnJDLGdCQUFBLENBQUEsSUFBSSxHQUFHLHNCQUFzQixDQUFDO1NBSTdCOztBQUxILHVCQUFBLFdBT0UsT0FBTyxHQUFBLGlCQUFDLEdBQXFCLEVBQUUsR0FBZ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ID0gXCJpbi1lbGVtZW50LXN0YXRlbWVudFwiO1xuXG4gIGNvbnN0cnVjdG9yKHByaXZhdGUgYXJnczogU3ludGF4LkFyZ3MpIHtcbiAgICBzdXBlcigpO1xuICB9XG5cbiAgY29tcGlsZShkc2w6IE9wY29kZUJ1aWxkZXJEU0wsIGVudjogRW52aXJvbm1lbnQpIHtcbiAgICBsZXQgeyBhcmdzLCBhcmdzOiB7IGJsb2NrcyB9IH0gPSB0aGlzO1xuXG4gICAgZHNsLnB1dEFyZ3MoYXJncyk7XG4gICAgZHNsLnRlc3QoJ3NpbXBsZScpO1xuXG4gICAgZHNsLmJsb2NrKG51bGwsIChkc2wsIEJFR0lOLCBFTkQpID0+IHtcbiAgICAgIGRzbC5qdW1wVW5sZXNzKEVORCk7XG4gICAgICBkc2wucHVzaFJlbW90ZUVsZW1lbnQoKTtcbiAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgIGRzbC5wb3BSZW1vdGVFbGVtZW50KCk7XG4gICAgfSk7XG4gIH1cbn1cbiJdfQ== + enifed("glimmer-runtime/lib/syntax/builtins/partial", ["exports", "glimmer-runtime/lib/syntax"], function (exports, _glimmerRuntimeLibSyntax) { "use strict"; @@ -51567,7 +51460,7 @@ enifed("glimmer-runtime/lib/syntax/builtins/partial", ["exports", "glimmer-runti exports.DynamicPartialSyntax = DynamicPartialSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL3BhcnRpYWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBY0EsbUJBQUE7OEJBQUEsbUJBQUE7O0FBR0UsaUJBSEYsbUJBQUEsQ0FHc0IsSUFBdUIsRUFBQTtBQUN6Qyx1Q0FBTyxDQUFDO0FBRFUsZ0JBQUEsQ0FBQSxJQUFJLE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WUobmFtZSk7XG4gICAgZHNsLnRlc3QoJ3NpbXBsZScpO1xuICAgIGRzbC5lbnRlcignQkVHSU4nLCAnRU5EJyk7XG4gICAgZHNsLmxhYmVsKCdCRUdJTicpO1xuICAgIGRzbC5qdW1wVW5sZXNzKCdFTkQnKTtcbiAgICBkc2wucHV0RHluYW1pY1BhcnRpYWxEZWZpbml0aW9uKCk7XG4gICAgZHNsLmV2YWx1YXRlUGFydGlhbCgpO1xuICAgIGRzbC5sYWJlbCgnRU5EJyk7XG4gICAgZHNsLmV4aXQoKTtcblxuICAgIGRzbC5zdG9wTGFiZWxzKCk7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/syntax/builtins/unless', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; @@ -51616,7 +51509,7 @@ enifed('glimmer-runtime/lib/syntax/builtins/unless', ['exports', 'glimmer-runtim exports.default = UnlessSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL3VubGVzcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFVQSxZQUFBOzhCQUFBLFlBQUE7O0FBR0UsaUJBSEYsWUFBQSxDQUdxQixJQUFpQixFQUFBO0FBQ2xDLHVDQUFPLENBQUM7QUFEUyxnQkFBQSxDQUFBLElBQUksR0FBSixJQUFJLENBQWE7QUFGcEMsZ0JBQUEsQ0FBQSxJQUFJLEdBQUcsa0JBQWtCLENBQUM7U0FJekI7O0FBTEgsb0JBQUEsV0FPRSxPQUFPLEdBQUEsaUJBQUMsR0FBcUIsRUFBRSxHQUFnQixFQUFBOzs7Ozs7Ozs7Ozs7Z0JBYXZDLElBQUksR0FBdUIsSUFBSSxDQUEvQixJQUFJO2dCQUFVLE1BQU0sR0FBTyxJQUFJLENBQXpCLElBQUksQ0FBSSxNQUFN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oJ0VORCcpO1xuICAgICAgICBkc2wubGFiZWwoJ0VMU0UnKTtcbiAgICAgICAgZHNsLmV2YWx1YXRlKCdpbnZlcnNlJywgYmxvY2tzLmludmVyc2UpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgZHNsLmp1bXBJZignRU5EJyk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgIH1cbiAgICB9KTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/syntax/builtins/with-dynamic-vars', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; @@ -51647,7 +51540,7 @@ enifed('glimmer-runtime/lib/syntax/builtins/with-dynamic-vars', ['exports', 'gli exports.default = WithDynamicVarsSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL3dpdGgtZHluYW1pYy12YXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQVFBLHFCQUFBOzhCQUFBLHFCQUFBOztBQUdFLGlCQUhGLHFCQUFBLENBR3NCLElBQWlCLEVBQUE7QUFDbkMsdUNBQU8sQ0FBQztBQURVLGdCQUFBLENBQUEsSUFBSSxHQUFKLElBQUksQ0FBYTtBQUZyQyxnQkFBQSxDQUFBLElBQUksR0FBRyw2QkFBNkIsQ0FBQztTQUlwQzs7QUFMSCw2QkFBQSxXQU9FLE9BQU8sR0FBQSxpQkFBQyxHQUFxQixFQUFFLEdBQWdCLEVBQUE7Z0JBQ3ZDLElBQUksR0FBdUIsSUFBSSxDQUEvQixJQUFJO2dCQUFVLE1BQU0sR0FBTyxJQUFJLENBQXpCLElBQUksQ0FBSSxNQUFNOztBQUUxQixlQUFHLENBQUMsSUFBSSxDQUFDLFVBQUEsR0FBRyxFQUFBO0FBQ1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Z3M6IHsgYmxvY2tzIH0gfSA9IHRoaXM7XG5cbiAgICBkc2wudW5pdChkc2wgPT4ge1xuICAgICAgZHNsLnB1dEFyZ3MoYXJncyk7XG4gICAgICBkc2wucHVzaER5bmFtaWNTY29wZSgpO1xuICAgICAgZHNsLmJpbmREeW5hbWljU2NvcGUoYXJncy5uYW1lZC5rZXlzKTtcbiAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgIGRzbC5wb3BEeW5hbWljU2NvcGUoKTtcbiAgICB9KTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/syntax/builtins/with', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; @@ -51696,7 +51589,7 @@ enifed('glimmer-runtime/lib/syntax/builtins/with', ['exports', 'glimmer-runtime/ exports.default = WithSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL3dpdGgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBU0EsVUFBQTs4QkFBQSxVQUFBOztBQUdFLGlCQUhGLFVBQUEsQ0FHcUIsSUFBaUIsRUFBQTtBQUNsQyx1Q0FBTyxDQUFDO0FBRFMsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFhO0FBRnBDLGdCQUFBLENBQUEsSUFBSSxHQUFHLGdCQUFnQixDQUFDO1NBSXZCOztBQUxILGtCQUFBLFdBT0UsT0FBTyxHQUFBLGlCQUFDLEdBQXFCLEVBQUUsR0FBZ0IsRUFBQTs7Ozs7Ozs7Ozs7O2dCQWF2QyxJQUFJLEdBQXVCLElBQUksQ0FBL0IsSUFBSTtnQkFBVSxNQUFNLEdBQU8sSUFBSSxDQUF6QixJQUFJLENBQUksTUFBTTs7QUFFMUIsZUFBR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sIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgICAgZHNsLmp1bXAoRU5EKTtcbiAgICAgICAgZHNsLmxhYmVsKCdFTFNFJyk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnaW52ZXJzZScsIGJsb2Nrcy5pbnZlcnNlKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGRzbC5qdW1wVW5sZXNzKEVORCk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgIH1cbiAgICB9KTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/syntax/core', ['exports', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/syntax/builtins/partial', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-runtime/lib/compiled/opcodes/component', 'glimmer-runtime/lib/compiled/opcodes/dom', 'glimmer-runtime/lib/syntax/expressions', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/compiled/expressions/value', 'glimmer-runtime/lib/compiled/expressions/lookups', 'glimmer-runtime/lib/compiled/expressions/has-block', 'glimmer-runtime/lib/compiled/expressions/helper', 'glimmer-runtime/lib/compiled/expressions/concat', 'glimmer-runtime/lib/utils', 'glimmer-runtime/lib/compiled/opcodes/content'], function (exports, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibSyntaxBuiltinsPartial, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerRuntimeLibCompiledOpcodesComponent, _glimmerRuntimeLibCompiledOpcodesDom, _glimmerRuntimeLibSyntaxExpressions, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibCompiledExpressionsValue, _glimmerRuntimeLibCompiledExpressionsLookups, _glimmerRuntimeLibCompiledExpressionsHasBlock, _glimmerRuntimeLibCompiledExpressionsHelper, _glimmerRuntimeLibCompiledExpressionsConcat, _glimmerRuntimeLibUtils, _glimmerRuntimeLibCompiledOpcodesContent) { 'use strict'; @@ -52955,9 +52848,11 @@ enifed('glimmer-runtime/lib/syntax/core', ['exports', 'glimmer-runtime/lib/synta var keys = this.keys; var values = this.values; - return new _glimmerRuntimeLibCompiledExpressionsArgs.CompiledNamedArgs(keys, values.map(function (value) { - return value.compile(compiler, env, symbolTable); - })); + var compiledValues = new Array(values.length); + for (var i = 0; i < compiledValues.length; i++) { + compiledValues[i] = values[i].compile(compiler, env, symbolTable); + } + return new _glimmerRuntimeLibCompiledExpressionsArgs.CompiledNamedArgs(keys, compiledValues); }; return NamedArgs; @@ -53000,7 +52895,7 @@ enifed('glimmer-runtime/lib/syntax/core', ['exports', 'glimmer-runtime/lib/synta return _class4; })(Args))(); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2NvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBMEdBLEtBQUE7OEJBQUEsS0FBQTs7QUFxQkUsaUJBckJGLEtBQUEsQ0FzQlcsSUFBYyxFQUNkLElBQVUsRUFBQTtBQUVqQix1Q0FBTyxDQUFDO0FBSEQsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFVO0FBQ2QsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFNO0FBdEJaLGdCQUFBLENBQUEsSUFBSSxHQUFHLE9BQU8sQ0FBQztTQXlCckI7O0FBMUJILGFBQUEsQ0FHUyxRQUFRLEdBQUEsa0JBQUMsSUFBZ0MsRUFBRSxXQUF3QixFQUFFLE9BQXFCLEVBQUE7Z0JBQ3hGLElBQUksR0FBeUMsSUFBSTtnQkFBM0MsTUFBTSxHQUFpQyxJQUFJO2dCQUFuQyxJQUFJLEdBQTJCLElBQUk7Z0JBQTdCLFVBQVUsR0FBZSxJQUFJO2dCQUFqQixTQUFTLEdBQUksSUFBST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immer-runtime/lib/syntax/expressions', ['exports', 'glimmer-runtime/lib/syntax/core', 'glimmer-wire-format'], function (exports, _glimmerRuntimeLibSyntaxCore, _glimmerWireFormat) { 'use strict'; @@ -53029,7 +52924,7 @@ enifed('glimmer-runtime/lib/syntax/expressions', ['exports', 'glimmer-runtime/li ; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2V4cHJlc3Npb25zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQWlCRSxLQUFLLHNCQUxMLFdBQVcsQ0FLWCxLQUFLO1FBQ0wsUUFBUSxzQkFOUixXQUFXLENBTVgsUUFBUTtRQUNSLEtBQUssc0JBUEwsV0FBVyxDQU9YLEtBQUs7UUFDTCxVQUFVLHNCQVJWLFdBQVcsQ0FRWCxVQUFVO1FBQ1YsZ0JBQWdCLHNCQVRoQixXQUFXLENBU1gsZ0JBQWdCO1FBQ2hCLFFBQVEsc0JBVlIsV0FBVyxDQVVYLFFBQVE7UUFDUixTQUFTLHNCQVhULFdBQVcsQ0FXWCxTQUFTO1FBQ1QsZ0JBQWdCLHNCQVpoQixXQUFXLENBWVgsZ0JBQWdCO1FBQ2hCLFdBQVcsc0JBYlgsV0FBVyxDQWFYLFdBQVc7O3NCQUdiLFVBQXdCLElBQTBCLEVBQUE7QUFDaEQsWUFBSSxnQkFBZ0IsQ0FBQyxJQUFJLENBQUMsRUFBRSxPQUFPLDZCQTVCbkMsS0FBSyxDQTRCMEMsUUFBUSxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQzlELFlBQUksV0FBVyxDQUFDLElBQUksQ0FBQyxFQUFFLE9BQU8sNkJBN0I5QixLQUFLLENBNkJxQyxLQUFLLENBQUMsU0FBUyxDQUFDLENBQUM7QUFDM0QsWUFBSSxLQUFLLENBQUMsSUFBSSxDQUFDLEVBQUUsT0FBTyw2QkE3QnhCLFdBQVcsQ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ybiBIZWxwZXJTeW50YXguZnJvbVNwZWMoc2V4cCk7XG4gIGlmIChpc1Vua25vd24oc2V4cCkpIHJldHVybiBVbmtub3duU3ludGF4LmZyb21TcGVjKHNleHApO1xuICBpZiAoaXNIYXNCbG9jayhzZXhwKSkgcmV0dXJuIEhhc0Jsb2NrU3ludGF4LmZyb21TcGVjKHNleHApO1xuICBpZiAoaXNIYXNCbG9ja1BhcmFtcyhzZXhwKSkgcmV0dXJuIEhhc0Jsb2NrUGFyYW1zU3ludGF4LmZyb21TcGVjKHNleHApO1xuXG4gIHRocm93IG5ldyBFcnJvcihgVW5leHBlY3RlZCB3aXJlIGZvcm1hdDogJHtKU09OLnN0cmluZ2lmeShzZXhwKX1gKTtcbn07XG4iXX0= + enifed('glimmer-runtime/lib/syntax/statements', ['exports', 'glimmer-runtime/lib/syntax/core', 'glimmer-wire-format'], function (exports, _glimmerRuntimeLibSyntaxCore, _glimmerWireFormat) { 'use strict'; @@ -53069,7 +52964,7 @@ enifed('glimmer-runtime/lib/syntax/statements', ['exports', 'glimmer-runtime/lib ; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L3N0YXRlbWVudHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBMkJFLE9BQU8sc0JBTlAsVUFBVSxDQU1WLE9BQU87UUFDUCxPQUFPLHNCQVBQLFVBQVUsQ0FPVixPQUFPO1FBQ1AsU0FBUyxzQkFSVCxVQUFVLENBUVYsU0FBUztRQUNULFFBQVEsc0JBVFIsVUFBVSxDQVNWLFFBQVE7UUFDUixhQUFhLHNCQVZiLFVBQVUsQ0FVVixhQUFhO1FBQ2IsTUFBTSxzQkFYTixVQUFVLENBV1YsTUFBTTtRQUNOLFNBQVMsc0JBWlQsVUFBVSxDQVlWLFNBQVM7UUFDVCxhQUFhLHNCQWJiLFVBQVUsQ0FhVixhQUFhO1FBQ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nJvbVNwZWMoKTtcbiAgaWYgKGlzQ2xvc2VFbGVtZW50KHNleHApKSByZXR1cm4gQ2xvc2VFbGVtZW50LmZyb21TcGVjKCk7XG4gIGlmIChpc1N0YXRpY0F0dHIoc2V4cCkpIHJldHVybiBTdGF0aWNBdHRyLmZyb21TcGVjKHNleHApO1xuICBpZiAoaXNTdGF0aWNBcmcoc2V4cCkpIHJldHVybiBTdGF0aWNBcmcuZnJvbVNwZWMoc2V4cCk7XG4gIGlmIChpc01vZGlmaWVyKHNleHApKSByZXR1cm4gTW9kaWZpZXIuZnJvbVNwZWMoc2V4cCk7XG59O1xuIl19 + enifed('glimmer-runtime/lib/template', ['exports', 'glimmer-util', 'glimmer-runtime/lib/builder', 'glimmer-runtime/lib/vm', 'glimmer-runtime/lib/scanner'], function (exports, _glimmerUtil, _glimmerRuntimeLibBuilder, _glimmerRuntimeLibVm, _glimmerRuntimeLibScanner) { 'use strict'; @@ -53120,7 +53015,7 @@ enifed('glimmer-runtime/lib/template', ['exports', 'glimmer-util', 'glimmer-runt return { id: id, meta: meta, _block: block, asEntryPoint: asEntryPoint, asLayout: asLayout, asPartial: asPartial, render: render }; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdGVtcGxhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O3NCQWtGQSxlQUFBOztBQVRBLFFBQUksUUFBUSxHQUFHLENBQUMsQ0FBQzs7QUFTakIsYUFBQSxlQUFBLENBQXdDLElBQXlELEVBQUE7WUFBdkQsRUFBRSxHQUFKLElBQXlELENBQXZELEVBQUU7WUFBRSxJQUFJLEdBQVYsSUFBeUQsQ0FBbkQsSUFBSTtZQUFFLEtBQUssR0FBakIsSUFBeUQsQ0FBN0MsS0FBSzs7QUFDdkQsWUFBSSxXQUFvQyxZQUFBLENBQUM7QUFDekMsWUFBSSxDQUFDLEVBQUUsRUFBRTtBQ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gKCFsYXlvdXQpIGxheW91dCA9IHNjYW5uZXIuc2NhbkxheW91dCgpO1xuICAgIHJldHVybiBsYXlvdXQ7XG4gIH07XG4gIGxldCBhc1BhcnRpYWwgPSBzeW1ib2xzID0+IHNjYW5uZXIuc2NhblBhcnRpYWwoc3ltYm9scyk7XG4gIGxldCByZW5kZXIgPSAoc2VsZjogUGF0aFJlZmVyZW5jZTxhbnk+LCBhcHBlbmRUbzogU2ltcGxlLkVsZW1lbnQsIGR5bmFtaWNTY29wZTogRHluYW1pY1Njb3BlKSA9PiB7XG4gICAgbGV0IGVsZW1lbnRTdGFjayA9IEVsZW1lbnRTdGFjay5mb3JJbml0aWFsUmVuZGVyKGVudiwgYXBwZW5kVG8sIG51bGwpO1xuICAgIGxldCBjb21waWxlZCA9IGFzRW50cnlQb2ludCgpLmNvbXBpbGUoZW52KTtcbiAgICBsZXQgdm0gPSBWTS5pbml0aWFsKGVudiwgc2VsZiwgZHluYW1pY1Njb3BlLCBlbGVtZW50U3RhY2ssIGNvbXBpbGVkLnN5bWJvbHMpO1xuICAgIHJldHVybiB2bS5leGVjdXRlKGNvbXBpbGVkLm9wcyk7XG4gIH07XG4gIHJldHVybiB7IGlkLCBtZXRhLCBfYmxvY2s6IGJsb2NrLCBhc0VudHJ5UG9pbnQsIGFzTGF5b3V0LCBhc1BhcnRpYWwsIHJlbmRlciB9O1xufVxuIl19 + enifed('glimmer-runtime/lib/upsert', ['exports', 'glimmer-runtime/lib/bounds'], function (exports, _glimmerRuntimeLibBounds) { 'use strict'; @@ -53288,13 +53183,24 @@ enifed('glimmer-runtime/lib/upsert', ['exports', 'glimmer-runtime/lib/bounds'], return NodeUpsert; })(Upsert); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdXBzZXJ0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQVVBLGFBQUEsWUFB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RklDQVRJT048Tm9kZT4pO1xuXG4gICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9IGVsc2Uge1xuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/utils', ['exports', 'glimmer-util'], function (exports, _glimmerUtil) { 'use strict'; - var EMPTY_ARRAY = Object.freeze([]); + var HAS_NATIVE_WEAKMAP = (function () { + // detect if `WeakMap` is even present + var hasWeakMap = typeof WeakMap === 'function'; + if (!hasWeakMap) { + return false; + } + var instance = new WeakMap(); + // use `Object`'s `.toString` directly to prevent us from detecting + // polyfills as native weakmaps + return Object.prototype.toString.call(instance) === '[object WeakMap]'; + })(); + var EMPTY_ARRAY = HAS_NATIVE_WEAKMAP ? Object.freeze([]) : []; exports.EMPTY_ARRAY = EMPTY_ARRAY; - var EMPTY_DICT = Object.freeze(_glimmerUtil.dict()); + var EMPTY_DICT = HAS_NATIVE_WEAKMAP ? Object.freeze(_glimmerUtil.dict()) : _glimmerUtil.dict(); exports.EMPTY_DICT = EMPTY_DICT; var ListRange = (function () { @@ -53322,7 +53228,7 @@ enifed('glimmer-runtime/lib/utils', ['exports', 'glimmer-util'], function (expor exports.ListRange = ListRange; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBRU8sUUFBTSxXQUFXLEdBQUcsTUFBTSxDQUFDLE1BQU0sQ0FBQyxFQUFFLENBQUMsQ0FBQzs7QUFDdEMsUUFBTSxVQUFVLEdBQWMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxhQUhwQyxJQUFJLEVBRzJDLENBQUMsQ0FBQzs7O1FBb0JoRSxTQUFBO0FBT0UsaUJBUEYsU0FBQSxDQU9jLElBQVMsRUFBRSxLQUFhLEVBQUUsR0FBVyxFQUFBO0FBQy9DLGdCQ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JsZSB7XG4gIGRlc3Ryb3koKTtcbn1cblxuZXhwb3J0IGludGVyZmFjZSBSYW5nZTxUPiB7XG4gIG1pbigpOiBudW1iZXI7XG4gIG1heCgpOiBudW1iZXI7XG4gIGF0KGluZGV4OiBudW1iZXIpOiBUO1xufVxuXG5leHBvcnQgY2xhc3MgTGlzdFJhbmdlPFQ+IGltcGxlbWVudHMgUmFuZ2U8VD4ge1xuICBwcml2YXRlIGxpc3Q6IFRbXTtcblxuICAvLyBbc3RhcnQsIGVuZF1cbiAgcHJpdmF0ZSBzdGFydDogbnVtYmVyO1xuICBwcml2YXRlIGVuZDogbnVtYmVyO1xuXG4gIGNvbnN0cnVjdG9yKGxpc3Q6IFRbXSwgc3RhcnQ6IG51bWJlciwgZW5kOiBudW1iZXIpIHtcbiAgICB0aGlzLmxpc3QgPSBsaXN0O1xuICAgIHRoaXMuc3RhcnQgPSBzdGFydDtcbiAgICB0aGlzLmVuZCA9IGVuZDtcbiAgfVxuXG4gIGF0KGluZGV4OiBudW1iZXIpOiBUIHtcbiAgICBpZiAoaW5kZXggPj0gdGhpcy5saXN0Lmxlbmd0aCkgcmV0dXJuIG51bGw7XG4gICAgcmV0dXJuIHRoaXMubGlzdFtpbmRleF07XG4gIH1cblxuICBtaW4oKTogbnVtYmVyIHtcbiAgICByZXR1cm4gdGhpcy5zdGFydDtcbiAgfVxuXG4gIG1heCgpOiBudW1iZXIge1xuICAgIHJldHVybiB0aGlzLmVuZDtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/vm', ['exports', 'glimmer-runtime/lib/vm/append', 'glimmer-runtime/lib/vm/update', 'glimmer-runtime/lib/vm/render-result'], function (exports, _glimmerRuntimeLibVmAppend, _glimmerRuntimeLibVmUpdate, _glimmerRuntimeLibVmRenderResult) { 'use strict'; @@ -53331,7 +53237,7 @@ enifed('glimmer-runtime/lib/vm', ['exports', 'glimmer-runtime/lib/vm/append', 'g exports.UpdatingVM = _glimmerRuntimeLibVmUpdate.default; exports.RenderResult = _glimmerRuntimeLibVmRenderResult.default; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1VBQW9CLEVBQUUsOEJBQWIsT0FBTztVQUFRLFFBQVEsOEJBQVIsUUFBUTtVQUNaLFVBQVUsOEJBQXJCLE9BQU87VUFDSSxZQUFZLG9DQUF2QixPQUFPIiwiZmlsZSI6InZtLmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgZGVmYXVsdCBhcyBWTSwgUHVibGljVk0gfSBmcm9tICcuL3ZtL2FwcGVuZCc7XG5leHBvcnQgeyBkZWZhdWx0IGFzIFVwZGF0aW5nVk0gfSBmcm9tICcuL3ZtL3VwZGF0ZSc7XG5leHBvcnQgeyBkZWZhdWx0IGFzIFJlbmRlclJlc3VsdCB9IGZyb20gJy4vdm0vcmVuZGVyLXJlc3VsdCc7XG4iXX0= + enifed('glimmer-runtime/lib/vm/append', ['exports', 'glimmer-runtime/lib/environment', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-runtime/lib/vm/update', 'glimmer-runtime/lib/vm/render-result', 'glimmer-runtime/lib/vm/frame'], function (exports, _glimmerRuntimeLibEnvironment, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerRuntimeLibVmUpdate, _glimmerRuntimeLibVmRenderResult, _glimmerRuntimeLibVmFrame) { 'use strict'; @@ -53636,7 +53542,7 @@ enifed('glimmer-runtime/lib/vm/append', ['exports', 'glimmer-runtime/lib/environ exports.default = VM; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0vYXBwZW5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQXlCQSxF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YXJncy5uYW1lZC5nZXQobmFtZXNbaV0pKTtcbiAgICB9XG4gIH1cbn1cblxuaW50ZXJmYWNlIEV4Y2VwdGlvbkhhbmRsZXIge1xuICBoYW5kbGVFeGNlcHRpb24oaW5pdGlhbGl6ZT86ICh2bTogVk0pID0+IHZvaWQpO1xufVxuXG5pbnRlcmZhY2UgUmV0dXJuSGFuZGxlciB7XG4gIHNldFJlbmRlclJlc3VsdChyZW5kZXJSZXN1bHQ6IFJlbmRlclJlc3VsdCk7XG59XG4iXX0= + enifed('glimmer-runtime/lib/vm/frame', ['exports'], function (exports) { 'use strict'; @@ -53830,7 +53736,7 @@ enifed('glimmer-runtime/lib/vm/frame', ['exports'], function (exports) { exports.FrameStack = FrameStack; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0vZnJhbWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBUUEsYUFBQSxHQUNFLFNBREYsYUFBQSxDQUVZLE9BQTJCLEVBQzNCLElBQW1CLEVBQ25CLFNBQTZCLEVBQUE7QUFGN0IsWUFBQSxDQUFBLE9BQU8sR0FBUCxPQUFPLENBQW9CO0FBQzNCLFlBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFlO0FBQ25CLFlBQUEsQ0FBQSxTQUFTLEdBQVQsU0FBUyxDQUFvQjtLQUNuQzs7OztRQUdOLEtBQUE7QUFZRSxpQkFaRixLQUFBLENBYUksR0FBVSxFQUdvQjtnQkFGdkIsU0FBUyx5REFBYyxJQUFJO2dCQUMzQixPQUFPLHlEQUFnQyxJQUFJO2dCQUMzQyxNQUFNLHlEQUFhLElBQUk7O0FBRnZCLGdCQUFBLENBQUEsU0FBUyxHQUFULFNBQVMsQ0FBa0I7QUFDM0IsZ0JBQUEsQ0FBQSxPQUFPLEdBQVAsT0FBTyxDQUFvQztBQUMzQyxnQkFBQSxDQUFBLE1BQ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mV4dE5vZGUob3ApKTtcbiAgICAgIHJldHVybiBvcDtcbiAgICB9IGVsc2Uge1xuICAgICAgdGhpcy5wb3AoKTtcbiAgICAgIHJldHVybiBudWxsO1xuICAgIH1cbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/vm/render-result', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/vm/update'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibVmUpdate) { 'use strict'; @@ -53883,7 +53789,7 @@ enifed('glimmer-runtime/lib/vm/render-result', ['exports', 'glimmer-runtime/lib/ exports.default = RenderResult; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0vcmVuZGVyLXJlc3VsdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFPQSxZQUFBO0FBQ0UsaUJBREYsWUFBQSxDQUVZLEdBQWdCLEVBQ2hCLFFBQW9DLEVBQ3BDLE1BQXlCLEVBQUE7QUFGekIsZ0JBQUEsQ0FBQSxHQUFHLEdBQUgsR0FBRyxDQUFhO0FBQ2hCLGdCQUFBLENBQUEsUUFBUSxHQUFSLFFBQVEsQ0FBNEI7QUFDcEMsZ0JBQUEsQ0FBQSxNQUFNLEdBQU4sTUFBTSxDQUFtQjtTQUMvQjs7QUFMTixvQkFBQSxXQU9FLFFBQVEsR0FBQSxvQkFBMkQ7NkVBQTNCLEVBQUUsZ0JBQWdCLEVBQUUsS0FBSyxFQUFFOzs2Q0FBeEQsZ0JBQWdCO2dCQUFoQixnQkFBZ0IseUNBQUcsS0FBSztnQkFDM0IsR0FBRyxHQUFlLElBQUksQ0FBdEIsR0FBRztnQkFBRSxRQUFRLEdBQUssSUFBSSxDQUFqQixRQUFROztBQUNuQixnQkFBSSxFQUFFLEdBQUcsdUNBQWUsR0FBRyxFQUFFLEVBQUUsZ0JBQWdCLEVBQWhCLGdCQUFnQixFQUFFLEN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ZXR1cm4gdGhpcy5ib3VuZHMubGFzdE5vZGUoKTtcbiAgfVxuXG4gIG9wY29kZXMoKTogTGlua2VkTGlzdDxVcGRhdGluZ09wY29kZT4ge1xuICAgIHJldHVybiB0aGlzLnVwZGF0aW5nO1xuICB9XG5cbiAgaGFuZGxlRXhjZXB0aW9uKCkge1xuICAgIHRocm93IFwidGhpcyBzaG91bGQgbmV2ZXIgaGFwcGVuXCI7XG4gIH1cblxuICBkZXN0cm95KCkge1xuICAgIHRoaXMuYm91bmRzLmRlc3Ryb3koKTtcbiAgICBjbGVhcih0aGlzLmJvdW5kcyk7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/vm/update', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/builder', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/vm/append'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibBuilder, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibVmAppend) { 'use strict'; @@ -54217,7 +54123,7 @@ enifed('glimmer-runtime/lib/vm/update', ['exports', 'glimmer-runtime/lib/bounds' return UpdatingVMFrame; })(); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0vdXBkYXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQTRCQSxVQUFBO0FBTUUsaUJBTkYsVUFBQSxDQU1jLEdBQWdCLEVBQUUsSUFBNEIsRUFBQTt3Q0FBNUIsSUFBNEIsQ0FBMUIsZ0JBQWdCO2dCQUFoQixnQkFBZ0IseUNBQUcsS0FBSzs7QUFGaEQsZ0JBQUEsQ0FBQSxVQUFVLEdBQTJCLGlCQTdCdEIsS0FBSyxFQTZCNkMsQ0FB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RlIHtcbiAgICBsZXQgeyBjdXJyZW50LCBvcHMgfSA9IHRoaXM7XG4gICAgaWYgKGN1cnJlbnQpIHRoaXMuY3VycmVudCA9IG9wcy5uZXh0Tm9kZShjdXJyZW50KTtcbiAgICByZXR1cm4gY3VycmVudDtcbiAgfVxuXG4gIGhhbmRsZUV4Y2VwdGlvbigpIHtcbiAgICB0aGlzLmV4Y2VwdGlvbkhhbmRsZXIuaGFuZGxlRXhjZXB0aW9uKCk7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-util/index', ['exports', 'glimmer-util/lib/namespaces', 'glimmer-util/lib/platform-utils', 'glimmer-util/lib/assert', 'glimmer-util/lib/logger', 'glimmer-util/lib/object-utils', 'glimmer-util/lib/guid', 'glimmer-util/lib/collections', 'glimmer-util/lib/list-utils'], function (exports, _glimmerUtilLibNamespaces, _glimmerUtilLibPlatformUtils, _glimmerUtilLibAssert, _glimmerUtilLibLogger, _glimmerUtilLibObjectUtils, _glimmerUtilLibGuid, _glimmerUtilLibCollections, _glimmerUtilLibListUtils) { 'use strict'; @@ -54246,7 +54152,7 @@ enifed('glimmer-util/index', ['exports', 'glimmer-util/lib/namespaces', 'glimmer exports.ListSlice = _glimmerUtilLibListUtils.ListSlice; exports.Slice = _glimmerUtilLibListUtils.Slice; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7VUFJUyxnQkFBZ0IsNkJBQWhCLGdCQUFnQjtVQUNoQixNQUFNLGdDQUFOLE1BQU07VUFBRSxLQUFLLGdDQUFMLEtBQUs7VUFBRSxNQUFNLGdDQUFOLE1BQU07VUFDVixNQUFNLHlCQUFqQixPQUFPO1VBQ0ksTUFBTSx5QkFBakIsT0FBTztVQUFZLE1BQU0seUJBQU4sTUFBTTtVQUFFLFFBQVEseUJBQVIsUUFBUTtVQUVuQyxNQUFNL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2ssIERpY3QsIFNldCwgRGljdFNldCwgZGljdCB9IGZyb20gJy4vbGliL2NvbGxlY3Rpb25zJztcbmV4cG9ydCB7IEVNUFRZX1NMSUNFLCBMaW5rZWRMaXN0LCBMaW5rZWRMaXN0Tm9kZSwgTGlzdE5vZGUsIENsb25lYWJsZUxpc3ROb2RlLCBMaXN0U2xpY2UsIFNsaWNlIH0gZnJvbSAnLi9saWIvbGlzdC11dGlscyc7XG5cbmV4cG9ydCB0eXBlIEZJWE1FPFQsIHN0cmluZz4gPSBUO1xuIl19 + enifed("glimmer-util/lib/assert", ["exports"], function (exports) { // import Logger from './logger'; // let alreadyWarned = false; @@ -54269,7 +54175,7 @@ enifed("glimmer-util/lib/assert", ["exports"], function (exports) { exports.default = debugAssert; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvYXNzZXJ0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O0FBSUEsYUFBQSxXQUFBLENBQTRCLElBQUksRUFBRSxHQUFHLEVBQUE7Ozs7O0FBTW5DLFlBQUksQ0FBQyxJQUFJLEVBQUU7QUFDVCxrQkFBTSxJQUFJLEtBQUssQ0FBQyxHQUFHLElBQUksbUJBQW1CLENBQUMsQ0FBQztTQUM3QztLQUNGOztBQUVELGFBQUEsVUFBQSxHQUFBLEVBQStCOztzQkFFaEIsV0FBVyIsImZpbGUiOiJhc3NlcnQuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBpbXBvcnQgTG9nZ2VyIGZyb20gJy4vbG9nZ2VyJztcblxuLy8gbGV0IGFscmVhZHlXYXJuZWQgPSBmYWxzZTtcblxuZXhwb3J0IGZ1bmN0aW9uIGRlYnVnQXNzZXJ0KHRlc3QsIG1zZykge1xuICAvLyBpZiAoIWFscmVhZHlXYXJuZWQpIHtcbiAgLy8gICBhbHJlYWR5V2FybmVkID0gdHJ1ZTtcbiAgLy8gICBMb2dnZXIud2FybihcIkRvbid0IGxlYXZlIGRlYnVnIGFzc2VydGlvbnMgb24gaW4gcHVibGljIGJ1aWxkc1wiKTtcbiAgLy8gfVxuXG4gIGlmICghdGVzdCkge1xuICAgIHRocm93IG5ldyBFcnJvcihtc2cgfHwgXCJhc3NlcnRpb24gZmFpbHVyZVwiKTtcbiAgfVxufVxuXG5leHBvcnQgZnVuY3Rpb24gcHJvZEFzc2VydCgpIHt9XG5cbmV4cG9ydCBkZWZhdWx0IGRlYnVnQXNzZXJ0O1xuIl19 + enifed('glimmer-util/lib/collections', ['exports', 'glimmer-util/lib/guid'], function (exports, _glimmerUtilLibGuid) { 'use strict'; @@ -54353,7 +54259,7 @@ enifed('glimmer-util/lib/collections', ['exports', 'glimmer-util/lib/guid'], fun exports.Stack = Stack; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvY29sbGVjdGlvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFZQSxRQUFJLEtBQUssR0FBRyxNQUFNLENBQUMsTUFBTSxDQUFDLElBQUksRUFBRTs7O0FBRzlCLG1CQUFXLEVBQUU7QUFDWCxpQkFBSyxFQUFFLFNBQVM7QUFDaEIsc0JBQVUsRUFBRSxLQUFLO0FBQ2pCLG9CQUFRLEVBQUUsSUFBSTtTQUNmO0tBQ0YsQ0FBQyxDQUFDO0FBRUgsYUFBQSxXQUFBLEdBQUEsRUFBeUI7QUFDekIsZUFBVyxDQUFDLFNBQVMsR0FBRyxLQUFLLENBQUM7O0FBRTlCLGFBQUEsSUFBQSxHQUFBOzs7OztBQUtFLGVBQU8sSUFBSSxXQUFXLEVBQUUsQ0FBQztLQUMxQjs7UUFJRCxPQUFBO0FBR0UsaUJBSEYsT0FBQSxHQUdFO0FBQ0UsZ0JBQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxFQUFLLENBQUM7U0F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iAgfVxufVxuIl19 + enifed("glimmer-util/lib/guid", ["exports"], function (exports) { "use strict"; @@ -54369,7 +54275,7 @@ enifed("glimmer-util/lib/guid", ["exports"], function (exports) { return object._guid || initializeGuid(object); } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvZ3VpZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLFFBQUksSUFBSSxHQUFHLENBQUMsQ0FBQzs7QUFNYixhQUFBLGNBQUEsQ0FBK0IsTUFBZSxFQUFBO0FBQzVDLGVBQVEsTUFBTSxDQUFDLEtBQUssR0FBRyxFQUFFLElBQUksQ0FBRTtLQUNoQzs7QUFFRCxhQUFBLFVBQUEsQ0FBMkIsTUFBZSxFQUFBO0FBQ3hDLGVBQU8sTUFBTSxDQUFDLEtBQUssSUFBSSxjQUFjLENBQUMsTUFBTSxDQUFDLENBQUM7S0FDL0MiLCJmaWxlIjoiZ3VpZC5qcyIsInNvdXJjZXNDb250ZW50IjpbImxldCBHVUlEID0gMDtcblxuZXhwb3J0IGludGVyZmFjZSBIYXNHdWlkIHtcbiAgX2d1aWQ6IG51bWJlcjtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGluaXRpYWxpemVHdWlkKG9iamVjdDogSGFzR3VpZCk6IG51bWJlciB7XG4gIHJldHVybiAob2JqZWN0Ll9ndWlkID0gKytHVUlEKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGVuc3VyZUd1aWQob2JqZWN0OiBIYXNHdWlkKTogbnVtYmVyIHtcbiAgcmV0dXJuIG9iamVjdC5fZ3VpZCB8fCBpbml0aWFsaXplR3VpZChvYmplY3QpO1xufSJdfQ== + enifed("glimmer-util/lib/list-utils", ["exports"], function (exports) { "use strict"; @@ -54593,7 +54499,7 @@ enifed("glimmer-util/lib/list-utils", ["exports"], function (exports) { var EMPTY_SLICE = new ListSlice(null, null); exports.EMPT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2Tm9kZShub2RlOiBUKTogVCB7XG4gICAgaWYgKG5vZGUgPT09IHRoaXMuX2hlYWQpIHJldHVybiBudWxsO1xuICAgIHJldHVybiA8VD5ub2RlLnByZXY7XG4gIH1cblxuICBpc0VtcHR5KCkge1xuICAgIHJldHVybiBmYWxzZTtcbiAgfVxufVxuXG5leHBvcnQgY29uc3QgRU1QVFlfU0xJQ0UgPSBuZXcgTGlzdFNsaWNlKG51bGwsIG51bGwpO1xuIl19 + enifed("glimmer-util/lib/logger", ["exports"], function (exports) { "use strict"; @@ -54683,7 +54589,7 @@ enifed("glimmer-util/lib/logger", ["exports"], function (exports) { var LOG_LEVEL = LogLevel.Warn; exports.default = new Logger({ console: _console, level: LOG_LEVEL }); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvbG9nZ2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLFFBQVksUUFLWCxDQUFBOztBQUxELEtBQUEsVUFBWSxRQUFRLEVBQUE7QUFDbEIsZ0JBQUEsQ0FBQSxRQUFBLENBQUEsT0FBQSxDQUFBLEdBQUEsQ0FBQSxDQUFBLEdBQUEsT0FBSyxDQUFBO0FBQ0wsZ0JBQUEsQ0FBQSxRQUFBLENBQUEsT0FBQSxDQUFBLEdBQUEsQ0FBQSxDQUFBLEdBQUEsT0FBSyxDQUFBO0FBQ0wsZ0JBQUEsQ0FBQSxRQUFBLENBQUEsTUFBQSxDQUFBLEdBQUEsQ0FBQSxDQUFBLEdBQUEsTUFBSSxDQUFBO0FBQ0osZ0JBQUEsQ0FBQSxRQUFBLENBQUEsT0FBQSxDQUFBLEdBQUEsQ0FBQSxDQUFBLEdBQUEsT0FBSyxDQUFBO0tBQ04sQ0FBQSxDQUxXLFFBQVEsYUFBUixRQUtYLEdBTFcsUUFBUSxHQUFBLEVBQUEsQ0FBQSxDQUFBLENBS25COztRQVNELFdBQUE7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ihtZXNzYWdlKTtcbiAgfVxufVxuXG5sZXQgX2NvbnNvbGUgPSAodHlwZW9mIGNvbnNvbGUgPT09ICd1bmRlZmluZWQnKSA/IG5ldyBOdWxsQ29uc29sZSgpIDogY29uc29sZTtcblxuY29uc3QgQUxXQVlTID0gbmV3IExvZ2dlcih7IGNvbnNvbGU6IF9jb25zb2xlLCBsZXZlbDogTG9nTGV2ZWwuVHJhY2UgfSk7XG5jb25zdCBMT0dfTEVWRUwgPSBMb2dMZXZlbC5XYXJuO1xuXG5leHBvcnQgZGVmYXVsdCBuZXcgTG9nZ2VyKHsgY29uc29sZTogX2NvbnNvbGUsIGxldmVsOiBMT0dfTEVWRUwgfSk7XG4iXX0= + enifed('glimmer-util/lib/namespaces', ['exports'], function (exports) { // There is a small whitelist of namespaced attributes specially // enumerated in @@ -54723,7 +54629,7 @@ enifed('glimmer-util/lib/namespaces', ['exports'], function (exports) { return WHITELIST[attrName] || null; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvbmFtZXNwYWNlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7OztBQWNBLFFBQU0sS0FBSyxHQUFHLDhCQUE4QixDQUFDO0FBQzdDLFFBQU0sR0FBRyxHQUFHLHNDQUFzQyxDQUFDO0FBQ25ELFFBQU0sS0FBSyxHQUFHLCtCQUErQixDQUFDO0FBRTlDLFFBQU0sU0FBUyxHQUFHO0FBQ2hCLHVCQUFlLEVBQUUsS0FBSztBQUN0Qix1QkFBZSxFQUFFLEtBQUs7QUFDdEIsb0JBQVksRUFBRSxLQUFLO0FBQ25CLG9CQUFZLEVBQUUsS0FBSztBQUNuQixvQkFBWSxFQUFFLEtBQUs7QUFDbkIscUJBQWEsRUFBRSxLQUFLO0FBQ3BCLG9CQUFZLEVBQUUsS0FBSztBQUNuQixrQkFBVSxFQUFFLEdBQUc7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c2VkIGluIHRoZSBIVE1MIHN5bnRheC5cblxuY29uc3QgWExJTksgPSAnaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayc7XG5jb25zdCBYTUwgPSAnaHR0cDovL3d3dy53My5vcmcvWE1MLzE5OTgvbmFtZXNwYWNlJztcbmNvbnN0IFhNTE5TID0gJ2h0dHA6Ly93d3cudzMub3JnLzIwMDAveG1sbnMvJztcblxuY29uc3QgV0hJVEVMSVNUID0ge1xuICAneGxpbms6YWN0dWF0ZSc6IFhMSU5LLFxuICAneGxpbms6YXJjcm9sZSc6IFhMSU5LLFxuICAneGxpbms6aHJlZic6IFhMSU5LLFxuICAneGxpbms6cm9sZSc6IFhMSU5LLFxuICAneGxpbms6c2hvdyc6IFhMSU5LLFxuICAneGxpbms6dGl0bGUnOiBYTElOSyxcbiAgJ3hsaW5rOnR5cGUnOiBYTElOSyxcbiAgJ3htbDpiYXNlJzogWE1MLFxuICAneG1sOmxhbmcnOiBYTUwsXG4gICd4bWw6c3BhY2UnOiBYTUwsXG4gICd4bWxucyc6IFhNTE5TLFxuICAneG1sbnM6eGxpbmsnOiBYTUxOU1xufTtcblxuZXhwb3J0IGZ1bmN0aW9uIGdldEF0dHJOYW1lc3BhY2UoYXR0ck5hbWUpIHtcbiAgcmV0dXJuIFdISVRFTElTVFthdHRyTmFtZV0gfHwgbnVsbDtcbn0iXX0= + enifed('glimmer-util/lib/object-utils', ['exports'], function (exports) { 'use strict'; @@ -54743,7 +54649,7 @@ enifed('glimmer-util/lib/object-utils', ['exports'], function (exports) { return obj; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvb2JqZWN0LXV0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7UUFBYyxPQUFPLEdBQUssTUFBTSxDQUF4QixJQUFJOztBQVNaLGFBQUEsTUFBQSxDQUF1QixHQUFHLEVBQUE7QUFDeE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ogViwgYzogVywgZDogWCk6IFQgJiBVICYgViAmIFcgJiBYO1xuZXhwb3J0IGZ1bmN0aW9uIGFzc2lnbjxULCBVLCBWLCBXLCBYLCBZPihvYmo6IFQsIGE6IFUsIGI6IFYsIGM6IFcsIGQ6IFgsIGU6IFkpOiBUICYgVSAmIFYgJiBXICYgWCAmIFk7XG5leHBvcnQgZnVuY3Rpb24gYXNzaWduPFQsIFUsIFYsIFcsIFgsIFksIFo+KG9iajogVCwgYTogVSwgYjogViwgYzogVywgZDogWCwgZTogWSwgZjogWik6IFQgJiBVICYgViAmIFcgJiBYICYgWSAmIFo7XG5leHBvcnQgZnVuY3Rpb24gYXNzaWduKHRhcmdldDogYW55LCAuLi5hcmdzOiBhbnlbXSk6IGFueTtcbmV4cG9ydCBmdW5jdGlvbiBhc3NpZ24ob2JqKSB7XG4gIGZvciAobGV0IGkgPSAxOyBpIDwgYXJndW1lbnRzLmxlbmd0aDsgaSsrKSB7XG4gICAgbGV0IGFzc2lnbm1lbnQgPSBhcmd1bWVudHNbaV07XG4gICAgaWYgKGFzc2lnbm1lbnQgPT09IG51bGwgfHwgdHlwZW9mIGFzc2lnbm1lbnQgIT09ICdvYmplY3QnKSBjb250aW51ZTtcbiAgICBsZXQga2V5cyA9IG9iaktleXMoYXNzaWdubWVudCk7XG4gICAgZm9yIChsZXQgaiA9IDA7IGogPCBrZXlzLmxlbmd0aDsgaisrKSB7XG4gICAgICBsZXQga2V5ID0ga2V5c1tqXTtcbiAgICAgIG9ialtrZXldID0gYXNzaWdubWVudFtrZXldO1xuICAgIH1cbiAgfVxuICByZXR1cm4gb2JqO1xufVxuIl19 + enifed("glimmer-util/lib/platform-utils", ["exports"], function (exports) { "use strict"; @@ -54754,7 +54660,7 @@ enifed("glimmer-util/lib/platform-utils", ["exports"], function (exports) { return val; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvcGxhdGZvcm0tdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFJQSxhQUFBLE1BQUEsQ0FBMEIsR0FBYSxFQUFBO0FBQ3JDLFlBQUksR0FBRyxLQUFLLElBQUksSUFBSSxHQUFHLEtBQUssU0FBUyxFQUFFLE1BQU0sSUFBSSxLQUFLLGdDQUFnQyxDQUFDO0FBQ3ZGLGVBQU8sR0FBRyxDQUFDO0tBQ1oiLCJmaWxlIjoicGxhdGZvcm0tdXRpbHMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgdHlwZSBPcGFxdWUgPSB7fSB8IHZvaWQ7XG5leHBvcnQgdHlwZSBPcHRpb248VD4gPSBUIHwgbnVsbDsgLy8gdHNsaW50OmRpc2FibGUtbGluZVxuZXhwb3J0IHR5cGUgTWF5YmU8VD4gPSBPcHRpb248VD4gfCB1bmRlZmluZWQ7IC8vIHRzbGludDpkaXNhYmxlLWxpbmVcblxuZXhwb3J0IGZ1bmN0aW9uIHVud3JhcDxUPih2YWw6IE1heWJlPFQ+KTogVCB7XG4gIGlmICh2YWwgPT09IG51bGwgfHwgdmFsID09PSB1bmRlZmluZWQpIHRocm93IG5ldyBFcnJvcihgRXhwZWN0ZWQgdmFsdWUgdG8gYmUgcHJlc2VudGApO1xuICByZXR1cm4gdmFsO1xufVxuIl19 + enifed("glimmer-util/lib/quoting", ["exports"], function (exports) { "use strict"; @@ -54790,7 +54696,7 @@ enifed("glimmer-util/lib/quoting", ["exports"], function (exports) { return str; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvcXVvdGluZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLGFBQUEsWUFBQSxDQUFzQixHQUFHLEVBQUE7QUFDdkIsV0FBRyxHQUFHLEdBQUcsQ0FBQyxPQUFPLENBQUMsS0FBSyxFQUFFLE1BQU0sQ0FBQ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cXFxcIicpO1xuICBzdHIgPSBzdHIucmVwbGFjZSgvXFxuL2csIFwiXFxcXG5cIik7XG4gIHJldHVybiBzdHI7XG59XG5cbmV4cG9ydCB7IGVzY2FwZVN0cmluZyB9O1xuXG5mdW5jdGlvbiBzdHJpbmcoc3RyKSB7XG4gIHJldHVybiAnXCInICsgZXNjYXBlU3RyaW5nKHN0cikgKyAnXCInO1xufVxuXG5leHBvcnQgeyBzdHJpbmcgfTtcblxuZnVuY3Rpb24gYXJyYXkoYSkge1xuICByZXR1cm4gXCJbXCIgKyBhICsgXCJdXCI7XG59XG5cbmV4cG9ydCB7IGFycmF5IH07XG5cbmV4cG9ydCBmdW5jdGlvbiBoYXNoKHBhaXJzKSB7XG4gIHJldHVybiBcIntcIiArIHBhaXJzLmpvaW4oXCIsIFwiKSArIFwifVwiO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gcmVwZWF0KGNoYXJzLCB0aW1lcykge1xuICBsZXQgc3RyID0gXCJcIjtcbiAgd2hpbGUgKHRpbWVzLS0pIHtcbiAgICBzdHIgKz0gY2hhcnM7XG4gIH1cbiAgcmV0dXJuIHN0cjtcbn1cbiJdfQ== + enifed('glimmer-wire-format/index', ['exports'], function (exports) { 'use strict'; @@ -54838,7 +54744,7 @@ enifed('glimmer-wire-format/index', ['exports'], function (exports) { Statements.isTrustingAttr = is('trusting-attr'); })(Statements || (exports.Statements = Statements = {})); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItd2lyZS1mb3JtYXQvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBbUJBLGFBQUEsRUFBQSxDQUE2QixPQUFlLEVBQUE7QUFDMUMsZUFBTyxVQUFTLEtBQVksRUFBQTtBQUMxQixtQkFBTyxLQUFLLENBQUMsQ0FBQyxDQUFDLEtBQUssT0FBTyxDQUFDO1NBQzdCLENBQUM7S0FDSDtBQVVELFFBQWlCL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4gKiBAdHlwZWRlZiB7c3RyaW5nfSBTZXJpYWxpemVkVGVtcGxhdGVCbG9ja0pTT05cbiAqL1xuZXhwb3J0IHR5cGUgU2VyaWFsaXplZFRlbXBsYXRlQmxvY2tKU09OID0gc3RyaW5nO1xuXG4vKipcbiAqIEEgSlNPTiBvYmplY3QgY29udGFpbmluZyB0aGUgU2VyaWFsaXplZFRlbXBsYXRlQmxvY2sgYXMgSlNPTiBhbmQgVGVtcGxhdGVNZXRhLlxuICovXG5leHBvcnQgaW50ZXJmYWNlIFNlcmlhbGl6ZWRUZW1wbGF0ZVdpdGhMYXp5QmxvY2s8VCBleHRlbmRzIFRlbXBsYXRlTWV0YT4ge1xuICBpZD86IHN0cmluZztcbiAgYmxvY2s6IFNlcmlhbGl6ZWRUZW1wbGF0ZUJsb2NrSlNPTjtcbiAgbWV0YTogVDtcbn1cblxuLyoqXG4gKiBBIHN0cmluZyBvZiBKYXZhc2NyaXB0IGNvbnRhaW5pbmcgYSBTZXJpYWxpemVkVGVtcGxhdGVXaXRoTGF6eUJsb2NrIHRvIGJlXG4gKiBjb25jYXRlbmF0ZWQgaW50byBhIEphdmFzY3JpcHQgbW9kdWxlLlxuICogQHR5cGVkZWYge3N0cmluZ30gVGVtcGxhdGVKYXZhc2NyaXB0XG4gKi9cbmV4cG9ydCB0eXBlIFRlbXBsYXRlSmF2YXNjcmlwdCA9IHN0cmluZztcbiJdfQ== + enifed('glimmer/index', ['exports', 'glimmer-compiler'], function (exports, _glimmerCompiler) { /* * @overview Glimmer @@ -54851,7 +54757,7 @@ enifed('glimmer/index', ['exports', 'glimmer-compiler'], function (exports, _gli exports.precompile = _glimmerCompiler.precompile; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztVQU9TLFVBQVUsb0JBQVYsVUFBVSIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBAb3ZlcnZpZXcgIEdsaW1tZXJcbiAqIEBjb3B5cmlnaHQgQ29weXJpZ2h0IDIwMTEtMjAxNSBUaWxkZSBJbmMuIGFuZCBjb250cmlidXRvcnNcbiAqIEBsaWNlbnNlICAgTGljZW5zZWQgdW5kZXIgTUlUIGxpY2Vuc2VcbiAqICAgICAgICAgICAgU2VlIGh0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS90aWxkZWlvL2dsaW1tZXIvbWFzdGVyL0xJQ0VOU0VcbiAqIEB2ZXJzaW9uICAgVkVSU0lPTl9TVFJJTkdfUExBQ0VIT0xERVJcbiAqL1xuZXhwb3J0IHsgcHJlY29tcGlsZSB9IGZyb20gJ2dsaW1tZXItY29tcGlsZXInO1xuIl19 + enifed('route-recognizer', ['exports'], function (exports) { 'use strict'; function Target(path, matcher, delegate) { @@ -55910,30 +55816,6 @@ TransitionState.prototype = { } }; -function TransitionAbortedError(message) { - if (!(this instanceof TransitionAbortedError)) { - return new TransitionAbortedError(message); - } - - var error = Error.call(this, message); - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, TransitionAbortedError); - } else { - this.stack = error.stack; - } - - this.description = error.description; - this.fileName = error.fileName; - this.lineNumber = error.lineNumber; - this.message = error.message || 'TransitionAborted'; - this.name = 'TransitionAborted'; - this.number = error.number; - this.code = error.code; -} - -TransitionAbortedError.prototype = oCreate(Error.prototype); - /** A Transition is a thennable (a promise-like object) that represents an attempt to transition to another route. It can be aborted, either @@ -56258,11 +56140,16 @@ Transition.prototype.send = Transition.prototype.trigger; /** @private - Logs and returns an instance of TransitionAbortedError. + Logs and returns a TransitionAborted error. */ function logAbort(transition) { log(transition.router, transition.sequence, "detected abort."); - return new TransitionAbortedError(); + return new TransitionAborted(); +} + +function TransitionAborted(message) { + this.message = (message || "TransitionAborted"); + this.name = "TransitionAborted"; } function TransitionIntent(props) { @@ -56822,26 +56709,14 @@ var NamedTransitionIntent = subclass(TransitionIntent, { } }); +/** + Promise reject reasons passed to promise rejection + handlers for failed transitions. + */ function UnrecognizedURLError(message) { - if (!(this instanceof UnrecognizedURLError)) { - return new UnrecognizedURLError(message); - } - - var error = Error.call(this, message); - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, UnrecognizedURLError); - } else { - this.stack = error.stack; - } - - this.description = error.description; - this.fileName = error.fileName; - this.lineNumber = error.lineNumber; - this.message = error.message || 'UnrecognizedURL'; - this.name = 'UnrecognizedURLError'; - this.number = error.number; - this.code = error.code; + this.message = (message || "UnrecognizedURLError"); + this.name = "UnrecognizedURLError"; + Error.call(this); } UnrecognizedURLError.prototype = oCreate(Error.prototype); @@ -57398,7 +57273,7 @@ function handlerEnteredOrUpdated(currentHandlerInfos, handlerInfo, enter, transi } if (transition && transition.isAborted) { - throw new TransitionAbortedError(); + throw new TransitionAborted(); } handler.context = context; @@ -57406,7 +57281,7 @@ function handlerEnteredOrUpdated(currentHandlerInfos, handlerInfo, enter, transi callHook(handler, 'setup', context, transition); if (transition && transition.isAborted) { - throw new TransitionAbortedError(); + throw new TransitionAborted(); } currentHandlerInfos.push(handlerInfo); @@ -57598,7 +57473,7 @@ function finalizeTransition(transition, newState) { // Resolve with the final handler. return handlerInfos[handlerInfos.length - 1].handler; } catch(e) { - if (!(e instanceof TransitionAbortedError)) { + if (!(e instanceof TransitionAborted)) { //var erroneousHandler = handlerInfos.pop(); var infos = transition.state.handlerInfos; transition.trigger(true, 'error', e, transition, infos[infos.length-1].handler); @@ -57755,2533 +57630,2506 @@ exports.Transition = Transition; Object.defineProperty(exports, '__esModule', { value: true }); }); -enifed('rsvp', ['exports'], function (exports) { - 'use strict'; - - var _rsvp; +/*! + * @overview RSVP - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/tildeio/rsvp.js/master/LICENSE + * @version 3.2.1 + */ - function indexOf(callbacks, callback) { - for (var i = 0, l = callbacks.length; i < l; i++) { - if (callbacks[i] === callback) { - return i; - } - } +enifed('rsvp', ['exports'], function (exports) { 'use strict'; - return -1; +function indexOf(callbacks, callback) { + for (var i=0, l=callbacks.length; i 1) { - throw new Error('Second argument not supported'); - } - if (typeof o !== 'object') { - throw new TypeError('Argument must be an object'); - } - F.prototype = o; - return new F(); - }; + object.trigger('stuff'); // callback1 and callback2 will be executed. - var queue = []; + object.off('stuff'); + object.trigger('stuff'); // callback1 and callback2 will not be executed! + ``` - function scheduleFlush() { - setTimeout(function () { - for (var i = 0; i < queue.length; i++) { - var entry = queue[i]; + @method off + @for RSVP.EventTarget + @private + @param {String} eventName event to stop listening to + @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) { + var allCallbacks = callbacksFor(this), callbacks, index; - var payload = entry.payload; + if (!callback) { + allCallbacks[eventName] = []; + return; + } - payload.guid = payload.key + payload.id; - payload.childGuid = payload.key + payload.childId; - if (payload.error) { - payload.stack = payload.error.stack; - } + callbacks = allCallbacks[eventName]; - config['trigger'](entry.name, entry.payload); - } - queue.length = 0; - }, 50); - } + index = indexOf(callbacks, callback); - function instrument(eventName, promise, child) { - if (1 === queue.push({ - name: eventName, - payload: { - key: promise._guidKey, - id: promise._id, - eventName: eventName, - detail: promise._result, - childId: child && child._id, - label: promise._label, - timeStamp: now(), - error: config["instrument-with-stack"] ? new Error(promise._label) : null - } })) { - scheduleFlush(); - } - } + if (index !== -1) { callbacks.splice(index, 1); } + }, /** - `RSVP.Promise.resolve` returns a promise that will become resolved with the - passed `value`. It is shorthand for the following: - + Use `trigger` to fire custom events. For example: + ```javascript - let promise = new RSVP.Promise(function(resolve, reject){ - resolve(1); - }); - - promise.then(function(value){ - // value === 1 + object.on('foo', function(){ + console.log('foo event happened!'); }); + object.trigger('foo'); + // 'foo event happened!' logged to the console ``` - - Instead of writing the above, your code now simply becomes the following: - + + You can also pass a value as a second argument to `trigger` that will be + passed as an argument to all event listeners for the event: + ```javascript - let promise = RSVP.Promise.resolve(1); - - promise.then(function(value){ - // value === 1 + object.on('foo', function(value){ + console.log(value.name); }); + + object.trigger('foo', { name: 'bar' }); + // 'bar' logged to the console ``` - - @method resolve - @static - @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` + + @method trigger + @for RSVP.EventTarget + @private + @param {String} eventName name of the event to be triggered + @param {*} options optional value to be passed to any event handlers for + the given `eventName` */ - function resolve$1(object, label) { - /*jshint validthis:true */ - var Constructor = this; + 'trigger': function(eventName, options, label) { + var allCallbacks = callbacksFor(this), callbacks, callback; - if (object && typeof object === 'object' && object.constructor === Constructor) { - return object; + if (callbacks = allCallbacks[eventName]) { + // Don't cache the callbacks.length since it may grow + for (var i=0; i 1) { + throw new Error('Second argument not supported'); } - - function handleOwnThenable(promise, thenable) { - if (thenable._state === FULFILLED) { - fulfill(promise, thenable._result); - } else if (thenable._state === REJECTED) { - thenable._onError = null; - reject(promise, thenable._result); - } else { - subscribe(thenable, undefined, function (value) { - if (thenable !== value) { - resolve(promise, value, undefined); - } else { - fulfill(promise, value); - } - }, function (reason) { - return reject(promise, reason); - }); - } + if (typeof o !== 'object') { + throw new TypeError('Argument must be an object'); } + F.prototype = o; + return new F(); +}); - function handleMaybeThenable(promise, maybeThenable, then$$) { - if (maybeThenable.constructor === promise.constructor && then$$ === then && promise.constructor.resolve === resolve$1) { - handleOwnThenable(promise, maybeThenable); - } else { - if (then$$ === GET_THEN_ERROR) { - reject(promise, GET_THEN_ERROR.error); - } else if (then$$ === undefined) { - fulfill(promise, maybeThenable); - } else if (isFunction(then$$)) { - handleForeignThenable(promise, maybeThenable, then$$); - } else { - fulfill(promise, maybeThenable); +var queue = []; + +function scheduleFlush() { + setTimeout(function() { + var entry; + for (var i = 0; i < queue.length; i++) { + entry = queue[i]; + + var payload = entry.payload; + + payload.guid = payload.key + payload.id; + payload.childGuid = payload.key + payload.childId; + if (payload.error) { + payload.stack = payload.error.stack; } + + config['trigger'](entry.name, entry.payload); } - } + queue.length = 0; + }, 50); +} - function resolve(promise, value) { - if (promise === value) { - fulfill(promise, value); - } else if (objectOrFunction(value)) { - handleMaybeThenable(promise, value, getThen(value)); - } else { - fulfill(promise, value); +function instrument(eventName, promise, child) { + if (1 === queue.push({ + name: eventName, + payload: { + key: promise._guidKey, + id: promise._id, + eventName: eventName, + detail: promise._result, + childId: child && child._id, + label: promise._label, + timeStamp: now(), + error: config["instrument-with-stack"] ? new Error(promise._label) : null + }})) { + scheduleFlush(); } } - function publishRejection(promise) { - if (promise._onError) { - promise._onError(promise._result); - } +/** + `RSVP.Promise.resolve` returns a promise that will become resolved with the + passed `value`. It is shorthand for the following: + + ```javascript + var promise = new RSVP.Promise(function(resolve, reject){ + resolve(1); + }); + + promise.then(function(value){ + // value === 1 + }); + ``` + + Instead of writing the above, your code now simply becomes the following: + + ```javascript + var promise = RSVP.Promise.resolve(1); + + promise.then(function(value){ + // value === 1 + }); + ``` + + @method resolve + @static + @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` +*/ +function resolve$1(object, label) { + /*jshint validthis:true */ + var Constructor = this; - publish(promise); + if (object && typeof object === 'object' && object.constructor === Constructor) { + return object; } - function fulfill(promise, value) { - if (promise._state !== PENDING) { - return; - } + var promise = new Constructor(noop, label); + resolve(promise, object); + return promise; +} + +function withOwnPromise() { + return new TypeError('A promises callback cannot return that same promise.'); +} + +function noop() {} - promise._result = value; - promise._state = FULFILLED; +var PENDING = void 0; +var FULFILLED = 1; +var REJECTED = 2; + +var GET_THEN_ERROR = new ErrorObject(); + +function getThen(promise) { + try { + return promise.then; + } catch(error) { + GET_THEN_ERROR.error = error; + return GET_THEN_ERROR; + } +} + +function tryThen(then, value, fulfillmentHandler, rejectionHandler) { + try { + then.call(value, fulfillmentHandler, rejectionHandler); + } catch(e) { + return e; + } +} - if (promise._subscribers.length === 0) { - if (config.instrument) { - instrument('fulfilled', promise); +function handleForeignThenable(promise, thenable, then) { + config.async(function(promise) { + var sealed = false; + var error = tryThen(then, thenable, function(value) { + if (sealed) { return; } + sealed = true; + if (thenable !== value) { + resolve(promise, value, undefined); + } else { + fulfill(promise, value); } - } else { - config.async(publish, promise); + }, function(reason) { + if (sealed) { return; } + sealed = true; + + reject(promise, reason); + }, 'Settle: ' + (promise._label || ' unknown promise')); + + if (!sealed && error) { + sealed = true; + reject(promise, error); } + }, promise); +} + +function handleOwnThenable(promise, thenable) { + if (thenable._state === FULFILLED) { + fulfill(promise, thenable._result); + } else if (thenable._state === REJECTED) { + thenable._onError = null; + reject(promise, thenable._result); + } else { + subscribe(thenable, undefined, function(value) { + if (thenable !== value) { + resolve(promise, value, undefined); + } else { + fulfill(promise, value); + } + }, function(reason) { + reject(promise, reason); + }); } +} - function reject(promise, reason) { - if (promise._state !== PENDING) { - return; +function handleMaybeThenable(promise, maybeThenable, then$$) { + if (maybeThenable.constructor === promise.constructor && + then$$ === then && + constructor.resolve === resolve$1) { + handleOwnThenable(promise, maybeThenable); + } else { + if (then$$ === GET_THEN_ERROR) { + reject(promise, GET_THEN_ERROR.error); + } else if (then$$ === undefined) { + fulfill(promise, maybeThenable); + } else if (isFunction(then$$)) { + handleForeignThenable(promise, maybeThenable, then$$); + } else { + fulfill(promise, maybeThenable); } - promise._state = REJECTED; - promise._result = reason; - config.async(publishRejection, promise); } +} - function subscribe(parent, child, onFulfillment, onRejection) { - var subscribers = parent._subscribers; - var length = subscribers.length; +function resolve(promise, value) { + if (promise === value) { + fulfill(promise, value); + } else if (objectOrFunction(value)) { + handleMaybeThenable(promise, value, getThen(value)); + } else { + fulfill(promise, value); + } +} - parent._onError = null; +function publishRejection(promise) { + if (promise._onError) { + promise._onError(promise._result); + } - subscribers[length] = child; - subscribers[length + FULFILLED] = onFulfillment; - subscribers[length + REJECTED] = onRejection; + publish(promise); +} - if (length === 0 && parent._state) { - config.async(publish, parent); - } - } +function fulfill(promise, value) { + if (promise._state !== PENDING) { return; } - function publish(promise) { - var subscribers = promise._subscribers; - var settled = promise._state; + promise._result = value; + promise._state = FULFILLED; + if (promise._subscribers.length === 0) { if (config.instrument) { - instrument(settled === FULFILLED ? 'fulfilled' : 'rejected', promise); + instrument('fulfilled', promise); } + } else { + config.async(publish, promise); + } +} - if (subscribers.length === 0) { - return; - } +function reject(promise, reason) { + if (promise._state !== PENDING) { return; } + promise._state = REJECTED; + promise._result = reason; + config.async(publishRejection, promise); +} - var child = undefined, - callback = undefined, - detail = promise._result; +function subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers; + var length = subscribers.length; - for (var i = 0; i < subscribers.length; i += 3) { - child = subscribers[i]; - callback = subscribers[i + settled]; + parent._onError = null; - if (child) { - invokeCallback(settled, child, callback, detail); - } else { - callback(detail); - } - } + subscribers[length] = child; + subscribers[length + FULFILLED] = onFulfillment; + subscribers[length + REJECTED] = onRejection; - promise._subscribers.length = 0; + if (length === 0 && parent._state) { + config.async(publish, parent); } +} + +function publish(promise) { + var subscribers = promise._subscribers; + var settled = promise._state; - function ErrorObject() { - this.error = null; + if (config.instrument) { + instrument(settled === FULFILLED ? 'fulfilled' : 'rejected', promise); } - var TRY_CATCH_ERROR = new ErrorObject(); + if (subscribers.length === 0) { return; } - function tryCatch(callback, detail) { - try { - return callback(detail); - } catch (e) { - TRY_CATCH_ERROR.error = e; - return TRY_CATCH_ERROR; + var child, callback, detail = promise._result; + + for (var i = 0; i < subscribers.length; i += 3) { + child = subscribers[i]; + callback = subscribers[i + settled]; + + if (child) { + invokeCallback(settled, child, callback, detail); + } else { + callback(detail); } } - function invokeCallback(settled, promise, callback, detail) { - var hasCallback = isFunction(callback), - value = undefined, - error = undefined, - succeeded = undefined, - failed = undefined; + promise._subscribers.length = 0; +} + +function ErrorObject() { + this.error = null; +} - if (hasCallback) { - value = tryCatch(callback, detail); +var TRY_CATCH_ERROR = new ErrorObject(); - if (value === TRY_CATCH_ERROR) { - failed = true; - error = value.error; - value = null; - } else { - succeeded = true; - } +function tryCatch(callback, detail) { + try { + return callback(detail); + } catch(e) { + TRY_CATCH_ERROR.error = e; + return TRY_CATCH_ERROR; + } +} - if (promise === value) { - reject(promise, withOwnPromise()); - return; - } +function invokeCallback(settled, promise, callback, detail) { + var hasCallback = isFunction(callback), + value, error, succeeded, failed; + + if (hasCallback) { + value = tryCatch(callback, detail); + + if (value === TRY_CATCH_ERROR) { + failed = true; + error = value.error; + value = null; } else { - value = detail; succeeded = true; } - 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 (value) { - if (resolved) { - return; - } - resolved = true; - resolve(promise, value); - }, function (reason) { - if (resolved) { - return; - } - resolved = true; - reject(promise, reason); - }); - } catch (e) { - reject(promise, e); + if (promise === value) { + reject(promise, withOwnPromise()); + return; } + + } else { + value = detail; + succeeded = true; } - function then(onFulfillment, onRejection, label) { - var _arguments = arguments; + 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); + } +} - var parent = this; - var state = parent._state; +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); + } +} - if (state === FULFILLED && !onFulfillment || state === REJECTED && !onRejection) { - config.instrument && instrument('chained', parent, parent); - return parent; - } +function then(onFulfillment, onRejection, label) { + var parent = this; + var state = parent._state; - parent._onError = null; + if (state === FULFILLED && !onFulfillment || state === REJECTED && !onRejection) { + config.instrument && instrument('chained', parent, parent); + return parent; + } - var child = new parent.constructor(noop, label); - var result = parent._result; + parent._onError = null; - config.instrument && instrument('chained', parent, child); + var child = new parent.constructor(noop, label); + var result = parent._result; - if (state) { - (function () { - var callback = _arguments[state - 1]; - config.async(function () { - return invokeCallback(state, child, callback, result); - }); - })(); - } else { - subscribe(parent, child, onFulfillment, onRejection); - } + config.instrument && instrument('chained', parent, child); - return child; + if (state) { + var callback = arguments[state - 1]; + config.async(function(){ + invokeCallback(state, child, callback, result); + }); + } else { + subscribe(parent, child, onFulfillment, onRejection); } - function makeSettledResult(state, position, value) { - if (state === FULFILLED) { - return { - state: 'fulfilled', - value: value - }; - } else { - return { - state: 'rejected', - reason: value - }; - } + return child; +} + +function makeSettledResult(state, position, value) { + if (state === FULFILLED) { + return { + state: 'fulfilled', + value: value + }; + } else { + return { + state: 'rejected', + reason: value + }; } +} - function Enumerator(Constructor, input, abortOnReject, label) { - this._instanceConstructor = Constructor; - this.promise = new Constructor(noop, label); - this._abortOnReject = abortOnReject; +function Enumerator(Constructor, input, abortOnReject, label) { + this._instanceConstructor = Constructor; + this.promise = new Constructor(noop, label); + this._abortOnReject = abortOnReject; - if (this._validateInput(input)) { - this._input = input; - this.length = input.length; - this._remaining = input.length; + if (this._validateInput(input)) { + this._input = input; + this.length = input.length; + this._remaining = input.length; - this._init(); + this._init(); - if (this.length === 0) { + if (this.length === 0) { + fulfill(this.promise, this._result); + } else { + this.length = this.length || 0; + this._enumerate(); + if (this._remaining === 0) { fulfill(this.promise, this._result); - } else { - this.length = this.length || 0; - this._enumerate(); - if (this._remaining === 0) { - fulfill(this.promise, this._result); - } } - } else { - reject(this.promise, this._validationError()); } + } else { + reject(this.promise, this._validationError()); } +} - Enumerator.prototype._validateInput = function (input) { - return isArray(input); - }; +Enumerator.prototype._validateInput = function(input) { + return isArray(input); +}; - Enumerator.prototype._validationError = function () { - return new Error('Array Methods must be provided an Array'); - }; +Enumerator.prototype._validationError = function() { + return new Error('Array Methods must be provided an Array'); +}; - Enumerator.prototype._init = function () { - this._result = new Array(this.length); - }; +Enumerator.prototype._init = function() { + this._result = new Array(this.length); +}; - Enumerator.prototype._enumerate = function () { - var length = this.length; - var promise = this.promise; - var input = this._input; +Enumerator.prototype._enumerate = function() { + var length = this.length; + var promise = this.promise; + var input = this._input; - for (var i = 0; promise._state === PENDING && i < length; i++) { - this._eachEntry(input[i], i); - } - }; + for (var i = 0; promise._state === PENDING && i < length; i++) { + this._eachEntry(input[i], i); + } +}; - Enumerator.prototype._settleMaybeThenable = function (entry, i) { - var c = this._instanceConstructor; - var resolve = c.resolve; - - if (resolve === resolve$1) { - var then$$ = getThen(entry); - - if (then$$ === then && entry._state !== PENDING) { - entry._onError = null; - this._settledAt(entry._state, i, entry._result); - } else if (typeof then$$ !== 'function') { - this._remaining--; - this._result[i] = this._makeResult(FULFILLED, i, entry); - } else if (c === Promise) { - var promise = new c(noop); - handleMaybeThenable(promise, entry, then$$); - this._willSettleAt(promise, i); - } else { - this._willSettleAt(new c(function (resolve) { - return resolve(entry); - }), i); - } - } else { - this._willSettleAt(resolve(entry), i); - } - }; +Enumerator.prototype._settleMaybeThenable = function(entry, i) { + var c = this._instanceConstructor; + var resolve = c.resolve; - Enumerator.prototype._eachEntry = function (entry, i) { - if (isMaybeThenable(entry)) { - this._settleMaybeThenable(entry, i); - } else { + if (resolve === resolve$1) { + var then$$ = getThen(entry); + + if (then$$ === then && + entry._state !== PENDING) { + entry._onError = null; + this._settledAt(entry._state, i, entry._result); + } else if (typeof then$$ !== 'function') { this._remaining--; this._result[i] = this._makeResult(FULFILLED, i, entry); + } else if (c === Promise) { + var promise = new c(noop); + handleMaybeThenable(promise, entry, then$$); + this._willSettleAt(promise, i); + } else { + this._willSettleAt(new c(function(resolve) { resolve(entry); }), i); } - }; + } else { + this._willSettleAt(resolve(entry), i); + } +}; - Enumerator.prototype._settledAt = function (state, i, value) { - var promise = this.promise; +Enumerator.prototype._eachEntry = function(entry, i) { + if (isMaybeThenable(entry)) { + this._settleMaybeThenable(entry, i); + } else { + this._remaining--; + this._result[i] = this._makeResult(FULFILLED, i, entry); + } +}; - if (promise._state === PENDING) { - this._remaining--; +Enumerator.prototype._settledAt = function(state, i, value) { + var promise = this.promise; - if (this._abortOnReject && state === REJECTED) { - reject(promise, value); - } else { - this._result[i] = this._makeResult(state, i, value); - } - } + if (promise._state === PENDING) { + this._remaining--; - if (this._remaining === 0) { - fulfill(promise, this._result); + if (this._abortOnReject && state === REJECTED) { + reject(promise, value); + } else { + this._result[i] = this._makeResult(state, i, value); } - }; + } - Enumerator.prototype._makeResult = function (state, i, value) { - return value; - }; + if (this._remaining === 0) { + fulfill(promise, this._result); + } +}; - Enumerator.prototype._willSettleAt = function (promise, i) { - var enumerator = this; +Enumerator.prototype._makeResult = function(state, i, value) { + return value; +}; - subscribe(promise, undefined, function (value) { - return enumerator._settledAt(FULFILLED, i, value); - }, function (reason) { - return enumerator._settledAt(REJECTED, i, reason); - }); - }; +Enumerator.prototype._willSettleAt = function(promise, i) { + var enumerator = this; - /** - `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 - rejected with the reason of the first passed promise to be rejected. It casts all - elements of the passed iterable to promises as it runs this algorithm. - - Example: - - ```javascript - let promise1 = RSVP.resolve(1); - let promise2 = RSVP.resolve(2); - let promise3 = RSVP.resolve(3); - let promises = [ promise1, promise2, promise3 ]; - - RSVP.Promise.all(promises).then(function(array){ - // The array here would be [ 1, 2, 3 ]; - }); - ``` - - If any of the `promises` given to `RSVP.all` are rejected, the first promise - that is rejected will be given as an argument to the returned promises's - rejection handler. For example: - - Example: - - ```javascript - let promise1 = RSVP.resolve(1); - let promise2 = RSVP.reject(new Error("2")); - let promise3 = RSVP.reject(new Error("3")); - let promises = [ promise1, promise2, promise3 ]; - - RSVP.Promise.all(promises).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(error) { - // error.message === "2" - }); - ``` - - @method all - @static - @param {Array} entries array of promises - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} promise that is fulfilled when all `promises` have been - fulfilled, or rejected if any of them become rejected. - @static - */ - function all(entries, label) { - return new Enumerator(this, entries, true, /* abort on reject */label).promise; - } + subscribe(promise, undefined, function(value) { + enumerator._settledAt(FULFILLED, i, value); + }, function(reason) { + enumerator._settledAt(REJECTED, i, reason); + }); +}; - /** - `RSVP.Promise.race` returns a new promise which is settled in the same way as the - first passed promise to settle. - - Example: - - ```javascript - let promise1 = new RSVP.Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 1'); - }, 200); - }); - - let promise2 = new RSVP.Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 2'); - }, 100); - }); - - RSVP.Promise.race([promise1, promise2]).then(function(result){ - // result === 'promise 2' because it was resolved before promise1 - // was resolved. - }); - ``` - - `RSVP.Promise.race` is deterministic in that only the state of the first - settled promise matters. For example, even if other promises given to the - `promises` array argument are resolved, but the first settled promise has - become rejected before the other promises became fulfilled, the returned - promise will become rejected: - - ```javascript - let promise1 = new RSVP.Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 1'); - }, 200); - }); - - let promise2 = new RSVP.Promise(function(resolve, reject){ - setTimeout(function(){ - reject(new Error('promise 2')); - }, 100); - }); - - RSVP.Promise.race([promise1, promise2]).then(function(result){ - // Code here never runs - }, function(reason){ - // reason.message === 'promise 2' because promise 2 became rejected before - // promise 1 became fulfilled - }); - ``` - - An example real-world use case is implementing timeouts: - - ```javascript - RSVP.Promise.race([ajax('foo.json'), timeout(5000)]) - ``` - - @method race - @static - @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. - */ - function race(entries, label) { - /*jshint validthis:true */ - var Constructor = this; +/** + `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 + rejected with the reason of the first passed promise to be rejected. It casts all + elements of the passed iterable to promises as it runs this algorithm. - var promise = new Constructor(noop, label); + Example: - if (!isArray(entries)) { - reject(promise, new TypeError('You must pass an array to race.')); - return promise; - } + ```javascript + var promise1 = RSVP.resolve(1); + var promise2 = RSVP.resolve(2); + var promise3 = RSVP.resolve(3); + var promises = [ promise1, promise2, promise3 ]; - for (var i = 0; promise._state === PENDING && i < entries.length; i++) { - subscribe(Constructor.resolve(entries[i]), undefined, function (value) { - return resolve(promise, value); - }, function (reason) { - return reject(promise, reason); - }); - } + RSVP.Promise.all(promises).then(function(array){ + // The array here would be [ 1, 2, 3 ]; + }); + ``` - return promise; - } + If any of the `promises` given to `RSVP.all` are rejected, the first promise + that is rejected will be given as an argument to the returned promises's + rejection handler. For example: - /** - `RSVP.Promise.reject` returns a promise rejected with the passed `reason`. - It is shorthand for the following: - - ```javascript - let promise = new RSVP.Promise(function(resolve, reject){ - reject(new Error('WHOOPS')); - }); - - promise.then(function(value){ - // Code here doesn't run because the promise is rejected! - }, function(reason){ - // reason.message === 'WHOOPS' - }); - ``` - - Instead of writing the above, your code now simply becomes the following: - - ```javascript - let promise = RSVP.Promise.reject(new Error('WHOOPS')); - - promise.then(function(value){ - // Code here doesn't run because the promise is rejected! - }, function(reason){ - // reason.message === 'WHOOPS' - }); - ``` - - @method reject - @static - @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$1(reason, label) { - /*jshint validthis:true */ - var Constructor = this; - var promise = new Constructor(noop, label); - reject(promise, reason); + Example: + + ```javascript + var promise1 = RSVP.resolve(1); + var promise2 = RSVP.reject(new Error("2")); + var promise3 = RSVP.reject(new Error("3")); + var promises = [ promise1, promise2, promise3 ]; + + RSVP.Promise.all(promises).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(error) { + // error.message === "2" + }); + ``` + + @method all + @static + @param {Array} entries array of promises + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} promise that is fulfilled when all `promises` have been + fulfilled, or rejected if any of them become rejected. + @static +*/ +function all(entries, label) { + return new Enumerator(this, entries, true /* abort on reject */, label).promise; +} + +/** + `RSVP.Promise.race` returns a new promise which is settled in the same way as the + first passed promise to settle. + + Example: + + ```javascript + var promise1 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 1'); + }, 200); + }); + + var promise2 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 2'); + }, 100); + }); + + RSVP.Promise.race([promise1, promise2]).then(function(result){ + // result === 'promise 2' because it was resolved before promise1 + // was resolved. + }); + ``` + + `RSVP.Promise.race` is deterministic in that only the state of the first + settled promise matters. For example, even if other promises given to the + `promises` array argument are resolved, but the first settled promise has + become rejected before the other promises became fulfilled, the returned + promise will become rejected: + + ```javascript + var promise1 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 1'); + }, 200); + }); + + var promise2 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + reject(new Error('promise 2')); + }, 100); + }); + + RSVP.Promise.race([promise1, promise2]).then(function(result){ + // Code here never runs + }, function(reason){ + // reason.message === 'promise 2' because promise 2 became rejected before + // promise 1 became fulfilled + }); + ``` + + An example real-world use case is implementing timeouts: + + ```javascript + RSVP.Promise.race([ajax('foo.json'), timeout(5000)]) + ``` + + @method race + @static + @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. +*/ +function race(entries, label) { + /*jshint validthis:true */ + var Constructor = this; + + var promise = new Constructor(noop, label); + + if (!isArray(entries)) { + reject(promise, new TypeError('You must pass an array to race.')); return promise; } - var guidKey = 'rsvp_' + now() + '-'; - var counter = 0; + var length = entries.length; - function needsResolver() { - throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); + function onFulfillment(value) { + resolve(promise, value); } - function needsNew() { - throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); + function onRejection(reason) { + reject(promise, reason); } - /** - 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 - why the promise cannot be fulfilled. - - Terminology - ----------- - - - `promise` is an object or function with a `then` method whose behavior conforms to this specification. - - `thenable` is an object or function that defines a `then` method. - - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). - - `exception` is a value that is thrown using the throw statement. - - `reason` is a value that indicates why a promise was rejected. - - `settled` the final resting state of a promise, fulfilled or rejected. - - A promise can be in one of three states: pending, fulfilled, or rejected. - - Promises that are fulfilled have a fulfillment value and are in the fulfilled - state. Promises that are rejected have a rejection reason and are in the - rejected state. A fulfillment value is never a thenable. - - Promises can also be said to *resolve* a value. If this value is also a - promise, then the original promise's settled state will match the value's - settled state. So a promise that *resolves* a promise that rejects will - itself reject, and a promise that *resolves* a promise that fulfills will - itself fulfill. - - - Basic Usage: - ------------ - - ```js - let promise = new Promise(function(resolve, reject) { - // on success - resolve(value); - - // on failure - reject(reason); - }); - - promise.then(function(value) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` - - Advanced Usage: - --------------- - - Promises shine when abstracting away asynchronous interactions such as - `XMLHttpRequest`s. - - ```js - function getJSON(url) { - return new Promise(function(resolve, reject){ - let xhr = new XMLHttpRequest(); - - xhr.open('GET', url); - xhr.onreadystatechange = handler; - xhr.responseType = 'json'; - xhr.setRequestHeader('Accept', 'application/json'); - xhr.send(); - - function handler() { - if (this.readyState === this.DONE) { - if (this.status === 200) { - resolve(this.response); - } else { - reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); - } + for (var i = 0; promise._state === PENDING && i < length; i++) { + subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection); + } + + return promise; +} + +/** + `RSVP.Promise.reject` returns a promise rejected with the passed `reason`. + It is shorthand for the following: + + ```javascript + var promise = new RSVP.Promise(function(resolve, reject){ + reject(new Error('WHOOPS')); + }); + + promise.then(function(value){ + // Code here doesn't run because the promise is rejected! + }, function(reason){ + // reason.message === 'WHOOPS' + }); + ``` + + Instead of writing the above, your code now simply becomes the following: + + ```javascript + var promise = RSVP.Promise.reject(new Error('WHOOPS')); + + promise.then(function(value){ + // Code here doesn't run because the promise is rejected! + }, function(reason){ + // reason.message === 'WHOOPS' + }); + ``` + + @method reject + @static + @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$1(reason, label) { + /*jshint validthis:true */ + var Constructor = this; + var promise = new Constructor(noop, label); + reject(promise, reason); + return promise; +} + +var guidKey = 'rsvp_' + 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."); +} + +/** + 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 + why the promise cannot be fulfilled. + + Terminology + ----------- + + - `promise` is an object or function with a `then` method whose behavior conforms to this specification. + - `thenable` is an object or function that defines a `then` method. + - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). + - `exception` is a value that is thrown using the throw statement. + - `reason` is a value that indicates why a promise was rejected. + - `settled` the final resting state of a promise, fulfilled or rejected. + + A promise can be in one of three states: pending, fulfilled, or rejected. + + Promises that are fulfilled have a fulfillment value and are in the fulfilled + state. Promises that are rejected have a rejection reason and are in the + rejected state. A fulfillment value is never a thenable. + + Promises can also be said to *resolve* a value. If this value is also a + promise, then the original promise's settled state will match the value's + settled state. So a promise that *resolves* a promise that rejects will + itself reject, and a promise that *resolves* a promise that fulfills will + itself fulfill. + + + Basic Usage: + ------------ + + ```js + var promise = new Promise(function(resolve, reject) { + // on success + resolve(value); + + // on failure + reject(reason); + }); + + promise.then(function(value) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Advanced Usage: + --------------- + + Promises shine when abstracting away asynchronous interactions such as + `XMLHttpRequest`s. + + ```js + function getJSON(url) { + return new Promise(function(resolve, reject){ + var xhr = new XMLHttpRequest(); + + xhr.open('GET', url); + xhr.onreadystatechange = handler; + xhr.responseType = 'json'; + xhr.setRequestHeader('Accept', 'application/json'); + xhr.send(); + + function handler() { + if (this.readyState === this.DONE) { + if (this.status === 200) { + resolve(this.response); + } else { + reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); } - }; - }); - } - - getJSON('/posts.json').then(function(json) { - // on fulfillment - }, function(reason) { - // on rejection + } + }; }); - ``` - - Unlike callbacks, promises are great composable primitives. - - ```js - Promise.all([ - getJSON('/posts'), - getJSON('/comments') - ]).then(function(values){ - values[0] // => postsJSON - values[1] // => commentsJSON - - return values; + } + + getJSON('/posts.json').then(function(json) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Unlike callbacks, promises are great composable primitives. + + ```js + Promise.all([ + getJSON('/posts'), + getJSON('/comments') + ]).then(function(values){ + values[0] // => postsJSON + values[1] // => commentsJSON + + return values; + }); + ``` + + @class RSVP.Promise + @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 = []; + + config.instrument && instrument('created', this); + + if (noop !== resolver) { + typeof resolver !== 'function' && needsResolver(); + this instanceof Promise ? initializePromise(this, resolver) : needsNew(); + } +} + +Promise.cast = resolve$1; // deprecated +Promise.all = all; +Promise.race = race; +Promise.resolve = resolve$1; +Promise.reject = reject$1; + +Promise.prototype = { + constructor: Promise, + + _guidKey: guidKey, + + _onError: function (reason) { + var promise = this; + config.after(function() { + if (promise._onError) { + config['trigger']('error', reason, promise._label); + } }); - ``` - - @class RSVP.Promise - @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 = []; + }, + +/** + 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 why the promise cannot be fulfilled. + + ```js + findUser().then(function(user){ + // user is available + }, function(reason){ + // user is unavailable, and you are given the reason why + }); + ``` + + Chaining + -------- + + The return value of `then` is itself a promise. This second, 'downstream' + promise is resolved with the return value of the first promise's fulfillment + or rejection handler, or rejected if the handler throws an exception. + + ```js + findUser().then(function (user) { + return user.name; + }, function (reason) { + return 'default name'; + }).then(function (userName) { + // If `findUser` fulfilled, `userName` will be the user's name, otherwise it + // will be `'default name'` + }); + + findUser().then(function (user) { + throw new Error('Found user, but still unhappy'); + }, function (reason) { + throw new Error('`findUser` rejected and we're unhappy'); + }).then(function (value) { + // never reached + }, function (reason) { + // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. + // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. + }); + ``` + If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. + + ```js + findUser().then(function (user) { + throw new PedagogicalException('Upstream error'); + }).then(function (value) { + // never reached + }).then(function (value) { + // never reached + }, function (reason) { + // The `PedgagocialException` is propagated all the way down to here + }); + ``` + + Assimilation + ------------ + + Sometimes the value you want to propagate to a downstream promise can only be + retrieved asynchronously. This can be achieved by returning a promise in the + fulfillment or rejection handler. The downstream promise will then be pending + until the returned promise is settled. This is called *assimilation*. - config.instrument && instrument('created', this); + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // The user's comments are now available + }); + ``` + + If the assimliated promise rejects, then the downstream promise will also reject. + + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // If `findCommentsByAuthor` fulfills, we'll have the value here + }, function (reason) { + // If `findCommentsByAuthor` rejects, we'll have the reason here + }); + ``` + + Simple Example + -------------- + + Synchronous Example + + ```javascript + var result; - if (noop !== resolver) { - typeof resolver !== 'function' && needsResolver(); - this instanceof Promise ? initializePromise(this, resolver) : needsNew(); + try { + result = findResult(); + // success + } catch(reason) { + // failure + } + ``` + + Errback Example + + ```js + findResult(function(result, err){ + if (err) { + // failure + } else { + // success } + }); + ``` + + Promise Example; + + ```javascript + findResult().then(function(result){ + // success + }, function(reason){ + // failure + }); + ``` + + Advanced Example + -------------- + + Synchronous Example + + ```javascript + var author, books; + + try { + author = findAuthor(); + books = findBooksByAuthor(author); + // success + } catch(reason) { + // failure } + ``` - Promise.cast = resolve$1; // deprecated - Promise.all = all; - Promise.race = race; - Promise.resolve = resolve$1; - Promise.reject = reject$1; + Errback Example - Promise.prototype = { - constructor: Promise, + ```js - _guidKey: guidKey, + function foundBooks(books) { - _onError: function (reason) { - var promise = this; - config.after(function () { - if (promise._onError) { - config['trigger']('error', reason, promise._label); - } - }); - }, + } - /** - 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 why the promise cannot be fulfilled. - - ```js - findUser().then(function(user){ - // user is available - }, function(reason){ - // user is unavailable, and you are given the reason why - }); - ``` - - Chaining - -------- - - The return value of `then` is itself a promise. This second, 'downstream' - promise is resolved with the return value of the first promise's fulfillment - or rejection handler, or rejected if the handler throws an exception. - - ```js - findUser().then(function (user) { - return user.name; - }, function (reason) { - return 'default name'; - }).then(function (userName) { - // If `findUser` fulfilled, `userName` will be the user's name, otherwise it - // will be `'default name'` - }); - - findUser().then(function (user) { - throw new Error('Found user, but still unhappy'); - }, function (reason) { - throw new Error('`findUser` rejected and we\'re unhappy'); - }).then(function (value) { - // never reached - }, function (reason) { - // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. - // If `findUser` rejected, `reason` will be '`findUser` rejected and we\'re unhappy'. - }); - ``` - If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. - - ```js - findUser().then(function (user) { - throw new PedagogicalException('Upstream error'); - }).then(function (value) { - // never reached - }).then(function (value) { - // never reached - }, function (reason) { - // The `PedgagocialException` is propagated all the way down to here - }); - ``` - - Assimilation - ------------ - - Sometimes the value you want to propagate to a downstream promise can only be - retrieved asynchronously. This can be achieved by returning a promise in the - fulfillment or rejection handler. The downstream promise will then be pending - until the returned promise is settled. This is called *assimilation*. - - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // The user's comments are now available - }); - ``` - - If the assimliated promise rejects, then the downstream promise will also reject. - - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // If `findCommentsByAuthor` fulfills, we'll have the value here - }, function (reason) { - // If `findCommentsByAuthor` rejects, we'll have the reason here - }); - ``` - - Simple Example - -------------- - - Synchronous Example - - ```javascript - let result; - - try { - result = findResult(); - // success - } catch(reason) { - // failure - } - ``` - - Errback Example - - ```js - findResult(function(result, err){ - if (err) { - // failure - } else { - // success - } - }); - ``` - - Promise Example; - - ```javascript - findResult().then(function(result){ - // success - }, function(reason){ - // failure - }); - ``` - - Advanced Example - -------------- - - Synchronous Example - - ```javascript - let author, books; - + function failure(reason) { + + } + + findAuthor(function(author, err){ + if (err) { + failure(err); + // failure + } else { try { - author = findAuthor(); - books = findBooksByAuthor(author); - // success - } catch(reason) { - // failure - } - ``` - - Errback Example - - ```js - - function foundBooks(books) { - - } - - function failure(reason) { - - } - - findAuthor(function(author, err){ - if (err) { - failure(err); - // failure - } else { - try { - findBoooksByAuthor(author, function(books, err) { - if (err) { - failure(err); - } else { - try { - foundBooks(books); - } catch(reason) { - failure(reason); - } - } - }); - } catch(error) { + findBoooksByAuthor(author, function(books, err) { + if (err) { failure(err); + } else { + try { + foundBooks(books); + } catch(reason) { + failure(reason); + } } - // success - } + }); + } catch(error) { + failure(err); + } + // success + } + }); + ``` + + Promise Example; + + ```javascript + findAuthor(). + then(findBooksByAuthor). + then(function(books){ + // found books + }).catch(function(reason){ + // something went wrong + }); + ``` + + @method then + @param {Function} onFulfillment + @param {Function} onRejection + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} +*/ + then: then, + +/** + `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same + as the catch block of a try/catch statement. + + ```js + function findAuthor(){ + throw new Error('couldn't find that author'); + } + + // synchronous + try { + findAuthor(); + } catch(reason) { + // something went wrong + } + + // async with promises + findAuthor().catch(function(reason){ + // something went wrong + }); + ``` + + @method catch + @param {Function} onRejection + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} +*/ + 'catch': function(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 + + Synchronous example: + + ```js + findAuthor() { + if (Math.random() > 0.5) { + throw new Error(); + } + return new Author(); + } + + try { + return findAuthor(); // succeed or fail + } catch(error) { + return findOtherAuther(); + } finally { + // always runs + // doesn't affect the return value + } + ``` + + Asynchronous example: + + ```js + findAuthor().catch(function(reason){ + return findOtherAuther(); + }).finally(function(){ + // author was either found, or not + }); + ``` + + @method finally + @param {Function} callback + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} +*/ + 'finally': function(callback, label) { + var promise = this; + var constructor = promise.constructor; + + return promise.then(function(value) { + return constructor.resolve(callback()).then(function() { + return value; }); - ``` - - Promise Example; - - ```javascript - findAuthor(). - then(findBooksByAuthor). - then(function(books){ - // found books - }).catch(function(reason){ - // something went wrong + }, function(reason) { + return constructor.resolve(callback()).then(function() { + return constructor.reject(reason); }); - ``` - - @method then - @param {Function} onFulfillment - @param {Function} onRejection - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - */ - then: then, + }, label); + } +}; - /** - `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same - as the catch block of a try/catch statement. - - ```js - function findAuthor(){ - throw new Error('couldn\'t find that author'); - } - - // synchronous - try { - findAuthor(); - } catch(reason) { - // something went wrong - } - - // async with promises - findAuthor().catch(function(reason){ - // something went wrong - }); - ``` - - @method catch - @param {Function} onRejection - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - */ - catch: function (onRejection, label) { - return this.then(undefined, onRejection, label); - }, +function Result() { + this.value = undefined; +} - /** - `finally` will be invoked regardless of the promise's fate just as native - try/catch/finally behaves - - Synchronous example: - - ```js - findAuthor() { - if (Math.random() > 0.5) { - throw new Error(); +var ERROR = new Result(); +var GET_THEN_ERROR$1 = new Result(); + +function getThen$1(obj) { + try { + return obj.then; + } catch(error) { + ERROR.value= error; + return ERROR; + } +} + + +function tryApply(f, s, a) { + try { + f.apply(s, a); + } catch(error) { + ERROR.value = error; + return ERROR; + } +} + +function makeObject(_, argumentNames) { + var obj = {}; + var name; + var i; + var length = _.length; + var args = new Array(length); + + for (var x = 0; x < length; x++) { + args[x] = _[x]; + } + + for (i = 0; i < argumentNames.length; i++) { + name = argumentNames[i]; + obj[name] = args[i + 1]; + } + + return obj; +} + +function arrayResult(_) { + var length = _.length; + var args = new Array(length - 1); + + for (var i = 1; i < length; i++) { + args[i - 1] = _[i]; + } + + return args; +} + +function wrapThenable(then, promise) { + return { + then: function(onFulFillment, onRejection) { + return then.call(promise, onFulFillment, onRejection); + } + }; +} + +/** + `RSVP.denodeify` takes a 'node-style' function and returns a function that + will return an `RSVP.Promise`. You can use `denodeify` in Node.js or the + browser when you'd prefer to use promises over using callbacks. For example, + `denodeify` transforms the following: + + ```javascript + var fs = require('fs'); + + fs.readFile('myfile.txt', function(err, data){ + if (err) return handleError(err); + handleData(data); + }); + ``` + + into: + + ```javascript + var fs = require('fs'); + var readFile = RSVP.denodeify(fs.readFile); + + readFile('myfile.txt').then(handleData, handleError); + ``` + + If the node function has multiple success parameters, then `denodeify` + just returns the first one: + + ```javascript + var request = RSVP.denodeify(require('request')); + + request('http://example.com').then(function(res) { + // ... + }); + ``` + + However, if you need all success parameters, setting `denodeify`'s + second parameter to `true` causes it to return all success parameters + as an array: + + ```javascript + var request = RSVP.denodeify(require('request'), true); + + request('http://example.com').then(function(result) { + // result[0] -> res + // result[1] -> body + }); + ``` + + Or if you pass it an array with names it returns the parameters as a hash: + + ```javascript + var request = RSVP.denodeify(require('request'), ['res', 'body']); + + request('http://example.com').then(function(result) { + // result.res + // result.body + }); + ``` + + Sometimes you need to retain the `this`: + + ```javascript + var app = require('express')(); + var render = RSVP.denodeify(app.render.bind(app)); + ``` + + The denodified function inherits from the original function. It works in all + environments, except IE 10 and below. Consequently all properties of the original + function are available to you. However, any properties you change on the + denodeified function won't be changed on the original function. Example: + + ```javascript + var request = RSVP.denodeify(require('request')), + cookieJar = request.jar(); // <- Inheritance is used here + + request('http://example.com', {jar: cookieJar}).then(function(res) { + // cookieJar.cookies holds now the cookies returned by example.com + }); + ``` + + Using `denodeify` makes it easier to compose asynchronous operations instead + of using callbacks. For example, instead of: + + ```javascript + var fs = require('fs'); + + fs.readFile('myfile.txt', function(err, data){ + if (err) { ... } // Handle error + fs.writeFile('myfile2.txt', data, function(err){ + if (err) { ... } // Handle error + console.log('done') + }); + }); + ``` + + you can chain the operations together using `then` from the returned promise: + + ```javascript + var fs = require('fs'); + var readFile = RSVP.denodeify(fs.readFile); + var writeFile = RSVP.denodeify(fs.writeFile); + + readFile('myfile.txt').then(function(data){ + return writeFile('myfile2.txt', data); + }).then(function(){ + console.log('done') + }).catch(function(error){ + // Handle error + }); + ``` + + @method denodeify + @static + @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} [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. + @return {Function} a function that wraps `nodeFunc` to return an + `RSVP.Promise` + @static +*/ +function denodeify(nodeFunc, options) { + var fn = function() { + var self = this; + var l = arguments.length; + var args = new Array(l + 1); + var arg; + var promiseInput = false; + + for (var i = 0; i < l; ++i) { + arg = arguments[i]; + + if (!promiseInput) { + // TODO: clean this up + promiseInput = needsPromiseInput(arg); + if (promiseInput === GET_THEN_ERROR$1) { + var p = new Promise(noop); + reject(p, GET_THEN_ERROR$1.value); + return p; + } else if (promiseInput && promiseInput !== true) { + arg = wrapThenable(promiseInput, arg); } - return new Author(); } - - try { - return findAuthor(); // succeed or fail - } catch(error) { - return findOtherAuther(); - } finally { - // always runs - // doesn't affect the return value - } - ``` - - Asynchronous example: - - ```js - findAuthor().catch(function(reason){ - return findOtherAuther(); - }).finally(function(){ - // author was either found, or not + args[i] = arg; + } + + var promise = new Promise(noop); + + args[l] = function(err, val) { + if (err) + reject(promise, err); + else if (options === undefined) + resolve(promise, val); + else if (options === true) + resolve(promise, arrayResult(arguments)); + else if (isArray(options)) + resolve(promise, makeObject(arguments, options)); + else + resolve(promise, val); + }; + + if (promiseInput) { + return handlePromiseInput(promise, args, nodeFunc, self); + } else { + return handleValueInput(promise, args, nodeFunc, self); + } + }; + + fn.__proto__ = nodeFunc; + + return fn; +} + +function handleValueInput(promise, args, nodeFunc, self) { + var result = tryApply(nodeFunc, self, args); + if (result === ERROR) { + reject(promise, result.value); + } + return promise; +} + +function handlePromiseInput(promise, args, nodeFunc, self){ + return Promise.all(args).then(function(args){ + var result = tryApply(nodeFunc, self, args); + if (result === ERROR) { + reject(promise, result.value); + } + return promise; + }); +} + +function needsPromiseInput(arg) { + if (arg && typeof arg === 'object') { + if (arg.constructor === Promise) { + return true; + } else { + return getThen$1(arg); + } + } else { + return false; + } +} + +/** + This is a convenient alias for `RSVP.Promise.all`. + + @method all + @static + @for RSVP + @param {Array} array Array of promises. + @param {String} label An optional label. This is useful + for tooling. +*/ +function all$1(array, label) { + return Promise.all(array, label); +} + +function AllSettled(Constructor, entries, label) { + this._superConstructor(Constructor, entries, false /* don't abort on reject */, label); +} + +AllSettled.prototype = o_create(Enumerator.prototype); +AllSettled.prototype._superConstructor = Enumerator; +AllSettled.prototype._makeResult = makeSettledResult; +AllSettled.prototype._validationError = function() { + return new Error('allSettled must be called with an array'); +}; + +/** + `RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing + a fail-fast method, it waits until all the promises have returned and + shows you all the results. This is useful if you want to handle multiple + promises' failure states together as a set. + + Returns a promise that is fulfilled when all the given promises have been + settled. The return promise is fulfilled with an array of the states of + the promises passed into the `promises` array argument. + + Each state object will either indicate fulfillment or rejection, and + provide the corresponding value or reason. The states will take one of + the following formats: + + ```javascript + { state: 'fulfilled', value: value } + or + { state: 'rejected', reason: reason } + ``` + + Example: + + ```javascript + var promise1 = RSVP.Promise.resolve(1); + var promise2 = RSVP.Promise.reject(new Error('2')); + var promise3 = RSVP.Promise.reject(new Error('3')); + var promises = [ promise1, promise2, promise3 ]; + + RSVP.allSettled(promises).then(function(array){ + // array == [ + // { state: 'fulfilled', value: 1 }, + // { state: 'rejected', reason: Error }, + // { state: 'rejected', reason: Error } + // ] + // Note that for the second item, reason.message will be '2', and for the + // third item, reason.message will be '3'. + }, function(error) { + // Not run. (This block would only be called if allSettled had failed, + // for instance if passed an incorrect argument type.) + }); + ``` + + @method allSettled + @static + @for RSVP + @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. +*/ + +function allSettled(entries, label) { + return new AllSettled(Promise, entries, label).promise; +} + +/** + This is a convenient alias for `RSVP.Promise.race`. + + @method race + @static + @for RSVP + @param {Array} array Array of promises. + @param {String} label An optional label. This is useful + for tooling. + */ +function race$1(array, label) { + return Promise.race(array, label); +} + +function PromiseHash(Constructor, object, label) { + this._superConstructor(Constructor, object, true, label); +} + +PromiseHash.prototype = o_create(Enumerator.prototype); +PromiseHash.prototype._superConstructor = Enumerator; +PromiseHash.prototype._init = function() { + this._result = {}; +}; + +PromiseHash.prototype._validateInput = function(input) { + return input && typeof input === 'object'; +}; + +PromiseHash.prototype._validationError = function() { + return new Error('Promise.hash must be called with an object'); +}; + +PromiseHash.prototype._enumerate = function() { + var enumerator = this; + var promise = enumerator.promise; + var input = enumerator._input; + var results = []; + + for (var key in input) { + if (promise._state === PENDING && Object.prototype.hasOwnProperty.call(input, key)) { + results.push({ + position: key, + entry: input[key] }); - ``` - - @method finally - @param {Function} callback - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - */ - finally: function (callback, label) { - var promise = this; - var constructor = promise.constructor; + } + } + + var length = results.length; + enumerator._remaining = length; + var result; + + for (var i = 0; promise._state === PENDING && i < length; i++) { + result = results[i]; + enumerator._eachEntry(result.entry, result.position); + } +}; + +/** + `RSVP.hash` is similar to `RSVP.all`, but takes an object instead of an array + for its `promises` argument. + + Returns a promise that is fulfilled when all the given promises have been + fulfilled, or rejected if any of them become rejected. The returned promise + is fulfilled with a hash that has the same key names as the `promises` object + argument. If any of the values in the object are not promises, they will + simply be copied over to the fulfilled object. + + Example: + + ```javascript + var promises = { + myPromise: RSVP.resolve(1), + yourPromise: RSVP.resolve(2), + theirPromise: RSVP.resolve(3), + notAPromise: 4 + }; + + RSVP.hash(promises).then(function(hash){ + // hash here is an object that looks like: + // { + // myPromise: 1, + // yourPromise: 2, + // theirPromise: 3, + // notAPromise: 4 + // } + }); + ```` + + If any of the `promises` given to `RSVP.hash` are rejected, the first promise + that is rejected will be given as the reason to the rejection handler. + + Example: + + ```javascript + var promises = { + myPromise: RSVP.resolve(1), + rejectedPromise: RSVP.reject(new Error('rejectedPromise')), + anotherRejectedPromise: RSVP.reject(new Error('anotherRejectedPromise')), + }; + + RSVP.hash(promises).then(function(hash){ + // Code here never runs because there are rejected promises! + }, function(reason) { + // reason.message === 'rejectedPromise' + }); + ``` + + An important note: `RSVP.hash` is intended for plain JavaScript objects that + are just a set of keys and values. `RSVP.hash` will NOT preserve prototype + chains. + + Example: + + ```javascript + function MyConstructor(){ + this.example = RSVP.resolve('Example'); + } + + MyConstructor.prototype = { + protoProperty: RSVP.resolve('Proto Property') + }; + + var myObject = new MyConstructor(); + + RSVP.hash(myObject).then(function(hash){ + // protoProperty will not be present, instead you will just have an + // object that looks like: + // { + // example: 'Example' + // } + // + // hash.hasOwnProperty('protoProperty'); // false + // 'undefined' === typeof hash.protoProperty + }); + ``` + + @method hash + @static + @for RSVP + @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. +*/ +function hash(object, label) { + return new PromiseHash(Promise, object, label).promise; +} + +function HashSettled(Constructor, object, label) { + this._superConstructor(Constructor, object, false, label); +} + +HashSettled.prototype = o_create(PromiseHash.prototype); +HashSettled.prototype._superConstructor = Enumerator; +HashSettled.prototype._makeResult = makeSettledResult; + +HashSettled.prototype._validationError = function() { + return new Error('hashSettled must be called with an object'); +}; + +/** + `RSVP.hashSettled` is similar to `RSVP.allSettled`, but takes an object + instead of an array for its `promises` argument. - return promise.then(function (value) { - return constructor.resolve(callback()).then(function () { - return value; - }); - }, function (reason) { - return constructor.resolve(callback()).then(function () { - throw reason; - }); - }, label); - } + Unlike `RSVP.all` or `RSVP.hash`, which implement a fail-fast method, + but like `RSVP.allSettled`, `hashSettled` waits until all the + constituent promises have returned and then shows you all the results + with their states and values/reasons. This is useful if you want to + handle multiple promises' failure states together as a set. + + Returns a promise that is fulfilled when all the given promises have been + settled, or rejected if the passed parameters are invalid. + + The returned promise is fulfilled with a hash that has the same key names as + the `promises` object argument. If any of the values in the object are not + promises, they will be copied over to the fulfilled object and marked with state + 'fulfilled'. + + Example: + + ```javascript + var promises = { + myPromise: RSVP.Promise.resolve(1), + yourPromise: RSVP.Promise.resolve(2), + theirPromise: RSVP.Promise.resolve(3), + notAPromise: 4 }; - function Result() { - this.value = undefined; - } + RSVP.hashSettled(promises).then(function(hash){ + // hash here is an object that looks like: + // { + // myPromise: { state: 'fulfilled', value: 1 }, + // yourPromise: { state: 'fulfilled', value: 2 }, + // theirPromise: { state: 'fulfilled', value: 3 }, + // notAPromise: { state: 'fulfilled', value: 4 } + // } + }); + ``` - var ERROR = new Result(); - var GET_THEN_ERROR$1 = new Result(); + If any of the `promises` given to `RSVP.hash` are rejected, the state will + be set to 'rejected' and the reason for rejection provided. - function getThen$1(obj) { - try { - return obj.then; - } catch (error) { - ERROR.value = error; - return ERROR; - } - } + Example: - function tryApply(f, s, a) { - try { - f.apply(s, a); - } catch (error) { - ERROR.value = error; - return ERROR; - } - } + ```javascript + var promises = { + myPromise: RSVP.Promise.resolve(1), + rejectedPromise: RSVP.Promise.reject(new Error('rejection')), + anotherRejectedPromise: RSVP.Promise.reject(new Error('more rejection')), + }; - function makeObject(_, argumentNames) { - var obj = {}; - var length = _.length; - var args = new Array(length); + RSVP.hashSettled(promises).then(function(hash){ + // hash here is an object that looks like: + // { + // myPromise: { state: 'fulfilled', value: 1 }, + // rejectedPromise: { state: 'rejected', reason: Error }, + // anotherRejectedPromise: { state: 'rejected', reason: Error }, + // } + // Note that for rejectedPromise, reason.message == 'rejection', + // and for anotherRejectedPromise, reason.message == 'more rejection'. + }); + ``` - for (var x = 0; x < length; x++) { - args[x] = _[x]; - } + An important note: `RSVP.hashSettled` is intended for plain JavaScript objects that + are just a set of keys and values. `RSVP.hashSettled` will NOT preserve prototype + chains. - for (var i = 0; i < argumentNames.length; i++) { - var _name = argumentNames[i]; - obj[_name] = args[i + 1]; - } + Example: - return obj; + ```javascript + function MyConstructor(){ + this.example = RSVP.Promise.resolve('Example'); } - function arrayResult(_) { - var length = _.length; - var args = new Array(length - 1); + MyConstructor.prototype = { + protoProperty: RSVP.Promise.resolve('Proto Property') + }; - for (var i = 1; i < length; i++) { - args[i - 1] = _[i]; - } + var myObject = new MyConstructor(); - return args; - } + RSVP.hashSettled(myObject).then(function(hash){ + // protoProperty will not be present, instead you will just have an + // object that looks like: + // { + // example: { state: 'fulfilled', value: 'Example' } + // } + // + // hash.hasOwnProperty('protoProperty'); // false + // 'undefined' === typeof hash.protoProperty + }); + ``` - function wrapThenable(then, promise) { - return { - then: function (onFulFillment, onRejection) { - return then.call(promise, onFulFillment, onRejection); - } - }; + @method hashSettled + @for RSVP + @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 +*/ +function hashSettled(object, label) { + return new HashSettled(Promise, object, label).promise; +} + +/** + `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 + caught by the promises implementation and bubbled to the last handler. For + this reason, it is recommended that you always specify a second rejection + handler function to `then`. However, `RSVP.rethrow` will throw the exception + outside of the promise, so it bubbles up to your console if in the browser, + or domain/cause uncaught exception in Node. `rethrow` will also throw the + error again so the error can be handled by the promise per the spec. + + ```javascript + function throws(){ + throw new Error('Whoops!'); } - /** - `RSVP.denodeify` takes a 'node-style' function and returns a function that - will return an `RSVP.Promise`. You can use `denodeify` in Node.js or the - browser when you'd prefer to use promises over using callbacks. For example, - `denodeify` transforms the following: - - ```javascript - let fs = require('fs'); - - fs.readFile('myfile.txt', function(err, data){ - if (err) return handleError(err); - handleData(data); - }); - ``` - - into: - - ```javascript - let fs = require('fs'); - let readFile = RSVP.denodeify(fs.readFile); - - readFile('myfile.txt').then(handleData, handleError); - ``` - - If the node function has multiple success parameters, then `denodeify` - just returns the first one: - - ```javascript - let request = RSVP.denodeify(require('request')); - - request('http://example.com').then(function(res) { - // ... - }); - ``` - - However, if you need all success parameters, setting `denodeify`'s - second parameter to `true` causes it to return all success parameters - as an array: - - ```javascript - let request = RSVP.denodeify(require('request'), true); - - request('http://example.com').then(function(result) { - // result[0] -> res - // result[1] -> body - }); - ``` - - Or if you pass it an array with names it returns the parameters as a hash: - - ```javascript - let request = RSVP.denodeify(require('request'), ['res', 'body']); - - request('http://example.com').then(function(result) { - // result.res - // result.body - }); - ``` - - Sometimes you need to retain the `this`: - - ```javascript - let app = require('express')(); - let render = RSVP.denodeify(app.render.bind(app)); - ``` - - The denodified function inherits from the original function. It works in all - environments, except IE 10 and below. Consequently all properties of the original - function are available to you. However, any properties you change on the - denodeified function won't be changed on the original function. Example: - - ```javascript - let request = RSVP.denodeify(require('request')), - cookieJar = request.jar(); // <- Inheritance is used here - - request('http://example.com', {jar: cookieJar}).then(function(res) { - // cookieJar.cookies holds now the cookies returned by example.com - }); - ``` - - Using `denodeify` makes it easier to compose asynchronous operations instead - of using callbacks. For example, instead of: - - ```javascript - let fs = require('fs'); - - fs.readFile('myfile.txt', function(err, data){ - if (err) { ... } // Handle error - fs.writeFile('myfile2.txt', data, function(err){ - if (err) { ... } // Handle error - console.log('done') - }); - }); - ``` - - you can chain the operations together using `then` from the returned promise: - - ```javascript - let fs = require('fs'); - let readFile = RSVP.denodeify(fs.readFile); - let writeFile = RSVP.denodeify(fs.writeFile); - - readFile('myfile.txt').then(function(data){ - return writeFile('myfile2.txt', data); - }).then(function(){ - console.log('done') - }).catch(function(error){ - // Handle error - }); - ``` - - @method denodeify - @static - @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} [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. - @return {Function} a function that wraps `nodeFunc` to return an - `RSVP.Promise` - @static - */ - function denodeify(nodeFunc, options) { - var fn = function () { - var self = this; - var l = arguments.length; - var args = new Array(l + 1); - var promiseInput = false; - - for (var i = 0; i < l; ++i) { - var arg = arguments[i]; - - if (!promiseInput) { - // TODO: clean this up - promiseInput = needsPromiseInput(arg); - if (promiseInput === GET_THEN_ERROR$1) { - var p = new Promise(noop); - reject(p, GET_THEN_ERROR$1.value); - return p; - } else if (promiseInput && promiseInput !== true) { - arg = wrapThenable(promiseInput, arg); - } - } - args[i] = arg; - } + var promise = new RSVP.Promise(function(resolve, reject){ + throws(); + }); - var promise = new Promise(noop); + promise.catch(RSVP.rethrow).then(function(){ + // Code here doesn't run because the promise became rejected due to an + // error! + }, function (err){ + // handle the error here + }); + ``` - args[l] = function (err, val) { - if (err) reject(promise, err);else if (options === undefined) resolve(promise, val);else if (options === true) resolve(promise, arrayResult(arguments));else if (isArray(options)) resolve(promise, makeObject(arguments, options));else resolve(promise, val); - }; + The 'Whoops' error will be thrown on the next turn of the event loop + and you can watch for it in your console. You can also handle it using a + rejection handler given to `.then` or `.catch` on the returned promise. - if (promiseInput) { - return handlePromiseInput(promise, args, nodeFunc, self); - } else { - return handleValueInput(promise, args, nodeFunc, self); - } - }; + @method rethrow + @static + @for RSVP + @param {Error} reason reason the promise became rejected. + @throws Error + @static +*/ +function rethrow(reason) { + setTimeout(function() { + throw reason; + }); + throw reason; +} - babelHelpers.defaults(fn, nodeFunc); +/** + `RSVP.defer` returns an object similar to jQuery's `$.Deferred`. + `RSVP.defer` should be used when porting over code reliant on `$.Deferred`'s + interface. New code should use the `RSVP.Promise` constructor instead. - return fn; - } + The object returned from `RSVP.defer` is a plain object with three properties: - function handleValueInput(promise, args, nodeFunc, self) { - var result = tryApply(nodeFunc, self, args); - if (result === ERROR) { - reject(promise, result.value); - } - return promise; - } + * promise - an `RSVP.Promise`. + * reject - a function that causes the `promise` property on this object to + become rejected + * resolve - a function that causes the `promise` property on this object to + become fulfilled. - function handlePromiseInput(promise, args, nodeFunc, self) { - return Promise.all(args).then(function (args) { - var result = tryApply(nodeFunc, self, args); - if (result === ERROR) { - reject(promise, result.value); - } - return promise; - }); - } + Example: - function needsPromiseInput(arg) { - if (arg && typeof arg === 'object') { - if (arg.constructor === Promise) { - return true; - } else { - return getThen$1(arg); - } - } else { - return false; - } - } + ```javascript + var deferred = RSVP.defer(); - /** - This is a convenient alias for `RSVP.Promise.all`. - - @method all - @static - @for RSVP - @param {Array} array Array of promises. - @param {String} label An optional label. This is useful - for tooling. - */ - function all$1(array, label) { - return Promise.all(array, label); - } + deferred.resolve("Success!"); - function AllSettled(Constructor, entries, label) { - this._superConstructor(Constructor, entries, false, /* don't abort on reject */label); - } + deferred.promise.then(function(value){ + // value here is "Success!" + }); + ``` - AllSettled.prototype = o_create(Enumerator.prototype); - AllSettled.prototype._superConstructor = Enumerator; - AllSettled.prototype._makeResult = makeSettledResult; - AllSettled.prototype._validationError = function () { - return new Error('allSettled must be called with an array'); - }; + @method defer + @static + @for RSVP + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Object} + */ - /** - `RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing - a fail-fast method, it waits until all the promises have returned and - shows you all the results. This is useful if you want to handle multiple - promises' failure states together as a set. - - Returns a promise that is fulfilled when all the given promises have been - settled. The return promise is fulfilled with an array of the states of - the promises passed into the `promises` array argument. - - Each state object will either indicate fulfillment or rejection, and - provide the corresponding value or reason. The states will take one of - the following formats: - - ```javascript - { state: 'fulfilled', value: value } - or - { state: 'rejected', reason: reason } - ``` - - Example: - - ```javascript - let promise1 = RSVP.Promise.resolve(1); - let promise2 = RSVP.Promise.reject(new Error('2')); - let promise3 = RSVP.Promise.reject(new Error('3')); - let promises = [ promise1, promise2, promise3 ]; - - RSVP.allSettled(promises).then(function(array){ - // array == [ - // { state: 'fulfilled', value: 1 }, - // { state: 'rejected', reason: Error }, - // { state: 'rejected', reason: Error } - // ] - // Note that for the second item, reason.message will be '2', and for the - // third item, reason.message will be '3'. - }, function(error) { - // Not run. (This block would only be called if allSettled had failed, - // for instance if passed an incorrect argument type.) - }); - ``` - - @method allSettled - @static - @for RSVP - @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. - */ +function defer(label) { + var deferred = {}; - function allSettled(entries, label) { - return new AllSettled(Promise, entries, label).promise; - } + deferred['promise'] = new Promise(function(resolve, reject) { + deferred['resolve'] = resolve; + deferred['reject'] = reject; + }, label); - /** - This is a convenient alias for `RSVP.Promise.race`. - - @method race - @static - @for RSVP - @param {Array} array Array of promises. - @param {String} label An optional label. This is useful - for tooling. - */ - function race$1(array, label) { - return Promise.race(array, label); - } + return deferred; +} - function PromiseHash(Constructor, object, label) { - this._superConstructor(Constructor, object, true, label); - } +/** + `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 + each item in given to `promises`. `RSVP.map` returns a promise that will + become fulfilled with the result of running `mapFn` on the values the promises + become fulfilled with. - PromiseHash.prototype = o_create(Enumerator.prototype); - PromiseHash.prototype._superConstructor = Enumerator; - PromiseHash.prototype._init = function () { - this._result = {}; - }; + For example: - PromiseHash.prototype._validateInput = function (input) { - return input && typeof input === 'object'; - }; + ```javascript + + var promise1 = RSVP.resolve(1); + var promise2 = RSVP.resolve(2); + var promise3 = RSVP.resolve(3); + var promises = [ promise1, promise2, promise3 ]; - PromiseHash.prototype._validationError = function () { - return new Error('Promise.hash must be called with an object'); + var mapFn = function(item){ + return item + 1; }; - PromiseHash.prototype._enumerate = function () { - var enumerator = this; - var promise = enumerator.promise; - var input = enumerator._input; - var results = []; - - for (var key in input) { - if (promise._state === PENDING && Object.prototype.hasOwnProperty.call(input, key)) { - results.push({ - position: key, - entry: input[key] - }); - } - } + RSVP.map(promises, mapFn).then(function(result){ + // result is [ 2, 3, 4 ] + }); + ``` - var length = results.length; - enumerator._remaining = length; - var result = undefined; + If any of the `promises` given to `RSVP.map` are rejected, the first promise + that is rejected will be given as an argument to the returned promise's + rejection handler. For example: - for (var i = 0; promise._state === PENDING && i < length; i++) { - result = results[i]; - enumerator._eachEntry(result.entry, result.position); - } + ```javascript + var promise1 = RSVP.resolve(1); + var promise2 = RSVP.reject(new Error('2')); + var promise3 = RSVP.reject(new Error('3')); + var promises = [ promise1, promise2, promise3 ]; + + var mapFn = function(item){ + return item + 1; }; - /** - `RSVP.hash` is similar to `RSVP.all`, but takes an object instead of an array - for its `promises` argument. - - Returns a promise that is fulfilled when all the given promises have been - fulfilled, or rejected if any of them become rejected. The returned promise - is fulfilled with a hash that has the same key names as the `promises` object - argument. If any of the values in the object are not promises, they will - simply be copied over to the fulfilled object. - - Example: - - ```javascript - let promises = { - myPromise: RSVP.resolve(1), - yourPromise: RSVP.resolve(2), - theirPromise: RSVP.resolve(3), - notAPromise: 4 - }; - - RSVP.hash(promises).then(function(hash){ - // hash here is an object that looks like: - // { - // myPromise: 1, - // yourPromise: 2, - // theirPromise: 3, - // notAPromise: 4 - // } - }); - ```` - - If any of the `promises` given to `RSVP.hash` are rejected, the first promise - that is rejected will be given as the reason to the rejection handler. - - Example: - - ```javascript - let promises = { - myPromise: RSVP.resolve(1), - rejectedPromise: RSVP.reject(new Error('rejectedPromise')), - anotherRejectedPromise: RSVP.reject(new Error('anotherRejectedPromise')), - }; - - RSVP.hash(promises).then(function(hash){ - // Code here never runs because there are rejected promises! - }, function(reason) { - // reason.message === 'rejectedPromise' - }); - ``` - - An important note: `RSVP.hash` is intended for plain JavaScript objects that - are just a set of keys and values. `RSVP.hash` will NOT preserve prototype - chains. - - Example: - - ```javascript - function MyConstructor(){ - this.example = RSVP.resolve('Example'); - } - - MyConstructor.prototype = { - protoProperty: RSVP.resolve('Proto Property') - }; - - let myObject = new MyConstructor(); - - RSVP.hash(myObject).then(function(hash){ - // protoProperty will not be present, instead you will just have an - // object that looks like: - // { - // example: 'Example' - // } - // - // hash.hasOwnProperty('protoProperty'); // false - // 'undefined' === typeof hash.protoProperty - }); - ``` - - @method hash - @static - @for RSVP - @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. - */ - function hash(object, label) { - return new PromiseHash(Promise, object, label).promise; - } + RSVP.map(promises, mapFn).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(reason) { + // reason.message === '2' + }); + ``` - function HashSettled(Constructor, object, label) { - this._superConstructor(Constructor, object, false, label); - } + `RSVP.map` will also wait if a promise is returned from `mapFn`. For example, + say you want to get all comments from a set of blog posts, but you need + the blog posts first because they contain a url to those comments. - HashSettled.prototype = o_create(PromiseHash.prototype); - HashSettled.prototype._superConstructor = Enumerator; - HashSettled.prototype._makeResult = makeSettledResult; + ```javscript - HashSettled.prototype._validationError = function () { - return new Error('hashSettled must be called with an object'); + var mapFn = function(blogPost){ + // getComments does some ajax and returns an RSVP.Promise that is fulfilled + // with some comments data + return getComments(blogPost.comments_url); }; - /** - `RSVP.hashSettled` is similar to `RSVP.allSettled`, but takes an object - instead of an array for its `promises` argument. - - Unlike `RSVP.all` or `RSVP.hash`, which implement a fail-fast method, - but like `RSVP.allSettled`, `hashSettled` waits until all the - constituent promises have returned and then shows you all the results - with their states and values/reasons. This is useful if you want to - handle multiple promises' failure states together as a set. - - Returns a promise that is fulfilled when all the given promises have been - settled, or rejected if the passed parameters are invalid. - - The returned promise is fulfilled with a hash that has the same key names as - the `promises` object argument. If any of the values in the object are not - promises, they will be copied over to the fulfilled object and marked with state - 'fulfilled'. - - Example: - - ```javascript - let promises = { - myPromise: RSVP.Promise.resolve(1), - yourPromise: RSVP.Promise.resolve(2), - theirPromise: RSVP.Promise.resolve(3), - notAPromise: 4 - }; - - RSVP.hashSettled(promises).then(function(hash){ - // hash here is an object that looks like: - // { - // myPromise: { state: 'fulfilled', value: 1 }, - // yourPromise: { state: 'fulfilled', value: 2 }, - // theirPromise: { state: 'fulfilled', value: 3 }, - // notAPromise: { state: 'fulfilled', value: 4 } - // } - }); - ``` - - If any of the `promises` given to `RSVP.hash` are rejected, the state will - be set to 'rejected' and the reason for rejection provided. - - Example: - - ```javascript - let promises = { - myPromise: RSVP.Promise.resolve(1), - rejectedPromise: RSVP.Promise.reject(new Error('rejection')), - anotherRejectedPromise: RSVP.Promise.reject(new Error('more rejection')), - }; - - RSVP.hashSettled(promises).then(function(hash){ - // hash here is an object that looks like: - // { - // myPromise: { state: 'fulfilled', value: 1 }, - // rejectedPromise: { state: 'rejected', reason: Error }, - // anotherRejectedPromise: { state: 'rejected', reason: Error }, - // } - // Note that for rejectedPromise, reason.message == 'rejection', - // and for anotherRejectedPromise, reason.message == 'more rejection'. - }); - ``` - - An important note: `RSVP.hashSettled` is intended for plain JavaScript objects that - are just a set of keys and values. `RSVP.hashSettled` will NOT preserve prototype - chains. - - Example: - - ```javascript - function MyConstructor(){ - this.example = RSVP.Promise.resolve('Example'); + // getBlogPosts does some ajax and returns an RSVP.Promise that is fulfilled + // with some blog post data + RSVP.map(getBlogPosts(), mapFn).then(function(comments){ + // comments is the result of asking the server for the comments + // of all blog posts returned from getBlogPosts() + }); + ``` + + @method map + @static + @for RSVP + @param {Array} promises + @param {Function} mapFn function to be called on each fulfilled promise. + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} promise that is fulfilled with the result of calling + `mapFn` on each fulfilled promise or value when they become fulfilled. + The promise will be rejected if any of the given `promises` become rejected. + @static +*/ +function map(promises, mapFn, label) { + return Promise.all(promises, label).then(function(values) { + if (!isFunction(mapFn)) { + throw new TypeError("You must pass a function as map's second argument."); } - - MyConstructor.prototype = { - protoProperty: RSVP.Promise.resolve('Proto Property') - }; - - let myObject = new MyConstructor(); - - RSVP.hashSettled(myObject).then(function(hash){ - // protoProperty will not be present, instead you will just have an - // object that looks like: - // { - // example: { state: 'fulfilled', value: 'Example' } - // } - // - // hash.hasOwnProperty('protoProperty'); // false - // 'undefined' === typeof hash.protoProperty - }); - ``` - - @method hashSettled - @for RSVP - @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 - */ - function hashSettled(object, label) { - return new HashSettled(Promise, object, label).promise; - } - /** - `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 - caught by the promises implementation and bubbled to the last handler. For - this reason, it is recommended that you always specify a second rejection - handler function to `then`. However, `RSVP.rethrow` will throw the exception - outside of the promise, so it bubbles up to your console if in the browser, - or domain/cause uncaught exception in Node. `rethrow` will also throw the - error again so the error can be handled by the promise per the spec. - - ```javascript - function throws(){ - throw new Error('Whoops!'); + var length = values.length; + var results = new Array(length); + + for (var i = 0; i < length; i++) { + results[i] = mapFn(values[i]); } - - let promise = new RSVP.Promise(function(resolve, reject){ - throws(); - }); - - promise.catch(RSVP.rethrow).then(function(){ - // Code here doesn't run because the promise became rejected due to an - // error! - }, function (err){ - // handle the error here - }); - ``` - - The 'Whoops' error will be thrown on the next turn of the event loop - and you can watch for it in your console. You can also handle it using a - rejection handler given to `.then` or `.catch` on the returned promise. - - @method rethrow - @static - @for RSVP - @param {Error} reason reason the promise became rejected. - @throws Error - @static - */ - function rethrow(reason) { - setTimeout(function () { - throw reason; - }); - throw reason; - } - /** - `RSVP.defer` returns an object similar to jQuery's `$.Deferred`. - `RSVP.defer` should be used when porting over code reliant on `$.Deferred`'s - interface. New code should use the `RSVP.Promise` constructor instead. - - The object returned from `RSVP.defer` is a plain object with three properties: - - * promise - an `RSVP.Promise`. - * reject - a function that causes the `promise` property on this object to - become rejected - * resolve - a function that causes the `promise` property on this object to - become fulfilled. - - Example: - - ```javascript - let deferred = RSVP.defer(); - - deferred.resolve("Success!"); - - deferred.promise.then(function(value){ - // value here is "Success!" - }); - ``` - - @method defer - @static - @for RSVP - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Object} - */ + return Promise.all(results, label); + }); +} - function defer(label) { - var deferred = { resolve: undefined, reject: undefined }; +/** + This is a convenient alias for `RSVP.Promise.resolve`. - deferred.promise = new Promise(function (resolve, reject) { - deferred.resolve = resolve; - deferred.reject = reject; - }, label); + @method resolve + @static + @for RSVP + @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` +*/ +function resolve$2(value, label) { + return Promise.resolve(value, label); +} - return deferred; - } +/** + This is a convenient alias for `RSVP.Promise.reject`. - /** - `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 - each item in given to `promises`. `RSVP.map` returns a promise that will - become fulfilled with the result of running `mapFn` on the values the promises - become fulfilled with. - - For example: - - ```javascript - - let promise1 = RSVP.resolve(1); - let promise2 = RSVP.resolve(2); - let promise3 = RSVP.resolve(3); - let promises = [ promise1, promise2, promise3 ]; - - let mapFn = function(item){ - return item + 1; - }; - - RSVP.map(promises, mapFn).then(function(result){ - // result is [ 2, 3, 4 ] - }); - ``` - - If any of the `promises` given to `RSVP.map` are rejected, the first promise - that is rejected will be given as an argument to the returned promise's - rejection handler. For example: - - ```javascript - let promise1 = RSVP.resolve(1); - let promise2 = RSVP.reject(new Error('2')); - let promise3 = RSVP.reject(new Error('3')); - let promises = [ promise1, promise2, promise3 ]; - - let mapFn = function(item){ - return item + 1; - }; - - RSVP.map(promises, mapFn).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(reason) { - // reason.message === '2' - }); - ``` - - `RSVP.map` will also wait if a promise is returned from `mapFn`. For example, - say you want to get all comments from a set of blog posts, but you need - the blog posts first because they contain a url to those comments. - - ```javscript - - let mapFn = function(blogPost){ - // getComments does some ajax and returns an RSVP.Promise that is fulfilled - // with some comments data - return getComments(blogPost.comments_url); - }; - - // getBlogPosts does some ajax and returns an RSVP.Promise that is fulfilled - // with some blog post data - RSVP.map(getBlogPosts(), mapFn).then(function(comments){ - // comments is the result of asking the server for the comments - // of all blog posts returned from getBlogPosts() - }); - ``` - - @method map - @static - @for RSVP - @param {Array} promises - @param {Function} mapFn function to be called on each fulfilled promise. - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} promise that is fulfilled with the result of calling - `mapFn` on each fulfilled promise or value when they become fulfilled. - The promise will be rejected if any of the given `promises` become rejected. - @static - */ - function map(promises, mapFn, label) { - return Promise.all(promises, label).then(function (values) { - if (!isFunction(mapFn)) { - throw new TypeError("You must pass a function as map's second argument."); - } + @method reject + @static + @for RSVP + @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$2(reason, label) { + return Promise.reject(reason, label); +} - var length = values.length; - var results = new Array(length); +/** + `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 + each item in given to `promises`. `RSVP.filter` returns a promise that will + become fulfilled with the result of running `filterFn` on the values the + promises become fulfilled with. - for (var i = 0; i < length; i++) { - results[i] = mapFn(values[i]); - } + For example: - return Promise.all(results, label); - }); - } + ```javascript - /** - This is a convenient alias for `RSVP.Promise.resolve`. - - @method resolve - @static - @for RSVP - @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` - */ - function resolve$2(value, label) { - return Promise.resolve(value, label); - } + var promise1 = RSVP.resolve(1); + var promise2 = RSVP.resolve(2); + var promise3 = RSVP.resolve(3); - /** - This is a convenient alias for `RSVP.Promise.reject`. - - @method reject - @static - @for RSVP - @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$2(reason, label) { - return Promise.reject(reason, label); - } + var promises = [promise1, promise2, promise3]; - /** - `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 - each item in given to `promises`. `RSVP.filter` returns a promise that will - become fulfilled with the result of running `filterFn` on the values the - promises become fulfilled with. - - For example: - - ```javascript - - let promise1 = RSVP.resolve(1); - let promise2 = RSVP.resolve(2); - let promise3 = RSVP.resolve(3); - - let promises = [promise1, promise2, promise3]; - - let filterFn = function(item){ - return item > 1; - }; - - RSVP.filter(promises, filterFn).then(function(result){ - // result is [ 2, 3 ] - }); - ``` - - If any of the `promises` given to `RSVP.filter` are rejected, the first promise - that is rejected will be given as an argument to the returned promise's - rejection handler. For example: - - ```javascript - let promise1 = RSVP.resolve(1); - let promise2 = RSVP.reject(new Error('2')); - let promise3 = RSVP.reject(new Error('3')); - let promises = [ promise1, promise2, promise3 ]; - - let filterFn = function(item){ - return item > 1; - }; - - RSVP.filter(promises, filterFn).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(reason) { - // reason.message === '2' - }); - ``` - - `RSVP.filter` will also wait for any promises returned from `filterFn`. - For instance, you may want to fetch a list of users then return a subset - of those users based on some asynchronous operation: - - ```javascript - - let alice = { name: 'alice' }; - let bob = { name: 'bob' }; - let users = [ alice, bob ]; - - let promises = users.map(function(user){ - return RSVP.resolve(user); - }); - - let filterFn = function(user){ - // Here, Alice has permissions to create a blog post, but Bob does not. - return getPrivilegesForUser(user).then(function(privs){ - return privs.can_create_blog_post === true; - }); - }; - RSVP.filter(promises, filterFn).then(function(users){ - // true, because the server told us only Alice can create a blog post. - users.length === 1; - // false, because Alice is the only user present in `users` - users[0] === bob; - }); - ``` - - @method filter - @static - @for RSVP - @param {Array} promises - @param {Function} filterFn - function to be called on each resolved value to - filter the final results. - @param {String} label optional string describing the promise. Useful for - tooling. - @return {Promise} - */ + var filterFn = function(item){ + return item > 1; + }; - function resolveAll(promises, label) { - return Promise.all(promises, label); - } + RSVP.filter(promises, filterFn).then(function(result){ + // result is [ 2, 3 ] + }); + ``` - function resolveSingle(promise, label) { - return Promise.resolve(promise, label).then(function (promises) { - return resolveAll(promises, label); - }); - } + If any of the `promises` given to `RSVP.filter` are rejected, the first promise + that is rejected will be given as an argument to the returned promise's + rejection handler. For example: - function filter(promises, filterFn, label) { - var promise = isArray(promises) ? resolveAll(promises, label) : resolveSingle(promises, label); - return promise.then(function (values) { - if (!isFunction(filterFn)) { - throw new TypeError("You must pass a function as filter's second argument."); - } + ```javascript + var promise1 = RSVP.resolve(1); + var promise2 = RSVP.reject(new Error('2')); + var promise3 = RSVP.reject(new Error('3')); + var promises = [ promise1, promise2, promise3 ]; - var length = values.length; - var filtered = new Array(length); + var filterFn = function(item){ + return item > 1; + }; - for (var i = 0; i < length; i++) { - filtered[i] = filterFn(values[i]); - } + RSVP.filter(promises, filterFn).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(reason) { + // reason.message === '2' + }); + ``` - return resolveAll(filtered, label).then(function (filtered) { - var results = new Array(length); - var newLength = 0; + `RSVP.filter` will also wait for any promises returned from `filterFn`. + For instance, you may want to fetch a list of users then return a subset + of those users based on some asynchronous operation: - for (var i = 0; i < length; i++) { - if (filtered[i]) { - results[newLength] = values[i]; - newLength++; - } - } + ```javascript - results.length = newLength; + var alice = { name: 'alice' }; + var bob = { name: 'bob' }; + var users = [ alice, bob ]; - return results; - }); + var promises = users.map(function(user){ + return RSVP.resolve(user); + }); + + var filterFn = function(user){ + // Here, Alice has permissions to create a blog post, but Bob does not. + return getPrivilegesForUser(user).then(function(privs){ + return privs.can_create_blog_post === true; }); - } + }; + RSVP.filter(promises, filterFn).then(function(users){ + // true, because the server told us only Alice can create a blog post. + users.length === 1; + // false, because Alice is the only user present in `users` + users[0] === bob; + }); + ``` - var len = 0; - var vertxNext = undefined; - function asap(callback, arg) { - queue$1[len] = callback; - queue$1[len + 1] = arg; - len += 2; - if (len === 2) { - // If len is 1, that means that we need to schedule an async flush. - // If additional callbacks are queued before the queue is flushed, they - // will be processed by this flush that we are scheduling. - scheduleFlush$1(); - } - } - - var browserWindow = typeof window !== 'undefined' ? window : undefined; - var browserGlobal = browserWindow || {}; - var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; - var isNode = typeof self === '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; + @method filter + @static + @for RSVP + @param {Array} promises + @param {Function} filterFn - function to be called on each resolved value to + filter the final results. + @param {String} label optional string describing the promise. Useful for + tooling. + @return {Promise} +*/ +function filter(promises, filterFn, label) { + return Promise.all(promises, label).then(function(values) { + if (!isFunction(filterFn)) { + throw new TypeError("You must pass a function as filter's second argument."); } - return function () { - return nextTick(flush); - }; - } - // vertx - function useVertxTimer() { - if (typeof vertxNext !== 'undefined') { - return function () { - vertxNext(flush); - }; + var length = values.length; + var filtered = new Array(length); + + for (var i = 0; i < length; i++) { + filtered[i] = filterFn(values[i]); } - return useSetTimeout(); - } - function useMutationObserver() { - var iterations = 0; - var observer = new BrowserMutationObserver(flush); - var node = document.createTextNode(''); - observer.observe(node, { characterData: true }); + return Promise.all(filtered, label).then(function(filtered) { + var results = new Array(length); + var newLength = 0; - return function () { - return node.data = iterations = ++iterations % 2; - }; - } + for (var i = 0; i < length; i++) { + if (filtered[i]) { + results[newLength] = values[i]; + newLength++; + } + } - // web worker - function useMessageChannel() { - var channel = new MessageChannel(); - channel.port1.onmessage = flush; - return function () { - return channel.port2.postMessage(0); - }; - } + results.length = newLength; - function useSetTimeout() { - return function () { - return setTimeout(flush, 1); - }; + return results; + }); + }); +} + +var len = 0; +var vertxNext; +function asap(callback, arg) { + queue$1[len] = callback; + queue$1[len + 1] = arg; + len += 2; + if (len === 2) { + // If len is 1, that means that we need to schedule an async flush. + // If additional callbacks are queued before the queue is flushed, they + // will be processed by this flush that we are scheduling. + scheduleFlush$1(); } +} - var queue$1 = new Array(1000); +var browserWindow = (typeof window !== 'undefined') ? window : undefined; +var browserGlobal = browserWindow || {}; +var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; +var isNode = typeof self === '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() { + nextTick(flush); + }; +} - function flush() { - for (var i = 0; i < len; i += 2) { - var callback = queue$1[i]; - var arg = queue$1[i + 1]; +// vertx +function useVertxTimer() { + return function() { + vertxNext(flush); + }; +} - callback(arg); +function useMutationObserver() { + var iterations = 0; + var observer = new BrowserMutationObserver(flush); + var node = document.createTextNode(''); + observer.observe(node, { characterData: true }); - queue$1[i] = undefined; - queue$1[i + 1] = undefined; - } + return function() { + node.data = (iterations = ++iterations % 2); + }; +} - len = 0; - } +// web worker +function useMessageChannel() { + var channel = new MessageChannel(); + channel.port1.onmessage = flush; + return function () { + channel.port2.postMessage(0); + }; +} - function attemptVertex() { - try { - var r = require; - var vertx = r('vertx'); - vertxNext = vertx.runOnLoop || vertx.runOnContext; - return useVertxTimer(); - } catch (e) { - return useSetTimeout(); - } +function useSetTimeout() { + return function() { + setTimeout(flush, 1); + }; +} + +var queue$1 = new Array(1000); +function flush() { + for (var i = 0; i < len; i+=2) { + var callback = queue$1[i]; + var arg = queue$1[i+1]; + + callback(arg); + + queue$1[i] = undefined; + queue$1[i+1] = undefined; } - var scheduleFlush$1 = undefined; - // Decide what async method to use to triggering processing of queued callbacks: - if (isNode) { - scheduleFlush$1 = useNextTick(); - } else if (BrowserMutationObserver) { - scheduleFlush$1 = useMutationObserver(); - } else if (isWorker) { - scheduleFlush$1 = useMessageChannel(); - } else if (browserWindow === undefined && typeof require === 'function') { - scheduleFlush$1 = attemptVertex(); - } else { - scheduleFlush$1 = useSetTimeout(); + len = 0; +} + +function attemptVertex() { + try { + var r = require; + var vertx = r('vertx'); + vertxNext = vertx.runOnLoop || vertx.runOnContext; + return useVertxTimer(); + } catch(e) { + return useSetTimeout(); } +} + +var scheduleFlush$1; +// Decide what async method to use to triggering processing of queued callbacks: +if (isNode) { + scheduleFlush$1 = useNextTick(); +} else if (BrowserMutationObserver) { + scheduleFlush$1 = useMutationObserver(); +} else if (isWorker) { + scheduleFlush$1 = useMessageChannel(); +} else if (browserWindow === undefined && typeof require === 'function') { + scheduleFlush$1 = attemptVertex(); +} else { + scheduleFlush$1 = useSetTimeout(); +} + +// defaults +config.async = asap; +config.after = function(cb) { + setTimeout(cb, 0); +}; +var cast = resolve$2; +function async(callback, arg) { + config.async(callback, arg); +} - var platform = undefined; +function on() { + config['on'].apply(config, arguments); +} - /* global self */ - if (typeof self === 'object') { - platform = self; +function off() { + config['off'].apply(config, arguments); +} - /* global global */ - } else if (typeof global === 'object') { - platform = global; - } else { - throw new Error('no global: `self` or `global` found'); +// Set up instrumentation through `window.__PROMISE_INTRUMENTATION__` +if (typeof window !== 'undefined' && typeof window['__PROMISE_INSTRUMENTATION__'] === 'object') { + var callbacks = window['__PROMISE_INSTRUMENTATION__']; + configure('instrument', true); + for (var eventName in callbacks) { + if (callbacks.hasOwnProperty(eventName)) { + on(eventName, callbacks[eventName]); } + } +} - // defaults - config.async = asap; - config.after = function (cb) { - return setTimeout(cb, 0); - }; - var cast = resolve$2; +exports.cast = cast; +exports.Promise = Promise; +exports.EventTarget = EventTarget; +exports.all = all$1; +exports.allSettled = allSettled; +exports.race = race$1; +exports.hash = hash; +exports.hashSettled = hashSettled; +exports.rethrow = rethrow; +exports.defer = defer; +exports.denodeify = denodeify; +exports.configure = configure; +exports.on = on; +exports.off = off; +exports.resolve = resolve$2; +exports.reject = reject$2; +exports.async = async; +exports.map = map; +exports.filter = filter; - var async = function (callback, arg) { - return config.async(callback, arg); - }; +Object.defineProperty(exports, '__esModule', { value: true }); - function on() { - config['on'].apply(config, arguments); - } - - function off() { - config['off'].apply(config, arguments); - } - - // Set up instrumentation through `window.__PROMISE_INTRUMENTATION__` - if (typeof window !== 'undefined' && typeof window['__PROMISE_INSTRUMENTATION__'] === 'object') { - var callbacks = window['__PROMISE_INSTRUMENTATION__']; - configure('instrument', true); - for (var eventName in callbacks) { - if (callbacks.hasOwnProperty(eventName)) { - on(eventName, callbacks[eventName]); - } - } - } - - // the default export here is for backwards compat: - // https://github.com/tildeio/rsvp.js/issues/434 - var rsvp = (_rsvp = { - cast: cast, - Promise: Promise, - EventTarget: EventTarget, - all: all$1, - allSettled: allSettled, - race: race$1, - hash: hash, - hashSettled: hashSettled, - rethrow: rethrow, - defer: defer, - denodeify: denodeify, - configure: configure, - on: on, - off: off, - resolve: resolve$2, - reject: reject$2, - map: map - }, _rsvp['async'] = async, _rsvp.filter = // babel seems to error if async isn't a computed prop here... - filter, _rsvp); - - exports.cast = cast; - exports.Promise = Promise; - exports.EventTarget = EventTarget; - exports.all = all$1; - exports.allSettled = allSettled; - exports.race = race$1; - exports.hash = hash; - exports.hashSettled = hashSettled; - exports.rethrow = rethrow; - exports.defer = defer; - exports.denodeify = denodeify; - exports.configure = configure; - exports.on = on; - exports.off = off; - exports.resolve = resolve$2; - exports.reject = reject$2; - exports.map = map; - exports.async = async; - exports.filter = filter; - exports.default = rsvp; }); requireModule("ember"); diff --git a/ember.js b/ember.js index 8ff25b735..14a3d55ab 100644 --- a/ember.js +++ b/ember.js @@ -6,10 +6,11 @@ * 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.11.0-beta.2 + * @version 2.10.2-with-backtracking */ var enifed, requireModule, Ember; +var mainContext = this; (function() { var isNode = typeof window === 'undefined' && @@ -111,6 +112,8 @@ var enifed, requireModule, Ember; } })(); +var babelHelpers; + function classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); @@ -1469,7 +1472,7 @@ enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'e var factoryInjections = factoryInjectionsFor(container, fullName); var cacheable = !areInjectionsDynamic(injections) && !areInjectionsDynamic(factoryInjections); - factoryInjections[_emberUtils.NAME_KEY] = registry.makeToString(factory, fullName); + factoryInjections._toString = registry.makeToString(factory, fullName); var injectedFactory = factory.extend(injections); @@ -2481,11 +2484,10 @@ enifed('container/registry', ['exports', 'ember-utils', 'ember-metal', 'containe enifed('dag-map', ['exports'], function (exports) { 'use strict'; /** - * A map of key/value pairs with dependencies contraints that can be traversed - * in topological order and is checked for cycles. + * A topologically ordered map of key/value pairs with a simple API for adding constraints. * - * @class DAG - * @constructor + * Edges can forward reference keys that have not been added yet (the forward reference will + * map the key to undefined). */ var DAG = (function () { function DAG() { @@ -2495,15 +2497,16 @@ var DAG = (function () { * Adds a key/value pair with dependencies on other key/value pairs. * * @public - * @method addEdges - * @param {string[]} key The key of the vertex to be added. - * @param {any} value The value of that vertex. - * @param {string[]|string|undefined} before A key or array of keys of the vertices that must - * be visited before this vertex. - * @param {string[]|string|undefined} after An string or array of strings with the keys of the - * vertices that must be after this vertex is visited. + * @param key The key of the vertex to be added. + * @param value The value of that vertex. + * @param before A key or array of keys of the vertices that must + * be visited before this vertex. + * @param after An string or array of strings with the keys of the + * vertices that must be after this vertex is visited. */ DAG.prototype.add = function (key, value, before, after) { + if (!key) + throw new Error('argument `key` is required'); var vertices = this._vertices; var v = vertices.add(key); v.val = value; @@ -2528,83 +2531,88 @@ var DAG = (function () { } } }; + /** + * @deprecated please use add. + */ + DAG.prototype.addEdges = function (key, value, before, after) { + this.add(key, value, before, after); + }; /** * Visits key/value pairs in topological order. * * @public - * @method topsort - * @param {Function} fn The function to be invoked with each key/value. + * @param callback The function to be invoked with each key/value. + */ + DAG.prototype.each = function (callback) { + this._vertices.walk(callback); + }; + /** + * @deprecated please use each. */ DAG.prototype.topsort = function (callback) { - this._vertices.topsort(callback); + this.each(callback); }; return DAG; }()); +/** @private */ var Vertices = (function () { function Vertices() { + this.length = 0; this.stack = new IntStack(); + this.path = new IntStack(); this.result = new IntStack(); - this.vertices = []; } Vertices.prototype.add = function (key) { if (!key) throw new Error("missing key"); - var vertices = this.vertices; - var i = 0; + var l = this.length | 0; var vertex; - for (; i < vertices.length; i++) { - vertex = vertices[i]; + for (var i = 0; i < l; i++) { + vertex = this[i]; if (vertex.key === key) return vertex; } - return vertices[i] = { - id: i, + this.length = l + 1; + return this[l] = { + idx: l, key: key, - val: null, - inc: null, + val: undefined, out: false, - mark: false + flag: false, + length: 0 }; }; Vertices.prototype.addEdge = function (v, w) { this.check(v, w.key); - var inc = w.inc; - if (!inc) { - w.inc = [v.id]; - } - else { - var i = 0; - for (; i < inc.length; i++) { - if (inc[i] === v.id) - return; - } - inc[i] = v.id; + var l = w.length | 0; + for (var i = 0; i < l; i++) { + if (w[i] === v.idx) + return; } + w.length = l + 1; + w[l] = v.idx; v.out = true; }; - Vertices.prototype.topsort = function (cb) { + Vertices.prototype.walk = function (cb) { this.reset(); - var vertices = this.vertices; - for (var i = 0; i < vertices.length; i++) { - var vertex = vertices[i]; + for (var i = 0; i < this.length; i++) { + var vertex = this[i]; if (vertex.out) continue; - this.visit(vertex, undefined); + this.visit(vertex, ""); } - this.each(cb); + this.each(this.result, cb); }; Vertices.prototype.check = function (v, w) { if (v.key === w) { throw new Error("cycle detected: " + w + " <- " + w); } - var inc = v.inc; // quick check - if (!inc || inc.length === 0) + if (v.length === 0) return; - var vertices = this.vertices; // shallow check - for (var i = 0; i < inc.length; i++) { - var key = vertices[inc[i]].key; + for (var i = 0; i < v.length; i++) { + var key = this[v[i]].key; if (key === w) { throw new Error("cycle detected: " + w + " <- " + v.key + " <- " + w); } @@ -2612,82 +2620,74 @@ var Vertices = (function () { // deep check this.reset(); this.visit(v, w); - if (this.result.len > 0) { + if (this.path.length > 0) { var msg_1 = "cycle detected: " + w; - this.each(function (key) { + this.each(this.path, function (key) { msg_1 += " <- " + key; }); throw new Error(msg_1); } }; - Vertices.prototype.each = function (cb) { - var _a = this, result = _a.result, vertices = _a.vertices; - for (var i = 0; i < result.len; i++) { - var vertex = vertices[result.stack[i]]; - cb(vertex.key, vertex.val); - } - }; - // reuse between cycle check and topsort Vertices.prototype.reset = function () { - this.stack.len = 0; - this.result.len = 0; - var vertices = this.vertices; - for (var i = 0; i < vertices.length; i++) { - vertices[i].mark = false; + this.stack.length = 0; + this.path.length = 0; + this.result.length = 0; + for (var i = 0, l = this.length; i < l; i++) { + this[i].flag = false; } }; Vertices.prototype.visit = function (start, search) { - var _a = this, stack = _a.stack, result = _a.result, vertices = _a.vertices; - stack.push(start.id); - while (stack.len) { - var index = stack.pop(); - if (index < 0) { - index = ~index; - if (search) { - result.pop(); - } - else { - result.push(index); - } - } - else { - var vertex = vertices[index]; - if (vertex.mark) { + var _a = this, stack = _a.stack, path = _a.path, result = _a.result; + stack.push(start.idx); + while (stack.length) { + var index = stack.pop() | 0; + if (index >= 0) { + // enter + var vertex = this[index]; + if (vertex.flag) continue; - } - if (search) { - result.push(index); - if (search === vertex.key) { - return; - } - } - vertex.mark = true; + vertex.flag = true; + path.push(index); + if (search === vertex.key) + break; + // push exit stack.push(~index); - var incoming = vertex.inc; - if (incoming) { - var i = incoming.length; - while (i--) { - index = incoming[i]; - if (!vertices[index].mark) { - stack.push(index); - } - } - } + this.pushIncoming(vertex); + } + else { + // exit + path.pop(); + result.push(~index); + } + } + }; + Vertices.prototype.pushIncoming = function (incomming) { + var stack = this.stack; + for (var i = incomming.length - 1; i >= 0; i--) { + var index = incomming[i]; + if (!this[index].flag) { + stack.push(index); } } }; + Vertices.prototype.each = function (indices, cb) { + for (var i = 0, l = indices.length; i < l; i++) { + var vertex = this[indices[i]]; + cb(vertex.key, vertex.val); + } + }; return Vertices; }()); +/** @private */ var IntStack = (function () { function IntStack() { - this.stack = [0, 0, 0, 0, 0, 0]; - this.len = 0; + this.length = 0; } IntStack.prototype.push = function (n) { - this.stack[this.len++] = n; + this[this.length++] = n | 0; }; IntStack.prototype.pop = function () { - return this.stack[--this.len]; + return this[--this.length] | 0; }; return IntStack; }()); @@ -3233,10 +3233,22 @@ enifed('ember-application/system/application', ['exports', 'ember-utils', 'ember */ 'use strict'; + exports._resetLegacyAddonWarnings = _resetLegacyAddonWarnings; + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); var librariesRegistered = false; + var warnedAboutLegacyViewAddon = false; + var warnedAboutLegacyControllerAddon = false; + + // For testing + + function _resetLegacyAddonWarnings() { + warnedAboutLegacyViewAddon = false; + warnedAboutLegacyControllerAddon = false; + } + /** An instance of `Ember.Application` is the starting point for every Ember application. It helps to instantiate, initialize and coordinate the many @@ -5594,6 +5606,7 @@ enifed('ember-debug/deprecate', ['exports', 'ember-metal', 'ember-console', 'emb emberjs.com website. @for Ember @public + @since 1.0.0 */ function deprecate(message, test, options) { @@ -5692,6 +5705,7 @@ enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'emb @param {Boolean} test Must be truthy for the assertion to pass. If falsy, an exception will be thrown. @public + @since 1.0.0 */ _emberMetal.setDebugFunction('assert', function assert(desc, test) { if (!test) { @@ -6014,6 +6028,7 @@ enifed('ember-debug/warn', ['exports', 'ember-console', 'ember-metal', 'ember-de The `id` should be namespaced by dots, e.g. "ember-debug.feature-flag-with-features-stripped" @for Ember @public + @since 1.0.0 */ function warn(message, test, options) { @@ -7144,7 +7159,7 @@ enifed('ember-glimmer/component', ['exports', 'ember-utils', 'ember-views', 'emb @default null @public */ - Component[_emberUtils.NAME_KEY] = 'Ember.Component'; + Component[_emberMetal.NAME_KEY] = 'Ember.Component'; Component.reopenClass({ isComponentFactory: true, @@ -9079,14 +9094,13 @@ enifed('ember-glimmer/helpers/-normalize-class', ['exports', 'ember-glimmer/util return new _emberGlimmerUtilsReferences.InternalHelperReference(normalizeClass, args); }; }); -enifed('ember-glimmer/helpers/action', ['exports', 'ember-utils', 'ember-glimmer/utils/references', 'ember-metal'], function (exports, _emberUtils, _emberGlimmerUtilsReferences, _emberMetal) { +enifed('ember-glimmer/helpers/action', ['exports', 'ember-utils', 'ember-metal', 'ember-glimmer/utils/references', 'glimmer-runtime', 'glimmer-reference'], function (exports, _emberUtils, _emberMetal, _emberGlimmerUtilsReferences, _glimmerRuntime, _glimmerReference) { /** @module ember @submodule ember-glimmer */ 'use strict'; - exports.createClosureAction = createClosureAction; var INVOKE = _emberUtils.symbol('INVOKE'); exports.INVOKE = INVOKE; var ACTION = _emberUtils.symbol('ACTION'); @@ -9339,140 +9353,128 @@ enifed('ember-glimmer/helpers/action', ['exports', 'ember-utils', 'ember-glimmer @public */ - var ClosureActionReference = (function (_CachedReference) { - babelHelpers.inherits(ClosureActionReference, _CachedReference); + exports.default = function (vm, args) { + var named = args.named; + var positional = args.positional; - ClosureActionReference.create = function create(args) { - // TODO: Const reference optimization. - return new ClosureActionReference(args); - }; + // The first two argument slots are reserved. + // pos[0] is the context (or `this`) + // pos[1] is the action name or function + // Anything else is an action argument. + var context = positional.at(0); + var action = positional.at(1); - function ClosureActionReference(args) { - babelHelpers.classCallCheck(this, ClosureActionReference); + // TODO: Is there a better way of doing this? + var debugKey = action._propertyKey; - _CachedReference.call(this); + var restArgs = undefined; - this.args = args; - this.tag = args.tag; + if (positional.length === 2) { + restArgs = _glimmerRuntime.EvaluatedPositionalArgs.empty(); + } else { + restArgs = _glimmerRuntime.EvaluatedPositionalArgs.create(positional.values.slice(2)); } - ClosureActionReference.prototype.compute = function compute() { - var _args = this.args; - var named = _args.named; - var positional = _args.positional; + var target = named.has('target') ? named.get('target') : context; + var processArgs = makeArgsProcessor(named.has('value') && named.get('value'), restArgs); - var positionalValues = positional.value(); + var fn = undefined; - var target = positionalValues[0]; - var rawActionRef = positional.at(1); - var rawAction = positionalValues[1]; - - // The first two argument slots are reserved. - // pos[0] is the context (or `this`) - // pos[1] is the action name or function - // Anything else is an action argument. - var actionArgs = positionalValues.slice(2); - - // on-change={{action setName}} - // element-space actions look to "controller" then target. Here we only - // look to "target". - var actionType = typeof rawAction; - var action = rawAction; - - if (rawActionRef[INVOKE]) { - target = rawActionRef; - action = rawActionRef[INVOKE]; - } else if (_emberMetal.isNone(rawAction)) { - throw new _emberMetal.Error('Action passed is null or undefined in (action) from ' + target + '.'); - } else if (actionType === 'string') { - // on-change={{action 'setName'}} - var actionName = rawAction; - - action = null; + if (typeof action[INVOKE] === 'function') { + fn = makeClosureAction(action, action, action[INVOKE], processArgs, debugKey); + } else if (_glimmerReference.isConst(target) && _glimmerReference.isConst(action)) { + fn = makeClosureAction(context.value(), target.value(), action.value(), processArgs, debugKey); + } else { + fn = makeDynamicClosureAction(context.value(), target, action, processArgs, debugKey); + } - if (named.has('target')) { - // on-change={{action 'setName' target=alternativeComponent}} - target = named.get('target').value(); - } + fn[ACTION] = true; - if (target['actions']) { - action = target.actions[actionName]; - } + return new _emberGlimmerUtilsReferences.UnboundReference(fn); + }; - if (!action) { - throw new _emberMetal.Error('An action named \'' + actionName + '\' was not found in ' + target); - } - } else if (action && typeof action[INVOKE] === 'function') { - target = action; - action = action[INVOKE]; - } else if (actionType !== 'function') { - // TODO: Is there a better way of doing this? - var rawActionLabel = rawActionRef._propertyKey || rawAction; - throw new _emberMetal.Error('An action could not be made for `' + rawActionLabel + '` in ' + target + '. Please confirm that you are using either a quoted action name (i.e. `(action \'' + rawActionLabel + '\')`) or a function available in ' + target + '.'); - } + function NOOP(args) { + return args; + } - var valuePath = named.get('value').value(); + function makeArgsProcessor(valuePathRef, actionArgsRef) { + var mergeArgs = null; - return createClosureAction(target, action, valuePath, actionArgs); - }; + if (actionArgsRef.length > 0) { + mergeArgs = function (args) { + return actionArgsRef.value().concat(args); + }; + } - return ClosureActionReference; - })(_emberGlimmerUtilsReferences.CachedReference); + var readValue = null; - exports.ClosureActionReference = ClosureActionReference; + if (valuePathRef) { + readValue = function (args) { + var valuePath = valuePathRef.value(); - exports.default = function (vm, args) { - return ClosureActionReference.create(args); - }; + if (valuePath && args.length > 0) { + args[0] = _emberMetal.get(args[0], valuePath); + } - function createClosureAction(target, action, valuePath, actionArgs) { - var closureAction = undefined; - var actionArgLength = actionArgs.length; + return args; + }; + } - if (actionArgLength > 0) { - closureAction = function () { - for (var _len = arguments.length, passedArguments = Array(_len), _key = 0; _key < _len; _key++) { - passedArguments[_key] = arguments[_key]; - } + if (mergeArgs && readValue) { + return function (args) { + return readValue(mergeArgs(args)); + }; + } else { + return mergeArgs || readValue || NOOP; + } + } - var args = new Array(actionArgLength + passedArguments.length); + function makeDynamicClosureAction(context, targetRef, actionRef, processArgs, debugKey) { + // We don't allow undefined/null values, so this creates a throw-away action to trigger the assertions + _emberMetal.runInDebug(function () { + makeClosureAction(context, targetRef.value(), actionRef.value(), processArgs, debugKey); + }); - for (var i = 0; i < actionArgLength; i++) { - args[i] = actionArgs[i]; - } + return function () { + return makeClosureAction(context, targetRef.value(), actionRef.value(), processArgs, debugKey).apply(undefined, arguments); + }; + } - for (var i = 0; i < passedArguments.length; i++) { - args[i + actionArgLength] = passedArguments[i]; - } + function makeClosureAction(context, target, action, processArgs, debugKey) { + var self = undefined, + fn = undefined; - if (valuePath && args.length > 0) { - args[0] = _emberMetal.get(args[0], valuePath); - } + _emberMetal.assert('Action passed is null or undefined in (action) from ' + target + '.', !_emberMetal.isNone(action)); - var payload = { target: target, args: args, label: 'glimmer-closure-action' }; - return _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { - return _emberMetal.run.join.apply(_emberMetal.run, [target, action].concat(args)); - }); - }; + if (typeof action[INVOKE] === 'function') { + self = action; + fn = action[INVOKE]; } else { - closureAction = function () { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } + var typeofAction = typeof action; - if (valuePath && args.length > 0) { - args[0] = _emberMetal.get(args[0], valuePath); - } + if (typeofAction === 'string') { + self = target; + fn = target.actions && target.actions[action]; - var payload = { target: target, args: args, label: 'glimmer-closure-action' }; - return _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { - return _emberMetal.run.join.apply(_emberMetal.run, [target, action].concat(args)); - }); - }; + _emberMetal.assert('An action named \'' + action + '\' was not found in ' + target, fn); + } else if (typeofAction === 'function') { + self = context; + fn = action; + } else { + _emberMetal.assert('An action could not be made for `' + (debugKey || action) + '` in ' + target + '. Please confirm that you are using either a quoted action name (i.e. `(action \'' + (debugKey || 'myAction') + '\')`) or a function available in ' + target + '.', false); + } } - closureAction[ACTION] = true; - return closureAction; + return function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var payload = { target: self, args: args, label: 'glimmer-closure-action' }; + return _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { + return _emberMetal.run.join.apply(_emberMetal.run, [self, fn].concat(processArgs(args))); + }); + }; } }); enifed('ember-glimmer/helpers/component', ['exports', 'ember-utils', 'ember-glimmer/utils/references', 'ember-glimmer/syntax/curly-component', 'glimmer-runtime', 'ember-metal'], function (exports, _emberUtils, _emberGlimmerUtilsReferences, _emberGlimmerSyntaxCurlyComponent, _glimmerRuntime, _emberMetal) { @@ -9488,19 +9490,17 @@ enifed('ember-glimmer/helpers/component', ['exports', 'ember-utils', 'ember-glim additional information on how a `Component` functions. `{{component}}`'s primary use is for cases where you want to dynamically change which type of component is rendered as the state of your application - changes. This helper has three modes: inline, block, and nested. - - ### Inline Form + changes. The provided block will be applied as the template for the component. + Given an empty `` the following template: - Given the following template: - - ```app/application.hbs + ```handlebars + {{! application.hbs }} {{component infographicComponentName}} ``` And the following application code: - ```app/controllers/application.js + ```javascript export default Ember.Controller.extend({ infographicComponentName: computed('isMarketOpen', { get() { @@ -9521,87 +9521,33 @@ enifed('ember-glimmer/helpers/component', ['exports', 'ember-utils', 'ember-glim Note: You should not use this helper when you are consistently rendering the same component. In that case, use standard component syntax, for example: - ```app/templates/application.hbs + ```handlebars + {{! application.hbs }} {{live-updating-chart}} ``` - ### Block Form - - Using the block form of this helper is similar to using the block form - of a component. Given the following application template: - - ```app/templates/application.hbs - {{#component infographicComponentName}} - Last update: {{lastUpdateTimestamp}} - {{/component}} - ``` - - The following controller code: - - ```app/controllers/application.js - export default Ember.Controller.extend({ - lastUpdateTimestamp: computed(function() { - return new Date(); - }), - - infographicComponentName: computed('isMarketOpen', { - get() { - if (this.get('isMarketOpen')) { - return 'live-updating-chart'; - } else { - return 'market-close-summary'; - } - } - }) - }); - ``` - - And the following component template: - - ```app/templates/components/live-updating-chart.hbs - {{! chart }} - {{yield}} - ``` - - The `Last Update: {{lastUpdateTimestamp}}` will be rendered in place of the `{{yield}}`. - - ### Nested Usage + ## Nested Usage The `component` helper can be used to package a component path with initial attrs. The included attrs can then be merged during the final invocation. For example, given a `person-form` component with the following template: - ```app/templates/components/person-form.hbs + ```handlebars {{yield (hash - nameInput=(component "my-input-component" value=model.name placeholder="First Name") - )}} + nameInput=(component "my-input-component" value=model.name placeholder="First Name"))}} ``` - When yielding the component via the `hash` helper, the component is invocked directly. - See the following snippet: + The following snippet: ``` {{#person-form as |form|}} - {{form.nameInput placeholder="Username"}} + {{component form.nameInput placeholder="Username"}} {{/person-form}} ``` - Which outputs an input whose value is already bound to `model.name` and `placeholder` + would output an input whose value is already bound to `model.name` and `placeholder` is "Username". - When yielding the component without the hash helper use the `component` helper. - For example, below is a `full-name` component template: - - ```handlebars - {{yield (component "my-input-component" value=model.name placeholder="Name")}} - ``` - - ``` - {{#full-name as |field|}} - {{component field placeholder="Full name"}} - {{/full-name}} - ``` - @method component @since 1.11.0 @for Ember.Templates.helpers @@ -10027,8 +9973,8 @@ enifed('ember-glimmer/helpers/get', ['exports', 'ember-metal', 'ember-glimmer/ut ```handlebars {{get person factName}} - - + + ``` The `{{get}}` helper can also respect mutable values itself. For example: @@ -10443,9 +10389,6 @@ enifed('ember-glimmer/helpers/mut', ['exports', 'ember-utils', 'ember-metal', 'e }); ``` - Note that for curly components (`{{my-component}}`) the bindings are already mutable, - making the `mut` unnecessary. - Additionally, the `mut` helper can be combined with the `action` helper to mutate a value. For example: @@ -10459,7 +10402,7 @@ enifed('ember-glimmer/helpers/mut', ['exports', 'ember-utils', 'ember-metal', 'e // my-child.js export default Component.extend({ click() { - this.get('click-count-change')(this.get('childClickCount') + 1); + this.get('clickCountChange')(this.get('childClickCount') + 1); } }); ``` @@ -11327,7 +11270,7 @@ enifed('ember-glimmer/renderer', ['exports', 'ember-glimmer/utils/references', ' var runInTransaction = undefined; - if (true || false) { + if (true || true) { runInTransaction = _emberMetal.runInTransaction; } else { runInTransaction = function (context, methodName) { @@ -14258,7 +14201,7 @@ enifed('ember-glimmer/utils/references', ['exports', 'ember-utils', 'ember-metal var TwoWayFlushDetectionTag = undefined; - if (true || false) { + if (true || true) { TwoWayFlushDetectionTag = (function () { function _class(tag, key, ref) { babelHelpers.classCallCheck(this, _class); @@ -14332,7 +14275,7 @@ enifed('ember-glimmer/utils/references', ['exports', 'ember-utils', 'ember-metal this._parentValue = parentValue; this._propertyKey = propertyKey; - if (true || false) { + if (true || true) { this.tag = new TwoWayFlushDetectionTag(_emberMetal.tagForProperty(parentValue, propertyKey), propertyKey, this); } else { this.tag = _emberMetal.tagForProperty(parentValue, propertyKey); @@ -14347,7 +14290,7 @@ enifed('ember-glimmer/utils/references', ['exports', 'ember-utils', 'ember-metal var _parentValue = this._parentValue; var _propertyKey = this._propertyKey; - if (true || false) { + if (true || true) { this.tag.didCompute(_parentValue); } @@ -14378,7 +14321,7 @@ enifed('ember-glimmer/utils/references', ['exports', 'ember-utils', 'ember-metal this._parentObjectTag = parentObjectTag; this._propertyKey = propertyKey; - if (true || false) { + if (true || true) { var tag = _glimmerReference.combine([parentReferenceTag, parentObjectTag]); this.tag = new TwoWayFlushDetectionTag(tag, propertyKey, this); } else { @@ -14404,7 +14347,7 @@ enifed('ember-glimmer/utils/references', ['exports', 'ember-utils', 'ember-metal _emberMetal.watchKey(parentValue, _propertyKey); } - if (true || false) { + if (true || true) { this.tag.didCompute(parentValue); } @@ -15030,6 +14973,8 @@ enifed('ember-metal/alias', ['exports', 'ember-utils', 'ember-metal/debug', 'emb exports.default = alias; exports.AliasedProperty = AliasedProperty; + var CONSUMED = {}; + function alias(altKey) { return new AliasedProperty(altKey); } @@ -15050,28 +14995,30 @@ enifed('ember-metal/alias', ['exports', 'ember-utils', 'ember-metal/debug', 'emb } }; - AliasedProperty.prototype._addDependentKeyIfMissing = function (obj, keyName) { + AliasedProperty.prototype.teardown = function (obj, keyName) { var meta = _emberMetalMeta.meta(obj); - if (!meta.peekDeps(this.altKey, keyName)) { - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); + if (meta.peekWatching(keyName)) { + _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); } }; - AliasedProperty.prototype._removeDependentKeyIfAdded = function (obj, keyName) { - var meta = _emberMetalMeta.meta(obj); - if (meta.peekDeps(this.altKey, keyName)) { - _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); - } + AliasedProperty.prototype.willWatch = function (obj, keyName) { + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); }; - AliasedProperty.prototype.willWatch = AliasedProperty.prototype._addDependentKeyIfMissing; - AliasedProperty.prototype.didUnwatch = AliasedProperty.prototype._removeDependentKeyIfAdded; - AliasedProperty.prototype.teardown = AliasedProperty.prototype._removeDependentKeyIfAdded; + AliasedProperty.prototype.didUnwatch = function (obj, keyName) { + _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); + }; AliasedProperty.prototype.get = function AliasedProperty_get(obj, keyName) { - this._addDependentKeyIfMissing(obj, keyName); - - return _emberMetalProperty_get.get(obj, this.altKey); + var ret = _emberMetalProperty_get.get(obj, this.altKey); + var meta = _emberMetalMeta.meta(obj); + var cache = meta.writableCache(); + if (cache[keyName] !== CONSUMED) { + cache[keyName] = CONSUMED; + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); + } + return ret; }; AliasedProperty.prototype.set = function AliasedProperty_set(obj, keyName, value) { @@ -17588,6 +17535,7 @@ enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-me exports.removeObserver = _emberMetalObserver.removeObserver; exports._addBeforeObserver = _emberMetalObserver._addBeforeObserver; exports._removeBeforeObserver = _emberMetalObserver._removeBeforeObserver; + exports.NAME_KEY = _emberMetalMixin.NAME_KEY; exports.Mixin = _emberMetalMixin.Mixin; exports.aliasMethod = _emberMetalMixin.aliasMethod; exports._immediateObserver = _emberMetalMixin._immediateObserver; @@ -18788,7 +18736,7 @@ enifed('ember-metal/meta', ['exports', 'ember-utils', 'ember-metal/features', 'e var META_DESTROYED = 1 << 3; var IS_PROXY = 1 << 4; - if (true || false) { + if (true || true) { members.lastRendered = ownMap; members.lastRenderedFrom = ownMap; // FIXME: not used in production, remove me from prod builds } @@ -18830,7 +18778,7 @@ enifed('ember-metal/meta', ['exports', 'ember-utils', 'ember-metal/features', 'e // inherited, and we can optimize it much better than JS runtimes. this.parent = parentMeta; - if (true || false) { + if (true || true) { this._lastRendered = undefined; this._lastRenderedFrom = undefined; // FIXME: not used in production, remove me from prod builds } @@ -19626,32 +19574,20 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb function applyConcatenatedProperties(obj, key, value, values) { var baseValue = values[key] || obj[key]; - var ret = undefined; if (baseValue) { if ('function' === typeof baseValue.concat) { if (value === null || value === undefined) { - ret = baseValue; + return baseValue; } else { - ret = baseValue.concat(value); + return baseValue.concat(value); } } else { - ret = _emberUtils.makeArray(baseValue).concat(value); + return _emberUtils.makeArray(baseValue).concat(value); } } else { - ret = _emberUtils.makeArray(value); + return _emberUtils.makeArray(value); } - - _emberMetalDebug.runInDebug(function () { - // it is possible to use concatenatedProperties with strings (which cannot be frozen) - // only freeze objects... - if (typeof ret === 'object' && ret !== null) { - // prevent mutating `concatenatedProperties` array after it is applied - Object.freeze(ret); - } - }); - - return ret; } function applyMergedProperties(obj, key, value, values) { @@ -19927,6 +19863,9 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb return obj; } + var NAME_KEY = _emberUtils.GUID_KEY + '_name'; + + exports.NAME_KEY = NAME_KEY; /** The `Ember.Mixin` class allows you to create mixins, whose properties can be added to other classes. For instance, @@ -20009,7 +19948,7 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb this.ownerConstructor = undefined; this._without = undefined; this[_emberUtils.GUID_KEY] = null; - this[_emberUtils.NAME_KEY] = null; + this[NAME_KEY] = null; _emberMetalDebug.debugSeal(this); } @@ -21002,7 +20941,7 @@ enifed('ember-metal/property_events', ['exports', 'ember-utils', 'ember-metal/me _emberMetalTags.markObjectAsDirty(meta, keyName); - if (true || false) { + if (true || true) { _emberMetalTransaction.assertNotRendered(obj, keyName, meta); } } @@ -22331,20 +22270,20 @@ enifed('ember-metal/transaction', ['exports', 'ember-metal/meta', 'ember-metal/d assertNotRendered = undefined; var raise = _emberMetalDebug.assert; - if (false) { + if (true) { raise = function (message, test) { _emberMetalDebug.deprecate(message, test, { id: 'ember-views.render-double-modify', until: '3.0.0' }); }; } var implication = undefined; - if (false) { + if (true) { implication = 'will be removed in Ember 3.0.'; } else if (true) { implication = 'is no longer supported. See https://github.com/emberjs/ember.js/issues/13948 for more details.'; } - if (true || false) { + if (true || true) { (function () { var counter = 0; var inTransaction = false; @@ -22396,7 +22335,7 @@ enifed('ember-metal/transaction', ['exports', 'ember-metal/meta', 'ember-metal/d label = 'the same value'; } - return 'You modified ' + label + ' twice on ' + object + ' in a single render. This was unreliable and slow in Ember 1.x and ' + implication; + return 'You modified ' + parts.join('.') + ' twice on ' + object + ' in a single render. This was unreliable and slow in Ember 1.x and ' + implication; })(), false); shouldReflush = true; @@ -24690,8 +24629,9 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** The name of the route, dot-delimited. - For example, a route found at `app/routes/posts/post.js` will have - a `routeName` of `posts.post`. + 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 @@ -24907,23 +24847,18 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** Returns a hash containing the parameters of an ancestor route. Example - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('member', { path: ':name' }, function() { this.route('interest', { path: ':interest' }); }); }); - ``` - ```app/routes/member.js - export default Ember.Route.extend({ + App.MemberRoute = Ember.Route.extend({ queryParams: { memberQp: { refreshModel: true } } }); - ``` - ```app/routes/member/interest.js - export default Ember.Route.extend({ + App.MemberInterestRoute = Ember.Route.extend({ queryParams: { interestQp: { refreshModel: true } }, @@ -25016,10 +24951,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** A hook you can use to reset controller values either when the model changes or the route is exiting. - ```app/routes/articles.js - import Ember from 'ember'; - export default Ember.Route.extend({ - resetController(controller, isExiting, transition) { + ```javascript + App.ArticlesRoute = Ember.Route.extend({ + // ... + resetController: function(controller, isExiting, transition) { if (isExiting) { controller.set('page', 1); } @@ -25070,19 +25005,12 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** The name of the template to use by default when rendering this routes template. - ```app/routes/posts/list.js - import Ember from 'ember'; - export default Ember.Route.extend({ + ```javascript + let PostsList = Ember.Route.extend({ templateName: 'posts/list' }); - ``` - ```app/routes/posts/index.js - import PostsList from '../posts/list'; - export default PostsList.extend(); - ``` - ```app/routes/posts/archived.js - import PostsList from '../posts/list'; - export default PostsList.extend(); + App.PostsIndexRoute = PostsList.extend(); + App.PostsArchivedRoute = PostsList.extend(); ``` @property templateName @type String @@ -25117,11 +25045,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' or decorating the transition from the currently active routes. A good example is preventing navigation when a form is half-filled out: - ```app/routes/contact-form.js - import Ember from 'ember'; - export default Ember.Route.extend({ + ```javascript + App.ContactFormRoute = Ember.Route.extend({ actions: { - willTransition(transition) { + willTransition: function(transition) { if (this.controller.get('userHasEnteredData')) { this.controller.displayNavigationConfirm(); transition.abort(); @@ -25155,11 +25082,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' have resolved. The `didTransition` action has no arguments, however, it can be useful for tracking page views or resetting state on the controller. - ```app/routes/login.js - import Ember from 'ember'; - export default Ember.Route.extend({ + ```javascript + App.LoginRoute = Ember.Route.extend({ actions: { - didTransition() { + didTransition: function() { this.controller.get('errors.base').clear(); return true; // Bubble the didTransition event } @@ -25176,10 +25102,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' hook returns a promise that is not already resolved. The current `Transition` object is the first parameter and the route that triggered the loading event is the second parameter. - ```app/routes/application.js - export default Ember.Route.extend({ + ```javascript + App.ApplicationRoute = Ember.Route.extend({ actions: { - loading(transition, route) { + loading: function(transition, route) { let controller = this.controllerFor('foo'); controller.set('currentlyLoading', true); transition.finally(function() { @@ -25205,14 +25131,13 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' Here is an example of an error handler that will be invoked for rejected promises from the various hooks on the route, as well as any unhandled errors from child routes: - ```app/routes/admin.js - import Ember from 'ember'; - export default Ember.Route.extend({ - beforeModel() { + ```javascript + App.AdminRoute = Ember.Route.extend({ + beforeModel: function() { return Ember.RSVP.reject('bad things!'); }, actions: { - error(error, transition) { + error: function(error, transition) { // Assuming we got here due to the error in `beforeModel`, // we can expect that error === "bad things!", // but a promise model rejecting would also @@ -25230,11 +25155,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' will fire a default error handler that logs the error. You can specify your own global default error handler by overriding the `error` handler on `ApplicationRoute`: - ```app/routes/application.js - import Ember from 'ember'; - export default Ember.Route.extend({ + ```javascript + App.ApplicationRoute = Ember.Route.extend({ actions: { - error(error, transition) { + error: function(error, transition) { this.controllerFor('banner').displayError(error.message); } } @@ -25250,12 +25174,11 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** This event is triggered when the router enters the route. It is not executed when the model for the route changes. - ```app/routes/application.js - import Ember from 'ember'; - export default Ember.Route.extend({ - collectAnalytics: Ember.on('activate', function(){ + ```javascript + App.ApplicationRoute = Ember.Route.extend({ + collectAnalytics: function(){ collectAnalytics(); - }) + }.on('activate') }); ``` @event activate @@ -25266,12 +25189,11 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** This event is triggered when the router completely exits this route. It is not executed when the model for the route changes. - ```app/routes/index.js - import Ember from 'ember'; - export default Ember.Route.extend({ - trackPageLeaveAnalytics: Ember.on('deactivate', function(){ + ```javascript + App.IndexRoute = Ember.Route.extend({ + trackPageLeaveAnalytics: function(){ trackPageLeaveAnalytics(); - }) + }.on('deactivate') }); ``` @event deactivate @@ -25282,11 +25204,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** The controller associated with this route. Example - ```app/routes/form.js - import Ember from 'ember'; - export default Ember.Route.extend({ + ```javascript + App.FormRoute = Ember.Route.extend({ actions: { - willTransition(transition) { + willTransition: function(transition) { if (this.controller.get('userHasEnteredData') && !confirm('Are you sure you want to abandon progress?')) { transition.abort(); @@ -25458,17 +25379,13 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' ``` Multiple models will be applied last to first recursively up the route tree. - ```app/routes.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('blogPost', { path:':blogPostId' }, function() { - this.route('blogComment', { path: ':blogCommentId' }); + this.route('blogComment', { path: ':blogCommentId', resetNamespace: true }); }); }); - export default Router; - ``` - ```javascript - this.transitionTo('blogComment', aPost, aComment); + this.transitionTo('blogComment', aPost, aComment); this.transitionTo('blogComment', 1, 13); ``` It is also possible to pass a URL (a string that starts with a @@ -25490,20 +25407,15 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' ``` See also [replaceWith](#method_replaceWith). Simple Transition Example - ```app/routes.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('index'); this.route('secret'); this.route('fourOhFour', { path: '*:' }); }); - export default Router; - ``` - ```app/routes/index.js - import Ember from 'ember': - export Ember.Route.extend({ + App.IndexRoute = Ember.Route.extend({ actions: { - moveToSecret(context) { + moveToSecret: function(context) { if (authorized()) { this.transitionTo('secret', context); } else { @@ -25514,63 +25426,48 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' }); ``` Transition to a nested route - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('articles', { path: '/articles' }, function() { this.route('new'); }); }); - export default Router; - ``` - ```app/routes/index.js - import Ember from 'ember'; - export default Ember.Route.extend({ + App.IndexRoute = Ember.Route.extend({ actions: { - transitionToNewArticle() { + transitionToNewArticle: function() { this.transitionTo('articles.new'); } } }); ``` Multiple Models Example - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('index'); this.route('breakfast', { path: ':breakfastId' }, function() { - this.route('cereal', { path: ':cerealId' }); + this.route('cereal', { path: ':cerealId', resetNamespace: true }); }); }); - export default Router; - ``` - ```app/routes/index.js - import Ember from 'ember'; - export default Ember.Route.extend({ + App.IndexRoute = Ember.Route.extend({ actions: { - moveToChocolateCereal() { + moveToChocolateCereal: function() { let cereal = { cerealId: 'ChocolateYumminess' }; let breakfast = { breakfastId: 'CerealAndMilk' }; - this.transitionTo('breakfast.cereal', breakfast, cereal); + this.transitionTo('cereal', breakfast, cereal); } } }); ``` Nested Route with Query String Example - ```app/routes.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('fruits', function() { this.route('apples'); }); }); - export default Router; - ``` - ```app/routes/index.js - import Ember from 'ember'; - export default Ember.Route.extend({ + App.IndexRoute = Ember.Route.extend({ actions: { - transitionToApples() { + transitionToApples: function() { this.transitionTo('fruits.apples', { queryParams: { color: 'red' } }); } } @@ -25641,18 +25538,13 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' Beside that, it is identical to `transitionTo` in all other respects. See 'transitionTo' for additional information regarding multiple models. Example - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('index'); this.route('secret'); }); - export default Router; - ``` - ```app/routes/secret.js - import Ember from 'ember'; - export default Ember.Route.extend({ - afterModel() { + App.SecretRoute = Ember.Route.extend({ + afterModel: function() { if (!authorized()){ this.replaceWith('index'); } @@ -25677,28 +25569,20 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' Sends an action to the router, which will delegate it to the currently active route hierarchy per the bubbling rules explained under `actions`. Example - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('index'); }); - export default Router; - ``` - ```app/routes/application.js - import Ember from 'ember'; - export default Ember.Route.extend({ + App.ApplicationRoute = Ember.Route.extend({ actions: { - track(arg) { + track: function(arg) { console.log(arg, 'was clicked'); } } }); - ``` - ```app/routes/index.js - import Ember from 'ember'; - export default Ember.Route.extend({ + App.IndexRoute = Ember.Route.extend({ actions: { - trackIfDebug(arg) { + trackIfDebug: function(arg) { if (debug) { this.send('track', arg); } @@ -25817,7 +25701,6 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' cache.stash(cacheKey, prop, value); } }, - /** This hook is the first of the route entry validation hooks called when an attempt is made to transition into a route @@ -25837,6 +25720,46 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' transition until the promise resolves (or rejects). This could be useful, for instance, for retrieving async code from the server that is required to enter a route. + ```javascript + App.PostRoute = Ember.Route.extend({ + beforeModel: function(transition) { + if (!App.Post) { + return Ember.$.getScript('/models/post.js'); + } + } + }); + ``` + If `App.Post` doesn't exist in the above example, + `beforeModel` will use jQuery's `getScript`, which + returns a promise that resolves after the server has + successfully retrieved and executed the code from the + server. Note that if an error were to occur, it would + be passed to the `error` hook on `Ember.Route`, but + it's also possible to handle errors specific to + `beforeModel` right from within the hook (to distinguish + from the shared error handling behavior of the `error` + hook): + ```javascript + App.PostRoute = Ember.Route.extend({ + beforeModel: function(transition) { + if (!App.Post) { + let self = this; + return Ember.$.getScript('post.js').then(null, function(e) { + self.transitionTo('help'); + // Note that the above transitionTo will implicitly + // halt the transition. If you were to return + // nothing from this promise reject handler, + // according to promise semantics, that would + // convert the reject into a resolve and the + // transition would continue. To propagate the + // error so that it'd be handled by the `error` + // hook, you would have to + return Ember.RSVP.reject(e); + }); + } + } + }); + ``` @method beforeModel @param {Transition} transition @return {Promise} if the value returned from this hook is @@ -25855,10 +25778,9 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' the `transition`, and is therefore suited to performing logic that can only take place after the model has already resolved. - ```app/routes/posts.js - import Ember from 'ember'; - export default Ember.Route.extend({ - afterModel(posts, transition) { + ```javascript + App.PostsRoute = Ember.Route.extend({ + afterModel: function(posts, transition) { if (posts.get('length') === 1) { this.transitionTo('post.show', posts.get('firstObject')); } @@ -25918,12 +25840,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** A hook you can implement to convert the URL into the model for this route. - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('post', { path: '/posts/:post_id' }); }); - export default Router; ``` The model for the `post` route is `store.findRecord('post', params.post_id)`. By default, if your route has a dynamic segment ending in `_id`: @@ -25957,10 +25877,9 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' if a promise returned from `model` fails, the error will be handled by the `error` hook on `Ember.Route`. Example - ```app/routes/post.js - import Ember from 'ember'; - export default Ember.Route.extend({ - model(params) { + ```javascript + App.PostRoute = Ember.Route.extend({ + model: function(params) { return this.store.findRecord('post', params.post_id); } }); @@ -25976,7 +25895,8 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' @public */ model: function (params, transition) { - var name = undefined, + var match = undefined, + name = undefined, sawParams = undefined, value = undefined; var queryParams = _emberMetal.get(this, '_qp.map'); @@ -25986,8 +25906,7 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' continue; } - var match = prop.match(/^(.*)_id$/); - if (match) { + if (match = prop.match(/^(.*)_id$/)) { name = match[1]; value = params[prop]; } @@ -26067,20 +25986,16 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** A hook you can implement to convert the route's model into parameters for the URL. - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('post', { path: '/posts/:post_id' }); }); - ``` - ```app/routes/post.js - import Ember from 'ember'; - export default Ember.Route.extend({ - model(params) { + App.PostRoute = Ember.Route.extend({ + model: function(params) { // the server returns `{ id: 12 }` return Ember.$.getJSON('/posts/' + params.post_id); }, - serialize(model) { + serialize: function(model) { // this will make the URL `/posts/12` return { post_id: model.id }; } @@ -26112,13 +26027,12 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' prevent this default behavior. If you want to preserve that behavior when implementing your `setupController` function, make sure to call `_super`: - ```app/routes/photos.js - import Ember from 'ebmer'; - export default Ember.Route.extend({ - model() { + ```javascript + App.PhotosRoute = Ember.Route.extend({ + model: function() { return this.store.findAll('photo'); }, - setupController(controller, model) { + setupController: function(controller, model) { // Call _super for default behavior this._super(controller, model); // Implement your custom setup after @@ -26130,21 +26044,18 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' of this route. If no explicit controller is defined, Ember will automatically create one. As an example, consider the router: - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('post', { path: '/posts/:post_id' }); }); - export default Router; ``` For the `post` route, a controller named `App.PostController` would be used if it is defined. If it is not defined, a basic `Ember.Controller` instance would be used. Example - ```app/routes/post.js - import Ember from 'ember'; - export default Ember.Route.extend({ - setupController(controller, model) { + ```javascript + App.PostRoute = Ember.Route.extend({ + setupController: function(controller, model) { controller.set('model', model); } }); @@ -26162,14 +26073,12 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' }, /** - Returns the resolved model of the current route, or a parent (or any ancestor) - route in a route hierarchy. + Returns the controller for a particular route or name. The controller instance must already have been created, either through entering the associated route or using `generateController`. - ```app/routes/post.js - import Ember from 'ember'; - export default Ember.Route.extend({ - setupController(controller, post) { + ```javascript + App.PostRoute = Ember.Route.extend({ + setupController: function(controller, post) { this._super(controller, post); this.controllerFor('posts').set('currentPost', post); } @@ -26203,10 +26112,9 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** Generates a controller for a route. Example - ```app/routes/post.js - import Ember from 'ember'; - export default Ember.Route.extend({ - setupController(controller, post) { + ```javascript + App.PostRoute = Ember.Route.extend({ + setupController: function(controller, post) { this._super(controller, post); this.generateController('posts'); } @@ -26232,19 +26140,14 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' retrieve it. If the ancestor route's model was a promise, its resolved result is returned. Example - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('post', { path: '/post/:post_id' }, function() { this.route('comments', { resetNamespace: true }); }); }); - export default Router; - ``` - ```app/routes/comments.js - import Ember from 'ember'; - export default Ember.Route.extend({ - afterModel() { + App.CommentsRoute = Ember.Route.extend({ + afterModel: function() { this.set('post', this.modelFor('post')); } }); @@ -26289,10 +26192,9 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' template, configured with the controller for the route. This method can be overridden to set up and render additional or alternative templates. - ```app/routes/posts.js - import Ember from 'ember'; - export default Ember.Route.extend({ - renderTemplate(controller, model) { + ```javascript + App.PostsRoute = Ember.Route.extend({ + renderTemplate: function(controller, model) { let favController = this.controllerFor('favoritePost'); // Render the `favoritePost` template into // the outlet `posts`, and display the `favoritePost` @@ -26320,12 +26222,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' phase of routing (via the `renderTemplate` hook) and later in response to user interaction. For example, given the following minimal router and templates: - ```app/router.js - // ... - Router.map(function() { + ```javascript + Router.map(function() { this.route('photos'); }); - export default Router; ``` ```handlebars @@ -26339,10 +26239,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' ``` You can render `photos.hbs` into the `"anOutletName"` outlet of `application.hbs` by calling `render`: - ```app/routes/post.js - import Ember from 'ember'; - export default Ember.Route.extend({ - renderTemplate() { + ```javascript + // posts route + Ember.Route.extend({ + renderTemplate: function() { this.render('photos', { into: 'application', outlet: 'anOutletName' @@ -26352,10 +26252,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' ``` `render` additionally allows you to supply which `controller` and `model` objects should be loaded and associated with the rendered template. - ```app/routes/posts.js - import Ember from 'ember'; - export default Ember.Route.extend({ - renderTemplate(controller, model){ + ```javascript + // posts route + Ember.Route.extend({ + renderTemplate: function(controller, model){ this.render('posts', { // the template to render, referenced by name into: 'application', // the template to render into, referenced by name outlet: 'anOutletName', // the outlet inside `options.template` to render into. @@ -26374,26 +26274,26 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' based on the name of the route specified in the router or the Route's `controllerName` and `templateName` properties. For example: - ```app/router.js - // ... - Router.map(function() { + ```javascript + // router + Router.map(function() { this.route('index'); this.route('post', { path: '/posts/:post_id' }); }); - export default Router; ``` - ```app/routes/post.js - import Ember from 'ember'; - export default Ember.Route.extend({ - renderTemplate() { + ```javascript + // post route + PostRoute = App.Route.extend({ + renderTemplate: function() { this.render(); // all defaults apply } }); ``` - The name of the route, defined by the router, is `post`. + The name of the `PostRoute`, defined by the router, is `post`. The following equivalent default options will be applied when the Route calls `render`: ```javascript + // this.render('post', { // the template name associated with 'post' Route into: 'application', // the parent route to 'post' Route outlet: 'main', // {{outlet}} and {{outlet 'main'}} are synonymous, @@ -26442,17 +26342,16 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' * `parentView`: the name of the view containing the outlet to clear (default: the view rendered by the parent route) Example: - ```app/routes/application.js - import Ember from 'ember'; - export default App.Route.extend({ + ```javascript + App.ApplicationRoute = App.Route.extend({ actions: { - showModal(evt) { + showModal: function(evt) { this.render(evt.modalName, { outlet: 'modal', into: 'application' }); }, - hideModal(evt) { + hideModal: function(evt) { this.disconnectOutlet({ outlet: 'modal', parentView: 'application' @@ -26463,18 +26362,11 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' ``` Alternatively, you can pass the `outlet` name directly as a string. Example: - ```app/routes/application.js - import Ember from 'ember'; - export default App.Route.extend({ - actions: { - showModal(evt) { - // ... - }, - hideModal(evt) { - this.disconnectOutlet('modal'); - } - } - }); + ```javascript + hideModal: function(evt) { + this.disconnectOutlet('modal'); + } + ``` @method disconnectOutlet @param {Object|String} options the options hash or outlet name @since 1.0.0 @@ -26618,7 +26510,7 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' var template = owner.lookup('template:' + templateName); var parent = undefined; - if (into && (parent = parentRoute(route)) && into === parent.routeName) { + if (into && (parent = parentRoute(route)) && into === parentRoute(route).routeName) { into = undefined; } @@ -28200,12 +28092,6 @@ enifed('ember-routing/system/router', ['exports', 'ember-utils', 'ember-console' _emberMetal.set(target.outlets, renderOptions.outlet, myState); } else { if (renderOptions.into) { - _emberMetal.deprecate('Rendering into a {{render}} helper that resolves to an {{outlet}} is deprecated.', false, { - id: 'ember-routing.top-level-render-helper', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_rendering-into-a-render-helper-that-resolves-to-an-outlet' - }); - // Megahax time. Post-3.0-breaking-changes, we will just assert // right here that the user tried to target a nonexistent // thing. But for now we still need to support the `render` @@ -28451,7 +28337,11 @@ enifed('ember-routing/utils', ['exports', 'ember-utils', 'ember-metal'], functio */ function normalizeControllerQueryParams(queryParams) { - var qpMap = {}; + if (queryParams._qpMap) { + return queryParams._qpMap; + } + + var qpMap = queryParams._qpMap = {}; for (var i = 0; i < queryParams.length; ++i) { accumulateQueryParamDescriptors(queryParams[i], qpMap); @@ -31152,6 +31042,8 @@ enifed('ember-runtime/mixins/action_handler', ['exports', 'ember-metal'], functi args[_key - 1] = arguments[_key]; } + var target = undefined; + if (this.actions && this.actions[actionName]) { var shouldBubble = this.actions[actionName].apply(this, args) === true; if (!shouldBubble) { @@ -31159,10 +31051,11 @@ enifed('ember-runtime/mixins/action_handler', ['exports', 'ember-metal'], functi } } - var target = _emberMetal.get(this, 'target'); - if (target) { + if (target = _emberMetal.get(this, 'target')) { + var _target; + _emberMetal.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); } }, @@ -31583,7 +31476,7 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-utils', 'ember-metal', ' /** This returns the objects at the specified indexes, using `objectAt`. ```javascript - let arr = ['a', 'b', 'c', 'd']; + let arr = ['a', 'b', 'c', 'd']; arr.objectsAt([0, 1, 2]); // ['a', 'b', 'c'] arr.objectsAt([2, 3, 4]); // ['c', 'd', undefined] ``` @@ -32523,8 +32416,7 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-utils', 'ember-meta for (var idx = 0; idx < len && !found; idx++) { next = this.nextObject(idx, last, context); - found = callback.call(target, next, idx, this); - if (found) { + if (found = callback.call(target, next, idx, this)) { ret = next; } @@ -35317,7 +35209,7 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met // using ember-metal/lib/main here to ensure that ember-debug is setup // if present - var _Mixin$create, _ClassMixinProps; + var _Mixin$create; var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['.'], ['.']); @@ -35576,7 +35468,7 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met CoreObject.__super__ = null; - var ClassMixinProps = (_ClassMixinProps = { + var ClassMixinProps = { ClassMixin: _emberMetal.REQUIRED, @@ -35584,95 +35476,310 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met isClass: true, - isMethod: false - }, _ClassMixinProps[_emberUtils.NAME_KEY] = null, _ClassMixinProps[_emberUtils.GUID_KEY] = null, _ClassMixinProps.extend = function () { - var Class = makeCtor(); - var proto; - Class.ClassMixin = _emberMetal.Mixin.create(this.ClassMixin); - Class.PrototypeMixin = _emberMetal.Mixin.create(this.PrototypeMixin); + isMethod: false, + /** + Creates a new subclass. + ```javascript + const Person = Ember.Object.extend({ + say(thing) { + alert(thing); + } + }); + ``` + This defines a new subclass of Ember.Object: `Person`. It contains one method: `say()`. + You can also create a subclass from any existing class by calling its `extend()` method. + For example, you might want to create a subclass of Ember's built-in `Ember.Component` class: + ```javascript + const PersonComponent = Ember.Component.extend({ + tagName: 'li', + classNameBindings: ['isAdministrator'] + }); + ``` + When defining a subclass, you can override methods but still access the + implementation of your parent class by calling the special `_super()` method: + ```javascript + const Person = Ember.Object.extend({ + say(thing) { + var name = this.get('name'); + alert(`${name} says: ${thing}`); + } + }); + const Soldier = Person.extend({ + say(thing) { + this._super(`${thing}, sir!`); + }, + march(numberOfHours) { + alert(`${this.get('name')} marches for ${numberOfHours} hours.`); + } + }); + let yehuda = Soldier.create({ + name: "Yehuda Katz" + }); + yehuda.say("Yes"); // alerts "Yehuda Katz says: Yes, sir!" + ``` + The `create()` on line #17 creates an *instance* of the `Soldier` class. + The `extend()` on line #8 creates a *subclass* of `Person`. Any instance + of the `Person` class will *not* have the `march()` method. + You can also pass `Mixin` classes to add additional properties to the subclass. + ```javascript + const Person = Ember.Object.extend({ + say(thing) { + alert(`${this.get('name')} says: ${thing}`); + } + }); + const SingingMixin = Mixin.create({ + sing(thing){ + alert(`${this.get('name')} sings: la la la ${thing}`); + } + }); + const BroadwayStar = Person.extend(SingingMixin, { + dance() { + alert(`${this.get('name')} dances: tap tap tap tap `); + } + }); + ``` + The `BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`. + @method extend + @static + @param {Mixin} [mixins]* One or more Mixin classes + @param {Object} [arguments]* Object containing values to use within the new class + @public + */ + extend: function () { + var Class = makeCtor(); + var proto; + Class.ClassMixin = _emberMetal.Mixin.create(this.ClassMixin); + Class.PrototypeMixin = _emberMetal.Mixin.create(this.PrototypeMixin); - Class.ClassMixin.ownerConstructor = Class; - Class.PrototypeMixin.ownerConstructor = Class; + Class.ClassMixin.ownerConstructor = Class; + Class.PrototypeMixin.ownerConstructor = Class; - reopen.apply(Class.PrototypeMixin, arguments); + reopen.apply(Class.PrototypeMixin, arguments); - Class.superclass = this; - Class.__super__ = this.prototype; + Class.superclass = this; + Class.__super__ = this.prototype; - proto = Class.prototype = Object.create(this.prototype); - proto.constructor = Class; - _emberUtils.generateGuid(proto); - _emberMetal.meta(proto).proto = proto; // this will disable observers on prototype + proto = Class.prototype = Object.create(this.prototype); + proto.constructor = Class; + _emberUtils.generateGuid(proto); + _emberMetal.meta(proto).proto = proto; // this will disable observers on prototype - Class.ClassMixin.apply(Class); - return Class; - }, _ClassMixinProps.create = function () { - var C = this; + Class.ClassMixin.apply(Class); + return Class; + }, - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } + /** + Creates an instance of a class. Accepts either no arguments, or an object + containing values to initialize the newly instantiated object with. + ```javascript + const Person = Ember.Object.extend({ + helloWorld() { + alert(`Hi, my name is ${this.get('name')}`); + } + }); + let tom = Person.create({ + name: 'Tom Dale' + }); + tom.helloWorld(); // alerts "Hi, my name is Tom Dale". + ``` + `create` will call the `init` function if defined during + `Ember.AnyObject.extend` + If no arguments are passed to `create`, it will not set values to the new + instance during initialization: + ```javascript + let noName = Person.create(); + noName.helloWorld(); // alerts undefined + ``` + NOTE: For performance reasons, you cannot declare methods or computed + properties during `create`. You should instead declare methods and computed + properties when using `extend`. + @method create + @static + @param [arguments]* + @public + */ + create: function () { + var C = this; - if (args.length > 0) { - this._initProperties(args); - } - return new C(); - }, _ClassMixinProps.reopen = function () { - this.willReopen(); - reopen.apply(this.PrototypeMixin, arguments); - return this; - }, _ClassMixinProps.reopenClass = function () { - reopen.apply(this.ClassMixin, arguments); - applyMixin(this, arguments, false); - return this; - }, _ClassMixinProps.detect = function (obj) { - if ('function' !== typeof obj) { - return false; - } - while (obj) { - if (obj === this) { - return true; + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; } - obj = obj.superclass; - } - return false; - }, _ClassMixinProps.detectInstance = function (obj) { - return obj instanceof this; - }, _ClassMixinProps.metaForProperty = function (key) { - var proto = this.proto(); - var possibleDesc = proto[key]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - _emberMetal.assert('metaForProperty() could not find a computed property ' + 'with key \'' + key + '\'.', !!desc && desc instanceof _emberMetal.ComputedProperty); - return desc._meta || {}; - }, _ClassMixinProps._computedProperties = _emberMetal.computed(function () { - hasCachedComputedProperties = true; - var proto = this.proto(); - var property; - var properties = []; + if (args.length > 0) { + this._initProperties(args); + } + return new C(); + }, + + /** + Augments a constructor's prototype with additional + properties and functions: + ```javascript + const MyObject = Ember.Object.extend({ + name: 'an object' + }); + o = MyObject.create(); + o.get('name'); // 'an object' + MyObject.reopen({ + say(msg){ + console.log(msg); + } + }) + o2 = MyObject.create(); + o2.say("hello"); // logs "hello" + o.say("goodbye"); // logs "goodbye" + ``` + To add functions and properties to the constructor itself, + see `reopenClass` + @method reopen + @public + */ + reopen: function () { + this.willReopen(); + reopen.apply(this.PrototypeMixin, arguments); + return this; + }, - for (var name in proto) { - property = proto[name]; + /** + Augments a constructor's own properties and functions: + ```javascript + const MyObject = Ember.Object.extend({ + name: 'an object' + }); + MyObject.reopenClass({ + canBuild: false + }); + MyObject.canBuild; // false + o = MyObject.create(); + ``` + In other words, this creates static properties and functions for the class. + These are only available on the class and not on any instance of that class. + ```javascript + const Person = Ember.Object.extend({ + name: "", + sayHello() { + alert("Hello. My name is " + this.get('name')); + } + }); + Person.reopenClass({ + species: "Homo sapiens", + createPerson(newPersonsName){ + return Person.create({ + name:newPersonsName + }); + } + }); + let tom = Person.create({ + name: "Tom Dale" + }); + let yehuda = Person.createPerson("Yehuda Katz"); + tom.sayHello(); // "Hello. My name is Tom Dale" + yehuda.sayHello(); // "Hello. My name is Yehuda Katz" + alert(Person.species); // "Homo sapiens" + ``` + Note that `species` and `createPerson` are *not* valid on the `tom` and `yehuda` + variables. They are only valid on `Person`. + To add functions and properties to instances of + a constructor by extending the constructor's prototype + see `reopen` + @method reopenClass + @public + */ + reopenClass: function () { + reopen.apply(this.ClassMixin, arguments); + applyMixin(this, arguments, false); + return this; + }, - if (property && property.isDescriptor) { - properties.push({ - name: name, - meta: property._meta - }); + detect: function (obj) { + if ('function' !== typeof obj) { + return false; } - } - return properties; - }).readOnly(), _ClassMixinProps.eachComputedProperty = function (callback, binding) { - var property; - var empty = {}; + while (obj) { + if (obj === this) { + return true; + } + obj = obj.superclass; + } + return false; + }, - var properties = _emberMetal.get(this, '_computedProperties'); + detectInstance: function (obj) { + return obj instanceof this; + }, - for (var i = 0; i < properties.length; i++) { - property = properties[i]; - callback.call(binding || this, property.name, property.meta || empty); + /** + In some cases, you may want to annotate computed properties with additional + metadata about how they function or what values they operate on. For + example, computed property functions may close over variables that are then + no longer available for introspection. + You can pass a hash of these values to a computed property like this: + ```javascript + person: Ember.computed(function() { + var personId = this.get('personId'); + return Person.create({ id: personId }); + }).meta({ type: Person }) + ``` + Once you've done this, you can retrieve the values saved to the computed + property from your class like this: + ```javascript + MyClass.metaForProperty('person'); + ``` + This will return the original hash that was passed to `meta()`. + @static + @method metaForProperty + @param key {String} property name + @private + */ + metaForProperty: function (key) { + var proto = this.proto(); + var possibleDesc = proto[key]; + var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; + + _emberMetal.assert('metaForProperty() could not find a computed property ' + 'with key \'' + key + '\'.', !!desc && desc instanceof _emberMetal.ComputedProperty); + return desc._meta || {}; + }, + + _computedProperties: _emberMetal.computed(function () { + hasCachedComputedProperties = true; + var proto = this.proto(); + var property; + var properties = []; + + for (var name in proto) { + property = proto[name]; + + if (property && property.isDescriptor) { + properties.push({ + name: name, + meta: property._meta + }); + } + } + return properties; + }).readOnly(), + + /** + Iterate over each computed property for the class, passing its name + and any associated metadata (see `metaForProperty`) to the callback. + @static + @method eachComputedProperty + @param {Function} callback + @param {Object} binding + @private + */ + eachComputedProperty: function (callback, binding) { + var property; + var empty = {}; + + var properties = _emberMetal.get(this, '_computedProperties'); + + for (var i = 0; i < properties.length; i++) { + property = properties[i]; + callback.call(binding || this, property.name, property.meta || empty); + } } - }, _ClassMixinProps); + }; function injectedPropertyAssertion() { _emberMetal.assert('Injected properties are invalid', _emberRuntimeInject.validatePropertyInjections(this)); @@ -35930,210 +36037,6 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met @return {String} string representation @public */ - -/** - Creates a new subclass. - ```javascript - const Person = Ember.Object.extend({ - say(thing) { - alert(thing); - } - }); - ``` - This defines a new subclass of Ember.Object: `Person`. It contains one method: `say()`. - You can also create a subclass from any existing class by calling its `extend()` method. - For example, you might want to create a subclass of Ember's built-in `Ember.Component` class: - ```javascript - const PersonComponent = Ember.Component.extend({ - tagName: 'li', - classNameBindings: ['isAdministrator'] - }); - ``` - When defining a subclass, you can override methods but still access the - implementation of your parent class by calling the special `_super()` method: - ```javascript - const Person = Ember.Object.extend({ - say(thing) { - var name = this.get('name'); - alert(`${name} says: ${thing}`); - } - }); - const Soldier = Person.extend({ - say(thing) { - this._super(`${thing}, sir!`); - }, - march(numberOfHours) { - alert(`${this.get('name')} marches for ${numberOfHours} hours.`); - } - }); - let yehuda = Soldier.create({ - name: "Yehuda Katz" - }); - yehuda.say("Yes"); // alerts "Yehuda Katz says: Yes, sir!" - ``` - The `create()` on line #17 creates an *instance* of the `Soldier` class. - The `extend()` on line #8 creates a *subclass* of `Person`. Any instance - of the `Person` class will *not* have the `march()` method. - You can also pass `Mixin` classes to add additional properties to the subclass. - ```javascript - const Person = Ember.Object.extend({ - say(thing) { - alert(`${this.get('name')} says: ${thing}`); - } - }); - const SingingMixin = Mixin.create({ - sing(thing){ - alert(`${this.get('name')} sings: la la la ${thing}`); - } - }); - const BroadwayStar = Person.extend(SingingMixin, { - dance() { - alert(`${this.get('name')} dances: tap tap tap tap `); - } - }); - ``` - The `BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`. - @method extend - @static - @param {Mixin} [mixins]* One or more Mixin classes - @param {Object} [arguments]* Object containing values to use within the new class - @public -*/ - -/** - Creates an instance of a class. Accepts either no arguments, or an object - containing values to initialize the newly instantiated object with. - ```javascript - const Person = Ember.Object.extend({ - helloWorld() { - alert(`Hi, my name is ${this.get('name')}`); - } - }); - let tom = Person.create({ - name: 'Tom Dale' - }); - tom.helloWorld(); // alerts "Hi, my name is Tom Dale". - ``` - `create` will call the `init` function if defined during - `Ember.AnyObject.extend` - If no arguments are passed to `create`, it will not set values to the new - instance during initialization: - ```javascript - let noName = Person.create(); - noName.helloWorld(); // alerts undefined - ``` - NOTE: For performance reasons, you cannot declare methods or computed - properties during `create`. You should instead declare methods and computed - properties when using `extend`. - @method create - @static - @param [arguments]* - @public -*/ - -/** - Augments a constructor's prototype with additional - properties and functions: - ```javascript - const MyObject = Ember.Object.extend({ - name: 'an object' - }); - o = MyObject.create(); - o.get('name'); // 'an object' - MyObject.reopen({ - say(msg){ - console.log(msg); - } - }) - o2 = MyObject.create(); - o2.say("hello"); // logs "hello" - o.say("goodbye"); // logs "goodbye" - ``` - To add functions and properties to the constructor itself, - see `reopenClass` - @method reopen - @public -*/ - -/** - Augments a constructor's own properties and functions: - ```javascript - const MyObject = Ember.Object.extend({ - name: 'an object' - }); - MyObject.reopenClass({ - canBuild: false - }); - MyObject.canBuild; // false - o = MyObject.create(); - ``` - In other words, this creates static properties and functions for the class. - These are only available on the class and not on any instance of that class. - ```javascript - const Person = Ember.Object.extend({ - name: "", - sayHello() { - alert("Hello. My name is " + this.get('name')); - } - }); - Person.reopenClass({ - species: "Homo sapiens", - createPerson(newPersonsName){ - return Person.create({ - name:newPersonsName - }); - } - }); - let tom = Person.create({ - name: "Tom Dale" - }); - let yehuda = Person.createPerson("Yehuda Katz"); - tom.sayHello(); // "Hello. My name is Tom Dale" - yehuda.sayHello(); // "Hello. My name is Yehuda Katz" - alert(Person.species); // "Homo sapiens" - ``` - Note that `species` and `createPerson` are *not* valid on the `tom` and `yehuda` - variables. They are only valid on `Person`. - To add functions and properties to instances of - a constructor by extending the constructor's prototype - see `reopen` - @method reopenClass - @public -*/ - -/** - In some cases, you may want to annotate computed properties with additional - metadata about how they function or what values they operate on. For - example, computed property functions may close over variables that are then - no longer available for introspection. - You can pass a hash of these values to a computed property like this: - ```javascript - person: Ember.computed(function() { - var personId = this.get('personId'); - return Person.create({ id: personId }); - }).meta({ type: Person }) - ``` - Once you've done this, you can retrieve the values saved to the computed - property from your class like this: - ```javascript - MyClass.metaForProperty('person'); - ``` - This will return the original hash that was passed to `meta()`. - @static - @method metaForProperty - @param key {String} property name - @private -*/ - -/** - Iterate over each computed property for the class, passing its name - and any associated metadata (see `metaForProperty`) to the callback. - @static - @method eachComputedProperty - @param {Function} callback - @param {Object} binding - @private -*/ enifed('ember-runtime/system/each_proxy', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/mixins/array'], function (exports, _emberUtils, _emberMetal, _emberRuntimeMixinsArray) { 'use strict'; @@ -36386,7 +36289,7 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal } findNamespaces(); - return this[_emberUtils.NAME_KEY]; + return this[_emberMetal.NAME_KEY]; }, nameClasses: function () { @@ -36446,10 +36349,10 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal paths[idx] = key; // If we have found an unprocessed class - if (obj && obj.toString === classToString && !obj[_emberUtils.NAME_KEY]) { + if (obj && obj.toString === classToString && !obj[_emberMetal.NAME_KEY]) { // Replace the class' `toString` with the dot-separated path // and set its `NAME_KEY` - obj[_emberUtils.NAME_KEY] = paths.join('.'); + obj[_emberMetal.NAME_KEY] = paths.join('.'); // Support nested namespaces } else if (obj && obj.isNamespace) { @@ -36495,7 +36398,7 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal } var obj = tryIsNamespace(lookup, key); if (obj) { - obj[_emberUtils.NAME_KEY] = key; + obj[_emberMetal.NAME_KEY] = key; } } } @@ -36503,41 +36406,35 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal function superClassString(mixin) { var superclass = mixin.superclass; if (superclass) { - if (superclass[_emberUtils.NAME_KEY]) { - return superclass[_emberUtils.NAME_KEY]; + if (superclass[_emberMetal.NAME_KEY]) { + return superclass[_emberMetal.NAME_KEY]; } return superClassString(superclass); } } - function calculateToString(target) { - var str = undefined; - - if (!searchDisabled) { + function classToString() { + if (!searchDisabled && !this[_emberMetal.NAME_KEY]) { processAllNamespaces(); - // can also be set by processAllNamespaces - str = target[_emberUtils.NAME_KEY]; + } + + var ret = undefined; + + if (this[_emberMetal.NAME_KEY]) { + ret = this[_emberMetal.NAME_KEY]; + } else if (this._toString) { + ret = this._toString; + } else { + var str = superClassString(this); if (str) { - return str; + ret = '(subclass of ' + str + ')'; } else { - str = superClassString(target); - str = str ? '(subclass of ' + str + ')' : str; + ret = '(unknown mixin)'; } - } - if (str) { - return str; - } else { - return '(unknown mixin)'; - } - } - - function classToString() { - var name = this[_emberUtils.NAME_KEY]; - if (name) { - return name; + this.toString = makeToString(ret); } - return this[_emberUtils.NAME_KEY] = calculateToString(this); + return ret; } function processAllNamespaces() { @@ -36562,6 +36459,12 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal } } + function makeToString(ret) { + return function () { + return ret; + }; + } + _emberMetal.Mixin.prototype.toString = classToString; // ES6TODO: altering imported objects. SBB. exports.default = Namespace; @@ -38283,6 +38186,7 @@ enifed('ember-testing/helpers/wait', ['exports', 'ember-testing/test/waiters', ' @param {Object} value The value to be returned. @return {RSVP.Promise} @public + @since 1.0.0 */ function wait(app, value) { @@ -38356,9 +38260,7 @@ enifed('ember-testing/initializers', ['exports', 'ember-runtime'], function (exp } }); }); -enifed('ember-testing/setup_for_testing', ['exports', 'ember-metal', 'ember-views', 'ember-testing/test/adapter', 'ember-testing/test/pending_requests', 'ember-testing/adapters/adapter', 'ember-testing/adapters/qunit'], function (exports, _emberMetal, _emberViews, _emberTestingTestAdapter, _emberTestingTestPending_requests, _emberTestingAdaptersAdapter, _emberTestingAdaptersQunit) { - /* global self */ - +enifed('ember-testing/setup_for_testing', ['exports', 'ember-metal', 'ember-views', 'ember-testing/test/adapter', 'ember-testing/test/pending_requests', 'ember-testing/adapters/qunit'], function (exports, _emberMetal, _emberViews, _emberTestingTestAdapter, _emberTestingTestPending_requests, _emberTestingAdaptersQunit) { 'use strict'; exports.default = setupForTesting; @@ -38382,7 +38284,7 @@ enifed('ember-testing/setup_for_testing', ['exports', 'ember-metal', 'ember-view var adapter = _emberTestingTestAdapter.getAdapter(); // if adapter is not manually set default to QUnit if (!adapter) { - _emberTestingTestAdapter.setAdapter(typeof self.QUnit === 'undefined' ? new _emberTestingAdaptersAdapter.default() : new _emberTestingAdaptersQunit.default()); + _emberTestingTestAdapter.setAdapter(new _emberTestingAdaptersQunit.default()); } _emberViews.jQuery(document).off('ajaxSend', _emberTestingTestPending_requests.incrementPendingRequests); @@ -39324,7 +39226,7 @@ enifed('ember-utils/guid', ['exports', 'ember-utils/intern'], function (exports, } } }); -enifed('ember-utils/index', ['exports', 'ember-utils/symbol', 'ember-utils/owner', 'ember-utils/assign', 'ember-utils/empty-object', 'ember-utils/dictionary', 'ember-utils/guid', 'ember-utils/intern', 'ember-utils/super', 'ember-utils/inspect', 'ember-utils/lookup-descriptor', 'ember-utils/invoke', 'ember-utils/make-array', 'ember-utils/apply-str', 'ember-utils/name', 'ember-utils/to-string'], function (exports, _emberUtilsSymbol, _emberUtilsOwner, _emberUtilsAssign, _emberUtilsEmptyObject, _emberUtilsDictionary, _emberUtilsGuid, _emberUtilsIntern, _emberUtilsSuper, _emberUtilsInspect, _emberUtilsLookupDescriptor, _emberUtilsInvoke, _emberUtilsMakeArray, _emberUtilsApplyStr, _emberUtilsName, _emberUtilsToString) { +enifed('ember-utils/index', ['exports', 'ember-utils/symbol', 'ember-utils/owner', 'ember-utils/assign', 'ember-utils/empty-object', 'ember-utils/dictionary', 'ember-utils/guid', 'ember-utils/intern', 'ember-utils/super', 'ember-utils/inspect', 'ember-utils/lookup-descriptor', 'ember-utils/invoke', 'ember-utils/make-array', 'ember-utils/apply-str', 'ember-utils/to-string'], function (exports, _emberUtilsSymbol, _emberUtilsOwner, _emberUtilsAssign, _emberUtilsEmptyObject, _emberUtilsDictionary, _emberUtilsGuid, _emberUtilsIntern, _emberUtilsSuper, _emberUtilsInspect, _emberUtilsLookupDescriptor, _emberUtilsInvoke, _emberUtilsMakeArray, _emberUtilsApplyStr, _emberUtilsToString) { /* This package will be eagerly parsed and should have no dependencies on external packages. @@ -39360,7 +39262,6 @@ enifed('ember-utils/index', ['exports', 'ember-utils/symbol', 'ember-utils/owner exports.tryInvoke = _emberUtilsInvoke.tryInvoke; exports.makeArray = _emberUtilsMakeArray.default; exports.applyStr = _emberUtilsApplyStr.default; - exports.NAME_KEY = _emberUtilsName.default; exports.toString = _emberUtilsToString.default; }); enifed('ember-utils/inspect', ['exports'], function (exports) { @@ -39593,11 +39494,6 @@ enifed("ember-utils/make-array", ["exports"], function (exports) { return Array.isArray(obj) ? obj : [obj]; } }); -enifed('ember-utils/name', ['exports', 'ember-utils/symbol'], function (exports, _emberUtilsSymbol) { - 'use strict'; - - exports.default = _emberUtilsSymbol.default('NAME_KEY'); -}); enifed('ember-utils/owner', ['exports', 'ember-utils/symbol'], function (exports, _emberUtilsSymbol) { /** @module ember @@ -39756,12 +39652,12 @@ enifed('ember-utils/symbol', ['exports', 'ember-utils/guid', 'ember-utils/intern // TODO: Investigate using platform symbols, but we do not // want to require non-enumerability for this API, which // would introduce a large cost. - - return _emberUtilsIntern.default(debugName + ' [id=' + _emberUtilsGuid.GUID_KEY + Math.floor(Math.random() * new Date()) + ']'); + var id = _emberUtilsGuid.GUID_KEY + Math.floor(Math.random() * new Date()); + return _emberUtilsIntern.default('__' + debugName + '__ [id=' + id + ']'); } }); -enifed('ember-utils/to-string', ['exports'], function (exports) { - 'use strict'; +enifed("ember-utils/to-string", ["exports"], function (exports) { + "use strict"; exports.default = toString; var objectToString = Object.prototype.toString; @@ -39772,7 +39668,7 @@ enifed('ember-utils/to-string', ['exports'], function (exports) { */ function toString(obj) { - if (obj && typeof obj.toString === 'function') { + if (obj && obj.toString) { return obj.toString(); } else { return objectToString.call(obj); @@ -39970,6 +39866,7 @@ enifed('ember-views/mixins/action_support', ['exports', 'ember-utils', 'ember-me args[_key2 - 1] = arguments[_key2]; } + var target = undefined; var action = this.actions && this.actions[actionName]; if (action) { @@ -39979,10 +39876,13 @@ enifed('ember-views/mixins/action_support', ['exports', 'ember-utils', 'ember-me } } - var target = _emberMetal.get(this, 'target'); + target = _emberMetal.get(this, 'target'); + if (target) { + var _target; + _emberMetal.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 { _emberMetal.assert(_emberUtils.inspect(this) + ' had no action handler for: ' + actionName, action); } @@ -40051,7 +39951,10 @@ enifed('ember-views/mixins/class_names_support', ['exports', 'ember-metal'], fun this._super.apply(this, arguments); _emberMetal.assert('Only arrays are allowed for \'classNameBindings\'', Array.isArray(this.classNameBindings)); + this.classNameBindings = this.classNameBindings.slice(); + _emberMetal.assert('Only arrays of static class strings are allowed for \'classNames\'. For dynamic classes, use \'classNameBindings\'.', Array.isArray(this.classNames)); + this.classNames = this.classNames.slice(); }, /** @@ -40495,7 +40398,9 @@ enifed('ember-views/mixins/view_support', ['exports', 'ember-utils', 'ember-meta } }), _Mixin$create.$ = function (sel) { _emberMetal.assert('You cannot access this.$() on a component with `tagName: \'\'` specified.', this.tagName !== ''); - return this._currentState.$(this, sel); + if (this.element) { + return sel ? _emberViewsSystemJquery.default(sel, this.element) : _emberViewsSystemJquery.default(this.element); + } }, _Mixin$create.appendTo = function (selector) { var env = this._environment || _emberEnvironment.environment; var target = undefined; @@ -40530,12 +40435,6 @@ enifed('ember-views/mixins/view_support', ['exports', 'ember-utils', 'ember-meta }, _Mixin$create.renderToElement = function (tagName) { tagName = tagName || 'body'; - _emberMetal.deprecate('Using the `renderToElement` is deprecated in favor of `appendTo`. Called in ' + this.toString(), false, { - id: 'ember-views.render-to-element', - until: '2.12.0', - url: 'http://emberjs.com/deprecations/v2.x#toc_code-rendertoelement-code' - }); - var element = this.renderer.createElement(tagName); this.renderer.appendTo(this, element); @@ -40687,7 +40586,6 @@ enifed('ember-views/mixins/view_support', ['exports', 'ember-utils', 'ember-meta @method renderToElement @param {String} tagName The tag of the element to create and render into. Defaults to "body". @return {HTMLBodyElement} element - @deprecated Use appendTo instead. @private */ @@ -41628,10 +41526,6 @@ enifed('ember-views/views/states/default', ['exports', 'ember-metal'], function throw new _emberMetal.Error('You can\'t use appendChild outside of the rendering process'); }, - $: function () { - return undefined; - }, - // Handle events from `Ember.EventDispatcher` handleEvent: function () { return true; // continue event propagation @@ -41663,16 +41557,12 @@ enifed('ember-views/views/states/destroying', ['exports', 'ember-utils', 'ember- exports.default = destroying; }); -enifed('ember-views/views/states/has_element', ['exports', 'ember-utils', 'ember-views/views/states/default', 'ember-metal', 'ember-views/system/jquery'], function (exports, _emberUtils, _emberViewsViewsStatesDefault, _emberMetal, _emberViewsSystemJquery) { +enifed('ember-views/views/states/has_element', ['exports', 'ember-utils', 'ember-views/views/states/default', 'ember-metal'], function (exports, _emberUtils, _emberViewsViewsStatesDefault, _emberMetal) { 'use strict'; var hasElement = Object.create(_emberViewsViewsStatesDefault.default); _emberUtils.assign(hasElement, { - $: function (view, sel) { - var elem = view.element; - return sel ? _emberViewsSystemJquery.default(sel, elem) : _emberViewsSystemJquery.default(elem); - }, rerender: function (view) { view.renderer.rerender(view); @@ -42235,7 +42125,7 @@ enifed("ember-views/views/view", ["exports"], function (exports) { enifed("ember/features", ["exports"], function (exports) { "use strict"; - exports.default = { "features-stripped-test": false, "ember-libraries-isregistered": false, "ember-runtime-computed-uniq-by": true, "ember-improved-instrumentation": false, "ember-runtime-enumerable-includes": true, "ember-string-ishtmlsafe": true, "ember-testing-check-waiters": true, "ember-metal-weakmap": false, "ember-glimmer-allow-backtracking-rerender": false, "ember-testing-resume-test": false, "mandatory-setter": true, "ember-glimmer-detect-backtracking-rerender": true }; + exports.default = { "features-stripped-test": false, "ember-libraries-isregistered": false, "ember-runtime-computed-uniq-by": true, "ember-improved-instrumentation": false, "ember-runtime-enumerable-includes": true, "ember-string-ishtmlsafe": true, "ember-testing-check-waiters": true, "ember-metal-weakmap": false, "ember-glimmer-allow-backtracking-rerender": true, "ember-testing-resume-test": false, "ember-glimmer-detect-backtracking-rerender": true, "mandatory-setter": true }; }); enifed('ember/index', ['exports', 'require', 'ember-environment', 'ember-utils', 'container', 'ember-metal', 'backburner', 'ember-console', 'ember-runtime', 'ember-glimmer', 'ember/version', 'ember-views', 'ember-routing', 'ember-application', 'ember-extension-support'], function (exports, _require, _emberEnvironment, _emberUtils, _container, _emberMetal, _backburner, _emberConsole, _emberRuntime, _emberGlimmer, _emberVersion, _emberViews, _emberRouting, _emberApplication, _emberExtensionSupport) { 'use strict'; @@ -42341,7 +42231,7 @@ enifed('ember/index', ['exports', 'require', 'ember-environment', 'ember-utils', _emberMetal.default.getProperties = _emberMetal.getProperties; _emberMetal.default.setProperties = _emberMetal.setProperties; _emberMetal.default.expandProperties = _emberMetal.expandProperties; - _emberMetal.default.NAME_KEY = _emberUtils.NAME_KEY; + _emberMetal.default.NAME_KEY = _emberMetal.NAME_KEY; _emberMetal.default.addObserver = _emberMetal.addObserver; _emberMetal.default.observersFor = _emberMetal.observersFor; _emberMetal.default.removeObserver = _emberMetal.removeObserver; @@ -42770,7 +42660,7 @@ enifed('ember/index', ['exports', 'require', 'ember-environment', 'ember-utils', enifed("ember/version", ["exports"], function (exports) { "use strict"; - exports.default = "2.11.0-beta.2"; + exports.default = "2.10.2-with-backtracking"; }); enifed('internal-test-helpers/apply-mixins', ['exports', 'ember-utils'], function (exports, _emberUtils) { 'use strict'; @@ -43950,7 +43840,7 @@ enifed('glimmer-node/index', ['exports', 'glimmer-node/lib/node-dom-helper'], fu exports.NodeDOMTreeConstruction = _glimmerNodeLibNodeDomHelper.default; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItbm9kZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7VUFBb0IsdUJBQXVCLGdDQUFsQyxPQUFPIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgZGVmYXVsdCBhcyBOb2RlRE9NVHJlZUNvbnN0cnVjdGlvbiB9IGZyb20gJy4vbGliL25vZGUtZG9tLWhlbHBlcic7XG4iXX0= + enifed('glimmer-node/lib/node-dom-helper', ['exports', 'glimmer-runtime'], function (exports, _glimmerRuntime) { 'use strict'; @@ -43991,7 +43881,7 @@ enifed('glimmer-node/lib/node-dom-helper', ['exports', 'glimmer-runtime'], funct exports.default = NodeDOMTreeConstruction; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItbm9kZS9saWIvbm9kZS1kb20taGVscGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQUlBLHVCQUFBOzhCQUFBLHVCQUFBOztBQUVFLGlCQUZGLHVCQUFBLENBRWMsR0FBb0IsRUFBQTtBQUM5Qiw0Q0FBTSxHQUFHLENB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mVmZXJlbmNlKTtcblxuICAgIGxldCBmaXJzdCA9IHByZXYgPyBwcmV2Lm5leHRTaWJsaW5nIDogcGFyZW50LmZpcnN0Q2hpbGQ7XG4gICAgbGV0IGxhc3QgPSByZWZlcmVuY2UgPyByZWZlcmVuY2UucHJldmlvdXNTaWJsaW5nIDogcGFyZW50Lmxhc3RDaGlsZDtcblxuICAgIHJldHVybiBuZXcgQ29uY3JldGVCb3VuZHMocGFyZW50LCBmaXJzdCwgbGFzdCk7XG4gIH1cblxuICAvLyBvdmVycmlkZSB0byBhdm9pZCBTVkcgZGV0ZWN0aW9uL3dvcmsgd2hlbiBpbiBub2RlICh0aGlzIGlzIG5vdCBuZWVkZWQgaW4gU1NSKVxuICBjcmVhdGVFbGVtZW50KHRhZzogc3RyaW5nKSB7XG4gICAgcmV0dXJuIHRoaXMuZG9jdW1lbnQuY3JlYXRlRWxlbWVudCh0YWcpO1xuICB9XG5cbiAgLy8gb3ZlcnJpZGUgdG8gYXZvaWQgbmFtZXNwYWNlIHNoZW5hbmlnYW5zIHdoZW4gaW4gbm9kZSAodGhpcyBpcyBub3QgbmVlZGVkIGluIFNTUilcbiAgc2V0QXR0cmlidXRlKGVsZW1lbnQ6IEVsZW1lbnQsIG5hbWU6IHN0cmluZywgdmFsdWU6IHN0cmluZykge1xuICAgIGVsZW1lbnQuc2V0QXR0cmlidXRlKG5hbWUsIHZhbHVlKTtcbiAgfVxufVxuIl19 + enifed('glimmer-reference/index', ['exports', 'glimmer-reference/lib/reference', 'glimmer-reference/lib/const', 'glimmer-reference/lib/validators', 'glimmer-reference/lib/utils', 'glimmer-reference/lib/iterable'], function (exports, _glimmerReferenceLibReference, _glimmerReferenceLibConst, _glimmerReferenceLibValidators, _glimmerReferenceLibUtils, _glimmerReferenceLibIterable) { 'use strict'; @@ -44015,7 +43905,7 @@ enifed('glimmer-reference/index', ['exports', 'glimmer-reference/lib/reference', exports.IteratorSynchronizer = _glimmerReferenceLibIterable.IteratorSynchronizer; exports.I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V4cG9ydCAqIGZyb20gJy4vbGliL3ZhbGlkYXRvcnMnO1xuXG5leHBvcnQge1xuICBWZXJzaW9uZWRSZWZlcmVuY2UgYXMgUmVmZXJlbmNlLFxuICBWZXJzaW9uZWRQYXRoUmVmZXJlbmNlIGFzIFBhdGhSZWZlcmVuY2Vcbn0gZnJvbSAnLi9saWIvdmFsaWRhdG9ycyc7XG5cbmV4cG9ydCB7XG4gIHJlZmVyZW5jZUZyb21QYXJ0c1xufSBmcm9tICcuL2xpYi91dGlscyc7XG5cbmV4cG9ydCB7XG4gIEl0ZXJhdGlvbkl0ZW0sXG4gIEl0ZXJhdG9yLFxuICBJdGVyYWJsZSxcbiAgT3BhcXVlSXRlcmF0b3IsXG4gIE9wYXF1ZUl0ZXJhYmxlLFxuICBBYnN0cmFjdEl0ZXJhdG9yLFxuICBBYnN0cmFjdEl0ZXJhYmxlLFxuICBJdGVyYXRpb25BcnRpZmFjdHMsXG4gIFJlZmVyZW5jZUl0ZXJhdG9yLFxuICBJdGVyYXRvclN5bmNocm9uaXplcixcbiAgSXRlcmF0b3JTeW5jaHJvbml6ZXJEZWxlZ2F0ZVxufSBmcm9tICcuL2xpYi9pdGVyYWJsZSc7XG4iXX0= + enifed('glimmer-reference/lib/const', ['exports', 'glimmer-reference/lib/validators'], function (exports, _glimmerReferenceLibValidators) { 'use strict'; @@ -44040,7 +43930,7 @@ enifed('glimmer-reference/lib/const', ['exports', 'glimmer-reference/lib/validat return reference.tag === _glimmerReferenceLibValidators.CONSTANT_TAG; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2xpYi9jb25zdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztRQUdBLGNBQUE7QUFHRSxpQkFIRixjQUFBLENBR3dCLEtBQVEsRUFBQTtBQUFSLGdCQUFBLENBQUEsS0FBSyxHQUFMLEtBQUssQ0FBRztBQUZ2QixnQkFBQSxDQUFBLEdBQUcsa0NBSkgsWUFBWSxBQUltQixDQUFDO1NBRUo7O0FBSHJDLHNCQUFBLFdBS0UsS0FBSyxHQUFBLGlCQUFBO0FBQVEsbUJBQU8sSUFBSSxDQUFDLEtBQUssQ0FBQztTQUFFOztlQUxuQyxjQUFBOzs7OztBQVFBLGFBQUEsT0FBQSxDQUF3QixTQUFxQyxFQUFBO0FBQzNELGVBQU8sU0FBUyxDQUFDLEdBQUcsb0NBWmIsWUFBWSxBQVlrQixDQUFDO0tBQ3ZDIiwiZmlsZSI6ImNvbnN0LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQ09OU1RBTlRfVEFHLCBWZXJzaW9uZWRSZWZlcmVuY2UsIFJldmlzaW9uVGFnIH0gZnJvbSAnLi92YWxpZGF0b3JzJztcbmltcG9ydCB7IE9wYXF1ZSB9IGZyb20gJ2dsaW1tZXItdXRpbCc7XG5cbmV4cG9ydCBjbGFzcyBDb25zdFJlZmVyZW5jZTxUPiBpbXBsZW1lbnRzIFZlcnNpb25lZFJlZmVyZW5jZTxUPiB7XG4gIHB1YmxpYyB0YWc6IFJldmlzaW9uVGFnID0gQ09OU1RBTlRfVEFHO1xuXG4gIGNvbnN0cnVjdG9yKHByb3RlY3RlZCBpbm5lcjogVCkgeyB9XG5cbiAgdmFsdWUoKTogVCB7IHJldHVybiB0aGlzLmlubmVyOyB9XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBpc0NvbnN0KHJlZmVyZW5jZTogVmVyc2lvbmVkUmVmZXJlbmNlPE9wYXF1ZT4pOiBib29sZWFuIHtcbiAgcmV0dXJuIHJlZmVyZW5jZS50YWcgPT09IENPTlNUQU5UX1RBRztcbn1cbiJdfQ== + enifed("glimmer-reference/lib/iterable", ["exports", "glimmer-util"], function (exports, _glimmerUtil) { "use strict"; @@ -44316,11 +44206,11 @@ enifed("glimmer-reference/lib/iterable", ["exports", "glimmer-util"], function ( exports.IteratorSynchronizer = IteratorS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nJlbnQpO1xuICAgIHRhcmdldC5pbnNlcnQobm9kZS5rZXksIG5vZGUudmFsdWUsIG5vZGUubWVtbywgY3VycmVudCA/IGN1cnJlbnQua2V5IDogbnVsbCk7XG4gIH1cblxuICBwcml2YXRlIHN0YXJ0UHJ1bmUoKTogUGhhc2Uge1xuICAgIHRoaXMuY3VycmVudCA9IHRoaXMuYXJ0aWZhY3RzLmhlYWQoKTtcbiAgICByZXR1cm4gUGhhc2UuUHJ1bmU7XG4gIH1cblxuICBwcml2YXRlIG5leHRQcnVuZSgpOiBQaGFzZSB7XG4gICAgbGV0IHsgYXJ0aWZhY3RzLCB0YXJnZXQsIGN1cnJlbnQgfSA9IHRoaXM7XG5cbiAgICBpZiAoY3VycmVudCA9PT0gbnVsbCkge1xuICAgICAgcmV0dXJuIFBoYXNlLkRvbmU7XG4gICAgfVxuXG4gICAgbGV0IG5vZGUgPSBjdXJyZW50O1xuICAgIHRoaXMuY3VycmVudCA9IGFydGlmYWN0cy5uZXh0Tm9kZShub2RlKTtcblxuICAgIGlmIChub2RlLnNob3VsZFJlbW92ZSgpKSB7XG4gICAgICBhcnRpZmFjdHMucmVtb3ZlKG5vZGUpO1xuICAgICAgdGFyZ2V0LmRlbGV0ZShub2RlLmtleSk7XG4gICAgfSBlbHNlIHtcbiAgICAgIG5vZGUucmVzZXQoKTtcbiAgICB9XG5cbiAgICByZXR1cm4gUGhhc2UuUHJ1bmU7XG4gIH1cblxuICBwcml2YXRlIG5leHREb25lKCkge1xuICAgIHRoaXMudGFyZ2V0LmRvbmUoKTtcbiAgfVxufVxuIl19 + enifed("glimmer-reference/lib/reference", ["exports"], function (exports) { "use strict"; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2xpYi9yZWZlcmVuY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJyZWZlcmVuY2UuanMiLCJzb3VyY2VzQ29udGVudCI6W119 + enifed("glimmer-reference/lib/utils", ["exports"], function (exports) { "use strict"; @@ -44334,7 +44224,7 @@ enifed("glimmer-reference/lib/utils", ["exports"], function (exports) { return reference; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2xpYi91dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUdBLGFBQUEsa0JBQUEsQ0FBbUMsSUFBb0MsRUFBRSxLQUFlLEVBQUE7QUFDdEYsWUFBSSxTQUFTLEdBQUcsSUFBSSxDQUFDO0FBRXJCLGFBQUssSUFBSSxDQUFDLEdBQUMsQ0FBQyxFQUFFLENBQUMsR0FBQyxLQUFLLENBQUMsTUFBTSxFQUFFLENBQUMsRUFBRSxFQUFFO0FBQ2pDLHFCQUFTLEdBQUcsU0FBUyxDQUFDLEdBQUcsQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztTQUNyQztBQUVELGVBQU8sU0FBUyxDQUFDO0tBQ2xCIiwiZmlsZSI6InV0aWxzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgVmVyc2lvbmVkUGF0aFJlZmVyZW5jZSB9IGZyb20gJy4vdmFsaWRhdG9ycyc7XG5pbXBvcnQgeyBPcGFxdWUgfSBmcm9tICdnbGltbWVyLXV0aWwnO1xuXG5leHBvcnQgZnVuY3Rpb24gcmVmZXJlbmNlRnJvbVBhcnRzKHJvb3Q6IFZlcnNpb25lZFBhdGhSZWZlcmVuY2U8T3BhcXVlPiwgcGFydHM6IHN0cmluZ1tdKTogVmVyc2lvbmVkUGF0aFJlZmVyZW5jZTxPcGFxdWU+IHtcbiAgbGV0IHJlZmVyZW5jZSA9IHJvb3Q7XG5cbiAgZm9yIChsZXQgaT0wOyBpPHBhcnRzLmxlbmd0aDsgaSsrKSB7XG4gICAgcmVmZXJlbmNlID0gcmVmZXJlbmNlLmdldChwYXJ0c1tpXSk7XG4gIH1cblxuICByZXR1cm4gcmVmZXJlbmNlO1xufVxuIl19 + enifed("glimmer-reference/lib/validators", ["exports"], function (exports) { "use strict"; @@ -44679,7 +44569,7 @@ enifed("glimmer-reference/lib/validators", ["exports"], function (exports) { return value !== NOT_MODIFIED; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2xpYi92YWxpZGF0b3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O0FBa0JPLFFBQU0sUUFBUSxHQUFhLENBQUMsQ0FBQzs7QUFDN0IsUUFBTSxPQUFPLEdBQWMsQ0FBQyxDQUFDOztBQUM3QixRQUFNLFFBQVEsR0FBYSxHQUFHLENBQUM7OztRQUV0QyxXQUFBO2lCQUFBLFdBQUE7O0FBQUEsbUJBQUEsV0FHRSxRQUFRLEdBQUEsa0JBQUMsUUFBa0IsRUFBQTtBQUN6QixtQkFBTyxJQUFJLENBQUMsS0FBSyxFQUFFLEtBQUssUUFBUSxDQUFDO1NBQ2xDOztlQUxILFdBQUE7Ozs7O0FBUUEsUUFBSSxTQUFTLEdBQUcsT0FBTyxDQUFDOztRQUV4QixZQUFBOzhCQUFBLFlBQUE7O0FBR0UsaUJBSEYsWUFBQSxHQUdrQztnQkFBcEIsUUFBUSx5REFBRyxTQUFTOztBQUM5QixtQ0FBTyxDQUFDO0FBQ1IsZ0JBQUksQ0FBQyxRQUFRLEdBQUcsUUFBUSxDQUFDO1NBQzFCOztBQU5ILG9CQUFBLFdBUUUsS0FBSyxHQUFBLGlCQUFBO0FBQ0gsbUJBQU8sSUFBSSxDQUFDLFFBQVEsQ0FBQztTQUN0Qjs7QUFWSCxvQkFBQSxXQVlFLEtBQUssR0FBQSxpQkFBQTtBQUNILGdCQUFJLENBQUMsUUFBUSxHQUFHLEVBQUUsU0FBUyxDQUFDO1NB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ZS0zZDIyLTRlNGItODc3YS02MzE3YzJjNWMxNDVcIjtcblxuZXhwb3J0IGZ1bmN0aW9uIGlzTW9kaWZpZWQ8VD4odmFsdWU6IFZhbGlkYXRpb248VD4pOiB2YWx1ZSBpcyBUIHtcbiAgcmV0dXJuIHZhbHVlICE9PSBOT1RfTU9ESUZJRUQ7XG59XG4iXX0= + enifed('glimmer-runtime/index', ['exports', 'glimmer-runtime/lib/dom/interfaces', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/template', 'glimmer-runtime/lib/symbol-table', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/syntax/core', 'glimmer-runtime/lib/compiled/opcodes/builder', 'glimmer-runtime/lib/compiler', 'glimmer-runtime/lib/opcode-builder', 'glimmer-runtime/lib/compiled/blocks', 'glimmer-runtime/lib/dom/attribute-managers', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/compiled/expressions/function', 'glimmer-runtime/lib/helpers/get-dynamic-var', 'glimmer-runtime/lib/syntax/builtins/with-dynamic-vars', 'glimmer-runtime/lib/syntax/builtins/in-element', 'glimmer-runtime/lib/vm', 'glimmer-runtime/lib/upsert', 'glimmer-runtime/lib/environment', 'glimmer-runtime/lib/partial', 'glimmer-runtime/lib/component/interfaces', 'glimmer-runtime/lib/modifier/interfaces', 'glimmer-runtime/lib/dom/helper', 'glimmer-runtime/lib/builder', 'glimmer-runtime/lib/bounds'], function (exports, _glimmerRuntimeLibDomInterfaces, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibTemplate, _glimmerRuntimeLibSymbolTable, _glimmerRuntimeLibReferences, _glimmerRuntimeLibSyntaxCore, _glimmerRuntimeLibCompiledOpcodesBuilder, _glimmerRuntimeLibCompiler, _glimmerRuntimeLibOpcodeBuilder, _glimmerRuntimeLibCompiledBlocks, _glimmerRuntimeLibDomAttributeManagers, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerRuntimeLibCompiledExpressions, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibCompiledExpressionsFunction, _glimmerRuntimeLibHelpersGetDynamicVar, _glimmerRuntimeLibSyntaxBuiltinsWithDynamicVars, _glimmerRuntimeLibSyntaxBuiltinsInElement, _glimmerRuntimeLibVm, _glimmerRuntimeLibUpsert, _glimmerRuntimeLibEnvironment, _glimmerRuntimeLibPartial, _glimmerRuntimeLibComponentInterfaces, _glimmerRuntimeLibModifierInterfaces, _glimmerRuntimeLibDomHelper, _glimmerRuntimeLibBuilder, _glimmerRuntimeLibBounds) { 'use strict'; @@ -44780,7 +44670,7 @@ enifed('glimmer-runtime/index', ['exports', 'glimmer-runtime/lib/dom/interfaces' exports.Bounds = _glimmerRuntimeLibBounds.default; exports.ConcreteBounds = _glimmerRuntimeLibBounds.ConcreteBounds; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7VUFDZSxnQkFBZ0IsNEJBQTdCLFNBQVM7VUFDSSxlQUFlLDRCQUE1QixTQUFTO1VBQ0ssZ0JBQWdCLDRCQUE5QixVQUFVO1VBQ0csZUFBZSw0QkFBNUIsU0FBUztVQUNULDBCQUEwQiw0QkFBMUIsMEJBQTBCO1VBQzFCLFlBQVksNEJBQVosWUFBWTtVQUNaLFdBQVcsNEJBQVgsV0FBVztVQUNYLFdBQVcsNEJBQVgsV0FBVztVQUdPLGVBQWUsOEJBQTFCLE9BQU87VUFBcUIsZUFBZSw4QkFBZixlQUFlO1VBQUUsUUFBUSw4QkFBUixRQUFRO1VBRTFDLFdBQVcsaUNBQXRCLE9BQU87VUFFUCxjQUFjLGdDQUFkLGNBQWM7VUFBRSxtQkFBbUIsZ0NBQW5CLG1CQUFtQjtVQUFFLGtCQUFrQixnQ0FBbEIsa0JBQWtCO1VBQUU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9saWIvY29tcG9uZW50L2ludGVyZmFjZXMnO1xuXG5leHBvcnQge1xuICBNb2RpZmllck1hbmFnZXJcbn0gZnJvbSAnLi9saWIvbW9kaWZpZXIvaW50ZXJmYWNlcyc7XG5cbmV4cG9ydCB7IGRlZmF1bHQgYXMgRE9NQ2hhbmdlcywgRE9NQ2hhbmdlcyBhcyBJRE9NQ2hhbmdlcywgRE9NVHJlZUNvbnN0cnVjdGlvbiwgaXNXaGl0ZXNwYWNlLCBpbnNlcnRIVE1MQmVmb3JlIH0gZnJvbSAnLi9saWIvZG9tL2hlbHBlcic7XG5pbXBvcnQgICogYXMgU2ltcGxlIGZyb20gJy4vbGliL2RvbS9pbnRlcmZhY2VzJztcbmV4cG9ydCB7IFNpbXBsZSB9O1xuZXhwb3J0IHsgRWxlbWVudFN0YWNrLCBFbGVtZW50T3BlcmF0aW9ucyB9IGZyb20gJy4vbGliL2J1aWxkZXInO1xuZXhwb3J0IHsgZGVmYXVsdCBhcyBCb3VuZHMsIENvbmNyZXRlQm91bmRzIH0gZnJvbSAnLi9saWIvYm91bmRzJztcbiJdfQ== + enifed("glimmer-runtime/lib/bounds", ["exports"], function (exports) { "use strict"; @@ -44901,7 +44791,7 @@ enifed("glimmer-runtime/lib/bounds", ["exports"], function (exports) { return null; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvYm91bmRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O1FBVUEsTUFBQSxHQUNFLFNBREYsTUFBQSxDQUNxQixPQUF1QixFQUFTLFdBQXdCLEVBQUE7QUFBeEQsWUFBQSxDQUFBLE9BQU8sR0FBUCxPQUFPLENBQWdCO0FBQVMsWUFBQSxDQUFBLFdBQVcsR0FBWCxXQUFXLENBQWE7S0FBSTs7OztRQU9qRixhQUFBO0FBQ0UsaUJBREYsYUFBQSxDQUNzQixNQUFjLEVBQUE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XJlbmNlOiBTaW1wbGUuTm9kZSkge1xuICBsZXQgcGFyZW50ID0gYm91bmRzLnBhcmVudEVsZW1lbnQoKTtcbiAgbGV0IGZpcnN0ID0gYm91bmRzLmZpcnN0Tm9kZSgpO1xuICBsZXQgbGFzdCA9IGJvdW5kcy5sYXN0Tm9kZSgpO1xuXG4gIGxldCBub2RlID0gZmlyc3Q7XG5cbiAgd2hpbGUgKG5vZGUpIHtcbiAgICBsZXQgbmV4dCA9IG5vZGUubmV4dFNpYmxpbmc7XG4gICAgcGFyZW50Lmluc2VydEJlZm9yZShub2RlLCByZWZlcmVuY2UpO1xuICAgIGlmIChub2RlID09PSBsYXN0KSByZXR1cm4gbmV4dDtcbiAgICBub2RlID0gbmV4dDtcbiAgfVxuXG4gIHJldHVybiBudWxsO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gY2xlYXIoYm91bmRzOiBCb3VuZHMpOiBTaW1wbGUuTm9kZSB7XG4gIGxldCBwYXJlbnQgPSBib3VuZHMucGFyZW50RWxlbWVudCgpO1xuICBsZXQgZmlyc3QgPSBib3VuZHMuZmlyc3ROb2RlKCk7XG4gIGxldCBsYXN0ID0gYm91bmRzLmxhc3ROb2RlKCk7XG5cbiAgbGV0IG5vZGUgPSBmaXJzdDtcblxuICB3aGlsZSAobm9kZSkge1xuICAgIGxldCBuZXh0ID0gbm9kZS5uZXh0U2libGluZztcbiAgICBwYXJlbnQucmVtb3ZlQ2hpbGQobm9kZSk7XG4gICAgaWYgKG5vZGUgPT09IGxhc3QpIHJldHVybiBuZXh0O1xuICAgIG5vZGUgPSBuZXh0O1xuICB9XG5cbiAgcmV0dXJuIG51bGw7XG59XG4iXX0= + enifed('glimmer-runtime/lib/builder', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-util', 'glimmer-runtime/lib/compiled/opcodes/dom'], function (exports, _glimmerRuntimeLibBounds, _glimmerUtil, _glimmerRuntimeLibCompiledOpcodesDom) { 'use strict'; @@ -45290,7 +45180,7 @@ enifed('glimmer-runtime/lib/builder', ['exports', 'glimmer-runtime/lib/bounds', return BlockListTracker; })(); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvYnVpbGRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUE0QkEsS0FBQTtBQUNFLGlCQURGLEtBQUEsQ0FDc0IsSUFBVSxFQUFBO0FBQVYsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFNO1NBQUs7O0FBRHJDLGFBQUEsV0FHRSxTQUFTLEdBQUEscUJBQUE7QUFDUCxtQkFBTyxJQUFJLENBQUMsSUFBSSxDQUFDO1NBQ2xCOztlQUxILEtBQUE7OztRQVFBLElBQUE7QUFDRSxpQkFERixJQUFBLENBQ3NCLElBQVUsRUFBQTtBQUFWLGdCQUFBLENBQUEsSUFBSSxHQUFKLElBQUksQ0FBTTtTQUFLOztBQURyQyxZQUFBLFdBR0UsUUFBUSxHQUFBLG9CQUFBO0FBQ04sbUJBQU8sSUFBSSxDQUFDLElBQUksQ0FBQztTQUNsQjs7ZUFMSCxJQUFBOzs7UUFnQkEsUUFBQTtBQUdFLGlCQUhGLFFBQUEsQ0FHYyxNQUFjLEVBQUE7QUFDeEIsZ0JBQUksQ0FBQyxNQUFNLEdBQUcsTUFBTSxDQUFDO1NBQ3RCOztBQUxILGdCQUFBLFdBT0UsYUFBYSxHQUFBLHlCQUFBO0FBQ1gsbUJBQU8sSUFBSSxDQUFDLE1BQU0sQ0FBQyxhQUFhLEVBQUUsQ0FBQztTQUNwQzs7QUFUSCxnQkFBQSxXQVdFLFNBQVMsR0FBQSxxQkFBQTtBQUNQLG1CQUFPLElBQUksQ0FBQyxNQUFNLENBQUMsU0FBUyxFQUFFLENBQUM7U0FDaEM7O0FBYkgsZ0JBQUEsV0FlRSxRQUFRLEdBQUEsb0JBQUE7QUFDTixtQkFBTyxJQUFJLENBQUMsTUF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IGxhc3ROb2RlKCkge1xuICAgIHJldHVybiB0aGlzLmJvdW5kTGlzdC50YWlsKCkubGFzdE5vZGUoKTtcbiAgfVxuXG4gIG9wZW5FbGVtZW50KGVsZW1lbnQ6IEVsZW1lbnQpIHtcbiAgICBhc3NlcnQoZmFsc2UsICdDYW5ub3Qgb3BlbkVsZW1lbnQgZGlyZWN0bHkgaW5zaWRlIGEgYmxvY2sgbGlzdCcpO1xuICB9XG5cbiAgY2xvc2VFbGVtZW50KCkge1xuICAgIGFzc2VydChmYWxzZSwgJ0Nhbm5vdCBjbG9zZUVsZW1lbnQgZGlyZWN0bHkgaW5zaWRlIGEgYmxvY2sgbGlzdCcpO1xuICB9XG5cbiAgbmV3Tm9kZShub2RlOiBOb2RlKSB7XG4gICAgYXNzZXJ0KGZhbHNlLCAnQ2Fubm90IGNyZWF0ZSBhIG5ldyBub2RlIGRpcmVjdGx5IGluc2lkZSBhIGJsb2NrIGxpc3QnKTtcbiAgfVxuXG4gIG5ld0JvdW5kcyhib3VuZHM6IEJvdW5kcykge1xuICB9XG5cbiAgbmV3RGVzdHJveWFibGUoZDogRGVzdHJveWFibGUpIHtcbiAgfVxuXG4gIGZpbmFsaXplKHN0YWNrOiBFbGVtZW50U3RhY2spIHtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compat/inner-html-fix', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/dom/helper'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibDomHelper) { 'use strict'; @@ -45399,7 +45289,7 @@ enifed('glimmer-runtime/lib/compat/inner-html-fix', ['exports', 'glimmer-runtime return true; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGF0L2lubmVyLWh0bWwtZml4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQVNBLFFBQUksZ0JBQWdCLEdBQUc7Q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seSB7XG4gICAgaWYgKHRhYmxlLmNoaWxkTm9kZXMubGVuZ3RoICE9PSAwKSB7XG4gICAgICAvLyBJdCB3b3JrZWQgYXMgZXhwZWN0ZWQsIG5vIGZpeCByZXF1aXJlZFxuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgfVxuXG4gIHJldHVybiB0cnVlO1xufVxuIl19 + enifed('glimmer-runtime/lib/compat/svg-inner-html-fix', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/dom/helper'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibDomHelper) { 'use strict'; @@ -45501,7 +45391,7 @@ enifed('glimmer-runtime/lib/compat/svg-inner-html-fix', ['exports', 'glimmer-run } } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGF0L3N2Zy1pbm5lci1odG1sLWZpeC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFHQSxRQUFNLGFBQWEsR0FBRyw0QkFBNEIsQ0FBQzs7Ozs7Ozs7Ozs7OztBQWFuRCxhQUFBLFVBQUEsQ0FBMkIsUUFBa0IsRUFBRSxlQUFrQyxFQUFFLFlBQW9CLEVBQUE7QUFDckcsWUFBSSxDQUFDLFFBQVEsRUFBRSxPQUFPLGVBQWUsQ0FBQztBQUV0QyxZQUFJLENBQUMsY0FBYyxDQUFDLFFBQVEsRUFBRSxZQUFZLENBQUMsRUFBRTtBQUMzQyxtQkFBTyxlQUFlLENBQUM7U0FDeEI7QUFFRCxZQUFJLEdBQUcsR0FBRyxRQUFRLENBQUMsYUFBYSxDQUFDLEtBQUssQ0FBQyxDQUFDO0FBRXhDO2tDQUFPLDZCQUFBOztxQkFBQSw2QkFBQTs7OztBQUFBLHlDQUFBLFdBQ0wsZ0JBQWdCLEdBQUEsMEJBQUMsTUFBbUIsRUFBRSxXQUFpQixFQUFFLElBQVksR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CBmaXJzdCwgbGFzdCk7XG59XG5cbmZ1bmN0aW9uIHNob3VsZEFwcGx5Rml4KGRvY3VtZW50LCBzdmdOYW1lc3BhY2UpIHtcbiAgbGV0IHN2ZyA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnROUyhzdmdOYW1lc3BhY2UsICdzdmcnKTtcblxuICB0cnkge1xuICAgIHN2Z1snaW5zZXJ0QWRqYWNlbnRIVE1MJ10oJ2JlZm9yZUVuZCcsICc8Y2lyY2xlPjwvY2lyY2xlPicpO1xuICB9IGNhdGNoIChlKSB7XG4gICAgLy8gSUUsIEVkZ2U6IFdpbGwgdGhyb3csIGluc2VydEFkamFjZW50SFRNTCBpcyB1bnN1cHBvcnRlZCBvbiBTVkdcbiAgICAvLyBTYWZhcmk6IFdpbGwgdGhyb3csIGluc2VydEFkamFjZW50SFRNTCBpcyBub3QgcHJlc2VudCBvbiBTVkdcbiAgfSBmaW5hbGx5IHtcbiAgICAvLyBGRjogT2xkIHZlcnNpb25zIHdpbGwgY3JlYXRlIGEgbm9kZSBpbiB0aGUgd3JvbmcgbmFtZXNwYWNlXG4gICAgaWYgKHN2Zy5jaGlsZE5vZGVzLmxlbmd0aCA9PT0gMSAmJiBzdmcuZmlyc3RDaGlsZC5uYW1lc3BhY2VVUkkgPT09IFNWR19OQU1FU1BBQ0UpIHtcbiAgICAgIC8vIFRoZSB0ZXN0IHdvcmtlZCBhcyBleHBlY3RlZCwgbm8gZml4IHJlcXVpcmVkXG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICAgIHN2ZyA9IG51bGw7XG5cbiAgICByZXR1cm4gdHJ1ZTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compat/text-node-merging-fix', ['exports'], function (exports) { // Patch: Adjacent text node merging fix // Browsers: IE, Edge, Firefox w/o inspector open @@ -45601,7 +45491,7 @@ enifed('glimmer-runtime/lib/compat/text-node-merging-fix', ['exports'], function return true; } }); -//# sourceMappingURL=data:application/json;base64,eyJ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RVc2VsZXNzQ29tbWVudCkge1xuICAgICAgICBwYXJlbnQucmVtb3ZlQ2hpbGQodGhpcy51c2VsZXNzQ29tbWVudCk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBib3VuZHM7XG4gICAgfVxuICB9O1xufVxuXG5mdW5jdGlvbiBzaG91bGRBcHBseUZpeChkb2N1bWVudCkge1xuICBsZXQgbWVyZ2luZ1RleHREaXYgPSA8SFRNTEVsZW1lbnQ+IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2RpdicpO1xuXG4gIG1lcmdpbmdUZXh0RGl2LmlubmVySFRNTCA9ICdmaXJzdCc7XG4gIG1lcmdpbmdUZXh0RGl2Lmluc2VydEFkamFjZW50SFRNTCgnYmVmb3JlRW5kJywgJ3NlY29uZCcpO1xuXG4gIGlmIChtZXJnaW5nVGV4dERpdi5jaGlsZE5vZGVzLmxlbmd0aCA9PT0gMikge1xuICAgIG1lcmdpbmdUZXh0RGl2ID0gbnVsbDtcbiAgICAvLyBJdCB3b3JrZWQgYXMgZXhwZWN0ZWQsIG5vIGZpeCByZXF1aXJlZFxuICAgIHJldHVybiBmYWxzZTtcbiAgfVxuXG4gIG1lcmdpbmdUZXh0RGl2ID0gbnVsbDtcblxuICByZXR1cm4gdHJ1ZTtcbn1cbiJdfQ== + enifed('glimmer-runtime/lib/compiled/blocks', ['exports', 'glimmer-runtime/lib/utils', 'glimmer-runtime/lib/compiler'], function (exports, _glimmerRuntimeLibUtils, _glimmerRuntimeLibCompiler) { 'use strict'; @@ -45707,7 +45597,7 @@ enifed('glimmer-runtime/lib/compiled/blocks', ['exports', 'glimmer-runtime/lib/u exports.Layout = Layout; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvYmxvY2tzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQVdBLGFBQUEsR0FJRSxTQUpGLGF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yb25tZW50KSB7XG4gICAgbGV0IGNvbXBpbGVkID0gdGhpcy5jb21waWxlZDtcbiAgICBpZiAoY29tcGlsZWQpIHJldHVybiBjb21waWxlZDtcblxuICAgIGxldCBvcHMgPSBuZXcgRW50cnlQb2ludENvbXBpbGVyKHRoaXMsIGVudikuY29tcGlsZSgpO1xuICAgIHJldHVybiB0aGlzLmNvbXBpbGVkID0gbmV3IENvbXBpbGVkQmxvY2sob3BzLCB0aGlzLnN5bWJvbFRhYmxlLnNpemUpO1xuICB9XG59XG5cbmV4cG9ydCBjbGFzcyBMYXlvdXQgZXh0ZW5kcyBUb3BMZXZlbFRlbXBsYXRlIHtcbiAgcHVibGljIGhhc05hbWVkUGFyYW1ldGVyczogYm9vbGVhbjtcbiAgcHVibGljIGhhc1lpZWxkczogYm9vbGVhbjtcbiAgY29uc3RydWN0b3IocHJvZ3JhbTogUHJvZ3JhbSwgc3ltYm9sVGFibGU6IFN5bWJvbFRhYmxlLCBwdWJsaWMgbmFtZWQ6IHN0cmluZ1tdLCBwdWJsaWMgeWllbGRzOiBzdHJpbmdbXSwgcHVibGljIGhhc1BhcnRpYWxzOiBib29sZWFuKSB7XG4gICAgc3VwZXIocHJvZ3JhbSwgc3ltYm9sVGFibGUpO1xuICAgIHRoaXMuaGFzTmFtZWRQYXJhbWV0ZXJzID0gISF0aGlzLm5hbWVkLmxlbmd0aDtcbiAgICB0aGlzLmhhc1lpZWxkcyA9ICEhdGhpcy55aWVsZHMubGVuZ3RoOztcbiAgfVxufVxuIl19 + enifed("glimmer-runtime/lib/compiled/expressions", ["exports"], function (exports) { "use strict"; @@ -45723,7 +45613,7 @@ enifed("glimmer-runtime/lib/compiled/expressions", ["exports"], function (export exports.CompiledExpression = CompiledExpression; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBR0Esa0JBQUE7aUJBQUEsa0JBQUE7O0FBQUEsMEJBQUEsV0FJRSxNQUFNLEdBQUEsa0JBQUE7QUFDSixnQ0FBa0IsSUFBSSxDQUFDLElBQUksQ0FBQyxXQUFXLEVBQUUsQ0FBRztTQUM3Qzs7ZUFOSCxrQkFBQSIsImZpbGUiOiJleHByZXNzaW9ucy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBWTSBmcm9tICcuLi92bS9hcHBlbmQnO1xuaW1wb3J0IHsgUGF0aFJlZmVyZW5jZSB9IGZyb20gJ2dsaW1tZXItcmVmZXJlbmNlJztcblxuZXhwb3J0IGFic3RyYWN0IGNsYXNzIENvbXBpbGVkRXhwcmVzc2lvbjxUPiB7XG4gIHR5cGU6IHN0cmluZztcbiAgYWJzdHJhY3QgZXZhbHVhdGUodm06IFZNKTogUGF0aFJlZmVyZW5jZTxUPjtcblxuICB0b0pTT04oKTogc3RyaW5nIHtcbiAgICByZXR1cm4gYFVOSU1QTDogJHt0aGlzLnR5cGUudG9VcHBlckNhc2UoKX1gO1xuICB9XG59XG4iXX0= + enifed('glimmer-runtime/lib/compiled/expressions/args', ['exports', 'glimmer-runtime/lib/compiled/expressions/positional-args', 'glimmer-runtime/lib/compiled/expressions/named-args', 'glimmer-runtime/lib/syntax/core', 'glimmer-reference'], function (exports, _glimmerRuntimeLibCompiledExpressionsPositionalArgs, _glimmerRuntimeLibCompiledExpressionsNamedArgs, _glimmerRuntimeLibSyntaxCore, _glimmerReference) { 'use strict'; @@ -45812,7 +45702,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/args', ['exports', 'glimmer-run exports.CompiledNamedArgs = _glimmerRuntimeLibCompiledExpressionsNamedArgs.CompiledNamedArgs; exports.EvaluatedNamedArgs = _glimmerRuntimeLibCompiledExpressionsNamedArgs.EvaluatedNamedArgs; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpb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9uYWxBcmdzLCBDb21waWxlZE5hbWVkQXJncywgRXZhbHVhdGVkTmFtZWRBcmdzIH07XG4iXX0= + enifed("glimmer-runtime/lib/compiled/expressions/concat", ["exports", "glimmer-reference"], function (exports, _glimmerReference) { "use strict"; @@ -45874,7 +45764,7 @@ enifed("glimmer-runtime/lib/compiled/expressions/concat", ["exports", "glimmer-r return String(value); } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvY29uY2F0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQU1BLGNBQUE7QUFHRSxpQkFIRixjQUFBLENBR3NCLEtBQW1DLEVBQUE7QUFBbkMsZ0JBQUEsQ0FBQSxLQUFLLEdBQUwsS0FBSyxDQUE4QjtBQUZoRCxnQkFBQSxDQUFBLElBQUksR0FBRyxRQUFRLENBQUM7U0FFb0M7O0FBSDdELHNCQUFBLFdBS0UsUUFBUSxHQUFBLGtCQUFDLEVBQU0sRUFBQTtBQUNiLGdCQUFJLEtBQUssR0FBNEIsSUFBSSxLQUFLLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQztBQUNsRSxpQkFBSyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUMsTUFBTSxFQUFFLENBQUMsRUFBRSxFQUFFO0FBQzFDLHFCQUFLLENBQUMsQ0FBQyxDQUFDLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxRQUFRLENBQUMsRUFBRSxDQUFDLENBQUM7YUFDdkM7QUFDRCxtQkFBTyxJQUFJLGVBQWUsQ0FBQyxLQUFLLENBQUMsQ0FBQztTQUNuQzs7QUFYSCxzQkFBQSxXQWFFLE1BQU0sR0FBQSxrQkFBQTtBQUNKLC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AgaWYgKHBhcnRzLmxlbmd0aCA+IDApIHtcbiAgICAgIHJldHVybiBwYXJ0cy5qb2luKCcnKTtcbiAgICB9XG5cbiAgICByZXR1cm4gbnVsbDtcbiAgfVxufVxuXG5mdW5jdGlvbiBjYXN0VG9TdHJpbmcodmFsdWUpIHtcbiAgaWYgKHR5cGVvZiB2YWx1ZVsndG9TdHJpbmcnXSAhPT0gJ2Z1bmN0aW9uJykge1xuICAgIHJldHVybiAnJztcbiAgfVxuXG4gIHJldHVybiBTdHJpbmcodmFsdWUpO1xufVxuIl19 + enifed('glimmer-runtime/lib/compiled/expressions/function', ['exports', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/compiled/expressions'], function (exports, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibCompiledExpressions) { 'use strict'; @@ -45931,7 +45821,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/function', ['exports', 'glimmer return CompiledFunctionExpression; })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvZnVuY3Rpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O3NCQVFBLElBQUE7O0FBQUEsYUFBQSxJQUFBLENBQWdDLElBQTJCLEVBQUE7QUFDekQsZUFBTyxJQUFJLHdCQUF3QixDQUFDLElBQUksQ0FBQyxDQUFDO0tBQzNDOztRQUVELHdCQUFBOzhCQUFBLHdCQUFBOztBQUlFLGlCQUpGLHdCQUFBLENBSWMsSUFBMkIsRUFBQTtBQUNyQyx3Q0FBTyxDQUFDO0FBSkgsZ0JBQUEsQ0FBQSxJQUFJLEdBQUcscUJBQXFCLENBQUM7QUFLbEMsZ0JBQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFDO1NBQ2xCOztBQVBILGdDQUFBLFdBU0UsT0FBTyxHQ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uICAgIHJldHVybiBuZXcgQ29tcGlsZWRGdW5jdGlvbkV4cHJlc3Npb24odGhpcy5mdW5jLCBzeW1ib2xUYWJsZSk7XG4gIH1cbn1cblxuY2xhc3MgQ29tcGlsZWRGdW5jdGlvbkV4cHJlc3Npb248VD4gZXh0ZW5kcyBDb21waWxlZEV4cHJlc3Npb248VD4ge1xuICBwdWJsaWMgdHlwZSA9IFwiZnVuY3Rpb25cIjtcblxuICBjb25zdHJ1Y3Rvcihwcml2YXRlIGZ1bmM6IEZ1bmN0aW9uRXhwcmVzc2lvbjxUPiwgcHJpdmF0ZSBzeW1ib2xUYWJsZTogU3ltYm9sVGFibGUpIHtcbiAgICBzdXBlcigpO1xuICAgIHRoaXMuZnVuYyA9IGZ1bmM7XG4gIH1cblxuICBldmFsdWF0ZSh2bTogVk0pOiBQYXRoUmVmZXJlbmNlPFQ+IHtcbiAgICBsZXQgeyBmdW5jLCBzeW1ib2xUYWJsZSB9ID0gdGhpcztcbiAgICByZXR1cm4gZnVuYyh2bSwgc3ltYm9sVGFibGUpO1xuICB9XG5cbiAgdG9KU09OKCk6IHN0cmluZyB7XG4gICAgbGV0IHsgZnVuYyB9ID0gdGhpcztcblxuICAgIGlmIChmdW5jLm5hbWUpIHtcbiAgICAgIHJldHVybiBgXFxgJHtmdW5jLm5hbWV9KC4uLilcXGBgO1xuICAgIH0gZWxzZSB7XG4gICAgICByZXR1cm4gXCJgZnVuYyguLi4pYFwiO1xuICAgIH1cbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compiled/expressions/has-block', ['exports', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-runtime/lib/references'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerRuntimeLibReferences) { 'use strict'; @@ -46023,7 +45913,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/has-block', ['exports', 'glimme exports.CompiledInPartialGetBlock = CompiledInPartialGetBlock; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLC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29tcGlsZWRHZXRCbG9jayB7XG4gIGNvbnN0cnVjdG9yKHByaXZhdGUgc3ltYm9sOiBudW1iZXIsIHByaXZhdGUgZGVidWc6IHN0cmluZykge1xuICB9XG5cbiAgZXZhbHVhdGUodm06IFZNKTogSW5saW5lQmxvY2sge1xuICAgIHJldHVybiB2bS5zY29wZSgpLmdldEJsb2NrKHRoaXMuc3ltYm9sKTtcbiAgfVxuXG4gIHRvSlNPTigpOiBzdHJpbmcge1xuICAgIHJldHVybiBgZ2V0LWJsb2NrKCQke3RoaXMuc3ltYm9sfSgke3RoaXMuZGVidWd9KSlgO1xuICB9XG59XG5cbmV4cG9ydCBjbGFzcyBDb21waWxlZEluUGFydGlhbEdldEJsb2NrIGltcGxlbWVudHMgQ29tcGlsZWRHZXRCbG9jayB7XG4gIGNvbnN0cnVjdG9yKHByaXZhdGUgc3ltYm9sOiBudW1iZXIsIHByaXZhdGUgbmFtZTogc3RyaW5nKSB7XG4gIH1cblxuICBldmFsdWF0ZSh2bTogVk0pOiBJbmxpbmVCbG9jayB7XG4gICAgbGV0IHsgc3ltYm9sLCBuYW1lIH0gPSB0aGlzO1xuICAgIGxldCBhcmdzID0gdm0uc2NvcGUoKS5nZXRQYXJ0aWFsQXJncyhzeW1ib2wpO1xuICAgIHJldHVybiBhcmdzLmJsb2Nrc1tuYW1lXTtcbiAgfVxuXG4gIHRvSlNPTigpOiBzdHJpbmcge1xuICAgIHJldHVybiBgZ2V0LWJsb2NrKCQke3RoaXMuc3ltYm9sfSgkQVJHUykuJHt0aGlzLm5hbWV9KSlgO1xuICB9XG59XG4iXX0= + enifed('glimmer-runtime/lib/compiled/expressions/helper', ['exports', 'glimmer-runtime/lib/compiled/expressions'], function (exports, _glimmerRuntimeLibCompiledExpressions) { 'use strict'; @@ -46054,7 +45944,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/helper', ['exports', 'glimmer-r exports.default = CompiledHelper; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIj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IHsgQ29tcGlsZWRBcmdzIH0gZnJvbSAnLi9hcmdzJztcbmltcG9ydCBWTSBmcm9tICcuLi8uLi92bS9hcHBlbmQnO1xuaW1wb3J0IHsgSGVscGVyIH0gZnJvbSAnLi4vLi4vZW52aXJvbm1lbnQnO1xuaW1wb3J0IFN5bWJvbFRhYmxlIGZyb20gJy4uLy4uL3N5bWJvbC10YWJsZSc7XG5pbXBvcnQgeyBQYXRoUmVmZXJlbmNlIH0gZnJvbSAnZ2xpbW1lci1yZWZlcmVuY2UnO1xuaW1wb3J0IHsgT3BhcXVlIH0gZnJvbSAnZ2xpbW1lci11dGlsJztcblxuZXhwb3J0IGRlZmF1bHQgY2xhc3MgQ29tcGlsZWRIZWxwZXIgZXh0ZW5kcyBDb21waWxlZEV4cHJlc3Npb248T3BhcXVlPiB7XG4gIHB1YmxpYyB0eXBlID0gXCJoZWxwZXJcIjtcblxuICBjb25zdHJ1Y3RvcihwdWJsaWMgbmFtZTogc3RyaW5nW10sIHB1YmxpYyBoZWxwZXI6IEhlbHBlciwgcHVibGljIGFyZ3M6IENvbXBpbGVkQXJncywgcHVibGljIHN5bWJvbFRhYmxlOiBTeW1ib2xUYWJsZSkge1xuICAgIHN1cGVyKCk7XG4gIH1cblxuICBldmFsdWF0ZSh2bTogVk0pOiBQYXRoUmVmZXJlbmNlPE9wYXF1ZT4ge1xuICAgIGxldCB7IGhlbHBlciB9ID0gdGhpcztcbiAgICByZXR1cm4gaGVscGVyKHZtLCB0aGlzLmFyZ3MuZXZhbHVhdGUodm0pLCB0aGlzLnN5bWJvbFRhYmxlKTtcbiAgfVxuXG4gIHRvSlNPTigpOiBzdHJpbmcge1xuICAgIHJldHVybiBgXFxgJHt0aGlzLm5hbWUuam9pbignLicpfSgkQVJHUylcXGBgO1xuICB9XG59XG4iXX0= + enifed('glimmer-runtime/lib/compiled/expressions/lookups', ['exports', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-reference'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerReference) { 'use strict'; @@ -46160,7 +46050,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/lookups', ['exports', 'glimmer- exports.CompiledInPartialName = CompiledInPartialName; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvbG9va3Vwcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFNQSxjQUFBOzhCQUFBLGNBQUE7O0FBV0UsaUJBWEYsY0FBQSxDQVlZLElBQWdDLEVBQ2hDLElBQWMsRUFBQTtBQUV0QiwwQ0FBTyxDQUFDO0FBSEEsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUE0QjtBQUNoQyxnQkFBQSxDQUFBLElBQUksR0FBSixJQUFJLENBQVU7QUFaakIsZ0JBQUEsQ0FBQSxJQUFJLEdBQUcsUUFBUSxDQUFDO1NBZXRCOztBQWhCSCxzQkFBQSxDQUdTLE1BQU0sR0FBQSxnQkFBQyxJQUFnQyxFQUFFLElBQWMsRUFBQTtBQUM1RCxnQkFBSSxJQUFJLENBQUMsTUFBTSxLQUFLLENBQUMsRUFBRTtBQUNyQix1QkFBTyxJQUFJLENBQUM7YUFDYixNQUFNO0FBQ0wsdUJBQU8sSUFBSSxJQUFJLENBQUMsSUFBSSxFQUFFLElBQUksQ0FBQyxDQUFDO2FBQzdCO1NBQ0Y7O0FBVEgsc0JBQUEsV0FrQkUsUUFBUSxHQUFBLGtCQUFDLEVBQU0sRUFBQTtnQkFDUCxJQUFJLEdBQVcsSUFBSSxDQUFuQixJQUFJO2dCQUFFLElBQUksR0FBSyxJQUFJLENBQWIsSUFBSTs7QUFDaEIsbUJBQU8sa0JBdEJGLGtCQUFrQixDQXNCRyxJQUFJLENBQUMsUUFBUSxDQUFDLEVBQUUsQ0FBQyxFQUFFLElBQUksQ0FBQyxDQUFDO1NBQ3BEOztBQ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/lib/compiled/expressions/named-args', ['exports', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/utils', 'glimmer-reference', 'glimmer-util'], function (exports, _glimmerRuntimeLibReferences, _glimmerRuntimeLibUtils, _glimmerReference, _glimmerUtil) { 'use strict'; @@ -46336,7 +46226,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/named-args', ['exports', 'glimm })(EvaluatedNamedArgs))(); exports.EVALUATED_EMPTY_NAMED_ARGS = EVALUATED_EMPTY_NAMED_ARGS; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvbmFtZWQtYXJncy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFPQSxpQkFBQTtBQXdCRSxpQkF4QkYsaUJBQUEsQ0F5QlcsSUFBYyxFQUNkLE1BQW9DLEVBQUE7QUFEcEMsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFVO0FBQ2QsZ0JBQUEsQ0FBQSxNQUFNLEdBQU4sTUFBTSxDQUE4QjtBQUUzQyxnQkFBSSxDQUFDLE1BQU0sR0FBRyxJQUFJLENBQUMsTUFBTSxDQUFDO0FBQzFCLHlCQS9CbUIsTUFBTSxDQStCbEIsSUFBSSxDQUFDLE1BQU0sS0FBSyxNQUFNLENBQUMsTUFBTSxFQUFFLDZDQUE2QyxDQUFDLENBQUM7U0FDdEY7O0FBOUJILHlCQUFBLENBQ1MsS0FBSyxHQUFBLGlCQUFBO0FBQ1YsbUJBQU8seUJBQXlCLENBQUM7U0FDbEM7O0FBSEgseUJBQUEsQ0FLUyxNQUFNLEdBQUEsZ0JBQUMsR0FBcUMsRUFBQTtBQUNqRCxnQkFBSSxJQUFJLEdBQUcsTUFBTSxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUM1QixnQkFBSSxNQUFNLEdBQUcsSUFBSS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VxuXG4gIHZhbHVlKCk6IERpY3Q8T3BhcXVlPiB7XG4gICAgbGV0IHsga2V5cywgdmFsdWVzIH0gPSB0aGlzO1xuXG4gICAgbGV0IG91dCA9IGRpY3Q8T3BhcXVlPigpO1xuXG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICBsZXQga2V5ID0ga2V5c1tpXTtcbiAgICAgIGxldCByZWYgPSB2YWx1ZXNbaV07XG4gICAgICBvdXRba2V5XSA9IHJlZi52YWx1ZSgpO1xuICAgIH1cblxuICAgIHJldHVybiBvdXQ7XG4gIH1cbn1cblxuZXhwb3J0IGNvbnN0IEVWQUxVQVRFRF9FTVBUWV9OQU1FRF9BUkdTOiBFdmFsdWF0ZWROYW1lZEFyZ3MgPSBuZXcgKGNsYXNzIGV4dGVuZHMgRXZhbHVhdGVkTmFtZWRBcmdzIHtcbiAgY29uc3RydWN0b3IoKSB7XG4gICAgc3VwZXIoRU1QVFlfQVJSQVksIEVNUFRZX0FSUkFZLCBFTVBUWV9ESUNUKTtcbiAgfVxuXG4gIGdldCgpOiBQYXRoUmVmZXJlbmNlPE9wYXF1ZT4ge1xuICAgIHJldHVybiBVTkRFRklORURfUkVGRVJFTkNFO1xuICB9XG5cbiAgaGFzKGtleTogc3RyaW5nKTogYm9vbGVhbiB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG5cbiAgdmFsdWUoKTogRGljdDxPcGFxdWU+IHtcbiAgICByZXR1cm4gRU1QVFlfRElDVDtcbiAgfVxufSk7XG4iXX0= + enifed('glimmer-runtime/lib/compiled/expressions/positional-args', ['exports', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/utils', 'glimmer-reference'], function (exports, _glimmerRuntimeLibReferences, _glimmerRuntimeLibUtils, _glimmerReference) { 'use strict'; @@ -46454,7 +46344,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/positional-args', ['exports', ' })(EvaluatedPositionalArgs))(); exports.EVALU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FMX0FSR1M6IEV2YWx1YXRlZFBvc2l0aW9uYWxBcmdzID0gbmV3IChjbGFzcyBleHRlbmRzIEV2YWx1YXRlZFBvc2l0aW9uYWxBcmdzIHtcbiAgY29uc3RydWN0b3IoKSB7XG4gICAgc3VwZXIoRU1QVFlfQVJSQVkpO1xuICB9XG5cbiAgYXQoKTogUGF0aFJlZmVyZW5jZTxPcGFxdWU+IHtcbiAgICByZXR1cm4gVU5ERUZJTkVEX1JFRkVSRU5DRTtcbiAgfVxuXG4gIHZhbHVlKCk6IE9wYXF1ZVtdIHtcbiAgICByZXR1cm4gdGhpcy52YWx1ZXM7XG4gIH1cbn0pO1xuIl19 + enifed('glimmer-runtime/lib/compiled/expressions/value', ['exports', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-runtime/lib/references'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerRuntimeLibReferences) { 'use strict'; @@ -46480,7 +46370,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/value', ['exports', 'glimmer-ru exports.default = CompiledValue; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvdmFsdWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBSUEsYUFBQTs4QkFBQSxhQUFBOztBQUlFLGlCQUpGLGFBQUEsQ0FJYyxLQUFRLEVBQUE7QUFDbEIsMENBQU8sQ0FBQztBQUpILGdCQUFBLENBQUEsSUFBSSxHQUFHLE9BQU8sQ0FBQztBQUtwQixnQkFBSSxDQUFDLFNBQVMsR0FBRyw2QkFSRCxrQkFBa0IsQ0FRRSxNQUFNLENBQUMsS0FBWSxDQUFDLENBQUM7U0FDMUQ7O0FBUEgscUJBQUEsV0FTRSxRQUFRLEdBQUEsa0JBQUMsRUFBTSxFQUFBO0FBQ2IsbUJBQU8sSUFBSSxDQUFDLFNBQVMsQ0FBQ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enifed('glimmer-runtime/lib/compiled/opcodes/builder', ['exports', 'glimmer-runtime/lib/compiled/opcodes/component', 'glimmer-runtime/lib/compiled/opcodes/partial', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-runtime/lib/compiled/opcodes/dom', 'glimmer-runtime/lib/compiled/opcodes/lists', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-util', 'glimmer-runtime/lib/utils'], function (exports, _glimmerRuntimeLibCompiledOpcodesComponent, _glimmerRuntimeLibCompiledOpcodesPartial, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerRuntimeLibCompiledOpcodesDom, _glimmerRuntimeLibCompiledOpcodesLists, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerUtil, _glimmerRuntimeLibUtils) { 'use strict'; @@ -46885,7 +46775,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/builder', ['exports', 'glimmer-runt exports.default = OpcodeBuilder; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy9idWlsZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQXlCQSwrQkFBQTtBQUVFLGlCQUZGLCtCQUFBLENBRXdCLEtBQWlDLEVBQUE7QUFBakMsZ0JBQUEsQ0FBQSxLQUFLLEdBQUwsS0FBSyxDQUE0QjtTQUFJOztBQUY3RCx1Q0FBQSxXQVFFLE9BQU8sR0FBQSxtQkFBQTtBQUNMLG1CQUFPLElBQUksQ0FBQyxLQUFLLENBQUMsT0FBTyxFQUFFLENBQUM7U0FDN0I7O0FBVkgsdUNBQUEsV0FZRSxNQUFNLEdBQUEsZ0JBQW1CLE1BQVMsRUFBQTtBQUNoQyxnQkFBSSxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUM7U0FDM0I7O0FBZEgsdUNBQUEsV0FnQkUsY0FBYyxHQU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TtcbiAgICBjYWxsYmFjayh0aGlzKTtcbiAgICB0aGlzLnN0b3BMYWJlbHMoKTtcbiAgfVxufVxuXG5leHBvcnQgdHlwZSBCbG9ja0NhbGxiYWNrID0gKGRzbDogT3Bjb2RlQnVpbGRlciwgQkVHSU46IExhYmVsLCBFTkQ6IExhYmVsKSA9PiB2b2lkO1xuIl19 + enifed('glimmer-runtime/lib/compiled/opcodes/component', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-reference'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerReference) { 'use strict'; @@ -47163,7 +47053,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/component', ['exports', 'glimmer-ru exports.CloseComponentOpcode = CloseComponentOpcode; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy9jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBVUEsbUNBQUE7OEJBQUEsbUNBQUE7O0FBQUEsaUJBQUEsbUNBQUEsR0FBQTtBQUF5RCxnQ0FBQSxTQUFBLENBQUEsQ0FBTTtBQUN0RCxnQkFBQSxDQUFBLElBQUksR0FBRyxrQ0FBa0MsQ0FBQztTQXFCbEQ7O0FBdEJELDJDQUFBLFdBR0UsUUFBUSxHQUFBLGtCQUFDLEVBQU0sRUFBQTtBQUNiLGdCQUFJLFNBQVMsR0FBRyxFQUFFLENBQUMsS0FBSyxDQUFDLFVBQVUsRUFBa0MsQ0FBQztBQUN0RSxnQkFBSSxLQUFLLEdBQUcsa0JBUitDLE9BQU8sQ0FROUMsU0FBUyxDQUFDLEdBQUcsU0FBUyxHQUFHLHNCQVJYLGNBQWMsQ0FRZ0IsU0FBUyxDQUFDLENBQUM7QUFDM0UsZ0JBQUksVUFBVSxHQUF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bnQsIGJvdW5kcyB9ID0gdGhpcztcblxuICAgIG1hbmFnZXIuZGlkVXBkYXRlTGF5b3V0KGNvbXBvbmVudCwgYm91bmRzKTtcblxuICAgIHZtLmVudi5kaWRVcGRhdGUoY29tcG9uZW50LCBtYW5hZ2VyKTtcbiAgfVxufVxuXG5leHBvcnQgY2xhc3MgQ2xvc2VDb21wb25lbnRPcGNvZGUgZXh0ZW5kcyBPcGNvZGUge1xuICBwdWJsaWMgdHlwZSA9IFwiY2xvc2UtY29tcG9uZW50XCI7XG5cbiAgZXZhbHVhdGUodm06IFZNKSB7XG4gICAgdm0ucG9wU2NvcGUoKTtcbiAgICB2bS5wb3BEeW5hbWljU2NvcGUoKTtcbiAgICB2bS5jb21taXRDYWNoZUdyb3VwKCk7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/compiled/opcodes/content', ['exports', 'glimmer-runtime/lib/upsert', 'glimmer-runtime/lib/component/interfaces', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/vm/update', 'glimmer-reference', 'glimmer-util', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/builder', 'glimmer-runtime/lib/compiler', 'glimmer-runtime/lib/compiled/opcodes/builder', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/syntax/core'], function (exports, _glimmerRuntimeLibUpsert, _glimmerRuntimeLibComponentInterfaces, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibVmUpdate, _glimmerReference, _glimmerUtil, _glimmerRuntimeLibBounds, _glimmerRuntimeLibBuilder, _glimmerRuntimeLibCompiler, _glimmerRuntimeLibCompiledOpcodesBuilder, _glimmerRuntimeLibReferences, _glimmerRuntimeLibSyntaxCore) { 'use strict'; @@ -47691,7 +47581,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/content', ['exports', 'glimmer-runt return GuardedTrustingUpdateOpcode; })(GuardedUpdateOpcode); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzI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GJvdW5kczogRnJhZ21lbnQsIHVwc2VydDogVXBzZXJ0KTogVXBkYXRpbmdPcGNvZGUge1xuICAgIHJldHVybiBuZXcgR3VhcmRlZFRydXN0aW5nVXBkYXRlT3Bjb2RlKHJlZmVyZW5jZSwgY2FjaGUsIGJvdW5kcywgdXBzZXJ0LCB0aGlzLCB2bS5jYXB0dXJlKCkpO1xuICB9XG59XG5cbmNsYXNzIEd1YXJkZWRUcnVzdGluZ1VwZGF0ZU9wY29kZSBleHRlbmRzIEd1YXJkZWRVcGRhdGVPcGNvZGU8VHJ1c3RpbmdJbnNlcnRpb24+IHtcbiAgdHlwZSA9ICd0cnVzdGluZy11cGRhdGUnO1xuXG4gIHByb3RlY3RlZCBpbnNlcnQoZG9tOiBET01UcmVlQ29uc3RydWN0aW9uLCBjdXJzb3I6IEN1cnNvciwgdmFsdWU6IFRydXN0aW5nSW5zZXJ0aW9uKTogVXBzZXJ0IHtcbiAgICByZXR1cm4gdHJ1c3RpbmdJbnNlcnQoZG9tLCBjdXJzb3IsIHZhbHVlKTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compiled/opcodes/dom', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/compiled/opcodes/vm'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibReferences, _glimmerRuntimeLibCompiledOpcodesVm) { 'use strict'; @@ -48475,7 +48365,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/dom', ['exports', 'glimmer-runtime/ exports.CommentOpcode = CommentOpcode; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy9kb20udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBd0JBLFVBQUE7OEJBQUEsVUFBQTs7QUF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9O1xuICB9XG59XG5cbmV4cG9ydCBjbGFzcyBDb21tZW50T3Bjb2RlIGV4dGVuZHMgT3Bjb2RlIHtcbiAgcHVibGljIHR5cGUgPSBcImNvbW1lbnRcIjtcblxuICBjb25zdHJ1Y3RvcihwdWJsaWMgY29tbWVudDogc3RyaW5nKSB7XG4gICAgc3VwZXIoKTtcbiAgfVxuXG4gIGV2YWx1YXRlKHZtOiBWTSkge1xuICAgIHZtLnN0YWNrKCkuYXBwZW5kQ29tbWVudCh0aGlzLmNvbW1lbnQpO1xuICB9XG5cbiAgdG9KU09OKCk6IE9wY29kZUpTT04ge1xuICAgIHJldHVybiB7XG4gICAgICBndWlkOiB0aGlzLl9ndWlkLFxuICAgICAgdHlwZTogdGhpcy50eXBlLFxuICAgICAgYXJnczogW0pTT04uc3RyaW5naWZ5KHRoaXMuY29tbWVudCldXG4gICAgfTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compiled/opcodes/lists', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-util', 'glimmer-reference'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerUtil, _glimmerReference) { 'use strict'; @@ -48625,7 +48515,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/lists', ['exports', 'glimmer-runtim exports.NextIterOpcode = NextIterOpcode; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy9saXN0cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFPQSx5QkFBQTtBQUlFLGlCQUpGLHlCQUFBLENBSWMsU0FBNkIsRUFBQTtBQUN2QyxnQkFBSSxDQUFDLEdBQUcsR0FBRyxTQUFTLENBQUMsR0FBRyxDQUFDO0FBQ3pCLGdCQUFJLENBQUMsU0FBUyxHQUFHLF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dzKEV2YWx1YXRlZEFyZ3MucG9zaXRpb25hbChbaXRlbS52YWx1ZSwgaXRlbS5tZW1vXSkpO1xuICAgIH0gZWxzZSB7XG4gICAgICB2bS5mcmFtZS5zZXRDb25kaXRpb24oRkFMU0VfUkVGKTtcbiAgICAgIHZtLmdvdG8odGhpcy5lbmQpO1xuICAgIH1cbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compiled/opcodes/partial', ['exports', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/opcodes/vm'], function (exports, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledOpcodesVm) { 'use strict'; @@ -48732,7 +48622,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/partial', ['exports', 'glimmer-util exports.EvaluatePartialOpcode = EvaluatePartialOpcode; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy9wYXJ0aWFsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQVNBLGlDQUFBOzhCQUFBLGlDQUFBOztBQUdFLGlCQUhGLGlDQUFBLENBR3NCLFdBQXdCLEVBQUE7QUFDMUMsOEJBQU8sQ0FBQztBQURVLGdCQUFBLENBQUEsV0FBVyxHQUFYLFdBQVcsQ0FBYTtBQUZyQyxnQkFBQSxDQUFBLElBQUksR0FBRyxnQ0FBZ0MsQ0FBQztTQUk5Qzs7QUFMSCx5Q0FBQSxXQU9FLFFBQVEsR0FBQSxrQkFBQyxFQUFNLEVBQUE7QUFDYixnQkFBSSxHQUFHLEdBQUcsRUFBRSxDQUFDLEdBQUcsQ0FBQztnQkFDWCxXQUFXLEdBQUssSUFBSSxDQUFwQixXQUFXOztBQUVqQixxQkFBQSxhQUFBLENBQXVCLElBQVksRUFBQTtBQUNqQyxvQkFBSSxV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SBjYWNoZSA9IGRpY3Q8UGFydGlhbEJsb2NrPigpO1xuXG4gIGNvbnN0cnVjdG9yKHByaXZhdGUgc3ltYm9sVGFibGU6IFN5bWJvbFRhYmxlKSB7XG4gICAgc3VwZXIoKTtcbiAgfVxuXG4gIGV2YWx1YXRlKHZtOiBWTSkge1xuICAgIGxldCB7IHRlbXBsYXRlIH0gPSB2bS5mcmFtZS5nZXRJbW1lZGlhdGU8UGFydGlhbERlZmluaXRpb248T3BhcXVlPj4oKTtcblxuICAgIGxldCBibG9jayA9IHRoaXMuY2FjaGVbdGVtcGxhdGUuaWRdO1xuXG4gICAgaWYgKCFibG9jaykge1xuICAgICAgYmxvY2sgPSB0ZW1wbGF0ZS5hc1BhcnRpYWwodGhpcy5zeW1ib2xUYWJsZSk7XG4gICAgfVxuXG4gICAgdm0uaW52b2tlUGFydGlhbChibG9jayk7XG4gIH1cblxuICB0b0pTT04oKTogT3Bjb2RlSlNPTiB7XG4gICAgcmV0dXJuIHtcbiAgICAgIGd1aWQ6IHRoaXMuX2d1aWQsXG4gICAgICB0eXBlOiB0aGlzLnR5cGUsXG4gICAgICBhcmdzOiBbXCIkT1BFUkFORFwiXVxuICAgIH07XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/compiled/opcodes/vm', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/references', 'glimmer-reference', 'glimmer-util'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibReferences, _glimmerReference, _glimmerUtil) { 'use strict'; @@ -49394,7 +49284,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/vm', ['exports', 'glimmer-runtime/l exports.DidModifyOpcode = DidModifyOpcode; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy92bS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFXQ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m90TW9kaWZpZWRPcGNvZGUpIHtcbiAgICBzdXBlcigpO1xuICAgIHRoaXMudGFnID0gQ09OU1RBTlRfVEFHO1xuICB9XG5cbiAgZXZhbHVhdGUoKSB7XG4gICAgdGhpcy50YXJnZXQuZGlkTW9kaWZ5KCk7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/compiler', ['exports', 'glimmer-util', 'glimmer-runtime/lib/utils', 'glimmer-runtime/lib/syntax/core', 'glimmer-runtime/lib/compiled/blocks', 'glimmer-runtime/lib/compiled/expressions/function', 'glimmer-runtime/lib/compiled/opcodes/builder'], function (exports, _glimmerUtil, _glimmerRuntimeLibUtils, _glimmerRuntimeLibSyntaxCore, _glimmerRuntimeLibCompiledBlocks, _glimmerRuntimeLibCompiledExpressionsFunction, _glimmerRuntimeLibCompiledOpcodesBuilder) { 'use strict'; @@ -49826,7 +49716,7 @@ enifed('glimmer-runtime/lib/compiler', ['exports', 'glimmer-util', 'glimmer-runt exports.CompileIntoList = CompileIntoList; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7UUFrQ0EsUUFBQTtBQUlFLGlCQUpGLFFBQUEsQ0FJd0IsS0FBWSxFQUFTLEdBQWdCLEVBQUE7QUFBckMsZ0JBQUEsQ0FBQSxLQUFLLEdBQUwsS0FBSyxDQUFPO0FBQVMsZ0JBQUEsQ0FBQSxHQUFHLEdBQUgsR0FBRyxDQUFhO0FBQ3pELGdCQUFJLENBQUMsT0FBTyxHQUFHLEtBQUssQ0FBQyxPQUFPLENBQUMsSUFBSSxFQUFFLENBQUM7QUFDcEMsZ0JBQUksQ0FBQyxXQUFXLEdBQUcsS0FBSyxDQUFDLFdBQVcsQ0FBQztTQUN0Qzs7QUFQSCxnQkFBQSxXQVNZLGdCQUFnQixHQUFBLDBCQU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1cm4gdGhpcztcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/component/interfaces', ['exports'], function (exports) { 'use strict'; @@ -49846,7 +49736,7 @@ enifed('glimmer-runtime/lib/component/interfaces', ['exports'], function (export exports.ComponentDefinition = ComponentDefinition; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcG9uZW50L2ludGVyZmFjZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQXFHQSxRQUFNLDBCQUEwQixHQUFHLGdFQUFnRSxDQUFDOztBQUVwRyxhQUFBLHFCQUFBLENBQXNDLEdBQVEsRUFBQTtBQUM1QyxlQUFPLE9BQU8sR0FBRyxLQUFLLFFBQVEsSUFBSSxHQUFHLElBQUksR0FBRyxDQUFDLDBCQUEwQixDQUFDLENBQUM7S0FDMUU7O1FBRUQsbUJBQUEsR0FPRSxTQVBGLG1CQUFBLENBT2MsSUFBWSxFQUFFLE9BQTRCLEVBQUUsY0FBOEIsRUFBQTtBQUY5RSxZQUFBLENBQUMsZ0VBQWdFLENBQUMsR0FBRyxJQUFJLENBQUM7QUFHaEYsWUFBSSxDQUFDLElBQUksR0FBRyxJQUFJLENBQUM7QUFDakIsWUFBSSxDQUFDLE9BQU8sR0FBRyxPQUFPLENBQUM7QUFDdkIsWUFBSSxDQUFDLGNBQWMsR0FBRyxjQUFjLENBQUM7S0FDdEMiLCJmaWxlIjoiaW50ZXJmYWNlcy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEV2YWx1YXRlZEFyZ3MgfSBmcm9tICcuLi9jb21waWxlZC9leHByZXNzaW9ucy9hcmdzJztcbmltcG9ydCB7IEZ1bmN0aW9uRXhwcmVzc2lvbiB9IGZyb20gJy4uL2NvbXBpbGVkL2V4cHJlc3Npb25zL2Z1bmN0aW9uJztcbmltcG9ydCB7IExheW91dCwgQ29tcGlsZWRCbG9jayB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TU5Yzc1NGUtNjFlYi00MzkyLThjNGEtMmMwYWM3MmJmY2Q0XSddID0gdHJ1ZTtcblxuICBjb25zdHJ1Y3RvcihuYW1lOiBzdHJpbmcsIG1hbmFnZXI6IENvbXBvbmVudE1hbmFnZXI8VD4sIENvbXBvbmVudENsYXNzOiBDb21wb25lbnRDbGFzcykge1xuICAgIHRoaXMubmFtZSA9IG5hbWU7XG4gICAgdGhpcy5tYW5hZ2VyID0gbWFuYWdlcjtcbiAgICB0aGlzLkNvbXBvbmVudENsYXNzID0gQ29tcG9uZW50Q2xhc3M7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/dom/attribute-managers', ['exports', 'glimmer-runtime/lib/dom/sanitized-values', 'glimmer-runtime/lib/dom/props', 'glimmer-runtime/lib/dom/helper', 'glimmer-runtime/lib/compiled/opcodes/content'], function (exports, _glimmerRuntimeLibDomSanitizedValues, _glimmerRuntimeLibDomProps, _glimmerRuntimeLibDomHelper, _glimmerRuntimeLibCompiledOpcodesContent) { 'use strict'; @@ -50102,7 +49992,7 @@ enifed('glimmer-runtime/lib/dom/attribute-managers', ['exports', 'glimmer-runtim return SafeAttributeManager; })(AttributeManager); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL2F0dHJpYnV0ZS1tYW5hZ2Vycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7OztBQVlBLGFBQUEsZUFBQSxDQUFnQyxPQUF1QixFQUFFLElBQVksRUFBRSxVQUFtQixFQUFFLFNBQWlCLEVBQUE7QUFDM0csWUFBSSxPQUFPLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQztBQUM5QixZQUFJLEtBQUssR0FBRyxPQUFPLENBQUMsWUFBWSxpQ0FOekIsYUFBYSxBQU04QixDQUFDO0FBRW5ELFlBQUksS0FBSyxFQUFFO0FBQ1QsbUJBQU8sd0JB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R0cmlidXRlKGVudiwgZWxlbWVudCwgc2FuaXRpemVBdHRyaWJ1dGVWYWx1ZShlbnYsIGVsZW1lbnQsIHRoaXMuYXR0ciwgdmFsdWUpKTtcbiAgfVxuXG4gIHVwZGF0ZUF0dHJpYnV0ZShlbnY6IEVudmlyb25tZW50LCBlbGVtZW50OiBFbGVtZW50LCB2YWx1ZTogT3BhcXVlLCBuYW1lc3BhY2U/OiBET01OYW1lc3BhY2UpIHtcbiAgICBzdXBlci51cGRhdGVBdHRyaWJ1dGUoZW52LCBlbGVtZW50LCBzYW5pdGl6ZUF0dHJpYnV0ZVZhbHVlKGVudiwgZWxlbWVudCwgdGhpcy5hdHRyLCB2YWx1ZSkpO1xuICB9XG59XG4iXX0= + enifed('glimmer-runtime/lib/dom/helper', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/compat/inner-html-fix', 'glimmer-runtime/lib/compat/svg-inner-html-fix', 'glimmer-runtime/lib/compat/text-node-merging-fix', 'glimmer-runtime/lib/dom/interfaces'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibCompatInnerHtmlFix, _glimmerRuntimeLibCompatSvgInnerHtmlFix, _glimmerRuntimeLibCompatTextNodeMergingFix, _glimmerRuntimeLibDomInterfaces) { 'use strict'; @@ -50355,7 +50245,7 @@ enifed('glimmer-runtime/lib/dom/helper', ['exports', 'glimmer-runtime/lib/bounds exports.DOMTreeConstruction = DOMTreeConstruction; exports.DOMNamespace = _glimmerRuntimeLibDomInterfaces.Namespace; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL2hlbHBlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFlTyxRQUFNLGFBQWEsR0FBRyw0QkFBNEIsQ0FBQzs7O0FBRzFELFFBQU0sc0JBQXNCLEdBQUcsRUFBRSxhQUFhLEVBQUUsQ0FBQyxFQU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GhlbHBlcjtcbmV4cG9ydCBjb25zdCBET01UcmVlQ29uc3RydWN0aW9uID0gRE9NLkRPTVRyZWVDb25zdHJ1Y3Rpb247XG5leHBvcnQgdHlwZSBET01UcmVlQ29uc3RydWN0aW9uID0gRE9NLkRPTVRyZWVDb25zdHJ1Y3Rpb247XG5leHBvcnQgeyBOYW1lc3BhY2UgYXMgRE9NTmFtZXNwYWNlIH0gZnJvbSAnLi9pbnRlcmZhY2VzJztcbiJdfQ== + enifed("glimmer-runtime/lib/dom/interfaces", ["exports"], function (exports) { "use strict"; @@ -50376,7 +50266,7 @@ enifed("glimmer-runtime/lib/dom/interfaces", ["exports"], function (exports) { NodeType[NodeType["Notation"] = 11] = "Notation"; })(NodeType || (exports.NodeType = NodeType = {})); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL2ludGVyZmFjZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBV0EsUUFBWSxRQWFYLENBQUE7O0FBYkQsS0FBQSxVQUFZLFFBQVEsRUFBQTtBQUNsQixnQkFBQSxDQUFBLFFBQUEsQ0FBQSxTQUFBLENBQUEsR0FBQSxDQUFBLENBQUEsR0FBQSxTQUFPLENBQUE7QUFDUCxnQkFBQSxDQUFBLFFBQUEsQ0FBQSxXQUFBLENBQUEsR0FBQSxDQUFBLENBQUEsR0FBQSxXQUFTLENBQUE7QUFDVCxnQkFBQSxDQUFBLFFBQUEsQ0FBQSxNQUFBLENBQUEsR0FBQSxDQUFBLENBQUEsR0FBQSxNQUFJLENBQUE7QUFDSixnQkFBQSxDQUFBLFFBQUEsQ0FBQSxjQUFBLENBQUEsR0FBQSxDQUFBLENBQUEsR0FBQSxjQUFZLENBQUE7QUFDWixnQkFBQSxDQUFBLFFBQUEsQ0FBQSxpQkFBQSxDQUFBLEdBQUEsQ0FBQSxDQUFBLEdBQUEsaUJBQWUsQ0F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OiB2b2lkO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIFNWR0VsZW1lbnQgZXh0ZW5kcyBFbGVtZW50IHt9XG5cbmV4cG9ydCBpbnRlcmZhY2UgSFRNTEVsZW1lbnQgZXh0ZW5kcyBFbGVtZW50IHt9XG4iXX0= + enifed('glimmer-runtime/lib/dom/props', ['exports'], function (exports) { /* * @method normalizeProperty @@ -50433,7 +50323,10 @@ enifed('glimmer-runtime/lib/dom/props', ['exports'], function (exports) { // Chrome 46.0.2464.0: 'autocorrect' in document.createElement('input') === false // Safari 8.0.7: 'autocorrect' in document.createElement('input') === false // Mobile Safari (iOS 8.4 simulator): 'autocorrect' in document.createElement('input') === true - autocorrect: true + autocorrect: true, + // Chrome 54.0.2840.98: 'list' in document.createElement('input') === true + // Safari 9.1.3: 'list' in document.createElement('input') === false + list: true }, // element.form is actually a legitimate readOnly property, that is to be // mutated, but must be mutated by setAttribute... @@ -50450,7 +50343,7 @@ enifed('glimmer-runtime/lib/dom/props', ['exports'], function (exports) { return tag && tag[propName.toLowerCase()] || false; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL3Byb3BzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztBQU1BLGFBQUEsaUJBQUEsQ0FBa0MsT0FBTyxFQUFFLFFBQVEsRUFBQTtBQUNqRCxZQUFJLElBQUksWUFBQTtZQUFFLFVBQVUsWUFBQSxDQUFDO0FBRXJCLFlBQUksUUFBUSxJQUFJLE9BQU8sRUFBRTtBQUN2QixzQkFBVSxHQUFHLFFBQVEsQ0FBQztBQUN0QixnQkFBSSxHQUFHLE1BQU0sQ0FBQztTQUNmLE1BQU07QUFDTCxnQkFBSSxLQUFLLEdBQUcsUUFBUSxDQUFDLFdBQVcsRUFBRSxDQUFDO0FBQ25DLGdCQUFJLEtBQUssSUFBSSxPQUFPL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FtZS50b0xvd2VyQ2FzZSgpXSB8fCBmYWxzZTtcbn1cbiJdfQ== + enifed('glimmer-runtime/lib/dom/sanitized-values', ['exports', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-runtime/lib/upsert'], function (exports, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerRuntimeLibUpsert) { 'use strict'; @@ -50502,7 +50395,7 @@ enifed('glimmer-runtime/lib/dom/sanitized-values', ['exports', 'glimmer-runtime/ return str; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL3Nhbml0aXplZC12YWx1ZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBTUEsUUFBTSxZQUFZLEdBQUcsQ0FDbkIsYUFBYSxFQUNiLFdBQVcsQ0FDWixDQUFDO0FBRUYsUUFBTSxPQUFPLEdBQUcsQ0FDZCxHQUFHLEVBQ0gsTUFBTSxFQUNOLE1BQU0sRUFDTixLQUFLLEVBQ0wsUUFBUSxFQUNSLE1BQU0sRUFDTixNQUFNLENBQ1AsQ0FBQztBQUVGLFFBQU0saUJBQWlCLEdBQUcsQ0FDeEIsT0FBTyxDQUNSLENBQUM7QUFFRixRQUFNLGFBQWEsR0FBRyxDQUNwQixNQUFNLEVBQ04sS0FBSyxFQUNMLFlBQVksRUFDWixRQUFRLENBQ1QsQ0FBQztBQUVGLFFBQU0sdUJBQXVCLEdBQUcsQ0FDOUIsS0FBSyxDQUNOLENBQUM7QUFFRixhQUFBLEdBQUEsQ0FBYSxLQUFvQixFQUFFLElBQVksRUFBQTtBQUM3QyxlQUFPLEtBQUssQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUM7S0FDbkM7QUFFRCxhQUFBLFFBQUEsQ0FBa0IsT0FBZSxFQUFFLFNBQWlCLEVBQUE7QUFDbEQsZUFBTyxDQUFDLE9BQ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tZW50LCBhdHRyaWJ1dGU6IHN0cmluZywgdmFsdWU6IE9wYXF1ZSk6IE9wYXF1ZSB7XG4gIGxldCB0YWdOYW1lO1xuXG4gIGlmICh2YWx1ZSA9PT0gbnVsbCB8fCB2YWx1ZSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgcmV0dXJuIHZhbHVlO1xuICB9XG5cbiAgaWYgKGlzU2FmZVN0cmluZyh2YWx1ZSkpIHtcbiAgICByZXR1cm4gdmFsdWUudG9IVE1MKCk7XG4gIH1cblxuICBpZiAoIWVsZW1lbnQpIHtcbiAgICB0YWdOYW1lID0gbnVsbDtcbiAgfSBlbHNlIHtcbiAgICB0YWdOYW1lID0gZWxlbWVudC50YWdOYW1lLnRvVXBwZXJDYXNlKCk7XG4gIH1cblxuICBsZXQgc3RyID0gbm9ybWFsaXplVGV4dFZhbHVlKHZhbHVlKTtcblxuICBpZiAoY2hlY2tVUkkodGFnTmFtZSwgYXR0cmlidXRlKSkge1xuICAgIGxldCBwcm90b2NvbCA9IGVudi5wcm90b2NvbEZvclVSTChzdHIpO1xuICAgIGlmIChoYXMoYmFkUHJvdG9jb2xzLCBwcm90b2NvbCkpIHtcbiAgICAgIHJldHVybiBgdW5zYWZlOiR7c3RyfWA7XG4gICAgfVxuICB9XG5cbiAgaWYgKGNoZWNrRGF0YVVSSSh0YWdOYW1lLCBhdHRyaWJ1dGUpKSB7XG4gICAgcmV0dXJuIGB1bnNhZmU6JHtzdHJ9YDtcbiAgfVxuXG4gIHJldHVybiBzdHI7XG59XG4iXX0= + enifed('glimmer-runtime/lib/environment', ['exports', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/dom/attribute-managers', 'glimmer-util', 'glimmer-runtime/lib/syntax/core', 'glimmer-runtime/lib/syntax/builtins/if', 'glimmer-runtime/lib/syntax/builtins/unless', 'glimmer-runtime/lib/syntax/builtins/with', 'glimmer-runtime/lib/syntax/builtins/each'], function (exports, _glimmerRuntimeLibReferences, _glimmerRuntimeLibDomAttributeManagers, _glimmerUtil, _glimmerRuntimeLibSyntaxCore, _glimmerRuntimeLibSyntaxBuiltinsIf, _glimmerRuntimeLibSyntaxBuiltinsUnless, _glimmerRuntimeLibSyntaxBuiltinsWith, _glimmerRuntimeLibSyntaxBuiltinsEach) { 'use strict'; @@ -50758,7 +50651,7 @@ enifed('glimmer-runtime/lib/environment', ['exports', 'glimmer-runtime/lib/refer }; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZW52aXJvbm1lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBMkRBLEtBQUE7QUFlRSxpQkFmRixLQUFBLENBZWMsVUFBdUIsRUFBMkI7Z0JBQXpCLFdBQVcseURBQVUsSUFBSTs7QUFGdEQsZ0JBQUEsQ0FBQSxXQUFXLEdBQVUsSUFBSSxDQUFDO0FBR2hDLGdCQUFJLENBQUMsS0FBSyxHQUFHLFVBQVUsQ0FBQztBQUN4QixnQkFBSSxDQUFDLFdBQVcsR0FBRyxXQUFXLENBQUM7U0FDaEM7O0FBbEJILGFBQUEsQ0FDUyxJQUFJLEdBQUEsY0FBQyxJQUEyQixFQUFVO2dCQUFSLElBQUkseURBQUcsQ0FBQzs7QUFDL0MsZ0JBQUksSUFBSSxHQUE0QixJQUFJLEtBQUssQ0FBQyxJQUFJLEdBQUcsQ0FBQyxDQUFDLENBQUM7QUFFeEQsaUJBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsSUFBSSxJQUFJLEVBQUUsQ0FBQyxFQUFFLEVBQUU7QUFDOUIsb0JBQUksQ0FBQyxDQUFDLENBQUMsZ0NBekRKLG1CQUFtQixBQXlETyxDQUFDO2FBQy9CO0FBRUQsbUJBQU8sSUFBSSxLQUFLLENBQUMsSUFBSSxDQUFDLENBQUMsSUFBSSxDQUFDLEVBQUUsSUFBSSxFQUFKLElBQUksRUFBRSxDQUF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KTtcbiAgICAgIHBhdGggPSBhcHBlbmRWYWx1ZS5yZWYucGFydHM7XG4gICAgfSBlbHNlIGlmIChhcHBlbmQgJiYgYXBwZW5kLnZhbHVlLnR5cGUgPT09ICdoZWxwZXInKSB7XG4gICAgICBsZXQgaGVscGVyID0gPFN5bnRheC5IZWxwZXI+YXBwZW5kLnZhbHVlO1xuICAgICAgYXJncyA9IGhlbHBlci5hcmdzO1xuICAgICAgcGF0aCA9IGhlbHBlci5yZWYucGFydHM7XG4gICAgfSBlbHNlIGlmIChtb2RpZmllcikge1xuICAgICAgcGF0aCA9IG1vZGlmaWVyLnBhdGg7XG4gICAgICBhcmdzID0gbW9kaWZpZXIuYXJncztcbiAgICB9XG5cbiAgICBsZXQga2V5OiBzdHJpbmcsIGlzU2ltcGxlOiBib29sZWFuO1xuXG4gICAgaWYgKHBhdGgpIHtcbiAgICAgIGlzU2ltcGxlID0gcGF0aC5sZW5ndGggPT09IDE7XG4gICAgICBrZXkgPSBwYXRoWzBdO1xuICAgIH1cblxuICAgIHJldHVybiB7XG4gICAgICBpc1NpbXBsZSxcbiAgICAgIHBhdGgsXG4gICAgICBrZXksXG4gICAgICBhcmdzLFxuICAgICAgYXBwZW5kVHlwZSxcbiAgICAgIG9yaWdpbmFsOiBzdGF0ZW1lbnQsXG4gICAgICBpc0lubGluZTogISFhcHBlbmQsXG4gICAgICBpc0Jsb2NrOiAhIWJsb2NrLFxuICAgICAgaXNNb2RpZmllcjogISFtb2RpZmllclxuICAgIH07XG59XG4iXX0= + enifed('glimmer-runtime/lib/helpers/get-dynamic-var', ['exports', 'glimmer-reference'], function (exports, _glimmerReference) { 'use strict'; @@ -50795,15 +50688,15 @@ enifed('glimmer-runtime/lib/helpers/get-dynamic-var', ['exports', 'glimmer-refer } exports.default = getDynamicVar; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvaGVscGVycy9nZXQtZHluYW1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bWljVmFyIGFzIEhlbHBlcik7XG4iXX0= + enifed("glimmer-runtime/lib/modifier/interfaces", ["exports"], function (exports) { "use strict"; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvbW9kaWZpZXIvaW50ZXJmYWNlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwiZmlsZSI6ImludGVyZmFjZXMuanMiLCJzb3VyY2VzQ29udGVudCI6W119 + enifed("glimmer-runtime/lib/opcode-builder", ["exports"], function (exports) { "use strict"; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvb3Bjb2RlLWJ1aWxkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJvcGNvZGUtYnVpbGRlci5qcyIsInNvdXJjZXNDb250ZW50IjpbXX0= + enifed('glimmer-runtime/lib/opcodes', ['exports', 'glimmer-util'], function (exports, _glimmerUtil) { 'use strict'; @@ -50892,7 +50785,7 @@ enifed('glimmer-runtime/lib/opcodes', ['exports', 'glimmer-util'], function (exp } } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvb3Bjb2Rlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztRQWFBLGNBQUE7QUFPRSxpQkFQRixjQUFBLEdBT0U7QUFDRSx5QkFyQjhDLGNBQWMsQ0FxQjdDLElBQUksQ0FBQyxDQUFDO1NBQ3RCOztBQVRILHNCQUFBLFdBV0UsTUFBTSxHQUFBLGtCQUFBO0FBQ0osbUJBQU8sRUFBRSxJQUFJLEVBQUUsSUFBSSxDQUFDLEtBQUssRUFBRSxJQUFJLEVBQUUsSUFBSSxDQUFDLElBQUksRUFBRSxDQUFDO1NBQzlDOztlQWJILG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dzICYmIG9wY29kZS5hcmdzLmxlbmd0aCkge1xuICAgICAgICAgIGJ1ZmZlci5wdXNoKCcsICcpO1xuICAgICAgICB9XG5cbiAgICAgICAgYnVmZmVyLnB1c2goa2V5cy5tYXAoa2V5ID0+IGAke2tleX09JHtvcGNvZGUuZGV0YWlsc1trZXldfWApLmpvaW4oJywgJykpO1xuICAgICAgfVxuICAgIH1cblxuICAgIGJ1ZmZlci5wdXNoKCcpJyk7XG4gIH1cblxuICBidWZmZXIucHVzaCgnXFxuJyk7XG5cbiAgaWYgKG9wY29kZS5jaGlsZHJlbiAmJiBvcGNvZGUuY2hpbGRyZW4ubGVuZ3RoKSB7XG4gICAgZm9yIChsZXQgaT0wOyBpPG9wY29kZS5jaGlsZHJlbi5sZW5ndGg7IGkrKykge1xuICAgICAgX2luc3BlY3Qob3Bjb2RlLmNoaWxkcmVuW2ldLCBidWZmZXIsIGxldmVsKzEsIGkpO1xuICAgIH1cbiAgfVxufVxuIl19 + enifed("glimmer-runtime/lib/partial", ["exports"], function (exports) { "use strict"; @@ -50903,7 +50796,7 @@ enifed("glimmer-runtime/lib/partial", ["exports"], function (exports) { exports.PartialDefinition = PartialDefinition; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvcGFydGlhbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFFQSxpQkFBQSxHQUlFLFNBSkYsaUJBQUEsQ0FJYyxJQUFZLEVBQUUsUUFBcUIsRUFBQTtBQUM3QyxZQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQztBQUNqQixZQUFJLENBQUMsUUFBUSxHQUFHLFFBQVEsQ0FBQztLQUMxQiIsImZpbGUiOiJwYXJ0aWFsLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgVGVtcGxhdGUgfSBmcm9tICcuL3RlbXBsYXRlJztcblxuZXhwb3J0IGNsYXNzIFBhcnRpYWxEZWZpbml0aW9uPFQ+IHtcbiAgbmFtZTogc3RyaW5nOyAvLyBmb3IgZGVidWdnaW5nXG4gIHRlbXBsYXRlOiBUZW1wbGF0ZTxUPjtcblxuICBjb25zdHJ1Y3RvcihuYW1lOiBzdHJpbmcsIHRlbXBsYXRlOiBUZW1wbGF0ZTxUPikge1xuICAgIHRoaXMubmFtZSA9IG5hbWU7XG4gICAgdGhpcy50ZW1wbGF0ZSA9IHRlbXBsYXRlO1xuICB9XG59XG4iXX0= + enifed('glimmer-runtime/lib/references', ['exports', 'glimmer-reference'], function (exports, _glimmerReference) { 'use strict'; @@ -50999,7 +50892,7 @@ enifed('glimmer-runtime/lib/references', ['exports', 'glimmer-reference'], funct exports.ConditionalReference = ConditionalReference; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvcmVmZXJlbmNlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFLQSxrQkFBQTs4QkFBQSxrQkFBQTs7QUFzQkUsaUJBdEJGLGtCQUFBLENBc0J3QixLQUFRLEVBQUE7QUFDNUIsdUNBQU0sS0FBSyxDQUFDLENBQUM7U0FDZDs7QUF4QkgsMEJBQUEsQ0FNUyxNQUFNLEdBQUEsZ0JBQUMsS0FBZ0IsRUFBQTtBQUM1QixnQkFBSSxLQUFLLEtBQUssU0FBUyxFQUFFO0FBQ3ZCLHVCQUFPLG1CQUFtQixDQUFDO2FBQzVCLE1BQU0sSUFBSSxLQUFLLEtBQUssSUFBSSxFQUFFO0FBQ3pCLHVCQUFPLGNBQWMsQ0FBQzthQUN2QixNQUFNLElBQUksS0FBSyxLQUFLLElBQUksRUFBRTtBQUN6Qix1QkFBTyxjQUFjLENBQUM7YUFDdkIsTUFBTSxJQUFJLEtBQUssS0FBSyxLQUFLLEVBQUU7QUFDMUIsdUJBQU8sZUFBZSxDQUFDO2FBQ3hCLE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hcXVlKTogYm9vbGVhbiB7XG4gICAgcmV0dXJuICEhdmFsdWU7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/scanner', ['exports', 'glimmer-runtime/lib/syntax/statements', 'glimmer-runtime/lib/compiled/blocks', 'glimmer-util', 'glimmer-runtime/lib/symbol-table'], function (exports, _glimmerRuntimeLibSyntaxStatements, _glimmerRuntimeLibCompiledBlocks, _glimmerUtil, _glimmerRuntimeLibSymbolTable) { 'use strict'; @@ -51154,7 +51047,7 @@ enifed('glimmer-runtime/lib/scanner', ['exports', 'glimmer-runtime/lib/syntax/st return SyntaxReader; })(); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc2Nhbm5lci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFRQSxPQUFBO0FBQ0UsaUJBREYsT0FBQSxDQUNzQixLQUE4QixFQUFVLElBQWtCLEVBQVUsR0FBZ0IsRUFBQTtBQUFwRixnQkFBQSxDQUFBLEtBQUssR0FBTCxLQUFLLENBQXlCO0FBQVUsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFjO0FBQVUsZ0JBQUEsQ0FBQSxHQUFHLEdBQUgsR0FBRyxDQUFhO1NBQ3ZHOztBQUZILGVBQUEsV0FJRSxjQUFjLEdBQUEsMEJBQUE7Z0JBQ04sS0FBSyxHQUFXLElBQUksQ0FBcEIsS0FBSztnQkFBRSxJQUFJLEdBQUssSUFBSSxDQUFiLElBQUk7O0FBRWpCLGdCQUFJLFdBQVcsR0FBRyxzQ0FBWSxhQUFhLENBQUMsSUFBSSxDQUFDLENBQUM7QUFDbEQsZ0JBQUksT0FBTyxHQUFHLGVBQWUsQ0FBQyxLQUFLLEVBQUUsS0FBSyxDQUFDLE1BQU0sRUFBRSxXQUFXLEVBQUUsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDO0FBQzFFL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lhbGl6ZWRTdGF0ZW1lbnRbXSwgcHJpdmF0ZSBzeW1ib2xUYWJsZTogU3ltYm9sVGFibGUsIHByaXZhdGUgc2Nhbm5lcjogQmxvY2tTY2FubmVyKSB7fVxuXG4gIG5leHQoKTogU3RhdGVtZW50U3ludGF4IHtcbiAgICBsZXQgbGFzdCA9IHRoaXMubGFzdDtcbiAgICBpZiAobGFzdCkge1xuICAgICAgdGhpcy5sYXN0ID0gbnVsbDtcbiAgICAgIHJldHVybiBsYXN0O1xuICAgIH0gZWxzZSBpZiAodGhpcy5jdXJyZW50ID09PSB0aGlzLnN0YXRlbWVudHMubGVuZ3RoKSB7XG4gICAgICByZXR1cm4gbnVsbDtcbiAgICB9XG5cbiAgICBsZXQgc2V4cCA9IHRoaXMuc3RhdGVtZW50c1t0aGlzLmN1cnJlbnQrK107XG4gICAgcmV0dXJuIGJ1aWxkU3RhdGVtZW50KHNleHAsIHRoaXMuc3ltYm9sVGFibGUsIHRoaXMuc2Nhbm5lcik7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/symbol-table', ['exports', 'glimmer-util'], function (exports, _glimmerUtil) { 'use strict'; @@ -51288,7 +51181,7 @@ enifed('glimmer-runtime/lib/symbol-table', ['exports', 'glimmer-util'], function exports.default = SymbolTable; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ltYm9sLXRhYmxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQUdBLFdBQUE7QUFvQkUsaUJBcEJGLFdBQUEsQ0FvQnNCLE1BQW1CLEVBQW1DO2dCQUF6QixJQUFJLHlEQUFpQixJQUFJOztBQUF0RCxnQkFBQSxDQUFBLE1BQU0sR0FBTixNQUFNLENBQWE7QUFBVSxnQkFBQSxDQUFBLElBQUksR0FBSixJQUFJLENBQXFCO0FBTmxFLGdCQUFBLENBQUEsTUFBTSxHQUFHLGFBak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xzLCBwYXJlbnQgfSA9IHRoaXM7XG5cbiAgICBsZXQgc3ltYm9sID0gbG9jYWxzW25hbWVdO1xuXG4gICAgaWYgKCFzeW1ib2wgJiYgcGFyZW50KSB7XG4gICAgICBzeW1ib2wgPSBwYXJlbnQuZ2V0TG9jYWwobmFtZSk7XG4gICAgfVxuXG4gICAgcmV0dXJuIHN5bWJvbDtcbiAgfVxuXG4gIGdldFBhcnRpYWxBcmdzKCk6IG51bWJlciB7XG4gICAgcmV0dXJuIHRoaXMudG9wLnBhcnRpYWxBcmdzO1xuICB9XG5cbiAgaXNUb3AoKTogYm9vbGVhbiB7XG4gICAgcmV0dXJuIHRoaXMudG9wID09PSB0aGlzO1xuICB9XG59XG4iXX0= + enifed("glimmer-runtime/lib/syntax", ["exports"], function (exports) { "use strict"; @@ -51365,7 +51258,7 @@ enifed("glimmer-runtime/lib/syntax", ["exports"], function (exports) { return value && value[ATTRIBUTE] === true; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O1FBbUJBLFNBQUE7QUFBQSxpQkFBQSxTQUFBLEdBQUE7QUFNUyxnQkFBQSxDQUFBLElBQUksR0FBYyxJQUFJLENBQUM7QUFDdkIsZ0JBQUEsQ0FBQSxJQUFJLEdBQWMsSUFBSSxDQUFDO1NBYS9COztBQXBCRCxpQkFBQSxDQUNTLFFBQVEsR0FBQSxrQkFBZ0MsSUFBTyxFQUFFLFdBQXdCLEVBQUUsT0FBc0IsRUFBQTtBQUN0RyxrQkFBTSxJQUFJLEtBQUssd0NBQXNDLElBQUksQ0FBRyxDQUFDO1NBQzlEOztBQUhILGlCQUFBLFdBU0UsS0FBSyxHQUFBLGlCQUFBOzs7QUFHSCxtQkFBTyxJQUF1QixJQUFJLENBQUMsV0FBWSxDQUFDLElBQUksQ0FBQyxDQUF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ZW1lbnQpOiB2YWx1ZSBpcyBBdHRyaWJ1dGU8YW55PiB7XG4gIHJldHVybiB2YWx1ZSAmJiB2YWx1ZVtBVFRSSUJVVEVdID09PSB0cnVlO1xufVxuIl19 + enifed('glimmer-runtime/lib/syntax/builtins/each', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; @@ -51428,7 +51321,7 @@ enifed('glimmer-runtime/lib/syntax/builtins/each', ['exports', 'glimmer-runtime/ exports.default = EachSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL2VhY2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBVUEsVUFBQTs4QkFBQSxVQUFBOztBQUdFLGlCQUhGLFVBQUEsQ0FHcUIsSUFBaUIsRUFBQTtBQUNsQyx1Q0FBTyxDQUFDO0FBRFMsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFhO0FBRnBDLGdCQUFBLENBQUEsSUFBSSxHQUFHLGdCQUFnQixDQUFDO1NBSXZCOztBQUxILGtCQUFBLFdBT0UsT0FBTyxHQUFBLGlCQUFDLEdBQXFCLEVBQUUsR0FBZ0IsRUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O2dCQXlCdkMsSUFBSSxHQUF1QixJQUFJLENBQS9CLElBQUk7Z0JBQVUsTUFBTSxHQUFPLElBQUksQ0FBekIsSUFBSSxDQUFJLE1BQU07O0FBRTFCLGVBQUcsQ0FBQyxLQUFLLENBQUMsSUFBSSxFQUFFLFVBQUMsR0FBRyxFQUFFLEtBQUssRUFBRSxHQUFHLEVBQUE7QUFDOUIsbUJBQUcsQ0FBQyxXQUFXLEVBQUUsQ0FBQztBQUVsQixvQkFBSSxNQUFNLENBQUMsT0FBTyxFQUFFO0FBQ2xCLHVCQUFHLENBQ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ImVhY2gtc3RhdGVtZW50XCI7XG5cbiAgY29uc3RydWN0b3IocHVibGljIGFyZ3M6IFN5bnRheC5BcmdzKSB7XG4gICAgc3VwZXIoKTtcbiAgfVxuXG4gIGNvbXBpbGUoZHNsOiBPcGNvZGVCdWlsZGVyRFNMLCBlbnY6IEVudmlyb25tZW50KSB7XG4gICAgLy8gICAgICAgICBFbnRlcihCRUdJTiwgRU5EKVxuICAgIC8vIEJFR0lOOiAgTm9vcFxuICAgIC8vICAgICAgICAgUHV0QXJnc1xuICAgIC8vICAgICAgICAgUHV0SXRlcmFibGVcbiAgICAvLyAgICAgICAgIEp1bXBVbmxlc3MoRUxTRSlcbiAgICAvLyAgICAgICAgIEVudGVyTGlzdChCRUdJTjIsIEVORDIpXG4gICAgLy8gSVRFUjogICBOb29wXG4gICAgLy8gICAgICAgICBOZXh0SXRlcihCUkVBSylcbiAgICAvLyAgICAgICAgIEVudGVyV2l0aEtleShCRUdJTjIsIEVORDIpXG4gICAgLy8gQkVHSU4yOiBOb29wXG4gICAgLy8gICAgICAgICBQdXNoQ2hpbGRTY29wZVxuICAgIC8vICAgICAgICAgRXZhbHVhdGUoZGVmYXVsdClcbiAgICAvLyAgICAgICAgIFBvcFNjb3BlXG4gICAgLy8gRU5EMjogICBOb29wXG4gICAgLy8gICAgICAgICBFeGl0XG4gICAgLy8gICAgICAgICBKdW1wKElURVIpXG4gICAgLy8gQlJFQUs6ICBOb29wXG4gICAgLy8gICAgICAgICBFeGl0TGlzdFxuICAgIC8vICAgICAgICAgSnVtcChFTkQpXG4gICAgLy8gRUxTRTogICBOb29wXG4gICAgLy8gICAgICAgICBFdmFsdWxhdGUoaW52ZXJzZSlcbiAgICAvLyBFTkQ6ICAgIE5vb3BcbiAgICAvLyAgICAgICAgIEV4aXRcblxuICAgIGxldCB7IGFyZ3MsIGFyZ3M6IHsgYmxvY2tzIH0gfSA9IHRoaXM7XG5cbiAgICBkc2wuYmxvY2soYXJncywgKGRzbCwgQkVHSU4sIEVORCkgPT4ge1xuICAgICAgZHNsLnB1dEl0ZXJhdG9yKCk7XG5cbiAgICAgIGlmIChibG9ja3MuaW52ZXJzZSkge1xuICAgICAgICBkc2wuanVtcFVubGVzcygnRUxTRScpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgZHNsLmp1bXBVbmxlc3MoRU5EKTtcbiAgICAgIH1cblxuICAgICAgZHNsLml0ZXIoKGRzbCwgQkVHSU4sIEVORCkgPT4ge1xuICAgICAgICBkc2wuZXZhbHVhdGUoJ2RlZmF1bHQnLCBibG9ja3MuZGVmYXVsdCk7XG4gICAgICB9KTtcblxuICAgICAgaWYgKGJsb2Nrcy5pbnZlcnNlKSB7XG4gICAgICAgIGRzbC5qdW1wKEVORCk7XG4gICAgICAgIGRzbC5sYWJlbCgnRUxTRScpO1xuICAgICAgICBkc2wuZXZhbHVhdGUoJ2ludmVyc2UnLCBibG9ja3MuaW52ZXJzZSk7XG4gICAgICB9XG4gICAgfSk7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/syntax/builtins/if', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; @@ -51477,7 +51370,7 @@ enifed('glimmer-runtime/lib/syntax/builtins/if', ['exports', 'glimmer-runtime/li exports.default = IfSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL2lmLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQVFBLFFBQUE7OEJBQUEsUUFBQTs7QUFHRSxpQkFIRixRQUFBLENBR3FCLElBQWlCLEVBQUE7QUFDbEMsdUNBQU8sQ0FBQztBQURTLGdCQUFBLENBQUEsSUFBSSxHQUFKLElBQUksQ0FBYTtBQUZwQyxnQkFBQSxDQUFBLElBQUksR0FBRyxjQUFjLENBQUM7U0FJckI7O0FBTEgsZ0JBQUEs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ICAgIGRzbC5qdW1wVW5sZXNzKCdFTFNFJyk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgICAgZHNsLmp1bXAoRU5EKTtcbiAgICAgICAgZHNsLmxhYmVsKCdFTFNFJyk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnaW52ZXJzZScsIGJsb2Nrcy5pbnZlcnNlKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGRzbC5qdW1wVW5sZXNzKEVORCk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgIH1cbiAgICB9KTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/syntax/builtins/in-element', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; @@ -51509,7 +51402,7 @@ enifed('glimmer-runtime/lib/syntax/builtins/in-element', ['exports', 'glimmer-ru exports.default = InElementSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL2luLWVsZW1lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBUUEsZUFBQTs4QkFBQSxlQUFBOztBQUdFLGlCQUhGLGVBQUEsQ0FHc0IsSUFBaUIsRUFBQTtBQUNuQyx1Q0FBTyxDQUFDO0FBRFUsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFhO0FBRnJDLGdCQUFBLENBQUEsSUFBSSxHQUFHLHNCQUFzQixDQUFDO1NBSTdCOztBQUxILHVCQUFBLFdBT0UsT0FBTyxHQUFBLGlCQUFDLEdBQXFCLEVBQUUsR0FBZ0IsRUFBQTtnQkFDdkMsSUFBSSxHQUF1QixJQUFJLENBQS9CLElBQUk7Z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G9yKHByaXZhdGUgYXJnczogU3ludGF4LkFyZ3MpIHtcbiAgICBzdXBlcigpO1xuICB9XG5cbiAgY29tcGlsZShkc2w6IE9wY29kZUJ1aWxkZXJEU0wsIGVudjogRW52aXJvbm1lbnQpIHtcbiAgICBsZXQgeyBhcmdzLCBhcmdzOiB7IGJsb2NrcyB9IH0gPSB0aGlzO1xuXG4gICAgZHNsLnB1dEFyZ3MoYXJncyk7XG4gICAgZHNsLnRlc3QoJ3NpbXBsZScpO1xuXG4gICAgZHNsLmJsb2NrKG51bGwsIChkc2wsIEJFR0lOLCBFTkQpID0+IHtcbiAgICAgIGRzbC5qdW1wVW5sZXNzKEVORCk7XG4gICAgICBkc2wucHVzaFJlbW90ZUVsZW1lbnQoKTtcbiAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgIGRzbC5wb3BSZW1vdGVFbGVtZW50KCk7XG4gICAgfSk7XG4gIH1cbn1cbiJdfQ== + enifed("glimmer-runtime/lib/syntax/builtins/partial", ["exports", "glimmer-runtime/lib/syntax"], function (exports, _glimmerRuntimeLibSyntax) { "use strict"; @@ -51567,7 +51460,7 @@ enifed("glimmer-runtime/lib/syntax/builtins/partial", ["exports", "glimmer-runti exports.DynamicPartialSyntax = DynamicPartialSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL3BhcnRpYWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBY0EsbUJBQUE7OEJBQUEsbUJBQUE7O0FBR0UsaUJBSEYsbUJBQUEsQ0FHc0IsSUFBdUIsRUFBQTtBQUN6Qyx1Q0FBTyxDQUFDO0FBRFUsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFtQjtBQUZwQyxnQkFBQSxDQUFBLElBQUksR0FBRyx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5lbnRlcignQkVHSU4nLCAnRU5EJyk7XG4gICAgZHNsLmxhYmVsKCdCRUdJTicpO1xuICAgIGRzbC5qdW1wVW5sZXNzKCdFTkQnKTtcbiAgICBkc2wucHV0RHluYW1pY1BhcnRpYWxEZWZpbml0aW9uKCk7XG4gICAgZHNsLmV2YWx1YXRlUGFydGlhbCgpO1xuICAgIGRzbC5sYWJlbCgnRU5EJyk7XG4gICAgZHNsLmV4aXQoKTtcblxuICAgIGRzbC5zdG9wTGFiZWxzKCk7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/syntax/builtins/unless', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; @@ -51616,7 +51509,7 @@ enifed('glimmer-runtime/lib/syntax/builtins/unless', ['exports', 'glimmer-runtim exports.default = UnlessSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL3VubGVzcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFVQSxZQUFBOzhCQUFBLFlBQUE7O0FBR0UsaUJBSEYsWUFBQSxDQUdxQixJQUFpQixFQUFBO0FBQ2xDLHVDQUFPLENBQUM7QUFEUyxnQkFBQSxDQUFBLElBQUksR0FBSixJQUFJLENBQWE7QUFGcEMsZ0JBQUEsQ0FBQSxJQUFJLEdBQUcsa0JBQWtCLENBQUM7U0FJekI7O0FBTEgsb0JBQUEsV0FPRSxPQUFPLEdBQUEsaUJBQUMsR0FBcUIsRUFBRSxHQUFnQixFQUFBOzs7Ozs7Ozs7Ozs7Z0JBYXZDLElBQUksR0FBdUIsSUFBSSxDQUEvQixJQUFJO2dCQUFVLE1BQU0sR0FBTyxJQUFJLENBQXpCLElBQUksQ0FBSSxNQUFNOztBQUUxQixlQUFHLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDO0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AgZHNsLmV2YWx1YXRlKCdpbnZlcnNlJywgYmxvY2tzLmludmVyc2UpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgZHNsLmp1bXBJZignRU5EJyk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgIH1cbiAgICB9KTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/syntax/builtins/with-dynamic-vars', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; @@ -51647,7 +51540,7 @@ enifed('glimmer-runtime/lib/syntax/builtins/with-dynamic-vars', ['exports', 'gli exports.default = WithDynamicVarsSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL3dpdGgtZHluYW1pYy12YXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQVFBLHFCQUFBOzhCQUFBLHFCQUFBOztBQUdFLGlCQUhGLHFCQUFBLENBR3NCLElBQWlCLEVBQUE7QUFDbkMsdUNBQU8sQ0FBQztBQURVLGdCQUFBLENBQUEsSUFBSSxHQUFKLElBQUksQ0FBYTtBQUZyQyxnQkFBQSxDQUFBLElBQUksR0FBRyw2QkFBNkIsQ0FBQztTQUlwQzs7QUFMSCw2QkFBQSxXQU9FLE9BQU8sR0FBQSxpQkFBQyxHQUFxQixFQUFFLEdBQWdCLEVBQUE7Z0JBQ3ZDLElBQUksR0FBdUIsSUFBSSxDQUEvQixJQUFJO2dCQUFVLE1BQU0sR0FBTyxJQUFJLENBQXpCLElBQUksQ0FBSSxNQUFNOztBQUUxQixlQUFHLENBQUMsSUFBSSxDQUFDLFVBQUEsR0FBRyxFQUFBO0FBQ1YsbUJBQUcsQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUM7QUFDb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c2wgPT4ge1xuICAgICAgZHNsLnB1dEFyZ3MoYXJncyk7XG4gICAgICBkc2wucHVzaER5bmFtaWNTY29wZSgpO1xuICAgICAgZHNsLmJpbmREeW5hbWljU2NvcGUoYXJncy5uYW1lZC5rZXlzKTtcbiAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgIGRzbC5wb3BEeW5hbWljU2NvcGUoKTtcbiAgICB9KTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/syntax/builtins/with', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; @@ -51696,7 +51589,7 @@ enifed('glimmer-runtime/lib/syntax/builtins/with', ['exports', 'glimmer-runtime/ exports.default = WithSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL3dpdGgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBU0EsVUFBQTs4QkFBQSxVQUFBOztBQUdFLGlCQUhGLFVBQUEsQ0FHcUIsSUFBaUIsRUFBQTtBQUNsQyx1Q0FBTyxDQUFDO0FBRFMsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFhO0FBRnBDLGdCQUFBLENBQUEsSUFBSSxHQUFHLGdCQUFnQixDQUFDO1NBSXZCOztBQUxILGtCQUFBLFdBT0UsT0FBTyxHQUFBLGlCQUFDLEdBQXFCLEVBQUUsR0FBZ0IsRUFBQTs7Ozs7Ozs7Ozs7O2dCQWF2QyxJQUFJLEdBQXVCLElBQUksQ0FBL0IsSUFBSTtnQkFBVSxNQUFNLEdBQU8sSUFBSSxDQUF6QixJQUFJLENBQUksTUFBTTs7QUFFMUIsZUFBRyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQztBQUNsQixlQUFH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tcbiAgICAgICAgZHNsLmxhYmVsKCdFTFNFJyk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnaW52ZXJzZScsIGJsb2Nrcy5pbnZlcnNlKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGRzbC5qdW1wVW5sZXNzKEVORCk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgIH1cbiAgICB9KTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/syntax/core', ['exports', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/syntax/builtins/partial', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-runtime/lib/compiled/opcodes/component', 'glimmer-runtime/lib/compiled/opcodes/dom', 'glimmer-runtime/lib/syntax/expressions', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/compiled/expressions/value', 'glimmer-runtime/lib/compiled/expressions/lookups', 'glimmer-runtime/lib/compiled/expressions/has-block', 'glimmer-runtime/lib/compiled/expressions/helper', 'glimmer-runtime/lib/compiled/expressions/concat', 'glimmer-runtime/lib/utils', 'glimmer-runtime/lib/compiled/opcodes/content'], function (exports, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibSyntaxBuiltinsPartial, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerRuntimeLibCompiledOpcodesComponent, _glimmerRuntimeLibCompiledOpcodesDom, _glimmerRuntimeLibSyntaxExpressions, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibCompiledExpressionsValue, _glimmerRuntimeLibCompiledExpressionsLookups, _glimmerRuntimeLibCompiledExpressionsHasBlock, _glimmerRuntimeLibCompiledExpressionsHelper, _glimmerRuntimeLibCompiledExpressionsConcat, _glimmerRuntimeLibUtils, _glimmerRuntimeLibCompiledOpcodesContent) { 'use strict'; @@ -52955,9 +52848,11 @@ enifed('glimmer-runtime/lib/syntax/core', ['exports', 'glimmer-runtime/lib/synta var keys = this.keys; var values = this.values; - return new _glimmerRuntimeLibCompiledExpressionsArgs.CompiledNamedArgs(keys, values.map(function (value) { - return value.compile(compiler, env, symbolTable); - })); + var compiledValues = new Array(values.length); + for (var i = 0; i < compiledValues.length; i++) { + compiledValues[i] = values[i].compile(compiler, env, symbolTable); + } + return new _glimmerRuntimeLibCompiledExpressionsArgs.CompiledNamedArgs(keys, compiledValues); }; return NamedArgs; @@ -53000,7 +52895,7 @@ enifed('glimmer-runtime/lib/syntax/core', ['exports', 'glimmer-runtime/lib/synta return _class4; })(Args))(); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2NvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBMEdBLEtBQUE7OEJBQUEsS0FBQTs7QUFxQkUsaUJBckJGLEtBQUEsQ0FzQlcsSUFBYyxFQUNkLElBQVUsRUFBQTtBQUVqQix1Q0FBTyxDQUFDO0FBSEQsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFVO0FBQ2QsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFNO0FBdEJaLGdCQUFBLENBQUEsSUFBSSxHQUFHLE9BQU8sQ0FBQztTQXlCckI7O0FBMUJILGFBQUEsQ0FHUyxRQUFRLEdBQUEsa0JBQUMsSUFBZ0MsRUFBRSxXQUF3QixFQUFFLE9BQXFCLEVBQUE7Z0JBQ3hGLElBQUksR0FBeUMsSUFBSTtnQkFBM0MsTUFBTSxHQUFpQyxJQUFJO2dCQUFuQyxJQUFJLEdBQTJCLElBQUk7Z0JBQTdCLFVBQVUsR0FBZSxJQUFJO2dCQUFqQixTQUFTLEdBQUksSUFBSTs7QUFFeEQsZ0JBQUksUUFBUSxHQUFHLE9BQU8sQ0FBQyxRQUFRLENB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format'], function (exports, _glimmerRuntimeLibSyntaxCore, _glimmerWireFormat) { 'use strict'; @@ -53029,7 +52924,7 @@ enifed('glimmer-runtime/lib/syntax/expressions', ['exports', 'glimmer-runtime/li ; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2V4cHJlc3Npb25zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQWlCRSxLQUFLLHNCQUxMLFdBQVcsQ0FLWCxLQUFLO1FBQ0wsUUFBUSxzQkFOUixXQUFXLENBTVgsUUFBUTtRQUNSLEtBQUssc0JBUEwsV0FBVyxDQU9YLEtBQUs7UUFDTCxVQUFVLHNCQVJWLFdBQVcsQ0FRWCxVQUFVO1FBQ1YsZ0JBQWdCLHNCQVRoQixXQUFXLENBU1gsZ0JBQWdCO1FBQ2hCLFFBQVEsc0JBVlIsV0FBVyxDQVVYLFFBQVE7UUFDUixTQUFTLHNCQVhULFdBQVcsQ0FXWCxTQUFTO1FBQ1QsZ0JBQWdCLHNCQVpoQixXQUFXLENBWVgsZ0JBQWdCO1FBQ2hCLFdBQVcsc0JBYlgsV0FBVyxDQWFYLFdBQVc7O3NCQUdiLFVBQXdCLElBQTBCLEVBQUE7QUFDaEQsWUFBSSxnQkFBZ0IsQ0FBQyxJQUFJLENBQUMsRUFBRSxPQUFPLDZCQTVCbkMsS0FBSyxDQTRCMEMsUUFBUSxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQzlELFlBQUksV0FBVyxDQUFDLElBQUksQ0FBQyxFQUFFLE9BQU8sNkJBN0I5QixLQUFLLENBNkJxQyxLQUFLLENBQUMsU0FBUyxDQUFDLENBQUM7QUFDM0QsWUFBSSxLQUFLLENBQUMsSUFBSSxDQUFDLEVBQUUsT0FBTyw2QkE3QnhCLFdBQVcsQ0E2QnVCLFFBQVEsQ0FBQyxJQUFJLENBQUMsQ0FBQztBQUNqRCxZQU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25vd24oc2V4cCkpIHJldHVybiBVbmtub3duU3ludGF4LmZyb21TcGVjKHNleHApO1xuICBpZiAoaXNIYXNCbG9jayhzZXhwKSkgcmV0dXJuIEhhc0Jsb2NrU3ludGF4LmZyb21TcGVjKHNleHApO1xuICBpZiAoaXNIYXNCbG9ja1BhcmFtcyhzZXhwKSkgcmV0dXJuIEhhc0Jsb2NrUGFyYW1zU3ludGF4LmZyb21TcGVjKHNleHApO1xuXG4gIHRocm93IG5ldyBFcnJvcihgVW5leHBlY3RlZCB3aXJlIGZvcm1hdDogJHtKU09OLnN0cmluZ2lmeShzZXhwKX1gKTtcbn07XG4iXX0= + enifed('glimmer-runtime/lib/syntax/statements', ['exports', 'glimmer-runtime/lib/syntax/core', 'glimmer-wire-format'], function (exports, _glimmerRuntimeLibSyntaxCore, _glimmerWireFormat) { 'use strict'; @@ -53069,7 +52964,7 @@ enifed('glimmer-runtime/lib/syntax/statements', ['exports', 'glimmer-runtime/lib ; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L3N0YXRlbWVudHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBMkJFLE9BQU8sc0JBTlAsVUFBVSxDQU1WLE9BQU87UUFDUCxPQUFPLHNCQVBQLFVBQVUsQ0FPVixPQUFPO1FBQ1AsU0FBUyxzQkFSVCxVQUFVLENBUVYsU0FBUztRQUNULFFBQVEsc0JBVFIsVUFBVSxDQVNWLFFBQVE7UUFDUixhQUFhLHNCQVZiLFVBQVUsQ0FVVixhQUFhO1FBQ2IsTUFBTSxzQkFYTixVQUFVLENBV1YsTUFBTTtRQUNOLFNBQVMsc0JBWlQsVUFBVSxDQVlWLFNBQVM7UUFDVCxhQUFhLHNCQWJiLFVBQVUsQ0FhVixhQUFhO1FBQ2IsY0FBYyxzQkFkZCxVQUFVLENBY1YsY0FBYztRQUNkLGNBQWMsc0JB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R1cm4gQ2xvc2VFbGVtZW50LmZyb21TcGVjKCk7XG4gIGlmIChpc1N0YXRpY0F0dHIoc2V4cCkpIHJldHVybiBTdGF0aWNBdHRyLmZyb21TcGVjKHNleHApO1xuICBpZiAoaXNTdGF0aWNBcmcoc2V4cCkpIHJldHVybiBTdGF0aWNBcmcuZnJvbVNwZWMoc2V4cCk7XG4gIGlmIChpc01vZGlmaWVyKHNleHApKSByZXR1cm4gTW9kaWZpZXIuZnJvbVNwZWMoc2V4cCk7XG59O1xuIl19 + enifed('glimmer-runtime/lib/template', ['exports', 'glimmer-util', 'glimmer-runtime/lib/builder', 'glimmer-runtime/lib/vm', 'glimmer-runtime/lib/scanner'], function (exports, _glimmerUtil, _glimmerRuntimeLibBuilder, _glimmerRuntimeLibVm, _glimmerRuntimeLibScanner) { 'use strict'; @@ -53120,7 +53015,7 @@ enifed('glimmer-runtime/lib/template', ['exports', 'glimmer-util', 'glimmer-runt return { id: id, meta: meta, _block: block, asEntryPoint: asEntryPoint, asLayout: asLayout, asPartial: asPartial, render: render }; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdGVtcGxhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O3NCQWtGQSxlQUFBOztBQVRBLFFBQUksUUFBUSxHQUFHLENBQUMsQ0FBQzs7QUFTakIsYUFBQSxlQUFBLENBQXdDLElBQXlELEVBQUE7WUFBdkQsRUFBRSxHQUFKLElBQXlELENBQXZELEVBQUU7WUFBRSxJQUFJLEdBQVYsSUFBeUQsQ0FBbkQsSUFBSTtZQUFFLEtBQUssR0FBakIsSUFBeUQsQ0FBN0MsS0FBSzs7QUFDdkQsWUFBSSxXQUFvQyxZQUFBLENBQUM7QUFDekMsWUFBSSxDQUFDLEVBQUUsRUFBRTtBQUNQLGNBQUUsZUFBYSxRQUFRLEVBQUcsQUFBRSxDQUFDO1NBQzlCO0F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AgIHJldHVybiBsYXlvdXQ7XG4gIH07XG4gIGxldCBhc1BhcnRpYWwgPSBzeW1ib2xzID0+IHNjYW5uZXIuc2NhblBhcnRpYWwoc3ltYm9scyk7XG4gIGxldCByZW5kZXIgPSAoc2VsZjogUGF0aFJlZmVyZW5jZTxhbnk+LCBhcHBlbmRUbzogU2ltcGxlLkVsZW1lbnQsIGR5bmFtaWNTY29wZTogRHluYW1pY1Njb3BlKSA9PiB7XG4gICAgbGV0IGVsZW1lbnRTdGFjayA9IEVsZW1lbnRTdGFjay5mb3JJbml0aWFsUmVuZGVyKGVudiwgYXBwZW5kVG8sIG51bGwpO1xuICAgIGxldCBjb21waWxlZCA9IGFzRW50cnlQb2ludCgpLmNvbXBpbGUoZW52KTtcbiAgICBsZXQgdm0gPSBWTS5pbml0aWFsKGVudiwgc2VsZiwgZHluYW1pY1Njb3BlLCBlbGVtZW50U3RhY2ssIGNvbXBpbGVkLnN5bWJvbHMpO1xuICAgIHJldHVybiB2bS5leGVjdXRlKGNvbXBpbGVkLm9wcyk7XG4gIH07XG4gIHJldHVybiB7IGlkLCBtZXRhLCBfYmxvY2s6IGJsb2NrLCBhc0VudHJ5UG9pbnQsIGFzTGF5b3V0LCBhc1BhcnRpYWwsIHJlbmRlciB9O1xufVxuIl19 + enifed('glimmer-runtime/lib/upsert', ['exports', 'glimmer-runtime/lib/bounds'], function (exports, _glimmerRuntimeLibBounds) { 'use strict'; @@ -53288,13 +53183,24 @@ enifed('glimmer-runtime/lib/upsert', ['exports', 'glimmer-runtime/lib/bounds'], return NodeUpsert; })(Upsert); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdXBzZXJ0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQVVBLGFBQUEsWUFBQSxDQUE2QixLQUFhLEVBQUE7QUFDeEMsZUFBTyxLQUFLLElBQUksT0FBT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B9IGVsc2Uge1xuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/utils', ['exports', 'glimmer-util'], function (exports, _glimmerUtil) { 'use strict'; - var EMPTY_ARRAY = Object.freeze([]); + var HAS_NATIVE_WEAKMAP = (function () { + // detect if `WeakMap` is even present + var hasWeakMap = typeof WeakMap === 'function'; + if (!hasWeakMap) { + return false; + } + var instance = new WeakMap(); + // use `Object`'s `.toString` directly to prevent us from detecting + // polyfills as native weakmaps + return Object.prototype.toString.call(instance) === '[object WeakMap]'; + })(); + var EMPTY_ARRAY = HAS_NATIVE_WEAKMAP ? Object.freeze([]) : []; exports.EMPTY_ARRAY = EMPTY_ARRAY; - var EMPTY_DICT = Object.freeze(_glimmerUtil.dict()); + var EMPTY_DICT = HAS_NATIVE_WEAKMAP ? Object.freeze(_glimmerUtil.dict()) : _glimmerUtil.dict(); exports.EMPTY_DICT = EMPTY_DICT; var ListRange = (function () { @@ -53322,7 +53228,7 @@ enifed('glimmer-runtime/lib/utils', ['exports', 'glimmer-util'], function (expor exports.ListRange = ListRange; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBRU8sUUFBTSxXQUFXLEdBQUcsTUFBTSxDQUFDLE1BQU0sQ0FBQyxFQUFFLENBQUMsQ0FBQzs7QUFDdEMsUUFBTSxVQUFVLEdBQWMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxhQUhwQyxJQUFJLEVBRzJDLENBQUMsQ0FBQzs7O1FBb0JoRSxTQUFBO0FBT0UsaUJBUEYsU0FBQSxDQU9jLElBQVMsRUFBRSxLQUFhLEVBQUUsR0FBVyxFQUFBO0FBQy9DLGdCQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQztBQUNqQixnQkFBSSxDQUF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SYW5nZTxUPiB7XG4gIG1pbigpOiBudW1iZXI7XG4gIG1heCgpOiBudW1iZXI7XG4gIGF0KGluZGV4OiBudW1iZXIpOiBUO1xufVxuXG5leHBvcnQgY2xhc3MgTGlzdFJhbmdlPFQ+IGltcGxlbWVudHMgUmFuZ2U8VD4ge1xuICBwcml2YXRlIGxpc3Q6IFRbXTtcblxuICAvLyBbc3RhcnQsIGVuZF1cbiAgcHJpdmF0ZSBzdGFydDogbnVtYmVyO1xuICBwcml2YXRlIGVuZDogbnVtYmVyO1xuXG4gIGNvbnN0cnVjdG9yKGxpc3Q6IFRbXSwgc3RhcnQ6IG51bWJlciwgZW5kOiBudW1iZXIpIHtcbiAgICB0aGlzLmxpc3QgPSBsaXN0O1xuICAgIHRoaXMuc3RhcnQgPSBzdGFydDtcbiAgICB0aGlzLmVuZCA9IGVuZDtcbiAgfVxuXG4gIGF0KGluZGV4OiBudW1iZXIpOiBUIHtcbiAgICBpZiAoaW5kZXggPj0gdGhpcy5saXN0Lmxlbmd0aCkgcmV0dXJuIG51bGw7XG4gICAgcmV0dXJuIHRoaXMubGlzdFtpbmRleF07XG4gIH1cblxuICBtaW4oKTogbnVtYmVyIHtcbiAgICByZXR1cm4gdGhpcy5zdGFydDtcbiAgfVxuXG4gIG1heCgpOiBudW1iZXIge1xuICAgIHJldHVybiB0aGlzLmVuZDtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/vm', ['exports', 'glimmer-runtime/lib/vm/append', 'glimmer-runtime/lib/vm/update', 'glimmer-runtime/lib/vm/render-result'], function (exports, _glimmerRuntimeLibVmAppend, _glimmerRuntimeLibVmUpdate, _glimmerRuntimeLibVmRenderResult) { 'use strict'; @@ -53331,7 +53237,7 @@ enifed('glimmer-runtime/lib/vm', ['exports', 'glimmer-runtime/lib/vm/append', 'g exports.UpdatingVM = _glimmerRuntimeLibVmUpdate.default; exports.RenderResult = _glimmerRuntimeLibVmRenderResult.default; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1VBQW9CLEVBQUUsOEJBQWIsT0FBTztVQUFRLFFBQVEsOEJBQVIsUUFBUTtVQUNaLFVBQVUsOEJBQXJCLE9BQU87VUFDSSxZQUFZLG9DQUF2QixPQUFPIiwiZmlsZSI6InZtLmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgZGVmYXVsdCBhcyBWTSwgUHVibGljVk0gfSBmcm9tICcuL3ZtL2FwcGVuZCc7XG5leHBvcnQgeyBkZWZhdWx0IGFzIFVwZGF0aW5nVk0gfSBmcm9tICcuL3ZtL3VwZGF0ZSc7XG5leHBvcnQgeyBkZWZhdWx0IGFzIFJlbmRlclJlc3VsdCB9IGZyb20gJy4vdm0vcmVuZGVyLXJlc3VsdCc7XG4iXX0= + enifed('glimmer-runtime/lib/vm/append', ['exports', 'glimmer-runtime/lib/environment', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-runtime/lib/vm/update', 'glimmer-runtime/lib/vm/render-result', 'glimmer-runtime/lib/vm/frame'], function (exports, _glimmerRuntimeLibEnvironment, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerRuntimeLibVmUpdate, _glimmerRuntimeLibVmRenderResult, _glimmerRuntimeLibVmFrame) { 'use strict'; @@ -53636,7 +53542,7 @@ enifed('glimmer-runtime/lib/vm/append', ['exports', 'glimmer-runtime/lib/environ exports.default = VM; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0vYXBwZW5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQXlCQSxFQUFBO0FBbUJFLGlCQW5CRixFQUFBLENBb0JXLEdBQWdCLEVBQ3ZCLE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xuaW50ZXJmYWNlIEV4Y2VwdGlvbkhhbmRsZXIge1xuICBoYW5kbGVFeGNlcHRpb24oaW5pdGlhbGl6ZT86ICh2bTogVk0pID0+IHZvaWQpO1xufVxuXG5pbnRlcmZhY2UgUmV0dXJuSGFuZGxlciB7XG4gIHNldFJlbmRlclJlc3VsdChyZW5kZXJSZXN1bHQ6IFJlbmRlclJlc3VsdCk7XG59XG4iXX0= + enifed('glimmer-runtime/lib/vm/frame', ['exports'], function (exports) { 'use strict'; @@ -53830,7 +53736,7 @@ enifed('glimmer-runtime/lib/vm/frame', ['exports'], function (exports) { exports.FrameStack = FrameStack; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0vZnJhbWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBUUEsYUFBQSxHQUNFLFNBREYsYUFBQSxDQUVZLE9BQTJCLEVBQzNCLElBQW1CLEVBQ25CLFNBQTZCLEVBQUE7QUFGN0IsWUFBQSxDQUFBLE9BQU8sR0FBUCxPQUFPLENBQW9CO0FBQzNCLFlBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFlO0FBQ25CLFlBQUEsQ0FBQSxTQUFTLEdBQVQsU0FBUyxDQUFvQjtLQUNuQzs7OztRQUdOLEtBQUE7QUFZRSxpQkFaRixLQUFBLENBYUksR0FBVSxFQUdvQjtnQkFGdkIsU0FBUyx5REFBYyxJQUFJO2dCQUMzQixPQUFPLHlEQUFnQyxJQUFJO2dCQUMzQyxNQUFNLHlEQUFhLElBQUk7O0FBRnZCLGdCQUFBLENBQUEsU0FBUyxHQUFULFNBQVMsQ0FBa0I7QUFDM0IsZ0JBQUEsQ0FBQSxPQUFPLEdBQVAsT0FBTyxDQUFvQztBQUMzQyxnQkFBQSxDQUFBLE1BQU0sR0FBTixNQUFNLENBQWlCO0FBYmhDLGdCQUFBLENBQUEsT0FBTyxHQU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ge1xuICAgICAgdGhpcy5wb3AoKTtcbiAgICAgIHJldHVybiBudWxsO1xuICAgIH1cbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/vm/render-result', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/vm/update'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibVmUpdate) { 'use strict'; @@ -53883,7 +53789,7 @@ enifed('glimmer-runtime/lib/vm/render-result', ['exports', 'glimmer-runtime/lib/ exports.default = RenderResult; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0vcmVuZGVyLXJlc3VsdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFPQSxZQUFBO0FBQ0UsaUJBREYsWUFBQSxDQUVZLEdBQWdCLEVBQ2hCLFFBQW9DLEVBQ3BDLE1BQXlCLEVBQUE7QUFGekIsZ0JBQUEsQ0FBQSxHQUFHLEdBQUgsR0FBRyxDQUFhO0FBQ2hCLGdCQUFBLENBQUEsUUFBUSxHQUFSLFFBQVEsQ0FBNEI7QUFDcEMsZ0JBQUEsQ0FBQSxNQUFNLEdBQU4sTUFBTSxDQUFtQjtTQUMvQjs7QUFMTixvQkFBQSxXQU9FLFFBQVEsR0FBQSxvQkFBMkQ7NkVBQTNCLEVBQUUsZ0JBQWdCLEVBQUUsS0FBSyxFQUFFOzs2Q0FBeEQsZ0JBQWdCO2dCQUFoQixnQkFBZ0IseUNBQUcsS0FBSztnQkFDM0IsR0FBRyxHQUFlLElBQUksQ0FBdEIsR0FBRztnQkFBRSxRQUFRLEdBQUssSUFBSSxDQUFqQixRQUFROztBQUNuQixnQkFBSSxFQUFFLEdBQUcsdUNBQWUsR0FBRyxFQUFFLEVBQUUsZ0JBQWdCLEVBQWhCLGdCQUFnQixFQUFFLENBQUMsQ0FBQztBQUNuRCxjQUFFLENBQUMsT0FBTyxDQUFDLFFBQVEsRU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wY29kZXMoKTogTGlua2VkTGlzdDxVcGRhdGluZ09wY29kZT4ge1xuICAgIHJldHVybiB0aGlzLnVwZGF0aW5nO1xuICB9XG5cbiAgaGFuZGxlRXhjZXB0aW9uKCkge1xuICAgIHRocm93IFwidGhpcyBzaG91bGQgbmV2ZXIgaGFwcGVuXCI7XG4gIH1cblxuICBkZXN0cm95KCkge1xuICAgIHRoaXMuYm91bmRzLmRlc3Ryb3koKTtcbiAgICBjbGVhcih0aGlzLmJvdW5kcyk7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/vm/update', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/builder', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/vm/append'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibBuilder, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibVmAppend) { 'use strict'; @@ -54217,7 +54123,7 @@ enifed('glimmer-runtime/lib/vm/update', ['exports', 'glimmer-runtime/lib/bounds' return UpdatingVMFrame; })(); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0vdXBkYXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQTRCQSxVQUFBO0FBTUUsaUJBTkYsVUFBQSxDQU1jLEdBQWdCLEVBQUUsSUFBNEIsRUFBQTt3Q0FBNUIsSUFBNEIsQ0FBMUIsZ0JBQWdCO2dCQUFoQixnQkFBZ0IseUNBQUcsS0FBSzs7QUFGaEQsZ0JBQUEsQ0FBQSxVQUFVLEdBQTJCLGlCQTdCdEIsS0FBSyxFQTZCNkMsQ0FBQztBQUd4RSxnQkFBSSxDQUFDLEdBQUcsR0FBRyxHQUFHLENBQUM7QUFD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gaWYgKGN1cnJlbnQpIHRoaXMuY3VycmVudCA9IG9wcy5uZXh0Tm9kZShjdXJyZW50KTtcbiAgICByZXR1cm4gY3VycmVudDtcbiAgfVxuXG4gIGhhbmRsZUV4Y2VwdGlvbigpIHtcbiAgICB0aGlzLmV4Y2VwdGlvbkhhbmRsZXIuaGFuZGxlRXhjZXB0aW9uKCk7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-util/index', ['exports', 'glimmer-util/lib/namespaces', 'glimmer-util/lib/platform-utils', 'glimmer-util/lib/assert', 'glimmer-util/lib/logger', 'glimmer-util/lib/object-utils', 'glimmer-util/lib/guid', 'glimmer-util/lib/collections', 'glimmer-util/lib/list-utils'], function (exports, _glimmerUtilLibNamespaces, _glimmerUtilLibPlatformUtils, _glimmerUtilLibAssert, _glimmerUtilLibLogger, _glimmerUtilLibObjectUtils, _glimmerUtilLibGuid, _glimmerUtilLibCollections, _glimmerUtilLibListUtils) { 'use strict'; @@ -54246,7 +54152,7 @@ enifed('glimmer-util/index', ['exports', 'glimmer-util/lib/namespaces', 'glimmer exports.ListSlice = _glimmerUtilLibListUtils.ListSlice; exports.Slice = _glimmerUtilLibListUtils.Slice; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7VUFJUyxnQkFBZ0IsNkJBQWhCLGdCQUFnQjtVQUNoQixNQUFNLGdDQUFOLE1BQU07VUFBRSxLQUFLLGdDQUFMLEtBQUs7VUFBRSxNQUFNLGdDQUFOLE1BQU07VUFDVixNQUFNLHlCQUFqQixPQUFPO1VBQ0ksTUFBTSx5QkFBakIsT0FBTztVQUFZLE1BQU0seUJBQU4sTUFBTTtVQUFFLFFBQVEseUJBQVIsUUFBUTtVQUVuQyxNQUFNLDhCQUFOLE1BQU07VUFDTixVQUFVLHVCQUFWLFVBQVU7VUFBRSxjQUFjL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xlY3Rpb25zJztcbmV4cG9ydCB7IEVNUFRZX1NMSUNFLCBMaW5rZWRMaXN0LCBMaW5rZWRMaXN0Tm9kZSwgTGlzdE5vZGUsIENsb25lYWJsZUxpc3ROb2RlLCBMaXN0U2xpY2UsIFNsaWNlIH0gZnJvbSAnLi9saWIvbGlzdC11dGlscyc7XG5cbmV4cG9ydCB0eXBlIEZJWE1FPFQsIHN0cmluZz4gPSBUO1xuIl19 + enifed("glimmer-util/lib/assert", ["exports"], function (exports) { // import Logger from './logger'; // let alreadyWarned = false; @@ -54269,7 +54175,7 @@ enifed("glimmer-util/lib/assert", ["exports"], function (exports) { exports.default = debugAssert; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvYXNzZXJ0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O0FBSUEsYUFBQSxXQUFBLENBQTRCLElBQUksRUFBRSxHQUFHLEVBQUE7Ozs7O0FBTW5DLFlBQUksQ0FBQyxJQUFJLEVBQUU7QUFDVCxrQkFBTSxJQUFJLEtBQUssQ0FBQyxHQUFHLElBQUksbUJBQW1CLENBQUMsQ0FBQztTQUM3QztLQUNGOztBQUVELGFBQUEsVUFBQSxHQUFBLEVBQStCOztzQkFFaEIsV0FBVyIsImZpbGUiOiJhc3NlcnQuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBpbXBvcnQgTG9nZ2VyIGZyb20gJy4vbG9nZ2VyJztcblxuLy8gbGV0IGFscmVhZHlXYXJuZWQgPSBmYWxzZTtcblxuZXhwb3J0IGZ1bmN0aW9uIGRlYnVnQXNzZXJ0KHRlc3QsIG1zZykge1xuICAvLyBpZiAoIWFscmVhZHlXYXJuZWQpIHtcbiAgLy8gICBhbHJlYWR5V2FybmVkID0gdHJ1ZTtcbiAgLy8gICBMb2dnZXIud2FybihcIkRvbid0IGxlYXZlIGRlYnVnIGFzc2VydGlvbnMgb24gaW4gcHVibGljIGJ1aWxkc1wiKTtcbiAgLy8gfVxuXG4gIGlmICghdGVzdCkge1xuICAgIHRocm93IG5ldyBFcnJvcihtc2cgfHwgXCJhc3NlcnRpb24gZmFpbHVyZVwiKTtcbiAgfVxufVxuXG5leHBvcnQgZnVuY3Rpb24gcHJvZEFzc2VydCgpIHt9XG5cbmV4cG9ydCBkZWZhdWx0IGRlYnVnQXNzZXJ0O1xuIl19 + enifed('glimmer-util/lib/collections', ['exports', 'glimmer-util/lib/guid'], function (exports, _glimmerUtilLibGuid) { 'use strict'; @@ -54353,7 +54259,7 @@ enifed('glimmer-util/lib/collections', ['exports', 'glimmer-util/lib/guid'], fun exports.Stack = Stack; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvY29sbGVjdGlvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFZQSxRQUFJLEtBQUssR0FBRyxNQUFNLENBQUMsTUFBTSxDQUFDLElBQUksRUFBRTs7O0FBRzlCLG1CQUFXLEVBQUU7QUFDWCxpQkFBSyxFQUFFLFNBQVM7QUFDaEIsc0JBQVUsRUFBRSxLQUFLO0FBQ2pCLG9CQUFRLEVBQUUsSUFBSTtTQUNmO0tBQ0YsQ0FBQyxDQUFDO0FBRUgsYUFBQSxXQUFBLEdBQUEsRUFBeUI7QUFDekIsZUFBVyxDQUFDLFNBQVMsR0FBRyxLQUFLLENBQUM7O0FBRTlCLGFBQUEsSUFBQSxHQUFBOzs7OztBQUtFLGVBQU8sSUFBSSxXQUFXLEVBQUUsQ0FBQztLQUMxQjs7UUFJRCxPQUFBO0FBR0UsaUJBSEYsT0FBQSxHQUdFO0FBQ0UsZ0JBQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxFQUFLLENBQUM7U0FDdkI7O0FBTEgsZUFBQSxXQU9FLEdBQUcsR0FBQSxhQUFDLEdBQU0sR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54369,7 +54275,7 @@ enifed("glimmer-util/lib/guid", ["exports"], function (exports) { return object._guid || initializeGuid(object); } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvZ3VpZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLFFBQUksSUFBSSxHQUFHLENBQUMsQ0FBQzs7QUFNYixhQUFBLGNBQUEsQ0FBK0IsTUFBZSxFQUFBO0FBQzVDLGVBQVEsTUFBTSxDQUFDLEtBQUssR0FBRyxFQUFFLElBQUksQ0FBRTtLQUNoQzs7QUFFRCxhQUFBLFVBQUEsQ0FBMkIsTUFBZSxFQUFBO0FBQ3hDLGVBQU8sTUFBTSxDQUFDLEtBQUssSUFBSSxjQUFjLENBQUMsTUFBTSxDQUFDLENBQUM7S0FDL0MiLCJmaWxlIjoiZ3VpZC5qcyIsInNvdXJjZXNDb250ZW50IjpbImxldCBHVUlEID0gMDtcblxuZXhwb3J0IGludGVyZmFjZSBIYXNHdWlkIHtcbiAgX2d1aWQ6IG51bWJlcjtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGluaXRpYWxpemVHdWlkKG9iamVjdDogSGFzR3VpZCk6IG51bWJlciB7XG4gIHJldHVybiAob2JqZWN0Ll9ndWlkID0gKytHVUlEKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGVuc3VyZUd1aWQob2JqZWN0OiBIYXNHdWlkKTogbnVtYmVyIHtcbiAgcmV0dXJuIG9iamVjdC5fZ3VpZCB8fCBpbml0aWFsaXplR3VpZChvYmplY3QpO1xufSJdfQ== + enifed("glimmer-util/lib/list-utils", ["exports"], function (exports) { "use strict"; @@ -54593,7 +54499,7 @@ enifed("glimmer-util/lib/list-utils", ["exports"], function (exports) { var EMPTY_SLICE = new ListSlice(null, null); exports.EMPTY_SLICE = EMPTY_SLICE; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9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2hlYWQpIHJldHVybiBudWxsO1xuICAgIHJldHVybiA8VD5ub2RlLnByZXY7XG4gIH1cblxuICBpc0VtcHR5KCkge1xuICAgIHJldHVybiBmYWxzZTtcbiAgfVxufVxuXG5leHBvcnQgY29uc3QgRU1QVFlfU0xJQ0UgPSBuZXcgTGlzdFNsaWNlKG51bGwsIG51bGwpO1xuIl19 + enifed("glimmer-util/lib/logger", ["exports"], function (exports) { "use strict"; @@ -54683,7 +54589,7 @@ enifed("glimmer-util/lib/logger", ["exports"], function (exports) { var LOG_LEVEL = LogLevel.Warn; exports.default = new Logger({ console: _console, level: LOG_LEVEL }); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvbG9nZ2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLFFBQVksUUFLWCxDQUFBOztBQUxELEtBQUEsVUFBWSxRQUFRLEVBQUE7QUFDbEIsZ0JBQUEsQ0FBQSxRQUFBLENBQUEsT0FBQSxDQUFBLEdBQUEsQ0FBQSxDQUFBLEdBQUEsT0FBSyxDQUFBO0FBQ0wsZ0JBQUEsQ0FBQSxRQUFBLENBQUEsT0FBQSxDQUFBLEdBQUEsQ0FBQSxDQUFBLEdBQUEsT0FBSyxDQUFBO0FBQ0wsZ0JBQUEsQ0FBQSxRQUFBLENBQUEsTUFBQSxDQUFBLEdBQUEsQ0FBQSxDQUFBLEdBQUEsTUFBSSxDQUFBO0FBQ0osZ0JBQUEsQ0FBQSxRQUFBLENBQUEsT0FBQSxDQUFBLEdBQUEsQ0FBQSxDQUFBLEdBQUEsT0FBSyxDQUFBO0tBQ04sQ0FBQSxDQUxXLFFBQVEsYUFBUixRQUtYLEdBTFcsUUFBUSxHQUFBLEVBQUEsQ0FBQSxDQUFBLENBS25COztRQVNELFdBQUE7aUJBQUEsV0FBQTs7QUFBQSxtQkFBQSxXQUNFLEdBQUcsR0FBQSxhQU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9mIGNvbnNvbGUgPT09ICd1bmRlZmluZWQnKSA/IG5ldyBOdWxsQ29uc29sZSgpIDogY29uc29sZTtcblxuY29uc3QgQUxXQVlTID0gbmV3IExvZ2dlcih7IGNvbnNvbGU6IF9jb25zb2xlLCBsZXZlbDogTG9nTGV2ZWwuVHJhY2UgfSk7XG5jb25zdCBMT0dfTEVWRUwgPSBMb2dMZXZlbC5XYXJuO1xuXG5leHBvcnQgZGVmYXVsdCBuZXcgTG9nZ2VyKHsgY29uc29sZTogX2NvbnNvbGUsIGxldmVsOiBMT0dfTEVWRUwgfSk7XG4iXX0= + enifed('glimmer-util/lib/namespaces', ['exports'], function (exports) { // There is a small whitelist of namespaced attributes specially // enumerated in @@ -54723,7 +54629,7 @@ enifed('glimmer-util/lib/namespaces', ['exports'], function (exports) { return WHITELIST[attrName] || null; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvbmFtZXNwYWNlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7OztBQWNBLFFBQU0sS0FBSyxHQUFHLDhCQUE4QixDQUFDO0FBQzdDLFFBQU0sR0FBRyxHQUFHLHNDQUFzQyxDQUFDO0FBQ25ELFFBQU0sS0FBSyxHQUFHLCtCQUErQixDQUFDO0FBRTlDLFFBQU0sU0FBUyxHQUFHO0FBQ2hCLHVCQUFlLEVBQUUsS0FBSztBQUN0Qix1QkFBZSxFQUFFLEtBQUs7QUFDdEIsb0JBQVksRUFBRSxLQUFLO0FBQ25CLG9CQUFZLEVBQUUsS0FBSztBQUNuQixvQkFBWSxFQUFFLEtBQUs7QUFDbkIscUJBQWEsRUFBRSxLQUFLO0FBQ3BCLG9CQUFZLEVBQUUsS0FBSztBQUNuQixrQkFBVSxFQUFFLEdBQUc7QUFDZixrQkFBVSxFQUFFLEdBQUc7QUFDZixtQkFBVyxFQUFFLEdBQUc7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cDovL3d3dy53My5vcmcvMTk5OS94bGluayc7XG5jb25zdCBYTUwgPSAnaHR0cDovL3d3dy53My5vcmcvWE1MLzE5OTgvbmFtZXNwYWNlJztcbmNvbnN0IFhNTE5TID0gJ2h0dHA6Ly93d3cudzMub3JnLzIwMDAveG1sbnMvJztcblxuY29uc3QgV0hJVEVMSVNUID0ge1xuICAneGxpbms6YWN0dWF0ZSc6IFhMSU5LLFxuICAneGxpbms6YXJjcm9sZSc6IFhMSU5LLFxuICAneGxpbms6aHJlZic6IFhMSU5LLFxuICAneGxpbms6cm9sZSc6IFhMSU5LLFxuICAneGxpbms6c2hvdyc6IFhMSU5LLFxuICAneGxpbms6dGl0bGUnOiBYTElOSyxcbiAgJ3hsaW5rOnR5cGUnOiBYTElOSyxcbiAgJ3htbDpiYXNlJzogWE1MLFxuICAneG1sOmxhbmcnOiBYTUwsXG4gICd4bWw6c3BhY2UnOiBYTUwsXG4gICd4bWxucyc6IFhNTE5TLFxuICAneG1sbnM6eGxpbmsnOiBYTUxOU1xufTtcblxuZXhwb3J0IGZ1bmN0aW9uIGdldEF0dHJOYW1lc3BhY2UoYXR0ck5hbWUpIHtcbiAgcmV0dXJuIFdISVRFTElTVFthdHRyTmFtZV0gfHwgbnVsbDtcbn0iXX0= + enifed('glimmer-util/lib/object-utils', ['exports'], function (exports) { 'use strict'; @@ -54743,7 +54649,7 @@ enifed('glimmer-util/lib/object-utils', ['exports'], function (exports) { return obj; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvb2JqZWN0LXV0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7UUFBYyxPQUFPLEdBQUssTUFBTSxDQUF4QixJQUFJOztBQVNaLGFBQUEsTUFBQSxDQUF1QixHQUFHLEVBQUE7QUFDeEIsYUFBSyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxHQUFH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1bmN0aW9uIGFzc2lnbjxULCBVLCBWLCBXLCBYLCBZPihvYmo6IFQsIGE6IFUsIGI6IFYsIGM6IFcsIGQ6IFgsIGU6IFkpOiBUICYgVSAmIFYgJiBXICYgWCAmIFk7XG5leHBvcnQgZnVuY3Rpb24gYXNzaWduPFQsIFUsIFYsIFcsIFgsIFksIFo+KG9iajogVCwgYTogVSwgYjogViwgYzogVywgZDogWCwgZTogWSwgZjogWik6IFQgJiBVICYgViAmIFcgJiBYICYgWSAmIFo7XG5leHBvcnQgZnVuY3Rpb24gYXNzaWduKHRhcmdldDogYW55LCAuLi5hcmdzOiBhbnlbXSk6IGFueTtcbmV4cG9ydCBmdW5jdGlvbiBhc3NpZ24ob2JqKSB7XG4gIGZvciAobGV0IGkgPSAxOyBpIDwgYXJndW1lbnRzLmxlbmd0aDsgaSsrKSB7XG4gICAgbGV0IGFzc2lnbm1lbnQgPSBhcmd1bWVudHNbaV07XG4gICAgaWYgKGFzc2lnbm1lbnQgPT09IG51bGwgfHwgdHlwZW9mIGFzc2lnbm1lbnQgIT09ICdvYmplY3QnKSBjb250aW51ZTtcbiAgICBsZXQga2V5cyA9IG9iaktleXMoYXNzaWdubWVudCk7XG4gICAgZm9yIChsZXQgaiA9IDA7IGogPCBrZXlzLmxlbmd0aDsgaisrKSB7XG4gICAgICBsZXQga2V5ID0ga2V5c1tqXTtcbiAgICAgIG9ialtrZXldID0gYXNzaWdubWVudFtrZXldO1xuICAgIH1cbiAgfVxuICByZXR1cm4gb2JqO1xufVxuIl19 + enifed("glimmer-util/lib/platform-utils", ["exports"], function (exports) { "use strict"; @@ -54754,7 +54660,7 @@ enifed("glimmer-util/lib/platform-utils", ["exports"], function (exports) { return val; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvcGxhdGZvcm0tdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFJQSxhQUFBLE1BQUEsQ0FBMEIsR0FBYSxFQUFBO0FBQ3JDLFlBQUksR0FBRyxLQUFLLElBQUksSUFBSSxHQUFHLEtBQUssU0FBUyxFQUFFLE1BQU0sSUFBSSxLQUFLLGdDQUFnQyxDQUFDO0FBQ3ZGLGVBQU8sR0FBRyxDQUFDO0tBQ1oiLCJmaWxlIjoicGxhdGZvcm0tdXRpbHMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgdHlwZSBPcGFxdWUgPSB7fSB8IHZvaWQ7XG5leHBvcnQgdHlwZSBPcHRpb248VD4gPSBUIHwgbnVsbDsgLy8gdHNsaW50OmRpc2FibGUtbGluZVxuZXhwb3J0IHR5cGUgTWF5YmU8VD4gPSBPcHRpb248VD4gfCB1bmRlZmluZWQ7IC8vIHRzbGludDpkaXNhYmxlLWxpbmVcblxuZXhwb3J0IGZ1bmN0aW9uIHVud3JhcDxUPih2YWw6IE1heWJlPFQ+KTogVCB7XG4gIGlmICh2YWwgPT09IG51bGwgfHwgdmFsID09PSB1bmRlZmluZWQpIHRocm93IG5ldyBFcnJvcihgRXhwZWN0ZWQgdmFsdWUgdG8gYmUgcHJlc2VudGApO1xuICByZXR1cm4gdmFsO1xufVxuIl19 + enifed("glimmer-util/lib/quoting", ["exports"], function (exports) { "use strict"; @@ -54790,7 +54696,7 @@ enifed("glimmer-util/lib/quoting", ["exports"], function (exports) { return str; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvcXVvdGluZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLGFBQUEsWUFBQSxDQUFzQixHQUFHLEVBQUE7QUFDdkIsV0FBRyxHQUFHLEdBQUcsQ0FBQyxPQUFPLENBQUMsS0FBSyxFQUFFLE1BQU0sQ0FBQyxDQUFDO0FBQ2pDLFdBQUcsR0FBRyxHQUFHLENBQUMsT0FBTyxDQUF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G5cIik7XG4gIHJldHVybiBzdHI7XG59XG5cbmV4cG9ydCB7IGVzY2FwZVN0cmluZyB9O1xuXG5mdW5jdGlvbiBzdHJpbmcoc3RyKSB7XG4gIHJldHVybiAnXCInICsgZXNjYXBlU3RyaW5nKHN0cikgKyAnXCInO1xufVxuXG5leHBvcnQgeyBzdHJpbmcgfTtcblxuZnVuY3Rpb24gYXJyYXkoYSkge1xuICByZXR1cm4gXCJbXCIgKyBhICsgXCJdXCI7XG59XG5cbmV4cG9ydCB7IGFycmF5IH07XG5cbmV4cG9ydCBmdW5jdGlvbiBoYXNoKHBhaXJzKSB7XG4gIHJldHVybiBcIntcIiArIHBhaXJzLmpvaW4oXCIsIFwiKSArIFwifVwiO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gcmVwZWF0KGNoYXJzLCB0aW1lcykge1xuICBsZXQgc3RyID0gXCJcIjtcbiAgd2hpbGUgKHRpbWVzLS0pIHtcbiAgICBzdHIgKz0gY2hhcnM7XG4gIH1cbiAgcmV0dXJuIHN0cjtcbn1cbiJdfQ== + enifed('glimmer-wire-format/index', ['exports'], function (exports) { 'use strict'; @@ -54838,7 +54744,7 @@ enifed('glimmer-wire-format/index', ['exports'], function (exports) { Statements.isTrustingAttr = is('trusting-attr'); })(Statements || (exports.Statements = Statements = {})); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItd2lyZS1mb3JtYXQvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBbUJBLGFBQUEsRUFBQSxDQUE2QixPQUFlLEVBQUE7QUFDMUMsZUFBTyxVQUFTLEtBQVksRUFBQTtBQUMxQixtQkFBTyxLQUFLLENBQUMsQ0FBQyxDQUFDLEtBQUssT0FBTyxDQUFDO1NBQzdCLENBQUM7S0FDSDtBQVVELFFBQWlCLFdBQVcsQ0FvRDNCOztBQXBERCxLQUFBLFVBQWlCLFdBQVcsRUFBQztBQ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G9ja0pTT05cbiAqL1xuZXhwb3J0IHR5cGUgU2VyaWFsaXplZFRlbXBsYXRlQmxvY2tKU09OID0gc3RyaW5nO1xuXG4vKipcbiAqIEEgSlNPTiBvYmplY3QgY29udGFpbmluZyB0aGUgU2VyaWFsaXplZFRlbXBsYXRlQmxvY2sgYXMgSlNPTiBhbmQgVGVtcGxhdGVNZXRhLlxuICovXG5leHBvcnQgaW50ZXJmYWNlIFNlcmlhbGl6ZWRUZW1wbGF0ZVdpdGhMYXp5QmxvY2s8VCBleHRlbmRzIFRlbXBsYXRlTWV0YT4ge1xuICBpZD86IHN0cmluZztcbiAgYmxvY2s6IFNlcmlhbGl6ZWRUZW1wbGF0ZUJsb2NrSlNPTjtcbiAgbWV0YTogVDtcbn1cblxuLyoqXG4gKiBBIHN0cmluZyBvZiBKYXZhc2NyaXB0IGNvbnRhaW5pbmcgYSBTZXJpYWxpemVkVGVtcGxhdGVXaXRoTGF6eUJsb2NrIHRvIGJlXG4gKiBjb25jYXRlbmF0ZWQgaW50byBhIEphdmFzY3JpcHQgbW9kdWxlLlxuICogQHR5cGVkZWYge3N0cmluZ30gVGVtcGxhdGVKYXZhc2NyaXB0XG4gKi9cbmV4cG9ydCB0eXBlIFRlbXBsYXRlSmF2YXNjcmlwdCA9IHN0cmluZztcbiJdfQ== + enifed('glimmer/index', ['exports', 'glimmer-compiler'], function (exports, _glimmerCompiler) { /* * @overview Glimmer @@ -54851,7 +54757,7 @@ enifed('glimmer/index', ['exports', 'glimmer-compiler'], function (exports, _gli exports.precompile = _glimmerCompiler.precompile; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztVQU9TLFVBQVUsb0JBQVYsVUFBVSIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBAb3ZlcnZpZXcgIEdsaW1tZXJcbiAqIEBjb3B5cmlnaHQgQ29weXJpZ2h0IDIwMTEtMjAxNSBUaWxkZSBJbmMuIGFuZCBjb250cmlidXRvcnNcbiAqIEBsaWNlbnNlICAgTGljZW5zZWQgdW5kZXIgTUlUIGxpY2Vuc2VcbiAqICAgICAgICAgICAgU2VlIGh0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS90aWxkZWlvL2dsaW1tZXIvbWFzdGVyL0xJQ0VOU0VcbiAqIEB2ZXJzaW9uICAgVkVSU0lPTl9TVFJJTkdfUExBQ0VIT0xERVJcbiAqL1xuZXhwb3J0IHsgcHJlY29tcGlsZSB9IGZyb20gJ2dsaW1tZXItY29tcGlsZXInO1xuIl19 + enifed('route-recognizer', ['exports'], function (exports) { 'use strict'; function Target(path, matcher, delegate) { @@ -55910,30 +55816,6 @@ TransitionState.prototype = { } }; -function TransitionAbortedError(message) { - if (!(this instanceof TransitionAbortedError)) { - return new TransitionAbortedError(message); - } - - var error = Error.call(this, message); - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, TransitionAbortedError); - } else { - this.stack = error.stack; - } - - this.description = error.description; - this.fileName = error.fileName; - this.lineNumber = error.lineNumber; - this.message = error.message || 'TransitionAborted'; - this.name = 'TransitionAborted'; - this.number = error.number; - this.code = error.code; -} - -TransitionAbortedError.prototype = oCreate(Error.prototype); - /** A Transition is a thennable (a promise-like object) that represents an attempt to transition to another route. It can be aborted, either @@ -56258,11 +56140,16 @@ Transition.prototype.send = Transition.prototype.trigger; /** @private - Logs and returns an instance of TransitionAbortedError. + Logs and returns a TransitionAborted error. */ function logAbort(transition) { log(transition.router, transition.sequence, "detected abort."); - return new TransitionAbortedError(); + return new TransitionAborted(); +} + +function TransitionAborted(message) { + this.message = (message || "TransitionAborted"); + this.name = "TransitionAborted"; } function TransitionIntent(props) { @@ -56822,26 +56709,14 @@ var NamedTransitionIntent = subclass(TransitionIntent, { } }); +/** + Promise reject reasons passed to promise rejection + handlers for failed transitions. + */ function UnrecognizedURLError(message) { - if (!(this instanceof UnrecognizedURLError)) { - return new UnrecognizedURLError(message); - } - - var error = Error.call(this, message); - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, UnrecognizedURLError); - } else { - this.stack = error.stack; - } - - this.description = error.description; - this.fileName = error.fileName; - this.lineNumber = error.lineNumber; - this.message = error.message || 'UnrecognizedURL'; - this.name = 'UnrecognizedURLError'; - this.number = error.number; - this.code = error.code; + this.message = (message || "UnrecognizedURLError"); + this.name = "UnrecognizedURLError"; + Error.call(this); } UnrecognizedURLError.prototype = oCreate(Error.prototype); @@ -57398,7 +57273,7 @@ function handlerEnteredOrUpdated(currentHandlerInfos, handlerInfo, enter, transi } if (transition && transition.isAborted) { - throw new TransitionAbortedError(); + throw new TransitionAborted(); } handler.context = context; @@ -57406,7 +57281,7 @@ function handlerEnteredOrUpdated(currentHandlerInfos, handlerInfo, enter, transi callHook(handler, 'setup', context, transition); if (transition && transition.isAborted) { - throw new TransitionAbortedError(); + throw new TransitionAborted(); } currentHandlerInfos.push(handlerInfo); @@ -57598,7 +57473,7 @@ function finalizeTransition(transition, newState) { // Resolve with the final handler. return handlerInfos[handlerInfos.length - 1].handler; } catch(e) { - if (!(e instanceof TransitionAbortedError)) { + if (!(e instanceof TransitionAborted)) { //var erroneousHandler = handlerInfos.pop(); var infos = transition.state.handlerInfos; transition.trigger(true, 'error', e, transition, infos[infos.length-1].handler); @@ -57755,2533 +57630,2506 @@ exports.Transition = Transition; Object.defineProperty(exports, '__esModule', { value: true }); }); -enifed('rsvp', ['exports'], function (exports) { - 'use strict'; - - var _rsvp; +/*! + * @overview RSVP - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/tildeio/rsvp.js/master/LICENSE + * @version 3.2.1 + */ - function indexOf(callbacks, callback) { - for (var i = 0, l = callbacks.length; i < l; i++) { - if (callbacks[i] === callback) { - return i; - } - } +enifed('rsvp', ['exports'], function (exports) { 'use strict'; - return -1; +function indexOf(callbacks, callback) { + for (var i=0, l=callbacks.length; i 1) { - throw new Error('Second argument not supported'); - } - if (typeof o !== 'object') { - throw new TypeError('Argument must be an object'); - } - F.prototype = o; - return new F(); - }; + object.trigger('stuff'); // callback1 and callback2 will be executed. - var queue = []; + object.off('stuff'); + object.trigger('stuff'); // callback1 and callback2 will not be executed! + ``` - function scheduleFlush() { - setTimeout(function () { - for (var i = 0; i < queue.length; i++) { - var entry = queue[i]; + @method off + @for RSVP.EventTarget + @private + @param {String} eventName event to stop listening to + @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) { + var allCallbacks = callbacksFor(this), callbacks, index; - var payload = entry.payload; + if (!callback) { + allCallbacks[eventName] = []; + return; + } - payload.guid = payload.key + payload.id; - payload.childGuid = payload.key + payload.childId; - if (payload.error) { - payload.stack = payload.error.stack; - } + callbacks = allCallbacks[eventName]; - config['trigger'](entry.name, entry.payload); - } - queue.length = 0; - }, 50); - } + index = indexOf(callbacks, callback); - function instrument(eventName, promise, child) { - if (1 === queue.push({ - name: eventName, - payload: { - key: promise._guidKey, - id: promise._id, - eventName: eventName, - detail: promise._result, - childId: child && child._id, - label: promise._label, - timeStamp: now(), - error: config["instrument-with-stack"] ? new Error(promise._label) : null - } })) { - scheduleFlush(); - } - } + if (index !== -1) { callbacks.splice(index, 1); } + }, /** - `RSVP.Promise.resolve` returns a promise that will become resolved with the - passed `value`. It is shorthand for the following: - + Use `trigger` to fire custom events. For example: + ```javascript - let promise = new RSVP.Promise(function(resolve, reject){ - resolve(1); - }); - - promise.then(function(value){ - // value === 1 + object.on('foo', function(){ + console.log('foo event happened!'); }); + object.trigger('foo'); + // 'foo event happened!' logged to the console ``` - - Instead of writing the above, your code now simply becomes the following: - + + You can also pass a value as a second argument to `trigger` that will be + passed as an argument to all event listeners for the event: + ```javascript - let promise = RSVP.Promise.resolve(1); - - promise.then(function(value){ - // value === 1 + object.on('foo', function(value){ + console.log(value.name); }); + + object.trigger('foo', { name: 'bar' }); + // 'bar' logged to the console ``` - - @method resolve - @static - @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` + + @method trigger + @for RSVP.EventTarget + @private + @param {String} eventName name of the event to be triggered + @param {*} options optional value to be passed to any event handlers for + the given `eventName` */ - function resolve$1(object, label) { - /*jshint validthis:true */ - var Constructor = this; + 'trigger': function(eventName, options, label) { + var allCallbacks = callbacksFor(this), callbacks, callback; - if (object && typeof object === 'object' && object.constructor === Constructor) { - return object; + if (callbacks = allCallbacks[eventName]) { + // Don't cache the callbacks.length since it may grow + for (var i=0; i 1) { + throw new Error('Second argument not supported'); } - - function handleOwnThenable(promise, thenable) { - if (thenable._state === FULFILLED) { - fulfill(promise, thenable._result); - } else if (thenable._state === REJECTED) { - thenable._onError = null; - reject(promise, thenable._result); - } else { - subscribe(thenable, undefined, function (value) { - if (thenable !== value) { - resolve(promise, value, undefined); - } else { - fulfill(promise, value); - } - }, function (reason) { - return reject(promise, reason); - }); - } + if (typeof o !== 'object') { + throw new TypeError('Argument must be an object'); } + F.prototype = o; + return new F(); +}); - function handleMaybeThenable(promise, maybeThenable, then$$) { - if (maybeThenable.constructor === promise.constructor && then$$ === then && promise.constructor.resolve === resolve$1) { - handleOwnThenable(promise, maybeThenable); - } else { - if (then$$ === GET_THEN_ERROR) { - reject(promise, GET_THEN_ERROR.error); - } else if (then$$ === undefined) { - fulfill(promise, maybeThenable); - } else if (isFunction(then$$)) { - handleForeignThenable(promise, maybeThenable, then$$); - } else { - fulfill(promise, maybeThenable); +var queue = []; + +function scheduleFlush() { + setTimeout(function() { + var entry; + for (var i = 0; i < queue.length; i++) { + entry = queue[i]; + + var payload = entry.payload; + + payload.guid = payload.key + payload.id; + payload.childGuid = payload.key + payload.childId; + if (payload.error) { + payload.stack = payload.error.stack; } + + config['trigger'](entry.name, entry.payload); } - } + queue.length = 0; + }, 50); +} - function resolve(promise, value) { - if (promise === value) { - fulfill(promise, value); - } else if (objectOrFunction(value)) { - handleMaybeThenable(promise, value, getThen(value)); - } else { - fulfill(promise, value); +function instrument(eventName, promise, child) { + if (1 === queue.push({ + name: eventName, + payload: { + key: promise._guidKey, + id: promise._id, + eventName: eventName, + detail: promise._result, + childId: child && child._id, + label: promise._label, + timeStamp: now(), + error: config["instrument-with-stack"] ? new Error(promise._label) : null + }})) { + scheduleFlush(); } } - function publishRejection(promise) { - if (promise._onError) { - promise._onError(promise._result); - } +/** + `RSVP.Promise.resolve` returns a promise that will become resolved with the + passed `value`. It is shorthand for the following: + + ```javascript + var promise = new RSVP.Promise(function(resolve, reject){ + resolve(1); + }); + + promise.then(function(value){ + // value === 1 + }); + ``` + + Instead of writing the above, your code now simply becomes the following: + + ```javascript + var promise = RSVP.Promise.resolve(1); + + promise.then(function(value){ + // value === 1 + }); + ``` + + @method resolve + @static + @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` +*/ +function resolve$1(object, label) { + /*jshint validthis:true */ + var Constructor = this; - publish(promise); + if (object && typeof object === 'object' && object.constructor === Constructor) { + return object; } - function fulfill(promise, value) { - if (promise._state !== PENDING) { - return; - } + var promise = new Constructor(noop, label); + resolve(promise, object); + return promise; +} + +function withOwnPromise() { + return new TypeError('A promises callback cannot return that same promise.'); +} + +function noop() {} - promise._result = value; - promise._state = FULFILLED; +var PENDING = void 0; +var FULFILLED = 1; +var REJECTED = 2; + +var GET_THEN_ERROR = new ErrorObject(); + +function getThen(promise) { + try { + return promise.then; + } catch(error) { + GET_THEN_ERROR.error = error; + return GET_THEN_ERROR; + } +} + +function tryThen(then, value, fulfillmentHandler, rejectionHandler) { + try { + then.call(value, fulfillmentHandler, rejectionHandler); + } catch(e) { + return e; + } +} - if (promise._subscribers.length === 0) { - if (config.instrument) { - instrument('fulfilled', promise); +function handleForeignThenable(promise, thenable, then) { + config.async(function(promise) { + var sealed = false; + var error = tryThen(then, thenable, function(value) { + if (sealed) { return; } + sealed = true; + if (thenable !== value) { + resolve(promise, value, undefined); + } else { + fulfill(promise, value); } - } else { - config.async(publish, promise); + }, function(reason) { + if (sealed) { return; } + sealed = true; + + reject(promise, reason); + }, 'Settle: ' + (promise._label || ' unknown promise')); + + if (!sealed && error) { + sealed = true; + reject(promise, error); } + }, promise); +} + +function handleOwnThenable(promise, thenable) { + if (thenable._state === FULFILLED) { + fulfill(promise, thenable._result); + } else if (thenable._state === REJECTED) { + thenable._onError = null; + reject(promise, thenable._result); + } else { + subscribe(thenable, undefined, function(value) { + if (thenable !== value) { + resolve(promise, value, undefined); + } else { + fulfill(promise, value); + } + }, function(reason) { + reject(promise, reason); + }); } +} - function reject(promise, reason) { - if (promise._state !== PENDING) { - return; +function handleMaybeThenable(promise, maybeThenable, then$$) { + if (maybeThenable.constructor === promise.constructor && + then$$ === then && + constructor.resolve === resolve$1) { + handleOwnThenable(promise, maybeThenable); + } else { + if (then$$ === GET_THEN_ERROR) { + reject(promise, GET_THEN_ERROR.error); + } else if (then$$ === undefined) { + fulfill(promise, maybeThenable); + } else if (isFunction(then$$)) { + handleForeignThenable(promise, maybeThenable, then$$); + } else { + fulfill(promise, maybeThenable); } - promise._state = REJECTED; - promise._result = reason; - config.async(publishRejection, promise); } +} - function subscribe(parent, child, onFulfillment, onRejection) { - var subscribers = parent._subscribers; - var length = subscribers.length; +function resolve(promise, value) { + if (promise === value) { + fulfill(promise, value); + } else if (objectOrFunction(value)) { + handleMaybeThenable(promise, value, getThen(value)); + } else { + fulfill(promise, value); + } +} - parent._onError = null; +function publishRejection(promise) { + if (promise._onError) { + promise._onError(promise._result); + } - subscribers[length] = child; - subscribers[length + FULFILLED] = onFulfillment; - subscribers[length + REJECTED] = onRejection; + publish(promise); +} - if (length === 0 && parent._state) { - config.async(publish, parent); - } - } +function fulfill(promise, value) { + if (promise._state !== PENDING) { return; } - function publish(promise) { - var subscribers = promise._subscribers; - var settled = promise._state; + promise._result = value; + promise._state = FULFILLED; + if (promise._subscribers.length === 0) { if (config.instrument) { - instrument(settled === FULFILLED ? 'fulfilled' : 'rejected', promise); + instrument('fulfilled', promise); } + } else { + config.async(publish, promise); + } +} - if (subscribers.length === 0) { - return; - } +function reject(promise, reason) { + if (promise._state !== PENDING) { return; } + promise._state = REJECTED; + promise._result = reason; + config.async(publishRejection, promise); +} - var child = undefined, - callback = undefined, - detail = promise._result; +function subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers; + var length = subscribers.length; - for (var i = 0; i < subscribers.length; i += 3) { - child = subscribers[i]; - callback = subscribers[i + settled]; + parent._onError = null; - if (child) { - invokeCallback(settled, child, callback, detail); - } else { - callback(detail); - } - } + subscribers[length] = child; + subscribers[length + FULFILLED] = onFulfillment; + subscribers[length + REJECTED] = onRejection; - promise._subscribers.length = 0; + if (length === 0 && parent._state) { + config.async(publish, parent); } +} + +function publish(promise) { + var subscribers = promise._subscribers; + var settled = promise._state; - function ErrorObject() { - this.error = null; + if (config.instrument) { + instrument(settled === FULFILLED ? 'fulfilled' : 'rejected', promise); } - var TRY_CATCH_ERROR = new ErrorObject(); + if (subscribers.length === 0) { return; } - function tryCatch(callback, detail) { - try { - return callback(detail); - } catch (e) { - TRY_CATCH_ERROR.error = e; - return TRY_CATCH_ERROR; + var child, callback, detail = promise._result; + + for (var i = 0; i < subscribers.length; i += 3) { + child = subscribers[i]; + callback = subscribers[i + settled]; + + if (child) { + invokeCallback(settled, child, callback, detail); + } else { + callback(detail); } } - function invokeCallback(settled, promise, callback, detail) { - var hasCallback = isFunction(callback), - value = undefined, - error = undefined, - succeeded = undefined, - failed = undefined; + promise._subscribers.length = 0; +} + +function ErrorObject() { + this.error = null; +} - if (hasCallback) { - value = tryCatch(callback, detail); +var TRY_CATCH_ERROR = new ErrorObject(); - if (value === TRY_CATCH_ERROR) { - failed = true; - error = value.error; - value = null; - } else { - succeeded = true; - } +function tryCatch(callback, detail) { + try { + return callback(detail); + } catch(e) { + TRY_CATCH_ERROR.error = e; + return TRY_CATCH_ERROR; + } +} - if (promise === value) { - reject(promise, withOwnPromise()); - return; - } +function invokeCallback(settled, promise, callback, detail) { + var hasCallback = isFunction(callback), + value, error, succeeded, failed; + + if (hasCallback) { + value = tryCatch(callback, detail); + + if (value === TRY_CATCH_ERROR) { + failed = true; + error = value.error; + value = null; } else { - value = detail; succeeded = true; } - 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 (value) { - if (resolved) { - return; - } - resolved = true; - resolve(promise, value); - }, function (reason) { - if (resolved) { - return; - } - resolved = true; - reject(promise, reason); - }); - } catch (e) { - reject(promise, e); + if (promise === value) { + reject(promise, withOwnPromise()); + return; } + + } else { + value = detail; + succeeded = true; } - function then(onFulfillment, onRejection, label) { - var _arguments = arguments; + 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); + } +} - var parent = this; - var state = parent._state; +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); + } +} - if (state === FULFILLED && !onFulfillment || state === REJECTED && !onRejection) { - config.instrument && instrument('chained', parent, parent); - return parent; - } +function then(onFulfillment, onRejection, label) { + var parent = this; + var state = parent._state; - parent._onError = null; + if (state === FULFILLED && !onFulfillment || state === REJECTED && !onRejection) { + config.instrument && instrument('chained', parent, parent); + return parent; + } - var child = new parent.constructor(noop, label); - var result = parent._result; + parent._onError = null; - config.instrument && instrument('chained', parent, child); + var child = new parent.constructor(noop, label); + var result = parent._result; - if (state) { - (function () { - var callback = _arguments[state - 1]; - config.async(function () { - return invokeCallback(state, child, callback, result); - }); - })(); - } else { - subscribe(parent, child, onFulfillment, onRejection); - } + config.instrument && instrument('chained', parent, child); - return child; + if (state) { + var callback = arguments[state - 1]; + config.async(function(){ + invokeCallback(state, child, callback, result); + }); + } else { + subscribe(parent, child, onFulfillment, onRejection); } - function makeSettledResult(state, position, value) { - if (state === FULFILLED) { - return { - state: 'fulfilled', - value: value - }; - } else { - return { - state: 'rejected', - reason: value - }; - } + return child; +} + +function makeSettledResult(state, position, value) { + if (state === FULFILLED) { + return { + state: 'fulfilled', + value: value + }; + } else { + return { + state: 'rejected', + reason: value + }; } +} - function Enumerator(Constructor, input, abortOnReject, label) { - this._instanceConstructor = Constructor; - this.promise = new Constructor(noop, label); - this._abortOnReject = abortOnReject; +function Enumerator(Constructor, input, abortOnReject, label) { + this._instanceConstructor = Constructor; + this.promise = new Constructor(noop, label); + this._abortOnReject = abortOnReject; - if (this._validateInput(input)) { - this._input = input; - this.length = input.length; - this._remaining = input.length; + if (this._validateInput(input)) { + this._input = input; + this.length = input.length; + this._remaining = input.length; - this._init(); + this._init(); - if (this.length === 0) { + if (this.length === 0) { + fulfill(this.promise, this._result); + } else { + this.length = this.length || 0; + this._enumerate(); + if (this._remaining === 0) { fulfill(this.promise, this._result); - } else { - this.length = this.length || 0; - this._enumerate(); - if (this._remaining === 0) { - fulfill(this.promise, this._result); - } } - } else { - reject(this.promise, this._validationError()); } + } else { + reject(this.promise, this._validationError()); } +} - Enumerator.prototype._validateInput = function (input) { - return isArray(input); - }; +Enumerator.prototype._validateInput = function(input) { + return isArray(input); +}; - Enumerator.prototype._validationError = function () { - return new Error('Array Methods must be provided an Array'); - }; +Enumerator.prototype._validationError = function() { + return new Error('Array Methods must be provided an Array'); +}; - Enumerator.prototype._init = function () { - this._result = new Array(this.length); - }; +Enumerator.prototype._init = function() { + this._result = new Array(this.length); +}; - Enumerator.prototype._enumerate = function () { - var length = this.length; - var promise = this.promise; - var input = this._input; +Enumerator.prototype._enumerate = function() { + var length = this.length; + var promise = this.promise; + var input = this._input; - for (var i = 0; promise._state === PENDING && i < length; i++) { - this._eachEntry(input[i], i); - } - }; + for (var i = 0; promise._state === PENDING && i < length; i++) { + this._eachEntry(input[i], i); + } +}; - Enumerator.prototype._settleMaybeThenable = function (entry, i) { - var c = this._instanceConstructor; - var resolve = c.resolve; - - if (resolve === resolve$1) { - var then$$ = getThen(entry); - - if (then$$ === then && entry._state !== PENDING) { - entry._onError = null; - this._settledAt(entry._state, i, entry._result); - } else if (typeof then$$ !== 'function') { - this._remaining--; - this._result[i] = this._makeResult(FULFILLED, i, entry); - } else if (c === Promise) { - var promise = new c(noop); - handleMaybeThenable(promise, entry, then$$); - this._willSettleAt(promise, i); - } else { - this._willSettleAt(new c(function (resolve) { - return resolve(entry); - }), i); - } - } else { - this._willSettleAt(resolve(entry), i); - } - }; +Enumerator.prototype._settleMaybeThenable = function(entry, i) { + var c = this._instanceConstructor; + var resolve = c.resolve; - Enumerator.prototype._eachEntry = function (entry, i) { - if (isMaybeThenable(entry)) { - this._settleMaybeThenable(entry, i); - } else { + if (resolve === resolve$1) { + var then$$ = getThen(entry); + + if (then$$ === then && + entry._state !== PENDING) { + entry._onError = null; + this._settledAt(entry._state, i, entry._result); + } else if (typeof then$$ !== 'function') { this._remaining--; this._result[i] = this._makeResult(FULFILLED, i, entry); + } else if (c === Promise) { + var promise = new c(noop); + handleMaybeThenable(promise, entry, then$$); + this._willSettleAt(promise, i); + } else { + this._willSettleAt(new c(function(resolve) { resolve(entry); }), i); } - }; + } else { + this._willSettleAt(resolve(entry), i); + } +}; - Enumerator.prototype._settledAt = function (state, i, value) { - var promise = this.promise; +Enumerator.prototype._eachEntry = function(entry, i) { + if (isMaybeThenable(entry)) { + this._settleMaybeThenable(entry, i); + } else { + this._remaining--; + this._result[i] = this._makeResult(FULFILLED, i, entry); + } +}; - if (promise._state === PENDING) { - this._remaining--; +Enumerator.prototype._settledAt = function(state, i, value) { + var promise = this.promise; - if (this._abortOnReject && state === REJECTED) { - reject(promise, value); - } else { - this._result[i] = this._makeResult(state, i, value); - } - } + if (promise._state === PENDING) { + this._remaining--; - if (this._remaining === 0) { - fulfill(promise, this._result); + if (this._abortOnReject && state === REJECTED) { + reject(promise, value); + } else { + this._result[i] = this._makeResult(state, i, value); } - }; + } - Enumerator.prototype._makeResult = function (state, i, value) { - return value; - }; + if (this._remaining === 0) { + fulfill(promise, this._result); + } +}; - Enumerator.prototype._willSettleAt = function (promise, i) { - var enumerator = this; +Enumerator.prototype._makeResult = function(state, i, value) { + return value; +}; - subscribe(promise, undefined, function (value) { - return enumerator._settledAt(FULFILLED, i, value); - }, function (reason) { - return enumerator._settledAt(REJECTED, i, reason); - }); - }; +Enumerator.prototype._willSettleAt = function(promise, i) { + var enumerator = this; - /** - `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 - rejected with the reason of the first passed promise to be rejected. It casts all - elements of the passed iterable to promises as it runs this algorithm. - - Example: - - ```javascript - let promise1 = RSVP.resolve(1); - let promise2 = RSVP.resolve(2); - let promise3 = RSVP.resolve(3); - let promises = [ promise1, promise2, promise3 ]; - - RSVP.Promise.all(promises).then(function(array){ - // The array here would be [ 1, 2, 3 ]; - }); - ``` - - If any of the `promises` given to `RSVP.all` are rejected, the first promise - that is rejected will be given as an argument to the returned promises's - rejection handler. For example: - - Example: - - ```javascript - let promise1 = RSVP.resolve(1); - let promise2 = RSVP.reject(new Error("2")); - let promise3 = RSVP.reject(new Error("3")); - let promises = [ promise1, promise2, promise3 ]; - - RSVP.Promise.all(promises).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(error) { - // error.message === "2" - }); - ``` - - @method all - @static - @param {Array} entries array of promises - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} promise that is fulfilled when all `promises` have been - fulfilled, or rejected if any of them become rejected. - @static - */ - function all(entries, label) { - return new Enumerator(this, entries, true, /* abort on reject */label).promise; - } + subscribe(promise, undefined, function(value) { + enumerator._settledAt(FULFILLED, i, value); + }, function(reason) { + enumerator._settledAt(REJECTED, i, reason); + }); +}; - /** - `RSVP.Promise.race` returns a new promise which is settled in the same way as the - first passed promise to settle. - - Example: - - ```javascript - let promise1 = new RSVP.Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 1'); - }, 200); - }); - - let promise2 = new RSVP.Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 2'); - }, 100); - }); - - RSVP.Promise.race([promise1, promise2]).then(function(result){ - // result === 'promise 2' because it was resolved before promise1 - // was resolved. - }); - ``` - - `RSVP.Promise.race` is deterministic in that only the state of the first - settled promise matters. For example, even if other promises given to the - `promises` array argument are resolved, but the first settled promise has - become rejected before the other promises became fulfilled, the returned - promise will become rejected: - - ```javascript - let promise1 = new RSVP.Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 1'); - }, 200); - }); - - let promise2 = new RSVP.Promise(function(resolve, reject){ - setTimeout(function(){ - reject(new Error('promise 2')); - }, 100); - }); - - RSVP.Promise.race([promise1, promise2]).then(function(result){ - // Code here never runs - }, function(reason){ - // reason.message === 'promise 2' because promise 2 became rejected before - // promise 1 became fulfilled - }); - ``` - - An example real-world use case is implementing timeouts: - - ```javascript - RSVP.Promise.race([ajax('foo.json'), timeout(5000)]) - ``` - - @method race - @static - @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. - */ - function race(entries, label) { - /*jshint validthis:true */ - var Constructor = this; +/** + `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 + rejected with the reason of the first passed promise to be rejected. It casts all + elements of the passed iterable to promises as it runs this algorithm. - var promise = new Constructor(noop, label); + Example: - if (!isArray(entries)) { - reject(promise, new TypeError('You must pass an array to race.')); - return promise; - } + ```javascript + var promise1 = RSVP.resolve(1); + var promise2 = RSVP.resolve(2); + var promise3 = RSVP.resolve(3); + var promises = [ promise1, promise2, promise3 ]; - for (var i = 0; promise._state === PENDING && i < entries.length; i++) { - subscribe(Constructor.resolve(entries[i]), undefined, function (value) { - return resolve(promise, value); - }, function (reason) { - return reject(promise, reason); - }); - } + RSVP.Promise.all(promises).then(function(array){ + // The array here would be [ 1, 2, 3 ]; + }); + ``` - return promise; - } + If any of the `promises` given to `RSVP.all` are rejected, the first promise + that is rejected will be given as an argument to the returned promises's + rejection handler. For example: - /** - `RSVP.Promise.reject` returns a promise rejected with the passed `reason`. - It is shorthand for the following: - - ```javascript - let promise = new RSVP.Promise(function(resolve, reject){ - reject(new Error('WHOOPS')); - }); - - promise.then(function(value){ - // Code here doesn't run because the promise is rejected! - }, function(reason){ - // reason.message === 'WHOOPS' - }); - ``` - - Instead of writing the above, your code now simply becomes the following: - - ```javascript - let promise = RSVP.Promise.reject(new Error('WHOOPS')); - - promise.then(function(value){ - // Code here doesn't run because the promise is rejected! - }, function(reason){ - // reason.message === 'WHOOPS' - }); - ``` - - @method reject - @static - @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$1(reason, label) { - /*jshint validthis:true */ - var Constructor = this; - var promise = new Constructor(noop, label); - reject(promise, reason); + Example: + + ```javascript + var promise1 = RSVP.resolve(1); + var promise2 = RSVP.reject(new Error("2")); + var promise3 = RSVP.reject(new Error("3")); + var promises = [ promise1, promise2, promise3 ]; + + RSVP.Promise.all(promises).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(error) { + // error.message === "2" + }); + ``` + + @method all + @static + @param {Array} entries array of promises + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} promise that is fulfilled when all `promises` have been + fulfilled, or rejected if any of them become rejected. + @static +*/ +function all(entries, label) { + return new Enumerator(this, entries, true /* abort on reject */, label).promise; +} + +/** + `RSVP.Promise.race` returns a new promise which is settled in the same way as the + first passed promise to settle. + + Example: + + ```javascript + var promise1 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 1'); + }, 200); + }); + + var promise2 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 2'); + }, 100); + }); + + RSVP.Promise.race([promise1, promise2]).then(function(result){ + // result === 'promise 2' because it was resolved before promise1 + // was resolved. + }); + ``` + + `RSVP.Promise.race` is deterministic in that only the state of the first + settled promise matters. For example, even if other promises given to the + `promises` array argument are resolved, but the first settled promise has + become rejected before the other promises became fulfilled, the returned + promise will become rejected: + + ```javascript + var promise1 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 1'); + }, 200); + }); + + var promise2 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + reject(new Error('promise 2')); + }, 100); + }); + + RSVP.Promise.race([promise1, promise2]).then(function(result){ + // Code here never runs + }, function(reason){ + // reason.message === 'promise 2' because promise 2 became rejected before + // promise 1 became fulfilled + }); + ``` + + An example real-world use case is implementing timeouts: + + ```javascript + RSVP.Promise.race([ajax('foo.json'), timeout(5000)]) + ``` + + @method race + @static + @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. +*/ +function race(entries, label) { + /*jshint validthis:true */ + var Constructor = this; + + var promise = new Constructor(noop, label); + + if (!isArray(entries)) { + reject(promise, new TypeError('You must pass an array to race.')); return promise; } - var guidKey = 'rsvp_' + now() + '-'; - var counter = 0; + var length = entries.length; - function needsResolver() { - throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); + function onFulfillment(value) { + resolve(promise, value); } - function needsNew() { - throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); + function onRejection(reason) { + reject(promise, reason); } - /** - 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 - why the promise cannot be fulfilled. - - Terminology - ----------- - - - `promise` is an object or function with a `then` method whose behavior conforms to this specification. - - `thenable` is an object or function that defines a `then` method. - - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). - - `exception` is a value that is thrown using the throw statement. - - `reason` is a value that indicates why a promise was rejected. - - `settled` the final resting state of a promise, fulfilled or rejected. - - A promise can be in one of three states: pending, fulfilled, or rejected. - - Promises that are fulfilled have a fulfillment value and are in the fulfilled - state. Promises that are rejected have a rejection reason and are in the - rejected state. A fulfillment value is never a thenable. - - Promises can also be said to *resolve* a value. If this value is also a - promise, then the original promise's settled state will match the value's - settled state. So a promise that *resolves* a promise that rejects will - itself reject, and a promise that *resolves* a promise that fulfills will - itself fulfill. - - - Basic Usage: - ------------ - - ```js - let promise = new Promise(function(resolve, reject) { - // on success - resolve(value); - - // on failure - reject(reason); - }); - - promise.then(function(value) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` - - Advanced Usage: - --------------- - - Promises shine when abstracting away asynchronous interactions such as - `XMLHttpRequest`s. - - ```js - function getJSON(url) { - return new Promise(function(resolve, reject){ - let xhr = new XMLHttpRequest(); - - xhr.open('GET', url); - xhr.onreadystatechange = handler; - xhr.responseType = 'json'; - xhr.setRequestHeader('Accept', 'application/json'); - xhr.send(); - - function handler() { - if (this.readyState === this.DONE) { - if (this.status === 200) { - resolve(this.response); - } else { - reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); - } + for (var i = 0; promise._state === PENDING && i < length; i++) { + subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection); + } + + return promise; +} + +/** + `RSVP.Promise.reject` returns a promise rejected with the passed `reason`. + It is shorthand for the following: + + ```javascript + var promise = new RSVP.Promise(function(resolve, reject){ + reject(new Error('WHOOPS')); + }); + + promise.then(function(value){ + // Code here doesn't run because the promise is rejected! + }, function(reason){ + // reason.message === 'WHOOPS' + }); + ``` + + Instead of writing the above, your code now simply becomes the following: + + ```javascript + var promise = RSVP.Promise.reject(new Error('WHOOPS')); + + promise.then(function(value){ + // Code here doesn't run because the promise is rejected! + }, function(reason){ + // reason.message === 'WHOOPS' + }); + ``` + + @method reject + @static + @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$1(reason, label) { + /*jshint validthis:true */ + var Constructor = this; + var promise = new Constructor(noop, label); + reject(promise, reason); + return promise; +} + +var guidKey = 'rsvp_' + 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."); +} + +/** + 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 + why the promise cannot be fulfilled. + + Terminology + ----------- + + - `promise` is an object or function with a `then` method whose behavior conforms to this specification. + - `thenable` is an object or function that defines a `then` method. + - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). + - `exception` is a value that is thrown using the throw statement. + - `reason` is a value that indicates why a promise was rejected. + - `settled` the final resting state of a promise, fulfilled or rejected. + + A promise can be in one of three states: pending, fulfilled, or rejected. + + Promises that are fulfilled have a fulfillment value and are in the fulfilled + state. Promises that are rejected have a rejection reason and are in the + rejected state. A fulfillment value is never a thenable. + + Promises can also be said to *resolve* a value. If this value is also a + promise, then the original promise's settled state will match the value's + settled state. So a promise that *resolves* a promise that rejects will + itself reject, and a promise that *resolves* a promise that fulfills will + itself fulfill. + + + Basic Usage: + ------------ + + ```js + var promise = new Promise(function(resolve, reject) { + // on success + resolve(value); + + // on failure + reject(reason); + }); + + promise.then(function(value) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Advanced Usage: + --------------- + + Promises shine when abstracting away asynchronous interactions such as + `XMLHttpRequest`s. + + ```js + function getJSON(url) { + return new Promise(function(resolve, reject){ + var xhr = new XMLHttpRequest(); + + xhr.open('GET', url); + xhr.onreadystatechange = handler; + xhr.responseType = 'json'; + xhr.setRequestHeader('Accept', 'application/json'); + xhr.send(); + + function handler() { + if (this.readyState === this.DONE) { + if (this.status === 200) { + resolve(this.response); + } else { + reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); } - }; - }); - } - - getJSON('/posts.json').then(function(json) { - // on fulfillment - }, function(reason) { - // on rejection + } + }; }); - ``` - - Unlike callbacks, promises are great composable primitives. - - ```js - Promise.all([ - getJSON('/posts'), - getJSON('/comments') - ]).then(function(values){ - values[0] // => postsJSON - values[1] // => commentsJSON - - return values; + } + + getJSON('/posts.json').then(function(json) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Unlike callbacks, promises are great composable primitives. + + ```js + Promise.all([ + getJSON('/posts'), + getJSON('/comments') + ]).then(function(values){ + values[0] // => postsJSON + values[1] // => commentsJSON + + return values; + }); + ``` + + @class RSVP.Promise + @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 = []; + + config.instrument && instrument('created', this); + + if (noop !== resolver) { + typeof resolver !== 'function' && needsResolver(); + this instanceof Promise ? initializePromise(this, resolver) : needsNew(); + } +} + +Promise.cast = resolve$1; // deprecated +Promise.all = all; +Promise.race = race; +Promise.resolve = resolve$1; +Promise.reject = reject$1; + +Promise.prototype = { + constructor: Promise, + + _guidKey: guidKey, + + _onError: function (reason) { + var promise = this; + config.after(function() { + if (promise._onError) { + config['trigger']('error', reason, promise._label); + } }); - ``` - - @class RSVP.Promise - @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 = []; + }, + +/** + 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 why the promise cannot be fulfilled. + + ```js + findUser().then(function(user){ + // user is available + }, function(reason){ + // user is unavailable, and you are given the reason why + }); + ``` + + Chaining + -------- + + The return value of `then` is itself a promise. This second, 'downstream' + promise is resolved with the return value of the first promise's fulfillment + or rejection handler, or rejected if the handler throws an exception. + + ```js + findUser().then(function (user) { + return user.name; + }, function (reason) { + return 'default name'; + }).then(function (userName) { + // If `findUser` fulfilled, `userName` will be the user's name, otherwise it + // will be `'default name'` + }); + + findUser().then(function (user) { + throw new Error('Found user, but still unhappy'); + }, function (reason) { + throw new Error('`findUser` rejected and we're unhappy'); + }).then(function (value) { + // never reached + }, function (reason) { + // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. + // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. + }); + ``` + If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. + + ```js + findUser().then(function (user) { + throw new PedagogicalException('Upstream error'); + }).then(function (value) { + // never reached + }).then(function (value) { + // never reached + }, function (reason) { + // The `PedgagocialException` is propagated all the way down to here + }); + ``` + + Assimilation + ------------ + + Sometimes the value you want to propagate to a downstream promise can only be + retrieved asynchronously. This can be achieved by returning a promise in the + fulfillment or rejection handler. The downstream promise will then be pending + until the returned promise is settled. This is called *assimilation*. - config.instrument && instrument('created', this); + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // The user's comments are now available + }); + ``` + + If the assimliated promise rejects, then the downstream promise will also reject. + + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // If `findCommentsByAuthor` fulfills, we'll have the value here + }, function (reason) { + // If `findCommentsByAuthor` rejects, we'll have the reason here + }); + ``` + + Simple Example + -------------- + + Synchronous Example + + ```javascript + var result; - if (noop !== resolver) { - typeof resolver !== 'function' && needsResolver(); - this instanceof Promise ? initializePromise(this, resolver) : needsNew(); + try { + result = findResult(); + // success + } catch(reason) { + // failure + } + ``` + + Errback Example + + ```js + findResult(function(result, err){ + if (err) { + // failure + } else { + // success } + }); + ``` + + Promise Example; + + ```javascript + findResult().then(function(result){ + // success + }, function(reason){ + // failure + }); + ``` + + Advanced Example + -------------- + + Synchronous Example + + ```javascript + var author, books; + + try { + author = findAuthor(); + books = findBooksByAuthor(author); + // success + } catch(reason) { + // failure } + ``` - Promise.cast = resolve$1; // deprecated - Promise.all = all; - Promise.race = race; - Promise.resolve = resolve$1; - Promise.reject = reject$1; + Errback Example - Promise.prototype = { - constructor: Promise, + ```js - _guidKey: guidKey, + function foundBooks(books) { - _onError: function (reason) { - var promise = this; - config.after(function () { - if (promise._onError) { - config['trigger']('error', reason, promise._label); - } - }); - }, + } - /** - 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 why the promise cannot be fulfilled. - - ```js - findUser().then(function(user){ - // user is available - }, function(reason){ - // user is unavailable, and you are given the reason why - }); - ``` - - Chaining - -------- - - The return value of `then` is itself a promise. This second, 'downstream' - promise is resolved with the return value of the first promise's fulfillment - or rejection handler, or rejected if the handler throws an exception. - - ```js - findUser().then(function (user) { - return user.name; - }, function (reason) { - return 'default name'; - }).then(function (userName) { - // If `findUser` fulfilled, `userName` will be the user's name, otherwise it - // will be `'default name'` - }); - - findUser().then(function (user) { - throw new Error('Found user, but still unhappy'); - }, function (reason) { - throw new Error('`findUser` rejected and we\'re unhappy'); - }).then(function (value) { - // never reached - }, function (reason) { - // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. - // If `findUser` rejected, `reason` will be '`findUser` rejected and we\'re unhappy'. - }); - ``` - If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. - - ```js - findUser().then(function (user) { - throw new PedagogicalException('Upstream error'); - }).then(function (value) { - // never reached - }).then(function (value) { - // never reached - }, function (reason) { - // The `PedgagocialException` is propagated all the way down to here - }); - ``` - - Assimilation - ------------ - - Sometimes the value you want to propagate to a downstream promise can only be - retrieved asynchronously. This can be achieved by returning a promise in the - fulfillment or rejection handler. The downstream promise will then be pending - until the returned promise is settled. This is called *assimilation*. - - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // The user's comments are now available - }); - ``` - - If the assimliated promise rejects, then the downstream promise will also reject. - - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // If `findCommentsByAuthor` fulfills, we'll have the value here - }, function (reason) { - // If `findCommentsByAuthor` rejects, we'll have the reason here - }); - ``` - - Simple Example - -------------- - - Synchronous Example - - ```javascript - let result; - - try { - result = findResult(); - // success - } catch(reason) { - // failure - } - ``` - - Errback Example - - ```js - findResult(function(result, err){ - if (err) { - // failure - } else { - // success - } - }); - ``` - - Promise Example; - - ```javascript - findResult().then(function(result){ - // success - }, function(reason){ - // failure - }); - ``` - - Advanced Example - -------------- - - Synchronous Example - - ```javascript - let author, books; - + function failure(reason) { + + } + + findAuthor(function(author, err){ + if (err) { + failure(err); + // failure + } else { try { - author = findAuthor(); - books = findBooksByAuthor(author); - // success - } catch(reason) { - // failure - } - ``` - - Errback Example - - ```js - - function foundBooks(books) { - - } - - function failure(reason) { - - } - - findAuthor(function(author, err){ - if (err) { - failure(err); - // failure - } else { - try { - findBoooksByAuthor(author, function(books, err) { - if (err) { - failure(err); - } else { - try { - foundBooks(books); - } catch(reason) { - failure(reason); - } - } - }); - } catch(error) { + findBoooksByAuthor(author, function(books, err) { + if (err) { failure(err); + } else { + try { + foundBooks(books); + } catch(reason) { + failure(reason); + } } - // success - } + }); + } catch(error) { + failure(err); + } + // success + } + }); + ``` + + Promise Example; + + ```javascript + findAuthor(). + then(findBooksByAuthor). + then(function(books){ + // found books + }).catch(function(reason){ + // something went wrong + }); + ``` + + @method then + @param {Function} onFulfillment + @param {Function} onRejection + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} +*/ + then: then, + +/** + `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same + as the catch block of a try/catch statement. + + ```js + function findAuthor(){ + throw new Error('couldn't find that author'); + } + + // synchronous + try { + findAuthor(); + } catch(reason) { + // something went wrong + } + + // async with promises + findAuthor().catch(function(reason){ + // something went wrong + }); + ``` + + @method catch + @param {Function} onRejection + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} +*/ + 'catch': function(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 + + Synchronous example: + + ```js + findAuthor() { + if (Math.random() > 0.5) { + throw new Error(); + } + return new Author(); + } + + try { + return findAuthor(); // succeed or fail + } catch(error) { + return findOtherAuther(); + } finally { + // always runs + // doesn't affect the return value + } + ``` + + Asynchronous example: + + ```js + findAuthor().catch(function(reason){ + return findOtherAuther(); + }).finally(function(){ + // author was either found, or not + }); + ``` + + @method finally + @param {Function} callback + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} +*/ + 'finally': function(callback, label) { + var promise = this; + var constructor = promise.constructor; + + return promise.then(function(value) { + return constructor.resolve(callback()).then(function() { + return value; }); - ``` - - Promise Example; - - ```javascript - findAuthor(). - then(findBooksByAuthor). - then(function(books){ - // found books - }).catch(function(reason){ - // something went wrong + }, function(reason) { + return constructor.resolve(callback()).then(function() { + return constructor.reject(reason); }); - ``` - - @method then - @param {Function} onFulfillment - @param {Function} onRejection - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - */ - then: then, + }, label); + } +}; - /** - `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same - as the catch block of a try/catch statement. - - ```js - function findAuthor(){ - throw new Error('couldn\'t find that author'); - } - - // synchronous - try { - findAuthor(); - } catch(reason) { - // something went wrong - } - - // async with promises - findAuthor().catch(function(reason){ - // something went wrong - }); - ``` - - @method catch - @param {Function} onRejection - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - */ - catch: function (onRejection, label) { - return this.then(undefined, onRejection, label); - }, +function Result() { + this.value = undefined; +} - /** - `finally` will be invoked regardless of the promise's fate just as native - try/catch/finally behaves - - Synchronous example: - - ```js - findAuthor() { - if (Math.random() > 0.5) { - throw new Error(); +var ERROR = new Result(); +var GET_THEN_ERROR$1 = new Result(); + +function getThen$1(obj) { + try { + return obj.then; + } catch(error) { + ERROR.value= error; + return ERROR; + } +} + + +function tryApply(f, s, a) { + try { + f.apply(s, a); + } catch(error) { + ERROR.value = error; + return ERROR; + } +} + +function makeObject(_, argumentNames) { + var obj = {}; + var name; + var i; + var length = _.length; + var args = new Array(length); + + for (var x = 0; x < length; x++) { + args[x] = _[x]; + } + + for (i = 0; i < argumentNames.length; i++) { + name = argumentNames[i]; + obj[name] = args[i + 1]; + } + + return obj; +} + +function arrayResult(_) { + var length = _.length; + var args = new Array(length - 1); + + for (var i = 1; i < length; i++) { + args[i - 1] = _[i]; + } + + return args; +} + +function wrapThenable(then, promise) { + return { + then: function(onFulFillment, onRejection) { + return then.call(promise, onFulFillment, onRejection); + } + }; +} + +/** + `RSVP.denodeify` takes a 'node-style' function and returns a function that + will return an `RSVP.Promise`. You can use `denodeify` in Node.js or the + browser when you'd prefer to use promises over using callbacks. For example, + `denodeify` transforms the following: + + ```javascript + var fs = require('fs'); + + fs.readFile('myfile.txt', function(err, data){ + if (err) return handleError(err); + handleData(data); + }); + ``` + + into: + + ```javascript + var fs = require('fs'); + var readFile = RSVP.denodeify(fs.readFile); + + readFile('myfile.txt').then(handleData, handleError); + ``` + + If the node function has multiple success parameters, then `denodeify` + just returns the first one: + + ```javascript + var request = RSVP.denodeify(require('request')); + + request('http://example.com').then(function(res) { + // ... + }); + ``` + + However, if you need all success parameters, setting `denodeify`'s + second parameter to `true` causes it to return all success parameters + as an array: + + ```javascript + var request = RSVP.denodeify(require('request'), true); + + request('http://example.com').then(function(result) { + // result[0] -> res + // result[1] -> body + }); + ``` + + Or if you pass it an array with names it returns the parameters as a hash: + + ```javascript + var request = RSVP.denodeify(require('request'), ['res', 'body']); + + request('http://example.com').then(function(result) { + // result.res + // result.body + }); + ``` + + Sometimes you need to retain the `this`: + + ```javascript + var app = require('express')(); + var render = RSVP.denodeify(app.render.bind(app)); + ``` + + The denodified function inherits from the original function. It works in all + environments, except IE 10 and below. Consequently all properties of the original + function are available to you. However, any properties you change on the + denodeified function won't be changed on the original function. Example: + + ```javascript + var request = RSVP.denodeify(require('request')), + cookieJar = request.jar(); // <- Inheritance is used here + + request('http://example.com', {jar: cookieJar}).then(function(res) { + // cookieJar.cookies holds now the cookies returned by example.com + }); + ``` + + Using `denodeify` makes it easier to compose asynchronous operations instead + of using callbacks. For example, instead of: + + ```javascript + var fs = require('fs'); + + fs.readFile('myfile.txt', function(err, data){ + if (err) { ... } // Handle error + fs.writeFile('myfile2.txt', data, function(err){ + if (err) { ... } // Handle error + console.log('done') + }); + }); + ``` + + you can chain the operations together using `then` from the returned promise: + + ```javascript + var fs = require('fs'); + var readFile = RSVP.denodeify(fs.readFile); + var writeFile = RSVP.denodeify(fs.writeFile); + + readFile('myfile.txt').then(function(data){ + return writeFile('myfile2.txt', data); + }).then(function(){ + console.log('done') + }).catch(function(error){ + // Handle error + }); + ``` + + @method denodeify + @static + @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} [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. + @return {Function} a function that wraps `nodeFunc` to return an + `RSVP.Promise` + @static +*/ +function denodeify(nodeFunc, options) { + var fn = function() { + var self = this; + var l = arguments.length; + var args = new Array(l + 1); + var arg; + var promiseInput = false; + + for (var i = 0; i < l; ++i) { + arg = arguments[i]; + + if (!promiseInput) { + // TODO: clean this up + promiseInput = needsPromiseInput(arg); + if (promiseInput === GET_THEN_ERROR$1) { + var p = new Promise(noop); + reject(p, GET_THEN_ERROR$1.value); + return p; + } else if (promiseInput && promiseInput !== true) { + arg = wrapThenable(promiseInput, arg); } - return new Author(); } - - try { - return findAuthor(); // succeed or fail - } catch(error) { - return findOtherAuther(); - } finally { - // always runs - // doesn't affect the return value - } - ``` - - Asynchronous example: - - ```js - findAuthor().catch(function(reason){ - return findOtherAuther(); - }).finally(function(){ - // author was either found, or not + args[i] = arg; + } + + var promise = new Promise(noop); + + args[l] = function(err, val) { + if (err) + reject(promise, err); + else if (options === undefined) + resolve(promise, val); + else if (options === true) + resolve(promise, arrayResult(arguments)); + else if (isArray(options)) + resolve(promise, makeObject(arguments, options)); + else + resolve(promise, val); + }; + + if (promiseInput) { + return handlePromiseInput(promise, args, nodeFunc, self); + } else { + return handleValueInput(promise, args, nodeFunc, self); + } + }; + + fn.__proto__ = nodeFunc; + + return fn; +} + +function handleValueInput(promise, args, nodeFunc, self) { + var result = tryApply(nodeFunc, self, args); + if (result === ERROR) { + reject(promise, result.value); + } + return promise; +} + +function handlePromiseInput(promise, args, nodeFunc, self){ + return Promise.all(args).then(function(args){ + var result = tryApply(nodeFunc, self, args); + if (result === ERROR) { + reject(promise, result.value); + } + return promise; + }); +} + +function needsPromiseInput(arg) { + if (arg && typeof arg === 'object') { + if (arg.constructor === Promise) { + return true; + } else { + return getThen$1(arg); + } + } else { + return false; + } +} + +/** + This is a convenient alias for `RSVP.Promise.all`. + + @method all + @static + @for RSVP + @param {Array} array Array of promises. + @param {String} label An optional label. This is useful + for tooling. +*/ +function all$1(array, label) { + return Promise.all(array, label); +} + +function AllSettled(Constructor, entries, label) { + this._superConstructor(Constructor, entries, false /* don't abort on reject */, label); +} + +AllSettled.prototype = o_create(Enumerator.prototype); +AllSettled.prototype._superConstructor = Enumerator; +AllSettled.prototype._makeResult = makeSettledResult; +AllSettled.prototype._validationError = function() { + return new Error('allSettled must be called with an array'); +}; + +/** + `RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing + a fail-fast method, it waits until all the promises have returned and + shows you all the results. This is useful if you want to handle multiple + promises' failure states together as a set. + + Returns a promise that is fulfilled when all the given promises have been + settled. The return promise is fulfilled with an array of the states of + the promises passed into the `promises` array argument. + + Each state object will either indicate fulfillment or rejection, and + provide the corresponding value or reason. The states will take one of + the following formats: + + ```javascript + { state: 'fulfilled', value: value } + or + { state: 'rejected', reason: reason } + ``` + + Example: + + ```javascript + var promise1 = RSVP.Promise.resolve(1); + var promise2 = RSVP.Promise.reject(new Error('2')); + var promise3 = RSVP.Promise.reject(new Error('3')); + var promises = [ promise1, promise2, promise3 ]; + + RSVP.allSettled(promises).then(function(array){ + // array == [ + // { state: 'fulfilled', value: 1 }, + // { state: 'rejected', reason: Error }, + // { state: 'rejected', reason: Error } + // ] + // Note that for the second item, reason.message will be '2', and for the + // third item, reason.message will be '3'. + }, function(error) { + // Not run. (This block would only be called if allSettled had failed, + // for instance if passed an incorrect argument type.) + }); + ``` + + @method allSettled + @static + @for RSVP + @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. +*/ + +function allSettled(entries, label) { + return new AllSettled(Promise, entries, label).promise; +} + +/** + This is a convenient alias for `RSVP.Promise.race`. + + @method race + @static + @for RSVP + @param {Array} array Array of promises. + @param {String} label An optional label. This is useful + for tooling. + */ +function race$1(array, label) { + return Promise.race(array, label); +} + +function PromiseHash(Constructor, object, label) { + this._superConstructor(Constructor, object, true, label); +} + +PromiseHash.prototype = o_create(Enumerator.prototype); +PromiseHash.prototype._superConstructor = Enumerator; +PromiseHash.prototype._init = function() { + this._result = {}; +}; + +PromiseHash.prototype._validateInput = function(input) { + return input && typeof input === 'object'; +}; + +PromiseHash.prototype._validationError = function() { + return new Error('Promise.hash must be called with an object'); +}; + +PromiseHash.prototype._enumerate = function() { + var enumerator = this; + var promise = enumerator.promise; + var input = enumerator._input; + var results = []; + + for (var key in input) { + if (promise._state === PENDING && Object.prototype.hasOwnProperty.call(input, key)) { + results.push({ + position: key, + entry: input[key] }); - ``` - - @method finally - @param {Function} callback - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - */ - finally: function (callback, label) { - var promise = this; - var constructor = promise.constructor; + } + } + + var length = results.length; + enumerator._remaining = length; + var result; + + for (var i = 0; promise._state === PENDING && i < length; i++) { + result = results[i]; + enumerator._eachEntry(result.entry, result.position); + } +}; + +/** + `RSVP.hash` is similar to `RSVP.all`, but takes an object instead of an array + for its `promises` argument. + + Returns a promise that is fulfilled when all the given promises have been + fulfilled, or rejected if any of them become rejected. The returned promise + is fulfilled with a hash that has the same key names as the `promises` object + argument. If any of the values in the object are not promises, they will + simply be copied over to the fulfilled object. + + Example: + + ```javascript + var promises = { + myPromise: RSVP.resolve(1), + yourPromise: RSVP.resolve(2), + theirPromise: RSVP.resolve(3), + notAPromise: 4 + }; + + RSVP.hash(promises).then(function(hash){ + // hash here is an object that looks like: + // { + // myPromise: 1, + // yourPromise: 2, + // theirPromise: 3, + // notAPromise: 4 + // } + }); + ```` + + If any of the `promises` given to `RSVP.hash` are rejected, the first promise + that is rejected will be given as the reason to the rejection handler. + + Example: + + ```javascript + var promises = { + myPromise: RSVP.resolve(1), + rejectedPromise: RSVP.reject(new Error('rejectedPromise')), + anotherRejectedPromise: RSVP.reject(new Error('anotherRejectedPromise')), + }; + + RSVP.hash(promises).then(function(hash){ + // Code here never runs because there are rejected promises! + }, function(reason) { + // reason.message === 'rejectedPromise' + }); + ``` + + An important note: `RSVP.hash` is intended for plain JavaScript objects that + are just a set of keys and values. `RSVP.hash` will NOT preserve prototype + chains. + + Example: + + ```javascript + function MyConstructor(){ + this.example = RSVP.resolve('Example'); + } + + MyConstructor.prototype = { + protoProperty: RSVP.resolve('Proto Property') + }; + + var myObject = new MyConstructor(); + + RSVP.hash(myObject).then(function(hash){ + // protoProperty will not be present, instead you will just have an + // object that looks like: + // { + // example: 'Example' + // } + // + // hash.hasOwnProperty('protoProperty'); // false + // 'undefined' === typeof hash.protoProperty + }); + ``` + + @method hash + @static + @for RSVP + @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. +*/ +function hash(object, label) { + return new PromiseHash(Promise, object, label).promise; +} + +function HashSettled(Constructor, object, label) { + this._superConstructor(Constructor, object, false, label); +} + +HashSettled.prototype = o_create(PromiseHash.prototype); +HashSettled.prototype._superConstructor = Enumerator; +HashSettled.prototype._makeResult = makeSettledResult; + +HashSettled.prototype._validationError = function() { + return new Error('hashSettled must be called with an object'); +}; + +/** + `RSVP.hashSettled` is similar to `RSVP.allSettled`, but takes an object + instead of an array for its `promises` argument. - return promise.then(function (value) { - return constructor.resolve(callback()).then(function () { - return value; - }); - }, function (reason) { - return constructor.resolve(callback()).then(function () { - throw reason; - }); - }, label); - } + Unlike `RSVP.all` or `RSVP.hash`, which implement a fail-fast method, + but like `RSVP.allSettled`, `hashSettled` waits until all the + constituent promises have returned and then shows you all the results + with their states and values/reasons. This is useful if you want to + handle multiple promises' failure states together as a set. + + Returns a promise that is fulfilled when all the given promises have been + settled, or rejected if the passed parameters are invalid. + + The returned promise is fulfilled with a hash that has the same key names as + the `promises` object argument. If any of the values in the object are not + promises, they will be copied over to the fulfilled object and marked with state + 'fulfilled'. + + Example: + + ```javascript + var promises = { + myPromise: RSVP.Promise.resolve(1), + yourPromise: RSVP.Promise.resolve(2), + theirPromise: RSVP.Promise.resolve(3), + notAPromise: 4 }; - function Result() { - this.value = undefined; - } + RSVP.hashSettled(promises).then(function(hash){ + // hash here is an object that looks like: + // { + // myPromise: { state: 'fulfilled', value: 1 }, + // yourPromise: { state: 'fulfilled', value: 2 }, + // theirPromise: { state: 'fulfilled', value: 3 }, + // notAPromise: { state: 'fulfilled', value: 4 } + // } + }); + ``` - var ERROR = new Result(); - var GET_THEN_ERROR$1 = new Result(); + If any of the `promises` given to `RSVP.hash` are rejected, the state will + be set to 'rejected' and the reason for rejection provided. - function getThen$1(obj) { - try { - return obj.then; - } catch (error) { - ERROR.value = error; - return ERROR; - } - } + Example: - function tryApply(f, s, a) { - try { - f.apply(s, a); - } catch (error) { - ERROR.value = error; - return ERROR; - } - } + ```javascript + var promises = { + myPromise: RSVP.Promise.resolve(1), + rejectedPromise: RSVP.Promise.reject(new Error('rejection')), + anotherRejectedPromise: RSVP.Promise.reject(new Error('more rejection')), + }; - function makeObject(_, argumentNames) { - var obj = {}; - var length = _.length; - var args = new Array(length); + RSVP.hashSettled(promises).then(function(hash){ + // hash here is an object that looks like: + // { + // myPromise: { state: 'fulfilled', value: 1 }, + // rejectedPromise: { state: 'rejected', reason: Error }, + // anotherRejectedPromise: { state: 'rejected', reason: Error }, + // } + // Note that for rejectedPromise, reason.message == 'rejection', + // and for anotherRejectedPromise, reason.message == 'more rejection'. + }); + ``` - for (var x = 0; x < length; x++) { - args[x] = _[x]; - } + An important note: `RSVP.hashSettled` is intended for plain JavaScript objects that + are just a set of keys and values. `RSVP.hashSettled` will NOT preserve prototype + chains. - for (var i = 0; i < argumentNames.length; i++) { - var _name = argumentNames[i]; - obj[_name] = args[i + 1]; - } + Example: - return obj; + ```javascript + function MyConstructor(){ + this.example = RSVP.Promise.resolve('Example'); } - function arrayResult(_) { - var length = _.length; - var args = new Array(length - 1); + MyConstructor.prototype = { + protoProperty: RSVP.Promise.resolve('Proto Property') + }; - for (var i = 1; i < length; i++) { - args[i - 1] = _[i]; - } + var myObject = new MyConstructor(); - return args; - } + RSVP.hashSettled(myObject).then(function(hash){ + // protoProperty will not be present, instead you will just have an + // object that looks like: + // { + // example: { state: 'fulfilled', value: 'Example' } + // } + // + // hash.hasOwnProperty('protoProperty'); // false + // 'undefined' === typeof hash.protoProperty + }); + ``` - function wrapThenable(then, promise) { - return { - then: function (onFulFillment, onRejection) { - return then.call(promise, onFulFillment, onRejection); - } - }; + @method hashSettled + @for RSVP + @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 +*/ +function hashSettled(object, label) { + return new HashSettled(Promise, object, label).promise; +} + +/** + `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 + caught by the promises implementation and bubbled to the last handler. For + this reason, it is recommended that you always specify a second rejection + handler function to `then`. However, `RSVP.rethrow` will throw the exception + outside of the promise, so it bubbles up to your console if in the browser, + or domain/cause uncaught exception in Node. `rethrow` will also throw the + error again so the error can be handled by the promise per the spec. + + ```javascript + function throws(){ + throw new Error('Whoops!'); } - /** - `RSVP.denodeify` takes a 'node-style' function and returns a function that - will return an `RSVP.Promise`. You can use `denodeify` in Node.js or the - browser when you'd prefer to use promises over using callbacks. For example, - `denodeify` transforms the following: - - ```javascript - let fs = require('fs'); - - fs.readFile('myfile.txt', function(err, data){ - if (err) return handleError(err); - handleData(data); - }); - ``` - - into: - - ```javascript - let fs = require('fs'); - let readFile = RSVP.denodeify(fs.readFile); - - readFile('myfile.txt').then(handleData, handleError); - ``` - - If the node function has multiple success parameters, then `denodeify` - just returns the first one: - - ```javascript - let request = RSVP.denodeify(require('request')); - - request('http://example.com').then(function(res) { - // ... - }); - ``` - - However, if you need all success parameters, setting `denodeify`'s - second parameter to `true` causes it to return all success parameters - as an array: - - ```javascript - let request = RSVP.denodeify(require('request'), true); - - request('http://example.com').then(function(result) { - // result[0] -> res - // result[1] -> body - }); - ``` - - Or if you pass it an array with names it returns the parameters as a hash: - - ```javascript - let request = RSVP.denodeify(require('request'), ['res', 'body']); - - request('http://example.com').then(function(result) { - // result.res - // result.body - }); - ``` - - Sometimes you need to retain the `this`: - - ```javascript - let app = require('express')(); - let render = RSVP.denodeify(app.render.bind(app)); - ``` - - The denodified function inherits from the original function. It works in all - environments, except IE 10 and below. Consequently all properties of the original - function are available to you. However, any properties you change on the - denodeified function won't be changed on the original function. Example: - - ```javascript - let request = RSVP.denodeify(require('request')), - cookieJar = request.jar(); // <- Inheritance is used here - - request('http://example.com', {jar: cookieJar}).then(function(res) { - // cookieJar.cookies holds now the cookies returned by example.com - }); - ``` - - Using `denodeify` makes it easier to compose asynchronous operations instead - of using callbacks. For example, instead of: - - ```javascript - let fs = require('fs'); - - fs.readFile('myfile.txt', function(err, data){ - if (err) { ... } // Handle error - fs.writeFile('myfile2.txt', data, function(err){ - if (err) { ... } // Handle error - console.log('done') - }); - }); - ``` - - you can chain the operations together using `then` from the returned promise: - - ```javascript - let fs = require('fs'); - let readFile = RSVP.denodeify(fs.readFile); - let writeFile = RSVP.denodeify(fs.writeFile); - - readFile('myfile.txt').then(function(data){ - return writeFile('myfile2.txt', data); - }).then(function(){ - console.log('done') - }).catch(function(error){ - // Handle error - }); - ``` - - @method denodeify - @static - @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} [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. - @return {Function} a function that wraps `nodeFunc` to return an - `RSVP.Promise` - @static - */ - function denodeify(nodeFunc, options) { - var fn = function () { - var self = this; - var l = arguments.length; - var args = new Array(l + 1); - var promiseInput = false; - - for (var i = 0; i < l; ++i) { - var arg = arguments[i]; - - if (!promiseInput) { - // TODO: clean this up - promiseInput = needsPromiseInput(arg); - if (promiseInput === GET_THEN_ERROR$1) { - var p = new Promise(noop); - reject(p, GET_THEN_ERROR$1.value); - return p; - } else if (promiseInput && promiseInput !== true) { - arg = wrapThenable(promiseInput, arg); - } - } - args[i] = arg; - } + var promise = new RSVP.Promise(function(resolve, reject){ + throws(); + }); - var promise = new Promise(noop); + promise.catch(RSVP.rethrow).then(function(){ + // Code here doesn't run because the promise became rejected due to an + // error! + }, function (err){ + // handle the error here + }); + ``` - args[l] = function (err, val) { - if (err) reject(promise, err);else if (options === undefined) resolve(promise, val);else if (options === true) resolve(promise, arrayResult(arguments));else if (isArray(options)) resolve(promise, makeObject(arguments, options));else resolve(promise, val); - }; + The 'Whoops' error will be thrown on the next turn of the event loop + and you can watch for it in your console. You can also handle it using a + rejection handler given to `.then` or `.catch` on the returned promise. - if (promiseInput) { - return handlePromiseInput(promise, args, nodeFunc, self); - } else { - return handleValueInput(promise, args, nodeFunc, self); - } - }; + @method rethrow + @static + @for RSVP + @param {Error} reason reason the promise became rejected. + @throws Error + @static +*/ +function rethrow(reason) { + setTimeout(function() { + throw reason; + }); + throw reason; +} - babelHelpers.defaults(fn, nodeFunc); +/** + `RSVP.defer` returns an object similar to jQuery's `$.Deferred`. + `RSVP.defer` should be used when porting over code reliant on `$.Deferred`'s + interface. New code should use the `RSVP.Promise` constructor instead. - return fn; - } + The object returned from `RSVP.defer` is a plain object with three properties: - function handleValueInput(promise, args, nodeFunc, self) { - var result = tryApply(nodeFunc, self, args); - if (result === ERROR) { - reject(promise, result.value); - } - return promise; - } + * promise - an `RSVP.Promise`. + * reject - a function that causes the `promise` property on this object to + become rejected + * resolve - a function that causes the `promise` property on this object to + become fulfilled. - function handlePromiseInput(promise, args, nodeFunc, self) { - return Promise.all(args).then(function (args) { - var result = tryApply(nodeFunc, self, args); - if (result === ERROR) { - reject(promise, result.value); - } - return promise; - }); - } + Example: - function needsPromiseInput(arg) { - if (arg && typeof arg === 'object') { - if (arg.constructor === Promise) { - return true; - } else { - return getThen$1(arg); - } - } else { - return false; - } - } + ```javascript + var deferred = RSVP.defer(); - /** - This is a convenient alias for `RSVP.Promise.all`. - - @method all - @static - @for RSVP - @param {Array} array Array of promises. - @param {String} label An optional label. This is useful - for tooling. - */ - function all$1(array, label) { - return Promise.all(array, label); - } + deferred.resolve("Success!"); - function AllSettled(Constructor, entries, label) { - this._superConstructor(Constructor, entries, false, /* don't abort on reject */label); - } + deferred.promise.then(function(value){ + // value here is "Success!" + }); + ``` - AllSettled.prototype = o_create(Enumerator.prototype); - AllSettled.prototype._superConstructor = Enumerator; - AllSettled.prototype._makeResult = makeSettledResult; - AllSettled.prototype._validationError = function () { - return new Error('allSettled must be called with an array'); - }; + @method defer + @static + @for RSVP + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Object} + */ - /** - `RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing - a fail-fast method, it waits until all the promises have returned and - shows you all the results. This is useful if you want to handle multiple - promises' failure states together as a set. - - Returns a promise that is fulfilled when all the given promises have been - settled. The return promise is fulfilled with an array of the states of - the promises passed into the `promises` array argument. - - Each state object will either indicate fulfillment or rejection, and - provide the corresponding value or reason. The states will take one of - the following formats: - - ```javascript - { state: 'fulfilled', value: value } - or - { state: 'rejected', reason: reason } - ``` - - Example: - - ```javascript - let promise1 = RSVP.Promise.resolve(1); - let promise2 = RSVP.Promise.reject(new Error('2')); - let promise3 = RSVP.Promise.reject(new Error('3')); - let promises = [ promise1, promise2, promise3 ]; - - RSVP.allSettled(promises).then(function(array){ - // array == [ - // { state: 'fulfilled', value: 1 }, - // { state: 'rejected', reason: Error }, - // { state: 'rejected', reason: Error } - // ] - // Note that for the second item, reason.message will be '2', and for the - // third item, reason.message will be '3'. - }, function(error) { - // Not run. (This block would only be called if allSettled had failed, - // for instance if passed an incorrect argument type.) - }); - ``` - - @method allSettled - @static - @for RSVP - @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. - */ +function defer(label) { + var deferred = {}; - function allSettled(entries, label) { - return new AllSettled(Promise, entries, label).promise; - } + deferred['promise'] = new Promise(function(resolve, reject) { + deferred['resolve'] = resolve; + deferred['reject'] = reject; + }, label); - /** - This is a convenient alias for `RSVP.Promise.race`. - - @method race - @static - @for RSVP - @param {Array} array Array of promises. - @param {String} label An optional label. This is useful - for tooling. - */ - function race$1(array, label) { - return Promise.race(array, label); - } + return deferred; +} - function PromiseHash(Constructor, object, label) { - this._superConstructor(Constructor, object, true, label); - } +/** + `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 + each item in given to `promises`. `RSVP.map` returns a promise that will + become fulfilled with the result of running `mapFn` on the values the promises + become fulfilled with. - PromiseHash.prototype = o_create(Enumerator.prototype); - PromiseHash.prototype._superConstructor = Enumerator; - PromiseHash.prototype._init = function () { - this._result = {}; - }; + For example: - PromiseHash.prototype._validateInput = function (input) { - return input && typeof input === 'object'; - }; + ```javascript + + var promise1 = RSVP.resolve(1); + var promise2 = RSVP.resolve(2); + var promise3 = RSVP.resolve(3); + var promises = [ promise1, promise2, promise3 ]; - PromiseHash.prototype._validationError = function () { - return new Error('Promise.hash must be called with an object'); + var mapFn = function(item){ + return item + 1; }; - PromiseHash.prototype._enumerate = function () { - var enumerator = this; - var promise = enumerator.promise; - var input = enumerator._input; - var results = []; - - for (var key in input) { - if (promise._state === PENDING && Object.prototype.hasOwnProperty.call(input, key)) { - results.push({ - position: key, - entry: input[key] - }); - } - } + RSVP.map(promises, mapFn).then(function(result){ + // result is [ 2, 3, 4 ] + }); + ``` - var length = results.length; - enumerator._remaining = length; - var result = undefined; + If any of the `promises` given to `RSVP.map` are rejected, the first promise + that is rejected will be given as an argument to the returned promise's + rejection handler. For example: - for (var i = 0; promise._state === PENDING && i < length; i++) { - result = results[i]; - enumerator._eachEntry(result.entry, result.position); - } + ```javascript + var promise1 = RSVP.resolve(1); + var promise2 = RSVP.reject(new Error('2')); + var promise3 = RSVP.reject(new Error('3')); + var promises = [ promise1, promise2, promise3 ]; + + var mapFn = function(item){ + return item + 1; }; - /** - `RSVP.hash` is similar to `RSVP.all`, but takes an object instead of an array - for its `promises` argument. - - Returns a promise that is fulfilled when all the given promises have been - fulfilled, or rejected if any of them become rejected. The returned promise - is fulfilled with a hash that has the same key names as the `promises` object - argument. If any of the values in the object are not promises, they will - simply be copied over to the fulfilled object. - - Example: - - ```javascript - let promises = { - myPromise: RSVP.resolve(1), - yourPromise: RSVP.resolve(2), - theirPromise: RSVP.resolve(3), - notAPromise: 4 - }; - - RSVP.hash(promises).then(function(hash){ - // hash here is an object that looks like: - // { - // myPromise: 1, - // yourPromise: 2, - // theirPromise: 3, - // notAPromise: 4 - // } - }); - ```` - - If any of the `promises` given to `RSVP.hash` are rejected, the first promise - that is rejected will be given as the reason to the rejection handler. - - Example: - - ```javascript - let promises = { - myPromise: RSVP.resolve(1), - rejectedPromise: RSVP.reject(new Error('rejectedPromise')), - anotherRejectedPromise: RSVP.reject(new Error('anotherRejectedPromise')), - }; - - RSVP.hash(promises).then(function(hash){ - // Code here never runs because there are rejected promises! - }, function(reason) { - // reason.message === 'rejectedPromise' - }); - ``` - - An important note: `RSVP.hash` is intended for plain JavaScript objects that - are just a set of keys and values. `RSVP.hash` will NOT preserve prototype - chains. - - Example: - - ```javascript - function MyConstructor(){ - this.example = RSVP.resolve('Example'); - } - - MyConstructor.prototype = { - protoProperty: RSVP.resolve('Proto Property') - }; - - let myObject = new MyConstructor(); - - RSVP.hash(myObject).then(function(hash){ - // protoProperty will not be present, instead you will just have an - // object that looks like: - // { - // example: 'Example' - // } - // - // hash.hasOwnProperty('protoProperty'); // false - // 'undefined' === typeof hash.protoProperty - }); - ``` - - @method hash - @static - @for RSVP - @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. - */ - function hash(object, label) { - return new PromiseHash(Promise, object, label).promise; - } + RSVP.map(promises, mapFn).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(reason) { + // reason.message === '2' + }); + ``` - function HashSettled(Constructor, object, label) { - this._superConstructor(Constructor, object, false, label); - } + `RSVP.map` will also wait if a promise is returned from `mapFn`. For example, + say you want to get all comments from a set of blog posts, but you need + the blog posts first because they contain a url to those comments. - HashSettled.prototype = o_create(PromiseHash.prototype); - HashSettled.prototype._superConstructor = Enumerator; - HashSettled.prototype._makeResult = makeSettledResult; + ```javscript - HashSettled.prototype._validationError = function () { - return new Error('hashSettled must be called with an object'); + var mapFn = function(blogPost){ + // getComments does some ajax and returns an RSVP.Promise that is fulfilled + // with some comments data + return getComments(blogPost.comments_url); }; - /** - `RSVP.hashSettled` is similar to `RSVP.allSettled`, but takes an object - instead of an array for its `promises` argument. - - Unlike `RSVP.all` or `RSVP.hash`, which implement a fail-fast method, - but like `RSVP.allSettled`, `hashSettled` waits until all the - constituent promises have returned and then shows you all the results - with their states and values/reasons. This is useful if you want to - handle multiple promises' failure states together as a set. - - Returns a promise that is fulfilled when all the given promises have been - settled, or rejected if the passed parameters are invalid. - - The returned promise is fulfilled with a hash that has the same key names as - the `promises` object argument. If any of the values in the object are not - promises, they will be copied over to the fulfilled object and marked with state - 'fulfilled'. - - Example: - - ```javascript - let promises = { - myPromise: RSVP.Promise.resolve(1), - yourPromise: RSVP.Promise.resolve(2), - theirPromise: RSVP.Promise.resolve(3), - notAPromise: 4 - }; - - RSVP.hashSettled(promises).then(function(hash){ - // hash here is an object that looks like: - // { - // myPromise: { state: 'fulfilled', value: 1 }, - // yourPromise: { state: 'fulfilled', value: 2 }, - // theirPromise: { state: 'fulfilled', value: 3 }, - // notAPromise: { state: 'fulfilled', value: 4 } - // } - }); - ``` - - If any of the `promises` given to `RSVP.hash` are rejected, the state will - be set to 'rejected' and the reason for rejection provided. - - Example: - - ```javascript - let promises = { - myPromise: RSVP.Promise.resolve(1), - rejectedPromise: RSVP.Promise.reject(new Error('rejection')), - anotherRejectedPromise: RSVP.Promise.reject(new Error('more rejection')), - }; - - RSVP.hashSettled(promises).then(function(hash){ - // hash here is an object that looks like: - // { - // myPromise: { state: 'fulfilled', value: 1 }, - // rejectedPromise: { state: 'rejected', reason: Error }, - // anotherRejectedPromise: { state: 'rejected', reason: Error }, - // } - // Note that for rejectedPromise, reason.message == 'rejection', - // and for anotherRejectedPromise, reason.message == 'more rejection'. - }); - ``` - - An important note: `RSVP.hashSettled` is intended for plain JavaScript objects that - are just a set of keys and values. `RSVP.hashSettled` will NOT preserve prototype - chains. - - Example: - - ```javascript - function MyConstructor(){ - this.example = RSVP.Promise.resolve('Example'); + // getBlogPosts does some ajax and returns an RSVP.Promise that is fulfilled + // with some blog post data + RSVP.map(getBlogPosts(), mapFn).then(function(comments){ + // comments is the result of asking the server for the comments + // of all blog posts returned from getBlogPosts() + }); + ``` + + @method map + @static + @for RSVP + @param {Array} promises + @param {Function} mapFn function to be called on each fulfilled promise. + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} promise that is fulfilled with the result of calling + `mapFn` on each fulfilled promise or value when they become fulfilled. + The promise will be rejected if any of the given `promises` become rejected. + @static +*/ +function map(promises, mapFn, label) { + return Promise.all(promises, label).then(function(values) { + if (!isFunction(mapFn)) { + throw new TypeError("You must pass a function as map's second argument."); } - - MyConstructor.prototype = { - protoProperty: RSVP.Promise.resolve('Proto Property') - }; - - let myObject = new MyConstructor(); - - RSVP.hashSettled(myObject).then(function(hash){ - // protoProperty will not be present, instead you will just have an - // object that looks like: - // { - // example: { state: 'fulfilled', value: 'Example' } - // } - // - // hash.hasOwnProperty('protoProperty'); // false - // 'undefined' === typeof hash.protoProperty - }); - ``` - - @method hashSettled - @for RSVP - @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 - */ - function hashSettled(object, label) { - return new HashSettled(Promise, object, label).promise; - } - /** - `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 - caught by the promises implementation and bubbled to the last handler. For - this reason, it is recommended that you always specify a second rejection - handler function to `then`. However, `RSVP.rethrow` will throw the exception - outside of the promise, so it bubbles up to your console if in the browser, - or domain/cause uncaught exception in Node. `rethrow` will also throw the - error again so the error can be handled by the promise per the spec. - - ```javascript - function throws(){ - throw new Error('Whoops!'); + var length = values.length; + var results = new Array(length); + + for (var i = 0; i < length; i++) { + results[i] = mapFn(values[i]); } - - let promise = new RSVP.Promise(function(resolve, reject){ - throws(); - }); - - promise.catch(RSVP.rethrow).then(function(){ - // Code here doesn't run because the promise became rejected due to an - // error! - }, function (err){ - // handle the error here - }); - ``` - - The 'Whoops' error will be thrown on the next turn of the event loop - and you can watch for it in your console. You can also handle it using a - rejection handler given to `.then` or `.catch` on the returned promise. - - @method rethrow - @static - @for RSVP - @param {Error} reason reason the promise became rejected. - @throws Error - @static - */ - function rethrow(reason) { - setTimeout(function () { - throw reason; - }); - throw reason; - } - /** - `RSVP.defer` returns an object similar to jQuery's `$.Deferred`. - `RSVP.defer` should be used when porting over code reliant on `$.Deferred`'s - interface. New code should use the `RSVP.Promise` constructor instead. - - The object returned from `RSVP.defer` is a plain object with three properties: - - * promise - an `RSVP.Promise`. - * reject - a function that causes the `promise` property on this object to - become rejected - * resolve - a function that causes the `promise` property on this object to - become fulfilled. - - Example: - - ```javascript - let deferred = RSVP.defer(); - - deferred.resolve("Success!"); - - deferred.promise.then(function(value){ - // value here is "Success!" - }); - ``` - - @method defer - @static - @for RSVP - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Object} - */ + return Promise.all(results, label); + }); +} - function defer(label) { - var deferred = { resolve: undefined, reject: undefined }; +/** + This is a convenient alias for `RSVP.Promise.resolve`. - deferred.promise = new Promise(function (resolve, reject) { - deferred.resolve = resolve; - deferred.reject = reject; - }, label); + @method resolve + @static + @for RSVP + @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` +*/ +function resolve$2(value, label) { + return Promise.resolve(value, label); +} - return deferred; - } +/** + This is a convenient alias for `RSVP.Promise.reject`. - /** - `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 - each item in given to `promises`. `RSVP.map` returns a promise that will - become fulfilled with the result of running `mapFn` on the values the promises - become fulfilled with. - - For example: - - ```javascript - - let promise1 = RSVP.resolve(1); - let promise2 = RSVP.resolve(2); - let promise3 = RSVP.resolve(3); - let promises = [ promise1, promise2, promise3 ]; - - let mapFn = function(item){ - return item + 1; - }; - - RSVP.map(promises, mapFn).then(function(result){ - // result is [ 2, 3, 4 ] - }); - ``` - - If any of the `promises` given to `RSVP.map` are rejected, the first promise - that is rejected will be given as an argument to the returned promise's - rejection handler. For example: - - ```javascript - let promise1 = RSVP.resolve(1); - let promise2 = RSVP.reject(new Error('2')); - let promise3 = RSVP.reject(new Error('3')); - let promises = [ promise1, promise2, promise3 ]; - - let mapFn = function(item){ - return item + 1; - }; - - RSVP.map(promises, mapFn).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(reason) { - // reason.message === '2' - }); - ``` - - `RSVP.map` will also wait if a promise is returned from `mapFn`. For example, - say you want to get all comments from a set of blog posts, but you need - the blog posts first because they contain a url to those comments. - - ```javscript - - let mapFn = function(blogPost){ - // getComments does some ajax and returns an RSVP.Promise that is fulfilled - // with some comments data - return getComments(blogPost.comments_url); - }; - - // getBlogPosts does some ajax and returns an RSVP.Promise that is fulfilled - // with some blog post data - RSVP.map(getBlogPosts(), mapFn).then(function(comments){ - // comments is the result of asking the server for the comments - // of all blog posts returned from getBlogPosts() - }); - ``` - - @method map - @static - @for RSVP - @param {Array} promises - @param {Function} mapFn function to be called on each fulfilled promise. - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} promise that is fulfilled with the result of calling - `mapFn` on each fulfilled promise or value when they become fulfilled. - The promise will be rejected if any of the given `promises` become rejected. - @static - */ - function map(promises, mapFn, label) { - return Promise.all(promises, label).then(function (values) { - if (!isFunction(mapFn)) { - throw new TypeError("You must pass a function as map's second argument."); - } + @method reject + @static + @for RSVP + @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$2(reason, label) { + return Promise.reject(reason, label); +} - var length = values.length; - var results = new Array(length); +/** + `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 + each item in given to `promises`. `RSVP.filter` returns a promise that will + become fulfilled with the result of running `filterFn` on the values the + promises become fulfilled with. - for (var i = 0; i < length; i++) { - results[i] = mapFn(values[i]); - } + For example: - return Promise.all(results, label); - }); - } + ```javascript - /** - This is a convenient alias for `RSVP.Promise.resolve`. - - @method resolve - @static - @for RSVP - @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` - */ - function resolve$2(value, label) { - return Promise.resolve(value, label); - } + var promise1 = RSVP.resolve(1); + var promise2 = RSVP.resolve(2); + var promise3 = RSVP.resolve(3); - /** - This is a convenient alias for `RSVP.Promise.reject`. - - @method reject - @static - @for RSVP - @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$2(reason, label) { - return Promise.reject(reason, label); - } + var promises = [promise1, promise2, promise3]; - /** - `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 - each item in given to `promises`. `RSVP.filter` returns a promise that will - become fulfilled with the result of running `filterFn` on the values the - promises become fulfilled with. - - For example: - - ```javascript - - let promise1 = RSVP.resolve(1); - let promise2 = RSVP.resolve(2); - let promise3 = RSVP.resolve(3); - - let promises = [promise1, promise2, promise3]; - - let filterFn = function(item){ - return item > 1; - }; - - RSVP.filter(promises, filterFn).then(function(result){ - // result is [ 2, 3 ] - }); - ``` - - If any of the `promises` given to `RSVP.filter` are rejected, the first promise - that is rejected will be given as an argument to the returned promise's - rejection handler. For example: - - ```javascript - let promise1 = RSVP.resolve(1); - let promise2 = RSVP.reject(new Error('2')); - let promise3 = RSVP.reject(new Error('3')); - let promises = [ promise1, promise2, promise3 ]; - - let filterFn = function(item){ - return item > 1; - }; - - RSVP.filter(promises, filterFn).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(reason) { - // reason.message === '2' - }); - ``` - - `RSVP.filter` will also wait for any promises returned from `filterFn`. - For instance, you may want to fetch a list of users then return a subset - of those users based on some asynchronous operation: - - ```javascript - - let alice = { name: 'alice' }; - let bob = { name: 'bob' }; - let users = [ alice, bob ]; - - let promises = users.map(function(user){ - return RSVP.resolve(user); - }); - - let filterFn = function(user){ - // Here, Alice has permissions to create a blog post, but Bob does not. - return getPrivilegesForUser(user).then(function(privs){ - return privs.can_create_blog_post === true; - }); - }; - RSVP.filter(promises, filterFn).then(function(users){ - // true, because the server told us only Alice can create a blog post. - users.length === 1; - // false, because Alice is the only user present in `users` - users[0] === bob; - }); - ``` - - @method filter - @static - @for RSVP - @param {Array} promises - @param {Function} filterFn - function to be called on each resolved value to - filter the final results. - @param {String} label optional string describing the promise. Useful for - tooling. - @return {Promise} - */ + var filterFn = function(item){ + return item > 1; + }; - function resolveAll(promises, label) { - return Promise.all(promises, label); - } + RSVP.filter(promises, filterFn).then(function(result){ + // result is [ 2, 3 ] + }); + ``` - function resolveSingle(promise, label) { - return Promise.resolve(promise, label).then(function (promises) { - return resolveAll(promises, label); - }); - } + If any of the `promises` given to `RSVP.filter` are rejected, the first promise + that is rejected will be given as an argument to the returned promise's + rejection handler. For example: - function filter(promises, filterFn, label) { - var promise = isArray(promises) ? resolveAll(promises, label) : resolveSingle(promises, label); - return promise.then(function (values) { - if (!isFunction(filterFn)) { - throw new TypeError("You must pass a function as filter's second argument."); - } + ```javascript + var promise1 = RSVP.resolve(1); + var promise2 = RSVP.reject(new Error('2')); + var promise3 = RSVP.reject(new Error('3')); + var promises = [ promise1, promise2, promise3 ]; - var length = values.length; - var filtered = new Array(length); + var filterFn = function(item){ + return item > 1; + }; - for (var i = 0; i < length; i++) { - filtered[i] = filterFn(values[i]); - } + RSVP.filter(promises, filterFn).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(reason) { + // reason.message === '2' + }); + ``` - return resolveAll(filtered, label).then(function (filtered) { - var results = new Array(length); - var newLength = 0; + `RSVP.filter` will also wait for any promises returned from `filterFn`. + For instance, you may want to fetch a list of users then return a subset + of those users based on some asynchronous operation: - for (var i = 0; i < length; i++) { - if (filtered[i]) { - results[newLength] = values[i]; - newLength++; - } - } + ```javascript - results.length = newLength; + var alice = { name: 'alice' }; + var bob = { name: 'bob' }; + var users = [ alice, bob ]; - return results; - }); + var promises = users.map(function(user){ + return RSVP.resolve(user); + }); + + var filterFn = function(user){ + // Here, Alice has permissions to create a blog post, but Bob does not. + return getPrivilegesForUser(user).then(function(privs){ + return privs.can_create_blog_post === true; }); - } + }; + RSVP.filter(promises, filterFn).then(function(users){ + // true, because the server told us only Alice can create a blog post. + users.length === 1; + // false, because Alice is the only user present in `users` + users[0] === bob; + }); + ``` - var len = 0; - var vertxNext = undefined; - function asap(callback, arg) { - queue$1[len] = callback; - queue$1[len + 1] = arg; - len += 2; - if (len === 2) { - // If len is 1, that means that we need to schedule an async flush. - // If additional callbacks are queued before the queue is flushed, they - // will be processed by this flush that we are scheduling. - scheduleFlush$1(); - } - } - - var browserWindow = typeof window !== 'undefined' ? window : undefined; - var browserGlobal = browserWindow || {}; - var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; - var isNode = typeof self === '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; + @method filter + @static + @for RSVP + @param {Array} promises + @param {Function} filterFn - function to be called on each resolved value to + filter the final results. + @param {String} label optional string describing the promise. Useful for + tooling. + @return {Promise} +*/ +function filter(promises, filterFn, label) { + return Promise.all(promises, label).then(function(values) { + if (!isFunction(filterFn)) { + throw new TypeError("You must pass a function as filter's second argument."); } - return function () { - return nextTick(flush); - }; - } - // vertx - function useVertxTimer() { - if (typeof vertxNext !== 'undefined') { - return function () { - vertxNext(flush); - }; + var length = values.length; + var filtered = new Array(length); + + for (var i = 0; i < length; i++) { + filtered[i] = filterFn(values[i]); } - return useSetTimeout(); - } - function useMutationObserver() { - var iterations = 0; - var observer = new BrowserMutationObserver(flush); - var node = document.createTextNode(''); - observer.observe(node, { characterData: true }); + return Promise.all(filtered, label).then(function(filtered) { + var results = new Array(length); + var newLength = 0; - return function () { - return node.data = iterations = ++iterations % 2; - }; - } + for (var i = 0; i < length; i++) { + if (filtered[i]) { + results[newLength] = values[i]; + newLength++; + } + } - // web worker - function useMessageChannel() { - var channel = new MessageChannel(); - channel.port1.onmessage = flush; - return function () { - return channel.port2.postMessage(0); - }; - } + results.length = newLength; - function useSetTimeout() { - return function () { - return setTimeout(flush, 1); - }; + return results; + }); + }); +} + +var len = 0; +var vertxNext; +function asap(callback, arg) { + queue$1[len] = callback; + queue$1[len + 1] = arg; + len += 2; + if (len === 2) { + // If len is 1, that means that we need to schedule an async flush. + // If additional callbacks are queued before the queue is flushed, they + // will be processed by this flush that we are scheduling. + scheduleFlush$1(); } +} - var queue$1 = new Array(1000); +var browserWindow = (typeof window !== 'undefined') ? window : undefined; +var browserGlobal = browserWindow || {}; +var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; +var isNode = typeof self === '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() { + nextTick(flush); + }; +} - function flush() { - for (var i = 0; i < len; i += 2) { - var callback = queue$1[i]; - var arg = queue$1[i + 1]; +// vertx +function useVertxTimer() { + return function() { + vertxNext(flush); + }; +} - callback(arg); +function useMutationObserver() { + var iterations = 0; + var observer = new BrowserMutationObserver(flush); + var node = document.createTextNode(''); + observer.observe(node, { characterData: true }); - queue$1[i] = undefined; - queue$1[i + 1] = undefined; - } + return function() { + node.data = (iterations = ++iterations % 2); + }; +} - len = 0; - } +// web worker +function useMessageChannel() { + var channel = new MessageChannel(); + channel.port1.onmessage = flush; + return function () { + channel.port2.postMessage(0); + }; +} - function attemptVertex() { - try { - var r = require; - var vertx = r('vertx'); - vertxNext = vertx.runOnLoop || vertx.runOnContext; - return useVertxTimer(); - } catch (e) { - return useSetTimeout(); - } +function useSetTimeout() { + return function() { + setTimeout(flush, 1); + }; +} + +var queue$1 = new Array(1000); +function flush() { + for (var i = 0; i < len; i+=2) { + var callback = queue$1[i]; + var arg = queue$1[i+1]; + + callback(arg); + + queue$1[i] = undefined; + queue$1[i+1] = undefined; } - var scheduleFlush$1 = undefined; - // Decide what async method to use to triggering processing of queued callbacks: - if (isNode) { - scheduleFlush$1 = useNextTick(); - } else if (BrowserMutationObserver) { - scheduleFlush$1 = useMutationObserver(); - } else if (isWorker) { - scheduleFlush$1 = useMessageChannel(); - } else if (browserWindow === undefined && typeof require === 'function') { - scheduleFlush$1 = attemptVertex(); - } else { - scheduleFlush$1 = useSetTimeout(); + len = 0; +} + +function attemptVertex() { + try { + var r = require; + var vertx = r('vertx'); + vertxNext = vertx.runOnLoop || vertx.runOnContext; + return useVertxTimer(); + } catch(e) { + return useSetTimeout(); } +} + +var scheduleFlush$1; +// Decide what async method to use to triggering processing of queued callbacks: +if (isNode) { + scheduleFlush$1 = useNextTick(); +} else if (BrowserMutationObserver) { + scheduleFlush$1 = useMutationObserver(); +} else if (isWorker) { + scheduleFlush$1 = useMessageChannel(); +} else if (browserWindow === undefined && typeof require === 'function') { + scheduleFlush$1 = attemptVertex(); +} else { + scheduleFlush$1 = useSetTimeout(); +} + +// defaults +config.async = asap; +config.after = function(cb) { + setTimeout(cb, 0); +}; +var cast = resolve$2; +function async(callback, arg) { + config.async(callback, arg); +} - var platform = undefined; +function on() { + config['on'].apply(config, arguments); +} - /* global self */ - if (typeof self === 'object') { - platform = self; +function off() { + config['off'].apply(config, arguments); +} - /* global global */ - } else if (typeof global === 'object') { - platform = global; - } else { - throw new Error('no global: `self` or `global` found'); +// Set up instrumentation through `window.__PROMISE_INTRUMENTATION__` +if (typeof window !== 'undefined' && typeof window['__PROMISE_INSTRUMENTATION__'] === 'object') { + var callbacks = window['__PROMISE_INSTRUMENTATION__']; + configure('instrument', true); + for (var eventName in callbacks) { + if (callbacks.hasOwnProperty(eventName)) { + on(eventName, callbacks[eventName]); } + } +} - // defaults - config.async = asap; - config.after = function (cb) { - return setTimeout(cb, 0); - }; - var cast = resolve$2; +exports.cast = cast; +exports.Promise = Promise; +exports.EventTarget = EventTarget; +exports.all = all$1; +exports.allSettled = allSettled; +exports.race = race$1; +exports.hash = hash; +exports.hashSettled = hashSettled; +exports.rethrow = rethrow; +exports.defer = defer; +exports.denodeify = denodeify; +exports.configure = configure; +exports.on = on; +exports.off = off; +exports.resolve = resolve$2; +exports.reject = reject$2; +exports.async = async; +exports.map = map; +exports.filter = filter; - var async = function (callback, arg) { - return config.async(callback, arg); - }; +Object.defineProperty(exports, '__esModule', { value: true }); - function on() { - config['on'].apply(config, arguments); - } - - function off() { - config['off'].apply(config, arguments); - } - - // Set up instrumentation through `window.__PROMISE_INTRUMENTATION__` - if (typeof window !== 'undefined' && typeof window['__PROMISE_INSTRUMENTATION__'] === 'object') { - var callbacks = window['__PROMISE_INSTRUMENTATION__']; - configure('instrument', true); - for (var eventName in callbacks) { - if (callbacks.hasOwnProperty(eventName)) { - on(eventName, callbacks[eventName]); - } - } - } - - // the default export here is for backwards compat: - // https://github.com/tildeio/rsvp.js/issues/434 - var rsvp = (_rsvp = { - cast: cast, - Promise: Promise, - EventTarget: EventTarget, - all: all$1, - allSettled: allSettled, - race: race$1, - hash: hash, - hashSettled: hashSettled, - rethrow: rethrow, - defer: defer, - denodeify: denodeify, - configure: configure, - on: on, - off: off, - resolve: resolve$2, - reject: reject$2, - map: map - }, _rsvp['async'] = async, _rsvp.filter = // babel seems to error if async isn't a computed prop here... - filter, _rsvp); - - exports.cast = cast; - exports.Promise = Promise; - exports.EventTarget = EventTarget; - exports.all = all$1; - exports.allSettled = allSettled; - exports.race = race$1; - exports.hash = hash; - exports.hashSettled = hashSettled; - exports.rethrow = rethrow; - exports.defer = defer; - exports.denodeify = denodeify; - exports.configure = configure; - exports.on = on; - exports.off = off; - exports.resolve = resolve$2; - exports.reject = reject$2; - exports.map = map; - exports.async = async; - exports.filter = filter; - exports.default = rsvp; }); requireModule("ember"); diff --git a/ember.min.js b/ember.min.js index 9549714d4..0ccdddf69 100644 --- a/ember.min.js +++ b/ember.min.js @@ -1,17 +1,3632 @@ -!function(){function e(e,t){e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):o(e,t))}function t(e,t){return e.raw=t,e}function n(e,t){for(var n=0;n=t[n]?i=n+2:o=n;return e>=t[i]?i+2:i}function a(e,t,n){this.name=e,this.globalOptions=n||{},this.options=t,this._queue=[],this.targetQueues={},this._queueBeingFlushed=void 0}function u(e,n){var r=this.queues={};this.queueNames=e=e||[],this.options=n,t(e,function(e){r[e]=new a(e,n[e],n)})}function l(e){throw new Error("You attempted to schedule an action in a queue ("+e+") that doesn't exist")}function c(e){throw new Error("You attempted to schedule an action in a queue ("+e+") for a method that doesn't exist")}function p(e,t){this.queueNames=e,this.options=t||{},this.options.defaultQueue||(this.options.defaultQueue=e[0]),this.instanceStack=[],this._debouncees=[],this._throttlers=[],this._eventCallbacks={end:[],begin:[]};var n=this;this._boundClearItems=function(){v()},this._timerTimeoutId=void 0,this._timers=[],this._platform=this.options._platform||{setTimeout:function(e,t){return setTimeout(e,t)},clearTimeout:function(e){clearTimeout(e)}},this._boundRunExpiredTimers=function(){n._runExpiredTimers()}}function h(e){return e.onError||e.onErrorTarget&&e.onErrorTarget[e.onErrorMethod]}function f(e){var t=e._platform.setTimeout;e.begin(),e._autorun=t(function(){e._autorun=null,e.end()},0)}function m(e,t,n){return g(e,t,n)}function d(e,t,n){return g(e,t,n)}function g(e,t,n){for(var r,i=-1,o=0,s=n.length;o0?t.apply(e,n):t.call(e)},invokeWithOnError:function(e,t,n,r,i){try{n&&n.length>0?t.apply(e,n):t.call(e)}catch(e){r(e,i)}},flush:function(e){var t=this._queue,r=t.length;if(0!==r){var i,o,s,a,u=this.globalOptions,l=this.options,c=l&&l.before,p=l&&l.after,h=u.onError||u.onErrorTarget&&u.onErrorTarget[u.onErrorMethod],f=h?this.invokeWithOnError:this.invoke;this.targetQueues=Object.create(null);var m=this._queueBeingFlushed=this._queue.slice();this._queue=[],c&&c();for(var d=0;d0&&this.flush(!0)}},cancel:function(e){var t,n,r,i,o=this._queue,s=e.target,a=e.method,u=this.globalOptions.GUID_KEY;if(u&&this.targetQueues&&s){var l=this.targetQueues[s[u]];if(l)for(r=0,i=l.length;r2){r=new Array(i-2);for(var o=0,s=i-2;o3){i=new Array(o-3);for(var a=3;a3){i=new Array(o-3);for(var a=3;a-1?this._throttlers[l]:(c=this._platform.setTimeout(function(){p||r.run.apply(r,o);var n=d(e,t,r._throttlers);n>-1&&r._throttlers.splice(n,1)},a),p&&this.run.apply(this,o),u=[e,t,c],this._throttlers.push(u),u)},debounce:function(e,t){for(var r=this,o=new Array(arguments.length),s=0;s-1&&(l=this._debouncees[u],this._debouncees.splice(u,1),this._platform.clearTimeout(l[2])),c=this._platform.setTimeout(function(){p||r.run.apply(r,o);var n=m(e,t,r._debouncees);n>-1&&r._debouncees.splice(n,1)},a),p&&u===-1&&r.run.apply(r,o),l=[e,t,c],r._debouncees.push(l),l},cancelTimers:function(){t(this._throttlers,this._boundClearItems),this._throttlers=[],t(this._debouncees,this._boundClearItems),this._debouncees=[],this._clearTimerTimeout(),this._timers=[],this._autorun&&(this._platform.clearTimeout(this._autorun),this._autorun=null)},hasTimers:function(){return!!this._timers.length||!!this._debouncees.length||!!this._throttlers.length||this._autorun},cancel:function(e){var t=typeof e;if(e&&"object"===t&&e.queue&&e.method)return e.queue.cancel(e);if("function"!==t)return"[object Array]"===Object.prototype.toString.call(e)?this._cancelItem(d,this._throttlers,e)||this._cancelItem(m,this._debouncees,e):void 0;for(var n=0,r=this._timers.length;n-1&&(r=t[i],r[2]===n[2])&&(t.splice(i,1),this._platform.clearTimeout(n[2]),!0))},_runExpiredTimers:function(){this._timerTimeoutId=void 0,this.run(this,this._scheduleExpiredTimers)},_scheduleExpiredTimers:function(){for(var e=Date.now(),t=this._timers,n=0,r=t.length;n1){for(var t=arguments[0],n=[],r=void 0,i=1;i0?v(this,this.registry.normalize(e)):g(this)},ownerInjection:function(){var e;return e={},e[t.OWNER]=this.owner,e}}}),s("container/index",["exports","container/registry","container/container"],function(e,t,n){"use strict";e.Registry=t.default,e.privatize=t.privatize,e.Container=n.default,e.buildFakeContainerWithDeprecations=n.buildFakeContainerWithDeprecations}),s("container/registry",["exports","ember-utils","ember-metal","container/container"],function(e,t,n,r){"use strict";function i(e){this.fallback=e&&e.fallback?e.fallback:null,e&&e.resolver&&(this.resolver=e.resolver,"function"==typeof this.resolver&&o(this)),this.registrations=t.dictionary(e&&e.registrations?e.registrations:null),this._typeInjections=t.dictionary(null),this._injections=t.dictionary(null),this._factoryTypeInjections=t.dictionary(null),this._factoryInjections=t.dictionary(null),this._localLookupCache=new t.EmptyObject,this._normalizeCache=t.dictionary(null),this._resolveCache=t.dictionary(null),this._failCache=t.dictionary(null),this._options=t.dictionary(null),this._typeOptions=t.dictionary(null)}function o(e){e.resolver={resolve:e.resolver}}function s(e,n,r){var i=e._localLookupCache,o=i[n];o||(o=i[n]=new t.EmptyObject);var s=o[r];if(void 0!==s)return s;var a=e.resolver.expandLocalLookup(n,r);return o[r]=a}function a(e,t,n){if(!n||!n.source||(t=e.expandLocalLookup(t,n))){var r=e._resolveCache[t];if(void 0!==r)return r;if(!e._failCache[t]){var i=void 0;return e.resolver&&(i=e.resolver.resolve(t)),void 0===i&&(i=e.registrations[t]),void 0===i?e._failCache[t]=!0:e._resolveCache[t]=i,i}}}function u(e,t,n){return void 0!==e.resolve(t,{source:n})}function l(e){var n=e[0],r=p[n];if(r)return r;var i=n.split(":"),o=i[0],s=i[1];return p[n]=t.intern(o+":"+s+"-"+h)}e.default=i,e.privatize=l;var c=/^[^:]+:[^:]+$/;i.prototype={fallback:null,resolver:null,registrations:null,_typeInjections:null,_injections:null,_factoryTypeInjections:null,_factoryInjections:null,_normalizeCache:null,_resolveCache:null,_options:null,_typeOptions:null,container:function(e){return new r.default(this,e)},register:function(e,t){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];if(void 0===t)throw new TypeError("Attempting to register an unknown factory: '"+e+"'");var r=this.normalize(e);if(this._resolveCache[r])throw new Error("Cannot re-register: '"+e+"', as it has already been resolved.");delete this._failCache[r],this.registrations[r]=t,this._options[r]=n},unregister:function(e){var n=this.normalize(e);this._localLookupCache=new t.EmptyObject,delete this.registrations[n],delete this._resolveCache[n],delete this._failCache[n],delete this._options[n]},resolve:function(e,t){var n=a(this,this.normalize(e),t);if(void 0===n&&this.fallback){var r;n=(r=this.fallback).resolve.apply(r,arguments)}return n},describe:function(e){return this.resolver&&this.resolver.lookupDescription?this.resolver.lookupDescription(e):this.fallback?this.fallback.describe(e):e},normalizeFullName:function(e){return this.resolver&&this.resolver.normalize?this.resolver.normalize(e):this.fallback?this.fallback.normalizeFullName(e):e},normalize:function(e){return this._normalizeCache[e]||(this._normalizeCache[e]=this.normalizeFullName(e))},makeToString:function(e,t){return this.resolver&&this.resolver.makeToString?this.resolver.makeToString(e,t):this.fallback?this.fallback.makeToString(e,t):e.toString()},has:function(e,t){if(!this.isValidFullName(e))return!1;var n=t&&t.source&&this.normalize(t.source);return u(this,this.normalize(e),n)},optionsForType:function(e,t){this._typeOptions[e]=t},getOptionsForType:function(e){var t=this._typeOptions[e];return void 0===t&&this.fallback&&(t=this.fallback.getOptionsForType(e)),t},options:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=this.normalize(e);this._options[n]=t},getOptions:function(e){var t=this.normalize(e),n=this._options[t];return void 0===n&&this.fallback&&(n=this.fallback.getOptions(e)),n},getOption:function(e,t){var n=this._options[e];if(n&&void 0!==n[t])return n[t];var r=e.split(":")[0];return n=this._typeOptions[r],n&&void 0!==n[t]?n[t]:this.fallback?this.fallback.getOption(e,t):void 0},typeInjection:function(e,t,n){var r=n.split(":")[0];if(r===e)throw new Error("Cannot inject a '"+n+"' on other "+e+"(s).");var i=this._typeInjections[e]||(this._typeInjections[e]=[]);i.push({property:t,fullName:n})},injection:function(e,t,n){this.validateFullName(n);var r=this.normalize(n);if(e.indexOf(":")===-1)return this.typeInjection(e,t,r);var i=this.normalize(e),o=this._injections[i]||(this._injections[i]=[]);o.push({property:t,fullName:r})},factoryTypeInjection:function(e,t,n){var r=this._factoryTypeInjections[e]||(this._factoryTypeInjections[e]=[]);r.push({property:t,fullName:this.normalize(n)})},factoryInjection:function(e,t,n){var r=this.normalize(e),i=this.normalize(n);if(this.validateFullName(n),e.indexOf(":")===-1)return this.factoryTypeInjection(r,t,i);var o=this._factoryInjections[r]||(this._factoryInjections[r]=[]);o.push({property:t,fullName:i})},knownForType:function(e){for(var n=void 0,r=void 0,i=t.dictionary(null),o=Object.keys(this.registrations),s=0;s0){var s="cycle detected: "+t;throw this.each(function(e){s+=" <- "+e}),new Error(s)}}},e.prototype.each=function(e){for(var t=this,n=t.result,r=t.vertices,i=0;i-1&&(i=i.replace(/\.(.)/g,function(e){return e.charAt(1).toUpperCase()})),r.indexOf("_")>-1&&(i=i.replace(/_(.)/g,function(e){return e.charAt(1).toUpperCase()})),r.indexOf("-")>-1&&(i=i.replace(/-(.)/g,function(e){return e.charAt(1).toUpperCase()})),n+":"+i}return e},resolve:function(e){var t,n=this.parseName(e),r=n.resolveMethodName;return this[r]&&(t=this[r](n)),t=t||this.resolveOther(n),n.root&&n.root.LOG_RESOLVER&&this._logLookup(t,n),t&&i.default(t,n),t},parseName:function(e){return this._parseNameCache[e]||(this._parseNameCache[e]=this._parseName(e))},_parseName:function(e){var t=e.split(":"),i=t[0],o=t[1],s=o,a=n.get(this,"namespace"),u=a,l=s.lastIndexOf("/"),c=l!==-1?s.slice(0,l):null;if("template"!==i&&l!==-1){var p=s.split("/");s=p[p.length-1];var h=r.String.capitalize(p.slice(0,-1).join("."));u=r.Namespace.byName(h)}var f="main"===o?"Main":r.String.classify(i);if(!s||!i)throw new TypeError("Invalid fullName: `"+e+"`, must be of the form `type:name` ");return{fullName:e,type:i,fullNameWithoutType:o,dirname:c,name:s,root:u,resolveMethodName:"resolve"+f}},lookupDescription:function(e){var t=this.parseName(e),n=void 0;return"template"===t.type?"template at "+t.fullNameWithoutType.replace(/\./g,"/"):(n=t.root+"."+r.String.classify(t.name).replace(/\./g,""),"model"!==t.type&&(n+=r.String.classify(t.type)),n)},makeToString:function(e,t){return e.toString()},useRouterNaming:function(e){e.name=e.name.replace(/\./g,"_"),"basic"===e.name&&(e.name="")},resolveTemplate:function(e){var t=e.fullNameWithoutType.replace(/\./g,"/");return o.getTemplate(t)||o.getTemplate(r.String.decamelize(t))},resolveView:function(e){return this.useRouterNaming(e),this.resolveOther(e)},resolveController:function(e){return this.useRouterNaming(e),this.resolveOther(e)},resolveRoute:function(e){return this.useRouterNaming(e),this.resolveOther(e)},resolveModel:function(e){var t=r.String.classify(e.name),i=n.get(e.root,t);return i},resolveHelper:function(e){return this.resolveOther(e)},resolveOther:function(e){var t=r.String.classify(e.name)+r.String.classify(e.type),i=n.get(e.root,t);return i},resolveMain:function(e){var t=r.String.classify(e.type);return n.get(e.root,t)},_logLookup:function(e,t){var n=void 0,r=void 0;n=e?"[✓]":"[ ]",r=t.fullName.length>60?".":new Array(60-t.fullName.length).join(".")},knownForType:function(e){for(var i=n.get(this,"namespace"),o=r.String.classify(e),s=new RegExp(o+"$"),a=t.dictionary(null),u=Object.keys(i),l=0;l1?this.set("models",this._getModels(t)):this.set("models",[])}});a.toString=function(){return"LinkComponent"},a.reopenClass({positionalParams:"params"}),e.default=a}),s("ember-glimmer/components/text_area",["exports","ember-glimmer/component","ember-views","ember-glimmer/templates/empty"],function(e,t,n,r){"use strict";e.default=t.default.extend(n.TextSupport,{classNames:["ember-text-area"],layout:r.default,tagName:"textarea",attributeBindings:["rows","cols","name","selectionEnd","selectionStart","wrap","lang","dir","value"],rows:null,cols:null})}),s("ember-glimmer/components/text_field",["exports","ember-utils","ember-metal","ember-environment","ember-glimmer/component","ember-glimmer/templates/empty","ember-views"],function(e,t,n,r,i,o,s){"use strict";function a(e){if(e in l)return l[e];if(!r.environment.hasDOM)return l[e]=e,e;u||(u=document.createElement("input"));try{u.type=e}catch(e){}return l[e]=u.type===e}var u=void 0,l=new t.EmptyObject;e.default=i.default.extend(s.TextSupport,{layout:o.default,classNames:["ember-text-field"],tagName:"input",attributeBindings:["accept","autocomplete","autosave","dir","formaction","formenctype","formmethod","formnovalidate","formtarget","height","inputmode","lang","list","max","min","multiple","name","pattern","size","step","type","value","width"],value:"",type:n.computed({get:function(){return"text"},set:function(e,t){var n="text";return a(t)&&(n=t),n}}),size:null,pattern:null,min:null,max:null})}),s("ember-glimmer/dom",["exports","glimmer-runtime","glimmer-node"],function(e,t,n){"use strict";e.DOMChanges=t.DOMChanges,e.DOMTreeConstruction=t.DOMTreeConstruction,e.NodeDOMTreeConstruction=n.NodeDOMTreeConstruction}),s("ember-glimmer/environment",["exports","ember-utils","ember-metal","ember-views","glimmer-runtime","ember-glimmer/syntax/curly-component","ember-glimmer/syntax","ember-glimmer/syntax/dynamic-component","ember-glimmer/utils/iterable","ember-glimmer/utils/references","ember-glimmer/helpers/if-unless","ember-glimmer/utils/bindings","ember-glimmer/helpers/action","ember-glimmer/helpers/component","ember-glimmer/helpers/concat","ember-glimmer/helpers/debugger","ember-glimmer/helpers/get","ember-glimmer/helpers/hash","ember-glimmer/helpers/loc","ember-glimmer/helpers/log","ember-glimmer/helpers/mut","ember-glimmer/helpers/readonly","ember-glimmer/helpers/unbound","ember-glimmer/helpers/-class","ember-glimmer/helpers/-input-type","ember-glimmer/helpers/query-param","ember-glimmer/helpers/each-in","ember-glimmer/helpers/-normalize-class","ember-glimmer/helpers/-html-safe","ember-glimmer/protocol-for-url","ember-glimmer/modifiers/action"],function(e,t,n,r,i,o,s,a,u,l,c,p,h,f,m,d,g,v,y,b,_,w,E,O,S,x,C,A,k,T,N){"use strict";var R={textarea:"-text-area"},P=function(e){function P(s){var a=this,u=s[t.OWNER];e.apply(this,arguments),this.owner=u,this.isInteractive=u.lookup("-environment:main").isInteractive,this.destroyedComponents=void 0,T.default(this),this._definitionCache=new n.Cache(2e3,function(e){var t=e.name,n=e.source,i=e.owner,s=r.lookupComponent(i,t,{source:n}),a=s.component,u=s.layout;if(a||u)return new o.CurlyComponentDefinition(t,a,u)},function(e){var n=e.name,r=e.source,i=e.owner,o=r&&i._resolveLocalLookupName(n,r)||n,s=t.guidFor(i);return s+"|"+o}),this._templateCache=new n.Cache(1e3,function(e){var n=e.Template,r=e.owner;if(n.create){var i;return n.create((i={env:a},i[t.OWNER]=r,i))}return n},function(e){var n=e.Template,r=e.owner;return t.guidFor(r)+"|"+n.id}),this._compilerCache=new n.Cache(10,function(e){return new n.Cache(2e3,function(t){var n=new e(t);return i.compileLayout(n,a)},function(e){var n=e.meta.owner;return t.guidFor(n)+"|"+e.id})},function(e){return e.id}),this.builtInModifiers={action:new N.default},this.builtInHelpers={if:c.inlineIf,action:h.default,component:f.default,concat:m.default,debugger:d.default,get:g.default,hash:v.default,loc:y.default,log:b.default,mut:_.default,"query-params":x.default,readonly:w.default,unbound:E.default,unless:c.inlineUnless,"-class":O.default,"-each-in":C.default,"-input-type":S.default,"-normalize-class":A.default,"-html-safe":k.default,"-get-dynamic-var":i.getDynamicVar}}return babelHelpers.inherits(P,e),P.create=function(e){return new P(e)},P.prototype.refineStatement=function(t,n){var r=e.prototype.refineStatement.call(this,t,n);if(r)return r;var i=t.appendType,u=t.isSimple,l=t.isInline,c=t.isBlock,h=(t.isModifier,t.key),f=t.path,m=t.args;if(u&&(l||c)&&"get"!==i){var d=s.findSyntaxBuilder(h);if(d)return d.create(this,m,n);var g=R[h],v=null;if(g?v=this.getComponentDefinition([g],n):h.indexOf("-")>=0&&(v=this.getComponentDefinition(f,n)),v)return p.wrapComponentClassAttribute(m),new o.CurlyComponentSyntax(m,v,n)}return l&&!u&&"helper"!==i?t.original.deopt():!u&&f?a.DynamicComponentSyntax.fromPath(this,f,m,n):void 0},P.prototype.hasComponentDefinition=function(){return!1},P.prototype.getComponentDefinition=function(e,t){var n=e[0],r=t.getMeta(),i=r.owner,o=r.moduleName&&"template:"+r.moduleName;return this._definitionCache.get({name:n,source:o,owner:i})},P.prototype.getTemplate=function(e,t){return this._templateCache.get({Template:e,owner:t})},P.prototype.getCompiledBlock=function(e,t){var n=this._compilerCache.get(e);return n.get(t)},P.prototype.hasPartial=function(e,t){var n=t.getMeta(),i=n.owner;return r.hasPartial(e,i)},P.prototype.lookupPartial=function(e,t){var n=t.getMeta(),i=n.owner,o={template:r.lookupPartial(e,i)};if(o.template)return o;throw new Error(e+" is not a partial")},P.prototype.hasHelper=function(e,t){if(e.length>1)return!1;var n=e[0];if(this.builtInHelpers[n])return!0;var r=t.getMeta(),i=r.owner,o={source:"template:"+r.moduleName};return i.hasRegistration("helper:"+n,o)||i.hasRegistration("helper:"+n)},P.prototype.lookupHelper=function(e,t){var n=e[0],r=this.builtInHelpers[n];if(r)return r;var i=t.getMeta(),o=i.owner,s=i.moduleName&&{source:"template:"+i.moduleName}||{};if(r=o.lookup("helper:"+n,s)||o.lookup("helper:"+n),r.isHelperInstance)return function(e,t){return l.SimpleHelperReference.create(r.compute,t)};if(r.isHelperFactory)return function(e,t){return l.ClassBasedHelperReference.create(r,e,t)};throw new Error(e+" is not a helper")},P.prototype.hasModifier=function(e){return!(e.length>1)&&!!this.builtInModifiers[e[0]]},P.prototype.lookupModifier=function(e){var t=this.builtInModifiers[e[0]];if(t)return t;throw new Error(e+" is not a modifier")},P.prototype.toConditionalReference=function(e){return l.ConditionalReference.create(e)},P.prototype.iterableFor=function(e,t){var n=t.named.get("key").value();return u.default(e,n)},P.prototype.scheduleInstallModifier=function(){if(this.isInteractive){var t;(t=e.prototype.scheduleInstallModifier).call.apply(t,[this].concat(babelHelpers.slice.call(arguments)))}},P.prototype.scheduleUpdateModifier=function(){if(this.isInteractive){var t;(t=e.prototype.scheduleUpdateModifier).call.apply(t,[this].concat(babelHelpers.slice.call(arguments)))}},P.prototype.didDestroy=function(e){e.destroy()},P.prototype.begin=function(){this.inTransaction=!0,e.prototype.begin.call(this),this.destroyedComponents=[]},P.prototype.commit=function(){for(var t=0;t1?n.String.dasherize(t.at(1).value()):null:o===!1?i>2?n.String.dasherize(t.at(2).value()):null:o}e.default=function(e,n){return new t.InternalHelperReference(r,n); -}}),s("ember-glimmer/helpers/-html-safe",["exports","ember-glimmer/utils/references","ember-glimmer/utils/string"],function(e,t,n){"use strict";function r(e){var t=e.positional,r=t.at(0);return new n.SafeString(r.value())}e.default=function(e,n){return new t.InternalHelperReference(r,n)}}),s("ember-glimmer/helpers/-input-type",["exports","ember-glimmer/utils/references"],function(e,t){"use strict";function n(e){var t=e.positional,n=(e.named,t.at(0).value());return"checkbox"===n?"-checkbox":"-text-field"}e.default=function(e,r){return new t.InternalHelperReference(n,r)}}),s("ember-glimmer/helpers/-normalize-class",["exports","ember-glimmer/utils/references","ember-runtime"],function(e,t,n){"use strict";function r(e){var t=e.positional,r=(e.named,t.at(0).value().split(".")),i=r[r.length-1],o=t.at(1).value();return o===!0?n.String.dasherize(i):o||0===o?String(o):""}e.default=function(e,n){return new t.InternalHelperReference(r,n)}}),s("ember-glimmer/helpers/action",["exports","ember-utils","ember-glimmer/utils/references","ember-metal"],function(e,t,n,r){"use strict";function i(e,t,n,i){var o=void 0,a=i.length;return o=a>0?function(){for(var o=arguments.length,s=Array(o),u=0;u0&&(l[0]=r.get(l[0],n));var p={target:e,args:l,label:"glimmer-closure-action"};return r.flaggedInstrument("interaction.ember-action",p,function(){return r.run.join.apply(r.run,[e,t].concat(l))})}:function(){for(var i=arguments.length,o=Array(i),s=0;s0&&(o[0]=r.get(o[0],n));var a={target:e,args:o,label:"glimmer-closure-action"};return r.flaggedInstrument("interaction.ember-action",a,function(){return r.run.join.apply(r.run,[e,t].concat(o))})},o[s]=!0,o}e.createClosureAction=i;var o=t.symbol("INVOKE");e.INVOKE=o;var s=t.symbol("ACTION");e.ACTION=s;var a=function(e){function t(t){e.call(this),this.args=t,this.tag=t.tag}return babelHelpers.inherits(t,e),t.create=function(e){return new t(e)},t.prototype.compute=function(){var e=this.args,t=e.named,n=e.positional,s=n.value(),a=s[0],u=n.at(1),l=s[1],c=s.slice(2),p=typeof l,h=l;if(u[o])a=u,h=u[o];else{if(r.isNone(l))throw new r.Error("Action passed is null or undefined in (action) from "+a+".");if("string"===p){var f=l;if(h=null,t.has("target")&&(a=t.get("target").value()),a.actions&&(h=a.actions[f]),!h)throw new r.Error("An action named '"+f+"' was not found in "+a)}else if(h&&"function"==typeof h[o])a=h,h=h[o];else if("function"!==p){var m=u._propertyKey||l;throw new r.Error("An action could not be made for `"+m+"` in "+a+". Please confirm that you are using either a quoted action name (i.e. `(action '"+m+"')`) or a function available in "+a+".")}}var d=t.get("value").value();return i(a,h,d,c)},t}(n.CachedReference);e.ClosureActionReference=a,e.default=function(e,t){return a.create(t)}}),s("ember-glimmer/helpers/component",["exports","ember-utils","ember-glimmer/utils/references","ember-glimmer/syntax/curly-component","glimmer-runtime","ember-metal"],function(e,t,n,r,i,o){"use strict";function s(e,t){var n=a(e,t);return new r.CurlyComponentDefinition(e.name,e.ComponentClass,e.template,n)}function a(e,n){var o=e.args,s=e.ComponentClass,a=s.positionalParams,u=n.positional.values,l=u.slice(1);a&&l.length&&r.validatePositionalParameters(n.named,l,a);var c="string"==typeof a,p={};if(!c&&a&&a.length>0){for(var h=Math.min(a.length,l.length),f=0;f=0)return!0;for(var n=0;n1)if(u=a.at(0),p=a.at(1),p[i.INVOKE])c=p;else{p._propertyKey;c=p.value()}for(var h=[],f=2;f10)throw y=0,v[n].destroy(),new Error("infinite rendering invalidation detected");return y++,m.join(null,p)}y=0}var f=void 0;f=function(e,t){return e[t](),!1};var m=n.run.backburner,d=function(){function e(e,t,n,r){this.view=e,this.outletState=t,this.rootOutletState=n}return e.prototype.child=function(){return new e(this.view,this.outletState,this.rootOutletState)},e.prototype.get=function(e){return this.outletState},e.prototype.set=function(e,t){return this.outletState=t,t},e}(),g=function(){function e(e,t,n,r,o,s){var a=this;this.id=i.getViewId(e),this.env=t,this.root=e,this.result=void 0,this.shouldReflush=!1,this.destroyed=!1,this._removing=!1;var u=this.options={alwaysRevalidate:!1};this.render=function(){var e=a.result=n.render(r,o,s);a.render=function(){e.rerender(u)}}}return e.prototype.isFor=function(e){return this.root===e},e.prototype.destroy=function(){var e=this.result,t=this.env;if(this.destroyed=!0,this.env=null,this.root=null,this.result=null,this.render=null,e){var n=!t.inTransaction;n&&t.begin(),e.destroy(),n&&t.commit()}},e}(),v=[];n.setHasViews(function(){return v.length>0});var y=0;m.on("begin",c),m.on("end",h);var b=function(){function e(e,t){var n=arguments.length<=2||void 0===arguments[2]?i.fallbackViewRegistry:arguments[2],r=!(arguments.length<=3||void 0===arguments[3])&&arguments[3];this._env=e,this._rootTemplate=t,this._viewRegistry=n,this._destinedForDOM=r,this._destroyed=!1,this._roots=[],this._lastRevision=null,this._isRenderingRoots=!1,this._removedRoots=[]}return e.prototype.appendOutletView=function(e,t){var n=new a.TopLevelOutletComponentDefinition(e),r=e.toReference(),i=e.outletState.render.controller;this._appendDefinition(e,n,t,r,i)},e.prototype.appendTo=function(e,t){var n=new s.RootComponentDefinition(e);this._appendDefinition(e,n,t)},e.prototype._appendDefinition=function(e,n,i){var o=arguments.length<=3||void 0===arguments[3]?r.UNDEFINED_REFERENCE:arguments[3],s=arguments.length<=4||void 0===arguments[4]?null:arguments[4],a=new t.RootReference(n),u=new d(null,o,o,!0,s),l=new g(e,this._env,this._rootTemplate,a,i,u);this._renderRoot(l)},e.prototype.rerender=function(e){this._scheduleRevalidate()},e.prototype.register=function(e){var t=i.getViewId(e);this._viewRegistry[t]=e},e.prototype.unregister=function(e){delete this._viewRegistry[i.getViewId(e)]},e.prototype.remove=function(e){e._transitionTo("destroying"),this.cleanupRootFor(e),i.setViewElement(e,null),this._destinedForDOM&&e.trigger("didDestroyElement"),e.isDestroying||e.destroy()},e.prototype.cleanupRootFor=function(e){if(!this._destroyed)for(var t=this._roots,n=this._roots.length;n--;){var r=t[n];r.isFor(e)&&r.destroy()}},e.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this._clearAllRoots())},e.prototype.getElement=function(e){},e.prototype.getBounds=function(e){var t=e[o.BOUNDS],n=t.parentElement(),r=t.firstNode(),i=t.lastNode();return{parentElement:n,firstNode:r,lastNode:i}},e.prototype.createElement=function(e){return this._env.getAppendOperations().createElement(e)},e.prototype._renderRoot=function(e){var t=this._roots;t.push(e),1===t.length&&u(this),this._renderRootsTransaction()},e.prototype._renderRoots=function(){var e=this._roots,t=this._env,n=this._removedRoots,i=void 0,o=void 0;do{t.begin(),o=e.length,i=!1;for(var s=0;s=o&&!u||(a.options.alwaysRevalidate=u,u=a.shouldReflush=f(a,"render"),i=i||u)}}this._lastRevision=r.CURRENT_TAG.value(),t.commit()}while(i||e.length>o);for(;n.length;){var a=n.pop(),c=e.indexOf(a);e.splice(c,1)}0===this._roots.length&&l(this)},e.prototype._renderRootsTransaction=function(){if(!this._isRenderingRoots){this._isRenderingRoots=!0;var e=!1;try{this._renderRoots(),e=!0}finally{e||(this._lastRevision=r.CURRENT_TAG.value()),this._isRenderingRoots=!1}}},e.prototype._clearAllRoots=function(){for(var e=this._roots,t=0;t-1)return c[t]}e.registerSyntax=a,e.findSyntaxBuilder=u;var l=[],c=[];a("render",t.RenderSyntax),a("outlet",n.OutletSyntax),a("mount",r.MountSyntax),a("component",i.DynamicComponentSyntax),a("input",o.InputSyntax),a("-with-dynamic-vars",function(){function e(){}return e.create=function(e,t,n){return new s.WithDynamicVarsSyntax(t)},e}()),a("-in-element",function(){function e(){}return e.create=function(e,t,n){return new s.InElementSyntax(t)},e}())}),s("ember-glimmer/syntax/curly-component",["exports","ember-utils","glimmer-runtime","ember-glimmer/utils/bindings","ember-glimmer/component","ember-metal","ember-views","ember-glimmer/utils/process-args","container"],function(e,t,n,r,i,o,s,a,u){"use strict";function l(e,t){}function c(e,t,n){}function p(e,t){e.named.has("id")&&(t.elementId=t.id)}function h(e,t,n,i){for(var o=[],s=t.length-1;s!==-1;){var a=t[s],u=r.AttributeBinding.parse(a),l=u[1];o.indexOf(l)===-1&&(o.push(l),r.AttributeBinding.install(e,n,u,i)),s--}o.indexOf("id")===-1&&i.addStaticAttribute(e,"id",n.elementId),o.indexOf("style")===-1&&r.IsVisibleBinding.install(e,n,i)}function f(){}function m(e){return e.instrumentDetails({initialRender:!0})}function d(e){return e.instrumentDetails({initialRender:!1})}function g(e){var t=e.dynamicScope().view.tagName;return n.PrimitiveReference.create(""===t?null:t||"div")}function v(e){return e.getSelf().get("ariaRole")}e.validatePositionalParameters=c;var y=babelHelpers.taggedTemplateLiteralLoose(["template:components/-default"],["template:components/-default"]),b=u.privatize(y),_=function(e){function t(t,n,r){e.call(this),this.args=t,this.definition=n,this.symbolTable=r,this.shadow=null}return babelHelpers.inherits(t,e),t.prototype.compile=function(e){e.component.static(this.definition,this.args,this.symbolTable,this.shadow)},t}(n.StatementSyntax);e.CurlyComponentSyntax=_;var w=function(){function e(e,t,n,r){this.environment=e,this.component=t,this.classRef=null,this.args=n,this.argsRevision=n.tag.value(),this.finalizer=r}return e.prototype.destroy=function(){var e=this.component,t=this.environment;t.isInteractive&&(e.trigger("willDestroyElement"),e.trigger("willClearRender")),t.destroyedComponents.push(e)},e.prototype.finalize=function(){var e=this.finalizer;e(),this.finalizer=f},e}(),E=function(){function e(){}return e.prototype.prepareArgs=function(e,t){return c(t.named,t.positional.values,e.ComponentClass.positionalParams),a.gatherArgs(t,e)},e.prototype.create=function(e,t,n,r,s,u){var c=r.view,h=t.ComponentClass,f=a.ComponentArgs.create(n),d=f.value(),g=d.props;p(n,g),g.parentView=c,g[i.HAS_BLOCK]=u,g._targetObject=s.value();var v=h.create(g),y=o._instrumentStart("render.component",m,v);r.view=v,null!==c&&c.appendChild(v),""===v.tagName&&(e.isInteractive&&v.trigger("willRender"),v._transitionTo("hasElement"),e.isInteractive&&v.trigger("willInsertElement"));var b=new w(e,v,f,y);return n.named.has("class")&&(b.classRef=n.named.get("class")),l(v,g),e.isInteractive&&""!==v.tagName&&v.trigger("willRender"),b},e.prototype.layoutFor=function(e,t,n){var r=e.template;if(!r){var i=t.component;r=this.templateFor(i,n)}return n.getCompiledBlock(k,r)},e.prototype.templateFor=function(e,n){var r=o.get(e,"layout"),i=e[t.OWNER];if(r)return n.getTemplate(r,i);var s=o.get(e,"layoutName");if(s){var a=i.lookup("template:"+s);if(a)return a}return i.lookup(b)},e.prototype.getSelf=function(e){var t=e.component;return t[i.ROOT_REF]},e.prototype.didCreateElement=function(e,t,n){var i=e.component,o=e.classRef,a=e.environment;s.setViewElement(i,t);var u=i.attributeBindings,l=i.classNames,c=i.classNameBindings;u&&u.length?h(t,u,i,n):(n.addStaticAttribute(t,"id",i.elementId),r.IsVisibleBinding.install(t,i,n)),o&&n.addDynamicAttribute(t,"class",o),l&&l.length&&l.forEach(function(e){n.addStaticAttribute(t,"class",e)}),c&&c.length&&c.forEach(function(e){r.ClassNameBinding.install(t,i,e,n)}),i._transitionTo("hasElement"),a.isInteractive&&i.trigger("willInsertElement")},e.prototype.didRenderLayout=function(e,t){e.component[i.BOUNDS]=t,e.finalize()},e.prototype.getTag=function(e){var t=e.component;return t[i.DIRTY_TAG]},e.prototype.didCreate=function(e){var t=e.component,n=e.environment;n.isInteractive&&(t._transitionTo("inDOM"),t.trigger("didInsertElement"),t.trigger("didRender"))},e.prototype.update=function(e,t,n){var r=e.component,s=e.args,a=e.argsRevision,u=e.environment;if(e.finalizer=o._instrumentStart("render.component",d,r),!s.tag.validate(a)){var l=s.value(),c=l.attrs,p=l.props;e.argsRevision=s.tag.value();var h=r.attrs,f=c;r[i.IS_DISPATCHING_ATTRS]=!0,r.setProperties(p),r[i.IS_DISPATCHING_ATTRS]=!1,r.trigger("didUpdateAttrs",{oldAttrs:h,newAttrs:f}),r.trigger("didReceiveAttrs",{oldAttrs:h,newAttrs:f})}u.isInteractive&&(r.trigger("willUpdate"),r.trigger("willRender"))},e.prototype.didUpdateLayout=function(e){e.finalize()},e.prototype.didUpdate=function(e){var t=e.component,n=e.environment;n.isInteractive&&(t.trigger("didUpdate"),t.trigger("didRender"))},e.prototype.getDestructor=function(e){return e},e}(),O=new E,S=function(e){function t(){e.apply(this,arguments)}return babelHelpers.inherits(t,e),t.prototype.create=function(e,t,n,r,i,s){var a=t.ComponentClass,u=o._instrumentStart("render.component",m,a);return r.view=a,""===a.tagName&&(e.isInteractive&&a.trigger("willRender"),a._transitionTo("hasElement"),e.isInteractive&&a.trigger("willInsertElement")),l(a,{}),new w(e,a,n,u)},t}(E),x=new S,C=function(e){function t(t,n,r,i){e.call(this,t,O,n),this.template=r,this.args=i}return babelHelpers.inherits(t,e),t}(n.ComponentDefinition);e.CurlyComponentDefinition=C;var A=function(e){function t(t){e.call(this,"-root",x,t),this.template=void 0,this.args=void 0}return babelHelpers.inherits(t,e),t}(n.ComponentDefinition);e.RootComponentDefinition=A;var k=function(){function e(e){this.template=e}return e.prototype.compile=function(e){e.wrapLayout(this.template.asLayout()),e.tag.dynamic(g),e.attrs.dynamic("role",v),e.attrs.static("class","ember-view")},e}();k.id="curly"}),s("ember-glimmer/syntax/dynamic-component",["exports","glimmer-runtime","glimmer-reference","ember-metal"],function(e,t,n,r){"use strict";function i(e,t){var n=e.env,r=e.getArgs(),i=r.positional.at(0);return new s({nameRef:i,env:n,symbolTable:t})}var o=function(e){function n(t,n,r){e.call(this),this.definition=i,this.definitionArgs=t,this.args=n,this.symbolTable=r,this.shadow=null}return babelHelpers.inherits(n,e),n.create=function(e,n,r){var i=t.ArgsSyntax.fromPositionalArgs(n.positional.slice(0,1)),o=t.ArgsSyntax.build(n.positional.slice(1),n.named,n.blocks);return new this(i,o,r)},n.fromPath=function(e,n,r,i){var o=t.ArgsSyntax.fromPositionalArgs(t.PositionalArgsSyntax.build([t.GetSyntax.build(n.join("."))]));return new this(o,r,i)},n.prototype.compile=function(e){e.component.dynamic(this.definitionArgs,this.definition,this.args,this.symbolTable,this.shadow)},n}(t.StatementSyntax);e.DynamicComponentSyntax=o;var s=function(){function e(e){var t=e.nameRef,n=e.env,r=e.symbolTable,i=e.args;this.tag=t.tag,this.nameRef=t,this.env=n,this.symbolTable=r,this.args=i}return e.prototype.value=function(){var e=this.env,n=this.nameRef,r=this.symbolTable,i=n.value();if("string"==typeof i){var o=e.getComponentDefinition([i],r);return o}return t.isComponentDefinition(i)?i:null},e.prototype.get=function(){return n.UNDEFINED_REFERENCE},e}()}),s("ember-glimmer/syntax/input",["exports","ember-metal","ember-glimmer/syntax/curly-component","ember-glimmer/syntax/dynamic-component","ember-glimmer/utils/bindings"],function(e,t,n,r,i){"use strict";function o(e,t,r){var o=t("-text-field");return i.wrapComponentClassAttribute(e),new n.CurlyComponentSyntax(e,o,r)}var s={create:function(e,t,s){var a=function(t){return e.getComponentDefinition([t],s)};if(!t.named.has("type"))return o(t,a,s);var u=t.named.at("type");if("value"===u.type){if("checkbox"===u.value){i.wrapComponentClassAttribute(t);var l=a("-checkbox");return new n.CurlyComponentSyntax(t,l,s)}return o(t,a,s)}return r.DynamicComponentSyntax.create(e,t,s)}};e.InputSyntax=s}),s("ember-glimmer/syntax/mount",["exports","glimmer-runtime","glimmer-reference","ember-metal","ember-glimmer/utils/references","ember-routing","ember-glimmer/syntax/outlet"],function(e,t,n,r,i,o,s){"use strict";var a=function(e){function n(t,n){e.call(this),this.definition=t,this.symbolTable=n}return babelHelpers.inherits(n,e),n.create=function(e,t,r){var i=t.positional.at(0).inner(),o=new c(i,e);return new n(o,r)},n.prototype.compile=function(e){e.component.static(this.definition,t.ArgsSyntax.empty(),null,this.symbolTable,null)},n}(t.StatementSyntax);e.MountSyntax=a;var u=function(){function e(){}return e.prototype.prepareArgs=function(e,t){return t},e.prototype.create=function(e,t,r,i){var o=t.name,s=t.env;i.outletState=n.UNDEFINED_REFERENCE;var a=s.owner.buildChildEngineInstance(o);return a.boot(),{engine:a}},e.prototype.layoutFor=function(e,t,n){var r=t.engine,i=r.lookup("template:application");return n.getCompiledBlock(s.OutletLayoutCompiler,i)},e.prototype.getSelf=function(e){var t=e.engine,n=t._lookupFactory("controller:application")||o.generateControllerFactory(t,"application"); -return new i.RootReference(n.create())},e.prototype.getTag=function(){return null},e.prototype.getDestructor=function(e){var t=e.engine;return t},e.prototype.didCreateElement=function(){},e.prototype.didRenderLayout=function(){},e.prototype.didCreate=function(e){},e.prototype.update=function(e,t,n){},e.prototype.didUpdateLayout=function(){},e.prototype.didUpdate=function(e){},e}(),l=new u,c=function(e){function t(t,n){e.call(this,t,l,null),this.env=n}return babelHelpers.inherits(t,e),t}(t.ComponentDefinition)}),s("ember-glimmer/syntax/outlet",["exports","ember-utils","glimmer-runtime","ember-metal","ember-glimmer/utils/references","glimmer-reference"],function(e,t,n,r,i,o){"use strict";function s(e){var t=e.dynamicScope(),n=t.outletState,r=e.getArgs(),i=void 0;return i=0===r.positional.length?new o.ConstReference("main"):r.positional.at(0),new p(i,n)}function a(e,t,n){return t||n?!t&&n||t&&!n?null:n.render.template===t.render.template&&n.render.controller===t.render.controller?e:null:e}function u(e){var t=e.render,n=t.name,r=t.outlet;return{object:n+":"+r}}function l(){}var c=function(e){function t(t,r,i){e.call(this),this.definitionArgs=r,this.definition=s,this.args=n.ArgsSyntax.empty(),this.symbolTable=i,this.shadow=null}return babelHelpers.inherits(t,e),t.create=function(e,t,r){var i=n.ArgsSyntax.fromPositionalArgs(t.positional.slice(0,1));return new this(e,i,r)},t.prototype.compile=function(e){e.component.dynamic(this.definitionArgs,this.definition,this.args,this.symbolTable,this.shadow)},t}(n.StatementSyntax);e.OutletSyntax=c;var p=function(){function e(e,t){this.outletNameRef=e,this.parentOutletStateRef=t,this.definition=null,this.lastState=null;var n=this.outletStateTag=new o.UpdatableTag(t.tag);this.tag=o.combine([n.tag,e.tag])}return e.prototype.value=function(){var e=this.outletNameRef,t=this.parentOutletStateRef,n=this.definition,r=this.lastState,i=e.value(),o=t.get("outlets").get(i),s=this.lastState=o.value();this.outletStateTag.update(o.tag),n=a(n,r,s);var u=s&&s.render.template;return n?n:u?this.definition=new b(i,s.render.template):this.definition=null},e}(),h=function(){function e(e){this.outletState=e,this.instrument()}return e.prototype.instrument=function(){this.finalizer=r._instrumentStart("render.outlet",u,this.outletState)},e.prototype.finalize=function(){var e=this.finalizer;e(),this.finalizer=l},e}(),f=function(){function e(){}return e.prototype.prepareArgs=function(e,t){return t},e.prototype.create=function(e,t,n,r){var i=r.outletState=r.outletState.get("outlets").get(t.outletName),o=i.value();return new h(o)},e.prototype.layoutFor=function(e,t,n){return n.getCompiledBlock(_,e.template)},e.prototype.getSelf=function(e){var t=e.outletState;return new i.RootReference(t.render.controller)},e.prototype.getTag=function(){return null},e.prototype.getDestructor=function(){return null},e.prototype.didRenderLayout=function(e){e.finalize()},e.prototype.didCreateElement=function(){},e.prototype.didCreate=function(e){},e.prototype.update=function(e){},e.prototype.didUpdateLayout=function(e){},e.prototype.didUpdate=function(e){},e}(),m=new f,d=function(e){function t(){e.apply(this,arguments)}return babelHelpers.inherits(t,e),t.prototype.create=function(e,t,n,r){return new h(r.outletState.value())},t.prototype.layoutFor=function(e,t,n){return n.getCompiledBlock(y,e.template)},t}(f),g=new d,v=function(e){function n(n){e.call(this,"outlet",g,n),this.template=n.template,t.generateGuid(this)}return babelHelpers.inherits(n,e),n}(n.ComponentDefinition);e.TopLevelOutletComponentDefinition=v;var y=function(){function e(e){this.template=e}return e.prototype.compile=function(e){e.wrapLayout(this.template.asLayout()),e.tag.static("div"),e.attrs.static("id",t.guidFor(this)),e.attrs.static("class","ember-view")},e}();y.id="top-level-outlet";var b=function(e){function n(n,r){e.call(this,"outlet",m,null),this.outletName=n,this.template=r,t.generateGuid(this)}return babelHelpers.inherits(n,e),n}(n.ComponentDefinition),_=function(){function e(e){this.template=e}return e.prototype.compile=function(e){e.wrapLayout(this.template.asLayout())},e}();e.OutletLayoutCompiler=_,_.id="outlet"}),s("ember-glimmer/syntax/render",["exports","glimmer-runtime","glimmer-reference","ember-metal","ember-glimmer/utils/references","ember-routing","ember-glimmer/syntax/outlet"],function(e,t,n,r,i,o,s){"use strict";function a(e){var t=e.env,r=e.getArgs(),i=r.positional.at(0),o=i.value(),s=t.owner.lookup("template:"+o),a=void 0;if(r.named.has("controller")){var u=r.named.get("controller");a=u.value()}else a=o;return 1===r.positional.length?new n.ConstReference(new m(a,s,t,p)):new n.ConstReference(new m(a,s,t,f))}var u=function(e){function n(n,r,i){e.call(this),this.definitionArgs=r,this.definition=a,this.args=t.ArgsSyntax.fromPositionalArgs(r.positional.slice(1,2)),this.symbolTable=i,this.shadow=null}return babelHelpers.inherits(n,e),n.create=function(e,t,n){return new this(e,t,n)},n.prototype.compile=function(e){e.component.dynamic(this.definitionArgs,this.definition,this.args,this.symbolTable,this.shadow)},n}(t.StatementSyntax);e.RenderSyntax=u;var l=function(){function e(){}return e.prototype.prepareArgs=function(e,t){return t},e.prototype.layoutFor=function(e,t,n){return n.getCompiledBlock(s.OutletLayoutCompiler,e.template)},e.prototype.getSelf=function(e){var t=e.controller;return new i.RootReference(t)},e.prototype.getTag=function(){return null},e.prototype.getDestructor=function(){return null},e.prototype.didCreateElement=function(){},e.prototype.didRenderLayout=function(){},e.prototype.didCreate=function(){},e.prototype.update=function(){},e.prototype.didUpdateLayout=function(){},e.prototype.didUpdate=function(){},e}(),c=function(e){function t(){e.apply(this,arguments)}return babelHelpers.inherits(t,e),t.prototype.create=function(e,t,n,r){var i=t.name,s=t.env,a=s.owner.lookup("controller:"+i)||o.generateController(s.owner,i);return r.rootOutletState&&(r.outletState=r.rootOutletState.getOrphan(i)),{controller:a}},t}(l),p=new c,h=function(e){function t(){e.apply(this,arguments)}return babelHelpers.inherits(t,e),t.prototype.create=function(e,t,n,r){var i=t.name,s=t.env,a=n.positional.at(0),u=s.owner._lookupFactory("controller:"+i)||o.generateControllerFactory(s.owner,i),l=u.create({model:a.value()});return r.rootOutletState&&(r.outletState=r.rootOutletState.getOrphan(i)),{controller:l}},t.prototype.update=function(e,t,n){var r=e.controller;r.set("model",t.positional.at(0).value())},t.prototype.getDestructor=function(e){var t=e.controller;return t},t}(l),f=new h,m=function(e){function t(t,n,r,i){e.call(this,"render",i,null),this.name=t,this.template=n,this.env=r}return babelHelpers.inherits(t,e),t}(t.ComponentDefinition)}),s("ember-glimmer/template",["exports","ember-utils","glimmer-runtime"],function(e,t,n){"use strict";function r(e){var r=n.templateFactory(e);return{id:r.id,meta:r.meta,create:function(e){return r.create(e.env,{owner:e[t.OWNER]})}}}e.default=r}),s("ember-glimmer/template_registry",["exports"],function(e){"use strict";function t(e){s=e}function n(){return s}function r(e){if(s.hasOwnProperty(e))return s[e]}function i(e){return s.hasOwnProperty(e)}function o(e,t){return s[e]=t}e.setTemplates=t,e.getTemplates=n,e.getTemplate=r,e.hasTemplate=i,e.setTemplate=o;var s={}}),s("ember-glimmer/templates/component",["exports","ember-glimmer/template"],function(e,t){"use strict";e.default=t.default({id:"ZoGfVsSJ",block:'{"statements":[["yield","default"]],"locals":[],"named":[],"yields":["default"],"blocks":[],"hasPartials":false}',meta:{moduleName:"ember-glimmer/templates/component.hbs"}})}),s("ember-glimmer/templates/empty",["exports","ember-glimmer/template"],function(e,t){"use strict";e.default=t.default({id:"qEHL4OLi",block:'{"statements":[],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":false}',meta:{moduleName:"ember-glimmer/templates/empty.hbs"}})}),s("ember-glimmer/templates/link-to",["exports","ember-glimmer/template"],function(e,t){"use strict";e.default=t.default({id:"Ca7iQMR7",block:'{"statements":[["block",["if"],[["get",["linkTitle"]]],null,1,0]],"locals":[],"named":[],"yields":["default"],"blocks":[{"statements":[["yield","default"]],"locals":[]},{"statements":[["append",["unknown",["linkTitle"]],false]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"ember-glimmer/templates/link-to.hbs"}})}),s("ember-glimmer/templates/outlet",["exports","ember-glimmer/template"],function(e,t){"use strict";e.default=t.default({id:"sYQo9vi/",block:'{"statements":[["append",["unknown",["outlet"]],false]],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":false}',meta:{moduleName:"ember-glimmer/templates/outlet.hbs"}})}),s("ember-glimmer/templates/root",["exports","ember-glimmer/template"],function(e,t){"use strict";e.default=t.default({id:"Eaf3RPY3",block:'{"statements":[["append",["helper",["component"],[["get",[null]]],null],false]],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":false}',meta:{moduleName:"ember-glimmer/templates/root.hbs"}})}),s("ember-glimmer/utils/bindings",["exports","glimmer-reference","glimmer-runtime","ember-metal","ember-runtime","ember-glimmer/component","ember-glimmer/utils/string"],function(e,t,n,r,i,o,s){"use strict";function a(e,t){return e[o.ROOT_REF].get(t)}function u(e,n){var r="attrs"===n[0];return r&&(n.shift(),1===n.length)?a(e,n[0]):t.referenceFromParts(e[o.ROOT_REF],n)}function l(e){var t=e.named,r=t.keys.indexOf("class");if(r!==-1){var i=t.values[r],o=i.ref,s=i.type;if("get"===s){var a=o.parts[o.parts.length-1];t.values[r]=n.HelperSyntax.fromSpec(["helper",["-class"],[["get",o.parts],a],null])}}return e}e.wrapComponentClassAttribute=l;var c={parse:function(e){var t=e.indexOf(":");if(t===-1)return[e,e,!0];var n=e.substring(0,t),r=e.substring(t+1);return[n,r,!1]},install:function(e,t,n,i){var o=n[0],s=n[1];n[2];if("id"===s){var l=r.get(t,o);return void 0!==l&&null!==l||(l=t.elementId),void i.addStaticAttribute(e,"id",l)}var c=o.indexOf(".")>-1,p=c?u(t,o.split(".")):a(t,o);"style"===s&&(p=new f(p,a(t,"isVisible"))),i.addDynamicAttribute(e,s,p)}};e.AttributeBinding=c;var p="display: none;",h=s.htmlSafe(p),f=function(e){function n(n,r){e.call(this),this.tag=t.combine([n.tag,r.tag]),this.inner=n,this.isVisible=r}return babelHelpers.inherits(n,e),n.prototype.compute=function(){var e=this.inner.value(),t=this.isVisible.value();if(t!==!1)return e;if(e||0===e){var n=e+" "+p;return s.isHTMLSafe(e)?s.htmlSafe(n):n}return h},n}(t.CachedReference),m={install:function(e,n,r){r.addDynamicAttribute(e,"style",t.map(a(n,"isVisible"),this.mapStyleValue))},mapStyleValue:function(e){return e===!1?h:null}};e.IsVisibleBinding=m;var d={install:function(e,t,n,r){var i=n.split(":"),o=i[0],s=i[1],l=i[2],c=""===o;if(c)r.addStaticAttribute(e,"class",s);else{var p=o.indexOf(".")>-1,h=p&&o.split("."),f=p?u(t,h):a(t,o),m=void 0;m=void 0===s?new g(f,p?h[h.length-1]:o):new v(f,s,l),r.addDynamicAttribute(e,"class",m)}}};e.ClassNameBinding=d;var g=function(e){function t(t,n){e.call(this),this.tag=t.tag,this.inner=t,this.path=n,this.dasherizedPath=null}return babelHelpers.inherits(t,e),t.prototype.compute=function(){var e=this.inner.value();if(e===!0){var t=this.path,n=this.dasherizedPath;return n||(this.dasherizedPath=i.String.dasherize(t))}return e||0===e?e:null},t}(t.CachedReference),v=function(e){function t(t,n,r){e.call(this),this.tag=t.tag,this.inner=t,this.truthy=n||null,this.falsy=r||null}return babelHelpers.inherits(t,e),t.prototype.compute=function(){var e=this.inner,t=this.truthy,n=this.falsy;return e.value()?t:n},t}(t.CachedReference)}),s("ember-glimmer/utils/iterable",["exports","ember-utils","ember-metal","ember-runtime","ember-glimmer/utils/references","ember-glimmer/helpers/each-in","glimmer-reference"],function(e,t,n,r,i,o,s){"use strict";function a(e,t){return o.isEachIn(e)?new b(e,u(t)):new _(e,l(t))}function u(e){switch(e){case"@index":case void 0:case null:return c;case"@identity":return p;default:return function(t){return n.get(t,e)}}}function l(e){switch(e){case"@index":return c;case"@identity":case void 0:case null:return p;default:return function(t){return n.get(t,e)}}}function c(e,t){return String(t)}function p(e){switch(typeof e){case"string":case"number":return String(e);default:return t.guidFor(e)}}function h(e,t){var n=e[t];return n?(e[t]++,""+t+f+n):(e[t]=1,t)}e.default=a;var f="be277757-bbbe-4620-9fcb-213ef433cca2",m=function(){function e(e,n){this.array=e,this.length=e.length,this.keyFor=n,this.position=0,this.seen=new t.EmptyObject}return e.prototype.isEmpty=function(){return!1},e.prototype.next=function(){var e=this.array,t=this.length,n=this.keyFor,r=this.position,i=this.seen;if(r>=t)return null;var o=e[r],s=r,a=h(i,n(o,s));return this.position++,{key:a,value:o,memo:s}},e}(),d=function(){function e(e,r){this.array=e,this.length=n.get(e,"length"),this.keyFor=r,this.position=0,this.seen=new t.EmptyObject}return e.prototype.isEmpty=function(){return 0===this.length},e.prototype.next=function(){var e=this.array,t=this.length,n=this.keyFor,i=this.position,o=this.seen;if(i>=t)return null;var s=r.objectAt(e,i),a=i,u=h(o,n(s,a));return this.position++,{key:u,value:s,memo:a}},e}(),g=function(){function e(e,n,r){this.keys=e,this.values=n,this.keyFor=r,this.position=0,this.seen=new t.EmptyObject}return e.prototype.isEmpty=function(){return 0===this.keys.length},e.prototype.next=function(){var e=this.keys,t=this.values,n=this.keyFor,r=this.position,i=this.seen;if(r>=e.length)return null;var o=t[r],s=e[r],a=h(i,n(o,s));return this.position++,{key:a,value:o,memo:s}},e}(),v=function(){function e(){}return e.prototype.isEmpty=function(){return!0},e.prototype.next=function(){throw new Error("Cannot call next() on an empty iterator")},e}(),y=new v,b=function(){function e(e,t){this.ref=e,this.keyFor=t;var n=this.valueTag=new s.UpdatableTag(s.CONSTANT_TAG);this.tag=s.combine([e.tag,n])}return e.prototype.iterate=function(){var e=this.ref,t=this.keyFor,r=this.valueTag,i=e.value();r.update(n.tagFor(i)),n.isProxy(i)&&(i=n.get(i,"content"));var o=typeof i;if(!i||"object"!==o&&"function"!==o)return y;var s=Object.keys(i),a=s.map(function(e){return i[e]});return s.length>0?new g(s,a,t):y},e.prototype.valueReferenceFor=function(e){return new i.UpdatablePrimitiveReference(e.memo)},e.prototype.updateValueReference=function(e,t){e.update(t.memo)},e.prototype.memoReferenceFor=function(e){return new i.UpdatableReference(e.value)},e.prototype.updateMemoReference=function(e,t){e.update(t.value)},e}(),_=function(){function e(e,t){this.ref=e,this.keyFor=t;var n=this.valueTag=new s.UpdatableTag(s.CONSTANT_TAG);this.tag=s.combine([e.tag,n])}return e.prototype.iterate=function(){var e=this.ref,t=this.keyFor,i=this.valueTag,o=e.value();if(i.update(n.tagForProperty(o,"[]")),!o||"object"!=typeof o)return y;if(Array.isArray(o))return o.length>0?new m(o,t):y;if(r.isEmberArray(o))return n.get(o,"length")>0?new d(o,t):y;if("function"!=typeof o.forEach)return y;var s=function(){var e=[];return o.forEach(function(t){e.push(t)}),{v:e.length>0?new m(e,t):y}}();return"object"==typeof s?s.v:void 0},e.prototype.valueReferenceFor=function(e){return new i.UpdatableReference(e.value)},e.prototype.updateValueReference=function(e,t){e.update(t.value)},e.prototype.memoReferenceFor=function(e){return new i.UpdatablePrimitiveReference(e.memo)},e.prototype.updateMemoReference=function(e,t){e.update(t.memo)},e}()}),s("ember-glimmer/utils/process-args",["exports","ember-utils","glimmer-reference","ember-glimmer/component","ember-glimmer/utils/references","ember-views","ember-glimmer/helpers/action","glimmer-runtime"],function(e,t,n,r,i,o,s,a){"use strict";function u(e,t){var n=l(e,t),r=c(e,t);return p(n,r,e.blocks,t.ComponentClass)}function l(e,n){var r=e.named.map;return n.args?t.assign({},n.args.named.map,r):r}function c(e,t){var n=e.positional.values;if(t.args){var r=t.args.positional.values,i=[];return i.push.apply(i,r),i.splice.apply(i,[0,n.length].concat(n)),i}return n}function p(e,t,n,r){var i=r.positionalParams;return i&&i.length>0&&t.length>0&&(e="string"==typeof i?h(e,t,i):f(e,t,i)),a.EvaluatedArgs.named(e,n)}function h(e,n,r){var i=t.assign({},e);return i[r]=a.EvaluatedPositionalArgs.create(n),i}function f(e,n,r){for(var i=t.assign({},e),o=Math.min(n.length,r.length),s=0;s":">",'"':""","'":"'","`":"`","=":"="},l=/[&<>"'`=]/,c=/[&<>"'`=]/g}),s("ember-glimmer/utils/to-bool",["exports","ember-runtime","ember-metal"],function(e,t,n){"use strict";function r(e){return!!e&&(e===!0||(!t.isArray(e)||0!==n.get(e,"length")))}e.default=r}),s("ember-glimmer/views/outlet",["exports","ember-utils","glimmer-reference","ember-environment","ember-metal"],function(e,t,n,r,i){"use strict";var o=function(){function e(e){this.outletView=e,this.tag=e._tag}return e.prototype.get=function(e){return new a(this,e)},e.prototype.value=function(){return this.outletView.outletState},e.prototype.getOrphan=function(e){return new s(this,e)},e.prototype.update=function(e){this.outletView.setOutletState(e)},e}(),s=function(e){function n(t,n){e.call(this,t.outletView),this.root=t,this.name=n}return babelHelpers.inherits(n,e),n.prototype.value=function(){var e=this.root.value(),n=e.outlets.main.outlets.__ember_orphans__;if(!n)return null;var r=n.outlets[this.name];if(!r)return null;var i=new t.EmptyObject;return i[r.render.outlet]=r,r.wasUsed=!0,{outlets:i}},n}(o),a=function(){function e(e,t){this.parent=e,this.key=t,this.tag=e.tag}return e.prototype.get=function(t){return new e(this,t)},e.prototype.value=function(){return this.parent.value()[this.key]},e}(),u=function(){function e(e,t,r,i){this._environment=e,this.renderer=t,this.owner=r,this.template=i,this.outletState=null,this._tag=new n.DirtyableTag}return e.extend=function(n){return function(e){function r(){e.apply(this,arguments)}return babelHelpers.inherits(r,e),r.create=function(r){return r?e.create.call(this,t.assign({},n,r)):e.create.call(this,n)},r}(e)},e.reopenClass=function(e){t.assign(this,e)},e.create=function(n){var r=n._environment,i=n.renderer,o=n.template,s=n[t.OWNER];return new e(r,i,s,o)},e.prototype.appendTo=function(e){var t=this._environment||r.environment,n=void 0;n=t.hasDOM&&"string"==typeof e?document.querySelector(e):e,i.run.schedule("render",this.renderer,"appendOutletView",this,n)},e.prototype.rerender=function(){},e.prototype.setOutletState=function(e){this.outletState={outlets:{main:e},render:{owner:void 0,into:void 0,outlet:"main",name:"-top-level",controller:void 0,ViewClass:void 0,template:void 0}},this._tag.dirty()},e.prototype.toReference=function(){return new o(this)},e.prototype.destroy=function(){},e}();e.default=u}),s("ember-metal/alias",["exports","ember-utils","ember-metal/debug","ember-metal/property_get","ember-metal/property_set","ember-metal/error","ember-metal/properties","ember-metal/computed","ember-metal/meta","ember-metal/dependent_keys"],function(e,t,n,r,i,o,s,a,u,l){"use strict";function c(e){return new p(e)}function p(e){this.isDescriptor=!0,this.altKey=e,this._dependentKeys=[e]}function h(e,n,r){throw new o.default("Cannot set read-only property '"+n+"' on object: "+t.inspect(e))}function f(e,t,n){return s.defineProperty(e,t,null),i.set(e,t,n)}e.default=c,e.AliasedProperty=p,p.prototype=Object.create(s.Descriptor.prototype),p.prototype.setup=function(e,t){var n=u.meta(e);n.peekWatching(t)&&l.addDependentKeys(this,e,t,n)},p.prototype._addDependentKeyIfMissing=function(e,t){var n=u.meta(e);n.peekDeps(this.altKey,t)||l.addDependentKeys(this,e,t,n)},p.prototype._removeDependentKeyIfAdded=function(e,t){var n=u.meta(e);n.peekDeps(this.altKey,t)&&l.removeDependentKeys(this,e,t,n)},p.prototype.willWatch=p.prototype._addDependentKeyIfMissing,p.prototype.didUnwatch=p.prototype._removeDependentKeyIfAdded,p.prototype.teardown=p.prototype._removeDependentKeyIfAdded,p.prototype.get=function(e,t){return this._addDependentKeyIfMissing(e,t),r.get(e,this.altKey)},p.prototype.set=function(e,t,n){return i.set(e,this.altKey,n)},p.prototype.readOnly=function(){return this.set=h,this},p.prototype.oneWay=function(){return this.set=f,this},p.prototype._meta=void 0,p.prototype.meta=a.ComputedProperty.prototype.meta}),s("ember-metal/binding",["exports","ember-utils","ember-console","ember-environment","ember-metal/run_loop","ember-metal/debug","ember-metal/property_get","ember-metal/property_set","ember-metal/events","ember-metal/observer","ember-metal/path_cache"],function(e,t,n,r,i,o,s,a,u,l,c){"use strict";function p(e,t){this._from=t,this._to=e,this._oneWay=void 0,this._direction=void 0,this._readyToSync=void 0,this._fromObj=void 0,this._fromPath=void 0,this._toObj=void 0}function h(e,t,n,r,i,o){}function f(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}function m(e,t,n){return new p(t,n).connect(e)}e.bind=m,p.prototype={copy:function(){var e=new p(this._to,this._from);return this._oneWay&&(e._oneWay=!0),e},from:function(e){return this._from=e,this},to:function(e){return this._to=e,this},oneWay:function(){return this._oneWay=!0,this},toString:function(){var e=this._oneWay?"[oneWay]":"";return"Ember.Binding<"+t.guidFor(this)+">("+this._from+" -> "+this._to+")"+e},connect:function(e){var t=void 0,n=void 0,i=void 0;if(c.isGlobalPath(this._from)){var o=c.getFirstKey(this._from);i=r.context.lookup[o],i&&(t=i,n=c.getTailPath(this._from))}return void 0===t&&(t=e,n=this._from),a.trySet(e,this._to,s.get(t,n)),l.addObserver(t,n,this,"fromDidChange"),this._oneWay||l.addObserver(e,this._to,this,"toDidChange"),u.addListener(e,"willDestroy",this,"disconnect"),h(e,this._to,this._from,i,this._oneWay,!i&&!this._oneWay),this._readyToSync=!0,this._fromObj=t,this._fromPath=n,this._toObj=e,this},disconnect:function(){return l.removeObserver(this._fromObj,this._fromPath,this,"fromDidChange"),this._oneWay||l.removeObserver(this._toObj,this._to,this,"toDidChange"),this._readyToSync=!1,this},fromDidChange:function(e){this._scheduleSync("fwd")},toDidChange:function(e){this._scheduleSync("back")},_scheduleSync:function(e){var t=this._direction;void 0===t&&(i.default.schedule("sync",this,"_sync"),this._direction=e),"back"===t&&"fwd"===e&&(this._direction="fwd")},_sync:function(){var e=r.ENV.LOG_BINDINGS,t=this._toObj;if(!t.isDestroyed&&this._readyToSync){var i=this._direction,o=this._fromObj,u=this._fromPath;if(this._direction=void 0,"fwd"===i){var c=s.get(o,u);e&&n.default.log(" ",this.toString(),"->",c,o),this._oneWay?a.trySet(t,this._to,c):l._suspendObserver(t,this._to,this,"toDidChange",function(){a.trySet(t,this._to,c)})}else if("back"===i){var p=s.get(t,this._to);e&&n.default.log(" ",this.toString(),"<-",p,t),l._suspendObserver(o,u,this,"fromDidChange",function(){a.trySet(o,u,p)})}}}},f(p,{from:function(e){var t=this;return new t(void 0,e)},to:function(e){var t=this;return new t(e,void 0)}}),e.Binding=p}),s("ember-metal/cache",["exports","ember-utils","ember-metal/meta"],function(e,t,n){"use strict";var r=function(){function e(e,t,n,r){this.size=0,this.misses=0,this.hits=0,this.limit=e,this.func=t,this.key=n,this.store=r||new i}return e.prototype.get=function(e){var t=void 0===this.key?e:this.key(e),r=this.store.get(t);return void 0===r?(this.misses++,r=this._set(t,this.func(e))):r===n.UNDEFINED?(this.hits++,r=void 0):this.hits++,r},e.prototype.set=function(e,t){var n=void 0===this.key?e:this.key(e);return this._set(n,t)},e.prototype._set=function(e,t){return this.limit>this.size&&(this.size++,void 0===t?this.store.set(e,n.UNDEFINED):this.store.set(e,t)),t},e.prototype.purge=function(){this.store.clear(),this.size=0,this.hits=0,this.misses=0},e}();e.default=r;var i=function(){function e(){this.data=new t.EmptyObject}return e.prototype.get=function(e){return this.data[e]},e.prototype.set=function(e,t){this.data[e]=t},e.prototype.clear=function(){this.data=new t.EmptyObject},e}()}),s("ember-metal/chains",["exports","ember-utils","ember-metal/property_get","ember-metal/meta","ember-metal/watch_key","ember-metal/watch_path"],function(e,t,n,r,i,o){"use strict";function s(e){return e.match(g)[0]}function a(e){return"object"==typeof e&&e}function u(e){return!(a(e)&&e.isDescriptor&&e._volatile===!1)}function l(){this.chains=new t.EmptyObject}function c(){return new l}function p(e,t,n){var o=r.meta(e);o.writableChainWatchers(c).add(t,n),i.watchKey(e,t,o)}function h(e,t,n,o){if(a(e)){var s=o||r.peekMeta(e);s&&s.readableChainWatchers()&&(s=r.meta(e),s.readableChainWatchers().remove(t,n),i.unwatchKey(e,t,s))}}function f(e,t,n){if(this._parent=e,this._key=t,this._watching=void 0===n,this._chains=void 0,this._object=void 0,this.count=0,this._value=n,this._paths={},this._watching){var r=e.value();if(!a(r))return;this._object=r,p(this._object,this._key,this)}}function m(e,t){if(a(e)){var i=r.peekMeta(e);if(!i||i.proto!==e){if(u(e[t]))return n.get(e,t);var o=i.readableCache();return o&&t in o?o[t]:void 0}}}function d(e){var t=r.peekMeta(e);if(t){t=r.meta(e);var n=t.readableChainWatchers();n&&n.revalidateAll(),t.readableChains()&&t.writableChains(o.makeChainNode)}}e.finishChains=d;var g=/^([^\.]+)/;l.prototype={add:function(e,t){var n=this.chains[e];void 0===n?this.chains[e]=[t]:n.push(t)},remove:function(e,t){var n=this.chains[e];if(n)for(var r=0;r0&&t[e]--;var n=s(e),r=e.slice(n.length+1);this.unchain(n,r)},chain:function(e,n){var r=this._chains,i=void 0;void 0===r?r=this._chains=new t.EmptyObject:i=r[e],void 0===i&&(i=r[e]=new f(this,e,void 0)),i.count++,n&&(e=s(n),n=n.slice(e.length+1),i.chain(e,n))},unchain:function(e,t){var n=this._chains,r=n[e];if(t&&t.length>1){var i=s(t),o=t.slice(i.length+1);r.unchain(i,o)}r.count--,r.count<=0&&(n[r._key]=void 0,r.destroy())},notify:function(e,t){if(e&&this._watching){var n=this._parent.value();n!==this._object&&(this._object&&h(this._object,this._key,this),a(n)?(this._object=n,p(n,this._key,this)):this._object=void 0),this._value=void 0}var r=this._chains,i=void 0;if(r)for(var o in r)i=r[o],void 0!==i&&i.notify(e,t);t&&this._parent&&this._parent.populateAffected(this._key,1,t)},populateAffected:function(e,t,n){this._key&&(e=this._key+"."+e),this._parent?this._parent.populateAffected(e,t+1,n):t>1&&n.push(this.value(),e)}},e.removeChainWatcher=h,e.ChainNode=f}),s("ember-metal/computed",["exports","ember-utils","ember-metal/debug","ember-metal/property_set","ember-metal/meta","ember-metal/expand_properties","ember-metal/error","ember-metal/properties","ember-metal/property_events","ember-metal/dependent_keys"],function(e,t,n,r,i,o,s,a,u,l){"use strict";function c(e,t){this.isDescriptor=!0,"function"==typeof e?this._getter=e:(this._getter=e.get,this._setter=e.set),this._dependentKeys=void 0,this._suspended=void 0,this._meta=void 0,this._volatile=!1,this._dependentKeys=t&&t.dependentKeys,this._readOnly=!1}function p(e){var t=void 0;arguments.length>1&&(t=[].slice.call(arguments),e=t.pop());var n=new c(e);return t&&n.property.apply(n,t),n}function h(e,t){var n=i.peekMeta(e),r=n&&n.source===e&&n.readableCache(),o=r&&r[t];if(o!==i.UNDEFINED)return o}e.default=p;c.prototype=new a.Descriptor,c.prototype.constructor=c;var f=c.prototype;f.volatile=function(){return this._volatile=!0,this},f.readOnly=function(){return this._readOnly=!0,this},f.property=function(){function e(e){t.push(e)}for(var t=[],n=0;n=0;i-=3)if(t===e[i]&&n===e[i+1]){r=i;break}return r}function s(e,t,n){var i=r.peekMeta(e);if(i){for(var s=i.matchingListeners(t),a=[],u=s.length-3;u>=0;u-=3){var l=s[u],c=s[u+1],p=s[u+2],h=o(n,l,c);h===-1&&(n.push(l,c,p),a.push(l,c,p))}return a}}function a(e,t,n,o,s){o||"function"!=typeof n||(o=n,n=null);var a=0;s&&(a|=i.ONCE),r.meta(e).addToListeners(t,n,o,a),"function"==typeof e.didAddListener&&e.didAddListener(t,n,o)}function u(e,t,n,i){i||"function"!=typeof n||(i=n,n=null),r.meta(e).removeFromListeners(t,n,i,function(){"function"==typeof e.didRemoveListener&&e.didRemoveListener.apply(e,arguments)})}function l(e,t,n,r,i){return c(e,[t],n,r,i)}function c(e,t,n,i,o){return i||"function"!=typeof n||(i=n,n=null),r.meta(e).suspendListeners(t,n,i,o)}function p(e){return r.meta(e).watchedEvents()}function h(e,n,o,s){if(!s){var a=r.peekMeta(e);s=a&&a.matchingListeners(n)}if(s&&0!==s.length){for(var l=s.length-3;l>=0;l-=3){var c=s[l],p=s[l+1],h=s[l+2];p&&(h&i.SUSPENDED||(h&i.ONCE&&u(e,n,c,p),c||(c=e),"string"==typeof p?o?t.applyStr(c,p,o):c[p]():o?p.apply(c,o):p.call(c)))}return!0}}function f(e,t){var n=r.peekMeta(e);return!!n&&n.matchingListeners(t).length>0}function m(e,t){var n=[],i=r.peekMeta(e),o=i&&i.matchingListeners(t);if(!o)return n;for(var s=0;s=0&&(s=r(s,u.split(","),a))}for(var a=0;a-1&&o.splice(s,1),this.size=o.length,!0}return!1},isEmpty:function(){return 0===this.size},has:function(e){if(0===this.size)return!1;var n=t.guidFor(e),r=this.presenceSet;return r[n]===!0},forEach:function(e){if("function"!=typeof e&&n(e),0!==this.size){var t=this.list;if(2===arguments.length)for(var r=0;r0;){if(e=O.pop(),t=e._chains)for(n in t)void 0!==t[n]&&O.push(t[n]);if(e._watching&&(r=e._object)){var i=N(r);i&&!i.isSourceDestroying()&&o.removeChainWatcher(r,e._key,e,i)}}this.setMetaDestroyed()}};for(var S in r.protoMethods)s.prototype[S]=r.protoMethods[S];w.forEach(function(e){return g[e](e,s)}),s.prototype.isSourceDestroying=function(){return 0!==(this._flags&v)},s.prototype.setSourceDestroying=function(){this._flags|=v},s.prototype.isSourceDestroyed=function(){return 0!==(this._flags&y)},s.prototype.setSourceDestroyed=function(){this._flags|=y},s.prototype.isMetaDestroyed=function(){return 0!==(this._flags&b)},s.prototype.setMetaDestroyed=function(){this._flags|=b},s.prototype.isProxy=function(){return 0!==(this._flags&_)},s.prototype.setProxy=function(){this._flags|=_},s.prototype._getOrCreateOwnMap=function(e){var n=this[e];return n||(n=this[e]=new t.EmptyObject),n},s.prototype._getInherited=function(e){for(var t=this;void 0!==t;){if(t[e])return t[e];t=t.parent}},s.prototype._findInherited=function(e,t){for(var n=this;void 0!==n;){var r=n[e];if(r){var i=r[t];if(void 0!==i)return i}n=n.parent}};var x=t.symbol("undefined");e.UNDEFINED=x,s.prototype.writeDeps=function(e,n,r){var i=this._getOrCreateOwnMap("_deps"),o=i[e];o||(o=i[e]=new t.EmptyObject),o[n]=r},s.prototype.peekDeps=function(e,t){for(var n=this;void 0!==n;){var r=n._deps;if(r){var i=r[e];if(i&&void 0!==i[t])return i[t]}n=n.parent}},s.prototype.hasDeps=function(e){for(var t=this;void 0!==t;){if(t._deps&&t._deps[e])return!0;t=t.parent}return!1},s.prototype.forEachInDeps=function(e,t){return this._forEachIn("_deps",e,t)},s.prototype._forEachIn=function(e,n,r){for(var i=this,o=new t.EmptyObject,s=[];void 0!==i;){var a=i[e];if(a){var u=a[n];if(u)for(var l in u)o[l]||(o[l]=!0,s.push([l,u[l]]))}i=i.parent}for(var c=0;c=0;s-=4)if(o[s]===e&&(!n||o[s+1]===t&&o[s+2]===n)){if(i!==this)return this._finalizeListeners(),this.removeFromListeners(e,t,n);"function"==typeof r&&r(e,t,o[s+2]),o.splice(s,4)}if(i._listenersFinalized)break;i=i.parent}},matchingListeners:function(e){for(var n=this,i=[];n;){var o=n._listeners;if(o)for(var s=0;s=0;o-=3)i[o+1]===t&&i[o+2]===n&&e.indexOf(i[o])!==-1&&i.splice(o,3)}},watchedEvents:function(){for(var e=this,t={};e;){var n=e._listeners;if(n)for(var r=0;r=0||"concatenatedProperties"===t||"mergedProperties"===t?n=v(e,t,n,o):u&&u.indexOf(t)>=0?n=y(e,t,n,o):h(n)&&(n=g(e,t,n,o,i)),i[t]=void 0,o[t]=n}function _(e,t,n,r,i,o){function s(e){delete n[e],delete r[e]}for(var a=void 0,u=void 0,l=void 0,c=void 0,p=void 0,h=0;h7&&66===e.charCodeAt(t-7)&&e.indexOf("inding",t-6)!==-1}function E(e,t){t.forEachBindings(function(t,n){if(n){var r=t.slice(0,-7);n instanceof u.Binding?(n=n.copy(),n.to(r)):n=new u.Binding(r,n),n.connect(e),e[t]=n}}),t.clearBindings()}function O(e,t){return E(e,t||i.meta(e)),e}function S(e,t,n,r,i){var o=t.methodName,s=void 0,a=void 0;return r[o]||i[o]?(s=i[o],t=r[o]):(a=e[o])&&null!==a&&"object"==typeof a&&a.isDescriptor?(t=a,s=void 0):(t=void 0,s=e[o]),{desc:t,value:s}}function x(e,t,n,r,i){var o=n[r];if(o)for(var s=0;s1?t-1:0),r=1;r0){for(var i=new Array(r),o=0;o=0;)if(P(o[s],n,r))return!0;return!1}function D(e,n,r){if(!r[t.guidFor(n)])if(r[t.guidFor(n)]=!0,n.properties)for(var i=Object.keys(n.properties),o=0;o0,l&&l.teardown(e,t),n instanceof o)p=n,e[t]=p,n.setup&&n.setup(e,t);else if(null==n){p=s;e[t]=s}else p=n,Object.defineProperty(e,t,n);return c&&i.overrideChains(e,t,a),e.didDefineProperty&&e.didDefineProperty(e,t,p),this}e.Descriptor=o,e.MANDATORY_SETTER_FUNCTION=s,e.DEFAULT_GETTER_FUNCTION=a,e.INHERITING_GETTER_FUNCTION=u,e.defineProperty=l;(function(){var e=Object.create(Object.prototype,{prop:{configurable:!0,value:1}});return Object.defineProperty(e,"prop",{configurable:!0,value:2}),2===e.prop})()}),s("ember-metal/property_events",["exports","ember-utils","ember-metal/meta","ember-metal/events","ember-metal/tags","ember-metal/observer_set","ember-metal/features","ember-metal/transaction"],function(e,t,n,r,i,o,s,a){"use strict";function u(e,t,r){var i=r||n.peekMeta(e);if(!i||i.isInitialized(e)){var o=i&&i.peekWatching(t)>0,s=e[t],a=null!==s&&"object"==typeof s&&s.isDescriptor?s:void 0;a&&a.willChange&&a.willChange(e,t),o&&(c(e,t,i),f(e,t,i),b(e,t,i))}}function l(e,t,r){var o=r||n.peekMeta(e);if(!o||o.isInitialized(e)){var s=o&&o.peekWatching(t)>0,a=e[t],u=null!==a&&"object"==typeof a&&a.isDescriptor?a:void 0;u&&u.didChange&&u.didChange(e,t),s&&(o.hasDeps(t)&&p(e,t,o),m(e,t,o,!1),_(e,t,o)),e[w]&&e[w](t),o&&o.isSourceDestroying()||i.markObjectAsDirty(o,t)}}function c(e,t,n){if((!n||!n.isSourceDestroying())&&n&&n.hasDeps(t)){var r=x,i=!r;i&&(r=x={}),h(u,e,t,r,n),i&&(x=null)}}function p(e,t,n){if((!n||!n.isSourceDestroying())&&n&&n.hasDeps(t)){var r=C,i=!r;i&&(r=C={}),h(l,e,t,r,n),i&&(C=null)}}function h(e,n,r,i,o){var s=void 0,a=void 0,u=t.guidFor(n),l=i[u];l||(l=i[u]={}),l[r]||(l[r]=!0,o.forEachInDeps(r,function(t,r){r&&(s=n[t],a=null!==s&&"object"==typeof s&&s.isDescriptor?s:void 0,a&&a._suspended===n||e(n,t,o))}))}function f(e,t,n){var r=n.readableChainWatchers();r&&r.notify(t,!1,u)}function m(e,t,n){var r=n.readableChainWatchers();r&&r.notify(t,!0,l)}function d(e,t,n){var r=n.readableChainWatchers();r&&r.revalidate(t)}function g(){S++}function v(){S--,S<=0&&(E.clear(),O.flush())}function y(e,t){g();try{e.call(t)}finally{v.call(t)}}function b(e,t,n){if(!n||!n.isSourceDestroying()){var i=t+":before",o=void 0,s=void 0;S?(o=E.add(e,t,i),s=r.accumulateListeners(e,i,o),r.sendEvent(e,i,[e,t],s)):r.sendEvent(e,i,[e,t])}}function _(e,t,n){if(!n||!n.isSourceDestroying()){var i=t+":change",o=void 0;S?(o=O.add(e,t,i),r.accumulateListeners(e,i,o)):r.sendEvent(e,i,[e,t])}}var w=t.symbol("PROPERTY_DID_CHANGE");e.PROPERTY_DID_CHANGE=w;var E=new o.default,O=new o.default,S=0,x=void 0,C=void 0;e.propertyWillChange=u,e.propertyDidChange=l,e.overrideChains=d,e.beginPropertyChanges=g,e.endPropertyChanges=v,e.changeProperties=y}),s("ember-metal/property_get",["exports","ember-metal/debug","ember-metal/path_cache"],function(e,t,n){"use strict";function r(e,t){var r=e[t],o=null!==r&&"object"==typeof r&&r.isDescriptor?r:void 0,s=void 0;return void 0===o&&n.isPath(t)?i(e,t):o?o.get(e,t):(s=r,void 0!==s||"object"!=typeof e||t in e||"function"!=typeof e.unknownProperty?s:e.unknownProperty(t))}function i(e,t){for(var n=e,i=t.split("."),s=0;sa?a:l,c<=0&&(c=0),p=o.splice(0,a),p=[u,c].concat(p),u+=a,l-=c,s=s.concat(n.apply(e,p));return s}e.default=t;var n=Array.prototype.splice}),s("ember-metal/run_loop",["exports","ember-utils","ember-metal/debug","ember-metal/testing","ember-metal/error_handler","ember-metal/property_events","backburner"],function(e,t,n,r,i,o,s){"use strict";function a(e){l.currentRunLoop=e}function u(e,t){l.currentRunLoop=t}function l(){return p.run.apply(p,arguments)}e.default=l;var c={get onerror(){return i.getOnerror()},set onerror(e){return i.setOnerror(e)}},p=new s.default(["sync","actions","destroy"],{GUID_KEY:t.GUID_KEY,sync:{before:o.beginPropertyChanges,after:o.endPropertyChanges},defaultQueue:"actions",onBegin:a,onEnd:u,onErrorTarget:c,onErrorMethod:"onerror"});l.join=function(){return p.join.apply(p,arguments)},l.bind=function(){for(var e=arguments.length,t=Array(e),n=0;n1&&i.writeWatching(t,o-1)}}}e.watchKey=o,e.unwatchKey=s}),s("ember-metal/watch_path",["exports","ember-metal/meta","ember-metal/chains"],function(e,t,n){"use strict";function r(e,n){return(n||t.meta(e)).writableChains(i)}function i(e){return new n.ChainNode(null,null,e)}function o(e,n,i){if("object"==typeof e&&null!==e){var o=i||t.meta(e),s=o.peekWatching(n)||0;s?o.writeWatching(n,s+1):(o.writeWatching(n,1),r(e,o).add(n))}}function s(e,n,i){if("object"==typeof e&&null!==e){var o=i||t.meta(e),s=o.peekWatching(n)||0;1===s?(o.writeWatching(n,0),r(e,o).remove(n)):s>1&&o.writeWatching(n,s-1)}}e.makeChainNode=i,e.watchPath=o,e.unwatchPath=s}),s("ember-metal/watching",["exports","ember-metal/watch_key","ember-metal/watch_path","ember-metal/path_cache","ember-metal/meta"],function(e,t,n,r,i){"use strict";function o(e,i,o){r.isPath(i)?n.watchPath(e,i,o):t.watchKey(e,i,o)}function s(e,t){if("object"!=typeof e||null===e)return!1;var n=i.peekMeta(e);return(n&&n.peekWatching(t))>0}function a(e,t){var n=i.peekMeta(e);return n&&n.peekWatching(t)||0}function u(e,i,o){r.isPath(i)?n.unwatchPath(e,i,o):t.unwatchKey(e,i,o)}function l(e){i.deleteMeta(e)}e.isWatching=s,e.watcherCount=a,e.unwatch=u,e.destroy=l,e.watch=o}),s("ember-metal/weak_map",["exports","ember-utils","ember-metal/meta"],function(e,t,n){"use strict";function r(e){return"object"==typeof e&&null!==e||"function"==typeof e}function i(e){if(!(this instanceof i))throw new TypeError("Constructor WeakMap requires 'new'");if(this._id=t.GUID_KEY+o++,null!==e&&void 0!==e){if(!Array.isArray(e))throw new TypeError("The weak map constructor polyfill only supports an array argument");for(var n=0;n7)}function a(e,t){return(e.indexOf("Android 2.")===-1&&e.indexOf("Android 4.0")===-1||e.indexOf("Mobile Safari")===-1||e.indexOf("Chrome")!==-1||e.indexOf("Windows Phone")!==-1)&&!!(t&&"pushState"in t)}function u(e,t){e.replace(o(e)+t)}e.getPath=t,e.getQuery=n,e.getHash=r,e.getFullPath=i,e.getOrigin=o,e.supportsHashChange=s,e.supportsHistory=a,e.replacePath=u}),s("ember-routing/services/routing",["exports","ember-utils","ember-runtime","ember-metal","ember-routing/utils"],function(e,t,n,r,i){"use strict";function o(e,t){for(var n=0,r=0;rc&&(n=l),i.isActiveIntent(n,e,t,!s)}})}),s("ember-routing/system/cache",["exports","ember-utils","ember-runtime"],function(e,t,n){"use strict";e.default=n.Object.extend({init:function(){this.cache=new t.EmptyObject},has:function(e){return!!this.cache[e]},stash:function(e,n,r){var i=this.cache[e];i||(i=this.cache[e]=new t.EmptyObject),i[n]=r},lookup:function(e,t,n){var r=this.cache;if(!this.has(e))return n;var i=r[e];return t in i&&void 0!==i[t]?i[t]:n}})}),s("ember-routing/system/controller_for",["exports"],function(e){"use strict";function t(e,t,n){return e.lookup("controller:"+t,n)}e.default=t}),s("ember-routing/system/dsl",["exports","ember-utils","ember-metal"],function(e,t,n){"use strict";function r(e,t){this.parent=e,this.enableLoadingSubstates=t&&t.enableLoadingSubstates,this.matches=[],this.explicitIndex=void 0,this.options=t}function i(e){return e.parent&&"application"!==e.parent}function o(e,t,n){return i(e)&&n!==!0?e.parent+"."+t:t}function s(e,t,n,r){n=n||{};var i=o(e,t,n.resetNamespace);"string"!=typeof n.path&&(n.path="/"+t),e.push(n.path,i,r,n.serialize)}e.default=r,r.prototype={route:function(e,t,n){var i="/_unused_dummy_error_path_route_"+e+"/:error";if(2===arguments.length&&"function"==typeof t&&(n=t,t={}),1===arguments.length&&(t={}),this.enableLoadingSubstates&&(s(this,e+"_loading",{resetNamespace:t.resetNamespace}),s(this,e+"_error",{resetNamespace:t.resetNamespace,path:i})),n){var a=o(this,e,t.resetNamespace),u=new r(a,this.options);s(u,"loading"),s(u,"error",{path:i}),n.call(u),s(this,e,t,u.generate())}else s(this,e,t)},push:function(e,n,r,i){var o=n.split(".");if(this.options.engineInfo){var s=n.slice(this.options.engineInfo.fullName.length+1),a=t.assign({localFullName:s},this.options.engineInfo);i&&(a.serializeMethod=i),this.options.addRouteForEngine(n,a)}else if(i)throw new Error("Defining a route serializer on route '"+n+"' outside an Engine is not allowed.");""!==e&&"/"!==e&&"index"!==o[o.length-1]||(this.explicitIndex=!0),this.matches.push([e,n,r])},resource:function(e,t,n){2===arguments.length&&"function"==typeof t&&(n=t,t={}),1===arguments.length&&(t={}),t.resetNamespace=!0,this.route(e,t,n)},generate:function(){var e=this.matches;return this.explicitIndex||this.route("index",{path:"/"}),function(t){for(var n=0;n0&&(this.connections=[],n.run.once(this.router,"_setOutlets"))}});r.deprecateUnderscoreActions(_),_.reopenClass({isRouteFactory:!0}),e.default=_}),s("ember-routing/system/router",["exports","ember-utils","ember-console","ember-metal","ember-runtime","ember-routing/system/route","ember-routing/system/dsl","ember-routing/location/api","ember-routing/utils","ember-routing/system/router_state","router"],function(e,t,n,r,i,o,s,a,u,l,c){"use strict";function p(){return this}function h(e,t,n){for(var r=!1,i=t.length-1;i>=0;--i){var o=t[i],s=o.handler;if(e===s&&(r=!0),r&&n(s)!==!0)return}}function f(e,t){var r=[],i=void 0;i=e&&"object"==typeof e&&"object"==typeof e.errorThrown?e.errorThrown:e,t&&r.push(t),i&&(i.message&&r.push(i.message),i.stack&&r.push(i.stack),"string"==typeof i&&r.push(i)),n.default.error.apply(this,r)}function m(e,n){var r=e.router,i=t.getOwner(e),o=e.routeName,s=o+"_"+n,a=e.fullRouteName,u=a+"_"+n;return g(i,r,s,u)?u:""}function d(e,n){var r=e.router,i=t.getOwner(e),o=e.routeName,s="application"===o?n:o+"."+n,a=e.fullRouteName,u="application"===a?n:a+"."+n;return g(i,r,s,u)?u:""}function g(e,t,n,r){var i=t.hasRoute(r),o=e.hasRegistration("template:"+n)||e.hasRegistration("route:"+n);return i&&o}function v(e,n,i){var o=i.shift();if(!e){if(n)return;throw new r.Error("Can't trigger action '"+o+"' because your app hasn't finished transitioning into its first route. To trigger an action on destination routes during a transition, you can call `.send()` on the `Transition` object passed to the `model/beforeModel/afterModel` hooks.")}for(var s=!1,a=void 0,u=void 0,l=e.length-1;l>=0;l--)if(a=e[l],u=a.handler,u&&u.actions&&u.actions[o]){if(u.actions[o].apply(u,i)!==!0){if("error"===o){var c=t.guidFor(i[0]);u.router._markErrorAsHandled(c)}return}s=!0}if(T[o])return void T[o].apply(null,i);if(!s&&!n)throw new r.Error("Nothing handled the action '"+o+"'. If you did handle the action, this error can be caused by returning true from an action handler in a controller, causing the action to bubble.")}function y(e,t,n){for(var r=e.router,i=r.applyIntent(t,n),o=i.handlerInfos,s=i.params,a=0;a0;){var r=n.shift();if(r.render.name===t)return r;var i=r.outlets;for(var o in i)n.push(i[o])}}function S(e,n,i){var o=void 0,s={render:i,outlets:new t.EmptyObject,wasUsed:!1};return o=i.into?O(e,i.into):n,o?r.set(o.outlets,i.outlet,s):i.into?x(e,i.into,s):e=s,{liveRoutes:e,ownState:s}}function x(e,n,i){e.outlets.__ember_orphans__||(e.outlets.__ember_orphans__={render:{name:"__ember_orphans__"},outlets:new t.EmptyObject}),e.outlets.__ember_orphans__.outlets[n]=i,r.run.schedule("afterRender",function(){})}function C(e,t,n){var r=O(e,n.routeName);return r?r:(t.outlets.main={render:{name:n.routeName,outlet:"main"},outlets:{}},t)}e.triggerEvent=v;var A=Array.prototype.slice,k=i.Object.extend(i.Evented,{location:"hash",rootURL:"/",_initRouterJs:function(){var e=this.router=new c.default;e.triggerEvent=v,e._triggerWillChangeContext=p,e._triggerWillLeave=p;var t=this.constructor.dslCallbacks||[p],i=this._buildDSL();i.route("application",{path:"/",resetNamespace:!0,overrideNameAssertion:!0},function(){for(var e=0;e0)-(n<0)}function i(e,s){if(e===s)return 0;var a=t.typeOf(e),u=t.typeOf(s);if(n.default){if("instance"===a&&n.default.detect(e)&&e.constructor.compare)return e.constructor.compare(e,s);if("instance"===u&&n.default.detect(s)&&s.constructor.compare)return s.constructor.compare(s,e)*-1}var l=r(o[a],o[u]);if(0!==l)return l;switch(a){case"boolean":case"number":return r(e,s);case"string":return r(e.localeCompare(s),0);case"array":for(var c=e.length,p=s.length,h=Math.min(c,p),f=0;fn})}function h(e,n){return t.computed(e,function(){return t.get(this,e)>=n})}function f(e,n){return t.computed(e,function(){return t.get(this,e)=0)return o[a];if(Array.isArray(e)){if(s=e.slice(),t)for(a=s.length;--a>=0;)s[a]=i(s[a],t,n,o)}else if(r.default&&r.default.detect(e))s=e.copy(t,n,o);else if(e instanceof Date)s=new Date(e.getTime());else{s={};for(u in e)Object.prototype.hasOwnProperty.call(e,u)&&"__"!==u.substring(0,2)&&(s[u]=t?i(e[u],t,n,o):e[u])}return t&&(n.push(e),o.push(s)),s}function o(e,t){return"object"!=typeof e||null===e?e:r.default&&r.default.detect(e)?e.copy(t):i(e,t,t?[]:null,t?[]:null)}e.default=o}),s("ember-runtime/ext/function",["exports","ember-environment","ember-metal"],function(e,t,n){"use strict";var r=Array.prototype.slice,i=Function.prototype;t.ENV.EXTEND_PROTOTYPES.Function&&(i.property=function(){var e=n.computed(this);return e.property.apply(e,arguments)},i.observes=function(){for(var e=arguments.length,t=Array(e),r=0;r1?n-1:0),i=1;i=0&&r>=0&&n.get(e,"hasEnumerableObservers")){o=[],s=t+r;for(var a=t;a=0&&i>=0&&n.get(e,"hasEnumerableObservers")){o=[];for(var s=t+i,a=t;a=n.get(this,"length")))return n.get(this,e)},h.objectsAt=function(e){var t=this;return e.map(function(e){return u(t,e)})},h.nextObject=function(e){return u(this,e)},h["[]"]=n.computed({get:function(e){return this},set:function(e,t){return this.replace(0,n.get(this,"length"),t),this}}),h.firstObject=n.computed(function(){return u(this,0)}).readOnly(),h.lastObject=n.computed(function(){return u(this,n.get(this,"length")-1)}).readOnly(),h.contains=function(e){return this.indexOf(e)>=0},h.slice=function(e,t){var r=n.default.A(),i=n.get(this,"length");for(n.isNone(e)&&(e=0),(n.isNone(t)||t>i)&&(t=i),e<0&&(e=i+e),t<0&&(t=i+t);e=r)&&(t=r-1),t<0&&(t+=r);for(var i=t;i>=0;i--)if(u(this,i)===e)return i;return-1},h.addArrayObserver=function(e,t){return s(this,e,t)},h.removeArrayObserver=function(e,t){return a(this,e,t)},h.hasArrayObservers=n.computed(function(){return n.hasListeners(this,"@array:change")||n.hasListeners(this,"@array:before")}),h.arrayContentWillChange=function(e,t,n){return l(this,e,t,n)},h.arrayContentDidChange=function(e,t,n){return c(this,e,t,n)},h["@each"]=n.computed(function(){return this.__each||(this.__each=new i.default(this)),this.__each}).volatile().readOnly(),h));m.reopen({includes:function(e,t){var r=n.get(this,"length");void 0===t&&(t=0),t<0&&(t+=r);for(var i=t;i1?t-1:0),r=1;r1?n-1:0),i=1;i=t.get(e,"length"))throw new t.Error(s);void 0===r&&(r=1),e.replace(n,r,a)}return e}e.removeAt=o;var s="Index out of range",a=[];e.default=t.Mixin.create(n.default,r.default,{replace:null,clear:function(){var e=t.get(this,"length");return 0===e?this:(this.replace(0,e,a),this)},insertAt:function(e,n){if(e>t.get(this,"length"))throw new t.Error(s);return this.replace(e,0,[n]),this},removeAt:function(e,t){return o(this,e,t)},pushObject:function(e){return this.insertAt(t.get(this,"length"),e),e},pushObjects:function(e){if(!i.default.detect(e)&&!Array.isArray(e))throw new TypeError("Must pass Ember.Enumerable to Ember.MutableArray#pushObjects");return this.replace(t.get(this,"length"),0,e),this},popObject:function(){var e=t.get(this,"length");if(0===e)return null;var r=n.objectAt(this,e-1);return this.removeAt(e-1,1),r},shiftObject:function(){if(0===t.get(this,"length"))return null;var e=n.objectAt(this,0);return this.removeAt(0),e},unshiftObject:function(e){return this.insertAt(0,e),e},unshiftObjects:function(e){return this.replace(0,0,e),this},reverseObjects:function(){var e=t.get(this,"length");if(0===e)return this;var n=this.toArray().reverse();return this.replace(0,e,n),this},setObjects:function(e){if(0===e.length)return this.clear();var n=t.get(this,"length");return this.replace(0,n,e),this},removeObject:function(e){for(var r=t.get(this,"length")||0;--r>=0;){var i=n.objectAt(this,r);i===e&&this.removeAt(r)}return this},addObject:function(e){var t=void 0;return t=this.includes(e),t||this.pushObject(e),this}})}),s("ember-runtime/mixins/mutable_enumerable",["exports","ember-runtime/mixins/enumerable","ember-metal"],function(e,t,n){"use strict";e.default=n.Mixin.create(t.default,{addObject:null,addObjects:function(e){var t=this;return n.beginPropertyChanges(this),e.forEach(function(e){return t.addObject(e)}),n.endPropertyChanges(this),this},removeObject:null,removeObjects:function(e){n.beginPropertyChanges(this);for(var t=e.length-1;t>=0;t--)this.removeObject(e[t]);return n.endPropertyChanges(this),this}})}),s("ember-runtime/mixins/observable",["exports","ember-metal"],function(e,t){"use strict";e.default=t.Mixin.create({get:function(e){return t.get(this,e)},getProperties:function(){for(var e=arguments.length,n=Array(e),r=0;rt.get(this,"content.length"))throw new t.Error(u);return this._replace(e,0,[n]),this},insertAt:function(e,n){if(t.get(this,"arrangedContent")===t.get(this,"content"))return this._insertAt(e,n);throw new t.Error("Using insertAt on an arranged ArrayProxy is not allowed.")},removeAt:function(e,n){if("number"==typeof e){var r=t.get(this,"content"),i=t.get(this,"arrangedContent"),o=[];if(e<0||e>=t.get(this,"length"))throw new t.Error(u);void 0===n&&(n=1);for(var a=e;a0&&(e=[arguments[0]]),this.__defineNonEnumerable(t.GUID_KEY_PROPERTY);var o=n.meta(this),s=o.proto;if(o.proto=this,e){var a=e;e=null;for(var u=this.concatenatedProperties,l=this.mergedProperties,p=0;p0&&u.indexOf(g)>=0){var _=this[g];v=_?"function"==typeof _.concat?_.concat(v):t.makeArray(_).concat(v):t.makeArray(v)}if(l&&l.length&&l.indexOf(g)>=0){var w=this[g];v=t.assign({},w,v)}b?b.set(this,g,v):"function"!=typeof this.setUnknownProperty||g in this?this[g]=v:this.setUnknownProperty(g,v)}}}c(this,o),this.init.apply(this,arguments),this[f](),o.proto=s,n.finishChains(this),n.sendEvent(this,"init")};return i.toString=n.Mixin.prototype.toString,i.willReopen=function(){r&&(i.PrototypeMixin=n.Mixin.create(i.PrototypeMixin)),r=!1},i._initProperties=function(t){e=t},i.proto=function(){var e=i.superclass;return e&&e.proto(),r||(r=!0,i.PrototypeMixin.applyPartial(i.prototype)),this.prototype},i}var s,a,u=n.run.schedule,l=n.Mixin._apply,c=n.Mixin.finishPartial,p=n.Mixin.prototype.reopen,h=!1,f=t.symbol("POST_INIT");e.POST_INIT=f;var m=o();m.toString=function(){return"Ember.CoreObject"},m.PrototypeMixin=n.Mixin.create((s={reopen:function(){for(var e=arguments.length,t=Array(e),n=0;n";return r},s)),m.PrototypeMixin.ownerConstructor=m,m.__super__=null;var d=(a={ClassMixin:n.REQUIRED,PrototypeMixin:n.REQUIRED,isClass:!0,isMethod:!1},a[t.NAME_KEY]=null,a[t.GUID_KEY]=null,a.extend=function(){var e,r=o();return r.ClassMixin=n.Mixin.create(this.ClassMixin),r.PrototypeMixin=n.Mixin.create(this.PrototypeMixin),r.ClassMixin.ownerConstructor=r,r.PrototypeMixin.ownerConstructor=r,p.apply(r.PrototypeMixin,arguments),r.superclass=this,r.__super__=this.prototype,e=r.prototype=Object.create(this.prototype),e.constructor=r,t.generateGuid(e),n.meta(e).proto=e,r.ClassMixin.apply(r),r},a.create=function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r0&&this._initProperties(n),new e},a.reopen=function(){return this.willReopen(),p.apply(this.PrototypeMixin,arguments),this},a.reopenClass=function(){return p.apply(this.ClassMixin,arguments),l(this,arguments,!1),this},a.detect=function(e){if("function"!=typeof e)return!1;for(;e;){if(e===this)return!0;e=e.superclass}return!1},a.detectInstance=function(e){return e instanceof this},a.metaForProperty=function(e){var t=this.proto(),n=t[e],r=null!==n&&"object"==typeof n&&n.isDescriptor?n:void 0;return r._meta||{}},a._computedProperties=n.computed(function(){h=!0;var e,t=this.proto(),n=[];for(var r in t)e=t[r],e&&e.isDescriptor&&n.push({name:r,meta:e._meta});return n}).readOnly(),a.eachComputedProperty=function(e,t){for(var r,i={},o=n.get(this,"_computedProperties"),s=0;s=o;){var a=r.objectAt(e,s);a&&(n._addBeforeObserver(a,t,i,"contentKeyWillChange"),n.addObserver(a,t,i,"contentKeyDidChange"))}}function s(e,t,i,o,s){for(;--s>=o;){var a=r.objectAt(e,s);a&&(n._removeBeforeObserver(a,t,i,"contentKeyWillChange"),n.removeObserver(a,t,i,"contentKeyDidChange"))}}e.default=i,i.prototype={__defineNonEnumerable:function(e){this[e.name]=e.descriptor.value},arrayWillChange:function(e,t,r,i){var o=this._keys,a=r>0?t+r:-1;for(var u in o)a>0&&s(e,u,this,t,a),n.propertyWillChange(this,u)},arrayDidChange:function(e,t,r,i){var s=this._keys,a=i>0?t+i:-1;for(var u in s)a>0&&o(e,u,this,t,a),n.propertyDidChange(this,u)},willWatchProperty:function(e){this.beginObservingContentKey(e)},didUnwatchProperty:function(e){this.stopObservingContentKey(e)},beginObservingContentKey:function(e){var r=this._keys;if(r||(r=this._keys=new t.EmptyObject),r[e])r[e]++;else{r[e]=1;var i=this._content,s=n.get(i,"length");o(i,e,this,0,s)}},stopObservingContentKey:function(e){var t=this._keys;if(t&&t[e]>0&&--t[e]<=0){var r=this._content,i=n.get(r,"length");s(r,e,this,0,i)}},contentKeyWillChange:function(e,t){n.propertyWillChange(this,t)},contentKeyDidChange:function(e,t){n.propertyDidChange(this,t)}}}),s("ember-runtime/system/lazy_load",["exports","ember-environment"],function(e,t){"use strict";function n(e,t){var n=o[e];i[e]=i[e]||[],i[e].push(t),n&&t(n)}function r(e,n){o[e]=n;var r=t.environment.window;if(r&&"function"==typeof CustomEvent){var s=new CustomEvent(e,{detail:n,name:e});r.dispatchEvent(s)}i[e]&&i[e].forEach(function(e){return e(n)})}e.onLoad=n,e.runLoadHooks=r;var i=t.ENV.EMBER_LOAD_HOOKS||{},o={},s=o;e._loaded=s}),s("ember-runtime/system/namespace",["exports","ember-utils","ember-metal","ember-environment","ember-runtime/system/object"],function(e,t,n,r,i){"use strict";function o(){return d}function s(e){d=!!e}function a(e,n,r){var i=e.length;v[e.join(".")]=n;for(var o in n)if(y.call(n,o)){var s=n[o];if(e[i]=o,s&&s.toString===f&&!s[t.NAME_KEY])s[t.NAME_KEY]=e.join(".");else if(s&&s.isNamespace){if(r[t.guidFor(s)])continue;r[t.guidFor(s)]=!0,a(e,s,r)}}e.length=i}function u(e){return e>=65&&e<=90}function l(e,t){try{var n=e[t];return n&&n.isNamespace&&n}catch(e){}}function c(){if(!g.PROCESSED)for(var e=r.context.lookup,n=Object.keys(e),i=0;i2){i=new Array(arguments.length-1);for(var o=1;o2)&&(t=Array.prototype.slice.call(arguments,1)),e=i.get(e)||e,o(e,t)}function u(e){return e.split(/\s+/)}function l(e){return N.get(e)}function c(e){return g.get(e)}function p(e){return b.get(e)}function h(e){return O.get(e)}function f(e){return C.get(e)}function m(e){return k.get(e)}var d=/[ _]/g,g=new t.Cache(1e3,function(e){return l(e).replace(d,"-")}),v=/(\-|\_|\.|\s)+(.)?/g,y=/(^|\/)([A-Z])/g,b=new t.Cache(1e3,function(e){return e.replace(v,function(e,t,n){return n?n.toUpperCase():""}).replace(y,function(e,t,n){return e.toLowerCase()})}),_=/^(\-|_)+(.)?/,w=/(.)(\-|\_|\.|\s)+(.)?/g,E=/(^|\/|\.)([a-z])/g,O=new t.Cache(1e3,function(e){for(var t=function(e,t,n){return n?"_"+n.toUpperCase():""},n=function(e,t,n,r){return t+(r?r.toUpperCase():"")},r=e.split("/"),i=0;i-1;return e?function(e){return o.test(s.call(e))}:function(){return!0}}();e.checkHasSuper=a,t.__hasSuper=!1}),s("ember-utils/symbol",["exports","ember-utils/guid","ember-utils/intern"],function(e,t,n){"use strict";function r(e){return n.default(e+" [id="+t.GUID_KEY+Math.floor(Math.random()*new Date)+"]")}e.default=r}),s("ember-utils/to-string",["exports"],function(e){"use strict";function t(e){return e&&"function"==typeof e.toString?e.toString():n.call(e)}e.default=t;var n=Object.prototype.toString}),s("ember-views/compat/attrs",["exports","ember-utils"],function(e,t){"use strict";var n=t.symbol("MUTABLE_CELL");e.MUTABLE_CELL=n});s("ember-views/compat/fallback-view-registry",["exports","ember-utils"],function(e,t){"use strict";e.default=t.dictionary(null)});s("ember-views/component_lookup",["exports","ember-metal","ember-runtime"],function(e,t,n){"use strict";e.default=n.Object.extend({componentFor:function(e,t,n){var r="component:"+e;return t._lookupFactory(r,n)},layoutFor:function(e,t,n){var r="template:components/"+e;return t.lookup(r,n)}})}),s("ember-views/index",["exports","ember-views/system/ext","ember-views/system/jquery","ember-views/system/utils","ember-views/system/event_dispatcher","ember-views/component_lookup","ember-views/mixins/text_support","ember-views/views/core_view","ember-views/mixins/class_names_support","ember-views/mixins/child_views_support","ember-views/mixins/view_state_support","ember-views/mixins/view_support","ember-views/mixins/action_support","ember-views/compat/attrs","ember-views/system/lookup_partial","ember-views/utils/lookup-component","ember-views/system/action_manager","ember-views/compat/fallback-view-registry"],function(e,t,n,r,i,o,s,a,u,l,c,p,h,f,m,d,g,v){"use strict";e.jQuery=n.default,e.isSimpleClick=r.isSimpleClick,e.getViewBounds=r.getViewBounds,e.getViewClientRects=r.getViewClientRects,e.getViewBoundingClientRect=r.getViewBoundingClientRect,e.getRootViews=r.getRootViews,e.getChildViews=r.getChildViews,e.getViewId=r.getViewId,e.getViewElement=r.getViewElement,e.setViewElement=r.setViewElement,e.STYLE_WARNING=r.STYLE_WARNING,e.EventDispatcher=i.default,e.ComponentLookup=o.default,e.TextSupport=s.default,e.CoreView=a.default,e.ClassNamesSupport=u.default,e.ChildViewsSupport=l.default,e.ViewStateSupport=c.default,e.ViewMixin=p.default,e.ActionSupport=h.default,e.MUTABLE_CELL=f.MUTABLE_CELL,e.lookupPartial=m.default,e.hasPartial=m.hasPartial,e.lookupComponent=d.default,e.ActionManager=g.default,e.fallbackViewRegistry=v.default}),s("ember-views/mixins/action_support",["exports","ember-utils","ember-metal","ember-views/compat/attrs"],function(e,t,n,r){"use strict";function i(e,t){return t&&t[r.MUTABLE_CELL]&&(t=t.value),t}e.default=n.Mixin.create({sendAction:function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;o1?t-1:0),i=1;i1;return!t&&!n}function r(e){var t=e.lookup("-view-registry:main"),n=[];return Object.keys(t).forEach(function(e){var r=t[e];null===r.parentView&&n.push(r)}),n}function i(e){return""===e.tagName?t.guidFor(e):e.elementId||t.guidFor(e)}function o(e){return e[y]}function s(e){e[y]=null}function a(e,t){return e[y]=t}function u(e){var n=t.getOwner(e),r=n.lookup("-view-registry:main");return p(e,r)}function l(e){e[b]=[]}function c(e,t){e[b].push(i(t))}function p(e,t){var n=[],r=[];return e[b].forEach(function(e){var i=t[e];!i||i.isDestroying||i.isDestroyed||n.indexOf(e)!==-1||(n.push(e),r.push(i))}),e[b]=n,r}function h(e){return e.renderer.getBounds(e)}function f(e){var t=h(e),n=document.createRange();return n.setStartBefore(t.firstNode),n.setEndAfter(t.lastNode),n}function m(e){var t=f(e);return t.getClientRects()}function d(e){var t=f(e);return t.getBoundingClientRect()}function g(e,t){return _.call(e,t)}e.isSimpleClick=n,e.getRootViews=r,e.getViewId=i,e.getViewElement=o,e.initViewElement=s,e.setViewElement=a,e.getChildViews=u,e.initChildViews=l,e.addChildView=c,e.collectChildViews=p,e.getViewBounds=h,e.getViewRange=f,e.getViewClientRects=m,e.getViewBoundingClientRect=d,e.matches=g;var v="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.";e.STYLE_WARNING=v;var y=t.symbol("VIEW_ELEMENT"),b=t.symbol("CHILD_VIEW_IDS"),_="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector);e.elMatches=_}),s("ember-views/utils/lookup-component",["exports","container"],function(e,t){"use strict";function n(e,n,r,o){var s=e.componentFor(r,n,o),a=e.layoutFor(r,n,o),u={layout:a,component:s};return a&&!s&&(u.component=n._lookupFactory(t.privatize(i))),u}function r(e,t,r){var i=e.lookup("component-lookup:main"),o=r&&r.source;if(o){var s=n(i,e,t,r);if(s.component||s.layout)return s}return n(i,e,t)}e.default=r;var i=babelHelpers.taggedTemplateLiteralLoose(["component:-default"],["component:-default"])}),s("ember-views/views/core_view",["exports","ember-runtime","ember-views/system/utils","ember-views/views/states"],function(e,t,n,r){"use strict";var i=t.FrameworkObject.extend(t.Evented,t.ActionHandler,{isView:!0,_states:r.cloneStates(r.states),init:function(){if(this._super.apply(this,arguments),this._state="preRender",this._currentState=this._states.preRender,n.initViewElement(this),!this.renderer)throw new Error("Cannot instantiate a component without a renderer. Please ensure that you are creating "+this+" with a proper container/registry.")},parentView:null,instrumentDetails:function(e){return e.object=this.toString(),e.containerKey=this._debugContainerKey,e.view=this,e},trigger:function(){this._super.apply(this,arguments);var e=arguments[0],t=this[e];if(t){for(var n=new Array(arguments.length-1),r=1;r1?r-1:0),o=1;o]+) [^\/>]*\/>/gi,function(e,t){return e.slice(0,e.length-3)+">"})),e}function n(e,n){var r=t(e.innerHTML);QUnit.push(r===n,r,n)}e.default=n;var r=function(){if(!document.createElementNS)return!1;var e=document.createElement("div"),t=document.createElementNS("http://www.w3.org/2000/svg","svg");e.appendChild(t);var n=e.cloneNode(!0);return''===n.innerHTML}()}),s("internal-test-helpers/equal-tokens",["exports","simple-html-tokenizer"],function(e,t){"use strict";function n(e){return"string"==typeof e?{tokens:t.tokenize(e),html:e}:{tokens:t.tokenize(e.innerHTML),html:e.innerHTML}}function r(e){e.forEach(function(e){"StartTag"===e.type&&(e.attributes=e.attributes.sort(function(e,t){return e[0]>t[0]?1:e[0]"},e.create=n,e.extend=o,e.reopen=o,e.reopenClass=i,e}e.default=n;var r=0}),s("internal-test-helpers/index",["exports","internal-test-helpers/factory","internal-test-helpers/build-owner","internal-test-helpers/confirm-export","internal-test-helpers/equal-inner-html","internal-test-helpers/equal-tokens","internal-test-helpers/module-for","internal-test-helpers/strip","internal-test-helpers/apply-mixins","internal-test-helpers/matchers","internal-test-helpers/run","internal-test-helpers/test-groups","internal-test-helpers/test-cases/abstract","internal-test-helpers/test-cases/abstract-application","internal-test-helpers/test-cases/application","internal-test-helpers/test-cases/query-param","internal-test-helpers/test-cases/abstract-rendering","internal-test-helpers/test-cases/rendering"],function(e,t,n,r,i,o,s,a,u,l,c,p,h,f,m,d,g,v){"use strict";e.factory=t.default,e.buildOwner=n.default,e.confirmExport=r.default,e.equalInnerHTML=i.default,e.equalTokens=o.default,e.moduleFor=s.default,e.strip=a.default,e.applyMixins=u.default,e.equalsElement=l.equalsElement,e.classes=l.classes,e.styles=l.styles,e.regex=l.regex,e.runAppend=c.runAppend,e.runDestroy=c.runDestroy,e.testBoth=p.testBoth,e.testWithDefault=p.testWithDefault,e.AbstractTestCase=h.default,e.AbstractApplicationTestCase=f.default,e.ApplicationTestCase=m.default,e.QueryParamTestCase=d.default,e.AbstractRenderingTestCase=g.default,e.RenderingTestCase=v.default}),s("internal-test-helpers/matchers",["exports"],function(e){"use strict";function t(e){return"object"==typeof e&&null!==e&&u in e}function n(e){var t;return t={},t[u]=!0,t.match=function(t){return e===t},t.expected=function(){return e},t.message=function(){return"should equal "+this.expected()},t}function r(e){var t;return t={},t[u]=!0,t.match=function(t){return e.test(t)},t.expected=function(){return e.toString()},t.message=function(){return"should match "+this.expected()},t}function i(e){var t;return t={},t[u]=!0,t.match=function(t){return t=t.trim(),t&&e.split(/\s+/).sort().join(" ")===t.trim().split(/\s+/).sort().join(" ")},t.expected=function(){return e},t.message=function(){return"should match "+this.expected()},t}function o(e){var t;return t={},t[u]=!0,t.match=function(t){return t=t||"",t=t.trim(),e.split(";").map(function(e){return e.trim()}).filter(function(e){return e}).sort().join("; ")===t.split(";").map(function(e){return e.trim()}).filter(function(e){return e}).sort().join("; ")},t.expected=function(){return e},t.message=function(){return"should match "+this.expected()},t}function s(e,r,i,o){QUnit.push(e.tagName===r.toUpperCase(),e.tagName.toLowerCase(),r,"expect tagName to be "+r);var s={},u=0;for(var l in i){var c=i[l];null!==c&&u++;var p=t(c)?c:n(c);s[l]=p,QUnit.push(s[l].match(e.getAttribute(l)),e.getAttribute(l),p.expected(),"Element's "+l+" attribute "+p.message())}for(var h={},f=0,m=e.attributes.length;f2?o-2:0),a=2;a1?t-1:0),r=1;re));)n=n.nextSibling; -return n},e.prototype.$=function(e){return e?r.jQuery(e,this.element):r.jQuery(this.element)},e.prototype.textValue=function(){return this.$().text()},e.prototype.takeSnapshot=function(){for(var e=this.snapshot=[],t=this.element.firstChild;t;)a(t)||e.push(t),t=t.nextSibling;return e},e.prototype.assertText=function(e){this.assert.strictEqual(this.textValue(),e,"#qunit-fixture content should be: `"+e+"`")},e.prototype.assertInnerHTML=function(e){i.default(this.element,e)},e.prototype.assertHTML=function(e){o.default(this.element,e,"#qunit-fixture content should be: `"+e+"`")},e.prototype.assertElement=function(e,t){var n=t.ElementType,r=void 0===n?l:n,i=t.tagName,o=t.attrs,a=void 0===o?null:o,u=t.content,c=void 0===u?null:u;if(!(e instanceof r))throw new Error("Expecting a "+r.name+", but got "+e);s.equalsElement(e,i,a,c)},e.prototype.assertComponentElement=function(e,n){var r=n.ElementType,i=void 0===r?l:r,o=n.tagName,a=void 0===o?"div":o,u=n.attrs,c=void 0===u?null:u,p=n.content,h=void 0===p?null:p;c=t.assign({},{id:s.regex(/^ember\d*$/),class:s.classes("ember-view")},c||{}),this.assertElement(e,{ElementType:i,tagName:a,attrs:c,content:h})},e.prototype.assertSameNode=function(e,t){this.assert.strictEqual(e,t,"DOM node stability")},e.prototype.assertInvariants=function(e,t){e=e||this.snapshot,t=t||this.takeSnapshot(),this.assert.strictEqual(t.length,e.length,"Same number of nodes");for(var n=0;n"}catch(e){}finally{if(0!==t.childNodes.length)return!1}return!0}e.domChanges=r,e.treeConstruction=i;var a={colgroup:{depth:2,before:"",after:"
    "},table:{depth:1,before:"",after:"
    "},tbody:{depth:2,before:"",after:"
    "},tfoot:{depth:2,before:"",after:"
    "},thead:{depth:2,before:"",after:"
    "},tr:{depth:3,before:"",after:"
    "}}}),s("glimmer-runtime/lib/compat/svg-inner-html-fix",["exports","glimmer-runtime/lib/bounds","glimmer-runtime/lib/dom/helper"],function(e,t,n){"use strict";function r(e,t,n){if(!e)return t;if(!s(e,n))return t;var r=e.createElement("div");return function(e){function t(){e.apply(this,arguments)}return babelHelpers.inherits(t,e),t.prototype.insertHTMLBefore=function(t,i,s){return null===s||""===s?e.prototype.insertHTMLBefore.call(this,t,i,s):t.namespaceURI!==n?e.prototype.insertHTMLBefore.call(this,t,i,s):o(t,r,s,i)},t}(t)}function i(e,t,n){if(!e)return t;if(!s(e,n))return t;var r=e.createElement("div");return function(e){function t(){e.apply(this,arguments)}return babelHelpers.inherits(t,e),t.prototype.insertHTMLBefore=function(t,i,s){return null===i||""===i?e.prototype.insertHTMLBefore.call(this,t,i,s):t.namespaceURI!==n?e.prototype.insertHTMLBefore.call(this,t,i,s):o(t,r,i,s)},t}(t)}function o(e,r,i,o){var s=""+i+"";r.innerHTML=s;var a=n.moveNodesBefore(r.firstChild,e,o),u=a[0],l=a[1];return new t.ConcreteBounds(e,u,l)}function s(e,t){var n=e.createElementNS(t,"svg");try{n.insertAdjacentHTML("beforeEnd","")}catch(e){}finally{return(1!==n.childNodes.length||n.firstChild.namespaceURI!==a)&&(n=null,!0)}}e.domChanges=r,e.treeConstruction=i;var a="http://www.w3.org/2000/svg"}),s("glimmer-runtime/lib/compat/text-node-merging-fix",["exports"],function(e){"use strict";function t(e,t){return e&&r(e)?function(e){function t(t){e.call(this,t),this.uselessComment=t.createComment("")}return babelHelpers.inherits(t,e),t.prototype.insertHTMLBefore=function(t,n,r){if(null===r)return e.prototype.insertHTMLBefore.call(this,t,n,r);var i=!1,o=n?n.previousSibling:t.lastChild;o&&o instanceof Text&&(i=!0,t.insertBefore(this.uselessComment,n));var s=e.prototype.insertHTMLBefore.call(this,t,n,r);return i&&t.removeChild(this.uselessComment),s},t}(t):t}function n(e,t){return e&&r(e)?function(e){function t(t){e.call(this,t),this.uselessComment=this.createComment("")}return babelHelpers.inherits(t,e),t.prototype.insertHTMLBefore=function(t,n,r){if(null===n)return e.prototype.insertHTMLBefore.call(this,t,n,r);var i=!1,o=r?r.previousSibling:t.lastChild;o&&o instanceof Text&&(i=!0,t.insertBefore(this.uselessComment,r));var s=e.prototype.insertHTMLBefore.call(this,t,n,r);return i&&t.removeChild(this.uselessComment),s},t}(t):t}function r(e){var t=e.createElement("div");return t.innerHTML="first", -t.insertAdjacentHTML("beforeEnd","second"),2===t.childNodes.length?(t=null,!1):(t=null,!0)}e.domChanges=t,e.treeConstruction=n}),s("glimmer-runtime/lib/compiled/blocks",["exports","glimmer-runtime/lib/utils","glimmer-runtime/lib/compiler"],function(e,t,n){"use strict";var r=function(e,t){this.ops=e,this.symbols=t};e.CompiledBlock=r;var i=function(e,t){this.program=e,this.symbolTable=t,this.compiled=null};e.Block=i;var o=function(e){function i(n,r){var i=arguments.length<=2||void 0===arguments[2]?t.EMPTY_ARRAY:arguments[2];e.call(this,n,r),this.locals=i}return babelHelpers.inherits(i,e),i.prototype.hasPositionalParameters=function(){return!!this.locals.length},i.prototype.compile=function(e){var t=this.compiled;if(t)return t;var i=new n.InlineBlockCompiler(this,e).compile();return this.compiled=new r(i,this.symbolTable.size)},i}(i);e.InlineBlock=o;var s=function(e){function t(){e.apply(this,arguments)}return babelHelpers.inherits(t,e),t}(o);e.PartialBlock=s;var a=function(e){function t(){e.apply(this,arguments)}return babelHelpers.inherits(t,e),t}(i);e.TopLevelTemplate=a;var u=function(e){function t(){e.apply(this,arguments)}return babelHelpers.inherits(t,e),t.prototype.compile=function(e){var t=this.compiled;if(t)return t;var i=new n.EntryPointCompiler(this,e).compile();return this.compiled=new r(i,this.symbolTable.size)},t}(a);e.EntryPoint=u;var l=function(e){function t(t,n,r,i,o){e.call(this,t,n),this.named=r,this.yields=i,this.hasPartials=o,this.hasNamedParameters=!!this.named.length,this.hasYields=!!this.yields.length}return babelHelpers.inherits(t,e),t}(a);e.Layout=l}),s("glimmer-runtime/lib/compiled/expressions",["exports"],function(e){"use strict";var t=function(){function e(){}return e.prototype.toJSON=function(){return"UNIMPL: "+this.type.toUpperCase()},e}();e.CompiledExpression=t}),s("glimmer-runtime/lib/compiled/expressions/args",["exports","glimmer-runtime/lib/compiled/expressions/positional-args","glimmer-runtime/lib/compiled/expressions/named-args","glimmer-runtime/lib/syntax/core","glimmer-reference"],function(e,t,n,r,i){"use strict";var o=function(){function e(e,t,n){this.positional=e,this.named=t,this.blocks=n}return e.create=function(e,i,o){return e===t.COMPILED_EMPTY_POSITIONAL_ARGS&&i===n.COMPILED_EMPTY_NAMED_ARGS&&o===r.EMPTY_BLOCKS?this.empty():new this(e,i,o)},e.empty=function(){return s},e.prototype.evaluate=function(e){var t=this.positional,n=this.named,r=this.blocks;return a.create(t.evaluate(e),n.evaluate(e),r)},e}();e.CompiledArgs=o;var s=new(function(e){function i(){e.call(this,t.COMPILED_EMPTY_POSITIONAL_ARGS,n.COMPILED_EMPTY_NAMED_ARGS,r.EMPTY_BLOCKS)}return babelHelpers.inherits(i,e),i.prototype.evaluate=function(e){return u},i}(o)),a=function(){function e(e,t,n){this.positional=e,this.named=t,this.blocks=n,this.tag=i.combineTagged([e,t])}return e.empty=function(){return u},e.create=function(e,t,n){return new this(e,t,n)},e.positional=function(e){var i=arguments.length<=1||void 0===arguments[1]?r.EMPTY_BLOCKS:arguments[1];return new this(t.EvaluatedPositionalArgs.create(e),n.EVALUATED_EMPTY_NAMED_ARGS,i)},e.named=function(e){var i=arguments.length<=1||void 0===arguments[1]?r.EMPTY_BLOCKS:arguments[1];return new this(t.EVALUATED_EMPTY_POSITIONAL_ARGS,n.EvaluatedNamedArgs.create(e),i)},e}();e.EvaluatedArgs=a;var u=new a(t.EVALUATED_EMPTY_POSITIONAL_ARGS,n.EVALUATED_EMPTY_NAMED_ARGS,r.EMPTY_BLOCKS);e.CompiledPositionalArgs=t.CompiledPositionalArgs,e.EvaluatedPositionalArgs=t.EvaluatedPositionalArgs,e.CompiledNamedArgs=n.CompiledNamedArgs,e.EvaluatedNamedArgs=n.EvaluatedNamedArgs}),s("glimmer-runtime/lib/compiled/expressions/concat",["exports","glimmer-reference"],function(e,t){"use strict";function n(e){return"function"!=typeof e.toString?"":String(e)}var r=function(){function e(e){this.parts=e,this.type="concat"}return e.prototype.evaluate=function(e){for(var t=new Array(this.parts.length),n=0;n0?e.join(""):null},r}(t.CachedReference)}),s("glimmer-runtime/lib/compiled/expressions/function",["exports","glimmer-runtime/lib/syntax","glimmer-runtime/lib/compiled/expressions"],function(e,t,n){"use strict";function r(e){return new i(e)}e.default=r;var i=function(e){function t(t){e.call(this),this.type="function-expression",this.func=t}return babelHelpers.inherits(t,e),t.prototype.compile=function(e,t,n){return new o(this.func,n)},t}(t.Expression),o=function(e){function t(t,n){e.call(this),this.func=t,this.symbolTable=n,this.type="function",this.func=t}return babelHelpers.inherits(t,e),t.prototype.evaluate=function(e){var t=this.func,n=this.symbolTable;return t(e,n)},t.prototype.toJSON=function(){var e=this.func;return e.name?"`"+e.name+"(...)`":"`func(...)`"},t}(n.CompiledExpression)}),s("glimmer-runtime/lib/compiled/expressions/has-block",["exports","glimmer-runtime/lib/compiled/expressions","glimmer-runtime/lib/references"],function(e,t,n){"use strict";var r=function(e){function t(t){e.call(this),this.inner=t,this.type="has-block"}return babelHelpers.inherits(t,e),t.prototype.evaluate=function(e){var t=this.inner.evaluate(e);return n.PrimitiveReference.create(!!t)},t.prototype.toJSON=function(){return"has-block("+this.inner.toJSON()+")"},t}(t.CompiledExpression);e.default=r;var i=function(e){function t(t){e.call(this),this.inner=t,this.type="has-block-params"}return babelHelpers.inherits(t,e),t.prototype.evaluate=function(e){var t=this.inner.evaluate(e);return n.PrimitiveReference.create(!!(t&&t.locals.length>0))},t.prototype.toJSON=function(){return"has-block-params("+this.inner.toJSON()+")"},t}(t.CompiledExpression);e.CompiledHasBlockParams=i;var o=function(){function e(e,t){this.symbol=e,this.debug=t}return e.prototype.evaluate=function(e){return e.scope().getBlock(this.symbol)},e.prototype.toJSON=function(){return"get-block($"+this.symbol+"("+this.debug+"))"},e}();e.CompiledGetBlockBySymbol=o;var s=function(){function e(e,t){this.symbol=e,this.name=t}return e.prototype.evaluate=function(e){var t=this.symbol,n=this.name,r=e.scope().getPartialArgs(t);return r.blocks[n]},e.prototype.toJSON=function(){return"get-block($"+this.symbol+"($ARGS)."+this.name+"))"},e}();e.CompiledInPartialGetBlock=s}),s("glimmer-runtime/lib/compiled/expressions/helper",["exports","glimmer-runtime/lib/compiled/expressions"],function(e,t){"use strict";var n=function(e){function t(t,n,r,i){e.call(this),this.name=t,this.helper=n,this.args=r,this.symbolTable=i,this.type="helper"}return babelHelpers.inherits(t,e),t.prototype.evaluate=function(e){var t=this.helper;return t(e,this.args.evaluate(e),this.symbolTable)},t.prototype.toJSON=function(){return"`"+this.name.join(".")+"($ARGS)`"},t}(t.CompiledExpression);e.default=n}),s("glimmer-runtime/lib/compiled/expressions/lookups",["exports","glimmer-runtime/lib/compiled/expressions","glimmer-reference"],function(e,t,n){"use strict";var r=function(e){function t(t,n){e.call(this),this.base=t,this.path=n,this.type="lookup"}return babelHelpers.inherits(t,e),t.create=function(e,t){return 0===t.length?e:new this(e,t)},t.prototype.evaluate=function(e){var t=this.base,r=this.path;return n.referenceFromParts(t.evaluate(e),r)},t.prototype.toJSON=function(){return this.base.toJSON()+"."+this.path.join(".")},t}(t.CompiledExpression);e.default=r;var i=function(e){function t(){e.apply(this,arguments)}return babelHelpers.inherits(t,e),t.prototype.evaluate=function(e){return e.getSelf()},t.prototype.toJSON=function(){return"self"},t}(t.CompiledExpression);e.CompiledSelf=i;var o=function(e){function t(t,n){e.call(this),this.symbol=t,this.debug=n}return babelHelpers.inherits(t,e),t.prototype.evaluate=function(e){return e.referenceForSymbol(this.symbol)},t.prototype.toJSON=function(){return"$"+this.symbol+"("+this.debug+")"},t}(t.CompiledExpression);e.CompiledSymbol=o;var s=function(e){function t(t,n){e.call(this),this.symbol=t,this.name=n}return babelHelpers.inherits(t,e),t.prototype.evaluate=function(e){var t=this.symbol,n=this.name,r=e.scope().getPartialArgs(t);return r.named.get(n)},t.prototype.toJSON=function(){return"$"+this.symbol+"($ARGS)."+this.name},t}(t.CompiledExpression);e.CompiledInPartialName=s}),s("glimmer-runtime/lib/compiled/expressions/named-args",["exports","glimmer-runtime/lib/references","glimmer-runtime/lib/utils","glimmer-reference","glimmer-util"],function(e,t,n,r,i){"use strict";var o=function(){function e(e,t){this.keys=e,this.values=t,this.length=e.length,i.assert(e.length===t.length,"Keys and values do not have the same length")}return e.empty=function(){return s},e.create=function(e){var t=Object.keys(e),n=t.length;if(n>0){for(var r=[],i=0;i"},t}(o));e.COMPILED_EMPTY_NAMED_ARGS=s;var a=function(){function e(e,t){var n=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2];this.keys=e,this.values=t,this._map=n,this.tag=r.combineTagged(t),this.length=e.length,i.assert(e.length===t.length,"Keys and values do not have the same length")}return e.create=function(e){var t=Object.keys(e),n=t.length;if(n>0){for(var r=new Array(n),i=0;i"},t}(i));e.COMPILED_EMPTY_POSITIONAL_ARGS=o;var s=function(){function e(e){this.values=e,this.tag=r.combineTagged(e),this.length=e.length}return e.create=function(e){return new this(e)},e.empty=function(){return a},e.prototype.at=function(e){var n=this.values,r=this.length;return e")}var u=function(e){function t(t){e.call(this),this.text=t,this.type="text"}return babelHelpers.inherits(t,e),t.prototype.evaluate=function(e){e.stack().appendText(this.text)},t.prototype.toJSON=function(){return{guid:this._guid,type:this.type,args:[JSON.stringify(this.text)]}},t}(t.Opcode);e.TextOpcode=u;var l=function(e){function t(t){e.call(this),this.tag=t,this.type="open-primitive-element"}return babelHelpers.inherits(t,e),t.prototype.evaluate=function(e){e.stack().openElement(this.tag)},t.prototype.toJSON=function(){return{guid:this._guid,type:this.type,args:[JSON.stringify(this.tag)]}},t}(t.Opcode);e.OpenPrimitiveElementOpcode=l; -var c=function(e){function t(){e.apply(this,arguments),this.type="push-remote-element"}return babelHelpers.inherits(t,e),t.prototype.evaluate=function(e){var t=e.frame.getOperand(),n=r.isConst(t)?void 0:new r.ReferenceCache(t),i=n?n.peek():t.value();e.stack().pushRemoteElement(i),n&&e.updateWith(new o.Assert(n))},t.prototype.toJSON=function(){return{guid:this._guid,type:this.type,args:["$OPERAND"]}},t}(t.Opcode);e.PushRemoteElementOpcode=c;var p=function(e){function t(){e.apply(this,arguments),this.type="pop-remote-element"}return babelHelpers.inherits(t,e),t.prototype.evaluate=function(e){e.stack().popRemoteElement()},t}(t.Opcode);e.PopRemoteElementOpcode=p;var h=function(e){function t(t){e.call(this),this.tag=t,this.type="open-component-element"}return babelHelpers.inherits(t,e),t.prototype.evaluate=function(e){e.stack().openElement(this.tag,new v(e.env))},t.prototype.toJSON=function(){return{guid:this._guid,type:this.type,args:[JSON.stringify(this.tag)]}},t}(t.Opcode);e.OpenComponentElementOpcode=h;var f=function(e){function t(){e.apply(this,arguments),this.type="open-dynamic-primitive-element"}return babelHelpers.inherits(t,e),t.prototype.evaluate=function(e){var t=e.frame.getOperand().value();e.stack().openElement(t)},t.prototype.toJSON=function(){return{guid:this._guid,type:this.type,args:["$OPERAND"]}},t}(t.Opcode);e.OpenDynamicPrimitiveElementOpcode=f;var m=function(){function e(){this.list=null,this.isConst=!0}return e.prototype.append=function(e){var t=this.list,n=this.isConst;null===t&&(t=this.list=[]),t.push(e),this.isConst=n&&r.isConst(e)},e.prototype.toReference=function(){var e=this.list,t=this.isConst;return e?t?i.PrimitiveReference.create(s(e)):new d(e):i.NULL_REFERENCE},e}(),d=function(e){function t(t){e.call(this),this.list=[],this.tag=r.combineTagged(t),this.list=t}return babelHelpers.inherits(t,e),t.prototype.compute=function(){return s(this.list)},t}(r.CachedReference),g=function(){function e(e){this.env=e,this.opcodes=null,this.classList=null}return e.prototype.addStaticAttribute=function(e,t,n){"class"===t?this.addClass(i.PrimitiveReference.create(n)):this.env.getAppendOperations().setAttribute(e,t,n)},e.prototype.addStaticAttributeNS=function(e,t,n,r){this.env.getAppendOperations().setAttribute(e,n,r,t)},e.prototype.addDynamicAttribute=function(e,t,n,r){if("class"===t)this.addClass(n);else{var i=this.env.attributeFor(e,t,r),o=new x(e,i,t,n);this.addAttribute(o)}},e.prototype.addDynamicAttributeNS=function(e,t,n,r,i){var o=this.env.attributeFor(e,n,i,t),s=new x(e,o,n,r,t);this.addAttribute(s)},e.prototype.flush=function(e,t){for(var n=t.env,r=this.opcodes,i=this.classList,o=0;r&&o.')},t.prototype.valueSyntax=function(){return F.build(this.value)},t}(t.Argument);e.StaticArg=O;var S=function(e){function t(t,n){var r=arguments.length<=2||void 0===arguments[2]?null:arguments[2];e.call(this),this.name=t,this.value=n,this.namespace=r,this.type="dynamic-arg"}return babelHelpers.inherits(t,e),t.fromSpec=function(e){var n=e[1],r=e[2];return new t(n,a.default(r))},t.build=function(e,t){return new this(e,t)},t.prototype.compile=function(){throw new Error('Cannot compile DynamicArg for "'+this.name+'" as it is delegate for ExpressionSyntax.')},t.prototype.valueSyntax=function(){return this.value},t}(t.Argument);e.DynamicArg=S;var x=function(){function e(){}return e.fromSpec=function(e){var t=e[1],n=e[2],r=e[3];return new A(t,a.default(n),r,!0)},e.build=function(e,t,n){var r=arguments.length<=3||void 0===arguments[3]?null:arguments[3];return new A(e,t,r,n)},e.prototype.compile=function(){throw new Error("Attempting to compile a TrustingAttr which is just a delegate for DynamicAttr.")},e}();e.TrustingAttr=x;var C=function(e){function t(t,n,r){e.call(this),this.name=t,this.value=n,this.namespace=r,this["e1185d30-7cac-4b12-b26a-35327d905d92"]=!0,this.type="static-attr",this.isTrusting=!1}return babelHelpers.inherits(t,e),t.fromSpec=function(e){var n=e[1],r=e[2],i=e[3];return new t(n,r,i)},t.build=function(e,t){var n=arguments.length<=2||void 0===arguments[2]?null:arguments[2];return new this(e,t,n)},t.prototype.compile=function(e){e.append(new s.StaticAttrOpcode(this.namespace,this.name,this.value))},t.prototype.valueSyntax=function(){return F.build(this.value)},t}(t.Attribute);e.StaticAttr=C;var A=function(e){function t(t,n,r,i){void 0===r&&(r=void 0),e.call(this),this.name=t,this.value=n,this.namespace=r,this.isTrusting=i,this["e1185d30-7cac-4b12-b26a-35327d905d92"]=!0,this.type="dynamic-attr"}return babelHelpers.inherits(t,e),t.fromSpec=function(e){var n=e[1],r=e[2],i=e[3];return new t(n,a.default(r),i)},t.build=function(e,t){var n=!(arguments.length<=2||void 0===arguments[2])&&arguments[2],r=arguments.length<=3||void 0===arguments[3]?null:arguments[3];return new this(e,t,r,n)},t.prototype.compile=function(e,t,n){var r=this.namespace,o=this.value;e.append(new i.PutValueOpcode(o.compile(e,t,n))),r?e.append(new s.DynamicAttrNSOpcode(this.name,this.namespace,this.isTrusting)):e.append(new s.DynamicAttrOpcode(this.name,this.isTrusting))},t.prototype.valueSyntax=function(){return this.value},t}(t.Attribute);e.DynamicAttr=A;var k=function(e){function t(){e.apply(this,arguments),this.type="flush-element"}return babelHelpers.inherits(t,e),t.fromSpec=function(){return new t},t.build=function(){return new this},t.prototype.compile=function(e){e.append(new s.FlushElementOpcode)},t}(t.Statement);e.FlushElement=k;var T=function(e){function t(){e.apply(this,arguments),this.type="close-element"}return babelHelpers.inherits(t,e),t.fromSpec=function(){return new t},t.build=function(){return new this},t.prototype.compile=function(e){e.append(new s.CloseElementOpcode)},t}(t.Statement);e.CloseElement=T;var N=function(e){function t(t){e.call(this),this.content=t,this.type="text"}return babelHelpers.inherits(t,e),t.fromSpec=function(e){var n=e[1];return new t(n)},t.build=function(e){return new this(e)},t.prototype.compile=function(e){e.text(this.content)},t}(t.Statement);e.Text=N;var R=function(e){function t(t){e.call(this),this.comment=t,this.type="comment"}return babelHelpers.inherits(t,e),t.fromSpec=function(e){var n=e[1];return new t(n)},t.build=function(e){return new this(e)},t.prototype.compile=function(e){e.comment(this.comment)},t}(t.Statement);e.Comment=R;var P=function(e){function n(t,n,r){e.call(this),this.tag=t,this.blockParams=n,this.symbolTable=r,this.type="open-element"}return babelHelpers.inherits(n,e),n.fromSpec=function(e,t){var r=e[1],i=e[2];return new n(r,i,t)},n.build=function(e,t,n){return new this(e,t,n)},n.prototype.scan=function(e){var t=this.tag;if(e.env.hasComponentDefinition([t],this.symbolTable)){var n=this.parameters(e),r=n.args,i=n.attrs;e.startBlock(this.blockParams),this.tagContents(e);var o=e.endBlock(this.blockParams);return r.blocks=Y.fromSpec(o),new D(t,i,r)}return new I(t)},n.prototype.compile=function(e,t){e.append(new s.OpenPrimitiveElementOpcode(this.tag))},n.prototype.toIdentity=function(){var e=this.tag;return new I(e)},n.prototype.parameters=function(e){for(var n=e.next(),r=[],i=[],o=[];!(n instanceof k);){if(n[w])throw new Error("Compile Error: Element modifiers are not allowed in components");var s=n;if(n[t.ATTRIBUTE])r.push(s.name),i.push(s.name),o.push(s.valueSyntax());else{if(!n[t.ARGUMENT])throw new Error("Expected FlushElement, but got ${current}");i.push(s.name),o.push(s.valueSyntax())}n=e.next()}return{args:J.fromNamedArgs(X.build(i,o)),attrs:r}},n.prototype.tagContents=function(e){for(var t=1;;){var r=e.next();if(r instanceof T&&0===--t)break;e.addStatement(r),(r instanceof n||r instanceof I)&&t++}},n}(t.Statement);e.OpenElement=P;var D=function(e){function t(t,n,r){e.call(this),this.tag=t,this.attrs=n,this.args=r,this.type="component"}return babelHelpers.inherits(t,e),t.prototype.compile=function(e,t,n){var r=t.getComponentDefinition([this.tag],n),i=this.args.compile(e,t,n),s=this.attrs; -e.append(new o.PutComponentDefinitionOpcode(r)),e.append(new o.OpenComponentOpcode(i,s)),e.append(new o.CloseComponentOpcode)},t}(t.Statement);e.Component=D;var I=function(e){function t(t){e.call(this),this.tag=t,this.type="open-primitive-element"}return babelHelpers.inherits(t,e),t.build=function(e){return new this(e)},t.prototype.compile=function(e){e.append(new s.OpenPrimitiveElementOpcode(this.tag))},t}(t.Statement);e.OpenPrimitiveElement=I;var L=function(e){function t(t,n){e.call(this),this.to=t,this.args=n,this.type="yield"}return babelHelpers.inherits(t,e),t.fromSpec=function(e){var n=e[1],r=e[2],i=J.fromSpec(r,null,Q);return new t(n,i)},t.build=function(e,t){var n=J.fromPositionalArgs($.build(e));return new this(t,n)},t.prototype.compile=function(e,t,n){var r=this.to,i=this.args.compile(e,t,n);if(e.hasBlockSymbol(r)){var o=e.getBlockSymbol(r),s=new p.CompiledGetBlockBySymbol(o,r);e.append(new j(s,i)),e.append(new H)}else{if(!e.hasPartialArgsSymbol())throw new Error("[BUG] ${to} is not a valid block name.");var o=e.getPartialArgsSymbol(),s=new p.CompiledInPartialGetBlock(o,r);e.append(new j(s,i)),e.append(new H)}},t}(t.Statement);e.Yield=L;var M=function(e){function t(){e.apply(this,arguments)}return babelHelpers.inherits(t,e),t.fromSpec=function(e){var t=e[1],r=a.default(t);return g(r)?new n.StaticPartialSyntax(r):new n.DynamicPartialSyntax(r)},t}(t.Statement);e.Partial=M;var j=function(e){function t(t,n){e.call(this),this.inner=t,this.args=n,this.type="open-block"}return babelHelpers.inherits(t,e),t.prototype.evaluate=function(e){var t=this.inner.evaluate(e),n=void 0;t&&(n=this.args.evaluate(e)),e.pushCallerScope(),t&&e.invokeBlock(t,n)},t.prototype.toJSON=function(){return{guid:this._guid,type:this.type,details:{block:this.inner.toJSON(),positional:this.args.positional.toJSON(),named:this.args.named.toJSON()}}},t}(r.Opcode),H=function(e){function t(){e.apply(this,arguments),this.type="close-block"}return babelHelpers.inherits(t,e),t.prototype.evaluate=function(e){e.popScope()},t}(r.Opcode);e.CloseBlockOpcode=H;var F=function(e){function t(t){e.call(this),this.value=t,this.type="value"}return babelHelpers.inherits(t,e),t.fromSpec=function(e){return new t(e)},t.build=function(e){return new this(e)},t.prototype.inner=function(){return this.value},t.prototype.compile=function(e){return new l.default(this.value)},t}(t.Expression);e.Value=F;var U=function(e){function t(t){e.call(this),this.parts=t,this.type="get-argument"}return babelHelpers.inherits(t,e),t.fromSpec=function(e){var n=e[1];return new t(n)},t.build=function(e){return new this(e.split("."))},t.prototype.compile=function(e){var t=this.parts,n=t[0];if(e.hasNamedSymbol(n)){var r=e.getNamedSymbol(n),i=t.slice(1),o=new c.CompiledSymbol(r,n);return c.default.create(o,i)}if(e.hasPartialArgsSymbol()){var r=e.getPartialArgsSymbol(),i=t.slice(1),o=new c.CompiledInPartialName(r,n);return c.default.create(o,i)}throw new Error("[BUG] @"+this.parts.join(".")+" is not a valid lookup path.")},t}(t.Expression);e.GetArgument=U;var B=function(e){function t(t){e.call(this),this.parts=t,this.type="ref"}return babelHelpers.inherits(t,e),t.build=function(e){var t=e.split(".");return"this"===t[0]&&(t[0]=null),new this(t)},t.prototype.compile=function(e){var t=this.parts,n=t[0];if(null===n){var r=new c.CompiledSelf,i=t.slice(1);return c.default.create(r,i)}if(e.hasLocalSymbol(n)){var o=e.getLocalSymbol(n),i=t.slice(1),r=new c.CompiledSymbol(o,n);return c.default.create(r,i)}var r=new c.CompiledSelf;return c.default.create(r,t)},t}(t.Expression);e.Ref=B;var z=function(e){function t(t){e.call(this),this.ref=t,this.type="get"}return babelHelpers.inherits(t,e),t.fromSpec=function(e){var t=e[1];return new this(new B(t))},t.build=function(e){return new this(B.build(e))},t.prototype.compile=function(e){return this.ref.compile(e)},t}(t.Expression);e.Get=z;var V=function(e){function t(t){e.call(this),this.ref=t,this.type="unknown"}return babelHelpers.inherits(t,e),t.fromSpec=function(e){var t=e[1];return new this(new B(t))},t.build=function(e){return new this(B.build(e))},t.prototype.compile=function(e,t,n){var r=this.ref;return t.hasHelper(r.parts,n)?new h.default(r.parts,t.lookupHelper(r.parts,n),u.CompiledArgs.empty(),n):this.ref.compile(e)},t}(t.Expression);e.Unknown=V;var q=function(e){function t(t,n){e.call(this),this.ref=t,this.args=n,this.type="helper"}return babelHelpers.inherits(t,e),t.fromSpec=function(e){var n=e[1],r=e[2],i=e[3];return new t(new B(n),J.fromSpec(r,i,Q))},t.build=function(e,t,n){return new this(B.build(e),J.build(t,n,Q))},t.prototype.compile=function(e,t,n){if(t.hasHelper(this.ref.parts,n)){var r=this.args,i=this.ref;return new h.default(i.parts,t.lookupHelper(i.parts,n),r.compile(e,t,n),n)}throw new Error("Compile Error: "+this.ref.parts.join(".")+" is not a helper")},t}(t.Expression);e.Helper=q;var G=function(e){function t(t){e.call(this),this.blockName=t,this.type="has-block"}return babelHelpers.inherits(t,e),t.fromSpec=function(e){var n=e[1];return new t(n)},t.build=function(e){return new this(e)},t.prototype.compile=function(e,t){var n=this.blockName;if(e.hasBlockSymbol(n)){var r=e.getBlockSymbol(n),i=new p.CompiledGetBlockBySymbol(r,n);return new p.default(i)}if(e.hasPartialArgsSymbol()){var r=e.getPartialArgsSymbol(),i=new p.CompiledInPartialGetBlock(r,n);return new p.default(i)}throw new Error("[BUG] ${blockName} is not a valid block name.")},t}(t.Expression);e.HasBlock=G;var W=function(e){function t(t){e.call(this),this.blockName=t,this.type="has-block-params"}return babelHelpers.inherits(t,e),t.fromSpec=function(e){var n=e[1];return new t(n)},t.build=function(e){return new this(e)},t.prototype.compile=function(e,t){var n=this.blockName;if(e.hasBlockSymbol(n)){var r=e.getBlockSymbol(n),i=new p.CompiledGetBlockBySymbol(r,n);return new p.CompiledHasBlockParams(i)}if(e.hasPartialArgsSymbol()){var r=e.getPartialArgsSymbol(),i=new p.CompiledInPartialGetBlock(r,n);return new p.CompiledHasBlockParams(i)}throw new Error("[BUG] ${blockName} is not a valid block name.")},t}(t.Expression);e.HasBlockParams=W;var K=function(){function e(e){this.parts=e,this.type="concat"}return e.fromSpec=function(t){var n=t[1];return new e(n.map(a.default))},e.build=function(e){return new this(e)},e.prototype.compile=function(e,t,n){return new f.default(this.parts.map(function(r){return r.compile(e,t,n)}))},e}();e.Concat=K;var Y=function(){function e(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];this.type="blocks",this.default=e,this.inverse=t}return e.fromSpec=function(t){var n=arguments.length<=1||void 0===arguments[1]?null:arguments[1];return new e(t,n)},e.empty=function(){return Q},e}();e.Blocks=Y;var Q=new(function(e){function t(){e.call(this,null,null)}return babelHelpers.inherits(t,e),t}(Y));e.EMPTY_BLOCKS=Q;var J=function(){function e(e,t,n){this.positional=e,this.named=t,this.blocks=n,this.type="args"}return e.empty=function(){return te},e.fromSpec=function(t,n,r){return new e($.fromSpec(t),X.fromSpec(n),r)},e.fromPositionalArgs=function(t){var n=arguments.length<=1||void 0===arguments[1]?Q:arguments[1];return new e(t,ee,n)},e.fromNamedArgs=function(t){var n=arguments.length<=1||void 0===arguments[1]?Q:arguments[1];return new e(Z,t,n)},e.build=function(e,t,n){return e===Z&&t===ee&&n===Q?te:new this(e,t,n)},e.prototype.compile=function(e,t,n){var r=this.positional,i=this.named,o=this.blocks;return u.CompiledArgs.create(r.compile(e,t,n),i.compile(e,t,n),o)},e}();e.Args=J;var $=function(){function e(e){this.values=e,this.type="positional",this.length=e.length}return e.empty=function(){return Z},e.fromSpec=function(t){return t&&0!==t.length?new e(t.map(a.default)):Z},e.build=function(e){return 0===e.length?Z:new this(e)},e.prototype.slice=function(t,n){return e.build(this.values.slice(t,n))},e.prototype.at=function(e){return this.values[e]},e.prototype.compile=function(e,t,n){return u.CompiledPositionalArgs.create(this.values.map(function(r){return r.compile(e,t,n)}))},e}();e.PositionalArgs=$;var Z=new(function(e){function t(){e.call(this,m.EMPTY_ARRAY)}return babelHelpers.inherits(t,e),t.prototype.slice=function(e,t){return this},t.prototype.at=function(e){},t.prototype.compile=function(e,t){return u.CompiledPositionalArgs.empty()},t}($)),X=function(){function e(e,t){this.keys=e,this.values=t,this.type="named",this.length=e.length}return e.empty=function(){return ee},e.fromSpec=function(e){if(null===e||void 0===e)return ee;var t=e[0],n=e[1];return 0===t.length?ee:new this(t,n.map(function(e){return a.default(e)}))},e.build=function(e,t){return 0===e.length?ee:new this(e,t)},e.prototype.at=function(e){var t=this.keys,n=this.values,r=t.indexOf(e);return n[r]},e.prototype.has=function(e){return this.keys.indexOf(e)!==-1},e.prototype.compile=function(e,t,n){var r=this.keys,i=this.values;return new u.CompiledNamedArgs(r,i.map(function(r){return r.compile(e,t,n)}))},e}();e.NamedArgs=X;var ee=new(function(e){function t(){e.call(this,m.EMPTY_ARRAY,m.EMPTY_ARRAY)}return babelHelpers.inherits(t,e),t.prototype.at=function(e){},t.prototype.has=function(e){return!1},t.prototype.compile=function(e,t){return u.CompiledNamedArgs.empty()},t}(X)),te=new(function(e){function t(){e.call(this,Z,ee,Q)}return babelHelpers.inherits(t,e),t.prototype.compile=function(e,t){return u.CompiledArgs.empty()},t}(J))}),s("glimmer-runtime/lib/syntax/expressions",["exports","glimmer-runtime/lib/syntax/core","glimmer-wire-format"],function(e,t,n){"use strict";var r=n.Expressions.isArg,i=n.Expressions.isConcat,o=n.Expressions.isGet,s=n.Expressions.isHasBlock,a=n.Expressions.isHasBlockParams,u=n.Expressions.isHelper,l=n.Expressions.isUnknown,c=n.Expressions.isPrimitiveValue,p=n.Expressions.isUndefined;e.default=function(e){if(c(e))return t.Value.fromSpec(e);if(p(e))return t.Value.build(void 0);if(r(e))return t.GetArgument.fromSpec(e);if(i(e))return t.Concat.fromSpec(e);if(o(e))return t.Get.fromSpec(e);if(u(e))return t.Helper.fromSpec(e);if(l(e))return t.Unknown.fromSpec(e);if(s(e))return t.HasBlock.fromSpec(e);if(a(e))return t.HasBlockParams.fromSpec(e);throw new Error("Unexpected wire format: "+JSON.stringify(e))}}),s("glimmer-runtime/lib/syntax/statements",["exports","glimmer-runtime/lib/syntax/core","glimmer-wire-format"],function(e,t,n){"use strict";var r=n.Statements.isYield,i=n.Statements.isBlock,o=n.Statements.isPartial,s=n.Statements.isAppend,a=n.Statements.isDynamicAttr,u=n.Statements.isText,l=n.Statements.isComment,c=n.Statements.isOpenElement,p=n.Statements.isFlushElement,h=n.Statements.isCloseElement,f=n.Statements.isStaticAttr,m=n.Statements.isModifier,d=n.Statements.isDynamicArg,g=n.Statements.isStaticArg,v=n.Statements.isTrustingAttr;e.default=function(e,n,y){return r(e)?t.Yield.fromSpec(e):o(e)?t.Partial.fromSpec(e):i(e)?t.Block.fromSpec(e,n,y):s(e)?t.OptimizedAppend.fromSpec(e):a(e)?t.DynamicAttr.fromSpec(e):d(e)?t.DynamicArg.fromSpec(e):v(e)?t.TrustingAttr.fromSpec(e):u(e)?t.Text.fromSpec(e):l(e)?t.Comment.fromSpec(e):c(e)?t.OpenElement.fromSpec(e,n):p(e)?t.FlushElement.fromSpec():h(e)?t.CloseElement.fromSpec():f(e)?t.StaticAttr.fromSpec(e):g(e)?t.StaticArg.fromSpec(e):m(e)?t.Modifier.fromSpec(e):void 0}}),s("glimmer-runtime/lib/template",["exports","glimmer-util","glimmer-runtime/lib/builder","glimmer-runtime/lib/vm","glimmer-runtime/lib/scanner"],function(e,t,n,r,i){"use strict";function o(e){var n=e.id,r=e.meta,i=e.block,o=void 0;n||(n="client-"+a++);var u=function(e,a){var u=a?t.assign({},a,r):r;return o||(o=JSON.parse(i)),s(o,n,u,e)};return{id:n,meta:r,create:u}}function s(e,t,o,s){var a=new i.default(e,o,s),u=void 0,l=function(){return u||(u=a.scanEntryPoint()),u},c=void 0,p=function(){return c||(c=a.scanLayout()),c},h=function(e){return a.scanPartial(e)},f=function(e,t,i){var o=n.ElementStack.forInitialRender(s,t,null),a=l().compile(s),u=r.VM.initial(s,e,i,o,a.symbols);return u.execute(a.ops)};return{id:t,meta:o,_block:e,asEntryPoint:l,asLayout:p,asPartial:h,render:f}}e.default=o;var a=0}),s("glimmer-runtime/lib/upsert",["exports","glimmer-runtime/lib/bounds"],function(e,t){"use strict";function n(e){return e&&"function"==typeof e.toHTML}function r(e){return null!==e&&"object"==typeof e&&"number"==typeof e.nodeType}function i(e){return"string"==typeof e}function o(e,t,o){return i(o)?u.insert(e,t,o):n(o)?c.insert(e,t,o):r(o)?p.insert(e,t,o):void 0}function s(e,t,n){return i(n)?l.insert(e,t,n):r(n)?p.insert(e,t,n):void 0}e.isSafeString=n,e.isNode=r,e.isString=i,e.cautiousInsert=o,e.trustingInsert=s;var a=function(e){this.bounds=e};e.default=a;var u=function(e){function n(t,n){e.call(this,t),this.textNode=n}return babelHelpers.inherits(n,e),n.insert=function(e,r,i){var o=e.createTextNode(i);e.insertBefore(r.element,o,r.nextSibling);var s=new t.SingleNodeBounds(r.element,o);return new n(s,o)},n.prototype.update=function(e,t){if(i(t)){var n=this.textNode;return n.nodeValue=t,!0}return!1},n}(a),l=function(e){function n(){e.apply(this,arguments)}return babelHelpers.inherits(n,e),n.insert=function(e,t,r){var i=e.insertHTMLBefore(t.element,r,t.nextSibling);return new n(i)},n.prototype.update=function(e,n){if(i(n)){var r=this.bounds,o=r.parentElement(),s=t.clear(r);return this.bounds=e.insertHTMLBefore(o,s,n),!0}return!1},n}(a),c=function(e){function r(t,n){e.call(this,t),this.lastStringValue=n}return babelHelpers.inherits(r,e),r.insert=function(e,t,n){var i=n.toHTML(),o=e.insertHTMLBefore(t.element,i,t.nextSibling);return new r(o,i)},r.prototype.update=function(e,r){if(n(r)){var i=r.toHTML();if(i!==this.lastStringValue){var o=this.bounds,s=o.parentElement(),a=t.clear(o);this.bounds=e.insertHTMLBefore(s,a,i),this.lastStringValue=i}return!0}return!1},r}(a),p=function(e){function n(){e.apply(this,arguments)}return babelHelpers.inherits(n,e),n.insert=function(e,r,i){return e.insertBefore(r.element,i,r.nextSibling),new n(t.single(r.element,i))},n.prototype.update=function(e,n){if(r(n)){var i=this.bounds,o=i.parentElement(),s=t.clear(i);return this.bounds=e.insertNodeBefore(o,n,s),!0}return!1},n}(a)}),s("glimmer-runtime/lib/utils",["exports","glimmer-util"],function(e,t){"use strict";var n=Object.freeze([]);e.EMPTY_ARRAY=n;var r=Object.freeze(t.dict());e.EMPTY_DICT=r;var i=function(){function e(e,t,n){this.list=e,this.start=t,this.end=n}return e.prototype.at=function(e){return e>=this.list.length?null:this.list[e]},e.prototype.min=function(){return this.start},e.prototype.max=function(){return this.end},e}();e.ListRange=i}),s("glimmer-runtime/lib/vm",["exports","glimmer-runtime/lib/vm/append","glimmer-runtime/lib/vm/update","glimmer-runtime/lib/vm/render-result"],function(e,t,n,r){"use strict";e.VM=t.default,e.PublicVM=t.PublicVM,e.UpdatingVM=n.default,e.RenderResult=r.default}),s("glimmer-runtime/lib/vm/append",["exports","glimmer-runtime/lib/environment","glimmer-util","glimmer-reference","glimmer-runtime/lib/compiled/opcodes/vm","glimmer-runtime/lib/vm/update","glimmer-runtime/lib/vm/render-result","glimmer-runtime/lib/vm/frame"],function(e,t,n,r,i,o,s,a){"use strict";var u=function(){function e(e,t,r,i){this.env=e,this.elementStack=i,this.dynamicScopeStack=new n.Stack,this.scopeStack=new n.Stack,this.updatingOpcodeStack=new n.Stack,this.cacheGroups=new n.Stack,this.listBlockStack=new n.Stack,this.frame=new a.FrameStack,this.env=e,this.elementStack=i,this.scopeStack.push(t),this.dynamicScopeStack.push(r)}return e.initial=function(n,r,i,o,s){var a=t.Scope.root(r,s);return new e(n,a,i,o)},e.prototype.capture=function(){return{env:this.env,scope:this.scope(),dynamicScope:this.dynamicScope(),frame:this.frame.capture()}},e.prototype.goto=function(e){this.frame.goto(e)},e.prototype.beginCacheGroup=function(){this.cacheGroups.push(this.updatingOpcodeStack.current.tail())},e.prototype.commitCacheGroup=function(){var e=new i.LabelOpcode("END"),t=this.updatingOpcodeStack.current,o=this.cacheGroups.pop(),s=o?t.nextNode(o):t.head(),a=t.tail(),u=r.combineSlice(new n.ListSlice(s,a)),l=new i.JumpIfNotModifiedOpcode(u,e);t.insertBefore(l,s),t.append(new i.DidModifyOpcode(l)),t.append(e)},e.prototype.enter=function(e){var t=new n.LinkedList,r=this.stack().pushUpdatableBlock(),i=this.capture(),s=new o.TryOpcode(e,i,r,t);this.didEnter(s,t)},e.prototype.enterWithKey=function(e,t){var r=new n.LinkedList,i=this.stack().pushUpdatableBlock(),s=this.capture(),a=new o.TryOpcode(t,s,i,r);this.listBlockStack.current.map[e]=a,this.didEnter(a,r)},e.prototype.enterList=function(e){var t=new n.LinkedList,r=this.stack().pushBlockList(t),i=this.capture(),s=this.frame.getIterator().artifacts,a=new o.ListBlockOpcode(e,i,r,t,s);this.listBlockStack.push(a),this.didEnter(a,t)},e.prototype.didEnter=function(e,t){this.updateWith(e),this.updatingOpcodeStack.push(t)},e.prototype.exit=function(){this.stack().popBlock(),this.updatingOpcodeStack.pop();var e=this.updatingOpcodeStack.current.tail();e.didInitializeChildren()},e.prototype.exitList=function(){this.exit(),this.listBlockStack.pop()},e.prototype.updateWith=function(e){this.updatingOpcodeStack.current.append(e)},e.prototype.stack=function(){return this.elementStack},e.prototype.scope=function(){return this.scopeStack.current},e.prototype.dynamicScope=function(){return this.dynamicScopeStack.current},e.prototype.pushFrame=function(e,t,n){this.frame.push(e.ops),t&&this.frame.setArgs(t),t&&t.blocks&&this.frame.setBlocks(t.blocks),n&&this.frame.setCallerScope(n)},e.prototype.pushComponentFrame=function(e,t,n,r,i,o){this.frame.push(e.ops,r,i,o),t&&this.frame.setArgs(t),t&&t.blocks&&this.frame.setBlocks(t.blocks),n&&this.frame.setCallerScope(n)},e.prototype.pushEvalFrame=function(e){this.frame.push(e)},e.prototype.pushChildScope=function(){this.scopeStack.push(this.scopeStack.current.child())},e.prototype.pushCallerScope=function(){this.scopeStack.push(this.scope().getCallerScope())},e.prototype.pushDynamicScope=function(){var e=this.dynamicScopeStack.current.child();return this.dynamicScopeStack.push(e),e},e.prototype.pushRootScope=function(e,n){var r=t.Scope.root(e,n);return this.scopeStack.push(r),r},e.prototype.popScope=function(){this.scopeStack.pop()},e.prototype.popDynamicScope=function(){this.dynamicScopeStack.pop()},e.prototype.newDestroyable=function(e){this.stack().newDestroyable(e)},e.prototype.getSelf=function(){return this.scope().getSelf()},e.prototype.referenceForSymbol=function(e){return this.scope().getSymbol(e)},e.prototype.getArgs=function(){return this.frame.getArgs()},e.prototype.resume=function(e,t){return this.execute(e,function(e){return e.frame.restore(t)})},e.prototype.execute=function(e,t){n.LOGGER.debug("[VM] Begin program execution");var r=this.elementStack,i=this.frame,o=this.updatingOpcodeStack,a=this.env;r.pushSimpleBlock(),o.push(new n.LinkedList),i.push(e),t&&t(this);for(var u=void 0;i.hasOpcodes();)(u=i.nextStatement())&&(n.LOGGER.debug("[VM] OP "+u.type),n.LOGGER.trace(u),u.evaluate(this));return n.LOGGER.debug("[VM] Completed program execution"),new s.default(a,o.pop(),r.popBlock())},e.prototype.evaluateOpcode=function(e){e.evaluate(this)},e.prototype.invokeBlock=function(e,t){var n=e.compile(this.env);this.pushFrame(n,t)},e.prototype.invokePartial=function(e){var t=e.compile(this.env);this.pushFrame(t)},e.prototype.invokeLayout=function(e,t,n,r,i,o){this.pushComponentFrame(t,e,n,r,i,o)},e.prototype.evaluateOperand=function(e){this.frame.setOperand(e.evaluate(this))},e.prototype.evaluateArgs=function(e){var t=this.frame.setArgs(e.evaluate(this));this.frame.setOperand(t.positional.at(0))},e.prototype.bindPositionalArgs=function(e){var t=this.frame.getArgs();n.assert(t,"Cannot bind positional args");for(var r=t.positional,i=this.scope(),o=0;o2&&"[]"===s.slice(a-2)&&(u=!0,s=s.slice(0,a-2),n[s]||(n[s]=[])),i=o[1]?O(o[1]):""),u?n[s].push(i):n[s]=i}return n},recognize:function(e){var t,n,r,i,o=[this.rootState],s={},u=!1;if(i=e.indexOf("#"),i!==-1&&(e=e.substr(0,i)),r=e.indexOf("?"),r!==-1){var l=e.substr(r+1,e.length);e=e.substr(0,r),s=this.parseQueryString(l)}"/"!==e.charAt(0)&&(e="/"+e);var c=e;for(T.ENCODE_AND_DECODE_PATH_SEGMENTS?e=a(e):(e=decodeURI(e),c=decodeURI(c)),t=e.length,t>1&&"/"===e.charAt(t-1)&&(e=e.substr(0,t-1),c=c.substr(0,c.length-1),u=!0),n=0;n0&&e[r-1]&&e[r-1].hasOwnProperty("queryParams")?(n=e[r-1].queryParams,t=B.call(e,0,r-1),[t,n]):[e,null]}function s(e){for(var t in e)if("number"==typeof e[t])e[t]=""+e[t];else if(z(e[t]))for(var n=0,r=e[t].length;n=0;a--){var l=t[a],c=l.handler;if(c){if(c.events&&c.events[o]){if(c.events[o].apply(c,r)!==!0)return;s=!0}}else l.handlerPromise.then(u(null,i,o,r))}if("error"===o&&"UnrecognizedURLError"===r[0].name)throw r[0];if(!s&&!n)throw new Error("Nothing handled the event '"+o+"'.")}function h(e,t){var n,r={all:{},changed:{},removed:{}};i(r.all,t);var o=!1;s(e),s(t);for(n in e)e.hasOwnProperty(n)&&(t.hasOwnProperty(n)||(o=!0,r.removed[n]=e[n]));for(n in t)if(t.hasOwnProperty(n))if(z(e[n])&&z(t[n]))if(e[n].length!==t[n].length)r.changed[n]=t[n],o=!0;else for(var a=0,u=e[n].length;a=0;--u){var l=o[u];i(a,l.params),l.handler.inaccessibleByURL&&(n=null)}if(n){a.queryParams=e._visibleQueryParams||t.queryParams;var c=r.recognizer.generate(s,a),p=e.isCausedByInitialTransition,h="replace"===n&&!e.isCausedByAbortingTransition;p||h?r.replaceURL(c):r.updateURL(c)}}}function L(e,t){try{a(e.router,e.sequence,"Resolved all models on destination route; finalizing transition.");var r=e.router,i=t.handlerInfos;return R(r,t,e),e.isAborted?(r.state.handlerInfos=r.currentHandlerInfos,n.Promise.reject(E(e))):(I(e,t,e.intent.url),e.isActive=!1,r.activeTransition=null,p(r,r.currentHandlerInfos,!0,["didTransition"]),r.didTransition&&r.didTransition(r.currentHandlerInfos),a(r,e.sequence,"TRANSITION COMPLETE."),i[i.length-1].handler)}catch(t){if(!(t instanceof b)){var o=e.state.handlerInfos;e.trigger(!0,"error",t,e,o[o.length-1].handler),e.abort()}throw t}}function M(e,t,n){var r=t[0]||"/",i=t[t.length-1],o={};i&&i.hasOwnProperty("queryParams")&&(o=J.call(t).queryParams);var s;if(0===t.length){a(e,"Updating query params");var u=e.state.handlerInfos;s=new Y({name:u[u.length-1].name,contexts:[],queryParams:o})}else"/"===r.charAt(0)?(a(e,"Attempting URL transition to "+r),s=new Q({url:r})):(a(e,"Attempting transition to "+r),s=new Y({name:t[0],contexts:B.call(t,1),queryParams:o}));return e.transitionByIntent(s,n)}function j(e,t){if(e.length!==t.length)return!1;for(var n=0,r=e.length;n=r.length?r.length-1:t.resolveIndex;return n.Promise.reject({error:e,handlerWithError:u.handlerInfos[i].handler,wasAborted:l,state:u})}function o(e){var n=u.handlerInfos[t.resolveIndex].isResolved;if(u.handlerInfos[t.resolveIndex++]=e,!n){var i=e.handler;g(i,"redirect",e.context,t)}return r().then(s,null,u.promiseLabel("Resolve handler"))}function s(){if(t.resolveIndex===u.handlerInfos.length)return{error:null,state:u};var e=u.handlerInfos[t.resolveIndex];return e.resolve(r,t).then(o,null,u.promiseLabel("Proceed"))}var a=this.params;c(this.handlerInfos,function(e){a[e.name]=e.params||{}}),t=t||{},t.resolveIndex=0;var u=this,l=!1;return n.Promise.resolve(null,this.promiseLabel("Start transition")).then(s,null,this.promiseLabel("Resolve handler")).catch(i,this.promiseLabel("Handle error"))}},b.prototype=V(Error.prototype),_.prototype={targetName:null,urlMethod:"update",intent:null,pivotHandler:null,resolveIndex:0,resolvedModels:null,state:null,queryParamsOnly:!1,isTransition:!0,isExiting:function(e){for(var t=this.handlerInfos,n=0,r=t.length;n=0;--u){var f=t[u],m=f.handler,d=e.handlerInfos[u],g=null;if(f.names.length>0)if(u>=h)g=this.createParamHandlerInfo(m,n,f.names,p,d);else{var v=a(m);g=this.getHandlerInfoForDynamicSegment(m,n,f.names,p,d,r,u,v); -}else g=this.createParamHandlerInfo(m,n,f.names,p,d);if(s){g=g.becomeResolved(null,g.context);var b=d&&d.context;f.names.length>0&&g.context===b&&(g.params=d&&d.params),g.context=b}var _=d;(u>=h||g.shouldSupercede(d))&&(h=Math.min(u,h),_=g),o&&!s&&(_=_.becomeResolved(null,_.context)),c.handlerInfos.unshift(_)}if(p.length>0)throw new Error("More context objects were passed than there are dynamic segments for the route: "+r);return o||this.invalidateChildren(c.handlerInfos,h),i(c.queryParams,this.queryParams||{}),c},invalidateChildren:function(e,t){for(var n=t,r=e.length;n0){if(u=r[r.length-1],l(u))return this.createParamHandlerInfo(e,t,n,r,i);r.pop()}else{if(i&&i.name===e)return i;if(!this.preTransitionState)return i;var c=this.preTransitionState.handlerInfos[s];u=c&&c.context}return C("object",{name:e,getHandler:t,serializer:a,context:u,names:n})},createParamHandlerInfo:function(e,t,n,r,i){for(var o={},s=n.length;s--;){var a=i&&e===i.name&&i.params||{},u=r[r.length-1],c=n[s];if(l(u))o[c]=""+r.pop();else{if(!a.hasOwnProperty(c))throw new Error("You didn't provide enough string/numeric parameters to satisfy all of the dynamic segments for route "+e);o[c]=a[c]}}return C("param",{name:e,getHandler:t,params:o})}});A.prototype=V(Error.prototype);var Q=m(O,{url:null,initialize:function(e){this.url=e.url},applyToState:function(e,t,n){function r(e){if(e&&e.inaccessibleByURL)throw new A(c);return e}var o,s,a=new y,u=t.recognize(this.url);if(!u)throw new A(this.url);var l=!1,c=this.url;for(o=0,s=u.length;o=0&&r;--n){var i=t[n];e.add(t,{as:i.handler}),r="/"===i.path||""===i.path||".index"===i.handler.slice(-6)}})},hasRoute:function(e){return this.recognizer.hasRoute(e)},getHandler:function(){},getSerializer:function(){},queryParamsTransition:function(e,t,n,r){var i=this;if(N(this,r,e),!t&&this.activeTransition)return this.activeTransition;var o=new _(this);return o.queryParamsOnly=!0,n.queryParams=H(this,r.handlerInfos,r.queryParams,o),o.promise=o.promise.then(function(e){return I(o,n,!0),i.didTransition&&i.didTransition(i.currentHandlerInfos),e},null,f("Transition complete")),o},transitionByIntent:function(e){try{return T.apply(this,arguments)}catch(t){return new _(this,e,null,t)}},reset:function(){this.state&&c(this.state.handlerInfos.slice().reverse(),function(e){var t=e.handler;g(t,"exit")}),this.oldState=void 0,this.state=new y,this.currentHandlerInfos=null},activeTransition:null,handleURL:function(e){var t=B.call(arguments);return"/"!==e.charAt(0)&&(t[0]="/"+e),M(this,t).method(null)},updateURL:function(){throw new Error("updateURL is not implemented")},replaceURL:function(e){this.updateURL(e)},transitionTo:function(){return M(this,arguments)},intermediateTransitionTo:function(){return M(this,arguments,!0)},refresh:function(e){for(var t=this.activeTransition?this.activeTransition.state:this.state,n=t.handlerInfos,r={},i=0,o=n.length;i1)throw new Error("Second argument not supported");if("object"!=typeof e)throw new TypeError("Argument must be an object");return a.prototype=e,new a},Ce=[],Ae=void 0,ke=1,Te=2,Ne=new S,Re=new S;N.prototype._validateInput=function(e){return Oe(e)},N.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},N.prototype._init=function(){this._result=new Array(this.length)},N.prototype._enumerate=function(){for(var e=this.length,t=this.promise,n=this._input,r=0;t._state===Ae&&r=t[n]?i=n+2:o=n +return e>=t[i]?i+2:i}function a(e,t,n){this.name=e,this.globalOptions=n||{},this.options=t,this._queue=[],this.targetQueues={},this._queueBeingFlushed=void 0}function u(e,n){var r=this.queues={} +this.queueNames=e=e||[],this.options=n,t(e,function(e){r[e]=new a(e,n[e],n)})}function l(e){throw new Error("You attempted to schedule an action in a queue ("+e+") that doesn't exist")}function c(e){throw new Error("You attempted to schedule an action in a queue ("+e+") for a method that doesn't exist")}function p(e,t){this.queueNames=e,this.options=t||{},this.options.defaultQueue||(this.options.defaultQueue=e[0]),this.instanceStack=[],this._debouncees=[],this._throttlers=[],this._eventCallbacks={end:[],begin:[]} +var n=this +this._boundClearItems=function(){v()},this._timerTimeoutId=void 0,this._timers=[],this._platform=this.options._platform||{setTimeout:function(e,t){return setTimeout(e,t)},clearTimeout:function(e){clearTimeout(e)}},this._boundRunExpiredTimers=function(){n._runExpiredTimers()}}function h(e){return e.onError||e.onErrorTarget&&e.onErrorTarget[e.onErrorMethod]}function f(e){var t=e._platform.setTimeout +e.begin(),e._autorun=t(function(){e._autorun=null,e.end()},0)}function m(e,t,n){return g(e,t,n)}function d(e,t,n){return g(e,t,n)}function g(e,t,n){for(var r,i=-1,o=0,s=n.length;o0?t.apply(e,n):t.call(e)},invokeWithOnError:function(e,t,n,r,i){try{n&&n.length>0?t.apply(e,n):t.call(e)}catch(e){r(e,i)}},flush:function(e){var t=this._queue,r=t.length +if(0!==r){var i,o,s,a,u=this.globalOptions,l=this.options,c=l&&l.before,p=l&&l.after,h=u.onError||u.onErrorTarget&&u.onErrorTarget[u.onErrorMethod],f=h?this.invokeWithOnError:this.invoke +this.targetQueues=Object.create(null) +var m=this._queueBeingFlushed=this._queue.slice() +this._queue=[],c&&c() +for(var d=0;d0&&this.flush(!0)}},cancel:function(e){var t,n,r,i,o=this._queue,s=e.target,a=e.method,u=this.globalOptions.GUID_KEY +if(u&&this.targetQueues&&s){var l=this.targetQueues[s[u]] +if(l)for(r=0,i=l.length;r2){r=new Array(i-2) +for(var o=0,s=i-2;o3){i=new Array(o-3) +for(var a=3;a3){i=new Array(o-3) +for(var a=3;a-1?this._throttlers[l]:(c=this._platform.setTimeout(function(){p||r.run.apply(r,o) +var n=d(e,t,r._throttlers) +n>-1&&r._throttlers.splice(n,1)},a),p&&this.run.apply(this,o),u=[e,t,c],this._throttlers.push(u),u)},debounce:function(e,t){for(var r=this,o=new Array(arguments.length),s=0;s-1&&(l=this._debouncees[u],this._debouncees.splice(u,1),this._platform.clearTimeout(l[2])),c=this._platform.setTimeout(function(){p||r.run.apply(r,o) +var n=m(e,t,r._debouncees) +n>-1&&r._debouncees.splice(n,1)},a),p&&u===-1&&r.run.apply(r,o),l=[e,t,c],r._debouncees.push(l),l},cancelTimers:function(){t(this._throttlers,this._boundClearItems),this._throttlers=[],t(this._debouncees,this._boundClearItems),this._debouncees=[],this._clearTimerTimeout(),this._timers=[],this._autorun&&(this._platform.clearTimeout(this._autorun),this._autorun=null)},hasTimers:function(){return!!this._timers.length||!!this._debouncees.length||!!this._throttlers.length||this._autorun},cancel:function(e){var t=typeof e +if(e&&"object"===t&&e.queue&&e.method)return e.queue.cancel(e) +if("function"!==t)return"[object Array]"===Object.prototype.toString.call(e)?this._cancelItem(d,this._throttlers,e)||this._cancelItem(m,this._debouncees,e):void 0 +for(var n=0,r=this._timers.length;n-1&&(r=t[i],r[2]===n[2])&&(t.splice(i,1),this._platform.clearTimeout(n[2]),!0))},_runExpiredTimers:function(){this._timerTimeoutId=void 0,this.run(this,this._scheduleExpiredTimers)},_scheduleExpiredTimers:function(){for(var e=Date.now(),t=this._timers,n=0,r=t.length;n1){for(var t=arguments[0],n=[],r=void 0,i=1;i0?v(this,this.registry.normalize(e)):g(this)},ownerInjection:function(){var e +return e={},e[t.OWNER]=this.owner,e}}}),s("container/index",["exports","container/registry","container/container"],function(e,t,n){"use strict" +e.Registry=t.default,e.privatize=t.privatize,e.Container=n.default,e.buildFakeContainerWithDeprecations=n.buildFakeContainerWithDeprecations}),s("container/registry",["exports","ember-utils","ember-metal","container/container"],function(e,t,n,r){"use strict" +function i(e){this.fallback=e&&e.fallback?e.fallback:null,e&&e.resolver&&(this.resolver=e.resolver,"function"==typeof this.resolver&&o(this)),this.registrations=t.dictionary(e&&e.registrations?e.registrations:null),this._typeInjections=t.dictionary(null),this._injections=t.dictionary(null),this._factoryTypeInjections=t.dictionary(null),this._factoryInjections=t.dictionary(null),this._localLookupCache=new t.EmptyObject,this._normalizeCache=t.dictionary(null),this._resolveCache=t.dictionary(null),this._failCache=t.dictionary(null),this._options=t.dictionary(null),this._typeOptions=t.dictionary(null)}function o(e){e.resolver={resolve:e.resolver}}function s(e,n,r){var i=e._localLookupCache,o=i[n] +o||(o=i[n]=new t.EmptyObject) +var s=o[r] +if(void 0!==s)return s +var a=e.resolver.expandLocalLookup(n,r) +return o[r]=a}function a(e,t,n){if(!n||!n.source||(t=e.expandLocalLookup(t,n))){var r=e._resolveCache[t] +if(void 0!==r)return r +if(!e._failCache[t]){var i=void 0 +return e.resolver&&(i=e.resolver.resolve(t)),void 0===i&&(i=e.registrations[t]),void 0===i?e._failCache[t]=!0:e._resolveCache[t]=i,i}}}function u(e,t,n){return void 0!==e.resolve(t,{source:n})}function l(e){var n=e[0],r=p[n] +if(r)return r +var i=n.split(":"),o=i[0],s=i[1] +return p[n]=t.intern(o+":"+s+"-"+h)}e.default=i,e.privatize=l +var c=/^[^:]+:[^:]+$/ +i.prototype={fallback:null,resolver:null,registrations:null,_typeInjections:null,_injections:null,_factoryTypeInjections:null,_factoryInjections:null,_normalizeCache:null,_resolveCache:null,_options:null,_typeOptions:null,container:function(e){return new r.default(this,e)},register:function(e,t){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2] +if(void 0===t)throw new TypeError("Attempting to register an unknown factory: '"+e+"'") +var r=this.normalize(e) +if(this._resolveCache[r])throw new Error("Cannot re-register: '"+e+"', as it has already been resolved.") +delete this._failCache[r],this.registrations[r]=t,this._options[r]=n},unregister:function(e){var n=this.normalize(e) +this._localLookupCache=new t.EmptyObject,delete this.registrations[n],delete this._resolveCache[n],delete this._failCache[n],delete this._options[n]},resolve:function(e,t){var n=a(this,this.normalize(e),t) +if(void 0===n&&this.fallback){var r +n=(r=this.fallback).resolve.apply(r,arguments)}return n},describe:function(e){return this.resolver&&this.resolver.lookupDescription?this.resolver.lookupDescription(e):this.fallback?this.fallback.describe(e):e},normalizeFullName:function(e){return this.resolver&&this.resolver.normalize?this.resolver.normalize(e):this.fallback?this.fallback.normalizeFullName(e):e},normalize:function(e){return this._normalizeCache[e]||(this._normalizeCache[e]=this.normalizeFullName(e))},makeToString:function(e,t){return this.resolver&&this.resolver.makeToString?this.resolver.makeToString(e,t):this.fallback?this.fallback.makeToString(e,t):e.toString()},has:function(e,t){if(!this.isValidFullName(e))return!1 +var n=t&&t.source&&this.normalize(t.source) +return u(this,this.normalize(e),n)},optionsForType:function(e,t){this._typeOptions[e]=t},getOptionsForType:function(e){var t=this._typeOptions[e] +return void 0===t&&this.fallback&&(t=this.fallback.getOptionsForType(e)),t},options:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=this.normalize(e) +this._options[n]=t},getOptions:function(e){var t=this.normalize(e),n=this._options[t] +return void 0===n&&this.fallback&&(n=this.fallback.getOptions(e)),n},getOption:function(e,t){var n=this._options[e] +if(n&&void 0!==n[t])return n[t] +var r=e.split(":")[0] +return n=this._typeOptions[r],n&&void 0!==n[t]?n[t]:this.fallback?this.fallback.getOption(e,t):void 0},typeInjection:function(e,t,n){var r=n.split(":")[0] +if(r===e)throw new Error("Cannot inject a '"+n+"' on other "+e+"(s).") +var i=this._typeInjections[e]||(this._typeInjections[e]=[]) +i.push({property:t,fullName:n})},injection:function(e,t,n){this.validateFullName(n) +var r=this.normalize(n) +if(e.indexOf(":")===-1)return this.typeInjection(e,t,r) +var i=this.normalize(e),o=this._injections[i]||(this._injections[i]=[]) +o.push({property:t,fullName:r})},factoryTypeInjection:function(e,t,n){var r=this._factoryTypeInjections[e]||(this._factoryTypeInjections[e]=[]) +r.push({property:t,fullName:this.normalize(n)})},factoryInjection:function(e,t,n){var r=this.normalize(e),i=this.normalize(n) +if(this.validateFullName(n),e.indexOf(":")===-1)return this.factoryTypeInjection(r,t,i) +var o=this._factoryInjections[r]||(this._factoryInjections[r]=[]) +o.push({property:t,fullName:i})},knownForType:function(e){for(var n=void 0,r=void 0,i=t.dictionary(null),o=Object.keys(this.registrations),s=0;s0){var i="cycle detected: "+t +throw this.each(this.path,function(e){i+=" <- "+e}),new Error(i)}}},e.prototype.reset=function(){this.stack.length=0,this.path.length=0,this.result.length=0 +for(var e=0,t=this.length;e=0){var a=this[s] +if(a.flag)continue +if(a.flag=!0,i.push(s),t===a.key)break +r.push(~s),this.pushIncoming(a)}else i.pop(),o.push(~s)}},e.prototype.pushIncoming=function(e){for(var t=this.stack,n=e.length-1;n>=0;n--){var r=e[n] +this[r].flag||t.push(r)}},e.prototype.each=function(e,t){for(var n=0,r=e.length;n-1&&(i=i.replace(/\.(.)/g,function(e){return e.charAt(1).toUpperCase()})),r.indexOf("_")>-1&&(i=i.replace(/_(.)/g,function(e){return e.charAt(1).toUpperCase()})),r.indexOf("-")>-1&&(i=i.replace(/-(.)/g,function(e){return e.charAt(1).toUpperCase()})),n+":"+i}return e},resolve:function(e){var t,n=this.parseName(e),r=n.resolveMethodName +return this[r]&&(t=this[r](n)),t=t||this.resolveOther(n),n.root&&n.root.LOG_RESOLVER&&this._logLookup(t,n),t&&i.default(t,n),t},parseName:function(e){return this._parseNameCache[e]||(this._parseNameCache[e]=this._parseName(e))},_parseName:function(e){var t=e.split(":"),i=t[0],o=t[1],s=o,a=n.get(this,"namespace"),u=a,l=s.lastIndexOf("/"),c=l!==-1?s.slice(0,l):null +if("template"!==i&&l!==-1){var p=s.split("/") +s=p[p.length-1] +var h=r.String.capitalize(p.slice(0,-1).join(".")) +u=r.Namespace.byName(h)}var f="main"===o?"Main":r.String.classify(i) +if(!s||!i)throw new TypeError("Invalid fullName: `"+e+"`, must be of the form `type:name` ") +return{fullName:e,type:i,fullNameWithoutType:o,dirname:c,name:s,root:u,resolveMethodName:"resolve"+f}},lookupDescription:function(e){var t=this.parseName(e),n=void 0 +return"template"===t.type?"template at "+t.fullNameWithoutType.replace(/\./g,"/"):(n=t.root+"."+r.String.classify(t.name).replace(/\./g,""),"model"!==t.type&&(n+=r.String.classify(t.type)),n)},makeToString:function(e,t){return e.toString()},useRouterNaming:function(e){e.name=e.name.replace(/\./g,"_"),"basic"===e.name&&(e.name="")},resolveTemplate:function(e){var t=e.fullNameWithoutType.replace(/\./g,"/") +return o.getTemplate(t)||o.getTemplate(r.String.decamelize(t))},resolveView:function(e){return this.useRouterNaming(e),this.resolveOther(e)},resolveController:function(e){return this.useRouterNaming(e),this.resolveOther(e)},resolveRoute:function(e){return this.useRouterNaming(e),this.resolveOther(e)},resolveModel:function(e){var t=r.String.classify(e.name),i=n.get(e.root,t) +return i},resolveHelper:function(e){return this.resolveOther(e)},resolveOther:function(e){var t=r.String.classify(e.name)+r.String.classify(e.type),i=n.get(e.root,t) +return i},resolveMain:function(e){var t=r.String.classify(e.type) +return n.get(e.root,t)},_logLookup:function(e,t){var n=void 0,r=void 0 +n=e?"[✓]":"[ ]",r=t.fullName.length>60?".":new Array(60-t.fullName.length).join(".")},knownForType:function(e){for(var i=n.get(this,"namespace"),o=r.String.classify(e),s=new RegExp(o+"$"),a=t.dictionary(null),u=Object.keys(i),l=0;l1?this.set("models",this._getModels(t)):this.set("models",[])}}) +a.toString=function(){return"LinkComponent"},a.reopenClass({positionalParams:"params"}),e.default=a}),s("ember-glimmer/components/text_area",["exports","ember-glimmer/component","ember-views","ember-glimmer/templates/empty"],function(e,t,n,r){"use strict" +e.default=t.default.extend(n.TextSupport,{classNames:["ember-text-area"],layout:r.default,tagName:"textarea",attributeBindings:["rows","cols","name","selectionEnd","selectionStart","wrap","lang","dir","value"],rows:null,cols:null})}),s("ember-glimmer/components/text_field",["exports","ember-utils","ember-metal","ember-environment","ember-glimmer/component","ember-glimmer/templates/empty","ember-views"],function(e,t,n,r,i,o,s){"use strict" +function a(e){if(e in l)return l[e] +if(!r.environment.hasDOM)return l[e]=e,e +u||(u=document.createElement("input")) +try{u.type=e}catch(e){}return l[e]=u.type===e}var u=void 0,l=new t.EmptyObject +e.default=i.default.extend(s.TextSupport,{layout:o.default,classNames:["ember-text-field"],tagName:"input",attributeBindings:["accept","autocomplete","autosave","dir","formaction","formenctype","formmethod","formnovalidate","formtarget","height","inputmode","lang","list","max","min","multiple","name","pattern","size","step","type","value","width"],value:"",type:n.computed({get:function(){return"text"},set:function(e,t){var n="text" +return a(t)&&(n=t),n}}),size:null,pattern:null,min:null,max:null})}),s("ember-glimmer/dom",["exports","glimmer-runtime","glimmer-node"],function(e,t,n){"use strict" +e.DOMChanges=t.DOMChanges,e.DOMTreeConstruction=t.DOMTreeConstruction,e.NodeDOMTreeConstruction=n.NodeDOMTreeConstruction}),s("ember-glimmer/environment",["exports","ember-utils","ember-metal","ember-views","glimmer-runtime","ember-glimmer/syntax/curly-component","ember-glimmer/syntax","ember-glimmer/syntax/dynamic-component","ember-glimmer/utils/iterable","ember-glimmer/utils/references","ember-glimmer/helpers/if-unless","ember-glimmer/utils/bindings","ember-glimmer/helpers/action","ember-glimmer/helpers/component","ember-glimmer/helpers/concat","ember-glimmer/helpers/debugger","ember-glimmer/helpers/get","ember-glimmer/helpers/hash","ember-glimmer/helpers/loc","ember-glimmer/helpers/log","ember-glimmer/helpers/mut","ember-glimmer/helpers/readonly","ember-glimmer/helpers/unbound","ember-glimmer/helpers/-class","ember-glimmer/helpers/-input-type","ember-glimmer/helpers/query-param","ember-glimmer/helpers/each-in","ember-glimmer/helpers/-normalize-class","ember-glimmer/helpers/-html-safe","ember-glimmer/protocol-for-url","ember-glimmer/modifiers/action"],function(e,t,n,r,i,o,s,a,u,l,p,h,f,m,d,g,v,y,b,_,w,E,O,S,x,C,A,k,T,N,R){"use strict" +var P={textarea:"-text-area"},D=function(e){function D(s){var a=this,u=s[t.OWNER] +e.apply(this,arguments),this.owner=u,this.isInteractive=u.lookup("-environment:main").isInteractive,this.destroyedComponents=void 0,N.default(this),this._definitionCache=new n.Cache(2e3,function(e){var t=e.name,n=e.source,i=e.owner,s=r.lookupComponent(i,t,{source:n}),a=s.component,u=s.layout +if(a||u)return new o.CurlyComponentDefinition(t,a,u)},function(e){var n=e.name,r=e.source,i=e.owner,o=r&&i._resolveLocalLookupName(n,r)||n,s=t.guidFor(i) +return s+"|"+o}),this._templateCache=new n.Cache(1e3,function(e){var n=e.Template,r=e.owner +if(n.create){var i +return n.create((i={env:a},i[t.OWNER]=r,i))}return n},function(e){var n=e.Template,r=e.owner +return t.guidFor(r)+"|"+n.id}),this._compilerCache=new n.Cache(10,function(e){return new n.Cache(2e3,function(t){var n=new e(t) +return i.compileLayout(n,a)},function(e){var n=e.meta.owner +return t.guidFor(n)+"|"+e.id})},function(e){return e.id}),this.builtInModifiers={action:new R.default},this.builtInHelpers={if:p.inlineIf,action:f.default,component:m.default,concat:d.default,debugger:g.default,get:v.default,hash:y.default,loc:b.default,log:_.default,mut:w.default,"query-params":C.default,readonly:E.default,unbound:O.default,unless:p.inlineUnless,"-class":S.default,"-each-in":A.default,"-input-type":x.default,"-normalize-class":k.default,"-html-safe":T.default,"-get-dynamic-var":i.getDynamicVar}}return c.inherits(D,e),D.create=function(e){return new D(e)},D.prototype.refineStatement=function(t,n){var r=e.prototype.refineStatement.call(this,t,n) +if(r)return r +var i=t.appendType,u=t.isSimple,l=t.isInline,c=t.isBlock,p=(t.isModifier,t.key),f=t.path,m=t.args +if(u&&(l||c)&&"get"!==i){var d=s.findSyntaxBuilder(p) +if(d)return d.create(this,m,n) +var g=P[p],v=null +if(g?v=this.getComponentDefinition([g],n):p.indexOf("-")>=0&&(v=this.getComponentDefinition(f,n)),v)return h.wrapComponentClassAttribute(m),new o.CurlyComponentSyntax(m,v,n)}return l&&!u&&"helper"!==i?t.original.deopt():!u&&f?a.DynamicComponentSyntax.fromPath(this,f,m,n):void 0},D.prototype.hasComponentDefinition=function(){return!1},D.prototype.getComponentDefinition=function(e,t){var n=e[0],r=t.getMeta(),i=r.owner,o=r.moduleName&&"template:"+r.moduleName +return this._definitionCache.get({name:n,source:o,owner:i})},D.prototype.getTemplate=function(e,t){return this._templateCache.get({Template:e,owner:t})},D.prototype.getCompiledBlock=function(e,t){var n=this._compilerCache.get(e) +return n.get(t)},D.prototype.hasPartial=function(e,t){var n=t.getMeta(),i=n.owner +return r.hasPartial(e,i)},D.prototype.lookupPartial=function(e,t){var n=t.getMeta(),i=n.owner,o={template:r.lookupPartial(e,i)} +if(o.template)return o +throw new Error(e+" is not a partial")},D.prototype.hasHelper=function(e,t){if(e.length>1)return!1 +var n=e[0] +if(this.builtInHelpers[n])return!0 +var r=t.getMeta(),i=r.owner,o={source:"template:"+r.moduleName} +return i.hasRegistration("helper:"+n,o)||i.hasRegistration("helper:"+n)},D.prototype.lookupHelper=function(e,t){var n=e[0],r=this.builtInHelpers[n] +if(r)return r +var i=t.getMeta(),o=i.owner,s=i.moduleName&&{source:"template:"+i.moduleName}||{} +if(r=o.lookup("helper:"+n,s)||o.lookup("helper:"+n),r.isHelperInstance)return function(e,t){return l.SimpleHelperReference.create(r.compute,t)} +if(r.isHelperFactory)return function(e,t){return l.ClassBasedHelperReference.create(r,e,t)} +throw new Error(e+" is not a helper")},D.prototype.hasModifier=function(e){return!(e.length>1)&&!!this.builtInModifiers[e[0]]},D.prototype.lookupModifier=function(e){var t=this.builtInModifiers[e[0]] +if(t)return t +throw new Error(e+" is not a modifier")},D.prototype.toConditionalReference=function(e){return l.ConditionalReference.create(e)},D.prototype.iterableFor=function(e,t){var n=t.named.get("key").value() +return u.default(e,n)},D.prototype.scheduleInstallModifier=function(){if(this.isInteractive){var t;(t=e.prototype.scheduleInstallModifier).call.apply(t,[this].concat(c.slice.call(arguments)))}},D.prototype.scheduleUpdateModifier=function(){if(this.isInteractive){var t;(t=e.prototype.scheduleUpdateModifier).call.apply(t,[this].concat(c.slice.call(arguments)))}},D.prototype.didDestroy=function(e){e.destroy()},D.prototype.begin=function(){this.inTransaction=!0,e.prototype.begin.call(this),this.destroyedComponents=[]},D.prototype.commit=function(){for(var t=0;t1?n.String.dasherize(t.at(1).value()):null:o===!1?i>2?n.String.dasherize(t.at(2).value()):null:o}e.default=function(e,n){return new t.InternalHelperReference(r,n)}}) +s("ember-glimmer/helpers/-html-safe",["exports","ember-glimmer/utils/references","ember-glimmer/utils/string"],function(e,t,n){"use strict" +function r(e){var t=e.positional,r=t.at(0) +return new n.SafeString(r.value())}e.default=function(e,n){return new t.InternalHelperReference(r,n)}}),s("ember-glimmer/helpers/-input-type",["exports","ember-glimmer/utils/references"],function(e,t){"use strict" +function n(e){var t=e.positional,n=(e.named,t.at(0).value()) +return"checkbox"===n?"-checkbox":"-text-field"}e.default=function(e,r){return new t.InternalHelperReference(n,r)}}),s("ember-glimmer/helpers/-normalize-class",["exports","ember-glimmer/utils/references","ember-runtime"],function(e,t,n){"use strict" +function r(e){var t=e.positional,r=(e.named,t.at(0).value().split(".")),i=r[r.length-1],o=t.at(1).value() +return o===!0?n.String.dasherize(i):o||0===o?String(o):""}e.default=function(e,n){return new t.InternalHelperReference(r,n)}}),s("ember-glimmer/helpers/action",["exports","ember-utils","ember-metal","ember-glimmer/utils/references","glimmer-runtime","glimmer-reference"],function(e,t,n,r,i,o){"use strict" +function s(e){return e}function a(e,t){var r=null +t.length>0&&(r=function(e){return t.value().concat(e)}) +var i=null +return e&&(i=function(t){var r=e.value() +return r&&t.length>0&&(t[0]=n.get(t[0],r)),t}),r&&i?function(e){return i(r(e))}:r||i||s}function u(e,t,n,r,i){return function(){return l(e,t.value(),n.value(),r,i).apply(void 0,arguments)}}function l(e,t,r,i,o){var s=void 0,a=void 0 +if("function"==typeof r[c])s=r,a=r[c] +else{var u=typeof r +"string"===u?(s=t,a=t.actions&&t.actions[r]):"function"===u&&(s=e,a=r)}return function(){for(var e=arguments.length,t=Array(e),r=0;r0){for(var h=Math.min(a.length,l.length),f=0;f=0)return!0 +for(var n=0;n1)if(u=a.at(0),p=a.at(1),p[i.INVOKE])c=p +else{p._propertyKey +c=p.value()}for(var h=[],f=2;f10)throw b=0,y[n].destroy(),new Error("infinite rendering invalidation detected") +return b++,d.join(null,h)}b=0}var m=void 0 +m=n.runInTransaction +var d=n.run.backburner,g=function(){function e(e,t,n,r){this.view=e,this.outletState=t,this.rootOutletState=n}return e.prototype.child=function(){return new e(this.view,this.outletState,this.rootOutletState)},e.prototype.get=function(e){return this.outletState},e.prototype.set=function(e,t){return this.outletState=t,t},e}(),v=function(){function e(e,t,n,r,o,s){var a=this +this.id=i.getViewId(e),this.env=t,this.root=e,this.result=void 0,this.shouldReflush=!1,this.destroyed=!1,this._removing=!1 +var u=this.options={alwaysRevalidate:!1} +this.render=function(){var e=a.result=n.render(r,o,s) +a.render=function(){e.rerender(u)}}}return e.prototype.isFor=function(e){return this.root===e},e.prototype.destroy=function(){var e=this.result,t=this.env +if(this.destroyed=!0,this.env=null,this.root=null,this.result=null,this.render=null,e){var n=!t.inTransaction +n&&t.begin(),e.destroy(),n&&t.commit()}},e}(),y=[] +n.setHasViews(function(){return y.length>0}) +var b=0 +d.on("begin",p),d.on("end",f) +var _=function(){function e(e,t){var n=arguments.length<=2||void 0===arguments[2]?i.fallbackViewRegistry:arguments[2],r=!(arguments.length<=3||void 0===arguments[3])&&arguments[3] +this._env=e,this._rootTemplate=t,this._viewRegistry=n,this._destinedForDOM=r,this._destroyed=!1,this._roots=[],this._lastRevision=null,this._isRenderingRoots=!1,this._removedRoots=[]}return e.prototype.appendOutletView=function(e,t){var n=new a.TopLevelOutletComponentDefinition(e),r=e.toReference(),i=e.outletState.render.controller +this._appendDefinition(e,n,t,r,i)},e.prototype.appendTo=function(e,t){var n=new s.RootComponentDefinition(e) +this._appendDefinition(e,n,t)},e.prototype._appendDefinition=function(e,n,i){var o=arguments.length<=3||void 0===arguments[3]?r.UNDEFINED_REFERENCE:arguments[3],s=arguments.length<=4||void 0===arguments[4]?null:arguments[4],a=new t.RootReference(n),u=new g(null,o,o,!0,s),l=new v(e,this._env,this._rootTemplate,a,i,u) +this._renderRoot(l)},e.prototype.rerender=function(e){this._scheduleRevalidate()},e.prototype.register=function(e){var t=i.getViewId(e) +this._viewRegistry[t]=e},e.prototype.unregister=function(e){delete this._viewRegistry[i.getViewId(e)]},e.prototype.remove=function(e){e._transitionTo("destroying"),this.cleanupRootFor(e),i.setViewElement(e,null),this._destinedForDOM&&e.trigger("didDestroyElement"),e.isDestroying||e.destroy()},e.prototype.cleanupRootFor=function(e){if(!this._destroyed)for(var t=this._roots,n=this._roots.length;n--;){var r=t[n] +r.isFor(e)&&r.destroy()}},e.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this._clearAllRoots())},e.prototype.getElement=function(e){},e.prototype.getBounds=function(e){var t=e[o.BOUNDS],n=t.parentElement(),r=t.firstNode(),i=t.lastNode() +return{parentElement:n,firstNode:r,lastNode:i}},e.prototype.createElement=function(e){return this._env.getAppendOperations().createElement(e)},e.prototype._renderRoot=function(e){var t=this._roots +t.push(e),1===t.length&&u(this),this._renderRootsTransaction()},e.prototype._renderRoots=function(){var e=this._roots,t=this._env,n=this._removedRoots,i=void 0,o=void 0 +do{t.begin(),o=e.length,i=!1 +for(var s=0;s=o&&!u||(a.options.alwaysRevalidate=u,u=a.shouldReflush=m(a,"render"),i=i||u)}}this._lastRevision=r.CURRENT_TAG.value(),t.commit()}while(i||e.length>o) +for(;n.length;){var a=n.pop(),c=e.indexOf(a) +e.splice(c,1)}0===this._roots.length&&l(this)},e.prototype._renderRootsTransaction=function(){if(!this._isRenderingRoots){this._isRenderingRoots=!0 +var e=!1 +try{this._renderRoots(),e=!0}finally{e||(this._lastRevision=r.CURRENT_TAG.value()),this._isRenderingRoots=!1}}},e.prototype._clearAllRoots=function(){for(var e=this._roots,t=0;t-1)return c[t]}e.registerSyntax=a,e.findSyntaxBuilder=u +var l=[],c=[] +a("render",t.RenderSyntax),a("outlet",n.OutletSyntax),a("mount",r.MountSyntax),a("component",i.DynamicComponentSyntax),a("input",o.InputSyntax),a("-with-dynamic-vars",function(){function e(){}return e.create=function(e,t,n){return new s.WithDynamicVarsSyntax(t)},e}()),a("-in-element",function(){function e(){}return e.create=function(e,t,n){return new s.InElementSyntax(t)},e}())}),s("ember-glimmer/syntax/curly-component",["exports","ember-utils","glimmer-runtime","ember-glimmer/utils/bindings","ember-glimmer/component","ember-metal","ember-views","ember-glimmer/utils/process-args","container"],function(e,t,n,r,i,o,s,a,u){"use strict" +function l(e,t){}function p(e,t,n){}function h(e,t){e.named.has("id")&&(t.elementId=t.id)}function f(e,t,n,i){for(var o=[],s=t.length-1;s!==-1;){var a=t[s],u=r.AttributeBinding.parse(a),l=u[1] +o.indexOf(l)===-1&&(o.push(l),r.AttributeBinding.install(e,n,u,i)),s--}o.indexOf("id")===-1&&i.addStaticAttribute(e,"id",n.elementId),o.indexOf("style")===-1&&r.IsVisibleBinding.install(e,n,i)}function m(){}function d(e){return e.instrumentDetails({initialRender:!0})}function g(e){return e.instrumentDetails({initialRender:!1})}function v(e){var t=e.dynamicScope().view.tagName +return n.PrimitiveReference.create(""===t?null:t||"div")}function y(e){return e.getSelf().get("ariaRole")}e.validatePositionalParameters=p +var b=c.taggedTemplateLiteralLoose(["template:components/-default"],["template:components/-default"]),_=u.privatize(b),w=function(e){function t(t,n,r){e.call(this),this.args=t,this.definition=n,this.symbolTable=r,this.shadow=null}return c.inherits(t,e),t.prototype.compile=function(e){e.component.static(this.definition,this.args,this.symbolTable,this.shadow)},t}(n.StatementSyntax) +e.CurlyComponentSyntax=w +var E=function(){function e(e,t,n,r){this.environment=e,this.component=t,this.classRef=null,this.args=n,this.argsRevision=n.tag.value(),this.finalizer=r}return e.prototype.destroy=function(){var e=this.component,t=this.environment +t.isInteractive&&(e.trigger("willDestroyElement"),e.trigger("willClearRender")),t.destroyedComponents.push(e)},e.prototype.finalize=function(){var e=this.finalizer +e(),this.finalizer=m},e}(),O=function(){function e(){}return e.prototype.prepareArgs=function(e,t){return p(t.named,t.positional.values,e.ComponentClass.positionalParams),a.gatherArgs(t,e)},e.prototype.create=function(e,t,n,r,s,u){var c=r.view,p=t.ComponentClass,f=a.ComponentArgs.create(n),m=f.value(),g=m.props +h(n,g),g.parentView=c,g[i.HAS_BLOCK]=u,g._targetObject=s.value() +var v=p.create(g),y=o._instrumentStart("render.component",d,v) +r.view=v,null!==c&&c.appendChild(v),""===v.tagName&&(e.isInteractive&&v.trigger("willRender"),v._transitionTo("hasElement"),e.isInteractive&&v.trigger("willInsertElement")) +var b=new E(e,v,f,y) +return n.named.has("class")&&(b.classRef=n.named.get("class")),l(v,g),e.isInteractive&&""!==v.tagName&&v.trigger("willRender"),b},e.prototype.layoutFor=function(e,t,n){var r=e.template +if(!r){var i=t.component +r=this.templateFor(i,n)}return n.getCompiledBlock(T,r)},e.prototype.templateFor=function(e,n){var r=o.get(e,"layout"),i=e[t.OWNER] +if(r)return n.getTemplate(r,i) +var s=o.get(e,"layoutName") +if(s){var a=i.lookup("template:"+s) +if(a)return a}return i.lookup(_)},e.prototype.getSelf=function(e){var t=e.component +return t[i.ROOT_REF]},e.prototype.didCreateElement=function(e,t,n){var i=e.component,o=e.classRef,a=e.environment +s.setViewElement(i,t) +var u=i.attributeBindings,l=i.classNames,c=i.classNameBindings +u&&u.length?f(t,u,i,n):(n.addStaticAttribute(t,"id",i.elementId),r.IsVisibleBinding.install(t,i,n)),o&&n.addDynamicAttribute(t,"class",o),l&&l.length&&l.forEach(function(e){n.addStaticAttribute(t,"class",e)}),c&&c.length&&c.forEach(function(e){r.ClassNameBinding.install(t,i,e,n)}),i._transitionTo("hasElement"),a.isInteractive&&i.trigger("willInsertElement")},e.prototype.didRenderLayout=function(e,t){e.component[i.BOUNDS]=t,e.finalize()},e.prototype.getTag=function(e){var t=e.component +return t[i.DIRTY_TAG]},e.prototype.didCreate=function(e){var t=e.component,n=e.environment +n.isInteractive&&(t._transitionTo("inDOM"),t.trigger("didInsertElement"),t.trigger("didRender"))},e.prototype.update=function(e,t,n){var r=e.component,s=e.args,a=e.argsRevision,u=e.environment +if(e.finalizer=o._instrumentStart("render.component",g,r),!s.tag.validate(a)){var l=s.value(),c=l.attrs,p=l.props +e.argsRevision=s.tag.value() +var h=r.attrs,f=c +r[i.IS_DISPATCHING_ATTRS]=!0,r.setProperties(p),r[i.IS_DISPATCHING_ATTRS]=!1,r.trigger("didUpdateAttrs",{oldAttrs:h,newAttrs:f}),r.trigger("didReceiveAttrs",{oldAttrs:h,newAttrs:f})}u.isInteractive&&(r.trigger("willUpdate"),r.trigger("willRender"))},e.prototype.didUpdateLayout=function(e){e.finalize()},e.prototype.didUpdate=function(e){var t=e.component,n=e.environment +n.isInteractive&&(t.trigger("didUpdate"),t.trigger("didRender"))},e.prototype.getDestructor=function(e){return e},e}(),S=new O,x=function(e){function t(){e.apply(this,arguments)}return c.inherits(t,e),t.prototype.create=function(e,t,n,r,i,s){var a=t.ComponentClass,u=o._instrumentStart("render.component",d,a) +return r.view=a,""===a.tagName&&(e.isInteractive&&a.trigger("willRender"),a._transitionTo("hasElement"),e.isInteractive&&a.trigger("willInsertElement")),l(a,{}),new E(e,a,n,u)},t}(O),C=new x,A=function(e){function t(t,n,r,i){e.call(this,t,S,n),this.template=r,this.args=i}return c.inherits(t,e),t}(n.ComponentDefinition) +e.CurlyComponentDefinition=A +var k=function(e){function t(t){e.call(this,"-root",C,t),this.template=void 0,this.args=void 0}return c.inherits(t,e),t}(n.ComponentDefinition) +e.RootComponentDefinition=k +var T=function(){function e(e){this.template=e}return e.prototype.compile=function(e){e.wrapLayout(this.template.asLayout()),e.tag.dynamic(v),e.attrs.dynamic("role",y),e.attrs.static("class","ember-view")},e}() +T.id="curly"}),s("ember-glimmer/syntax/dynamic-component",["exports","glimmer-runtime","glimmer-reference","ember-metal"],function(e,t,n,r){"use strict" +function i(e,t){var n=e.env,r=e.getArgs(),i=r.positional.at(0) +return new s({nameRef:i,env:n,symbolTable:t})}var o=function(e){function n(t,n,r){e.call(this),this.definition=i,this.definitionArgs=t,this.args=n,this.symbolTable=r,this.shadow=null}return c.inherits(n,e),n.create=function(e,n,r){var i=t.ArgsSyntax.fromPositionalArgs(n.positional.slice(0,1)),o=t.ArgsSyntax.build(n.positional.slice(1),n.named,n.blocks) +return new this(i,o,r)},n.fromPath=function(e,n,r,i){var o=t.ArgsSyntax.fromPositionalArgs(t.PositionalArgsSyntax.build([t.GetSyntax.build(n.join("."))])) +return new this(o,r,i)},n.prototype.compile=function(e){e.component.dynamic(this.definitionArgs,this.definition,this.args,this.symbolTable,this.shadow)},n}(t.StatementSyntax) +e.DynamicComponentSyntax=o +var s=function(){function e(e){var t=e.nameRef,n=e.env,r=e.symbolTable,i=e.args +this.tag=t.tag,this.nameRef=t,this.env=n,this.symbolTable=r,this.args=i}return e.prototype.value=function(){var e=this.env,n=this.nameRef,r=this.symbolTable,i=n.value() +if("string"==typeof i){var o=e.getComponentDefinition([i],r) +return o}return t.isComponentDefinition(i)?i:null},e.prototype.get=function(){return n.UNDEFINED_REFERENCE},e}()}),s("ember-glimmer/syntax/input",["exports","ember-metal","ember-glimmer/syntax/curly-component","ember-glimmer/syntax/dynamic-component","ember-glimmer/utils/bindings"],function(e,t,n,r,i){"use strict" +function o(e,t,r){var o=t("-text-field") +return i.wrapComponentClassAttribute(e),new n.CurlyComponentSyntax(e,o,r)}var s={create:function(e,t,s){var a=function(t){return e.getComponentDefinition([t],s)} +if(!t.named.has("type"))return o(t,a,s) +var u=t.named.at("type") +if("value"===u.type){if("checkbox"===u.value){i.wrapComponentClassAttribute(t) +var l=a("-checkbox") +return new n.CurlyComponentSyntax(t,l,s)}return o(t,a,s)}return r.DynamicComponentSyntax.create(e,t,s)}} +e.InputSyntax=s}),s("ember-glimmer/syntax/mount",["exports","glimmer-runtime","glimmer-reference","ember-metal","ember-glimmer/utils/references","ember-routing","ember-glimmer/syntax/outlet"],function(e,t,n,r,i,o,s){"use strict" +var a=function(e){function n(t,n){e.call(this),this.definition=t,this.symbolTable=n}return c.inherits(n,e),n.create=function(e,t,r){var i=t.positional.at(0).inner(),o=new p(i,e) +return new n(o,r)},n.prototype.compile=function(e){e.component.static(this.definition,t.ArgsSyntax.empty(),null,this.symbolTable,null)},n}(t.StatementSyntax) +e.MountSyntax=a +var u=function(){function e(){}return e.prototype.prepareArgs=function(e,t){return t},e.prototype.create=function(e,t,r,i){var o=t.name,s=t.env +i.outletState=n.UNDEFINED_REFERENCE +var a=s.owner.buildChildEngineInstance(o) +return a.boot(),{engine:a}},e.prototype.layoutFor=function(e,t,n){var r=t.engine,i=r.lookup("template:application") +return n.getCompiledBlock(s.OutletLayoutCompiler,i)},e.prototype.getSelf=function(e){var t=e.engine,n=t._lookupFactory("controller:application")||o.generateControllerFactory(t,"application") +return new i.RootReference(n.create())},e.prototype.getTag=function(){return null},e.prototype.getDestructor=function(e){var t=e.engine +return t},e.prototype.didCreateElement=function(){},e.prototype.didRenderLayout=function(){},e.prototype.didCreate=function(e){},e.prototype.update=function(e,t,n){},e.prototype.didUpdateLayout=function(){},e.prototype.didUpdate=function(e){},e}(),l=new u,p=function(e){function t(t,n){e.call(this,t,l,null),this.env=n}return c.inherits(t,e),t}(t.ComponentDefinition)}),s("ember-glimmer/syntax/outlet",["exports","ember-utils","glimmer-runtime","ember-metal","ember-glimmer/utils/references","glimmer-reference"],function(e,t,n,r,i,o){"use strict" +function s(e){var t=e.dynamicScope(),n=t.outletState,r=e.getArgs(),i=void 0 +return i=0===r.positional.length?new o.ConstReference("main"):r.positional.at(0),new h(i,n)}function a(e,t,n){return t||n?!t&&n||t&&!n?null:n.render.template===t.render.template&&n.render.controller===t.render.controller?e:null:e}function u(e){var t=e.render,n=t.name,r=t.outlet +return{object:n+":"+r}}function l(){}var p=function(e){function t(t,r,i){e.call(this),this.definitionArgs=r,this.definition=s,this.args=n.ArgsSyntax.empty(),this.symbolTable=i,this.shadow=null}return c.inherits(t,e),t.create=function(e,t,r){var i=n.ArgsSyntax.fromPositionalArgs(t.positional.slice(0,1)) +return new this(e,i,r)},t.prototype.compile=function(e){e.component.dynamic(this.definitionArgs,this.definition,this.args,this.symbolTable,this.shadow)},t}(n.StatementSyntax) +e.OutletSyntax=p +var h=function(){function e(e,t){this.outletNameRef=e,this.parentOutletStateRef=t,this.definition=null,this.lastState=null +var n=this.outletStateTag=new o.UpdatableTag(t.tag) +this.tag=o.combine([n.tag,e.tag])}return e.prototype.value=function(){var e=this.outletNameRef,t=this.parentOutletStateRef,n=this.definition,r=this.lastState,i=e.value(),o=t.get("outlets").get(i),s=this.lastState=o.value() +this.outletStateTag.update(o.tag),n=a(n,r,s) +var u=s&&s.render.template +return n?n:u?this.definition=new _(i,s.render.template):this.definition=null},e}(),f=function(){function e(e){this.outletState=e,this.instrument()}return e.prototype.instrument=function(){this.finalizer=r._instrumentStart("render.outlet",u,this.outletState)},e.prototype.finalize=function(){var e=this.finalizer +e(),this.finalizer=l},e}(),m=function(){function e(){}return e.prototype.prepareArgs=function(e,t){return t},e.prototype.create=function(e,t,n,r){var i=r.outletState=r.outletState.get("outlets").get(t.outletName),o=i.value() +return new f(o)},e.prototype.layoutFor=function(e,t,n){return n.getCompiledBlock(w,e.template)},e.prototype.getSelf=function(e){var t=e.outletState +return new i.RootReference(t.render.controller)},e.prototype.getTag=function(){return null},e.prototype.getDestructor=function(){return null},e.prototype.didRenderLayout=function(e){e.finalize()},e.prototype.didCreateElement=function(){},e.prototype.didCreate=function(e){},e.prototype.update=function(e){},e.prototype.didUpdateLayout=function(e){},e.prototype.didUpdate=function(e){},e}(),d=new m,g=function(e){function t(){e.apply(this,arguments)}return c.inherits(t,e),t.prototype.create=function(e,t,n,r){return new f(r.outletState.value())},t.prototype.layoutFor=function(e,t,n){return n.getCompiledBlock(b,e.template)},t}(m),v=new g,y=function(e){function n(n){e.call(this,"outlet",v,n),this.template=n.template,t.generateGuid(this)}return c.inherits(n,e),n}(n.ComponentDefinition) +e.TopLevelOutletComponentDefinition=y +var b=function(){function e(e){this.template=e}return e.prototype.compile=function(e){e.wrapLayout(this.template.asLayout()),e.tag.static("div"),e.attrs.static("id",t.guidFor(this)),e.attrs.static("class","ember-view")},e}() +b.id="top-level-outlet" +var _=function(e){function n(n,r){e.call(this,"outlet",d,null),this.outletName=n,this.template=r,t.generateGuid(this)}return c.inherits(n,e),n}(n.ComponentDefinition),w=function(){function e(e){this.template=e}return e.prototype.compile=function(e){e.wrapLayout(this.template.asLayout())},e}() +e.OutletLayoutCompiler=w,w.id="outlet"}),s("ember-glimmer/syntax/render",["exports","glimmer-runtime","glimmer-reference","ember-metal","ember-glimmer/utils/references","ember-routing","ember-glimmer/syntax/outlet"],function(e,t,n,r,i,o,s){"use strict" +function a(e){var t=e.env,r=e.getArgs(),i=r.positional.at(0),o=i.value(),s=t.owner.lookup("template:"+o),a=void 0 +if(r.named.has("controller")){var u=r.named.get("controller") +a=u.value()}else a=o +return 1===r.positional.length?new n.ConstReference(new d(a,s,t,h)):new n.ConstReference(new d(a,s,t,m))}var u=function(e){function n(n,r,i){e.call(this),this.definitionArgs=r,this.definition=a,this.args=t.ArgsSyntax.fromPositionalArgs(r.positional.slice(1,2)),this.symbolTable=i,this.shadow=null}return c.inherits(n,e),n.create=function(e,t,n){return new this(e,t,n)},n.prototype.compile=function(e){e.component.dynamic(this.definitionArgs,this.definition,this.args,this.symbolTable,this.shadow)},n}(t.StatementSyntax) +e.RenderSyntax=u +var l=function(){function e(){}return e.prototype.prepareArgs=function(e,t){return t},e.prototype.layoutFor=function(e,t,n){return n.getCompiledBlock(s.OutletLayoutCompiler,e.template)},e.prototype.getSelf=function(e){var t=e.controller +return new i.RootReference(t)},e.prototype.getTag=function(){return null},e.prototype.getDestructor=function(){return null},e.prototype.didCreateElement=function(){},e.prototype.didRenderLayout=function(){},e.prototype.didCreate=function(){},e.prototype.update=function(){},e.prototype.didUpdateLayout=function(){},e.prototype.didUpdate=function(){},e}(),p=function(e){function t(){e.apply(this,arguments)}return c.inherits(t,e),t.prototype.create=function(e,t,n,r){var i=t.name,s=t.env,a=s.owner.lookup("controller:"+i)||o.generateController(s.owner,i) +return r.rootOutletState&&(r.outletState=r.rootOutletState.getOrphan(i)),{controller:a}},t}(l),h=new p,f=function(e){function t(){e.apply(this,arguments)}return c.inherits(t,e),t.prototype.create=function(e,t,n,r){var i=t.name,s=t.env,a=n.positional.at(0),u=s.owner._lookupFactory("controller:"+i)||o.generateControllerFactory(s.owner,i),l=u.create({model:a.value()}) +return r.rootOutletState&&(r.outletState=r.rootOutletState.getOrphan(i)),{controller:l}},t.prototype.update=function(e,t,n){var r=e.controller +r.set("model",t.positional.at(0).value())},t.prototype.getDestructor=function(e){var t=e.controller +return t},t}(l),m=new f,d=function(e){function t(t,n,r,i){e.call(this,"render",i,null),this.name=t,this.template=n,this.env=r}return c.inherits(t,e),t}(t.ComponentDefinition)}) +s("ember-glimmer/template",["exports","ember-utils","glimmer-runtime"],function(e,t,n){"use strict" +function r(e){var r=n.templateFactory(e) +return{id:r.id,meta:r.meta,create:function(e){return r.create(e.env,{owner:e[t.OWNER]})}}}e.default=r}) +s("ember-glimmer/template_registry",["exports"],function(e){"use strict" +function t(e){s=e}function n(){return s}function r(e){if(s.hasOwnProperty(e))return s[e]}function i(e){return s.hasOwnProperty(e)}function o(e,t){return s[e]=t}e.setTemplates=t,e.getTemplates=n,e.getTemplate=r,e.hasTemplate=i,e.setTemplate=o +var s={}}),s("ember-glimmer/templates/component",["exports","ember-glimmer/template"],function(e,t){"use strict" +e.default=t.default({id:"ZoGfVsSJ",block:'{"statements":[["yield","default"]],"locals":[],"named":[],"yields":["default"],"blocks":[],"hasPartials":false}',meta:{moduleName:"ember-glimmer/templates/component.hbs"}})}),s("ember-glimmer/templates/empty",["exports","ember-glimmer/template"],function(e,t){"use strict" +e.default=t.default({id:"qEHL4OLi",block:'{"statements":[],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":false}',meta:{moduleName:"ember-glimmer/templates/empty.hbs"}})}),s("ember-glimmer/templates/link-to",["exports","ember-glimmer/template"],function(e,t){"use strict" +e.default=t.default({id:"Ca7iQMR7",block:'{"statements":[["block",["if"],[["get",["linkTitle"]]],null,1,0]],"locals":[],"named":[],"yields":["default"],"blocks":[{"statements":[["yield","default"]],"locals":[]},{"statements":[["append",["unknown",["linkTitle"]],false]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"ember-glimmer/templates/link-to.hbs"}})}),s("ember-glimmer/templates/outlet",["exports","ember-glimmer/template"],function(e,t){"use strict" +e.default=t.default({id:"sYQo9vi/",block:'{"statements":[["append",["unknown",["outlet"]],false]],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":false}',meta:{moduleName:"ember-glimmer/templates/outlet.hbs"}})}),s("ember-glimmer/templates/root",["exports","ember-glimmer/template"],function(e,t){"use strict" +e.default=t.default({id:"Eaf3RPY3",block:'{"statements":[["append",["helper",["component"],[["get",[null]]],null],false]],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":false}',meta:{moduleName:"ember-glimmer/templates/root.hbs"}})}),s("ember-glimmer/utils/bindings",["exports","glimmer-reference","glimmer-runtime","ember-metal","ember-runtime","ember-glimmer/component","ember-glimmer/utils/string"],function(e,t,n,r,i,o,s){"use strict" +function a(e,t){return e[o.ROOT_REF].get(t)}function u(e,n){var r="attrs"===n[0] +return r&&(n.shift(),1===n.length)?a(e,n[0]):t.referenceFromParts(e[o.ROOT_REF],n)}function l(e){var t=e.named,r=t.keys.indexOf("class") +if(r!==-1){var i=t.values[r],o=i.ref,s=i.type +if("get"===s){var a=o.parts[o.parts.length-1] +t.values[r]=n.HelperSyntax.fromSpec(["helper",["-class"],[["get",o.parts],a],null])}}return e}e.wrapComponentClassAttribute=l +var p={parse:function(e){var t=e.indexOf(":") +if(t===-1)return[e,e,!0] +var n=e.substring(0,t),r=e.substring(t+1) +return[n,r,!1]},install:function(e,t,n,i){var o=n[0],s=n[1] +n[2] +if("id"===s){var l=r.get(t,o) +return void 0!==l&&null!==l||(l=t.elementId),void i.addStaticAttribute(e,"id",l)}var c=o.indexOf(".")>-1,p=c?u(t,o.split(".")):a(t,o) +"style"===s&&(p=new m(p,a(t,"isVisible"))),i.addDynamicAttribute(e,s,p)}} +e.AttributeBinding=p +var h="display: none;",f=s.htmlSafe(h),m=function(e){function n(n,r){e.call(this),this.tag=t.combine([n.tag,r.tag]),this.inner=n,this.isVisible=r}return c.inherits(n,e),n.prototype.compute=function(){var e=this.inner.value(),t=this.isVisible.value() +if(t!==!1)return e +if(e||0===e){var n=e+" "+h +return s.isHTMLSafe(e)?s.htmlSafe(n):n}return f},n}(t.CachedReference),d={install:function(e,n,r){r.addDynamicAttribute(e,"style",t.map(a(n,"isVisible"),this.mapStyleValue))},mapStyleValue:function(e){return e===!1?f:null}} +e.IsVisibleBinding=d +var g={install:function(e,t,n,r){var i=n.split(":"),o=i[0],s=i[1],l=i[2],c=""===o +if(c)r.addStaticAttribute(e,"class",s) +else{var p=o.indexOf(".")>-1,h=p&&o.split("."),f=p?u(t,h):a(t,o),m=void 0 +m=void 0===s?new v(f,p?h[h.length-1]:o):new y(f,s,l),r.addDynamicAttribute(e,"class",m)}}} +e.ClassNameBinding=g +var v=function(e){function t(t,n){e.call(this),this.tag=t.tag,this.inner=t,this.path=n,this.dasherizedPath=null}return c.inherits(t,e),t.prototype.compute=function(){var e=this.inner.value() +if(e===!0){var t=this.path,n=this.dasherizedPath +return n||(this.dasherizedPath=i.String.dasherize(t))}return e||0===e?e:null},t}(t.CachedReference),y=function(e){function t(t,n,r){e.call(this),this.tag=t.tag,this.inner=t,this.truthy=n||null,this.falsy=r||null}return c.inherits(t,e),t.prototype.compute=function(){var e=this.inner,t=this.truthy,n=this.falsy +return e.value()?t:n},t}(t.CachedReference)}),s("ember-glimmer/utils/iterable",["exports","ember-utils","ember-metal","ember-runtime","ember-glimmer/utils/references","ember-glimmer/helpers/each-in","glimmer-reference"],function(e,t,n,r,i,o,s){"use strict" +function a(e,t){return o.isEachIn(e)?new b(e,u(t)):new _(e,l(t))}function u(e){switch(e){case"@index":case void 0:case null:return c +case"@identity":return p +default:return function(t){return n.get(t,e)}}}function l(e){switch(e){case"@index":return c +case"@identity":case void 0:case null:return p +default:return function(t){return n.get(t,e)}}}function c(e,t){return String(t)}function p(e){switch(typeof e){case"string":case"number":return String(e) +default:return t.guidFor(e)}}function h(e,t){var n=e[t] +return n?(e[t]++,""+t+f+n):(e[t]=1,t)}e.default=a +var f="be277757-bbbe-4620-9fcb-213ef433cca2",m=function(){function e(e,n){this.array=e,this.length=e.length,this.keyFor=n,this.position=0,this.seen=new t.EmptyObject}return e.prototype.isEmpty=function(){return!1},e.prototype.next=function(){var e=this.array,t=this.length,n=this.keyFor,r=this.position,i=this.seen +if(r>=t)return null +var o=e[r],s=r,a=h(i,n(o,s)) +return this.position++,{key:a,value:o,memo:s}},e}(),d=function(){function e(e,r){this.array=e,this.length=n.get(e,"length"),this.keyFor=r,this.position=0,this.seen=new t.EmptyObject}return e.prototype.isEmpty=function(){return 0===this.length},e.prototype.next=function(){var e=this.array,t=this.length,n=this.keyFor,i=this.position,o=this.seen +if(i>=t)return null +var s=r.objectAt(e,i),a=i,u=h(o,n(s,a)) +return this.position++,{key:u,value:s,memo:a}},e}(),g=function(){function e(e,n,r){this.keys=e,this.values=n,this.keyFor=r,this.position=0,this.seen=new t.EmptyObject}return e.prototype.isEmpty=function(){return 0===this.keys.length},e.prototype.next=function(){var e=this.keys,t=this.values,n=this.keyFor,r=this.position,i=this.seen +if(r>=e.length)return null +var o=t[r],s=e[r],a=h(i,n(o,s)) +return this.position++,{key:a,value:o,memo:s}},e}(),v=function(){function e(){}return e.prototype.isEmpty=function(){return!0},e.prototype.next=function(){throw new Error("Cannot call next() on an empty iterator")},e}(),y=new v,b=function(){function e(e,t){this.ref=e,this.keyFor=t +var n=this.valueTag=new s.UpdatableTag(s.CONSTANT_TAG) +this.tag=s.combine([e.tag,n])}return e.prototype.iterate=function(){var e=this.ref,t=this.keyFor,r=this.valueTag,i=e.value() +r.update(n.tagFor(i)),n.isProxy(i)&&(i=n.get(i,"content")) +var o=typeof i +if(!i||"object"!==o&&"function"!==o)return y +var s=Object.keys(i),a=s.map(function(e){return i[e]}) +return s.length>0?new g(s,a,t):y},e.prototype.valueReferenceFor=function(e){return new i.UpdatablePrimitiveReference(e.memo)},e.prototype.updateValueReference=function(e,t){e.update(t.memo)},e.prototype.memoReferenceFor=function(e){return new i.UpdatableReference(e.value)},e.prototype.updateMemoReference=function(e,t){e.update(t.value)},e}(),_=function(){function e(e,t){this.ref=e,this.keyFor=t +var n=this.valueTag=new s.UpdatableTag(s.CONSTANT_TAG) +this.tag=s.combine([e.tag,n])}return e.prototype.iterate=function(){var e=this.ref,t=this.keyFor,i=this.valueTag,o=e.value() +if(i.update(n.tagForProperty(o,"[]")),!o||"object"!=typeof o)return y +if(Array.isArray(o))return o.length>0?new m(o,t):y +if(r.isEmberArray(o))return n.get(o,"length")>0?new d(o,t):y +if("function"!=typeof o.forEach)return y +var s=function(){var e=[] +return o.forEach(function(t){e.push(t)}),{v:e.length>0?new m(e,t):y}}() +return"object"==typeof s?s.v:void 0},e.prototype.valueReferenceFor=function(e){return new i.UpdatableReference(e.value)},e.prototype.updateValueReference=function(e,t){e.update(t.value)},e.prototype.memoReferenceFor=function(e){return new i.UpdatablePrimitiveReference(e.memo)},e.prototype.updateMemoReference=function(e,t){e.update(t.memo)},e}()}),s("ember-glimmer/utils/process-args",["exports","ember-utils","glimmer-reference","ember-glimmer/component","ember-glimmer/utils/references","ember-views","ember-glimmer/helpers/action","glimmer-runtime"],function(e,t,n,r,i,o,s,a){"use strict" +function u(e,t){var n=l(e,t),r=c(e,t) +return p(n,r,e.blocks,t.ComponentClass)}function l(e,n){var r=e.named.map +return n.args?t.assign({},n.args.named.map,r):r}function c(e,t){var n=e.positional.values +if(t.args){var r=t.args.positional.values,i=[] +return i.push.apply(i,r),i.splice.apply(i,[0,n.length].concat(n)),i}return n}function p(e,t,n,r){var i=r.positionalParams +return i&&i.length>0&&t.length>0&&(e="string"==typeof i?h(e,t,i):f(e,t,i)),a.EvaluatedArgs.named(e,n)}function h(e,n,r){var i=t.assign({},e) +return i[r]=a.EvaluatedPositionalArgs.create(n),i}function f(e,n,r){for(var i=t.assign({},e),o=Math.min(n.length,r.length),s=0;s":">",'"':""","'":"'","`":"`","=":"="},l=/[&<>"'`=]/,c=/[&<>"'`=]/g}),s("ember-glimmer/utils/to-bool",["exports","ember-runtime","ember-metal"],function(e,t,n){"use strict" +function r(e){return!!e&&(e===!0||(!t.isArray(e)||0!==n.get(e,"length")))}e.default=r}),s("ember-glimmer/views/outlet",["exports","ember-utils","glimmer-reference","ember-environment","ember-metal"],function(e,t,n,r,i){"use strict" +var o=function(){function e(e){this.outletView=e,this.tag=e._tag}return e.prototype.get=function(e){return new a(this,e)},e.prototype.value=function(){return this.outletView.outletState},e.prototype.getOrphan=function(e){return new s(this,e)},e.prototype.update=function(e){this.outletView.setOutletState(e)},e}(),s=function(e){function n(t,n){e.call(this,t.outletView),this.root=t,this.name=n}return c.inherits(n,e),n.prototype.value=function(){var e=this.root.value(),n=e.outlets.main.outlets.__ember_orphans__ +if(!n)return null +var r=n.outlets[this.name] +if(!r)return null +var i=new t.EmptyObject +return i[r.render.outlet]=r,r.wasUsed=!0,{outlets:i}},n}(o),a=function(){function e(e,t){this.parent=e,this.key=t,this.tag=e.tag}return e.prototype.get=function(t){return new e(this,t)},e.prototype.value=function(){return this.parent.value()[this.key]},e}(),u=function(){function e(e,t,r,i){this._environment=e,this.renderer=t,this.owner=r,this.template=i,this.outletState=null,this._tag=new n.DirtyableTag}return e.extend=function(n){return function(e){function r(){e.apply(this,arguments)}return c.inherits(r,e),r.create=function(r){return r?e.create.call(this,t.assign({},n,r)):e.create.call(this,n)},r}(e)},e.reopenClass=function(e){t.assign(this,e)},e.create=function(n){var r=n._environment,i=n.renderer,o=n.template,s=n[t.OWNER] +return new e(r,i,s,o)},e.prototype.appendTo=function(e){var t=this._environment||r.environment,n=void 0 +n=t.hasDOM&&"string"==typeof e?document.querySelector(e):e,i.run.schedule("render",this.renderer,"appendOutletView",this,n)},e.prototype.rerender=function(){},e.prototype.setOutletState=function(e){this.outletState={outlets:{main:e},render:{owner:void 0,into:void 0,outlet:"main",name:"-top-level",controller:void 0,ViewClass:void 0,template:void 0}},this._tag.dirty()},e.prototype.toReference=function(){return new o(this)},e.prototype.destroy=function(){},e}() +e.default=u}),s("ember-metal/alias",["exports","ember-utils","ember-metal/debug","ember-metal/property_get","ember-metal/property_set","ember-metal/error","ember-metal/properties","ember-metal/computed","ember-metal/meta","ember-metal/dependent_keys"],function(e,t,n,r,i,o,s,a,u,l){"use strict" +function c(e){return new p(e)}function p(e){this.isDescriptor=!0,this.altKey=e,this._dependentKeys=[e]}function h(e,n,r){throw new o.default("Cannot set read-only property '"+n+"' on object: "+t.inspect(e))}function f(e,t,n){return s.defineProperty(e,t,null),i.set(e,t,n)}e.default=c,e.AliasedProperty=p +var m={} +p.prototype=Object.create(s.Descriptor.prototype),p.prototype.setup=function(e,t){var n=u.meta(e) +n.peekWatching(t)&&l.addDependentKeys(this,e,t,n)},p.prototype.teardown=function(e,t){var n=u.meta(e) +n.peekWatching(t)&&l.removeDependentKeys(this,e,t,n)},p.prototype.willWatch=function(e,t){l.addDependentKeys(this,e,t,u.meta(e))},p.prototype.didUnwatch=function(e,t){l.removeDependentKeys(this,e,t,u.meta(e))},p.prototype.get=function(e,t){var n=r.get(e,this.altKey),i=u.meta(e),o=i.writableCache() +return o[t]!==m&&(o[t]=m,l.addDependentKeys(this,e,t,i)),n},p.prototype.set=function(e,t,n){return i.set(e,this.altKey,n)},p.prototype.readOnly=function(){return this.set=h,this},p.prototype.oneWay=function(){return this.set=f,this},p.prototype._meta=void 0,p.prototype.meta=a.ComputedProperty.prototype.meta}),s("ember-metal/binding",["exports","ember-utils","ember-console","ember-environment","ember-metal/run_loop","ember-metal/debug","ember-metal/property_get","ember-metal/property_set","ember-metal/events","ember-metal/observer","ember-metal/path_cache"],function(e,t,n,r,i,o,s,a,u,l,c){"use strict" +function p(e,t){this._from=t,this._to=e,this._oneWay=void 0,this._direction=void 0,this._readyToSync=void 0,this._fromObj=void 0,this._fromPath=void 0,this._toObj=void 0}function h(e,t,n,r,i,o){}function f(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}function m(e,t,n){return new p(t,n).connect(e)}e.bind=m,p.prototype={copy:function(){var e=new p(this._to,this._from) +return this._oneWay&&(e._oneWay=!0),e},from:function(e){return this._from=e,this},to:function(e){return this._to=e,this},oneWay:function(){return this._oneWay=!0,this},toString:function(){var e=this._oneWay?"[oneWay]":"" +return"Ember.Binding<"+t.guidFor(this)+">("+this._from+" -> "+this._to+")"+e},connect:function(e){var t=void 0,n=void 0,i=void 0 +if(c.isGlobalPath(this._from)){var o=c.getFirstKey(this._from) +i=r.context.lookup[o],i&&(t=i,n=c.getTailPath(this._from))}return void 0===t&&(t=e,n=this._from),a.trySet(e,this._to,s.get(t,n)),l.addObserver(t,n,this,"fromDidChange"),this._oneWay||l.addObserver(e,this._to,this,"toDidChange"),u.addListener(e,"willDestroy",this,"disconnect"),h(e,this._to,this._from,i,this._oneWay,!i&&!this._oneWay),this._readyToSync=!0,this._fromObj=t,this._fromPath=n,this._toObj=e,this},disconnect:function(){return l.removeObserver(this._fromObj,this._fromPath,this,"fromDidChange"),this._oneWay||l.removeObserver(this._toObj,this._to,this,"toDidChange"),this._readyToSync=!1,this},fromDidChange:function(e){this._scheduleSync("fwd")},toDidChange:function(e){this._scheduleSync("back")},_scheduleSync:function(e){var t=this._direction +void 0===t&&(i.default.schedule("sync",this,"_sync"),this._direction=e),"back"===t&&"fwd"===e&&(this._direction="fwd")},_sync:function(){var e=r.ENV.LOG_BINDINGS,t=this._toObj +if(!t.isDestroyed&&this._readyToSync){var i=this._direction,o=this._fromObj,u=this._fromPath +if(this._direction=void 0,"fwd"===i){var c=s.get(o,u) +e&&n.default.log(" ",this.toString(),"->",c,o),this._oneWay?a.trySet(t,this._to,c):l._suspendObserver(t,this._to,this,"toDidChange",function(){a.trySet(t,this._to,c)})}else if("back"===i){var p=s.get(t,this._to) +e&&n.default.log(" ",this.toString(),"<-",p,t),l._suspendObserver(o,u,this,"fromDidChange",function(){a.trySet(o,u,p)})}}}},f(p,{from:function(e){var t=this +return new t(void 0,e)},to:function(e){var t=this +return new t(e,void 0)}}),e.Binding=p}),s("ember-metal/cache",["exports","ember-utils","ember-metal/meta"],function(e,t,n){"use strict" +var r=function(){function e(e,t,n,r){this.size=0,this.misses=0,this.hits=0,this.limit=e,this.func=t,this.key=n,this.store=r||new i}return e.prototype.get=function(e){var t=void 0===this.key?e:this.key(e),r=this.store.get(t) +return void 0===r?(this.misses++,r=this._set(t,this.func(e))):r===n.UNDEFINED?(this.hits++,r=void 0):this.hits++,r},e.prototype.set=function(e,t){var n=void 0===this.key?e:this.key(e) +return this._set(n,t)},e.prototype._set=function(e,t){return this.limit>this.size&&(this.size++,void 0===t?this.store.set(e,n.UNDEFINED):this.store.set(e,t)),t},e.prototype.purge=function(){this.store.clear(),this.size=0,this.hits=0,this.misses=0},e}() +e.default=r +var i=function(){function e(){this.data=new t.EmptyObject}return e.prototype.get=function(e){return this.data[e]},e.prototype.set=function(e,t){this.data[e]=t},e.prototype.clear=function(){this.data=new t.EmptyObject},e}()}),s("ember-metal/chains",["exports","ember-utils","ember-metal/property_get","ember-metal/meta","ember-metal/watch_key","ember-metal/watch_path"],function(e,t,n,r,i,o){"use strict" +function s(e){return e.match(g)[0]}function a(e){return"object"==typeof e&&e}function u(e){return!(a(e)&&e.isDescriptor&&e._volatile===!1)}function l(){this.chains=new t.EmptyObject}function c(){return new l}function p(e,t,n){var o=r.meta(e) +o.writableChainWatchers(c).add(t,n),i.watchKey(e,t,o)}function h(e,t,n,o){if(a(e)){var s=o||r.peekMeta(e) +s&&s.readableChainWatchers()&&(s=r.meta(e),s.readableChainWatchers().remove(t,n),i.unwatchKey(e,t,s))}}function f(e,t,n){if(this._parent=e,this._key=t,this._watching=void 0===n,this._chains=void 0,this._object=void 0,this.count=0,this._value=n,this._paths={},this._watching){var r=e.value() +if(!a(r))return +this._object=r,p(this._object,this._key,this)}}function m(e,t){if(a(e)){var i=r.peekMeta(e) +if(!i||i.proto!==e){if(u(e[t]))return n.get(e,t) +var o=i.readableCache() +return o&&t in o?o[t]:void 0}}}function d(e){var t=r.peekMeta(e) +if(t){t=r.meta(e) +var n=t.readableChainWatchers() +n&&n.revalidateAll(),t.readableChains()&&t.writableChains(o.makeChainNode)}}e.finishChains=d +var g=/^([^\.]+)/ +l.prototype={add:function(e,t){var n=this.chains[e] +void 0===n?this.chains[e]=[t]:n.push(t)},remove:function(e,t){var n=this.chains[e] +if(n)for(var r=0;r0&&t[e]-- +var n=s(e),r=e.slice(n.length+1) +this.unchain(n,r)},chain:function(e,n){var r=this._chains,i=void 0 +void 0===r?r=this._chains=new t.EmptyObject:i=r[e],void 0===i&&(i=r[e]=new f(this,e,void 0)),i.count++,n&&(e=s(n),n=n.slice(e.length+1),i.chain(e,n))},unchain:function(e,t){var n=this._chains,r=n[e] +if(t&&t.length>1){var i=s(t),o=t.slice(i.length+1) +r.unchain(i,o)}r.count--,r.count<=0&&(n[r._key]=void 0,r.destroy())},notify:function(e,t){if(e&&this._watching){var n=this._parent.value() +n!==this._object&&(this._object&&h(this._object,this._key,this),a(n)?(this._object=n,p(n,this._key,this)):this._object=void 0),this._value=void 0}var r=this._chains,i=void 0 +if(r)for(var o in r)i=r[o],void 0!==i&&i.notify(e,t) +t&&this._parent&&this._parent.populateAffected(this._key,1,t)},populateAffected:function(e,t,n){this._key&&(e=this._key+"."+e),this._parent?this._parent.populateAffected(e,t+1,n):t>1&&n.push(this.value(),e)}},e.removeChainWatcher=h,e.ChainNode=f}),s("ember-metal/computed",["exports","ember-utils","ember-metal/debug","ember-metal/property_set","ember-metal/meta","ember-metal/expand_properties","ember-metal/error","ember-metal/properties","ember-metal/property_events","ember-metal/dependent_keys"],function(e,t,n,r,i,o,s,a,u,l){"use strict" +function c(e,t){this.isDescriptor=!0,"function"==typeof e?this._getter=e:(this._getter=e.get,this._setter=e.set),this._dependentKeys=void 0,this._suspended=void 0,this._meta=void 0,this._volatile=!1,this._dependentKeys=t&&t.dependentKeys,this._readOnly=!1}function p(e){var t=void 0 +arguments.length>1&&(t=[].slice.call(arguments),e=t.pop()) +var n=new c(e) +return t&&n.property.apply(n,t),n}function h(e,t){var n=i.peekMeta(e),r=n&&n.source===e&&n.readableCache(),o=r&&r[t] +if(o!==i.UNDEFINED)return o}e.default=p +c.prototype=new a.Descriptor,c.prototype.constructor=c +var f=c.prototype +f.volatile=function(){return this._volatile=!0,this},f.readOnly=function(){return this._readOnly=!0,this},f.property=function(){function e(e){t.push(e)}for(var t=[],n=0;n=0;i-=3)if(t===e[i]&&n===e[i+1]){r=i +break}return r}function s(e,t,n){var i=r.peekMeta(e) +if(i){for(var s=i.matchingListeners(t),a=[],u=s.length-3;u>=0;u-=3){var l=s[u],c=s[u+1],p=s[u+2],h=o(n,l,c) +h===-1&&(n.push(l,c,p),a.push(l,c,p))}return a}}function a(e,t,n,o,s){o||"function"!=typeof n||(o=n,n=null) +var a=0 +s&&(a|=i.ONCE),r.meta(e).addToListeners(t,n,o,a),"function"==typeof e.didAddListener&&e.didAddListener(t,n,o)}function u(e,t,n,i){i||"function"!=typeof n||(i=n,n=null),r.meta(e).removeFromListeners(t,n,i,function(){"function"==typeof e.didRemoveListener&&e.didRemoveListener.apply(e,arguments)})}function l(e,t,n,r,i){return c(e,[t],n,r,i)}function c(e,t,n,i,o){return i||"function"!=typeof n||(i=n,n=null),r.meta(e).suspendListeners(t,n,i,o)}function p(e){return r.meta(e).watchedEvents()}function h(e,n,o,s){if(!s){var a=r.peekMeta(e) +s=a&&a.matchingListeners(n)}if(s&&0!==s.length){for(var l=s.length-3;l>=0;l-=3){var c=s[l],p=s[l+1],h=s[l+2] +p&&(h&i.SUSPENDED||(h&i.ONCE&&u(e,n,c,p),c||(c=e),"string"==typeof p?o?t.applyStr(c,p,o):c[p]():o?p.apply(c,o):p.call(c)))}return!0}}function f(e,t){var n=r.peekMeta(e) +return!!n&&n.matchingListeners(t).length>0}function m(e,t){var n=[],i=r.peekMeta(e),o=i&&i.matchingListeners(t) +if(!o)return n +for(var s=0;s=0&&(s=r(s,u.split(","),a))}for(var a=0;a-1&&o.splice(s,1),this.size=o.length,!0}return!1},isEmpty:function(){return 0===this.size},has:function(e){if(0===this.size)return!1 +var n=t.guidFor(e),r=this.presenceSet +return r[n]===!0},forEach:function(e){if("function"!=typeof e&&n(e),0!==this.size){var t=this.list +if(2===arguments.length)for(var r=0;r0;){if(e=O.pop(),t=e._chains)for(n in t)void 0!==t[n]&&O.push(t[n]) +if(e._watching&&(r=e._object)){var i=N(r) +i&&!i.isSourceDestroying()&&o.removeChainWatcher(r,e._key,e,i)}}this.setMetaDestroyed()}} +for(var S in r.protoMethods)s.prototype[S]=r.protoMethods[S] +w.forEach(function(e){return g[e](e,s)}),s.prototype.isSourceDestroying=function(){return 0!==(this._flags&v)},s.prototype.setSourceDestroying=function(){this._flags|=v},s.prototype.isSourceDestroyed=function(){return 0!==(this._flags&y)},s.prototype.setSourceDestroyed=function(){this._flags|=y},s.prototype.isMetaDestroyed=function(){return 0!==(this._flags&b)},s.prototype.setMetaDestroyed=function(){this._flags|=b},s.prototype.isProxy=function(){return 0!==(this._flags&_)},s.prototype.setProxy=function(){this._flags|=_},s.prototype._getOrCreateOwnMap=function(e){var n=this[e] +return n||(n=this[e]=new t.EmptyObject),n},s.prototype._getInherited=function(e){for(var t=this;void 0!==t;){if(t[e])return t[e] +t=t.parent}},s.prototype._findInherited=function(e,t){for(var n=this;void 0!==n;){var r=n[e] +if(r){var i=r[t] +if(void 0!==i)return i}n=n.parent}} +var x=t.symbol("undefined") +e.UNDEFINED=x,s.prototype.writeDeps=function(e,n,r){var i=this._getOrCreateOwnMap("_deps"),o=i[e] +o||(o=i[e]=new t.EmptyObject),o[n]=r},s.prototype.peekDeps=function(e,t){for(var n=this;void 0!==n;){var r=n._deps +if(r){var i=r[e] +if(i&&void 0!==i[t])return i[t]}n=n.parent}},s.prototype.hasDeps=function(e){for(var t=this;void 0!==t;){if(t._deps&&t._deps[e])return!0 +t=t.parent}return!1},s.prototype.forEachInDeps=function(e,t){return this._forEachIn("_deps",e,t)},s.prototype._forEachIn=function(e,n,r){for(var i=this,o=new t.EmptyObject,s=[];void 0!==i;){var a=i[e] +if(a){var u=a[n] +if(u)for(var l in u)o[l]||(o[l]=!0,s.push([l,u[l]]))}i=i.parent}for(var c=0;c=0;s-=4)if(o[s]===e&&(!n||o[s+1]===t&&o[s+2]===n)){if(i!==this)return this._finalizeListeners(),this.removeFromListeners(e,t,n) +"function"==typeof r&&r(e,t,o[s+2]),o.splice(s,4)}if(i._listenersFinalized)break +i=i.parent}},matchingListeners:function(e){for(var n=this,i=[];n;){var o=n._listeners +if(o)for(var s=0;s=0;o-=3)i[o+1]===t&&i[o+2]===n&&e.indexOf(i[o])!==-1&&i.splice(o,3)}},watchedEvents:function(){for(var e=this,t={};e;){var n=e._listeners +if(n)for(var r=0;r=0||"concatenatedProperties"===t||"mergedProperties"===t?n=v(e,t,n,o):u&&u.indexOf(t)>=0?n=y(e,t,n,o):h(n)&&(n=g(e,t,n,o,i)),i[t]=void 0,o[t]=n}function _(e,t,n,r,i,o){function s(e){delete n[e],delete r[e]}for(var a=void 0,u=void 0,l=void 0,c=void 0,p=void 0,h=0;h7&&66===e.charCodeAt(t-7)&&e.indexOf("inding",t-6)!==-1}function E(e,t){t.forEachBindings(function(t,n){if(n){var r=t.slice(0,-7) +n instanceof u.Binding?(n=n.copy(),n.to(r)):n=new u.Binding(r,n),n.connect(e),e[t]=n}}),t.clearBindings()}function O(e,t){return E(e,t||i.meta(e)),e}function S(e,t,n,r,i){var o=t.methodName,s=void 0,a=void 0 +return r[o]||i[o]?(s=i[o],t=r[o]):(a=e[o])&&null!==a&&"object"==typeof a&&a.isDescriptor?(t=a,s=void 0):(t=void 0,s=e[o]),{desc:t,value:s}}function x(e,t,n,r,i){var o=n[r] +if(o)for(var s=0;s1?t-1:0),r=1;r0){for(var i=new Array(r),o=0;o=0;)if(P(o[s],n,r))return!0 +return!1}function D(e,n,r){if(!r[t.guidFor(n)])if(r[t.guidFor(n)]=!0,n.properties)for(var i=Object.keys(n.properties),o=0;o0,l&&l.teardown(e,t),n instanceof o)p=n,e[t]=p,n.setup&&n.setup(e,t) +else if(null==n){p=s +e[t]=s}else p=n,Object.defineProperty(e,t,n) +return c&&i.overrideChains(e,t,a),e.didDefineProperty&&e.didDefineProperty(e,t,p),this}e.Descriptor=o,e.MANDATORY_SETTER_FUNCTION=s,e.DEFAULT_GETTER_FUNCTION=a,e.INHERITING_GETTER_FUNCTION=u,e.defineProperty=l;(function(){var e=Object.create(Object.prototype,{prop:{configurable:!0,value:1}}) +return Object.defineProperty(e,"prop",{configurable:!0,value:2}),2===e.prop})()}),s("ember-metal/property_events",["exports","ember-utils","ember-metal/meta","ember-metal/events","ember-metal/tags","ember-metal/observer_set","ember-metal/features","ember-metal/transaction"],function(e,t,n,r,i,o,s,a){"use strict" +function u(e,t,r){var i=r||n.peekMeta(e) +if(!i||i.isInitialized(e)){var o=i&&i.peekWatching(t)>0,s=e[t],a=null!==s&&"object"==typeof s&&s.isDescriptor?s:void 0 +a&&a.willChange&&a.willChange(e,t),o&&(c(e,t,i),f(e,t,i),b(e,t,i))}}function l(e,t,r){var o=r||n.peekMeta(e) +if(!o||o.isInitialized(e)){var s=o&&o.peekWatching(t)>0,u=e[t],l=null!==u&&"object"==typeof u&&u.isDescriptor?u:void 0 +l&&l.didChange&&l.didChange(e,t),s&&(o.hasDeps(t)&&p(e,t,o),m(e,t,o,!1),_(e,t,o)),e[w]&&e[w](t),o&&o.isSourceDestroying()||(i.markObjectAsDirty(o,t),a.assertNotRendered(e,t,o))}}function c(e,t,n){if((!n||!n.isSourceDestroying())&&n&&n.hasDeps(t)){var r=x,i=!r +i&&(r=x={}),h(u,e,t,r,n),i&&(x=null)}}function p(e,t,n){if((!n||!n.isSourceDestroying())&&n&&n.hasDeps(t)){var r=C,i=!r +i&&(r=C={}),h(l,e,t,r,n),i&&(C=null)}}function h(e,n,r,i,o){var s=void 0,a=void 0,u=t.guidFor(n),l=i[u] +l||(l=i[u]={}),l[r]||(l[r]=!0,o.forEachInDeps(r,function(t,r){r&&(s=n[t],a=null!==s&&"object"==typeof s&&s.isDescriptor?s:void 0,a&&a._suspended===n||e(n,t,o))}))}function f(e,t,n){var r=n.readableChainWatchers() +r&&r.notify(t,!1,u)}function m(e,t,n){var r=n.readableChainWatchers() +r&&r.notify(t,!0,l)}function d(e,t,n){var r=n.readableChainWatchers() +r&&r.revalidate(t)}function g(){S++}function v(){S--,S<=0&&(E.clear(),O.flush())}function y(e,t){g() +try{e.call(t)}finally{v.call(t)}}function b(e,t,n){if(!n||!n.isSourceDestroying()){var i=t+":before",o=void 0,s=void 0 +S?(o=E.add(e,t,i),s=r.accumulateListeners(e,i,o),r.sendEvent(e,i,[e,t],s)):r.sendEvent(e,i,[e,t])}}function _(e,t,n){if(!n||!n.isSourceDestroying()){var i=t+":change",o=void 0 +S?(o=O.add(e,t,i),r.accumulateListeners(e,i,o)):r.sendEvent(e,i,[e,t])}}var w=t.symbol("PROPERTY_DID_CHANGE") +e.PROPERTY_DID_CHANGE=w +var E=new o.default,O=new o.default,S=0,x=void 0,C=void 0 +e.propertyWillChange=u,e.propertyDidChange=l,e.overrideChains=d,e.beginPropertyChanges=g,e.endPropertyChanges=v,e.changeProperties=y}),s("ember-metal/property_get",["exports","ember-metal/debug","ember-metal/path_cache"],function(e,t,n){"use strict" +function r(e,t){var r=e[t],o=null!==r&&"object"==typeof r&&r.isDescriptor?r:void 0,s=void 0 +return void 0===o&&n.isPath(t)?i(e,t):o?o.get(e,t):(s=r,void 0!==s||"object"!=typeof e||t in e||"function"!=typeof e.unknownProperty?s:e.unknownProperty(t))}function i(e,t){for(var n=e,i=t.split("."),s=0;sa?a:l,c<=0&&(c=0),p=o.splice(0,a),p=[u,c].concat(p),u+=a,l-=c,s=s.concat(n.apply(e,p)) +return s}e.default=t +var n=Array.prototype.splice}),s("ember-metal/run_loop",["exports","ember-utils","ember-metal/debug","ember-metal/testing","ember-metal/error_handler","ember-metal/property_events","backburner"],function(e,t,n,r,i,o,s){"use strict" +function a(e){l.currentRunLoop=e}function u(e,t){l.currentRunLoop=t}function l(){return p.run.apply(p,arguments)}e.default=l +var c={get onerror(){return i.getOnerror()},set onerror(e){return i.setOnerror(e)}},p=new s.default(["sync","actions","destroy"],{GUID_KEY:t.GUID_KEY,sync:{before:o.beginPropertyChanges,after:o.endPropertyChanges},defaultQueue:"actions",onBegin:a,onEnd:u,onErrorTarget:c,onErrorMethod:"onerror"}) +l.join=function(){return p.join.apply(p,arguments)},l.bind=function(){for(var e=arguments.length,t=Array(e),n=0;n1&&i.writeWatching(t,o-1)}}}e.watchKey=o,e.unwatchKey=s}),s("ember-metal/watch_path",["exports","ember-metal/meta","ember-metal/chains"],function(e,t,n){"use strict" +function r(e,n){return(n||t.meta(e)).writableChains(i)}function i(e){return new n.ChainNode(null,null,e)}function o(e,n,i){if("object"==typeof e&&null!==e){var o=i||t.meta(e),s=o.peekWatching(n)||0 +s?o.writeWatching(n,s+1):(o.writeWatching(n,1),r(e,o).add(n))}}function s(e,n,i){if("object"==typeof e&&null!==e){var o=i||t.meta(e),s=o.peekWatching(n)||0 +1===s?(o.writeWatching(n,0),r(e,o).remove(n)):s>1&&o.writeWatching(n,s-1)}}e.makeChainNode=i,e.watchPath=o,e.unwatchPath=s}),s("ember-metal/watching",["exports","ember-metal/watch_key","ember-metal/watch_path","ember-metal/path_cache","ember-metal/meta"],function(e,t,n,r,i){"use strict" +function o(e,i,o){r.isPath(i)?n.watchPath(e,i,o):t.watchKey(e,i,o)}function s(e,t){if("object"!=typeof e||null===e)return!1 +var n=i.peekMeta(e) +return(n&&n.peekWatching(t))>0}function a(e,t){var n=i.peekMeta(e) +return n&&n.peekWatching(t)||0}function u(e,i,o){r.isPath(i)?n.unwatchPath(e,i,o):t.unwatchKey(e,i,o)}function l(e){i.deleteMeta(e)}e.isWatching=s,e.watcherCount=a,e.unwatch=u,e.destroy=l,e.watch=o}),s("ember-metal/weak_map",["exports","ember-utils","ember-metal/meta"],function(e,t,n){"use strict" +function r(e){return"object"==typeof e&&null!==e||"function"==typeof e}function i(e){if(!(this instanceof i))throw new TypeError("Constructor WeakMap requires 'new'") +if(this._id=t.GUID_KEY+o++,null!==e&&void 0!==e){if(!Array.isArray(e))throw new TypeError("The weak map constructor polyfill only supports an array argument") +for(var n=0;n7)}function a(e,t){return(e.indexOf("Android 2.")===-1&&e.indexOf("Android 4.0")===-1||e.indexOf("Mobile Safari")===-1||e.indexOf("Chrome")!==-1||e.indexOf("Windows Phone")!==-1)&&!!(t&&"pushState"in t)}function u(e,t){e.replace(o(e)+t)}e.getPath=t,e.getQuery=n,e.getHash=r,e.getFullPath=i,e.getOrigin=o,e.supportsHashChange=s,e.supportsHistory=a,e.replacePath=u}),s("ember-routing/services/routing",["exports","ember-utils","ember-runtime","ember-metal","ember-routing/utils"],function(e,t,n,r,i){"use strict" +function o(e,t){for(var n=0,r=0;rc&&(n=l),i.isActiveIntent(n,e,t,!s)}})}),s("ember-routing/system/cache",["exports","ember-utils","ember-runtime"],function(e,t,n){"use strict" +e.default=n.Object.extend({init:function(){this.cache=new t.EmptyObject},has:function(e){return!!this.cache[e]},stash:function(e,n,r){var i=this.cache[e] +i||(i=this.cache[e]=new t.EmptyObject),i[n]=r},lookup:function(e,t,n){var r=this.cache +if(!this.has(e))return n +var i=r[e] +return t in i&&void 0!==i[t]?i[t]:n}})}),s("ember-routing/system/controller_for",["exports"],function(e){"use strict" +function t(e,t,n){return e.lookup("controller:"+t,n)}e.default=t}),s("ember-routing/system/dsl",["exports","ember-utils","ember-metal"],function(e,t,n){"use strict" +function r(e,t){this.parent=e,this.enableLoadingSubstates=t&&t.enableLoadingSubstates,this.matches=[],this.explicitIndex=void 0,this.options=t}function i(e){return e.parent&&"application"!==e.parent}function o(e,t,n){return i(e)&&n!==!0?e.parent+"."+t:t}function s(e,t,n,r){n=n||{} +var i=o(e,t,n.resetNamespace) +"string"!=typeof n.path&&(n.path="/"+t),e.push(n.path,i,r,n.serialize)}e.default=r,r.prototype={route:function(e,t,n){var i="/_unused_dummy_error_path_route_"+e+"/:error" +if(2===arguments.length&&"function"==typeof t&&(n=t,t={}),1===arguments.length&&(t={}),this.enableLoadingSubstates&&(s(this,e+"_loading",{resetNamespace:t.resetNamespace}),s(this,e+"_error",{resetNamespace:t.resetNamespace,path:i})),n){var a=o(this,e,t.resetNamespace),u=new r(a,this.options) +s(u,"loading"),s(u,"error",{path:i}),n.call(u),s(this,e,t,u.generate())}else s(this,e,t)},push:function(e,n,r,i){var o=n.split(".") +if(this.options.engineInfo){var s=n.slice(this.options.engineInfo.fullName.length+1),a=t.assign({localFullName:s},this.options.engineInfo) +i&&(a.serializeMethod=i),this.options.addRouteForEngine(n,a)}else if(i)throw new Error("Defining a route serializer on route '"+n+"' outside an Engine is not allowed.") +""!==e&&"/"!==e&&"index"!==o[o.length-1]||(this.explicitIndex=!0),this.matches.push([e,n,r])},resource:function(e,t,n){2===arguments.length&&"function"==typeof t&&(n=t,t={}),1===arguments.length&&(t={}),t.resetNamespace=!0,this.route(e,t,n)},generate:function(){var e=this.matches +return this.explicitIndex||this.route("index",{path:"/"}),function(t){for(var n=0;n0&&(this.connections=[],n.run.once(this.router,"_setOutlets"))}}) +r.deprecateUnderscoreActions(_),_.reopenClass({isRouteFactory:!0}),e.default=_}),s("ember-routing/system/router",["exports","ember-utils","ember-console","ember-metal","ember-runtime","ember-routing/system/route","ember-routing/system/dsl","ember-routing/location/api","ember-routing/utils","ember-routing/system/router_state","router"],function(e,t,n,r,i,o,s,a,u,l,c){"use strict" +function p(){return this}function h(e,t,n){for(var r=!1,i=t.length-1;i>=0;--i){var o=t[i],s=o.handler +if(e===s&&(r=!0),r&&n(s)!==!0)return}}function f(e,t){var r=[],i=void 0 +i=e&&"object"==typeof e&&"object"==typeof e.errorThrown?e.errorThrown:e,t&&r.push(t),i&&(i.message&&r.push(i.message),i.stack&&r.push(i.stack),"string"==typeof i&&r.push(i)),n.default.error.apply(this,r)}function m(e,n){var r=e.router,i=t.getOwner(e),o=e.routeName,s=o+"_"+n,a=e.fullRouteName,u=a+"_"+n +return g(i,r,s,u)?u:""}function d(e,n){var r=e.router,i=t.getOwner(e),o=e.routeName,s="application"===o?n:o+"."+n,a=e.fullRouteName,u="application"===a?n:a+"."+n +return g(i,r,s,u)?u:""}function g(e,t,n,r){var i=t.hasRoute(r),o=e.hasRegistration("template:"+n)||e.hasRegistration("route:"+n) +return i&&o}function v(e,n,i){var o=i.shift() +if(!e){if(n)return +throw new r.Error("Can't trigger action '"+o+"' because your app hasn't finished transitioning into its first route. To trigger an action on destination routes during a transition, you can call `.send()` on the `Transition` object passed to the `model/beforeModel/afterModel` hooks.")}for(var s=!1,a=void 0,u=void 0,l=e.length-1;l>=0;l--)if(a=e[l],u=a.handler,u&&u.actions&&u.actions[o]){if(u.actions[o].apply(u,i)!==!0){if("error"===o){var c=t.guidFor(i[0]) +u.router._markErrorAsHandled(c)}return}s=!0}if(T[o])return void T[o].apply(null,i) +if(!s&&!n)throw new r.Error("Nothing handled the action '"+o+"'. If you did handle the action, this error can be caused by returning true from an action handler in a controller, causing the action to bubble.")}function y(e,t,n){for(var r=e.router,i=r.applyIntent(t,n),o=i.handlerInfos,s=i.params,a=0;a0;){var r=n.shift() +if(r.render.name===t)return r +var i=r.outlets +for(var o in i)n.push(i[o])}}function S(e,n,i){var o=void 0,s={render:i,outlets:new t.EmptyObject,wasUsed:!1} +return o=i.into?O(e,i.into):n,o?r.set(o.outlets,i.outlet,s):i.into?x(e,i.into,s):e=s,{liveRoutes:e,ownState:s}}function x(e,n,i){e.outlets.__ember_orphans__||(e.outlets.__ember_orphans__={render:{name:"__ember_orphans__"},outlets:new t.EmptyObject}),e.outlets.__ember_orphans__.outlets[n]=i,r.run.schedule("afterRender",function(){})}function C(e,t,n){var r=O(e,n.routeName) +return r?r:(t.outlets.main={render:{name:n.routeName,outlet:"main"},outlets:{}},t)}e.triggerEvent=v +var A=Array.prototype.slice,k=i.Object.extend(i.Evented,{location:"hash",rootURL:"/",_initRouterJs:function(){var e=this.router=new c.default +e.triggerEvent=v,e._triggerWillChangeContext=p,e._triggerWillLeave=p +var t=this.constructor.dslCallbacks||[p],i=this._buildDSL() +i.route("application",{path:"/",resetNamespace:!0,overrideNameAssertion:!0},function(){for(var e=0;e0)-(n<0)}function i(e,s){if(e===s)return 0 +var a=t.typeOf(e),u=t.typeOf(s) +if(n.default){if("instance"===a&&n.default.detect(e)&&e.constructor.compare)return e.constructor.compare(e,s) +if("instance"===u&&n.default.detect(s)&&s.constructor.compare)return s.constructor.compare(s,e)*-1}var l=r(o[a],o[u]) +if(0!==l)return l +switch(a){case"boolean":case"number":return r(e,s) +case"string":return r(e.localeCompare(s),0) +case"array":for(var c=e.length,p=s.length,h=Math.min(c,p),f=0;fn})}function h(e,n){return t.computed(e,function(){return t.get(this,e)>=n})}function f(e,n){return t.computed(e,function(){return t.get(this,e)=0)return o[a] +if(Array.isArray(e)){if(s=e.slice(),t)for(a=s.length;--a>=0;)s[a]=i(s[a],t,n,o)}else if(r.default&&r.default.detect(e))s=e.copy(t,n,o) +else if(e instanceof Date)s=new Date(e.getTime()) +else{s={} +for(u in e)Object.prototype.hasOwnProperty.call(e,u)&&"__"!==u.substring(0,2)&&(s[u]=t?i(e[u],t,n,o):e[u])}return t&&(n.push(e),o.push(s)),s}function o(e,t){return"object"!=typeof e||null===e?e:r.default&&r.default.detect(e)?e.copy(t):i(e,t,t?[]:null,t?[]:null)}e.default=o}),s("ember-runtime/ext/function",["exports","ember-environment","ember-metal"],function(e,t,n){"use strict" +var r=Array.prototype.slice,i=Function.prototype +t.ENV.EXTEND_PROTOTYPES.Function&&(i.property=function(){var e=n.computed(this) +return e.property.apply(e,arguments)},i.observes=function(){for(var e=arguments.length,t=Array(e),r=0;r1?n-1:0),i=1;i=0&&r>=0&&n.get(e,"hasEnumerableObservers")){o=[],s=t+r +for(var a=t;a=0&&i>=0&&n.get(e,"hasEnumerableObservers")){o=[] +for(var s=t+i,a=t;a=n.get(this,"length")))return n.get(this,e)},h.objectsAt=function(e){var t=this +return e.map(function(e){return u(t,e)})},h.nextObject=function(e){return u(this,e)},h["[]"]=n.computed({get:function(e){return this},set:function(e,t){return this.replace(0,n.get(this,"length"),t),this}}),h.firstObject=n.computed(function(){return u(this,0)}).readOnly(),h.lastObject=n.computed(function(){return u(this,n.get(this,"length")-1)}).readOnly(),h.contains=function(e){return this.indexOf(e)>=0},h.slice=function(e,t){var r=n.default.A(),i=n.get(this,"length") +for(n.isNone(e)&&(e=0),(n.isNone(t)||t>i)&&(t=i),e<0&&(e=i+e),t<0&&(t=i+t);e=r)&&(t=r-1),t<0&&(t+=r) +for(var i=t;i>=0;i--)if(u(this,i)===e)return i +return-1},h.addArrayObserver=function(e,t){return s(this,e,t)},h.removeArrayObserver=function(e,t){return a(this,e,t)},h.hasArrayObservers=n.computed(function(){return n.hasListeners(this,"@array:change")||n.hasListeners(this,"@array:before")}),h.arrayContentWillChange=function(e,t,n){return l(this,e,t,n)},h.arrayContentDidChange=function(e,t,n){return c(this,e,t,n)},h["@each"]=n.computed(function(){return this.__each||(this.__each=new i.default(this)),this.__each}).volatile().readOnly(),h)) +m.reopen({includes:function(e,t){var r=n.get(this,"length") +void 0===t&&(t=0),t<0&&(t+=r) +for(var i=t;i1?t-1:0),r=1;r1?n-1:0),i=1;i=t.get(e,"length"))throw new t.Error(s) +void 0===r&&(r=1),e.replace(n,r,a)}return e}e.removeAt=o +var s="Index out of range",a=[] +e.default=t.Mixin.create(n.default,r.default,{replace:null,clear:function(){var e=t.get(this,"length") +return 0===e?this:(this.replace(0,e,a),this)},insertAt:function(e,n){if(e>t.get(this,"length"))throw new t.Error(s) +return this.replace(e,0,[n]),this},removeAt:function(e,t){return o(this,e,t)},pushObject:function(e){return this.insertAt(t.get(this,"length"),e),e},pushObjects:function(e){if(!i.default.detect(e)&&!Array.isArray(e))throw new TypeError("Must pass Ember.Enumerable to Ember.MutableArray#pushObjects") +return this.replace(t.get(this,"length"),0,e),this},popObject:function(){var e=t.get(this,"length") +if(0===e)return null +var r=n.objectAt(this,e-1) +return this.removeAt(e-1,1),r},shiftObject:function(){if(0===t.get(this,"length"))return null +var e=n.objectAt(this,0) +return this.removeAt(0),e},unshiftObject:function(e){return this.insertAt(0,e),e},unshiftObjects:function(e){return this.replace(0,0,e),this},reverseObjects:function(){var e=t.get(this,"length") +if(0===e)return this +var n=this.toArray().reverse() +return this.replace(0,e,n),this},setObjects:function(e){if(0===e.length)return this.clear() +var n=t.get(this,"length") +return this.replace(0,n,e),this},removeObject:function(e){for(var r=t.get(this,"length")||0;--r>=0;){var i=n.objectAt(this,r) +i===e&&this.removeAt(r)}return this},addObject:function(e){var t=void 0 +return t=this.includes(e),t||this.pushObject(e),this}})}),s("ember-runtime/mixins/mutable_enumerable",["exports","ember-runtime/mixins/enumerable","ember-metal"],function(e,t,n){"use strict" +e.default=n.Mixin.create(t.default,{addObject:null,addObjects:function(e){var t=this +return n.beginPropertyChanges(this),e.forEach(function(e){return t.addObject(e)}),n.endPropertyChanges(this),this},removeObject:null,removeObjects:function(e){n.beginPropertyChanges(this) +for(var t=e.length-1;t>=0;t--)this.removeObject(e[t]) +return n.endPropertyChanges(this),this}})}),s("ember-runtime/mixins/observable",["exports","ember-metal"],function(e,t){"use strict" +e.default=t.Mixin.create({get:function(e){return t.get(this,e)},getProperties:function(){for(var e=arguments.length,n=Array(e),r=0;rt.get(this,"content.length"))throw new t.Error(u) +return this._replace(e,0,[n]),this},insertAt:function(e,n){if(t.get(this,"arrangedContent")===t.get(this,"content"))return this._insertAt(e,n) +throw new t.Error("Using insertAt on an arranged ArrayProxy is not allowed.")},removeAt:function(e,n){if("number"==typeof e){var r=t.get(this,"content"),i=t.get(this,"arrangedContent"),o=[] +if(e<0||e>=t.get(this,"length"))throw new t.Error(u) +void 0===n&&(n=1) +for(var a=e;a0&&(e=[arguments[0]]),this.__defineNonEnumerable(t.GUID_KEY_PROPERTY) +var o=n.meta(this),s=o.proto +if(o.proto=this,e){var a=e +e=null +for(var u=this.concatenatedProperties,c=this.mergedProperties,p=0;p0&&u.indexOf(g)>=0){var _=this[g] +v=_?"function"==typeof _.concat?_.concat(v):t.makeArray(_).concat(v):t.makeArray(v)}if(c&&c.length&&c.indexOf(g)>=0){var w=this[g] +v=t.assign({},w,v)}b?b.set(this,g,v):"function"!=typeof this.setUnknownProperty||g in this?this[g]=v:this.setUnknownProperty(g,v)}}}l(this,o),this.init.apply(this,arguments),this[h](),o.proto=s,n.finishChains(this),n.sendEvent(this,"init")} +return i.toString=n.Mixin.prototype.toString,i.willReopen=function(){r&&(i.PrototypeMixin=n.Mixin.create(i.PrototypeMixin)),r=!1},i._initProperties=function(t){e=t},i.proto=function(){var e=i.superclass +return e&&e.proto(),r||(r=!0,i.PrototypeMixin.applyPartial(i.prototype)),this.prototype},i}var s,a=n.run.schedule,u=n.Mixin._apply,l=n.Mixin.finishPartial,c=n.Mixin.prototype.reopen,p=!1,h=t.symbol("POST_INIT") +e.POST_INIT=h +var f=o() +f.toString=function(){return"Ember.CoreObject"},f.PrototypeMixin=n.Mixin.create((s={reopen:function(){for(var e=arguments.length,t=Array(e),n=0;n" +return r},s)),f.PrototypeMixin.ownerConstructor=f,f.__super__=null +var m={ClassMixin:n.REQUIRED,PrototypeMixin:n.REQUIRED,isClass:!0,isMethod:!1,extend:function(){var e,r=o() +return r.ClassMixin=n.Mixin.create(this.ClassMixin),r.PrototypeMixin=n.Mixin.create(this.PrototypeMixin),r.ClassMixin.ownerConstructor=r,r.PrototypeMixin.ownerConstructor=r,c.apply(r.PrototypeMixin,arguments),r.superclass=this,r.__super__=this.prototype,e=r.prototype=Object.create(this.prototype),e.constructor=r,t.generateGuid(e),n.meta(e).proto=e,r.ClassMixin.apply(r),r},create:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r0&&this._initProperties(n),new e},reopen:function(){return this.willReopen(),c.apply(this.PrototypeMixin,arguments),this},reopenClass:function(){return c.apply(this.ClassMixin,arguments),u(this,arguments,!1),this},detect:function(e){if("function"!=typeof e)return!1 +for(;e;){if(e===this)return!0 +e=e.superclass}return!1},detectInstance:function(e){return e instanceof this},metaForProperty:function(e){var t=this.proto(),n=t[e],r=null!==n&&"object"==typeof n&&n.isDescriptor?n:void 0 +return r._meta||{}},_computedProperties:n.computed(function(){p=!0 +var e,t=this.proto(),n=[] +for(var r in t)e=t[r],e&&e.isDescriptor&&n.push({name:r,meta:e._meta}) +return n}).readOnly(),eachComputedProperty:function(e,t){for(var r,i={},o=n.get(this,"_computedProperties"),s=0;s=o;){var a=r.objectAt(e,s) +a&&(n._addBeforeObserver(a,t,i,"contentKeyWillChange"),n.addObserver(a,t,i,"contentKeyDidChange"))}}function s(e,t,i,o,s){for(;--s>=o;){var a=r.objectAt(e,s) +a&&(n._removeBeforeObserver(a,t,i,"contentKeyWillChange"),n.removeObserver(a,t,i,"contentKeyDidChange"))}}e.default=i,i.prototype={__defineNonEnumerable:function(e){this[e.name]=e.descriptor.value},arrayWillChange:function(e,t,r,i){var o=this._keys,a=r>0?t+r:-1 +for(var u in o)a>0&&s(e,u,this,t,a),n.propertyWillChange(this,u)},arrayDidChange:function(e,t,r,i){var s=this._keys,a=i>0?t+i:-1 +for(var u in s)a>0&&o(e,u,this,t,a),n.propertyDidChange(this,u)},willWatchProperty:function(e){this.beginObservingContentKey(e)},didUnwatchProperty:function(e){this.stopObservingContentKey(e)},beginObservingContentKey:function(e){var r=this._keys +if(r||(r=this._keys=new t.EmptyObject),r[e])r[e]++ +else{r[e]=1 +var i=this._content,s=n.get(i,"length") +o(i,e,this,0,s)}},stopObservingContentKey:function(e){var t=this._keys +if(t&&t[e]>0&&--t[e]<=0){var r=this._content,i=n.get(r,"length") +s(r,e,this,0,i)}},contentKeyWillChange:function(e,t){n.propertyWillChange(this,t)},contentKeyDidChange:function(e,t){n.propertyDidChange(this,t)}}}),s("ember-runtime/system/lazy_load",["exports","ember-environment"],function(e,t){"use strict" +function n(e,t){var n=o[e] +i[e]=i[e]||[],i[e].push(t),n&&t(n)}function r(e,n){o[e]=n +var r=t.environment.window +if(r&&"function"==typeof CustomEvent){var s=new CustomEvent(e,{detail:n,name:e}) +r.dispatchEvent(s)}i[e]&&i[e].forEach(function(e){return e(n)})}e.onLoad=n,e.runLoadHooks=r +var i=t.ENV.EMBER_LOAD_HOOKS||{},o={},s=o +e._loaded=s}),s("ember-runtime/system/namespace",["exports","ember-utils","ember-metal","ember-environment","ember-runtime/system/object"],function(e,t,n,r,i){"use strict" +function o(){return d}function s(e){d=!!e}function a(e,r,i){var o=e.length +v[e.join(".")]=r +for(var s in r)if(y.call(r,s)){var u=r[s] +if(e[o]=s,u&&u.toString===h&&!u[n.NAME_KEY])u[n.NAME_KEY]=e.join(".") +else if(u&&u.isNamespace){if(i[t.guidFor(u)])continue +i[t.guidFor(u)]=!0,a(e,u,i)}}e.length=o}function u(e){return e>=65&&e<=90}function l(e,t){try{var n=e[t] +return n&&n.isNamespace&&n}catch(e){}}function c(){if(!g.PROCESSED)for(var e=r.context.lookup,t=Object.keys(e),i=0;i2){i=new Array(arguments.length-1) +for(var o=1;o2)&&(t=Array.prototype.slice.call(arguments,1)),e=i.get(e)||e,o(e,t)}function u(e){return e.split(/\s+/)}function l(e){return N.get(e)}function c(e){return g.get(e)}function p(e){return b.get(e)}function h(e){return O.get(e)}function f(e){return C.get(e)}function m(e){return k.get(e)}var d=/[ _]/g,g=new t.Cache(1e3,function(e){return l(e).replace(d,"-")}),v=/(\-|\_|\.|\s)+(.)?/g,y=/(^|\/)([A-Z])/g,b=new t.Cache(1e3,function(e){return e.replace(v,function(e,t,n){return n?n.toUpperCase():""}).replace(y,function(e,t,n){return e.toLowerCase()})}),_=/^(\-|_)+(.)?/,w=/(.)(\-|\_|\.|\s)+(.)?/g,E=/(^|\/|\.)([a-z])/g,O=new t.Cache(1e3,function(e){for(var t=function(e,t,n){return n?"_"+n.toUpperCase():""},n=function(e,t,n,r){return t+(r?r.toUpperCase():"")},r=e.split("/"),i=0;i-1 +return e?function(e){return o.test(s.call(e))}:function(){return!0}}() +e.checkHasSuper=a,t.__hasSuper=!1}),s("ember-utils/symbol",["exports","ember-utils/guid","ember-utils/intern"],function(e,t,n){"use strict" +function r(e){var r=t.GUID_KEY+Math.floor(Math.random()*new Date) +return n.default("__"+e+"__ [id="+r+"]")}e.default=r}),s("ember-utils/to-string",["exports"],function(e){"use strict" +function t(e){return e&&e.toString?e.toString():n.call(e)}e.default=t +var n=Object.prototype.toString}),s("ember-views/compat/attrs",["exports","ember-utils"],function(e,t){"use strict" +var n=t.symbol("MUTABLE_CELL") +e.MUTABLE_CELL=n}),s("ember-views/compat/fallback-view-registry",["exports","ember-utils"],function(e,t){"use strict" +e.default=t.dictionary(null)}),s("ember-views/component_lookup",["exports","ember-metal","ember-runtime"],function(e,t,n){"use strict" +e.default=n.Object.extend({componentFor:function(e,t,n){var r="component:"+e +return t._lookupFactory(r,n)},layoutFor:function(e,t,n){var r="template:components/"+e +return t.lookup(r,n)}})}),s("ember-views/index",["exports","ember-views/system/ext","ember-views/system/jquery","ember-views/system/utils","ember-views/system/event_dispatcher","ember-views/component_lookup","ember-views/mixins/text_support","ember-views/views/core_view","ember-views/mixins/class_names_support","ember-views/mixins/child_views_support","ember-views/mixins/view_state_support","ember-views/mixins/view_support","ember-views/mixins/action_support","ember-views/compat/attrs","ember-views/system/lookup_partial","ember-views/utils/lookup-component","ember-views/system/action_manager","ember-views/compat/fallback-view-registry"],function(e,t,n,r,i,o,s,a,u,l,c,p,h,f,m,d,g,v){"use strict" +e.jQuery=n.default,e.isSimpleClick=r.isSimpleClick,e.getViewBounds=r.getViewBounds,e.getViewClientRects=r.getViewClientRects,e.getViewBoundingClientRect=r.getViewBoundingClientRect,e.getRootViews=r.getRootViews,e.getChildViews=r.getChildViews,e.getViewId=r.getViewId,e.getViewElement=r.getViewElement,e.setViewElement=r.setViewElement,e.STYLE_WARNING=r.STYLE_WARNING,e.EventDispatcher=i.default,e.ComponentLookup=o.default,e.TextSupport=s.default,e.CoreView=a.default,e.ClassNamesSupport=u.default,e.ChildViewsSupport=l.default,e.ViewStateSupport=c.default,e.ViewMixin=p.default,e.ActionSupport=h.default,e.MUTABLE_CELL=f.MUTABLE_CELL,e.lookupPartial=m.default,e.hasPartial=m.hasPartial,e.lookupComponent=d.default,e.ActionManager=g.default,e.fallbackViewRegistry=v.default}),s("ember-views/mixins/action_support",["exports","ember-utils","ember-metal","ember-views/compat/attrs"],function(e,t,n,r){"use strict" +function i(e,t){return t&&t[r.MUTABLE_CELL]&&(t=t.value),t}e.default=n.Mixin.create({sendAction:function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;o1?t-1:0),i=1;i1 +return!t&&!n}function r(e){var t=e.lookup("-view-registry:main"),n=[] +return Object.keys(t).forEach(function(e){var r=t[e] +null===r.parentView&&n.push(r)}),n}function i(e){return""===e.tagName?t.guidFor(e):e.elementId||t.guidFor(e)}function o(e){return e[y]}function s(e){e[y]=null}function a(e,t){return e[y]=t}function u(e){var n=t.getOwner(e),r=n.lookup("-view-registry:main") +return p(e,r)}function l(e){e[b]=[]}function c(e,t){e[b].push(i(t))}function p(e,t){var n=[],r=[] +return e[b].forEach(function(e){var i=t[e] +!i||i.isDestroying||i.isDestroyed||n.indexOf(e)!==-1||(n.push(e),r.push(i))}),e[b]=n,r}function h(e){return e.renderer.getBounds(e)}function f(e){var t=h(e),n=document.createRange() +return n.setStartBefore(t.firstNode),n.setEndAfter(t.lastNode),n}function m(e){var t=f(e) +return t.getClientRects()}function d(e){var t=f(e) +return t.getBoundingClientRect()}function g(e,t){return _.call(e,t)}e.isSimpleClick=n,e.getRootViews=r,e.getViewId=i,e.getViewElement=o,e.initViewElement=s,e.setViewElement=a,e.getChildViews=u,e.initChildViews=l,e.addChildView=c,e.collectChildViews=p,e.getViewBounds=h,e.getViewRange=f,e.getViewClientRects=m,e.getViewBoundingClientRect=d,e.matches=g +var v="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." +e.STYLE_WARNING=v +var y=t.symbol("VIEW_ELEMENT"),b=t.symbol("CHILD_VIEW_IDS"),_="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector) +e.elMatches=_}),s("ember-views/utils/lookup-component",["exports","container"],function(e,t){"use strict" +function n(e,n,r,o){var s=e.componentFor(r,n,o),a=e.layoutFor(r,n,o),u={layout:a,component:s} +return a&&!s&&(u.component=n._lookupFactory(t.privatize(i))),u}function r(e,t,r){var i=e.lookup("component-lookup:main"),o=r&&r.source +if(o){var s=n(i,e,t,r) +if(s.component||s.layout)return s}return n(i,e,t)}e.default=r +var i=c.taggedTemplateLiteralLoose(["component:-default"],["component:-default"])}),s("ember-views/views/core_view",["exports","ember-runtime","ember-views/system/utils","ember-views/views/states"],function(e,t,n,r){"use strict" +var i=t.FrameworkObject.extend(t.Evented,t.ActionHandler,{isView:!0,_states:r.cloneStates(r.states),init:function(){if(this._super.apply(this,arguments),this._state="preRender",this._currentState=this._states.preRender,n.initViewElement(this),!this.renderer)throw new Error("Cannot instantiate a component without a renderer. Please ensure that you are creating "+this+" with a proper container/registry.")},parentView:null,instrumentDetails:function(e){return e.object=this.toString(),e.containerKey=this._debugContainerKey,e.view=this,e},trigger:function(){this._super.apply(this,arguments) +var e=arguments[0],t=this[e] +if(t){for(var n=new Array(arguments.length-1),r=1;r1?r-1:0),o=1;o]+) [^\/>]*\/>/gi,function(e,t){return e.slice(0,e.length-3)+">"})),e}function n(e,n){var r=t(e.innerHTML) +QUnit.push(r===n,r,n)}e.default=n +var r=function(){if(!document.createElementNS)return!1 +var e=document.createElement("div"),t=document.createElementNS("http://www.w3.org/2000/svg","svg") +e.appendChild(t) +var n=e.cloneNode(!0) +return''===n.innerHTML}()}),s("internal-test-helpers/equal-tokens",["exports","simple-html-tokenizer"],function(e,t){"use strict" +function n(e){return"string"==typeof e?{tokens:t.tokenize(e),html:e}:{tokens:t.tokenize(e.innerHTML),html:e.innerHTML}}function r(e){e.forEach(function(e){"StartTag"===e.type&&(e.attributes=e.attributes.sort(function(e,t){return e[0]>t[0]?1:e[0]"},e.create=n,e.extend=o,e.reopen=o,e.reopenClass=i,e}e.default=n +var r=0}),s("internal-test-helpers/index",["exports","internal-test-helpers/factory","internal-test-helpers/build-owner","internal-test-helpers/confirm-export","internal-test-helpers/equal-inner-html","internal-test-helpers/equal-tokens","internal-test-helpers/module-for","internal-test-helpers/strip","internal-test-helpers/apply-mixins","internal-test-helpers/matchers","internal-test-helpers/run","internal-test-helpers/test-groups","internal-test-helpers/test-cases/abstract","internal-test-helpers/test-cases/abstract-application","internal-test-helpers/test-cases/application","internal-test-helpers/test-cases/query-param","internal-test-helpers/test-cases/abstract-rendering","internal-test-helpers/test-cases/rendering"],function(e,t,n,r,i,o,s,a,u,l,c,p,h,f,m,d,g,v){"use strict" +e.factory=t.default,e.buildOwner=n.default,e.confirmExport=r.default,e.equalInnerHTML=i.default,e.equalTokens=o.default,e.moduleFor=s.default,e.strip=a.default,e.applyMixins=u.default,e.equalsElement=l.equalsElement,e.classes=l.classes,e.styles=l.styles,e.regex=l.regex,e.runAppend=c.runAppend,e.runDestroy=c.runDestroy,e.testBoth=p.testBoth,e.testWithDefault=p.testWithDefault,e.AbstractTestCase=h.default,e.AbstractApplicationTestCase=f.default,e.ApplicationTestCase=m.default,e.QueryParamTestCase=d.default,e.AbstractRenderingTestCase=g.default,e.RenderingTestCase=v.default}),s("internal-test-helpers/matchers",["exports"],function(e){"use strict" +function t(e){return"object"==typeof e&&null!==e&&u in e}function n(e){var t +return t={},t[u]=!0,t.match=function(t){return e===t},t.expected=function(){return e},t.message=function(){return"should equal "+this.expected()},t}function r(e){var t +return t={},t[u]=!0,t.match=function(t){return e.test(t)},t.expected=function(){return e.toString()},t.message=function(){return"should match "+this.expected()},t}function i(e){var t +return t={},t[u]=!0,t.match=function(t){return t=t.trim(),t&&e.split(/\s+/).sort().join(" ")===t.trim().split(/\s+/).sort().join(" ")},t.expected=function(){return e},t.message=function(){return"should match "+this.expected()},t}function o(e){var t +return t={},t[u]=!0,t.match=function(t){return t=t||"",t=t.trim(),e.split(";").map(function(e){return e.trim()}).filter(function(e){return e}).sort().join("; ")===t.split(";").map(function(e){return e.trim()}).filter(function(e){return e}).sort().join("; ")},t.expected=function(){return e},t.message=function(){return"should match "+this.expected()},t}function s(e,r,i,o){QUnit.push(e.tagName===r.toUpperCase(),e.tagName.toLowerCase(),r,"expect tagName to be "+r) +var s={},u=0 +for(var l in i){var c=i[l] +null!==c&&u++ +var p=t(c)?c:n(c) +s[l]=p,QUnit.push(s[l].match(e.getAttribute(l)),e.getAttribute(l),p.expected(),"Element's "+l+" attribute "+p.message())}for(var h={},f=0,m=e.attributes.length;f2?o-2:0),a=2;a1?t-1:0),r=1;re));)n=n.nextSibling +return n},e.prototype.$=function(e){return e?r.jQuery(e,this.element):r.jQuery(this.element)},e.prototype.textValue=function(){return this.$().text()},e.prototype.takeSnapshot=function(){for(var e=this.snapshot=[],t=this.element.firstChild;t;)a(t)||e.push(t),t=t.nextSibling +return e},e.prototype.assertText=function(e){this.assert.strictEqual(this.textValue(),e,"#qunit-fixture content should be: `"+e+"`")},e.prototype.assertInnerHTML=function(e){i.default(this.element,e)},e.prototype.assertHTML=function(e){o.default(this.element,e,"#qunit-fixture content should be: `"+e+"`")},e.prototype.assertElement=function(e,t){var n=t.ElementType,r=void 0===n?l:n,i=t.tagName,o=t.attrs,a=void 0===o?null:o,u=t.content,c=void 0===u?null:u +if(!(e instanceof r))throw new Error("Expecting a "+r.name+", but got "+e) +s.equalsElement(e,i,a,c)},e.prototype.assertComponentElement=function(e,n){var r=n.ElementType,i=void 0===r?l:r,o=n.tagName,a=void 0===o?"div":o,u=n.attrs,c=void 0===u?null:u,p=n.content,h=void 0===p?null:p +c=t.assign({},{id:s.regex(/^ember\d*$/),class:s.classes("ember-view")},c||{}),this.assertElement(e,{ElementType:i,tagName:a,attrs:c,content:h})},e.prototype.assertSameNode=function(e,t){this.assert.strictEqual(e,t,"DOM node stability")},e.prototype.assertInvariants=function(e,t){e=e||this.snapshot,t=t||this.takeSnapshot(),this.assert.strictEqual(t.length,e.length,"Same number of nodes") +for(var n=0;n",after:""},table:{depth:1,before:"",after:"
    "},tbody:{depth:2,before:"",after:"
    "},tfoot:{depth:2,before:"",after:"
    "},thead:{depth:2,before:"",after:"
    "},tr:{depth:3,before:"",after:"
    "}}}),s("glimmer-runtime/lib/compat/svg-inner-html-fix",["exports","glimmer-runtime/lib/bounds","glimmer-runtime/lib/dom/helper"],function(e,t,n){"use strict" +function r(e,t,n){if(!e)return t +if(!s(e,n))return t +var r=e.createElement("div") +return function(e){function t(){e.apply(this,arguments)}return c.inherits(t,e),t.prototype.insertHTMLBefore=function(t,i,s){return null===s||""===s?e.prototype.insertHTMLBefore.call(this,t,i,s):t.namespaceURI!==n?e.prototype.insertHTMLBefore.call(this,t,i,s):o(t,r,s,i)},t}(t)}function i(e,t,n){if(!e)return t +if(!s(e,n))return t +var r=e.createElement("div") +return function(e){function t(){e.apply(this,arguments)}return c.inherits(t,e),t.prototype.insertHTMLBefore=function(t,i,s){return null===i||""===i?e.prototype.insertHTMLBefore.call(this,t,i,s):t.namespaceURI!==n?e.prototype.insertHTMLBefore.call(this,t,i,s):o(t,r,i,s)},t}(t)}function o(e,r,i,o){var s=""+i+"" +r.innerHTML=s +var a=n.moveNodesBefore(r.firstChild,e,o),u=a[0],l=a[1] +return new t.ConcreteBounds(e,u,l)}function s(e,t){var n=e.createElementNS(t,"svg") +try{n.insertAdjacentHTML("beforeEnd","")}catch(e){}finally{return(1!==n.childNodes.length||n.firstChild.namespaceURI!==a)&&(n=null,!0)}}e.domChanges=r,e.treeConstruction=i +var a="http://www.w3.org/2000/svg"}),s("glimmer-runtime/lib/compat/text-node-merging-fix",["exports"],function(e){"use strict" +function t(e,t){return e&&r(e)?function(e){function t(t){e.call(this,t),this.uselessComment=t.createComment("")}return c.inherits(t,e),t.prototype.insertHTMLBefore=function(t,n,r){if(null===r)return e.prototype.insertHTMLBefore.call(this,t,n,r) +var i=!1,o=n?n.previousSibling:t.lastChild +o&&o instanceof Text&&(i=!0,t.insertBefore(this.uselessComment,n)) +var s=e.prototype.insertHTMLBefore.call(this,t,n,r) +return i&&t.removeChild(this.uselessComment),s},t}(t):t}function n(e,t){return e&&r(e)?function(e){function t(t){e.call(this,t),this.uselessComment=this.createComment("")}return c.inherits(t,e),t.prototype.insertHTMLBefore=function(t,n,r){if(null===n)return e.prototype.insertHTMLBefore.call(this,t,n,r) +var i=!1,o=r?r.previousSibling:t.lastChild +o&&o instanceof Text&&(i=!0,t.insertBefore(this.uselessComment,r)) +var s=e.prototype.insertHTMLBefore.call(this,t,n,r) +return i&&t.removeChild(this.uselessComment),s},t}(t):t}function r(e){var t=e.createElement("div") +return t.innerHTML="first",t.insertAdjacentHTML("beforeEnd","second"),2===t.childNodes.length?(t=null,!1):(t=null,!0)}e.domChanges=t,e.treeConstruction=n}),s("glimmer-runtime/lib/compiled/blocks",["exports","glimmer-runtime/lib/utils","glimmer-runtime/lib/compiler"],function(e,t,n){"use strict" +var r=function(e,t){this.ops=e,this.symbols=t} +e.CompiledBlock=r +var i=function(e,t){this.program=e,this.symbolTable=t,this.compiled=null} +e.Block=i +var o=function(e){function i(n,r){var i=arguments.length<=2||void 0===arguments[2]?t.EMPTY_ARRAY:arguments[2] +e.call(this,n,r),this.locals=i}return c.inherits(i,e),i.prototype.hasPositionalParameters=function(){return!!this.locals.length},i.prototype.compile=function(e){var t=this.compiled +if(t)return t +var i=new n.InlineBlockCompiler(this,e).compile() +return this.compiled=new r(i,this.symbolTable.size)},i}(i) +e.InlineBlock=o +var s=function(e){function t(){e.apply(this,arguments)}return c.inherits(t,e),t}(o) +e.PartialBlock=s +var a=function(e){function t(){e.apply(this,arguments)}return c.inherits(t,e),t}(i) +e.TopLevelTemplate=a +var u=function(e){function t(){e.apply(this,arguments)}return c.inherits(t,e),t.prototype.compile=function(e){var t=this.compiled +if(t)return t +var i=new n.EntryPointCompiler(this,e).compile() +return this.compiled=new r(i,this.symbolTable.size)},t}(a) +e.EntryPoint=u +var l=function(e){function t(t,n,r,i,o){e.call(this,t,n),this.named=r,this.yields=i,this.hasPartials=o,this.hasNamedParameters=!!this.named.length,this.hasYields=!!this.yields.length}return c.inherits(t,e),t}(a) +e.Layout=l}),s("glimmer-runtime/lib/compiled/expressions",["exports"],function(e){"use strict" +var t=function(){function e(){}return e.prototype.toJSON=function(){return"UNIMPL: "+this.type.toUpperCase()},e}() +e.CompiledExpression=t}),s("glimmer-runtime/lib/compiled/expressions/args",["exports","glimmer-runtime/lib/compiled/expressions/positional-args","glimmer-runtime/lib/compiled/expressions/named-args","glimmer-runtime/lib/syntax/core","glimmer-reference"],function(e,t,n,r,i){"use strict" +var o=function(){function e(e,t,n){this.positional=e,this.named=t,this.blocks=n}return e.create=function(e,i,o){return e===t.COMPILED_EMPTY_POSITIONAL_ARGS&&i===n.COMPILED_EMPTY_NAMED_ARGS&&o===r.EMPTY_BLOCKS?this.empty():new this(e,i,o)},e.empty=function(){return s},e.prototype.evaluate=function(e){var t=this.positional,n=this.named,r=this.blocks +return a.create(t.evaluate(e),n.evaluate(e),r)},e}() +e.CompiledArgs=o +var s=new(function(e){function i(){e.call(this,t.COMPILED_EMPTY_POSITIONAL_ARGS,n.COMPILED_EMPTY_NAMED_ARGS,r.EMPTY_BLOCKS)}return c.inherits(i,e),i.prototype.evaluate=function(e){return u},i}(o)),a=function(){function e(e,t,n){this.positional=e,this.named=t,this.blocks=n,this.tag=i.combineTagged([e,t])}return e.empty=function(){return u},e.create=function(e,t,n){return new this(e,t,n)},e.positional=function(e){var i=arguments.length<=1||void 0===arguments[1]?r.EMPTY_BLOCKS:arguments[1] +return new this(t.EvaluatedPositionalArgs.create(e),n.EVALUATED_EMPTY_NAMED_ARGS,i)},e.named=function(e){var i=arguments.length<=1||void 0===arguments[1]?r.EMPTY_BLOCKS:arguments[1] +return new this(t.EVALUATED_EMPTY_POSITIONAL_ARGS,n.EvaluatedNamedArgs.create(e),i)},e}() +e.EvaluatedArgs=a +var u=new a(t.EVALUATED_EMPTY_POSITIONAL_ARGS,n.EVALUATED_EMPTY_NAMED_ARGS,r.EMPTY_BLOCKS) +e.CompiledPositionalArgs=t.CompiledPositionalArgs,e.EvaluatedPositionalArgs=t.EvaluatedPositionalArgs,e.CompiledNamedArgs=n.CompiledNamedArgs,e.EvaluatedNamedArgs=n.EvaluatedNamedArgs}),s("glimmer-runtime/lib/compiled/expressions/concat",["exports","glimmer-reference"],function(e,t){"use strict" +function n(e){return"function"!=typeof e.toString?"":String(e)}var r=function(){function e(e){this.parts=e,this.type="concat"}return e.prototype.evaluate=function(e){for(var t=new Array(this.parts.length),n=0;n0?e.join(""):null},r}(t.CachedReference)}),s("glimmer-runtime/lib/compiled/expressions/function",["exports","glimmer-runtime/lib/syntax","glimmer-runtime/lib/compiled/expressions"],function(e,t,n){"use strict" +function r(e){return new i(e)}e.default=r +var i=function(e){function t(t){e.call(this),this.type="function-expression",this.func=t}return c.inherits(t,e),t.prototype.compile=function(e,t,n){return new o(this.func,n)},t}(t.Expression),o=function(e){function t(t,n){e.call(this),this.func=t,this.symbolTable=n,this.type="function",this.func=t}return c.inherits(t,e),t.prototype.evaluate=function(e){var t=this.func,n=this.symbolTable +return t(e,n)},t.prototype.toJSON=function(){var e=this.func +return e.name?"`"+e.name+"(...)`":"`func(...)`"},t}(n.CompiledExpression)}),s("glimmer-runtime/lib/compiled/expressions/has-block",["exports","glimmer-runtime/lib/compiled/expressions","glimmer-runtime/lib/references"],function(e,t,n){"use strict" +var r=function(e){function t(t){e.call(this),this.inner=t,this.type="has-block"}return c.inherits(t,e),t.prototype.evaluate=function(e){var t=this.inner.evaluate(e) +return n.PrimitiveReference.create(!!t)},t.prototype.toJSON=function(){return"has-block("+this.inner.toJSON()+")"},t}(t.CompiledExpression) +e.default=r +var i=function(e){function t(t){e.call(this),this.inner=t,this.type="has-block-params"}return c.inherits(t,e),t.prototype.evaluate=function(e){var t=this.inner.evaluate(e) +return n.PrimitiveReference.create(!!(t&&t.locals.length>0))},t.prototype.toJSON=function(){return"has-block-params("+this.inner.toJSON()+")"},t}(t.CompiledExpression) +e.CompiledHasBlockParams=i +var o=function(){function e(e,t){this.symbol=e,this.debug=t}return e.prototype.evaluate=function(e){return e.scope().getBlock(this.symbol)},e.prototype.toJSON=function(){return"get-block($"+this.symbol+"("+this.debug+"))"},e}() +e.CompiledGetBlockBySymbol=o +var s=function(){function e(e,t){this.symbol=e,this.name=t}return e.prototype.evaluate=function(e){var t=this.symbol,n=this.name,r=e.scope().getPartialArgs(t) +return r.blocks[n]},e.prototype.toJSON=function(){return"get-block($"+this.symbol+"($ARGS)."+this.name+"))"},e}() +e.CompiledInPartialGetBlock=s}),s("glimmer-runtime/lib/compiled/expressions/helper",["exports","glimmer-runtime/lib/compiled/expressions"],function(e,t){"use strict" +var n=function(e){function t(t,n,r,i){e.call(this),this.name=t,this.helper=n,this.args=r,this.symbolTable=i,this.type="helper"}return c.inherits(t,e),t.prototype.evaluate=function(e){var t=this.helper +return t(e,this.args.evaluate(e),this.symbolTable)},t.prototype.toJSON=function(){return"`"+this.name.join(".")+"($ARGS)`"},t}(t.CompiledExpression) +e.default=n}),s("glimmer-runtime/lib/compiled/expressions/lookups",["exports","glimmer-runtime/lib/compiled/expressions","glimmer-reference"],function(e,t,n){"use strict" +var r=function(e){function t(t,n){e.call(this),this.base=t,this.path=n,this.type="lookup"}return c.inherits(t,e),t.create=function(e,t){return 0===t.length?e:new this(e,t)},t.prototype.evaluate=function(e){var t=this.base,r=this.path +return n.referenceFromParts(t.evaluate(e),r)},t.prototype.toJSON=function(){return this.base.toJSON()+"."+this.path.join(".")},t}(t.CompiledExpression) +e.default=r +var i=function(e){function t(){e.apply(this,arguments)}return c.inherits(t,e),t.prototype.evaluate=function(e){return e.getSelf()},t.prototype.toJSON=function(){return"self"},t}(t.CompiledExpression) +e.CompiledSelf=i +var o=function(e){function t(t,n){e.call(this),this.symbol=t,this.debug=n}return c.inherits(t,e),t.prototype.evaluate=function(e){return e.referenceForSymbol(this.symbol)},t.prototype.toJSON=function(){return"$"+this.symbol+"("+this.debug+")"},t}(t.CompiledExpression) +e.CompiledSymbol=o +var s=function(e){function t(t,n){e.call(this),this.symbol=t,this.name=n}return c.inherits(t,e),t.prototype.evaluate=function(e){var t=this.symbol,n=this.name,r=e.scope().getPartialArgs(t) +return r.named.get(n)},t.prototype.toJSON=function(){return"$"+this.symbol+"($ARGS)."+this.name},t}(t.CompiledExpression) +e.CompiledInPartialName=s}),s("glimmer-runtime/lib/compiled/expressions/named-args",["exports","glimmer-runtime/lib/references","glimmer-runtime/lib/utils","glimmer-reference","glimmer-util"],function(e,t,n,r,i){"use strict" +var o=function(){function e(e,t){this.keys=e,this.values=t,this.length=e.length,i.assert(e.length===t.length,"Keys and values do not have the same length")}return e.empty=function(){return s},e.create=function(e){var t=Object.keys(e),n=t.length +if(n>0){for(var r=[],i=0;i"},t}(o)) +e.COMPILED_EMPTY_NAMED_ARGS=s +var a=function(){function e(e,t){var n=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2] +this.keys=e,this.values=t,this._map=n,this.tag=r.combineTagged(t),this.length=e.length,i.assert(e.length===t.length,"Keys and values do not have the same length")}return e.create=function(e){var t=Object.keys(e),n=t.length +if(n>0){for(var r=new Array(n),i=0;i"},t}(i)) +e.COMPILED_EMPTY_POSITIONAL_ARGS=o +var s=function(){function e(e){this.values=e,this.tag=r.combineTagged(e),this.length=e.length}return e.create=function(e){return new this(e)},e.empty=function(){return a},e.prototype.at=function(e){var n=this.values,r=this.length +return e")}var u=function(e){function t(t){e.call(this),this.text=t,this.type="text"}return c.inherits(t,e),t.prototype.evaluate=function(e){e.stack().appendText(this.text)},t.prototype.toJSON=function(){return{guid:this._guid,type:this.type,args:[JSON.stringify(this.text)]}},t}(t.Opcode) +e.TextOpcode=u +var l=function(e){function t(t){e.call(this),this.tag=t,this.type="open-primitive-element"}return c.inherits(t,e),t.prototype.evaluate=function(e){e.stack().openElement(this.tag)},t.prototype.toJSON=function(){return{guid:this._guid,type:this.type,args:[JSON.stringify(this.tag)]}},t}(t.Opcode) +e.OpenPrimitiveElementOpcode=l +var p=function(e){function t(){e.apply(this,arguments),this.type="push-remote-element"}return c.inherits(t,e),t.prototype.evaluate=function(e){var t=e.frame.getOperand(),n=r.isConst(t)?void 0:new r.ReferenceCache(t),i=n?n.peek():t.value() +e.stack().pushRemoteElement(i),n&&e.updateWith(new o.Assert(n))},t.prototype.toJSON=function(){return{guid:this._guid,type:this.type,args:["$OPERAND"]}},t}(t.Opcode) +e.PushRemoteElementOpcode=p +var h=function(e){function t(){e.apply(this,arguments),this.type="pop-remote-element"}return c.inherits(t,e),t.prototype.evaluate=function(e){e.stack().popRemoteElement()},t}(t.Opcode) +e.PopRemoteElementOpcode=h +var f=function(e){function t(t){e.call(this),this.tag=t,this.type="open-component-element"}return c.inherits(t,e),t.prototype.evaluate=function(e){e.stack().openElement(this.tag,new y(e.env))},t.prototype.toJSON=function(){return{guid:this._guid,type:this.type,args:[JSON.stringify(this.tag)]}},t}(t.Opcode) +e.OpenComponentElementOpcode=f +var m=function(e){function t(){e.apply(this,arguments),this.type="open-dynamic-primitive-element"}return c.inherits(t,e),t.prototype.evaluate=function(e){var t=e.frame.getOperand().value() +e.stack().openElement(t)},t.prototype.toJSON=function(){return{guid:this._guid,type:this.type,args:["$OPERAND"]}},t}(t.Opcode) +e.OpenDynamicPrimitiveElementOpcode=m +var d=function(){function e(){this.list=null,this.isConst=!0}return e.prototype.append=function(e){var t=this.list,n=this.isConst +null===t&&(t=this.list=[]),t.push(e),this.isConst=n&&r.isConst(e)},e.prototype.toReference=function(){var e=this.list,t=this.isConst +return e?t?i.PrimitiveReference.create(s(e)):new g(e):i.NULL_REFERENCE},e}(),g=function(e){function t(t){e.call(this),this.list=[],this.tag=r.combineTagged(t),this.list=t}return c.inherits(t,e),t.prototype.compute=function(){return s(this.list)},t}(r.CachedReference),v=function(){function e(e){this.env=e,this.opcodes=null,this.classList=null}return e.prototype.addStaticAttribute=function(e,t,n){"class"===t?this.addClass(i.PrimitiveReference.create(n)):this.env.getAppendOperations().setAttribute(e,t,n)},e.prototype.addStaticAttributeNS=function(e,t,n,r){this.env.getAppendOperations().setAttribute(e,n,r,t)},e.prototype.addDynamicAttribute=function(e,t,n,r){if("class"===t)this.addClass(n) +else{var i=this.env.attributeFor(e,t,r),o=new C(e,i,t,n) +this.addAttribute(o)}},e.prototype.addDynamicAttributeNS=function(e,t,n,r,i){var o=this.env.attributeFor(e,n,i,t),s=new C(e,o,n,r,t) +this.addAttribute(s)},e.prototype.flush=function(e,t){for(var n=t.env,r=this.opcodes,i=this.classList,o=0;r&&o.')},t.prototype.valueSyntax=function(){return B.build(this.value)},t}(t.Argument) +e.StaticArg=S +var x=function(e){function t(t,n){var r=arguments.length<=2||void 0===arguments[2]?null:arguments[2] +e.call(this),this.name=t,this.value=n,this.namespace=r,this.type="dynamic-arg"}return c.inherits(t,e),t.fromSpec=function(e){var n=e[1],r=e[2] +return new t(n,a.default(r))},t.build=function(e,t){return new this(e,t)},t.prototype.compile=function(){throw new Error('Cannot compile DynamicArg for "'+this.name+'" as it is delegate for ExpressionSyntax.')},t.prototype.valueSyntax=function(){return this.value},t}(t.Argument) +e.DynamicArg=x +var C=function(){function e(){}return e.fromSpec=function(e){var t=e[1],n=e[2],r=e[3] +return new k(t,a.default(n),r,!0)},e.build=function(e,t,n){var r=arguments.length<=3||void 0===arguments[3]?null:arguments[3] +return new k(e,t,r,n)},e.prototype.compile=function(){throw new Error("Attempting to compile a TrustingAttr which is just a delegate for DynamicAttr.")},e}() +e.TrustingAttr=C +var A=function(e){function t(t,n,r){e.call(this),this.name=t,this.value=n,this.namespace=r,this["e1185d30-7cac-4b12-b26a-35327d905d92"]=!0,this.type="static-attr",this.isTrusting=!1}return c.inherits(t,e),t.fromSpec=function(e){var n=e[1],r=e[2],i=e[3] +return new t(n,r,i)},t.build=function(e,t){var n=arguments.length<=2||void 0===arguments[2]?null:arguments[2] +return new this(e,t,n)},t.prototype.compile=function(e){e.append(new s.StaticAttrOpcode(this.namespace,this.name,this.value))},t.prototype.valueSyntax=function(){return B.build(this.value)},t}(t.Attribute) +e.StaticAttr=A +var k=function(e){function t(t,n,r,i){void 0===r&&(r=void 0),e.call(this),this.name=t,this.value=n,this.namespace=r,this.isTrusting=i,this["e1185d30-7cac-4b12-b26a-35327d905d92"]=!0,this.type="dynamic-attr"}return c.inherits(t,e),t.fromSpec=function(e){var n=e[1],r=e[2],i=e[3] +return new t(n,a.default(r),i)},t.build=function(e,t){var n=!(arguments.length<=2||void 0===arguments[2])&&arguments[2],r=arguments.length<=3||void 0===arguments[3]?null:arguments[3] +return new this(e,t,r,n)},t.prototype.compile=function(e,t,n){var r=this.namespace,o=this.value +e.append(new i.PutValueOpcode(o.compile(e,t,n))),r?e.append(new s.DynamicAttrNSOpcode(this.name,this.namespace,this.isTrusting)):e.append(new s.DynamicAttrOpcode(this.name,this.isTrusting))},t.prototype.valueSyntax=function(){return this.value},t}(t.Attribute) +e.DynamicAttr=k +var T=function(e){function t(){e.apply(this,arguments),this.type="flush-element"}return c.inherits(t,e),t.fromSpec=function(){return new t},t.build=function(){return new this},t.prototype.compile=function(e){e.append(new s.FlushElementOpcode)},t}(t.Statement) +e.FlushElement=T +var N=function(e){function t(){e.apply(this,arguments),this.type="close-element"}return c.inherits(t,e),t.fromSpec=function(){return new t},t.build=function(){return new this},t.prototype.compile=function(e){e.append(new s.CloseElementOpcode)},t}(t.Statement) +e.CloseElement=N +var R=function(e){function t(t){e.call(this),this.content=t,this.type="text"}return c.inherits(t,e),t.fromSpec=function(e){var n=e[1] +return new t(n)},t.build=function(e){return new this(e)},t.prototype.compile=function(e){e.text(this.content)},t}(t.Statement) +e.Text=R +var P=function(e){function t(t){e.call(this),this.comment=t,this.type="comment"}return c.inherits(t,e),t.fromSpec=function(e){var n=e[1] +return new t(n)},t.build=function(e){return new this(e)},t.prototype.compile=function(e){e.comment(this.comment)},t}(t.Statement) +e.Comment=P +var D=function(e){function n(t,n,r){e.call(this),this.tag=t,this.blockParams=n,this.symbolTable=r,this.type="open-element"}return c.inherits(n,e),n.fromSpec=function(e,t){var r=e[1],i=e[2] +return new n(r,i,t)},n.build=function(e,t,n){return new this(e,t,n)},n.prototype.scan=function(e){var t=this.tag +if(e.env.hasComponentDefinition([t],this.symbolTable)){var n=this.parameters(e),r=n.args,i=n.attrs +e.startBlock(this.blockParams),this.tagContents(e) +var o=e.endBlock(this.blockParams) +return r.blocks=Q.fromSpec(o),new I(t,i,r)}return new L(t)},n.prototype.compile=function(e,t){e.append(new s.OpenPrimitiveElementOpcode(this.tag))},n.prototype.toIdentity=function(){var e=this.tag +return new L(e)},n.prototype.parameters=function(e){for(var n=e.next(),r=[],i=[],o=[];!(n instanceof T);){if(n[E])throw new Error("Compile Error: Element modifiers are not allowed in components") +var s=n +if(n[t.ATTRIBUTE])r.push(s.name),i.push(s.name),o.push(s.valueSyntax()) +else{if(!n[t.ARGUMENT])throw new Error("Expected FlushElement, but got ${current}") +i.push(s.name),o.push(s.valueSyntax())}n=e.next()}return{args:$.fromNamedArgs(ee.build(i,o)),attrs:r}},n.prototype.tagContents=function(e){for(var t=1;;){var r=e.next() +if(r instanceof N&&0===--t)break +e.addStatement(r),(r instanceof n||r instanceof L)&&t++}},n}(t.Statement) +e.OpenElement=D +var I=function(e){function t(t,n,r){e.call(this),this.tag=t,this.attrs=n,this.args=r,this.type="component"}return c.inherits(t,e),t.prototype.compile=function(e,t,n){var r=t.getComponentDefinition([this.tag],n),i=this.args.compile(e,t,n),s=this.attrs +e.append(new o.PutComponentDefinitionOpcode(r)),e.append(new o.OpenComponentOpcode(i,s)),e.append(new o.CloseComponentOpcode)},t}(t.Statement) +e.Component=I +var L=function(e){function t(t){e.call(this),this.tag=t,this.type="open-primitive-element"}return c.inherits(t,e),t.build=function(e){return new this(e)},t.prototype.compile=function(e){e.append(new s.OpenPrimitiveElementOpcode(this.tag))},t}(t.Statement) +e.OpenPrimitiveElement=L +var M=function(e){function t(t,n){e.call(this),this.to=t,this.args=n,this.type="yield"}return c.inherits(t,e),t.fromSpec=function(e){var n=e[1],r=e[2],i=$.fromSpec(r,null,J) +return new t(n,i)},t.build=function(e,t){var n=$.fromPositionalArgs(Z.build(e)) +return new this(t,n)},t.prototype.compile=function(e,t,n){var r=this.to,i=this.args.compile(e,t,n) +if(e.hasBlockSymbol(r)){var o=e.getBlockSymbol(r),s=new h.CompiledGetBlockBySymbol(o,r) +e.append(new F(s,i)),e.append(new U)}else{if(!e.hasPartialArgsSymbol())throw new Error("[BUG] ${to} is not a valid block name.") +var o=e.getPartialArgsSymbol(),s=new h.CompiledInPartialGetBlock(o,r) +e.append(new F(s,i)),e.append(new U)}},t}(t.Statement) +e.Yield=M +var j=function(e){function t(){e.apply(this,arguments)}return c.inherits(t,e),t.fromSpec=function(e){var t=e[1],r=a.default(t) +return v(r)?new n.StaticPartialSyntax(r):new n.DynamicPartialSyntax(r)},t}(t.Statement) +e.Partial=j +var F=function(e){function t(t,n){e.call(this),this.inner=t,this.args=n,this.type="open-block"}return c.inherits(t,e),t.prototype.evaluate=function(e){var t=this.inner.evaluate(e),n=void 0 +t&&(n=this.args.evaluate(e)),e.pushCallerScope(),t&&e.invokeBlock(t,n)},t.prototype.toJSON=function(){return{guid:this._guid,type:this.type,details:{block:this.inner.toJSON(),positional:this.args.positional.toJSON(),named:this.args.named.toJSON()}}},t}(r.Opcode),U=function(e){function t(){e.apply(this,arguments),this.type="close-block"}return c.inherits(t,e),t.prototype.evaluate=function(e){e.popScope()},t}(r.Opcode) +e.CloseBlockOpcode=U +var B=function(e){function t(t){e.call(this),this.value=t,this.type="value"}return c.inherits(t,e),t.fromSpec=function(e){return new t(e)},t.build=function(e){return new this(e)},t.prototype.inner=function(){return this.value},t.prototype.compile=function(e){return new l.default(this.value)},t}(t.Expression) +e.Value=B +var z=function(e){function t(t){e.call(this),this.parts=t,this.type="get-argument"}return c.inherits(t,e),t.fromSpec=function(e){var n=e[1] +return new t(n)},t.build=function(e){return new this(e.split("."))},t.prototype.compile=function(e){var t=this.parts,n=t[0] +if(e.hasNamedSymbol(n)){var r=e.getNamedSymbol(n),i=t.slice(1),o=new p.CompiledSymbol(r,n) +return p.default.create(o,i)}if(e.hasPartialArgsSymbol()){var r=e.getPartialArgsSymbol(),i=t.slice(1),o=new p.CompiledInPartialName(r,n) +return p.default.create(o,i)}throw new Error("[BUG] @"+this.parts.join(".")+" is not a valid lookup path.")},t}(t.Expression) +e.GetArgument=z +var V=function(e){function t(t){e.call(this),this.parts=t,this.type="ref"}return c.inherits(t,e),t.build=function(e){var t=e.split(".") +return"this"===t[0]&&(t[0]=null),new this(t)},t.prototype.compile=function(e){var t=this.parts,n=t[0] +if(null===n){var r=new p.CompiledSelf,i=t.slice(1) +return p.default.create(r,i)}if(e.hasLocalSymbol(n)){var o=e.getLocalSymbol(n),i=t.slice(1),r=new p.CompiledSymbol(o,n) +return p.default.create(r,i)}var r=new p.CompiledSelf +return p.default.create(r,t)},t}(t.Expression) +e.Ref=V +var q=function(e){function t(t){e.call(this),this.ref=t,this.type="get"}return c.inherits(t,e),t.fromSpec=function(e){var t=e[1] +return new this(new V(t))},t.build=function(e){return new this(V.build(e))},t.prototype.compile=function(e){return this.ref.compile(e)},t}(t.Expression) +e.Get=q +var H=function(e){function t(t){e.call(this),this.ref=t,this.type="unknown"}return c.inherits(t,e),t.fromSpec=function(e){var t=e[1] +return new this(new V(t))},t.build=function(e){return new this(V.build(e))},t.prototype.compile=function(e,t,n){var r=this.ref +return t.hasHelper(r.parts,n)?new f.default(r.parts,t.lookupHelper(r.parts,n),u.CompiledArgs.empty(),n):this.ref.compile(e)},t}(t.Expression) +e.Unknown=H +var G=function(e){function t(t,n){e.call(this),this.ref=t,this.args=n,this.type="helper"}return c.inherits(t,e),t.fromSpec=function(e){var n=e[1],r=e[2],i=e[3] +return new t(new V(n),$.fromSpec(r,i,J))},t.build=function(e,t,n){return new this(V.build(e),$.build(t,n,J))},t.prototype.compile=function(e,t,n){if(t.hasHelper(this.ref.parts,n)){var r=this.args,i=this.ref +return new f.default(i.parts,t.lookupHelper(i.parts,n),r.compile(e,t,n),n)}throw new Error("Compile Error: "+this.ref.parts.join(".")+" is not a helper")},t}(t.Expression) +e.Helper=G +var W=function(e){function t(t){e.call(this),this.blockName=t,this.type="has-block"}return c.inherits(t,e),t.fromSpec=function(e){var n=e[1] +return new t(n)},t.build=function(e){return new this(e)},t.prototype.compile=function(e,t){var n=this.blockName +if(e.hasBlockSymbol(n)){var r=e.getBlockSymbol(n),i=new h.CompiledGetBlockBySymbol(r,n) +return new h.default(i)}if(e.hasPartialArgsSymbol()){var r=e.getPartialArgsSymbol(),i=new h.CompiledInPartialGetBlock(r,n) +return new h.default(i)}throw new Error("[BUG] ${blockName} is not a valid block name.")},t}(t.Expression) +e.HasBlock=W +var K=function(e){function t(t){e.call(this),this.blockName=t,this.type="has-block-params"}return c.inherits(t,e),t.fromSpec=function(e){var n=e[1] +return new t(n)},t.build=function(e){return new this(e)},t.prototype.compile=function(e,t){var n=this.blockName +if(e.hasBlockSymbol(n)){var r=e.getBlockSymbol(n),i=new h.CompiledGetBlockBySymbol(r,n) +return new h.CompiledHasBlockParams(i)}if(e.hasPartialArgsSymbol()){var r=e.getPartialArgsSymbol(),i=new h.CompiledInPartialGetBlock(r,n) +return new h.CompiledHasBlockParams(i)}throw new Error("[BUG] ${blockName} is not a valid block name.")},t}(t.Expression) +e.HasBlockParams=K +var Y=function(){function e(e){this.parts=e,this.type="concat"}return e.fromSpec=function(t){var n=t[1] +return new e(n.map(a.default))},e.build=function(e){return new this(e)},e.prototype.compile=function(e,t,n){return new m.default(this.parts.map(function(r){return r.compile(e,t,n)}))},e}() +e.Concat=Y +var Q=function(){function e(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1] +this.type="blocks",this.default=e,this.inverse=t}return e.fromSpec=function(t){var n=arguments.length<=1||void 0===arguments[1]?null:arguments[1] +return new e(t,n)},e.empty=function(){return J},e}() +e.Blocks=Q +var J=new(function(e){function t(){e.call(this,null,null)}return c.inherits(t,e),t}(Q)) +e.EMPTY_BLOCKS=J +var $=function(){function e(e,t,n){this.positional=e,this.named=t,this.blocks=n,this.type="args"}return e.empty=function(){return ne},e.fromSpec=function(t,n,r){return new e(Z.fromSpec(t),ee.fromSpec(n),r)},e.fromPositionalArgs=function(t){var n=arguments.length<=1||void 0===arguments[1]?J:arguments[1] +return new e(t,te,n)},e.fromNamedArgs=function(t){var n=arguments.length<=1||void 0===arguments[1]?J:arguments[1] +return new e(X,t,n)},e.build=function(e,t,n){return e===X&&t===te&&n===J?ne:new this(e,t,n)},e.prototype.compile=function(e,t,n){var r=this.positional,i=this.named,o=this.blocks +return u.CompiledArgs.create(r.compile(e,t,n),i.compile(e,t,n),o)},e}() +e.Args=$ +var Z=function(){function e(e){this.values=e,this.type="positional",this.length=e.length}return e.empty=function(){return X},e.fromSpec=function(t){return t&&0!==t.length?new e(t.map(a.default)):X},e.build=function(e){return 0===e.length?X:new this(e)},e.prototype.slice=function(t,n){return e.build(this.values.slice(t,n))},e.prototype.at=function(e){return this.values[e]},e.prototype.compile=function(e,t,n){return u.CompiledPositionalArgs.create(this.values.map(function(r){return r.compile(e,t,n)}))},e}() +e.PositionalArgs=Z +var X=new(function(e){function t(){e.call(this,d.EMPTY_ARRAY)}return c.inherits(t,e),t.prototype.slice=function(e,t){return this},t.prototype.at=function(e){},t.prototype.compile=function(e,t){return u.CompiledPositionalArgs.empty()},t}(Z)),ee=function(){function e(e,t){this.keys=e,this.values=t,this.type="named",this.length=e.length}return e.empty=function(){return te},e.fromSpec=function(e){if(null===e||void 0===e)return te +var t=e[0],n=e[1] +return 0===t.length?te:new this(t,n.map(function(e){return a.default(e)}))},e.build=function(e,t){return 0===e.length?te:new this(e,t)},e.prototype.at=function(e){var t=this.keys,n=this.values,r=t.indexOf(e) +return n[r]},e.prototype.has=function(e){return this.keys.indexOf(e)!==-1},e.prototype.compile=function(e,t,n){for(var r=this.keys,i=this.values,o=new Array(i.length),s=0;s=this.list.length?null:this.list[e]},e.prototype.min=function(){return this.start},e.prototype.max=function(){return this.end},e}() +e.ListRange=o}),s("glimmer-runtime/lib/vm",["exports","glimmer-runtime/lib/vm/append","glimmer-runtime/lib/vm/update","glimmer-runtime/lib/vm/render-result"],function(e,t,n,r){"use strict" +e.VM=t.default,e.PublicVM=t.PublicVM,e.UpdatingVM=n.default,e.RenderResult=r.default}),s("glimmer-runtime/lib/vm/append",["exports","glimmer-runtime/lib/environment","glimmer-util","glimmer-reference","glimmer-runtime/lib/compiled/opcodes/vm","glimmer-runtime/lib/vm/update","glimmer-runtime/lib/vm/render-result","glimmer-runtime/lib/vm/frame"],function(e,t,n,r,i,o,s,a){"use strict" +var u=function(){function e(e,t,r,i){this.env=e,this.elementStack=i,this.dynamicScopeStack=new n.Stack,this.scopeStack=new n.Stack,this.updatingOpcodeStack=new n.Stack,this.cacheGroups=new n.Stack,this.listBlockStack=new n.Stack,this.frame=new a.FrameStack,this.env=e,this.elementStack=i,this.scopeStack.push(t),this.dynamicScopeStack.push(r)}return e.initial=function(n,r,i,o,s){var a=t.Scope.root(r,s) +return new e(n,a,i,o)},e.prototype.capture=function(){return{env:this.env,scope:this.scope(),dynamicScope:this.dynamicScope(),frame:this.frame.capture()}},e.prototype.goto=function(e){this.frame.goto(e)},e.prototype.beginCacheGroup=function(){this.cacheGroups.push(this.updatingOpcodeStack.current.tail())},e.prototype.commitCacheGroup=function(){var e=new i.LabelOpcode("END"),t=this.updatingOpcodeStack.current,o=this.cacheGroups.pop(),s=o?t.nextNode(o):t.head(),a=t.tail(),u=r.combineSlice(new n.ListSlice(s,a)),l=new i.JumpIfNotModifiedOpcode(u,e) +t.insertBefore(l,s),t.append(new i.DidModifyOpcode(l)),t.append(e)},e.prototype.enter=function(e){var t=new n.LinkedList,r=this.stack().pushUpdatableBlock(),i=this.capture(),s=new o.TryOpcode(e,i,r,t) +this.didEnter(s,t)},e.prototype.enterWithKey=function(e,t){var r=new n.LinkedList,i=this.stack().pushUpdatableBlock(),s=this.capture(),a=new o.TryOpcode(t,s,i,r) +this.listBlockStack.current.map[e]=a,this.didEnter(a,r)},e.prototype.enterList=function(e){var t=new n.LinkedList,r=this.stack().pushBlockList(t),i=this.capture(),s=this.frame.getIterator().artifacts,a=new o.ListBlockOpcode(e,i,r,t,s) +this.listBlockStack.push(a),this.didEnter(a,t)},e.prototype.didEnter=function(e,t){this.updateWith(e),this.updatingOpcodeStack.push(t)},e.prototype.exit=function(){this.stack().popBlock(),this.updatingOpcodeStack.pop() +var e=this.updatingOpcodeStack.current.tail() +e.didInitializeChildren()},e.prototype.exitList=function(){this.exit(),this.listBlockStack.pop()},e.prototype.updateWith=function(e){this.updatingOpcodeStack.current.append(e)},e.prototype.stack=function(){return this.elementStack},e.prototype.scope=function(){return this.scopeStack.current},e.prototype.dynamicScope=function(){return this.dynamicScopeStack.current},e.prototype.pushFrame=function(e,t,n){this.frame.push(e.ops),t&&this.frame.setArgs(t),t&&t.blocks&&this.frame.setBlocks(t.blocks),n&&this.frame.setCallerScope(n)},e.prototype.pushComponentFrame=function(e,t,n,r,i,o){this.frame.push(e.ops,r,i,o),t&&this.frame.setArgs(t),t&&t.blocks&&this.frame.setBlocks(t.blocks),n&&this.frame.setCallerScope(n)},e.prototype.pushEvalFrame=function(e){this.frame.push(e)},e.prototype.pushChildScope=function(){this.scopeStack.push(this.scopeStack.current.child())},e.prototype.pushCallerScope=function(){this.scopeStack.push(this.scope().getCallerScope())},e.prototype.pushDynamicScope=function(){var e=this.dynamicScopeStack.current.child() +return this.dynamicScopeStack.push(e),e},e.prototype.pushRootScope=function(e,n){var r=t.Scope.root(e,n) +return this.scopeStack.push(r),r},e.prototype.popScope=function(){this.scopeStack.pop()},e.prototype.popDynamicScope=function(){this.dynamicScopeStack.pop()},e.prototype.newDestroyable=function(e){this.stack().newDestroyable(e)},e.prototype.getSelf=function(){return this.scope().getSelf()},e.prototype.referenceForSymbol=function(e){return this.scope().getSymbol(e)},e.prototype.getArgs=function(){return this.frame.getArgs()},e.prototype.resume=function(e,t){return this.execute(e,function(e){return e.frame.restore(t)})},e.prototype.execute=function(e,t){n.LOGGER.debug("[VM] Begin program execution") +var r=this.elementStack,i=this.frame,o=this.updatingOpcodeStack,a=this.env +r.pushSimpleBlock(),o.push(new n.LinkedList),i.push(e),t&&t(this) +for(var u=void 0;i.hasOpcodes();)(u=i.nextStatement())&&(n.LOGGER.debug("[VM] OP "+u.type),n.LOGGER.trace(u),u.evaluate(this)) +return n.LOGGER.debug("[VM] Completed program execution"),new s.default(a,o.pop(),r.popBlock())},e.prototype.evaluateOpcode=function(e){e.evaluate(this)},e.prototype.invokeBlock=function(e,t){var n=e.compile(this.env) +this.pushFrame(n,t)},e.prototype.invokePartial=function(e){var t=e.compile(this.env) +this.pushFrame(t)},e.prototype.invokeLayout=function(e,t,n,r,i,o){this.pushComponentFrame(t,e,n,r,i,o)},e.prototype.evaluateOperand=function(e){this.frame.setOperand(e.evaluate(this))},e.prototype.evaluateArgs=function(e){var t=this.frame.setArgs(e.evaluate(this)) +this.frame.setOperand(t.positional.at(0))},e.prototype.bindPositionalArgs=function(e){var t=this.frame.getArgs() +n.assert(t,"Cannot bind positional args") +for(var r=t.positional,i=this.scope(),o=0;o2&&"[]"===s.slice(a-2)&&(u=!0,s=s.slice(0,a-2),n[s]||(n[s]=[])),i=o[1]?O(o[1]):""),u?n[s].push(i):n[s]=i}return n},recognize:function(e){var t,n,r,i,o=[this.rootState],s={},u=!1 +if(i=e.indexOf("#"),i!==-1&&(e=e.substr(0,i)),r=e.indexOf("?"),r!==-1){var l=e.substr(r+1,e.length) +e=e.substr(0,r),s=this.parseQueryString(l)}"/"!==e.charAt(0)&&(e="/"+e) +var c=e +for(T.ENCODE_AND_DECODE_PATH_SEGMENTS?e=a(e):(e=decodeURI(e),c=decodeURI(c)),t=e.length,t>1&&"/"===e.charAt(t-1)&&(e=e.substr(0,t-1),c=c.substr(0,c.length-1),u=!0),n=0;n0&&e[r-1]&&e[r-1].hasOwnProperty("queryParams")?(n=e[r-1].queryParams,t=z.call(e,0,r-1),[t,n]):[e,null]}function s(e){for(var t in e)if("number"==typeof e[t])e[t]=""+e[t] +else if(V(e[t]))for(var n=0,r=e[t].length;n=0;a--){var l=t[a],c=l.handler +if(c){if(c.events&&c.events[o]){if(c.events[o].apply(c,r)!==!0)return +s=!0}}else l.handlerPromise.then(u(null,i,o,r))}if("error"===o&&"UnrecognizedURLError"===r[0].name)throw r[0] +if(!s&&!n)throw new Error("Nothing handled the event '"+o+"'.")}function h(e,t){var n,r={all:{},changed:{},removed:{}} +i(r.all,t) +var o=!1 +s(e),s(t) +for(n in e)e.hasOwnProperty(n)&&(t.hasOwnProperty(n)||(o=!0,r.removed[n]=e[n])) +for(n in t)if(t.hasOwnProperty(n))if(V(e[n])&&V(t[n]))if(e[n].length!==t[n].length)r.changed[n]=t[n],o=!0 +else for(var a=0,u=e[n].length;a=0;--u){var l=o[u] +i(a,l.params),l.handler.inaccessibleByURL&&(n=null)}if(n){a.queryParams=e._visibleQueryParams||t.queryParams +var c=r.recognizer.generate(s,a),p=e.isCausedByInitialTransition,h="replace"===n&&!e.isCausedByAbortingTransition +p||h?r.replaceURL(c):r.updateURL(c)}}}function L(e,t){try{a(e.router,e.sequence,"Resolved all models on destination route; finalizing transition.") +var r=e.router,i=t.handlerInfos +return R(r,t,e),e.isAborted?(r.state.handlerInfos=r.currentHandlerInfos,n.Promise.reject(w(e))):(I(e,t,e.intent.url),e.isActive=!1,r.activeTransition=null,p(r,r.currentHandlerInfos,!0,["didTransition"]),r.didTransition&&r.didTransition(r.currentHandlerInfos),a(r,e.sequence,"TRANSITION COMPLETE."),i[i.length-1].handler)}catch(t){if(!(t instanceof E)){var o=e.state.handlerInfos +e.trigger(!0,"error",t,e,o[o.length-1].handler),e.abort()}throw t}}function M(e,t,n){var r=t[0]||"/",i=t[t.length-1],o={} +i&&i.hasOwnProperty("queryParams")&&(o=J.call(t).queryParams) +var s +if(0===t.length){a(e,"Updating query params") +var u=e.state.handlerInfos +s=new Y({name:u[u.length-1].name,contexts:[],queryParams:o})}else"/"===r.charAt(0)?(a(e,"Attempting URL transition to "+r),s=new Q({url:r})):(a(e,"Attempting transition to "+r),s=new Y({name:t[0],contexts:z.call(t,1),queryParams:o})) +return e.transitionByIntent(s,n)}function j(e,t){if(e.length!==t.length)return!1 +for(var n=0,r=e.length;n=r.length?r.length-1:t.resolveIndex +return n.Promise.reject({error:e,handlerWithError:u.handlerInfos[i].handler,wasAborted:l,state:u})}function o(e){var n=u.handlerInfos[t.resolveIndex].isResolved +if(u.handlerInfos[t.resolveIndex++]=e,!n){var i=e.handler +g(i,"redirect",e.context,t)}return r().then(s,null,u.promiseLabel("Resolve handler"))}function s(){if(t.resolveIndex===u.handlerInfos.length)return{error:null,state:u} +var e=u.handlerInfos[t.resolveIndex] +return e.resolve(r,t).then(o,null,u.promiseLabel("Proceed"))}var a=this.params +c(this.handlerInfos,function(e){a[e.name]=e.params||{}}),t=t||{},t.resolveIndex=0 +var u=this,l=!1 +return n.Promise.resolve(null,this.promiseLabel("Start transition")).then(s,null,this.promiseLabel("Resolve handler")).catch(i,this.promiseLabel("Handle error"))}},b.prototype={targetName:null,urlMethod:"update",intent:null,pivotHandler:null,resolveIndex:0,resolvedModels:null,state:null,queryParamsOnly:!1,isTransition:!0,isExiting:function(e){for(var t=this.handlerInfos,n=0,r=t.length;n=0;--u){var f=t[u],m=f.handler,d=e.handlerInfos[u],g=null +if(f.names.length>0)if(u>=h)g=this.createParamHandlerInfo(m,n,f.names,p,d) +else{var v=a(m) +g=this.getHandlerInfoForDynamicSegment(m,n,f.names,p,d,r,u,v)}else g=this.createParamHandlerInfo(m,n,f.names,p,d) +if(s){g=g.becomeResolved(null,g.context) +var b=d&&d.context +f.names.length>0&&g.context===b&&(g.params=d&&d.params),g.context=b}var _=d;(u>=h||g.shouldSupercede(d))&&(h=Math.min(u,h),_=g),o&&!s&&(_=_.becomeResolved(null,_.context)),c.handlerInfos.unshift(_)}if(p.length>0)throw new Error("More context objects were passed than there are dynamic segments for the route: "+r) +return o||this.invalidateChildren(c.handlerInfos,h),i(c.queryParams,this.queryParams||{}),c},invalidateChildren:function(e,t){for(var n=t,r=e.length;n0){if(u=r[r.length-1],l(u))return this.createParamHandlerInfo(e,t,n,r,i) +r.pop()}else{if(i&&i.name===e)return i +if(!this.preTransitionState)return i +var c=this.preTransitionState.handlerInfos[s] +u=c&&c.context}return C("object",{name:e,getHandler:t,serializer:a,context:u,names:n})},createParamHandlerInfo:function(e,t,n,r,i){for(var o={},s=n.length;s--;){var a=i&&e===i.name&&i.params||{},u=r[r.length-1],c=n[s] +if(l(u))o[c]=""+r.pop() +else{if(!a.hasOwnProperty(c))throw new Error("You didn't provide enough string/numeric parameters to satisfy all of the dynamic segments for route "+e) +o[c]=a[c]}}return C("param",{name:e,getHandler:t,params:o})}}) +A.prototype=q(Error.prototype) +var Q=m(O,{url:null,initialize:function(e){this.url=e.url},applyToState:function(e,t,n){function r(e){if(e&&e.inaccessibleByURL)throw new A(c) +return e}var o,s,a=new y,u=t.recognize(this.url) +if(!u)throw new A(this.url) +var l=!1,c=this.url +for(o=0,s=u.length;o=0&&r;--n){var i=t[n] +e.add(t,{as:i.handler}),r="/"===i.path||""===i.path||".index"===i.handler.slice(-6)}})},hasRoute:function(e){return this.recognizer.hasRoute(e)},getHandler:function(){},getSerializer:function(){},queryParamsTransition:function(e,t,n,r){var i=this +if(N(this,r,e),!t&&this.activeTransition)return this.activeTransition +var o=new b(this) +return o.queryParamsOnly=!0,n.queryParams=F(this,r.handlerInfos,r.queryParams,o),o.promise=o.promise.then(function(e){return I(o,n,!0),i.didTransition&&i.didTransition(i.currentHandlerInfos),e},null,f("Transition complete")),o},transitionByIntent:function(e){try{return T.apply(this,arguments)}catch(t){return new b(this,e,null,t)}},reset:function(){this.state&&c(this.state.handlerInfos.slice().reverse(),function(e){var t=e.handler +g(t,"exit")}),this.oldState=void 0,this.state=new y,this.currentHandlerInfos=null},activeTransition:null,handleURL:function(e){var t=z.call(arguments) +return"/"!==e.charAt(0)&&(t[0]="/"+e),M(this,t).method(null)},updateURL:function(){throw new Error("updateURL is not implemented")},replaceURL:function(e){this.updateURL(e)},transitionTo:function(){return M(this,arguments)},intermediateTransitionTo:function(){return M(this,arguments,!0)},refresh:function(e){for(var t=this.activeTransition?this.activeTransition.state:this.state,n=t.handlerInfos,r={},i=0,o=n.length;i1)throw new Error("Second argument not supported") +if("object"!=typeof e)throw new TypeError("Argument must be an object") +return a.prototype=e,new a},Se=[],xe=void 0,Ce=1,Ae=2,ke=new S,Te=new S +N.prototype._validateInput=function(e){return we(e)},N.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},N.prototype._init=function(){this._result=new Array(this.length)},N.prototype._enumerate=function(){for(var e=this.length,t=this.promise,n=this._input,r=0;t._state===xe&&r 0) { + if (this.path.length > 0) { var msg_1 = "cycle detected: " + w; - this.each(function (key) { + this.each(this.path, function (key) { msg_1 += " <- " + key; }); throw new Error(msg_1); } }; - Vertices.prototype.each = function (cb) { - var _a = this, result = _a.result, vertices = _a.vertices; - for (var i = 0; i < result.len; i++) { - var vertex = vertices[result.stack[i]]; - cb(vertex.key, vertex.val); - } - }; - // reuse between cycle check and topsort Vertices.prototype.reset = function () { - this.stack.len = 0; - this.result.len = 0; - var vertices = this.vertices; - for (var i = 0; i < vertices.length; i++) { - vertices[i].mark = false; + this.stack.length = 0; + this.path.length = 0; + this.result.length = 0; + for (var i = 0, l = this.length; i < l; i++) { + this[i].flag = false; } }; Vertices.prototype.visit = function (start, search) { - var _a = this, stack = _a.stack, result = _a.result, vertices = _a.vertices; - stack.push(start.id); - while (stack.len) { - var index = stack.pop(); - if (index < 0) { - index = ~index; - if (search) { - result.pop(); - } - else { - result.push(index); - } - } - else { - var vertex = vertices[index]; - if (vertex.mark) { + var _a = this, stack = _a.stack, path = _a.path, result = _a.result; + stack.push(start.idx); + while (stack.length) { + var index = stack.pop() | 0; + if (index >= 0) { + // enter + var vertex = this[index]; + if (vertex.flag) continue; - } - if (search) { - result.push(index); - if (search === vertex.key) { - return; - } - } - vertex.mark = true; + vertex.flag = true; + path.push(index); + if (search === vertex.key) + break; + // push exit stack.push(~index); - var incoming = vertex.inc; - if (incoming) { - var i = incoming.length; - while (i--) { - index = incoming[i]; - if (!vertices[index].mark) { - stack.push(index); - } - } - } + this.pushIncoming(vertex); + } + else { + // exit + path.pop(); + result.push(~index); + } + } + }; + Vertices.prototype.pushIncoming = function (incomming) { + var stack = this.stack; + for (var i = incomming.length - 1; i >= 0; i--) { + var index = incomming[i]; + if (!this[index].flag) { + stack.push(index); } } }; + Vertices.prototype.each = function (indices, cb) { + for (var i = 0, l = indices.length; i < l; i++) { + var vertex = this[indices[i]]; + cb(vertex.key, vertex.val); + } + }; return Vertices; }()); +/** @private */ var IntStack = (function () { function IntStack() { - this.stack = [0, 0, 0, 0, 0, 0]; - this.len = 0; + this.length = 0; } IntStack.prototype.push = function (n) { - this.stack[this.len++] = n; + this[this.length++] = n | 0; }; IntStack.prototype.pop = function () { - return this.stack[--this.len]; + return this[--this.length] | 0; }; return IntStack; }()); @@ -3189,10 +3189,22 @@ enifed('ember-application/system/application', ['exports', 'ember-utils', 'ember */ 'use strict'; + exports._resetLegacyAddonWarnings = _resetLegacyAddonWarnings; + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); var librariesRegistered = false; + var warnedAboutLegacyViewAddon = false; + var warnedAboutLegacyControllerAddon = false; + + // For testing + + function _resetLegacyAddonWarnings() { + warnedAboutLegacyViewAddon = false; + warnedAboutLegacyControllerAddon = false; + } + /** An instance of `Ember.Application` is the starting point for every Ember application. It helps to instantiate, initialize and coordinate the many @@ -6492,7 +6504,7 @@ enifed('ember-glimmer/component', ['exports', 'ember-utils', 'ember-views', 'emb @default null @public */ - Component[_emberUtils.NAME_KEY] = 'Ember.Component'; + Component[_emberMetal.NAME_KEY] = 'Ember.Component'; Component.reopenClass({ isComponentFactory: true, @@ -8335,14 +8347,13 @@ enifed('ember-glimmer/helpers/-normalize-class', ['exports', 'ember-glimmer/util return new _emberGlimmerUtilsReferences.InternalHelperReference(normalizeClass, args); }; }); -enifed('ember-glimmer/helpers/action', ['exports', 'ember-utils', 'ember-glimmer/utils/references', 'ember-metal'], function (exports, _emberUtils, _emberGlimmerUtilsReferences, _emberMetal) { +enifed('ember-glimmer/helpers/action', ['exports', 'ember-utils', 'ember-metal', 'ember-glimmer/utils/references', 'glimmer-runtime', 'glimmer-reference'], function (exports, _emberUtils, _emberMetal, _emberGlimmerUtilsReferences, _glimmerRuntime, _glimmerReference) { /** @module ember @submodule ember-glimmer */ 'use strict'; - exports.createClosureAction = createClosureAction; var INVOKE = _emberUtils.symbol('INVOKE'); exports.INVOKE = INVOKE; var ACTION = _emberUtils.symbol('ACTION'); @@ -8595,138 +8606,120 @@ enifed('ember-glimmer/helpers/action', ['exports', 'ember-utils', 'ember-glimmer @public */ - var ClosureActionReference = (function (_CachedReference) { - babelHelpers.inherits(ClosureActionReference, _CachedReference); - - ClosureActionReference.create = function create(args) { - // TODO: Const reference optimization. - return new ClosureActionReference(args); - }; - - function ClosureActionReference(args) { - _CachedReference.call(this); - - this.args = args; - this.tag = args.tag; - } - - ClosureActionReference.prototype.compute = function compute() { - var _args = this.args; - var named = _args.named; - var positional = _args.positional; - - var positionalValues = positional.value(); - - var target = positionalValues[0]; - var rawActionRef = positional.at(1); - var rawAction = positionalValues[1]; - - // The first two argument slots are reserved. - // pos[0] is the context (or `this`) - // pos[1] is the action name or function - // Anything else is an action argument. - var actionArgs = positionalValues.slice(2); - - // on-change={{action setName}} - // element-space actions look to "controller" then target. Here we only - // look to "target". - var actionType = typeof rawAction; - var action = rawAction; - - if (rawActionRef[INVOKE]) { - target = rawActionRef; - action = rawActionRef[INVOKE]; - } else if (_emberMetal.isNone(rawAction)) { - throw new _emberMetal.Error('Action passed is null or undefined in (action) from ' + target + '.'); - } else if (actionType === 'string') { - // on-change={{action 'setName'}} - var actionName = rawAction; + exports.default = function (vm, args) { + var named = args.named; + var positional = args.positional; - action = null; + // The first two argument slots are reserved. + // pos[0] is the context (or `this`) + // pos[1] is the action name or function + // Anything else is an action argument. + var context = positional.at(0); + var action = positional.at(1); - if (named.has('target')) { - // on-change={{action 'setName' target=alternativeComponent}} - target = named.get('target').value(); - } + // TODO: Is there a better way of doing this? + var debugKey = action._propertyKey; - if (target['actions']) { - action = target.actions[actionName]; - } + var restArgs = undefined; - if (!action) { - throw new _emberMetal.Error('An action named \'' + actionName + '\' was not found in ' + target); - } - } else if (action && typeof action[INVOKE] === 'function') { - target = action; - action = action[INVOKE]; - } else if (actionType !== 'function') { - // TODO: Is there a better way of doing this? - var rawActionLabel = rawActionRef._propertyKey || rawAction; - throw new _emberMetal.Error('An action could not be made for `' + rawActionLabel + '` in ' + target + '. Please confirm that you are using either a quoted action name (i.e. `(action \'' + rawActionLabel + '\')`) or a function available in ' + target + '.'); - } + if (positional.length === 2) { + restArgs = _glimmerRuntime.EvaluatedPositionalArgs.empty(); + } else { + restArgs = _glimmerRuntime.EvaluatedPositionalArgs.create(positional.values.slice(2)); + } - var valuePath = named.get('value').value(); + var target = named.has('target') ? named.get('target') : context; + var processArgs = makeArgsProcessor(named.has('value') && named.get('value'), restArgs); - return createClosureAction(target, action, valuePath, actionArgs); - }; + var fn = undefined; - return ClosureActionReference; - })(_emberGlimmerUtilsReferences.CachedReference); + if (typeof action[INVOKE] === 'function') { + fn = makeClosureAction(action, action, action[INVOKE], processArgs, debugKey); + } else if (_glimmerReference.isConst(target) && _glimmerReference.isConst(action)) { + fn = makeClosureAction(context.value(), target.value(), action.value(), processArgs, debugKey); + } else { + fn = makeDynamicClosureAction(context.value(), target, action, processArgs, debugKey); + } - exports.ClosureActionReference = ClosureActionReference; + fn[ACTION] = true; - exports.default = function (vm, args) { - return ClosureActionReference.create(args); + return new _emberGlimmerUtilsReferences.UnboundReference(fn); }; - function createClosureAction(target, action, valuePath, actionArgs) { - var closureAction = undefined; - var actionArgLength = actionArgs.length; + function NOOP(args) { + return args; + } - if (actionArgLength > 0) { - closureAction = function () { - for (var _len = arguments.length, passedArguments = Array(_len), _key = 0; _key < _len; _key++) { - passedArguments[_key] = arguments[_key]; - } + function makeArgsProcessor(valuePathRef, actionArgsRef) { + var mergeArgs = null; - var args = new Array(actionArgLength + passedArguments.length); + if (actionArgsRef.length > 0) { + mergeArgs = function (args) { + return actionArgsRef.value().concat(args); + }; + } - for (var i = 0; i < actionArgLength; i++) { - args[i] = actionArgs[i]; - } + var readValue = null; - for (var i = 0; i < passedArguments.length; i++) { - args[i + actionArgLength] = passedArguments[i]; - } + if (valuePathRef) { + readValue = function (args) { + var valuePath = valuePathRef.value(); if (valuePath && args.length > 0) { args[0] = _emberMetal.get(args[0], valuePath); } - var payload = { target: target, args: args, label: 'glimmer-closure-action' }; - return _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { - return _emberMetal.run.join.apply(_emberMetal.run, [target, action].concat(args)); - }); + return args; + }; + } + + if (mergeArgs && readValue) { + return function (args) { + return readValue(mergeArgs(args)); }; } else { - closureAction = function () { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } + return mergeArgs || readValue || NOOP; + } + } - if (valuePath && args.length > 0) { - args[0] = _emberMetal.get(args[0], valuePath); - } + function makeDynamicClosureAction(context, targetRef, actionRef, processArgs, debugKey) { - var payload = { target: target, args: args, label: 'glimmer-closure-action' }; - return _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { - return _emberMetal.run.join.apply(_emberMetal.run, [target, action].concat(args)); - }); - }; + return function () { + return makeClosureAction(context, targetRef.value(), actionRef.value(), processArgs, debugKey).apply(undefined, arguments); + }; + + // We don't allow undefined/null values, so this creates a throw-away action to trigger the assertions + } + + function makeClosureAction(context, target, action, processArgs, debugKey) { + var self = undefined, + fn = undefined; + + if (typeof action[INVOKE] === 'function') { + self = action; + fn = action[INVOKE]; + } else { + var typeofAction = typeof action; + + if (typeofAction === 'string') { + self = target; + fn = target.actions && target.actions[action]; + } else if (typeofAction === 'function') { + self = context; + fn = action; + } else {} } - closureAction[ACTION] = true; - return closureAction; + return function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var payload = { target: self, args: args, label: 'glimmer-closure-action' }; + return _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { + return _emberMetal.run.join.apply(_emberMetal.run, [self, fn].concat(processArgs(args))); + }); + }; } }); enifed('ember-glimmer/helpers/component', ['exports', 'ember-utils', 'ember-glimmer/utils/references', 'ember-glimmer/syntax/curly-component', 'glimmer-runtime', 'ember-metal'], function (exports, _emberUtils, _emberGlimmerUtilsReferences, _emberGlimmerSyntaxCurlyComponent, _glimmerRuntime, _emberMetal) { @@ -8742,19 +8735,17 @@ enifed('ember-glimmer/helpers/component', ['exports', 'ember-utils', 'ember-glim additional information on how a `Component` functions. `{{component}}`'s primary use is for cases where you want to dynamically change which type of component is rendered as the state of your application - changes. This helper has three modes: inline, block, and nested. - - ### Inline Form + changes. The provided block will be applied as the template for the component. + Given an empty `` the following template: - Given the following template: - - ```app/application.hbs + ```handlebars + {{! application.hbs }} {{component infographicComponentName}} ``` And the following application code: - ```app/controllers/application.js + ```javascript export default Ember.Controller.extend({ infographicComponentName: computed('isMarketOpen', { get() { @@ -8775,87 +8766,33 @@ enifed('ember-glimmer/helpers/component', ['exports', 'ember-utils', 'ember-glim Note: You should not use this helper when you are consistently rendering the same component. In that case, use standard component syntax, for example: - ```app/templates/application.hbs + ```handlebars + {{! application.hbs }} {{live-updating-chart}} ``` - ### Block Form - - Using the block form of this helper is similar to using the block form - of a component. Given the following application template: - - ```app/templates/application.hbs - {{#component infographicComponentName}} - Last update: {{lastUpdateTimestamp}} - {{/component}} - ``` - - The following controller code: - - ```app/controllers/application.js - export default Ember.Controller.extend({ - lastUpdateTimestamp: computed(function() { - return new Date(); - }), - - infographicComponentName: computed('isMarketOpen', { - get() { - if (this.get('isMarketOpen')) { - return 'live-updating-chart'; - } else { - return 'market-close-summary'; - } - } - }) - }); - ``` - - And the following component template: - - ```app/templates/components/live-updating-chart.hbs - {{! chart }} - {{yield}} - ``` - - The `Last Update: {{lastUpdateTimestamp}}` will be rendered in place of the `{{yield}}`. - - ### Nested Usage + ## Nested Usage The `component` helper can be used to package a component path with initial attrs. The included attrs can then be merged during the final invocation. For example, given a `person-form` component with the following template: - ```app/templates/components/person-form.hbs + ```handlebars {{yield (hash - nameInput=(component "my-input-component" value=model.name placeholder="First Name") - )}} + nameInput=(component "my-input-component" value=model.name placeholder="First Name"))}} ``` - When yielding the component via the `hash` helper, the component is invocked directly. - See the following snippet: + The following snippet: ``` {{#person-form as |form|}} - {{form.nameInput placeholder="Username"}} + {{component form.nameInput placeholder="Username"}} {{/person-form}} ``` - Which outputs an input whose value is already bound to `model.name` and `placeholder` + would output an input whose value is already bound to `model.name` and `placeholder` is "Username". - When yielding the component without the hash helper use the `component` helper. - For example, below is a `full-name` component template: - - ```handlebars - {{yield (component "my-input-component" value=model.name placeholder="Name")}} - ``` - - ``` - {{#full-name as |field|}} - {{component field placeholder="Full name"}} - {{/full-name}} - ``` - @method component @since 1.11.0 @for Ember.Templates.helpers @@ -9276,8 +9213,8 @@ enifed('ember-glimmer/helpers/get', ['exports', 'ember-metal', 'ember-glimmer/ut ```handlebars {{get person factName}} - - + + ``` The `{{get}}` helper can also respect mutable values itself. For example: @@ -9686,9 +9623,6 @@ enifed('ember-glimmer/helpers/mut', ['exports', 'ember-utils', 'ember-metal', 'e }); ``` - Note that for curly components (`{{my-component}}`) the bindings are already mutable, - making the `mut` unnecessary. - Additionally, the `mut` helper can be combined with the `action` helper to mutate a value. For example: @@ -9702,7 +9636,7 @@ enifed('ember-glimmer/helpers/mut', ['exports', 'ember-utils', 'ember-metal', 'e // my-child.js export default Component.extend({ click() { - this.get('click-count-change')(this.get('childClickCount') + 1); + this.get('clickCountChange')(this.get('childClickCount') + 1); } }); ``` @@ -10558,7 +10492,7 @@ enifed('ember-glimmer/renderer', ['exports', 'ember-glimmer/utils/references', ' var runInTransaction = undefined; - if (false || false) { + if (false || true) { runInTransaction = _emberMetal.runInTransaction; } else { runInTransaction = function (context, methodName) { @@ -13314,7 +13248,7 @@ enifed('ember-glimmer/utils/references', ['exports', 'ember-utils', 'ember-metal var TwoWayFlushDetectionTag = undefined; - if (false || false) { + if (false || true) { TwoWayFlushDetectionTag = (function () { function _class(tag, key, ref) { this.tag = tag; @@ -13382,7 +13316,7 @@ enifed('ember-glimmer/utils/references', ['exports', 'ember-utils', 'ember-metal this._parentValue = parentValue; this._propertyKey = propertyKey; - if (false || false) { + if (false || true) { this.tag = new TwoWayFlushDetectionTag(_emberMetal.tagForProperty(parentValue, propertyKey), propertyKey, this); } else { this.tag = _emberMetal.tagForProperty(parentValue, propertyKey); @@ -13397,7 +13331,7 @@ enifed('ember-glimmer/utils/references', ['exports', 'ember-utils', 'ember-metal var _parentValue = this._parentValue; var _propertyKey = this._propertyKey; - if (false || false) { + if (false || true) { this.tag.didCompute(_parentValue); } @@ -13426,7 +13360,7 @@ enifed('ember-glimmer/utils/references', ['exports', 'ember-utils', 'ember-metal this._parentObjectTag = parentObjectTag; this._propertyKey = propertyKey; - if (false || false) { + if (false || true) { var tag = _glimmerReference.combine([parentReferenceTag, parentObjectTag]); this.tag = new TwoWayFlushDetectionTag(tag, propertyKey, this); } else { @@ -13452,7 +13386,7 @@ enifed('ember-glimmer/utils/references', ['exports', 'ember-utils', 'ember-metal _emberMetal.watchKey(parentValue, _propertyKey); } - if (false || false) { + if (false || true) { this.tag.didCompute(parentValue); } @@ -14020,6 +13954,8 @@ enifed('ember-metal/alias', ['exports', 'ember-utils', 'ember-metal/debug', 'emb exports.default = alias; exports.AliasedProperty = AliasedProperty; + var CONSUMED = {}; + function alias(altKey) { return new AliasedProperty(altKey); } @@ -14039,28 +13975,30 @@ enifed('ember-metal/alias', ['exports', 'ember-utils', 'ember-metal/debug', 'emb } }; - AliasedProperty.prototype._addDependentKeyIfMissing = function (obj, keyName) { + AliasedProperty.prototype.teardown = function (obj, keyName) { var meta = _emberMetalMeta.meta(obj); - if (!meta.peekDeps(this.altKey, keyName)) { - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); + if (meta.peekWatching(keyName)) { + _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); } }; - AliasedProperty.prototype._removeDependentKeyIfAdded = function (obj, keyName) { - var meta = _emberMetalMeta.meta(obj); - if (meta.peekDeps(this.altKey, keyName)) { - _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); - } + AliasedProperty.prototype.willWatch = function (obj, keyName) { + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); }; - AliasedProperty.prototype.willWatch = AliasedProperty.prototype._addDependentKeyIfMissing; - AliasedProperty.prototype.didUnwatch = AliasedProperty.prototype._removeDependentKeyIfAdded; - AliasedProperty.prototype.teardown = AliasedProperty.prototype._removeDependentKeyIfAdded; + AliasedProperty.prototype.didUnwatch = function (obj, keyName) { + _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); + }; AliasedProperty.prototype.get = function AliasedProperty_get(obj, keyName) { - this._addDependentKeyIfMissing(obj, keyName); - - return _emberMetalProperty_get.get(obj, this.altKey); + var ret = _emberMetalProperty_get.get(obj, this.altKey); + var meta = _emberMetalMeta.meta(obj); + var cache = meta.writableCache(); + if (cache[keyName] !== CONSUMED) { + cache[keyName] = CONSUMED; + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); + } + return ret; }; AliasedProperty.prototype.set = function AliasedProperty_set(obj, keyName, value) { @@ -16512,6 +16450,7 @@ enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-me exports.removeObserver = _emberMetalObserver.removeObserver; exports._addBeforeObserver = _emberMetalObserver._addBeforeObserver; exports._removeBeforeObserver = _emberMetalObserver._removeBeforeObserver; + exports.NAME_KEY = _emberMetalMixin.NAME_KEY; exports.Mixin = _emberMetalMixin.Mixin; exports.aliasMethod = _emberMetalMixin.aliasMethod; exports._immediateObserver = _emberMetalMixin._immediateObserver; @@ -17707,7 +17646,7 @@ enifed('ember-metal/meta', ['exports', 'ember-utils', 'ember-metal/features', 'e var META_DESTROYED = 1 << 3; var IS_PROXY = 1 << 4; - if (false || false) { + if (false || true) { members.lastRendered = ownMap; members.lastRenderedFrom = ownMap; // FIXME: not used in production, remove me from prod builds } @@ -17746,7 +17685,7 @@ enifed('ember-metal/meta', ['exports', 'ember-utils', 'ember-metal/features', 'e // inherited, and we can optimize it much better than JS runtimes. this.parent = parentMeta; - if (false || false) { + if (false || true) { this._lastRendered = undefined; this._lastRenderedFrom = undefined; // FIXME: not used in production, remove me from prod builds } @@ -18520,23 +18459,20 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb function applyConcatenatedProperties(obj, key, value, values) { var baseValue = values[key] || obj[key]; - var ret = undefined; if (baseValue) { if ('function' === typeof baseValue.concat) { if (value === null || value === undefined) { - ret = baseValue; + return baseValue; } else { - ret = baseValue.concat(value); + return baseValue.concat(value); } } else { - ret = _emberUtils.makeArray(baseValue).concat(value); + return _emberUtils.makeArray(baseValue).concat(value); } } else { - ret = _emberUtils.makeArray(value); + return _emberUtils.makeArray(value); } - - return ret; } function applyMergedProperties(obj, key, value, values) { @@ -18804,6 +18740,9 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb return obj; } + var NAME_KEY = _emberUtils.GUID_KEY + '_name'; + + exports.NAME_KEY = NAME_KEY; /** The `Ember.Mixin` class allows you to create mixins, whose properties can be added to other classes. For instance, @@ -18886,7 +18825,7 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb this.ownerConstructor = undefined; this._without = undefined; this[_emberUtils.GUID_KEY] = null; - this[_emberUtils.NAME_KEY] = null; + this[NAME_KEY] = null; } Mixin._apply = applyMixin; @@ -19278,11 +19217,6 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb exports.required = required; exports.REQUIRED = REQUIRED; }); - -// it is possible to use concatenatedProperties with strings (which cannot be frozen) -// only freeze objects... - -// prevent mutating `concatenatedProperties` array after it is applied // use conditional to avoid stringifying every time enifed('ember-metal/observer', ['exports', 'ember-metal/watching', 'ember-metal/events'], function (exports, _emberMetalWatching, _emberMetalEvents) { 'use strict'; @@ -19876,7 +19810,7 @@ enifed('ember-metal/property_events', ['exports', 'ember-utils', 'ember-metal/me _emberMetalTags.markObjectAsDirty(meta, keyName); - if (false || false) { + if (false || true) { _emberMetalTransaction.assertNotRendered(obj, keyName, meta); } } @@ -21190,18 +21124,18 @@ enifed('ember-metal/transaction', ['exports', 'ember-metal/meta', 'ember-metal/d assertNotRendered = undefined; var raise = _emberMetalDebug.assert; - if (false) { + if (true) { raise = function (message, test) {}; } var implication = undefined; - if (false) { + if (true) { implication = 'will be removed in Ember 3.0.'; } else if (false) { implication = 'is no longer supported. See https://github.com/emberjs/ember.js/issues/13948 for more details.'; } - if (false || false) { + if (false || true) { (function () { var counter = 0; var inTransaction = false; @@ -21248,7 +21182,7 @@ enifed('ember-metal/transaction', ['exports', 'ember-metal/meta', 'ember-metal/d label = 'the same value'; } - return 'You modified ' + label + ' twice on ' + object + ' in a single render. This was unreliable and slow in Ember 1.x and ' + implication; + return 'You modified ' + parts.join('.') + ' twice on ' + object + ' in a single render. This was unreliable and slow in Ember 1.x and ' + implication; })(), false); shouldReflush = true; @@ -23521,8 +23455,9 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** The name of the route, dot-delimited. - For example, a route found at `app/routes/posts/post.js` will have - a `routeName` of `posts.post`. + 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 @@ -23738,23 +23673,18 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** Returns a hash containing the parameters of an ancestor route. Example - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('member', { path: ':name' }, function() { this.route('interest', { path: ':interest' }); }); }); - ``` - ```app/routes/member.js - export default Ember.Route.extend({ + App.MemberRoute = Ember.Route.extend({ queryParams: { memberQp: { refreshModel: true } } }); - ``` - ```app/routes/member/interest.js - export default Ember.Route.extend({ + App.MemberInterestRoute = Ember.Route.extend({ queryParams: { interestQp: { refreshModel: true } }, @@ -23844,10 +23774,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** A hook you can use to reset controller values either when the model changes or the route is exiting. - ```app/routes/articles.js - import Ember from 'ember'; - export default Ember.Route.extend({ - resetController(controller, isExiting, transition) { + ```javascript + App.ArticlesRoute = Ember.Route.extend({ + // ... + resetController: function(controller, isExiting, transition) { if (isExiting) { controller.set('page', 1); } @@ -23898,19 +23828,12 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** The name of the template to use by default when rendering this routes template. - ```app/routes/posts/list.js - import Ember from 'ember'; - export default Ember.Route.extend({ + ```javascript + let PostsList = Ember.Route.extend({ templateName: 'posts/list' }); - ``` - ```app/routes/posts/index.js - import PostsList from '../posts/list'; - export default PostsList.extend(); - ``` - ```app/routes/posts/archived.js - import PostsList from '../posts/list'; - export default PostsList.extend(); + App.PostsIndexRoute = PostsList.extend(); + App.PostsArchivedRoute = PostsList.extend(); ``` @property templateName @type String @@ -23945,11 +23868,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' or decorating the transition from the currently active routes. A good example is preventing navigation when a form is half-filled out: - ```app/routes/contact-form.js - import Ember from 'ember'; - export default Ember.Route.extend({ + ```javascript + App.ContactFormRoute = Ember.Route.extend({ actions: { - willTransition(transition) { + willTransition: function(transition) { if (this.controller.get('userHasEnteredData')) { this.controller.displayNavigationConfirm(); transition.abort(); @@ -23983,11 +23905,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' have resolved. The `didTransition` action has no arguments, however, it can be useful for tracking page views or resetting state on the controller. - ```app/routes/login.js - import Ember from 'ember'; - export default Ember.Route.extend({ + ```javascript + App.LoginRoute = Ember.Route.extend({ actions: { - didTransition() { + didTransition: function() { this.controller.get('errors.base').clear(); return true; // Bubble the didTransition event } @@ -24004,10 +23925,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' hook returns a promise that is not already resolved. The current `Transition` object is the first parameter and the route that triggered the loading event is the second parameter. - ```app/routes/application.js - export default Ember.Route.extend({ + ```javascript + App.ApplicationRoute = Ember.Route.extend({ actions: { - loading(transition, route) { + loading: function(transition, route) { let controller = this.controllerFor('foo'); controller.set('currentlyLoading', true); transition.finally(function() { @@ -24033,14 +23954,13 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' Here is an example of an error handler that will be invoked for rejected promises from the various hooks on the route, as well as any unhandled errors from child routes: - ```app/routes/admin.js - import Ember from 'ember'; - export default Ember.Route.extend({ - beforeModel() { + ```javascript + App.AdminRoute = Ember.Route.extend({ + beforeModel: function() { return Ember.RSVP.reject('bad things!'); }, actions: { - error(error, transition) { + error: function(error, transition) { // Assuming we got here due to the error in `beforeModel`, // we can expect that error === "bad things!", // but a promise model rejecting would also @@ -24058,11 +23978,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' will fire a default error handler that logs the error. You can specify your own global default error handler by overriding the `error` handler on `ApplicationRoute`: - ```app/routes/application.js - import Ember from 'ember'; - export default Ember.Route.extend({ + ```javascript + App.ApplicationRoute = Ember.Route.extend({ actions: { - error(error, transition) { + error: function(error, transition) { this.controllerFor('banner').displayError(error.message); } } @@ -24078,12 +23997,11 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** This event is triggered when the router enters the route. It is not executed when the model for the route changes. - ```app/routes/application.js - import Ember from 'ember'; - export default Ember.Route.extend({ - collectAnalytics: Ember.on('activate', function(){ + ```javascript + App.ApplicationRoute = Ember.Route.extend({ + collectAnalytics: function(){ collectAnalytics(); - }) + }.on('activate') }); ``` @event activate @@ -24094,12 +24012,11 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** This event is triggered when the router completely exits this route. It is not executed when the model for the route changes. - ```app/routes/index.js - import Ember from 'ember'; - export default Ember.Route.extend({ - trackPageLeaveAnalytics: Ember.on('deactivate', function(){ + ```javascript + App.IndexRoute = Ember.Route.extend({ + trackPageLeaveAnalytics: function(){ trackPageLeaveAnalytics(); - }) + }.on('deactivate') }); ``` @event deactivate @@ -24110,11 +24027,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** The controller associated with this route. Example - ```app/routes/form.js - import Ember from 'ember'; - export default Ember.Route.extend({ + ```javascript + App.FormRoute = Ember.Route.extend({ actions: { - willTransition(transition) { + willTransition: function(transition) { if (this.controller.get('userHasEnteredData') && !confirm('Are you sure you want to abandon progress?')) { transition.abort(); @@ -24286,17 +24202,13 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' ``` Multiple models will be applied last to first recursively up the route tree. - ```app/routes.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('blogPost', { path:':blogPostId' }, function() { - this.route('blogComment', { path: ':blogCommentId' }); + this.route('blogComment', { path: ':blogCommentId', resetNamespace: true }); }); }); - export default Router; - ``` - ```javascript - this.transitionTo('blogComment', aPost, aComment); + this.transitionTo('blogComment', aPost, aComment); this.transitionTo('blogComment', 1, 13); ``` It is also possible to pass a URL (a string that starts with a @@ -24318,20 +24230,15 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' ``` See also [replaceWith](#method_replaceWith). Simple Transition Example - ```app/routes.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('index'); this.route('secret'); this.route('fourOhFour', { path: '*:' }); }); - export default Router; - ``` - ```app/routes/index.js - import Ember from 'ember': - export Ember.Route.extend({ + App.IndexRoute = Ember.Route.extend({ actions: { - moveToSecret(context) { + moveToSecret: function(context) { if (authorized()) { this.transitionTo('secret', context); } else { @@ -24342,63 +24249,48 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' }); ``` Transition to a nested route - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('articles', { path: '/articles' }, function() { this.route('new'); }); }); - export default Router; - ``` - ```app/routes/index.js - import Ember from 'ember'; - export default Ember.Route.extend({ + App.IndexRoute = Ember.Route.extend({ actions: { - transitionToNewArticle() { + transitionToNewArticle: function() { this.transitionTo('articles.new'); } } }); ``` Multiple Models Example - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('index'); this.route('breakfast', { path: ':breakfastId' }, function() { - this.route('cereal', { path: ':cerealId' }); + this.route('cereal', { path: ':cerealId', resetNamespace: true }); }); }); - export default Router; - ``` - ```app/routes/index.js - import Ember from 'ember'; - export default Ember.Route.extend({ + App.IndexRoute = Ember.Route.extend({ actions: { - moveToChocolateCereal() { + moveToChocolateCereal: function() { let cereal = { cerealId: 'ChocolateYumminess' }; let breakfast = { breakfastId: 'CerealAndMilk' }; - this.transitionTo('breakfast.cereal', breakfast, cereal); + this.transitionTo('cereal', breakfast, cereal); } } }); ``` Nested Route with Query String Example - ```app/routes.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('fruits', function() { this.route('apples'); }); }); - export default Router; - ``` - ```app/routes/index.js - import Ember from 'ember'; - export default Ember.Route.extend({ + App.IndexRoute = Ember.Route.extend({ actions: { - transitionToApples() { + transitionToApples: function() { this.transitionTo('fruits.apples', { queryParams: { color: 'red' } }); } } @@ -24469,18 +24361,13 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' Beside that, it is identical to `transitionTo` in all other respects. See 'transitionTo' for additional information regarding multiple models. Example - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('index'); this.route('secret'); }); - export default Router; - ``` - ```app/routes/secret.js - import Ember from 'ember'; - export default Ember.Route.extend({ - afterModel() { + App.SecretRoute = Ember.Route.extend({ + afterModel: function() { if (!authorized()){ this.replaceWith('index'); } @@ -24505,28 +24392,20 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' Sends an action to the router, which will delegate it to the currently active route hierarchy per the bubbling rules explained under `actions`. Example - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('index'); }); - export default Router; - ``` - ```app/routes/application.js - import Ember from 'ember'; - export default Ember.Route.extend({ + App.ApplicationRoute = Ember.Route.extend({ actions: { - track(arg) { + track: function(arg) { console.log(arg, 'was clicked'); } } }); - ``` - ```app/routes/index.js - import Ember from 'ember'; - export default Ember.Route.extend({ + App.IndexRoute = Ember.Route.extend({ actions: { - trackIfDebug(arg) { + trackIfDebug: function(arg) { if (debug) { this.send('track', arg); } @@ -24645,7 +24524,6 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' cache.stash(cacheKey, prop, value); } }, - /** This hook is the first of the route entry validation hooks called when an attempt is made to transition into a route @@ -24665,6 +24543,46 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' transition until the promise resolves (or rejects). This could be useful, for instance, for retrieving async code from the server that is required to enter a route. + ```javascript + App.PostRoute = Ember.Route.extend({ + beforeModel: function(transition) { + if (!App.Post) { + return Ember.$.getScript('/models/post.js'); + } + } + }); + ``` + If `App.Post` doesn't exist in the above example, + `beforeModel` will use jQuery's `getScript`, which + returns a promise that resolves after the server has + successfully retrieved and executed the code from the + server. Note that if an error were to occur, it would + be passed to the `error` hook on `Ember.Route`, but + it's also possible to handle errors specific to + `beforeModel` right from within the hook (to distinguish + from the shared error handling behavior of the `error` + hook): + ```javascript + App.PostRoute = Ember.Route.extend({ + beforeModel: function(transition) { + if (!App.Post) { + let self = this; + return Ember.$.getScript('post.js').then(null, function(e) { + self.transitionTo('help'); + // Note that the above transitionTo will implicitly + // halt the transition. If you were to return + // nothing from this promise reject handler, + // according to promise semantics, that would + // convert the reject into a resolve and the + // transition would continue. To propagate the + // error so that it'd be handled by the `error` + // hook, you would have to + return Ember.RSVP.reject(e); + }); + } + } + }); + ``` @method beforeModel @param {Transition} transition @return {Promise} if the value returned from this hook is @@ -24683,10 +24601,9 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' the `transition`, and is therefore suited to performing logic that can only take place after the model has already resolved. - ```app/routes/posts.js - import Ember from 'ember'; - export default Ember.Route.extend({ - afterModel(posts, transition) { + ```javascript + App.PostsRoute = Ember.Route.extend({ + afterModel: function(posts, transition) { if (posts.get('length') === 1) { this.transitionTo('post.show', posts.get('firstObject')); } @@ -24746,12 +24663,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** A hook you can implement to convert the URL into the model for this route. - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('post', { path: '/posts/:post_id' }); }); - export default Router; ``` The model for the `post` route is `store.findRecord('post', params.post_id)`. By default, if your route has a dynamic segment ending in `_id`: @@ -24785,10 +24700,9 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' if a promise returned from `model` fails, the error will be handled by the `error` hook on `Ember.Route`. Example - ```app/routes/post.js - import Ember from 'ember'; - export default Ember.Route.extend({ - model(params) { + ```javascript + App.PostRoute = Ember.Route.extend({ + model: function(params) { return this.store.findRecord('post', params.post_id); } }); @@ -24804,7 +24718,8 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' @public */ model: function (params, transition) { - var name = undefined, + var match = undefined, + name = undefined, sawParams = undefined, value = undefined; var queryParams = _emberMetal.get(this, '_qp.map'); @@ -24814,8 +24729,7 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' continue; } - var match = prop.match(/^(.*)_id$/); - if (match) { + if (match = prop.match(/^(.*)_id$/)) { name = match[1]; value = params[prop]; } @@ -24891,20 +24805,16 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** A hook you can implement to convert the route's model into parameters for the URL. - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('post', { path: '/posts/:post_id' }); }); - ``` - ```app/routes/post.js - import Ember from 'ember'; - export default Ember.Route.extend({ - model(params) { + App.PostRoute = Ember.Route.extend({ + model: function(params) { // the server returns `{ id: 12 }` return Ember.$.getJSON('/posts/' + params.post_id); }, - serialize(model) { + serialize: function(model) { // this will make the URL `/posts/12` return { post_id: model.id }; } @@ -24936,13 +24846,12 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' prevent this default behavior. If you want to preserve that behavior when implementing your `setupController` function, make sure to call `_super`: - ```app/routes/photos.js - import Ember from 'ebmer'; - export default Ember.Route.extend({ - model() { + ```javascript + App.PhotosRoute = Ember.Route.extend({ + model: function() { return this.store.findAll('photo'); }, - setupController(controller, model) { + setupController: function(controller, model) { // Call _super for default behavior this._super(controller, model); // Implement your custom setup after @@ -24954,21 +24863,18 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' of this route. If no explicit controller is defined, Ember will automatically create one. As an example, consider the router: - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('post', { path: '/posts/:post_id' }); }); - export default Router; ``` For the `post` route, a controller named `App.PostController` would be used if it is defined. If it is not defined, a basic `Ember.Controller` instance would be used. Example - ```app/routes/post.js - import Ember from 'ember'; - export default Ember.Route.extend({ - setupController(controller, model) { + ```javascript + App.PostRoute = Ember.Route.extend({ + setupController: function(controller, model) { controller.set('model', model); } }); @@ -24986,14 +24892,12 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' }, /** - Returns the resolved model of the current route, or a parent (or any ancestor) - route in a route hierarchy. + Returns the controller for a particular route or name. The controller instance must already have been created, either through entering the associated route or using `generateController`. - ```app/routes/post.js - import Ember from 'ember'; - export default Ember.Route.extend({ - setupController(controller, post) { + ```javascript + App.PostRoute = Ember.Route.extend({ + setupController: function(controller, post) { this._super(controller, post); this.controllerFor('posts').set('currentPost', post); } @@ -25026,10 +24930,9 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' /** Generates a controller for a route. Example - ```app/routes/post.js - import Ember from 'ember'; - export default Ember.Route.extend({ - setupController(controller, post) { + ```javascript + App.PostRoute = Ember.Route.extend({ + setupController: function(controller, post) { this._super(controller, post); this.generateController('posts'); } @@ -25055,19 +24958,14 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' retrieve it. If the ancestor route's model was a promise, its resolved result is returned. Example - ```app/router.js - // ... - Router.map(function() { + ```javascript + App.Router.map(function() { this.route('post', { path: '/post/:post_id' }, function() { this.route('comments', { resetNamespace: true }); }); }); - export default Router; - ``` - ```app/routes/comments.js - import Ember from 'ember'; - export default Ember.Route.extend({ - afterModel() { + App.CommentsRoute = Ember.Route.extend({ + afterModel: function() { this.set('post', this.modelFor('post')); } }); @@ -25112,10 +25010,9 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' template, configured with the controller for the route. This method can be overridden to set up and render additional or alternative templates. - ```app/routes/posts.js - import Ember from 'ember'; - export default Ember.Route.extend({ - renderTemplate(controller, model) { + ```javascript + App.PostsRoute = Ember.Route.extend({ + renderTemplate: function(controller, model) { let favController = this.controllerFor('favoritePost'); // Render the `favoritePost` template into // the outlet `posts`, and display the `favoritePost` @@ -25143,12 +25040,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' phase of routing (via the `renderTemplate` hook) and later in response to user interaction. For example, given the following minimal router and templates: - ```app/router.js - // ... - Router.map(function() { + ```javascript + Router.map(function() { this.route('photos'); }); - export default Router; ``` ```handlebars @@ -25162,10 +25057,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' ``` You can render `photos.hbs` into the `"anOutletName"` outlet of `application.hbs` by calling `render`: - ```app/routes/post.js - import Ember from 'ember'; - export default Ember.Route.extend({ - renderTemplate() { + ```javascript + // posts route + Ember.Route.extend({ + renderTemplate: function() { this.render('photos', { into: 'application', outlet: 'anOutletName' @@ -25175,10 +25070,10 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' ``` `render` additionally allows you to supply which `controller` and `model` objects should be loaded and associated with the rendered template. - ```app/routes/posts.js - import Ember from 'ember'; - export default Ember.Route.extend({ - renderTemplate(controller, model){ + ```javascript + // posts route + Ember.Route.extend({ + renderTemplate: function(controller, model){ this.render('posts', { // the template to render, referenced by name into: 'application', // the template to render into, referenced by name outlet: 'anOutletName', // the outlet inside `options.template` to render into. @@ -25197,26 +25092,26 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' based on the name of the route specified in the router or the Route's `controllerName` and `templateName` properties. For example: - ```app/router.js - // ... - Router.map(function() { + ```javascript + // router + Router.map(function() { this.route('index'); this.route('post', { path: '/posts/:post_id' }); }); - export default Router; ``` - ```app/routes/post.js - import Ember from 'ember'; - export default Ember.Route.extend({ - renderTemplate() { + ```javascript + // post route + PostRoute = App.Route.extend({ + renderTemplate: function() { this.render(); // all defaults apply } }); ``` - The name of the route, defined by the router, is `post`. + The name of the `PostRoute`, defined by the router, is `post`. The following equivalent default options will be applied when the Route calls `render`: ```javascript + // this.render('post', { // the template name associated with 'post' Route into: 'application', // the parent route to 'post' Route outlet: 'main', // {{outlet}} and {{outlet 'main'}} are synonymous, @@ -25264,17 +25159,16 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' * `parentView`: the name of the view containing the outlet to clear (default: the view rendered by the parent route) Example: - ```app/routes/application.js - import Ember from 'ember'; - export default App.Route.extend({ + ```javascript + App.ApplicationRoute = App.Route.extend({ actions: { - showModal(evt) { + showModal: function(evt) { this.render(evt.modalName, { outlet: 'modal', into: 'application' }); }, - hideModal(evt) { + hideModal: function(evt) { this.disconnectOutlet({ outlet: 'modal', parentView: 'application' @@ -25285,18 +25179,11 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' ``` Alternatively, you can pass the `outlet` name directly as a string. Example: - ```app/routes/application.js - import Ember from 'ember'; - export default App.Route.extend({ - actions: { - showModal(evt) { - // ... - }, - hideModal(evt) { - this.disconnectOutlet('modal'); - } - } - }); + ```javascript + hideModal: function(evt) { + this.disconnectOutlet('modal'); + } + ``` @method disconnectOutlet @param {Object|String} options the options hash or outlet name @since 1.0.0 @@ -25440,7 +25327,7 @@ enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', ' var template = owner.lookup('template:' + templateName); var parent = undefined; - if (into && (parent = parentRoute(route)) && into === parent.routeName) { + if (into && (parent = parentRoute(route)) && into === parentRoute(route).routeName) { into = undefined; } @@ -27012,7 +26899,6 @@ enifed('ember-routing/system/router', ['exports', 'ember-utils', 'ember-console' _emberMetal.set(target.outlets, renderOptions.outlet, myState); } else { if (renderOptions.into) { - // Megahax time. Post-3.0-breaking-changes, we will just assert // right here that the user tried to target a nonexistent // thing. But for now we still need to support the `render` @@ -27257,7 +27143,11 @@ enifed('ember-routing/utils', ['exports', 'ember-utils', 'ember-metal'], functio */ function normalizeControllerQueryParams(queryParams) { - var qpMap = {}; + if (queryParams._qpMap) { + return queryParams._qpMap; + } + + var qpMap = queryParams._qpMap = {}; for (var i = 0; i < queryParams.length; ++i) { accumulateQueryParamDescriptors(queryParams[i], qpMap); @@ -29928,6 +29818,8 @@ enifed('ember-runtime/mixins/action_handler', ['exports', 'ember-metal'], functi args[_key - 1] = arguments[_key]; } + var target = undefined; + if (this.actions && this.actions[actionName]) { var shouldBubble = this.actions[actionName].apply(this, args) === true; if (!shouldBubble) { @@ -29935,9 +29827,10 @@ enifed('ember-runtime/mixins/action_handler', ['exports', 'ember-metal'], functi } } - var target = _emberMetal.get(this, 'target'); - if (target) { - target.send.apply(target, arguments); + if (target = _emberMetal.get(this, 'target')) { + var _target; + + (_target = target).send.apply(_target, arguments); } }, @@ -30351,7 +30244,7 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-utils', 'ember-metal', ' /** This returns the objects at the specified indexes, using `objectAt`. ```javascript - let arr = ['a', 'b', 'c', 'd']; + let arr = ['a', 'b', 'c', 'd']; arr.objectsAt([0, 1, 2]); // ['a', 'b', 'c'] arr.objectsAt([2, 3, 4]); // ['c', 'd', undefined] ``` @@ -31286,8 +31179,7 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-utils', 'ember-meta for (var idx = 0; idx < len && !found; idx++) { next = this.nextObject(idx, last, context); - found = callback.call(target, next, idx, this); - if (found) { + if (found = callback.call(target, next, idx, this)) { ret = next; } @@ -34066,7 +33958,7 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met // using ember-metal/lib/main here to ensure that ember-debug is setup // if present - var _Mixin$create, _ClassMixinProps; + var _Mixin$create; var schedule = _emberMetal.run.schedule; var applyMixin = _emberMetal.Mixin._apply; @@ -34313,7 +34205,7 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met CoreObject.__super__ = null; - var ClassMixinProps = (_ClassMixinProps = { + var ClassMixinProps = { ClassMixin: _emberMetal.REQUIRED, @@ -34321,94 +34213,309 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met isClass: true, - isMethod: false - }, _ClassMixinProps[_emberUtils.NAME_KEY] = null, _ClassMixinProps[_emberUtils.GUID_KEY] = null, _ClassMixinProps.extend = function () { - var Class = makeCtor(); - var proto; - Class.ClassMixin = _emberMetal.Mixin.create(this.ClassMixin); - Class.PrototypeMixin = _emberMetal.Mixin.create(this.PrototypeMixin); + isMethod: false, + /** + Creates a new subclass. + ```javascript + const Person = Ember.Object.extend({ + say(thing) { + alert(thing); + } + }); + ``` + This defines a new subclass of Ember.Object: `Person`. It contains one method: `say()`. + You can also create a subclass from any existing class by calling its `extend()` method. + For example, you might want to create a subclass of Ember's built-in `Ember.Component` class: + ```javascript + const PersonComponent = Ember.Component.extend({ + tagName: 'li', + classNameBindings: ['isAdministrator'] + }); + ``` + When defining a subclass, you can override methods but still access the + implementation of your parent class by calling the special `_super()` method: + ```javascript + const Person = Ember.Object.extend({ + say(thing) { + var name = this.get('name'); + alert(`${name} says: ${thing}`); + } + }); + const Soldier = Person.extend({ + say(thing) { + this._super(`${thing}, sir!`); + }, + march(numberOfHours) { + alert(`${this.get('name')} marches for ${numberOfHours} hours.`); + } + }); + let yehuda = Soldier.create({ + name: "Yehuda Katz" + }); + yehuda.say("Yes"); // alerts "Yehuda Katz says: Yes, sir!" + ``` + The `create()` on line #17 creates an *instance* of the `Soldier` class. + The `extend()` on line #8 creates a *subclass* of `Person`. Any instance + of the `Person` class will *not* have the `march()` method. + You can also pass `Mixin` classes to add additional properties to the subclass. + ```javascript + const Person = Ember.Object.extend({ + say(thing) { + alert(`${this.get('name')} says: ${thing}`); + } + }); + const SingingMixin = Mixin.create({ + sing(thing){ + alert(`${this.get('name')} sings: la la la ${thing}`); + } + }); + const BroadwayStar = Person.extend(SingingMixin, { + dance() { + alert(`${this.get('name')} dances: tap tap tap tap `); + } + }); + ``` + The `BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`. + @method extend + @static + @param {Mixin} [mixins]* One or more Mixin classes + @param {Object} [arguments]* Object containing values to use within the new class + @public + */ + extend: function () { + var Class = makeCtor(); + var proto; + Class.ClassMixin = _emberMetal.Mixin.create(this.ClassMixin); + Class.PrototypeMixin = _emberMetal.Mixin.create(this.PrototypeMixin); - Class.ClassMixin.ownerConstructor = Class; - Class.PrototypeMixin.ownerConstructor = Class; + Class.ClassMixin.ownerConstructor = Class; + Class.PrototypeMixin.ownerConstructor = Class; - reopen.apply(Class.PrototypeMixin, arguments); + reopen.apply(Class.PrototypeMixin, arguments); - Class.superclass = this; - Class.__super__ = this.prototype; + Class.superclass = this; + Class.__super__ = this.prototype; - proto = Class.prototype = Object.create(this.prototype); - proto.constructor = Class; - _emberUtils.generateGuid(proto); - _emberMetal.meta(proto).proto = proto; // this will disable observers on prototype + proto = Class.prototype = Object.create(this.prototype); + proto.constructor = Class; + _emberUtils.generateGuid(proto); + _emberMetal.meta(proto).proto = proto; // this will disable observers on prototype - Class.ClassMixin.apply(Class); - return Class; - }, _ClassMixinProps.create = function () { - var C = this; + Class.ClassMixin.apply(Class); + return Class; + }, - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } + /** + Creates an instance of a class. Accepts either no arguments, or an object + containing values to initialize the newly instantiated object with. + ```javascript + const Person = Ember.Object.extend({ + helloWorld() { + alert(`Hi, my name is ${this.get('name')}`); + } + }); + let tom = Person.create({ + name: 'Tom Dale' + }); + tom.helloWorld(); // alerts "Hi, my name is Tom Dale". + ``` + `create` will call the `init` function if defined during + `Ember.AnyObject.extend` + If no arguments are passed to `create`, it will not set values to the new + instance during initialization: + ```javascript + let noName = Person.create(); + noName.helloWorld(); // alerts undefined + ``` + NOTE: For performance reasons, you cannot declare methods or computed + properties during `create`. You should instead declare methods and computed + properties when using `extend`. + @method create + @static + @param [arguments]* + @public + */ + create: function () { + var C = this; - if (args.length > 0) { - this._initProperties(args); - } - return new C(); - }, _ClassMixinProps.reopen = function () { - this.willReopen(); - reopen.apply(this.PrototypeMixin, arguments); - return this; - }, _ClassMixinProps.reopenClass = function () { - reopen.apply(this.ClassMixin, arguments); - applyMixin(this, arguments, false); - return this; - }, _ClassMixinProps.detect = function (obj) { - if ('function' !== typeof obj) { - return false; - } - while (obj) { - if (obj === this) { - return true; + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; } - obj = obj.superclass; - } - return false; - }, _ClassMixinProps.detectInstance = function (obj) { - return obj instanceof this; - }, _ClassMixinProps.metaForProperty = function (key) { - var proto = this.proto(); - var possibleDesc = proto[key]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - return desc._meta || {}; - }, _ClassMixinProps._computedProperties = _emberMetal.computed(function () { - hasCachedComputedProperties = true; - var proto = this.proto(); - var property; - var properties = []; + if (args.length > 0) { + this._initProperties(args); + } + return new C(); + }, - for (var name in proto) { - property = proto[name]; + /** + Augments a constructor's prototype with additional + properties and functions: + ```javascript + const MyObject = Ember.Object.extend({ + name: 'an object' + }); + o = MyObject.create(); + o.get('name'); // 'an object' + MyObject.reopen({ + say(msg){ + console.log(msg); + } + }) + o2 = MyObject.create(); + o2.say("hello"); // logs "hello" + o.say("goodbye"); // logs "goodbye" + ``` + To add functions and properties to the constructor itself, + see `reopenClass` + @method reopen + @public + */ + reopen: function () { + this.willReopen(); + reopen.apply(this.PrototypeMixin, arguments); + return this; + }, - if (property && property.isDescriptor) { - properties.push({ - name: name, - meta: property._meta - }); + /** + Augments a constructor's own properties and functions: + ```javascript + const MyObject = Ember.Object.extend({ + name: 'an object' + }); + MyObject.reopenClass({ + canBuild: false + }); + MyObject.canBuild; // false + o = MyObject.create(); + ``` + In other words, this creates static properties and functions for the class. + These are only available on the class and not on any instance of that class. + ```javascript + const Person = Ember.Object.extend({ + name: "", + sayHello() { + alert("Hello. My name is " + this.get('name')); + } + }); + Person.reopenClass({ + species: "Homo sapiens", + createPerson(newPersonsName){ + return Person.create({ + name:newPersonsName + }); + } + }); + let tom = Person.create({ + name: "Tom Dale" + }); + let yehuda = Person.createPerson("Yehuda Katz"); + tom.sayHello(); // "Hello. My name is Tom Dale" + yehuda.sayHello(); // "Hello. My name is Yehuda Katz" + alert(Person.species); // "Homo sapiens" + ``` + Note that `species` and `createPerson` are *not* valid on the `tom` and `yehuda` + variables. They are only valid on `Person`. + To add functions and properties to instances of + a constructor by extending the constructor's prototype + see `reopen` + @method reopenClass + @public + */ + reopenClass: function () { + reopen.apply(this.ClassMixin, arguments); + applyMixin(this, arguments, false); + return this; + }, + + detect: function (obj) { + if ('function' !== typeof obj) { + return false; } - } - return properties; - }).readOnly(), _ClassMixinProps.eachComputedProperty = function (callback, binding) { - var property; - var empty = {}; + while (obj) { + if (obj === this) { + return true; + } + obj = obj.superclass; + } + return false; + }, - var properties = _emberMetal.get(this, '_computedProperties'); + detectInstance: function (obj) { + return obj instanceof this; + }, - for (var i = 0; i < properties.length; i++) { - property = properties[i]; - callback.call(binding || this, property.name, property.meta || empty); + /** + In some cases, you may want to annotate computed properties with additional + metadata about how they function or what values they operate on. For + example, computed property functions may close over variables that are then + no longer available for introspection. + You can pass a hash of these values to a computed property like this: + ```javascript + person: Ember.computed(function() { + var personId = this.get('personId'); + return Person.create({ id: personId }); + }).meta({ type: Person }) + ``` + Once you've done this, you can retrieve the values saved to the computed + property from your class like this: + ```javascript + MyClass.metaForProperty('person'); + ``` + This will return the original hash that was passed to `meta()`. + @static + @method metaForProperty + @param key {String} property name + @private + */ + metaForProperty: function (key) { + var proto = this.proto(); + var possibleDesc = proto[key]; + var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; + + return desc._meta || {}; + }, + + _computedProperties: _emberMetal.computed(function () { + hasCachedComputedProperties = true; + var proto = this.proto(); + var property; + var properties = []; + + for (var name in proto) { + property = proto[name]; + + if (property && property.isDescriptor) { + properties.push({ + name: name, + meta: property._meta + }); + } + } + return properties; + }).readOnly(), + + /** + Iterate over each computed property for the class, passing its name + and any associated metadata (see `metaForProperty`) to the callback. + @static + @method eachComputedProperty + @param {Function} callback + @param {Object} binding + @private + */ + eachComputedProperty: function (callback, binding) { + var property; + var empty = {}; + + var properties = _emberMetal.get(this, '_computedProperties'); + + for (var i = 0; i < properties.length; i++) { + property = properties[i]; + callback.call(binding || this, property.name, property.meta || empty); + } } - }, _ClassMixinProps); + }; function injectedPropertyAssertion() {} @@ -34656,210 +34763,6 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met @public */ -/** - Creates a new subclass. - ```javascript - const Person = Ember.Object.extend({ - say(thing) { - alert(thing); - } - }); - ``` - This defines a new subclass of Ember.Object: `Person`. It contains one method: `say()`. - You can also create a subclass from any existing class by calling its `extend()` method. - For example, you might want to create a subclass of Ember's built-in `Ember.Component` class: - ```javascript - const PersonComponent = Ember.Component.extend({ - tagName: 'li', - classNameBindings: ['isAdministrator'] - }); - ``` - When defining a subclass, you can override methods but still access the - implementation of your parent class by calling the special `_super()` method: - ```javascript - const Person = Ember.Object.extend({ - say(thing) { - var name = this.get('name'); - alert(`${name} says: ${thing}`); - } - }); - const Soldier = Person.extend({ - say(thing) { - this._super(`${thing}, sir!`); - }, - march(numberOfHours) { - alert(`${this.get('name')} marches for ${numberOfHours} hours.`); - } - }); - let yehuda = Soldier.create({ - name: "Yehuda Katz" - }); - yehuda.say("Yes"); // alerts "Yehuda Katz says: Yes, sir!" - ``` - The `create()` on line #17 creates an *instance* of the `Soldier` class. - The `extend()` on line #8 creates a *subclass* of `Person`. Any instance - of the `Person` class will *not* have the `march()` method. - You can also pass `Mixin` classes to add additional properties to the subclass. - ```javascript - const Person = Ember.Object.extend({ - say(thing) { - alert(`${this.get('name')} says: ${thing}`); - } - }); - const SingingMixin = Mixin.create({ - sing(thing){ - alert(`${this.get('name')} sings: la la la ${thing}`); - } - }); - const BroadwayStar = Person.extend(SingingMixin, { - dance() { - alert(`${this.get('name')} dances: tap tap tap tap `); - } - }); - ``` - The `BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`. - @method extend - @static - @param {Mixin} [mixins]* One or more Mixin classes - @param {Object} [arguments]* Object containing values to use within the new class - @public -*/ - -/** - Creates an instance of a class. Accepts either no arguments, or an object - containing values to initialize the newly instantiated object with. - ```javascript - const Person = Ember.Object.extend({ - helloWorld() { - alert(`Hi, my name is ${this.get('name')}`); - } - }); - let tom = Person.create({ - name: 'Tom Dale' - }); - tom.helloWorld(); // alerts "Hi, my name is Tom Dale". - ``` - `create` will call the `init` function if defined during - `Ember.AnyObject.extend` - If no arguments are passed to `create`, it will not set values to the new - instance during initialization: - ```javascript - let noName = Person.create(); - noName.helloWorld(); // alerts undefined - ``` - NOTE: For performance reasons, you cannot declare methods or computed - properties during `create`. You should instead declare methods and computed - properties when using `extend`. - @method create - @static - @param [arguments]* - @public -*/ - -/** - Augments a constructor's prototype with additional - properties and functions: - ```javascript - const MyObject = Ember.Object.extend({ - name: 'an object' - }); - o = MyObject.create(); - o.get('name'); // 'an object' - MyObject.reopen({ - say(msg){ - console.log(msg); - } - }) - o2 = MyObject.create(); - o2.say("hello"); // logs "hello" - o.say("goodbye"); // logs "goodbye" - ``` - To add functions and properties to the constructor itself, - see `reopenClass` - @method reopen - @public -*/ - -/** - Augments a constructor's own properties and functions: - ```javascript - const MyObject = Ember.Object.extend({ - name: 'an object' - }); - MyObject.reopenClass({ - canBuild: false - }); - MyObject.canBuild; // false - o = MyObject.create(); - ``` - In other words, this creates static properties and functions for the class. - These are only available on the class and not on any instance of that class. - ```javascript - const Person = Ember.Object.extend({ - name: "", - sayHello() { - alert("Hello. My name is " + this.get('name')); - } - }); - Person.reopenClass({ - species: "Homo sapiens", - createPerson(newPersonsName){ - return Person.create({ - name:newPersonsName - }); - } - }); - let tom = Person.create({ - name: "Tom Dale" - }); - let yehuda = Person.createPerson("Yehuda Katz"); - tom.sayHello(); // "Hello. My name is Tom Dale" - yehuda.sayHello(); // "Hello. My name is Yehuda Katz" - alert(Person.species); // "Homo sapiens" - ``` - Note that `species` and `createPerson` are *not* valid on the `tom` and `yehuda` - variables. They are only valid on `Person`. - To add functions and properties to instances of - a constructor by extending the constructor's prototype - see `reopen` - @method reopenClass - @public -*/ - -/** - In some cases, you may want to annotate computed properties with additional - metadata about how they function or what values they operate on. For - example, computed property functions may close over variables that are then - no longer available for introspection. - You can pass a hash of these values to a computed property like this: - ```javascript - person: Ember.computed(function() { - var personId = this.get('personId'); - return Person.create({ id: personId }); - }).meta({ type: Person }) - ``` - Once you've done this, you can retrieve the values saved to the computed - property from your class like this: - ```javascript - MyClass.metaForProperty('person'); - ``` - This will return the original hash that was passed to `meta()`. - @static - @method metaForProperty - @param key {String} property name - @private -*/ - -/** - Iterate over each computed property for the class, passing its name - and any associated metadata (see `metaForProperty`) to the callback. - @static - @method eachComputedProperty - @param {Function} callback - @param {Object} binding - @private -*/ - /** Provides lookup-time type validation for injected properties. @private @@ -35116,7 +35019,7 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal } findNamespaces(); - return this[_emberUtils.NAME_KEY]; + return this[_emberMetal.NAME_KEY]; }, nameClasses: function () { @@ -35176,10 +35079,10 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal paths[idx] = key; // If we have found an unprocessed class - if (obj && obj.toString === classToString && !obj[_emberUtils.NAME_KEY]) { + if (obj && obj.toString === classToString && !obj[_emberMetal.NAME_KEY]) { // Replace the class' `toString` with the dot-separated path // and set its `NAME_KEY` - obj[_emberUtils.NAME_KEY] = paths.join('.'); + obj[_emberMetal.NAME_KEY] = paths.join('.'); // Support nested namespaces } else if (obj && obj.isNamespace) { @@ -35225,7 +35128,7 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal } var obj = tryIsNamespace(lookup, key); if (obj) { - obj[_emberUtils.NAME_KEY] = key; + obj[_emberMetal.NAME_KEY] = key; } } } @@ -35233,41 +35136,35 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal function superClassString(mixin) { var superclass = mixin.superclass; if (superclass) { - if (superclass[_emberUtils.NAME_KEY]) { - return superclass[_emberUtils.NAME_KEY]; + if (superclass[_emberMetal.NAME_KEY]) { + return superclass[_emberMetal.NAME_KEY]; } return superClassString(superclass); } } - function calculateToString(target) { - var str = undefined; - - if (!searchDisabled) { + function classToString() { + if (!searchDisabled && !this[_emberMetal.NAME_KEY]) { processAllNamespaces(); - // can also be set by processAllNamespaces - str = target[_emberUtils.NAME_KEY]; + } + + var ret = undefined; + + if (this[_emberMetal.NAME_KEY]) { + ret = this[_emberMetal.NAME_KEY]; + } else if (this._toString) { + ret = this._toString; + } else { + var str = superClassString(this); if (str) { - return str; + ret = '(subclass of ' + str + ')'; } else { - str = superClassString(target); - str = str ? '(subclass of ' + str + ')' : str; + ret = '(unknown mixin)'; } - } - if (str) { - return str; - } else { - return '(unknown mixin)'; - } - } - - function classToString() { - var name = this[_emberUtils.NAME_KEY]; - if (name) { - return name; + this.toString = makeToString(ret); } - return this[_emberUtils.NAME_KEY] = calculateToString(this); + return ret; } function processAllNamespaces() { @@ -35292,6 +35189,12 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal } } + function makeToString(ret) { + return function () { + return ret; + }; + } + _emberMetal.Mixin.prototype.toString = classToString; // ES6TODO: altering imported objects. SBB. exports.default = Namespace; @@ -36379,7 +36282,7 @@ enifed('ember-utils/guid', ['exports', 'ember-utils/intern'], function (exports, } } }); -enifed('ember-utils/index', ['exports', 'ember-utils/symbol', 'ember-utils/owner', 'ember-utils/assign', 'ember-utils/empty-object', 'ember-utils/dictionary', 'ember-utils/guid', 'ember-utils/intern', 'ember-utils/super', 'ember-utils/inspect', 'ember-utils/lookup-descriptor', 'ember-utils/invoke', 'ember-utils/make-array', 'ember-utils/apply-str', 'ember-utils/name', 'ember-utils/to-string'], function (exports, _emberUtilsSymbol, _emberUtilsOwner, _emberUtilsAssign, _emberUtilsEmptyObject, _emberUtilsDictionary, _emberUtilsGuid, _emberUtilsIntern, _emberUtilsSuper, _emberUtilsInspect, _emberUtilsLookupDescriptor, _emberUtilsInvoke, _emberUtilsMakeArray, _emberUtilsApplyStr, _emberUtilsName, _emberUtilsToString) { +enifed('ember-utils/index', ['exports', 'ember-utils/symbol', 'ember-utils/owner', 'ember-utils/assign', 'ember-utils/empty-object', 'ember-utils/dictionary', 'ember-utils/guid', 'ember-utils/intern', 'ember-utils/super', 'ember-utils/inspect', 'ember-utils/lookup-descriptor', 'ember-utils/invoke', 'ember-utils/make-array', 'ember-utils/apply-str', 'ember-utils/to-string'], function (exports, _emberUtilsSymbol, _emberUtilsOwner, _emberUtilsAssign, _emberUtilsEmptyObject, _emberUtilsDictionary, _emberUtilsGuid, _emberUtilsIntern, _emberUtilsSuper, _emberUtilsInspect, _emberUtilsLookupDescriptor, _emberUtilsInvoke, _emberUtilsMakeArray, _emberUtilsApplyStr, _emberUtilsToString) { /* This package will be eagerly parsed and should have no dependencies on external packages. @@ -36415,7 +36318,6 @@ enifed('ember-utils/index', ['exports', 'ember-utils/symbol', 'ember-utils/owner exports.tryInvoke = _emberUtilsInvoke.tryInvoke; exports.makeArray = _emberUtilsMakeArray.default; exports.applyStr = _emberUtilsApplyStr.default; - exports.NAME_KEY = _emberUtilsName.default; exports.toString = _emberUtilsToString.default; }); enifed('ember-utils/inspect', ['exports'], function (exports) { @@ -36648,11 +36550,6 @@ enifed("ember-utils/make-array", ["exports"], function (exports) { return Array.isArray(obj) ? obj : [obj]; } }); -enifed('ember-utils/name', ['exports', 'ember-utils/symbol'], function (exports, _emberUtilsSymbol) { - 'use strict'; - - exports.default = _emberUtilsSymbol.default('NAME_KEY'); -}); enifed('ember-utils/owner', ['exports', 'ember-utils/symbol'], function (exports, _emberUtilsSymbol) { /** @module ember @@ -36811,12 +36708,12 @@ enifed('ember-utils/symbol', ['exports', 'ember-utils/guid', 'ember-utils/intern // TODO: Investigate using platform symbols, but we do not // want to require non-enumerability for this API, which // would introduce a large cost. - - return _emberUtilsIntern.default(debugName + ' [id=' + _emberUtilsGuid.GUID_KEY + Math.floor(Math.random() * new Date()) + ']'); + var id = _emberUtilsGuid.GUID_KEY + Math.floor(Math.random() * new Date()); + return _emberUtilsIntern.default('__' + debugName + '__ [id=' + id + ']'); } }); -enifed('ember-utils/to-string', ['exports'], function (exports) { - 'use strict'; +enifed("ember-utils/to-string", ["exports"], function (exports) { + "use strict"; exports.default = toString; var objectToString = Object.prototype.toString; @@ -36827,7 +36724,7 @@ enifed('ember-utils/to-string', ['exports'], function (exports) { */ function toString(obj) { - if (obj && typeof obj.toString === 'function') { + if (obj && obj.toString) { return obj.toString(); } else { return objectToString.call(obj); @@ -37022,6 +36919,7 @@ enifed('ember-views/mixins/action_support', ['exports', 'ember-utils', 'ember-me args[_key2 - 1] = arguments[_key2]; } + var target = undefined; var action = this.actions && this.actions[actionName]; if (action) { @@ -37031,9 +36929,12 @@ enifed('ember-views/mixins/action_support', ['exports', 'ember-utils', 'ember-me } } - var target = _emberMetal.get(this, 'target'); + target = _emberMetal.get(this, 'target'); + if (target) { - target.send.apply(target, arguments); + var _target; + + (_target = target).send.apply(_target, arguments); } else {} } }); @@ -37098,6 +36999,10 @@ enifed('ember-views/mixins/class_names_support', ['exports', 'ember-metal'], fun init: function () { this._super.apply(this, arguments); + + this.classNameBindings = this.classNameBindings.slice(); + + this.classNames = this.classNames.slice(); }, /** @@ -37540,7 +37445,9 @@ enifed('ember-views/mixins/view_support', ['exports', 'ember-utils', 'ember-meta return this.renderer.getElement(this); } }), _Mixin$create.$ = function (sel) { - return this._currentState.$(this, sel); + if (this.element) { + return sel ? _emberViewsSystemJquery.default(sel, this.element) : _emberViewsSystemJquery.default(this.element); + } }, _Mixin$create.appendTo = function (selector) { var env = this._environment || _emberEnvironment.environment; var target = undefined; @@ -37697,7 +37604,6 @@ enifed('ember-views/mixins/view_support', ['exports', 'ember-utils', 'ember-meta @method renderToElement @param {String} tagName The tag of the element to create and render into. Defaults to "body". @return {HTMLBodyElement} element - @deprecated Use appendTo instead. @private */ @@ -38630,10 +38536,6 @@ enifed('ember-views/views/states/default', ['exports', 'ember-metal'], function throw new _emberMetal.Error('You can\'t use appendChild outside of the rendering process'); }, - $: function () { - return undefined; - }, - // Handle events from `Ember.EventDispatcher` handleEvent: function () { return true; // continue event propagation @@ -38665,16 +38567,12 @@ enifed('ember-views/views/states/destroying', ['exports', 'ember-utils', 'ember- exports.default = destroying; }); -enifed('ember-views/views/states/has_element', ['exports', 'ember-utils', 'ember-views/views/states/default', 'ember-metal', 'ember-views/system/jquery'], function (exports, _emberUtils, _emberViewsViewsStatesDefault, _emberMetal, _emberViewsSystemJquery) { +enifed('ember-views/views/states/has_element', ['exports', 'ember-utils', 'ember-views/views/states/default', 'ember-metal'], function (exports, _emberUtils, _emberViewsViewsStatesDefault, _emberMetal) { 'use strict'; var hasElement = Object.create(_emberViewsViewsStatesDefault.default); _emberUtils.assign(hasElement, { - $: function (view, sel) { - var elem = view.element; - return sel ? _emberViewsSystemJquery.default(sel, elem) : _emberViewsSystemJquery.default(elem); - }, rerender: function (view) { view.renderer.rerender(view); @@ -39231,7 +39129,7 @@ enifed("ember-views/views/view", ["exports"], function (exports) { enifed("ember/features", ["exports"], function (exports) { "use strict"; - exports.default = { "features-stripped-test": false, "ember-libraries-isregistered": false, "ember-runtime-computed-uniq-by": true, "ember-improved-instrumentation": false, "ember-runtime-enumerable-includes": true, "ember-string-ishtmlsafe": true, "ember-testing-check-waiters": true, "ember-metal-weakmap": false, "ember-glimmer-allow-backtracking-rerender": false, "ember-testing-resume-test": false, "mandatory-setter": false, "ember-glimmer-detect-backtracking-rerender": false }; + exports.default = { "features-stripped-test": false, "ember-libraries-isregistered": false, "ember-runtime-computed-uniq-by": true, "ember-improved-instrumentation": false, "ember-runtime-enumerable-includes": true, "ember-string-ishtmlsafe": true, "ember-testing-check-waiters": true, "ember-metal-weakmap": false, "ember-glimmer-allow-backtracking-rerender": true, "ember-testing-resume-test": false, "ember-glimmer-detect-backtracking-rerender": false, "mandatory-setter": false }; }); enifed('ember/index', ['exports', 'require', 'ember-environment', 'ember-utils', 'container', 'ember-metal', 'backburner', 'ember-console', 'ember-runtime', 'ember-glimmer', 'ember/version', 'ember-views', 'ember-routing', 'ember-application', 'ember-extension-support'], function (exports, _require, _emberEnvironment, _emberUtils, _container, _emberMetal, _backburner, _emberConsole, _emberRuntime, _emberGlimmer, _emberVersion, _emberViews, _emberRouting, _emberApplication, _emberExtensionSupport) { 'use strict'; @@ -39337,7 +39235,7 @@ enifed('ember/index', ['exports', 'require', 'ember-environment', 'ember-utils', _emberMetal.default.getProperties = _emberMetal.getProperties; _emberMetal.default.setProperties = _emberMetal.setProperties; _emberMetal.default.expandProperties = _emberMetal.expandProperties; - _emberMetal.default.NAME_KEY = _emberUtils.NAME_KEY; + _emberMetal.default.NAME_KEY = _emberMetal.NAME_KEY; _emberMetal.default.addObserver = _emberMetal.addObserver; _emberMetal.default.observersFor = _emberMetal.observersFor; _emberMetal.default.removeObserver = _emberMetal.removeObserver; @@ -39761,7 +39659,7 @@ enifed('ember/index', ['exports', 'require', 'ember-environment', 'ember-utils', enifed("ember/version", ["exports"], function (exports) { "use strict"; - exports.default = "2.11.0-beta.2"; + exports.default = "2.10.2-with-backtracking"; }); enifed('internal-test-helpers/apply-mixins', ['exports', 'ember-utils'], function (exports, _emberUtils) { 'use strict'; @@ -40929,7 +40827,7 @@ enifed('glimmer-node/index', ['exports', 'glimmer-node/lib/node-dom-helper'], fu exports.NodeDOMTreeConstruction = _glimmerNodeLibNodeDomHelper.default; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItbm9kZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7VUFBb0IsdUJBQXVCLGdDQUFsQyxPQUFPIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgZGVmYXVsdCBhcyBOb2RlRE9NVHJlZUNvbnN0cnVjdGlvbiB9IGZyb20gJy4vbGliL25vZGUtZG9tLWhlbHBlcic7XG4iXX0= + enifed('glimmer-node/lib/node-dom-helper', ['exports', 'glimmer-runtime'], function (exports, _glimmerRuntime) { 'use strict'; @@ -40970,7 +40868,7 @@ enifed('glimmer-node/lib/node-dom-helper', ['exports', 'glimmer-runtime'], funct exports.default = NodeDOMTreeConstruction; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItbm9kZS9saWIvbm9kZS1kb20taGVscGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQU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ID0gdGhpcy5kb2N1bWVudC5jcmVhdGVSYXdIVE1MU2VjdGlvbihodG1sKTtcbiAgICBwYXJlbnQuaW5zZXJ0QmVmb3JlKHJhdywgcmVmZXJlbmNlKTtcblxuICAgIGxldCBmaXJzdCA9IHByZXYgPyBwcmV2Lm5leHRTaWJsaW5nIDogcGFyZW50LmZpcnN0Q2hpbGQ7XG4gICAgbGV0IGxhc3QgPSByZWZlcmVuY2UgPyByZWZlcmVuY2UucHJldmlvdXNTaWJsaW5nIDogcGFyZW50Lmxhc3RDaGlsZDtcblxuICAgIHJldHVybiBuZXcgQ29uY3JldGVCb3VuZHMocGFyZW50LCBmaXJzdCwgbGFzdCk7XG4gIH1cblxuICAvLyBvdmVycmlkZSB0byBhdm9pZCBTVkcgZGV0ZWN0aW9uL3dvcmsgd2hlbiBpbiBub2RlICh0aGlzIGlzIG5vdCBuZWVkZWQgaW4gU1NSKVxuICBjcmVhdGVFbGVtZW50KHRhZzogc3RyaW5nKSB7XG4gICAgcmV0dXJuIHRoaXMuZG9jdW1lbnQuY3JlYXRlRWxlbWVudCh0YWcpO1xuICB9XG5cbiAgLy8gb3ZlcnJpZGUgdG8gYXZvaWQgbmFtZXNwYWNlIHNoZW5hbmlnYW5zIHdoZW4gaW4gbm9kZSAodGhpcyBpcyBub3QgbmVlZGVkIGluIFNTUilcbiAgc2V0QXR0cmlidXRlKGVsZW1lbnQ6IEVsZW1lbnQsIG5hbWU6IHN0cmluZywgdmFsdWU6IHN0cmluZykge1xuICAgIGVsZW1lbnQuc2V0QXR0cmlidXRlKG5hbWUsIHZhbHVlKTtcbiAgfVxufVxuIl19 + enifed('glimmer-reference/index', ['exports', 'glimmer-reference/lib/reference', 'glimmer-reference/lib/const', 'glimmer-reference/lib/validators', 'glimmer-reference/lib/utils', 'glimmer-reference/lib/iterable'], function (exports, _glimmerReferenceLibReference, _glimmerReferenceLibConst, _glimmerReferenceLibValidators, _glimmerReferenceLibUtils, _glimmerReferenceLibIterable) { 'use strict'; @@ -40994,7 +40892,7 @@ enifed('glimmer-reference/index', ['exports', 'glimmer-reference/lib/reference', exports.IteratorSynchronizer = _glimmerReferenceLibIterable.IteratorSynchronizer; exports.IteratorSynchronizerDelegate = _glimmerReferenceLibIterable.IteratorSynchronizerDelegate; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztVQUNlLGNBQWMsaUNBQTNCLFNBQVM7VUFDUSxrQkFBa0IsaUNBQW5DLGFBQWE7VUFJYixjQUFjLDZCQUFkLGNBQWM7VUFDZCxPQUFPLDZCQUFQLE9BQU87O1VBTWUsU0FBUyxrQ0FBL0Isa0JBQWtCO1VBQ1EsYUFBYSxrQ0FBdkMsc0JBQXNCO1VBSXRCLGtCQUFrQiw2QkFBbEIsa0JBQWtCO1VBSWxCLGFBQWEsZ0NBQWIsYUFBYTtVQUNiLFFBQVEsZ0NBQVIsUUFBUTtVQUNSLFFBQVEsZ0NBQVIsUUFBUTtVQUNSLGNBQWMsZ0NBQWQsY0FBYztVQUNkLGNBQWMsZ0NBQWQsY0FBYztVQUNkLGdCQUFnQixnQ0FBaEIsZ0JBQWdCO1VBQ2hCLGdCQUFnQixnQ0FBaEIsZ0JBQWdCO1VBQ2hCLGtCQUFrQixnQ0FBbEIsa0JBQWtCO1VBQ2xCLGlCQUFpQixnQ0FBakIsaUJBQWlCO1VBQ2pCLG9CQUFvQixnQ0FBcEIsb0JBQW9CO1VBQ3BCLDRCQUE0QixnQ0FBNUIsNEJBQTRCIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHtcbiAgUmVmZXJlbmNlIGFzIEJhc2ljUmVmZXJlbmNlLFxuICBQYXRoUmVmZXJlbmNlIGFzIEJhc2ljUGF0aFJlZmVyZW5jZVxufSBmcm9tICcuL2xpYi9yZWZlcmVuY2UnO1xuXG5leHBvcnQge1xuICBDb25zdFJlZmVyZW5jZSxcbiAgaXNDb25zdFxufSBmcm9tICcuL2xpYi9jb25zdCc7XG5cbmV4cG9ydCAqIGZyb20gJy4vbGliL3ZhbGlkYXRvcnMnO1xuXG5leHBvcnQge1xuICBWZXJzaW9uZWRSZWZlcmVuY2UgYXMgUmVmZXJlbmNlLFxuICBWZXJzaW9uZWRQYXRoUmVmZXJlbmNlIGFzIFBhdGhSZWZlcmVuY2Vcbn0gZnJvbSAnLi9saWIvdmFsaWRhdG9ycyc7XG5cbmV4cG9ydCB7XG4gIHJlZmVyZW5jZUZyb21QYXJ0c1xufSBmcm9tICcuL2xpYi91dGlscyc7XG5cbmV4cG9ydCB7XG4gIEl0ZXJhdGlvbkl0ZW0sXG4gIEl0ZXJhdG9yLFxuICBJdGVyYWJsZSxcbiAgT3BhcXVlSXRlcmF0b3IsXG4gIE9wYXF1ZUl0ZXJhYmxlLFxuICBBYnN0cmFjdEl0ZXJhdG9yLFxuICBBYnN0cmFjdEl0ZXJhYmxlLFxuICBJdGVyYXRpb25BcnRpZmFjdHMsXG4gIFJlZmVyZW5jZUl0ZXJhdG9yLFxuICBJdGVyYXRvclN5bmNocm9uaXplcixcbiAgSXRlcmF0b3JTeW5jaHJvbml6ZXJEZWxlZ2F0ZVxufSBmcm9tICcuL2xpYi9pdGVyYWJsZSc7XG4iXX0= + enifed('glimmer-reference/lib/const', ['exports', 'glimmer-reference/lib/validators'], function (exports, _glimmerReferenceLibValidators) { 'use strict'; @@ -41019,7 +40917,7 @@ enifed('glimmer-reference/lib/const', ['exports', 'glimmer-reference/lib/validat return reference.tag === _glimmerReferenceLibValidators.CONSTANT_TAG; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2xpYi9jb25zdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztRQUdBLGNBQ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util"], function (exports, _glimmerUtil) { "use strict"; @@ -41295,11 +41193,11 @@ enifed("glimmer-reference/lib/iterable", ["exports", "glimmer-util"], function ( exports.IteratorSynchronizer = IteratorSynchronizer; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2xpYi9pdGVyYWJsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFrQ0EsUUFBQTs4QkFBQSxRQUFBOztBQU9FLGlCQVBGLFFBQUEsQ0FPYyxRQUF3QixFQUFFLE1BQTJCLEVBQUE7QUFDL0QsaUNBQU0sUUFBUSxDQUFDLGlCQUFpQixDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUM7QUFMckMsZ0JBQUEsQ0FBQSxRQUFRLEdBQVksS0FBSyxDQUFDO0FBQzFCLGdCQUFBLENBQUEsSUFBSSxHQUFZLEtBQUssQ0FBQztBQUszQixnQkFBSSxDQUFDLEdBQUcsR0FBRyxNQUFNLENBQUMsR0FBRyxDQUFDO0FBQ3RCLGdCQUFJLENBQUMsUUFBUSxHQUFHLFFBQVEsQ0FBQztBQUN6QixnQkFBSSxDQUFDLElBQUksR0FBRyxRQUFRLENBQUMsZ0JBQWdCLENBQUMsTUFBTSxDQUFDLENBQUM7U0FDL0M7O0FBWkgsZ0JBQUEsV0FjRSxNQUFNLEdBQUEsZ0JBQUMsSUFBeUIsRUFBQTtBQUM5QixnQkFBSSxDQUFDLFFBQVEsR0FBRyxJQUFJLENBQUM7QUFDckIsZ0JBQUksQ0FBQyxRQUFRLENBQUMsb0JBQW9CLENBQUMsSUFBSSxDQUFDLEtBQUssRUFBRSxJQUFJLENBQUMsQ0FBQztBQUNyRCxnQkFBSSxDQUFDLFFBQVEsQ0FBQyxtQkFBbUIsQ0FBQyxJQUFJLENBQUMsSUFBSSxFQUFFLElBQUksQ0FBQyxDQUFDO1NBQ3BEOztBQWxCSCxnQkFBQSxXQW9C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2V0LCBjdXJyZW50IH0gPSB0aGlzO1xuXG4gICAgbGV0IG5vZGUgPSBhcnRpZmFjdHMuaW5zZXJ0QmVmb3JlKGl0ZW0sIGN1cnJlbnQpO1xuICAgIHRhcmdldC5pbnNlcnQobm9kZS5rZXksIG5vZGUudmFsdWUsIG5vZGUubWVtbywgY3VycmVudCA/IGN1cnJlbnQua2V5IDogbnVsbCk7XG4gIH1cblxuICBwcml2YXRlIHN0YXJ0UHJ1bmUoKTogUGhhc2Uge1xuICAgIHRoaXMuY3VycmVudCA9IHRoaXMuYXJ0aWZhY3RzLmhlYWQoKTtcbiAgICByZXR1cm4gUGhhc2UuUHJ1bmU7XG4gIH1cblxuICBwcml2YXRlIG5leHRQcnVuZSgpOiBQaGFzZSB7XG4gICAgbGV0IHsgYXJ0aWZhY3RzLCB0YXJnZXQsIGN1cnJlbnQgfSA9IHRoaXM7XG5cbiAgICBpZiAoY3VycmVudCA9PT0gbnVsbCkge1xuICAgICAgcmV0dXJuIFBoYXNlLkRvbmU7XG4gICAgfVxuXG4gICAgbGV0IG5vZGUgPSBjdXJyZW50O1xuICAgIHRoaXMuY3VycmVudCA9IGFydGlmYWN0cy5uZXh0Tm9kZShub2RlKTtcblxuICAgIGlmIChub2RlLnNob3VsZFJlbW92ZSgpKSB7XG4gICAgICBhcnRpZmFjdHMucmVtb3ZlKG5vZGUpO1xuICAgICAgdGFyZ2V0LmRlbGV0ZShub2RlLmtleSk7XG4gICAgfSBlbHNlIHtcbiAgICAgIG5vZGUucmVzZXQoKTtcbiAgICB9XG5cbiAgICByZXR1cm4gUGhhc2UuUHJ1bmU7XG4gIH1cblxuICBwcml2YXRlIG5leHREb25lKCkge1xuICAgIHRoaXMudGFyZ2V0LmRvbmUoKTtcbiAgfVxufVxuIl19 + enifed("glimmer-reference/lib/reference", ["exports"], function (exports) { "use strict"; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2xpYi9yZWZlcmVuY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJyZWZlcmVuY2UuanMiLCJzb3VyY2VzQ29udGVudCI6W119 + enifed("glimmer-reference/lib/utils", ["exports"], function (exports) { "use strict"; @@ -41313,7 +41211,7 @@ enifed("glimmer-reference/lib/utils", ["exports"], function (exports) { return reference; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2xpYi91dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUdBLGFBQUEsa0JBQUEsQ0FBbUMsSUFBb0MsRUFBRSxLQUFlLEVBQUE7QUFDdEYsWUFBSSxTQUFTLEdBQUcsSUFBSSxDQUFDO0FBRXJCLGFBQUssSUFBSSxDQUFDLEdBQUMsQ0FBQyxFQUFFLENBQUMsR0FBQyxLQUFLLENBQUMsTUFBTSxFQUFFLENBQUMsRUFBRSxFQUFFO0FBQ2pDLHFCQUFTLEdBQUcsU0FBUyxDQUFDLEdBQUcsQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztTQUNyQztBQUVELGVBQU8sU0FBUyxDQUFDO0tBQ2xCIiwiZmlsZSI6InV0aWxzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgVmVyc2lvbmVkUGF0aFJlZmVyZW5jZSB9IGZyb20gJy4vdmFsaWRhdG9ycyc7XG5pbXBvcnQgeyBPcGFxdWUgfSBmcm9tICdnbGltbWVyLXV0aWwnO1xuXG5leHBvcnQgZnVuY3Rpb24gcmVmZXJlbmNlRnJvbVBhcnRzKHJvb3Q6IFZlcnNpb25lZFBhdGhSZWZlcmVuY2U8T3BhcXVlPiwgcGFydHM6IHN0cmluZ1tdKTogVmVyc2lvbmVkUGF0aFJlZmVyZW5jZTxPcGFxdWU+IHtcbiAgbGV0IHJlZmVyZW5jZSA9IHJvb3Q7XG5cbiAgZm9yIChsZXQgaT0wOyBpPHBhcnRzLmxlbmd0aDsgaSsrKSB7XG4gICAgcmVmZXJlbmNlID0gcmVmZXJlbmNlLmdldChwYXJ0c1tpXSk7XG4gIH1cblxuICByZXR1cm4gcmVmZXJlbmNlO1xufVxuIl19 + enifed("glimmer-reference/lib/validators", ["exports"], function (exports) { "use strict"; @@ -41658,7 +41556,7 @@ enifed("glimmer-reference/lib/validators", ["exports"], function (exports) { return value !== NOT_MODIFIED; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2xpYi92YWxpZGF0b3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O0FBa0JPLFFBQU0sUUFBUSxHQUFhLENBQUMsQ0FBQzs7QUFDN0IsUUFBTSxPQUFPLEdBQWMsQ0FBQyxDQUFDOztBQUM3QixRQUFNLFFBQVEsR0FBYSxHQUFHLENBQUM7OztRQUV0QyxXQUFBO2lCQUFBLFdBQUE7O0FBQUEsbUJBQUEsV0FHRSxRQUFRLEdBQUEsa0JBQUMsUUFBa0IsRUFBQTtBQUN6QixtQkFBTyxJQUFJLENBQUMsS0FBSyxFQUFFLEtBQUssUUFBUSxDQUFDO1NBQ2xDOztlQUxILFdBQUE7Ozs7O0FBUUEsUUFBSSxTQUFTLEdBQUcsT0FBTyxDQUFDOztRQUV4QixZQUFBOzhCQUFBLFlBQUE7O0FBR0UsaUJBSEYsWUFBQSxHQUdrQztnQkFBcEIsUUFBUSx5REFBRyxTQUFTOztBQUM5QixtQ0FBTyxDQUFDO0FBQ1IsZ0JBQUksQ0FBQyxRQUFRLEdBQUcsUUFBUSxDQUFDO1NBQzFCOztBQU5ILG9CQUFBLFdBUUUsS0FBSyxHQUFBLGlCQUFBO0FBQ0gsbUJBQU8sSUFBSSxDQUFDLFFBQVEsQ0FBQztTQUN0Qjs7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jItNGU0Yi04NzdhLTYzMTdjMmM1YzE0NVwiO1xuXG5jb25zdCBOT1RfTU9ESUZJRUQ6IE5vdE1vZGlmaWVkID0gXCJhZGIzYjc4ZS0zZDIyLTRlNGItODc3YS02MzE3YzJjNWMxNDVcIjtcblxuZXhwb3J0IGZ1bmN0aW9uIGlzTW9kaWZpZWQ8VD4odmFsdWU6IFZhbGlkYXRpb248VD4pOiB2YWx1ZSBpcyBUIHtcbiAgcmV0dXJuIHZhbHVlICE9PSBOT1RfTU9ESUZJRUQ7XG59XG4iXX0= + enifed('glimmer-runtime/index', ['exports', 'glimmer-runtime/lib/dom/interfaces', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/template', 'glimmer-runtime/lib/symbol-table', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/syntax/core', 'glimmer-runtime/lib/compiled/opcodes/builder', 'glimmer-runtime/lib/compiler', 'glimmer-runtime/lib/opcode-builder', 'glimmer-runtime/lib/compiled/blocks', 'glimmer-runtime/lib/dom/attribute-managers', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/compiled/expressions/function', 'glimmer-runtime/lib/helpers/get-dynamic-var', 'glimmer-runtime/lib/syntax/builtins/with-dynamic-vars', 'glimmer-runtime/lib/syntax/builtins/in-element', 'glimmer-runtime/lib/vm', 'glimmer-runtime/lib/upsert', 'glimmer-runtime/lib/environment', 'glimmer-runtime/lib/partial', 'glimmer-runtime/lib/component/interfaces', 'glimmer-runtime/lib/modifier/interfaces', 'glimmer-runtime/lib/dom/helper', 'glimmer-runtime/lib/builder', 'glimmer-runtime/lib/bounds'], function (exports, _glimmerRuntimeLibDomInterfaces, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibTemplate, _glimmerRuntimeLibSymbolTable, _glimmerRuntimeLibReferences, _glimmerRuntimeLibSyntaxCore, _glimmerRuntimeLibCompiledOpcodesBuilder, _glimmerRuntimeLibCompiler, _glimmerRuntimeLibOpcodeBuilder, _glimmerRuntimeLibCompiledBlocks, _glimmerRuntimeLibDomAttributeManagers, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerRuntimeLibCompiledExpressions, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibCompiledExpressionsFunction, _glimmerRuntimeLibHelpersGetDynamicVar, _glimmerRuntimeLibSyntaxBuiltinsWithDynamicVars, _glimmerRuntimeLibSyntaxBuiltinsInElement, _glimmerRuntimeLibVm, _glimmerRuntimeLibUpsert, _glimmerRuntimeLibEnvironment, _glimmerRuntimeLibPartial, _glimmerRuntimeLibComponentInterfaces, _glimmerRuntimeLibModifierInterfaces, _glimmerRuntimeLibDomHelper, _glimmerRuntimeLibBuilder, _glimmerRuntimeLibBounds) { 'use strict'; @@ -41759,7 +41657,7 @@ enifed('glimmer-runtime/index', ['exports', 'glimmer-runtime/lib/dom/interfaces' exports.Bounds = _glimmerRuntimeLibBounds.default; exports.ConcreteBounds = _glimmerRuntimeLibBounds.ConcreteBounds; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7VUFDZSxnQkFBZ0IsNEJBQTdCLFNBQVM7VUFDSSxlQUFlLDRCQUE1QixTQUFTO1VBQ0ssZ0JBQWdCLDRCQUE5QixVQUFVO1VBQ0csZUFBZSw0QkFBNUIsU0FBUztVQUNULDBCQUEwQiw0QkFBMUIsMEJBQTBCO1VBQzFCLFlBQVksNEJBQVosWUFBWTtVQUNaLFdBQVcsNEJBQVgsV0FBVztVQUNYLFdBQVcsNEJBQVgsV0FBVztVQUdPLGVBQWUsOEJBQTFCLE9BQU87VUFBcUIsZUFBZSw4QkFBZixlQUFlO1VBQUUsUUFBUSw4QkFBUixRQUFRO1VBRTFDLFdBQVcsaUNBQXRCLE9BQU87VUFFUCx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W50TGF5b3V0QnVpbGRlcixcbiAgQ29tcG9uZW50QXR0cnNCdWlsZGVyLFxuICBpc0NvbXBvbmVudERlZmluaXRpb25cbn0gZnJvbSAnLi9saWIvY29tcG9uZW50L2ludGVyZmFjZXMnO1xuXG5leHBvcnQge1xuICBNb2RpZmllck1hbmFnZXJcbn0gZnJvbSAnLi9saWIvbW9kaWZpZXIvaW50ZXJmYWNlcyc7XG5cbmV4cG9ydCB7IGRlZmF1bHQgYXMgRE9NQ2hhbmdlcywgRE9NQ2hhbmdlcyBhcyBJRE9NQ2hhbmdlcywgRE9NVHJlZUNvbnN0cnVjdGlvbiwgaXNXaGl0ZXNwYWNlLCBpbnNlcnRIVE1MQmVmb3JlIH0gZnJvbSAnLi9saWIvZG9tL2hlbHBlcic7XG5pbXBvcnQgICogYXMgU2ltcGxlIGZyb20gJy4vbGliL2RvbS9pbnRlcmZhY2VzJztcbmV4cG9ydCB7IFNpbXBsZSB9O1xuZXhwb3J0IHsgRWxlbWVudFN0YWNrLCBFbGVtZW50T3BlcmF0aW9ucyB9IGZyb20gJy4vbGliL2J1aWxkZXInO1xuZXhwb3J0IHsgZGVmYXVsdCBhcyBCb3VuZHMsIENvbmNyZXRlQm91bmRzIH0gZnJvbSAnLi9saWIvYm91bmRzJztcbiJdfQ== + enifed("glimmer-runtime/lib/bounds", ["exports"], function (exports) { "use strict"; @@ -41880,7 +41778,7 @@ enifed("glimmer-runtime/lib/bounds", ["exports"], function (exports) { return null; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvYm91bmRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O1FBVUEsTUFBQSxHQUNFLFNBREYsTUFBQSxDQUNxQixPQUF1QixFQUFTLFdBQXdCLEVBQUE7QUFBeEQsWUFBQSxDQUFBLE9BQU8sR0FBUCxPQUFPLENBQWdCO0FBQVMsWUFBQS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Z2xlTm9kZUJvdW5kcyhwYXJlbnQsIG5vZGUpO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gbW92ZShib3VuZHM6IEJvdW5kcywgcmVmZXJlbmNlOiBTaW1wbGUuTm9kZSkge1xuICBsZXQgcGFyZW50ID0gYm91bmRzLnBhcmVudEVsZW1lbnQoKTtcbiAgbGV0IGZpcnN0ID0gYm91bmRzLmZpcnN0Tm9kZSgpO1xuICBsZXQgbGFzdCA9IGJvdW5kcy5sYXN0Tm9kZSgpO1xuXG4gIGxldCBub2RlID0gZmlyc3Q7XG5cbiAgd2hpbGUgKG5vZGUpIHtcbiAgICBsZXQgbmV4dCA9IG5vZGUubmV4dFNpYmxpbmc7XG4gICAgcGFyZW50Lmluc2VydEJlZm9yZShub2RlLCByZWZlcmVuY2UpO1xuICAgIGlmIChub2RlID09PSBsYXN0KSByZXR1cm4gbmV4dDtcbiAgICBub2RlID0gbmV4dDtcbiAgfVxuXG4gIHJldHVybiBudWxsO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gY2xlYXIoYm91bmRzOiBCb3VuZHMpOiBTaW1wbGUuTm9kZSB7XG4gIGxldCBwYXJlbnQgPSBib3VuZHMucGFyZW50RWxlbWVudCgpO1xuICBsZXQgZmlyc3QgPSBib3VuZHMuZmlyc3ROb2RlKCk7XG4gIGxldCBsYXN0ID0gYm91bmRzLmxhc3ROb2RlKCk7XG5cbiAgbGV0IG5vZGUgPSBmaXJzdDtcblxuICB3aGlsZSAobm9kZSkge1xuICAgIGxldCBuZXh0ID0gbm9kZS5uZXh0U2libGluZztcbiAgICBwYXJlbnQucmVtb3ZlQ2hpbGQobm9kZSk7XG4gICAgaWYgKG5vZGUgPT09IGxhc3QpIHJldHVybiBuZXh0O1xuICAgIG5vZGUgPSBuZXh0O1xuICB9XG5cbiAgcmV0dXJuIG51bGw7XG59XG4iXX0= + enifed('glimmer-runtime/lib/builder', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-util', 'glimmer-runtime/lib/compiled/opcodes/dom'], function (exports, _glimmerRuntimeLibBounds, _glimmerUtil, _glimmerRuntimeLibCompiledOpcodesDom) { 'use strict'; @@ -42269,7 +42167,7 @@ enifed('glimmer-runtime/lib/builder', ['exports', 'glimmer-runtime/lib/bounds', return BlockListTracker; })(); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvYnVpbGRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUE0QkEsS0FBQTtBQUNFLGlCQURGLEtBQUEsQ0FDc0IsSUFBVSxFQUFBO0FBQVYsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFNO1NBQUs7O0FBRHJDLGFBQUEsV0FHRSxTQUFTLEdBQUEscUJBQUE7QUFDUCxtQkFBTyxJQUFJLENBQUMsSUFBSSxDQUFDO1NBQ2xCOztlQUxILEtBQUE7OztRQVFBLElBQUE7QUFDRSxpQkFERixJQUFBLENBQ3NCLElBQVUsRUFBQTtBQUFWLGdCQUFBLENBQUEsSUFBSSxHQUFKLElBQUksQ0FBTTtTQUFLOztBQURyQyxZQUFBLFdBR0UsUUFBUSxHQUFBLG9CQUFBO0FBQ04sbUJBQU8sSUFBSSxDQUFDLElBQUksQ0FBQztTQUNsQjs7ZUFMSCxJQUFBOzs7UUFnQkEsUUFBQTtBQUdFLGlCQUhGLFFBQUEsQ0FHYyxNQUFjLEVBQUE7QUFDeEIsZ0JBQUksQ0FBQyxNQUFNLEdBQUcsTUFBTSxDQUFDO1NBQ3RCOztBQUxILGdCQUFBLFdBT0UsYUFBYSxHQUFBLHlCQUFBO0FBQ1gsbUJBQU8sSUFBSSxDQUFDLE1BQU0sQ0FBQyxhQUFhLEVBQUUsQ0FBQztTQUNwQzs7QUFUSCxnQkFBQSxXQVdFLFNBQVMsR0FBQSxxQkFBQTtBQUNQLG1CQUFPLElBQUksQ0FBQyxNQUFNLENBQUMsU0FB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1cblxuICBmaXJzdE5vZGUoKSB7XG4gICAgcmV0dXJuIHRoaXMuYm91bmRMaXN0LmhlYWQoKS5maXJzdE5vZGUoKTtcbiAgfVxuXG4gIGxhc3ROb2RlKCkge1xuICAgIHJldHVybiB0aGlzLmJvdW5kTGlzdC50YWlsKCkubGFzdE5vZGUoKTtcbiAgfVxuXG4gIG9wZW5FbGVtZW50KGVsZW1lbnQ6IEVsZW1lbnQpIHtcbiAgICBhc3NlcnQoZmFsc2UsICdDYW5ub3Qgb3BlbkVsZW1lbnQgZGlyZWN0bHkgaW5zaWRlIGEgYmxvY2sgbGlzdCcpO1xuICB9XG5cbiAgY2xvc2VFbGVtZW50KCkge1xuICAgIGFzc2VydChmYWxzZSwgJ0Nhbm5vdCBjbG9zZUVsZW1lbnQgZGlyZWN0bHkgaW5zaWRlIGEgYmxvY2sgbGlzdCcpO1xuICB9XG5cbiAgbmV3Tm9kZShub2RlOiBOb2RlKSB7XG4gICAgYXNzZXJ0KGZhbHNlLCAnQ2Fubm90IGNyZWF0ZSBhIG5ldyBub2RlIGRpcmVjdGx5IGluc2lkZSBhIGJsb2NrIGxpc3QnKTtcbiAgfVxuXG4gIG5ld0JvdW5kcyhib3VuZHM6IEJvdW5kcykge1xuICB9XG5cbiAgbmV3RGVzdHJveWFibGUoZDogRGVzdHJveWFibGUpIHtcbiAgfVxuXG4gIGZpbmFsaXplKHN0YWNrOiBFbGVtZW50U3RhY2spIHtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compat/inner-html-fix', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/dom/helper'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibDomHelper) { 'use strict'; @@ -42378,7 +42276,7 @@ enifed('glimmer-runtime/lib/compat/inner-html-fix', ['exports', 'glimmer-runtime return true; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tc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1xuICB0cnkge1xuICAgIHRhYmxlLmlubmVySFRNTCA9ICc8dGJvZHk+PC90Ym9keT4nO1xuICB9IGNhdGNoIChlKSB7XG4gIH0gZmluYWxseSB7XG4gICAgaWYgKHRhYmxlLmNoaWxkTm9kZXMubGVuZ3RoICE9PSAwKSB7XG4gICAgICAvLyBJdCB3b3JrZWQgYXMgZXhwZWN0ZWQsIG5vIGZpeCByZXF1aXJlZFxuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgfVxuXG4gIHJldHVybiB0cnVlO1xufVxuIl19 + enifed('glimmer-runtime/lib/compat/svg-inner-html-fix', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/dom/helper'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibDomHelper) { 'use strict'; @@ -42480,7 +42378,7 @@ enifed('glimmer-runtime/lib/compat/svg-inner-html-fix', ['exports', 'glimmer-run } } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGF0L3N2Zy1pbm5lci1odG1sLWZpeC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFHQSxRQUFNLGFBQWEsR0FBRyw0QkFBNEIsQ0FBQzs7Ozs7Ozs7Ozs7OztBQWFuRCxhQUFBLFVBQUEsQ0FBMkIsUUFBa0IsRUFBRSxlQUFrQyxFQUFFLFlBQW9CLEVBQUE7QUFDckcsWUFBSSxDQUFDLFFBQVEsRUFBRSxPQUFPLGVBQWUsQ0FBQztBQUV0QyxZQUFJLENBQUMsY0FBYyxDQUFDLFFBQVEsRUFBRSxZQUFZLENBQUMsRUFBRTtBQUMzQyxtQkFBTyxlQUFlLENBQUM7U0FDeEI7QUFFRCxZQUFJLEdBQUcsR0FBRyxRQUFRLENBQUMsYUFBYSxDQUFDLEtBQUssQ0FBQyxDQUFDO0FBRXhDO2tDQUFPLDZCQUFBOztxQk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mVmb3JlKGRpdi5maXJzdENoaWxkLCBwYXJlbnQsIHJlZmVyZW5jZSk7XG4gIHJldHVybiBuZXcgQ29uY3JldGVCb3VuZHMocGFyZW50LCBmaXJzdCwgbGFzdCk7XG59XG5cbmZ1bmN0aW9uIHNob3VsZEFwcGx5Rml4KGRvY3VtZW50LCBzdmdOYW1lc3BhY2UpIHtcbiAgbGV0IHN2ZyA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnROUyhzdmdOYW1lc3BhY2UsICdzdmcnKTtcblxuICB0cnkge1xuICAgIHN2Z1snaW5zZXJ0QWRqYWNlbnRIVE1MJ10oJ2JlZm9yZUVuZCcsICc8Y2lyY2xlPjwvY2lyY2xlPicpO1xuICB9IGNhdGNoIChlKSB7XG4gICAgLy8gSUUsIEVkZ2U6IFdpbGwgdGhyb3csIGluc2VydEFkamFjZW50SFRNTCBpcyB1bnN1cHBvcnRlZCBvbiBTVkdcbiAgICAvLyBTYWZhcmk6IFdpbGwgdGhyb3csIGluc2VydEFkamFjZW50SFRNTCBpcyBub3QgcHJlc2VudCBvbiBTVkdcbiAgfSBmaW5hbGx5IHtcbiAgICAvLyBGRjogT2xkIHZlcnNpb25zIHdpbGwgY3JlYXRlIGEgbm9kZSBpbiB0aGUgd3JvbmcgbmFtZXNwYWNlXG4gICAgaWYgKHN2Zy5jaGlsZE5vZGVzLmxlbmd0aCA9PT0gMSAmJiBzdmcuZmlyc3RDaGlsZC5uYW1lc3BhY2VVUkkgPT09IFNWR19OQU1FU1BBQ0UpIHtcbiAgICAgIC8vIFRoZSB0ZXN0IHdvcmtlZCBhcyBleHBlY3RlZCwgbm8gZml4IHJlcXVpcmVkXG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICAgIHN2ZyA9IG51bGw7XG5cbiAgICByZXR1cm4gdHJ1ZTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compat/text-node-merging-fix', ['exports'], function (exports) { // Patch: Adjacent text node merging fix // Browsers: IE, Edge, Firefox w/o inspector open @@ -42580,7 +42478,7 @@ enifed('glimmer-runtime/lib/compat/text-node-merging-fix', ['exports'], function return true; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGF0L3RleHQtbm9kZS1tZXJnaW5nLWZpeC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFlQSxhQUFBLFVBQUEsQ0FBMkIsUUFBa0IsRUFBRSxlQUFrQyxFQUFBO0FBQy9FLFlBQUksQ0FBQyxRQUFRLEVBQUUsT0FBTyxlQUFlLENBQUM7QUFFdEMsWUFBSSxDQUFDLGNBQWMsQ0FBQyxRQUFRLENBQUMsRUFBRTtBQUM3QixtQkFBTyxlQUFlLENBQUM7U0FDeEI7QUFFRDtrQ0FBTyxnQ0FBQTs7QUFHTCxxQkFISyxnQ0FBQSxDQUdPLFFBQVEsRUFBQTtBQUNsQiw0Q0FBTSxRQUFRLENBQUMsQ0FBQztBQUNoQixvQkFBSSxDQUFDLGNBQWMsR0FBRyxRQUFRLENBQUMsYUFBYSxDQUFDLEVBQUUsQ0FBQyxDQUFDO2FBQ2xEOztBQU5JLDRDQUFBLFdBUUwsZ0JBQWdCLEdBQUEsMEJBQUMsTUFBbUIsRUFBRSxXQUFpQixFQUFFLElBQVksRUFBQTtBQUNuRSxvQkFBSSxJQUFJLEtBQUssSUFBSSxFQUFFO0FBQ2pCLDJCQUFPLDJCQUFNLGdCQUFnQixLQUFBLE9BQUMsTUFBTSxFQUFFLFdBQVcsRUFBRSxJQUFJLENBQUMsQ0FBQztpQkFDMUQ7QUFFRCxvQkFBSSxvQkFBb0IsR0FBRyxLQUFLLENBQUM7QUFFakMsb0JBQUksWUFBWSxHQUFHLFdBQVcsR0FBRyxXQUFXLENBQUMsZUFBZSxHQUFHLE1BQU0sQ0FBQyxTQUFTLENBQUM7QUFDaEYsb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m91bmRzID0gc3VwZXIuaW5zZXJ0SFRNTEJlZm9yZShwYXJlbnQsIGh0bWwsIHJlZmVyZW5jZSk7XG5cbiAgICAgIGlmIChkaWRTZXRVc2VsZXNzQ29tbWVudCkge1xuICAgICAgICBwYXJlbnQucmVtb3ZlQ2hpbGQodGhpcy51c2VsZXNzQ29tbWVudCk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBib3VuZHM7XG4gICAgfVxuICB9O1xufVxuXG5mdW5jdGlvbiBzaG91bGRBcHBseUZpeChkb2N1bWVudCkge1xuICBsZXQgbWVyZ2luZ1RleHREaXYgPSA8SFRNTEVsZW1lbnQ+IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2RpdicpO1xuXG4gIG1lcmdpbmdUZXh0RGl2LmlubmVySFRNTCA9ICdmaXJzdCc7XG4gIG1lcmdpbmdUZXh0RGl2Lmluc2VydEFkamFjZW50SFRNTCgnYmVmb3JlRW5kJywgJ3NlY29uZCcpO1xuXG4gIGlmIChtZXJnaW5nVGV4dERpdi5jaGlsZE5vZGVzLmxlbmd0aCA9PT0gMikge1xuICAgIG1lcmdpbmdUZXh0RGl2ID0gbnVsbDtcbiAgICAvLyBJdCB3b3JrZWQgYXMgZXhwZWN0ZWQsIG5vIGZpeCByZXF1aXJlZFxuICAgIHJldHVybiBmYWxzZTtcbiAgfVxuXG4gIG1lcmdpbmdUZXh0RGl2ID0gbnVsbDtcblxuICByZXR1cm4gdHJ1ZTtcbn1cbiJdfQ== + enifed('glimmer-runtime/lib/compiled/blocks', ['exports', 'glimmer-runtime/lib/utils', 'glimmer-runtime/lib/compiler'], function (exports, _glimmerRuntimeLibUtils, _glimmerRuntimeLibCompiler) { 'use strict'; @@ -42686,7 +42584,7 @@ enifed('glimmer-runtime/lib/compiled/blocks', ['exports', 'glimmer-runtime/lib/u exports.Layout = Layout; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVud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cblxuZXhwb3J0IGNsYXNzIEVudHJ5UG9pbnQgZXh0ZW5kcyBUb3BMZXZlbFRlbXBsYXRlIHtcbiAgY29tcGlsZShlbnY6IEVudmlyb25tZW50KSB7XG4gICAgbGV0IGNvbXBpbGVkID0gdGhpcy5jb21waWxlZDtcbiAgICBpZiAoY29tcGlsZWQpIHJldHVybiBjb21waWxlZDtcblxuICAgIGxldCBvcHMgPSBuZXcgRW50cnlQb2ludENvbXBpbGVyKHRoaXMsIGVudikuY29tcGlsZSgpO1xuICAgIHJldHVybiB0aGlzLmNvbXBpbGVkID0gbmV3IENvbXBpbGVkQmxvY2sob3BzLCB0aGlzLnN5bWJvbFRhYmxlLnNpemUpO1xuICB9XG59XG5cbmV4cG9ydCBjbGFzcyBMYXlvdXQgZXh0ZW5kcyBUb3BMZXZlbFRlbXBsYXRlIHtcbiAgcHVibGljIGhhc05hbWVkUGFyYW1ldGVyczogYm9vbGVhbjtcbiAgcHVibGljIGhhc1lpZWxkczogYm9vbGVhbjtcbiAgY29uc3RydWN0b3IocHJvZ3JhbTogUHJvZ3JhbSwgc3ltYm9sVGFibGU6IFN5bWJvbFRhYmxlLCBwdWJsaWMgbmFtZWQ6IHN0cmluZ1tdLCBwdWJsaWMgeWllbGRzOiBzdHJpbmdbXSwgcHVibGljIGhhc1BhcnRpYWxzOiBib29sZWFuKSB7XG4gICAgc3VwZXIocHJvZ3JhbSwgc3ltYm9sVGFibGUpO1xuICAgIHRoaXMuaGFzTmFtZWRQYXJhbWV0ZXJzID0gISF0aGlzLm5hbWVkLmxlbmd0aDtcbiAgICB0aGlzLmhhc1lpZWxkcyA9ICEhdGhpcy55aWVsZHMubGVuZ3RoOztcbiAgfVxufVxuIl19 + enifed("glimmer-runtime/lib/compiled/expressions", ["exports"], function (exports) { "use strict"; @@ -42702,7 +42600,7 @@ enifed("glimmer-runtime/lib/compiled/expressions", ["exports"], function (export exports.CompiledExpression = CompiledExpression; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBR0Esa0JBQUE7aUJBQUEsa0JBQUE7O0FBQUEsMEJBQUEsV0FJRSxNQUFNLEdBQUEsa0JBQUE7QUFDSixnQ0FBa0IsSUFBSSxDQUFDLElBQUksQ0FBQyxXQUFXLEVBQUUsQ0FBRztTQUM3Qzs7ZUFOSCxrQkFBQSIsImZpbGUiOiJleHByZXNzaW9ucy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBWTSBmcm9tICcuLi92bS9hcHBlbmQnO1xuaW1wb3J0IHsgUGF0aFJlZmVyZW5jZSB9IGZyb20gJ2dsaW1tZXItcmVmZXJlbmNlJztcblxuZXhwb3J0IGFic3RyYWN0IGNsYXNzIENvbXBpbGVkRXhwcmVzc2lvbjxUPiB7XG4gIHR5cGU6IHN0cmluZztcbiAgYWJzdHJhY3QgZXZhbHVhdGUodm06IFZNKTogUGF0aFJlZmVyZW5jZTxUPjtcblxuICB0b0pTT04oKTogc3RyaW5nIHtcbiAgICByZXR1cm4gYFVOSU1QTDogJHt0aGlzLnR5cGUudG9VcHBlckNhc2UoKX1gO1xuICB9XG59XG4iXX0= + enifed('glimmer-runtime/lib/compiled/expressions/args', ['exports', 'glimmer-runtime/lib/compiled/expressions/positional-args', 'glimmer-runtime/lib/compiled/expressions/named-args', 'glimmer-runtime/lib/syntax/core', 'glimmer-reference'], function (exports, _glimmerRuntimeLibCompiledExpressionsPositionalArgs, _glimmerRuntimeLibCompiledExpressionsNamedArgs, _glimmerRuntimeLibSyntaxCore, _glimmerReference) { 'use strict'; @@ -42791,7 +42689,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/args', ['exports', 'glimmer-run exports.CompiledNamedArgs = _glimmerRuntimeLibCompiledExpressionsNamedArgs.CompiledNamedArgs; exports.EvaluatedNamedArgs =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X0FSR1MsIEVNUFRZX0JMT0NLUyk7XG5cbmV4cG9ydCB7IENvbXBpbGVkUG9zaXRpb25hbEFyZ3MsIEV2YWx1YXRlZFBvc2l0aW9uYWxBcmdzLCBDb21waWxlZE5hbWVkQXJncywgRXZhbHVhdGVkTmFtZWRBcmdzIH07XG4iXX0= + enifed("glimmer-runtime/lib/compiled/expressions/concat", ["exports", "glimmer-reference"], function (exports, _glimmerReference) { "use strict"; @@ -42853,7 +42751,7 @@ enifed("glimmer-runtime/lib/compiled/expressions/concat", ["exports", "glimmer-r return String(value); } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvY29uY2F0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQU1BLGNBQUE7QUFHRSxpQkFIRixjQUFBLENBR3NCLEtBQW1DLEVBQUE7QUFBbkMsZ0JBQUEsQ0FBQSxLQUFLLEdBQUwsS0FBSyxDQUE4QjtBQUZoRCxnQkFBQSxDQUFBLElBQUksR0FBRyxRQUFRLENBQUM7U0FFb0M7O0FBSDdELHNCQUFBLFdBS0UsUUFBUSxHQUFBLGtCQUFDLEVBQU0sRUFBQTtBQUNiLGdCQUFJLEtBQUssR0FBNEIsSUFBSSxLQUFLLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQztBQUNsRSxpQkFBSyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUMsTUFBTSxFQUFFLENBQUMsRUFBRSxFQUFFO0FBQzFDLHFCQUFLLENBQUMsQ0FBQyxDQUFDLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxRQUFRLENBQUMsRUFBRSxDQUFDLENBQUM7YUFDdkM7QUFDRCxtQkFBTyxJQ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UoKSkgYXMgRklYTUU8c3RyaW5nLCAnQ29lcmNlIGZhbHN5IHZhbHVlcyB0byBzdHJpbmdzJz47XG4gICAgICB9XG4gICAgfVxuXG4gICAgaWYgKHBhcnRzLmxlbmd0aCA+IDApIHtcbiAgICAgIHJldHVybiBwYXJ0cy5qb2luKCcnKTtcbiAgICB9XG5cbiAgICByZXR1cm4gbnVsbDtcbiAgfVxufVxuXG5mdW5jdGlvbiBjYXN0VG9TdHJpbmcodmFsdWUpIHtcbiAgaWYgKHR5cGVvZiB2YWx1ZVsndG9TdHJpbmcnXSAhPT0gJ2Z1bmN0aW9uJykge1xuICAgIHJldHVybiAnJztcbiAgfVxuXG4gIHJldHVybiBTdHJpbmcodmFsdWUpO1xufVxuIl19 + enifed('glimmer-runtime/lib/compiled/expressions/function', ['exports', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/compiled/expressions'], function (exports, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibCompiledExpressions) { 'use strict'; @@ -42910,7 +42808,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/function', ['exports', 'glimmer return CompiledFunctionExpression; })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvZnVuY3Rpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O3NCQVFBLElBQUE7O0FBQUEsYUFBQSxJQUFBLENBQWdDLElBQTJCLEVBQUE7QUFDekQsZUFBTyxJQUFJLHdCQUF3QixDQUFDLElBQUksQ0FBQyxDQUFDO0tBQzNDOztRQUVELHdCQUFBOzhCQUFBLHdCQUFBOztBQUlFLGlCQUpGLHdCQUFBLENBSWMsSUFBMkIsRUFBQTtBQUNyQyx3Q0FBTyxDQUFDO0FBSkgsZ0JBQUEsQ0FBQSxJQUFJLEdBQUcscUJBQXF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gIH1cblxuICBjb21waWxlKGxvb2t1cCwgZW52LCBzeW1ib2xUYWJsZTogU3ltYm9sVGFibGUpOiBDb21waWxlZEV4cHJlc3Npb248VD4ge1xuICAgIHJldHVybiBuZXcgQ29tcGlsZWRGdW5jdGlvbkV4cHJlc3Npb24odGhpcy5mdW5jLCBzeW1ib2xUYWJsZSk7XG4gIH1cbn1cblxuY2xhc3MgQ29tcGlsZWRGdW5jdGlvbkV4cHJlc3Npb248VD4gZXh0ZW5kcyBDb21waWxlZEV4cHJlc3Npb248VD4ge1xuICBwdWJsaWMgdHlwZSA9IFwiZnVuY3Rpb25cIjtcblxuICBjb25zdHJ1Y3Rvcihwcml2YXRlIGZ1bmM6IEZ1bmN0aW9uRXhwcmVzc2lvbjxUPiwgcHJpdmF0ZSBzeW1ib2xUYWJsZTogU3ltYm9sVGFibGUpIHtcbiAgICBzdXBlcigpO1xuICAgIHRoaXMuZnVuYyA9IGZ1bmM7XG4gIH1cblxuICBldmFsdWF0ZSh2bTogVk0pOiBQYXRoUmVmZXJlbmNlPFQ+IHtcbiAgICBsZXQgeyBmdW5jLCBzeW1ib2xUYWJsZSB9ID0gdGhpcztcbiAgICByZXR1cm4gZnVuYyh2bSwgc3ltYm9sVGFibGUpO1xuICB9XG5cbiAgdG9KU09OKCk6IHN0cmluZyB7XG4gICAgbGV0IHsgZnVuYyB9ID0gdGhpcztcblxuICAgIGlmIChmdW5jLm5hbWUpIHtcbiAgICAgIHJldHVybiBgXFxgJHtmdW5jLm5hbWV9KC4uLilcXGBgO1xuICAgIH0gZWxzZSB7XG4gICAgICByZXR1cm4gXCJgZnVuYyguLi4pYFwiO1xuICAgIH1cbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compiled/expressions/has-block', ['exports', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-runtime/lib/references'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerRuntimeLibReferences) { 'use strict'; @@ -43002,7 +42900,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/has-block', ['exports', 'glimme exports.CompiledInPartialGetBlock = CompiledInPartialGetBlock; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvaGFzLWJsb2NrLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQU1BLGdCQUFBOzhCQUFBLGdCQUFBOztBQUdFLGlCQUhGLGdCQUFBLENBR3NCLEtBQXVCLEVBQUE7QUFDekMsMENBQU8sQ0FBQztBQURVLGdCQUFBLENBQUEsS0FBSyxHQUFMLEtBQUssQ0FBa0I7QUFGcEMsZ0JBQUEsQ0FBQSxJQUFJLEdBQUcsV0FBVyxDQUFDO1NBSXpCOztBQUxILHdCQUFBLFdBT0UsUUFBUSxHQUFBLGtCQUFDLEVBQU0sRUFBQTtBQUNiLGdCQUFJLEtBQUssR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLFFBQVEsQ0FBQyxFQUFFLENBQUMsQ0FBQztBQUNwQyxtQkFBTyw2QkFYRixrQkFBa0IsQ0FXRyxNQUFNLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQyxDQUFDO1NBQzNDOztBQVZILHdCQUFBLFdBWUUsTUFBTSxHQUFBLGtCQUFBO0FBQ0osa0NBQW9CLElBQUksQ0FBQyxLQUFLLENBQUMsTUFBTSxFQUFFLE9BQUk7U0FDNUM7O2VBZEgsZ0JBQUE7NkNBSFMsa0JBQWtCOztzQkFHM0IsZ0JBQUE7O1FBaUJBLHNCQUFBOzhCQUFBLHNCQUFBOztBQUdFLGlCQUhGLHNCQUFBLENBR3NCLEtBQXVCLEVBQUE7QUFDekMsMkNBQU8sQ0FBQztBQURVLGdCQUFBLENBQUEsS0FBSyxHQUFMLEtBQUssQ0FBa0I7QUFGcEMsZ0JBQUEsQ0FBQSxJQUFJLEdBQUcsa0JBQWtCLENBQUM7U0FJaEM7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xuICB0b0pTT04oKTogc3RyaW5nO1xufVxuXG5leHBvcnQgY2xhc3MgQ29tcGlsZWRHZXRCbG9ja0J5U3ltYm9sIGltcGxlbWVudHMgQ29tcGlsZWRHZXRCbG9jayB7XG4gIGNvbnN0cnVjdG9yKHByaXZhdGUgc3ltYm9sOiBudW1iZXIsIHByaXZhdGUgZGVidWc6IHN0cmluZykge1xuICB9XG5cbiAgZXZhbHVhdGUodm06IFZNKTogSW5saW5lQmxvY2sge1xuICAgIHJldHVybiB2bS5zY29wZSgpLmdldEJsb2NrKHRoaXMuc3ltYm9sKTtcbiAgfVxuXG4gIHRvSlNPTigpOiBzdHJpbmcge1xuICAgIHJldHVybiBgZ2V0LWJsb2NrKCQke3RoaXMuc3ltYm9sfSgke3RoaXMuZGVidWd9KSlgO1xuICB9XG59XG5cbmV4cG9ydCBjbGFzcyBDb21waWxlZEluUGFydGlhbEdldEJsb2NrIGltcGxlbWVudHMgQ29tcGlsZWRHZXRCbG9jayB7XG4gIGNvbnN0cnVjdG9yKHByaXZhdGUgc3ltYm9sOiBudW1iZXIsIHByaXZhdGUgbmFtZTogc3RyaW5nKSB7XG4gIH1cblxuICBldmFsdWF0ZSh2bTogVk0pOiBJbmxpbmVCbG9jayB7XG4gICAgbGV0IHsgc3ltYm9sLCBuYW1lIH0gPSB0aGlzO1xuICAgIGxldCBhcmdzID0gdm0uc2NvcGUoKS5nZXRQYXJ0aWFsQXJncyhzeW1ib2wpO1xuICAgIHJldHVybiBhcmdzLmJsb2Nrc1tuYW1lXTtcbiAgfVxuXG4gIHRvSlNPTigpOiBzdHJpbmcge1xuICAgIHJldHVybiBgZ2V0LWJsb2NrKCQke3RoaXMuc3ltYm9sfSgkQVJHUykuJHt0aGlzLm5hbWV9KSlgO1xuICB9XG59XG4iXX0= + enifed('glimmer-runtime/lib/compiled/expressions/helper', ['exports', 'glimmer-runtime/lib/compiled/expressions'], function (exports, _glimmerRuntimeLibCompiledExpressions) { 'use strict'; @@ -43033,7 +42931,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/helper', ['exports', 'glimmer-r exports.default = CompiledHelper; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvaGVscGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQVFBLGNBQUE7OEJBQUEsY0FBQTs7QUFHRSxpQkFIRixjQUFBLENBR3FCLElBQWMsRUFBUyxNQUFjLEVBQVMsSUFBa0IsRUFBUyxXQUF3QixFQUFBO0FBQ2xILDBDQUFPLENBQUM7QUFEUyxnQkFBQSxDQUFBLElBQUksR0FBSixJQUFJLENBQVU7QUFBUyxnQkFBQSxDQUFBLE1BQU0sR0FBTixNQUFNLENBQVE7QUFBUyxnQkFBQSxDQUFBLElBQUksR0FBSixJQUFJLENBQWM7QUFBUyxnQkFBQSxDQUFBLFdBQVcsR0FBWCxXQUFXLENBQWE7QUFGN0csZ0JBQUEsQ0FBQSxJQUFJLEdBQUcsUUFBUSxDQUFDO1NBSXRCOztBQUxILHNCQUFBLFdBT0UsUUFBUSxHQUFBLGtCQUFDLEVBQU0sRUFBQTtnQkFDUCxNQUFNLEdBQUssSUFBSSxDQUFmLE1BQU07O0FBQ1osbUJBQU8sTUFBTSxDQUFDLEVBQUUsRUFBRSxJQUFJLENBQUMsSUFBSSxDQUFDLFFBQVEsQ0FBQyxFQUFFLENBQUMsRUFBRSxJQUFJLENBQUMsV0FBVyxDQUFDLENBQUM7U0FDN0Q7O0FBVkgsc0JBQUEsV0FZRSxNQUFNLEdBQUEsa0JBQUE7QUFDSix5QkFBWSxJQUFJLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsY0FBWTtTQUM1Qzs7ZUFkSCxjQUFBOzZDQVJTLGtCQUFrQjs7c0JBUTNCLGNBQUEiLCJmaWxlIjoiaGVscGVyLmpzIiwic291cm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XX0= + enifed('glimmer-runtime/lib/compiled/expressions/lookups', ['exports', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-reference'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerReference) { 'use strict'; @@ -43139,7 +43037,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/lookups', ['exports', 'glimmer- exports.CompiledInPartialName = CompiledInPartialName; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvbG9va3Vwcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFNQSxjQUFBOzhCQUFBLGNBQUE7O0FBV0UsaUJBWEYsY0FBQSxDQVlZLElBQWdDLEVBQ2hDLElBQWMsRUFBQTtBQUV0QiwwQ0FBTyxDQUFDO0FBSEEsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUE0QjtBQUNoQyxnQkFBQSxDQUFBLElBQUksR0FBSixJQUFJLENBQVU7QUFaakIsZ0JBQUEsQ0FBQSxJQUFJLEdBQUcsUUFBUSxDQUFDO1NBZXRCOztBQWhCSCxzQkFBQSxDQUdTLE1BQU0sR0FBQSxnQkFBQyxJQUFnQyxFQUFFLElBQWMsRUFBQTtBQUM1RCxnQkFBSSxJQUFJLENBQUMsTUFBTSxLQUFLLENBQUMsRUFBRTtBQUNyQix1QkFBTyxJQUFJLENBQUM7YUFDYixNQUFNO0FBQ0wsdUJBQU8sSUFBSSxJQUFJLENBQUMsSUFBSSxFQUFFLElBQUksQ0FBQyxDQUFDO2FBQzdCO1NBQ0Y7O0FBVEgsc0JBQUEsV0FrQkUsUUFBUSxHQUFBLGtCQUFDLEVBQU0sRUFBQTtnQkFDUCxJQUFJLEdBQVcsSUFBSSxDQUFuQixJQUFJO2dCQUFFLElBQUksR0FBSyxJQUFJLENBQWIsSUFBSTs7QUFDaEIsbUJBQU8sa0JBdE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nIHtcbiAgICByZXR1cm4gYCQke3RoaXMuc3ltYm9sfSgkQVJHUykuJHt0aGlzLm5hbWV9YDtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compiled/expressions/named-args', ['exports', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/utils', 'glimmer-reference', 'glimmer-util'], function (exports, _glimmerRuntimeLibReferences, _glimmerRuntimeLibUtils, _glimmerReference, _glimmerUtil) { 'use strict'; @@ -43315,7 +43213,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/named-args', ['exports', 'glimm })(EvaluatedNamedArgs))(); exports.EVALUATED_EMPTY_NAMED_ARGS = EVALUATED_EMPTY_NAMED_ARGS; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvbmFtZWQtYXJncy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFPQSxpQkFBQTtBQXdCRSxpQkF4QkYsaUJBQUEsQ0F5QlcsSUFBYyxFQUNkLE1BQW9DLEVBQUE7QUFEcEMsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFVO0FBQ2QsZ0JBQUEsQ0FBQSxNQUFNLEdBQU4sTUFBTSxDQUE4QjtBQUUzQyxnQkFBSSxDQUFDLE1BQU0sR0FBRyxJQUFJLENBQUMsTUFBTSxDQUFDO0FBQzFCLHlCQS9CbUIsTUFBTSxDQStCbEIsSUFBSSxDQUFDLE1BQU0sS0FBSyxNQUFNLENBQUMsTUFBTSxFQUFFLDZDQUE2QyxDQUFDLENBQUM7U0FDdEY7O0FBOUJILHlCQUFBLENBQ1MsS0FBSyxHQUFBLGlCQUFBO0FBQ1YsbUJBQU8seUJBQXlCLENBQUM7U0FDbEM7O0FBSEgseUJBQUEsQ0FLUyxNQUFNLEdBQUEsZ0JBQUMsR0FBcUMsRUFBQTtBQUNqRCxnQk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G4gIGhhcyhrZXk6IHN0cmluZyk6IGJvb2xlYW4ge1xuICAgIHJldHVybiB0aGlzLmtleXMuaW5kZXhPZihrZXkpICE9PSAtMTtcbiAgfVxuXG4gIHZhbHVlKCk6IERpY3Q8T3BhcXVlPiB7XG4gICAgbGV0IHsga2V5cywgdmFsdWVzIH0gPSB0aGlzO1xuXG4gICAgbGV0IG91dCA9IGRpY3Q8T3BhcXVlPigpO1xuXG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICBsZXQga2V5ID0ga2V5c1tpXTtcbiAgICAgIGxldCByZWYgPSB2YWx1ZXNbaV07XG4gICAgICBvdXRba2V5XSA9IHJlZi52YWx1ZSgpO1xuICAgIH1cblxuICAgIHJldHVybiBvdXQ7XG4gIH1cbn1cblxuZXhwb3J0IGNvbnN0IEVWQUxVQVRFRF9FTVBUWV9OQU1FRF9BUkdTOiBFdmFsdWF0ZWROYW1lZEFyZ3MgPSBuZXcgKGNsYXNzIGV4dGVuZHMgRXZhbHVhdGVkTmFtZWRBcmdzIHtcbiAgY29uc3RydWN0b3IoKSB7XG4gICAgc3VwZXIoRU1QVFlfQVJSQVksIEVNUFRZX0FSUkFZLCBFTVBUWV9ESUNUKTtcbiAgfVxuXG4gIGdldCgpOiBQYXRoUmVmZXJlbmNlPE9wYXF1ZT4ge1xuICAgIHJldHVybiBVTkRFRklORURfUkVGRVJFTkNFO1xuICB9XG5cbiAgaGFzKGtleTogc3RyaW5nKTogYm9vbGVhbiB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG5cbiAgdmFsdWUoKTogRGljdDxPcGFxdWU+IHtcbiAgICByZXR1cm4gRU1QVFlfRElDVDtcbiAgfVxufSk7XG4iXX0= + enifed('glimmer-runtime/lib/compiled/expressions/positional-args', ['exports', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/utils', 'glimmer-reference'], function (exports, _glimmerRuntimeLibReferences, _glimmerRuntimeLibUtils, _glimmerReference) { 'use strict'; @@ -43433,7 +43331,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/positional-args', ['exports', ' })(EvaluatedPositionalArgs))(); exports.EVALUATED_EMPTY_POSITIONAL_ARGS = EVALUATED_EMPTY_POSITIONAL_ARGS; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvcG9zaXRpb25hbC1hcmdzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQU9BLHNCQUFBO0FBZUUsaUJBZkYsc0JBQUEsQ0FlcUIsTUFBb0MsRUFBQTtBQUFwQyxnQkFBQSxDQUFBLE1BQU0sR0FBTixNQUFNLENBQThCO0FBQ3JELGdCQUFJLENBQUMsTUFBTSxHQUFHLE1BQU0sQ0FBQyxNQUFNLENBQUM7U0FDN0I7O0FBakJILDhCQUFBLENBQ1MsTUFBTSxHQUFBLGdCQUFDLE1BQW9DLEVBQUE7QUFDaEQsZ0JBQUksTUFBTSxDQUFDLE1BQU0sRUFBRTtBQUNqQix1QkFBTyxJQUFJLElBQUksQ0FBQyxNQUFNLENBQUMsQ0FBQzthQUN6QixNQUFNO0FBQ0wsdUJBQU8sOEJBQThCLENBQUM7YUFDdkM7U0FDRjs7QUFQSCw4QkFBQSxDQVNTLEtBQUssR0FBQSxpQkFBQTtBQUNWLG1CQUFPLDhCQUE4QixDQUFDO1NBQ3ZDOztBQVhILDhCQUFBLFdBbUJFLFFBQVEsR0FBQSxrQkFBQyxFQUFNLEVBQUE7Z0JBQ1AsTUFBTSxHQUFhLElBQUksQ0FBdkIsTUFBTTtnQkFBRSxNQUFNLEdBQUssSUFBSSxDQUFmLE1BQU07O0FBQ3BCLGdCQUFJLFVBQVUsR0FBNEIsSUFBSSxLQUFLLENBQUMsTUFBTSxDQUFDLENBQUM7QUFFNUQsaUJBQUssSUFBSSxDQUFDLEd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gpO1xuICAgIH1cblxuICAgIHJldHVybiByZXQ7XG4gIH1cbn1cblxuZXhwb3J0IGNvbnN0IEVWQUxVQVRFRF9FTVBUWV9QT1NJVElPTkFMX0FSR1M6IEV2YWx1YXRlZFBvc2l0aW9uYWxBcmdzID0gbmV3IChjbGFzcyBleHRlbmRzIEV2YWx1YXRlZFBvc2l0aW9uYWxBcmdzIHtcbiAgY29uc3RydWN0b3IoKSB7XG4gICAgc3VwZXIoRU1QVFlfQVJSQVkpO1xuICB9XG5cbiAgYXQoKTogUGF0aFJlZmVyZW5jZTxPcGFxdWU+IHtcbiAgICByZXR1cm4gVU5ERUZJTkVEX1JFRkVSRU5DRTtcbiAgfVxuXG4gIHZhbHVlKCk6IE9wYXF1ZVtdIHtcbiAgICByZXR1cm4gdGhpcy52YWx1ZXM7XG4gIH1cbn0pO1xuIl19 + enifed('glimmer-runtime/lib/compiled/expressions/value', ['exports', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-runtime/lib/references'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerRuntimeLibReferences) { 'use strict'; @@ -43459,7 +43357,7 @@ enifed('glimmer-runtime/lib/compiled/expressions/value', ['exports', 'glimmer-ru exports.default = CompiledValue; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvdmFsdWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBSUEsYUFBQTs4QkFBQSxhQUFBOztBQUlFLGlCQUpGLGFBQUEsQ0FJYyxLQUFRLEVBQUE7QUFDbEIsMENBQU8sQ0FBQztBQUpILGdCQUFBLENBQUEsSUFBSSxHQUFHLE9BQU8sQ0FBQztBQUtwQixnQkFBSSxDQUFDLFNBQVMsR0FBRyw2QkFSRCxrQkFBa0IsQ0FRRSxNQUFNLENBQUMsS0FBWSxDQUFDLENBQUM7U0FDMUQ7O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k6IHN0cmluZyB7XG4gICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHRoaXMucmVmZXJlbmNlLnZhbHVlKCkpO1xuICB9XG59XG4iXX0= + enifed('glimmer-runtime/lib/compiled/opcodes/builder', ['exports', 'glimmer-runtime/lib/compiled/opcodes/component', 'glimmer-runtime/lib/compiled/opcodes/partial', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-runtime/lib/compiled/opcodes/dom', 'glimmer-runtime/lib/compiled/opcodes/lists', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-util', 'glimmer-runtime/lib/utils'], function (exports, _glimmerRuntimeLibCompiledOpcodesComponent, _glimmerRuntimeLibCompiledOpcodesPartial, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerRuntimeLibCompiledOpcodesDom, _glimmerRuntimeLibCompiledOpcodesLists, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerUtil, _glimmerRuntimeLibUtils) { 'use strict'; @@ -43864,7 +43762,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/builder', ['exports', 'glimmer-runt exports.default = OpcodeBuilder; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy9idWlsZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQXlCQSwrQkFBQTtBQUVFLGlCQUZGLCtCQUFBLENBRXdCLEtBQWlDLEVBQUE7QUFBakMsZ0JBQUEsQ0FBQSxLQUFLLEdBQUwsS0FBSyxDQUE0QjtTQUFJOztBQUY3RCx1Q0FBQSxXQVFFLE9BQU8sR0FBQSxtQkFBQTtBQUNMLG1CQUFPLElBQUksQ0FBQyxLQUFLLENBQUMsT0FBTyxFQUFFLENBQUM7U0FDN0I7O0FBVkgsdUNBQUEsV0FZRSxNQUFNLEdBQUEsZ0JBQW1CLE1BQVMsRUFBQTtBQUNoQyxnQkF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uICB1bml0KGNhbGxiYWNrOiAoYnVpbGRlcjogT3Bjb2RlQnVpbGRlcikgPT4gdm9pZCkge1xuICAgIHRoaXMuc3RhcnRMYWJlbHMoKTtcbiAgICBjYWxsYmFjayh0aGlzKTtcbiAgICB0aGlzLnN0b3BMYWJlbHMoKTtcbiAgfVxufVxuXG5leHBvcnQgdHlwZSBCbG9ja0NhbGxiYWNrID0gKGRzbDogT3Bjb2RlQnVpbGRlciwgQkVHSU46IExhYmVsLCBFTkQ6IExhYmVsKSA9PiB2b2lkO1xuIl19 + enifed('glimmer-runtime/lib/compiled/opcodes/component', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-reference'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerReference) { 'use strict'; @@ -44142,7 +44040,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/component', ['exports', 'glimmer-ru exports.CloseComponentOpcode = CloseComponentOpcode; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy9jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBVUEsbUNBQUE7OEJBQUEsbUNBQUE7O0FBQUEsaUJBQUEsbUNBQUEsR0FBQTtBQUF5RCxnQ0FBQSxTQUFBLENBQUEsQ0FBTTtBQUN0RCxnQkFBQSxDQUFBLElBQUksR0FBRyxrQ0FBa0MsQ0FBQztTQXFCbEQ7O0FBdEJELDJDQUFBLFdBR0UsUUFBUSxHQUFBLGtCQUFDLEVBQU0sRUFBQTtBQUNiLGdCQUFJLFNBQVMsR0FBRyxFQUFFLENBQUMsS0FBSyxDQUFDLFVBQVUsRUFBa0MsQ0FBQztBQUN0RSxnQkFBSSxLQUFLLEdBQUcsa0JBUitDLE9BQU8sQ0FROUMsU0FBUyx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biAgICBzdXBlcigpO1xuICB9XG5cbiAgZXZhbHVhdGUodm06IFVwZGF0aW5nVk0pIHtcbiAgICBsZXQgeyBtYW5hZ2VyLCBjb21wb25lbnQsIGJvdW5kcyB9ID0gdGhpcztcblxuICAgIG1hbmFnZXIuZGlkVXBkYXRlTGF5b3V0KGNvbXBvbmVudCwgYm91bmRzKTtcblxuICAgIHZtLmVudi5kaWRVcGRhdGUoY29tcG9uZW50LCBtYW5hZ2VyKTtcbiAgfVxufVxuXG5leHBvcnQgY2xhc3MgQ2xvc2VDb21wb25lbnRPcGNvZGUgZXh0ZW5kcyBPcGNvZGUge1xuICBwdWJsaWMgdHlwZSA9IFwiY2xvc2UtY29tcG9uZW50XCI7XG5cbiAgZXZhbHVhdGUodm06IFZNKSB7XG4gICAgdm0ucG9wU2NvcGUoKTtcbiAgICB2bS5wb3BEeW5hbWljU2NvcGUoKTtcbiAgICB2bS5jb21taXRDYWNoZUdyb3VwKCk7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/compiled/opcodes/content', ['exports', 'glimmer-runtime/lib/upsert', 'glimmer-runtime/lib/component/interfaces', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/vm/update', 'glimmer-reference', 'glimmer-util', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/builder', 'glimmer-runtime/lib/compiler', 'glimmer-runtime/lib/compiled/opcodes/builder', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/syntax/core'], function (exports, _glimmerRuntimeLibUpsert, _glimmerRuntimeLibComponentInterfaces, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibVmUpdate, _glimmerReference, _glimmerUtil, _glimmerRuntimeLibBounds, _glimmerRuntimeLibBuilder, _glimmerRuntimeLibCompiler, _glimmerRuntimeLibCompiledOpcodesBuilder, _glimmerRuntimeLibReferences, _glimmerRuntimeLibSyntaxCore) { 'use strict'; @@ -44670,7 +44568,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/content', ['ex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0sIHJlZmVyZW5jZTogUmVmZXJlbmNlPE9wYXF1ZT4sIGNhY2hlOiBSZWZlcmVuY2VDYWNoZTxUcnVzdGluZ0luc2VydGlvbj4sIGJvdW5kczogRnJhZ21lbnQsIHVwc2VydDogVXBzZXJ0KTogVXBkYXRpbmdPcGNvZGUge1xuICAgIHJldHVybiBuZXcgR3VhcmRlZFRydXN0aW5nVXBkYXRlT3Bjb2RlKHJlZmVyZW5jZSwgY2FjaGUsIGJvdW5kcywgdXBzZXJ0LCB0aGlzLCB2bS5jYXB0dXJlKCkpO1xuICB9XG59XG5cbmNsYXNzIEd1YXJkZWRUcnVzdGluZ1VwZGF0ZU9wY29kZSBleHRlbmRzIEd1YXJkZWRVcGRhdGVPcGNvZGU8VHJ1c3RpbmdJbnNlcnRpb24+IHtcbiAgdHlwZSA9ICd0cnVzdGluZy11cGRhdGUnO1xuXG4gIHByb3RlY3RlZCBpbnNlcnQoZG9tOiBET01UcmVlQ29uc3RydWN0aW9uLCBjdXJzb3I6IEN1cnNvciwgdmFsdWU6IFRydXN0aW5nSW5zZXJ0aW9uKTogVXBzZXJ0IHtcbiAgICByZXR1cm4gdHJ1c3RpbmdJbnNlcnQoZG9tLCBjdXJzb3IsIHZhbHVlKTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compiled/opcodes/dom', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/compiled/opcodes/vm'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibReferences, _glimmerRuntimeLibCompiledOpcodesVm) { 'use strict'; @@ -45454,7 +45352,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/dom', ['exports', 'glimmer-runtime/ exports.CommentOpcode = CommentOpcode; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tc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JldHVybiB7XG4gICAgICBndWlkOiBfZ3VpZCxcbiAgICAgIHR5cGUsXG4gICAgICBkZXRhaWxzOiBvcGVyYXRpb24udG9KU09OKClcbiAgICB9O1xuICB9XG59XG5cbmV4cG9ydCBjbGFzcyBDb21tZW50T3Bjb2RlIGV4dGVuZHMgT3Bjb2RlIHtcbiAgcHVibGljIHR5cGUgPSBcImNvbW1lbnRcIjtcblxuICBjb25zdHJ1Y3RvcihwdWJsaWMgY29tbWVudDogc3RyaW5nKSB7XG4gICAgc3VwZXIoKTtcbiAgfVxuXG4gIGV2YWx1YXRlKHZtOiBWTSkge1xuICAgIHZtLnN0YWNrKCkuYXBwZW5kQ29tbWVudCh0aGlzLmNvbW1lbnQpO1xuICB9XG5cbiAgdG9KU09OKCk6IE9wY29kZUpTT04ge1xuICAgIHJldHVybiB7XG4gICAgICBndWlkOiB0aGlzLl9ndWlkLFxuICAgICAgdHlwZTogdGhpcy50eXBlLFxuICAgICAgYXJnczogW0pTT04uc3RyaW5naWZ5KHRoaXMuY29tbWVudCldXG4gICAgfTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compiled/opcodes/lists', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-util', 'glimmer-reference'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerUtil, _glimmerReference) { 'use strict'; @@ -45604,7 +45502,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/lists', ['exports', 'glimmer-runtim exports.NextIterOpcode = NextIterOpcode; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy9saXN0cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFPQSx5QkFBQTtBQUlFLGlCQUpGLHlCQUFBLENBSWMsU0FBNkIsRUFBQTtB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V5KGl0ZW0ua2V5KTtcbiAgICAgIHZtLmZyYW1lLnNldE9wZXJhbmQoaXRlbS52YWx1ZSk7XG4gICAgICB2bS5mcmFtZS5zZXRBcmdzKEV2YWx1YXRlZEFyZ3MucG9zaXRpb25hbChbaXRlbS52YWx1ZSwgaXRlbS5tZW1vXSkpO1xuICAgIH0gZWxzZSB7XG4gICAgICB2bS5mcmFtZS5zZXRDb25kaXRpb24oRkFMU0VfUkVGKTtcbiAgICAgIHZtLmdvdG8odGhpcy5lbmQpO1xuICAgIH1cbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/compiled/opcodes/partial', ['exports', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/opcodes/vm'], function (exports, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledOpcodesVm) { 'use strict'; @@ -45711,7 +45609,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/partial', ['exports', 'glimmer-util exports.EvaluatePartialOpcode = EvaluatePartialOpcode; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy9wYXJ0aWFsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQVNBLGlDQUFBOzhCQUFBLGlDQUFBOztBQUdFLGlCQUhGLGlDQUFBLENBR3NCLFdBQXdCLEVBQUE7QUFDMUMsOEJBQU8sQ0FBQztBQURVLGdCQUFBLENBQUEsV0FBVyxHQUFYLFdBQVcsQ0FBYTtBQUZyQyxnQkFBQSxDQUFBLElBQUksR0FBRyxnQ0FBZ0MsQ0FBQztTQUk5Qzs7QUFMSCx5Q0FBQSxXQU9FLFFBQVEsR0FBQSxrQkFBQyxFQUFNLEVBQUE7QUFDYixnQkFBSSxHQUFHLEdBQUcsRUFBRSxDQUFDLEdBQUcsQ0FBQztn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T3Bjb2RlIGV4dGVuZHMgT3Bjb2RlIHtcbiAgcHVibGljIHR5cGUgPSBcImV2YWx1YXRlLXBhcnRpYWxcIjtcbiAgcHJpdmF0ZSBjYWNoZSA9IGRpY3Q8UGFydGlhbEJsb2NrPigpO1xuXG4gIGNvbnN0cnVjdG9yKHByaXZhdGUgc3ltYm9sVGFibGU6IFN5bWJvbFRhYmxlKSB7XG4gICAgc3VwZXIoKTtcbiAgfVxuXG4gIGV2YWx1YXRlKHZtOiBWTSkge1xuICAgIGxldCB7IHRlbXBsYXRlIH0gPSB2bS5mcmFtZS5nZXRJbW1lZGlhdGU8UGFydGlhbERlZmluaXRpb248T3BhcXVlPj4oKTtcblxuICAgIGxldCBibG9jayA9IHRoaXMuY2FjaGVbdGVtcGxhdGUuaWRdO1xuXG4gICAgaWYgKCFibG9jaykge1xuICAgICAgYmxvY2sgPSB0ZW1wbGF0ZS5hc1BhcnRpYWwodGhpcy5zeW1ib2xUYWJsZSk7XG4gICAgfVxuXG4gICAgdm0uaW52b2tlUGFydGlhbChibG9jayk7XG4gIH1cblxuICB0b0pTT04oKTogT3Bjb2RlSlNPTiB7XG4gICAgcmV0dXJuIHtcbiAgICAgIGd1aWQ6IHRoaXMuX2d1aWQsXG4gICAgICB0eXBlOiB0aGlzLnR5cGUsXG4gICAgICBhcmdzOiBbXCIkT1BFUkFORFwiXVxuICAgIH07XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/compiled/opcodes/vm', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/references', 'glimmer-reference', 'glimmer-util'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibReferences, _glimmerReference, _glimmerUtil) { 'use strict'; @@ -46373,7 +46271,7 @@ enifed('glimmer-runtime/lib/compiled/opcodes/vm', ['exports', 'glimmer-runtime/l exports.DidModifyOpcode = DidModifyOpcode; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzI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b2RlIHtcbiAgcHVibGljIHR5cGUgPSBcImRpZC1tb2RpZnlcIjtcblxuICBjb25zdHJ1Y3Rvcihwcml2YXRlIHRhcmdldDogSnVtcElmTm90TW9kaWZpZWRPcGNvZGUpIHtcbiAgICBzdXBlcigpO1xuICAgIHRoaXMudGFnID0gQ09OU1RBTlRfVEFHO1xuICB9XG5cbiAgZXZhbHVhdGUoKSB7XG4gICAgdGhpcy50YXJnZXQuZGlkTW9kaWZ5KCk7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/compiler', ['exports', 'glimmer-util', 'glimmer-runtime/lib/utils', 'glimmer-runtime/lib/syntax/core', 'glimmer-runtime/lib/compiled/blocks', 'glimmer-runtime/lib/compiled/expressions/function', 'glimmer-runtime/lib/compiled/opcodes/builder'], function (exports, _glimmerUtil, _glimmerRuntimeLibUtils, _glimmerRuntimeLibSyntaxCore, _glimmerRuntimeLibCompiledBlocks, _glimmerRuntimeLibCompiledExpressionsFunction, _glimmerRuntimeLibCompiledOpcodesBuilder) { 'use strict'; @@ -46805,7 +46703,7 @@ enifed('glimmer-runtime/lib/compiler', ['exports', 'glimmer-util', 'glimmer-runt exports.CompileIntoList = CompileIntoList; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7UUFrQ0EsUUFBQTtBQUlFLGlCQUpGLFFBQUEsQ0FJd0IsS0FBWSxFQUFTLEdBQWdCLEVBQUE7QUFBckMsZ0JBQUEsQ0FBQSxLQUFLLEdBQUwsS0FBSyxDQUFPO0FBQVMsZ0JBQUEsQ0FBQSxHQUFHLEdBQUgsR0FBRyxDQUFhO0FBQ3pELGdCQUFJLENBQUMsT0FBTyxHQUFHLEtBQUssQ0FBQyxPQUFPLENBQUMsSUFBSSxFQUFFLENBQUM7QUFDcEMsZ0JBQUksQ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ltYm9sVGFibGUuZ2V0UGFydGlhbEFyZ3MoKSA9PT0gJ251bWJlcic7XG4gIH1cblxuICB0b09wU2VxKCk6IE9wU2VxIHtcbiAgICByZXR1cm4gdGhpcztcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/component/interfaces', ['exports'], function (exports) { 'use strict'; @@ -46825,7 +46723,7 @@ enifed('glimmer-runtime/lib/component/interfaces', ['exports'], function (export exports.ComponentDefinition = ComponentDefinition; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcG9uZW50L2ludGVyZmFjZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQXFHQSxRQUFNLDBCQUEwQixHQUFHLGdFQUFnRSxDQUFDOztBQUVwRyxhQUFBLHFCQUFBLENBQXNDLEdBQVEsRUFBQTtBQUM1QyxlQUFPLE9BQU8sR0FBRyxLQUFLLFFBQVEsSUFBSSxHQUFHLElBQUksR0FBRyxDQUFDLDBCQUEwQixDQUFDLENBQUM7S0FDMUU7O1FBRUQsbUJBQUEsR0FPRSxTQVBGLG1CQUFBLENBT2MsSUFBWSxFQUFFLE9BQTRCLEVBQUUsY0FBOEIsRUFBQTtBQUY5RSxZQUFBLENBQUMsZ0VBQWdFLENBQUMsR0FBRyxJQUFJLENBQUM7QUFHaEYsWUFBSSxDQUFDLElBQUksR0FBRyxJQUFJLENBQUM7QUFDakIsWUFBSSxDQUFDLE9BQU8sR0FBRyxPQUFPLENBQUM7QUFDdkIsWUFBSSxDQUFDLGNBQWMsR0FBRyxjQUFjLENBQUM7S0FDdEMiLCJmaWxlIjoiaW50ZXJmYWNlcy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEV2YWx1YXRlZEFyZ3MgfSBmcm9tICcuLi9jb21waWxlZC9leHByZXNzaW9ucy9hcmdzJztcbmltcG9ydCB7IEZ1bmN0aW9uRXhwcmVzc2l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WJsaWMgQ29tcG9uZW50Q2xhc3M6IENvbXBvbmVudENsYXNzO1xuXG4gIHByaXZhdGUgWydDT01QT05FTlQgREVGSU5JVElPTiBbaWQ9ZTU5Yzc1NGUtNjFlYi00MzkyLThjNGEtMmMwYWM3MmJmY2Q0XSddID0gdHJ1ZTtcblxuICBjb25zdHJ1Y3RvcihuYW1lOiBzdHJpbmcsIG1hbmFnZXI6IENvbXBvbmVudE1hbmFnZXI8VD4sIENvbXBvbmVudENsYXNzOiBDb21wb25lbnRDbGFzcykge1xuICAgIHRoaXMubmFtZSA9IG5hbWU7XG4gICAgdGhpcy5tYW5hZ2VyID0gbWFuYWdlcjtcbiAgICB0aGlzLkNvbXBvbmVudENsYXNzID0gQ29tcG9uZW50Q2xhc3M7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/dom/attribute-managers', ['exports', 'glimmer-runtime/lib/dom/sanitized-values', 'glimmer-runtime/lib/dom/props', 'glimmer-runtime/lib/dom/helper', 'glimmer-runtime/lib/compiled/opcodes/content'], function (exports, _glimmerRuntimeLibDomSanitizedValues, _glimmerRuntimeLibDomProps, _glimmerRuntimeLibDomHelper, _glimmerRuntimeLibCompiledOpcodesContent) { 'use strict'; @@ -47081,7 +46979,7 @@ enifed('glimmer-runtime/lib/dom/attribute-managers', ['exports', 'glimmer-runtim return SafeAttributeManager; })(AttributeManager); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL2F0dHJpYnV0ZS1tYW5hZ2Vycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7OztBQVlBLGFBQUEsZUFBQSxDQUFnQyxPQUF1QixFQUFFLElBQVksRUFBRSxVQUFtQixFQUFFLFNBQWlCLEVBQUE7QUFDM0csWUFBSSxPQUFPLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQztBQUM5QixZQUFJLEtBQUssR0FB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0dHJpYnV0ZShlbnY6IEVudmlyb25tZW50LCBlbGVtZW50OiBFbGVtZW50LCB2YWx1ZTogT3BhcXVlKSB7XG4gICAgc3VwZXIuc2V0QXR0cmlidXRlKGVudiwgZWxlbWVudCwgc2FuaXRpemVBdHRyaWJ1dGVWYWx1ZShlbnYsIGVsZW1lbnQsIHRoaXMuYXR0ciwgdmFsdWUpKTtcbiAgfVxuXG4gIHVwZGF0ZUF0dHJpYnV0ZShlbnY6IEVudmlyb25tZW50LCBlbGVtZW50OiBFbGVtZW50LCB2YWx1ZTogT3BhcXVlLCBuYW1lc3BhY2U/OiBET01OYW1lc3BhY2UpIHtcbiAgICBzdXBlci51cGRhdGVBdHRyaWJ1dGUoZW52LCBlbGVtZW50LCBzYW5pdGl6ZUF0dHJpYnV0ZVZhbHVlKGVudiwgZWxlbWVudCwgdGhpcy5hdHRyLCB2YWx1ZSkpO1xuICB9XG59XG4iXX0= + enifed('glimmer-runtime/lib/dom/helper', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/compat/inner-html-fix', 'glimmer-runtime/lib/compat/svg-inner-html-fix', 'glimmer-runtime/lib/compat/text-node-merging-fix', 'glimmer-runtime/lib/dom/interfaces'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibCompatInnerHtmlFix, _glimmerRuntimeLibCompatSvgInnerHtmlFix, _glimmerRuntimeLibCompatTextNodeMergingFix, _glimmerRuntimeLibDomInterfaces) { 'use strict'; @@ -47334,7 +47232,7 @@ enifed('glimmer-runtime/lib/dom/helper', ['exports', 'glimmer-runtime/lib/bounds exports.DOMTreeConstruction = DOMTreeConstruction; exports.DOMNamespace = _glimmerRuntimeLibDomInterfaces.Namespace; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL2hlbHBlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFlTyxRQU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IgPSBkb21DaGFuZ2VzU3ZnRWxlbWVudEZpeChkb2MsIGhlbHBlciwgU1ZHX05BTUVTUEFDRSk7XG5cbmV4cG9ydCBkZWZhdWx0IGhlbHBlcjtcbmV4cG9ydCBjb25zdCBET01UcmVlQ29uc3RydWN0aW9uID0gRE9NLkRPTVRyZWVDb25zdHJ1Y3Rpb247XG5leHBvcnQgdHlwZSBET01UcmVlQ29uc3RydWN0aW9uID0gRE9NLkRPTVRyZWVDb25zdHJ1Y3Rpb247XG5leHBvcnQgeyBOYW1lc3BhY2UgYXMgRE9NTmFtZXNwYWNlIH0gZnJvbSAnLi9pbnRlcmZhY2VzJztcbiJdfQ== + enifed("glimmer-runtime/lib/dom/interfaces", ["exports"], function (exports) { "use strict"; @@ -47355,7 +47253,7 @@ enifed("glimmer-runtime/lib/dom/interfaces", ["exports"], function (exports) { NodeType[NodeType["Notation"] = 11] = "Notation"; })(NodeType || (exports.NodeType = NodeType = {})); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL2ludGVyZmFjZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBV0EsUUFBWSxRQWFYLENBQUE7O0FBYkQsS0FBQSxVQUFZLFFBQVEsRUFBQTtBQUNsQixnQkFBQSxDQUFBLFFBQUEsQ0FBQSxTQUFBLENBQUEsR0FBQSxDQUFBLENBQUEsR0FBQSxTQUFPLENBQUE7QUFDUCxnQkFBQSxDQUFBLFFBQUEsQ0FBQSxXQUFBLENBQUEsR0FBQSxDQUFBLENBQUEsR0FBQSxXQUFTLENBQUE7QUFDVCxnQkFBQSxDQUFBLFFBQUEsQ0FBQSxNQUFBLENBQUEsR0FBQSxDQUFBLENBQUEsR0FBQSxNQUFJLENBQUE7QUFDSixnQkFBQSxDQUFBLFFBQUEsQ0FBQSxjQUFBLENBQUEsR0FBQSxDQUFBLENBQUEsR0FBQSxjQUF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ZXJ0QmVmb3JlKG5vZGU6IE5vZGUsIHJlZmVyZW5jZTogTm9kZSk6IHZvaWQ7XG4gIHJlbW92ZUNoaWxkKG5vZGU6IE5vZGUpOiB2b2lkO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIFNWR0VsZW1lbnQgZXh0ZW5kcyBFbGVtZW50IHt9XG5cbmV4cG9ydCBpbnRlcmZhY2UgSFRNTEVsZW1lbnQgZXh0ZW5kcyBFbGVtZW50IHt9XG4iXX0= + enifed('glimmer-runtime/lib/dom/props', ['exports'], function (exports) { /* * @method normalizeProperty @@ -47412,7 +47310,10 @@ enifed('glimmer-runtime/lib/dom/props', ['exports'], function (exports) { // Chrome 46.0.2464.0: 'autocorrect' in document.createElement('input') === false // Safari 8.0.7: 'autocorrect' in document.createElement('input') === false // Mobile Safari (iOS 8.4 simulator): 'autocorrect' in document.createElement('input') === true - autocorrect: true + autocorrect: true, + // Chrome 54.0.2840.98: 'list' in document.createElement('input') === true + // Safari 9.1.3: 'list' in document.createElement('input') === false + list: true }, // element.form is actually a legitimate readOnly property, that is to be // mutated, but must be mutated by setAttribute... @@ -47429,7 +47330,7 @@ enifed('glimmer-runtime/lib/dom/props', ['exports'], function (exports) { return tag && tag[propName.toLowerCase()] || false; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL3Byb3BzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztBQU1BLGFBQUEsaUJBQUEsQ0FBa0MsT0FBTyxFQUFFLFFBQVEsRUFBQTtBQUNqRCxZQUFJLElBQUksWUFBQTtZQUFFLFVBQVUsWUFBQSxDQUFDO0FBRXJCLFlBQUksUUFBUSxJQUFJLE9BQU8sRUFBRTtBQUN2QixzQkFBVSxHQUFHLFFBQVEsQ0FBQztBQUN0QixnQkFBSSxHQUFHLE1BQU0sQ0FBQztTQUNmLE1BQU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4gIGxldCB0YWcgPSBBVFRSX09WRVJSSURFU1t0YWdOYW1lLnRvVXBwZXJDYXNlKCldO1xuICByZXR1cm4gdGFnICYmIHRhZ1twcm9wTmFtZS50b0xvd2VyQ2FzZSgpXSB8fCBmYWxzZTtcbn1cbiJdfQ== + enifed('glimmer-runtime/lib/dom/sanitized-values', ['exports', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-runtime/lib/upsert'], function (exports, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerRuntimeLibUpsert) { 'use strict'; @@ -47481,7 +47382,7 @@ enifed('glimmer-runtime/lib/dom/sanitized-values', ['exports', 'glimmer-runtime/ return str; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL3Nhbml0aXplZC12YWx1ZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBTUEsUUFBTSxZQUFZLEdBQUcsQ0FDbkIsYUFBYSxFQUNiLFdBQVcsQ0FDWixDQUFDO0FBRUYsUUFBTSxPQUFPLEdBQUcsQ0FDZCxHQUFHLEVBQ0gsTUFBTSxFQUNOLE1BQU0sRUFDTixLQUFLLEVBQ0wsUUFBUSxFQUNSLE1BQU0sRUFDTixNQUFNLENBQ1AsQ0FBQztBQUVGLFFBQU0saUJBQWlCLEdBQUcsQ0FDeEIsT0FBTyxDQUNSLENBQUM7QUFFRixRQUFNLGFBQWEsR0FBRyxDQUNwQixNQUFNLEVBQ04sS0FBSyxFQUNMLFlBQVksRUFDWixRQUFRLENBQ1QsQ0FBQztBQUVGLFFBQU0sdUJBQXVCLEdBQUcsQ0FDOUIsS0FBSyxDQUNOLENBQUM7QUFFRixhQUFBLEdBQUEsQ0FBYSxLQUFvQixFQUFFLElBQVksRUFBQTtBQUM3QyxlQUFPLEtBQUssQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFD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9ydCBmdW5jdGlvbiBzYW5pdGl6ZUF0dHJpYnV0ZVZhbHVlKGVudjogRW52aXJvbm1lbnQsIGVsZW1lbnQ6IFNpbXBsZS5FbGVtZW50LCBhdHRyaWJ1dGU6IHN0cmluZywgdmFsdWU6IE9wYXF1ZSk6IE9wYXF1ZSB7XG4gIGxldCB0YWdOYW1lO1xuXG4gIGlmICh2YWx1ZSA9PT0gbnVsbCB8fCB2YWx1ZSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgcmV0dXJuIHZhbHVlO1xuICB9XG5cbiAgaWYgKGlzU2FmZVN0cmluZyh2YWx1ZSkpIHtcbiAgICByZXR1cm4gdmFsdWUudG9IVE1MKCk7XG4gIH1cblxuICBpZiAoIWVsZW1lbnQpIHtcbiAgICB0YWdOYW1lID0gbnVsbDtcbiAgfSBlbHNlIHtcbiAgICB0YWdOYW1lID0gZWxlbWVudC50YWdOYW1lLnRvVXBwZXJDYXNlKCk7XG4gIH1cblxuICBsZXQgc3RyID0gbm9ybWFsaXplVGV4dFZhbHVlKHZhbHVlKTtcblxuICBpZiAoY2hlY2tVUkkodGFnTmFtZSwgYXR0cmlidXRlKSkge1xuICAgIGxldCBwcm90b2NvbCA9IGVudi5wcm90b2NvbEZvclVSTChzdHIpO1xuICAgIGlmIChoYXMoYmFkUHJvdG9jb2xzLCBwcm90b2NvbCkpIHtcbiAgICAgIHJldHVybiBgdW5zYWZlOiR7c3RyfWA7XG4gICAgfVxuICB9XG5cbiAgaWYgKGNoZWNrRGF0YVVSSSh0YWdOYW1lLCBhdHRyaWJ1dGUpKSB7XG4gICAgcmV0dXJuIGB1bnNhZmU6JHtzdHJ9YDtcbiAgfVxuXG4gIHJldHVybiBzdHI7XG59XG4iXX0= + enifed('glimmer-runtime/lib/environment', ['exports', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/dom/attribute-managers', 'glimmer-util', 'glimmer-runtime/lib/syntax/core', 'glimmer-runtime/lib/syntax/builtins/if', 'glimmer-runtime/lib/syntax/builtins/unless', 'glimmer-runtime/lib/syntax/builtins/with', 'glimmer-runtime/lib/syntax/builtins/each'], function (exports, _glimmerRuntimeLibReferences, _glimmerRuntimeLibDomAttributeManagers, _glimmerUtil, _glimmerRuntimeLibSyntaxCore, _glimmerRuntimeLibSyntaxBuiltinsIf, _glimmerRuntimeLibSyntaxBuiltinsUnless, _glimmerRuntimeLibSyntaxBuiltinsWith, _glimmerRuntimeLibSyntaxBuiltinsEach) { 'use strict'; @@ -47737,7 +47638,7 @@ enifed('glimmer-runtime/lib/environment', ['exports', 'glimmer-runtime/lib/refer }; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZW52aXJvbm1lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBMkRBLEtBQUE7QUFlRSxpQkFmRixLQUFBLENBZWMsVUFBdUIsRUFBMkI7Z0JBQXpCLFdBQVcseURBQVUsSUFBSTs7QUFGdEQsZ0JBQUEsQ0FBQSxXQUFXLEdBQVUsSUFBSSxDQUFDO0FBR2hDLGdCQUFJLENBQUMsS0FBSyxHQUFHLFVBQVUsQ0FBQztBQUN4QixnQkFBSSxDQUFDLFdBQVcsR0FBRyxXQUFXLENBQUM7U0FDaEM7O0FBbEJILGFBQUEsQ0FDUyxJQUFJLEdBQUEsY0FBQyxJQUEyQixFQUFVO2dCQUFSLElBQUkseURBQUcsQ0FBQzs7QUFDL0MsZ0JBQUksSUFBSSxHQUE0QixJQUFJLEtBQUssQ0FBQyxJQUFJLEdBQUcsQ0FBQyxDQUFDLENBQUM7QUFFeEQsaUJBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsSUFBSSxJQUFJLEVBQUUsQ0FBQyxFQUFFLEVBQUU7QUFDOUIsb0JBQUksQ0FBQyxDQUFDLENBQUMsZ0NBekRKLG1CQUFtQixBQXlETyxDQUFDO2FBQy9CO0FBRU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CBhcHBlbmRWYWx1ZSA9IDxBcHBlbmRWYWx1ZT5hcHBlbmQudmFsdWU7XG4gICAgICBhcmdzID0gU3ludGF4LkFyZ3MuZW1wdHkoKTtcbiAgICAgIHBhdGggPSBhcHBlbmRWYWx1ZS5yZWYucGFydHM7XG4gICAgfSBlbHNlIGlmIChhcHBlbmQgJiYgYXBwZW5kLnZhbHVlLnR5cGUgPT09ICdoZWxwZXInKSB7XG4gICAgICBsZXQgaGVscGVyID0gPFN5bnRheC5IZWxwZXI+YXBwZW5kLnZhbHVlO1xuICAgICAgYXJncyA9IGhlbHBlci5hcmdzO1xuICAgICAgcGF0aCA9IGhlbHBlci5yZWYucGFydHM7XG4gICAgfSBlbHNlIGlmIChtb2RpZmllcikge1xuICAgICAgcGF0aCA9IG1vZGlmaWVyLnBhdGg7XG4gICAgICBhcmdzID0gbW9kaWZpZXIuYXJncztcbiAgICB9XG5cbiAgICBsZXQga2V5OiBzdHJpbmcsIGlzU2ltcGxlOiBib29sZWFuO1xuXG4gICAgaWYgKHBhdGgpIHtcbiAgICAgIGlzU2ltcGxlID0gcGF0aC5sZW5ndGggPT09IDE7XG4gICAgICBrZXkgPSBwYXRoWzBdO1xuICAgIH1cblxuICAgIHJldHVybiB7XG4gICAgICBpc1NpbXBsZSxcbiAgICAgIHBhdGgsXG4gICAgICBrZXksXG4gICAgICBhcmdzLFxuICAgICAgYXBwZW5kVHlwZSxcbiAgICAgIG9yaWdpbmFsOiBzdGF0ZW1lbnQsXG4gICAgICBpc0lubGluZTogISFhcHBlbmQsXG4gICAgICBpc0Jsb2NrOiAhIWJsb2NrLFxuICAgICAgaXNNb2RpZmllcjogISFtb2RpZmllclxuICAgIH07XG59XG4iXX0= + enifed('glimmer-runtime/lib/helpers/get-dynamic-var', ['exports', 'glimmer-reference'], function (exports, _glimmerReference) { 'use strict'; @@ -47774,15 +47675,15 @@ enifed('glimmer-runtime/lib/helpers/get-dynamic-var', ['exports', 'glimmer-refer } exports.default = getDynamicVar; });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4gIHJldHVybiBuZXcgRHluYW1pY1ZhclJlZmVyZW5jZShzY29wZSwgbmFtZVJlZik7XG59XG5cbmV4cG9ydCBkZWZhdWx0IChnZXREeW5hbWljVmFyIGFzIEhlbHBlcik7XG4iXX0= + enifed("glimmer-runtime/lib/modifier/interfaces", ["exports"], function (exports) { "use strict"; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvbW9kaWZpZXIvaW50ZXJmYWNlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwiZmlsZSI6ImludGVyZmFjZXMuanMiLCJzb3VyY2VzQ29udGVudCI6W119 + enifed("glimmer-runtime/lib/opcode-builder", ["exports"], function (exports) { "use strict"; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvb3Bjb2RlLWJ1aWxkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJvcGNvZGUtYnVpbGRlci5qcyIsInNvdXJjZXNDb250ZW50IjpbXX0= + enifed('glimmer-runtime/lib/opcodes', ['exports', 'glimmer-util'], function (exports, _glimmerUtil) { 'use strict'; @@ -47871,7 +47772,7 @@ enifed('glimmer-runtime/lib/opcodes', ['exports', 'glimmer-util'], function (exp } } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvb3Bjb2Rlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztRQWFBLGNBQUE7QUFPRSxpQkFQRixjQUFBLEdBT0U7QUFDRSx5QkFyQjhDLGNBQWMsQ0FxQjdDLElBQUksQ0FBQyxDQUFDO1NBQ3RCOztBQVRILHNCQUFBLFdBV0UsTUFBTSxHQUFBLGtCQUFBO0FBQ0osbUJBQU8sRUFBRSxJ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JqZWN0LmtleXMob3Bjb2RlLmRldGFpbHMpO1xuXG4gICAgICBpZiAoa2V5cy5sZW5ndGgpIHtcbiAgICAgICAgaWYgKG9wY29kZS5hcmdzICYmIG9wY29kZS5hcmdzLmxlbmd0aCkge1xuICAgICAgICAgIGJ1ZmZlci5wdXNoKCcsICcpO1xuICAgICAgICB9XG5cbiAgICAgICAgYnVmZmVyLnB1c2goa2V5cy5tYXAoa2V5ID0+IGAke2tleX09JHtvcGNvZGUuZGV0YWlsc1trZXldfWApLmpvaW4oJywgJykpO1xuICAgICAgfVxuICAgIH1cblxuICAgIGJ1ZmZlci5wdXNoKCcpJyk7XG4gIH1cblxuICBidWZmZXIucHVzaCgnXFxuJyk7XG5cbiAgaWYgKG9wY29kZS5jaGlsZHJlbiAmJiBvcGNvZGUuY2hpbGRyZW4ubGVuZ3RoKSB7XG4gICAgZm9yIChsZXQgaT0wOyBpPG9wY29kZS5jaGlsZHJlbi5sZW5ndGg7IGkrKykge1xuICAgICAgX2luc3BlY3Qob3Bjb2RlLmNoaWxkcmVuW2ldLCBidWZmZXIsIGxldmVsKzEsIGkpO1xuICAgIH1cbiAgfVxufVxuIl19 + enifed("glimmer-runtime/lib/partial", ["exports"], function (exports) { "use strict"; @@ -47882,7 +47783,7 @@ enifed("glimmer-runtime/lib/partial", ["exports"], function (exports) { exports.PartialDefinition = PartialDefinition; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvcGFydGlhbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFFQSxpQkFBQSxHQUlFLFNBSkYsaUJBQUEsQ0FJYyxJQUFZLEVBQUUsUUFBcUIsRUFBQTtBQUM3QyxZQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQztBQUNqQixZQUFJLENBQUMsUUFBUSxHQUFHLFFBQVEsQ0FBQztLQUMxQiIsImZpbGUiOiJwYXJ0aWFsLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgVGVtcGxhdGUgfSBmcm9tICcuL3RlbXBsYXRlJztcblxuZXhwb3J0IGNsYXNzIFBhcnRpYWxEZWZpbml0aW9uPFQ+IHtcbiAgbmFtZTogc3RyaW5nOyAvLyBmb3IgZGVidWdnaW5nXG4gIHRlbXBsYXRlOiBUZW1wbGF0ZTxUPjtcblxuICBjb25zdHJ1Y3RvcihuYW1lOiBzdHJpbmcsIHRlbXBsYXRlOiBUZW1wbGF0ZTxUPikge1xuICAgIHRoaXMubmFtZSA9IG5hbWU7XG4gICAgdGhpcy50ZW1wbGF0ZSA9IHRlbXBsYXRlO1xuICB9XG59XG4iXX0= + enifed('glimmer-runtime/lib/references', ['exports', 'glimmer-reference'], function (exports, _glimmerReference) { 'use strict'; @@ -47978,7 +47879,7 @@ enifed('glimmer-runtime/lib/references', ['exports', 'glimmer-reference'], funct exports.ConditionalReference = ConditionalReference; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvcmVmZXJlbmNlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFLQSxrQkFBQTs4QkFBQSxrQkFBQTs7QUFzQkUsaUJBdEJGLGtCQUFBLENBc0J3QixLQUFRLEVBQUE7QUFDNUIsdUNBQU0sS0FBSyxDQUFDLENBQUM7U0FDZDs7QUF4QkgsMEJBQUEsQ0FNUyxNQUFNLEdBQUEsZ0JBQUMsS0FBZ0IsRUFBQTtBQUM1QixnQkFBSSxLQUFLLEtBQUssU0FBUyxFQUFFO0FBQ3ZCLHVCQUFPLG1CQUFtQixDQUFDO2FBQzVCLE1BQU0sSUFBSSxLQUFLLEtBQUssSUFBSSxFQUFFO0FBQ3pCLHVCQUFPLGNBQWMsQ0FBQzthQUN2QixNQUFNLElBQUksS0FBSyxLQUFLLElBQUksRUFBRTtBQUN6Qix1QkFBTyxj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JldHVybiB0aGlzLnRvQm9vbCh0aGlzLmlubmVyLnZhbHVlKCkpO1xuICB9XG5cbiAgcHJvdGVjdGVkIHRvQm9vbCh2YWx1ZTogT3BhcXVlKTogYm9vbGVhbiB7XG4gICAgcmV0dXJuICEhdmFsdWU7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/scanner', ['exports', 'glimmer-runtime/lib/syntax/statements', 'glimmer-runtime/lib/compiled/blocks', 'glimmer-util', 'glimmer-runtime/lib/symbol-table'], function (exports, _glimmerRuntimeLibSyntaxStatements, _glimmerRuntimeLibCompiledBlocks, _glimmerUtil, _glimmerRuntimeLibSymbolTable) { 'use strict'; @@ -48133,7 +48034,7 @@ enifed('glimmer-runtime/lib/scanner', ['exports', 'glimmer-runtime/lib/syntax/st return SyntaxReader; })(); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc2Nhbm5lci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFRQSxPQUFBO0FBQ0UsaUJBREYsT0FBQSxDQUNzQixLQUE4QixFQUFVLElBQWtCLEVBQVUsR0FBZ0IsRUFBQTtBQUFwRixnQkFBQSxDQUFBLEtBQUssR0FBTCxLQUFLLENBQXlCO0FBQVUsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFjO0FBQVUsZ0JBQUEsQ0FBQSxHQUFHLEdBQUgsR0FBRyxDQUFhO1NBQ3ZHOztBQUZILGVBQUEsV0FJRSxjQUFjLEdBQUEsMEJBQUE7Z0JBQ04sS0FBSyxHQUFXLElBQUksQ0FBcEIsS0FBSztnQkFBRSxJQUFJLEdBQUssSUFBSSxDQUFiLElBQUk7O0FBRWpCLGdCQUFJLFdBQVcsR0FBRyxzQ0FBWSxhQUFhLENBQUMsSUFBSSxDQUFDLENBQUM7QUFDbEQsZ0JBQUksT0FBTyxHQUFHLGVBQWUsQ0FBQ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gMDtcbiAgbGFzdDogU3RhdGVtZW50U3ludGF4ID0gbnVsbDtcblxuICBjb25zdHJ1Y3Rvcihwcml2YXRlIHN0YXRlbWVudHM6IFNlcmlhbGl6ZWRTdGF0ZW1lbnRbXSwgcHJpdmF0ZSBzeW1ib2xUYWJsZTogU3ltYm9sVGFibGUsIHByaXZhdGUgc2Nhbm5lcjogQmxvY2tTY2FubmVyKSB7fVxuXG4gIG5leHQoKTogU3RhdGVtZW50U3ludGF4IHtcbiAgICBsZXQgbGFzdCA9IHRoaXMubGFzdDtcbiAgICBpZiAobGFzdCkge1xuICAgICAgdGhpcy5sYXN0ID0gbnVsbDtcbiAgICAgIHJldHVybiBsYXN0O1xuICAgIH0gZWxzZSBpZiAodGhpcy5jdXJyZW50ID09PSB0aGlzLnN0YXRlbWVudHMubGVuZ3RoKSB7XG4gICAgICByZXR1cm4gbnVsbDtcbiAgICB9XG5cbiAgICBsZXQgc2V4cCA9IHRoaXMuc3RhdGVtZW50c1t0aGlzLmN1cnJlbnQrK107XG4gICAgcmV0dXJuIGJ1aWxkU3RhdGVtZW50KHNleHAsIHRoaXMuc3ltYm9sVGFibGUsIHRoaXMuc2Nhbm5lcik7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/symbol-table', ['exports', 'glimmer-util'], function (exports, _glimmerUtil) { 'use strict'; @@ -48267,7 +48168,7 @@ enifed('glimmer-runtime/lib/symbol-table', ['exports', 'glimmer-util'], function exports.default = SymbolTable; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ltYm9sLXRhYmxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQUdBLFdBQUE7QUFvQkUsaUJBcEJGLFdBQUEsQ0FvQnNCLE1BQW1CLEVBQW1DO2dCQUF6QixJQUFJLHlEQUFpQixJQUFJOztBQUF0RCxnQkFBQSxDQUFBLE1BQU0sR0FBT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4gICAgcmV0dXJuIHN5bWJvbDtcbiAgfVxuXG4gIGdldExvY2FsKG5hbWU6IHN0cmluZyk6IG51bWJlciB7XG4gICAgbGV0IHsgbG9jYWxzLCBwYXJlbnQgfSA9IHRoaXM7XG5cbiAgICBsZXQgc3ltYm9sID0gbG9jYWxzW25hbWVdO1xuXG4gICAgaWYgKCFzeW1ib2wgJiYgcGFyZW50KSB7XG4gICAgICBzeW1ib2wgPSBwYXJlbnQuZ2V0TG9jYWwobmFtZSk7XG4gICAgfVxuXG4gICAgcmV0dXJuIHN5bWJvbDtcbiAgfVxuXG4gIGdldFBhcnRpYWxBcmdzKCk6IG51bWJlciB7XG4gICAgcmV0dXJuIHRoaXMudG9wLnBhcnRpYWxBcmdzO1xuICB9XG5cbiAgaXNUb3AoKTogYm9vbGVhbiB7XG4gICAgcmV0dXJuIHRoaXMudG9wID09PSB0aGlzO1xuICB9XG59XG4iXX0= + enifed("glimmer-runtime/lib/syntax", ["exports"], function (exports) { "use strict"; @@ -48344,7 +48245,7 @@ enifed("glimmer-runtime/lib/syntax", ["exports"], function (exports) { return value && value[ATTRIBUTE] === true; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O1FBbUJBLFNBQUE7QUFBQSxpQkFBQSxTQUFBLEdBQUE7QUFNUyxnQkFBQSxDQUFBLElBQUksR0FBYyxJQUFJLENBQUM7QUFDdkIsZ0JBQUEsQ0FBQSxJQUFJLEdBQWMsSUFBSSxDQUFDO1NBYS9COztBQXBCRCxpQkFBQSxDQUNTLFFBQVEsR0FBQSxrQkFBZ0MsSUFBTyxFQUFFLFdBQXdCLEVBQUUsT0FBc0IsRUFBQTtBQUN0RyxrQkFBTSxJQUFJLEtBQUssd0NBQXNDLElBQUksQ0FBRyxDQUFDO1NBQzlEOztBQUhILGlCQUF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mFsdWVTeW50YXgoKTogRXhwcmVzc2lvbjxUPjtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGlzQXR0cmlidXRlKHZhbHVlOiBTdGF0ZW1lbnQpOiB2YWx1ZSBpcyBBdHRyaWJ1dGU8YW55PiB7XG4gIHJldHVybiB2YWx1ZSAmJiB2YWx1ZVtBVFRSSUJVVEVdID09PSB0cnVlO1xufVxuIl19 + enifed('glimmer-runtime/lib/syntax/builtins/each', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; @@ -48407,7 +48308,7 @@ enifed('glimmer-runtime/lib/syntax/builtins/each', ['exports', 'glimmer-runtime/ exports.default = EachSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL2VhY2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBVUEsVUFBQTs4QkFBQSxVQUFBOztBQUdFLGlCQUhGLFVBQUEsQ0FHcUIsSUFBaUIsRUFBQTtBQUNsQyx1Q0FBTyxDQUFDO0FBRFMsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFhO0FBRnBDLGdCQUFBLENBQUEsSUFBSSxHQUFHLGdCQUFnQixDQUFDO1NBSXZCOztBQUxILGtCQUFBLFdBT0UsT0FBTyxHQUFBLGlCQUFDLEdBQXFCLEVBQUUsR0FBZ0IsRUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O2dCQXlCdkMsSUFBSSxHQUF1QixJQUFJLENBQS9CLElBQUk7Z0JBQVUsTUFBTSxHQUFPLElBQUksQ0FBekIsSUFBSSxDQUFJLE1BQU07O0FBRTFCLGVBQUcsQ0FBQyxLQUFLLENBQUMsSUFBSSxFQUFFLFVBQUMsR0FBRyxFQUFFLEtBQUssRUFBRSxHQUFHLEVBQUE7QUFDOUI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ZW50JztcblxuZXhwb3J0IGRlZmF1bHQgY2xhc3MgRWFjaFN5bnRheCBleHRlbmRzIFN0YXRlbWVudFN5bnRheCB7XG4gIHR5cGUgPSBcImVhY2gtc3RhdGVtZW50XCI7XG5cbiAgY29uc3RydWN0b3IocHVibGljIGFyZ3M6IFN5bnRheC5BcmdzKSB7XG4gICAgc3VwZXIoKTtcbiAgfVxuXG4gIGNvbXBpbGUoZHNsOiBPcGNvZGVCdWlsZGVyRFNMLCBlbnY6IEVudmlyb25tZW50KSB7XG4gICAgLy8gICAgICAgICBFbnRlcihCRUdJTiwgRU5EKVxuICAgIC8vIEJFR0lOOiAgTm9vcFxuICAgIC8vICAgICAgICAgUHV0QXJnc1xuICAgIC8vICAgICAgICAgUHV0SXRlcmFibGVcbiAgICAvLyAgICAgICAgIEp1bXBVbmxlc3MoRUxTRSlcbiAgICAvLyAgICAgICAgIEVudGVyTGlzdChCRUdJTjIsIEVORDIpXG4gICAgLy8gSVRFUjogICBOb29wXG4gICAgLy8gICAgICAgICBOZXh0SXRlcihCUkVBSylcbiAgICAvLyAgICAgICAgIEVudGVyV2l0aEtleShCRUdJTjIsIEVORDIpXG4gICAgLy8gQkVHSU4yOiBOb29wXG4gICAgLy8gICAgICAgICBQdXNoQ2hpbGRTY29wZVxuICAgIC8vICAgICAgICAgRXZhbHVhdGUoZGVmYXVsdClcbiAgICAvLyAgICAgICAgIFBvcFNjb3BlXG4gICAgLy8gRU5EMjogICBOb29wXG4gICAgLy8gICAgICAgICBFeGl0XG4gICAgLy8gICAgICAgICBKdW1wKElURVIpXG4gICAgLy8gQlJFQUs6ICBOb29wXG4gICAgLy8gICAgICAgICBFeGl0TGlzdFxuICAgIC8vICAgICAgICAgSnVtcChFTkQpXG4gICAgLy8gRUxTRTogICBOb29wXG4gICAgLy8gICAgICAgICBFdmFsdWxhdGUoaW52ZXJzZSlcbiAgICAvLyBFTkQ6ICAgIE5vb3BcbiAgICAvLyAgICAgICAgIEV4aXRcblxuICAgIGxldCB7IGFyZ3MsIGFyZ3M6IHsgYmxvY2tzIH0gfSA9IHRoaXM7XG5cbiAgICBkc2wuYmxvY2soYXJncywgKGRzbCwgQkVHSU4sIEVORCkgPT4ge1xuICAgICAgZHNsLnB1dEl0ZXJhdG9yKCk7XG5cbiAgICAgIGlmIChibG9ja3MuaW52ZXJzZSkge1xuICAgICAgICBkc2wuanVtcFVubGVzcygnRUxTRScpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgZHNsLmp1bXBVbmxlc3MoRU5EKTtcbiAgICAgIH1cblxuICAgICAgZHNsLml0ZXIoKGRzbCwgQkVHSU4sIEVORCkgPT4ge1xuICAgICAgICBkc2wuZXZhbHVhdGUoJ2RlZmF1bHQnLCBibG9ja3MuZGVmYXVsdCk7XG4gICAgICB9KTtcblxuICAgICAgaWYgKGJsb2Nrcy5pbnZlcnNlKSB7XG4gICAgICAgIGRzbC5qdW1wKEVORCk7XG4gICAgICAgIGRzbC5sYWJlbCgnRUxTRScpO1xuICAgICAgICBkc2wuZXZhbHVhdGUoJ2ludmVyc2UnLCBibG9ja3MuaW52ZXJzZSk7XG4gICAgICB9XG4gICAgfSk7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/syntax/builtins/if', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; @@ -48456,7 +48357,7 @@ enifed('glimmer-runtime/lib/syntax/builtins/if', ['exports', 'glimmer-runtime/li exports.default = IfSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL2lmLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQVFBLFFBQUE7OEJBQUEsUUFBQTs7QUFHRSxpQkFIRixRQUFBLENBR3FCLElBQWlCLEVBQUE7QUFDbEMsdUNBQU8sQ0FBQztBQURTLGdCQUFBLENBQUE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AgICBkc2wuYmxvY2sobnVsbCwgKGRzbCwgQkVHSU4sIEVORCkgPT4ge1xuICAgICAgaWYgKGJsb2Nrcy5pbnZlcnNlKSB7XG4gICAgICAgIGRzbC5qdW1wVW5sZXNzKCdFTFNFJyk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgICAgZHNsLmp1bXAoRU5EKTtcbiAgICAgICAgZHNsLmxhYmVsKCdFTFNFJyk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnaW52ZXJzZScsIGJsb2Nrcy5pbnZlcnNlKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGRzbC5qdW1wVW5sZXNzKEVORCk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgIH1cbiAgICB9KTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/syntax/builtins/in-element', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; @@ -48488,7 +48389,7 @@ enifed('glimmer-runtime/lib/syntax/builtins/in-element', ['exports', 'glimmer-ru exports.default = InElementSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL2luLWVsZW1lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBUUEsZUFBQTs4QkFBQSxlQUFBOztBQUdFLGlCQUhGLGVBQUEsQ0FHc0IsSUFBaUIsRUFBQTtBQUNuQyx1Q0FBTyxDQUFDO0FBRFUsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFhO0FBRnJDLGdCQUFBLENBQUEsSUFBSSxHQUFHLHNCQUFzQixDQUFDO1NBSTdCOztBQUxILHVCQUFBLFdBT0U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ZXh0ZW5kcyBTdGF0ZW1lbnRTeW50YXgge1xuICB0eXBlID0gXCJpbi1lbGVtZW50LXN0YXRlbWVudFwiO1xuXG4gIGNvbnN0cnVjdG9yKHByaXZhdGUgYXJnczogU3ludGF4LkFyZ3MpIHtcbiAgICBzdXBlcigpO1xuICB9XG5cbiAgY29tcGlsZShkc2w6IE9wY29kZUJ1aWxkZXJEU0wsIGVudjogRW52aXJvbm1lbnQpIHtcbiAgICBsZXQgeyBhcmdzLCBhcmdzOiB7IGJsb2NrcyB9IH0gPSB0aGlzO1xuXG4gICAgZHNsLnB1dEFyZ3MoYXJncyk7XG4gICAgZHNsLnRlc3QoJ3NpbXBsZScpO1xuXG4gICAgZHNsLmJsb2NrKG51bGwsIChkc2wsIEJFR0lOLCBFTkQpID0+IHtcbiAgICAgIGRzbC5qdW1wVW5sZXNzKEVORCk7XG4gICAgICBkc2wucHVzaFJlbW90ZUVsZW1lbnQoKTtcbiAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgIGRzbC5wb3BSZW1vdGVFbGVtZW50KCk7XG4gICAgfSk7XG4gIH1cbn1cbiJdfQ== + enifed("glimmer-runtime/lib/syntax/builtins/partial", ["exports", "glimmer-runtime/lib/syntax"], function (exports, _glimmerRuntimeLibSyntax) { "use strict"; @@ -48546,7 +48447,7 @@ enifed("glimmer-runtime/lib/syntax/builtins/partial", ["exports", "glimmer-runti exports.DynamicPartialSyntax = DynamicPartialSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL3BhcnRpYWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBY0EsbUJBQUE7OEJBQUEsbUJBQUE7O0FBR0UsaUJBSEYsbUJBQUEsQ0FHc0IsSUFBdUIsRUFBQTtBQUN6Qyx1Q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nN0YXJ0TGFiZWxzKCk7XG5cbiAgICBkc2wucHV0VmFsdWUobmFtZSk7XG4gICAgZHNsLnRlc3QoJ3NpbXBsZScpO1xuICAgIGRzbC5lbnRlcignQkVHSU4nLCAnRU5EJyk7XG4gICAgZHNsLmxhYmVsKCdCRUdJTicpO1xuICAgIGRzbC5qdW1wVW5sZXNzKCdFTkQnKTtcbiAgICBkc2wucHV0RHluYW1pY1BhcnRpYWxEZWZpbml0aW9uKCk7XG4gICAgZHNsLmV2YWx1YXRlUGFydGlhbCgpO1xuICAgIGRzbC5sYWJlbCgnRU5EJyk7XG4gICAgZHNsLmV4aXQoKTtcblxuICAgIGRzbC5zdG9wTGFiZWxzKCk7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/syntax/builtins/unless', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; @@ -48595,7 +48496,7 @@ enifed('glimmer-runtime/lib/syntax/builtins/unless', ['exports', 'glimmer-runtim exports.default = UnlessSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL3VubGVzcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFVQSxZQUFBOzhCQUFBLFlBQUE7O0FBR0UsaUJBSEYsWUFBQSxDQUdxQixJQUFpQixFQUFBO0FBQ2xDLHVDQUFPLENBQUM7QUFEUyxnQkFBQSxDQUFBLElBQUksR0FBSixJQUFJLENBQWE7QUFGcEMsZ0JBQUEsQ0FBQSxJQUFJLEdBQUcsa0JBQWtCLENBQUM7U0FJekI7O0FBTEgsb0JBQUEsV0FPRSxPQUFPLEdBQUEsaUJBQUMsR0FBcUIsRUFBRSxHQUFnQixFQUFBOzs7Ozs7Ozs7Ozs7Z0JBYXZDLElBQUksR0FBdUIsSUFBSSxDQUEvQixJQUFJO2dCQUFVLE1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sb2Nrcy5kZWZhdWx0KTtcbiAgICAgICAgZHNsLmp1bXAoJ0VORCcpO1xuICAgICAgICBkc2wubGFiZWwoJ0VMU0UnKTtcbiAgICAgICAgZHNsLmV2YWx1YXRlKCdpbnZlcnNlJywgYmxvY2tzLmludmVyc2UpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgZHNsLmp1bXBJZignRU5EJyk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgIH1cbiAgICB9KTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/syntax/builtins/with-dynamic-vars', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; @@ -48626,7 +48527,7 @@ enifed('glimmer-runtime/lib/syntax/builtins/with-dynamic-vars', ['exports', 'gli exports.default = WithDynamicVarsSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL3dpdGgtZHluYW1pYy12YXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQVFBLHFCQUFBOzhCQUFBLHFCQUFBOztBQUdFLGlCQUhGLHFCQUFBLENBR3NCLElBQWlCLEVBQUE7QUFDbkMsdUNBQU8sQ0FBQztBQURVLGdCQUFBLENBQUEsSUFBSSxHQUFKLElBQUksQ0FBYTtBQUZyQyxnQkFBQSxDQUFBLElBQUksR0FBRyw2QkFBNkIsQ0FBQztTQUlwQzs7QUFMSCw2QkFBQSxXQU9FLE9BQU8sR0FBQSxpQkFBQyxHQUFxQixFQUFFLEdBQWdCLEVBQUE7Z0JBQ3ZDLElBQUksR0FBdUIsSUFBSSxDQUEvQixJQUFJO2dCQUFVLE1BQU0sR0FBTyxJQUFJLENBQXpCLElBQUksQ0FBSSxNQUFNOztBQUUxQixlQUFHLENB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BFbnZpcm9ubWVudCkge1xuICAgIGxldCB7IGFyZ3MsIGFyZ3M6IHsgYmxvY2tzIH0gfSA9IHRoaXM7XG5cbiAgICBkc2wudW5pdChkc2wgPT4ge1xuICAgICAgZHNsLnB1dEFyZ3MoYXJncyk7XG4gICAgICBkc2wucHVzaER5bmFtaWNTY29wZSgpO1xuICAgICAgZHNsLmJpbmREeW5hbWljU2NvcGUoYXJncy5uYW1lZC5rZXlzKTtcbiAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgIGRzbC5wb3BEeW5hbWljU2NvcGUoKTtcbiAgICB9KTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/syntax/builtins/with', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; @@ -48675,7 +48576,7 @@ enifed('glimmer-runtime/lib/syntax/builtins/with', ['exports', 'glimmer-runtime/ exports.default = WithSyntax; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL3dpdGgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBU0EsVUFBQTs4QkFBQSxVQUFBOztBQUdFLGlCQUhGLFVBQUEsQ0FHcUIsSUFBaUIsRUFBQTtBQUNsQyx1Q0FBTyxDQUFDO0FBRFMsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFhO0FBRnBDLGdCQUFBLENBQUEsSUFBSSxHQUFHLGdCQUFnQixDQUFDO1NBSXZCOztBQUxILGtCQUFBLFdBT0UsT0FBTyxHQUFBLGlCQUFDLEdBQXFCLEVBQUUsR0FBZ0IsRUFBQTs7Ozs7Ozs7Ozs7O2dCQWF2QyxJQUFJLEdBQXVCLElBQUksQ0FBL0IsSUFBSTtnQkFBVSxNQUFNLEdBQU8sSUF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7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgICAgZHNsLmp1bXAoRU5EKTtcbiAgICAgICAgZHNsLmxhYmVsKCdFTFNFJyk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnaW52ZXJzZScsIGJsb2Nrcy5pbnZlcnNlKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGRzbC5qdW1wVW5sZXNzKEVORCk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcsIGJsb2Nrcy5kZWZhdWx0KTtcbiAgICAgIH1cbiAgICB9KTtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/syntax/core', ['exports', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/syntax/builtins/partial', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-runtime/lib/compiled/opcodes/component', 'glimmer-runtime/lib/compiled/opcodes/dom', 'glimmer-runtime/lib/syntax/expressions', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/compiled/expressions/value', 'glimmer-runtime/lib/compiled/expressions/lookups', 'glimmer-runtime/lib/compiled/expressions/has-block', 'glimmer-runtime/lib/compiled/expressions/helper', 'glimmer-runtime/lib/compiled/expressions/concat', 'glimmer-runtime/lib/utils', 'glimmer-runtime/lib/compiled/opcodes/content'], function (exports, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibSyntaxBuiltinsPartial, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerRuntimeLibCompiledOpcodesComponent, _glimmerRuntimeLibCompiledOpcodesDom, _glimmerRuntimeLibSyntaxExpressions, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibCompiledExpressionsValue, _glimmerRuntimeLibCompiledExpressionsLookups, _glimmerRuntimeLibCompiledExpressionsHasBlock, _glimmerRuntimeLibCompiledExpressionsHelper, _glimmerRuntimeLibCompiledExpressionsConcat, _glimmerRuntimeLibUtils, _glimmerRuntimeLibCompiledOpcodesContent) { 'use strict'; @@ -49934,9 +49835,11 @@ enifed('glimmer-runtime/lib/syntax/core', ['exports', 'glimmer-runtime/lib/synta var keys = this.keys; var values = this.values; - return new _glimmerRuntimeLibCompiledExpressionsArgs.CompiledNamedArgs(keys, values.map(function (value) { - return value.compile(compiler, env, symbolTable); - })); + var compiledValues = new Array(values.length); + for (var i = 0; i < compiledValues.length; i++) { + compiledValues[i] = values[i].compile(compiler, env, symbolTable); + } + return new _glimmerRuntimeLibCompiledExpressionsArgs.CompiledNamedArgs(keys, compiledValues); }; return NamedArgs; @@ -49979,7 +49882,7 @@ enifed('glimmer-runtime/lib/syntax/core', ['exports', 'glimmer-runtime/lib/synta return _class4; })(Args))(); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2NvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBMEdBLEtBQUE7OEJBQUEsS0FBQTs7QUFxQkUsaUJBckJGLEtBQUEsQ0FzQlcsSUFBYyxFQUNkLElBQVUsRUFBQTtBQUVqQix1Q0FBTyxDQUFDO0FBSEQsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFVO0FBQ2QsZ0JBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFNO0FBdEJaLGdCQUFBLENBQUEsSUFBSSxHQUFHLE9BQU8sQ0FBQztTQXlCckI7O0FBMUJILGFBQUEsQ0FHUyxRQUFRLEdBQUEsa0JBQUMsSUFBZ0MsRUFBRSxXQUF3QixFQUFFLE9BQXFCLEVBQUE7Z0JBQ3hGLElBQUksR0FBeUMsSUFBSTtnQkFBM0MsTUFBTSxHQUFpQyxJQUFJO2dCQUFuQyxJQUFJLEdBQTJCLElBQUk7Z0JBQTdCLFVBQ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QXJncy5lbXB0eSgpO1xuICB9XG59KTtcbiJdfQ== + enifed('glimmer-runtime/lib/syntax/expressions', ['exports', 'glimmer-runtime/lib/syntax/core', 'glimmer-wire-format'], function (exports, _glimmerRuntimeLibSyntaxCore, _glimmerWireFormat) { 'use strict'; @@ -50008,7 +49911,7 @@ enifed('glimmer-runtime/lib/syntax/expressions', ['exports', 'glimmer-runtime/li ; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2V4cHJlc3Npb25zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQWlCRSxLQUFLLHNCQUxMLFdBQVcsQ0FLWCxLQUFLO1FBQ0wsUUFBUSxzQkFOUixXQUFXLENBTVgsUUFBUTtRQUNSLEtBQUssc0JBUEwsV0FBVyxDQU9YLEtBQUs7UUFDTCxVQUFVLHNCQVJWLFdBQVcsQ0FRWCxVQUFVO1FBQ1YsZ0JBQWdCLHNCQVRoQixXQUFXLENBU1gsZ0JBQWdCO1FBQ2hCLFFBQVEsc0JBVlIsV0FBVyxDQVVYLFFBQVE7UUFDUixTQUFTLHNCQVhULFdBQVcsQ0FXWCxTQUFTO1FBQ1QsZ0JBQWdCLHNCQVpoQixXQUFXLENBWVgsZ0JBQWdCO1FBQ2hCLFdBQVcsc0JBYlgsV0FBVyxDQWFYLFdBQVc7O3NCQUdiLFVBQXdCLElBQTBCLEVBQUE7QUFDaEQsWUFBSSxnQkFBZ0IsQ0FBQyxJQUFJLENBQUMsRUFBRSxPQUFPLDZCQTVCbkMsS0FBSyxDQTRCMEMsUUFBUSxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQzlELFlBQUksV0FBVyxDQUFDLElBQUksQ0FBQyxFQUFFLE9BQU8sNkJBN0I5QixLQUFLLENBNkJxQyxLQUFLLENBQUMsU0FBUyxDQUFDLENBQUM7QUFDM0QsWUFBSSxLQUFLLENBQUMsSU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KHNleHApO1xuICBpZiAoaXNIZWxwZXIoc2V4cCkpIHJldHVybiBIZWxwZXJTeW50YXguZnJvbVNwZWMoc2V4cCk7XG4gIGlmIChpc1Vua25vd24oc2V4cCkpIHJldHVybiBVbmtub3duU3ludGF4LmZyb21TcGVjKHNleHApO1xuICBpZiAoaXNIYXNCbG9jayhzZXhwKSkgcmV0dXJuIEhhc0Jsb2NrU3ludGF4LmZyb21TcGVjKHNleHApO1xuICBpZiAoaXNIYXNCbG9ja1BhcmFtcyhzZXhwKSkgcmV0dXJuIEhhc0Jsb2NrUGFyYW1zU3ludGF4LmZyb21TcGVjKHNleHApO1xuXG4gIHRocm93IG5ldyBFcnJvcihgVW5leHBlY3RlZCB3aXJlIGZvcm1hdDogJHtKU09OLnN0cmluZ2lmeShzZXhwKX1gKTtcbn07XG4iXX0= + enifed('glimmer-runtime/lib/syntax/statements', ['exports', 'glimmer-runtime/lib/syntax/core', 'glimmer-wire-format'], function (exports, _glimmerRuntimeLibSyntaxCore, _glimmerWireFormat) { 'use strict'; @@ -50048,7 +49951,7 @@ enifed('glimmer-runtime/lib/syntax/statements', ['exports', 'glimmer-runtime/lib ; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L3N0YXRlbWVudHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBMkJFLE9BQU8sc0JBTlAsVUFBVSxDQU1WLE9BQU87UUFDUCxPQUFPLHNCQVBQLFVBQVUsQ0FPVixPQUFPO1FBQ1AsU0FBUyxzQkFSVCxVQUFVLENBUVYsU0FBUztRQUNULFFBQVEsc0JBVFIsVUFBVSxDQVNWLFFBQVE7UUFDUixhQUFhLHNCQVZiLFVBQVUsQ0FVVixhQUFhO1FBQ2IsTUFBTSxzQkFYTixVQUFVLENBV1YsTUFBTTtRQUNOLFNBQVMsc0JBWlQsVUFBVSxDQVlWLFNBQVM7UU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ZW1lbnQoc2V4cCkpIHJldHVybiBGbHVzaEVsZW1lbnQuZnJvbVNwZWMoKTtcbiAgaWYgKGlzQ2xvc2VFbGVtZW50KHNleHApKSByZXR1cm4gQ2xvc2VFbGVtZW50LmZyb21TcGVjKCk7XG4gIGlmIChpc1N0YXRpY0F0dHIoc2V4cCkpIHJldHVybiBTdGF0aWNBdHRyLmZyb21TcGVjKHNleHApO1xuICBpZiAoaXNTdGF0aWNBcmcoc2V4cCkpIHJldHVybiBTdGF0aWNBcmcuZnJvbVNwZWMoc2V4cCk7XG4gIGlmIChpc01vZGlmaWVyKHNleHApKSByZXR1cm4gTW9kaWZpZXIuZnJvbVNwZWMoc2V4cCk7XG59O1xuIl19 + enifed('glimmer-runtime/lib/template', ['exports', 'glimmer-util', 'glimmer-runtime/lib/builder', 'glimmer-runtime/lib/vm', 'glimmer-runtime/lib/scanner'], function (exports, _glimmerUtil, _glimmerRuntimeLibBuilder, _glimmerRuntimeLibVm, _glimmerRuntimeLibScanner) { 'use strict'; @@ -50099,7 +50002,7 @@ enifed('glimmer-runtime/lib/template', ['exports', 'glimmer-util', 'glimmer-runt return { id: id, meta: meta, _block: block, asEntryPoint: asEntryPoint, asLayout: asLayout, asPartial: asPartial, render: render }; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdGVtcGxhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O3NCQWtGQSxlQUFBOztBQVRBLFFBQUksUUFBUSxHQUFHLENBQUMsQ0FBQzs7QUFTakIsYUFBQSxlQUFBLENBQXdDLElBQXlELEVBQUE7WUFBdkQsRUFBRSxHQUFKLElBQXlELENBQXZELEVBQUU7WUFBRSxJQUFJLEdBQVYsSUFBeUQsQ0FBbkQsSUFBSTtZQUFFLEtBQUssR0FBakIsSUFBeUQsQ0FBN0MsS0FBSzs7QUFDdkQsWUFBSSxXQUFvQyxZQUFB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xuICBsZXQgYXNMYXlvdXQgPSAoKSA9PiB7XG4gICAgaWYgKCFsYXlvdXQpIGxheW91dCA9IHNjYW5uZXIuc2NhbkxheW91dCgpO1xuICAgIHJldHVybiBsYXlvdXQ7XG4gIH07XG4gIGxldCBhc1BhcnRpYWwgPSBzeW1ib2xzID0+IHNjYW5uZXIuc2NhblBhcnRpYWwoc3ltYm9scyk7XG4gIGxldCByZW5kZXIgPSAoc2VsZjogUGF0aFJlZmVyZW5jZTxhbnk+LCBhcHBlbmRUbzogU2ltcGxlLkVsZW1lbnQsIGR5bmFtaWNTY29wZTogRHluYW1pY1Njb3BlKSA9PiB7XG4gICAgbGV0IGVsZW1lbnRTdGFjayA9IEVsZW1lbnRTdGFjay5mb3JJbml0aWFsUmVuZGVyKGVudiwgYXBwZW5kVG8sIG51bGwpO1xuICAgIGxldCBjb21waWxlZCA9IGFzRW50cnlQb2ludCgpLmNvbXBpbGUoZW52KTtcbiAgICBsZXQgdm0gPSBWTS5pbml0aWFsKGVudiwgc2VsZiwgZHluYW1pY1Njb3BlLCBlbGVtZW50U3RhY2ssIGNvbXBpbGVkLnN5bWJvbHMpO1xuICAgIHJldHVybiB2bS5leGVjdXRlKGNvbXBpbGVkLm9wcyk7XG4gIH07XG4gIHJldHVybiB7IGlkLCBtZXRhLCBfYmxvY2s6IGJsb2NrLCBhc0VudHJ5UG9pbnQsIGFzTGF5b3V0LCBhc1BhcnRpYWwsIHJlbmRlciB9O1xufVxuIl19 + enifed('glimmer-runtime/lib/upsert', ['exports', 'glimmer-runtime/lib/bounds'], function (exports, _glimmerRuntimeLibBounds) { 'use strict'; @@ -50267,13 +50170,24 @@ enifed('glimmer-runtime/lib/upsert', ['exports', 'glimmer-runtime/lib/bounds'], return NodeUpsert; })(Upsert); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdXBzZXJ0LnRzIl0sIm5hbWVzIjpbXSwibW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WVudD4sIHZhbHVlLCBuZXh0U2libGluZyBhcyBGSVhfUkVJRklDQVRJT048Tm9kZT4pO1xuXG4gICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9IGVsc2Uge1xuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/utils', ['exports', 'glimmer-util'], function (exports, _glimmerUtil) { 'use strict'; - var EMPTY_ARRAY = Object.freeze([]); + var HAS_NATIVE_WEAKMAP = (function () { + // detect if `WeakMap` is even present + var hasWeakMap = typeof WeakMap === 'function'; + if (!hasWeakMap) { + return false; + } + var instance = new WeakMap(); + // use `Object`'s `.toString` directly to prevent us from detecting + // polyfills as native weakmaps + return Object.prototype.toString.call(instance) === '[object WeakMap]'; + })(); + var EMPTY_ARRAY = HAS_NATIVE_WEAKMAP ? Object.freeze([]) : []; exports.EMPTY_ARRAY = EMPTY_ARRAY; - var EMPTY_DICT = Object.freeze(_glimmerUtil.dict()); + var EMPTY_DICT = HAS_NATIVE_WEAKMAP ? Object.freeze(_glimmerUtil.dict()) : _glimmerUtil.dict(); exports.EMPTY_DICT = EMPTY_DICT; var ListRange = (function () { @@ -50301,7 +50215,7 @@ enifed('glimmer-runtime/lib/utils', ['exports', 'glimmer-util'], function (expor exports.ListRange = ListRange; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBRU8sUUFBTSxXQUFXLEdBQUcsTUFBTSxDQUFDLE1BQU0sQ0FBQyxFQUFFLENBQUMsQ0FBQzs7QUFDdEMsUUFBTSxVQUFVLEdBQWMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxhQUhwQyxJQUFJLEVBRzJDLENBQUMsQ0FBQzs7O1FBb0JoRSxTQUFBO0FBT0UsaUJBUEYsU0FBQSxDQU9jLElBQVMsRU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+KTtcbn1cblxuZXhwb3J0IGludGVyZmFjZSBEZXN0cm95YWJsZSB7XG4gIGRlc3Ryb3koKTtcbn1cblxuZXhwb3J0IGludGVyZmFjZSBSYW5nZTxUPiB7XG4gIG1pbigpOiBudW1iZXI7XG4gIG1heCgpOiBudW1iZXI7XG4gIGF0KGluZGV4OiBudW1iZXIpOiBUO1xufVxuXG5leHBvcnQgY2xhc3MgTGlzdFJhbmdlPFQ+IGltcGxlbWVudHMgUmFuZ2U8VD4ge1xuICBwcml2YXRlIGxpc3Q6IFRbXTtcblxuICAvLyBbc3RhcnQsIGVuZF1cbiAgcHJpdmF0ZSBzdGFydDogbnVtYmVyO1xuICBwcml2YXRlIGVuZDogbnVtYmVyO1xuXG4gIGNvbnN0cnVjdG9yKGxpc3Q6IFRbXSwgc3RhcnQ6IG51bWJlciwgZW5kOiBudW1iZXIpIHtcbiAgICB0aGlzLmxpc3QgPSBsaXN0O1xuICAgIHRoaXMuc3RhcnQgPSBzdGFydDtcbiAgICB0aGlzLmVuZCA9IGVuZDtcbiAgfVxuXG4gIGF0KGluZGV4OiBudW1iZXIpOiBUIHtcbiAgICBpZiAoaW5kZXggPj0gdGhpcy5saXN0Lmxlbmd0aCkgcmV0dXJuIG51bGw7XG4gICAgcmV0dXJuIHRoaXMubGlzdFtpbmRleF07XG4gIH1cblxuICBtaW4oKTogbnVtYmVyIHtcbiAgICByZXR1cm4gdGhpcy5zdGFydDtcbiAgfVxuXG4gIG1heCgpOiBudW1iZXIge1xuICAgIHJldHVybiB0aGlzLmVuZDtcbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/vm', ['exports', 'glimmer-runtime/lib/vm/append', 'glimmer-runtime/lib/vm/update', 'glimmer-runtime/lib/vm/render-result'], function (exports, _glimmerRuntimeLibVmAppend, _glimmerRuntimeLibVmUpdate, _glimmerRuntimeLibVmRenderResult) { 'use strict'; @@ -50310,7 +50224,7 @@ enifed('glimmer-runtime/lib/vm', ['exports', 'glimmer-runtime/lib/vm/append', 'g exports.UpdatingVM = _glimmerRuntimeLibVmUpdate.default; exports.RenderResult = _glimmerRuntimeLibVmRenderResult.default; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1VBQW9CLEVBQUUsOEJBQWIsT0FBTztVQUFRLFFBQVEsOEJBQVIsUUFBUTtVQUNaLFVBQVUsOEJBQXJCLE9BQU87VUFDSSxZQUFZLG9DQUF2QixPQUFPIiwiZmlsZSI6InZtLmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgZGVmYXVsdCBhcyBWTSwgUHVibGljVk0gfSBmcm9tICcuL3ZtL2FwcGVuZCc7XG5leHBvcnQgeyBkZWZhdWx0IGFzIFVwZGF0aW5nVk0gfSBmcm9tICcuL3ZtL3VwZGF0ZSc7XG5leHBvcnQgeyBkZWZhdWx0IGFzIFJlbmRlclJlc3VsdCB9IGZyb20gJy4vdm0vcmVuZGVyLXJlc3VsdCc7XG4iXX0= + enifed('glimmer-runtime/lib/vm/append', ['exports', 'glimmer-runtime/lib/environment', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-runtime/lib/vm/update', 'glimmer-runtime/lib/vm/render-result', 'glimmer-runtime/lib/vm/frame'], function (exports, _glimmerRuntimeLibEnvironment, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerRuntimeLibVmUpdate, _glimmerRuntimeLibVmRenderResult, _glimmerRuntimeLibVmFrame) { 'use strict'; @@ -50615,7 +50529,7 @@ enifed('glimmer-runtime/lib/vm/append', ['exports', 'glimmer-runtime/lib/environ exports.default = VM; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0vYXBwZW5kLnRzIl0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yBpKyspIHtcbiAgICAgIHNjb3BlLnNldChuYW1lc1tpXSwgYXJncy5uYW1lZC5nZXQobmFtZXNbaV0pKTtcbiAgICB9XG4gIH1cbn1cblxuaW50ZXJmYWNlIEV4Y2VwdGlvbkhhbmRsZXIge1xuICBoYW5kbGVFeGNlcHRpb24oaW5pdGlhbGl6ZT86ICh2bTogVk0pID0+IHZvaWQpO1xufVxuXG5pbnRlcmZhY2UgUmV0dXJuSGFuZGxlciB7XG4gIHNldFJlbmRlclJlc3VsdChyZW5kZXJSZXN1bHQ6IFJlbmRlclJlc3VsdCk7XG59XG4iXX0= + enifed('glimmer-runtime/lib/vm/frame', ['exports'], function (exports) { 'use strict'; @@ -50809,7 +50723,7 @@ enifed('glimmer-runtime/lib/vm/frame', ['exports'], function (exports) { exports.FrameStack = FrameStack; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0vZnJhbWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBUUEsYUFBQSxHQUNFLFNBREYsYUFBQSxDQUVZLE9BQTJCLEVBQzNCLElBQW1CLEVBQ25CLFNBQTZCLEVBQUE7QUFGN0IsWUFBQSxDQUFBLE9BQU8sR0FBUCxPQUFPLENBQW9CO0FBQzNCLFlBQUEsQ0FBQSxJQUFJLEdBQUosSUFBSSxDQUFlO0FBQ25CLFlBQUEsQ0FBQSxTQUFTLEdBQVQsU0FBUyxDQUFvQjtLQUNuQzs7OztRQUdOLEtBQUE7QUFZRSxpQkFaRixLQUFBLENBYUksR0FBVSxFQUdvQjtnQkFGdkIsU0FBUyx5REFBYyxJQUFJO2dCQUMzQixPQUFPLHlEQUFnQyxJQUFJO2dCQUMzQyxNQUFNLHlEQUFhLElBQUk7O0FBRnZCLGdCQUFBLENBQUEsU0FBUyxHQUFULFNBQVMsQ0FBa0I7QUFDM0IsZ0JBQUEsQ0FBQSxPQUFPLEdBQ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iAob3ApIHtcbiAgICAgIHRoaXMuc2V0Q3VycmVudChvcHMubmV4dE5vZGUob3ApKTtcbiAgICAgIHJldHVybiBvcDtcbiAgICB9IGVsc2Uge1xuICAgICAgdGhpcy5wb3AoKTtcbiAgICAgIHJldHVybiBudWxsO1xuICAgIH1cbiAgfVxufVxuIl19 + enifed('glimmer-runtime/lib/vm/render-result', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/vm/update'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibVmUpdate) { 'use strict'; @@ -50862,7 +50776,7 @@ enifed('glimmer-runtime/lib/vm/render-result', ['exports', 'glimmer-runtime/lib/ exports.default = RenderResult; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0vcmVuZGVyLXJlc3VsdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFPQSxZQUFBO0FBQ0UsaUJBREYsWUFBQSxDQUVZLEdBQWdCLEVBQ2hCLFFBQW9DLEVBQ3BDLE1BQXlCLEVBQUE7QUFGekIsZ0JBQUEsQ0FBQSxHQUFHLEdBQUgsR0FBRyxDQUFhO0FBQ2hCLGdCQUFBLENBQUEsUUFBUSxHQUFSLFFBQVEsQ0FBNEI7QUFDcEMsZ0JBQUEsQ0FBQSxNQUFNLEdBQU4sTUFBTSxDQUFtQjtTQUMvQjs7QUFMTixvQkFBQSxXQU9FLFFBQVEsR0FBQSxvQkFBMkQ7NkVBQTNCLEVBQUUsZ0JBQWdCLEVBQUUsS0FBSyxFQUFFOzs2Q0FBeEQsZ0JBQWdCO2dCQUFoQixnQkFBZ0IseUNBQUcsS0FBSztnQkFDM0IsR0FBRyxHQUFlLElBQUksQ0FBdEIsR0FBRztnQkFBRSxRQUFRLEdBQUssSUFBSSxDQUFqQixRQUFROztBQUNuQixnQkFBSSxFQUFFLEdBQUcsdUNBQWUsR0FBRyxFQUF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IGxhc3ROb2RlKCk6IFNpbXBsZS5Ob2RlIHtcbiAgICByZXR1cm4gdGhpcy5ib3VuZHMubGFzdE5vZGUoKTtcbiAgfVxuXG4gIG9wY29kZXMoKTogTGlua2VkTGlzdDxVcGRhdGluZ09wY29kZT4ge1xuICAgIHJldHVybiB0aGlzLnVwZGF0aW5nO1xuICB9XG5cbiAgaGFuZGxlRXhjZXB0aW9uKCkge1xuICAgIHRocm93IFwidGhpcyBzaG91bGQgbmV2ZXIgaGFwcGVuXCI7XG4gIH1cblxuICBkZXN0cm95KCkge1xuICAgIHRoaXMuYm91bmRzLmRlc3Ryb3koKTtcbiAgICBjbGVhcih0aGlzLmJvdW5kcyk7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-runtime/lib/vm/update', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/builder', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/vm/append'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibBuilder, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibVmAppend) { 'use strict'; @@ -51196,7 +51110,7 @@ enifed('glimmer-runtime/lib/vm/update', ['exports', 'glimmer-runtime/lib/bounds' return UpdatingVMFrame; })(); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0vdXBkYXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQTRCQSxVQUFBO0FBTUUsaUJBTkYsVUFBQSxDQU1jLEdBQWdCLEVBQUUsSUFBNEIsRUFBQTt3Q0FBNUIsSUFBNEIsQ0FBMUIsZ0JBQWdCO2dCQUFoQixnQkFBZ0IseUNBQUcsS0FBSzs7QUFGaEQsZ0JBQUEsQ0FBQSxVQU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xuICBuZXh0U3RhdGVtZW50KCk6IFVwZGF0aW5nT3Bjb2RlIHtcbiAgICBsZXQgeyBjdXJyZW50LCBvcHMgfSA9IHRoaXM7XG4gICAgaWYgKGN1cnJlbnQpIHRoaXMuY3VycmVudCA9IG9wcy5uZXh0Tm9kZShjdXJyZW50KTtcbiAgICByZXR1cm4gY3VycmVudDtcbiAgfVxuXG4gIGhhbmRsZUV4Y2VwdGlvbigpIHtcbiAgICB0aGlzLmV4Y2VwdGlvbkhhbmRsZXIuaGFuZGxlRXhjZXB0aW9uKCk7XG4gIH1cbn1cbiJdfQ== + enifed('glimmer-util/index', ['exports', 'glimmer-util/lib/namespaces', 'glimmer-util/lib/platform-utils', 'glimmer-util/lib/assert', 'glimmer-util/lib/logger', 'glimmer-util/lib/object-utils', 'glimmer-util/lib/guid', 'glimmer-util/lib/collections', 'glimmer-util/lib/list-utils'], function (exports, _glimmerUtilLibNamespaces, _glimmerUtilLibPlatformUtils, _glimmerUtilLibAssert, _glimmerUtilLibLogger, _glimmerUtilLibObjectUtils, _glimmerUtilLibGuid, _glimmerUtilLibCollections, _glimmerUtilLibListUtils) { 'use strict'; @@ -51225,7 +51139,7 @@ enifed('glimmer-util/index', ['exports', 'glimmer-util/lib/namespaces', 'glimmer exports.ListSlice = _glimmerUtilLibListUtils.ListSlice; exports.Slice = _glimmerUtilLibListUtils.Slice; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7VUFJUyxnQkFBZ0IsNkJBQWhCLGdCQUFnQjtVQUNoQixNQUFNLGdDQUFOLE1BQU07VUFBRSxLQUFLLGdDQUFMLEtBQUs7VUFBRSxNQUFNLGdDQUFOLE1BQU07VUFDVixNQUFNLHlCQUFqQixPQUFPO1VBQ0ksTUFBTSx5QkFBakIsT0FBTztVQUFZLE1BQU0seUJBQU4sTUFBT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mcm9tICcuL2xpYi9ndWlkJztcblxuZXhwb3J0IHsgU3RhY2ssIERpY3QsIFNldCwgRGljdFNldCwgZGljdCB9IGZyb20gJy4vbGliL2NvbGxlY3Rpb25zJztcbmV4cG9ydCB7IEVNUFRZX1NMSUNFLCBMaW5rZWRMaXN0LCBMaW5rZWRMaXN0Tm9kZSwgTGlzdE5vZGUsIENsb25lYWJsZUxpc3ROb2RlLCBMaXN0U2xpY2UsIFNsaWNlIH0gZnJvbSAnLi9saWIvbGlzdC11dGlscyc7XG5cbmV4cG9ydCB0eXBlIEZJWE1FPFQsIHN0cmluZz4gPSBUO1xuIl19 + enifed("glimmer-util/lib/assert", ["exports"], function (exports) { // import Logger from './logger'; // let alreadyWarned = false; @@ -51248,7 +51162,7 @@ enifed("glimmer-util/lib/assert", ["exports"], function (exports) { exports.default = debugAssert; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvYXNzZXJ0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O0FBSUEsYUFBQSxXQUFBLENBQTRCLElBQUksRUFBRSxHQUFHLEVBQUE7Ozs7O0FBTW5DLFlBQUksQ0FBQyxJQUFJLEVBQUU7QUFDVCxrQkFBTSxJQUFJLEtBQUssQ0FBQyxHQUFHLElBQUksbUJBQW1CLENBQUMsQ0FBQztTQUM3QztLQUNGOztBQUVELGFBQUEsVUFBQSxHQUFBLEVBQStCOztzQkFFaEIsV0FBVyIsImZpbGUiOiJhc3NlcnQuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBpbXBvcnQgTG9nZ2VyIGZyb20gJy4vbG9nZ2VyJztcblxuLy8gbGV0IGFscmVhZHlXYXJuZWQgPSBmYWxzZTtcblxuZXhwb3J0IGZ1bmN0aW9uIGRlYnVnQXNzZXJ0KHRlc3QsIG1zZykge1xuICAvLyBpZiAoIWFscmVhZHlXYXJuZWQpIHtcbiAgLy8gICBhbHJlYWR5V2FybmVkID0gdHJ1ZTtcbiAgLy8gICBMb2dnZXIud2FybihcIkRvbid0IGxlYXZlIGRlYnVnIGFzc2VydGlvbnMgb24gaW4gcHVibGljIGJ1aWxkc1wiKTtcbiAgLy8gfVxuXG4gIGlmICghdGVzdCkge1xuICAgIHRocm93IG5ldyBFcnJvcihtc2cgfHwgXCJhc3NlcnRpb24gZmFpbHVyZVwiKTtcbiAgfVxufVxuXG5leHBvcnQgZnVuY3Rpb24gcHJvZEFzc2VydCgpIHt9XG5cbmV4cG9ydCBkZWZhdWx0IGRlYnVnQXNzZXJ0O1xuIl19 + enifed('glimmer-util/lib/collections', ['exports', 'glimmer-util/lib/guid'], function (exports, _glimmerUtilLibGuid) { 'use strict'; @@ -51332,7 +51246,7 @@ enifed('glimmer-util/lib/collections', ['exports', 'glimmer-util/lib/guid'], fun exports.Stack = Stack; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvY29sbGVjdGlvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFZQSxRQUFJLEtBQUssR0FBRyxNQUFNLENBQUMsTUFBTSxDQUFDLElBQUksRUFBRTs7O0FBRzlCLG1CQUFXLEVBQUU7QUFDWCxpQkFBSyxFQUFFLFNBQVM7QUFDaEIsc0JBQVUsRUFBRSxLQUFLO0FBQ2pCLG9CQUFRLEVBQUUsSUFBSTtTQUNmO0tBQ0YsQ0FBQyxDQUFDO0FBRUgsYUFBQSxXQUFBLEdBQUEsRUFBeUI7QUFDekIsZUFBVyxDQUFDLFNBQVMsR0FBRyxLQUFLLENBQUM7O0FBRTlCLGFBQUEsSUFBQSxHQUFBOzs7OztBQUtFLGVBQU8sSUFBSSxXQUFXLEVBQUUsQ0FBQztLQUMxQjs7UUFJRCxPQUFBO0FBR0UsaUJBSEYsT0FBQSxHQUdFO0FBQ0UsZ0JBQUks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IHJldHVybiB0aGlzLnN0YWNrLmxlbmd0aCA9PT0gMDtcbiAgfVxufVxuIl19 + enifed("glimmer-util/lib/guid", ["exports"], function (exports) { "use strict"; @@ -51348,7 +51262,7 @@ enifed("glimmer-util/lib/guid", ["exports"], function (exports) { return object._guid || initializeGuid(object); } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvZ3VpZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLFFBQUksSUFBSSxHQUFHLENBQUMsQ0FBQzs7QUFNYixhQUFBLGNBQUEsQ0FBK0IsTUFBZSxFQUFBO0FBQzVDLGVBQVEsTUFBTSxDQUFDLEtBQUssR0FBRyxFQUFFLElBQUksQ0FBRTtLQUNoQzs7QUFFRCxhQUFBLFVBQUEsQ0FBMkIsTUFBZSxFQUFBO0FBQ3hDLGVBQU8sTUFBTSxDQUFDLEtBQUssSUFBSSxjQUFjLENBQUMsTUFBTSxDQUFDLENBQUM7S0FDL0MiLCJmaWxlIjoiZ3VpZC5qcyIsInNvdXJjZXNDb250ZW50IjpbImxldCBHVUlEID0gMDtcblxuZXhwb3J0IGludGVyZmFjZSBIYXNHdWlkIHtcbiAgX2d1aWQ6IG51bWJlcjtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGluaXRpYWxpemVHdWlkKG9iamVjdDogSGFzR3VpZCk6IG51bWJlciB7XG4gIHJldHVybiAob2JqZWN0Ll9ndWlkID0gKytHVUlEKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGVuc3VyZUd1aWQob2JqZWN0OiBIYXNHdWlkKTogbnVtYmVyIHtcbiAgcmV0dXJuIG9iamVjdC5fZ3VpZCB8fCBpbml0aWFsaXplR3VpZChvYmplY3QpO1xufSJdfQ== + enifed("glimmer-util/lib/list-utils", ["exports"], function (exports) { "use strict"; @@ -51572,7 +51486,7 @@ enifed("glimmer-util/lib/list-utils", ["exports"], function (exports) { var EMPTY_SLICE = new ListSlice(null, null); exports.EMPTY_SLICE = EMPTY_SLICE; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvbGlzdC11dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFTQSxRQUFBLEdBS0UsU0FMRixRQUFBLENBS2MsS0FBUSxFQUFBO0FBSmIsWUFBQSxDQUFBLElBQUksR0FBZ0IsSUFBSSxDQUFDO0FBQ3pCLFlBQUEsQ0FBQSxJQUFJLEdBQWdCLElBQUksQ0FBQztBQUk5QixZQUFJLENBQUMsS0FBSyxHQUFHLEtBQUssQ0FBQztLQUNwQjs7OztRQU9ILFVBQUE7QUFVRSxpQkFWRixVQUFBLEdBVUU7QUFDRSxnQkFBSSxDQUFDLEtBQUssRUFBRSxDQUFDO1NBQ2Q7O0FBWkgsa0JBQUEsQ0FDUyxTQUFTLEdBQUEsbUJBQThCLEtBQWUsRUFBQTtBQUMzRCxnQkFBSSxJQUFJLEdBQUcsSUFBSSxVQUFVLEVBQUssQ0FBQztBQUMvQixpQkFBSyxDQUFDLFdBQVcsQ0FBQyxVQUFBLENBQUM7dUJBQUksSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsS0FBSyxFQUFFLENBQUM7YUFBQSxDQUFDLENBQUM7QUFDL0MsbUJBQU8sSUFBSSxDQUFDO1NBQ2I7O0FBTEgsa0JBQUEsV0FjRSxJQUFJLEdBQUEsZ0JBQUE7QUFDRixtQkFBTyxJQUFJLENBQUMsS0FBSyxDQUFDO1NBQ25COztBQWhCSCxrQkFBQSxXQWtCRSxJQUFJLEdBQUEsZ0JBQUE7QUFDRixtQkFBTyxJQUFJLENBQUMsS0FBSyxDQUFDO1NBQ25COztBQXBCSCxrQkFBQSxXQXNCRSxLQUFLLEdBQUEsaUJBQUE7QUFDSCxnQkFBSSxDQUFDLEtBQUss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IHJldHVybiA8VD5ub2RlLm5leHQ7XG4gIH1cblxuICBwcmV2Tm9kZShub2RlOiBUKTogVCB7XG4gICAgaWYgKG5vZGUgPT09IHRoaXMuX2hlYWQpIHJldHVybiBudWxsO1xuICAgIHJldHVybiA8VD5ub2RlLnByZXY7XG4gIH1cblxuICBpc0VtcHR5KCkge1xuICAgIHJldHVybiBmYWxzZTtcbiAgfVxufVxuXG5leHBvcnQgY29uc3QgRU1QVFlfU0xJQ0UgPSBuZXcgTGlzdFNsaWNlKG51bGwsIG51bGwpO1xuIl19 + enifed("glimmer-util/lib/logger", ["exports"], function (exports) { "use strict"; @@ -51662,7 +51576,7 @@ enifed("glimmer-util/lib/logger", ["exports"], function (exports) { var LOG_LEVEL = LogLevel.Warn; exports.default = new Logger({ console: _console, level: LOG_LEVEL }); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvbG9nZ2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLFFBQVksUUFLWCxDQUFBOztBQUxELEtBQUEsVUFBWSxRQUFRLEVBQUE7QUFDbEIsZ0JBQUEsQ0FBQSxRQUFBLENBQUEsT0FBQSxDQUFBLEdBQUEsQ0FBQSxDQUFBLEdBQUEsT0FBSyxDQUFBO0FBQ0wsZ0JBQUEsQ0FBQSxRQUFBLENBQUEsT0FBQSxDQUFBLEdBQUEsQ0FBQSxDQUFBLEdBQUEsT0FBSyxDQUFBO0FBQ0wsZ0JBQUEsQ0FBQSxRQUFBLENBQUEsTUFBQSxDQUFBLEdBQUEsQ0FBQSxDQUFBLEdBQUEsTUFBSSxDQUFBO0FBQ0osZ0JBQUEsQ0FBQSxRQUFBLENBQUEsT0FBQSxDQUFBLEdBQUEsQ0FBQSxDQUFBLEdBQUEsT0FBSyxDQUFBO0tBQ04sQ0FBQSxDQUxXLFFBQVEsYUFBUixRQUtYLEdBTFcsUUFBUSxHQ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yKSkgcmV0dXJuO1xuICAgIHRoaXMuY29uc29sZS5lcnJvcihtZXNzYWdlKTtcbiAgfVxufVxuXG5sZXQgX2NvbnNvbGUgPSAodHlwZW9mIGNvbnNvbGUgPT09ICd1bmRlZmluZWQnKSA/IG5ldyBOdWxsQ29uc29sZSgpIDogY29uc29sZTtcblxuY29uc3QgQUxXQVlTID0gbmV3IExvZ2dlcih7IGNvbnNvbGU6IF9jb25zb2xlLCBsZXZlbDogTG9nTGV2ZWwuVHJhY2UgfSk7XG5jb25zdCBMT0dfTEVWRUwgPSBMb2dMZXZlbC5XYXJuO1xuXG5leHBvcnQgZGVmYXVsdCBuZXcgTG9nZ2VyKHsgY29uc29sZTogX2NvbnNvbGUsIGxldmVsOiBMT0dfTEVWRUwgfSk7XG4iXX0= + enifed('glimmer-util/lib/namespaces', ['exports'], function (exports) { // There is a small whitelist of namespaced attributes specially // enumerated in @@ -51702,7 +51616,7 @@ enifed('glimmer-util/lib/namespaces', ['exports'], function (exports) { return WHITELIST[attrName] || null; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvbmFtZXNwYWNlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7OztBQWNBLFFBQU0sS0FBSyxHQUFHLDhCQUE4QixDQUFDO0FBQzdDLFFBQU0sR0FBRyxHQUFHLHNDQUFzQyxDQUFDO0FBQ25ELFFBQU0sS0FBSyxHQUFHLCtCQUErQixDQUFDO0FBRTlDLFFBQU0sU0FBUyxHQUFHO0FBQ2hCLHVCQUFlLEVBQUUsS0FBSztBQUN0Qix1QkFBZSxFQUFFLEtBQUs7QUFDdEIsb0JBQVksRUFBRSxLQUFLO0FBQ25CLG9CQUFZLEVBQUUsS0FBSztBQUNuQixvQkFBWSxFQUFFLEtBQUs7QUFDbkIscUJBQWEsRUFBRSxLQUFLO0FBQ3BCLG9CQUF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1lc3BhY2VkIGF0dHJpYnV0ZSBjYW4gYmUgZXhwcmVzc2VkIGluIHRoZSBIVE1MIHN5bnRheC5cblxuY29uc3QgWExJTksgPSAnaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayc7XG5jb25zdCBYTUwgPSAnaHR0cDovL3d3dy53My5vcmcvWE1MLzE5OTgvbmFtZXNwYWNlJztcbmNvbnN0IFhNTE5TID0gJ2h0dHA6Ly93d3cudzMub3JnLzIwMDAveG1sbnMvJztcblxuY29uc3QgV0hJVEVMSVNUID0ge1xuICAneGxpbms6YWN0dWF0ZSc6IFhMSU5LLFxuICAneGxpbms6YXJjcm9sZSc6IFhMSU5LLFxuICAneGxpbms6aHJlZic6IFhMSU5LLFxuICAneGxpbms6cm9sZSc6IFhMSU5LLFxuICAneGxpbms6c2hvdyc6IFhMSU5LLFxuICAneGxpbms6dGl0bGUnOiBYTElOSyxcbiAgJ3hsaW5rOnR5cGUnOiBYTElOSyxcbiAgJ3htbDpiYXNlJzogWE1MLFxuICAneG1sOmxhbmcnOiBYTUwsXG4gICd4bWw6c3BhY2UnOiBYTUwsXG4gICd4bWxucyc6IFhNTE5TLFxuICAneG1sbnM6eGxpbmsnOiBYTUxOU1xufTtcblxuZXhwb3J0IGZ1bmN0aW9uIGdldEF0dHJOYW1lc3BhY2UoYXR0ck5hbWUpIHtcbiAgcmV0dXJuIFdISVRFTElTVFthdHRyTmFtZV0gfHwgbnVsbDtcbn0iXX0= + enifed('glimmer-util/lib/object-utils', ['exports'], function (exports) { 'use strict'; @@ -51722,7 +51636,7 @@ enifed('glimmer-util/lib/object-utils', ['exports'], function (exports) { return obj; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvb2JqZWN0LXV0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7UUFBYyxPQUFPLEdBQUssTUFBTSxDQUF4QixJQUFJOztBQV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zaWduPFQsIFUsIFYsIFcsIFg+KG9iajogVCwgYTogVSwgYjogViwgYzogVywgZDogWCk6IFQgJiBVICYgViAmIFcgJiBYO1xuZXhwb3J0IGZ1bmN0aW9uIGFzc2lnbjxULCBVLCBWLCBXLCBYLCBZPihvYmo6IFQsIGE6IFUsIGI6IFYsIGM6IFcsIGQ6IFgsIGU6IFkpOiBUICYgVSAmIFYgJiBXICYgWCAmIFk7XG5leHBvcnQgZnVuY3Rpb24gYXNzaWduPFQsIFUsIFYsIFcsIFgsIFksIFo+KG9iajogVCwgYTogVSwgYjogViwgYzogVywgZDogWCwgZTogWSwgZjogWik6IFQgJiBVICYgViAmIFcgJiBYICYgWSAmIFo7XG5leHBvcnQgZnVuY3Rpb24gYXNzaWduKHRhcmdldDogYW55LCAuLi5hcmdzOiBhbnlbXSk6IGFueTtcbmV4cG9ydCBmdW5jdGlvbiBhc3NpZ24ob2JqKSB7XG4gIGZvciAobGV0IGkgPSAxOyBpIDwgYXJndW1lbnRzLmxlbmd0aDsgaSsrKSB7XG4gICAgbGV0IGFzc2lnbm1lbnQgPSBhcmd1bWVudHNbaV07XG4gICAgaWYgKGFzc2lnbm1lbnQgPT09IG51bGwgfHwgdHlwZW9mIGFzc2lnbm1lbnQgIT09ICdvYmplY3QnKSBjb250aW51ZTtcbiAgICBsZXQga2V5cyA9IG9iaktleXMoYXNzaWdubWVudCk7XG4gICAgZm9yIChsZXQgaiA9IDA7IGogPCBrZXlzLmxlbmd0aDsgaisrKSB7XG4gICAgICBsZXQga2V5ID0ga2V5c1tqXTtcbiAgICAgIG9ialtrZXldID0gYXNzaWdubWVudFtrZXldO1xuICAgIH1cbiAgfVxuICByZXR1cm4gb2JqO1xufVxuIl19 + enifed("glimmer-util/lib/platform-utils", ["exports"], function (exports) { "use strict"; @@ -51733,7 +51647,7 @@ enifed("glimmer-util/lib/platform-utils", ["exports"], function (exports) { return val; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvcGxhdGZvcm0tdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFJQSxhQUFBLE1BQUEsQ0FBMEIsR0FBYSxFQUFBO0FBQ3JDLFlBQUksR0FBRyxLQUFLLElBQUksSUFBSSxHQUFHLEtBQUssU0FBUyxFQUFFLE1BQU0sSUFBSSxLQUFLLGdDQUFnQyxDQUFDO0FBQ3ZGLGVBQU8sR0FBRyxDQUFDO0tBQ1oiLCJmaWxlIjoicGxhdGZvcm0tdXRpbHMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgdHlwZSBPcGFxdWUgPSB7fSB8IHZvaWQ7XG5leHBvcnQgdHlwZSBPcHRpb248VD4gPSBUIHwgbnVsbDsgLy8gdHNsaW50OmRpc2FibGUtbGluZVxuZXhwb3J0IHR5cGUgTWF5YmU8VD4gPSBPcHRpb248VD4gfCB1bmRlZmluZWQ7IC8vIHRzbGludDpkaXNhYmxlLWxpbmVcblxuZXhwb3J0IGZ1bmN0aW9uIHVud3JhcDxUPih2YWw6IE1heWJlPFQ+KTogVCB7XG4gIGlmICh2YWwgPT09IG51bGwgfHwgdmFsID09PSB1bmRlZmluZWQpIHRocm93IG5ldyBFcnJvcihgRXhwZWN0ZWQgdmFsdWUgdG8gYmUgcHJlc2VudGApO1xuICByZXR1cm4gdmFsO1xufVxuIl19 + enifed("glimmer-util/lib/quoting", ["exports"], function (exports) { "use strict"; @@ -51769,7 +51683,7 @@ enifed("glimmer-util/lib/quoting", ["exports"], function (exports) { return str; } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvcXVvdGluZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLGFBQUEsWUFBQSxDQUFzQixHQUFHLEVBQUE7QUFDdkIsV0FBRyxHQUFHLEdBQUcsQ0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IpO1xuICBzdHIgPSBzdHIucmVwbGFjZSgvXCIvZywgJ1xcXFxcIicpO1xuICBzdHIgPSBzdHIucmVwbGFjZSgvXFxuL2csIFwiXFxcXG5cIik7XG4gIHJldHVybiBzdHI7XG59XG5cbmV4cG9ydCB7IGVzY2FwZVN0cmluZyB9O1xuXG5mdW5jdGlvbiBzdHJpbmcoc3RyKSB7XG4gIHJldHVybiAnXCInICsgZXNjYXBlU3RyaW5nKHN0cikgKyAnXCInO1xufVxuXG5leHBvcnQgeyBzdHJpbmcgfTtcblxuZnVuY3Rpb24gYXJyYXkoYSkge1xuICByZXR1cm4gXCJbXCIgKyBhICsgXCJdXCI7XG59XG5cbmV4cG9ydCB7IGFycmF5IH07XG5cbmV4cG9ydCBmdW5jdGlvbiBoYXNoKHBhaXJzKSB7XG4gIHJldHVybiBcIntcIiArIHBhaXJzLmpvaW4oXCIsIFwiKSArIFwifVwiO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gcmVwZWF0KGNoYXJzLCB0aW1lcykge1xuICBsZXQgc3RyID0gXCJcIjtcbiAgd2hpbGUgKHRpbWVzLS0pIHtcbiAgICBzdHIgKz0gY2hhcnM7XG4gIH1cbiAgcmV0dXJuIHN0cjtcbn1cbiJdfQ== + enifed('glimmer-wire-format/index', ['exports'], function (exports) { 'use strict'; @@ -51817,7 +51731,7 @@ enifed('glimmer-wire-format/index', ['exports'], function (exports) { Statements.isTrustingAttr = is('trusting-attr'); })(Statements || (exports.Statements = Statements = {})); }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItd2lyZS1mb3JtYXQvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBbUJBLGFBQUEsRUFBQSxDQUE2QixPQUFlLEVBQUE7QUFDMUMsZUFBTyxVQUFTLEtBQVksRUFBQTtBQUMxQixtQkFBTyxLQUFLLENBQUMsQ0FBQyxDQUFDLEtBQUssT0FB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bmluZyBhIFNlcmlhbGl6ZWRUZW1wbGF0ZUJsb2NrXG4gKiBAdHlwZWRlZiB7c3RyaW5nfSBTZXJpYWxpemVkVGVtcGxhdGVCbG9ja0pTT05cbiAqL1xuZXhwb3J0IHR5cGUgU2VyaWFsaXplZFRlbXBsYXRlQmxvY2tKU09OID0gc3RyaW5nO1xuXG4vKipcbiAqIEEgSlNPTiBvYmplY3QgY29udGFpbmluZyB0aGUgU2VyaWFsaXplZFRlbXBsYXRlQmxvY2sgYXMgSlNPTiBhbmQgVGVtcGxhdGVNZXRhLlxuICovXG5leHBvcnQgaW50ZXJmYWNlIFNlcmlhbGl6ZWRUZW1wbGF0ZVdpdGhMYXp5QmxvY2s8VCBleHRlbmRzIFRlbXBsYXRlTWV0YT4ge1xuICBpZD86IHN0cmluZztcbiAgYmxvY2s6IFNlcmlhbGl6ZWRUZW1wbGF0ZUJsb2NrSlNPTjtcbiAgbWV0YTogVDtcbn1cblxuLyoqXG4gKiBBIHN0cmluZyBvZiBKYXZhc2NyaXB0IGNvbnRhaW5pbmcgYSBTZXJpYWxpemVkVGVtcGxhdGVXaXRoTGF6eUJsb2NrIHRvIGJlXG4gKiBjb25jYXRlbmF0ZWQgaW50byBhIEphdmFzY3JpcHQgbW9kdWxlLlxuICogQHR5cGVkZWYge3N0cmluZ30gVGVtcGxhdGVKYXZhc2NyaXB0XG4gKi9cbmV4cG9ydCB0eXBlIFRlbXBsYXRlSmF2YXNjcmlwdCA9IHN0cmluZztcbiJdfQ== + enifed('glimmer/index', ['exports', 'glimmer-compiler'], function (exports, _glimmerCompiler) { /* * @overview Glimmer @@ -51830,7 +51744,7 @@ enifed('glimmer/index', ['exports', 'glimmer-compiler'], function (exports, _gli exports.precompile = _glimmerCompiler.precompile; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztVQU9TLFVBQVUsb0JBQVYsVUFBVSIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBAb3ZlcnZpZXcgIEdsaW1tZXJcbiAqIEBjb3B5cmlnaHQgQ29weXJpZ2h0IDIwMTEtMjAxNSBUaWxkZSBJbmMuIGFuZCBjb250cmlidXRvcnNcbiAqIEBsaWNlbnNlICAgTGljZW5zZWQgdW5kZXIgTUlUIGxpY2Vuc2VcbiAqICAgICAgICAgICAgU2VlIGh0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS90aWxkZWlvL2dsaW1tZXIvbWFzdGVyL0xJQ0VOU0VcbiAqIEB2ZXJzaW9uICAgVkVSU0lPTl9TVFJJTkdfUExBQ0VIT0xERVJcbiAqL1xuZXhwb3J0IHsgcHJlY29tcGlsZSB9IGZyb20gJ2dsaW1tZXItY29tcGlsZXInO1xuIl19 + enifed('route-recognizer', ['exports'], function (exports) { 'use strict'; function Target(path, matcher, delegate) { @@ -52889,30 +52803,6 @@ TransitionState.prototype = { } }; -function TransitionAbortedError(message) { - if (!(this instanceof TransitionAbortedError)) { - return new TransitionAbortedError(message); - } - - var error = Error.call(this, message); - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, TransitionAbortedError); - } else { - this.stack = error.stack; - } - - this.description = error.description; - this.fileName = error.fileName; - this.lineNumber = error.lineNumber; - this.message = error.message || 'TransitionAborted'; - this.name = 'TransitionAborted'; - this.number = error.number; - this.code = error.code; -} - -TransitionAbortedError.prototype = oCreate(Error.prototype); - /** A Transition is a thennable (a promise-like object) that represents an attempt to transition to another route. It can be aborted, either @@ -53237,11 +53127,16 @@ Transition.prototype.send = Transition.prototype.trigger; /** @private - Logs and returns an instance of TransitionAbortedError. + Logs and returns a TransitionAborted error. */ function logAbort(transition) { log(transition.router, transition.sequence, "detected abort."); - return new TransitionAbortedError(); + return new TransitionAborted(); +} + +function TransitionAborted(message) { + this.message = (message || "TransitionAborted"); + this.name = "TransitionAborted"; } function TransitionIntent(props) { @@ -53801,26 +53696,14 @@ var NamedTransitionIntent = subclass(TransitionIntent, { } }); +/** + Promise reject reasons passed to promise rejection + handlers for failed transitions. + */ function UnrecognizedURLError(message) { - if (!(this instanceof UnrecognizedURLError)) { - return new UnrecognizedURLError(message); - } - - var error = Error.call(this, message); - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, UnrecognizedURLError); - } else { - this.stack = error.stack; - } - - this.description = error.description; - this.fileName = error.fileName; - this.lineNumber = error.lineNumber; - this.message = error.message || 'UnrecognizedURL'; - this.name = 'UnrecognizedURLError'; - this.number = error.number; - this.code = error.code; + this.message = (message || "UnrecognizedURLError"); + this.name = "UnrecognizedURLError"; + Error.call(this); } UnrecognizedURLError.prototype = oCreate(Error.prototype); @@ -54377,7 +54260,7 @@ function handlerEnteredOrUpdated(currentHandlerInfos, handlerInfo, enter, transi } if (transition && transition.isAborted) { - throw new TransitionAbortedError(); + throw new TransitionAborted(); } handler.context = context; @@ -54385,7 +54268,7 @@ function handlerEnteredOrUpdated(currentHandlerInfos, handlerInfo, enter, transi callHook(handler, 'setup', context, transition); if (transition && transition.isAborted) { - throw new TransitionAbortedError(); + throw new TransitionAborted(); } currentHandlerInfos.push(handlerInfo); @@ -54577,7 +54460,7 @@ function finalizeTransition(transition, newState) { // Resolve with the final handler. return handlerInfos[handlerInfos.length - 1].handler; } catch(e) { - if (!(e instanceof TransitionAbortedError)) { + if (!(e instanceof TransitionAborted)) { //var erroneousHandler = handlerInfos.pop(); var infos = transition.state.handlerInfos; transition.trigger(true, 'error', e, transition, infos[infos.length-1].handler); @@ -54734,2533 +54617,2506 @@ exports.Transition = Transition; Object.defineProperty(exports, '__esModule', { value: true }); }); -enifed('rsvp', ['exports'], function (exports) { - 'use strict'; - - var _rsvp; +/*! + * @overview RSVP - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/tildeio/rsvp.js/master/LICENSE + * @version 3.2.1 + */ - function indexOf(callbacks, callback) { - for (var i = 0, l = callbacks.length; i < l; i++) { - if (callbacks[i] === callback) { - return i; - } - } +enifed('rsvp', ['exports'], function (exports) { 'use strict'; - return -1; +function indexOf(callbacks, callback) { + for (var i=0, l=callbacks.length; i 1) { - throw new Error('Second argument not supported'); - } - if (typeof o !== 'object') { - throw new TypeError('Argument must be an object'); - } - F.prototype = o; - return new F(); - }; + object.trigger('stuff'); // callback1 and callback2 will be executed. - var queue = []; + object.off('stuff'); + object.trigger('stuff'); // callback1 and callback2 will not be executed! + ``` - function scheduleFlush() { - setTimeout(function () { - for (var i = 0; i < queue.length; i++) { - var entry = queue[i]; + @method off + @for RSVP.EventTarget + @private + @param {String} eventName event to stop listening to + @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) { + var allCallbacks = callbacksFor(this), callbacks, index; - var payload = entry.payload; + if (!callback) { + allCallbacks[eventName] = []; + return; + } - payload.guid = payload.key + payload.id; - payload.childGuid = payload.key + payload.childId; - if (payload.error) { - payload.stack = payload.error.stack; - } + callbacks = allCallbacks[eventName]; - config['trigger'](entry.name, entry.payload); - } - queue.length = 0; - }, 50); - } + index = indexOf(callbacks, callback); - function instrument(eventName, promise, child) { - if (1 === queue.push({ - name: eventName, - payload: { - key: promise._guidKey, - id: promise._id, - eventName: eventName, - detail: promise._result, - childId: child && child._id, - label: promise._label, - timeStamp: now(), - error: config["instrument-with-stack"] ? new Error(promise._label) : null - } })) { - scheduleFlush(); - } - } + if (index !== -1) { callbacks.splice(index, 1); } + }, /** - `RSVP.Promise.resolve` returns a promise that will become resolved with the - passed `value`. It is shorthand for the following: - + Use `trigger` to fire custom events. For example: + ```javascript - let promise = new RSVP.Promise(function(resolve, reject){ - resolve(1); - }); - - promise.then(function(value){ - // value === 1 + object.on('foo', function(){ + console.log('foo event happened!'); }); + object.trigger('foo'); + // 'foo event happened!' logged to the console ``` - - Instead of writing the above, your code now simply becomes the following: - + + You can also pass a value as a second argument to `trigger` that will be + passed as an argument to all event listeners for the event: + ```javascript - let promise = RSVP.Promise.resolve(1); - - promise.then(function(value){ - // value === 1 + object.on('foo', function(value){ + console.log(value.name); }); + + object.trigger('foo', { name: 'bar' }); + // 'bar' logged to the console ``` - - @method resolve - @static - @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` + + @method trigger + @for RSVP.EventTarget + @private + @param {String} eventName name of the event to be triggered + @param {*} options optional value to be passed to any event handlers for + the given `eventName` */ - function resolve$1(object, label) { - /*jshint validthis:true */ - var Constructor = this; + 'trigger': function(eventName, options, label) { + var allCallbacks = callbacksFor(this), callbacks, callback; - if (object && typeof object === 'object' && object.constructor === Constructor) { - return object; + if (callbacks = allCallbacks[eventName]) { + // Don't cache the callbacks.length since it may grow + for (var i=0; i 1) { + throw new Error('Second argument not supported'); } - - function handleOwnThenable(promise, thenable) { - if (thenable._state === FULFILLED) { - fulfill(promise, thenable._result); - } else if (thenable._state === REJECTED) { - thenable._onError = null; - reject(promise, thenable._result); - } else { - subscribe(thenable, undefined, function (value) { - if (thenable !== value) { - resolve(promise, value, undefined); - } else { - fulfill(promise, value); - } - }, function (reason) { - return reject(promise, reason); - }); - } + if (typeof o !== 'object') { + throw new TypeError('Argument must be an object'); } + F.prototype = o; + return new F(); +}); - function handleMaybeThenable(promise, maybeThenable, then$$) { - if (maybeThenable.constructor === promise.constructor && then$$ === then && promise.constructor.resolve === resolve$1) { - handleOwnThenable(promise, maybeThenable); - } else { - if (then$$ === GET_THEN_ERROR) { - reject(promise, GET_THEN_ERROR.error); - } else if (then$$ === undefined) { - fulfill(promise, maybeThenable); - } else if (isFunction(then$$)) { - handleForeignThenable(promise, maybeThenable, then$$); - } else { - fulfill(promise, maybeThenable); +var queue = []; + +function scheduleFlush() { + setTimeout(function() { + var entry; + for (var i = 0; i < queue.length; i++) { + entry = queue[i]; + + var payload = entry.payload; + + payload.guid = payload.key + payload.id; + payload.childGuid = payload.key + payload.childId; + if (payload.error) { + payload.stack = payload.error.stack; } + + config['trigger'](entry.name, entry.payload); } - } + queue.length = 0; + }, 50); +} - function resolve(promise, value) { - if (promise === value) { - fulfill(promise, value); - } else if (objectOrFunction(value)) { - handleMaybeThenable(promise, value, getThen(value)); - } else { - fulfill(promise, value); +function instrument(eventName, promise, child) { + if (1 === queue.push({ + name: eventName, + payload: { + key: promise._guidKey, + id: promise._id, + eventName: eventName, + detail: promise._result, + childId: child && child._id, + label: promise._label, + timeStamp: now(), + error: config["instrument-with-stack"] ? new Error(promise._label) : null + }})) { + scheduleFlush(); } } - function publishRejection(promise) { - if (promise._onError) { - promise._onError(promise._result); - } +/** + `RSVP.Promise.resolve` returns a promise that will become resolved with the + passed `value`. It is shorthand for the following: + + ```javascript + var promise = new RSVP.Promise(function(resolve, reject){ + resolve(1); + }); - publish(promise); + promise.then(function(value){ + // value === 1 + }); + ``` + + Instead of writing the above, your code now simply becomes the following: + + ```javascript + var promise = RSVP.Promise.resolve(1); + + promise.then(function(value){ + // value === 1 + }); + ``` + + @method resolve + @static + @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` +*/ +function resolve$1(object, label) { + /*jshint validthis:true */ + var Constructor = this; + + if (object && typeof object === 'object' && object.constructor === Constructor) { + return object; } - function fulfill(promise, value) { - if (promise._state !== PENDING) { - return; - } + var promise = new Constructor(noop, label); + resolve(promise, object); + return promise; +} - promise._result = value; - promise._state = FULFILLED; +function withOwnPromise() { + return new TypeError('A promises callback cannot return that same promise.'); +} + +function noop() {} + +var PENDING = void 0; +var FULFILLED = 1; +var REJECTED = 2; + +var GET_THEN_ERROR = new ErrorObject(); + +function getThen(promise) { + try { + return promise.then; + } catch(error) { + GET_THEN_ERROR.error = error; + return GET_THEN_ERROR; + } +} - if (promise._subscribers.length === 0) { - if (config.instrument) { - instrument('fulfilled', promise); +function tryThen(then, value, fulfillmentHandler, rejectionHandler) { + try { + then.call(value, fulfillmentHandler, rejectionHandler); + } catch(e) { + return e; + } +} + +function handleForeignThenable(promise, thenable, then) { + config.async(function(promise) { + var sealed = false; + var error = tryThen(then, thenable, function(value) { + if (sealed) { return; } + sealed = true; + if (thenable !== value) { + resolve(promise, value, undefined); + } else { + fulfill(promise, value); } - } else { - config.async(publish, promise); + }, function(reason) { + if (sealed) { return; } + sealed = true; + + reject(promise, reason); + }, 'Settle: ' + (promise._label || ' unknown promise')); + + if (!sealed && error) { + sealed = true; + reject(promise, error); } + }, promise); +} + +function handleOwnThenable(promise, thenable) { + if (thenable._state === FULFILLED) { + fulfill(promise, thenable._result); + } else if (thenable._state === REJECTED) { + thenable._onError = null; + reject(promise, thenable._result); + } else { + subscribe(thenable, undefined, function(value) { + if (thenable !== value) { + resolve(promise, value, undefined); + } else { + fulfill(promise, value); + } + }, function(reason) { + reject(promise, reason); + }); } +} - function reject(promise, reason) { - if (promise._state !== PENDING) { - return; +function handleMaybeThenable(promise, maybeThenable, then$$) { + if (maybeThenable.constructor === promise.constructor && + then$$ === then && + constructor.resolve === resolve$1) { + handleOwnThenable(promise, maybeThenable); + } else { + if (then$$ === GET_THEN_ERROR) { + reject(promise, GET_THEN_ERROR.error); + } else if (then$$ === undefined) { + fulfill(promise, maybeThenable); + } else if (isFunction(then$$)) { + handleForeignThenable(promise, maybeThenable, then$$); + } else { + fulfill(promise, maybeThenable); } - promise._state = REJECTED; - promise._result = reason; - config.async(publishRejection, promise); } +} - function subscribe(parent, child, onFulfillment, onRejection) { - var subscribers = parent._subscribers; - var length = subscribers.length; +function resolve(promise, value) { + if (promise === value) { + fulfill(promise, value); + } else if (objectOrFunction(value)) { + handleMaybeThenable(promise, value, getThen(value)); + } else { + fulfill(promise, value); + } +} - parent._onError = null; +function publishRejection(promise) { + if (promise._onError) { + promise._onError(promise._result); + } - subscribers[length] = child; - subscribers[length + FULFILLED] = onFulfillment; - subscribers[length + REJECTED] = onRejection; + publish(promise); +} - if (length === 0 && parent._state) { - config.async(publish, parent); - } - } +function fulfill(promise, value) { + if (promise._state !== PENDING) { return; } - function publish(promise) { - var subscribers = promise._subscribers; - var settled = promise._state; + promise._result = value; + promise._state = FULFILLED; + if (promise._subscribers.length === 0) { if (config.instrument) { - instrument(settled === FULFILLED ? 'fulfilled' : 'rejected', promise); + instrument('fulfilled', promise); } + } else { + config.async(publish, promise); + } +} - if (subscribers.length === 0) { - return; - } +function reject(promise, reason) { + if (promise._state !== PENDING) { return; } + promise._state = REJECTED; + promise._result = reason; + config.async(publishRejection, promise); +} - var child = undefined, - callback = undefined, - detail = promise._result; +function subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers; + var length = subscribers.length; - for (var i = 0; i < subscribers.length; i += 3) { - child = subscribers[i]; - callback = subscribers[i + settled]; + parent._onError = null; - if (child) { - invokeCallback(settled, child, callback, detail); - } else { - callback(detail); - } - } + subscribers[length] = child; + subscribers[length + FULFILLED] = onFulfillment; + subscribers[length + REJECTED] = onRejection; - promise._subscribers.length = 0; + if (length === 0 && parent._state) { + config.async(publish, parent); } +} - function ErrorObject() { - this.error = null; +function publish(promise) { + var subscribers = promise._subscribers; + var settled = promise._state; + + if (config.instrument) { + instrument(settled === FULFILLED ? 'fulfilled' : 'rejected', promise); } - var TRY_CATCH_ERROR = new ErrorObject(); + if (subscribers.length === 0) { return; } - function tryCatch(callback, detail) { - try { - return callback(detail); - } catch (e) { - TRY_CATCH_ERROR.error = e; - return TRY_CATCH_ERROR; + var child, callback, detail = promise._result; + + for (var i = 0; i < subscribers.length; i += 3) { + child = subscribers[i]; + callback = subscribers[i + settled]; + + if (child) { + invokeCallback(settled, child, callback, detail); + } else { + callback(detail); } } - function invokeCallback(settled, promise, callback, detail) { - var hasCallback = isFunction(callback), - value = undefined, - error = undefined, - succeeded = undefined, - failed = undefined; + promise._subscribers.length = 0; +} - if (hasCallback) { - value = tryCatch(callback, detail); +function ErrorObject() { + this.error = null; +} - if (value === TRY_CATCH_ERROR) { - failed = true; - error = value.error; - value = null; - } else { - succeeded = true; - } +var TRY_CATCH_ERROR = new ErrorObject(); - if (promise === value) { - reject(promise, withOwnPromise()); - return; - } +function tryCatch(callback, detail) { + try { + return callback(detail); + } catch(e) { + TRY_CATCH_ERROR.error = e; + return TRY_CATCH_ERROR; + } +} + +function invokeCallback(settled, promise, callback, detail) { + var hasCallback = isFunction(callback), + value, error, succeeded, failed; + + if (hasCallback) { + value = tryCatch(callback, detail); + + if (value === TRY_CATCH_ERROR) { + failed = true; + error = value.error; + value = null; } else { - value = detail; succeeded = true; } - 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 (value) { - if (resolved) { - return; - } - resolved = true; - resolve(promise, value); - }, function (reason) { - if (resolved) { - return; - } - resolved = true; - reject(promise, reason); - }); - } catch (e) { - reject(promise, e); + if (promise === value) { + reject(promise, withOwnPromise()); + return; } + + } else { + value = detail; + succeeded = true; } - function then(onFulfillment, onRejection, label) { - var _arguments = arguments; + 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); + } +} - var parent = this; - var state = parent._state; +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); + } +} - if (state === FULFILLED && !onFulfillment || state === REJECTED && !onRejection) { - config.instrument && instrument('chained', parent, parent); - return parent; - } +function then(onFulfillment, onRejection, label) { + var parent = this; + var state = parent._state; - parent._onError = null; + if (state === FULFILLED && !onFulfillment || state === REJECTED && !onRejection) { + config.instrument && instrument('chained', parent, parent); + return parent; + } - var child = new parent.constructor(noop, label); - var result = parent._result; + parent._onError = null; - config.instrument && instrument('chained', parent, child); + var child = new parent.constructor(noop, label); + var result = parent._result; - if (state) { - (function () { - var callback = _arguments[state - 1]; - config.async(function () { - return invokeCallback(state, child, callback, result); - }); - })(); - } else { - subscribe(parent, child, onFulfillment, onRejection); - } + config.instrument && instrument('chained', parent, child); - return child; + if (state) { + var callback = arguments[state - 1]; + config.async(function(){ + invokeCallback(state, child, callback, result); + }); + } else { + subscribe(parent, child, onFulfillment, onRejection); } - function makeSettledResult(state, position, value) { - if (state === FULFILLED) { - return { - state: 'fulfilled', - value: value - }; - } else { - return { - state: 'rejected', - reason: value - }; - } + return child; +} + +function makeSettledResult(state, position, value) { + if (state === FULFILLED) { + return { + state: 'fulfilled', + value: value + }; + } else { + return { + state: 'rejected', + reason: value + }; } +} - function Enumerator(Constructor, input, abortOnReject, label) { - this._instanceConstructor = Constructor; - this.promise = new Constructor(noop, label); - this._abortOnReject = abortOnReject; +function Enumerator(Constructor, input, abortOnReject, label) { + this._instanceConstructor = Constructor; + this.promise = new Constructor(noop, label); + this._abortOnReject = abortOnReject; - if (this._validateInput(input)) { - this._input = input; - this.length = input.length; - this._remaining = input.length; + if (this._validateInput(input)) { + this._input = input; + this.length = input.length; + this._remaining = input.length; - this._init(); + this._init(); - if (this.length === 0) { + if (this.length === 0) { + fulfill(this.promise, this._result); + } else { + this.length = this.length || 0; + this._enumerate(); + if (this._remaining === 0) { fulfill(this.promise, this._result); - } else { - this.length = this.length || 0; - this._enumerate(); - if (this._remaining === 0) { - fulfill(this.promise, this._result); - } } - } else { - reject(this.promise, this._validationError()); } + } else { + reject(this.promise, this._validationError()); } +} - Enumerator.prototype._validateInput = function (input) { - return isArray(input); - }; +Enumerator.prototype._validateInput = function(input) { + return isArray(input); +}; - Enumerator.prototype._validationError = function () { - return new Error('Array Methods must be provided an Array'); - }; +Enumerator.prototype._validationError = function() { + return new Error('Array Methods must be provided an Array'); +}; - Enumerator.prototype._init = function () { - this._result = new Array(this.length); - }; +Enumerator.prototype._init = function() { + this._result = new Array(this.length); +}; - Enumerator.prototype._enumerate = function () { - var length = this.length; - var promise = this.promise; - var input = this._input; +Enumerator.prototype._enumerate = function() { + var length = this.length; + var promise = this.promise; + var input = this._input; - for (var i = 0; promise._state === PENDING && i < length; i++) { - this._eachEntry(input[i], i); - } - }; + for (var i = 0; promise._state === PENDING && i < length; i++) { + this._eachEntry(input[i], i); + } +}; - Enumerator.prototype._settleMaybeThenable = function (entry, i) { - var c = this._instanceConstructor; - var resolve = c.resolve; - - if (resolve === resolve$1) { - var then$$ = getThen(entry); - - if (then$$ === then && entry._state !== PENDING) { - entry._onError = null; - this._settledAt(entry._state, i, entry._result); - } else if (typeof then$$ !== 'function') { - this._remaining--; - this._result[i] = this._makeResult(FULFILLED, i, entry); - } else if (c === Promise) { - var promise = new c(noop); - handleMaybeThenable(promise, entry, then$$); - this._willSettleAt(promise, i); - } else { - this._willSettleAt(new c(function (resolve) { - return resolve(entry); - }), i); - } - } else { - this._willSettleAt(resolve(entry), i); - } - }; +Enumerator.prototype._settleMaybeThenable = function(entry, i) { + var c = this._instanceConstructor; + var resolve = c.resolve; - Enumerator.prototype._eachEntry = function (entry, i) { - if (isMaybeThenable(entry)) { - this._settleMaybeThenable(entry, i); - } else { + if (resolve === resolve$1) { + var then$$ = getThen(entry); + + if (then$$ === then && + entry._state !== PENDING) { + entry._onError = null; + this._settledAt(entry._state, i, entry._result); + } else if (typeof then$$ !== 'function') { this._remaining--; this._result[i] = this._makeResult(FULFILLED, i, entry); + } else if (c === Promise) { + var promise = new c(noop); + handleMaybeThenable(promise, entry, then$$); + this._willSettleAt(promise, i); + } else { + this._willSettleAt(new c(function(resolve) { resolve(entry); }), i); } - }; + } else { + this._willSettleAt(resolve(entry), i); + } +}; - Enumerator.prototype._settledAt = function (state, i, value) { - var promise = this.promise; +Enumerator.prototype._eachEntry = function(entry, i) { + if (isMaybeThenable(entry)) { + this._settleMaybeThenable(entry, i); + } else { + this._remaining--; + this._result[i] = this._makeResult(FULFILLED, i, entry); + } +}; - if (promise._state === PENDING) { - this._remaining--; +Enumerator.prototype._settledAt = function(state, i, value) { + var promise = this.promise; - if (this._abortOnReject && state === REJECTED) { - reject(promise, value); - } else { - this._result[i] = this._makeResult(state, i, value); - } - } + if (promise._state === PENDING) { + this._remaining--; - if (this._remaining === 0) { - fulfill(promise, this._result); + if (this._abortOnReject && state === REJECTED) { + reject(promise, value); + } else { + this._result[i] = this._makeResult(state, i, value); } - }; + } - Enumerator.prototype._makeResult = function (state, i, value) { - return value; - }; + if (this._remaining === 0) { + fulfill(promise, this._result); + } +}; - Enumerator.prototype._willSettleAt = function (promise, i) { - var enumerator = this; +Enumerator.prototype._makeResult = function(state, i, value) { + return value; +}; - subscribe(promise, undefined, function (value) { - return enumerator._settledAt(FULFILLED, i, value); - }, function (reason) { - return enumerator._settledAt(REJECTED, i, reason); - }); - }; +Enumerator.prototype._willSettleAt = function(promise, i) { + var enumerator = this; - /** - `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 - rejected with the reason of the first passed promise to be rejected. It casts all - elements of the passed iterable to promises as it runs this algorithm. - - Example: - - ```javascript - let promise1 = RSVP.resolve(1); - let promise2 = RSVP.resolve(2); - let promise3 = RSVP.resolve(3); - let promises = [ promise1, promise2, promise3 ]; - - RSVP.Promise.all(promises).then(function(array){ - // The array here would be [ 1, 2, 3 ]; - }); - ``` - - If any of the `promises` given to `RSVP.all` are rejected, the first promise - that is rejected will be given as an argument to the returned promises's - rejection handler. For example: - - Example: - - ```javascript - let promise1 = RSVP.resolve(1); - let promise2 = RSVP.reject(new Error("2")); - let promise3 = RSVP.reject(new Error("3")); - let promises = [ promise1, promise2, promise3 ]; - - RSVP.Promise.all(promises).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(error) { - // error.message === "2" - }); - ``` - - @method all - @static - @param {Array} entries array of promises - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} promise that is fulfilled when all `promises` have been - fulfilled, or rejected if any of them become rejected. - @static - */ - function all(entries, label) { - return new Enumerator(this, entries, true, /* abort on reject */label).promise; - } + subscribe(promise, undefined, function(value) { + enumerator._settledAt(FULFILLED, i, value); + }, function(reason) { + enumerator._settledAt(REJECTED, i, reason); + }); +}; - /** - `RSVP.Promise.race` returns a new promise which is settled in the same way as the - first passed promise to settle. - - Example: - - ```javascript - let promise1 = new RSVP.Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 1'); - }, 200); - }); - - let promise2 = new RSVP.Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 2'); - }, 100); - }); - - RSVP.Promise.race([promise1, promise2]).then(function(result){ - // result === 'promise 2' because it was resolved before promise1 - // was resolved. - }); - ``` - - `RSVP.Promise.race` is deterministic in that only the state of the first - settled promise matters. For example, even if other promises given to the - `promises` array argument are resolved, but the first settled promise has - become rejected before the other promises became fulfilled, the returned - promise will become rejected: - - ```javascript - let promise1 = new RSVP.Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 1'); - }, 200); - }); - - let promise2 = new RSVP.Promise(function(resolve, reject){ - setTimeout(function(){ - reject(new Error('promise 2')); - }, 100); - }); - - RSVP.Promise.race([promise1, promise2]).then(function(result){ - // Code here never runs - }, function(reason){ - // reason.message === 'promise 2' because promise 2 became rejected before - // promise 1 became fulfilled - }); - ``` - - An example real-world use case is implementing timeouts: - - ```javascript - RSVP.Promise.race([ajax('foo.json'), timeout(5000)]) - ``` - - @method race - @static - @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. - */ - function race(entries, label) { - /*jshint validthis:true */ - var Constructor = this; +/** + `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 + rejected with the reason of the first passed promise to be rejected. It casts all + elements of the passed iterable to promises as it runs this algorithm. - var promise = new Constructor(noop, label); + Example: - if (!isArray(entries)) { - reject(promise, new TypeError('You must pass an array to race.')); - return promise; - } + ```javascript + var promise1 = RSVP.resolve(1); + var promise2 = RSVP.resolve(2); + var promise3 = RSVP.resolve(3); + var promises = [ promise1, promise2, promise3 ]; - for (var i = 0; promise._state === PENDING && i < entries.length; i++) { - subscribe(Constructor.resolve(entries[i]), undefined, function (value) { - return resolve(promise, value); - }, function (reason) { - return reject(promise, reason); - }); - } + RSVP.Promise.all(promises).then(function(array){ + // The array here would be [ 1, 2, 3 ]; + }); + ``` - return promise; - } + If any of the `promises` given to `RSVP.all` are rejected, the first promise + that is rejected will be given as an argument to the returned promises's + rejection handler. For example: - /** - `RSVP.Promise.reject` returns a promise rejected with the passed `reason`. - It is shorthand for the following: - - ```javascript - let promise = new RSVP.Promise(function(resolve, reject){ - reject(new Error('WHOOPS')); - }); - - promise.then(function(value){ - // Code here doesn't run because the promise is rejected! - }, function(reason){ - // reason.message === 'WHOOPS' - }); - ``` - - Instead of writing the above, your code now simply becomes the following: - - ```javascript - let promise = RSVP.Promise.reject(new Error('WHOOPS')); - - promise.then(function(value){ - // Code here doesn't run because the promise is rejected! - }, function(reason){ - // reason.message === 'WHOOPS' - }); - ``` - - @method reject - @static - @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$1(reason, label) { - /*jshint validthis:true */ - var Constructor = this; - var promise = new Constructor(noop, label); - reject(promise, reason); + Example: + + ```javascript + var promise1 = RSVP.resolve(1); + var promise2 = RSVP.reject(new Error("2")); + var promise3 = RSVP.reject(new Error("3")); + var promises = [ promise1, promise2, promise3 ]; + + RSVP.Promise.all(promises).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(error) { + // error.message === "2" + }); + ``` + + @method all + @static + @param {Array} entries array of promises + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} promise that is fulfilled when all `promises` have been + fulfilled, or rejected if any of them become rejected. + @static +*/ +function all(entries, label) { + return new Enumerator(this, entries, true /* abort on reject */, label).promise; +} + +/** + `RSVP.Promise.race` returns a new promise which is settled in the same way as the + first passed promise to settle. + + Example: + + ```javascript + var promise1 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 1'); + }, 200); + }); + + var promise2 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 2'); + }, 100); + }); + + RSVP.Promise.race([promise1, promise2]).then(function(result){ + // result === 'promise 2' because it was resolved before promise1 + // was resolved. + }); + ``` + + `RSVP.Promise.race` is deterministic in that only the state of the first + settled promise matters. For example, even if other promises given to the + `promises` array argument are resolved, but the first settled promise has + become rejected before the other promises became fulfilled, the returned + promise will become rejected: + + ```javascript + var promise1 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 1'); + }, 200); + }); + + var promise2 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + reject(new Error('promise 2')); + }, 100); + }); + + RSVP.Promise.race([promise1, promise2]).then(function(result){ + // Code here never runs + }, function(reason){ + // reason.message === 'promise 2' because promise 2 became rejected before + // promise 1 became fulfilled + }); + ``` + + An example real-world use case is implementing timeouts: + + ```javascript + RSVP.Promise.race([ajax('foo.json'), timeout(5000)]) + ``` + + @method race + @static + @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. +*/ +function race(entries, label) { + /*jshint validthis:true */ + var Constructor = this; + + var promise = new Constructor(noop, label); + + if (!isArray(entries)) { + reject(promise, new TypeError('You must pass an array to race.')); return promise; } - var guidKey = 'rsvp_' + now() + '-'; - var counter = 0; + var length = entries.length; - function needsResolver() { - throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); + function onFulfillment(value) { + resolve(promise, value); } - function needsNew() { - throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); + function onRejection(reason) { + reject(promise, reason); } - /** - 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 - why the promise cannot be fulfilled. - - Terminology - ----------- - - - `promise` is an object or function with a `then` method whose behavior conforms to this specification. - - `thenable` is an object or function that defines a `then` method. - - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). - - `exception` is a value that is thrown using the throw statement. - - `reason` is a value that indicates why a promise was rejected. - - `settled` the final resting state of a promise, fulfilled or rejected. - - A promise can be in one of three states: pending, fulfilled, or rejected. - - Promises that are fulfilled have a fulfillment value and are in the fulfilled - state. Promises that are rejected have a rejection reason and are in the - rejected state. A fulfillment value is never a thenable. - - Promises can also be said to *resolve* a value. If this value is also a - promise, then the original promise's settled state will match the value's - settled state. So a promise that *resolves* a promise that rejects will - itself reject, and a promise that *resolves* a promise that fulfills will - itself fulfill. - - - Basic Usage: - ------------ - - ```js - let promise = new Promise(function(resolve, reject) { - // on success - resolve(value); - - // on failure - reject(reason); - }); - - promise.then(function(value) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` - - Advanced Usage: - --------------- - - Promises shine when abstracting away asynchronous interactions such as - `XMLHttpRequest`s. - - ```js - function getJSON(url) { - return new Promise(function(resolve, reject){ - let xhr = new XMLHttpRequest(); - - xhr.open('GET', url); - xhr.onreadystatechange = handler; - xhr.responseType = 'json'; - xhr.setRequestHeader('Accept', 'application/json'); - xhr.send(); - - function handler() { - if (this.readyState === this.DONE) { - if (this.status === 200) { - resolve(this.response); - } else { - reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); - } + for (var i = 0; promise._state === PENDING && i < length; i++) { + subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection); + } + + return promise; +} + +/** + `RSVP.Promise.reject` returns a promise rejected with the passed `reason`. + It is shorthand for the following: + + ```javascript + var promise = new RSVP.Promise(function(resolve, reject){ + reject(new Error('WHOOPS')); + }); + + promise.then(function(value){ + // Code here doesn't run because the promise is rejected! + }, function(reason){ + // reason.message === 'WHOOPS' + }); + ``` + + Instead of writing the above, your code now simply becomes the following: + + ```javascript + var promise = RSVP.Promise.reject(new Error('WHOOPS')); + + promise.then(function(value){ + // Code here doesn't run because the promise is rejected! + }, function(reason){ + // reason.message === 'WHOOPS' + }); + ``` + + @method reject + @static + @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$1(reason, label) { + /*jshint validthis:true */ + var Constructor = this; + var promise = new Constructor(noop, label); + reject(promise, reason); + return promise; +} + +var guidKey = 'rsvp_' + 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."); +} + +/** + 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 + why the promise cannot be fulfilled. + + Terminology + ----------- + + - `promise` is an object or function with a `then` method whose behavior conforms to this specification. + - `thenable` is an object or function that defines a `then` method. + - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). + - `exception` is a value that is thrown using the throw statement. + - `reason` is a value that indicates why a promise was rejected. + - `settled` the final resting state of a promise, fulfilled or rejected. + + A promise can be in one of three states: pending, fulfilled, or rejected. + + Promises that are fulfilled have a fulfillment value and are in the fulfilled + state. Promises that are rejected have a rejection reason and are in the + rejected state. A fulfillment value is never a thenable. + + Promises can also be said to *resolve* a value. If this value is also a + promise, then the original promise's settled state will match the value's + settled state. So a promise that *resolves* a promise that rejects will + itself reject, and a promise that *resolves* a promise that fulfills will + itself fulfill. + + + Basic Usage: + ------------ + + ```js + var promise = new Promise(function(resolve, reject) { + // on success + resolve(value); + + // on failure + reject(reason); + }); + + promise.then(function(value) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Advanced Usage: + --------------- + + Promises shine when abstracting away asynchronous interactions such as + `XMLHttpRequest`s. + + ```js + function getJSON(url) { + return new Promise(function(resolve, reject){ + var xhr = new XMLHttpRequest(); + + xhr.open('GET', url); + xhr.onreadystatechange = handler; + xhr.responseType = 'json'; + xhr.setRequestHeader('Accept', 'application/json'); + xhr.send(); + + function handler() { + if (this.readyState === this.DONE) { + if (this.status === 200) { + resolve(this.response); + } else { + reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); } - }; - }); - } - - getJSON('/posts.json').then(function(json) { - // on fulfillment - }, function(reason) { - // on rejection + } + }; }); - ``` - - Unlike callbacks, promises are great composable primitives. - - ```js - Promise.all([ - getJSON('/posts'), - getJSON('/comments') - ]).then(function(values){ - values[0] // => postsJSON - values[1] // => commentsJSON - - return values; + } + + getJSON('/posts.json').then(function(json) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Unlike callbacks, promises are great composable primitives. + + ```js + Promise.all([ + getJSON('/posts'), + getJSON('/comments') + ]).then(function(values){ + values[0] // => postsJSON + values[1] // => commentsJSON + + return values; + }); + ``` + + @class RSVP.Promise + @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 = []; + + config.instrument && instrument('created', this); + + if (noop !== resolver) { + typeof resolver !== 'function' && needsResolver(); + this instanceof Promise ? initializePromise(this, resolver) : needsNew(); + } +} + +Promise.cast = resolve$1; // deprecated +Promise.all = all; +Promise.race = race; +Promise.resolve = resolve$1; +Promise.reject = reject$1; + +Promise.prototype = { + constructor: Promise, + + _guidKey: guidKey, + + _onError: function (reason) { + var promise = this; + config.after(function() { + if (promise._onError) { + config['trigger']('error', reason, promise._label); + } }); - ``` - - @class RSVP.Promise - @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 = []; + }, + +/** + 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 why the promise cannot be fulfilled. + + ```js + findUser().then(function(user){ + // user is available + }, function(reason){ + // user is unavailable, and you are given the reason why + }); + ``` - config.instrument && instrument('created', this); + Chaining + -------- + + The return value of `then` is itself a promise. This second, 'downstream' + promise is resolved with the return value of the first promise's fulfillment + or rejection handler, or rejected if the handler throws an exception. + + ```js + findUser().then(function (user) { + return user.name; + }, function (reason) { + return 'default name'; + }).then(function (userName) { + // If `findUser` fulfilled, `userName` will be the user's name, otherwise it + // will be `'default name'` + }); + + findUser().then(function (user) { + throw new Error('Found user, but still unhappy'); + }, function (reason) { + throw new Error('`findUser` rejected and we're unhappy'); + }).then(function (value) { + // never reached + }, function (reason) { + // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. + // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. + }); + ``` + If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. + + ```js + findUser().then(function (user) { + throw new PedagogicalException('Upstream error'); + }).then(function (value) { + // never reached + }).then(function (value) { + // never reached + }, function (reason) { + // The `PedgagocialException` is propagated all the way down to here + }); + ``` + + Assimilation + ------------ + + Sometimes the value you want to propagate to a downstream promise can only be + retrieved asynchronously. This can be achieved by returning a promise in the + fulfillment or rejection handler. The downstream promise will then be pending + until the returned promise is settled. This is called *assimilation*. + + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // The user's comments are now available + }); + ``` - if (noop !== resolver) { - typeof resolver !== 'function' && needsResolver(); - this instanceof Promise ? initializePromise(this, resolver) : needsNew(); + If the assimliated promise rejects, then the downstream promise will also reject. + + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // If `findCommentsByAuthor` fulfills, we'll have the value here + }, function (reason) { + // If `findCommentsByAuthor` rejects, we'll have the reason here + }); + ``` + + Simple Example + -------------- + + Synchronous Example + + ```javascript + var result; + + try { + result = findResult(); + // success + } catch(reason) { + // failure + } + ``` + + Errback Example + + ```js + findResult(function(result, err){ + if (err) { + // failure + } else { + // success } + }); + ``` + + Promise Example; + + ```javascript + findResult().then(function(result){ + // success + }, function(reason){ + // failure + }); + ``` + + Advanced Example + -------------- + + Synchronous Example + + ```javascript + var author, books; + + try { + author = findAuthor(); + books = findBooksByAuthor(author); + // success + } catch(reason) { + // failure } + ``` - Promise.cast = resolve$1; // deprecated - Promise.all = all; - Promise.race = race; - Promise.resolve = resolve$1; - Promise.reject = reject$1; + Errback Example - Promise.prototype = { - constructor: Promise, + ```js - _guidKey: guidKey, + function foundBooks(books) { - _onError: function (reason) { - var promise = this; - config.after(function () { - if (promise._onError) { - config['trigger']('error', reason, promise._label); - } - }); - }, + } - /** - 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 why the promise cannot be fulfilled. - - ```js - findUser().then(function(user){ - // user is available - }, function(reason){ - // user is unavailable, and you are given the reason why - }); - ``` - - Chaining - -------- - - The return value of `then` is itself a promise. This second, 'downstream' - promise is resolved with the return value of the first promise's fulfillment - or rejection handler, or rejected if the handler throws an exception. - - ```js - findUser().then(function (user) { - return user.name; - }, function (reason) { - return 'default name'; - }).then(function (userName) { - // If `findUser` fulfilled, `userName` will be the user's name, otherwise it - // will be `'default name'` - }); - - findUser().then(function (user) { - throw new Error('Found user, but still unhappy'); - }, function (reason) { - throw new Error('`findUser` rejected and we\'re unhappy'); - }).then(function (value) { - // never reached - }, function (reason) { - // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. - // If `findUser` rejected, `reason` will be '`findUser` rejected and we\'re unhappy'. - }); - ``` - If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. - - ```js - findUser().then(function (user) { - throw new PedagogicalException('Upstream error'); - }).then(function (value) { - // never reached - }).then(function (value) { - // never reached - }, function (reason) { - // The `PedgagocialException` is propagated all the way down to here - }); - ``` - - Assimilation - ------------ - - Sometimes the value you want to propagate to a downstream promise can only be - retrieved asynchronously. This can be achieved by returning a promise in the - fulfillment or rejection handler. The downstream promise will then be pending - until the returned promise is settled. This is called *assimilation*. - - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // The user's comments are now available - }); - ``` - - If the assimliated promise rejects, then the downstream promise will also reject. - - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // If `findCommentsByAuthor` fulfills, we'll have the value here - }, function (reason) { - // If `findCommentsByAuthor` rejects, we'll have the reason here - }); - ``` - - Simple Example - -------------- - - Synchronous Example - - ```javascript - let result; - - try { - result = findResult(); - // success - } catch(reason) { - // failure - } - ``` - - Errback Example - - ```js - findResult(function(result, err){ - if (err) { - // failure - } else { - // success - } - }); - ``` - - Promise Example; - - ```javascript - findResult().then(function(result){ - // success - }, function(reason){ - // failure - }); - ``` - - Advanced Example - -------------- - - Synchronous Example - - ```javascript - let author, books; - + function failure(reason) { + + } + + findAuthor(function(author, err){ + if (err) { + failure(err); + // failure + } else { try { - author = findAuthor(); - books = findBooksByAuthor(author); - // success - } catch(reason) { - // failure - } - ``` - - Errback Example - - ```js - - function foundBooks(books) { - - } - - function failure(reason) { - - } - - findAuthor(function(author, err){ - if (err) { - failure(err); - // failure - } else { - try { - findBoooksByAuthor(author, function(books, err) { - if (err) { - failure(err); - } else { - try { - foundBooks(books); - } catch(reason) { - failure(reason); - } - } - }); - } catch(error) { + findBoooksByAuthor(author, function(books, err) { + if (err) { failure(err); + } else { + try { + foundBooks(books); + } catch(reason) { + failure(reason); + } } - // success - } + }); + } catch(error) { + failure(err); + } + // success + } + }); + ``` + + Promise Example; + + ```javascript + findAuthor(). + then(findBooksByAuthor). + then(function(books){ + // found books + }).catch(function(reason){ + // something went wrong + }); + ``` + + @method then + @param {Function} onFulfillment + @param {Function} onRejection + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} +*/ + then: then, + +/** + `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same + as the catch block of a try/catch statement. + + ```js + function findAuthor(){ + throw new Error('couldn't find that author'); + } + + // synchronous + try { + findAuthor(); + } catch(reason) { + // something went wrong + } + + // async with promises + findAuthor().catch(function(reason){ + // something went wrong + }); + ``` + + @method catch + @param {Function} onRejection + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} +*/ + 'catch': function(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 + + Synchronous example: + + ```js + findAuthor() { + if (Math.random() > 0.5) { + throw new Error(); + } + return new Author(); + } + + try { + return findAuthor(); // succeed or fail + } catch(error) { + return findOtherAuther(); + } finally { + // always runs + // doesn't affect the return value + } + ``` + + Asynchronous example: + + ```js + findAuthor().catch(function(reason){ + return findOtherAuther(); + }).finally(function(){ + // author was either found, or not + }); + ``` + + @method finally + @param {Function} callback + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} +*/ + 'finally': function(callback, label) { + var promise = this; + var constructor = promise.constructor; + + return promise.then(function(value) { + return constructor.resolve(callback()).then(function() { + return value; }); - ``` - - Promise Example; - - ```javascript - findAuthor(). - then(findBooksByAuthor). - then(function(books){ - // found books - }).catch(function(reason){ - // something went wrong + }, function(reason) { + return constructor.resolve(callback()).then(function() { + return constructor.reject(reason); }); - ``` - - @method then - @param {Function} onFulfillment - @param {Function} onRejection - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - */ - then: then, + }, label); + } +}; - /** - `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same - as the catch block of a try/catch statement. - - ```js - function findAuthor(){ - throw new Error('couldn\'t find that author'); - } - - // synchronous - try { - findAuthor(); - } catch(reason) { - // something went wrong - } - - // async with promises - findAuthor().catch(function(reason){ - // something went wrong - }); - ``` - - @method catch - @param {Function} onRejection - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - */ - catch: function (onRejection, label) { - return this.then(undefined, onRejection, label); - }, +function Result() { + this.value = undefined; +} - /** - `finally` will be invoked regardless of the promise's fate just as native - try/catch/finally behaves - - Synchronous example: - - ```js - findAuthor() { - if (Math.random() > 0.5) { - throw new Error(); +var ERROR = new Result(); +var GET_THEN_ERROR$1 = new Result(); + +function getThen$1(obj) { + try { + return obj.then; + } catch(error) { + ERROR.value= error; + return ERROR; + } +} + + +function tryApply(f, s, a) { + try { + f.apply(s, a); + } catch(error) { + ERROR.value = error; + return ERROR; + } +} + +function makeObject(_, argumentNames) { + var obj = {}; + var name; + var i; + var length = _.length; + var args = new Array(length); + + for (var x = 0; x < length; x++) { + args[x] = _[x]; + } + + for (i = 0; i < argumentNames.length; i++) { + name = argumentNames[i]; + obj[name] = args[i + 1]; + } + + return obj; +} + +function arrayResult(_) { + var length = _.length; + var args = new Array(length - 1); + + for (var i = 1; i < length; i++) { + args[i - 1] = _[i]; + } + + return args; +} + +function wrapThenable(then, promise) { + return { + then: function(onFulFillment, onRejection) { + return then.call(promise, onFulFillment, onRejection); + } + }; +} + +/** + `RSVP.denodeify` takes a 'node-style' function and returns a function that + will return an `RSVP.Promise`. You can use `denodeify` in Node.js or the + browser when you'd prefer to use promises over using callbacks. For example, + `denodeify` transforms the following: + + ```javascript + var fs = require('fs'); + + fs.readFile('myfile.txt', function(err, data){ + if (err) return handleError(err); + handleData(data); + }); + ``` + + into: + + ```javascript + var fs = require('fs'); + var readFile = RSVP.denodeify(fs.readFile); + + readFile('myfile.txt').then(handleData, handleError); + ``` + + If the node function has multiple success parameters, then `denodeify` + just returns the first one: + + ```javascript + var request = RSVP.denodeify(require('request')); + + request('http://example.com').then(function(res) { + // ... + }); + ``` + + However, if you need all success parameters, setting `denodeify`'s + second parameter to `true` causes it to return all success parameters + as an array: + + ```javascript + var request = RSVP.denodeify(require('request'), true); + + request('http://example.com').then(function(result) { + // result[0] -> res + // result[1] -> body + }); + ``` + + Or if you pass it an array with names it returns the parameters as a hash: + + ```javascript + var request = RSVP.denodeify(require('request'), ['res', 'body']); + + request('http://example.com').then(function(result) { + // result.res + // result.body + }); + ``` + + Sometimes you need to retain the `this`: + + ```javascript + var app = require('express')(); + var render = RSVP.denodeify(app.render.bind(app)); + ``` + + The denodified function inherits from the original function. It works in all + environments, except IE 10 and below. Consequently all properties of the original + function are available to you. However, any properties you change on the + denodeified function won't be changed on the original function. Example: + + ```javascript + var request = RSVP.denodeify(require('request')), + cookieJar = request.jar(); // <- Inheritance is used here + + request('http://example.com', {jar: cookieJar}).then(function(res) { + // cookieJar.cookies holds now the cookies returned by example.com + }); + ``` + + Using `denodeify` makes it easier to compose asynchronous operations instead + of using callbacks. For example, instead of: + + ```javascript + var fs = require('fs'); + + fs.readFile('myfile.txt', function(err, data){ + if (err) { ... } // Handle error + fs.writeFile('myfile2.txt', data, function(err){ + if (err) { ... } // Handle error + console.log('done') + }); + }); + ``` + + you can chain the operations together using `then` from the returned promise: + + ```javascript + var fs = require('fs'); + var readFile = RSVP.denodeify(fs.readFile); + var writeFile = RSVP.denodeify(fs.writeFile); + + readFile('myfile.txt').then(function(data){ + return writeFile('myfile2.txt', data); + }).then(function(){ + console.log('done') + }).catch(function(error){ + // Handle error + }); + ``` + + @method denodeify + @static + @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} [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. + @return {Function} a function that wraps `nodeFunc` to return an + `RSVP.Promise` + @static +*/ +function denodeify(nodeFunc, options) { + var fn = function() { + var self = this; + var l = arguments.length; + var args = new Array(l + 1); + var arg; + var promiseInput = false; + + for (var i = 0; i < l; ++i) { + arg = arguments[i]; + + if (!promiseInput) { + // TODO: clean this up + promiseInput = needsPromiseInput(arg); + if (promiseInput === GET_THEN_ERROR$1) { + var p = new Promise(noop); + reject(p, GET_THEN_ERROR$1.value); + return p; + } else if (promiseInput && promiseInput !== true) { + arg = wrapThenable(promiseInput, arg); } - return new Author(); - } - - try { - return findAuthor(); // succeed or fail - } catch(error) { - return findOtherAuther(); - } finally { - // always runs - // doesn't affect the return value } - ``` - - Asynchronous example: - - ```js - findAuthor().catch(function(reason){ - return findOtherAuther(); - }).finally(function(){ - // author was either found, or not + args[i] = arg; + } + + var promise = new Promise(noop); + + args[l] = function(err, val) { + if (err) + reject(promise, err); + else if (options === undefined) + resolve(promise, val); + else if (options === true) + resolve(promise, arrayResult(arguments)); + else if (isArray(options)) + resolve(promise, makeObject(arguments, options)); + else + resolve(promise, val); + }; + + if (promiseInput) { + return handlePromiseInput(promise, args, nodeFunc, self); + } else { + return handleValueInput(promise, args, nodeFunc, self); + } + }; + + fn.__proto__ = nodeFunc; + + return fn; +} + +function handleValueInput(promise, args, nodeFunc, self) { + var result = tryApply(nodeFunc, self, args); + if (result === ERROR) { + reject(promise, result.value); + } + return promise; +} + +function handlePromiseInput(promise, args, nodeFunc, self){ + return Promise.all(args).then(function(args){ + var result = tryApply(nodeFunc, self, args); + if (result === ERROR) { + reject(promise, result.value); + } + return promise; + }); +} + +function needsPromiseInput(arg) { + if (arg && typeof arg === 'object') { + if (arg.constructor === Promise) { + return true; + } else { + return getThen$1(arg); + } + } else { + return false; + } +} + +/** + This is a convenient alias for `RSVP.Promise.all`. + + @method all + @static + @for RSVP + @param {Array} array Array of promises. + @param {String} label An optional label. This is useful + for tooling. +*/ +function all$1(array, label) { + return Promise.all(array, label); +} + +function AllSettled(Constructor, entries, label) { + this._superConstructor(Constructor, entries, false /* don't abort on reject */, label); +} + +AllSettled.prototype = o_create(Enumerator.prototype); +AllSettled.prototype._superConstructor = Enumerator; +AllSettled.prototype._makeResult = makeSettledResult; +AllSettled.prototype._validationError = function() { + return new Error('allSettled must be called with an array'); +}; + +/** + `RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing + a fail-fast method, it waits until all the promises have returned and + shows you all the results. This is useful if you want to handle multiple + promises' failure states together as a set. + + Returns a promise that is fulfilled when all the given promises have been + settled. The return promise is fulfilled with an array of the states of + the promises passed into the `promises` array argument. + + Each state object will either indicate fulfillment or rejection, and + provide the corresponding value or reason. The states will take one of + the following formats: + + ```javascript + { state: 'fulfilled', value: value } + or + { state: 'rejected', reason: reason } + ``` + + Example: + + ```javascript + var promise1 = RSVP.Promise.resolve(1); + var promise2 = RSVP.Promise.reject(new Error('2')); + var promise3 = RSVP.Promise.reject(new Error('3')); + var promises = [ promise1, promise2, promise3 ]; + + RSVP.allSettled(promises).then(function(array){ + // array == [ + // { state: 'fulfilled', value: 1 }, + // { state: 'rejected', reason: Error }, + // { state: 'rejected', reason: Error } + // ] + // Note that for the second item, reason.message will be '2', and for the + // third item, reason.message will be '3'. + }, function(error) { + // Not run. (This block would only be called if allSettled had failed, + // for instance if passed an incorrect argument type.) + }); + ``` + + @method allSettled + @static + @for RSVP + @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. +*/ + +function allSettled(entries, label) { + return new AllSettled(Promise, entries, label).promise; +} + +/** + This is a convenient alias for `RSVP.Promise.race`. + + @method race + @static + @for RSVP + @param {Array} array Array of promises. + @param {String} label An optional label. This is useful + for tooling. + */ +function race$1(array, label) { + return Promise.race(array, label); +} + +function PromiseHash(Constructor, object, label) { + this._superConstructor(Constructor, object, true, label); +} + +PromiseHash.prototype = o_create(Enumerator.prototype); +PromiseHash.prototype._superConstructor = Enumerator; +PromiseHash.prototype._init = function() { + this._result = {}; +}; + +PromiseHash.prototype._validateInput = function(input) { + return input && typeof input === 'object'; +}; + +PromiseHash.prototype._validationError = function() { + return new Error('Promise.hash must be called with an object'); +}; + +PromiseHash.prototype._enumerate = function() { + var enumerator = this; + var promise = enumerator.promise; + var input = enumerator._input; + var results = []; + + for (var key in input) { + if (promise._state === PENDING && Object.prototype.hasOwnProperty.call(input, key)) { + results.push({ + position: key, + entry: input[key] }); - ``` - - @method finally - @param {Function} callback - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - */ - finally: function (callback, label) { - var promise = this; - var constructor = promise.constructor; + } + } + + var length = results.length; + enumerator._remaining = length; + var result; + + for (var i = 0; promise._state === PENDING && i < length; i++) { + result = results[i]; + enumerator._eachEntry(result.entry, result.position); + } +}; + +/** + `RSVP.hash` is similar to `RSVP.all`, but takes an object instead of an array + for its `promises` argument. + + Returns a promise that is fulfilled when all the given promises have been + fulfilled, or rejected if any of them become rejected. The returned promise + is fulfilled with a hash that has the same key names as the `promises` object + argument. If any of the values in the object are not promises, they will + simply be copied over to the fulfilled object. + + Example: + + ```javascript + var promises = { + myPromise: RSVP.resolve(1), + yourPromise: RSVP.resolve(2), + theirPromise: RSVP.resolve(3), + notAPromise: 4 + }; + + RSVP.hash(promises).then(function(hash){ + // hash here is an object that looks like: + // { + // myPromise: 1, + // yourPromise: 2, + // theirPromise: 3, + // notAPromise: 4 + // } + }); + ```` + + If any of the `promises` given to `RSVP.hash` are rejected, the first promise + that is rejected will be given as the reason to the rejection handler. + + Example: + + ```javascript + var promises = { + myPromise: RSVP.resolve(1), + rejectedPromise: RSVP.reject(new Error('rejectedPromise')), + anotherRejectedPromise: RSVP.reject(new Error('anotherRejectedPromise')), + }; + + RSVP.hash(promises).then(function(hash){ + // Code here never runs because there are rejected promises! + }, function(reason) { + // reason.message === 'rejectedPromise' + }); + ``` + + An important note: `RSVP.hash` is intended for plain JavaScript objects that + are just a set of keys and values. `RSVP.hash` will NOT preserve prototype + chains. + + Example: + + ```javascript + function MyConstructor(){ + this.example = RSVP.resolve('Example'); + } + + MyConstructor.prototype = { + protoProperty: RSVP.resolve('Proto Property') + }; + + var myObject = new MyConstructor(); + + RSVP.hash(myObject).then(function(hash){ + // protoProperty will not be present, instead you will just have an + // object that looks like: + // { + // example: 'Example' + // } + // + // hash.hasOwnProperty('protoProperty'); // false + // 'undefined' === typeof hash.protoProperty + }); + ``` + + @method hash + @static + @for RSVP + @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. +*/ +function hash(object, label) { + return new PromiseHash(Promise, object, label).promise; +} - return promise.then(function (value) { - return constructor.resolve(callback()).then(function () { - return value; - }); - }, function (reason) { - return constructor.resolve(callback()).then(function () { - throw reason; - }); - }, label); - } +function HashSettled(Constructor, object, label) { + this._superConstructor(Constructor, object, false, label); +} + +HashSettled.prototype = o_create(PromiseHash.prototype); +HashSettled.prototype._superConstructor = Enumerator; +HashSettled.prototype._makeResult = makeSettledResult; + +HashSettled.prototype._validationError = function() { + return new Error('hashSettled must be called with an object'); +}; + +/** + `RSVP.hashSettled` is similar to `RSVP.allSettled`, but takes an object + instead of an array for its `promises` argument. + + Unlike `RSVP.all` or `RSVP.hash`, which implement a fail-fast method, + but like `RSVP.allSettled`, `hashSettled` waits until all the + constituent promises have returned and then shows you all the results + with their states and values/reasons. This is useful if you want to + handle multiple promises' failure states together as a set. + + Returns a promise that is fulfilled when all the given promises have been + settled, or rejected if the passed parameters are invalid. + + The returned promise is fulfilled with a hash that has the same key names as + the `promises` object argument. If any of the values in the object are not + promises, they will be copied over to the fulfilled object and marked with state + 'fulfilled'. + + Example: + + ```javascript + var promises = { + myPromise: RSVP.Promise.resolve(1), + yourPromise: RSVP.Promise.resolve(2), + theirPromise: RSVP.Promise.resolve(3), + notAPromise: 4 }; - function Result() { - this.value = undefined; - } + RSVP.hashSettled(promises).then(function(hash){ + // hash here is an object that looks like: + // { + // myPromise: { state: 'fulfilled', value: 1 }, + // yourPromise: { state: 'fulfilled', value: 2 }, + // theirPromise: { state: 'fulfilled', value: 3 }, + // notAPromise: { state: 'fulfilled', value: 4 } + // } + }); + ``` - var ERROR = new Result(); - var GET_THEN_ERROR$1 = new Result(); + If any of the `promises` given to `RSVP.hash` are rejected, the state will + be set to 'rejected' and the reason for rejection provided. - function getThen$1(obj) { - try { - return obj.then; - } catch (error) { - ERROR.value = error; - return ERROR; - } - } + Example: - function tryApply(f, s, a) { - try { - f.apply(s, a); - } catch (error) { - ERROR.value = error; - return ERROR; - } - } + ```javascript + var promises = { + myPromise: RSVP.Promise.resolve(1), + rejectedPromise: RSVP.Promise.reject(new Error('rejection')), + anotherRejectedPromise: RSVP.Promise.reject(new Error('more rejection')), + }; - function makeObject(_, argumentNames) { - var obj = {}; - var length = _.length; - var args = new Array(length); + RSVP.hashSettled(promises).then(function(hash){ + // hash here is an object that looks like: + // { + // myPromise: { state: 'fulfilled', value: 1 }, + // rejectedPromise: { state: 'rejected', reason: Error }, + // anotherRejectedPromise: { state: 'rejected', reason: Error }, + // } + // Note that for rejectedPromise, reason.message == 'rejection', + // and for anotherRejectedPromise, reason.message == 'more rejection'. + }); + ``` - for (var x = 0; x < length; x++) { - args[x] = _[x]; - } + An important note: `RSVP.hashSettled` is intended for plain JavaScript objects that + are just a set of keys and values. `RSVP.hashSettled` will NOT preserve prototype + chains. - for (var i = 0; i < argumentNames.length; i++) { - var _name = argumentNames[i]; - obj[_name] = args[i + 1]; - } + Example: - return obj; + ```javascript + function MyConstructor(){ + this.example = RSVP.Promise.resolve('Example'); } - function arrayResult(_) { - var length = _.length; - var args = new Array(length - 1); + MyConstructor.prototype = { + protoProperty: RSVP.Promise.resolve('Proto Property') + }; - for (var i = 1; i < length; i++) { - args[i - 1] = _[i]; - } + var myObject = new MyConstructor(); - return args; - } + RSVP.hashSettled(myObject).then(function(hash){ + // protoProperty will not be present, instead you will just have an + // object that looks like: + // { + // example: { state: 'fulfilled', value: 'Example' } + // } + // + // hash.hasOwnProperty('protoProperty'); // false + // 'undefined' === typeof hash.protoProperty + }); + ``` - function wrapThenable(then, promise) { - return { - then: function (onFulFillment, onRejection) { - return then.call(promise, onFulFillment, onRejection); - } - }; + @method hashSettled + @for RSVP + @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 +*/ +function hashSettled(object, label) { + return new HashSettled(Promise, object, label).promise; +} + +/** + `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 + caught by the promises implementation and bubbled to the last handler. For + this reason, it is recommended that you always specify a second rejection + handler function to `then`. However, `RSVP.rethrow` will throw the exception + outside of the promise, so it bubbles up to your console if in the browser, + or domain/cause uncaught exception in Node. `rethrow` will also throw the + error again so the error can be handled by the promise per the spec. + + ```javascript + function throws(){ + throw new Error('Whoops!'); } - /** - `RSVP.denodeify` takes a 'node-style' function and returns a function that - will return an `RSVP.Promise`. You can use `denodeify` in Node.js or the - browser when you'd prefer to use promises over using callbacks. For example, - `denodeify` transforms the following: - - ```javascript - let fs = require('fs'); - - fs.readFile('myfile.txt', function(err, data){ - if (err) return handleError(err); - handleData(data); - }); - ``` - - into: - - ```javascript - let fs = require('fs'); - let readFile = RSVP.denodeify(fs.readFile); - - readFile('myfile.txt').then(handleData, handleError); - ``` - - If the node function has multiple success parameters, then `denodeify` - just returns the first one: - - ```javascript - let request = RSVP.denodeify(require('request')); - - request('http://example.com').then(function(res) { - // ... - }); - ``` - - However, if you need all success parameters, setting `denodeify`'s - second parameter to `true` causes it to return all success parameters - as an array: - - ```javascript - let request = RSVP.denodeify(require('request'), true); - - request('http://example.com').then(function(result) { - // result[0] -> res - // result[1] -> body - }); - ``` - - Or if you pass it an array with names it returns the parameters as a hash: - - ```javascript - let request = RSVP.denodeify(require('request'), ['res', 'body']); - - request('http://example.com').then(function(result) { - // result.res - // result.body - }); - ``` - - Sometimes you need to retain the `this`: - - ```javascript - let app = require('express')(); - let render = RSVP.denodeify(app.render.bind(app)); - ``` - - The denodified function inherits from the original function. It works in all - environments, except IE 10 and below. Consequently all properties of the original - function are available to you. However, any properties you change on the - denodeified function won't be changed on the original function. Example: - - ```javascript - let request = RSVP.denodeify(require('request')), - cookieJar = request.jar(); // <- Inheritance is used here - - request('http://example.com', {jar: cookieJar}).then(function(res) { - // cookieJar.cookies holds now the cookies returned by example.com - }); - ``` - - Using `denodeify` makes it easier to compose asynchronous operations instead - of using callbacks. For example, instead of: - - ```javascript - let fs = require('fs'); - - fs.readFile('myfile.txt', function(err, data){ - if (err) { ... } // Handle error - fs.writeFile('myfile2.txt', data, function(err){ - if (err) { ... } // Handle error - console.log('done') - }); - }); - ``` - - you can chain the operations together using `then` from the returned promise: - - ```javascript - let fs = require('fs'); - let readFile = RSVP.denodeify(fs.readFile); - let writeFile = RSVP.denodeify(fs.writeFile); - - readFile('myfile.txt').then(function(data){ - return writeFile('myfile2.txt', data); - }).then(function(){ - console.log('done') - }).catch(function(error){ - // Handle error - }); - ``` - - @method denodeify - @static - @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} [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. - @return {Function} a function that wraps `nodeFunc` to return an - `RSVP.Promise` - @static - */ - function denodeify(nodeFunc, options) { - var fn = function () { - var self = this; - var l = arguments.length; - var args = new Array(l + 1); - var promiseInput = false; - - for (var i = 0; i < l; ++i) { - var arg = arguments[i]; - - if (!promiseInput) { - // TODO: clean this up - promiseInput = needsPromiseInput(arg); - if (promiseInput === GET_THEN_ERROR$1) { - var p = new Promise(noop); - reject(p, GET_THEN_ERROR$1.value); - return p; - } else if (promiseInput && promiseInput !== true) { - arg = wrapThenable(promiseInput, arg); - } - } - args[i] = arg; - } + var promise = new RSVP.Promise(function(resolve, reject){ + throws(); + }); - var promise = new Promise(noop); + promise.catch(RSVP.rethrow).then(function(){ + // Code here doesn't run because the promise became rejected due to an + // error! + }, function (err){ + // handle the error here + }); + ``` - args[l] = function (err, val) { - if (err) reject(promise, err);else if (options === undefined) resolve(promise, val);else if (options === true) resolve(promise, arrayResult(arguments));else if (isArray(options)) resolve(promise, makeObject(arguments, options));else resolve(promise, val); - }; + The 'Whoops' error will be thrown on the next turn of the event loop + and you can watch for it in your console. You can also handle it using a + rejection handler given to `.then` or `.catch` on the returned promise. - if (promiseInput) { - return handlePromiseInput(promise, args, nodeFunc, self); - } else { - return handleValueInput(promise, args, nodeFunc, self); - } - }; + @method rethrow + @static + @for RSVP + @param {Error} reason reason the promise became rejected. + @throws Error + @static +*/ +function rethrow(reason) { + setTimeout(function() { + throw reason; + }); + throw reason; +} - babelHelpers.defaults(fn, nodeFunc); +/** + `RSVP.defer` returns an object similar to jQuery's `$.Deferred`. + `RSVP.defer` should be used when porting over code reliant on `$.Deferred`'s + interface. New code should use the `RSVP.Promise` constructor instead. - return fn; - } + The object returned from `RSVP.defer` is a plain object with three properties: - function handleValueInput(promise, args, nodeFunc, self) { - var result = tryApply(nodeFunc, self, args); - if (result === ERROR) { - reject(promise, result.value); - } - return promise; - } + * promise - an `RSVP.Promise`. + * reject - a function that causes the `promise` property on this object to + become rejected + * resolve - a function that causes the `promise` property on this object to + become fulfilled. - function handlePromiseInput(promise, args, nodeFunc, self) { - return Promise.all(args).then(function (args) { - var result = tryApply(nodeFunc, self, args); - if (result === ERROR) { - reject(promise, result.value); - } - return promise; - }); - } + Example: - function needsPromiseInput(arg) { - if (arg && typeof arg === 'object') { - if (arg.constructor === Promise) { - return true; - } else { - return getThen$1(arg); - } - } else { - return false; - } - } + ```javascript + var deferred = RSVP.defer(); - /** - This is a convenient alias for `RSVP.Promise.all`. - - @method all - @static - @for RSVP - @param {Array} array Array of promises. - @param {String} label An optional label. This is useful - for tooling. - */ - function all$1(array, label) { - return Promise.all(array, label); - } + deferred.resolve("Success!"); - function AllSettled(Constructor, entries, label) { - this._superConstructor(Constructor, entries, false, /* don't abort on reject */label); - } + deferred.promise.then(function(value){ + // value here is "Success!" + }); + ``` - AllSettled.prototype = o_create(Enumerator.prototype); - AllSettled.prototype._superConstructor = Enumerator; - AllSettled.prototype._makeResult = makeSettledResult; - AllSettled.prototype._validationError = function () { - return new Error('allSettled must be called with an array'); - }; + @method defer + @static + @for RSVP + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Object} + */ - /** - `RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing - a fail-fast method, it waits until all the promises have returned and - shows you all the results. This is useful if you want to handle multiple - promises' failure states together as a set. - - Returns a promise that is fulfilled when all the given promises have been - settled. The return promise is fulfilled with an array of the states of - the promises passed into the `promises` array argument. - - Each state object will either indicate fulfillment or rejection, and - provide the corresponding value or reason. The states will take one of - the following formats: - - ```javascript - { state: 'fulfilled', value: value } - or - { state: 'rejected', reason: reason } - ``` - - Example: - - ```javascript - let promise1 = RSVP.Promise.resolve(1); - let promise2 = RSVP.Promise.reject(new Error('2')); - let promise3 = RSVP.Promise.reject(new Error('3')); - let promises = [ promise1, promise2, promise3 ]; - - RSVP.allSettled(promises).then(function(array){ - // array == [ - // { state: 'fulfilled', value: 1 }, - // { state: 'rejected', reason: Error }, - // { state: 'rejected', reason: Error } - // ] - // Note that for the second item, reason.message will be '2', and for the - // third item, reason.message will be '3'. - }, function(error) { - // Not run. (This block would only be called if allSettled had failed, - // for instance if passed an incorrect argument type.) - }); - ``` - - @method allSettled - @static - @for RSVP - @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. - */ +function defer(label) { + var deferred = {}; - function allSettled(entries, label) { - return new AllSettled(Promise, entries, label).promise; - } + deferred['promise'] = new Promise(function(resolve, reject) { + deferred['resolve'] = resolve; + deferred['reject'] = reject; + }, label); - /** - This is a convenient alias for `RSVP.Promise.race`. - - @method race - @static - @for RSVP - @param {Array} array Array of promises. - @param {String} label An optional label. This is useful - for tooling. - */ - function race$1(array, label) { - return Promise.race(array, label); - } + return deferred; +} - function PromiseHash(Constructor, object, label) { - this._superConstructor(Constructor, object, true, label); - } +/** + `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 + each item in given to `promises`. `RSVP.map` returns a promise that will + become fulfilled with the result of running `mapFn` on the values the promises + become fulfilled with. - PromiseHash.prototype = o_create(Enumerator.prototype); - PromiseHash.prototype._superConstructor = Enumerator; - PromiseHash.prototype._init = function () { - this._result = {}; - }; + For example: - PromiseHash.prototype._validateInput = function (input) { - return input && typeof input === 'object'; - }; + ```javascript - PromiseHash.prototype._validationError = function () { - return new Error('Promise.hash must be called with an object'); + var promise1 = RSVP.resolve(1); + var promise2 = RSVP.resolve(2); + var promise3 = RSVP.resolve(3); + var promises = [ promise1, promise2, promise3 ]; + + var mapFn = function(item){ + return item + 1; }; - PromiseHash.prototype._enumerate = function () { - var enumerator = this; - var promise = enumerator.promise; - var input = enumerator._input; - var results = []; - - for (var key in input) { - if (promise._state === PENDING && Object.prototype.hasOwnProperty.call(input, key)) { - results.push({ - position: key, - entry: input[key] - }); - } - } + RSVP.map(promises, mapFn).then(function(result){ + // result is [ 2, 3, 4 ] + }); + ``` - var length = results.length; - enumerator._remaining = length; - var result = undefined; + If any of the `promises` given to `RSVP.map` are rejected, the first promise + that is rejected will be given as an argument to the returned promise's + rejection handler. For example: - for (var i = 0; promise._state === PENDING && i < length; i++) { - result = results[i]; - enumerator._eachEntry(result.entry, result.position); - } + ```javascript + var promise1 = RSVP.resolve(1); + var promise2 = RSVP.reject(new Error('2')); + var promise3 = RSVP.reject(new Error('3')); + var promises = [ promise1, promise2, promise3 ]; + + var mapFn = function(item){ + return item + 1; }; - /** - `RSVP.hash` is similar to `RSVP.all`, but takes an object instead of an array - for its `promises` argument. - - Returns a promise that is fulfilled when all the given promises have been - fulfilled, or rejected if any of them become rejected. The returned promise - is fulfilled with a hash that has the same key names as the `promises` object - argument. If any of the values in the object are not promises, they will - simply be copied over to the fulfilled object. - - Example: - - ```javascript - let promises = { - myPromise: RSVP.resolve(1), - yourPromise: RSVP.resolve(2), - theirPromise: RSVP.resolve(3), - notAPromise: 4 - }; - - RSVP.hash(promises).then(function(hash){ - // hash here is an object that looks like: - // { - // myPromise: 1, - // yourPromise: 2, - // theirPromise: 3, - // notAPromise: 4 - // } - }); - ```` - - If any of the `promises` given to `RSVP.hash` are rejected, the first promise - that is rejected will be given as the reason to the rejection handler. - - Example: - - ```javascript - let promises = { - myPromise: RSVP.resolve(1), - rejectedPromise: RSVP.reject(new Error('rejectedPromise')), - anotherRejectedPromise: RSVP.reject(new Error('anotherRejectedPromise')), - }; - - RSVP.hash(promises).then(function(hash){ - // Code here never runs because there are rejected promises! - }, function(reason) { - // reason.message === 'rejectedPromise' - }); - ``` - - An important note: `RSVP.hash` is intended for plain JavaScript objects that - are just a set of keys and values. `RSVP.hash` will NOT preserve prototype - chains. - - Example: - - ```javascript - function MyConstructor(){ - this.example = RSVP.resolve('Example'); - } - - MyConstructor.prototype = { - protoProperty: RSVP.resolve('Proto Property') - }; - - let myObject = new MyConstructor(); - - RSVP.hash(myObject).then(function(hash){ - // protoProperty will not be present, instead you will just have an - // object that looks like: - // { - // example: 'Example' - // } - // - // hash.hasOwnProperty('protoProperty'); // false - // 'undefined' === typeof hash.protoProperty - }); - ``` - - @method hash - @static - @for RSVP - @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. - */ - function hash(object, label) { - return new PromiseHash(Promise, object, label).promise; - } + RSVP.map(promises, mapFn).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(reason) { + // reason.message === '2' + }); + ``` - function HashSettled(Constructor, object, label) { - this._superConstructor(Constructor, object, false, label); - } + `RSVP.map` will also wait if a promise is returned from `mapFn`. For example, + say you want to get all comments from a set of blog posts, but you need + the blog posts first because they contain a url to those comments. - HashSettled.prototype = o_create(PromiseHash.prototype); - HashSettled.prototype._superConstructor = Enumerator; - HashSettled.prototype._makeResult = makeSettledResult; + ```javscript - HashSettled.prototype._validationError = function () { - return new Error('hashSettled must be called with an object'); + var mapFn = function(blogPost){ + // getComments does some ajax and returns an RSVP.Promise that is fulfilled + // with some comments data + return getComments(blogPost.comments_url); }; - /** - `RSVP.hashSettled` is similar to `RSVP.allSettled`, but takes an object - instead of an array for its `promises` argument. - - Unlike `RSVP.all` or `RSVP.hash`, which implement a fail-fast method, - but like `RSVP.allSettled`, `hashSettled` waits until all the - constituent promises have returned and then shows you all the results - with their states and values/reasons. This is useful if you want to - handle multiple promises' failure states together as a set. - - Returns a promise that is fulfilled when all the given promises have been - settled, or rejected if the passed parameters are invalid. - - The returned promise is fulfilled with a hash that has the same key names as - the `promises` object argument. If any of the values in the object are not - promises, they will be copied over to the fulfilled object and marked with state - 'fulfilled'. - - Example: - - ```javascript - let promises = { - myPromise: RSVP.Promise.resolve(1), - yourPromise: RSVP.Promise.resolve(2), - theirPromise: RSVP.Promise.resolve(3), - notAPromise: 4 - }; - - RSVP.hashSettled(promises).then(function(hash){ - // hash here is an object that looks like: - // { - // myPromise: { state: 'fulfilled', value: 1 }, - // yourPromise: { state: 'fulfilled', value: 2 }, - // theirPromise: { state: 'fulfilled', value: 3 }, - // notAPromise: { state: 'fulfilled', value: 4 } - // } - }); - ``` - - If any of the `promises` given to `RSVP.hash` are rejected, the state will - be set to 'rejected' and the reason for rejection provided. - - Example: - - ```javascript - let promises = { - myPromise: RSVP.Promise.resolve(1), - rejectedPromise: RSVP.Promise.reject(new Error('rejection')), - anotherRejectedPromise: RSVP.Promise.reject(new Error('more rejection')), - }; - - RSVP.hashSettled(promises).then(function(hash){ - // hash here is an object that looks like: - // { - // myPromise: { state: 'fulfilled', value: 1 }, - // rejectedPromise: { state: 'rejected', reason: Error }, - // anotherRejectedPromise: { state: 'rejected', reason: Error }, - // } - // Note that for rejectedPromise, reason.message == 'rejection', - // and for anotherRejectedPromise, reason.message == 'more rejection'. - }); - ``` - - An important note: `RSVP.hashSettled` is intended for plain JavaScript objects that - are just a set of keys and values. `RSVP.hashSettled` will NOT preserve prototype - chains. - - Example: - - ```javascript - function MyConstructor(){ - this.example = RSVP.Promise.resolve('Example'); + // getBlogPosts does some ajax and returns an RSVP.Promise that is fulfilled + // with some blog post data + RSVP.map(getBlogPosts(), mapFn).then(function(comments){ + // comments is the result of asking the server for the comments + // of all blog posts returned from getBlogPosts() + }); + ``` + + @method map + @static + @for RSVP + @param {Array} promises + @param {Function} mapFn function to be called on each fulfilled promise. + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} promise that is fulfilled with the result of calling + `mapFn` on each fulfilled promise or value when they become fulfilled. + The promise will be rejected if any of the given `promises` become rejected. + @static +*/ +function map(promises, mapFn, label) { + return Promise.all(promises, label).then(function(values) { + if (!isFunction(mapFn)) { + throw new TypeError("You must pass a function as map's second argument."); } - - MyConstructor.prototype = { - protoProperty: RSVP.Promise.resolve('Proto Property') - }; - - let myObject = new MyConstructor(); - - RSVP.hashSettled(myObject).then(function(hash){ - // protoProperty will not be present, instead you will just have an - // object that looks like: - // { - // example: { state: 'fulfilled', value: 'Example' } - // } - // - // hash.hasOwnProperty('protoProperty'); // false - // 'undefined' === typeof hash.protoProperty - }); - ``` - - @method hashSettled - @for RSVP - @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 - */ - function hashSettled(object, label) { - return new HashSettled(Promise, object, label).promise; - } - /** - `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 - caught by the promises implementation and bubbled to the last handler. For - this reason, it is recommended that you always specify a second rejection - handler function to `then`. However, `RSVP.rethrow` will throw the exception - outside of the promise, so it bubbles up to your console if in the browser, - or domain/cause uncaught exception in Node. `rethrow` will also throw the - error again so the error can be handled by the promise per the spec. - - ```javascript - function throws(){ - throw new Error('Whoops!'); + var length = values.length; + var results = new Array(length); + + for (var i = 0; i < length; i++) { + results[i] = mapFn(values[i]); } - - let promise = new RSVP.Promise(function(resolve, reject){ - throws(); - }); - - promise.catch(RSVP.rethrow).then(function(){ - // Code here doesn't run because the promise became rejected due to an - // error! - }, function (err){ - // handle the error here - }); - ``` - - The 'Whoops' error will be thrown on the next turn of the event loop - and you can watch for it in your console. You can also handle it using a - rejection handler given to `.then` or `.catch` on the returned promise. - - @method rethrow - @static - @for RSVP - @param {Error} reason reason the promise became rejected. - @throws Error - @static - */ - function rethrow(reason) { - setTimeout(function () { - throw reason; - }); - throw reason; - } - /** - `RSVP.defer` returns an object similar to jQuery's `$.Deferred`. - `RSVP.defer` should be used when porting over code reliant on `$.Deferred`'s - interface. New code should use the `RSVP.Promise` constructor instead. - - The object returned from `RSVP.defer` is a plain object with three properties: - - * promise - an `RSVP.Promise`. - * reject - a function that causes the `promise` property on this object to - become rejected - * resolve - a function that causes the `promise` property on this object to - become fulfilled. - - Example: - - ```javascript - let deferred = RSVP.defer(); - - deferred.resolve("Success!"); - - deferred.promise.then(function(value){ - // value here is "Success!" - }); - ``` - - @method defer - @static - @for RSVP - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Object} - */ + return Promise.all(results, label); + }); +} - function defer(label) { - var deferred = { resolve: undefined, reject: undefined }; +/** + This is a convenient alias for `RSVP.Promise.resolve`. - deferred.promise = new Promise(function (resolve, reject) { - deferred.resolve = resolve; - deferred.reject = reject; - }, label); + @method resolve + @static + @for RSVP + @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` +*/ +function resolve$2(value, label) { + return Promise.resolve(value, label); +} - return deferred; - } +/** + This is a convenient alias for `RSVP.Promise.reject`. - /** - `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 - each item in given to `promises`. `RSVP.map` returns a promise that will - become fulfilled with the result of running `mapFn` on the values the promises - become fulfilled with. - - For example: - - ```javascript - - let promise1 = RSVP.resolve(1); - let promise2 = RSVP.resolve(2); - let promise3 = RSVP.resolve(3); - let promises = [ promise1, promise2, promise3 ]; - - let mapFn = function(item){ - return item + 1; - }; - - RSVP.map(promises, mapFn).then(function(result){ - // result is [ 2, 3, 4 ] - }); - ``` - - If any of the `promises` given to `RSVP.map` are rejected, the first promise - that is rejected will be given as an argument to the returned promise's - rejection handler. For example: - - ```javascript - let promise1 = RSVP.resolve(1); - let promise2 = RSVP.reject(new Error('2')); - let promise3 = RSVP.reject(new Error('3')); - let promises = [ promise1, promise2, promise3 ]; - - let mapFn = function(item){ - return item + 1; - }; - - RSVP.map(promises, mapFn).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(reason) { - // reason.message === '2' - }); - ``` - - `RSVP.map` will also wait if a promise is returned from `mapFn`. For example, - say you want to get all comments from a set of blog posts, but you need - the blog posts first because they contain a url to those comments. - - ```javscript - - let mapFn = function(blogPost){ - // getComments does some ajax and returns an RSVP.Promise that is fulfilled - // with some comments data - return getComments(blogPost.comments_url); - }; - - // getBlogPosts does some ajax and returns an RSVP.Promise that is fulfilled - // with some blog post data - RSVP.map(getBlogPosts(), mapFn).then(function(comments){ - // comments is the result of asking the server for the comments - // of all blog posts returned from getBlogPosts() - }); - ``` - - @method map - @static - @for RSVP - @param {Array} promises - @param {Function} mapFn function to be called on each fulfilled promise. - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} promise that is fulfilled with the result of calling - `mapFn` on each fulfilled promise or value when they become fulfilled. - The promise will be rejected if any of the given `promises` become rejected. - @static - */ - function map(promises, mapFn, label) { - return Promise.all(promises, label).then(function (values) { - if (!isFunction(mapFn)) { - throw new TypeError("You must pass a function as map's second argument."); - } + @method reject + @static + @for RSVP + @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$2(reason, label) { + return Promise.reject(reason, label); +} - var length = values.length; - var results = new Array(length); +/** + `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 + each item in given to `promises`. `RSVP.filter` returns a promise that will + become fulfilled with the result of running `filterFn` on the values the + promises become fulfilled with. - for (var i = 0; i < length; i++) { - results[i] = mapFn(values[i]); - } + For example: - return Promise.all(results, label); - }); - } + ```javascript - /** - This is a convenient alias for `RSVP.Promise.resolve`. - - @method resolve - @static - @for RSVP - @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` - */ - function resolve$2(value, label) { - return Promise.resolve(value, label); - } + var promise1 = RSVP.resolve(1); + var promise2 = RSVP.resolve(2); + var promise3 = RSVP.resolve(3); - /** - This is a convenient alias for `RSVP.Promise.reject`. - - @method reject - @static - @for RSVP - @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$2(reason, label) { - return Promise.reject(reason, label); - } + var promises = [promise1, promise2, promise3]; - /** - `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 - each item in given to `promises`. `RSVP.filter` returns a promise that will - become fulfilled with the result of running `filterFn` on the values the - promises become fulfilled with. - - For example: - - ```javascript - - let promise1 = RSVP.resolve(1); - let promise2 = RSVP.resolve(2); - let promise3 = RSVP.resolve(3); - - let promises = [promise1, promise2, promise3]; - - let filterFn = function(item){ - return item > 1; - }; - - RSVP.filter(promises, filterFn).then(function(result){ - // result is [ 2, 3 ] - }); - ``` - - If any of the `promises` given to `RSVP.filter` are rejected, the first promise - that is rejected will be given as an argument to the returned promise's - rejection handler. For example: - - ```javascript - let promise1 = RSVP.resolve(1); - let promise2 = RSVP.reject(new Error('2')); - let promise3 = RSVP.reject(new Error('3')); - let promises = [ promise1, promise2, promise3 ]; - - let filterFn = function(item){ - return item > 1; - }; - - RSVP.filter(promises, filterFn).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(reason) { - // reason.message === '2' - }); - ``` - - `RSVP.filter` will also wait for any promises returned from `filterFn`. - For instance, you may want to fetch a list of users then return a subset - of those users based on some asynchronous operation: - - ```javascript - - let alice = { name: 'alice' }; - let bob = { name: 'bob' }; - let users = [ alice, bob ]; - - let promises = users.map(function(user){ - return RSVP.resolve(user); - }); - - let filterFn = function(user){ - // Here, Alice has permissions to create a blog post, but Bob does not. - return getPrivilegesForUser(user).then(function(privs){ - return privs.can_create_blog_post === true; - }); - }; - RSVP.filter(promises, filterFn).then(function(users){ - // true, because the server told us only Alice can create a blog post. - users.length === 1; - // false, because Alice is the only user present in `users` - users[0] === bob; - }); - ``` - - @method filter - @static - @for RSVP - @param {Array} promises - @param {Function} filterFn - function to be called on each resolved value to - filter the final results. - @param {String} label optional string describing the promise. Useful for - tooling. - @return {Promise} - */ + var filterFn = function(item){ + return item > 1; + }; - function resolveAll(promises, label) { - return Promise.all(promises, label); - } + RSVP.filter(promises, filterFn).then(function(result){ + // result is [ 2, 3 ] + }); + ``` - function resolveSingle(promise, label) { - return Promise.resolve(promise, label).then(function (promises) { - return resolveAll(promises, label); - }); - } + If any of the `promises` given to `RSVP.filter` are rejected, the first promise + that is rejected will be given as an argument to the returned promise's + rejection handler. For example: - function filter(promises, filterFn, label) { - var promise = isArray(promises) ? resolveAll(promises, label) : resolveSingle(promises, label); - return promise.then(function (values) { - if (!isFunction(filterFn)) { - throw new TypeError("You must pass a function as filter's second argument."); - } + ```javascript + var promise1 = RSVP.resolve(1); + var promise2 = RSVP.reject(new Error('2')); + var promise3 = RSVP.reject(new Error('3')); + var promises = [ promise1, promise2, promise3 ]; - var length = values.length; - var filtered = new Array(length); + var filterFn = function(item){ + return item > 1; + }; - for (var i = 0; i < length; i++) { - filtered[i] = filterFn(values[i]); - } + RSVP.filter(promises, filterFn).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(reason) { + // reason.message === '2' + }); + ``` - return resolveAll(filtered, label).then(function (filtered) { - var results = new Array(length); - var newLength = 0; + `RSVP.filter` will also wait for any promises returned from `filterFn`. + For instance, you may want to fetch a list of users then return a subset + of those users based on some asynchronous operation: - for (var i = 0; i < length; i++) { - if (filtered[i]) { - results[newLength] = values[i]; - newLength++; - } - } + ```javascript - results.length = newLength; + var alice = { name: 'alice' }; + var bob = { name: 'bob' }; + var users = [ alice, bob ]; - return results; - }); + var promises = users.map(function(user){ + return RSVP.resolve(user); + }); + + var filterFn = function(user){ + // Here, Alice has permissions to create a blog post, but Bob does not. + return getPrivilegesForUser(user).then(function(privs){ + return privs.can_create_blog_post === true; }); - } + }; + RSVP.filter(promises, filterFn).then(function(users){ + // true, because the server told us only Alice can create a blog post. + users.length === 1; + // false, because Alice is the only user present in `users` + users[0] === bob; + }); + ``` - var len = 0; - var vertxNext = undefined; - function asap(callback, arg) { - queue$1[len] = callback; - queue$1[len + 1] = arg; - len += 2; - if (len === 2) { - // If len is 1, that means that we need to schedule an async flush. - // If additional callbacks are queued before the queue is flushed, they - // will be processed by this flush that we are scheduling. - scheduleFlush$1(); - } - } - - var browserWindow = typeof window !== 'undefined' ? window : undefined; - var browserGlobal = browserWindow || {}; - var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; - var isNode = typeof self === '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; + @method filter + @static + @for RSVP + @param {Array} promises + @param {Function} filterFn - function to be called on each resolved value to + filter the final results. + @param {String} label optional string describing the promise. Useful for + tooling. + @return {Promise} +*/ +function filter(promises, filterFn, label) { + return Promise.all(promises, label).then(function(values) { + if (!isFunction(filterFn)) { + throw new TypeError("You must pass a function as filter's second argument."); } - return function () { - return nextTick(flush); - }; - } - // vertx - function useVertxTimer() { - if (typeof vertxNext !== 'undefined') { - return function () { - vertxNext(flush); - }; + var length = values.length; + var filtered = new Array(length); + + for (var i = 0; i < length; i++) { + filtered[i] = filterFn(values[i]); } - return useSetTimeout(); - } - function useMutationObserver() { - var iterations = 0; - var observer = new BrowserMutationObserver(flush); - var node = document.createTextNode(''); - observer.observe(node, { characterData: true }); + return Promise.all(filtered, label).then(function(filtered) { + var results = new Array(length); + var newLength = 0; - return function () { - return node.data = iterations = ++iterations % 2; - }; - } + for (var i = 0; i < length; i++) { + if (filtered[i]) { + results[newLength] = values[i]; + newLength++; + } + } - // web worker - function useMessageChannel() { - var channel = new MessageChannel(); - channel.port1.onmessage = flush; - return function () { - return channel.port2.postMessage(0); - }; - } + results.length = newLength; - function useSetTimeout() { - return function () { - return setTimeout(flush, 1); - }; + return results; + }); + }); +} + +var len = 0; +var vertxNext; +function asap(callback, arg) { + queue$1[len] = callback; + queue$1[len + 1] = arg; + len += 2; + if (len === 2) { + // If len is 1, that means that we need to schedule an async flush. + // If additional callbacks are queued before the queue is flushed, they + // will be processed by this flush that we are scheduling. + scheduleFlush$1(); } +} - var queue$1 = new Array(1000); +var browserWindow = (typeof window !== 'undefined') ? window : undefined; +var browserGlobal = browserWindow || {}; +var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; +var isNode = typeof self === '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() { + nextTick(flush); + }; +} - function flush() { - for (var i = 0; i < len; i += 2) { - var callback = queue$1[i]; - var arg = queue$1[i + 1]; +// vertx +function useVertxTimer() { + return function() { + vertxNext(flush); + }; +} - callback(arg); +function useMutationObserver() { + var iterations = 0; + var observer = new BrowserMutationObserver(flush); + var node = document.createTextNode(''); + observer.observe(node, { characterData: true }); - queue$1[i] = undefined; - queue$1[i + 1] = undefined; - } + return function() { + node.data = (iterations = ++iterations % 2); + }; +} - len = 0; - } +// web worker +function useMessageChannel() { + var channel = new MessageChannel(); + channel.port1.onmessage = flush; + return function () { + channel.port2.postMessage(0); + }; +} - function attemptVertex() { - try { - var r = require; - var vertx = r('vertx'); - vertxNext = vertx.runOnLoop || vertx.runOnContext; - return useVertxTimer(); - } catch (e) { - return useSetTimeout(); - } +function useSetTimeout() { + return function() { + setTimeout(flush, 1); + }; +} + +var queue$1 = new Array(1000); +function flush() { + for (var i = 0; i < len; i+=2) { + var callback = queue$1[i]; + var arg = queue$1[i+1]; + + callback(arg); + + queue$1[i] = undefined; + queue$1[i+1] = undefined; } - var scheduleFlush$1 = undefined; - // Decide what async method to use to triggering processing of queued callbacks: - if (isNode) { - scheduleFlush$1 = useNextTick(); - } else if (BrowserMutationObserver) { - scheduleFlush$1 = useMutationObserver(); - } else if (isWorker) { - scheduleFlush$1 = useMessageChannel(); - } else if (browserWindow === undefined && typeof require === 'function') { - scheduleFlush$1 = attemptVertex(); - } else { - scheduleFlush$1 = useSetTimeout(); + len = 0; +} + +function attemptVertex() { + try { + var r = require; + var vertx = r('vertx'); + vertxNext = vertx.runOnLoop || vertx.runOnContext; + return useVertxTimer(); + } catch(e) { + return useSetTimeout(); } +} + +var scheduleFlush$1; +// Decide what async method to use to triggering processing of queued callbacks: +if (isNode) { + scheduleFlush$1 = useNextTick(); +} else if (BrowserMutationObserver) { + scheduleFlush$1 = useMutationObserver(); +} else if (isWorker) { + scheduleFlush$1 = useMessageChannel(); +} else if (browserWindow === undefined && typeof require === 'function') { + scheduleFlush$1 = attemptVertex(); +} else { + scheduleFlush$1 = useSetTimeout(); +} + +// defaults +config.async = asap; +config.after = function(cb) { + setTimeout(cb, 0); +}; +var cast = resolve$2; +function async(callback, arg) { + config.async(callback, arg); +} - var platform = undefined; +function on() { + config['on'].apply(config, arguments); +} - /* global self */ - if (typeof self === 'object') { - platform = self; +function off() { + config['off'].apply(config, arguments); +} - /* global global */ - } else if (typeof global === 'object') { - platform = global; - } else { - throw new Error('no global: `self` or `global` found'); +// Set up instrumentation through `window.__PROMISE_INTRUMENTATION__` +if (typeof window !== 'undefined' && typeof window['__PROMISE_INSTRUMENTATION__'] === 'object') { + var callbacks = window['__PROMISE_INSTRUMENTATION__']; + configure('instrument', true); + for (var eventName in callbacks) { + if (callbacks.hasOwnProperty(eventName)) { + on(eventName, callbacks[eventName]); } + } +} - // defaults - config.async = asap; - config.after = function (cb) { - return setTimeout(cb, 0); - }; - var cast = resolve$2; +exports.cast = cast; +exports.Promise = Promise; +exports.EventTarget = EventTarget; +exports.all = all$1; +exports.allSettled = allSettled; +exports.race = race$1; +exports.hash = hash; +exports.hashSettled = hashSettled; +exports.rethrow = rethrow; +exports.defer = defer; +exports.denodeify = denodeify; +exports.configure = configure; +exports.on = on; +exports.off = off; +exports.resolve = resolve$2; +exports.reject = reject$2; +exports.async = async; +exports.map = map; +exports.filter = filter; - var async = function (callback, arg) { - return config.async(callback, arg); - }; +Object.defineProperty(exports, '__esModule', { value: true }); - function on() { - config['on'].apply(config, arguments); - } - - function off() { - config['off'].apply(config, arguments); - } - - // Set up instrumentation through `window.__PROMISE_INTRUMENTATION__` - if (typeof window !== 'undefined' && typeof window['__PROMISE_INSTRUMENTATION__'] === 'object') { - var callbacks = window['__PROMISE_INSTRUMENTATION__']; - configure('instrument', true); - for (var eventName in callbacks) { - if (callbacks.hasOwnProperty(eventName)) { - on(eventName, callbacks[eventName]); - } - } - } - - // the default export here is for backwards compat: - // https://github.com/tildeio/rsvp.js/issues/434 - var rsvp = (_rsvp = { - cast: cast, - Promise: Promise, - EventTarget: EventTarget, - all: all$1, - allSettled: allSettled, - race: race$1, - hash: hash, - hashSettled: hashSettled, - rethrow: rethrow, - defer: defer, - denodeify: denodeify, - configure: configure, - on: on, - off: off, - resolve: resolve$2, - reject: reject$2, - map: map - }, _rsvp['async'] = async, _rsvp.filter = // babel seems to error if async isn't a computed prop here... - filter, _rsvp); - - exports.cast = cast; - exports.Promise = Promise; - exports.EventTarget = EventTarget; - exports.all = all$1; - exports.allSettled = allSettled; - exports.race = race$1; - exports.hash = hash; - exports.hashSettled = hashSettled; - exports.rethrow = rethrow; - exports.defer = defer; - exports.denodeify = denodeify; - exports.configure = configure; - exports.on = on; - exports.off = off; - exports.resolve = resolve$2; - exports.reject = reject$2; - exports.map = map; - exports.async = async; - exports.filter = filter; - exports.default = rsvp; }); requireModule("ember"); diff --git a/package.json b/package.json index 87b761863..7a50950f9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "components-ember", - "version": "2.11.0-beta.2", + "version": "2.10.2-with-backtracking", "description": "Ember Application Framework", "license": "MIT", "homepage": "https://github.com/emberjs/ember.js", From 6e7c22f1c13b41dd00b2da4e2aab69b55d6b5421 Mon Sep 17 00:00:00 2001 From: Gavin Joyce Date: Wed, 25 Jan 2017 21:20:32 +0000 Subject: [PATCH 2/3] 2.12.0-canary-with-backtracking --- bower.json | 2 +- component.json | 2 +- composer.json | 2 +- ember-runtime.js | 7536 +-- ember-template-compiler.js | 38439 ++++++-------- ember-testing.js | 35 +- ember-tests.js | 14546 +++--- ember-tests.prod.js | 14482 +++--- ember.debug.js | 95949 ++++++++++++++++------------------- ember.js | 95949 ++++++++++++++++------------------- ember.min.js | 3896 +- ember.prod.js | 89994 +++++++++++++++----------------- package.json | 2 +- 13 files changed, 159708 insertions(+), 201126 deletions(-) diff --git a/bower.json b/bower.json index ccac6302d..26ac09930 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "ember", - "version": "2.10.2-with-backtracking", + "version": "2.12.0-canary-with-backtracking", "license": "MIT", "homepage": "https://github.com/emberjs/ember.js", "main": [ diff --git a/component.json b/component.json index 1040acef9..dd27aa932 100644 --- a/component.json +++ b/component.json @@ -1,7 +1,7 @@ { "name": "ember", "repo": "components/ember", - "version": "2.10.2-with-backtracking", + "version": "2.12.0-canary-with-backtracking", "license": "MIT", "homepage": "https://github.com/emberjs/ember.js", "main": "ember.debug.js", diff --git a/composer.json b/composer.json index 65c2e703f..e5869769a 100644 --- a/composer.json +++ b/composer.json @@ -25,5 +25,5 @@ } } }, - "version": "2.10.2-with-backtracking" + "version": "2.12.0-canary-with-backtracking" } diff --git a/ember-runtime.js b/ember-runtime.js index 736bff9ce..1404078a6 100644 --- a/ember-runtime.js +++ b/ember-runtime.js @@ -1,16 +1,16 @@ ;(function() { /*! * @overview Ember - JavaScript Application Framework - * @copyright Copyright 2011-2016 Tilde Inc. and contributors + * @copyright Copyright 2011-2017 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.10.2-with-backtracking + * @version 2.12.0-canary-with-backtracking */ var enifed, requireModule, Ember; -var mainContext = this; +var mainContext = this; // Used in ember-environment/lib/global.js (function() { var isNode = typeof window === 'undefined' && @@ -112,8 +112,6 @@ var mainContext = this; } })(); -var babelHelpers; - function inherits(subClass, superClass) { subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { @@ -1190,13 +1188,20 @@ Object.defineProperty(exports, '__esModule', { value: true }); }); enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'ember-metal'], function (exports, _emberUtils, _emberEnvironment, _emberMetal) { + /* globals Proxy */ 'use strict'; + var _Container$prototype; + exports.default = Container; exports.buildFakeContainerWithDeprecations = buildFakeContainerWithDeprecations; var CONTAINER_OVERRIDE = _emberUtils.symbol('CONTAINER_OVERRIDE'); + var FACTORY_FOR = _emberUtils.symbol('FACTORY_FOR'); + exports.FACTORY_FOR = FACTORY_FOR; + var LOOKUP_FACTORY = _emberUtils.symbol('LOOKUP_FACTORY'); + exports.LOOKUP_FACTORY = LOOKUP_FACTORY; /** A container used to instantiate and cache objects. @@ -1222,7 +1227,7 @@ enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'e this.isDestroyed = false; } - Container.prototype = { + Container.prototype = (_Container$prototype = { /** @private @property owner @@ -1307,57 +1312,150 @@ enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'e */ lookupFactory: function (fullName, options) { _emberMetal.assert('fullName must be a proper full name', this.registry.validateFullName(fullName)); - return factoryFor(this, this.registry.normalize(fullName), options); - }, + _emberMetal.deprecate('Using "_lookupFactory" is deprecated. Please use container.factoryFor instead.', !_emberMetal.isFeatureEnabled('ember-factory-for'), { id: 'container-lookupFactory', until: '2.13.0', url: 'TODO' }); + + return deprecatedFactoryFor(this, this.registry.normalize(fullName), options); + } + + }, _Container$prototype[LOOKUP_FACTORY] = function (fullName, options) { + _emberMetal.assert('fullName must be a proper full name', this.registry.validateFullName(fullName)); + return deprecatedFactoryFor(this, this.registry.normalize(fullName), options); + }, _Container$prototype[FACTORY_FOR] = function (fullName) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + if (_emberMetal.isFeatureEnabled('ember-no-double-extend')) { + if (_emberMetal.isFeatureEnabled('ember-factory-for')) { + return this.factoryFor(fullName, options); + } else { + /* This throws in case of a poorly designed build */ + throw new Error('If ember-no-double-extend is enabled, ember-factory-for must also be enabled'); + } + } + var factory = this[LOOKUP_FACTORY](fullName, options); + if (factory === undefined) { + return; + } + var manager = new DeprecatedFactoryManager(this, factory, fullName); + + _emberMetal.runInDebug(function () { + manager = wrapManagerInDeprecationProxy(manager); + }); + + return manager; + }, _Container$prototype.destroy = function () { + eachDestroyable(this, function (item) { + if (item.destroy) { + item.destroy(); + } + }); + + this.isDestroyed = true; + }, _Container$prototype.reset = function (fullName) { + if (arguments.length > 0) { + resetMember(this, this.registry.normalize(fullName)); + } else { + resetCache(this); + } + }, _Container$prototype.ownerInjection = function () { + var _ref; + + return _ref = {}, _ref[_emberUtils.OWNER] = this.owner, _ref; + }, _Container$prototype); + + /* + * Wrap a factory manager in a proxy which will not permit properties to be + * set on the manager. + */ + function wrapManagerInDeprecationProxy(manager) { + if (_emberUtils.HAS_NATIVE_PROXY) { + var _ret = (function () { + var validator = { + get: function (obj, prop) { + if (prop !== 'class' && prop !== 'create') { + throw new Error('You attempted to access "' + prop + '" on a factory manager created by container#factoryFor. "' + prop + '" is not a member of a factory manager."'); + } + + return obj[prop]; + }, + set: function (obj, prop, value) { + throw new Error('You attempted to set "' + prop + '" on a factory manager created by container#factoryFor. A factory manager is a read-only construct.'); + } + }; + + // Note: + // We have to proxy access to the manager here so that private property + // access doesn't cause the above errors to occur. + var m = manager; + var proxiedManager = { + class: m.class, + create: function (props) { + return m.create(props); + } + }; + + return { + v: new Proxy(proxiedManager, validator) + }; + })(); + + if (typeof _ret === 'object') return _ret.v; + } + + return manager; + } + + if (_emberMetal.isFeatureEnabled('ember-factory-for')) { /** - A depth first traversal, destroying the container, its descendant containers and all - their managed objects. - @private - @method destroy + Given a fullName, return the corresponding factory. The consumer of the factory + is responsible for the destruction of any factory instances, as there is no + way for the container to ensure instances are destroyed when it itself is + destroyed. + @public + @method factoryFor + @param {String} fullName + @param {Object} [options] + @param {String} [options.source] The fullname of the request source (used for local lookup) + @return {any} */ - destroy: function () { - eachDestroyable(this, function (item) { - if (item.destroy) { - item.destroy(); + Container.prototype.factoryFor = function _factoryFor(fullName) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + var normalizedName = this.registry.normalize(fullName); + _emberMetal.assert('fullName must be a proper full name', this.registry.validateFullName(normalizedName)); + + if (options.source) { + normalizedName = this.registry.expandLocalLookup(fullName, options); + // if expandLocalLookup returns falsey, we do not support local lookup + if (!normalizedName) { + return; } - }); + } - this.isDestroyed = true; - }, + var factory = this.registry.resolve(normalizedName); - /** - Clear either the entire cache or just the cache for a particular key. - @private - @method reset - @param {String} fullName optional key to reset; if missing, resets everything - */ - reset: function (fullName) { - if (arguments.length > 0) { - resetMember(this, this.registry.normalize(fullName)); - } else { - resetCache(this); + if (factory === undefined) { + return; } - }, - /** - Returns an object that can be used to provide an owner to a - manually created instance. - @private - @method ownerInjection - @returns { Object } - */ - ownerInjection: function () { - var _ref; + var manager = new FactoryManager(this, factory, fullName, normalizedName); - return _ref = {}, _ref[_emberUtils.OWNER] = this.owner, _ref; - } - }; + _emberMetal.runInDebug(function () { + manager = wrapManagerInDeprecationProxy(manager); + }); + + return manager; + }; + } function isSingleton(container, fullName) { return container.registry.getOption(fullName, 'singleton') !== false; } + function shouldInstantiate(container, fullName) { + return container.registry.getOption(fullName, 'instantiate') !== false; + } + function lookup(container, fullName) { var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; @@ -1374,17 +1472,76 @@ enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'e return container.cache[fullName]; } - var value = instantiate(container, fullName); + if (_emberMetal.isFeatureEnabled('ember-factory-for')) { + return instantiateFactory(container, fullName, options); + } else { + var factory = deprecatedFactoryFor(container, fullName); + var value = instantiate(factory, {}, container, fullName); - if (value === undefined) { + if (value === undefined) { + return; + } + + if (isSingleton(container, fullName) && options.singleton !== false) { + container.cache[fullName] = value; + } + + return value; + } + } + + function isSingletonClass(container, fullName, _ref2) { + var instantiate = _ref2.instantiate; + var singleton = _ref2.singleton; + + return singleton !== false && isSingleton(container, fullName) && !instantiate && !shouldInstantiate(container, fullName); + } + + function isSingletonInstance(container, fullName, _ref3) { + var instantiate = _ref3.instantiate; + var singleton = _ref3.singleton; + + return singleton !== false && isSingleton(container, fullName) && instantiate !== false && shouldInstantiate(container, fullName); + } + + function isFactoryClass(container, fullname, _ref4) { + var instantiate = _ref4.instantiate; + var singleton = _ref4.singleton; + + return (singleton === false || !isSingleton(container, fullname)) && instantiate === false && !shouldInstantiate(container, fullname); + } + + function isFactoryInstance(container, fullName, _ref5) { + var instantiate = _ref5.instantiate; + var singleton = _ref5.singleton; + + return (singleton !== false || isSingleton(container, fullName)) && instantiate !== false && shouldInstantiate(container, fullName); + } + + function instantiateFactory(container, fullName, options) { + var factoryManager = container[FACTORY_FOR](fullName); + + if (factoryManager === undefined) { return; } - if (isSingleton(container, fullName) && options.singleton !== false) { - container.cache[fullName] = value; + // SomeClass { singleton: true, instantiate: true } | { singleton: true } | { instantiate: true } | {} + // By default majority of objects fall into this case + if (isSingletonInstance(container, fullName, options)) { + return container.cache[fullName] = factoryManager.create(); } - return value; + // SomeClass { singleton: false, instantiate: true } + if (isFactoryInstance(container, fullName, options)) { + return factoryManager.create(); + } + + // SomeClass { singleton: true, instantiate: false } | { instantiate: false } | { singleton: false, instantiation: false } + if (isSingletonClass(container, fullName, options) || isFactoryClass(container, fullName, options)) { + return factoryManager.class; + } + + throw new Error('Could not create factory'); } function markInjectionsAsDynamic(injections) { @@ -1396,41 +1553,46 @@ enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'e } function buildInjections() /* container, ...injections */{ + var _arguments = arguments; + var hash = {}; if (arguments.length > 1) { - var container = arguments[0]; - var injections = []; - var injection = undefined; - - for (var i = 1; i < arguments.length; i++) { - if (arguments[i]) { - injections = injections.concat(arguments[i]); + (function () { + var container = _arguments[0]; + var injections = []; + var injection = undefined; + + for (var i = 1; i < _arguments.length; i++) { + if (_arguments[i]) { + injections = injections.concat(_arguments[i]); + } } - } - container.registry.validateInjections(injections); + _emberMetal.runInDebug(function () { + container.registry.validateInjections(injections); + }); - for (var i = 0; i < injections.length; i++) { - injection = injections[i]; - hash[injection.property] = lookup(container, injection.fullName); - if (!isSingleton(container, injection.fullName)) { - markInjectionsAsDynamic(hash); + for (var i = 0; i < injections.length; i++) { + injection = injections[i]; + hash[injection.property] = lookup(container, injection.fullName); + if (!isSingleton(container, injection.fullName)) { + markInjectionsAsDynamic(hash); + } } - } + })(); } return hash; } - function factoryFor(container, fullName) { + function deprecatedFactoryFor(container, fullName) { var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; var registry = container.registry; if (options.source) { fullName = registry.expandLocalLookup(fullName, options); - // if expandLocalLookup returns falsey, we do not support local lookup if (!fullName) { return; @@ -1461,7 +1623,7 @@ enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'e var factoryInjections = factoryInjectionsFor(container, fullName); var cacheable = !areInjectionsDynamic(injections) && !areInjectionsDynamic(factoryInjections); - factoryInjections._toString = registry.makeToString(factory, fullName); + factoryInjections[_emberUtils.NAME_KEY] = registry.makeToString(factory, fullName); var injectedFactory = factory.extend(injections); @@ -1494,22 +1656,12 @@ enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'e return injections; } - function factoryInjectionsFor(container, fullName) { - var registry = container.registry; - var splitName = fullName.split(':'); - var type = splitName[0]; - - var factoryInjections = buildInjections(container, registry.getFactoryTypeInjections(type), registry.getFactoryInjections(fullName)); - factoryInjections._debugContainerKey = fullName; - - return factoryInjections; - } - - function instantiate(container, fullName) { - var factory = factoryFor(container, fullName); + function instantiate(factory, props, container, fullName) { var lazyInjections = undefined, validationCache = undefined; + props = props || {}; + if (container.registry.getOption(fullName, 'instantiate') === false) { return factory; } @@ -1537,7 +1689,7 @@ enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'e if (typeof factory.extend === 'function') { // assume the factory was extendable and is already injected - obj = factory.create(); + obj = factory.create(props); } else { // assume the factory was extendable // to create time injections @@ -1549,7 +1701,7 @@ enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'e // This "fake" container will be replaced after instantiation with a // property that raises deprecations every time it is accessed. injections.container = container._fakeContainerToInject; - obj = factory.create(injections); + obj = factory.create(_emberUtils.assign({}, injections, props)); // TODO - remove when Ember reaches v3.0.0 if (!Object.isFrozen(obj) && 'container' in obj) { @@ -1561,6 +1713,17 @@ enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'e } } + function factoryInjectionsFor(container, fullName) { + var registry = container.registry; + var splitName = fullName.split(':'); + var type = splitName[0]; + + var factoryInjections = buildInjections(container, registry.getFactoryTypeInjections(type), registry.getFactoryInjections(fullName)); + factoryInjections._debugContainerKey = fullName; + + return factoryInjections; + } + // TODO - remove when Ember reaches v3.0.0 function injectDeprecatedContainer(object, container) { Object.defineProperty(object, 'container', { @@ -1643,7 +1806,98 @@ enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'e return container[containerProperty].apply(container, arguments); }; } + + var DeprecatedFactoryManager = (function () { + function DeprecatedFactoryManager(container, factory, fullName) { + this.container = container; + this.class = factory; + this.fullName = fullName; + } + + DeprecatedFactoryManager.prototype.create = function create() { + var props = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + + return instantiate(this.class, props, this.container, this.fullName); + }; + + return DeprecatedFactoryManager; + })(); + + var FactoryManager = (function () { + function FactoryManager(container, factory, fullName, normalizedName) { + this.container = container; + this.class = factory; + this.fullName = fullName; + this.normalizedName = normalizedName; + } + + FactoryManager.prototype.create = function create() { + var _this = this; + + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + + var injections = injectionsFor(this.container, this.normalizedName); + var props = _emberUtils.assign({}, injections, options); + + props[_emberUtils.NAME_KEY] = this.container.registry.makeToString(this.class, this.fullName); + + _emberMetal.runInDebug(function () { + var lazyInjections = undefined; + var validationCache = _this.container.validationCache; + // Ensure that all lazy injections are valid at instantiation time + if (!validationCache[_this.fullName] && _this.class && typeof _this.class._lazyInjections === 'function') { + lazyInjections = _this.class._lazyInjections(); + lazyInjections = _this.container.registry.normalizeInjectionsHash(lazyInjections); + + _this.container.registry.validateInjections(lazyInjections); + } + + validationCache[_this.fullName] = true; + }); + + if (!this.class.create) { + throw new Error('Failed to create an instance of \'' + this.normalizedName + '\'. Most likely an improperly defined class or' + ' an invalid module export.'); + } + + if (this.class.prototype) { + injectDeprecatedContainer(this.class.prototype, this.container); + } + + return this.class.create(props); + }; + + return FactoryManager; + })(); }); + +/* + * This internal version of factoryFor swaps between the public API for + * factoryFor (class is the registered class) and a transition implementation + * (class is the double-extended class). It is *not* the public API version + * of factoryFor, which always returns the registered class. + */ + +/** + A depth first traversal, destroying the container, its descendant containers and all + their managed objects. + @private + @method destroy + */ + +/** + Clear either the entire cache or just the cache for a particular key. + @private + @method reset + @param {String} fullName optional key to reset; if missing, resets everything + */ + +/** + Returns an object that can be used to provide an owner to a + manually created instance. + @private + @method ownerInjection + @returns { Object } +*/ enifed('container/index', ['exports', 'container/registry', 'container/container'], function (exports, _containerRegistry, _containerContainer) { /* Public API for the container is still in flux. @@ -1658,6 +1912,8 @@ enifed('container/index', ['exports', 'container/registry', 'container/container exports.privatize = _containerRegistry.privatize; exports.Container = _containerContainer.default; exports.buildFakeContainerWithDeprecations = _containerContainer.buildFakeContainerWithDeprecations; + exports.FACTORY_FOR = _containerContainer.FACTORY_FOR; + exports.LOOKUP_FACTORY = _containerContainer.LOOKUP_FACTORY; }); enifed('container/registry', ['exports', 'ember-utils', 'ember-metal', 'container/container'], function (exports, _emberUtils, _emberMetal, _containerContainer) { 'use strict'; @@ -2291,9 +2547,7 @@ enifed('container/registry', ['exports', 'ember-utils', 'ember-metal', 'containe for (var i = 0; i < injections.length; i++) { fullName = injections[i].fullName; - if (!this.has(fullName)) { - throw new Error('Attempting to inject an unknown injection: \'' + fullName + '\''); - } + _emberMetal.assert('Attempting to inject an unknown injection: \'' + fullName + '\'', this.has(fullName)); } }, @@ -2786,7 +3040,6 @@ enifed('ember-metal/alias', ['exports', 'ember-utils', 'ember-metal/debug', 'emb 'use strict'; exports.default = alias; - exports.AliasedProperty = AliasedProperty; var CONSUMED = {}; @@ -2794,66 +3047,73 @@ enifed('ember-metal/alias', ['exports', 'ember-utils', 'ember-metal/debug', 'emb return new AliasedProperty(altKey); } - function AliasedProperty(altKey) { - this.isDescriptor = true; - this.altKey = altKey; - this._dependentKeys = [altKey]; - } - - AliasedProperty.prototype = Object.create(_emberMetalProperties.Descriptor.prototype); + var AliasedProperty = (function (_Descriptor) { + babelHelpers.inherits(AliasedProperty, _Descriptor); - AliasedProperty.prototype.setup = function (obj, keyName) { - _emberMetalDebug.assert('Setting alias \'' + keyName + '\' on self', this.altKey !== keyName); - var meta = _emberMetalMeta.meta(obj); - if (meta.peekWatching(keyName)) { - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); + function AliasedProperty(altKey) { + _Descriptor.call(this); + this.isDescriptor = true; + this.altKey = altKey; + this._dependentKeys = [altKey]; } - }; - AliasedProperty.prototype.teardown = function (obj, keyName) { - var meta = _emberMetalMeta.meta(obj); - if (meta.peekWatching(keyName)) { - _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); - } - }; + AliasedProperty.prototype.setup = function setup(obj, keyName) { + _emberMetalDebug.assert('Setting alias \'' + keyName + '\' on self', this.altKey !== keyName); + var meta = _emberMetalMeta.meta(obj); + if (meta.peekWatching(keyName)) { + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); + } + }; - AliasedProperty.prototype.willWatch = function (obj, keyName) { - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); - }; + AliasedProperty.prototype.teardown = function teardown(obj, keyName) { + var meta = _emberMetalMeta.meta(obj); + if (meta.peekWatching(keyName)) { + _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); + } + }; - AliasedProperty.prototype.didUnwatch = function (obj, keyName) { - _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); - }; + AliasedProperty.prototype.willWatch = function willWatch(obj, keyName) { + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); + }; - AliasedProperty.prototype.get = function AliasedProperty_get(obj, keyName) { - var ret = _emberMetalProperty_get.get(obj, this.altKey); - var meta = _emberMetalMeta.meta(obj); - var cache = meta.writableCache(); - if (cache[keyName] !== CONSUMED) { - cache[keyName] = CONSUMED; - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); - } - return ret; - }; + AliasedProperty.prototype.didUnwatch = function didUnwatch(obj, keyName) { + _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); + }; - AliasedProperty.prototype.set = function AliasedProperty_set(obj, keyName, value) { - return _emberMetalProperty_set.set(obj, this.altKey, value); - }; + AliasedProperty.prototype.get = function get(obj, keyName) { + var ret = _emberMetalProperty_get.get(obj, this.altKey); + var meta = _emberMetalMeta.meta(obj); + var cache = meta.writableCache(); + if (cache[keyName] !== CONSUMED) { + cache[keyName] = CONSUMED; + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); + } + return ret; + }; - AliasedProperty.prototype.readOnly = function () { - this.set = AliasedProperty_readOnlySet; - return this; - }; + AliasedProperty.prototype.set = function set(obj, keyName, value) { + return _emberMetalProperty_set.set(obj, this.altKey, value); + }; + + AliasedProperty.prototype.readOnly = function readOnly() { + this.set = AliasedProperty_readOnlySet; + return this; + }; + + AliasedProperty.prototype.oneWay = function oneWay() { + this.set = AliasedProperty_oneWaySet; + return this; + }; + + return AliasedProperty; + })(_emberMetalProperties.Descriptor); + + exports.AliasedProperty = AliasedProperty; function AliasedProperty_readOnlySet(obj, keyName, value) { throw new _emberMetalError.default('Cannot set read-only property \'' + keyName + '\' on object: ' + _emberUtils.inspect(obj)); } - AliasedProperty.prototype.oneWay = function () { - this.set = AliasedProperty_oneWaySet; - return this; - }; - function AliasedProperty_oneWaySet(obj, keyName, value) { _emberMetalProperties.defineProperty(obj, keyName, null); return _emberMetalProperty_set.set(obj, keyName, value); @@ -2877,41 +3137,42 @@ enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember // BINDING // - function Binding(toPath, fromPath) { - // Configuration - this._from = fromPath; - this._to = toPath; - this._oneWay = undefined; + var Binding = (function () { + function Binding(toPath, fromPath) { + // Configuration + this._from = fromPath; + this._to = toPath; + this._oneWay = undefined; - // State - this._direction = undefined; - this._readyToSync = undefined; - this._fromObj = undefined; - this._fromPath = undefined; - this._toObj = undefined; - } + // State + this._direction = undefined; + this._readyToSync = undefined; + this._fromObj = undefined; + this._fromPath = undefined; + this._toObj = undefined; + } - /** - @class Binding - @namespace Ember - @deprecated See http://emberjs.com/deprecations/v2.x#toc_ember-binding - @public - */ + /** + @class Binding + @namespace Ember + @deprecated See http://emberjs.com/deprecations/v2.x#toc_ember-binding + @public + */ - Binding.prototype = { /** This copies the Binding so it can be connected to another object. @method copy @return {Ember.Binding} `this` @public */ - copy: function () { + + Binding.prototype.copy = function copy() { var copy = new Binding(this._to, this._from); if (this._oneWay) { copy._oneWay = true; } return copy; - }, + }; // .......................................................... // CONFIG @@ -2929,10 +3190,11 @@ enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember @return {Ember.Binding} `this` @public */ - from: function (path) { + + Binding.prototype.from = function from(path) { this._from = path; return this; - }, + }; /** This will set the `to` property path to the specified value. It will not @@ -2946,10 +3208,11 @@ enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember @return {Ember.Binding} `this` @public */ - to: function (path) { + + Binding.prototype.to = function to(path) { this._to = path; return this; - }, + }; /** Configures the binding as one way. A one-way binding will relay changes @@ -2960,20 +3223,22 @@ enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember @return {Ember.Binding} `this` @public */ - oneWay: function () { + + Binding.prototype.oneWay = function oneWay() { this._oneWay = true; return this; - }, + }; /** @method toString @return {String} string representation of binding @public */ - toString: function () { + + Binding.prototype.toString = function toString() { var oneWay = this._oneWay ? '[oneWay]' : ''; return 'Ember.Binding<' + _emberUtils.guidFor(this) + '>(' + this._from + ' -> ' + this._to + ')' + oneWay; - }, + }; // .......................................................... // CONNECT AND SYNC @@ -2988,7 +3253,8 @@ enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember @return {Ember.Binding} `this` @public */ - connect: function (obj) { + + Binding.prototype.connect = function connect(obj) { _emberMetalDebug.assert('Must pass a valid object to Ember.Binding.connect()', !!obj); var fromObj = undefined, @@ -3032,7 +3298,7 @@ enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember this._toObj = obj; return this; - }, + }; /** Disconnects the binding instance. Changes will no longer be relayed. You @@ -3041,7 +3307,8 @@ enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember @return {Ember.Binding} `this` @public */ - disconnect: function () { + + Binding.prototype.disconnect = function disconnect() { _emberMetalDebug.assert('Must pass a valid object to Ember.Binding.disconnect()', !!this._toObj); // Remove an observer on the object so we're no longer notified of @@ -3055,23 +3322,25 @@ enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember this._readyToSync = false; // Disable scheduled syncs... return this; - }, + }; // .......................................................... // PRIVATE // /* Called when the from side changes. */ - fromDidChange: function (target) { + + Binding.prototype.fromDidChange = function fromDidChange(target) { this._scheduleSync('fwd'); - }, + }; /* Called when the to side changes. */ - toDidChange: function (target) { + + Binding.prototype.toDidChange = function toDidChange(target) { this._scheduleSync('back'); - }, + }; - _scheduleSync: function (dir) { + Binding.prototype._scheduleSync = function _scheduleSync(dir) { var existingDir = this._direction; // If we haven't scheduled the binding yet, schedule it. @@ -3085,9 +3354,11 @@ enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember if (existingDir === 'back' && dir === 'fwd') { this._direction = 'fwd'; } - }, + }; + + Binding.prototype._sync = function _sync() { + var _this = this; - _sync: function () { var log = _emberEnvironment.ENV.LOG_BINDINGS; var toObj = this._toObj; @@ -3108,30 +3379,35 @@ enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember // If we're synchronizing from the remote object... if (direction === 'fwd') { - var fromValue = _emberMetalProperty_get.get(fromObj, fromPath); - if (log) { - _emberConsole.default.log(' ', this.toString(), '->', fromValue, fromObj); - } - if (this._oneWay) { - _emberMetalProperty_set.trySet(toObj, this._to, fromValue); - } else { - _emberMetalObserver._suspendObserver(toObj, this._to, this, 'toDidChange', function () { - _emberMetalProperty_set.trySet(toObj, this._to, fromValue); - }); - } - // If we're synchronizing *to* the remote object. - } else if (direction === 'back') { - var toValue = _emberMetalProperty_get.get(toObj, this._to); + (function () { + var fromValue = _emberMetalProperty_get.get(fromObj, fromPath); if (log) { - _emberConsole.default.log(' ', this.toString(), '<-', toValue, toObj); + _emberConsole.default.log(' ', _this.toString(), '->', fromValue, fromObj); } - _emberMetalObserver._suspendObserver(fromObj, fromPath, this, 'fromDidChange', function () { - _emberMetalProperty_set.trySet(fromObj, fromPath, toValue); - }); + if (_this._oneWay) { + _emberMetalProperty_set.trySet(toObj, _this._to, fromValue); + } else { + _emberMetalObserver._suspendObserver(toObj, _this._to, _this, 'toDidChange', function () { + _emberMetalProperty_set.trySet(toObj, this._to, fromValue); + }); + } + // If we're synchronizing *to* the remote object. + })(); + } else if (direction === 'back') { + (function () { + var toValue = _emberMetalProperty_get.get(toObj, _this._to); + if (log) { + _emberConsole.default.log(' ', _this.toString(), '<-', toValue, toObj); + } + _emberMetalObserver._suspendObserver(fromObj, fromPath, _this, 'fromDidChange', function () { + _emberMetalProperty_set.trySet(fromObj, fromPath, toValue); + }); + })(); } - } + }; - }; + return Binding; + })(); function fireDeprecations(obj, toPath, fromPath, deprecateGlobal, deprecateOneWay, deprecateAlias) { var deprecateGlobalMessage = '`Ember.Binding` is deprecated. Since you' + ' are binding to a global consider using a service instead.'; @@ -3420,7 +3696,7 @@ enifed('ember-metal/cache', ['exports', 'ember-utils', 'ember-metal/meta'], func return DefaultStore; })(); }); -enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_get', 'ember-metal/meta', 'ember-metal/watch_key', 'ember-metal/watch_path'], function (exports, _emberUtils, _emberMetalProperty_get, _emberMetalMeta, _emberMetalWatch_key, _emberMetalWatch_path) { +enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_get', 'ember-metal/meta', 'ember-metal/watch_key', 'ember-metal/computed', 'ember-metal/watch_path'], function (exports, _emberUtils, _emberMetalProperty_get, _emberMetalMeta, _emberMetalWatch_key, _emberMetalComputed, _emberMetalWatch_path) { 'use strict'; exports.finishChains = finishChains; @@ -3439,24 +3715,24 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge return !(isObject(obj) && obj.isDescriptor && obj._volatile === false); } - function ChainWatchers() { - // chain nodes that reference a key in this obj by key - // we only create ChainWatchers when we are going to add them - // so create this upfront - this.chains = new _emberUtils.EmptyObject(); - } + var ChainWatchers = (function () { + function ChainWatchers() { + // chain nodes that reference a key in this obj by key + // we only create ChainWatchers when we are going to add them + // so create this upfront + this.chains = new _emberUtils.EmptyObject(); + } - ChainWatchers.prototype = { - add: function (key, node) { + ChainWatchers.prototype.add = function add(key, node) { var nodes = this.chains[key]; if (nodes === undefined) { this.chains[key] = [node]; } else { nodes.push(node); } - }, + }; - remove: function (key, node) { + ChainWatchers.prototype.remove = function remove(key, node) { var nodes = this.chains[key]; if (nodes) { for (var i = 0; i < nodes.length; i++) { @@ -3466,9 +3742,9 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge } } } - }, + }; - has: function (key, node) { + ChainWatchers.prototype.has = function has(key, node) { var nodes = this.chains[key]; if (nodes) { for (var i = 0; i < nodes.length; i++) { @@ -3478,24 +3754,25 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge } } return false; - }, + }; - revalidateAll: function () { + ChainWatchers.prototype.revalidateAll = function revalidateAll() { for (var key in this.chains) { this.notify(key, true, undefined); } - }, + }; - revalidate: function (key) { + ChainWatchers.prototype.revalidate = function revalidate(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 object and path that // will be/are invalidated by this key change, depending on // whether the revalidate flag is passed - notify: function (key, revalidate, callback) { + + ChainWatchers.prototype.notify = function notify(key, revalidate, callback) { var nodes = this.chains[key]; if (nodes === undefined || nodes.length === 0) { return; @@ -3521,8 +3798,10 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge var path = affected[i + 1]; callback(obj, path); } - } - }; + }; + + return ChainWatchers; + })(); function makeChainWatcher() { return new ChainWatchers(); @@ -3556,71 +3835,48 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge // 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 // pass null for parent and key and object for value. - function ChainNode(parent, key, value) { - this._parent = parent; - this._key = key; - // _watching is true when calling get(this._parent, this._key) will - // return the value of this node. - // - // It is false for the root of a chain (because we have no parent) - // and for global paths (because the parent node is the object with - // the observer on it) - this._watching = value === undefined; + var ChainNode = (function () { + function ChainNode(parent, key, value) { + this._parent = parent; + this._key = key; + + // _watching is true when calling get(this._parent, this._key) will + // return the value of this node. + // + // It is false for the root of a chain (because we have no parent) + // and for global paths (because the parent node is the object with + // the observer on it) + this._watching = value === undefined; + + this._chains = undefined; + this._object = undefined; + this.count = 0; + + this._value = value; + this._paths = {}; + if (this._watching) { + var obj = parent.value(); - this._chains = undefined; - this._object = undefined; - this.count = 0; + if (!isObject(obj)) { + return; + } - this._value = value; - this._paths = {}; - if (this._watching) { - var obj = parent.value(); + this._object = obj; - if (!isObject(obj)) { - return; + addChainWatcher(this._object, this._key, this); } - - this._object = obj; - - addChainWatcher(this._object, this._key, this); - } - } - - function lazyGet(obj, key) { - if (!isObject(obj)) { - return; - } - - var meta = _emberMetalMeta.peekMeta(obj); - - // check if object meant only to be a prototype - if (meta && meta.proto === obj) { - return; } - // Use `get` if the return value is an EachProxy or an uncacheable value. - if (isVolatile(obj[key])) { - return _emberMetalProperty_get.get(obj, key); - // Otherwise attempt to get the cached value of the computed property - } else { - var cache = meta.readableCache(); - if (cache && key in cache) { - return cache[key]; - } - } - } - - ChainNode.prototype = { - value: function () { + ChainNode.prototype.value = function value() { if (this._value === undefined && this._watching) { var obj = this._parent.value(); this._value = lazyGet(obj, this._key); } return this._value; - }, + }; - destroy: function () { + ChainNode.prototype.destroy = function destroy() { if (this._watching) { var obj = this._object; if (obj) { @@ -3628,10 +3884,11 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge } this._watching = false; // so future calls do nothing } - }, + }; // copies a top level object only - copy: function (obj) { + + ChainNode.prototype.copy = function copy(obj) { var ret = new ChainNode(null, null, obj); var paths = this._paths; var path = undefined; @@ -3644,11 +3901,12 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge ret.add(path); } return ret; - }, + }; // called on the root node of a chain to setup watchers on the specified // path. - add: function (path) { + + ChainNode.prototype.add = function add(path) { var paths = this._paths; paths[path] = (paths[path] || 0) + 1; @@ -3656,11 +3914,12 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge var tail = path.slice(key.length + 1); this.chain(key, tail); - }, + }; // called on the root node of a chain to teardown watcher on the specified // path - remove: function (path) { + + ChainNode.prototype.remove = function remove(path) { var paths = this._paths; if (paths[path] > 0) { paths[path]--; @@ -3670,9 +3929,9 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge var tail = path.slice(key.length + 1); this.unchain(key, tail); - }, + }; - chain: function (key, path) { + ChainNode.prototype.chain = function chain(key, path) { var chains = this._chains; var node = undefined; if (chains === undefined) { @@ -3693,9 +3952,9 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge path = path.slice(key.length + 1); node.chain(key, path); } - }, + }; - unchain: function (key, path) { + ChainNode.prototype.unchain = function unchain(key, path) { var chains = this._chains; var node = chains[key]; @@ -3712,9 +3971,9 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge chains[node._key] = undefined; node.destroy(); } - }, + }; - notify: function (revalidate, affected) { + ChainNode.prototype.notify = function notify(revalidate, affected) { if (revalidate && this._watching) { var parentValue = this._parent.value(); @@ -3748,9 +4007,9 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge if (affected && this._parent) { this._parent.populateAffected(this._key, 1, affected); } - }, + }; - populateAffected: function (path, depth, affected) { + ChainNode.prototype.populateAffected = function populateAffected(path, depth, affected) { if (this._key) { path = this._key + '.' + path; } @@ -3762,8 +4021,34 @@ enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_ge affected.push(this.value(), path); } } + }; + + return ChainNode; + })(); + + function lazyGet(obj, key) { + if (!isObject(obj)) { + return; } - }; + + var meta = _emberMetalMeta.peekMeta(obj); + + // check if object meant only to be a prototype + if (meta && meta.proto === obj) { + return; + } + + // Use `get` if the return value is an EachProxy or an uncacheable value. + if (isVolatile(obj[key])) { + return _emberMetalProperty_get.get(obj, key); + // Otherwise attempt to get the cached value of the computed property + } else { + var cache = meta.readableCache(); + if (cache) { + return _emberMetalComputed.cacheFor.get(cache, key); + } + } + } function finishChains(obj) { // We only create meta if we really have to @@ -4267,8 +4552,8 @@ enifed('ember-metal/computed', ['exports', 'ember-utils', 'ember-metal/debug', ' this.setProperties({ firstName, lastName }); return value; } - }); - }) + }) + }); let client = Person.create(); client.get('firstName'); // 'Betty' @@ -4625,31 +4910,37 @@ enifed("ember-metal/error", ["exports"], function (exports) { */ "use strict"; - exports.default = EmberError; + var EmberError = (function (_Error) { + babelHelpers.inherits(EmberError, _Error); - function EmberError(message) { - if (!(this instanceof EmberError)) { - return new EmberError(message); - } + function EmberError(message) { + _Error.call(this); + + if (!(this instanceof EmberError)) { + return new EmberError(message); + } - var error = Error.call(this, message); + var error = Error.call(this, message); - if (Error.captureStackTrace) { - Error.captureStackTrace(this, EmberError); - } else { - this.stack = error.stack; + if (Error.captureStackTrace) { + Error.captureStackTrace(this, EmberError); + } else { + this.stack = error.stack; + } + + this.description = error.description; + this.fileName = error.fileName; + this.lineNumber = error.lineNumber; + this.message = error.message; + this.name = error.name; + this.number = error.number; + this.code = error.code; } - this.description = error.description; - this.fileName = error.fileName; - this.lineNumber = error.lineNumber; - this.message = error.message; - this.name = error.name; - this.number = error.number; - this.code = error.code; - } + return EmberError; + })(Error); - EmberError.prototype = Object.create(Error.prototype); + exports.default = EmberError; }); enifed('ember-metal/error_handler', ['exports', 'ember-console', 'ember-metal/testing'], function (exports, _emberConsole, _emberMetalTesting) { 'use strict'; @@ -4664,7 +4955,7 @@ enifed('ember-metal/error_handler', ['exports', 'ember-console', 'ember-metal/te var stack = error.stack; var message = error.message; - if (stack && stack.indexOf(message) === -1) { + if (stack && !stack.includes(message)) { stack = message + '\n' + stack; } @@ -5344,7 +5635,6 @@ enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-me exports.removeObserver = _emberMetalObserver.removeObserver; exports._addBeforeObserver = _emberMetalObserver._addBeforeObserver; exports._removeBeforeObserver = _emberMetalObserver._removeBeforeObserver; - exports.NAME_KEY = _emberMetalMixin.NAME_KEY; exports.Mixin = _emberMetalMixin.Mixin; exports.aliasMethod = _emberMetalMixin.aliasMethod; exports._immediateObserver = _emberMetalMixin._immediateObserver; @@ -5428,6 +5718,9 @@ enifed('ember-metal/injected_property', ['exports', 'ember-utils', 'ember-metal/ InjectedPropertyPrototype.teardown = ComputedPropertyPrototype.teardown; }); enifed('ember-metal/instrumentation', ['exports', 'ember-environment', 'ember-metal/features'], function (exports, _emberEnvironment, _emberMetalFeatures) { + /* eslint no-console:off */ + /* global console */ + 'use strict'; exports.instrument = instrument; @@ -5564,8 +5857,8 @@ enifed('ember-metal/instrumentation', ['exports', 'ember-environment', 'ember-me result = payload; } finally { finalizer(); - return result; } + return result; } function NOOP() {} @@ -5885,8 +6178,6 @@ enifed('ember-metal/is_proxy', ['exports', 'ember-metal/meta'], function (export enifed('ember-metal/libraries', ['exports', 'ember-metal/debug', 'ember-metal/features'], function (exports, _emberMetalDebug, _emberMetalFeatures) { 'use strict'; - exports.Libraries = Libraries; - /** Helper class that allows you to register your library with Ember. @@ -5897,10 +6188,20 @@ enifed('ember-metal/libraries', ['exports', 'ember-metal/debug', 'ember-metal/fe @private */ - function Libraries() { - this._registry = []; - this._coreLibIndex = 0; - } + var Libraries = (function () { + function Libraries() { + this._registry = []; + this._coreLibIndex = 0; + } + + Libraries.prototype.isRegistered = function isRegistered(name) { + return !!this._getLibraryByName(name); + }; + + return Libraries; + })(); + + exports.Libraries = Libraries; Libraries.prototype = { constructor: Libraries, @@ -6482,12 +6783,11 @@ enifed('ember-metal/merge', ['exports'], function (exports) { return original; } }); -enifed('ember-metal/meta', ['exports', 'ember-utils', 'ember-metal/features', 'ember-metal/meta_listeners', 'ember-metal/debug', 'ember-metal/chains'], function (exports, _emberUtils, _emberMetalFeatures, _emberMetalMeta_listeners, _emberMetalDebug, _emberMetalChains) { +enifed('ember-metal/meta', ['exports', 'ember-utils', 'ember-metal/features', 'ember-metal/meta_listeners', 'ember-metal/debug', 'ember-metal/chains', 'require'], function (exports, _emberUtils, _emberMetalFeatures, _emberMetalMeta_listeners, _emberMetalDebug, _emberMetalChains, _require) { 'no use strict'; // Remove "use strict"; from transpiled module until // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - exports.Meta = Meta; exports.deleteMeta = deleteMeta; exports.meta = meta; @@ -6547,315 +6847,356 @@ enifed('ember-metal/meta', ['exports', 'ember-utils', 'ember-metal/features', 'e if (_emberMetalFeatures.default('ember-glimmer-detect-backtracking-rerender') || _emberMetalFeatures.default('ember-glimmer-allow-backtracking-rerender')) { members.lastRendered = ownMap; - members.lastRenderedFrom = ownMap; // FIXME: not used in production, remove me from prod builds + if (_require.has('ember-debug')) { + //https://github.com/emberjs/ember.js/issues/14732 + members.lastRenderedReferenceMap = ownMap; + members.lastRenderedTemplateMap = ownMap; + } } var memberNames = Object.keys(members); var META_FIELD = '__ember_meta__'; - function Meta(obj, parentMeta) { - _emberMetalDebug.runInDebug(function () { - return counters.metaInstantiated++; - }); - - this._cache = undefined; - this._weak = undefined; - this._watching = undefined; - this._mixins = undefined; - this._bindings = undefined; - this._values = undefined; - this._deps = undefined; - this._chainWatchers = undefined; - this._chains = undefined; - this._tag = undefined; - this._tags = undefined; - - // initial value for all flags right now is false - // see FLAGS const for detailed list of flags used - this._flags = 0; - - // used only internally - this.source = obj; - - // when meta(obj).proto === obj, the object is intended to be only a - // prototype and doesn't need to actually be observable itself - this.proto = undefined; - - // The next meta in our inheritance chain. We (will) track this - // explicitly instead of using prototypical inheritance because we - // have detailed knowledge of how each property should really be - // inherited, and we can optimize it much better than JS runtimes. - this.parent = parentMeta; + var Meta = (function () { + function Meta(obj, parentMeta) { + var _this = this; - if (_emberMetalFeatures.default('ember-glimmer-detect-backtracking-rerender') || _emberMetalFeatures.default('ember-glimmer-allow-backtracking-rerender')) { - this._lastRendered = undefined; - this._lastRenderedFrom = undefined; // FIXME: not used in production, remove me from prod builds - } + _emberMetalDebug.runInDebug(function () { + return counters.metaInstantiated++; + }); - this._initializeListeners(); - } + this._cache = undefined; + this._weak = undefined; + this._watching = undefined; + this._mixins = undefined; + this._bindings = undefined; + this._values = undefined; + this._deps = undefined; + this._chainWatchers = undefined; + this._chains = undefined; + this._tag = undefined; + this._tags = undefined; + + // initial value for all flags right now is false + // see FLAGS const for detailed list of flags used + this._flags = 0; + + // used only internally + this.source = obj; + + // when meta(obj).proto === obj, the object is intended to be only a + // prototype and doesn't need to actually be observable itself + this.proto = undefined; + + // The next meta in our inheritance chain. We (will) track this + // explicitly instead of using prototypical inheritance because we + // have detailed knowledge of how each property should really be + // inherited, and we can optimize it much better than JS runtimes. + this.parent = parentMeta; + + if (_emberMetalFeatures.default('ember-glimmer-detect-backtracking-rerender') || _emberMetalFeatures.default('ember-glimmer-allow-backtracking-rerender')) { + this._lastRendered = undefined; + _emberMetalDebug.runInDebug(function () { + _this._lastRenderedReferenceMap = undefined; + _this._lastRenderedTemplateMap = undefined; + }); + } - Meta.prototype.isInitialized = function (obj) { - return this.proto !== obj; - }; + this._initializeListeners(); + } - var NODE_STACK = []; + Meta.prototype.isInitialized = function isInitialized(obj) { + return this.proto !== obj; + }; - Meta.prototype.destroy = function () { - if (this.isMetaDestroyed()) { - return; - } + Meta.prototype.destroy = function destroy() { + if (this.isMetaDestroyed()) { + return; + } - // remove chainWatchers to remove circular references that would prevent GC - var node = undefined, - nodes = undefined, - key = undefined, - nodeObject = undefined; - node = this.readableChains(); - if (node) { - NODE_STACK.push(node); - // process tree - while (NODE_STACK.length > 0) { - node = NODE_STACK.pop(); - // push children - nodes = node._chains; - if (nodes) { - for (key in nodes) { - if (nodes[key] !== undefined) { - NODE_STACK.push(nodes[key]); + // remove chainWatchers to remove circular references that would prevent GC + var nodes = undefined, + key = undefined, + nodeObject = undefined; + var node = this.readableChains(); + if (node) { + NODE_STACK.push(node); + // process tree + while (NODE_STACK.length > 0) { + node = NODE_STACK.pop(); + // push children + nodes = node._chains; + if (nodes) { + for (key in nodes) { + if (nodes[key] !== undefined) { + NODE_STACK.push(nodes[key]); + } } } - } - // remove chainWatcher in node object - if (node._watching) { - nodeObject = node._object; - if (nodeObject) { - var foreignMeta = peekMeta(nodeObject); - // avoid cleaning up chain watchers when both current and - // foreign objects are being destroyed - // if both are being destroyed manual cleanup is not needed - // as they will be GC'ed and no non-destroyed references will - // be remaining - if (foreignMeta && !foreignMeta.isSourceDestroying()) { - _emberMetalChains.removeChainWatcher(nodeObject, node._key, node, foreignMeta); + // remove chainWatcher in node object + if (node._watching) { + nodeObject = node._object; + if (nodeObject) { + var foreignMeta = peekMeta(nodeObject); + // avoid cleaning up chain watchers when both current and + // foreign objects are being destroyed + // if both are being destroyed manual cleanup is not needed + // as they will be GC'ed and no non-destroyed references will + // be remaining + if (foreignMeta && !foreignMeta.isSourceDestroying()) { + _emberMetalChains.removeChainWatcher(nodeObject, node._key, node, foreignMeta); + } } } } } - } - - this.setMetaDestroyed(); - }; - - for (var _name in _emberMetalMeta_listeners.protoMethods) { - Meta.prototype[_name] = _emberMetalMeta_listeners.protoMethods[_name]; - } - memberNames.forEach(function (name) { - return members[name](name, Meta); - }); - - Meta.prototype.isSourceDestroying = function isSourceDestroying() { - return (this._flags & SOURCE_DESTROYING) !== 0; - }; - - Meta.prototype.setSourceDestroying = function setSourceDestroying() { - this._flags |= SOURCE_DESTROYING; - }; - - Meta.prototype.isSourceDestroyed = function isSourceDestroyed() { - return (this._flags & SOURCE_DESTROYED) !== 0; - }; - - Meta.prototype.setSourceDestroyed = function setSourceDestroyed() { - this._flags |= SOURCE_DESTROYED; - }; - Meta.prototype.isMetaDestroyed = function isMetaDestroyed() { - return (this._flags & META_DESTROYED) !== 0; - }; + this.setMetaDestroyed(); + }; - Meta.prototype.setMetaDestroyed = function setMetaDestroyed() { - this._flags |= META_DESTROYED; - }; + Meta.prototype.isSourceDestroying = function isSourceDestroying() { + return (this._flags & SOURCE_DESTROYING) !== 0; + }; - Meta.prototype.isProxy = function isProxy() { - return (this._flags & IS_PROXY) !== 0; - }; + Meta.prototype.setSourceDestroying = function setSourceDestroying() { + this._flags |= SOURCE_DESTROYING; + }; - Meta.prototype.setProxy = function setProxy() { - this._flags |= IS_PROXY; - }; + Meta.prototype.isSourceDestroyed = function isSourceDestroyed() { + return (this._flags & SOURCE_DESTROYED) !== 0; + }; - // Implements a member that is a lazily created, non-inheritable - // POJO. - function ownMap(name, Meta) { - var key = memberProperty(name); - var capitalized = capitalize(name); - Meta.prototype['writable' + capitalized] = function () { - return this._getOrCreateOwnMap(key); + Meta.prototype.setSourceDestroyed = function setSourceDestroyed() { + this._flags |= SOURCE_DESTROYED; }; - Meta.prototype['readable' + capitalized] = function () { - return this[key]; + + Meta.prototype.isMetaDestroyed = function isMetaDestroyed() { + return (this._flags & META_DESTROYED) !== 0; }; - } - Meta.prototype._getOrCreateOwnMap = function (key) { - var ret = this[key]; - if (!ret) { - ret = this[key] = new _emberUtils.EmptyObject(); - } - return ret; - }; + Meta.prototype.setMetaDestroyed = function setMetaDestroyed() { + this._flags |= META_DESTROYED; + }; - // Implements a member that is a lazily created POJO with inheritable - // values. - function inheritedMap(name, Meta) { - var key = memberProperty(name); - var capitalized = capitalize(name); + Meta.prototype.isProxy = function isProxy() { + return (this._flags & IS_PROXY) !== 0; + }; - Meta.prototype['write' + capitalized] = function (subkey, value) { - _emberMetalDebug.assert('Cannot call write' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); + Meta.prototype.setProxy = function setProxy() { + this._flags |= IS_PROXY; + }; - var map = this._getOrCreateOwnMap(key); - map[subkey] = value; + Meta.prototype._getOrCreateOwnMap = function _getOrCreateOwnMap(key) { + return this[key] || (this[key] = new _emberUtils.EmptyObject()); }; - Meta.prototype['peek' + capitalized] = function (subkey) { - return this._findInherited(key, subkey); + Meta.prototype._getInherited = function _getInherited(key) { + var pointer = this; + while (pointer !== undefined) { + if (pointer[key]) { + return pointer[key]; + } + pointer = pointer.parent; + } }; - Meta.prototype['forEach' + capitalized] = function (fn) { + Meta.prototype._findInherited = function _findInherited(key, subkey) { var pointer = this; - var seen = new _emberUtils.EmptyObject(); while (pointer !== undefined) { var map = pointer[key]; if (map) { - for (var _key in map) { - if (!seen[_key]) { - seen[_key] = true; - fn(_key, map[_key]); - } + var value = map[subkey]; + if (value !== undefined) { + return value; } } pointer = pointer.parent; } }; - Meta.prototype['clear' + capitalized] = function () { - _emberMetalDebug.assert('Cannot call clear' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); + // Implements a member that provides a lazily created map of maps, + // with inheritance at both levels. - this[key] = undefined; - }; + Meta.prototype.writeDeps = function writeDeps(subkey, itemkey, value) { + _emberMetalDebug.assert('Cannot call writeDeps after the object is destroyed.', !this.isMetaDestroyed()); - Meta.prototype['deleteFrom' + capitalized] = function (subkey) { - delete this._getOrCreateOwnMap(key)[subkey]; + var outerMap = this._getOrCreateOwnMap('_deps'); + var innerMap = outerMap[subkey]; + if (!innerMap) { + innerMap = outerMap[subkey] = new _emberUtils.EmptyObject(); + } + innerMap[itemkey] = value; }; - Meta.prototype['hasIn' + capitalized] = function (subkey) { - return this._findInherited(key, subkey) !== undefined; + Meta.prototype.peekDeps = function peekDeps(subkey, itemkey) { + var pointer = this; + while (pointer !== undefined) { + var map = pointer._deps; + if (map) { + var value = map[subkey]; + if (value) { + if (value[itemkey] !== undefined) { + return value[itemkey]; + } + } + } + pointer = pointer.parent; + } }; - } - Meta.prototype._getInherited = function (key) { - var pointer = this; - while (pointer !== undefined) { - if (pointer[key]) { - return pointer[key]; + Meta.prototype.hasDeps = function hasDeps(subkey) { + var pointer = this; + while (pointer !== undefined) { + if (pointer._deps && pointer._deps[subkey]) { + return true; + } + pointer = pointer.parent; } - pointer = pointer.parent; - } - }; + return false; + }; - Meta.prototype._findInherited = function (key, subkey) { - var pointer = this; - while (pointer !== undefined) { - var map = pointer[key]; - if (map) { - var value = map[subkey]; - if (value !== undefined) { - return value; + Meta.prototype.forEachInDeps = function forEachInDeps(subkey, fn) { + return this._forEachIn('_deps', subkey, fn); + }; + + Meta.prototype._forEachIn = function _forEachIn(key, subkey, fn) { + var pointer = this; + var seen = new _emberUtils.EmptyObject(); + var calls = []; + while (pointer !== undefined) { + var map = pointer[key]; + if (map) { + var innerMap = map[subkey]; + if (innerMap) { + for (var innerKey in innerMap) { + if (!seen[innerKey]) { + seen[innerKey] = true; + calls.push([innerKey, innerMap[innerKey]]); + } + } + } } + pointer = pointer.parent; } - pointer = pointer.parent; - } - }; + for (var i = 0; i < calls.length; i++) { + var _calls$i = calls[i]; + var innerKey = _calls$i[0]; + var value = _calls$i[1]; - var UNDEFINED = _emberUtils.symbol('undefined'); + fn(innerKey, value); + } + }; - exports.UNDEFINED = UNDEFINED; - // Implements a member that provides a lazily created map of maps, - // with inheritance at both levels. - Meta.prototype.writeDeps = function writeDeps(subkey, itemkey, value) { - _emberMetalDebug.assert('Cannot call writeDeps after the object is destroyed.', !this.isMetaDestroyed()); + Meta.prototype.readInheritedValue = function readInheritedValue(key, subkey) { + var internalKey = '_' + key; - var outerMap = this._getOrCreateOwnMap('_deps'); - var innerMap = outerMap[subkey]; - if (!innerMap) { - innerMap = outerMap[subkey] = new _emberUtils.EmptyObject(); - } - innerMap[itemkey] = value; - }; + var pointer = this; - Meta.prototype.peekDeps = function peekDeps(subkey, itemkey) { - var pointer = this; - while (pointer !== undefined) { - var map = pointer._deps; - if (map) { - var value = map[subkey]; - if (value) { - if (value[itemkey] !== undefined) { - return value[itemkey]; + 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; } - pointer = pointer.parent; - } - }; - Meta.prototype.hasDeps = function hasDeps(subkey) { - var pointer = this; - while (pointer !== undefined) { - if (pointer._deps && pointer._deps[subkey]) { - return true; + return UNDEFINED; + }; + + Meta.prototype.writeValue = function writeValue(obj, key, value) { + var descriptor = _emberUtils.lookupDescriptor(obj, key); + var isMandatorySetter = descriptor && descriptor.set && descriptor.set.isMandatorySetter; + + if (isMandatorySetter) { + this.writeValues(key, value); + } else { + obj[key] = value; } - pointer = pointer.parent; - } - return false; - }; + }; - Meta.prototype.forEachInDeps = function forEachInDeps(subkey, fn) { - return this._forEachIn('_deps', subkey, fn); - }; + return Meta; + })(); - Meta.prototype._forEachIn = function (key, subkey, fn) { - var pointer = this; - var seen = new _emberUtils.EmptyObject(); - var calls = []; - while (pointer !== undefined) { - var map = pointer[key]; - if (map) { - var innerMap = map[subkey]; - if (innerMap) { - for (var innerKey in innerMap) { - if (!seen[innerKey]) { - seen[innerKey] = true; - calls.push([innerKey, innerMap[innerKey]]); + exports.Meta = Meta; + + var NODE_STACK = []; + + for (var _name in _emberMetalMeta_listeners.protoMethods) { + Meta.prototype[_name] = _emberMetalMeta_listeners.protoMethods[_name]; + } + memberNames.forEach(function (name) { + return members[name](name, Meta); + }); + + // Implements a member that is a lazily created, non-inheritable + // POJO. + function ownMap(name, Meta) { + var key = memberProperty(name); + var capitalized = capitalize(name); + Meta.prototype['writable' + capitalized] = function () { + return this._getOrCreateOwnMap(key); + }; + Meta.prototype['readable' + capitalized] = function () { + return this[key]; + }; + } + + // Implements a member that is a lazily created POJO with inheritable + // values. + function inheritedMap(name, Meta) { + var key = memberProperty(name); + var capitalized = capitalize(name); + + Meta.prototype['write' + capitalized] = function (subkey, value) { + _emberMetalDebug.assert('Cannot call write' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); + + var map = this._getOrCreateOwnMap(key); + map[subkey] = value; + }; + + Meta.prototype['peek' + capitalized] = function (subkey) { + return this._findInherited(key, subkey); + }; + + Meta.prototype['forEach' + capitalized] = function (fn) { + var pointer = this; + var seen = new _emberUtils.EmptyObject(); + while (pointer !== undefined) { + var map = pointer[key]; + if (map) { + for (var _key in map) { + if (!seen[_key]) { + seen[_key] = true; + fn(_key, map[_key]); } } } + pointer = pointer.parent; } - pointer = pointer.parent; - } - for (var i = 0; i < calls.length; i++) { - var _calls$i = calls[i]; - var innerKey = _calls$i[0]; - var value = _calls$i[1]; + }; - fn(innerKey, value); - } - }; + Meta.prototype['clear' + capitalized] = function () { + _emberMetalDebug.assert('Cannot call clear' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); + this[key] = undefined; + }; + + Meta.prototype['deleteFrom' + capitalized] = function (subkey) { + delete this._getOrCreateOwnMap(key)[subkey]; + }; + + Meta.prototype['hasIn' + capitalized] = function (subkey) { + return this._findInherited(key, subkey) !== undefined; + }; + } + + var UNDEFINED = _emberUtils.symbol('undefined'); + + exports.UNDEFINED = UNDEFINED; // Implements a member that provides a non-heritable, lazily-created // object using the method you provide. function ownCustomObject(name, Meta) { @@ -6956,24 +7297,11 @@ enifed('ember-metal/meta', ['exports', 'ember-utils', 'ember-metal/features', 'e }; } - var HAS_NATIVE_WEAKMAP = (function () { - // detect if `WeakMap` is even present - var hasWeakMap = typeof WeakMap === 'function'; - if (!hasWeakMap) { - return false; - } - - var instance = new WeakMap(); - // use `Object`'s `.toString` directly to prevent us from detecting - // polyfills as native weakmaps - return Object.prototype.toString.call(instance) === '[object WeakMap]'; - })(); - var setMeta = undefined, peekMeta = undefined; // choose the one appropriate for given platform - if (HAS_NATIVE_WEAKMAP) { + if (_emberUtils.HAS_NATIVE_WEAKMAP) { (function () { var getPrototypeOf = Object.getPrototypeOf; var metaStore = new WeakMap(); @@ -7275,7 +7603,6 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb */ exports.detectBinding = detectBinding; exports.mixin = mixin; - exports.default = Mixin; exports.hasUnprocessedMixins = hasUnprocessedMixins; exports.clearUnprocessedMixins = clearUnprocessedMixins; exports.required = required; @@ -7287,7 +7614,9 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb function ROOT() {} ROOT.__hasSuper = false; - var a_slice = [].slice; + var a_slice = Array.prototype.slice; + var a_concat = Array.prototype.concat; + var isArray = Array.isArray; function isMethod(obj) { return 'function' === typeof obj && obj.isMethod !== false && obj !== Boolean && obj !== Object && obj !== Number && obj !== Array && obj !== Date && obj !== String; @@ -7311,14 +7640,11 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb } function concatenatedMixinProperties(concatProp, props, values, base) { - var concats = undefined; - // reset before adding each new mixin to pickup concats from previous - concats = values[concatProp] || base[concatProp]; + var concats = values[concatProp] || base[concatProp]; if (props[concatProp]) { - concats = concats ? concats.concat(props[concatProp]) : props[concatProp]; + concats = concats ? a_concat.call(concats, props[concatProp]) : props[concatProp]; } - return concats; } @@ -7383,27 +7709,39 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb function applyConcatenatedProperties(obj, key, value, values) { var baseValue = values[key] || obj[key]; + var ret = undefined; - if (baseValue) { - if ('function' === typeof baseValue.concat) { + if (baseValue === null || baseValue === undefined) { + ret = _emberUtils.makeArray(value); + } else { + if (isArray(baseValue)) { if (value === null || value === undefined) { - return baseValue; + ret = baseValue; } else { - return baseValue.concat(value); + ret = a_concat.call(baseValue, value); } } else { - return _emberUtils.makeArray(baseValue).concat(value); + ret = a_concat.call(_emberUtils.makeArray(baseValue), value); } - } else { - return _emberUtils.makeArray(value); } + + _emberMetalDebug.runInDebug(function () { + // it is possible to use concatenatedProperties with strings (which cannot be frozen) + // only freeze objects... + if (typeof ret === 'object' && ret !== null) { + // prevent mutating `concatenatedProperties` array after it is applied + Object.freeze(ret); + } + }); + + return ret; } function applyMergedProperties(obj, key, value, values) { var baseValue = values[key] || obj[key]; _emberMetalDebug.runInDebug(function () { - if (Array.isArray(value)) { + if (isArray(value)) { // use conditional to avoid stringifying every time _emberMetalDebug.assert('You passed in `' + JSON.stringify(value) + '` as the value for `' + key + '` but `' + key + '` cannot be an Array', false); } @@ -7672,9 +8010,6 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb return obj; } - var NAME_KEY = _emberUtils.GUID_KEY + '_name'; - - exports.NAME_KEY = NAME_KEY; /** The `Ember.Mixin` class allows you to create mixins, whose properties can be added to other classes. For instance, @@ -7733,40 +8068,85 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb @public */ - function Mixin(args, properties) { - this.properties = properties; + var Mixin = (function () { + function Mixin(args, properties) { + this.properties = properties; - var length = args && args.length; + var length = args && args.length; - if (length > 0) { - var m = new Array(length); + if (length > 0) { + var m = new Array(length); - for (var i = 0; i < length; i++) { - var x = args[i]; - if (x instanceof Mixin) { - m[i] = x; - } else { - m[i] = new Mixin(undefined, x); + for (var i = 0; i < length; i++) { + var x = args[i]; + if (x instanceof Mixin) { + m[i] = x; + } else { + m[i] = new Mixin(undefined, x); + } } - } - this.mixins = m; - } else { - this.mixins = undefined; + this.mixins = m; + } else { + this.mixins = undefined; + } + this.ownerConstructor = undefined; + this._without = undefined; + this[_emberUtils.GUID_KEY] = null; + this[_emberUtils.NAME_KEY] = null; + _emberMetalDebug.debugSeal(this); } - this.ownerConstructor = undefined; - this._without = undefined; - this[_emberUtils.GUID_KEY] = null; - this[NAME_KEY] = null; - _emberMetalDebug.debugSeal(this); - } - Mixin._apply = applyMixin; + Mixin.applyPartial = function applyPartial(obj) { + var args = a_slice.call(arguments, 1); + return applyMixin(obj, args, true); + }; - Mixin.applyPartial = function (obj) { - var args = a_slice.call(arguments, 1); - return applyMixin(obj, args, true); - }; + /** + @method create + @static + @param arguments* + @public + */ + + Mixin.create = function create() { + // ES6TODO: this relies on a global state? + unprocessedFlag = true; + var M = this; + + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return new M(args, undefined); + }; + + // returns the mixins currently applied to the specified object + // TODO: Make Ember.mixin + + Mixin.mixins = function mixins(obj) { + var m = _emberMetalMeta.peekMeta(obj); + var ret = []; + if (!m) { + return ret; + } + + m.forEachMixins(function (key, currentMixin) { + // skip primitive mixins since these are always anonymous + if (!currentMixin.properties) { + ret.push(currentMixin); + } + }); + + return ret; + }; + + return Mixin; + })(); + + exports.default = Mixin; + + Mixin._apply = applyMixin; Mixin.finishPartial = finishPartial; @@ -7780,24 +8160,6 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb unprocessedFlag = false; } - /** - @method create - @static - @param arguments* - @public - */ - Mixin.create = function () { - // ES6TODO: this relies on a global state? - unprocessedFlag = true; - var M = this; - - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - return new M(args, undefined); - }; - var MixinPrototype = Mixin.prototype; /** @@ -7931,25 +8293,6 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb _emberMetalDebug.debugSeal(MixinPrototype); - // returns the mixins currently applied to the specified object - // TODO: Make Ember.mixin - Mixin.mixins = function (obj) { - var m = _emberMetalMeta.peekMeta(obj); - var ret = []; - if (!m) { - return ret; - } - - m.forEachMixins(function (key, currentMixin) { - // skip primitive mixins since these are always anonymous - if (!currentMixin.properties) { - ret.push(currentMixin); - } - }); - - return ret; - }; - var REQUIRED = new _emberMetalProperties.Descriptor(); REQUIRED.toString = function () { return '(Required Property)'; @@ -8153,7 +8496,6 @@ enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'emb } exports.Mixin = Mixin; - exports.required = required; exports.REQUIRED = REQUIRED; }); enifed('ember-metal/observer', ['exports', 'ember-metal/watching', 'ember-metal/events'], function (exports, _emberMetalWatching, _emberMetalEvents) { @@ -8273,8 +8615,6 @@ enifed('ember-metal/observer', ['exports', 'ember-metal/watching', 'ember-metal/ enifed('ember-metal/observer_set', ['exports', 'ember-utils', 'ember-metal/events'], function (exports, _emberUtils, _emberMetalEvents) { 'use strict'; - exports.default = ObserverSet; - /* this.observerSet = { [senderGuid]: { // variable name: `keySet` @@ -8294,56 +8634,62 @@ enifed('ember-metal/observer_set', ['exports', 'ember-utils', 'ember-metal/event ] */ - function ObserverSet() { - this.clear(); - } + var ObserverSet = (function () { + function ObserverSet() { + this.clear(); + } - ObserverSet.prototype.add = function (sender, keyName, eventName) { - var observerSet = this.observerSet; - var observers = this.observers; - var senderGuid = _emberUtils.guidFor(sender); - var keySet = observerSet[senderGuid]; - var index = undefined; + ObserverSet.prototype.add = function add(sender, keyName, eventName) { + var observerSet = this.observerSet; + var observers = this.observers; + var senderGuid = _emberUtils.guidFor(sender); + var keySet = observerSet[senderGuid]; + var index = undefined; - if (!keySet) { - observerSet[senderGuid] = keySet = {}; - } - index = keySet[keyName]; - if (index === undefined) { - index = observers.push({ - sender: sender, - keyName: keyName, - eventName: eventName, - listeners: [] - }) - 1; - keySet[keyName] = index; - } - return observers[index].listeners; - }; + if (!keySet) { + observerSet[senderGuid] = keySet = {}; + } + index = keySet[keyName]; + if (index === undefined) { + index = observers.push({ + sender: sender, + keyName: keyName, + eventName: eventName, + listeners: [] + }) - 1; + keySet[keyName] = index; + } + return observers[index].listeners; + }; - ObserverSet.prototype.flush = function () { - var observers = this.observers; - var i = undefined, - observer = undefined, - sender = undefined; - this.clear(); - for (i = 0; i < observers.length; ++i) { - observer = observers[i]; - sender = observer.sender; - if (sender.isDestroying || sender.isDestroyed) { - continue; + ObserverSet.prototype.flush = function flush() { + var observers = this.observers; + var i = undefined, + observer = undefined, + sender = undefined; + this.clear(); + for (i = 0; i < observers.length; ++i) { + observer = observers[i]; + sender = observer.sender; + if (sender.isDestroying || sender.isDestroyed) { + continue; + } + _emberMetalEvents.sendEvent(sender, observer.eventName, [sender, observer.keyName], observer.listeners); } - _emberMetalEvents.sendEvent(sender, observer.eventName, [sender, observer.keyName], observer.listeners); - } - }; + }; - ObserverSet.prototype.clear = function () { - this.observerSet = {}; - this.observers = []; - }; -}); -enifed('ember-metal/path_cache', ['exports', 'ember-metal/cache'], function (exports, _emberMetalCache) { - 'use strict'; + ObserverSet.prototype.clear = function clear() { + this.observerSet = {}; + this.observers = []; + }; + + return ObserverSet; + })(); + + exports.default = ObserverSet; +}); +enifed('ember-metal/path_cache', ['exports', 'ember-metal/cache'], function (exports, _emberMetalCache) { + 'use strict'; exports.isGlobal = isGlobal; exports.isGlobalPath = isGlobalPath; @@ -9975,7 +10321,7 @@ enifed('ember-metal/set_properties', ['exports', 'ember-metal/property_events', return properties; } }); -enifed('ember-metal/tags', ['exports', 'glimmer-reference', 'ember-metal/meta', 'require', 'ember-metal/is_proxy'], function (exports, _glimmerReference, _emberMetalMeta, _require, _emberMetalIs_proxy) { +enifed('ember-metal/tags', ['exports', '@glimmer/reference', 'ember-metal/meta', 'require', 'ember-metal/is_proxy'], function (exports, _glimmerReference, _emberMetalMeta, _require, _emberMetalIs_proxy) { 'use strict'; exports.setHasViews = setHasViews; @@ -10078,29 +10424,21 @@ enifed('ember-metal/transaction', ['exports', 'ember-metal/meta', 'ember-metal/d didRender = undefined, assertNotRendered = undefined; - var raise = _emberMetalDebug.assert; - if (_emberMetalFeatures.default('ember-glimmer-allow-backtracking-rerender')) { - raise = function (message, test) { - _emberMetalDebug.deprecate(message, test, { id: 'ember-views.render-double-modify', until: '3.0.0' }); - }; - } - - var implication = undefined; - if (_emberMetalFeatures.default('ember-glimmer-allow-backtracking-rerender')) { - implication = 'will be removed in Ember 3.0.'; - } else if (_emberMetalFeatures.default('ember-glimmer-detect-backtracking-rerender')) { - implication = 'is no longer supported. See https://github.com/emberjs/ember.js/issues/13948 for more details.'; - } - + // detect-backtracking-rerender by default is debug build only + // detect-glimmer-allow-backtracking-rerender can be enabled in custom builds if (_emberMetalFeatures.default('ember-glimmer-detect-backtracking-rerender') || _emberMetalFeatures.default('ember-glimmer-allow-backtracking-rerender')) { (function () { var counter = 0; var inTransaction = false; var shouldReflush = undefined; + var debugStack = undefined; exports.default = runInTransaction = function (context, methodName) { shouldReflush = false; inTransaction = true; + _emberMetalDebug.runInDebug(function () { + debugStack = context.env.debugStack; + }); context[methodName](); inTransaction = false; counter++; @@ -10116,8 +10454,13 @@ enifed('ember-metal/transaction', ['exports', 'ember-metal/meta', 'ember-metal/d lastRendered[key] = counter; _emberMetalDebug.runInDebug(function () { - var lastRenderedFrom = meta.writableLastRenderedFrom(); - lastRenderedFrom[key] = reference; + var referenceMap = meta.writableLastRenderedReferenceMap(); + referenceMap[key] = reference; + + var templateMap = meta.writableLastRenderedTemplateMap(); + if (templateMap[key] === undefined) { + templateMap[key] = debugStack.peek(); + } }); }; @@ -10126,11 +10469,14 @@ enifed('ember-metal/transaction', ['exports', 'ember-metal/meta', 'ember-metal/d var lastRendered = meta.readableLastRendered(); if (lastRendered && lastRendered[key] === counter) { - raise((function () { - var ref = meta.readableLastRenderedFrom(); - var parts = []; - var lastRef = ref[key]; + _emberMetalDebug.runInDebug(function () { + var templateMap = meta.readableLastRenderedTemplateMap(); + var lastRenderedIn = templateMap[key]; + var currentlyIn = debugStack.peek(); + var referenceMap = meta.readableLastRenderedReferenceMap(); + var lastRef = referenceMap[key]; + var parts = []; var label = undefined; if (lastRef) { @@ -10139,29 +10485,29 @@ enifed('ember-metal/transaction', ['exports', 'ember-metal/meta', 'ember-metal/d lastRef = lastRef._parentReference; } - label = parts.join(); + label = parts.join('.'); } else { label = 'the same value'; } - return 'You modified ' + parts.join('.') + ' twice on ' + object + ' in a single render. This was unreliable and slow in Ember 1.x and ' + implication; - })(), false); + var message = 'You modified "' + label + '" twice on ' + object + ' in a single render. It was rendered in ' + lastRenderedIn + ' and modified in ' + currentlyIn + '. This was unreliable and slow in Ember 1.x and'; + + if (_emberMetalFeatures.default('ember-glimmer-allow-backtracking-rerender')) { + _emberMetalDebug.deprecate(message + ' will be removed in Ember 3.0.', false, { id: 'ember-views.render-double-modify', until: '3.0.0' }); + } else { + _emberMetalDebug.assert(message + ' is no longer supported. See https://github.com/emberjs/ember.js/issues/13948 for more details.', false); + } + }); shouldReflush = true; } }; })(); } else { - exports.default = runInTransaction = function () { - throw new Error('Cannot call runInTransaction without Glimmer'); - }; - - exports.didRender = didRender = function () { - throw new Error('Cannot call didRender without Glimmer'); - }; - - exports.assertNotRendered = assertNotRendered = function () { - throw new Error('Cannot call assertNotRendered without Glimmer'); + // in production do nothing to detect reflushes + exports.default = runInTransaction = function (context, methodName) { + context[methodName](); + return false; }; } @@ -10685,21 +11031,22 @@ enifed('ember-runtime/compare', ['exports', 'ember-runtime/utils', 'ember-runtim return spaceship(v.localeCompare(w), 0); case 'array': - var vLen = v.length; - var wLen = w.length; - var len = Math.min(vLen, wLen); - - for (var i = 0; i < len; i++) { - var r = compare(v[i], w[i]); - if (r !== 0) { - return r; + { + var vLen = v.length; + var wLen = w.length; + var len = Math.min(vLen, wLen); + + for (var i = 0; i < len; i++) { + var r = compare(v[i], w[i]); + if (r !== 0) { + return r; + } } - } - - // all elements are equal now - // shorter array should be ordered first - return spaceship(vLen, wLen); + // all elements are equal now + // shorter array should be ordered first + return spaceship(vLen, wLen); + } case 'instance': if (_emberRuntimeMixinsComparable.default && _emberRuntimeMixinsComparable.default.detect(v)) { return v.compare(v, w); @@ -10993,16 +11340,16 @@ enifed('ember-runtime/computed/computed_macros', ['exports', 'ember-metal'], fun ```javascript let Hamster = Ember.Object.extend({ - napTime: Ember.computed.equal('state', 'sleepy') + satisfied: Ember.computed.equal('percentCarrotsEaten', 100) }); let hamster = Hamster.create(); - hamster.get('napTime'); // false - hamster.set('state', 'sleepy'); - hamster.get('napTime'); // true - hamster.set('state', 'hungry'); - hamster.get('napTime'); // false + hamster.get('satisfied'); // false + hamster.set('percentCarrotsEaten', 100); + hamster.get('satisfied'); // true + hamster.set('percentCarrotsEaten', 50); + hamster.get('satisfied'); // false ``` @method equal @@ -12145,7 +12492,7 @@ enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-utils if (activeObservers) { activeObservers.forEach(function (args) { - return _emberMetal.removeObserver.apply(null, args); + return _emberMetal.removeObserver.apply(undefined, args); }); } @@ -12158,7 +12505,7 @@ enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-utils var path = itemsKeyIsAtThis ? '@each.' + prop : itemsKey + '.@each.' + prop; var args = [_this5, path, sortPropertyDidChange]; - _emberMetal.addObserver.apply(null, args); + _emberMetal.addObserver.apply(undefined, args); return args; }); @@ -12916,7 +13263,7 @@ enifed('ember-runtime/is-equal', ['exports'], function (exports) { return a === b; } }); -enifed('ember-runtime/mixins/-proxy', ['exports', 'glimmer-reference', 'ember-metal', 'ember-runtime/computed/computed_macros'], function (exports, _glimmerReference, _emberMetal, _emberRuntimeComputedComputed_macros) { +enifed('ember-runtime/mixins/-proxy', ['exports', '@glimmer/reference', 'ember-metal', 'ember-runtime/computed/computed_macros'], function (exports, _glimmerReference, _emberMetal, _emberRuntimeComputedComputed_macros) { /** @module ember @submodule ember-runtime @@ -13199,8 +13546,6 @@ enifed('ember-runtime/mixins/action_handler', ['exports', 'ember-metal'], functi args[_key - 1] = arguments[_key]; } - var target = undefined; - if (this.actions && this.actions[actionName]) { var shouldBubble = this.actions[actionName].apply(this, args) === true; if (!shouldBubble) { @@ -13208,11 +13553,10 @@ enifed('ember-runtime/mixins/action_handler', ['exports', 'ember-metal'], functi } } - if (target = _emberMetal.get(this, 'target')) { - var _target; - + var target = _emberMetal.get(this, 'target'); + if (target) { _emberMetal.assert('The `target` for ' + this + ' (' + target + ') does not have a `send` method', typeof target.send === 'function'); - (_target = target).send.apply(_target, arguments); + target.send.apply(target, arguments); } }, @@ -13463,9 +13807,7 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-utils', 'ember-metal', ' }).readOnly(), _Mixin$create.lastObject = _emberMetal.computed(function () { return objectAt(this, _emberMetal.get(this, 'length') - 1); }).readOnly(), _Mixin$create.contains = function (obj) { - if (_emberMetal.isFeatureEnabled('ember-runtime-enumerable-includes')) { - _emberMetal.deprecate('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.', false, { id: 'ember-runtime.enumerable-contains', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_enumerable-contains' }); - } + _emberMetal.deprecate('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.', false, { id: 'ember-runtime.enumerable-contains', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_enumerable-contains' }); return this.indexOf(obj) >= 0; }, _Mixin$create.slice = function (beginIndex, endIndex) { @@ -13539,6 +13881,27 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-utils', 'ember-metal', ' return arrayContentWillChange(this, startIdx, removeAmt, addAmt); }, _Mixin$create.arrayContentDidChange = function (startIdx, removeAmt, addAmt) { return arrayContentDidChange(this, startIdx, removeAmt, addAmt); + }, _Mixin$create.includes = function (obj, startAt) { + var len = _emberMetal.get(this, 'length'); + + if (startAt === undefined) { + startAt = 0; + } + + if (startAt < 0) { + startAt += len; + } + + for (var idx = startAt; idx < len; idx++) { + var currentObj = objectAt(this, idx); + + // SameValueZero comparison (NaN !== NaN) + if (obj === currentObj || obj !== obj && currentObj !== currentObj) { + return true; + } + } + + return false; }, _Mixin$create['@each'] = _emberMetal.computed(function () { // TODO use Symbol or add to meta if (!this.__each) { @@ -13548,55 +13911,6 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-utils', 'ember-metal', ' return this.__each; }).volatile().readOnly(), _Mixin$create)); - if (_emberMetal.isFeatureEnabled('ember-runtime-enumerable-includes')) { - 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 = _emberMetal.get(this, 'length'); - - if (startAt === undefined) { - startAt = 0; - } - - if (startAt < 0) { - startAt += len; - } - - for (var idx = startAt; idx < len; idx++) { - var 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 @@ -13633,7 +13947,7 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-utils', 'ember-metal', ' /** This returns the objects at the specified indexes, using `objectAt`. ```javascript - let arr = ['a', 'b', 'c', 'd']; + let arr = ['a', 'b', 'c', 'd']; arr.objectsAt([0, 1, 2]); // ['a', 'b', 'c'] arr.objectsAt([2, 3, 4]); // ['c', 'd', undefined] ``` @@ -13792,6 +14106,29 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-utils', 'ember-metal', ' @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 +*/ + /** 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 @@ -13851,13 +14188,15 @@ enifed('ember-runtime/mixins/comparable', ['exports', 'ember-metal'], function ( compare: null }); }); -enifed('ember-runtime/mixins/container_proxy', ['exports', 'ember-metal'], function (exports, _emberMetal) { +enifed('ember-runtime/mixins/container_proxy', ['exports', 'ember-metal', 'container'], function (exports, _emberMetal, _container) { /** @module ember @submodule ember-runtime */ 'use strict'; + var _containerProxyMixin; + /** ContainerProxyMixin is used to provide public access to specific container functionality. @@ -13865,7 +14204,7 @@ enifed('ember-runtime/mixins/container_proxy', ['exports', 'ember-metal'], funct @class ContainerProxyMixin @private */ - exports.default = _emberMetal.Mixin.create({ + var containerProxyMixin = (_containerProxyMixin = { /** The container stores state. @private @@ -13886,6 +14225,7 @@ enifed('ember-runtime/mixins/container_proxy', ['exports', 'ember-metal'], funct ``` @public @method ownerInjection + @since 2.3.0 @return {Object} */ ownerInjection: function () { @@ -13936,34 +14276,51 @@ enifed('ember-runtime/mixins/container_proxy', ['exports', 'ember-metal'], funct */ _lookupFactory: function (fullName, options) { return this.__container__.lookupFactory(fullName, options); - }, + } - /** - Given a name and a source path, resolve the fullName - @private - @method _resolveLocalLookupName - @param {String} fullName - @param {String} source - @return {String} - */ - _resolveLocalLookupName: function (name, source) { - return this.__container__.registry.expandLocalLookup('component:' + name, { - source: source - }); - }, + }, _containerProxyMixin[_container.FACTORY_FOR] = function () { + var _container__; - /** - @private - */ - willDestroy: function () { - this._super.apply(this, arguments); + return (_container__ = this.__container__)[_container.FACTORY_FOR].apply(_container__, arguments); + }, _containerProxyMixin[_container.LOOKUP_FACTORY] = function () { + var _container__2; - if (this.__container__) { - _emberMetal.run(this.__container__, 'destroy'); - } + return (_container__2 = this.__container__)[_container.LOOKUP_FACTORY].apply(_container__2, arguments); + }, _containerProxyMixin._resolveLocalLookupName = function (name, source) { + return this.__container__.registry.expandLocalLookup('component:' + name, { + source: source + }); + }, _containerProxyMixin.willDestroy = function () { + this._super.apply(this, arguments); + + if (this.__container__) { + _emberMetal.run(this.__container__, 'destroy'); } - }); + }, _containerProxyMixin); + + if (_emberMetal.isFeatureEnabled('ember-factory-for')) { + containerProxyMixin.factoryFor = function ContainerProxyMixin_factoryFor(fullName) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + return this.__container__.factoryFor(fullName, options); + }; + } + + exports.default = _emberMetal.Mixin.create(containerProxyMixin); }); + +/** + Given a name and a source path, resolve the fullName + @private + @method _resolveLocalLookupName + @param {String} fullName + @param {String} source + @return {String} + */ + +/** + @private + */ enifed('ember-runtime/mixins/controller', ['exports', 'ember-metal', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/controller_content_model_alias_deprecation'], function (exports, _emberMetal, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsController_content_model_alias_deprecation) { 'use strict'; @@ -14308,9 +14665,7 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-utils', 'ember-meta @public */ contains: function (obj) { - if (_emberMetal.isFeatureEnabled('ember-runtime-enumerable-includes')) { - _emberMetal.deprecate('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.', false, { id: 'ember-runtime.enumerable-contains', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_enumerable-contains' }); - } + _emberMetal.deprecate('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.', false, { id: 'ember-runtime.enumerable-contains', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_enumerable-contains' }); var found = this.find(function (item) { return item === obj; @@ -14573,7 +14928,8 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-utils', 'ember-meta for (var idx = 0; idx < len && !found; idx++) { next = this.nextObject(idx, last, context); - if (found = callback.call(target, next, idx, this)) { + found = callback.call(target, next, idx, this); + if (found) { ret = next; } @@ -14830,14 +15186,15 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-utils', 'ember-meta @public */ without: function (value) { - if (!this.contains(value)) { + if (!this.includes(value)) { return this; // nothing to do } var ret = emberA(); this.forEach(function (k) { - if (k !== value) { + // SameValueZero comparison (NaN !== NaN) + if (!(k === value || k !== k && value !== value)) { ret[ret.length] = k; } }); @@ -15093,99 +15450,74 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-utils', 'ember-meta } return 0; }); - } - }); + }, - if (_emberMetal.isFeatureEnabled('ember-runtime-computed-uniq-by')) { - 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 - let 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 _emberUtils.EmptyObject(); - - this.forEach(function (item) { - var guid = _emberUtils.guidFor(_emberMetal.get(item, key)); - if (!(guid in seen)) { - seen[guid] = true; - ret.push(item); - } - }); + /** + 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 + let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }]; + arr.uniqBy('value'); // [{ value: 'a' }, { value: 'b' }] + ``` + @method uniqBy + @return {Ember.Enumerable} + @public + */ - return ret; - } - }); - } + uniqBy: function (key) { + var ret = emberA(); + var seen = new _emberUtils.EmptyObject(); - if (_emberMetal.isFeatureEnabled('ember-runtime-enumerable-includes')) { - 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) { - _emberMetal.assert('Enumerable#includes cannot accept a second argument "startAt" as enumerable items are unordered.', arguments.length === 1); - - var len = _emberMetal.get(this, 'length'); - var idx = undefined, - next = undefined; - 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; + this.forEach(function (item) { + var guid = _emberUtils.guidFor(_emberMetal.get(item, key)); + if (!(guid in seen)) { + seen[guid] = true; + ret.push(item); } + }); - next = last = null; - context = pushCtx(context); + return ret; + }, - return found; - }, + /** + 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) { + _emberMetal.assert('Enumerable#includes cannot accept a second argument "startAt" as enumerable items are unordered.', arguments.length === 1); - without: function (value) { - if (!this.includes(value)) { - return this; // nothing to do - } + var len = _emberMetal.get(this, 'length'); + var idx = undefined, + next = undefined; + var last = null; + var found = false; - var ret = emberA(); + var context = popCtx(); - this.forEach(function (k) { - // SameValueZero comparison (NaN !== NaN) - if (!(k === value || k !== k && value !== value)) { - ret[ret.length] = k; - } - }); + for (idx = 0; idx < len && !found; idx++) { + next = this.nextObject(idx, last, context); - return ret; + found = obj === next || obj !== obj && next !== next; + + last = next; } - }); - } + + next = last = null; + context = pushCtx(context); + + return found; + } + }); exports.default = Enumerable; }); @@ -15513,9 +15845,9 @@ enifed('ember-runtime/mixins/mutable_array', ['exports', 'ember-metal', 'ember-r want to reuse an existing array without having to recreate it. ```javascript let colors = ['red', 'green', 'blue']; - color.length(); // 3 - colors.clear(); // [] - colors.length(); // 0 + colors.length; // 3 + colors.clear(); // [] + colors.length; // 0 ``` @method clear @return {Ember.Array} An empty Array. @@ -15779,13 +16111,7 @@ enifed('ember-runtime/mixins/mutable_array', ['exports', 'ember-metal', 'ember-r @public */ addObject: function (obj) { - var included = undefined; - - if (_emberMetal.isFeatureEnabled('ember-runtime-enumerable-includes')) { - included = this.includes(obj); - } else { - included = this.contains(obj); - } + var included = this.includes(obj); if (!included) { this.pushObject(obj); @@ -16042,7 +16368,7 @@ enifed('ember-runtime/mixins/observable', ['exports', 'ember-metal'], function ( args[_key] = arguments[_key]; } - return _emberMetal.getProperties.apply(null, [this].concat(args)); + return _emberMetal.getProperties.apply(undefined, [this].concat(args)); }, /** @@ -16198,27 +16524,24 @@ enifed('ember-runtime/mixins/observable', ['exports', 'ember-metal'], function ( will be notified. Note that the observers are triggered any time the value is set, regardless of whether it has actually changed. Your observer should be prepared to handle that. - You can also pass an optional context parameter to this method. The - context will be passed to your observer method whenever it is triggered. - Note that if you add the same target/method pair on a key multiple times - with different context parameters, your observer will only be called once - with the last context you passed. ### Observer Methods - Observer methods you pass should generally have the following signature if - you do not pass a `context` parameter: + Observer methods have the following signature: ```javascript - fooDidChange: function(sender, key, value, rev) { }; + export default Ember.Component.extend({ + init() { + this._super(...arguments); + this.addObserver('foo', this, 'fooDidChange'); + }, + fooDidChange(sender, key, value, rev) { + // your code + } + }); ``` - The sender is the object that changed. The key is the property that - changes. The value property is currently reserved and unused. The rev + The `sender` is the object that changed. The `key` is the property that + changes. The `value` property is currently reserved and unused. The `rev` is the last property revision of the object when it changed, which you can use to detect if the key value has really changed or not. - If you pass a `context` parameter, the context will be passed before the - revision like so: - ```javascript - fooDidChange: function(sender, key, value, context, rev) { }; - ``` - Usually you will not need the value, context or revision parameters at + Usually you will not need the value or revision parameters at the end. In this case, it is common to write observer methods that take only a sender and key value as parameters or, if you aren't interested in any of these values, to write an observer that has no parameters at all. @@ -16692,7 +17015,7 @@ enifed('ember-runtime/mixins/registry_proxy', ['exports', 'ember-metal'], functi let App = Ember.Application.create(); let appInstance = App.buildInstance(); // if all of type `connection` must not be singletons - appInstance.optionsForType('connection', { singleton: false }); + appInstance.registerOptionsForType('connection', { singleton: false }); appInstance.register('connection:twitter', TwitterConnection); appInstance.register('connection:facebook', FacebookConnection); let twitter = appInstance.lookup('connection:twitter'); @@ -16916,10 +17239,14 @@ enifed('ember-runtime/mixins/target_action_support', ['exports', 'ember-environm var ret = undefined; if (target.send) { - ret = target.send.apply(target, args(actionContext, action)); + var _target; + + ret = (_target = target).send.apply(_target, args(actionContext, action)); } else { + var _target2; + _emberMetal.assert('The action \'' + action + '\' did not exist on ' + target, typeof target[action] === 'function'); - ret = target[action].apply(target, args(actionContext)); + ret = (_target2 = target)[action].apply(_target2, args(actionContext)); } if (ret !== false) { @@ -17366,7 +17693,7 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met // using ember-metal/lib/main here to ensure that ember-debug is setup // if present - var _Mixin$create; + var _Mixin$create, _ClassMixinProps; var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['.'], ['.']); @@ -17385,133 +17712,137 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met // possible. var wasApplied = false; - var initProperties; - - var Class = function () { - if (!wasApplied) { - Class.proto(); // prepare prototype... - } + var initProperties = undefined; - if (arguments.length > 0) { - initProperties = [arguments[0]]; - } + var Class = (function () { + function Class() { + if (!wasApplied) { + Class.proto(); // prepare prototype... + } - this.__defineNonEnumerable(_emberUtils.GUID_KEY_PROPERTY); - var m = _emberMetal.meta(this); - var proto = m.proto; - m.proto = this; - if (initProperties) { - // capture locally so we can clear the closed over variable - var props = initProperties; - initProperties = null; + if (arguments.length > 0) { + initProperties = [arguments[0]]; + } - var concatenatedProperties = this.concatenatedProperties; - var mergedProperties = this.mergedProperties; + this.__defineNonEnumerable(_emberUtils.GUID_KEY_PROPERTY); + var m = _emberMetal.meta(this); + var proto = m.proto; + m.proto = this; + if (initProperties) { + // capture locally so we can clear the closed over variable + var props = initProperties; + initProperties = null; - for (var i = 0; i < props.length; i++) { - var properties = props[i]; + var concatenatedProperties = this.concatenatedProperties; + var mergedProperties = this.mergedProperties; - _emberMetal.assert('Ember.Object.create no longer supports mixing in other ' + 'definitions, use .extend & .create separately instead.', !(properties instanceof _emberMetal.Mixin)); + for (var i = 0; i < props.length; i++) { + var properties = props[i]; + _emberMetal.assert('Ember.Object.create no longer supports mixing in other ' + 'definitions, use .extend & .create separately instead.', !(properties instanceof _emberMetal.Mixin)); - if (typeof properties !== 'object' && properties !== undefined) { - throw new _emberMetal.Error('Ember.Object.create only accepts objects.'); - } + if (typeof properties !== 'object' && properties !== undefined) { + throw new _emberMetal.Error('Ember.Object.create only accepts objects.'); + } - if (!properties) { - continue; - } + if (!properties) { + continue; + } - var keyNames = Object.keys(properties); + var keyNames = Object.keys(properties); - for (var j = 0; j < keyNames.length; j++) { - var keyName = keyNames[j]; - var value = properties[keyName]; + for (var j = 0; j < keyNames.length; j++) { + var keyName = keyNames[j]; + var value = properties[keyName]; - if (_emberMetal.detectBinding(keyName)) { - m.writeBindings(keyName, value); - } + if (_emberMetal.detectBinding(keyName)) { + m.writeBindings(keyName, value); + } - var possibleDesc = this[keyName]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; + var possibleDesc = this[keyName]; + var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - _emberMetal.assert('Ember.Object.create no longer supports defining computed ' + 'properties. Define computed properties using extend() or reopen() ' + 'before calling create().', !(value instanceof _emberMetal.ComputedProperty)); - _emberMetal.assert('Ember.Object.create no longer supports defining methods that call _super.', !(typeof value === 'function' && value.toString().indexOf('._super') !== -1)); - _emberMetal.assert('`actions` must be provided at extend time, not at create time, ' + 'when Ember.ActionHandler is used (i.e. views, controllers & routes).', !(keyName === 'actions' && _emberRuntimeMixinsAction_handler.default.detect(this))); + _emberMetal.assert('Ember.Object.create no longer supports defining computed ' + 'properties. Define computed properties using extend() or reopen() ' + 'before calling create().', !(value instanceof _emberMetal.ComputedProperty)); + _emberMetal.assert('Ember.Object.create no longer supports defining methods that call _super.', !(typeof value === 'function' && value.toString().indexOf('._super') !== -1)); + _emberMetal.assert('`actions` must be provided at extend time, not at create time, ' + 'when Ember.ActionHandler is used (i.e. views, controllers & routes).', !(keyName === 'actions' && _emberRuntimeMixinsAction_handler.default.detect(this))); - if (concatenatedProperties && concatenatedProperties.length > 0 && concatenatedProperties.indexOf(keyName) >= 0) { - var baseValue = this[keyName]; + if (concatenatedProperties && concatenatedProperties.length > 0 && concatenatedProperties.indexOf(keyName) >= 0) { + var baseValue = this[keyName]; - if (baseValue) { - if ('function' === typeof baseValue.concat) { - value = baseValue.concat(value); + if (baseValue) { + if ('function' === typeof baseValue.concat) { + value = baseValue.concat(value); + } else { + value = _emberUtils.makeArray(baseValue).concat(value); + } } else { - value = _emberUtils.makeArray(baseValue).concat(value); + value = _emberUtils.makeArray(value); } - } else { - value = _emberUtils.makeArray(value); } - } - if (mergedProperties && mergedProperties.length && mergedProperties.indexOf(keyName) >= 0) { - var originalValue = this[keyName]; + if (mergedProperties && mergedProperties.length && mergedProperties.indexOf(keyName) >= 0) { + var originalValue = this[keyName]; - value = _emberUtils.assign({}, originalValue, value); - } + value = _emberUtils.assign({}, originalValue, value); + } - if (desc) { - desc.set(this, keyName, value); - } else { - if (typeof this.setUnknownProperty === 'function' && !(keyName in this)) { - this.setUnknownProperty(keyName, value); + if (desc) { + desc.set(this, keyName, value); } else { - if (_emberMetal.isFeatureEnabled('mandatory-setter')) { - _emberMetal.defineProperty(this, keyName, null, value); // setup mandatory setter + if (typeof this.setUnknownProperty === 'function' && !(keyName in this)) { + this.setUnknownProperty(keyName, value); } else { - this[keyName] = value; - } + if (_emberMetal.isFeatureEnabled('mandatory-setter')) { + _emberMetal.defineProperty(this, keyName, null, value); // setup mandatory setter + } else { + this[keyName] = value; + } + } } } } } - } - - finishPartial(this, m); - this.init.apply(this, arguments); + finishPartial(this, m); - this[POST_INIT](); + this.init.apply(this, arguments); - m.proto = proto; - _emberMetal.finishChains(this); - _emberMetal.sendEvent(this, 'init'); - }; + this[POST_INIT](); - Class.toString = _emberMetal.Mixin.prototype.toString; - Class.willReopen = function () { - if (wasApplied) { - Class.PrototypeMixin = _emberMetal.Mixin.create(Class.PrototypeMixin); + m.proto = proto; + _emberMetal.finishChains(this); + _emberMetal.sendEvent(this, 'init'); } - wasApplied = false; - }; + Class.willReopen = function willReopen() { + if (wasApplied) { + Class.PrototypeMixin = _emberMetal.Mixin.create(Class.PrototypeMixin); + } - Class._initProperties = function (args) { - initProperties = args; - }; + wasApplied = false; + }; - Class.proto = function () { - var superclass = Class.superclass; - if (superclass) { - superclass.proto(); - } + Class._initProperties = function _initProperties(args) { + initProperties = args; + }; - if (!wasApplied) { - wasApplied = true; - Class.PrototypeMixin.applyPartial(Class.prototype); - } + Class.proto = function proto() { + var superclass = Class.superclass; + if (superclass) { + superclass.proto(); + } - return this.prototype; - }; + if (!wasApplied) { + wasApplied = true; + Class.PrototypeMixin.applyPartial(Class.prototype); + } + + return this.prototype; + }; + + return Class; + })(); + + Class.toString = _emberMetal.Mixin.prototype.toString; return Class; } @@ -17616,7 +17947,7 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met }, _Mixin$create.toString = function () { var hasToStringExtension = typeof this.toStringExtension === 'function'; var extension = hasToStringExtension ? ':' + this.toStringExtension() : ''; - var ret = '<' + this.constructor.toString() + ':' + _emberUtils.guidFor(this) + extension + '>'; + var ret = '<' + (this[_emberUtils.NAME_KEY] || this.constructor.toString()) + ':' + _emberUtils.guidFor(this) + extension + '>'; return ret; }, _Mixin$create)); @@ -17625,7 +17956,7 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met CoreObject.__super__ = null; - var ClassMixinProps = { + var ClassMixinProps = (_ClassMixinProps = { ClassMixin: _emberMetal.REQUIRED, @@ -17633,310 +17964,95 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met isClass: true, - isMethod: false, - /** - Creates a new subclass. - ```javascript - const Person = Ember.Object.extend({ - say(thing) { - alert(thing); - } - }); - ``` - This defines a new subclass of Ember.Object: `Person`. It contains one method: `say()`. - You can also create a subclass from any existing class by calling its `extend()` method. - For example, you might want to create a subclass of Ember's built-in `Ember.Component` class: - ```javascript - const PersonComponent = Ember.Component.extend({ - tagName: 'li', - classNameBindings: ['isAdministrator'] - }); - ``` - When defining a subclass, you can override methods but still access the - implementation of your parent class by calling the special `_super()` method: - ```javascript - const Person = Ember.Object.extend({ - say(thing) { - var name = this.get('name'); - alert(`${name} says: ${thing}`); - } - }); - const Soldier = Person.extend({ - say(thing) { - this._super(`${thing}, sir!`); - }, - march(numberOfHours) { - alert(`${this.get('name')} marches for ${numberOfHours} hours.`); - } - }); - let yehuda = Soldier.create({ - name: "Yehuda Katz" - }); - yehuda.say("Yes"); // alerts "Yehuda Katz says: Yes, sir!" - ``` - The `create()` on line #17 creates an *instance* of the `Soldier` class. - The `extend()` on line #8 creates a *subclass* of `Person`. Any instance - of the `Person` class will *not* have the `march()` method. - You can also pass `Mixin` classes to add additional properties to the subclass. - ```javascript - const Person = Ember.Object.extend({ - say(thing) { - alert(`${this.get('name')} says: ${thing}`); - } - }); - const SingingMixin = Mixin.create({ - sing(thing){ - alert(`${this.get('name')} sings: la la la ${thing}`); - } - }); - const BroadwayStar = Person.extend(SingingMixin, { - dance() { - alert(`${this.get('name')} dances: tap tap tap tap `); - } - }); - ``` - The `BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`. - @method extend - @static - @param {Mixin} [mixins]* One or more Mixin classes - @param {Object} [arguments]* Object containing values to use within the new class - @public - */ - extend: function () { - var Class = makeCtor(); - var proto; - Class.ClassMixin = _emberMetal.Mixin.create(this.ClassMixin); - Class.PrototypeMixin = _emberMetal.Mixin.create(this.PrototypeMixin); + isMethod: false + }, _ClassMixinProps[_emberUtils.NAME_KEY] = null, _ClassMixinProps[_emberUtils.GUID_KEY] = null, _ClassMixinProps.extend = function () { + var Class = makeCtor(); + var proto = undefined; + Class.ClassMixin = _emberMetal.Mixin.create(this.ClassMixin); + Class.PrototypeMixin = _emberMetal.Mixin.create(this.PrototypeMixin); - Class.ClassMixin.ownerConstructor = Class; - Class.PrototypeMixin.ownerConstructor = Class; + Class.ClassMixin.ownerConstructor = Class; + Class.PrototypeMixin.ownerConstructor = Class; - reopen.apply(Class.PrototypeMixin, arguments); + reopen.apply(Class.PrototypeMixin, arguments); - Class.superclass = this; - Class.__super__ = this.prototype; + Class.superclass = this; + Class.__super__ = this.prototype; - proto = Class.prototype = Object.create(this.prototype); - proto.constructor = Class; - _emberUtils.generateGuid(proto); - _emberMetal.meta(proto).proto = proto; // this will disable observers on prototype + proto = Class.prototype = Object.create(this.prototype); + proto.constructor = Class; + _emberUtils.generateGuid(proto); + _emberMetal.meta(proto).proto = proto; // this will disable observers on prototype - Class.ClassMixin.apply(Class); - return Class; - }, + Class.ClassMixin.apply(Class); + return Class; + }, _ClassMixinProps.create = function () { + var C = this; - /** - Creates an instance of a class. Accepts either no arguments, or an object - containing values to initialize the newly instantiated object with. - ```javascript - const Person = Ember.Object.extend({ - helloWorld() { - alert(`Hi, my name is ${this.get('name')}`); - } - }); - let tom = Person.create({ - name: 'Tom Dale' - }); - tom.helloWorld(); // alerts "Hi, my name is Tom Dale". - ``` - `create` will call the `init` function if defined during - `Ember.AnyObject.extend` - If no arguments are passed to `create`, it will not set values to the new - instance during initialization: - ```javascript - let noName = Person.create(); - noName.helloWorld(); // alerts undefined - ``` - NOTE: For performance reasons, you cannot declare methods or computed - properties during `create`. You should instead declare methods and computed - properties when using `extend`. - @method create - @static - @param [arguments]* - @public - */ - create: function () { - var C = this; - - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - if (args.length > 0) { - this._initProperties(args); - } - return new C(); - }, - - /** - Augments a constructor's prototype with additional - properties and functions: - ```javascript - const MyObject = Ember.Object.extend({ - name: 'an object' - }); - o = MyObject.create(); - o.get('name'); // 'an object' - MyObject.reopen({ - say(msg){ - console.log(msg); - } - }) - o2 = MyObject.create(); - o2.say("hello"); // logs "hello" - o.say("goodbye"); // logs "goodbye" - ``` - To add functions and properties to the constructor itself, - see `reopenClass` - @method reopen - @public - */ - reopen: function () { - this.willReopen(); - reopen.apply(this.PrototypeMixin, arguments); - return this; - }, - - /** - Augments a constructor's own properties and functions: - ```javascript - const MyObject = Ember.Object.extend({ - name: 'an object' - }); - MyObject.reopenClass({ - canBuild: false - }); - MyObject.canBuild; // false - o = MyObject.create(); - ``` - In other words, this creates static properties and functions for the class. - These are only available on the class and not on any instance of that class. - ```javascript - const Person = Ember.Object.extend({ - name: "", - sayHello() { - alert("Hello. My name is " + this.get('name')); - } - }); - Person.reopenClass({ - species: "Homo sapiens", - createPerson(newPersonsName){ - return Person.create({ - name:newPersonsName - }); - } - }); - let tom = Person.create({ - name: "Tom Dale" - }); - let yehuda = Person.createPerson("Yehuda Katz"); - tom.sayHello(); // "Hello. My name is Tom Dale" - yehuda.sayHello(); // "Hello. My name is Yehuda Katz" - alert(Person.species); // "Homo sapiens" - ``` - Note that `species` and `createPerson` are *not* valid on the `tom` and `yehuda` - variables. They are only valid on `Person`. - To add functions and properties to instances of - a constructor by extending the constructor's prototype - see `reopen` - @method reopenClass - @public - */ - reopenClass: function () { - reopen.apply(this.ClassMixin, arguments); - applyMixin(this, arguments, false); - return this; - }, + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - detect: function (obj) { - if ('function' !== typeof obj) { - return false; - } - while (obj) { - if (obj === this) { - return true; - } - obj = obj.superclass; - } + if (args.length > 0) { + this._initProperties(args); + } + return new C(); + }, _ClassMixinProps.reopen = function () { + this.willReopen(); + reopen.apply(this.PrototypeMixin, arguments); + return this; + }, _ClassMixinProps.reopenClass = function () { + reopen.apply(this.ClassMixin, arguments); + applyMixin(this, arguments, false); + return this; + }, _ClassMixinProps.detect = function (obj) { + if ('function' !== typeof obj) { return false; - }, - - detectInstance: function (obj) { - return obj instanceof this; - }, - - /** - In some cases, you may want to annotate computed properties with additional - metadata about how they function or what values they operate on. For - example, computed property functions may close over variables that are then - no longer available for introspection. - You can pass a hash of these values to a computed property like this: - ```javascript - person: Ember.computed(function() { - var personId = this.get('personId'); - return Person.create({ id: personId }); - }).meta({ type: Person }) - ``` - Once you've done this, you can retrieve the values saved to the computed - property from your class like this: - ```javascript - MyClass.metaForProperty('person'); - ``` - This will return the original hash that was passed to `meta()`. - @static - @method metaForProperty - @param key {String} property name - @private - */ - metaForProperty: function (key) { - var proto = this.proto(); - var possibleDesc = proto[key]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - _emberMetal.assert('metaForProperty() could not find a computed property ' + 'with key \'' + key + '\'.', !!desc && desc instanceof _emberMetal.ComputedProperty); - return desc._meta || {}; - }, + } + while (obj) { + if (obj === this) { + return true; + } + obj = obj.superclass; + } + return false; + }, _ClassMixinProps.detectInstance = function (obj) { + return obj instanceof this; + }, _ClassMixinProps.metaForProperty = function (key) { + var proto = this.proto(); + var possibleDesc = proto[key]; + var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - _computedProperties: _emberMetal.computed(function () { - hasCachedComputedProperties = true; - var proto = this.proto(); - var property; - var properties = []; + _emberMetal.assert('metaForProperty() could not find a computed property with key \'' + key + '\'.', !!desc && desc instanceof _emberMetal.ComputedProperty); + return desc._meta || {}; + }, _ClassMixinProps._computedProperties = _emberMetal.computed(function () { + hasCachedComputedProperties = true; + var proto = this.proto(); + var property = undefined; + var properties = []; - for (var name in proto) { - property = proto[name]; + for (var _name in proto) { + property = proto[_name]; - if (property && property.isDescriptor) { - properties.push({ - name: name, - meta: property._meta - }); - } + if (property && property.isDescriptor) { + properties.push({ + name: _name, + meta: property._meta + }); } - return properties; - }).readOnly(), - - /** - Iterate over each computed property for the class, passing its name - and any associated metadata (see `metaForProperty`) to the callback. - @static - @method eachComputedProperty - @param {Function} callback - @param {Object} binding - @private - */ - eachComputedProperty: function (callback, binding) { - var property; - var empty = {}; + } + return properties; + }).readOnly(), _ClassMixinProps.eachComputedProperty = function (callback, binding) { + var property = undefined; + var empty = {}; - var properties = _emberMetal.get(this, '_computedProperties'); + var properties = _emberMetal.get(this, '_computedProperties'); - for (var i = 0; i < properties.length; i++) { - property = properties[i]; - callback.call(binding || this, property.name, property.meta || empty); - } + for (var i = 0; i < properties.length; i++) { + property = properties[i]; + callback.call(binding || this, property.name, property.meta || empty); } - }; + }, _ClassMixinProps); function injectedPropertyAssertion() { _emberMetal.assert('Injected properties are invalid', _emberRuntimeInject.validatePropertyInjections(this)); @@ -17962,7 +18078,8 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met ClassMixinProps._lazyInjections = function () { var injections = {}; var proto = this.proto(); - var key, desc; + var key = undefined; + var desc = undefined; for (key in proto) { desc = proto[key]; @@ -18194,6 +18311,210 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-met @return {String} string representation @public */ + +/** + Creates a new subclass. + ```javascript + const Person = Ember.Object.extend({ + say(thing) { + alert(thing); + } + }); + ``` + This defines a new subclass of Ember.Object: `Person`. It contains one method: `say()`. + You can also create a subclass from any existing class by calling its `extend()` method. + For example, you might want to create a subclass of Ember's built-in `Ember.Component` class: + ```javascript + const PersonComponent = Ember.Component.extend({ + tagName: 'li', + classNameBindings: ['isAdministrator'] + }); + ``` + When defining a subclass, you can override methods but still access the + implementation of your parent class by calling the special `_super()` method: + ```javascript + const Person = Ember.Object.extend({ + say(thing) { + let name = this.get('name'); + alert(`${name} says: ${thing}`); + } + }); + const Soldier = Person.extend({ + say(thing) { + this._super(`${thing}, sir!`); + }, + march(numberOfHours) { + alert(`${this.get('name')} marches for ${numberOfHours} hours.`); + } + }); + let yehuda = Soldier.create({ + name: "Yehuda Katz" + }); + yehuda.say("Yes"); // alerts "Yehuda Katz says: Yes, sir!" + ``` + The `create()` on line #17 creates an *instance* of the `Soldier` class. + The `extend()` on line #8 creates a *subclass* of `Person`. Any instance + of the `Person` class will *not* have the `march()` method. + You can also pass `Mixin` classes to add additional properties to the subclass. + ```javascript + const Person = Ember.Object.extend({ + say(thing) { + alert(`${this.get('name')} says: ${thing}`); + } + }); + const SingingMixin = Mixin.create({ + sing(thing){ + alert(`${this.get('name')} sings: la la la ${thing}`); + } + }); + const BroadwayStar = Person.extend(SingingMixin, { + dance() { + alert(`${this.get('name')} dances: tap tap tap tap `); + } + }); + ``` + The `BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`. + @method extend + @static + @param {Mixin} [mixins]* One or more Mixin classes + @param {Object} [arguments]* Object containing values to use within the new class + @public +*/ + +/** + Creates an instance of a class. Accepts either no arguments, or an object + containing values to initialize the newly instantiated object with. + ```javascript + const Person = Ember.Object.extend({ + helloWorld() { + alert(`Hi, my name is ${this.get('name')}`); + } + }); + let tom = Person.create({ + name: 'Tom Dale' + }); + tom.helloWorld(); // alerts "Hi, my name is Tom Dale". + ``` + `create` will call the `init` function if defined during + `Ember.AnyObject.extend` + If no arguments are passed to `create`, it will not set values to the new + instance during initialization: + ```javascript + let noName = Person.create(); + noName.helloWorld(); // alerts undefined + ``` + NOTE: For performance reasons, you cannot declare methods or computed + properties during `create`. You should instead declare methods and computed + properties when using `extend`. + @method create + @static + @param [arguments]* + @public +*/ + +/** + Augments a constructor's prototype with additional + properties and functions: + ```javascript + const MyObject = Ember.Object.extend({ + name: 'an object' + }); + o = MyObject.create(); + o.get('name'); // 'an object' + MyObject.reopen({ + say(msg){ + console.log(msg); + } + }) + o2 = MyObject.create(); + o2.say("hello"); // logs "hello" + o.say("goodbye"); // logs "goodbye" + ``` + To add functions and properties to the constructor itself, + see `reopenClass` + @method reopen + @public +*/ + +/** + Augments a constructor's own properties and functions: + ```javascript + const MyObject = Ember.Object.extend({ + name: 'an object' + }); + MyObject.reopenClass({ + canBuild: false + }); + MyObject.canBuild; // false + o = MyObject.create(); + ``` + In other words, this creates static properties and functions for the class. + These are only available on the class and not on any instance of that class. + ```javascript + const Person = Ember.Object.extend({ + name: "", + sayHello() { + alert("Hello. My name is " + this.get('name')); + } + }); + Person.reopenClass({ + species: "Homo sapiens", + createPerson(newPersonsName){ + return Person.create({ + name:newPersonsName + }); + } + }); + let tom = Person.create({ + name: "Tom Dale" + }); + let yehuda = Person.createPerson("Yehuda Katz"); + tom.sayHello(); // "Hello. My name is Tom Dale" + yehuda.sayHello(); // "Hello. My name is Yehuda Katz" + alert(Person.species); // "Homo sapiens" + ``` + Note that `species` and `createPerson` are *not* valid on the `tom` and `yehuda` + variables. They are only valid on `Person`. + To add functions and properties to instances of + a constructor by extending the constructor's prototype + see `reopen` + @method reopenClass + @public +*/ + +/** + In some cases, you may want to annotate computed properties with additional + metadata about how they function or what values they operate on. For + example, computed property functions may close over variables that are then + no longer available for introspection. + You can pass a hash of these values to a computed property like this: + ```javascript + person: Ember.computed(function() { + let personId = this.get('personId'); + return Person.create({ id: personId }); + }).meta({ type: Person }) + ``` + Once you've done this, you can retrieve the values saved to the computed + property from your class like this: + ```javascript + MyClass.metaForProperty('person'); + ``` + This will return the original hash that was passed to `meta()`. + @static + @method metaForProperty + @param key {String} property name + @private +*/ + +/** + Iterate over each computed property for the class, passing its name + and any associated metadata (see `metaForProperty`) to the callback. + @static + @method eachComputedProperty + @param {Function} callback + @param {Object} binding + @private +*/ enifed('ember-runtime/system/each_proxy', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/mixins/array'], function (exports, _emberUtils, _emberMetal, _emberRuntimeMixinsArray) { 'use strict'; @@ -18446,7 +18767,7 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal } findNamespaces(); - return this[_emberMetal.NAME_KEY]; + return this[_emberUtils.NAME_KEY]; }, nameClasses: function () { @@ -18506,10 +18827,10 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal paths[idx] = key; // If we have found an unprocessed class - if (obj && obj.toString === classToString && !obj[_emberMetal.NAME_KEY]) { + if (obj && obj.toString === classToString && !obj[_emberUtils.NAME_KEY]) { // Replace the class' `toString` with the dot-separated path // and set its `NAME_KEY` - obj[_emberMetal.NAME_KEY] = paths.join('.'); + obj[_emberUtils.NAME_KEY] = paths.join('.'); // Support nested namespaces } else if (obj && obj.isNamespace) { @@ -18555,7 +18876,7 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal } var obj = tryIsNamespace(lookup, key); if (obj) { - obj[_emberMetal.NAME_KEY] = key; + obj[_emberUtils.NAME_KEY] = key; } } } @@ -18563,35 +18884,41 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal function superClassString(mixin) { var superclass = mixin.superclass; if (superclass) { - if (superclass[_emberMetal.NAME_KEY]) { - return superclass[_emberMetal.NAME_KEY]; + if (superclass[_emberUtils.NAME_KEY]) { + return superclass[_emberUtils.NAME_KEY]; } return superClassString(superclass); } } - function classToString() { - if (!searchDisabled && !this[_emberMetal.NAME_KEY]) { - processAllNamespaces(); - } - - var ret = undefined; + function calculateToString(target) { + var str = undefined; - if (this[_emberMetal.NAME_KEY]) { - ret = this[_emberMetal.NAME_KEY]; - } else if (this._toString) { - ret = this._toString; - } else { - var str = superClassString(this); + if (!searchDisabled) { + processAllNamespaces(); + // can also be set by processAllNamespaces + str = target[_emberUtils.NAME_KEY]; if (str) { - ret = '(subclass of ' + str + ')'; + return str; } else { - ret = '(unknown mixin)'; + str = superClassString(target); + str = str ? '(subclass of ' + str + ')' : str; } - this.toString = makeToString(ret); } + if (str) { + return str; + } else { + return '(unknown mixin)'; + } + } - return ret; + function classToString() { + var name = this[_emberUtils.NAME_KEY]; + if (name) { + return name; + } + + return this[_emberUtils.NAME_KEY] = calculateToString(this); } function processAllNamespaces() { @@ -18616,12 +18943,6 @@ enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal } } - function makeToString(ret) { - return function () { - return ret; - }; - } - _emberMetal.Mixin.prototype.toString = classToString; // ES6TODO: altering imported objects. SBB. exports.default = Namespace; @@ -18634,6 +18955,8 @@ enifed('ember-runtime/system/native_array', ['exports', 'ember-metal', 'ember-en */ 'use strict'; + var _NativeArray; + // 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. @@ -18723,7 +19046,7 @@ enifed('ember-runtime/system/native_array', ['exports', 'ember-metal', 'ember-en }); exports.NativeArray // TODO: only use default export - = NativeArray = NativeArray.without.apply(NativeArray, ignore); + = NativeArray = (_NativeArray = NativeArray).without.apply(_NativeArray, ignore); /** Creates an `Ember.NativeArray` from an Array like object. @@ -19408,2513 +19731,2540 @@ enifed('ember-runtime/utils', ['exports', 'ember-runtime/mixins/array', 'ember-r enifed("ember/features", ["exports"], function (exports) { "use strict"; - exports.default = { "features-stripped-test": false, "ember-libraries-isregistered": false, "ember-runtime-computed-uniq-by": true, "ember-improved-instrumentation": false, "ember-runtime-enumerable-includes": true, "ember-string-ishtmlsafe": true, "ember-testing-check-waiters": true, "ember-metal-weakmap": false, "ember-glimmer-allow-backtracking-rerender": true, "ember-testing-resume-test": false, "ember-glimmer-detect-backtracking-rerender": true, "mandatory-setter": true }; + exports.default = { "features-stripped-test": null, "ember-libraries-isregistered": null, "ember-improved-instrumentation": null, "ember-metal-weakmap": null, "ember-glimmer-allow-backtracking-rerender": true, "ember-testing-resume-test": null, "ember-factory-for": true, "ember-no-double-extend": null, "ember-routing-router-service": null, "ember-unique-location-history-state": null, "ember-glimmer-detect-backtracking-rerender": true, "mandatory-setter": true }; }); enifed("ember/version", ["exports"], function (exports) { "use strict"; - exports.default = "2.10.2-with-backtracking"; + exports.default = "2.12.0-canary-with-backtracking"; }); -/*! - * @overview RSVP - a tiny implementation of Promises/A+. - * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors - * @license Licensed under MIT license - * See https://raw.githubusercontent.com/tildeio/rsvp.js/master/LICENSE - * @version 3.2.1 - */ +enifed('rsvp', ['exports'], function (exports) { + 'use strict'; + + var _rsvp; -enifed('rsvp', ['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; + } + } -function indexOf(callbacks, callback) { - for (var i=0, l=callbacks.length; i 1) { + throw new Error('Second argument not supported'); + } + if (typeof o !== 'object') { + throw new TypeError('Argument must be an object'); + } + F.prototype = o; + return new F(); + }; - object.off('stuff'); - object.trigger('stuff'); // callback1 and callback2 will not be executed! - ``` + var queue = []; - @method off - @for RSVP.EventTarget - @private - @param {String} eventName event to stop listening to - @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) { - var allCallbacks = callbacksFor(this), callbacks, index; + function scheduleFlush() { + setTimeout(function () { + for (var i = 0; i < queue.length; i++) { + var entry = queue[i]; - if (!callback) { - allCallbacks[eventName] = []; - return; - } + var payload = entry.payload; - callbacks = allCallbacks[eventName]; + payload.guid = payload.key + payload.id; + payload.childGuid = payload.key + payload.childId; + if (payload.error) { + payload.stack = payload.error.stack; + } - index = indexOf(callbacks, callback); + config['trigger'](entry.name, entry.payload); + } + queue.length = 0; + }, 50); + } - if (index !== -1) { callbacks.splice(index, 1); } - }, + function instrument(eventName, promise, child) { + if (1 === queue.push({ + name: eventName, + payload: { + key: promise._guidKey, + id: promise._id, + eventName: eventName, + detail: promise._result, + childId: child && child._id, + label: promise._label, + timeStamp: now(), + error: config["instrument-with-stack"] ? new Error(promise._label) : null + } })) { + scheduleFlush(); + } + } /** - Use `trigger` to fire custom events. For example: - + `RSVP.Promise.resolve` returns a promise that will become resolved with the + passed `value`. It is shorthand for the following: + ```javascript - object.on('foo', function(){ - console.log('foo event happened!'); + let promise = new RSVP.Promise(function(resolve, reject){ + resolve(1); + }); + + promise.then(function(value){ + // value === 1 }); - object.trigger('foo'); - // 'foo event happened!' logged to the console ``` - - You can also pass a value as a second argument to `trigger` that will be - passed as an argument to all event listeners for the event: - + + Instead of writing the above, your code now simply becomes the following: + ```javascript - object.on('foo', function(value){ - console.log(value.name); + let promise = RSVP.Promise.resolve(1); + + promise.then(function(value){ + // value === 1 }); - - object.trigger('foo', { name: 'bar' }); - // 'bar' logged to the console ``` - - @method trigger - @for RSVP.EventTarget - @private - @param {String} eventName name of the event to be triggered - @param {*} options optional value to be passed to any event handlers for - the given `eventName` + + @method resolve + @static + @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` */ - 'trigger': function(eventName, options, label) { - var allCallbacks = callbacksFor(this), callbacks, callback; - - if (callbacks = allCallbacks[eventName]) { - // Don't cache the callbacks.length since it may grow - for (var i=0; i 1) { - throw new Error('Second argument not supported'); - } - if (typeof o !== 'object') { - throw new TypeError('Argument must be an object'); + if (!sealed && error) { + sealed = true; + reject(promise, error); + } + }, promise); } - F.prototype = o; - return new F(); -}); - -var queue = []; -function scheduleFlush() { - setTimeout(function() { - var entry; - for (var i = 0; i < queue.length; i++) { - entry = queue[i]; - - var payload = entry.payload; + function handleOwnThenable(promise, thenable) { + if (thenable._state === FULFILLED) { + fulfill(promise, thenable._result); + } else if (thenable._state === REJECTED) { + thenable._onError = null; + reject(promise, thenable._result); + } else { + subscribe(thenable, undefined, function (value) { + if (thenable !== value) { + resolve(promise, value, undefined); + } else { + fulfill(promise, value); + } + }, function (reason) { + return reject(promise, reason); + }); + } + } - payload.guid = payload.key + payload.id; - payload.childGuid = payload.key + payload.childId; - if (payload.error) { - payload.stack = payload.error.stack; + function handleMaybeThenable(promise, maybeThenable, then$$) { + if (maybeThenable.constructor === promise.constructor && then$$ === then && promise.constructor.resolve === resolve$1) { + handleOwnThenable(promise, maybeThenable); + } else { + if (then$$ === GET_THEN_ERROR) { + reject(promise, GET_THEN_ERROR.error); + } else if (then$$ === undefined) { + fulfill(promise, maybeThenable); + } else if (isFunction(then$$)) { + handleForeignThenable(promise, maybeThenable, then$$); + } else { + fulfill(promise, maybeThenable); } + } + } - config['trigger'](entry.name, entry.payload); + function resolve(promise, value) { + if (promise === value) { + fulfill(promise, value); + } else if (objectOrFunction(value)) { + handleMaybeThenable(promise, value, getThen(value)); + } else { + fulfill(promise, value); } - queue.length = 0; - }, 50); -} + } -function instrument(eventName, promise, child) { - if (1 === queue.push({ - name: eventName, - payload: { - key: promise._guidKey, - id: promise._id, - eventName: eventName, - detail: promise._result, - childId: child && child._id, - label: promise._label, - timeStamp: now(), - error: config["instrument-with-stack"] ? new Error(promise._label) : null - }})) { - scheduleFlush(); + function publishRejection(promise) { + if (promise._onError) { + promise._onError(promise._result); } + + publish(promise); } -/** - `RSVP.Promise.resolve` returns a promise that will become resolved with the - passed `value`. It is shorthand for the following: + function fulfill(promise, value) { + if (promise._state !== PENDING) { + return; + } - ```javascript - var promise = new RSVP.Promise(function(resolve, reject){ - resolve(1); - }); + promise._result = value; + promise._state = FULFILLED; - promise.then(function(value){ - // value === 1 - }); - ``` + if (promise._subscribers.length === 0) { + if (config.instrument) { + instrument('fulfilled', promise); + } + } else { + config.async(publish, promise); + } + } - Instead of writing the above, your code now simply becomes the following: + function reject(promise, reason) { + if (promise._state !== PENDING) { + return; + } + promise._state = REJECTED; + promise._result = reason; + config.async(publishRejection, promise); + } - ```javascript - var promise = RSVP.Promise.resolve(1); + function subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers; + var length = subscribers.length; - promise.then(function(value){ - // value === 1 - }); - ``` + parent._onError = null; - @method resolve - @static - @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` -*/ -function resolve$1(object, label) { - /*jshint validthis:true */ - var Constructor = this; + subscribers[length] = child; + subscribers[length + FULFILLED] = onFulfillment; + subscribers[length + REJECTED] = onRejection; - if (object && typeof object === 'object' && object.constructor === Constructor) { - return object; + if (length === 0 && parent._state) { + config.async(publish, parent); + } } - var promise = new Constructor(noop, label); - resolve(promise, object); - return promise; -} + function publish(promise) { + var subscribers = promise._subscribers; + var settled = promise._state; -function withOwnPromise() { - return new TypeError('A promises callback cannot return that same promise.'); -} + if (config.instrument) { + instrument(settled === FULFILLED ? 'fulfilled' : 'rejected', promise); + } -function noop() {} + if (subscribers.length === 0) { + return; + } -var PENDING = void 0; -var FULFILLED = 1; -var REJECTED = 2; + var child = undefined, + callback = undefined, + detail = promise._result; -var GET_THEN_ERROR = new ErrorObject(); + for (var i = 0; i < subscribers.length; i += 3) { + child = subscribers[i]; + callback = subscribers[i + settled]; -function getThen(promise) { - try { - return promise.then; - } catch(error) { - GET_THEN_ERROR.error = error; - return GET_THEN_ERROR; - } -} + if (child) { + invokeCallback(settled, child, callback, detail); + } else { + callback(detail); + } + } -function tryThen(then, value, fulfillmentHandler, rejectionHandler) { - try { - then.call(value, fulfillmentHandler, rejectionHandler); - } catch(e) { - return e; + promise._subscribers.length = 0; } -} -function handleForeignThenable(promise, thenable, then) { - config.async(function(promise) { - var sealed = false; - var error = tryThen(then, thenable, function(value) { - if (sealed) { return; } - sealed = true; - if (thenable !== value) { - resolve(promise, value, undefined); - } else { - fulfill(promise, value); - } - }, function(reason) { - if (sealed) { return; } - sealed = true; + function ErrorObject() { + this.error = null; + } - reject(promise, reason); - }, 'Settle: ' + (promise._label || ' unknown promise')); + var TRY_CATCH_ERROR = new ErrorObject(); - if (!sealed && error) { - sealed = true; - reject(promise, error); + function tryCatch(callback, detail) { + try { + return callback(detail); + } catch (e) { + TRY_CATCH_ERROR.error = e; + return TRY_CATCH_ERROR; } - }, promise); -} + } -function handleOwnThenable(promise, thenable) { - if (thenable._state === FULFILLED) { - fulfill(promise, thenable._result); - } else if (thenable._state === REJECTED) { - thenable._onError = null; - reject(promise, thenable._result); - } else { - subscribe(thenable, undefined, function(value) { - if (thenable !== value) { - resolve(promise, value, undefined); + function invokeCallback(settled, promise, callback, detail) { + var hasCallback = isFunction(callback), + value = undefined, + error = undefined, + succeeded = undefined, + failed = undefined; + + if (hasCallback) { + value = tryCatch(callback, detail); + + if (value === TRY_CATCH_ERROR) { + failed = true; + error = value.error; + value = null; } else { - fulfill(promise, value); + succeeded = true; } - }, function(reason) { - reject(promise, reason); - }); - } -} -function handleMaybeThenable(promise, maybeThenable, then$$) { - if (maybeThenable.constructor === promise.constructor && - then$$ === then && - constructor.resolve === resolve$1) { - handleOwnThenable(promise, maybeThenable); - } else { - if (then$$ === GET_THEN_ERROR) { - reject(promise, GET_THEN_ERROR.error); - } else if (then$$ === undefined) { - fulfill(promise, maybeThenable); - } else if (isFunction(then$$)) { - handleForeignThenable(promise, maybeThenable, then$$); + if (promise === value) { + reject(promise, withOwnPromise()); + return; + } } else { - fulfill(promise, maybeThenable); + value = detail; + succeeded = true; } - } -} -function resolve(promise, value) { - if (promise === value) { - fulfill(promise, value); - } else if (objectOrFunction(value)) { - handleMaybeThenable(promise, value, getThen(value)); - } else { - fulfill(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 publishRejection(promise) { - if (promise._onError) { - promise._onError(promise._result); + function initializePromise(promise, resolver) { + var resolved = false; + try { + resolver(function (value) { + if (resolved) { + return; + } + resolved = true; + resolve(promise, value); + }, function (reason) { + if (resolved) { + return; + } + resolved = true; + reject(promise, reason); + }); + } catch (e) { + reject(promise, e); + } } - publish(promise); -} - -function fulfill(promise, value) { - if (promise._state !== PENDING) { return; } + function then(onFulfillment, onRejection, label) { + var _arguments = arguments; - promise._result = value; - promise._state = FULFILLED; + var parent = this; + var state = parent._state; - if (promise._subscribers.length === 0) { - if (config.instrument) { - instrument('fulfilled', promise); + if (state === FULFILLED && !onFulfillment || state === REJECTED && !onRejection) { + config.instrument && instrument('chained', parent, parent); + return parent; } - } else { - config.async(publish, promise); - } -} -function reject(promise, reason) { - if (promise._state !== PENDING) { return; } - promise._state = REJECTED; - promise._result = reason; - config.async(publishRejection, promise); -} + parent._onError = null; -function subscribe(parent, child, onFulfillment, onRejection) { - var subscribers = parent._subscribers; - var length = subscribers.length; + var child = new parent.constructor(noop, label); + var result = parent._result; - parent._onError = null; + config.instrument && instrument('chained', parent, child); - subscribers[length] = child; - subscribers[length + FULFILLED] = onFulfillment; - subscribers[length + REJECTED] = onRejection; + if (state) { + (function () { + var callback = _arguments[state - 1]; + config.async(function () { + return invokeCallback(state, child, callback, result); + }); + })(); + } else { + subscribe(parent, child, onFulfillment, onRejection); + } - if (length === 0 && parent._state) { - config.async(publish, parent); + return child; } -} - -function publish(promise) { - var subscribers = promise._subscribers; - var settled = promise._state; - if (config.instrument) { - instrument(settled === FULFILLED ? 'fulfilled' : 'rejected', promise); + function makeSettledResult(state, position, value) { + if (state === FULFILLED) { + return { + state: 'fulfilled', + value: value + }; + } else { + return { + state: 'rejected', + reason: value + }; + } } - if (subscribers.length === 0) { return; } + function Enumerator(Constructor, input, abortOnReject, label) { + this._instanceConstructor = Constructor; + this.promise = new Constructor(noop, label); + this._abortOnReject = abortOnReject; - var child, callback, detail = promise._result; + if (this._validateInput(input)) { + this._input = input; + this.length = input.length; + this._remaining = input.length; - for (var i = 0; i < subscribers.length; i += 3) { - child = subscribers[i]; - callback = subscribers[i + settled]; + this._init(); - if (child) { - invokeCallback(settled, child, callback, detail); + if (this.length === 0) { + fulfill(this.promise, this._result); + } else { + this.length = this.length || 0; + this._enumerate(); + if (this._remaining === 0) { + fulfill(this.promise, this._result); + } + } } else { - callback(detail); + reject(this.promise, this._validationError()); } } - promise._subscribers.length = 0; -} - -function ErrorObject() { - this.error = null; -} + Enumerator.prototype._validateInput = function (input) { + return isArray(input); + }; -var TRY_CATCH_ERROR = new ErrorObject(); + Enumerator.prototype._validationError = function () { + return new Error('Array Methods must be provided an Array'); + }; -function tryCatch(callback, detail) { - try { - return callback(detail); - } catch(e) { - TRY_CATCH_ERROR.error = e; - return TRY_CATCH_ERROR; - } -} + Enumerator.prototype._init = function () { + this._result = new Array(this.length); + }; -function invokeCallback(settled, promise, callback, detail) { - var hasCallback = isFunction(callback), - value, error, succeeded, failed; + Enumerator.prototype._enumerate = function () { + var length = this.length; + var promise = this.promise; + var input = this._input; - if (hasCallback) { - value = tryCatch(callback, detail); + for (var i = 0; promise._state === PENDING && i < length; i++) { + this._eachEntry(input[i], i); + } + }; - if (value === TRY_CATCH_ERROR) { - failed = true; - error = value.error; - value = null; + Enumerator.prototype._settleMaybeThenable = function (entry, i) { + var c = this._instanceConstructor; + var resolve = c.resolve; + + if (resolve === resolve$1) { + var then$$ = getThen(entry); + + if (then$$ === then && entry._state !== PENDING) { + entry._onError = null; + this._settledAt(entry._state, i, entry._result); + } else if (typeof then$$ !== 'function') { + this._remaining--; + this._result[i] = this._makeResult(FULFILLED, i, entry); + } else if (c === Promise) { + var promise = new c(noop); + handleMaybeThenable(promise, entry, then$$); + this._willSettleAt(promise, i); + } else { + this._willSettleAt(new c(function (resolve) { + return resolve(entry); + }), i); + } } else { - succeeded = true; + this._willSettleAt(resolve(entry), i); } + }; - if (promise === value) { - reject(promise, withOwnPromise()); - return; + Enumerator.prototype._eachEntry = function (entry, i) { + if (isMaybeThenable(entry)) { + this._settleMaybeThenable(entry, i); + } else { + this._remaining--; + this._result[i] = this._makeResult(FULFILLED, i, entry); } + }; - } else { - value = detail; - succeeded = true; - } - - 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); - } -} + Enumerator.prototype._settledAt = function (state, i, value) { + var promise = this.promise; -function then(onFulfillment, onRejection, label) { - var parent = this; - var state = parent._state; + if (promise._state === PENDING) { + this._remaining--; - if (state === FULFILLED && !onFulfillment || state === REJECTED && !onRejection) { - config.instrument && instrument('chained', parent, parent); - return parent; - } + if (this._abortOnReject && state === REJECTED) { + reject(promise, value); + } else { + this._result[i] = this._makeResult(state, i, value); + } + } - parent._onError = null; + if (this._remaining === 0) { + fulfill(promise, this._result); + } + }; - var child = new parent.constructor(noop, label); - var result = parent._result; + Enumerator.prototype._makeResult = function (state, i, value) { + return value; + }; - config.instrument && instrument('chained', parent, child); + Enumerator.prototype._willSettleAt = function (promise, i) { + var enumerator = this; - if (state) { - var callback = arguments[state - 1]; - config.async(function(){ - invokeCallback(state, child, callback, result); + subscribe(promise, undefined, function (value) { + return enumerator._settledAt(FULFILLED, i, value); + }, function (reason) { + return enumerator._settledAt(REJECTED, i, reason); }); - } else { - subscribe(parent, child, onFulfillment, onRejection); - } + }; - return child; -} - -function makeSettledResult(state, position, value) { - if (state === FULFILLED) { - return { - state: 'fulfilled', - value: value - }; - } else { - return { - state: 'rejected', - reason: value - }; - } -} - -function Enumerator(Constructor, input, abortOnReject, label) { - this._instanceConstructor = Constructor; - this.promise = new Constructor(noop, label); - this._abortOnReject = abortOnReject; - - if (this._validateInput(input)) { - this._input = input; - this.length = input.length; - this._remaining = input.length; - - this._init(); - - if (this.length === 0) { - fulfill(this.promise, this._result); - } else { - this.length = this.length || 0; - this._enumerate(); - if (this._remaining === 0) { - fulfill(this.promise, this._result); - } - } - } else { - reject(this.promise, this._validationError()); - } -} - -Enumerator.prototype._validateInput = function(input) { - return isArray(input); -}; - -Enumerator.prototype._validationError = function() { - return new Error('Array Methods must be provided an Array'); -}; - -Enumerator.prototype._init = function() { - this._result = new Array(this.length); -}; - -Enumerator.prototype._enumerate = function() { - var length = this.length; - var promise = this.promise; - var input = this._input; - - for (var i = 0; promise._state === PENDING && i < length; i++) { - this._eachEntry(input[i], i); + /** + `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 + rejected with the reason of the first passed promise to be rejected. It casts all + elements of the passed iterable to promises as it runs this algorithm. + + Example: + + ```javascript + let promise1 = RSVP.resolve(1); + let promise2 = RSVP.resolve(2); + let promise3 = RSVP.resolve(3); + let promises = [ promise1, promise2, promise3 ]; + + RSVP.Promise.all(promises).then(function(array){ + // The array here would be [ 1, 2, 3 ]; + }); + ``` + + If any of the `promises` given to `RSVP.all` are rejected, the first promise + that is rejected will be given as an argument to the returned promises's + rejection handler. For example: + + Example: + + ```javascript + let promise1 = RSVP.resolve(1); + let promise2 = RSVP.reject(new Error("2")); + let promise3 = RSVP.reject(new Error("3")); + let promises = [ promise1, promise2, promise3 ]; + + RSVP.Promise.all(promises).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(error) { + // error.message === "2" + }); + ``` + + @method all + @static + @param {Array} entries array of promises + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} promise that is fulfilled when all `promises` have been + fulfilled, or rejected if any of them become rejected. + @static + */ + function all(entries, label) { + return new Enumerator(this, entries, true, /* abort on reject */label).promise; } -}; -Enumerator.prototype._settleMaybeThenable = function(entry, i) { - var c = this._instanceConstructor; - var resolve = c.resolve; + /** + `RSVP.Promise.race` returns a new promise which is settled in the same way as the + first passed promise to settle. + + Example: + + ```javascript + let promise1 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 1'); + }, 200); + }); + + let promise2 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 2'); + }, 100); + }); + + RSVP.Promise.race([promise1, promise2]).then(function(result){ + // result === 'promise 2' because it was resolved before promise1 + // was resolved. + }); + ``` + + `RSVP.Promise.race` is deterministic in that only the state of the first + settled promise matters. For example, even if other promises given to the + `promises` array argument are resolved, but the first settled promise has + become rejected before the other promises became fulfilled, the returned + promise will become rejected: + + ```javascript + let promise1 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 1'); + }, 200); + }); + + let promise2 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + reject(new Error('promise 2')); + }, 100); + }); + + RSVP.Promise.race([promise1, promise2]).then(function(result){ + // Code here never runs + }, function(reason){ + // reason.message === 'promise 2' because promise 2 became rejected before + // promise 1 became fulfilled + }); + ``` + + An example real-world use case is implementing timeouts: + + ```javascript + RSVP.Promise.race([ajax('foo.json'), timeout(5000)]) + ``` + + @method race + @static + @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. + */ + function race(entries, label) { + /*jshint validthis:true */ + var Constructor = this; - if (resolve === resolve$1) { - var then$$ = getThen(entry); + var promise = new Constructor(noop, label); - if (then$$ === then && - entry._state !== PENDING) { - entry._onError = null; - this._settledAt(entry._state, i, entry._result); - } else if (typeof then$$ !== 'function') { - this._remaining--; - this._result[i] = this._makeResult(FULFILLED, i, entry); - } else if (c === Promise) { - var promise = new c(noop); - handleMaybeThenable(promise, entry, then$$); - this._willSettleAt(promise, i); - } else { - this._willSettleAt(new c(function(resolve) { resolve(entry); }), i); + if (!isArray(entries)) { + reject(promise, new TypeError('You must pass an array to race.')); + return promise; } - } else { - this._willSettleAt(resolve(entry), i); - } -}; - -Enumerator.prototype._eachEntry = function(entry, i) { - if (isMaybeThenable(entry)) { - this._settleMaybeThenable(entry, i); - } else { - this._remaining--; - this._result[i] = this._makeResult(FULFILLED, i, entry); - } -}; - -Enumerator.prototype._settledAt = function(state, i, value) { - var promise = this.promise; - if (promise._state === PENDING) { - this._remaining--; - - if (this._abortOnReject && state === REJECTED) { - reject(promise, value); - } else { - this._result[i] = this._makeResult(state, i, value); + for (var i = 0; promise._state === PENDING && i < entries.length; i++) { + subscribe(Constructor.resolve(entries[i]), undefined, function (value) { + return resolve(promise, value); + }, function (reason) { + return reject(promise, reason); + }); } - } - if (this._remaining === 0) { - fulfill(promise, this._result); + return promise; } -}; - -Enumerator.prototype._makeResult = function(state, i, value) { - return value; -}; - -Enumerator.prototype._willSettleAt = function(promise, i) { - var enumerator = this; - - subscribe(promise, undefined, function(value) { - enumerator._settledAt(FULFILLED, i, value); - }, function(reason) { - enumerator._settledAt(REJECTED, i, reason); - }); -}; - -/** - `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 - rejected with the reason of the first passed promise to be rejected. It casts all - elements of the passed iterable to promises as it runs this algorithm. - - Example: - - ```javascript - var promise1 = RSVP.resolve(1); - var promise2 = RSVP.resolve(2); - var promise3 = RSVP.resolve(3); - var promises = [ promise1, promise2, promise3 ]; - - RSVP.Promise.all(promises).then(function(array){ - // The array here would be [ 1, 2, 3 ]; - }); - ``` - - If any of the `promises` given to `RSVP.all` are rejected, the first promise - that is rejected will be given as an argument to the returned promises's - rejection handler. For example: - - Example: - - ```javascript - var promise1 = RSVP.resolve(1); - var promise2 = RSVP.reject(new Error("2")); - var promise3 = RSVP.reject(new Error("3")); - var promises = [ promise1, promise2, promise3 ]; - - RSVP.Promise.all(promises).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(error) { - // error.message === "2" - }); - ``` - - @method all - @static - @param {Array} entries array of promises - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} promise that is fulfilled when all `promises` have been - fulfilled, or rejected if any of them become rejected. - @static -*/ -function all(entries, label) { - return new Enumerator(this, entries, true /* abort on reject */, label).promise; -} - -/** - `RSVP.Promise.race` returns a new promise which is settled in the same way as the - first passed promise to settle. - - Example: - - ```javascript - var promise1 = new RSVP.Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 1'); - }, 200); - }); - - var promise2 = new RSVP.Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 2'); - }, 100); - }); - - RSVP.Promise.race([promise1, promise2]).then(function(result){ - // result === 'promise 2' because it was resolved before promise1 - // was resolved. - }); - ``` - `RSVP.Promise.race` is deterministic in that only the state of the first - settled promise matters. For example, even if other promises given to the - `promises` array argument are resolved, but the first settled promise has - become rejected before the other promises became fulfilled, the returned - promise will become rejected: - - ```javascript - var promise1 = new RSVP.Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 1'); - }, 200); - }); - - var promise2 = new RSVP.Promise(function(resolve, reject){ - setTimeout(function(){ - reject(new Error('promise 2')); - }, 100); - }); - - RSVP.Promise.race([promise1, promise2]).then(function(result){ - // Code here never runs - }, function(reason){ - // reason.message === 'promise 2' because promise 2 became rejected before - // promise 1 became fulfilled - }); - ``` - - An example real-world use case is implementing timeouts: - - ```javascript - RSVP.Promise.race([ajax('foo.json'), timeout(5000)]) - ``` - - @method race - @static - @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. -*/ -function race(entries, label) { - /*jshint validthis:true */ - var Constructor = this; - - var promise = new Constructor(noop, label); - - if (!isArray(entries)) { - reject(promise, new TypeError('You must pass an array to race.')); + /** + `RSVP.Promise.reject` returns a promise rejected with the passed `reason`. + It is shorthand for the following: + + ```javascript + let promise = new RSVP.Promise(function(resolve, reject){ + reject(new Error('WHOOPS')); + }); + + promise.then(function(value){ + // Code here doesn't run because the promise is rejected! + }, function(reason){ + // reason.message === 'WHOOPS' + }); + ``` + + Instead of writing the above, your code now simply becomes the following: + + ```javascript + let promise = RSVP.Promise.reject(new Error('WHOOPS')); + + promise.then(function(value){ + // Code here doesn't run because the promise is rejected! + }, function(reason){ + // reason.message === 'WHOOPS' + }); + ``` + + @method reject + @static + @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$1(reason, label) { + /*jshint validthis:true */ + var Constructor = this; + var promise = new Constructor(noop, label); + reject(promise, reason); return promise; } - var length = entries.length; - - function onFulfillment(value) { - resolve(promise, value); - } + var guidKey = 'rsvp_' + now() + '-'; + var counter = 0; - function onRejection(reason) { - reject(promise, reason); + function needsResolver() { + throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); } - for (var i = 0; promise._state === PENDING && i < length; i++) { - subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection); + function needsNew() { + throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); } - return promise; -} - -/** - `RSVP.Promise.reject` returns a promise rejected with the passed `reason`. - It is shorthand for the following: - - ```javascript - var promise = new RSVP.Promise(function(resolve, reject){ - reject(new Error('WHOOPS')); - }); - - promise.then(function(value){ - // Code here doesn't run because the promise is rejected! - }, function(reason){ - // reason.message === 'WHOOPS' - }); - ``` - - Instead of writing the above, your code now simply becomes the following: - - ```javascript - var promise = RSVP.Promise.reject(new Error('WHOOPS')); - - promise.then(function(value){ - // Code here doesn't run because the promise is rejected! - }, function(reason){ - // reason.message === 'WHOOPS' - }); - ``` - - @method reject - @static - @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$1(reason, label) { - /*jshint validthis:true */ - var Constructor = this; - var promise = new Constructor(noop, label); - reject(promise, reason); - return promise; -} - -var guidKey = 'rsvp_' + 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."); -} - -/** - 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 - why the promise cannot be fulfilled. - - Terminology - ----------- - - - `promise` is an object or function with a `then` method whose behavior conforms to this specification. - - `thenable` is an object or function that defines a `then` method. - - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). - - `exception` is a value that is thrown using the throw statement. - - `reason` is a value that indicates why a promise was rejected. - - `settled` the final resting state of a promise, fulfilled or rejected. - - A promise can be in one of three states: pending, fulfilled, or rejected. - - Promises that are fulfilled have a fulfillment value and are in the fulfilled - state. Promises that are rejected have a rejection reason and are in the - rejected state. A fulfillment value is never a thenable. - - Promises can also be said to *resolve* a value. If this value is also a - promise, then the original promise's settled state will match the value's - settled state. So a promise that *resolves* a promise that rejects will - itself reject, and a promise that *resolves* a promise that fulfills will - itself fulfill. - - - Basic Usage: - ------------ - - ```js - var promise = new Promise(function(resolve, reject) { - // on success - resolve(value); - - // on failure - reject(reason); - }); + /** + 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 + why the promise cannot be fulfilled. + + Terminology + ----------- + + - `promise` is an object or function with a `then` method whose behavior conforms to this specification. + - `thenable` is an object or function that defines a `then` method. + - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). + - `exception` is a value that is thrown using the throw statement. + - `reason` is a value that indicates why a promise was rejected. + - `settled` the final resting state of a promise, fulfilled or rejected. + + A promise can be in one of three states: pending, fulfilled, or rejected. + + Promises that are fulfilled have a fulfillment value and are in the fulfilled + state. Promises that are rejected have a rejection reason and are in the + rejected state. A fulfillment value is never a thenable. + + Promises can also be said to *resolve* a value. If this value is also a + promise, then the original promise's settled state will match the value's + settled state. So a promise that *resolves* a promise that rejects will + itself reject, and a promise that *resolves* a promise that fulfills will + itself fulfill. + + + Basic Usage: + ------------ + + ```js + let promise = new Promise(function(resolve, reject) { + // on success + resolve(value); + + // on failure + reject(reason); + }); + + promise.then(function(value) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Advanced Usage: + --------------- + + Promises shine when abstracting away asynchronous interactions such as + `XMLHttpRequest`s. + + ```js + function getJSON(url) { + return new Promise(function(resolve, reject){ + let xhr = new XMLHttpRequest(); + + xhr.open('GET', url); + xhr.onreadystatechange = handler; + xhr.responseType = 'json'; + xhr.setRequestHeader('Accept', 'application/json'); + xhr.send(); + + function handler() { + if (this.readyState === this.DONE) { + if (this.status === 200) { + resolve(this.response); + } else { + reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); + } + } + }; + }); + } + + getJSON('/posts.json').then(function(json) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Unlike callbacks, promises are great composable primitives. + + ```js + Promise.all([ + getJSON('/posts'), + getJSON('/comments') + ]).then(function(values){ + values[0] // => postsJSON + values[1] // => commentsJSON + + return values; + }); + ``` + + @class RSVP.Promise + @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 = []; - promise.then(function(value) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` + config.instrument && instrument('created', this); - Advanced Usage: - --------------- + if (noop !== resolver) { + typeof resolver !== 'function' && needsResolver(); + this instanceof Promise ? initializePromise(this, resolver) : needsNew(); + } + } - Promises shine when abstracting away asynchronous interactions such as - `XMLHttpRequest`s. + Promise.cast = resolve$1; // deprecated + Promise.all = all; + Promise.race = race; + Promise.resolve = resolve$1; + Promise.reject = reject$1; - ```js - function getJSON(url) { - return new Promise(function(resolve, reject){ - var xhr = new XMLHttpRequest(); + Promise.prototype = { + constructor: Promise, - xhr.open('GET', url); - xhr.onreadystatechange = handler; - xhr.responseType = 'json'; - xhr.setRequestHeader('Accept', 'application/json'); - xhr.send(); + _guidKey: guidKey, - function handler() { - if (this.readyState === this.DONE) { - if (this.status === 200) { - resolve(this.response); - } else { - reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); - } + _onError: function (reason) { + var promise = this; + config.after(function () { + if (promise._onError) { + config['trigger']('error', reason, promise._label); } - }; - }); - } - - getJSON('/posts.json').then(function(json) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` - - Unlike callbacks, promises are great composable primitives. - - ```js - Promise.all([ - getJSON('/posts'), - getJSON('/comments') - ]).then(function(values){ - values[0] // => postsJSON - values[1] // => commentsJSON + }); + }, - return values; - }); - ``` - - @class RSVP.Promise - @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 = []; - - config.instrument && instrument('created', this); - - if (noop !== resolver) { - typeof resolver !== 'function' && needsResolver(); - this instanceof Promise ? initializePromise(this, resolver) : needsNew(); - } -} - -Promise.cast = resolve$1; // deprecated -Promise.all = all; -Promise.race = race; -Promise.resolve = resolve$1; -Promise.reject = reject$1; - -Promise.prototype = { - constructor: Promise, - - _guidKey: guidKey, - - _onError: function (reason) { - var promise = this; - config.after(function() { - if (promise._onError) { - config['trigger']('error', reason, promise._label); - } - }); - }, - -/** - 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 why the promise cannot be fulfilled. - - ```js - findUser().then(function(user){ - // user is available - }, function(reason){ - // user is unavailable, and you are given the reason why - }); - ``` - - Chaining - -------- - - The return value of `then` is itself a promise. This second, 'downstream' - promise is resolved with the return value of the first promise's fulfillment - or rejection handler, or rejected if the handler throws an exception. - - ```js - findUser().then(function (user) { - return user.name; - }, function (reason) { - return 'default name'; - }).then(function (userName) { - // If `findUser` fulfilled, `userName` will be the user's name, otherwise it - // will be `'default name'` - }); - - findUser().then(function (user) { - throw new Error('Found user, but still unhappy'); - }, function (reason) { - throw new Error('`findUser` rejected and we're unhappy'); - }).then(function (value) { - // never reached - }, function (reason) { - // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. - // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. - }); - ``` - If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. - - ```js - findUser().then(function (user) { - throw new PedagogicalException('Upstream error'); - }).then(function (value) { - // never reached - }).then(function (value) { - // never reached - }, function (reason) { - // The `PedgagocialException` is propagated all the way down to here - }); - ``` - - Assimilation - ------------ - - Sometimes the value you want to propagate to a downstream promise can only be - retrieved asynchronously. This can be achieved by returning a promise in the - fulfillment or rejection handler. The downstream promise will then be pending - until the returned promise is settled. This is called *assimilation*. - - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // The user's comments are now available - }); - ``` - - If the assimliated promise rejects, then the downstream promise will also reject. - - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // If `findCommentsByAuthor` fulfills, we'll have the value here - }, function (reason) { - // If `findCommentsByAuthor` rejects, we'll have the reason here - }); - ``` - - Simple Example - -------------- - - Synchronous Example - - ```javascript - var result; - - try { - result = findResult(); - // success - } catch(reason) { - // failure - } - ``` - - Errback Example - - ```js - findResult(function(result, err){ - if (err) { - // failure - } else { - // success - } - }); - ``` - - Promise Example; - - ```javascript - findResult().then(function(result){ - // success - }, function(reason){ - // failure - }); - ``` - - Advanced Example - -------------- - - Synchronous Example - - ```javascript - var author, books; - - try { - author = findAuthor(); - books = findBooksByAuthor(author); - // success - } catch(reason) { - // failure - } - ``` - - Errback Example - - ```js - - function foundBooks(books) { - - } - - function failure(reason) { - - } - - findAuthor(function(author, err){ - if (err) { - failure(err); - // failure - } else { + /** + 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 why the promise cannot be fulfilled. + + ```js + findUser().then(function(user){ + // user is available + }, function(reason){ + // user is unavailable, and you are given the reason why + }); + ``` + + Chaining + -------- + + The return value of `then` is itself a promise. This second, 'downstream' + promise is resolved with the return value of the first promise's fulfillment + or rejection handler, or rejected if the handler throws an exception. + + ```js + findUser().then(function (user) { + return user.name; + }, function (reason) { + return 'default name'; + }).then(function (userName) { + // If `findUser` fulfilled, `userName` will be the user's name, otherwise it + // will be `'default name'` + }); + + findUser().then(function (user) { + throw new Error('Found user, but still unhappy'); + }, function (reason) { + throw new Error('`findUser` rejected and we\'re unhappy'); + }).then(function (value) { + // never reached + }, function (reason) { + // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. + // If `findUser` rejected, `reason` will be '`findUser` rejected and we\'re unhappy'. + }); + ``` + If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. + + ```js + findUser().then(function (user) { + throw new PedagogicalException('Upstream error'); + }).then(function (value) { + // never reached + }).then(function (value) { + // never reached + }, function (reason) { + // The `PedgagocialException` is propagated all the way down to here + }); + ``` + + Assimilation + ------------ + + Sometimes the value you want to propagate to a downstream promise can only be + retrieved asynchronously. This can be achieved by returning a promise in the + fulfillment or rejection handler. The downstream promise will then be pending + until the returned promise is settled. This is called *assimilation*. + + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // The user's comments are now available + }); + ``` + + If the assimliated promise rejects, then the downstream promise will also reject. + + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // If `findCommentsByAuthor` fulfills, we'll have the value here + }, function (reason) { + // If `findCommentsByAuthor` rejects, we'll have the reason here + }); + ``` + + Simple Example + -------------- + + Synchronous Example + + ```javascript + let result; + try { - findBoooksByAuthor(author, function(books, err) { - if (err) { - failure(err); - } else { - try { - foundBooks(books); - } catch(reason) { - failure(reason); - } - } - }); - } catch(error) { - failure(err); + result = findResult(); + // success + } catch(reason) { + // failure } - // success - } - }); - ``` - - Promise Example; - - ```javascript - findAuthor(). - then(findBooksByAuthor). - then(function(books){ - // found books - }).catch(function(reason){ - // something went wrong - }); - ``` - - @method then - @param {Function} onFulfillment - @param {Function} onRejection - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} -*/ - then: then, - -/** - `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same - as the catch block of a try/catch statement. - - ```js - function findAuthor(){ - throw new Error('couldn't find that author'); - } - - // synchronous - try { - findAuthor(); - } catch(reason) { - // something went wrong - } - - // async with promises - findAuthor().catch(function(reason){ - // something went wrong - }); - ``` - - @method catch - @param {Function} onRejection - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} -*/ - 'catch': function(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 - - Synchronous example: - - ```js - findAuthor() { - if (Math.random() > 0.5) { - throw new Error(); - } - return new Author(); - } - - try { - return findAuthor(); // succeed or fail - } catch(error) { - return findOtherAuther(); - } finally { - // always runs - // doesn't affect the return value - } - ``` - - Asynchronous example: - - ```js - findAuthor().catch(function(reason){ - return findOtherAuther(); - }).finally(function(){ - // author was either found, or not - }); - ``` - - @method finally - @param {Function} callback - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} -*/ - 'finally': function(callback, label) { - var promise = this; - var constructor = promise.constructor; - - return promise.then(function(value) { - return constructor.resolve(callback()).then(function() { - return value; + ``` + + Errback Example + + ```js + findResult(function(result, err){ + if (err) { + // failure + } else { + // success + } }); - }, function(reason) { - return constructor.resolve(callback()).then(function() { - return constructor.reject(reason); + ``` + + Promise Example; + + ```javascript + findResult().then(function(result){ + // success + }, function(reason){ + // failure }); - }, label); - } -}; - -function Result() { - this.value = undefined; -} - -var ERROR = new Result(); -var GET_THEN_ERROR$1 = new Result(); - -function getThen$1(obj) { - try { - return obj.then; - } catch(error) { - ERROR.value= error; - return ERROR; - } -} - - -function tryApply(f, s, a) { - try { - f.apply(s, a); - } catch(error) { - ERROR.value = error; - return ERROR; - } -} - -function makeObject(_, argumentNames) { - var obj = {}; - var name; - var i; - var length = _.length; - var args = new Array(length); - - for (var x = 0; x < length; x++) { - args[x] = _[x]; - } - - for (i = 0; i < argumentNames.length; i++) { - name = argumentNames[i]; - obj[name] = args[i + 1]; - } - - return obj; -} - -function arrayResult(_) { - var length = _.length; - var args = new Array(length - 1); - - for (var i = 1; i < length; i++) { - args[i - 1] = _[i]; - } - - return args; -} - -function wrapThenable(then, promise) { - return { - then: function(onFulFillment, onRejection) { - return then.call(promise, onFulFillment, onRejection); - } - }; -} - -/** - `RSVP.denodeify` takes a 'node-style' function and returns a function that - will return an `RSVP.Promise`. You can use `denodeify` in Node.js or the - browser when you'd prefer to use promises over using callbacks. For example, - `denodeify` transforms the following: - - ```javascript - var fs = require('fs'); - - fs.readFile('myfile.txt', function(err, data){ - if (err) return handleError(err); - handleData(data); - }); - ``` - - into: - - ```javascript - var fs = require('fs'); - var readFile = RSVP.denodeify(fs.readFile); - - readFile('myfile.txt').then(handleData, handleError); - ``` - - If the node function has multiple success parameters, then `denodeify` - just returns the first one: - - ```javascript - var request = RSVP.denodeify(require('request')); - - request('http://example.com').then(function(res) { - // ... - }); - ``` - - However, if you need all success parameters, setting `denodeify`'s - second parameter to `true` causes it to return all success parameters - as an array: - - ```javascript - var request = RSVP.denodeify(require('request'), true); - - request('http://example.com').then(function(result) { - // result[0] -> res - // result[1] -> body - }); - ``` - - Or if you pass it an array with names it returns the parameters as a hash: - - ```javascript - var request = RSVP.denodeify(require('request'), ['res', 'body']); - - request('http://example.com').then(function(result) { - // result.res - // result.body - }); - ``` - - Sometimes you need to retain the `this`: - - ```javascript - var app = require('express')(); - var render = RSVP.denodeify(app.render.bind(app)); - ``` - - The denodified function inherits from the original function. It works in all - environments, except IE 10 and below. Consequently all properties of the original - function are available to you. However, any properties you change on the - denodeified function won't be changed on the original function. Example: - - ```javascript - var request = RSVP.denodeify(require('request')), - cookieJar = request.jar(); // <- Inheritance is used here - - request('http://example.com', {jar: cookieJar}).then(function(res) { - // cookieJar.cookies holds now the cookies returned by example.com - }); - ``` - - Using `denodeify` makes it easier to compose asynchronous operations instead - of using callbacks. For example, instead of: - - ```javascript - var fs = require('fs'); - - fs.readFile('myfile.txt', function(err, data){ - if (err) { ... } // Handle error - fs.writeFile('myfile2.txt', data, function(err){ - if (err) { ... } // Handle error - console.log('done') - }); - }); - ``` - - you can chain the operations together using `then` from the returned promise: - - ```javascript - var fs = require('fs'); - var readFile = RSVP.denodeify(fs.readFile); - var writeFile = RSVP.denodeify(fs.writeFile); - - readFile('myfile.txt').then(function(data){ - return writeFile('myfile2.txt', data); - }).then(function(){ - console.log('done') - }).catch(function(error){ - // Handle error - }); - ``` - - @method denodeify - @static - @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} [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. - @return {Function} a function that wraps `nodeFunc` to return an - `RSVP.Promise` - @static -*/ -function denodeify(nodeFunc, options) { - var fn = function() { - var self = this; - var l = arguments.length; - var args = new Array(l + 1); - var arg; - var promiseInput = false; - - for (var i = 0; i < l; ++i) { - arg = arguments[i]; - - if (!promiseInput) { - // TODO: clean this up - promiseInput = needsPromiseInput(arg); - if (promiseInput === GET_THEN_ERROR$1) { - var p = new Promise(noop); - reject(p, GET_THEN_ERROR$1.value); - return p; - } else if (promiseInput && promiseInput !== true) { - arg = wrapThenable(promiseInput, arg); - } + ``` + + Advanced Example + -------------- + + Synchronous Example + + ```javascript + let author, books; + + try { + author = findAuthor(); + books = findBooksByAuthor(author); + // success + } catch(reason) { + // failure } - args[i] = arg; - } - - var promise = new Promise(noop); - - args[l] = function(err, val) { - if (err) - reject(promise, err); - else if (options === undefined) - resolve(promise, val); - else if (options === true) - resolve(promise, arrayResult(arguments)); - else if (isArray(options)) - resolve(promise, makeObject(arguments, options)); - else - resolve(promise, val); - }; - - if (promiseInput) { - return handlePromiseInput(promise, args, nodeFunc, self); - } else { - return handleValueInput(promise, args, nodeFunc, self); - } - }; - - fn.__proto__ = nodeFunc; - - return fn; -} - -function handleValueInput(promise, args, nodeFunc, self) { - var result = tryApply(nodeFunc, self, args); - if (result === ERROR) { - reject(promise, result.value); - } - return promise; -} - -function handlePromiseInput(promise, args, nodeFunc, self){ - return Promise.all(args).then(function(args){ - var result = tryApply(nodeFunc, self, args); - if (result === ERROR) { - reject(promise, result.value); - } - return promise; - }); -} - -function needsPromiseInput(arg) { - if (arg && typeof arg === 'object') { - if (arg.constructor === Promise) { - return true; - } else { - return getThen$1(arg); - } - } else { - return false; - } -} - -/** - This is a convenient alias for `RSVP.Promise.all`. - - @method all - @static - @for RSVP - @param {Array} array Array of promises. - @param {String} label An optional label. This is useful - for tooling. -*/ -function all$1(array, label) { - return Promise.all(array, label); -} - -function AllSettled(Constructor, entries, label) { - this._superConstructor(Constructor, entries, false /* don't abort on reject */, label); -} - -AllSettled.prototype = o_create(Enumerator.prototype); -AllSettled.prototype._superConstructor = Enumerator; -AllSettled.prototype._makeResult = makeSettledResult; -AllSettled.prototype._validationError = function() { - return new Error('allSettled must be called with an array'); -}; - -/** - `RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing - a fail-fast method, it waits until all the promises have returned and - shows you all the results. This is useful if you want to handle multiple - promises' failure states together as a set. - - Returns a promise that is fulfilled when all the given promises have been - settled. The return promise is fulfilled with an array of the states of - the promises passed into the `promises` array argument. - - Each state object will either indicate fulfillment or rejection, and - provide the corresponding value or reason. The states will take one of - the following formats: - - ```javascript - { state: 'fulfilled', value: value } - or - { state: 'rejected', reason: reason } - ``` - - Example: - - ```javascript - var promise1 = RSVP.Promise.resolve(1); - var promise2 = RSVP.Promise.reject(new Error('2')); - var promise3 = RSVP.Promise.reject(new Error('3')); - var promises = [ promise1, promise2, promise3 ]; - - RSVP.allSettled(promises).then(function(array){ - // array == [ - // { state: 'fulfilled', value: 1 }, - // { state: 'rejected', reason: Error }, - // { state: 'rejected', reason: Error } - // ] - // Note that for the second item, reason.message will be '2', and for the - // third item, reason.message will be '3'. - }, function(error) { - // Not run. (This block would only be called if allSettled had failed, - // for instance if passed an incorrect argument type.) - }); - ``` - - @method allSettled - @static - @for RSVP - @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. -*/ - -function allSettled(entries, label) { - return new AllSettled(Promise, entries, label).promise; -} - -/** - This is a convenient alias for `RSVP.Promise.race`. - - @method race - @static - @for RSVP - @param {Array} array Array of promises. - @param {String} label An optional label. This is useful - for tooling. - */ -function race$1(array, label) { - return Promise.race(array, label); -} - -function PromiseHash(Constructor, object, label) { - this._superConstructor(Constructor, object, true, label); -} - -PromiseHash.prototype = o_create(Enumerator.prototype); -PromiseHash.prototype._superConstructor = Enumerator; -PromiseHash.prototype._init = function() { - this._result = {}; -}; - -PromiseHash.prototype._validateInput = function(input) { - return input && typeof input === 'object'; -}; - -PromiseHash.prototype._validationError = function() { - return new Error('Promise.hash must be called with an object'); -}; - -PromiseHash.prototype._enumerate = function() { - var enumerator = this; - var promise = enumerator.promise; - var input = enumerator._input; - var results = []; - - for (var key in input) { - if (promise._state === PENDING && Object.prototype.hasOwnProperty.call(input, key)) { - results.push({ - position: key, - entry: input[key] + ``` + + Errback Example + + ```js + + function foundBooks(books) { + + } + + function failure(reason) { + + } + + findAuthor(function(author, err){ + if (err) { + failure(err); + // failure + } else { + try { + findBoooksByAuthor(author, function(books, err) { + if (err) { + failure(err); + } else { + try { + foundBooks(books); + } catch(reason) { + failure(reason); + } + } + }); + } catch(error) { + failure(err); + } + // success + } }); - } - } - - var length = results.length; - enumerator._remaining = length; - var result; - - for (var i = 0; promise._state === PENDING && i < length; i++) { - result = results[i]; - enumerator._eachEntry(result.entry, result.position); - } -}; - -/** - `RSVP.hash` is similar to `RSVP.all`, but takes an object instead of an array - for its `promises` argument. - - Returns a promise that is fulfilled when all the given promises have been - fulfilled, or rejected if any of them become rejected. The returned promise - is fulfilled with a hash that has the same key names as the `promises` object - argument. If any of the values in the object are not promises, they will - simply be copied over to the fulfilled object. - - Example: - - ```javascript - var promises = { - myPromise: RSVP.resolve(1), - yourPromise: RSVP.resolve(2), - theirPromise: RSVP.resolve(3), - notAPromise: 4 - }; - - RSVP.hash(promises).then(function(hash){ - // hash here is an object that looks like: - // { - // myPromise: 1, - // yourPromise: 2, - // theirPromise: 3, - // notAPromise: 4 - // } - }); - ```` - - If any of the `promises` given to `RSVP.hash` are rejected, the first promise - that is rejected will be given as the reason to the rejection handler. - - Example: - - ```javascript - var promises = { - myPromise: RSVP.resolve(1), - rejectedPromise: RSVP.reject(new Error('rejectedPromise')), - anotherRejectedPromise: RSVP.reject(new Error('anotherRejectedPromise')), - }; - - RSVP.hash(promises).then(function(hash){ - // Code here never runs because there are rejected promises! - }, function(reason) { - // reason.message === 'rejectedPromise' - }); - ``` - - An important note: `RSVP.hash` is intended for plain JavaScript objects that - are just a set of keys and values. `RSVP.hash` will NOT preserve prototype - chains. - - Example: - - ```javascript - function MyConstructor(){ - this.example = RSVP.resolve('Example'); - } - - MyConstructor.prototype = { - protoProperty: RSVP.resolve('Proto Property') - }; - - var myObject = new MyConstructor(); - - RSVP.hash(myObject).then(function(hash){ - // protoProperty will not be present, instead you will just have an - // object that looks like: - // { - // example: 'Example' - // } - // - // hash.hasOwnProperty('protoProperty'); // false - // 'undefined' === typeof hash.protoProperty - }); - ``` - - @method hash - @static - @for RSVP - @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. -*/ -function hash(object, label) { - return new PromiseHash(Promise, object, label).promise; -} - -function HashSettled(Constructor, object, label) { - this._superConstructor(Constructor, object, false, label); -} - -HashSettled.prototype = o_create(PromiseHash.prototype); -HashSettled.prototype._superConstructor = Enumerator; -HashSettled.prototype._makeResult = makeSettledResult; - -HashSettled.prototype._validationError = function() { - return new Error('hashSettled must be called with an object'); -}; - -/** - `RSVP.hashSettled` is similar to `RSVP.allSettled`, but takes an object - instead of an array for its `promises` argument. - - Unlike `RSVP.all` or `RSVP.hash`, which implement a fail-fast method, - but like `RSVP.allSettled`, `hashSettled` waits until all the - constituent promises have returned and then shows you all the results - with their states and values/reasons. This is useful if you want to - handle multiple promises' failure states together as a set. - - Returns a promise that is fulfilled when all the given promises have been - settled, or rejected if the passed parameters are invalid. - - The returned promise is fulfilled with a hash that has the same key names as - the `promises` object argument. If any of the values in the object are not - promises, they will be copied over to the fulfilled object and marked with state - 'fulfilled'. - - Example: - - ```javascript - var promises = { - myPromise: RSVP.Promise.resolve(1), - yourPromise: RSVP.Promise.resolve(2), - theirPromise: RSVP.Promise.resolve(3), - notAPromise: 4 - }; - - RSVP.hashSettled(promises).then(function(hash){ - // hash here is an object that looks like: - // { - // myPromise: { state: 'fulfilled', value: 1 }, - // yourPromise: { state: 'fulfilled', value: 2 }, - // theirPromise: { state: 'fulfilled', value: 3 }, - // notAPromise: { state: 'fulfilled', value: 4 } - // } - }); - ``` + ``` + + Promise Example; + + ```javascript + findAuthor(). + then(findBooksByAuthor). + then(function(books){ + // found books + }).catch(function(reason){ + // something went wrong + }); + ``` + + @method then + @param {Function} onFulfillment + @param {Function} onRejection + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + */ + then: then, - If any of the `promises` given to `RSVP.hash` are rejected, the state will - be set to 'rejected' and the reason for rejection provided. + /** + `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same + as the catch block of a try/catch statement. + + ```js + function findAuthor(){ + throw new Error('couldn\'t find that author'); + } + + // synchronous + try { + findAuthor(); + } catch(reason) { + // something went wrong + } + + // async with promises + findAuthor().catch(function(reason){ + // something went wrong + }); + ``` + + @method catch + @param {Function} onRejection + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + */ + catch: function (onRejection, label) { + return this.then(undefined, onRejection, label); + }, - Example: + /** + `finally` will be invoked regardless of the promise's fate just as native + try/catch/finally behaves + + Synchronous example: + + ```js + findAuthor() { + if (Math.random() > 0.5) { + throw new Error(); + } + return new Author(); + } + + try { + return findAuthor(); // succeed or fail + } catch(error) { + return findOtherAuther(); + } finally { + // always runs + // doesn't affect the return value + } + ``` + + Asynchronous example: + + ```js + findAuthor().catch(function(reason){ + return findOtherAuther(); + }).finally(function(){ + // author was either found, or not + }); + ``` + + @method finally + @param {Function} callback + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + */ + finally: function (callback, label) { + var promise = this; + var constructor = promise.constructor; - ```javascript - var promises = { - myPromise: RSVP.Promise.resolve(1), - rejectedPromise: RSVP.Promise.reject(new Error('rejection')), - anotherRejectedPromise: RSVP.Promise.reject(new Error('more rejection')), + return promise.then(function (value) { + return constructor.resolve(callback()).then(function () { + return value; + }); + }, function (reason) { + return constructor.resolve(callback()).then(function () { + throw reason; + }); + }, label); + } }; - RSVP.hashSettled(promises).then(function(hash){ - // hash here is an object that looks like: - // { - // myPromise: { state: 'fulfilled', value: 1 }, - // rejectedPromise: { state: 'rejected', reason: Error }, - // anotherRejectedPromise: { state: 'rejected', reason: Error }, - // } - // Note that for rejectedPromise, reason.message == 'rejection', - // and for anotherRejectedPromise, reason.message == 'more rejection'. - }); - ``` + function Result() { + this.value = undefined; + } - An important note: `RSVP.hashSettled` is intended for plain JavaScript objects that - are just a set of keys and values. `RSVP.hashSettled` will NOT preserve prototype - chains. + var ERROR = new Result(); + var GET_THEN_ERROR$1 = new Result(); - Example: + function getThen$1(obj) { + try { + return obj.then; + } catch (error) { + ERROR.value = error; + return ERROR; + } + } - ```javascript - function MyConstructor(){ - this.example = RSVP.Promise.resolve('Example'); + function tryApply(f, s, a) { + try { + f.apply(s, a); + } catch (error) { + ERROR.value = error; + return ERROR; + } } - MyConstructor.prototype = { - protoProperty: RSVP.Promise.resolve('Proto Property') - }; + function makeObject(_, argumentNames) { + var obj = {}; + var length = _.length; + var args = new Array(length); - var myObject = new MyConstructor(); + for (var x = 0; x < length; x++) { + args[x] = _[x]; + } - RSVP.hashSettled(myObject).then(function(hash){ - // protoProperty will not be present, instead you will just have an - // object that looks like: - // { - // example: { state: 'fulfilled', value: 'Example' } - // } - // - // hash.hasOwnProperty('protoProperty'); // false - // 'undefined' === typeof hash.protoProperty - }); - ``` + for (var i = 0; i < argumentNames.length; i++) { + var _name = argumentNames[i]; + obj[_name] = args[i + 1]; + } - @method hashSettled - @for RSVP - @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 -*/ -function hashSettled(object, label) { - return new HashSettled(Promise, object, label).promise; -} + return obj; + } -/** - `RSVP.rethrow` will rethrow an error on the next turn of the JavaScript event - loop in order to aid debugging. + function arrayResult(_) { + var length = _.length; + var args = new Array(length - 1); - Promises A+ specifies that any exceptions that occur with a promise must be - caught by the promises implementation and bubbled to the last handler. For - this reason, it is recommended that you always specify a second rejection - handler function to `then`. However, `RSVP.rethrow` will throw the exception - outside of the promise, so it bubbles up to your console if in the browser, - or domain/cause uncaught exception in Node. `rethrow` will also throw the - error again so the error can be handled by the promise per the spec. + for (var i = 1; i < length; i++) { + args[i - 1] = _[i]; + } - ```javascript - function throws(){ - throw new Error('Whoops!'); + return args; } - var promise = new RSVP.Promise(function(resolve, reject){ - throws(); - }); - - promise.catch(RSVP.rethrow).then(function(){ - // Code here doesn't run because the promise became rejected due to an - // error! - }, function (err){ - // handle the error here - }); - ``` - - The 'Whoops' error will be thrown on the next turn of the event loop - and you can watch for it in your console. You can also handle it using a - rejection handler given to `.then` or `.catch` on the returned promise. + function wrapThenable(then, promise) { + return { + then: function (onFulFillment, onRejection) { + return then.call(promise, onFulFillment, onRejection); + } + }; + } - @method rethrow - @static - @for RSVP - @param {Error} reason reason the promise became rejected. - @throws Error - @static -*/ -function rethrow(reason) { - setTimeout(function() { - throw reason; - }); - throw reason; -} + /** + `RSVP.denodeify` takes a 'node-style' function and returns a function that + will return an `RSVP.Promise`. You can use `denodeify` in Node.js or the + browser when you'd prefer to use promises over using callbacks. For example, + `denodeify` transforms the following: + + ```javascript + let fs = require('fs'); + + fs.readFile('myfile.txt', function(err, data){ + if (err) return handleError(err); + handleData(data); + }); + ``` + + into: + + ```javascript + let fs = require('fs'); + let readFile = RSVP.denodeify(fs.readFile); + + readFile('myfile.txt').then(handleData, handleError); + ``` + + If the node function has multiple success parameters, then `denodeify` + just returns the first one: + + ```javascript + let request = RSVP.denodeify(require('request')); + + request('http://example.com').then(function(res) { + // ... + }); + ``` + + However, if you need all success parameters, setting `denodeify`'s + second parameter to `true` causes it to return all success parameters + as an array: + + ```javascript + let request = RSVP.denodeify(require('request'), true); + + request('http://example.com').then(function(result) { + // result[0] -> res + // result[1] -> body + }); + ``` + + Or if you pass it an array with names it returns the parameters as a hash: + + ```javascript + let request = RSVP.denodeify(require('request'), ['res', 'body']); + + request('http://example.com').then(function(result) { + // result.res + // result.body + }); + ``` + + Sometimes you need to retain the `this`: + + ```javascript + let app = require('express')(); + let render = RSVP.denodeify(app.render.bind(app)); + ``` + + The denodified function inherits from the original function. It works in all + environments, except IE 10 and below. Consequently all properties of the original + function are available to you. However, any properties you change on the + denodeified function won't be changed on the original function. Example: + + ```javascript + let request = RSVP.denodeify(require('request')), + cookieJar = request.jar(); // <- Inheritance is used here + + request('http://example.com', {jar: cookieJar}).then(function(res) { + // cookieJar.cookies holds now the cookies returned by example.com + }); + ``` + + Using `denodeify` makes it easier to compose asynchronous operations instead + of using callbacks. For example, instead of: + + ```javascript + let fs = require('fs'); + + fs.readFile('myfile.txt', function(err, data){ + if (err) { ... } // Handle error + fs.writeFile('myfile2.txt', data, function(err){ + if (err) { ... } // Handle error + console.log('done') + }); + }); + ``` + + you can chain the operations together using `then` from the returned promise: + + ```javascript + let fs = require('fs'); + let readFile = RSVP.denodeify(fs.readFile); + let writeFile = RSVP.denodeify(fs.writeFile); + + readFile('myfile.txt').then(function(data){ + return writeFile('myfile2.txt', data); + }).then(function(){ + console.log('done') + }).catch(function(error){ + // Handle error + }); + ``` + + @method denodeify + @static + @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} [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. + @return {Function} a function that wraps `nodeFunc` to return an + `RSVP.Promise` + @static + */ + function denodeify(nodeFunc, options) { + var fn = function () { + var self = this; + var l = arguments.length; + var args = new Array(l + 1); + var promiseInput = false; + + for (var i = 0; i < l; ++i) { + var arg = arguments[i]; + + if (!promiseInput) { + // TODO: clean this up + promiseInput = needsPromiseInput(arg); + if (promiseInput === GET_THEN_ERROR$1) { + var p = new Promise(noop); + reject(p, GET_THEN_ERROR$1.value); + return p; + } else if (promiseInput && promiseInput !== true) { + arg = wrapThenable(promiseInput, arg); + } + } + args[i] = arg; + } -/** - `RSVP.defer` returns an object similar to jQuery's `$.Deferred`. - `RSVP.defer` should be used when porting over code reliant on `$.Deferred`'s - interface. New code should use the `RSVP.Promise` constructor instead. + var promise = new Promise(noop); - The object returned from `RSVP.defer` is a plain object with three properties: + args[l] = function (err, val) { + if (err) reject(promise, err);else if (options === undefined) resolve(promise, val);else if (options === true) resolve(promise, arrayResult(arguments));else if (isArray(options)) resolve(promise, makeObject(arguments, options));else resolve(promise, val); + }; - * promise - an `RSVP.Promise`. - * reject - a function that causes the `promise` property on this object to - become rejected - * resolve - a function that causes the `promise` property on this object to - become fulfilled. + if (promiseInput) { + return handlePromiseInput(promise, args, nodeFunc, self); + } else { + return handleValueInput(promise, args, nodeFunc, self); + } + }; - Example: + babelHelpers.defaults(fn, nodeFunc); - ```javascript - var deferred = RSVP.defer(); + return fn; + } - deferred.resolve("Success!"); + function handleValueInput(promise, args, nodeFunc, self) { + var result = tryApply(nodeFunc, self, args); + if (result === ERROR) { + reject(promise, result.value); + } + return promise; + } - deferred.promise.then(function(value){ - // value here is "Success!" - }); - ``` + function handlePromiseInput(promise, args, nodeFunc, self) { + return Promise.all(args).then(function (args) { + var result = tryApply(nodeFunc, self, args); + if (result === ERROR) { + reject(promise, result.value); + } + return promise; + }); + } - @method defer - @static - @for RSVP - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Object} - */ + function needsPromiseInput(arg) { + if (arg && typeof arg === 'object') { + if (arg.constructor === Promise) { + return true; + } else { + return getThen$1(arg); + } + } else { + return false; + } + } -function defer(label) { - var deferred = {}; + /** + This is a convenient alias for `RSVP.Promise.all`. + + @method all + @static + @for RSVP + @param {Array} array Array of promises. + @param {String} label An optional label. This is useful + for tooling. + */ + function all$1(array, label) { + return Promise.all(array, label); + } - deferred['promise'] = new Promise(function(resolve, reject) { - deferred['resolve'] = resolve; - deferred['reject'] = reject; - }, label); + function AllSettled(Constructor, entries, label) { + this._superConstructor(Constructor, entries, false, /* don't abort on reject */label); + } - return deferred; -} + AllSettled.prototype = o_create(Enumerator.prototype); + AllSettled.prototype._superConstructor = Enumerator; + AllSettled.prototype._makeResult = makeSettledResult; + AllSettled.prototype._validationError = function () { + return new Error('allSettled must be called with an array'); + }; -/** - `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 - each item in given to `promises`. `RSVP.map` returns a promise that will - become fulfilled with the result of running `mapFn` on the values the promises - become fulfilled with. + /** + `RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing + a fail-fast method, it waits until all the promises have returned and + shows you all the results. This is useful if you want to handle multiple + promises' failure states together as a set. + + Returns a promise that is fulfilled when all the given promises have been + settled. The return promise is fulfilled with an array of the states of + the promises passed into the `promises` array argument. + + Each state object will either indicate fulfillment or rejection, and + provide the corresponding value or reason. The states will take one of + the following formats: + + ```javascript + { state: 'fulfilled', value: value } + or + { state: 'rejected', reason: reason } + ``` + + Example: + + ```javascript + let promise1 = RSVP.Promise.resolve(1); + let promise2 = RSVP.Promise.reject(new Error('2')); + let promise3 = RSVP.Promise.reject(new Error('3')); + let promises = [ promise1, promise2, promise3 ]; + + RSVP.allSettled(promises).then(function(array){ + // array == [ + // { state: 'fulfilled', value: 1 }, + // { state: 'rejected', reason: Error }, + // { state: 'rejected', reason: Error } + // ] + // Note that for the second item, reason.message will be '2', and for the + // third item, reason.message will be '3'. + }, function(error) { + // Not run. (This block would only be called if allSettled had failed, + // for instance if passed an incorrect argument type.) + }); + ``` + + @method allSettled + @static + @for RSVP + @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. + */ - For example: + function allSettled(entries, label) { + return new AllSettled(Promise, entries, label).promise; + } - ```javascript + /** + This is a convenient alias for `RSVP.Promise.race`. + + @method race + @static + @for RSVP + @param {Array} array Array of promises. + @param {String} label An optional label. This is useful + for tooling. + */ + function race$1(array, label) { + return Promise.race(array, label); + } - var promise1 = RSVP.resolve(1); - var promise2 = RSVP.resolve(2); - var promise3 = RSVP.resolve(3); - var promises = [ promise1, promise2, promise3 ]; + function PromiseHash(Constructor, object, label) { + this._superConstructor(Constructor, object, true, label); + } - var mapFn = function(item){ - return item + 1; + PromiseHash.prototype = o_create(Enumerator.prototype); + PromiseHash.prototype._superConstructor = Enumerator; + PromiseHash.prototype._init = function () { + this._result = {}; }; - RSVP.map(promises, mapFn).then(function(result){ - // result is [ 2, 3, 4 ] - }); - ``` - - If any of the `promises` given to `RSVP.map` are rejected, the first promise - that is rejected will be given as an argument to the returned promise's - rejection handler. For example: - - ```javascript - var promise1 = RSVP.resolve(1); - var promise2 = RSVP.reject(new Error('2')); - var promise3 = RSVP.reject(new Error('3')); - var promises = [ promise1, promise2, promise3 ]; - - var mapFn = function(item){ - return item + 1; + PromiseHash.prototype._validateInput = function (input) { + return input && typeof input === 'object'; }; - RSVP.map(promises, mapFn).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(reason) { - // reason.message === '2' - }); - ``` - - `RSVP.map` will also wait if a promise is returned from `mapFn`. For example, - say you want to get all comments from a set of blog posts, but you need - the blog posts first because they contain a url to those comments. - - ```javscript - - var mapFn = function(blogPost){ - // getComments does some ajax and returns an RSVP.Promise that is fulfilled - // with some comments data - return getComments(blogPost.comments_url); + PromiseHash.prototype._validationError = function () { + return new Error('Promise.hash must be called with an object'); }; - // getBlogPosts does some ajax and returns an RSVP.Promise that is fulfilled - // with some blog post data - RSVP.map(getBlogPosts(), mapFn).then(function(comments){ - // comments is the result of asking the server for the comments - // of all blog posts returned from getBlogPosts() - }); - ``` - - @method map - @static - @for RSVP - @param {Array} promises - @param {Function} mapFn function to be called on each fulfilled promise. - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} promise that is fulfilled with the result of calling - `mapFn` on each fulfilled promise or value when they become fulfilled. - The promise will be rejected if any of the given `promises` become rejected. - @static -*/ -function map(promises, mapFn, label) { - return Promise.all(promises, label).then(function(values) { - if (!isFunction(mapFn)) { - throw new TypeError("You must pass a function as map's second argument."); + PromiseHash.prototype._enumerate = function () { + var enumerator = this; + var promise = enumerator.promise; + var input = enumerator._input; + var results = []; + + for (var key in input) { + if (promise._state === PENDING && Object.prototype.hasOwnProperty.call(input, key)) { + results.push({ + position: key, + entry: input[key] + }); + } } - var length = values.length; - var results = new Array(length); + var length = results.length; + enumerator._remaining = length; + var result = undefined; - for (var i = 0; i < length; i++) { - results[i] = mapFn(values[i]); + for (var i = 0; promise._state === PENDING && i < length; i++) { + result = results[i]; + enumerator._eachEntry(result.entry, result.position); } + }; - return Promise.all(results, label); - }); -} - -/** - This is a convenient alias for `RSVP.Promise.resolve`. - - @method resolve - @static - @for RSVP - @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` -*/ -function resolve$2(value, label) { - return Promise.resolve(value, label); -} + /** + `RSVP.hash` is similar to `RSVP.all`, but takes an object instead of an array + for its `promises` argument. + + Returns a promise that is fulfilled when all the given promises have been + fulfilled, or rejected if any of them become rejected. The returned promise + is fulfilled with a hash that has the same key names as the `promises` object + argument. If any of the values in the object are not promises, they will + simply be copied over to the fulfilled object. + + Example: + + ```javascript + let promises = { + myPromise: RSVP.resolve(1), + yourPromise: RSVP.resolve(2), + theirPromise: RSVP.resolve(3), + notAPromise: 4 + }; + + RSVP.hash(promises).then(function(hash){ + // hash here is an object that looks like: + // { + // myPromise: 1, + // yourPromise: 2, + // theirPromise: 3, + // notAPromise: 4 + // } + }); + ```` + + If any of the `promises` given to `RSVP.hash` are rejected, the first promise + that is rejected will be given as the reason to the rejection handler. + + Example: + + ```javascript + let promises = { + myPromise: RSVP.resolve(1), + rejectedPromise: RSVP.reject(new Error('rejectedPromise')), + anotherRejectedPromise: RSVP.reject(new Error('anotherRejectedPromise')), + }; + + RSVP.hash(promises).then(function(hash){ + // Code here never runs because there are rejected promises! + }, function(reason) { + // reason.message === 'rejectedPromise' + }); + ``` + + An important note: `RSVP.hash` is intended for plain JavaScript objects that + are just a set of keys and values. `RSVP.hash` will NOT preserve prototype + chains. + + Example: + + ```javascript + function MyConstructor(){ + this.example = RSVP.resolve('Example'); + } + + MyConstructor.prototype = { + protoProperty: RSVP.resolve('Proto Property') + }; + + let myObject = new MyConstructor(); + + RSVP.hash(myObject).then(function(hash){ + // protoProperty will not be present, instead you will just have an + // object that looks like: + // { + // example: 'Example' + // } + // + // hash.hasOwnProperty('protoProperty'); // false + // 'undefined' === typeof hash.protoProperty + }); + ``` + + @method hash + @static + @for RSVP + @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. + */ + function hash(object, label) { + return new PromiseHash(Promise, object, label).promise; + } -/** - This is a convenient alias for `RSVP.Promise.reject`. + function HashSettled(Constructor, object, label) { + this._superConstructor(Constructor, object, false, label); + } - @method reject - @static - @for RSVP - @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$2(reason, label) { - return Promise.reject(reason, label); -} + HashSettled.prototype = o_create(PromiseHash.prototype); + HashSettled.prototype._superConstructor = Enumerator; + HashSettled.prototype._makeResult = makeSettledResult; -/** - `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 - each item in given to `promises`. `RSVP.filter` returns a promise that will - become fulfilled with the result of running `filterFn` on the values the - promises become fulfilled with. + HashSettled.prototype._validationError = function () { + return new Error('hashSettled must be called with an object'); + }; - For example: + /** + `RSVP.hashSettled` is similar to `RSVP.allSettled`, but takes an object + instead of an array for its `promises` argument. + + Unlike `RSVP.all` or `RSVP.hash`, which implement a fail-fast method, + but like `RSVP.allSettled`, `hashSettled` waits until all the + constituent promises have returned and then shows you all the results + with their states and values/reasons. This is useful if you want to + handle multiple promises' failure states together as a set. + + Returns a promise that is fulfilled when all the given promises have been + settled, or rejected if the passed parameters are invalid. + + The returned promise is fulfilled with a hash that has the same key names as + the `promises` object argument. If any of the values in the object are not + promises, they will be copied over to the fulfilled object and marked with state + 'fulfilled'. + + Example: + + ```javascript + let promises = { + myPromise: RSVP.Promise.resolve(1), + yourPromise: RSVP.Promise.resolve(2), + theirPromise: RSVP.Promise.resolve(3), + notAPromise: 4 + }; + + RSVP.hashSettled(promises).then(function(hash){ + // hash here is an object that looks like: + // { + // myPromise: { state: 'fulfilled', value: 1 }, + // yourPromise: { state: 'fulfilled', value: 2 }, + // theirPromise: { state: 'fulfilled', value: 3 }, + // notAPromise: { state: 'fulfilled', value: 4 } + // } + }); + ``` + + If any of the `promises` given to `RSVP.hash` are rejected, the state will + be set to 'rejected' and the reason for rejection provided. + + Example: + + ```javascript + let promises = { + myPromise: RSVP.Promise.resolve(1), + rejectedPromise: RSVP.Promise.reject(new Error('rejection')), + anotherRejectedPromise: RSVP.Promise.reject(new Error('more rejection')), + }; + + RSVP.hashSettled(promises).then(function(hash){ + // hash here is an object that looks like: + // { + // myPromise: { state: 'fulfilled', value: 1 }, + // rejectedPromise: { state: 'rejected', reason: Error }, + // anotherRejectedPromise: { state: 'rejected', reason: Error }, + // } + // Note that for rejectedPromise, reason.message == 'rejection', + // and for anotherRejectedPromise, reason.message == 'more rejection'. + }); + ``` + + An important note: `RSVP.hashSettled` is intended for plain JavaScript objects that + are just a set of keys and values. `RSVP.hashSettled` will NOT preserve prototype + chains. + + Example: + + ```javascript + function MyConstructor(){ + this.example = RSVP.Promise.resolve('Example'); + } + + MyConstructor.prototype = { + protoProperty: RSVP.Promise.resolve('Proto Property') + }; + + let myObject = new MyConstructor(); + + RSVP.hashSettled(myObject).then(function(hash){ + // protoProperty will not be present, instead you will just have an + // object that looks like: + // { + // example: { state: 'fulfilled', value: 'Example' } + // } + // + // hash.hasOwnProperty('protoProperty'); // false + // 'undefined' === typeof hash.protoProperty + }); + ``` + + @method hashSettled + @for RSVP + @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 + */ + function hashSettled(object, label) { + return new HashSettled(Promise, object, label).promise; + } - ```javascript + /** + `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 + caught by the promises implementation and bubbled to the last handler. For + this reason, it is recommended that you always specify a second rejection + handler function to `then`. However, `RSVP.rethrow` will throw the exception + outside of the promise, so it bubbles up to your console if in the browser, + or domain/cause uncaught exception in Node. `rethrow` will also throw the + error again so the error can be handled by the promise per the spec. + + ```javascript + function throws(){ + throw new Error('Whoops!'); + } + + let promise = new RSVP.Promise(function(resolve, reject){ + throws(); + }); + + promise.catch(RSVP.rethrow).then(function(){ + // Code here doesn't run because the promise became rejected due to an + // error! + }, function (err){ + // handle the error here + }); + ``` + + The 'Whoops' error will be thrown on the next turn of the event loop + and you can watch for it in your console. You can also handle it using a + rejection handler given to `.then` or `.catch` on the returned promise. + + @method rethrow + @static + @for RSVP + @param {Error} reason reason the promise became rejected. + @throws Error + @static + */ + function rethrow(reason) { + setTimeout(function () { + throw reason; + }); + throw reason; + } - var promise1 = RSVP.resolve(1); - var promise2 = RSVP.resolve(2); - var promise3 = RSVP.resolve(3); + /** + `RSVP.defer` returns an object similar to jQuery's `$.Deferred`. + `RSVP.defer` should be used when porting over code reliant on `$.Deferred`'s + interface. New code should use the `RSVP.Promise` constructor instead. + + The object returned from `RSVP.defer` is a plain object with three properties: + + * promise - an `RSVP.Promise`. + * reject - a function that causes the `promise` property on this object to + become rejected + * resolve - a function that causes the `promise` property on this object to + become fulfilled. + + Example: + + ```javascript + let deferred = RSVP.defer(); + + deferred.resolve("Success!"); + + deferred.promise.then(function(value){ + // value here is "Success!" + }); + ``` + + @method defer + @static + @for RSVP + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Object} + */ - var promises = [promise1, promise2, promise3]; + function defer(label) { + var deferred = { resolve: undefined, reject: undefined }; - var filterFn = function(item){ - return item > 1; - }; + deferred.promise = new Promise(function (resolve, reject) { + deferred.resolve = resolve; + deferred.reject = reject; + }, label); - RSVP.filter(promises, filterFn).then(function(result){ - // result is [ 2, 3 ] - }); - ``` + return deferred; + } - If any of the `promises` given to `RSVP.filter` are rejected, the first promise - that is rejected will be given as an argument to the returned promise's - rejection handler. For example: + /** + `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 + each item in given to `promises`. `RSVP.map` returns a promise that will + become fulfilled with the result of running `mapFn` on the values the promises + become fulfilled with. + + For example: + + ```javascript + + let promise1 = RSVP.resolve(1); + let promise2 = RSVP.resolve(2); + let promise3 = RSVP.resolve(3); + let promises = [ promise1, promise2, promise3 ]; + + let mapFn = function(item){ + return item + 1; + }; + + RSVP.map(promises, mapFn).then(function(result){ + // result is [ 2, 3, 4 ] + }); + ``` + + If any of the `promises` given to `RSVP.map` are rejected, the first promise + that is rejected will be given as an argument to the returned promise's + rejection handler. For example: + + ```javascript + let promise1 = RSVP.resolve(1); + let promise2 = RSVP.reject(new Error('2')); + let promise3 = RSVP.reject(new Error('3')); + let promises = [ promise1, promise2, promise3 ]; + + let mapFn = function(item){ + return item + 1; + }; + + RSVP.map(promises, mapFn).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(reason) { + // reason.message === '2' + }); + ``` + + `RSVP.map` will also wait if a promise is returned from `mapFn`. For example, + say you want to get all comments from a set of blog posts, but you need + the blog posts first because they contain a url to those comments. + + ```javscript + + let mapFn = function(blogPost){ + // getComments does some ajax and returns an RSVP.Promise that is fulfilled + // with some comments data + return getComments(blogPost.comments_url); + }; + + // getBlogPosts does some ajax and returns an RSVP.Promise that is fulfilled + // with some blog post data + RSVP.map(getBlogPosts(), mapFn).then(function(comments){ + // comments is the result of asking the server for the comments + // of all blog posts returned from getBlogPosts() + }); + ``` + + @method map + @static + @for RSVP + @param {Array} promises + @param {Function} mapFn function to be called on each fulfilled promise. + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} promise that is fulfilled with the result of calling + `mapFn` on each fulfilled promise or value when they become fulfilled. + The promise will be rejected if any of the given `promises` become rejected. + @static + */ + function map(promises, mapFn, label) { + return Promise.all(promises, label).then(function (values) { + if (!isFunction(mapFn)) { + throw new TypeError("You must pass a function as map's second argument."); + } - ```javascript - var promise1 = RSVP.resolve(1); - var promise2 = RSVP.reject(new Error('2')); - var promise3 = RSVP.reject(new Error('3')); - var promises = [ promise1, promise2, promise3 ]; + var length = values.length; + var results = new Array(length); - var filterFn = function(item){ - return item > 1; - }; + for (var i = 0; i < length; i++) { + results[i] = mapFn(values[i]); + } - RSVP.filter(promises, filterFn).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(reason) { - // reason.message === '2' - }); - ``` + return Promise.all(results, label); + }); + } - `RSVP.filter` will also wait for any promises returned from `filterFn`. - For instance, you may want to fetch a list of users then return a subset - of those users based on some asynchronous operation: + /** + This is a convenient alias for `RSVP.Promise.resolve`. + + @method resolve + @static + @for RSVP + @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` + */ + function resolve$2(value, label) { + return Promise.resolve(value, label); + } - ```javascript + /** + This is a convenient alias for `RSVP.Promise.reject`. + + @method reject + @static + @for RSVP + @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$2(reason, label) { + return Promise.reject(reason, label); + } - var alice = { name: 'alice' }; - var bob = { name: 'bob' }; - var users = [ alice, bob ]; + /** + `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 + each item in given to `promises`. `RSVP.filter` returns a promise that will + become fulfilled with the result of running `filterFn` on the values the + promises become fulfilled with. + + For example: + + ```javascript + + let promise1 = RSVP.resolve(1); + let promise2 = RSVP.resolve(2); + let promise3 = RSVP.resolve(3); + + let promises = [promise1, promise2, promise3]; + + let filterFn = function(item){ + return item > 1; + }; + + RSVP.filter(promises, filterFn).then(function(result){ + // result is [ 2, 3 ] + }); + ``` + + If any of the `promises` given to `RSVP.filter` are rejected, the first promise + that is rejected will be given as an argument to the returned promise's + rejection handler. For example: + + ```javascript + let promise1 = RSVP.resolve(1); + let promise2 = RSVP.reject(new Error('2')); + let promise3 = RSVP.reject(new Error('3')); + let promises = [ promise1, promise2, promise3 ]; + + let filterFn = function(item){ + return item > 1; + }; + + RSVP.filter(promises, filterFn).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(reason) { + // reason.message === '2' + }); + ``` + + `RSVP.filter` will also wait for any promises returned from `filterFn`. + For instance, you may want to fetch a list of users then return a subset + of those users based on some asynchronous operation: + + ```javascript + + let alice = { name: 'alice' }; + let bob = { name: 'bob' }; + let users = [ alice, bob ]; + + let promises = users.map(function(user){ + return RSVP.resolve(user); + }); + + let filterFn = function(user){ + // Here, Alice has permissions to create a blog post, but Bob does not. + return getPrivilegesForUser(user).then(function(privs){ + return privs.can_create_blog_post === true; + }); + }; + RSVP.filter(promises, filterFn).then(function(users){ + // true, because the server told us only Alice can create a blog post. + users.length === 1; + // false, because Alice is the only user present in `users` + users[0] === bob; + }); + ``` + + @method filter + @static + @for RSVP + @param {Array} promises + @param {Function} filterFn - function to be called on each resolved value to + filter the final results. + @param {String} label optional string describing the promise. Useful for + tooling. + @return {Promise} + */ - var promises = users.map(function(user){ - return RSVP.resolve(user); - }); + function resolveAll(promises, label) { + return Promise.all(promises, label); + } - var filterFn = function(user){ - // Here, Alice has permissions to create a blog post, but Bob does not. - return getPrivilegesForUser(user).then(function(privs){ - return privs.can_create_blog_post === true; + function resolveSingle(promise, label) { + return Promise.resolve(promise, label).then(function (promises) { + return resolveAll(promises, label); }); - }; - RSVP.filter(promises, filterFn).then(function(users){ - // true, because the server told us only Alice can create a blog post. - users.length === 1; - // false, because Alice is the only user present in `users` - users[0] === bob; - }); - ``` + } - @method filter - @static - @for RSVP - @param {Array} promises - @param {Function} filterFn - function to be called on each resolved value to - filter the final results. - @param {String} label optional string describing the promise. Useful for - tooling. - @return {Promise} -*/ -function filter(promises, filterFn, label) { - return Promise.all(promises, label).then(function(values) { - if (!isFunction(filterFn)) { - throw new TypeError("You must pass a function as filter's second argument."); - } + function filter(promises, filterFn, label) { + var promise = isArray(promises) ? resolveAll(promises, label) : resolveSingle(promises, label); + return promise.then(function (values) { + if (!isFunction(filterFn)) { + throw new TypeError("You must pass a function as filter's second argument."); + } - var length = values.length; - var filtered = new Array(length); + var length = values.length; + var filtered = new Array(length); - for (var i = 0; i < length; i++) { - filtered[i] = filterFn(values[i]); - } + for (var i = 0; i < length; i++) { + filtered[i] = filterFn(values[i]); + } - return Promise.all(filtered, label).then(function(filtered) { - var results = new Array(length); - var newLength = 0; + return resolveAll(filtered, label).then(function (filtered) { + var results = new Array(length); + var newLength = 0; - for (var i = 0; i < length; i++) { - if (filtered[i]) { - results[newLength] = values[i]; - newLength++; + for (var i = 0; i < length; i++) { + if (filtered[i]) { + results[newLength] = values[i]; + newLength++; + } } - } - results.length = newLength; + results.length = newLength; - return results; + return results; + }); }); - }); -} - -var len = 0; -var vertxNext; -function asap(callback, arg) { - queue$1[len] = callback; - queue$1[len + 1] = arg; - len += 2; - if (len === 2) { - // If len is 1, that means that we need to schedule an async flush. - // If additional callbacks are queued before the queue is flushed, they - // will be processed by this flush that we are scheduling. - scheduleFlush$1(); } -} -var browserWindow = (typeof window !== 'undefined') ? window : undefined; -var browserGlobal = browserWindow || {}; -var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; -var isNode = typeof self === '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() { - nextTick(flush); - }; -} + var len = 0; + var vertxNext = undefined; + function asap(callback, arg) { + queue$1[len] = callback; + queue$1[len + 1] = arg; + len += 2; + if (len === 2) { + // If len is 1, that means that we need to schedule an async flush. + // If additional callbacks are queued before the queue is flushed, they + // will be processed by this flush that we are scheduling. + scheduleFlush$1(); + } + } -// vertx -function useVertxTimer() { - return function() { - vertxNext(flush); - }; -} + var browserWindow = typeof window !== 'undefined' ? window : undefined; + var browserGlobal = browserWindow || {}; + var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; + var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && ({}).toString.call(process) === '[object process]'; -function useMutationObserver() { - var iterations = 0; - var observer = new BrowserMutationObserver(flush); - var node = document.createTextNode(''); - observer.observe(node, { characterData: true }); + // test for web worker but not in IE10 + var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined'; - return function() { - node.data = (iterations = ++iterations % 2); - }; -} + // 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 () { + return nextTick(flush); + }; + } -// web worker -function useMessageChannel() { - var channel = new MessageChannel(); - channel.port1.onmessage = flush; - return function () { - channel.port2.postMessage(0); - }; -} + // vertx + function useVertxTimer() { + if (typeof vertxNext !== 'undefined') { + return function () { + vertxNext(flush); + }; + } + return useSetTimeout(); + } -function useSetTimeout() { - return function() { - setTimeout(flush, 1); - }; -} + function useMutationObserver() { + var iterations = 0; + var observer = new BrowserMutationObserver(flush); + var node = document.createTextNode(''); + observer.observe(node, { characterData: true }); -var queue$1 = new Array(1000); -function flush() { - for (var i = 0; i < len; i+=2) { - var callback = queue$1[i]; - var arg = queue$1[i+1]; + return function () { + return node.data = iterations = ++iterations % 2; + }; + } - callback(arg); + // web worker + function useMessageChannel() { + var channel = new MessageChannel(); + channel.port1.onmessage = flush; + return function () { + return channel.port2.postMessage(0); + }; + } - queue$1[i] = undefined; - queue$1[i+1] = undefined; + function useSetTimeout() { + return function () { + return setTimeout(flush, 1); + }; } - len = 0; -} + var queue$1 = new Array(1000); -function attemptVertex() { - try { - var r = require; - var vertx = r('vertx'); - vertxNext = vertx.runOnLoop || vertx.runOnContext; - return useVertxTimer(); - } catch(e) { - return useSetTimeout(); + function flush() { + for (var i = 0; i < len; i += 2) { + var callback = queue$1[i]; + var arg = queue$1[i + 1]; + + callback(arg); + + queue$1[i] = undefined; + queue$1[i + 1] = undefined; + } + + len = 0; } -} -var scheduleFlush$1; -// Decide what async method to use to triggering processing of queued callbacks: -if (isNode) { - scheduleFlush$1 = useNextTick(); -} else if (BrowserMutationObserver) { - scheduleFlush$1 = useMutationObserver(); -} else if (isWorker) { - scheduleFlush$1 = useMessageChannel(); -} else if (browserWindow === undefined && typeof require === 'function') { - scheduleFlush$1 = attemptVertex(); -} else { - scheduleFlush$1 = useSetTimeout(); -} + function attemptVertex() { + try { + var r = require; + var vertx = r('vertx'); + vertxNext = vertx.runOnLoop || vertx.runOnContext; + return useVertxTimer(); + } catch (e) { + return useSetTimeout(); + } + } -// defaults -config.async = asap; -config.after = function(cb) { - setTimeout(cb, 0); -}; -var cast = resolve$2; -function async(callback, arg) { - config.async(callback, arg); -} + var scheduleFlush$1 = undefined; + // Decide what async method to use to triggering processing of queued callbacks: + if (isNode) { + scheduleFlush$1 = useNextTick(); + } else if (BrowserMutationObserver) { + scheduleFlush$1 = useMutationObserver(); + } else if (isWorker) { + scheduleFlush$1 = useMessageChannel(); + } else if (browserWindow === undefined && typeof require === 'function') { + scheduleFlush$1 = attemptVertex(); + } else { + scheduleFlush$1 = useSetTimeout(); + } -function on() { - config['on'].apply(config, arguments); -} + var platform = undefined; -function off() { - config['off'].apply(config, arguments); -} + /* global self */ + if (typeof self === 'object') { + platform = self; -// Set up instrumentation through `window.__PROMISE_INTRUMENTATION__` -if (typeof window !== 'undefined' && typeof window['__PROMISE_INSTRUMENTATION__'] === 'object') { - var callbacks = window['__PROMISE_INSTRUMENTATION__']; - configure('instrument', true); - for (var eventName in callbacks) { - if (callbacks.hasOwnProperty(eventName)) { - on(eventName, callbacks[eventName]); + /* global global */ + } else if (typeof global === 'object') { + platform = global; + } else { + throw new Error('no global: `self` or `global` found'); } - } -} -exports.cast = cast; -exports.Promise = Promise; -exports.EventTarget = EventTarget; -exports.all = all$1; -exports.allSettled = allSettled; -exports.race = race$1; -exports.hash = hash; -exports.hashSettled = hashSettled; -exports.rethrow = rethrow; -exports.defer = defer; -exports.denodeify = denodeify; -exports.configure = configure; -exports.on = on; -exports.off = off; -exports.resolve = resolve$2; -exports.reject = reject$2; -exports.async = async; -exports.map = map; -exports.filter = filter; + // defaults + config.async = asap; + config.after = function (cb) { + return setTimeout(cb, 0); + }; + var cast = resolve$2; -Object.defineProperty(exports, '__esModule', { value: true }); + var async = function (callback, arg) { + return config.async(callback, arg); + }; + function on() { + config['on'].apply(config, arguments); + } + + function off() { + config['off'].apply(config, arguments); + } + + // Set up instrumentation through `window.__PROMISE_INTRUMENTATION__` + if (typeof window !== 'undefined' && typeof window['__PROMISE_INSTRUMENTATION__'] === 'object') { + var callbacks = window['__PROMISE_INSTRUMENTATION__']; + configure('instrument', true); + for (var eventName in callbacks) { + if (callbacks.hasOwnProperty(eventName)) { + on(eventName, callbacks[eventName]); + } + } + } + + // the default export here is for backwards compat: + // https://github.com/tildeio/rsvp.js/issues/434 + var rsvp = (_rsvp = { + cast: cast, + Promise: Promise, + EventTarget: EventTarget, + all: all$1, + allSettled: allSettled, + race: race$1, + hash: hash, + hashSettled: hashSettled, + rethrow: rethrow, + defer: defer, + denodeify: denodeify, + configure: configure, + on: on, + off: off, + resolve: resolve$2, + reject: reject$2, + map: map + }, _rsvp['async'] = async, _rsvp.filter = // babel seems to error if async isn't a computed prop here... + filter, _rsvp); + + exports.cast = cast; + exports.Promise = Promise; + exports.EventTarget = EventTarget; + exports.all = all$1; + exports.allSettled = allSettled; + exports.race = race$1; + exports.hash = hash; + exports.hashSettled = hashSettled; + exports.rethrow = rethrow; + exports.defer = defer; + exports.denodeify = denodeify; + exports.configure = configure; + exports.on = on; + exports.off = off; + exports.resolve = resolve$2; + exports.reject = reject$2; + exports.map = map; + exports.async = async; + exports.filter = filter; + exports.default = rsvp; }); (function (m) { if (typeof module === "object" && module.exports) { module.exports = m } }(requireModule("ember-runtime").default)); diff --git a/ember-template-compiler.js b/ember-template-compiler.js index 7390c8661..865dec60f 100644 --- a/ember-template-compiler.js +++ b/ember-template-compiler.js @@ -1,16 +1,16 @@ ;(function() { /*! * @overview Ember - JavaScript Application Framework - * @copyright Copyright 2011-2016 Tilde Inc. and contributors + * @copyright Copyright 2011-2017 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.10.2-with-backtracking + * @version 2.12.0-canary-with-backtracking */ var enifed, requireModule, Ember; -var mainContext = this; +var mainContext = this; // Used in ember-environment/lib/global.js (function() { var isNode = typeof window === 'undefined' && @@ -112,8 +112,6 @@ var mainContext = this; } })(); -var babelHelpers; - function classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); @@ -186,24972 +184,16474 @@ babelHelpers = { defaults: defaults }; -enifed('backburner', ['exports'], function (exports) { 'use strict'; - -var NUMBER = /\d+/; - -function each(collection, callback) { - for (var i = 0; i < collection.length; i++) { - callback(collection[i]); - } -} - -function isString(suspect) { - return typeof suspect === 'string'; -} - -function isFunction(suspect) { - return typeof suspect === 'function'; -} - -function isNumber(suspect) { - return typeof suspect === 'number'; -} - -function isCoercableNumber(number) { - return isNumber(number) || NUMBER.test(number); -} - -function binarySearch(time, timers) { - var start = 0; - var end = timers.length - 2; - var middle, l; - - while (start < end) { - // since timers is an array of pairs 'l' will always - // be an integer - l = (end - start) / 2; - - // compensate for the index in case even number - // of pairs inside timers - middle = start + l - (l % 2); - - if (time >= timers[middle]) { - start = middle + 2; - } else { - end = middle; - } - } - - return (time >= timers[start]) ? start + 2 : start; -} - -function Queue(name, options, globalOptions) { - this.name = name; - this.globalOptions = globalOptions || {}; - this.options = options; - this._queue = []; - this.targetQueues = {}; - this._queueBeingFlushed = undefined; -} +enifed('@glimmer/compiler', ['exports', '@glimmer/syntax', '@glimmer/util', '@glimmer/wire-format'], function (exports, _glimmerSyntax, _glimmerUtil, _glimmerWireFormat) { + 'use strict'; -Queue.prototype = { - push: function(target, method, args, stack) { - var queue = this._queue; - queue.push(target, method, args, stack); + var push = Array.prototype.push; - return { - queue: this, - target: target, - method: method + var Frame = function Frame() { + this.parentNode = null; + this.children = null; + this.childIndex = null; + this.childCount = null; + this.childTemplateCount = 0; + this.mustacheCount = 0; + this.actions = []; + this.blankChildTextNodes = null; + this.symbols = null; }; - }, - pushUniqueWithoutGuid: function(target, method, args, stack) { - var queue = this._queue; - - for (var i = 0, l = queue.length; i < l; i += 4) { - var currentTarget = queue[i]; - var currentMethod = queue[i+1]; - - if (currentTarget === target && currentMethod === method) { - queue[i+2] = args; // replace args - queue[i+3] = stack; // replace stack - return; - } - } - - queue.push(target, method, args, stack); - }, + var SymbolTable = (function () { + function SymbolTable(symbols) { + var parent = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; - targetQueue: function(targetQueue, target, method, args, stack) { - var queue = this._queue; + this.symbols = symbols; + this.parent = parent; + } - for (var i = 0, l = targetQueue.length; i < l; i += 2) { - var currentMethod = targetQueue[i]; - var currentIndex = targetQueue[i + 1]; + /** + * Takes in an AST and outputs a list of actions to be consumed + * by a compiler. For example, the template + * + * foo{{bar}}
    baz
    + * + * produces the actions + * + * [['startProgram', [programNode, 0]], + * ['text', [textNode, 0, 3]], + * ['mustache', [mustacheNode, 1, 3]], + * ['openElement', [elementNode, 2, 3, 0]], + * ['text', [textNode, 0, 1]], + * ['closeElement', [elementNode, 2, 3], + * ['endProgram', [programNode]]] + * + * This visitor walks the AST depth first and backwards. As + * a result the bottom-most child template will appear at the + * top of the actions list whereas the root template will appear + * at the bottom of the list. For example, + * + *
    {{#if}}foo{{else}}bar{{/if}}
    + * + * produces the actions + * + * [['startProgram', [programNode, 0]], + * ['text', [textNode, 0, 2, 0]], + * ['openElement', [elementNode, 1, 2, 0]], + * ['closeElement', [elementNode, 1, 2]], + * ['endProgram', [programNode]], + * ['startProgram', [programNode, 0]], + * ['text', [textNode, 0, 1]], + * ['endProgram', [programNode]], + * ['startProgram', [programNode, 2]], + * ['openElement', [elementNode, 0, 1, 1]], + * ['block', [blockNode, 0, 1]], + * ['closeElement', [elementNode, 0, 1]], + * ['endProgram', [programNode]]] + * + * The state of the traversal is maintained by a stack of frames. + * Whenever a node with children is entered (either a ProgramNode + * or an ElementNode) a frame is pushed onto the stack. The frame + * contains information about the state of the traversal of that + * node. For example, + * + * - index of the current child node being visited + * - the number of mustaches contained within its child nodes + * - the list of actions generated by its child nodes + */ - if (currentMethod === method) { - queue[currentIndex + 2] = args; // replace args - queue[currentIndex + 3] = stack; // replace stack - return; - } - } + SymbolTable.prototype.hasLocalVariable = function hasLocalVariable(name) { + var symbols = this.symbols; + var parent = this.parent; - targetQueue.push( - method, - queue.push(target, method, args, stack) - 4 - ); - }, + return symbols.indexOf(name) >= 0 || parent && parent.hasLocalVariable(name); + }; - pushUniqueWithGuid: function(guid, target, method, args, stack) { - var hasLocalQueue = this.targetQueues[guid]; + return SymbolTable; + })(); - if (hasLocalQueue) { - this.targetQueue(hasLocalQueue, target, method, args, stack); - } else { - this.targetQueues[guid] = [ - method, - this._queue.push(target, method, args, stack) - 4 - ]; + function TemplateVisitor() { + this.frameStack = []; + this.actions = []; + this.programDepth = -1; } - - return { - queue: this, - target: target, - method: method + // Traversal methods + TemplateVisitor.prototype.visit = function (node) { + this[node.type](node); }; - }, - - pushUnique: function(target, method, args, stack) { - var KEY = this.globalOptions.GUID_KEY; - - if (target && KEY) { - var guid = target[KEY]; - if (guid) { - return this.pushUniqueWithGuid(guid, target, method, args, stack); - } - } - - this.pushUniqueWithoutGuid(target, method, args, stack); - - return { - queue: this, - target: target, - method: method + TemplateVisitor.prototype.Program = function (program) { + this.programDepth++; + var parentFrame = this.getCurrentFrame(); + var programFrame = this.pushFrame(); + if (parentFrame) { + program.symbols = new SymbolTable(program.blockParams, parentFrame.symbols); + } else { + program.symbols = new SymbolTable(program.blockParams); + } + var startType = undefined, + endType = undefined; + if (this.programDepth === 0) { + startType = 'startProgram'; + endType = 'endProgram'; + } else { + startType = 'startBlock'; + endType = 'endBlock'; + } + programFrame.parentNode = program; + programFrame.children = program.body; + programFrame.childCount = program.body.length; + programFrame.blankChildTextNodes = []; + programFrame.actions.push([endType, [program, this.programDepth]]); + programFrame.symbols = program.symbols; + for (var i = program.body.length - 1; i >= 0; i--) { + programFrame.childIndex = i; + this.visit(program.body[i]); + } + programFrame.actions.push([startType, [program, programFrame.childTemplateCount, programFrame.blankChildTextNodes.reverse()]]); + this.popFrame(); + this.programDepth--; + // Push the completed template into the global actions list + if (parentFrame) { + parentFrame.childTemplateCount++; + } + push.apply(this.actions, programFrame.actions.reverse()); }; - }, - - invoke: function(target, method, args /*, onError, errorRecordedForStack */) { - if (args && args.length > 0) { - method.apply(target, args); - } else { - method.call(target); - } - }, - - invokeWithOnError: function(target, method, args, onError, errorRecordedForStack) { - try { - if (args && args.length > 0) { - method.apply(target, args); - } else { - method.call(target); - } - } catch(error) { - onError(error, errorRecordedForStack); + TemplateVisitor.prototype.ElementNode = function (element) { + var parentFrame = this.getCurrentFrame(); + var elementFrame = this.pushFrame(); + elementFrame.parentNode = element; + elementFrame.children = element.children; + elementFrame.childCount = element.children.length; + elementFrame.mustacheCount += element.modifiers.length; + elementFrame.blankChildTextNodes = []; + elementFrame.symbols = parentFrame.symbols; + var actionArgs = [element, parentFrame.childIndex, parentFrame.childCount]; + elementFrame.actions.push(['closeElement', actionArgs]); + for (var i = element.attributes.length - 1; i >= 0; i--) { + this.visit(element.attributes[i]); + } + for (var i = element.children.length - 1; i >= 0; i--) { + elementFrame.childIndex = i; + this.visit(element.children[i]); + } + elementFrame.actions.push(['openElement', actionArgs.concat([elementFrame.mustacheCount, elementFrame.blankChildTextNodes.reverse()])]); + this.popFrame(); + // Propagate the element's frame state to the parent frame + if (elementFrame.mustacheCount > 0) { + parentFrame.mustacheCount++; + } + parentFrame.childTemplateCount += elementFrame.childTemplateCount; + push.apply(parentFrame.actions, elementFrame.actions); + }; + TemplateVisitor.prototype.AttrNode = function (attr) { + if (attr.value.type !== 'TextNode') { + this.getCurrentFrame().mustacheCount++; + } + }; + TemplateVisitor.prototype.TextNode = function (text) { + var frame = this.getCurrentFrame(); + if (text.chars === '') { + frame.blankChildTextNodes.push(domIndexOf(frame.children, text)); + } + frame.actions.push(['text', [text, frame.childIndex, frame.childCount]]); + }; + TemplateVisitor.prototype.BlockStatement = function (node) { + var frame = this.getCurrentFrame(); + frame.mustacheCount++; + frame.actions.push(['block', [node, frame.childIndex, frame.childCount]]); + if (node.inverse) { + this.visit(node.inverse); + } + if (node.program) { + this.visit(node.program); + } + }; + TemplateVisitor.prototype.PartialStatement = function (node) { + var frame = this.getCurrentFrame(); + frame.mustacheCount++; + frame.actions.push(['mustache', [node, frame.childIndex, frame.childCount]]); + }; + TemplateVisitor.prototype.CommentStatement = function (text) { + var frame = this.getCurrentFrame(); + frame.actions.push(['comment', [text, frame.childIndex, frame.childCount]]); + }; + TemplateVisitor.prototype.MustacheCommentStatement = function () { + // Intentional empty: Handlebars comments should not affect output. + }; + TemplateVisitor.prototype.MustacheStatement = function (mustache) { + var frame = this.getCurrentFrame(); + frame.mustacheCount++; + frame.actions.push(['mustache', [mustache, frame.childIndex, frame.childCount]]); + }; + // Frame helpers + TemplateVisitor.prototype.getCurrentFrame = function () { + return this.frameStack[this.frameStack.length - 1]; + }; + TemplateVisitor.prototype.pushFrame = function () { + var frame = new Frame(); + this.frameStack.push(frame); + return frame; + }; + TemplateVisitor.prototype.popFrame = function () { + return this.frameStack.pop(); + }; + // Returns the index of `domNode` in the `nodes` array, skipping + // over any nodes which do not represent DOM nodes. + function domIndexOf(nodes, domNode) { + var index = -1; + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + if (node.type !== 'TextNode' && node.type !== 'ElementNode') { + continue; + } else { + index++; + } + if (node === domNode) { + return index; + } + } + return -1; } - }, - - flush: function(sync) { - var queue = this._queue; - var length = queue.length; - if (length === 0) { - return; - } + var Block = (function () { + function Block() { + this.type = "block"; + this.statements = []; + this.positionals = []; + } - var globalOptions = this.globalOptions; - var options = this.options; - var before = options && options.before; - var after = options && options.after; - var onError = globalOptions.onError || (globalOptions.onErrorTarget && - globalOptions.onErrorTarget[globalOptions.onErrorMethod]); - var target, method, args, errorRecordedForStack; - var invoke = onError ? this.invokeWithOnError : this.invoke; + Block.prototype.toJSON = function toJSON() { + return { + statements: this.statements, + locals: this.positionals + }; + }; - this.targetQueues = Object.create(null); - var queueItems = this._queueBeingFlushed = this._queue.slice(); - this._queue = []; + Block.prototype.push = function push(statement) { + this.statements.push(statement); + }; - if (before) { - before(); - } + return Block; + })(); - for (var i = 0; i < length; i += 4) { - target = queueItems[i]; - method = queueItems[i+1]; - args = queueItems[i+2]; - errorRecordedForStack = queueItems[i+3]; // Debugging assistance + var TemplateBlock = (function (_Block) { + babelHelpers.inherits(TemplateBlock, _Block); - if (isString(method)) { - method = target[method]; - } + function TemplateBlock() { + _Block.apply(this, arguments); + this.type = "template"; + this.yields = new _glimmerUtil.DictSet(); + this.named = new _glimmerUtil.DictSet(); + this.blocks = []; + this.hasPartials = false; + } - // method could have been nullified / canceled during flush - if (method) { - // - // ** Attention intrepid developer ** - // - // To find out the stack of this task when it was scheduled onto - // the run loop, add the following to your app.js: - // - // Ember.run.backburner.DEBUG = true; // NOTE: This slows your app, don't leave it on in production. - // - // Once that is in place, when you are at a breakpoint and navigate - // here in the stack explorer, you can look at `errorRecordedForStack.stack`, - // which will be the captured stack when this job was scheduled. - // - // One possible long-term solution is the following Chrome issue: - // https://bugs.chromium.org/p/chromium/issues/detail?id=332624 - // - invoke(target, method, args, onError, errorRecordedForStack); - } - } + TemplateBlock.prototype.toJSON = function toJSON() { + return { + statements: this.statements, + locals: this.positionals, + named: this.named.toArray(), + yields: this.yields.toArray(), + hasPartials: this.hasPartials + }; + }; - if (after) { - after(); - } + return TemplateBlock; + })(Block); - this._queueBeingFlushed = undefined; + var ComponentBlock = (function (_Block2) { + babelHelpers.inherits(ComponentBlock, _Block2); - if (sync !== false && - this._queue.length > 0) { - // check if new items have been added - this.flush(true); - } - }, + function ComponentBlock() { + _Block2.apply(this, arguments); + this.type = "component"; + this.attributes = []; + this.arguments = []; + this.inParams = true; + } + + ComponentBlock.prototype.push = function push(statement) { + if (this.inParams) { + if (_glimmerWireFormat.Statements.isFlushElement(statement)) { + this.inParams = false; + } else if (_glimmerWireFormat.Statements.isArgument(statement)) { + this.arguments.push(statement); + } else if (_glimmerWireFormat.Statements.isAttribute(statement)) { + this.attributes.push(statement); + } else if (_glimmerWireFormat.Statements.isModifier(statement)) { + throw new Error('Compile Error: Element modifiers are not allowed in components'); + } else { + throw new Error('Compile Error: only parameters allowed before flush-element'); + } + } else { + this.statements.push(statement); + } + }; - cancel: function(actionToCancel) { - var queue = this._queue, currentTarget, currentMethod, i, l; - var target = actionToCancel.target; - var method = actionToCancel.method; - var GUID_KEY = this.globalOptions.GUID_KEY; + ComponentBlock.prototype.toJSON = function toJSON() { + var args = this.arguments; + var keys = args.map(function (arg) { + return arg[1]; + }); + var values = args.map(function (arg) { + return arg[2]; + }); + return { + attrs: this.attributes, + args: [keys, values], + locals: this.positionals, + statements: this.statements + }; + }; - if (GUID_KEY && this.targetQueues && target) { - var targetQueue = this.targetQueues[target[GUID_KEY]]; + return ComponentBlock; + })(Block); - if (targetQueue) { - for (i = 0, l = targetQueue.length; i < l; i++) { - if (targetQueue[i] === method) { - targetQueue.splice(i, 1); - } + var Template = (function () { + function Template(meta) { + this.meta = meta; + this.block = new TemplateBlock(); } - } - } - for (i = 0, l = queue.length; i < l; i += 4) { - currentTarget = queue[i]; - currentMethod = queue[i+1]; + Template.prototype.toJSON = function toJSON() { + return { + block: this.block.toJSON(), + meta: this.meta + }; + }; - if (currentTarget === target && - currentMethod === method) { - queue.splice(i, 4); - return true; - } - } + return Template; + })(); - // if not found in current queue - // could be in the queue that is being flushed - queue = this._queueBeingFlushed; + var JavaScriptCompiler = (function () { + function JavaScriptCompiler(opcodes, meta) { + this.blocks = new _glimmerUtil.Stack(); + this.values = []; + this.opcodes = opcodes; + this.template = new Template(meta); + } - if (!queue) { - return; - } + JavaScriptCompiler.process = function process(opcodes, meta) { + var compiler = new JavaScriptCompiler(opcodes, meta); + return compiler.process(); + }; - for (i = 0, l = queue.length; i < l; i += 4) { - currentTarget = queue[i]; - currentMethod = queue[i+1]; + JavaScriptCompiler.prototype.process = function process() { + var _this = this; - if (currentTarget === target && - currentMethod === method) { - // don't mess with array during flush - // just nullify the method - queue[i+1] = null; - return true; - } - } - } -}; + this.opcodes.forEach(function (_ref) { + var opcode = _ref[0]; -function DeferredActionQueues(queueNames, options) { - var queues = this.queues = {}; - this.queueNames = queueNames = queueNames || []; + var args = _ref.slice(1); - this.options = options; + if (!_this[opcode]) { + throw new Error('unimplemented ' + opcode + ' on JavaScriptCompiler'); + } + _this[opcode].apply(_this, args); + }); + return this.template; + }; - each(queueNames, function(queueName) { - queues[queueName] = new Queue(queueName, options[queueName], options); - }); -} + /// Nesting -function noSuchQueue(name) { - throw new Error('You attempted to schedule an action in a queue (' + name + ') that doesn\'t exist'); -} + JavaScriptCompiler.prototype.startBlock = function startBlock(_ref2) { + var program = _ref2[0]; -function noSuchMethod(name) { - throw new Error('You attempted to schedule an action in a queue (' + name + ') for a method that doesn\'t exist'); -} + var block = new Block(); + block.positionals = program.blockParams; + this.blocks.push(block); + }; -DeferredActionQueues.prototype = { - schedule: function(name, target, method, args, onceFlag, stack) { - var queues = this.queues; - var queue = queues[name]; + JavaScriptCompiler.prototype.endBlock = function endBlock() { + var template = this.template; + var blocks = this.blocks; - if (!queue) { - noSuchQueue(name); - } + template.block.blocks.push(blocks.pop().toJSON()); + }; - if (!method) { - noSuchMethod(name); - } + JavaScriptCompiler.prototype.startProgram = function startProgram() { + this.blocks.push(this.template.block); + }; - if (onceFlag) { - return queue.pushUnique(target, method, args, stack); - } else { - return queue.push(target, method, args, stack); - } - }, + JavaScriptCompiler.prototype.endProgram = function endProgram() {}; - flush: function() { - var queues = this.queues; - var queueNames = this.queueNames; - var queueName, queue; - var queueNameIndex = 0; - var numberOfQueues = queueNames.length; + /// Statements - while (queueNameIndex < numberOfQueues) { - queueName = queueNames[queueNameIndex]; - queue = queues[queueName]; + JavaScriptCompiler.prototype.text = function text(content) { + this.push(['text', content]); + }; - var numberOfQueueItems = queue._queue.length; + JavaScriptCompiler.prototype.append = function append(trusted) { + this.push(['append', this.popValue(), trusted]); + }; - if (numberOfQueueItems === 0) { - queueNameIndex++; - } else { - queue.flush(false /* async */); - queueNameIndex = 0; - } - } - } -}; + JavaScriptCompiler.prototype.comment = function comment(value) { + this.push(['comment', value]); + }; -function Backburner(queueNames, options) { - this.queueNames = queueNames; - this.options = options || {}; - if (!this.options.defaultQueue) { - this.options.defaultQueue = queueNames[0]; - } - this.instanceStack = []; - this._debouncees = []; - this._throttlers = []; - this._eventCallbacks = { - end: [], - begin: [] - }; + JavaScriptCompiler.prototype.modifier = function modifier(path) { + var params = this.popValue(); + var hash = this.popValue(); + this.push(['modifier', path, params, hash]); + }; - var _this = this; - this._boundClearItems = function() { - clearItems(); - }; + JavaScriptCompiler.prototype.block = function block(path, template, inverse) { + var params = this.popValue(); + var hash = this.popValue(); + var blocks = this.template.block.blocks; + _glimmerUtil.assert(typeof template !== 'number' || blocks[template] !== null, 'missing block in the compiler'); + _glimmerUtil.assert(typeof inverse !== 'number' || blocks[inverse] !== null, 'missing block in the compiler'); + this.push(['block', path, params, hash, blocks[template], blocks[inverse]]); + }; - this._timerTimeoutId = undefined; - this._timers = []; + JavaScriptCompiler.prototype.openElement = function openElement(tag, blockParams) { + if (tag.indexOf('-') !== -1) { + this.startComponent(blockParams); + } else { + this.push(['open-element', tag, blockParams]); + } + }; - this._platform = this.options._platform || { - setTimeout: function (fn, ms) { - return setTimeout(fn, ms); - }, - clearTimeout: function (id) { - clearTimeout(id); - } - }; + JavaScriptCompiler.prototype.flushElement = function flushElement() { + this.push(['flush-element']); + }; - this._boundRunExpiredTimers = function () { - _this._runExpiredTimers(); - }; -} + JavaScriptCompiler.prototype.closeElement = function closeElement(tag) { + if (tag.indexOf('-') !== -1) { + var component = this.endComponent(); + this.push(['component', tag, component]); + } else { + this.push(['close-element']); + } + }; -Backburner.prototype = { - begin: function() { - var options = this.options; - var onBegin = options && options.onBegin; - var previousInstance = this.currentInstance; + JavaScriptCompiler.prototype.staticAttr = function staticAttr(name, namespace) { + var value = this.popValue(); + this.push(['static-attr', name, value, namespace]); + }; - if (previousInstance) { - this.instanceStack.push(previousInstance); - } + JavaScriptCompiler.prototype.dynamicAttr = function dynamicAttr(name, namespace) { + var value = this.popValue(); + this.push(['dynamic-attr', name, value, namespace]); + }; - this.currentInstance = new DeferredActionQueues(this.queueNames, options); - this._trigger('begin', this.currentInstance, previousInstance); - if (onBegin) { - onBegin(this.currentInstance, previousInstance); - } - }, + JavaScriptCompiler.prototype.trustingAttr = function trustingAttr(name, namespace) { + var value = this.popValue(); + this.push(['trusting-attr', name, value, namespace]); + }; - end: function() { - var options = this.options; - var onEnd = options && options.onEnd; - var currentInstance = this.currentInstance; - var nextInstance = null; + JavaScriptCompiler.prototype.staticArg = function staticArg(name) { + var value = this.popValue(); + this.push(['static-arg', name.slice(1), value]); + }; - // Prevent double-finally bug in Safari 6.0.2 and iOS 6 - // This bug appears to be resolved in Safari 6.0.5 and iOS 7 - var finallyAlreadyCalled = false; - try { - currentInstance.flush(); - } finally { - if (!finallyAlreadyCalled) { - finallyAlreadyCalled = true; + JavaScriptCompiler.prototype.dynamicArg = function dynamicArg(name) { + var value = this.popValue(); + this.push(['dynamic-arg', name.slice(1), value]); + }; - this.currentInstance = null; + JavaScriptCompiler.prototype.yield = function _yield(to) { + var params = this.popValue(); + this.push(['yield', to, params]); + this.template.block.yields.add(to); + }; - if (this.instanceStack.length) { - nextInstance = this.instanceStack.pop(); - this.currentInstance = nextInstance; - } - this._trigger('end', currentInstance, nextInstance); - if (onEnd) { - onEnd(currentInstance, nextInstance); - } - } - } - }, + JavaScriptCompiler.prototype.debugger = function _debugger() { + this.push(['debugger', null, null]); + }; - /** - 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. + JavaScriptCompiler.prototype.hasBlock = function hasBlock(name) { + this.pushValue(['has-block', name]); + this.template.block.yields.add(name); + }; - @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); - } - } - }, + JavaScriptCompiler.prototype.hasBlockParams = function hasBlockParams(name) { + this.pushValue(['has-block-params', name]); + this.template.block.yields.add(name); + }; - 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; + JavaScriptCompiler.prototype.partial = function partial() { + var params = this.popValue(); + this.push(['partial', params[0]]); + this.template.block.hasPartials = true; + }; - if (length === 1) { - method = arguments[0]; - target = null; - } else { - target = arguments[0]; - method = arguments[1]; - } + /// Expressions - if (isString(method)) { - method = target[method]; - } + JavaScriptCompiler.prototype.literal = function literal(value) { + if (value === undefined) { + this.pushValue(['undefined']); + } else { + this.pushValue(value); + } + }; - if (length > 2) { - args = new Array(length - 2); - for (var i = 0, l = length - 2; i < l; i++) { - args[i] = arguments[i + 2]; - } - } else { - args = []; - } + JavaScriptCompiler.prototype.unknown = function unknown(path) { + this.pushValue(['unknown', path]); + }; - var onError = getOnError(this.options); + JavaScriptCompiler.prototype.arg = function arg(path) { + this.template.block.named.add(path[0]); + this.pushValue(['arg', path]); + }; - this.begin(); + JavaScriptCompiler.prototype.get = function get(path) { + this.pushValue(['get', path]); + }; - // guard against Safari 6's double-finally bug - var didFinally = false; + JavaScriptCompiler.prototype.concat = function concat() { + this.pushValue(['concat', this.popValue()]); + }; - if (onError) { - try { - return method.apply(target, args); - } catch(error) { - onError(error); - } finally { - if (!didFinally) { - didFinally = true; - this.end(); - } - } - } else { - try { - return method.apply(target, args); - } finally { - if (!didFinally) { - didFinally = true; - this.end(); - } - } - } - }, + JavaScriptCompiler.prototype.helper = function helper(path) { + var params = this.popValue(); + var hash = this.popValue(); + this.pushValue(['helper', path, params, hash]); + }; - /* - Join the passed method with an existing queue and execute immediately, - if there isn't one use `Backburner#run`. + /// Stack Management Opcodes - The join method is like the run method except that it will schedule into - an existing queue if one already exists. In either case, the join method will - immediately execute the passed in function and return its result. + JavaScriptCompiler.prototype.startComponent = function startComponent(blockParams) { + var component = new ComponentBlock(); + component.positionals = blockParams; + this.blocks.push(component); + }; - @method join - @param {Object} target - @param {Function} method The method to be executed - @param {any} args The method arguments - @return method result - */ - join: function(/* target, method, args */) { - if (!this.currentInstance) { - return this.run.apply(this, arguments); - } + JavaScriptCompiler.prototype.endComponent = function endComponent() { + var component = this.blocks.pop(); + _glimmerUtil.assert(component.type === 'component', "Compiler bug: endComponent() should end a component"); + return component.toJSON(); + }; - var length = arguments.length; - var method, target; + JavaScriptCompiler.prototype.prepareArray = function prepareArray(size) { + var values = []; + for (var i = 0; i < size; i++) { + values.push(this.popValue()); + } + this.pushValue(values); + }; - if (length === 1) { - method = arguments[0]; - target = null; - } else { - target = arguments[0]; - method = arguments[1]; - } + JavaScriptCompiler.prototype.prepareObject = function prepareObject(size) { + _glimmerUtil.assert(this.values.length >= size, 'Expected ' + size + ' values on the stack, found ' + this.values.length); + var keys = new Array(size); + var values = new Array(size); + for (var i = 0; i < size; i++) { + keys[i] = this.popValue(); + values[i] = this.popValue(); + } + this.pushValue([keys, values]); + }; - if (isString(method)) { - method = target[method]; - } + /// Utilities - if (length === 1) { - return method(); - } else if (length === 2) { - return method.call(target); - } else { - var args = new Array(length - 2); - for (var i = 0, l = length - 2; i < l; i++) { - args[i] = arguments[i + 2]; - } - return method.apply(target, args); - } - }, + JavaScriptCompiler.prototype.push = function push(args) { + while (args[args.length - 1] === null) { + args.pop(); + } + this.blocks.current.push(args); + }; + JavaScriptCompiler.prototype.pushValue = function pushValue(val) { + this.values.push(val); + }; - /* - Defer the passed function to run inside the specified queue. + JavaScriptCompiler.prototype.popValue = function popValue() { + _glimmerUtil.assert(this.values.length, "No expression found on stack"); + return this.values.pop(); + }; - @method defer - @param {String} queueName - @param {Object} target - @param {Function|String} method The method or method name to be executed - @param {any} args The method arguments - @return method result - */ - defer: function(queueName /* , target, method, args */) { - var length = arguments.length; - var method, target, args; + return JavaScriptCompiler; + })(); - if (length === 2) { - method = arguments[1]; - target = null; - } else { - target = arguments[1]; - method = arguments[2]; + function isTrustedValue(value) { + return value.escaped !== undefined && !value.escaped; } - if (isString(method)) { - method = target[method]; - } + var TemplateCompiler = (function () { + function TemplateCompiler(options) { + this.templateId = 0; + this.templateIds = []; + this.symbols = null; + this.opcodes = []; + this.includeMeta = false; + this.options = options || {}; + } - var stack = this.DEBUG ? new Error() : undefined; + TemplateCompiler.compile = function compile(options, ast) { + var templateVisitor = new TemplateVisitor(); + templateVisitor.visit(ast); + var compiler = new TemplateCompiler(options); + var opcodes = compiler.process(templateVisitor.actions); + return JavaScriptCompiler.process(opcodes, options.meta); + }; - if (length > 3) { - args = new Array(length - 3); - for (var i = 3; i < length; i++) { - args[i-3] = arguments[i]; - } - } else { - args = undefined; - } + TemplateCompiler.prototype.process = function process(actions) { + var _this2 = this; - if (!this.currentInstance) { createAutorun(this); } - return this.currentInstance.schedule(queueName, target, method, args, false, stack); - }, + actions.forEach(function (_ref3) { + var name = _ref3[0]; - deferOnce: function(queueName /* , target, method, args */) { - var length = arguments.length; - var method, target, args; + var args = _ref3.slice(1); - if (length === 2) { - method = arguments[1]; - target = null; - } else { - target = arguments[1]; - method = arguments[2]; - } + if (!_this2[name]) { + throw new Error('Unimplemented ' + name + ' on TemplateCompiler'); + } + _this2[name].apply(_this2, args); + }); + return this.opcodes; + }; - if (isString(method)) { - method = target[method]; - } + TemplateCompiler.prototype.startProgram = function startProgram(program) { + this.opcode('startProgram', program, program); + }; - var stack = this.DEBUG ? new Error() : undefined; + TemplateCompiler.prototype.endProgram = function endProgram() { + this.opcode('endProgram', null); + }; - if (length > 3) { - args = new Array(length - 3); - for (var i = 3; i < length; i++) { - args[i-3] = arguments[i]; - } - } else { - args = undefined; - } + TemplateCompiler.prototype.startBlock = function startBlock(program) { + this.symbols = program[0].symbols; + this.templateId++; + this.opcode('startBlock', program, program); + }; - if (!this.currentInstance) { - createAutorun(this); - } - return this.currentInstance.schedule(queueName, target, method, args, true, stack); - }, + TemplateCompiler.prototype.endBlock = function endBlock() { + this.symbols = null; + this.templateIds.push(this.templateId - 1); + this.opcode('endBlock', null); + }; - setTimeout: function() { - var l = arguments.length; - var args = new Array(l); + TemplateCompiler.prototype.text = function text(_ref4) { + var action = _ref4[0]; - for (var x = 0; x < l; x++) { - args[x] = arguments[x]; - } + this.opcode('text', action, action.chars); + }; - var length = args.length, - method, wait, target, - methodOrTarget, methodOrWait, methodOrArgs; + TemplateCompiler.prototype.comment = function comment(_ref5) { + var action = _ref5[0]; - if (length === 0) { - return; - } else if (length === 1) { - method = args.shift(); - wait = 0; - } else if (length === 2) { - methodOrTarget = args[0]; - methodOrWait = args[1]; + this.opcode('comment', action, action.value); + }; - if (isFunction(methodOrWait) || isFunction(methodOrTarget[methodOrWait])) { - target = args.shift(); - method = args.shift(); - wait = 0; - } else if (isCoercableNumber(methodOrWait)) { - method = args.shift(); - wait = args.shift(); - } else { - method = args.shift(); - wait = 0; - } - } else { - var last = args[args.length - 1]; + TemplateCompiler.prototype.openElement = function openElement(_ref6) { + var action = _ref6[0]; - if (isCoercableNumber(last)) { - wait = args.pop(); - } else { - wait = 0; - } + this.opcode('openElement', action, action.tag, action.blockParams); + for (var i = 0; i < action.attributes.length; i++) { + this.attribute([action.attributes[i]]); + } + for (var i = 0; i < action.modifiers.length; i++) { + this.modifier([action.modifiers[i]]); + } + this.opcode('flushElement', null); + }; - methodOrTarget = args[0]; - methodOrArgs = args[1]; + TemplateCompiler.prototype.closeElement = function closeElement(_ref7) { + var action = _ref7[0]; - if (isFunction(methodOrArgs) || (isString(methodOrArgs) && - methodOrTarget !== null && - methodOrArgs in methodOrTarget)) { - target = args.shift(); - method = args.shift(); - } else { - method = args.shift(); - } - } + this.opcode('closeElement', null, action.tag); + }; - var executeAt = Date.now() + parseInt(wait !== wait ? 0 : wait, 10); + TemplateCompiler.prototype.attribute = function attribute(_ref8) { + var action = _ref8[0]; + var name = action.name; + var value = action.value; - if (isString(method)) { - method = target[method]; - } + var namespace = _glimmerUtil.getAttrNamespace(name); + var isStatic = this.prepareAttributeValue(value); + if (name.charAt(0) === '@') { + // Arguments + if (isStatic) { + this.opcode('staticArg', action, name); + } else if (action.value.type === 'MustacheStatement') { + this.opcode('dynamicArg', action, name); + } else { + this.opcode('dynamicArg', action, name); + } + } else { + var isTrusting = isTrustedValue(value); + if (isStatic) { + this.opcode('staticAttr', action, name, namespace); + } else if (isTrusting) { + this.opcode('trustingAttr', action, name, namespace); + } else if (action.value.type === 'MustacheStatement') { + this.opcode('dynamicAttr', action, name); + } else { + this.opcode('dynamicAttr', action, name, namespace); + } + } + }; - var onError = getOnError(this.options); + TemplateCompiler.prototype.modifier = function modifier(_ref9) { + var action = _ref9[0]; + var parts = action.path.parts; - function fn() { - if (onError) { - try { - method.apply(target, args); - } catch (e) { - onError(e); - } - } else { - method.apply(target, args); - } - } + this.prepareHelper(action); + this.opcode('modifier', action, parts); + }; - return this._setTimeout(fn, executeAt); - }, + TemplateCompiler.prototype.mustache = function mustache(_ref10) { + var action = _ref10[0]; - _setTimeout: function (fn, executeAt) { - if (this._timers.length === 0) { - this._timers.push(executeAt, fn); - this._installTimerTimeout(); - return fn; - } + if (isYield(action)) { + var to = assertValidYield(action); + this.yield(to, action); + } else if (isPartial(action)) { + var params = assertValidPartial(action); + this.partial(params, action); + } else if (isDebugger(action)) { + assertValidDebuggerUsage(action); + this.debugger('debugger', action); + } else { + this.mustacheExpression(action); + this.opcode('append', action, !action.escaped); + } + }; - // find position to insert - var i = binarySearch(executeAt, this._timers); + TemplateCompiler.prototype.block = function block(_ref11) /*, index, count*/{ + var action = _ref11[0]; - this._timers.splice(i, 0, executeAt, fn); + this.prepareHelper(action); + var templateId = this.templateIds.pop(); + var inverseId = action.inverse === null ? null : this.templateIds.pop(); + this.opcode('block', action, action.path.parts, templateId, inverseId); + }; - // we should be the new earliest timer if i == 0 - if (i === 0) { - this._reinstallTimerTimeout(); - } + /// Internal actions, not found in the original processed actions - return fn; - }, + TemplateCompiler.prototype.arg = function arg(_ref12) { + var path = _ref12[0]; + var parts = path.parts; - throttle: function(target, method /* , args, wait, [immediate] */) { - var backburner = this; - var args = new Array(arguments.length); - for (var i = 0; i < arguments.length; i++) { - args[i] = arguments[i]; - } - var immediate = args.pop(); - var wait, throttler, index, timer; + this.opcode('arg', path, parts); + }; - if (isNumber(immediate) || isString(immediate)) { - wait = immediate; - immediate = true; - } else { - wait = args.pop(); - } + TemplateCompiler.prototype.mustacheExpression = function mustacheExpression(expr) { + if (isBuiltInHelper(expr)) { + this.builtInHelper(expr); + } else if (isLiteral(expr)) { + this.opcode('literal', expr, expr.path.value); + } else if (isArg(expr)) { + this.arg([expr.path]); + } else if (isHelperInvocation(expr)) { + this.prepareHelper(expr); + this.opcode('helper', expr, expr.path.parts); + } else if (isSelfGet(expr) || isLocalVariable(expr, this.symbols)) { + this.opcode('get', expr, expr.path.parts); + } else { + this.opcode('unknown', expr, expr.path.parts); + } + }; - wait = parseInt(wait, 10); + /// Internal Syntax - index = findThrottler(target, method, this._throttlers); - if (index > -1) { return this._throttlers[index]; } // throttled + TemplateCompiler.prototype.yield = function _yield(to, action) { + this.prepareParams(action.params); + this.opcode('yield', action, to); + }; - timer = this._platform.setTimeout(function() { - if (!immediate) { - backburner.run.apply(backburner, args); - } - var index = findThrottler(target, method, backburner._throttlers); - if (index > -1) { - backburner._throttlers.splice(index, 1); - } - }, wait); + TemplateCompiler.prototype.debugger = function _debugger(name, action) { + this.opcode('debugger', null); + }; - if (immediate) { - this.run.apply(this, args); - } + TemplateCompiler.prototype.hasBlock = function hasBlock(name, action) { + this.opcode('hasBlock', action, name); + }; - throttler = [target, method, timer]; + TemplateCompiler.prototype.hasBlockParams = function hasBlockParams(name, action) { + this.opcode('hasBlockParams', action, name); + }; - this._throttlers.push(throttler); + TemplateCompiler.prototype.partial = function partial(params, action) { + this.prepareParams(action.params); + this.opcode('partial', action); + }; - return throttler; - }, + TemplateCompiler.prototype.builtInHelper = function builtInHelper(expr) { + if (isHasBlock(expr)) { + var _name = assertValidHasBlockUsage(expr.path.original, expr); + this.hasBlock(_name, expr); + } else if (isHasBlockParams(expr)) { + var _name2 = assertValidHasBlockUsage(expr.path.original, expr); + this.hasBlockParams(_name2, expr); + } + }; - debounce: function(target, method /* , args, wait, [immediate] */) { - var backburner = this; - var args = new Array(arguments.length); - for (var i = 0; i < arguments.length; i++) { - args[i] = arguments[i]; - } + /// Expressions, invoked recursively from prepareParams and prepareHash - var immediate = args.pop(); - var wait, index, debouncee, timer; + TemplateCompiler.prototype.SubExpression = function SubExpression(expr) { + if (isBuiltInHelper(expr)) { + this.builtInHelper(expr); + } else { + this.prepareHelper(expr); + this.opcode('helper', expr, expr.path.parts); + } + }; - if (isNumber(immediate) || isString(immediate)) { - wait = immediate; - immediate = false; - } else { - wait = args.pop(); - } + TemplateCompiler.prototype.PathExpression = function PathExpression(expr) { + if (expr.data) { + this.arg([expr]); + } else { + this.opcode('get', expr, expr.parts); + } + }; - wait = parseInt(wait, 10); - // Remove debouncee - index = findDebouncee(target, method, this._debouncees); + TemplateCompiler.prototype.StringLiteral = function StringLiteral(action) { + this.opcode('literal', null, action.value); + }; - if (index > -1) { - debouncee = this._debouncees[index]; - this._debouncees.splice(index, 1); - this._platform.clearTimeout(debouncee[2]); - } + TemplateCompiler.prototype.BooleanLiteral = function BooleanLiteral(action) { + this.opcode('literal', null, action.value); + }; - timer = this._platform.setTimeout(function() { - if (!immediate) { - backburner.run.apply(backburner, args); - } - var index = findDebouncee(target, method, backburner._debouncees); - if (index > -1) { - backburner._debouncees.splice(index, 1); - } - }, wait); + TemplateCompiler.prototype.NumberLiteral = function NumberLiteral(action) { + this.opcode('literal', null, action.value); + }; - if (immediate && index === -1) { - backburner.run.apply(backburner, args); - } + TemplateCompiler.prototype.NullLiteral = function NullLiteral(action) { + this.opcode('literal', null, action.value); + }; - debouncee = [ - target, - method, - timer - ]; + TemplateCompiler.prototype.UndefinedLiteral = function UndefinedLiteral(action) { + this.opcode('literal', null, action.value); + }; - backburner._debouncees.push(debouncee); + /// Utilities - return debouncee; - }, + TemplateCompiler.prototype.opcode = function opcode(name, action) { + for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } - cancelTimers: function() { - each(this._throttlers, this._boundClearItems); - this._throttlers = []; + var opcode = [name].concat(args); + if (this.includeMeta && action) { + opcode.push(this.meta(action)); + } + this.opcodes.push(opcode); + }; - each(this._debouncees, this._boundClearItems); - this._debouncees = []; + TemplateCompiler.prototype.prepareHelper = function prepareHelper(_ref13) { + var params = _ref13.params; + var hash = _ref13.hash; - this._clearTimerTimeout(); - this._timers = []; + this.prepareHash(hash); + this.prepareParams(params); + }; - if (this._autorun) { - this._platform.clearTimeout(this._autorun); - this._autorun = null; - } - }, + TemplateCompiler.prototype.preparePath = function preparePath(path) { + this.opcode('literal', path, path.parts); + }; - hasTimers: function() { - return !!this._timers.length || !!this._debouncees.length || !!this._throttlers.length || this._autorun; - }, + TemplateCompiler.prototype.prepareParams = function prepareParams(params) { + if (!params.length) { + this.opcode('literal', null, null); + return; + } + for (var i = params.length - 1; i >= 0; i--) { + var param = params[i]; + _glimmerUtil.assert(this[param.type], 'Unimplemented ' + param.type + ' on TemplateCompiler'); + this[param.type](param); + } + this.opcode('prepareArray', null, params.length); + }; - cancel: function (timer) { - var timerType = typeof timer; + TemplateCompiler.prototype.prepareHash = function prepareHash(hash) { + var pairs = hash.pairs; + if (!pairs.length) { + this.opcode('literal', null, null); + return; + } + for (var i = pairs.length - 1; i >= 0; i--) { + var _pairs$i = pairs[i]; + var key = _pairs$i.key; + var value = _pairs$i.value; - if (timer && timerType === 'object' && timer.queue && timer.method) { // we're cancelling a deferOnce - return timer.queue.cancel(timer); - } else if (timerType === 'function') { // we're cancelling a setTimeout - for (var i = 0, l = this._timers.length; i < l; i += 2) { - if (this._timers[i + 1] === timer) { - this._timers.splice(i, 2); // remove the two elements - if (i === 0) { - this._reinstallTimerTimeout(); - } - return true; - } - } - } else if (Object.prototype.toString.call(timer) === '[object Array]'){ // we're cancelling a throttle or debounce - return this._cancelItem(findThrottler, this._throttlers, timer) || - this._cancelItem(findDebouncee, this._debouncees, timer); - } else { - return; // timer was null or not a timer - } - }, + _glimmerUtil.assert(this[value.type], 'Unimplemented ' + value.type + ' on TemplateCompiler'); + this[value.type](value); + this.opcode('literal', null, key); + } + this.opcode('prepareObject', null, pairs.length); + }; - _cancelItem: function(findMethod, array, timer){ - var item, index; + TemplateCompiler.prototype.prepareAttributeValue = function prepareAttributeValue(value) { + // returns the static value if the value is static + switch (value.type) { + case 'TextNode': + this.opcode('literal', value, value.chars); + return true; + case 'MustacheStatement': + this.attributeMustache([value]); + return false; + case 'ConcatStatement': + this.prepareConcatParts(value.parts); + this.opcode('concat', value); + return false; + } + }; - if (timer.length < 3) { return false; } + TemplateCompiler.prototype.prepareConcatParts = function prepareConcatParts(parts) { + for (var i = parts.length - 1; i >= 0; i--) { + var part = parts[i]; + if (part.type === 'MustacheStatement') { + this.attributeMustache([part]); + } else if (part.type === 'TextNode') { + this.opcode('literal', null, part.chars); + } + } + this.opcode('prepareArray', null, parts.length); + }; - index = findMethod(timer[0], timer[1], array); + TemplateCompiler.prototype.attributeMustache = function attributeMustache(_ref14) { + var action = _ref14[0]; - if (index > -1) { + this.mustacheExpression(action); + }; - item = array[index]; + TemplateCompiler.prototype.meta = function meta(node) { + var loc = node.loc; + if (!loc) { + return []; + } + var source = loc.source; + var start = loc.start; + var end = loc.end; - if (item[2] === timer[2]) { - array.splice(index, 1); - this._platform.clearTimeout(timer[2]); - return true; - } - } + return ['loc', [source || null, [start.line, start.column], [end.line, end.column]]]; + }; - return false; - }, + return TemplateCompiler; + })(); - _runExpiredTimers: function () { - this._timerTimeoutId = undefined; - this.run(this, this._scheduleExpiredTimers); - }, + function isHelperInvocation(mustache) { + return mustache.params && mustache.params.length > 0 || mustache.hash && mustache.hash.pairs.length > 0; + } + function isSelfGet(mustache) { + var parts = mustache.path.parts; - _scheduleExpiredTimers: function () { - var n = Date.now(); - var timers = this._timers; - var i = 0; - var l = timers.length; - for (; i < l; i += 2) { - var executeAt = timers[i]; - var fn = timers[i+1]; - if (executeAt <= n) { - this.schedule(this.options.defaultQueue, null, fn); - } else { - break; - } + return parts[0] === null; } - timers.splice(0, i); - this._installTimerTimeout(); - }, + function isLocalVariable(mustache, symbols) { + var parts = mustache.path.parts; - _reinstallTimerTimeout: function () { - this._clearTimerTimeout(); - this._installTimerTimeout(); - }, + return parts.length === 1 && symbols && symbols.hasLocalVariable(parts[0]); + } + function isYield(_ref15) { + var path = _ref15.path; - _clearTimerTimeout: function () { - if (!this._timerTimeoutId) { - return; + return path.original === 'yield'; } - this._platform.clearTimeout(this._timerTimeoutId); - this._timerTimeoutId = undefined; - }, + function isPartial(_ref16) { + var path = _ref16.path; - _installTimerTimeout: function () { - if (!this._timers.length) { - return; + return path.original === 'partial'; } - var minExpiresAt = this._timers[0]; - var n = Date.now(); - var wait = Math.max(0, minExpiresAt - n); - this._timerTimeoutId = this._platform.setTimeout(this._boundRunExpiredTimers, wait); - } -}; + function isDebugger(_ref17) { + var path = _ref17.path; -Backburner.prototype.schedule = Backburner.prototype.defer; -Backburner.prototype.scheduleOnce = Backburner.prototype.deferOnce; -Backburner.prototype.later = Backburner.prototype.setTimeout; + return path.original === 'debugger'; + } + function isArg(_ref18) { + var path = _ref18.path; -function getOnError(options) { - return options.onError || (options.onErrorTarget && options.onErrorTarget[options.onErrorMethod]); -} + return path.data; + } + function isLiteral(_ref19) { + var path = _ref19.path; -function createAutorun(backburner) { - var setTimeout = backburner._platform.setTimeout; - backburner.begin(); - backburner._autorun = setTimeout(function() { - backburner._autorun = null; - backburner.end(); - }, 0); -} + return path.type === 'StringLiteral' || path.type === 'BooleanLiteral' || path.type === 'NumberLiteral' || path.type === 'NullLiteral' || path.type === 'UndefinedLiteral'; + } + function isHasBlock(_ref20) { + var path = _ref20.path; -function findDebouncee(target, method, debouncees) { - return findItem(target, method, debouncees); -} + return path.original === 'has-block'; + } + function isHasBlockParams(_ref21) { + var path = _ref21.path; -function findThrottler(target, method, throttlers) { - return findItem(target, method, throttlers); -} + return path.original === 'has-block-params'; + } + function isBuiltInHelper(expr) { + return isHasBlock(expr) || isHasBlockParams(expr); + } + function assertValidYield(_ref22) { + var hash = _ref22.hash; -function findItem(target, method, collection) { - var item; - var index = -1; + var pairs = hash.pairs; + if (pairs.length === 1 && pairs[0].key !== 'to' || pairs.length > 1) { + throw new Error('yield only takes a single named argument: \'to\''); + } else if (pairs.length === 1 && pairs[0].value.type !== 'StringLiteral') { + throw new Error('you can only yield to a literal value'); + } else if (pairs.length === 0) { + return 'default'; + } else { + return pairs[0].value.value; + } + } + function assertValidPartial(_ref23) { + var params = _ref23.params; + var hash = _ref23.hash; + var escaped = _ref23.escaped; + var loc = _ref23.loc; - for (var i = 0, l = collection.length; i < l; i++) { - item = collection[i]; - if (item[0] === target && item[1] === method) { - index = i; - break; + if (params && params.length !== 1) { + throw new Error('Partial found with no arguments. You must specify a template name. (on line ' + loc.start.line + ')'); + } else if (hash && hash.pairs.length > 0) { + throw new Error('partial does not take any named arguments (on line ' + loc.start.line + ')'); + } else if (!escaped) { + throw new Error('{{{partial ...}}} is not supported, please use {{partial ...}} instead (on line ' + loc.start.line + ')'); + } + return params; } - } + function assertValidHasBlockUsage(type, _ref24) { + var params = _ref24.params; + var hash = _ref24.hash; + var loc = _ref24.loc; - return index; -} + if (hash && hash.pairs.length > 0) { + throw new Error(type + ' does not take any named arguments'); + } + if (params.length === 0) { + return 'default'; + } else if (params.length === 1) { + if (params[0].type === 'StringLiteral') { + return params[0].value; + } else { + throw new Error('you can only yield to a literal value (on line ' + loc.start.line + ')'); + } + } else { + throw new Error(type + ' only takes a single positional argument (on line ' + loc.start.line + ')'); + } + } + function assertValidDebuggerUsage(_ref25) { + var params = _ref25.params; + var hash = _ref25.hash; -function clearItems(item) { - this._platform.clearTimeout(item[2]); -} + if (hash && hash.pairs.length > 0) { + throw new Error('debugger does not take any named arguments'); + } + if (params.length === 0) { + return 'default'; + } else { + throw new Error('debugger does not take any positional arguments'); + } + } -exports['default'] = Backburner; + var defaultId = (function () { + var idFn = undefined; + return function () { + if (!idFn) { + if (typeof require === 'function') { + try { + (function () { + /* tslint:disable:no-require-imports */ + var crypto = require('crypto'); + /* tslint:enable:no-require-imports */ + idFn = function (src) { + var hash = crypto.createHash('sha1'); + hash.update(src, 'utf8'); + // trim to 6 bytes of data (2^48 - 1) + return hash.digest('base64').substring(0, 8); + }; + idFn("test"); + })(); + } catch (e) { + idFn = null; + } + } + if (!idFn) { + idFn = function () { + return null; + }; + } + } + return idFn; + }; + })(); + function precompile(string, options) { + var opts = options || { + id: defaultId(), + meta: {} + }; + var ast = _glimmerSyntax.preprocess(string, opts); -Object.defineProperty(exports, '__esModule', { value: true }); + var _TemplateCompiler$compile = TemplateCompiler.compile(opts, ast); + + var block = _TemplateCompiler$compile.block; + var meta = _TemplateCompiler$compile.meta; + + var idFn = opts.id || defaultId(); + var blockJSON = JSON.stringify(block.toJSON()); + var templateJSONObject = { + id: idFn(JSON.stringify(meta) + blockJSON), + block: blockJSON, + meta: meta + }; + // JSON is javascript + return JSON.stringify(templateJSONObject); + } + exports.precompile = precompile; + exports.TemplateVisitor = TemplateVisitor; }); -enifed('ember-console/index', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { - 'use strict'; +enifed("@glimmer/reference", ["exports", "@glimmer/util"], function (exports, _glimmerUtil) { + "use strict"; - function K() {} + var CONSTANT = 0; + var INITIAL = 1; + var VOLATILE = NaN; - function consoleMethod(name) { - var consoleObj = undefined; - if (_emberEnvironment.context.imports.console) { - consoleObj = _emberEnvironment.context.imports.console; - } else if (typeof console !== 'undefined') { - consoleObj = console; - } + var RevisionTag = (function () { + function RevisionTag() {} - var method = typeof consoleObj === 'object' ? consoleObj[name] : null; + RevisionTag.prototype.validate = function validate(snapshot) { + return this.value() === snapshot; + }; - if (typeof method !== 'function') { - return; - } + return RevisionTag; + })(); - if (typeof method.bind === 'function') { - return method.bind(consoleObj); - } + var $REVISION = INITIAL; - return function () { - method.apply(consoleObj, arguments); - }; - } + var DirtyableTag = (function (_RevisionTag) { + babelHelpers.inherits(DirtyableTag, _RevisionTag); - function assertPolyfill(test, message) { - if (!test) { - try { - // attempt to preserve the stack - throw new Error('assertion failed: ' + message); - } catch (error) { - setTimeout(function () { - throw error; - }, 0); - } - } - } + function DirtyableTag() { + var revision = arguments.length <= 0 || arguments[0] === undefined ? $REVISION : arguments[0]; - /** - Inside Ember-Metal, simply uses the methods from `imports.console`. - Override this to provide more robust logging functionality. - - @class Logger - @namespace Ember - @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. - ```javascript - var foo = 1; - Ember.Logger.log('log value of foo:', foo); - // "log value of foo: 1" will be printed to the console - ``` - @method log - @for Ember.Logger - @param {*} arguments - @public - */ - log: consoleMethod('log') || K, + _RevisionTag.call(this); + this.revision = revision; + } - /** - Prints the arguments to the console with a warning icon. - You can pass as many arguments as you want and they will be joined together with a space. - ```javascript - Ember.Logger.warn('Something happened!'); - // "Something happened!" will be printed to the console with a warning icon. - ``` - @method warn - @for Ember.Logger - @param {*} arguments - @public - */ - warn: consoleMethod('warn') || K, + DirtyableTag.prototype.value = function value() { + return this.revision; + }; - /** - Prints the arguments to the console with an error icon, red text and a stack trace. - You can pass as many arguments as you want and they will be joined together with a space. - ```javascript - Ember.Logger.error('Danger! Danger!'); - // "Danger! Danger!" will be printed to the console in red text. - ``` - @method error - @for Ember.Logger - @param {*} arguments - @public - */ - error: consoleMethod('error') || K, + DirtyableTag.prototype.dirty = function dirty() { + this.revision = ++$REVISION; + }; - /** - Logs the arguments to the console. - You can pass as many arguments as you want and they will be joined together with a space. - ```javascript - var foo = 1; - Ember.Logger.info('log value of foo:', foo); - // "log value of foo: 1" will be printed to the console - ``` - @method info - @for Ember.Logger - @param {*} arguments - @public - */ - info: consoleMethod('info') || K, + return DirtyableTag; + })(RevisionTag); - /** - Logs the arguments to the console in blue text. - You can pass as many arguments as you want and they will be joined together with a space. - ```javascript - var foo = 1; - Ember.Logger.debug('log value of foo:', foo); - // "log value of foo: 1" will be printed to the console - ``` - @method debug - @for Ember.Logger - @param {*} arguments - @public - */ - debug: consoleMethod('debug') || consoleMethod('info') || K, + function combineTagged(tagged) { + var optimized = []; + for (var i = 0, l = tagged.length; i < l; i++) { + var tag = tagged[i].tag; + if (tag === VOLATILE_TAG) return VOLATILE_TAG; + if (tag === CONSTANT_TAG) continue; + optimized.push(tag); + } + return _combine(optimized); + } + function combineSlice(slice) { + var optimized = []; + var node = slice.head(); + while (node !== null) { + var tag = node.tag; + if (tag === VOLATILE_TAG) return VOLATILE_TAG; + if (tag !== CONSTANT_TAG) optimized.push(tag); + node = slice.nextNode(node); + } + return _combine(optimized); + } + function combine(tags) { + var optimized = []; + for (var i = 0, l = tags.length; i < l; i++) { + var tag = tags[i]; + if (tag === VOLATILE_TAG) return VOLATILE_TAG; + if (tag === CONSTANT_TAG) continue; + optimized.push(tag); + } + return _combine(optimized); + } + function _combine(tags) { + switch (tags.length) { + case 0: + return CONSTANT_TAG; + case 1: + return tags[0]; + case 2: + return new TagsPair(tags[0], tags[1]); + default: + return new TagsCombinator(tags); + } + ; + } - /** - 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 - }; -}); -enifed('ember-debug/deprecate', ['exports', 'ember-metal', 'ember-console', 'ember-environment', 'ember-debug/handlers'], function (exports, _emberMetal, _emberConsole, _emberEnvironment, _emberDebugHandlers) { - /*global __fail__*/ + var CachedTag = (function (_RevisionTag2) { + babelHelpers.inherits(CachedTag, _RevisionTag2); - 'use strict'; + function CachedTag() { + _RevisionTag2.apply(this, arguments); + this.lastChecked = null; + this.lastValue = null; + } - exports.registerHandler = registerHandler; - exports.default = deprecate; + CachedTag.prototype.value = function value() { + var lastChecked = this.lastChecked; + var lastValue = this.lastValue; - function registerHandler(handler) { - _emberDebugHandlers.registerHandler('deprecate', handler); - } + if (lastChecked !== $REVISION) { + this.lastChecked = $REVISION; + this.lastValue = lastValue = this.compute(); + } + return this.lastValue; + }; - function formatMessage(_message, options) { - var message = _message; + CachedTag.prototype.invalidate = function invalidate() { + this.lastChecked = null; + }; - if (options && options.id) { - message = message + (' [deprecation id: ' + options.id + ']'); - } + return CachedTag; + })(RevisionTag); - if (options && options.url) { - message += ' See ' + options.url + ' for more details.'; - } + var TagsPair = (function (_CachedTag) { + babelHelpers.inherits(TagsPair, _CachedTag); - return message; - } + function TagsPair(first, second) { + _CachedTag.call(this); + this.first = first; + this.second = second; + } - registerHandler(function logDeprecationToConsole(message, options) { - var updatedMessage = formatMessage(message, options); + TagsPair.prototype.compute = function compute() { + return Math.max(this.first.value(), this.second.value()); + }; - _emberConsole.default.warn('DEPRECATION: ' + updatedMessage); - }); + return TagsPair; + })(CachedTag); - var captureErrorForStack = undefined; + var TagsCombinator = (function (_CachedTag2) { + babelHelpers.inherits(TagsCombinator, _CachedTag2); - if (new Error().stack) { - captureErrorForStack = function () { - return new Error(); - }; - } else { - captureErrorForStack = function () { - try { - __fail__.fail(); - } catch (e) { - return e; - } - }; - } + function TagsCombinator(tags) { + _CachedTag2.call(this); + this.tags = tags; + } - registerHandler(function logDeprecationStackTrace(message, options, next) { - if (_emberEnvironment.ENV.LOG_STACKTRACE_ON_DEPRECATION) { - var stackStr = ''; - var error = captureErrorForStack(); - var stack = undefined; + TagsCombinator.prototype.compute = function compute() { + var tags = this.tags; - if (error.stack) { - if (error['arguments']) { - // Chrome - stack = error.stack.replace(/^\s+at\s+/gm, '').replace(/^([^\(]+?)([\n$])/gm, '{anonymous}($1)$2').replace(/^Object.\s*\(([^\)]+)\)/gm, '{anonymous}($1)').split('\n'); - stack.shift(); - } else { - // Firefox - stack = error.stack.replace(/(?:\n@:0)?\s+$/m, '').replace(/^\(/gm, '{anonymous}(').split('\n'); - } + var max = -1; + for (var i = 0; i < tags.length; i++) { + var value = tags[i].value(); + max = Math.max(value, max); + } + return max; + }; - stackStr = '\n ' + stack.slice(2).join('\n '); - } + return TagsCombinator; + })(CachedTag); - var updatedMessage = formatMessage(message, options); + var UpdatableTag = (function (_CachedTag3) { + babelHelpers.inherits(UpdatableTag, _CachedTag3); - _emberConsole.default.warn('DEPRECATION: ' + updatedMessage + stackStr); - } else { - next.apply(undefined, arguments); - } - }); + function UpdatableTag(tag) { + _CachedTag3.call(this); + this.tag = tag; + this.lastUpdated = INITIAL; + } - registerHandler(function raiseOnDeprecation(message, options, next) { - if (_emberEnvironment.ENV.RAISE_ON_DEPRECATION) { - var updatedMessage = formatMessage(message); + ////////// - throw new _emberMetal.Error(updatedMessage); - } else { - next.apply(undefined, arguments); - } - }); + UpdatableTag.prototype.compute = function compute() { + return Math.max(this.lastUpdated, this.tag.value()); + }; - var missingOptionsDeprecation = 'When calling `Ember.deprecate` you ' + 'must provide an `options` hash as the third parameter. ' + '`options` should include `id` and `until` properties.'; - exports.missingOptionsDeprecation = missingOptionsDeprecation; - var missingOptionsIdDeprecation = 'When calling `Ember.deprecate` you must provide `id` in options.'; - exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation; - var missingOptionsUntilDeprecation = 'When calling `Ember.deprecate` you must provide `until` in options.'; + UpdatableTag.prototype.update = function update(tag) { + if (tag !== this.tag) { + this.tag = tag; + this.lastUpdated = $REVISION; + this.invalidate(); + } + }; - exports.missingOptionsUntilDeprecation = missingOptionsUntilDeprecation; - /** - @module ember - @submodule ember-debug - */ + return UpdatableTag; + })(CachedTag); - /** - Display a deprecation warning with the provided message and a stack trace - (Chrome and Firefox only). - - * In a production build, this method is defined as an empty function (NOP). - Uses of this method in Ember itself are stripped from the ember.prod.js build. - - @method deprecate - @param {String} message A description of the deprecation. - @param {Boolean} test A boolean. If falsy, the deprecation will be displayed. - @param {Object} options - @param {String} options.id A unique id for this deprecation. The id can be - used by Ember debugging tools to change the behavior (raise, log or silence) - for that specific deprecation. The id should be namespaced by dots, e.g. - "view.helper.select". - @param {string} options.until The version of Ember when this deprecation - warning will be removed. - @param {String} [options.url] An optional url to the transition guide on the - emberjs.com website. - @for Ember - @public - @since 1.0.0 - */ + var CONSTANT_TAG = new ((function (_RevisionTag3) { + babelHelpers.inherits(ConstantTag, _RevisionTag3); - function deprecate(message, test, options) { - if (!options || !options.id && !options.until) { - deprecate(missingOptionsDeprecation, false, { - id: 'ember-debug.deprecate-options-missing', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' - }); - } + function ConstantTag() { + _RevisionTag3.apply(this, arguments); + } - if (options && !options.id) { - deprecate(missingOptionsIdDeprecation, false, { - id: 'ember-debug.deprecate-id-missing', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' - }); - } + ConstantTag.prototype.value = function value() { + return CONSTANT; + }; - if (options && !options.until) { - deprecate(missingOptionsUntilDeprecation, options && options.until, { - id: 'ember-debug.deprecate-until-missing', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' - }); - } + return ConstantTag; + })(RevisionTag))(); + var VOLATILE_TAG = new ((function (_RevisionTag4) { + babelHelpers.inherits(VolatileTag, _RevisionTag4); - _emberDebugHandlers.invoke.apply(undefined, ['deprecate'].concat(babelHelpers.slice.call(arguments))); - } -}); -enifed("ember-debug/handlers", ["exports"], function (exports) { - "use strict"; + function VolatileTag() { + _RevisionTag4.apply(this, arguments); + } - exports.registerHandler = registerHandler; - exports.invoke = invoke; - var HANDLERS = {}; + VolatileTag.prototype.value = function value() { + return VOLATILE; + }; - exports.HANDLERS = HANDLERS; + return VolatileTag; + })(RevisionTag))(); + var CURRENT_TAG = new ((function (_DirtyableTag) { + babelHelpers.inherits(CurrentTag, _DirtyableTag); - function registerHandler(type, callback) { - var nextHandler = HANDLERS[type] || function () {}; + function CurrentTag() { + _DirtyableTag.apply(this, arguments); + } - HANDLERS[type] = function (message, options) { - callback(message, options, nextHandler); - }; - } + CurrentTag.prototype.value = function value() { + return $REVISION; + }; - function invoke(type, message, test, options) { - if (test) { - return; - } + return CurrentTag; + })(DirtyableTag))(); - var handlerForType = HANDLERS[type]; + var CachedReference = (function () { + function CachedReference() { + this.lastRevision = null; + this.lastValue = null; + } - if (!handlerForType) { - return; - } + CachedReference.prototype.value = function value() { + var tag = this.tag; + var lastRevision = this.lastRevision; + var lastValue = this.lastValue; - if (handlerForType) { - handlerForType(message, options); - } - } -}); -enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'ember-console', 'ember-debug/deprecate', 'ember-debug/warn'], function (exports, _emberMetal, _emberEnvironment, _emberConsole, _emberDebugDeprecate, _emberDebugWarn) { - 'use strict'; + if (!lastRevision || !tag.validate(lastRevision)) { + lastValue = this.lastValue = this.compute(); + this.lastRevision = tag.value(); + } + return lastValue; + }; - exports._warnIfUsingStrippedFeatureFlags = _warnIfUsingStrippedFeatureFlags; + CachedReference.prototype.invalidate = function invalidate() { + this.lastRevision = null; + }; - /** - @module ember - @submodule ember-debug - */ + return CachedReference; + })(); - /** - @class Ember - @public - */ + var MapperReference = (function (_CachedReference) { + babelHelpers.inherits(MapperReference, _CachedReference); - /** - Define an assertion that will throw an exception if the condition is not met. - - * In a production build, this method is defined as an empty function (NOP). - Uses of this method in Ember itself are stripped from the ember.prod.js build. - - ```javascript - // Test for truthiness - Ember.assert('Must pass a valid object', obj); - - // Fail unconditionally - Ember.assert('This code path should never be run'); - ``` - - @method assert - @param {String} desc A description of the assertion. This will become - the text of the Error thrown if the assertion fails. - @param {Boolean} test Must be truthy for the assertion to pass. If - falsy, an exception will be thrown. - @public - @since 1.0.0 - */ - _emberMetal.setDebugFunction('assert', function assert(desc, test) { - if (!test) { - throw new _emberMetal.Error('Assertion Failed: ' + desc); - } - }); + function MapperReference(reference, mapper) { + _CachedReference.call(this); + this.tag = reference.tag; + this.reference = reference; + this.mapper = mapper; + } - /** - Display a debug notice. - - * In a production build, this method is defined as an empty function (NOP). - Uses of this method in Ember itself are stripped from the ember.prod.js build. - - ```javascript - Ember.debug('I\'m a debug notice!'); - ``` - - @method debug - @param {String} message A debug message to display. - @public - */ - _emberMetal.setDebugFunction('debug', function debug(message) { - _emberConsole.default.debug('DEBUG: ' + message); - }); + MapperReference.prototype.compute = function compute() { + var reference = this.reference; + var mapper = this.mapper; - /** - Display an info notice. - - * In a production build, this method is defined as an empty function (NOP). - Uses of this method in Ember itself are stripped from the ember.prod.js build. - - @method info - @private - */ - _emberMetal.setDebugFunction('info', function info() { - _emberConsole.default.info.apply(undefined, arguments); - }); + return mapper(reference.value()); + }; - /** - Alias an old, deprecated method with its new counterpart. - - Display a deprecation warning with the provided message and a stack trace - (Chrome and Firefox only) when the assigned method is called. - - * In a production build, this method is defined as an empty function (NOP). - - ```javascript - Ember.oldMethod = Ember.deprecateFunc('Please use the new, updated method', Ember.newMethod); - ``` - - @method deprecateFunc - @param {String} message A description of the deprecation. - @param {Object} [options] The options object for Ember.deprecate. - @param {Function} func The new function called to replace its deprecated counterpart. - @return {Function} A new function that wraps the original function with a deprecation warning - @private - */ - _emberMetal.setDebugFunction('deprecateFunc', function deprecateFunc() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; + return MapperReference; + })(CachedReference); + + function map(reference, mapper) { + return new MapperReference(reference, mapper); } + ////////// - if (args.length === 3) { - var _ret = (function () { - var message = args[0]; - var options = args[1]; - var func = args[2]; + var ReferenceCache = (function () { + function ReferenceCache(reference) { + this.lastValue = null; + this.lastRevision = null; + this.initialized = false; + this.tag = reference.tag; + this.reference = reference; + } - return { - v: function () { - _emberMetal.deprecate(message, false, options); - return func.apply(this, arguments); - } + ReferenceCache.prototype.peek = function peek() { + if (!this.initialized) { + return this.initialize(); + } + return this.lastValue; }; - })(); - if (typeof _ret === 'object') return _ret.v; - } else { - var _ret2 = (function () { - var message = args[0]; - var func = args[1]; + ReferenceCache.prototype.revalidate = function revalidate() { + if (!this.initialized) { + return this.initialize(); + } + var reference = this.reference; + var lastRevision = this.lastRevision; - return { - v: function () { - _emberMetal.deprecate(message); - return func.apply(this, arguments); - } + var tag = reference.tag; + if (tag.validate(lastRevision)) return NOT_MODIFIED; + this.lastRevision = tag.value(); + var lastValue = this.lastValue; + + var value = reference.value(); + if (value === lastValue) return NOT_MODIFIED; + this.lastValue = value; + return value; }; - })(); - if (typeof _ret2 === 'object') return _ret2.v; - } - }); + ReferenceCache.prototype.initialize = function initialize() { + var reference = this.reference; - /** - Run a function meant for debugging. - - * In a production build, this method is defined as an empty function (NOP). - Uses of this method in Ember itself are stripped from the ember.prod.js build. - - ```javascript - Ember.runInDebug(() => { - Ember.Component.reopen({ - didInsertElement() { - console.log("I'm happy"); - } - }); - }); - ``` - - @method runInDebug - @param {Function} func The function to be executed. - @since 1.5.0 - @public - */ - _emberMetal.setDebugFunction('runInDebug', function runInDebug(func) { - func(); - }); + var value = this.lastValue = reference.value(); + this.lastRevision = reference.tag.value(); + this.initialized = true; + return value; + }; - _emberMetal.setDebugFunction('debugSeal', function debugSeal(obj) { - Object.seal(obj); - }); + return ReferenceCache; + })(); - _emberMetal.setDebugFunction('debugFreeze', function debugFreeze(obj) { - Object.freeze(obj); - }); + var NOT_MODIFIED = "adb3b78e-3d22-4e4b-877a-6317c2c5c145"; + function isModified(value) { + return value !== NOT_MODIFIED; + } - _emberMetal.setDebugFunction('deprecate', _emberDebugDeprecate.default); + var ConstReference = (function () { + function ConstReference(inner) { + this.inner = inner; + this.tag = CONSTANT_TAG; + } - _emberMetal.setDebugFunction('warn', _emberDebugWarn.default); + ConstReference.prototype.value = function value() { + return this.inner; + }; - /** - Will call `Ember.warn()` if ENABLE_OPTIONAL_FEATURES or - any specific FEATURES flag is truthy. - - This method is called automatically in debug canary builds. - - @private - @method _warnIfUsingStrippedFeatureFlags - @return {void} - */ + return ConstReference; + })(); - function _warnIfUsingStrippedFeatureFlags(FEATURES, knownFeatures, featuresWereStripped) { - if (featuresWereStripped) { - _emberMetal.warn('Ember.ENV.ENABLE_OPTIONAL_FEATURES is only available in canary builds.', !_emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES, { id: 'ember-debug.feature-flag-with-features-stripped' }); + function isConst(reference) { + return reference.tag === CONSTANT_TAG; + } - var keys = Object.keys(FEATURES || {}); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (key === 'isEnabled' || !(key in knownFeatures)) { - continue; + var ListItem = (function (_ListNode) { + babelHelpers.inherits(ListItem, _ListNode); + + function ListItem(iterable, result) { + _ListNode.call(this, iterable.valueReferenceFor(result)); + this.retained = false; + this.seen = false; + this.key = result.key; + this.iterable = iterable; + this.memo = iterable.memoReferenceFor(result); } - _emberMetal.warn('FEATURE["' + key + '"] is set as enabled, but FEATURE flags are only available in canary builds.', !FEATURES[key], { id: 'ember-debug.feature-flag-with-features-stripped' }); - } - } - } + ListItem.prototype.update = function update(item) { + this.retained = true; + this.iterable.updateValueReference(this.value, item); + this.iterable.updateMemoReference(this.memo, item); + }; - if (!_emberMetal.isTesting()) { - (function () { - // Complain if they're using FEATURE flags in builds other than canary - _emberMetal.FEATURES['features-stripped-test'] = true; - var featuresWereStripped = true; + ListItem.prototype.shouldRemove = function shouldRemove() { + return !this.retained; + }; - if (false) { - featuresWereStripped = false; - } + ListItem.prototype.reset = function reset() { + this.retained = false; + this.seen = false; + }; - delete _emberMetal.FEATURES['features-stripped-test']; - _warnIfUsingStrippedFeatureFlags(_emberEnvironment.ENV.FEATURES, _emberMetal.DEFAULT_FEATURES, featuresWereStripped); + return ListItem; + })(_glimmerUtil.ListNode); - // Inform the developer about the Ember Inspector if not installed. - var isFirefox = _emberEnvironment.environment.isFirefox; - var isChrome = _emberEnvironment.environment.isChrome; + var IterationArtifacts = (function () { + function IterationArtifacts(iterable) { + this.map = _glimmerUtil.dict(); + this.list = new _glimmerUtil.LinkedList(); + this.tag = iterable.tag; + this.iterable = iterable; + } - if (typeof window !== 'undefined' && (isFirefox || isChrome) && window.addEventListener) { - window.addEventListener('load', function () { - if (document.documentElement && document.documentElement.dataset && !document.documentElement.dataset.emberExtension) { - var downloadURL; + IterationArtifacts.prototype.isEmpty = function isEmpty() { + var iterator = this.iterator = this.iterable.iterate(); + return iterator.isEmpty(); + }; - if (isChrome) { - downloadURL = 'https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi'; - } else if (isFirefox) { - downloadURL = 'https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/'; - } + IterationArtifacts.prototype.iterate = function iterate() { + var iterator = this.iterator || this.iterable.iterate(); + this.iterator = null; + return iterator; + }; - _emberMetal.debug('For more advanced debugging, install the Ember Inspector from ' + downloadURL); - } - }, false); - } - })(); - } - /** - @public - @class Ember.Debug - */ - _emberMetal.default.Debug = {}; + IterationArtifacts.prototype.has = function has(key) { + return !!this.map[key]; + }; - /** - Allows for runtime registration of handler functions that override the default deprecation behavior. - Deprecations are invoked by calls to [Ember.deprecate](http://emberjs.com/api/classes/Ember.html#method_deprecate). - The following example demonstrates its usage by registering a handler that throws an error if the - message contains the word "should", otherwise defers to the default handler. - - ```javascript - Ember.Debug.registerDeprecationHandler((message, options, next) => { - if (message.indexOf('should') !== -1) { - throw new Error(`Deprecation message with should: ${message}`); - } else { - // defer to whatever handler was registered before this one - next(message, options); - } - }); - ``` - - The handler function takes the following arguments: - -
      -
    • message - The message received from the deprecation call.
    • -
    • options - An object passed in with the deprecation call containing additional information including:
    • -
        -
      • id - An id of the deprecation in the form of package-name.specific-deprecation.
      • -
      • until - The Ember version number the feature and deprecation will be removed in.
      • -
      -
    • next - A function that calls into the previously registered handler.
    • -
    - - @public - @static - @method registerDeprecationHandler - @param handler {Function} A function to handle deprecation calls. - @since 2.1.0 - */ - _emberMetal.default.Debug.registerDeprecationHandler = _emberDebugDeprecate.registerHandler; - /** - Allows for runtime registration of handler functions that override the default warning behavior. - Warnings are invoked by calls made to [Ember.warn](http://emberjs.com/api/classes/Ember.html#method_warn). - The following example demonstrates its usage by registering a handler that does nothing overriding Ember's - default warning behavior. - - ```javascript - // next is not called, so no warnings get the default behavior - Ember.Debug.registerWarnHandler(() => {}); - ``` - - The handler function takes the following arguments: - -
      -
    • message - The message received from the warn call.
    • -
    • options - An object passed in with the warn call containing additional information including:
    • -
        -
      • id - An id of the warning in the form of package-name.specific-warning.
      • -
      -
    • next - A function that calls into the previously registered handler.
    • -
    - - @public - @static - @method registerWarnHandler - @param handler {Function} A function to handle warnings. - @since 2.1.0 - */ - _emberMetal.default.Debug.registerWarnHandler = _emberDebugWarn.registerHandler; + IterationArtifacts.prototype.get = function get(key) { + return this.map[key]; + }; - /* - We are transitioning away from `ember.js` to `ember.debug.js` to make - it much clearer that it is only for local development purposes. - - This flag value is changed by the tooling (by a simple string replacement) - so that if `ember.js` (which must be output for backwards compat reasons) is - used a nice helpful warning message will be printed out. - */ - var runningNonEmberDebugJS = false; - exports.runningNonEmberDebugJS = runningNonEmberDebugJS; - if (runningNonEmberDebugJS) { - _emberMetal.warn('Please use `ember.debug.js` instead of `ember.js` for development and debugging.'); - } -}); -// reexports -enifed('ember-debug/warn', ['exports', 'ember-console', 'ember-metal', 'ember-debug/handlers'], function (exports, _emberConsole, _emberMetal, _emberDebugHandlers) { - 'use strict'; + IterationArtifacts.prototype.wasSeen = function wasSeen(key) { + var node = this.map[key]; + return node && node.seen; + }; - exports.registerHandler = registerHandler; - exports.default = warn; + IterationArtifacts.prototype.append = function append(item) { + var map = this.map; + var list = this.list; + var iterable = this.iterable; - function registerHandler(handler) { - _emberDebugHandlers.registerHandler('warn', handler); - } + var node = map[item.key] = new ListItem(iterable, item); + list.append(node); + return node; + }; - registerHandler(function logWarning(message, options) { - _emberConsole.default.warn('WARNING: ' + message); - if ('trace' in _emberConsole.default) { - _emberConsole.default.trace(); - } - }); + IterationArtifacts.prototype.insertBefore = function insertBefore(item, reference) { + var map = this.map; + var list = this.list; + var iterable = this.iterable; - var missingOptionsDeprecation = 'When calling `Ember.warn` you ' + 'must provide an `options` hash as the third parameter. ' + '`options` should include an `id` property.'; - exports.missingOptionsDeprecation = missingOptionsDeprecation; - var missingOptionsIdDeprecation = 'When calling `Ember.warn` you must provide `id` in options.'; + var node = map[item.key] = new ListItem(iterable, item); + node.retained = true; + list.insertBefore(node, reference); + return node; + }; - exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation; - /** - @module ember - @submodule ember-debug - */ + IterationArtifacts.prototype.move = function move(item, reference) { + var list = this.list; - /** - Display a warning with the provided message. - - * In a production build, this method is defined as an empty function (NOP). - Uses of this method in Ember itself are stripped from the ember.prod.js build. - - @method warn - @param {String} message A warning to display. - @param {Boolean} test An optional boolean. If falsy, the warning - will be displayed. - @param {Object} options An object that can be used to pass a unique - `id` for this warning. The `id` can be used by Ember debugging tools - to change the behavior (raise, log, or silence) for that specific warning. - The `id` should be namespaced by dots, e.g. "ember-debug.feature-flag-with-features-stripped" - @for Ember - @public - @since 1.0.0 - */ + item.retained = true; + list.remove(item); + list.insertBefore(item, reference); + }; - function warn(message, test, options) { - if (!options) { - _emberMetal.deprecate(missingOptionsDeprecation, false, { - id: 'ember-debug.warn-options-missing', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' - }); - } + IterationArtifacts.prototype.remove = function remove(item) { + var list = this.list; - if (options && !options.id) { - _emberMetal.deprecate(missingOptionsIdDeprecation, false, { - id: 'ember-debug.warn-id-missing', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' - }); - } + list.remove(item); + delete this.map[item.key]; + }; - _emberDebugHandlers.invoke.apply(undefined, ['warn'].concat(babelHelpers.slice.call(arguments))); - } -}); -enifed('ember-environment/global', ['exports'], function (exports) { - /* globals global, window, self, mainContext */ + IterationArtifacts.prototype.nextNode = function nextNode(item) { + return this.list.nextNode(item); + }; - // from lodash to catch fake globals - 'use strict'; + IterationArtifacts.prototype.head = function head() { + return this.list.head(); + }; - function checkGlobal(value) { - return value && value.Object === Object ? value : undefined; - } + return IterationArtifacts; + })(); - // element ids can ruin global miss checks - function checkElementIdShadowing(value) { - return value && value.nodeType === undefined ? value : undefined; - } + var ReferenceIterator = (function () { + // if anyone needs to construct this object with something other than + // an iterable, let @wycats know. - // export real global - exports.default = checkGlobal(checkElementIdShadowing(typeof global === 'object' && global)) || checkGlobal(typeof self === 'object' && self) || checkGlobal(typeof window === 'object' && window) || mainContext || // set before strict mode in Ember loader/wrapper - new Function('return this')(); - // eval outside of strict mode -}); -enifed('ember-environment/index', ['exports', 'ember-environment/global', 'ember-environment/utils'], function (exports, _emberEnvironmentGlobal, _emberEnvironmentUtils) { - /* globals module */ - 'use strict'; + function ReferenceIterator(iterable) { + this.iterator = null; + var artifacts = new IterationArtifacts(iterable); + this.artifacts = artifacts; + } - /** - 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 - backwards compatibility with earlier versions of Ember). The `EmberENV` - hash must be created before loading Ember. - - @class EmberENV - @type Object - @public - */ - var ENV = typeof _emberEnvironmentGlobal.default.EmberENV === 'object' && _emberEnvironmentGlobal.default.EmberENV || typeof _emberEnvironmentGlobal.default.ENV === 'object' && _emberEnvironmentGlobal.default.ENV || {}; + ReferenceIterator.prototype.next = function next() { + var artifacts = this.artifacts; - exports.ENV = ENV; - // ENABLE_ALL_FEATURES was documented, but you can't actually enable non optional features. - if (ENV.ENABLE_ALL_FEATURES) { - ENV.ENABLE_OPTIONAL_FEATURES = true; - } + var iterator = this.iterator = this.iterator || artifacts.iterate(); + var item = iterator.next(); + if (!item) return null; + return artifacts.append(item); + }; - /** - Determines whether Ember should add to `Array`, `Function`, and `String` - native object prototypes, a few extra methods in order to provide a more - friendly API. - - We generally recommend leaving this option set to true however, if you need - to turn it off, you can add the configuration property - `EXTEND_PROTOTYPES` to `EmberENV` and set it to `false`. - - Note, when disabled (the default configuration for Ember Addons), you will - instead have to access all methods and functions from the Ember - namespace. - - @property EXTEND_PROTOTYPES - @type Boolean - @default true - @for EmberENV - @public - */ - ENV.EXTEND_PROTOTYPES = _emberEnvironmentUtils.normalizeExtendPrototypes(ENV.EXTEND_PROTOTYPES); + return ReferenceIterator; + })(); - /** - The `LOG_STACKTRACE_ON_DEPRECATION` property, when true, tells Ember to log - a full stack trace during deprecation warnings. - - @property LOG_STACKTRACE_ON_DEPRECATION - @type Boolean - @default true - @for EmberENV - @public - */ - ENV.LOG_STACKTRACE_ON_DEPRECATION = _emberEnvironmentUtils.defaultTrue(ENV.LOG_STACKTRACE_ON_DEPRECATION); + var Phase; + (function (Phase) { + Phase[Phase["Append"] = 0] = "Append"; + Phase[Phase["Prune"] = 1] = "Prune"; + Phase[Phase["Done"] = 2] = "Done"; + })(Phase || (Phase = {})); - /** - The `LOG_VERSION` property, when true, tells Ember to log versions of all - dependent libraries in use. - - @property LOG_VERSION - @type Boolean - @default true - @for EmberENV - @public - */ - ENV.LOG_VERSION = _emberEnvironmentUtils.defaultTrue(ENV.LOG_VERSION); + var IteratorSynchronizer = (function () { + function IteratorSynchronizer(_ref) { + var target = _ref.target; + var artifacts = _ref.artifacts; - // default false - ENV.MODEL_FACTORY_INJECTIONS = _emberEnvironmentUtils.defaultFalse(ENV.MODEL_FACTORY_INJECTIONS); + this.target = target; + this.artifacts = artifacts; + this.iterator = artifacts.iterate(); + this.current = artifacts.head(); + } - /** - Debug parameter you can turn on. This will log all bindings that fire to - the console. This should be disabled in production code. Note that you - can also enable this from the console or temporarily. - - @property LOG_BINDINGS - @for EmberENV - @type Boolean - @default false - @public - */ - ENV.LOG_BINDINGS = _emberEnvironmentUtils.defaultFalse(ENV.LOG_BINDINGS); + IteratorSynchronizer.prototype.sync = function sync() { + var phase = Phase.Append; + while (true) { + switch (phase) { + case Phase.Append: + phase = this.nextAppend(); + break; + case Phase.Prune: + phase = this.nextPrune(); + break; + case Phase.Done: + this.nextDone(); + return; + } + } + }; - ENV.RAISE_ON_DEPRECATION = _emberEnvironmentUtils.defaultFalse(ENV.RAISE_ON_DEPRECATION); + IteratorSynchronizer.prototype.advanceToKey = function advanceToKey(key) { + var current = this.current; + var artifacts = this.artifacts; - // check if window exists and actually is the global - var hasDOM = typeof window !== 'undefined' && window === _emberEnvironmentGlobal.default && window.document && window.document.createElement && !ENV.disableBrowserEnvironment; // is this a public thing? + var seek = current; + while (seek && seek.key !== key) { + seek.seen = true; + seek = artifacts.nextNode(seek); + } + this.current = seek && artifacts.nextNode(seek); + }; - // legacy imports/exports/lookup stuff (should we keep this??) - var originalContext = _emberEnvironmentGlobal.default.Ember || {}; + IteratorSynchronizer.prototype.nextAppend = function nextAppend() { + var iterator = this.iterator; + var current = this.current; + var artifacts = this.artifacts; - var context = { - // import jQuery - imports: originalContext.imports || _emberEnvironmentGlobal.default, - // export Ember - exports: originalContext.exports || _emberEnvironmentGlobal.default, - // search for Namespaces - lookup: originalContext.lookup || _emberEnvironmentGlobal.default - }; + var item = iterator.next(); + if (item === null) { + return this.startPrune(); + } + var key = item.key; - exports.context = context; - // TODO: cleanup single source of truth issues with this stuff - var environment = hasDOM ? { - hasDOM: true, - isChrome: !!window.chrome && !window.opera, - isFirefox: typeof InstallTrigger !== 'undefined', - isPhantom: !!window.callPhantom, - location: window.location, - history: window.history, - userAgent: window.navigator.userAgent, - window: window - } : { - hasDOM: false, - isChrome: false, - isFirefox: false, - isPhantom: false, - location: null, - history: null, - userAgent: 'Lynx (textmode)', - window: null - }; - exports.environment = environment; -}); -enifed("ember-environment/utils", ["exports"], function (exports) { - "use strict"; - - exports.defaultTrue = defaultTrue; - exports.defaultFalse = defaultFalse; - exports.normalizeExtendPrototypes = normalizeExtendPrototypes; - - function defaultTrue(v) { - return v === false ? false : true; - } + if (current && current.key === key) { + this.nextRetain(item); + } else if (artifacts.has(key)) { + this.nextMove(item); + } else { + this.nextInsert(item); + } + return Phase.Append; + }; - function defaultFalse(v) { - return v === true ? true : false; - } + IteratorSynchronizer.prototype.nextRetain = function nextRetain(item) { + var artifacts = this.artifacts; + var current = this.current; - function normalizeExtendPrototypes(obj) { - if (obj === false) { - return { String: false, Array: false, Function: false }; - } else if (!obj || obj === true) { - return { String: true, Array: true, Function: true }; - } else { - return { - String: defaultTrue(obj.String), - Array: defaultTrue(obj.Array), - Function: defaultTrue(obj.Function) - }; - } - } -}); -enifed('ember-metal/alias', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/error', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/meta', 'ember-metal/dependent_keys'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalError, _emberMetalProperties, _emberMetalComputed, _emberMetalMeta, _emberMetalDependent_keys) { - 'use strict'; + current = _glimmerUtil.expect(current, 'BUG: current is empty'); + current.update(item); + this.current = artifacts.nextNode(current); + this.target.retain(item.key, current.value, current.memo); + }; - exports.default = alias; - exports.AliasedProperty = AliasedProperty; + IteratorSynchronizer.prototype.nextMove = function nextMove(item) { + var current = this.current; + var artifacts = this.artifacts; + var target = this.target; + var key = item.key; - var CONSUMED = {}; + var found = artifacts.get(item.key); + found.update(item); + if (artifacts.wasSeen(item.key)) { + artifacts.move(found, current); + target.move(found.key, found.value, found.memo, current ? current.key : null); + } else { + this.advanceToKey(key); + } + }; - function alias(altKey) { - return new AliasedProperty(altKey); - } + IteratorSynchronizer.prototype.nextInsert = function nextInsert(item) { + var artifacts = this.artifacts; + var target = this.target; + var current = this.current; - function AliasedProperty(altKey) { - this.isDescriptor = true; - this.altKey = altKey; - this._dependentKeys = [altKey]; - } + var node = artifacts.insertBefore(item, current); + target.insert(node.key, node.value, node.memo, current ? current.key : null); + }; - AliasedProperty.prototype = Object.create(_emberMetalProperties.Descriptor.prototype); + IteratorSynchronizer.prototype.startPrune = function startPrune() { + this.current = this.artifacts.head(); + return Phase.Prune; + }; - AliasedProperty.prototype.setup = function (obj, keyName) { - _emberMetalDebug.assert('Setting alias \'' + keyName + '\' on self', this.altKey !== keyName); - var meta = _emberMetalMeta.meta(obj); - if (meta.peekWatching(keyName)) { - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); - } - }; + IteratorSynchronizer.prototype.nextPrune = function nextPrune() { + var artifacts = this.artifacts; + var target = this.target; + var current = this.current; - AliasedProperty.prototype.teardown = function (obj, keyName) { - var meta = _emberMetalMeta.meta(obj); - if (meta.peekWatching(keyName)) { - _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); - } - }; + if (current === null) { + return Phase.Done; + } + var node = current; + this.current = artifacts.nextNode(node); + if (node.shouldRemove()) { + artifacts.remove(node); + target.delete(node.key); + } else { + node.reset(); + } + return Phase.Prune; + }; - AliasedProperty.prototype.willWatch = function (obj, keyName) { - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); - }; + IteratorSynchronizer.prototype.nextDone = function nextDone() { + this.target.done(); + }; - AliasedProperty.prototype.didUnwatch = function (obj, keyName) { - _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); - }; + return IteratorSynchronizer; + })(); - AliasedProperty.prototype.get = function AliasedProperty_get(obj, keyName) { - var ret = _emberMetalProperty_get.get(obj, this.altKey); - var meta = _emberMetalMeta.meta(obj); - var cache = meta.writableCache(); - if (cache[keyName] !== CONSUMED) { - cache[keyName] = CONSUMED; - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); + function referenceFromParts(root, parts) { + var reference = root; + for (var i = 0; i < parts.length; i++) { + reference = reference.get(parts[i]); + } + return reference; } - return ret; - }; - - AliasedProperty.prototype.set = function AliasedProperty_set(obj, keyName, value) { - return _emberMetalProperty_set.set(obj, this.altKey, value); - }; - AliasedProperty.prototype.readOnly = function () { - this.set = AliasedProperty_readOnlySet; - return this; - }; - - function AliasedProperty_readOnlySet(obj, keyName, value) { - throw new _emberMetalError.default('Cannot set read-only property \'' + keyName + '\' on object: ' + _emberUtils.inspect(obj)); - } - - AliasedProperty.prototype.oneWay = function () { - this.set = AliasedProperty_oneWaySet; - return this; - }; - - function AliasedProperty_oneWaySet(obj, keyName, value) { - _emberMetalProperties.defineProperty(obj, keyName, null); - return _emberMetalProperty_set.set(obj, keyName, value); - } - - // Backwards compatibility with Ember Data. - AliasedProperty.prototype._meta = undefined; - AliasedProperty.prototype.meta = _emberMetalComputed.ComputedProperty.prototype.meta; + exports.ConstReference = ConstReference; + exports.isConst = isConst; + exports.ListItem = ListItem; + exports.referenceFromParts = referenceFromParts; + exports.IterationArtifacts = IterationArtifacts; + exports.ReferenceIterator = ReferenceIterator; + exports.IteratorSynchronizer = IteratorSynchronizer; + exports.CONSTANT = CONSTANT; + exports.INITIAL = INITIAL; + exports.VOLATILE = VOLATILE; + exports.RevisionTag = RevisionTag; + exports.DirtyableTag = DirtyableTag; + exports.combineTagged = combineTagged; + exports.combineSlice = combineSlice; + exports.combine = combine; + exports.CachedTag = CachedTag; + exports.UpdatableTag = UpdatableTag; + exports.CONSTANT_TAG = CONSTANT_TAG; + exports.VOLATILE_TAG = VOLATILE_TAG; + exports.CURRENT_TAG = CURRENT_TAG; + exports.CachedReference = CachedReference; + exports.map = map; + exports.ReferenceCache = ReferenceCache; + exports.isModified = isModified; }); -enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember-environment', 'ember-metal/run_loop', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/events', 'ember-metal/observer', 'ember-metal/path_cache'], function (exports, _emberUtils, _emberConsole, _emberEnvironment, _emberMetalRun_loop, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalEvents, _emberMetalObserver, _emberMetalPath_cache) { - 'use strict'; - - exports.bind = bind; - - /** - @module ember - @submodule ember-metal - */ - - // .......................................................... - // BINDING - // - - function Binding(toPath, fromPath) { - // Configuration - this._from = fromPath; - this._to = toPath; - this._oneWay = undefined; - - // State - this._direction = undefined; - this._readyToSync = undefined; - this._fromObj = undefined; - this._fromPath = undefined; - this._toObj = undefined; - } - - /** - @class Binding - @namespace Ember - @deprecated See http://emberjs.com/deprecations/v2.x#toc_ember-binding - @public - */ - - Binding.prototype = { - /** - This copies the Binding so it can be connected to another object. - @method copy - @return {Ember.Binding} `this` - @public - */ - copy: function () { - var copy = new Binding(this._to, this._from); - if (this._oneWay) { - copy._oneWay = true; - } - return copy; - }, - - // .......................................................... - // CONFIG - // - - /** - This will set `from` property path to the specified value. It will not - attempt to resolve this property path to an actual object until you - connect the binding. - The binding will search for the property path starting at the root object - you pass when you `connect()` the binding. It follows the same rules as - `get()` - see that method for more information. - @method from - @param {String} path The property path to connect to. - @return {Ember.Binding} `this` - @public - */ - from: function (path) { - this._from = path; - return this; - }, - - /** - This will set the `to` property path to the specified value. It will not - attempt to resolve this property path to an actual object until you - connect the binding. - The binding will search for the property path starting at the root object - you pass when you `connect()` the binding. It follows the same rules as - `get()` - see that method for more information. - @method to - @param {String|Tuple} path A property path or tuple. - @return {Ember.Binding} `this` - @public - */ - to: function (path) { - this._to = path; - return this; - }, - - /** - Configures the binding as one way. A one-way binding will relay changes - on the `from` side to the `to` side, but not the other way around. This - means that if you change the `to` side directly, the `from` side may have - a different value. - @method oneWay - @return {Ember.Binding} `this` - @public - */ - oneWay: function () { - this._oneWay = true; - return this; - }, +enifed('@glimmer/runtime',['exports','@glimmer/util','@glimmer/reference','@glimmer/wire-format'],function(exports,_glimmerUtil,_glimmerReference,_glimmerWireFormat){'use strict';var PrimitiveReference=(function(_ConstReference){babelHelpers.inherits(PrimitiveReference,_ConstReference);function PrimitiveReference(value){_ConstReference.call(this,value);}PrimitiveReference.create = function create(value){if(value === undefined){return UNDEFINED_REFERENCE;}else if(value === null){return NULL_REFERENCE;}else if(value === true){return TRUE_REFERENCE;}else if(value === false){return FALSE_REFERENCE;}else if(typeof value === 'number'){return new ValueReference(value);}else {return new StringReference(value);}};PrimitiveReference.prototype.get = function get(_key){return UNDEFINED_REFERENCE;};return PrimitiveReference;})(_glimmerReference.ConstReference);var StringReference=(function(_PrimitiveReference){babelHelpers.inherits(StringReference,_PrimitiveReference);function StringReference(){_PrimitiveReference.apply(this,arguments);this.lengthReference = null;}StringReference.prototype.get = function get(key){if(key === 'length'){var lengthReference=this.lengthReference;if(lengthReference === null){lengthReference = this.lengthReference = new ValueReference(this.inner.length);}return lengthReference;}else {return _PrimitiveReference.prototype.get.call(this,key);}};return StringReference;})(PrimitiveReference);var ValueReference=(function(_PrimitiveReference2){babelHelpers.inherits(ValueReference,_PrimitiveReference2);function ValueReference(value){_PrimitiveReference2.call(this,value);}return ValueReference;})(PrimitiveReference);var UNDEFINED_REFERENCE=new ValueReference(undefined);var NULL_REFERENCE=new ValueReference(null);var TRUE_REFERENCE=new ValueReference(true);var FALSE_REFERENCE=new ValueReference(false);var ConditionalReference=(function(){function ConditionalReference(inner){this.inner = inner;this.tag = inner.tag;}ConditionalReference.prototype.value = function value(){return this.toBool(this.inner.value());};ConditionalReference.prototype.toBool = function toBool(value){return !!value;};return ConditionalReference;})();var Constants=(function(){function Constants(){ // `0` means NULL +this.references = [];this.strings = [];this.expressions = [];this.arrays = [];this.slices = [];this.blocks = [];this.functions = [];this.others = [];this.NULL_REFERENCE = this.reference(NULL_REFERENCE);this.UNDEFINED_REFERENCE = this.reference(UNDEFINED_REFERENCE);}Constants.prototype.getReference = function getReference(value){return this.references[value - 1];};Constants.prototype.reference = function reference(value){var index=this.references.length;this.references.push(value);return index + 1;};Constants.prototype.getString = function getString(value){return this.strings[value - 1];};Constants.prototype.string = function string(value){var index=this.strings.length;this.strings.push(value);return index + 1;};Constants.prototype.getExpression = function getExpression(value){return this.expressions[value - 1];};Constants.prototype.expression = function expression(value){var index=this.expressions.length;this.expressions.push(value);return index + 1;};Constants.prototype.getArray = function getArray(value){return this.arrays[value - 1];};Constants.prototype.array = function array(values){var index=this.arrays.length;this.arrays.push(values);return index + 1;};Constants.prototype.getSlice = function getSlice(value){return this.slices[value - 1];};Constants.prototype.slice = function slice(_slice2){ // TODO: Put the entire program in one big array +var index=this.slices.length;this.slices.push(_slice2);return index + 1;};Constants.prototype.getBlock = function getBlock(value){return this.blocks[value - 1];};Constants.prototype.block = function block(_block2){var index=this.blocks.length;this.blocks.push(_block2);return index + 1;};Constants.prototype.getFunction = function getFunction(value){return this.functions[value - 1];};Constants.prototype.function = function _function(f){var index=this.functions.length;this.functions.push(f);return index + 1;};Constants.prototype.getOther = function getOther(value){return this.others[value - 1];};Constants.prototype.other = function other(_other){var index=this.others.length;this.others.push(_other);return index + 1;};return Constants;})();var AppendOpcodes=(function(){function AppendOpcodes(){this.evaluateOpcode = _glimmerUtil.fillNulls(51 /* EvaluatePartial */ + 1);}AppendOpcodes.prototype.add = function add(name,evaluate){this.evaluateOpcode[name] = evaluate;};AppendOpcodes.prototype.construct = function construct(name,_debug,op1,op2,op3){return [name | 0,(op1 || 0) | 0,(op2 || 0) | 0,(op3 || 0) | 0];};AppendOpcodes.prototype.evaluate = function evaluate(vm,opcode){_glimmerUtil.LOGGER.debug('[VM] OPCODE: ' + opcode.type);var func=this.evaluateOpcode[opcode.type];func(vm,opcode);};return AppendOpcodes;})();var APPEND_OPCODES=new AppendOpcodes();var AbstractOpcode=(function(){function AbstractOpcode(){_glimmerUtil.initializeGuid(this);}AbstractOpcode.prototype.toJSON = function toJSON(){return {guid:this._guid,type:this.type};};return AbstractOpcode;})();var UpdatingOpcode=(function(_AbstractOpcode){babelHelpers.inherits(UpdatingOpcode,_AbstractOpcode);function UpdatingOpcode(){_AbstractOpcode.apply(this,arguments);this.next = null;this.prev = null;}return UpdatingOpcode;})(AbstractOpcode);APPEND_OPCODES.add(20, /* OpenBlock */function(vm,_ref){var _getBlock=_ref.op1;var _args=_ref.op2;var inner=vm.constants.getOther(_getBlock);var rawArgs=vm.constants.getExpression(_args);var args=null;var block=inner.evaluate(vm);if(block){args = rawArgs.evaluate(vm);} // FIXME: can we avoid doing this when we don't have a block? +vm.pushCallerScope();if(block){vm.invokeBlock(block,args || null);}});APPEND_OPCODES.add(21, /* CloseBlock */function(vm){return vm.popScope();});APPEND_OPCODES.add(0, /* PushChildScope */function(vm){return vm.pushChildScope();});APPEND_OPCODES.add(1, /* PopScope */function(vm){return vm.popScope();});APPEND_OPCODES.add(2, /* PushDynamicScope */function(vm){return vm.pushDynamicScope();});APPEND_OPCODES.add(3, /* PopDynamicScope */function(vm){return vm.popDynamicScope();});APPEND_OPCODES.add(4, /* Put */function(vm,_ref2){var reference=_ref2.op1;vm.frame.setOperand(vm.constants.getReference(reference));});APPEND_OPCODES.add(5, /* EvaluatePut */function(vm,_ref3){var expression=_ref3.op1;var expr=vm.constants.getExpression(expression);vm.evaluateOperand(expr);});APPEND_OPCODES.add(6, /* PutArgs */function(vm,_ref4){var args=_ref4.op1;vm.evaluateArgs(vm.constants.getExpression(args));});APPEND_OPCODES.add(7, /* BindPositionalArgs */function(vm,_ref5){var _symbols=_ref5.op1;var symbols=vm.constants.getArray(_symbols);vm.bindPositionalArgs(symbols);});APPEND_OPCODES.add(8, /* BindNamedArgs */function(vm,_ref6){var _names=_ref6.op1;var _symbols=_ref6.op2;var names=vm.constants.getArray(_names);var symbols=vm.constants.getArray(_symbols);vm.bindNamedArgs(names,symbols);});APPEND_OPCODES.add(9, /* BindBlocks */function(vm,_ref7){var _names=_ref7.op1;var _symbols=_ref7.op2;var names=vm.constants.getArray(_names);var symbols=vm.constants.getArray(_symbols);vm.bindBlocks(names,symbols);});APPEND_OPCODES.add(10, /* BindPartialArgs */function(vm,_ref8){var symbol=_ref8.op1;vm.bindPartialArgs(symbol);});APPEND_OPCODES.add(11, /* BindCallerScope */function(vm){return vm.bindCallerScope();});APPEND_OPCODES.add(12, /* BindDynamicScope */function(vm,_ref9){var _names=_ref9.op1;var names=vm.constants.getArray(_names);vm.bindDynamicScope(names);});APPEND_OPCODES.add(13, /* Enter */function(vm,_ref10){var slice=_ref10.op1;return vm.enter(slice);});APPEND_OPCODES.add(14, /* Exit */function(vm){return vm.exit();});APPEND_OPCODES.add(15, /* Evaluate */function(vm,_ref11){var _block=_ref11.op1;var block=vm.constants.getBlock(_block);var args=vm.frame.getArgs();vm.invokeBlock(block,args);});APPEND_OPCODES.add(16, /* Jump */function(vm,_ref12){var target=_ref12.op1;return vm.goto(target);});APPEND_OPCODES.add(17, /* JumpIf */function(vm,_ref13){var target=_ref13.op1;var reference=vm.frame.getCondition();if(_glimmerReference.isConst(reference)){if(reference.value()){vm.goto(target);}}else {var cache=new _glimmerReference.ReferenceCache(reference);if(cache.peek()){vm.goto(target);}vm.updateWith(new Assert(cache));}});APPEND_OPCODES.add(18, /* JumpUnless */function(vm,_ref14){var target=_ref14.op1;var reference=vm.frame.getCondition();if(_glimmerReference.isConst(reference)){if(!reference.value()){vm.goto(target);}}else {var cache=new _glimmerReference.ReferenceCache(reference);if(!cache.peek()){vm.goto(target);}vm.updateWith(new Assert(cache));}});var ConstTest=function(ref,_env){return new _glimmerReference.ConstReference(!!ref.value());};var SimpleTest=function(ref,_env){return ref;};var EnvironmentTest=function(ref,env){return env.toConditionalReference(ref);};APPEND_OPCODES.add(19, /* Test */function(vm,_ref15){var _func=_ref15.op1;var operand=vm.frame.getOperand();var func=vm.constants.getFunction(_func);vm.frame.setCondition(func(operand,vm.env));});var Assert=(function(_UpdatingOpcode){babelHelpers.inherits(Assert,_UpdatingOpcode);function Assert(cache){_UpdatingOpcode.call(this);this.type = "assert";this.tag = cache.tag;this.cache = cache;}Assert.prototype.evaluate = function evaluate(vm){var cache=this.cache;if(_glimmerReference.isModified(cache.revalidate())){vm.throw();}};Assert.prototype.toJSON = function toJSON(){var type=this.type;var _guid=this._guid;var cache=this.cache;var expected=undefined;try{expected = JSON.stringify(cache.peek());}catch(e) {expected = String(cache.peek());}return {guid:_guid,type:type,args:[],details:{expected:expected}};};return Assert;})(UpdatingOpcode);var JumpIfNotModifiedOpcode=(function(_UpdatingOpcode2){babelHelpers.inherits(JumpIfNotModifiedOpcode,_UpdatingOpcode2);function JumpIfNotModifiedOpcode(tag,target){_UpdatingOpcode2.call(this);this.target = target;this.type = "jump-if-not-modified";this.tag = tag;this.lastRevision = tag.value();}JumpIfNotModifiedOpcode.prototype.evaluate = function evaluate(vm){var tag=this.tag;var target=this.target;var lastRevision=this.lastRevision;if(!vm.alwaysRevalidate && tag.validate(lastRevision)){vm.goto(target);}};JumpIfNotModifiedOpcode.prototype.didModify = function didModify(){this.lastRevision = this.tag.value();};JumpIfNotModifiedOpcode.prototype.toJSON = function toJSON(){return {guid:this._guid,type:this.type,args:[JSON.stringify(this.target.inspect())]};};return JumpIfNotModifiedOpcode;})(UpdatingOpcode);var DidModifyOpcode=(function(_UpdatingOpcode3){babelHelpers.inherits(DidModifyOpcode,_UpdatingOpcode3);function DidModifyOpcode(target){_UpdatingOpcode3.call(this);this.target = target;this.type = "did-modify";this.tag = _glimmerReference.CONSTANT_TAG;}DidModifyOpcode.prototype.evaluate = function evaluate(){this.target.didModify();};return DidModifyOpcode;})(UpdatingOpcode);var LabelOpcode=(function(){function LabelOpcode(label){this.tag = _glimmerReference.CONSTANT_TAG;this.type = "label";this.label = null;this.prev = null;this.next = null;_glimmerUtil.initializeGuid(this);if(label)this.label = label;}LabelOpcode.prototype.evaluate = function evaluate(){};LabelOpcode.prototype.inspect = function inspect(){return this.label + ' [' + this._guid + ']';};LabelOpcode.prototype.toJSON = function toJSON(){return {guid:this._guid,type:this.type,args:[JSON.stringify(this.inspect())]};};return LabelOpcode;})();var EMPTY_ARRAY=_glimmerUtil.HAS_NATIVE_WEAKMAP?Object.freeze([]):[];var EMPTY_DICT=_glimmerUtil.HAS_NATIVE_WEAKMAP?Object.freeze(_glimmerUtil.dict()):_glimmerUtil.dict();var CompiledPositionalArgs=(function(){function CompiledPositionalArgs(values){this.values = values;this.length = values.length;}CompiledPositionalArgs.create = function create(values){if(values.length){return new this(values);}else {return COMPILED_EMPTY_POSITIONAL_ARGS;}};CompiledPositionalArgs.empty = function empty(){return COMPILED_EMPTY_POSITIONAL_ARGS;};CompiledPositionalArgs.prototype.evaluate = function evaluate(vm){var values=this.values;var length=this.length;var references=new Array(length);for(var i=0;i < length;i++) {references[i] = values[i].evaluate(vm);}return EvaluatedPositionalArgs.create(references);};CompiledPositionalArgs.prototype.toJSON = function toJSON(){return '[' + this.values.map(function(value){return value.toJSON();}).join(", ") + ']';};return CompiledPositionalArgs;})();var COMPILED_EMPTY_POSITIONAL_ARGS=new ((function(_CompiledPositionalArgs){babelHelpers.inherits(_class,_CompiledPositionalArgs);function _class(){_CompiledPositionalArgs.call(this,EMPTY_ARRAY);}_class.prototype.evaluate = function evaluate(_vm){return EVALUATED_EMPTY_POSITIONAL_ARGS;};_class.prototype.toJSON = function toJSON(){return '';};return _class;})(CompiledPositionalArgs))();var EvaluatedPositionalArgs=(function(){function EvaluatedPositionalArgs(values){this.values = values;this.tag = _glimmerReference.combineTagged(values);this.length = values.length;}EvaluatedPositionalArgs.create = function create(values){return new this(values);};EvaluatedPositionalArgs.empty = function empty(){return EVALUATED_EMPTY_POSITIONAL_ARGS;};EvaluatedPositionalArgs.prototype.at = function at(index){var values=this.values;var length=this.length;return index < length?values[index]:UNDEFINED_REFERENCE;};EvaluatedPositionalArgs.prototype.value = function value(){var values=this.values;var length=this.length;var ret=new Array(length);for(var i=0;i < length;i++) {ret[i] = values[i].value();}return ret;};return EvaluatedPositionalArgs;})();var EVALUATED_EMPTY_POSITIONAL_ARGS=new ((function(_EvaluatedPositionalArgs){babelHelpers.inherits(_class2,_EvaluatedPositionalArgs);function _class2(){_EvaluatedPositionalArgs.call(this,EMPTY_ARRAY);}_class2.prototype.at = function at(){return UNDEFINED_REFERENCE;};_class2.prototype.value = function value(){return this.values;};return _class2;})(EvaluatedPositionalArgs))();var CompiledNamedArgs=(function(){function CompiledNamedArgs(keys,values){this.keys = keys;this.values = values;this.length = keys.length;_glimmerUtil.assert(keys.length === values.length,'Keys and values do not have the same length');}CompiledNamedArgs.empty = function empty(){return COMPILED_EMPTY_NAMED_ARGS;};CompiledNamedArgs.create = function create(map){var keys=Object.keys(map);var length=keys.length;if(length > 0){var values=[];for(var i=0;i < length;i++) {values[i] = map[keys[i]];}return new this(keys,values);}else {return COMPILED_EMPTY_NAMED_ARGS;}};CompiledNamedArgs.prototype.evaluate = function evaluate(vm){var keys=this.keys;var values=this.values;var length=this.length;var evaluated=new Array(length);for(var i=0;i < length;i++) {evaluated[i] = values[i].evaluate(vm);}return new EvaluatedNamedArgs(keys,evaluated);};CompiledNamedArgs.prototype.toJSON = function toJSON(){var keys=this.keys;var values=this.values;var inner=keys.map(function(key,i){return key + ': ' + values[i].toJSON();}).join(", ");return '{' + inner + '}';};return CompiledNamedArgs;})();var COMPILED_EMPTY_NAMED_ARGS=new ((function(_CompiledNamedArgs){babelHelpers.inherits(_class3,_CompiledNamedArgs);function _class3(){_CompiledNamedArgs.call(this,EMPTY_ARRAY,EMPTY_ARRAY);}_class3.prototype.evaluate = function evaluate(_vm){return EVALUATED_EMPTY_NAMED_ARGS;};_class3.prototype.toJSON = function toJSON(){return '';};return _class3;})(CompiledNamedArgs))();var EvaluatedNamedArgs=(function(){function EvaluatedNamedArgs(keys,values){var _map=arguments.length <= 2 || arguments[2] === undefined?null:arguments[2];this.keys = keys;this.values = values;this._map = _map;this.tag = _glimmerReference.combineTagged(values);this.length = keys.length;_glimmerUtil.assert(keys.length === values.length,'Keys and values do not have the same length');}EvaluatedNamedArgs.create = function create(map){var keys=Object.keys(map);var length=keys.length;if(length > 0){var values=new Array(length);for(var i=0;i < length;i++) {values[i] = map[keys[i]];}return new this(keys,values,map);}else {return EVALUATED_EMPTY_NAMED_ARGS;}};EvaluatedNamedArgs.empty = function empty(){return EVALUATED_EMPTY_NAMED_ARGS;};EvaluatedNamedArgs.prototype.get = function get(key){var keys=this.keys;var values=this.values;var index=keys.indexOf(key);return index === -1?UNDEFINED_REFERENCE:values[index];};EvaluatedNamedArgs.prototype.has = function has(key){return this.keys.indexOf(key) !== -1;};EvaluatedNamedArgs.prototype.value = function value(){var keys=this.keys;var values=this.values;var out=_glimmerUtil.dict();for(var i=0;i < keys.length;i++) {var key=keys[i];var ref=values[i];out[key] = ref.value();}return out;};babelHelpers.createClass(EvaluatedNamedArgs,[{key:'map',get:function(){var map=this._map;if(map){return map;}map = this._map = _glimmerUtil.dict();var keys=this.keys;var values=this.values;var length=this.length;for(var i=0;i < length;i++) {map[keys[i]] = values[i];}return map;}}]);return EvaluatedNamedArgs;})();var EVALUATED_EMPTY_NAMED_ARGS=new ((function(_EvaluatedNamedArgs){babelHelpers.inherits(_class4,_EvaluatedNamedArgs);function _class4(){_EvaluatedNamedArgs.call(this,EMPTY_ARRAY,EMPTY_ARRAY,EMPTY_DICT);}_class4.prototype.get = function get(){return UNDEFINED_REFERENCE;};_class4.prototype.has = function has(_key){return false;};_class4.prototype.value = function value(){return EMPTY_DICT;};return _class4;})(EvaluatedNamedArgs))();var EMPTY_BLOCKS={default:null,inverse:null};var CompiledArgs=(function(){function CompiledArgs(positional,named,blocks){this.positional = positional;this.named = named;this.blocks = blocks;this.type = "compiled-args";}CompiledArgs.create = function create(positional,named,blocks){if(positional === COMPILED_EMPTY_POSITIONAL_ARGS && named === COMPILED_EMPTY_NAMED_ARGS && blocks === EMPTY_BLOCKS){return this.empty();}else {return new this(positional,named,blocks);}};CompiledArgs.empty = function empty(){return COMPILED_EMPTY_ARGS;};CompiledArgs.prototype.evaluate = function evaluate(vm){var positional=this.positional;var named=this.named;var blocks=this.blocks;return EvaluatedArgs.create(positional.evaluate(vm),named.evaluate(vm),blocks);};return CompiledArgs;})();var COMPILED_EMPTY_ARGS=new ((function(_CompiledArgs){babelHelpers.inherits(_class5,_CompiledArgs);function _class5(){_CompiledArgs.call(this,COMPILED_EMPTY_POSITIONAL_ARGS,COMPILED_EMPTY_NAMED_ARGS,EMPTY_BLOCKS);}_class5.prototype.evaluate = function evaluate(_vm){return EMPTY_EVALUATED_ARGS;};return _class5;})(CompiledArgs))();var EvaluatedArgs=(function(){function EvaluatedArgs(positional,named,blocks){this.positional = positional;this.named = named;this.blocks = blocks;this.tag = _glimmerReference.combineTagged([positional,named]);}EvaluatedArgs.empty = function empty(){return EMPTY_EVALUATED_ARGS;};EvaluatedArgs.create = function create(positional,named,blocks){return new this(positional,named,blocks);};EvaluatedArgs.positional = function positional(values){var blocks=arguments.length <= 1 || arguments[1] === undefined?EMPTY_BLOCKS:arguments[1];return new this(EvaluatedPositionalArgs.create(values),EVALUATED_EMPTY_NAMED_ARGS,blocks);};EvaluatedArgs.named = function named(map){var blocks=arguments.length <= 1 || arguments[1] === undefined?EMPTY_BLOCKS:arguments[1];return new this(EVALUATED_EMPTY_POSITIONAL_ARGS,EvaluatedNamedArgs.create(map),blocks);};return EvaluatedArgs;})();var EMPTY_EVALUATED_ARGS=new EvaluatedArgs(EVALUATED_EMPTY_POSITIONAL_ARGS,EVALUATED_EMPTY_NAMED_ARGS,EMPTY_BLOCKS);APPEND_OPCODES.add(22, /* PutDynamicComponent */function(vm){var reference=vm.frame.getOperand();var cache=_glimmerReference.isConst(reference)?undefined:new _glimmerReference.ReferenceCache(reference);var definition=cache?cache.peek():reference.value();vm.frame.setImmediate(definition);if(cache){vm.updateWith(new Assert(cache));}});APPEND_OPCODES.add(23, /* PutComponent */function(vm,_ref16){var _component=_ref16.op1;var definition=vm.constants.getOther(_component);vm.frame.setImmediate(definition);});APPEND_OPCODES.add(24, /* OpenComponent */function(vm,_ref17){var _args=_ref17.op1;var _shadow=_ref17.op2;var rawArgs=vm.constants.getExpression(_args);var shadow=vm.constants.getBlock(_shadow);var definition=vm.frame.getImmediate();var dynamicScope=vm.pushDynamicScope();var callerScope=vm.scope();var manager=definition.manager;var args=manager.prepareArgs(definition,rawArgs.evaluate(vm),dynamicScope);var hasDefaultBlock=!!args.blocks.default; // TODO Cleanup? +var component=manager.create(vm.env,definition,args,dynamicScope,vm.getSelf(),hasDefaultBlock);var destructor=manager.getDestructor(component);if(destructor)vm.newDestroyable(destructor);var layout=manager.layoutFor(definition,component,vm.env);var selfRef=manager.getSelf(component);vm.beginCacheGroup();vm.stack().pushSimpleBlock();vm.pushRootScope(selfRef,layout.symbols);vm.invokeLayout(args,layout,callerScope,component,manager,shadow);vm.updateWith(new UpdateComponentOpcode(definition.name,component,manager,args,dynamicScope));}); // export class DidCreateElementOpcode extends Opcode { +// public type = "did-create-element"; +// evaluate(vm: VM) { +// let manager = vm.frame.getManager(); +// let component = vm.frame.getComponent(); +// let action = 'DidCreateElementOpcode#evaluate'; +// manager.didCreateElement(component, vm.stack().expectConstructing(action), vm.stack().expectOperations(action)); +// } +// toJSON(): OpcodeJSON { +// return { +// guid: this._guid, +// type: this.type, +// args: ["$ARGS"] +// }; +// } +// } +APPEND_OPCODES.add(25, /* DidCreateElement */function(vm){var manager=vm.frame.getManager();var component=vm.frame.getComponent();var action='DidCreateElementOpcode#evaluate';manager.didCreateElement(component,vm.stack().expectConstructing(action),vm.stack().expectOperations(action));}); // export class ShadowAttributesOpcode extends Opcode { +// public type = "shadow-attributes"; +// evaluate(vm: VM) { +// let shadow = vm.frame.getShadow(); +// vm.pushCallerScope(); +// if (!shadow) return; +// vm.invokeBlock(shadow, EvaluatedArgs.empty()); +// } +// toJSON(): OpcodeJSON { +// return { +// guid: this._guid, +// type: this.type, +// args: ["$ARGS"] +// }; +// } +// } +// Slow path for non-specialized component invocations. Uses an internal +// named lookup on the args. +APPEND_OPCODES.add(26, /* ShadowAttributes */function(vm){var shadow=vm.frame.getShadow();vm.pushCallerScope();if(!shadow)return;vm.invokeBlock(shadow,EvaluatedArgs.empty());}); // export class DidRenderLayoutOpcode extends Opcode { +// public type = "did-render-layout"; +// evaluate(vm: VM) { +// let manager = vm.frame.getManager(); +// let component = vm.frame.getComponent(); +// let bounds = vm.stack().popBlock(); +// manager.didRenderLayout(component, bounds); +// vm.env.didCreate(component, manager); +// vm.updateWith(new DidUpdateLayoutOpcode(manager, component, bounds)); +// } +// } +APPEND_OPCODES.add(27, /* DidRenderLayout */function(vm){var manager=vm.frame.getManager();var component=vm.frame.getComponent();var bounds=vm.stack().popBlock();manager.didRenderLayout(component,bounds);vm.env.didCreate(component,manager);vm.updateWith(new DidUpdateLayoutOpcode(manager,component,bounds));}); // export class CloseComponentOpcode extends Opcode { +// public type = "close-component"; +// evaluate(vm: VM) { +// vm.popScope(); +// vm.popDynamicScope(); +// vm.commitCacheGroup(); +// } +// } +APPEND_OPCODES.add(28, /* CloseComponent */function(vm){vm.popScope();vm.popDynamicScope();vm.commitCacheGroup();});var UpdateComponentOpcode=(function(_UpdatingOpcode4){babelHelpers.inherits(UpdateComponentOpcode,_UpdatingOpcode4);function UpdateComponentOpcode(name,component,manager,args,dynamicScope){_UpdatingOpcode4.call(this);this.name = name;this.component = component;this.manager = manager;this.args = args;this.dynamicScope = dynamicScope;this.type = "update-component";var componentTag=manager.getTag(component);if(componentTag){this.tag = _glimmerReference.combine([args.tag,componentTag]);}else {this.tag = args.tag;}}UpdateComponentOpcode.prototype.evaluate = function evaluate(_vm){var component=this.component;var manager=this.manager;var args=this.args;var dynamicScope=this.dynamicScope;manager.update(component,args,dynamicScope);};UpdateComponentOpcode.prototype.toJSON = function toJSON(){return {guid:this._guid,type:this.type,args:[JSON.stringify(this.name)]};};return UpdateComponentOpcode;})(UpdatingOpcode);var DidUpdateLayoutOpcode=(function(_UpdatingOpcode5){babelHelpers.inherits(DidUpdateLayoutOpcode,_UpdatingOpcode5);function DidUpdateLayoutOpcode(manager,component,bounds){_UpdatingOpcode5.call(this);this.manager = manager;this.component = component;this.bounds = bounds;this.type = "did-update-layout";this.tag = _glimmerReference.CONSTANT_TAG;}DidUpdateLayoutOpcode.prototype.evaluate = function evaluate(vm){var manager=this.manager;var component=this.component;var bounds=this.bounds;manager.didUpdateLayout(component,bounds);vm.env.didUpdate(component,manager);};return DidUpdateLayoutOpcode;})(UpdatingOpcode);var Cursor=function Cursor(element,nextSibling){this.element = element;this.nextSibling = nextSibling;};var ConcreteBounds=(function(){function ConcreteBounds(parentNode,first,last){this.parentNode = parentNode;this.first = first;this.last = last;}ConcreteBounds.prototype.parentElement = function parentElement(){return this.parentNode;};ConcreteBounds.prototype.firstNode = function firstNode(){return this.first;};ConcreteBounds.prototype.lastNode = function lastNode(){return this.last;};return ConcreteBounds;})();var SingleNodeBounds=(function(){function SingleNodeBounds(parentNode,node){this.parentNode = parentNode;this.node = node;}SingleNodeBounds.prototype.parentElement = function parentElement(){return this.parentNode;};SingleNodeBounds.prototype.firstNode = function firstNode(){return this.node;};SingleNodeBounds.prototype.lastNode = function lastNode(){return this.node;};return SingleNodeBounds;})();function single(parent,node){return new SingleNodeBounds(parent,node);}function moveBounds(bounds,reference){var parent=bounds.parentElement();var first=bounds.firstNode();var last=bounds.lastNode();var node=first;while(node) {var next=node.nextSibling;parent.insertBefore(node,reference);if(node === last)return next;node = next;}return null;}function clear(bounds){var parent=bounds.parentElement();var first=bounds.firstNode();var last=bounds.lastNode();var node=first;while(node) {var next=node.nextSibling;parent.removeChild(node);if(node === last)return next;node = next;}return null;}function isSafeString(value){return !!value && typeof value['toHTML'] === 'function';}function isNode(value){return value !== null && typeof value === 'object' && typeof value['nodeType'] === 'number';}function isString(value){return typeof value === 'string';}var Upsert=function Upsert(bounds){this.bounds = bounds;};function cautiousInsert(dom,cursor,value){if(isString(value)){return TextUpsert.insert(dom,cursor,value);}if(isSafeString(value)){return SafeStringUpsert.insert(dom,cursor,value);}if(isNode(value)){return NodeUpsert.insert(dom,cursor,value);}throw _glimmerUtil.unreachable();}function trustingInsert(dom,cursor,value){if(isString(value)){return HTMLUpsert.insert(dom,cursor,value);}if(isNode(value)){return NodeUpsert.insert(dom,cursor,value);}throw _glimmerUtil.unreachable();}var TextUpsert=(function(_Upsert){babelHelpers.inherits(TextUpsert,_Upsert);TextUpsert.insert = function insert(dom,cursor,value){var textNode=dom.createTextNode(value);dom.insertBefore(cursor.element,textNode,cursor.nextSibling);var bounds=new SingleNodeBounds(cursor.element,textNode);return new TextUpsert(bounds,textNode);};function TextUpsert(bounds,textNode){_Upsert.call(this,bounds);this.textNode = textNode;}TextUpsert.prototype.update = function update(_dom,value){if(isString(value)){var textNode=this.textNode;textNode.nodeValue = value;return true;}else {return false;}};return TextUpsert;})(Upsert);var HTMLUpsert=(function(_Upsert2){babelHelpers.inherits(HTMLUpsert,_Upsert2);function HTMLUpsert(){_Upsert2.apply(this,arguments);}HTMLUpsert.insert = function insert(dom,cursor,value){var bounds=dom.insertHTMLBefore(cursor.element,value,cursor.nextSibling);return new HTMLUpsert(bounds);};HTMLUpsert.prototype.update = function update(dom,value){if(isString(value)){var bounds=this.bounds;var parentElement=bounds.parentElement();var nextSibling=clear(bounds);this.bounds = dom.insertHTMLBefore(parentElement,nextSibling,value);return true;}else {return false;}};return HTMLUpsert;})(Upsert);var SafeStringUpsert=(function(_Upsert3){babelHelpers.inherits(SafeStringUpsert,_Upsert3);function SafeStringUpsert(bounds,lastStringValue){_Upsert3.call(this,bounds);this.lastStringValue = lastStringValue;}SafeStringUpsert.insert = function insert(dom,cursor,value){var stringValue=value.toHTML();var bounds=dom.insertHTMLBefore(cursor.element,stringValue,cursor.nextSibling);return new SafeStringUpsert(bounds,stringValue);};SafeStringUpsert.prototype.update = function update(dom,value){if(isSafeString(value)){var stringValue=value.toHTML();if(stringValue !== this.lastStringValue){var bounds=this.bounds;var parentElement=bounds.parentElement();var nextSibling=clear(bounds);this.bounds = dom.insertHTMLBefore(parentElement,nextSibling,stringValue);this.lastStringValue = stringValue;}return true;}else {return false;}};return SafeStringUpsert;})(Upsert);var NodeUpsert=(function(_Upsert4){babelHelpers.inherits(NodeUpsert,_Upsert4);function NodeUpsert(){_Upsert4.apply(this,arguments);}NodeUpsert.insert = function insert(dom,cursor,node){dom.insertBefore(cursor.element,node,cursor.nextSibling);return new NodeUpsert(single(cursor.element,node));};NodeUpsert.prototype.update = function update(dom,value){if(isNode(value)){var bounds=this.bounds;var parentElement=bounds.parentElement();var nextSibling=clear(bounds);this.bounds = dom.insertNodeBefore(parentElement,value,nextSibling);return true;}else {return false;}};return NodeUpsert;})(Upsert);var COMPONENT_DEFINITION_BRAND='COMPONENT DEFINITION [id=e59c754e-61eb-4392-8c4a-2c0ac72bfcd4]';function isComponentDefinition(obj){return typeof obj === 'object' && obj && obj[COMPONENT_DEFINITION_BRAND];}var ComponentDefinition=function ComponentDefinition(name,manager,ComponentClass){this[COMPONENT_DEFINITION_BRAND] = true;this.name = name;this.manager = manager;this.ComponentClass = ComponentClass;};var CompiledExpression=(function(){function CompiledExpression(){}CompiledExpression.prototype.toJSON = function toJSON(){return 'UNIMPL: ' + this.type.toUpperCase();};return CompiledExpression;})();APPEND_OPCODES.add(29, /* Text */function(vm,_ref18){var text=_ref18.op1;vm.stack().appendText(vm.constants.getString(text));});APPEND_OPCODES.add(30, /* Comment */function(vm,_ref19){var text=_ref19.op1;vm.stack().appendComment(vm.constants.getString(text));});APPEND_OPCODES.add(32, /* OpenElement */function(vm,_ref20){var tag=_ref20.op1;vm.stack().openElement(vm.constants.getString(tag));});APPEND_OPCODES.add(33, /* PushRemoteElement */function(vm){var reference=vm.frame.getOperand();var cache=_glimmerReference.isConst(reference)?undefined:new _glimmerReference.ReferenceCache(reference);var element=cache?cache.peek():reference.value();vm.stack().pushRemoteElement(element);if(cache){vm.updateWith(new Assert(cache));}});APPEND_OPCODES.add(34, /* PopRemoteElement */function(vm){return vm.stack().popRemoteElement();});APPEND_OPCODES.add(35, /* OpenComponentElement */function(vm,_ref21){var _tag=_ref21.op1;var tag=vm.constants.getString(_tag);vm.stack().openElement(tag,new ComponentElementOperations(vm.env));});APPEND_OPCODES.add(36, /* OpenDynamicElement */function(vm){var tagName=vm.frame.getOperand().value();vm.stack().openElement(tagName);});var ClassList=(function(){function ClassList(){this.list = null;this.isConst = true;}ClassList.prototype.append = function append(reference){var list=this.list;var isConst$$=this.isConst;if(list === null)list = this.list = [];list.push(reference);this.isConst = isConst$$ && _glimmerReference.isConst(reference);};ClassList.prototype.toReference = function toReference(){var list=this.list;var isConst$$=this.isConst;if(!list)return NULL_REFERENCE;if(isConst$$)return PrimitiveReference.create(toClassName(list));return new ClassListReference(list);};return ClassList;})();var ClassListReference=(function(_CachedReference){babelHelpers.inherits(ClassListReference,_CachedReference);function ClassListReference(list){_CachedReference.call(this);this.list = [];this.tag = _glimmerReference.combineTagged(list);this.list = list;}ClassListReference.prototype.compute = function compute(){return toClassName(this.list);};return ClassListReference;})(_glimmerReference.CachedReference);function toClassName(list){var ret=[];for(var i=0;i < list.length;i++) {var value=list[i].value();if(value !== false && value !== null && value !== undefined)ret.push(value);}return ret.length === 0?null:ret.join(' ');}var SimpleElementOperations=(function(){function SimpleElementOperations(env){this.env = env;this.opcodes = null;this.classList = null;}SimpleElementOperations.prototype.addStaticAttribute = function addStaticAttribute(element,name,value){if(name === 'class'){this.addClass(PrimitiveReference.create(value));}else {this.env.getAppendOperations().setAttribute(element,name,value);}};SimpleElementOperations.prototype.addStaticAttributeNS = function addStaticAttributeNS(element,namespace,name,value){this.env.getAppendOperations().setAttribute(element,name,value,namespace);};SimpleElementOperations.prototype.addDynamicAttribute = function addDynamicAttribute(element,name,reference,isTrusting){if(name === 'class'){this.addClass(reference);}else {var attributeManager=this.env.attributeFor(element,name,isTrusting);var attribute=new DynamicAttribute(element,attributeManager,name,reference);this.addAttribute(attribute);}};SimpleElementOperations.prototype.addDynamicAttributeNS = function addDynamicAttributeNS(element,namespace,name,reference,isTrusting){var attributeManager=this.env.attributeFor(element,name,isTrusting,namespace);var nsAttribute=new DynamicAttribute(element,attributeManager,name,reference,namespace);this.addAttribute(nsAttribute);};SimpleElementOperations.prototype.flush = function flush(element,vm){var env=vm.env;var opcodes=this.opcodes;var classList=this.classList;for(var i=0;opcodes && i < opcodes.length;i++) {vm.updateWith(opcodes[i]);}if(classList){var attributeManager=env.attributeFor(element,'class',false);var attribute=new DynamicAttribute(element,attributeManager,'class',classList.toReference());var opcode=attribute.flush(env);if(opcode){vm.updateWith(opcode);}}this.opcodes = null;this.classList = null;};SimpleElementOperations.prototype.addClass = function addClass(reference){var classList=this.classList;if(!classList){classList = this.classList = new ClassList();}classList.append(reference);};SimpleElementOperations.prototype.addAttribute = function addAttribute(attribute){var opcode=attribute.flush(this.env);if(opcode){var opcodes=this.opcodes;if(!opcodes){opcodes = this.opcodes = [];}opcodes.push(opcode);}};return SimpleElementOperations;})();var ComponentElementOperations=(function(){function ComponentElementOperations(env){this.env = env;this.attributeNames = null;this.attributes = null;this.classList = null;}ComponentElementOperations.prototype.addStaticAttribute = function addStaticAttribute(element,name,value){if(name === 'class'){this.addClass(PrimitiveReference.create(value));}else if(this.shouldAddAttribute(name)){this.addAttribute(name,new StaticAttribute(element,name,value));}};ComponentElementOperations.prototype.addStaticAttributeNS = function addStaticAttributeNS(element,namespace,name,value){if(this.shouldAddAttribute(name)){this.addAttribute(name,new StaticAttribute(element,name,value,namespace));}};ComponentElementOperations.prototype.addDynamicAttribute = function addDynamicAttribute(element,name,reference,isTrusting){if(name === 'class'){this.addClass(reference);}else if(this.shouldAddAttribute(name)){var attributeManager=this.env.attributeFor(element,name,isTrusting);var attribute=new DynamicAttribute(element,attributeManager,name,reference);this.addAttribute(name,attribute);}};ComponentElementOperations.prototype.addDynamicAttributeNS = function addDynamicAttributeNS(element,namespace,name,reference,isTrusting){if(this.shouldAddAttribute(name)){var attributeManager=this.env.attributeFor(element,name,isTrusting,namespace);var nsAttribute=new DynamicAttribute(element,attributeManager,name,reference,namespace);this.addAttribute(name,nsAttribute);}};ComponentElementOperations.prototype.flush = function flush(element,vm){var env=this.env;var attributes=this.attributes;var classList=this.classList;for(var i=0;attributes && i < attributes.length;i++) {var opcode=attributes[i].flush(env);if(opcode){vm.updateWith(opcode);}}if(classList){var attributeManager=env.attributeFor(element,'class',false);var attribute=new DynamicAttribute(element,attributeManager,'class',classList.toReference());var opcode=attribute.flush(env);if(opcode){vm.updateWith(opcode);}}};ComponentElementOperations.prototype.shouldAddAttribute = function shouldAddAttribute(name){return !this.attributeNames || this.attributeNames.indexOf(name) === -1;};ComponentElementOperations.prototype.addClass = function addClass(reference){var classList=this.classList;if(!classList){classList = this.classList = new ClassList();}classList.append(reference);};ComponentElementOperations.prototype.addAttribute = function addAttribute(name,attribute){var attributeNames=this.attributeNames;var attributes=this.attributes;if(!attributeNames){attributeNames = this.attributeNames = [];attributes = this.attributes = [];}attributeNames.push(name);_glimmerUtil.unwrap(attributes).push(attribute);};return ComponentElementOperations;})();APPEND_OPCODES.add(37, /* FlushElement */function(vm){var stack=vm.stack();var action='FlushElementOpcode#evaluate';stack.expectOperations(action).flush(stack.expectConstructing(action),vm);stack.flushElement();});APPEND_OPCODES.add(38, /* CloseElement */function(vm){return vm.stack().closeElement();});APPEND_OPCODES.add(39, /* PopElement */function(vm){return vm.stack().popElement();});APPEND_OPCODES.add(40, /* StaticAttr */function(vm,_ref22){var _name=_ref22.op1;var _value=_ref22.op2;var _namespace=_ref22.op3;var name=vm.constants.getString(_name);var value=vm.constants.getString(_value);if(_namespace){var namespace=vm.constants.getString(_namespace);vm.stack().setStaticAttributeNS(namespace,name,value);}else {vm.stack().setStaticAttribute(name,value);}});APPEND_OPCODES.add(41, /* Modifier */function(vm,_ref23){var _name=_ref23.op1;var _manager=_ref23.op2;var _args=_ref23.op3;var manager=vm.constants.getOther(_manager);var rawArgs=vm.constants.getExpression(_args);var stack=vm.stack();var element=stack.constructing;var updateOperations=stack.updateOperations;var args=rawArgs.evaluate(vm);var dynamicScope=vm.dynamicScope();var modifier=manager.create(element,args,dynamicScope,updateOperations);vm.env.scheduleInstallModifier(modifier,manager);var destructor=manager.getDestructor(modifier);if(destructor){vm.newDestroyable(destructor);}vm.updateWith(new UpdateModifierOpcode(manager,modifier,args));});var UpdateModifierOpcode=(function(_UpdatingOpcode6){babelHelpers.inherits(UpdateModifierOpcode,_UpdatingOpcode6);function UpdateModifierOpcode(manager,modifier,args){_UpdatingOpcode6.call(this);this.manager = manager;this.modifier = modifier;this.args = args;this.type = "update-modifier";this.tag = args.tag;this.lastUpdated = args.tag.value();}UpdateModifierOpcode.prototype.evaluate = function evaluate(vm){var manager=this.manager;var modifier=this.modifier;var tag=this.tag;var lastUpdated=this.lastUpdated;if(!tag.validate(lastUpdated)){vm.env.scheduleUpdateModifier(modifier,manager);this.lastUpdated = tag.value();}};UpdateModifierOpcode.prototype.toJSON = function toJSON(){return {guid:this._guid,type:this.type,args:[JSON.stringify(this.args)]};};return UpdateModifierOpcode;})(UpdatingOpcode);var StaticAttribute=(function(){function StaticAttribute(element,name,value,namespace){this.element = element;this.name = name;this.value = value;this.namespace = namespace;}StaticAttribute.prototype.flush = function flush(env){env.getAppendOperations().setAttribute(this.element,this.name,this.value,this.namespace);return null;};return StaticAttribute;})();var DynamicAttribute=(function(){function DynamicAttribute(element,attributeManager,name,reference,namespace){this.element = element;this.attributeManager = attributeManager;this.name = name;this.reference = reference;this.namespace = namespace;this.cache = null;this.tag = reference.tag;}DynamicAttribute.prototype.patch = function patch(env){var element=this.element;var cache=this.cache;var value=_glimmerUtil.expect(cache,'must patch after flush').revalidate();if(_glimmerReference.isModified(value)){this.attributeManager.updateAttribute(env,element,value,this.namespace);}};DynamicAttribute.prototype.flush = function flush(env){var reference=this.reference;var element=this.element;if(_glimmerReference.isConst(reference)){var value=reference.value();this.attributeManager.setAttribute(env,element,value,this.namespace);return null;}else {var cache=this.cache = new _glimmerReference.ReferenceCache(reference);var value=cache.peek();this.attributeManager.setAttribute(env,element,value,this.namespace);return new PatchElementOpcode(this);}};DynamicAttribute.prototype.toJSON = function toJSON(){var element=this.element;var namespace=this.namespace;var name=this.name;var cache=this.cache;var formattedElement=formatElement(element);var lastValue=_glimmerUtil.expect(cache,'must serialize after flush').peek();if(namespace){return {element:formattedElement,type:'attribute',namespace:namespace,name:name,lastValue:lastValue};}return {element:formattedElement,type:'attribute',namespace:namespace === undefined?null:namespace,name:name,lastValue:lastValue};};return DynamicAttribute;})();function formatElement(element){return JSON.stringify('<' + element.tagName.toLowerCase() + ' />');}APPEND_OPCODES.add(42, /* DynamicAttrNS */function(vm,_ref24){var _name=_ref24.op1;var _namespace=_ref24.op2;var trusting=_ref24.op3;var name=vm.constants.getString(_name);var namespace=vm.constants.getString(_namespace);var reference=vm.frame.getOperand();vm.stack().setDynamicAttributeNS(namespace,name,reference,!!trusting);});APPEND_OPCODES.add(43, /* DynamicAttr */function(vm,_ref25){var _name=_ref25.op1;var trusting=_ref25.op2;var name=vm.constants.getString(_name);var reference=vm.frame.getOperand();vm.stack().setDynamicAttribute(name,reference,!!trusting);});var PatchElementOpcode=(function(_UpdatingOpcode7){babelHelpers.inherits(PatchElementOpcode,_UpdatingOpcode7);function PatchElementOpcode(operation){_UpdatingOpcode7.call(this);this.type = "patch-element";this.tag = operation.tag;this.operation = operation;}PatchElementOpcode.prototype.evaluate = function evaluate(vm){this.operation.patch(vm.env);};PatchElementOpcode.prototype.toJSON = function toJSON(){var _guid=this._guid;var type=this.type;var operation=this.operation;return {guid:_guid,type:type,details:operation.toJSON()};};return PatchElementOpcode;})(UpdatingOpcode);var First=(function(){function First(node){this.node = node;}First.prototype.firstNode = function firstNode(){return this.node;};return First;})();var Last=(function(){function Last(node){this.node = node;}Last.prototype.lastNode = function lastNode(){return this.node;};return Last;})();var Fragment=(function(){function Fragment(bounds){this.bounds = bounds;}Fragment.prototype.parentElement = function parentElement(){return this.bounds.parentElement();};Fragment.prototype.firstNode = function firstNode(){return this.bounds.firstNode();};Fragment.prototype.lastNode = function lastNode(){return this.bounds.lastNode();};Fragment.prototype.update = function update(bounds){this.bounds = bounds;};return Fragment;})();var ElementStack=(function(){function ElementStack(env,parentNode,nextSibling){this.constructing = null;this.operations = null;this.elementStack = new _glimmerUtil.Stack();this.nextSiblingStack = new _glimmerUtil.Stack();this.blockStack = new _glimmerUtil.Stack();this.env = env;this.dom = env.getAppendOperations();this.updateOperations = env.getDOM();this.element = parentNode;this.nextSibling = nextSibling;this.defaultOperations = new SimpleElementOperations(env);this.elementStack.push(this.element);this.nextSiblingStack.push(this.nextSibling);}ElementStack.forInitialRender = function forInitialRender(env,parentNode,nextSibling){return new ElementStack(env,parentNode,nextSibling);};ElementStack.resume = function resume(env,tracker,nextSibling){var parentNode=tracker.parentElement();var stack=new ElementStack(env,parentNode,nextSibling);stack.pushBlockTracker(tracker);return stack;};ElementStack.prototype.expectConstructing = function expectConstructing(method){return _glimmerUtil.expect(this.constructing,method + ' should only be called while constructing an element');};ElementStack.prototype.expectOperations = function expectOperations(method){return _glimmerUtil.expect(this.operations,method + ' should only be called while constructing an element');};ElementStack.prototype.block = function block(){return _glimmerUtil.expect(this.blockStack.current,"Expected a current block tracker");};ElementStack.prototype.popElement = function popElement(){var elementStack=this.elementStack;var nextSiblingStack=this.nextSiblingStack;var topElement=elementStack.pop();nextSiblingStack.pop();_glimmerUtil.LOGGER.debug('-> element stack ' + this.elementStack.toArray().map(function(e){return e.tagName;}).join(', '));this.element = _glimmerUtil.expect(elementStack.current,"can't pop past the last element");this.nextSibling = nextSiblingStack.current;return topElement;};ElementStack.prototype.pushSimpleBlock = function pushSimpleBlock(){var tracker=new SimpleBlockTracker(this.element);this.pushBlockTracker(tracker);return tracker;};ElementStack.prototype.pushUpdatableBlock = function pushUpdatableBlock(){var tracker=new UpdatableBlockTracker(this.element);this.pushBlockTracker(tracker);return tracker;};ElementStack.prototype.pushBlockTracker = function pushBlockTracker(tracker){var isRemote=arguments.length <= 1 || arguments[1] === undefined?false:arguments[1];var current=this.blockStack.current;if(current !== null){current.newDestroyable(tracker);if(!isRemote){current.newBounds(tracker);}}this.blockStack.push(tracker);return tracker;};ElementStack.prototype.pushBlockList = function pushBlockList(list){var tracker=new BlockListTracker(this.element,list);var current=this.blockStack.current;if(current !== null){current.newDestroyable(tracker);current.newBounds(tracker);}this.blockStack.push(tracker);return tracker;};ElementStack.prototype.popBlock = function popBlock(){this.block().finalize(this);return _glimmerUtil.expect(this.blockStack.pop(),"Expected popBlock to return a block");};ElementStack.prototype.openElement = function openElement(tag){var operations=arguments.length <= 1 || arguments[1] === undefined?this.defaultOperations:arguments[1];var element=this.dom.createElement(tag,this.element);this.constructing = element;this.operations = operations;return element;};ElementStack.prototype.flushElement = function flushElement(){var parent=this.element;var element=_glimmerUtil.expect(this.constructing,'flushElement should only be called when constructing an element');this.dom.insertBefore(parent,element,this.nextSibling);this.constructing = null;this.operations = null;this.pushElement(element);this.block().openElement(element);};ElementStack.prototype.pushRemoteElement = function pushRemoteElement(element){this.pushElement(element);var tracker=new RemoteBlockTracker(element);this.pushBlockTracker(tracker,true);};ElementStack.prototype.popRemoteElement = function popRemoteElement(){this.popBlock();this.popElement();};ElementStack.prototype.pushElement = function pushElement(element){this.element = element;this.elementStack.push(element);_glimmerUtil.LOGGER.debug('-> element stack ' + this.elementStack.toArray().map(function(e){return e.tagName;}).join(', '));this.nextSibling = null;this.nextSiblingStack.push(null);};ElementStack.prototype.newDestroyable = function newDestroyable(d){this.block().newDestroyable(d);};ElementStack.prototype.newBounds = function newBounds(bounds){this.block().newBounds(bounds);};ElementStack.prototype.appendText = function appendText(string){var dom=this.dom;var text=dom.createTextNode(string);dom.insertBefore(this.element,text,this.nextSibling);this.block().newNode(text);return text;};ElementStack.prototype.appendComment = function appendComment(string){var dom=this.dom;var comment=dom.createComment(string);dom.insertBefore(this.element,comment,this.nextSibling);this.block().newNode(comment);return comment;};ElementStack.prototype.setStaticAttribute = function setStaticAttribute(name,value){this.expectOperations('setStaticAttribute').addStaticAttribute(this.expectConstructing('setStaticAttribute'),name,value);};ElementStack.prototype.setStaticAttributeNS = function setStaticAttributeNS(namespace,name,value){this.expectOperations('setStaticAttributeNS').addStaticAttributeNS(this.expectConstructing('setStaticAttributeNS'),namespace,name,value);};ElementStack.prototype.setDynamicAttribute = function setDynamicAttribute(name,reference,isTrusting){this.expectOperations('setDynamicAttribute').addDynamicAttribute(this.expectConstructing('setDynamicAttribute'),name,reference,isTrusting);};ElementStack.prototype.setDynamicAttributeNS = function setDynamicAttributeNS(namespace,name,reference,isTrusting){this.expectOperations('setDynamicAttributeNS').addDynamicAttributeNS(this.expectConstructing('setDynamicAttributeNS'),namespace,name,reference,isTrusting);};ElementStack.prototype.closeElement = function closeElement(){this.block().closeElement();this.popElement();};return ElementStack;})();var SimpleBlockTracker=(function(){function SimpleBlockTracker(parent){this.parent = parent;this.first = null;this.last = null;this.destroyables = null;this.nesting = 0;}SimpleBlockTracker.prototype.destroy = function destroy(){var destroyables=this.destroyables;if(destroyables && destroyables.length){for(var i=0;i < destroyables.length;i++) {destroyables[i].destroy();}}};SimpleBlockTracker.prototype.parentElement = function parentElement(){return this.parent;};SimpleBlockTracker.prototype.firstNode = function firstNode(){return this.first && this.first.firstNode();};SimpleBlockTracker.prototype.lastNode = function lastNode(){return this.last && this.last.lastNode();};SimpleBlockTracker.prototype.openElement = function openElement(element){this.newNode(element);this.nesting++;};SimpleBlockTracker.prototype.closeElement = function closeElement(){this.nesting--;};SimpleBlockTracker.prototype.newNode = function newNode(node){if(this.nesting !== 0)return;if(!this.first){this.first = new First(node);}this.last = new Last(node);};SimpleBlockTracker.prototype.newBounds = function newBounds(bounds){if(this.nesting !== 0)return;if(!this.first){this.first = bounds;}this.last = bounds;};SimpleBlockTracker.prototype.newDestroyable = function newDestroyable(d){this.destroyables = this.destroyables || [];this.destroyables.push(d);};SimpleBlockTracker.prototype.finalize = function finalize(stack){if(!this.first){stack.appendComment('');}};return SimpleBlockTracker;})();var RemoteBlockTracker=(function(_SimpleBlockTracker){babelHelpers.inherits(RemoteBlockTracker,_SimpleBlockTracker);function RemoteBlockTracker(){_SimpleBlockTracker.apply(this,arguments);}RemoteBlockTracker.prototype.destroy = function destroy(){_SimpleBlockTracker.prototype.destroy.call(this);clear(this);};return RemoteBlockTracker;})(SimpleBlockTracker);var UpdatableBlockTracker=(function(_SimpleBlockTracker2){babelHelpers.inherits(UpdatableBlockTracker,_SimpleBlockTracker2);function UpdatableBlockTracker(){_SimpleBlockTracker2.apply(this,arguments);}UpdatableBlockTracker.prototype.reset = function reset(env){var destroyables=this.destroyables;if(destroyables && destroyables.length){for(var i=0;i < destroyables.length;i++) {env.didDestroy(destroyables[i]);}}var nextSibling=clear(this);this.destroyables = null;this.first = null;this.last = null;return nextSibling;};return UpdatableBlockTracker;})(SimpleBlockTracker);var BlockListTracker=(function(){function BlockListTracker(parent,boundList){this.parent = parent;this.boundList = boundList;this.parent = parent;this.boundList = boundList;}BlockListTracker.prototype.destroy = function destroy(){this.boundList.forEachNode(function(node){return node.destroy();});};BlockListTracker.prototype.parentElement = function parentElement(){return this.parent;};BlockListTracker.prototype.firstNode = function firstNode(){var head=this.boundList.head();return head && head.firstNode();};BlockListTracker.prototype.lastNode = function lastNode(){var tail=this.boundList.tail();return tail && tail.lastNode();};BlockListTracker.prototype.openElement = function openElement(_element){_glimmerUtil.assert(false,'Cannot openElement directly inside a block list');};BlockListTracker.prototype.closeElement = function closeElement(){_glimmerUtil.assert(false,'Cannot closeElement directly inside a block list');};BlockListTracker.prototype.newNode = function newNode(_node){_glimmerUtil.assert(false,'Cannot create a new node directly inside a block list');};BlockListTracker.prototype.newBounds = function newBounds(_bounds){};BlockListTracker.prototype.newDestroyable = function newDestroyable(_d){};BlockListTracker.prototype.finalize = function finalize(_stack){};return BlockListTracker;})();var CompiledValue=(function(_CompiledExpression){babelHelpers.inherits(CompiledValue,_CompiledExpression);function CompiledValue(value){_CompiledExpression.call(this);this.type = "value";this.reference = PrimitiveReference.create(value);}CompiledValue.prototype.evaluate = function evaluate(_vm){return this.reference;};CompiledValue.prototype.toJSON = function toJSON(){return JSON.stringify(this.reference.value());};return CompiledValue;})(CompiledExpression);var CompiledHasBlock=(function(_CompiledExpression2){babelHelpers.inherits(CompiledHasBlock,_CompiledExpression2);function CompiledHasBlock(inner){_CompiledExpression2.call(this);this.inner = inner;this.type = "has-block";}CompiledHasBlock.prototype.evaluate = function evaluate(vm){var block=this.inner.evaluate(vm);return PrimitiveReference.create(!!block);};CompiledHasBlock.prototype.toJSON = function toJSON(){return 'has-block(' + this.inner.toJSON() + ')';};return CompiledHasBlock;})(CompiledExpression);var CompiledHasBlockParams=(function(_CompiledExpression3){babelHelpers.inherits(CompiledHasBlockParams,_CompiledExpression3);function CompiledHasBlockParams(inner){_CompiledExpression3.call(this);this.inner = inner;this.type = "has-block-params";}CompiledHasBlockParams.prototype.evaluate = function evaluate(vm){var block=this.inner.evaluate(vm);var hasLocals=block && block.symbolTable.getSymbols().locals;return PrimitiveReference.create(!!hasLocals);};CompiledHasBlockParams.prototype.toJSON = function toJSON(){return 'has-block-params(' + this.inner.toJSON() + ')';};return CompiledHasBlockParams;})(CompiledExpression);var CompiledGetBlockBySymbol=(function(){function CompiledGetBlockBySymbol(symbol,debug){this.symbol = symbol;this.debug = debug;}CompiledGetBlockBySymbol.prototype.evaluate = function evaluate(vm){return vm.scope().getBlock(this.symbol);};CompiledGetBlockBySymbol.prototype.toJSON = function toJSON(){return 'get-block($' + this.symbol + '(' + this.debug + '))';};return CompiledGetBlockBySymbol;})();var CompiledInPartialGetBlock=(function(){function CompiledInPartialGetBlock(symbol,name){this.symbol = symbol;this.name = name;}CompiledInPartialGetBlock.prototype.evaluate = function evaluate(vm){var symbol=this.symbol;var name=this.name;var args=vm.scope().getPartialArgs(symbol);return args.blocks[name];};CompiledInPartialGetBlock.prototype.toJSON = function toJSON(){return 'get-block($' + this.symbol + '($ARGS).' + this.name + '))';};return CompiledInPartialGetBlock;})();var CompiledLookup=(function(_CompiledExpression4){babelHelpers.inherits(CompiledLookup,_CompiledExpression4);function CompiledLookup(base,path){_CompiledExpression4.call(this);this.base = base;this.path = path;this.type = "lookup";}CompiledLookup.create = function create(base,path){if(path.length === 0){return base;}else {return new this(base,path);}};CompiledLookup.prototype.evaluate = function evaluate(vm){var base=this.base;var path=this.path;return _glimmerReference.referenceFromParts(base.evaluate(vm),path);};CompiledLookup.prototype.toJSON = function toJSON(){return this.base.toJSON() + '.' + this.path.join('.');};return CompiledLookup;})(CompiledExpression);var CompiledSelf=(function(_CompiledExpression5){babelHelpers.inherits(CompiledSelf,_CompiledExpression5);function CompiledSelf(){_CompiledExpression5.apply(this,arguments);}CompiledSelf.prototype.evaluate = function evaluate(vm){return vm.getSelf();};CompiledSelf.prototype.toJSON = function toJSON(){return 'self';};return CompiledSelf;})(CompiledExpression);var CompiledSymbol=(function(_CompiledExpression6){babelHelpers.inherits(CompiledSymbol,_CompiledExpression6);function CompiledSymbol(symbol,debug){_CompiledExpression6.call(this);this.symbol = symbol;this.debug = debug;}CompiledSymbol.prototype.evaluate = function evaluate(vm){return vm.referenceForSymbol(this.symbol);};CompiledSymbol.prototype.toJSON = function toJSON(){return '$' + this.symbol + '(' + this.debug + ')';};return CompiledSymbol;})(CompiledExpression);var CompiledInPartialName=(function(_CompiledExpression7){babelHelpers.inherits(CompiledInPartialName,_CompiledExpression7);function CompiledInPartialName(symbol,name){_CompiledExpression7.call(this);this.symbol = symbol;this.name = name;}CompiledInPartialName.prototype.evaluate = function evaluate(vm){var symbol=this.symbol;var name=this.name;var args=vm.scope().getPartialArgs(symbol);return args.named.get(name);};CompiledInPartialName.prototype.toJSON = function toJSON(){return '$' + this.symbol + '($ARGS).' + this.name;};return CompiledInPartialName;})(CompiledExpression);var CompiledHelper=(function(_CompiledExpression8){babelHelpers.inherits(CompiledHelper,_CompiledExpression8);function CompiledHelper(name,helper,args,symbolTable){_CompiledExpression8.call(this);this.name = name;this.helper = helper;this.args = args;this.symbolTable = symbolTable;this.type = "helper";}CompiledHelper.prototype.evaluate = function evaluate(vm){var helper=this.helper;return helper(vm,this.args.evaluate(vm),this.symbolTable);};CompiledHelper.prototype.toJSON = function toJSON(){return '`' + this.name.join('.') + '($ARGS)`';};return CompiledHelper;})(CompiledExpression);var CompiledConcat=(function(){function CompiledConcat(parts){this.parts = parts;this.type = "concat";}CompiledConcat.prototype.evaluate = function evaluate(vm){var parts=new Array(this.parts.length);for(var i=0;i < this.parts.length;i++) {parts[i] = this.parts[i].evaluate(vm);}return new ConcatReference(parts);};CompiledConcat.prototype.toJSON = function toJSON(){return 'concat(' + this.parts.map(function(expr){return expr.toJSON();}).join(", ") + ')';};return CompiledConcat;})();var ConcatReference=(function(_CachedReference2){babelHelpers.inherits(ConcatReference,_CachedReference2);function ConcatReference(parts){_CachedReference2.call(this);this.parts = parts;this.tag = _glimmerReference.combineTagged(parts);}ConcatReference.prototype.compute = function compute(){var parts=new Array();for(var i=0;i < this.parts.length;i++) {var value=this.parts[i].value();if(value !== null && value !== undefined){parts[i] = castToString(value);}}if(parts.length > 0){return parts.join('');}return null;};return ConcatReference;})(_glimmerReference.CachedReference);function castToString(value){if(typeof value['toString'] !== 'function'){return '';}return String(value);}var CompiledFunctionExpression=(function(_CompiledExpression9){babelHelpers.inherits(CompiledFunctionExpression,_CompiledExpression9);function CompiledFunctionExpression(func,symbolTable){_CompiledExpression9.call(this);this.func = func;this.symbolTable = symbolTable;this.type = "function";this.func = func;}CompiledFunctionExpression.prototype.evaluate = function evaluate(vm){var func=this.func;var symbolTable=this.symbolTable;return func(vm,symbolTable);};CompiledFunctionExpression.prototype.toJSON = function toJSON(){var func=this.func;if(func.name){return '`' + func.name + '(...)`';}else {return "`func(...)`";}};return CompiledFunctionExpression;})(CompiledExpression);function debugCallback(context,get){console.info('Use `context`, and `get()` to debug this template.'); /* tslint:disable */debugger; /* tslint:enable */return {context:context,get:get};}function getter(vm,builder){return function(path){var parts=path.split('.');if(parts[0] === 'this'){parts[0] = null;}return compileRef(parts,builder).evaluate(vm);};}var callback=debugCallback; // For testing purposes +function setDebuggerCallback(cb){callback = cb;}function resetDebuggerCallback(){callback = debugCallback;}var Compilers=(function(){function Compilers(){this.names = _glimmerUtil.dict();this.funcs = [];}Compilers.prototype.add = function add(name,func){this.funcs.push(func);this.names[name] = this.funcs.length - 1;};Compilers.prototype.compile = function compile(sexp,builder){var name=sexp[0];var index=this.names[name];var func=this.funcs[index];_glimmerUtil.assert(!!func,'expected an implementation for ' + sexp[0]);return func(sexp,builder);};return Compilers;})();var STATEMENTS=new Compilers();STATEMENTS.add('text',function(sexp,builder){builder.text(sexp[1]);});STATEMENTS.add('comment',function(sexp,builder){builder.comment(sexp[1]);});STATEMENTS.add('close-element',function(_sexp,builder){_glimmerUtil.LOGGER.trace('close-element statement');builder.closeElement();});STATEMENTS.add('flush-element',function(_sexp,builder){builder.flushElement();});STATEMENTS.add('modifier',function(sexp,builder){var path=sexp[1];var params=sexp[2];var hash=sexp[3];var args=compileArgs(params,hash,builder);if(builder.env.hasModifier(path,builder.symbolTable)){builder.modifier(path[0],args);}else {throw new Error('Compile Error ' + path.join('.') + ' is not a modifier: Helpers may not be used in the element form.');}});STATEMENTS.add('static-attr',function(sexp,builder){var name=sexp[1];var value=sexp[2];var namespace=sexp[3];builder.staticAttr(name,namespace,value);});STATEMENTS.add('any-dynamic-attr',function(sexp,builder){var name=sexp[1];var value=sexp[2];var namespace=sexp[3];var trusting=sexp[4];builder.putValue(value);if(namespace){builder.dynamicAttrNS(name,namespace,trusting);}else {builder.dynamicAttr(name,trusting);}});STATEMENTS.add('open-element',function(sexp,builder){_glimmerUtil.LOGGER.trace('open-element statement');builder.openPrimitiveElement(sexp[1]);});STATEMENTS.add('optimized-append',function(sexp,builder){var value=sexp[1];var trustingMorph=sexp[2];var _builder$env$macros=builder.env.macros();var inlines=_builder$env$macros.inlines;var returned=inlines.compile(sexp,builder) || value;if(returned === true)return;builder.putValue(returned[1]);if(trustingMorph){builder.trustingAppend();}else {builder.cautiousAppend();}});STATEMENTS.add('unoptimized-append',function(sexp,builder){var value=sexp[1];var trustingMorph=sexp[2];var _builder$env$macros2=builder.env.macros();var inlines=_builder$env$macros2.inlines;var returned=inlines.compile(sexp,builder) || value;if(returned === true)return;if(trustingMorph){builder.guardedTrustingAppend(returned[1]);}else {builder.guardedCautiousAppend(returned[1]);}});STATEMENTS.add('nested-block',function(sexp,builder){var _builder$env$macros3=builder.env.macros();var blocks=_builder$env$macros3.blocks;blocks.compile(sexp,builder);});STATEMENTS.add('scanned-block',function(sexp,builder){var path=sexp[1];var params=sexp[2];var hash=sexp[3];var template=sexp[4];var inverse=sexp[5];var templateBlock=template && template.scan();var inverseBlock=inverse && inverse.scan();var _builder$env$macros4=builder.env.macros();var blocks=_builder$env$macros4.blocks;blocks.compile(['nested-block',path,params,hash,templateBlock,inverseBlock],builder);});STATEMENTS.add('scanned-component',function(sexp,builder){var tag=sexp[1];var attrs=sexp[2];var rawArgs=sexp[3];var rawBlock=sexp[4];var block=rawBlock && rawBlock.scan();var args=compileBlockArgs(null,rawArgs,{default:block,inverse:null},builder);var definition=builder.env.getComponentDefinition([tag],builder.symbolTable);builder.putComponentDefinition(definition);builder.openComponent(args,attrs.scan());builder.closeComponent();});STATEMENTS.add('static-partial',function(sexp,builder){var name=sexp[1];if(!builder.env.hasPartial(name,builder.symbolTable)){throw new Error('Compile Error: Could not find a partial named "' + name + '"');}var definition=builder.env.lookupPartial(name,builder.symbolTable);builder.putPartialDefinition(definition);builder.evaluatePartial();});STATEMENTS.add('dynamic-partial',function(sexp,builder){var name=sexp[1];builder.startLabels();builder.putValue(name);builder.test('simple');builder.enter('BEGIN','END');builder.label('BEGIN');builder.jumpUnless('END');builder.putDynamicPartialDefinition();builder.evaluatePartial();builder.label('END');builder.exit();builder.stopLabels();});STATEMENTS.add('yield',function(sexp,builder){var to=sexp[1];var params=sexp[2];var args=compileArgs(params,null,builder);builder.yield(args,to);});STATEMENTS.add('debugger',function(sexp,builder){builder.putValue(['function',function(vm){var context=vm.getSelf().value();var get=function(path){return getter(vm,builder)(path).value();};callback(context,get);}]);return sexp;});var EXPRESSIONS=new Compilers();function expr(expression,builder){if(Array.isArray(expression)){return EXPRESSIONS.compile(expression,builder);}else {return new CompiledValue(expression);}}EXPRESSIONS.add('unknown',function(sexp,builder){var path=sexp[1];if(builder.env.hasHelper(path,builder.symbolTable)){return new CompiledHelper(path,builder.env.lookupHelper(path,builder.symbolTable),CompiledArgs.empty(),builder.symbolTable);}else {return compileRef(path,builder);}});EXPRESSIONS.add('concat',function(sexp,builder){var params=sexp[1].map(function(p){return expr(p,builder);});return new CompiledConcat(params);});EXPRESSIONS.add('function',function(sexp,builder){return new CompiledFunctionExpression(sexp[1],builder.symbolTable);});EXPRESSIONS.add('helper',function(sexp,builder){var env=builder.env;var symbolTable=builder.symbolTable;var path=sexp[1];var params=sexp[2];var hash=sexp[3];if(env.hasHelper(path,symbolTable)){var args=compileArgs(params,hash,builder);return new CompiledHelper(path,env.lookupHelper(path,symbolTable),args,symbolTable);}else {throw new Error('Compile Error: ' + path.join('.') + ' is not a helper');}});EXPRESSIONS.add('get',function(sexp,builder){return compileRef(sexp[1],builder);});EXPRESSIONS.add('undefined',function(_sexp,_builder){return new CompiledValue(undefined);});EXPRESSIONS.add('arg',function(sexp,builder){var parts=sexp[1];var head=parts[0];var named=undefined,partial=undefined;if(named = builder.symbolTable.getSymbol('named',head)){var path=parts.slice(1);var inner=new CompiledSymbol(named,head);return CompiledLookup.create(inner,path);}else if(partial = builder.symbolTable.getPartialArgs()){var path=parts.slice(1);var inner=new CompiledInPartialName(partial,head);return CompiledLookup.create(inner,path);}else {throw new Error('[BUG] @' + parts.join('.') + ' is not a valid lookup path.');}});EXPRESSIONS.add('has-block',function(sexp,builder){var blockName=sexp[1];var yields=undefined,partial=undefined;if(yields = builder.symbolTable.getSymbol('yields',blockName)){var inner=new CompiledGetBlockBySymbol(yields,blockName);return new CompiledHasBlock(inner);}else if(partial = builder.symbolTable.getPartialArgs()){var inner=new CompiledInPartialGetBlock(partial,blockName);return new CompiledHasBlock(inner);}else {throw new Error('[BUG] ${blockName} is not a valid block name.');}});EXPRESSIONS.add('has-block-params',function(sexp,builder){var blockName=sexp[1];var yields=undefined,partial=undefined;if(yields = builder.symbolTable.getSymbol('yields',blockName)){var inner=new CompiledGetBlockBySymbol(yields,blockName);return new CompiledHasBlockParams(inner);}else if(partial = builder.symbolTable.getPartialArgs()){var inner=new CompiledInPartialGetBlock(partial,blockName);return new CompiledHasBlockParams(inner);}else {throw new Error('[BUG] ${blockName} is not a valid block name.');}});function compileArgs(params,hash,builder){var compiledParams=compileParams(params,builder);var compiledHash=compileHash(hash,builder);return CompiledArgs.create(compiledParams,compiledHash,EMPTY_BLOCKS);}function compileBlockArgs(params,hash,blocks,builder){var compiledParams=compileParams(params,builder);var compiledHash=compileHash(hash,builder);return CompiledArgs.create(compiledParams,compiledHash,blocks);}function compileBaselineArgs(args,builder){var params=args[0];var hash=args[1];var _default=args[2];var inverse=args[3];return CompiledArgs.create(compileParams(params,builder),compileHash(hash,builder),{default:_default,inverse:inverse});}function compileParams(params,builder){if(!params || params.length === 0)return COMPILED_EMPTY_POSITIONAL_ARGS;var compiled=params.map(function(p){return expr(p,builder);});return CompiledPositionalArgs.create(compiled);}function compileHash(hash,builder){if(!hash)return COMPILED_EMPTY_NAMED_ARGS;var keys=hash[0];var values=hash[1];if(keys.length === 0)return COMPILED_EMPTY_NAMED_ARGS;var compiled=values.map(function(p){return expr(p,builder);});return new CompiledNamedArgs(keys,compiled);}function compileRef(parts,builder){var head=parts[0];var local=undefined;if(head === null){var inner=new CompiledSelf();var path=parts.slice(1);return CompiledLookup.create(inner,path);}else if(local = builder.symbolTable.getSymbol('local',head)){var path=parts.slice(1);var inner=new CompiledSymbol(local,head);return CompiledLookup.create(inner,path);}else {var inner=new CompiledSelf();return CompiledLookup.create(inner,parts);}}var Blocks=(function(){function Blocks(){this.names = _glimmerUtil.dict();this.funcs = [];}Blocks.prototype.add = function add(name,func){this.funcs.push(func);this.names[name] = this.funcs.length - 1;};Blocks.prototype.addMissing = function addMissing(func){this.missing = func;};Blocks.prototype.compile = function compile(sexp,builder){ // assert(sexp[1].length === 1, 'paths in blocks are not supported'); +var name=sexp[1][0];var index=this.names[name];if(index === undefined){_glimmerUtil.assert(!!this.missing,name + ' not found, and no catch-all block handler was registered');var func=this.missing;var handled=func(sexp,builder);_glimmerUtil.assert(!!handled,name + ' not found, and the catch-all block handler didn\'t handle it');}else {var func=this.funcs[index];func(sexp,builder);}};return Blocks;})();var BLOCKS=new Blocks();var Inlines=(function(){function Inlines(){this.names = _glimmerUtil.dict();this.funcs = [];}Inlines.prototype.add = function add(name,func){this.funcs.push(func);this.names[name] = this.funcs.length - 1;};Inlines.prototype.addMissing = function addMissing(func){this.missing = func;};Inlines.prototype.compile = function compile(sexp,builder){var value=sexp[1]; // TODO: Fix this so that expression macros can return +// things like components, so that {{component foo}} +// is the same as {{(component foo)}} +if(!Array.isArray(value))return ['expr',value];var path=undefined;var params=undefined;var hash=undefined;if(value[0] === 'helper'){path = value[1];params = value[2];hash = value[3];}else if(value[0] === 'unknown'){path = value[1];params = hash = null;}else {return ['expr',value];}if(path.length > 1 && !params && !hash){return ['expr',value];}var name=path[0];var index=this.names[name];if(index === undefined && this.missing){var func=this.missing;var returned=func(path,params,hash,builder);return returned === false?['expr',value]:returned;}else if(index !== undefined){var func=this.funcs[index];var returned=func(path,params,hash,builder);return returned === false?['expr',value]:returned;}else {return ['expr',value];}};return Inlines;})();var INLINES=new Inlines();populateBuiltins(BLOCKS,INLINES);function populateBuiltins(){var blocks=arguments.length <= 0 || arguments[0] === undefined?new Blocks():arguments[0];var inlines=arguments.length <= 1 || arguments[1] === undefined?new Inlines():arguments[1];blocks.add('if',function(sexp,builder){ // PutArgs +// Test(Environment) +// Enter(BEGIN, END) +// BEGIN: Noop +// JumpUnless(ELSE) +// Evaluate(default) +// Jump(END) +// ELSE: Noop +// Evalulate(inverse) +// END: Noop +// Exit +var params=sexp[2];var hash=sexp[3];var _default=sexp[4];var inverse=sexp[5];var args=compileArgs(params,hash,builder);builder.putArgs(args);builder.test('environment');builder.labelled(null,function(b){if(_default && inverse){b.jumpUnless('ELSE');b.evaluate(_default);b.jump('END');b.label('ELSE');b.evaluate(inverse);}else if(_default){b.jumpUnless('END');b.evaluate(_default);}else {throw _glimmerUtil.unreachable();}});});blocks.add('unless',function(sexp,builder){ // PutArgs +// Test(Environment) +// Enter(BEGIN, END) +// BEGIN: Noop +// JumpUnless(ELSE) +// Evaluate(default) +// Jump(END) +// ELSE: Noop +// Evalulate(inverse) +// END: Noop +// Exit +var params=sexp[2];var hash=sexp[3];var _default=sexp[4];var inverse=sexp[5];var args=compileArgs(params,hash,builder);builder.putArgs(args);builder.test('environment');builder.labelled(null,function(b){if(_default && inverse){b.jumpIf('ELSE');b.evaluate(_default);b.jump('END');b.label('ELSE');b.evaluate(inverse);}else if(_default){b.jumpIf('END');b.evaluate(_default);}else {throw _glimmerUtil.unreachable();}});});blocks.add('with',function(sexp,builder){ // PutArgs +// Test(Environment) +// Enter(BEGIN, END) +// BEGIN: Noop +// JumpUnless(ELSE) +// Evaluate(default) +// Jump(END) +// ELSE: Noop +// Evalulate(inverse) +// END: Noop +// Exit +var params=sexp[2];var hash=sexp[3];var _default=sexp[4];var inverse=sexp[5];var args=compileArgs(params,hash,builder);builder.putArgs(args);builder.test('environment');builder.labelled(null,function(b){if(_default && inverse){b.jumpUnless('ELSE');b.evaluate(_default);b.jump('END');b.label('ELSE');b.evaluate(inverse);}else if(_default){b.jumpUnless('END');b.evaluate(_default);}else {throw _glimmerUtil.unreachable();}});});blocks.add('each',function(sexp,builder){ // Enter(BEGIN, END) +// BEGIN: Noop +// PutArgs +// PutIterable +// JumpUnless(ELSE) +// EnterList(BEGIN2, END2) +// ITER: Noop +// NextIter(BREAK) +// EnterWithKey(BEGIN2, END2) +// BEGIN2: Noop +// PushChildScope +// Evaluate(default) +// PopScope +// END2: Noop +// Exit +// Jump(ITER) +// BREAK: Noop +// ExitList +// Jump(END) +// ELSE: Noop +// Evalulate(inverse) +// END: Noop +// Exit +var params=sexp[2];var hash=sexp[3];var _default=sexp[4];var inverse=sexp[5];var args=compileArgs(params,hash,builder);builder.labelled(args,function(b){b.putIterator();if(inverse){b.jumpUnless('ELSE');}else {b.jumpUnless('END');}b.iter(function(b){b.evaluate(_glimmerUtil.unwrap(_default));});if(inverse){b.jump('END');b.label('ELSE');b.evaluate(inverse);}});});return {blocks:blocks,inlines:inlines};}var badProtocols=['javascript:','vbscript:'];var badTags=['A','BODY','LINK','IMG','IFRAME','BASE','FORM'];var badTagsForDataURI=['EMBED'];var badAttributes=['href','src','background','action'];var badAttributesForDataURI=['src'];function has(array,item){return array.indexOf(item) !== -1;}function checkURI(tagName,attribute){return (tagName === null || has(badTags,tagName)) && has(badAttributes,attribute);}function checkDataURI(tagName,attribute){if(tagName === null)return false;return has(badTagsForDataURI,tagName) && has(badAttributesForDataURI,attribute);}function requiresSanitization(tagName,attribute){return checkURI(tagName,attribute) || checkDataURI(tagName,attribute);}function sanitizeAttributeValue(env,element,attribute,value){var tagName=null;if(value === null || value === undefined){return value;}if(isSafeString(value)){return value.toHTML();}if(!element){tagName = null;}else {tagName = element.tagName.toUpperCase();}var str=normalizeTextValue(value);if(checkURI(tagName,attribute)){var protocol=env.protocolForURL(str);if(has(badProtocols,protocol)){return 'unsafe:' + str;}}if(checkDataURI(tagName,attribute)){return 'unsafe:' + str;}return str;} /* + * @method normalizeProperty + * @param element {HTMLElement} + * @param slotName {String} + * @returns {Object} { name, type } + */function normalizeProperty(element,slotName){var type=undefined,normalized=undefined;if(slotName in element){normalized = slotName;type = 'prop';}else {var lower=slotName.toLowerCase();if(lower in element){type = 'prop';normalized = lower;}else {type = 'attr';normalized = slotName;}}if(type === 'prop' && (normalized.toLowerCase() === 'style' || preferAttr(element.tagName,normalized))){type = 'attr';}return {normalized:normalized,type:type};} // properties that MUST be set as attributes, due to: +// * browser bug +// * strange spec outlier +var ATTR_OVERRIDES={ // phantomjs < 2.0 lets you set it as a prop but won't reflect it +// back to the attribute. button.getAttribute('type') === null +BUTTON:{type:true,form:true},INPUT:{ // Some version of IE (like IE9) actually throw an exception +// if you set input.type = 'something-unknown' +type:true,form:true, // Chrome 46.0.2464.0: 'autocorrect' in document.createElement('input') === false +// Safari 8.0.7: 'autocorrect' in document.createElement('input') === false +// Mobile Safari (iOS 8.4 simulator): 'autocorrect' in document.createElement('input') === true +autocorrect:true, // Chrome 54.0.2840.98: 'list' in document.createElement('input') === true +// Safari 9.1.3: 'list' in document.createElement('input') === false +list:true}, // element.form is actually a legitimate readOnly property, that is to be +// mutated, but must be mutated by setAttribute... +SELECT:{form:true},OPTION:{form:true},TEXTAREA:{form:true},LABEL:{form:true},FIELDSET:{form:true},LEGEND:{form:true},OBJECT:{form:true}};function preferAttr(tagName,propName){var tag=ATTR_OVERRIDES[tagName.toUpperCase()];return tag && tag[propName.toLowerCase()] || false;}var innerHTMLWrapper={colgroup:{depth:2,before:'',after:'
    '},table:{depth:1,before:'',after:'
    '},tbody:{depth:2,before:'',after:'
    '},tfoot:{depth:2,before:'',after:'
    '},thead:{depth:2,before:'',after:'
    '},tr:{depth:3,before:'',after:'
    '}}; // Patch: innerHTML Fix +// Browsers: IE9 +// Reason: IE9 don't allow us to set innerHTML on col, colgroup, frameset, +// html, style, table, tbody, tfoot, thead, title, tr. +// Fix: Wrap the innerHTML we are about to set in its parents, apply the +// wrapped innerHTML on a div, then move the unwrapped nodes into the +// target position. +function domChanges(document,DOMChangesClass){if(!document)return DOMChangesClass;if(!shouldApplyFix(document)){return DOMChangesClass;}var div=document.createElement('div');return (function(_DOMChangesClass){babelHelpers.inherits(DOMChangesWithInnerHTMLFix,_DOMChangesClass);function DOMChangesWithInnerHTMLFix(){_DOMChangesClass.apply(this,arguments);}DOMChangesWithInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent,nextSibling,html){if(html === null || html === ''){return _DOMChangesClass.prototype.insertHTMLBefore.call(this,parent,nextSibling,html);}var parentTag=parent.tagName.toLowerCase();var wrapper=innerHTMLWrapper[parentTag];if(wrapper === undefined){return _DOMChangesClass.prototype.insertHTMLBefore.call(this,parent,nextSibling,html);}return fixInnerHTML(parent,wrapper,div,html,nextSibling);};return DOMChangesWithInnerHTMLFix;})(DOMChangesClass);}function treeConstruction(document,DOMTreeConstructionClass){if(!document)return DOMTreeConstructionClass;if(!shouldApplyFix(document)){return DOMTreeConstructionClass;}var div=document.createElement('div');return (function(_DOMTreeConstructionClass){babelHelpers.inherits(DOMTreeConstructionWithInnerHTMLFix,_DOMTreeConstructionClass);function DOMTreeConstructionWithInnerHTMLFix(){_DOMTreeConstructionClass.apply(this,arguments);}DOMTreeConstructionWithInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent,html,reference){if(html === null || html === ''){return _DOMTreeConstructionClass.prototype.insertHTMLBefore.call(this,parent,html,reference);}var parentTag=parent.tagName.toLowerCase();var wrapper=innerHTMLWrapper[parentTag];if(wrapper === undefined){return _DOMTreeConstructionClass.prototype.insertHTMLBefore.call(this,parent,html,reference);}return fixInnerHTML(parent,wrapper,div,html,reference);};return DOMTreeConstructionWithInnerHTMLFix;})(DOMTreeConstructionClass);}function fixInnerHTML(parent,wrapper,div,html,reference){var wrappedHtml=wrapper.before + html + wrapper.after;div.innerHTML = wrappedHtml;var parentNode=div;for(var i=0;i < wrapper.depth;i++) {parentNode = parentNode.childNodes[0];}var _moveNodesBefore=moveNodesBefore(parentNode,parent,reference);var first=_moveNodesBefore[0];var last=_moveNodesBefore[1];return new ConcreteBounds(parent,first,last);}function shouldApplyFix(document){var table=document.createElement('table');try{table.innerHTML = '';}catch(e) {}finally {if(table.childNodes.length !== 0){ // It worked as expected, no fix required +return false;}}return true;}var SVG_NAMESPACE$1='http://www.w3.org/2000/svg'; // Patch: insertAdjacentHTML on SVG Fix +// Browsers: Safari, IE, Edge, Firefox ~33-34 +// Reason: insertAdjacentHTML does not exist on SVG elements in Safari. It is +// present but throws an exception on IE and Edge. Old versions of +// Firefox create nodes in the incorrect namespace. +// Fix: Since IE and Edge silently fail to create SVG nodes using +// innerHTML, and because Firefox may create nodes in the incorrect +// namespace using innerHTML on SVG elements, an HTML-string wrapping +// approach is used. A pre/post SVG tag is added to the string, then +// that whole string is added to a div. The created nodes are plucked +// out and applied to the target location on DOM. +function domChanges$1(document,DOMChangesClass,svgNamespace){if(!document)return DOMChangesClass;if(!shouldApplyFix$1(document,svgNamespace)){return DOMChangesClass;}var div=document.createElement('div');return (function(_DOMChangesClass2){babelHelpers.inherits(DOMChangesWithSVGInnerHTMLFix,_DOMChangesClass2);function DOMChangesWithSVGInnerHTMLFix(){_DOMChangesClass2.apply(this,arguments);}DOMChangesWithSVGInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent,nextSibling,html){if(html === null || html === ''){return _DOMChangesClass2.prototype.insertHTMLBefore.call(this,parent,nextSibling,html);}if(parent.namespaceURI !== svgNamespace){return _DOMChangesClass2.prototype.insertHTMLBefore.call(this,parent,nextSibling,html);}return fixSVG(parent,div,html,nextSibling);};return DOMChangesWithSVGInnerHTMLFix;})(DOMChangesClass);}function treeConstruction$1(document,TreeConstructionClass,svgNamespace){if(!document)return TreeConstructionClass;if(!shouldApplyFix$1(document,svgNamespace)){return TreeConstructionClass;}var div=document.createElement('div');return (function(_TreeConstructionClass){babelHelpers.inherits(TreeConstructionWithSVGInnerHTMLFix,_TreeConstructionClass);function TreeConstructionWithSVGInnerHTMLFix(){_TreeConstructionClass.apply(this,arguments);}TreeConstructionWithSVGInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent,html,reference){if(html === null || html === ''){return _TreeConstructionClass.prototype.insertHTMLBefore.call(this,parent,html,reference);}if(parent.namespaceURI !== svgNamespace){return _TreeConstructionClass.prototype.insertHTMLBefore.call(this,parent,html,reference);}return fixSVG(parent,div,html,reference);};return TreeConstructionWithSVGInnerHTMLFix;})(TreeConstructionClass);}function fixSVG(parent,div,html,reference){ // IE, Edge: also do not correctly support using `innerHTML` on SVG +// namespaced elements. So here a wrapper is used. +var wrappedHtml='' + html + '';div.innerHTML = wrappedHtml;var _moveNodesBefore2=moveNodesBefore(div.firstChild,parent,reference);var first=_moveNodesBefore2[0];var last=_moveNodesBefore2[1];return new ConcreteBounds(parent,first,last);}function shouldApplyFix$1(document,svgNamespace){var svg=document.createElementNS(svgNamespace,'svg');try{svg['insertAdjacentHTML']('beforeEnd','');}catch(e) {}finally { // FF: Old versions will create a node in the wrong namespace +if(svg.childNodes.length === 1 && _glimmerUtil.unwrap(svg.firstChild).namespaceURI === SVG_NAMESPACE$1){ // The test worked as expected, no fix required +return false;}return true;}} // Patch: Adjacent text node merging fix +// Browsers: IE, Edge, Firefox w/o inspector open +// Reason: These browsers will merge adjacent text nodes. For exmaple given +//
    Hello
    with div.insertAdjacentHTML(' world') browsers +// with proper behavior will populate div.childNodes with two items. +// These browsers will populate it with one merged node instead. +// Fix: Add these nodes to a wrapper element, then iterate the childNodes +// of that wrapper and move the nodes to their target location. Note +// that potential SVG bugs will have been handled before this fix. +// Note that this fix must only apply to the previous text node, as +// the base implementation of `insertHTMLBefore` already handles +// following text nodes correctly. +function domChanges$2(document,DOMChangesClass){if(!document)return DOMChangesClass;if(!shouldApplyFix$2(document)){return DOMChangesClass;}return (function(_DOMChangesClass3){babelHelpers.inherits(DOMChangesWithTextNodeMergingFix,_DOMChangesClass3);function DOMChangesWithTextNodeMergingFix(document){_DOMChangesClass3.call(this,document);this.uselessComment = document.createComment('');}DOMChangesWithTextNodeMergingFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent,nextSibling,html){if(html === null){return _DOMChangesClass3.prototype.insertHTMLBefore.call(this,parent,nextSibling,html);}var didSetUselessComment=false;var nextPrevious=nextSibling?nextSibling.previousSibling:parent.lastChild;if(nextPrevious && nextPrevious instanceof Text){didSetUselessComment = true;parent.insertBefore(this.uselessComment,nextSibling);}var bounds=_DOMChangesClass3.prototype.insertHTMLBefore.call(this,parent,nextSibling,html);if(didSetUselessComment){parent.removeChild(this.uselessComment);}return bounds;};return DOMChangesWithTextNodeMergingFix;})(DOMChangesClass);}function treeConstruction$2(document,TreeConstructionClass){if(!document)return TreeConstructionClass;if(!shouldApplyFix$2(document)){return TreeConstructionClass;}return (function(_TreeConstructionClass2){babelHelpers.inherits(TreeConstructionWithTextNodeMergingFix,_TreeConstructionClass2);function TreeConstructionWithTextNodeMergingFix(document){_TreeConstructionClass2.call(this,document);this.uselessComment = this.createComment('');}TreeConstructionWithTextNodeMergingFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent,html,reference){if(html === null){return _TreeConstructionClass2.prototype.insertHTMLBefore.call(this,parent,html,reference);}var didSetUselessComment=false;var nextPrevious=reference?reference.previousSibling:parent.lastChild;if(nextPrevious && nextPrevious instanceof Text){didSetUselessComment = true;parent.insertBefore(this.uselessComment,reference);}var bounds=_TreeConstructionClass2.prototype.insertHTMLBefore.call(this,parent,html,reference);if(didSetUselessComment){parent.removeChild(this.uselessComment);}return bounds;};return TreeConstructionWithTextNodeMergingFix;})(TreeConstructionClass);}function shouldApplyFix$2(document){var mergingTextDiv=document.createElement('div');mergingTextDiv.innerHTML = 'first';mergingTextDiv.insertAdjacentHTML('beforeEnd','second');if(mergingTextDiv.childNodes.length === 2){ // It worked as expected, no fix required +return false;}return true;}var SVG_NAMESPACE='http://www.w3.org/2000/svg'; // http://www.w3.org/TR/html/syntax.html#html-integration-point +var SVG_INTEGRATION_POINTS={foreignObject:1,desc:1,title:1}; // http://www.w3.org/TR/html/syntax.html#adjust-svg-attributes +// TODO: Adjust SVG attributes +// http://www.w3.org/TR/html/syntax.html#parsing-main-inforeign +// TODO: Adjust SVG elements +// http://www.w3.org/TR/html/syntax.html#parsing-main-inforeign +var BLACKLIST_TABLE=Object.create(null);["b","big","blockquote","body","br","center","code","dd","div","dl","dt","em","embed","h1","h2","h3","h4","h5","h6","head","hr","i","img","li","listing","main","meta","nobr","ol","p","pre","ruby","s","small","span","strong","strike","sub","sup","table","tt","u","ul","var"].forEach(function(tag){return BLACKLIST_TABLE[tag] = 1;});var WHITESPACE=/[\t-\r \xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/;var doc=typeof document === 'undefined'?null:document;function isWhitespace(string){return WHITESPACE.test(string);}function moveNodesBefore(source,target,nextSibling){var first=source.firstChild;var last=null;var current=first;while(current) {last = current;current = current.nextSibling;target.insertBefore(last,nextSibling);}return [first,last];}var DOM;(function(DOM){var TreeConstruction=(function(){function TreeConstruction(document){this.document = document;this.setupUselessElement();}TreeConstruction.prototype.setupUselessElement = function setupUselessElement(){this.uselessElement = this.document.createElement('div');};TreeConstruction.prototype.createElement = function createElement(tag,context){var isElementInSVGNamespace=undefined,isHTMLIntegrationPoint=undefined;if(context){isElementInSVGNamespace = context.namespaceURI === SVG_NAMESPACE || tag === 'svg';isHTMLIntegrationPoint = SVG_INTEGRATION_POINTS[context.tagName];}else {isElementInSVGNamespace = tag === 'svg';isHTMLIntegrationPoint = false;}if(isElementInSVGNamespace && !isHTMLIntegrationPoint){ // FIXME: This does not properly handle with color, face, or +// size attributes, which is also disallowed by the spec. We should fix +// this. +if(BLACKLIST_TABLE[tag]){throw new Error('Cannot create a ' + tag + ' inside an SVG context');}return this.document.createElementNS(SVG_NAMESPACE,tag);}else {return this.document.createElement(tag);}};TreeConstruction.prototype.createElementNS = function createElementNS(namespace,tag){return this.document.createElementNS(namespace,tag);};TreeConstruction.prototype.setAttribute = function setAttribute(element,name,value,namespace){if(namespace){element.setAttributeNS(namespace,name,value);}else {element.setAttribute(name,value);}};TreeConstruction.prototype.createTextNode = function createTextNode(text){return this.document.createTextNode(text);};TreeConstruction.prototype.createComment = function createComment(data){return this.document.createComment(data);};TreeConstruction.prototype.insertBefore = function insertBefore(parent,node,reference){parent.insertBefore(node,reference);};TreeConstruction.prototype.insertHTMLBefore = function insertHTMLBefore(parent,html,reference){return _insertHTMLBefore(this.uselessElement,parent,reference,html);};return TreeConstruction;})();DOM.TreeConstruction = TreeConstruction;var appliedTreeContruction=TreeConstruction;appliedTreeContruction = treeConstruction$2(doc,appliedTreeContruction);appliedTreeContruction = treeConstruction(doc,appliedTreeContruction);appliedTreeContruction = treeConstruction$1(doc,appliedTreeContruction,SVG_NAMESPACE);DOM.DOMTreeConstruction = appliedTreeContruction;})(DOM || (DOM = {}));var DOMChanges=(function(){function DOMChanges(document){this.document = document;this.namespace = null;this.uselessElement = this.document.createElement('div');}DOMChanges.prototype.setAttribute = function setAttribute(element,name,value){element.setAttribute(name,value);};DOMChanges.prototype.setAttributeNS = function setAttributeNS(element,namespace,name,value){element.setAttributeNS(namespace,name,value);};DOMChanges.prototype.removeAttribute = function removeAttribute(element,name){element.removeAttribute(name);};DOMChanges.prototype.removeAttributeNS = function removeAttributeNS(element,namespace,name){element.removeAttributeNS(namespace,name);};DOMChanges.prototype.createTextNode = function createTextNode(text){return this.document.createTextNode(text);};DOMChanges.prototype.createComment = function createComment(data){return this.document.createComment(data);};DOMChanges.prototype.createElement = function createElement(tag,context){var isElementInSVGNamespace=undefined,isHTMLIntegrationPoint=undefined;if(context){isElementInSVGNamespace = context.namespaceURI === SVG_NAMESPACE || tag === 'svg';isHTMLIntegrationPoint = SVG_INTEGRATION_POINTS[context.tagName];}else {isElementInSVGNamespace = tag === 'svg';isHTMLIntegrationPoint = false;}if(isElementInSVGNamespace && !isHTMLIntegrationPoint){ // FIXME: This does not properly handle with color, face, or +// size attributes, which is also disallowed by the spec. We should fix +// this. +if(BLACKLIST_TABLE[tag]){throw new Error('Cannot create a ' + tag + ' inside an SVG context');}return this.document.createElementNS(SVG_NAMESPACE,tag);}else {return this.document.createElement(tag);}};DOMChanges.prototype.insertHTMLBefore = function insertHTMLBefore(_parent,nextSibling,html){return _insertHTMLBefore(this.uselessElement,_parent,nextSibling,html);};DOMChanges.prototype.insertNodeBefore = function insertNodeBefore(parent,node,reference){if(isDocumentFragment(node)){var firstChild=node.firstChild;var lastChild=node.lastChild;this.insertBefore(parent,node,reference);return new ConcreteBounds(parent,firstChild,lastChild);}else {this.insertBefore(parent,node,reference);return new SingleNodeBounds(parent,node);}};DOMChanges.prototype.insertTextBefore = function insertTextBefore(parent,nextSibling,text){var textNode=this.createTextNode(text);this.insertBefore(parent,textNode,nextSibling);return textNode;};DOMChanges.prototype.insertBefore = function insertBefore(element,node,reference){element.insertBefore(node,reference);};DOMChanges.prototype.insertAfter = function insertAfter(element,node,reference){this.insertBefore(element,node,reference.nextSibling);};return DOMChanges;})();function _insertHTMLBefore(_useless,_parent,_nextSibling,html){ // TypeScript vendored an old version of the DOM spec where `insertAdjacentHTML` +// only exists on `HTMLElement` but not on `Element`. We actually work with the +// newer version of the DOM API here (and monkey-patch this method in `./compat` +// when we detect older browsers). This is a hack to work around this limitation. +var parent=_parent;var useless=_useless;var nextSibling=_nextSibling;var prev=nextSibling?nextSibling.previousSibling:parent.lastChild;var last=undefined;if(html === null || html === ''){return new ConcreteBounds(parent,null,null);}if(nextSibling === null){parent.insertAdjacentHTML('beforeEnd',html);last = parent.lastChild;}else if(nextSibling instanceof HTMLElement){nextSibling.insertAdjacentHTML('beforeBegin',html);last = nextSibling.previousSibling;}else { // Non-element nodes do not support insertAdjacentHTML, so add an +// element and call it on that element. Then remove the element. +// +// This also protects Edge, IE and Firefox w/o the inspector open +// from merging adjacent text nodes. See ./compat/text-node-merging-fix.ts +parent.insertBefore(useless,nextSibling);useless.insertAdjacentHTML('beforeBegin',html);last = useless.previousSibling;parent.removeChild(useless);}var first=prev?prev.nextSibling:parent.firstChild;return new ConcreteBounds(parent,first,last);}function isDocumentFragment(node){return node.nodeType === Node.DOCUMENT_FRAGMENT_NODE;}var helper=DOMChanges;helper = domChanges$2(doc,helper);helper = domChanges(doc,helper);helper = domChanges$1(doc,helper,SVG_NAMESPACE);var helper$1=helper;var DOMTreeConstruction=DOM.DOMTreeConstruction;function defaultManagers(element,attr,_isTrusting,_namespace){var tagName=element.tagName;var isSVG=element.namespaceURI === SVG_NAMESPACE;if(isSVG){return defaultAttributeManagers(tagName,attr);}var _normalizeProperty=normalizeProperty(element,attr);var type=_normalizeProperty.type;var normalized=_normalizeProperty.normalized;if(type === 'attr'){return defaultAttributeManagers(tagName,normalized);}else {return defaultPropertyManagers(tagName,normalized);}}function defaultPropertyManagers(tagName,attr){if(requiresSanitization(tagName,attr)){return new SafePropertyManager(attr);}if(isUserInputValue(tagName,attr)){return INPUT_VALUE_PROPERTY_MANAGER;}if(isOptionSelected(tagName,attr)){return OPTION_SELECTED_MANAGER;}return new PropertyManager(attr);}function defaultAttributeManagers(tagName,attr){if(requiresSanitization(tagName,attr)){return new SafeAttributeManager(attr);}return new AttributeManager(attr);}function readDOMAttr(element,attr){var isSVG=element.namespaceURI === SVG_NAMESPACE;var _normalizeProperty2=normalizeProperty(element,attr);var type=_normalizeProperty2.type;var normalized=_normalizeProperty2.normalized;if(isSVG){return element.getAttribute(normalized);}if(type === 'attr'){return element.getAttribute(normalized);}{return element[normalized];}};var AttributeManager=(function(){function AttributeManager(attr){this.attr = attr;}AttributeManager.prototype.setAttribute = function setAttribute(env,element,value,namespace){var dom=env.getAppendOperations();var normalizedValue=normalizeAttributeValue(value);if(!isAttrRemovalValue(normalizedValue)){dom.setAttribute(element,this.attr,normalizedValue,namespace);}};AttributeManager.prototype.updateAttribute = function updateAttribute(env,element,value,namespace){if(value === null || value === undefined || value === false){if(namespace){env.getDOM().removeAttributeNS(element,namespace,this.attr);}else {env.getDOM().removeAttribute(element,this.attr);}}else {this.setAttribute(env,element,value);}};return AttributeManager;})();;var PropertyManager=(function(_AttributeManager){babelHelpers.inherits(PropertyManager,_AttributeManager);function PropertyManager(){_AttributeManager.apply(this,arguments);}PropertyManager.prototype.setAttribute = function setAttribute(_env,element,value,_namespace){if(!isAttrRemovalValue(value)){element[this.attr] = value;}};PropertyManager.prototype.removeAttribute = function removeAttribute(env,element,namespace){ // TODO this sucks but to preserve properties first and to meet current +// semantics we must do this. +var attr=this.attr;if(namespace){env.getDOM().removeAttributeNS(element,namespace,attr);}else {env.getDOM().removeAttribute(element,attr);}};PropertyManager.prototype.updateAttribute = function updateAttribute(env,element,value,namespace){ // ensure the property is always updated +element[this.attr] = value;if(isAttrRemovalValue(value)){this.removeAttribute(env,element,namespace);}};return PropertyManager;})(AttributeManager);;function normalizeAttributeValue(value){if(value === false || value === undefined || value === null){return null;}if(value === true){return '';} // onclick function etc in SSR +if(typeof value === 'function'){return null;}return String(value);}function isAttrRemovalValue(value){return value === null || value === undefined;}var SafePropertyManager=(function(_PropertyManager){babelHelpers.inherits(SafePropertyManager,_PropertyManager);function SafePropertyManager(){_PropertyManager.apply(this,arguments);}SafePropertyManager.prototype.setAttribute = function setAttribute(env,element,value){_PropertyManager.prototype.setAttribute.call(this,env,element,sanitizeAttributeValue(env,element,this.attr,value));};SafePropertyManager.prototype.updateAttribute = function updateAttribute(env,element,value){_PropertyManager.prototype.updateAttribute.call(this,env,element,sanitizeAttributeValue(env,element,this.attr,value));};return SafePropertyManager;})(PropertyManager);function isUserInputValue(tagName,attribute){return (tagName === 'INPUT' || tagName === 'TEXTAREA') && attribute === 'value';}var InputValuePropertyManager=(function(_AttributeManager2){babelHelpers.inherits(InputValuePropertyManager,_AttributeManager2);function InputValuePropertyManager(){_AttributeManager2.apply(this,arguments);}InputValuePropertyManager.prototype.setAttribute = function setAttribute(_env,element,value){var input=element;input.value = normalizeTextValue(value);};InputValuePropertyManager.prototype.updateAttribute = function updateAttribute(_env,element,value){var input=element;var currentValue=input.value;var normalizedValue=normalizeTextValue(value);if(currentValue !== normalizedValue){input.value = normalizedValue;}};return InputValuePropertyManager;})(AttributeManager);var INPUT_VALUE_PROPERTY_MANAGER=new InputValuePropertyManager('value');function isOptionSelected(tagName,attribute){return tagName === 'OPTION' && attribute === 'selected';}var OptionSelectedManager=(function(_PropertyManager2){babelHelpers.inherits(OptionSelectedManager,_PropertyManager2);function OptionSelectedManager(){_PropertyManager2.apply(this,arguments);}OptionSelectedManager.prototype.setAttribute = function setAttribute(_env,element,value){if(value !== null && value !== undefined && value !== false){var option=element;option.selected = true;}};OptionSelectedManager.prototype.updateAttribute = function updateAttribute(_env,element,value){var option=element;if(value){option.selected = true;}else {option.selected = false;}};return OptionSelectedManager;})(PropertyManager);var OPTION_SELECTED_MANAGER=new OptionSelectedManager('selected');var SafeAttributeManager=(function(_AttributeManager3){babelHelpers.inherits(SafeAttributeManager,_AttributeManager3);function SafeAttributeManager(){_AttributeManager3.apply(this,arguments);}SafeAttributeManager.prototype.setAttribute = function setAttribute(env,element,value){_AttributeManager3.prototype.setAttribute.call(this,env,element,sanitizeAttributeValue(env,element,this.attr,value));};SafeAttributeManager.prototype.updateAttribute = function updateAttribute(env,element,value,_namespace){_AttributeManager3.prototype.updateAttribute.call(this,env,element,sanitizeAttributeValue(env,element,this.attr,value));};return SafeAttributeManager;})(AttributeManager);var Scope=(function(){function Scope(references){var callerScope=arguments.length <= 1 || arguments[1] === undefined?null:arguments[1];this.callerScope = null;this.slots = references;this.callerScope = callerScope;}Scope.root = function root(self){var size=arguments.length <= 1 || arguments[1] === undefined?0:arguments[1];var refs=new Array(size + 1);for(var i=0;i <= size;i++) {refs[i] = UNDEFINED_REFERENCE;}return new Scope(refs).init({self:self});};Scope.prototype.init = function init(_ref26){var self=_ref26.self;this.slots[0] = self;return this;};Scope.prototype.getSelf = function getSelf(){return this.slots[0];};Scope.prototype.getSymbol = function getSymbol(symbol){return this.slots[symbol];};Scope.prototype.getBlock = function getBlock(symbol){return this.slots[symbol];};Scope.prototype.getPartialArgs = function getPartialArgs(symbol){return this.slots[symbol];};Scope.prototype.bindSymbol = function bindSymbol(symbol,value){this.slots[symbol] = value;};Scope.prototype.bindBlock = function bindBlock(symbol,value){this.slots[symbol] = value;};Scope.prototype.bindPartialArgs = function bindPartialArgs(symbol,value){this.slots[symbol] = value;};Scope.prototype.bindCallerScope = function bindCallerScope(scope){this.callerScope = scope;};Scope.prototype.getCallerScope = function getCallerScope(){return this.callerScope;};Scope.prototype.child = function child(){return new Scope(this.slots.slice(),this.callerScope);};return Scope;})();var Transaction=(function(){function Transaction(){this.scheduledInstallManagers = [];this.scheduledInstallModifiers = [];this.scheduledUpdateModifierManagers = [];this.scheduledUpdateModifiers = [];this.createdComponents = [];this.createdManagers = [];this.updatedComponents = [];this.updatedManagers = [];this.destructors = [];}Transaction.prototype.didCreate = function didCreate(component,manager){this.createdComponents.push(component);this.createdManagers.push(manager);};Transaction.prototype.didUpdate = function didUpdate(component,manager){this.updatedComponents.push(component);this.updatedManagers.push(manager);};Transaction.prototype.scheduleInstallModifier = function scheduleInstallModifier(modifier,manager){this.scheduledInstallManagers.push(manager);this.scheduledInstallModifiers.push(modifier);};Transaction.prototype.scheduleUpdateModifier = function scheduleUpdateModifier(modifier,manager){this.scheduledUpdateModifierManagers.push(manager);this.scheduledUpdateModifiers.push(modifier);};Transaction.prototype.didDestroy = function didDestroy(d){this.destructors.push(d);};Transaction.prototype.commit = function commit(){var createdComponents=this.createdComponents;var createdManagers=this.createdManagers;for(var i=0;i < createdComponents.length;i++) {var component=createdComponents[i];var manager=createdManagers[i];manager.didCreate(component);}var updatedComponents=this.updatedComponents;var updatedManagers=this.updatedManagers;for(var i=0;i < updatedComponents.length;i++) {var component=updatedComponents[i];var manager=updatedManagers[i];manager.didUpdate(component);}var destructors=this.destructors;for(var i=0;i < destructors.length;i++) {destructors[i].destroy();}var scheduledInstallManagers=this.scheduledInstallManagers;var scheduledInstallModifiers=this.scheduledInstallModifiers;for(var i=0;i < scheduledInstallManagers.length;i++) {var manager=scheduledInstallManagers[i];var modifier=scheduledInstallModifiers[i];manager.install(modifier);}var scheduledUpdateModifierManagers=this.scheduledUpdateModifierManagers;var scheduledUpdateModifiers=this.scheduledUpdateModifiers;for(var i=0;i < scheduledUpdateModifierManagers.length;i++) {var manager=scheduledUpdateModifierManagers[i];var modifier=scheduledUpdateModifiers[i];manager.update(modifier);}};return Transaction;})();var Opcode=(function(){function Opcode(array){this.array = array;this.offset = 0;}babelHelpers.createClass(Opcode,[{key:'type',get:function(){return this.array[this.offset];}},{key:'op1',get:function(){return this.array[this.offset + 1];}},{key:'op2',get:function(){return this.array[this.offset + 2];}},{key:'op3',get:function(){return this.array[this.offset + 3];}}]);return Opcode;})();var Program=(function(){function Program(){this.opcodes = new _glimmerUtil.A(0x100000);this._offset = 0;this._opcode = new Opcode(this.opcodes);}Program.prototype.opcode = function opcode(offset){this._opcode.offset = offset;return this._opcode;};Program.prototype.set = function set(pos,opcode){var type=opcode[0];var op1=opcode[1];var op2=opcode[2];var op3=opcode[3];this.opcodes[pos] = type;this.opcodes[pos + 1] = op1;this.opcodes[pos + 2] = op2;this.opcodes[pos + 3] = op3;};Program.prototype.push = function push(opcode){var offset=this._offset;var type=opcode[0];var op1=opcode[1];var op2=opcode[2];var op3=opcode[3];this.opcodes[this._offset++] = type;this.opcodes[this._offset++] = op1;this.opcodes[this._offset++] = op2;this.opcodes[this._offset++] = op3;return offset;};babelHelpers.createClass(Program,[{key:'next',get:function(){return this._offset;}},{key:'current',get:function(){return this._offset - 4;}}]);return Program;})();var Environment=(function(){function Environment(_ref27){var appendOperations=_ref27.appendOperations;var updateOperations=_ref27.updateOperations;this._macros = null;this._transaction = null;this.constants = new Constants();this.program = new Program();this.appendOperations = appendOperations;this.updateOperations = updateOperations;}Environment.prototype.toConditionalReference = function toConditionalReference(reference){return new ConditionalReference(reference);};Environment.prototype.getAppendOperations = function getAppendOperations(){return this.appendOperations;};Environment.prototype.getDOM = function getDOM(){return this.updateOperations;};Environment.prototype.getIdentity = function getIdentity(object){return _glimmerUtil.ensureGuid(object) + '';};Environment.prototype.begin = function begin(){_glimmerUtil.assert(!this._transaction,'Cannot start a nested transaction');this._transaction = new Transaction();};Environment.prototype.didCreate = function didCreate(component,manager){this.transaction.didCreate(component,manager);};Environment.prototype.didUpdate = function didUpdate(component,manager){this.transaction.didUpdate(component,manager);};Environment.prototype.scheduleInstallModifier = function scheduleInstallModifier(modifier,manager){this.transaction.scheduleInstallModifier(modifier,manager);};Environment.prototype.scheduleUpdateModifier = function scheduleUpdateModifier(modifier,manager){this.transaction.scheduleUpdateModifier(modifier,manager);};Environment.prototype.didDestroy = function didDestroy(d){this.transaction.didDestroy(d);};Environment.prototype.commit = function commit(){this.transaction.commit();this._transaction = null;};Environment.prototype.attributeFor = function attributeFor(element,attr,isTrusting,namespace){return defaultManagers(element,attr,isTrusting,namespace === undefined?null:namespace);};Environment.prototype.macros = function macros(){var macros=this._macros;if(!macros){this._macros = macros = populateBuiltins();}return macros;};babelHelpers.createClass(Environment,[{key:'transaction',get:function(){return _glimmerUtil.expect(this._transaction,'must be in a transaction');}}]);return Environment;})();var RenderResult=(function(){function RenderResult(env,updating,bounds){this.env = env;this.updating = updating;this.bounds = bounds;}RenderResult.prototype.rerender = function rerender(){var _ref28=arguments.length <= 0 || arguments[0] === undefined?{alwaysRevalidate:false}:arguments[0];var _ref28$alwaysRevalidate=_ref28.alwaysRevalidate;var alwaysRevalidate=_ref28$alwaysRevalidate === undefined?false:_ref28$alwaysRevalidate;var env=this.env;var updating=this.updating;var vm=new UpdatingVM(env,{alwaysRevalidate:alwaysRevalidate});vm.execute(updating,this);};RenderResult.prototype.parentElement = function parentElement(){return this.bounds.parentElement();};RenderResult.prototype.firstNode = function firstNode(){return this.bounds.firstNode();};RenderResult.prototype.lastNode = function lastNode(){return this.bounds.lastNode();};RenderResult.prototype.opcodes = function opcodes(){return this.updating;};RenderResult.prototype.handleException = function handleException(){throw "this should never happen";};RenderResult.prototype.destroy = function destroy(){this.bounds.destroy();clear(this.bounds);};return RenderResult;})();var CapturedFrame=function CapturedFrame(operand,args,condition){this.operand = operand;this.args = args;this.condition = condition;};var Frame=(function(){function Frame(ops){var component=arguments.length <= 1 || arguments[1] === undefined?null:arguments[1];var manager=arguments.length <= 2 || arguments[2] === undefined?null:arguments[2];var shadow=arguments.length <= 3 || arguments[3] === undefined?null:arguments[3];this.ops = ops;this.component = component;this.manager = manager;this.shadow = shadow;this.operand = null;this.immediate = null;this.args = null;this.callerScope = null;this.blocks = null;this.condition = null;this.iterator = null;this.key = null;this.ip = ops[0];}Frame.prototype.capture = function capture(){return new CapturedFrame(this.operand,this.args,this.condition);};Frame.prototype.restore = function restore(frame){this.operand = frame['operand'];this.args = frame['args'];this.condition = frame['condition'];};return Frame;})();var FrameStack=(function(){function FrameStack(){this.frames = [];this.frame = null;}FrameStack.prototype.push = function push(ops){var component=arguments.length <= 1 || arguments[1] === undefined?null:arguments[1];var manager=arguments.length <= 2 || arguments[2] === undefined?null:arguments[2];var shadow=arguments.length <= 3 || arguments[3] === undefined?null:arguments[3];var frame=this.frame === null?this.frame = 0:++this.frame;if(this.frames.length <= frame){this.frames.push(null);}this.frames[frame] = new Frame(ops,component,manager,shadow);};FrameStack.prototype.pop = function pop(){var frames=this.frames;var frame=this.frame;frames[_glimmerUtil.expect(frame,'only pop after pushing')] = null;this.frame = frame === 0?null:frame - 1;};FrameStack.prototype.capture = function capture(){return this.currentFrame.capture();};FrameStack.prototype.restore = function restore(frame){this.currentFrame.restore(frame);};FrameStack.prototype.getOps = function getOps(){return this.currentFrame.ops;};FrameStack.prototype.getCurrent = function getCurrent(){return this.currentFrame.ip;};FrameStack.prototype.setCurrent = function setCurrent(ip){return this.currentFrame.ip = ip;};FrameStack.prototype.getOperand = function getOperand(){return _glimmerUtil.unwrap(this.currentFrame.operand);};FrameStack.prototype.setOperand = function setOperand(operand){return this.currentFrame.operand = operand;};FrameStack.prototype.getImmediate = function getImmediate(){return this.currentFrame.immediate;};FrameStack.prototype.setImmediate = function setImmediate(value){return this.currentFrame.immediate = value;}; // FIXME: These options are required in practice by the existing code, but +// figure out why. +FrameStack.prototype.getArgs = function getArgs(){return this.currentFrame.args;};FrameStack.prototype.setArgs = function setArgs(args){return this.currentFrame.args = args;};FrameStack.prototype.getCondition = function getCondition(){return _glimmerUtil.unwrap(this.currentFrame.condition);};FrameStack.prototype.setCondition = function setCondition(condition){return this.currentFrame.condition = condition;};FrameStack.prototype.getIterator = function getIterator(){return _glimmerUtil.unwrap(this.currentFrame.iterator);};FrameStack.prototype.setIterator = function setIterator(iterator){return this.currentFrame.iterator = iterator;};FrameStack.prototype.getKey = function getKey(){return this.currentFrame.key;};FrameStack.prototype.setKey = function setKey(key){return this.currentFrame.key = key;};FrameStack.prototype.getBlocks = function getBlocks(){return _glimmerUtil.unwrap(this.currentFrame.blocks);};FrameStack.prototype.setBlocks = function setBlocks(blocks){return this.currentFrame.blocks = blocks;};FrameStack.prototype.getCallerScope = function getCallerScope(){return _glimmerUtil.unwrap(this.currentFrame.callerScope);};FrameStack.prototype.setCallerScope = function setCallerScope(callerScope){return this.currentFrame.callerScope = callerScope;};FrameStack.prototype.getComponent = function getComponent(){return _glimmerUtil.unwrap(this.currentFrame.component);};FrameStack.prototype.getManager = function getManager(){return _glimmerUtil.unwrap(this.currentFrame.manager);};FrameStack.prototype.getShadow = function getShadow(){return this.currentFrame.shadow;};FrameStack.prototype.goto = function goto(ip){this.setCurrent(ip);};FrameStack.prototype.hasOpcodes = function hasOpcodes(){return this.frame !== null;};FrameStack.prototype.nextStatement = function nextStatement(env){var ip=this.frames[_glimmerUtil.unwrap(this.frame)].ip;var ops=this.getOps();if(ip <= ops[1]){var program=env.program;this.setCurrent(ip + 4);return program.opcode(ip);}else {this.pop();return null;}};babelHelpers.createClass(FrameStack,[{key:'currentFrame',get:function(){return this.frames[_glimmerUtil.unwrap(this.frame)];}}]);return FrameStack;})();var VM=(function(){function VM(env,scope,dynamicScope,elementStack){this.env = env;this.elementStack = elementStack;this.dynamicScopeStack = new _glimmerUtil.Stack();this.scopeStack = new _glimmerUtil.Stack();this.updatingOpcodeStack = new _glimmerUtil.Stack();this.cacheGroups = new _glimmerUtil.Stack();this.listBlockStack = new _glimmerUtil.Stack();this.frame = new FrameStack();this.env = env;this.constants = env.constants;this.elementStack = elementStack;this.scopeStack.push(scope);this.dynamicScopeStack.push(dynamicScope);}VM.initial = function initial(env,self,dynamicScope,elementStack,size){var scope=Scope.root(self,size);return new VM(env,scope,dynamicScope,elementStack);};VM.prototype.capture = function capture(){return {env:this.env,scope:this.scope(),dynamicScope:this.dynamicScope(),frame:this.frame.capture()};};VM.prototype.goto = function goto(ip){ // assert(this.frame.getOps().contains(op), `Illegal jump to ${op.label}`); +this.frame.goto(ip);};VM.prototype.beginCacheGroup = function beginCacheGroup(){this.cacheGroups.push(this.updating().tail());};VM.prototype.commitCacheGroup = function commitCacheGroup(){ // JumpIfNotModified(END) +// (head) +// (....) +// (tail) +// DidModify +// END: Noop +var END=new LabelOpcode("END");var opcodes=this.updating();var marker=this.cacheGroups.pop();var head=marker?opcodes.nextNode(marker):opcodes.head();var tail=opcodes.tail();var tag=_glimmerReference.combineSlice(new _glimmerUtil.ListSlice(head,tail));var guard=new JumpIfNotModifiedOpcode(tag,END);opcodes.insertBefore(guard,head);opcodes.append(new DidModifyOpcode(guard));opcodes.append(END);};VM.prototype.enter = function enter(sliceId){var updating=new _glimmerUtil.LinkedList();var tracker=this.stack().pushUpdatableBlock();var state=this.capture();var slice=this.constants.getSlice(sliceId);var tryOpcode=new TryOpcode(slice,state,tracker,updating);this.didEnter(tryOpcode,updating);};VM.prototype.enterWithKey = function enterWithKey(key,ops){var updating=new _glimmerUtil.LinkedList();var tracker=this.stack().pushUpdatableBlock();var state=this.capture();var tryOpcode=new TryOpcode(ops,state,tracker,updating);this.listBlock().map[key] = tryOpcode;this.didEnter(tryOpcode,updating);};VM.prototype.enterList = function enterList(ops){var updating=new _glimmerUtil.LinkedList();var tracker=this.stack().pushBlockList(updating);var state=this.capture();var artifacts=this.frame.getIterator().artifacts;var opcode=new ListBlockOpcode(ops,state,tracker,updating,artifacts);this.listBlockStack.push(opcode);this.didEnter(opcode,updating);};VM.prototype.didEnter = function didEnter(opcode,updating){this.updateWith(opcode);this.updatingOpcodeStack.push(updating);};VM.prototype.exit = function exit(){this.stack().popBlock();this.updatingOpcodeStack.pop();var parent=this.updating().tail();parent.didInitializeChildren();};VM.prototype.exitList = function exitList(){this.exit();this.listBlockStack.pop();};VM.prototype.updateWith = function updateWith(opcode){this.updating().append(opcode);};VM.prototype.listBlock = function listBlock(){return _glimmerUtil.expect(this.listBlockStack.current,'expected a list block');};VM.prototype.updating = function updating(){return _glimmerUtil.expect(this.updatingOpcodeStack.current,'expected updating opcode on the updating opcode stack');};VM.prototype.stack = function stack(){return this.elementStack;};VM.prototype.scope = function scope(){return _glimmerUtil.expect(this.scopeStack.current,'expected scope on the scope stack');};VM.prototype.dynamicScope = function dynamicScope(){return _glimmerUtil.expect(this.dynamicScopeStack.current,'expected dynamic scope on the dynamic scope stack');};VM.prototype.pushFrame = function pushFrame(block,args,callerScope){this.frame.push(block.slice);if(args)this.frame.setArgs(args);if(args && args.blocks)this.frame.setBlocks(args.blocks);if(callerScope)this.frame.setCallerScope(callerScope);};VM.prototype.pushComponentFrame = function pushComponentFrame(layout,args,callerScope,component,manager,shadow){this.frame.push(layout.slice,component,manager,shadow);if(args)this.frame.setArgs(args);if(args && args.blocks)this.frame.setBlocks(args.blocks);if(callerScope)this.frame.setCallerScope(callerScope);};VM.prototype.pushEvalFrame = function pushEvalFrame(slice){this.frame.push(slice);};VM.prototype.pushChildScope = function pushChildScope(){this.scopeStack.push(this.scope().child());};VM.prototype.pushCallerScope = function pushCallerScope(){this.scopeStack.push(_glimmerUtil.expect(this.scope().getCallerScope(),'pushCallerScope is called when a caller scope is present'));};VM.prototype.pushDynamicScope = function pushDynamicScope(){var child=this.dynamicScope().child();this.dynamicScopeStack.push(child);return child;};VM.prototype.pushRootScope = function pushRootScope(self,size){var scope=Scope.root(self,size);this.scopeStack.push(scope);return scope;};VM.prototype.popScope = function popScope(){this.scopeStack.pop();};VM.prototype.popDynamicScope = function popDynamicScope(){this.dynamicScopeStack.pop();};VM.prototype.newDestroyable = function newDestroyable(d){this.stack().newDestroyable(d);}; /// SCOPE HELPERS +VM.prototype.getSelf = function getSelf(){return this.scope().getSelf();};VM.prototype.referenceForSymbol = function referenceForSymbol(symbol){return this.scope().getSymbol(symbol);};VM.prototype.getArgs = function getArgs(){return this.frame.getArgs();}; /// EXECUTION +VM.prototype.resume = function resume(opcodes,frame){return this.execute(opcodes,function(vm){return vm.frame.restore(frame);});};VM.prototype.execute = function execute(opcodes,initialize){_glimmerUtil.LOGGER.debug("[VM] Begin program execution");var elementStack=this.elementStack;var frame=this.frame;var updatingOpcodeStack=this.updatingOpcodeStack;var env=this.env;elementStack.pushSimpleBlock();updatingOpcodeStack.push(new _glimmerUtil.LinkedList());frame.push(opcodes);if(initialize)initialize(this);var opcode=undefined;while(frame.hasOpcodes()) {if(opcode = frame.nextStatement(this.env)){_glimmerUtil.LOGGER.trace(opcode);APPEND_OPCODES.evaluate(this,opcode);}}_glimmerUtil.LOGGER.debug("[VM] Completed program execution");return new RenderResult(env,_glimmerUtil.expect(updatingOpcodeStack.pop(),'there should be a final updating opcode stack'),elementStack.popBlock());};VM.prototype.evaluateOpcode = function evaluateOpcode(opcode){APPEND_OPCODES.evaluate(this,opcode);}; // Make sure you have opcodes that push and pop a scope around this opcode +// if you need to change the scope. +VM.prototype.invokeBlock = function invokeBlock(block,args){var compiled=block.compile(this.env);this.pushFrame(compiled,args);};VM.prototype.invokePartial = function invokePartial(block){var compiled=block.compile(this.env);this.pushFrame(compiled);};VM.prototype.invokeLayout = function invokeLayout(args,layout,callerScope,component,manager,shadow){this.pushComponentFrame(layout,args,callerScope,component,manager,shadow);};VM.prototype.evaluateOperand = function evaluateOperand(expr){this.frame.setOperand(expr.evaluate(this));};VM.prototype.evaluateArgs = function evaluateArgs(args){var evaledArgs=this.frame.setArgs(args.evaluate(this));this.frame.setOperand(evaledArgs.positional.at(0));};VM.prototype.bindPositionalArgs = function bindPositionalArgs(symbols){var args=_glimmerUtil.expect(this.frame.getArgs(),'bindPositionalArgs assumes a previous setArgs');var positional=args.positional;var scope=this.scope();for(var i=0;i < symbols.length;i++) {scope.bindSymbol(symbols[i],positional.at(i));}};VM.prototype.bindNamedArgs = function bindNamedArgs(names,symbols){var args=_glimmerUtil.expect(this.frame.getArgs(),'bindNamedArgs assumes a previous setArgs');var scope=this.scope();var named=args.named;for(var i=0;i < names.length;i++) {var _name2=this.constants.getString(names[i]);scope.bindSymbol(symbols[i],named.get(_name2));}};VM.prototype.bindBlocks = function bindBlocks(names,symbols){var blocks=this.frame.getBlocks();var scope=this.scope();for(var i=0;i < names.length;i++) {var _name3=this.constants.getString(names[i]);scope.bindBlock(symbols[i],blocks && blocks[_name3] || null);}};VM.prototype.bindPartialArgs = function bindPartialArgs(symbol){var args=_glimmerUtil.expect(this.frame.getArgs(),'bindPartialArgs assumes a previous setArgs');var scope=this.scope();_glimmerUtil.assert(args,"Cannot bind named args");scope.bindPartialArgs(symbol,args);};VM.prototype.bindCallerScope = function bindCallerScope(){var callerScope=this.frame.getCallerScope();var scope=this.scope();_glimmerUtil.assert(callerScope,"Cannot bind caller scope");scope.bindCallerScope(callerScope);};VM.prototype.bindDynamicScope = function bindDynamicScope(names){var args=_glimmerUtil.expect(this.frame.getArgs(),'bindDynamicScope assumes a previous setArgs');var scope=this.dynamicScope();_glimmerUtil.assert(args,"Cannot bind dynamic scope");for(var i=0;i < names.length;i++) {var _name4=this.constants.getString(names[i]);scope.set(_name4,args.named.get(_name4));}};return VM;})();var UpdatingVM=(function(){function UpdatingVM(env,_ref29){var _ref29$alwaysRevalidate=_ref29.alwaysRevalidate;var alwaysRevalidate=_ref29$alwaysRevalidate === undefined?false:_ref29$alwaysRevalidate;this.frameStack = new _glimmerUtil.Stack();this.env = env;this.constants = env.constants;this.dom = env.getDOM();this.alwaysRevalidate = alwaysRevalidate;}UpdatingVM.prototype.execute = function execute(opcodes,handler){var frameStack=this.frameStack;this.try(opcodes,handler);while(true) {if(frameStack.isEmpty())break;var opcode=this.frame.nextStatement();if(opcode === null){this.frameStack.pop();continue;}_glimmerUtil.LOGGER.debug('[VM] OP ' + opcode.type);_glimmerUtil.LOGGER.trace(opcode);opcode.evaluate(this);}};UpdatingVM.prototype.goto = function goto(op){this.frame.goto(op);};UpdatingVM.prototype.try = function _try(ops,handler){this.frameStack.push(new UpdatingVMFrame(this,ops,handler));};UpdatingVM.prototype.throw = function _throw(){this.frame.handleException();this.frameStack.pop();};UpdatingVM.prototype.evaluateOpcode = function evaluateOpcode(opcode){opcode.evaluate(this);};babelHelpers.createClass(UpdatingVM,[{key:'frame',get:function(){return _glimmerUtil.expect(this.frameStack.current,'bug: expected a frame');}}]);return UpdatingVM;})();var BlockOpcode=(function(_UpdatingOpcode8){babelHelpers.inherits(BlockOpcode,_UpdatingOpcode8);function BlockOpcode(ops,state,bounds,children){_UpdatingOpcode8.call(this);this.ops = ops;this.type = "block";this.next = null;this.prev = null;var env=state.env;var scope=state.scope;var dynamicScope=state.dynamicScope;var frame=state.frame;this.children = children;this.env = env;this.scope = scope;this.dynamicScope = dynamicScope;this.frame = frame;this.bounds = bounds;}BlockOpcode.prototype.parentElement = function parentElement(){return this.bounds.parentElement();};BlockOpcode.prototype.firstNode = function firstNode(){return this.bounds.firstNode();};BlockOpcode.prototype.lastNode = function lastNode(){return this.bounds.lastNode();};BlockOpcode.prototype.evaluate = function evaluate(vm){vm.try(this.children,null);};BlockOpcode.prototype.destroy = function destroy(){this.bounds.destroy();};BlockOpcode.prototype.didDestroy = function didDestroy(){this.env.didDestroy(this.bounds);};BlockOpcode.prototype.toJSON = function toJSON(){var details=_glimmerUtil.dict();details["guid"] = '' + this._guid;return {guid:this._guid,type:this.type,details:details,children:this.children.toArray().map(function(op){return op.toJSON();})};};return BlockOpcode;})(UpdatingOpcode);var TryOpcode=(function(_BlockOpcode){babelHelpers.inherits(TryOpcode,_BlockOpcode);function TryOpcode(ops,state,bounds,children){_BlockOpcode.call(this,ops,state,bounds,children);this.type = "try";this.tag = this._tag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG);}TryOpcode.prototype.didInitializeChildren = function didInitializeChildren(){this._tag.update(_glimmerReference.combineSlice(this.children));};TryOpcode.prototype.evaluate = function evaluate(vm){vm.try(this.children,this);};TryOpcode.prototype.handleException = function handleException(){var env=this.env;var scope=this.scope;var ops=this.ops;var dynamicScope=this.dynamicScope;var frame=this.frame;var elementStack=ElementStack.resume(this.env,this.bounds,this.bounds.reset(env));var vm=new VM(env,scope,dynamicScope,elementStack);var result=vm.resume(ops,frame);this.children = result.opcodes();this.didInitializeChildren();};TryOpcode.prototype.toJSON = function toJSON(){var json=_BlockOpcode.prototype.toJSON.call(this);var details=json["details"];if(!details){details = json["details"] = {};}return _BlockOpcode.prototype.toJSON.call(this);};return TryOpcode;})(BlockOpcode);var ListRevalidationDelegate=(function(){function ListRevalidationDelegate(opcode,marker){this.opcode = opcode;this.marker = marker;this.didInsert = false;this.didDelete = false;this.map = opcode.map;this.updating = opcode['children'];}ListRevalidationDelegate.prototype.insert = function insert(key,item,memo,before){var map=this.map;var opcode=this.opcode;var updating=this.updating;var nextSibling=null;var reference=null;if(before){reference = map[before];nextSibling = reference['bounds'].firstNode();}else {nextSibling = this.marker;}var vm=opcode.vmForInsertion(nextSibling);var tryOpcode=null;vm.execute(opcode.ops,function(vm){vm.frame.setArgs(EvaluatedArgs.positional([item,memo]));vm.frame.setOperand(item);vm.frame.setCondition(new _glimmerReference.ConstReference(true));vm.frame.setKey(key);var state=vm.capture();var tracker=vm.stack().pushUpdatableBlock();tryOpcode = new TryOpcode(opcode.ops,state,tracker,vm.updating());});tryOpcode.didInitializeChildren();updating.insertBefore(tryOpcode,reference);map[key] = tryOpcode;this.didInsert = true;};ListRevalidationDelegate.prototype.retain = function retain(_key,_item,_memo){};ListRevalidationDelegate.prototype.move = function move(key,_item,_memo,before){var map=this.map;var updating=this.updating;var entry=map[key];var reference=map[before] || null;if(before){moveBounds(entry,reference.firstNode());}else {moveBounds(entry,this.marker);}updating.remove(entry);updating.insertBefore(entry,reference);};ListRevalidationDelegate.prototype.delete = function _delete(key){var map=this.map;var opcode=map[key];opcode.didDestroy();clear(opcode);this.updating.remove(opcode);delete map[key];this.didDelete = true;};ListRevalidationDelegate.prototype.done = function done(){this.opcode.didInitializeChildren(this.didInsert || this.didDelete);};return ListRevalidationDelegate;})();var ListBlockOpcode=(function(_BlockOpcode2){babelHelpers.inherits(ListBlockOpcode,_BlockOpcode2);function ListBlockOpcode(ops,state,bounds,children,artifacts){_BlockOpcode2.call(this,ops,state,bounds,children);this.type = "list-block";this.map = _glimmerUtil.dict();this.lastIterated = _glimmerReference.INITIAL;this.artifacts = artifacts;var _tag=this._tag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG);this.tag = _glimmerReference.combine([artifacts.tag,_tag]);}ListBlockOpcode.prototype.didInitializeChildren = function didInitializeChildren(){var listDidChange=arguments.length <= 0 || arguments[0] === undefined?true:arguments[0];this.lastIterated = this.artifacts.tag.value();if(listDidChange){this._tag.update(_glimmerReference.combineSlice(this.children));}};ListBlockOpcode.prototype.evaluate = function evaluate(vm){var artifacts=this.artifacts;var lastIterated=this.lastIterated;if(!artifacts.tag.validate(lastIterated)){var bounds=this.bounds;var dom=vm.dom;var marker=dom.createComment('');dom.insertAfter(bounds.parentElement(),marker,_glimmerUtil.expect(bounds.lastNode(),"can't insert after an empty bounds"));var target=new ListRevalidationDelegate(this,marker);var synchronizer=new _glimmerReference.IteratorSynchronizer({target:target,artifacts:artifacts});synchronizer.sync();this.parentElement().removeChild(marker);} // Run now-updated updating opcodes +_BlockOpcode2.prototype.evaluate.call(this,vm);};ListBlockOpcode.prototype.vmForInsertion = function vmForInsertion(nextSibling){var env=this.env;var scope=this.scope;var dynamicScope=this.dynamicScope;var elementStack=ElementStack.forInitialRender(this.env,this.bounds.parentElement(),nextSibling);return new VM(env,scope,dynamicScope,elementStack);};ListBlockOpcode.prototype.toJSON = function toJSON(){var json=_BlockOpcode2.prototype.toJSON.call(this);var map=this.map;var inner=Object.keys(map).map(function(key){return JSON.stringify(key) + ': ' + map[key]._guid;}).join(", ");var details=json["details"];if(!details){details = json["details"] = {};}details["map"] = '{' + inner + '}';return json;};return ListBlockOpcode;})(BlockOpcode);var UpdatingVMFrame=(function(){function UpdatingVMFrame(vm,ops,exceptionHandler){this.vm = vm;this.ops = ops;this.exceptionHandler = exceptionHandler;this.vm = vm;this.ops = ops;this.current = ops.head();}UpdatingVMFrame.prototype.goto = function goto(op){this.current = op;};UpdatingVMFrame.prototype.nextStatement = function nextStatement(){var current=this.current;var ops=this.ops;if(current)this.current = ops.nextNode(current);return current;};UpdatingVMFrame.prototype.handleException = function handleException(){if(this.exceptionHandler){this.exceptionHandler.handleException();}};return UpdatingVMFrame;})();var CompiledBlock=function CompiledBlock(slice){this.start = slice[0];this.end = slice[1];this.slice = slice;};var CompiledProgram=(function(_CompiledBlock){babelHelpers.inherits(CompiledProgram,_CompiledBlock);function CompiledProgram(slice,symbols){_CompiledBlock.call(this,slice);this.symbols = symbols;}return CompiledProgram;})(CompiledBlock);function entryPoint(meta){return new ProgramSymbolTable(meta);}function layout(meta,wireNamed,wireYields,hasPartials){var _symbols3=symbols(wireNamed,wireYields,hasPartials);var named=_symbols3.named;var yields=_symbols3.yields;var partialSymbol=_symbols3.partialSymbol;var size=_symbols3.size;return new ProgramSymbolTable(meta,named,yields,partialSymbol,size);}function block(parent,locals){var localsMap=null;var program=parent['program'];if(locals.length !== 0){(function(){var map=localsMap = _glimmerUtil.dict();locals.forEach(function(l){return map[l] = program.size++;});})();}return new BlockSymbolTable(parent,program,localsMap);}function symbols(named,yields,hasPartials){var yieldsMap=null;var namedMap=null;var size=1;if(yields.length !== 0){(function(){var map=yieldsMap = _glimmerUtil.dict();yields.forEach(function(y){return map[y] = size++;});})();}if(named.length !== 0){(function(){var map=namedMap = _glimmerUtil.dict();named.forEach(function(y){return map[y] = size++;});})();}var partialSymbol=hasPartials?size++:null;return {named:namedMap,yields:yieldsMap,partialSymbol:partialSymbol,size:size};}var ProgramSymbolTable=(function(){function ProgramSymbolTable(meta){var named=arguments.length <= 1 || arguments[1] === undefined?null:arguments[1];var yields=arguments.length <= 2 || arguments[2] === undefined?null:arguments[2];var partialArgs=arguments.length <= 3 || arguments[3] === undefined?null:arguments[3];var size=arguments.length <= 4 || arguments[4] === undefined?1:arguments[4];this.meta = meta;this.named = named;this.yields = yields;this.partialArgs = partialArgs;this.size = size;this.program = this;}ProgramSymbolTable.prototype.getMeta = function getMeta(){return this.meta;};ProgramSymbolTable.prototype.getSymbols = function getSymbols(){return {named:this.named,yields:this.yields,locals:null,partialArgs:this.partialArgs};};ProgramSymbolTable.prototype.getSymbol = function getSymbol(kind,name){if(kind === 'local')return null;return this[kind] && this[kind][name];};ProgramSymbolTable.prototype.getPartialArgs = function getPartialArgs(){return this.partialArgs || 0;};return ProgramSymbolTable;})();var BlockSymbolTable=(function(){function BlockSymbolTable(parent,program,locals){this.parent = parent;this.program = program;this.locals = locals;}BlockSymbolTable.prototype.getMeta = function getMeta(){return this.program.getMeta();};BlockSymbolTable.prototype.getSymbols = function getSymbols(){return {named:null,yields:null,locals:this.locals,partialArgs:null};};BlockSymbolTable.prototype.getSymbol = function getSymbol(kind,name){if(kind === 'local'){return this.getLocal(name);}else {return this.program.getSymbol(kind,name);}};BlockSymbolTable.prototype.getLocal = function getLocal(name){var locals=this.locals;var parent=this.parent;var symbol=locals && locals[name];if(!symbol && parent){symbol = parent.getSymbol('local',name);}return symbol;};BlockSymbolTable.prototype.getPartialArgs = function getPartialArgs(){return this.program.getPartialArgs();};return BlockSymbolTable;})();var Specialize=(function(){function Specialize(){this.names = _glimmerUtil.dict();this.funcs = [];}Specialize.prototype.add = function add(name,func){this.funcs.push(func);this.names[name] = this.funcs.length - 1;};Specialize.prototype.specialize = function specialize(sexp,table){var name=sexp[0];var index=this.names[name];if(index === undefined)return sexp;var func=this.funcs[index];_glimmerUtil.assert(!!func,'expected a specialization for ' + sexp[0]);return func(sexp,table);};return Specialize;})();var SPECIALIZE=new Specialize();var E=_glimmerWireFormat.Expressions;SPECIALIZE.add('append',function(sexp,_symbolTable){var path=sexp[1];if(Array.isArray(path) && (E.isUnknown(path) || E.isGet(path))){if(path[1].length !== 1){return ['unoptimized-append',sexp[1],sexp[2]];}}return ['optimized-append',sexp[1],sexp[2]];});SPECIALIZE.add('dynamic-attr',function(sexp,_symbolTable){return ['any-dynamic-attr',sexp[1],sexp[2],sexp[3],false];});SPECIALIZE.add('trusting-attr',function(sexp,_symbolTable){return ['any-dynamic-attr',sexp[1],sexp[2],sexp[3],true];});SPECIALIZE.add('partial',function(sexp,_table){var expression=sexp[1];if(typeof expression === 'string'){return ['static-partial',expression];}else {return ['dynamic-partial',expression];}});function compileStatement(statement,builder){var refined=SPECIALIZE.specialize(statement,builder.symbolTable);STATEMENTS.compile(refined,builder);}var Template=function Template(statements,symbolTable){this.statements = statements;this.symbolTable = symbolTable;};var Layout=(function(_Template){babelHelpers.inherits(Layout,_Template);function Layout(){_Template.apply(this,arguments);}return Layout;})(Template);var EntryPoint=(function(_Template2){babelHelpers.inherits(EntryPoint,_Template2);function EntryPoint(){_Template2.apply(this,arguments);}EntryPoint.prototype.compile = function compile(env){var table=this.symbolTable;var b=builder(env,table);for(var i=0;i < this.statements.length;i++) {var statement=this.statements[i];var refined=SPECIALIZE.specialize(statement,table);STATEMENTS.compile(refined,b);}return new CompiledProgram(b.toSlice(),this.symbolTable.size);};return EntryPoint;})(Template);var InlineBlock=(function(_Template3){babelHelpers.inherits(InlineBlock,_Template3);function InlineBlock(){_Template3.apply(this,arguments);}InlineBlock.prototype.splat = function splat(builder){var table=builder.symbolTable;var locals=table.getSymbols().locals;if(locals){builder.pushChildScope();builder.bindPositionalArgsForLocals(locals);}for(var i=0;i < this.statements.length;i++) {var statement=this.statements[i];var refined=SPECIALIZE.specialize(statement,table);STATEMENTS.compile(refined,builder);}if(locals){builder.popScope();}};InlineBlock.prototype.compile = function compile(env){var table=this.symbolTable;var b=builder(env,table);this.splat(b);return new CompiledBlock(b.toSlice());};return InlineBlock;})(Template);var PartialBlock=(function(_Template4){babelHelpers.inherits(PartialBlock,_Template4);function PartialBlock(){_Template4.apply(this,arguments);}PartialBlock.prototype.compile = function compile(env){var table=this.symbolTable;var b=builder(env,table);for(var i=0;i < this.statements.length;i++) {var statement=this.statements[i];var refined=SPECIALIZE.specialize(statement,table);STATEMENTS.compile(refined,b);}return new CompiledProgram(b.toSlice(),table.size);};return PartialBlock;})(Template);var Scanner=(function(){function Scanner(block,meta,env){this.block = block;this.meta = meta;this.env = env;}Scanner.prototype.scanEntryPoint = function scanEntryPoint(){var block=this.block;var meta=this.meta;var symbolTable=entryPoint(meta);var child=scanBlock(block,symbolTable,this.env);return new EntryPoint(child.statements,symbolTable);};Scanner.prototype.scanLayout = function scanLayout(){var block=this.block;var meta=this.meta;var named=block.named;var yields=block.yields;var hasPartials=block.hasPartials;var symbolTable=layout(meta,named,yields,hasPartials);var child=scanBlock(block,symbolTable,this.env);return new Layout(child.statements,symbolTable);};Scanner.prototype.scanPartial = function scanPartial(symbolTable){var block=this.block;var child=scanBlock(block,symbolTable,this.env);return new PartialBlock(child.statements,symbolTable);};return Scanner;})();function scanBlock(_ref30,symbolTable,env){var statements=_ref30.statements;return new RawInlineBlock(env,symbolTable,statements).scan();}var BaselineSyntax;(function(BaselineSyntax){BaselineSyntax.isScannedComponent = _glimmerWireFormat.is('scanned-component');BaselineSyntax.isPrimitiveElement = _glimmerWireFormat.is('open-primitive-element');BaselineSyntax.isOptimizedAppend = _glimmerWireFormat.is('optimized-append');BaselineSyntax.isUnoptimizedAppend = _glimmerWireFormat.is('unoptimized-append');BaselineSyntax.isAnyAttr = _glimmerWireFormat.is('any-dynamic-attr');BaselineSyntax.isStaticPartial = _glimmerWireFormat.is('static-partial');BaselineSyntax.isDynamicPartial = _glimmerWireFormat.is('dynamic-partial');BaselineSyntax.isFunctionExpression = _glimmerWireFormat.is('function');BaselineSyntax.isNestedBlock = _glimmerWireFormat.is('nested-block');BaselineSyntax.isScannedBlock = _glimmerWireFormat.is('scanned-block');BaselineSyntax.isDebugger = _glimmerWireFormat.is('debugger');var NestedBlock;(function(NestedBlock){function defaultBlock(sexp){return sexp[4];}NestedBlock.defaultBlock = defaultBlock;function inverseBlock(sexp){return sexp[5];}NestedBlock.inverseBlock = inverseBlock;function params(sexp){return sexp[2];}NestedBlock.params = params;function hash(sexp){return sexp[3];}NestedBlock.hash = hash;})(NestedBlock = BaselineSyntax.NestedBlock || (BaselineSyntax.NestedBlock = {}));})(BaselineSyntax || (exports.BaselineSyntax = BaselineSyntax = {}));var RawInlineBlock=(function(){function RawInlineBlock(env,table,statements){this.env = env;this.table = table;this.statements = statements;}RawInlineBlock.prototype.scan = function scan(){var buffer=[];for(var i=0;i < this.statements.length;i++) {var statement=this.statements[i];if(_glimmerWireFormat.Statements.isBlock(statement)){buffer.push(this.specializeBlock(statement));}else if(_glimmerWireFormat.Statements.isComponent(statement)){buffer.push.apply(buffer,this.specializeComponent(statement));}else {buffer.push(statement);}}return new InlineBlock(buffer,this.table);};RawInlineBlock.prototype.specializeBlock = function specializeBlock(block$$){var path=block$$[1];var params=block$$[2];var hash=block$$[3];var template=block$$[4];var inverse=block$$[5];return ['scanned-block',path,params,hash,this.child(template),this.child(inverse)];};RawInlineBlock.prototype.specializeComponent = function specializeComponent(sexp){var tag=sexp[1];var component=sexp[2];if(this.env.hasComponentDefinition([tag],this.table)){var child=this.child(component);var attrs=new RawInlineBlock(this.env,this.table,component.attrs);return [['scanned-component',tag,attrs,component.args,child]];}else {var buf=[];buf.push(['open-element',tag,[]]);buf.push.apply(buf,component.attrs);buf.push(['flush-element']);buf.push.apply(buf,component.statements);buf.push(['close-element']);return buf;}};RawInlineBlock.prototype.child = function child(block$$){if(!block$$)return null;var table=block(this.table,block$$.locals);return new RawInlineBlock(this.env,table,block$$.statements);};return RawInlineBlock;})();function compileLayout(compilable,env){var builder=new ComponentLayoutBuilder(env);compilable.compile(builder);return builder.compile();}var ComponentLayoutBuilder=(function(){function ComponentLayoutBuilder(env){this.env = env;}ComponentLayoutBuilder.prototype.wrapLayout = function wrapLayout(layout){this.inner = new WrappedBuilder(this.env,layout);};ComponentLayoutBuilder.prototype.fromLayout = function fromLayout(layout){this.inner = new UnwrappedBuilder(this.env,layout);};ComponentLayoutBuilder.prototype.compile = function compile(){return this.inner.compile();};babelHelpers.createClass(ComponentLayoutBuilder,[{key:'tag',get:function(){return this.inner.tag;}},{key:'attrs',get:function(){return this.inner.attrs;}}]);return ComponentLayoutBuilder;})();var WrappedBuilder=(function(){function WrappedBuilder(env,layout){this.env = env;this.layout = layout;this.tag = new ComponentTagBuilder();this.attrs = new ComponentAttrsBuilder();}WrappedBuilder.prototype.compile = function compile(){ //========DYNAMIC +// PutValue(TagExpr) +// Test +// JumpUnless(BODY) +// OpenDynamicPrimitiveElement +// DidCreateElement +// ...attr statements... +// FlushElement +// BODY: Noop +// ...body statements... +// PutValue(TagExpr) +// Test +// JumpUnless(END) +// CloseElement +// END: Noop +// DidRenderLayout +// Exit +// +//========STATIC +// OpenPrimitiveElementOpcode +// DidCreateElement +// ...attr statements... +// FlushElement +// ...body statements... +// CloseElement +// DidRenderLayout +// Exit +var env=this.env;var layout=this.layout;var symbolTable=layout.symbolTable;var b=builder(env,layout.symbolTable);b.startLabels();var dynamicTag=this.tag.getDynamic();var staticTag=undefined;if(dynamicTag){b.putValue(dynamicTag);b.test('simple');b.jumpUnless('BODY');b.openDynamicPrimitiveElement();b.didCreateElement();this.attrs['buffer'].forEach(function(statement){return compileStatement(statement,b);});b.flushElement();b.label('BODY');}else if(staticTag = this.tag.getStatic()){b.openPrimitiveElement(staticTag);b.didCreateElement();this.attrs['buffer'].forEach(function(statement){return compileStatement(statement,b);});b.flushElement();}b.preludeForLayout(layout);layout.statements.forEach(function(statement){return compileStatement(statement,b);});if(dynamicTag){b.putValue(dynamicTag);b.test('simple');b.jumpUnless('END');b.closeElement();b.label('END');}else if(staticTag){b.closeElement();}b.didRenderLayout();b.stopLabels();return new CompiledProgram(b.toSlice(),symbolTable.size);};return WrappedBuilder;})();function isOpenElement(value){var type=value[0];return type === 'open-element' || type === 'open-primitive-element';}var UnwrappedBuilder=(function(){function UnwrappedBuilder(env,layout){this.env = env;this.layout = layout;this.attrs = new ComponentAttrsBuilder();}UnwrappedBuilder.prototype.compile = function compile(){var env=this.env;var layout=this.layout;var b=builder(env,layout.symbolTable);b.startLabels();b.preludeForLayout(layout);var attrs=this.attrs['buffer'];var attrsInserted=false;for(var i=0;i < layout.statements.length;i++) {var statement=layout.statements[i];if(!attrsInserted && isOpenElement(statement)){b.openComponentElement(statement[1]);b.didCreateElement();b.shadowAttributes();attrs.forEach(function(statement){return compileStatement(statement,b);});attrsInserted = true;}else {compileStatement(statement,b);}}b.didRenderLayout();b.stopLabels();return new CompiledProgram(b.toSlice(),layout.symbolTable.size);};babelHelpers.createClass(UnwrappedBuilder,[{key:'tag',get:function(){throw new Error('BUG: Cannot call `tag` on an UnwrappedBuilder');}}]);return UnwrappedBuilder;})();var ComponentTagBuilder=(function(){function ComponentTagBuilder(){this.isDynamic = null;this.isStatic = null;this.staticTagName = null;this.dynamicTagName = null;}ComponentTagBuilder.prototype.getDynamic = function getDynamic(){if(this.isDynamic){return this.dynamicTagName;}};ComponentTagBuilder.prototype.getStatic = function getStatic(){if(this.isStatic){return this.staticTagName;}};ComponentTagBuilder.prototype.static = function _static(tagName){this.isStatic = true;this.staticTagName = tagName;};ComponentTagBuilder.prototype.dynamic = function dynamic(tagName){this.isDynamic = true;this.dynamicTagName = ['function',tagName];};return ComponentTagBuilder;})();var ComponentAttrsBuilder=(function(){function ComponentAttrsBuilder(){this.buffer = [];}ComponentAttrsBuilder.prototype.static = function _static(name,value){this.buffer.push(['static-attr',name,value,null]);};ComponentAttrsBuilder.prototype.dynamic = function dynamic(name,value){this.buffer.push(['dynamic-attr',name,['function',value],null]);};return ComponentAttrsBuilder;})();var ComponentBuilder=(function(){function ComponentBuilder(builder){this.builder = builder;this.env = builder.env;}ComponentBuilder.prototype.static = function _static(definition,args,_symbolTable,shadow){this.builder.unit(function(b){b.putComponentDefinition(definition);b.openComponent(compileBaselineArgs(args,b),shadow);b.closeComponent();});};ComponentBuilder.prototype.dynamic = function dynamic(definitionArgs,definition,args,_symbolTable,shadow){this.builder.unit(function(b){b.putArgs(compileArgs(definitionArgs[0],definitionArgs[1],b));b.putValue(['function',definition]);b.test('simple');b.enter('BEGIN','END');b.label('BEGIN');b.jumpUnless('END');b.putDynamicComponentDefinition();b.openComponent(compileBaselineArgs(args,b),shadow);b.closeComponent();b.label('END');b.exit();});};return ComponentBuilder;})();function builder(env,symbolTable){return new OpcodeBuilder(symbolTable,env);}function appendOpcode(name,op1,op2,op3){return APPEND_OPCODES.construct(name,null,op1,op2,op3);}var Labels=(function(){function Labels(){this.labels = _glimmerUtil.dict();this.jumps = [];this.ranges = [];}Labels.prototype.label = function label(name,index){this.labels[name] = index;};Labels.prototype.jump = function jump(at,Target,target){this.jumps.push({at:at,target:target,Target:Target});};Labels.prototype.range = function range(at,Range,start,end){this.ranges.push({at:at,start:start,end:end,Range:Range});};Labels.prototype.patch = function patch(constants,opcodes){for(var i=0;i < this.jumps.length;i++) {var _jumps$i=this.jumps[i];var at=_jumps$i.at;var target=_jumps$i.target;var Target=_jumps$i.Target;opcodes.set(at,APPEND_OPCODES.construct(Target,null,this.labels[target]));}for(var i=0;i < this.ranges.length;i++) {var _ranges$i=this.ranges[i];var at=_ranges$i.at;var start=_ranges$i.start;var end=_ranges$i.end;var _Range=_ranges$i.Range;var slice=constants.slice([this.labels[start],this.labels[end] - 1]);opcodes.set(at,APPEND_OPCODES.construct(_Range,null,slice));}};return Labels;})();var BasicOpcodeBuilder=(function(){function BasicOpcodeBuilder(symbolTable,env,program){this.symbolTable = symbolTable;this.env = env;this.program = program;this.labelsStack = new _glimmerUtil.Stack();this.constants = env.constants;this.start = program.next;}BasicOpcodeBuilder.prototype.opcode = function opcode(name,op1,op2,op3){this.push(appendOpcode(name,op1,op2,op3));};BasicOpcodeBuilder.prototype.push = function push(op){ // console.log(`pushing ${op && op.type}`); +if(op === null){this.program.push([0,0,0,0]);}else {this.program.push(op);}};BasicOpcodeBuilder.prototype.toSlice = function toSlice(){return [this.start,this.program.current];}; // helpers +BasicOpcodeBuilder.prototype.startLabels = function startLabels(){this.labelsStack.push(new Labels());};BasicOpcodeBuilder.prototype.stopLabels = function stopLabels(){var label=_glimmerUtil.expect(this.labelsStack.pop(),'unbalanced push and pop labels');label.patch(this.constants,this.program);}; // partials +BasicOpcodeBuilder.prototype.putPartialDefinition = function putPartialDefinition(_definition){var definition=this.constants.other(_definition);this.opcode(50, /* PutPartial */definition);};BasicOpcodeBuilder.prototype.putDynamicPartialDefinition = function putDynamicPartialDefinition(){this.opcode(49, /* PutDynamicPartial */this.constants.other(this.symbolTable));};BasicOpcodeBuilder.prototype.evaluatePartial = function evaluatePartial(){this.opcode(51, /* EvaluatePartial */this.constants.other(this.symbolTable),this.constants.other(_glimmerUtil.dict()));}; // components +BasicOpcodeBuilder.prototype.putComponentDefinition = function putComponentDefinition(definition){this.opcode(23, /* PutComponent */this.other(definition));};BasicOpcodeBuilder.prototype.putDynamicComponentDefinition = function putDynamicComponentDefinition(){this.opcode(22 /* PutDynamicComponent */);};BasicOpcodeBuilder.prototype.openComponent = function openComponent(args,shadow){this.opcode(24, /* OpenComponent */this.args(args),shadow?this.block(shadow):0);};BasicOpcodeBuilder.prototype.didCreateElement = function didCreateElement(){this.opcode(25 /* DidCreateElement */);};BasicOpcodeBuilder.prototype.shadowAttributes = function shadowAttributes(){this.opcode(26 /* ShadowAttributes */);this.opcode(21 /* CloseBlock */);};BasicOpcodeBuilder.prototype.didRenderLayout = function didRenderLayout(){this.opcode(27 /* DidRenderLayout */);};BasicOpcodeBuilder.prototype.closeComponent = function closeComponent(){this.opcode(28 /* CloseComponent */);}; // content +BasicOpcodeBuilder.prototype.dynamicContent = function dynamicContent(Opcode){this.opcode(31, /* DynamicContent */this.other(Opcode));};BasicOpcodeBuilder.prototype.cautiousAppend = function cautiousAppend(){this.dynamicContent(new OptimizedCautiousAppendOpcode());};BasicOpcodeBuilder.prototype.trustingAppend = function trustingAppend(){this.dynamicContent(new OptimizedTrustingAppendOpcode());};BasicOpcodeBuilder.prototype.guardedCautiousAppend = function guardedCautiousAppend(expression){this.dynamicContent(new GuardedCautiousAppendOpcode(this.compileExpression(expression),this.symbolTable));};BasicOpcodeBuilder.prototype.guardedTrustingAppend = function guardedTrustingAppend(expression){this.dynamicContent(new GuardedTrustingAppendOpcode(this.compileExpression(expression),this.symbolTable));}; // dom +BasicOpcodeBuilder.prototype.text = function text(_text){this.opcode(29, /* Text */this.constants.string(_text));};BasicOpcodeBuilder.prototype.openPrimitiveElement = function openPrimitiveElement(tag){this.opcode(32, /* OpenElement */this.constants.string(tag));};BasicOpcodeBuilder.prototype.openComponentElement = function openComponentElement(tag){this.opcode(35, /* OpenComponentElement */this.constants.string(tag));};BasicOpcodeBuilder.prototype.openDynamicPrimitiveElement = function openDynamicPrimitiveElement(){this.opcode(36 /* OpenDynamicElement */);};BasicOpcodeBuilder.prototype.flushElement = function flushElement(){this.opcode(37 /* FlushElement */);};BasicOpcodeBuilder.prototype.closeElement = function closeElement(){this.opcode(38 /* CloseElement */);};BasicOpcodeBuilder.prototype.staticAttr = function staticAttr(_name,_namespace,_value){var name=this.constants.string(_name);var namespace=_namespace?this.constants.string(_namespace):0;var value=this.constants.string(_value);this.opcode(40, /* StaticAttr */name,value,namespace);};BasicOpcodeBuilder.prototype.dynamicAttrNS = function dynamicAttrNS(_name,_namespace,trusting){var name=this.constants.string(_name);var namespace=this.constants.string(_namespace);this.opcode(42, /* DynamicAttrNS */name,namespace,trusting | 0);};BasicOpcodeBuilder.prototype.dynamicAttr = function dynamicAttr(_name,trusting){var name=this.constants.string(_name);this.opcode(43, /* DynamicAttr */name,trusting | 0);};BasicOpcodeBuilder.prototype.comment = function comment(_comment){var comment=this.constants.string(_comment);this.opcode(30, /* Comment */comment);};BasicOpcodeBuilder.prototype.modifier = function modifier(_name,_args){var args=this.constants.expression(this.compile(_args));var _modifierManager=this.env.lookupModifier([_name],this.symbolTable);var modifierManager=this.constants.other(_modifierManager);var name=this.constants.string(_name);this.opcode(41, /* Modifier */name,modifierManager,args);}; // lists +BasicOpcodeBuilder.prototype.putIterator = function putIterator(){this.opcode(44 /* PutIterator */);};BasicOpcodeBuilder.prototype.enterList = function enterList(start,end){this.push(null);this.labels.range(this.pos,45, /* EnterList */start,end);};BasicOpcodeBuilder.prototype.exitList = function exitList(){this.opcode(46 /* ExitList */);};BasicOpcodeBuilder.prototype.enterWithKey = function enterWithKey(start,end){this.push(null);this.labels.range(this.pos,47, /* EnterWithKey */start,end);};BasicOpcodeBuilder.prototype.nextIter = function nextIter(end){this.push(null);this.labels.jump(this.pos,48, /* NextIter */end);}; // vm +BasicOpcodeBuilder.prototype.openBlock = function openBlock(_args,_inner){var args=this.constants.expression(this.compile(_args));var inner=this.constants.other(_inner);this.opcode(20, /* OpenBlock */inner,args);};BasicOpcodeBuilder.prototype.closeBlock = function closeBlock(){this.opcode(21 /* CloseBlock */);};BasicOpcodeBuilder.prototype.pushRemoteElement = function pushRemoteElement(){this.opcode(33 /* PushRemoteElement */);};BasicOpcodeBuilder.prototype.popRemoteElement = function popRemoteElement(){this.opcode(34 /* PopRemoteElement */);};BasicOpcodeBuilder.prototype.popElement = function popElement(){this.opcode(39 /* PopElement */);};BasicOpcodeBuilder.prototype.label = function label(name){this.labels.label(name,this.nextPos);};BasicOpcodeBuilder.prototype.pushChildScope = function pushChildScope(){this.opcode(0 /* PushChildScope */);};BasicOpcodeBuilder.prototype.popScope = function popScope(){this.opcode(1 /* PopScope */);};BasicOpcodeBuilder.prototype.pushDynamicScope = function pushDynamicScope(){this.opcode(2 /* PushDynamicScope */);};BasicOpcodeBuilder.prototype.popDynamicScope = function popDynamicScope(){this.opcode(3 /* PopDynamicScope */);};BasicOpcodeBuilder.prototype.putNull = function putNull(){this.opcode(4, /* Put */this.constants.NULL_REFERENCE);};BasicOpcodeBuilder.prototype.putValue = function putValue(_expression){var expr=this.constants.expression(this.compileExpression(_expression));this.opcode(5, /* EvaluatePut */expr);};BasicOpcodeBuilder.prototype.putArgs = function putArgs(_args){var args=this.constants.expression(this.compile(_args));this.opcode(6, /* PutArgs */args);};BasicOpcodeBuilder.prototype.bindDynamicScope = function bindDynamicScope(_names){this.opcode(12, /* BindDynamicScope */this.names(_names));};BasicOpcodeBuilder.prototype.bindPositionalArgs = function bindPositionalArgs(_names,_symbols){this.opcode(7, /* BindPositionalArgs */this.names(_names),this.symbols(_symbols));};BasicOpcodeBuilder.prototype.bindNamedArgs = function bindNamedArgs(_names,_symbols){this.opcode(8, /* BindNamedArgs */this.names(_names),this.symbols(_symbols));};BasicOpcodeBuilder.prototype.bindBlocks = function bindBlocks(_names,_symbols){this.opcode(9, /* BindBlocks */this.names(_names),this.symbols(_symbols));};BasicOpcodeBuilder.prototype.enter = function enter(_enter,exit){this.push(null);this.labels.range(this.pos,13, /* Enter */_enter,exit);};BasicOpcodeBuilder.prototype.exit = function exit(){this.opcode(14 /* Exit */);};BasicOpcodeBuilder.prototype.evaluate = function evaluate(_block){var block=this.constants.block(_block);this.opcode(15, /* Evaluate */block);};BasicOpcodeBuilder.prototype.test = function test(testFunc){var _func=undefined;if(testFunc === 'const'){_func = ConstTest;}else if(testFunc === 'simple'){_func = SimpleTest;}else if(testFunc === 'environment'){_func = EnvironmentTest;}else if(typeof testFunc === 'function'){_func = testFunc;}else {throw new Error('unreachable');}var func=this.constants.function(_func);this.opcode(19, /* Test */func);};BasicOpcodeBuilder.prototype.jump = function jump(target){this.push(null);this.labels.jump(this.pos,16, /* Jump */target);};BasicOpcodeBuilder.prototype.jumpIf = function jumpIf(target){this.push(null);this.labels.jump(this.pos,17, /* JumpIf */target);};BasicOpcodeBuilder.prototype.jumpUnless = function jumpUnless(target){this.push(null);this.labels.jump(this.pos,18, /* JumpUnless */target);};BasicOpcodeBuilder.prototype.names = function names(_names){var _this=this;var names=_names.map(function(n){return _this.constants.string(n);});return this.constants.array(names);};BasicOpcodeBuilder.prototype.symbols = function symbols(_symbols2){return this.constants.array(_symbols2);};BasicOpcodeBuilder.prototype.other = function other(value){return this.constants.other(value);};BasicOpcodeBuilder.prototype.args = function args(_args2){return this.constants.expression(this.compile(_args2));};BasicOpcodeBuilder.prototype.block = function block(_block3){return this.constants.block(_block3);};babelHelpers.createClass(BasicOpcodeBuilder,[{key:'pos',get:function(){return this.program.current;}},{key:'nextPos',get:function(){return this.program.next;}},{key:'labels',get:function(){return _glimmerUtil.expect(this.labelsStack.current,'bug: not in a label stack');}}]);return BasicOpcodeBuilder;})();function isCompilableExpression(expr){return expr && typeof expr['compile'] === 'function';}var OpcodeBuilder=(function(_BasicOpcodeBuilder){babelHelpers.inherits(OpcodeBuilder,_BasicOpcodeBuilder);function OpcodeBuilder(symbolTable,env){var program=arguments.length <= 2 || arguments[2] === undefined?env.program:arguments[2];return (function(){_BasicOpcodeBuilder.call(this,symbolTable,env,program);this.component = new ComponentBuilder(this);}).apply(this,arguments);}OpcodeBuilder.prototype.compile = function compile(expr){if(isCompilableExpression(expr)){return expr.compile(this);}else {return expr;}};OpcodeBuilder.prototype.compileExpression = function compileExpression(expression){if(expression instanceof CompiledExpression){return expression;}else {return expr(expression,this);}};OpcodeBuilder.prototype.bindPositionalArgsForLocals = function bindPositionalArgsForLocals(locals){var symbols=Object.keys(locals).map(function(name){return locals[name];});this.opcode(7, /* BindPositionalArgs */this.symbols(symbols));};OpcodeBuilder.prototype.preludeForLayout = function preludeForLayout(layout){var _this2=this;var symbols=layout.symbolTable.getSymbols();if(symbols.named){(function(){var named=symbols.named;var namedNames=Object.keys(named);var namedSymbols=namedNames.map(function(n){return named[n];});_this2.opcode(8, /* BindNamedArgs */_this2.names(namedNames),_this2.symbols(namedSymbols));})();}this.opcode(11 /* BindCallerScope */);if(symbols.yields){(function(){var yields=symbols.yields;var yieldNames=Object.keys(yields);var yieldSymbols=yieldNames.map(function(n){return yields[n];});_this2.opcode(9, /* BindBlocks */_this2.names(yieldNames),_this2.symbols(yieldSymbols));})();}if(symbols.partialArgs){this.opcode(10, /* BindPartialArgs */symbols.partialArgs);}};OpcodeBuilder.prototype.yield = function _yield(args,to){var yields=undefined,partial=undefined;var inner=undefined;if(yields = this.symbolTable.getSymbol('yields',to)){inner = new CompiledGetBlockBySymbol(yields,to);}else if(partial = this.symbolTable.getPartialArgs()){inner = new CompiledInPartialGetBlock(partial,to);}else {throw new Error('[BUG] ${to} is not a valid block name.');}this.openBlock(args,inner);this.closeBlock();}; // TODO +// come back to this +OpcodeBuilder.prototype.labelled = function labelled(args,callback){if(args)this.putArgs(args);this.startLabels();this.enter('BEGIN','END');this.label('BEGIN');callback(this,'BEGIN','END');this.label('END');this.exit();this.stopLabels();}; // TODO +// come back to this +OpcodeBuilder.prototype.iter = function iter(callback){this.startLabels();this.enterList('BEGIN','END');this.label('ITER');this.nextIter('BREAK');this.enterWithKey('BEGIN','END');this.label('BEGIN');callback(this,'BEGIN','END');this.label('END');this.exit();this.jump('ITER');this.label('BREAK');this.exitList();this.stopLabels();}; // TODO +// come back to this +OpcodeBuilder.prototype.unit = function unit(callback){this.startLabels();callback(this);this.stopLabels();};return OpcodeBuilder;})(BasicOpcodeBuilder);APPEND_OPCODES.add(31, /* DynamicContent */function(vm,_ref31){var append=_ref31.op1;var opcode=vm.constants.getOther(append);opcode.evaluate(vm);});function isEmpty(value){return value === null || value === undefined || typeof value['toString'] !== 'function';}function normalizeTextValue(value){if(isEmpty(value)){return '';}return String(value);}function normalizeTrustedValue(value){if(isEmpty(value)){return '';}if(isString(value)){return value;}if(isSafeString(value)){return value.toHTML();}if(isNode(value)){return value;}return String(value);}function normalizeValue(value){if(isEmpty(value)){return '';}if(isString(value)){return value;}if(isSafeString(value) || isNode(value)){return value;}return String(value);}var AppendDynamicOpcode=(function(){function AppendDynamicOpcode(){}AppendDynamicOpcode.prototype.evaluate = function evaluate(vm){var reference=vm.frame.getOperand();var normalized=this.normalize(reference);var value=undefined,cache=undefined;if(_glimmerReference.isConst(reference)){value = normalized.value();}else {cache = new _glimmerReference.ReferenceCache(normalized);value = cache.peek();}var stack=vm.stack();var upsert=this.insert(vm.env.getAppendOperations(),stack,value);var bounds=new Fragment(upsert.bounds);stack.newBounds(bounds);if(cache /* i.e. !isConst(reference) */){vm.updateWith(this.updateWith(vm,reference,cache,bounds,upsert));}};return AppendDynamicOpcode;})();var GuardedAppendOpcode=(function(_AppendDynamicOpcode){babelHelpers.inherits(GuardedAppendOpcode,_AppendDynamicOpcode);function GuardedAppendOpcode(expression,symbolTable){_AppendDynamicOpcode.call(this);this.expression = expression;this.symbolTable = symbolTable;this.deopted = null;}GuardedAppendOpcode.prototype.evaluate = function evaluate(vm){if(this.deopted){vm.pushEvalFrame(this.deopted);}else {vm.evaluateOperand(this.expression);var value=vm.frame.getOperand().value();if(isComponentDefinition(value)){vm.pushEvalFrame(this.deopt(vm.env));}else {_AppendDynamicOpcode.prototype.evaluate.call(this,vm);}}};GuardedAppendOpcode.prototype.deopt = function deopt(env){var _this3=this; // At compile time, we determined that this append callsite might refer +// to a local variable/property lookup that resolves to a component +// definition at runtime. +// +// We could have eagerly compiled this callsite into something like this: +// +// {{#if (is-component-definition foo)}} +// {{component foo}} +// {{else}} +// {{foo}} +// {{/if}} +// +// However, in practice, there might be a large amout of these callsites +// and most of them would resolve to a simple value lookup. Therefore, we +// tried to be optimistic and assumed that the callsite will resolve to +// appending a simple value. +// +// However, we have reached here because at runtime, the guard conditional +// have detected that this callsite is indeed referring to a component +// definition object. Since this is likely going to be true for other +// instances of the same callsite, it is now appropiate to deopt into the +// expanded version that handles both cases. The compilation would look +// like this: +// +// PutValue(expression) +// Test(is-component-definition) +// Enter(BEGIN, END) +// BEGIN: Noop +// JumpUnless(VALUE) +// PutDynamicComponentDefinitionOpcode +// OpenComponent +// CloseComponent +// Jump(END) +// VALUE: Noop +// OptimizedAppend +// END: Noop +// Exit +// +// Keep in mind that even if we *don't* reach here at initial render time, +// it is still possible (although quite rare) that the simple value we +// encounter during initial render could later change into a component +// definition object at update time. That is handled by the "lazy deopt" +// code on the update side (scroll down for the next big block of comment). +var dsl=new OpcodeBuilder(this.symbolTable,env);dsl.putValue(this.expression);dsl.test(IsComponentDefinitionReference.create);dsl.labelled(null,function(dsl,_BEGIN,END){dsl.jumpUnless('VALUE');dsl.putDynamicComponentDefinition();dsl.openComponent(CompiledArgs.empty());dsl.closeComponent();dsl.jump(END);dsl.label('VALUE');dsl.dynamicContent(new _this3.AppendOpcode());});var deopted=this.deopted = dsl.toSlice(); // From this point on, we have essentially replaced ourselves with a new set +// of opcodes. Since we will always be executing the new/deopted code, it's +// a good idea (as a pattern) to null out any unneeded fields here to avoid +// holding on to unneeded/stale objects: +// QUESTION: Shouldn't this whole object be GCed? If not, why not? +this.expression = null;return deopted;};return GuardedAppendOpcode;})(AppendDynamicOpcode);var IsComponentDefinitionReference=(function(_ConditionalReference){babelHelpers.inherits(IsComponentDefinitionReference,_ConditionalReference);function IsComponentDefinitionReference(){_ConditionalReference.apply(this,arguments);}IsComponentDefinitionReference.create = function create(inner){return new IsComponentDefinitionReference(inner);};IsComponentDefinitionReference.prototype.toBool = function toBool(value){return isComponentDefinition(value);};return IsComponentDefinitionReference;})(ConditionalReference);var UpdateOpcode=(function(_UpdatingOpcode9){babelHelpers.inherits(UpdateOpcode,_UpdatingOpcode9);function UpdateOpcode(cache,bounds,upsert){_UpdatingOpcode9.call(this);this.cache = cache;this.bounds = bounds;this.upsert = upsert;this.tag = cache.tag;}UpdateOpcode.prototype.evaluate = function evaluate(vm){var value=this.cache.revalidate();if(_glimmerReference.isModified(value)){var bounds=this.bounds;var upsert=this.upsert;var dom=vm.dom;if(!this.upsert.update(dom,value)){var cursor=new Cursor(bounds.parentElement(),clear(bounds));upsert = this.upsert = this.insert(vm.env.getAppendOperations(),cursor,value);}bounds.update(upsert.bounds);}};UpdateOpcode.prototype.toJSON = function toJSON(){var guid=this._guid;var type=this.type;var cache=this.cache;return {guid:guid,type:type,details:{lastValue:JSON.stringify(cache.peek())}};};return UpdateOpcode;})(UpdatingOpcode);var GuardedUpdateOpcode=(function(_UpdateOpcode){babelHelpers.inherits(GuardedUpdateOpcode,_UpdateOpcode);function GuardedUpdateOpcode(reference,cache,bounds,upsert,appendOpcode,state){_UpdateOpcode.call(this,cache,bounds,upsert);this.reference = reference;this.appendOpcode = appendOpcode;this.state = state;this.deopted = null;this.tag = this._tag = new _glimmerReference.UpdatableTag(this.tag);}GuardedUpdateOpcode.prototype.evaluate = function evaluate(vm){if(this.deopted){vm.evaluateOpcode(this.deopted);}else {if(isComponentDefinition(this.reference.value())){this.lazyDeopt(vm);}else {_UpdateOpcode.prototype.evaluate.call(this,vm);}}};GuardedUpdateOpcode.prototype.lazyDeopt = function lazyDeopt(vm){ // Durign initial render, we know that the reference does not contain a +// component definition, so we optimistically assumed that this append +// is just a normal append. However, at update time, we discovered that +// the reference has switched into containing a component definition, so +// we need to do a "lazy deopt", simulating what would have happened if +// we had decided to perform the deopt in the first place during initial +// render. +// +// More concretely, we would have expanded the curly into a if/else, and +// based on whether the value is a component definition or not, we would +// have entered either the dynamic component branch or the simple value +// branch. +// +// Since we rendered a simple value during initial render (and all the +// updates up until this point), we need to pretend that the result is +// produced by the "VALUE" branch of the deopted append opcode: +// +// Try(BEGIN, END) +// Assert(IsComponentDefinition, expected=false) +// OptimizedUpdate +// +// In this case, because the reference has switched from being a simple +// value into a component definition, what would have happened is that +// the assert would throw, causing the Try opcode to teardown the bounds +// and rerun the original append opcode. +// +// Since the Try opcode would have nuked the updating opcodes anyway, we +// wouldn't have to worry about simulating those. All we have to do is to +// execute the Try opcode and immediately throw. +var bounds=this.bounds;var appendOpcode=this.appendOpcode;var state=this.state;var env=vm.env;var slice=appendOpcode.deopt(env);var enter=_glimmerUtil.expect(env.program.opcode(slice[0] + 8),'hardcoded deopt location');var ops=vm.constants.getSlice(enter.op1);var tracker=new UpdatableBlockTracker(bounds.parentElement());tracker.newBounds(this.bounds);var children=new _glimmerUtil.LinkedList();state.frame['condition'] = IsComponentDefinitionReference.create(_glimmerUtil.expect(state.frame['operand'],'operand should be populated'));var deopted=this.deopted = new TryOpcode(ops,state,tracker,children);this._tag.update(deopted.tag);vm.evaluateOpcode(deopted);vm.throw(); // From this point on, we have essentially replaced ourselve with a new +// opcode. Since we will always be executing the new/deopted code, it's a +// good idea (as a pattern) to null out any unneeded fields here to avoid +// holding on to unneeded/stale objects: +// QUESTION: Shouldn't this whole object be GCed? If not, why not? +this._tag = null;this.reference = null;this.cache = null;this.bounds = null;this.upsert = null;this.appendOpcode = null;this.state = null;};GuardedUpdateOpcode.prototype.toJSON = function toJSON(){var guid=this._guid;var type=this.type;var deopted=this.deopted;if(deopted){return {guid:guid,type:type,deopted:true,children:[deopted.toJSON()]};}else {return _UpdateOpcode.prototype.toJSON.call(this);}};return GuardedUpdateOpcode;})(UpdateOpcode);var OptimizedCautiousAppendOpcode=(function(_AppendDynamicOpcode2){babelHelpers.inherits(OptimizedCautiousAppendOpcode,_AppendDynamicOpcode2);function OptimizedCautiousAppendOpcode(){_AppendDynamicOpcode2.apply(this,arguments);this.type = 'optimized-cautious-append';}OptimizedCautiousAppendOpcode.prototype.normalize = function normalize(reference){return _glimmerReference.map(reference,normalizeValue);};OptimizedCautiousAppendOpcode.prototype.insert = function insert(dom,cursor,value){return cautiousInsert(dom,cursor,value);};OptimizedCautiousAppendOpcode.prototype.updateWith = function updateWith(_vm,_reference,cache,bounds,upsert){return new OptimizedCautiousUpdateOpcode(cache,bounds,upsert);};return OptimizedCautiousAppendOpcode;})(AppendDynamicOpcode);var OptimizedCautiousUpdateOpcode=(function(_UpdateOpcode2){babelHelpers.inherits(OptimizedCautiousUpdateOpcode,_UpdateOpcode2);function OptimizedCautiousUpdateOpcode(){_UpdateOpcode2.apply(this,arguments);this.type = 'optimized-cautious-update';}OptimizedCautiousUpdateOpcode.prototype.insert = function insert(dom,cursor,value){return cautiousInsert(dom,cursor,value);};return OptimizedCautiousUpdateOpcode;})(UpdateOpcode);var GuardedCautiousAppendOpcode=(function(_GuardedAppendOpcode){babelHelpers.inherits(GuardedCautiousAppendOpcode,_GuardedAppendOpcode);function GuardedCautiousAppendOpcode(){_GuardedAppendOpcode.apply(this,arguments);this.type = 'guarded-cautious-append';this.AppendOpcode = OptimizedCautiousAppendOpcode;}GuardedCautiousAppendOpcode.prototype.normalize = function normalize(reference){return _glimmerReference.map(reference,normalizeValue);};GuardedCautiousAppendOpcode.prototype.insert = function insert(dom,cursor,value){return cautiousInsert(dom,cursor,value);};GuardedCautiousAppendOpcode.prototype.updateWith = function updateWith(vm,reference,cache,bounds,upsert){return new GuardedCautiousUpdateOpcode(reference,cache,bounds,upsert,this,vm.capture());};return GuardedCautiousAppendOpcode;})(GuardedAppendOpcode);var GuardedCautiousUpdateOpcode=(function(_GuardedUpdateOpcode){babelHelpers.inherits(GuardedCautiousUpdateOpcode,_GuardedUpdateOpcode);function GuardedCautiousUpdateOpcode(){_GuardedUpdateOpcode.apply(this,arguments);this.type = 'guarded-cautious-update';}GuardedCautiousUpdateOpcode.prototype.insert = function insert(dom,cursor,value){return cautiousInsert(dom,cursor,value);};return GuardedCautiousUpdateOpcode;})(GuardedUpdateOpcode);var OptimizedTrustingAppendOpcode=(function(_AppendDynamicOpcode3){babelHelpers.inherits(OptimizedTrustingAppendOpcode,_AppendDynamicOpcode3);function OptimizedTrustingAppendOpcode(){_AppendDynamicOpcode3.apply(this,arguments);this.type = 'optimized-trusting-append';}OptimizedTrustingAppendOpcode.prototype.normalize = function normalize(reference){return _glimmerReference.map(reference,normalizeTrustedValue);};OptimizedTrustingAppendOpcode.prototype.insert = function insert(dom,cursor,value){return trustingInsert(dom,cursor,value);};OptimizedTrustingAppendOpcode.prototype.updateWith = function updateWith(_vm,_reference,cache,bounds,upsert){return new OptimizedTrustingUpdateOpcode(cache,bounds,upsert);};return OptimizedTrustingAppendOpcode;})(AppendDynamicOpcode);var OptimizedTrustingUpdateOpcode=(function(_UpdateOpcode3){babelHelpers.inherits(OptimizedTrustingUpdateOpcode,_UpdateOpcode3);function OptimizedTrustingUpdateOpcode(){_UpdateOpcode3.apply(this,arguments);this.type = 'optimized-trusting-update';}OptimizedTrustingUpdateOpcode.prototype.insert = function insert(dom,cursor,value){return trustingInsert(dom,cursor,value);};return OptimizedTrustingUpdateOpcode;})(UpdateOpcode);var GuardedTrustingAppendOpcode=(function(_GuardedAppendOpcode2){babelHelpers.inherits(GuardedTrustingAppendOpcode,_GuardedAppendOpcode2);function GuardedTrustingAppendOpcode(){_GuardedAppendOpcode2.apply(this,arguments);this.type = 'guarded-trusting-append';this.AppendOpcode = OptimizedTrustingAppendOpcode;}GuardedTrustingAppendOpcode.prototype.normalize = function normalize(reference){return _glimmerReference.map(reference,normalizeTrustedValue);};GuardedTrustingAppendOpcode.prototype.insert = function insert(dom,cursor,value){return trustingInsert(dom,cursor,value);};GuardedTrustingAppendOpcode.prototype.updateWith = function updateWith(vm,reference,cache,bounds,upsert){return new GuardedTrustingUpdateOpcode(reference,cache,bounds,upsert,this,vm.capture());};return GuardedTrustingAppendOpcode;})(GuardedAppendOpcode);var GuardedTrustingUpdateOpcode=(function(_GuardedUpdateOpcode2){babelHelpers.inherits(GuardedTrustingUpdateOpcode,_GuardedUpdateOpcode2);function GuardedTrustingUpdateOpcode(){_GuardedUpdateOpcode2.apply(this,arguments);this.type = 'trusting-update';}GuardedTrustingUpdateOpcode.prototype.insert = function insert(dom,cursor,value){return trustingInsert(dom,cursor,value);};return GuardedTrustingUpdateOpcode;})(GuardedUpdateOpcode);APPEND_OPCODES.add(49, /* PutDynamicPartial */function(vm,_ref32){var _symbolTable=_ref32.op1;var env=vm.env;var symbolTable=vm.constants.getOther(_symbolTable);function lookupPartial(name){var normalized=String(name);if(!env.hasPartial(normalized,symbolTable)){throw new Error('Could not find a partial named "' + normalized + '"');}return env.lookupPartial(normalized,symbolTable);}var reference=_glimmerReference.map(vm.frame.getOperand(),lookupPartial);var cache=_glimmerReference.isConst(reference)?undefined:new _glimmerReference.ReferenceCache(reference);var definition=cache?cache.peek():reference.value();vm.frame.setImmediate(definition);if(cache){vm.updateWith(new Assert(cache));}});APPEND_OPCODES.add(50, /* PutPartial */function(vm,_ref33){var _definition=_ref33.op1;var definition=vm.constants.getOther(_definition);vm.frame.setImmediate(definition);});APPEND_OPCODES.add(51, /* EvaluatePartial */function(vm,_ref34){var _symbolTable=_ref34.op1;var _cache=_ref34.op2;var symbolTable=vm.constants.getOther(_symbolTable);var cache=vm.constants.getOther(_cache);var _vm$frame$getImmediate=vm.frame.getImmediate();var template=_vm$frame$getImmediate.template;var block=cache[template.id];if(!block){block = template.asPartial(symbolTable);}vm.invokePartial(block);});var IterablePresenceReference=(function(){function IterablePresenceReference(artifacts){this.tag = artifacts.tag;this.artifacts = artifacts;}IterablePresenceReference.prototype.value = function value(){return !this.artifacts.isEmpty();};return IterablePresenceReference;})();APPEND_OPCODES.add(44, /* PutIterator */function(vm){var listRef=vm.frame.getOperand();var args=_glimmerUtil.expect(vm.frame.getArgs(),'PutIteratorOpcode expects a populated args register');var iterable=vm.env.iterableFor(listRef,args);var iterator=new _glimmerReference.ReferenceIterator(iterable);vm.frame.setIterator(iterator);vm.frame.setCondition(new IterablePresenceReference(iterator.artifacts));});APPEND_OPCODES.add(45, /* EnterList */function(vm,_ref35){var _slice=_ref35.op1;vm.enterList(vm.constants.getSlice(_slice));});APPEND_OPCODES.add(46, /* ExitList */function(vm){return vm.exitList();});APPEND_OPCODES.add(47, /* EnterWithKey */function(vm,_ref36){var _slice=_ref36.op2;var key=_glimmerUtil.expect(vm.frame.getKey(),'EnterWithKeyOpcode expects a populated key register');var slice=vm.constants.getSlice(_slice);vm.enterWithKey(key,slice);});var TRUE_REF=new _glimmerReference.ConstReference(true);var FALSE_REF=new _glimmerReference.ConstReference(false);APPEND_OPCODES.add(48, /* NextIter */function(vm,_ref37){var end=_ref37.op1;var item=vm.frame.getIterator().next();if(item){vm.frame.setCondition(TRUE_REF);vm.frame.setKey(item.key);vm.frame.setOperand(item.value);vm.frame.setArgs(EvaluatedArgs.positional([item.value,item.memo]));}else {vm.frame.setCondition(FALSE_REF);vm.goto(end);}});var clientId=0;function templateFactory(_ref38){var templateId=_ref38.id;var meta=_ref38.meta;var block=_ref38.block;var parsedBlock=undefined;var id=templateId || 'client-' + clientId++;var create=function(env,envMeta){var newMeta=envMeta?_glimmerUtil.assign({},envMeta,meta):meta;if(!parsedBlock){parsedBlock = JSON.parse(block);}return template(parsedBlock,id,newMeta,env);};return {id:id,meta:meta,create:create};}function template(block,id,meta,env){var scanner=new Scanner(block,meta,env);var entryPoint=undefined;var asEntryPoint=function(){if(!entryPoint)entryPoint = scanner.scanEntryPoint();return entryPoint;};var layout=undefined;var asLayout=function(){if(!layout)layout = scanner.scanLayout();return layout;};var asPartial=function(symbols){return scanner.scanPartial(symbols);};var render=function(self,appendTo,dynamicScope){var elementStack=ElementStack.forInitialRender(env,appendTo,null);var compiled=asEntryPoint().compile(env);var vm=VM.initial(env,self,dynamicScope,elementStack,compiled.symbols);return vm.execute(compiled.slice);};return {id:id,meta:meta,_block:block,asEntryPoint:asEntryPoint,asLayout:asLayout,asPartial:asPartial,render:render};}var DynamicVarReference=(function(){function DynamicVarReference(scope,nameRef){this.scope = scope;this.nameRef = nameRef;var varTag=this.varTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG);this.tag = _glimmerReference.combine([nameRef.tag,varTag]);}DynamicVarReference.prototype.value = function value(){return this.getVar().value();};DynamicVarReference.prototype.get = function get(key){return this.getVar().get(key);};DynamicVarReference.prototype.getVar = function getVar(){var name=String(this.nameRef.value());var ref=this.scope.get(name);this.varTag.update(ref.tag);return ref;};return DynamicVarReference;})();function getDynamicVar(vm,args,_symbolTable){var scope=vm.dynamicScope();var nameRef=args.positional.at(0);return new DynamicVarReference(scope,nameRef);}var PartialDefinition=function PartialDefinition(name,template){this.name = name;this.template = template;};var NodeType;(function(NodeType){NodeType[NodeType["Element"] = 0] = "Element";NodeType[NodeType["Attribute"] = 1] = "Attribute";NodeType[NodeType["Text"] = 2] = "Text";NodeType[NodeType["CdataSection"] = 3] = "CdataSection";NodeType[NodeType["EntityReference"] = 4] = "EntityReference";NodeType[NodeType["Entity"] = 5] = "Entity";NodeType[NodeType["ProcessingInstruction"] = 6] = "ProcessingInstruction";NodeType[NodeType["Comment"] = 7] = "Comment";NodeType[NodeType["Document"] = 8] = "Document";NodeType[NodeType["DocumentType"] = 9] = "DocumentType";NodeType[NodeType["DocumentFragment"] = 10] = "DocumentFragment";NodeType[NodeType["Notation"] = 11] = "Notation";})(NodeType || (NodeType = {}));var Simple=Object.freeze({get NodeType(){return NodeType;}});exports.Simple = Simple;exports.templateFactory = templateFactory;exports.NULL_REFERENCE = NULL_REFERENCE;exports.UNDEFINED_REFERENCE = UNDEFINED_REFERENCE;exports.PrimitiveReference = PrimitiveReference;exports.ConditionalReference = ConditionalReference;exports.OpcodeBuilderDSL = OpcodeBuilder;exports.compileLayout = compileLayout;exports.CompiledBlock = CompiledBlock;exports.CompiledProgram = CompiledProgram;exports.IAttributeManager = AttributeManager;exports.AttributeManager = AttributeManager;exports.PropertyManager = PropertyManager;exports.INPUT_VALUE_PROPERTY_MANAGER = INPUT_VALUE_PROPERTY_MANAGER;exports.defaultManagers = defaultManagers;exports.defaultAttributeManagers = defaultAttributeManagers;exports.defaultPropertyManagers = defaultPropertyManagers;exports.readDOMAttr = readDOMAttr;exports.normalizeTextValue = normalizeTextValue;exports.CompiledExpression = CompiledExpression;exports.CompiledArgs = CompiledArgs;exports.CompiledNamedArgs = CompiledNamedArgs;exports.CompiledPositionalArgs = CompiledPositionalArgs;exports.EvaluatedArgs = EvaluatedArgs;exports.EvaluatedNamedArgs = EvaluatedNamedArgs;exports.EvaluatedPositionalArgs = EvaluatedPositionalArgs;exports.getDynamicVar = getDynamicVar;exports.BlockMacros = Blocks;exports.InlineMacros = Inlines;exports.compileArgs = compileArgs;exports.setDebuggerCallback = setDebuggerCallback;exports.resetDebuggerCallback = resetDebuggerCallback;exports.BaselineSyntax = BaselineSyntax;exports.Layout = Layout;exports.UpdatingVM = UpdatingVM;exports.RenderResult = RenderResult;exports.isSafeString = isSafeString;exports.Scope = Scope;exports.Environment = Environment;exports.PartialDefinition = PartialDefinition;exports.ComponentDefinition = ComponentDefinition;exports.isComponentDefinition = isComponentDefinition;exports.DOMChanges = helper$1;exports.IDOMChanges = DOMChanges;exports.DOMTreeConstruction = DOMTreeConstruction;exports.isWhitespace = isWhitespace;exports.insertHTMLBefore = _insertHTMLBefore;exports.ElementStack = ElementStack;exports.ConcreteBounds = ConcreteBounds;}); +enifed('@glimmer/syntax', ['exports', 'handlebars', 'simple-html-tokenizer'], function (exports, _handlebars, _simpleHtmlTokenizer) { + 'use strict'; - /** - @method toString - @return {String} string representation of binding - @public - */ - toString: function () { - var oneWay = this._oneWay ? '[oneWay]' : ''; - return 'Ember.Binding<' + _emberUtils.guidFor(this) + '>(' + this._from + ' -> ' + this._to + ')' + oneWay; - }, - - // .......................................................... - // CONNECT AND SYNC - // - - /** - Attempts to connect this binding instance so that it can receive and relay - changes. This method will raise an exception if you have not set the - from/to properties yet. - @method connect - @param {Object} obj The root object for this binding. - @return {Ember.Binding} `this` - @public - */ - connect: function (obj) { - _emberMetalDebug.assert('Must pass a valid object to Ember.Binding.connect()', !!obj); - - var fromObj = undefined, - fromPath = undefined, - possibleGlobal = undefined; - - // If the binding's "from" path could be interpreted as a global, verify - // whether the path refers to a global or not by consulting `Ember.lookup`. - if (_emberMetalPath_cache.isGlobalPath(this._from)) { - var _name = _emberMetalPath_cache.getFirstKey(this._from); - possibleGlobal = _emberEnvironment.context.lookup[_name]; - - if (possibleGlobal) { - fromObj = possibleGlobal; - fromPath = _emberMetalPath_cache.getTailPath(this._from); - } - } - - if (fromObj === undefined) { - fromObj = obj; - fromPath = this._from; - } - - _emberMetalProperty_set.trySet(obj, this._to, _emberMetalProperty_get.get(fromObj, fromPath)); - - // Add an observer on the object to be notified when the binding should be updated. - _emberMetalObserver.addObserver(fromObj, fromPath, this, 'fromDidChange'); - - // If the binding is a two-way binding, also set up an observer on the target. - if (!this._oneWay) { - _emberMetalObserver.addObserver(obj, this._to, this, 'toDidChange'); - } - - _emberMetalEvents.addListener(obj, 'willDestroy', this, 'disconnect'); - - fireDeprecations(obj, this._to, this._from, possibleGlobal, this._oneWay, !possibleGlobal && !this._oneWay); - - this._readyToSync = true; - this._fromObj = fromObj; - this._fromPath = fromPath; - this._toObj = obj; - - return this; - }, - - /** - Disconnects the binding instance. Changes will no longer be relayed. You - will not usually need to call this method. - @method disconnect - @return {Ember.Binding} `this` - @public - */ - disconnect: function () { - _emberMetalDebug.assert('Must pass a valid object to Ember.Binding.disconnect()', !!this._toObj); - - // Remove an observer on the object so we're no longer notified of - // changes that should update bindings. - _emberMetalObserver.removeObserver(this._fromObj, this._fromPath, this, 'fromDidChange'); - - // If the binding is two-way, remove the observer from the target as well. - if (!this._oneWay) { - _emberMetalObserver.removeObserver(this._toObj, this._to, this, 'toDidChange'); - } - - this._readyToSync = false; // Disable scheduled syncs... - return this; - }, - - // .......................................................... - // PRIVATE - // - - /* Called when the from side changes. */ - fromDidChange: function (target) { - this._scheduleSync('fwd'); - }, - - /* Called when the to side changes. */ - toDidChange: function (target) { - this._scheduleSync('back'); - }, - - _scheduleSync: function (dir) { - var existingDir = this._direction; - - // If we haven't scheduled the binding yet, schedule it. - if (existingDir === undefined) { - _emberMetalRun_loop.default.schedule('sync', this, '_sync'); - this._direction = dir; - } - - // If both a 'back' and 'fwd' sync have been scheduled on the same object, - // default to a 'fwd' sync so that it remains deterministic. - if (existingDir === 'back' && dir === 'fwd') { - this._direction = 'fwd'; - } - }, - - _sync: function () { - var log = _emberEnvironment.ENV.LOG_BINDINGS; - - var toObj = this._toObj; - - // Don't synchronize destroyed objects or disconnected bindings. - if (toObj.isDestroyed || !this._readyToSync) { - return; - } - - // Get the direction of the binding for the object we are - // synchronizing from. - var direction = this._direction; - - var fromObj = this._fromObj; - var fromPath = this._fromPath; - - this._direction = undefined; - - // If we're synchronizing from the remote object... - if (direction === 'fwd') { - var fromValue = _emberMetalProperty_get.get(fromObj, fromPath); - if (log) { - _emberConsole.default.log(' ', this.toString(), '->', fromValue, fromObj); - } - if (this._oneWay) { - _emberMetalProperty_set.trySet(toObj, this._to, fromValue); - } else { - _emberMetalObserver._suspendObserver(toObj, this._to, this, 'toDidChange', function () { - _emberMetalProperty_set.trySet(toObj, this._to, fromValue); - }); - } - // If we're synchronizing *to* the remote object. - } else if (direction === 'back') { - var toValue = _emberMetalProperty_get.get(toObj, this._to); - if (log) { - _emberConsole.default.log(' ', this.toString(), '<-', toValue, toObj); - } - _emberMetalObserver._suspendObserver(fromObj, fromPath, this, 'fromDidChange', function () { - _emberMetalProperty_set.trySet(fromObj, fromPath, toValue); - }); - } - } - - }; - - function fireDeprecations(obj, toPath, fromPath, deprecateGlobal, deprecateOneWay, deprecateAlias) { - var deprecateGlobalMessage = '`Ember.Binding` is deprecated. Since you' + ' are binding to a global consider using a service instead.'; - var deprecateOneWayMessage = '`Ember.Binding` is deprecated. Since you' + ' are using a `oneWay` binding consider using a `readOnly` computed' + ' property instead.'; - var deprecateAliasMessage = '`Ember.Binding` is deprecated. Consider' + ' using an `alias` computed property instead.'; - - var objectInfo = 'The `' + toPath + '` property of `' + obj + '` is an `Ember.Binding` connected to `' + fromPath + '`, but '; - _emberMetalDebug.deprecate(objectInfo + deprecateGlobalMessage, !deprecateGlobal, { - id: 'ember-metal.binding', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x#toc_ember-binding' - }); - _emberMetalDebug.deprecate(objectInfo + deprecateOneWayMessage, !deprecateOneWay, { - id: 'ember-metal.binding', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x#toc_ember-binding' - }); - _emberMetalDebug.deprecate(objectInfo + deprecateAliasMessage, !deprecateAlias, { - id: 'ember-metal.binding', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x#toc_ember-binding' - }); - } - - function mixinProperties(to, from) { - for (var key in from) { - if (from.hasOwnProperty(key)) { - to[key] = from[key]; - } - } - } - - mixinProperties(Binding, { - - /* - See `Ember.Binding.from`. - @method from - @static - */ - from: function (from) { - var C = this; - return new C(undefined, from); - }, - - /* - See `Ember.Binding.to`. - @method to - @static - */ - to: function (to) { - var C = this; - return new C(to, undefined); - } - }); - /** - An `Ember.Binding` connects the properties of two objects so that whenever - the value of one property changes, the other property will be changed also. - - ## Automatic Creation of Bindings with `/^*Binding/`-named Properties. - - You do not usually create Binding objects directly but instead describe - bindings in your class or object definition using automatic binding - detection. - - Properties ending in a `Binding` suffix will be converted to `Ember.Binding` - instances. The value of this property should be a string representing a path - to another object or a custom binding instance created using Binding helpers - (see "One Way Bindings"): - - ``` - valueBinding: "MyApp.someController.title" - ``` - - This will create a binding from `MyApp.someController.title` to the `value` - property of your object instance automatically. Now the two values will be - kept in sync. - - ## One Way Bindings - - One especially useful binding customization you can use is the `oneWay()` - helper. This helper tells Ember that you are only interested in - receiving changes on the object you are binding from. For example, if you - are binding to a preference and you want to be notified if the preference - has changed, but your object will not be changing the preference itself, you - could do: - - ``` - bigTitlesBinding: Ember.Binding.oneWay("MyApp.preferencesController.bigTitles") - ``` - - This way if the value of `MyApp.preferencesController.bigTitles` changes the - `bigTitles` property of your object will change also. However, if you - change the value of your `bigTitles` property, it will not update the - `preferencesController`. - - One way bindings are almost twice as fast to setup and twice as fast to - execute because the binding only has to worry about changes to one side. - - You should consider using one way bindings anytime you have an object that - may be created frequently and you do not intend to change a property; only - to monitor it for changes (such as in the example above). - - ## Adding Bindings Manually - - All of the examples above show you how to configure a custom binding, but the - result of these customizations will be a binding template, not a fully active - Binding instance. The binding will actually become active only when you - instantiate the object the binding belongs to. It is useful, however, to - understand what actually happens when the binding is activated. - - For a binding to function it must have at least a `from` property and a `to` - property. The `from` property path points to the object/key that you want to - bind from while the `to` path points to the object/key you want to bind to. - - When you define a custom binding, you are usually describing the property - you want to bind from (such as `MyApp.someController.value` in the examples - above). When your object is created, it will automatically assign the value - you want to bind `to` based on the name of your binding key. In the - examples above, during init, Ember objects will effectively call - something like this on your binding: - - ```javascript - binding = Ember.Binding.from("valueBinding").to("value"); - ``` - - This creates a new binding instance based on the template you provide, and - sets the to path to the `value` property of the new object. Now that the - binding is fully configured with a `from` and a `to`, it simply needs to be - connected to become active. This is done through the `connect()` method: - - ```javascript - binding.connect(this); - ``` - - Note that when you connect a binding you pass the object you want it to be - connected to. This object will be used as the root for both the from and - to side of the binding when inspecting relative paths. This allows the - binding to be automatically inherited by subclassed objects as well. - - This also allows you to bind between objects using the paths you declare in - `from` and `to`: - - ```javascript - // Example 1 - binding = Ember.Binding.from("App.someObject.value").to("value"); - binding.connect(this); - - // Example 2 - binding = Ember.Binding.from("parentView.value").to("App.someObject.value"); - binding.connect(this); - ``` - - Now that the binding is connected, it will observe both the from and to side - and relay changes. - - If you ever needed to do so (you almost never will, but it is useful to - understand this anyway), you could manually create an active binding by - using the `Ember.bind()` helper method. (This is the same method used by - to setup your bindings on objects): - - ```javascript - Ember.bind(MyApp.anotherObject, "value", "MyApp.someController.value"); - ``` - - Both of these code fragments have the same effect as doing the most friendly - form of binding creation like so: - - ```javascript - MyApp.anotherObject = Ember.Object.create({ - valueBinding: "MyApp.someController.value", - - // OTHER CODE FOR THIS OBJECT... - }); - ``` - - Ember's built in binding creation method makes it easy to automatically - create bindings for you. You should always use the highest-level APIs - available, even if you understand how it works underneath. - - @class Binding - @namespace Ember - @since Ember 0.9 - @public - */ - // Ember.Binding = Binding; ES6TODO: where to put this? - - /** - Global helper method to create a new binding. Just pass the root object - along with a `to` and `from` path to create and connect the binding. - - @method bind - @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 bind(obj, to, from) { - return new Binding(to, from).connect(obj); - } - - exports.Binding = Binding; -}); -enifed('ember-metal/cache', ['exports', 'ember-utils', 'ember-metal/meta'], function (exports, _emberUtils, _emberMetalMeta) { - 'use strict'; - - var Cache = (function () { - function Cache(limit, func, key, store) { - babelHelpers.classCallCheck(this, Cache); - - this.size = 0; - this.misses = 0; - this.hits = 0; - this.limit = limit; - this.func = func; - this.key = key; - this.store = store || new DefaultStore(); - } - - Cache.prototype.get = function get(obj) { - var key = this.key === undefined ? obj : this.key(obj); - var value = this.store.get(key); - if (value === undefined) { - this.misses++; - value = this._set(key, this.func(obj)); - } else if (value === _emberMetalMeta.UNDEFINED) { - this.hits++; - value = undefined; - } else { - this.hits++; - // nothing to translate - } - - return value; - }; - - Cache.prototype.set = function set(obj, value) { - var key = this.key === undefined ? obj : this.key(obj); - return this._set(key, value); - }; - - Cache.prototype._set = function _set(key, value) { - if (this.limit > this.size) { - this.size++; - if (value === undefined) { - this.store.set(key, _emberMetalMeta.UNDEFINED); - } else { - this.store.set(key, value); - } - } - - return value; - }; - - Cache.prototype.purge = function purge() { - this.store.clear(); - this.size = 0; - this.hits = 0; - this.misses = 0; - }; - - return Cache; - })(); - - exports.default = Cache; - - var DefaultStore = (function () { - function DefaultStore() { - babelHelpers.classCallCheck(this, DefaultStore); - - this.data = new _emberUtils.EmptyObject(); - } - - DefaultStore.prototype.get = function get(key) { - return this.data[key]; - }; - - DefaultStore.prototype.set = function set(key, value) { - this.data[key] = value; - }; - - DefaultStore.prototype.clear = function clear() { - this.data = new _emberUtils.EmptyObject(); - }; - - return DefaultStore; - })(); -}); -enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_get', 'ember-metal/meta', 'ember-metal/watch_key', 'ember-metal/watch_path'], function (exports, _emberUtils, _emberMetalProperty_get, _emberMetalMeta, _emberMetalWatch_key, _emberMetalWatch_path) { - 'use strict'; - - exports.finishChains = finishChains; - - var FIRST_KEY = /^([^\.]+)/; - - function firstKey(path) { - return path.match(FIRST_KEY)[0]; - } - - function isObject(obj) { - return typeof obj === 'object' && obj; - } - - function isVolatile(obj) { - return !(isObject(obj) && obj.isDescriptor && obj._volatile === false); - } - - function ChainWatchers() { - // chain nodes that reference a key in this obj by key - // we only create ChainWatchers when we are going to add them - // so create this upfront - this.chains = new _emberUtils.EmptyObject(); - } - - 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; i < nodes.length; 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; i < nodes.length; 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 object and path that - // will be/are invalidated by this key change, depending on - // 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; i < nodes.length; 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; i < affected.length; i += 2) { - var obj = affected[i]; - var path = affected[i + 1]; - callback(obj, path); - } - } - }; - - function makeChainWatcher() { - return new ChainWatchers(); - } - - function addChainWatcher(obj, keyName, node) { - var m = _emberMetalMeta.meta(obj); - m.writableChainWatchers(makeChainWatcher).add(keyName, node); - _emberMetalWatch_key.watchKey(obj, keyName, m); - } - - function removeChainWatcher(obj, keyName, node, _meta) { - if (!isObject(obj)) { - return; - } - - var meta = _meta || _emberMetalMeta.peekMeta(obj); - - if (!meta || !meta.readableChainWatchers()) { - return; - } - - // make meta writable - meta = _emberMetalMeta.meta(obj); - - meta.readableChainWatchers().remove(keyName, node); - - _emberMetalWatch_key.unwatchKey(obj, keyName, meta); - } - - // 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 - // pass null for parent and key and object for value. - function ChainNode(parent, key, value) { - this._parent = parent; - this._key = key; - - // _watching is true when calling get(this._parent, this._key) will - // return the value of this node. - // - // It is false for the root of a chain (because we have no parent) - // and for global paths (because the parent node is the object with - // the observer on it) - this._watching = value === undefined; - - this._chains = undefined; - this._object = undefined; - this.count = 0; - - this._value = value; - this._paths = {}; - if (this._watching) { - var obj = parent.value(); - - if (!isObject(obj)) { - return; - } - - this._object = obj; - - addChainWatcher(this._object, this._key, this); - } - } - - function lazyGet(obj, key) { - if (!isObject(obj)) { - return; - } - - var meta = _emberMetalMeta.peekMeta(obj); - - // check if object meant only to be a prototype - if (meta && meta.proto === obj) { - return; - } - - // Use `get` if the return value is an EachProxy or an uncacheable value. - if (isVolatile(obj[key])) { - return _emberMetalProperty_get.get(obj, key); - // Otherwise attempt to get the cached value of the computed property - } else { - var cache = meta.readableCache(); - if (cache && key in cache) { - return cache[key]; - } - } - } - - ChainNode.prototype = { - value: function () { - if (this._value === undefined && this._watching) { - var obj = this._parent.value(); - this._value = lazyGet(obj, this._key); - } - return this._value; - }, - - destroy: function () { - if (this._watching) { - var obj = this._object; - if (obj) { - removeChainWatcher(obj, this._key, this); - } - this._watching = false; // so future calls do nothing - } - }, - - // copies a top level object only - copy: function (obj) { - var ret = new ChainNode(null, null, obj); - var paths = this._paths; - var path = undefined; - - for (path in paths) { - // this check will also catch non-number vals. - if (paths[path] <= 0) { - continue; - } - ret.add(path); - } - return ret; - }, - - // called on the root node of a chain to setup watchers on the specified - // path. - add: function (path) { - var paths = this._paths; - paths[path] = (paths[path] || 0) + 1; - - var key = firstKey(path); - var tail = path.slice(key.length + 1); - - this.chain(key, tail); - }, - - // called on the root node of a chain to teardown watcher on the specified - // path - remove: function (path) { - var paths = this._paths; - if (paths[path] > 0) { - paths[path]--; - } - - var key = firstKey(path); - var tail = path.slice(key.length + 1); - - this.unchain(key, tail); - }, - - chain: function (key, path) { - var chains = this._chains; - var node = undefined; - if (chains === undefined) { - chains = this._chains = new _emberUtils.EmptyObject(); - } else { - node = chains[key]; - } - - if (node === undefined) { - node = chains[key] = new ChainNode(this, key, undefined); - } - - node.count++; // count chains... - - // chain rest of path if there is one - if (path) { - key = firstKey(path); - path = path.slice(key.length + 1); - node.chain(key, path); - } - }, - - unchain: function (key, path) { - var chains = this._chains; - var node = chains[key]; - - // unchain rest of path first... - if (path && path.length > 1) { - var nextKey = firstKey(path); - var nextPath = path.slice(nextKey.length + 1); - node.unchain(nextKey, nextPath); - } - - // delete node if needed. - node.count--; - if (node.count <= 0) { - chains[node._key] = undefined; - node.destroy(); - } - }, - - notify: function (revalidate, affected) { - if (revalidate && this._watching) { - var parentValue = this._parent.value(); - - if (parentValue !== this._object) { - if (this._object) { - removeChainWatcher(this._object, this._key, this); - } - - if (isObject(parentValue)) { - this._object = parentValue; - addChainWatcher(parentValue, this._key, this); - } else { - this._object = undefined; - } - } - this._value = undefined; - } - - // then notify chains... - var chains = this._chains; - var node = undefined; - if (chains) { - for (var key in chains) { - node = chains[key]; - if (node !== undefined) { - node.notify(revalidate, affected); - } - } - } - - if (affected && this._parent) { - this._parent.populateAffected(this._key, 1, affected); - } - }, - - populateAffected: function (path, depth, affected) { - if (this._key) { - path = this._key + '.' + path; - } - - if (this._parent) { - this._parent.populateAffected(path, depth + 1, affected); - } else { - if (depth > 1) { - affected.push(this.value(), path); - } - } - } - }; - - function finishChains(obj) { - // We only create meta if we really have to - var m = _emberMetalMeta.peekMeta(obj); - if (m) { - m = _emberMetalMeta.meta(obj); - - // finish any current chains node watchers that reference obj - var chainWatchers = m.readableChainWatchers(); - if (chainWatchers) { - chainWatchers.revalidateAll(); - } - // ensure that if we have inherited any chains they have been - // copied onto our own meta. - if (m.readableChains()) { - m.writableChains(_emberMetalWatch_path.makeChainNode); - } - } - } - - exports.removeChainWatcher = removeChainWatcher; - exports.ChainNode = ChainNode; -}); -enifed('ember-metal/computed', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/property_set', 'ember-metal/meta', 'ember-metal/expand_properties', 'ember-metal/error', 'ember-metal/properties', 'ember-metal/property_events', 'ember-metal/dependent_keys'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalProperty_set, _emberMetalMeta, _emberMetalExpand_properties, _emberMetalError, _emberMetalProperties, _emberMetalProperty_events, _emberMetalDependent_keys) { - 'use strict'; - - exports.default = computed; - - /** - @module ember - @submodule ember-metal - */ - - var DEEP_EACH_REGEX = /\.@each\.[^.]+\./; - - /** - A computed property transforms an object literal with object's accessor function(s) into a property. - - By default the function backing the computed property will only be called - once and the result will be cached. You can specify various properties - that your computed property depends on. This will force the cached - result to be recomputed if the dependencies are modified. - - In the following example we declare a computed property - `fullName` - by calling - `.Ember.computed()` with property dependencies (`firstName` and `lastName`) as leading arguments and getter accessor function. The `fullName` getter function - will be called once (regardless of how many times it is accessed) as long - as its dependencies have not changed. Once `firstName` or `lastName` are updated - any future calls (or anything bound) to `fullName` will incorporate the new - values. - - ```javascript - let Person = Ember.Object.extend({ - // these will be supplied by `create` - firstName: null, - lastName: null, - - fullName: Ember.computed('firstName', 'lastName', function() { - let firstName = this.get('firstName'), - lastName = this.get('lastName'); - - return firstName + ' ' + lastName; - }) - }); - - let tom = Person.create({ - firstName: 'Tom', - lastName: 'Dale' - }); - - tom.get('fullName') // 'Tom Dale' - ``` - - You can also define what Ember should do when setting a computed property by providing additional function (`set`) in hash argument. - If you try to set a computed property, it will try to invoke setter accessor function with the key and - value you want to set it to as arguments. - - ```javascript - let Person = Ember.Object.extend({ - // these will be supplied by `create` - firstName: null, - lastName: null, - - fullName: Ember.computed('firstName', 'lastName', { - get(key) { - let firstName = this.get('firstName'), - lastName = this.get('lastName'); - - return firstName + ' ' + lastName; - }, - set(key, value) { - let [firstName, lastName] = value.split(' '); - - this.set('firstName', firstName); - this.set('lastName', lastName); - - return value; - } - }) - }); - - let person = Person.create(); - - person.set('fullName', 'Peter Wagenet'); - person.get('firstName'); // 'Peter' - person.get('lastName'); // 'Wagenet' - ``` - - You can overwrite computed property with normal property (no longer computed), that won't change if dependencies change, if you set computed property and it won't have setter accessor function defined. - - You can also mark computed property as `.readOnly()` and block all attempts to set it. - - ```javascript - let Person = Ember.Object.extend({ - // these will be supplied by `create` - firstName: null, - lastName: null, - - fullName: Ember.computed('firstName', 'lastName', { - get(key) { - let firstName = this.get('firstName'); - let lastName = this.get('lastName'); - - return firstName + ' ' + lastName; - } - }).readOnly() - }); - - let person = Person.create(); - person.set('fullName', 'Peter Wagenet'); // Uncaught Error: Cannot set read-only property "fullName" on object: <(...):emberXXX> - ``` - - Additional resources: - - [New CP syntax RFC](https://github.com/emberjs/rfcs/blob/master/text/0011-improved-cp-syntax.md) - - [New computed syntax explained in "Ember 1.12 released" ](http://emberjs.com/blog/2015/05/13/ember-1-12-released.html#toc_new-computed-syntax) - - @class ComputedProperty - @namespace Ember - @public - */ - function ComputedProperty(config, opts) { - this.isDescriptor = true; - if (typeof config === 'function') { - this._getter = config; - } else { - _emberMetalDebug.assert('Ember.computed expects a function or an object as last argument.', typeof config === 'object' && !Array.isArray(config)); - _emberMetalDebug.assert('Config object passed to an Ember.computed can only contain `get` or `set` keys.', (function () { - var keys = Object.keys(config); - for (var i = 0; i < keys.length; i++) { - if (keys[i] !== 'get' && keys[i] !== 'set') { - return false; - } - } - return true; - })()); - this._getter = config.get; - this._setter = config.set; - } - _emberMetalDebug.assert('Computed properties must receive a getter or a setter, you passed none.', !!this._getter || !!this._setter); - this._dependentKeys = undefined; - this._suspended = undefined; - this._meta = undefined; - this._volatile = false; - this._dependentKeys = opts && opts.dependentKeys; - this._readOnly = false; - } - - ComputedProperty.prototype = new _emberMetalProperties.Descriptor(); - ComputedProperty.prototype.constructor = ComputedProperty; - - var ComputedPropertyPrototype = ComputedProperty.prototype; - - /** - Call on a computed property to set it into non-cached mode. When in this - mode the computed property will not automatically cache the return value. - - It also does not automatically fire any change events. You must manually notify - any changes if you want to observe this property. - - Dependency keys have no effect on volatile properties as they are for cache - invalidation and notification when cached value is invalidated. - - ```javascript - let outsideService = Ember.Object.extend({ - value: Ember.computed(function() { - return OutsideService.getValue(); - }).volatile() - }).create(); - ``` - - @method volatile - @return {Ember.ComputedProperty} this - @chainable - @public - */ - ComputedPropertyPrototype.volatile = function () { - this._volatile = true; - return this; - }; - - /** - Call on a computed property to set it into read-only mode. When in this - mode the computed property will throw an error when set. - - ```javascript - let Person = Ember.Object.extend({ - guid: Ember.computed(function() { - return 'guid-guid-guid'; - }).readOnly() - }); - - let person = Person.create(); - - person.set('guid', 'new-guid'); // will throw an exception - ``` - - @method readOnly - @return {Ember.ComputedProperty} this - @chainable - @public - */ - ComputedPropertyPrototype.readOnly = function () { - this._readOnly = true; - _emberMetalDebug.assert('Computed properties that define a setter using the new syntax cannot be read-only', !(this._readOnly && this._setter && this._setter !== this._getter)); - return this; - }; - - /** - Sets the dependent keys on this computed property. Pass any number of - arguments containing key paths that this computed property depends on. - - ```javascript - let President = Ember.Object.extend({ - fullName: Ember.computed(function() { - return this.get('firstName') + ' ' + this.get('lastName'); - - // Tell Ember that this computed property depends on firstName - // and lastName - }).property('firstName', 'lastName') - }); - - let president = President.create({ - firstName: 'Barack', - lastName: 'Obama' - }); - - president.get('fullName'); // 'Barack Obama' - ``` - - @method property - @param {String} path* zero or more property paths - @return {Ember.ComputedProperty} this - @chainable - @public - */ - ComputedPropertyPrototype.property = function () { - var args = []; - - function addArg(property) { - _emberMetalDebug.warn('Dependent keys containing @each only work one level deep. ' + ('You used the key "' + property + '" which is invalid. ') + 'Please create an intermediary computed property.', DEEP_EACH_REGEX.test(property) === false, { id: 'ember-metal.computed-deep-each' }); - args.push(property); - } - - for (var i = 0; i < arguments.length; i++) { - _emberMetalExpand_properties.default(arguments[i], addArg); - } - - this._dependentKeys = args; - return this; - }; - - /** - In some cases, you may want to annotate computed properties with additional - metadata about how they function or what values they operate on. For example, - computed property functions may close over variables that are then no longer - available for introspection. - - You can pass a hash of these values to a computed property like this: - - ``` - person: Ember.computed(function() { - let personId = this.get('personId'); - return App.Person.create({ id: personId }); - }).meta({ type: App.Person }) - ``` - - The hash that you pass to the `meta()` function will be saved on the - computed property descriptor under the `_meta` key. Ember runtime - exposes a public API for retrieving these values from classes, - via the `metaForProperty()` function. - - @method meta - @param {Object} meta - @chainable - @public - */ - ComputedPropertyPrototype.meta = function (meta) { - if (arguments.length === 0) { - return this._meta || {}; - } else { - this._meta = meta; - return this; - } - }; - - // invalidate cache when CP key changes - ComputedPropertyPrototype.didChange = function (obj, keyName) { - // _suspended is set via a CP.set to ensure we don't clear - // the cached value set by the setter - if (this._volatile || this._suspended === obj) { - return; - } - - // don't create objects just to invalidate - var meta = _emberMetalMeta.peekMeta(obj); - if (!meta || meta.source !== obj) { - return; - } - - var cache = meta.readableCache(); - if (cache && cache[keyName] !== undefined) { - cache[keyName] = undefined; - _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); - } - }; - - ComputedPropertyPrototype.get = function (obj, keyName) { - if (this._volatile) { - return this._getter.call(obj, keyName); - } - - var meta = _emberMetalMeta.meta(obj); - var cache = meta.writableCache(); - - var result = cache[keyName]; - if (result === _emberMetalMeta.UNDEFINED) { - return undefined; - } else if (result !== undefined) { - return result; - } - - var ret = this._getter.call(obj, keyName); - if (ret === undefined) { - cache[keyName] = _emberMetalMeta.UNDEFINED; - } else { - cache[keyName] = ret; - } - - var chainWatchers = meta.readableChainWatchers(); - if (chainWatchers) { - chainWatchers.revalidate(keyName); - } - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); - - return ret; - }; - - ComputedPropertyPrototype.set = function computedPropertySetEntry(obj, keyName, value) { - if (this._readOnly) { - this._throwReadOnlyError(obj, keyName); - } - - if (!this._setter) { - return this.clobberSet(obj, keyName, value); - } - - if (this._volatile) { - return this.volatileSet(obj, keyName, value); - } - - return this.setWithSuspend(obj, keyName, value); - }; - - ComputedPropertyPrototype._throwReadOnlyError = function computedPropertyThrowReadOnlyError(obj, keyName) { - throw new _emberMetalError.default('Cannot set read-only property "' + keyName + '" on object: ' + _emberUtils.inspect(obj)); - }; - - ComputedPropertyPrototype.clobberSet = function computedPropertyClobberSet(obj, keyName, value) { - var cachedValue = cacheFor(obj, keyName); - _emberMetalProperties.defineProperty(obj, keyName, null, cachedValue); - _emberMetalProperty_set.set(obj, keyName, value); - return value; - }; - - ComputedPropertyPrototype.volatileSet = function computedPropertyVolatileSet(obj, keyName, value) { - return this._setter.call(obj, keyName, value); - }; - - ComputedPropertyPrototype.setWithSuspend = function computedPropertySetWithSuspend(obj, keyName, value) { - var oldSuspended = this._suspended; - this._suspended = obj; - try { - return this._set(obj, keyName, value); - } finally { - this._suspended = oldSuspended; - } - }; - - ComputedPropertyPrototype._set = function computedPropertySet(obj, keyName, value) { - // cache requires own meta - var meta = _emberMetalMeta.meta(obj); - // either there is a writable cache or we need one to update - var cache = meta.writableCache(); - var hadCachedValue = false; - var cachedValue = undefined; - if (cache[keyName] !== undefined) { - if (cache[keyName] !== _emberMetalMeta.UNDEFINED) { - cachedValue = cache[keyName]; - } - hadCachedValue = true; - } - - var ret = this._setter.call(obj, keyName, value, cachedValue); - - // allows setter to return the same value that is cached already - if (hadCachedValue && cachedValue === ret) { - return ret; - } - - _emberMetalProperty_events.propertyWillChange(obj, keyName); - - if (hadCachedValue) { - cache[keyName] = undefined; - } - - if (!hadCachedValue) { - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); - } - - if (ret === undefined) { - cache[keyName] = _emberMetalMeta.UNDEFINED; - } else { - cache[keyName] = ret; - } - - _emberMetalProperty_events.propertyDidChange(obj, keyName); - - return ret; - }; - - /* called before property is overridden */ - ComputedPropertyPrototype.teardown = function (obj, keyName) { - if (this._volatile) { - return; - } - var meta = _emberMetalMeta.meta(obj); - var cache = meta.readableCache(); - if (cache && cache[keyName] !== undefined) { - _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); - cache[keyName] = undefined; - } - }; - - /** - This helper returns a new property descriptor that wraps the passed - computed property function. You can use this helper to define properties - with mixins or via `Ember.defineProperty()`. - - If you pass a function as an argument, it will be used as a getter. A computed - property defined in this way might look like this: - - ```js - let Person = Ember.Object.extend({ - init() { - this._super(...arguments); - - this.firstName = 'Betty'; - this.lastName = 'Jones'; - }, - - fullName: Ember.computed('firstName', 'lastName', function() { - return `${this.get('firstName')} ${this.get('lastName')}`; - }) - }); - - let client = Person.create(); - - client.get('fullName'); // 'Betty Jones' - - client.set('lastName', 'Fuller'); - client.get('fullName'); // 'Betty Fuller' - ``` - - You can pass a hash with two functions, `get` and `set`, as an - argument to provide both a getter and setter: - - ```js - let Person = Ember.Object.extend({ - init() { - this._super(...arguments); - - this.firstName = 'Betty'; - this.lastName = 'Jones'; - }, - - fullName: Ember.computed('firstName', 'lastName', { - get(key) { - return `${this.get('firstName')} ${this.get('lastName')}`; - }, - set(key, value) { - let [firstName, lastName] = value.split(/\s+/); - this.setProperties({ firstName, lastName }); - return value; - } - }); - }) - - let client = Person.create(); - client.get('firstName'); // 'Betty' - - client.set('fullName', 'Carroll Fuller'); - client.get('firstName'); // 'Carroll' - ``` - - The `set` function should accept two parameters, `key` and `value`. The value - returned from `set` will be the new value of the property. - - _Note: This is the preferred way to define computed properties when writing third-party - libraries that depend on or use Ember, since there is no guarantee that the user - will have [prototype Extensions](http://emberjs.com/guides/configuring-ember/disabling-prototype-extensions/) enabled._ - - The alternative syntax, with prototype extensions, might look like: - - ```js - fullName: function() { - return this.get('firstName') + ' ' + this.get('lastName'); - }.property('firstName', 'lastName') - ``` - - @class computed - @namespace Ember - @constructor - @static - @param {String} [dependentKeys*] Optional dependent keys that trigger this computed property. - @param {Function} func The computed property function. - @return {Ember.ComputedProperty} property descriptor instance - @public - */ - - function computed(func) { - var args = undefined; - - if (arguments.length > 1) { - args = [].slice.call(arguments); - func = args.pop(); - } - - var cp = new ComputedProperty(func); - - if (args) { - cp.property.apply(cp, args); - } - - return cp; - } - - /** - Returns the cached value for a property, if one exists. - This can be useful for peeking at the value of a computed - property that is generated lazily, without accidentally causing - it to be created. - - @method cacheFor - @for Ember - @param {Object} obj the object whose property you want to check - @param {String} key the name of the property whose cached value you want - to return - @return {Object} the cached value - @public - */ - function cacheFor(obj, key) { - var meta = _emberMetalMeta.peekMeta(obj); - var cache = meta && meta.source === obj && meta.readableCache(); - var ret = cache && cache[key]; - - if (ret === _emberMetalMeta.UNDEFINED) { - return undefined; - } - return ret; - } - - cacheFor.set = function (cache, key, value) { - if (value === undefined) { - cache[key] = _emberMetalMeta.UNDEFINED; - } else { - cache[key] = value; - } - }; - - cacheFor.get = function (cache, key) { - var ret = cache[key]; - if (ret === _emberMetalMeta.UNDEFINED) { - return undefined; - } - return ret; - }; - - cacheFor.remove = function (cache, key) { - cache[key] = undefined; - }; - - exports.ComputedProperty = ComputedProperty; - exports.computed = computed; - exports.cacheFor = cacheFor; -}); -enifed('ember-metal/core', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { - 'use strict'; - - /** - @module ember - @submodule ember-metal - */ - - /** - This namespace contains all Ember methods and functions. Future versions of - Ember may overwrite this namespace and therefore, you should avoid adding any - new properties. - - At the heart of Ember is Ember-Runtime, a set of core functions that provide - cross-platform compatibility and object property observing. Ember-Runtime is - small and performance-focused so you can use it alongside other - cross-platform libraries such as jQuery. For more details, see - [Ember-Runtime](http://emberjs.com/api/modules/ember-runtime.html). - - @class Ember - @static - @public - */ - var Ember = typeof _emberEnvironment.context.imports.Ember === 'object' && _emberEnvironment.context.imports.Ember || {}; - - // Make sure these are set whether Ember was already defined or not - Ember.isNamespace = true; - Ember.toString = function () { - return 'Ember'; - }; - - // .......................................................... - // BOOTSTRAP - // - - exports.default = Ember; -}); -enifed("ember-metal/debug", ["exports"], function (exports) { - "use strict"; - - exports.getDebugFunction = getDebugFunction; - exports.setDebugFunction = setDebugFunction; - exports.assert = assert; - exports.info = info; - exports.warn = warn; - exports.debug = debug; - exports.deprecate = deprecate; - exports.deprecateFunc = deprecateFunc; - exports.runInDebug = runInDebug; - exports.debugSeal = debugSeal; - exports.debugFreeze = debugFreeze; - var debugFunctions = { - assert: function () {}, - info: function () {}, - warn: function () {}, - debug: function () {}, - deprecate: function () {}, - deprecateFunc: function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return args[args.length - 1]; - }, - runInDebug: function () {}, - debugSeal: function () {}, - debugFreeze: function () {} - }; - - exports.debugFunctions = debugFunctions; - - function getDebugFunction(name) { - return debugFunctions[name]; - } - - function setDebugFunction(name, fn) { - debugFunctions[name] = fn; - } - - function assert() { - return debugFunctions.assert.apply(undefined, arguments); - } - - function info() { - return debugFunctions.info.apply(undefined, arguments); - } - - function warn() { - return debugFunctions.warn.apply(undefined, arguments); - } - - function debug() { - return debugFunctions.debug.apply(undefined, arguments); - } - - function deprecate() { - return debugFunctions.deprecate.apply(undefined, arguments); - } - - function deprecateFunc() { - return debugFunctions.deprecateFunc.apply(undefined, arguments); - } - - function runInDebug() { - return debugFunctions.runInDebug.apply(undefined, arguments); - } - - function debugSeal() { - return debugFunctions.debugSeal.apply(undefined, arguments); - } - - function debugFreeze() { - return debugFunctions.debugFreeze.apply(undefined, arguments); - } -}); -enifed('ember-metal/dependent_keys', ['exports', 'ember-metal/watching'], function (exports, _emberMetalWatching) { - 'no use strict'; - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - - exports.addDependentKeys = addDependentKeys; - exports.removeDependentKeys = removeDependentKeys; - - /** - @module ember - @submodule ember-metal - */ - - // .......................................................... - // DEPENDENT KEYS - // - - function addDependentKeys(desc, obj, keyName, meta) { - // the descriptor has a list of dependent keys, so - // add all of its dependent keys. - var idx = undefined, - depKey = undefined; - var depKeys = desc._dependentKeys; - if (!depKeys) { - return; - } - - for (idx = 0; idx < depKeys.length; idx++) { - depKey = depKeys[idx]; - // Increment the number of times depKey depends on keyName. - meta.writeDeps(depKey, keyName, (meta.peekDeps(depKey, keyName) || 0) + 1); - // Watch the depKey - _emberMetalWatching.watch(obj, depKey, meta); - } - } - - function removeDependentKeys(desc, obj, keyName, meta) { - // the descriptor has a list of dependent keys, so - // remove all of its dependent keys. - var depKeys = desc._dependentKeys; - if (!depKeys) { - return; - } - - for (var idx = 0; idx < depKeys.length; idx++) { - var depKey = depKeys[idx]; - // Decrement the number of times depKey depends on keyName. - meta.writeDeps(depKey, keyName, (meta.peekDeps(depKey, keyName) || 0) - 1); - // Unwatch the depKey - _emberMetalWatching.unwatch(obj, depKey, meta); - } - } -}); -enifed('ember-metal/deprecate_property', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set'], function (exports, _emberMetalDebug, _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. - - @method deprecateProperty - @param {Object} object The object to add the deprecated property to. - @param {String} deprecatedKey The property to add (and print deprecation warnings upon accessing). - @param {String} newKey The property that will be aliased. - @private - @since 1.7.0 - */ - - function deprecateProperty(object, deprecatedKey, newKey, options) { - function _deprecate() { - _emberMetalDebug.deprecate('Usage of `' + deprecatedKey + '` is deprecated, use `' + newKey + '` instead.', false, options); - } - - Object.defineProperty(object, deprecatedKey, { - configurable: true, - enumerable: false, - set: function (value) { - _deprecate(); - _emberMetalProperty_set.set(this, newKey, value); - }, - get: function () { - _deprecate(); - return _emberMetalProperty_get.get(this, newKey); - } - }); - } -}); -enifed('ember-metal/descriptor', ['exports', 'ember-metal/properties'], function (exports, _emberMetalProperties) { - 'use strict'; - - exports.default = descriptor; - - function descriptor(desc) { - return new Descriptor(desc); - } - - /** - A wrapper for a native ES5 descriptor. In an ideal world, we wouldn't need - this at all, however, the way we currently flatten/merge our mixins require - a special value to denote a descriptor. - - @class Descriptor - @private - */ - - var Descriptor = (function (_EmberDescriptor) { - babelHelpers.inherits(Descriptor, _EmberDescriptor); - - function Descriptor(desc) { - babelHelpers.classCallCheck(this, Descriptor); - - _EmberDescriptor.call(this); - this.desc = desc; - } - - Descriptor.prototype.setup = function setup(obj, key) { - Object.defineProperty(obj, key, this.desc); - }; - - Descriptor.prototype.teardown = function teardown(obj, key) {}; - - return Descriptor; - })(_emberMetalProperties.Descriptor); -}); -enifed("ember-metal/error", ["exports"], function (exports) { - - /** - A subclass of the JavaScript Error object for use in Ember. - - @class Error - @namespace Ember - @extends Error - @constructor - @public - */ - "use strict"; - - exports.default = EmberError; - - function EmberError(message) { - if (!(this instanceof EmberError)) { - return new EmberError(message); - } - - var error = Error.call(this, message); - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, EmberError); - } else { - this.stack = error.stack; - } - - this.description = error.description; - this.fileName = error.fileName; - this.lineNumber = error.lineNumber; - this.message = error.message; - this.name = error.name; - this.number = error.number; - this.code = error.code; - } - - EmberError.prototype = Object.create(Error.prototype); -}); -enifed('ember-metal/error_handler', ['exports', 'ember-console', 'ember-metal/testing'], function (exports, _emberConsole, _emberMetalTesting) { - 'use strict'; - - exports.getOnerror = getOnerror; - exports.setOnerror = setOnerror; - exports.dispatchError = dispatchError; - exports.setDispatchOverride = setDispatchOverride; - - // To maintain stacktrace consistency across browsers - var getStack = function (error) { - var stack = error.stack; - var message = error.message; - - if (stack && stack.indexOf(message) === -1) { - stack = message + '\n' + stack; - } - - return stack; - }; - - var onerror = undefined; - // Ember.onerror getter - - function getOnerror() { - return onerror; - } - - // Ember.onerror setter - - function setOnerror(handler) { - onerror = handler; - } - - var dispatchOverride = undefined; - // dispatch error - - function dispatchError(error) { - if (dispatchOverride) { - dispatchOverride(error); - } else { - defaultDispatch(error); - } - } - - // allows testing adapter to override dispatch - - function setDispatchOverride(handler) { - dispatchOverride = handler; - } - - function defaultDispatch(error) { - if (_emberMetalTesting.isTesting()) { - throw error; - } - if (onerror) { - onerror(error); - } else { - _emberConsole.default.error(getStack(error)); - } - } -}); -enifed('ember-metal/events', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/meta', 'ember-metal/meta_listeners'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalMeta, _emberMetalMeta_listeners) { - 'no use strict'; - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - - /** - @module ember - @submodule ember-metal - */ - exports.accumulateListeners = accumulateListeners; - exports.addListener = addListener; - exports.removeListener = removeListener; - exports.suspendListener = suspendListener; - exports.suspendListeners = suspendListeners; - exports.watchedEvents = watchedEvents; - exports.sendEvent = sendEvent; - exports.hasListeners = hasListeners; - exports.listenersFor = listenersFor; - exports.on = on; - - /* - The event system uses a series of nested hashes to store listeners on an - object. When a listener is registered, or when an event arrives, these - hashes are consulted to determine which target and action pair to invoke. - - The hashes are stored in the object's meta hash, and look like this: - - // Object's meta hash - { - listeners: { // variable name: `listenerSet` - "foo:changed": [ // variable name: `actions` - target, method, flags - ] - } - } - - */ - - function indexOf(array, target, method) { - var index = -1; - // hashes are added to the end of the event array - // so it makes sense to start searching at the end - // of the array and search in reverse - for (var i = array.length - 3; i >= 0; i -= 3) { - if (target === array[i] && method === array[i + 1]) { - index = i; - break; - } - } - return index; - } - - function accumulateListeners(obj, eventName, otherActions) { - var meta = _emberMetalMeta.peekMeta(obj); - if (!meta) { - return; - } - var actions = meta.matchingListeners(eventName); - var newActions = []; - - for (var i = actions.length - 3; i >= 0; i -= 3) { - var target = actions[i]; - var method = actions[i + 1]; - var flags = actions[i + 2]; - var actionIndex = indexOf(otherActions, target, method); - - if (actionIndex === -1) { - otherActions.push(target, method, flags); - newActions.push(target, method, flags); - } - } - - return newActions; - } - - /** - Add an event listener - - @method addListener - @for Ember - @param obj - @param {String} eventName - @param {Object|Function} target A target object or a function - @param {Function|String} method A function or the name of a function to be called on `target` - @param {Boolean} once A flag whether a function should only be called once - @public - */ - - function addListener(obj, eventName, target, method, once) { - _emberMetalDebug.assert('You must pass at least an object and event name to Ember.addListener', !!obj && !!eventName); - - _emberMetalDebug.deprecate('didInitAttrs called in ' + (obj && obj.toString && obj.toString()) + '.', eventName !== 'didInitAttrs', { - id: 'ember-views.did-init-attrs', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x#toc_ember-component-didinitattrs' - }); - - if (!method && 'function' === typeof target) { - method = target; - target = null; - } - - var flags = 0; - if (once) { - flags |= _emberMetalMeta_listeners.ONCE; - } - - _emberMetalMeta.meta(obj).addToListeners(eventName, target, method, flags); - - if ('function' === typeof obj.didAddListener) { - obj.didAddListener(eventName, target, method); - } - } - - /** - Remove an event listener - - Arguments should match those passed to `Ember.addListener`. - - @method removeListener - @for Ember - @param obj - @param {String} eventName - @param {Object|Function} target A target object or a function - @param {Function|String} method A function or the name of a function to be called on `target` - @public - */ - - function removeListener(obj, eventName, target, method) { - _emberMetalDebug.assert('You must pass at least an object and event name to Ember.removeListener', !!obj && !!eventName); - - if (!method && 'function' === typeof target) { - method = target; - target = null; - } - - _emberMetalMeta.meta(obj).removeFromListeners(eventName, target, method, function () { - if ('function' === typeof obj.didRemoveListener) { - obj.didRemoveListener.apply(obj, arguments); - } - }); - } - - /** - Suspend listener during callback. - - This should only be used by the target of the event listener - when it is taking an action that would cause the event, e.g. - an object might suspend its property change listener while it is - setting that property. - - @method suspendListener - @for Ember - - @private - @param obj - @param {String} eventName - @param {Object|Function} target A target object or a function - @param {Function|String} method A function or the name of a function to be called on `target` - @param {Function} callback - */ - - function suspendListener(obj, eventName, target, method, callback) { - return suspendListeners(obj, [eventName], target, method, callback); - } - - /** - Suspends multiple listeners during a callback. - - @method suspendListeners - @for Ember - - @private - @param obj - @param {Array} eventNames Array of event names - @param {Object|Function} target A target object or a function - @param {Function|String} method A function or the name of a function to be called on `target` - @param {Function} callback - */ - - function suspendListeners(obj, eventNames, target, method, callback) { - if (!method && 'function' === typeof target) { - method = target; - target = null; - } - return _emberMetalMeta.meta(obj).suspendListeners(eventNames, target, method, callback); - } - - /** - Return a list of currently watched events - - @private - @method watchedEvents - @for Ember - @param obj - */ - - function watchedEvents(obj) { - return _emberMetalMeta.meta(obj).watchedEvents(); - } - - /** - Send an event. The execution of suspended listeners - is skipped, and once listeners are removed. A listener without - a target is executed on the passed object. If an array of actions - is not passed, the actions stored on the passed object are invoked. - - @method sendEvent - @for Ember - @param obj - @param {String} eventName - @param {Array} params Optional parameters for each listener. - @param {Array} actions Optional array of actions (listeners). - @return true - @public - */ - - function sendEvent(obj, eventName, params, actions) { - if (!actions) { - var meta = _emberMetalMeta.peekMeta(obj); - actions = meta && meta.matchingListeners(eventName); - } - - if (!actions || actions.length === 0) { - return; - } - - for (var i = actions.length - 3; i >= 0; i -= 3) { - // looping in reverse for once listeners - var target = actions[i]; - var method = actions[i + 1]; - var flags = actions[i + 2]; - - if (!method) { - continue; - } - if (flags & _emberMetalMeta_listeners.SUSPENDED) { - continue; - } - if (flags & _emberMetalMeta_listeners.ONCE) { - removeListener(obj, eventName, target, method); - } - if (!target) { - target = obj; - } - if ('string' === typeof method) { - if (params) { - _emberUtils.applyStr(target, method, params); - } else { - target[method](); - } - } else { - if (params) { - method.apply(target, params); - } else { - method.call(target); - } - } - } - return true; - } - - /** - @private - @method hasListeners - @for Ember - @param obj - @param {String} eventName - */ - - function hasListeners(obj, eventName) { - var meta = _emberMetalMeta.peekMeta(obj); - if (!meta) { - return false; - } - return meta.matchingListeners(eventName).length > 0; - } - - /** - @private - @method listenersFor - @for Ember - @param obj - @param {String} eventName - */ - - function listenersFor(obj, eventName) { - var ret = []; - var meta = _emberMetalMeta.peekMeta(obj); - var actions = meta && meta.matchingListeners(eventName); - - if (!actions) { - return ret; - } - - for (var i = 0; i < actions.length; i += 3) { - var target = actions[i]; - var method = actions[i + 1]; - ret.push([target, method]); - } - - return ret; - } - - /** - Define a property as a function that should be executed when - a specified event or events are triggered. - - - ``` javascript - let Job = Ember.Object.extend({ - logCompleted: Ember.on('completed', function() { - console.log('Job completed!'); - }) - }); - - let job = Job.create(); - - Ember.sendEvent(job, 'completed'); // Logs 'Job completed!' - ``` - - @method on - @for Ember - @param {String} eventNames* - @param {Function} func - @return func - @public - */ - - function on() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - var func = args.pop(); - var events = args; - func.__ember_listens__ = events; - return func; - } -}); -enifed('ember-metal/expand_properties', ['exports', 'ember-metal/debug'], function (exports, _emberMetalDebug) { - 'use strict'; - - exports.default = expandProperties; - - /** - @module ember - @submodule ember-metal - */ - - var SPLIT_REGEX = /\{|\}/; - var END_WITH_EACH_REGEX = /\.@each$/; - - /** - Expands `pattern`, invoking `callback` for each expansion. - - The only pattern supported is brace-expansion, anything else will be passed - once to `callback` directly. - - Example - - ```js - function echo(arg){ console.log(arg); } - - 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}.[]', 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 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. - */ - - function expandProperties(pattern, callback) { - _emberMetalDebug.assert('A computed property key must be a string', typeof pattern === 'string'); - _emberMetalDebug.assert('Brace expanded properties cannot contain spaces, e.g. "user.{firstName, lastName}" should be "user.{firstName,lastName}"', pattern.indexOf(' ') === -1); - _emberMetalDebug.assert('Brace expanded properties have to be balanced and cannot be nested, pattern: ' + pattern, (function (str) { - var inBrace = 0; - var char = undefined; - for (var i = 0; i < str.length; i++) { - char = str.charAt(i); - - if (char === '{') { - inBrace++; - } else if (char === '}') { - inBrace--; - } - - if (inBrace > 1 || inBrace < 0) { - return false; - } - } - - return true; - })(pattern)); - - var parts = pattern.split(SPLIT_REGEX); - var properties = [parts]; - - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; - if (part.indexOf(',') >= 0) { - properties = duplicateAndReplace(properties, part.split(','), i); - } - } - - for (var i = 0; i < properties.length; i++) { - callback(properties[i].join('').replace(END_WITH_EACH_REGEX, '.[]')); - } - } - - function duplicateAndReplace(properties, currentParts, index) { - var all = []; - - properties.forEach(function (property) { - currentParts.forEach(function (part) { - var current = property.slice(0); - current[index] = part; - all.push(current); - }); - }); - - return all; - } -}); -enifed('ember-metal/features', ['exports', 'ember-utils', 'ember-environment', 'ember/features'], function (exports, _emberUtils, _emberEnvironment, _emberFeatures) { - 'use strict'; - - exports.default = isEnabled; - - /** - The hash of enabled Canary features. Add to this, any canary features - before creating your application. - - Alternatively (and recommended), you can also define `EmberENV.FEATURES` - if you need to enable features flagged at runtime. - - @class FEATURES - @namespace Ember - @static - @since 1.1.0 - @public - */ - var FEATURES = _emberUtils.assign(_emberFeatures.default, _emberEnvironment.ENV.FEATURES); - - exports.FEATURES = FEATURES; - /** - Determine whether the specified `feature` is enabled. Used by Ember's - build tools to exclude experimental features from beta/stable builds. - - You can define the following configuration options: - - * `EmberENV.ENABLE_OPTIONAL_FEATURES` - enable any features that have not been explicitly - enabled/disabled. - - @method isEnabled - @param {String} feature The feature to check - @return {Boolean} - @for Ember.FEATURES - @since 1.1.0 - @public - */ - - function isEnabled(feature) { - var featureValue = FEATURES[feature]; - - if (featureValue === true || featureValue === false || featureValue === undefined) { - return featureValue; - } else if (_emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES) { - return true; - } else { - return false; - } - } - - exports.DEFAULT_FEATURES = _emberFeatures.default; -}); -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: - - ```javascript - Ember.getProperties(record, 'firstName', 'lastName', 'zipCode'); - // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } - ``` - - is equivalent to: - - ```javascript - Ember.getProperties(record, ['firstName', 'lastName', 'zipCode']); - // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } - ``` - - @method getProperties - @for Ember - @param {Object} obj - @param {String...|Array} list of keys to get - @return {Object} - @public - */ - - function getProperties(obj) { - var ret = {}; - var propertyNames = arguments; - var i = 1; - - if (arguments.length === 2 && Array.isArray(arguments[1])) { - i = 0; - propertyNames = arguments[1]; - } - for (; i < propertyNames.length; i++) { - ret[propertyNames[i]] = _emberMetalProperty_get.get(obj, propertyNames[i]); - } - return ret; - } -}); -enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/merge', 'ember-metal/debug', 'ember-metal/instrumentation', 'ember-metal/testing', 'ember-metal/error_handler', 'ember-metal/meta', 'ember-metal/error', 'ember-metal/cache', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/weak_map', 'ember-metal/events', 'ember-metal/is_none', 'ember-metal/is_empty', 'ember-metal/is_blank', 'ember-metal/is_present', 'ember-metal/run_loop', 'ember-metal/observer_set', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/watch_key', 'ember-metal/chains', 'ember-metal/watch_path', 'ember-metal/watching', 'ember-metal/libraries', 'ember-metal/map', 'ember-metal/get_properties', 'ember-metal/set_properties', 'ember-metal/expand_properties', 'ember-metal/observer', 'ember-metal/mixin', 'ember-metal/binding', 'ember-metal/path_cache', 'ember-metal/injected_property', 'ember-metal/tags', 'ember-metal/replace', 'ember-metal/transaction', 'ember-metal/is_proxy', 'ember-metal/descriptor'], function (exports, _require, _emberMetalCore, _emberMetalComputed, _emberMetalAlias, _emberMetalMerge, _emberMetalDebug, _emberMetalInstrumentation, _emberMetalTesting, _emberMetalError_handler, _emberMetalMeta, _emberMetalError, _emberMetalCache, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalWeak_map, _emberMetalEvents, _emberMetalIs_none, _emberMetalIs_empty, _emberMetalIs_blank, _emberMetalIs_present, _emberMetalRun_loop, _emberMetalObserver_set, _emberMetalProperty_events, _emberMetalProperties, _emberMetalWatch_key, _emberMetalChains, _emberMetalWatch_path, _emberMetalWatching, _emberMetalLibraries, _emberMetalMap, _emberMetalGet_properties, _emberMetalSet_properties, _emberMetalExpand_properties, _emberMetalObserver, _emberMetalMixin, _emberMetalBinding, _emberMetalPath_cache, _emberMetalInjected_property, _emberMetalTags, _emberMetalReplace, _emberMetalTransaction, _emberMetalIs_proxy, _emberMetalDescriptor) { - /** - @module ember - @submodule ember-metal - */ - - 'use strict'; - - exports.default = _emberMetalCore.default; - // reexports - exports.computed = _emberMetalComputed.default; - exports.cacheFor = _emberMetalComputed.cacheFor; - exports.ComputedProperty = _emberMetalComputed.ComputedProperty; - exports.alias = _emberMetalAlias.default; - exports.merge = _emberMetalMerge.default; - exports.assert = _emberMetalDebug.assert; - exports.info = _emberMetalDebug.info; - exports.warn = _emberMetalDebug.warn; - exports.debug = _emberMetalDebug.debug; - exports.deprecate = _emberMetalDebug.deprecate; - exports.deprecateFunc = _emberMetalDebug.deprecateFunc; - exports.runInDebug = _emberMetalDebug.runInDebug; - exports.setDebugFunction = _emberMetalDebug.setDebugFunction; - exports.getDebugFunction = _emberMetalDebug.getDebugFunction; - exports.debugSeal = _emberMetalDebug.debugSeal; - exports.debugFreeze = _emberMetalDebug.debugFreeze; - exports.instrument = _emberMetalInstrumentation.instrument; - exports.flaggedInstrument = _emberMetalInstrumentation.flaggedInstrument; - exports._instrumentStart = _emberMetalInstrumentation._instrumentStart; - exports.instrumentationReset = _emberMetalInstrumentation.reset; - exports.instrumentationSubscribe = _emberMetalInstrumentation.subscribe; - exports.instrumentationUnsubscribe = _emberMetalInstrumentation.unsubscribe; - exports.isTesting = _emberMetalTesting.isTesting; - exports.setTesting = _emberMetalTesting.setTesting; - exports.getOnerror = _emberMetalError_handler.getOnerror; - exports.setOnerror = _emberMetalError_handler.setOnerror; - exports.dispatchError = _emberMetalError_handler.dispatchError; - exports.setDispatchOverride = _emberMetalError_handler.setDispatchOverride; - exports.META_DESC = _emberMetalMeta.META_DESC; - exports.meta = _emberMetalMeta.meta; - exports.peekMeta = _emberMetalMeta.peekMeta; - exports.Error = _emberMetalError.default; - exports.Cache = _emberMetalCache.default; - exports.isFeatureEnabled = _emberMetalFeatures.default; - exports.FEATURES = _emberMetalFeatures.FEATURES; - exports.DEFAULT_FEATURES = _emberMetalFeatures.DEFAULT_FEATURES; - exports._getPath = _emberMetalProperty_get._getPath; - exports.get = _emberMetalProperty_get.get; - exports.getWithDefault = _emberMetalProperty_get.getWithDefault; - exports.set = _emberMetalProperty_set.set; - exports.trySet = _emberMetalProperty_set.trySet; - exports.WeakMap = _emberMetalWeak_map.default; - exports.accumulateListeners = _emberMetalEvents.accumulateListeners; - exports.addListener = _emberMetalEvents.addListener; - exports.hasListeners = _emberMetalEvents.hasListeners; - exports.listenersFor = _emberMetalEvents.listenersFor; - exports.on = _emberMetalEvents.on; - exports.removeListener = _emberMetalEvents.removeListener; - exports.sendEvent = _emberMetalEvents.sendEvent; - exports.suspendListener = _emberMetalEvents.suspendListener; - exports.suspendListeners = _emberMetalEvents.suspendListeners; - exports.watchedEvents = _emberMetalEvents.watchedEvents; - exports.isNone = _emberMetalIs_none.default; - exports.isEmpty = _emberMetalIs_empty.default; - exports.isBlank = _emberMetalIs_blank.default; - exports.isPresent = _emberMetalIs_present.default; - exports.run = _emberMetalRun_loop.default; - exports.ObserverSet = _emberMetalObserver_set.default; - exports.beginPropertyChanges = _emberMetalProperty_events.beginPropertyChanges; - exports.changeProperties = _emberMetalProperty_events.changeProperties; - exports.endPropertyChanges = _emberMetalProperty_events.endPropertyChanges; - exports.overrideChains = _emberMetalProperty_events.overrideChains; - exports.propertyDidChange = _emberMetalProperty_events.propertyDidChange; - exports.propertyWillChange = _emberMetalProperty_events.propertyWillChange; - exports.PROPERTY_DID_CHANGE = _emberMetalProperty_events.PROPERTY_DID_CHANGE; - exports.defineProperty = _emberMetalProperties.defineProperty; - exports.Descriptor = _emberMetalProperties.Descriptor; - exports.watchKey = _emberMetalWatch_key.watchKey; - exports.unwatchKey = _emberMetalWatch_key.unwatchKey; - exports.ChainNode = _emberMetalChains.ChainNode; - exports.finishChains = _emberMetalChains.finishChains; - exports.removeChainWatcher = _emberMetalChains.removeChainWatcher; - exports.watchPath = _emberMetalWatch_path.watchPath; - exports.unwatchPath = _emberMetalWatch_path.unwatchPath; - exports.destroy = _emberMetalWatching.destroy; - exports.isWatching = _emberMetalWatching.isWatching; - exports.unwatch = _emberMetalWatching.unwatch; - exports.watch = _emberMetalWatching.watch; - exports.watcherCount = _emberMetalWatching.watcherCount; - exports.libraries = _emberMetalLibraries.default; - exports.Map = _emberMetalMap.Map; - exports.MapWithDefault = _emberMetalMap.MapWithDefault; - exports.OrderedSet = _emberMetalMap.OrderedSet; - exports.getProperties = _emberMetalGet_properties.default; - exports.setProperties = _emberMetalSet_properties.default; - exports.expandProperties = _emberMetalExpand_properties.default; - exports._suspendObserver = _emberMetalObserver._suspendObserver; - exports._suspendObservers = _emberMetalObserver._suspendObservers; - exports.addObserver = _emberMetalObserver.addObserver; - exports.observersFor = _emberMetalObserver.observersFor; - exports.removeObserver = _emberMetalObserver.removeObserver; - exports._addBeforeObserver = _emberMetalObserver._addBeforeObserver; - exports._removeBeforeObserver = _emberMetalObserver._removeBeforeObserver; - exports.NAME_KEY = _emberMetalMixin.NAME_KEY; - exports.Mixin = _emberMetalMixin.Mixin; - exports.aliasMethod = _emberMetalMixin.aliasMethod; - exports._immediateObserver = _emberMetalMixin._immediateObserver; - exports._beforeObserver = _emberMetalMixin._beforeObserver; - exports.mixin = _emberMetalMixin.mixin; - exports.observer = _emberMetalMixin.observer; - exports.required = _emberMetalMixin.required; - exports.REQUIRED = _emberMetalMixin.REQUIRED; - exports.hasUnprocessedMixins = _emberMetalMixin.hasUnprocessedMixins; - exports.clearUnprocessedMixins = _emberMetalMixin.clearUnprocessedMixins; - exports.detectBinding = _emberMetalMixin.detectBinding; - exports.Binding = _emberMetalBinding.Binding; - exports.bind = _emberMetalBinding.bind; - exports.isGlobalPath = _emberMetalPath_cache.isGlobalPath; - exports.InjectedProperty = _emberMetalInjected_property.default; - exports.setHasViews = _emberMetalTags.setHasViews; - exports.tagForProperty = _emberMetalTags.tagForProperty; - exports.tagFor = _emberMetalTags.tagFor; - exports.markObjectAsDirty = _emberMetalTags.markObjectAsDirty; - exports.replace = _emberMetalReplace.default; - exports.runInTransaction = _emberMetalTransaction.default; - exports.didRender = _emberMetalTransaction.didRender; - exports.assertNotRendered = _emberMetalTransaction.assertNotRendered; - exports.isProxy = _emberMetalIs_proxy.isProxy; - exports.descriptor = _emberMetalDescriptor.default; - - // TODO: this needs to be deleted once we refactor the build tooling - // do this for side-effects of updating Ember.assert, warn, etc when - // ember-debug is present - // This needs to be called before any deprecateFunc - - if (_require.has('ember-debug')) { - _require.default('ember-debug'); - } -}); -enifed('ember-metal/injected_property', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/properties'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalComputed, _emberMetalAlias, _emberMetalProperties) { - 'use strict'; - - exports.default = InjectedProperty; - - /** - Read-only property that returns the result of a container lookup. - - @class InjectedProperty - @namespace Ember - @constructor - @param {String} type The container type the property will lookup - @param {String} name (optional) The name the property will lookup, defaults - to the property's name - @private - */ - - function InjectedProperty(type, name) { - this.type = type; - this.name = name; - - this._super$Constructor(injectedPropertyGet); - AliasedPropertyPrototype.oneWay.call(this); - } - - function injectedPropertyGet(keyName) { - var desc = this[keyName]; - var owner = _emberUtils.getOwner(this) || this.container; // fallback to `container` for backwards compat - - _emberMetalDebug.assert('InjectedProperties should be defined with the Ember.inject computed property macros.', desc && desc.isDescriptor && desc.type); - _emberMetalDebug.assert('Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container.', owner); - - return owner.lookup(desc.type + ':' + (desc.name || keyName)); - } - - InjectedProperty.prototype = Object.create(_emberMetalProperties.Descriptor.prototype); - - var InjectedPropertyPrototype = InjectedProperty.prototype; - var ComputedPropertyPrototype = _emberMetalComputed.ComputedProperty.prototype; - var AliasedPropertyPrototype = _emberMetalAlias.AliasedProperty.prototype; - - InjectedPropertyPrototype._super$Constructor = _emberMetalComputed.ComputedProperty; - - InjectedPropertyPrototype.get = ComputedPropertyPrototype.get; - InjectedPropertyPrototype.readOnly = ComputedPropertyPrototype.readOnly; - InjectedPropertyPrototype.teardown = ComputedPropertyPrototype.teardown; -}); -enifed('ember-metal/instrumentation', ['exports', 'ember-environment', 'ember-metal/features'], function (exports, _emberEnvironment, _emberMetalFeatures) { - 'use strict'; - - exports.instrument = instrument; - exports._instrumentStart = _instrumentStart; - exports.subscribe = subscribe; - exports.unsubscribe = unsubscribe; - exports.reset = reset; - - /** - The purpose of the Ember Instrumentation module is - to provide efficient, general-purpose instrumentation - for Ember. - - Subscribe to a listener by using `Ember.subscribe`: - - ```javascript - Ember.subscribe("render", { - before(name, timestamp, payload) { - - }, - - after(name, timestamp, payload) { - - } - }); - ``` - - If you return a value from the `before` callback, that same - value will be passed as a fourth parameter to the `after` - callback. - - Instrument a block of code by using `Ember.instrument`: - - ```javascript - Ember.instrument("render.handlebars", payload, function() { - // rendering logic - }, binding); - ``` - - Event names passed to `Ember.instrument` are namespaced - by periods, from more general to more specific. Subscribers - can listen for events by whatever level of granularity they - are interested in. - - In the above example, the event is `render.handlebars`, - and the subscriber listened for all events beginning with - `render`. It would receive callbacks for events named - `render`, `render.handlebars`, `render.container`, or - even `render.handlebars.layout`. - - @class Instrumentation - @namespace Ember - @static - @private - */ - var subscribers = []; - exports.subscribers = subscribers; - var cache = {}; - - function populateListeners(name) { - var listeners = []; - var subscriber = undefined; - - for (var i = 0; i < subscribers.length; i++) { - subscriber = subscribers[i]; - if (subscriber.regex.test(name)) { - listeners.push(subscriber.object); - } - } - - cache[name] = listeners; - return listeners; - } - - var time = (function () { - var perf = 'undefined' !== typeof window ? window.performance || {} : {}; - var fn = perf.now || perf.mozNow || perf.webkitNow || perf.msNow || perf.oNow; - // fn.bind will be available in all the browsers that support the advanced window.performance... ;-) - return fn ? fn.bind(perf) : function () { - return +new Date(); - }; - })(); - - /** - Notifies event's subscribers, calls `before` and `after` hooks. - - @method instrument - @namespace Ember.Instrumentation - - @param {String} [name] Namespaced event name. - @param {Object} _payload - @param {Function} callback Function that you're instrumenting. - @param {Object} binding Context that instrument function is called with. - @private - */ - - function instrument(name, _payload, callback, binding) { - if (arguments.length <= 3 && typeof _payload === 'function') { - binding = callback; - callback = _payload; - _payload = undefined; - } - if (subscribers.length === 0) { - return callback.call(binding); - } - var payload = _payload || {}; - var finalizer = _instrumentStart(name, function () { - return payload; - }); - - if (finalizer) { - return withFinalizer(callback, finalizer, payload, binding); - } else { - return callback.call(binding); - } - } - - var flaggedInstrument = undefined; - 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 { - result = callback.call(binding); - } catch (e) { - payload.exception = e; - result = payload; - } finally { - finalizer(); - return result; - } - } - - function NOOP() {} - - // private for now - - function _instrumentStart(name, _payload, _payloadParam) { - if (subscribers.length === 0) { - return NOOP; - } - - var listeners = cache[name]; - - if (!listeners) { - listeners = populateListeners(name); - } - - if (listeners.length === 0) { - return NOOP; - } - - var payload = _payload(_payloadParam); - - var STRUCTURED_PROFILE = _emberEnvironment.ENV.STRUCTURED_PROFILE; - var timeName = undefined; - if (STRUCTURED_PROFILE) { - timeName = name + ': ' + payload.object; - console.time(timeName); - } - - var beforeValues = new Array(listeners.length); - var i = undefined, - listener = undefined; - var timestamp = time(); - for (i = 0; i < listeners.length; i++) { - listener = listeners[i]; - beforeValues[i] = listener.before(name, timestamp, payload); - } - - return function _instrumentEnd() { - var i = undefined, - listener = undefined; - var timestamp = time(); - for (i = 0; i < listeners.length; i++) { - listener = listeners[i]; - if (typeof listener.after === 'function') { - listener.after(name, timestamp, payload, beforeValues[i]); - } - } - - if (STRUCTURED_PROFILE) { - console.timeEnd(timeName); - } - }; - } - - /** - Subscribes to a particular event or instrumented block of code. - - @method subscribe - @namespace Ember.Instrumentation - - @param {String} [pattern] Namespaced event name. - @param {Object} [object] Before and After hooks. - - @return {Subscriber} - @private - */ - - function subscribe(pattern, object) { - var paths = pattern.split('.'); - var path = undefined; - var regex = []; - - for (var i = 0; i < paths.length; i++) { - path = paths[i]; - if (path === '*') { - regex.push('[^\\.]*'); - } else { - regex.push(path); - } - } - - regex = regex.join('\\.'); - regex = regex + '(\\..*)?'; - - var subscriber = { - pattern: pattern, - regex: new RegExp('^' + regex + '$'), - object: object - }; - - subscribers.push(subscriber); - cache = {}; - - return subscriber; - } - - /** - Unsubscribes from a particular event or instrumented block of code. - - @method unsubscribe - @namespace Ember.Instrumentation - - @param {Object} [subscriber] - @private - */ - - function unsubscribe(subscriber) { - var index = undefined; - - for (var i = 0; i < subscribers.length; i++) { - if (subscribers[i] === subscriber) { - index = i; - } - } - - subscribers.splice(index, 1); - cache = {}; - } - - /** - Resets `Ember.Instrumentation` by flushing list of subscribers. - - @method reset - @namespace Ember.Instrumentation - @private - */ - - function reset() { - 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. - - ```javascript - Ember.isBlank(); // true - Ember.isBlank(null); // true - Ember.isBlank(undefined); // true - Ember.isBlank(''); // true - Ember.isBlank([]); // true - Ember.isBlank('\n\t'); // true - Ember.isBlank(' '); // true - Ember.isBlank({}); // false - Ember.isBlank('\n\t Hello'); // false - Ember.isBlank('Hello world'); // false - Ember.isBlank([1,2,3]); // false - ``` - - @method isBlank - @for Ember - @param {Object} obj Value to test - @return {Boolean} - @since 1.5.0 - @public - */ - - 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'; - - exports.default = isEmpty; - - /** - Verifies that a value is `null` or an empty string, empty array, - or empty function. - - Constrains the rules on `Ember.isNone` by returning true for empty - string and empty arrays. - - ```javascript - Ember.isEmpty(); // true - Ember.isEmpty(null); // true - Ember.isEmpty(undefined); // true - Ember.isEmpty(''); // true - Ember.isEmpty([]); // true - Ember.isEmpty({}); // false - Ember.isEmpty('Adam Hawkins'); // false - Ember.isEmpty([0,1,2]); // false - Ember.isEmpty('\n\t'); // false - Ember.isEmpty(' '); // false - ``` - - @method isEmpty - @for Ember - @param {Object} obj Value to test - @return {Boolean} - @public - */ - - function isEmpty(obj) { - var none = _emberMetalIs_none.default(obj); - if (none) { - return none; - } - - if (typeof obj.size === 'number') { - return !obj.size; - } - - var objectType = typeof obj; - - if (objectType === 'object') { - var size = _emberMetalProperty_get.get(obj, 'size'); - if (typeof size === 'number') { - return !size; - } - } - - if (typeof obj.length === 'number' && objectType !== 'function') { - return !obj.length; - } - - if (objectType === 'object') { - var _length = _emberMetalProperty_get.get(obj, 'length'); - if (typeof _length === 'number') { - return !_length; - } - } - - return false; - } -}); -enifed("ember-metal/is_none", ["exports"], function (exports) { - /** - Returns true if the passed value is null or undefined. This avoids errors - from JSLint complaining about use of ==, which can be technically - confusing. - - ```javascript - Ember.isNone(); // true - Ember.isNone(null); // true - Ember.isNone(undefined); // true - Ember.isNone(''); // false - Ember.isNone([]); // false - Ember.isNone(function() {}); // false - ``` - - @method isNone - @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`. - - ```javascript - Ember.isPresent(); // false - Ember.isPresent(null); // false - Ember.isPresent(undefined); // false - Ember.isPresent(''); // false - Ember.isPresent(' '); // false - Ember.isPresent('\n\t'); // false - Ember.isPresent([]); // false - Ember.isPresent({ length: 0 }) // false - Ember.isPresent(false); // true - Ember.isPresent(true); // true - Ember.isPresent('string'); // true - Ember.isPresent(0); // true - Ember.isPresent(function() {}) // true - Ember.isPresent({}); // true - Ember.isPresent(false); // true - Ember.isPresent('\n\t Hello'); // true - Ember.isPresent([1,2,3]); // true - ``` - - @method isPresent - @for Ember - @param {Object} obj Value to test - @return {Boolean} - @since 1.8.0 - @public - */ - - function isPresent(obj) { - return !_emberMetalIs_blank.default(obj); - } -}); -enifed('ember-metal/is_proxy', ['exports', 'ember-metal/meta'], function (exports, _emberMetalMeta) { - 'use strict'; - - exports.isProxy = isProxy; - - function isProxy(value) { - if (typeof value === 'object' && value) { - var meta = _emberMetalMeta.peekMeta(value); - return meta && meta.isProxy(); - } - - return false; - } -}); -enifed('ember-metal/libraries', ['exports', 'ember-metal/debug', 'ember-metal/features'], function (exports, _emberMetalDebug, _emberMetalFeatures) { - 'use strict'; - - exports.Libraries = Libraries; - - /** - Helper class that allows you to register your library with Ember. - - Singleton created at `Ember.libraries`. - - @class Libraries - @constructor - @private - */ - - function Libraries() { - this._registry = []; - this._coreLibIndex = 0; - } - - Libraries.prototype = { - constructor: Libraries, - - _getLibraryByName: function (name) { - var libs = this._registry; - var count = libs.length; - - for (var i = 0; i < count; i++) { - if (libs[i].name === name) { - return libs[i]; - } - } - }, - - register: function (name, version, isCoreLibrary) { - var index = this._registry.length; - - if (!this._getLibraryByName(name)) { - if (isCoreLibrary) { - index = this._coreLibIndex++; - } - this._registry.splice(index, 0, { name: name, version: version }); - } else { - _emberMetalDebug.warn('Library "' + name + '" is already registered with Ember.', false, { id: 'ember-metal.libraries-register' }); - } - }, - - registerCoreLibrary: function (name, version) { - this.register(name, version, true); - }, - - deRegister: function (name) { - var lib = this._getLibraryByName(name); - var index = undefined; - - if (lib) { - index = this._registry.indexOf(lib); - 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-utils'], function (exports, _emberUtils) { - /** - @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) { - throw new TypeError('Constructor ' + name + ' requires \'new\''); - } - - function copyNull(obj) { - var output = new _emberUtils.EmptyObject(); - - for (var prop in obj) { - // hasOwnPropery is not needed because obj is new EmptyObject(); - output[prop] = obj[prop]; - } - - return output; - } - - function copyMap(original, newObject) { - var keys = original._keys.copy(); - var values = copyNull(original._values); - - newObject._keys = keys; - newObject._values = values; - newObject.size = original.size; - - return newObject; - } - - /** - This class is used internally by Ember and Ember Data. - Please do not use it at this time. We plan to clean it up - and add many tests soon. - - @class OrderedSet - @namespace Ember - @constructor - @private - */ - function OrderedSet() { - if (this instanceof OrderedSet) { - this.clear(); - this._silenceRemoveDeprecation = false; - } else { - missingNew('OrderedSet'); - } - } - - /** - @method create - @static - @return {Ember.OrderedSet} - @private - */ - OrderedSet.create = function () { - var Constructor = this; - - return new Constructor(); - }; - - OrderedSet.prototype = { - constructor: OrderedSet, - /** - @method clear - @private - */ - clear: function () { - this.presenceSet = new _emberUtils.EmptyObject(); - this.list = []; - this.size = 0; - }, - - /** - @method add - @param obj - @param guid (optional, and for internal use) - @return {Ember.OrderedSet} - @private - */ - add: function (obj, _guid) { - var guid = _guid || _emberUtils.guidFor(obj); - var presenceSet = this.presenceSet; - var list = this.list; - - if (presenceSet[guid] !== true) { - presenceSet[guid] = true; - this.size = list.push(obj); - } - - return this; - }, - - /** - @since 1.8.0 - @method delete - @param obj - @param _guid (optional and for internal use only) - @return {Boolean} - @private - */ - delete: function (obj, _guid) { - var guid = _guid || _emberUtils.guidFor(obj); - var presenceSet = this.presenceSet; - var list = this.list; - - if (presenceSet[guid] === true) { - delete presenceSet[guid]; - var index = list.indexOf(obj); - if (index > -1) { - list.splice(index, 1); - } - this.size = list.length; - return true; - } else { - return false; - } - }, - - /** - @method isEmpty - @return {Boolean} - @private - */ - isEmpty: function () { - return this.size === 0; - }, - - /** - @method has - @param obj - @return {Boolean} - @private - */ - has: function (obj) { - if (this.size === 0) { - return false; - } - - var guid = _emberUtils.guidFor(obj); - var presenceSet = this.presenceSet; - - return presenceSet[guid] === true; - }, - - /** - @method forEach - @param {Function} fn - @param self - @private - */ - forEach: function (fn /*, ...thisArg*/) { - if (typeof fn !== 'function') { - missingFunction(fn); - } - - if (this.size === 0) { - return; - } - - var list = this.list; - - if (arguments.length === 2) { - for (var i = 0; i < list.length; i++) { - fn.call(arguments[1], list[i]); - } - } else { - for (var i = 0; i < list.length; i++) { - fn(list[i]); - } - } - }, - - /** - @method toArray - @return {Array} - @private - */ - toArray: function () { - return this.list.slice(); - }, - - /** - @method copy - @return {Ember.OrderedSet} - @private - */ - copy: function () { - var Constructor = this.constructor; - var set = new Constructor(); - - set._silenceRemoveDeprecation = this._silenceRemoveDeprecation; - set.presenceSet = copyNull(this.presenceSet); - set.list = this.toArray(); - set.size = this.size; - - return set; - } - }; - - /** - A Map stores values indexed by keys. Unlike JavaScript's - default Objects, the keys of a Map can be any JavaScript - object. - - Internally, a Map has two data structures: - - 1. `keys`: an OrderedSet of all of the existing keys - 2. `values`: a JavaScript Object indexed by the `Ember.guidFor(key)` - - When a key/value pair is added for the first time, we - add the key to the `keys` OrderedSet, and create or - replace an entry in `values`. When an entry is deleted, - we delete its entry in `keys` and `values`. - - @class Map - @namespace Ember - @private - @constructor - */ - function Map() { - if (this instanceof Map) { - this._keys = OrderedSet.create(); - this._keys._silenceRemoveDeprecation = true; - this._values = new _emberUtils.EmptyObject(); - this.size = 0; - } else { - missingNew('Map'); - } - } - - /** - @method create - @static - @private - */ - Map.create = function () { - var Constructor = this; - return new Constructor(); - }; - - Map.prototype = { - constructor: Map, - - /** - This property will change as the number of objects in the map changes. - @since 1.8.0 - @property size - @type number - @default 0 - @private - */ - size: 0, - - /** - Retrieve the value associated with a given key. - @method get - @param {*} key - @return {*} the value associated with the key, or `undefined` - @private - */ - get: function (key) { - if (this.size === 0) { - return; - } - - var values = this._values; - var guid = _emberUtils.guidFor(key); - - return values[guid]; - }, - - /** - Adds a value to the map. If a value for the given key has already been - provided, the new value will replace the old value. - @method set - @param {*} key - @param {*} value - @return {Ember.Map} - @private - */ - set: function (key, value) { - var keys = this._keys; - var values = this._values; - var guid = _emberUtils.guidFor(key); - - // ensure we don't store -0 - var k = key === -0 ? 0 : key; - - keys.add(k, guid); - - values[guid] = value; - - this.size = keys.size; - - return this; - }, - - /** - Removes a value from the map for an associated key. - @since 1.8.0 - @method delete - @param {*} key - @return {Boolean} true if an item was removed, false otherwise - @private - */ - delete: function (key) { - if (this.size === 0) { - return false; - } - // don't use ES6 "delete" because it will be annoying - // to use in browsers that are not ES6 friendly; - var keys = this._keys; - var values = this._values; - var guid = _emberUtils.guidFor(key); - - if (keys.delete(key, guid)) { - delete values[guid]; - this.size = keys.size; - return true; - } else { - return false; - } - }, - - /** - Check whether a key is present. - @method has - @param {*} key - @return {Boolean} true if the item was present, false otherwise - @private - */ - has: function (key) { - return this._keys.has(key); - }, - - /** - Iterate over all the keys and values. Calls the function once - for each key, passing in value, key, and the map being iterated over, - in that order. - The keys are guaranteed to be iterated over in insertion order. - @method forEach - @param {Function} callback - @param {*} self if passed, the `this` value inside the - callback. By default, `this` is the map. - @private - */ - forEach: function (callback /*, ...thisArg*/) { - if (typeof callback !== 'function') { - missingFunction(callback); - } - - if (this.size === 0) { - return; - } - - var map = this; - var cb = undefined, - thisArg = undefined; - - if (arguments.length === 2) { - thisArg = arguments[1]; - cb = function (key) { - return callback.call(thisArg, map.get(key), key, map); - }; - } else { - cb = function (key) { - return callback(map.get(key), key, map); - }; - } - - this._keys.forEach(cb); - }, - - /** - @method clear - @private - */ - clear: function () { - this._keys.clear(); - this._values = new _emberUtils.EmptyObject(); - this.size = 0; - }, - - /** - @method copy - @return {Ember.Map} - @private - */ - copy: function () { - return copyMap(this, new Map()); - } - }; - - /** - @class MapWithDefault - @namespace Ember - @extends Ember.Map - @private - @constructor - @param [options] - @param {*} [options.defaultValue] - */ - function MapWithDefault(options) { - this._super$constructor(); - this.defaultValue = options.defaultValue; - } - - /** - @method create - @static - @param [options] - @param {*} [options.defaultValue] - @return {Ember.MapWithDefault|Ember.Map} If options are passed, returns - `Ember.MapWithDefault` otherwise returns `Ember.Map` - @private - */ - MapWithDefault.create = function (options) { - if (options) { - return new MapWithDefault(options); - } else { - return new Map(); - } - }; - - MapWithDefault.prototype = Object.create(Map.prototype); - MapWithDefault.prototype.constructor = MapWithDefault; - MapWithDefault.prototype._super$constructor = Map; - MapWithDefault.prototype._super$get = Map.prototype.get; - - /** - Retrieve the value associated with a given key. - - @method get - @param {*} key - @return {*} the value associated with the key, or the default value - @private - */ - MapWithDefault.prototype.get = function (key) { - var hasValue = this.has(key); - - if (hasValue) { - return this._super$get(key); - } else { - var defaultValue = this.defaultValue(key); - this.set(key, defaultValue); - return defaultValue; - } - }; - - /** - @method copy - @return {Ember.MapWithDefault} - @private - */ - MapWithDefault.prototype.copy = function () { - var Constructor = this.constructor; - return copyMap(this, new Constructor({ - defaultValue: this.defaultValue - })); - }; - - exports.default = Map; - exports.OrderedSet = OrderedSet; - exports.Map = Map; - exports.MapWithDefault = MapWithDefault; -}); -enifed('ember-metal/merge', ['exports'], function (exports) { - /** - Merge the contents of two objects together into the first object. - - ```javascript - Ember.merge({ first: 'Tom' }, { last: 'Dale' }); // { first: 'Tom', last: 'Dale' } - var a = { first: 'Yehuda' }; - var b = { last: 'Katz' }; - Ember.merge(a, b); // a == { first: 'Yehuda', last: 'Katz' }, b == { last: 'Katz' } - ``` - - @method merge - @for Ember - @param {Object} original The object to merge into - @param {Object} updates The object to copy properties from - @return {Object} - @public - */ - 'use strict'; - - exports.default = merge; - - function merge(original, updates) { - if (!updates || typeof updates !== 'object') { - return original; - } - - var props = Object.keys(updates); - var prop = undefined; - - for (var i = 0; i < props.length; i++) { - prop = props[i]; - original[prop] = updates[prop]; - } - - return original; - } -}); -enifed('ember-metal/meta', ['exports', 'ember-utils', 'ember-metal/features', 'ember-metal/meta_listeners', 'ember-metal/debug', 'ember-metal/chains'], function (exports, _emberUtils, _emberMetalFeatures, _emberMetalMeta_listeners, _emberMetalDebug, _emberMetalChains) { - 'no use strict'; - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - - exports.Meta = Meta; - exports.deleteMeta = deleteMeta; - exports.meta = meta; - - var counters = { - peekCalls: 0, - peekParentCalls: 0, - peekPrototypeWalks: 0, - setCalls: 0, - deleteCalls: 0, - metaCalls: 0, - metaInstantiated: 0 - }; - - /** - @module ember-metal - */ - - /* - This declares several meta-programmed members on the Meta class. Such - meta! - - In general, the `readable` variants will give you an object (if it - already exists) that you can read but should not modify. The - `writable` variants will give you a mutable object, and they will - create it if it didn't already exist. - - The following methods will get generated metaprogrammatically, and - I'm including them here for greppability: - - writableCache, readableCache, writeWatching, - peekWatching, clearWatching, writeMixins, - peekMixins, clearMixins, writeBindings, - peekBindings, clearBindings, writeValues, - peekValues, clearValues, writeDeps, forEachInDeps - writableChainWatchers, readableChainWatchers, writableChains, - readableChains, writableTag, readableTag, writableTags, - readableTags - */ - var members = { - cache: ownMap, - weak: ownMap, - watching: inheritedMap, - mixins: inheritedMap, - bindings: inheritedMap, - values: inheritedMap, - chainWatchers: ownCustomObject, - chains: inheritedCustomObject, - tag: ownCustomObject, - tags: ownMap - }; - - // FLAGS - var SOURCE_DESTROYING = 1 << 1; - var SOURCE_DESTROYED = 1 << 2; - var META_DESTROYED = 1 << 3; - var IS_PROXY = 1 << 4; - - if (true || true) { - members.lastRendered = ownMap; - members.lastRenderedFrom = ownMap; // FIXME: not used in production, remove me from prod builds - } - - var memberNames = Object.keys(members); - var META_FIELD = '__ember_meta__'; - - function Meta(obj, parentMeta) { - _emberMetalDebug.runInDebug(function () { - return counters.metaInstantiated++; - }); - - this._cache = undefined; - this._weak = undefined; - this._watching = undefined; - this._mixins = undefined; - this._bindings = undefined; - this._values = undefined; - this._deps = undefined; - this._chainWatchers = undefined; - this._chains = undefined; - this._tag = undefined; - this._tags = undefined; - - // initial value for all flags right now is false - // see FLAGS const for detailed list of flags used - this._flags = 0; - - // used only internally - this.source = obj; - - // when meta(obj).proto === obj, the object is intended to be only a - // prototype and doesn't need to actually be observable itself - this.proto = undefined; - - // The next meta in our inheritance chain. We (will) track this - // explicitly instead of using prototypical inheritance because we - // have detailed knowledge of how each property should really be - // inherited, and we can optimize it much better than JS runtimes. - this.parent = parentMeta; - - if (true || true) { - this._lastRendered = undefined; - this._lastRenderedFrom = undefined; // FIXME: not used in production, remove me from prod builds - } - - this._initializeListeners(); - } - - Meta.prototype.isInitialized = function (obj) { - return this.proto !== obj; - }; - - var NODE_STACK = []; - - Meta.prototype.destroy = function () { - if (this.isMetaDestroyed()) { - return; - } - - // remove chainWatchers to remove circular references that would prevent GC - var node = undefined, - nodes = undefined, - key = undefined, - nodeObject = undefined; - node = this.readableChains(); - if (node) { - NODE_STACK.push(node); - // process tree - while (NODE_STACK.length > 0) { - node = NODE_STACK.pop(); - // push children - nodes = node._chains; - if (nodes) { - for (key in nodes) { - if (nodes[key] !== undefined) { - NODE_STACK.push(nodes[key]); - } - } - } - - // remove chainWatcher in node object - if (node._watching) { - nodeObject = node._object; - if (nodeObject) { - var foreignMeta = peekMeta(nodeObject); - // avoid cleaning up chain watchers when both current and - // foreign objects are being destroyed - // if both are being destroyed manual cleanup is not needed - // as they will be GC'ed and no non-destroyed references will - // be remaining - if (foreignMeta && !foreignMeta.isSourceDestroying()) { - _emberMetalChains.removeChainWatcher(nodeObject, node._key, node, foreignMeta); - } - } - } - } - } - - this.setMetaDestroyed(); - }; - - for (var _name in _emberMetalMeta_listeners.protoMethods) { - Meta.prototype[_name] = _emberMetalMeta_listeners.protoMethods[_name]; - } - memberNames.forEach(function (name) { - return members[name](name, Meta); - }); - - Meta.prototype.isSourceDestroying = function isSourceDestroying() { - return (this._flags & SOURCE_DESTROYING) !== 0; - }; - - Meta.prototype.setSourceDestroying = function setSourceDestroying() { - this._flags |= SOURCE_DESTROYING; - }; - - Meta.prototype.isSourceDestroyed = function isSourceDestroyed() { - return (this._flags & SOURCE_DESTROYED) !== 0; - }; - - Meta.prototype.setSourceDestroyed = function setSourceDestroyed() { - this._flags |= SOURCE_DESTROYED; - }; - - Meta.prototype.isMetaDestroyed = function isMetaDestroyed() { - return (this._flags & META_DESTROYED) !== 0; - }; - - Meta.prototype.setMetaDestroyed = function setMetaDestroyed() { - this._flags |= META_DESTROYED; - }; - - Meta.prototype.isProxy = function isProxy() { - return (this._flags & IS_PROXY) !== 0; - }; - - Meta.prototype.setProxy = function setProxy() { - this._flags |= IS_PROXY; - }; - - // Implements a member that is a lazily created, non-inheritable - // POJO. - function ownMap(name, Meta) { - var key = memberProperty(name); - var capitalized = capitalize(name); - Meta.prototype['writable' + capitalized] = function () { - return this._getOrCreateOwnMap(key); - }; - Meta.prototype['readable' + capitalized] = function () { - return this[key]; - }; - } - - Meta.prototype._getOrCreateOwnMap = function (key) { - var ret = this[key]; - if (!ret) { - ret = this[key] = new _emberUtils.EmptyObject(); - } - return ret; - }; - - // Implements a member that is a lazily created POJO with inheritable - // values. - function inheritedMap(name, Meta) { - var key = memberProperty(name); - var capitalized = capitalize(name); - - Meta.prototype['write' + capitalized] = function (subkey, value) { - _emberMetalDebug.assert('Cannot call write' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); - - var map = this._getOrCreateOwnMap(key); - map[subkey] = value; - }; - - Meta.prototype['peek' + capitalized] = function (subkey) { - return this._findInherited(key, subkey); - }; - - Meta.prototype['forEach' + capitalized] = function (fn) { - var pointer = this; - var seen = new _emberUtils.EmptyObject(); - while (pointer !== undefined) { - var map = pointer[key]; - if (map) { - for (var _key in map) { - if (!seen[_key]) { - seen[_key] = true; - fn(_key, map[_key]); - } - } - } - pointer = pointer.parent; - } - }; - - Meta.prototype['clear' + capitalized] = function () { - _emberMetalDebug.assert('Cannot call clear' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); - - this[key] = undefined; - }; - - Meta.prototype['deleteFrom' + capitalized] = function (subkey) { - delete this._getOrCreateOwnMap(key)[subkey]; - }; - - Meta.prototype['hasIn' + capitalized] = function (subkey) { - return this._findInherited(key, subkey) !== undefined; - }; - } - - Meta.prototype._getInherited = function (key) { - var pointer = this; - while (pointer !== undefined) { - if (pointer[key]) { - return pointer[key]; - } - pointer = pointer.parent; - } - }; - - Meta.prototype._findInherited = function (key, subkey) { - var pointer = this; - while (pointer !== undefined) { - var map = pointer[key]; - if (map) { - var value = map[subkey]; - if (value !== undefined) { - return value; - } - } - pointer = pointer.parent; - } - }; - - var UNDEFINED = _emberUtils.symbol('undefined'); - - exports.UNDEFINED = UNDEFINED; - // Implements a member that provides a lazily created map of maps, - // with inheritance at both levels. - Meta.prototype.writeDeps = function writeDeps(subkey, itemkey, value) { - _emberMetalDebug.assert('Cannot call writeDeps after the object is destroyed.', !this.isMetaDestroyed()); - - var outerMap = this._getOrCreateOwnMap('_deps'); - var innerMap = outerMap[subkey]; - if (!innerMap) { - innerMap = outerMap[subkey] = new _emberUtils.EmptyObject(); - } - innerMap[itemkey] = value; - }; - - Meta.prototype.peekDeps = function peekDeps(subkey, itemkey) { - var pointer = this; - while (pointer !== undefined) { - var map = pointer._deps; - if (map) { - var value = map[subkey]; - if (value) { - if (value[itemkey] !== undefined) { - return value[itemkey]; - } - } - } - pointer = pointer.parent; - } - }; - - Meta.prototype.hasDeps = function hasDeps(subkey) { - var pointer = this; - while (pointer !== undefined) { - if (pointer._deps && pointer._deps[subkey]) { - return true; - } - pointer = pointer.parent; - } - return false; - }; - - Meta.prototype.forEachInDeps = function forEachInDeps(subkey, fn) { - return this._forEachIn('_deps', subkey, fn); - }; - - Meta.prototype._forEachIn = function (key, subkey, fn) { - var pointer = this; - var seen = new _emberUtils.EmptyObject(); - var calls = []; - while (pointer !== undefined) { - var map = pointer[key]; - if (map) { - var innerMap = map[subkey]; - if (innerMap) { - for (var innerKey in innerMap) { - if (!seen[innerKey]) { - seen[innerKey] = true; - calls.push([innerKey, innerMap[innerKey]]); - } - } - } - } - pointer = pointer.parent; - } - for (var i = 0; i < calls.length; i++) { - var _calls$i = calls[i]; - var innerKey = _calls$i[0]; - var value = _calls$i[1]; - - fn(innerKey, value); - } - }; - - // Implements a member that provides a non-heritable, lazily-created - // object using the method you provide. - function ownCustomObject(name, Meta) { - var key = memberProperty(name); - var capitalized = capitalize(name); - Meta.prototype['writable' + capitalized] = function (create) { - _emberMetalDebug.assert('Cannot call writable' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); - - var ret = this[key]; - if (!ret) { - ret = this[key] = create(this.source); - } - return ret; - }; - Meta.prototype['readable' + capitalized] = function () { - return this[key]; - }; - } - - // Implements a member that provides an inheritable, lazily-created - // object using the method you provide. We will derived children from - // their parents by calling your object's `copy()` method. - function inheritedCustomObject(name, Meta) { - var key = memberProperty(name); - var capitalized = capitalize(name); - Meta.prototype['writable' + capitalized] = function (create) { - _emberMetalDebug.assert('Cannot call writable' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); - - var ret = this[key]; - if (!ret) { - if (this.parent) { - ret = this[key] = this.parent['writable' + capitalized](create).copy(this.source); - } else { - ret = this[key] = create(this.source); - } - } - return ret; - }; - Meta.prototype['readable' + capitalized] = function () { - return this._getInherited(key); - }; - } - - function memberProperty(name) { - return '_' + name; - } - - // there's a more general-purpose capitalize in ember-runtime, but we - // don't want to make ember-metal depend on ember-runtime. - function capitalize(name) { - return name.replace(/^\w/, function (m) { - return m.toUpperCase(); - }); - } - - var META_DESC = { - writable: true, - configurable: true, - enumerable: false, - value: null - }; - - exports.META_DESC = META_DESC; - var EMBER_META_PROPERTY = { - name: META_FIELD, - descriptor: META_DESC - }; - - if (true) { - 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 = _emberUtils.lookupDescriptor(obj, key); - var isMandatorySetter = descriptor && descriptor.set && descriptor.set.isMandatorySetter; - - if (isMandatorySetter) { - this.writeValues(key, value); - } else { - obj[key] = value; - } - }; - } - - var HAS_NATIVE_WEAKMAP = (function () { - // detect if `WeakMap` is even present - var hasWeakMap = typeof WeakMap === 'function'; - if (!hasWeakMap) { - return false; - } - - var instance = new WeakMap(); - // use `Object`'s `.toString` directly to prevent us from detecting - // polyfills as native weakmaps - return Object.prototype.toString.call(instance) === '[object WeakMap]'; - })(); - - var setMeta = undefined, - peekMeta = undefined; - - // choose the one appropriate for given platform - if (HAS_NATIVE_WEAKMAP) { - (function () { - var getPrototypeOf = Object.getPrototypeOf; - var metaStore = new WeakMap(); - - exports.setMeta = setMeta = function WeakMap_setMeta(obj, meta) { - _emberMetalDebug.runInDebug(function () { - return counters.setCalls++; - }); - metaStore.set(obj, meta); - }; - - exports.peekMeta = peekMeta = function WeakMap_peekMeta(obj) { - _emberMetalDebug.runInDebug(function () { - return counters.peekCalls++; - }); - - return metaStore.get(obj); - }; - - exports.peekMeta = peekMeta = function WeakMap_peekParentMeta(obj) { - var pointer = obj; - var meta = undefined; - while (pointer) { - meta = metaStore.get(pointer); - // jshint loopfunc:true - _emberMetalDebug.runInDebug(function () { - return counters.peekCalls++; - }); - // stop if we find a `null` value, since - // that means the meta was deleted - // any other truthy value is a "real" meta - if (meta === null || meta) { - return meta; - } - - pointer = getPrototypeOf(pointer); - _emberMetalDebug.runInDebug(function () { - return counters.peakPrototypeWalks++; - }); - } - }; - })(); - } else { - exports.setMeta = setMeta = function Fallback_setMeta(obj, meta) { - // if `null` already, just set it to the new value - // otherwise define property first - if (obj[META_FIELD] !== null) { - if (obj.__defineNonEnumerable) { - obj.__defineNonEnumerable(EMBER_META_PROPERTY); - } else { - Object.defineProperty(obj, META_FIELD, META_DESC); - } - } - - obj[META_FIELD] = meta; - }; - - exports.peekMeta = peekMeta = function Fallback_peekMeta(obj) { - return obj[META_FIELD]; - }; - } - - function deleteMeta(obj) { - _emberMetalDebug.runInDebug(function () { - return counters.deleteCalls++; - }); - - var meta = peekMeta(obj); - if (meta) { - meta.destroy(); - } - } - - /** - Retrieves the meta hash for an object. If `writable` is true ensures the - hash is writable for this object as well. - - The meta object contains information about computed property descriptors as - well as any watched properties and other information. You generally will - not access this information directly but instead work with higher level - methods that manipulate this hash indirectly. - - @method meta - @for Ember - @private - - @param {Object} obj The object to retrieve meta for - @param {Boolean} [writable=true] Pass `false` if you do not intend to modify - the meta hash, allowing the method to avoid making an unnecessary copy. - @return {Object} the meta hash for an object - */ - - function meta(obj) { - _emberMetalDebug.runInDebug(function () { - return counters.metaCalls++; - }); - - var maybeMeta = peekMeta(obj); - var parent = undefined; - - // remove this code, in-favor of explicit parent - if (maybeMeta) { - if (maybeMeta.source === obj) { - return maybeMeta; - } - parent = maybeMeta; - } - - var newMeta = new Meta(obj, parent); - setMeta(obj, newMeta); - return newMeta; - } - - exports.peekMeta = peekMeta; - exports.setMeta = setMeta; - exports.counters = counters; -}); -enifed('ember-metal/meta_listeners', ['exports'], function (exports) { - /* - When we render a rich template hierarchy, the set of events that - *might* happen tends to be much larger than the set of events that - actually happen. This implies that we should make listener creation & - destruction cheap, even at the cost of making event dispatch more - expensive. - - Thus we store a new listener with a single push and no new - allocations, without even bothering to do deduplication -- we can - save that for dispatch time, if an event actually happens. - */ - - /* listener flags */ - 'use strict'; - - var ONCE = 1; - exports.ONCE = ONCE; - var SUSPENDED = 2; - - exports.SUSPENDED = SUSPENDED; - var protoMethods = { - - addToListeners: function (eventName, target, method, flags) { - if (!this._listeners) { - this._listeners = []; - } - this._listeners.push(eventName, target, method, flags); - }, - - _finalizeListeners: function () { - if (this._listenersFinalized) { - return; - } - if (!this._listeners) { - this._listeners = []; - } - var pointer = this.parent; - while (pointer) { - var listeners = pointer._listeners; - if (listeners) { - this._listeners = this._listeners.concat(listeners); - } - if (pointer._listenersFinalized) { - break; - } - pointer = pointer.parent; - } - this._listenersFinalized = true; - }, - - removeFromListeners: function (eventName, target, method, didRemove) { - var pointer = this; - while (pointer) { - var listeners = pointer._listeners; - if (listeners) { - for (var index = listeners.length - 4; index >= 0; index -= 4) { - if (listeners[index] === eventName && (!method || listeners[index + 1] === target && listeners[index + 2] === method)) { - if (pointer === this) { - // we are modifying our own list, so we edit directly - if (typeof didRemove === 'function') { - didRemove(eventName, target, listeners[index + 2]); - } - listeners.splice(index, 4); - } else { - // we are trying to remove an inherited listener, so we do - // just-in-time copying to detach our own listeners from - // our inheritance chain. - this._finalizeListeners(); - return this.removeFromListeners(eventName, target, method); - } - } - } - } - if (pointer._listenersFinalized) { - break; - } - pointer = pointer.parent; - } - }, - - matchingListeners: function (eventName) { - var pointer = this; - var result = []; - while (pointer) { - var listeners = pointer._listeners; - if (listeners) { - for (var index = 0; index < listeners.length - 3; index += 4) { - if (listeners[index] === eventName) { - pushUniqueListener(result, listeners, index); - } - } - } - if (pointer._listenersFinalized) { - break; - } - pointer = pointer.parent; - } - var sus = this._suspendedListeners; - if (sus) { - for (var susIndex = 0; susIndex < sus.length - 2; susIndex += 3) { - if (eventName === sus[susIndex]) { - for (var resultIndex = 0; resultIndex < result.length - 2; resultIndex += 3) { - if (result[resultIndex] === sus[susIndex + 1] && result[resultIndex + 1] === sus[susIndex + 2]) { - result[resultIndex + 2] |= SUSPENDED; - } - } - } - } - } - return result; - }, - - suspendListeners: function (eventNames, target, method, callback) { - var sus = this._suspendedListeners; - if (!sus) { - sus = this._suspendedListeners = []; - } - for (var i = 0; i < eventNames.length; i++) { - sus.push(eventNames[i], target, method); - } - try { - return callback.call(target); - } finally { - if (sus.length === eventNames.length) { - this._suspendedListeners = undefined; - } else { - for (var i = sus.length - 3; i >= 0; i -= 3) { - if (sus[i + 1] === target && sus[i + 2] === method && eventNames.indexOf(sus[i]) !== -1) { - sus.splice(i, 3); - } - } - } - } - }, - - watchedEvents: function () { - var pointer = this; - var names = {}; - while (pointer) { - var listeners = pointer._listeners; - if (listeners) { - for (var index = 0; index < listeners.length - 3; index += 4) { - names[listeners[index]] = true; - } - } - if (pointer._listenersFinalized) { - break; - } - pointer = pointer.parent; - } - return Object.keys(names); - }, - - _initializeListeners: function () { - this._listeners = undefined; - this._listenersFinalized = undefined; - this._suspendedListeners = undefined; - } - }; - - exports.protoMethods = protoMethods; - function pushUniqueListener(destination, source, index) { - var target = source[index + 1]; - var method = source[index + 2]; - for (var destinationIndex = 0; destinationIndex < destination.length - 2; destinationIndex += 3) { - if (destination[destinationIndex] === target && destination[destinationIndex + 1] === method) { - return; - } - } - destination.push(target, method, source[index + 3]); - } -}); -enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'ember-metal/debug', 'ember-metal/meta', 'ember-metal/expand_properties', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/binding', 'ember-metal/observer', 'ember-metal/events'], function (exports, _emberUtils, _emberMetalError, _emberMetalDebug, _emberMetalMeta, _emberMetalExpand_properties, _emberMetalProperties, _emberMetalComputed, _emberMetalBinding, _emberMetalObserver, _emberMetalEvents) { - 'no use strict'; - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - - /** - @module ember - @submodule ember-metal - */ - exports.detectBinding = detectBinding; - exports.mixin = mixin; - exports.default = Mixin; - exports.hasUnprocessedMixins = hasUnprocessedMixins; - exports.clearUnprocessedMixins = clearUnprocessedMixins; - exports.required = required; - exports.aliasMethod = aliasMethod; - exports.observer = observer; - exports._immediateObserver = _immediateObserver; - exports._beforeObserver = _beforeObserver; - - function ROOT() {} - ROOT.__hasSuper = false; - - var a_slice = [].slice; - - function isMethod(obj) { - return 'function' === typeof obj && obj.isMethod !== false && obj !== Boolean && obj !== Object && obj !== Number && obj !== Array && obj !== Date && obj !== String; - } - - var CONTINUE = {}; - - function mixinProperties(mixinsMeta, mixin) { - var guid = undefined; - - if (mixin instanceof Mixin) { - guid = _emberUtils.guidFor(mixin); - if (mixinsMeta.peekMixins(guid)) { - return CONTINUE; - } - mixinsMeta.writeMixins(guid, mixin); - return mixin.properties; - } else { - return mixin; // apply anonymous mixin properties - } - } - - function concatenatedMixinProperties(concatProp, props, values, base) { - var concats = undefined; - - // reset before adding each new mixin to pickup concats from previous - concats = values[concatProp] || base[concatProp]; - if (props[concatProp]) { - concats = concats ? concats.concat(props[concatProp]) : props[concatProp]; - } - - return concats; - } - - function giveDescriptorSuper(meta, key, property, values, descs, base) { - var superProperty = undefined; - - // Computed properties override methods, and do not call super to them - if (values[key] === undefined) { - // Find the original descriptor in a parent mixin - superProperty = descs[key]; - } - - // If we didn't find the original descriptor in a parent mixin, find - // it on the original object. - if (!superProperty) { - var possibleDesc = base[key]; - var superDesc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - superProperty = superDesc; - } - - if (superProperty === undefined || !(superProperty instanceof _emberMetalComputed.ComputedProperty)) { - return property; - } - - // Since multiple mixins may inherit from the same parent, we need - // to clone the computed property so that other mixins do not receive - // the wrapped version. - property = Object.create(property); - property._getter = _emberUtils.wrap(property._getter, superProperty._getter); - if (superProperty._setter) { - if (property._setter) { - property._setter = _emberUtils.wrap(property._setter, superProperty._setter); - } else { - property._setter = superProperty._setter; - } - } - - return property; - } - - function giveMethodSuper(obj, key, method, values, descs) { - var superMethod = undefined; - - // Methods overwrite computed properties, and do not call super to them. - if (descs[key] === undefined) { - // Find the original method in a parent mixin - superMethod = values[key]; - } - - // If we didn't find the original value in a parent mixin, find it in - // the original object - superMethod = superMethod || obj[key]; - - // Only wrap the new method if the original method was a function - if (superMethod === undefined || 'function' !== typeof superMethod) { - return method; - } - - return _emberUtils.wrap(method, superMethod); - } - - function applyConcatenatedProperties(obj, key, value, values) { - var baseValue = values[key] || obj[key]; - - if (baseValue) { - if ('function' === typeof baseValue.concat) { - if (value === null || value === undefined) { - return baseValue; - } else { - return baseValue.concat(value); - } - } else { - return _emberUtils.makeArray(baseValue).concat(value); - } - } else { - return _emberUtils.makeArray(value); - } - } - - function applyMergedProperties(obj, key, value, values) { - var baseValue = values[key] || obj[key]; - - _emberMetalDebug.runInDebug(function () { - if (Array.isArray(value)) { - // use conditional to avoid stringifying every time - _emberMetalDebug.assert('You passed in `' + JSON.stringify(value) + '` as the value for `' + key + '` but `' + key + '` cannot be an Array', false); - } - }); - - if (!baseValue) { - return value; - } - - var newBase = _emberUtils.assign({}, baseValue); - var hasFunction = false; - - for (var prop in value) { - if (!value.hasOwnProperty(prop)) { - continue; - } - - var propValue = value[prop]; - if (isMethod(propValue)) { - // TODO: support for Computed Properties, etc? - hasFunction = true; - newBase[prop] = giveMethodSuper(obj, prop, propValue, baseValue, {}); - } else { - newBase[prop] = propValue; - } - } - - if (hasFunction) { - newBase._super = ROOT; - } - - return newBase; - } - - function addNormalizedProperty(base, key, value, meta, descs, values, concats, mergings) { - if (value instanceof _emberMetalProperties.Descriptor) { - if (value === REQUIRED && descs[key]) { - return CONTINUE; - } - - // Wrap descriptor function to implement - // _super() if needed - if (value._getter) { - value = giveDescriptorSuper(meta, key, value, values, descs, base); - } - - descs[key] = value; - values[key] = undefined; - } else { - if (concats && concats.indexOf(key) >= 0 || key === 'concatenatedProperties' || key === 'mergedProperties') { - value = applyConcatenatedProperties(base, key, value, values); - } else if (mergings && mergings.indexOf(key) >= 0) { - value = applyMergedProperties(base, key, value, values); - } else if (isMethod(value)) { - value = giveMethodSuper(base, key, value, values, descs); - } - - descs[key] = undefined; - values[key] = value; - } - } - - function mergeMixins(mixins, m, descs, values, base, keys) { - var currentMixin = undefined, - props = undefined, - key = undefined, - concats = undefined, - mergings = undefined; - - function removeKeys(keyName) { - delete descs[keyName]; - delete values[keyName]; - } - - for (var i = 0; i < mixins.length; i++) { - currentMixin = mixins[i]; - _emberMetalDebug.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(currentMixin), typeof currentMixin === 'object' && currentMixin !== null && Object.prototype.toString.call(currentMixin) !== '[object Array]'); - - props = mixinProperties(m, currentMixin); - if (props === CONTINUE) { - continue; - } - - if (props) { - if (base.willMergeMixin) { - base.willMergeMixin(props); - } - concats = concatenatedMixinProperties('concatenatedProperties', props, values, base); - mergings = concatenatedMixinProperties('mergedProperties', props, values, base); - - for (key in props) { - if (!props.hasOwnProperty(key)) { - continue; - } - keys.push(key); - addNormalizedProperty(base, key, props[key], m, descs, values, concats, mergings); - } - - // manually copy toString() because some JS engines do not enumerate it - if (props.hasOwnProperty('toString')) { - base.toString = props.toString; - } - } else if (currentMixin.mixins) { - mergeMixins(currentMixin.mixins, m, descs, values, base, keys); - if (currentMixin._without) { - currentMixin._without.forEach(removeKeys); - } - } - } - } - - function detectBinding(key) { - var length = key.length; - - return length > 7 && key.charCodeAt(length - 7) === 66 && key.indexOf('inding', length - 6) !== -1; - } - - // warm both paths of above function - detectBinding('notbound'); - detectBinding('fooBinding'); - - function connectBindings(obj, m) { - // TODO Mixin.apply(instance) should disconnect binding if exists - m.forEachBindings(function (key, binding) { - if (binding) { - var to = key.slice(0, -7); // strip Binding off end - if (binding instanceof _emberMetalBinding.Binding) { - binding = binding.copy(); // copy prototypes' instance - binding.to(to); - } else { - // binding is string path - binding = new _emberMetalBinding.Binding(to, binding); - } - binding.connect(obj); - obj[key] = binding; - } - }); - // mark as applied - m.clearBindings(); - } - - function finishPartial(obj, m) { - connectBindings(obj, m || _emberMetalMeta.meta(obj)); - return obj; - } - - function followAlias(obj, desc, m, descs, values) { - var altKey = desc.methodName; - var value = undefined; - var possibleDesc = undefined; - if (descs[altKey] || values[altKey]) { - value = values[altKey]; - desc = descs[altKey]; - } else if ((possibleDesc = obj[altKey]) && possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor) { - desc = possibleDesc; - value = undefined; - } else { - desc = undefined; - value = obj[altKey]; - } - - return { desc: desc, value: value }; - } - - function updateObserversAndListeners(obj, key, observerOrListener, pathsKey, updateMethod) { - var paths = observerOrListener[pathsKey]; - - if (paths) { - for (var i = 0; i < paths.length; i++) { - updateMethod(obj, paths[i], null, key); - } - } - } - - function replaceObserversAndListeners(obj, key, observerOrListener) { - var prev = obj[key]; - - if ('function' === typeof prev) { - updateObserversAndListeners(obj, key, prev, '__ember_observesBefore__', _emberMetalObserver._removeBeforeObserver); - updateObserversAndListeners(obj, key, prev, '__ember_observes__', _emberMetalObserver.removeObserver); - updateObserversAndListeners(obj, key, prev, '__ember_listens__', _emberMetalEvents.removeListener); - } - - if ('function' === typeof observerOrListener) { - updateObserversAndListeners(obj, key, observerOrListener, '__ember_observesBefore__', _emberMetalObserver._addBeforeObserver); - updateObserversAndListeners(obj, key, observerOrListener, '__ember_observes__', _emberMetalObserver.addObserver); - updateObserversAndListeners(obj, key, observerOrListener, '__ember_listens__', _emberMetalEvents.addListener); - } - } - - function applyMixin(obj, mixins, partial) { - var descs = {}; - var values = {}; - var m = _emberMetalMeta.meta(obj); - var keys = []; - var key = undefined, - value = undefined, - desc = undefined; - - obj._super = ROOT; - - // Go through all mixins and hashes passed in, and: - // - // * Handle concatenated properties - // * Handle merged properties - // * Set up _super wrapping if necessary - // * Set up computed property descriptors - // * Copying `toString` in broken browsers - mergeMixins(mixins, m, descs, values, obj, keys); - - for (var i = 0; i < keys.length; i++) { - key = keys[i]; - if (key === 'constructor' || !values.hasOwnProperty(key)) { - continue; - } - - desc = descs[key]; - value = values[key]; - - if (desc === REQUIRED) { - continue; - } - - while (desc && desc instanceof Alias) { - var followed = followAlias(obj, desc, m, descs, values); - desc = followed.desc; - value = followed.value; - } - - if (desc === undefined && value === undefined) { - continue; - } - - replaceObserversAndListeners(obj, key, value); - - if (detectBinding(key)) { - m.writeBindings(key, value); - } - - _emberMetalProperties.defineProperty(obj, key, desc, value, m); - } - - if (!partial) { - // don't apply to prototype - finishPartial(obj, m); - } - - return obj; - } - - /** - @method mixin - @for Ember - @param obj - @param mixins* - @return obj - @private - */ - - function mixin(obj) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - applyMixin(obj, args, false); - return obj; - } - - var NAME_KEY = _emberUtils.GUID_KEY + '_name'; - - exports.NAME_KEY = NAME_KEY; - /** - The `Ember.Mixin` class allows you to create mixins, whose properties can be - added to other classes. For instance, - - ```javascript - const EditableMixin = Ember.Mixin.create({ - edit() { - console.log('starting to edit'); - this.set('isEditing', true); - }, - isEditing: false - }); - - // Mix mixins into classes by passing them as the first arguments to - // `.extend.` - const Comment = Ember.Object.extend(EditableMixin, { - post: null - }); - - let comment = Comment.create(post: somePost); - comment.edit(); // outputs 'starting to edit' - ``` - - Note that Mixins are created with `Ember.Mixin.create`, not - `Ember.Mixin.extend`. - - Note that mixins extend a constructor's prototype so arrays and object literals - defined as properties will be shared amongst objects that implement the mixin. - If you want to define a property in a mixin that is not shared, you can define - it either as a computed property or have it be created on initialization of the object. - - ```javascript - // filters array will be shared amongst any object implementing mixin - const FilterableMixin = Ember.Mixin.create({ - filters: Ember.A() - }); - - // filters will be a separate array for every object implementing the mixin - const FilterableMixin = Ember.Mixin.create({ - filters: Ember.computed(function() { - return Ember.A(); - }) - }); - - // filters will be created as a separate array during the object's initialization - const Filterable = Ember.Mixin.create({ - init() { - this._super(...arguments); - this.set("filters", Ember.A()); - } - }); - ``` - - @class Mixin - @namespace Ember - @public - */ - - function Mixin(args, properties) { - this.properties = properties; - - var length = args && args.length; - - if (length > 0) { - var m = new Array(length); - - for (var i = 0; i < length; i++) { - var x = args[i]; - if (x instanceof Mixin) { - m[i] = x; - } else { - m[i] = new Mixin(undefined, x); - } - } - - this.mixins = m; - } else { - this.mixins = undefined; - } - this.ownerConstructor = undefined; - this._without = undefined; - this[_emberUtils.GUID_KEY] = null; - this[NAME_KEY] = null; - _emberMetalDebug.debugSeal(this); - } - - Mixin._apply = applyMixin; - - Mixin.applyPartial = function (obj) { - var args = a_slice.call(arguments, 1); - return applyMixin(obj, args, true); - }; - - Mixin.finishPartial = finishPartial; - - var unprocessedFlag = false; - - function hasUnprocessedMixins() { - return unprocessedFlag; - } - - function clearUnprocessedMixins() { - unprocessedFlag = false; - } - - /** - @method create - @static - @param arguments* - @public - */ - Mixin.create = function () { - // ES6TODO: this relies on a global state? - unprocessedFlag = true; - var M = this; - - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - return new M(args, undefined); - }; - - var MixinPrototype = Mixin.prototype; - - /** - @method reopen - @param arguments* - @private - */ - MixinPrototype.reopen = function () { - var currentMixin = undefined; - - if (this.properties) { - currentMixin = new Mixin(undefined, this.properties); - this.properties = undefined; - this.mixins = [currentMixin]; - } else if (!this.mixins) { - this.mixins = []; - } - - var mixins = this.mixins; - var idx = undefined; - - for (idx = 0; idx < arguments.length; idx++) { - currentMixin = arguments[idx]; - _emberMetalDebug.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(currentMixin), typeof currentMixin === 'object' && currentMixin !== null && Object.prototype.toString.call(currentMixin) !== '[object Array]'); - - if (currentMixin instanceof Mixin) { - mixins.push(currentMixin); - } else { - mixins.push(new Mixin(undefined, currentMixin)); - } - } - - return this; - }; - - /** - @method apply - @param obj - @return applied object - @private - */ - MixinPrototype.apply = function (obj) { - return applyMixin(obj, [this], false); - }; - - MixinPrototype.applyPartial = function (obj) { - return applyMixin(obj, [this], true); - }; - - MixinPrototype.toString = Object.toString; - - function _detect(curMixin, targetMixin, seen) { - var guid = _emberUtils.guidFor(curMixin); - - if (seen[guid]) { - return false; - } - seen[guid] = true; - - if (curMixin === targetMixin) { - return true; - } - var mixins = curMixin.mixins; - var loc = mixins ? mixins.length : 0; - while (--loc >= 0) { - if (_detect(mixins[loc], targetMixin, seen)) { - return true; - } - } - return false; - } - - /** - @method detect - @param obj - @return {Boolean} - @private - */ - MixinPrototype.detect = function (obj) { - if (typeof obj !== 'object' || obj === null) { - return false; - } - if (obj instanceof Mixin) { - return _detect(obj, this, {}); - } - var m = _emberMetalMeta.peekMeta(obj); - if (!m) { - return false; - } - return !!m.peekMixins(_emberUtils.guidFor(this)); - }; - - MixinPrototype.without = function () { - var ret = new Mixin([this]); - - for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - - ret._without = args; - return ret; - }; - - function _keys(ret, mixin, seen) { - if (seen[_emberUtils.guidFor(mixin)]) { - return; - } - seen[_emberUtils.guidFor(mixin)] = true; - - if (mixin.properties) { - var props = Object.keys(mixin.properties); - for (var i = 0; i < props.length; i++) { - var key = props[i]; - ret[key] = true; - } - } else if (mixin.mixins) { - mixin.mixins.forEach(function (x) { - return _keys(ret, x, seen); - }); - } - } - - MixinPrototype.keys = function () { - var keys = {}; - var seen = {}; - - _keys(keys, this, seen); - var ret = Object.keys(keys); - return ret; - }; - - _emberMetalDebug.debugSeal(MixinPrototype); - - // returns the mixins currently applied to the specified object - // TODO: Make Ember.mixin - Mixin.mixins = function (obj) { - var m = _emberMetalMeta.peekMeta(obj); - var ret = []; - if (!m) { - return ret; - } - - m.forEachMixins(function (key, currentMixin) { - // skip primitive mixins since these are always anonymous - if (!currentMixin.properties) { - ret.push(currentMixin); - } - }); - - return ret; - }; - - var REQUIRED = new _emberMetalProperties.Descriptor(); - REQUIRED.toString = function () { - return '(Required Property)'; - }; - - /** - Denotes a required property for a mixin - - @method required - @for Ember - @private - */ - - function required() { - _emberMetalDebug.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; - this.methodName = methodName; - } - - Alias.prototype = new _emberMetalProperties.Descriptor(); - - /** - Makes a method available via an additional name. - - ```javascript - App.Person = Ember.Object.extend({ - name: function() { - return 'Tomhuda Katzdale'; - }, - moniker: Ember.aliasMethod('name') - }); - - let goodGuy = App.Person.create(); - - goodGuy.name(); // 'Tomhuda Katzdale' - goodGuy.moniker(); // 'Tomhuda Katzdale' - ``` - - @method aliasMethod - @for Ember - @param {String} methodName name of the method to alias - @public - */ - - function aliasMethod(methodName) { - return new Alias(methodName); - } - - // .......................................................... - // OBSERVER HELPER - // - - /** - Specify a method that observes property changes. - - ```javascript - Ember.Object.extend({ - valueObserver: Ember.observer('value', function() { - // Executes whenever the "value" property changes - }) - }); - ``` - - Also available as `Function.prototype.observes` if prototype extensions are - enabled. - - @method observer - @for Ember - @param {String} propertyNames* - @param {Function} func - @return func - @public - */ - - function observer() { - for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { - args[_key4] = arguments[_key4]; - } - - var func = args.slice(-1)[0]; - var paths = undefined; - - var addWatchedProperty = function (path) { - paths.push(path); - }; - var _paths = args.slice(0, -1); - - if (typeof func !== 'function') { - // revert to old, soft-deprecated argument ordering - _emberMetalDebug.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 _emberMetalError.default('Ember.observer called without a function'); - } - - func.__ember_observes__ = paths; - return func; - } - - /** - Specify a method that observes property changes. - - ```javascript - Ember.Object.extend({ - valueObserver: Ember.immediateObserver('value', function() { - // Executes whenever the "value" property changes - }) - }); - ``` - - In the future, `Ember.observer` may become asynchronous. In this event, - `Ember.immediateObserver` will maintain the synchronous behavior. - - Also available as `Function.prototype.observesImmediately` if prototype extensions are - enabled. - - @method _immediateObserver - @for Ember - @param {String} propertyNames* - @param {Function} func - @deprecated Use `Ember.observer` instead. - @return func - @private - */ - - function _immediateObserver() { - _emberMetalDebug.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; i < arguments.length; i++) { - var arg = arguments[i]; - _emberMetalDebug.assert('Immediate observers must observe internal properties only, not properties on other objects.', typeof arg !== 'string' || arg.indexOf('.') === -1); - } - - return observer.apply(this, arguments); - } - - /** - When observers fire, they are called with the arguments `obj`, `keyName`. - - Note, `@each.property` observer is called per each add or replace of an element - and it's not called with a specific enumeration item. - - A `_beforeObserver` fires before a property changes. - - @method beforeObserver - @for Ember - @param {String} propertyNames* - @param {Function} func - @return func - @deprecated - @private - */ - - function _beforeObserver() { - for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { - args[_key5] = arguments[_key5]; - } - - var func = args.slice(-1)[0]; - var paths = undefined; - - var addWatchedProperty = function (path) { - paths.push(path); - }; - - var _paths = args.slice(0, -1); - - if (typeof func !== 'function') { - // revert to old, soft-deprecated argument ordering - - 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 _emberMetalError.default('_beforeObserver called without a function'); - } - - func.__ember_observesBefore__ = paths; - return func; - } - - exports.Mixin = Mixin; - exports.required = required; - exports.REQUIRED = REQUIRED; -}); -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; - exports._suspendObservers = _suspendObservers; - exports._removeBeforeObserver = _removeBeforeObserver; - - /** - @module ember-metal - */ - - var AFTER_OBSERVERS = ':change'; - var BEFORE_OBSERVERS = ':before'; - - function changeEvent(keyName) { - return keyName + AFTER_OBSERVERS; - } - - function beforeEvent(keyName) { - return keyName + BEFORE_OBSERVERS; - } - - /** - @method addObserver - @for Ember - @param obj - @param {String} _path - @param {Object|Function} target - @param {Function|String} [method] - @public - */ - - function addObserver(obj, _path, target, method) { - _emberMetalEvents.addListener(obj, changeEvent(_path), target, method); - _emberMetalWatching.watch(obj, _path); - - return this; - } - - function observersFor(obj, path) { - return _emberMetalEvents.listenersFor(obj, changeEvent(path)); - } - - /** - @method removeObserver - @for Ember - @param obj - @param {String} path - @param {Object|Function} target - @param {Function|String} [method] - @public - */ - - function removeObserver(obj, path, target, method) { - _emberMetalWatching.unwatch(obj, path); - _emberMetalEvents.removeListener(obj, changeEvent(path), target, method); - - return this; - } - - /** - @method _addBeforeObserver - @for Ember - @param obj - @param {String} path - @param {Object|Function} target - @param {Function|String} [method] - @deprecated - @private - */ - - function _addBeforeObserver(obj, path, target, method) { - _emberMetalEvents.addListener(obj, beforeEvent(path), target, method); - _emberMetalWatching.watch(obj, path); - - return this; - } - - // Suspend observer during callback. - // - // This should only be used by the target of the observer - // while it is setting the observed path. - - function _suspendObserver(obj, path, target, method, callback) { - return _emberMetalEvents.suspendListener(obj, changeEvent(path), target, method, callback); - } - - function _suspendObservers(obj, paths, target, method, callback) { - var events = paths.map(changeEvent); - return _emberMetalEvents.suspendListeners(obj, events, target, method, callback); - } - - /** - @method removeBeforeObserver - @for Ember - @param obj - @param {String} path - @param {Object|Function} target - @param {Function|String} [method] - @deprecated - @private - */ - - function _removeBeforeObserver(obj, path, target, method) { - _emberMetalWatching.unwatch(obj, path); - _emberMetalEvents.removeListener(obj, beforeEvent(path), target, method); - - return this; - } -}); -enifed('ember-metal/observer_set', ['exports', 'ember-utils', 'ember-metal/events'], function (exports, _emberUtils, _emberMetalEvents) { - 'use strict'; - - exports.default = ObserverSet; - - /* - this.observerSet = { - [senderGuid]: { // variable name: `keySet` - [keyName]: listIndex - } - }, - this.observers = [ - { - sender: obj, - keyName: keyName, - eventName: eventName, - listeners: [ - [target, method, flags] - ] - }, - ... - ] - */ - - function ObserverSet() { - this.clear(); - } - - ObserverSet.prototype.add = function (sender, keyName, eventName) { - var observerSet = this.observerSet; - var observers = this.observers; - var senderGuid = _emberUtils.guidFor(sender); - var keySet = observerSet[senderGuid]; - var index = undefined; - - if (!keySet) { - observerSet[senderGuid] = keySet = {}; - } - index = keySet[keyName]; - if (index === undefined) { - index = observers.push({ - sender: sender, - keyName: keyName, - eventName: eventName, - listeners: [] - }) - 1; - keySet[keyName] = index; - } - return observers[index].listeners; - }; - - ObserverSet.prototype.flush = function () { - var observers = this.observers; - var i = undefined, - observer = undefined, - sender = undefined; - this.clear(); - for (i = 0; i < observers.length; ++i) { - observer = observers[i]; - sender = observer.sender; - if (sender.isDestroying || sender.isDestroyed) { - continue; - } - _emberMetalEvents.sendEvent(sender, observer.eventName, [sender, observer.keyName], observer.listeners); - } - }; - - ObserverSet.prototype.clear = function () { - 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; - exports.getTailPath = getTailPath; - - var IS_GLOBAL = /^[A-Z$]/; - var IS_GLOBAL_PATH = /^[A-Z$].*[\.]/; - var HAS_THIS = 'this.'; - - var isGlobalCache = new _emberMetalCache.default(1000, function (key) { - return IS_GLOBAL.test(key); - }); - var isGlobalPathCache = new _emberMetalCache.default(1000, function (key) { - return IS_GLOBAL_PATH.test(key); - }); - var hasThisCache = new _emberMetalCache.default(1000, function (key) { - return key.lastIndexOf(HAS_THIS, 0) === 0; - }); - var firstDotIndexCache = new _emberMetalCache.default(1000, function (key) { - return key.indexOf('.'); - }); - - var firstKeyCache = new _emberMetalCache.default(1000, function (path) { - var index = firstDotIndexCache.get(path); - if (index === -1) { - return path; - } else { - return path.slice(0, index); - } - }); - - var tailPathCache = new _emberMetalCache.default(1000, function (path) { - var index = firstDotIndexCache.get(path); - if (index !== -1) { - return path.slice(index + 1); - } - }); - - var caches = { - isGlobalCache: isGlobalCache, - isGlobalPathCache: isGlobalPathCache, - hasThisCache: hasThisCache, - firstDotIndexCache: firstDotIndexCache, - firstKeyCache: firstKeyCache, - tailPathCache: tailPathCache - }; - - exports.caches = caches; - - function isGlobal(path) { - return isGlobalCache.get(path); - } - - function isGlobalPath(path) { - return isGlobalPathCache.get(path); - } - - function hasThis(path) { - return hasThisCache.get(path); - } - - function isPath(path) { - return firstDotIndexCache.get(path) !== -1; - } - - function getFirstKey(path) { - return firstKeyCache.get(path); - } - - function getTailPath(path) { - return tailPathCache.get(path); - } -}); -enifed('ember-metal/properties', ['exports', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/meta', 'ember-metal/property_events'], function (exports, _emberMetalDebug, _emberMetalFeatures, _emberMetalMeta, _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.INHERITING_GETTER_FUNCTION = INHERITING_GETTER_FUNCTION; - exports.defineProperty = defineProperty; - - // .......................................................... - // DESCRIPTOR - // - - /** - Objects of this type can implement an interface to respond to requests to - get and set. The default implementation handles simple properties. - - @class Descriptor - @private - */ - - function Descriptor() { - this.isDescriptor = true; - } - - var REDEFINE_SUPPORTED = (function () { - // https://github.com/spalger/kibana/commit/b7e35e6737df585585332857a4c397dc206e7ff9 - var a = Object.create(Object.prototype, { - prop: { - configurable: true, - value: 1 - } - }); - - Object.defineProperty(a, 'prop', { - configurable: true, - value: 2 - }); - - return a.prop === 2; - })(); - // .......................................................... - // DEFINING PROPERTIES API - // - - function MANDATORY_SETTER_FUNCTION(name) { - function SETTER_FUNCTION(value) { - var m = _emberMetalMeta.peekMeta(this); - if (!m.isInitialized(this)) { - m.writeValues(name, value); - } else { - _emberMetalDebug.assert('You must use Ember.set() to set the `' + name + '` property (of ' + this + ') to `' + value + '`.', false); - } - } - - SETTER_FUNCTION.isMandatorySetter = true; - return SETTER_FUNCTION; - } - - function DEFAULT_GETTER_FUNCTION(name) { - return function GETTER_FUNCTION() { - var meta = _emberMetalMeta.peekMeta(this); - return meta && meta.peekValues(name); - }; - } - - function INHERITING_GETTER_FUNCTION(name) { - function IGETTER_FUNCTION() { - var meta = _emberMetalMeta.peekMeta(this); - var val = meta && meta.readInheritedValue('values', name); - - if (val === _emberMetalMeta.UNDEFINED) { - var proto = Object.getPrototypeOf(this); - return proto && proto[name]; - } else { - return val; - } - } - - IGETTER_FUNCTION.isInheritingGetter = true; - return IGETTER_FUNCTION; - } - - /** - NOTE: This is a low-level method used by other parts of the API. You almost - never want to call this method directly. Instead you should use - `Ember.mixin()` to define new properties. - - Defines a property on an object. This method works much like the ES5 - `Object.defineProperty()` method except that it can also accept computed - properties and other special descriptors. - - Normally this method takes only three parameters. However if you pass an - instance of `Descriptor` as the third param then you can pass an - optional value as the fourth parameter. This is often more efficient than - creating new descriptor hashes for each property. - - ## Examples - - ```javascript - // ES5 compatible mode - Ember.defineProperty(contact, 'firstName', { - writable: true, - configurable: false, - enumerable: true, - value: 'Charles' - }); - - // define a simple property - Ember.defineProperty(contact, 'lastName', undefined, 'Jolley'); - - // define a computed property - Ember.defineProperty(contact, 'fullName', Ember.computed('firstName', 'lastName', function() { - return this.firstName+' '+this.lastName; - })); - ``` - - @private - @method defineProperty - @for Ember - @param {Object} obj the object to define this property on. This may be a prototype. - @param {String} keyName the name of the property - @param {Descriptor} [desc] an instance of `Descriptor` (typically a - computed property) or an ES5 descriptor. - You must provide this or `data` but not both. - @param {*} [data] something other than a descriptor, that will - become the explicit value of this property. - */ - - function defineProperty(obj, keyName, desc, data, meta) { - var possibleDesc = undefined, - existingDesc = undefined, - watching = undefined, - value = undefined; - - if (!meta) { - meta = _emberMetalMeta.meta(obj); - } - var watchEntry = meta.peekWatching(keyName); - possibleDesc = obj[keyName]; - existingDesc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - watching = watchEntry !== undefined && watchEntry > 0; - - if (existingDesc) { - existingDesc.teardown(obj, keyName); - } - - if (desc instanceof Descriptor) { - value = desc; - if (true) { - 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; - - if (true) { - 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); - } - } - - // if key is being watched, override chains that - // were initialized with the prototype - if (watching) { - _emberMetalProperty_events.overrideChains(obj, keyName, meta); - } - - // The `value` passed to the `didDefineProperty` hook is - // either the descriptor or data, whichever was passed. - if (obj.didDefineProperty) { - obj.didDefineProperty(obj, keyName, value); - } - - return this; - } - - function handleBrokenPhantomDefineProperty(obj, keyName, desc) { - // https://github.com/ariya/phantomjs/issues/11856 - Object.defineProperty(obj, keyName, { configurable: true, writable: true, value: 'iCry' }); - Object.defineProperty(obj, keyName, desc); - } -}); -enifed('ember-metal/property_events', ['exports', 'ember-utils', 'ember-metal/meta', 'ember-metal/events', 'ember-metal/tags', 'ember-metal/observer_set', 'ember-metal/features', 'ember-metal/transaction'], function (exports, _emberUtils, _emberMetalMeta, _emberMetalEvents, _emberMetalTags, _emberMetalObserver_set, _emberMetalFeatures, _emberMetalTransaction) { - 'use strict'; - - var PROPERTY_DID_CHANGE = _emberUtils.symbol('PROPERTY_DID_CHANGE'); - - exports.PROPERTY_DID_CHANGE = PROPERTY_DID_CHANGE; - var beforeObserverSet = new _emberMetalObserver_set.default(); - var observerSet = new _emberMetalObserver_set.default(); - var deferred = 0; - - // .......................................................... - // PROPERTY CHANGES - // - - /** - This function is called just before an object property is about to change. - It will notify any before observers and prepare caches among other things. - - Normally you will not need to call this method directly but if for some - reason you can't directly watch a property you can invoke this method - manually along with `Ember.propertyDidChange()` which you should call just - after the property value changes. - - @method propertyWillChange - @for Ember - @param {Object} obj The object with the property that will change - @param {String} keyName The property key (or path) that will change. - @return {void} - @private - */ - function propertyWillChange(obj, keyName, _meta) { - var meta = _meta || _emberMetalMeta.peekMeta(obj); - - if (meta && !meta.isInitialized(obj)) { - return; - } - - var watching = meta && meta.peekWatching(keyName) > 0; - var possibleDesc = obj[keyName]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - if (desc && desc.willChange) { - desc.willChange(obj, keyName); - } - - if (watching) { - dependentKeysWillChange(obj, keyName, meta); - chainsWillChange(obj, keyName, meta); - notifyBeforeObservers(obj, keyName, meta); - } - } - - /** - This function is called just after an object property has changed. - It will notify any observers and clear caches among other things. - - Normally you will not need to call this method directly but if for some - reason you can't directly watch a property you can invoke this method - manually along with `Ember.propertyWillChange()` which you should call just - before the property value changes. - - @method propertyDidChange - @for Ember - @param {Object} obj The object with the property that will change - @param {String} keyName The property key (or path) that will change. - @param {Meta} meta The objects meta. - @return {void} - @private - */ - function propertyDidChange(obj, keyName, _meta) { - var meta = _meta || _emberMetalMeta.peekMeta(obj); - - if (meta && !meta.isInitialized(obj)) { - return; - } - - var watching = meta && meta.peekWatching(keyName) > 0; - var possibleDesc = obj[keyName]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - // shouldn't this mean that we're watching this key? - if (desc && desc.didChange) { - desc.didChange(obj, keyName); - } - - if (watching) { - if (meta.hasDeps(keyName)) { - dependentKeysDidChange(obj, keyName, meta); - } - - chainsDidChange(obj, keyName, meta, false); - notifyObservers(obj, keyName, meta); - } - - if (obj[PROPERTY_DID_CHANGE]) { - obj[PROPERTY_DID_CHANGE](keyName); - } - - if (meta && meta.isSourceDestroying()) { - return; - } - - _emberMetalTags.markObjectAsDirty(meta, keyName); - - if (true || true) { - _emberMetalTransaction.assertNotRendered(obj, keyName, meta); - } - } - - var WILL_SEEN = undefined, - DID_SEEN = undefined; - // called whenever a property is about to change to clear the cache of any dependent keys (and notify those properties of changes, etc...) - function dependentKeysWillChange(obj, depKey, meta) { - if (meta && meta.isSourceDestroying()) { - return; - } - - if (meta && meta.hasDeps(depKey)) { - var seen = WILL_SEEN; - var _top = !seen; - - if (_top) { - seen = WILL_SEEN = {}; - } - - iterDeps(propertyWillChange, obj, depKey, seen, meta); - - if (_top) { - WILL_SEEN = null; - } - } - } - - // called whenever a property has just changed to update dependent keys - function dependentKeysDidChange(obj, depKey, meta) { - if (meta && meta.isSourceDestroying()) { - return; - } - - if (meta && meta.hasDeps(depKey)) { - var seen = DID_SEEN; - var _top2 = !seen; - - if (_top2) { - seen = DID_SEEN = {}; - } - - iterDeps(propertyDidChange, obj, depKey, seen, meta); - - if (_top2) { - DID_SEEN = null; - } - } - } - - function iterDeps(method, obj, depKey, seen, meta) { - var possibleDesc = undefined, - desc = undefined; - var guid = _emberUtils.guidFor(obj); - var current = seen[guid]; - - if (!current) { - current = seen[guid] = {}; - } - - if (current[depKey]) { - return; - } - - current[depKey] = true; - - meta.forEachInDeps(depKey, function (key, value) { - if (!value) { - return; - } - - possibleDesc = obj[key]; - desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - if (desc && desc._suspended === obj) { - return; - } - - method(obj, key, meta); - }); - } - - function chainsWillChange(obj, keyName, meta) { - var chainWatchers = meta.readableChainWatchers(); - if (chainWatchers) { - chainWatchers.notify(keyName, false, propertyWillChange); - } - } - - function chainsDidChange(obj, keyName, meta) { - var chainWatchers = meta.readableChainWatchers(); - if (chainWatchers) { - chainWatchers.notify(keyName, true, propertyDidChange); - } - } - - function overrideChains(obj, keyName, meta) { - var chainWatchers = meta.readableChainWatchers(); - if (chainWatchers) { - chainWatchers.revalidate(keyName); - } - } - - /** - @method beginPropertyChanges - @chainable - @private - */ - function beginPropertyChanges() { - deferred++; - } - - /** - @method endPropertyChanges - @private - */ - function endPropertyChanges() { - deferred--; - if (deferred <= 0) { - beforeObserverSet.clear(); - observerSet.flush(); - } - } - - /** - Make a series of property changes together in an - exception-safe way. - - ```javascript - Ember.changeProperties(function() { - obj1.set('foo', mayBlowUpWhenSet); - obj2.set('bar', baz); - }); - ``` - - @method changeProperties - @param {Function} callback - @param [binding] - @private - */ - function changeProperties(callback, binding) { - beginPropertyChanges(); - try { - callback.call(binding); - } finally { - endPropertyChanges.call(binding); - } - } - - function notifyBeforeObservers(obj, keyName, meta) { - if (meta && meta.isSourceDestroying()) { - return; - } - - var eventName = keyName + ':before'; - var listeners = undefined, - added = undefined; - if (deferred) { - listeners = beforeObserverSet.add(obj, keyName, eventName); - added = _emberMetalEvents.accumulateListeners(obj, eventName, listeners); - _emberMetalEvents.sendEvent(obj, eventName, [obj, keyName], added); - } else { - _emberMetalEvents.sendEvent(obj, eventName, [obj, keyName]); - } - } - - function notifyObservers(obj, keyName, meta) { - if (meta && meta.isSourceDestroying()) { - return; - } - - var eventName = keyName + ':change'; - var listeners = undefined; - if (deferred) { - listeners = observerSet.add(obj, keyName, eventName); - _emberMetalEvents.accumulateListeners(obj, eventName, listeners); - } else { - _emberMetalEvents.sendEvent(obj, eventName, [obj, keyName]); - } - } - - exports.propertyWillChange = propertyWillChange; - exports.propertyDidChange = propertyDidChange; - exports.overrideChains = overrideChains; - exports.beginPropertyChanges = beginPropertyChanges; - exports.endPropertyChanges = endPropertyChanges; - exports.changeProperties = changeProperties; -}); -enifed('ember-metal/property_get', ['exports', 'ember-metal/debug', 'ember-metal/path_cache'], function (exports, _emberMetalDebug, _emberMetalPath_cache) { - /** - @module ember-metal - */ - - 'use strict'; - - exports.get = get; - exports._getPath = _getPath; - exports.getWithDefault = getWithDefault; - - var ALLOWABLE_TYPES = { - object: true, - function: true, - string: true - }; - - // .......................................................... - // 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 - // object. - - /** - Gets the value of a property on an object. If the property is computed, - the function will be invoked. If the property is not defined but the - object implements the `unknownProperty` method then that will be invoked. - - ```javascript - Ember.get(obj, "name"); - ``` - - If you plan to run on IE8 and older browsers then you should use this - method anytime you want to retrieve a property on an object that you don't - know for sure is private. (Properties beginning with an underscore '_' - are considered private.) - - On all newer browsers, you only need to use this method to retrieve - properties if the property might not be defined on the object and you want - to respect the `unknownProperty` handler. Otherwise you can ignore this - method. - - Note that if the object itself is `undefined`, this method will throw - an error. - - @method get - @for Ember - @param {Object} obj The object to retrieve from. - @param {String} keyName The property key to retrieve - @return {Object} the property value or `null`. - @public - */ - - function get(obj, keyName) { - _emberMetalDebug.assert('Get must be called with two arguments; an object and a property key', arguments.length === 2); - _emberMetalDebug.assert('Cannot call get with \'' + keyName + '\' on an undefined object.', obj !== undefined && obj !== null); - _emberMetalDebug.assert('The key provided to get must be a string, you passed ' + keyName, typeof keyName === 'string'); - _emberMetalDebug.assert('\'this\' in paths is not supported', !_emberMetalPath_cache.hasThis(keyName)); - _emberMetalDebug.assert('Cannot call `Ember.get` with an empty string', keyName !== ''); - - var value = obj[keyName]; - var desc = value !== null && typeof value === 'object' && value.isDescriptor ? value : undefined; - var ret = undefined; - - if (desc === undefined && _emberMetalPath_cache.isPath(keyName)) { - return _getPath(obj, keyName); - } - - if (desc) { - return desc.get(obj, keyName); - } else { - ret = value; - - if (ret === undefined && 'object' === typeof obj && !(keyName in obj) && 'function' === typeof obj.unknownProperty) { - return obj.unknownProperty(keyName); - } - - return ret; - } - } - - function _getPath(root, path) { - var obj = root; - var parts = path.split('.'); - - for (var i = 0; i < parts.length; i++) { - if (!isGettable(obj)) { - return undefined; - } - - obj = get(obj, parts[i]); - - if (obj && obj.isDestroyed) { - return undefined; - } - } - - return obj; - } - - function isGettable(obj) { - if (obj == null) { - return false; - } - - return ALLOWABLE_TYPES[typeof obj]; - } - - /** - Retrieves the value of a property from an Object, or a default value in the - case that the property returns `undefined`. - - ```javascript - Ember.getWithDefault(person, 'lastName', 'Doe'); - ``` - - @method getWithDefault - @for Ember - @param {Object} obj The object to retrieve from. - @param {String} keyName The name of the property to retrieve - @param {Object} defaultValue The value to return if the property value is undefined - @return {Object} The property value or the defaultValue. - @public - */ - - function getWithDefault(root, key, defaultValue) { - var value = get(root, key); - - if (value === undefined) { - return defaultValue; - } - return value; - } - - exports.default = get; -}); -enifed('ember-metal/property_set', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_events', 'ember-metal/error', 'ember-metal/path_cache', 'ember-metal/meta'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_events, _emberMetalError, _emberMetalPath_cache, _emberMetalMeta) { - 'use strict'; - - exports.set = set; - exports.trySet = trySet; - - /** - 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. - - ```javascript - Ember.set(obj, "name", value); - ``` - - @method set - @for Ember - @param {Object} obj The object to modify. - @param {String} keyName The property key to set - @param {Object} value The value to set - @return {Object} the passed value. - @public - */ - - function set(obj, keyName, value, tolerant) { - _emberMetalDebug.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); - _emberMetalDebug.assert('Cannot call set with \'' + keyName + '\' on an undefined object.', obj && typeof obj === 'object' || typeof obj === 'function'); - _emberMetalDebug.assert('The key provided to set must be a string, you passed ' + keyName, typeof keyName === 'string'); - _emberMetalDebug.assert('\'this\' in paths is not supported', !_emberMetalPath_cache.hasThis(keyName)); - _emberMetalDebug.assert('calling set on destroyed object: ' + _emberUtils.toString(obj) + '.' + keyName + ' = ' + _emberUtils.toString(value), !obj.isDestroyed); - - if (_emberMetalPath_cache.isPath(keyName)) { - return setPath(obj, keyName, value, tolerant); - } - - var meta = _emberMetalMeta.peekMeta(obj); - var possibleDesc = obj[keyName]; - - var desc = undefined, - currentValue = undefined; - if (possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor) { - desc = possibleDesc; - } else { - currentValue = possibleDesc; - } - - if (desc) { - /* computed property */ - desc.set(obj, keyName, value); - } else if (obj.setUnknownProperty && currentValue === undefined && !(keyName in obj)) { - /* unknown property */ - _emberMetalDebug.assert('setUnknownProperty must be a function', typeof obj.setUnknownProperty === 'function'); - obj.setUnknownProperty(keyName, value); - } else if (currentValue === value) { - /* no change */ - return value; - } else { - _emberMetalProperty_events.propertyWillChange(obj, keyName); - - if (true) { - setWithMandatorySetter(meta, obj, keyName, value); - } else { - obj[keyName] = value; - } - - _emberMetalProperty_events.propertyDidChange(obj, keyName); - } - - return value; - } - - if (true) { - 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) { - // get the last part of the path - var keyName = path.slice(path.lastIndexOf('.') + 1); - - // get the first part of the part - path = path === keyName ? keyName : path.slice(0, path.length - (keyName.length + 1)); - - // unless the path is this, look up the first part to - // get the root - if (path !== 'this') { - root = _emberMetalProperty_get._getPath(root, path); - } - - if (!keyName || keyName.length === 0) { - throw new _emberMetalError.default('Property set failed: You passed an empty path'); - } - - if (!root) { - if (tolerant) { - return; - } else { - throw new _emberMetalError.default('Property set failed: object in path "' + path + '" could not be found or was destroyed.'); - } - } - - return set(root, keyName, value); - } - - /** - Error-tolerant form of `Ember.set`. Will not blow up if any part of the - chain is `undefined`, `null`, or destroyed. - - This is primarily used when syncing bindings, which may try to update after - an object has been destroyed. - - @method trySet - @for Ember - @param {Object} root The object to modify. - @param {String} path The property path to set - @param {Object} value The value to set - @public - */ - - function trySet(root, path, value) { - return set(root, path, value, true); - } -}); -enifed("ember-metal/replace", ["exports"], function (exports) { - "use strict"; - - exports.default = replace; - var splice = Array.prototype.splice; - - 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; - var ends = amt; - var count = undefined, - chunk = undefined; - - while (args.length) { - count = ends > size ? size : ends; - if (count <= 0) { - count = 0; - } - - chunk = args.splice(0, size); - chunk = [start, count].concat(chunk); - - start += size; - ends -= count; - - ret = ret.concat(splice.apply(array, chunk)); - } - return ret; - } -}); -enifed('ember-metal/run_loop', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/testing', 'ember-metal/error_handler', 'ember-metal/property_events', 'backburner'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalTesting, _emberMetalError_handler, _emberMetalProperty_events, _backburner) { - 'use strict'; - - exports.default = run; - - function onBegin(current) { - run.currentRunLoop = current; - } - - function onEnd(current, next) { - run.currentRunLoop = next; - } - - var onErrorTarget = { - get onerror() { - return _emberMetalError_handler.getOnerror(); - }, - set onerror(handler) { - return _emberMetalError_handler.setOnerror(handler); - } - }; - - var backburner = new _backburner.default(['sync', 'actions', 'destroy'], { - GUID_KEY: _emberUtils.GUID_KEY, - sync: { - before: _emberMetalProperty_events.beginPropertyChanges, - after: _emberMetalProperty_events.endPropertyChanges - }, - defaultQueue: 'actions', - onBegin: onBegin, - onEnd: onEnd, - onErrorTarget: onErrorTarget, - onErrorMethod: 'onerror' - }); - - // .......................................................... - // run - this is ideally the only public API the dev sees - // - - /** - Runs the passed target and method inside of a RunLoop, ensuring any - deferred actions including bindings and views updates are flushed at the - end. - - Normally you should not need to invoke this method yourself. However if - you are implementing raw event handlers when interfacing with other - libraries or plugins, you should probably wrap all of your code inside this - call. - - ```javascript - run(function() { - // code to be executed within a RunLoop - }); - ``` - - @class run - @namespace Ember - @static - @constructor - @param {Object} [target] target of method to call - @param {Function|String} method Method to invoke. - May be a function or a string. If you pass a string - then it will be looked up on the passed target. - @param {Object} [args*] Any additional arguments you wish to pass to the method. - @return {Object} return value from invoking the passed function. - @public - */ - - function run() { - return backburner.run.apply(backburner, arguments); - } - - /** - If no run-loop is present, it creates a new one. If a run loop is - present it will queue itself to run on the existing run-loops action - queue. - - Please note: This is not for normal usage, and should be used sparingly. - - If invoked when not within a run loop: - - ```javascript - run.join(function() { - // creates a new run-loop - }); - ``` - - Alternatively, if called within an existing run loop: - - ```javascript - run(function() { - // creates a new run-loop - run.join(function() { - // joins with the existing run-loop, and queues for invocation on - // the existing run-loops action queue. - }); - }); - ``` - - @method join - @namespace Ember - @param {Object} [target] target of method to call - @param {Function|String} method Method to invoke. - May be a function or a string. If you pass a string - then it will be looked up on the passed target. - @param {Object} [args*] Any additional arguments you wish to pass to the method. - @return {Object} Return value from invoking the passed function. Please note, - when called within an existing loop, no return value is possible. - @public - */ - run.join = function () { - return backburner.join.apply(backburner, arguments); - }; - - /** - Allows you to specify which context to call the specified function in while - adding the execution of that function to the Ember run loop. This ability - makes this method a great way to asynchronously integrate third-party libraries - into your Ember application. - - `run.bind` takes two main arguments, the desired context and the function to - invoke in that context. Any additional arguments will be supplied as arguments - to the function that is passed in. - - Let's use the creation of a TinyMCE component as an example. Currently, - TinyMCE provides a setup configuration option we can use to do some processing - after the TinyMCE instance is initialized but before it is actually rendered. - We can use that setup option to do some additional setup for our component. - The component itself could look something like the following: - - ```javascript - App.RichTextEditorComponent = Ember.Component.extend({ - initializeTinyMCE: Ember.on('didInsertElement', function() { - tinymce.init({ - selector: '#' + this.$().prop('id'), - setup: Ember.run.bind(this, this.setupEditor) - }); - }), - - setupEditor: function(editor) { - this.set('editor', editor); - - editor.on('change', function() { - console.log('content changed!'); - }); - } - }); - ``` - - In this example, we use Ember.run.bind to bind the setupEditor method to the - context of the App.RichTextEditorComponent and to have the invocation of that - method be safely handled and executed by the Ember run loop. - - @method bind - @namespace Ember - @param {Object} [target] target of method to call - @param {Function|String} method Method to invoke. - May be a function or a string. If you pass a string - then it will be looked up on the passed target. - @param {Object} [args*] Any additional arguments you wish to pass to the method. - @return {Function} returns a new function that will always have a particular context - @since 1.4.0 - @public - */ - run.bind = function () { - for (var _len = arguments.length, curried = Array(_len), _key = 0; _key < _len; _key++) { - curried[_key] = arguments[_key]; - } - - return function () { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - return run.join.apply(run, curried.concat(args)); - }; - }; - - run.backburner = backburner; - run.currentRunLoop = null; - run.queues = backburner.queueNames; - - /** - Begins a new RunLoop. Any deferred actions invoked after the begin will - be buffered until you invoke a matching call to `run.end()`. This is - a lower-level way to use a RunLoop instead of using `run()`. - - ```javascript - run.begin(); - // code to be executed within a RunLoop - run.end(); - ``` - - @method begin - @return {void} - @public - */ - run.begin = function () { - backburner.begin(); - }; - - /** - Ends a RunLoop. This must be called sometime after you call - `run.begin()` to flush any deferred actions. This is a lower-level way - to use a RunLoop instead of using `run()`. - - ```javascript - run.begin(); - // code to be executed within a RunLoop - run.end(); - ``` - - @method end - @return {void} - @public - */ - run.end = function () { - backburner.end(); - }; - - /** - Array of named queues. This array determines the order in which queues - are flushed at the end of the RunLoop. You can define your own queues by - simply adding the queue name to this array. Normally you should not need - to inspect or modify this property. - - @property queues - @type Array - @default ['sync', 'actions', 'destroy'] - @private - */ - - /** - Adds the passed target/method and any optional arguments to the named - queue to be executed at the end of the RunLoop. If you have not already - started a RunLoop when calling this method one will be started for you - automatically. - - At the end of a RunLoop, any methods scheduled in this way will be invoked. - Methods will be invoked in an order matching the named queues defined in - the `run.queues` property. - - ```javascript - run.schedule('sync', this, function() { - // this will be executed in the first RunLoop queue, when bindings are synced - console.log('scheduled on sync queue'); - }); - - run.schedule('actions', this, function() { - // this will be executed in the 'actions' queue, after bindings have synced. - console.log('scheduled on actions queue'); - }); - - // Note the functions will be run in order based on the run queues order. - // Output would be: - // scheduled on sync queue - // scheduled on actions queue - ``` - - @method schedule - @param {String} queue The name of the queue to schedule against. - Default queues are 'sync' and 'actions' - @param {Object} [target] target object to use as the context when invoking a method. - @param {String|Function} method The method to invoke. If you pass a string it - will be resolved on the target object at the time the scheduled item is - invoked allowing you to change the target function. - @param {Object} [arguments*] Optional arguments to be passed to the queued method. - @return {*} Timer information for use in cancelling, see `run.cancel`. - @public - */ - run.schedule = function () /* queue, target, method */{ - _emberMetalDebug.assert('You have turned on testing mode, which disabled the run-loop\'s autorun. ' + 'You will need to wrap any code with asynchronous side-effects in a run', run.currentRunLoop || !_emberMetalTesting.isTesting()); - - return backburner.schedule.apply(backburner, arguments); - }; - - // Used by global test teardown - run.hasScheduledTimers = function () { - return backburner.hasTimers(); - }; - - // Used by global test teardown - run.cancelTimers = function () { - backburner.cancelTimers(); - }; - - /** - Immediately flushes any events scheduled in the 'sync' queue. Bindings - use this queue so this method is a useful way to immediately force all - bindings in the application to sync. - - You should call this method anytime you need any changed state to propagate - throughout the app immediately without repainting the UI (which happens - in the later 'render' queue added by the `ember-views` package). - - ```javascript - run.sync(); - ``` - - @method sync - @return {void} - @private - */ - run.sync = function () { - if (backburner.currentInstance) { - backburner.currentInstance.queues.sync.flush(); - } - }; - - /** - Invokes the passed target/method and optional arguments after a specified - period of time. The last parameter of this method must always be a number - of milliseconds. - - You should use this method whenever you need to run some action after a - period of time instead of using `setTimeout()`. This method will ensure that - items that expire during the same script execution cycle all execute - together, which is often more efficient than using a real setTimeout. - - ```javascript - run.later(myContext, function() { - // code here will execute within a RunLoop in about 500ms with this == myContext - }, 500); - ``` - - @method later - @param {Object} [target] target of method to invoke - @param {Function|String} method The method to invoke. - If you pass a string it will be resolved on the - target at the time the method is invoked. - @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 () /*target, method*/{ - return backburner.later.apply(backburner, arguments); - }; - - /** - Schedule a function to run one time during the current RunLoop. This is equivalent - to calling `scheduleOnce` with the "actions" queue. - - @method once - @param {Object} [target] The target of the method to invoke. - @param {Function|String} method The method to invoke. - If you pass a string it will be resolved on the - 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.once = function () { - _emberMetalDebug.assert('You have turned on testing mode, which disabled the run-loop\'s autorun. ' + 'You will need to wrap any code with asynchronous side-effects in a run', run.currentRunLoop || !_emberMetalTesting.isTesting()); - - for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - - args.unshift('actions'); - return backburner.scheduleOnce.apply(backburner, args); - }; - - /** - Schedules a function to run one time in a given queue of the current RunLoop. - Calling this method with the same queue/target/method combination will have - no effect (past the initial call). - - Note that although you can pass optional arguments these will not be - considered when looking for duplicates. New arguments will replace previous - calls. - - ```javascript - function sayHi() { - console.log('hi'); - } - - run(function() { - run.scheduleOnce('afterRender', myContext, sayHi); - run.scheduleOnce('afterRender', myContext, sayHi); - // sayHi will only be executed once, in the afterRender queue of the RunLoop - }); - ``` - - Also note that passing an anonymous function to `run.scheduleOnce` will - not prevent additional calls with an identical anonymous function from - scheduling the items multiple times, e.g.: - - ```javascript - function scheduleIt() { - run.scheduleOnce('actions', myContext, function() { - console.log('Closure'); - }); - } - - scheduleIt(); - scheduleIt(); - - // "Closure" will print twice, even though we're using `run.scheduleOnce`, - // because the function we pass to it is anonymous and won't match the - // previously scheduled operation. - ``` - - Available queues, and their order, can be found at `run.queues` - - @method scheduleOnce - @param {String} [queue] The name of the queue to schedule against. Default queues are 'sync' and 'actions'. - @param {Object} [target] The target of the method to invoke. - @param {Function|String} method The method to invoke. - If you pass a string it will be resolved on the - 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 () /*queue, target, method*/{ - _emberMetalDebug.assert('You have turned on testing mode, which disabled the run-loop\'s autorun. ' + 'You will need to wrap any code with asynchronous side-effects in a run', run.currentRunLoop || !_emberMetalTesting.isTesting()); - return backburner.scheduleOnce.apply(backburner, arguments); - }; - - /** - Schedules an item to run from within a separate run loop, after - control has been returned to the system. This is equivalent to calling - `run.later` with a wait time of 1ms. - - ```javascript - run.next(myContext, function() { - // code to be executed in the next run loop, - // which will be scheduled after the current one - }); - ``` - - Multiple operations scheduled with `run.next` will coalesce - into the same later run loop, along with any other operations - scheduled by `run.later` that expire right around the same - time that `run.next` operations will fire. - - Note that there are often alternatives to using `run.next`. - For instance, if you'd like to schedule an operation to happen - after all DOM element operations have completed within the current - run loop, you can make use of the `afterRender` run loop queue (added - by the `ember-views` package, along with the preceding `render` queue - where all the DOM element operations happen). - - Example: - - ```javascript - export default Ember.Component.extend({ - didInsertElement() { - this._super(...arguments); - run.scheduleOnce('afterRender', this, 'processChildElements'); - }, - - processChildElements() { - // ... do something with component's child component - // elements after they've finished rendering, which - // can't be done within this component's - // `didInsertElement` hook because that gets run - // before the child elements have been added to the DOM. - } - }); - ``` - - One benefit of the above approach compared to using `run.next` is - that you will be able to perform DOM/CSS operations before unprocessed - elements are rendered to the screen, which may prevent flickering or - other artifacts caused by delaying processing until after rendering. - - The other major benefit to the above approach is that `run.next` - introduces an element of non-determinism, which can make things much - harder to test, due to its reliance on `setTimeout`; it's much harder - to guarantee the order of scheduled operations when they are scheduled - outside of the current run loop, i.e. with `run.next`. - - @method next - @param {Object} [target] target of method to invoke - @param {Function|String} method The method to invoke. - If you pass a string it will be resolved on the - 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.next = function () { - for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { - args[_key4] = arguments[_key4]; - } - - args.push(1); - return backburner.later.apply(backburner, args); - }; - - /** - Cancels a scheduled item. Must be a value returned by `run.later()`, - `run.once()`, `run.scheduleOnce()`, `run.next()`, `run.debounce()`, or - `run.throttle()`. - - ```javascript - let runNext = run.next(myContext, function() { - // will not be executed - }); - - run.cancel(runNext); - - let runLater = run.later(myContext, function() { - // will not be executed - }, 500); - - run.cancel(runLater); - - let runScheduleOnce = run.scheduleOnce('afterRender', myContext, function() { - // will not be executed - }); - - run.cancel(runScheduleOnce); - - let runOnce = run.once(myContext, function() { - // will not be executed - }); - - run.cancel(runOnce); - - let throttle = run.throttle(myContext, function() { - // will not be executed - }, 1, false); - - run.cancel(throttle); - - let debounce = run.debounce(myContext, function() { - // will not be executed - }, 1); - - run.cancel(debounce); - - let debounceImmediate = run.debounce(myContext, function() { - // will be executed since we passed in true (immediate) - }, 100, true); - - // the 100ms delay until this method can be called again will be cancelled - run.cancel(debounceImmediate); - ``` - - @method cancel - @param {Object} timer Timer object to cancel - @return {Boolean} true if cancelled or false/undefined if it wasn't found - @public - */ - run.cancel = function (timer) { - return backburner.cancel(timer); - }; - - /** - Delay calling the target method until the debounce period has elapsed - with no additional debounce calls. If `debounce` is called again before - the specified time has elapsed, the timer is reset and the entire period - must pass again before the target method is called. - - This method should be used when an event may be called multiple times - but the action should only be called once when the event is done firing. - A common example is for scroll events where you only want updates to - happen once scrolling has ceased. - - ```javascript - function whoRan() { - console.log(this.name + ' ran.'); - } - - let myContext = { name: 'debounce' }; - - run.debounce(myContext, whoRan, 150); - - // less than 150ms passes - run.debounce(myContext, whoRan, 150); - - // 150ms passes - // whoRan is invoked with context myContext - // console logs 'debounce ran.' one time. - ``` - - Immediate allows you to run the function immediately, but debounce - other calls for this function until the wait time has elapsed. If - `debounce` is called again before the specified time has elapsed, - the timer is reset and the entire period must pass again before - the method can be called again. - - ```javascript - function whoRan() { - console.log(this.name + ' ran.'); - } - - let myContext = { name: 'debounce' }; - - run.debounce(myContext, whoRan, 150, true); - - // console logs 'debounce ran.' one time immediately. - // 100ms passes - run.debounce(myContext, whoRan, 150, true); - - // 150ms passes and nothing else is logged to the console and - // the debouncee is no longer being watched - run.debounce(myContext, whoRan, 150, true); - - // console logs 'debounce ran.' one time immediately. - // 150ms passes and nothing else is logged to the console and - // the debouncee is no longer being watched - - ``` - - @method debounce - @param {Object} [target] target of method to invoke - @param {Function|String} method The method to invoke. - May be a function or a string. If you pass a string - then it will be looked up on the passed target. - @param {Object} [args*] Optional arguments to pass to the timeout. - @param {Number} wait Number of milliseconds to wait. - @param {Boolean} immediate Trigger the function on the leading instead - of the trailing edge of the wait interval. Defaults to false. - @return {Array} Timer information for use in cancelling, see `run.cancel`. - @public - */ - run.debounce = function () { - return backburner.debounce.apply(backburner, arguments); - }; - - /** - Ensure that the target method is never called more frequently than - the specified spacing period. The target method is called immediately. - - ```javascript - function whoRan() { - console.log(this.name + ' ran.'); - } - - let myContext = { name: 'throttle' }; - - run.throttle(myContext, whoRan, 150); - // whoRan is invoked with context myContext - // console logs 'throttle ran.' - - // 50ms passes - run.throttle(myContext, whoRan, 150); - - // 50ms passes - run.throttle(myContext, whoRan, 150); - - // 150ms passes - run.throttle(myContext, whoRan, 150); - // whoRan is invoked with context myContext - // console logs 'throttle ran.' - ``` - - @method throttle - @param {Object} [target] target of method to invoke - @param {Function|String} method The method to invoke. - May be a function or a string. If you pass a string - then it will be looked up on the passed target. - @param {Object} [args*] Optional arguments to pass to the timeout. - @param {Number} spacing Number of milliseconds to space out requests. - @param {Boolean} immediate Trigger the function on the leading instead - of the trailing edge of the wait interval. Defaults to true. - @return {Array} Timer information for use in cancelling, see `run.cancel`. - @public - */ - run.throttle = function () { - return backburner.throttle.apply(backburner, arguments); - }; - - /** - Add a new named queue after the specified queue. - - The queue to add will only be added once. - - @method _addQueue - @param {String} name the name of the queue to add. - @param {String} after the name of the queue to add after. - @private - */ - run._addQueue = function (name, after) { - if (run.queues.indexOf(name) === -1) { - run.queues.splice(run.queues.indexOf(after) + 1, 0, name); - } - }; -}); -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 - observers will be buffered. - - ```javascript - let anObject = Ember.Object.create(); - - anObject.setProperties({ - firstName: 'Stanley', - lastName: 'Stuart', - age: 21 - }); - ``` - - @method setProperties - @param obj - @param {Object} properties - @return properties - @public - */ - - function setProperties(obj, properties) { - if (!properties || typeof properties !== 'object') { - return properties; - } - _emberMetalProperty_events.changeProperties(function () { - var props = Object.keys(properties); - var propertyName = undefined; - - for (var i = 0; i < props.length; i++) { - propertyName = props[i]; - - _emberMetalProperty_set.set(obj, propertyName, properties[propertyName]); - } - }); - return properties; - } -}); -enifed('ember-metal/tags', ['exports', 'glimmer-reference', 'ember-metal/meta', 'require', 'ember-metal/is_proxy'], function (exports, _glimmerReference, _emberMetalMeta, _require, _emberMetalIs_proxy) { - 'use strict'; - - exports.setHasViews = setHasViews; - exports.tagForProperty = tagForProperty; - exports.tagFor = tagFor; - exports.markObjectAsDirty = markObjectAsDirty; - - var hasViews = function () { - return false; - }; - - function setHasViews(fn) { - hasViews = fn; - } - - function makeTag() { - return new _glimmerReference.DirtyableTag(); - } - - function tagForProperty(object, propertyKey, _meta) { - if (_emberMetalIs_proxy.isProxy(object)) { - return tagFor(object, _meta); - } - - if (typeof object === 'object' && object) { - var meta = _meta || _emberMetalMeta.meta(object); - var tags = meta.writableTags(); - var tag = tags[propertyKey]; - if (tag) { - return tag; - } - - return tags[propertyKey] = makeTag(); - } else { - return _glimmerReference.CONSTANT_TAG; - } - } - - function tagFor(object, _meta) { - if (typeof object === 'object' && object) { - var meta = _meta || _emberMetalMeta.meta(object); - return meta.writableTag(makeTag); - } else { - return _glimmerReference.CONSTANT_TAG; - } - } - - function markObjectAsDirty(meta, propertyKey) { - var objectTag = meta && meta.readableTag(); - - if (objectTag) { - objectTag.dirty(); - } - - var tags = meta && meta.readableTags(); - var propertyTag = tags && tags[propertyKey]; - - if (propertyTag) { - propertyTag.dirty(); - } - - if (objectTag || propertyTag) { - ensureRunloop(); - } - } - - var run = undefined; - - function K() {} - - function ensureRunloop() { - if (!run) { - run = _require.default('ember-metal/run_loop').default; - } - - if (hasViews() && !run.backburner.currentInstance) { - run.schedule('actions', K); - } - } -}); -enifed("ember-metal/testing", ["exports"], function (exports) { - "use strict"; - - exports.isTesting = isTesting; - exports.setTesting = setTesting; - var testing = false; - - function isTesting() { - return testing; - } - - function setTesting(value) { - testing = !!value; - } -}); -enifed('ember-metal/transaction', ['exports', 'ember-metal/meta', 'ember-metal/debug', 'ember-metal/features'], function (exports, _emberMetalMeta, _emberMetalDebug, _emberMetalFeatures) { - 'use strict'; - - var runInTransaction = undefined, - didRender = undefined, - assertNotRendered = undefined; - - var raise = _emberMetalDebug.assert; - if (true) { - raise = function (message, test) { - _emberMetalDebug.deprecate(message, test, { id: 'ember-views.render-double-modify', until: '3.0.0' }); - }; - } - - var implication = undefined; - if (true) { - implication = 'will be removed in Ember 3.0.'; - } else if (true) { - implication = 'is no longer supported. See https://github.com/emberjs/ember.js/issues/13948 for more details.'; - } - - if (true || true) { - (function () { - var counter = 0; - var inTransaction = false; - var shouldReflush = undefined; - - exports.default = runInTransaction = function (context, methodName) { - shouldReflush = false; - inTransaction = true; - context[methodName](); - inTransaction = false; - counter++; - return shouldReflush; - }; - - exports.didRender = didRender = function (object, key, reference) { - if (!inTransaction) { - return; - } - var meta = _emberMetalMeta.meta(object); - var lastRendered = meta.writableLastRendered(); - lastRendered[key] = counter; - - _emberMetalDebug.runInDebug(function () { - var lastRenderedFrom = meta.writableLastRenderedFrom(); - lastRenderedFrom[key] = reference; - }); - }; - - exports.assertNotRendered = assertNotRendered = function (object, key, _meta) { - var meta = _meta || _emberMetalMeta.meta(object); - var lastRendered = meta.readableLastRendered(); - - if (lastRendered && lastRendered[key] === counter) { - raise((function () { - var ref = meta.readableLastRenderedFrom(); - var parts = []; - var lastRef = ref[key]; - - var label = undefined; - - if (lastRef) { - while (lastRef && lastRef._propertyKey) { - parts.unshift(lastRef._propertyKey); - lastRef = lastRef._parentReference; - } - - label = parts.join(); - } else { - label = 'the same value'; - } - - return 'You modified ' + parts.join('.') + ' twice on ' + object + ' in a single render. This was unreliable and slow in Ember 1.x and ' + implication; - })(), false); - - shouldReflush = true; - } - }; - })(); - } else { - exports.default = runInTransaction = function () { - throw new Error('Cannot call runInTransaction without Glimmer'); - }; - - exports.didRender = didRender = function () { - throw new Error('Cannot call didRender without Glimmer'); - }; - - exports.assertNotRendered = assertNotRendered = function () { - throw new Error('Cannot call assertNotRendered without Glimmer'); - }; - } - - exports.default = runInTransaction; - exports.didRender = didRender; - exports.assertNotRendered = assertNotRendered; -}); -enifed('ember-metal/watch_key', ['exports', 'ember-utils', 'ember-metal/features', 'ember-metal/meta', 'ember-metal/properties'], function (exports, _emberUtils, _emberMetalFeatures, _emberMetalMeta, _emberMetalProperties) { - 'use strict'; - - exports.watchKey = watchKey; - exports.unwatchKey = unwatchKey; - - var handleMandatorySetter = undefined; - - function watchKey(obj, keyName, meta) { - if (typeof obj !== 'object' || obj === null) { - return; - } - var m = meta || _emberMetalMeta.meta(obj); - - // activate watching first time - if (!m.peekWatching(keyName)) { - m.writeWatching(keyName, 1); - - var possibleDesc = obj[keyName]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - if (desc && desc.willWatch) { - desc.willWatch(obj, keyName); - } - - if ('function' === typeof obj.willWatchProperty) { - obj.willWatchProperty(keyName); - } - - if (true) { - // NOTE: this is dropped for prod + minified builds - handleMandatorySetter(m, obj, keyName); - } - } else { - m.writeWatching(keyName, (m.peekWatching(keyName) || 0) + 1); - } - } - - if (true) { - (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 = _emberUtils.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) { - if (typeof obj !== 'object' || obj === null) { - return; - } - var meta = _meta || _emberMetalMeta.meta(obj); - - // do nothing of this object has already been destroyed - if (meta.isSourceDestroyed()) { - return; - } - - var count = meta.peekWatching(keyName); - if (count === 1) { - meta.writeWatching(keyName, 0); - - var possibleDesc = obj[keyName]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - if (desc && desc.didUnwatch) { - desc.didUnwatch(obj, keyName); - } - - if ('function' === typeof obj.didUnwatchProperty) { - obj.didUnwatchProperty(keyName); - } - - if (true) { - // 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 = _emberUtils.lookupDescriptor(obj, keyName); - - if (maybeMandatoryDescriptor.set && maybeMandatoryDescriptor.set.isMandatorySetter) { - if (maybeMandatoryDescriptor.get && maybeMandatoryDescriptor.get.isInheritingGetter) { - var possibleValue = meta.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: meta.peekValues(keyName) - }); - meta.deleteFromValues(keyName); - } - } - } - } else if (count > 1) { - meta.writeWatching(keyName, count - 1); - } - } -}); -enifed('ember-metal/watch_path', ['exports', 'ember-metal/meta', 'ember-metal/chains'], function (exports, _emberMetalMeta, _emberMetalChains) { - 'use strict'; - - exports.makeChainNode = makeChainNode; - 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 - // the current object. - function chainsFor(obj, meta) { - return (meta || _emberMetalMeta.meta(obj)).writableChains(makeChainNode); - } - - function makeChainNode(obj) { - return new _emberMetalChains.ChainNode(null, null, obj); - } - - function watchPath(obj, keyPath, meta) { - if (typeof obj !== 'object' || obj === null) { - return; - } - var m = meta || _emberMetalMeta.meta(obj); - var counter = m.peekWatching(keyPath) || 0; - if (!counter) { - // activate watching first time - m.writeWatching(keyPath, 1); - chainsFor(obj, m).add(keyPath); - } else { - m.writeWatching(keyPath, counter + 1); - } - } - - function unwatchPath(obj, keyPath, meta) { - if (typeof obj !== 'object' || obj === null) { - return; - } - var m = meta || _emberMetalMeta.meta(obj); - var counter = m.peekWatching(keyPath) || 0; - - if (counter === 1) { - m.writeWatching(keyPath, 0); - chainsFor(obj, m).remove(keyPath); - } else if (counter > 1) { - m.writeWatching(keyPath, counter - 1); - } - } -}); -enifed('ember-metal/watching', ['exports', 'ember-metal/watch_key', 'ember-metal/watch_path', 'ember-metal/path_cache', 'ember-metal/meta'], function (exports, _emberMetalWatch_key, _emberMetalWatch_path, _emberMetalPath_cache, _emberMetalMeta) { - /** - @module ember-metal - */ - - 'use strict'; - - exports.isWatching = isWatching; - exports.watcherCount = watcherCount; - exports.unwatch = unwatch; - exports.destroy = destroy; - - /** - Starts watching a property on an object. Whenever the property changes, - invokes `Ember.propertyWillChange` and `Ember.propertyDidChange`. This is the - primitive used by observers and dependent keys; usually you will never call - this method directly but instead use higher level methods like - `Ember.addObserver()` - - @private - @method watch - @for Ember - @param obj - @param {String} _keyPath - */ - function watch(obj, _keyPath, m) { - if (!_emberMetalPath_cache.isPath(_keyPath)) { - _emberMetalWatch_key.watchKey(obj, _keyPath, m); - } else { - _emberMetalWatch_path.watchPath(obj, _keyPath, m); - } - } - - exports.watch = watch; - - function isWatching(obj, key) { - if (typeof obj !== 'object' || obj === null) { - return false; - } - var meta = _emberMetalMeta.peekMeta(obj); - return (meta && meta.peekWatching(key)) > 0; - } - - function watcherCount(obj, key) { - var meta = _emberMetalMeta.peekMeta(obj); - return meta && meta.peekWatching(key) || 0; - } - - function unwatch(obj, _keyPath, m) { - if (!_emberMetalPath_cache.isPath(_keyPath)) { - _emberMetalWatch_key.unwatchKey(obj, _keyPath, m); - } else { - _emberMetalWatch_path.unwatchPath(obj, _keyPath, m); - } - } - - /** - Tears down the meta on an object so that it can be garbage collected. - Multiple calls will have no effect. - - @method destroy - @for Ember - @param {Object} obj the object to destroy - @return {void} - @private - */ - - function destroy(obj) { - _emberMetalMeta.deleteMeta(obj); - } -}); -enifed('ember-metal/weak_map', ['exports', 'ember-utils', 'ember-metal/meta'], function (exports, _emberUtils, _emberMetalMeta) { - 'use strict'; - - exports.default = WeakMap; - - var id = 0; - - // Returns whether Type(value) is Object according to the terminology in the spec - function isObject(value) { - return typeof value === 'object' && value !== null || typeof value === 'function'; - } - - /* - * @class Ember.WeakMap - * @public - * @category ember-metal-weakmap - * - * A partial polyfill for [WeakMap](http://www.ecma-international.org/ecma-262/6.0/#sec-weakmap-objects). - * - * There is a small but important caveat. This implementation assumes that the - * weak map will live longer (in the sense of garbage collection) than all of its - * keys, otherwise it is possible to leak the values stored in the weak map. In - * practice, most use cases satisfy this limitation which is why it is included - * in ember-metal. - */ - - function WeakMap(iterable) { - if (!(this instanceof WeakMap)) { - throw new TypeError('Constructor WeakMap requires \'new\''); - } - - this._id = _emberUtils.GUID_KEY + id++; - - if (iterable === null || iterable === undefined) { - return; - } else if (Array.isArray(iterable)) { - for (var i = 0; i < iterable.length; i++) { - var _iterable$i = iterable[i]; - var key = _iterable$i[0]; - var value = _iterable$i[1]; - - this.set(key, value); - } - } else { - throw new TypeError('The weak map constructor polyfill only supports an array argument'); - } - } - - /* - * @method get - * @param key {Object | Function} - * @return {Any} stored value - */ - WeakMap.prototype.get = function (obj) { - if (!isObject(obj)) { - return undefined; - } - - var meta = _emberMetalMeta.peekMeta(obj); - if (meta) { - var map = meta.readableWeak(); - if (map) { - if (map[this._id] === _emberMetalMeta.UNDEFINED) { - return undefined; - } - - return map[this._id]; - } - } - }; - - /* - * @method set - * @param key {Object | Function} - * @param value {Any} - * @return {WeakMap} the weak map - */ - WeakMap.prototype.set = function (obj, value) { - if (!isObject(obj)) { - throw new TypeError('Invalid value used as weak map key'); - } - - if (value === undefined) { - value = _emberMetalMeta.UNDEFINED; - } - - _emberMetalMeta.meta(obj).writableWeak()[this._id] = value; - - return this; - }; - - /* - * @method has - * @param key {Object | Function} - * @return {boolean} if the key exists - */ - WeakMap.prototype.has = function (obj) { - if (!isObject(obj)) { - return false; - } - - var meta = _emberMetalMeta.peekMeta(obj); - if (meta) { - var map = meta.readableWeak(); - if (map) { - return map[this._id] !== undefined; - } - } - - return false; - }; - - /* - * @method delete - * @param key {Object | Function} - * @return {boolean} if the key was deleted - */ - WeakMap.prototype.delete = function (obj) { - if (this.has(obj)) { - delete _emberMetalMeta.meta(obj).writableWeak()[this._id]; - return true; - } else { - return false; - } - }; - - /* - * @method toString - * @return {String} - */ - WeakMap.prototype.toString = function () { - return '[object WeakMap]'; - }; -}); -enifed('ember-template-compiler/compat', ['exports', 'ember-metal', 'ember-template-compiler/system/precompile', 'ember-template-compiler/system/compile', 'ember-template-compiler/system/compile-options'], function (exports, _emberMetal, _emberTemplateCompilerSystemPrecompile, _emberTemplateCompilerSystemCompile, _emberTemplateCompilerSystemCompileOptions) { - 'use strict'; - - var EmberHandlebars = _emberMetal.default.Handlebars = _emberMetal.default.Handlebars || {}; - var EmberHTMLBars = _emberMetal.default.HTMLBars = _emberMetal.default.HTMLBars || {}; - - EmberHTMLBars.precompile = EmberHandlebars.precompile = _emberTemplateCompilerSystemPrecompile.default; - EmberHTMLBars.compile = EmberHandlebars.compile = _emberTemplateCompilerSystemCompile.default; - EmberHTMLBars.registerPlugin = _emberTemplateCompilerSystemCompileOptions.registerPlugin; -}); -// reexports -enifed('ember-template-compiler/index', ['exports', 'ember-metal', 'ember-environment', 'ember/version', 'ember-template-compiler/compat', 'ember-template-compiler/system/bootstrap', 'ember-template-compiler/system/precompile', 'ember-template-compiler/system/compile', 'ember-template-compiler/system/compile-options', 'ember-template-compiler/plugins'], function (exports, _emberMetal, _emberEnvironment, _emberVersion, _emberTemplateCompilerCompat, _emberTemplateCompilerSystemBootstrap, _emberTemplateCompilerSystemPrecompile, _emberTemplateCompilerSystemCompile, _emberTemplateCompilerSystemCompileOptions, _emberTemplateCompilerPlugins) { - 'use strict'; - - // private API used by ember-cli-htmlbars to setup ENV and FEATURES - if (!_emberMetal.default.ENV) { - _emberMetal.default.ENV = _emberEnvironment.ENV; - } - if (!_emberMetal.default.FEATURES) { - _emberMetal.default.FEATURES = _emberMetal.FEATURES; - } - if (!_emberMetal.default.VERSION) { - _emberMetal.default.VERSION = _emberVersion.default; - } - - exports._Ember = _emberMetal.default; - exports.precompile = _emberTemplateCompilerSystemPrecompile.default; - exports.compile = _emberTemplateCompilerSystemCompile.default; - exports.compileOptions = _emberTemplateCompilerSystemCompileOptions.default; - exports.registerPlugin = _emberTemplateCompilerSystemCompileOptions.registerPlugin; - exports.defaultPlugins = _emberTemplateCompilerPlugins.default; - - // used for adding Ember.Handlebars.compile for backwards compat -}); - -// used to bootstrap templates -enifed('ember-template-compiler/plugins/assert-reserved-named-arguments', ['exports', 'ember-metal', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetal, _emberTemplateCompilerSystemCalculateLocationDisplay) { - 'use strict'; - - exports.default = AssertReservedNamedArguments; - - function AssertReservedNamedArguments(options) { - this.syntax = null; - this.options = options; - } - - AssertReservedNamedArguments.prototype.transform = function AssertReservedNamedArguments_transform(ast) { - var moduleName = this.options.meta.moduleName; - - this.syntax.traverse(ast, { - PathExpression: function (node) { - if (node.original[0] === '@') { - _emberMetal.assert(assertMessage(moduleName, node)); - } - } - }); - - return ast; - }; - - function assertMessage(moduleName, node) { - var path = node.original; - var source = _emberTemplateCompilerSystemCalculateLocationDisplay.default(moduleName, node.loc); - - return '\'' + path + '\' is not a valid path. ' + source; - } -}); -enifed('ember-template-compiler/plugins/deprecate-render-model', ['exports', 'ember-metal', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetal, _emberTemplateCompilerSystemCalculateLocationDisplay) { - 'use strict'; - - exports.default = DeprecateRenderModel; - - function DeprecateRenderModel(options) { - this.syntax = null; - this.options = options; - } - - DeprecateRenderModel.prototype.transform = function DeprecateRenderModel_transform(ast) { - var moduleName = this.options.meta.moduleName; - var walker = new this.syntax.Walker(); - - walker.visit(ast, function (node) { - if (!validate(node)) { - return; - } - - each(node.params, function (param) { - if (param.type !== 'PathExpression') { - return; - } - - _emberMetal.deprecate(deprecationMessage(moduleName, node, param), false, { - id: 'ember-template-compiler.deprecate-render-model', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x#toc_model-param-in-code-render-code-helper' - }); - }); - }); - - return ast; - }; - - function validate(node) { - return node.type === 'MustacheStatement' && node.path.original === 'render' && node.params.length > 1; - } - - function each(list, callback) { - for (var i = 0, l = list.length; i < l; i++) { - callback(list[i]); - } - } - - function deprecationMessage(moduleName, node, param) { - var sourceInformation = _emberTemplateCompilerSystemCalculateLocationDisplay.default(moduleName, node.loc); - var componentName = node.params[0].original; - var modelName = param.original; - var original = '{{render "' + componentName + '" ' + modelName + '}}'; - var preferred = '{{' + componentName + ' model=' + modelName + '}}'; - - return 'Please refactor `' + original + '` to a component and invoke via' + (' `' + preferred + '`. ' + sourceInformation); - } -}); -enifed('ember-template-compiler/plugins/index', ['exports', 'ember-template-compiler/plugins/transform-old-binding-syntax', 'ember-template-compiler/plugins/transform-item-class', 'ember-template-compiler/plugins/transform-angle-bracket-components', 'ember-template-compiler/plugins/transform-input-on-to-onEvent', 'ember-template-compiler/plugins/transform-top-level-components', 'ember-template-compiler/plugins/transform-inline-link-to', 'ember-template-compiler/plugins/transform-old-class-binding-syntax', 'ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings', 'ember-template-compiler/plugins/deprecate-render-model', 'ember-template-compiler/plugins/assert-reserved-named-arguments', 'ember-template-compiler/plugins/transform-action-syntax', 'ember-template-compiler/plugins/transform-input-type-syntax', 'ember-template-compiler/plugins/transform-attrs-into-args', 'ember-template-compiler/plugins/transform-each-in-into-each', 'ember-template-compiler/plugins/transform-has-block-syntax'], function (exports, _emberTemplateCompilerPluginsTransformOldBindingSyntax, _emberTemplateCompilerPluginsTransformItemClass, _emberTemplateCompilerPluginsTransformAngleBracketComponents, _emberTemplateCompilerPluginsTransformInputOnToOnEvent, _emberTemplateCompilerPluginsTransformTopLevelComponents, _emberTemplateCompilerPluginsTransformInlineLinkTo, _emberTemplateCompilerPluginsTransformOldClassBindingSyntax, _emberTemplateCompilerPluginsTransformQuotedBindingsIntoJustBindings, _emberTemplateCompilerPluginsDeprecateRenderModel, _emberTemplateCompilerPluginsAssertReservedNamedArguments, _emberTemplateCompilerPluginsTransformActionSyntax, _emberTemplateCompilerPluginsTransformInputTypeSyntax, _emberTemplateCompilerPluginsTransformAttrsIntoArgs, _emberTemplateCompilerPluginsTransformEachInIntoEach, _emberTemplateCompilerPluginsTransformHasBlockSyntax) { - 'use strict'; - - exports.default = Object.freeze([_emberTemplateCompilerPluginsTransformOldBindingSyntax.default, _emberTemplateCompilerPluginsTransformItemClass.default, _emberTemplateCompilerPluginsTransformAngleBracketComponents.default, _emberTemplateCompilerPluginsTransformInputOnToOnEvent.default, _emberTemplateCompilerPluginsTransformTopLevelComponents.default, _emberTemplateCompilerPluginsTransformInlineLinkTo.default, _emberTemplateCompilerPluginsTransformOldClassBindingSyntax.default, _emberTemplateCompilerPluginsTransformQuotedBindingsIntoJustBindings.default, _emberTemplateCompilerPluginsDeprecateRenderModel.default, _emberTemplateCompilerPluginsAssertReservedNamedArguments.default, _emberTemplateCompilerPluginsTransformActionSyntax.default, _emberTemplateCompilerPluginsTransformInputTypeSyntax.default, _emberTemplateCompilerPluginsTransformAttrsIntoArgs.default, _emberTemplateCompilerPluginsTransformEachInIntoEach.default, _emberTemplateCompilerPluginsTransformHasBlockSyntax.default]); -}); -enifed('ember-template-compiler/plugins/transform-action-syntax', ['exports'], function (exports) { - /** - @module ember - @submodule ember-glimmer - */ - - /** - A Glimmer2 AST transformation that replaces all instances of - - ```handlebars - '], ['\n ']); - _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: closure components', (function (_RenderingTest) { + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: contextual components', (function (_RenderingTest) { babelHelpers.inherits(_class, _RenderingTest); function _class() { @@ -12853,7 +12484,7 @@ babelHelpers.classCallCheck(this, _class); this.assertText('Inner 28'); }; - _class.prototype['@test conflicting positional and hash parameters raise and assertion if in the same closure'] = function testConflictingPositionalAndHashParametersRaiseAndAssertionIfInTheSameClosure() { + _class.prototype['@test conflicting positional and hash parameters raise and assertion if in the same component context'] = function testConflictingPositionalAndHashParametersRaiseAndAssertionIfInTheSameComponentContext() { var _this15 = this; this.registerComponent('-looked-up', { @@ -12907,7 +12538,7 @@ babelHelpers.classCallCheck(this, _class); this.assertText('Hodi Hodari'); }; - _class.prototype['@test conflicting positional and hash parameters does not raise an assertion if in different closure'] = function testConflictingPositionalAndHashParametersDoesNotRaiseAnAssertionIfInDifferentClosure() { + _class.prototype['@test conflicting positional and hash parameters does not raise an assertion if in different component context'] = function testConflictingPositionalAndHashParametersDoesNotRaiseAnAssertionIfInDifferentComponentContext() { var _this17 = this; this.registerComponent('-looked-up', { @@ -13084,7 +12715,7 @@ babelHelpers.classCallCheck(this, _class); _class.prototype['@test renders with dot path and rest parameter does not leak'] = function testRendersWithDotPathAndRestParameterDoesNotLeak(assert) { // In the original implementation, positional parameters were not handled - // correctly causing the first positional parameter to be the closure + // correctly causing the first positional parameter to be the contextual // component itself. var value = false; @@ -13163,7 +12794,7 @@ babelHelpers.classCallCheck(this, _class); assert.equal(this.$('#nested-prop').text(), '1'); }; - _class.prototype['@test adding parameters to a closure component\'s instance does not add it to other instances'] = function testAddingParametersToAClosureComponentSInstanceDoesNotAddItToOtherInstances() { + _class.prototype['@test adding parameters to a contextual component\'s instance does not add it to other instances'] = function testAddingParametersToAContextualComponentSInstanceDoesNotAddItToOtherInstances() { var _this26 = this; // If parameters and attributes are not handled correctly, setting a value @@ -13187,7 +12818,7 @@ babelHelpers.classCallCheck(this, _class); this.assertText('Foo'); }; - _class.prototype['@test parameters in a closure are mutable when closure is a param'] = function testParametersInAClosureAreMutableWhenClosureIsAParam(assert) { + _class.prototype['@test parameters in a contextual component are mutable when value is a param'] = function testParametersInAContextualComponentAreMutableWhenValueIsAParam(assert) { var _this27 = this; // This checks that a `(mut)` is added to parameters and attributes to @@ -13503,25 +13134,147 @@ babelHelpers.classCallCheck(this, _class); assert.equal(this.$().text(), 'my-comp: open'); }; + _class.prototype['@test GH#14508 rest positional params are received when passed as named parameter'] = function testGH14508RestPositionalParamsAreReceivedWhenPassedAsNamedParameter() { + var _this33 = this; + + this.registerComponent('my-link', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'params' + }), + template: '{{#each params as |p|}}{{p}}{{/each}}' + }); + + this.render('{{component (component "my-link") params=allParams}}', { + allParams: _emberRuntimeSystemNative_array.A(['a', 'b']) + }); + + this.assertText('ab'); + + this.runTask(function () { + return _this33.rerender(); + }); + + this.assertText('ab'); + + this.runTask(function () { + return _this33.context.get('allParams').pushObject('c'); + }); + + this.assertText('abc'); + + this.runTask(function () { + return _this33.context.get('allParams').popObject(); + }); + + this.assertText('ab'); + + this.runTask(function () { + return _this33.context.get('allParams').clear(); + }); + + this.assertText(''); + + this.runTask(function () { + return _this33.context.set('allParams', _emberRuntimeSystemNative_array.A(['1', '2'])); + }); + + this.assertText('12'); + + this.runTask(function () { + return _this33.context.set('allParams', _emberRuntimeSystemNative_array.A(['a', 'b'])); + }); + + this.assertText('ab'); + }; + + _class.prototype['@test GH#14508 rest positional params are received when passed as named parameter with dot notation'] = function testGH14508RestPositionalParamsAreReceivedWhenPassedAsNamedParameterWithDotNotation() { + var _this34 = this; + + this.registerComponent('my-link', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'params' + }), + template: '{{#each params as |p|}}{{p}}{{/each}}' + }); + + this.render('{{#with (hash link=(component "my-link")) as |c|}}{{c.link params=allParams}}{{/with}}', { + allParams: _emberRuntimeSystemNative_array.A(['a', 'b']) + }); + + this.assertText('ab'); + + this.runTask(function () { + return _this34.rerender(); + }); + + this.assertText('ab'); + + this.runTask(function () { + return _this34.context.get('allParams').pushObject('c'); + }); + + this.assertText('abc'); + + this.runTask(function () { + return _this34.context.get('allParams').popObject(); + }); + + this.assertText('ab'); + + this.runTask(function () { + return _this34.context.get('allParams').clear(); + }); + + this.assertText(''); + + this.runTask(function () { + return _this34.context.set('allParams', _emberRuntimeSystemNative_array.A(['1', '2'])); + }); + + this.assertText('12'); + + this.runTask(function () { + return _this34.context.set('allParams', _emberRuntimeSystemNative_array.A(['a', 'b'])); + }); + + this.assertText('ab'); + }; + + _class.prototype['@test GH#14632 give useful warning when calling contextual components with input as a name'] = function testGH14632GiveUsefulWarningWhenCallingContextualComponentsWithInputAsAName() { + var _this35 = this; + + expectAssertion(function () { + _this35.render('{{component (component "input" type="text")}}'); + }, 'You cannot use the input helper as a contextual helper. Please extend Ember.TextField or Ember.Checkbox to use it as a contextual component.'); + }; + + _class.prototype['@test GH#14632 give useful warning when calling contextual components with textarea as a name'] = function testGH14632GiveUsefulWarningWhenCallingContextualComponentsWithTextareaAsAName() { + var _this36 = this; + + expectAssertion(function () { + _this36.render('{{component (component "textarea" type="text")}}'); + }, 'You cannot use the textarea helper as a contextual helper. Please extend Ember.TextArea to use it as a contextual component.'); + }; + return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); - var ClosureComponentMutableParamsTest = (function (_RenderingTest2) { -babelHelpers.inherits(ClosureComponentMutableParamsTest, _RenderingTest2); + var ContextualComponentMutableParamsTest = (function (_RenderingTest2) { +babelHelpers.inherits(ContextualComponentMutableParamsTest, _RenderingTest2); - function ClosureComponentMutableParamsTest() { -babelHelpers.classCallCheck(this, ClosureComponentMutableParamsTest); + function ContextualComponentMutableParamsTest() { +babelHelpers.classCallCheck(this, ContextualComponentMutableParamsTest); _RenderingTest2.apply(this, arguments); } - ClosureComponentMutableParamsTest.prototype.render = function render(templateStr) { + ContextualComponentMutableParamsTest.prototype.render = function render(templateStr) { var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; _RenderingTest2.prototype.render.call(this, templateStr + '{{model.val2}}', _emberUtils.assign(context, { model: { val2: 8 } })); }; - return ClosureComponentMutableParamsTest; + return ContextualComponentMutableParamsTest; })(_emberGlimmerTestsUtilsTestCase.RenderingTest); var MutableParamTestGenerator = (function () { @@ -13537,8 +13290,8 @@ babelHelpers.classCallCheck(this, MutableParamTestGenerator); var title = _ref2.title; var setup = _ref2.setup; - return _ref = {}, _ref['@test parameters in a closure are mutable when closure is a ' + title] = function (assert) { - var _this33 = this; + return _ref = {}, _ref['@test parameters in a contextual component are mutable when value is a ' + title] = function (assert) { + var _this37 = this; this.registerComponent('change-button', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ @@ -13552,19 +13305,19 @@ babelHelpers.classCallCheck(this, MutableParamTestGenerator); assert.equal(this.$('.value').text(), '8'); this.runTask(function () { - return _this33.rerender(); + return _this37.rerender(); }); assert.equal(this.$('.value').text(), '8'); this.runTask(function () { - return _this33.$('.my-button').click(); + return _this37.$('.my-button').click(); }); assert.equal(this.$('.value').text(), '10'); this.runTask(function () { - return _this33.context.set('model', { val2: 8 }); + return _this37.context.set('model', { val2: 8 }); }); assert.equal(this.$('.value').text(), '8'); @@ -13574,7 +13327,7 @@ babelHelpers.classCallCheck(this, MutableParamTestGenerator); return MutableParamTestGenerator; })(); - _emberGlimmerTestsUtilsAbstractTestCase.applyMixins(ClosureComponentMutableParamsTest, new MutableParamTestGenerator([{ + _emberGlimmerTestsUtilsAbstractTestCase.applyMixins(ContextualComponentMutableParamsTest, new MutableParamTestGenerator([{ title: 'param', setup: function () { this.render('{{component (component "change-button" model.val2)}}'); @@ -13611,23 +13364,15 @@ babelHelpers.classCallCheck(this, MutableParamTestGenerator); } }])); - _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: closure components -- mutable params', ClosureComponentMutableParamsTest); -}); -enifed('ember-glimmer/tests/integration/components/closure-components-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/closure-components-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/closure-components-test.js should pass jscs.'); - }); + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: contextual components -- mutable params', ContextualComponentMutableParamsTest); }); -enifed('ember-glimmer/tests/integration/components/closure-components-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/contextual-components-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/closure-components-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/contextual-components-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/closure-components-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/contextual-components-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/curly-components-test', ['exports', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/test-helpers'], function (exports, _emberMetal, _emberRuntime, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsTestHelpers) { @@ -13967,6 +13712,22 @@ babelHelpers.classCallCheck(this, _class); this.assertComponentElement(this.firstChild, { tagName: 'foo-bar', content: 'hello' }); }; + _class.prototype['@test tagName can not be a computed property'] = function testTagNameCanNotBeAComputedProperty(assert) { + var _this10 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: _emberMetal.computed(function () { + return 'foo-bar'; + }) + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + expectAssertion(function () { + _this10.render('{{foo-bar}}'); + }, /You cannot use a computed property for the component's `tagName` \(<\(.+>\)\./); + }; + _class.prototype['@test class is applied before didInsertElement'] = function testClassIsAppliedBeforeDidInsertElement(assert) { var componentClass = undefined; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -13983,7 +13744,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test it can have custom classNames'] = function testItCanHaveCustomClassNames() { - var _this10 = this; + var _this11 = this; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ classNames: ['foo', 'bar'] @@ -13996,14 +13757,14 @@ babelHelpers.classCallCheck(this, _class); this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar') }, content: 'hello' }); this.runTask(function () { - return _this10.rerender(); + return _this11.rerender(); }); this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar') }, content: 'hello' }); }; _class.prototype['@test should not apply falsy class name'] = function testShouldNotApplyFalsyClassName() { - var _this11 = this; + var _this12 = this; this.registerComponent('foo-bar', { template: 'hello' }); @@ -14014,14 +13775,14 @@ babelHelpers.classCallCheck(this, _class); this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: 'ember-view' }, content: 'hello' }); this.runTask(function () { - return _this11.rerender(); + return _this12.rerender(); }); this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: 'ember-view' }, content: 'hello' }); }; _class.prototype['@test should apply classes of the dasherized property name when bound property specified is true'] = function testShouldApplyClassesOfTheDasherizedPropertyNameWhenBoundPropertySpecifiedIsTrue() { - var _this12 = this; + var _this13 = this; this.registerComponent('foo-bar', { template: 'hello' }); @@ -14032,26 +13793,26 @@ babelHelpers.classCallCheck(this, _class); this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('ember-view some-truth') }, content: 'hello' }); this.runTask(function () { - return _this12.rerender(); + return _this13.rerender(); }); this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('ember-view some-truth') }, content: 'hello' }); this.runTask(function () { - return _emberMetal.set(_this12.context, 'model.someTruth', false); + return _emberMetal.set(_this13.context, 'model.someTruth', false); }); this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') }, content: 'hello' }); this.runTask(function () { - return _emberMetal.set(_this12.context, 'model', { someTruth: true }); + return _emberMetal.set(_this13.context, 'model', { someTruth: true }); }); this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('ember-view some-truth') }, content: 'hello' }); }; _class.prototype['@test class property on components can be dynamic'] = function testClassPropertyOnComponentsCanBeDynamic() { - var _this13 = this; + var _this14 = this; this.registerComponent('foo-bar', { template: 'hello' }); @@ -14062,30 +13823,31 @@ babelHelpers.classCallCheck(this, _class); this.assertComponentElement(this.firstChild, { content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar') } }); this.runTask(function () { - return _this13.rerender(); + return _this14.rerender(); }); this.assertComponentElement(this.firstChild, { content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar') } }); this.runTask(function () { - return _emberMetal.set(_this13.context, 'fooBar', false); + return _emberMetal.set(_this14.context, 'fooBar', false); }); this.assertComponentElement(this.firstChild, { content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') } }); this.runTask(function () { - return _emberMetal.set(_this13.context, 'fooBar', true); + return _emberMetal.set(_this14.context, 'fooBar', true); }); this.assertComponentElement(this.firstChild, { content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar') } }); }; _class.prototype['@test it can have custom classNames from constructor'] = function testItCanHaveCustomClassNamesFromConstructor() { - var _this14 = this; + var _this15 = this; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ init: function () { this._super(); + this.classNames = this.classNames.slice(); this.classNames.push('foo', 'bar', 'outside-' + this.get('extraClass')); } }); @@ -14097,14 +13859,14 @@ babelHelpers.classCallCheck(this, _class); this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar outside-baz') }, content: 'hello' }); this.runTask(function () { - return _this14.rerender(); + return _this15.rerender(); }); this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar outside-baz') }, content: 'hello' }); }; _class.prototype['@test it can set custom classNames from the invocation'] = function testItCanSetCustomClassNamesFromTheInvocation() { - var _this15 = this; + var _this16 = this; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ classNames: ['foo'] @@ -14119,7 +13881,7 @@ babelHelpers.classCallCheck(this, _class); this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo') }, content: 'hello' }); this.runTask(function () { - return _this15.rerender(); + return _this16.rerender(); }); this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar baz') }, content: 'hello' }); @@ -14128,7 +13890,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test it has an element'] = function testItHasAnElement() { - var _this16 = this; + var _this17 = this; var instance = undefined; @@ -14148,7 +13910,7 @@ babelHelpers.classCallCheck(this, _class); this.assertComponentElement(element1, { content: 'hello' }); this.runTask(function () { - return _this16.rerender(); + return _this17.rerender(); }); var element2 = instance.element; @@ -14159,7 +13921,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test it has a jQuery proxy to the element'] = function testItHasAJQueryProxyToTheElement(assert) { - var _this17 = this; + var _this18 = this; var instance = undefined; @@ -14179,7 +13941,7 @@ babelHelpers.classCallCheck(this, _class); this.assertComponentElement(element1, { content: 'hello' }); this.runTask(function () { - return _this17.rerender(); + return _this18.rerender(); }); var element2 = instance.$()[0]; @@ -14190,7 +13952,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test it scopes the jQuery proxy to the component element'] = function testItScopesTheJQueryProxyToTheComponentElement(assert) { - var _this18 = this; + var _this19 = this; var instance = undefined; @@ -14211,7 +13973,7 @@ babelHelpers.classCallCheck(this, _class); assert.equal($span.attr('class'), 'inner'); this.runTask(function () { - return _this18.rerender(); + return _this19.rerender(); }); $span = instance.$('span'); @@ -14221,7 +13983,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test an empty component does not have childNodes'] = function testAnEmptyComponentDoesNotHaveChildNodes(assert) { - var _this19 = this; + var _this20 = this; var fooBarInstance = undefined; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -14241,7 +14003,7 @@ babelHelpers.classCallCheck(this, _class); assert.strictEqual(fooBarInstance.element.childNodes.length, 0); this.runTask(function () { - return _this19.rerender(); + return _this20.rerender(); }); this.assertComponentElement(this.firstChild, { tagName: 'input' }); @@ -14250,7 +14012,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test it has the right parentView and childViews'] = function testItHasTheRightParentViewAndChildViews(assert) { - var _this20 = this; + var _this21 = this; var fooBarInstance = undefined, fooBarBazInstance = undefined; @@ -14282,7 +14044,7 @@ babelHelpers.classCallCheck(this, _class); assert.deepEqual(fooBarInstance.childViews, [fooBarBazInstance]); this.runTask(function () { - return _this20.rerender(); + return _this21.rerender(); }); this.assertText('foo-bar foo-bar-baz'); @@ -14294,7 +14056,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test it renders passed named arguments'] = function testItRendersPassedNamedArguments() { - var _this21 = this; + var _this22 = this; this.registerComponent('foo-bar', { template: '{{foo}}' @@ -14309,26 +14071,26 @@ babelHelpers.classCallCheck(this, _class); this.assertText('Hola'); this.runTask(function () { - return _this21.rerender(); + return _this22.rerender(); }); this.assertText('Hola'); this.runTask(function () { - return _this21.context.set('model.bar', 'Hello'); + return _this22.context.set('model.bar', 'Hello'); }); this.assertText('Hello'); this.runTask(function () { - return _this21.context.set('model', { bar: 'Hola' }); + return _this22.context.set('model', { bar: 'Hola' }); }); this.assertText('Hola'); }; _class.prototype['@test it can render a basic component with a block'] = function testItCanRenderABasicComponentWithABlock() { - var _this22 = this; + var _this23 = this; this.registerComponent('foo-bar', { template: '{{yield}} - In component' }); @@ -14337,14 +14099,14 @@ babelHelpers.classCallCheck(this, _class); this.assertComponentElement(this.firstChild, { content: 'hello - In component' }); this.runTask(function () { - return _this22.rerender(); + return _this23.rerender(); }); this.assertComponentElement(this.firstChild, { content: 'hello - In component' }); }; _class.prototype['@test it can render a basic component with a block when the yield is in a partial'] = function testItCanRenderABasicComponentWithABlockWhenTheYieldIsInAPartial() { - var _this23 = this; + var _this24 = this; this.registerPartial('_partialWithYield', 'yielded: [{{yield}}]'); @@ -14355,14 +14117,14 @@ babelHelpers.classCallCheck(this, _class); this.assertComponentElement(this.firstChild, { content: 'yielded: [hello] - In component' }); this.runTask(function () { - return _this23.rerender(); + return _this24.rerender(); }); this.assertComponentElement(this.firstChild, { content: 'yielded: [hello] - In component' }); }; _class.prototype['@test it can render a basic component with a block param when the yield is in a partial'] = function testItCanRenderABasicComponentWithABlockParamWhenTheYieldIsInAPartial() { - var _this24 = this; + var _this25 = this; this.registerPartial('_partialWithYield', 'yielded: [{{yield "hello"}}]'); @@ -14373,14 +14135,14 @@ babelHelpers.classCallCheck(this, _class); this.assertComponentElement(this.firstChild, { content: 'yielded: [hello] - In component' }); this.runTask(function () { - return _this24.rerender(); + return _this25.rerender(); }); this.assertComponentElement(this.firstChild, { content: 'yielded: [hello] - In component' }); }; _class.prototype['@test it renders the layout with the component instance as the context'] = function testItRendersTheLayoutWithTheComponentInstanceAsTheContext() { - var _this25 = this; + var _this26 = this; var instance = undefined; @@ -14399,7 +14161,7 @@ babelHelpers.classCallCheck(this, _class); this.assertComponentElement(this.firstChild, { content: 'hello' }); this.runTask(function () { - return _this25.rerender(); + return _this26.rerender(); }); this.assertComponentElement(this.firstChild, { content: 'hello' }); @@ -14418,7 +14180,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test it preserves the outer context when yielding'] = function testItPreservesTheOuterContextWhenYielding() { - var _this26 = this; + var _this27 = this; this.registerComponent('foo-bar', { template: '{{yield}}' }); @@ -14427,19 +14189,19 @@ babelHelpers.classCallCheck(this, _class); this.assertComponentElement(this.firstChild, { content: 'hello' }); this.runTask(function () { - return _this26.rerender(); + return _this27.rerender(); }); this.assertComponentElement(this.firstChild, { content: 'hello' }); this.runTask(function () { - return _emberMetal.set(_this26.context, 'message', 'goodbye'); + return _emberMetal.set(_this27.context, 'message', 'goodbye'); }); this.assertComponentElement(this.firstChild, { content: 'goodbye' }); this.runTask(function () { - return _emberMetal.set(_this26.context, 'message', 'hello'); + return _emberMetal.set(_this27.context, 'message', 'hello'); }); this.assertComponentElement(this.firstChild, { content: 'hello' }); @@ -14479,7 +14241,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test it can yield internal and external properties positionally'] = function testItCanYieldInternalAndExternalPropertiesPositionally() { - var _this27 = this; + var _this28 = this; var instance = undefined; @@ -14503,13 +14265,13 @@ babelHelpers.classCallCheck(this, _class); this.assertComponentElement(this.firstChild, { content: 'Joel Kang, hello' }); this.runTask(function () { - return _this27.rerender(); + return _this28.rerender(); }); this.assertComponentElement(this.firstChild, { content: 'Joel Kang, hello' }); this.runTask(function () { - return _emberMetal.set(_this27.context, 'person', { firstName: 'Dora', lastName: 'the Explorer' }); + return _emberMetal.set(_this28.context, 'person', { firstName: 'Dora', lastName: 'the Explorer' }); }); this.assertComponentElement(this.firstChild, { content: 'Dora the Explorer, hello' }); @@ -14522,7 +14284,7 @@ babelHelpers.classCallCheck(this, _class); this.runTask(function () { _emberMetal.set(instance, 'greeting', 'hello'); - _emberMetal.set(_this27.context, 'person', { + _emberMetal.set(_this28.context, 'person', { firstName: 'Joel', lastName: 'Kang' }); @@ -14532,7 +14294,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test #11519 - block param infinite loop'] = function test11519BlockParamInfiniteLoop() { - var _this28 = this; + var _this29 = this; var instance = undefined; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -14554,7 +14316,7 @@ babelHelpers.classCallCheck(this, _class); // Trigger a non-revalidating re-render. The yielded block will not be dirtied // nor will block param streams, and thus no infinite loop will occur. this.runTask(function () { - return _this28.rerender(); + return _this29.rerender(); }); this.assertText('0'); @@ -14577,7 +14339,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test the component and its child components are destroyed'] = function testTheComponentAndItsChildComponentsAreDestroyed(assert) { - var _this29 = this; + var _this30 = this; var destroyed = { 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0 }; @@ -14602,13 +14364,13 @@ babelHelpers.classCallCheck(this, _class); this.assertText('1 2 3 4 5 6 7 8 '); this.runTask(function () { - return _this29.rerender(); + return _this30.rerender(); }); assert.deepEqual(destroyed, { 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0 }); this.runTask(function () { - return _emberMetal.set(_this29.context, 'cond5', false); + return _emberMetal.set(_this30.context, 'cond5', false); }); this.assertText('1 2 3 4 8 '); @@ -14616,23 +14378,23 @@ babelHelpers.classCallCheck(this, _class); assert.deepEqual(destroyed, { 1: 0, 2: 0, 3: 0, 4: 0, 5: 1, 6: 1, 7: 1, 8: 0 }); this.runTask(function () { - _emberMetal.set(_this29.context, 'cond3', false); - _emberMetal.set(_this29.context, 'cond5', true); - _emberMetal.set(_this29.context, 'cond4', false); + _emberMetal.set(_this30.context, 'cond3', false); + _emberMetal.set(_this30.context, 'cond5', true); + _emberMetal.set(_this30.context, 'cond4', false); }); assert.deepEqual(destroyed, { 1: 0, 2: 0, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1 }); this.runTask(function () { - _emberMetal.set(_this29.context, 'cond2', false); - _emberMetal.set(_this29.context, 'cond1', false); + _emberMetal.set(_this30.context, 'cond2', false); + _emberMetal.set(_this30.context, 'cond1', false); }); assert.deepEqual(destroyed, { 1: 1, 2: 1, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1 }); }; _class.prototype['@test should escape HTML in normal mustaches'] = function testShouldEscapeHTMLInNormalMustaches() { - var _this30 = this; + var _this31 = this; var component = undefined; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -14650,7 +14412,7 @@ babelHelpers.classCallCheck(this, _class); this.assertText('you need to be more bold'); this.runTask(function () { - return _this30.rerender(); + return _this31.rerender(); }); this.assertText('you need to be more bold'); @@ -14667,7 +14429,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test should not escape HTML in triple mustaches'] = function testShouldNotEscapeHTMLInTripleMustaches(assert) { - var _this31 = this; + var _this32 = this; var expectedHtmlBold = 'you need to be more bold'; var expectedHtmlItalic = 'you are so super'; @@ -14687,7 +14449,7 @@ babelHelpers.classCallCheck(this, _class); _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.firstChild, expectedHtmlBold); this.runTask(function () { - return _this31.rerender(); + return _this32.rerender(); }); _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.firstChild, expectedHtmlBold); @@ -14706,7 +14468,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test should not escape HTML if string is a htmlSafe'] = function testShouldNotEscapeHTMLIfStringIsAHtmlSafe(assert) { - var _this32 = this; + var _this33 = this; var expectedHtmlBold = 'you need to be more bold'; var expectedHtmlItalic = 'you are so super'; @@ -14726,7 +14488,7 @@ babelHelpers.classCallCheck(this, _class); _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.firstChild, expectedHtmlBold); this.runTask(function () { - return _this32.rerender(); + return _this33.rerender(); }); _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.firstChild, expectedHtmlBold); @@ -14746,7 +14508,6 @@ babelHelpers.classCallCheck(this, _class); _class.prototype['@test late bound layouts return the same definition'] = function testLateBoundLayoutsReturnTheSameDefinition(assert) { var templateIds = []; - var component = undefined; // This is testing the scenario where you import a template and // set it to the layout property: @@ -14763,7 +14524,6 @@ babelHelpers.classCallCheck(this, _class); init: function () { this._super.apply(this, arguments); this.layout = this.cond ? hello : bye; - component = this; templateIds.push(this.layout.id); } }); @@ -14782,7 +14542,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test can use isStream property without conflict (#13271)'] = function testCanUseIsStreamPropertyWithoutConflict13271() { - var _this33 = this; + var _this34 = this; var component = undefined; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -14805,7 +14565,7 @@ babelHelpers.classCallCheck(this, _class); this.assertComponentElement(this.firstChild, { content: 'true' }); this.runTask(function () { - return _this33.rerender(); + return _this34.rerender(); }); this.assertComponentElement(this.firstChild, { content: 'true' }); @@ -14824,7 +14584,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test lookup of component takes priority over property'] = function testLookupOfComponentTakesPriorityOverProperty() { - var _this34 = this; + var _this35 = this; this.registerComponent('some-component', { template: 'some-component' @@ -14838,14 +14598,14 @@ babelHelpers.classCallCheck(this, _class); this.assertText('some-prop some-component'); this.runTask(function () { - return _this34.rerender(); + return _this35.rerender(); }); this.assertText('some-prop some-component'); }; _class.prototype['@test component without dash is not looked up'] = function testComponentWithoutDashIsNotLookedUp() { - var _this35 = this; + var _this36 = this; this.registerComponent('somecomponent', { template: 'somecomponent' @@ -14858,26 +14618,26 @@ babelHelpers.classCallCheck(this, _class); this.assertText('notsomecomponent'); this.runTask(function () { - return _this35.rerender(); + return _this36.rerender(); }); this.assertText('notsomecomponent'); this.runTask(function () { - return _this35.context.set('somecomponent', 'not not notsomecomponent'); + return _this36.context.set('somecomponent', 'not not notsomecomponent'); }); this.assertText('not not notsomecomponent'); this.runTask(function () { - return _this35.context.set('somecomponent', 'notsomecomponent'); + return _this36.context.set('somecomponent', 'notsomecomponent'); }); this.assertText('notsomecomponent'); }; _class.prototype['@test non-block with properties on attrs'] = function testNonBlockWithPropertiesOnAttrs() { - var _this36 = this; + var _this37 = this; this.registerComponent('non-block', { template: 'In layout - someProp: {{attrs.someProp}}' @@ -14890,26 +14650,26 @@ babelHelpers.classCallCheck(this, _class); this.assertText('In layout - someProp: something here'); this.runTask(function () { - return _this36.rerender(); + return _this37.rerender(); }); this.assertText('In layout - someProp: something here'); this.runTask(function () { - return _this36.context.set('prop', 'other thing there'); + return _this37.context.set('prop', 'other thing there'); }); this.assertText('In layout - someProp: other thing there'); this.runTask(function () { - return _this36.context.set('prop', 'something here'); + return _this37.context.set('prop', 'something here'); }); this.assertText('In layout - someProp: something here'); }; _class.prototype['@test non-block with properties overridden in init'] = function testNonBlockWithPropertiesOverriddenInInit() { - var _this37 = this; + var _this38 = this; var instance = undefined; this.registerComponent('non-block', { @@ -14930,13 +14690,13 @@ babelHelpers.classCallCheck(this, _class); this.assertText('In layout - someProp: value set in instance'); this.runTask(function () { - return _this37.rerender(); + return _this38.rerender(); }); this.assertText('In layout - someProp: value set in instance'); this.runTask(function () { - return _this37.context.set('prop', 'updated something passed when invoked'); + return _this38.context.set('prop', 'updated something passed when invoked'); }); this.assertText('In layout - someProp: updated something passed when invoked'); @@ -14948,7 +14708,7 @@ babelHelpers.classCallCheck(this, _class); this.assertText('In layout - someProp: update value set in instance'); this.runTask(function () { - return _this37.context.set('prop', 'something passed when invoked'); + return _this38.context.set('prop', 'something passed when invoked'); }); this.runTask(function () { return instance.set('someProp', 'value set in instance'); @@ -14958,7 +14718,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test rerendering component with attrs from parent'] = function testRerenderingComponentWithAttrsFromParent(assert) { - var _this38 = this; + var _this39 = this; var willUpdateCount = 0; var didReceiveAttrsCount = 0; @@ -14999,7 +14759,7 @@ babelHelpers.classCallCheck(this, _class); }); expectHooks({ willUpdate: false, didReceiveAttrs: true }, function () { - _this38.render('{{non-block someProp=someProp}}', { + _this39.render('{{non-block someProp=someProp}}', { someProp: 'wycats' }); }); @@ -15008,16 +14768,16 @@ babelHelpers.classCallCheck(this, _class); // Note: Hooks are not fired in Glimmer for idempotent re-renders expectHooks({ willUpdate: false, didReceiveAttrs: false }, function () { - _this38.runTask(function () { - return _this38.rerender(); + _this39.runTask(function () { + return _this39.rerender(); }); }); this.assertText('In layout - someProp: wycats'); expectHooks({ willUpdate: true, didReceiveAttrs: true }, function () { - _this38.runTask(function () { - return _this38.context.set('someProp', 'tomdale'); + _this39.runTask(function () { + return _this39.context.set('someProp', 'tomdale'); }); }); @@ -15025,16 +14785,16 @@ babelHelpers.classCallCheck(this, _class); // Note: Hooks are not fired in Glimmer for idempotent re-renders expectHooks({ willUpdate: false, didReceiveAttrs: false }, function () { - _this38.runTask(function () { - return _this38.rerender(); + _this39.runTask(function () { + return _this39.rerender(); }); }); this.assertText('In layout - someProp: tomdale'); expectHooks({ willUpdate: true, didReceiveAttrs: true }, function () { - _this38.runTask(function () { - return _this38.context.set('someProp', 'wycats'); + _this39.runTask(function () { + return _this39.context.set('someProp', 'wycats'); }); }); @@ -15042,7 +14802,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test this.attrs.foo === attrs.foo === foo'] = function testThisAttrsFooAttrsFooFoo() { - var _this39 = this; + var _this40 = this; this.registerComponent('foo-bar', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4) @@ -15058,21 +14818,21 @@ babelHelpers.classCallCheck(this, _class); this.assertStableRerender(); this.runTask(function () { - _this39.context.set('model.value', 'lul'); - _this39.context.set('model.items', [1]); + _this40.context.set('model.value', 'lul'); + _this40.context.set('model.items', [1]); }); this.assertText(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5)); this.runTask(function () { - return _this39.context.set('model', { value: 'wat', items: [1, 2, 3] }); + return _this40.context.set('model', { value: 'wat', items: [1, 2, 3] }); }); this.assertText('Args: wat | wat | wat123123123'); }; _class.prototype['@test non-block with properties on self'] = function testNonBlockWithPropertiesOnSelf() { - var _this40 = this; + var _this41 = this; this.registerComponent('non-block', { template: 'In layout - someProp: {{someProp}}' @@ -15085,26 +14845,26 @@ babelHelpers.classCallCheck(this, _class); this.assertText('In layout - someProp: something here'); this.runTask(function () { - return _this40.rerender(); + return _this41.rerender(); }); this.assertText('In layout - someProp: something here'); this.runTask(function () { - return _this40.context.set('prop', 'something else'); + return _this41.context.set('prop', 'something else'); }); this.assertText('In layout - someProp: something else'); this.runTask(function () { - return _this40.context.set('prop', 'something here'); + return _this41.context.set('prop', 'something here'); }); this.assertText('In layout - someProp: something here'); }; _class.prototype['@test block with properties on self'] = function testBlockWithPropertiesOnSelf() { - var _this41 = this; + var _this42 = this; this.registerComponent('with-block', { template: 'In layout - someProp: {{someProp}} - {{yield}}' @@ -15117,26 +14877,26 @@ babelHelpers.classCallCheck(this, _class); this.assertText('In layout - someProp: something here - In template'); this.runTask(function () { - return _this41.rerender(); + return _this42.rerender(); }); this.assertText('In layout - someProp: something here - In template'); this.runTask(function () { - return _this41.context.set('prop', 'something else'); + return _this42.context.set('prop', 'something else'); }); this.assertText('In layout - someProp: something else - In template'); this.runTask(function () { - return _this41.context.set('prop', 'something here'); + return _this42.context.set('prop', 'something here'); }); this.assertText('In layout - someProp: something here - In template'); }; _class.prototype['@test block with properties on attrs'] = function testBlockWithPropertiesOnAttrs() { - var _this42 = this; + var _this43 = this; this.registerComponent('with-block', { template: 'In layout - someProp: {{attrs.someProp}} - {{yield}}' @@ -15149,26 +14909,26 @@ babelHelpers.classCallCheck(this, _class); this.assertText('In layout - someProp: something here - In template'); this.runTask(function () { - return _this42.rerender(); + return _this43.rerender(); }); this.assertText('In layout - someProp: something here - In template'); this.runTask(function () { - return _this42.context.set('prop', 'something else'); + return _this43.context.set('prop', 'something else'); }); this.assertText('In layout - someProp: something else - In template'); this.runTask(function () { - return _this42.context.set('prop', 'something here'); + return _this43.context.set('prop', 'something here'); }); this.assertText('In layout - someProp: something here - In template'); }; _class.prototype['@test static arbitrary number of positional parameters'] = function testStaticArbitraryNumberOfPositionalParameters(assert) { - var _this43 = this; + var _this44 = this; this.registerComponent('sample-component', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ @@ -15183,7 +14943,7 @@ babelHelpers.classCallCheck(this, _class); assert.equal(this.$('#args-5').text(), 'Foo4Bar5Baz'); this.runTask(function () { - return _this43.rerender(); + return _this44.rerender(); }); assert.equal(this.$('#args-3').text(), 'Foo4Bar'); @@ -15191,7 +14951,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test arbitrary positional parameter conflict with hash parameter is reported'] = function testArbitraryPositionalParameterConflictWithHashParameterIsReported() { - var _this44 = this; + var _this45 = this; this.registerComponent('sample-component', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ @@ -15201,14 +14961,14 @@ babelHelpers.classCallCheck(this, _class); }); expectAssertion(function () { - _this44.render('{{sample-component "Foo" 4 "Bar" names=numbers id="args-3"}}', { + _this45.render('{{sample-component "Foo" 4 "Bar" names=numbers id="args-3"}}', { numbers: [1, 2, 3] }); }, 'You cannot specify positional parameters and the hash argument `names`.'); }; _class.prototype['@test can use hash parameter instead of arbitrary positional param [GH #12444]'] = function testCanUseHashParameterInsteadOfArbitraryPositionalParamGH12444(assert) { - var _this45 = this; + var _this46 = this; this.registerComponent('sample-component', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ @@ -15224,38 +14984,38 @@ babelHelpers.classCallCheck(this, _class); this.assertText('Foo4Bar'); this.runTask(function () { - return _this45.rerender(); + return _this46.rerender(); }); this.assertText('Foo4Bar'); this.runTask(function () { - return _this45.context.get('things').pushObject(5); + return _this46.context.get('things').pushObject(5); }); this.assertText('Foo4Bar5'); this.runTask(function () { - return _this45.context.get('things').shiftObject(); + return _this46.context.get('things').shiftObject(); }); this.assertText('4Bar5'); this.runTask(function () { - return _this45.context.get('things').clear(); + return _this46.context.get('things').clear(); }); this.assertText(''); this.runTask(function () { - return _this45.context.set('things', _emberRuntime.A(['Foo', 4, 'Bar'])); + return _this46.context.set('things', _emberRuntime.A(['Foo', 4, 'Bar'])); }); this.assertText('Foo4Bar'); }; _class.prototype['@test can use hash parameter instead of positional param'] = function testCanUseHashParameterInsteadOfPositionalParam(assert) { - var _this46 = this; + var _this47 = this; this.registerComponent('sample-component', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ @@ -15272,7 +15032,7 @@ babelHelpers.classCallCheck(this, _class); assert.equal(this.$('#no-positional').text(), 'one - two'); this.runTask(function () { - return _this46.rerender(); + return _this47.rerender(); }); assert.equal(this.$('#two-positional').text(), 'one - two'); @@ -15281,7 +15041,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test dynamic arbitrary number of positional parameters'] = function testDynamicArbitraryNumberOfPositionalParameters(assert) { - var _this47 = this; + var _this48 = this; this.registerComponent('sample-component', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ @@ -15298,33 +15058,33 @@ babelHelpers.classCallCheck(this, _class); this.assertText('Foo4'); this.runTask(function () { - return _this47.rerender(); + return _this48.rerender(); }); this.assertText('Foo4'); this.runTask(function () { - return _this47.context.set('user1', 'Bar'); + return _this48.context.set('user1', 'Bar'); }); this.assertText('Bar4'); this.runTask(function () { - return _this47.context.set('user2', '5'); + return _this48.context.set('user2', '5'); }); this.assertText('Bar5'); this.runTask(function () { - _this47.context.set('user1', 'Foo'); - _this47.context.set('user2', 4); + _this48.context.set('user1', 'Foo'); + _this48.context.set('user2', 4); }); this.assertText('Foo4'); }; _class.prototype['@test with ariaRole specified'] = function testWithAriaRoleSpecified() { - var _this48 = this; + var _this49 = this; this.registerComponent('aria-test', { template: 'Here!' @@ -15337,26 +15097,26 @@ babelHelpers.classCallCheck(this, _class); this.assertComponentElement(this.firstChild, { attrs: { role: 'main' } }); this.runTask(function () { - return _this48.rerender(); + return _this49.rerender(); }); this.assertComponentElement(this.firstChild, { attrs: { role: 'main' } }); this.runTask(function () { - return _this48.context.set('role', 'input'); + return _this49.context.set('role', 'input'); }); this.assertComponentElement(this.firstChild, { attrs: { role: 'input' } }); this.runTask(function () { - return _this48.context.set('role', 'main'); + return _this49.context.set('role', 'main'); }); this.assertComponentElement(this.firstChild, { attrs: { role: 'main' } }); }; _class.prototype['@test `template` specified in component is overriden by block'] = function testTemplateSpecifiedInComponentIsOverridenByBlock() { - var _this49 = this; + var _this50 = this; this.registerComponent('with-template', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -15372,26 +15132,26 @@ babelHelpers.classCallCheck(this, _class); this.assertText('[In layout - with-block] [In block - Whoop, whoop!][In layout - without-block] '); this.runTask(function () { - return _this49.rerender(); + return _this50.rerender(); }); this.assertText('[In layout - with-block] [In block - Whoop, whoop!][In layout - without-block] '); this.runTask(function () { - return _this49.context.set('name', 'Ole, ole'); + return _this50.context.set('name', 'Ole, ole'); }); this.assertText('[In layout - with-block] [In block - Ole, ole][In layout - without-block] '); this.runTask(function () { - return _this49.context.set('name', 'Whoop, whoop!'); + return _this50.context.set('name', 'Whoop, whoop!'); }); this.assertText('[In layout - with-block] [In block - Whoop, whoop!][In layout - without-block] '); }; _class.prototype['@test hasBlock is true when block supplied'] = function testHasBlockIsTrueWhenBlockSupplied() { - var _this50 = this; + var _this51 = this; this.registerComponent('with-block', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject12) @@ -15402,14 +15162,14 @@ babelHelpers.classCallCheck(this, _class); this.assertText('In template'); this.runTask(function () { - return _this50.rerender(); + return _this51.rerender(); }); this.assertText('In template'); }; _class.prototype['@test hasBlock is false when no block supplied'] = function testHasBlockIsFalseWhenNoBlockSupplied() { - var _this51 = this; + var _this52 = this; this.registerComponent('with-block', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject12) @@ -15420,14 +15180,14 @@ babelHelpers.classCallCheck(this, _class); this.assertText('No Block!'); this.runTask(function () { - return _this51.rerender(); + return _this52.rerender(); }); this.assertText('No Block!'); }; _class.prototype['@test hasBlockParams is true when block param supplied'] = function testHasBlockParamsIsTrueWhenBlockParamSupplied() { - var _this52 = this; + var _this53 = this; this.registerComponent('with-block', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject14) @@ -15438,14 +15198,14 @@ babelHelpers.classCallCheck(this, _class); this.assertText('In template - In Component'); this.runTask(function () { - return _this52.rerender(); + return _this53.rerender(); }); this.assertText('In template - In Component'); }; _class.prototype['@test hasBlockParams is false when no block param supplied'] = function testHasBlockParamsIsFalseWhenNoBlockParamSupplied() { - var _this53 = this; + var _this54 = this; this.registerComponent('with-block', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject16) @@ -15456,14 +15216,14 @@ babelHelpers.classCallCheck(this, _class); this.assertText('In block No Block Param!'); this.runTask(function () { - return _this53.rerender(); + return _this54.rerender(); }); this.assertText('In block No Block Param!'); }; _class.prototype['@test static named positional parameters'] = function testStaticNamedPositionalParameters() { - var _this54 = this; + var _this55 = this; this.registerComponent('sample-component', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ @@ -15477,14 +15237,14 @@ babelHelpers.classCallCheck(this, _class); this.assertText('Quint4'); this.runTask(function () { - return _this54.rerender(); + return _this55.rerender(); }); this.assertText('Quint4'); }; _class.prototype['@test dynamic named positional parameters'] = function testDynamicNamedPositionalParameters() { - var _this55 = this; + var _this56 = this; this.registerComponent('sample-component', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ @@ -15501,33 +15261,33 @@ babelHelpers.classCallCheck(this, _class); this.assertText('Quint4'); this.runTask(function () { - return _this55.rerender(); + return _this56.rerender(); }); this.assertText('Quint4'); this.runTask(function () { - return _this55.context.set('myName', 'Sergio'); + return _this56.context.set('myName', 'Sergio'); }); this.assertText('Sergio4'); this.runTask(function () { - return _this55.context.set('myAge', 2); + return _this56.context.set('myAge', 2); }); this.assertText('Sergio2'); this.runTask(function () { - _this55.context.set('myName', 'Quint'); - _this55.context.set('myAge', 4); + _this56.context.set('myName', 'Quint'); + _this56.context.set('myAge', 4); }); this.assertText('Quint4'); }; _class.prototype['@test if a value is passed as a non-positional parameter, it raises an assertion'] = function testIfAValueIsPassedAsANonPositionalParameterItRaisesAnAssertion() { - var _this56 = this; + var _this57 = this; this.registerComponent('sample-component', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ @@ -15537,7 +15297,7 @@ babelHelpers.classCallCheck(this, _class); }); expectAssertion(function () { - _this56.render('{{sample-component notMyName name=myName}}', { + _this57.render('{{sample-component notMyName name=myName}}', { myName: 'Quint', notMyName: 'Sergio' }); @@ -15545,7 +15305,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test yield to inverse'] = function testYieldToInverse() { - var _this57 = this; + var _this58 = this; this.registerComponent('my-if', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject18) @@ -15558,19 +15318,19 @@ babelHelpers.classCallCheck(this, _class); this.assertText('Yes:Hello42'); this.runTask(function () { - return _this57.rerender(); + return _this58.rerender(); }); this.assertText('Yes:Hello42'); this.runTask(function () { - return _this57.context.set('activated', false); + return _this58.context.set('activated', false); }); this.assertText('No:Goodbye'); this.runTask(function () { - return _this57.context.set('activated', true); + return _this58.context.set('activated', true); }); this.assertText('Yes:Hello42'); @@ -15798,7 +15558,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test component in template of a yielding component should have the proper parentView'] = function testComponentInTemplateOfAYieldingComponentShouldHaveTheProperParentView(assert) { - var _this58 = this; + var _this59 = this; var outer = undefined, innerTemplate = undefined, @@ -15839,7 +15599,7 @@ babelHelpers.classCallCheck(this, _class); assert.equal(outer.parentView, this.context, 'x-outer receives the ambient scope as its parentView'); this.runTask(function () { - return _this58.rerender(); + return _this59.rerender(); }); assert.equal(innerTemplate.parentView, outer, 'receives the wrapping component as its parentView in template blocks'); @@ -15848,7 +15608,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test newly-added sub-components get correct parentView'] = function testNewlyAddedSubComponentsGetCorrectParentView(assert) { - var _this59 = this; + var _this60 = this; var outer = undefined, inner = undefined; @@ -15878,31 +15638,27 @@ babelHelpers.classCallCheck(this, _class); assert.equal(outer.parentView, this.context, 'x-outer receives the ambient scope as its parentView'); this.runTask(function () { - return _this59.rerender(); + return _this60.rerender(); }); assert.equal(outer.parentView, this.context, 'x-outer receives the ambient scope as its parentView (after rerender)'); this.runTask(function () { - return _this59.context.set('showInner', true); + return _this60.context.set('showInner', true); }); assert.equal(outer.parentView, this.context, 'x-outer receives the ambient scope as its parentView'); assert.equal(inner.parentView, outer, 'receives the wrapping component as its parentView in template blocks'); this.runTask(function () { - return _this59.context.set('showInner', false); + return _this60.context.set('showInner', false); }); assert.equal(outer.parentView, this.context, 'x-outer receives the ambient scope as its parentView'); }; _class.prototype['@test when a property is changed during children\'s rendering'] = function testWhenAPropertyIsChangedDuringChildrenSRendering(assert) { - var _this60 = this; - - if (true) { - expectDeprecation(/modified value twice on <\(.+> in a single render/); - } + var _this61 = this; var outer = undefined, middle = undefined; @@ -15945,24 +15701,27 @@ babelHelpers.classCallCheck(this, _class); assert.equal(this.$('#middle-value').text(), '', 'initial render of middle (observers do not run during init)'); this.runTask(function () { - return _this60.rerender(); + return _this61.rerender(); }); assert.equal(this.$('#inner-value').text(), '1', 'initial render of inner'); assert.equal(this.$('#middle-value').text(), '', 'initial render of middle (observers do not run during init)'); - if (!true) { + var expectedBacktrackingMessage = /modified "value" twice on <\(.+> in a single render\. It was rendered in "component:x-middle" and modified in "component:x-inner"/; + + if (true) { + expectDeprecation(expectedBacktrackingMessage); + this.runTask(function () { + return outer.set('value', 2); + }); + } else { expectAssertion(function () { - _this60.runTask(function () { + _this61.runTask(function () { return outer.set('value', 2); }); - }, /modified value twice on <\(.+> in a single render/); + }, expectedBacktrackingMessage); return; - } else { - this.runTask(function () { - return outer.set('value', 2); - }); } assert.equal(this.$('#inner-value').text(), '2', 'second render of inner'); @@ -15984,14 +15743,9 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test when a shared dependency is changed during children\'s rendering'] = function testWhenASharedDependencyIsChangedDuringChildrenSRendering(assert) { - var _this61 = this; - - if (true) { - expectDeprecation(/modified wrapper.content twice on in a single render/); - } + var _this62 = this; - var outer = undefined, - middle = undefined; + var outer = undefined; this.registerComponent('x-outer', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -16007,10 +15761,6 @@ babelHelpers.classCallCheck(this, _class); this.registerComponent('x-inner', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ - init: function () { - this._super.apply(this, arguments); - middle = this; - }, didReceiveAttrs: function () { this.get('wrapper').set('content', this.get('value')); }, @@ -16019,21 +15769,24 @@ babelHelpers.classCallCheck(this, _class); template: '
    {{wrapper.content}}
    ' }); - if (!true) { + var expectedBacktrackingMessage = /modified "wrapper\.content" twice on in a single render\. It was rendered in "component:x-outer" and modified in "component:x-inner"/; + + if (true) { + expectDeprecation(expectedBacktrackingMessage); + this.render('{{x-outer}}'); + } else { expectAssertion(function () { - _this61.render('{{x-outer}}'); - }, /modified wrapper.content twice on in a single render/); + _this62.render('{{x-outer}}'); + }, expectedBacktrackingMessage); return; - } else { - this.render('{{x-outer}}'); } assert.equal(this.$('#inner-value').text(), '1', 'initial render of inner'); assert.equal(this.$('#outer-value').text(), '1', 'initial render of outer'); this.runTask(function () { - return _this61.rerender(); + return _this62.rerender(); }); assert.equal(this.$('#inner-value').text(), '1', 're-render of inner'); @@ -16062,7 +15815,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test non-block with each rendering child components'] = function testNonBlockWithEachRenderingChildComponents() { - var _this62 = this; + var _this63 = this; this.registerComponent('non-block', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject38) @@ -16079,43 +15832,37 @@ babelHelpers.classCallCheck(this, _class); this.assertText('In layout. [Child: Tom.][Child: Dick.][Child: Harry.]'); this.runTask(function () { - return _this62.rerender(); + return _this63.rerender(); }); this.assertText('In layout. [Child: Tom.][Child: Dick.][Child: Harry.]'); this.runTask(function () { - return _this62.context.get('items').pushObject('Sergio'); + return _this63.context.get('items').pushObject('Sergio'); }); this.assertText('In layout. [Child: Tom.][Child: Dick.][Child: Harry.][Child: Sergio.]'); this.runTask(function () { - return _this62.context.get('items').shiftObject(); + return _this63.context.get('items').shiftObject(); }); this.assertText('In layout. [Child: Dick.][Child: Harry.][Child: Sergio.]'); this.runTask(function () { - return _this62.context.set('items', _emberRuntime.A(['Tom', 'Dick', 'Harry'])); + return _this63.context.set('items', _emberRuntime.A(['Tom', 'Dick', 'Harry'])); }); this.assertText('In layout. [Child: Tom.][Child: Dick.][Child: Harry.]'); }; _class.prototype['@test specifying classNames results in correct class'] = function testSpecifyingClassNamesResultsInCorrectClass(assert) { - var _this63 = this; - - var clickyThing = undefined; + var _this64 = this; this.registerComponent('some-clicky-thing', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ tagName: 'button', - classNames: ['foo', 'bar'], - init: function () { - this._super.apply(this, arguments); - clickyThing = this; - } + classNames: ['foo', 'bar'] }) }); @@ -16131,7 +15878,7 @@ babelHelpers.classCallCheck(this, _class); this.assertComponentElement(this.firstChild, { tagName: 'button', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes(expectedClassNames.join(' ')) } }); this.runTask(function () { - return _this63.rerender(); + return _this64.rerender(); }); assert.ok(this.$('button').is('.foo.bar.baz.ember-view'), 'the element has the correct classes: ' + this.$('button').attr('class') + ' (rerender)'); @@ -16141,17 +15888,12 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test specifying custom concatenatedProperties avoids clobbering'] = function testSpecifyingCustomConcatenatedPropertiesAvoidsClobbering(assert) { - var _this64 = this; + var _this65 = this; - var clickyThing = undefined; this.registerComponent('some-clicky-thing', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ concatenatedProperties: ['blahzz'], - blahzz: ['blark', 'pory'], - init: function () { - this._super.apply(this, arguments); - clickyThing = this; - } + blahzz: ['blark', 'pory'] }), template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject40) }); @@ -16161,14 +15903,14 @@ babelHelpers.classCallCheck(this, _class); this.assertText('blarkporybaz- Click Me'); this.runTask(function () { - return _this64.rerender(); + return _this65.rerender(); }); this.assertText('blarkporybaz- Click Me'); }; _class.prototype['@test a two way binding flows upstream when consumed in the template'] = function testATwoWayBindingFlowsUpstreamWhenConsumedInTheTemplate() { - var _this65 = this; + var _this66 = this; var component = undefined; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -16191,7 +15933,7 @@ babelHelpers.classCallCheck(this, _class); this.assertText('initial value - initial value'); this.runTask(function () { - return _this65.rerender(); + return _this66.rerender(); }); this.assertText('initial value - initial value'); @@ -16217,14 +15959,14 @@ babelHelpers.classCallCheck(this, _class); this.assertText(' - '); this.runTask(function () { - _this65.component.set('localBar', 'initial value'); + _this66.component.set('localBar', 'initial value'); }); this.assertText('initial value - initial value'); }; _class.prototype['@test a two way binding flows upstream through a CP when consumed in the template'] = function testATwoWayBindingFlowsUpstreamThroughACPWhenConsumedInTheTemplate() { - var _this66 = this; + var _this67 = this; var component = undefined; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -16258,7 +16000,7 @@ babelHelpers.classCallCheck(this, _class); this.assertText('initial value - initial value'); this.runTask(function () { - return _this66.rerender(); + return _this67.rerender(); }); this.assertText('initial value - initial value'); @@ -16270,14 +16012,14 @@ babelHelpers.classCallCheck(this, _class); this.assertText('updated value - updated value'); this.runTask(function () { - _this66.component.set('localBar', 'initial value'); + _this67.component.set('localBar', 'initial value'); }); this.assertText('initial value - initial value'); }; _class.prototype['@test a two way binding flows upstream through a CP without template consumption'] = function testATwoWayBindingFlowsUpstreamThroughACPWithoutTemplateConsumption() { - var _this67 = this; + var _this68 = this; var component = undefined; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -16310,7 +16052,7 @@ babelHelpers.classCallCheck(this, _class); this.assertText('initial value'); this.runTask(function () { - return _this67.rerender(); + return _this68.rerender(); }); this.assertText('initial value'); @@ -16322,14 +16064,14 @@ babelHelpers.classCallCheck(this, _class); this.assertText('updated value'); this.runTask(function () { - _this67.component.set('localBar', 'initial value'); + _this68.component.set('localBar', 'initial value'); }); this.assertText('initial value'); }; _class.prototype['@test services can be injected into components'] = function testServicesCanBeInjectedIntoComponents() { - var _this68 = this; + var _this69 = this; var service = undefined; this.registerService('name', _emberRuntime.Service.extend({ @@ -16352,7 +16094,7 @@ babelHelpers.classCallCheck(this, _class); this.assertText('Jackson'); this.runTask(function () { - return _this68.rerender(); + return _this69.rerender(); }); this.assertText('Jackson'); @@ -16370,8 +16112,22 @@ babelHelpers.classCallCheck(this, _class); this.assertText('Jackson'); }; + _class.prototype['@test injecting an unknown service raises an exception'] = function testInjectingAnUnknownServiceRaisesAnException(assert) { + var _this70 = this; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + missingService: _emberRuntime.inject.service() + }) + }); + + expectAssertion(function () { + _this70.render('{{foo-bar}}'); + }, 'Attempting to inject an unknown injection: \'service:missingService\''); + }; + _class.prototype['@test can access `actions` hash via `_actions` [DEPRECATED]'] = function testCanAccessActionsHashVia_actionsDEPRECATED() { - var _this69 = this; + var _this71 = this; var component = undefined; @@ -16395,12 +16151,12 @@ babelHelpers.classCallCheck(this, _class); this.assert.strictEqual(component.actions.derp, derp); expectDeprecation(function () { - _this69.assert.strictEqual(component._actions.derp, derp); + _this71.assert.strictEqual(component._actions.derp, derp); }, 'Usage of `_actions` is deprecated, use `actions` instead.'); }; _class.prototype['@test throws if `this._super` is not called from `init`'] = function testThrowsIfThis_superIsNotCalledFromInit() { - var _this70 = this; + var _this72 = this; this.registerComponent('foo-bar', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -16409,16 +16165,16 @@ babelHelpers.classCallCheck(this, _class); }); expectAssertion(function () { - _this70.render('{{foo-bar}}'); + _this72.render('{{foo-bar}}'); }, /You must call `this._super\(...arguments\);` when overriding `init` on a framework object. Please update .* to call `this._super\(...arguments\);` from `init`./); }; _class.prototype['@test should toggle visibility with isVisible'] = function testShouldToggleVisibilityWithIsVisible(assert) { - var _this71 = this; + var _this73 = this; var assertStyle = function (expected) { var matcher = _emberGlimmerTestsUtilsTestHelpers.styles(expected); - var actual = _this71.firstChild.getAttribute('style'); + var actual = _this73.firstChild.getAttribute('style'); assert.pushResult({ result: matcher.match(actual), @@ -16441,18 +16197,18 @@ babelHelpers.classCallCheck(this, _class); this.assertStableRerender(); this.runTask(function () { - _emberMetal.set(_this71.context, 'visible', true); + _emberMetal.set(_this73.context, 'visible', true); }); assertStyle(''); this.runTask(function () { - _emberMetal.set(_this71.context, 'visible', false); + _emberMetal.set(_this73.context, 'visible', false); }); assertStyle('display: none;'); }; _class.prototype['@test isVisible does not overwrite component style'] = function testIsVisibleDoesNotOverwriteComponentStyle(assert) { - var _this72 = this; + var _this74 = this; this.registerComponent('foo-bar', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -16475,7 +16231,7 @@ babelHelpers.classCallCheck(this, _class); this.assertStableRerender(); this.runTask(function () { - _emberMetal.set(_this72.context, 'visible', true); + _emberMetal.set(_this74.context, 'visible', true); }); this.assertComponentElement(this.firstChild, { @@ -16484,7 +16240,7 @@ babelHelpers.classCallCheck(this, _class); }); this.runTask(function () { - _emberMetal.set(_this72.context, 'visible', false); + _emberMetal.set(_this74.context, 'visible', false); }); this.assertComponentElement(this.firstChild, { @@ -16494,11 +16250,11 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test adds isVisible binding when style binding is missing and other bindings exist'] = function testAddsIsVisibleBindingWhenStyleBindingIsMissingAndOtherBindingsExist(assert) { - var _this73 = this; + var _this75 = this; var assertStyle = function (expected) { var matcher = _emberGlimmerTestsUtilsTestHelpers.styles(expected); - var actual = _this73.firstChild.getAttribute('style'); + var actual = _this75.firstChild.getAttribute('style'); assert.pushResult({ result: matcher.match(actual), @@ -16526,14 +16282,14 @@ babelHelpers.classCallCheck(this, _class); this.assertStableRerender(); this.runTask(function () { - _emberMetal.set(_this73.context, 'visible', true); + _emberMetal.set(_this75.context, 'visible', true); }); assertStyle(''); this.runTask(function () { - _emberMetal.set(_this73.context, 'visible', false); - _emberMetal.set(_this73.context, 'foo', 'woo'); + _emberMetal.set(_this75.context, 'visible', false); + _emberMetal.set(_this75.context, 'foo', 'woo'); }); assertStyle('display: none;'); @@ -16541,14 +16297,14 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test it can use readDOMAttr to read input value'] = function testItCanUseReadDOMAttrToReadInputValue() { - var _this74 = this; + var _this76 = this; var component = undefined; var assertElement = function (expectedValue) { // value is a property, not an attribute - _this74.assertHTML(''); - _this74.assert.equal(_this74.firstChild.value, expectedValue, 'value property is correct'); - _this74.assert.equal(_emberMetal.get(component, 'value'), expectedValue, 'component.get("value") is correct'); + _this76.assertHTML(''); + _this76.assert.equal(_this76.firstChild.value, expectedValue, 'value property is correct'); + _this76.assert.equal(_emberMetal.get(component, 'value'), expectedValue, 'component.get("value") is correct'); }; this.registerComponent('one-way-input', { @@ -16577,15 +16333,15 @@ babelHelpers.classCallCheck(this, _class); this.assertStableRerender(); this.runTask(function () { - _this74.firstChild.value = 'bar'; - _this74.$('input').trigger('change'); + _this76.firstChild.value = 'bar'; + _this76.$('input').trigger('change'); }); assertElement('bar'); this.runTask(function () { - _this74.firstChild.value = 'foo'; - _this74.$('input').trigger('change'); + _this76.firstChild.value = 'foo'; + _this76.$('input').trigger('change'); }); assertElement('foo'); @@ -16597,16 +16353,14 @@ babelHelpers.classCallCheck(this, _class); assertElement('bar'); this.runTask(function () { - _this74.firstChild.value = 'foo'; - _this74.$('input').trigger('change'); + _this76.firstChild.value = 'foo'; + _this76.$('input').trigger('change'); }); assertElement('foo'); }; _class.prototype['@test child triggers revalidate during parent destruction (GH#13846)'] = function testChildTriggersRevalidateDuringParentDestructionGH13846() { - var select = undefined; - this.registerComponent('x-select', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ tagName: 'select', @@ -16615,8 +16369,6 @@ babelHelpers.classCallCheck(this, _class); this._super(); this.options = _emberRuntime.A([]); this.value = null; - - select = this; }, updateValue: function () { @@ -16694,7 +16446,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test using didInitAttrs as an event is deprecated'] = function testUsingDidInitAttrsAsAnEventIsDeprecated(assert) { - var _this75 = this; + var _this77 = this; this.registerComponent('foo-bar', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -16705,7 +16457,7 @@ babelHelpers.classCallCheck(this, _class); }); expectDeprecation(function () { - _this75.render('{{foo-bar}}'); + _this77.render('{{foo-bar}}'); }, /didInitAttrs called/); }; @@ -16716,7 +16468,7 @@ babelHelpers.classCallCheck(this, _class); // like there is no real "attrs" here, and there is no "update" pass. _class.prototype['@test did{Init,Receive}Attrs fires even if component is not rendered'] = function testDidInitReceiveAttrsFiresEvenIfComponentIsNotRendered(assert) { - var _this76 = this; + var _this78 = this; expectDeprecation(/didInitAttrs called/); @@ -16750,7 +16502,7 @@ babelHelpers.classCallCheck(this, _class); assert.strictEqual(didReceiveAttrsCount, 0, 'precond: didReceiveAttrs is not fired'); this.runTask(function () { - return _this76.component = _this76.owner.lookup('component:foo-bar'); + return _this78.component = _this78.owner.lookup('component:foo-bar'); }); assert.strictEqual(didInitAttrsCount, 1, 'precond: didInitAttrs is fired'); @@ -16758,7 +16510,7 @@ babelHelpers.classCallCheck(this, _class); }; _class.prototype['@test did{Init,Receive}Attrs fires after .init() but before observers become active'] = function testDidInitReceiveAttrsFiresAfterInitButBeforeObserversBecomeActive(assert) { - var _this77 = this; + var _this79 = this; expectDeprecation(/didInitAttrs called/); @@ -16805,7 +16557,7 @@ babelHelpers.classCallCheck(this, _class); assert.strictEqual(barCopyDidChangeCount, 0, 'expected NO observer firing for: barCopy'); this.runTask(function () { - return _emberMetal.set(_this77.context, 'foo', 5); + return _emberMetal.set(_this79.context, 'foo', 5); }); this.assertText('5-2-3-4'); @@ -16814,7 +16566,7 @@ babelHelpers.classCallCheck(this, _class); assert.strictEqual(barCopyDidChangeCount, 0, 'expected NO observer firing for: barCopy'); this.runTask(function () { - return _emberMetal.set(_this77.context, 'bar', 7); + return _emberMetal.set(_this79.context, 'bar', 7); }); this.assertText('5-2-7-8'); @@ -16823,8 +16575,84 @@ babelHelpers.classCallCheck(this, _class); assert.strictEqual(barCopyDidChangeCount, 1, 'expected observer firing for: barCopy'); }; + _class.prototype['@test overriding didReceiveAttrs does not trigger deprecation'] = function testOverridingDidReceiveAttrsDoesNotTriggerDeprecation(assert) { + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didReceiveAttrs: function () { + assert.equal(1, this.get('foo'), 'expected attrs to have correct value'); + } + }), + + template: '{{foo}}-{{fooCopy}}-{{bar}}-{{barCopy}}' + }); + + this.render('{{foo-bar foo=foo bar=bar}}', { foo: 1, bar: 3 }); + }; + + _class.prototype['@test can access didReceiveAttrs arguments [DEPRECATED]'] = function testCanAccessDidReceiveAttrsArgumentsDEPRECATED(assert) { + expectDeprecation(/didReceiveAttrs.*stop taking arguments/); + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didReceiveAttrs: function (_ref4) { + var attrs = _ref4.attrs; + + assert.equal(1, attrs.foo.value, 'expected attrs to have correct value'); + } + }), + + template: '{{foo}}-{{fooCopy}}-{{bar}}-{{barCopy}}' + }); + + this.render('{{foo-bar foo=foo bar=bar}}', { foo: 1, bar: 3 }); + }; + + _class.prototype['@test can access didUpdateAttrs arguments [DEPRECATED]'] = function testCanAccessDidUpdateAttrsArgumentsDEPRECATED(assert) { + var _this80 = this; + + expectDeprecation(/didUpdateAttrs.*stop taking arguments/); + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didUpdateAttrs: function (_ref5) { + var newAttrs = _ref5.newAttrs; + + assert.equal(5, newAttrs.foo.value, "expected newAttrs to have new value"); + } + }), + + template: '{{foo}}-{{fooCopy}}-{{bar}}-{{barCopy}}' + }); + + this.render('{{foo-bar foo=foo bar=bar}}', { foo: 1, bar: 3 }); + + this.runTask(function () { + return _emberMetal.set(_this80.context, 'foo', 5); + }); + }; + + _class.prototype['@test overriding didUpdateAttrs does not trigger deprecation'] = function testOverridingDidUpdateAttrsDoesNotTriggerDeprecation(assert) { + var _this81 = this; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didUpdateAttrs: function () { + assert.equal(5, this.get('foo'), "expected newAttrs to have new value"); + } + }), + + template: '{{foo}}-{{fooCopy}}-{{bar}}-{{barCopy}}' + }); + + this.render('{{foo-bar foo=foo bar=bar}}', { foo: 1, bar: 3 }); + + this.runTask(function () { + return _emberMetal.set(_this81.context, 'foo', 5); + }); + }; + _class.prototype['@test returning `true` from an action does not bubble if `target` is not specified (GH#14275)'] = function testReturningTrueFromAnActionDoesNotBubbleIfTargetIsNotSpecifiedGH14275(assert) { - var _this78 = this; + var _this82 = this; this.registerComponent('display-toggle', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -16848,12 +16676,12 @@ babelHelpers.classCallCheck(this, _class); this.assertText('Show'); this.runTask(function () { - return _this78.$('button').click(); + return _this82.$('button').click(); }); }; _class.prototype['@test returning `true` from an action bubbles to the `target` if specified'] = function testReturningTrueFromAnActionBubblesToTheTargetIfSpecified(assert) { - var _this79 = this; + var _this83 = this; assert.expect(4); @@ -16880,12 +16708,12 @@ babelHelpers.classCallCheck(this, _class); this.assertText('Show'); this.runTask(function () { - return _this79.$('button').click(); + return _this83.$('button').click(); }); }; _class.prototype['@test component yielding in an {{#each}} has correct block values after rerendering (GH#14284)'] = function testComponentYieldingInAnEachHasCorrectBlockValuesAfterRerenderingGH14284() { - var _this80 = this; + var _this84 = this; this.registerComponent('list-items', { template: '{{#each items as |item|}}{{yield item}}{{/each}}' @@ -16901,13 +16729,13 @@ babelHelpers.classCallCheck(this, _class); this.assertStableRerender(); this.runTask(function () { - return _emberMetal.set(_this80.context, 'editMode', true); + return _emberMetal.set(_this84.context, 'editMode', true); }); this.assertText('|foo|Remove foo|bar|Remove bar|qux|Remove qux|baz|Remove baz'); this.runTask(function () { - return _emberMetal.set(_this80.context, 'editMode', false); + return _emberMetal.set(_this84.context, 'editMode', false); }); this.assertText('|foo||bar||qux||baz|'); @@ -16993,21 +16821,13 @@ babelHelpers.classCallCheck(this, _class); return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/components/curly-components-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/curly-components-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/curly-components-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/curly-components-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/curly-components-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/curly-components-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/curly-components-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/curly-components-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/curly-components-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/dynamic-components-test', ['exports', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case'], function (exports, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase) { @@ -17827,24 +17647,51 @@ babelHelpers.classCallCheck(this, _class); this.assertText('Foo4'); }; + _class.prototype['@test component helper emits useful backtracking re-render assertion message'] = function testComponentHelperEmitsUsefulBacktrackingReRenderAssertionMessage(assert) { + var _this25 = this; + + this.registerComponent('outer-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + this.set('person', { name: 'Alex' }); + } + }), + template: 'Hi {{person.name}}! {{component "error-component" person=person}}' + }); + + this.registerComponent('error-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + this.set('person.name', { name: 'Ben' }); + } + }), + template: '{{person.name}}' + }); + + var expectedBacktrackingMessage = /modified "person\.name" twice on \[object Object\] in a single render\. It was rendered in "component:outer-component" and modified in "component:error-component"/; + + if (true) { + expectDeprecation(expectedBacktrackingMessage); + this.render('{{component componentName}}', { componentName: 'outer-component' }); + } else { + expectAssertion(function () { + _this25.render('{{component componentName}}', { componentName: 'outer-component' }); + }, expectedBacktrackingMessage); + } + }; + return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/components/dynamic-components-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/dynamic-components-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/dynamic-components-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/dynamic-components-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/dynamic-components-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/dynamic-components-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/dynamic-components-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/dynamic-components-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/dynamic-components-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/fragment-components-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { @@ -17912,14 +17759,9 @@ babelHelpers.classCallCheck(this, _class); _class.prototype['@test throws an error if an event function is defined in a tagless component'] = function testThrowsAnErrorIfAnEventFunctionIsDefinedInATaglessComponent() { var _this = this; - var instance = undefined; var template = 'hit dem folks'; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ tagName: '', - init: function () { - this._super(); - instance = this; - }, click: function () {} }); @@ -17933,14 +17775,9 @@ babelHelpers.classCallCheck(this, _class); _class.prototype['@test throws an error if a custom defined event function is defined in a tagless component'] = function testThrowsAnErrorIfACustomDefinedEventFunctionIsDefinedInATaglessComponent() { var _this2 = this; - var instance = undefined; var template = 'hit dem folks'; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ tagName: '', - init: function () { - this._super(); - instance = this; - }, folks: function () {} }); @@ -17954,14 +17791,9 @@ babelHelpers.classCallCheck(this, _class); _class.prototype['@test throws an error if `tagName` is an empty string and `classNameBindings` are specified'] = function testThrowsAnErrorIfTagNameIsAnEmptyStringAndClassNameBindingsAreSpecified() { var _this3 = this; - var instance = undefined; var template = 'hit dem folks'; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ tagName: '', - init: function () { - this._super(); - instance = this; - }, foo: true, classNameBindings: ['foo:is-foo:is-bar'] }); @@ -18142,21 +17974,13 @@ babelHelpers.classCallCheck(this, _class); return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/components/fragment-components-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/fragment-components-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/fragment-components-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/fragment-components-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/fragment-components-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/fragment-components-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/fragment-components-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/fragment-components-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/fragment-components-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/instrumentation-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { @@ -18308,6 +18132,7 @@ enifed('ember-glimmer/tests/integration/components/instrumentation-test', ['expo _class.prototype.assertPayload = function assertPayload(payload, component, initialRender) { this.assert.equal(payload.object, component.toString(), 'payload.object'); + this.assert.ok(payload.containerKey, 'the container key should be present'); this.assert.equal(payload.containerKey, component._debugContainerKey, 'payload.containerKey'); this.assert.equal(payload.view, component, 'payload.view'); this.assert.strictEqual(payload.initialRender, initialRender, 'payload.initialRender'); @@ -18316,21 +18141,13 @@ enifed('ember-glimmer/tests/integration/components/instrumentation-test', ['expo return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/components/instrumentation-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/instrumentation-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/instrumentation-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/instrumentation-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/instrumentation-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/instrumentation-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/instrumentation-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/instrumentation-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/instrumentation-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/life-cycle-test', ['exports', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-views', 'ember-glimmer/tests/utils/test-helpers', 'ember-utils', 'internal-test-helpers'], function (exports, _emberMetal, _emberRuntime, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberViews, _emberGlimmerTestsUtilsTestHelpers, _emberUtils, _internalTestHelpers) { @@ -18660,7 +18477,7 @@ babelHelpers.classCallCheck(this, LifeCycleHooksTest); interactive: [ // Sync hooks - ['the-top', 'init'], ['the-top', 'didInitAttrs', { attrs: topAttrs }], ['the-top', 'didReceiveAttrs', { newAttrs: topAttrs }], ['the-top', 'on(init)'], ['the-top', 'willRender'], ['the-top', 'willInsertElement'], ['the-middle', 'init'], ['the-middle', 'didInitAttrs', { attrs: middleAttrs }], ['the-middle', 'didReceiveAttrs', { newAttrs: middleAttrs }], ['the-middle', 'on(init)'], ['the-middle', 'willRender'], ['the-middle', 'willInsertElement'], ['the-bottom', 'init'], ['the-bottom', 'didInitAttrs', { attrs: bottomAttrs }], ['the-bottom', 'didReceiveAttrs', { newAttrs: bottomAttrs }], ['the-bottom', 'on(init)'], ['the-bottom', 'willRender'], ['the-bottom', 'willInsertElement'], + ['the-top', 'init'], ['the-top', 'didInitAttrs', { attrs: topAttrs, newAttrs: topAttrs }], ['the-top', 'didReceiveAttrs', { attrs: topAttrs, newAttrs: topAttrs }], ['the-top', 'on(init)'], ['the-top', 'willRender'], ['the-top', 'willInsertElement'], ['the-middle', 'init'], ['the-middle', 'didInitAttrs', { attrs: middleAttrs, newAttrs: middleAttrs }], ['the-middle', 'didReceiveAttrs', { attrs: middleAttrs, newAttrs: middleAttrs }], ['the-middle', 'on(init)'], ['the-middle', 'willRender'], ['the-middle', 'willInsertElement'], ['the-bottom', 'init'], ['the-bottom', 'didInitAttrs', { attrs: bottomAttrs, newAttrs: bottomAttrs }], ['the-bottom', 'didReceiveAttrs', { attrs: bottomAttrs, newAttrs: bottomAttrs }], ['the-bottom', 'on(init)'], ['the-bottom', 'willRender'], ['the-bottom', 'willInsertElement'], // Async hooks @@ -18668,7 +18485,7 @@ babelHelpers.classCallCheck(this, LifeCycleHooksTest); nonInteractive: [ // Sync hooks - ['the-top', 'init'], ['the-top', 'didInitAttrs', { attrs: topAttrs }], ['the-top', 'didReceiveAttrs', { newAttrs: topAttrs }], ['the-top', 'on(init)'], ['the-middle', 'init'], ['the-middle', 'didInitAttrs', { attrs: middleAttrs }], ['the-middle', 'didReceiveAttrs', { newAttrs: middleAttrs }], ['the-middle', 'on(init)'], ['the-bottom', 'init'], ['the-bottom', 'didInitAttrs', { attrs: bottomAttrs }], ['the-bottom', 'didReceiveAttrs', { newAttrs: bottomAttrs }], ['the-bottom', 'on(init)']] + ['the-top', 'init'], ['the-top', 'didInitAttrs', { attrs: topAttrs, newAttrs: topAttrs }], ['the-top', 'didReceiveAttrs', { attrs: topAttrs, newAttrs: topAttrs }], ['the-top', 'on(init)'], ['the-middle', 'init'], ['the-middle', 'didInitAttrs', { attrs: middleAttrs, newAttrs: middleAttrs }], ['the-middle', 'didReceiveAttrs', { attrs: middleAttrs, newAttrs: middleAttrs }], ['the-middle', 'on(init)'], ['the-bottom', 'init'], ['the-bottom', 'didInitAttrs', { attrs: bottomAttrs, newAttrs: bottomAttrs }], ['the-bottom', 'didReceiveAttrs', { attrs: bottomAttrs, newAttrs: bottomAttrs }], ['the-bottom', 'on(init)']] }); this.runTask(function () { @@ -18745,7 +18562,7 @@ babelHelpers.classCallCheck(this, LifeCycleHooksTest); // the new attribute to rerender itself imperatively, that would result // in lifecycle hooks being invoked for the child. - topAttrs = { oldAttrs: { twitter: '@tomdale' }, newAttrs: { twitter: '@horsetomdale' } }; + topAttrs = { attrs: { twitter: '@horsetomdale' }, oldAttrs: { twitter: '@tomdale' }, newAttrs: { twitter: '@horsetomdale' } }; this.assertHooks({ label: 'after update', @@ -18817,7 +18634,7 @@ babelHelpers.classCallCheck(this, LifeCycleHooksTest); interactive: [ // Sync hooks - ['the-parent', 'init'], ['the-parent', 'didInitAttrs', { attrs: parentAttrs }], ['the-parent', 'didReceiveAttrs', { newAttrs: parentAttrs }], ['the-parent', 'on(init)'], ['the-parent', 'willRender'], ['the-parent', 'willInsertElement'], ['the-first-child', 'init'], ['the-first-child', 'didInitAttrs', { attrs: firstAttrs }], ['the-first-child', 'didReceiveAttrs', { newAttrs: firstAttrs }], ['the-first-child', 'on(init)'], ['the-first-child', 'willRender'], ['the-first-child', 'willInsertElement'], ['the-second-child', 'init'], ['the-second-child', 'didInitAttrs', { attrs: secondAttrs }], ['the-second-child', 'didReceiveAttrs', { newAttrs: secondAttrs }], ['the-second-child', 'on(init)'], ['the-second-child', 'willRender'], ['the-second-child', 'willInsertElement'], ['the-last-child', 'init'], ['the-last-child', 'didInitAttrs', { attrs: lastAttrs }], ['the-last-child', 'didReceiveAttrs', { newAttrs: lastAttrs }], ['the-last-child', 'on(init)'], ['the-last-child', 'willRender'], ['the-last-child', 'willInsertElement'], + ['the-parent', 'init'], ['the-parent', 'didInitAttrs', { attrs: parentAttrs, newAttrs: parentAttrs }], ['the-parent', 'didReceiveAttrs', { attrs: parentAttrs, newAttrs: parentAttrs }], ['the-parent', 'on(init)'], ['the-parent', 'willRender'], ['the-parent', 'willInsertElement'], ['the-first-child', 'init'], ['the-first-child', 'didInitAttrs', { attrs: firstAttrs, newAttrs: firstAttrs }], ['the-first-child', 'didReceiveAttrs', { attrs: firstAttrs, newAttrs: firstAttrs }], ['the-first-child', 'on(init)'], ['the-first-child', 'willRender'], ['the-first-child', 'willInsertElement'], ['the-second-child', 'init'], ['the-second-child', 'didInitAttrs', { attrs: secondAttrs, newAttrs: secondAttrs }], ['the-second-child', 'didReceiveAttrs', { attrs: secondAttrs, newAttrs: secondAttrs }], ['the-second-child', 'on(init)'], ['the-second-child', 'willRender'], ['the-second-child', 'willInsertElement'], ['the-last-child', 'init'], ['the-last-child', 'didInitAttrs', { attrs: lastAttrs, newAttrs: lastAttrs }], ['the-last-child', 'didReceiveAttrs', { attrs: lastAttrs, newAttrs: lastAttrs }], ['the-last-child', 'on(init)'], ['the-last-child', 'willRender'], ['the-last-child', 'willInsertElement'], // Async hooks @@ -18826,7 +18643,7 @@ babelHelpers.classCallCheck(this, LifeCycleHooksTest); nonInteractive: [ // Sync hooks - ['the-parent', 'init'], ['the-parent', 'didInitAttrs', { attrs: parentAttrs }], ['the-parent', 'didReceiveAttrs', { newAttrs: parentAttrs }], ['the-parent', 'on(init)'], ['the-first-child', 'init'], ['the-first-child', 'didInitAttrs', { attrs: firstAttrs }], ['the-first-child', 'didReceiveAttrs', { newAttrs: firstAttrs }], ['the-first-child', 'on(init)'], ['the-second-child', 'init'], ['the-second-child', 'didInitAttrs', { attrs: secondAttrs }], ['the-second-child', 'didReceiveAttrs', { newAttrs: secondAttrs }], ['the-second-child', 'on(init)'], ['the-last-child', 'init'], ['the-last-child', 'didInitAttrs', { attrs: lastAttrs }], ['the-last-child', 'didReceiveAttrs', { newAttrs: lastAttrs }], ['the-last-child', 'on(init)']] + ['the-parent', 'init'], ['the-parent', 'didInitAttrs', { attrs: parentAttrs, newAttrs: parentAttrs }], ['the-parent', 'didReceiveAttrs', { attrs: parentAttrs, newAttrs: parentAttrs }], ['the-parent', 'on(init)'], ['the-first-child', 'init'], ['the-first-child', 'didInitAttrs', { attrs: firstAttrs, newAttrs: firstAttrs }], ['the-first-child', 'didReceiveAttrs', { attrs: firstAttrs, newAttrs: firstAttrs }], ['the-first-child', 'on(init)'], ['the-second-child', 'init'], ['the-second-child', 'didInitAttrs', { attrs: secondAttrs, newAttrs: secondAttrs }], ['the-second-child', 'didReceiveAttrs', { attrs: secondAttrs, newAttrs: secondAttrs }], ['the-second-child', 'on(init)'], ['the-last-child', 'init'], ['the-last-child', 'didInitAttrs', { attrs: lastAttrs, newAttrs: lastAttrs }], ['the-last-child', 'didReceiveAttrs', { attrs: lastAttrs, newAttrs: lastAttrs }], ['the-last-child', 'on(init)']] }); this.runTask(function () { @@ -18924,12 +18741,13 @@ babelHelpers.classCallCheck(this, LifeCycleHooksTest); this.assertText('Twitter: @horsetomdale|Name: Horse Tom Dale|Website: horsetomdale.net'); parentAttrs = { + attrs: { twitter: '@horsetomdale', name: 'Horse Tom Dale', website: 'horsetomdale.net' }, oldAttrs: { twitter: '@tomdale', name: 'Tom Dale', website: 'tomdale.net' }, newAttrs: { twitter: '@horsetomdale', name: 'Horse Tom Dale', website: 'horsetomdale.net' } }; - firstAttrs = { oldAttrs: { twitter: '@tomdale' }, newAttrs: { twitter: '@horsetomdale' } }; - secondAttrs = { oldAttrs: { name: 'Tom Dale' }, newAttrs: { name: 'Horse Tom Dale' } }; - lastAttrs = { oldAttrs: { website: 'tomdale.net' }, newAttrs: { website: 'horsetomdale.net' } }; + firstAttrs = { attrs: { twitter: '@horsetomdale' }, oldAttrs: { twitter: '@tomdale' }, newAttrs: { twitter: '@horsetomdale' } }; + secondAttrs = { attrs: { name: 'Horse Tom Dale' }, oldAttrs: { name: 'Tom Dale' }, newAttrs: { name: 'Horse Tom Dale' } }; + lastAttrs = { attrs: { website: 'horsetomdale.net' }, oldAttrs: { website: 'tomdale.net' }, newAttrs: { website: 'horsetomdale.net' } }; this.assertHooks({ label: 'after update', @@ -18993,7 +18811,7 @@ babelHelpers.classCallCheck(this, LifeCycleHooksTest); interactive: [ // Sync hooks - ['the-top', 'init'], ['the-top', 'didInitAttrs', { attrs: topAttrs }], ['the-top', 'didReceiveAttrs', { newAttrs: topAttrs }], ['the-top', 'on(init)'], ['the-top', 'willRender'], ['the-top', 'willInsertElement'], ['the-middle', 'init'], ['the-middle', 'didInitAttrs', { attrs: middleAttrs }], ['the-middle', 'didReceiveAttrs', { newAttrs: middleAttrs }], ['the-middle', 'on(init)'], ['the-middle', 'willRender'], ['the-middle', 'willInsertElement'], ['the-bottom', 'init'], ['the-bottom', 'didInitAttrs', { attrs: bottomAttrs }], ['the-bottom', 'didReceiveAttrs', { newAttrs: bottomAttrs }], ['the-bottom', 'on(init)'], ['the-bottom', 'willRender'], ['the-bottom', 'willInsertElement'], + ['the-top', 'init'], ['the-top', 'didInitAttrs', { attrs: topAttrs, newAttrs: topAttrs }], ['the-top', 'didReceiveAttrs', { attrs: topAttrs, newAttrs: topAttrs }], ['the-top', 'on(init)'], ['the-top', 'willRender'], ['the-top', 'willInsertElement'], ['the-middle', 'init'], ['the-middle', 'didInitAttrs', { attrs: middleAttrs, newAttrs: middleAttrs }], ['the-middle', 'didReceiveAttrs', { attrs: middleAttrs, newAttrs: middleAttrs }], ['the-middle', 'on(init)'], ['the-middle', 'willRender'], ['the-middle', 'willInsertElement'], ['the-bottom', 'init'], ['the-bottom', 'didInitAttrs', { attrs: bottomAttrs, newAttrs: bottomAttrs }], ['the-bottom', 'didReceiveAttrs', { attrs: bottomAttrs, newAttrs: bottomAttrs }], ['the-bottom', 'on(init)'], ['the-bottom', 'willRender'], ['the-bottom', 'willInsertElement'], // Async hooks @@ -19002,7 +18820,7 @@ babelHelpers.classCallCheck(this, LifeCycleHooksTest); nonInteractive: [ // Sync hooks - ['the-top', 'init'], ['the-top', 'didInitAttrs', { attrs: topAttrs }], ['the-top', 'didReceiveAttrs', { newAttrs: topAttrs }], ['the-top', 'on(init)'], ['the-middle', 'init'], ['the-middle', 'didInitAttrs', { attrs: middleAttrs }], ['the-middle', 'didReceiveAttrs', { newAttrs: middleAttrs }], ['the-middle', 'on(init)'], ['the-bottom', 'init'], ['the-bottom', 'didInitAttrs', { attrs: bottomAttrs }], ['the-bottom', 'didReceiveAttrs', { newAttrs: bottomAttrs }], ['the-bottom', 'on(init)']] + ['the-top', 'init'], ['the-top', 'didInitAttrs', { attrs: topAttrs, newAttrs: topAttrs }], ['the-top', 'didReceiveAttrs', { attrs: topAttrs, newAttrs: topAttrs }], ['the-top', 'on(init)'], ['the-middle', 'init'], ['the-middle', 'didInitAttrs', { attrs: middleAttrs, newAttrs: middleAttrs }], ['the-middle', 'didReceiveAttrs', { attrs: middleAttrs, newAttrs: middleAttrs }], ['the-middle', 'on(init)'], ['the-bottom', 'init'], ['the-bottom', 'didInitAttrs', { attrs: bottomAttrs, newAttrs: bottomAttrs }], ['the-bottom', 'didReceiveAttrs', { attrs: bottomAttrs, newAttrs: bottomAttrs }], ['the-bottom', 'on(init)']] }); this.runTask(function () { @@ -19014,9 +18832,9 @@ babelHelpers.classCallCheck(this, LifeCycleHooksTest); // Because the `twitter` attr is used by the all of the components, // the lifecycle hooks are invoked for all components. - topAttrs = { oldAttrs: { twitter: '@tomdale' }, newAttrs: { twitter: '@horsetomdale' } }; - middleAttrs = { oldAttrs: { twitterTop: '@tomdale' }, newAttrs: { twitterTop: '@horsetomdale' } }; - bottomAttrs = { oldAttrs: { twitterMiddle: '@tomdale' }, newAttrs: { twitterMiddle: '@horsetomdale' } }; + topAttrs = { attrs: { twitter: '@horsetomdale' }, oldAttrs: { twitter: '@tomdale' }, newAttrs: { twitter: '@horsetomdale' } }; + middleAttrs = { attrs: { twitterTop: '@horsetomdale' }, oldAttrs: { twitterTop: '@tomdale' }, newAttrs: { twitterTop: '@horsetomdale' } }; + bottomAttrs = { attrs: { twitterMiddle: '@horsetomdale' }, oldAttrs: { twitterMiddle: '@tomdale' }, newAttrs: { twitterMiddle: '@horsetomdale' } }; this.assertHooks({ label: 'after updating (root)', @@ -19044,9 +18862,9 @@ babelHelpers.classCallCheck(this, LifeCycleHooksTest); // In this case, because the attrs are passed down, all child components are invoked. - topAttrs = { oldAttrs: { twitter: '@horsetomdale' }, newAttrs: { twitter: '@horsetomdale' } }; - middleAttrs = { oldAttrs: { twitterTop: '@horsetomdale' }, newAttrs: { twitterTop: '@horsetomdale' } }; - bottomAttrs = { oldAttrs: { twitterMiddle: '@horsetomdale' }, newAttrs: { twitterMiddle: '@horsetomdale' } }; + topAttrs = { attrs: { twitter: '@horsetomdale' }, oldAttrs: { twitter: '@horsetomdale' }, newAttrs: { twitter: '@horsetomdale' } }; + middleAttrs = { attrs: { twitterTop: '@horsetomdale' }, oldAttrs: { twitterTop: '@horsetomdale' }, newAttrs: { twitterTop: '@horsetomdale' } }; + bottomAttrs = { attrs: { twitterMiddle: '@horsetomdale' }, oldAttrs: { twitterMiddle: '@horsetomdale' }, newAttrs: { twitterMiddle: '@horsetomdale' } }; this.assertHooks({ label: 'after no-op rernder (root)', @@ -19086,11 +18904,11 @@ babelHelpers.classCallCheck(this, LifeCycleHooksTest); this.assertRegisteredViews('intial render'); var initialHooks = function (count) { - var ret = [['an-item', 'init'], ['an-item', 'didInitAttrs', { attrs: { count: count } }], ['an-item', 'didReceiveAttrs', { newAttrs: { count: count } }], ['an-item', 'on(init)']]; + var ret = [['an-item', 'init'], ['an-item', 'didInitAttrs', { attrs: { count: count }, newAttrs: { count: count } }], ['an-item', 'didReceiveAttrs', { attrs: { count: count }, newAttrs: { count: count } }], ['an-item', 'on(init)']]; if (_this6.isInteractive) { ret.push(['an-item', 'willRender'], ['an-item', 'willInsertElement']); } - ret.push(['nested-item', 'init'], ['nested-item', 'didInitAttrs', { attrs: {} }], ['nested-item', 'didReceiveAttrs', { newAttrs: {} }], ['nested-item', 'on(init)']); + ret.push(['nested-item', 'init'], ['nested-item', 'didInitAttrs', { attrs: {}, newAttrs: {} }], ['nested-item', 'didReceiveAttrs', { attrs: {}, newAttrs: {} }], ['nested-item', 'on(init)']); if (_this6.isInteractive) { ret.push(['nested-item', 'willRender'], ['nested-item', 'willInsertElement']); } @@ -19132,9 +18950,9 @@ babelHelpers.classCallCheck(this, LifeCycleHooksTest); this.assertHooks({ label: 'reset to empty array', - interactive: [['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['no-items', 'init'], ['no-items', 'didInitAttrs', { attrs: {} }], ['no-items', 'didReceiveAttrs', { newAttrs: {} }], ['no-items', 'on(init)'], ['no-items', 'willRender'], ['no-items', 'willInsertElement'], ['nested-item', 'init'], ['nested-item', 'didInitAttrs', { attrs: {} }], ['nested-item', 'didReceiveAttrs', { newAttrs: {} }], ['nested-item', 'on(init)'], ['nested-item', 'willRender'], ['nested-item', 'willInsertElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['nested-item', 'didInsertElement'], ['nested-item', 'didRender'], ['no-items', 'didInsertElement'], ['no-items', 'didRender'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy']], + interactive: [['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['no-items', 'init'], ['no-items', 'didInitAttrs', { attrs: {}, newAttrs: {} }], ['no-items', 'didReceiveAttrs', { attrs: {}, newAttrs: {} }], ['no-items', 'on(init)'], ['no-items', 'willRender'], ['no-items', 'willInsertElement'], ['nested-item', 'init'], ['nested-item', 'didInitAttrs', { attrs: {}, newAttrs: {} }], ['nested-item', 'didReceiveAttrs', { attrs: {}, newAttrs: {} }], ['nested-item', 'on(init)'], ['nested-item', 'willRender'], ['nested-item', 'willInsertElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['nested-item', 'didInsertElement'], ['nested-item', 'didRender'], ['no-items', 'didInsertElement'], ['no-items', 'didRender'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy']], - nonInteractive: [['no-items', 'init'], ['no-items', 'didInitAttrs', { attrs: {} }], ['no-items', 'didReceiveAttrs', { newAttrs: {} }], ['no-items', 'on(init)'], ['nested-item', 'init'], ['nested-item', 'didInitAttrs', { attrs: {} }], ['nested-item', 'didReceiveAttrs', { newAttrs: {} }], ['nested-item', 'on(init)'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy']] + nonInteractive: [['no-items', 'init'], ['no-items', 'didInitAttrs', { attrs: {}, newAttrs: {} }], ['no-items', 'didReceiveAttrs', { attrs: {}, newAttrs: {} }], ['no-items', 'on(init)'], ['nested-item', 'init'], ['nested-item', 'didInitAttrs', { attrs: {}, newAttrs: {} }], ['nested-item', 'didReceiveAttrs', { attrs: {}, newAttrs: {} }], ['nested-item', 'on(init)'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy']] }); this.teardownAssertions.push(function () { @@ -19582,8 +19400,14 @@ babelHelpers.classCallCheck(this, _class5); return { isExpr: true, value: value }; } - function hook(name, hook, args) { - return { name: name, hook: hook, args: args }; + function hook(name, hook) { + var _ref3 = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + + var attrs = _ref3.attrs; + var oldAttrs = _ref3.oldAttrs; + var newAttrs = _ref3.newAttrs; + + return { name: name, hook: hook, args: { attrs: attrs, oldAttrs: oldAttrs, newAttrs: newAttrs } }; } function json(serializable) { @@ -19598,21 +19422,13 @@ babelHelpers.classCallCheck(this, _class5); // Sync hooks // Async hooks -enifed('ember-glimmer/tests/integration/components/life-cycle-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/life-cycle-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/life-cycle-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/life-cycle-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/life-cycle-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/life-cycle-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/life-cycle-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/life-cycle-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/life-cycle-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/link-to-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-runtime', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/test-helpers'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberRuntime, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsTestHelpers) { @@ -19831,21 +19647,13 @@ enifed('ember-glimmer/tests/integration/components/link-to-test', ['exports', 'e return _class2; })(_emberGlimmerTestsUtilsTestCase.ApplicationTest)); }); -enifed('ember-glimmer/tests/integration/components/link-to-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/link-to-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/link-to-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/link-to-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/link-to-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/link-to-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/link-to-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/link-to-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/link-to-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/local-lookup-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers) { @@ -20137,41 +19945,25 @@ enifed('ember-glimmer/tests/integration/components/local-lookup-test', ['exports return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/components/local-lookup-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/local-lookup-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/local-lookup-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/local-lookup-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/local-lookup-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/local-lookup-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/local-lookup-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/local-lookup-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/local-lookup-test.js should pass ESLint\n\n'); }); }); enifed("ember-glimmer/tests/integration/components/render-to-element-test", ["exports"], function (exports) { "use strict"; }); -enifed('ember-glimmer/tests/integration/components/render-to-element-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/render-to-element-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/render-to-element-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/render-to-element-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/render-to-element-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/render-to-element-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/render-to-element-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/render-to-element-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/render-to-element-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/target-action-test', ['exports', 'ember-utils', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-runtime', 'ember-routing'], function (exports, _emberUtils, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberRuntime, _emberRouting) { @@ -20881,21 +20673,13 @@ babelHelpers.classCallCheck(this, _class4); return _class4; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/components/target-action-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/target-action-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/target-action-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/target-action-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/target-action-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/target-action-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/target-action-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/target-action-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/target-action-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/utils-test', ['exports', 'ember-runtime', 'ember-views', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberRuntime, _emberViews, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers) { @@ -21250,21 +21034,13 @@ enifed('ember-glimmer/tests/integration/components/utils-test', ['exports', 'emb return _class2; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/components/utils-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/utils-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/utils-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/utils-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/utils-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/utils-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/utils-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/utils-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/utils-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/web-component-fallback-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal) { @@ -21316,21 +21092,13 @@ enifed('ember-glimmer/tests/integration/components/web-component-fallback-test', return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/components/web-component-fallback-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/web-component-fallback-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/web-component-fallback-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/web-component-fallback-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/web-component-fallback-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/web-component-fallback-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/web-component-fallback-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/web-component-fallback-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/web-component-fallback-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/will-destroy-element-hook-test', ['exports', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/test-case'], function (exports, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsTestCase) { @@ -21381,21 +21149,13 @@ enifed('ember-glimmer/tests/integration/components/will-destroy-element-hook-tes return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/components/will-destroy-element-hook-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/will-destroy-element-hook-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/will-destroy-element-hook-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/will-destroy-element-hook-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/will-destroy-element-hook-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/will-destroy-element-hook-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/will-destroy-element-hook-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/will-destroy-element-hook-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/will-destroy-element-hook-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/content-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/test-helpers', 'ember-views', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberMetal, _emberRuntime, _emberGlimmerTestsUtilsTestHelpers, _emberViews, _emberGlimmerTestsUtilsHelpers) { @@ -23059,21 +22819,13 @@ enifed('ember-glimmer/tests/integration/content-test', ['exports', 'ember-glimme })(StyleTest)); } }); -enifed('ember-glimmer/tests/integration/content-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration'); - test('ember-glimmer/tests/integration/content-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/content-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/content-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/content-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration'); - QUnit.test('ember-glimmer/tests/integration/content-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/content-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/content-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/content-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/event-dispatcher-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { @@ -23282,7 +23034,7 @@ enifed('ember-glimmer/tests/integration/event-dispatcher-test', ['exports', 'emb return _class2; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); - if (false) { + if (_emberMetal.isFeatureEnabled('ember-improved-instrumentation')) { _emberGlimmerTestsUtilsTestCase.moduleFor('EventDispatcher - Instrumentation', (function (_RenderingTest3) { babelHelpers.inherits(_class3, _RenderingTest3); @@ -23378,21 +23130,13 @@ enifed('ember-glimmer/tests/integration/event-dispatcher-test', ['exports', 'emb })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); } }); -enifed('ember-glimmer/tests/integration/event-dispatcher-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/event-dispatcher-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration'); - test('ember-glimmer/tests/integration/event-dispatcher-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/event-dispatcher-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/event-dispatcher-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration'); - QUnit.test('ember-glimmer/tests/integration/event-dispatcher-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/event-dispatcher-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/event-dispatcher-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/event-dispatcher-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/-class-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/test-helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsTestHelpers, _emberMetal) { @@ -23470,21 +23214,13 @@ enifed('ember-glimmer/tests/integration/helpers/-class-test', ['exports', 'ember return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/-class-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/-class-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/-class-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/-class-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/-class-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/-class-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/-class-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/-class-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/-class-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/closure-action-test', ['exports', 'ember-metal', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberMetal, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsHelpers) { @@ -23492,7 +23228,7 @@ enifed('ember-glimmer/tests/integration/helpers/closure-action-test', ['exports' var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n
    clicked: {{clicked}}; foo: {{foo}}
    \n\n {{click-me id="string-action" onClick=(action "on-click")}}\n {{click-me id="function-action" onClick=(action onClick)}}\n {{click-me id="mut-action" onClick=(action (mut clicked))}}\n '], ['\n
    clicked: {{clicked}}; foo: {{foo}}
    \n\n {{click-me id="string-action" onClick=(action "on-click")}}\n {{click-me id="function-action" onClick=(action onClick)}}\n {{click-me id="mut-action" onClick=(action (mut clicked))}}\n ']); - if (false) { + if (_emberMetal.isFeatureEnabled('ember-improved-instrumentation')) { _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: closure {{action}} improved instrumentation', (function (_RenderingTest) { babelHelpers.inherits(_class, _RenderingTest); @@ -23615,8 +23351,6 @@ babelHelpers.classCallCheck(this, _class); var _this3 = this; var returnedValue = 'Chris P is so krispy'; - var beforeParameter = undefined; - var afterParameter = undefined; var actualReturnedValue = undefined; var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -23644,12 +23378,8 @@ babelHelpers.classCallCheck(this, _class); }); this.subscribe('interaction.ember-action', { - before: function (name, timestamp, payload) { - beforeParameter = payload.target.get('myProperty'); - }, - after: function (name, timestamp, payload) { - afterParameter = payload.target.get('myProperty'); - } + before: function (name, timestamp, payload) {}, + after: function (name, timestamp, payload) {} }); this.render('{{outer-component}}'); @@ -24144,7 +23874,6 @@ babelHelpers.classCallCheck(this, _class2); var actualReturnedValue = undefined; var innerComponent = undefined; - var outerComponent = undefined; var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ init: function () { @@ -24157,10 +23886,6 @@ babelHelpers.classCallCheck(this, _class2); }); var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ - init: function () { - this._super.apply(this, arguments); - outerComponent = this; - }, actions: { outerAction: function (incomingFirst, incomingSecond) { actualFirst = incomingFirst; @@ -24747,21 +24472,13 @@ babelHelpers.classCallCheck(this, _class2); return _class2; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/closure-action-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/closure-action-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/closure-action-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/closure-action-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/closure-action-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/closure-action-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/closure-action-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/closure-action-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/closure-action-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/concat-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal) { @@ -24900,24 +24617,16 @@ enifed('ember-glimmer/tests/integration/helpers/concat-test', ['exports', 'ember return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/concat-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/concat-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/concat-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/concat-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/concat-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/concat-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/concat-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/concat-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/concat-test.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/tests/integration/helpers/custom-helper-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'internal-test-helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _internalTestHelpers, _emberMetal) { +enifed('ember-glimmer/tests/integration/helpers/custom-helper-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'internal-test-helpers', 'ember-metal', 'ember-utils'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _internalTestHelpers, _emberMetal, _emberUtils) { /* globals EmberDev */ 'use strict'; @@ -25142,6 +24851,30 @@ enifed('ember-glimmer/tests/integration/helpers/custom-helper-test', ['exports', assert.strictEqual(destroyCount, 0, 'destroy is not called on recomputation'); }; + _class.prototype['@test helper params can be returned'] = function testHelperParamsCanBeReturned() { + this.registerHelper('hello-world', function (values) { + return values; + }); + + this.render('{{#each (hello-world model) as |item|}}({{item}}){{/each}}', { + model: ['bob'] + }); + + this.assertText('(bob)'); + }; + + _class.prototype['@test helper hash can be returned'] = function testHelperHashCanBeReturned() { + this.registerHelper('hello-world', function (_, hash) { + return hash.model; + }); + + this.render('{{get (hello-world model=model) \'name\'}}', { + model: { name: 'bob' } + }); + + this.assertText('bob'); + }; + _class.prototype['@test simple helper is called for param changes'] = function testSimpleHelperIsCalledForParamChanges() { var _this9 = this; @@ -25333,9 +25066,7 @@ enifed('ember-glimmer/tests/integration/helpers/custom-helper-test', ['exports', } }); - this.render('{{join-words "Who"\n (join-words "overcomes" "by")\n model.reason\n (join-words (join-words "hath overcome but" "half"))\n (join-words "his" (join-words "foe"))}}', { - model: { reason: 'force' } - }); + this.render('{{join-words "Who"\n (join-words "overcomes" "by")\n model.reason\n (join-words (join-words "hath overcome but" "half"))\n (join-words "his" (join-words "foe"))}}', { model: { reason: 'force' } }); this.assertText('Who overcomes by force hath overcome but half his foe'); @@ -25421,9 +25152,9 @@ enifed('ember-glimmer/tests/integration/helpers/custom-helper-test', ['exports', this.registerHelper('some-helper', function () {}); - expectAssertion(function () { + this.assert.throws(function () { _this18.render('
    '); - }, /Helpers may not be used in the element form/); + }, /Compile Error some-helper is not a modifier: Helpers may not be used in the element form/); }; _class.prototype['@test class-based helper not usable within element'] = function testClassBasedHelperNotUsableWithinElement() { @@ -25433,9 +25164,9 @@ enifed('ember-glimmer/tests/integration/helpers/custom-helper-test', ['exports', compute: function () {} }); - expectAssertion(function () { + this.assert.throws(function () { _this19.render('
    '); - }, /Helpers may not be used in the element form/); + }, /Compile Error some-helper is not a modifier: Helpers may not be used in the element form/); }; _class.prototype['@test class-based helper is torn down'] = function testClassBasedHelperIsTornDown() { @@ -25635,7 +25366,7 @@ enifed('ember-glimmer/tests/integration/helpers/custom-helper-test', ['exports', } })(); - if (!EmberDev.runningProdBuild && (pushingIntoFrozenArrayThrows || assigningExistingFrozenPropertyThrows || addingPropertyToFrozenObjectThrows)) { + if (!EmberDev.runningProdBuild && _emberUtils.HAS_NATIVE_WEAKMAP && (pushingIntoFrozenArrayThrows || assigningExistingFrozenPropertyThrows || addingPropertyToFrozenObjectThrows)) { (function () { var HelperMutatingArgsTests = (function (_RenderingTest2) { babelHelpers.inherits(HelperMutatingArgsTests, _RenderingTest2); @@ -25731,317 +25462,13 @@ enifed('ember-glimmer/tests/integration/helpers/custom-helper-test', ['exports', })(); } }); -enifed('ember-glimmer/tests/integration/helpers/custom-helper-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/custom-helper-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/custom-helper-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/custom-helper-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/custom-helper-test.js should pass jshint', function (assert) { - assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/custom-helper-test.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/debugger-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/helpers/debugger', 'ember-metal', 'ember-runtime'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberGlimmerHelpersDebugger, _emberMetal, _emberRuntime) { - 'use strict'; - - // This file is generally not I-N-U-R tested, because the {{debugger}} helper currently - // does not run during re-render. This is something we eventually want to do, and when - // we implement that feature these tests should be updated accordingly. - - _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{debugger}}', (function (_RenderingTest) { - babelHelpers.inherits(_class, _RenderingTest); - - function _class() { - babelHelpers.classCallCheck(this, _class); - - _RenderingTest.apply(this, arguments); - } - - _class.prototype.teardown = function teardown() { - _RenderingTest.prototype.teardown.call(this); - _emberGlimmerHelpersDebugger.resetDebuggerCallback(); - }; - - _class.prototype.expectDebuggerCallback = function expectDebuggerCallback(callback, debuggerCallback) { - var times = arguments.length <= 2 || arguments[2] === undefined ? 1 : arguments[2]; - - var called = 0; - - _emberGlimmerHelpersDebugger.setDebuggerCallback(function (context, get) { - called++; - debuggerCallback(context, get); - }); - - callback(); - - this.assert.strictEqual(called, times, 'Expect debugger callback to be called exactly ' + times + ' time(s)'); - }; - - _class.prototype.expectNoDebuggerCallback = function expectNoDebuggerCallback(callback) { - var called = 0; - - _emberGlimmerHelpersDebugger.setDebuggerCallback(function () { - return called++; - }); - - callback(); - - this.assert.strictEqual(called, 0, 'Expect no debugger callback'); - }; - - _class.prototype['@test should have the right context when used in a component layout'] = function testShouldHaveTheRightContextWhenUsedInAComponentLayout(assert) { - var _this = this; - - var instance = undefined; - - this.registerComponent('my-wrapper', { - template: '{{yield}}' - }); - - this.registerComponent('foo-bar', { - ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ - init: function () { - this._super(); - instance = this; - } - }), - template: '{{debugger}}foo-bar' - }); - - this.expectDebuggerCallback(function () { - _this.render('{{#my-wrapper}}{{foo-bar}}{{/my-wrapper}}'); - }, function (context) { - assert.strictEqual(context, instance, 'context should be the component instance'); - }); - - this.assertText('foo-bar'); - - this.expectNoDebuggerCallback(function () { - return _this.runTask(function () { - return _this.rerender(); - }); - }); - - this.assertText('foo-bar'); - }; - - _class.prototype['@test should have the right context when yielded'] = function testShouldHaveTheRightContextWhenYielded(assert) { - var _this2 = this; - - var instance = undefined; - - this.registerComponent('my-wrapper', { - template: '{{yield}}' - }); - - this.registerComponent('foo-bar', { - ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ - init: function () { - this._super(); - instance = this; - } - }), - template: '{{#my-wrapper}}{{debugger}}foo-bar{{/my-wrapper}}' - }); - - this.expectDebuggerCallback(function () { - _this2.render('{{foo-bar}}'); - }, function (context) { - assert.strictEqual(context, instance, 'context should be the component instance'); - }); - - this.assertText('foo-bar'); - - this.expectNoDebuggerCallback(function () { - return _this2.runTask(function () { - return _this2.rerender(); - }); - }); - - this.assertText('foo-bar'); - }; - - _class.prototype['@test should be called once per iteration in a loop'] = function testShouldBeCalledOncePerIterationInALoop(assert) { - var _this3 = this; - - var count = 0; - - _emberGlimmerHelpersDebugger.setDebuggerCallback(function () { - return count++; - }); - - var items = _emberRuntime.A([1, 2, 3, 4, 5]); - - this.render('{{#each items as |item|}}{{debugger}}[{{item}}]{{/each}}', { items: items }); - - this.assertText('[1][2][3][4][5]'); - - assert.equal(count, 5, 'should have fired once per iteration'); - - count = 0; - - this.runTask(function () { - return _this3.rerender(); - }); - - this.assertText('[1][2][3][4][5]'); - - assert.strictEqual(count, 0, 'should not fire for re-render'); - - count = 0; - - this.runTask(function () { - return items.pushObjects([6, 7, 8]); - }); - - this.assertText('[1][2][3][4][5][6][7][8]'); - - assert.equal(count, 3, 'should fire once per new items added to the loop'); - }; - - _class.prototype['@test could `get` properties from "self"'] = function testCouldGetPropertiesFromSelf(assert) { - var _this4 = this; - - this.registerComponent('foo-bar', { - ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ - init: function () { - this._super(); - this.zomg = 'zomg'; - } - }), - template: '{{debugger not.here}}foo-bar' - }); - - this.expectDebuggerCallback(function () { - _this4.render('{{foo-bar lol="lol" foo=foo}}', { foo: { bar: { baz: 'fooBarBaz' } } }); - }, function (context, get) { - assert.equal(get('this'), context, '{{this}}'); - - assert.equal(get('lol'), 'lol', '{{lol}}'); - assert.equal(get('this.lol'), 'lol', '{{this.lol}}'); - - assert.equal(get('zomg'), 'zomg', '{{zomg}}'); - assert.equal(get('this.zomg'), 'zomg', '{{this.zomg}}'); - - assert.equal(get('foo.bar.baz'), 'fooBarBaz', '{{foo.bar.baz}}'); - assert.equal(get('this.foo.bar.baz'), 'fooBarBaz', '{{this.foo.bar.baz}}'); - - assert.strictEqual(get('nope'), undefined, '{{nope}}'); - assert.strictEqual(get('this.nope'), undefined, '{{this.nope}}'); - - assert.strictEqual(get('not.here'), undefined, '{{not.here}}'); - assert.strictEqual(get('this.not.here'), undefined, '{{this.not.here}}'); - }); - - this.assertText('foo-bar'); - - this.expectNoDebuggerCallback(function () { - return _this4.runTask(function () { - return _this4.rerender(); - }); - }); - - this.assertText('foo-bar'); - }; - - _class.prototype['@test could `get` local variables'] = function testCouldGetLocalVariables(assert) { - var _this5 = this; - - var obj = { - foo: 'foo', - bar: { baz: { bat: 'barBazBat' } } - }; - - this.expectDebuggerCallback(function () { - _this5.render('{{#each-in obj as |key value|}}{{debugger}}[{{key}}]{{/each-in}}', { obj: obj }); - }, function (context, get) { - assert.equal(get('this'), context, '{{this}}'); - - assert.equal(get('obj'), obj); - - // Glimmer bug: - // assert.strictEqual(get('this.key'), undefined, '{{this.key}}'); - // assert.strictEqual(get('this.value'), undefined, '{{this.value}}'); - - var key = get('key'); - - if (key === 'foo') { - assert.equal(get('value'), 'foo', '{{value}} for key=foo'); - assert.strictEqual(get('value.baz.bat'), undefined, '{{value.baz.bat}} for key=foo'); - assert.strictEqual(get('value.nope'), undefined, '{{value.nope}} for key=foo'); - } else if (key === 'bar') { - assert.equal(get('value'), obj.bar, '{{value}} for key=bar'); - assert.equal(get('value.baz.bat'), 'barBazBat', '{{value.baz.bat}} for key=bar'); - assert.strictEqual(get('value.nope'), undefined, '{{value.nope}} for key=bar'); - } else { - assert.ok(false, 'Unknown key: ' + key); - } - }, 2); - - this.assertText('[foo][bar]'); - - this.expectNoDebuggerCallback(function () { - return _this5.runTask(function () { - return _this5.rerender(); - }); - }); - - this.assertText('[foo][bar]'); - - this.expectDebuggerCallback(function () { - _this5.runTask(function () { - return _emberMetal.set(obj, 'baz', 'baz'); - }); - }, function (context, get) { - assert.equal(get('this'), context, '{{this}}'); - - assert.equal(get('obj'), obj); - - assert.strictEqual(get('this.key'), undefined, '{{this.key}}'); - assert.strictEqual(get('this.value'), undefined, '{{this.value}}'); - - assert.equal(get('key'), 'baz', '{{key}} for key=baz'); - assert.equal(get('value'), 'baz', '{{value}} for key=baz'); - assert.strictEqual(get('value.baz.bat'), undefined, '{{value.baz.bat}} for key=baz'); - assert.strictEqual(get('value.nope'), undefined, '{{value.nope}} for key=baz'); - }); - - this.assertText('[foo][bar][baz]'); - - this.expectNoDebuggerCallback(function () { - return _this5.runTask(function () { - return _this5.rerender(); - }); - }); - - this.assertText('[foo][bar][baz]'); - }; - - return _class; - })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); -}); -enifed('ember-glimmer/tests/integration/helpers/debugger-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/debugger-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/debugger-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/debugger-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/custom-helper-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/debugger-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/custom-helper-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/debugger-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/custom-helper-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/element-action-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal', 'ember-runtime', 'ember-views'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal, _emberRuntime, _emberViews) { @@ -26075,7 +25502,7 @@ enifed('ember-glimmer/tests/integration/helpers/element-action-test', ['exports' }); } - if (false) { + if (_emberMetal.isFeatureEnabled('ember-improved-instrumentation')) { _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: element action instrumentation', (function (_RenderingTest) { babelHelpers.inherits(_class, _RenderingTest); @@ -27590,21 +27017,13 @@ babelHelpers.classCallCheck(this, _class2); return _class2; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/element-action-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/element-action-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/element-action-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/element-action-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/element-action-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/element-action-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/element-action-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/element-action-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/element-action-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/get-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { @@ -28246,21 +27665,13 @@ enifed('ember-glimmer/tests/integration/helpers/get-test', ['exports', 'ember-gl return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/get-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/get-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/get-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/get-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/get-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/get-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/get-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/get-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/get-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/hash-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { @@ -28488,21 +27899,13 @@ enifed('ember-glimmer/tests/integration/helpers/hash-test', ['exports', 'ember-g return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/hash-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/hash-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/hash-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/hash-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/hash-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/hash-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/hash-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/hash-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/hash-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/if-unless-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/shared-conditional-tests'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsSharedConditionalTests) { @@ -28784,21 +28187,13 @@ enifed('ember-glimmer/tests/integration/helpers/if-unless-test', ['exports', 'em return _class11; })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessHelperTest)); }); -enifed('ember-glimmer/tests/integration/helpers/if-unless-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/if-unless-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/if-unless-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/if-unless-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/if-unless-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/if-unless-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/if-unless-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/if-unless-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/if-unless-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember-utils', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/test-case', 'internal-test-helpers'], function (exports, _emberUtils, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsTestCase, _internalTestHelpers) { @@ -29284,6 +28679,36 @@ enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember- this.assertAttr('type', 'password'); }; + _class2.prototype['@test a subexpression can be used to determine type'] = function testASubexpressionCanBeUsedToDetermineType() { + var _this11 = this; + + this.render('{{input type=(if isTruthy trueType falseType)}}', { + isTruthy: true, + trueType: 'text', + falseType: 'password' + }); + + this.assertAttr('type', 'text'); + + this.runTask(function () { + return _this11.rerender(); + }); + + this.assertAttr('type', 'text'); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'isTruthy', false); + }); + + this.assertAttr('type', 'password'); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'isTruthy', true); + }); + + this.assertAttr('type', 'text'); + }; + return _class2; })(InputRenderingTest)); @@ -29297,7 +28722,7 @@ enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember- } _class3.prototype['@test dynamic attributes'] = function testDynamicAttributes() { - var _this11 = this; + var _this12 = this; this.render('{{input\n type=\'checkbox\'\n disabled=disabled\n name=name\n checked=checked\n tabindex=tabindex\n }}', { disabled: false, @@ -29312,7 +28737,7 @@ enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember- this.assertAttr('tabindex', '10'); this.runTask(function () { - return _this11.rerender(); + return _this12.rerender(); }); this.assertSingleCheckbox(); @@ -29321,9 +28746,9 @@ enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember- this.assertAttr('tabindex', '10'); this.runTask(function () { - _emberMetal.set(_this11.context, 'disabled', true); - _emberMetal.set(_this11.context, 'name', 'updated-name'); - _emberMetal.set(_this11.context, 'tabindex', 11); + _emberMetal.set(_this12.context, 'disabled', true); + _emberMetal.set(_this12.context, 'name', 'updated-name'); + _emberMetal.set(_this12.context, 'tabindex', 11); }); this.assertSingleCheckbox(); @@ -29332,9 +28757,9 @@ enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember- this.assertAttr('tabindex', '11'); this.runTask(function () { - _emberMetal.set(_this11.context, 'disabled', false); - _emberMetal.set(_this11.context, 'name', 'original-name'); - _emberMetal.set(_this11.context, 'tabindex', 10); + _emberMetal.set(_this12.context, 'disabled', false); + _emberMetal.set(_this12.context, 'name', 'original-name'); + _emberMetal.set(_this12.context, 'tabindex', 10); }); this.assertSingleCheckbox(); @@ -29344,15 +28769,15 @@ enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember- }; _class3.prototype['@test `value` property assertion'] = function testValuePropertyAssertion() { - var _this12 = this; + var _this13 = this; expectAssertion(function () { - _this12.render('{{input type="checkbox" value=value}}', { value: 'value' }); + _this13.render('{{input type="checkbox" value=value}}', { value: 'value' }); }, /you must use `checked=/); }; _class3.prototype['@test with a bound type'] = function testWithABoundType(assert) { - var _this13 = this; + var _this14 = this; this.render('{{input type=inputType checked=isChecked}}', { inputType: 'checkbox', isChecked: true }); @@ -29360,26 +28785,26 @@ enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember- this.assertCheckboxIsChecked(); this.runTask(function () { - return _this13.rerender(); + return _this14.rerender(); }); this.assertCheckboxIsChecked(); this.runTask(function () { - return _emberMetal.set(_this13.context, 'isChecked', false); + return _emberMetal.set(_this14.context, 'isChecked', false); }); this.assertCheckboxIsNotChecked(); this.runTask(function () { - return _emberMetal.set(_this13.context, 'isChecked', true); + return _emberMetal.set(_this14.context, 'isChecked', true); }); this.assertCheckboxIsChecked(); }; _class3.prototype['@test with static values'] = function testWithStaticValues(assert) { - var _this14 = this; + var _this15 = this; this.render('{{input type="checkbox" disabled=false tabindex=10 name="original-name" checked=false}}'); @@ -29390,7 +28815,7 @@ enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember- this.assertAttr('name', 'original-name'); this.runTask(function () { - return _this14.rerender(); + return _this15.rerender(); }); this.assertSingleCheckbox(); @@ -29413,7 +28838,7 @@ enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember- } _class4.prototype['@test null values'] = function testNullValues(assert) { - var _this15 = this; + var _this16 = this; var attributes = ['disabled', 'placeholder', 'name', 'maxlength', 'size', 'tabindex']; @@ -29431,20 +28856,20 @@ enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember- this.assertAllAttrs(attributes, undefined); this.runTask(function () { - return _this15.rerender(); + return _this16.rerender(); }); this.assertValue(''); this.assertAllAttrs(attributes, undefined); this.runTask(function () { - _emberMetal.set(_this15.context, 'disabled', true); - _emberMetal.set(_this15.context, 'value', 'Updated value'); - _emberMetal.set(_this15.context, 'placeholder', 'Updated placeholder'); - _emberMetal.set(_this15.context, 'name', 'updated-name'); - _emberMetal.set(_this15.context, 'maxlength', 11); - _emberMetal.set(_this15.context, 'size', 21); - _emberMetal.set(_this15.context, 'tabindex', 31); + _emberMetal.set(_this16.context, 'disabled', true); + _emberMetal.set(_this16.context, 'value', 'Updated value'); + _emberMetal.set(_this16.context, 'placeholder', 'Updated placeholder'); + _emberMetal.set(_this16.context, 'name', 'updated-name'); + _emberMetal.set(_this16.context, 'maxlength', 11); + _emberMetal.set(_this16.context, 'size', 21); + _emberMetal.set(_this16.context, 'tabindex', 31); }); this.assertDisabled(); @@ -29456,13 +28881,13 @@ enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember- this.assertAttr('tabindex', '31'); this.runTask(function () { - _emberMetal.set(_this15.context, 'disabled', null); - _emberMetal.set(_this15.context, 'value', null); - _emberMetal.set(_this15.context, 'placeholder', null); - _emberMetal.set(_this15.context, 'name', null); - _emberMetal.set(_this15.context, 'maxlength', null); + _emberMetal.set(_this16.context, 'disabled', null); + _emberMetal.set(_this16.context, 'value', null); + _emberMetal.set(_this16.context, 'placeholder', null); + _emberMetal.set(_this16.context, 'name', null); + _emberMetal.set(_this16.context, 'maxlength', null); // set(this.context, 'size', null); //NOTE: this fails with `Error: Failed to set the 'size' property on 'HTMLInputElement': The value provided is 0, which is an invalid size.` (TEST_SUITE=sauce) - _emberMetal.set(_this15.context, 'tabindex', null); + _emberMetal.set(_this16.context, 'tabindex', null); }); this.assertAttr('disabled', undefined); @@ -29477,21 +28902,13 @@ enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember- return _class4; })(InputRenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/input-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/input-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/input-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/input-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/input-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/input-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/input-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/input-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/input-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/loc-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal, _ember) { @@ -29607,21 +29024,13 @@ enifed('ember-glimmer/tests/integration/helpers/loc-test', ['exports', 'ember-gl return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/loc-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/loc-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/loc-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/loc-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/loc-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/loc-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/loc-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/loc-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/loc-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/log-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-console'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberConsole) { @@ -29691,21 +29100,13 @@ enifed('ember-glimmer/tests/integration/helpers/log-test', ['exports', 'ember-gl return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/log-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/log-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/log-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/log-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/log-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/log-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/log-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/log-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/log-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/mut-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal', 'ember-glimmer/tests/utils/test-helpers'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal, _emberGlimmerTestsUtilsTestHelpers) { @@ -30337,21 +29738,13 @@ enifed('ember-glimmer/tests/integration/helpers/mut-test', ['exports', 'ember-gl return _class2; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/mut-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/mut-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/mut-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/mut-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/mut-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/mut-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/mut-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/mut-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/mut-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/partial-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase) { @@ -30513,21 +29906,13 @@ babelHelpers.classCallCheck(this, _class); return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/partial-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/partial-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/partial-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/partial-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/partial-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/partial-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/partial-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/partial-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/partial-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/readonly-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { @@ -30696,21 +30081,13 @@ enifed('ember-glimmer/tests/integration/helpers/readonly-test', ['exports', 'emb return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/readonly-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/readonly-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/readonly-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/readonly-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/readonly-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/readonly-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/readonly-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/readonly-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/readonly-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/test-case'], function (exports, _emberMetal, _emberRuntime, _emberGlimmerTestsUtilsTestCase) { @@ -30726,68 +30103,91 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember } _class.prototype['@test should render given template'] = function testShouldRenderGivenTemplate() { + var _this = this; + this.registerTemplate('home', '

    BYE

    '); - this.render('

    HI

    {{render \'home\'}}'); + expectDeprecation(function () { + _this.render('

    HI

    {{render \'home\'}}'); + }, /Please refactor [\w\{\}"` ]+ to a component/); this.assertText('HIBYE'); }; _class.prototype['@test uses `controller:basic` as the basis for a generated controller when none exists for specified name'] = function testUsesControllerBasicAsTheBasisForAGeneratedControllerWhenNoneExistsForSpecifiedName() { + var _this2 = this; + this.owner.register('controller:basic', _emberRuntime.Controller.extend({ isBasicController: true })); this.registerTemplate('home', '{{isBasicController}}'); - this.render('{{render \'home\'}}'); + expectDeprecation(function () { + _this2.render('{{render \'home\'}}'); + }, /Please refactor [\w\{\}"` ]+ to a component/); this.assertText('true'); }; _class.prototype['@test generates a controller if none exists'] = function testGeneratesAControllerIfNoneExists() { + var _this3 = this; + this.registerTemplate('home', '

    {{this}}

    '); - this.render('

    HI

    {{render \'home\'}}'); + expectDeprecation(function () { + _this3.render('

    HI

    {{render \'home\'}}'); + }, /Please refactor [\w\{\}"` ]+ to a component/); this.assertText('HI(generated home controller)'); }; _class.prototype['@test should use controller with the same name as template if present'] = function testShouldUseControllerWithTheSameNameAsTemplateIfPresent() { + var _this4 = this; + this.owner.register('controller:home', _emberRuntime.Controller.extend({ name: 'home' })); this.registerTemplate('home', '{{name}}

    BYE

    '); - this.render('

    HI

    {{render \'home\'}}'); + expectDeprecation(function () { + _this4.render('

    HI

    {{render \'home\'}}'); + }, /Please refactor [\w\{\}"` ]+ to a component/); this.assertText('HIhomeBYE'); }; _class.prototype['@test should render nested helpers'] = function testShouldRenderNestedHelpers() { + var _this5 = this; + this.owner.register('controller:home', _emberRuntime.Controller.extend()); this.owner.register('controller:foo', _emberRuntime.Controller.extend()); this.owner.register('controller:bar', _emberRuntime.Controller.extend()); this.owner.register('controller:baz', _emberRuntime.Controller.extend()); this.registerTemplate('home', '

    BYE

    '); - this.registerTemplate('foo', '

    FOO

    {{render \'bar\'}}'); - this.registerTemplate('bar', '

    BAR

    {{render \'baz\'}}'); this.registerTemplate('baz', '

    BAZ

    '); - this.render('

    HI

    {{render \'foo\'}}'); + expectDeprecation(function () { + _this5.registerTemplate('foo', '

    FOO

    {{render \'bar\'}}'); + _this5.registerTemplate('bar', '

    BAR

    {{render \'baz\'}}'); + _this5.render('

    HI

    {{render \'foo\'}}'); + }, /Please refactor [\w\{\}"` ]+ to a component/); + this.assertText('HIFOOBARBAZ'); }; _class.prototype['@test should have assertion if the template does not exist'] = function testShouldHaveAssertionIfTheTemplateDoesNotExist() { - var _this = this; + var _this6 = this; this.owner.register('controller:oops', _emberRuntime.Controller.extend()); - expectAssertion(function () { - _this.render('

    HI

    {{render \'oops\'}}'); - }, 'You used `{{render \'oops\'}}`, but \'oops\' can not be found as a template.'); + expectDeprecation(function () { + expectAssertion(function () { + _this6.render('

    HI

    {{render \'oops\'}}'); + }, 'You used `{{render \'oops\'}}`, but \'oops\' can not be found as a template.'); + }, /Please refactor [\w\{\}"` ]+ to a component/); }; _class.prototype['@test should render given template with the singleton controller as its context'] = function testShouldRenderGivenTemplateWithTheSingletonControllerAsItsContext() { - var _this2 = this; + var _this7 = this; this.owner.register('controller:post', _emberRuntime.Controller.extend({ init: function () { @@ -30796,12 +30196,14 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember })); this.registerTemplate('post', '

    {{title}}

    '); - this.render('

    HI

    {{render \'post\'}}'); + expectDeprecation(function () { + _this7.render('

    HI

    {{render \'post\'}}'); + }, /Please refactor [\w\{\}"` ]+ to a component/); this.assertText('HIIt\'s Simple Made Easy'); this.runTask(function () { - return _this2.rerender(); + return _this7.rerender(); }); this.assertText('HIIt\'s Simple Made Easy'); @@ -30822,7 +30224,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember }; _class.prototype['@test should not destroy the singleton controller on teardown'] = function testShouldNotDestroyTheSingletonControllerOnTeardown(assert) { - var _this3 = this; + var _this8 = this; var willDestroyFired = 0; @@ -30839,14 +30241,16 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember this.registerTemplate('post', '

    {{title}}

    '); - this.render('{{#if showPost}}{{render \'post\'}}{{else}}Nothing here{{/if}}', { showPost: false }); + expectDeprecation(function () { + _this8.render('{{#if showPost}}{{render \'post\'}}{{else}}Nothing here{{/if}}', { showPost: false }); + }, /Please refactor [\w\{\}"` ]+ to a component/); this.assertText('Nothing here'); assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); this.runTask(function () { - return _this3.rerender(); + return _this8.rerender(); }); this.assertText('Nothing here'); @@ -30854,7 +30258,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); this.runTask(function () { - return _emberMetal.set(_this3.context, 'showPost', true); + return _emberMetal.set(_this8.context, 'showPost', true); }); this.assertText('It\'s Simple Made Easy'); @@ -30862,7 +30266,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); this.runTask(function () { - return _emberMetal.set(_this3.context, 'showPost', false); + return _emberMetal.set(_this8.context, 'showPost', false); }); this.assertText('Nothing here'); @@ -30871,13 +30275,13 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember }; _class.prototype['@test should render given template with a supplied model'] = function testShouldRenderGivenTemplateWithASuppliedModel() { - var _this4 = this; + var _this9 = this; this.owner.register('controller:post', _emberRuntime.Controller.extend()); this.registerTemplate('post', '

    {{model.title}}

    '); expectDeprecation(function () { - _this4.render('

    HI

    {{render \'post\' post}}', { + _this9.render('

    HI

    {{render \'post\' post}}', { post: { title: 'It\'s Simple Made Easy' } @@ -30887,26 +30291,26 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember this.assertText('HIIt\'s Simple Made Easy'); this.runTask(function () { - return _this4.rerender(); + return _this9.rerender(); }); this.assertText('HIIt\'s Simple Made Easy'); this.runTask(function () { - return _emberMetal.set(_this4.context, 'post.title', 'Rails is omakase'); + return _emberMetal.set(_this9.context, 'post.title', 'Rails is omakase'); }); this.assertText('HIRails is omakase'); this.runTask(function () { - return _emberMetal.set(_this4.context, 'post', { title: 'It\'s Simple Made Easy' }); + return _emberMetal.set(_this9.context, 'post', { title: 'It\'s Simple Made Easy' }); }); this.assertText('HIIt\'s Simple Made Easy'); }; _class.prototype['@test should destroy the non-singleton controllers on teardown'] = function testShouldDestroyTheNonSingletonControllersOnTeardown(assert) { - var _this5 = this; + var _this10 = this; var willDestroyFired = 0; @@ -30920,7 +30324,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember this.registerTemplate('post', '

    {{model.title}}

    '); expectDeprecation(function () { - _this5.render('{{#if showPost}}{{render \'post\' post}}{{else}}Nothing here{{/if}}', { + _this10.render('{{#if showPost}}{{render \'post\' post}}{{else}}Nothing here{{/if}}', { showPost: false, post: { title: 'It\'s Simple Made Easy' @@ -30933,7 +30337,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); this.runTask(function () { - return _this5.rerender(); + return _this10.rerender(); }); this.assertText('Nothing here'); @@ -30941,7 +30345,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); this.runTask(function () { - return _emberMetal.set(_this5.context, 'showPost', true); + return _emberMetal.set(_this10.context, 'showPost', true); }); this.assertText('It\'s Simple Made Easy'); @@ -30949,7 +30353,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); this.runTask(function () { - return _emberMetal.set(_this5.context, 'showPost', false); + return _emberMetal.set(_this10.context, 'showPost', false); }); this.assertText('Nothing here'); @@ -30957,7 +30361,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember assert.strictEqual(willDestroyFired, 1, 'it did destroy the controller'); this.runTask(function () { - return _emberMetal.set(_this5.context, 'showPost', true); + return _emberMetal.set(_this10.context, 'showPost', true); }); this.assertText('It\'s Simple Made Easy'); @@ -30965,7 +30369,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember assert.strictEqual(willDestroyFired, 1, 'it did not destroy the controller'); this.runTask(function () { - return _emberMetal.set(_this5.context, 'showPost', false); + return _emberMetal.set(_this10.context, 'showPost', false); }); this.assertText('Nothing here'); @@ -30974,14 +30378,14 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember }; _class.prototype['@test with a supplied model should not fire observers on the controller'] = function testWithASuppliedModelShouldNotFireObserversOnTheController() { - var _this6 = this; + var _this11 = this; this.owner.register('controller:post', _emberRuntime.Controller.extend()); this.registerTemplate('post', '

    {{model.title}}

    '); var postDidChange = 0; expectDeprecation(function () { - _this6.render('

    HI

    {{render \'post\' post}}', { + _this11.render('

    HI

    {{render \'post\' post}}', { postDidChange: _emberMetal.observer('post', function () { postDidChange++; }), @@ -30994,24 +30398,27 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember this.assertText('HIIt\'s Simple Made Easy'); this.runTask(function () { - return _this6.rerender(); + return _this11.rerender(); }); this.assertText('HIIt\'s Simple Made Easy'); }; _class.prototype['@test should raise an error when a given controller name does not resolve to a controller'] = function testShouldRaiseAnErrorWhenAGivenControllerNameDoesNotResolveToAController() { - var _this7 = this; + var _this12 = this; this.registerTemplate('home', '

    BYE

    '); this.owner.register('controller:posts', _emberRuntime.Controller.extend()); - expectAssertion(function () { - _this7.render('

    HI

    {{render "home" controller="postss"}}'); - }, /The controller name you supplied \'postss\' did not resolve to a controller./); + + expectDeprecation(function () { + expectAssertion(function () { + _this12.render('

    HI

    {{render "home" controller="postss"}}'); + }, /The controller name you supplied \'postss\' did not resolve to a controller./); + }, /Please refactor [\w\{\}"` ]+ to a component/); }; _class.prototype['@test should render with given controller'] = function testShouldRenderWithGivenController(assert) { - var _this8 = this; + var _this13 = this; this.registerTemplate('home', '{{uniqueId}}'); @@ -31026,7 +30433,10 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember } })); - this.render('{{render "home" controller="posts"}}'); + expectDeprecation(function () { + _this13.render('{{render "home" controller="posts"}}'); + }, /Please refactor [\w\{\}"` ]+ to a component/); + var renderedController = this.owner.lookup('controller:posts'); var uniqueId = renderedController.get('uniqueId'); var renderedModel = renderedController.get('model'); @@ -31036,7 +30446,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember this.assertText('0'); this.runTask(function () { - return _this8.rerender(); + return _this13.rerender(); }); assert.equal(uniqueId, 0); @@ -31045,13 +30455,13 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember }; _class.prototype['@test should render templates with models multiple times'] = function testShouldRenderTemplatesWithModelsMultipleTimes(assert) { - var _this9 = this; + var _this14 = this; this.owner.register('controller:post', _emberRuntime.Controller.extend()); this.registerTemplate('post', '

    {{model.title}}

    '); expectDeprecation(function () { - _this9.render('

    HI

    {{render \'post\' post1}} {{render \'post\' post2}}', { + _this14.render('

    HI

    {{render \'post\' post1}} {{render \'post\' post2}}', { post1: { title: 'Me First' }, @@ -31064,32 +30474,32 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember this.assertText('HI Me First Then me'); this.runTask(function () { - return _this9.rerender(); + return _this14.rerender(); }); this.assertText('HI Me First Then me'); this.runTask(function () { - return _emberMetal.set(_this9.context, 'post1.title', 'I am new'); + return _emberMetal.set(_this14.context, 'post1.title', 'I am new'); }); this.assertText('HI I am new Then me'); this.runTask(function () { - return _emberMetal.set(_this9.context, 'post1', { title: 'Me First' }); + return _emberMetal.set(_this14.context, 'post1', { title: 'Me First' }); }); this.assertText('HI Me First Then me'); }; _class.prototype['@test should not treat invocations with falsy contexts as context-less'] = function testShouldNotTreatInvocationsWithFalsyContextsAsContextLess(assert) { - var _this10 = this; + var _this15 = this; this.registerTemplate('post', '

    {{#unless model.zero}}NOTHING{{/unless}}

    '); this.owner.register('controller:post', _emberRuntime.Controller.extend()); expectDeprecation(function () { - _this10.render('

    HI

    {{render \'post\' zero}} {{render \'post\' nonexistent}}', { + _this15.render('

    HI

    {{render \'post\' zero}} {{render \'post\' nonexistent}}', { model: { zero: false } @@ -31100,7 +30510,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember }; _class.prototype['@test should render templates both with and without models'] = function testShouldRenderTemplatesBothWithAndWithoutModels(assert) { - var _this11 = this; + var _this16 = this; this.registerTemplate('post', '

    Title:{{model.title}}

    '); this.owner.register('controller:post', _emberRuntime.Controller.extend()); @@ -31109,7 +30519,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember title: 'Rails is omakase' }; expectDeprecation(function () { - _this11.render('

    HI

    {{render \'post\'}} {{render \'post\' post}}', { + _this16.render('

    HI

    {{render \'post\'}} {{render \'post\' post}}', { post: post }); }, /Please refactor [\w\{\}"` ]+ to a component/); @@ -31117,25 +30527,27 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember assert.ok(this.$().text().match(/^HI ?Title: ?Title:Rails is omakase$/)); this.runTask(function () { - return _this11.rerender(); + return _this16.rerender(); }); assert.ok(this.$().text().match(/^HI ?Title: ?Title:Rails is omakase$/)); this.runTask(function () { - return _emberMetal.set(_this11.context, 'post.title', 'Simple Made Easy'); + return _emberMetal.set(_this16.context, 'post.title', 'Simple Made Easy'); }); assert.ok(this.$().text().match(/^HI ?Title: ?Title:Simple Made Easy$/)); this.runTask(function () { - return _emberMetal.set(_this11.context, 'post', { title: 'Rails is omakase' }); + return _emberMetal.set(_this16.context, 'post', { title: 'Rails is omakase' }); }); assert.ok(this.$().text().match(/^HI ?Title: ?Title:Rails is omakase$/)); }; _class.prototype['@test works with dot notation'] = function testWorksWithDotNotation() { + var _this17 = this; + this.registerTemplate('blog.post', '{{uniqueId}}'); var id = 0; @@ -31146,27 +30558,29 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember } })); - this.render('{{render "blog.post"}}'); + expectDeprecation(function () { + _this17.render('{{render "blog.post"}}'); + }, /Please refactor [\w\.{\}"` ]+ to a component/); this.assertText('0'); }; _class.prototype['@test throws an assertion if called with an unquoted template name'] = function testThrowsAnAssertionIfCalledWithAnUnquotedTemplateName() { - var _this12 = this; + var _this18 = this; this.registerTemplate('home', '

    BYE

    '); expectAssertion(function () { - _this12.render('

    HI

    {{render home}}'); + _this18.render('

    HI

    {{render home}}'); }, 'The first argument of {{render}} must be quoted, e.g. {{render "sidebar"}}.'); }; _class.prototype['@test throws an assertion if called with a literal for a model'] = function testThrowsAnAssertionIfCalledWithALiteralForAModel() { - var _this13 = this; + var _this19 = this; this.registerTemplate('home', '

    BYE

    '); expectAssertion(function () { - _this13.render('

    HI

    {{render "home" "model"}}', { + _this19.render('

    HI

    {{render "home" "model"}}', { model: { title: 'Simple Made Easy' } @@ -31175,7 +30589,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember }; _class.prototype['@test should set router as target when action not found on parentController is not found'] = function testShouldSetRouterAsTargetWhenActionNotFoundOnParentControllerIsNotFound(assert) { - var _this14 = this; + var _this20 = this; var postController = undefined; this.registerTemplate('post', 'post template'); @@ -31196,30 +30610,52 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember this.owner.register('router:main', routerStub, { instantiate: false }); expectDeprecation(function () { - _this14.render('{{render \'post\' post1}}'); + _this20.render('{{render \'post\' post1}}'); }, /Please refactor [\w\{\}"` ]+ to a component/); postController.send('someAction'); }; + _class.prototype['@test render helper emits useful backtracking re-render assertion message'] = function testRenderHelperEmitsUsefulBacktrackingReRenderAssertionMessage(assert) { + var _this21 = this; + + this.owner.register('controller:outer', _emberRuntime.Controller.extend()); + this.owner.register('controller:inner', _emberRuntime.Controller.extend({ + propertyWithError: _emberMetal.computed(function () { + this.set('model.name', 'this will cause a backtracking error'); + return 'foo'; + }) + })); + + var expectedBacktrackingMessage = /modified "model\.name" twice on \[object Object\] in a single render\. It was rendered in "controller:outer \(with the render helper\)" and modified in "controller:inner \(with the render helper\)"/; + + expectDeprecation(function () { + var person = { name: 'Ben' }; + + _this21.registerTemplate('outer', 'Hi {{model.name}} | {{render \'inner\' model}}'); + _this21.registerTemplate('inner', 'Hi {{propertyWithError}}'); + + if (true) { + expectDeprecation(expectedBacktrackingMessage); + _this21.render('{{render \'outer\' person}}', { person: person }); + } else { + expectAssertion(function () { + _this21.render('{{render \'outer\' person}}', { person: person }); + }, expectedBacktrackingMessage); + } + }); + }; + return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/render-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/render-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/render-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/render-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/render-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/render-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/render-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/render-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/render-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/text-area-test', ['exports', 'ember-utils', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/test-helpers', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberUtils, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsTestHelpers, _emberGlimmerTestsUtilsAbstractTestCase) { @@ -31437,21 +30873,13 @@ enifed('ember-glimmer/tests/integration/helpers/text-area-test', ['exports', 'em return _class; })(TextAreaRenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/text-area-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/text-area-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/text-area-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/text-area-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/text-area-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/text-area-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/text-area-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/text-area-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/text-area-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/unbound-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-runtime'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberRuntime) { @@ -32196,21 +31624,13 @@ babelHelpers.classCallCheck(this, _class); return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/unbound-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/unbound-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/unbound-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/unbound-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/unbound-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/unbound-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/unbound-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/unbound-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/unbound-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/yield-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal, _emberGlimmerTestsUtilsHelpers) { @@ -32513,21 +31933,13 @@ enifed('ember-glimmer/tests/integration/helpers/yield-test', ['exports', 'ember- return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/yield-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/yield-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/yield-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/yield-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/yield-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/yield-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/yield-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/yield-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/yield-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/input-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal) { @@ -32783,21 +32195,13 @@ enifed('ember-glimmer/tests/integration/input-test', ['exports', 'ember-glimmer/ return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/input-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration'); - test('ember-glimmer/tests/integration/input-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/input-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/input-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/input-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration'); - QUnit.test('ember-glimmer/tests/integration/input-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/input-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/input-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/input-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/mount-test', ['exports', 'ember-utils', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-runtime', 'ember-metal', 'ember-application'], function (exports, _emberUtils, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberRuntime, _emberMetal, _emberApplication) { @@ -32904,24 +32308,53 @@ enifed('ember-glimmer/tests/integration/mount-test', ['exports', 'ember-utils', }); }; + _class2.prototype['@test it emits a useful backtracking re-render assertion message'] = function testItEmitsAUsefulBacktrackingReRenderAssertionMessage(assert) { + var _this6 = this; + + this.router.map(function () { + this.route('route-with-mount'); + }); + + this.registerTemplate('index', ''); + this.registerTemplate('route-with-mount', '{{mount "chat"}}'); + + this.engineRegistrations['template:application'] = _emberGlimmerTestsUtilsHelpers.compile('hi {{person.name}} [{{component-with-backtracking-set person=person}}]', { moduleName: 'application' }); + this.engineRegistrations['controller:application'] = _emberRuntime.Controller.extend({ + person: { name: 'Alex' } + }); + + this.engineRegistrations['template:components/component-with-backtracking-set'] = _emberGlimmerTestsUtilsHelpers.compile('[component {{person.name}}]', { moduleName: 'components/component-with-backtracking-set' }); + this.engineRegistrations['component:component-with-backtracking-set'] = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + this.set('person.name', 'Ben'); + } + }); + + var expectedBacktrackingMessage = /modified "person\.name" twice on \[object Object\] in a single render\. It was rendered in "template:route-with-mount" \(in "engine:chat"\) and modified in "component:component-with-backtracking-set" \(in "engine:chat"\)/; + + if (true) { + expectDeprecation(expectedBacktrackingMessage); + return this.visit('/route-with-mount'); + } else { + return this.visit('/').then(function () { + expectAssertion(function () { + _this6.visit('/route-with-mount'); + }, expectedBacktrackingMessage); + }); + } + }; + return _class2; })(_emberGlimmerTestsUtilsTestCase.ApplicationTest)); }); -enifed('ember-glimmer/tests/integration/mount-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/mount-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration'); - test('ember-glimmer/tests/integration/mount-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/mount-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/mount-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration'); - QUnit.test('ember-glimmer/tests/integration/mount-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/mount-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/mount-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/mount-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/outlet-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'internal-test-helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _internalTestHelpers, _emberMetal) { @@ -32935,7 +32368,13 @@ enifed('ember-glimmer/tests/integration/outlet-test', ['exports', 'ember-glimmer _RenderingTest.apply(this, arguments); - var CoreOutlet = this.owner._lookupFactory('view:-outlet'); + var CoreOutlet = undefined; + if (true) { + CoreOutlet = this.owner.factoryFor('view:-outlet'); + } else { + CoreOutlet = this.owner._lookupFactory('view:-outlet'); + } + this.component = CoreOutlet.create(); } @@ -33301,21 +32740,13 @@ enifed('ember-glimmer/tests/integration/outlet-test', ['exports', 'ember-glimmer return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/outlet-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/outlet-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration'); - test('ember-glimmer/tests/integration/outlet-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/outlet-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/outlet-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration'); - QUnit.test('ember-glimmer/tests/integration/outlet-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/outlet-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/outlet-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/outlet-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/refinements-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberMetal) { @@ -33359,21 +32790,13 @@ babelHelpers.classCallCheck(this, _class); return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/refinements-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/refinements-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration'); - test('ember-glimmer/tests/integration/refinements-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/refinements-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/refinements-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration'); - QUnit.test('ember-glimmer/tests/integration/refinements-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/refinements-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/refinements-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/refinements-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/svg-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase) { @@ -33523,21 +32946,13 @@ babelHelpers.classCallCheck(this, _class); return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/svg-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration'); - test('ember-glimmer/tests/integration/svg-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/svg-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/svg-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/svg-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration'); - QUnit.test('ember-glimmer/tests/integration/svg-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/svg-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/svg-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/svg-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/syntax/each-in-test', ['exports', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-runtime', 'ember-glimmer/tests/utils/shared-conditional-tests'], function (exports, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberRuntime, _emberGlimmerTestsUtilsSharedConditionalTests) { @@ -33888,6 +33303,18 @@ babelHelpers.classCallCheck(this, _class); this.assertText('[0:1][1:2][2:3][foo:bar]'); }; + _class.prototype['@test it skips holes in sparse arrays'] = function testItSkipsHolesInSparseArrays(assert) { + var arr = []; + arr[5] = 'foo'; + arr[6] = 'bar'; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject14), { arr: arr }); + + this.assertText('[5:foo][6:bar]'); + + this.assertStableRerender(); + }; + babelHelpers.createClass(_class, [{ key: 'truthyValue', get: function () { @@ -34023,21 +33450,13 @@ babelHelpers.createClass(_class3, [{ return _class3; })(EachInProxyTest)); }); -enifed('ember-glimmer/tests/integration/syntax/each-in-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/syntax'); - test('ember-glimmer/tests/integration/syntax/each-in-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/syntax/each-in-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/syntax/each-in-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/syntax/each-in-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/syntax'); - QUnit.test('ember-glimmer/tests/integration/syntax/each-in-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/syntax/each-in-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/syntax/each-in-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/syntax/each-in-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/syntax/each-test', ['exports', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-runtime', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/shared-conditional-tests'], function (exports, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberRuntime, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsSharedConditionalTests) { @@ -34046,10 +33465,11 @@ enifed('ember-glimmer/tests/integration/syntax/each-test', ['exports', 'ember-me var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each list as |item|}}\n
  • Prev
  • \n {{foo-bar item=item}}\n
  • Next
  • \n {{/each}}\n '], ['\n {{#each list as |item|}}\n
  • Prev
  • \n {{foo-bar item=item}}\n
  • Next
  • \n {{/each}}\n ']), _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each content as |value|}}\n {{value}}-\n {{#each options as |option|}}\n {{option.value}}:{{option.label}}\n {{/each}}\n {{/each}}\n '], ['\n {{#each content as |value|}}\n {{value}}-\n {{#each options as |option|}}\n {{option.value}}:{{option.label}}\n {{/each}}\n {{/each}}\n ']), _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each foo.bar.baz as |thing|}}\n {{thing}}\n {{/each}}'], ['\n {{#each foo.bar.baz as |thing|}}\n {{thing}}\n {{/each}}']), - _templateObject4 = babelHelpers.taggedTemplateLiteralLoose(['\n

    {{page.title}}

    \n\n
      \n {{#each model as |post|}}\n
    • {{post.title}}
    • \n {{/each}}\n
    \n '], ['\n

    {{page.title}}

    \n\n
      \n {{#each model as |post|}}\n
    • {{post.title}}
    • \n {{/each}}\n
    \n ']), - _templateObject5 = babelHelpers.taggedTemplateLiteralLoose(['\n

    Blog Posts

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n '], ['\n

    Blog Posts

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n ']), - _templateObject6 = babelHelpers.taggedTemplateLiteralLoose(['\n

    Essays

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n '], ['\n

    Essays

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n ']), - _templateObject7 = babelHelpers.taggedTemplateLiteralLoose(['\n

    Think Pieces™

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n '], ['\n

    Think Pieces™

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n ']); + _templateObject4 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each list as |value key|}}\n [{{key}}:{{value}}]\n {{/each}}'], ['\n {{#each list as |value key|}}\n [{{key}}:{{value}}]\n {{/each}}']), + _templateObject5 = babelHelpers.taggedTemplateLiteralLoose(['\n

    {{page.title}}

    \n\n
      \n {{#each model as |post|}}\n
    • {{post.title}}
    • \n {{/each}}\n
    \n '], ['\n

    {{page.title}}

    \n\n
      \n {{#each model as |post|}}\n
    • {{post.title}}
    • \n {{/each}}\n
    \n ']), + _templateObject6 = babelHelpers.taggedTemplateLiteralLoose(['\n

    Blog Posts

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n '], ['\n

    Blog Posts

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n ']), + _templateObject7 = babelHelpers.taggedTemplateLiteralLoose(['\n

    Essays

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n '], ['\n

    Essays

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n ']), + _templateObject8 = babelHelpers.taggedTemplateLiteralLoose(['\n

    Think Pieces™

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n '], ['\n

    Think Pieces™

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n ']); var ArrayLike = (function () { function ArrayLike(content) { @@ -35225,97 +34645,122 @@ babelHelpers.classCallCheck(this, _class10); return _class10; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); - /* globals MutationObserver: false */ - if (typeof MutationObserver === 'function') { - _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#each as}} DOM mutation test', (function (_RenderingTest4) { + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#each}} with sparse arrays', (function (_RenderingTest4) { babelHelpers.inherits(_class11, _RenderingTest4); - function _class11() { + function _class11() { babelHelpers.classCallCheck(this, _class11); - _RenderingTest4.call(this); + _RenderingTest4.apply(this, arguments); + } + + _class11.prototype['@test it should itterate over holes'] = function testItShouldItterateOverHoles(assert) { + var _this26 = this; + + var sparseArray = []; + sparseArray[3] = 'foo'; + sparseArray[4] = 'bar'; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4), { list: _emberRuntime.A(sparseArray) }); + + this.assertText('[0:][1:][2:][3:foo][4:bar]'); + + this.assertStableRerender(); + + this.runTask(function () { + var list = _emberMetal.get(_this26.context, 'list'); + list.pushObject('baz'); + }); + + this.assertText('[0:][1:][2:][3:foo][4:bar][5:baz]'); + }; + + return _class11; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + + /* globals MutationObserver: false */ + if (typeof MutationObserver === 'function') { + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#each as}} DOM mutation test', (function (_RenderingTest5) { +babelHelpers.inherits(_class12, _RenderingTest5); + + function _class12() { +babelHelpers.classCallCheck(this, _class12); + + _RenderingTest5.call(this); this.observer = null; } - _class11.prototype.observe = function observe(element) { + _class12.prototype.observe = function observe(element) { var observer = this.observer = new MutationObserver(function () {}); observer.observe(element, { childList: true, characterData: true }); }; - _class11.prototype.teardown = function teardown() { + _class12.prototype.teardown = function teardown() { if (this.observer) { this.observer.disconnect(); } - _RenderingTest4.prototype.teardown.call(this); + _RenderingTest5.prototype.teardown.call(this); }; - _class11.prototype.assertNoMutation = function assertNoMutation() { + _class12.prototype.assertNoMutation = function assertNoMutation() { this.assert.deepEqual(this.observer.takeRecords(), [], 'Expected no mutations'); }; - _class11.prototype.expectMutations = function expectMutations() { + _class12.prototype.expectMutations = function expectMutations() { this.assert.ok(this.observer.takeRecords().length > 0, 'Expected some mutations'); }; - _class11.prototype['@test {{#each}} should not mutate a subtree when the array has not changed [GH #14332]'] = function testEachShouldNotMutateASubtreeWhenTheArrayHasNotChangedGH14332(assert) { - var _this26 = this; + _class12.prototype['@test {{#each}} should not mutate a subtree when the array has not changed [GH #14332]'] = function testEachShouldNotMutateASubtreeWhenTheArrayHasNotChangedGH14332(assert) { + var _this27 = this; var page = { title: 'Blog Posts' }; var model = [{ title: 'Rails is omakase' }, { title: 'Ember is omakase' }]; - this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4), { page: page, model: model }); + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5), { page: page, model: model }); - this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5)); + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject6)); this.observe(this.$('#posts')[0]); // MutationObserver is async return _emberRuntime.RSVP.Promise.resolve(function () { - _this26.assertStableRerender(); + _this27.assertStableRerender(); }).then(function () { - _this26.assertNoMutation(); + _this27.assertNoMutation(); - _this26.runTask(function () { - return _emberMetal.set(_this26.context, 'page', { title: 'Essays' }); + _this27.runTask(function () { + return _emberMetal.set(_this27.context, 'page', { title: 'Essays' }); }); - _this26.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject6)); + _this27.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject7)); }).then(function () { - _this26.assertNoMutation(); + _this27.assertNoMutation(); - _this26.runTask(function () { - return _emberMetal.set(_this26.context.page, 'title', 'Think Pieces™'); + _this27.runTask(function () { + return _emberMetal.set(_this27.context.page, 'title', 'Think Pieces™'); }); - _this26.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject7)); + _this27.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject8)); }).then(function () { // The last set is localized to the `page` object, so we do not expect Glimmer // to re-iterate the list - _this26.assertNoMutation(); + _this27.assertNoMutation(); }); }; - return _class11; + return _class12; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); } }); -enifed('ember-glimmer/tests/integration/syntax/each-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/syntax/each-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/syntax'); - test('ember-glimmer/tests/integration/syntax/each-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/syntax/each-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/syntax/each-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/syntax'); - QUnit.test('ember-glimmer/tests/integration/syntax/each-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/syntax/each-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/syntax/each-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/syntax/each-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/syntax/if-unless-test', ['exports', 'ember-glimmer/tests/utils/helpers', 'ember-runtime', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/shared-conditional-tests'], function (exports, _emberGlimmerTestsUtilsHelpers, _emberRuntime, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsSharedConditionalTests) { @@ -35461,21 +34906,13 @@ babelHelpers.classCallCheck(this, _class4); return _class4; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/syntax/if-unless-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/syntax/if-unless-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/syntax'); - test('ember-glimmer/tests/integration/syntax/if-unless-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/syntax/if-unless-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/syntax/if-unless-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/syntax'); - QUnit.test('ember-glimmer/tests/integration/syntax/if-unless-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/syntax/if-unless-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/syntax/if-unless-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/syntax/if-unless-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/syntax/in-element-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/test-helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/component', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsTestHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerComponent, _emberMetal) { @@ -35589,21 +35026,13 @@ babelHelpers.classCallCheck(this, _class); return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/syntax/in-element-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/syntax'); - test('ember-glimmer/tests/integration/syntax/in-element-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/syntax/in-element-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/syntax/in-element-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/syntax/in-element-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/syntax'); - QUnit.test('ember-glimmer/tests/integration/syntax/in-element-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/syntax/in-element-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/syntax/in-element-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/syntax/in-element-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/syntax/with-dynamic-var-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase) { @@ -35649,21 +35078,13 @@ babelHelpers.classCallCheck(this, _class); return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/syntax/with-dynamic-var-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/syntax/with-dynamic-var-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/syntax'); - test('ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/syntax/with-dynamic-var-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/syntax'); - QUnit.test('ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/syntax/with-test', ['exports', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/shared-conditional-tests', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberMetal, _emberRuntime, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsSharedConditionalTests, _emberGlimmerTestsUtilsAbstractTestCase) { @@ -36173,24 +35594,16 @@ babelHelpers.classCallCheck(this, _class3); return _class3; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/syntax/with-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/syntax'); - test('ember-glimmer/tests/integration/syntax/with-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/syntax/with-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/syntax/with-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/syntax/with-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/syntax'); - QUnit.test('ember-glimmer/tests/integration/syntax/with-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/syntax/with-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/syntax/with-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/syntax/with-test.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/tests/unit/layout-cache-test', ['exports', 'ember-utils', 'ember-glimmer/tests/utils/test-case', 'glimmer-runtime'], function (exports, _emberUtils, _emberGlimmerTestsUtilsTestCase, _glimmerRuntime) { +enifed('ember-glimmer/tests/unit/layout-cache-test', ['exports', 'ember-utils', 'ember-glimmer/tests/utils/test-case', '@glimmer/runtime'], function (exports, _emberUtils, _emberGlimmerTestsUtilsTestCase, _glimmerRuntime) { 'use strict'; var Counter = (function () { @@ -36370,21 +35783,13 @@ enifed('ember-glimmer/tests/unit/layout-cache-test', ['exports', 'ember-utils', return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/unit/layout-cache-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/unit'); - test('ember-glimmer/tests/unit/layout-cache-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/unit/layout-cache-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/unit/layout-cache-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/unit/layout-cache-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/unit'); - QUnit.test('ember-glimmer/tests/unit/layout-cache-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/unit/layout-cache-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/unit/layout-cache-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/unit/layout-cache-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/unit/outlet-test', ['exports', 'ember-glimmer/views/outlet', 'ember-metal'], function (exports, _emberGlimmerViewsOutlet, _emberMetal) { @@ -36420,21 +35825,13 @@ enifed('ember-glimmer/tests/unit/outlet-test', ['exports', 'ember-glimmer/views/ }); }); }); -enifed('ember-glimmer/tests/unit/outlet-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/unit/outlet-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/unit'); - test('ember-glimmer/tests/unit/outlet-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/unit/outlet-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/unit/outlet-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/unit'); - QUnit.test('ember-glimmer/tests/unit/outlet-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/unit/outlet-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/unit/outlet-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/unit/outlet-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/unit/template-factory-test', ['exports', 'ember-template-compiler', 'ember-glimmer/index', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberTemplateCompiler, _emberGlimmerIndex, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers) { @@ -36509,45 +35906,289 @@ enifed('ember-glimmer/tests/unit/template-factory-test', ['exports', 'ember-temp return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/unit/template-factory-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/unit/template-factory-test.lint-test', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('ESLint | ember-glimmer/tests/unit/template-factory-test.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/unit/template-factory-test.js should pass ESLint\n\n'); + }); +}); +enifed('ember-glimmer/tests/unit/utils/debug-stack-test', ['exports', 'ember-glimmer/utils/debug-stack', 'ember-metal'], function (exports, _emberGlimmerUtilsDebugStack, _emberMetal) { 'use strict'; - module('JSCS - ember-glimmer/tests/unit'); - test('ember-glimmer/tests/unit/template-factory-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/unit/template-factory-test.js should pass jscs.'); + _emberMetal.runInDebug(function () { + QUnit.module('Glimmer DebugStack'); + + QUnit.test('pushing and popping', function (assert) { + var stack = new _emberGlimmerUtilsDebugStack.default(); + + assert.equal(stack.peek(), undefined); + + stack.push('template:application'); + + assert.equal(stack.peek(), '"template:application"'); + + stack.push('component:top-level-component'); + + assert.equal(stack.peek(), '"component:top-level-component"'); + + stack.pushEngine('engine:my-engine'); + stack.push('component:component-in-engine'); + + assert.equal(stack.peek(), '"component:component-in-engine" (in "engine:my-engine")'); + + stack.pop(); + stack.pop(); + var item = stack.pop(); + + assert.equal(item, 'component:top-level-component'); + assert.equal(stack.peek(), '"template:application"'); + }); }); }); -enifed('ember-glimmer/tests/unit/template-factory-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/unit/utils/debug-stack-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/unit'); - QUnit.test('ember-glimmer/tests/unit/template-factory-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/unit/utils/debug-stack-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/unit/template-factory-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/unit/utils/debug-stack-test.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/tests/utils/abstract-test-case', ['exports', 'internal-test-helpers'], function (exports, _internalTestHelpers) { +enifed('ember-glimmer/tests/unit/utils/iterable-test', ['exports', 'ember', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/utils/iterable', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/each-in', '@glimmer/runtime'], function (exports, _ember, _emberGlimmerTestsUtilsTestCase, _emberGlimmerUtilsIterable, _emberGlimmerUtilsReferences, _emberGlimmerHelpersEachIn, _glimmerRuntime) { 'use strict'; - exports.TestCase = _internalTestHelpers.AbstractTestCase; - exports.applyMixins = _internalTestHelpers.applyMixins; - exports.strip = _internalTestHelpers.strip; + var ITERATOR_KEY_GUID = 'be277757-bbbe-4620-9fcb-213ef433cca2'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Iterable', (function (_TestCase) { + babelHelpers.inherits(_class, _TestCase); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _TestCase.apply(this, arguments); + } + + _class.prototype['@test iterates over an array'] = function testIteratesOverAnArray() { + var iterator = iteratorForArray(['foo', 'bar']); + + this.assert.deepEqual(iterator.next(), { key: 'foo', memo: 0, value: 'foo' }); + this.assert.deepEqual(iterator.next(), { key: 'bar', memo: 1, value: 'bar' }); + }; + + _class.prototype['@test iterates over an `Ember.A`'] = function testIteratesOverAnEmberA() { + var iterator = iteratorForArray(_ember.default.A(['foo', 'bar'])); + + this.assert.deepEqual(iterator.next(), { key: 'foo', memo: 0, value: 'foo' }); + this.assert.deepEqual(iterator.next(), { key: 'bar', memo: 1, value: 'bar' }); + }; + + _class.prototype['@test returns `null` when out of items'] = function testReturnsNullWhenOutOfItems() { + var iterator = iteratorForArray(['foo']); + + this.assert.deepEqual(iterator.next(), { key: 'foo', memo: 0, value: 'foo' }); + this.assert.deepEqual(iterator.next(), null); + }; + + _class.prototype['@test iterates over an array with indices as keys'] = function testIteratesOverAnArrayWithIndicesAsKeys() { + var iterator = iteratorForArray(['foo', 'bar'], '@index'); + + this.assert.deepEqual(iterator.next(), { key: '0', memo: 0, value: 'foo' }); + this.assert.deepEqual(iterator.next(), { key: '1', memo: 1, value: 'bar' }); + }; + + _class.prototype['@test iterates over an array with identities as keys'] = function testIteratesOverAnArrayWithIdentitiesAsKeys() { + var iterator = iteratorForArray(['foo', 'bar'], '@identity'); + + this.assert.deepEqual(iterator.next(), { key: 'foo', memo: 0, value: 'foo' }); + this.assert.deepEqual(iterator.next(), { key: 'bar', memo: 1, value: 'bar' }); + }; + + _class.prototype['@test iterates over an array with arbitrary properties as keys'] = function testIteratesOverAnArrayWithArbitraryPropertiesAsKeys() { + var iterator = iteratorForArray([{ k: 'first', v: 'foo' }, { k: 'second', v: 'bar' }], 'k'); + + this.assert.deepEqual(iterator.next(), { key: 'first', memo: 0, value: { k: 'first', v: 'foo' } }); + this.assert.deepEqual(iterator.next(), { key: 'second', memo: 1, value: { k: 'second', v: 'bar' } }); + }; + + _class.prototype['@test errors on `#next` with an undefined ref'] = function testErrorsOnNextWithAnUndefinedRef() { + var iterator = iteratorForArray(undefined); + + this.assert.expect(1); + + try { + iterator.next(); + } catch (_ref) { + var _message = _ref.message; + + this.assert.equal(_message, 'Cannot call next() on an empty iterator'); + } + }; + + _class.prototype['@test errors on `#next` with a null ref'] = function testErrorsOnNextWithANullRef() { + var iterator = iteratorForArray(null); + + this.assert.expect(1); + + try { + iterator.next(); + } catch (_ref2) { + var _message2 = _ref2.message; + + this.assert.equal(_message2, 'Cannot call next() on an empty iterator'); + } + }; + + _class.prototype['@test errors on `#next` with an invalid ref type'] = function testErrorsOnNextWithAnInvalidRefType() { + var iterator = iteratorForArray('string'); + + this.assert.expect(1); + + try { + iterator.next(); + } catch (_ref3) { + var _message3 = _ref3.message; + + this.assert.equal(_message3, 'Cannot call next() on an empty iterator'); + } + }; + + _class.prototype['@test errors on `#next` with an empty array'] = function testErrorsOnNextWithAnEmptyArray() { + var iterator = iteratorForArray([]); + + this.assert.expect(1); + + try { + iterator.next(); + } catch (_ref4) { + var _message4 = _ref4.message; + + this.assert.equal(_message4, 'Cannot call next() on an empty iterator'); + } + }; + + _class.prototype['@test iterates over an object\'s own properties'] = function testIteratesOverAnObjectSOwnProperties() { + var iterator = iteratorForObject({ first: 'foo', second: 'bar' }); + + this.assert.deepEqual(iterator.next(), { key: 'first', memo: 'first', value: 'foo' }); + this.assert.deepEqual(iterator.next(), { key: 'second', memo: 'second', value: 'bar' }); + }; + + _class.prototype['@test iterates over an object\'s own properties with indices as keys'] = function testIteratesOverAnObjectSOwnPropertiesWithIndicesAsKeys() { + var iterator = iteratorForObject({ first: 'foo', second: 'bar' }, '@index'); + + this.assert.deepEqual(iterator.next(), { key: 'first', memo: 'first', value: 'foo' }); + this.assert.deepEqual(iterator.next(), { key: 'second', memo: 'second', value: 'bar' }); + }; + + _class.prototype['@test iterates over an object\'s own properties with identities as keys'] = function testIteratesOverAnObjectSOwnPropertiesWithIdentitiesAsKeys() { + var iterator = iteratorForObject({ first: 'foo', second: 'bar' }, '@identity'); + + this.assert.deepEqual(iterator.next(), { key: 'foo', memo: 'first', value: 'foo' }); + this.assert.deepEqual(iterator.next(), { key: 'bar', memo: 'second', value: 'bar' }); + }; + + _class.prototype['@test iterates over an object\'s own properties with arbitrary properties as keys'] = function testIteratesOverAnObjectSOwnPropertiesWithArbitraryPropertiesAsKeys() { + var iterator = iteratorForObject({ first: { k: 'uno', v: 'foo' }, second: { k: 'dos', v: 'bar' } }, 'k'); + + this.assert.deepEqual(iterator.next(), { key: 'uno', memo: 'first', value: { k: 'uno', v: 'foo' } }); + this.assert.deepEqual(iterator.next(), { key: 'dos', memo: 'second', value: { k: 'dos', v: 'bar' } }); + }; + + _class.prototype['@test each-in errors on `#next` with an undefined ref'] = function testEachInErrorsOnNextWithAnUndefinedRef() { + var iterator = iteratorForObject(undefined); + + this.assert.expect(1); + + try { + iterator.next(); + } catch (_ref5) { + var _message5 = _ref5.message; + + this.assert.equal(_message5, 'Cannot call next() on an empty iterator'); + } + }; + + _class.prototype['@test each-in errors on `#next` with a null ref'] = function testEachInErrorsOnNextWithANullRef() { + var iterator = iteratorForObject(null); + + this.assert.expect(1); + + try { + iterator.next(); + } catch (_ref6) { + var _message6 = _ref6.message; + + this.assert.equal(_message6, 'Cannot call next() on an empty iterator'); + } + }; + + _class.prototype['@test each-in errors on `#next` with an invalid ref type'] = function testEachInErrorsOnNextWithAnInvalidRefType() { + var iterator = iteratorForObject('string'); + + this.assert.expect(1); + + try { + iterator.next(); + } catch (_ref7) { + var _message7 = _ref7.message; + + this.assert.equal(_message7, 'Cannot call next() on an empty iterator'); + } + }; + + _class.prototype['@test ensures keys are unique'] = function testEnsuresKeysAreUnique() { + var iterator = iteratorForArray([{ k: 'qux', v: 'foo' }, { k: 'qux', v: 'bar' }, { k: 'qux', v: 'baz' }], 'k'); + + this.assert.deepEqual(iterator.next(), { key: 'qux', memo: 0, value: { k: 'qux', v: 'foo' } }); + this.assert.deepEqual(iterator.next(), { key: 'qux' + ITERATOR_KEY_GUID + '1', memo: 1, value: { k: 'qux', v: 'bar' } }); + this.assert.deepEqual(iterator.next(), { key: 'qux' + ITERATOR_KEY_GUID + '2', memo: 2, value: { k: 'qux', v: 'baz' } }); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.TestCase)); + + function iteratorForArray(arr, keyPath) { + var ref = new _emberGlimmerUtilsReferences.UpdatableReference(arr); + var iterable = _emberGlimmerUtilsIterable.default(ref, keyPath); + + return iterable.iterate(); + } + + function iteratorForObject(obj, keyPath) { + var vm = null; + var positionalArgs = _glimmerRuntime.EvaluatedPositionalArgs.create([new _emberGlimmerUtilsReferences.UpdatableReference(obj)]); + var ref = _emberGlimmerHelpersEachIn.default(vm, { positional: positionalArgs }); + var iterable = _emberGlimmerUtilsIterable.default(ref, keyPath); + + return iterable.iterate(); + } }); -enifed('ember-glimmer/tests/utils/abstract-test-case.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/unit/utils/iterable-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/utils'); - test('ember-glimmer/tests/utils/abstract-test-case.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/utils/abstract-test-case.js should pass jscs.'); + QUnit.module('ESLint | ember-glimmer/tests/unit/utils/iterable-test.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/unit/utils/iterable-test.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/tests/utils/abstract-test-case.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/utils/abstract-test-case', ['exports', 'internal-test-helpers'], function (exports, _internalTestHelpers) { + 'use strict'; + + exports.TestCase = _internalTestHelpers.AbstractTestCase; + exports.applyMixins = _internalTestHelpers.applyMixins; + exports.strip = _internalTestHelpers.strip; +}); +enifed('ember-glimmer/tests/utils/abstract-test-case.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/utils'); - QUnit.test('ember-glimmer/tests/utils/abstract-test-case.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/utils/abstract-test-case.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/utils/abstract-test-case.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/utils/abstract-test-case.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/utils/helpers', ['exports', 'ember-template-compiler', 'ember-glimmer'], function (exports, _emberTemplateCompiler, _emberGlimmer) { @@ -36570,21 +36211,13 @@ enifed('ember-glimmer/tests/utils/helpers', ['exports', 'ember-template-compiler exports.DOMChanges = _emberGlimmer.DOMChanges; exports.isHTMLSafe = _emberGlimmer.isHTMLSafe; }); -enifed('ember-glimmer/tests/utils/helpers.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/utils'); - test('ember-glimmer/tests/utils/helpers.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/utils/helpers.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/utils/helpers.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/utils/helpers.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/utils'); - QUnit.test('ember-glimmer/tests/utils/helpers.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/utils/helpers.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/utils/helpers.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/utils/helpers.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/utils/shared-conditional-tests', ['exports', 'ember-utils', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberUtils, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberMetal, _emberRuntime, _emberGlimmerTestsUtilsHelpers) { @@ -37693,24 +37326,16 @@ enifed('ember-glimmer/tests/utils/shared-conditional-tests', ['exports', 'ember- _emberGlimmerTestsUtilsAbstractTestCase.applyMixins.apply(undefined, [IfUnlessWithSyntaxTest].concat(IfUnlessWithTestCases)); }); -enifed('ember-glimmer/tests/utils/shared-conditional-tests.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/utils'); - test('ember-glimmer/tests/utils/shared-conditional-tests.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/utils/shared-conditional-tests.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/utils/shared-conditional-tests.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/utils/shared-conditional-tests.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/utils'); - QUnit.test('ember-glimmer/tests/utils/shared-conditional-tests.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/utils/shared-conditional-tests.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/utils/shared-conditional-tests.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/utils/shared-conditional-tests.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/tests/utils/string-test', ['exports', 'ember-glimmer/tests/utils/helpers', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case'], function (exports, _emberGlimmerTestsUtilsHelpers, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase) { +enifed('ember-glimmer/tests/utils/string-test', ['exports', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case'], function (exports, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase) { 'use strict'; _emberGlimmerTestsUtilsTestCase.moduleFor('SafeString', (function (_TestCase) { @@ -37745,49 +37370,39 @@ enifed('ember-glimmer/tests/utils/string-test', ['exports', 'ember-glimmer/tests return _class; })(_emberGlimmerTestsUtilsAbstractTestCase.TestCase)); - if (true) { - _emberGlimmerTestsUtilsTestCase.moduleFor('SafeString isHTMLSafe', (function (_TestCase2) { - babelHelpers.inherits(_class2, _TestCase2); - - function _class2() { - babelHelpers.classCallCheck(this, _class2); + _emberGlimmerTestsUtilsTestCase.moduleFor('SafeString isHTMLSafe', (function (_TestCase2) { + babelHelpers.inherits(_class2, _TestCase2); - _TestCase2.apply(this, arguments); - } + function _class2() { + babelHelpers.classCallCheck(this, _class2); - _class2.prototype['@test isHTMLSafe should detect SafeString'] = function testIsHTMLSafeShouldDetectSafeString() { - var safeString = _emberGlimmerTestsUtilsHelpers.htmlSafe('Emphasize the important things.'); + _TestCase2.apply(this, arguments); + } - this.assert.ok(_emberGlimmerTestsUtilsHelpers.isHTMLSafe(safeString)); - }; + _class2.prototype['@test isHTMLSafe should detect SafeString'] = function testIsHTMLSafeShouldDetectSafeString() { + var safeString = _emberGlimmerTestsUtilsHelpers.htmlSafe('Emphasize the important things.'); - _class2.prototype['@test isHTMLSafe should not detect SafeString on primatives'] = function testIsHTMLSafeShouldNotDetectSafeStringOnPrimatives() { - this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe('Hello World')); - this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe({})); - this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe([])); - this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe(10)); - this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe(null)); - }; + this.assert.ok(_emberGlimmerTestsUtilsHelpers.isHTMLSafe(safeString)); + }; - return _class2; - })(_emberGlimmerTestsUtilsAbstractTestCase.TestCase)); - } -}); -enifed('ember-glimmer/tests/utils/string-test.jscs-test', ['exports'], function (exports) { - 'use strict'; + _class2.prototype['@test isHTMLSafe should not detect SafeString on primatives'] = function testIsHTMLSafeShouldNotDetectSafeStringOnPrimatives() { + this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe('Hello World')); + this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe({})); + this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe([])); + this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe(10)); + this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe(null)); + }; - module('JSCS - ember-glimmer/tests/utils'); - test('ember-glimmer/tests/utils/string-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/utils/string-test.js should pass jscs.'); - }); + return _class2; + })(_emberGlimmerTestsUtilsAbstractTestCase.TestCase)); }); -enifed('ember-glimmer/tests/utils/string-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/utils/string-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/utils'); - QUnit.test('ember-glimmer/tests/utils/string-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/utils/string-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/utils/string-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/utils/string-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/utils/test-case', ['exports', 'internal-test-helpers'], function (exports, _internalTestHelpers) { @@ -37798,21 +37413,13 @@ enifed('ember-glimmer/tests/utils/test-case', ['exports', 'internal-test-helpers exports.RenderingTest = _internalTestHelpers.RenderingTestCase; exports.moduleFor = _internalTestHelpers.moduleFor; }); -enifed('ember-glimmer/tests/utils/test-case.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/utils'); - test('ember-glimmer/tests/utils/test-case.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/utils/test-case.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/utils/test-case.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/utils/test-case.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/utils'); - QUnit.test('ember-glimmer/tests/utils/test-case.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/utils/test-case.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/utils/test-case.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/utils/test-case.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/utils/test-helpers', ['exports', 'internal-test-helpers'], function (exports, _internalTestHelpers) { @@ -37823,854 +37430,463 @@ enifed('ember-glimmer/tests/utils/test-helpers', ['exports', 'internal-test-help exports.equalTokens = _internalTestHelpers.equalTokens; exports.equalsElement = _internalTestHelpers.equalsElement; }); -enifed('ember-glimmer/tests/utils/test-helpers.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/utils'); - test('ember-glimmer/tests/utils/test-helpers.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/utils/test-helpers.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/utils/test-helpers.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/utils/test-helpers.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/utils'); - QUnit.test('ember-glimmer/tests/utils/test-helpers.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/utils/test-helpers.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/utils/test-helpers.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/utils/test-helpers.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/utils/bindings.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/utils/bindings.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/utils'); - test('ember-glimmer/utils/bindings.js should pass jscs', function () { - ok(true, 'ember-glimmer/utils/bindings.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/utils/bindings.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/utils'); - QUnit.test('ember-glimmer/utils/bindings.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/utils/bindings.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/utils/bindings.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/utils/bindings.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/utils/iterable.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/utils/debug-stack.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/utils'); - test('ember-glimmer/utils/iterable.js should pass jscs', function () { - ok(true, 'ember-glimmer/utils/iterable.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/utils/iterable.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/utils'); - QUnit.test('ember-glimmer/utils/iterable.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/utils/debug-stack.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/utils/iterable.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/utils/process-args.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/utils'); - test('ember-glimmer/utils/process-args.js should pass jscs', function () { - ok(true, 'ember-glimmer/utils/process-args.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/utils/debug-stack.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/utils/process-args.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/utils/iterable.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/utils'); - QUnit.test('ember-glimmer/utils/process-args.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/utils/iterable.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/utils/process-args.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/utils/iterable.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/utils/references.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/utils/process-args.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/utils'); - test('ember-glimmer/utils/references.js should pass jscs', function () { - ok(true, 'ember-glimmer/utils/references.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/utils/references.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/utils'); - QUnit.test('ember-glimmer/utils/references.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/utils/process-args.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/utils/references.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/utils/string.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/utils'); - test('ember-glimmer/utils/string.js should pass jscs', function () { - ok(true, 'ember-glimmer/utils/string.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/utils/process-args.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/utils/string.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/utils/references.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/utils'); - QUnit.test('ember-glimmer/utils/string.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/utils/references.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/utils/string.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/utils/to-bool.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/utils'); - test('ember-glimmer/utils/to-bool.js should pass jscs', function () { - ok(true, 'ember-glimmer/utils/to-bool.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/utils/references.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/utils/to-bool.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/utils/string.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/utils'); - QUnit.test('ember-glimmer/utils/to-bool.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/utils/string.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/utils/to-bool.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/utils/string.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/views/outlet.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/utils/to-bool.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/views'); - test('ember-glimmer/views/outlet.js should pass jscs', function () { - ok(true, 'ember-glimmer/views/outlet.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/views/outlet.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/views'); - QUnit.test('ember-glimmer/views/outlet.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/utils/to-bool.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/views/outlet.js should pass jshint.'); - }); -}); -enifed('ember-metal/alias.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/alias.js should pass jscs', function () { - ok(true, 'ember-metal/alias.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/utils/to-bool.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/alias.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/views/outlet.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/alias.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/views/outlet.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/alias.js should pass jshint.'); - }); -}); -enifed('ember-metal/binding.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/binding.js should pass jscs', function () { - ok(true, 'ember-metal/binding.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/views/outlet.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/binding.jshint', ['exports'], function (exports) { +enifed('ember-metal/alias.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/binding.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/alias.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/binding.js should pass jshint.'); - }); -}); -enifed('ember-metal/cache.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/cache.js should pass jscs', function () { - ok(true, 'ember-metal/cache.js should pass jscs.'); + assert.ok(true, 'ember-metal/alias.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/cache.jshint', ['exports'], function (exports) { +enifed('ember-metal/binding.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/cache.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/binding.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/cache.js should pass jshint.'); - }); -}); -enifed('ember-metal/chains.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/chains.js should pass jscs', function () { - ok(true, 'ember-metal/chains.js should pass jscs.'); + assert.ok(true, 'ember-metal/binding.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/chains.jshint', ['exports'], function (exports) { +enifed('ember-metal/cache.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/chains.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/cache.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/chains.js should pass jshint.'); - }); -}); -enifed('ember-metal/computed.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/computed.js should pass jscs', function () { - ok(true, 'ember-metal/computed.js should pass jscs.'); + assert.ok(true, 'ember-metal/cache.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/computed.jshint', ['exports'], function (exports) { +enifed('ember-metal/chains.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/computed.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/chains.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/computed.js should pass jshint.'); + assert.ok(true, 'ember-metal/chains.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/core.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/computed.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/core.js should pass jscs', function () { - ok(true, 'ember-metal/core.js should pass jscs.'); - }); -}); -enifed('ember-metal/core.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/core.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/computed.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/core.js should pass jshint.'); - }); -}); -enifed('ember-metal/debug.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/debug.js should pass jscs', function () { - ok(true, 'ember-metal/debug.js should pass jscs.'); + assert.ok(true, 'ember-metal/computed.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/debug.jshint', ['exports'], function (exports) { +enifed('ember-metal/core.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/debug.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/core.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/debug.js should pass jshint.'); - }); -}); -enifed('ember-metal/dependent_keys.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/dependent_keys.js should pass jscs', function () { - ok(true, 'ember-metal/dependent_keys.js should pass jscs.'); + assert.ok(true, 'ember-metal/core.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/dependent_keys.jshint', ['exports'], function (exports) { +enifed('ember-metal/debug.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/dependent_keys.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/debug.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/dependent_keys.js should pass jshint.'); - }); -}); -enifed('ember-metal/deprecate_property.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/deprecate_property.js should pass jscs', function () { - ok(true, 'ember-metal/deprecate_property.js should pass jscs.'); + assert.ok(true, 'ember-metal/debug.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/deprecate_property.jshint', ['exports'], function (exports) { +enifed('ember-metal/dependent_keys.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/deprecate_property.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/dependent_keys.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/deprecate_property.js should pass jshint.'); - }); -}); -enifed('ember-metal/descriptor.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/descriptor.js should pass jscs', function () { - ok(true, 'ember-metal/descriptor.js should pass jscs.'); + assert.ok(true, 'ember-metal/dependent_keys.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/descriptor.jshint', ['exports'], function (exports) { +enifed('ember-metal/deprecate_property.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/descriptor.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/deprecate_property.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/descriptor.js should pass jshint.'); - }); -}); -enifed('ember-metal/error.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/error.js should pass jscs', function () { - ok(true, 'ember-metal/error.js should pass jscs.'); + assert.ok(true, 'ember-metal/deprecate_property.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/error.jshint', ['exports'], function (exports) { +enifed('ember-metal/descriptor.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/error.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/descriptor.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/error.js should pass jshint.'); - }); -}); -enifed('ember-metal/error_handler.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/error_handler.js should pass jscs', function () { - ok(true, 'ember-metal/error_handler.js should pass jscs.'); + assert.ok(true, 'ember-metal/descriptor.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/error_handler.jshint', ['exports'], function (exports) { +enifed('ember-metal/error.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/error_handler.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/error.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/error_handler.js should pass jshint.'); - }); -}); -enifed('ember-metal/events.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/events.js should pass jscs', function () { - ok(true, 'ember-metal/events.js should pass jscs.'); + assert.ok(true, 'ember-metal/error.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/events.jshint', ['exports'], function (exports) { +enifed('ember-metal/error_handler.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/events.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/error_handler.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/events.js should pass jshint.'); - }); -}); -enifed('ember-metal/expand_properties.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/expand_properties.js should pass jscs', function () { - ok(true, 'ember-metal/expand_properties.js should pass jscs.'); + assert.ok(true, 'ember-metal/error_handler.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/expand_properties.jshint', ['exports'], function (exports) { +enifed('ember-metal/events.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/expand_properties.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/events.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/expand_properties.js should pass jshint.'); - }); -}); -enifed('ember-metal/features.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/features.js should pass jscs', function () { - ok(true, 'ember-metal/features.js should pass jscs.'); + assert.ok(true, 'ember-metal/events.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/features.jshint', ['exports'], function (exports) { +enifed('ember-metal/expand_properties.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/features.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/expand_properties.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/features.js should pass jshint.'); - }); -}); -enifed('ember-metal/get_properties.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/get_properties.js should pass jscs', function () { - ok(true, 'ember-metal/get_properties.js should pass jscs.'); + assert.ok(true, 'ember-metal/expand_properties.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/get_properties.jshint', ['exports'], function (exports) { +enifed('ember-metal/features.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/get_properties.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/features.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/get_properties.js should pass jshint.'); - }); -}); -enifed('ember-metal/index.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/index.js should pass jscs', function () { - ok(true, 'ember-metal/index.js should pass jscs.'); + assert.ok(true, 'ember-metal/features.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/index.jshint', ['exports'], function (exports) { +enifed('ember-metal/get_properties.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/get_properties.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/index.js should pass jshint.'); + assert.ok(true, 'ember-metal/get_properties.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/injected_property.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/index.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/injected_property.js should pass jscs', function () { - ok(true, 'ember-metal/injected_property.js should pass jscs.'); - }); -}); -enifed('ember-metal/injected_property.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/injected_property.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/injected_property.js should pass jshint.'); - }); -}); -enifed('ember-metal/instrumentation.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/instrumentation.js should pass jscs', function () { - ok(true, 'ember-metal/instrumentation.js should pass jscs.'); + assert.ok(true, 'ember-metal/index.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/instrumentation.jshint', ['exports'], function (exports) { +enifed('ember-metal/injected_property.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/instrumentation.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/injected_property.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/instrumentation.js should pass jshint.'); - }); -}); -enifed('ember-metal/is_blank.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/is_blank.js should pass jscs', function () { - ok(true, 'ember-metal/is_blank.js should pass jscs.'); + assert.ok(true, 'ember-metal/injected_property.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/is_blank.jshint', ['exports'], function (exports) { +enifed('ember-metal/instrumentation.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/is_blank.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/instrumentation.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/is_blank.js should pass jshint.'); - }); -}); -enifed('ember-metal/is_empty.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/is_empty.js should pass jscs', function () { - ok(true, 'ember-metal/is_empty.js should pass jscs.'); + assert.ok(true, 'ember-metal/instrumentation.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/is_empty.jshint', ['exports'], function (exports) { +enifed('ember-metal/is_blank.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/is_empty.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/is_blank.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/is_empty.js should pass jshint.'); - }); -}); -enifed('ember-metal/is_none.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/is_none.js should pass jscs', function () { - ok(true, 'ember-metal/is_none.js should pass jscs.'); + assert.ok(true, 'ember-metal/is_blank.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/is_none.jshint', ['exports'], function (exports) { +enifed('ember-metal/is_empty.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/is_none.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/is_empty.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/is_none.js should pass jshint.'); - }); -}); -enifed('ember-metal/is_present.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/is_present.js should pass jscs', function () { - ok(true, 'ember-metal/is_present.js should pass jscs.'); + assert.ok(true, 'ember-metal/is_empty.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/is_present.jshint', ['exports'], function (exports) { +enifed('ember-metal/is_none.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/is_present.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/is_none.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/is_present.js should pass jshint.'); - }); -}); -enifed('ember-metal/is_proxy.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/is_proxy.js should pass jscs', function () { - ok(true, 'ember-metal/is_proxy.js should pass jscs.'); + assert.ok(true, 'ember-metal/is_none.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/is_proxy.jshint', ['exports'], function (exports) { +enifed('ember-metal/is_present.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/is_proxy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/is_present.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/is_proxy.js should pass jshint.'); - }); -}); -enifed('ember-metal/libraries.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/libraries.js should pass jscs', function () { - ok(true, 'ember-metal/libraries.js should pass jscs.'); + assert.ok(true, 'ember-metal/is_present.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/libraries.jshint', ['exports'], function (exports) { +enifed('ember-metal/is_proxy.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/libraries.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/is_proxy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/libraries.js should pass jshint.'); - }); -}); -enifed('ember-metal/map.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/map.js should pass jscs', function () { - ok(true, 'ember-metal/map.js should pass jscs.'); + assert.ok(true, 'ember-metal/is_proxy.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/map.jshint', ['exports'], function (exports) { +enifed('ember-metal/libraries.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/map.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/libraries.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/map.js should pass jshint.'); - }); -}); -enifed('ember-metal/merge.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/merge.js should pass jscs', function () { - ok(true, 'ember-metal/merge.js should pass jscs.'); + assert.ok(true, 'ember-metal/libraries.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/merge.jshint', ['exports'], function (exports) { +enifed('ember-metal/map.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/merge.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/map.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/merge.js should pass jshint.'); - }); -}); -enifed('ember-metal/meta.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/meta.js should pass jscs', function () { - ok(true, 'ember-metal/meta.js should pass jscs.'); + assert.ok(true, 'ember-metal/map.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/meta.jshint', ['exports'], function (exports) { +enifed('ember-metal/merge.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/meta.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/merge.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/meta.js should pass jshint.'); - }); -}); -enifed('ember-metal/meta_listeners.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/meta_listeners.js should pass jscs', function () { - ok(true, 'ember-metal/meta_listeners.js should pass jscs.'); + assert.ok(true, 'ember-metal/merge.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/meta_listeners.jshint', ['exports'], function (exports) { +enifed('ember-metal/meta.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/meta_listeners.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/meta.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/meta_listeners.js should pass jshint.'); - }); -}); -enifed('ember-metal/mixin.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/mixin.js should pass jscs', function () { - ok(true, 'ember-metal/mixin.js should pass jscs.'); + assert.ok(true, 'ember-metal/meta.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/mixin.jshint', ['exports'], function (exports) { +enifed('ember-metal/meta_listeners.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/mixin.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/meta_listeners.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/mixin.js should pass jshint.'); - }); -}); -enifed('ember-metal/observer.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/observer.js should pass jscs', function () { - ok(true, 'ember-metal/observer.js should pass jscs.'); + assert.ok(true, 'ember-metal/meta_listeners.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/observer.jshint', ['exports'], function (exports) { +enifed('ember-metal/mixin.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/observer.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/mixin.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/observer.js should pass jshint.'); - }); -}); -enifed('ember-metal/observer_set.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/observer_set.js should pass jscs', function () { - ok(true, 'ember-metal/observer_set.js should pass jscs.'); + assert.ok(true, 'ember-metal/mixin.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/observer_set.jshint', ['exports'], function (exports) { +enifed('ember-metal/observer.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/observer_set.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/observer.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/observer_set.js should pass jshint.'); - }); -}); -enifed('ember-metal/path_cache.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/path_cache.js should pass jscs', function () { - ok(true, 'ember-metal/path_cache.js should pass jscs.'); + assert.ok(true, 'ember-metal/observer.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/path_cache.jshint', ['exports'], function (exports) { +enifed('ember-metal/observer_set.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/path_cache.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/observer_set.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/path_cache.js should pass jshint.'); - }); -}); -enifed('ember-metal/properties.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/properties.js should pass jscs', function () { - ok(true, 'ember-metal/properties.js should pass jscs.'); + assert.ok(true, 'ember-metal/observer_set.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/properties.jshint', ['exports'], function (exports) { +enifed('ember-metal/path_cache.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/properties.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/path_cache.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/properties.js should pass jshint.'); - }); -}); -enifed('ember-metal/property_events.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/property_events.js should pass jscs', function () { - ok(true, 'ember-metal/property_events.js should pass jscs.'); + assert.ok(true, 'ember-metal/path_cache.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/property_events.jshint', ['exports'], function (exports) { +enifed('ember-metal/properties.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/property_events.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/properties.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/property_events.js should pass jshint.'); - }); -}); -enifed('ember-metal/property_get.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/property_get.js should pass jscs', function () { - ok(true, 'ember-metal/property_get.js should pass jscs.'); + assert.ok(true, 'ember-metal/properties.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/property_get.jshint', ['exports'], function (exports) { +enifed('ember-metal/property_events.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/property_get.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/property_events.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/property_get.js should pass jshint.'); - }); -}); -enifed('ember-metal/property_set.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/property_set.js should pass jscs', function () { - ok(true, 'ember-metal/property_set.js should pass jscs.'); + assert.ok(true, 'ember-metal/property_events.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/property_set.jshint', ['exports'], function (exports) { +enifed('ember-metal/property_get.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/property_set.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/property_get.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/property_set.js should pass jshint.'); - }); -}); -enifed('ember-metal/replace.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/replace.js should pass jscs', function () { - ok(true, 'ember-metal/replace.js should pass jscs.'); + assert.ok(true, 'ember-metal/property_get.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/replace.jshint', ['exports'], function (exports) { +enifed('ember-metal/property_set.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/replace.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/property_set.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/replace.js should pass jshint.'); - }); -}); -enifed('ember-metal/run_loop.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/run_loop.js should pass jscs', function () { - ok(true, 'ember-metal/run_loop.js should pass jscs.'); + assert.ok(true, 'ember-metal/property_set.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/run_loop.jshint', ['exports'], function (exports) { +enifed('ember-metal/replace.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/run_loop.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/replace.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/run_loop.js should pass jshint.'); - }); -}); -enifed('ember-metal/set_properties.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/set_properties.js should pass jscs', function () { - ok(true, 'ember-metal/set_properties.js should pass jscs.'); + assert.ok(true, 'ember-metal/replace.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/set_properties.jshint', ['exports'], function (exports) { +enifed('ember-metal/run_loop.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/set_properties.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/run_loop.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/set_properties.js should pass jshint.'); - }); -}); -enifed('ember-metal/tags.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/tags.js should pass jscs', function () { - ok(true, 'ember-metal/tags.js should pass jscs.'); + assert.ok(true, 'ember-metal/run_loop.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/tags.jshint', ['exports'], function (exports) { +enifed('ember-metal/set_properties.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/tags.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/set_properties.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tags.js should pass jshint.'); + assert.ok(true, 'ember-metal/set_properties.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/testing.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tags.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/testing.js should pass jscs', function () { - ok(true, 'ember-metal/testing.js should pass jscs.'); + QUnit.module('ESLint | ember-metal/tags.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tags.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/testing.jshint', ['exports'], function (exports) { +enifed('ember-metal/testing.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/testing.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/testing.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/testing.js should pass jshint.'); + assert.ok(true, 'ember-metal/testing.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/accessors/get_path_test', ['exports', 'ember-metal/property_get'], function (exports, _emberMetalProperty_get) { @@ -38754,21 +37970,13 @@ enifed('ember-metal/tests/accessors/get_path_test', ['exports', 'ember-metal/pro strictEqual(_emberMetalProperty_get.get(obj, 'Foo.bar'), undefined); }); }); -enifed('ember-metal/tests/accessors/get_path_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/accessors/get_path_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/accessors'); - test('ember-metal/tests/accessors/get_path_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/accessors/get_path_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/accessors/get_path_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/accessors'); - QUnit.test('ember-metal/tests/accessors/get_path_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/accessors/get_path_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/accessors/get_path_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/accessors/get_path_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/accessors/get_properties_test', ['exports', 'ember-metal/get_properties'], function (exports, _emberMetalGet_properties) { @@ -38792,21 +38000,13 @@ enifed('ember-metal/tests/accessors/get_properties_test', ['exports', 'ember-met deepEqual(_emberMetalGet_properties.default(obj, []), {}); }); }); -enifed('ember-metal/tests/accessors/get_properties_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/accessors/get_properties_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/accessors'); - test('ember-metal/tests/accessors/get_properties_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/accessors/get_properties_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/accessors/get_properties_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/accessors'); - QUnit.test('ember-metal/tests/accessors/get_properties_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/accessors/get_properties_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/accessors/get_properties_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/accessors/get_properties_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/accessors/get_test', ['exports', 'internal-test-helpers', 'ember-metal/property_get', 'ember-metal/mixin', 'ember-metal/observer'], function (exports, _internalTestHelpers, _emberMetalProperty_get, _emberMetalMixin, _emberMetalObserver) { @@ -39019,21 +38219,13 @@ enifed('ember-metal/tests/accessors/get_test', ['exports', 'internal-test-helper equal(_emberMetalProperty_get.getWithDefault(theRealObject, 'someProperty', 'fail'), 'foo', 'should return the set value, not false'); }); }); -enifed('ember-metal/tests/accessors/get_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/accessors'); - test('ember-metal/tests/accessors/get_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/accessors/get_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/accessors/get_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/accessors/get_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/accessors'); - QUnit.test('ember-metal/tests/accessors/get_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/accessors/get_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/accessors/get_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/accessors/get_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/accessors/is_global_path_test', ['exports', 'ember-metal/path_cache'], function (exports, _emberMetalPath_cache) { @@ -39056,21 +38248,13 @@ enifed('ember-metal/tests/accessors/is_global_path_test', ['exports', 'ember-met ok(!_emberMetalPath_cache.isGlobalPath('myObj.SecondProperty')); }); }); -enifed('ember-metal/tests/accessors/is_global_path_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/accessors'); - test('ember-metal/tests/accessors/is_global_path_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/accessors/is_global_path_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/accessors/is_global_path_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/accessors/is_global_path_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/accessors'); - QUnit.test('ember-metal/tests/accessors/is_global_path_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/accessors/is_global_path_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/accessors/is_global_path_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/accessors/is_global_path_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/accessors/mandatory_setters_test', ['exports', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/watching', 'ember-metal/meta'], function (exports, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalWatching, _emberMetalMeta) { @@ -39508,21 +38692,13 @@ enifed('ember-metal/tests/accessors/mandatory_setters_test', ['exports', 'ember- }); } }); -enifed('ember-metal/tests/accessors/mandatory_setters_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/accessors/mandatory_setters_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/accessors'); - test('ember-metal/tests/accessors/mandatory_setters_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/accessors/mandatory_setters_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/accessors/mandatory_setters_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/accessors'); - QUnit.test('ember-metal/tests/accessors/mandatory_setters_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/accessors/mandatory_setters_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/accessors/mandatory_setters_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/accessors/mandatory_setters_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/accessors/set_path_test', ['exports', 'ember-environment', 'ember-metal/property_set', 'ember-metal/property_get'], function (exports, _emberEnvironment, _emberMetalProperty_set, _emberMetalProperty_get) { @@ -39605,21 +38781,13 @@ enifed('ember-metal/tests/accessors/set_path_test', ['exports', 'ember-environme ok(true, 'does not raise'); }); }); -enifed('ember-metal/tests/accessors/set_path_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/accessors/set_path_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/accessors'); - test('ember-metal/tests/accessors/set_path_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/accessors/set_path_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/accessors/set_path_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/accessors'); - QUnit.test('ember-metal/tests/accessors/set_path_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/accessors/set_path_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/accessors/set_path_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/accessors/set_path_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/accessors/set_test', ['exports', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/tags'], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalTags) { @@ -39727,21 +38895,13 @@ enifed('ember-metal/tests/accessors/set_test', ['exports', 'ember-metal/property assert.equal(obj.foo, 'bar'); }); }); -enifed('ember-metal/tests/accessors/set_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/accessors'); - test('ember-metal/tests/accessors/set_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/accessors/set_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/accessors/set_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/accessors/set_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/accessors'); - QUnit.test('ember-metal/tests/accessors/set_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/accessors/set_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/accessors/set_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/accessors/set_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/alias_test', ['exports', 'ember-metal/alias', 'ember-metal/properties', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/meta', 'ember-metal/watching', 'ember-metal/observer', 'ember-metal/tags'], function (exports, _emberMetalAlias, _emberMetalProperties, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMeta, _emberMetalWatching, _emberMetalObserver, _emberMetalTags) { @@ -39851,21 +39011,13 @@ enifed('ember-metal/tests/alias_test', ['exports', 'ember-metal/alias', 'ember-m ok(!tag.validate(tagValue), label); } }); -enifed('ember-metal/tests/alias_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/alias_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/alias_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/alias_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/alias_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/alias_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/alias_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/alias_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/alias_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/binding/connect_test', ['exports', 'ember-environment', 'internal-test-helpers', 'ember-metal/binding', 'ember-metal/run_loop', 'ember-metal/property_set', 'ember-metal/property_get'], function (exports, _emberEnvironment, _internalTestHelpers, _emberMetalBinding, _emberMetalRun_loop, _emberMetalProperty_set, _emberMetalProperty_get) { @@ -40008,21 +39160,13 @@ enifed('ember-metal/tests/binding/connect_test', ['exports', 'ember-environment' equal(_emberMetalProperty_get.get(a, 'foo'), 'BAZ', 'should have synced binding on new obj'); }); }); -enifed('ember-metal/tests/binding/connect_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/binding/connect_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/binding'); - test('ember-metal/tests/binding/connect_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/binding/connect_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/binding/connect_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/binding'); - QUnit.test('ember-metal/tests/binding/connect_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/binding/connect_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/binding/connect_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/binding/connect_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/binding/sync_test', ['exports', 'internal-test-helpers', 'ember-metal/run_loop', 'ember-metal/observer', 'ember-metal/binding', 'ember-metal/computed', 'ember-metal/properties', 'ember-metal/property_events'], function (exports, _internalTestHelpers, _emberMetalRun_loop, _emberMetalObserver, _emberMetalBinding, _emberMetalComputed, _emberMetalProperties, _emberMetalProperty_events) { @@ -40193,21 +39337,13 @@ enifed('ember-metal/tests/binding/sync_test', ['exports', 'internal-test-helpers }); }); }); -enifed('ember-metal/tests/binding/sync_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/binding'); - test('ember-metal/tests/binding/sync_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/binding/sync_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/binding/sync_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/binding/sync_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/binding'); - QUnit.test('ember-metal/tests/binding/sync_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/binding/sync_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/binding/sync_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/binding/sync_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/cache_test', ['exports', 'ember-metal/cache'], function (exports, _emberMetalCache) { @@ -40311,21 +39447,13 @@ enifed('ember-metal/tests/cache_test', ['exports', 'ember-metal/cache'], functio equal(cache.get('c'), 'C'); }); }); -enifed('ember-metal/tests/cache_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/cache_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/cache_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/cache_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/cache_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/cache_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/cache_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/cache_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/cache_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/chains_test', ['exports', 'ember-metal/observer', 'ember-metal/property_get', 'ember-metal/chains', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/property_events', 'ember-metal/meta'], function (exports, _emberMetalObserver, _emberMetalProperty_get, _emberMetalChains, _emberMetalProperties, _emberMetalComputed, _emberMetalProperty_events, _emberMetalMeta) { @@ -40400,22 +39528,27 @@ enifed('ember-metal/tests/chains_test', ['exports', 'ember-metal/observer', 'emb _emberMetalProperty_get.get(obj, 'qux'); // CP chain re-recreated ok(true, 'no crash'); }); -}); -enifed('ember-metal/tests/chains_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/chains_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/chains_test.js should pass jscs.'); + QUnit.test('checks cache correctly', function (assert) { + var obj = {}; + var parentChainNode = new _emberMetalChains.ChainNode(null, null, obj); + var chainNode = new _emberMetalChains.ChainNode(parentChainNode, 'foo'); + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.default(function () { + return undefined; + })); + _emberMetalProperty_get.get(obj, 'foo'); + + assert.strictEqual(chainNode.value(), undefined); }); }); -enifed('ember-metal/tests/chains_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/chains_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/chains_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/chains_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/chains_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/chains_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/computed_test', ['exports', 'ember-runtime', 'internal-test-helpers', 'ember-metal/computed', 'ember-metal/properties', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/watching', 'ember-metal/observer'], function (exports, _emberRuntime, _internalTestHelpers, _emberMetalComputed, _emberMetalProperties, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalWatching, _emberMetalObserver) { @@ -41085,6 +40218,7 @@ enifed('ember-metal/tests/computed_test', ['exports', 'ember-runtime', 'internal firstName: 'Yehuda', lastName: 'Katz' }; + _emberMetalProperties.defineProperty(obj, 'fullName', _emberMetalComputed.computed({ get: function () { return get(this, 'firstName') + ' ' + get(this, 'lastName'); @@ -41096,6 +40230,7 @@ enifed('ember-metal/tests/computed_test', ['exports', 'ember-runtime', 'internal return value; } }).property('firstName', 'lastName')); + var fullNameWillChange = 0; var fullNameDidChange = 0; var firstNameWillChange = 0; @@ -41143,6 +40278,7 @@ enifed('ember-metal/tests/computed_test', ['exports', 'ember-runtime', 'internal var obj = { foo: 0 }; + _emberMetalProperties.defineProperty(obj, 'plusOne', _emberMetalComputed.computed({ get: function (key) { return get(this, 'foo') + 1; @@ -41152,6 +40288,7 @@ enifed('ember-metal/tests/computed_test', ['exports', 'ember-runtime', 'internal return value + 1; } }).property('foo')); + var plusOneWillChange = 0; var plusOneDidChange = 0; _emberMetalObserver._addBeforeObserver(obj, 'plusOne', function () { @@ -41232,21 +40369,13 @@ enifed('ember-metal/tests/computed_test', ['exports', 'ember-runtime', 'internal equal(get(obj, 'bar'), 'barValue'); }); }); -enifed('ember-metal/tests/computed_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/computed_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/computed_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/computed_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/computed_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/computed_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/computed_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/computed_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/computed_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/descriptor_test', ['exports', 'ember-runtime', 'ember-metal/mixin', 'ember-metal/properties', 'ember-metal/descriptor'], function (exports, _emberRuntime, _emberMetalMixin, _emberMetalProperties, _emberMetalDescriptor) { @@ -41683,21 +40812,13 @@ enifed('ember-metal/tests/descriptor_test', ['exports', 'ember-runtime', 'ember- }); }); }); -enifed('ember-metal/tests/descriptor_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/descriptor_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/descriptor_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/descriptor_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/descriptor_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/descriptor_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/descriptor_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/descriptor_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/descriptor_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/error_test', ['exports', 'ember-metal/error'], function (exports, _emberMetalError) { @@ -41713,21 +40834,13 @@ enifed('ember-metal/tests/error_test', ['exports', 'ember-metal/error'], functio }, 'the assigned message was displayed'); }); }); -enifed('ember-metal/tests/error_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/error_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/error_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/error_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/error_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/error_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/error_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/error_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/error_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/events_test', ['exports', 'ember-metal/mixin', 'ember-metal/meta', 'ember-metal/events'], function (exports, _emberMetalMixin, _emberMetalMeta, _emberMetalEvents) { @@ -41999,21 +41112,13 @@ enifed('ember-metal/tests/events_test', ['exports', 'ember-metal/mixin', 'ember- equal(triggered, 1, 'should invoke from subclass property'); }); }); -enifed('ember-metal/tests/events_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/events_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/events_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/events_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/events_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/events_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/events_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/events_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/events_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/expand_properties_test', ['exports', 'ember-metal/expand_properties'], function (exports, _emberMetalExpand_properties) { @@ -42120,21 +41225,13 @@ enifed('ember-metal/tests/expand_properties_test', ['exports', 'ember-metal/expa }, /Brace expanded properties cannot contain spaces, e.g. "user.{firstName, lastName}" should be "user.{firstName,lastName}"/); }); }); -enifed('ember-metal/tests/expand_properties_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/expand_properties_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/expand_properties_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/expand_properties_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/expand_properties_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/expand_properties_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/expand_properties_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/expand_properties_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/expand_properties_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/injected_property_test', ['exports', 'ember-utils', 'ember-metal/properties', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/injected_property'], function (exports, _emberUtils, _emberMetalProperties, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalInjected_property) { @@ -42210,21 +41307,13 @@ enifed('ember-metal/tests/injected_property_test', ['exports', 'ember-utils', 'e equal(_emberMetalProperty_get.get(obj, 'foo'), 'type:foo', 'should lookup the type using the property name'); }); }); -enifed('ember-metal/tests/injected_property_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/injected_property_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/injected_property_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/injected_property_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/injected_property_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/injected_property_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/injected_property_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/injected_property_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/injected_property_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/instrumentation_test', ['exports', 'ember-metal/instrumentation'], function (exports, _emberMetalInstrumentation) { @@ -42430,21 +41519,13 @@ enifed('ember-metal/tests/instrumentation_test', ['exports', 'ember-metal/instru _emberMetalInstrumentation.instrument('render.handlebars', null, function () {}); }); }); -enifed('ember-metal/tests/instrumentation_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/instrumentation_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/instrumentation_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/instrumentation_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/instrumentation_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/instrumentation_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/instrumentation_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/instrumentation_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/instrumentation_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/is_blank_test', ['exports', 'ember-metal/is_blank'], function (exports, _emberMetalIs_blank) { @@ -42474,21 +41555,13 @@ enifed('ember-metal/tests/is_blank_test', ['exports', 'ember-metal/is_blank'], f equal(false, _emberMetalIs_blank.default([1, 2, 3]), 'for a non-empty array'); }); }); -enifed('ember-metal/tests/is_blank_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/is_blank_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/is_blank_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/is_blank_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/is_blank_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/is_blank_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/is_blank_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/is_blank_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/is_blank_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/is_empty_test', ['exports', 'ember-metal/is_empty', 'ember-metal/map'], function (exports, _emberMetalIs_empty, _emberMetalMap) { @@ -42530,21 +41603,13 @@ enifed('ember-metal/tests/is_empty_test', ['exports', 'ember-metal/is_empty', 'e equal(false, _emberMetalIs_empty.default(orderedSet), 'Ordered set is not empty'); }); }); -enifed('ember-metal/tests/is_empty_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/is_empty_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/is_empty_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/is_empty_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/is_empty_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/is_empty_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/is_empty_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/is_empty_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/is_empty_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/is_none_test', ['exports', 'ember-metal/is_none'], function (exports, _emberMetalIs_none) { @@ -42568,21 +41633,13 @@ enifed('ember-metal/tests/is_none_test', ['exports', 'ember-metal/is_none'], fun equal(false, _emberMetalIs_none.default({}), 'for an empty Object'); }); }); -enifed('ember-metal/tests/is_none_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/is_none_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/is_none_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/is_none_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/is_none_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/is_none_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/is_none_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/is_none_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/is_none_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/is_present_test', ['exports', 'ember-metal/is_present'], function (exports, _emberMetalIs_present) { @@ -42613,21 +41670,13 @@ enifed('ember-metal/tests/is_present_test', ['exports', 'ember-metal/is_present' equal(true, _emberMetalIs_present.default([1, 2, 3]), 'for a non-empty array'); }); }); -enifed('ember-metal/tests/is_present_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/is_present_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/is_present_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/is_present_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/is_present_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/is_present_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/is_present_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/is_present_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/is_present_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/libraries_test', ['exports', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/libraries'], function (exports, _emberMetalDebug, _emberMetalFeatures, _emberMetalLibraries) { @@ -42673,7 +41722,7 @@ enifed('ember-metal/tests/libraries_test', ['exports', 'ember-metal/debug', 'emb equal(registry.length, 1); }); - if (false) { + if (_emberMetalFeatures.default('ember-libraries-isregistered')) { QUnit.test('isRegistered returns correct value', function () { expect(3); @@ -42721,21 +41770,13 @@ enifed('ember-metal/tests/libraries_test', ['exports', 'ember-metal/debug', 'emb equal(registry.length, 1); }); }); -enifed('ember-metal/tests/libraries_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/libraries_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/libraries_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/libraries_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/libraries_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/libraries_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/libraries_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/libraries_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/libraries_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/main_test', ['exports', 'ember-metal/index'], function (exports, _emberMetalIndex) { @@ -42792,22 +41833,24 @@ enifed('ember-metal/tests/main_test', ['exports', 'ember-metal/index'], function new _emberMetalIndex.default.Backburner(['foo']); }, 'Usage of Ember.Backburner is deprecated.'); }); -}); -enifed('ember-metal/tests/main_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/main_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/main_test.js should pass jscs.'); + QUnit.test('Ember.K is deprecated', function (assert) { + expectDeprecation(function () { + var obj = { + noop: _emberMetalIndex.default.K + }; + + assert.equal(obj, obj.noop()); + }, 'Ember.K is deprecated in favor of defining a function inline.'); }); }); -enifed('ember-metal/tests/main_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/main_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/main_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/main_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/main_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/main_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/map_test', ['exports', 'ember-metal/map'], function (exports, _emberMetalMap) { @@ -43301,21 +42344,13 @@ enifed('ember-metal/tests/map_test', ['exports', 'ember-metal/map'], function (e equal(map.add(obj), map, 'when it is already in the set'); }); }); -enifed('ember-metal/tests/map_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/map_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/map_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/map_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/map_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/map_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/map_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/map_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/map_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/meta_test', ['exports', 'ember-metal/meta'], function (exports, _emberMetalMeta) { @@ -43398,21 +42433,13 @@ enifed('ember-metal/tests/meta_test', ['exports', 'ember-metal/meta'], function assert.equal(matching[0], t); }); }); -enifed('ember-metal/tests/meta_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/meta_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/meta_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/meta_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/meta_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/meta_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/meta_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/meta_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/meta_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/mixin/alias_method_test', ['exports', 'ember-metal/property_get', 'ember-metal/mixin'], function (exports, _emberMetalProperty_get, _emberMetalMixin) { @@ -43504,21 +42531,13 @@ enifed('ember-metal/tests/mixin/alias_method_test', ['exports', 'ember-metal/pro validateAliasMethod(obj); }); }); -enifed('ember-metal/tests/mixin/alias_method_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/mixin/alias_method_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/mixin'); - test('ember-metal/tests/mixin/alias_method_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/mixin/alias_method_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/mixin/alias_method_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/mixin'); - QUnit.test('ember-metal/tests/mixin/alias_method_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/mixin/alias_method_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/mixin/alias_method_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/mixin/alias_method_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/mixin/apply_test', ['exports', 'ember-metal/property_get', 'ember-metal/mixin'], function (exports, _emberMetalProperty_get, _emberMetalMixin) { @@ -43561,21 +42580,13 @@ enifed('ember-metal/tests/mixin/apply_test', ['exports', 'ember-metal/property_g strictEqual(_emberMetalProperty_get.default(obj, 'tagName'), ''); }); }); -enifed('ember-metal/tests/mixin/apply_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/mixin'); - test('ember-metal/tests/mixin/apply_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/mixin/apply_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/mixin/apply_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/mixin/apply_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/mixin'); - QUnit.test('ember-metal/tests/mixin/apply_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/mixin/apply_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/mixin/apply_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/mixin/apply_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/mixin/computed_test', ['exports', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/mixin', 'ember-metal/computed', 'ember-metal/properties'], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMixin, _emberMetalComputed, _emberMetalProperties) { @@ -43735,21 +42746,13 @@ enifed('ember-metal/tests/mixin/computed_test', ['exports', 'ember-metal/propert ok(!cpWasCalled, 'The default setter was called, not the CP itself'); }); }); -enifed('ember-metal/tests/mixin/computed_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/mixin/computed_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/mixin'); - test('ember-metal/tests/mixin/computed_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/mixin/computed_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/mixin/computed_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/mixin'); - QUnit.test('ember-metal/tests/mixin/computed_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/mixin/computed_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/mixin/computed_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/mixin/computed_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/mixin/concatenated_properties_test', ['exports', 'ember-metal/property_get', 'ember-metal/mixin'], function (exports, _emberMetalProperty_get, _emberMetalMixin) { @@ -43856,24 +42859,16 @@ enifed('ember-metal/tests/mixin/concatenated_properties_test', ['exports', 'embe }); var obj = _emberMetalMixin.mixin({}, mixinA, mixinB); - equal(_emberMetalProperty_get.default(obj, 'foobar'), 'foobar'); - }); -}); -enifed('ember-metal/tests/mixin/concatenated_properties_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/mixin'); - test('ember-metal/tests/mixin/concatenated_properties_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/mixin/concatenated_properties_test.js should pass jscs.'); + deepEqual(_emberMetalProperty_get.default(obj, 'foobar'), ['foo', 'bar']); }); }); -enifed('ember-metal/tests/mixin/concatenated_properties_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/mixin/concatenated_properties_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/mixin'); - QUnit.test('ember-metal/tests/mixin/concatenated_properties_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/mixin/concatenated_properties_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/mixin/concatenated_properties_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/mixin/concatenated_properties_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/mixin/detect_test', ['exports', 'ember-metal/mixin'], function (exports, _emberMetalMixin) { @@ -43914,21 +42909,13 @@ enifed('ember-metal/tests/mixin/detect_test', ['exports', 'ember-metal/mixin'], equal(MixinA.detect(null), false); }); }); -enifed('ember-metal/tests/mixin/detect_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/mixin/detect_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/mixin'); - test('ember-metal/tests/mixin/detect_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/mixin/detect_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/mixin/detect_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/mixin'); - QUnit.test('ember-metal/tests/mixin/detect_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/mixin/detect_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/mixin/detect_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/mixin/detect_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/mixin/introspection_test', ['exports', 'ember-utils', 'ember-metal/mixin'], function (exports, _emberUtils, _emberMetalMixin) { @@ -43980,21 +42967,13 @@ enifed('ember-metal/tests/mixin/introspection_test', ['exports', 'ember-utils', deepEqual(mapGuids(_emberMetalMixin.Mixin.mixins(obj)), mapGuids([PrivateProperty, PublicProperty, PrivateMethod, PublicMethod, Combined, BarProperties, BarMethods]), 'should return included mixins'); }); }); -enifed('ember-metal/tests/mixin/introspection_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/mixin/introspection_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/mixin'); - test('ember-metal/tests/mixin/introspection_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/mixin/introspection_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/mixin/introspection_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/mixin'); - QUnit.test('ember-metal/tests/mixin/introspection_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/mixin/introspection_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/mixin/introspection_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/mixin/introspection_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/mixin/merged_properties_test', ['exports', 'ember-runtime', 'ember-metal/property_get', 'ember-metal/mixin'], function (exports, _emberRuntime, _emberMetalProperty_get, _emberMetalMixin) { @@ -44176,21 +43155,13 @@ enifed('ember-metal/tests/mixin/merged_properties_test', ['exports', 'ember-runt }, 'You passed in `["a"]` as the value for `foo` but `foo` cannot be an Array'); }); }); -enifed('ember-metal/tests/mixin/merged_properties_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/mixin'); - test('ember-metal/tests/mixin/merged_properties_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/mixin/merged_properties_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/mixin/merged_properties_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/mixin/merged_properties_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/mixin'); - QUnit.test('ember-metal/tests/mixin/merged_properties_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/mixin/merged_properties_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/mixin/merged_properties_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/mixin/merged_properties_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/mixin/method_test', ['exports', 'ember-metal/mixin'], function (exports, _emberMetalMixin) { @@ -44439,21 +43410,13 @@ enifed('ember-metal/tests/mixin/method_test', ['exports', 'ember-metal/mixin'], equal(cnt, 3, 'should invoke all 3 methods'); }); }); -enifed('ember-metal/tests/mixin/method_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/mixin'); - test('ember-metal/tests/mixin/method_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/mixin/method_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/mixin/method_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/mixin/method_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/mixin'); - QUnit.test('ember-metal/tests/mixin/method_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/mixin/method_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/mixin/method_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/mixin/method_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/mixin/observer_test', ['exports', 'internal-test-helpers', 'ember-metal/mixin', 'ember-metal/watching'], function (exports, _internalTestHelpers, _emberMetalMixin, _emberMetalWatching) { @@ -44674,21 +43637,13 @@ enifed('ember-metal/tests/mixin/observer_test', ['exports', 'internal-test-helpe }); }); }); -enifed('ember-metal/tests/mixin/observer_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/mixin/observer_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/mixin'); - test('ember-metal/tests/mixin/observer_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/mixin/observer_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/mixin/observer_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/mixin'); - QUnit.test('ember-metal/tests/mixin/observer_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/mixin/observer_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/mixin/observer_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/mixin/observer_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/mixin/reopen_test', ['exports', 'ember-metal/run_loop', 'ember-metal/property_get', 'ember-runtime', 'ember-metal/mixin'], function (exports, _emberMetalRun_loop, _emberMetalProperty_get, _emberRuntime, _emberMetalMixin) { @@ -44738,21 +43693,13 @@ enifed('ember-metal/tests/mixin/reopen_test', ['exports', 'ember-metal/run_loop' equal(result, 'Breakfast!'); }); }); -enifed('ember-metal/tests/mixin/reopen_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/mixin/reopen_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/mixin'); - test('ember-metal/tests/mixin/reopen_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/mixin/reopen_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/mixin/reopen_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/mixin'); - QUnit.test('ember-metal/tests/mixin/reopen_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/mixin/reopen_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/mixin/reopen_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/mixin/reopen_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/mixin/required_test', ['exports', 'ember-metal/mixin', 'ember-metal/property_get'], function (exports, _emberMetalMixin, _emberMetalProperty_get) { @@ -44810,21 +43757,13 @@ enifed('ember-metal/tests/mixin/required_test', ['exports', 'ember-metal/mixin', equal(_emberMetalProperty_get.get(obj, 'foo'), 'FOO', 'should now be defined'); }); }); -enifed('ember-metal/tests/mixin/required_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/mixin/required_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/mixin'); - test('ember-metal/tests/mixin/required_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/mixin/required_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/mixin/required_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/mixin'); - QUnit.test('ember-metal/tests/mixin/required_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/mixin/required_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/mixin/required_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/mixin/required_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/mixin/without_test', ['exports', 'ember-metal/mixin'], function (exports, _emberMetalMixin) { @@ -44845,21 +43784,13 @@ enifed('ember-metal/tests/mixin/without_test', ['exports', 'ember-metal/mixin'], equal(obj.bar, undefined, 'should not define bar'); }); }); -enifed('ember-metal/tests/mixin/without_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/mixin'); - test('ember-metal/tests/mixin/without_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/mixin/without_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/mixin/without_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/mixin/without_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/mixin'); - QUnit.test('ember-metal/tests/mixin/without_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/mixin/without_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/mixin/without_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/mixin/without_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/observer_test', ['exports', 'ember-environment', 'internal-test-helpers', 'ember-metal/observer', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/mixin', 'ember-metal/run_loop'], function (exports, _emberEnvironment, _internalTestHelpers, _emberMetalObserver, _emberMetalProperty_events, _emberMetalProperties, _emberMetalComputed, _emberMetalMixin, _emberMetalRun_loop) { @@ -46163,21 +45094,13 @@ enifed('ember-metal/tests/observer_test', ['exports', 'ember-environment', 'inte deepEqual(Object.keys(itsMyLastBeer), ['type'], 'set -> removeObserver'); }); }); -enifed('ember-metal/tests/observer_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/observer_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/observer_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/observer_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/observer_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/observer_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/observer_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/observer_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/observer_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/performance_test', ['exports', 'ember-metal/property_set', 'ember-metal/property_get', 'ember-metal/computed', 'ember-metal/properties', 'ember-metal/property_events', 'ember-metal/observer'], function (exports, _emberMetalProperty_set, _emberMetalProperty_get, _emberMetalComputed, _emberMetalProperties, _emberMetalProperty_events, _emberMetalObserver) { @@ -46238,21 +45161,13 @@ enifed('ember-metal/tests/performance_test', ['exports', 'ember-metal/property_s equal(count, 0, 'should not have recomputed property'); }); }); -enifed('ember-metal/tests/performance_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/performance_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/performance_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/performance_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/performance_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/performance_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/performance_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/performance_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/performance_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/properties_test', ['exports', 'ember-metal/computed', 'ember-metal/properties', 'ember-metal/deprecate_property'], function (exports, _emberMetalComputed, _emberMetalProperties, _emberMetalDeprecate_property) { @@ -46358,21 +45273,13 @@ enifed('ember-metal/tests/properties_test', ['exports', 'ember-metal/computed', equal(obj.baz, obj.foo, 'baz and foo are equal'); }); }); -enifed('ember-metal/tests/properties_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/properties_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/properties_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/properties_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/properties_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/properties_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/properties_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/properties_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/properties_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/property_did_change_hook', ['exports', 'internal-test-helpers', 'ember-metal/property_events', 'ember-metal/watching', 'ember-metal/properties', 'ember-metal/alias', 'ember-metal/computed'], function (exports, _internalTestHelpers, _emberMetalProperty_events, _emberMetalWatching, _emberMetalProperties, _emberMetalAlias, _emberMetalComputed) { @@ -46437,21 +45344,13 @@ enifed('ember-metal/tests/property_did_change_hook', ['exports', 'internal-test- equal(counts['total'], 1, 'PROPERTY_DID_CHANGE called with total'); }); }); -enifed('ember-metal/tests/property_did_change_hook.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/property_did_change_hook.js should pass jscs', function () { - ok(true, 'ember-metal/tests/property_did_change_hook.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/property_did_change_hook.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/property_did_change_hook.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/property_did_change_hook.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/property_did_change_hook.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/property_did_change_hook.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/property_did_change_hook.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/run_loop/add_queue_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { @@ -46482,21 +45381,13 @@ enifed('ember-metal/tests/run_loop/add_queue_test', ['exports', 'ember-metal/run equal(queues.length, 3, 'queue was not added twice'); }); }); -enifed('ember-metal/tests/run_loop/add_queue_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/run_loop/add_queue_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/run_loop'); - test('ember-metal/tests/run_loop/add_queue_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/run_loop/add_queue_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/run_loop/add_queue_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/run_loop'); - QUnit.test('ember-metal/tests/run_loop/add_queue_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/run_loop/add_queue_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/run_loop/add_queue_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/run_loop/add_queue_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/run_loop/debounce_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { @@ -46521,21 +45412,13 @@ enifed('ember-metal/tests/run_loop/debounce_test', ['exports', 'ember-metal/run_ ok(wasCalled, 'Ember.run.debounce used'); }); }); -enifed('ember-metal/tests/run_loop/debounce_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/run_loop/debounce_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/run_loop'); - test('ember-metal/tests/run_loop/debounce_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/run_loop/debounce_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/run_loop/debounce_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/run_loop'); - QUnit.test('ember-metal/tests/run_loop/debounce_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/run_loop/debounce_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/run_loop/debounce_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/run_loop/debounce_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/run_loop/later_test', ['exports', 'ember-metal/is_none', 'ember-metal/run_loop'], function (exports, _emberMetalIs_none, _emberMetalRun_loop) { @@ -46779,21 +45662,13 @@ enifed('ember-metal/tests/run_loop/later_test', ['exports', 'ember-metal/is_none }); }); }); -enifed('ember-metal/tests/run_loop/later_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/run_loop/later_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/run_loop'); - test('ember-metal/tests/run_loop/later_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/run_loop/later_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/run_loop/later_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/run_loop'); - QUnit.test('ember-metal/tests/run_loop/later_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/run_loop/later_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/run_loop/later_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/run_loop/later_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/run_loop/next_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { @@ -46836,11 +45711,9 @@ enifed('ember-metal/tests/run_loop/next_test', ['exports', 'ember-metal/run_loop }); asyncTest('multiple calls to run.next share coalesce callbacks into same run loop', function () { - var firstRunLoop = undefined, - secondRunLoop = undefined, + var secondRunLoop = undefined, thirdRunLoop = undefined; _emberMetalRun_loop.default(function () { - firstRunLoop = _emberMetalRun_loop.default.currentRunLoop; _emberMetalRun_loop.default.next(function () { return secondRunLoop = _emberMetalRun_loop.default.currentRunLoop; }); @@ -46855,21 +45728,13 @@ enifed('ember-metal/tests/run_loop/next_test', ['exports', 'ember-metal/run_loop }, 20); }); }); -enifed('ember-metal/tests/run_loop/next_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/run_loop/next_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/run_loop'); - test('ember-metal/tests/run_loop/next_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/run_loop/next_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/run_loop/next_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/run_loop'); - QUnit.test('ember-metal/tests/run_loop/next_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/run_loop/next_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/run_loop/next_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/run_loop/next_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/run_loop/once_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { @@ -46934,21 +45799,13 @@ enifed('ember-metal/tests/run_loop/once_test', ['exports', 'ember-metal/run_loop }); }); }); -enifed('ember-metal/tests/run_loop/once_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/run_loop'); - test('ember-metal/tests/run_loop/once_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/run_loop/once_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/run_loop/once_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/run_loop/once_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/run_loop'); - QUnit.test('ember-metal/tests/run_loop/once_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/run_loop/once_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/run_loop/once_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/run_loop/once_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/run_loop/onerror_test', ['exports', 'ember-metal/run_loop', 'ember-metal/error_handler'], function (exports, _emberMetalRun_loop, _emberMetalError_handler) { @@ -46994,21 +45851,13 @@ enifed('ember-metal/tests/run_loop/onerror_test', ['exports', 'ember-metal/run_l deepEqual(caught, thrown); }); }); -enifed('ember-metal/tests/run_loop/onerror_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/run_loop/onerror_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/run_loop'); - test('ember-metal/tests/run_loop/onerror_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/run_loop/onerror_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/run_loop/onerror_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/run_loop'); - QUnit.test('ember-metal/tests/run_loop/onerror_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/run_loop/onerror_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/run_loop/onerror_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/run_loop/onerror_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/run_loop/run_bind_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { @@ -47049,21 +45898,13 @@ enifed('ember-metal/tests/run_loop/run_bind_test', ['exports', 'ember-metal/run_ asyncFunction(_emberMetalRun_loop.default.bind(asyncCallback, asyncCallback, 1)); }); }); -enifed('ember-metal/tests/run_loop/run_bind_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/run_loop'); - test('ember-metal/tests/run_loop/run_bind_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/run_loop/run_bind_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/run_loop/run_bind_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/run_loop/run_bind_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/run_loop'); - QUnit.test('ember-metal/tests/run_loop/run_bind_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/run_loop/run_bind_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/run_loop/run_bind_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/run_loop/run_bind_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/run_loop/run_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { @@ -47090,21 +45931,13 @@ enifed('ember-metal/tests/run_loop/run_test', ['exports', 'ember-metal/run_loop' deepEqual(_emberMetalRun_loop.default(obj, obj.checkArgs, 'hello', 'world'), ['hello', 'BAR', 'world'], 'pass obj, obj.method, and extra arguments'); }); }); -enifed('ember-metal/tests/run_loop/run_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/run_loop/run_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/run_loop'); - test('ember-metal/tests/run_loop/run_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/run_loop/run_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/run_loop/run_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/run_loop'); - QUnit.test('ember-metal/tests/run_loop/run_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/run_loop/run_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/run_loop/run_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/run_loop/run_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/run_loop/schedule_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { @@ -47208,21 +46041,13 @@ enifed('ember-metal/tests/run_loop/schedule_test', ['exports', 'ember-metal/run_ }, /wrap any code with asynchronous side-effects in a run/); }); }); -enifed('ember-metal/tests/run_loop/schedule_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/run_loop'); - test('ember-metal/tests/run_loop/schedule_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/run_loop/schedule_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/run_loop/schedule_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/run_loop/schedule_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/run_loop'); - QUnit.test('ember-metal/tests/run_loop/schedule_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/run_loop/schedule_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/run_loop/schedule_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/run_loop/schedule_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/run_loop/sync_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { @@ -47262,21 +46087,13 @@ enifed('ember-metal/tests/run_loop/sync_test', ['exports', 'ember-metal/run_loop _emberMetalRun_loop.default.sync(); }); }); -enifed('ember-metal/tests/run_loop/sync_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/run_loop/sync_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/run_loop'); - test('ember-metal/tests/run_loop/sync_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/run_loop/sync_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/run_loop/sync_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/run_loop'); - QUnit.test('ember-metal/tests/run_loop/sync_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/run_loop/sync_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/run_loop/sync_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/run_loop/sync_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/run_loop/unwind_test', ['exports', 'ember-metal/run_loop', 'ember-metal/error'], function (exports, _emberMetalRun_loop, _emberMetalError) { @@ -47320,21 +46137,13 @@ enifed('ember-metal/tests/run_loop/unwind_test', ['exports', 'ember-metal/run_lo _emberMetalRun_loop.default.currentRunLoop = initialRunLoop; }); }); -enifed('ember-metal/tests/run_loop/unwind_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/run_loop/unwind_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/run_loop'); - test('ember-metal/tests/run_loop/unwind_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/run_loop/unwind_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/run_loop/unwind_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/run_loop'); - QUnit.test('ember-metal/tests/run_loop/unwind_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/run_loop/unwind_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/run_loop/unwind_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/run_loop/unwind_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/set_properties_test', ['exports', 'ember-metal/set_properties'], function (exports, _emberMetalSet_properties) { @@ -47363,21 +46172,13 @@ enifed('ember-metal/tests/set_properties_test', ['exports', 'ember-metal/set_pro }, 'Set an additional, previously unset property'); }); }); -enifed('ember-metal/tests/set_properties_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/set_properties_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/set_properties_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/set_properties_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/set_properties_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/set_properties_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/set_properties_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/set_properties_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/set_properties_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/watching/is_watching_test', ['exports', 'ember-metal/computed', 'ember-metal/property_get', 'ember-metal/properties', 'ember-metal/mixin', 'ember-metal/observer', 'ember-metal/watching'], function (exports, _emberMetalComputed, _emberMetalProperty_get, _emberMetalProperties, _emberMetalMixin, _emberMetalObserver, _emberMetalWatching) { @@ -47453,21 +46254,13 @@ enifed('ember-metal/tests/watching/is_watching_test', ['exports', 'ember-metal/c }, 'length'); }); }); -enifed('ember-metal/tests/watching/is_watching_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/watching'); - test('ember-metal/tests/watching/is_watching_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/watching/is_watching_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/watching/is_watching_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/watching/is_watching_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/watching'); - QUnit.test('ember-metal/tests/watching/is_watching_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/watching/is_watching_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/watching/is_watching_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/watching/is_watching_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/watching/unwatch_test', ['exports', 'internal-test-helpers', 'ember-metal/watching', 'ember-metal/properties', 'ember-metal/events', 'ember-metal/computed', 'ember-metal/property_set'], function (exports, _internalTestHelpers, _emberMetalWatching, _emberMetalProperties, _emberMetalEvents, _emberMetalComputed, _emberMetalProperty_set) { @@ -47586,21 +46379,13 @@ enifed('ember-metal/tests/watching/unwatch_test', ['exports', 'internal-test-hel equal(obj.foo, 'RUN', 'obj.foo after unwatch'); }); }); -enifed('ember-metal/tests/watching/unwatch_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/watching'); - test('ember-metal/tests/watching/unwatch_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/watching/unwatch_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/watching/unwatch_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/watching/unwatch_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/watching'); - QUnit.test('ember-metal/tests/watching/unwatch_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/watching/unwatch_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/watching/unwatch_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/watching/unwatch_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/watching/watch_test', ['exports', 'ember-environment', 'ember-metal/meta', 'ember-metal/property_set', 'ember-metal/property_get', 'ember-metal/computed', 'ember-metal/properties', 'internal-test-helpers', 'ember-metal/events', 'ember-metal/watching'], function (exports, _emberEnvironment, _emberMetalMeta, _emberMetalProperty_set, _emberMetalProperty_get, _emberMetalComputed, _emberMetalProperties, _internalTestHelpers, _emberMetalEvents, _emberMetalWatching) { @@ -47610,8 +46395,7 @@ enifed('ember-metal/tests/watching/watch_test', ['exports', 'ember-environment', didCount = undefined, willKeys = undefined, didKeys = undefined, - originalLookup = undefined, - lookup = undefined; + originalLookup = undefined; QUnit.module('watch', { setup: function () { @@ -47620,7 +46404,7 @@ enifed('ember-metal/tests/watching/watch_test', ['exports', 'ember-environment', didKeys = []; originalLookup = _emberEnvironment.context.lookup; - _emberEnvironment.context.lookup = lookup = {}; + _emberEnvironment.context.lookup = {}; }, teardown: function () { @@ -47853,21 +46637,13 @@ enifed('ember-metal/tests/watching/watch_test', ['exports', 'ember-environment', equal(get(child, 'b'), 1, 'Ember.get(child, "b") (after watch)'); }); }); -enifed('ember-metal/tests/watching/watch_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/watching/watch_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/watching'); - test('ember-metal/tests/watching/watch_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/watching/watch_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/watching/watch_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/watching'); - QUnit.test('ember-metal/tests/watching/watch_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/watching/watch_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/watching/watch_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/watching/watch_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/weak_map_test', ['exports', 'ember-metal/weak_map'], function (exports, _emberMetalWeak_map) { @@ -47996,412 +46772,229 @@ enifed('ember-metal/tests/weak_map_test', ['exports', 'ember-metal/weak_map'], f assert.strictEqual(map.toString(), '[object WeakMap]'); }); }); -enifed('ember-metal/tests/weak_map_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/weak_map_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/weak_map_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/weak_map_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/weak_map_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/weak_map_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/weak_map_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/weak_map_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/weak_map_test.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/transaction.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/transaction.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/transaction.js should pass jscs', function () { - ok(true, 'ember-metal/transaction.js should pass jscs.'); - }); -}); -enifed('ember-metal/transaction.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/transaction.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/transaction.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/transaction.js should pass jshint.'); + assert.ok(true, 'ember-metal/transaction.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/watch_key.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/watch_key.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/watch_key.js should pass jscs', function () { - ok(true, 'ember-metal/watch_key.js should pass jscs.'); - }); -}); -enifed('ember-metal/watch_key.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/watch_key.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/watch_key.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/watch_key.js should pass jshint.'); + assert.ok(true, 'ember-metal/watch_key.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/watch_path.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/watch_path.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/watch_path.js should pass jscs', function () { - ok(true, 'ember-metal/watch_path.js should pass jscs.'); - }); -}); -enifed('ember-metal/watch_path.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/watch_path.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/watch_path.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/watch_path.js should pass jshint.'); - }); -}); -enifed('ember-metal/watching.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/watching.js should pass jscs', function () { - ok(true, 'ember-metal/watching.js should pass jscs.'); + assert.ok(true, 'ember-metal/watch_path.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/watching.jshint', ['exports'], function (exports) { +enifed('ember-metal/watching.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/watching.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/watching.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/watching.js should pass jshint.'); + assert.ok(true, 'ember-metal/watching.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/weak_map.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/weak_map.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/weak_map.js should pass jscs', function () { - ok(true, 'ember-metal/weak_map.js should pass jscs.'); - }); -}); -enifed('ember-metal/weak_map.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/weak_map.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/weak_map.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/weak_map.js should pass jshint.'); - }); -}); -enifed('ember-routing/ext/controller.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-routing/ext'); - test('ember-routing/ext/controller.js should pass jscs', function () { - ok(true, 'ember-routing/ext/controller.js should pass jscs.'); + assert.ok(true, 'ember-metal/weak_map.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/ext/controller.jshint', ['exports'], function (exports) { +enifed('ember-routing/ext/controller.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-routing/ext'); - QUnit.test('ember-routing/ext/controller.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/ext/controller.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/ext/controller.js should pass jshint.'); - }); -}); -enifed('ember-routing/ext/run_loop.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-routing/ext'); - test('ember-routing/ext/run_loop.js should pass jscs', function () { - ok(true, 'ember-routing/ext/run_loop.js should pass jscs.'); + assert.ok(true, 'ember-routing/ext/controller.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/ext/run_loop.jshint', ['exports'], function (exports) { +enifed('ember-routing/ext/run_loop.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-routing/ext'); - QUnit.test('ember-routing/ext/run_loop.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/ext/run_loop.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/ext/run_loop.js should pass jshint.'); - }); -}); -enifed('ember-routing/index.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-routing'); - test('ember-routing/index.js should pass jscs', function () { - ok(true, 'ember-routing/index.js should pass jscs.'); + assert.ok(true, 'ember-routing/ext/run_loop.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/index.jshint', ['exports'], function (exports) { +enifed('ember-routing/index.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-routing'); - QUnit.test('ember-routing/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/index.js should pass jshint.'); + assert.ok(true, 'ember-routing/index.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/location/api.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/location/api.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/location'); - test('ember-routing/location/api.js should pass jscs', function () { - ok(true, 'ember-routing/location/api.js should pass jscs.'); - }); -}); -enifed('ember-routing/location/api.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/location'); - QUnit.test('ember-routing/location/api.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/location/api.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/location/api.js should pass jshint.'); + assert.ok(true, 'ember-routing/location/api.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/location/auto_location.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/location/auto_location.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/location'); - test('ember-routing/location/auto_location.js should pass jscs', function () { - ok(true, 'ember-routing/location/auto_location.js should pass jscs.'); - }); -}); -enifed('ember-routing/location/auto_location.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/location'); - QUnit.test('ember-routing/location/auto_location.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/location/auto_location.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/location/auto_location.js should pass jshint.'); - }); -}); -enifed('ember-routing/location/hash_location.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-routing/location'); - test('ember-routing/location/hash_location.js should pass jscs', function () { - ok(true, 'ember-routing/location/hash_location.js should pass jscs.'); + assert.ok(true, 'ember-routing/location/auto_location.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/location/hash_location.jshint', ['exports'], function (exports) { +enifed('ember-routing/location/hash_location.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-routing/location'); - QUnit.test('ember-routing/location/hash_location.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/location/hash_location.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/location/hash_location.js should pass jshint.'); - }); -}); -enifed('ember-routing/location/history_location.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-routing/location'); - test('ember-routing/location/history_location.js should pass jscs', function () { - ok(true, 'ember-routing/location/history_location.js should pass jscs.'); + assert.ok(true, 'ember-routing/location/hash_location.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/location/history_location.jshint', ['exports'], function (exports) { +enifed('ember-routing/location/history_location.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-routing/location'); - QUnit.test('ember-routing/location/history_location.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/location/history_location.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/location/history_location.js should pass jshint.'); - }); -}); -enifed('ember-routing/location/none_location.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-routing/location'); - test('ember-routing/location/none_location.js should pass jscs', function () { - ok(true, 'ember-routing/location/none_location.js should pass jscs.'); + assert.ok(true, 'ember-routing/location/history_location.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/location/none_location.jshint', ['exports'], function (exports) { +enifed('ember-routing/location/none_location.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-routing/location'); - QUnit.test('ember-routing/location/none_location.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/location/none_location.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/location/none_location.js should pass jshint.'); + assert.ok(true, 'ember-routing/location/none_location.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/location/util.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/location/util.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/location'); - test('ember-routing/location/util.js should pass jscs', function () { - ok(true, 'ember-routing/location/util.js should pass jscs.'); - }); -}); -enifed('ember-routing/location/util.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/location'); - QUnit.test('ember-routing/location/util.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/location/util.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/location/util.js should pass jshint.'); + assert.ok(true, 'ember-routing/location/util.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/services/routing.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/services/router.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/services'); - test('ember-routing/services/routing.js should pass jscs', function () { - ok(true, 'ember-routing/services/routing.js should pass jscs.'); - }); -}); -enifed('ember-routing/services/routing.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/services'); - QUnit.test('ember-routing/services/routing.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/services/router.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/services/routing.js should pass jshint.'); - }); -}); -enifed('ember-routing/system/cache.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-routing/system'); - test('ember-routing/system/cache.js should pass jscs', function () { - ok(true, 'ember-routing/system/cache.js should pass jscs.'); + assert.ok(true, 'ember-routing/services/router.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/system/cache.jshint', ['exports'], function (exports) { +enifed('ember-routing/services/routing.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-routing/system'); - QUnit.test('ember-routing/system/cache.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/services/routing.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/system/cache.js should pass jshint.'); - }); -}); -enifed('ember-routing/system/controller_for.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-routing/system'); - test('ember-routing/system/controller_for.js should pass jscs', function () { - ok(true, 'ember-routing/system/controller_for.js should pass jscs.'); + assert.ok(true, 'ember-routing/services/routing.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/system/controller_for.jshint', ['exports'], function (exports) { +enifed('ember-routing/system/cache.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-routing/system'); - QUnit.test('ember-routing/system/controller_for.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/system/cache.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/system/controller_for.js should pass jshint.'); + assert.ok(true, 'ember-routing/system/cache.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/system/dsl.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/system/controller_for.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/system'); - test('ember-routing/system/dsl.js should pass jscs', function () { - ok(true, 'ember-routing/system/dsl.js should pass jscs.'); - }); -}); -enifed('ember-routing/system/dsl.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/system'); - QUnit.test('ember-routing/system/dsl.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/system/controller_for.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/system/dsl.js should pass jshint.'); + assert.ok(true, 'ember-routing/system/controller_for.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/system/generate_controller.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/system/dsl.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/system'); - test('ember-routing/system/generate_controller.js should pass jscs', function () { - ok(true, 'ember-routing/system/generate_controller.js should pass jscs.'); - }); -}); -enifed('ember-routing/system/generate_controller.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/system'); - QUnit.test('ember-routing/system/generate_controller.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/system/dsl.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/system/generate_controller.js should pass jshint.'); + assert.ok(true, 'ember-routing/system/dsl.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/system/query_params.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/system/generate_controller.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/system'); - test('ember-routing/system/query_params.js should pass jscs', function () { - ok(true, 'ember-routing/system/query_params.js should pass jscs.'); - }); -}); -enifed('ember-routing/system/query_params.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/system'); - QUnit.test('ember-routing/system/query_params.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/system/generate_controller.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/system/query_params.js should pass jshint.'); - }); -}); -enifed('ember-routing/system/route.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-routing/system'); - test('ember-routing/system/route.js should pass jscs', function () { - ok(true, 'ember-routing/system/route.js should pass jscs.'); + assert.ok(true, 'ember-routing/system/generate_controller.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/system/route.jshint', ['exports'], function (exports) { +enifed('ember-routing/system/query_params.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-routing/system'); - QUnit.test('ember-routing/system/route.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/system/query_params.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/system/route.js should pass jshint.'); + assert.ok(true, 'ember-routing/system/query_params.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/system/router.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/system/route.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/system'); - test('ember-routing/system/router.js should pass jscs', function () { - ok(true, 'ember-routing/system/router.js should pass jscs.'); - }); -}); -enifed('ember-routing/system/router.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/system'); - QUnit.test('ember-routing/system/router.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/system/route.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/system/router.js should pass jshint.'); + assert.ok(true, 'ember-routing/system/route.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/system/router_state.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/system/router.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/system'); - test('ember-routing/system/router_state.js should pass jscs', function () { - ok(true, 'ember-routing/system/router_state.js should pass jscs.'); + QUnit.module('ESLint | ember-routing/system/router.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/system/router.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/system/router_state.jshint', ['exports'], function (exports) { +enifed('ember-routing/system/router_state.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-routing/system'); - QUnit.test('ember-routing/system/router_state.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/system/router_state.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/system/router_state.js should pass jshint.'); + assert.ok(true, 'ember-routing/system/router_state.js should pass ESLint\n\n'); }); }); enifed('ember-routing/tests/ext/controller_test', ['exports', 'ember-utils', 'internal-test-helpers', 'ember-runtime'], function (exports, _emberUtils, _internalTestHelpers, _emberRuntime) { @@ -48438,21 +47031,13 @@ enifed('ember-routing/tests/ext/controller_test', ['exports', 'ember-utils', 'in strictEqual(controller.transitionToRoute(queryParams), queryParams, 'passes query param only transitions through'); }); }); -enifed('ember-routing/tests/ext/controller_test.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/tests/ext/controller_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/tests/ext'); - test('ember-routing/tests/ext/controller_test.js should pass jscs', function () { - ok(true, 'ember-routing/tests/ext/controller_test.js should pass jscs.'); - }); -}); -enifed('ember-routing/tests/ext/controller_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/tests/ext'); - QUnit.test('ember-routing/tests/ext/controller_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/tests/ext/controller_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/tests/ext/controller_test.js should pass jshint.'); + assert.ok(true, 'ember-routing/tests/ext/controller_test.js should pass ESLint\n\n'); }); }); enifed('ember-routing/tests/location/auto_location_test', ['exports', 'ember-utils', 'ember-environment', 'ember-metal', 'ember-routing/location/auto_location', 'ember-routing/location/history_location', 'ember-routing/location/hash_location', 'ember-routing/location/none_location', 'internal-test-helpers'], function (exports, _emberUtils, _emberEnvironment, _emberMetal, _emberRoutingLocationAuto_location, _emberRoutingLocationHistory_location, _emberRoutingLocationHash_location, _emberRoutingLocationNone_location, _internalTestHelpers) { @@ -48741,21 +47326,13 @@ enifed('ember-routing/tests/location/auto_location_test', ['exports', 'ember-uti equal(_emberRoutingLocationAuto_location.getHashPath('/app/', browserLocation), '/app/#/#about?foo=bar#foo', 'URLs with a hash not following #/ convention shouldn\'t be normalized as a route'); }); }); -enifed('ember-routing/tests/location/auto_location_test.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/tests/location/auto_location_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/tests/location'); - test('ember-routing/tests/location/auto_location_test.js should pass jscs', function () { - ok(true, 'ember-routing/tests/location/auto_location_test.js should pass jscs.'); - }); -}); -enifed('ember-routing/tests/location/auto_location_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/tests/location'); - QUnit.test('ember-routing/tests/location/auto_location_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/tests/location/auto_location_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/tests/location/auto_location_test.js should pass jshint.'); + assert.ok(true, 'ember-routing/tests/location/auto_location_test.js should pass ESLint\n\n'); }); }); enifed('ember-routing/tests/location/hash_location_test', ['exports', 'ember-metal', 'ember-routing/location/hash_location'], function (exports, _emberMetal, _emberRoutingLocationHash_location) { @@ -48951,21 +47528,13 @@ enifed('ember-routing/tests/location/hash_location_test', ['exports', 'ember-met triggerHashchange(); }); }); -enifed('ember-routing/tests/location/hash_location_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-routing/tests/location'); - test('ember-routing/tests/location/hash_location_test.js should pass jscs', function () { - ok(true, 'ember-routing/tests/location/hash_location_test.js should pass jscs.'); - }); -}); -enifed('ember-routing/tests/location/hash_location_test.jshint', ['exports'], function (exports) { +enifed('ember-routing/tests/location/hash_location_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-routing/tests/location'); - QUnit.test('ember-routing/tests/location/hash_location_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/tests/location/hash_location_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/tests/location/hash_location_test.js should pass jshint.'); + assert.ok(true, 'ember-routing/tests/location/hash_location_test.js should pass ESLint\n\n'); }); }); enifed('ember-routing/tests/location/history_location_test', ['exports', 'ember-metal', 'ember-routing/location/history_location'], function (exports, _emberMetal, _emberRoutingLocationHistory_location) { @@ -49086,48 +47655,96 @@ enifed('ember-routing/tests/location/history_location_test', ['exports', 'ember- location.initState(); }); - QUnit.test('base URL is preserved when moving around', function () { - expect(1); + if (_emberMetal.isFeatureEnabled('ember-unique-location-history-state')) { + QUnit.test('base URL is preserved when moving around', function () { + expect(2); - HistoryTestLocation.reopen({ - init: function () { - this._super.apply(this, arguments); + HistoryTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); - _emberMetal.set(this, 'location', mockBrowserLocation('/base/foo/bar')); - _emberMetal.set(this, 'baseURL', '/base/'); - } + _emberMetal.set(this, 'location', mockBrowserLocation('/base/foo/bar')); + _emberMetal.set(this, 'baseURL', '/base/'); + } + }); + + createLocation(); + location.initState(); + location.setURL('/one/two'); + + equal(location._historyState.path, '/base/one/two'); + ok(location._historyState.uuid); }); - createLocation(); - location.initState(); - location.setURL('/one/two'); + QUnit.test('setURL continues to set even with a null state (iframes may set this)', function () { + expect(2); - equal(location._historyState.path, '/base/one/two'); - }); + createLocation(); + location.initState(); - QUnit.test('setURL continues to set even with a null state (iframes may set this)', function () { - expect(1); + FakeHistory.pushState(null); + location.setURL('/three/four'); - createLocation(); - location.initState(); + equal(location._historyState.path, '/three/four'); + ok(location._historyState.uuid); + }); - FakeHistory.pushState(null); - location.setURL('/three/four'); + QUnit.test('replaceURL continues to set even with a null state (iframes may set this)', function () { + expect(2); - equal(location._historyState.path, '/three/four'); - }); + createLocation(); + location.initState(); - QUnit.test('replaceURL continues to set even with a null state (iframes may set this)', function () { - expect(1); + FakeHistory.pushState(null); + location.replaceURL('/three/four'); - createLocation(); - location.initState(); + equal(location._historyState.path, '/three/four'); + ok(location._historyState.uuid); + }); + } else { + QUnit.test('base URL is preserved when moving around', function () { + expect(1); - FakeHistory.pushState(null); - location.replaceURL('/three/four'); + HistoryTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); - equal(location._historyState.path, '/three/four'); - }); + _emberMetal.set(this, 'location', mockBrowserLocation('/base/foo/bar')); + _emberMetal.set(this, 'baseURL', '/base/'); + } + }); + + createLocation(); + location.initState(); + location.setURL('/one/two'); + + equal(location._historyState.path, '/base/one/two'); + }); + + QUnit.test('setURL continues to set even with a null state (iframes may set this)', function () { + expect(1); + + createLocation(); + location.initState(); + + FakeHistory.pushState(null); + location.setURL('/three/four'); + + equal(location._historyState.path, '/three/four'); + }); + + QUnit.test('replaceURL continues to set even with a null state (iframes may set this)', function () { + expect(1); + + createLocation(); + location.initState(); + + FakeHistory.pushState(null); + location.replaceURL('/three/four'); + + equal(location._historyState.path, '/three/four'); + }); + } QUnit.test('HistoryLocation.getURL() returns the current url, excluding both rootURL and baseURL', function () { expect(1); @@ -49258,21 +47875,13 @@ enifed('ember-routing/tests/location/history_location_test', ['exports', 'ember- equal(location.getURL(), '/foo/bar?time=morphin#pink-power-ranger'); }); }); -enifed('ember-routing/tests/location/history_location_test.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/tests/location/history_location_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/tests/location'); - test('ember-routing/tests/location/history_location_test.js should pass jscs', function () { - ok(true, 'ember-routing/tests/location/history_location_test.js should pass jscs.'); - }); -}); -enifed('ember-routing/tests/location/history_location_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/tests/location'); - QUnit.test('ember-routing/tests/location/history_location_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/tests/location/history_location_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/tests/location/history_location_test.js should pass jshint.'); + assert.ok(true, 'ember-routing/tests/location/history_location_test.js should pass ESLint\n\n'); }); }); enifed('ember-routing/tests/location/none_location_test', ['exports', 'ember-metal', 'ember-routing/location/none_location'], function (exports, _emberMetal, _emberRoutingLocationNone_location) { @@ -49365,21 +47974,13 @@ enifed('ember-routing/tests/location/none_location_test', ['exports', 'ember-met equal(location.getURL(), '/bars/baz'); }); }); -enifed('ember-routing/tests/location/none_location_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-routing/tests/location'); - test('ember-routing/tests/location/none_location_test.js should pass jscs', function () { - ok(true, 'ember-routing/tests/location/none_location_test.js should pass jscs.'); - }); -}); -enifed('ember-routing/tests/location/none_location_test.jshint', ['exports'], function (exports) { +enifed('ember-routing/tests/location/none_location_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-routing/tests/location'); - QUnit.test('ember-routing/tests/location/none_location_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/tests/location/none_location_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/tests/location/none_location_test.js should pass jshint.'); + assert.ok(true, 'ember-routing/tests/location/none_location_test.js should pass ESLint\n\n'); }); }); enifed('ember-routing/tests/location/util_test', ['exports', 'ember-utils', 'ember-routing/location/util'], function (exports, _emberUtils, _emberRoutingLocationUtil) { @@ -49474,21 +48075,13 @@ enifed('ember-routing/tests/location/util_test', ['exports', 'ember-utils', 'emb }); // jscs:enable }); -enifed('ember-routing/tests/location/util_test.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/tests/location/util_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/tests/location'); - test('ember-routing/tests/location/util_test.js should pass jscs', function () { - ok(true, 'ember-routing/tests/location/util_test.js should pass jscs.'); - }); -}); -enifed('ember-routing/tests/location/util_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/tests/location'); - QUnit.test('ember-routing/tests/location/util_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/tests/location/util_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/tests/location/util_test.js should pass jshint.'); + assert.ok(true, 'ember-routing/tests/location/util_test.js should pass ESLint\n\n'); }); }); enifed('ember-routing/tests/system/cache_test', ['exports', 'ember-routing/system/cache'], function (exports, _emberRoutingSystemCache) { @@ -49541,21 +48134,13 @@ enifed('ember-routing/tests/system/cache_test', ['exports', 'ember-routing/syste assert.strictEqual(this.cache.lookup('constructor', 'bar', defaultValue), defaultValue); }); }); -enifed('ember-routing/tests/system/cache_test.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/tests/system/cache_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/tests/system'); - test('ember-routing/tests/system/cache_test.js should pass jscs', function () { - ok(true, 'ember-routing/tests/system/cache_test.js should pass jscs.'); - }); -}); -enifed('ember-routing/tests/system/cache_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/tests/system'); - QUnit.test('ember-routing/tests/system/cache_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/tests/system/cache_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/tests/system/cache_test.js should pass jshint.'); + assert.ok(true, 'ember-routing/tests/system/cache_test.js should pass ESLint\n\n'); }); }); enifed('ember-routing/tests/system/controller_for_test', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/system/controller_for', 'ember-routing/system/generate_controller', 'internal-test-helpers'], function (exports, _emberMetal, _emberRuntime, _emberRoutingSystemController_for, _emberRoutingSystemGenerate_controller, _internalTestHelpers) { @@ -49632,37 +48217,48 @@ enifed('ember-routing/tests/system/controller_for_test', ['exports', 'ember-meta } }); - QUnit.test('generateController should create Ember.Controller', function () { + QUnit.test('generateController should return Ember.Controller', function () { var controller = _emberRoutingSystemGenerate_controller.default(appInstance, 'home'); - ok(controller instanceof _emberRuntime.Controller, 'should create controller'); + ok(controller instanceof _emberRuntime.Controller, 'should return controller'); }); - QUnit.test('generateController should create App.Controller if provided', function () { + QUnit.test('generateController should return App.Controller if provided', function () { var controller = undefined; namespace.Controller = _emberRuntime.Controller.extend(); controller = _emberRoutingSystemGenerate_controller.default(appInstance, 'home'); - ok(controller instanceof namespace.Controller, 'should create controller'); + ok(controller instanceof namespace.Controller, 'should return controller'); }); -}); -// A -enifed('ember-routing/tests/system/controller_for_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - module('JSCS - ember-routing/tests/system'); - test('ember-routing/tests/system/controller_for_test.js should pass jscs', function () { - ok(true, 'ember-routing/tests/system/controller_for_test.js should pass jscs.'); + QUnit.test('generateController should return controller:basic if provided', function () { + var controller = undefined; + + var BasicController = _emberRuntime.Controller.extend(); + appInstance.register('controller:basic', BasicController); + + controller = _emberRoutingSystemGenerate_controller.default(appInstance, 'home'); + + if (_emberMetal.isFeatureEnabled('ember-no-double-extend')) { + ok(controller instanceof BasicController, 'should return base class of controller'); + } else { + var doubleExtendedFactory = undefined; + ignoreDeprecation(function () { + doubleExtendedFactory = appInstance._lookupFactory('controller:basic'); + }); + ok(controller instanceof doubleExtendedFactory, 'should return double-extended controller'); + } }); }); -enifed('ember-routing/tests/system/controller_for_test.jshint', ['exports'], function (exports) { +// A +enifed('ember-routing/tests/system/controller_for_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-routing/tests/system'); - QUnit.test('ember-routing/tests/system/controller_for_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/tests/system/controller_for_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/tests/system/controller_for_test.js should pass jshint.'); + assert.ok(true, 'ember-routing/tests/system/controller_for_test.js should pass ESLint\n\n'); }); }); enifed('ember-routing/tests/system/dsl_test', ['exports', 'ember-utils', 'ember-routing/system/router', 'internal-test-helpers'], function (exports, _emberUtils, _emberRoutingSystemRouter, _internalTestHelpers) { @@ -49871,7 +48467,7 @@ enifed('ember-routing/tests/system/dsl_test', ['exports', 'ember-utils', 'ember- router._initRouterJs(); assert.deepEqual(router.router.recognizer.names['bleep.bloop.chat'].segments.slice(1, 4).map(function (s) { - return s.string; + return s.value; }), ['bleep', 'bloop', 'custom-chat'], 'segments are properly associated with mounted engine'); }); @@ -49895,7 +48491,7 @@ enifed('ember-routing/tests/system/dsl_test', ['exports', 'ember-utils', 'ember- router._initRouterJs(); assert.deepEqual(router.router.recognizer.names['bleep.bloop.blork'].segments.slice(1, 4).map(function (s) { - return s.string; + return s.value; }), ['bleep', 'bloop', 'blork'], 'segments are properly associated with mounted engine with aliased name'); }); @@ -49994,24 +48590,16 @@ enifed('ember-routing/tests/system/dsl_test', ['exports', 'ember-utils', 'ember- ok(!router.router.recognizer.names['news.blog_error'], 'nested reset error route was not added'); }); }); -enifed('ember-routing/tests/system/dsl_test.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/tests/system/dsl_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/tests/system'); - test('ember-routing/tests/system/dsl_test.js should pass jscs', function () { - ok(true, 'ember-routing/tests/system/dsl_test.js should pass jscs.'); - }); -}); -enifed('ember-routing/tests/system/dsl_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/tests/system'); - QUnit.test('ember-routing/tests/system/dsl_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/tests/system/dsl_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/tests/system/dsl_test.js should pass jshint.'); + assert.ok(true, 'ember-routing/tests/system/dsl_test.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/tests/system/route_test', ['exports', 'ember-utils', 'internal-test-helpers', 'ember-runtime', 'ember-routing/system/route'], function (exports, _emberUtils, _internalTestHelpers, _emberRuntime, _emberRoutingSystemRoute) { +enifed('ember-routing/tests/system/route_test', ['exports', 'ember-utils', 'internal-test-helpers', 'ember-runtime', 'ember-routing/system/route', 'container'], function (exports, _emberUtils, _internalTestHelpers, _emberRuntime, _emberRoutingSystemRoute, _container) { 'use strict'; var route = undefined, @@ -50033,6 +48621,8 @@ enifed('ember-routing/tests/system/route_test', ['exports', 'ember-utils', 'inte }); QUnit.test('default store utilizes the container to acquire the model factory', function () { + var _ownerOptions; + expect(4); var Post = _emberRuntime.Object.extend(); @@ -50044,19 +48634,24 @@ enifed('ember-routing/tests/system/route_test', ['exports', 'ember-utils', 'inte } }); - _emberUtils.setOwner(route, _internalTestHelpers.buildOwner({ - ownerOptions: { + var ownerOptions = { + ownerOptions: (_ownerOptions = { hasRegistration: function () { return true; - }, + } + }, _ownerOptions[_container.FACTORY_FOR] = function (fullName) { + equal(fullName, 'model:post', 'correct factory was looked up'); - _lookupFactory: function (fullName) { - equal(fullName, 'model:post', 'correct factory was looked up'); + return { + class: Post, + create: function () { + return Post.create(); + } + }; + }, _ownerOptions) + }; - return Post; - } - } - })); + _emberUtils.setOwner(route, _internalTestHelpers.buildOwner(ownerOptions)); route.set('_qp', null); @@ -50519,21 +49114,13 @@ enifed('ember-routing/tests/system/route_test', ['exports', 'ember-utils', 'inte strictEqual(route.replaceWith(queryParams), queryParams, 'passes query param only transitions through'); }); }); -enifed('ember-routing/tests/system/route_test.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/tests/system/route_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/tests/system'); - test('ember-routing/tests/system/route_test.js should pass jscs', function () { - ok(true, 'ember-routing/tests/system/route_test.js should pass jscs.'); - }); -}); -enifed('ember-routing/tests/system/route_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/tests/system'); - QUnit.test('ember-routing/tests/system/route_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/tests/system/route_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/tests/system/route_test.js should pass jshint.'); + assert.ok(true, 'ember-routing/tests/system/route_test.js should pass ESLint\n\n'); }); }); enifed('ember-routing/tests/system/router_test', ['exports', 'ember-utils', 'ember-routing/location/hash_location', 'ember-routing/location/history_location', 'ember-routing/location/auto_location', 'ember-routing/location/none_location', 'ember-routing/system/router', 'internal-test-helpers'], function (exports, _emberUtils, _emberRoutingLocationHash_location, _emberRoutingLocationHistory_location, _emberRoutingLocationAuto_location, _emberRoutingLocationNone_location, _emberRoutingSystemRouter, _internalTestHelpers) { @@ -50786,21 +49373,13 @@ enifed('ember-routing/tests/system/router_test', ['exports', 'ember-utils', 'emb _emberRoutingSystemRouter.triggerEvent(handlerInfos, false, ['loading']); }); }); -enifed('ember-routing/tests/system/router_test.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/tests/system/router_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/tests/system'); - test('ember-routing/tests/system/router_test.js should pass jscs', function () { - ok(true, 'ember-routing/tests/system/router_test.js should pass jscs.'); - }); -}); -enifed('ember-routing/tests/system/router_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/tests/system'); - QUnit.test('ember-routing/tests/system/router_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/tests/system/router_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/tests/system/router_test.js should pass jshint.'); + assert.ok(true, 'ember-routing/tests/system/router_test.js should pass ESLint\n\n'); }); }); enifed('ember-routing/tests/utils_test', ['exports', 'ember-routing/utils'], function (exports, _emberRoutingUtils) { @@ -50808,15 +49387,6 @@ enifed('ember-routing/tests/utils_test', ['exports', 'ember-routing/utils'], fun QUnit.module('Routing query parameter utils - normalizeControllerQueryParams'); - QUnit.test('returns the cached value if that has been previously set', function (assert) { - var cached = {}; - var params = ['foo']; - params._qpMap = cached; - - var normalized = _emberRoutingUtils.normalizeControllerQueryParams(params); - equal(cached, normalized, 'cached value returned if previously set'); - }); - QUnit.test('converts array style into verbose object style', function (assert) { var paramName = 'foo'; var params = [paramName]; @@ -50827,7 +49397,7 @@ enifed('ember-routing/tests/utils_test', ['exports', 'ember-routing/utils'], fun equal(normalized[paramName].scope, 'model', 'defaults scope to model'); }); - QUnit.test('converts object stlye [{foo: \'an_alias\'}]', function (assert) { + QUnit.test('converts object style [{foo: \'an_alias\'}]', function (assert) { var paramName = 'foo'; var params = [{ 'foo': 'an_alias' }]; var normalized = _emberRoutingUtils.normalizeControllerQueryParams(params); @@ -50837,7 +49407,7 @@ enifed('ember-routing/tests/utils_test', ['exports', 'ember-routing/utils'], fun equal(normalized[paramName].scope, 'model', 'defaults scope to model'); }); - QUnit.test('retains maximally verbose object stlye [{foo: {as: \'foo\'}}]', function (assert) { + QUnit.test('retains maximally verbose object style [{foo: {as: \'foo\'}}]', function (assert) { var paramName = 'foo'; var params = [{ 'foo': { as: 'an_alias' } }]; var normalized = _emberRoutingUtils.normalizeControllerQueryParams(params); @@ -50847,713 +49417,382 @@ enifed('ember-routing/tests/utils_test', ['exports', 'ember-routing/utils'], fun equal(normalized[paramName].scope, 'model', 'defaults scope to model'); }); }); -enifed('ember-routing/tests/utils_test.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/tests/utils_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/tests'); - test('ember-routing/tests/utils_test.js should pass jscs', function () { - ok(true, 'ember-routing/tests/utils_test.js should pass jscs.'); - }); -}); -enifed('ember-routing/tests/utils_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/tests'); - QUnit.test('ember-routing/tests/utils_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/tests/utils_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/tests/utils_test.js should pass jshint.'); + assert.ok(true, 'ember-routing/tests/utils_test.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/utils.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/utils.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing'); - test('ember-routing/utils.js should pass jscs', function () { - ok(true, 'ember-routing/utils.js should pass jscs.'); - }); -}); -enifed('ember-routing/utils.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing'); - QUnit.test('ember-routing/utils.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/utils.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/utils.js should pass jshint.'); - }); -}); -enifed('ember-runtime/compare.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime'); - test('ember-runtime/compare.js should pass jscs', function () { - ok(true, 'ember-runtime/compare.js should pass jscs.'); + assert.ok(true, 'ember-routing/utils.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/compare.jshint', ['exports'], function (exports) { +enifed('ember-runtime/compare.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime'); - QUnit.test('ember-runtime/compare.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/compare.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/compare.js should pass jshint.'); - }); -}); -enifed('ember-runtime/computed/computed_macros.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/computed'); - test('ember-runtime/computed/computed_macros.js should pass jscs', function () { - ok(true, 'ember-runtime/computed/computed_macros.js should pass jscs.'); + assert.ok(true, 'ember-runtime/compare.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/computed/computed_macros.jshint', ['exports'], function (exports) { +enifed('ember-runtime/computed/computed_macros.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/computed'); - QUnit.test('ember-runtime/computed/computed_macros.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/computed/computed_macros.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/computed/computed_macros.js should pass jshint.'); + assert.ok(true, 'ember-runtime/computed/computed_macros.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/computed/reduce_computed_macros.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/computed/reduce_computed_macros.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/computed'); - test('ember-runtime/computed/reduce_computed_macros.js should pass jscs', function () { - ok(true, 'ember-runtime/computed/reduce_computed_macros.js should pass jscs.'); - }); -}); -enifed('ember-runtime/computed/reduce_computed_macros.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/computed'); - QUnit.test('ember-runtime/computed/reduce_computed_macros.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/computed/reduce_computed_macros.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/computed/reduce_computed_macros.js should pass jshint.'); - }); -}); -enifed('ember-runtime/controllers/controller.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/controllers'); - test('ember-runtime/controllers/controller.js should pass jscs', function () { - ok(true, 'ember-runtime/controllers/controller.js should pass jscs.'); + assert.ok(true, 'ember-runtime/computed/reduce_computed_macros.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/controllers/controller.jshint', ['exports'], function (exports) { +enifed('ember-runtime/controllers/controller.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/controllers'); - QUnit.test('ember-runtime/controllers/controller.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/controllers/controller.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/controllers/controller.js should pass jshint.'); + assert.ok(true, 'ember-runtime/controllers/controller.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/copy.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/copy.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime'); - test('ember-runtime/copy.js should pass jscs', function () { - ok(true, 'ember-runtime/copy.js should pass jscs.'); - }); -}); -enifed('ember-runtime/copy.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime'); - QUnit.test('ember-runtime/copy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/copy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/copy.js should pass jshint.'); + assert.ok(true, 'ember-runtime/copy.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/ext/function.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/ext/function.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/ext'); - test('ember-runtime/ext/function.js should pass jscs', function () { - ok(true, 'ember-runtime/ext/function.js should pass jscs.'); - }); -}); -enifed('ember-runtime/ext/function.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/ext'); - QUnit.test('ember-runtime/ext/function.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/ext/function.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/ext/function.js should pass jshint.'); + assert.ok(true, 'ember-runtime/ext/function.js should pass ESLint\n\n'); }); }); -enifed("ember-runtime/ext/rsvp.jscs-test", ["exports"], function (exports) { - "use strict"; -}); -enifed('ember-runtime/ext/rsvp.jshint', ['exports'], function (exports) { +enifed('ember-runtime/ext/rsvp.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/ext'); - QUnit.test('ember-runtime/ext/rsvp.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/ext/rsvp.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/ext/rsvp.js should pass jshint.'); - }); -}); -enifed('ember-runtime/ext/string.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/ext'); - test('ember-runtime/ext/string.js should pass jscs', function () { - ok(true, 'ember-runtime/ext/string.js should pass jscs.'); + assert.ok(true, 'ember-runtime/ext/rsvp.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/ext/string.jshint', ['exports'], function (exports) { +enifed('ember-runtime/ext/string.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/ext'); - QUnit.test('ember-runtime/ext/string.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/ext/string.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/ext/string.js should pass jshint.'); - }); -}); -enifed('ember-runtime/index.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime'); - test('ember-runtime/index.js should pass jscs', function () { - ok(true, 'ember-runtime/index.js should pass jscs.'); + assert.ok(true, 'ember-runtime/ext/string.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/index.jshint', ['exports'], function (exports) { +enifed('ember-runtime/index.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime'); - QUnit.test('ember-runtime/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/index.js should pass jshint.'); + assert.ok(true, 'ember-runtime/index.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/inject.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/inject.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime'); - test('ember-runtime/inject.js should pass jscs', function () { - ok(true, 'ember-runtime/inject.js should pass jscs.'); - }); -}); -enifed('ember-runtime/inject.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime'); - QUnit.test('ember-runtime/inject.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/inject.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/inject.js should pass jshint.'); + assert.ok(true, 'ember-runtime/inject.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/is-equal.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/is-equal.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime'); - test('ember-runtime/is-equal.js should pass jscs', function () { - ok(true, 'ember-runtime/is-equal.js should pass jscs.'); - }); -}); -enifed('ember-runtime/is-equal.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime'); - QUnit.test('ember-runtime/is-equal.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/is-equal.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/is-equal.js should pass jshint.'); - }); -}); -enifed('ember-runtime/mixins/-proxy.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/-proxy.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/-proxy.js should pass jscs.'); + assert.ok(true, 'ember-runtime/is-equal.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/-proxy.jshint', ['exports'], function (exports) { +enifed('ember-runtime/mixins/-proxy.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/-proxy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/-proxy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/-proxy.js should pass jshint.'); + assert.ok(true, 'ember-runtime/mixins/-proxy.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/action_handler.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/mixins/action_handler.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/action_handler.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/action_handler.js should pass jscs.'); - }); -}); -enifed('ember-runtime/mixins/action_handler.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/action_handler.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/action_handler.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/action_handler.js should pass jshint.'); + assert.ok(true, 'ember-runtime/mixins/action_handler.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/array.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/mixins/array.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/array.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/array.js should pass jscs.'); - }); -}); -enifed('ember-runtime/mixins/array.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/array.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/array.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/array.js should pass jshint.'); + assert.ok(true, 'ember-runtime/mixins/array.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/comparable.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/mixins/comparable.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/comparable.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/comparable.js should pass jscs.'); - }); -}); -enifed('ember-runtime/mixins/comparable.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/comparable.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/comparable.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/comparable.js should pass jshint.'); - }); -}); -enifed('ember-runtime/mixins/container_proxy.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/container_proxy.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/container_proxy.js should pass jscs.'); + assert.ok(true, 'ember-runtime/mixins/comparable.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/container_proxy.jshint', ['exports'], function (exports) { +enifed('ember-runtime/mixins/container_proxy.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/container_proxy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/container_proxy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/container_proxy.js should pass jshint.'); - }); -}); -enifed('ember-runtime/mixins/controller.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/controller.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/controller.js should pass jscs.'); + assert.ok(true, 'ember-runtime/mixins/container_proxy.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/controller.jshint', ['exports'], function (exports) { +enifed('ember-runtime/mixins/controller.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/controller.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/controller.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/controller.js should pass jshint.'); - }); -}); -enifed('ember-runtime/mixins/controller_content_model_alias_deprecation.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/controller_content_model_alias_deprecation.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/controller_content_model_alias_deprecation.js should pass jscs.'); + assert.ok(true, 'ember-runtime/mixins/controller.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/controller_content_model_alias_deprecation.jshint', ['exports'], function (exports) { +enifed('ember-runtime/mixins/controller_content_model_alias_deprecation.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/controller_content_model_alias_deprecation.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/controller_content_model_alias_deprecation.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/controller_content_model_alias_deprecation.js should pass jshint.'); + assert.ok(true, 'ember-runtime/mixins/controller_content_model_alias_deprecation.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/copyable.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/mixins/copyable.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/copyable.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/copyable.js should pass jscs.'); - }); -}); -enifed('ember-runtime/mixins/copyable.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/copyable.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/copyable.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/copyable.js should pass jshint.'); + assert.ok(true, 'ember-runtime/mixins/copyable.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/enumerable.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/mixins/enumerable.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/enumerable.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/enumerable.js should pass jscs.'); - }); -}); -enifed('ember-runtime/mixins/enumerable.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/enumerable.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/enumerable.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/enumerable.js should pass jshint.'); + assert.ok(true, 'ember-runtime/mixins/enumerable.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/evented.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/mixins/evented.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/evented.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/evented.js should pass jscs.'); - }); -}); -enifed('ember-runtime/mixins/evented.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/evented.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/evented.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/evented.js should pass jshint.'); - }); -}); -enifed('ember-runtime/mixins/freezable.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/freezable.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/freezable.js should pass jscs.'); + assert.ok(true, 'ember-runtime/mixins/evented.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/freezable.jshint', ['exports'], function (exports) { +enifed('ember-runtime/mixins/freezable.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/freezable.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/freezable.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/freezable.js should pass jshint.'); - }); -}); -enifed('ember-runtime/mixins/mutable_array.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/mutable_array.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/mutable_array.js should pass jscs.'); + assert.ok(true, 'ember-runtime/mixins/freezable.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/mutable_array.jshint', ['exports'], function (exports) { +enifed('ember-runtime/mixins/mutable_array.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/mutable_array.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/mutable_array.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/mutable_array.js should pass jshint.'); + assert.ok(true, 'ember-runtime/mixins/mutable_array.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/mutable_enumerable.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/mixins/mutable_enumerable.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/mutable_enumerable.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/mutable_enumerable.js should pass jscs.'); - }); -}); -enifed('ember-runtime/mixins/mutable_enumerable.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/mutable_enumerable.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/mutable_enumerable.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/mutable_enumerable.js should pass jshint.'); - }); -}); -enifed('ember-runtime/mixins/observable.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/observable.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/observable.js should pass jscs.'); + assert.ok(true, 'ember-runtime/mixins/mutable_enumerable.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/observable.jshint', ['exports'], function (exports) { +enifed('ember-runtime/mixins/observable.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/observable.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/observable.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/observable.js should pass jshint.'); + assert.ok(true, 'ember-runtime/mixins/observable.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/promise_proxy.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/mixins/promise_proxy.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/promise_proxy.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/promise_proxy.js should pass jscs.'); - }); -}); -enifed('ember-runtime/mixins/promise_proxy.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/promise_proxy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/promise_proxy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/promise_proxy.js should pass jshint.'); - }); -}); -enifed('ember-runtime/mixins/registry_proxy.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/registry_proxy.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/registry_proxy.js should pass jscs.'); + assert.ok(true, 'ember-runtime/mixins/promise_proxy.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/registry_proxy.jshint', ['exports'], function (exports) { +enifed('ember-runtime/mixins/registry_proxy.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/registry_proxy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/registry_proxy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/registry_proxy.js should pass jshint.'); - }); -}); -enifed('ember-runtime/mixins/target_action_support.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/target_action_support.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/target_action_support.js should pass jscs.'); + assert.ok(true, 'ember-runtime/mixins/registry_proxy.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/target_action_support.jshint', ['exports'], function (exports) { +enifed('ember-runtime/mixins/target_action_support.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/target_action_support.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/target_action_support.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/target_action_support.js should pass jshint.'); - }); -}); -enifed('ember-runtime/string_registry.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime'); - test('ember-runtime/string_registry.js should pass jscs', function () { - ok(true, 'ember-runtime/string_registry.js should pass jscs.'); + assert.ok(true, 'ember-runtime/mixins/target_action_support.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/string_registry.jshint', ['exports'], function (exports) { +enifed('ember-runtime/string_registry.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime'); - QUnit.test('ember-runtime/string_registry.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/string_registry.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/string_registry.js should pass jshint.'); + assert.ok(true, 'ember-runtime/string_registry.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/system/application.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/system/application.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/system'); - test('ember-runtime/system/application.js should pass jscs', function () { - ok(true, 'ember-runtime/system/application.js should pass jscs.'); - }); -}); -enifed('ember-runtime/system/application.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/system'); - QUnit.test('ember-runtime/system/application.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/system/application.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/system/application.js should pass jshint.'); + assert.ok(true, 'ember-runtime/system/application.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/system/array_proxy.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/system/array_proxy.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/system'); - test('ember-runtime/system/array_proxy.js should pass jscs', function () { - ok(true, 'ember-runtime/system/array_proxy.js should pass jscs.'); - }); -}); -enifed('ember-runtime/system/array_proxy.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/system'); - QUnit.test('ember-runtime/system/array_proxy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/system/array_proxy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/system/array_proxy.js should pass jshint.'); + assert.ok(true, 'ember-runtime/system/array_proxy.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/system/core_object.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/system/core_object.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/system'); - test('ember-runtime/system/core_object.js should pass jscs', function () { - ok(true, 'ember-runtime/system/core_object.js should pass jscs.'); - }); -}); -enifed('ember-runtime/system/core_object.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/system'); - QUnit.test('ember-runtime/system/core_object.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/system/core_object.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/system/core_object.js should pass jshint.'); + assert.ok(true, 'ember-runtime/system/core_object.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/system/each_proxy.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/system/each_proxy.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/system'); - test('ember-runtime/system/each_proxy.js should pass jscs', function () { - ok(true, 'ember-runtime/system/each_proxy.js should pass jscs.'); - }); -}); -enifed('ember-runtime/system/each_proxy.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/system'); - QUnit.test('ember-runtime/system/each_proxy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/system/each_proxy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/system/each_proxy.js should pass jshint.'); - }); -}); -enifed('ember-runtime/system/lazy_load.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/system'); - test('ember-runtime/system/lazy_load.js should pass jscs', function () { - ok(true, 'ember-runtime/system/lazy_load.js should pass jscs.'); + assert.ok(true, 'ember-runtime/system/each_proxy.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/system/lazy_load.jshint', ['exports'], function (exports) { +enifed('ember-runtime/system/lazy_load.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/system'); - QUnit.test('ember-runtime/system/lazy_load.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/system/lazy_load.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/system/lazy_load.js should pass jshint.'); + assert.ok(true, 'ember-runtime/system/lazy_load.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/system/namespace.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/system/namespace.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/system'); - test('ember-runtime/system/namespace.js should pass jscs', function () { - ok(true, 'ember-runtime/system/namespace.js should pass jscs.'); - }); -}); -enifed('ember-runtime/system/namespace.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/system'); - QUnit.test('ember-runtime/system/namespace.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/system/namespace.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/system/namespace.js should pass jshint.'); + assert.ok(true, 'ember-runtime/system/namespace.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/system/native_array.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/system/native_array.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/system'); - test('ember-runtime/system/native_array.js should pass jscs', function () { - ok(true, 'ember-runtime/system/native_array.js should pass jscs.'); - }); -}); -enifed('ember-runtime/system/native_array.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/system'); - QUnit.test('ember-runtime/system/native_array.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/system/native_array.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/system/native_array.js should pass jshint.'); - }); -}); -enifed('ember-runtime/system/object.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/system'); - test('ember-runtime/system/object.js should pass jscs', function () { - ok(true, 'ember-runtime/system/object.js should pass jscs.'); + assert.ok(true, 'ember-runtime/system/native_array.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/system/object.jshint', ['exports'], function (exports) { +enifed('ember-runtime/system/object.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/system'); - QUnit.test('ember-runtime/system/object.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/system/object.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/system/object.js should pass jshint.'); - }); -}); -enifed('ember-runtime/system/object_proxy.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/system'); - test('ember-runtime/system/object_proxy.js should pass jscs', function () { - ok(true, 'ember-runtime/system/object_proxy.js should pass jscs.'); + assert.ok(true, 'ember-runtime/system/object.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/system/object_proxy.jshint', ['exports'], function (exports) { +enifed('ember-runtime/system/object_proxy.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/system'); - QUnit.test('ember-runtime/system/object_proxy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/system/object_proxy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/system/object_proxy.js should pass jshint.'); + assert.ok(true, 'ember-runtime/system/object_proxy.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/system/service.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/system/service.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/system'); - test('ember-runtime/system/service.js should pass jscs', function () { - ok(true, 'ember-runtime/system/service.js should pass jscs.'); - }); -}); -enifed('ember-runtime/system/service.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/system'); - QUnit.test('ember-runtime/system/service.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/system/service.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/system/service.js should pass jshint.'); - }); -}); -enifed('ember-runtime/system/string.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/system'); - test('ember-runtime/system/string.js should pass jscs', function () { - ok(true, 'ember-runtime/system/string.js should pass jscs.'); + assert.ok(true, 'ember-runtime/system/service.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/system/string.jshint', ['exports'], function (exports) { +enifed('ember-runtime/system/string.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/system'); - QUnit.test('ember-runtime/system/string.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/system/string.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/system/string.js should pass jshint.'); + assert.ok(true, 'ember-runtime/system/string.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/computed/computed_macros_test', ['exports', 'ember-metal', 'ember-runtime/computed/computed_macros', 'internal-test-helpers', 'ember-runtime/system/object', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeComputedComputed_macros, _internalTestHelpers, _emberRuntimeSystemObject, _emberRuntimeSystemNative_array) { @@ -52040,21 +50279,13 @@ enifed('ember-runtime/tests/computed/computed_macros_test', ['exports', 'ember-m equal(get(obj, 'quz'), null); }); }); -enifed('ember-runtime/tests/computed/computed_macros_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/computed/computed_macros_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/computed'); - test('ember-runtime/tests/computed/computed_macros_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/computed/computed_macros_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/computed/computed_macros_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/computed'); - QUnit.test('ember-runtime/tests/computed/computed_macros_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/computed/computed_macros_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/computed/computed_macros_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/computed/computed_macros_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/computed/reduce_computed_macros_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object', 'ember-runtime/system/object_proxy', 'ember-runtime/computed/reduce_computed_macros', 'ember-runtime/utils', 'ember-runtime/system/native_array', 'ember-runtime/mixins/mutable_array'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject, _emberRuntimeSystemObject_proxy, _emberRuntimeComputedReduce_computed_macros, _emberRuntimeUtils, _emberRuntimeSystemNative_array, _emberRuntimeMixinsMutable_array) { @@ -52526,63 +50757,61 @@ enifed('ember-runtime/tests/computed/reduce_computed_macros_test', ['exports', ' }); }); - if (true) { - QUnit.module('computed.uniqBy', { - setup: function () { - obj = _emberRuntimeSystemObject.default.extend({ - list: null, - uniqueById: _emberRuntimeComputedReduce_computed_macros.uniqBy('list', 'id') - }).create({ - list: _emberRuntimeSystemNative_array.A([{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 1, value: 'one' }]) - }); - }, - teardown: function () { - _emberMetal.run(obj, 'destroy'); - } - }); - - QUnit.test('uniqBy is readOnly', function () { - QUnit.throws(function () { - obj.set('uniqueById', 1); - }, /Cannot set read-only property "uniqueById" on object:/); - }); - QUnit.test('does not include duplicates', function () { - deepEqual(obj.get('uniqueById'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }]); - }); - - QUnit.test('it does not share state among instances', function () { - var MyObject = _emberRuntimeSystemObject.default.extend({ - list: [], - uniqueByName: _emberRuntimeComputedReduce_computed_macros.uniqBy('list', 'name') + QUnit.module('computed.uniqBy', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + list: null, + uniqueById: _emberRuntimeComputedReduce_computed_macros.uniqBy('list', 'id') + }).create({ + list: _emberRuntimeSystemNative_array.A([{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 1, value: 'one' }]) }); - var a = MyObject.create({ list: [{ name: 'bob' }, { name: 'mitch' }, { name: 'mitch' }] }); - var b = MyObject.create({ list: [{ name: 'warren' }, { name: 'mitch' }] }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('uniqBy is readOnly', function () { + QUnit.throws(function () { + obj.set('uniqueById', 1); + }, /Cannot set read-only property "uniqueById" on object:/); + }); + QUnit.test('does not include duplicates', function () { + deepEqual(obj.get('uniqueById'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }]); + }); - deepEqual(a.get('uniqueByName'), [{ name: 'bob' }, { name: 'mitch' }]); - // Making sure that 'mitch' appears - deepEqual(b.get('uniqueByName'), [{ name: 'warren' }, { name: 'mitch' }]); + QUnit.test('it does not share state among instances', function () { + var MyObject = _emberRuntimeSystemObject.default.extend({ + list: [], + uniqueByName: _emberRuntimeComputedReduce_computed_macros.uniqBy('list', 'name') }); + var a = MyObject.create({ list: [{ name: 'bob' }, { name: 'mitch' }, { name: 'mitch' }] }); + var b = MyObject.create({ list: [{ name: 'warren' }, { name: 'mitch' }] }); - QUnit.test('it handles changes to the dependent array', function () { - obj.get('list').pushObject({ id: 3, value: 'three' }); + deepEqual(a.get('uniqueByName'), [{ name: 'bob' }, { name: 'mitch' }]); + // Making sure that 'mitch' appears + deepEqual(b.get('uniqueByName'), [{ name: 'warren' }, { name: 'mitch' }]); + }); - deepEqual(obj.get('uniqueById'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 3, value: 'three' }], 'The list includes three'); + QUnit.test('it handles changes to the dependent array', function () { + obj.get('list').pushObject({ id: 3, value: 'three' }); - obj.get('list').pushObject({ id: 3, value: 'three' }); + deepEqual(obj.get('uniqueById'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 3, value: 'three' }], 'The list includes three'); - deepEqual(obj.get('uniqueById'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 3, value: 'three' }], 'The list does not include a duplicate three'); - }); + obj.get('list').pushObject({ id: 3, value: 'three' }); - QUnit.test('it returns an empty array when computed on a non-array', function () { - var MyObject = _emberRuntimeSystemObject.default.extend({ - list: null, - uniq: _emberRuntimeComputedReduce_computed_macros.uniqBy('list', 'name') - }); - var a = MyObject.create({ list: 'not an array' }); + deepEqual(obj.get('uniqueById'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 3, value: 'three' }], 'The list does not include a duplicate three'); + }); - deepEqual(a.get('uniq'), []); + QUnit.test('it returns an empty array when computed on a non-array', function () { + var MyObject = _emberRuntimeSystemObject.default.extend({ + list: null, + uniq: _emberRuntimeComputedReduce_computed_macros.uniqBy('list', 'name') }); - } + var a = MyObject.create({ list: 'not an array' }); + + deepEqual(a.get('uniq'), []); + }); QUnit.module('computed.intersect', { setup: function () { @@ -53520,21 +51749,13 @@ enifed('ember-runtime/tests/computed/reduce_computed_macros_test', ['exports', ' deepEqual(get(obj, 'all'), [0, 'bar', a, true], 'have all of them'); }); }); -enifed('ember-runtime/tests/computed/reduce_computed_macros_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/computed/reduce_computed_macros_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/computed'); - test('ember-runtime/tests/computed/reduce_computed_macros_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/computed/reduce_computed_macros_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/computed/reduce_computed_macros_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/computed'); - QUnit.test('ember-runtime/tests/computed/reduce_computed_macros_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/computed/reduce_computed_macros_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/computed/reduce_computed_macros_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/computed/reduce_computed_macros_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/controllers/controller_test', ['exports', 'ember-runtime/controllers/controller', 'ember-runtime/system/service', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/inject', 'internal-test-helpers'], function (exports, _emberRuntimeControllersController, _emberRuntimeSystemService, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeInject, _internalTestHelpers) { @@ -53662,10 +51883,9 @@ enifed('ember-runtime/tests/controllers/controller_test', ['exports', 'ember-run QUnit.test('specifying `content` (without `model` specified) results in deprecation', function () { expect(1); - var controller = undefined; expectDeprecation(function () { - controller = _emberRuntimeControllersController.default.extend({ + _emberRuntimeControllersController.default.extend({ content: 'foo-bar' }).create(); }, 'Do not specify `content` on a Controller, use `model` instead.'); @@ -53697,7 +51917,13 @@ enifed('ember-runtime/tests/controllers/controller_test', ['exports', 'ember-run owner.register('foo:main', AnObject); - owner._lookupFactory('foo:main'); + if (true) { + expectDeprecation(function () { + owner._lookupFactory('foo:main'); + }, /Using "_lookupFactory" is deprecated. Please use container.factoryFor instead./); + } else { + owner._lookupFactory('foo:main'); + } }, /Defining an injected controller property on a non-controller is not allowed./); }); } @@ -53732,21 +51958,13 @@ enifed('ember-runtime/tests/controllers/controller_test', ['exports', 'ember-run equal(authService, appController.get('authService'), 'service.auth is injected'); }); }); -enifed('ember-runtime/tests/controllers/controller_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/controllers/controller_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/controllers'); - test('ember-runtime/tests/controllers/controller_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/controllers/controller_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/controllers/controller_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/controllers'); - QUnit.test('ember-runtime/tests/controllers/controller_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/controllers/controller_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/controllers/controller_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/controllers/controller_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/core/compare_test', ['exports', 'ember-runtime/utils', 'ember-runtime/system/object', 'ember-runtime/compare', 'ember-runtime/mixins/comparable'], function (exports, _emberRuntimeUtils, _emberRuntimeSystemObject, _emberRuntimeCompare, _emberRuntimeMixinsComparable) { @@ -53828,21 +52046,13 @@ enifed('ember-runtime/tests/core/compare_test', ['exports', 'ember-runtime/utils equal(_emberRuntimeCompare.default('c', one), -1, 'Second item comparable - returns 1 (negated)'); }); }); -enifed('ember-runtime/tests/core/compare_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/core'); - test('ember-runtime/tests/core/compare_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/core/compare_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/core/compare_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/core/compare_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/core'); - QUnit.test('ember-runtime/tests/core/compare_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/core/compare_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/core/compare_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/core/compare_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/core/copy_test', ['exports', 'ember-runtime/copy'], function (exports, _emberRuntimeCopy) { @@ -53878,21 +52088,13 @@ enifed('ember-runtime/tests/core/copy_test', ['exports', 'ember-runtime/copy'], deepEqual(array, arrayCopy, 'array content cloned successfully in new array'); }); }); -enifed('ember-runtime/tests/core/copy_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/core/copy_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/core'); - test('ember-runtime/tests/core/copy_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/core/copy_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/core/copy_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/core'); - QUnit.test('ember-runtime/tests/core/copy_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/core/copy_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/core/copy_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/core/copy_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/core/isEqual_test', ['exports', 'ember-runtime/is-equal'], function (exports, _emberRuntimeIsEqual) { @@ -53939,21 +52141,13 @@ enifed('ember-runtime/tests/core/isEqual_test', ['exports', 'ember-runtime/is-eq equal(_emberRuntimeIsEqual.default(obj, obj), false, 'should return false because isEqual returns false'); }); }); -enifed('ember-runtime/tests/core/isEqual_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/core'); - test('ember-runtime/tests/core/isEqual_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/core/isEqual_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/core/isEqual_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/core/isEqual_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/core'); - QUnit.test('ember-runtime/tests/core/isEqual_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/core/isEqual_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/core/isEqual_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/core/isEqual_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/core/is_array_test', ['exports', 'ember-runtime/utils', 'ember-runtime/system/native_array', 'ember-runtime/system/array_proxy', 'ember-environment'], function (exports, _emberRuntimeUtils, _emberRuntimeSystemNative_array, _emberRuntimeSystemArray_proxy, _emberEnvironment) { @@ -53993,21 +52187,13 @@ enifed('ember-runtime/tests/core/is_array_test', ['exports', 'ember-runtime/util }); } }); -enifed('ember-runtime/tests/core/is_array_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/core/is_array_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/core'); - test('ember-runtime/tests/core/is_array_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/core/is_array_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/core/is_array_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/core'); - QUnit.test('ember-runtime/tests/core/is_array_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/core/is_array_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/core/is_array_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/core/is_array_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/core/is_empty_test', ['exports', 'ember-metal', 'ember-runtime/system/array_proxy', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemNative_array) { @@ -54021,21 +52207,13 @@ enifed('ember-runtime/tests/core/is_empty_test', ['exports', 'ember-metal', 'emb equal(true, _emberMetal.isEmpty(arrayProxy), 'for an ArrayProxy that has empty content'); }); }); -enifed('ember-runtime/tests/core/is_empty_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/core/is_empty_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/core'); - test('ember-runtime/tests/core/is_empty_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/core/is_empty_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/core/is_empty_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/core'); - QUnit.test('ember-runtime/tests/core/is_empty_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/core/is_empty_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/core/is_empty_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/core/is_empty_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/core/type_of_test', ['exports', 'ember-runtime/utils', 'ember-runtime/system/object', 'ember-environment'], function (exports, _emberRuntimeUtils, _emberRuntimeSystemObject, _emberEnvironment) { @@ -54086,21 +52264,13 @@ enifed('ember-runtime/tests/core/type_of_test', ['exports', 'ember-runtime/utils }); } }); -enifed('ember-runtime/tests/core/type_of_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/core/type_of_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/core'); - test('ember-runtime/tests/core/type_of_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/core/type_of_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/core/type_of_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/core'); - QUnit.test('ember-runtime/tests/core/type_of_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/core/type_of_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/core/type_of_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/core/type_of_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/ext/function_test', ['exports', 'ember-environment', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object', 'ember-runtime/mixins/evented'], function (exports, _emberEnvironment, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject, _emberRuntimeMixinsEvented) { @@ -54207,21 +52377,13 @@ enifed('ember-runtime/tests/ext/function_test', ['exports', 'ember-environment', equal(get(obj, 'fullName'), 'Wilma ', 'should return the new computed value'); }); }); -enifed('ember-runtime/tests/ext/function_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/ext'); - test('ember-runtime/tests/ext/function_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/ext/function_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/ext/function_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/ext/function_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/ext'); - QUnit.test('ember-runtime/tests/ext/function_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/ext/function_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/ext/function_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/ext/function_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/ext/mixin_test', ['exports', 'ember-metal'], function (exports, _emberMetal) { @@ -54274,21 +52436,13 @@ enifed('ember-runtime/tests/ext/mixin_test', ['exports', 'ember-metal'], functio equal(_emberMetal.get(obj2, 'foo'), 'BARG', 'binding should be created and synced'); }); }); -enifed('ember-runtime/tests/ext/mixin_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/ext/mixin_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/ext'); - test('ember-runtime/tests/ext/mixin_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/ext/mixin_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/ext/mixin_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/ext'); - QUnit.test('ember-runtime/tests/ext/mixin_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/ext/mixin_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/ext/mixin_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/ext/mixin_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/ext/rsvp_test', ['exports', 'ember-metal', 'ember-runtime/ext/rsvp'], function (exports, _emberMetal, _emberRuntimeExtRsvp) { @@ -54553,21 +52707,13 @@ enifed('ember-runtime/tests/ext/rsvp_test', ['exports', 'ember-metal', 'ember-ru }, reason); }); }); -enifed('ember-runtime/tests/ext/rsvp_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/ext'); - test('ember-runtime/tests/ext/rsvp_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/ext/rsvp_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/ext/rsvp_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/ext/rsvp_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/ext'); - QUnit.test('ember-runtime/tests/ext/rsvp_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/ext/rsvp_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/ext/rsvp_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/ext/rsvp_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/inject_test', ['exports', 'ember-metal', 'ember-runtime/inject', 'ember-runtime/system/object', 'internal-test-helpers'], function (exports, _emberMetal, _emberRuntimeInject, _emberRuntimeSystemObject, _internalTestHelpers) { @@ -54587,8 +52733,6 @@ enifed('ember-runtime/tests/inject_test', ['exports', 'ember-metal', 'ember-runt // this check is done via an assertion which is stripped from // production builds QUnit.test('injection type validation is run when first looked up', function () { - expect(1); - _emberRuntimeInject.createInjectionHelper('foo', function () { ok(true, 'should call validation method'); }); @@ -54601,7 +52745,16 @@ enifed('ember-runtime/tests/inject_test', ['exports', 'ember-metal', 'ember-runt }); owner.register('foo:main', AnObject); - owner._lookupFactory('foo:main'); + + if (true) { + expect(2); + expectDeprecation(function () { + owner._lookupFactory('foo:main'); + }, /Using "_lookupFactory" is deprecated. Please use container.factoryFor instead./); + } else { + expect(1); + owner._lookupFactory('foo:main'); + } }); QUnit.test('attempting to inject a nonexistent container key should error', function () { @@ -54627,21 +52780,13 @@ enifed('ember-runtime/tests/inject_test', ['exports', 'ember-metal', 'ember-runt deepEqual(AnObject._lazyInjections(), { 'foo': 'foo:bar', 'bar': 'quux:bar' }, 'should return injected container keys'); }); }); -enifed('ember-runtime/tests/inject_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests'); - test('ember-runtime/tests/inject_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/inject_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/inject_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/inject_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests'); - QUnit.test('ember-runtime/tests/inject_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/inject_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/inject_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/inject_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/legacy_1x/mixins/observable/chained_test', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeSystemNative_array) { @@ -54704,21 +52849,13 @@ enifed('ember-runtime/tests/legacy_1x/mixins/observable/chained_test', ['exports equal(observerFiredCount, 0, 'observer did not fire after removing changing property on a removed object'); }); }); -enifed('ember-runtime/tests/legacy_1x/mixins/observable/chained_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/legacy_1x/mixins/observable/chained_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/legacy_1x/mixins/observable'); - test('ember-runtime/tests/legacy_1x/mixins/observable/chained_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/chained_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/legacy_1x/mixins/observable/chained_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/legacy_1x/mixins/observable'); - QUnit.test('ember-runtime/tests/legacy_1x/mixins/observable/chained_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/legacy_1x/mixins/observable/chained_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/chained_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/chained_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/legacy_1x/mixins/observable/observable_test', ['exports', 'ember-environment', 'ember-metal', 'ember-runtime/system/string', 'ember-runtime/system/object', 'ember-runtime/mixins/observable', 'ember-runtime/system/native_array'], function (exports, _emberEnvironment, _emberMetal, _emberRuntimeSystemString, _emberRuntimeSystemObject, _emberRuntimeMixinsObservable, _emberRuntimeSystemNative_array) { @@ -55621,21 +53758,13 @@ enifed('ember-runtime/tests/legacy_1x/mixins/observable/observable_test', ['expo expect(1); }); }); -enifed('ember-runtime/tests/legacy_1x/mixins/observable/observable_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/legacy_1x/mixins/observable/observable_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/legacy_1x/mixins/observable'); - test('ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/legacy_1x/mixins/observable/observable_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/legacy_1x/mixins/observable'); - QUnit.test('ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/mixins/observable'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeMixinsObservable) { @@ -55681,21 +53810,13 @@ enifed('ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test', [ equal(observers[1][0], o3, 'second item in observers array should be o3'); }); }); -enifed('ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/legacy_1x/mixins/observable'); - test('ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/legacy_1x/mixins/observable'); - QUnit.test('ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test', ['exports', 'ember-runtime/system/object', 'ember-runtime/mixins/observable', 'ember-metal'], function (exports, _emberRuntimeSystemObject, _emberRuntimeMixinsObservable, _emberMetal) { @@ -55722,7 +53843,6 @@ enifed('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test', [ var ObservableObject = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsObservable.default); - var revMatches = false; var ObjectA = undefined; QUnit.module('object.propertyChanges', { @@ -55740,7 +53860,6 @@ enifed('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test', [ }), starObserver: function (target, key, value, rev) { - revMatches = rev === target.propertyRevision; this.starProp = key; } }).create({ @@ -55838,21 +53957,13 @@ enifed('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test', [ equal(a.get('b'), 'foo', 'should have invalidated the cache so that the newly set value is actually set'); }); }); -enifed('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/legacy_1x/mixins/observable'); - test('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/legacy_1x/mixins/observable'); - QUnit.test('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/legacy_1x/system/binding_test', ['exports', 'ember-environment', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberEnvironment, _emberMetal, _emberRuntimeSystemObject) { @@ -55987,9 +54098,7 @@ enifed('ember-runtime/tests/legacy_1x/system/binding_test', ['exports', 'ember-e var first = undefined, second = undefined, - third = undefined, - binding1 = undefined, - binding2 = undefined; // global variables + third = undefined; // global variables // .......................................................... // chained binding @@ -56015,11 +54124,11 @@ enifed('ember-runtime/tests/legacy_1x/system/binding_test', ['exports', 'ember-e root = { first: first, second: second, third: third }; expectDeprecation(function () { - binding1 = _emberMetal.bind(root, 'second.input', 'first.output'); + _emberMetal.bind(root, 'second.input', 'first.output'); }, /`Ember\.Binding` is deprecated./); expectDeprecation(function () { - binding2 = _emberMetal.bind(root, 'second.output', 'third.input'); + _emberMetal.bind(root, 'second.output', 'third.input'); }, /`Ember\.Binding` is deprecated./); }); }, @@ -56165,21 +54274,13 @@ enifed('ember-runtime/tests/legacy_1x/system/binding_test', ['exports', 'ember-e equal(_emberMetal.get(TestNamespace.toObject, 'relative'), 'newerValue'); }); }); -enifed('ember-runtime/tests/legacy_1x/system/binding_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/legacy_1x/system'); - test('ember-runtime/tests/legacy_1x/system/binding_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/legacy_1x/system/binding_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/legacy_1x/system/binding_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/legacy_1x/system/binding_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/legacy_1x/system'); - QUnit.test('ember-runtime/tests/legacy_1x/system/binding_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/legacy_1x/system/binding_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/legacy_1x/system/binding_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/legacy_1x/system/binding_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/legacy_1x/system/object/base_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { @@ -56208,8 +54309,7 @@ enifed('ember-runtime/tests/legacy_1x/system/object/base_test', ['exports', 'emb // ======================================================================== var obj = undefined, - obj1 = undefined, - don = undefined; // global variables + obj1 = undefined; // global variables QUnit.module('A new EmberObject instance', { @@ -56260,17 +54360,11 @@ enifed('ember-runtime/tests/legacy_1x/system/object/base_test', ['exports', 'emb } }); obj1 = obj.extend(); - don = obj1.create({ - method2: function () { - return this.superclass(); - } - }); }, teardown: function () { obj = undefined; obj1 = undefined; - don = undefined; } }); @@ -56284,21 +54378,13 @@ enifed('ember-runtime/tests/legacy_1x/system/object/base_test', ['exports', 'emb ok(obj.detectInstance(obj.create())); }); }); -enifed('ember-runtime/tests/legacy_1x/system/object/base_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/legacy_1x/system/object/base_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/legacy_1x/system/object'); - test('ember-runtime/tests/legacy_1x/system/object/base_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/legacy_1x/system/object/base_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/legacy_1x/system/object/base_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/legacy_1x/system/object'); - QUnit.test('ember-runtime/tests/legacy_1x/system/object/base_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/legacy_1x/system/object/base_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/legacy_1x/system/object/base_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/legacy_1x/system/object/base_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test', ['exports', 'ember-environment', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberEnvironment, _emberMetal, _emberRuntimeSystemObject) { @@ -56324,7 +54410,6 @@ enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test', ['exports', var originalLookup = _emberEnvironment.context.lookup; var testObject = undefined, fromObject = undefined, - extraObject = undefined, TestObject = undefined; var TestNamespace = undefined, lookup = undefined; @@ -56344,10 +54429,6 @@ enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test', ['exports', extraObject: null }); - extraObject = _emberRuntimeSystemObject.default.create({ - foo: 'extraObjectValue' - }); - lookup['TestNamespace'] = TestNamespace = { fromObject: fromObject, testObject: testObject @@ -56355,7 +54436,7 @@ enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test', ['exports', }, teardown: function () { - testObject = fromObject = extraObject = null; + testObject = fromObject = null; _emberEnvironment.context.lookup = originalLookup; } }); @@ -56403,10 +54484,6 @@ enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test', ['exports', extraObject: null }); - extraObject = _emberRuntimeSystemObject.default.create({ - foo: 'extraObjectValue' - }); - lookup['TestNamespace'] = TestNamespace = { fromObject: fromObject, testObject: TestObject @@ -56415,7 +54492,7 @@ enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test', ['exports', teardown: function () { _emberEnvironment.context.lookup = originalLookup; - TestObject = fromObject = extraObject = null; + TestObject = fromObject = null; // delete TestNamespace; } }); @@ -56479,21 +54556,13 @@ enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test', ['exports', ok(_emberMetal.get(testObject, 'foo') !== 'bar', 'binding should not have synced'); }); }); -enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/legacy_1x/system/object'); - test('ember-runtime/tests/legacy_1x/system/object/bindings_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/legacy_1x/system/object/bindings_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/legacy_1x/system/object'); - QUnit.test('ember-runtime/tests/legacy_1x/system/object/bindings_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/legacy_1x/system/object/bindings_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/legacy_1x/system/object/bindings_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/legacy_1x/system/object/bindings_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/legacy_1x/system/object/concatenated_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { @@ -56600,21 +54669,13 @@ enifed('ember-runtime/tests/legacy_1x/system/object/concatenated_test', ['export deepEqual(values, expected, 'should concatenate functions property (expected: ' + expected + ', got: ' + values + ')'); }); }); -enifed('ember-runtime/tests/legacy_1x/system/object/concatenated_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/legacy_1x/system/object/concatenated_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/legacy_1x/system/object'); - test('ember-runtime/tests/legacy_1x/system/object/concatenated_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/legacy_1x/system/object/concatenated_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/legacy_1x/system/object/concatenated_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/legacy_1x/system/object'); - QUnit.test('ember-runtime/tests/legacy_1x/system/object/concatenated_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/legacy_1x/system/object/concatenated_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/legacy_1x/system/object/concatenated_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/legacy_1x/system/object/concatenated_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/legacy_1x/system/run_loop_test', ['exports', 'ember-metal', 'ember-runtime/mixins/observable', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeMixinsObservable, _emberRuntimeSystemObject) { @@ -56634,9 +54695,7 @@ enifed('ember-runtime/tests/legacy_1x/system/run_loop_test', ['exports', 'ember- broken anyway. I don't think it ever even worked. */ - var MyApp = undefined, - binding1 = undefined, - binding2 = undefined; + var MyApp = undefined; QUnit.module('System:run_loop() - chained binding', { setup: function () { @@ -56666,12 +54725,12 @@ enifed('ember-runtime/tests/legacy_1x/system/run_loop_test', ['exports', 'ember- _emberMetal.run(function () { //Binding of output of MyApp.first object to input of MyApp.second object expectDeprecation(function () { - binding1 = _emberMetal.Binding.from('first.output').to('second.input').connect(MyApp); + _emberMetal.Binding.from('first.output').to('second.input').connect(MyApp); }, deprecationMessage); //Binding of output of MyApp.second object to input of MyApp.third object expectDeprecation(function () { - binding2 = _emberMetal.Binding.from('second.output').to('third.input').connect(MyApp); + _emberMetal.Binding.from('second.output').to('third.input').connect(MyApp); }, deprecationMessage); }); @@ -56699,12 +54758,12 @@ enifed('ember-runtime/tests/legacy_1x/system/run_loop_test', ['exports', 'ember- _emberMetal.run(function () { //Binding of output of MyApp.first object to input of MyApp.second object expectDeprecation(function () { - binding1 = _emberMetal.Binding.from('first.output').to('second.input').connect(MyApp); + _emberMetal.Binding.from('first.output').to('second.input').connect(MyApp); }, deprecationMessage); //Binding of output of MyApp.second object to input of MyApp.third object expectDeprecation(function () { - binding2 = _emberMetal.Binding.from('second.output').to('third.input').connect(MyApp); + _emberMetal.Binding.from('second.output').to('third.input').connect(MyApp); }, deprecationMessage); }); @@ -56727,21 +54786,13 @@ enifed('ember-runtime/tests/legacy_1x/system/run_loop_test', ['exports', 'ember- equal(MyApp.second.get('output'), 'change'); }); }); -enifed('ember-runtime/tests/legacy_1x/system/run_loop_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/legacy_1x/system/run_loop_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/legacy_1x/system'); - test('ember-runtime/tests/legacy_1x/system/run_loop_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/legacy_1x/system/run_loop_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/legacy_1x/system/run_loop_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/legacy_1x/system'); - QUnit.test('ember-runtime/tests/legacy_1x/system/run_loop_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/legacy_1x/system/run_loop_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/legacy_1x/system/run_loop_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/legacy_1x/system/run_loop_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/main_test', ['exports', 'ember-runtime/index'], function (exports, _emberRuntimeIndex) { @@ -56765,21 +54816,13 @@ enifed('ember-runtime/tests/main_test', ['exports', 'ember-runtime/index'], func deepEqual(propsValue, [3, 5, 'asdf']); }); }); -enifed('ember-runtime/tests/main_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests'); - test('ember-runtime/tests/main_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/main_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/main_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/main_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests'); - QUnit.test('ember-runtime/tests/main_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/main_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/main_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/main_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/mixins/array_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/tests/suites/array', 'ember-runtime/system/object', 'ember-runtime/mixins/array', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeTestsSuitesArray, _emberRuntimeSystemObject, _emberRuntimeMixinsArray, _emberRuntimeSystemNative_array) { @@ -57220,21 +55263,13 @@ enifed('ember-runtime/tests/mixins/array_test', ['exports', 'ember-metal', 'inte equal(count, 2, 'observers should only be called once'); }); }); -enifed('ember-runtime/tests/mixins/array_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/mixins'); - test('ember-runtime/tests/mixins/array_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/mixins/array_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/mixins/array_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/mixins/array_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/mixins'); - QUnit.test('ember-runtime/tests/mixins/array_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/mixins/array_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/mixins/array_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/mixins/array_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/mixins/comparable_test', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/compare', 'ember-runtime/mixins/comparable'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeCompare, _emberRuntimeMixinsComparable) { @@ -57271,21 +55306,13 @@ enifed('ember-runtime/tests/mixins/comparable_test', ['exports', 'ember-metal', equal(_emberRuntimeCompare.default(r2, r1), 1); }); }); -enifed('ember-runtime/tests/mixins/comparable_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/mixins/comparable_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/mixins'); - test('ember-runtime/tests/mixins/comparable_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/mixins/comparable_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/mixins/comparable_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/mixins'); - QUnit.test('ember-runtime/tests/mixins/comparable_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/mixins/comparable_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/mixins/comparable_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/mixins/comparable_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/mixins/container_proxy_test', ['exports', 'ember-utils', 'container', 'ember-runtime/mixins/container_proxy', 'ember-runtime/system/object'], function (exports, _emberUtils, _container, _emberRuntimeMixinsContainer_proxy, _emberRuntimeSystemObject) { @@ -57310,21 +55337,13 @@ enifed('ember-runtime/tests/mixins/container_proxy_test', ['exports', 'ember-uti assert.equal(result[_emberUtils.OWNER], this.instance, 'returns an object with the OWNER symbol'); }); }); -enifed('ember-runtime/tests/mixins/container_proxy_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/mixins/container_proxy_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/mixins'); - test('ember-runtime/tests/mixins/container_proxy_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/mixins/container_proxy_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/mixins/container_proxy_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/mixins'); - QUnit.test('ember-runtime/tests/mixins/container_proxy_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/mixins/container_proxy_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/mixins/container_proxy_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/mixins/container_proxy_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/mixins/copyable_test', ['exports', 'ember-utils', 'ember-runtime/tests/suites/copyable', 'ember-runtime/mixins/copyable', 'ember-runtime/mixins/freezable', 'ember-runtime/system/object', 'ember-metal'], function (exports, _emberUtils, _emberRuntimeTestsSuitesCopyable, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsFreezable, _emberRuntimeSystemObject, _emberMetal) { @@ -57376,21 +55395,13 @@ enifed('ember-runtime/tests/mixins/copyable_test', ['exports', 'ember-utils', 'e } }).run(); }); -enifed('ember-runtime/tests/mixins/copyable_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/mixins'); - test('ember-runtime/tests/mixins/copyable_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/mixins/copyable_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/mixins/copyable_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/mixins/copyable_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/mixins'); - QUnit.test('ember-runtime/tests/mixins/copyable_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/mixins/copyable_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/mixins/copyable_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/mixins/copyable_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/mixins/enumerable_test', ['exports', 'ember-runtime/tests/suites/enumerable', 'ember-runtime/system/object', 'ember-runtime/mixins/enumerable', 'ember-runtime/mixins/array', 'ember-runtime/system/native_array', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesEnumerable, _emberRuntimeSystemObject, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsArray, _emberRuntimeSystemNative_array, _emberMetal) { @@ -57485,17 +55496,12 @@ enifed('ember-runtime/tests/mixins/enumerable_test', ['exports', 'ember-runtime/ var X = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default, { contains: function () { return true; + }, + includes: function () { + return true; } }); - if (true) { - X.reopen({ - includes: function () { - return true; - } - }); - } - var x = X.create(); var y = x.without(K); equal(_emberRuntimeMixinsArray.default.detect(y), true, 'should have mixin applied'); @@ -57567,16 +55573,14 @@ enifed('ember-runtime/tests/mixins/enumerable_test', ['exports', 'ember-runtime/ equal(allWhite, true); }); - if (true) { - QUnit.test('should throw an error passing a second argument to includes', function () { - var x = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default).create(); + QUnit.test('should throw an error passing a second argument to includes', function () { + var x = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default).create(); - equal(x.includes('any'), false); - expectAssertion(function () { - x.includes('any', 1); - }, /Enumerable#includes cannot accept a second argument "startAt" as enumerable items are unordered./); - }); - } + equal(x.includes('any'), false); + expectAssertion(function () { + x.includes('any', 1); + }, /Enumerable#includes cannot accept a second argument "startAt" as enumerable items are unordered./); + }); // .......................................................... // CONTENT DID CHANGE @@ -57762,21 +55766,13 @@ enifed('ember-runtime/tests/mixins/enumerable_test', ['exports', 'ember-runtime/ deepEqual(observer._after, null); }); }); -enifed('ember-runtime/tests/mixins/enumerable_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/mixins'); - test('ember-runtime/tests/mixins/enumerable_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/mixins/enumerable_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/mixins/enumerable_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/mixins/enumerable_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/mixins'); - QUnit.test('ember-runtime/tests/mixins/enumerable_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/mixins/enumerable_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/mixins/enumerable_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/mixins/enumerable_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/mixins/freezable_test', ['exports', 'ember-runtime/system/object', 'ember-runtime/mixins/freezable'], function (exports, _emberRuntimeSystemObject, _emberRuntimeMixinsFreezable) { @@ -57789,21 +55785,13 @@ enifed('ember-runtime/tests/mixins/freezable_test', ['exports', 'ember-runtime/s _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsFreezable.Freezable).create(); }); }); -enifed('ember-runtime/tests/mixins/freezable_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/mixins/freezable_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/mixins'); - test('ember-runtime/tests/mixins/freezable_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/mixins/freezable_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/mixins/freezable_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/mixins'); - QUnit.test('ember-runtime/tests/mixins/freezable_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/mixins/freezable_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/mixins/freezable_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/mixins/freezable_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/mixins/mutable_array_test', ['exports', 'ember-metal', 'ember-runtime/tests/suites/mutable_array', 'ember-runtime/mixins/mutable_array', 'ember-runtime/system/object', 'ember-runtime/system/native_array', 'ember-runtime/mixins/array'], function (exports, _emberMetal, _emberRuntimeTestsSuitesMutable_array, _emberRuntimeMixinsMutable_array, _emberRuntimeSystemObject, _emberRuntimeSystemNative_array, _emberRuntimeMixinsArray) { @@ -57871,21 +55859,13 @@ enifed('ember-runtime/tests/mixins/mutable_array_test', ['exports', 'ember-metal }).run(); }); -enifed('ember-runtime/tests/mixins/mutable_array_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/mixins'); - test('ember-runtime/tests/mixins/mutable_array_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/mixins/mutable_array_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/mixins/mutable_array_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/mixins/mutable_array_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/mixins'); - QUnit.test('ember-runtime/tests/mixins/mutable_array_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/mixins/mutable_array_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/mixins/mutable_array_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/mixins/mutable_array_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/mixins/mutable_enumerable_test', ['exports', 'ember-runtime/tests/suites/mutable_enumerable', 'ember-runtime/mixins/mutable_enumerable', 'ember-runtime/system/object', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesMutable_enumerable, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeSystemObject, _emberMetal) { @@ -57955,21 +55935,13 @@ enifed('ember-runtime/tests/mixins/mutable_enumerable_test', ['exports', 'ember- } }).run(); }); -enifed('ember-runtime/tests/mixins/mutable_enumerable_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/mixins/mutable_enumerable_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/mixins'); - test('ember-runtime/tests/mixins/mutable_enumerable_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/mixins/mutable_enumerable_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/mixins/mutable_enumerable_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/mixins'); - QUnit.test('ember-runtime/tests/mixins/mutable_enumerable_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/mixins/mutable_enumerable_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/mixins/mutable_enumerable_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/mixins/mutable_enumerable_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/mixins/observable_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject) { @@ -58076,21 +56048,13 @@ enifed('ember-runtime/tests/mixins/observable_test', ['exports', 'ember-metal', equal(25, obj.get('age')); }); }); -enifed('ember-runtime/tests/mixins/observable_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/mixins'); - test('ember-runtime/tests/mixins/observable_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/mixins/observable_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/mixins/observable_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/mixins/observable_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/mixins'); - QUnit.test('ember-runtime/tests/mixins/observable_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/mixins/observable_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/mixins/observable_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/mixins/observable_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/mixins/promise_proxy_test', ['exports', 'ember-metal', 'ember-runtime/system/object_proxy', 'ember-runtime/mixins/promise_proxy', 'ember-runtime/ext/rsvp', 'rsvp'], function (exports, _emberMetal, _emberRuntimeSystemObject_proxy, _emberRuntimeMixinsPromise_proxy, _emberRuntimeExtRsvp, _rsvp) { @@ -58438,21 +56402,13 @@ enifed('ember-runtime/tests/mixins/promise_proxy_test', ['exports', 'ember-metal equal(receivedReason, expectedReason, 'passed reason is the reason the promise was rejected for'); }); }); -enifed('ember-runtime/tests/mixins/promise_proxy_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/mixins/promise_proxy_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/mixins'); - test('ember-runtime/tests/mixins/promise_proxy_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/mixins/promise_proxy_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/mixins/promise_proxy_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/mixins'); - QUnit.test('ember-runtime/tests/mixins/promise_proxy_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/mixins/promise_proxy_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/mixins/promise_proxy_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/mixins/promise_proxy_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/mixins/target_action_support_test', ['exports', 'ember-environment', 'ember-runtime/system/object', 'ember-runtime/mixins/target_action_support'], function (exports, _emberEnvironment, _emberRuntimeSystemObject, _emberRuntimeMixinsTarget_action_support) { @@ -58637,24 +56593,16 @@ enifed('ember-runtime/tests/mixins/target_action_support_test', ['exports', 'emb ok(true === obj.triggerAction({ actionContext: null }), 'a valid target and action were specified'); }); }); -enifed('ember-runtime/tests/mixins/target_action_support_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/mixins/target_action_support_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/mixins'); - test('ember-runtime/tests/mixins/target_action_support_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/mixins/target_action_support_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/mixins/target_action_support_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/mixins'); - QUnit.test('ember-runtime/tests/mixins/target_action_support_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/mixins/target_action_support_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/mixins/target_action_support_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/mixins/target_action_support_test.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/tests/suites/array', ['exports', 'ember-runtime/tests/suites/enumerable', 'ember-runtime/tests/suites/array/indexOf', 'ember-runtime/tests/suites/array/lastIndexOf', 'ember-runtime/tests/suites/array/objectAt', 'ember-runtime/tests/suites/array/includes', 'ember-runtime/mixins/array', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesEnumerable, _emberRuntimeTestsSuitesArrayIndexOf, _emberRuntimeTestsSuitesArrayLastIndexOf, _emberRuntimeTestsSuitesArrayObjectAt, _emberRuntimeTestsSuitesArrayIncludes, _emberRuntimeMixinsArray, _emberMetal) { +enifed('ember-runtime/tests/suites/array', ['exports', 'ember-runtime/tests/suites/enumerable', 'ember-runtime/tests/suites/array/indexOf', 'ember-runtime/tests/suites/array/lastIndexOf', 'ember-runtime/tests/suites/array/objectAt', 'ember-runtime/tests/suites/array/includes', 'ember-runtime/mixins/array'], function (exports, _emberRuntimeTestsSuitesEnumerable, _emberRuntimeTestsSuitesArrayIndexOf, _emberRuntimeTestsSuitesArrayLastIndexOf, _emberRuntimeTestsSuitesArrayObjectAt, _emberRuntimeTestsSuitesArrayIncludes, _emberRuntimeMixinsArray) { 'use strict'; var ObserverClass = _emberRuntimeTestsSuitesEnumerable.ObserverClass.extend({ @@ -58689,28 +56637,18 @@ enifed('ember-runtime/tests/suites/array', ['exports', 'ember-runtime/tests/suit ArrayTests.importModuleTests(_emberRuntimeTestsSuitesArrayLastIndexOf.default); ArrayTests.importModuleTests(_emberRuntimeTestsSuitesArrayObjectAt.default); - if (true) { - ArrayTests.importModuleTests(_emberRuntimeTestsSuitesArrayIncludes.default); - } + ArrayTests.importModuleTests(_emberRuntimeTestsSuitesArrayIncludes.default); exports.ArrayTests = ArrayTests; exports.ObserverClass = ObserverClass; }); -enifed('ember-runtime/tests/suites/array.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites'); - test('ember-runtime/tests/suites/array.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/array.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/array.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/array.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites'); - QUnit.test('ember-runtime/tests/suites/array.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/array.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/array.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/array.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/array/includes', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { @@ -58754,21 +56692,13 @@ enifed('ember-runtime/tests/suites/array/includes', ['exports', 'ember-runtime/t exports.default = suite; }); -enifed('ember-runtime/tests/suites/array/includes.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/array/includes.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/array'); - test('ember-runtime/tests/suites/array/includes.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/array/includes.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/array/includes.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/array'); - QUnit.test('ember-runtime/tests/suites/array/includes.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/array/includes.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/array/includes.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/array/includes.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/array/indexOf', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { @@ -58797,21 +56727,13 @@ enifed('ember-runtime/tests/suites/array/indexOf', ['exports', 'ember-runtime/te exports.default = suite; }); -enifed('ember-runtime/tests/suites/array/indexOf.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/array'); - test('ember-runtime/tests/suites/array/indexOf.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/array/indexOf.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/array/indexOf.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/array/indexOf.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/array'); - QUnit.test('ember-runtime/tests/suites/array/indexOf.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/array/indexOf.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/array/indexOf.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/array/indexOf.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/array/lastIndexOf', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { @@ -58874,21 +56796,13 @@ enifed('ember-runtime/tests/suites/array/lastIndexOf', ['exports', 'ember-runtim exports.default = suite; }); -enifed('ember-runtime/tests/suites/array/lastIndexOf.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/array'); - test('ember-runtime/tests/suites/array/lastIndexOf.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/array/lastIndexOf.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/array/lastIndexOf.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/array/lastIndexOf.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/array'); - QUnit.test('ember-runtime/tests/suites/array/lastIndexOf.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/array/lastIndexOf.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/array/lastIndexOf.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/array/lastIndexOf.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/array/objectAt', ['exports', 'ember-runtime/tests/suites/suite', 'ember-runtime/mixins/array'], function (exports, _emberRuntimeTestsSuitesSuite, _emberRuntimeMixinsArray) { @@ -58920,21 +56834,13 @@ enifed('ember-runtime/tests/suites/array/objectAt', ['exports', 'ember-runtime/t exports.default = suite; }); -enifed('ember-runtime/tests/suites/array/objectAt.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/array'); - test('ember-runtime/tests/suites/array/objectAt.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/array/objectAt.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/array/objectAt.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/array/objectAt.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/array'); - QUnit.test('ember-runtime/tests/suites/array/objectAt.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/array/objectAt.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/array/objectAt.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/array/objectAt.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/copyable', ['exports', 'ember-runtime/tests/suites/suite', 'ember-runtime/tests/suites/copyable/copy', 'ember-runtime/tests/suites/copyable/frozenCopy'], function (exports, _emberRuntimeTestsSuitesSuite, _emberRuntimeTestsSuitesCopyableCopy, _emberRuntimeTestsSuitesCopyableFrozenCopy) { @@ -58977,21 +56883,13 @@ enifed('ember-runtime/tests/suites/copyable', ['exports', 'ember-runtime/tests/s exports.default = CopyableTests; }); -enifed('ember-runtime/tests/suites/copyable.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites'); - test('ember-runtime/tests/suites/copyable.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/copyable.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/copyable.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/copyable.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites'); - QUnit.test('ember-runtime/tests/suites/copyable.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/copyable.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/copyable.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/copyable.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/copyable/copy', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { @@ -59009,21 +56907,13 @@ enifed('ember-runtime/tests/suites/copyable/copy', ['exports', 'ember-runtime/te exports.default = suite; }); -enifed('ember-runtime/tests/suites/copyable/copy.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/copyable'); - test('ember-runtime/tests/suites/copyable/copy.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/copyable/copy.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/copyable/copy.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/copyable/copy.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/copyable'); - QUnit.test('ember-runtime/tests/suites/copyable/copy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/copyable/copy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/copyable/copy.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/copyable/copy.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/copyable/frozenCopy', ['exports', 'ember-runtime/tests/suites/suite', 'ember-runtime/mixins/freezable', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberRuntimeMixinsFreezable, _emberMetal) { @@ -59057,21 +56947,13 @@ enifed('ember-runtime/tests/suites/copyable/frozenCopy', ['exports', 'ember-runt exports.default = suite; }); -enifed('ember-runtime/tests/suites/copyable/frozenCopy.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/copyable'); - test('ember-runtime/tests/suites/copyable/frozenCopy.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/copyable/frozenCopy.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/copyable/frozenCopy.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/copyable/frozenCopy.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/copyable'); - QUnit.test('ember-runtime/tests/suites/copyable/frozenCopy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/copyable/frozenCopy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/copyable/frozenCopy.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/copyable/frozenCopy.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable', ['exports', 'ember-utils', 'ember-runtime/tests/suites/suite', 'ember-runtime/system/object', 'ember-metal', 'ember-runtime/tests/suites/enumerable/any', 'ember-runtime/tests/suites/enumerable/is_any', 'ember-runtime/tests/suites/enumerable/compact', 'ember-runtime/tests/suites/enumerable/contains', 'ember-runtime/tests/suites/enumerable/includes', 'ember-runtime/tests/suites/enumerable/every', 'ember-runtime/tests/suites/enumerable/filter', 'ember-runtime/tests/suites/enumerable/find', 'ember-runtime/tests/suites/enumerable/firstObject', 'ember-runtime/tests/suites/enumerable/forEach', 'ember-runtime/tests/suites/enumerable/mapBy', 'ember-runtime/tests/suites/enumerable/invoke', 'ember-runtime/tests/suites/enumerable/lastObject', 'ember-runtime/tests/suites/enumerable/map', 'ember-runtime/tests/suites/enumerable/reduce', 'ember-runtime/tests/suites/enumerable/reject', 'ember-runtime/tests/suites/enumerable/sortBy', 'ember-runtime/tests/suites/enumerable/toArray', 'ember-runtime/tests/suites/enumerable/uniq', 'ember-runtime/tests/suites/enumerable/uniqBy', 'ember-runtime/tests/suites/enumerable/without'], function (exports, _emberUtils, _emberRuntimeTestsSuitesSuite, _emberRuntimeSystemObject, _emberMetal, _emberRuntimeTestsSuitesEnumerableAny, _emberRuntimeTestsSuitesEnumerableIs_any, _emberRuntimeTestsSuitesEnumerableCompact, _emberRuntimeTestsSuitesEnumerableContains, _emberRuntimeTestsSuitesEnumerableIncludes, _emberRuntimeTestsSuitesEnumerableEvery, _emberRuntimeTestsSuitesEnumerableFilter, _emberRuntimeTestsSuitesEnumerableFind, _emberRuntimeTestsSuitesEnumerableFirstObject, _emberRuntimeTestsSuitesEnumerableForEach, _emberRuntimeTestsSuitesEnumerableMapBy, _emberRuntimeTestsSuitesEnumerableInvoke, _emberRuntimeTestsSuitesEnumerableLastObject, _emberRuntimeTestsSuitesEnumerableMap, _emberRuntimeTestsSuitesEnumerableReduce, _emberRuntimeTestsSuitesEnumerableReject, _emberRuntimeTestsSuitesEnumerableSortBy, _emberRuntimeTestsSuitesEnumerableToArray, _emberRuntimeTestsSuitesEnumerableUniq, _emberRuntimeTestsSuitesEnumerableUniqBy, _emberRuntimeTestsSuitesEnumerableWithout) { @@ -59347,13 +57229,9 @@ enifed('ember-runtime/tests/suites/enumerable', ['exports', 'ember-utils', 'embe EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableToArray.default); EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableUniq.default); - if (true) { - EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableUniqBy.default); - } + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableUniqBy.default); - if (true) { - EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableIncludes.default); - } + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableIncludes.default); EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableWithout.default); @@ -59361,21 +57239,13 @@ enifed('ember-runtime/tests/suites/enumerable', ['exports', 'ember-utils', 'embe exports.EnumerableTests = EnumerableTests; exports.ObserverClass = ObserverClass; }); -enifed('ember-runtime/tests/suites/enumerable.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites'); - test('ember-runtime/tests/suites/enumerable.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites'); - QUnit.test('ember-runtime/tests/suites/enumerable.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/any', ['exports', 'ember-runtime/tests/suites/suite', 'ember-runtime/system/native_array'], function (exports, _emberRuntimeTestsSuitesSuite, _emberRuntimeSystemNative_array) { @@ -59452,21 +57322,13 @@ enifed('ember-runtime/tests/suites/enumerable/any', ['exports', 'ember-runtime/t exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/any.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/any.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/any.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/any.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/any.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/any.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/any.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/any.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/any.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/compact', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { @@ -59484,24 +57346,16 @@ enifed('ember-runtime/tests/suites/enumerable/compact', ['exports', 'ember-runti exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/compact.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/compact.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/compact.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/compact.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/compact.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/compact.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/compact.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/compact.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/compact.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/tests/suites/enumerable/contains', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { +enifed('ember-runtime/tests/suites/enumerable/contains', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { 'use strict'; var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); @@ -59512,9 +57366,7 @@ enifed('ember-runtime/tests/suites/enumerable/contains', ['exports', 'ember-runt var data = this.newFixture(3); var obj = this.newObject(data); - if (true) { - expectDeprecation('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.'); - } + expectDeprecation('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.'); equal(obj.contains(data[1]), true, 'should return true if contained'); }); @@ -59522,29 +57374,19 @@ enifed('ember-runtime/tests/suites/enumerable/contains', ['exports', 'ember-runt var data = this.newFixture(1); var obj = this.newObject(this.newFixture(3)); - if (true) { - expectDeprecation('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.'); - } + expectDeprecation('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.'); equal(obj.contains(data[0]), false, 'should return false if not contained'); }); exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/contains.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/contains.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/contains.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/contains.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/contains.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/contains.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/contains.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/contains.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/contains.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/every', ['exports', 'ember-runtime/system/object', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeSystemObject, _emberRuntimeTestsSuitesSuite) { @@ -59626,21 +57468,13 @@ enifed('ember-runtime/tests/suites/enumerable/every', ['exports', 'ember-runtime exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/every.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/every.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/every.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/every.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/every.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/every.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/every.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/every.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/every.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/filter', ['exports', 'ember-runtime/system/object', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeSystemObject, _emberRuntimeTestsSuitesSuite) { @@ -59758,21 +57592,13 @@ enifed('ember-runtime/tests/suites/enumerable/filter', ['exports', 'ember-runtim exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/filter.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/filter.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/filter.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/filter.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/filter.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/filter.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/filter.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/filter.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/filter.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/find', ['exports', 'ember-runtime/system/object', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeSystemObject, _emberRuntimeTestsSuitesSuite) { @@ -59873,21 +57699,13 @@ enifed('ember-runtime/tests/suites/enumerable/find', ['exports', 'ember-runtime/ exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/find.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/find.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/find.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/find.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/find.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/find.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/find.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/find.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/find.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/firstObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { @@ -59919,21 +57737,13 @@ enifed('ember-runtime/tests/suites/enumerable/firstObject', ['exports', 'ember-r exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/firstObject.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/firstObject.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/firstObject.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/firstObject.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/firstObject.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/firstObject.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/firstObject.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/firstObject.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/firstObject.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/forEach', ['exports', 'ember-utils', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberUtils, _emberRuntimeTestsSuitesSuite, _emberMetal) { @@ -60013,21 +57823,13 @@ enifed('ember-runtime/tests/suites/enumerable/forEach', ['exports', 'ember-utils exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/forEach.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/forEach.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/forEach.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/forEach.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/forEach.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/forEach.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/forEach.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/forEach.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/forEach.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/includes', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { @@ -60057,21 +57859,13 @@ enifed('ember-runtime/tests/suites/enumerable/includes', ['exports', 'ember-runt exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/includes.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/includes.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/includes.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/includes.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/includes.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/includes.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/includes.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/includes.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/includes.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/invoke', ['exports', 'ember-runtime/system/object', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeSystemObject, _emberRuntimeTestsSuitesSuite) { @@ -60106,21 +57900,13 @@ enifed('ember-runtime/tests/suites/enumerable/invoke', ['exports', 'ember-runtim exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/invoke.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/invoke.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/invoke.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/invoke.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/invoke.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/invoke.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/invoke.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/invoke.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/invoke.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/is_any', ['exports', 'ember-runtime/system/object', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeSystemObject, _emberRuntimeTestsSuitesSuite) { @@ -60173,21 +57959,13 @@ enifed('ember-runtime/tests/suites/enumerable/is_any', ['exports', 'ember-runtim exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/is_any.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/is_any.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/is_any.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/is_any.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/is_any.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/is_any.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/is_any.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/is_any.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/is_any.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/lastObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { @@ -60223,21 +58001,13 @@ enifed('ember-runtime/tests/suites/enumerable/lastObject', ['exports', 'ember-ru exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/lastObject.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/lastObject.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/lastObject.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/lastObject.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/lastObject.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/lastObject.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/lastObject.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/lastObject.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/lastObject.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/map', ['exports', 'ember-utils', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberUtils, _emberRuntimeTestsSuitesSuite, _emberMetal) { @@ -60313,21 +58083,13 @@ enifed('ember-runtime/tests/suites/enumerable/map', ['exports', 'ember-utils', ' exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/map.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/map.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/map.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/map.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/map.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/map.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/map.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/map.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/map.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/mapBy', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { @@ -60349,21 +58111,13 @@ enifed('ember-runtime/tests/suites/enumerable/mapBy', ['exports', 'ember-runtime exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/mapBy.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/mapBy.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/mapBy.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/mapBy.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/mapBy.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/mapBy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/mapBy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/mapBy.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/mapBy.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/reduce', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { @@ -60399,21 +58153,13 @@ enifed('ember-runtime/tests/suites/enumerable/reduce', ['exports', 'ember-runtim exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/reduce.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/reduce.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/reduce.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/reduce.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/reduce.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/reduce.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/reduce.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/reduce.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/reduce.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/reject', ['exports', 'ember-runtime/system/object', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeSystemObject, _emberRuntimeTestsSuitesSuite) { @@ -60539,21 +58285,13 @@ enifed('ember-runtime/tests/suites/enumerable/reject', ['exports', 'ember-runtim exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/reject.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/reject.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/reject.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/reject.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/reject.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/reject.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/reject.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/reject.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/reject.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/sortBy', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { @@ -60581,21 +58319,13 @@ enifed('ember-runtime/tests/suites/enumerable/sortBy', ['exports', 'ember-runtim exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/sortBy.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/sortBy.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/sortBy.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/sortBy.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/sortBy.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/sortBy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/sortBy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/sortBy.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/sortBy.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/toArray', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { @@ -60612,21 +58342,13 @@ enifed('ember-runtime/tests/suites/enumerable/toArray', ['exports', 'ember-runti exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/toArray.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/toArray.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/toArray.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/toArray.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/toArray.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/toArray.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/toArray.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/toArray.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/toArray.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/uniq', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { @@ -60664,57 +58386,39 @@ enifed('ember-runtime/tests/suites/enumerable/uniq', ['exports', 'ember-runtime/ exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/uniq.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/uniq.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/uniq.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/uniq.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/uniq.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/uniq.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/uniq.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/uniq.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/uniq.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/tests/suites/enumerable/uniqBy', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { +enifed('ember-runtime/tests/suites/enumerable/uniqBy', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { 'use strict'; var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); suite.module('uniqBy'); - if (true) { - suite.test('should return new instance with duplicates removed', function () { - var numbers = this.newObject([{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 1, value: 'one' }]); - deepEqual(numbers.uniqBy('id'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }]); - }); - } + suite.test('should return new instance with duplicates removed', function () { + var numbers = this.newObject([{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 1, value: 'one' }]); + deepEqual(numbers.uniqBy('id'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }]); + }); exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/uniqBy.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/uniqBy.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/uniqBy.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/uniqBy.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/uniqBy.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/uniqBy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/uniqBy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/uniqBy.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/uniqBy.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/tests/suites/enumerable/without', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { +enifed('ember-runtime/tests/suites/enumerable/without', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { 'use strict'; var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); @@ -60736,21 +58440,19 @@ enifed('ember-runtime/tests/suites/enumerable/without', ['exports', 'ember-runti deepEqual(this.toArray(obj), before, 'should not have changed original'); }); - if (true) { - suite.test('should remove NaN value', function () { - var before = undefined, - after = undefined, - obj = undefined, - ret = undefined; + suite.test('should remove NaN value', function () { + var before = undefined, + after = undefined, + obj = undefined, + ret = undefined; - before = [].concat(this.newFixture(2), [NaN]); - after = [before[0], before[1]]; - obj = this.newObject(before); + before = [].concat(this.newFixture(2), [NaN]); + after = [before[0], before[1]]; + obj = this.newObject(before); - ret = obj.without(NaN); - deepEqual(this.toArray(ret), after, 'should have removed item'); - }); - } + ret = obj.without(NaN); + deepEqual(this.toArray(ret), after, 'should have removed item'); + }); suite.test('should return same instance if object not found', function () { var item = undefined, @@ -60766,21 +58468,13 @@ enifed('ember-runtime/tests/suites/enumerable/without', ['exports', 'ember-runti exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/without.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/without.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/without.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/without.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/without.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/without.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/without.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/without.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/without.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array', ['exports', 'ember-runtime/tests/suites/array', 'ember-runtime/tests/suites/mutable_array/insertAt', 'ember-runtime/tests/suites/mutable_array/popObject', 'ember-runtime/tests/suites/mutable_array/pushObject', 'ember-runtime/tests/suites/mutable_array/pushObjects', 'ember-runtime/tests/suites/mutable_array/removeAt', 'ember-runtime/tests/suites/mutable_array/replace', 'ember-runtime/tests/suites/mutable_array/shiftObject', 'ember-runtime/tests/suites/mutable_array/unshiftObject', 'ember-runtime/tests/suites/mutable_array/reverseObjects'], function (exports, _emberRuntimeTestsSuitesArray, _emberRuntimeTestsSuitesMutable_arrayInsertAt, _emberRuntimeTestsSuitesMutable_arrayPopObject, _emberRuntimeTestsSuitesMutable_arrayPushObject, _emberRuntimeTestsSuitesMutable_arrayPushObjects, _emberRuntimeTestsSuitesMutable_arrayRemoveAt, _emberRuntimeTestsSuitesMutable_arrayReplace, _emberRuntimeTestsSuitesMutable_arrayShiftObject, _emberRuntimeTestsSuitesMutable_arrayUnshiftObject, _emberRuntimeTestsSuitesMutable_arrayReverseObjects) { @@ -60799,21 +58493,13 @@ enifed('ember-runtime/tests/suites/mutable_array', ['exports', 'ember-runtime/te exports.default = MutableArrayTests; }); -enifed('ember-runtime/tests/suites/mutable_array.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites'); - test('ember-runtime/tests/suites/mutable_array.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites'); - QUnit.test('ember-runtime/tests/suites/mutable_array.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/addObject', ['exports', 'ember-metal', 'ember-runtime/tests/suites/suite'], function (exports, _emberMetal, _emberRuntimeTestsSuitesSuite) { @@ -60878,21 +58564,13 @@ enifed('ember-runtime/tests/suites/mutable_array/addObject', ['exports', 'ember- exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/addObject.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/addObject.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/addObject.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/addObject.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/addObject.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/addObject.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/addObject.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/addObject.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/addObject.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/clear', ['exports', 'ember-metal', 'ember-runtime/tests/suites/suite'], function (exports, _emberMetal, _emberRuntimeTestsSuitesSuite) { @@ -60945,21 +58623,13 @@ enifed('ember-runtime/tests/suites/mutable_array/clear', ['exports', 'ember-meta exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/clear.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/clear.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/clear.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/clear.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/clear.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/clear.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/clear.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/clear.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/clear.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/insertAt', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { @@ -61154,21 +58824,13 @@ enifed('ember-runtime/tests/suites/mutable_array/insertAt', ['exports', 'ember-r exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/insertAt.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/insertAt.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/insertAt.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/insertAt.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/insertAt.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/insertAt.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/insertAt.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/insertAt.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/insertAt.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/popObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { @@ -61240,21 +58902,13 @@ enifed('ember-runtime/tests/suites/mutable_array/popObject', ['exports', 'ember- exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/popObject.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/popObject.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/popObject.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/popObject.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/popObject.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/popObject.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/popObject.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/popObject.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/popObject.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/pushObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { @@ -61315,21 +58969,13 @@ enifed('ember-runtime/tests/suites/mutable_array/pushObject', ['exports', 'ember exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/pushObject.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/pushObject.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/pushObject.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/pushObject.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/pushObject.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/pushObject.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/pushObject.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/pushObject.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/pushObject.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/pushObjects', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { @@ -61349,21 +58995,13 @@ enifed('ember-runtime/tests/suites/mutable_array/pushObjects', ['exports', 'embe exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/pushObjects.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/pushObjects.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/pushObjects.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/pushObjects.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/pushObjects.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/pushObjects.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/pushObjects.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/pushObjects.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/pushObjects.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/removeAt', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal', 'ember-runtime/mixins/mutable_array'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal, _emberRuntimeMixinsMutable_array) { @@ -61508,21 +59146,13 @@ enifed('ember-runtime/tests/suites/mutable_array/removeAt', ['exports', 'ember-r exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/removeAt.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/removeAt.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/removeAt.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/removeAt.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/removeAt.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/removeAt.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/removeAt.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/removeAt.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/removeAt.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/removeObject', ['exports', 'ember-metal', 'ember-runtime/tests/suites/suite'], function (exports, _emberMetal, _emberRuntimeTestsSuitesSuite) { @@ -61588,21 +59218,13 @@ enifed('ember-runtime/tests/suites/mutable_array/removeObject', ['exports', 'emb exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/removeObject.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/removeObject.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/removeObject.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/removeObject.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/removeObject.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/removeObject.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/removeObject.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/removeObject.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/removeObject.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/replace', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { @@ -61760,21 +59382,13 @@ enifed('ember-runtime/tests/suites/mutable_array/replace', ['exports', 'ember-ru exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/replace.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/replace.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/replace.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/replace.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/replace.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/replace.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/replace.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/replace.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/replace.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/reverseObjects', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { @@ -61806,21 +59420,13 @@ enifed('ember-runtime/tests/suites/mutable_array/reverseObjects', ['exports', 'e exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/reverseObjects.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/reverseObjects.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/reverseObjects.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/reverseObjects.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/reverseObjects.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/reverseObjects.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/reverseObjects.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/reverseObjects.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/reverseObjects.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/setObjects', ['exports', 'ember-metal', 'ember-runtime/tests/suites/suite'], function (exports, _emberMetal, _emberRuntimeTestsSuitesSuite) { @@ -61872,21 +59478,13 @@ enifed('ember-runtime/tests/suites/mutable_array/setObjects', ['exports', 'ember exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/setObjects.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/setObjects.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/setObjects.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/setObjects.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/setObjects.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/setObjects.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/setObjects.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/setObjects.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/setObjects.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/shiftObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { @@ -61960,21 +59558,13 @@ enifed('ember-runtime/tests/suites/mutable_array/shiftObject', ['exports', 'embe exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/shiftObject.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/shiftObject.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/shiftObject.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/shiftObject.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/shiftObject.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/shiftObject.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/shiftObject.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/shiftObject.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/shiftObject.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/unshiftObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { @@ -62058,21 +59648,13 @@ enifed('ember-runtime/tests/suites/mutable_array/unshiftObject', ['exports', 'em exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/unshiftObject.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/unshiftObject.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/unshiftObject.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/unshiftObject.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/unshiftObject.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/unshiftObject.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/unshiftObject.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/unshiftObject.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/unshiftObject.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/unshiftObjects', ['exports', 'ember-metal', 'ember-runtime/tests/suites/suite'], function (exports, _emberMetal, _emberRuntimeTestsSuitesSuite) { @@ -62155,21 +59737,13 @@ enifed('ember-runtime/tests/suites/mutable_array/unshiftObjects', ['exports', 'e exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/unshiftObjects.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/unshiftObjects.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/unshiftObjects.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/unshiftObjects.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/unshiftObjects.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/unshiftObjects.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/unshiftObjects.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/unshiftObjects.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/unshiftObjects.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_enumerable', ['exports', 'ember-runtime/tests/suites/enumerable', 'ember-runtime/tests/suites/mutable_enumerable/addObject', 'ember-runtime/tests/suites/mutable_enumerable/removeObject', 'ember-runtime/tests/suites/mutable_enumerable/removeObjects'], function (exports, _emberRuntimeTestsSuitesEnumerable, _emberRuntimeTestsSuitesMutable_enumerableAddObject, _emberRuntimeTestsSuitesMutable_enumerableRemoveObject, _emberRuntimeTestsSuitesMutable_enumerableRemoveObjects) { @@ -62182,21 +59756,13 @@ enifed('ember-runtime/tests/suites/mutable_enumerable', ['exports', 'ember-runti exports.default = MutableEnumerableTests; }); -enifed('ember-runtime/tests/suites/mutable_enumerable.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites'); - test('ember-runtime/tests/suites/mutable_enumerable.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_enumerable.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_enumerable.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_enumerable.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites'); - QUnit.test('ember-runtime/tests/suites/mutable_enumerable.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_enumerable.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_enumerable.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_enumerable.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_enumerable/addObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { @@ -62270,21 +59836,13 @@ enifed('ember-runtime/tests/suites/mutable_enumerable/addObject', ['exports', 'e exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_enumerable/addObject.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/mutable_enumerable'); - test('ember-runtime/tests/suites/mutable_enumerable/addObject.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_enumerable/addObject.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_enumerable/addObject.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_enumerable/addObject.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_enumerable'); - QUnit.test('ember-runtime/tests/suites/mutable_enumerable/addObject.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_enumerable/addObject.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_enumerable/addObject.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_enumerable/addObject.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_enumerable/removeObject', ['exports', 'ember-metal', 'ember-runtime/tests/suites/suite', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeTestsSuitesSuite, _emberRuntimeSystemNative_array) { @@ -62360,21 +59918,13 @@ enifed('ember-runtime/tests/suites/mutable_enumerable/removeObject', ['exports', exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_enumerable/removeObject.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/mutable_enumerable'); - test('ember-runtime/tests/suites/mutable_enumerable/removeObject.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_enumerable/removeObject.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_enumerable/removeObject.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_enumerable/removeObject.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_enumerable'); - QUnit.test('ember-runtime/tests/suites/mutable_enumerable/removeObject.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_enumerable/removeObject.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_enumerable/removeObject.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_enumerable/removeObject.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_enumerable/removeObjects', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal', 'ember-runtime/system/native_array'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal, _emberRuntimeSystemNative_array) { @@ -62560,21 +60110,13 @@ enifed('ember-runtime/tests/suites/mutable_enumerable/removeObjects', ['exports' exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_enumerable/removeObjects.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_enumerable/removeObjects.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/mutable_enumerable'); - test('ember-runtime/tests/suites/mutable_enumerable/removeObjects.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_enumerable/removeObjects.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_enumerable/removeObjects.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_enumerable'); - QUnit.test('ember-runtime/tests/suites/mutable_enumerable/removeObjects.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_enumerable/removeObjects.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_enumerable/removeObjects.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_enumerable/removeObjects.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/suite', ['exports', 'ember-utils', 'ember-runtime/system/object', 'ember-metal'], function (exports, _emberUtils, _emberRuntimeSystemObject, _emberMetal) { @@ -62728,21 +60270,13 @@ enifed('ember-runtime/tests/suites/suite', ['exports', 'ember-utils', 'ember-run exports.Suite = Suite; exports.default = Suite; }); -enifed('ember-runtime/tests/suites/suite.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/suite.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites'); - test('ember-runtime/tests/suites/suite.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/suite.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/suite.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites'); - QUnit.test('ember-runtime/tests/suites/suite.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/suite.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/suite.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/suite.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/application/base_test', ['exports', 'ember-runtime/system/namespace', 'ember-runtime/system/application'], function (exports, _emberRuntimeSystemNamespace, _emberRuntimeSystemApplication) { @@ -62754,21 +60288,13 @@ enifed('ember-runtime/tests/system/application/base_test', ['exports', 'ember-ru ok(_emberRuntimeSystemNamespace.default.detect(_emberRuntimeSystemApplication.default), 'Ember.Application subclass of Ember.Namespace'); }); }); -enifed('ember-runtime/tests/system/application/base_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/application/base_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/application'); - test('ember-runtime/tests/system/application/base_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/application/base_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/application/base_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/application'); - QUnit.test('ember-runtime/tests/system/application/base_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/application/base_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/application/base_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/application/base_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/array_proxy/arranged_content_test', ['exports', 'ember-metal', 'ember-runtime/system/array_proxy', 'ember-runtime/system/native_array', 'ember-runtime/mixins/array'], function (exports, _emberMetal, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemNative_array, _emberRuntimeMixinsArray) { @@ -63168,21 +60694,13 @@ enifed('ember-runtime/tests/system/array_proxy/arranged_content_test', ['exports equal(didChangeCallCount, 2); }); }); -enifed('ember-runtime/tests/system/array_proxy/arranged_content_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/array_proxy'); - test('ember-runtime/tests/system/array_proxy/arranged_content_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/array_proxy/arranged_content_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/array_proxy/arranged_content_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/array_proxy/arranged_content_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/array_proxy'); - QUnit.test('ember-runtime/tests/system/array_proxy/arranged_content_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/array_proxy/arranged_content_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/array_proxy/arranged_content_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/array_proxy/arranged_content_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/array_proxy/content_change_test', ['exports', 'ember-metal', 'ember-runtime/computed/computed_macros', 'ember-runtime/system/array_proxy', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeComputedComputed_macros, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemNative_array) { @@ -63310,21 +60828,13 @@ enifed('ember-runtime/tests/system/array_proxy/content_change_test', ['exports', equal(didChangeCallCount, 2); }); }); -enifed('ember-runtime/tests/system/array_proxy/content_change_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/array_proxy/content_change_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/array_proxy'); - test('ember-runtime/tests/system/array_proxy/content_change_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/array_proxy/content_change_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/array_proxy/content_change_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/array_proxy'); - QUnit.test('ember-runtime/tests/system/array_proxy/content_change_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/array_proxy/content_change_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/array_proxy/content_change_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/array_proxy/content_change_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/array_proxy/content_update_test', ['exports', 'ember-metal', 'ember-runtime/system/array_proxy', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemNative_array) { @@ -63352,21 +60862,13 @@ enifed('ember-runtime/tests/system/array_proxy/content_update_test', ['exports', ok(observerCalled, 'contentArrayDidChange is invoked'); }); }); -enifed('ember-runtime/tests/system/array_proxy/content_update_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/array_proxy'); - test('ember-runtime/tests/system/array_proxy/content_update_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/array_proxy/content_update_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/array_proxy/content_update_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/array_proxy/content_update_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/array_proxy'); - QUnit.test('ember-runtime/tests/system/array_proxy/content_update_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/array_proxy/content_update_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/array_proxy/content_update_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/array_proxy/content_update_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/array_proxy/length_test', ['exports', 'ember-runtime/system/array_proxy', 'ember-runtime/system/object', 'ember-metal', 'ember-runtime/system/native_array'], function (exports, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemObject, _emberMetal, _emberRuntimeSystemNative_array) { @@ -63431,21 +60933,13 @@ enifed('ember-runtime/tests/system/array_proxy/length_test', ['exports', 'ember- equal(eCalled, 2, 'expected observer `colors.content.[]` to be called TWICE'); }); }); -enifed('ember-runtime/tests/system/array_proxy/length_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/array_proxy/length_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/array_proxy'); - test('ember-runtime/tests/system/array_proxy/length_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/array_proxy/length_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/array_proxy/length_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/array_proxy'); - QUnit.test('ember-runtime/tests/system/array_proxy/length_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/array_proxy/length_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/array_proxy/length_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/array_proxy/length_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/array_proxy/suite_test', ['exports', 'ember-runtime/tests/suites/mutable_array', 'ember-runtime/system/array_proxy', 'ember-metal', 'ember-runtime/system/native_array'], function (exports, _emberRuntimeTestsSuitesMutable_array, _emberRuntimeSystemArray_proxy, _emberMetal, _emberRuntimeSystemNative_array) { @@ -63468,21 +60962,13 @@ enifed('ember-runtime/tests/system/array_proxy/suite_test', ['exports', 'ember-r } }).run(); }); -enifed('ember-runtime/tests/system/array_proxy/suite_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/array_proxy'); - test('ember-runtime/tests/system/array_proxy/suite_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/array_proxy/suite_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/array_proxy/suite_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/array_proxy/suite_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/array_proxy'); - QUnit.test('ember-runtime/tests/system/array_proxy/suite_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/array_proxy/suite_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/array_proxy/suite_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/array_proxy/suite_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/array_proxy/watching_and_listening_test', ['exports', 'ember-metal', 'ember-runtime/system/array_proxy', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemNative_array) { @@ -63617,21 +61103,13 @@ enifed('ember-runtime/tests/system/array_proxy/watching_and_listening_test', ['e equal(_emberMetal.watcherCount(item2c, 'id'), 3); }); }); -enifed('ember-runtime/tests/system/array_proxy/watching_and_listening_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/array_proxy'); - test('ember-runtime/tests/system/array_proxy/watching_and_listening_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/array_proxy/watching_and_listening_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/array_proxy/watching_and_listening_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/array_proxy/watching_and_listening_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/array_proxy'); - QUnit.test('ember-runtime/tests/system/array_proxy/watching_and_listening_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/array_proxy/watching_and_listening_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/array_proxy/watching_and_listening_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/array_proxy/watching_and_listening_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/core_object_test', ['exports', 'ember-runtime/system/core_object', 'ember-metal/property_set', 'ember-metal/mixin'], function (exports, _emberRuntimeSystemCore_object, _emberMetalProperty_set, _emberMetalMixin) { @@ -63711,21 +61189,13 @@ enifed('ember-runtime/tests/system/core_object_test', ['exports', 'ember-runtime equal(callCount, 1); }); }); -enifed('ember-runtime/tests/system/core_object_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/core_object_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system'); - test('ember-runtime/tests/system/core_object_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/core_object_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/core_object_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system'); - QUnit.test('ember-runtime/tests/system/core_object_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/core_object_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/core_object_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/core_object_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/lazy_load_test', ['exports', 'ember-metal', 'ember-runtime/system/lazy_load'], function (exports, _emberMetal, _emberRuntimeSystemLazy_load) { @@ -63804,21 +61274,13 @@ enifed('ember-runtime/tests/system/lazy_load_test', ['exports', 'ember-metal', ' }); } }); -enifed('ember-runtime/tests/system/lazy_load_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system'); - test('ember-runtime/tests/system/lazy_load_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/lazy_load_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/lazy_load_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/lazy_load_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system'); - QUnit.test('ember-runtime/tests/system/lazy_load_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/lazy_load_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/lazy_load_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/lazy_load_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/namespace/base_test', ['exports', 'ember-environment', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/system/namespace'], function (exports, _emberEnvironment, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeSystemNamespace) { @@ -63949,21 +61411,13 @@ enifed('ember-runtime/tests/system/namespace/base_test', ['exports', 'ember-envi equal(_emberRuntimeSystemNamespace.default.byName('CF'), undefined, 'namespace can not be found after destroyed'); }); }); -enifed('ember-runtime/tests/system/namespace/base_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/namespace'); - test('ember-runtime/tests/system/namespace/base_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/namespace/base_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/namespace/base_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/namespace/base_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/namespace'); - QUnit.test('ember-runtime/tests/system/namespace/base_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/namespace/base_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/namespace/base_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/namespace/base_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/native_array/a_test', ['exports', 'ember-runtime/mixins/array', 'ember-runtime/system/native_array'], function (exports, _emberRuntimeMixinsArray, _emberRuntimeSystemNative_array) { @@ -63979,21 +61433,13 @@ enifed('ember-runtime/tests/system/native_array/a_test', ['exports', 'ember-runt ok(_emberRuntimeMixinsArray.default.detect(_emberRuntimeSystemNative_array.A([1, 2])), 'returned an ember array'); }); }); -enifed('ember-runtime/tests/system/native_array/a_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/native_array'); - test('ember-runtime/tests/system/native_array/a_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/native_array/a_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/native_array/a_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/native_array/a_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/native_array'); - QUnit.test('ember-runtime/tests/system/native_array/a_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/native_array/a_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/native_array/a_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/native_array/a_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/native_array/copyable_suite_test', ['exports', 'ember-utils', 'ember-runtime/system/native_array', 'ember-runtime/tests/suites/copyable'], function (exports, _emberUtils, _emberRuntimeSystemNative_array, _emberRuntimeTestsSuitesCopyable) { @@ -64036,21 +61482,13 @@ enifed('ember-runtime/tests/system/native_array/copyable_suite_test', ['exports' ok(copiedArray[0] !== array[0], 'objects inside should be unique'); }); }); -enifed('ember-runtime/tests/system/native_array/copyable_suite_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/native_array/copyable_suite_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/native_array'); - test('ember-runtime/tests/system/native_array/copyable_suite_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/native_array/copyable_suite_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/native_array/copyable_suite_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/native_array'); - QUnit.test('ember-runtime/tests/system/native_array/copyable_suite_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/native_array/copyable_suite_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/native_array/copyable_suite_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/native_array/copyable_suite_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/native_array/suite_test', ['exports', 'ember-runtime/system/native_array', 'ember-runtime/tests/suites/mutable_array'], function (exports, _emberRuntimeSystemNative_array, _emberRuntimeTestsSuitesMutable_array) { @@ -64072,21 +61510,13 @@ enifed('ember-runtime/tests/system/native_array/suite_test', ['exports', 'ember- } }).run(); }); -enifed('ember-runtime/tests/system/native_array/suite_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/native_array/suite_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/native_array'); - test('ember-runtime/tests/system/native_array/suite_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/native_array/suite_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/native_array/suite_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/native_array'); - QUnit.test('ember-runtime/tests/system/native_array/suite_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/native_array/suite_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/native_array/suite_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/native_array/suite_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/computed_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject) { @@ -64358,21 +61788,13 @@ enifed('ember-runtime/tests/system/object/computed_test', ['exports', 'ember-met ok(_emberMetal.get(SubClass.create(), 'foo'), 'FOO', 'super value is fetched'); }); }); -enifed('ember-runtime/tests/system/object/computed_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/computed_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/computed_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object/computed_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/computed_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/computed_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/computed_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/computed_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/computed_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/create_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { @@ -64520,21 +61942,13 @@ enifed('ember-runtime/tests/system/object/create_test', ['exports', 'ember-metal ok(!m.peekBindings(), 'A binding map is not allocated'); }); }); -enifed('ember-runtime/tests/system/object/create_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/create_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/create_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/create_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object/create_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/create_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/create_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/create_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/create_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/destroy_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject) { @@ -64705,21 +62119,13 @@ enifed('ember-runtime/tests/system/object/destroy_test', ['exports', 'ember-meta ok(foo.get('value'), 'foo is synced when the binding is updated in the willDestroy hook'); }); }); -enifed('ember-runtime/tests/system/object/destroy_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/destroy_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/destroy_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object/destroy_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/destroy_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/destroy_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/destroy_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/destroy_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/destroy_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/detectInstance_test', ['exports', 'ember-runtime/system/object'], function (exports, _emberRuntimeSystemObject) { @@ -64758,21 +62164,13 @@ enifed('ember-runtime/tests/system/object/detectInstance_test', ['exports', 'emb ok(C.detectInstance(c), 'c is an instance of C'); }); }); -enifed('ember-runtime/tests/system/object/detectInstance_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/detectInstance_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/detectInstance_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/detectInstance_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object/detectInstance_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/detectInstance_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/detectInstance_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/detectInstance_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/detectInstance_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/detect_test', ['exports', 'ember-runtime/system/object'], function (exports, _emberRuntimeSystemObject) { @@ -64806,21 +62204,233 @@ enifed('ember-runtime/tests/system/object/detect_test', ['exports', 'ember-runti ok(C.detect(C), 'C is a C class'); }); }); -enifed('ember-runtime/tests/system/object/detect_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/detect_test.lint-test', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('ESLint | ember-runtime/tests/system/object/detect_test.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/detect_test.js should pass ESLint\n\n'); + }); +}); +enifed('ember-runtime/tests/system/object/es-compatibility-test', ['exports', 'ember-runtime/system/object', 'ember-metal'], function (exports, _emberRuntimeSystemObject, _emberMetal) { 'use strict'; - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/detect_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/detect_test.js should pass jscs.'); + QUnit.module('EmberObject ES Compatibility'); + + QUnit.test('extending an Ember.Object', function (assert) { + var calls = []; + + var MyObject = (function (_EmberObject) { + babelHelpers.inherits(MyObject, _EmberObject); + + function MyObject() { + babelHelpers.classCallCheck(this, MyObject); + + calls.push('constructor'); + _EmberObject.apply(this, arguments); + this.postInitProperty = 'post-init-property'; + } + + MyObject.prototype.init = function init() { + var _EmberObject$prototype$init; + + calls.push('init'); + (_EmberObject$prototype$init = _EmberObject.prototype.init).call.apply(_EmberObject$prototype$init, [this].concat(babelHelpers.slice.call(arguments))); + this.initProperty = 'init-property'; + }; + + return MyObject; + })(_emberRuntimeSystemObject.default); + + var myObject = MyObject.create({ passedProperty: 'passed-property' }); + + assert.deepEqual(calls, ['constructor', 'init'], 'constructor then init called (create)'); + assert.equal(myObject.postInitProperty, 'post-init-property', 'constructor property available on instance (create)'); + assert.equal(myObject.initProperty, 'init-property', 'init property available on instance (create)'); + assert.equal(myObject.passedProperty, 'passed-property', 'passed property available on instance (create)'); + + calls = []; + myObject = new MyObject({ passedProperty: 'passed-property' }); + + assert.deepEqual(calls, ['constructor', 'init'], 'constructor then init called (new)'); + assert.equal(myObject.postInitProperty, 'post-init-property', 'constructor property available on instance (new)'); + assert.equal(myObject.initProperty, 'init-property', 'init property available on instance (new)'); + assert.equal(myObject.passedProperty, 'passed-property', 'passed property available on instance (new)'); + }); + + QUnit.test('using super', function (assert) { + var calls = []; + + var SuperSuperObject = _emberRuntimeSystemObject.default.extend({ + method: function () { + calls.push('super-super-method'); + } + }); + + var SuperObject = SuperSuperObject.extend({ + method: function () { + this._super(); + calls.push('super-method'); + } + }); + + var MyObject = (function (_SuperObject) { + babelHelpers.inherits(MyObject, _SuperObject); + + function MyObject() { + babelHelpers.classCallCheck(this, MyObject); + + _SuperObject.apply(this, arguments); + } + + MyObject.prototype.method = function method() { + _SuperObject.prototype.method.call(this); + calls.push('method'); + }; + + return MyObject; + })(SuperObject); + + var myObject = new MyObject(); + myObject.method(); + + assert.deepEqual(calls, ['super-super-method', 'super-method', 'method'], 'chain of prototype methods called with super'); + }); + + QUnit.test('using mixins', function (assert) { + var Mixin1 = _emberMetal.Mixin.create({ + property1: 'data-1' + }); + + var Mixin2 = _emberMetal.Mixin.create({ + property2: 'data-2' + }); + + var MyObject = (function (_EmberObject$extend) { + babelHelpers.inherits(MyObject, _EmberObject$extend); + + function MyObject() { + babelHelpers.classCallCheck(this, MyObject); + + _EmberObject$extend.apply(this, arguments); + } + + return MyObject; + })(_emberRuntimeSystemObject.default.extend(Mixin1, Mixin2)); + + var myObject = new MyObject(); + assert.equal(myObject.property1, 'data-1', 'includes the first mixin'); + assert.equal(myObject.property2, 'data-2', 'includes the second mixin'); + }); + + QUnit.test('using instanceof', function (assert) { + var MyObject = (function (_EmberObject2) { + babelHelpers.inherits(MyObject, _EmberObject2); + + function MyObject() { + babelHelpers.classCallCheck(this, MyObject); + + _EmberObject2.apply(this, arguments); + } + + return MyObject; + })(_emberRuntimeSystemObject.default); + + var myObject1 = MyObject.create(); + var myObject2 = new MyObject(); + + assert.ok(myObject1 instanceof MyObject); + assert.ok(myObject1 instanceof _emberRuntimeSystemObject.default); + + assert.ok(myObject2 instanceof MyObject); + assert.ok(myObject2 instanceof _emberRuntimeSystemObject.default); + }); + + QUnit.test('extending an ES subclass of EmberObject', function (assert) { + var calls = []; + + var SubEmberObject = (function (_EmberObject3) { + babelHelpers.inherits(SubEmberObject, _EmberObject3); + + function SubEmberObject() { + babelHelpers.classCallCheck(this, SubEmberObject); + + calls.push('constructor'); + _EmberObject3.apply(this, arguments); + } + + SubEmberObject.prototype.init = function init() { + var _EmberObject3$prototype$init; + + calls.push('init'); + (_EmberObject3$prototype$init = _EmberObject3.prototype.init).call.apply(_EmberObject3$prototype$init, [this].concat(babelHelpers.slice.call(arguments))); + }; + + return SubEmberObject; + })(_emberRuntimeSystemObject.default); + + var MyObject = (function (_SubEmberObject) { + babelHelpers.inherits(MyObject, _SubEmberObject); + + function MyObject() { + babelHelpers.classCallCheck(this, MyObject); + + _SubEmberObject.apply(this, arguments); + } + + return MyObject; + })(SubEmberObject); + + MyObject.create(); + assert.deepEqual(calls, ['constructor', 'init'], 'constructor then init called (create)'); + + calls = []; + new MyObject(); + assert.deepEqual(calls, ['constructor', 'init'], 'constructor then init called (new)'); + }); + + // TODO: Needs to be fixed. Currently only `init` is called. + QUnit.skip('calling extend on an ES subclass of EmberObject', function (assert) { + var calls = []; + + var SubEmberObject = (function (_EmberObject4) { + babelHelpers.inherits(SubEmberObject, _EmberObject4); + + function SubEmberObject() { + babelHelpers.classCallCheck(this, SubEmberObject); + + calls.push('constructor'); + _EmberObject4.apply(this, arguments); + } + + SubEmberObject.prototype.init = function init() { + var _EmberObject4$prototype$init; + + calls.push('init'); + (_EmberObject4$prototype$init = _EmberObject4.prototype.init).call.apply(_EmberObject4$prototype$init, [this].concat(babelHelpers.slice.call(arguments))); + }; + + return SubEmberObject; + })(_emberRuntimeSystemObject.default); + + var MyObject = SubEmberObject.extend({}); + + MyObject.create(); + assert.deepEqual(calls, ['constructor', 'init'], 'constructor then init called (create)'); + + calls = []; + new MyObject(); + assert.deepEqual(calls, ['constructor', 'init'], 'constructor then init called (new)'); }); }); -enifed('ember-runtime/tests/system/object/detect_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/es-compatibility-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/detect_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/es-compatibility-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/detect_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/es-compatibility-test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/events_test', ['exports', 'ember-runtime/system/object', 'ember-runtime/mixins/evented'], function (exports, _emberRuntimeSystemObject, _emberRuntimeMixinsEvented) { @@ -64975,21 +62585,13 @@ enifed('ember-runtime/tests/system/object/events_test', ['exports', 'ember-runti equal(ret, obj, '#one returns self'); }); }); -enifed('ember-runtime/tests/system/object/events_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/events_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/events_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/events_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object/events_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/events_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/events_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/events_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/events_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/extend_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { @@ -65091,21 +62693,13 @@ enifed('ember-runtime/tests/system/object/extend_test', ['exports', 'ember-metal deepEqual(_emberMetal.get(yetAnother.constructor, 'things'), ['foo', 'baz'], 'subclass should have base class\' and its own'); }); }); -enifed('ember-runtime/tests/system/object/extend_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/extend_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/extend_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/extend_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object/extend_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/extend_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/extend_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/extend_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/extend_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/observer_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject) { @@ -65319,21 +62913,13 @@ enifed('ember-runtime/tests/system/object/observer_test', ['exports', 'ember-met equal(changed, true, 'child should have been notified of change to path'); }); }); -enifed('ember-runtime/tests/system/object/observer_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/observer_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/observer_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/observer_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object/observer_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/observer_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/observer_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/observer_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/observer_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/reopenClass_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { @@ -65369,21 +62955,13 @@ enifed('ember-runtime/tests/system/object/reopenClass_test', ['exports', 'ember- equal(_emberMetal.get(SubSub, 'bar'), 'BAR', 'Adds property'); }); }); -enifed('ember-runtime/tests/system/object/reopenClass_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/reopenClass_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/reopenClass_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object/reopenClass_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/reopenClass_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/reopenClass_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/reopenClass_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/reopenClass_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/reopenClass_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/reopen_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { @@ -65431,21 +63009,13 @@ enifed('ember-runtime/tests/system/object/reopen_test', ['exports', 'ember-metal equal(Subclass.create().get('trololol'), true, 'reopen works'); }); }); -enifed('ember-runtime/tests/system/object/reopen_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/reopen_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/reopen_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/reopen_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object/reopen_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/reopen_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/reopen_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/reopen_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/reopen_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/strict-mode-test', ['exports', 'ember-runtime/system/object'], function (exports, _emberRuntimeSystemObject) { @@ -65477,21 +63047,13 @@ enifed('ember-runtime/tests/system/object/strict-mode-test', ['exports', 'ember- equal(bar.callBlah(), 'bar', 'can call local function without call/apply'); }); }); -enifed('ember-runtime/tests/system/object/strict-mode-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/strict-mode-test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/strict-mode-test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object/strict-mode-test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/strict-mode-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/strict-mode-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/strict-mode-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/strict-mode-test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/strict-mode-test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/subclasses_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { @@ -65544,21 +63106,13 @@ enifed('ember-runtime/tests/system/object/subclasses_test', ['exports', 'ember-m equal(subSub.get('greeting'), 'hello world'); }); }); -enifed('ember-runtime/tests/system/object/subclasses_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/subclasses_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/subclasses_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/subclasses_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object/subclasses_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/subclasses_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/subclasses_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/subclasses_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/subclasses_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/toString_test', ['exports', 'ember-utils', 'ember-environment', 'ember-runtime/system/object', 'ember-runtime/system/namespace'], function (exports, _emberUtils, _emberEnvironment, _emberRuntimeSystemObject, _emberRuntimeSystemNamespace) { @@ -65576,6 +63130,10 @@ enifed('ember-runtime/tests/system/object/toString_test', ['exports', 'ember-uti } }); + QUnit.test('NAME_KEY slot is present on Class', function () { + ok(_emberRuntimeSystemObject.default.extend().hasOwnProperty(_emberUtils.NAME_KEY), 'Ember Class\'s have a NAME_KEY slot'); + }); + QUnit.test('toString() returns the same value if called twice', function () { var Foo = _emberRuntimeSystemNamespace.default.create(); Foo.toString = function () { @@ -65654,28 +63212,20 @@ enifed('ember-runtime/tests/system/object/toString_test', ['exports', 'ember-uti var bar = Bar.create(); // simulate these classes being defined on a Namespace - Foo[_emberUtils.GUID_KEY + '_name'] = 'Foo'; - Bar[_emberUtils.GUID_KEY + '_name'] = 'Bar'; + Foo[_emberUtils.NAME_KEY] = 'Foo'; + Bar[_emberUtils.NAME_KEY] = 'Bar'; equal(bar.toString(), '', 'does not include toStringExtension part'); equal(foo.toString(), '', 'Includes toStringExtension result'); }); }); -enifed('ember-runtime/tests/system/object/toString_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/toString_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/toString_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/toString_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object/toString_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/toString_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/toString_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/toString_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/toString_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object_proxy_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object_proxy'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject_proxy) { @@ -65875,21 +63425,13 @@ enifed('ember-runtime/tests/system/object_proxy_test', ['exports', 'ember-metal' equal(get(proxyObject, 'prop'), undefined, 'sets the `undefined` value to the proxied content'); }); }); -enifed('ember-runtime/tests/system/object_proxy_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system'); - test('ember-runtime/tests/system/object_proxy_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object_proxy_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object_proxy_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object_proxy_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system'); - QUnit.test('ember-runtime/tests/system/object_proxy_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object_proxy_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object_proxy_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object_proxy_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/string/camelize_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { @@ -65966,21 +63508,13 @@ enifed('ember-runtime/tests/system/string/camelize_test', ['exports', 'ember-env } }); }); -enifed('ember-runtime/tests/system/string/camelize_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/string'); - test('ember-runtime/tests/system/string/camelize_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/string/camelize_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/string/camelize_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/string/camelize_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/string'); - QUnit.test('ember-runtime/tests/system/string/camelize_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/string/camelize_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/string/camelize_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/string/camelize_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/string/capitalize_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { @@ -66050,21 +63584,13 @@ enifed('ember-runtime/tests/system/string/capitalize_test', ['exports', 'ember-e } }); }); -enifed('ember-runtime/tests/system/string/capitalize_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/string/capitalize_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/string'); - test('ember-runtime/tests/system/string/capitalize_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/string/capitalize_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/string/capitalize_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/string'); - QUnit.test('ember-runtime/tests/system/string/capitalize_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/string/capitalize_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/string/capitalize_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/string/capitalize_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/string/classify_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { @@ -66103,21 +63629,13 @@ enifed('ember-runtime/tests/system/string/classify_test', ['exports', 'ember-env test('InnerHTML', 'InnerHTML', 'does nothing with classified string'); test('_FooBar', '_FooBar', 'does nothing with classified prefixed string'); }); -enifed('ember-runtime/tests/system/string/classify_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/string/classify_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/string'); - test('ember-runtime/tests/system/string/classify_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/string/classify_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/string/classify_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/string'); - QUnit.test('ember-runtime/tests/system/string/classify_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/string/classify_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/string/classify_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/string/classify_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/string/dasherize_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { @@ -66187,21 +63705,13 @@ enifed('ember-runtime/tests/system/string/dasherize_test', ['exports', 'ember-en } }); }); -enifed('ember-runtime/tests/system/string/dasherize_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/string/dasherize_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/string'); - test('ember-runtime/tests/system/string/dasherize_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/string/dasherize_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/string/dasherize_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/string'); - QUnit.test('ember-runtime/tests/system/string/dasherize_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/string/dasherize_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/string/dasherize_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/string/dasherize_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/string/decamelize_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { @@ -66264,21 +63774,13 @@ enifed('ember-runtime/tests/system/string/decamelize_test', ['exports', 'ember-e } }); }); -enifed('ember-runtime/tests/system/string/decamelize_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/string'); - test('ember-runtime/tests/system/string/decamelize_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/string/decamelize_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/string/decamelize_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/string/decamelize_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/string'); - QUnit.test('ember-runtime/tests/system/string/decamelize_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/string/decamelize_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/string/decamelize_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/string/decamelize_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/string/fmt_string_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { @@ -66331,21 +63833,13 @@ enifed('ember-runtime/tests/system/string/fmt_string_test', ['exports', 'ember-e equal(_emberRuntimeSystemString.fmt('%@ %@', ['John'], 'Doe'), '[John] Doe'); }); }); -enifed('ember-runtime/tests/system/string/fmt_string_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/string/fmt_string_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/string'); - test('ember-runtime/tests/system/string/fmt_string_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/string/fmt_string_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/string/fmt_string_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/string'); - QUnit.test('ember-runtime/tests/system/string/fmt_string_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/string/fmt_string_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/string/fmt_string_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/string/fmt_string_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/string/loc_test', ['exports', 'ember-metal', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberMetal, _emberEnvironment, _emberRuntimeSystemString) { @@ -66409,21 +63903,13 @@ enifed('ember-runtime/tests/system/string/loc_test', ['exports', 'ember-metal', }); }); // ES6TODO Ember.STRINGS -enifed('ember-runtime/tests/system/string/loc_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/string'); - test('ember-runtime/tests/system/string/loc_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/string/loc_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/string/loc_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/string/loc_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/string'); - QUnit.test('ember-runtime/tests/system/string/loc_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/string/loc_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/string/loc_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/string/loc_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/string/underscore_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { @@ -66486,21 +63972,13 @@ enifed('ember-runtime/tests/system/string/underscore_test', ['exports', 'ember-e } }); }); -enifed('ember-runtime/tests/system/string/underscore_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/string/underscore_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/string'); - test('ember-runtime/tests/system/string/underscore_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/string/underscore_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/string/underscore_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/string'); - QUnit.test('ember-runtime/tests/system/string/underscore_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/string/underscore_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/string/underscore_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/string/underscore_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/string/w_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { @@ -66535,429 +64013,238 @@ enifed('ember-runtime/tests/system/string/w_test', ['exports', 'ember-environmen } }); }); -enifed('ember-runtime/tests/system/string/w_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/string'); - test('ember-runtime/tests/system/string/w_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/string/w_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/string/w_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/string/w_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/string'); - QUnit.test('ember-runtime/tests/system/string/w_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/string/w_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/string/w_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/string/w_test.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/utils.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/utils.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime'); - test('ember-runtime/utils.js should pass jscs', function () { - ok(true, 'ember-runtime/utils.js should pass jscs.'); - }); -}); -enifed('ember-runtime/utils.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime'); - QUnit.test('ember-runtime/utils.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/utils.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/utils.js should pass jshint.'); - }); -}); -enifed('ember-template-compiler/compat.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler'); - test('ember-template-compiler/compat.js should pass jscs', function () { - ok(true, 'ember-template-compiler/compat.js should pass jscs.'); + assert.ok(true, 'ember-runtime/utils.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/compat.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/compat.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler'); - QUnit.test('ember-template-compiler/compat.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/compat.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/compat.js should pass jshint.'); - }); -}); -enifed('ember-template-compiler/index.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler'); - test('ember-template-compiler/index.js should pass jscs', function () { - ok(true, 'ember-template-compiler/index.js should pass jscs.'); + assert.ok(true, 'ember-template-compiler/compat.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/index.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/index.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler'); - QUnit.test('ember-template-compiler/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/index.js should pass jshint.'); - }); -}); -enifed('ember-template-compiler/plugins/assert-reserved-named-arguments.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/assert-reserved-named-arguments.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/assert-reserved-named-arguments.js should pass jscs.'); + assert.ok(true, 'ember-template-compiler/index.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/assert-reserved-named-arguments.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/assert-reserved-named-arguments.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/assert-reserved-named-arguments.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/assert-reserved-named-arguments.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/assert-reserved-named-arguments.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/plugins/assert-reserved-named-arguments.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/deprecate-render-model.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/deprecate-render-model.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/deprecate-render-model.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/deprecate-render-model.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/plugins/deprecate-render-model.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/deprecate-render-model.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/deprecate-render-model.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/deprecate-render-model.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/plugins/deprecate-render-model.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/index.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/deprecate-render.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/index.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/index.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/plugins/index.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/deprecate-render.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/index.js should pass jshint.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-action-syntax.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-action-syntax.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-action-syntax.js should pass jscs.'); + assert.ok(true, 'ember-template-compiler/plugins/deprecate-render.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-action-syntax.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/index.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-action-syntax.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-action-syntax.js should pass jshint.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-angle-bracket-components.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-angle-bracket-components.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-angle-bracket-components.js should pass jscs.'); + assert.ok(true, 'ember-template-compiler/plugins/index.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-angle-bracket-components.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-action-syntax.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-angle-bracket-components.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-action-syntax.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-angle-bracket-components.js should pass jshint.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-attrs-into-args.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-attrs-into-args.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-attrs-into-args.js should pass jscs.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-action-syntax.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-attrs-into-args.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-angle-bracket-components.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-attrs-into-args.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-angle-bracket-components.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-attrs-into-args.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-angle-bracket-components.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-each-in-into-each.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-attrs-into-args.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-each-in-into-each.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-each-in-into-each.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-each-in-into-each.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-each-in-into-each.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-attrs-into-args.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-each-in-into-each.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-attrs-into-args.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-has-block-syntax.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-each-in-into-each.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-has-block-syntax.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-has-block-syntax.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-has-block-syntax.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-has-block-syntax.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-each-in-into-each.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-has-block-syntax.js should pass jshint.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-inline-link-to.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-inline-link-to.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-inline-link-to.js should pass jscs.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-each-in-into-each.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-inline-link-to.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-has-block-syntax.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-inline-link-to.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-has-block-syntax.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-inline-link-to.js should pass jshint.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-input-on-to-onEvent.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-input-on-to-onEvent.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-input-on-to-onEvent.js should pass jscs.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-has-block-syntax.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-input-on-to-onEvent.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-inline-link-to.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-input-on-to-onEvent.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-inline-link-to.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-input-on-to-onEvent.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-inline-link-to.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-input-type-syntax.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-input-on-to-onEvent.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-input-type-syntax.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-input-type-syntax.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-input-type-syntax.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-input-type-syntax.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-input-on-to-onEvent.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-input-type-syntax.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-input-on-to-onEvent.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-item-class.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-input-type-syntax.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-item-class.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-item-class.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-item-class.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-item-class.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-input-type-syntax.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-item-class.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-input-type-syntax.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-old-binding-syntax.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-item-class.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-old-binding-syntax.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-old-binding-syntax.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-old-binding-syntax.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-old-binding-syntax.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-item-class.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-old-binding-syntax.js should pass jshint.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-old-class-binding-syntax.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-old-class-binding-syntax.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-old-class-binding-syntax.js should pass jscs.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-item-class.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-old-class-binding-syntax.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-old-binding-syntax.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-old-class-binding-syntax.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-old-binding-syntax.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-old-class-binding-syntax.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-old-binding-syntax.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-old-class-binding-syntax.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-old-class-binding-syntax.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.js should pass jshint.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-top-level-components.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-top-level-components.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-top-level-components.js should pass jscs.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-old-class-binding-syntax.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-top-level-components.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-top-level-components.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-top-level-components.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/system/bootstrap.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-top-level-components.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/system'); - test('ember-template-compiler/system/bootstrap.js should pass jscs', function () { - ok(true, 'ember-template-compiler/system/bootstrap.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/system/bootstrap.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-template-compiler/system'); - QUnit.test('ember-template-compiler/system/bootstrap.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-top-level-components.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/system/bootstrap.js should pass jshint.'); - }); -}); -enifed('ember-template-compiler/system/calculate-location-display.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/system'); - test('ember-template-compiler/system/calculate-location-display.js should pass jscs', function () { - ok(true, 'ember-template-compiler/system/calculate-location-display.js should pass jscs.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-top-level-components.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/system/calculate-location-display.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/system/bootstrap.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/system'); - QUnit.test('ember-template-compiler/system/calculate-location-display.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/system/bootstrap.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/system/calculate-location-display.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/system/bootstrap.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/system/compile-options.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/system/calculate-location-display.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/system'); - test('ember-template-compiler/system/compile-options.js should pass jscs', function () { - ok(true, 'ember-template-compiler/system/compile-options.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/system/compile-options.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-template-compiler/system'); - QUnit.test('ember-template-compiler/system/compile-options.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/system/calculate-location-display.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/system/compile-options.js should pass jshint.'); - }); -}); -enifed('ember-template-compiler/system/compile.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/system'); - test('ember-template-compiler/system/compile.js should pass jscs', function () { - ok(true, 'ember-template-compiler/system/compile.js should pass jscs.'); + assert.ok(true, 'ember-template-compiler/system/calculate-location-display.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/system/compile.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/system/compile-options.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/system'); - QUnit.test('ember-template-compiler/system/compile.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/system/compile-options.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/system/compile.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/system/compile-options.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/system/precompile.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/system/compile.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/system'); - test('ember-template-compiler/system/precompile.js should pass jscs', function () { - ok(true, 'ember-template-compiler/system/precompile.js should pass jscs.'); + QUnit.module('ESLint | ember-template-compiler/system/compile.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/system/compile.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/system/precompile.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/system/precompile.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/system'); - QUnit.test('ember-template-compiler/system/precompile.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/system/precompile.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/system/precompile.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/system/precompile.js should pass ESLint\n\n'); }); }); enifed('ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test', ['exports', 'ember-template-compiler/index'], function (exports, _emberTemplateCompilerIndex) { @@ -66987,21 +64274,13 @@ enifed('ember-template-compiler/tests/plugins/assert-reserved-named-arguments-te }, '\'@foo\' is not a valid path. (\'baz/foo-bar\' @ L1:C17) '); }); }); -enifed('ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/tests/plugins'); - test('ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.js should pass jscs', function () { - ok(true, 'ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/tests/plugins'); - QUnit.test('ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.js should pass ESLint\n\n'); }); }); enifed('ember-template-compiler/tests/plugins/deprecate-render-model-test', ['exports', 'ember-template-compiler/index'], function (exports, _emberTemplateCompilerIndex) { @@ -67021,21 +64300,39 @@ enifed('ember-template-compiler/tests/plugins/deprecate-render-model-test', ['ex }, expectedMessage); }); }); -enifed('ember-template-compiler/tests/plugins/deprecate-render-model-test.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/tests/plugins/deprecate-render-model-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/tests/plugins'); - test('ember-template-compiler/tests/plugins/deprecate-render-model-test.js should pass jscs', function () { - ok(true, 'ember-template-compiler/tests/plugins/deprecate-render-model-test.js should pass jscs.'); + QUnit.module('ESLint | ember-template-compiler/tests/plugins/deprecate-render-model-test.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/tests/plugins/deprecate-render-model-test.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/tests/plugins/deprecate-render-model-test.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/tests/plugins/deprecate-render-test', ['exports', 'ember-template-compiler/index'], function (exports, _emberTemplateCompilerIndex) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/tests/plugins'); - QUnit.test('ember-template-compiler/tests/plugins/deprecate-render-model-test.js should pass jshint', function (assert) { + QUnit.module('ember-template-compiler: deprecate-render'); + + QUnit.test('Using `{{render` without a model provides a deprecation', function () { + expect(1); + + var expectedMessage = 'Please refactor `{{render "foo-bar"}}` to a component and' + ' invoke via `{{foo-bar}}`. (\'baz/foo-bar\' @ L1:C0) '; + + expectDeprecation(function () { + _emberTemplateCompilerIndex.compile('{{render "foo-bar"}}', { + moduleName: 'baz/foo-bar' + }); + }, expectedMessage); + }); +}); +enifed('ember-template-compiler/tests/plugins/deprecate-render-test.lint-test', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('ESLint | ember-template-compiler/tests/plugins/deprecate-render-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/tests/plugins/deprecate-render-model-test.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/tests/plugins/deprecate-render-test.js should pass ESLint\n\n'); }); }); enifed('ember-template-compiler/tests/plugins/transform-inline-link-to-test', ['exports', 'ember-template-compiler/index'], function (exports, _emberTemplateCompilerIndex) { @@ -67051,21 +64348,13 @@ enifed('ember-template-compiler/tests/plugins/transform-inline-link-to-test', [' }); }); }); -enifed('ember-template-compiler/tests/plugins/transform-inline-link-to-test.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/tests/plugins/transform-inline-link-to-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/tests/plugins'); - test('ember-template-compiler/tests/plugins/transform-inline-link-to-test.js should pass jscs', function () { - ok(true, 'ember-template-compiler/tests/plugins/transform-inline-link-to-test.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/tests/plugins/transform-inline-link-to-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-template-compiler/tests/plugins'); - QUnit.test('ember-template-compiler/tests/plugins/transform-inline-link-to-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/tests/plugins/transform-inline-link-to-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/tests/plugins/transform-inline-link-to-test.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/tests/plugins/transform-inline-link-to-test.js should pass ESLint\n\n'); }); }); enifed('ember-template-compiler/tests/plugins/transform-input-on-test', ['exports', 'ember-template-compiler/index'], function (exports, _emberTemplateCompilerIndex) { @@ -67113,21 +64402,45 @@ enifed('ember-template-compiler/tests/plugins/transform-input-on-test', ['export }, 'Using \'{{input on="asdf" ...}}\' without specifying an action (\'foo/bar/baz\' @ L1:C0) will do nothing.'); }); }); -enifed('ember-template-compiler/tests/plugins/transform-input-on-test.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/tests/plugins/transform-input-on-test.lint-test', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('ESLint | ember-template-compiler/tests/plugins/transform-input-on-test.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/tests/plugins/transform-input-on-test.js should pass ESLint\n\n'); + }); +}); +enifed('ember-template-compiler/tests/plugins/transform-input-type-syntax-test', ['exports', 'ember-template-compiler/index'], function (exports, _emberTemplateCompilerIndex) { 'use strict'; - module('JSCS - ember-template-compiler/tests/plugins'); - test('ember-template-compiler/tests/plugins/transform-input-on-test.js should pass jscs', function () { - ok(true, 'ember-template-compiler/tests/plugins/transform-input-on-test.js should pass jscs.'); + QUnit.module('ember-template-compiler: input type syntax'); + + QUnit.test('Can compile an {{input}} helper that has a sub-expression value as its type', function () { + expect(0); + + _emberTemplateCompilerIndex.compile('{{input type=(if true \'password\' \'text\')}}'); + }); + + QUnit.test('Can compile an {{input}} helper with a string literal type', function () { + expect(0); + + _emberTemplateCompilerIndex.compile('{{input type=\'text\'}}'); + }); + + QUnit.test('Can compile an {{input}} helper with a type stored in a var', function () { + expect(0); + + _emberTemplateCompilerIndex.compile('{{input type=_type}}'); }); }); -enifed('ember-template-compiler/tests/plugins/transform-input-on-test.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/tests/plugins/transform-input-type-syntax-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/tests/plugins'); - QUnit.test('ember-template-compiler/tests/plugins/transform-input-on-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/tests/plugins/transform-input-type-syntax-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/tests/plugins/transform-input-on-test.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/tests/plugins/transform-input-type-syntax-test.js should pass ESLint\n\n'); }); }); enifed('ember-template-compiler/tests/system/bootstrap-test', ['exports', 'ember-metal', 'ember-views', 'ember-glimmer', 'ember-template-compiler/system/bootstrap', 'internal-test-helpers'], function (exports, _emberMetal, _emberViews, _emberGlimmer, _emberTemplateCompilerSystemBootstrap, _internalTestHelpers) { @@ -67248,21 +64561,13 @@ enifed('ember-template-compiler/tests/system/bootstrap-test', ['exports', 'ember }, /Template named "[^"]+" already exists\./, 'duplicate templates should not be allowed'); }); }); -enifed('ember-template-compiler/tests/system/bootstrap-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/tests/system'); - test('ember-template-compiler/tests/system/bootstrap-test.js should pass jscs', function () { - ok(true, 'ember-template-compiler/tests/system/bootstrap-test.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/tests/system/bootstrap-test.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/tests/system/bootstrap-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/tests/system'); - QUnit.test('ember-template-compiler/tests/system/bootstrap-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/tests/system/bootstrap-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/tests/system/bootstrap-test.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/tests/system/bootstrap-test.js should pass ESLint\n\n'); }); }); enifed('ember-template-compiler/tests/system/compile_options_test', ['exports', 'ember-template-compiler/index'], function (exports, _emberTemplateCompilerIndex) { @@ -67285,548 +64590,292 @@ enifed('ember-template-compiler/tests/system/compile_options_test', ['exports', } }); }); -enifed('ember-template-compiler/tests/system/compile_options_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/tests/system'); - test('ember-template-compiler/tests/system/compile_options_test.js should pass jscs', function () { - ok(true, 'ember-template-compiler/tests/system/compile_options_test.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/tests/system/compile_options_test.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/tests/system/compile_options_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/tests/system'); - QUnit.test('ember-template-compiler/tests/system/compile_options_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/tests/system/compile_options_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/tests/system/compile_options_test.js should pass jshint.'); - }); -}); -enifed('ember-testing/adapters/adapter.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/adapters'); - test('ember-testing/adapters/adapter.js should pass jscs', function () { - ok(true, 'ember-testing/adapters/adapter.js should pass jscs.'); + assert.ok(true, 'ember-template-compiler/tests/system/compile_options_test.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/adapters/adapter.jshint', ['exports'], function (exports) { +enifed('ember-testing/adapters/adapter.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/adapters'); - QUnit.test('ember-testing/adapters/adapter.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/adapters/adapter.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/adapters/adapter.js should pass jshint.'); + assert.ok(true, 'ember-testing/adapters/adapter.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/adapters/qunit.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/adapters/qunit.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/adapters'); - test('ember-testing/adapters/qunit.js should pass jscs', function () { - ok(true, 'ember-testing/adapters/qunit.js should pass jscs.'); - }); -}); -enifed('ember-testing/adapters/qunit.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/adapters'); - QUnit.test('ember-testing/adapters/qunit.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/adapters/qunit.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/adapters/qunit.js should pass jshint.'); + assert.ok(true, 'ember-testing/adapters/qunit.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/events.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/events.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing'); - test('ember-testing/events.js should pass jscs', function () { - ok(true, 'ember-testing/events.js should pass jscs.'); - }); -}); -enifed('ember-testing/events.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing'); - QUnit.test('ember-testing/events.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/events.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/events.js should pass jshint.'); - }); -}); -enifed('ember-testing/ext/application.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/ext'); - test('ember-testing/ext/application.js should pass jscs', function () { - ok(true, 'ember-testing/ext/application.js should pass jscs.'); + assert.ok(true, 'ember-testing/events.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/ext/application.jshint', ['exports'], function (exports) { +enifed('ember-testing/ext/application.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/ext'); - QUnit.test('ember-testing/ext/application.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/ext/application.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/ext/application.js should pass jshint.'); - }); -}); -enifed('ember-testing/ext/rsvp.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/ext'); - test('ember-testing/ext/rsvp.js should pass jscs', function () { - ok(true, 'ember-testing/ext/rsvp.js should pass jscs.'); + assert.ok(true, 'ember-testing/ext/application.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/ext/rsvp.jshint', ['exports'], function (exports) { +enifed('ember-testing/ext/rsvp.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/ext'); - QUnit.test('ember-testing/ext/rsvp.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/ext/rsvp.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/ext/rsvp.js should pass jshint.'); - }); -}); -enifed('ember-testing/helpers.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing'); - test('ember-testing/helpers.js should pass jscs', function () { - ok(true, 'ember-testing/helpers.js should pass jscs.'); + assert.ok(true, 'ember-testing/ext/rsvp.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers.jshint', ['exports'], function (exports) { +enifed('ember-testing/helpers.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing'); - QUnit.test('ember-testing/helpers.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers.js should pass jshint.'); + assert.ok(true, 'ember-testing/helpers.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/and_then.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/helpers/and_then.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/and_then.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/and_then.js should pass jscs.'); - }); -}); -enifed('ember-testing/helpers/and_then.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/and_then.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/and_then.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/and_then.js should pass jshint.'); + assert.ok(true, 'ember-testing/helpers/and_then.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/click.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/helpers/click.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/click.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/click.js should pass jscs.'); - }); -}); -enifed('ember-testing/helpers/click.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/click.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/click.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/click.js should pass jshint.'); - }); -}); -enifed('ember-testing/helpers/current_path.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/current_path.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/current_path.js should pass jscs.'); + assert.ok(true, 'ember-testing/helpers/click.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/current_path.jshint', ['exports'], function (exports) { +enifed('ember-testing/helpers/current_path.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/current_path.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/current_path.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/current_path.js should pass jshint.'); - }); -}); -enifed('ember-testing/helpers/current_route_name.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/current_route_name.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/current_route_name.js should pass jscs.'); + assert.ok(true, 'ember-testing/helpers/current_path.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/current_route_name.jshint', ['exports'], function (exports) { +enifed('ember-testing/helpers/current_route_name.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/current_route_name.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/current_route_name.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/current_route_name.js should pass jshint.'); + assert.ok(true, 'ember-testing/helpers/current_route_name.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/current_url.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/helpers/current_url.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/current_url.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/current_url.js should pass jscs.'); - }); -}); -enifed('ember-testing/helpers/current_url.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/current_url.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/current_url.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/current_url.js should pass jshint.'); + assert.ok(true, 'ember-testing/helpers/current_url.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/fill_in.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/helpers/fill_in.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/fill_in.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/fill_in.js should pass jscs.'); - }); -}); -enifed('ember-testing/helpers/fill_in.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/fill_in.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/fill_in.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/fill_in.js should pass jshint.'); + assert.ok(true, 'ember-testing/helpers/fill_in.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/find.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/helpers/find.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/find.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/find.js should pass jscs.'); - }); -}); -enifed('ember-testing/helpers/find.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/find.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/find.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/find.js should pass jshint.'); - }); -}); -enifed('ember-testing/helpers/find_with_assert.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/find_with_assert.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/find_with_assert.js should pass jscs.'); + assert.ok(true, 'ember-testing/helpers/find.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/find_with_assert.jshint', ['exports'], function (exports) { +enifed('ember-testing/helpers/find_with_assert.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/find_with_assert.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/find_with_assert.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/find_with_assert.js should pass jshint.'); + assert.ok(true, 'ember-testing/helpers/find_with_assert.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/key_event.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/helpers/key_event.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/key_event.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/key_event.js should pass jscs.'); - }); -}); -enifed('ember-testing/helpers/key_event.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/key_event.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/key_event.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/key_event.js should pass jshint.'); - }); -}); -enifed('ember-testing/helpers/pause_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/pause_test.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/pause_test.js should pass jscs.'); + assert.ok(true, 'ember-testing/helpers/key_event.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/pause_test.jshint', ['exports'], function (exports) { +enifed('ember-testing/helpers/pause_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/pause_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/pause_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/pause_test.js should pass jshint.'); + assert.ok(true, 'ember-testing/helpers/pause_test.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/trigger_event.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/helpers/trigger_event.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/trigger_event.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/trigger_event.js should pass jscs.'); - }); -}); -enifed('ember-testing/helpers/trigger_event.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/trigger_event.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/trigger_event.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/trigger_event.js should pass jshint.'); - }); -}); -enifed('ember-testing/helpers/visit.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/visit.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/visit.js should pass jscs.'); + assert.ok(true, 'ember-testing/helpers/trigger_event.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/visit.jshint', ['exports'], function (exports) { +enifed('ember-testing/helpers/visit.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/visit.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/visit.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/visit.js should pass jshint.'); + assert.ok(true, 'ember-testing/helpers/visit.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/wait.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/helpers/wait.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/wait.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/wait.js should pass jscs.'); - }); -}); -enifed('ember-testing/helpers/wait.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/wait.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/wait.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/wait.js should pass jshint.'); - }); -}); -enifed('ember-testing/index.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing'); - test('ember-testing/index.js should pass jscs', function () { - ok(true, 'ember-testing/index.js should pass jscs.'); + assert.ok(true, 'ember-testing/helpers/wait.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/index.jshint', ['exports'], function (exports) { +enifed('ember-testing/index.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing'); - QUnit.test('ember-testing/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/index.js should pass jshint.'); - }); -}); -enifed('ember-testing/initializers.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing'); - test('ember-testing/initializers.js should pass jscs', function () { - ok(true, 'ember-testing/initializers.js should pass jscs.'); + assert.ok(true, 'ember-testing/index.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/initializers.jshint', ['exports'], function (exports) { +enifed('ember-testing/initializers.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing'); - QUnit.test('ember-testing/initializers.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/initializers.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/initializers.js should pass jshint.'); - }); -}); -enifed('ember-testing/setup_for_testing.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing'); - test('ember-testing/setup_for_testing.js should pass jscs', function () { - ok(true, 'ember-testing/setup_for_testing.js should pass jscs.'); + assert.ok(true, 'ember-testing/initializers.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/setup_for_testing.jshint', ['exports'], function (exports) { +enifed('ember-testing/setup_for_testing.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing'); - QUnit.test('ember-testing/setup_for_testing.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/setup_for_testing.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/setup_for_testing.js should pass jshint.'); + assert.ok(true, 'ember-testing/setup_for_testing.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/support.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/support.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing'); - test('ember-testing/support.js should pass jscs', function () { - ok(true, 'ember-testing/support.js should pass jscs.'); - }); -}); -enifed('ember-testing/support.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing'); - QUnit.test('ember-testing/support.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/support.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/support.js should pass jshint.'); + assert.ok(true, 'ember-testing/support.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/test.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing'); - test('ember-testing/test.js should pass jscs', function () { - ok(true, 'ember-testing/test.js should pass jscs.'); - }); -}); -enifed('ember-testing/test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing'); - QUnit.test('ember-testing/test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/test.js should pass jshint.'); - }); -}); -enifed('ember-testing/test/adapter.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/test'); - test('ember-testing/test/adapter.js should pass jscs', function () { - ok(true, 'ember-testing/test/adapter.js should pass jscs.'); + assert.ok(true, 'ember-testing/test.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/test/adapter.jshint', ['exports'], function (exports) { +enifed('ember-testing/test/adapter.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/test'); - QUnit.test('ember-testing/test/adapter.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/test/adapter.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/test/adapter.js should pass jshint.'); - }); -}); -enifed('ember-testing/test/helpers.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/test'); - test('ember-testing/test/helpers.js should pass jscs', function () { - ok(true, 'ember-testing/test/helpers.js should pass jscs.'); + assert.ok(true, 'ember-testing/test/adapter.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/test/helpers.jshint', ['exports'], function (exports) { +enifed('ember-testing/test/helpers.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/test'); - QUnit.test('ember-testing/test/helpers.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/test/helpers.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/test/helpers.js should pass jshint.'); - }); -}); -enifed('ember-testing/test/on_inject_helpers.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/test'); - test('ember-testing/test/on_inject_helpers.js should pass jscs', function () { - ok(true, 'ember-testing/test/on_inject_helpers.js should pass jscs.'); + assert.ok(true, 'ember-testing/test/helpers.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/test/on_inject_helpers.jshint', ['exports'], function (exports) { +enifed('ember-testing/test/on_inject_helpers.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/test'); - QUnit.test('ember-testing/test/on_inject_helpers.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/test/on_inject_helpers.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/test/on_inject_helpers.js should pass jshint.'); + assert.ok(true, 'ember-testing/test/on_inject_helpers.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/test/pending_requests.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/test/pending_requests.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/test'); - test('ember-testing/test/pending_requests.js should pass jscs', function () { - ok(true, 'ember-testing/test/pending_requests.js should pass jscs.'); - }); -}); -enifed('ember-testing/test/pending_requests.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/test'); - QUnit.test('ember-testing/test/pending_requests.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/test/pending_requests.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/test/pending_requests.js should pass jshint.'); + assert.ok(true, 'ember-testing/test/pending_requests.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/test/promise.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/test/promise.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/test'); - test('ember-testing/test/promise.js should pass jscs', function () { - ok(true, 'ember-testing/test/promise.js should pass jscs.'); - }); -}); -enifed('ember-testing/test/promise.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/test'); - QUnit.test('ember-testing/test/promise.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/test/promise.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/test/promise.js should pass jshint.'); - }); -}); -enifed('ember-testing/test/run.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/test'); - test('ember-testing/test/run.js should pass jscs', function () { - ok(true, 'ember-testing/test/run.js should pass jscs.'); + assert.ok(true, 'ember-testing/test/promise.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/test/run.jshint', ['exports'], function (exports) { +enifed('ember-testing/test/run.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/test'); - QUnit.test('ember-testing/test/run.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/test/run.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/test/run.js should pass jshint.'); - }); -}); -enifed('ember-testing/test/waiters.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/test'); - test('ember-testing/test/waiters.js should pass jscs', function () { - ok(true, 'ember-testing/test/waiters.js should pass jscs.'); + assert.ok(true, 'ember-testing/test/run.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/test/waiters.jshint', ['exports'], function (exports) { +enifed('ember-testing/test/waiters.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/test'); - QUnit.test('ember-testing/test/waiters.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/test/waiters.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/test/waiters.js should pass jshint.'); + assert.ok(true, 'ember-testing/test/waiters.js should pass ESLint\n\n'); }); }); enifed('ember-testing/tests/acceptance_test', ['exports', 'ember-metal', 'ember-views', 'ember-testing/test', 'ember-testing/adapters/qunit', 'ember-testing/initializers', 'ember-application', 'ember-routing', 'ember-template-compiler', 'ember-runtime', 'ember-glimmer'], function (exports, _emberMetal, _emberViews, _emberTestingTest, _emberTestingAdaptersQunit, _emberTestingInitializers, _emberApplication, _emberRouting, _emberTemplateCompiler, _emberRuntime, _emberGlimmer) { @@ -68225,21 +65274,13 @@ enifed('ember-testing/tests/acceptance_test', ['exports', 'ember-metal', 'ember- }); }); // ensure the initializer is setup -enifed('ember-testing/tests/acceptance_test.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/tests/acceptance_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/tests'); - test('ember-testing/tests/acceptance_test.js should pass jscs', function () { - ok(true, 'ember-testing/tests/acceptance_test.js should pass jscs.'); - }); -}); -enifed('ember-testing/tests/acceptance_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/tests'); - QUnit.test('ember-testing/tests/acceptance_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/tests/acceptance_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/tests/acceptance_test.js should pass jshint.'); + assert.ok(true, 'ember-testing/tests/acceptance_test.js should pass ESLint\n\n'); }); }); enifed('ember-testing/tests/adapters/adapter_test', ['exports', 'ember-metal', 'ember-testing/adapters/adapter'], function (exports, _emberMetal, _emberTestingAdaptersAdapter) { @@ -68277,21 +65318,13 @@ enifed('ember-testing/tests/adapters/adapter_test', ['exports', 'ember-metal', ' equal(thrown, error); }); }); -enifed('ember-testing/tests/adapters/adapter_test.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/tests/adapters/adapter_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/tests/adapters'); - test('ember-testing/tests/adapters/adapter_test.js should pass jscs', function () { - ok(true, 'ember-testing/tests/adapters/adapter_test.js should pass jscs.'); - }); -}); -enifed('ember-testing/tests/adapters/adapter_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/tests/adapters'); - QUnit.test('ember-testing/tests/adapters/adapter_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/tests/adapters/adapter_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/tests/adapters/adapter_test.js should pass jshint.'); + assert.ok(true, 'ember-testing/tests/adapters/adapter_test.js should pass ESLint\n\n'); }); }); enifed('ember-testing/tests/adapters/qunit_test', ['exports', 'ember-metal', 'ember-testing/adapters/qunit'], function (exports, _emberMetal, _emberTestingAdaptersQunit) { @@ -68346,31 +65379,24 @@ enifed('ember-testing/tests/adapters/qunit_test', ['exports', 'ember-metal', 'em } }); }); -enifed('ember-testing/tests/adapters/qunit_test.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/tests/adapters/qunit_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/tests/adapters'); - test('ember-testing/tests/adapters/qunit_test.js should pass jscs', function () { - ok(true, 'ember-testing/tests/adapters/qunit_test.js should pass jscs.'); - }); -}); -enifed('ember-testing/tests/adapters/qunit_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/tests/adapters'); - QUnit.test('ember-testing/tests/adapters/qunit_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/tests/adapters/qunit_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/tests/adapters/qunit_test.js should pass jshint.'); + assert.ok(true, 'ember-testing/tests/adapters/qunit_test.js should pass ESLint\n\n'); }); }); enifed('ember-testing/tests/adapters_test', ['exports', 'ember-metal', 'ember-testing/test', 'ember-testing/adapters/adapter', 'ember-testing/adapters/qunit', 'ember-application'], function (exports, _emberMetal, _emberTestingTest, _emberTestingAdaptersAdapter, _emberTestingAdaptersQunit, _emberApplication) { 'use strict'; - var App, originalAdapter; + var App, originalAdapter, originalQUnit; QUnit.module('ember-testing Adapters', { setup: function () { originalAdapter = _emberTestingTest.default.adapter; + originalQUnit = window.QUnit; }, teardown: function () { _emberMetal.run(App, App.destroy); @@ -68378,6 +65404,7 @@ enifed('ember-testing/tests/adapters_test', ['exports', 'ember-metal', 'ember-te App = null; _emberTestingTest.default.adapter = originalAdapter; + window.QUnit = originalQUnit; } }); @@ -68400,7 +65427,7 @@ enifed('ember-testing/tests/adapters_test', ['exports', 'ember-metal', 'ember-te _emberTestingTest.default.adapter.asyncStart(); }); - QUnit.test('QUnitAdapter is used by default', function () { + QUnit.test('QUnitAdapter is used by default (if QUnit is available)', function () { expect(1); _emberTestingTest.default.adapter = null; @@ -68412,22 +65439,30 @@ enifed('ember-testing/tests/adapters_test', ['exports', 'ember-metal', 'ember-te ok(_emberTestingTest.default.adapter instanceof _emberTestingAdaptersQunit.default); }); -}); -enifed('ember-testing/tests/adapters_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - module('JSCS - ember-testing/tests'); - test('ember-testing/tests/adapters_test.js should pass jscs', function () { - ok(true, 'ember-testing/tests/adapters_test.js should pass jscs.'); + QUnit.test('Adapter is used by default (if QUnit is not available)', function () { + expect(2); + + delete window.QUnit; + + _emberTestingTest.default.adapter = null; + + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.setupForTesting(); + }); + + ok(_emberTestingTest.default.adapter instanceof _emberTestingAdaptersAdapter.default); + ok(!(_emberTestingTest.default.adapter instanceof _emberTestingAdaptersQunit.default)); }); }); -enifed('ember-testing/tests/adapters_test.jshint', ['exports'], function (exports) { +enifed('ember-testing/tests/adapters_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/tests'); - QUnit.test('ember-testing/tests/adapters_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/tests/adapters_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/tests/adapters_test.js should pass jshint.'); + assert.ok(true, 'ember-testing/tests/adapters_test.js should pass ESLint\n\n'); }); }); enifed('ember-testing/tests/ext/rsvp_test', ['exports', 'ember-testing/ext/rsvp', 'ember-testing/test/adapter', 'ember-metal'], function (exports, _emberTestingExtRsvp, _emberTestingTestAdapter, _emberMetal) { @@ -68515,21 +65550,13 @@ enifed('ember-testing/tests/ext/rsvp_test', ['exports', 'ember-testing/ext/rsvp' }); }); }); -enifed('ember-testing/tests/ext/rsvp_test.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/tests/ext/rsvp_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/tests/ext'); - test('ember-testing/tests/ext/rsvp_test.js should pass jscs', function () { - ok(true, 'ember-testing/tests/ext/rsvp_test.js should pass jscs.'); - }); -}); -enifed('ember-testing/tests/ext/rsvp_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/tests/ext'); - QUnit.test('ember-testing/tests/ext/rsvp_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/tests/ext/rsvp_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/tests/ext/rsvp_test.js should pass jshint.'); + assert.ok(true, 'ember-testing/tests/ext/rsvp_test.js should pass ESLint\n\n'); }); }); enifed('ember-testing/tests/helper_registration_test', ['exports', 'ember-metal', 'ember-testing/test', 'ember-application'], function (exports, _emberMetal, _emberTestingTest, _emberApplication) { @@ -68615,21 +65642,13 @@ enifed('ember-testing/tests/helper_registration_test', ['exports', 'ember-metal' ok(!helperContainer.boot, 'once unregistered the helper is not added to the helperContainer'); }); }); -enifed('ember-testing/tests/helper_registration_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/tests'); - test('ember-testing/tests/helper_registration_test.js should pass jscs', function () { - ok(true, 'ember-testing/tests/helper_registration_test.js should pass jscs.'); - }); -}); -enifed('ember-testing/tests/helper_registration_test.jshint', ['exports'], function (exports) { +enifed('ember-testing/tests/helper_registration_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/tests'); - QUnit.test('ember-testing/tests/helper_registration_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/tests/helper_registration_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/tests/helper_registration_test.js should pass jshint.'); + assert.ok(true, 'ember-testing/tests/helper_registration_test.js should pass ESLint\n\n'); }); }); enifed('ember-testing/tests/helpers_test', ['exports', 'ember-routing', 'ember-runtime', 'ember-metal', 'ember-views', 'ember-glimmer', 'ember-testing/test', 'ember-testing/helpers', 'ember-testing/initializers', 'ember-testing/setup_for_testing', 'ember-application', 'ember-template-compiler', 'ember-testing/test/pending_requests', 'ember-testing/test/adapter', 'ember-testing/test/waiters'], function (exports, _emberRouting, _emberRuntime, _emberMetal, _emberViews, _emberGlimmer, _emberTestingTest, _emberTestingHelpers, _emberTestingInitializers, _emberTestingSetup_for_testing, _emberApplication, _emberTemplateCompiler, _emberTestingTestPending_requests, _emberTestingTestAdapter, _emberTestingTestWaiters) { @@ -69237,7 +66256,7 @@ enifed('ember-testing/tests/helpers_test', ['exports', 'ember-routing', 'ember-r QUnit.test('`fillIn` takes context into consideration', function () { expect(2); - var fillIn, find, visit, andThen, wait; + var fillIn, find, visit, andThen; _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('
    {{input type="text" id="first" class="current"}}
    {{input type="text" id="second" class="current"}}')); @@ -69247,7 +66266,6 @@ enifed('ember-testing/tests/helpers_test', ['exports', 'ember-routing', 'ember-r find = App.testHelpers.find; visit = App.testHelpers.visit; andThen = App.testHelpers.andThen; - wait = App.testHelpers.wait; visit('/'); fillIn('.current', '#parent', 'current value'); @@ -69411,7 +66429,7 @@ enifed('ember-testing/tests/helpers_test', ['exports', 'ember-routing', 'ember-r App.testHelpers.pauseTest(); }); - if (false) { + if (_emberMetal.isFeatureEnabled('ember-testing-resume-test')) { QUnit.test('resumeTest resumes paused tests', function () { expect(1); @@ -69678,21 +66696,13 @@ enifed('ember-testing/tests/helpers_test', ['exports', 'ember-routing', 'ember-r }); // ensure that the helpers are loaded // ensure the initializer is setup -enifed('ember-testing/tests/helpers_test.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/tests/helpers_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/tests'); - test('ember-testing/tests/helpers_test.js should pass jscs', function () { - ok(true, 'ember-testing/tests/helpers_test.js should pass jscs.'); - }); -}); -enifed('ember-testing/tests/helpers_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/tests'); - QUnit.test('ember-testing/tests/helpers_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/tests/helpers_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/tests/helpers_test.js should pass jshint.'); + assert.ok(true, 'ember-testing/tests/helpers_test.js should pass ESLint\n\n'); }); }); enifed('ember-testing/tests/integration_test', ['exports', 'ember-metal', 'ember-runtime', 'ember-views', 'ember-testing/test', 'ember-routing', 'ember-application', 'ember-template-compiler', 'ember-glimmer'], function (exports, _emberMetal, _emberRuntime, _emberViews, _emberTestingTest, _emberRouting, _emberApplication, _emberTemplateCompiler, _emberGlimmer) { @@ -69806,21 +66816,13 @@ enifed('ember-testing/tests/integration_test', ['exports', 'ember-metal', 'ember }); }); }); -enifed('ember-testing/tests/integration_test.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/tests/integration_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/tests'); - test('ember-testing/tests/integration_test.js should pass jscs', function () { - ok(true, 'ember-testing/tests/integration_test.js should pass jscs.'); - }); -}); -enifed('ember-testing/tests/integration_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/tests'); - QUnit.test('ember-testing/tests/integration_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/tests/integration_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/tests/integration_test.js should pass jshint.'); + assert.ok(true, 'ember-testing/tests/integration_test.js should pass ESLint\n\n'); }); }); enifed('ember-testing/tests/reexports_test', ['exports', 'ember', 'internal-test-helpers'], function (exports, _ember, _internalTestHelpers) { @@ -69845,21 +66847,13 @@ enifed('ember-testing/tests/reexports_test', ['exports', 'ember', 'internal-test }); }); }); -enifed('ember-testing/tests/reexports_test.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/tests/reexports_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/tests'); - test('ember-testing/tests/reexports_test.js should pass jscs', function () { - ok(true, 'ember-testing/tests/reexports_test.js should pass jscs.'); - }); -}); -enifed('ember-testing/tests/reexports_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/tests'); - QUnit.test('ember-testing/tests/reexports_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/tests/reexports_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/tests/reexports_test.js should pass jshint.'); + assert.ok(true, 'ember-testing/tests/reexports_test.js should pass ESLint\n\n'); }); }); enifed('ember-testing/tests/simple_setup', ['exports', 'ember-metal', 'ember-views'], function (exports, _emberMetal, _emberViews) { @@ -69878,24 +66872,16 @@ enifed('ember-testing/tests/simple_setup', ['exports', 'ember-metal', 'ember-vie } }); }); -enifed('ember-testing/tests/simple_setup.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/tests'); - test('ember-testing/tests/simple_setup.js should pass jscs', function () { - ok(true, 'ember-testing/tests/simple_setup.js should pass jscs.'); - }); -}); -enifed('ember-testing/tests/simple_setup.jshint', ['exports'], function (exports) { +enifed('ember-testing/tests/simple_setup.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/tests'); - QUnit.test('ember-testing/tests/simple_setup.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/tests/simple_setup.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/tests/simple_setup.js should pass jshint.'); + assert.ok(true, 'ember-testing/tests/simple_setup.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/tests/test/waiters-test', ['exports', 'ember-metal', 'ember-testing/test/waiters'], function (exports, _emberMetal, _emberTestingTestWaiters) { +enifed('ember-testing/tests/test/waiters-test', ['exports', 'ember-testing/test/waiters'], function (exports, _emberTestingTestWaiters) { 'use strict'; var Waiters = (function () { @@ -70051,270 +67037,164 @@ enifed('ember-testing/tests/test/waiters-test', ['exports', 'ember-metal', 'embe this.waiters.register(); var waiters = undefined; - if (true) { - expectDeprecation(function () { - waiters = _emberTestingTestWaiters.generateDeprecatedWaitersArray(); - }, /Usage of `Ember.Test.waiters` is deprecated/); - } else { + expectDeprecation(function () { waiters = _emberTestingTestWaiters.generateDeprecatedWaitersArray(); - } + }, /Usage of `Ember.Test.waiters` is deprecated/); assert.deepEqual(waiters, [[null, waiter1], [null, waiter2]]); }); }); -enifed('ember-testing/tests/test/waiters-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/tests/test'); - test('ember-testing/tests/test/waiters-test.js should pass jscs', function () { - ok(true, 'ember-testing/tests/test/waiters-test.js should pass jscs.'); - }); -}); -enifed('ember-testing/tests/test/waiters-test.jshint', ['exports'], function (exports) { +enifed('ember-testing/tests/test/waiters-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/tests/test'); - QUnit.test('ember-testing/tests/test/waiters-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/tests/test/waiters-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/tests/test/waiters-test.js should pass jshint.'); + assert.ok(true, 'ember-testing/tests/test/waiters-test.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/apply-str.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/apply-str.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils'); - test('ember-utils/apply-str.js should pass jscs', function () { - ok(true, 'ember-utils/apply-str.js should pass jscs.'); - }); -}); -enifed('ember-utils/apply-str.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/apply-str.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/apply-str.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/apply-str.js should pass jshint.'); - }); -}); -enifed('ember-utils/assign.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-utils'); - test('ember-utils/assign.js should pass jscs', function () { - ok(true, 'ember-utils/assign.js should pass jscs.'); + assert.ok(true, 'ember-utils/apply-str.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/assign.jshint', ['exports'], function (exports) { +enifed('ember-utils/assign.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/assign.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/assign.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/assign.js should pass jshint.'); + assert.ok(true, 'ember-utils/assign.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/dictionary.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/dictionary.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils'); - test('ember-utils/dictionary.js should pass jscs', function () { - ok(true, 'ember-utils/dictionary.js should pass jscs.'); - }); -}); -enifed('ember-utils/dictionary.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/dictionary.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/dictionary.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/dictionary.js should pass jshint.'); + assert.ok(true, 'ember-utils/dictionary.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/empty-object.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/empty-object.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils'); - test('ember-utils/empty-object.js should pass jscs', function () { - ok(true, 'ember-utils/empty-object.js should pass jscs.'); - }); -}); -enifed('ember-utils/empty-object.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/empty-object.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/empty-object.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/empty-object.js should pass jshint.'); + assert.ok(true, 'ember-utils/empty-object.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/guid.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/guid.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils'); - test('ember-utils/guid.js should pass jscs', function () { - ok(true, 'ember-utils/guid.js should pass jscs.'); - }); -}); -enifed('ember-utils/guid.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/guid.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/guid.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/guid.js should pass jshint.'); - }); -}); -enifed('ember-utils/index.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-utils'); - test('ember-utils/index.js should pass jscs', function () { - ok(true, 'ember-utils/index.js should pass jscs.'); + assert.ok(true, 'ember-utils/guid.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/index.jshint', ['exports'], function (exports) { +enifed('ember-utils/index.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/index.js should pass jshint.'); - }); -}); -enifed('ember-utils/inspect.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-utils'); - test('ember-utils/inspect.js should pass jscs', function () { - ok(true, 'ember-utils/inspect.js should pass jscs.'); + assert.ok(true, 'ember-utils/index.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/inspect.jshint', ['exports'], function (exports) { +enifed('ember-utils/inspect.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/inspect.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/inspect.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/inspect.js should pass jshint.'); + assert.ok(true, 'ember-utils/inspect.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/intern.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/intern.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils'); - test('ember-utils/intern.js should pass jscs', function () { - ok(true, 'ember-utils/intern.js should pass jscs.'); - }); -}); -enifed('ember-utils/intern.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/intern.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/intern.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/intern.js should pass jshint.'); + assert.ok(true, 'ember-utils/intern.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/invoke.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/invoke.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils'); - test('ember-utils/invoke.js should pass jscs', function () { - ok(true, 'ember-utils/invoke.js should pass jscs.'); - }); -}); -enifed('ember-utils/invoke.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/invoke.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/invoke.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/invoke.js should pass jshint.'); - }); -}); -enifed('ember-utils/lookup-descriptor.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-utils'); - test('ember-utils/lookup-descriptor.js should pass jscs', function () { - ok(true, 'ember-utils/lookup-descriptor.js should pass jscs.'); + assert.ok(true, 'ember-utils/invoke.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/lookup-descriptor.jshint', ['exports'], function (exports) { +enifed('ember-utils/lookup-descriptor.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/lookup-descriptor.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/lookup-descriptor.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/lookup-descriptor.js should pass jshint.'); + assert.ok(true, 'ember-utils/lookup-descriptor.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/make-array.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/make-array.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils'); - test('ember-utils/make-array.js should pass jscs', function () { - ok(true, 'ember-utils/make-array.js should pass jscs.'); - }); -}); -enifed('ember-utils/make-array.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/make-array.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/make-array.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/make-array.js should pass jshint.'); + assert.ok(true, 'ember-utils/make-array.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/owner.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/name.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils'); - test('ember-utils/owner.js should pass jscs', function () { - ok(true, 'ember-utils/owner.js should pass jscs.'); - }); -}); -enifed('ember-utils/owner.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/owner.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/name.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/owner.js should pass jshint.'); + assert.ok(true, 'ember-utils/name.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/super.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/owner.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils'); - test('ember-utils/super.js should pass jscs', function () { - ok(true, 'ember-utils/super.js should pass jscs.'); + QUnit.module('ESLint | ember-utils/owner.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/owner.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/super.jshint', ['exports'], function (exports) { +enifed('ember-utils/proxy-utils.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/super.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/proxy-utils.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/super.js should pass jshint.'); + assert.ok(true, 'ember-utils/proxy-utils.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/symbol.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/super.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils'); - test('ember-utils/symbol.js should pass jscs', function () { - ok(true, 'ember-utils/symbol.js should pass jscs.'); + QUnit.module('ESLint | ember-utils/super.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/super.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/symbol.jshint', ['exports'], function (exports) { +enifed('ember-utils/symbol.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/symbol.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/symbol.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/symbol.js should pass jshint.'); + assert.ok(true, 'ember-utils/symbol.js should pass ESLint\n\n'); }); }); enifed('ember-utils/tests/assign_test', ['exports', 'ember-utils/assign'], function (exports, _emberUtilsAssign) { @@ -70336,21 +67216,13 @@ enifed('ember-utils/tests/assign_test', ['exports', 'ember-utils/assign'], funct deepEqual(a2, { a: 4 }); }); }); -enifed('ember-utils/tests/assign_test.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/tests/assign_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils/tests'); - test('ember-utils/tests/assign_test.js should pass jscs', function () { - ok(true, 'ember-utils/tests/assign_test.js should pass jscs.'); - }); -}); -enifed('ember-utils/tests/assign_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-utils/tests'); - QUnit.test('ember-utils/tests/assign_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/tests/assign_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/tests/assign_test.js should pass jshint.'); + assert.ok(true, 'ember-utils/tests/assign_test.js should pass ESLint\n\n'); }); }); enifed('ember-utils/tests/can_invoke_test', ['exports', 'ember-utils/index'], function (exports, _emberUtilsIndex) { @@ -70387,21 +67259,13 @@ enifed('ember-utils/tests/can_invoke_test', ['exports', 'ember-utils/index'], fu equal(_emberUtilsIndex.canInvoke(obj, 'foobar'), false); }); }); -enifed('ember-utils/tests/can_invoke_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-utils/tests'); - test('ember-utils/tests/can_invoke_test.js should pass jscs', function () { - ok(true, 'ember-utils/tests/can_invoke_test.js should pass jscs.'); - }); -}); -enifed('ember-utils/tests/can_invoke_test.jshint', ['exports'], function (exports) { +enifed('ember-utils/tests/can_invoke_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-utils/tests'); - QUnit.test('ember-utils/tests/can_invoke_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/tests/can_invoke_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/tests/can_invoke_test.js should pass jshint.'); + assert.ok(true, 'ember-utils/tests/can_invoke_test.js should pass ESLint\n\n'); }); }); enifed('ember-utils/tests/checkHasSuper_test', ['exports', 'ember-environment', 'ember-utils/index'], function (exports, _emberEnvironment, _emberUtilsIndex) { @@ -70418,21 +67282,13 @@ enifed('ember-utils/tests/checkHasSuper_test', ['exports', 'ember-environment', }); } }); -enifed('ember-utils/tests/checkHasSuper_test.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/tests/checkHasSuper_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils/tests'); - test('ember-utils/tests/checkHasSuper_test.js should pass jscs', function () { - ok(true, 'ember-utils/tests/checkHasSuper_test.js should pass jscs.'); - }); -}); -enifed('ember-utils/tests/checkHasSuper_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-utils/tests'); - QUnit.test('ember-utils/tests/checkHasSuper_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/tests/checkHasSuper_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/tests/checkHasSuper_test.js should pass jshint.'); + assert.ok(true, 'ember-utils/tests/checkHasSuper_test.js should pass ESLint\n\n'); }); }); enifed('ember-utils/tests/generate_guid_test', ['exports', 'ember-utils/index'], function (exports, _emberUtilsIndex) { @@ -70446,21 +67302,13 @@ enifed('ember-utils/tests/generate_guid_test', ['exports', 'ember-utils/index'], ok(_emberUtilsIndex.generateGuid(a, 'tyrell').indexOf('tyrell') > -1, 'guid can be prefixed'); }); }); -enifed('ember-utils/tests/generate_guid_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-utils/tests'); - test('ember-utils/tests/generate_guid_test.js should pass jscs', function () { - ok(true, 'ember-utils/tests/generate_guid_test.js should pass jscs.'); - }); -}); -enifed('ember-utils/tests/generate_guid_test.jshint', ['exports'], function (exports) { +enifed('ember-utils/tests/generate_guid_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-utils/tests'); - QUnit.test('ember-utils/tests/generate_guid_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/tests/generate_guid_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/tests/generate_guid_test.js should pass jshint.'); + assert.ok(true, 'ember-utils/tests/generate_guid_test.js should pass ESLint\n\n'); }); }); enifed('ember-utils/tests/guid_for_test', ['exports', 'ember-utils/index'], function (exports, _emberUtilsIndex) { @@ -70548,21 +67396,13 @@ enifed('ember-utils/tests/guid_for_test', ['exports', 'ember-utils/index'], func nanGuid(a); }); }); -enifed('ember-utils/tests/guid_for_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-utils/tests'); - test('ember-utils/tests/guid_for_test.js should pass jscs', function () { - ok(true, 'ember-utils/tests/guid_for_test.js should pass jscs.'); - }); -}); -enifed('ember-utils/tests/guid_for_test.jshint', ['exports'], function (exports) { +enifed('ember-utils/tests/guid_for_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-utils/tests'); - QUnit.test('ember-utils/tests/guid_for_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/tests/guid_for_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/tests/guid_for_test.js should pass jshint.'); + assert.ok(true, 'ember-utils/tests/guid_for_test.js should pass ESLint\n\n'); }); }); enifed('ember-utils/tests/inspect_test', ['exports', 'ember-utils/index'], function (exports, _emberUtilsIndex) { @@ -70635,21 +67475,61 @@ enifed('ember-utils/tests/inspect_test', ['exports', 'ember-utils/index'], funct } }); }); -enifed('ember-utils/tests/inspect_test.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/tests/inspect_test.lint-test', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('ESLint | ember-utils/tests/inspect_test.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/tests/inspect_test.js should pass ESLint\n\n'); + }); +}); +enifed('ember-utils/tests/make_array_test', ['exports', 'ember-utils/make-array'], function (exports, _emberUtilsMakeArray) { 'use strict'; - module('JSCS - ember-utils/tests'); - test('ember-utils/tests/inspect_test.js should pass jscs', function () { - ok(true, 'ember-utils/tests/inspect_test.js should pass jscs.'); + QUnit.module('Ember.makeArray'); + + QUnit.test('undefined', function () { + deepEqual(_emberUtilsMakeArray.default(), []); + deepEqual(_emberUtilsMakeArray.default(undefined), []); + }); + + QUnit.test('null', function () { + deepEqual(_emberUtilsMakeArray.default(null), []); + }); + + QUnit.test('string', function () { + deepEqual(_emberUtilsMakeArray.default('lindsay'), ['lindsay']); + }); + + QUnit.test('number', function () { + deepEqual(_emberUtilsMakeArray.default(0), [0]); + deepEqual(_emberUtilsMakeArray.default(1), [1]); + }); + + QUnit.test('array', function () { + deepEqual(_emberUtilsMakeArray.default([1, 2, 42]), [1, 2, 42]); + }); + + QUnit.test('true', function () { + deepEqual(_emberUtilsMakeArray.default(true), [true]); + }); + + QUnit.test('false', function () { + deepEqual(_emberUtilsMakeArray.default(false), [false]); + }); + + QUnit.test('object', function () { + deepEqual(_emberUtilsMakeArray.default({}), [{}]); }); }); -enifed('ember-utils/tests/inspect_test.jshint', ['exports'], function (exports) { +enifed('ember-utils/tests/make_array_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-utils/tests'); - QUnit.test('ember-utils/tests/inspect_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/tests/make_array_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/tests/inspect_test.js should pass jshint.'); + assert.ok(true, 'ember-utils/tests/make_array_test.js should pass ESLint\n\n'); }); }); enifed('ember-utils/tests/to-string-test', ['exports', 'ember-utils/index'], function (exports, _emberUtilsIndex) { @@ -70673,21 +67553,13 @@ enifed('ember-utils/tests/to-string-test', ['exports', 'ember-utils/index'], fun strictEqual(_emberUtilsIndex.toString(obj), ({}).toString()); }); }); -enifed('ember-utils/tests/to-string-test.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/tests/to-string-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils/tests'); - test('ember-utils/tests/to-string-test.js should pass jscs', function () { - ok(true, 'ember-utils/tests/to-string-test.js should pass jscs.'); - }); -}); -enifed('ember-utils/tests/to-string-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-utils/tests'); - QUnit.test('ember-utils/tests/to-string-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/tests/to-string-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/tests/to-string-test.js should pass jshint.'); + assert.ok(true, 'ember-utils/tests/to-string-test.js should pass ESLint\n\n'); }); }); enifed('ember-utils/tests/try_invoke_test', ['exports', 'ember-utils/index'], function (exports, _emberUtilsIndex) { @@ -70728,480 +67600,265 @@ enifed('ember-utils/tests/try_invoke_test', ['exports', 'ember-utils/index'], fu equal(_emberUtilsIndex.tryInvoke(obj, 'aMethodThatTakesArguments', [true, true]), true); }); }); -enifed('ember-utils/tests/try_invoke_test.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/tests/try_invoke_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils/tests'); - test('ember-utils/tests/try_invoke_test.js should pass jscs', function () { - ok(true, 'ember-utils/tests/try_invoke_test.js should pass jscs.'); - }); -}); -enifed('ember-utils/tests/try_invoke_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-utils/tests'); - QUnit.test('ember-utils/tests/try_invoke_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/tests/try_invoke_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/tests/try_invoke_test.js should pass jshint.'); - }); -}); -enifed('ember-utils/to-string.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-utils'); - test('ember-utils/to-string.js should pass jscs', function () { - ok(true, 'ember-utils/to-string.js should pass jscs.'); + assert.ok(true, 'ember-utils/tests/try_invoke_test.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/to-string.jshint', ['exports'], function (exports) { +enifed('ember-utils/to-string.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/to-string.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/to-string.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/to-string.js should pass jshint.'); + assert.ok(true, 'ember-utils/to-string.js should pass ESLint\n\n'); }); }); -enifed('ember-views/compat/attrs.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/weak-map-utils.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-views/compat'); - test('ember-views/compat/attrs.js should pass jscs', function () { - ok(true, 'ember-views/compat/attrs.js should pass jscs.'); - }); -}); -enifed('ember-views/compat/attrs.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-views/compat'); - QUnit.test('ember-views/compat/attrs.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/weak-map-utils.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/compat/attrs.js should pass jshint.'); + assert.ok(true, 'ember-utils/weak-map-utils.js should pass ESLint\n\n'); }); }); -enifed('ember-views/compat/fallback-view-registry.jscs-test', ['exports'], function (exports) { +enifed('ember-views/compat/attrs.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-views/compat'); - test('ember-views/compat/fallback-view-registry.js should pass jscs', function () { - ok(true, 'ember-views/compat/fallback-view-registry.js should pass jscs.'); - }); -}); -enifed('ember-views/compat/fallback-view-registry.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-views/compat'); - QUnit.test('ember-views/compat/fallback-view-registry.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/compat/attrs.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/compat/fallback-view-registry.js should pass jshint.'); + assert.ok(true, 'ember-views/compat/attrs.js should pass ESLint\n\n'); }); }); -enifed('ember-views/component_lookup.jscs-test', ['exports'], function (exports) { +enifed('ember-views/compat/fallback-view-registry.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-views'); - test('ember-views/component_lookup.js should pass jscs', function () { - ok(true, 'ember-views/component_lookup.js should pass jscs.'); - }); -}); -enifed('ember-views/component_lookup.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-views'); - QUnit.test('ember-views/component_lookup.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/compat/fallback-view-registry.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/component_lookup.js should pass jshint.'); - }); -}); -enifed('ember-views/index.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views'); - test('ember-views/index.js should pass jscs', function () { - ok(true, 'ember-views/index.js should pass jscs.'); + assert.ok(true, 'ember-views/compat/fallback-view-registry.js should pass ESLint\n\n'); }); }); -enifed('ember-views/index.jshint', ['exports'], function (exports) { +enifed('ember-views/component_lookup.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views'); - QUnit.test('ember-views/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/component_lookup.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/index.js should pass jshint.'); + assert.ok(true, 'ember-views/component_lookup.js should pass ESLint\n\n'); }); }); -enifed('ember-views/mixins/action_support.jscs-test', ['exports'], function (exports) { +enifed('ember-views/index.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-views/mixins'); - test('ember-views/mixins/action_support.js should pass jscs', function () { - ok(true, 'ember-views/mixins/action_support.js should pass jscs.'); - }); -}); -enifed('ember-views/mixins/action_support.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-views/mixins'); - QUnit.test('ember-views/mixins/action_support.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/mixins/action_support.js should pass jshint.'); - }); -}); -enifed('ember-views/mixins/child_views_support.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/mixins'); - test('ember-views/mixins/child_views_support.js should pass jscs', function () { - ok(true, 'ember-views/mixins/child_views_support.js should pass jscs.'); + assert.ok(true, 'ember-views/index.js should pass ESLint\n\n'); }); }); -enifed('ember-views/mixins/child_views_support.jshint', ['exports'], function (exports) { +enifed('ember-views/mixins/action_support.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/mixins'); - QUnit.test('ember-views/mixins/child_views_support.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/mixins/action_support.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/mixins/child_views_support.js should pass jshint.'); - }); -}); -enifed('ember-views/mixins/class_names_support.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/mixins'); - test('ember-views/mixins/class_names_support.js should pass jscs', function () { - ok(true, 'ember-views/mixins/class_names_support.js should pass jscs.'); + assert.ok(true, 'ember-views/mixins/action_support.js should pass ESLint\n\n'); }); }); -enifed('ember-views/mixins/class_names_support.jshint', ['exports'], function (exports) { +enifed('ember-views/mixins/child_views_support.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/mixins'); - QUnit.test('ember-views/mixins/class_names_support.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/mixins/child_views_support.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/mixins/class_names_support.js should pass jshint.'); - }); -}); -enifed('ember-views/mixins/text_support.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/mixins'); - test('ember-views/mixins/text_support.js should pass jscs', function () { - ok(true, 'ember-views/mixins/text_support.js should pass jscs.'); + assert.ok(true, 'ember-views/mixins/child_views_support.js should pass ESLint\n\n'); }); }); -enifed('ember-views/mixins/text_support.jshint', ['exports'], function (exports) { +enifed('ember-views/mixins/class_names_support.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/mixins'); - QUnit.test('ember-views/mixins/text_support.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/mixins/class_names_support.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/mixins/text_support.js should pass jshint.'); - }); -}); -enifed('ember-views/mixins/view_state_support.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/mixins'); - test('ember-views/mixins/view_state_support.js should pass jscs', function () { - ok(true, 'ember-views/mixins/view_state_support.js should pass jscs.'); + assert.ok(true, 'ember-views/mixins/class_names_support.js should pass ESLint\n\n'); }); }); -enifed('ember-views/mixins/view_state_support.jshint', ['exports'], function (exports) { +enifed('ember-views/mixins/text_support.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/mixins'); - QUnit.test('ember-views/mixins/view_state_support.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/mixins/text_support.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/mixins/view_state_support.js should pass jshint.'); + assert.ok(true, 'ember-views/mixins/text_support.js should pass ESLint\n\n'); }); }); -enifed('ember-views/mixins/view_support.jscs-test', ['exports'], function (exports) { +enifed('ember-views/mixins/view_state_support.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-views/mixins'); - test('ember-views/mixins/view_support.js should pass jscs', function () { - ok(true, 'ember-views/mixins/view_support.js should pass jscs.'); - }); -}); -enifed('ember-views/mixins/view_support.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-views/mixins'); - QUnit.test('ember-views/mixins/view_support.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/mixins/view_state_support.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/mixins/view_support.js should pass jshint.'); + assert.ok(true, 'ember-views/mixins/view_state_support.js should pass ESLint\n\n'); }); }); -enifed('ember-views/system/action_manager.jscs-test', ['exports'], function (exports) { +enifed('ember-views/mixins/view_support.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-views/system'); - test('ember-views/system/action_manager.js should pass jscs', function () { - ok(true, 'ember-views/system/action_manager.js should pass jscs.'); - }); -}); -enifed('ember-views/system/action_manager.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-views/system'); - QUnit.test('ember-views/system/action_manager.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/mixins/view_support.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/system/action_manager.js should pass jshint.'); - }); -}); -enifed('ember-views/system/event_dispatcher.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/system'); - test('ember-views/system/event_dispatcher.js should pass jscs', function () { - ok(true, 'ember-views/system/event_dispatcher.js should pass jscs.'); + assert.ok(true, 'ember-views/mixins/view_support.js should pass ESLint\n\n'); }); }); -enifed('ember-views/system/event_dispatcher.jshint', ['exports'], function (exports) { +enifed('ember-views/system/action_manager.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/system'); - QUnit.test('ember-views/system/event_dispatcher.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/system/action_manager.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/system/event_dispatcher.js should pass jshint.'); - }); -}); -enifed('ember-views/system/ext.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/system'); - test('ember-views/system/ext.js should pass jscs', function () { - ok(true, 'ember-views/system/ext.js should pass jscs.'); + assert.ok(true, 'ember-views/system/action_manager.js should pass ESLint\n\n'); }); }); -enifed('ember-views/system/ext.jshint', ['exports'], function (exports) { +enifed('ember-views/system/event_dispatcher.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/system'); - QUnit.test('ember-views/system/ext.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/system/event_dispatcher.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/system/ext.js should pass jshint.'); - }); -}); -enifed('ember-views/system/jquery.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/system'); - test('ember-views/system/jquery.js should pass jscs', function () { - ok(true, 'ember-views/system/jquery.js should pass jscs.'); + assert.ok(true, 'ember-views/system/event_dispatcher.js should pass ESLint\n\n'); }); }); -enifed('ember-views/system/jquery.jshint', ['exports'], function (exports) { +enifed('ember-views/system/ext.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/system'); - QUnit.test('ember-views/system/jquery.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/system/ext.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/system/jquery.js should pass jshint.'); - }); -}); -enifed('ember-views/system/lookup_partial.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/system'); - test('ember-views/system/lookup_partial.js should pass jscs', function () { - ok(true, 'ember-views/system/lookup_partial.js should pass jscs.'); + assert.ok(true, 'ember-views/system/ext.js should pass ESLint\n\n'); }); }); -enifed('ember-views/system/lookup_partial.jshint', ['exports'], function (exports) { +enifed('ember-views/system/jquery.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/system'); - QUnit.test('ember-views/system/lookup_partial.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/system/jquery.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/system/lookup_partial.js should pass jshint.'); + assert.ok(true, 'ember-views/system/jquery.js should pass ESLint\n\n'); }); }); -enifed('ember-views/system/utils.jscs-test', ['exports'], function (exports) { +enifed('ember-views/system/lookup_partial.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-views/system'); - test('ember-views/system/utils.js should pass jscs', function () { - ok(true, 'ember-views/system/utils.js should pass jscs.'); - }); -}); -enifed('ember-views/system/utils.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-views/system'); - QUnit.test('ember-views/system/utils.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/system/lookup_partial.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/system/utils.js should pass jshint.'); - }); -}); -enifed('ember-views/utils/lookup-component.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/utils'); - test('ember-views/utils/lookup-component.js should pass jscs', function () { - ok(true, 'ember-views/utils/lookup-component.js should pass jscs.'); + assert.ok(true, 'ember-views/system/lookup_partial.js should pass ESLint\n\n'); }); }); -enifed('ember-views/utils/lookup-component.jshint', ['exports'], function (exports) { +enifed('ember-views/system/utils.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/utils'); - QUnit.test('ember-views/utils/lookup-component.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/system/utils.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/utils/lookup-component.js should pass jshint.'); + assert.ok(true, 'ember-views/system/utils.js should pass ESLint\n\n'); }); }); -enifed('ember-views/views/core_view.jscs-test', ['exports'], function (exports) { +enifed('ember-views/utils/lookup-component.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-views/views'); - test('ember-views/views/core_view.js should pass jscs', function () { - ok(true, 'ember-views/views/core_view.js should pass jscs.'); - }); -}); -enifed('ember-views/views/core_view.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-views/views'); - QUnit.test('ember-views/views/core_view.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/utils/lookup-component.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/views/core_view.js should pass jshint.'); + assert.ok(true, 'ember-views/utils/lookup-component.js should pass ESLint\n\n'); }); }); -enifed('ember-views/views/states.jscs-test', ['exports'], function (exports) { +enifed('ember-views/views/core_view.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-views/views'); - test('ember-views/views/states.js should pass jscs', function () { - ok(true, 'ember-views/views/states.js should pass jscs.'); - }); -}); -enifed('ember-views/views/states.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-views/views'); - QUnit.test('ember-views/views/states.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/views/core_view.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/views/states.js should pass jshint.'); + assert.ok(true, 'ember-views/views/core_view.js should pass ESLint\n\n'); }); }); -enifed('ember-views/views/states/default.jscs-test', ['exports'], function (exports) { +enifed('ember-views/views/states.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-views/views/states'); - test('ember-views/views/states/default.js should pass jscs', function () { - ok(true, 'ember-views/views/states/default.js should pass jscs.'); - }); -}); -enifed('ember-views/views/states/default.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-views/views/states'); - QUnit.test('ember-views/views/states/default.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/views/states.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/views/states/default.js should pass jshint.'); - }); -}); -enifed('ember-views/views/states/destroying.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/views/states'); - test('ember-views/views/states/destroying.js should pass jscs', function () { - ok(true, 'ember-views/views/states/destroying.js should pass jscs.'); + assert.ok(true, 'ember-views/views/states.js should pass ESLint\n\n'); }); }); -enifed('ember-views/views/states/destroying.jshint', ['exports'], function (exports) { +enifed('ember-views/views/states/default.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/views/states'); - QUnit.test('ember-views/views/states/destroying.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/views/states/default.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/views/states/destroying.js should pass jshint.'); + assert.ok(true, 'ember-views/views/states/default.js should pass ESLint\n\n'); }); }); -enifed('ember-views/views/states/has_element.jscs-test', ['exports'], function (exports) { +enifed('ember-views/views/states/destroying.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-views/views/states'); - test('ember-views/views/states/has_element.js should pass jscs', function () { - ok(true, 'ember-views/views/states/has_element.js should pass jscs.'); - }); -}); -enifed('ember-views/views/states/has_element.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-views/views/states'); - QUnit.test('ember-views/views/states/has_element.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/views/states/destroying.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/views/states/has_element.js should pass jshint.'); - }); -}); -enifed('ember-views/views/states/in_dom.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/views/states'); - test('ember-views/views/states/in_dom.js should pass jscs', function () { - ok(true, 'ember-views/views/states/in_dom.js should pass jscs.'); + assert.ok(true, 'ember-views/views/states/destroying.js should pass ESLint\n\n'); }); }); -enifed('ember-views/views/states/in_dom.jshint', ['exports'], function (exports) { +enifed('ember-views/views/states/has_element.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/views/states'); - QUnit.test('ember-views/views/states/in_dom.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/views/states/has_element.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/views/states/in_dom.js should pass jshint.'); - }); -}); -enifed('ember-views/views/states/pre_render.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/views/states'); - test('ember-views/views/states/pre_render.js should pass jscs', function () { - ok(true, 'ember-views/views/states/pre_render.js should pass jscs.'); + assert.ok(true, 'ember-views/views/states/has_element.js should pass ESLint\n\n'); }); }); -enifed('ember-views/views/states/pre_render.jshint', ['exports'], function (exports) { +enifed('ember-views/views/states/in_dom.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/views/states'); - QUnit.test('ember-views/views/states/pre_render.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/views/states/in_dom.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/views/states/pre_render.js should pass jshint.'); - }); -}); -enifed('ember-views/views/view.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/views'); - test('ember-views/views/view.js should pass jscs', function () { - ok(true, 'ember-views/views/view.js should pass jscs.'); + assert.ok(true, 'ember-views/views/states/in_dom.js should pass ESLint\n\n'); }); }); -enifed('ember-views/views/view.jshint', ['exports'], function (exports) { +enifed('ember-views/views/states/pre_render.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/views'); - QUnit.test('ember-views/views/view.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/views/states/pre_render.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/views/view.js should pass jshint.'); + assert.ok(true, 'ember-views/views/states/pre_render.js should pass ESLint\n\n'); }); }); -enifed('ember/index.jscs-test', ['exports'], function (exports) { +enifed('ember-views/views/view.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember'); - test('ember/index.js should pass jscs', function () { - ok(true, 'ember/index.js should pass jscs.'); + QUnit.module('ESLint | ember-views/views/view.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/views/view.js should pass ESLint\n\n'); }); }); -enifed('ember/index.jshint', ['exports'], function (exports) { +enifed('ember/index.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember'); - QUnit.test('ember/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/index.js should pass jshint.'); + assert.ok(true, 'ember/index.js should pass ESLint\n\n'); }); }); enifed('ember/tests/application_lifecycle_test', ['exports', 'ember-application', 'ember-routing', 'ember-metal', 'ember-glimmer', 'ember-views', 'ember-template-compiler'], function (exports, _emberApplication, _emberRouting, _emberMetal, _emberGlimmer, _emberViews, _emberTemplateCompiler) { @@ -71424,21 +68081,13 @@ enifed('ember/tests/application_lifecycle_test', ['exports', 'ember-application' }); }); }); -enifed('ember/tests/application_lifecycle_test.jscs-test', ['exports'], function (exports) { +enifed('ember/tests/application_lifecycle_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember/tests'); - test('ember/tests/application_lifecycle_test.js should pass jscs', function () { - ok(true, 'ember/tests/application_lifecycle_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/application_lifecycle_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember/tests'); - QUnit.test('ember/tests/application_lifecycle_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/application_lifecycle_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/application_lifecycle_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/application_lifecycle_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/component_registration_test', ['exports', 'ember-runtime', 'ember-metal', 'ember-application', 'ember-routing', 'ember-template-compiler', 'ember-glimmer', 'ember-views'], function (exports, _emberRuntime, _emberMetal, _emberApplication, _emberRouting, _emberTemplateCompiler, _emberGlimmer, _emberViews) { @@ -71799,21 +68448,13 @@ enifed('ember/tests/component_registration_test', ['exports', 'ember-runtime', ' _emberViews.jQuery('#fizzbuzz', '#wrapper').click(); }); }); -enifed('ember/tests/component_registration_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests'); - test('ember/tests/component_registration_test.js should pass jscs', function () { - ok(true, 'ember/tests/component_registration_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/component_registration_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/component_registration_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests'); - QUnit.test('ember/tests/component_registration_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/component_registration_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/component_registration_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/component_registration_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/controller_test', ['exports', 'ember-runtime', 'ember-routing', 'ember-metal', 'ember-template-compiler', 'ember-application', 'ember-glimmer', 'ember-views'], function (exports, _emberRuntime, _emberRouting, _emberMetal, _emberTemplateCompiler, _emberApplication, _emberGlimmer, _emberViews) { @@ -71889,21 +68530,13 @@ enifed('ember/tests/controller_test', ['exports', 'ember-runtime', 'ember-routin _emberMetal.run(App, 'advanceReadiness'); } }); -enifed('ember/tests/controller_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests'); - test('ember/tests/controller_test.js should pass jscs', function () { - ok(true, 'ember/tests/controller_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/controller_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/controller_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests'); - QUnit.test('ember/tests/controller_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/controller_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/controller_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/controller_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/global-api-test', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { @@ -71927,21 +68560,13 @@ enifed('ember/tests/global-api-test', ['exports', 'ember-metal', 'ember-runtime' confirmExport('Ember.Helper.helper'); confirmExport('Ember.isArray', _emberRuntime.isArray); }); -enifed('ember/tests/global-api-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests'); - test('ember/tests/global-api-test.js should pass jscs', function () { - ok(true, 'ember/tests/global-api-test.js should pass jscs.'); - }); -}); -enifed('ember/tests/global-api-test.jshint', ['exports'], function (exports) { +enifed('ember/tests/global-api-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests'); - QUnit.test('ember/tests/global-api-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/global-api-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/global-api-test.js should pass jshint.'); + assert.ok(true, 'ember/tests/global-api-test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/helpers/helper_registration_test', ['exports', 'ember-runtime', 'ember-metal', 'ember-template-compiler', 'ember-glimmer', 'ember-application', 'ember-routing', 'ember-views'], function (exports, _emberRuntime, _emberMetal, _emberTemplateCompiler, _emberGlimmer, _emberApplication, _emberRouting, _emberViews) { @@ -71976,6 +68601,7 @@ enifed('ember/tests/helpers/helper_registration_test', ['exports', 'ember-runtim location: 'none' }); + // We shouldn't be testing this appInstance = App.__deprecatedInstance__; if (callback) { @@ -72060,21 +68686,13 @@ enifed('ember/tests/helpers/helper_registration_test', ['exports', 'ember-runtim ok(serviceCalled, 'service was injected, method called'); }); }); -enifed('ember/tests/helpers/helper_registration_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests/helpers'); - test('ember/tests/helpers/helper_registration_test.js should pass jscs', function () { - ok(true, 'ember/tests/helpers/helper_registration_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/helpers/helper_registration_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/helpers/helper_registration_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests/helpers'); - QUnit.test('ember/tests/helpers/helper_registration_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/helpers/helper_registration_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/helpers/helper_registration_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/helpers/helper_registration_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/helpers/link_to_test', ['exports', 'ember-console', 'ember-runtime', 'ember-metal', 'ember-routing', 'ember-application', 'ember-views', 'ember-template-compiler', 'ember-glimmer'], function (exports, _emberConsole, _emberRuntime, _emberMetal, _emberRouting, _emberApplication, _emberViews, _emberTemplateCompiler, _emberGlimmer) { @@ -72188,7 +68806,7 @@ enifed('ember/tests/helpers/link_to_test', ['exports', 'ember-console', 'ember-r equal(_emberViews.jQuery('#home-link:not(.active)', '#qunit-fixture').length, 1, 'The other link was rendered without active class'); }); - if (false) { + if (_emberMetal.isFeatureEnabled('ember-improved-instrumentation')) { QUnit.test('The {{link-to}} helper fires an interaction event', function (assert) { assert.expect(2); Router.map(function (match) { @@ -73650,21 +70268,13 @@ enifed('ember/tests/helpers/link_to_test', ['exports', 'ember-console', 'ember-r shouldBeActive('#parent-link'); }); }); -enifed('ember/tests/helpers/link_to_test.jscs-test', ['exports'], function (exports) { +enifed('ember/tests/helpers/link_to_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember/tests/helpers'); - test('ember/tests/helpers/link_to_test.js should pass jscs', function () { - ok(true, 'ember/tests/helpers/link_to_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/helpers/link_to_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember/tests/helpers'); - QUnit.test('ember/tests/helpers/link_to_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/helpers/link_to_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/helpers/link_to_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/helpers/link_to_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test', ['exports', 'ember-runtime', 'ember-routing', 'ember-metal', 'ember-template-compiler', 'ember-application', 'ember-views', 'ember-glimmer'], function (exports, _emberRuntime, _emberRouting, _emberMetal, _emberTemplateCompiler, _emberApplication, _emberViews, _emberGlimmer) { @@ -73672,7 +70282,6 @@ enifed('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test', [' var Router = undefined, App = undefined, - router = undefined, registry = undefined, container = undefined; @@ -73680,7 +70289,7 @@ enifed('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test', [' otherDefer = undefined; function bootApplication() { - router = container.lookup('router:main'); + container.lookup('router:main'); _emberMetal.run(App, 'advanceReadiness'); } @@ -73859,21 +70468,13 @@ enifed('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test', [' assertHasClass('ember-transitioning-out', $index, false, $about, false, $other, false); }); }); -enifed('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests/helpers/link_to_test'); - test('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js should pass jscs', function () { - ok(true, 'ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests/helpers/link_to_test'); - QUnit.test('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/helpers/link_to_test/link_to_with_query_params_test', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing', 'ember-template-compiler', 'ember-application', 'ember-views', 'ember-glimmer'], function (exports, _emberMetal, _emberRuntime, _emberRouting, _emberTemplateCompiler, _emberApplication, _emberViews, _emberGlimmer) { @@ -74346,21 +70947,13 @@ enifed('ember/tests/helpers/link_to_test/link_to_with_query_params_test', ['expo shouldBeActive('#foos-link'); }); }); -enifed('ember/tests/helpers/link_to_test/link_to_with_query_params_test.jscs-test', ['exports'], function (exports) { +enifed('ember/tests/helpers/link_to_test/link_to_with_query_params_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember/tests/helpers/link_to_test'); - test('ember/tests/helpers/link_to_test/link_to_with_query_params_test.js should pass jscs', function () { - ok(true, 'ember/tests/helpers/link_to_test/link_to_with_query_params_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/helpers/link_to_test/link_to_with_query_params_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember/tests/helpers/link_to_test'); - QUnit.test('ember/tests/helpers/link_to_test/link_to_with_query_params_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/helpers/link_to_test/link_to_with_query_params_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/helpers/link_to_test/link_to_with_query_params_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/helpers/link_to_test/link_to_with_query_params_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/homepage_example_test', ['exports', 'ember-routing', 'ember-metal', 'ember-application', 'ember-runtime', 'ember-template-compiler', 'ember-views', 'ember-glimmer'], function (exports, _emberRouting, _emberMetal, _emberApplication, _emberRuntime, _emberTemplateCompiler, _emberViews, _emberGlimmer) { @@ -74437,21 +71030,13 @@ enifed('ember/tests/homepage_example_test', ['exports', 'ember-routing', 'ember- equal($fixture.find('li:nth-of-type(2)').text(), 'Hello, Yehuda Katz!'); }); }); -enifed('ember/tests/homepage_example_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests'); - test('ember/tests/homepage_example_test.js should pass jscs', function () { - ok(true, 'ember/tests/homepage_example_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/homepage_example_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/homepage_example_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests'); - QUnit.test('ember/tests/homepage_example_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/homepage_example_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/homepage_example_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/homepage_example_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/integration/multiple-app-test', ['exports', 'ember-metal', 'ember-template-compiler', 'ember-application', 'ember-glimmer', 'ember-views'], function (exports, _emberMetal, _emberTemplateCompiler, _emberApplication, _emberGlimmer, _emberViews) { @@ -74524,21 +71109,13 @@ enifed('ember/tests/integration/multiple-app-test', ['exports', 'ember-metal', ' assert.deepEqual(actions, ['#app-2', '#app-1']); }); }); -enifed('ember/tests/integration/multiple-app-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests/integration'); - test('ember/tests/integration/multiple-app-test.js should pass jscs', function () { - ok(true, 'ember/tests/integration/multiple-app-test.js should pass jscs.'); - }); -}); -enifed('ember/tests/integration/multiple-app-test.jshint', ['exports'], function (exports) { +enifed('ember/tests/integration/multiple-app-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests/integration'); - QUnit.test('ember/tests/integration/multiple-app-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/integration/multiple-app-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/integration/multiple-app-test.js should pass jshint.'); + assert.ok(true, 'ember/tests/integration/multiple-app-test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/reexports_test', ['exports', 'ember/index', 'internal-test-helpers', 'ember-metal'], function (exports, _emberIndex, _internalTestHelpers, _emberMetal) { @@ -74562,7 +71139,7 @@ enifed('ember/tests/reexports_test', ['exports', 'ember/index', 'internal-test-h ['computed', 'ember-metal'], ['computed.alias', 'ember-metal', 'alias'], ['ComputedProperty', 'ember-metal'], ['cacheFor', 'ember-metal'], ['deprecate', 'ember-metal'], ['deprecateFunc', 'ember-metal'], ['assert', 'ember-metal'], ['warn', 'ember-metal'], ['debug', 'ember-metal'], ['runInDebug', 'ember-metal'], ['merge', 'ember-metal'], ['instrument', 'ember-metal'], ['Instrumentation.instrument', 'ember-metal', 'instrument'], ['Instrumentation.subscribe', 'ember-metal', 'instrumentationSubscribe'], ['Instrumentation.unsubscribe', 'ember-metal', 'instrumentationUnsubscribe'], ['Instrumentation.reset', 'ember-metal', 'instrumentationReset'], ['testing', 'ember-metal', { get: 'isTesting', set: 'setTesting' }], ['onerror', 'ember-metal', { get: 'getOnerror', set: 'setOnerror' }], // ['create'], TODO: figure out what to do here // ['keys'], TODO: figure out what to do here - ['FEATURES', 'ember-metal'], ['FEATURES.isEnabled', 'ember-metal', 'isFeatureEnabled'], ['Error', 'ember-metal'], ['META_DESC', 'ember-metal'], ['meta', 'ember-metal'], ['get', 'ember-metal'], ['set', 'ember-metal'], ['_getPath', 'ember-metal'], ['getWithDefault', 'ember-metal'], ['trySet', 'ember-metal'], ['_Cache', 'ember-metal', 'Cache'], ['on', 'ember-metal'], ['addListener', 'ember-metal'], ['removeListener', 'ember-metal'], ['_suspendListener', 'ember-metal', 'suspendListener'], ['_suspendListeners', 'ember-metal', 'suspendListeners'], ['sendEvent', 'ember-metal'], ['hasListeners', 'ember-metal'], ['watchedEvents', 'ember-metal'], ['listenersFor', 'ember-metal'], ['accumulateListeners', 'ember-metal'], ['isNone', 'ember-metal'], ['isEmpty', 'ember-metal'], ['isBlank', 'ember-metal'], ['isPresent', 'ember-metal'], ['_Backburner', 'backburner', 'default'], ['run', 'ember-metal'], ['_ObserverSet', 'ember-metal', 'ObserverSet'], ['propertyWillChange', 'ember-metal'], ['propertyDidChange', 'ember-metal'], ['overrideChains', 'ember-metal'], ['beginPropertyChanges', 'ember-metal'], ['beginPropertyChanges', 'ember-metal'], ['endPropertyChanges', 'ember-metal'], ['changeProperties', 'ember-metal'], ['defineProperty', 'ember-metal'], ['watchKey', 'ember-metal'], ['unwatchKey', 'ember-metal'], ['removeChainWatcher', 'ember-metal'], ['_ChainNode', 'ember-metal', 'ChainNode'], ['finishChains', 'ember-metal'], ['watchPath', 'ember-metal'], ['unwatchPath', 'ember-metal'], ['watch', 'ember-metal'], ['isWatching', 'ember-metal'], ['unwatch', 'ember-metal'], ['destroy', 'ember-metal'], ['libraries', 'ember-metal'], ['OrderedSet', 'ember-metal'], ['Map', 'ember-metal'], ['MapWithDefault', 'ember-metal'], ['getProperties', 'ember-metal'], ['setProperties', 'ember-metal'], ['expandProperties', 'ember-metal'], ['NAME_KEY', 'ember-metal'], ['addObserver', 'ember-metal'], ['observersFor', 'ember-metal'], ['removeObserver', 'ember-metal'], ['_suspendObserver', 'ember-metal'], ['_suspendObservers', 'ember-metal'], ['required', 'ember-metal'], ['aliasMethod', 'ember-metal'], ['observer', 'ember-metal'], ['immediateObserver', 'ember-metal', '_immediateObserver'], ['mixin', 'ember-metal'], ['Mixin', 'ember-metal'], ['bind', 'ember-metal'], ['Binding', 'ember-metal'], ['isGlobalPath', 'ember-metal'], + ['FEATURES', 'ember-metal'], ['FEATURES.isEnabled', 'ember-metal', 'isFeatureEnabled'], ['Error', 'ember-metal'], ['META_DESC', 'ember-metal'], ['meta', 'ember-metal'], ['get', 'ember-metal'], ['set', 'ember-metal'], ['_getPath', 'ember-metal'], ['getWithDefault', 'ember-metal'], ['trySet', 'ember-metal'], ['_Cache', 'ember-metal', 'Cache'], ['on', 'ember-metal'], ['addListener', 'ember-metal'], ['removeListener', 'ember-metal'], ['_suspendListener', 'ember-metal', 'suspendListener'], ['_suspendListeners', 'ember-metal', 'suspendListeners'], ['sendEvent', 'ember-metal'], ['hasListeners', 'ember-metal'], ['watchedEvents', 'ember-metal'], ['listenersFor', 'ember-metal'], ['accumulateListeners', 'ember-metal'], ['isNone', 'ember-metal'], ['isEmpty', 'ember-metal'], ['isBlank', 'ember-metal'], ['isPresent', 'ember-metal'], ['_Backburner', 'backburner', 'default'], ['run', 'ember-metal'], ['_ObserverSet', 'ember-metal', 'ObserverSet'], ['propertyWillChange', 'ember-metal'], ['propertyDidChange', 'ember-metal'], ['overrideChains', 'ember-metal'], ['beginPropertyChanges', 'ember-metal'], ['beginPropertyChanges', 'ember-metal'], ['endPropertyChanges', 'ember-metal'], ['changeProperties', 'ember-metal'], ['defineProperty', 'ember-metal'], ['watchKey', 'ember-metal'], ['unwatchKey', 'ember-metal'], ['removeChainWatcher', 'ember-metal'], ['_ChainNode', 'ember-metal', 'ChainNode'], ['finishChains', 'ember-metal'], ['watchPath', 'ember-metal'], ['unwatchPath', 'ember-metal'], ['watch', 'ember-metal'], ['isWatching', 'ember-metal'], ['unwatch', 'ember-metal'], ['destroy', 'ember-metal'], ['libraries', 'ember-metal'], ['OrderedSet', 'ember-metal'], ['Map', 'ember-metal'], ['MapWithDefault', 'ember-metal'], ['getProperties', 'ember-metal'], ['setProperties', 'ember-metal'], ['expandProperties', 'ember-metal'], ['NAME_KEY', 'ember-utils'], ['addObserver', 'ember-metal'], ['observersFor', 'ember-metal'], ['removeObserver', 'ember-metal'], ['_suspendObserver', 'ember-metal'], ['_suspendObservers', 'ember-metal'], ['required', 'ember-metal'], ['aliasMethod', 'ember-metal'], ['observer', 'ember-metal'], ['immediateObserver', 'ember-metal', '_immediateObserver'], ['mixin', 'ember-metal'], ['Mixin', 'ember-metal'], ['bind', 'ember-metal'], ['Binding', 'ember-metal'], ['isGlobalPath', 'ember-metal'], // ember-views ['$', 'ember-views', 'jQuery'], ['ViewUtils.isSimpleClick', 'ember-views', 'isSimpleClick'], ['ViewUtils.getViewElement', 'ember-views', 'getViewElement'], ['ViewUtils.getViewBounds', 'ember-views', 'getViewBounds'], ['ViewUtils.getViewClientRects', 'ember-views', 'getViewClientRects'], ['ViewUtils.getViewBoundingClientRect', 'ember-views', 'getViewBoundingClientRect'], ['ViewUtils.getRootViews', 'ember-views', 'getRootViews'], ['ViewUtils.getChildViews', 'ember-views', 'getChildViews'], ['TextSupport', 'ember-views'], ['ComponentLookup', 'ember-views'], ['EventDispatcher', 'ember-views'], @@ -74595,33 +71172,23 @@ enifed('ember/tests/reexports_test', ['exports', 'ember/index', 'internal-test-h }); }); - if (true) { - QUnit.test('Ember.String.isHTMLSafe exports correctly', function (assert) { - _internalTestHelpers.confirmExport(_emberIndex.default, assert, 'String.isHTMLSafe', 'ember-glimmer', 'isHTMLSafe'); - }); - } + QUnit.test('Ember.String.isHTMLSafe exports correctly', function (assert) { + _internalTestHelpers.confirmExport(_emberIndex.default, assert, 'String.isHTMLSafe', 'ember-glimmer', 'isHTMLSafe'); + }); - if (false) { + if (_emberMetal.isFeatureEnabled('ember-metal-weakmap')) { QUnit.test('Ember.WeakMap exports correctly', function (assert) { _internalTestHelpers.confirmExport(_emberIndex.default, assert, 'WeakMap', 'ember-metal', 'WeakMap'); }); } }); -enifed('ember/tests/reexports_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests'); - test('ember/tests/reexports_test.js should pass jscs', function () { - ok(true, 'ember/tests/reexports_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/reexports_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/reexports_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests'); - QUnit.test('ember/tests/reexports_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/reexports_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/reexports_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/reexports_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-console', 'ember-runtime', 'ember-routing', 'ember-metal', 'ember-glimmer', 'ember-views', 'ember-template-compiler', 'ember-application', 'router'], function (exports, _emberUtils, _emberConsole, _emberRuntime, _emberRouting, _emberMetal, _emberGlimmer, _emberViews, _emberTemplateCompiler, _emberApplication, _router) { @@ -75918,7 +72485,6 @@ enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-conso var post1 = {}; var post2 = {}; var post3 = {}; - var currentPost = undefined; var share1 = {}; var share2 = {}; var share3 = {}; @@ -75964,15 +72530,12 @@ enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-conso bootApplication(); - currentPost = post1; handleURL('/posts/1/comments'); handleURL('/posts/1/shares/1'); - currentPost = post2; handleURL('/posts/2/comments'); handleURL('/posts/2/shares/2'); - currentPost = post3; handleURL('/posts/3/comments'); handleURL('/posts/3/shares/3'); }); @@ -75989,7 +72552,6 @@ enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-conso var post1 = {}; var post2 = {}; var post3 = {}; - var currentPost = undefined; var posts = { 1: post1, @@ -76013,13 +72575,8 @@ enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-conso bootApplication(); - currentPost = post1; handleURL('/posts/1/comments'); - - currentPost = post2; handleURL('/posts/2/comments'); - - currentPost = post3; handleURL('/posts/3/comments'); }); @@ -76844,6 +73401,8 @@ enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-conso }); QUnit.test('Route will assert if you try to explicitly render {into: ...} a missing template', function () { + expectDeprecation(/Rendering into a {{render}} helper that resolves to an {{outlet}} is deprecated./); + Router.map(function () { this.route('home', { path: '/' }); }); @@ -78038,7 +74597,12 @@ enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-conso }); QUnit.test('Can this.render({into:...}) the render helper', function () { - _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + expectDeprecation(/Rendering into a {{render}} helper that resolves to an {{outlet}} is deprecated./); + + expectDeprecation(function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + }, /Please refactor [\w\{\}"` ]+ to a component/); + _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('other')); _emberGlimmer.setTemplate('bar', _emberTemplateCompiler.compile('bar')); @@ -78065,7 +74629,12 @@ enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-conso }); QUnit.test('Can disconnect from the render helper', function () { - _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + expectDeprecation(/Rendering into a {{render}} helper that resolves to an {{outlet}} is deprecated./); + + expectDeprecation(function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + }, /Please refactor [\w\{\}"` ]+ to a component/); + _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('other')); @@ -78090,7 +74659,12 @@ enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-conso }); QUnit.test('Can this.render({into:...}) the render helper\'s children', function () { - _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + expectDeprecation(/Rendering into a {{render}} helper that resolves to an {{outlet}} is deprecated./); + + expectDeprecation(function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + }, /Please refactor [\w\{\}"` ]+ to a component/); + _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); _emberGlimmer.setTemplate('other', _emberTemplateCompiler.compile('other')); @@ -78119,7 +74693,12 @@ enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-conso }); QUnit.test('Can disconnect from the render helper\'s children', function () { - _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + expectDeprecation(/Rendering into a {{render}} helper that resolves to an {{outlet}} is deprecated./); + + expectDeprecation(function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + }, /Please refactor [\w\{\}"` ]+ to a component/); + _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); _emberGlimmer.setTemplate('other', _emberTemplateCompiler.compile('other')); @@ -78146,8 +74725,16 @@ enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-conso }); QUnit.test('Can this.render({into:...}) nested render helpers', function () { - _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); - _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); + expectDeprecation(/Rendering into a {{render}} helper that resolves to an {{outlet}} is deprecated./); + + expectDeprecation(function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + }, /Please refactor [\w\{\}"` ]+ to a component/); + + expectDeprecation(function () { + _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); + }, /Please refactor [\w\{\}"` ]+ to a component/); + _emberGlimmer.setTemplate('cart', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('other')); _emberGlimmer.setTemplate('baz', _emberTemplateCompiler.compile('baz')); @@ -78174,8 +74761,16 @@ enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-conso }); QUnit.test('Can disconnect from nested render helpers', function () { - _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); - _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); + expectDeprecation(/Rendering into a {{render}} helper that resolves to an {{outlet}} is deprecated./); + + expectDeprecation(function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + }, /Please refactor [\w\{\}"` ]+ to a component/); + + expectDeprecation(function () { + _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); + }, /Please refactor [\w\{\}"` ]+ to a component/); + _emberGlimmer.setTemplate('cart', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('other')); @@ -78400,21 +74995,13 @@ enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-conso equal(router._toplevelView, null, 'the toplevelView was not reinitialized'); }); }); -enifed('ember/tests/routing/basic_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests/routing'); - test('ember/tests/routing/basic_test.js should pass jscs', function () { - ok(true, 'ember/tests/routing/basic_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/routing/basic_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/routing/basic_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests/routing'); - QUnit.test('ember/tests/routing/basic_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/routing/basic_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/routing/basic_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/routing/basic_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'ember-metal', 'ember-routing', 'ember-views', 'internal-test-helpers'], function (exports, _emberRuntime, _emberMetal, _emberRouting, _emberViews, _internalTestHelpers) { @@ -78998,6 +75585,36 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em }); }; + _class.prototype['@test multiple QP value changes only cause a single model refresh'] = function testMultipleQPValueChangesOnlyCauseASingleModelRefresh(assert) { + var _this11 = this; + + assert.expect(2); + + this.setSingleQPController('index', 'alex', 'lol'); + this.setSingleQPController('index', 'steely', 'lel'); + + var refreshCount = 0; + this.registerRoute('index', _emberRouting.Route.extend({ + queryParams: { + alex: { + refreshModel: true + }, + steely: { + refreshModel: true + } + }, + refresh: function () { + refreshCount++; + } + })); + + return this.visitAndAssert('/').then(function () { + var indexController = _this11.getController('index'); + _emberMetal.run(indexController, 'setProperties', { alex: 'fran', steely: 'david' }); + assert.equal(refreshCount, 1, 'index refresh hook only run once'); + }); + }; + _class.prototype['@test refreshModel does not cause a second transition during app boot '] = function testRefreshModelDoesNotCauseASecondTransitionDuringAppBoot(assert) { assert.expect(1); @@ -79019,7 +75636,7 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em }; _class.prototype['@test queryParams are updated when a controller property is set and the route is refreshed. Issue #13263 '] = function testQueryParamsAreUpdatedWhenAControllerPropertyIsSetAndTheRouteIsRefreshedIssue13263(assert) { - var _this11 = this; + var _this12 = this; this.registerTemplate('application', '{{foo}}{{outlet}}'); @@ -79045,16 +75662,16 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em _emberMetal.run(_emberViews.jQuery('#test-button'), 'click'); assert.equal(_emberViews.jQuery('#test-value').text().trim(), '2'); - _this11.assertCurrentPath('/?foo=2'); + _this12.assertCurrentPath('/?foo=2'); _emberMetal.run(_emberViews.jQuery('#test-button'), 'click'); assert.equal(_emberViews.jQuery('#test-value').text().trim(), '3'); - _this11.assertCurrentPath('/?foo=3'); + _this12.assertCurrentPath('/?foo=3'); }); }; _class.prototype['@test Use Ember.get to retrieve query params \'refreshModel\' configuration'] = function testUseEmberGetToRetrieveQueryParamsRefreshModelConfiguration(assert) { - var _this12 = this; + var _this13 = this; assert.expect(7); @@ -79090,8 +75707,8 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em assert.equal(appModelCount, 1); assert.equal(indexModelCount, 1); - var indexController = _this12.getController('index'); - _this12.setAndFlush(indexController, 'omg', 'lex'); + var indexController = _this13.getController('index'); + _this13.setAndFlush(indexController, 'omg', 'lex'); assert.equal(appModelCount, 1); assert.equal(indexModelCount, 2); @@ -79099,7 +75716,7 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em }; _class.prototype['@test can use refreshModel even with URL changes that remove QPs from address bar'] = function testCanUseRefreshModelEvenWithURLChangesThatRemoveQPsFromAddressBar(assert) { - var _this13 = this; + var _this14 = this; assert.expect(4); @@ -79127,15 +75744,15 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visitAndAssert('/?omg=foo').then(function () { - _this13.transitionTo('/'); + _this14.transitionTo('/'); - var indexController = _this13.getController('index'); + var indexController = _this14.getController('index'); assert.equal(indexController.get('omg'), 'lol'); }); }; _class.prototype['@test can opt into a replace query by specifying replace:true in the Route config hash'] = function testCanOptIntoAReplaceQueryBySpecifyingReplaceTrueInTheRouteConfigHash(assert) { - var _this14 = this; + var _this15 = this; assert.expect(2); @@ -79150,14 +75767,14 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visitAndAssert('/').then(function () { - var appController = _this14.getController('application'); - _this14.expectedReplaceURL = '/?alex=wallace'; - _this14.setAndFlush(appController, 'alex', 'wallace'); + var appController = _this15.getController('application'); + _this15.expectedReplaceURL = '/?alex=wallace'; + _this15.setAndFlush(appController, 'alex', 'wallace'); }); }; _class.prototype['@test Route query params config can be configured using property name instead of URL key'] = function testRouteQueryParamsConfigCanBeConfiguredUsingPropertyNameInsteadOfURLKey(assert) { - var _this15 = this; + var _this16 = this; assert.expect(2); @@ -79174,14 +75791,14 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visitAndAssert('/').then(function () { - var appController = _this15.getController('application'); - _this15.expectedReplaceURL = '/?commit_by=igor_seb'; - _this15.setAndFlush(appController, 'commitBy', 'igor_seb'); + var appController = _this16.getController('application'); + _this16.expectedReplaceURL = '/?commit_by=igor_seb'; + _this16.setAndFlush(appController, 'commitBy', 'igor_seb'); }); }; _class.prototype['@test An explicit replace:false on a changed QP always wins and causes a pushState'] = function testAnExplicitReplaceFalseOnAChangedQPAlwaysWinsAndCausesAPushState(assert) { - var _this16 = this; + var _this17 = this; assert.expect(3); @@ -79203,14 +75820,14 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visit('/').then(function () { - var appController = _this16.getController('application'); - _this16.expectedPushURL = '/?alex=wallace&steely=jan'; + var appController = _this17.getController('application'); + _this17.expectedPushURL = '/?alex=wallace&steely=jan'; _emberMetal.run(appController, 'setProperties', { alex: 'wallace', steely: 'jan' }); - _this16.expectedPushURL = '/?alex=wallace&steely=fran'; + _this17.expectedPushURL = '/?alex=wallace&steely=fran'; _emberMetal.run(appController, 'setProperties', { steely: 'fran' }); - _this16.expectedReplaceURL = '/?alex=sriracha&steely=fran'; + _this17.expectedReplaceURL = '/?alex=sriracha&steely=fran'; _emberMetal.run(appController, 'setProperties', { alex: 'sriracha' }); }); }; @@ -79248,7 +75865,7 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em }; _class.prototype['@test Use Ember.get to retrieve query params \'replace\' configuration'] = function testUseEmberGetToRetrieveQueryParamsReplaceConfiguration(assert) { - var _this17 = this; + var _this18 = this; assert.expect(2); @@ -79264,14 +75881,14 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visitAndAssert('/').then(function () { - var appController = _this17.getController('application'); - _this17.expectedReplaceURL = '/?alex=wallace'; - _this17.setAndFlush(appController, 'alex', 'wallace'); + var appController = _this18.getController('application'); + _this18.expectedReplaceURL = '/?alex=wallace'; + _this18.setAndFlush(appController, 'alex', 'wallace'); }); }; _class.prototype['@test can override incoming QP values in setupController'] = function testCanOverrideIncomingQPValuesInSetupController(assert) { - var _this18 = this; + var _this19 = this; assert.expect(3); @@ -79294,13 +75911,13 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visitAndAssert('/about').then(function () { - _this18.transitionTo('index'); - _this18.assertCurrentPath('/?omg=OVERRIDE'); + _this19.transitionTo('index'); + _this19.assertCurrentPath('/?omg=OVERRIDE'); }); }; _class.prototype['@test can override incoming QP array values in setupController'] = function testCanOverrideIncomingQPArrayValuesInSetupController(assert) { - var _this19 = this; + var _this20 = this; assert.expect(3); @@ -79323,29 +75940,29 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visitAndAssert('/about').then(function () { - _this19.transitionTo('index'); - _this19.assertCurrentPath('/?omg=' + encodeURIComponent(JSON.stringify(['OVERRIDE']))); + _this20.transitionTo('index'); + _this20.assertCurrentPath('/?omg=' + encodeURIComponent(JSON.stringify(['OVERRIDE']))); }); }; _class.prototype['@test URL transitions that remove QPs still register as QP changes'] = function testURLTransitionsThatRemoveQPsStillRegisterAsQPChanges(assert) { - var _this20 = this; + var _this21 = this; assert.expect(2); this.setSingleQPController('index', 'omg', 'lol'); return this.visit('/?omg=borf').then(function () { - var indexController = _this20.getController('index'); + var indexController = _this21.getController('index'); assert.equal(indexController.get('omg'), 'borf'); - _this20.transitionTo('/'); + _this21.transitionTo('/'); assert.equal(indexController.get('omg'), 'lol'); }); }; _class.prototype['@test Subresource naming style is supported'] = function testSubresourceNamingStyleIsSupported(assert) { - var _this21 = this; + var _this22 = this; assert.expect(5); @@ -79365,35 +75982,35 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em assert.equal(_emberViews.jQuery('#two').attr('href'), '/abcdef/zoo?bar=456&foo=123'); _emberMetal.run(_emberViews.jQuery('#one'), 'click'); - _this21.assertCurrentPath('/abcdef?foo=123'); + _this22.assertCurrentPath('/abcdef?foo=123'); _emberMetal.run(_emberViews.jQuery('#two'), 'click'); - _this21.assertCurrentPath('/abcdef/zoo?bar=456&foo=123'); + _this22.assertCurrentPath('/abcdef/zoo?bar=456&foo=123'); }); }; _class.prototype['@test transitionTo supports query params'] = function testTransitionToSupportsQueryParams(assert) { - var _this22 = this; + var _this23 = this; this.setSingleQPController('index', 'foo', 'lol'); return this.visitAndAssert('/').then(function () { - _this22.transitionTo({ queryParams: { foo: 'borf' } }); - _this22.assertCurrentPath('/?foo=borf', 'shorthand supported'); + _this23.transitionTo({ queryParams: { foo: 'borf' } }); + _this23.assertCurrentPath('/?foo=borf', 'shorthand supported'); - _this22.transitionTo({ queryParams: { 'index:foo': 'blaf' } }); - _this22.assertCurrentPath('/?foo=blaf', 'longform supported'); + _this23.transitionTo({ queryParams: { 'index:foo': 'blaf' } }); + _this23.assertCurrentPath('/?foo=blaf', 'longform supported'); - _this22.transitionTo({ queryParams: { 'index:foo': false } }); - _this22.assertCurrentPath('/?foo=false', 'longform supported (bool)'); + _this23.transitionTo({ queryParams: { 'index:foo': false } }); + _this23.assertCurrentPath('/?foo=false', 'longform supported (bool)'); - _this22.transitionTo({ queryParams: { foo: false } }); - _this22.assertCurrentPath('/?foo=false', 'shorhand supported (bool)'); + _this23.transitionTo({ queryParams: { foo: false } }); + _this23.assertCurrentPath('/?foo=false', 'shorhand supported (bool)'); }); }; _class.prototype['@test transitionTo supports query params (multiple)'] = function testTransitionToSupportsQueryParamsMultiple(assert) { - var _this23 = this; + var _this24 = this; this.registerController('index', _emberRuntime.Controller.extend({ queryParams: ['foo', 'bar'], @@ -79402,37 +76019,37 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visitAndAssert('/').then(function () { - _this23.transitionTo({ queryParams: { foo: 'borf' } }); - _this23.assertCurrentPath('/?foo=borf', 'shorthand supported'); + _this24.transitionTo({ queryParams: { foo: 'borf' } }); + _this24.assertCurrentPath('/?foo=borf', 'shorthand supported'); - _this23.transitionTo({ queryParams: { 'index:foo': 'blaf' } }); - _this23.assertCurrentPath('/?foo=blaf', 'longform supported'); + _this24.transitionTo({ queryParams: { 'index:foo': 'blaf' } }); + _this24.assertCurrentPath('/?foo=blaf', 'longform supported'); - _this23.transitionTo({ queryParams: { 'index:foo': false } }); - _this23.assertCurrentPath('/?foo=false', 'longform supported (bool)'); + _this24.transitionTo({ queryParams: { 'index:foo': false } }); + _this24.assertCurrentPath('/?foo=false', 'longform supported (bool)'); - _this23.transitionTo({ queryParams: { foo: false } }); - _this23.assertCurrentPath('/?foo=false', 'shorhand supported (bool)'); + _this24.transitionTo({ queryParams: { foo: false } }); + _this24.assertCurrentPath('/?foo=false', 'shorhand supported (bool)'); }); }; _class.prototype['@test setting controller QP to empty string doesn\'t generate null in URL'] = function testSettingControllerQPToEmptyStringDoesnTGenerateNullInURL(assert) { - var _this24 = this; + var _this25 = this; assert.expect(1); this.setSingleQPController('index', 'foo', '123'); return this.visit('/').then(function () { - var controller = _this24.getController('index'); + var controller = _this25.getController('index'); - _this24.expectedPushURL = '/?foo='; - _this24.setAndFlush(controller, 'foo', ''); + _this25.expectedPushURL = '/?foo='; + _this25.setAndFlush(controller, 'foo', ''); }); }; _class.prototype['@test setting QP to empty string doesn\'t generate null in URL'] = function testSettingQPToEmptyStringDoesnTGenerateNullInURL(assert) { - var _this25 = this; + var _this26 = this; assert.expect(1); @@ -79445,15 +76062,15 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visit('/').then(function () { - var controller = _this25.getController('index'); + var controller = _this26.getController('index'); - _this25.expectedPushURL = '/?foo='; - _this25.setAndFlush(controller, 'foo', ''); + _this26.expectedPushURL = '/?foo='; + _this26.setAndFlush(controller, 'foo', ''); }); }; _class.prototype['@test A default boolean value deserializes QPs as booleans rather than strings'] = function testADefaultBooleanValueDeserializesQPsAsBooleansRatherThanStrings(assert) { - var _this26 = this; + var _this27 = this; assert.expect(3); @@ -79466,16 +76083,16 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visit('/?foo=true').then(function () { - var controller = _this26.getController('index'); + var controller = _this27.getController('index'); assert.equal(controller.get('foo'), true); - _this26.transitionTo('/?foo=false'); + _this27.transitionTo('/?foo=false'); assert.equal(controller.get('foo'), false); }); }; _class.prototype['@test Query param without value are empty string'] = function testQueryParamWithoutValueAreEmptyString(assert) { - var _this27 = this; + var _this28 = this; assert.expect(1); @@ -79485,13 +76102,13 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visit('/?foo=').then(function () { - var controller = _this27.getController('index'); + var controller = _this28.getController('index'); assert.equal(controller.get('foo'), ''); }); }; _class.prototype['@test Array query params can be set'] = function testArrayQueryParamsCanBeSet(assert) { - var _this28 = this; + var _this29 = this; assert.expect(2); @@ -79502,48 +76119,48 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em this.setSingleQPController('home', 'foo', []); return this.visit('/').then(function () { - var controller = _this28.getController('home'); + var controller = _this29.getController('home'); - _this28.setAndFlush(controller, 'foo', [1, 2]); - _this28.assertCurrentPath('/?foo=%5B1%2C2%5D'); + _this29.setAndFlush(controller, 'foo', [1, 2]); + _this29.assertCurrentPath('/?foo=%5B1%2C2%5D'); - _this28.setAndFlush(controller, 'foo', [3, 4]); - _this28.assertCurrentPath('/?foo=%5B3%2C4%5D'); + _this29.setAndFlush(controller, 'foo', [3, 4]); + _this29.assertCurrentPath('/?foo=%5B3%2C4%5D'); }); }; _class.prototype['@test (de)serialization: arrays'] = function testDeSerializationArrays(assert) { - var _this29 = this; + var _this30 = this; assert.expect(4); this.setSingleQPController('index', 'foo', [1]); return this.visitAndAssert('/').then(function () { - _this29.transitionTo({ queryParams: { foo: [2, 3] } }); - _this29.assertCurrentPath('/?foo=%5B2%2C3%5D', 'shorthand supported'); - _this29.transitionTo({ queryParams: { 'index:foo': [4, 5] } }); - _this29.assertCurrentPath('/?foo=%5B4%2C5%5D', 'longform supported'); - _this29.transitionTo({ queryParams: { foo: [] } }); - _this29.assertCurrentPath('/?foo=%5B%5D', 'longform supported'); + _this30.transitionTo({ queryParams: { foo: [2, 3] } }); + _this30.assertCurrentPath('/?foo=%5B2%2C3%5D', 'shorthand supported'); + _this30.transitionTo({ queryParams: { 'index:foo': [4, 5] } }); + _this30.assertCurrentPath('/?foo=%5B4%2C5%5D', 'longform supported'); + _this30.transitionTo({ queryParams: { foo: [] } }); + _this30.assertCurrentPath('/?foo=%5B%5D', 'longform supported'); }); }; _class.prototype['@test Url with array query param sets controller property to array'] = function testUrlWithArrayQueryParamSetsControllerPropertyToArray(assert) { - var _this30 = this; + var _this31 = this; assert.expect(1); this.setSingleQPController('index', 'foo', ''); return this.visit('/?foo[]=1&foo[]=2&foo[]=3').then(function () { - var controller = _this30.getController('index'); + var controller = _this31.getController('index'); assert.deepEqual(controller.get('foo'), ['1', '2', '3']); }); }; _class.prototype['@test Array query params can be pushed/popped'] = function testArrayQueryParamsCanBePushedPopped(assert) { - var _this31 = this; + var _this32 = this; assert.expect(17); @@ -79554,44 +76171,44 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em this.setSingleQPController('home', 'foo', _emberRuntime.A()); return this.visitAndAssert('/').then(function () { - var controller = _this31.getController('home'); + var controller = _this32.getController('home'); _emberMetal.run(controller.foo, 'pushObject', 1); - _this31.assertCurrentPath('/?foo=%5B1%5D'); + _this32.assertCurrentPath('/?foo=%5B1%5D'); assert.deepEqual(controller.foo, [1]); _emberMetal.run(controller.foo, 'popObject'); - _this31.assertCurrentPath('/'); + _this32.assertCurrentPath('/'); assert.deepEqual(controller.foo, []); _emberMetal.run(controller.foo, 'pushObject', 1); - _this31.assertCurrentPath('/?foo=%5B1%5D'); + _this32.assertCurrentPath('/?foo=%5B1%5D'); assert.deepEqual(controller.foo, [1]); _emberMetal.run(controller.foo, 'popObject'); - _this31.assertCurrentPath('/'); + _this32.assertCurrentPath('/'); assert.deepEqual(controller.foo, []); _emberMetal.run(controller.foo, 'pushObject', 1); - _this31.assertCurrentPath('/?foo=%5B1%5D'); + _this32.assertCurrentPath('/?foo=%5B1%5D'); assert.deepEqual(controller.foo, [1]); _emberMetal.run(controller.foo, 'pushObject', 2); - _this31.assertCurrentPath('/?foo=%5B1%2C2%5D'); + _this32.assertCurrentPath('/?foo=%5B1%2C2%5D'); assert.deepEqual(controller.foo, [1, 2]); _emberMetal.run(controller.foo, 'popObject'); - _this31.assertCurrentPath('/?foo=%5B1%5D'); + _this32.assertCurrentPath('/?foo=%5B1%5D'); assert.deepEqual(controller.foo, [1]); _emberMetal.run(controller.foo, 'unshiftObject', 'lol'); - _this31.assertCurrentPath('/?foo=%5B%22lol%22%2C1%5D'); + _this32.assertCurrentPath('/?foo=%5B%22lol%22%2C1%5D'); assert.deepEqual(controller.foo, ['lol', 1]); }); }; _class.prototype['@test Overwriting with array with same content shouldn\'t refire update'] = function testOverwritingWithArrayWithSameContentShouldnTRefireUpdate(assert) { - var _this32 = this; + var _this33 = this; assert.expect(4); @@ -79611,16 +76228,16 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em return this.visitAndAssert('/').then(function () { assert.equal(modelCount, 1); - var controller = _this32.getController('home'); - _this32.setAndFlush(controller, 'model', _emberRuntime.A([1])); + var controller = _this33.getController('home'); + _this33.setAndFlush(controller, 'model', _emberRuntime.A([1])); assert.equal(modelCount, 1); - _this32.assertCurrentPath('/'); + _this33.assertCurrentPath('/'); }); }; _class.prototype['@test Defaulting to params hash as the model should not result in that params object being watched'] = function testDefaultingToParamsHashAsTheModelShouldNotResultInThatParamsObjectBeingWatched(assert) { - var _this33 = this; + var _this34 = this; assert.expect(1); @@ -79642,7 +76259,7 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visit('/').then(function () { - _this33.transitionTo('other'); + _this34.transitionTo('other'); }); }; @@ -79669,7 +76286,7 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em }; _class.prototype['@test opting into replace does not affect transitions between routes'] = function testOptingIntoReplaceDoesNotAffectTransitionsBetweenRoutes(assert) { - var _this34 = this; + var _this35 = this; assert.expect(5); @@ -79691,27 +76308,27 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visit('/').then(function () { - var controller = _this34.getController('bar'); + var controller = _this35.getController('bar'); - _this34.expectedPushURL = '/foo'; + _this35.expectedPushURL = '/foo'; _emberMetal.run(_emberViews.jQuery('#foo-link'), 'click'); - _this34.expectedPushURL = '/bar'; + _this35.expectedPushURL = '/bar'; _emberMetal.run(_emberViews.jQuery('#bar-no-qp-link'), 'click'); - _this34.expectedReplaceURL = '/bar?raytiley=woot'; - _this34.setAndFlush(controller, 'raytiley', 'woot'); + _this35.expectedReplaceURL = '/bar?raytiley=woot'; + _this35.setAndFlush(controller, 'raytiley', 'woot'); - _this34.expectedPushURL = '/foo'; + _this35.expectedPushURL = '/foo'; _emberMetal.run(_emberViews.jQuery('#foo-link'), 'click'); - _this34.expectedPushURL = '/bar?raytiley=isthebest'; + _this35.expectedPushURL = '/bar?raytiley=isthebest'; _emberMetal.run(_emberViews.jQuery('#bar-link'), 'click'); }); }; _class.prototype['@test undefined isn\'t serialized or deserialized into a string'] = function testUndefinedIsnTSerializedOrDeserializedIntoAString(assert) { - var _this35 = this; + var _this36 = this; assert.expect(4); @@ -79732,10 +76349,10 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visitAndAssert('/').then(function () { - assert.equal(_this35.$('#the-link').attr('href'), '/example', 'renders without undefined qp serialized'); + assert.equal(_this36.$('#the-link').attr('href'), '/example', 'renders without undefined qp serialized'); - return _this35.transitionTo('example', { queryParams: { foo: undefined } }).then(function () { - _this35.assertCurrentPath('/example'); + return _this36.transitionTo('example', { queryParams: { foo: undefined } }).then(function () { + _this36.assertCurrentPath('/example'); }); }); }; @@ -79753,7 +76370,7 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em }; _class.prototype['@test warn user that Route\'s queryParams configuration must be an Object, not an Array'] = function testWarnUserThatRouteSQueryParamsConfigurationMustBeAnObjectNotAnArray(assert) { - var _this36 = this; + var _this37 = this; assert.expect(1); @@ -79762,12 +76379,12 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); expectAssertion(function () { - _this36.visit('/'); + _this37.visit('/'); }, 'You passed in `[{"commitBy":{"replace":true}}]` as the value for `queryParams` but `queryParams` cannot be an Array'); }; _class.prototype['@test handle route names that clash with Object.prototype properties'] = function testHandleRouteNamesThatClashWithObjectPrototypeProperties(assert) { - var _this37 = this; + var _this38 = this; assert.expect(1); @@ -79784,8 +76401,8 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visit('/').then(function () { - _this37.transitionTo('constructor', { queryParams: { foo: '999' } }); - var controller = _this37.getController('constructor'); + _this38.transitionTo('constructor', { queryParams: { foo: '999' } }); + var controller = _this38.getController('constructor'); assert.equal(_emberMetal.get(controller, 'foo'), '999'); }); }; @@ -79793,21 +76410,13 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em return _class; })(_internalTestHelpers.QueryParamTestCase)); }); -enifed('ember/tests/routing/query_params_test.jscs-test', ['exports'], function (exports) { +enifed('ember/tests/routing/query_params_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember/tests/routing'); - test('ember/tests/routing/query_params_test.js should pass jscs', function () { - ok(true, 'ember/tests/routing/query_params_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/routing/query_params_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember/tests/routing'); - QUnit.test('ember/tests/routing/query_params_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/routing/query_params_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/routing/query_params_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/routing/query_params_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test', ['exports', 'ember-runtime', 'ember-routing', 'ember-metal', 'ember-views', 'internal-test-helpers'], function (exports, _emberRuntime, _emberRouting, _emberMetal, _emberViews, _internalTestHelpers) { @@ -80711,24 +77320,16 @@ enifed('ember/tests/routing/query_params_test/model_dependent_state_with_query_p return _class3; })(ModelDependentQPTestCase)); }); -enifed('ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests/routing/query_params_test'); - test('ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js should pass jscs', function () { - ok(true, 'ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests/routing/query_params_test'); - QUnit.test('ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js should pass ESLint\n\n'); }); }); -enifed('ember/tests/routing/query_params_test/overlapping_query_params_test', ['exports', 'ember-runtime', 'ember-metal', 'internal-test-helpers'], function (exports, _emberRuntime, _emberMetal, _internalTestHelpers) { +enifed('ember/tests/routing/query_params_test/overlapping_query_params_test', ['exports', 'ember-runtime', 'ember-routing', 'ember-metal', 'internal-test-helpers'], function (exports, _emberRuntime, _emberRouting, _emberMetal, _internalTestHelpers) { 'use strict'; _internalTestHelpers.moduleFor('Query Params - overlapping query param property names', (function (_QueryParamTestCase) { @@ -80851,21 +77452,38 @@ enifed('ember/tests/routing/query_params_test/overlapping_query_params_test', [' }); }; - _class.prototype['@test query params in the same route hierarchy with the same url key get auto-scoped'] = function testQueryParamsInTheSameRouteHierarchyWithTheSameUrlKeyGetAutoScoped(assert) { + _class.prototype['@test query params does not error when a query parameter exists for route instances that share a controller'] = function testQueryParamsDoesNotErrorWhenAQueryParameterExistsForRouteInstancesThatShareAController(assert) { var _this5 = this; assert.expect(1); + var parentController = _emberRuntime.Controller.extend({ + queryParams: { page: 'page' } + }); + this.registerController('parent', parentController); + this.registerRoute('parent.child', _emberRouting.Route.extend({ controllerName: 'parent' })); + + return this.setupBase('/parent').then(function () { + _this5.transitionTo('parent.child', { queryParams: { page: 2 } }); + _this5.assertCurrentPath('/parent/child?page=2'); + }); + }; + + _class.prototype['@test query params in the same route hierarchy with the same url key get auto-scoped'] = function testQueryParamsInTheSameRouteHierarchyWithTheSameUrlKeyGetAutoScoped(assert) { + var _this6 = this; + + assert.expect(1); + this.setMappedQPController('parent'); this.setMappedQPController('parent.child'); expectAssertion(function () { - _this5.setupBase(); + _this6.setupBase(); }, 'You\'re not allowed to have more than one controller property map to the same query param key, but both `parent:page` and `parent.child:page` map to `parentPage`. You can fix this by mapping one of the controller properties to a different query param key via the `as` config option, e.g. `page: { as: \'other-page\' }`'); }; _class.prototype['@test Support shared but overridable mixin pattern'] = function testSupportSharedButOverridableMixinPattern(assert) { - var _this6 = this; + var _this7 = this; assert.expect(7); @@ -80881,18 +77499,18 @@ enifed('ember/tests/routing/query_params_test/overlapping_query_params_test', [' this.registerController('parent.child', _emberRuntime.Controller.extend(HasPage)); return this.setupBase().then(function () { - _this6.assertCurrentPath('/parent/child'); + _this7.assertCurrentPath('/parent/child'); - var parentController = _this6.getController('parent'); - var parentChildController = _this6.getController('parent.child'); + var parentController = _this7.getController('parent'); + var parentChildController = _this7.getController('parent.child'); - _this6.setAndFlush(parentChildController, 'page', 2); - _this6.assertCurrentPath('/parent/child?page=2'); + _this7.setAndFlush(parentChildController, 'page', 2); + _this7.assertCurrentPath('/parent/child?page=2'); assert.equal(parentController.get('page'), 1); assert.equal(parentChildController.get('page'), 2); - _this6.setAndFlush(parentController, 'page', 2); - _this6.assertCurrentPath('/parent/child?page=2&yespage=2'); + _this7.setAndFlush(parentController, 'page', 2); + _this7.assertCurrentPath('/parent/child?page=2&yespage=2'); assert.equal(parentController.get('page'), 2); assert.equal(parentChildController.get('page'), 2); }); @@ -80901,21 +77519,13 @@ enifed('ember/tests/routing/query_params_test/overlapping_query_params_test', [' return _class; })(_internalTestHelpers.QueryParamTestCase)); }); -enifed('ember/tests/routing/query_params_test/overlapping_query_params_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests/routing/query_params_test'); - test('ember/tests/routing/query_params_test/overlapping_query_params_test.js should pass jscs', function () { - ok(true, 'ember/tests/routing/query_params_test/overlapping_query_params_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/routing/query_params_test/overlapping_query_params_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/routing/query_params_test/overlapping_query_params_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests/routing/query_params_test'); - QUnit.test('ember/tests/routing/query_params_test/overlapping_query_params_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/routing/query_params_test/overlapping_query_params_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/routing/query_params_test/overlapping_query_params_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/routing/query_params_test/overlapping_query_params_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/routing/query_params_test/query_param_async_get_handler_test', ['exports', 'ember-runtime', 'ember-routing', 'internal-test-helpers'], function (exports, _emberRuntime, _emberRouting, _internalTestHelpers) { @@ -81147,21 +77757,13 @@ enifed('ember/tests/routing/query_params_test/query_param_async_get_handler_test return _class; })(_internalTestHelpers.QueryParamTestCase)); }); -enifed('ember/tests/routing/query_params_test/query_param_async_get_handler_test.jscs-test', ['exports'], function (exports) { +enifed('ember/tests/routing/query_params_test/query_param_async_get_handler_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember/tests/routing/query_params_test'); - test('ember/tests/routing/query_params_test/query_param_async_get_handler_test.js should pass jscs', function () { - ok(true, 'ember/tests/routing/query_params_test/query_param_async_get_handler_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/routing/query_params_test/query_param_async_get_handler_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember/tests/routing/query_params_test'); - QUnit.test('ember/tests/routing/query_params_test/query_param_async_get_handler_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/routing/query_params_test/query_param_async_get_handler_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/routing/query_params_test/query_param_async_get_handler_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/routing/query_params_test/query_param_async_get_handler_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/routing/query_params_test/query_params_paramless_link_to_test', ['exports', 'ember-runtime', 'ember-views', 'internal-test-helpers'], function (exports, _emberRuntime, _emberViews, _internalTestHelpers) { @@ -81202,21 +77804,13 @@ enifed('ember/tests/routing/query_params_test/query_params_paramless_link_to_tes return _class; })(_internalTestHelpers.QueryParamTestCase)); }); -enifed('ember/tests/routing/query_params_test/query_params_paramless_link_to_test.jscs-test', ['exports'], function (exports) { +enifed('ember/tests/routing/query_params_test/query_params_paramless_link_to_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember/tests/routing/query_params_test'); - test('ember/tests/routing/query_params_test/query_params_paramless_link_to_test.js should pass jscs', function () { - ok(true, 'ember/tests/routing/query_params_test/query_params_paramless_link_to_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/routing/query_params_test/query_params_paramless_link_to_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember/tests/routing/query_params_test'); - QUnit.test('ember/tests/routing/query_params_test/query_params_paramless_link_to_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/routing/query_params_test/query_params_paramless_link_to_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/routing/query_params_test/query_params_paramless_link_to_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/routing/query_params_test/query_params_paramless_link_to_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/routing/query_params_test/shared_state_test', ['exports', 'ember-runtime', 'ember', 'ember-metal', 'ember-views', 'internal-test-helpers'], function (exports, _emberRuntime, _ember, _emberMetal, _emberViews, _internalTestHelpers) { @@ -81302,21 +77896,13 @@ enifed('ember/tests/routing/query_params_test/shared_state_test', ['exports', 'e return _class; })(_internalTestHelpers.QueryParamTestCase)); }); -enifed('ember/tests/routing/query_params_test/shared_state_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests/routing/query_params_test'); - test('ember/tests/routing/query_params_test/shared_state_test.js should pass jscs', function () { - ok(true, 'ember/tests/routing/query_params_test/shared_state_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/routing/query_params_test/shared_state_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/routing/query_params_test/shared_state_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests/routing/query_params_test'); - QUnit.test('ember/tests/routing/query_params_test/shared_state_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/routing/query_params_test/shared_state_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/routing/query_params_test/shared_state_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/routing/query_params_test/shared_state_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/routing/router_map_test', ['exports', 'ember-metal', 'ember-template-compiler', 'ember-application', 'ember-routing', 'ember-views', 'ember-glimmer'], function (exports, _emberMetal, _emberTemplateCompiler, _emberApplication, _emberRouting, _emberViews, _emberGlimmer) { @@ -81406,21 +77992,594 @@ enifed('ember/tests/routing/router_map_test', ['exports', 'ember-metal', 'ember- equal(_emberViews.jQuery('#qunit-fixture').text(), 'Goodbye!', 'The goodbye template was rendered'); }); }); -enifed('ember/tests/routing/router_map_test.jscs-test', ['exports'], function (exports) { +enifed('ember/tests/routing/router_map_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember/tests/routing'); - test('ember/tests/routing/router_map_test.js should pass jscs', function () { - ok(true, 'ember/tests/routing/router_map_test.js should pass jscs.'); + QUnit.module('ESLint | ember/tests/routing/router_map_test.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/router_map_test.js should pass ESLint\n\n'); }); }); -enifed('ember/tests/routing/router_map_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/routing/router_service_test/basic_test', ['exports', 'ember-runtime', 'ember-glimmer', 'ember-routing', 'ember-metal', 'internal-test-helpers'], function (exports, _emberRuntime, _emberGlimmer, _emberRouting, _emberMetal, _internalTestHelpers) { 'use strict'; - QUnit.module('JSHint - ember/tests/routing'); - QUnit.test('ember/tests/routing/router_map_test.js should pass jshint', function (assert) { + if (_emberMetal.isFeatureEnabled('ember-routing-router-service')) { + _internalTestHelpers.moduleFor('Router Service - main', (function (_RouterTestCase) { + babelHelpers.inherits(_class, _RouterTestCase); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RouterTestCase.apply(this, arguments); + } + + _class.prototype['@test RouterService#currentRouteName is correctly set for top level route'] = function testRouterServiceCurrentRouteNameIsCorrectlySetForTopLevelRoute(assert) { + var _this = this; + + assert.expect(1); + + return this.visit('/').then(function () { + assert.equal(_this.routerService.get('currentRouteName'), 'parent.index'); + }); + }; + + _class.prototype['@test RouterService#currentRouteName is correctly set for child route'] = function testRouterServiceCurrentRouteNameIsCorrectlySetForChildRoute(assert) { + var _this2 = this; + + assert.expect(1); + + return this.visit('/child').then(function () { + assert.equal(_this2.routerService.get('currentRouteName'), 'parent.child'); + }); + }; + + _class.prototype['@test RouterService#currentRouteName is correctly set after transition'] = function testRouterServiceCurrentRouteNameIsCorrectlySetAfterTransition(assert) { + var _this3 = this; + + assert.expect(1); + + return this.visit('/child').then(function () { + return _this3.routerService.transitionTo('parent.sister'); + }).then(function () { + assert.equal(_this3.routerService.get('currentRouteName'), 'parent.sister'); + }); + }; + + _class.prototype['@test RouterService#currentRouteName is correctly set on each transition'] = function testRouterServiceCurrentRouteNameIsCorrectlySetOnEachTransition(assert) { + var _this4 = this; + + assert.expect(3); + + return this.visit('/child').then(function () { + assert.equal(_this4.routerService.get('currentRouteName'), 'parent.child'); + + return _this4.visit('/sister'); + }).then(function () { + assert.equal(_this4.routerService.get('currentRouteName'), 'parent.sister'); + + return _this4.visit('/brother'); + }).then(function () { + assert.equal(_this4.routerService.get('currentRouteName'), 'parent.brother'); + }); + }; + + _class.prototype['@test RouterService#rootURL is correctly set to the default value'] = function testRouterServiceRootURLIsCorrectlySetToTheDefaultValue(assert) { + var _this5 = this; + + assert.expect(1); + + return this.visit('/').then(function () { + assert.equal(_this5.routerService.get('rootURL'), '/'); + }); + }; + + _class.prototype['@test RouterService#rootURL is correctly set to a custom value'] = function testRouterServiceRootURLIsCorrectlySetToACustomValue(assert) { + var _this6 = this; + + assert.expect(1); + + this.registerRoute('parent.index', _emberRouting.Route.extend({ + init: function () { + this._super(); + _emberMetal.set(this.router, 'rootURL', '/homepage'); + } + })); + + return this.visit('/').then(function () { + assert.equal(_this6.routerService.get('rootURL'), '/homepage'); + }); + }; + + _class.prototype['@test RouterService#location is correctly delegated from router:main'] = function testRouterServiceLocationIsCorrectlyDelegatedFromRouterMain(assert) { + var _this7 = this; + + assert.expect(2); + + return this.visit('/').then(function () { + var location = _this7.routerService.get('location'); + assert.ok(location); + assert.ok(location instanceof _emberRouting.NoneLocation); + }); + }; + + return _class; + })(_internalTestHelpers.RouterTestCase)); + } +}); +enifed('ember/tests/routing/router_service_test/basic_test.lint-test', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('ESLint | ember/tests/routing/router_service_test/basic_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/routing/router_map_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/routing/router_service_test/basic_test.js should pass ESLint\n\n'); + }); +}); +enifed('ember/tests/routing/router_service_test/currenturl_lifecycle_test', ['exports', 'ember-runtime', 'ember-glimmer', 'ember-routing', 'ember-metal', 'internal-test-helpers'], function (exports, _emberRuntime, _emberGlimmer, _emberRouting, _emberMetal, _internalTestHelpers) { + 'use strict'; + + if (_emberMetal.isFeatureEnabled('ember-routing-router-service')) { + (function () { + var results = []; + var ROUTE_NAMES = ['index', 'child', 'sister', 'brother']; + + var InstrumentedRoute = _emberRouting.Route.extend({ + routerService: _emberRuntime.inject.service('router'), + + beforeModel: function () { + var service = _emberMetal.get(this, 'routerService'); + results.push([service.get('currentRouteName'), 'beforeModel', service.get('currentURL')]); + }, + + model: function () { + var service = _emberMetal.get(this, 'routerService'); + results.push([service.get('currentRouteName'), 'model', service.get('currentURL')]); + }, + + afterModel: function () { + var service = _emberMetal.get(this, 'routerService'); + results.push([service.get('currentRouteName'), 'afterModel', service.get('currentURL')]); + } + }); + + _internalTestHelpers.moduleFor('Router Service - currentURL', (function (_RouterTestCase) { + babelHelpers.inherits(_class, _RouterTestCase); + + function _class() { + var _this = this; + + babelHelpers.classCallCheck(this, _class); + + _RouterTestCase.call(this); + + results = []; + + ROUTE_NAMES.forEach(function (name) { + var routeName = 'parent.' + name; + _this.registerRoute(routeName, InstrumentedRoute.extend()); + _this.registerTemplate(routeName, '{{current-url}}'); + }); + + this.registerComponent('current-url', { + ComponentClass: _emberGlimmer.Component.extend({ + routerService: _emberRuntime.inject.service('router'), + currentURL: _emberRuntime.readOnly('routerService.currentURL') + }), + template: '{{currentURL}}' + }); + } + + _class.prototype['@test RouterService#currentURL is correctly set for top level route'] = function testRouterServiceCurrentURLIsCorrectlySetForTopLevelRoute(assert) { + var _this2 = this; + + assert.expect(1); + + return this.visit('/').then(function () { + assert.equal(_this2.routerService.get('currentURL'), '/'); + }); + }; + + _class.prototype['@test RouterService#currentURL is correctly set for child route'] = function testRouterServiceCurrentURLIsCorrectlySetForChildRoute(assert) { + var _this3 = this; + + assert.expect(1); + + return this.visit('/child').then(function () { + assert.equal(_this3.routerService.get('currentURL'), '/child'); + }); + }; + + _class.prototype['@test RouterService#currentURL is correctly set after transition'] = function testRouterServiceCurrentURLIsCorrectlySetAfterTransition(assert) { + var _this4 = this; + + assert.expect(1); + + return this.visit('/child').then(function () { + return _this4.routerService.transitionTo('parent.sister'); + }).then(function () { + assert.equal(_this4.routerService.get('currentURL'), '/sister'); + }); + }; + + _class.prototype['@test RouterService#currentURL is correctly set on each transition'] = function testRouterServiceCurrentURLIsCorrectlySetOnEachTransition(assert) { + var _this5 = this; + + assert.expect(3); + + return this.visit('/child').then(function () { + assert.equal(_this5.routerService.get('currentURL'), '/child'); + + return _this5.visit('/sister'); + }).then(function () { + assert.equal(_this5.routerService.get('currentURL'), '/sister'); + + return _this5.visit('/brother'); + }).then(function () { + assert.equal(_this5.routerService.get('currentURL'), '/brother'); + }); + }; + + _class.prototype['@test RouterService#currentURL is not set during lifecycle hooks'] = function testRouterServiceCurrentURLIsNotSetDuringLifecycleHooks(assert) { + var _this6 = this; + + assert.expect(2); + + return this.visit('/').then(function () { + assert.deepEqual(results, [[null, 'beforeModel', null], [null, 'model', null], [null, 'afterModel', null]]); + + results = []; + + return _this6.visit('/child'); + }).then(function () { + assert.deepEqual(results, [['parent.index', 'beforeModel', '/'], ['parent.index', 'model', '/'], ['parent.index', 'afterModel', '/']]); + }); + }; + + _class.prototype['@test RouterService#currentURL is correctly set with component after consecutive visits'] = function testRouterServiceCurrentURLIsCorrectlySetWithComponentAfterConsecutiveVisits(assert) { + var _this7 = this; + + assert.expect(3); + + return this.visit('/').then(function () { + _this7.assertText('/'); + + return _this7.visit('/child'); + }).then(function () { + _this7.assertText('/child'); + + return _this7.visit('/'); + }).then(function () { + _this7.assertText('/'); + }); + }; + + return _class; + })(_internalTestHelpers.RouterTestCase)); + })(); + } +}); +enifed('ember/tests/routing/router_service_test/currenturl_lifecycle_test.lint-test', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('ESLint | ember/tests/routing/router_service_test/currenturl_lifecycle_test.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/router_service_test/currenturl_lifecycle_test.js should pass ESLint\n\n'); + }); +}); +enifed('ember/tests/routing/router_service_test/replaceWith_test', ['exports', 'ember-routing', 'internal-test-helpers', 'router', 'ember-metal'], function (exports, _emberRouting, _internalTestHelpers, _router, _emberMetal) { + 'use strict'; + + if (_emberMetal.isFeatureEnabled('ember-routing-router-service')) { + _internalTestHelpers.moduleFor('Router Service - replaceWith', (function (_RouterTestCase) { + babelHelpers.inherits(_class, _RouterTestCase); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RouterTestCase.call(this); + + var testCase = this; + testCase.state = []; + + this.application.register('location:test', _emberRouting.NoneLocation.extend({ + setURL: function (path) { + testCase.state.push(path); + this.set('path', path); + }, + + replaceURL: function (path) { + testCase.state.splice(testCase.state.length - 1, 1, path); + this.set('path', path); + } + })); + } + + _class.prototype['@test RouterService#replaceWith returns a Transition'] = function testRouterServiceReplaceWithReturnsATransition(assert) { + var _this = this; + + assert.expect(1); + + var transition = undefined; + + return this.visit('/').then(function () { + transition = _this.routerService.replaceWith('parent.child'); + + assert.ok(transition instanceof _router.Transition); + + return transition; + }); + }; + + _class.prototype['@test RouterService#replaceWith with basic route replaces location'] = function testRouterServiceReplaceWithWithBasicRouteReplacesLocation(assert) { + var _this2 = this; + + assert.expect(1); + + return this.visit('/').then(function () { + return _this2.routerService.transitionTo('parent.child'); + }).then(function () { + return _this2.routerService.transitionTo('parent.sister'); + }).then(function () { + return _this2.routerService.replaceWith('parent.brother'); + }).then(function () { + assert.deepEqual(_this2.state, ['/', '/child', '/brother']); + }); + }; + + _class.prototype['@test RouterService#replaceWith transitioning back to previously visited route replaces location'] = function testRouterServiceReplaceWithTransitioningBackToPreviouslyVisitedRouteReplacesLocation(assert) { + var _this3 = this; + + assert.expect(1); + + return this.visit('/').then(function () { + return _this3.routerService.transitionTo('parent.child'); + }).then(function () { + return _this3.routerService.transitionTo('parent.sister'); + }).then(function () { + return _this3.routerService.transitionTo('parent.brother'); + }).then(function () { + return _this3.routerService.replaceWith('parent.sister'); + }).then(function () { + assert.deepEqual(_this3.state, ['/', '/child', '/sister', '/sister']); + }); + }; + + babelHelpers.createClass(_class, [{ + key: 'routerOptions', + get: function () { + return { + location: 'test' + }; + } + }]); + return _class; + })(_internalTestHelpers.RouterTestCase)); + } +}); +enifed('ember/tests/routing/router_service_test/replaceWith_test.lint-test', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('ESLint | ember/tests/routing/router_service_test/replaceWith_test.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/router_service_test/replaceWith_test.js should pass ESLint\n\n'); + }); +}); +enifed('ember/tests/routing/router_service_test/transitionTo_test', ['exports', 'ember-runtime', 'ember-glimmer', 'ember-routing', 'ember-metal', 'internal-test-helpers', 'router'], function (exports, _emberRuntime, _emberGlimmer, _emberRouting, _emberMetal, _internalTestHelpers, _router) { + 'use strict'; + + if (_emberMetal.isFeatureEnabled('ember-routing-router-service')) { + _internalTestHelpers.moduleFor('Router Service - transitionTo', (function (_RouterTestCase) { + babelHelpers.inherits(_class, _RouterTestCase); + + function _class() { + babelHelpers.classCallCheck(this, _class); + + _RouterTestCase.call(this); + + var testCase = this; + testCase.state = []; + + this.application.register('location:test', _emberRouting.NoneLocation.extend({ + setURL: function (path) { + testCase.state.push(path); + this.set('path', path); + }, + + replaceURL: function (path) { + testCase.state.splice(testCase.state.length - 1, 1, path); + this.set('path', path); + } + })); + } + + _class.prototype['@test RouterService#transitionTo returns a Transition'] = function testRouterServiceTransitionToReturnsATransition(assert) { + var _this = this; + + assert.expect(1); + + var transition = undefined; + + return this.visit('/').then(function () { + transition = _this.routerService.transitionTo('parent.child'); + + assert.ok(transition instanceof _router.Transition); + + return transition; + }); + }; + + _class.prototype['@test RouterService#transitionTo with basic route updates location'] = function testRouterServiceTransitionToWithBasicRouteUpdatesLocation(assert) { + var _this2 = this; + + assert.expect(1); + + return this.visit('/').then(function () { + return _this2.routerService.transitionTo('parent.child'); + }).then(function () { + return _this2.routerService.transitionTo('parent.sister'); + }).then(function () { + return _this2.routerService.transitionTo('parent.brother'); + }).then(function () { + assert.deepEqual(_this2.state, ['/', '/child', '/sister', '/brother']); + }); + }; + + _class.prototype['@test RouterService#transitionTo transitioning back to previously visited route updates location'] = function testRouterServiceTransitionToTransitioningBackToPreviouslyVisitedRouteUpdatesLocation(assert) { + var _this3 = this; + + assert.expect(1); + + return this.visit('/').then(function () { + return _this3.routerService.transitionTo('parent.child'); + }).then(function () { + return _this3.routerService.transitionTo('parent.sister'); + }).then(function () { + return _this3.routerService.transitionTo('parent.brother'); + }).then(function () { + return _this3.routerService.transitionTo('parent.sister'); + }).then(function () { + assert.deepEqual(_this3.state, ['/', '/child', '/sister', '/brother', '/sister']); + }); + }; + + _class.prototype['@test RouterService#transitionTo with basic route'] = function testRouterServiceTransitionToWithBasicRoute(assert) { + var _this4 = this; + + assert.expect(1); + + var componentInstance = undefined; + + this.registerTemplate('parent.index', '{{foo-bar}}'); + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmer.Component.extend({ + routerService: _emberRuntime.inject.service('router'), + init: function () { + this._super(); + componentInstance = this; + }, + actions: { + transitionToSister: function () { + _emberMetal.get(this, 'routerService').transitionTo('parent.sister'); + } + } + }), + template: 'foo-bar' + }); + + return this.visit('/').then(function () { + _emberMetal.run(function () { + componentInstance.send('transitionToSister'); + }); + + assert.equal(_this4.routerService.get('currentRouteName'), 'parent.sister'); + }); + }; + + _class.prototype['@test RouterService#transitionTo with dynamic segment'] = function testRouterServiceTransitionToWithDynamicSegment(assert) { + var _this5 = this; + + assert.expect(3); + + var componentInstance = undefined; + var dynamicModel = { id: 1, contents: 'much dynamicism' }; + + this.registerTemplate('parent.index', '{{foo-bar}}'); + this.registerTemplate('dynamic', '{{model.contents}}'); + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmer.Component.extend({ + routerService: _emberRuntime.inject.service('router'), + init: function () { + this._super(); + componentInstance = this; + }, + actions: { + transitionToDynamic: function () { + _emberMetal.get(this, 'routerService').transitionTo('dynamic', dynamicModel); + } + } + }), + template: 'foo-bar' + }); + + return this.visit('/').then(function () { + _emberMetal.run(function () { + componentInstance.send('transitionToDynamic'); + }); + + assert.equal(_this5.routerService.get('currentRouteName'), 'dynamic'); + assert.equal(_this5.routerService.get('currentURL'), '/dynamic/1'); + _this5.assertText('much dynamicism'); + }); + }; + + _class.prototype['@test RouterService#transitionTo with dynamic segment and model hook'] = function testRouterServiceTransitionToWithDynamicSegmentAndModelHook(assert) { + var _this6 = this; + + assert.expect(3); + + var componentInstance = undefined; + var dynamicModel = { id: 1, contents: 'much dynamicism' }; + + this.registerRoute('dynamic', _emberRouting.Route.extend({ + model: function () { + return dynamicModel; + } + })); + + this.registerTemplate('parent.index', '{{foo-bar}}'); + this.registerTemplate('dynamic', '{{model.contents}}'); + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmer.Component.extend({ + routerService: _emberRuntime.inject.service('router'), + init: function () { + this._super(); + componentInstance = this; + }, + actions: { + transitionToDynamic: function () { + _emberMetal.get(this, 'routerService').transitionTo('dynamic', 1); + } + } + }), + template: 'foo-bar' + }); + + return this.visit('/').then(function () { + _emberMetal.run(function () { + componentInstance.send('transitionToDynamic'); + }); + + assert.equal(_this6.routerService.get('currentRouteName'), 'dynamic'); + assert.equal(_this6.routerService.get('currentURL'), '/dynamic/1'); + _this6.assertText('much dynamicism'); + }); + }; + + babelHelpers.createClass(_class, [{ + key: 'routerOptions', + get: function () { + return { + location: 'test' + }; + } + }]); + return _class; + })(_internalTestHelpers.RouterTestCase)); + } +}); +enifed('ember/tests/routing/router_service_test/transitionTo_test.lint-test', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('ESLint | ember/tests/routing/router_service_test/transitionTo_test.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/router_service_test/transitionTo_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/routing/substates_test', ['exports', 'ember-runtime', 'ember-routing', 'ember-metal', 'ember-template-compiler', 'ember-application', 'ember-views', 'ember-glimmer'], function (exports, _emberRuntime, _emberRouting, _emberMetal, _emberTemplateCompiler, _emberApplication, _emberViews, _emberGlimmer) { @@ -81431,7 +78590,6 @@ enifed('ember/tests/routing/substates_test', ['exports', 'ember-runtime', 'ember templates = undefined, router = undefined, container = undefined, - registry = undefined, counter = undefined; function step(expectedValue, description) { @@ -81476,7 +78634,6 @@ enifed('ember/tests/routing/substates_test', ['exports', 'ember-runtime', 'ember Router = App.Router; container = App.__container__; - registry = App.__registry__; templates = { application: '
    {{outlet}}
    ', @@ -82021,8 +79178,6 @@ enifed('ember/tests/routing/substates_test', ['exports', 'ember-runtime', 'ember QUnit.test('errors that are bubbled are thrown at a higher level if not handled', function () { expect(3); - var handledError = undefined; - templates['grandma'] = 'GRANDMA {{outlet}}'; Router.map(function () { @@ -82047,9 +79202,6 @@ enifed('ember/tests/routing/substates_test', ['exports', 'ember-runtime', 'ember actions: { error: function (err) { step(2, 'MomSallyRoute#error'); - - handledError = err; - return true; } } @@ -82484,21 +79636,13 @@ enifed('ember/tests/routing/substates_test', ['exports', 'ember-runtime', 'ember equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'INDEX'); }); }); -enifed('ember/tests/routing/substates_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests/routing'); - test('ember/tests/routing/substates_test.js should pass jscs', function () { - ok(true, 'ember/tests/routing/substates_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/routing/substates_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/routing/substates_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests/routing'); - QUnit.test('ember/tests/routing/substates_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/routing/substates_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/routing/substates_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/routing/substates_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/routing/toplevel_dom_test', ['exports', 'ember-metal', 'ember-template-compiler', 'ember-application', 'ember-views', 'ember-routing', 'ember-glimmer'], function (exports, _emberMetal, _emberTemplateCompiler, _emberApplication, _emberViews, _emberRouting, _emberGlimmer) { @@ -82506,14 +79650,13 @@ enifed('ember/tests/routing/toplevel_dom_test', ['exports', 'ember-metal', 'embe var App = undefined, templates = undefined, - router = undefined, container = undefined; function bootApplication() { for (var _name in templates) { _emberGlimmer.setTemplate(_name, _emberTemplateCompiler.compile(templates[_name])); } - router = container.lookup('router:main'); + container.lookup('router:main'); _emberMetal.run(App, 'advanceReadiness'); } @@ -82557,21 +79700,13 @@ enifed('ember/tests/routing/toplevel_dom_test', ['exports', 'ember-metal', 'embe equal(_emberViews.jQuery('#qunit-fixture > .ember-view').text(), 'hello world'); }); }); -enifed('ember/tests/routing/toplevel_dom_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests/routing'); - test('ember/tests/routing/toplevel_dom_test.js should pass jscs', function () { - ok(true, 'ember/tests/routing/toplevel_dom_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/routing/toplevel_dom_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/routing/toplevel_dom_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests/routing'); - QUnit.test('ember/tests/routing/toplevel_dom_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/routing/toplevel_dom_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/routing/toplevel_dom_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/routing/toplevel_dom_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/view_instrumentation_test', ['exports', 'ember-metal', 'ember-views', 'ember-application', 'ember-template-compiler', 'ember-glimmer'], function (exports, _emberMetal, _emberViews, _emberApplication, _emberTemplateCompiler, _emberGlimmer) { @@ -82638,327 +79773,184 @@ enifed('ember/tests/view_instrumentation_test', ['exports', 'ember-metal', 'embe assert.ok(called, 'instrumentation called on transition to non-view backed route'); }); }); -enifed('ember/tests/view_instrumentation_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests'); - test('ember/tests/view_instrumentation_test.js should pass jscs', function () { - ok(true, 'ember/tests/view_instrumentation_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/view_instrumentation_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/view_instrumentation_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests'); - QUnit.test('ember/tests/view_instrumentation_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/view_instrumentation_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/view_instrumentation_test.js should pass jshint.'); - }); -}); -enifed('internal-test-helpers/apply-mixins.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - internal-test-helpers'); - test('internal-test-helpers/apply-mixins.js should pass jscs', function () { - ok(true, 'internal-test-helpers/apply-mixins.js should pass jscs.'); + assert.ok(true, 'ember/tests/view_instrumentation_test.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/apply-mixins.jshint', ['exports'], function (exports) { +enifed('internal-test-helpers/apply-mixins.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - internal-test-helpers'); - QUnit.test('internal-test-helpers/apply-mixins.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/apply-mixins.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/apply-mixins.js should pass jshint.'); + assert.ok(true, 'internal-test-helpers/apply-mixins.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/build-owner.jscs-test', ['exports'], function (exports) { +enifed('internal-test-helpers/build-owner.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - internal-test-helpers'); - test('internal-test-helpers/build-owner.js should pass jscs', function () { - ok(true, 'internal-test-helpers/build-owner.js should pass jscs.'); - }); -}); -enifed('internal-test-helpers/build-owner.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - internal-test-helpers'); - QUnit.test('internal-test-helpers/build-owner.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/build-owner.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/build-owner.js should pass jshint.'); - }); -}); -enifed('internal-test-helpers/confirm-export.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - internal-test-helpers'); - test('internal-test-helpers/confirm-export.js should pass jscs', function () { - ok(true, 'internal-test-helpers/confirm-export.js should pass jscs.'); + assert.ok(true, 'internal-test-helpers/build-owner.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/confirm-export.jshint', ['exports'], function (exports) { +enifed('internal-test-helpers/confirm-export.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - internal-test-helpers'); - QUnit.test('internal-test-helpers/confirm-export.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/confirm-export.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/confirm-export.js should pass jshint.'); - }); -}); -enifed('internal-test-helpers/equal-inner-html.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - internal-test-helpers'); - test('internal-test-helpers/equal-inner-html.js should pass jscs', function () { - ok(true, 'internal-test-helpers/equal-inner-html.js should pass jscs.'); + assert.ok(true, 'internal-test-helpers/confirm-export.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/equal-inner-html.jshint', ['exports'], function (exports) { +enifed('internal-test-helpers/equal-inner-html.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - internal-test-helpers'); - QUnit.test('internal-test-helpers/equal-inner-html.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/equal-inner-html.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/equal-inner-html.js should pass jshint.'); - }); -}); -enifed('internal-test-helpers/equal-tokens.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - internal-test-helpers'); - test('internal-test-helpers/equal-tokens.js should pass jscs', function () { - ok(true, 'internal-test-helpers/equal-tokens.js should pass jscs.'); + assert.ok(true, 'internal-test-helpers/equal-inner-html.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/equal-tokens.jshint', ['exports'], function (exports) { +enifed('internal-test-helpers/equal-tokens.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - internal-test-helpers'); - QUnit.test('internal-test-helpers/equal-tokens.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/equal-tokens.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/equal-tokens.js should pass jshint.'); - }); -}); -enifed('internal-test-helpers/factory.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - internal-test-helpers'); - test('internal-test-helpers/factory.js should pass jscs', function () { - ok(true, 'internal-test-helpers/factory.js should pass jscs.'); + assert.ok(true, 'internal-test-helpers/equal-tokens.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/factory.jshint', ['exports'], function (exports) { +enifed('internal-test-helpers/factory.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - internal-test-helpers'); - QUnit.test('internal-test-helpers/factory.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/factory.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/factory.js should pass jshint.'); + assert.ok(true, 'internal-test-helpers/factory.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/index.jscs-test', ['exports'], function (exports) { +enifed('internal-test-helpers/index.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - internal-test-helpers'); - test('internal-test-helpers/index.js should pass jscs', function () { - ok(true, 'internal-test-helpers/index.js should pass jscs.'); - }); -}); -enifed('internal-test-helpers/index.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - internal-test-helpers'); - QUnit.test('internal-test-helpers/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/index.js should pass jshint.'); - }); -}); -enifed('internal-test-helpers/matchers.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - internal-test-helpers'); - test('internal-test-helpers/matchers.js should pass jscs', function () { - ok(true, 'internal-test-helpers/matchers.js should pass jscs.'); + assert.ok(true, 'internal-test-helpers/index.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/matchers.jshint', ['exports'], function (exports) { +enifed('internal-test-helpers/matchers.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - internal-test-helpers'); - QUnit.test('internal-test-helpers/matchers.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/matchers.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/matchers.js should pass jshint.'); + assert.ok(true, 'internal-test-helpers/matchers.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/module-for.jscs-test', ['exports'], function (exports) { +enifed('internal-test-helpers/module-for.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - internal-test-helpers'); - test('internal-test-helpers/module-for.js should pass jscs', function () { - ok(true, 'internal-test-helpers/module-for.js should pass jscs.'); - }); -}); -enifed('internal-test-helpers/module-for.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - internal-test-helpers'); - QUnit.test('internal-test-helpers/module-for.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/module-for.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/module-for.js should pass jshint.'); - }); -}); -enifed('internal-test-helpers/run.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - internal-test-helpers'); - test('internal-test-helpers/run.js should pass jscs', function () { - ok(true, 'internal-test-helpers/run.js should pass jscs.'); + assert.ok(true, 'internal-test-helpers/module-for.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/run.jshint', ['exports'], function (exports) { +enifed('internal-test-helpers/run.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - internal-test-helpers'); - QUnit.test('internal-test-helpers/run.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/run.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/run.js should pass jshint.'); - }); -}); -enifed('internal-test-helpers/strip.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - internal-test-helpers'); - test('internal-test-helpers/strip.js should pass jscs', function () { - ok(true, 'internal-test-helpers/strip.js should pass jscs.'); + assert.ok(true, 'internal-test-helpers/run.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/strip.jshint', ['exports'], function (exports) { +enifed('internal-test-helpers/strip.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - internal-test-helpers'); - QUnit.test('internal-test-helpers/strip.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/strip.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/strip.js should pass jshint.'); + assert.ok(true, 'internal-test-helpers/strip.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/test-cases/abstract-application.jscs-test', ['exports'], function (exports) { +enifed('internal-test-helpers/test-cases/abstract-application.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - internal-test-helpers/test-cases'); - test('internal-test-helpers/test-cases/abstract-application.js should pass jscs', function () { - ok(true, 'internal-test-helpers/test-cases/abstract-application.js should pass jscs.'); - }); -}); -enifed('internal-test-helpers/test-cases/abstract-application.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - internal-test-helpers/test-cases'); - QUnit.test('internal-test-helpers/test-cases/abstract-application.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/test-cases/abstract-application.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/test-cases/abstract-application.js should pass jshint.'); - }); -}); -enifed('internal-test-helpers/test-cases/abstract-rendering.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - internal-test-helpers/test-cases'); - test('internal-test-helpers/test-cases/abstract-rendering.js should pass jscs', function () { - ok(true, 'internal-test-helpers/test-cases/abstract-rendering.js should pass jscs.'); + assert.ok(true, 'internal-test-helpers/test-cases/abstract-application.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/test-cases/abstract-rendering.jshint', ['exports'], function (exports) { +enifed('internal-test-helpers/test-cases/abstract-rendering.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - internal-test-helpers/test-cases'); - QUnit.test('internal-test-helpers/test-cases/abstract-rendering.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/test-cases/abstract-rendering.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/test-cases/abstract-rendering.js should pass jshint.'); + assert.ok(true, 'internal-test-helpers/test-cases/abstract-rendering.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/test-cases/abstract.jscs-test', ['exports'], function (exports) { +enifed('internal-test-helpers/test-cases/abstract.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - internal-test-helpers/test-cases'); - test('internal-test-helpers/test-cases/abstract.js should pass jscs', function () { - ok(true, 'internal-test-helpers/test-cases/abstract.js should pass jscs.'); - }); -}); -enifed('internal-test-helpers/test-cases/abstract.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - internal-test-helpers/test-cases'); - QUnit.test('internal-test-helpers/test-cases/abstract.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/test-cases/abstract.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/test-cases/abstract.js should pass jshint.'); - }); -}); -enifed('internal-test-helpers/test-cases/application.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - internal-test-helpers/test-cases'); - test('internal-test-helpers/test-cases/application.js should pass jscs', function () { - ok(true, 'internal-test-helpers/test-cases/application.js should pass jscs.'); + assert.ok(true, 'internal-test-helpers/test-cases/abstract.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/test-cases/application.jshint', ['exports'], function (exports) { +enifed('internal-test-helpers/test-cases/application.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - internal-test-helpers/test-cases'); - QUnit.test('internal-test-helpers/test-cases/application.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/test-cases/application.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/test-cases/application.js should pass jshint.'); - }); -}); -enifed('internal-test-helpers/test-cases/query-param.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - internal-test-helpers/test-cases'); - test('internal-test-helpers/test-cases/query-param.js should pass jscs', function () { - ok(true, 'internal-test-helpers/test-cases/query-param.js should pass jscs.'); + assert.ok(true, 'internal-test-helpers/test-cases/application.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/test-cases/query-param.jshint', ['exports'], function (exports) { +enifed('internal-test-helpers/test-cases/query-param.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - internal-test-helpers/test-cases'); - QUnit.test('internal-test-helpers/test-cases/query-param.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/test-cases/query-param.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/test-cases/query-param.js should pass jshint.'); + assert.ok(true, 'internal-test-helpers/test-cases/query-param.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/test-cases/rendering.jscs-test', ['exports'], function (exports) { +enifed('internal-test-helpers/test-cases/rendering.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - internal-test-helpers/test-cases'); - test('internal-test-helpers/test-cases/rendering.js should pass jscs', function () { - ok(true, 'internal-test-helpers/test-cases/rendering.js should pass jscs.'); - }); -}); -enifed('internal-test-helpers/test-cases/rendering.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - internal-test-helpers/test-cases'); - QUnit.test('internal-test-helpers/test-cases/rendering.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/test-cases/rendering.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/test-cases/rendering.js should pass jshint.'); + assert.ok(true, 'internal-test-helpers/test-cases/rendering.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/test-groups.jscs-test', ['exports'], function (exports) { +enifed('internal-test-helpers/test-cases/router.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - internal-test-helpers'); - test('internal-test-helpers/test-groups.js should pass jscs', function () { - ok(true, 'internal-test-helpers/test-groups.js should pass jscs.'); + QUnit.module('ESLint | internal-test-helpers/test-cases/router.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/test-cases/router.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/test-groups.jshint', ['exports'], function (exports) { +enifed('internal-test-helpers/test-groups.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - internal-test-helpers'); - QUnit.test('internal-test-helpers/test-groups.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/test-groups.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/test-groups.js should pass jshint.'); + assert.ok(true, 'internal-test-helpers/test-groups.js should pass ESLint\n\n'); }); }); enifed('internal-test-helpers/tests/index-test', ['exports'], function (exports) { @@ -82970,21 +79962,13 @@ enifed('internal-test-helpers/tests/index-test', ['exports'], function (exports) assert.ok(true, 'each package needs at least one test to be able to run through `npm test`'); }); }); -enifed('internal-test-helpers/tests/index-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - internal-test-helpers/tests'); - test('internal-test-helpers/tests/index-test.js should pass jscs', function () { - ok(true, 'internal-test-helpers/tests/index-test.js should pass jscs.'); - }); -}); -enifed('internal-test-helpers/tests/index-test.jshint', ['exports'], function (exports) { +enifed('internal-test-helpers/tests/index-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - internal-test-helpers/tests'); - QUnit.test('internal-test-helpers/tests/index-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/tests/index-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/tests/index-test.js should pass jshint.'); + assert.ok(true, 'internal-test-helpers/tests/index-test.js should pass ESLint\n\n'); }); }); }()); diff --git a/ember-tests.prod.js b/ember-tests.prod.js index 778ec9cff..3a96fcff4 100644 --- a/ember-tests.prod.js +++ b/ember-tests.prod.js @@ -1,16 +1,16 @@ ;(function() { /*! * @overview Ember - JavaScript Application Framework - * @copyright Copyright 2011-2016 Tilde Inc. and contributors + * @copyright Copyright 2011-2017 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.10.2-with-backtracking + * @version 2.12.0-canary-with-backtracking */ var enifed, requireModule, Ember; -var mainContext = this; +var mainContext = this; // Used in ember-environment/lib/global.js (function() { var isNode = typeof window === 'undefined' && @@ -112,8 +112,6 @@ var mainContext = this; } })(); -var babelHelpers; - function inherits(subClass, superClass) { subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { @@ -175,58 +173,34 @@ babelHelpers = { defaults: defaults }; -enifed('container/container.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - container'); - test('container/container.js should pass jscs', function () { - ok(true, 'container/container.js should pass jscs.'); - }); -}); -enifed('container/container.jshint', ['exports'], function (exports) { +enifed('container/container.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - container'); - QUnit.test('container/container.js should pass jshint', function (assert) { + QUnit.module('ESLint | container/container.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'container/container.js should pass jshint.'); - }); -}); -enifed('container/index.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - container'); - test('container/index.js should pass jscs', function () { - ok(true, 'container/index.js should pass jscs.'); + assert.ok(true, 'container/container.js should pass ESLint\n\n'); }); }); -enifed('container/index.jshint', ['exports'], function (exports) { +enifed('container/index.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - container'); - QUnit.test('container/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | container/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'container/index.js should pass jshint.'); + assert.ok(true, 'container/index.js should pass ESLint\n\n'); }); }); -enifed('container/registry.jscs-test', ['exports'], function (exports) { +enifed('container/registry.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - container'); - test('container/registry.js should pass jscs', function () { - ok(true, 'container/registry.js should pass jscs.'); - }); -}); -enifed('container/registry.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - container'); - QUnit.test('container/registry.js should pass jshint', function (assert) { + QUnit.module('ESLint | container/registry.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'container/registry.js should pass jshint.'); + assert.ok(true, 'container/registry.js should pass ESLint\n\n'); }); }); -enifed('container/tests/container_test', ['exports', 'ember-utils', 'ember-environment', 'ember-metal', 'container/index', 'internal-test-helpers'], function (exports, _emberUtils, _emberEnvironment, _emberMetal, _containerIndex, _internalTestHelpers) { +enifed('container/tests/container_test', ['exports', 'ember-utils', 'ember-environment', 'ember-metal', 'container/index', 'internal-test-helpers', 'container'], function (exports, _emberUtils, _emberEnvironment, _emberMetal, _containerIndex, _internalTestHelpers, _container) { 'use strict'; var originalModelInjections = undefined; @@ -240,6 +214,10 @@ enifed('container/tests/container_test', ['exports', 'ember-utils', 'ember-envir } }); + function lookupFactory(name, container, options) { + return container[_container.LOOKUP_FACTORY](name, options); + } + QUnit.test('A registered factory returns the same instance each time', function () { var registry = new _containerIndex.Registry(); var container = registry.container(); @@ -261,7 +239,7 @@ enifed('container/tests/container_test', ['exports', 'ember-utils', 'ember-envir registry.register('controller:post', PostController); - var PostControllerFactory = container.lookupFactory('controller:post'); + var PostControllerFactory = lookupFactory('controller:post', container); ok(PostControllerFactory, 'factory is returned'); ok(PostControllerFactory.create() instanceof PostController, 'The return of factory.create is an instance of PostController'); @@ -274,7 +252,10 @@ enifed('container/tests/container_test', ['exports', 'ember-utils', 'ember-envir registry.register('controller:post', PostController); - deepEqual(container.lookupFactory('controller:post'), container.lookupFactory('controller:post'), 'The return of lookupFactory is always the same'); + var Post1 = lookupFactory('controller:post', container); + var Post2 = lookupFactory('controller:post', container); + + deepEqual(Post1, Post2, 'The return of lookupFactory is always the same'); }); QUnit.test('A factory returned from lookupFactory has a debugkey', function () { @@ -283,7 +264,7 @@ enifed('container/tests/container_test', ['exports', 'ember-utils', 'ember-envir var PostController = _internalTestHelpers.factory(); registry.register('controller:post', PostController); - var PostFactory = container.lookupFactory('controller:post'); + var PostFactory = lookupFactory('controller:post', container); equal(PostFactory._debugContainerKey, 'controller:post', 'factory instance receives _debugContainerKey'); }); @@ -312,7 +293,7 @@ enifed('container/tests/container_test', ['exports', 'ember-utils', 'ember-envir var instance = undefined; registry.register('controller:post', PostController); - instance = container.lookupFactory('controller:post').create(); + instance = lookupFactory('controller:post', container).create(); equal(instance._debugContainerKey, 'controller:post', 'factory instance receives _debugContainerKey'); @@ -415,7 +396,7 @@ enifed('container/tests/container_test', ['exports', 'ember-utils', 'ember-envir registry.factoryInjection('controller:post', 'store', 'store:main'); registry.factoryTypeInjection('controller', 'router', 'router:main'); - var PostControllerFactory = container.lookupFactory('controller:post'); + var PostControllerFactory = lookupFactory('controller:post', container); var store = container.lookup('store:main'); var router = container.lookup('router:main'); @@ -577,7 +558,7 @@ enifed('container/tests/container_test', ['exports', 'ember-utils', 'ember-envir }; registry.register('controller:post', PostController); - var fact = container.lookupFactory('controller:normalized'); + var fact = lookupFactory('controller:normalized', container); equal(fact.toString() === PostController.extend().toString(), true, 'Normalizes the name when looking factory up'); }); @@ -657,10 +638,10 @@ enifed('container/tests/container_test', ['exports', 'ember-utils', 'ember-envir }; deepEqual(resolveWasCalled, []); - container.lookupFactory('controller:post'); + lookupFactory('controller:post', container); deepEqual(resolveWasCalled, ['controller:post']); - container.lookupFactory('controller:post'); + lookupFactory('controller:post', container); deepEqual(resolveWasCalled, ['controller:post']); }); @@ -675,10 +656,10 @@ enifed('container/tests/container_test', ['exports', 'ember-utils', 'ember-envir }; deepEqual(resolveWasCalled, []); - container.lookupFactory('model:post'); + lookupFactory('model:post', container); deepEqual(resolveWasCalled, ['model:post']); - container.lookupFactory('model:post'); + lookupFactory('model:post', container); deepEqual(resolveWasCalled, ['model:post']); }); @@ -694,10 +675,10 @@ enifed('container/tests/container_test', ['exports', 'ember-utils', 'ember-envir }; deepEqual(resolveWasCalled, []); - container.lookupFactory('foo:post'); + lookupFactory('foo:post', container); deepEqual(resolveWasCalled, ['foo:post']); - container.lookupFactory('foo:post'); + lookupFactory('foo:post', container); deepEqual(resolveWasCalled, ['foo:post']); }); @@ -717,8 +698,8 @@ enifed('container/tests/container_test', ['exports', 'ember-utils', 'ember-envir registry.register('apple:main', Apple); - container.lookupFactory('apple:main'); - container.lookupFactory('apple:main'); + lookupFactory('apple:main', container); + lookupFactory('apple:main', container); }); QUnit.test('A factory\'s lazy injections are validated when first instantiated', function () { @@ -790,8 +771,14 @@ enifed('container/tests/container_test', ['exports', 'ember-utils', 'ember-envir }, 'Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.'); }); + // This is testing that container was passed as an option QUnit.test('A deprecated `container` property is appended to every object instantiated from a non-extendable factory, and a fake container is available during instantiation.', function () { - expect(8); + if (!true) { + expect(8); + } else { + expect(1); + ok(true, '[SKIPPED] This will be removed when `factoryFor` lands.'); + } var owner = {}; var registry = new _containerIndex.Registry(); @@ -828,56 +815,21 @@ enifed('container/tests/container_test', ['exports', 'ember-utils', 'ember-envir }; registry.register('controller:post', PostController); - var postController = container.lookup('controller:post'); - - expectDeprecation(function () { - _emberMetal.get(postController, 'container'); - }, 'Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.'); - - expectDeprecation(function () { - var c = postController.container; - strictEqual(c, container, 'Injected container is now regular (not fake) container, but access is still deprecated.'); - }, 'Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.'); - }); - - QUnit.test('A deprecated `container` property is only set on a non-extendable factory instance if `container` is present and writable.', function () { - expect(2); - - var owner = {}; - var registry = new _containerIndex.Registry(); - var container = registry.container({ owner: owner }); - - // Define a non-extendable factory that is frozen after `create` - var PostController = function () {}; - PostController.create = function () { - var instance = new PostController(); - - Object.seal(instance); - - return instance; - }; - - registry.register('controller:post', PostController); - var postController = container.lookup('controller:post'); - - equal(postController.container, undefined, 'container was not added'); - - var OtherController = function () { - this.container = 'foo'; - }; - OtherController.create = function () { - var instance = new OtherController(); - - Object.freeze(instance); - - return instance; - }; + if (!true) { + (function () { + var postController = container.lookup('controller:post'); - registry.register('controller:other', OtherController); - var otherController = container.lookup('controller:other'); + expectDeprecation(function () { + _emberMetal.get(postController, 'container'); + }, 'Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.'); - equal(otherController.container, 'foo', 'container was not added'); + expectDeprecation(function () { + var c = postController.container; + strictEqual(c, container, 'Injected container is now regular (not fake) container, but access is still deprecated.'); + }, 'Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.'); + })(); + } }); QUnit.test('An extendable factory can provide `container` upon create, with a deprecation', function (assert) { @@ -886,7 +838,7 @@ enifed('container/tests/container_test', ['exports', 'ember-utils', 'ember-envir registry.register('controller:post', _internalTestHelpers.factory()); - var PostController = container.lookupFactory('controller:post'); + var PostController = lookupFactory('controller:post', container); var postController = undefined; @@ -917,7 +869,7 @@ enifed('container/tests/container_test', ['exports', 'ember-utils', 'ember-envir return 'controller:post'; }; - var PostControllerFactory = container.lookupFactory('foo:bar', { source: 'baz:qux' }); + var PostControllerFactory = lookupFactory('foo:bar', container, { source: 'baz:qux' }); assert.ok(PostControllerFactory.create() instanceof PostController, 'The return of factory.create is an instance of PostController'); }); @@ -928,7 +880,6 @@ enifed('container/tests/container_test', ['exports', 'ember-utils', 'ember-envir var PostController = _internalTestHelpers.factory(); registry.register('controller:post', PostController); - registry.expandLocalLookup = function (fullName, options) { assert.ok(true, 'expandLocalLookup was called'); assert.equal(fullName, 'foo:bar'); @@ -941,22 +892,111 @@ enifed('container/tests/container_test', ['exports', 'ember-utils', 'ember-envir assert.ok(PostControllerLookupResult instanceof PostController); }); -}); -enifed('container/tests/container_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - module('JSCS - container/tests'); - test('container/tests/container_test.js should pass jscs', function () { - ok(true, 'container/tests/container_test.js should pass jscs.'); + QUnit.test('#[FACTORY_FOR] class is the injected factory', function (assert) { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + + var Component = _internalTestHelpers.factory(); + registry.register('component:foo-bar', Component); + + var factoryCreator = container[_container.FACTORY_FOR]('component:foo-bar'); + if (_emberMetal.isFeatureEnabled('ember-no-double-extend')) { + assert.deepEqual(factoryCreator.class, Component, 'No double extend'); + } else { + assert.deepEqual(factoryCreator.class, lookupFactory('component:foo-bar', container), 'Double extended class'); + } }); + + if (true) { + QUnit.test('#factoryFor must supply a fullname', function (assert) { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + assert.throws(function () { + container.factoryFor('chad-bar'); + }, /Invalid Fullname, expected: 'type:name' got: chad-bar/); + }); + + QUnit.test('#factoryFor returns a factory creator', function (assert) { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + + var Component = _internalTestHelpers.factory(); + registry.register('component:foo-bar', Component); + + var factoryCreator = container.factoryFor('component:foo-bar'); + assert.ok(factoryCreator.create); + assert.ok(factoryCreator.class); + }); + + QUnit.test('#factoryFor class returns the factory function', function (assert) { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + + var Component = _internalTestHelpers.factory(); + registry.register('component:foo-bar', Component); + + var factoryCreator = container.factoryFor('component:foo-bar'); + assert.deepEqual(factoryCreator.class, Component, 'No double extend'); + }); + + QUnit.test('#factoryFor instance have a common parent', function (assert) { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + + var Component = _internalTestHelpers.factory(); + registry.register('component:foo-bar', Component); + + var factoryCreator1 = container.factoryFor('component:foo-bar'); + var factoryCreator2 = container.factoryFor('component:foo-bar'); + var instance1 = factoryCreator1.create({ foo: 'foo' }); + var instance2 = factoryCreator2.create({ bar: 'bar' }); + + assert.deepEqual(instance1.constructor, instance2.constructor); + }); + + QUnit.test('#factoryFor created instances come with instance injections', function (assert) { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + + var Component = _internalTestHelpers.factory(); + var Ajax = _internalTestHelpers.factory(); + registry.register('component:foo-bar', Component); + registry.register('util:ajax', Ajax); + registry.injection('component:foo-bar', 'ajax', 'util:ajax'); + + var componentFactory = container.factoryFor('component:foo-bar'); + var component = componentFactory.create(); + + assert.ok(component.ajax); + assert.ok(component.ajax instanceof Ajax); + }); + + QUnit.test('#factoryFor options passed to create clobber injections', function (assert) { + var registry = new _containerIndex.Registry(); + var container = registry.container(); + + var Component = _internalTestHelpers.factory(); + var Ajax = _internalTestHelpers.factory(); + registry.register('component:foo-bar', Component); + registry.register('util:ajax', Ajax); + registry.injection('component:foo-bar', 'ajax', 'util:ajax'); + + var componentFactory = container.factoryFor('component:foo-bar'); + + var instrance = componentFactory.create({ ajax: 'fetch' }); + + assert.equal(instrance.ajax, 'fetch'); + }); + } }); -enifed('container/tests/container_test.jshint', ['exports'], function (exports) { +enifed('container/tests/container_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - container/tests'); - QUnit.test('container/tests/container_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | container/tests/container_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'container/tests/container_test.js should pass jshint.'); + assert.ok(true, 'container/tests/container_test.js should pass ESLint\n\n'); }); }); enifed('container/tests/owner_test', ['exports', 'ember-utils'], function (exports, _emberUtils) { @@ -977,21 +1017,13 @@ enifed('container/tests/owner_test', ['exports', 'ember-utils'], function (expor strictEqual(obj[_emberUtils.OWNER], owner, 'owner has been set to the OWNER symbol'); }); }); -enifed('container/tests/owner_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - container/tests'); - test('container/tests/owner_test.js should pass jscs', function () { - ok(true, 'container/tests/owner_test.js should pass jscs.'); - }); -}); -enifed('container/tests/owner_test.jshint', ['exports'], function (exports) { +enifed('container/tests/owner_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - container/tests'); - QUnit.test('container/tests/owner_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | container/tests/owner_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'container/tests/owner_test.js should pass jshint.'); + assert.ok(true, 'container/tests/owner_test.js should pass ESLint\n\n'); }); }); enifed('container/tests/registry_test', ['exports', 'container/index', 'internal-test-helpers'], function (exports, _containerIndex, _internalTestHelpers) { @@ -1744,157 +1776,85 @@ enifed('container/tests/registry_test', ['exports', 'container/index', 'internal assert.deepEqual(['foo:qux/bar'], resolvedFullNames); }); }); -enifed('container/tests/registry_test.jscs-test', ['exports'], function (exports) { +enifed('container/tests/registry_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - container/tests'); - test('container/tests/registry_test.js should pass jscs', function () { - ok(true, 'container/tests/registry_test.js should pass jscs.'); - }); -}); -enifed('container/tests/registry_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - container/tests'); - QUnit.test('container/tests/registry_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | container/tests/registry_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'container/tests/registry_test.js should pass jshint.'); - }); -}); -enifed('ember-application/index.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-application'); - test('ember-application/index.js should pass jscs', function () { - ok(true, 'ember-application/index.js should pass jscs.'); + assert.ok(true, 'container/tests/registry_test.js should pass ESLint\n\n'); }); }); -enifed('ember-application/index.jshint', ['exports'], function (exports) { +enifed('ember-application/index.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-application'); - QUnit.test('ember-application/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/index.js should pass jshint.'); - }); -}); -enifed('ember-application/initializers/dom-templates.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-application/initializers'); - test('ember-application/initializers/dom-templates.js should pass jscs', function () { - ok(true, 'ember-application/initializers/dom-templates.js should pass jscs.'); + assert.ok(true, 'ember-application/index.js should pass ESLint\n\n'); }); }); -enifed('ember-application/initializers/dom-templates.jshint', ['exports'], function (exports) { +enifed('ember-application/initializers/dom-templates.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-application/initializers'); - QUnit.test('ember-application/initializers/dom-templates.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/initializers/dom-templates.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/initializers/dom-templates.js should pass jshint.'); - }); -}); -enifed('ember-application/system/application-instance.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-application/system'); - test('ember-application/system/application-instance.js should pass jscs', function () { - ok(true, 'ember-application/system/application-instance.js should pass jscs.'); + assert.ok(true, 'ember-application/initializers/dom-templates.js should pass ESLint\n\n'); }); }); -enifed('ember-application/system/application-instance.jshint', ['exports'], function (exports) { +enifed('ember-application/system/application-instance.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-application/system'); - QUnit.test('ember-application/system/application-instance.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/system/application-instance.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/system/application-instance.js should pass jshint.'); - }); -}); -enifed('ember-application/system/application.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-application/system'); - test('ember-application/system/application.js should pass jscs', function () { - ok(true, 'ember-application/system/application.js should pass jscs.'); + assert.ok(true, 'ember-application/system/application-instance.js should pass ESLint\n\n'); }); }); -enifed('ember-application/system/application.jshint', ['exports'], function (exports) { +enifed('ember-application/system/application.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-application/system'); - QUnit.test('ember-application/system/application.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/system/application.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/system/application.js should pass jshint.'); - }); -}); -enifed('ember-application/system/engine-instance.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-application/system'); - test('ember-application/system/engine-instance.js should pass jscs', function () { - ok(true, 'ember-application/system/engine-instance.js should pass jscs.'); + assert.ok(true, 'ember-application/system/application.js should pass ESLint\n\n'); }); }); -enifed('ember-application/system/engine-instance.jshint', ['exports'], function (exports) { +enifed('ember-application/system/engine-instance.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-application/system'); - QUnit.test('ember-application/system/engine-instance.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/system/engine-instance.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/system/engine-instance.js should pass jshint.'); - }); -}); -enifed('ember-application/system/engine-parent.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-application/system'); - test('ember-application/system/engine-parent.js should pass jscs', function () { - ok(true, 'ember-application/system/engine-parent.js should pass jscs.'); + assert.ok(true, 'ember-application/system/engine-instance.js should pass ESLint\n\n'); }); }); -enifed('ember-application/system/engine-parent.jshint', ['exports'], function (exports) { +enifed('ember-application/system/engine-parent.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-application/system'); - QUnit.test('ember-application/system/engine-parent.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/system/engine-parent.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/system/engine-parent.js should pass jshint.'); - }); -}); -enifed('ember-application/system/engine.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-application/system'); - test('ember-application/system/engine.js should pass jscs', function () { - ok(true, 'ember-application/system/engine.js should pass jscs.'); + assert.ok(true, 'ember-application/system/engine-parent.js should pass ESLint\n\n'); }); }); -enifed('ember-application/system/engine.jshint', ['exports'], function (exports) { +enifed('ember-application/system/engine.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-application/system'); - QUnit.test('ember-application/system/engine.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/system/engine.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/system/engine.js should pass jshint.'); - }); -}); -enifed('ember-application/system/resolver.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-application/system'); - test('ember-application/system/resolver.js should pass jscs', function () { - ok(true, 'ember-application/system/resolver.js should pass jscs.'); + assert.ok(true, 'ember-application/system/engine.js should pass ESLint\n\n'); }); }); -enifed('ember-application/system/resolver.jshint', ['exports'], function (exports) { +enifed('ember-application/system/resolver.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-application/system'); - QUnit.test('ember-application/system/resolver.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/system/resolver.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/system/resolver.js should pass jshint.'); + assert.ok(true, 'ember-application/system/resolver.js should pass ESLint\n\n'); }); }); enifed('ember-application/tests/system/application_instance_test', ['exports', 'ember-application/system/engine', 'ember-application/system/application', 'ember-application/system/application-instance', 'ember-metal', 'ember-views', 'container', 'internal-test-helpers', 'ember-runtime'], function (exports, _emberApplicationSystemEngine, _emberApplicationSystemApplication, _emberApplicationSystemApplicationInstance, _emberMetal, _emberViews, _container, _internalTestHelpers, _emberRuntime) { @@ -2093,21 +2053,13 @@ enifed('ember-application/tests/system/application_instance_test', ['exports', ' assert.equal(registry.resolve('service:-document'), document); }); }); -enifed('ember-application/tests/system/application_instance_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-application/tests/system'); - test('ember-application/tests/system/application_instance_test.js should pass jscs', function () { - ok(true, 'ember-application/tests/system/application_instance_test.js should pass jscs.'); - }); -}); -enifed('ember-application/tests/system/application_instance_test.jshint', ['exports'], function (exports) { +enifed('ember-application/tests/system/application_instance_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-application/tests/system'); - QUnit.test('ember-application/tests/system/application_instance_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/tests/system/application_instance_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/tests/system/application_instance_test.js should pass jshint.'); + assert.ok(true, 'ember-application/tests/system/application_instance_test.js should pass ESLint\n\n'); }); }); enifed('ember-application/tests/system/application_test', ['exports', 'ember', 'ember-environment', 'ember-metal', 'ember-application/system/application', 'ember-application/system/resolver', 'ember-routing', 'ember-views', 'ember-runtime', 'ember-template-compiler', 'ember-glimmer', 'container', 'ember-application/tests/test-helpers/registry-check'], function (exports, _ember, _emberEnvironment, _emberMetal, _emberApplicationSystemApplication, _emberApplicationSystemResolver, _emberRouting, _emberViews, _emberRuntime, _emberTemplateCompiler, _emberGlimmer, _container, _emberApplicationTestsTestHelpersRegistryCheck) { @@ -2513,21 +2465,13 @@ enifed('ember-application/tests/system/application_test', ['exports', 'ember', ' assert.equal(registry.resolve('application:main'), namespace); }); }); -enifed('ember-application/tests/system/application_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-application/tests/system'); - test('ember-application/tests/system/application_test.js should pass jscs', function () { - ok(true, 'ember-application/tests/system/application_test.js should pass jscs.'); - }); -}); -enifed('ember-application/tests/system/application_test.jshint', ['exports'], function (exports) { +enifed('ember-application/tests/system/application_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-application/tests/system'); - QUnit.test('ember-application/tests/system/application_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/tests/system/application_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/tests/system/application_test.js should pass jshint.'); + assert.ok(true, 'ember-application/tests/system/application_test.js should pass ESLint\n\n'); }); }); enifed('ember-application/tests/system/bootstrap-test', ['exports', 'ember-metal', 'ember-application/system/application', 'ember-routing', 'ember-views', 'ember-glimmer'], function (exports, _emberMetal, _emberApplicationSystemApplication, _emberRouting, _emberViews, _emberGlimmer) { @@ -2560,21 +2504,13 @@ enifed('ember-application/tests/system/bootstrap-test', ['exports', 'ember-metal assert.equal(_emberViews.jQuery('#app').text(), 'Hello World!'); }); }); -enifed('ember-application/tests/system/bootstrap-test.jscs-test', ['exports'], function (exports) { +enifed('ember-application/tests/system/bootstrap-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-application/tests/system'); - test('ember-application/tests/system/bootstrap-test.js should pass jscs', function () { - ok(true, 'ember-application/tests/system/bootstrap-test.js should pass jscs.'); - }); -}); -enifed('ember-application/tests/system/bootstrap-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-application/tests/system'); - QUnit.test('ember-application/tests/system/bootstrap-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/tests/system/bootstrap-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/tests/system/bootstrap-test.js should pass jshint.'); + assert.ok(true, 'ember-application/tests/system/bootstrap-test.js should pass ESLint\n\n'); }); }); enifed('ember-application/tests/system/dependency_injection/custom_resolver_test', ['exports', 'ember-views', 'ember-metal', 'ember-application/system/application', 'ember-application/system/resolver', 'ember-template-compiler'], function (exports, _emberViews, _emberMetal, _emberApplicationSystemApplication, _emberApplicationSystemResolver, _emberTemplateCompiler) { @@ -2617,21 +2553,13 @@ enifed('ember-application/tests/system/dependency_injection/custom_resolver_test equal(_emberViews.jQuery('h1', application.rootElement).text(), 'Fallback'); }); }); -enifed('ember-application/tests/system/dependency_injection/custom_resolver_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-application/tests/system/dependency_injection'); - test('ember-application/tests/system/dependency_injection/custom_resolver_test.js should pass jscs', function () { - ok(true, 'ember-application/tests/system/dependency_injection/custom_resolver_test.js should pass jscs.'); - }); -}); -enifed('ember-application/tests/system/dependency_injection/custom_resolver_test.jshint', ['exports'], function (exports) { +enifed('ember-application/tests/system/dependency_injection/custom_resolver_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-application/tests/system/dependency_injection'); - QUnit.test('ember-application/tests/system/dependency_injection/custom_resolver_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/tests/system/dependency_injection/custom_resolver_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/tests/system/dependency_injection/custom_resolver_test.js should pass jshint.'); + assert.ok(true, 'ember-application/tests/system/dependency_injection/custom_resolver_test.js should pass ESLint\n\n'); }); }); enifed('ember-application/tests/system/dependency_injection/default_resolver_test', ['exports', 'ember-environment', 'ember-metal', 'ember-runtime', 'ember-routing', 'ember-application/system/application', 'ember-glimmer', 'ember-template-compiler'], function (exports, _emberEnvironment, _emberMetal, _emberRuntime, _emberRouting, _emberApplicationSystemApplication, _emberGlimmer, _emberTemplateCompiler) { @@ -2685,9 +2613,17 @@ enifed('ember-application/tests/system/dependency_injection/default_resolver_tes _emberGlimmer.setTemplate('fooBar', fooBarTemplate); _emberGlimmer.setTemplate('fooBar/baz', fooBarBazTemplate); - equal(locator.lookupFactory('template:foo'), fooTemplate, 'resolves template:foo'); - equal(locator.lookupFactory('template:fooBar'), fooBarTemplate, 'resolves template:foo_bar'); - equal(locator.lookupFactory('template:fooBar.baz'), fooBarBazTemplate, 'resolves template:foo_bar.baz'); + ignoreDeprecation(function () { + equal(locator.lookupFactory('template:foo'), fooTemplate, 'resolves template:foo'); + equal(locator.lookupFactory('template:fooBar'), fooBarTemplate, 'resolves template:foo_bar'); + equal(locator.lookupFactory('template:fooBar.baz'), fooBarBazTemplate, 'resolves template:foo_bar.baz'); + }); + + if (true) { + equal(locator.factoryFor('template:foo').class, fooTemplate, 'resolves template:foo'); + equal(locator.factoryFor('template:fooBar').class, fooBarTemplate, 'resolves template:foo_bar'); + equal(locator.factoryFor('template:fooBar.baz').class, fooBarBazTemplate, 'resolves template:foo_bar.baz'); + } }); QUnit.test('the default resolver looks up basic name as no prefix', function () { @@ -2707,28 +2643,61 @@ enifed('ember-application/tests/system/dependency_injection/default_resolver_tes QUnit.test('the default resolver resolves models on the namespace', function () { application.Post = _emberRuntime.Object.extend({}); - detectEqual(application.Post, locator.lookupFactory('model:post'), 'looks up Post model on application'); + ignoreDeprecation(function () { + detectEqual(application.Post, locator.lookupFactory('model:post'), 'looks up Post model on application'); + }); + if (true) { + detectEqual(application.Post, locator.factoryFor('model:post').class, 'looks up Post model on application'); + } }); QUnit.test('the default resolver resolves *:main on the namespace', function () { application.FooBar = _emberRuntime.Object.extend({}); - detectEqual(application.FooBar, locator.lookupFactory('foo-bar:main'), 'looks up FooBar type without name on application'); + ignoreDeprecation(function () { + detectEqual(application.FooBar, locator.lookupFactory('foo-bar:main'), 'looks up FooBar type without name on application'); + }); + if (true) { + detectEqual(application.FooBar, locator.factoryFor('foo-bar:main').class, 'looks up FooBar type without name on application'); + } }); - QUnit.test('the default resolver resolves container-registered helpers', function () { + if (true) { + QUnit.test('the default resolver resolves container-registered helpers', function () { + var shorthandHelper = _emberGlimmer.helper(function () {}); + var helper = _emberGlimmer.Helper.extend(); + + application.register('helper:shorthand', shorthandHelper); + application.register('helper:complete', helper); + + var lookedUpShorthandHelper = locator.factoryFor('helper:shorthand').class; + + ok(lookedUpShorthandHelper.isHelperInstance, 'shorthand helper isHelper'); + + var lookedUpHelper = locator.factoryFor('helper:complete').class; + + ok(lookedUpHelper.isHelperFactory, 'complete helper is factory'); + ok(helper.detect(lookedUpHelper), 'looked up complete helper'); + }); + } + + QUnit.test('the default resolver resolves container-registered helpers via lookupFor', function () { var shorthandHelper = _emberGlimmer.helper(function () {}); var helper = _emberGlimmer.Helper.extend(); application.register('helper:shorthand', shorthandHelper); application.register('helper:complete', helper); - var lookedUpShorthandHelper = locator.lookupFactory('helper:shorthand'); - ok(lookedUpShorthandHelper.isHelperInstance, 'shorthand helper isHelper'); + ignoreDeprecation(function () { + var lookedUpShorthandHelper = locator.lookupFactory('helper:shorthand'); + + ok(lookedUpShorthandHelper.isHelperInstance, 'shorthand helper isHelper'); + + var lookedUpHelper = locator.lookupFactory('helper:complete'); - var lookedUpHelper = locator.lookupFactory('helper:complete'); - ok(lookedUpHelper.isHelperFactory, 'complete helper is factory'); - ok(helper.detect(lookedUpHelper), 'looked up complete helper'); + ok(lookedUpHelper.isHelperFactory, 'complete helper is factory'); + ok(helper.detect(lookedUpHelper), 'looked up complete helper'); + }); }); QUnit.test('the default resolver resolves helpers on the namespace', function () { @@ -2922,21 +2891,13 @@ enifed('ember-application/tests/system/dependency_injection/default_resolver_tes ok(true, 'does not error'); }); }); -enifed('ember-application/tests/system/dependency_injection/default_resolver_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-application/tests/system/dependency_injection'); - test('ember-application/tests/system/dependency_injection/default_resolver_test.js should pass jscs', function () { - ok(true, 'ember-application/tests/system/dependency_injection/default_resolver_test.js should pass jscs.'); - }); -}); -enifed('ember-application/tests/system/dependency_injection/default_resolver_test.jshint', ['exports'], function (exports) { +enifed('ember-application/tests/system/dependency_injection/default_resolver_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-application/tests/system/dependency_injection'); - QUnit.test('ember-application/tests/system/dependency_injection/default_resolver_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/tests/system/dependency_injection/default_resolver_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/tests/system/dependency_injection/default_resolver_test.js should pass jshint.'); + assert.ok(true, 'ember-application/tests/system/dependency_injection/default_resolver_test.js should pass ESLint\n\n'); }); }); enifed('ember-application/tests/system/dependency_injection/normalization_test', ['exports', 'ember-metal', 'ember-application/system/application'], function (exports, _emberMetal, _emberApplicationSystemApplication) { @@ -2988,21 +2949,13 @@ enifed('ember-application/tests/system/dependency_injection/normalization_test', }); }); }); -enifed('ember-application/tests/system/dependency_injection/normalization_test.jscs-test', ['exports'], function (exports) { +enifed('ember-application/tests/system/dependency_injection/normalization_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-application/tests/system/dependency_injection'); - test('ember-application/tests/system/dependency_injection/normalization_test.js should pass jscs', function () { - ok(true, 'ember-application/tests/system/dependency_injection/normalization_test.js should pass jscs.'); - }); -}); -enifed('ember-application/tests/system/dependency_injection/normalization_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-application/tests/system/dependency_injection'); - QUnit.test('ember-application/tests/system/dependency_injection/normalization_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/tests/system/dependency_injection/normalization_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/tests/system/dependency_injection/normalization_test.js should pass jshint.'); + assert.ok(true, 'ember-application/tests/system/dependency_injection/normalization_test.js should pass ESLint\n\n'); }); }); enifed('ember-application/tests/system/dependency_injection/to_string_test', ['exports', 'ember-utils', 'ember-environment', 'ember-metal', 'ember-application/system/application', 'ember-runtime', 'ember-application/system/resolver'], function (exports, _emberUtils, _emberEnvironment, _emberMetal, _emberApplicationSystemApplication, _emberRuntime, _emberApplicationSystemResolver) { @@ -3037,7 +2990,12 @@ enifed('ember-application/tests/system/dependency_injection/to_string_test', ['e }); QUnit.test('factories', function () { - var PostFactory = App.__container__.lookupFactory('model:post'); + var PostFactory = undefined; + if (true) { + PostFactory = App.__container__.factoryFor('model:post').class; + } else { + PostFactory = App.__container__.lookupFactory('model:post'); + } equal(PostFactory.toString(), 'App.Post', 'expecting the model to be post'); }); @@ -3070,21 +3028,13 @@ enifed('ember-application/tests/system/dependency_injection/to_string_test', ['e }); }); // lookup, etc -enifed('ember-application/tests/system/dependency_injection/to_string_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-application/tests/system/dependency_injection'); - test('ember-application/tests/system/dependency_injection/to_string_test.js should pass jscs', function () { - ok(true, 'ember-application/tests/system/dependency_injection/to_string_test.js should pass jscs.'); - }); -}); -enifed('ember-application/tests/system/dependency_injection/to_string_test.jshint', ['exports'], function (exports) { +enifed('ember-application/tests/system/dependency_injection/to_string_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-application/tests/system/dependency_injection'); - QUnit.test('ember-application/tests/system/dependency_injection/to_string_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/tests/system/dependency_injection/to_string_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/tests/system/dependency_injection/to_string_test.js should pass jshint.'); + assert.ok(true, 'ember-application/tests/system/dependency_injection/to_string_test.js should pass ESLint\n\n'); }); }); enifed('ember-application/tests/system/dependency_injection_test', ['exports', 'ember-environment', 'ember-metal', 'ember-runtime', 'ember-application/system/application'], function (exports, _emberEnvironment, _emberMetal, _emberRuntime, _emberApplicationSystemApplication) { @@ -3095,7 +3045,6 @@ enifed('ember-application/tests/system/dependency_injection_test', ['exports', ' var originalLookup = _emberEnvironment.context.lookup; var registry = undefined, locator = undefined, - lookup = undefined, application = undefined, originalModelInjections = undefined; @@ -3121,7 +3070,7 @@ enifed('ember-application/tests/system/dependency_injection_test', ['exports', ' registry = application.__registry__; locator = application.__container__; - lookup = _emberEnvironment.context.lookup = {}; + _emberEnvironment.context.lookup = {}; }, teardown: function () { _emberMetal.run(application, 'destroy'); @@ -3166,21 +3115,13 @@ enifed('ember-application/tests/system/dependency_injection_test', ['exports', ' ok(application.Email.detectInstance(user.get('communication'))); }); }); -enifed('ember-application/tests/system/dependency_injection_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-application/tests/system'); - test('ember-application/tests/system/dependency_injection_test.js should pass jscs', function () { - ok(true, 'ember-application/tests/system/dependency_injection_test.js should pass jscs.'); - }); -}); -enifed('ember-application/tests/system/dependency_injection_test.jshint', ['exports'], function (exports) { +enifed('ember-application/tests/system/dependency_injection_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-application/tests/system'); - QUnit.test('ember-application/tests/system/dependency_injection_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/tests/system/dependency_injection_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/tests/system/dependency_injection_test.js should pass jshint.'); + assert.ok(true, 'ember-application/tests/system/dependency_injection_test.js should pass ESLint\n\n'); }); }); enifed('ember-application/tests/system/engine_initializers_test', ['exports', 'ember-metal', 'ember-application/system/engine'], function (exports, _emberMetal, _emberApplicationSystemEngine) { @@ -3536,21 +3477,13 @@ enifed('ember-application/tests/system/engine_initializers_test', ['exports', 'e myEngineInstance = myEngine.buildInstance(); }); }); -enifed('ember-application/tests/system/engine_initializers_test.jscs-test', ['exports'], function (exports) { +enifed('ember-application/tests/system/engine_initializers_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-application/tests/system'); - test('ember-application/tests/system/engine_initializers_test.js should pass jscs', function () { - ok(true, 'ember-application/tests/system/engine_initializers_test.js should pass jscs.'); - }); -}); -enifed('ember-application/tests/system/engine_initializers_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-application/tests/system'); - QUnit.test('ember-application/tests/system/engine_initializers_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/tests/system/engine_initializers_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/tests/system/engine_initializers_test.js should pass jshint.'); + assert.ok(true, 'ember-application/tests/system/engine_initializers_test.js should pass ESLint\n\n'); }); }); enifed('ember-application/tests/system/engine_instance_initializers_test', ['exports', 'ember-metal', 'ember-application/system/engine', 'ember-application/system/engine-instance', 'ember-application/system/engine-parent'], function (exports, _emberMetal, _emberApplicationSystemEngine, _emberApplicationSystemEngineInstance, _emberApplicationSystemEngineParent) { @@ -3941,21 +3874,13 @@ enifed('ember-application/tests/system/engine_instance_initializers_test', ['exp return myEngineInstance.boot(); }); }); -enifed('ember-application/tests/system/engine_instance_initializers_test.jscs-test', ['exports'], function (exports) { +enifed('ember-application/tests/system/engine_instance_initializers_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-application/tests/system'); - test('ember-application/tests/system/engine_instance_initializers_test.js should pass jscs', function () { - ok(true, 'ember-application/tests/system/engine_instance_initializers_test.js should pass jscs.'); - }); -}); -enifed('ember-application/tests/system/engine_instance_initializers_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-application/tests/system'); - QUnit.test('ember-application/tests/system/engine_instance_initializers_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/tests/system/engine_instance_initializers_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/tests/system/engine_instance_initializers_test.js should pass jshint.'); + assert.ok(true, 'ember-application/tests/system/engine_instance_initializers_test.js should pass ESLint\n\n'); }); }); enifed('ember-application/tests/system/engine_instance_test', ['exports', 'ember-application/system/engine', 'ember-application/system/engine-instance', 'ember-application/system/engine-parent', 'ember-metal', 'internal-test-helpers'], function (exports, _emberApplicationSystemEngine, _emberApplicationSystemEngineInstance, _emberApplicationSystemEngineParent, _emberMetal, _internalTestHelpers) { @@ -4061,21 +3986,13 @@ enifed('ember-application/tests/system/engine_instance_test', ['exports', 'ember assert.strictEqual(_emberApplicationSystemEngineParent.getEngineParent(chatEngineInstance), engineInstance, 'child engine instance is assigned the correct parent'); }); }); -enifed('ember-application/tests/system/engine_instance_test.jscs-test', ['exports'], function (exports) { +enifed('ember-application/tests/system/engine_instance_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-application/tests/system'); - test('ember-application/tests/system/engine_instance_test.js should pass jscs', function () { - ok(true, 'ember-application/tests/system/engine_instance_test.js should pass jscs.'); - }); -}); -enifed('ember-application/tests/system/engine_instance_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-application/tests/system'); - QUnit.test('ember-application/tests/system/engine_instance_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/tests/system/engine_instance_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/tests/system/engine_instance_test.js should pass jshint.'); + assert.ok(true, 'ember-application/tests/system/engine_instance_test.js should pass ESLint\n\n'); }); }); enifed('ember-application/tests/system/engine_parent_test', ['exports', 'ember-application/system/engine-parent'], function (exports, _emberApplicationSystemEngineParent) { @@ -4096,21 +4013,13 @@ enifed('ember-application/tests/system/engine_parent_test', ['exports', 'ember-a strictEqual(engine[_emberApplicationSystemEngineParent.ENGINE_PARENT], parent, 'parent has been set to the ENGINE_PARENT symbol'); }); }); -enifed('ember-application/tests/system/engine_parent_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-application/tests/system'); - test('ember-application/tests/system/engine_parent_test.js should pass jscs', function () { - ok(true, 'ember-application/tests/system/engine_parent_test.js should pass jscs.'); - }); -}); -enifed('ember-application/tests/system/engine_parent_test.jshint', ['exports'], function (exports) { +enifed('ember-application/tests/system/engine_parent_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-application/tests/system'); - QUnit.test('ember-application/tests/system/engine_parent_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/tests/system/engine_parent_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/tests/system/engine_parent_test.js should pass jshint.'); + assert.ok(true, 'ember-application/tests/system/engine_parent_test.js should pass ESLint\n\n'); }); }); enifed('ember-application/tests/system/engine_test', ['exports', 'ember-environment', 'ember-metal', 'ember-application/system/engine', 'ember-runtime', 'container', 'ember-application/tests/test-helpers/registry-check'], function (exports, _emberEnvironment, _emberMetal, _emberApplicationSystemEngine, _emberRuntime, _container, _emberApplicationTestsTestHelpersRegistryCheck) { @@ -4190,21 +4099,13 @@ enifed('ember-application/tests/system/engine_test', ['exports', 'ember-environm deepEqual(engine.registeredOptionsForType('helper'), { instantiate: false }, 'optionsForType \'helper\''); }); }); -enifed('ember-application/tests/system/engine_test.jscs-test', ['exports'], function (exports) { +enifed('ember-application/tests/system/engine_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-application/tests/system'); - test('ember-application/tests/system/engine_test.js should pass jscs', function () { - ok(true, 'ember-application/tests/system/engine_test.js should pass jscs.'); - }); -}); -enifed('ember-application/tests/system/engine_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-application/tests/system'); - QUnit.test('ember-application/tests/system/engine_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/tests/system/engine_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/tests/system/engine_test.js should pass jshint.'); + assert.ok(true, 'ember-application/tests/system/engine_test.js should pass ESLint\n\n'); }); }); enifed('ember-application/tests/system/initializers_test', ['exports', 'ember-metal', 'ember-application/system/application', 'ember-views'], function (exports, _emberMetal, _emberApplicationSystemApplication, _emberViews) { @@ -4629,21 +4530,13 @@ enifed('ember-application/tests/system/initializers_test', ['exports', 'ember-me }, /The `initialize` method for Application initializer 'deprecated' should take only one argument - `App`, an instance of an `Application`./); }); }); -enifed('ember-application/tests/system/initializers_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-application/tests/system'); - test('ember-application/tests/system/initializers_test.js should pass jscs', function () { - ok(true, 'ember-application/tests/system/initializers_test.js should pass jscs.'); - }); -}); -enifed('ember-application/tests/system/initializers_test.jshint', ['exports'], function (exports) { +enifed('ember-application/tests/system/initializers_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-application/tests/system'); - QUnit.test('ember-application/tests/system/initializers_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/tests/system/initializers_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/tests/system/initializers_test.js should pass jshint.'); + assert.ok(true, 'ember-application/tests/system/initializers_test.js should pass ESLint\n\n'); }); }); enifed('ember-application/tests/system/instance_initializers_test', ['exports', 'ember-metal', 'ember-application/system/application', 'ember-application/system/application-instance', 'ember-views'], function (exports, _emberMetal, _emberApplicationSystemApplication, _emberApplicationSystemApplicationInstance, _emberViews) { @@ -5059,21 +4952,13 @@ enifed('ember-application/tests/system/instance_initializers_test', ['exports', _emberMetal.run(app, 'reset'); }); }); -enifed('ember-application/tests/system/instance_initializers_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-application/tests/system'); - test('ember-application/tests/system/instance_initializers_test.js should pass jscs', function () { - ok(true, 'ember-application/tests/system/instance_initializers_test.js should pass jscs.'); - }); -}); -enifed('ember-application/tests/system/instance_initializers_test.jshint', ['exports'], function (exports) { +enifed('ember-application/tests/system/instance_initializers_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-application/tests/system'); - QUnit.test('ember-application/tests/system/instance_initializers_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/tests/system/instance_initializers_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/tests/system/instance_initializers_test.js should pass jshint.'); + assert.ok(true, 'ember-application/tests/system/instance_initializers_test.js should pass ESLint\n\n'); }); }); enifed('ember-application/tests/system/logging_test', ['exports', 'ember-console', 'ember-metal', 'ember-application/system/application', 'ember-runtime', 'ember-routing', 'ember-template-compiler'], function (exports, _emberConsole, _emberMetal, _emberApplicationSystemApplication, _emberRuntime, _emberRouting, _emberTemplateCompiler) { @@ -5289,21 +5174,13 @@ enifed('ember-application/tests/system/logging_test', ['exports', 'ember-console }); }); }); -enifed('ember-application/tests/system/logging_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-application/tests/system'); - test('ember-application/tests/system/logging_test.js should pass jscs', function () { - ok(true, 'ember-application/tests/system/logging_test.js should pass jscs.'); - }); -}); -enifed('ember-application/tests/system/logging_test.jshint', ['exports'], function (exports) { +enifed('ember-application/tests/system/logging_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-application/tests/system'); - QUnit.test('ember-application/tests/system/logging_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/tests/system/logging_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/tests/system/logging_test.js should pass jshint.'); + assert.ok(true, 'ember-application/tests/system/logging_test.js should pass ESLint\n\n'); }); }); enifed('ember-application/tests/system/readiness_test', ['exports', 'ember-metal', 'ember-application/system/application'], function (exports, _emberMetal, _emberApplicationSystemApplication) { @@ -5445,21 +5322,13 @@ enifed('ember-application/tests/system/readiness_test', ['exports', 'ember-metal }); }); }); -enifed('ember-application/tests/system/readiness_test.jscs-test', ['exports'], function (exports) { +enifed('ember-application/tests/system/readiness_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-application/tests/system'); - test('ember-application/tests/system/readiness_test.js should pass jscs', function () { - ok(true, 'ember-application/tests/system/readiness_test.js should pass jscs.'); - }); -}); -enifed('ember-application/tests/system/readiness_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-application/tests/system'); - QUnit.test('ember-application/tests/system/readiness_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/tests/system/readiness_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/tests/system/readiness_test.js should pass jshint.'); + assert.ok(true, 'ember-application/tests/system/readiness_test.js should pass ESLint\n\n'); }); }); enifed('ember-application/tests/system/reset_test', ['exports', 'ember-metal', 'ember-application/system/application', 'ember-runtime', 'ember-routing', 'container'], function (exports, _emberMetal, _emberApplicationSystemApplication, _emberRuntime, _emberRouting, _container) { @@ -5659,10 +5528,6 @@ enifed('ember-application/tests/system/reset_test', ['exports', 'ember-metal', ' }); QUnit.test('With ember-data like initializer and constant', function () { - var readyCallCount = undefined; - - readyCallCount = 0; - var DS = { Store: _emberRuntime.Object.extend({ init: function () { @@ -5703,21 +5568,13 @@ enifed('ember-application/tests/system/reset_test', ['exports', 'ember-metal', ' ok(application.__container__.lookup('store:main'), 'store is still present'); }); }); -enifed('ember-application/tests/system/reset_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-application/tests/system'); - test('ember-application/tests/system/reset_test.js should pass jscs', function () { - ok(true, 'ember-application/tests/system/reset_test.js should pass jscs.'); - }); -}); -enifed('ember-application/tests/system/reset_test.jshint', ['exports'], function (exports) { +enifed('ember-application/tests/system/reset_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-application/tests/system'); - QUnit.test('ember-application/tests/system/reset_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/tests/system/reset_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/tests/system/reset_test.js should pass jshint.'); + assert.ok(true, 'ember-application/tests/system/reset_test.js should pass ESLint\n\n'); }); }); enifed('ember-application/tests/system/visit_test', ['exports', 'ember-runtime', 'ember-metal', 'ember-application/system/application', 'ember-application/system/application-instance', 'ember-application/system/engine', 'ember-routing', 'ember-glimmer', 'ember-template-compiler', 'ember-views'], function (exports, _emberRuntime, _emberMetal, _emberApplicationSystemApplication, _emberApplicationSystemApplicationInstance, _emberApplicationSystemEngine, _emberRouting, _emberGlimmer, _emberTemplateCompiler, _emberViews) { @@ -6334,21 +6191,13 @@ enifed('ember-application/tests/system/visit_test', ['exports', 'ember-runtime', QUnit.skip('iframe setup', function (assert) {}); }); -enifed('ember-application/tests/system/visit_test.jscs-test', ['exports'], function (exports) { +enifed('ember-application/tests/system/visit_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-application/tests/system'); - test('ember-application/tests/system/visit_test.js should pass jscs', function () { - ok(true, 'ember-application/tests/system/visit_test.js should pass jscs.'); - }); -}); -enifed('ember-application/tests/system/visit_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-application/tests/system'); - QUnit.test('ember-application/tests/system/visit_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/tests/system/visit_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/tests/system/visit_test.js should pass jshint.'); + assert.ok(true, 'ember-application/tests/system/visit_test.js should pass ESLint\n\n'); }); }); enifed('ember-application/tests/test-helpers/registry-check', ['exports'], function (exports) { @@ -6386,89 +6235,49 @@ enifed('ember-application/tests/test-helpers/registry-check', ['exports'], funct ok(hasInjection, 'has injection: ' + fullName + '.' + property + ' = ' + injectionName); } }); -enifed('ember-application/tests/test-helpers/registry-check.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-application/tests/test-helpers'); - test('ember-application/tests/test-helpers/registry-check.js should pass jscs', function () { - ok(true, 'ember-application/tests/test-helpers/registry-check.js should pass jscs.'); - }); -}); -enifed('ember-application/tests/test-helpers/registry-check.jshint', ['exports'], function (exports) { +enifed('ember-application/tests/test-helpers/registry-check.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-application/tests/test-helpers'); - QUnit.test('ember-application/tests/test-helpers/registry-check.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/tests/test-helpers/registry-check.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/tests/test-helpers/registry-check.js should pass jshint.'); + assert.ok(true, 'ember-application/tests/test-helpers/registry-check.js should pass ESLint\n\n'); }); }); -enifed('ember-application/utils/validate-type.jscs-test', ['exports'], function (exports) { +enifed('ember-application/utils/validate-type.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-application/utils'); - test('ember-application/utils/validate-type.js should pass jscs', function () { - ok(true, 'ember-application/utils/validate-type.js should pass jscs.'); - }); -}); -enifed('ember-application/utils/validate-type.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-application/utils'); - QUnit.test('ember-application/utils/validate-type.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-application/utils/validate-type.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-application/utils/validate-type.js should pass jshint.'); - }); -}); -enifed('ember-debug/deprecate.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-debug'); - test('ember-debug/deprecate.js should pass jscs', function () { - ok(true, 'ember-debug/deprecate.js should pass jscs.'); + assert.ok(true, 'ember-application/utils/validate-type.js should pass ESLint\n\n'); }); }); -enifed('ember-debug/deprecate.jshint', ['exports'], function (exports) { +enifed('ember-debug/deprecate.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-debug'); - QUnit.test('ember-debug/deprecate.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-debug/deprecate.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-debug/deprecate.js should pass jshint.'); + assert.ok(true, 'ember-debug/deprecate.js should pass ESLint\n\n'); }); }); -enifed('ember-debug/handlers.jscs-test', ['exports'], function (exports) { +enifed('ember-debug/handlers.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-debug'); - test('ember-debug/handlers.js should pass jscs', function () { - ok(true, 'ember-debug/handlers.js should pass jscs.'); - }); -}); -enifed('ember-debug/handlers.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-debug'); - QUnit.test('ember-debug/handlers.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-debug/handlers.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-debug/handlers.js should pass jshint.'); - }); -}); -enifed('ember-debug/index.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-debug'); - test('ember-debug/index.js should pass jscs', function () { - ok(true, 'ember-debug/index.js should pass jscs.'); + assert.ok(true, 'ember-debug/handlers.js should pass ESLint\n\n'); }); }); -enifed('ember-debug/index.jshint', ['exports'], function (exports) { +enifed('ember-debug/index.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-debug'); - QUnit.test('ember-debug/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-debug/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-debug/index.js should pass jshint.'); + assert.ok(true, 'ember-debug/index.js should pass ESLint\n\n'); }); }); enifed('ember-debug/tests/handlers-test', ['exports', 'ember-debug/handlers'], function (exports, _emberDebugHandlers) { @@ -6615,21 +6424,13 @@ enifed('ember-debug/tests/handlers-test', ['exports', 'ember-debug/handlers'], f _emberDebugHandlers.invoke('blarz', initialMessage, false, initialOptions); }); }); -enifed('ember-debug/tests/handlers-test.jscs-test', ['exports'], function (exports) { +enifed('ember-debug/tests/handlers-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-debug/tests'); - test('ember-debug/tests/handlers-test.js should pass jscs', function () { - ok(true, 'ember-debug/tests/handlers-test.js should pass jscs.'); - }); -}); -enifed('ember-debug/tests/handlers-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-debug/tests'); - QUnit.test('ember-debug/tests/handlers-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-debug/tests/handlers-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-debug/tests/handlers-test.js should pass jshint.'); + assert.ok(true, 'ember-debug/tests/handlers-test.js should pass ESLint\n\n'); }); }); enifed('ember-debug/tests/main_test', ['exports', 'ember-environment', 'ember-runtime', 'ember-debug/handlers', 'ember-debug/deprecate', 'ember-debug/warn', 'ember-metal'], function (exports, _emberEnvironment, _emberRuntime, _emberDebugHandlers, _emberDebugDeprecate, _emberDebugWarn, _emberMetal) { @@ -6834,21 +6635,13 @@ enifed('ember-debug/tests/main_test', ['exports', 'ember-environment', 'ember-ru }); }); }); -enifed('ember-debug/tests/main_test.jscs-test', ['exports'], function (exports) { +enifed('ember-debug/tests/main_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-debug/tests'); - test('ember-debug/tests/main_test.js should pass jscs', function () { - ok(true, 'ember-debug/tests/main_test.js should pass jscs.'); - }); -}); -enifed('ember-debug/tests/main_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-debug/tests'); - QUnit.test('ember-debug/tests/main_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-debug/tests/main_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-debug/tests/main_test.js should pass jshint.'); + assert.ok(true, 'ember-debug/tests/main_test.js should pass ESLint\n\n'); }); }); enifed('ember-debug/tests/warn_if_using_stripped_feature_flags_test', ['exports', 'ember-environment', 'ember-metal', 'ember-debug/index'], function (exports, _emberEnvironment, _emberMetal, _emberDebugIndex) { @@ -6946,47 +6739,31 @@ enifed('ember-debug/tests/warn_if_using_stripped_feature_flags_test', ['exports' confirmWarns(); }); }); -enifed('ember-debug/tests/warn_if_using_stripped_feature_flags_test.jscs-test', ['exports'], function (exports) { +enifed('ember-debug/tests/warn_if_using_stripped_feature_flags_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-debug/tests'); - test('ember-debug/tests/warn_if_using_stripped_feature_flags_test.js should pass jscs', function () { - ok(true, 'ember-debug/tests/warn_if_using_stripped_feature_flags_test.js should pass jscs.'); - }); -}); -enifed('ember-debug/tests/warn_if_using_stripped_feature_flags_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-debug/tests'); - QUnit.test('ember-debug/tests/warn_if_using_stripped_feature_flags_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-debug/tests/warn_if_using_stripped_feature_flags_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-debug/tests/warn_if_using_stripped_feature_flags_test.js should pass jshint.'); - }); -}); -enifed('ember-debug/warn.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-debug'); - test('ember-debug/warn.js should pass jscs', function () { - ok(true, 'ember-debug/warn.js should pass jscs.'); + assert.ok(true, 'ember-debug/tests/warn_if_using_stripped_feature_flags_test.js should pass ESLint\n\n'); }); }); -enifed('ember-debug/warn.jshint', ['exports'], function (exports) { +enifed('ember-debug/warn.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-debug'); - QUnit.test('ember-debug/warn.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-debug/warn.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-debug/warn.js should pass jshint.'); + assert.ok(true, 'ember-debug/warn.js should pass ESLint\n\n'); }); }); enifed('ember-dev/test-helper/assertion', ['exports', 'ember-dev/test-helper/utils'], function (exports, _emberDevTestHelperUtils) { - /* globals QUnit */ - 'use strict'; exports.default = AssertionAssert; + /* globals QUnit */ + var BREAK = {}; /** @@ -7006,19 +6783,18 @@ enifed('ember-dev/test-helper/assertion', ['exports', 'ember-dev/test-helper/uti In particular, this prevents `Ember.assert` from throw errors that would disrupt the control flow. */ - function AssertionAssert(env) { this.env = env; } AssertionAssert.prototype = { - reset: function () {}, - assert: function () {}, + reset: function reset() {}, + assert: function assert() {}, - inject: function () { + inject: function inject() { var _this = this; - var expectAssertion = function (func, expectedMessage) { + var expectAssertion = function expectAssertion(func, expectedMessage) { if (_this.env.runningProdBuild) { QUnit.ok(true, 'Assertions disabled in production builds.'); return; @@ -7047,7 +6823,7 @@ enifed('ember-dev/test-helper/assertion', ['exports', 'ember-dev/test-helper/uti assert(sawCall, actualMessage, expectedMessage); }; - var ignoreAssertion = function (func) { + var ignoreAssertion = function ignoreAssertion(func) { _emberDevTestHelperUtils.callWithStub(_this.env, 'assert', func); }; @@ -7055,7 +6831,7 @@ enifed('ember-dev/test-helper/assertion', ['exports', 'ember-dev/test-helper/uti window.ignoreAssertion = ignoreAssertion; }, - restore: function () { + restore: function restore() { window.expectAssertion = null; window.ignoreAssertion = null; } @@ -7084,61 +6860,86 @@ enifed('ember-dev/test-helper/assertion', ['exports', 'ember-dev/test-helper/uti enifed('ember-dev/test-helper/debug', ['exports', 'ember-dev/test-helper/method-call-tracker'], function (exports, _emberDevTestHelperMethodCallTracker) { 'use strict'; + var _createClass = (function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ('value' in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); + } + }return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; + }; + })(); + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + var DebugAssert = (function () { function DebugAssert(methodName, env) { + _classCallCheck(this, DebugAssert); + this.methodName = methodName; this.env = env; } - DebugAssert.prototype.inject = function inject() {}; - - DebugAssert.prototype.restore = function restore() { - this.reset(); - }; - - DebugAssert.prototype.reset = function reset() { - if (this.tracker) { - this.tracker.restoreMethod(); + _createClass(DebugAssert, [{ + key: 'inject', + value: function inject() {} + }, { + key: 'restore', + value: function restore() { + this.reset(); } + }, { + key: 'reset', + value: function reset() { + if (this.tracker) { + this.tracker.restoreMethod(); + } - this.tracker = null; - }; - - DebugAssert.prototype.assert = function assert() { - if (this.tracker) { - this.tracker.assert(); + this.tracker = null; + } + }, { + key: 'assert', + value: function assert() { + if (this.tracker) { + this.tracker.assert(); + } } - }; - - // Run an expectation callback within the context of a new tracker, optionally - // accepting a function to run, which asserts immediately - DebugAssert.prototype.runExpectation = function runExpectation(func, callback) { - var originalTracker = undefined; + // Run an expectation callback within the context of a new tracker, optionally + // accepting a function to run, which asserts immediately + }, { + key: 'runExpectation', + value: function runExpectation(func, callback) { + var originalTracker = undefined; - // When helpers are passed a callback, they get a new tracker context - if (func) { - originalTracker = this.tracker; - this.tracker = null; - } + // When helpers are passed a callback, they get a new tracker context + if (func) { + originalTracker = this.tracker; + this.tracker = null; + } - if (!this.tracker) { - this.tracker = new _emberDevTestHelperMethodCallTracker.default(this.env, this.methodName); - } + if (!this.tracker) { + this.tracker = new _emberDevTestHelperMethodCallTracker.default(this.env, this.methodName); + } - // Yield to caller with tracker instance - callback(this.tracker); + // Yield to caller with tracker instance + callback(this.tracker); - // Once the given callback is invoked, the pending assertions should be - // flushed immediately - if (func) { - func(); - this.assert(); - this.reset(); + // Once the given callback is invoked, the pending assertions should be + // flushed immediately + if (func) { + func(); + this.assert(); + this.reset(); - this.tracker = originalTracker; + this.tracker = originalTracker; + } } - }; + }]); return DebugAssert; })(); @@ -7148,82 +6949,130 @@ enifed('ember-dev/test-helper/debug', ['exports', 'ember-dev/test-helper/method- enifed('ember-dev/test-helper/deprecation', ['exports', 'ember-dev/test-helper/debug', 'ember-dev/test-helper/utils'], function (exports, _emberDevTestHelperDebug, _emberDevTestHelperUtils) { 'use strict'; + var _createClass = (function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ('value' in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); + } + }return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; + }; + })(); + + var _get = function get(_x, _x2, _x3) { + var _again = true;_function: while (_again) { + var object = _x, + property = _x2, + receiver = _x3;_again = false;if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { + var parent = Object.getPrototypeOf(object);if (parent === null) { + return undefined; + } else { + _x = parent;_x2 = property;_x3 = receiver;_again = true;desc = parent = undefined;continue _function; + } + } else if ('value' in desc) { + return desc.value; + } else { + var getter = desc.get;if (getter === undefined) { + return undefined; + }return getter.call(receiver); + } + } + }; + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : babelHelpers.defaults(subClass, superClass); + } + var DeprecationAssert = (function (_DebugAssert) { - babelHelpers.inherits(DeprecationAssert, _DebugAssert); + _inherits(DeprecationAssert, _DebugAssert); function DeprecationAssert(env) { - _DebugAssert.call(this, 'deprecate', env); - } + _classCallCheck(this, DeprecationAssert); - DeprecationAssert.prototype.inject = function inject() { - var _this = this; + _get(Object.getPrototypeOf(DeprecationAssert.prototype), 'constructor', this).call(this, 'deprecate', env); + } - // Expects no deprecation to happen within a function, or if no function is - // passed, from the time of calling until the end of the test. - // - // expectNoDeprecation(function() { - // fancyNewThing(); - // }); - // - // expectNoDeprecation(); - // Ember.deprecate("Old And Busted"); - // - var expectNoDeprecation = function (func) { - if (typeof func !== 'function') { - func = null; - } + _createClass(DeprecationAssert, [{ + key: 'inject', + value: function inject() { + var _this = this; - _this.runExpectation(func, function (tracker) { - if (tracker.isExpectingCalls()) { - throw new Error("expectNoDeprecation was called after expectDeprecation was called!"); + // Expects no deprecation to happen within a function, or if no function is + // passed, from the time of calling until the end of the test. + // + // expectNoDeprecation(function() { + // fancyNewThing(); + // }); + // + // expectNoDeprecation(); + // Ember.deprecate("Old And Busted"); + // + var expectNoDeprecation = function expectNoDeprecation(func) { + if (typeof func !== 'function') { + func = null; } - tracker.expectNoCalls(); - }); - }; + _this.runExpectation(func, function (tracker) { + if (tracker.isExpectingCalls()) { + throw new Error("expectNoDeprecation was called after expectDeprecation was called!"); + } - // Expect a deprecation to happen within a function, or if no function - // is pass, from the time of calling until the end of the test. Can be called - // multiple times to assert deprecations with different specific messages - // were fired. - // - // expectDeprecation(function() { - // Ember.deprecate("Old And Busted"); - // }, /* optionalStringOrRegex */); - // - // expectDeprecation(/* optionalStringOrRegex */); - // Ember.deprecate("Old And Busted"); - // - var expectDeprecation = function (func, message) { - if (typeof func !== 'function') { - message = func; - func = null; - } + tracker.expectNoCalls(); + }); + }; - _this.runExpectation(func, function (tracker) { - if (tracker.isExpectingNoCalls()) { - throw new Error("expectDeprecation was called after expectNoDeprecation was called!"); + // Expect a deprecation to happen within a function, or if no function + // is pass, from the time of calling until the end of the test. Can be called + // multiple times to assert deprecations with different specific messages + // were fired. + // + // expectDeprecation(function() { + // Ember.deprecate("Old And Busted"); + // }, /* optionalStringOrRegex */); + // + // expectDeprecation(/* optionalStringOrRegex */); + // Ember.deprecate("Old And Busted"); + // + var expectDeprecation = function expectDeprecation(func, message) { + if (typeof func !== 'function') { + message = func; + func = null; } - tracker.expectCall(message); - }); - }; + _this.runExpectation(func, function (tracker) { + if (tracker.isExpectingNoCalls()) { + throw new Error("expectDeprecation was called after expectNoDeprecation was called!"); + } - var ignoreDeprecation = function (func) { - _emberDevTestHelperUtils.callWithStub(_this.env, 'deprecate', func); - }; + tracker.expectCall(message); + }); + }; - window.expectNoDeprecation = expectNoDeprecation; - window.expectDeprecation = expectDeprecation; - window.ignoreDeprecation = ignoreDeprecation; - }; + var ignoreDeprecation = function ignoreDeprecation(func) { + _emberDevTestHelperUtils.callWithStub(_this.env, 'deprecate', func); + }; - DeprecationAssert.prototype.restore = function restore() { - _DebugAssert.prototype.restore.call(this); - window.expectDeprecation = null; - window.expectNoDeprecation = null; - window.ignoreDeprecation = null; - }; + window.expectNoDeprecation = expectNoDeprecation; + window.expectDeprecation = expectDeprecation; + window.ignoreDeprecation = ignoreDeprecation; + } + }, { + key: 'restore', + value: function restore() { + _get(Object.getPrototypeOf(DeprecationAssert.prototype), 'restore', this).call(this); + window.expectDeprecation = null; + window.expectNoDeprecation = null; + window.ignoreDeprecation = null; + } + }]); return DeprecationAssert; })(_emberDevTestHelperDebug.default); @@ -7242,7 +7091,7 @@ enifed('ember-dev/test-helper/method-call-tracker', ['exports', 'ember-dev/test- 'use strict'; - var MethodCallTracker = function (env, methodName) { + var MethodCallTracker = function MethodCallTracker(env, methodName) { this._env = env; this._methodName = methodName; this._isExpectingNoCalls = false; @@ -7251,7 +7100,7 @@ enifed('ember-dev/test-helper/method-call-tracker', ['exports', 'ember-dev/test- }; MethodCallTracker.prototype = { - stubMethod: function () { + stubMethod: function stubMethod() { var _this = this; if (this._originalMethod) { @@ -7271,31 +7120,31 @@ enifed('ember-dev/test-helper/method-call-tracker', ['exports', 'ember-dev/test- }); }, - restoreMethod: function () { + restoreMethod: function restoreMethod() { if (this._originalMethod) { this._env.setDebugFunction(this._methodName, this._originalMethod); } }, - expectCall: function (message) { + expectCall: function expectCall(message) { this.stubMethod(); this._expecteds.push(message || /.*/); }, - expectNoCalls: function () { + expectNoCalls: function expectNoCalls() { this.stubMethod(); this._isExpectingNoCalls = true; }, - isExpectingNoCalls: function () { + isExpectingNoCalls: function isExpectingNoCalls() { return this._isExpectingNoCalls; }, - isExpectingCalls: function () { + isExpectingCalls: function isExpectingCalls() { return !this._isExpectingNoCalls && this._expecteds.length; }, - assert: function () { + assert: function assert() { var env = this._env; var methodName = this._methodName; var isExpectingNoCalls = this._isExpectingNoCalls; @@ -7348,9 +7197,9 @@ enifed('ember-dev/test-helper/method-call-tracker', ['exports', 'ember-dev/test- } if (!actual) { - QUnit.ok(false, 'Recieved no Ember.' + methodName + ' calls at all, expecting: ' + expected); + QUnit.ok(false, 'Received no Ember.' + methodName + ' calls at all, expecting: ' + expected); } else if (match && !match[1]) { - QUnit.ok(true, 'Recieved failing Ember.' + methodName + ' call with message: ' + match[0]); + QUnit.ok(true, 'Received failing Ember.' + methodName + ' call with message: ' + match[0]); } else if (match && match[1]) { QUnit.ok(false, 'Expected failing Ember.' + methodName + ' call, got succeeding with message: ' + match[0]); } else if (actual[1]) { @@ -7369,14 +7218,14 @@ enifed("ember-dev/test-helper/remaining-template", ["exports"], function (export "use strict"; - var RemainingTemplateAssert = function (env) { + var RemainingTemplateAssert = function RemainingTemplateAssert(env) { this.env = env; }; RemainingTemplateAssert.prototype = { - reset: function () {}, - inject: function () {}, - assert: function () { + reset: function reset() {}, + inject: function inject() {}, + assert: function assert() { if (this.env.Ember && this.env.Ember.TEMPLATES) { var templateNames = [], name; @@ -7392,7 +7241,7 @@ enifed("ember-dev/test-helper/remaining-template", ["exports"], function (export } } }, - restore: function () {} + restore: function restore() {} }; exports.default = RemainingTemplateAssert; @@ -7402,14 +7251,14 @@ enifed("ember-dev/test-helper/remaining-view", ["exports"], function (exports) { "use strict"; - var RemainingViewAssert = function (env) { + var RemainingViewAssert = function RemainingViewAssert(env) { this.env = env; }; RemainingViewAssert.prototype = { - reset: function () {}, - inject: function () {}, - assert: function () { + reset: function reset() {}, + inject: function inject() {}, + assert: function assert() { if (this.env.Ember && this.env.Ember.View) { var viewIds = [], id; @@ -7425,7 +7274,7 @@ enifed("ember-dev/test-helper/remaining-view", ["exports"], function (exports) { } } }, - restore: function () {} + restore: function restore() {} }; exports.default = RemainingViewAssert; @@ -7440,9 +7289,9 @@ enifed("ember-dev/test-helper/run-loop", ["exports"], function (exports) { } RunLoopAssertion.prototype = { - reset: function () {}, - inject: function () {}, - assert: function () { + reset: function reset() {}, + inject: function inject() {}, + assert: function assert() { var run = this.env.Ember.run; if (run.currentRunLoop) { @@ -7457,18 +7306,17 @@ enifed("ember-dev/test-helper/run-loop", ["exports"], function (exports) { run.cancelTimers(); } }, - restore: function () {} + restore: function restore() {} }; exports.default = RunLoopAssertion; }); enifed("ember-dev/test-helper/setup-qunit", ["exports"], function (exports) { - /* globals QUnit */ - "use strict"; exports.default = setupQUnit; + /* globals QUnit */ function setupQUnit(assertion, _qunitGlobal) { var qunitGlobal = QUnit; @@ -7487,11 +7335,11 @@ enifed("ember-dev/test-helper/setup-qunit", ["exports"], function (exports) { assertion.reset(); assertion.inject(); - originalSetup.call(this); + originalSetup.apply(this, arguments); }; options.teardown = function () { - originalTeardown.call(this); + originalTeardown.apply(this, arguments); assertion.assert(); assertion.restore(); @@ -7507,6 +7355,7 @@ enifed('ember-dev/test-helper/utils', ['exports'], function (exports) { exports.buildCompositeAssert = buildCompositeAssert; exports.callWithStub = callWithStub; exports.checkTest = checkTest; + function callForEach(prop, func) { return function () { for (var i = 0, l = this[prop].length; i < l; i++) { @@ -7553,137 +7402,161 @@ enifed('ember-dev/test-helper/utils', ['exports'], function (exports) { enifed('ember-dev/test-helper/warning', ['exports', 'ember-dev/test-helper/debug', 'ember-dev/test-helper/utils'], function (exports, _emberDevTestHelperDebug, _emberDevTestHelperUtils) { 'use strict'; + var _createClass = (function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ('value' in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); + } + }return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; + }; + })(); + + var _get = function get(_x, _x2, _x3) { + var _again = true;_function: while (_again) { + var object = _x, + property = _x2, + receiver = _x3;_again = false;if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { + var parent = Object.getPrototypeOf(object);if (parent === null) { + return undefined; + } else { + _x = parent;_x2 = property;_x3 = receiver;_again = true;desc = parent = undefined;continue _function; + } + } else if ('value' in desc) { + return desc.value; + } else { + var getter = desc.get;if (getter === undefined) { + return undefined; + }return getter.call(receiver); + } + } + }; + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); + }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : babelHelpers.defaults(subClass, superClass); + } + var WarningAssert = (function (_DebugAssert) { - babelHelpers.inherits(WarningAssert, _DebugAssert); + _inherits(WarningAssert, _DebugAssert); function WarningAssert(env) { - _DebugAssert.call(this, 'warn', env); - } + _classCallCheck(this, WarningAssert); - WarningAssert.prototype.inject = function inject() { - var _this = this; + _get(Object.getPrototypeOf(WarningAssert.prototype), 'constructor', this).call(this, 'warn', env); + } - // Expects no warning to happen within a function, or if no function is - // passed, from the time of calling until the end of the test. - // - // expectNoWarning(function() { - // fancyNewThing(); - // }); - // - // expectNoWarning(); - // Ember.warn("Oh snap, didn't expect that"); - // - var expectNoWarning = function (func) { - if (typeof func !== 'function') { - func = null; - } + _createClass(WarningAssert, [{ + key: 'inject', + value: function inject() { + var _this = this; - _this.runExpectation(func, function (tracker) { - if (tracker.isExpectingCalls()) { - throw new Error("expectNoWarning was called after expectWarning was called!"); + // Expects no warning to happen within a function, or if no function is + // passed, from the time of calling until the end of the test. + // + // expectNoWarning(function() { + // fancyNewThing(); + // }); + // + // expectNoWarning(); + // Ember.warn("Oh snap, didn't expect that"); + // + var expectNoWarning = function expectNoWarning(func) { + if (typeof func !== 'function') { + func = null; } - tracker.expectNoCalls(); - }); - }; + _this.runExpectation(func, function (tracker) { + if (tracker.isExpectingCalls()) { + throw new Error("expectNoWarning was called after expectWarning was called!"); + } - // Expect a warning to happen within a function, or if no function is - // passed, from the time of calling until the end of the test. Can be called - // multiple times to assert warnings with different specific messages - // happened. - // - // expectWarning(function() { - // Ember.warn("Times they are a-changin'"); - // }, /* optionalStringOrRegex */); - // - // expectWarning(/* optionalStringOrRegex */); - // Ember.warn("Times definitely be changin'"); - // - var expectWarning = function (fn, message) { - if (typeof fn !== 'function') { - message = fn; - fn = null; - } + tracker.expectNoCalls(); + }); + }; - _this.runExpectation(fn, function (tracker) { - if (tracker.isExpectingNoCalls()) { - throw new Error("expectWarning was called after expectNoWarning was called!"); + // Expect a warning to happen within a function, or if no function is + // passed, from the time of calling until the end of the test. Can be called + // multiple times to assert warnings with different specific messages + // happened. + // + // expectWarning(function() { + // Ember.warn("Times they are a-changin'"); + // }, /* optionalStringOrRegex */); + // + // expectWarning(/* optionalStringOrRegex */); + // Ember.warn("Times definitely be changin'"); + // + var expectWarning = function expectWarning(fn, message) { + if (typeof fn !== 'function') { + message = fn; + fn = null; } - tracker.expectCall(message); - }); - }; + _this.runExpectation(fn, function (tracker) { + if (tracker.isExpectingNoCalls()) { + throw new Error("expectWarning was called after expectNoWarning was called!"); + } - var ignoreWarning = function (func) { - _emberDevTestHelperUtils.callWithStub(_this.env, 'warn', func); - }; + tracker.expectCall(message); + }); + }; - window.expectNoWarning = expectNoWarning; - window.expectWarning = expectWarning; - window.ignoreWarning = ignoreWarning; - }; + var ignoreWarning = function ignoreWarning(func) { + _emberDevTestHelperUtils.callWithStub(_this.env, 'warn', func); + }; - WarningAssert.prototype.restore = function restore() { - _DebugAssert.prototype.restore.call(this); - window.expectWarning = null; - window.expectNoWarning = null; - window.ignoreWarning = null; - }; + window.expectNoWarning = expectNoWarning; + window.expectWarning = expectWarning; + window.ignoreWarning = ignoreWarning; + } + }, { + key: 'restore', + value: function restore() { + _get(Object.getPrototypeOf(WarningAssert.prototype), 'restore', this).call(this); + window.expectWarning = null; + window.expectNoWarning = null; + window.ignoreWarning = null; + } + }]); return WarningAssert; })(_emberDevTestHelperDebug.default); exports.default = WarningAssert; }); -enifed('ember-extension-support/container_debug_adapter.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-extension-support'); - test('ember-extension-support/container_debug_adapter.js should pass jscs', function () { - ok(true, 'ember-extension-support/container_debug_adapter.js should pass jscs.'); - }); -}); -enifed('ember-extension-support/container_debug_adapter.jshint', ['exports'], function (exports) { +enifed('ember-extension-support/container_debug_adapter.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-extension-support'); - QUnit.test('ember-extension-support/container_debug_adapter.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-extension-support/container_debug_adapter.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-extension-support/container_debug_adapter.js should pass jshint.'); - }); -}); -enifed('ember-extension-support/data_adapter.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-extension-support'); - test('ember-extension-support/data_adapter.js should pass jscs', function () { - ok(true, 'ember-extension-support/data_adapter.js should pass jscs.'); + assert.ok(true, 'ember-extension-support/container_debug_adapter.js should pass ESLint\n\n'); }); }); -enifed('ember-extension-support/data_adapter.jshint', ['exports'], function (exports) { +enifed('ember-extension-support/data_adapter.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-extension-support'); - QUnit.test('ember-extension-support/data_adapter.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-extension-support/data_adapter.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-extension-support/data_adapter.js should pass jshint.'); - }); -}); -enifed('ember-extension-support/index.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-extension-support'); - test('ember-extension-support/index.js should pass jscs', function () { - ok(true, 'ember-extension-support/index.js should pass jscs.'); + assert.ok(true, 'ember-extension-support/data_adapter.js should pass ESLint\n\n'); }); }); -enifed('ember-extension-support/index.jshint', ['exports'], function (exports) { +enifed('ember-extension-support/index.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-extension-support'); - QUnit.test('ember-extension-support/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-extension-support/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-extension-support/index.js should pass jshint.'); + assert.ok(true, 'ember-extension-support/index.js should pass ESLint\n\n'); }); }); enifed('ember-extension-support/tests/container_debug_adapter_test', ['exports', 'ember-metal', 'ember-runtime', 'ember-extension-support/index', 'ember-application'], function (exports, _emberMetal, _emberRuntime, _emberExtensionSupportIndex, _emberApplication) { @@ -7742,21 +7615,13 @@ enifed('ember-extension-support/tests/container_debug_adapter_test', ['exports', }); }); // Must be required to export Ember.ContainerDebugAdapter. -enifed('ember-extension-support/tests/container_debug_adapter_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-extension-support/tests'); - test('ember-extension-support/tests/container_debug_adapter_test.js should pass jscs', function () { - ok(true, 'ember-extension-support/tests/container_debug_adapter_test.js should pass jscs.'); - }); -}); -enifed('ember-extension-support/tests/container_debug_adapter_test.jshint', ['exports'], function (exports) { +enifed('ember-extension-support/tests/container_debug_adapter_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-extension-support/tests'); - QUnit.test('ember-extension-support/tests/container_debug_adapter_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-extension-support/tests/container_debug_adapter_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-extension-support/tests/container_debug_adapter_test.js should pass jshint.'); + assert.ok(true, 'ember-extension-support/tests/container_debug_adapter_test.js should pass ESLint\n\n'); }); }); enifed('ember-extension-support/tests/data_adapter_test', ['exports', 'ember-metal', 'ember-runtime', 'ember-extension-support/data_adapter', 'ember-application'], function (exports, _emberMetal, _emberRuntime, _emberExtensionSupportData_adapter, _emberApplication) { @@ -7977,718 +7842,409 @@ enifed('ember-extension-support/tests/data_adapter_test', ['exports', 'ember-met equal(updatesCalled, 1, 'Release function removes observers'); }); }); -enifed('ember-extension-support/tests/data_adapter_test.jscs-test', ['exports'], function (exports) { +enifed('ember-extension-support/tests/data_adapter_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-extension-support/tests'); - test('ember-extension-support/tests/data_adapter_test.js should pass jscs', function () { - ok(true, 'ember-extension-support/tests/data_adapter_test.js should pass jscs.'); - }); -}); -enifed('ember-extension-support/tests/data_adapter_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-extension-support/tests'); - QUnit.test('ember-extension-support/tests/data_adapter_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-extension-support/tests/data_adapter_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-extension-support/tests/data_adapter_test.js should pass jshint.'); + assert.ok(true, 'ember-extension-support/tests/data_adapter_test.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/component.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/component.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer'); - test('ember-glimmer/component.js should pass jscs', function () { - ok(true, 'ember-glimmer/component.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/component.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer'); - QUnit.test('ember-glimmer/component.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/component.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/component.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/components/checkbox.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/components'); - test('ember-glimmer/components/checkbox.js should pass jscs', function () { - ok(true, 'ember-glimmer/components/checkbox.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/component.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/components/checkbox.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/components/checkbox.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/components'); - QUnit.test('ember-glimmer/components/checkbox.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/components/checkbox.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/components/checkbox.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/components/link-to.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/components'); - test('ember-glimmer/components/link-to.js should pass jscs', function () { - ok(true, 'ember-glimmer/components/link-to.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/components/checkbox.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/components/link-to.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/components/link-to.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/components'); - QUnit.test('ember-glimmer/components/link-to.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/components/link-to.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/components/link-to.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/components/link-to.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/components/text_area.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/components/text_area.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/components'); - test('ember-glimmer/components/text_area.js should pass jscs', function () { - ok(true, 'ember-glimmer/components/text_area.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/components/text_area.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/components'); - QUnit.test('ember-glimmer/components/text_area.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/components/text_area.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/components/text_area.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/components/text_field.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/components'); - test('ember-glimmer/components/text_field.js should pass jscs', function () { - ok(true, 'ember-glimmer/components/text_field.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/components/text_area.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/components/text_field.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/components/text_field.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/components'); - QUnit.test('ember-glimmer/components/text_field.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/components/text_field.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/components/text_field.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/dom.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer'); - test('ember-glimmer/dom.js should pass jscs', function () { - ok(true, 'ember-glimmer/dom.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/components/text_field.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/dom.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/dom.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer'); - QUnit.test('ember-glimmer/dom.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/dom.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/dom.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/environment.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer'); - test('ember-glimmer/environment.js should pass jscs', function () { - ok(true, 'ember-glimmer/environment.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/dom.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/environment.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/environment.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer'); - QUnit.test('ember-glimmer/environment.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/environment.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/environment.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/helper.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer'); - test('ember-glimmer/helper.js should pass jscs', function () { - ok(true, 'ember-glimmer/helper.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/environment.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/helper.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/helper.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer'); - QUnit.test('ember-glimmer/helper.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/helper.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/helper.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/helper.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/helpers/-class.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/helpers/-class.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/helpers'); - test('ember-glimmer/helpers/-class.js should pass jscs', function () { - ok(true, 'ember-glimmer/helpers/-class.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/helpers/-class.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/helpers'); - QUnit.test('ember-glimmer/helpers/-class.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/helpers/-class.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/helpers/-class.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/helpers/-class.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/helpers/-html-safe.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/helpers/-html-safe.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/helpers'); - test('ember-glimmer/helpers/-html-safe.js should pass jscs', function () { - ok(true, 'ember-glimmer/helpers/-html-safe.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/helpers/-html-safe.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/helpers'); - QUnit.test('ember-glimmer/helpers/-html-safe.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/helpers/-html-safe.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/helpers/-html-safe.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/helpers/-html-safe.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/helpers/-input-type.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/helpers/-input-type.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/helpers'); - test('ember-glimmer/helpers/-input-type.js should pass jscs', function () { - ok(true, 'ember-glimmer/helpers/-input-type.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/helpers/-input-type.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/helpers'); - QUnit.test('ember-glimmer/helpers/-input-type.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/helpers/-input-type.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/helpers/-input-type.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/helpers/-normalize-class.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/helpers'); - test('ember-glimmer/helpers/-normalize-class.js should pass jscs', function () { - ok(true, 'ember-glimmer/helpers/-normalize-class.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/helpers/-input-type.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/helpers/-normalize-class.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/helpers/-normalize-class.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/helpers'); - QUnit.test('ember-glimmer/helpers/-normalize-class.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/helpers/-normalize-class.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/helpers/-normalize-class.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/helpers/-normalize-class.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/helpers/action.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/helpers/action.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/helpers'); - test('ember-glimmer/helpers/action.js should pass jscs', function () { - ok(true, 'ember-glimmer/helpers/action.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/helpers/action.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/helpers'); - QUnit.test('ember-glimmer/helpers/action.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/helpers/action.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/helpers/action.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/helpers/action.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/helpers/component.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/helpers/component.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/helpers'); - test('ember-glimmer/helpers/component.js should pass jscs', function () { - ok(true, 'ember-glimmer/helpers/component.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/helpers/component.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/helpers'); - QUnit.test('ember-glimmer/helpers/component.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/helpers/component.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/helpers/component.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/helpers/concat.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/helpers'); - test('ember-glimmer/helpers/concat.js should pass jscs', function () { - ok(true, 'ember-glimmer/helpers/concat.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/helpers/component.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/helpers/concat.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/helpers/concat.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/helpers'); - QUnit.test('ember-glimmer/helpers/concat.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/helpers/concat.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/helpers/concat.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/helpers/debugger.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/helpers'); - test('ember-glimmer/helpers/debugger.js should pass jscs', function () { - ok(true, 'ember-glimmer/helpers/debugger.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/helpers/concat.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/helpers/debugger.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/helpers/each-in.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/helpers'); - QUnit.test('ember-glimmer/helpers/debugger.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/helpers/each-in.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/helpers/debugger.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/helpers/each-in.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/helpers'); - test('ember-glimmer/helpers/each-in.js should pass jscs', function () { - ok(true, 'ember-glimmer/helpers/each-in.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/helpers/each-in.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/helpers/each-in.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/helpers/get.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/helpers'); - QUnit.test('ember-glimmer/helpers/each-in.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/helpers/get.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/helpers/each-in.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/helpers/get.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/helpers/get.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/helpers/hash.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/helpers'); - test('ember-glimmer/helpers/get.js should pass jscs', function () { - ok(true, 'ember-glimmer/helpers/get.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/helpers/get.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/helpers'); - QUnit.test('ember-glimmer/helpers/get.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/helpers/hash.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/helpers/get.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/helpers/hash.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/helpers'); - test('ember-glimmer/helpers/hash.js should pass jscs', function () { - ok(true, 'ember-glimmer/helpers/hash.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/helpers/hash.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/helpers/hash.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/helpers/if-unless.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/helpers'); - QUnit.test('ember-glimmer/helpers/hash.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/helpers/if-unless.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/helpers/hash.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/helpers/if-unless.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/helpers/if-unless.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/helpers/loc.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/helpers'); - test('ember-glimmer/helpers/if-unless.js should pass jscs', function () { - ok(true, 'ember-glimmer/helpers/if-unless.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/helpers/if-unless.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/helpers'); - QUnit.test('ember-glimmer/helpers/if-unless.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/helpers/loc.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/helpers/if-unless.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/helpers/loc.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/helpers'); - test('ember-glimmer/helpers/loc.js should pass jscs', function () { - ok(true, 'ember-glimmer/helpers/loc.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/helpers/loc.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/helpers/loc.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/helpers/log.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/helpers'); - QUnit.test('ember-glimmer/helpers/loc.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/helpers/log.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/helpers/loc.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/helpers/log.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/helpers/log.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/helpers/mut.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/helpers'); - test('ember-glimmer/helpers/log.js should pass jscs', function () { - ok(true, 'ember-glimmer/helpers/log.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/helpers/log.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/helpers'); - QUnit.test('ember-glimmer/helpers/log.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/helpers/mut.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/helpers/log.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/helpers/mut.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/helpers'); - test('ember-glimmer/helpers/mut.js should pass jscs', function () { - ok(true, 'ember-glimmer/helpers/mut.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/helpers/mut.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/helpers/mut.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/helpers/query-param.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/helpers'); - QUnit.test('ember-glimmer/helpers/mut.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/helpers/query-param.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/helpers/mut.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/helpers/query-param.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/helpers/query-param.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/helpers/readonly.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/helpers'); - test('ember-glimmer/helpers/query-param.js should pass jscs', function () { - ok(true, 'ember-glimmer/helpers/query-param.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/helpers/query-param.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/helpers'); - QUnit.test('ember-glimmer/helpers/query-param.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/helpers/readonly.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/helpers/query-param.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/helpers/readonly.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/helpers'); - test('ember-glimmer/helpers/readonly.js should pass jscs', function () { - ok(true, 'ember-glimmer/helpers/readonly.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/helpers/readonly.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/helpers/readonly.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/helpers/unbound.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/helpers'); - QUnit.test('ember-glimmer/helpers/readonly.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/helpers/unbound.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/helpers/readonly.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/helpers/unbound.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/helpers'); - test('ember-glimmer/helpers/unbound.js should pass jscs', function () { - ok(true, 'ember-glimmer/helpers/unbound.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/helpers/unbound.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/helpers/unbound.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/index.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/helpers'); - QUnit.test('ember-glimmer/helpers/unbound.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/helpers/unbound.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/index.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/index.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/make-bound-helper.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer'); - test('ember-glimmer/index.js should pass jscs', function () { - ok(true, 'ember-glimmer/index.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/index.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer'); - QUnit.test('ember-glimmer/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/make-bound-helper.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/index.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/make-bound-helper.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer'); - test('ember-glimmer/make-bound-helper.js should pass jscs', function () { - ok(true, 'ember-glimmer/make-bound-helper.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/make-bound-helper.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/make-bound-helper.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/modifiers/action.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer'); - QUnit.test('ember-glimmer/make-bound-helper.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/modifiers/action.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/make-bound-helper.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/modifiers/action.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/modifiers'); - test('ember-glimmer/modifiers/action.js should pass jscs', function () { - ok(true, 'ember-glimmer/modifiers/action.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/modifiers/action.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/modifiers/action.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/protocol-for-url.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/modifiers'); - QUnit.test('ember-glimmer/modifiers/action.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/protocol-for-url.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/modifiers/action.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/protocol-for-url.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer'); - test('ember-glimmer/protocol-for-url.js should pass jscs', function () { - ok(true, 'ember-glimmer/protocol-for-url.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/protocol-for-url.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/protocol-for-url.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/renderer.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer'); - QUnit.test('ember-glimmer/protocol-for-url.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/renderer.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/protocol-for-url.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/renderer.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/renderer.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/setup-registry.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer'); - test('ember-glimmer/renderer.js should pass jscs', function () { - ok(true, 'ember-glimmer/renderer.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/renderer.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer'); - QUnit.test('ember-glimmer/renderer.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/setup-registry.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/renderer.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/setup-registry.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/setup-registry.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/syntax.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer'); - test('ember-glimmer/setup-registry.js should pass jscs', function () { - ok(true, 'ember-glimmer/setup-registry.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/setup-registry.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer'); - QUnit.test('ember-glimmer/setup-registry.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/syntax.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/setup-registry.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/syntax.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer'); - test('ember-glimmer/syntax.js should pass jscs', function () { - ok(true, 'ember-glimmer/syntax.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/syntax.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/syntax.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/syntax/-in-element.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer'); - QUnit.test('ember-glimmer/syntax.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/syntax/-in-element.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/syntax.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/syntax/-in-element.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/syntax/curly-component.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/syntax/-text-area.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/syntax'); - test('ember-glimmer/syntax/curly-component.js should pass jscs', function () { - ok(true, 'ember-glimmer/syntax/curly-component.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/syntax/curly-component.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/syntax'); - QUnit.test('ember-glimmer/syntax/curly-component.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/syntax/-text-area.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/syntax/curly-component.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/syntax/dynamic-component.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/syntax'); - test('ember-glimmer/syntax/dynamic-component.js should pass jscs', function () { - ok(true, 'ember-glimmer/syntax/dynamic-component.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/syntax/-text-area.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/syntax/dynamic-component.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/syntax/-with-dynamic-vars.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/syntax'); - QUnit.test('ember-glimmer/syntax/dynamic-component.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/syntax/-with-dynamic-vars.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/syntax/dynamic-component.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/syntax/-with-dynamic-vars.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/syntax/input.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/syntax/abstract-manager.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/syntax'); - test('ember-glimmer/syntax/input.js should pass jscs', function () { - ok(true, 'ember-glimmer/syntax/input.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/syntax/input.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/syntax'); - QUnit.test('ember-glimmer/syntax/input.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/syntax/abstract-manager.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/syntax/input.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/syntax/mount.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/syntax'); - test('ember-glimmer/syntax/mount.js should pass jscs', function () { - ok(true, 'ember-glimmer/syntax/mount.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/syntax/abstract-manager.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/syntax/mount.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/syntax/curly-component.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/syntax'); - QUnit.test('ember-glimmer/syntax/mount.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/syntax/curly-component.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/syntax/mount.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/syntax/outlet.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/syntax'); - test('ember-glimmer/syntax/outlet.js should pass jscs', function () { - ok(true, 'ember-glimmer/syntax/outlet.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/syntax/curly-component.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/syntax/outlet.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/syntax/dynamic-component.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/syntax'); - QUnit.test('ember-glimmer/syntax/outlet.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/syntax/dynamic-component.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/syntax/outlet.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/syntax/dynamic-component.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/syntax/render.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/syntax/input.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/syntax'); - test('ember-glimmer/syntax/render.js should pass jscs', function () { - ok(true, 'ember-glimmer/syntax/render.js should pass jscs.'); + QUnit.module('ESLint | ember-glimmer/syntax/input.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/syntax/input.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/syntax/render.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/syntax/mount.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/syntax'); - QUnit.test('ember-glimmer/syntax/render.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/syntax/mount.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/syntax/render.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/syntax/mount.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/template.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/syntax/outlet.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer'); - test('ember-glimmer/template.js should pass jscs', function () { - ok(true, 'ember-glimmer/template.js should pass jscs.'); + QUnit.module('ESLint | ember-glimmer/syntax/outlet.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/syntax/outlet.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/template.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/syntax/render.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer'); - QUnit.test('ember-glimmer/template.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/syntax/render.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/template.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/syntax/render.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/template_registry.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/template.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer'); - test('ember-glimmer/template_registry.js should pass jscs', function () { - ok(true, 'ember-glimmer/template_registry.js should pass jscs.'); + QUnit.module('ESLint | ember-glimmer/template.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/template.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/template_registry.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/template_registry.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer'); - QUnit.test('ember-glimmer/template_registry.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/template_registry.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/template_registry.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/template_registry.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/application/actions-test', ['exports', 'ember-runtime', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberRuntime, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers) { @@ -8789,21 +8345,13 @@ enifed('ember-glimmer/tests/integration/application/actions-test', ['exports', ' return _class2; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/application/actions-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/application/actions-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/application'); - test('ember-glimmer/tests/integration/application/actions-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/application/actions-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/application/actions-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/application'); - QUnit.test('ember-glimmer/tests/integration/application/actions-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/application/actions-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/application/actions-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/application/actions-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/application/engine-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/helpers', 'ember-runtime', 'ember-glimmer', 'ember-application', 'ember-routing'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsHelpers, _emberRuntime, _emberGlimmer, _emberApplication, _emberRouting) { @@ -8838,6 +8386,8 @@ babelHelpers.inherits(_class, _ApplicationTest); this.route('comments'); this.route('likes'); }); + this.route('category', { path: 'category/:id' }); + this.route('author', { path: 'author/:id' }); }); this.registerRoute('application', _emberRouting.Route.extend({ model: function () { @@ -8852,12 +8402,21 @@ babelHelpers.inherits(_class, _ApplicationTest); queryParams: ['lang'], lang: '' })); + this.register('controller:category', _emberRuntime.Controller.extend({ + queryParams: ['type'] + })); + this.register('controller:authorKtrl', _emberRuntime.Controller.extend({ + queryParams: ['official'] + })); this.register('template:application', _emberGlimmerTestsUtilsHelpers.compile('Engine{{lang}}{{outlet}}')); this.register('route:application', _emberRouting.Route.extend({ model: function () { hooks.push('engine - application'); } })); + this.register('route:author', _emberRouting.Route.extend({ + controllerName: 'authorKtrl' + })); if (self._additionalEngineRegistrations) { self._additionalEngineRegistrations.call(this); @@ -8957,6 +8516,10 @@ babelHelpers.inherits(_class, _ApplicationTest); })); }; + _class.prototype.stringsEndWith = function stringsEndWith(str, suffix) { + return str.indexOf(suffix, str.length - suffix.length) !== -1; + }; + _class.prototype['@test attrs in an engine'] = function testAttrsInAnEngine() { var _this = this; @@ -9401,27 +8964,60 @@ babelHelpers.inherits(_class, _ApplicationTest); }); }; + _class.prototype['@test query params don\'t have stickiness by default between model'] = function testQueryParamsDonTHaveStickinessByDefaultBetweenModel(assert) { + var _this19 = this; + + assert.expect(1); + var tmpl = '{{#link-to "blog.category" 1337}}Category 1337{{/link-to}}'; + this.setupAppAndRoutableEngine(); + this.additionalEngineRegistrations(function () { + this.register('template:category', _emberGlimmerTestsUtilsHelpers.compile(tmpl)); + }); + + return this.visit('/blog/category/1?type=news').then(function () { + var suffix = '/blog/category/1337'; + var href = _this19.element.querySelector('a').href; + + // check if link ends with the suffix + assert.ok(_this19.stringsEndWith(href, suffix)); + }); + }; + + _class.prototype['@test query params in customized controllerName have stickiness by default between model'] = function testQueryParamsInCustomizedControllerNameHaveStickinessByDefaultBetweenModel(assert) { + var _this20 = this; + + assert.expect(2); + var tmpl = '{{#link-to "blog.author" 1337 class="author-1337"}}Author 1337{{/link-to}}{{#link-to "blog.author" 1 class="author-1"}}Author 1{{/link-to}}'; + this.setupAppAndRoutableEngine(); + this.additionalEngineRegistrations(function () { + this.register('template:author', _emberGlimmerTestsUtilsHelpers.compile(tmpl)); + }); + + return this.visit('/blog/author/1?official=true').then(function () { + var suffix1 = '/blog/author/1?official=true'; + var href1 = _this20.element.querySelector('.author-1').href; + var suffix1337 = '/blog/author/1337'; + var href1337 = _this20.element.querySelector('.author-1337').href; + + // check if link ends with the suffix + assert.ok(_this20.stringsEndWith(href1, suffix1)); + assert.ok(_this20.stringsEndWith(href1337, suffix1337)); + }); + }; + return _class; })(_emberGlimmerTestsUtilsTestCase.ApplicationTest)); }); -enifed('ember-glimmer/tests/integration/application/engine-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/application/engine-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/application'); - test('ember-glimmer/tests/integration/application/engine-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/application/engine-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/application/engine-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/application'); - QUnit.test('ember-glimmer/tests/integration/application/engine-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/application/engine-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/application/engine-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/application/engine-test.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/tests/integration/application/rendering-test', ['exports', 'ember-runtime', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-routing'], function (exports, _emberRuntime, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberRouting) { +enifed('ember-glimmer/tests/integration/application/rendering-test', ['exports', 'ember-runtime', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-routing', 'ember-metal', 'ember-glimmer'], function (exports, _emberRuntime, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberRouting, _emberMetal, _emberGlimmer) { 'use strict'; var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n
      \n {{#each model as |item|}}\n
    • {{item}}
    • \n {{/each}}\n
    \n '], ['\n
      \n {{#each model as |item|}}\n
    • {{item}}
    • \n {{/each}}\n
    \n ']), @@ -9764,24 +9360,55 @@ babelHelpers.inherits(_class, _ApplicationTest); }); }; + _class.prototype['@test it emits a useful backtracking re-render assertion message'] = function testItEmitsAUsefulBacktrackingReRenderAssertionMessage(assert) { + var _this13 = this; + + this.router.map(function () { + this.route('routeWithError'); + }); + + this.registerRoute('routeWithError', _emberRouting.Route.extend({ + model: function () { + return { name: 'Alex' }; + } + })); + + this.registerTemplate('routeWithError', 'Hi {{model.name}} {{x-foo person=model}}'); + + this.registerComponent('x-foo', { + ComponentClass: _emberGlimmer.Component.extend({ + init: function () { + this._super.apply(this, arguments); + this.set('person.name', 'Ben'); + } + }), + template: 'Hi {{person.name}} from component' + }); + + var expectedBacktrackingMessage = /modified "model\.name" twice on \[object Object\] in a single render\. It was rendered in "template:routeWithError" and modified in "component:x-foo"/; + + if (true) { + expectDeprecation(expectedBacktrackingMessage); + return this.visit('/routeWithError'); + } else { + return this.visit('/').then(function () { + expectAssertion(function () { + _this13.visit('/routeWithError'); + }, expectedBacktrackingMessage); + }); + } + }; + return _class; })(_emberGlimmerTestsUtilsTestCase.ApplicationTest)); }); -enifed('ember-glimmer/tests/integration/application/rendering-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/application'); - test('ember-glimmer/tests/integration/application/rendering-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/application/rendering-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/application/rendering-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/application/rendering-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/application'); - QUnit.test('ember-glimmer/tests/integration/application/rendering-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/application/rendering-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/application/rendering-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/application/rendering-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/binding_integration_test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { @@ -9852,21 +9479,13 @@ enifed('ember-glimmer/tests/integration/binding_integration_test', ['exports', ' return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/binding_integration_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration'); - test('ember-glimmer/tests/integration/binding_integration_test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/binding_integration_test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/binding_integration_test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/binding_integration_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration'); - QUnit.test('ember-glimmer/tests/integration/binding_integration_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/binding_integration_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/binding_integration_test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/binding_integration_test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/append-test', ['exports', 'ember-metal', 'ember-views', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberMetal, _emberViews, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsAbstractTestCase) { @@ -10018,7 +9637,13 @@ babelHelpers.inherits(AbstractAppendTest, _RenderingTest); template: '[child: {{bar}}]{{yield}}' }); - var XParent = this.owner._lookupFactory('component:x-parent'); + var XParent = undefined; + + if (true) { + XParent = this.owner.factoryFor('component:x-parent'); + } else { + XParent = this.owner._lookupFactory('component:x-parent'); + } this.component = XParent.create({ foo: 'zomg' }); @@ -10095,7 +9720,13 @@ babelHelpers.inherits(AbstractAppendTest, _RenderingTest); template: '[child: {{bar}}]{{yield}}' }); - var XParent = this.owner._lookupFactory('component:x-parent'); + var XParent = undefined; + + if (true) { + XParent = this.owner.factoryFor('component:x-parent'); + } else { + XParent = this.owner._lookupFactory('component:x-parent'); + } this.component = XParent.create({ foo: 'zomg' }); @@ -10176,8 +9807,16 @@ babelHelpers.inherits(AbstractAppendTest, _RenderingTest); template: 'x-second {{bar}}!' }); - var First = this.owner._lookupFactory('component:x-first'); - var Second = this.owner._lookupFactory('component:x-second'); + var First = undefined, + Second = undefined; + + if (true) { + First = this.owner.factoryFor('component:x-first'); + Second = this.owner.factoryFor('component:x-second'); + } else { + First = this.owner._lookupFactory('component:x-first'); + Second = this.owner._lookupFactory('component:x-second'); + } var first = First.create({ foo: 'foo' }); var second = Second.create({ bar: 'bar' }); @@ -10261,9 +9900,7 @@ babelHelpers.inherits(AbstractAppendTest, _RenderingTest); return _this6.append(component); }; - var wrapper1 = undefined, - wrapper2 = undefined, - element1 = undefined, + var element1 = undefined, element2 = undefined; this.registerComponent('first-component', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -10271,9 +9908,15 @@ babelHelpers.inherits(AbstractAppendTest, _RenderingTest); didInsertElement: function () { element1 = this.element; - var SecondComponent = owner._lookupFactory('component:second-component'); - wrapper2 = append(SecondComponent.create()); + var SecondComponent = undefined; + if (true) { + SecondComponent = owner.factoryFor('component:second-component'); + } else { + SecondComponent = owner._lookupFactory('component:second-component'); + } + + append(SecondComponent.create()); } }) }); @@ -10288,10 +9931,16 @@ babelHelpers.inherits(AbstractAppendTest, _RenderingTest); }) }); - var FirstComponent = this.owner._lookupFactory('component:first-component'); + var FirstComponent = undefined; + + if (true) { + FirstComponent = this.owner.factoryFor('component:first-component'); + } else { + FirstComponent = this.owner._lookupFactory('component:first-component'); + } this.runTask(function () { - return wrapper1 = append(FirstComponent.create()); + return append(FirstComponent.create()); }); this.assertComponentElement(element1, { content: 'component-one' }); @@ -10324,7 +9973,13 @@ babelHelpers.inherits(AbstractAppendTest, _RenderingTest); didInsertElement: function () { element1 = this.element; - var OtherRoot = owner._lookupFactory('component:other-root'); + var OtherRoot = undefined; + + if (true) { + OtherRoot = owner.factoryFor('component:other-root'); + } else { + OtherRoot = owner._lookupFactory('component:other-root'); + } this._instance = OtherRoot.create({ didInsertElement: function () { @@ -10352,7 +10007,13 @@ babelHelpers.inherits(AbstractAppendTest, _RenderingTest); didInsertElement: function () { element3 = this.element; - var OtherRoot = owner._lookupFactory('component:other-root'); + var OtherRoot = undefined; + + if (true) { + OtherRoot = owner.factoryFor('component:other-root'); + } else { + OtherRoot = owner._lookupFactory('component:other-root'); + } this._instance = OtherRoot.create({ didInsertElement: function () { @@ -10458,7 +10119,13 @@ babelHelpers.inherits(_class2, _AbstractAppendTest2); template: 'FOO BAR!' }); - var FooBar = this.owner._lookupFactory('component:foo-bar'); + var FooBar = undefined; + + if (true) { + FooBar = this.owner.factoryFor('component:foo-bar'); + } else { + FooBar = this.owner._lookupFactory('component:foo-bar'); + } this.component = FooBar.create(); @@ -10521,6 +10188,7 @@ babelHelpers.inherits(_class5, _AbstractAppendTest5); } _class5.prototype.append = function append(component) { + expectDeprecation(/Using the `renderToElement` is deprecated in favor of `appendTo`. Called in/); var wrapper = undefined; this.runTask(function () { @@ -10546,6 +10214,7 @@ babelHelpers.inherits(_class6, _AbstractAppendTest6); } _class6.prototype.append = function append(component) { + expectDeprecation(/Using the `renderToElement` is deprecated in favor of `appendTo`. Called in/); var wrapper = undefined; this.runTask(function () { @@ -10562,21 +10231,13 @@ babelHelpers.inherits(_class6, _AbstractAppendTest6); return _class6; })(AbstractAppendTest)); }); -enifed('ember-glimmer/tests/integration/components/append-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/append-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/append-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/append-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/append-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/append-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/append-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/append-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/append-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/attribute-bindings-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberMetal) { @@ -11305,21 +10966,13 @@ babelHelpers.inherits(_class, _RenderingTest); return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/components/attribute-bindings-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/attribute-bindings-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/attribute-bindings-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/attribute-bindings-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/attribute-bindings-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/attribute-bindings-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/attribute-bindings-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/attribute-bindings-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/attribute-bindings-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/attrs-lookup-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal', 'ember-glimmer/tests/utils/test-helpers'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal, _emberGlimmerTestsUtilsTestHelpers) { @@ -11599,21 +11252,13 @@ enifed('ember-glimmer/tests/integration/components/attrs-lookup-test', ['exports return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/components/attrs-lookup-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/attrs-lookup-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/attrs-lookup-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/attrs-lookup-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/attrs-lookup-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/attrs-lookup-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/attrs-lookup-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/attrs-lookup-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/attrs-lookup-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/class-bindings-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/test-helpers', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsTestHelpers, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase) { @@ -11967,7 +11612,7 @@ babelHelpers.inherits(_class, _RenderingTest); init: function () { this._super(); - var bindings = this.classNameBindings; + var bindings = this.classNameBindings = this.classNameBindings.slice(); if (this.get('bindIsEnabled')) { bindings.push('isEnabled:enabled'); @@ -12186,24 +11831,16 @@ babelHelpers.inherits(_class2, _RenderingTest2); return _class2; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/components/class-bindings-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/class-bindings-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/class-bindings-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/class-bindings-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/class-bindings-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/class-bindings-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/class-bindings-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/class-bindings-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/class-bindings-test.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/tests/integration/components/closure-components-test', ['exports', 'ember-utils', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-metal'], function (exports, _emberUtils, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberMetal) { +enifed('ember-glimmer/tests/integration/components/contextual-components-test', ['exports', 'ember-utils', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember-runtime/system/native_array'], function (exports, _emberUtils, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberMetal, _emberRuntimeSystemNative_array) { 'use strict'; var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{component (component "-looked-up") "Hodari" greeting="Hodi"}}'], ['\n {{component (component "-looked-up") "Hodari" greeting="Hodi"}}']), @@ -12224,7 +11861,7 @@ enifed('ember-glimmer/tests/integration/components/closure-components-test', ['e _templateObject16 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#with (hash ctxCmp=(component compName isOpen=isOpen)) as |thing|}}\n {{#thing.ctxCmp}}This is a contextual component{{/thing.ctxCmp}}\n {{/with}}\n '], ['\n {{#with (hash ctxCmp=(component compName isOpen=isOpen)) as |thing|}}\n {{#thing.ctxCmp}}This is a contextual component{{/thing.ctxCmp}}\n {{/with}}\n ']), _templateObject17 = babelHelpers.taggedTemplateLiteralLoose(['\n '], ['\n ']); - _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: closure components', (function (_RenderingTest) { + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: contextual components', (function (_RenderingTest) { babelHelpers.inherits(_class, _RenderingTest); function _class() { @@ -12737,7 +12374,7 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('Inner 28'); }; - _class.prototype['@test conflicting positional and hash parameters raise and assertion if in the same closure'] = function testConflictingPositionalAndHashParametersRaiseAndAssertionIfInTheSameClosure() { + _class.prototype['@test conflicting positional and hash parameters raise and assertion if in the same component context'] = function testConflictingPositionalAndHashParametersRaiseAndAssertionIfInTheSameComponentContext() { var _this15 = this; this.registerComponent('-looked-up', { @@ -12791,7 +12428,7 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('Hodi Hodari'); }; - _class.prototype['@test conflicting positional and hash parameters does not raise an assertion if in different closure'] = function testConflictingPositionalAndHashParametersDoesNotRaiseAnAssertionIfInDifferentClosure() { + _class.prototype['@test conflicting positional and hash parameters does not raise an assertion if in different component context'] = function testConflictingPositionalAndHashParametersDoesNotRaiseAnAssertionIfInDifferentComponentContext() { var _this17 = this; this.registerComponent('-looked-up', { @@ -12968,7 +12605,7 @@ babelHelpers.inherits(_class, _RenderingTest); _class.prototype['@test renders with dot path and rest parameter does not leak'] = function testRendersWithDotPathAndRestParameterDoesNotLeak(assert) { // In the original implementation, positional parameters were not handled - // correctly causing the first positional parameter to be the closure + // correctly causing the first positional parameter to be the contextual // component itself. var value = false; @@ -13047,7 +12684,7 @@ babelHelpers.inherits(_class, _RenderingTest); assert.equal(this.$('#nested-prop').text(), '1'); }; - _class.prototype['@test adding parameters to a closure component\'s instance does not add it to other instances'] = function testAddingParametersToAClosureComponentSInstanceDoesNotAddItToOtherInstances() { + _class.prototype['@test adding parameters to a contextual component\'s instance does not add it to other instances'] = function testAddingParametersToAContextualComponentSInstanceDoesNotAddItToOtherInstances() { var _this26 = this; // If parameters and attributes are not handled correctly, setting a value @@ -13071,7 +12708,7 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('Foo'); }; - _class.prototype['@test parameters in a closure are mutable when closure is a param'] = function testParametersInAClosureAreMutableWhenClosureIsAParam(assert) { + _class.prototype['@test parameters in a contextual component are mutable when value is a param'] = function testParametersInAContextualComponentAreMutableWhenValueIsAParam(assert) { var _this27 = this; // This checks that a `(mut)` is added to parameters and attributes to @@ -13387,23 +13024,145 @@ babelHelpers.inherits(_class, _RenderingTest); assert.equal(this.$().text(), 'my-comp: open'); }; + _class.prototype['@test GH#14508 rest positional params are received when passed as named parameter'] = function testGH14508RestPositionalParamsAreReceivedWhenPassedAsNamedParameter() { + var _this33 = this; + + this.registerComponent('my-link', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'params' + }), + template: '{{#each params as |p|}}{{p}}{{/each}}' + }); + + this.render('{{component (component "my-link") params=allParams}}', { + allParams: _emberRuntimeSystemNative_array.A(['a', 'b']) + }); + + this.assertText('ab'); + + this.runTask(function () { + return _this33.rerender(); + }); + + this.assertText('ab'); + + this.runTask(function () { + return _this33.context.get('allParams').pushObject('c'); + }); + + this.assertText('abc'); + + this.runTask(function () { + return _this33.context.get('allParams').popObject(); + }); + + this.assertText('ab'); + + this.runTask(function () { + return _this33.context.get('allParams').clear(); + }); + + this.assertText(''); + + this.runTask(function () { + return _this33.context.set('allParams', _emberRuntimeSystemNative_array.A(['1', '2'])); + }); + + this.assertText('12'); + + this.runTask(function () { + return _this33.context.set('allParams', _emberRuntimeSystemNative_array.A(['a', 'b'])); + }); + + this.assertText('ab'); + }; + + _class.prototype['@test GH#14508 rest positional params are received when passed as named parameter with dot notation'] = function testGH14508RestPositionalParamsAreReceivedWhenPassedAsNamedParameterWithDotNotation() { + var _this34 = this; + + this.registerComponent('my-link', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ + positionalParams: 'params' + }), + template: '{{#each params as |p|}}{{p}}{{/each}}' + }); + + this.render('{{#with (hash link=(component "my-link")) as |c|}}{{c.link params=allParams}}{{/with}}', { + allParams: _emberRuntimeSystemNative_array.A(['a', 'b']) + }); + + this.assertText('ab'); + + this.runTask(function () { + return _this34.rerender(); + }); + + this.assertText('ab'); + + this.runTask(function () { + return _this34.context.get('allParams').pushObject('c'); + }); + + this.assertText('abc'); + + this.runTask(function () { + return _this34.context.get('allParams').popObject(); + }); + + this.assertText('ab'); + + this.runTask(function () { + return _this34.context.get('allParams').clear(); + }); + + this.assertText(''); + + this.runTask(function () { + return _this34.context.set('allParams', _emberRuntimeSystemNative_array.A(['1', '2'])); + }); + + this.assertText('12'); + + this.runTask(function () { + return _this34.context.set('allParams', _emberRuntimeSystemNative_array.A(['a', 'b'])); + }); + + this.assertText('ab'); + }; + + _class.prototype['@test GH#14632 give useful warning when calling contextual components with input as a name'] = function testGH14632GiveUsefulWarningWhenCallingContextualComponentsWithInputAsAName() { + var _this35 = this; + + expectAssertion(function () { + _this35.render('{{component (component "input" type="text")}}'); + }, 'You cannot use the input helper as a contextual helper. Please extend Ember.TextField or Ember.Checkbox to use it as a contextual component.'); + }; + + _class.prototype['@test GH#14632 give useful warning when calling contextual components with textarea as a name'] = function testGH14632GiveUsefulWarningWhenCallingContextualComponentsWithTextareaAsAName() { + var _this36 = this; + + expectAssertion(function () { + _this36.render('{{component (component "textarea" type="text")}}'); + }, 'You cannot use the textarea helper as a contextual helper. Please extend Ember.TextArea to use it as a contextual component.'); + }; + return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); - var ClosureComponentMutableParamsTest = (function (_RenderingTest2) { -babelHelpers.inherits(ClosureComponentMutableParamsTest, _RenderingTest2); + var ContextualComponentMutableParamsTest = (function (_RenderingTest2) { +babelHelpers.inherits(ContextualComponentMutableParamsTest, _RenderingTest2); - function ClosureComponentMutableParamsTest() { + function ContextualComponentMutableParamsTest() { _RenderingTest2.apply(this, arguments); } - ClosureComponentMutableParamsTest.prototype.render = function render(templateStr) { + ContextualComponentMutableParamsTest.prototype.render = function render(templateStr) { var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; _RenderingTest2.prototype.render.call(this, templateStr + '{{model.val2}}', _emberUtils.assign(context, { model: { val2: 8 } })); }; - return ClosureComponentMutableParamsTest; + return ContextualComponentMutableParamsTest; })(_emberGlimmerTestsUtilsTestCase.RenderingTest); var MutableParamTestGenerator = (function () { @@ -13417,8 +13176,8 @@ babelHelpers.inherits(ClosureComponentMutableParamsTest, _RenderingTest2); var title = _ref2.title; var setup = _ref2.setup; - return _ref = {}, _ref['@test parameters in a closure are mutable when closure is a ' + title] = function (assert) { - var _this33 = this; + return _ref = {}, _ref['@test parameters in a contextual component are mutable when value is a ' + title] = function (assert) { + var _this37 = this; this.registerComponent('change-button', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ @@ -13432,19 +13191,19 @@ babelHelpers.inherits(ClosureComponentMutableParamsTest, _RenderingTest2); assert.equal(this.$('.value').text(), '8'); this.runTask(function () { - return _this33.rerender(); + return _this37.rerender(); }); assert.equal(this.$('.value').text(), '8'); this.runTask(function () { - return _this33.$('.my-button').click(); + return _this37.$('.my-button').click(); }); assert.equal(this.$('.value').text(), '10'); this.runTask(function () { - return _this33.context.set('model', { val2: 8 }); + return _this37.context.set('model', { val2: 8 }); }); assert.equal(this.$('.value').text(), '8'); @@ -13454,7 +13213,7 @@ babelHelpers.inherits(ClosureComponentMutableParamsTest, _RenderingTest2); return MutableParamTestGenerator; })(); - _emberGlimmerTestsUtilsAbstractTestCase.applyMixins(ClosureComponentMutableParamsTest, new MutableParamTestGenerator([{ + _emberGlimmerTestsUtilsAbstractTestCase.applyMixins(ContextualComponentMutableParamsTest, new MutableParamTestGenerator([{ title: 'param', setup: function () { this.render('{{component (component "change-button" model.val2)}}'); @@ -13491,23 +13250,15 @@ babelHelpers.inherits(ClosureComponentMutableParamsTest, _RenderingTest2); } }])); - _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: closure components -- mutable params', ClosureComponentMutableParamsTest); -}); -enifed('ember-glimmer/tests/integration/components/closure-components-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/closure-components-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/closure-components-test.js should pass jscs.'); - }); + _emberGlimmerTestsUtilsTestCase.moduleFor('Components test: contextual components -- mutable params', ContextualComponentMutableParamsTest); }); -enifed('ember-glimmer/tests/integration/components/closure-components-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/contextual-components-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/closure-components-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/contextual-components-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/closure-components-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/contextual-components-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/curly-components-test', ['exports', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/test-helpers'], function (exports, _emberMetal, _emberRuntime, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsTestHelpers) { @@ -13845,6 +13596,22 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertComponentElement(this.firstChild, { tagName: 'foo-bar', content: 'hello' }); }; + _class.prototype['@test tagName can not be a computed property'] = function testTagNameCanNotBeAComputedProperty(assert) { + var _this10 = this; + + var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ + tagName: _emberMetal.computed(function () { + return 'foo-bar'; + }) + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); + + expectAssertion(function () { + _this10.render('{{foo-bar}}'); + }, /You cannot use a computed property for the component's `tagName` \(<\(.+>\)\./); + }; + _class.prototype['@test class is applied before didInsertElement'] = function testClassIsAppliedBeforeDidInsertElement(assert) { var componentClass = undefined; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -13861,7 +13628,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test it can have custom classNames'] = function testItCanHaveCustomClassNames() { - var _this10 = this; + var _this11 = this; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ classNames: ['foo', 'bar'] @@ -13874,14 +13641,14 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar') }, content: 'hello' }); this.runTask(function () { - return _this10.rerender(); + return _this11.rerender(); }); this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar') }, content: 'hello' }); }; _class.prototype['@test should not apply falsy class name'] = function testShouldNotApplyFalsyClassName() { - var _this11 = this; + var _this12 = this; this.registerComponent('foo-bar', { template: 'hello' }); @@ -13892,14 +13659,14 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: 'ember-view' }, content: 'hello' }); this.runTask(function () { - return _this11.rerender(); + return _this12.rerender(); }); this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: 'ember-view' }, content: 'hello' }); }; _class.prototype['@test should apply classes of the dasherized property name when bound property specified is true'] = function testShouldApplyClassesOfTheDasherizedPropertyNameWhenBoundPropertySpecifiedIsTrue() { - var _this12 = this; + var _this13 = this; this.registerComponent('foo-bar', { template: 'hello' }); @@ -13910,26 +13677,26 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('ember-view some-truth') }, content: 'hello' }); this.runTask(function () { - return _this12.rerender(); + return _this13.rerender(); }); this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('ember-view some-truth') }, content: 'hello' }); this.runTask(function () { - return _emberMetal.set(_this12.context, 'model.someTruth', false); + return _emberMetal.set(_this13.context, 'model.someTruth', false); }); this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') }, content: 'hello' }); this.runTask(function () { - return _emberMetal.set(_this12.context, 'model', { someTruth: true }); + return _emberMetal.set(_this13.context, 'model', { someTruth: true }); }); this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { class: _emberGlimmerTestsUtilsTestHelpers.classes('ember-view some-truth') }, content: 'hello' }); }; _class.prototype['@test class property on components can be dynamic'] = function testClassPropertyOnComponentsCanBeDynamic() { - var _this13 = this; + var _this14 = this; this.registerComponent('foo-bar', { template: 'hello' }); @@ -13940,30 +13707,31 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertComponentElement(this.firstChild, { content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar') } }); this.runTask(function () { - return _this13.rerender(); + return _this14.rerender(); }); this.assertComponentElement(this.firstChild, { content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar') } }); this.runTask(function () { - return _emberMetal.set(_this13.context, 'fooBar', false); + return _emberMetal.set(_this14.context, 'fooBar', false); }); this.assertComponentElement(this.firstChild, { content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view') } }); this.runTask(function () { - return _emberMetal.set(_this13.context, 'fooBar', true); + return _emberMetal.set(_this14.context, 'fooBar', true); }); this.assertComponentElement(this.firstChild, { content: 'hello', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo-bar') } }); }; _class.prototype['@test it can have custom classNames from constructor'] = function testItCanHaveCustomClassNamesFromConstructor() { - var _this14 = this; + var _this15 = this; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ init: function () { this._super(); + this.classNames = this.classNames.slice(); this.classNames.push('foo', 'bar', 'outside-' + this.get('extraClass')); } }); @@ -13975,14 +13743,14 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar outside-baz') }, content: 'hello' }); this.runTask(function () { - return _this14.rerender(); + return _this15.rerender(); }); this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar outside-baz') }, content: 'hello' }); }; _class.prototype['@test it can set custom classNames from the invocation'] = function testItCanSetCustomClassNamesFromTheInvocation() { - var _this15 = this; + var _this16 = this; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ classNames: ['foo'] @@ -13997,7 +13765,7 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertComponentElement(this.nthChild(2), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo') }, content: 'hello' }); this.runTask(function () { - return _this15.rerender(); + return _this16.rerender(); }); this.assertComponentElement(this.nthChild(0), { tagName: 'div', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes('ember-view foo bar baz') }, content: 'hello' }); @@ -14006,7 +13774,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test it has an element'] = function testItHasAnElement() { - var _this16 = this; + var _this17 = this; var instance = undefined; @@ -14026,7 +13794,7 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertComponentElement(element1, { content: 'hello' }); this.runTask(function () { - return _this16.rerender(); + return _this17.rerender(); }); var element2 = instance.element; @@ -14037,7 +13805,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test it has a jQuery proxy to the element'] = function testItHasAJQueryProxyToTheElement(assert) { - var _this17 = this; + var _this18 = this; var instance = undefined; @@ -14057,7 +13825,7 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertComponentElement(element1, { content: 'hello' }); this.runTask(function () { - return _this17.rerender(); + return _this18.rerender(); }); var element2 = instance.$()[0]; @@ -14068,7 +13836,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test it scopes the jQuery proxy to the component element'] = function testItScopesTheJQueryProxyToTheComponentElement(assert) { - var _this18 = this; + var _this19 = this; var instance = undefined; @@ -14089,7 +13857,7 @@ babelHelpers.inherits(_class, _RenderingTest); assert.equal($span.attr('class'), 'inner'); this.runTask(function () { - return _this18.rerender(); + return _this19.rerender(); }); $span = instance.$('span'); @@ -14099,7 +13867,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test an empty component does not have childNodes'] = function testAnEmptyComponentDoesNotHaveChildNodes(assert) { - var _this19 = this; + var _this20 = this; var fooBarInstance = undefined; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -14119,7 +13887,7 @@ babelHelpers.inherits(_class, _RenderingTest); assert.strictEqual(fooBarInstance.element.childNodes.length, 0); this.runTask(function () { - return _this19.rerender(); + return _this20.rerender(); }); this.assertComponentElement(this.firstChild, { tagName: 'input' }); @@ -14128,7 +13896,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test it has the right parentView and childViews'] = function testItHasTheRightParentViewAndChildViews(assert) { - var _this20 = this; + var _this21 = this; var fooBarInstance = undefined, fooBarBazInstance = undefined; @@ -14160,7 +13928,7 @@ babelHelpers.inherits(_class, _RenderingTest); assert.deepEqual(fooBarInstance.childViews, [fooBarBazInstance]); this.runTask(function () { - return _this20.rerender(); + return _this21.rerender(); }); this.assertText('foo-bar foo-bar-baz'); @@ -14172,7 +13940,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test it renders passed named arguments'] = function testItRendersPassedNamedArguments() { - var _this21 = this; + var _this22 = this; this.registerComponent('foo-bar', { template: '{{foo}}' @@ -14187,26 +13955,26 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('Hola'); this.runTask(function () { - return _this21.rerender(); + return _this22.rerender(); }); this.assertText('Hola'); this.runTask(function () { - return _this21.context.set('model.bar', 'Hello'); + return _this22.context.set('model.bar', 'Hello'); }); this.assertText('Hello'); this.runTask(function () { - return _this21.context.set('model', { bar: 'Hola' }); + return _this22.context.set('model', { bar: 'Hola' }); }); this.assertText('Hola'); }; _class.prototype['@test it can render a basic component with a block'] = function testItCanRenderABasicComponentWithABlock() { - var _this22 = this; + var _this23 = this; this.registerComponent('foo-bar', { template: '{{yield}} - In component' }); @@ -14215,14 +13983,14 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertComponentElement(this.firstChild, { content: 'hello - In component' }); this.runTask(function () { - return _this22.rerender(); + return _this23.rerender(); }); this.assertComponentElement(this.firstChild, { content: 'hello - In component' }); }; _class.prototype['@test it can render a basic component with a block when the yield is in a partial'] = function testItCanRenderABasicComponentWithABlockWhenTheYieldIsInAPartial() { - var _this23 = this; + var _this24 = this; this.registerPartial('_partialWithYield', 'yielded: [{{yield}}]'); @@ -14233,14 +14001,14 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertComponentElement(this.firstChild, { content: 'yielded: [hello] - In component' }); this.runTask(function () { - return _this23.rerender(); + return _this24.rerender(); }); this.assertComponentElement(this.firstChild, { content: 'yielded: [hello] - In component' }); }; _class.prototype['@test it can render a basic component with a block param when the yield is in a partial'] = function testItCanRenderABasicComponentWithABlockParamWhenTheYieldIsInAPartial() { - var _this24 = this; + var _this25 = this; this.registerPartial('_partialWithYield', 'yielded: [{{yield "hello"}}]'); @@ -14251,14 +14019,14 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertComponentElement(this.firstChild, { content: 'yielded: [hello] - In component' }); this.runTask(function () { - return _this24.rerender(); + return _this25.rerender(); }); this.assertComponentElement(this.firstChild, { content: 'yielded: [hello] - In component' }); }; _class.prototype['@test it renders the layout with the component instance as the context'] = function testItRendersTheLayoutWithTheComponentInstanceAsTheContext() { - var _this25 = this; + var _this26 = this; var instance = undefined; @@ -14277,7 +14045,7 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertComponentElement(this.firstChild, { content: 'hello' }); this.runTask(function () { - return _this25.rerender(); + return _this26.rerender(); }); this.assertComponentElement(this.firstChild, { content: 'hello' }); @@ -14296,7 +14064,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test it preserves the outer context when yielding'] = function testItPreservesTheOuterContextWhenYielding() { - var _this26 = this; + var _this27 = this; this.registerComponent('foo-bar', { template: '{{yield}}' }); @@ -14305,19 +14073,19 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertComponentElement(this.firstChild, { content: 'hello' }); this.runTask(function () { - return _this26.rerender(); + return _this27.rerender(); }); this.assertComponentElement(this.firstChild, { content: 'hello' }); this.runTask(function () { - return _emberMetal.set(_this26.context, 'message', 'goodbye'); + return _emberMetal.set(_this27.context, 'message', 'goodbye'); }); this.assertComponentElement(this.firstChild, { content: 'goodbye' }); this.runTask(function () { - return _emberMetal.set(_this26.context, 'message', 'hello'); + return _emberMetal.set(_this27.context, 'message', 'hello'); }); this.assertComponentElement(this.firstChild, { content: 'hello' }); @@ -14357,7 +14125,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test it can yield internal and external properties positionally'] = function testItCanYieldInternalAndExternalPropertiesPositionally() { - var _this27 = this; + var _this28 = this; var instance = undefined; @@ -14381,13 +14149,13 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertComponentElement(this.firstChild, { content: 'Joel Kang, hello' }); this.runTask(function () { - return _this27.rerender(); + return _this28.rerender(); }); this.assertComponentElement(this.firstChild, { content: 'Joel Kang, hello' }); this.runTask(function () { - return _emberMetal.set(_this27.context, 'person', { firstName: 'Dora', lastName: 'the Explorer' }); + return _emberMetal.set(_this28.context, 'person', { firstName: 'Dora', lastName: 'the Explorer' }); }); this.assertComponentElement(this.firstChild, { content: 'Dora the Explorer, hello' }); @@ -14400,7 +14168,7 @@ babelHelpers.inherits(_class, _RenderingTest); this.runTask(function () { _emberMetal.set(instance, 'greeting', 'hello'); - _emberMetal.set(_this27.context, 'person', { + _emberMetal.set(_this28.context, 'person', { firstName: 'Joel', lastName: 'Kang' }); @@ -14410,7 +14178,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test #11519 - block param infinite loop'] = function test11519BlockParamInfiniteLoop() { - var _this28 = this; + var _this29 = this; var instance = undefined; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -14432,7 +14200,7 @@ babelHelpers.inherits(_class, _RenderingTest); // Trigger a non-revalidating re-render. The yielded block will not be dirtied // nor will block param streams, and thus no infinite loop will occur. this.runTask(function () { - return _this28.rerender(); + return _this29.rerender(); }); this.assertText('0'); @@ -14455,7 +14223,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test the component and its child components are destroyed'] = function testTheComponentAndItsChildComponentsAreDestroyed(assert) { - var _this29 = this; + var _this30 = this; var destroyed = { 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0 }; @@ -14480,13 +14248,13 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('1 2 3 4 5 6 7 8 '); this.runTask(function () { - return _this29.rerender(); + return _this30.rerender(); }); assert.deepEqual(destroyed, { 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0 }); this.runTask(function () { - return _emberMetal.set(_this29.context, 'cond5', false); + return _emberMetal.set(_this30.context, 'cond5', false); }); this.assertText('1 2 3 4 8 '); @@ -14494,23 +14262,23 @@ babelHelpers.inherits(_class, _RenderingTest); assert.deepEqual(destroyed, { 1: 0, 2: 0, 3: 0, 4: 0, 5: 1, 6: 1, 7: 1, 8: 0 }); this.runTask(function () { - _emberMetal.set(_this29.context, 'cond3', false); - _emberMetal.set(_this29.context, 'cond5', true); - _emberMetal.set(_this29.context, 'cond4', false); + _emberMetal.set(_this30.context, 'cond3', false); + _emberMetal.set(_this30.context, 'cond5', true); + _emberMetal.set(_this30.context, 'cond4', false); }); assert.deepEqual(destroyed, { 1: 0, 2: 0, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1 }); this.runTask(function () { - _emberMetal.set(_this29.context, 'cond2', false); - _emberMetal.set(_this29.context, 'cond1', false); + _emberMetal.set(_this30.context, 'cond2', false); + _emberMetal.set(_this30.context, 'cond1', false); }); assert.deepEqual(destroyed, { 1: 1, 2: 1, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1 }); }; _class.prototype['@test should escape HTML in normal mustaches'] = function testShouldEscapeHTMLInNormalMustaches() { - var _this30 = this; + var _this31 = this; var component = undefined; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -14528,7 +14296,7 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('you need to be more bold'); this.runTask(function () { - return _this30.rerender(); + return _this31.rerender(); }); this.assertText('you need to be more bold'); @@ -14545,7 +14313,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test should not escape HTML in triple mustaches'] = function testShouldNotEscapeHTMLInTripleMustaches(assert) { - var _this31 = this; + var _this32 = this; var expectedHtmlBold = 'you need to be more bold'; var expectedHtmlItalic = 'you are so super'; @@ -14565,7 +14333,7 @@ babelHelpers.inherits(_class, _RenderingTest); _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.firstChild, expectedHtmlBold); this.runTask(function () { - return _this31.rerender(); + return _this32.rerender(); }); _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.firstChild, expectedHtmlBold); @@ -14584,7 +14352,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test should not escape HTML if string is a htmlSafe'] = function testShouldNotEscapeHTMLIfStringIsAHtmlSafe(assert) { - var _this32 = this; + var _this33 = this; var expectedHtmlBold = 'you need to be more bold'; var expectedHtmlItalic = 'you are so super'; @@ -14604,7 +14372,7 @@ babelHelpers.inherits(_class, _RenderingTest); _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.firstChild, expectedHtmlBold); this.runTask(function () { - return _this32.rerender(); + return _this33.rerender(); }); _emberGlimmerTestsUtilsTestHelpers.equalTokens(this.firstChild, expectedHtmlBold); @@ -14624,7 +14392,6 @@ babelHelpers.inherits(_class, _RenderingTest); _class.prototype['@test late bound layouts return the same definition'] = function testLateBoundLayoutsReturnTheSameDefinition(assert) { var templateIds = []; - var component = undefined; // This is testing the scenario where you import a template and // set it to the layout property: @@ -14641,7 +14408,6 @@ babelHelpers.inherits(_class, _RenderingTest); init: function () { this._super.apply(this, arguments); this.layout = this.cond ? hello : bye; - component = this; templateIds.push(this.layout.id); } }); @@ -14660,7 +14426,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test can use isStream property without conflict (#13271)'] = function testCanUseIsStreamPropertyWithoutConflict13271() { - var _this33 = this; + var _this34 = this; var component = undefined; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -14683,7 +14449,7 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertComponentElement(this.firstChild, { content: 'true' }); this.runTask(function () { - return _this33.rerender(); + return _this34.rerender(); }); this.assertComponentElement(this.firstChild, { content: 'true' }); @@ -14702,7 +14468,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test lookup of component takes priority over property'] = function testLookupOfComponentTakesPriorityOverProperty() { - var _this34 = this; + var _this35 = this; this.registerComponent('some-component', { template: 'some-component' @@ -14716,14 +14482,14 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('some-prop some-component'); this.runTask(function () { - return _this34.rerender(); + return _this35.rerender(); }); this.assertText('some-prop some-component'); }; _class.prototype['@test component without dash is not looked up'] = function testComponentWithoutDashIsNotLookedUp() { - var _this35 = this; + var _this36 = this; this.registerComponent('somecomponent', { template: 'somecomponent' @@ -14736,26 +14502,26 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('notsomecomponent'); this.runTask(function () { - return _this35.rerender(); + return _this36.rerender(); }); this.assertText('notsomecomponent'); this.runTask(function () { - return _this35.context.set('somecomponent', 'not not notsomecomponent'); + return _this36.context.set('somecomponent', 'not not notsomecomponent'); }); this.assertText('not not notsomecomponent'); this.runTask(function () { - return _this35.context.set('somecomponent', 'notsomecomponent'); + return _this36.context.set('somecomponent', 'notsomecomponent'); }); this.assertText('notsomecomponent'); }; _class.prototype['@test non-block with properties on attrs'] = function testNonBlockWithPropertiesOnAttrs() { - var _this36 = this; + var _this37 = this; this.registerComponent('non-block', { template: 'In layout - someProp: {{attrs.someProp}}' @@ -14768,26 +14534,26 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('In layout - someProp: something here'); this.runTask(function () { - return _this36.rerender(); + return _this37.rerender(); }); this.assertText('In layout - someProp: something here'); this.runTask(function () { - return _this36.context.set('prop', 'other thing there'); + return _this37.context.set('prop', 'other thing there'); }); this.assertText('In layout - someProp: other thing there'); this.runTask(function () { - return _this36.context.set('prop', 'something here'); + return _this37.context.set('prop', 'something here'); }); this.assertText('In layout - someProp: something here'); }; _class.prototype['@test non-block with properties overridden in init'] = function testNonBlockWithPropertiesOverriddenInInit() { - var _this37 = this; + var _this38 = this; var instance = undefined; this.registerComponent('non-block', { @@ -14808,13 +14574,13 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('In layout - someProp: value set in instance'); this.runTask(function () { - return _this37.rerender(); + return _this38.rerender(); }); this.assertText('In layout - someProp: value set in instance'); this.runTask(function () { - return _this37.context.set('prop', 'updated something passed when invoked'); + return _this38.context.set('prop', 'updated something passed when invoked'); }); this.assertText('In layout - someProp: updated something passed when invoked'); @@ -14826,7 +14592,7 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('In layout - someProp: update value set in instance'); this.runTask(function () { - return _this37.context.set('prop', 'something passed when invoked'); + return _this38.context.set('prop', 'something passed when invoked'); }); this.runTask(function () { return instance.set('someProp', 'value set in instance'); @@ -14836,7 +14602,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test rerendering component with attrs from parent'] = function testRerenderingComponentWithAttrsFromParent(assert) { - var _this38 = this; + var _this39 = this; var willUpdateCount = 0; var didReceiveAttrsCount = 0; @@ -14877,7 +14643,7 @@ babelHelpers.inherits(_class, _RenderingTest); }); expectHooks({ willUpdate: false, didReceiveAttrs: true }, function () { - _this38.render('{{non-block someProp=someProp}}', { + _this39.render('{{non-block someProp=someProp}}', { someProp: 'wycats' }); }); @@ -14886,16 +14652,16 @@ babelHelpers.inherits(_class, _RenderingTest); // Note: Hooks are not fired in Glimmer for idempotent re-renders expectHooks({ willUpdate: false, didReceiveAttrs: false }, function () { - _this38.runTask(function () { - return _this38.rerender(); + _this39.runTask(function () { + return _this39.rerender(); }); }); this.assertText('In layout - someProp: wycats'); expectHooks({ willUpdate: true, didReceiveAttrs: true }, function () { - _this38.runTask(function () { - return _this38.context.set('someProp', 'tomdale'); + _this39.runTask(function () { + return _this39.context.set('someProp', 'tomdale'); }); }); @@ -14903,16 +14669,16 @@ babelHelpers.inherits(_class, _RenderingTest); // Note: Hooks are not fired in Glimmer for idempotent re-renders expectHooks({ willUpdate: false, didReceiveAttrs: false }, function () { - _this38.runTask(function () { - return _this38.rerender(); + _this39.runTask(function () { + return _this39.rerender(); }); }); this.assertText('In layout - someProp: tomdale'); expectHooks({ willUpdate: true, didReceiveAttrs: true }, function () { - _this38.runTask(function () { - return _this38.context.set('someProp', 'wycats'); + _this39.runTask(function () { + return _this39.context.set('someProp', 'wycats'); }); }); @@ -14920,7 +14686,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test this.attrs.foo === attrs.foo === foo'] = function testThisAttrsFooAttrsFooFoo() { - var _this39 = this; + var _this40 = this; this.registerComponent('foo-bar', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4) @@ -14936,21 +14702,21 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertStableRerender(); this.runTask(function () { - _this39.context.set('model.value', 'lul'); - _this39.context.set('model.items', [1]); + _this40.context.set('model.value', 'lul'); + _this40.context.set('model.items', [1]); }); this.assertText(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5)); this.runTask(function () { - return _this39.context.set('model', { value: 'wat', items: [1, 2, 3] }); + return _this40.context.set('model', { value: 'wat', items: [1, 2, 3] }); }); this.assertText('Args: wat | wat | wat123123123'); }; _class.prototype['@test non-block with properties on self'] = function testNonBlockWithPropertiesOnSelf() { - var _this40 = this; + var _this41 = this; this.registerComponent('non-block', { template: 'In layout - someProp: {{someProp}}' @@ -14963,26 +14729,26 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('In layout - someProp: something here'); this.runTask(function () { - return _this40.rerender(); + return _this41.rerender(); }); this.assertText('In layout - someProp: something here'); this.runTask(function () { - return _this40.context.set('prop', 'something else'); + return _this41.context.set('prop', 'something else'); }); this.assertText('In layout - someProp: something else'); this.runTask(function () { - return _this40.context.set('prop', 'something here'); + return _this41.context.set('prop', 'something here'); }); this.assertText('In layout - someProp: something here'); }; _class.prototype['@test block with properties on self'] = function testBlockWithPropertiesOnSelf() { - var _this41 = this; + var _this42 = this; this.registerComponent('with-block', { template: 'In layout - someProp: {{someProp}} - {{yield}}' @@ -14995,26 +14761,26 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('In layout - someProp: something here - In template'); this.runTask(function () { - return _this41.rerender(); + return _this42.rerender(); }); this.assertText('In layout - someProp: something here - In template'); this.runTask(function () { - return _this41.context.set('prop', 'something else'); + return _this42.context.set('prop', 'something else'); }); this.assertText('In layout - someProp: something else - In template'); this.runTask(function () { - return _this41.context.set('prop', 'something here'); + return _this42.context.set('prop', 'something here'); }); this.assertText('In layout - someProp: something here - In template'); }; _class.prototype['@test block with properties on attrs'] = function testBlockWithPropertiesOnAttrs() { - var _this42 = this; + var _this43 = this; this.registerComponent('with-block', { template: 'In layout - someProp: {{attrs.someProp}} - {{yield}}' @@ -15027,26 +14793,26 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('In layout - someProp: something here - In template'); this.runTask(function () { - return _this42.rerender(); + return _this43.rerender(); }); this.assertText('In layout - someProp: something here - In template'); this.runTask(function () { - return _this42.context.set('prop', 'something else'); + return _this43.context.set('prop', 'something else'); }); this.assertText('In layout - someProp: something else - In template'); this.runTask(function () { - return _this42.context.set('prop', 'something here'); + return _this43.context.set('prop', 'something here'); }); this.assertText('In layout - someProp: something here - In template'); }; _class.prototype['@test static arbitrary number of positional parameters'] = function testStaticArbitraryNumberOfPositionalParameters(assert) { - var _this43 = this; + var _this44 = this; this.registerComponent('sample-component', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ @@ -15061,7 +14827,7 @@ babelHelpers.inherits(_class, _RenderingTest); assert.equal(this.$('#args-5').text(), 'Foo4Bar5Baz'); this.runTask(function () { - return _this43.rerender(); + return _this44.rerender(); }); assert.equal(this.$('#args-3').text(), 'Foo4Bar'); @@ -15069,7 +14835,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test arbitrary positional parameter conflict with hash parameter is reported'] = function testArbitraryPositionalParameterConflictWithHashParameterIsReported() { - var _this44 = this; + var _this45 = this; this.registerComponent('sample-component', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ @@ -15079,14 +14845,14 @@ babelHelpers.inherits(_class, _RenderingTest); }); expectAssertion(function () { - _this44.render('{{sample-component "Foo" 4 "Bar" names=numbers id="args-3"}}', { + _this45.render('{{sample-component "Foo" 4 "Bar" names=numbers id="args-3"}}', { numbers: [1, 2, 3] }); }, 'You cannot specify positional parameters and the hash argument `names`.'); }; _class.prototype['@test can use hash parameter instead of arbitrary positional param [GH #12444]'] = function testCanUseHashParameterInsteadOfArbitraryPositionalParamGH12444(assert) { - var _this45 = this; + var _this46 = this; this.registerComponent('sample-component', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ @@ -15102,38 +14868,38 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('Foo4Bar'); this.runTask(function () { - return _this45.rerender(); + return _this46.rerender(); }); this.assertText('Foo4Bar'); this.runTask(function () { - return _this45.context.get('things').pushObject(5); + return _this46.context.get('things').pushObject(5); }); this.assertText('Foo4Bar5'); this.runTask(function () { - return _this45.context.get('things').shiftObject(); + return _this46.context.get('things').shiftObject(); }); this.assertText('4Bar5'); this.runTask(function () { - return _this45.context.get('things').clear(); + return _this46.context.get('things').clear(); }); this.assertText(''); this.runTask(function () { - return _this45.context.set('things', _emberRuntime.A(['Foo', 4, 'Bar'])); + return _this46.context.set('things', _emberRuntime.A(['Foo', 4, 'Bar'])); }); this.assertText('Foo4Bar'); }; _class.prototype['@test can use hash parameter instead of positional param'] = function testCanUseHashParameterInsteadOfPositionalParam(assert) { - var _this46 = this; + var _this47 = this; this.registerComponent('sample-component', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ @@ -15150,7 +14916,7 @@ babelHelpers.inherits(_class, _RenderingTest); assert.equal(this.$('#no-positional').text(), 'one - two'); this.runTask(function () { - return _this46.rerender(); + return _this47.rerender(); }); assert.equal(this.$('#two-positional').text(), 'one - two'); @@ -15159,7 +14925,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test dynamic arbitrary number of positional parameters'] = function testDynamicArbitraryNumberOfPositionalParameters(assert) { - var _this47 = this; + var _this48 = this; this.registerComponent('sample-component', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ @@ -15176,33 +14942,33 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('Foo4'); this.runTask(function () { - return _this47.rerender(); + return _this48.rerender(); }); this.assertText('Foo4'); this.runTask(function () { - return _this47.context.set('user1', 'Bar'); + return _this48.context.set('user1', 'Bar'); }); this.assertText('Bar4'); this.runTask(function () { - return _this47.context.set('user2', '5'); + return _this48.context.set('user2', '5'); }); this.assertText('Bar5'); this.runTask(function () { - _this47.context.set('user1', 'Foo'); - _this47.context.set('user2', 4); + _this48.context.set('user1', 'Foo'); + _this48.context.set('user2', 4); }); this.assertText('Foo4'); }; _class.prototype['@test with ariaRole specified'] = function testWithAriaRoleSpecified() { - var _this48 = this; + var _this49 = this; this.registerComponent('aria-test', { template: 'Here!' @@ -15215,26 +14981,26 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertComponentElement(this.firstChild, { attrs: { role: 'main' } }); this.runTask(function () { - return _this48.rerender(); + return _this49.rerender(); }); this.assertComponentElement(this.firstChild, { attrs: { role: 'main' } }); this.runTask(function () { - return _this48.context.set('role', 'input'); + return _this49.context.set('role', 'input'); }); this.assertComponentElement(this.firstChild, { attrs: { role: 'input' } }); this.runTask(function () { - return _this48.context.set('role', 'main'); + return _this49.context.set('role', 'main'); }); this.assertComponentElement(this.firstChild, { attrs: { role: 'main' } }); }; _class.prototype['@test `template` specified in component is overriden by block'] = function testTemplateSpecifiedInComponentIsOverridenByBlock() { - var _this49 = this; + var _this50 = this; this.registerComponent('with-template', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -15250,26 +15016,26 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('[In layout - with-block] [In block - Whoop, whoop!][In layout - without-block] '); this.runTask(function () { - return _this49.rerender(); + return _this50.rerender(); }); this.assertText('[In layout - with-block] [In block - Whoop, whoop!][In layout - without-block] '); this.runTask(function () { - return _this49.context.set('name', 'Ole, ole'); + return _this50.context.set('name', 'Ole, ole'); }); this.assertText('[In layout - with-block] [In block - Ole, ole][In layout - without-block] '); this.runTask(function () { - return _this49.context.set('name', 'Whoop, whoop!'); + return _this50.context.set('name', 'Whoop, whoop!'); }); this.assertText('[In layout - with-block] [In block - Whoop, whoop!][In layout - without-block] '); }; _class.prototype['@test hasBlock is true when block supplied'] = function testHasBlockIsTrueWhenBlockSupplied() { - var _this50 = this; + var _this51 = this; this.registerComponent('with-block', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject12) @@ -15280,14 +15046,14 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('In template'); this.runTask(function () { - return _this50.rerender(); + return _this51.rerender(); }); this.assertText('In template'); }; _class.prototype['@test hasBlock is false when no block supplied'] = function testHasBlockIsFalseWhenNoBlockSupplied() { - var _this51 = this; + var _this52 = this; this.registerComponent('with-block', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject12) @@ -15298,14 +15064,14 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('No Block!'); this.runTask(function () { - return _this51.rerender(); + return _this52.rerender(); }); this.assertText('No Block!'); }; _class.prototype['@test hasBlockParams is true when block param supplied'] = function testHasBlockParamsIsTrueWhenBlockParamSupplied() { - var _this52 = this; + var _this53 = this; this.registerComponent('with-block', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject14) @@ -15316,14 +15082,14 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('In template - In Component'); this.runTask(function () { - return _this52.rerender(); + return _this53.rerender(); }); this.assertText('In template - In Component'); }; _class.prototype['@test hasBlockParams is false when no block param supplied'] = function testHasBlockParamsIsFalseWhenNoBlockParamSupplied() { - var _this53 = this; + var _this54 = this; this.registerComponent('with-block', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject16) @@ -15334,14 +15100,14 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('In block No Block Param!'); this.runTask(function () { - return _this53.rerender(); + return _this54.rerender(); }); this.assertText('In block No Block Param!'); }; _class.prototype['@test static named positional parameters'] = function testStaticNamedPositionalParameters() { - var _this54 = this; + var _this55 = this; this.registerComponent('sample-component', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ @@ -15355,14 +15121,14 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('Quint4'); this.runTask(function () { - return _this54.rerender(); + return _this55.rerender(); }); this.assertText('Quint4'); }; _class.prototype['@test dynamic named positional parameters'] = function testDynamicNamedPositionalParameters() { - var _this55 = this; + var _this56 = this; this.registerComponent('sample-component', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ @@ -15379,33 +15145,33 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('Quint4'); this.runTask(function () { - return _this55.rerender(); + return _this56.rerender(); }); this.assertText('Quint4'); this.runTask(function () { - return _this55.context.set('myName', 'Sergio'); + return _this56.context.set('myName', 'Sergio'); }); this.assertText('Sergio4'); this.runTask(function () { - return _this55.context.set('myAge', 2); + return _this56.context.set('myAge', 2); }); this.assertText('Sergio2'); this.runTask(function () { - _this55.context.set('myName', 'Quint'); - _this55.context.set('myAge', 4); + _this56.context.set('myName', 'Quint'); + _this56.context.set('myAge', 4); }); this.assertText('Quint4'); }; _class.prototype['@test if a value is passed as a non-positional parameter, it raises an assertion'] = function testIfAValueIsPassedAsANonPositionalParameterItRaisesAnAssertion() { - var _this56 = this; + var _this57 = this; this.registerComponent('sample-component', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend().reopenClass({ @@ -15415,7 +15181,7 @@ babelHelpers.inherits(_class, _RenderingTest); }); expectAssertion(function () { - _this56.render('{{sample-component notMyName name=myName}}', { + _this57.render('{{sample-component notMyName name=myName}}', { myName: 'Quint', notMyName: 'Sergio' }); @@ -15423,7 +15189,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test yield to inverse'] = function testYieldToInverse() { - var _this57 = this; + var _this58 = this; this.registerComponent('my-if', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject18) @@ -15436,19 +15202,19 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('Yes:Hello42'); this.runTask(function () { - return _this57.rerender(); + return _this58.rerender(); }); this.assertText('Yes:Hello42'); this.runTask(function () { - return _this57.context.set('activated', false); + return _this58.context.set('activated', false); }); this.assertText('No:Goodbye'); this.runTask(function () { - return _this57.context.set('activated', true); + return _this58.context.set('activated', true); }); this.assertText('Yes:Hello42'); @@ -15676,7 +15442,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test component in template of a yielding component should have the proper parentView'] = function testComponentInTemplateOfAYieldingComponentShouldHaveTheProperParentView(assert) { - var _this58 = this; + var _this59 = this; var outer = undefined, innerTemplate = undefined, @@ -15717,7 +15483,7 @@ babelHelpers.inherits(_class, _RenderingTest); assert.equal(outer.parentView, this.context, 'x-outer receives the ambient scope as its parentView'); this.runTask(function () { - return _this58.rerender(); + return _this59.rerender(); }); assert.equal(innerTemplate.parentView, outer, 'receives the wrapping component as its parentView in template blocks'); @@ -15726,7 +15492,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test newly-added sub-components get correct parentView'] = function testNewlyAddedSubComponentsGetCorrectParentView(assert) { - var _this59 = this; + var _this60 = this; var outer = undefined, inner = undefined; @@ -15756,31 +15522,27 @@ babelHelpers.inherits(_class, _RenderingTest); assert.equal(outer.parentView, this.context, 'x-outer receives the ambient scope as its parentView'); this.runTask(function () { - return _this59.rerender(); + return _this60.rerender(); }); assert.equal(outer.parentView, this.context, 'x-outer receives the ambient scope as its parentView (after rerender)'); this.runTask(function () { - return _this59.context.set('showInner', true); + return _this60.context.set('showInner', true); }); assert.equal(outer.parentView, this.context, 'x-outer receives the ambient scope as its parentView'); assert.equal(inner.parentView, outer, 'receives the wrapping component as its parentView in template blocks'); this.runTask(function () { - return _this59.context.set('showInner', false); + return _this60.context.set('showInner', false); }); assert.equal(outer.parentView, this.context, 'x-outer receives the ambient scope as its parentView'); }; _class.prototype['@test when a property is changed during children\'s rendering'] = function testWhenAPropertyIsChangedDuringChildrenSRendering(assert) { - var _this60 = this; - - if (true) { - expectDeprecation(/modified value twice on <\(.+> in a single render/); - } + var _this61 = this; var outer = undefined, middle = undefined; @@ -15823,24 +15585,27 @@ babelHelpers.inherits(_class, _RenderingTest); assert.equal(this.$('#middle-value').text(), '', 'initial render of middle (observers do not run during init)'); this.runTask(function () { - return _this60.rerender(); + return _this61.rerender(); }); assert.equal(this.$('#inner-value').text(), '1', 'initial render of inner'); assert.equal(this.$('#middle-value').text(), '', 'initial render of middle (observers do not run during init)'); - if (!true) { + var expectedBacktrackingMessage = /modified "value" twice on <\(.+> in a single render\. It was rendered in "component:x-middle" and modified in "component:x-inner"/; + + if (true) { + expectDeprecation(expectedBacktrackingMessage); + this.runTask(function () { + return outer.set('value', 2); + }); + } else { expectAssertion(function () { - _this60.runTask(function () { + _this61.runTask(function () { return outer.set('value', 2); }); - }, /modified value twice on <\(.+> in a single render/); + }, expectedBacktrackingMessage); return; - } else { - this.runTask(function () { - return outer.set('value', 2); - }); } assert.equal(this.$('#inner-value').text(), '2', 'second render of inner'); @@ -15862,14 +15627,9 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test when a shared dependency is changed during children\'s rendering'] = function testWhenASharedDependencyIsChangedDuringChildrenSRendering(assert) { - var _this61 = this; - - if (true) { - expectDeprecation(/modified wrapper.content twice on in a single render/); - } + var _this62 = this; - var outer = undefined, - middle = undefined; + var outer = undefined; this.registerComponent('x-outer', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -15885,10 +15645,6 @@ babelHelpers.inherits(_class, _RenderingTest); this.registerComponent('x-inner', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ - init: function () { - this._super.apply(this, arguments); - middle = this; - }, didReceiveAttrs: function () { this.get('wrapper').set('content', this.get('value')); }, @@ -15897,21 +15653,24 @@ babelHelpers.inherits(_class, _RenderingTest); template: '
    {{wrapper.content}}
    ' }); - if (!true) { + var expectedBacktrackingMessage = /modified "wrapper\.content" twice on in a single render\. It was rendered in "component:x-outer" and modified in "component:x-inner"/; + + if (true) { + expectDeprecation(expectedBacktrackingMessage); + this.render('{{x-outer}}'); + } else { expectAssertion(function () { - _this61.render('{{x-outer}}'); - }, /modified wrapper.content twice on in a single render/); + _this62.render('{{x-outer}}'); + }, expectedBacktrackingMessage); return; - } else { - this.render('{{x-outer}}'); } assert.equal(this.$('#inner-value').text(), '1', 'initial render of inner'); assert.equal(this.$('#outer-value').text(), '1', 'initial render of outer'); this.runTask(function () { - return _this61.rerender(); + return _this62.rerender(); }); assert.equal(this.$('#inner-value').text(), '1', 're-render of inner'); @@ -15940,7 +15699,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test non-block with each rendering child components'] = function testNonBlockWithEachRenderingChildComponents() { - var _this62 = this; + var _this63 = this; this.registerComponent('non-block', { template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject38) @@ -15957,43 +15716,37 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('In layout. [Child: Tom.][Child: Dick.][Child: Harry.]'); this.runTask(function () { - return _this62.rerender(); + return _this63.rerender(); }); this.assertText('In layout. [Child: Tom.][Child: Dick.][Child: Harry.]'); this.runTask(function () { - return _this62.context.get('items').pushObject('Sergio'); + return _this63.context.get('items').pushObject('Sergio'); }); this.assertText('In layout. [Child: Tom.][Child: Dick.][Child: Harry.][Child: Sergio.]'); this.runTask(function () { - return _this62.context.get('items').shiftObject(); + return _this63.context.get('items').shiftObject(); }); this.assertText('In layout. [Child: Dick.][Child: Harry.][Child: Sergio.]'); this.runTask(function () { - return _this62.context.set('items', _emberRuntime.A(['Tom', 'Dick', 'Harry'])); + return _this63.context.set('items', _emberRuntime.A(['Tom', 'Dick', 'Harry'])); }); this.assertText('In layout. [Child: Tom.][Child: Dick.][Child: Harry.]'); }; _class.prototype['@test specifying classNames results in correct class'] = function testSpecifyingClassNamesResultsInCorrectClass(assert) { - var _this63 = this; - - var clickyThing = undefined; + var _this64 = this; this.registerComponent('some-clicky-thing', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ tagName: 'button', - classNames: ['foo', 'bar'], - init: function () { - this._super.apply(this, arguments); - clickyThing = this; - } + classNames: ['foo', 'bar'] }) }); @@ -16009,7 +15762,7 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertComponentElement(this.firstChild, { tagName: 'button', attrs: { 'class': _emberGlimmerTestsUtilsTestHelpers.classes(expectedClassNames.join(' ')) } }); this.runTask(function () { - return _this63.rerender(); + return _this64.rerender(); }); assert.ok(this.$('button').is('.foo.bar.baz.ember-view'), 'the element has the correct classes: ' + this.$('button').attr('class') + ' (rerender)'); @@ -16019,17 +15772,12 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test specifying custom concatenatedProperties avoids clobbering'] = function testSpecifyingCustomConcatenatedPropertiesAvoidsClobbering(assert) { - var _this64 = this; + var _this65 = this; - var clickyThing = undefined; this.registerComponent('some-clicky-thing', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ concatenatedProperties: ['blahzz'], - blahzz: ['blark', 'pory'], - init: function () { - this._super.apply(this, arguments); - clickyThing = this; - } + blahzz: ['blark', 'pory'] }), template: _emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject40) }); @@ -16039,14 +15787,14 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('blarkporybaz- Click Me'); this.runTask(function () { - return _this64.rerender(); + return _this65.rerender(); }); this.assertText('blarkporybaz- Click Me'); }; _class.prototype['@test a two way binding flows upstream when consumed in the template'] = function testATwoWayBindingFlowsUpstreamWhenConsumedInTheTemplate() { - var _this65 = this; + var _this66 = this; var component = undefined; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -16069,7 +15817,7 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('initial value - initial value'); this.runTask(function () { - return _this65.rerender(); + return _this66.rerender(); }); this.assertText('initial value - initial value'); @@ -16095,14 +15843,14 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText(' - '); this.runTask(function () { - _this65.component.set('localBar', 'initial value'); + _this66.component.set('localBar', 'initial value'); }); this.assertText('initial value - initial value'); }; _class.prototype['@test a two way binding flows upstream through a CP when consumed in the template'] = function testATwoWayBindingFlowsUpstreamThroughACPWhenConsumedInTheTemplate() { - var _this66 = this; + var _this67 = this; var component = undefined; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -16136,7 +15884,7 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('initial value - initial value'); this.runTask(function () { - return _this66.rerender(); + return _this67.rerender(); }); this.assertText('initial value - initial value'); @@ -16148,14 +15896,14 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('updated value - updated value'); this.runTask(function () { - _this66.component.set('localBar', 'initial value'); + _this67.component.set('localBar', 'initial value'); }); this.assertText('initial value - initial value'); }; _class.prototype['@test a two way binding flows upstream through a CP without template consumption'] = function testATwoWayBindingFlowsUpstreamThroughACPWithoutTemplateConsumption() { - var _this67 = this; + var _this68 = this; var component = undefined; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -16188,7 +15936,7 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('initial value'); this.runTask(function () { - return _this67.rerender(); + return _this68.rerender(); }); this.assertText('initial value'); @@ -16200,14 +15948,14 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('updated value'); this.runTask(function () { - _this67.component.set('localBar', 'initial value'); + _this68.component.set('localBar', 'initial value'); }); this.assertText('initial value'); }; _class.prototype['@test services can be injected into components'] = function testServicesCanBeInjectedIntoComponents() { - var _this68 = this; + var _this69 = this; var service = undefined; this.registerService('name', _emberRuntime.Service.extend({ @@ -16230,7 +15978,7 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('Jackson'); this.runTask(function () { - return _this68.rerender(); + return _this69.rerender(); }); this.assertText('Jackson'); @@ -16248,8 +15996,22 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('Jackson'); }; + _class.prototype['@test injecting an unknown service raises an exception'] = function testInjectingAnUnknownServiceRaisesAnException(assert) { + var _this70 = this; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + missingService: _emberRuntime.inject.service() + }) + }); + + expectAssertion(function () { + _this70.render('{{foo-bar}}'); + }, 'Attempting to inject an unknown injection: \'service:missingService\''); + }; + _class.prototype['@test can access `actions` hash via `_actions` [DEPRECATED]'] = function testCanAccessActionsHashVia_actionsDEPRECATED() { - var _this69 = this; + var _this71 = this; var component = undefined; @@ -16273,12 +16035,12 @@ babelHelpers.inherits(_class, _RenderingTest); this.assert.strictEqual(component.actions.derp, derp); expectDeprecation(function () { - _this69.assert.strictEqual(component._actions.derp, derp); + _this71.assert.strictEqual(component._actions.derp, derp); }, 'Usage of `_actions` is deprecated, use `actions` instead.'); }; _class.prototype['@test throws if `this._super` is not called from `init`'] = function testThrowsIfThis_superIsNotCalledFromInit() { - var _this70 = this; + var _this72 = this; this.registerComponent('foo-bar', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -16287,16 +16049,16 @@ babelHelpers.inherits(_class, _RenderingTest); }); expectAssertion(function () { - _this70.render('{{foo-bar}}'); + _this72.render('{{foo-bar}}'); }, /You must call `this._super\(...arguments\);` when overriding `init` on a framework object. Please update .* to call `this._super\(...arguments\);` from `init`./); }; _class.prototype['@test should toggle visibility with isVisible'] = function testShouldToggleVisibilityWithIsVisible(assert) { - var _this71 = this; + var _this73 = this; var assertStyle = function (expected) { var matcher = _emberGlimmerTestsUtilsTestHelpers.styles(expected); - var actual = _this71.firstChild.getAttribute('style'); + var actual = _this73.firstChild.getAttribute('style'); assert.pushResult({ result: matcher.match(actual), @@ -16319,18 +16081,18 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertStableRerender(); this.runTask(function () { - _emberMetal.set(_this71.context, 'visible', true); + _emberMetal.set(_this73.context, 'visible', true); }); assertStyle(''); this.runTask(function () { - _emberMetal.set(_this71.context, 'visible', false); + _emberMetal.set(_this73.context, 'visible', false); }); assertStyle('display: none;'); }; _class.prototype['@test isVisible does not overwrite component style'] = function testIsVisibleDoesNotOverwriteComponentStyle(assert) { - var _this72 = this; + var _this74 = this; this.registerComponent('foo-bar', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -16353,7 +16115,7 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertStableRerender(); this.runTask(function () { - _emberMetal.set(_this72.context, 'visible', true); + _emberMetal.set(_this74.context, 'visible', true); }); this.assertComponentElement(this.firstChild, { @@ -16362,7 +16124,7 @@ babelHelpers.inherits(_class, _RenderingTest); }); this.runTask(function () { - _emberMetal.set(_this72.context, 'visible', false); + _emberMetal.set(_this74.context, 'visible', false); }); this.assertComponentElement(this.firstChild, { @@ -16372,11 +16134,11 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test adds isVisible binding when style binding is missing and other bindings exist'] = function testAddsIsVisibleBindingWhenStyleBindingIsMissingAndOtherBindingsExist(assert) { - var _this73 = this; + var _this75 = this; var assertStyle = function (expected) { var matcher = _emberGlimmerTestsUtilsTestHelpers.styles(expected); - var actual = _this73.firstChild.getAttribute('style'); + var actual = _this75.firstChild.getAttribute('style'); assert.pushResult({ result: matcher.match(actual), @@ -16404,14 +16166,14 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertStableRerender(); this.runTask(function () { - _emberMetal.set(_this73.context, 'visible', true); + _emberMetal.set(_this75.context, 'visible', true); }); assertStyle(''); this.runTask(function () { - _emberMetal.set(_this73.context, 'visible', false); - _emberMetal.set(_this73.context, 'foo', 'woo'); + _emberMetal.set(_this75.context, 'visible', false); + _emberMetal.set(_this75.context, 'foo', 'woo'); }); assertStyle('display: none;'); @@ -16419,14 +16181,14 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test it can use readDOMAttr to read input value'] = function testItCanUseReadDOMAttrToReadInputValue() { - var _this74 = this; + var _this76 = this; var component = undefined; var assertElement = function (expectedValue) { // value is a property, not an attribute - _this74.assertHTML(''); - _this74.assert.equal(_this74.firstChild.value, expectedValue, 'value property is correct'); - _this74.assert.equal(_emberMetal.get(component, 'value'), expectedValue, 'component.get("value") is correct'); + _this76.assertHTML(''); + _this76.assert.equal(_this76.firstChild.value, expectedValue, 'value property is correct'); + _this76.assert.equal(_emberMetal.get(component, 'value'), expectedValue, 'component.get("value") is correct'); }; this.registerComponent('one-way-input', { @@ -16455,15 +16217,15 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertStableRerender(); this.runTask(function () { - _this74.firstChild.value = 'bar'; - _this74.$('input').trigger('change'); + _this76.firstChild.value = 'bar'; + _this76.$('input').trigger('change'); }); assertElement('bar'); this.runTask(function () { - _this74.firstChild.value = 'foo'; - _this74.$('input').trigger('change'); + _this76.firstChild.value = 'foo'; + _this76.$('input').trigger('change'); }); assertElement('foo'); @@ -16475,16 +16237,14 @@ babelHelpers.inherits(_class, _RenderingTest); assertElement('bar'); this.runTask(function () { - _this74.firstChild.value = 'foo'; - _this74.$('input').trigger('change'); + _this76.firstChild.value = 'foo'; + _this76.$('input').trigger('change'); }); assertElement('foo'); }; _class.prototype['@test child triggers revalidate during parent destruction (GH#13846)'] = function testChildTriggersRevalidateDuringParentDestructionGH13846() { - var select = undefined; - this.registerComponent('x-select', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ tagName: 'select', @@ -16493,8 +16253,6 @@ babelHelpers.inherits(_class, _RenderingTest); this._super(); this.options = _emberRuntime.A([]); this.value = null; - - select = this; }, updateValue: function () { @@ -16572,7 +16330,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test using didInitAttrs as an event is deprecated'] = function testUsingDidInitAttrsAsAnEventIsDeprecated(assert) { - var _this75 = this; + var _this77 = this; this.registerComponent('foo-bar', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -16583,7 +16341,7 @@ babelHelpers.inherits(_class, _RenderingTest); }); expectDeprecation(function () { - _this75.render('{{foo-bar}}'); + _this77.render('{{foo-bar}}'); }, /didInitAttrs called/); }; @@ -16594,7 +16352,7 @@ babelHelpers.inherits(_class, _RenderingTest); // like there is no real "attrs" here, and there is no "update" pass. _class.prototype['@test did{Init,Receive}Attrs fires even if component is not rendered'] = function testDidInitReceiveAttrsFiresEvenIfComponentIsNotRendered(assert) { - var _this76 = this; + var _this78 = this; expectDeprecation(/didInitAttrs called/); @@ -16628,7 +16386,7 @@ babelHelpers.inherits(_class, _RenderingTest); assert.strictEqual(didReceiveAttrsCount, 0, 'precond: didReceiveAttrs is not fired'); this.runTask(function () { - return _this76.component = _this76.owner.lookup('component:foo-bar'); + return _this78.component = _this78.owner.lookup('component:foo-bar'); }); assert.strictEqual(didInitAttrsCount, 1, 'precond: didInitAttrs is fired'); @@ -16636,7 +16394,7 @@ babelHelpers.inherits(_class, _RenderingTest); }; _class.prototype['@test did{Init,Receive}Attrs fires after .init() but before observers become active'] = function testDidInitReceiveAttrsFiresAfterInitButBeforeObserversBecomeActive(assert) { - var _this77 = this; + var _this79 = this; expectDeprecation(/didInitAttrs called/); @@ -16683,7 +16441,7 @@ babelHelpers.inherits(_class, _RenderingTest); assert.strictEqual(barCopyDidChangeCount, 0, 'expected NO observer firing for: barCopy'); this.runTask(function () { - return _emberMetal.set(_this77.context, 'foo', 5); + return _emberMetal.set(_this79.context, 'foo', 5); }); this.assertText('5-2-3-4'); @@ -16692,7 +16450,7 @@ babelHelpers.inherits(_class, _RenderingTest); assert.strictEqual(barCopyDidChangeCount, 0, 'expected NO observer firing for: barCopy'); this.runTask(function () { - return _emberMetal.set(_this77.context, 'bar', 7); + return _emberMetal.set(_this79.context, 'bar', 7); }); this.assertText('5-2-7-8'); @@ -16701,8 +16459,84 @@ babelHelpers.inherits(_class, _RenderingTest); assert.strictEqual(barCopyDidChangeCount, 1, 'expected observer firing for: barCopy'); }; + _class.prototype['@test overriding didReceiveAttrs does not trigger deprecation'] = function testOverridingDidReceiveAttrsDoesNotTriggerDeprecation(assert) { + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didReceiveAttrs: function () { + assert.equal(1, this.get('foo'), 'expected attrs to have correct value'); + } + }), + + template: '{{foo}}-{{fooCopy}}-{{bar}}-{{barCopy}}' + }); + + this.render('{{foo-bar foo=foo bar=bar}}', { foo: 1, bar: 3 }); + }; + + _class.prototype['@test can access didReceiveAttrs arguments [DEPRECATED]'] = function testCanAccessDidReceiveAttrsArgumentsDEPRECATED(assert) { + expectDeprecation(/didReceiveAttrs.*stop taking arguments/); + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didReceiveAttrs: function (_ref4) { + var attrs = _ref4.attrs; + + assert.equal(1, attrs.foo.value, 'expected attrs to have correct value'); + } + }), + + template: '{{foo}}-{{fooCopy}}-{{bar}}-{{barCopy}}' + }); + + this.render('{{foo-bar foo=foo bar=bar}}', { foo: 1, bar: 3 }); + }; + + _class.prototype['@test can access didUpdateAttrs arguments [DEPRECATED]'] = function testCanAccessDidUpdateAttrsArgumentsDEPRECATED(assert) { + var _this80 = this; + + expectDeprecation(/didUpdateAttrs.*stop taking arguments/); + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didUpdateAttrs: function (_ref5) { + var newAttrs = _ref5.newAttrs; + + assert.equal(5, newAttrs.foo.value, "expected newAttrs to have new value"); + } + }), + + template: '{{foo}}-{{fooCopy}}-{{bar}}-{{barCopy}}' + }); + + this.render('{{foo-bar foo=foo bar=bar}}', { foo: 1, bar: 3 }); + + this.runTask(function () { + return _emberMetal.set(_this80.context, 'foo', 5); + }); + }; + + _class.prototype['@test overriding didUpdateAttrs does not trigger deprecation'] = function testOverridingDidUpdateAttrsDoesNotTriggerDeprecation(assert) { + var _this81 = this; + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + didUpdateAttrs: function () { + assert.equal(5, this.get('foo'), "expected newAttrs to have new value"); + } + }), + + template: '{{foo}}-{{fooCopy}}-{{bar}}-{{barCopy}}' + }); + + this.render('{{foo-bar foo=foo bar=bar}}', { foo: 1, bar: 3 }); + + this.runTask(function () { + return _emberMetal.set(_this81.context, 'foo', 5); + }); + }; + _class.prototype['@test returning `true` from an action does not bubble if `target` is not specified (GH#14275)'] = function testReturningTrueFromAnActionDoesNotBubbleIfTargetIsNotSpecifiedGH14275(assert) { - var _this78 = this; + var _this82 = this; this.registerComponent('display-toggle', { ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -16726,12 +16560,12 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('Show'); this.runTask(function () { - return _this78.$('button').click(); + return _this82.$('button').click(); }); }; _class.prototype['@test returning `true` from an action bubbles to the `target` if specified'] = function testReturningTrueFromAnActionBubblesToTheTargetIfSpecified(assert) { - var _this79 = this; + var _this83 = this; assert.expect(4); @@ -16758,12 +16592,12 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('Show'); this.runTask(function () { - return _this79.$('button').click(); + return _this83.$('button').click(); }); }; _class.prototype['@test component yielding in an {{#each}} has correct block values after rerendering (GH#14284)'] = function testComponentYieldingInAnEachHasCorrectBlockValuesAfterRerenderingGH14284() { - var _this80 = this; + var _this84 = this; this.registerComponent('list-items', { template: '{{#each items as |item|}}{{yield item}}{{/each}}' @@ -16779,13 +16613,13 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertStableRerender(); this.runTask(function () { - return _emberMetal.set(_this80.context, 'editMode', true); + return _emberMetal.set(_this84.context, 'editMode', true); }); this.assertText('|foo|Remove foo|bar|Remove bar|qux|Remove qux|baz|Remove baz'); this.runTask(function () { - return _emberMetal.set(_this80.context, 'editMode', false); + return _emberMetal.set(_this84.context, 'editMode', false); }); this.assertText('|foo||bar||qux||baz|'); @@ -16871,21 +16705,13 @@ babelHelpers.inherits(_class, _RenderingTest); return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/components/curly-components-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/curly-components-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/curly-components-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/curly-components-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/curly-components-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/curly-components-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/curly-components-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/curly-components-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/curly-components-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/dynamic-components-test', ['exports', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case'], function (exports, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase) { @@ -17703,24 +17529,51 @@ babelHelpers.inherits(_class, _RenderingTest); this.assertText('Foo4'); }; + _class.prototype['@test component helper emits useful backtracking re-render assertion message'] = function testComponentHelperEmitsUsefulBacktrackingReRenderAssertionMessage(assert) { + var _this25 = this; + + this.registerComponent('outer-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + this.set('person', { name: 'Alex' }); + } + }), + template: 'Hi {{person.name}}! {{component "error-component" person=person}}' + }); + + this.registerComponent('error-component', { + ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + this.set('person.name', { name: 'Ben' }); + } + }), + template: '{{person.name}}' + }); + + var expectedBacktrackingMessage = /modified "person\.name" twice on \[object Object\] in a single render\. It was rendered in "component:outer-component" and modified in "component:error-component"/; + + if (true) { + expectDeprecation(expectedBacktrackingMessage); + this.render('{{component componentName}}', { componentName: 'outer-component' }); + } else { + expectAssertion(function () { + _this25.render('{{component componentName}}', { componentName: 'outer-component' }); + }, expectedBacktrackingMessage); + } + }; + return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/components/dynamic-components-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/dynamic-components-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/dynamic-components-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/dynamic-components-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/dynamic-components-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/dynamic-components-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/dynamic-components-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/dynamic-components-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/dynamic-components-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/fragment-components-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { @@ -17786,14 +17639,9 @@ babelHelpers.inherits(_class, _RenderingTest); _class.prototype['@test throws an error if an event function is defined in a tagless component'] = function testThrowsAnErrorIfAnEventFunctionIsDefinedInATaglessComponent() { var _this = this; - var instance = undefined; var template = 'hit dem folks'; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ tagName: '', - init: function () { - this._super(); - instance = this; - }, click: function () {} }); @@ -17807,14 +17655,9 @@ babelHelpers.inherits(_class, _RenderingTest); _class.prototype['@test throws an error if a custom defined event function is defined in a tagless component'] = function testThrowsAnErrorIfACustomDefinedEventFunctionIsDefinedInATaglessComponent() { var _this2 = this; - var instance = undefined; var template = 'hit dem folks'; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ tagName: '', - init: function () { - this._super(); - instance = this; - }, folks: function () {} }); @@ -17828,14 +17671,9 @@ babelHelpers.inherits(_class, _RenderingTest); _class.prototype['@test throws an error if `tagName` is an empty string and `classNameBindings` are specified'] = function testThrowsAnErrorIfTagNameIsAnEmptyStringAndClassNameBindingsAreSpecified() { var _this3 = this; - var instance = undefined; var template = 'hit dem folks'; var FooBarComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ tagName: '', - init: function () { - this._super(); - instance = this; - }, foo: true, classNameBindings: ['foo:is-foo:is-bar'] }); @@ -18016,21 +17854,13 @@ babelHelpers.inherits(_class, _RenderingTest); return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/components/fragment-components-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/fragment-components-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/fragment-components-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/fragment-components-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/fragment-components-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/fragment-components-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/fragment-components-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/fragment-components-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/fragment-components-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/instrumentation-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { @@ -18180,6 +18010,7 @@ enifed('ember-glimmer/tests/integration/components/instrumentation-test', ['expo _class.prototype.assertPayload = function assertPayload(payload, component, initialRender) { this.assert.equal(payload.object, component.toString(), 'payload.object'); + this.assert.ok(payload.containerKey, 'the container key should be present'); this.assert.equal(payload.containerKey, component._debugContainerKey, 'payload.containerKey'); this.assert.equal(payload.view, component, 'payload.view'); this.assert.strictEqual(payload.initialRender, initialRender, 'payload.initialRender'); @@ -18188,21 +18019,13 @@ enifed('ember-glimmer/tests/integration/components/instrumentation-test', ['expo return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/components/instrumentation-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/instrumentation-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/instrumentation-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/instrumentation-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/instrumentation-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/instrumentation-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/instrumentation-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/instrumentation-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/instrumentation-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/life-cycle-test', ['exports', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-views', 'ember-glimmer/tests/utils/test-helpers', 'ember-utils', 'internal-test-helpers'], function (exports, _emberMetal, _emberRuntime, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberViews, _emberGlimmerTestsUtilsTestHelpers, _emberUtils, _internalTestHelpers) { @@ -18530,7 +18353,7 @@ babelHelpers.inherits(LifeCycleHooksTest, _RenderingTest); interactive: [ // Sync hooks - ['the-top', 'init'], ['the-top', 'didInitAttrs', { attrs: topAttrs }], ['the-top', 'didReceiveAttrs', { newAttrs: topAttrs }], ['the-top', 'on(init)'], ['the-top', 'willRender'], ['the-top', 'willInsertElement'], ['the-middle', 'init'], ['the-middle', 'didInitAttrs', { attrs: middleAttrs }], ['the-middle', 'didReceiveAttrs', { newAttrs: middleAttrs }], ['the-middle', 'on(init)'], ['the-middle', 'willRender'], ['the-middle', 'willInsertElement'], ['the-bottom', 'init'], ['the-bottom', 'didInitAttrs', { attrs: bottomAttrs }], ['the-bottom', 'didReceiveAttrs', { newAttrs: bottomAttrs }], ['the-bottom', 'on(init)'], ['the-bottom', 'willRender'], ['the-bottom', 'willInsertElement'], + ['the-top', 'init'], ['the-top', 'didInitAttrs', { attrs: topAttrs, newAttrs: topAttrs }], ['the-top', 'didReceiveAttrs', { attrs: topAttrs, newAttrs: topAttrs }], ['the-top', 'on(init)'], ['the-top', 'willRender'], ['the-top', 'willInsertElement'], ['the-middle', 'init'], ['the-middle', 'didInitAttrs', { attrs: middleAttrs, newAttrs: middleAttrs }], ['the-middle', 'didReceiveAttrs', { attrs: middleAttrs, newAttrs: middleAttrs }], ['the-middle', 'on(init)'], ['the-middle', 'willRender'], ['the-middle', 'willInsertElement'], ['the-bottom', 'init'], ['the-bottom', 'didInitAttrs', { attrs: bottomAttrs, newAttrs: bottomAttrs }], ['the-bottom', 'didReceiveAttrs', { attrs: bottomAttrs, newAttrs: bottomAttrs }], ['the-bottom', 'on(init)'], ['the-bottom', 'willRender'], ['the-bottom', 'willInsertElement'], // Async hooks @@ -18538,7 +18361,7 @@ babelHelpers.inherits(LifeCycleHooksTest, _RenderingTest); nonInteractive: [ // Sync hooks - ['the-top', 'init'], ['the-top', 'didInitAttrs', { attrs: topAttrs }], ['the-top', 'didReceiveAttrs', { newAttrs: topAttrs }], ['the-top', 'on(init)'], ['the-middle', 'init'], ['the-middle', 'didInitAttrs', { attrs: middleAttrs }], ['the-middle', 'didReceiveAttrs', { newAttrs: middleAttrs }], ['the-middle', 'on(init)'], ['the-bottom', 'init'], ['the-bottom', 'didInitAttrs', { attrs: bottomAttrs }], ['the-bottom', 'didReceiveAttrs', { newAttrs: bottomAttrs }], ['the-bottom', 'on(init)']] + ['the-top', 'init'], ['the-top', 'didInitAttrs', { attrs: topAttrs, newAttrs: topAttrs }], ['the-top', 'didReceiveAttrs', { attrs: topAttrs, newAttrs: topAttrs }], ['the-top', 'on(init)'], ['the-middle', 'init'], ['the-middle', 'didInitAttrs', { attrs: middleAttrs, newAttrs: middleAttrs }], ['the-middle', 'didReceiveAttrs', { attrs: middleAttrs, newAttrs: middleAttrs }], ['the-middle', 'on(init)'], ['the-bottom', 'init'], ['the-bottom', 'didInitAttrs', { attrs: bottomAttrs, newAttrs: bottomAttrs }], ['the-bottom', 'didReceiveAttrs', { attrs: bottomAttrs, newAttrs: bottomAttrs }], ['the-bottom', 'on(init)']] }); this.runTask(function () { @@ -18615,7 +18438,7 @@ babelHelpers.inherits(LifeCycleHooksTest, _RenderingTest); // the new attribute to rerender itself imperatively, that would result // in lifecycle hooks being invoked for the child. - topAttrs = { oldAttrs: { twitter: '@tomdale' }, newAttrs: { twitter: '@horsetomdale' } }; + topAttrs = { attrs: { twitter: '@horsetomdale' }, oldAttrs: { twitter: '@tomdale' }, newAttrs: { twitter: '@horsetomdale' } }; this.assertHooks({ label: 'after update', @@ -18687,7 +18510,7 @@ babelHelpers.inherits(LifeCycleHooksTest, _RenderingTest); interactive: [ // Sync hooks - ['the-parent', 'init'], ['the-parent', 'didInitAttrs', { attrs: parentAttrs }], ['the-parent', 'didReceiveAttrs', { newAttrs: parentAttrs }], ['the-parent', 'on(init)'], ['the-parent', 'willRender'], ['the-parent', 'willInsertElement'], ['the-first-child', 'init'], ['the-first-child', 'didInitAttrs', { attrs: firstAttrs }], ['the-first-child', 'didReceiveAttrs', { newAttrs: firstAttrs }], ['the-first-child', 'on(init)'], ['the-first-child', 'willRender'], ['the-first-child', 'willInsertElement'], ['the-second-child', 'init'], ['the-second-child', 'didInitAttrs', { attrs: secondAttrs }], ['the-second-child', 'didReceiveAttrs', { newAttrs: secondAttrs }], ['the-second-child', 'on(init)'], ['the-second-child', 'willRender'], ['the-second-child', 'willInsertElement'], ['the-last-child', 'init'], ['the-last-child', 'didInitAttrs', { attrs: lastAttrs }], ['the-last-child', 'didReceiveAttrs', { newAttrs: lastAttrs }], ['the-last-child', 'on(init)'], ['the-last-child', 'willRender'], ['the-last-child', 'willInsertElement'], + ['the-parent', 'init'], ['the-parent', 'didInitAttrs', { attrs: parentAttrs, newAttrs: parentAttrs }], ['the-parent', 'didReceiveAttrs', { attrs: parentAttrs, newAttrs: parentAttrs }], ['the-parent', 'on(init)'], ['the-parent', 'willRender'], ['the-parent', 'willInsertElement'], ['the-first-child', 'init'], ['the-first-child', 'didInitAttrs', { attrs: firstAttrs, newAttrs: firstAttrs }], ['the-first-child', 'didReceiveAttrs', { attrs: firstAttrs, newAttrs: firstAttrs }], ['the-first-child', 'on(init)'], ['the-first-child', 'willRender'], ['the-first-child', 'willInsertElement'], ['the-second-child', 'init'], ['the-second-child', 'didInitAttrs', { attrs: secondAttrs, newAttrs: secondAttrs }], ['the-second-child', 'didReceiveAttrs', { attrs: secondAttrs, newAttrs: secondAttrs }], ['the-second-child', 'on(init)'], ['the-second-child', 'willRender'], ['the-second-child', 'willInsertElement'], ['the-last-child', 'init'], ['the-last-child', 'didInitAttrs', { attrs: lastAttrs, newAttrs: lastAttrs }], ['the-last-child', 'didReceiveAttrs', { attrs: lastAttrs, newAttrs: lastAttrs }], ['the-last-child', 'on(init)'], ['the-last-child', 'willRender'], ['the-last-child', 'willInsertElement'], // Async hooks @@ -18696,7 +18519,7 @@ babelHelpers.inherits(LifeCycleHooksTest, _RenderingTest); nonInteractive: [ // Sync hooks - ['the-parent', 'init'], ['the-parent', 'didInitAttrs', { attrs: parentAttrs }], ['the-parent', 'didReceiveAttrs', { newAttrs: parentAttrs }], ['the-parent', 'on(init)'], ['the-first-child', 'init'], ['the-first-child', 'didInitAttrs', { attrs: firstAttrs }], ['the-first-child', 'didReceiveAttrs', { newAttrs: firstAttrs }], ['the-first-child', 'on(init)'], ['the-second-child', 'init'], ['the-second-child', 'didInitAttrs', { attrs: secondAttrs }], ['the-second-child', 'didReceiveAttrs', { newAttrs: secondAttrs }], ['the-second-child', 'on(init)'], ['the-last-child', 'init'], ['the-last-child', 'didInitAttrs', { attrs: lastAttrs }], ['the-last-child', 'didReceiveAttrs', { newAttrs: lastAttrs }], ['the-last-child', 'on(init)']] + ['the-parent', 'init'], ['the-parent', 'didInitAttrs', { attrs: parentAttrs, newAttrs: parentAttrs }], ['the-parent', 'didReceiveAttrs', { attrs: parentAttrs, newAttrs: parentAttrs }], ['the-parent', 'on(init)'], ['the-first-child', 'init'], ['the-first-child', 'didInitAttrs', { attrs: firstAttrs, newAttrs: firstAttrs }], ['the-first-child', 'didReceiveAttrs', { attrs: firstAttrs, newAttrs: firstAttrs }], ['the-first-child', 'on(init)'], ['the-second-child', 'init'], ['the-second-child', 'didInitAttrs', { attrs: secondAttrs, newAttrs: secondAttrs }], ['the-second-child', 'didReceiveAttrs', { attrs: secondAttrs, newAttrs: secondAttrs }], ['the-second-child', 'on(init)'], ['the-last-child', 'init'], ['the-last-child', 'didInitAttrs', { attrs: lastAttrs, newAttrs: lastAttrs }], ['the-last-child', 'didReceiveAttrs', { attrs: lastAttrs, newAttrs: lastAttrs }], ['the-last-child', 'on(init)']] }); this.runTask(function () { @@ -18794,12 +18617,13 @@ babelHelpers.inherits(LifeCycleHooksTest, _RenderingTest); this.assertText('Twitter: @horsetomdale|Name: Horse Tom Dale|Website: horsetomdale.net'); parentAttrs = { + attrs: { twitter: '@horsetomdale', name: 'Horse Tom Dale', website: 'horsetomdale.net' }, oldAttrs: { twitter: '@tomdale', name: 'Tom Dale', website: 'tomdale.net' }, newAttrs: { twitter: '@horsetomdale', name: 'Horse Tom Dale', website: 'horsetomdale.net' } }; - firstAttrs = { oldAttrs: { twitter: '@tomdale' }, newAttrs: { twitter: '@horsetomdale' } }; - secondAttrs = { oldAttrs: { name: 'Tom Dale' }, newAttrs: { name: 'Horse Tom Dale' } }; - lastAttrs = { oldAttrs: { website: 'tomdale.net' }, newAttrs: { website: 'horsetomdale.net' } }; + firstAttrs = { attrs: { twitter: '@horsetomdale' }, oldAttrs: { twitter: '@tomdale' }, newAttrs: { twitter: '@horsetomdale' } }; + secondAttrs = { attrs: { name: 'Horse Tom Dale' }, oldAttrs: { name: 'Tom Dale' }, newAttrs: { name: 'Horse Tom Dale' } }; + lastAttrs = { attrs: { website: 'horsetomdale.net' }, oldAttrs: { website: 'tomdale.net' }, newAttrs: { website: 'horsetomdale.net' } }; this.assertHooks({ label: 'after update', @@ -18863,7 +18687,7 @@ babelHelpers.inherits(LifeCycleHooksTest, _RenderingTest); interactive: [ // Sync hooks - ['the-top', 'init'], ['the-top', 'didInitAttrs', { attrs: topAttrs }], ['the-top', 'didReceiveAttrs', { newAttrs: topAttrs }], ['the-top', 'on(init)'], ['the-top', 'willRender'], ['the-top', 'willInsertElement'], ['the-middle', 'init'], ['the-middle', 'didInitAttrs', { attrs: middleAttrs }], ['the-middle', 'didReceiveAttrs', { newAttrs: middleAttrs }], ['the-middle', 'on(init)'], ['the-middle', 'willRender'], ['the-middle', 'willInsertElement'], ['the-bottom', 'init'], ['the-bottom', 'didInitAttrs', { attrs: bottomAttrs }], ['the-bottom', 'didReceiveAttrs', { newAttrs: bottomAttrs }], ['the-bottom', 'on(init)'], ['the-bottom', 'willRender'], ['the-bottom', 'willInsertElement'], + ['the-top', 'init'], ['the-top', 'didInitAttrs', { attrs: topAttrs, newAttrs: topAttrs }], ['the-top', 'didReceiveAttrs', { attrs: topAttrs, newAttrs: topAttrs }], ['the-top', 'on(init)'], ['the-top', 'willRender'], ['the-top', 'willInsertElement'], ['the-middle', 'init'], ['the-middle', 'didInitAttrs', { attrs: middleAttrs, newAttrs: middleAttrs }], ['the-middle', 'didReceiveAttrs', { attrs: middleAttrs, newAttrs: middleAttrs }], ['the-middle', 'on(init)'], ['the-middle', 'willRender'], ['the-middle', 'willInsertElement'], ['the-bottom', 'init'], ['the-bottom', 'didInitAttrs', { attrs: bottomAttrs, newAttrs: bottomAttrs }], ['the-bottom', 'didReceiveAttrs', { attrs: bottomAttrs, newAttrs: bottomAttrs }], ['the-bottom', 'on(init)'], ['the-bottom', 'willRender'], ['the-bottom', 'willInsertElement'], // Async hooks @@ -18872,7 +18696,7 @@ babelHelpers.inherits(LifeCycleHooksTest, _RenderingTest); nonInteractive: [ // Sync hooks - ['the-top', 'init'], ['the-top', 'didInitAttrs', { attrs: topAttrs }], ['the-top', 'didReceiveAttrs', { newAttrs: topAttrs }], ['the-top', 'on(init)'], ['the-middle', 'init'], ['the-middle', 'didInitAttrs', { attrs: middleAttrs }], ['the-middle', 'didReceiveAttrs', { newAttrs: middleAttrs }], ['the-middle', 'on(init)'], ['the-bottom', 'init'], ['the-bottom', 'didInitAttrs', { attrs: bottomAttrs }], ['the-bottom', 'didReceiveAttrs', { newAttrs: bottomAttrs }], ['the-bottom', 'on(init)']] + ['the-top', 'init'], ['the-top', 'didInitAttrs', { attrs: topAttrs, newAttrs: topAttrs }], ['the-top', 'didReceiveAttrs', { attrs: topAttrs, newAttrs: topAttrs }], ['the-top', 'on(init)'], ['the-middle', 'init'], ['the-middle', 'didInitAttrs', { attrs: middleAttrs, newAttrs: middleAttrs }], ['the-middle', 'didReceiveAttrs', { attrs: middleAttrs, newAttrs: middleAttrs }], ['the-middle', 'on(init)'], ['the-bottom', 'init'], ['the-bottom', 'didInitAttrs', { attrs: bottomAttrs, newAttrs: bottomAttrs }], ['the-bottom', 'didReceiveAttrs', { attrs: bottomAttrs, newAttrs: bottomAttrs }], ['the-bottom', 'on(init)']] }); this.runTask(function () { @@ -18884,9 +18708,9 @@ babelHelpers.inherits(LifeCycleHooksTest, _RenderingTest); // Because the `twitter` attr is used by the all of the components, // the lifecycle hooks are invoked for all components. - topAttrs = { oldAttrs: { twitter: '@tomdale' }, newAttrs: { twitter: '@horsetomdale' } }; - middleAttrs = { oldAttrs: { twitterTop: '@tomdale' }, newAttrs: { twitterTop: '@horsetomdale' } }; - bottomAttrs = { oldAttrs: { twitterMiddle: '@tomdale' }, newAttrs: { twitterMiddle: '@horsetomdale' } }; + topAttrs = { attrs: { twitter: '@horsetomdale' }, oldAttrs: { twitter: '@tomdale' }, newAttrs: { twitter: '@horsetomdale' } }; + middleAttrs = { attrs: { twitterTop: '@horsetomdale' }, oldAttrs: { twitterTop: '@tomdale' }, newAttrs: { twitterTop: '@horsetomdale' } }; + bottomAttrs = { attrs: { twitterMiddle: '@horsetomdale' }, oldAttrs: { twitterMiddle: '@tomdale' }, newAttrs: { twitterMiddle: '@horsetomdale' } }; this.assertHooks({ label: 'after updating (root)', @@ -18914,9 +18738,9 @@ babelHelpers.inherits(LifeCycleHooksTest, _RenderingTest); // In this case, because the attrs are passed down, all child components are invoked. - topAttrs = { oldAttrs: { twitter: '@horsetomdale' }, newAttrs: { twitter: '@horsetomdale' } }; - middleAttrs = { oldAttrs: { twitterTop: '@horsetomdale' }, newAttrs: { twitterTop: '@horsetomdale' } }; - bottomAttrs = { oldAttrs: { twitterMiddle: '@horsetomdale' }, newAttrs: { twitterMiddle: '@horsetomdale' } }; + topAttrs = { attrs: { twitter: '@horsetomdale' }, oldAttrs: { twitter: '@horsetomdale' }, newAttrs: { twitter: '@horsetomdale' } }; + middleAttrs = { attrs: { twitterTop: '@horsetomdale' }, oldAttrs: { twitterTop: '@horsetomdale' }, newAttrs: { twitterTop: '@horsetomdale' } }; + bottomAttrs = { attrs: { twitterMiddle: '@horsetomdale' }, oldAttrs: { twitterMiddle: '@horsetomdale' }, newAttrs: { twitterMiddle: '@horsetomdale' } }; this.assertHooks({ label: 'after no-op rernder (root)', @@ -18956,11 +18780,11 @@ babelHelpers.inherits(LifeCycleHooksTest, _RenderingTest); this.assertRegisteredViews('intial render'); var initialHooks = function (count) { - var ret = [['an-item', 'init'], ['an-item', 'didInitAttrs', { attrs: { count: count } }], ['an-item', 'didReceiveAttrs', { newAttrs: { count: count } }], ['an-item', 'on(init)']]; + var ret = [['an-item', 'init'], ['an-item', 'didInitAttrs', { attrs: { count: count }, newAttrs: { count: count } }], ['an-item', 'didReceiveAttrs', { attrs: { count: count }, newAttrs: { count: count } }], ['an-item', 'on(init)']]; if (_this6.isInteractive) { ret.push(['an-item', 'willRender'], ['an-item', 'willInsertElement']); } - ret.push(['nested-item', 'init'], ['nested-item', 'didInitAttrs', { attrs: {} }], ['nested-item', 'didReceiveAttrs', { newAttrs: {} }], ['nested-item', 'on(init)']); + ret.push(['nested-item', 'init'], ['nested-item', 'didInitAttrs', { attrs: {}, newAttrs: {} }], ['nested-item', 'didReceiveAttrs', { attrs: {}, newAttrs: {} }], ['nested-item', 'on(init)']); if (_this6.isInteractive) { ret.push(['nested-item', 'willRender'], ['nested-item', 'willInsertElement']); } @@ -19002,9 +18826,9 @@ babelHelpers.inherits(LifeCycleHooksTest, _RenderingTest); this.assertHooks({ label: 'reset to empty array', - interactive: [['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['no-items', 'init'], ['no-items', 'didInitAttrs', { attrs: {} }], ['no-items', 'didReceiveAttrs', { newAttrs: {} }], ['no-items', 'on(init)'], ['no-items', 'willRender'], ['no-items', 'willInsertElement'], ['nested-item', 'init'], ['nested-item', 'didInitAttrs', { attrs: {} }], ['nested-item', 'didReceiveAttrs', { newAttrs: {} }], ['nested-item', 'on(init)'], ['nested-item', 'willRender'], ['nested-item', 'willInsertElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['nested-item', 'didInsertElement'], ['nested-item', 'didRender'], ['no-items', 'didInsertElement'], ['no-items', 'didRender'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy']], + interactive: [['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['an-item', 'willDestroyElement'], ['an-item', 'willClearRender'], ['nested-item', 'willDestroyElement'], ['nested-item', 'willClearRender'], ['no-items', 'init'], ['no-items', 'didInitAttrs', { attrs: {}, newAttrs: {} }], ['no-items', 'didReceiveAttrs', { attrs: {}, newAttrs: {} }], ['no-items', 'on(init)'], ['no-items', 'willRender'], ['no-items', 'willInsertElement'], ['nested-item', 'init'], ['nested-item', 'didInitAttrs', { attrs: {}, newAttrs: {} }], ['nested-item', 'didReceiveAttrs', { attrs: {}, newAttrs: {} }], ['nested-item', 'on(init)'], ['nested-item', 'willRender'], ['nested-item', 'willInsertElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['an-item', 'didDestroyElement'], ['nested-item', 'didDestroyElement'], ['nested-item', 'didInsertElement'], ['nested-item', 'didRender'], ['no-items', 'didInsertElement'], ['no-items', 'didRender'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy']], - nonInteractive: [['no-items', 'init'], ['no-items', 'didInitAttrs', { attrs: {} }], ['no-items', 'didReceiveAttrs', { newAttrs: {} }], ['no-items', 'on(init)'], ['nested-item', 'init'], ['nested-item', 'didInitAttrs', { attrs: {} }], ['nested-item', 'didReceiveAttrs', { newAttrs: {} }], ['nested-item', 'on(init)'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy']] + nonInteractive: [['no-items', 'init'], ['no-items', 'didInitAttrs', { attrs: {}, newAttrs: {} }], ['no-items', 'didReceiveAttrs', { attrs: {}, newAttrs: {} }], ['no-items', 'on(init)'], ['nested-item', 'init'], ['nested-item', 'didInitAttrs', { attrs: {}, newAttrs: {} }], ['nested-item', 'didReceiveAttrs', { attrs: {}, newAttrs: {} }], ['nested-item', 'on(init)'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy'], ['an-item', 'willDestroy'], ['nested-item', 'willDestroy']] }); this.teardownAssertions.push(function () { @@ -19440,8 +19264,14 @@ babelHelpers.inherits(_class5, _RenderingTest2); return { isExpr: true, value: value }; } - function hook(name, hook, args) { - return { name: name, hook: hook, args: args }; + function hook(name, hook) { + var _ref3 = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + + var attrs = _ref3.attrs; + var oldAttrs = _ref3.oldAttrs; + var newAttrs = _ref3.newAttrs; + + return { name: name, hook: hook, args: { attrs: attrs, oldAttrs: oldAttrs, newAttrs: newAttrs } }; } function json(serializable) { @@ -19456,21 +19286,13 @@ babelHelpers.inherits(_class5, _RenderingTest2); // Sync hooks // Async hooks -enifed('ember-glimmer/tests/integration/components/life-cycle-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/life-cycle-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/life-cycle-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/life-cycle-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/life-cycle-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/life-cycle-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/life-cycle-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/life-cycle-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/life-cycle-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/link-to-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-runtime', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/test-helpers'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberRuntime, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsTestHelpers) { @@ -19685,21 +19507,13 @@ enifed('ember-glimmer/tests/integration/components/link-to-test', ['exports', 'e return _class2; })(_emberGlimmerTestsUtilsTestCase.ApplicationTest)); }); -enifed('ember-glimmer/tests/integration/components/link-to-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/link-to-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/link-to-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/link-to-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/link-to-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/link-to-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/link-to-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/link-to-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/link-to-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/local-lookup-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers) { @@ -19989,41 +19803,25 @@ enifed('ember-glimmer/tests/integration/components/local-lookup-test', ['exports return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/components/local-lookup-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/local-lookup-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/local-lookup-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/local-lookup-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/local-lookup-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/local-lookup-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/local-lookup-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/local-lookup-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/local-lookup-test.js should pass ESLint\n\n'); }); }); enifed("ember-glimmer/tests/integration/components/render-to-element-test", ["exports"], function (exports) { "use strict"; }); -enifed('ember-glimmer/tests/integration/components/render-to-element-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/render-to-element-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/render-to-element-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/render-to-element-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/render-to-element-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/render-to-element-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/render-to-element-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/render-to-element-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/render-to-element-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/target-action-test', ['exports', 'ember-utils', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-runtime', 'ember-routing'], function (exports, _emberUtils, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberRuntime, _emberRouting) { @@ -20725,21 +20523,13 @@ babelHelpers.inherits(_class4, _RenderingTest3); return _class4; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/components/target-action-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/target-action-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/target-action-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/target-action-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/target-action-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/target-action-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/target-action-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/target-action-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/target-action-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/utils-test', ['exports', 'ember-runtime', 'ember-views', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberRuntime, _emberViews, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers) { @@ -21090,21 +20880,13 @@ enifed('ember-glimmer/tests/integration/components/utils-test', ['exports', 'emb return _class2; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/components/utils-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/utils-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/utils-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/utils-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/utils-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/utils-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/utils-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/utils-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/utils-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/web-component-fallback-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal) { @@ -21154,21 +20936,13 @@ enifed('ember-glimmer/tests/integration/components/web-component-fallback-test', return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/components/web-component-fallback-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/web-component-fallback-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/web-component-fallback-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/web-component-fallback-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/web-component-fallback-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/web-component-fallback-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/web-component-fallback-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/web-component-fallback-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/web-component-fallback-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/components/will-destroy-element-hook-test', ['exports', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/test-case'], function (exports, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsTestCase) { @@ -21217,21 +20991,13 @@ enifed('ember-glimmer/tests/integration/components/will-destroy-element-hook-tes return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/components/will-destroy-element-hook-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/components'); - test('ember-glimmer/tests/integration/components/will-destroy-element-hook-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/components/will-destroy-element-hook-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/components/will-destroy-element-hook-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/components/will-destroy-element-hook-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/components'); - QUnit.test('ember-glimmer/tests/integration/components/will-destroy-element-hook-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/components/will-destroy-element-hook-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/components/will-destroy-element-hook-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/components/will-destroy-element-hook-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/content-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/test-helpers', 'ember-views', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberMetal, _emberRuntime, _emberGlimmerTestsUtilsTestHelpers, _emberViews, _emberGlimmerTestsUtilsHelpers) { @@ -22870,21 +22636,13 @@ enifed('ember-glimmer/tests/integration/content-test', ['exports', 'ember-glimme })(StyleTest)); } }); -enifed('ember-glimmer/tests/integration/content-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration'); - test('ember-glimmer/tests/integration/content-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/content-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/content-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/content-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration'); - QUnit.test('ember-glimmer/tests/integration/content-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/content-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/content-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/content-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/event-dispatcher-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { @@ -23089,7 +22847,7 @@ enifed('ember-glimmer/tests/integration/event-dispatcher-test', ['exports', 'emb return _class2; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); - if (false) { + if (_emberMetal.isFeatureEnabled('ember-improved-instrumentation')) { _emberGlimmerTestsUtilsTestCase.moduleFor('EventDispatcher - Instrumentation', (function (_RenderingTest3) { babelHelpers.inherits(_class3, _RenderingTest3); @@ -23181,21 +22939,13 @@ enifed('ember-glimmer/tests/integration/event-dispatcher-test', ['exports', 'emb })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); } }); -enifed('ember-glimmer/tests/integration/event-dispatcher-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration'); - test('ember-glimmer/tests/integration/event-dispatcher-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/event-dispatcher-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/event-dispatcher-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/event-dispatcher-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration'); - QUnit.test('ember-glimmer/tests/integration/event-dispatcher-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/event-dispatcher-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/event-dispatcher-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/event-dispatcher-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/-class-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/test-helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsTestHelpers, _emberMetal) { @@ -23271,21 +23021,13 @@ enifed('ember-glimmer/tests/integration/helpers/-class-test', ['exports', 'ember return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/-class-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/-class-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/-class-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/-class-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/-class-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/-class-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/-class-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/-class-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/-class-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/closure-action-test', ['exports', 'ember-metal', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberMetal, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsHelpers) { @@ -23293,7 +23035,7 @@ enifed('ember-glimmer/tests/integration/helpers/closure-action-test', ['exports' var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n
    clicked: {{clicked}}; foo: {{foo}}
    \n\n {{click-me id="string-action" onClick=(action "on-click")}}\n {{click-me id="function-action" onClick=(action onClick)}}\n {{click-me id="mut-action" onClick=(action (mut clicked))}}\n '], ['\n
    clicked: {{clicked}}; foo: {{foo}}
    \n\n {{click-me id="string-action" onClick=(action "on-click")}}\n {{click-me id="function-action" onClick=(action onClick)}}\n {{click-me id="mut-action" onClick=(action (mut clicked))}}\n ']); - if (false) { + if (_emberMetal.isFeatureEnabled('ember-improved-instrumentation')) { _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: closure {{action}} improved instrumentation', (function (_RenderingTest) { babelHelpers.inherits(_class, _RenderingTest); @@ -23414,8 +23156,6 @@ babelHelpers.inherits(_class, _RenderingTest); var _this3 = this; var returnedValue = 'Chris P is so krispy'; - var beforeParameter = undefined; - var afterParameter = undefined; var actualReturnedValue = undefined; var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ @@ -23443,12 +23183,8 @@ babelHelpers.inherits(_class, _RenderingTest); }); this.subscribe('interaction.ember-action', { - before: function (name, timestamp, payload) { - beforeParameter = payload.target.get('myProperty'); - }, - after: function (name, timestamp, payload) { - afterParameter = payload.target.get('myProperty'); - } + before: function (name, timestamp, payload) {}, + after: function (name, timestamp, payload) {} }); this.render('{{outer-component}}'); @@ -23941,7 +23677,6 @@ babelHelpers.inherits(_class2, _RenderingTest2); var actualReturnedValue = undefined; var innerComponent = undefined; - var outerComponent = undefined; var InnerComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ init: function () { @@ -23954,10 +23689,6 @@ babelHelpers.inherits(_class2, _RenderingTest2); }); var OuterComponent = _emberGlimmerTestsUtilsHelpers.Component.extend({ - init: function () { - this._super.apply(this, arguments); - outerComponent = this; - }, actions: { outerAction: function (incomingFirst, incomingSecond) { actualFirst = incomingFirst; @@ -24544,21 +24275,13 @@ babelHelpers.inherits(_class2, _RenderingTest2); return _class2; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/closure-action-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/closure-action-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/closure-action-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/closure-action-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/closure-action-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/closure-action-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/closure-action-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/closure-action-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/closure-action-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/concat-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal) { @@ -24695,24 +24418,16 @@ enifed('ember-glimmer/tests/integration/helpers/concat-test', ['exports', 'ember return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/concat-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/concat-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/concat-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/concat-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/concat-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/concat-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/concat-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/concat-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/concat-test.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/tests/integration/helpers/custom-helper-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'internal-test-helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _internalTestHelpers, _emberMetal) { +enifed('ember-glimmer/tests/integration/helpers/custom-helper-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'internal-test-helpers', 'ember-metal', 'ember-utils'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _internalTestHelpers, _emberMetal, _emberUtils) { /* globals EmberDev */ 'use strict'; @@ -24935,6 +24650,30 @@ enifed('ember-glimmer/tests/integration/helpers/custom-helper-test', ['exports', assert.strictEqual(destroyCount, 0, 'destroy is not called on recomputation'); }; + _class.prototype['@test helper params can be returned'] = function testHelperParamsCanBeReturned() { + this.registerHelper('hello-world', function (values) { + return values; + }); + + this.render('{{#each (hello-world model) as |item|}}({{item}}){{/each}}', { + model: ['bob'] + }); + + this.assertText('(bob)'); + }; + + _class.prototype['@test helper hash can be returned'] = function testHelperHashCanBeReturned() { + this.registerHelper('hello-world', function (_, hash) { + return hash.model; + }); + + this.render('{{get (hello-world model=model) \'name\'}}', { + model: { name: 'bob' } + }); + + this.assertText('bob'); + }; + _class.prototype['@test simple helper is called for param changes'] = function testSimpleHelperIsCalledForParamChanges() { var _this9 = this; @@ -25126,9 +24865,7 @@ enifed('ember-glimmer/tests/integration/helpers/custom-helper-test', ['exports', } }); - this.render('{{join-words "Who"\n (join-words "overcomes" "by")\n model.reason\n (join-words (join-words "hath overcome but" "half"))\n (join-words "his" (join-words "foe"))}}', { - model: { reason: 'force' } - }); + this.render('{{join-words "Who"\n (join-words "overcomes" "by")\n model.reason\n (join-words (join-words "hath overcome but" "half"))\n (join-words "his" (join-words "foe"))}}', { model: { reason: 'force' } }); this.assertText('Who overcomes by force hath overcome but half his foe'); @@ -25214,9 +24951,9 @@ enifed('ember-glimmer/tests/integration/helpers/custom-helper-test', ['exports', this.registerHelper('some-helper', function () {}); - expectAssertion(function () { + this.assert.throws(function () { _this18.render('
    '); - }, /Helpers may not be used in the element form/); + }, /Compile Error some-helper is not a modifier: Helpers may not be used in the element form/); }; _class.prototype['@test class-based helper not usable within element'] = function testClassBasedHelperNotUsableWithinElement() { @@ -25226,9 +24963,9 @@ enifed('ember-glimmer/tests/integration/helpers/custom-helper-test', ['exports', compute: function () {} }); - expectAssertion(function () { + this.assert.throws(function () { _this19.render('
    '); - }, /Helpers may not be used in the element form/); + }, /Compile Error some-helper is not a modifier: Helpers may not be used in the element form/); }; _class.prototype['@test class-based helper is torn down'] = function testClassBasedHelperIsTornDown() { @@ -25428,7 +25165,7 @@ enifed('ember-glimmer/tests/integration/helpers/custom-helper-test', ['exports', } })(); - if (!EmberDev.runningProdBuild && (pushingIntoFrozenArrayThrows || assigningExistingFrozenPropertyThrows || addingPropertyToFrozenObjectThrows)) { + if (!EmberDev.runningProdBuild && _emberUtils.HAS_NATIVE_WEAKMAP && (pushingIntoFrozenArrayThrows || assigningExistingFrozenPropertyThrows || addingPropertyToFrozenObjectThrows)) { (function () { var HelperMutatingArgsTests = (function (_RenderingTest2) { babelHelpers.inherits(HelperMutatingArgsTests, _RenderingTest2); @@ -25518,315 +25255,13 @@ enifed('ember-glimmer/tests/integration/helpers/custom-helper-test', ['exports', })(); } }); -enifed('ember-glimmer/tests/integration/helpers/custom-helper-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/custom-helper-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/custom-helper-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/custom-helper-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/custom-helper-test.js should pass jshint', function (assert) { - assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/custom-helper-test.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/debugger-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/helpers/debugger', 'ember-metal', 'ember-runtime'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberGlimmerHelpersDebugger, _emberMetal, _emberRuntime) { - 'use strict'; - - // This file is generally not I-N-U-R tested, because the {{debugger}} helper currently - // does not run during re-render. This is something we eventually want to do, and when - // we implement that feature these tests should be updated accordingly. - - _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: {{debugger}}', (function (_RenderingTest) { - babelHelpers.inherits(_class, _RenderingTest); - - function _class() { - _RenderingTest.apply(this, arguments); - } - - _class.prototype.teardown = function teardown() { - _RenderingTest.prototype.teardown.call(this); - _emberGlimmerHelpersDebugger.resetDebuggerCallback(); - }; - - _class.prototype.expectDebuggerCallback = function expectDebuggerCallback(callback, debuggerCallback) { - var times = arguments.length <= 2 || arguments[2] === undefined ? 1 : arguments[2]; - - var called = 0; - - _emberGlimmerHelpersDebugger.setDebuggerCallback(function (context, get) { - called++; - debuggerCallback(context, get); - }); - - callback(); - - this.assert.strictEqual(called, times, 'Expect debugger callback to be called exactly ' + times + ' time(s)'); - }; - - _class.prototype.expectNoDebuggerCallback = function expectNoDebuggerCallback(callback) { - var called = 0; - - _emberGlimmerHelpersDebugger.setDebuggerCallback(function () { - return called++; - }); - - callback(); - - this.assert.strictEqual(called, 0, 'Expect no debugger callback'); - }; - - _class.prototype['@test should have the right context when used in a component layout'] = function testShouldHaveTheRightContextWhenUsedInAComponentLayout(assert) { - var _this = this; - - var instance = undefined; - - this.registerComponent('my-wrapper', { - template: '{{yield}}' - }); - - this.registerComponent('foo-bar', { - ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ - init: function () { - this._super(); - instance = this; - } - }), - template: '{{debugger}}foo-bar' - }); - - this.expectDebuggerCallback(function () { - _this.render('{{#my-wrapper}}{{foo-bar}}{{/my-wrapper}}'); - }, function (context) { - assert.strictEqual(context, instance, 'context should be the component instance'); - }); - - this.assertText('foo-bar'); - - this.expectNoDebuggerCallback(function () { - return _this.runTask(function () { - return _this.rerender(); - }); - }); - - this.assertText('foo-bar'); - }; - - _class.prototype['@test should have the right context when yielded'] = function testShouldHaveTheRightContextWhenYielded(assert) { - var _this2 = this; - - var instance = undefined; - - this.registerComponent('my-wrapper', { - template: '{{yield}}' - }); - - this.registerComponent('foo-bar', { - ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ - init: function () { - this._super(); - instance = this; - } - }), - template: '{{#my-wrapper}}{{debugger}}foo-bar{{/my-wrapper}}' - }); - - this.expectDebuggerCallback(function () { - _this2.render('{{foo-bar}}'); - }, function (context) { - assert.strictEqual(context, instance, 'context should be the component instance'); - }); - - this.assertText('foo-bar'); - - this.expectNoDebuggerCallback(function () { - return _this2.runTask(function () { - return _this2.rerender(); - }); - }); - - this.assertText('foo-bar'); - }; - - _class.prototype['@test should be called once per iteration in a loop'] = function testShouldBeCalledOncePerIterationInALoop(assert) { - var _this3 = this; - - var count = 0; - - _emberGlimmerHelpersDebugger.setDebuggerCallback(function () { - return count++; - }); - - var items = _emberRuntime.A([1, 2, 3, 4, 5]); - - this.render('{{#each items as |item|}}{{debugger}}[{{item}}]{{/each}}', { items: items }); - - this.assertText('[1][2][3][4][5]'); - - assert.equal(count, 5, 'should have fired once per iteration'); - - count = 0; - - this.runTask(function () { - return _this3.rerender(); - }); - - this.assertText('[1][2][3][4][5]'); - - assert.strictEqual(count, 0, 'should not fire for re-render'); - - count = 0; - - this.runTask(function () { - return items.pushObjects([6, 7, 8]); - }); - - this.assertText('[1][2][3][4][5][6][7][8]'); - - assert.equal(count, 3, 'should fire once per new items added to the loop'); - }; - - _class.prototype['@test could `get` properties from "self"'] = function testCouldGetPropertiesFromSelf(assert) { - var _this4 = this; - - this.registerComponent('foo-bar', { - ComponentClass: _emberGlimmerTestsUtilsHelpers.Component.extend({ - init: function () { - this._super(); - this.zomg = 'zomg'; - } - }), - template: '{{debugger not.here}}foo-bar' - }); - - this.expectDebuggerCallback(function () { - _this4.render('{{foo-bar lol="lol" foo=foo}}', { foo: { bar: { baz: 'fooBarBaz' } } }); - }, function (context, get) { - assert.equal(get('this'), context, '{{this}}'); - - assert.equal(get('lol'), 'lol', '{{lol}}'); - assert.equal(get('this.lol'), 'lol', '{{this.lol}}'); - - assert.equal(get('zomg'), 'zomg', '{{zomg}}'); - assert.equal(get('this.zomg'), 'zomg', '{{this.zomg}}'); - - assert.equal(get('foo.bar.baz'), 'fooBarBaz', '{{foo.bar.baz}}'); - assert.equal(get('this.foo.bar.baz'), 'fooBarBaz', '{{this.foo.bar.baz}}'); - - assert.strictEqual(get('nope'), undefined, '{{nope}}'); - assert.strictEqual(get('this.nope'), undefined, '{{this.nope}}'); - - assert.strictEqual(get('not.here'), undefined, '{{not.here}}'); - assert.strictEqual(get('this.not.here'), undefined, '{{this.not.here}}'); - }); - - this.assertText('foo-bar'); - - this.expectNoDebuggerCallback(function () { - return _this4.runTask(function () { - return _this4.rerender(); - }); - }); - - this.assertText('foo-bar'); - }; - - _class.prototype['@test could `get` local variables'] = function testCouldGetLocalVariables(assert) { - var _this5 = this; - - var obj = { - foo: 'foo', - bar: { baz: { bat: 'barBazBat' } } - }; - - this.expectDebuggerCallback(function () { - _this5.render('{{#each-in obj as |key value|}}{{debugger}}[{{key}}]{{/each-in}}', { obj: obj }); - }, function (context, get) { - assert.equal(get('this'), context, '{{this}}'); - - assert.equal(get('obj'), obj); - - // Glimmer bug: - // assert.strictEqual(get('this.key'), undefined, '{{this.key}}'); - // assert.strictEqual(get('this.value'), undefined, '{{this.value}}'); - - var key = get('key'); - - if (key === 'foo') { - assert.equal(get('value'), 'foo', '{{value}} for key=foo'); - assert.strictEqual(get('value.baz.bat'), undefined, '{{value.baz.bat}} for key=foo'); - assert.strictEqual(get('value.nope'), undefined, '{{value.nope}} for key=foo'); - } else if (key === 'bar') { - assert.equal(get('value'), obj.bar, '{{value}} for key=bar'); - assert.equal(get('value.baz.bat'), 'barBazBat', '{{value.baz.bat}} for key=bar'); - assert.strictEqual(get('value.nope'), undefined, '{{value.nope}} for key=bar'); - } else { - assert.ok(false, 'Unknown key: ' + key); - } - }, 2); - - this.assertText('[foo][bar]'); - - this.expectNoDebuggerCallback(function () { - return _this5.runTask(function () { - return _this5.rerender(); - }); - }); - - this.assertText('[foo][bar]'); - - this.expectDebuggerCallback(function () { - _this5.runTask(function () { - return _emberMetal.set(obj, 'baz', 'baz'); - }); - }, function (context, get) { - assert.equal(get('this'), context, '{{this}}'); - - assert.equal(get('obj'), obj); - - assert.strictEqual(get('this.key'), undefined, '{{this.key}}'); - assert.strictEqual(get('this.value'), undefined, '{{this.value}}'); - - assert.equal(get('key'), 'baz', '{{key}} for key=baz'); - assert.equal(get('value'), 'baz', '{{value}} for key=baz'); - assert.strictEqual(get('value.baz.bat'), undefined, '{{value.baz.bat}} for key=baz'); - assert.strictEqual(get('value.nope'), undefined, '{{value.nope}} for key=baz'); - }); - - this.assertText('[foo][bar][baz]'); - - this.expectNoDebuggerCallback(function () { - return _this5.runTask(function () { - return _this5.rerender(); - }); - }); - - this.assertText('[foo][bar][baz]'); - }; - - return _class; - })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); -}); -enifed('ember-glimmer/tests/integration/helpers/debugger-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/debugger-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/debugger-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/debugger-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/custom-helper-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/debugger-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/custom-helper-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/debugger-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/custom-helper-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/element-action-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal', 'ember-runtime', 'ember-views'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal, _emberRuntime, _emberViews) { @@ -25860,7 +25295,7 @@ enifed('ember-glimmer/tests/integration/helpers/element-action-test', ['exports' }); } - if (false) { + if (_emberMetal.isFeatureEnabled('ember-improved-instrumentation')) { _emberGlimmerTestsUtilsTestCase.moduleFor('Helpers test: element action instrumentation', (function (_RenderingTest) { babelHelpers.inherits(_class, _RenderingTest); @@ -27371,21 +26806,13 @@ babelHelpers.inherits(_class2, _RenderingTest2); return _class2; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/element-action-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/element-action-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/element-action-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/element-action-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/element-action-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/element-action-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/element-action-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/element-action-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/element-action-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/get-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { @@ -28025,21 +27452,13 @@ enifed('ember-glimmer/tests/integration/helpers/get-test', ['exports', 'ember-gl return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/get-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/get-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/get-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/get-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/get-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/get-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/get-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/get-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/get-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/hash-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { @@ -28265,21 +27684,13 @@ enifed('ember-glimmer/tests/integration/helpers/hash-test', ['exports', 'ember-g return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/hash-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/hash-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/hash-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/hash-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/hash-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/hash-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/hash-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/hash-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/hash-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/if-unless-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/shared-conditional-tests'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsSharedConditionalTests) { @@ -28539,21 +27950,13 @@ enifed('ember-glimmer/tests/integration/helpers/if-unless-test', ['exports', 'em return _class11; })(_emberGlimmerTestsUtilsSharedConditionalTests.IfUnlessHelperTest)); }); -enifed('ember-glimmer/tests/integration/helpers/if-unless-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/if-unless-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/if-unless-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/if-unless-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/if-unless-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/if-unless-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/if-unless-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/if-unless-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/if-unless-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember-utils', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/test-case', 'internal-test-helpers'], function (exports, _emberUtils, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsTestCase, _internalTestHelpers) { @@ -29033,6 +28436,36 @@ enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember- this.assertAttr('type', 'password'); }; + _class2.prototype['@test a subexpression can be used to determine type'] = function testASubexpressionCanBeUsedToDetermineType() { + var _this11 = this; + + this.render('{{input type=(if isTruthy trueType falseType)}}', { + isTruthy: true, + trueType: 'text', + falseType: 'password' + }); + + this.assertAttr('type', 'text'); + + this.runTask(function () { + return _this11.rerender(); + }); + + this.assertAttr('type', 'text'); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'isTruthy', false); + }); + + this.assertAttr('type', 'password'); + + this.runTask(function () { + return _emberMetal.set(_this11.context, 'isTruthy', true); + }); + + this.assertAttr('type', 'text'); + }; + return _class2; })(InputRenderingTest)); @@ -29044,7 +28477,7 @@ enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember- } _class3.prototype['@test dynamic attributes'] = function testDynamicAttributes() { - var _this11 = this; + var _this12 = this; this.render('{{input\n type=\'checkbox\'\n disabled=disabled\n name=name\n checked=checked\n tabindex=tabindex\n }}', { disabled: false, @@ -29059,7 +28492,7 @@ enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember- this.assertAttr('tabindex', '10'); this.runTask(function () { - return _this11.rerender(); + return _this12.rerender(); }); this.assertSingleCheckbox(); @@ -29068,9 +28501,9 @@ enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember- this.assertAttr('tabindex', '10'); this.runTask(function () { - _emberMetal.set(_this11.context, 'disabled', true); - _emberMetal.set(_this11.context, 'name', 'updated-name'); - _emberMetal.set(_this11.context, 'tabindex', 11); + _emberMetal.set(_this12.context, 'disabled', true); + _emberMetal.set(_this12.context, 'name', 'updated-name'); + _emberMetal.set(_this12.context, 'tabindex', 11); }); this.assertSingleCheckbox(); @@ -29079,9 +28512,9 @@ enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember- this.assertAttr('tabindex', '11'); this.runTask(function () { - _emberMetal.set(_this11.context, 'disabled', false); - _emberMetal.set(_this11.context, 'name', 'original-name'); - _emberMetal.set(_this11.context, 'tabindex', 10); + _emberMetal.set(_this12.context, 'disabled', false); + _emberMetal.set(_this12.context, 'name', 'original-name'); + _emberMetal.set(_this12.context, 'tabindex', 10); }); this.assertSingleCheckbox(); @@ -29091,15 +28524,15 @@ enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember- }; _class3.prototype['@test `value` property assertion'] = function testValuePropertyAssertion() { - var _this12 = this; + var _this13 = this; expectAssertion(function () { - _this12.render('{{input type="checkbox" value=value}}', { value: 'value' }); + _this13.render('{{input type="checkbox" value=value}}', { value: 'value' }); }, /you must use `checked=/); }; _class3.prototype['@test with a bound type'] = function testWithABoundType(assert) { - var _this13 = this; + var _this14 = this; this.render('{{input type=inputType checked=isChecked}}', { inputType: 'checkbox', isChecked: true }); @@ -29107,26 +28540,26 @@ enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember- this.assertCheckboxIsChecked(); this.runTask(function () { - return _this13.rerender(); + return _this14.rerender(); }); this.assertCheckboxIsChecked(); this.runTask(function () { - return _emberMetal.set(_this13.context, 'isChecked', false); + return _emberMetal.set(_this14.context, 'isChecked', false); }); this.assertCheckboxIsNotChecked(); this.runTask(function () { - return _emberMetal.set(_this13.context, 'isChecked', true); + return _emberMetal.set(_this14.context, 'isChecked', true); }); this.assertCheckboxIsChecked(); }; _class3.prototype['@test with static values'] = function testWithStaticValues(assert) { - var _this14 = this; + var _this15 = this; this.render('{{input type="checkbox" disabled=false tabindex=10 name="original-name" checked=false}}'); @@ -29137,7 +28570,7 @@ enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember- this.assertAttr('name', 'original-name'); this.runTask(function () { - return _this14.rerender(); + return _this15.rerender(); }); this.assertSingleCheckbox(); @@ -29158,7 +28591,7 @@ enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember- } _class4.prototype['@test null values'] = function testNullValues(assert) { - var _this15 = this; + var _this16 = this; var attributes = ['disabled', 'placeholder', 'name', 'maxlength', 'size', 'tabindex']; @@ -29176,20 +28609,20 @@ enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember- this.assertAllAttrs(attributes, undefined); this.runTask(function () { - return _this15.rerender(); + return _this16.rerender(); }); this.assertValue(''); this.assertAllAttrs(attributes, undefined); this.runTask(function () { - _emberMetal.set(_this15.context, 'disabled', true); - _emberMetal.set(_this15.context, 'value', 'Updated value'); - _emberMetal.set(_this15.context, 'placeholder', 'Updated placeholder'); - _emberMetal.set(_this15.context, 'name', 'updated-name'); - _emberMetal.set(_this15.context, 'maxlength', 11); - _emberMetal.set(_this15.context, 'size', 21); - _emberMetal.set(_this15.context, 'tabindex', 31); + _emberMetal.set(_this16.context, 'disabled', true); + _emberMetal.set(_this16.context, 'value', 'Updated value'); + _emberMetal.set(_this16.context, 'placeholder', 'Updated placeholder'); + _emberMetal.set(_this16.context, 'name', 'updated-name'); + _emberMetal.set(_this16.context, 'maxlength', 11); + _emberMetal.set(_this16.context, 'size', 21); + _emberMetal.set(_this16.context, 'tabindex', 31); }); this.assertDisabled(); @@ -29201,13 +28634,13 @@ enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember- this.assertAttr('tabindex', '31'); this.runTask(function () { - _emberMetal.set(_this15.context, 'disabled', null); - _emberMetal.set(_this15.context, 'value', null); - _emberMetal.set(_this15.context, 'placeholder', null); - _emberMetal.set(_this15.context, 'name', null); - _emberMetal.set(_this15.context, 'maxlength', null); + _emberMetal.set(_this16.context, 'disabled', null); + _emberMetal.set(_this16.context, 'value', null); + _emberMetal.set(_this16.context, 'placeholder', null); + _emberMetal.set(_this16.context, 'name', null); + _emberMetal.set(_this16.context, 'maxlength', null); // set(this.context, 'size', null); //NOTE: this fails with `Error: Failed to set the 'size' property on 'HTMLInputElement': The value provided is 0, which is an invalid size.` (TEST_SUITE=sauce) - _emberMetal.set(_this15.context, 'tabindex', null); + _emberMetal.set(_this16.context, 'tabindex', null); }); this.assertAttr('disabled', undefined); @@ -29222,21 +28655,13 @@ enifed('ember-glimmer/tests/integration/helpers/input-test', ['exports', 'ember- return _class4; })(InputRenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/input-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/input-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/input-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/input-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/input-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/input-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/input-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/input-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/input-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/loc-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal, _ember) { @@ -29350,21 +28775,13 @@ enifed('ember-glimmer/tests/integration/helpers/loc-test', ['exports', 'ember-gl return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/loc-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/loc-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/loc-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/loc-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/loc-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/loc-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/loc-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/loc-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/loc-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/log-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-console'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberConsole) { @@ -29432,21 +28849,13 @@ enifed('ember-glimmer/tests/integration/helpers/log-test', ['exports', 'ember-gl return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/log-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/log-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/log-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/log-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/log-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/log-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/log-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/log-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/log-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/mut-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal', 'ember-glimmer/tests/utils/test-helpers'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal, _emberGlimmerTestsUtilsTestHelpers) { @@ -30074,21 +29483,13 @@ enifed('ember-glimmer/tests/integration/helpers/mut-test', ['exports', 'ember-gl return _class2; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/mut-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/mut-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/mut-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/mut-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/mut-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/mut-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/mut-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/mut-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/mut-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/partial-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase) { @@ -30248,21 +29649,13 @@ babelHelpers.inherits(_class, _RenderingTest); return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/partial-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/partial-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/partial-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/partial-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/partial-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/partial-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/partial-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/partial-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/partial-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/readonly-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberMetal) { @@ -30429,21 +29822,13 @@ enifed('ember-glimmer/tests/integration/helpers/readonly-test', ['exports', 'emb return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/readonly-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/readonly-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/readonly-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/readonly-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/readonly-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/readonly-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/readonly-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/readonly-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/readonly-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/test-case'], function (exports, _emberMetal, _emberRuntime, _emberGlimmerTestsUtilsTestCase) { @@ -30457,68 +29842,91 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember } _class.prototype['@test should render given template'] = function testShouldRenderGivenTemplate() { + var _this = this; + this.registerTemplate('home', '

    BYE

    '); - this.render('

    HI

    {{render \'home\'}}'); + expectDeprecation(function () { + _this.render('

    HI

    {{render \'home\'}}'); + }, /Please refactor [\w\{\}"` ]+ to a component/); this.assertText('HIBYE'); }; _class.prototype['@test uses `controller:basic` as the basis for a generated controller when none exists for specified name'] = function testUsesControllerBasicAsTheBasisForAGeneratedControllerWhenNoneExistsForSpecifiedName() { + var _this2 = this; + this.owner.register('controller:basic', _emberRuntime.Controller.extend({ isBasicController: true })); this.registerTemplate('home', '{{isBasicController}}'); - this.render('{{render \'home\'}}'); + expectDeprecation(function () { + _this2.render('{{render \'home\'}}'); + }, /Please refactor [\w\{\}"` ]+ to a component/); this.assertText('true'); }; _class.prototype['@test generates a controller if none exists'] = function testGeneratesAControllerIfNoneExists() { + var _this3 = this; + this.registerTemplate('home', '

    {{this}}

    '); - this.render('

    HI

    {{render \'home\'}}'); + expectDeprecation(function () { + _this3.render('

    HI

    {{render \'home\'}}'); + }, /Please refactor [\w\{\}"` ]+ to a component/); this.assertText('HI(generated home controller)'); }; _class.prototype['@test should use controller with the same name as template if present'] = function testShouldUseControllerWithTheSameNameAsTemplateIfPresent() { + var _this4 = this; + this.owner.register('controller:home', _emberRuntime.Controller.extend({ name: 'home' })); this.registerTemplate('home', '{{name}}

    BYE

    '); - this.render('

    HI

    {{render \'home\'}}'); + expectDeprecation(function () { + _this4.render('

    HI

    {{render \'home\'}}'); + }, /Please refactor [\w\{\}"` ]+ to a component/); this.assertText('HIhomeBYE'); }; _class.prototype['@test should render nested helpers'] = function testShouldRenderNestedHelpers() { + var _this5 = this; + this.owner.register('controller:home', _emberRuntime.Controller.extend()); this.owner.register('controller:foo', _emberRuntime.Controller.extend()); this.owner.register('controller:bar', _emberRuntime.Controller.extend()); this.owner.register('controller:baz', _emberRuntime.Controller.extend()); this.registerTemplate('home', '

    BYE

    '); - this.registerTemplate('foo', '

    FOO

    {{render \'bar\'}}'); - this.registerTemplate('bar', '

    BAR

    {{render \'baz\'}}'); this.registerTemplate('baz', '

    BAZ

    '); - this.render('

    HI

    {{render \'foo\'}}'); + expectDeprecation(function () { + _this5.registerTemplate('foo', '

    FOO

    {{render \'bar\'}}'); + _this5.registerTemplate('bar', '

    BAR

    {{render \'baz\'}}'); + _this5.render('

    HI

    {{render \'foo\'}}'); + }, /Please refactor [\w\{\}"` ]+ to a component/); + this.assertText('HIFOOBARBAZ'); }; _class.prototype['@test should have assertion if the template does not exist'] = function testShouldHaveAssertionIfTheTemplateDoesNotExist() { - var _this = this; + var _this6 = this; this.owner.register('controller:oops', _emberRuntime.Controller.extend()); - expectAssertion(function () { - _this.render('

    HI

    {{render \'oops\'}}'); - }, 'You used `{{render \'oops\'}}`, but \'oops\' can not be found as a template.'); + expectDeprecation(function () { + expectAssertion(function () { + _this6.render('

    HI

    {{render \'oops\'}}'); + }, 'You used `{{render \'oops\'}}`, but \'oops\' can not be found as a template.'); + }, /Please refactor [\w\{\}"` ]+ to a component/); }; _class.prototype['@test should render given template with the singleton controller as its context'] = function testShouldRenderGivenTemplateWithTheSingletonControllerAsItsContext() { - var _this2 = this; + var _this7 = this; this.owner.register('controller:post', _emberRuntime.Controller.extend({ init: function () { @@ -30527,12 +29935,14 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember })); this.registerTemplate('post', '

    {{title}}

    '); - this.render('

    HI

    {{render \'post\'}}'); + expectDeprecation(function () { + _this7.render('

    HI

    {{render \'post\'}}'); + }, /Please refactor [\w\{\}"` ]+ to a component/); this.assertText('HIIt\'s Simple Made Easy'); this.runTask(function () { - return _this2.rerender(); + return _this7.rerender(); }); this.assertText('HIIt\'s Simple Made Easy'); @@ -30553,7 +29963,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember }; _class.prototype['@test should not destroy the singleton controller on teardown'] = function testShouldNotDestroyTheSingletonControllerOnTeardown(assert) { - var _this3 = this; + var _this8 = this; var willDestroyFired = 0; @@ -30570,14 +29980,16 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember this.registerTemplate('post', '

    {{title}}

    '); - this.render('{{#if showPost}}{{render \'post\'}}{{else}}Nothing here{{/if}}', { showPost: false }); + expectDeprecation(function () { + _this8.render('{{#if showPost}}{{render \'post\'}}{{else}}Nothing here{{/if}}', { showPost: false }); + }, /Please refactor [\w\{\}"` ]+ to a component/); this.assertText('Nothing here'); assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); this.runTask(function () { - return _this3.rerender(); + return _this8.rerender(); }); this.assertText('Nothing here'); @@ -30585,7 +29997,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); this.runTask(function () { - return _emberMetal.set(_this3.context, 'showPost', true); + return _emberMetal.set(_this8.context, 'showPost', true); }); this.assertText('It\'s Simple Made Easy'); @@ -30593,7 +30005,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); this.runTask(function () { - return _emberMetal.set(_this3.context, 'showPost', false); + return _emberMetal.set(_this8.context, 'showPost', false); }); this.assertText('Nothing here'); @@ -30602,13 +30014,13 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember }; _class.prototype['@test should render given template with a supplied model'] = function testShouldRenderGivenTemplateWithASuppliedModel() { - var _this4 = this; + var _this9 = this; this.owner.register('controller:post', _emberRuntime.Controller.extend()); this.registerTemplate('post', '

    {{model.title}}

    '); expectDeprecation(function () { - _this4.render('

    HI

    {{render \'post\' post}}', { + _this9.render('

    HI

    {{render \'post\' post}}', { post: { title: 'It\'s Simple Made Easy' } @@ -30618,26 +30030,26 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember this.assertText('HIIt\'s Simple Made Easy'); this.runTask(function () { - return _this4.rerender(); + return _this9.rerender(); }); this.assertText('HIIt\'s Simple Made Easy'); this.runTask(function () { - return _emberMetal.set(_this4.context, 'post.title', 'Rails is omakase'); + return _emberMetal.set(_this9.context, 'post.title', 'Rails is omakase'); }); this.assertText('HIRails is omakase'); this.runTask(function () { - return _emberMetal.set(_this4.context, 'post', { title: 'It\'s Simple Made Easy' }); + return _emberMetal.set(_this9.context, 'post', { title: 'It\'s Simple Made Easy' }); }); this.assertText('HIIt\'s Simple Made Easy'); }; _class.prototype['@test should destroy the non-singleton controllers on teardown'] = function testShouldDestroyTheNonSingletonControllersOnTeardown(assert) { - var _this5 = this; + var _this10 = this; var willDestroyFired = 0; @@ -30651,7 +30063,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember this.registerTemplate('post', '

    {{model.title}}

    '); expectDeprecation(function () { - _this5.render('{{#if showPost}}{{render \'post\' post}}{{else}}Nothing here{{/if}}', { + _this10.render('{{#if showPost}}{{render \'post\' post}}{{else}}Nothing here{{/if}}', { showPost: false, post: { title: 'It\'s Simple Made Easy' @@ -30664,7 +30076,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); this.runTask(function () { - return _this5.rerender(); + return _this10.rerender(); }); this.assertText('Nothing here'); @@ -30672,7 +30084,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); this.runTask(function () { - return _emberMetal.set(_this5.context, 'showPost', true); + return _emberMetal.set(_this10.context, 'showPost', true); }); this.assertText('It\'s Simple Made Easy'); @@ -30680,7 +30092,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember assert.strictEqual(willDestroyFired, 0, 'it did not destroy the controller'); this.runTask(function () { - return _emberMetal.set(_this5.context, 'showPost', false); + return _emberMetal.set(_this10.context, 'showPost', false); }); this.assertText('Nothing here'); @@ -30688,7 +30100,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember assert.strictEqual(willDestroyFired, 1, 'it did destroy the controller'); this.runTask(function () { - return _emberMetal.set(_this5.context, 'showPost', true); + return _emberMetal.set(_this10.context, 'showPost', true); }); this.assertText('It\'s Simple Made Easy'); @@ -30696,7 +30108,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember assert.strictEqual(willDestroyFired, 1, 'it did not destroy the controller'); this.runTask(function () { - return _emberMetal.set(_this5.context, 'showPost', false); + return _emberMetal.set(_this10.context, 'showPost', false); }); this.assertText('Nothing here'); @@ -30705,14 +30117,14 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember }; _class.prototype['@test with a supplied model should not fire observers on the controller'] = function testWithASuppliedModelShouldNotFireObserversOnTheController() { - var _this6 = this; + var _this11 = this; this.owner.register('controller:post', _emberRuntime.Controller.extend()); this.registerTemplate('post', '

    {{model.title}}

    '); var postDidChange = 0; expectDeprecation(function () { - _this6.render('

    HI

    {{render \'post\' post}}', { + _this11.render('

    HI

    {{render \'post\' post}}', { postDidChange: _emberMetal.observer('post', function () { postDidChange++; }), @@ -30725,24 +30137,27 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember this.assertText('HIIt\'s Simple Made Easy'); this.runTask(function () { - return _this6.rerender(); + return _this11.rerender(); }); this.assertText('HIIt\'s Simple Made Easy'); }; _class.prototype['@test should raise an error when a given controller name does not resolve to a controller'] = function testShouldRaiseAnErrorWhenAGivenControllerNameDoesNotResolveToAController() { - var _this7 = this; + var _this12 = this; this.registerTemplate('home', '

    BYE

    '); this.owner.register('controller:posts', _emberRuntime.Controller.extend()); - expectAssertion(function () { - _this7.render('

    HI

    {{render "home" controller="postss"}}'); - }, /The controller name you supplied \'postss\' did not resolve to a controller./); + + expectDeprecation(function () { + expectAssertion(function () { + _this12.render('

    HI

    {{render "home" controller="postss"}}'); + }, /The controller name you supplied \'postss\' did not resolve to a controller./); + }, /Please refactor [\w\{\}"` ]+ to a component/); }; _class.prototype['@test should render with given controller'] = function testShouldRenderWithGivenController(assert) { - var _this8 = this; + var _this13 = this; this.registerTemplate('home', '{{uniqueId}}'); @@ -30757,7 +30172,10 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember } })); - this.render('{{render "home" controller="posts"}}'); + expectDeprecation(function () { + _this13.render('{{render "home" controller="posts"}}'); + }, /Please refactor [\w\{\}"` ]+ to a component/); + var renderedController = this.owner.lookup('controller:posts'); var uniqueId = renderedController.get('uniqueId'); var renderedModel = renderedController.get('model'); @@ -30767,7 +30185,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember this.assertText('0'); this.runTask(function () { - return _this8.rerender(); + return _this13.rerender(); }); assert.equal(uniqueId, 0); @@ -30776,13 +30194,13 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember }; _class.prototype['@test should render templates with models multiple times'] = function testShouldRenderTemplatesWithModelsMultipleTimes(assert) { - var _this9 = this; + var _this14 = this; this.owner.register('controller:post', _emberRuntime.Controller.extend()); this.registerTemplate('post', '

    {{model.title}}

    '); expectDeprecation(function () { - _this9.render('

    HI

    {{render \'post\' post1}} {{render \'post\' post2}}', { + _this14.render('

    HI

    {{render \'post\' post1}} {{render \'post\' post2}}', { post1: { title: 'Me First' }, @@ -30795,32 +30213,32 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember this.assertText('HI Me First Then me'); this.runTask(function () { - return _this9.rerender(); + return _this14.rerender(); }); this.assertText('HI Me First Then me'); this.runTask(function () { - return _emberMetal.set(_this9.context, 'post1.title', 'I am new'); + return _emberMetal.set(_this14.context, 'post1.title', 'I am new'); }); this.assertText('HI I am new Then me'); this.runTask(function () { - return _emberMetal.set(_this9.context, 'post1', { title: 'Me First' }); + return _emberMetal.set(_this14.context, 'post1', { title: 'Me First' }); }); this.assertText('HI Me First Then me'); }; _class.prototype['@test should not treat invocations with falsy contexts as context-less'] = function testShouldNotTreatInvocationsWithFalsyContextsAsContextLess(assert) { - var _this10 = this; + var _this15 = this; this.registerTemplate('post', '

    {{#unless model.zero}}NOTHING{{/unless}}

    '); this.owner.register('controller:post', _emberRuntime.Controller.extend()); expectDeprecation(function () { - _this10.render('

    HI

    {{render \'post\' zero}} {{render \'post\' nonexistent}}', { + _this15.render('

    HI

    {{render \'post\' zero}} {{render \'post\' nonexistent}}', { model: { zero: false } @@ -30831,7 +30249,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember }; _class.prototype['@test should render templates both with and without models'] = function testShouldRenderTemplatesBothWithAndWithoutModels(assert) { - var _this11 = this; + var _this16 = this; this.registerTemplate('post', '

    Title:{{model.title}}

    '); this.owner.register('controller:post', _emberRuntime.Controller.extend()); @@ -30840,7 +30258,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember title: 'Rails is omakase' }; expectDeprecation(function () { - _this11.render('

    HI

    {{render \'post\'}} {{render \'post\' post}}', { + _this16.render('

    HI

    {{render \'post\'}} {{render \'post\' post}}', { post: post }); }, /Please refactor [\w\{\}"` ]+ to a component/); @@ -30848,25 +30266,27 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember assert.ok(this.$().text().match(/^HI ?Title: ?Title:Rails is omakase$/)); this.runTask(function () { - return _this11.rerender(); + return _this16.rerender(); }); assert.ok(this.$().text().match(/^HI ?Title: ?Title:Rails is omakase$/)); this.runTask(function () { - return _emberMetal.set(_this11.context, 'post.title', 'Simple Made Easy'); + return _emberMetal.set(_this16.context, 'post.title', 'Simple Made Easy'); }); assert.ok(this.$().text().match(/^HI ?Title: ?Title:Simple Made Easy$/)); this.runTask(function () { - return _emberMetal.set(_this11.context, 'post', { title: 'Rails is omakase' }); + return _emberMetal.set(_this16.context, 'post', { title: 'Rails is omakase' }); }); assert.ok(this.$().text().match(/^HI ?Title: ?Title:Rails is omakase$/)); }; _class.prototype['@test works with dot notation'] = function testWorksWithDotNotation() { + var _this17 = this; + this.registerTemplate('blog.post', '{{uniqueId}}'); var id = 0; @@ -30877,27 +30297,29 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember } })); - this.render('{{render "blog.post"}}'); + expectDeprecation(function () { + _this17.render('{{render "blog.post"}}'); + }, /Please refactor [\w\.{\}"` ]+ to a component/); this.assertText('0'); }; _class.prototype['@test throws an assertion if called with an unquoted template name'] = function testThrowsAnAssertionIfCalledWithAnUnquotedTemplateName() { - var _this12 = this; + var _this18 = this; this.registerTemplate('home', '

    BYE

    '); expectAssertion(function () { - _this12.render('

    HI

    {{render home}}'); + _this18.render('

    HI

    {{render home}}'); }, 'The first argument of {{render}} must be quoted, e.g. {{render "sidebar"}}.'); }; _class.prototype['@test throws an assertion if called with a literal for a model'] = function testThrowsAnAssertionIfCalledWithALiteralForAModel() { - var _this13 = this; + var _this19 = this; this.registerTemplate('home', '

    BYE

    '); expectAssertion(function () { - _this13.render('

    HI

    {{render "home" "model"}}', { + _this19.render('

    HI

    {{render "home" "model"}}', { model: { title: 'Simple Made Easy' } @@ -30906,7 +30328,7 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember }; _class.prototype['@test should set router as target when action not found on parentController is not found'] = function testShouldSetRouterAsTargetWhenActionNotFoundOnParentControllerIsNotFound(assert) { - var _this14 = this; + var _this20 = this; var postController = undefined; this.registerTemplate('post', 'post template'); @@ -30927,30 +30349,52 @@ enifed('ember-glimmer/tests/integration/helpers/render-test', ['exports', 'ember this.owner.register('router:main', routerStub, { instantiate: false }); expectDeprecation(function () { - _this14.render('{{render \'post\' post1}}'); + _this20.render('{{render \'post\' post1}}'); }, /Please refactor [\w\{\}"` ]+ to a component/); postController.send('someAction'); }; + _class.prototype['@test render helper emits useful backtracking re-render assertion message'] = function testRenderHelperEmitsUsefulBacktrackingReRenderAssertionMessage(assert) { + var _this21 = this; + + this.owner.register('controller:outer', _emberRuntime.Controller.extend()); + this.owner.register('controller:inner', _emberRuntime.Controller.extend({ + propertyWithError: _emberMetal.computed(function () { + this.set('model.name', 'this will cause a backtracking error'); + return 'foo'; + }) + })); + + var expectedBacktrackingMessage = /modified "model\.name" twice on \[object Object\] in a single render\. It was rendered in "controller:outer \(with the render helper\)" and modified in "controller:inner \(with the render helper\)"/; + + expectDeprecation(function () { + var person = { name: 'Ben' }; + + _this21.registerTemplate('outer', 'Hi {{model.name}} | {{render \'inner\' model}}'); + _this21.registerTemplate('inner', 'Hi {{propertyWithError}}'); + + if (true) { + expectDeprecation(expectedBacktrackingMessage); + _this21.render('{{render \'outer\' person}}', { person: person }); + } else { + expectAssertion(function () { + _this21.render('{{render \'outer\' person}}', { person: person }); + }, expectedBacktrackingMessage); + } + }); + }; + return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/render-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/render-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/render-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/render-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/render-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/render-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/render-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/render-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/render-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/text-area-test', ['exports', 'ember-utils', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/test-helpers', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberUtils, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsTestHelpers, _emberGlimmerTestsUtilsAbstractTestCase) { @@ -31162,21 +30606,13 @@ enifed('ember-glimmer/tests/integration/helpers/text-area-test', ['exports', 'em return _class; })(TextAreaRenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/text-area-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/text-area-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/text-area-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/text-area-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/text-area-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/text-area-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/text-area-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/text-area-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/text-area-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/unbound-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-metal', 'ember-glimmer/tests/utils/helpers', 'ember-runtime'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberMetal, _emberGlimmerTestsUtilsHelpers, _emberRuntime) { @@ -31919,21 +31355,13 @@ babelHelpers.inherits(_class, _RenderingTest); return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/unbound-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/unbound-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/unbound-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/unbound-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/unbound-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/unbound-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/unbound-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/unbound-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/unbound-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/helpers/yield-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal, _emberGlimmerTestsUtilsHelpers) { @@ -32234,21 +31662,13 @@ enifed('ember-glimmer/tests/integration/helpers/yield-test', ['exports', 'ember- return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/helpers/yield-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/helpers/yield-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/helpers'); - test('ember-glimmer/tests/integration/helpers/yield-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/helpers/yield-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/helpers/yield-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/helpers'); - QUnit.test('ember-glimmer/tests/integration/helpers/yield-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/helpers/yield-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/helpers/yield-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/helpers/yield-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/input-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal) { @@ -32502,21 +31922,13 @@ enifed('ember-glimmer/tests/integration/input-test', ['exports', 'ember-glimmer/ return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/input-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/input-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration'); - test('ember-glimmer/tests/integration/input-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/input-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/input-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration'); - QUnit.test('ember-glimmer/tests/integration/input-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/input-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/input-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/input-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/mount-test', ['exports', 'ember-utils', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers', 'ember-runtime', 'ember-metal', 'ember-application'], function (exports, _emberUtils, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers, _emberRuntime, _emberMetal, _emberApplication) { @@ -32619,24 +32031,53 @@ enifed('ember-glimmer/tests/integration/mount-test', ['exports', 'ember-utils', }); }; + _class2.prototype['@test it emits a useful backtracking re-render assertion message'] = function testItEmitsAUsefulBacktrackingReRenderAssertionMessage(assert) { + var _this6 = this; + + this.router.map(function () { + this.route('route-with-mount'); + }); + + this.registerTemplate('index', ''); + this.registerTemplate('route-with-mount', '{{mount "chat"}}'); + + this.engineRegistrations['template:application'] = _emberGlimmerTestsUtilsHelpers.compile('hi {{person.name}} [{{component-with-backtracking-set person=person}}]', { moduleName: 'application' }); + this.engineRegistrations['controller:application'] = _emberRuntime.Controller.extend({ + person: { name: 'Alex' } + }); + + this.engineRegistrations['template:components/component-with-backtracking-set'] = _emberGlimmerTestsUtilsHelpers.compile('[component {{person.name}}]', { moduleName: 'components/component-with-backtracking-set' }); + this.engineRegistrations['component:component-with-backtracking-set'] = _emberGlimmerTestsUtilsHelpers.Component.extend({ + init: function () { + this._super.apply(this, arguments); + this.set('person.name', 'Ben'); + } + }); + + var expectedBacktrackingMessage = /modified "person\.name" twice on \[object Object\] in a single render\. It was rendered in "template:route-with-mount" \(in "engine:chat"\) and modified in "component:component-with-backtracking-set" \(in "engine:chat"\)/; + + if (true) { + expectDeprecation(expectedBacktrackingMessage); + return this.visit('/route-with-mount'); + } else { + return this.visit('/').then(function () { + expectAssertion(function () { + _this6.visit('/route-with-mount'); + }, expectedBacktrackingMessage); + }); + } + }; + return _class2; })(_emberGlimmerTestsUtilsTestCase.ApplicationTest)); }); -enifed('ember-glimmer/tests/integration/mount-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/mount-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration'); - test('ember-glimmer/tests/integration/mount-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/mount-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/mount-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration'); - QUnit.test('ember-glimmer/tests/integration/mount-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/mount-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/mount-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/mount-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/outlet-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'internal-test-helpers', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _internalTestHelpers, _emberMetal) { @@ -32648,7 +32089,13 @@ enifed('ember-glimmer/tests/integration/outlet-test', ['exports', 'ember-glimmer function _class() { _RenderingTest.apply(this, arguments); - var CoreOutlet = this.owner._lookupFactory('view:-outlet'); + var CoreOutlet = undefined; + if (true) { + CoreOutlet = this.owner.factoryFor('view:-outlet'); + } else { + CoreOutlet = this.owner._lookupFactory('view:-outlet'); + } + this.component = CoreOutlet.create(); } @@ -33014,21 +32461,13 @@ enifed('ember-glimmer/tests/integration/outlet-test', ['exports', 'ember-glimmer return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/outlet-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/outlet-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration'); - test('ember-glimmer/tests/integration/outlet-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/outlet-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/outlet-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration'); - QUnit.test('ember-glimmer/tests/integration/outlet-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/outlet-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/outlet-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/outlet-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/refinements-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase, _emberMetal) { @@ -33070,21 +32509,13 @@ babelHelpers.inherits(_class, _RenderingTest); return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/refinements-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration'); - test('ember-glimmer/tests/integration/refinements-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/refinements-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/refinements-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/refinements-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration'); - QUnit.test('ember-glimmer/tests/integration/refinements-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/refinements-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/refinements-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/refinements-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/svg-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase) { @@ -33232,21 +32663,13 @@ babelHelpers.inherits(_class, _RenderingTest); return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/svg-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/svg-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration'); - test('ember-glimmer/tests/integration/svg-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/svg-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/svg-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration'); - QUnit.test('ember-glimmer/tests/integration/svg-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/svg-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/svg-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/svg-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/syntax/each-in-test', ['exports', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-runtime', 'ember-glimmer/tests/utils/shared-conditional-tests'], function (exports, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberRuntime, _emberGlimmerTestsUtilsSharedConditionalTests) { @@ -33587,6 +33010,18 @@ babelHelpers.inherits(_class, _BasicEachInTest); this.assertText('[0:1][1:2][2:3][foo:bar]'); }; + _class.prototype['@test it skips holes in sparse arrays'] = function testItSkipsHolesInSparseArrays(assert) { + var arr = []; + arr[5] = 'foo'; + arr[6] = 'bar'; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject14), { arr: arr }); + + this.assertText('[5:foo][6:bar]'); + + this.assertStableRerender(); + }; + babelHelpers.createClass(_class, [{ key: 'truthyValue', get: function () { @@ -33714,21 +33149,13 @@ babelHelpers.createClass(_class3, [{ return _class3; })(EachInProxyTest)); }); -enifed('ember-glimmer/tests/integration/syntax/each-in-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/syntax/each-in-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/syntax'); - test('ember-glimmer/tests/integration/syntax/each-in-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/syntax/each-in-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/syntax/each-in-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/syntax'); - QUnit.test('ember-glimmer/tests/integration/syntax/each-in-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/syntax/each-in-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/syntax/each-in-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/syntax/each-in-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/syntax/each-test', ['exports', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-runtime', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/shared-conditional-tests'], function (exports, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberRuntime, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsSharedConditionalTests) { @@ -33737,10 +33164,11 @@ enifed('ember-glimmer/tests/integration/syntax/each-test', ['exports', 'ember-me var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each list as |item|}}\n
  • Prev
  • \n {{foo-bar item=item}}\n
  • Next
  • \n {{/each}}\n '], ['\n {{#each list as |item|}}\n
  • Prev
  • \n {{foo-bar item=item}}\n
  • Next
  • \n {{/each}}\n ']), _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each content as |value|}}\n {{value}}-\n {{#each options as |option|}}\n {{option.value}}:{{option.label}}\n {{/each}}\n {{/each}}\n '], ['\n {{#each content as |value|}}\n {{value}}-\n {{#each options as |option|}}\n {{option.value}}:{{option.label}}\n {{/each}}\n {{/each}}\n ']), _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each foo.bar.baz as |thing|}}\n {{thing}}\n {{/each}}'], ['\n {{#each foo.bar.baz as |thing|}}\n {{thing}}\n {{/each}}']), - _templateObject4 = babelHelpers.taggedTemplateLiteralLoose(['\n

    {{page.title}}

    \n\n
      \n {{#each model as |post|}}\n
    • {{post.title}}
    • \n {{/each}}\n
    \n '], ['\n

    {{page.title}}

    \n\n
      \n {{#each model as |post|}}\n
    • {{post.title}}
    • \n {{/each}}\n
    \n ']), - _templateObject5 = babelHelpers.taggedTemplateLiteralLoose(['\n

    Blog Posts

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n '], ['\n

    Blog Posts

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n ']), - _templateObject6 = babelHelpers.taggedTemplateLiteralLoose(['\n

    Essays

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n '], ['\n

    Essays

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n ']), - _templateObject7 = babelHelpers.taggedTemplateLiteralLoose(['\n

    Think Pieces™

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n '], ['\n

    Think Pieces™

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n ']); + _templateObject4 = babelHelpers.taggedTemplateLiteralLoose(['\n {{#each list as |value key|}}\n [{{key}}:{{value}}]\n {{/each}}'], ['\n {{#each list as |value key|}}\n [{{key}}:{{value}}]\n {{/each}}']), + _templateObject5 = babelHelpers.taggedTemplateLiteralLoose(['\n

    {{page.title}}

    \n\n
      \n {{#each model as |post|}}\n
    • {{post.title}}
    • \n {{/each}}\n
    \n '], ['\n

    {{page.title}}

    \n\n
      \n {{#each model as |post|}}\n
    • {{post.title}}
    • \n {{/each}}\n
    \n ']), + _templateObject6 = babelHelpers.taggedTemplateLiteralLoose(['\n

    Blog Posts

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n '], ['\n

    Blog Posts

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n ']), + _templateObject7 = babelHelpers.taggedTemplateLiteralLoose(['\n

    Essays

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n '], ['\n

    Essays

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n ']), + _templateObject8 = babelHelpers.taggedTemplateLiteralLoose(['\n

    Think Pieces™

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n '], ['\n

    Think Pieces™

    \n\n
      \n
    • Rails is omakase
    • \n
    • Ember is omakase
    • \n
    \n ']); var ArrayLike = (function () { function ArrayLike(content) { @@ -34884,95 +34312,118 @@ babelHelpers.inherits(_class10, _RenderingTest3); return _class10; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#each}} with sparse arrays', (function (_RenderingTest4) { +babelHelpers.inherits(_class11, _RenderingTest4); + + function _class11() { + _RenderingTest4.apply(this, arguments); + } + + _class11.prototype['@test it should itterate over holes'] = function testItShouldItterateOverHoles(assert) { + var _this26 = this; + + var sparseArray = []; + sparseArray[3] = 'foo'; + sparseArray[4] = 'bar'; + + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4), { list: _emberRuntime.A(sparseArray) }); + + this.assertText('[0:][1:][2:][3:foo][4:bar]'); + + this.assertStableRerender(); + + this.runTask(function () { + var list = _emberMetal.get(_this26.context, 'list'); + list.pushObject('baz'); + }); + + this.assertText('[0:][1:][2:][3:foo][4:bar][5:baz]'); + }; + + return _class11; + })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); + /* globals MutationObserver: false */ if (typeof MutationObserver === 'function') { - _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#each as}} DOM mutation test', (function (_RenderingTest4) { -babelHelpers.inherits(_class11, _RenderingTest4); + _emberGlimmerTestsUtilsTestCase.moduleFor('Syntax test: {{#each as}} DOM mutation test', (function (_RenderingTest5) { +babelHelpers.inherits(_class12, _RenderingTest5); - function _class11() { - _RenderingTest4.call(this); + function _class12() { + _RenderingTest5.call(this); this.observer = null; } - _class11.prototype.observe = function observe(element) { + _class12.prototype.observe = function observe(element) { var observer = this.observer = new MutationObserver(function () {}); observer.observe(element, { childList: true, characterData: true }); }; - _class11.prototype.teardown = function teardown() { + _class12.prototype.teardown = function teardown() { if (this.observer) { this.observer.disconnect(); } - _RenderingTest4.prototype.teardown.call(this); + _RenderingTest5.prototype.teardown.call(this); }; - _class11.prototype.assertNoMutation = function assertNoMutation() { + _class12.prototype.assertNoMutation = function assertNoMutation() { this.assert.deepEqual(this.observer.takeRecords(), [], 'Expected no mutations'); }; - _class11.prototype.expectMutations = function expectMutations() { + _class12.prototype.expectMutations = function expectMutations() { this.assert.ok(this.observer.takeRecords().length > 0, 'Expected some mutations'); }; - _class11.prototype['@test {{#each}} should not mutate a subtree when the array has not changed [GH #14332]'] = function testEachShouldNotMutateASubtreeWhenTheArrayHasNotChangedGH14332(assert) { - var _this26 = this; + _class12.prototype['@test {{#each}} should not mutate a subtree when the array has not changed [GH #14332]'] = function testEachShouldNotMutateASubtreeWhenTheArrayHasNotChangedGH14332(assert) { + var _this27 = this; var page = { title: 'Blog Posts' }; var model = [{ title: 'Rails is omakase' }, { title: 'Ember is omakase' }]; - this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject4), { page: page, model: model }); + this.render(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5), { page: page, model: model }); - this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject5)); + this.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject6)); this.observe(this.$('#posts')[0]); // MutationObserver is async return _emberRuntime.RSVP.Promise.resolve(function () { - _this26.assertStableRerender(); + _this27.assertStableRerender(); }).then(function () { - _this26.assertNoMutation(); + _this27.assertNoMutation(); - _this26.runTask(function () { - return _emberMetal.set(_this26.context, 'page', { title: 'Essays' }); + _this27.runTask(function () { + return _emberMetal.set(_this27.context, 'page', { title: 'Essays' }); }); - _this26.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject6)); + _this27.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject7)); }).then(function () { - _this26.assertNoMutation(); + _this27.assertNoMutation(); - _this26.runTask(function () { - return _emberMetal.set(_this26.context.page, 'title', 'Think Pieces™'); + _this27.runTask(function () { + return _emberMetal.set(_this27.context.page, 'title', 'Think Pieces™'); }); - _this26.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject7)); + _this27.assertHTML(_emberGlimmerTestsUtilsAbstractTestCase.strip(_templateObject8)); }).then(function () { // The last set is localized to the `page` object, so we do not expect Glimmer // to re-iterate the list - _this26.assertNoMutation(); + _this27.assertNoMutation(); }); }; - return _class11; + return _class12; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); } }); -enifed('ember-glimmer/tests/integration/syntax/each-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/syntax/each-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/syntax'); - test('ember-glimmer/tests/integration/syntax/each-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/syntax/each-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/syntax/each-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/syntax'); - QUnit.test('ember-glimmer/tests/integration/syntax/each-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/syntax/each-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/syntax/each-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/syntax/each-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/syntax/if-unless-test', ['exports', 'ember-glimmer/tests/utils/helpers', 'ember-runtime', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/shared-conditional-tests'], function (exports, _emberGlimmerTestsUtilsHelpers, _emberRuntime, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsSharedConditionalTests) { @@ -35110,21 +34561,13 @@ babelHelpers.inherits(_class4, _RenderingTest); return _class4; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/syntax/if-unless-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/syntax'); - test('ember-glimmer/tests/integration/syntax/if-unless-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/syntax/if-unless-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/syntax/if-unless-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/syntax/if-unless-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/syntax'); - QUnit.test('ember-glimmer/tests/integration/syntax/if-unless-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/syntax/if-unless-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/syntax/if-unless-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/syntax/if-unless-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/syntax/in-element-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/test-helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/component', 'ember-metal'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsTestHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerComponent, _emberMetal) { @@ -35236,21 +34679,13 @@ babelHelpers.inherits(_class, _RenderingTest); return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/syntax/in-element-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/syntax'); - test('ember-glimmer/tests/integration/syntax/in-element-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/syntax/in-element-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/syntax/in-element-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/syntax/in-element-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/syntax'); - QUnit.test('ember-glimmer/tests/integration/syntax/in-element-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/syntax/in-element-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/syntax/in-element-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/syntax/in-element-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/syntax/with-dynamic-var-test', ['exports', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsAbstractTestCase) { @@ -35294,21 +34729,13 @@ babelHelpers.inherits(_class, _RenderingTest); return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/syntax/with-dynamic-var-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/syntax/with-dynamic-var-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/integration/syntax'); - test('ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/syntax/with-dynamic-var-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/integration/syntax'); - QUnit.test('ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/integration/syntax/with-test', ['exports', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/shared-conditional-tests', 'ember-glimmer/tests/utils/abstract-test-case'], function (exports, _emberMetal, _emberRuntime, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsSharedConditionalTests, _emberGlimmerTestsUtilsAbstractTestCase) { @@ -35812,24 +35239,16 @@ babelHelpers.inherits(_class3, _RenderingTest); return _class3; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/integration/syntax/with-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/integration/syntax'); - test('ember-glimmer/tests/integration/syntax/with-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/integration/syntax/with-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/integration/syntax/with-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/integration/syntax/with-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/integration/syntax'); - QUnit.test('ember-glimmer/tests/integration/syntax/with-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/integration/syntax/with-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/integration/syntax/with-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/integration/syntax/with-test.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/tests/unit/layout-cache-test', ['exports', 'ember-utils', 'ember-glimmer/tests/utils/test-case', 'glimmer-runtime'], function (exports, _emberUtils, _emberGlimmerTestsUtilsTestCase, _glimmerRuntime) { +enifed('ember-glimmer/tests/unit/layout-cache-test', ['exports', 'ember-utils', 'ember-glimmer/tests/utils/test-case', '@glimmer/runtime'], function (exports, _emberUtils, _emberGlimmerTestsUtilsTestCase, _glimmerRuntime) { 'use strict'; var Counter = (function () { @@ -35999,21 +35418,13 @@ enifed('ember-glimmer/tests/unit/layout-cache-test', ['exports', 'ember-utils', return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/unit/layout-cache-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/unit'); - test('ember-glimmer/tests/unit/layout-cache-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/unit/layout-cache-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/unit/layout-cache-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/unit/layout-cache-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/unit'); - QUnit.test('ember-glimmer/tests/unit/layout-cache-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/unit/layout-cache-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/unit/layout-cache-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/unit/layout-cache-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/unit/outlet-test', ['exports', 'ember-glimmer/views/outlet', 'ember-metal'], function (exports, _emberGlimmerViewsOutlet, _emberMetal) { @@ -36049,21 +35460,13 @@ enifed('ember-glimmer/tests/unit/outlet-test', ['exports', 'ember-glimmer/views/ }); }); }); -enifed('ember-glimmer/tests/unit/outlet-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/unit/outlet-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/unit'); - test('ember-glimmer/tests/unit/outlet-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/unit/outlet-test.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/unit/outlet-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/unit'); - QUnit.test('ember-glimmer/tests/unit/outlet-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/unit/outlet-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/unit/outlet-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/unit/outlet-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/unit/template-factory-test', ['exports', 'ember-template-compiler', 'ember-glimmer/index', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberTemplateCompiler, _emberGlimmerIndex, _emberGlimmerTestsUtilsTestCase, _emberGlimmerTestsUtilsHelpers) { @@ -36136,45 +35539,257 @@ enifed('ember-glimmer/tests/unit/template-factory-test', ['exports', 'ember-temp return _class; })(_emberGlimmerTestsUtilsTestCase.RenderingTest)); }); -enifed('ember-glimmer/tests/unit/template-factory-test.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/unit/template-factory-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/unit'); - test('ember-glimmer/tests/unit/template-factory-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/unit/template-factory-test.js should pass jscs.'); + QUnit.module('ESLint | ember-glimmer/tests/unit/template-factory-test.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/unit/template-factory-test.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/tests/unit/template-factory-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/unit/utils/debug-stack-test', ['exports', 'ember-glimmer/utils/debug-stack', 'ember-metal'], function (exports, _emberGlimmerUtilsDebugStack, _emberMetal) { + 'use strict'; +}); +enifed('ember-glimmer/tests/unit/utils/debug-stack-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/unit'); - QUnit.test('ember-glimmer/tests/unit/template-factory-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/unit/utils/debug-stack-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/unit/template-factory-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/unit/utils/debug-stack-test.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/tests/utils/abstract-test-case', ['exports', 'internal-test-helpers'], function (exports, _internalTestHelpers) { +enifed('ember-glimmer/tests/unit/utils/iterable-test', ['exports', 'ember', 'ember-glimmer/tests/utils/test-case', 'ember-glimmer/utils/iterable', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/each-in', '@glimmer/runtime'], function (exports, _ember, _emberGlimmerTestsUtilsTestCase, _emberGlimmerUtilsIterable, _emberGlimmerUtilsReferences, _emberGlimmerHelpersEachIn, _glimmerRuntime) { 'use strict'; - exports.TestCase = _internalTestHelpers.AbstractTestCase; - exports.applyMixins = _internalTestHelpers.applyMixins; - exports.strip = _internalTestHelpers.strip; + var ITERATOR_KEY_GUID = 'be277757-bbbe-4620-9fcb-213ef433cca2'; + + _emberGlimmerTestsUtilsTestCase.moduleFor('Iterable', (function (_TestCase) { + babelHelpers.inherits(_class, _TestCase); + + function _class() { + _TestCase.apply(this, arguments); + } + + _class.prototype['@test iterates over an array'] = function testIteratesOverAnArray() { + var iterator = iteratorForArray(['foo', 'bar']); + + this.assert.deepEqual(iterator.next(), { key: 'foo', memo: 0, value: 'foo' }); + this.assert.deepEqual(iterator.next(), { key: 'bar', memo: 1, value: 'bar' }); + }; + + _class.prototype['@test iterates over an `Ember.A`'] = function testIteratesOverAnEmberA() { + var iterator = iteratorForArray(_ember.default.A(['foo', 'bar'])); + + this.assert.deepEqual(iterator.next(), { key: 'foo', memo: 0, value: 'foo' }); + this.assert.deepEqual(iterator.next(), { key: 'bar', memo: 1, value: 'bar' }); + }; + + _class.prototype['@test returns `null` when out of items'] = function testReturnsNullWhenOutOfItems() { + var iterator = iteratorForArray(['foo']); + + this.assert.deepEqual(iterator.next(), { key: 'foo', memo: 0, value: 'foo' }); + this.assert.deepEqual(iterator.next(), null); + }; + + _class.prototype['@test iterates over an array with indices as keys'] = function testIteratesOverAnArrayWithIndicesAsKeys() { + var iterator = iteratorForArray(['foo', 'bar'], '@index'); + + this.assert.deepEqual(iterator.next(), { key: '0', memo: 0, value: 'foo' }); + this.assert.deepEqual(iterator.next(), { key: '1', memo: 1, value: 'bar' }); + }; + + _class.prototype['@test iterates over an array with identities as keys'] = function testIteratesOverAnArrayWithIdentitiesAsKeys() { + var iterator = iteratorForArray(['foo', 'bar'], '@identity'); + + this.assert.deepEqual(iterator.next(), { key: 'foo', memo: 0, value: 'foo' }); + this.assert.deepEqual(iterator.next(), { key: 'bar', memo: 1, value: 'bar' }); + }; + + _class.prototype['@test iterates over an array with arbitrary properties as keys'] = function testIteratesOverAnArrayWithArbitraryPropertiesAsKeys() { + var iterator = iteratorForArray([{ k: 'first', v: 'foo' }, { k: 'second', v: 'bar' }], 'k'); + + this.assert.deepEqual(iterator.next(), { key: 'first', memo: 0, value: { k: 'first', v: 'foo' } }); + this.assert.deepEqual(iterator.next(), { key: 'second', memo: 1, value: { k: 'second', v: 'bar' } }); + }; + + _class.prototype['@test errors on `#next` with an undefined ref'] = function testErrorsOnNextWithAnUndefinedRef() { + var iterator = iteratorForArray(undefined); + + this.assert.expect(1); + + try { + iterator.next(); + } catch (_ref) { + var _message = _ref.message; + + this.assert.equal(_message, 'Cannot call next() on an empty iterator'); + } + }; + + _class.prototype['@test errors on `#next` with a null ref'] = function testErrorsOnNextWithANullRef() { + var iterator = iteratorForArray(null); + + this.assert.expect(1); + + try { + iterator.next(); + } catch (_ref2) { + var _message2 = _ref2.message; + + this.assert.equal(_message2, 'Cannot call next() on an empty iterator'); + } + }; + + _class.prototype['@test errors on `#next` with an invalid ref type'] = function testErrorsOnNextWithAnInvalidRefType() { + var iterator = iteratorForArray('string'); + + this.assert.expect(1); + + try { + iterator.next(); + } catch (_ref3) { + var _message3 = _ref3.message; + + this.assert.equal(_message3, 'Cannot call next() on an empty iterator'); + } + }; + + _class.prototype['@test errors on `#next` with an empty array'] = function testErrorsOnNextWithAnEmptyArray() { + var iterator = iteratorForArray([]); + + this.assert.expect(1); + + try { + iterator.next(); + } catch (_ref4) { + var _message4 = _ref4.message; + + this.assert.equal(_message4, 'Cannot call next() on an empty iterator'); + } + }; + + _class.prototype['@test iterates over an object\'s own properties'] = function testIteratesOverAnObjectSOwnProperties() { + var iterator = iteratorForObject({ first: 'foo', second: 'bar' }); + + this.assert.deepEqual(iterator.next(), { key: 'first', memo: 'first', value: 'foo' }); + this.assert.deepEqual(iterator.next(), { key: 'second', memo: 'second', value: 'bar' }); + }; + + _class.prototype['@test iterates over an object\'s own properties with indices as keys'] = function testIteratesOverAnObjectSOwnPropertiesWithIndicesAsKeys() { + var iterator = iteratorForObject({ first: 'foo', second: 'bar' }, '@index'); + + this.assert.deepEqual(iterator.next(), { key: 'first', memo: 'first', value: 'foo' }); + this.assert.deepEqual(iterator.next(), { key: 'second', memo: 'second', value: 'bar' }); + }; + + _class.prototype['@test iterates over an object\'s own properties with identities as keys'] = function testIteratesOverAnObjectSOwnPropertiesWithIdentitiesAsKeys() { + var iterator = iteratorForObject({ first: 'foo', second: 'bar' }, '@identity'); + + this.assert.deepEqual(iterator.next(), { key: 'foo', memo: 'first', value: 'foo' }); + this.assert.deepEqual(iterator.next(), { key: 'bar', memo: 'second', value: 'bar' }); + }; + + _class.prototype['@test iterates over an object\'s own properties with arbitrary properties as keys'] = function testIteratesOverAnObjectSOwnPropertiesWithArbitraryPropertiesAsKeys() { + var iterator = iteratorForObject({ first: { k: 'uno', v: 'foo' }, second: { k: 'dos', v: 'bar' } }, 'k'); + + this.assert.deepEqual(iterator.next(), { key: 'uno', memo: 'first', value: { k: 'uno', v: 'foo' } }); + this.assert.deepEqual(iterator.next(), { key: 'dos', memo: 'second', value: { k: 'dos', v: 'bar' } }); + }; + + _class.prototype['@test each-in errors on `#next` with an undefined ref'] = function testEachInErrorsOnNextWithAnUndefinedRef() { + var iterator = iteratorForObject(undefined); + + this.assert.expect(1); + + try { + iterator.next(); + } catch (_ref5) { + var _message5 = _ref5.message; + + this.assert.equal(_message5, 'Cannot call next() on an empty iterator'); + } + }; + + _class.prototype['@test each-in errors on `#next` with a null ref'] = function testEachInErrorsOnNextWithANullRef() { + var iterator = iteratorForObject(null); + + this.assert.expect(1); + + try { + iterator.next(); + } catch (_ref6) { + var _message6 = _ref6.message; + + this.assert.equal(_message6, 'Cannot call next() on an empty iterator'); + } + }; + + _class.prototype['@test each-in errors on `#next` with an invalid ref type'] = function testEachInErrorsOnNextWithAnInvalidRefType() { + var iterator = iteratorForObject('string'); + + this.assert.expect(1); + + try { + iterator.next(); + } catch (_ref7) { + var _message7 = _ref7.message; + + this.assert.equal(_message7, 'Cannot call next() on an empty iterator'); + } + }; + + _class.prototype['@test ensures keys are unique'] = function testEnsuresKeysAreUnique() { + var iterator = iteratorForArray([{ k: 'qux', v: 'foo' }, { k: 'qux', v: 'bar' }, { k: 'qux', v: 'baz' }], 'k'); + + this.assert.deepEqual(iterator.next(), { key: 'qux', memo: 0, value: { k: 'qux', v: 'foo' } }); + this.assert.deepEqual(iterator.next(), { key: 'qux' + ITERATOR_KEY_GUID + '1', memo: 1, value: { k: 'qux', v: 'bar' } }); + this.assert.deepEqual(iterator.next(), { key: 'qux' + ITERATOR_KEY_GUID + '2', memo: 2, value: { k: 'qux', v: 'baz' } }); + }; + + return _class; + })(_emberGlimmerTestsUtilsTestCase.TestCase)); + + function iteratorForArray(arr, keyPath) { + var ref = new _emberGlimmerUtilsReferences.UpdatableReference(arr); + var iterable = _emberGlimmerUtilsIterable.default(ref, keyPath); + + return iterable.iterate(); + } + + function iteratorForObject(obj, keyPath) { + var vm = null; + var positionalArgs = _glimmerRuntime.EvaluatedPositionalArgs.create([new _emberGlimmerUtilsReferences.UpdatableReference(obj)]); + var ref = _emberGlimmerHelpersEachIn.default(vm, { positional: positionalArgs }); + var iterable = _emberGlimmerUtilsIterable.default(ref, keyPath); + + return iterable.iterate(); + } }); -enifed('ember-glimmer/tests/utils/abstract-test-case.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/unit/utils/iterable-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/utils'); - test('ember-glimmer/tests/utils/abstract-test-case.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/utils/abstract-test-case.js should pass jscs.'); + QUnit.module('ESLint | ember-glimmer/tests/unit/utils/iterable-test.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-glimmer/tests/unit/utils/iterable-test.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/tests/utils/abstract-test-case.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/utils/abstract-test-case', ['exports', 'internal-test-helpers'], function (exports, _internalTestHelpers) { + 'use strict'; + + exports.TestCase = _internalTestHelpers.AbstractTestCase; + exports.applyMixins = _internalTestHelpers.applyMixins; + exports.strip = _internalTestHelpers.strip; +}); +enifed('ember-glimmer/tests/utils/abstract-test-case.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/utils'); - QUnit.test('ember-glimmer/tests/utils/abstract-test-case.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/utils/abstract-test-case.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/utils/abstract-test-case.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/utils/abstract-test-case.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/utils/helpers', ['exports', 'ember-template-compiler', 'ember-glimmer'], function (exports, _emberTemplateCompiler, _emberGlimmer) { @@ -36197,21 +35812,13 @@ enifed('ember-glimmer/tests/utils/helpers', ['exports', 'ember-template-compiler exports.DOMChanges = _emberGlimmer.DOMChanges; exports.isHTMLSafe = _emberGlimmer.isHTMLSafe; }); -enifed('ember-glimmer/tests/utils/helpers.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/utils'); - test('ember-glimmer/tests/utils/helpers.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/utils/helpers.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/utils/helpers.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/utils/helpers.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/utils'); - QUnit.test('ember-glimmer/tests/utils/helpers.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/utils/helpers.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/utils/helpers.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/utils/helpers.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/utils/shared-conditional-tests', ['exports', 'ember-utils', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case', 'ember-metal', 'ember-runtime', 'ember-glimmer/tests/utils/helpers'], function (exports, _emberUtils, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase, _emberMetal, _emberRuntime, _emberGlimmerTestsUtilsHelpers) { @@ -37294,24 +36901,16 @@ enifed('ember-glimmer/tests/utils/shared-conditional-tests', ['exports', 'ember- _emberGlimmerTestsUtilsAbstractTestCase.applyMixins.apply(undefined, [IfUnlessWithSyntaxTest].concat(IfUnlessWithTestCases)); }); -enifed('ember-glimmer/tests/utils/shared-conditional-tests.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/utils/shared-conditional-tests.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/utils'); - test('ember-glimmer/tests/utils/shared-conditional-tests.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/utils/shared-conditional-tests.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/utils/shared-conditional-tests.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/utils'); - QUnit.test('ember-glimmer/tests/utils/shared-conditional-tests.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/utils/shared-conditional-tests.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/utils/shared-conditional-tests.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/utils/shared-conditional-tests.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/tests/utils/string-test', ['exports', 'ember-glimmer/tests/utils/helpers', 'ember-metal', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case'], function (exports, _emberGlimmerTestsUtilsHelpers, _emberMetal, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase) { +enifed('ember-glimmer/tests/utils/string-test', ['exports', 'ember-glimmer/tests/utils/helpers', 'ember-glimmer/tests/utils/abstract-test-case', 'ember-glimmer/tests/utils/test-case'], function (exports, _emberGlimmerTestsUtilsHelpers, _emberGlimmerTestsUtilsAbstractTestCase, _emberGlimmerTestsUtilsTestCase) { 'use strict'; _emberGlimmerTestsUtilsTestCase.moduleFor('SafeString', (function (_TestCase) { @@ -37344,47 +36943,37 @@ enifed('ember-glimmer/tests/utils/string-test', ['exports', 'ember-glimmer/tests return _class; })(_emberGlimmerTestsUtilsAbstractTestCase.TestCase)); - if (true) { - _emberGlimmerTestsUtilsTestCase.moduleFor('SafeString isHTMLSafe', (function (_TestCase2) { - babelHelpers.inherits(_class2, _TestCase2); - - function _class2() { - _TestCase2.apply(this, arguments); - } + _emberGlimmerTestsUtilsTestCase.moduleFor('SafeString isHTMLSafe', (function (_TestCase2) { + babelHelpers.inherits(_class2, _TestCase2); - _class2.prototype['@test isHTMLSafe should detect SafeString'] = function testIsHTMLSafeShouldDetectSafeString() { - var safeString = _emberGlimmerTestsUtilsHelpers.htmlSafe('Emphasize the important things.'); + function _class2() { + _TestCase2.apply(this, arguments); + } - this.assert.ok(_emberGlimmerTestsUtilsHelpers.isHTMLSafe(safeString)); - }; + _class2.prototype['@test isHTMLSafe should detect SafeString'] = function testIsHTMLSafeShouldDetectSafeString() { + var safeString = _emberGlimmerTestsUtilsHelpers.htmlSafe('Emphasize the important things.'); - _class2.prototype['@test isHTMLSafe should not detect SafeString on primatives'] = function testIsHTMLSafeShouldNotDetectSafeStringOnPrimatives() { - this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe('Hello World')); - this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe({})); - this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe([])); - this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe(10)); - this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe(null)); - }; + this.assert.ok(_emberGlimmerTestsUtilsHelpers.isHTMLSafe(safeString)); + }; - return _class2; - })(_emberGlimmerTestsUtilsAbstractTestCase.TestCase)); - } -}); -enifed('ember-glimmer/tests/utils/string-test.jscs-test', ['exports'], function (exports) { - 'use strict'; + _class2.prototype['@test isHTMLSafe should not detect SafeString on primatives'] = function testIsHTMLSafeShouldNotDetectSafeStringOnPrimatives() { + this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe('Hello World')); + this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe({})); + this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe([])); + this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe(10)); + this.assert.notOk(_emberGlimmerTestsUtilsHelpers.isHTMLSafe(null)); + }; - module('JSCS - ember-glimmer/tests/utils'); - test('ember-glimmer/tests/utils/string-test.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/utils/string-test.js should pass jscs.'); - }); + return _class2; + })(_emberGlimmerTestsUtilsAbstractTestCase.TestCase)); }); -enifed('ember-glimmer/tests/utils/string-test.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/utils/string-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/utils'); - QUnit.test('ember-glimmer/tests/utils/string-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/utils/string-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/utils/string-test.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/utils/string-test.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/utils/test-case', ['exports', 'internal-test-helpers'], function (exports, _internalTestHelpers) { @@ -37395,21 +36984,13 @@ enifed('ember-glimmer/tests/utils/test-case', ['exports', 'internal-test-helpers exports.RenderingTest = _internalTestHelpers.RenderingTestCase; exports.moduleFor = _internalTestHelpers.moduleFor; }); -enifed('ember-glimmer/tests/utils/test-case.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/tests/utils'); - test('ember-glimmer/tests/utils/test-case.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/utils/test-case.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/utils/test-case.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/tests/utils/test-case.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/tests/utils'); - QUnit.test('ember-glimmer/tests/utils/test-case.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/utils/test-case.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/utils/test-case.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/utils/test-case.js should pass ESLint\n\n'); }); }); enifed('ember-glimmer/tests/utils/test-helpers', ['exports', 'internal-test-helpers'], function (exports, _internalTestHelpers) { @@ -37420,854 +37001,463 @@ enifed('ember-glimmer/tests/utils/test-helpers', ['exports', 'internal-test-help exports.equalTokens = _internalTestHelpers.equalTokens; exports.equalsElement = _internalTestHelpers.equalsElement; }); -enifed('ember-glimmer/tests/utils/test-helpers.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/tests/utils/test-helpers.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/tests/utils'); - test('ember-glimmer/tests/utils/test-helpers.js should pass jscs', function () { - ok(true, 'ember-glimmer/tests/utils/test-helpers.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/tests/utils/test-helpers.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/tests/utils'); - QUnit.test('ember-glimmer/tests/utils/test-helpers.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/tests/utils/test-helpers.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/tests/utils/test-helpers.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/tests/utils/test-helpers.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/utils/bindings.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/utils/bindings.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/utils'); - test('ember-glimmer/utils/bindings.js should pass jscs', function () { - ok(true, 'ember-glimmer/utils/bindings.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/utils/bindings.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/utils'); - QUnit.test('ember-glimmer/utils/bindings.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/utils/bindings.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/utils/bindings.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/utils/iterable.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/utils'); - test('ember-glimmer/utils/iterable.js should pass jscs', function () { - ok(true, 'ember-glimmer/utils/iterable.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/utils/bindings.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/utils/iterable.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/utils/debug-stack.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/utils'); - QUnit.test('ember-glimmer/utils/iterable.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/utils/debug-stack.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/utils/iterable.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/utils/debug-stack.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/utils/process-args.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/utils/iterable.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/utils'); - test('ember-glimmer/utils/process-args.js should pass jscs', function () { - ok(true, 'ember-glimmer/utils/process-args.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/utils/process-args.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/utils'); - QUnit.test('ember-glimmer/utils/process-args.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/utils/iterable.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/utils/process-args.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/utils/references.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/utils'); - test('ember-glimmer/utils/references.js should pass jscs', function () { - ok(true, 'ember-glimmer/utils/references.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/utils/iterable.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/utils/references.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/utils/process-args.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/utils'); - QUnit.test('ember-glimmer/utils/references.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/utils/process-args.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/utils/references.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/utils/string.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/utils'); - test('ember-glimmer/utils/string.js should pass jscs', function () { - ok(true, 'ember-glimmer/utils/string.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/utils/process-args.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/utils/string.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/utils/references.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/utils'); - QUnit.test('ember-glimmer/utils/string.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/utils/references.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/utils/string.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/utils/references.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/utils/to-bool.jscs-test', ['exports'], function (exports) { +enifed('ember-glimmer/utils/string.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-glimmer/utils'); - test('ember-glimmer/utils/to-bool.js should pass jscs', function () { - ok(true, 'ember-glimmer/utils/to-bool.js should pass jscs.'); - }); -}); -enifed('ember-glimmer/utils/to-bool.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-glimmer/utils'); - QUnit.test('ember-glimmer/utils/to-bool.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/utils/string.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/utils/to-bool.js should pass jshint.'); - }); -}); -enifed('ember-glimmer/views/outlet.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-glimmer/views'); - test('ember-glimmer/views/outlet.js should pass jscs', function () { - ok(true, 'ember-glimmer/views/outlet.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/utils/string.js should pass ESLint\n\n'); }); }); -enifed('ember-glimmer/views/outlet.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/utils/to-bool.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-glimmer/views'); - QUnit.test('ember-glimmer/views/outlet.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/utils/to-bool.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-glimmer/views/outlet.js should pass jshint.'); - }); -}); -enifed('ember-metal/alias.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/alias.js should pass jscs', function () { - ok(true, 'ember-metal/alias.js should pass jscs.'); + assert.ok(true, 'ember-glimmer/utils/to-bool.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/alias.jshint', ['exports'], function (exports) { +enifed('ember-glimmer/views/outlet.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/alias.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-glimmer/views/outlet.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/alias.js should pass jshint.'); + assert.ok(true, 'ember-glimmer/views/outlet.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/binding.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/alias.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/binding.js should pass jscs', function () { - ok(true, 'ember-metal/binding.js should pass jscs.'); - }); -}); -enifed('ember-metal/binding.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/binding.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/alias.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/binding.js should pass jshint.'); - }); -}); -enifed('ember-metal/cache.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/cache.js should pass jscs', function () { - ok(true, 'ember-metal/cache.js should pass jscs.'); + assert.ok(true, 'ember-metal/alias.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/cache.jshint', ['exports'], function (exports) { +enifed('ember-metal/binding.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/cache.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/binding.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/cache.js should pass jshint.'); - }); -}); -enifed('ember-metal/chains.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/chains.js should pass jscs', function () { - ok(true, 'ember-metal/chains.js should pass jscs.'); + assert.ok(true, 'ember-metal/binding.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/chains.jshint', ['exports'], function (exports) { +enifed('ember-metal/cache.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/chains.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/cache.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/chains.js should pass jshint.'); + assert.ok(true, 'ember-metal/cache.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/computed.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/chains.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/computed.js should pass jscs', function () { - ok(true, 'ember-metal/computed.js should pass jscs.'); - }); -}); -enifed('ember-metal/computed.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/computed.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/chains.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/computed.js should pass jshint.'); + assert.ok(true, 'ember-metal/chains.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/core.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/computed.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/core.js should pass jscs', function () { - ok(true, 'ember-metal/core.js should pass jscs.'); - }); -}); -enifed('ember-metal/core.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/core.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/computed.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/core.js should pass jshint.'); + assert.ok(true, 'ember-metal/computed.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/debug.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/core.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/debug.js should pass jscs', function () { - ok(true, 'ember-metal/debug.js should pass jscs.'); - }); -}); -enifed('ember-metal/debug.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/debug.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/core.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/debug.js should pass jshint.'); - }); -}); -enifed('ember-metal/dependent_keys.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/dependent_keys.js should pass jscs', function () { - ok(true, 'ember-metal/dependent_keys.js should pass jscs.'); + assert.ok(true, 'ember-metal/core.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/dependent_keys.jshint', ['exports'], function (exports) { +enifed('ember-metal/debug.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/dependent_keys.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/debug.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/dependent_keys.js should pass jshint.'); - }); -}); -enifed('ember-metal/deprecate_property.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/deprecate_property.js should pass jscs', function () { - ok(true, 'ember-metal/deprecate_property.js should pass jscs.'); + assert.ok(true, 'ember-metal/debug.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/deprecate_property.jshint', ['exports'], function (exports) { +enifed('ember-metal/dependent_keys.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/deprecate_property.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/dependent_keys.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/deprecate_property.js should pass jshint.'); + assert.ok(true, 'ember-metal/dependent_keys.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/descriptor.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/deprecate_property.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/descriptor.js should pass jscs', function () { - ok(true, 'ember-metal/descriptor.js should pass jscs.'); - }); -}); -enifed('ember-metal/descriptor.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/descriptor.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/deprecate_property.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/descriptor.js should pass jshint.'); - }); -}); -enifed('ember-metal/error.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/error.js should pass jscs', function () { - ok(true, 'ember-metal/error.js should pass jscs.'); + assert.ok(true, 'ember-metal/deprecate_property.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/error.jshint', ['exports'], function (exports) { +enifed('ember-metal/descriptor.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/error.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/descriptor.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/error.js should pass jshint.'); + assert.ok(true, 'ember-metal/descriptor.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/error_handler.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/error.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/error_handler.js should pass jscs', function () { - ok(true, 'ember-metal/error_handler.js should pass jscs.'); - }); -}); -enifed('ember-metal/error_handler.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/error_handler.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/error.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/error_handler.js should pass jshint.'); - }); -}); -enifed('ember-metal/events.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/events.js should pass jscs', function () { - ok(true, 'ember-metal/events.js should pass jscs.'); + assert.ok(true, 'ember-metal/error.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/events.jshint', ['exports'], function (exports) { +enifed('ember-metal/error_handler.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/events.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/error_handler.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/events.js should pass jshint.'); - }); -}); -enifed('ember-metal/expand_properties.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/expand_properties.js should pass jscs', function () { - ok(true, 'ember-metal/expand_properties.js should pass jscs.'); + assert.ok(true, 'ember-metal/error_handler.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/expand_properties.jshint', ['exports'], function (exports) { +enifed('ember-metal/events.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/expand_properties.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/events.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/expand_properties.js should pass jshint.'); + assert.ok(true, 'ember-metal/events.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/features.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/expand_properties.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/features.js should pass jscs', function () { - ok(true, 'ember-metal/features.js should pass jscs.'); - }); -}); -enifed('ember-metal/features.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/features.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/expand_properties.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/features.js should pass jshint.'); + assert.ok(true, 'ember-metal/expand_properties.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/get_properties.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/features.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/get_properties.js should pass jscs', function () { - ok(true, 'ember-metal/get_properties.js should pass jscs.'); - }); -}); -enifed('ember-metal/get_properties.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/get_properties.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/features.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/get_properties.js should pass jshint.'); - }); -}); -enifed('ember-metal/index.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/index.js should pass jscs', function () { - ok(true, 'ember-metal/index.js should pass jscs.'); + assert.ok(true, 'ember-metal/features.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/index.jshint', ['exports'], function (exports) { +enifed('ember-metal/get_properties.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/get_properties.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/index.js should pass jshint.'); + assert.ok(true, 'ember-metal/get_properties.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/injected_property.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/index.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/injected_property.js should pass jscs', function () { - ok(true, 'ember-metal/injected_property.js should pass jscs.'); - }); -}); -enifed('ember-metal/injected_property.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/injected_property.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/injected_property.js should pass jshint.'); + assert.ok(true, 'ember-metal/index.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/instrumentation.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/injected_property.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/instrumentation.js should pass jscs', function () { - ok(true, 'ember-metal/instrumentation.js should pass jscs.'); - }); -}); -enifed('ember-metal/instrumentation.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/instrumentation.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/injected_property.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/instrumentation.js should pass jshint.'); - }); -}); -enifed('ember-metal/is_blank.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/is_blank.js should pass jscs', function () { - ok(true, 'ember-metal/is_blank.js should pass jscs.'); + assert.ok(true, 'ember-metal/injected_property.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/is_blank.jshint', ['exports'], function (exports) { +enifed('ember-metal/instrumentation.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/is_blank.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/instrumentation.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/is_blank.js should pass jshint.'); - }); -}); -enifed('ember-metal/is_empty.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/is_empty.js should pass jscs', function () { - ok(true, 'ember-metal/is_empty.js should pass jscs.'); + assert.ok(true, 'ember-metal/instrumentation.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/is_empty.jshint', ['exports'], function (exports) { +enifed('ember-metal/is_blank.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/is_empty.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/is_blank.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/is_empty.js should pass jshint.'); + assert.ok(true, 'ember-metal/is_blank.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/is_none.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/is_empty.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/is_none.js should pass jscs', function () { - ok(true, 'ember-metal/is_none.js should pass jscs.'); - }); -}); -enifed('ember-metal/is_none.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/is_none.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/is_empty.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/is_none.js should pass jshint.'); + assert.ok(true, 'ember-metal/is_empty.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/is_present.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/is_none.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/is_present.js should pass jscs', function () { - ok(true, 'ember-metal/is_present.js should pass jscs.'); - }); -}); -enifed('ember-metal/is_present.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/is_present.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/is_none.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/is_present.js should pass jshint.'); - }); -}); -enifed('ember-metal/is_proxy.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/is_proxy.js should pass jscs', function () { - ok(true, 'ember-metal/is_proxy.js should pass jscs.'); + assert.ok(true, 'ember-metal/is_none.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/is_proxy.jshint', ['exports'], function (exports) { +enifed('ember-metal/is_present.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/is_proxy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/is_present.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/is_proxy.js should pass jshint.'); + assert.ok(true, 'ember-metal/is_present.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/libraries.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/is_proxy.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/libraries.js should pass jscs', function () { - ok(true, 'ember-metal/libraries.js should pass jscs.'); - }); -}); -enifed('ember-metal/libraries.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/libraries.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/is_proxy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/libraries.js should pass jshint.'); - }); -}); -enifed('ember-metal/map.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/map.js should pass jscs', function () { - ok(true, 'ember-metal/map.js should pass jscs.'); + assert.ok(true, 'ember-metal/is_proxy.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/map.jshint', ['exports'], function (exports) { +enifed('ember-metal/libraries.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/map.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/libraries.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/map.js should pass jshint.'); - }); -}); -enifed('ember-metal/merge.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/merge.js should pass jscs', function () { - ok(true, 'ember-metal/merge.js should pass jscs.'); + assert.ok(true, 'ember-metal/libraries.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/merge.jshint', ['exports'], function (exports) { +enifed('ember-metal/map.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/merge.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/map.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/merge.js should pass jshint.'); + assert.ok(true, 'ember-metal/map.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/meta.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/merge.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/meta.js should pass jscs', function () { - ok(true, 'ember-metal/meta.js should pass jscs.'); - }); -}); -enifed('ember-metal/meta.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/meta.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/merge.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/meta.js should pass jshint.'); + assert.ok(true, 'ember-metal/merge.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/meta_listeners.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/meta.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/meta_listeners.js should pass jscs', function () { - ok(true, 'ember-metal/meta_listeners.js should pass jscs.'); - }); -}); -enifed('ember-metal/meta_listeners.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/meta_listeners.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/meta.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/meta_listeners.js should pass jshint.'); - }); -}); -enifed('ember-metal/mixin.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/mixin.js should pass jscs', function () { - ok(true, 'ember-metal/mixin.js should pass jscs.'); + assert.ok(true, 'ember-metal/meta.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/mixin.jshint', ['exports'], function (exports) { +enifed('ember-metal/meta_listeners.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/mixin.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/meta_listeners.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/mixin.js should pass jshint.'); - }); -}); -enifed('ember-metal/observer.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/observer.js should pass jscs', function () { - ok(true, 'ember-metal/observer.js should pass jscs.'); + assert.ok(true, 'ember-metal/meta_listeners.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/observer.jshint', ['exports'], function (exports) { +enifed('ember-metal/mixin.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/observer.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/mixin.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/observer.js should pass jshint.'); - }); -}); -enifed('ember-metal/observer_set.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/observer_set.js should pass jscs', function () { - ok(true, 'ember-metal/observer_set.js should pass jscs.'); + assert.ok(true, 'ember-metal/mixin.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/observer_set.jshint', ['exports'], function (exports) { +enifed('ember-metal/observer.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/observer_set.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/observer.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/observer_set.js should pass jshint.'); + assert.ok(true, 'ember-metal/observer.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/path_cache.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/observer_set.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/path_cache.js should pass jscs', function () { - ok(true, 'ember-metal/path_cache.js should pass jscs.'); - }); -}); -enifed('ember-metal/path_cache.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/path_cache.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/observer_set.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/path_cache.js should pass jshint.'); - }); -}); -enifed('ember-metal/properties.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/properties.js should pass jscs', function () { - ok(true, 'ember-metal/properties.js should pass jscs.'); + assert.ok(true, 'ember-metal/observer_set.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/properties.jshint', ['exports'], function (exports) { +enifed('ember-metal/path_cache.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/properties.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/path_cache.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/properties.js should pass jshint.'); + assert.ok(true, 'ember-metal/path_cache.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/property_events.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/properties.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/property_events.js should pass jscs', function () { - ok(true, 'ember-metal/property_events.js should pass jscs.'); - }); -}); -enifed('ember-metal/property_events.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/property_events.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/properties.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/property_events.js should pass jshint.'); - }); -}); -enifed('ember-metal/property_get.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/property_get.js should pass jscs', function () { - ok(true, 'ember-metal/property_get.js should pass jscs.'); + assert.ok(true, 'ember-metal/properties.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/property_get.jshint', ['exports'], function (exports) { +enifed('ember-metal/property_events.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/property_get.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/property_events.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/property_get.js should pass jshint.'); - }); -}); -enifed('ember-metal/property_set.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/property_set.js should pass jscs', function () { - ok(true, 'ember-metal/property_set.js should pass jscs.'); + assert.ok(true, 'ember-metal/property_events.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/property_set.jshint', ['exports'], function (exports) { +enifed('ember-metal/property_get.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/property_set.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/property_get.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/property_set.js should pass jshint.'); + assert.ok(true, 'ember-metal/property_get.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/replace.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/property_set.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/replace.js should pass jscs', function () { - ok(true, 'ember-metal/replace.js should pass jscs.'); - }); -}); -enifed('ember-metal/replace.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/replace.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/property_set.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/replace.js should pass jshint.'); + assert.ok(true, 'ember-metal/property_set.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/run_loop.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/replace.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/run_loop.js should pass jscs', function () { - ok(true, 'ember-metal/run_loop.js should pass jscs.'); - }); -}); -enifed('ember-metal/run_loop.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/run_loop.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/replace.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/run_loop.js should pass jshint.'); - }); -}); -enifed('ember-metal/set_properties.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/set_properties.js should pass jscs', function () { - ok(true, 'ember-metal/set_properties.js should pass jscs.'); + assert.ok(true, 'ember-metal/replace.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/set_properties.jshint', ['exports'], function (exports) { +enifed('ember-metal/run_loop.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/set_properties.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/run_loop.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/set_properties.js should pass jshint.'); + assert.ok(true, 'ember-metal/run_loop.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/tags.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/set_properties.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/tags.js should pass jscs', function () { - ok(true, 'ember-metal/tags.js should pass jscs.'); - }); -}); -enifed('ember-metal/tags.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/tags.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/set_properties.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tags.js should pass jshint.'); + assert.ok(true, 'ember-metal/set_properties.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/testing.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tags.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/testing.js should pass jscs', function () { - ok(true, 'ember-metal/testing.js should pass jscs.'); + QUnit.module('ESLint | ember-metal/tags.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-metal/tags.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/testing.jshint', ['exports'], function (exports) { +enifed('ember-metal/testing.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/testing.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/testing.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/testing.js should pass jshint.'); + assert.ok(true, 'ember-metal/testing.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/accessors/get_path_test', ['exports', 'ember-metal/property_get'], function (exports, _emberMetalProperty_get) { @@ -38351,21 +37541,13 @@ enifed('ember-metal/tests/accessors/get_path_test', ['exports', 'ember-metal/pro strictEqual(_emberMetalProperty_get.get(obj, 'Foo.bar'), undefined); }); }); -enifed('ember-metal/tests/accessors/get_path_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/accessors/get_path_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/accessors'); - test('ember-metal/tests/accessors/get_path_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/accessors/get_path_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/accessors/get_path_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/accessors'); - QUnit.test('ember-metal/tests/accessors/get_path_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/accessors/get_path_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/accessors/get_path_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/accessors/get_path_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/accessors/get_properties_test', ['exports', 'ember-metal/get_properties'], function (exports, _emberMetalGet_properties) { @@ -38389,21 +37571,13 @@ enifed('ember-metal/tests/accessors/get_properties_test', ['exports', 'ember-met deepEqual(_emberMetalGet_properties.default(obj, []), {}); }); }); -enifed('ember-metal/tests/accessors/get_properties_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/accessors/get_properties_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/accessors'); - test('ember-metal/tests/accessors/get_properties_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/accessors/get_properties_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/accessors/get_properties_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/accessors'); - QUnit.test('ember-metal/tests/accessors/get_properties_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/accessors/get_properties_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/accessors/get_properties_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/accessors/get_properties_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/accessors/get_test', ['exports', 'internal-test-helpers', 'ember-metal/property_get', 'ember-metal/mixin', 'ember-metal/observer'], function (exports, _internalTestHelpers, _emberMetalProperty_get, _emberMetalMixin, _emberMetalObserver) { @@ -38616,21 +37790,13 @@ enifed('ember-metal/tests/accessors/get_test', ['exports', 'internal-test-helper equal(_emberMetalProperty_get.getWithDefault(theRealObject, 'someProperty', 'fail'), 'foo', 'should return the set value, not false'); }); }); -enifed('ember-metal/tests/accessors/get_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/accessors'); - test('ember-metal/tests/accessors/get_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/accessors/get_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/accessors/get_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/accessors/get_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/accessors'); - QUnit.test('ember-metal/tests/accessors/get_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/accessors/get_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/accessors/get_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/accessors/get_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/accessors/is_global_path_test', ['exports', 'ember-metal/path_cache'], function (exports, _emberMetalPath_cache) { @@ -38653,21 +37819,13 @@ enifed('ember-metal/tests/accessors/is_global_path_test', ['exports', 'ember-met ok(!_emberMetalPath_cache.isGlobalPath('myObj.SecondProperty')); }); }); -enifed('ember-metal/tests/accessors/is_global_path_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/accessors'); - test('ember-metal/tests/accessors/is_global_path_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/accessors/is_global_path_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/accessors/is_global_path_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/accessors/is_global_path_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/accessors'); - QUnit.test('ember-metal/tests/accessors/is_global_path_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/accessors/is_global_path_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/accessors/is_global_path_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/accessors/is_global_path_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/accessors/mandatory_setters_test', ['exports', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/watching', 'ember-metal/meta'], function (exports, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalWatching, _emberMetalMeta) { @@ -39105,21 +38263,13 @@ enifed('ember-metal/tests/accessors/mandatory_setters_test', ['exports', 'ember- }); } }); -enifed('ember-metal/tests/accessors/mandatory_setters_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/accessors/mandatory_setters_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/accessors'); - test('ember-metal/tests/accessors/mandatory_setters_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/accessors/mandatory_setters_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/accessors/mandatory_setters_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/accessors'); - QUnit.test('ember-metal/tests/accessors/mandatory_setters_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/accessors/mandatory_setters_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/accessors/mandatory_setters_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/accessors/mandatory_setters_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/accessors/set_path_test', ['exports', 'ember-environment', 'ember-metal/property_set', 'ember-metal/property_get'], function (exports, _emberEnvironment, _emberMetalProperty_set, _emberMetalProperty_get) { @@ -39202,21 +38352,13 @@ enifed('ember-metal/tests/accessors/set_path_test', ['exports', 'ember-environme ok(true, 'does not raise'); }); }); -enifed('ember-metal/tests/accessors/set_path_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/accessors/set_path_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/accessors'); - test('ember-metal/tests/accessors/set_path_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/accessors/set_path_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/accessors/set_path_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/accessors'); - QUnit.test('ember-metal/tests/accessors/set_path_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/accessors/set_path_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/accessors/set_path_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/accessors/set_path_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/accessors/set_test', ['exports', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/tags'], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalTags) { @@ -39324,21 +38466,13 @@ enifed('ember-metal/tests/accessors/set_test', ['exports', 'ember-metal/property assert.equal(obj.foo, 'bar'); }); }); -enifed('ember-metal/tests/accessors/set_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/accessors'); - test('ember-metal/tests/accessors/set_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/accessors/set_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/accessors/set_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/accessors/set_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/accessors'); - QUnit.test('ember-metal/tests/accessors/set_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/accessors/set_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/accessors/set_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/accessors/set_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/alias_test', ['exports', 'ember-metal/alias', 'ember-metal/properties', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/meta', 'ember-metal/watching', 'ember-metal/observer', 'ember-metal/tags'], function (exports, _emberMetalAlias, _emberMetalProperties, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMeta, _emberMetalWatching, _emberMetalObserver, _emberMetalTags) { @@ -39448,21 +38582,13 @@ enifed('ember-metal/tests/alias_test', ['exports', 'ember-metal/alias', 'ember-m ok(!tag.validate(tagValue), label); } }); -enifed('ember-metal/tests/alias_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/alias_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/alias_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/alias_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/alias_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/alias_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/alias_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/alias_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/alias_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/binding/connect_test', ['exports', 'ember-environment', 'internal-test-helpers', 'ember-metal/binding', 'ember-metal/run_loop', 'ember-metal/property_set', 'ember-metal/property_get'], function (exports, _emberEnvironment, _internalTestHelpers, _emberMetalBinding, _emberMetalRun_loop, _emberMetalProperty_set, _emberMetalProperty_get) { @@ -39605,21 +38731,13 @@ enifed('ember-metal/tests/binding/connect_test', ['exports', 'ember-environment' equal(_emberMetalProperty_get.get(a, 'foo'), 'BAZ', 'should have synced binding on new obj'); }); }); -enifed('ember-metal/tests/binding/connect_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/binding/connect_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/binding'); - test('ember-metal/tests/binding/connect_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/binding/connect_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/binding/connect_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/binding'); - QUnit.test('ember-metal/tests/binding/connect_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/binding/connect_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/binding/connect_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/binding/connect_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/binding/sync_test', ['exports', 'internal-test-helpers', 'ember-metal/run_loop', 'ember-metal/observer', 'ember-metal/binding', 'ember-metal/computed', 'ember-metal/properties', 'ember-metal/property_events'], function (exports, _internalTestHelpers, _emberMetalRun_loop, _emberMetalObserver, _emberMetalBinding, _emberMetalComputed, _emberMetalProperties, _emberMetalProperty_events) { @@ -39790,21 +38908,13 @@ enifed('ember-metal/tests/binding/sync_test', ['exports', 'internal-test-helpers }); }); }); -enifed('ember-metal/tests/binding/sync_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/binding'); - test('ember-metal/tests/binding/sync_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/binding/sync_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/binding/sync_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/binding/sync_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/binding'); - QUnit.test('ember-metal/tests/binding/sync_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/binding/sync_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/binding/sync_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/binding/sync_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/cache_test', ['exports', 'ember-metal/cache'], function (exports, _emberMetalCache) { @@ -39908,21 +39018,13 @@ enifed('ember-metal/tests/cache_test', ['exports', 'ember-metal/cache'], functio equal(cache.get('c'), 'C'); }); }); -enifed('ember-metal/tests/cache_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/cache_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/cache_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/cache_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/cache_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/cache_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/cache_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/cache_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/cache_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/chains_test', ['exports', 'ember-metal/observer', 'ember-metal/property_get', 'ember-metal/chains', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/property_events', 'ember-metal/meta'], function (exports, _emberMetalObserver, _emberMetalProperty_get, _emberMetalChains, _emberMetalProperties, _emberMetalComputed, _emberMetalProperty_events, _emberMetalMeta) { @@ -39997,22 +39099,27 @@ enifed('ember-metal/tests/chains_test', ['exports', 'ember-metal/observer', 'emb _emberMetalProperty_get.get(obj, 'qux'); // CP chain re-recreated ok(true, 'no crash'); }); -}); -enifed('ember-metal/tests/chains_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/chains_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/chains_test.js should pass jscs.'); + QUnit.test('checks cache correctly', function (assert) { + var obj = {}; + var parentChainNode = new _emberMetalChains.ChainNode(null, null, obj); + var chainNode = new _emberMetalChains.ChainNode(parentChainNode, 'foo'); + + _emberMetalProperties.defineProperty(obj, 'foo', _emberMetalComputed.default(function () { + return undefined; + })); + _emberMetalProperty_get.get(obj, 'foo'); + + assert.strictEqual(chainNode.value(), undefined); }); }); -enifed('ember-metal/tests/chains_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/chains_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/chains_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/chains_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/chains_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/chains_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/computed_test', ['exports', 'ember-runtime', 'internal-test-helpers', 'ember-metal/computed', 'ember-metal/properties', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/watching', 'ember-metal/observer'], function (exports, _emberRuntime, _internalTestHelpers, _emberMetalComputed, _emberMetalProperties, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalWatching, _emberMetalObserver) { @@ -40682,6 +39789,7 @@ enifed('ember-metal/tests/computed_test', ['exports', 'ember-runtime', 'internal firstName: 'Yehuda', lastName: 'Katz' }; + _emberMetalProperties.defineProperty(obj, 'fullName', _emberMetalComputed.computed({ get: function () { return get(this, 'firstName') + ' ' + get(this, 'lastName'); @@ -40693,6 +39801,7 @@ enifed('ember-metal/tests/computed_test', ['exports', 'ember-runtime', 'internal return value; } }).property('firstName', 'lastName')); + var fullNameWillChange = 0; var fullNameDidChange = 0; var firstNameWillChange = 0; @@ -40740,6 +39849,7 @@ enifed('ember-metal/tests/computed_test', ['exports', 'ember-runtime', 'internal var obj = { foo: 0 }; + _emberMetalProperties.defineProperty(obj, 'plusOne', _emberMetalComputed.computed({ get: function (key) { return get(this, 'foo') + 1; @@ -40749,6 +39859,7 @@ enifed('ember-metal/tests/computed_test', ['exports', 'ember-runtime', 'internal return value + 1; } }).property('foo')); + var plusOneWillChange = 0; var plusOneDidChange = 0; _emberMetalObserver._addBeforeObserver(obj, 'plusOne', function () { @@ -40829,21 +39940,13 @@ enifed('ember-metal/tests/computed_test', ['exports', 'ember-runtime', 'internal equal(get(obj, 'bar'), 'barValue'); }); }); -enifed('ember-metal/tests/computed_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/computed_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/computed_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/computed_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/computed_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/computed_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/computed_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/computed_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/computed_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/descriptor_test', ['exports', 'ember-runtime', 'ember-metal/mixin', 'ember-metal/properties', 'ember-metal/descriptor'], function (exports, _emberRuntime, _emberMetalMixin, _emberMetalProperties, _emberMetalDescriptor) { @@ -41268,21 +40371,13 @@ enifed('ember-metal/tests/descriptor_test', ['exports', 'ember-runtime', 'ember- }); }); }); -enifed('ember-metal/tests/descriptor_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/descriptor_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/descriptor_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/descriptor_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/descriptor_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/descriptor_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/descriptor_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/descriptor_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/descriptor_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/error_test', ['exports', 'ember-metal/error'], function (exports, _emberMetalError) { @@ -41298,21 +40393,13 @@ enifed('ember-metal/tests/error_test', ['exports', 'ember-metal/error'], functio }, 'the assigned message was displayed'); }); }); -enifed('ember-metal/tests/error_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/error_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/error_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/error_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/error_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/error_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/error_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/error_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/error_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/events_test', ['exports', 'ember-metal/mixin', 'ember-metal/meta', 'ember-metal/events'], function (exports, _emberMetalMixin, _emberMetalMeta, _emberMetalEvents) { @@ -41584,21 +40671,13 @@ enifed('ember-metal/tests/events_test', ['exports', 'ember-metal/mixin', 'ember- equal(triggered, 1, 'should invoke from subclass property'); }); }); -enifed('ember-metal/tests/events_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/events_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/events_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/events_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/events_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/events_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/events_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/events_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/events_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/expand_properties_test', ['exports', 'ember-metal/expand_properties'], function (exports, _emberMetalExpand_properties) { @@ -41705,21 +40784,13 @@ enifed('ember-metal/tests/expand_properties_test', ['exports', 'ember-metal/expa }, /Brace expanded properties cannot contain spaces, e.g. "user.{firstName, lastName}" should be "user.{firstName,lastName}"/); }); }); -enifed('ember-metal/tests/expand_properties_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/expand_properties_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/expand_properties_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/expand_properties_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/expand_properties_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/expand_properties_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/expand_properties_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/expand_properties_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/expand_properties_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/injected_property_test', ['exports', 'ember-utils', 'ember-metal/properties', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/injected_property'], function (exports, _emberUtils, _emberMetalProperties, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalInjected_property) { @@ -41795,21 +40866,13 @@ enifed('ember-metal/tests/injected_property_test', ['exports', 'ember-utils', 'e equal(_emberMetalProperty_get.get(obj, 'foo'), 'type:foo', 'should lookup the type using the property name'); }); }); -enifed('ember-metal/tests/injected_property_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/injected_property_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/injected_property_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/injected_property_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/injected_property_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/injected_property_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/injected_property_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/injected_property_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/injected_property_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/instrumentation_test', ['exports', 'ember-metal/instrumentation'], function (exports, _emberMetalInstrumentation) { @@ -42015,21 +41078,13 @@ enifed('ember-metal/tests/instrumentation_test', ['exports', 'ember-metal/instru _emberMetalInstrumentation.instrument('render.handlebars', null, function () {}); }); }); -enifed('ember-metal/tests/instrumentation_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/instrumentation_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/instrumentation_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/instrumentation_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/instrumentation_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/instrumentation_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/instrumentation_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/instrumentation_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/instrumentation_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/is_blank_test', ['exports', 'ember-metal/is_blank'], function (exports, _emberMetalIs_blank) { @@ -42059,21 +41114,13 @@ enifed('ember-metal/tests/is_blank_test', ['exports', 'ember-metal/is_blank'], f equal(false, _emberMetalIs_blank.default([1, 2, 3]), 'for a non-empty array'); }); }); -enifed('ember-metal/tests/is_blank_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/is_blank_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/is_blank_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/is_blank_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/is_blank_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/is_blank_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/is_blank_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/is_blank_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/is_blank_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/is_empty_test', ['exports', 'ember-metal/is_empty', 'ember-metal/map'], function (exports, _emberMetalIs_empty, _emberMetalMap) { @@ -42115,21 +41162,13 @@ enifed('ember-metal/tests/is_empty_test', ['exports', 'ember-metal/is_empty', 'e equal(false, _emberMetalIs_empty.default(orderedSet), 'Ordered set is not empty'); }); }); -enifed('ember-metal/tests/is_empty_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/is_empty_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/is_empty_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/is_empty_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/is_empty_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/is_empty_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/is_empty_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/is_empty_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/is_empty_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/is_none_test', ['exports', 'ember-metal/is_none'], function (exports, _emberMetalIs_none) { @@ -42153,21 +41192,13 @@ enifed('ember-metal/tests/is_none_test', ['exports', 'ember-metal/is_none'], fun equal(false, _emberMetalIs_none.default({}), 'for an empty Object'); }); }); -enifed('ember-metal/tests/is_none_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/is_none_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/is_none_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/is_none_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/is_none_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/is_none_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/is_none_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/is_none_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/is_none_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/is_present_test', ['exports', 'ember-metal/is_present'], function (exports, _emberMetalIs_present) { @@ -42198,21 +41229,13 @@ enifed('ember-metal/tests/is_present_test', ['exports', 'ember-metal/is_present' equal(true, _emberMetalIs_present.default([1, 2, 3]), 'for a non-empty array'); }); }); -enifed('ember-metal/tests/is_present_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/is_present_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/is_present_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/is_present_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/is_present_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/is_present_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/is_present_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/is_present_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/is_present_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/libraries_test', ['exports', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/libraries'], function (exports, _emberMetalDebug, _emberMetalFeatures, _emberMetalLibraries) { @@ -42258,7 +41281,7 @@ enifed('ember-metal/tests/libraries_test', ['exports', 'ember-metal/debug', 'emb equal(registry.length, 1); }); - if (false) { + if (_emberMetalFeatures.default('ember-libraries-isregistered')) { QUnit.test('isRegistered returns correct value', function () { expect(3); @@ -42306,21 +41329,13 @@ enifed('ember-metal/tests/libraries_test', ['exports', 'ember-metal/debug', 'emb equal(registry.length, 1); }); }); -enifed('ember-metal/tests/libraries_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/libraries_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/libraries_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/libraries_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/libraries_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/libraries_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/libraries_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/libraries_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/libraries_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/main_test', ['exports', 'ember-metal/index'], function (exports, _emberMetalIndex) { @@ -42377,22 +41392,24 @@ enifed('ember-metal/tests/main_test', ['exports', 'ember-metal/index'], function new _emberMetalIndex.default.Backburner(['foo']); }, 'Usage of Ember.Backburner is deprecated.'); }); -}); -enifed('ember-metal/tests/main_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/main_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/main_test.js should pass jscs.'); + QUnit.test('Ember.K is deprecated', function (assert) { + expectDeprecation(function () { + var obj = { + noop: _emberMetalIndex.default.K + }; + + assert.equal(obj, obj.noop()); + }, 'Ember.K is deprecated in favor of defining a function inline.'); }); }); -enifed('ember-metal/tests/main_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/main_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/main_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/main_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/main_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/main_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/map_test', ['exports', 'ember-metal/map'], function (exports, _emberMetalMap) { @@ -42886,21 +41903,13 @@ enifed('ember-metal/tests/map_test', ['exports', 'ember-metal/map'], function (e equal(map.add(obj), map, 'when it is already in the set'); }); }); -enifed('ember-metal/tests/map_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/map_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/map_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/map_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/map_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/map_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/map_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/map_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/map_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/meta_test', ['exports', 'ember-metal/meta'], function (exports, _emberMetalMeta) { @@ -42983,21 +41992,13 @@ enifed('ember-metal/tests/meta_test', ['exports', 'ember-metal/meta'], function assert.equal(matching[0], t); }); }); -enifed('ember-metal/tests/meta_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/meta_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/meta_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/meta_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/meta_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/meta_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/meta_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/meta_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/meta_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/mixin/alias_method_test', ['exports', 'ember-metal/property_get', 'ember-metal/mixin'], function (exports, _emberMetalProperty_get, _emberMetalMixin) { @@ -43089,21 +42090,13 @@ enifed('ember-metal/tests/mixin/alias_method_test', ['exports', 'ember-metal/pro validateAliasMethod(obj); }); }); -enifed('ember-metal/tests/mixin/alias_method_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/mixin/alias_method_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/mixin'); - test('ember-metal/tests/mixin/alias_method_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/mixin/alias_method_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/mixin/alias_method_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/mixin'); - QUnit.test('ember-metal/tests/mixin/alias_method_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/mixin/alias_method_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/mixin/alias_method_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/mixin/alias_method_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/mixin/apply_test', ['exports', 'ember-metal/property_get', 'ember-metal/mixin'], function (exports, _emberMetalProperty_get, _emberMetalMixin) { @@ -43146,21 +42139,13 @@ enifed('ember-metal/tests/mixin/apply_test', ['exports', 'ember-metal/property_g strictEqual(_emberMetalProperty_get.default(obj, 'tagName'), ''); }); }); -enifed('ember-metal/tests/mixin/apply_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/mixin'); - test('ember-metal/tests/mixin/apply_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/mixin/apply_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/mixin/apply_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/mixin/apply_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/mixin'); - QUnit.test('ember-metal/tests/mixin/apply_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/mixin/apply_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/mixin/apply_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/mixin/apply_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/mixin/computed_test', ['exports', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/mixin', 'ember-metal/computed', 'ember-metal/properties'], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMixin, _emberMetalComputed, _emberMetalProperties) { @@ -43320,21 +42305,13 @@ enifed('ember-metal/tests/mixin/computed_test', ['exports', 'ember-metal/propert ok(!cpWasCalled, 'The default setter was called, not the CP itself'); }); }); -enifed('ember-metal/tests/mixin/computed_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/mixin/computed_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/mixin'); - test('ember-metal/tests/mixin/computed_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/mixin/computed_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/mixin/computed_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/mixin'); - QUnit.test('ember-metal/tests/mixin/computed_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/mixin/computed_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/mixin/computed_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/mixin/computed_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/mixin/concatenated_properties_test', ['exports', 'ember-metal/property_get', 'ember-metal/mixin'], function (exports, _emberMetalProperty_get, _emberMetalMixin) { @@ -43441,24 +42418,16 @@ enifed('ember-metal/tests/mixin/concatenated_properties_test', ['exports', 'embe }); var obj = _emberMetalMixin.mixin({}, mixinA, mixinB); - equal(_emberMetalProperty_get.default(obj, 'foobar'), 'foobar'); - }); -}); -enifed('ember-metal/tests/mixin/concatenated_properties_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/mixin'); - test('ember-metal/tests/mixin/concatenated_properties_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/mixin/concatenated_properties_test.js should pass jscs.'); + deepEqual(_emberMetalProperty_get.default(obj, 'foobar'), ['foo', 'bar']); }); }); -enifed('ember-metal/tests/mixin/concatenated_properties_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/mixin/concatenated_properties_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/mixin'); - QUnit.test('ember-metal/tests/mixin/concatenated_properties_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/mixin/concatenated_properties_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/mixin/concatenated_properties_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/mixin/concatenated_properties_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/mixin/detect_test', ['exports', 'ember-metal/mixin'], function (exports, _emberMetalMixin) { @@ -43499,21 +42468,13 @@ enifed('ember-metal/tests/mixin/detect_test', ['exports', 'ember-metal/mixin'], equal(MixinA.detect(null), false); }); }); -enifed('ember-metal/tests/mixin/detect_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/mixin/detect_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/mixin'); - test('ember-metal/tests/mixin/detect_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/mixin/detect_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/mixin/detect_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/mixin'); - QUnit.test('ember-metal/tests/mixin/detect_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/mixin/detect_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/mixin/detect_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/mixin/detect_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/mixin/introspection_test', ['exports', 'ember-utils', 'ember-metal/mixin'], function (exports, _emberUtils, _emberMetalMixin) { @@ -43565,21 +42526,13 @@ enifed('ember-metal/tests/mixin/introspection_test', ['exports', 'ember-utils', deepEqual(mapGuids(_emberMetalMixin.Mixin.mixins(obj)), mapGuids([PrivateProperty, PublicProperty, PrivateMethod, PublicMethod, Combined, BarProperties, BarMethods]), 'should return included mixins'); }); }); -enifed('ember-metal/tests/mixin/introspection_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/mixin/introspection_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/mixin'); - test('ember-metal/tests/mixin/introspection_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/mixin/introspection_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/mixin/introspection_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/mixin'); - QUnit.test('ember-metal/tests/mixin/introspection_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/mixin/introspection_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/mixin/introspection_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/mixin/introspection_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/mixin/merged_properties_test', ['exports', 'ember-runtime', 'ember-metal/property_get', 'ember-metal/mixin'], function (exports, _emberRuntime, _emberMetalProperty_get, _emberMetalMixin) { @@ -43761,21 +42714,13 @@ enifed('ember-metal/tests/mixin/merged_properties_test', ['exports', 'ember-runt }, 'You passed in `["a"]` as the value for `foo` but `foo` cannot be an Array'); }); }); -enifed('ember-metal/tests/mixin/merged_properties_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/mixin'); - test('ember-metal/tests/mixin/merged_properties_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/mixin/merged_properties_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/mixin/merged_properties_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/mixin/merged_properties_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/mixin'); - QUnit.test('ember-metal/tests/mixin/merged_properties_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/mixin/merged_properties_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/mixin/merged_properties_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/mixin/merged_properties_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/mixin/method_test', ['exports', 'ember-metal/mixin'], function (exports, _emberMetalMixin) { @@ -44024,21 +42969,13 @@ enifed('ember-metal/tests/mixin/method_test', ['exports', 'ember-metal/mixin'], equal(cnt, 3, 'should invoke all 3 methods'); }); }); -enifed('ember-metal/tests/mixin/method_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/mixin'); - test('ember-metal/tests/mixin/method_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/mixin/method_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/mixin/method_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/mixin/method_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/mixin'); - QUnit.test('ember-metal/tests/mixin/method_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/mixin/method_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/mixin/method_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/mixin/method_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/mixin/observer_test', ['exports', 'internal-test-helpers', 'ember-metal/mixin', 'ember-metal/watching'], function (exports, _internalTestHelpers, _emberMetalMixin, _emberMetalWatching) { @@ -44259,21 +43196,13 @@ enifed('ember-metal/tests/mixin/observer_test', ['exports', 'internal-test-helpe }); }); }); -enifed('ember-metal/tests/mixin/observer_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/mixin'); - test('ember-metal/tests/mixin/observer_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/mixin/observer_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/mixin/observer_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/mixin/observer_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/mixin'); - QUnit.test('ember-metal/tests/mixin/observer_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/mixin/observer_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/mixin/observer_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/mixin/observer_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/mixin/reopen_test', ['exports', 'ember-metal/run_loop', 'ember-metal/property_get', 'ember-runtime', 'ember-metal/mixin'], function (exports, _emberMetalRun_loop, _emberMetalProperty_get, _emberRuntime, _emberMetalMixin) { @@ -44323,21 +43252,13 @@ enifed('ember-metal/tests/mixin/reopen_test', ['exports', 'ember-metal/run_loop' equal(result, 'Breakfast!'); }); }); -enifed('ember-metal/tests/mixin/reopen_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/mixin/reopen_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/mixin'); - test('ember-metal/tests/mixin/reopen_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/mixin/reopen_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/mixin/reopen_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/mixin'); - QUnit.test('ember-metal/tests/mixin/reopen_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/mixin/reopen_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/mixin/reopen_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/mixin/reopen_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/mixin/required_test', ['exports', 'ember-metal/mixin', 'ember-metal/property_get'], function (exports, _emberMetalMixin, _emberMetalProperty_get) { @@ -44395,21 +43316,13 @@ enifed('ember-metal/tests/mixin/required_test', ['exports', 'ember-metal/mixin', equal(_emberMetalProperty_get.get(obj, 'foo'), 'FOO', 'should now be defined'); }); }); -enifed('ember-metal/tests/mixin/required_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/mixin/required_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/mixin'); - test('ember-metal/tests/mixin/required_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/mixin/required_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/mixin/required_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/mixin'); - QUnit.test('ember-metal/tests/mixin/required_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/mixin/required_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/mixin/required_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/mixin/required_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/mixin/without_test', ['exports', 'ember-metal/mixin'], function (exports, _emberMetalMixin) { @@ -44430,21 +43343,13 @@ enifed('ember-metal/tests/mixin/without_test', ['exports', 'ember-metal/mixin'], equal(obj.bar, undefined, 'should not define bar'); }); }); -enifed('ember-metal/tests/mixin/without_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/mixin'); - test('ember-metal/tests/mixin/without_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/mixin/without_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/mixin/without_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/mixin/without_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/mixin'); - QUnit.test('ember-metal/tests/mixin/without_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/mixin/without_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/mixin/without_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/mixin/without_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/observer_test', ['exports', 'ember-environment', 'internal-test-helpers', 'ember-metal/observer', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/mixin', 'ember-metal/run_loop'], function (exports, _emberEnvironment, _internalTestHelpers, _emberMetalObserver, _emberMetalProperty_events, _emberMetalProperties, _emberMetalComputed, _emberMetalMixin, _emberMetalRun_loop) { @@ -45748,21 +44653,13 @@ enifed('ember-metal/tests/observer_test', ['exports', 'ember-environment', 'inte deepEqual(Object.keys(itsMyLastBeer), ['type'], 'set -> removeObserver'); }); }); -enifed('ember-metal/tests/observer_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/observer_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/observer_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/observer_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/observer_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/observer_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/observer_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/observer_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/observer_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/performance_test', ['exports', 'ember-metal/property_set', 'ember-metal/property_get', 'ember-metal/computed', 'ember-metal/properties', 'ember-metal/property_events', 'ember-metal/observer'], function (exports, _emberMetalProperty_set, _emberMetalProperty_get, _emberMetalComputed, _emberMetalProperties, _emberMetalProperty_events, _emberMetalObserver) { @@ -45823,21 +44720,13 @@ enifed('ember-metal/tests/performance_test', ['exports', 'ember-metal/property_s equal(count, 0, 'should not have recomputed property'); }); }); -enifed('ember-metal/tests/performance_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/performance_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/performance_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/performance_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/performance_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/performance_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/performance_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/performance_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/performance_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/properties_test', ['exports', 'ember-metal/computed', 'ember-metal/properties', 'ember-metal/deprecate_property'], function (exports, _emberMetalComputed, _emberMetalProperties, _emberMetalDeprecate_property) { @@ -45943,21 +44832,13 @@ enifed('ember-metal/tests/properties_test', ['exports', 'ember-metal/computed', equal(obj.baz, obj.foo, 'baz and foo are equal'); }); }); -enifed('ember-metal/tests/properties_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/properties_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/properties_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/properties_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/properties_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/properties_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/properties_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/properties_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/properties_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/property_did_change_hook', ['exports', 'internal-test-helpers', 'ember-metal/property_events', 'ember-metal/watching', 'ember-metal/properties', 'ember-metal/alias', 'ember-metal/computed'], function (exports, _internalTestHelpers, _emberMetalProperty_events, _emberMetalWatching, _emberMetalProperties, _emberMetalAlias, _emberMetalComputed) { @@ -46022,21 +44903,13 @@ enifed('ember-metal/tests/property_did_change_hook', ['exports', 'internal-test- equal(counts['total'], 1, 'PROPERTY_DID_CHANGE called with total'); }); }); -enifed('ember-metal/tests/property_did_change_hook.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/property_did_change_hook.js should pass jscs', function () { - ok(true, 'ember-metal/tests/property_did_change_hook.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/property_did_change_hook.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/property_did_change_hook.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/property_did_change_hook.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/property_did_change_hook.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/property_did_change_hook.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/property_did_change_hook.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/run_loop/add_queue_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { @@ -46067,21 +44940,13 @@ enifed('ember-metal/tests/run_loop/add_queue_test', ['exports', 'ember-metal/run equal(queues.length, 3, 'queue was not added twice'); }); }); -enifed('ember-metal/tests/run_loop/add_queue_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/run_loop'); - test('ember-metal/tests/run_loop/add_queue_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/run_loop/add_queue_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/run_loop/add_queue_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/run_loop/add_queue_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/run_loop'); - QUnit.test('ember-metal/tests/run_loop/add_queue_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/run_loop/add_queue_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/run_loop/add_queue_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/run_loop/add_queue_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/run_loop/debounce_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { @@ -46106,21 +44971,13 @@ enifed('ember-metal/tests/run_loop/debounce_test', ['exports', 'ember-metal/run_ ok(wasCalled, 'Ember.run.debounce used'); }); }); -enifed('ember-metal/tests/run_loop/debounce_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/run_loop/debounce_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/run_loop'); - test('ember-metal/tests/run_loop/debounce_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/run_loop/debounce_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/run_loop/debounce_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/run_loop'); - QUnit.test('ember-metal/tests/run_loop/debounce_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/run_loop/debounce_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/run_loop/debounce_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/run_loop/debounce_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/run_loop/later_test', ['exports', 'ember-metal/is_none', 'ember-metal/run_loop'], function (exports, _emberMetalIs_none, _emberMetalRun_loop) { @@ -46364,21 +45221,13 @@ enifed('ember-metal/tests/run_loop/later_test', ['exports', 'ember-metal/is_none }); }); }); -enifed('ember-metal/tests/run_loop/later_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/run_loop/later_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/run_loop'); - test('ember-metal/tests/run_loop/later_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/run_loop/later_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/run_loop/later_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/run_loop'); - QUnit.test('ember-metal/tests/run_loop/later_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/run_loop/later_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/run_loop/later_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/run_loop/later_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/run_loop/next_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { @@ -46421,11 +45270,9 @@ enifed('ember-metal/tests/run_loop/next_test', ['exports', 'ember-metal/run_loop }); asyncTest('multiple calls to run.next share coalesce callbacks into same run loop', function () { - var firstRunLoop = undefined, - secondRunLoop = undefined, + var secondRunLoop = undefined, thirdRunLoop = undefined; _emberMetalRun_loop.default(function () { - firstRunLoop = _emberMetalRun_loop.default.currentRunLoop; _emberMetalRun_loop.default.next(function () { return secondRunLoop = _emberMetalRun_loop.default.currentRunLoop; }); @@ -46440,21 +45287,13 @@ enifed('ember-metal/tests/run_loop/next_test', ['exports', 'ember-metal/run_loop }, 20); }); }); -enifed('ember-metal/tests/run_loop/next_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/run_loop/next_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/run_loop'); - test('ember-metal/tests/run_loop/next_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/run_loop/next_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/run_loop/next_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/run_loop'); - QUnit.test('ember-metal/tests/run_loop/next_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/run_loop/next_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/run_loop/next_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/run_loop/next_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/run_loop/once_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { @@ -46519,21 +45358,13 @@ enifed('ember-metal/tests/run_loop/once_test', ['exports', 'ember-metal/run_loop }); }); }); -enifed('ember-metal/tests/run_loop/once_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/run_loop/once_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/run_loop'); - test('ember-metal/tests/run_loop/once_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/run_loop/once_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/run_loop/once_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/run_loop'); - QUnit.test('ember-metal/tests/run_loop/once_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/run_loop/once_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/run_loop/once_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/run_loop/once_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/run_loop/onerror_test', ['exports', 'ember-metal/run_loop', 'ember-metal/error_handler'], function (exports, _emberMetalRun_loop, _emberMetalError_handler) { @@ -46579,21 +45410,13 @@ enifed('ember-metal/tests/run_loop/onerror_test', ['exports', 'ember-metal/run_l deepEqual(caught, thrown); }); }); -enifed('ember-metal/tests/run_loop/onerror_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/run_loop'); - test('ember-metal/tests/run_loop/onerror_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/run_loop/onerror_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/run_loop/onerror_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/run_loop/onerror_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/run_loop'); - QUnit.test('ember-metal/tests/run_loop/onerror_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/run_loop/onerror_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/run_loop/onerror_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/run_loop/onerror_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/run_loop/run_bind_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { @@ -46634,21 +45457,13 @@ enifed('ember-metal/tests/run_loop/run_bind_test', ['exports', 'ember-metal/run_ asyncFunction(_emberMetalRun_loop.default.bind(asyncCallback, asyncCallback, 1)); }); }); -enifed('ember-metal/tests/run_loop/run_bind_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/run_loop/run_bind_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/run_loop'); - test('ember-metal/tests/run_loop/run_bind_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/run_loop/run_bind_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/run_loop/run_bind_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/run_loop'); - QUnit.test('ember-metal/tests/run_loop/run_bind_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/run_loop/run_bind_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/run_loop/run_bind_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/run_loop/run_bind_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/run_loop/run_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { @@ -46675,21 +45490,13 @@ enifed('ember-metal/tests/run_loop/run_test', ['exports', 'ember-metal/run_loop' deepEqual(_emberMetalRun_loop.default(obj, obj.checkArgs, 'hello', 'world'), ['hello', 'BAR', 'world'], 'pass obj, obj.method, and extra arguments'); }); }); -enifed('ember-metal/tests/run_loop/run_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/run_loop/run_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/run_loop'); - test('ember-metal/tests/run_loop/run_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/run_loop/run_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/run_loop/run_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/run_loop'); - QUnit.test('ember-metal/tests/run_loop/run_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/run_loop/run_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/run_loop/run_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/run_loop/run_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/run_loop/schedule_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { @@ -46793,21 +45600,13 @@ enifed('ember-metal/tests/run_loop/schedule_test', ['exports', 'ember-metal/run_ }, /wrap any code with asynchronous side-effects in a run/); }); }); -enifed('ember-metal/tests/run_loop/schedule_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/run_loop/schedule_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/run_loop'); - test('ember-metal/tests/run_loop/schedule_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/run_loop/schedule_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/run_loop/schedule_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/run_loop'); - QUnit.test('ember-metal/tests/run_loop/schedule_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/run_loop/schedule_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/run_loop/schedule_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/run_loop/schedule_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/run_loop/sync_test', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) { @@ -46847,21 +45646,13 @@ enifed('ember-metal/tests/run_loop/sync_test', ['exports', 'ember-metal/run_loop _emberMetalRun_loop.default.sync(); }); }); -enifed('ember-metal/tests/run_loop/sync_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/run_loop'); - test('ember-metal/tests/run_loop/sync_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/run_loop/sync_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/run_loop/sync_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/run_loop/sync_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/run_loop'); - QUnit.test('ember-metal/tests/run_loop/sync_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/run_loop/sync_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/run_loop/sync_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/run_loop/sync_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/run_loop/unwind_test', ['exports', 'ember-metal/run_loop', 'ember-metal/error'], function (exports, _emberMetalRun_loop, _emberMetalError) { @@ -46905,21 +45696,13 @@ enifed('ember-metal/tests/run_loop/unwind_test', ['exports', 'ember-metal/run_lo _emberMetalRun_loop.default.currentRunLoop = initialRunLoop; }); }); -enifed('ember-metal/tests/run_loop/unwind_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/run_loop/unwind_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/run_loop'); - test('ember-metal/tests/run_loop/unwind_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/run_loop/unwind_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/run_loop/unwind_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/run_loop'); - QUnit.test('ember-metal/tests/run_loop/unwind_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/run_loop/unwind_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/run_loop/unwind_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/run_loop/unwind_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/set_properties_test', ['exports', 'ember-metal/set_properties'], function (exports, _emberMetalSet_properties) { @@ -46948,21 +45731,13 @@ enifed('ember-metal/tests/set_properties_test', ['exports', 'ember-metal/set_pro }, 'Set an additional, previously unset property'); }); }); -enifed('ember-metal/tests/set_properties_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/set_properties_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/set_properties_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/set_properties_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/set_properties_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/set_properties_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/set_properties_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/set_properties_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/set_properties_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/watching/is_watching_test', ['exports', 'ember-metal/computed', 'ember-metal/property_get', 'ember-metal/properties', 'ember-metal/mixin', 'ember-metal/observer', 'ember-metal/watching'], function (exports, _emberMetalComputed, _emberMetalProperty_get, _emberMetalProperties, _emberMetalMixin, _emberMetalObserver, _emberMetalWatching) { @@ -47038,21 +45813,13 @@ enifed('ember-metal/tests/watching/is_watching_test', ['exports', 'ember-metal/c }, 'length'); }); }); -enifed('ember-metal/tests/watching/is_watching_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/watching'); - test('ember-metal/tests/watching/is_watching_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/watching/is_watching_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/watching/is_watching_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/watching/is_watching_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/watching'); - QUnit.test('ember-metal/tests/watching/is_watching_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/watching/is_watching_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/watching/is_watching_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/watching/is_watching_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/watching/unwatch_test', ['exports', 'internal-test-helpers', 'ember-metal/watching', 'ember-metal/properties', 'ember-metal/events', 'ember-metal/computed', 'ember-metal/property_set'], function (exports, _internalTestHelpers, _emberMetalWatching, _emberMetalProperties, _emberMetalEvents, _emberMetalComputed, _emberMetalProperty_set) { @@ -47171,21 +45938,13 @@ enifed('ember-metal/tests/watching/unwatch_test', ['exports', 'internal-test-hel equal(obj.foo, 'RUN', 'obj.foo after unwatch'); }); }); -enifed('ember-metal/tests/watching/unwatch_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests/watching'); - test('ember-metal/tests/watching/unwatch_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/watching/unwatch_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/watching/unwatch_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/watching/unwatch_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests/watching'); - QUnit.test('ember-metal/tests/watching/unwatch_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/watching/unwatch_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/watching/unwatch_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/watching/unwatch_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/watching/watch_test', ['exports', 'ember-environment', 'ember-metal/meta', 'ember-metal/property_set', 'ember-metal/property_get', 'ember-metal/computed', 'ember-metal/properties', 'internal-test-helpers', 'ember-metal/events', 'ember-metal/watching'], function (exports, _emberEnvironment, _emberMetalMeta, _emberMetalProperty_set, _emberMetalProperty_get, _emberMetalComputed, _emberMetalProperties, _internalTestHelpers, _emberMetalEvents, _emberMetalWatching) { @@ -47195,8 +45954,7 @@ enifed('ember-metal/tests/watching/watch_test', ['exports', 'ember-environment', didCount = undefined, willKeys = undefined, didKeys = undefined, - originalLookup = undefined, - lookup = undefined; + originalLookup = undefined; QUnit.module('watch', { setup: function () { @@ -47205,7 +45963,7 @@ enifed('ember-metal/tests/watching/watch_test', ['exports', 'ember-environment', didKeys = []; originalLookup = _emberEnvironment.context.lookup; - _emberEnvironment.context.lookup = lookup = {}; + _emberEnvironment.context.lookup = {}; }, teardown: function () { @@ -47438,21 +46196,13 @@ enifed('ember-metal/tests/watching/watch_test', ['exports', 'ember-environment', equal(get(child, 'b'), 1, 'Ember.get(child, "b") (after watch)'); }); }); -enifed('ember-metal/tests/watching/watch_test.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/tests/watching/watch_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal/tests/watching'); - test('ember-metal/tests/watching/watch_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/watching/watch_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/watching/watch_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal/tests/watching'); - QUnit.test('ember-metal/tests/watching/watch_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/watching/watch_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/watching/watch_test.js should pass jshint.'); + assert.ok(true, 'ember-metal/tests/watching/watch_test.js should pass ESLint\n\n'); }); }); enifed('ember-metal/tests/weak_map_test', ['exports', 'ember-metal/weak_map'], function (exports, _emberMetalWeak_map) { @@ -47581,412 +46331,229 @@ enifed('ember-metal/tests/weak_map_test', ['exports', 'ember-metal/weak_map'], f assert.strictEqual(map.toString(), '[object WeakMap]'); }); }); -enifed('ember-metal/tests/weak_map_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal/tests'); - test('ember-metal/tests/weak_map_test.js should pass jscs', function () { - ok(true, 'ember-metal/tests/weak_map_test.js should pass jscs.'); - }); -}); -enifed('ember-metal/tests/weak_map_test.jshint', ['exports'], function (exports) { +enifed('ember-metal/tests/weak_map_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal/tests'); - QUnit.test('ember-metal/tests/weak_map_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/tests/weak_map_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/tests/weak_map_test.js should pass jshint.'); - }); -}); -enifed('ember-metal/transaction.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/transaction.js should pass jscs', function () { - ok(true, 'ember-metal/transaction.js should pass jscs.'); + assert.ok(true, 'ember-metal/tests/weak_map_test.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/transaction.jshint', ['exports'], function (exports) { +enifed('ember-metal/transaction.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/transaction.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/transaction.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/transaction.js should pass jshint.'); + assert.ok(true, 'ember-metal/transaction.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/watch_key.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/watch_key.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/watch_key.js should pass jscs', function () { - ok(true, 'ember-metal/watch_key.js should pass jscs.'); - }); -}); -enifed('ember-metal/watch_key.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/watch_key.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/watch_key.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/watch_key.js should pass jshint.'); + assert.ok(true, 'ember-metal/watch_key.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/watch_path.jscs-test', ['exports'], function (exports) { +enifed('ember-metal/watch_path.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-metal'); - test('ember-metal/watch_path.js should pass jscs', function () { - ok(true, 'ember-metal/watch_path.js should pass jscs.'); - }); -}); -enifed('ember-metal/watch_path.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/watch_path.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/watch_path.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/watch_path.js should pass jshint.'); - }); -}); -enifed('ember-metal/watching.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/watching.js should pass jscs', function () { - ok(true, 'ember-metal/watching.js should pass jscs.'); + assert.ok(true, 'ember-metal/watch_path.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/watching.jshint', ['exports'], function (exports) { +enifed('ember-metal/watching.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/watching.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/watching.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/watching.js should pass jshint.'); - }); -}); -enifed('ember-metal/weak_map.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-metal'); - test('ember-metal/weak_map.js should pass jscs', function () { - ok(true, 'ember-metal/weak_map.js should pass jscs.'); + assert.ok(true, 'ember-metal/watching.js should pass ESLint\n\n'); }); }); -enifed('ember-metal/weak_map.jshint', ['exports'], function (exports) { +enifed('ember-metal/weak_map.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-metal'); - QUnit.test('ember-metal/weak_map.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-metal/weak_map.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-metal/weak_map.js should pass jshint.'); + assert.ok(true, 'ember-metal/weak_map.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/ext/controller.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/ext/controller.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/ext'); - test('ember-routing/ext/controller.js should pass jscs', function () { - ok(true, 'ember-routing/ext/controller.js should pass jscs.'); - }); -}); -enifed('ember-routing/ext/controller.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/ext'); - QUnit.test('ember-routing/ext/controller.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/ext/controller.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/ext/controller.js should pass jshint.'); + assert.ok(true, 'ember-routing/ext/controller.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/ext/run_loop.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/ext/run_loop.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/ext'); - test('ember-routing/ext/run_loop.js should pass jscs', function () { - ok(true, 'ember-routing/ext/run_loop.js should pass jscs.'); - }); -}); -enifed('ember-routing/ext/run_loop.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/ext'); - QUnit.test('ember-routing/ext/run_loop.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/ext/run_loop.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/ext/run_loop.js should pass jshint.'); - }); -}); -enifed('ember-routing/index.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-routing'); - test('ember-routing/index.js should pass jscs', function () { - ok(true, 'ember-routing/index.js should pass jscs.'); + assert.ok(true, 'ember-routing/ext/run_loop.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/index.jshint', ['exports'], function (exports) { +enifed('ember-routing/index.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-routing'); - QUnit.test('ember-routing/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/index.js should pass jshint.'); + assert.ok(true, 'ember-routing/index.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/location/api.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/location/api.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/location'); - test('ember-routing/location/api.js should pass jscs', function () { - ok(true, 'ember-routing/location/api.js should pass jscs.'); - }); -}); -enifed('ember-routing/location/api.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/location'); - QUnit.test('ember-routing/location/api.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/location/api.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/location/api.js should pass jshint.'); + assert.ok(true, 'ember-routing/location/api.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/location/auto_location.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/location/auto_location.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/location'); - test('ember-routing/location/auto_location.js should pass jscs', function () { - ok(true, 'ember-routing/location/auto_location.js should pass jscs.'); - }); -}); -enifed('ember-routing/location/auto_location.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/location'); - QUnit.test('ember-routing/location/auto_location.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/location/auto_location.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/location/auto_location.js should pass jshint.'); - }); -}); -enifed('ember-routing/location/hash_location.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-routing/location'); - test('ember-routing/location/hash_location.js should pass jscs', function () { - ok(true, 'ember-routing/location/hash_location.js should pass jscs.'); + assert.ok(true, 'ember-routing/location/auto_location.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/location/hash_location.jshint', ['exports'], function (exports) { +enifed('ember-routing/location/hash_location.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-routing/location'); - QUnit.test('ember-routing/location/hash_location.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/location/hash_location.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/location/hash_location.js should pass jshint.'); + assert.ok(true, 'ember-routing/location/hash_location.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/location/history_location.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/location/history_location.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/location'); - test('ember-routing/location/history_location.js should pass jscs', function () { - ok(true, 'ember-routing/location/history_location.js should pass jscs.'); - }); -}); -enifed('ember-routing/location/history_location.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/location'); - QUnit.test('ember-routing/location/history_location.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/location/history_location.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/location/history_location.js should pass jshint.'); - }); -}); -enifed('ember-routing/location/none_location.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-routing/location'); - test('ember-routing/location/none_location.js should pass jscs', function () { - ok(true, 'ember-routing/location/none_location.js should pass jscs.'); + assert.ok(true, 'ember-routing/location/history_location.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/location/none_location.jshint', ['exports'], function (exports) { +enifed('ember-routing/location/none_location.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-routing/location'); - QUnit.test('ember-routing/location/none_location.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/location/none_location.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/location/none_location.js should pass jshint.'); + assert.ok(true, 'ember-routing/location/none_location.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/location/util.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/location/util.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/location'); - test('ember-routing/location/util.js should pass jscs', function () { - ok(true, 'ember-routing/location/util.js should pass jscs.'); - }); -}); -enifed('ember-routing/location/util.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/location'); - QUnit.test('ember-routing/location/util.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/location/util.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/location/util.js should pass jshint.'); + assert.ok(true, 'ember-routing/location/util.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/services/routing.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/services/router.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/services'); - test('ember-routing/services/routing.js should pass jscs', function () { - ok(true, 'ember-routing/services/routing.js should pass jscs.'); - }); -}); -enifed('ember-routing/services/routing.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/services'); - QUnit.test('ember-routing/services/routing.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/services/router.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/services/routing.js should pass jshint.'); - }); -}); -enifed('ember-routing/system/cache.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-routing/system'); - test('ember-routing/system/cache.js should pass jscs', function () { - ok(true, 'ember-routing/system/cache.js should pass jscs.'); + assert.ok(true, 'ember-routing/services/router.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/system/cache.jshint', ['exports'], function (exports) { +enifed('ember-routing/services/routing.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-routing/system'); - QUnit.test('ember-routing/system/cache.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/services/routing.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/system/cache.js should pass jshint.'); - }); -}); -enifed('ember-routing/system/controller_for.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-routing/system'); - test('ember-routing/system/controller_for.js should pass jscs', function () { - ok(true, 'ember-routing/system/controller_for.js should pass jscs.'); + assert.ok(true, 'ember-routing/services/routing.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/system/controller_for.jshint', ['exports'], function (exports) { +enifed('ember-routing/system/cache.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-routing/system'); - QUnit.test('ember-routing/system/controller_for.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/system/cache.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/system/controller_for.js should pass jshint.'); + assert.ok(true, 'ember-routing/system/cache.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/system/dsl.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/system/controller_for.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/system'); - test('ember-routing/system/dsl.js should pass jscs', function () { - ok(true, 'ember-routing/system/dsl.js should pass jscs.'); - }); -}); -enifed('ember-routing/system/dsl.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/system'); - QUnit.test('ember-routing/system/dsl.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/system/controller_for.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/system/dsl.js should pass jshint.'); + assert.ok(true, 'ember-routing/system/controller_for.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/system/generate_controller.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/system/dsl.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/system'); - test('ember-routing/system/generate_controller.js should pass jscs', function () { - ok(true, 'ember-routing/system/generate_controller.js should pass jscs.'); - }); -}); -enifed('ember-routing/system/generate_controller.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/system'); - QUnit.test('ember-routing/system/generate_controller.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/system/dsl.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/system/generate_controller.js should pass jshint.'); + assert.ok(true, 'ember-routing/system/dsl.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/system/query_params.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/system/generate_controller.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/system'); - test('ember-routing/system/query_params.js should pass jscs', function () { - ok(true, 'ember-routing/system/query_params.js should pass jscs.'); - }); -}); -enifed('ember-routing/system/query_params.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/system'); - QUnit.test('ember-routing/system/query_params.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/system/generate_controller.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/system/query_params.js should pass jshint.'); - }); -}); -enifed('ember-routing/system/route.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-routing/system'); - test('ember-routing/system/route.js should pass jscs', function () { - ok(true, 'ember-routing/system/route.js should pass jscs.'); + assert.ok(true, 'ember-routing/system/generate_controller.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/system/route.jshint', ['exports'], function (exports) { +enifed('ember-routing/system/query_params.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-routing/system'); - QUnit.test('ember-routing/system/route.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/system/query_params.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/system/route.js should pass jshint.'); + assert.ok(true, 'ember-routing/system/query_params.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/system/router.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/system/route.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/system'); - test('ember-routing/system/router.js should pass jscs', function () { - ok(true, 'ember-routing/system/router.js should pass jscs.'); - }); -}); -enifed('ember-routing/system/router.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/system'); - QUnit.test('ember-routing/system/router.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/system/route.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/system/router.js should pass jshint.'); + assert.ok(true, 'ember-routing/system/route.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/system/router_state.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/system/router.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/system'); - test('ember-routing/system/router_state.js should pass jscs', function () { - ok(true, 'ember-routing/system/router_state.js should pass jscs.'); + QUnit.module('ESLint | ember-routing/system/router.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-routing/system/router.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/system/router_state.jshint', ['exports'], function (exports) { +enifed('ember-routing/system/router_state.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-routing/system'); - QUnit.test('ember-routing/system/router_state.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/system/router_state.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/system/router_state.js should pass jshint.'); + assert.ok(true, 'ember-routing/system/router_state.js should pass ESLint\n\n'); }); }); enifed('ember-routing/tests/ext/controller_test', ['exports', 'ember-utils', 'internal-test-helpers', 'ember-runtime'], function (exports, _emberUtils, _internalTestHelpers, _emberRuntime) { @@ -48023,21 +46590,13 @@ enifed('ember-routing/tests/ext/controller_test', ['exports', 'ember-utils', 'in strictEqual(controller.transitionToRoute(queryParams), queryParams, 'passes query param only transitions through'); }); }); -enifed('ember-routing/tests/ext/controller_test.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/tests/ext/controller_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/tests/ext'); - test('ember-routing/tests/ext/controller_test.js should pass jscs', function () { - ok(true, 'ember-routing/tests/ext/controller_test.js should pass jscs.'); - }); -}); -enifed('ember-routing/tests/ext/controller_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/tests/ext'); - QUnit.test('ember-routing/tests/ext/controller_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/tests/ext/controller_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/tests/ext/controller_test.js should pass jshint.'); + assert.ok(true, 'ember-routing/tests/ext/controller_test.js should pass ESLint\n\n'); }); }); enifed('ember-routing/tests/location/auto_location_test', ['exports', 'ember-utils', 'ember-environment', 'ember-metal', 'ember-routing/location/auto_location', 'ember-routing/location/history_location', 'ember-routing/location/hash_location', 'ember-routing/location/none_location', 'internal-test-helpers'], function (exports, _emberUtils, _emberEnvironment, _emberMetal, _emberRoutingLocationAuto_location, _emberRoutingLocationHistory_location, _emberRoutingLocationHash_location, _emberRoutingLocationNone_location, _internalTestHelpers) { @@ -48326,21 +46885,13 @@ enifed('ember-routing/tests/location/auto_location_test', ['exports', 'ember-uti equal(_emberRoutingLocationAuto_location.getHashPath('/app/', browserLocation), '/app/#/#about?foo=bar#foo', 'URLs with a hash not following #/ convention shouldn\'t be normalized as a route'); }); }); -enifed('ember-routing/tests/location/auto_location_test.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/tests/location/auto_location_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/tests/location'); - test('ember-routing/tests/location/auto_location_test.js should pass jscs', function () { - ok(true, 'ember-routing/tests/location/auto_location_test.js should pass jscs.'); - }); -}); -enifed('ember-routing/tests/location/auto_location_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/tests/location'); - QUnit.test('ember-routing/tests/location/auto_location_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/tests/location/auto_location_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/tests/location/auto_location_test.js should pass jshint.'); + assert.ok(true, 'ember-routing/tests/location/auto_location_test.js should pass ESLint\n\n'); }); }); enifed('ember-routing/tests/location/hash_location_test', ['exports', 'ember-metal', 'ember-routing/location/hash_location'], function (exports, _emberMetal, _emberRoutingLocationHash_location) { @@ -48536,21 +47087,13 @@ enifed('ember-routing/tests/location/hash_location_test', ['exports', 'ember-met triggerHashchange(); }); }); -enifed('ember-routing/tests/location/hash_location_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-routing/tests/location'); - test('ember-routing/tests/location/hash_location_test.js should pass jscs', function () { - ok(true, 'ember-routing/tests/location/hash_location_test.js should pass jscs.'); - }); -}); -enifed('ember-routing/tests/location/hash_location_test.jshint', ['exports'], function (exports) { +enifed('ember-routing/tests/location/hash_location_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-routing/tests/location'); - QUnit.test('ember-routing/tests/location/hash_location_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/tests/location/hash_location_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/tests/location/hash_location_test.js should pass jshint.'); + assert.ok(true, 'ember-routing/tests/location/hash_location_test.js should pass ESLint\n\n'); }); }); enifed('ember-routing/tests/location/history_location_test', ['exports', 'ember-metal', 'ember-routing/location/history_location'], function (exports, _emberMetal, _emberRoutingLocationHistory_location) { @@ -48671,48 +47214,96 @@ enifed('ember-routing/tests/location/history_location_test', ['exports', 'ember- location.initState(); }); - QUnit.test('base URL is preserved when moving around', function () { - expect(1); + if (_emberMetal.isFeatureEnabled('ember-unique-location-history-state')) { + QUnit.test('base URL is preserved when moving around', function () { + expect(2); - HistoryTestLocation.reopen({ - init: function () { - this._super.apply(this, arguments); + HistoryTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); - _emberMetal.set(this, 'location', mockBrowserLocation('/base/foo/bar')); - _emberMetal.set(this, 'baseURL', '/base/'); - } + _emberMetal.set(this, 'location', mockBrowserLocation('/base/foo/bar')); + _emberMetal.set(this, 'baseURL', '/base/'); + } + }); + + createLocation(); + location.initState(); + location.setURL('/one/two'); + + equal(location._historyState.path, '/base/one/two'); + ok(location._historyState.uuid); }); - createLocation(); - location.initState(); - location.setURL('/one/two'); + QUnit.test('setURL continues to set even with a null state (iframes may set this)', function () { + expect(2); - equal(location._historyState.path, '/base/one/two'); - }); + createLocation(); + location.initState(); - QUnit.test('setURL continues to set even with a null state (iframes may set this)', function () { - expect(1); + FakeHistory.pushState(null); + location.setURL('/three/four'); - createLocation(); - location.initState(); + equal(location._historyState.path, '/three/four'); + ok(location._historyState.uuid); + }); - FakeHistory.pushState(null); - location.setURL('/three/four'); + QUnit.test('replaceURL continues to set even with a null state (iframes may set this)', function () { + expect(2); - equal(location._historyState.path, '/three/four'); - }); + createLocation(); + location.initState(); - QUnit.test('replaceURL continues to set even with a null state (iframes may set this)', function () { - expect(1); + FakeHistory.pushState(null); + location.replaceURL('/three/four'); - createLocation(); - location.initState(); + equal(location._historyState.path, '/three/four'); + ok(location._historyState.uuid); + }); + } else { + QUnit.test('base URL is preserved when moving around', function () { + expect(1); - FakeHistory.pushState(null); - location.replaceURL('/three/four'); + HistoryTestLocation.reopen({ + init: function () { + this._super.apply(this, arguments); - equal(location._historyState.path, '/three/four'); - }); + _emberMetal.set(this, 'location', mockBrowserLocation('/base/foo/bar')); + _emberMetal.set(this, 'baseURL', '/base/'); + } + }); + + createLocation(); + location.initState(); + location.setURL('/one/two'); + + equal(location._historyState.path, '/base/one/two'); + }); + + QUnit.test('setURL continues to set even with a null state (iframes may set this)', function () { + expect(1); + + createLocation(); + location.initState(); + + FakeHistory.pushState(null); + location.setURL('/three/four'); + + equal(location._historyState.path, '/three/four'); + }); + + QUnit.test('replaceURL continues to set even with a null state (iframes may set this)', function () { + expect(1); + + createLocation(); + location.initState(); + + FakeHistory.pushState(null); + location.replaceURL('/three/four'); + + equal(location._historyState.path, '/three/four'); + }); + } QUnit.test('HistoryLocation.getURL() returns the current url, excluding both rootURL and baseURL', function () { expect(1); @@ -48843,21 +47434,13 @@ enifed('ember-routing/tests/location/history_location_test', ['exports', 'ember- equal(location.getURL(), '/foo/bar?time=morphin#pink-power-ranger'); }); }); -enifed('ember-routing/tests/location/history_location_test.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/tests/location/history_location_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/tests/location'); - test('ember-routing/tests/location/history_location_test.js should pass jscs', function () { - ok(true, 'ember-routing/tests/location/history_location_test.js should pass jscs.'); - }); -}); -enifed('ember-routing/tests/location/history_location_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/tests/location'); - QUnit.test('ember-routing/tests/location/history_location_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/tests/location/history_location_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/tests/location/history_location_test.js should pass jshint.'); + assert.ok(true, 'ember-routing/tests/location/history_location_test.js should pass ESLint\n\n'); }); }); enifed('ember-routing/tests/location/none_location_test', ['exports', 'ember-metal', 'ember-routing/location/none_location'], function (exports, _emberMetal, _emberRoutingLocationNone_location) { @@ -48950,21 +47533,13 @@ enifed('ember-routing/tests/location/none_location_test', ['exports', 'ember-met equal(location.getURL(), '/bars/baz'); }); }); -enifed('ember-routing/tests/location/none_location_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-routing/tests/location'); - test('ember-routing/tests/location/none_location_test.js should pass jscs', function () { - ok(true, 'ember-routing/tests/location/none_location_test.js should pass jscs.'); - }); -}); -enifed('ember-routing/tests/location/none_location_test.jshint', ['exports'], function (exports) { +enifed('ember-routing/tests/location/none_location_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-routing/tests/location'); - QUnit.test('ember-routing/tests/location/none_location_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/tests/location/none_location_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/tests/location/none_location_test.js should pass jshint.'); + assert.ok(true, 'ember-routing/tests/location/none_location_test.js should pass ESLint\n\n'); }); }); enifed('ember-routing/tests/location/util_test', ['exports', 'ember-utils', 'ember-routing/location/util'], function (exports, _emberUtils, _emberRoutingLocationUtil) { @@ -49059,21 +47634,13 @@ enifed('ember-routing/tests/location/util_test', ['exports', 'ember-utils', 'emb }); // jscs:enable }); -enifed('ember-routing/tests/location/util_test.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/tests/location/util_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/tests/location'); - test('ember-routing/tests/location/util_test.js should pass jscs', function () { - ok(true, 'ember-routing/tests/location/util_test.js should pass jscs.'); - }); -}); -enifed('ember-routing/tests/location/util_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/tests/location'); - QUnit.test('ember-routing/tests/location/util_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/tests/location/util_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/tests/location/util_test.js should pass jshint.'); + assert.ok(true, 'ember-routing/tests/location/util_test.js should pass ESLint\n\n'); }); }); enifed('ember-routing/tests/system/cache_test', ['exports', 'ember-routing/system/cache'], function (exports, _emberRoutingSystemCache) { @@ -49126,21 +47693,13 @@ enifed('ember-routing/tests/system/cache_test', ['exports', 'ember-routing/syste assert.strictEqual(this.cache.lookup('constructor', 'bar', defaultValue), defaultValue); }); }); -enifed('ember-routing/tests/system/cache_test.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/tests/system/cache_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/tests/system'); - test('ember-routing/tests/system/cache_test.js should pass jscs', function () { - ok(true, 'ember-routing/tests/system/cache_test.js should pass jscs.'); - }); -}); -enifed('ember-routing/tests/system/cache_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/tests/system'); - QUnit.test('ember-routing/tests/system/cache_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/tests/system/cache_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/tests/system/cache_test.js should pass jshint.'); + assert.ok(true, 'ember-routing/tests/system/cache_test.js should pass ESLint\n\n'); }); }); enifed('ember-routing/tests/system/controller_for_test', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/system/controller_for', 'ember-routing/system/generate_controller', 'internal-test-helpers'], function (exports, _emberMetal, _emberRuntime, _emberRoutingSystemController_for, _emberRoutingSystemGenerate_controller, _internalTestHelpers) { @@ -49217,37 +47776,48 @@ enifed('ember-routing/tests/system/controller_for_test', ['exports', 'ember-meta } }); - QUnit.test('generateController should create Ember.Controller', function () { + QUnit.test('generateController should return Ember.Controller', function () { var controller = _emberRoutingSystemGenerate_controller.default(appInstance, 'home'); - ok(controller instanceof _emberRuntime.Controller, 'should create controller'); + ok(controller instanceof _emberRuntime.Controller, 'should return controller'); }); - QUnit.test('generateController should create App.Controller if provided', function () { + QUnit.test('generateController should return App.Controller if provided', function () { var controller = undefined; namespace.Controller = _emberRuntime.Controller.extend(); controller = _emberRoutingSystemGenerate_controller.default(appInstance, 'home'); - ok(controller instanceof namespace.Controller, 'should create controller'); + ok(controller instanceof namespace.Controller, 'should return controller'); }); -}); -// A -enifed('ember-routing/tests/system/controller_for_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - module('JSCS - ember-routing/tests/system'); - test('ember-routing/tests/system/controller_for_test.js should pass jscs', function () { - ok(true, 'ember-routing/tests/system/controller_for_test.js should pass jscs.'); + QUnit.test('generateController should return controller:basic if provided', function () { + var controller = undefined; + + var BasicController = _emberRuntime.Controller.extend(); + appInstance.register('controller:basic', BasicController); + + controller = _emberRoutingSystemGenerate_controller.default(appInstance, 'home'); + + if (_emberMetal.isFeatureEnabled('ember-no-double-extend')) { + ok(controller instanceof BasicController, 'should return base class of controller'); + } else { + var doubleExtendedFactory = undefined; + ignoreDeprecation(function () { + doubleExtendedFactory = appInstance._lookupFactory('controller:basic'); + }); + ok(controller instanceof doubleExtendedFactory, 'should return double-extended controller'); + } }); }); -enifed('ember-routing/tests/system/controller_for_test.jshint', ['exports'], function (exports) { +// A +enifed('ember-routing/tests/system/controller_for_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-routing/tests/system'); - QUnit.test('ember-routing/tests/system/controller_for_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/tests/system/controller_for_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/tests/system/controller_for_test.js should pass jshint.'); + assert.ok(true, 'ember-routing/tests/system/controller_for_test.js should pass ESLint\n\n'); }); }); enifed('ember-routing/tests/system/dsl_test', ['exports', 'ember-utils', 'ember-routing/system/router', 'internal-test-helpers'], function (exports, _emberUtils, _emberRoutingSystemRouter, _internalTestHelpers) { @@ -49456,7 +48026,7 @@ enifed('ember-routing/tests/system/dsl_test', ['exports', 'ember-utils', 'ember- router._initRouterJs(); assert.deepEqual(router.router.recognizer.names['bleep.bloop.chat'].segments.slice(1, 4).map(function (s) { - return s.string; + return s.value; }), ['bleep', 'bloop', 'custom-chat'], 'segments are properly associated with mounted engine'); }); @@ -49480,7 +48050,7 @@ enifed('ember-routing/tests/system/dsl_test', ['exports', 'ember-utils', 'ember- router._initRouterJs(); assert.deepEqual(router.router.recognizer.names['bleep.bloop.blork'].segments.slice(1, 4).map(function (s) { - return s.string; + return s.value; }), ['bleep', 'bloop', 'blork'], 'segments are properly associated with mounted engine with aliased name'); }); @@ -49579,24 +48149,16 @@ enifed('ember-routing/tests/system/dsl_test', ['exports', 'ember-utils', 'ember- ok(!router.router.recognizer.names['news.blog_error'], 'nested reset error route was not added'); }); }); -enifed('ember-routing/tests/system/dsl_test.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/tests/system/dsl_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/tests/system'); - test('ember-routing/tests/system/dsl_test.js should pass jscs', function () { - ok(true, 'ember-routing/tests/system/dsl_test.js should pass jscs.'); - }); -}); -enifed('ember-routing/tests/system/dsl_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/tests/system'); - QUnit.test('ember-routing/tests/system/dsl_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/tests/system/dsl_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/tests/system/dsl_test.js should pass jshint.'); + assert.ok(true, 'ember-routing/tests/system/dsl_test.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/tests/system/route_test', ['exports', 'ember-utils', 'internal-test-helpers', 'ember-runtime', 'ember-routing/system/route'], function (exports, _emberUtils, _internalTestHelpers, _emberRuntime, _emberRoutingSystemRoute) { +enifed('ember-routing/tests/system/route_test', ['exports', 'ember-utils', 'internal-test-helpers', 'ember-runtime', 'ember-routing/system/route', 'container'], function (exports, _emberUtils, _internalTestHelpers, _emberRuntime, _emberRoutingSystemRoute, _container) { 'use strict'; var route = undefined, @@ -49618,6 +48180,8 @@ enifed('ember-routing/tests/system/route_test', ['exports', 'ember-utils', 'inte }); QUnit.test('default store utilizes the container to acquire the model factory', function () { + var _ownerOptions; + expect(4); var Post = _emberRuntime.Object.extend(); @@ -49629,19 +48193,24 @@ enifed('ember-routing/tests/system/route_test', ['exports', 'ember-utils', 'inte } }); - _emberUtils.setOwner(route, _internalTestHelpers.buildOwner({ - ownerOptions: { + var ownerOptions = { + ownerOptions: (_ownerOptions = { hasRegistration: function () { return true; - }, + } + }, _ownerOptions[_container.FACTORY_FOR] = function (fullName) { + equal(fullName, 'model:post', 'correct factory was looked up'); - _lookupFactory: function (fullName) { - equal(fullName, 'model:post', 'correct factory was looked up'); + return { + class: Post, + create: function () { + return Post.create(); + } + }; + }, _ownerOptions) + }; - return Post; - } - } - })); + _emberUtils.setOwner(route, _internalTestHelpers.buildOwner(ownerOptions)); route.set('_qp', null); @@ -50104,21 +48673,13 @@ enifed('ember-routing/tests/system/route_test', ['exports', 'ember-utils', 'inte strictEqual(route.replaceWith(queryParams), queryParams, 'passes query param only transitions through'); }); }); -enifed('ember-routing/tests/system/route_test.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/tests/system/route_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/tests/system'); - test('ember-routing/tests/system/route_test.js should pass jscs', function () { - ok(true, 'ember-routing/tests/system/route_test.js should pass jscs.'); - }); -}); -enifed('ember-routing/tests/system/route_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/tests/system'); - QUnit.test('ember-routing/tests/system/route_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/tests/system/route_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/tests/system/route_test.js should pass jshint.'); + assert.ok(true, 'ember-routing/tests/system/route_test.js should pass ESLint\n\n'); }); }); enifed('ember-routing/tests/system/router_test', ['exports', 'ember-utils', 'ember-routing/location/hash_location', 'ember-routing/location/history_location', 'ember-routing/location/auto_location', 'ember-routing/location/none_location', 'ember-routing/system/router', 'internal-test-helpers'], function (exports, _emberUtils, _emberRoutingLocationHash_location, _emberRoutingLocationHistory_location, _emberRoutingLocationAuto_location, _emberRoutingLocationNone_location, _emberRoutingSystemRouter, _internalTestHelpers) { @@ -50371,21 +48932,13 @@ enifed('ember-routing/tests/system/router_test', ['exports', 'ember-utils', 'emb _emberRoutingSystemRouter.triggerEvent(handlerInfos, false, ['loading']); }); }); -enifed('ember-routing/tests/system/router_test.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/tests/system/router_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/tests/system'); - test('ember-routing/tests/system/router_test.js should pass jscs', function () { - ok(true, 'ember-routing/tests/system/router_test.js should pass jscs.'); - }); -}); -enifed('ember-routing/tests/system/router_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/tests/system'); - QUnit.test('ember-routing/tests/system/router_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/tests/system/router_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/tests/system/router_test.js should pass jshint.'); + assert.ok(true, 'ember-routing/tests/system/router_test.js should pass ESLint\n\n'); }); }); enifed('ember-routing/tests/utils_test', ['exports', 'ember-routing/utils'], function (exports, _emberRoutingUtils) { @@ -50393,15 +48946,6 @@ enifed('ember-routing/tests/utils_test', ['exports', 'ember-routing/utils'], fun QUnit.module('Routing query parameter utils - normalizeControllerQueryParams'); - QUnit.test('returns the cached value if that has been previously set', function (assert) { - var cached = {}; - var params = ['foo']; - params._qpMap = cached; - - var normalized = _emberRoutingUtils.normalizeControllerQueryParams(params); - equal(cached, normalized, 'cached value returned if previously set'); - }); - QUnit.test('converts array style into verbose object style', function (assert) { var paramName = 'foo'; var params = [paramName]; @@ -50412,7 +48956,7 @@ enifed('ember-routing/tests/utils_test', ['exports', 'ember-routing/utils'], fun equal(normalized[paramName].scope, 'model', 'defaults scope to model'); }); - QUnit.test('converts object stlye [{foo: \'an_alias\'}]', function (assert) { + QUnit.test('converts object style [{foo: \'an_alias\'}]', function (assert) { var paramName = 'foo'; var params = [{ 'foo': 'an_alias' }]; var normalized = _emberRoutingUtils.normalizeControllerQueryParams(params); @@ -50422,7 +48966,7 @@ enifed('ember-routing/tests/utils_test', ['exports', 'ember-routing/utils'], fun equal(normalized[paramName].scope, 'model', 'defaults scope to model'); }); - QUnit.test('retains maximally verbose object stlye [{foo: {as: \'foo\'}}]', function (assert) { + QUnit.test('retains maximally verbose object style [{foo: {as: \'foo\'}}]', function (assert) { var paramName = 'foo'; var params = [{ 'foo': { as: 'an_alias' } }]; var normalized = _emberRoutingUtils.normalizeControllerQueryParams(params); @@ -50432,713 +48976,382 @@ enifed('ember-routing/tests/utils_test', ['exports', 'ember-routing/utils'], fun equal(normalized[paramName].scope, 'model', 'defaults scope to model'); }); }); -enifed('ember-routing/tests/utils_test.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/tests/utils_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing/tests'); - test('ember-routing/tests/utils_test.js should pass jscs', function () { - ok(true, 'ember-routing/tests/utils_test.js should pass jscs.'); - }); -}); -enifed('ember-routing/tests/utils_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing/tests'); - QUnit.test('ember-routing/tests/utils_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/tests/utils_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/tests/utils_test.js should pass jshint.'); + assert.ok(true, 'ember-routing/tests/utils_test.js should pass ESLint\n\n'); }); }); -enifed('ember-routing/utils.jscs-test', ['exports'], function (exports) { +enifed('ember-routing/utils.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-routing'); - test('ember-routing/utils.js should pass jscs', function () { - ok(true, 'ember-routing/utils.js should pass jscs.'); - }); -}); -enifed('ember-routing/utils.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-routing'); - QUnit.test('ember-routing/utils.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-routing/utils.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-routing/utils.js should pass jshint.'); - }); -}); -enifed('ember-runtime/compare.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime'); - test('ember-runtime/compare.js should pass jscs', function () { - ok(true, 'ember-runtime/compare.js should pass jscs.'); + assert.ok(true, 'ember-routing/utils.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/compare.jshint', ['exports'], function (exports) { +enifed('ember-runtime/compare.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime'); - QUnit.test('ember-runtime/compare.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/compare.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/compare.js should pass jshint.'); - }); -}); -enifed('ember-runtime/computed/computed_macros.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/computed'); - test('ember-runtime/computed/computed_macros.js should pass jscs', function () { - ok(true, 'ember-runtime/computed/computed_macros.js should pass jscs.'); + assert.ok(true, 'ember-runtime/compare.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/computed/computed_macros.jshint', ['exports'], function (exports) { +enifed('ember-runtime/computed/computed_macros.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/computed'); - QUnit.test('ember-runtime/computed/computed_macros.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/computed/computed_macros.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/computed/computed_macros.js should pass jshint.'); + assert.ok(true, 'ember-runtime/computed/computed_macros.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/computed/reduce_computed_macros.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/computed/reduce_computed_macros.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/computed'); - test('ember-runtime/computed/reduce_computed_macros.js should pass jscs', function () { - ok(true, 'ember-runtime/computed/reduce_computed_macros.js should pass jscs.'); - }); -}); -enifed('ember-runtime/computed/reduce_computed_macros.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/computed'); - QUnit.test('ember-runtime/computed/reduce_computed_macros.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/computed/reduce_computed_macros.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/computed/reduce_computed_macros.js should pass jshint.'); - }); -}); -enifed('ember-runtime/controllers/controller.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/controllers'); - test('ember-runtime/controllers/controller.js should pass jscs', function () { - ok(true, 'ember-runtime/controllers/controller.js should pass jscs.'); + assert.ok(true, 'ember-runtime/computed/reduce_computed_macros.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/controllers/controller.jshint', ['exports'], function (exports) { +enifed('ember-runtime/controllers/controller.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/controllers'); - QUnit.test('ember-runtime/controllers/controller.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/controllers/controller.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/controllers/controller.js should pass jshint.'); + assert.ok(true, 'ember-runtime/controllers/controller.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/copy.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/copy.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime'); - test('ember-runtime/copy.js should pass jscs', function () { - ok(true, 'ember-runtime/copy.js should pass jscs.'); - }); -}); -enifed('ember-runtime/copy.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime'); - QUnit.test('ember-runtime/copy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/copy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/copy.js should pass jshint.'); + assert.ok(true, 'ember-runtime/copy.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/ext/function.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/ext/function.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/ext'); - test('ember-runtime/ext/function.js should pass jscs', function () { - ok(true, 'ember-runtime/ext/function.js should pass jscs.'); - }); -}); -enifed('ember-runtime/ext/function.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/ext'); - QUnit.test('ember-runtime/ext/function.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/ext/function.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/ext/function.js should pass jshint.'); + assert.ok(true, 'ember-runtime/ext/function.js should pass ESLint\n\n'); }); }); -enifed("ember-runtime/ext/rsvp.jscs-test", ["exports"], function (exports) { - "use strict"; -}); -enifed('ember-runtime/ext/rsvp.jshint', ['exports'], function (exports) { +enifed('ember-runtime/ext/rsvp.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/ext'); - QUnit.test('ember-runtime/ext/rsvp.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/ext/rsvp.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/ext/rsvp.js should pass jshint.'); - }); -}); -enifed('ember-runtime/ext/string.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/ext'); - test('ember-runtime/ext/string.js should pass jscs', function () { - ok(true, 'ember-runtime/ext/string.js should pass jscs.'); + assert.ok(true, 'ember-runtime/ext/rsvp.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/ext/string.jshint', ['exports'], function (exports) { +enifed('ember-runtime/ext/string.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/ext'); - QUnit.test('ember-runtime/ext/string.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/ext/string.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/ext/string.js should pass jshint.'); - }); -}); -enifed('ember-runtime/index.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime'); - test('ember-runtime/index.js should pass jscs', function () { - ok(true, 'ember-runtime/index.js should pass jscs.'); + assert.ok(true, 'ember-runtime/ext/string.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/index.jshint', ['exports'], function (exports) { +enifed('ember-runtime/index.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime'); - QUnit.test('ember-runtime/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/index.js should pass jshint.'); + assert.ok(true, 'ember-runtime/index.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/inject.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/inject.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime'); - test('ember-runtime/inject.js should pass jscs', function () { - ok(true, 'ember-runtime/inject.js should pass jscs.'); - }); -}); -enifed('ember-runtime/inject.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime'); - QUnit.test('ember-runtime/inject.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/inject.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/inject.js should pass jshint.'); + assert.ok(true, 'ember-runtime/inject.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/is-equal.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/is-equal.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime'); - test('ember-runtime/is-equal.js should pass jscs', function () { - ok(true, 'ember-runtime/is-equal.js should pass jscs.'); - }); -}); -enifed('ember-runtime/is-equal.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime'); - QUnit.test('ember-runtime/is-equal.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/is-equal.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/is-equal.js should pass jshint.'); - }); -}); -enifed('ember-runtime/mixins/-proxy.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/-proxy.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/-proxy.js should pass jscs.'); + assert.ok(true, 'ember-runtime/is-equal.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/-proxy.jshint', ['exports'], function (exports) { +enifed('ember-runtime/mixins/-proxy.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/-proxy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/-proxy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/-proxy.js should pass jshint.'); + assert.ok(true, 'ember-runtime/mixins/-proxy.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/action_handler.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/mixins/action_handler.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/action_handler.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/action_handler.js should pass jscs.'); - }); -}); -enifed('ember-runtime/mixins/action_handler.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/action_handler.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/action_handler.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/action_handler.js should pass jshint.'); + assert.ok(true, 'ember-runtime/mixins/action_handler.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/array.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/mixins/array.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/array.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/array.js should pass jscs.'); - }); -}); -enifed('ember-runtime/mixins/array.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/array.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/array.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/array.js should pass jshint.'); + assert.ok(true, 'ember-runtime/mixins/array.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/comparable.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/mixins/comparable.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/comparable.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/comparable.js should pass jscs.'); - }); -}); -enifed('ember-runtime/mixins/comparable.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/comparable.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/comparable.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/comparable.js should pass jshint.'); - }); -}); -enifed('ember-runtime/mixins/container_proxy.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/container_proxy.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/container_proxy.js should pass jscs.'); + assert.ok(true, 'ember-runtime/mixins/comparable.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/container_proxy.jshint', ['exports'], function (exports) { +enifed('ember-runtime/mixins/container_proxy.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/container_proxy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/container_proxy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/container_proxy.js should pass jshint.'); - }); -}); -enifed('ember-runtime/mixins/controller.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/controller.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/controller.js should pass jscs.'); + assert.ok(true, 'ember-runtime/mixins/container_proxy.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/controller.jshint', ['exports'], function (exports) { +enifed('ember-runtime/mixins/controller.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/controller.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/controller.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/controller.js should pass jshint.'); - }); -}); -enifed('ember-runtime/mixins/controller_content_model_alias_deprecation.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/controller_content_model_alias_deprecation.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/controller_content_model_alias_deprecation.js should pass jscs.'); + assert.ok(true, 'ember-runtime/mixins/controller.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/controller_content_model_alias_deprecation.jshint', ['exports'], function (exports) { +enifed('ember-runtime/mixins/controller_content_model_alias_deprecation.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/controller_content_model_alias_deprecation.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/controller_content_model_alias_deprecation.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/controller_content_model_alias_deprecation.js should pass jshint.'); + assert.ok(true, 'ember-runtime/mixins/controller_content_model_alias_deprecation.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/copyable.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/mixins/copyable.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/copyable.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/copyable.js should pass jscs.'); - }); -}); -enifed('ember-runtime/mixins/copyable.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/copyable.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/copyable.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/copyable.js should pass jshint.'); + assert.ok(true, 'ember-runtime/mixins/copyable.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/enumerable.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/mixins/enumerable.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/enumerable.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/enumerable.js should pass jscs.'); - }); -}); -enifed('ember-runtime/mixins/enumerable.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/enumerable.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/enumerable.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/enumerable.js should pass jshint.'); + assert.ok(true, 'ember-runtime/mixins/enumerable.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/evented.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/mixins/evented.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/evented.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/evented.js should pass jscs.'); - }); -}); -enifed('ember-runtime/mixins/evented.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/evented.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/evented.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/evented.js should pass jshint.'); - }); -}); -enifed('ember-runtime/mixins/freezable.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/freezable.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/freezable.js should pass jscs.'); + assert.ok(true, 'ember-runtime/mixins/evented.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/freezable.jshint', ['exports'], function (exports) { +enifed('ember-runtime/mixins/freezable.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/freezable.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/freezable.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/freezable.js should pass jshint.'); - }); -}); -enifed('ember-runtime/mixins/mutable_array.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/mutable_array.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/mutable_array.js should pass jscs.'); + assert.ok(true, 'ember-runtime/mixins/freezable.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/mutable_array.jshint', ['exports'], function (exports) { +enifed('ember-runtime/mixins/mutable_array.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/mutable_array.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/mutable_array.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/mutable_array.js should pass jshint.'); + assert.ok(true, 'ember-runtime/mixins/mutable_array.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/mutable_enumerable.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/mixins/mutable_enumerable.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/mutable_enumerable.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/mutable_enumerable.js should pass jscs.'); - }); -}); -enifed('ember-runtime/mixins/mutable_enumerable.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/mutable_enumerable.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/mutable_enumerable.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/mutable_enumerable.js should pass jshint.'); - }); -}); -enifed('ember-runtime/mixins/observable.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/observable.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/observable.js should pass jscs.'); + assert.ok(true, 'ember-runtime/mixins/mutable_enumerable.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/observable.jshint', ['exports'], function (exports) { +enifed('ember-runtime/mixins/observable.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/observable.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/observable.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/observable.js should pass jshint.'); + assert.ok(true, 'ember-runtime/mixins/observable.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/promise_proxy.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/mixins/promise_proxy.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/promise_proxy.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/promise_proxy.js should pass jscs.'); - }); -}); -enifed('ember-runtime/mixins/promise_proxy.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/promise_proxy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/promise_proxy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/promise_proxy.js should pass jshint.'); - }); -}); -enifed('ember-runtime/mixins/registry_proxy.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/registry_proxy.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/registry_proxy.js should pass jscs.'); + assert.ok(true, 'ember-runtime/mixins/promise_proxy.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/registry_proxy.jshint', ['exports'], function (exports) { +enifed('ember-runtime/mixins/registry_proxy.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/registry_proxy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/registry_proxy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/registry_proxy.js should pass jshint.'); - }); -}); -enifed('ember-runtime/mixins/target_action_support.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/mixins'); - test('ember-runtime/mixins/target_action_support.js should pass jscs', function () { - ok(true, 'ember-runtime/mixins/target_action_support.js should pass jscs.'); + assert.ok(true, 'ember-runtime/mixins/registry_proxy.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/mixins/target_action_support.jshint', ['exports'], function (exports) { +enifed('ember-runtime/mixins/target_action_support.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/mixins'); - QUnit.test('ember-runtime/mixins/target_action_support.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/mixins/target_action_support.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/mixins/target_action_support.js should pass jshint.'); - }); -}); -enifed('ember-runtime/string_registry.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime'); - test('ember-runtime/string_registry.js should pass jscs', function () { - ok(true, 'ember-runtime/string_registry.js should pass jscs.'); + assert.ok(true, 'ember-runtime/mixins/target_action_support.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/string_registry.jshint', ['exports'], function (exports) { +enifed('ember-runtime/string_registry.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime'); - QUnit.test('ember-runtime/string_registry.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/string_registry.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/string_registry.js should pass jshint.'); + assert.ok(true, 'ember-runtime/string_registry.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/system/application.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/system/application.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/system'); - test('ember-runtime/system/application.js should pass jscs', function () { - ok(true, 'ember-runtime/system/application.js should pass jscs.'); - }); -}); -enifed('ember-runtime/system/application.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/system'); - QUnit.test('ember-runtime/system/application.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/system/application.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/system/application.js should pass jshint.'); + assert.ok(true, 'ember-runtime/system/application.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/system/array_proxy.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/system/array_proxy.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/system'); - test('ember-runtime/system/array_proxy.js should pass jscs', function () { - ok(true, 'ember-runtime/system/array_proxy.js should pass jscs.'); - }); -}); -enifed('ember-runtime/system/array_proxy.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/system'); - QUnit.test('ember-runtime/system/array_proxy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/system/array_proxy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/system/array_proxy.js should pass jshint.'); + assert.ok(true, 'ember-runtime/system/array_proxy.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/system/core_object.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/system/core_object.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/system'); - test('ember-runtime/system/core_object.js should pass jscs', function () { - ok(true, 'ember-runtime/system/core_object.js should pass jscs.'); - }); -}); -enifed('ember-runtime/system/core_object.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/system'); - QUnit.test('ember-runtime/system/core_object.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/system/core_object.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/system/core_object.js should pass jshint.'); + assert.ok(true, 'ember-runtime/system/core_object.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/system/each_proxy.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/system/each_proxy.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/system'); - test('ember-runtime/system/each_proxy.js should pass jscs', function () { - ok(true, 'ember-runtime/system/each_proxy.js should pass jscs.'); - }); -}); -enifed('ember-runtime/system/each_proxy.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/system'); - QUnit.test('ember-runtime/system/each_proxy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/system/each_proxy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/system/each_proxy.js should pass jshint.'); - }); -}); -enifed('ember-runtime/system/lazy_load.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/system'); - test('ember-runtime/system/lazy_load.js should pass jscs', function () { - ok(true, 'ember-runtime/system/lazy_load.js should pass jscs.'); + assert.ok(true, 'ember-runtime/system/each_proxy.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/system/lazy_load.jshint', ['exports'], function (exports) { +enifed('ember-runtime/system/lazy_load.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/system'); - QUnit.test('ember-runtime/system/lazy_load.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/system/lazy_load.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/system/lazy_load.js should pass jshint.'); + assert.ok(true, 'ember-runtime/system/lazy_load.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/system/namespace.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/system/namespace.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/system'); - test('ember-runtime/system/namespace.js should pass jscs', function () { - ok(true, 'ember-runtime/system/namespace.js should pass jscs.'); - }); -}); -enifed('ember-runtime/system/namespace.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/system'); - QUnit.test('ember-runtime/system/namespace.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/system/namespace.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/system/namespace.js should pass jshint.'); + assert.ok(true, 'ember-runtime/system/namespace.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/system/native_array.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/system/native_array.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/system'); - test('ember-runtime/system/native_array.js should pass jscs', function () { - ok(true, 'ember-runtime/system/native_array.js should pass jscs.'); - }); -}); -enifed('ember-runtime/system/native_array.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/system'); - QUnit.test('ember-runtime/system/native_array.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/system/native_array.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/system/native_array.js should pass jshint.'); - }); -}); -enifed('ember-runtime/system/object.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/system'); - test('ember-runtime/system/object.js should pass jscs', function () { - ok(true, 'ember-runtime/system/object.js should pass jscs.'); + assert.ok(true, 'ember-runtime/system/native_array.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/system/object.jshint', ['exports'], function (exports) { +enifed('ember-runtime/system/object.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/system'); - QUnit.test('ember-runtime/system/object.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/system/object.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/system/object.js should pass jshint.'); - }); -}); -enifed('ember-runtime/system/object_proxy.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/system'); - test('ember-runtime/system/object_proxy.js should pass jscs', function () { - ok(true, 'ember-runtime/system/object_proxy.js should pass jscs.'); + assert.ok(true, 'ember-runtime/system/object.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/system/object_proxy.jshint', ['exports'], function (exports) { +enifed('ember-runtime/system/object_proxy.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/system'); - QUnit.test('ember-runtime/system/object_proxy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/system/object_proxy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/system/object_proxy.js should pass jshint.'); + assert.ok(true, 'ember-runtime/system/object_proxy.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/system/service.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/system/service.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/system'); - test('ember-runtime/system/service.js should pass jscs', function () { - ok(true, 'ember-runtime/system/service.js should pass jscs.'); - }); -}); -enifed('ember-runtime/system/service.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/system'); - QUnit.test('ember-runtime/system/service.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/system/service.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/system/service.js should pass jshint.'); - }); -}); -enifed('ember-runtime/system/string.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/system'); - test('ember-runtime/system/string.js should pass jscs', function () { - ok(true, 'ember-runtime/system/string.js should pass jscs.'); + assert.ok(true, 'ember-runtime/system/service.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/system/string.jshint', ['exports'], function (exports) { +enifed('ember-runtime/system/string.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/system'); - QUnit.test('ember-runtime/system/string.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/system/string.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/system/string.js should pass jshint.'); + assert.ok(true, 'ember-runtime/system/string.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/computed/computed_macros_test', ['exports', 'ember-metal', 'ember-runtime/computed/computed_macros', 'internal-test-helpers', 'ember-runtime/system/object', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeComputedComputed_macros, _internalTestHelpers, _emberRuntimeSystemObject, _emberRuntimeSystemNative_array) { @@ -51625,21 +49838,13 @@ enifed('ember-runtime/tests/computed/computed_macros_test', ['exports', 'ember-m equal(get(obj, 'quz'), null); }); }); -enifed('ember-runtime/tests/computed/computed_macros_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/computed/computed_macros_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/computed'); - test('ember-runtime/tests/computed/computed_macros_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/computed/computed_macros_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/computed/computed_macros_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/computed'); - QUnit.test('ember-runtime/tests/computed/computed_macros_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/computed/computed_macros_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/computed/computed_macros_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/computed/computed_macros_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/computed/reduce_computed_macros_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object', 'ember-runtime/system/object_proxy', 'ember-runtime/computed/reduce_computed_macros', 'ember-runtime/utils', 'ember-runtime/system/native_array', 'ember-runtime/mixins/mutable_array'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject, _emberRuntimeSystemObject_proxy, _emberRuntimeComputedReduce_computed_macros, _emberRuntimeUtils, _emberRuntimeSystemNative_array, _emberRuntimeMixinsMutable_array) { @@ -52111,63 +50316,61 @@ enifed('ember-runtime/tests/computed/reduce_computed_macros_test', ['exports', ' }); }); - if (true) { - QUnit.module('computed.uniqBy', { - setup: function () { - obj = _emberRuntimeSystemObject.default.extend({ - list: null, - uniqueById: _emberRuntimeComputedReduce_computed_macros.uniqBy('list', 'id') - }).create({ - list: _emberRuntimeSystemNative_array.A([{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 1, value: 'one' }]) - }); - }, - teardown: function () { - _emberMetal.run(obj, 'destroy'); - } - }); - - QUnit.test('uniqBy is readOnly', function () { - QUnit.throws(function () { - obj.set('uniqueById', 1); - }, /Cannot set read-only property "uniqueById" on object:/); - }); - QUnit.test('does not include duplicates', function () { - deepEqual(obj.get('uniqueById'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }]); - }); - - QUnit.test('it does not share state among instances', function () { - var MyObject = _emberRuntimeSystemObject.default.extend({ - list: [], - uniqueByName: _emberRuntimeComputedReduce_computed_macros.uniqBy('list', 'name') + QUnit.module('computed.uniqBy', { + setup: function () { + obj = _emberRuntimeSystemObject.default.extend({ + list: null, + uniqueById: _emberRuntimeComputedReduce_computed_macros.uniqBy('list', 'id') + }).create({ + list: _emberRuntimeSystemNative_array.A([{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 1, value: 'one' }]) }); - var a = MyObject.create({ list: [{ name: 'bob' }, { name: 'mitch' }, { name: 'mitch' }] }); - var b = MyObject.create({ list: [{ name: 'warren' }, { name: 'mitch' }] }); + }, + teardown: function () { + _emberMetal.run(obj, 'destroy'); + } + }); + + QUnit.test('uniqBy is readOnly', function () { + QUnit.throws(function () { + obj.set('uniqueById', 1); + }, /Cannot set read-only property "uniqueById" on object:/); + }); + QUnit.test('does not include duplicates', function () { + deepEqual(obj.get('uniqueById'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }]); + }); - deepEqual(a.get('uniqueByName'), [{ name: 'bob' }, { name: 'mitch' }]); - // Making sure that 'mitch' appears - deepEqual(b.get('uniqueByName'), [{ name: 'warren' }, { name: 'mitch' }]); + QUnit.test('it does not share state among instances', function () { + var MyObject = _emberRuntimeSystemObject.default.extend({ + list: [], + uniqueByName: _emberRuntimeComputedReduce_computed_macros.uniqBy('list', 'name') }); + var a = MyObject.create({ list: [{ name: 'bob' }, { name: 'mitch' }, { name: 'mitch' }] }); + var b = MyObject.create({ list: [{ name: 'warren' }, { name: 'mitch' }] }); - QUnit.test('it handles changes to the dependent array', function () { - obj.get('list').pushObject({ id: 3, value: 'three' }); + deepEqual(a.get('uniqueByName'), [{ name: 'bob' }, { name: 'mitch' }]); + // Making sure that 'mitch' appears + deepEqual(b.get('uniqueByName'), [{ name: 'warren' }, { name: 'mitch' }]); + }); - deepEqual(obj.get('uniqueById'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 3, value: 'three' }], 'The list includes three'); + QUnit.test('it handles changes to the dependent array', function () { + obj.get('list').pushObject({ id: 3, value: 'three' }); - obj.get('list').pushObject({ id: 3, value: 'three' }); + deepEqual(obj.get('uniqueById'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 3, value: 'three' }], 'The list includes three'); - deepEqual(obj.get('uniqueById'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 3, value: 'three' }], 'The list does not include a duplicate three'); - }); + obj.get('list').pushObject({ id: 3, value: 'three' }); - QUnit.test('it returns an empty array when computed on a non-array', function () { - var MyObject = _emberRuntimeSystemObject.default.extend({ - list: null, - uniq: _emberRuntimeComputedReduce_computed_macros.uniqBy('list', 'name') - }); - var a = MyObject.create({ list: 'not an array' }); + deepEqual(obj.get('uniqueById'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 3, value: 'three' }], 'The list does not include a duplicate three'); + }); - deepEqual(a.get('uniq'), []); + QUnit.test('it returns an empty array when computed on a non-array', function () { + var MyObject = _emberRuntimeSystemObject.default.extend({ + list: null, + uniq: _emberRuntimeComputedReduce_computed_macros.uniqBy('list', 'name') }); - } + var a = MyObject.create({ list: 'not an array' }); + + deepEqual(a.get('uniq'), []); + }); QUnit.module('computed.intersect', { setup: function () { @@ -53105,21 +51308,13 @@ enifed('ember-runtime/tests/computed/reduce_computed_macros_test', ['exports', ' deepEqual(get(obj, 'all'), [0, 'bar', a, true], 'have all of them'); }); }); -enifed('ember-runtime/tests/computed/reduce_computed_macros_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/computed/reduce_computed_macros_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/computed'); - test('ember-runtime/tests/computed/reduce_computed_macros_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/computed/reduce_computed_macros_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/computed/reduce_computed_macros_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/computed'); - QUnit.test('ember-runtime/tests/computed/reduce_computed_macros_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/computed/reduce_computed_macros_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/computed/reduce_computed_macros_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/computed/reduce_computed_macros_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/controllers/controller_test', ['exports', 'ember-runtime/controllers/controller', 'ember-runtime/system/service', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/inject', 'internal-test-helpers'], function (exports, _emberRuntimeControllersController, _emberRuntimeSystemService, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeInject, _internalTestHelpers) { @@ -53247,10 +51442,9 @@ enifed('ember-runtime/tests/controllers/controller_test', ['exports', 'ember-run QUnit.test('specifying `content` (without `model` specified) results in deprecation', function () { expect(1); - var controller = undefined; expectDeprecation(function () { - controller = _emberRuntimeControllersController.default.extend({ + _emberRuntimeControllersController.default.extend({ content: 'foo-bar' }).create(); }, 'Do not specify `content` on a Controller, use `model` instead.'); @@ -53282,7 +51476,13 @@ enifed('ember-runtime/tests/controllers/controller_test', ['exports', 'ember-run owner.register('foo:main', AnObject); - owner._lookupFactory('foo:main'); + if (true) { + expectDeprecation(function () { + owner._lookupFactory('foo:main'); + }, /Using "_lookupFactory" is deprecated. Please use container.factoryFor instead./); + } else { + owner._lookupFactory('foo:main'); + } }, /Defining an injected controller property on a non-controller is not allowed./); }); } @@ -53317,21 +51517,13 @@ enifed('ember-runtime/tests/controllers/controller_test', ['exports', 'ember-run equal(authService, appController.get('authService'), 'service.auth is injected'); }); }); -enifed('ember-runtime/tests/controllers/controller_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/controllers/controller_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/controllers'); - test('ember-runtime/tests/controllers/controller_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/controllers/controller_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/controllers/controller_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/controllers'); - QUnit.test('ember-runtime/tests/controllers/controller_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/controllers/controller_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/controllers/controller_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/controllers/controller_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/core/compare_test', ['exports', 'ember-runtime/utils', 'ember-runtime/system/object', 'ember-runtime/compare', 'ember-runtime/mixins/comparable'], function (exports, _emberRuntimeUtils, _emberRuntimeSystemObject, _emberRuntimeCompare, _emberRuntimeMixinsComparable) { @@ -53413,21 +51605,13 @@ enifed('ember-runtime/tests/core/compare_test', ['exports', 'ember-runtime/utils equal(_emberRuntimeCompare.default('c', one), -1, 'Second item comparable - returns 1 (negated)'); }); }); -enifed('ember-runtime/tests/core/compare_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/core'); - test('ember-runtime/tests/core/compare_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/core/compare_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/core/compare_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/core/compare_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/core'); - QUnit.test('ember-runtime/tests/core/compare_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/core/compare_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/core/compare_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/core/compare_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/core/copy_test', ['exports', 'ember-runtime/copy'], function (exports, _emberRuntimeCopy) { @@ -53463,21 +51647,13 @@ enifed('ember-runtime/tests/core/copy_test', ['exports', 'ember-runtime/copy'], deepEqual(array, arrayCopy, 'array content cloned successfully in new array'); }); }); -enifed('ember-runtime/tests/core/copy_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/core/copy_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/core'); - test('ember-runtime/tests/core/copy_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/core/copy_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/core/copy_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/core'); - QUnit.test('ember-runtime/tests/core/copy_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/core/copy_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/core/copy_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/core/copy_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/core/isEqual_test', ['exports', 'ember-runtime/is-equal'], function (exports, _emberRuntimeIsEqual) { @@ -53524,21 +51700,13 @@ enifed('ember-runtime/tests/core/isEqual_test', ['exports', 'ember-runtime/is-eq equal(_emberRuntimeIsEqual.default(obj, obj), false, 'should return false because isEqual returns false'); }); }); -enifed('ember-runtime/tests/core/isEqual_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/core'); - test('ember-runtime/tests/core/isEqual_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/core/isEqual_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/core/isEqual_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/core/isEqual_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/core'); - QUnit.test('ember-runtime/tests/core/isEqual_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/core/isEqual_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/core/isEqual_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/core/isEqual_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/core/is_array_test', ['exports', 'ember-runtime/utils', 'ember-runtime/system/native_array', 'ember-runtime/system/array_proxy', 'ember-environment'], function (exports, _emberRuntimeUtils, _emberRuntimeSystemNative_array, _emberRuntimeSystemArray_proxy, _emberEnvironment) { @@ -53578,21 +51746,13 @@ enifed('ember-runtime/tests/core/is_array_test', ['exports', 'ember-runtime/util }); } }); -enifed('ember-runtime/tests/core/is_array_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/core/is_array_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/core'); - test('ember-runtime/tests/core/is_array_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/core/is_array_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/core/is_array_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/core'); - QUnit.test('ember-runtime/tests/core/is_array_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/core/is_array_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/core/is_array_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/core/is_array_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/core/is_empty_test', ['exports', 'ember-metal', 'ember-runtime/system/array_proxy', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemNative_array) { @@ -53606,21 +51766,13 @@ enifed('ember-runtime/tests/core/is_empty_test', ['exports', 'ember-metal', 'emb equal(true, _emberMetal.isEmpty(arrayProxy), 'for an ArrayProxy that has empty content'); }); }); -enifed('ember-runtime/tests/core/is_empty_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/core/is_empty_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/core'); - test('ember-runtime/tests/core/is_empty_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/core/is_empty_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/core/is_empty_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/core'); - QUnit.test('ember-runtime/tests/core/is_empty_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/core/is_empty_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/core/is_empty_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/core/is_empty_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/core/type_of_test', ['exports', 'ember-runtime/utils', 'ember-runtime/system/object', 'ember-environment'], function (exports, _emberRuntimeUtils, _emberRuntimeSystemObject, _emberEnvironment) { @@ -53671,21 +51823,13 @@ enifed('ember-runtime/tests/core/type_of_test', ['exports', 'ember-runtime/utils }); } }); -enifed('ember-runtime/tests/core/type_of_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/core/type_of_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/core'); - test('ember-runtime/tests/core/type_of_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/core/type_of_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/core/type_of_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/core'); - QUnit.test('ember-runtime/tests/core/type_of_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/core/type_of_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/core/type_of_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/core/type_of_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/ext/function_test', ['exports', 'ember-environment', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object', 'ember-runtime/mixins/evented'], function (exports, _emberEnvironment, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject, _emberRuntimeMixinsEvented) { @@ -53792,21 +51936,13 @@ enifed('ember-runtime/tests/ext/function_test', ['exports', 'ember-environment', equal(get(obj, 'fullName'), 'Wilma ', 'should return the new computed value'); }); }); -enifed('ember-runtime/tests/ext/function_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/ext'); - test('ember-runtime/tests/ext/function_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/ext/function_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/ext/function_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/ext/function_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/ext'); - QUnit.test('ember-runtime/tests/ext/function_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/ext/function_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/ext/function_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/ext/function_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/ext/mixin_test', ['exports', 'ember-metal'], function (exports, _emberMetal) { @@ -53859,21 +51995,13 @@ enifed('ember-runtime/tests/ext/mixin_test', ['exports', 'ember-metal'], functio equal(_emberMetal.get(obj2, 'foo'), 'BARG', 'binding should be created and synced'); }); }); -enifed('ember-runtime/tests/ext/mixin_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/ext/mixin_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/ext'); - test('ember-runtime/tests/ext/mixin_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/ext/mixin_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/ext/mixin_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/ext'); - QUnit.test('ember-runtime/tests/ext/mixin_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/ext/mixin_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/ext/mixin_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/ext/mixin_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/ext/rsvp_test', ['exports', 'ember-metal', 'ember-runtime/ext/rsvp'], function (exports, _emberMetal, _emberRuntimeExtRsvp) { @@ -54138,21 +52266,13 @@ enifed('ember-runtime/tests/ext/rsvp_test', ['exports', 'ember-metal', 'ember-ru }, reason); }); }); -enifed('ember-runtime/tests/ext/rsvp_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/ext'); - test('ember-runtime/tests/ext/rsvp_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/ext/rsvp_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/ext/rsvp_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/ext/rsvp_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/ext'); - QUnit.test('ember-runtime/tests/ext/rsvp_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/ext/rsvp_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/ext/rsvp_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/ext/rsvp_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/inject_test', ['exports', 'ember-metal', 'ember-runtime/inject', 'ember-runtime/system/object', 'internal-test-helpers'], function (exports, _emberMetal, _emberRuntimeInject, _emberRuntimeSystemObject, _internalTestHelpers) { @@ -54172,8 +52292,6 @@ enifed('ember-runtime/tests/inject_test', ['exports', 'ember-metal', 'ember-runt // this check is done via an assertion which is stripped from // production builds QUnit.test('injection type validation is run when first looked up', function () { - expect(1); - _emberRuntimeInject.createInjectionHelper('foo', function () { ok(true, 'should call validation method'); }); @@ -54186,7 +52304,16 @@ enifed('ember-runtime/tests/inject_test', ['exports', 'ember-metal', 'ember-runt }); owner.register('foo:main', AnObject); - owner._lookupFactory('foo:main'); + + if (true) { + expect(2); + expectDeprecation(function () { + owner._lookupFactory('foo:main'); + }, /Using "_lookupFactory" is deprecated. Please use container.factoryFor instead./); + } else { + expect(1); + owner._lookupFactory('foo:main'); + } }); QUnit.test('attempting to inject a nonexistent container key should error', function () { @@ -54212,21 +52339,13 @@ enifed('ember-runtime/tests/inject_test', ['exports', 'ember-metal', 'ember-runt deepEqual(AnObject._lazyInjections(), { 'foo': 'foo:bar', 'bar': 'quux:bar' }, 'should return injected container keys'); }); }); -enifed('ember-runtime/tests/inject_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests'); - test('ember-runtime/tests/inject_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/inject_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/inject_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/inject_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests'); - QUnit.test('ember-runtime/tests/inject_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/inject_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/inject_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/inject_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/legacy_1x/mixins/observable/chained_test', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeSystemNative_array) { @@ -54289,21 +52408,13 @@ enifed('ember-runtime/tests/legacy_1x/mixins/observable/chained_test', ['exports equal(observerFiredCount, 0, 'observer did not fire after removing changing property on a removed object'); }); }); -enifed('ember-runtime/tests/legacy_1x/mixins/observable/chained_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/legacy_1x/mixins/observable/chained_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/legacy_1x/mixins/observable'); - test('ember-runtime/tests/legacy_1x/mixins/observable/chained_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/chained_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/legacy_1x/mixins/observable/chained_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/legacy_1x/mixins/observable'); - QUnit.test('ember-runtime/tests/legacy_1x/mixins/observable/chained_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/legacy_1x/mixins/observable/chained_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/chained_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/chained_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/legacy_1x/mixins/observable/observable_test', ['exports', 'ember-environment', 'ember-metal', 'ember-runtime/system/string', 'ember-runtime/system/object', 'ember-runtime/mixins/observable', 'ember-runtime/system/native_array'], function (exports, _emberEnvironment, _emberMetal, _emberRuntimeSystemString, _emberRuntimeSystemObject, _emberRuntimeMixinsObservable, _emberRuntimeSystemNative_array) { @@ -55206,21 +53317,13 @@ enifed('ember-runtime/tests/legacy_1x/mixins/observable/observable_test', ['expo expect(1); }); }); -enifed('ember-runtime/tests/legacy_1x/mixins/observable/observable_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/legacy_1x/mixins/observable/observable_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/legacy_1x/mixins/observable'); - test('ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/legacy_1x/mixins/observable/observable_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/legacy_1x/mixins/observable'); - QUnit.test('ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/mixins/observable'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeMixinsObservable) { @@ -55266,21 +53369,13 @@ enifed('ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test', [ equal(observers[1][0], o3, 'second item in observers array should be o3'); }); }); -enifed('ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/legacy_1x/mixins/observable'); - test('ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/legacy_1x/mixins/observable'); - QUnit.test('ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/observersForKey_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test', ['exports', 'ember-runtime/system/object', 'ember-runtime/mixins/observable', 'ember-metal'], function (exports, _emberRuntimeSystemObject, _emberRuntimeMixinsObservable, _emberMetal) { @@ -55307,7 +53402,6 @@ enifed('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test', [ var ObservableObject = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsObservable.default); - var revMatches = false; var ObjectA = undefined; QUnit.module('object.propertyChanges', { @@ -55325,7 +53419,6 @@ enifed('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test', [ }), starObserver: function (target, key, value, rev) { - revMatches = rev === target.propertyRevision; this.starProp = key; } }).create({ @@ -55423,21 +53516,13 @@ enifed('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test', [ equal(a.get('b'), 'foo', 'should have invalidated the cache so that the newly set value is actually set'); }); }); -enifed('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/legacy_1x/mixins/observable'); - test('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/legacy_1x/mixins/observable'); - QUnit.test('ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/legacy_1x/system/binding_test', ['exports', 'ember-environment', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberEnvironment, _emberMetal, _emberRuntimeSystemObject) { @@ -55572,9 +53657,7 @@ enifed('ember-runtime/tests/legacy_1x/system/binding_test', ['exports', 'ember-e var first = undefined, second = undefined, - third = undefined, - binding1 = undefined, - binding2 = undefined; // global variables + third = undefined; // global variables // .......................................................... // chained binding @@ -55600,11 +53683,11 @@ enifed('ember-runtime/tests/legacy_1x/system/binding_test', ['exports', 'ember-e root = { first: first, second: second, third: third }; expectDeprecation(function () { - binding1 = _emberMetal.bind(root, 'second.input', 'first.output'); + _emberMetal.bind(root, 'second.input', 'first.output'); }, /`Ember\.Binding` is deprecated./); expectDeprecation(function () { - binding2 = _emberMetal.bind(root, 'second.output', 'third.input'); + _emberMetal.bind(root, 'second.output', 'third.input'); }, /`Ember\.Binding` is deprecated./); }); }, @@ -55750,21 +53833,13 @@ enifed('ember-runtime/tests/legacy_1x/system/binding_test', ['exports', 'ember-e equal(_emberMetal.get(TestNamespace.toObject, 'relative'), 'newerValue'); }); }); -enifed('ember-runtime/tests/legacy_1x/system/binding_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/legacy_1x/system'); - test('ember-runtime/tests/legacy_1x/system/binding_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/legacy_1x/system/binding_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/legacy_1x/system/binding_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/legacy_1x/system/binding_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/legacy_1x/system'); - QUnit.test('ember-runtime/tests/legacy_1x/system/binding_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/legacy_1x/system/binding_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/legacy_1x/system/binding_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/legacy_1x/system/binding_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/legacy_1x/system/object/base_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { @@ -55793,8 +53868,7 @@ enifed('ember-runtime/tests/legacy_1x/system/object/base_test', ['exports', 'emb // ======================================================================== var obj = undefined, - obj1 = undefined, - don = undefined; // global variables + obj1 = undefined; // global variables QUnit.module('A new EmberObject instance', { @@ -55845,17 +53919,11 @@ enifed('ember-runtime/tests/legacy_1x/system/object/base_test', ['exports', 'emb } }); obj1 = obj.extend(); - don = obj1.create({ - method2: function () { - return this.superclass(); - } - }); }, teardown: function () { obj = undefined; obj1 = undefined; - don = undefined; } }); @@ -55869,21 +53937,13 @@ enifed('ember-runtime/tests/legacy_1x/system/object/base_test', ['exports', 'emb ok(obj.detectInstance(obj.create())); }); }); -enifed('ember-runtime/tests/legacy_1x/system/object/base_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/legacy_1x/system/object/base_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/legacy_1x/system/object'); - test('ember-runtime/tests/legacy_1x/system/object/base_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/legacy_1x/system/object/base_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/legacy_1x/system/object/base_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/legacy_1x/system/object'); - QUnit.test('ember-runtime/tests/legacy_1x/system/object/base_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/legacy_1x/system/object/base_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/legacy_1x/system/object/base_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/legacy_1x/system/object/base_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test', ['exports', 'ember-environment', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberEnvironment, _emberMetal, _emberRuntimeSystemObject) { @@ -55909,7 +53969,6 @@ enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test', ['exports', var originalLookup = _emberEnvironment.context.lookup; var testObject = undefined, fromObject = undefined, - extraObject = undefined, TestObject = undefined; var TestNamespace = undefined, lookup = undefined; @@ -55929,10 +53988,6 @@ enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test', ['exports', extraObject: null }); - extraObject = _emberRuntimeSystemObject.default.create({ - foo: 'extraObjectValue' - }); - lookup['TestNamespace'] = TestNamespace = { fromObject: fromObject, testObject: testObject @@ -55940,7 +53995,7 @@ enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test', ['exports', }, teardown: function () { - testObject = fromObject = extraObject = null; + testObject = fromObject = null; _emberEnvironment.context.lookup = originalLookup; } }); @@ -55988,10 +54043,6 @@ enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test', ['exports', extraObject: null }); - extraObject = _emberRuntimeSystemObject.default.create({ - foo: 'extraObjectValue' - }); - lookup['TestNamespace'] = TestNamespace = { fromObject: fromObject, testObject: TestObject @@ -56000,7 +54051,7 @@ enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test', ['exports', teardown: function () { _emberEnvironment.context.lookup = originalLookup; - TestObject = fromObject = extraObject = null; + TestObject = fromObject = null; // delete TestNamespace; } }); @@ -56064,21 +54115,13 @@ enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test', ['exports', ok(_emberMetal.get(testObject, 'foo') !== 'bar', 'binding should not have synced'); }); }); -enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/legacy_1x/system/object'); - test('ember-runtime/tests/legacy_1x/system/object/bindings_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/legacy_1x/system/object/bindings_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/legacy_1x/system/object/bindings_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/legacy_1x/system/object'); - QUnit.test('ember-runtime/tests/legacy_1x/system/object/bindings_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/legacy_1x/system/object/bindings_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/legacy_1x/system/object/bindings_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/legacy_1x/system/object/bindings_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/legacy_1x/system/object/concatenated_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { @@ -56185,21 +54228,13 @@ enifed('ember-runtime/tests/legacy_1x/system/object/concatenated_test', ['export deepEqual(values, expected, 'should concatenate functions property (expected: ' + expected + ', got: ' + values + ')'); }); }); -enifed('ember-runtime/tests/legacy_1x/system/object/concatenated_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/legacy_1x/system/object/concatenated_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/legacy_1x/system/object'); - test('ember-runtime/tests/legacy_1x/system/object/concatenated_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/legacy_1x/system/object/concatenated_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/legacy_1x/system/object/concatenated_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/legacy_1x/system/object'); - QUnit.test('ember-runtime/tests/legacy_1x/system/object/concatenated_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/legacy_1x/system/object/concatenated_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/legacy_1x/system/object/concatenated_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/legacy_1x/system/object/concatenated_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/legacy_1x/system/run_loop_test', ['exports', 'ember-metal', 'ember-runtime/mixins/observable', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeMixinsObservable, _emberRuntimeSystemObject) { @@ -56219,9 +54254,7 @@ enifed('ember-runtime/tests/legacy_1x/system/run_loop_test', ['exports', 'ember- broken anyway. I don't think it ever even worked. */ - var MyApp = undefined, - binding1 = undefined, - binding2 = undefined; + var MyApp = undefined; QUnit.module('System:run_loop() - chained binding', { setup: function () { @@ -56251,12 +54284,12 @@ enifed('ember-runtime/tests/legacy_1x/system/run_loop_test', ['exports', 'ember- _emberMetal.run(function () { //Binding of output of MyApp.first object to input of MyApp.second object expectDeprecation(function () { - binding1 = _emberMetal.Binding.from('first.output').to('second.input').connect(MyApp); + _emberMetal.Binding.from('first.output').to('second.input').connect(MyApp); }, deprecationMessage); //Binding of output of MyApp.second object to input of MyApp.third object expectDeprecation(function () { - binding2 = _emberMetal.Binding.from('second.output').to('third.input').connect(MyApp); + _emberMetal.Binding.from('second.output').to('third.input').connect(MyApp); }, deprecationMessage); }); @@ -56284,12 +54317,12 @@ enifed('ember-runtime/tests/legacy_1x/system/run_loop_test', ['exports', 'ember- _emberMetal.run(function () { //Binding of output of MyApp.first object to input of MyApp.second object expectDeprecation(function () { - binding1 = _emberMetal.Binding.from('first.output').to('second.input').connect(MyApp); + _emberMetal.Binding.from('first.output').to('second.input').connect(MyApp); }, deprecationMessage); //Binding of output of MyApp.second object to input of MyApp.third object expectDeprecation(function () { - binding2 = _emberMetal.Binding.from('second.output').to('third.input').connect(MyApp); + _emberMetal.Binding.from('second.output').to('third.input').connect(MyApp); }, deprecationMessage); }); @@ -56312,21 +54345,13 @@ enifed('ember-runtime/tests/legacy_1x/system/run_loop_test', ['exports', 'ember- equal(MyApp.second.get('output'), 'change'); }); }); -enifed('ember-runtime/tests/legacy_1x/system/run_loop_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/legacy_1x/system/run_loop_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/legacy_1x/system'); - test('ember-runtime/tests/legacy_1x/system/run_loop_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/legacy_1x/system/run_loop_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/legacy_1x/system/run_loop_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/legacy_1x/system'); - QUnit.test('ember-runtime/tests/legacy_1x/system/run_loop_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/legacy_1x/system/run_loop_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/legacy_1x/system/run_loop_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/legacy_1x/system/run_loop_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/main_test', ['exports', 'ember-runtime/index'], function (exports, _emberRuntimeIndex) { @@ -56350,21 +54375,13 @@ enifed('ember-runtime/tests/main_test', ['exports', 'ember-runtime/index'], func deepEqual(propsValue, [3, 5, 'asdf']); }); }); -enifed('ember-runtime/tests/main_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests'); - test('ember-runtime/tests/main_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/main_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/main_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/main_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests'); - QUnit.test('ember-runtime/tests/main_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/main_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/main_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/main_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/mixins/array_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/tests/suites/array', 'ember-runtime/system/object', 'ember-runtime/mixins/array', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeTestsSuitesArray, _emberRuntimeSystemObject, _emberRuntimeMixinsArray, _emberRuntimeSystemNative_array) { @@ -56805,21 +54822,13 @@ enifed('ember-runtime/tests/mixins/array_test', ['exports', 'ember-metal', 'inte equal(count, 2, 'observers should only be called once'); }); }); -enifed('ember-runtime/tests/mixins/array_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/mixins'); - test('ember-runtime/tests/mixins/array_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/mixins/array_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/mixins/array_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/mixins/array_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/mixins'); - QUnit.test('ember-runtime/tests/mixins/array_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/mixins/array_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/mixins/array_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/mixins/array_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/mixins/comparable_test', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/compare', 'ember-runtime/mixins/comparable'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeCompare, _emberRuntimeMixinsComparable) { @@ -56856,21 +54865,13 @@ enifed('ember-runtime/tests/mixins/comparable_test', ['exports', 'ember-metal', equal(_emberRuntimeCompare.default(r2, r1), 1); }); }); -enifed('ember-runtime/tests/mixins/comparable_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/mixins/comparable_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/mixins'); - test('ember-runtime/tests/mixins/comparable_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/mixins/comparable_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/mixins/comparable_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/mixins'); - QUnit.test('ember-runtime/tests/mixins/comparable_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/mixins/comparable_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/mixins/comparable_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/mixins/comparable_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/mixins/container_proxy_test', ['exports', 'ember-utils', 'container', 'ember-runtime/mixins/container_proxy', 'ember-runtime/system/object'], function (exports, _emberUtils, _container, _emberRuntimeMixinsContainer_proxy, _emberRuntimeSystemObject) { @@ -56895,21 +54896,13 @@ enifed('ember-runtime/tests/mixins/container_proxy_test', ['exports', 'ember-uti assert.equal(result[_emberUtils.OWNER], this.instance, 'returns an object with the OWNER symbol'); }); }); -enifed('ember-runtime/tests/mixins/container_proxy_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/mixins/container_proxy_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/mixins'); - test('ember-runtime/tests/mixins/container_proxy_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/mixins/container_proxy_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/mixins/container_proxy_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/mixins'); - QUnit.test('ember-runtime/tests/mixins/container_proxy_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/mixins/container_proxy_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/mixins/container_proxy_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/mixins/container_proxy_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/mixins/copyable_test', ['exports', 'ember-utils', 'ember-runtime/tests/suites/copyable', 'ember-runtime/mixins/copyable', 'ember-runtime/mixins/freezable', 'ember-runtime/system/object', 'ember-metal'], function (exports, _emberUtils, _emberRuntimeTestsSuitesCopyable, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsFreezable, _emberRuntimeSystemObject, _emberMetal) { @@ -56961,21 +54954,13 @@ enifed('ember-runtime/tests/mixins/copyable_test', ['exports', 'ember-utils', 'e } }).run(); }); -enifed('ember-runtime/tests/mixins/copyable_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/mixins'); - test('ember-runtime/tests/mixins/copyable_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/mixins/copyable_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/mixins/copyable_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/mixins/copyable_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/mixins'); - QUnit.test('ember-runtime/tests/mixins/copyable_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/mixins/copyable_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/mixins/copyable_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/mixins/copyable_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/mixins/enumerable_test', ['exports', 'ember-runtime/tests/suites/enumerable', 'ember-runtime/system/object', 'ember-runtime/mixins/enumerable', 'ember-runtime/mixins/array', 'ember-runtime/system/native_array', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesEnumerable, _emberRuntimeSystemObject, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsArray, _emberRuntimeSystemNative_array, _emberMetal) { @@ -57070,17 +55055,12 @@ enifed('ember-runtime/tests/mixins/enumerable_test', ['exports', 'ember-runtime/ var X = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default, { contains: function () { return true; + }, + includes: function () { + return true; } }); - if (true) { - X.reopen({ - includes: function () { - return true; - } - }); - } - var x = X.create(); var y = x.without(K); equal(_emberRuntimeMixinsArray.default.detect(y), true, 'should have mixin applied'); @@ -57152,16 +55132,14 @@ enifed('ember-runtime/tests/mixins/enumerable_test', ['exports', 'ember-runtime/ equal(allWhite, true); }); - if (true) { - QUnit.test('should throw an error passing a second argument to includes', function () { - var x = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default).create(); + QUnit.test('should throw an error passing a second argument to includes', function () { + var x = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsEnumerable.default).create(); - equal(x.includes('any'), false); - expectAssertion(function () { - x.includes('any', 1); - }, /Enumerable#includes cannot accept a second argument "startAt" as enumerable items are unordered./); - }); - } + equal(x.includes('any'), false); + expectAssertion(function () { + x.includes('any', 1); + }, /Enumerable#includes cannot accept a second argument "startAt" as enumerable items are unordered./); + }); // .......................................................... // CONTENT DID CHANGE @@ -57347,21 +55325,13 @@ enifed('ember-runtime/tests/mixins/enumerable_test', ['exports', 'ember-runtime/ deepEqual(observer._after, null); }); }); -enifed('ember-runtime/tests/mixins/enumerable_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/mixins'); - test('ember-runtime/tests/mixins/enumerable_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/mixins/enumerable_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/mixins/enumerable_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/mixins/enumerable_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/mixins'); - QUnit.test('ember-runtime/tests/mixins/enumerable_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/mixins/enumerable_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/mixins/enumerable_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/mixins/enumerable_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/mixins/freezable_test', ['exports', 'ember-runtime/system/object', 'ember-runtime/mixins/freezable'], function (exports, _emberRuntimeSystemObject, _emberRuntimeMixinsFreezable) { @@ -57374,21 +55344,13 @@ enifed('ember-runtime/tests/mixins/freezable_test', ['exports', 'ember-runtime/s _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsFreezable.Freezable).create(); }); }); -enifed('ember-runtime/tests/mixins/freezable_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/mixins/freezable_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/mixins'); - test('ember-runtime/tests/mixins/freezable_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/mixins/freezable_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/mixins/freezable_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/mixins'); - QUnit.test('ember-runtime/tests/mixins/freezable_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/mixins/freezable_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/mixins/freezable_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/mixins/freezable_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/mixins/mutable_array_test', ['exports', 'ember-metal', 'ember-runtime/tests/suites/mutable_array', 'ember-runtime/mixins/mutable_array', 'ember-runtime/system/object', 'ember-runtime/system/native_array', 'ember-runtime/mixins/array'], function (exports, _emberMetal, _emberRuntimeTestsSuitesMutable_array, _emberRuntimeMixinsMutable_array, _emberRuntimeSystemObject, _emberRuntimeSystemNative_array, _emberRuntimeMixinsArray) { @@ -57456,21 +55418,13 @@ enifed('ember-runtime/tests/mixins/mutable_array_test', ['exports', 'ember-metal }).run(); }); -enifed('ember-runtime/tests/mixins/mutable_array_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/mixins'); - test('ember-runtime/tests/mixins/mutable_array_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/mixins/mutable_array_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/mixins/mutable_array_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/mixins/mutable_array_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/mixins'); - QUnit.test('ember-runtime/tests/mixins/mutable_array_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/mixins/mutable_array_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/mixins/mutable_array_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/mixins/mutable_array_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/mixins/mutable_enumerable_test', ['exports', 'ember-runtime/tests/suites/mutable_enumerable', 'ember-runtime/mixins/mutable_enumerable', 'ember-runtime/system/object', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesMutable_enumerable, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeSystemObject, _emberMetal) { @@ -57540,21 +55494,13 @@ enifed('ember-runtime/tests/mixins/mutable_enumerable_test', ['exports', 'ember- } }).run(); }); -enifed('ember-runtime/tests/mixins/mutable_enumerable_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/mixins/mutable_enumerable_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/mixins'); - test('ember-runtime/tests/mixins/mutable_enumerable_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/mixins/mutable_enumerable_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/mixins/mutable_enumerable_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/mixins'); - QUnit.test('ember-runtime/tests/mixins/mutable_enumerable_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/mixins/mutable_enumerable_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/mixins/mutable_enumerable_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/mixins/mutable_enumerable_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/mixins/observable_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject) { @@ -57661,21 +55607,13 @@ enifed('ember-runtime/tests/mixins/observable_test', ['exports', 'ember-metal', equal(25, obj.get('age')); }); }); -enifed('ember-runtime/tests/mixins/observable_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/mixins'); - test('ember-runtime/tests/mixins/observable_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/mixins/observable_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/mixins/observable_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/mixins/observable_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/mixins'); - QUnit.test('ember-runtime/tests/mixins/observable_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/mixins/observable_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/mixins/observable_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/mixins/observable_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/mixins/promise_proxy_test', ['exports', 'ember-metal', 'ember-runtime/system/object_proxy', 'ember-runtime/mixins/promise_proxy', 'ember-runtime/ext/rsvp', 'rsvp'], function (exports, _emberMetal, _emberRuntimeSystemObject_proxy, _emberRuntimeMixinsPromise_proxy, _emberRuntimeExtRsvp, _rsvp) { @@ -58023,21 +55961,13 @@ enifed('ember-runtime/tests/mixins/promise_proxy_test', ['exports', 'ember-metal equal(receivedReason, expectedReason, 'passed reason is the reason the promise was rejected for'); }); }); -enifed('ember-runtime/tests/mixins/promise_proxy_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/mixins/promise_proxy_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/mixins'); - test('ember-runtime/tests/mixins/promise_proxy_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/mixins/promise_proxy_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/mixins/promise_proxy_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/mixins'); - QUnit.test('ember-runtime/tests/mixins/promise_proxy_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/mixins/promise_proxy_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/mixins/promise_proxy_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/mixins/promise_proxy_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/mixins/target_action_support_test', ['exports', 'ember-environment', 'ember-runtime/system/object', 'ember-runtime/mixins/target_action_support'], function (exports, _emberEnvironment, _emberRuntimeSystemObject, _emberRuntimeMixinsTarget_action_support) { @@ -58222,24 +56152,16 @@ enifed('ember-runtime/tests/mixins/target_action_support_test', ['exports', 'emb ok(true === obj.triggerAction({ actionContext: null }), 'a valid target and action were specified'); }); }); -enifed('ember-runtime/tests/mixins/target_action_support_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/mixins/target_action_support_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/mixins'); - test('ember-runtime/tests/mixins/target_action_support_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/mixins/target_action_support_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/mixins/target_action_support_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/mixins'); - QUnit.test('ember-runtime/tests/mixins/target_action_support_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/mixins/target_action_support_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/mixins/target_action_support_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/mixins/target_action_support_test.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/tests/suites/array', ['exports', 'ember-runtime/tests/suites/enumerable', 'ember-runtime/tests/suites/array/indexOf', 'ember-runtime/tests/suites/array/lastIndexOf', 'ember-runtime/tests/suites/array/objectAt', 'ember-runtime/tests/suites/array/includes', 'ember-runtime/mixins/array', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesEnumerable, _emberRuntimeTestsSuitesArrayIndexOf, _emberRuntimeTestsSuitesArrayLastIndexOf, _emberRuntimeTestsSuitesArrayObjectAt, _emberRuntimeTestsSuitesArrayIncludes, _emberRuntimeMixinsArray, _emberMetal) { +enifed('ember-runtime/tests/suites/array', ['exports', 'ember-runtime/tests/suites/enumerable', 'ember-runtime/tests/suites/array/indexOf', 'ember-runtime/tests/suites/array/lastIndexOf', 'ember-runtime/tests/suites/array/objectAt', 'ember-runtime/tests/suites/array/includes', 'ember-runtime/mixins/array'], function (exports, _emberRuntimeTestsSuitesEnumerable, _emberRuntimeTestsSuitesArrayIndexOf, _emberRuntimeTestsSuitesArrayLastIndexOf, _emberRuntimeTestsSuitesArrayObjectAt, _emberRuntimeTestsSuitesArrayIncludes, _emberRuntimeMixinsArray) { 'use strict'; var ObserverClass = _emberRuntimeTestsSuitesEnumerable.ObserverClass.extend({ @@ -58274,28 +56196,18 @@ enifed('ember-runtime/tests/suites/array', ['exports', 'ember-runtime/tests/suit ArrayTests.importModuleTests(_emberRuntimeTestsSuitesArrayLastIndexOf.default); ArrayTests.importModuleTests(_emberRuntimeTestsSuitesArrayObjectAt.default); - if (true) { - ArrayTests.importModuleTests(_emberRuntimeTestsSuitesArrayIncludes.default); - } + ArrayTests.importModuleTests(_emberRuntimeTestsSuitesArrayIncludes.default); exports.ArrayTests = ArrayTests; exports.ObserverClass = ObserverClass; }); -enifed('ember-runtime/tests/suites/array.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites'); - test('ember-runtime/tests/suites/array.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/array.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/array.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/array.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites'); - QUnit.test('ember-runtime/tests/suites/array.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/array.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/array.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/array.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/array/includes', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { @@ -58339,21 +56251,13 @@ enifed('ember-runtime/tests/suites/array/includes', ['exports', 'ember-runtime/t exports.default = suite; }); -enifed('ember-runtime/tests/suites/array/includes.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/array/includes.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/array'); - test('ember-runtime/tests/suites/array/includes.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/array/includes.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/array/includes.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/array'); - QUnit.test('ember-runtime/tests/suites/array/includes.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/array/includes.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/array/includes.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/array/includes.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/array/indexOf', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { @@ -58382,21 +56286,13 @@ enifed('ember-runtime/tests/suites/array/indexOf', ['exports', 'ember-runtime/te exports.default = suite; }); -enifed('ember-runtime/tests/suites/array/indexOf.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/array'); - test('ember-runtime/tests/suites/array/indexOf.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/array/indexOf.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/array/indexOf.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/array/indexOf.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/array'); - QUnit.test('ember-runtime/tests/suites/array/indexOf.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/array/indexOf.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/array/indexOf.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/array/indexOf.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/array/lastIndexOf', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { @@ -58459,21 +56355,13 @@ enifed('ember-runtime/tests/suites/array/lastIndexOf', ['exports', 'ember-runtim exports.default = suite; }); -enifed('ember-runtime/tests/suites/array/lastIndexOf.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/array'); - test('ember-runtime/tests/suites/array/lastIndexOf.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/array/lastIndexOf.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/array/lastIndexOf.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/array/lastIndexOf.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/array'); - QUnit.test('ember-runtime/tests/suites/array/lastIndexOf.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/array/lastIndexOf.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/array/lastIndexOf.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/array/lastIndexOf.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/array/objectAt', ['exports', 'ember-runtime/tests/suites/suite', 'ember-runtime/mixins/array'], function (exports, _emberRuntimeTestsSuitesSuite, _emberRuntimeMixinsArray) { @@ -58505,21 +56393,13 @@ enifed('ember-runtime/tests/suites/array/objectAt', ['exports', 'ember-runtime/t exports.default = suite; }); -enifed('ember-runtime/tests/suites/array/objectAt.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/array'); - test('ember-runtime/tests/suites/array/objectAt.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/array/objectAt.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/array/objectAt.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/array/objectAt.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/array'); - QUnit.test('ember-runtime/tests/suites/array/objectAt.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/array/objectAt.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/array/objectAt.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/array/objectAt.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/copyable', ['exports', 'ember-runtime/tests/suites/suite', 'ember-runtime/tests/suites/copyable/copy', 'ember-runtime/tests/suites/copyable/frozenCopy'], function (exports, _emberRuntimeTestsSuitesSuite, _emberRuntimeTestsSuitesCopyableCopy, _emberRuntimeTestsSuitesCopyableFrozenCopy) { @@ -58562,21 +56442,13 @@ enifed('ember-runtime/tests/suites/copyable', ['exports', 'ember-runtime/tests/s exports.default = CopyableTests; }); -enifed('ember-runtime/tests/suites/copyable.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites'); - test('ember-runtime/tests/suites/copyable.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/copyable.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/copyable.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/copyable.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites'); - QUnit.test('ember-runtime/tests/suites/copyable.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/copyable.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/copyable.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/copyable.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/copyable/copy', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { @@ -58594,21 +56466,13 @@ enifed('ember-runtime/tests/suites/copyable/copy', ['exports', 'ember-runtime/te exports.default = suite; }); -enifed('ember-runtime/tests/suites/copyable/copy.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/copyable'); - test('ember-runtime/tests/suites/copyable/copy.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/copyable/copy.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/copyable/copy.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/copyable/copy.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/copyable'); - QUnit.test('ember-runtime/tests/suites/copyable/copy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/copyable/copy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/copyable/copy.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/copyable/copy.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/copyable/frozenCopy', ['exports', 'ember-runtime/tests/suites/suite', 'ember-runtime/mixins/freezable', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberRuntimeMixinsFreezable, _emberMetal) { @@ -58642,21 +56506,13 @@ enifed('ember-runtime/tests/suites/copyable/frozenCopy', ['exports', 'ember-runt exports.default = suite; }); -enifed('ember-runtime/tests/suites/copyable/frozenCopy.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/copyable'); - test('ember-runtime/tests/suites/copyable/frozenCopy.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/copyable/frozenCopy.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/copyable/frozenCopy.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/copyable/frozenCopy.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/copyable'); - QUnit.test('ember-runtime/tests/suites/copyable/frozenCopy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/copyable/frozenCopy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/copyable/frozenCopy.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/copyable/frozenCopy.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable', ['exports', 'ember-utils', 'ember-runtime/tests/suites/suite', 'ember-runtime/system/object', 'ember-metal', 'ember-runtime/tests/suites/enumerable/any', 'ember-runtime/tests/suites/enumerable/is_any', 'ember-runtime/tests/suites/enumerable/compact', 'ember-runtime/tests/suites/enumerable/contains', 'ember-runtime/tests/suites/enumerable/includes', 'ember-runtime/tests/suites/enumerable/every', 'ember-runtime/tests/suites/enumerable/filter', 'ember-runtime/tests/suites/enumerable/find', 'ember-runtime/tests/suites/enumerable/firstObject', 'ember-runtime/tests/suites/enumerable/forEach', 'ember-runtime/tests/suites/enumerable/mapBy', 'ember-runtime/tests/suites/enumerable/invoke', 'ember-runtime/tests/suites/enumerable/lastObject', 'ember-runtime/tests/suites/enumerable/map', 'ember-runtime/tests/suites/enumerable/reduce', 'ember-runtime/tests/suites/enumerable/reject', 'ember-runtime/tests/suites/enumerable/sortBy', 'ember-runtime/tests/suites/enumerable/toArray', 'ember-runtime/tests/suites/enumerable/uniq', 'ember-runtime/tests/suites/enumerable/uniqBy', 'ember-runtime/tests/suites/enumerable/without'], function (exports, _emberUtils, _emberRuntimeTestsSuitesSuite, _emberRuntimeSystemObject, _emberMetal, _emberRuntimeTestsSuitesEnumerableAny, _emberRuntimeTestsSuitesEnumerableIs_any, _emberRuntimeTestsSuitesEnumerableCompact, _emberRuntimeTestsSuitesEnumerableContains, _emberRuntimeTestsSuitesEnumerableIncludes, _emberRuntimeTestsSuitesEnumerableEvery, _emberRuntimeTestsSuitesEnumerableFilter, _emberRuntimeTestsSuitesEnumerableFind, _emberRuntimeTestsSuitesEnumerableFirstObject, _emberRuntimeTestsSuitesEnumerableForEach, _emberRuntimeTestsSuitesEnumerableMapBy, _emberRuntimeTestsSuitesEnumerableInvoke, _emberRuntimeTestsSuitesEnumerableLastObject, _emberRuntimeTestsSuitesEnumerableMap, _emberRuntimeTestsSuitesEnumerableReduce, _emberRuntimeTestsSuitesEnumerableReject, _emberRuntimeTestsSuitesEnumerableSortBy, _emberRuntimeTestsSuitesEnumerableToArray, _emberRuntimeTestsSuitesEnumerableUniq, _emberRuntimeTestsSuitesEnumerableUniqBy, _emberRuntimeTestsSuitesEnumerableWithout) { @@ -58932,13 +56788,9 @@ enifed('ember-runtime/tests/suites/enumerable', ['exports', 'ember-utils', 'embe EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableToArray.default); EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableUniq.default); - if (true) { - EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableUniqBy.default); - } + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableUniqBy.default); - if (true) { - EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableIncludes.default); - } + EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableIncludes.default); EnumerableTests.importModuleTests(_emberRuntimeTestsSuitesEnumerableWithout.default); @@ -58946,21 +56798,13 @@ enifed('ember-runtime/tests/suites/enumerable', ['exports', 'ember-utils', 'embe exports.EnumerableTests = EnumerableTests; exports.ObserverClass = ObserverClass; }); -enifed('ember-runtime/tests/suites/enumerable.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites'); - test('ember-runtime/tests/suites/enumerable.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites'); - QUnit.test('ember-runtime/tests/suites/enumerable.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/any', ['exports', 'ember-runtime/tests/suites/suite', 'ember-runtime/system/native_array'], function (exports, _emberRuntimeTestsSuitesSuite, _emberRuntimeSystemNative_array) { @@ -59037,21 +56881,13 @@ enifed('ember-runtime/tests/suites/enumerable/any', ['exports', 'ember-runtime/t exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/any.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/any.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/any.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/any.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/any.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/any.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/any.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/any.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/any.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/compact', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { @@ -59069,24 +56905,16 @@ enifed('ember-runtime/tests/suites/enumerable/compact', ['exports', 'ember-runti exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/compact.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/compact.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/compact.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/compact.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/compact.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/compact.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/compact.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/compact.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/compact.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/tests/suites/enumerable/contains', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { +enifed('ember-runtime/tests/suites/enumerable/contains', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { 'use strict'; var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); @@ -59097,9 +56925,7 @@ enifed('ember-runtime/tests/suites/enumerable/contains', ['exports', 'ember-runt var data = this.newFixture(3); var obj = this.newObject(data); - if (true) { - expectDeprecation('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.'); - } + expectDeprecation('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.'); equal(obj.contains(data[1]), true, 'should return true if contained'); }); @@ -59107,29 +56933,19 @@ enifed('ember-runtime/tests/suites/enumerable/contains', ['exports', 'ember-runt var data = this.newFixture(1); var obj = this.newObject(this.newFixture(3)); - if (true) { - expectDeprecation('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.'); - } + expectDeprecation('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.'); equal(obj.contains(data[0]), false, 'should return false if not contained'); }); exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/contains.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/contains.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/contains.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/contains.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/contains.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/contains.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/contains.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/contains.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/contains.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/every', ['exports', 'ember-runtime/system/object', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeSystemObject, _emberRuntimeTestsSuitesSuite) { @@ -59211,21 +57027,13 @@ enifed('ember-runtime/tests/suites/enumerable/every', ['exports', 'ember-runtime exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/every.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/every.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/every.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/every.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/every.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/every.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/every.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/every.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/every.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/filter', ['exports', 'ember-runtime/system/object', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeSystemObject, _emberRuntimeTestsSuitesSuite) { @@ -59343,21 +57151,13 @@ enifed('ember-runtime/tests/suites/enumerable/filter', ['exports', 'ember-runtim exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/filter.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/filter.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/filter.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/filter.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/filter.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/filter.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/filter.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/filter.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/filter.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/find', ['exports', 'ember-runtime/system/object', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeSystemObject, _emberRuntimeTestsSuitesSuite) { @@ -59458,21 +57258,13 @@ enifed('ember-runtime/tests/suites/enumerable/find', ['exports', 'ember-runtime/ exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/find.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/find.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/find.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/find.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/find.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/find.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/find.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/find.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/find.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/firstObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { @@ -59504,21 +57296,13 @@ enifed('ember-runtime/tests/suites/enumerable/firstObject', ['exports', 'ember-r exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/firstObject.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/firstObject.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/firstObject.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/firstObject.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/firstObject.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/firstObject.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/firstObject.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/firstObject.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/firstObject.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/forEach', ['exports', 'ember-utils', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberUtils, _emberRuntimeTestsSuitesSuite, _emberMetal) { @@ -59598,21 +57382,13 @@ enifed('ember-runtime/tests/suites/enumerable/forEach', ['exports', 'ember-utils exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/forEach.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/forEach.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/forEach.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/forEach.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/forEach.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/forEach.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/forEach.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/forEach.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/forEach.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/includes', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { @@ -59642,21 +57418,13 @@ enifed('ember-runtime/tests/suites/enumerable/includes', ['exports', 'ember-runt exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/includes.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/includes.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/includes.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/includes.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/includes.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/includes.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/includes.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/includes.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/includes.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/invoke', ['exports', 'ember-runtime/system/object', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeSystemObject, _emberRuntimeTestsSuitesSuite) { @@ -59691,21 +57459,13 @@ enifed('ember-runtime/tests/suites/enumerable/invoke', ['exports', 'ember-runtim exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/invoke.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/invoke.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/invoke.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/invoke.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/invoke.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/invoke.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/invoke.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/invoke.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/invoke.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/is_any', ['exports', 'ember-runtime/system/object', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeSystemObject, _emberRuntimeTestsSuitesSuite) { @@ -59758,21 +57518,13 @@ enifed('ember-runtime/tests/suites/enumerable/is_any', ['exports', 'ember-runtim exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/is_any.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/is_any.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/is_any.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/is_any.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/is_any.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/is_any.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/is_any.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/is_any.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/is_any.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/lastObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { @@ -59808,21 +57560,13 @@ enifed('ember-runtime/tests/suites/enumerable/lastObject', ['exports', 'ember-ru exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/lastObject.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/lastObject.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/lastObject.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/lastObject.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/lastObject.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/lastObject.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/lastObject.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/lastObject.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/lastObject.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/map', ['exports', 'ember-utils', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberUtils, _emberRuntimeTestsSuitesSuite, _emberMetal) { @@ -59898,21 +57642,13 @@ enifed('ember-runtime/tests/suites/enumerable/map', ['exports', 'ember-utils', ' exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/map.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/map.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/map.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/map.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/map.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/map.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/map.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/map.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/map.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/mapBy', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { @@ -59934,21 +57670,13 @@ enifed('ember-runtime/tests/suites/enumerable/mapBy', ['exports', 'ember-runtime exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/mapBy.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/mapBy.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/mapBy.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/mapBy.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/mapBy.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/mapBy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/mapBy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/mapBy.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/mapBy.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/reduce', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { @@ -59984,21 +57712,13 @@ enifed('ember-runtime/tests/suites/enumerable/reduce', ['exports', 'ember-runtim exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/reduce.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/reduce.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/reduce.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/reduce.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/reduce.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/reduce.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/reduce.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/reduce.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/reduce.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/reject', ['exports', 'ember-runtime/system/object', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeSystemObject, _emberRuntimeTestsSuitesSuite) { @@ -60124,21 +57844,13 @@ enifed('ember-runtime/tests/suites/enumerable/reject', ['exports', 'ember-runtim exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/reject.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/reject.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/reject.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/reject.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/reject.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/reject.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/reject.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/reject.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/reject.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/sortBy', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { @@ -60166,21 +57878,13 @@ enifed('ember-runtime/tests/suites/enumerable/sortBy', ['exports', 'ember-runtim exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/sortBy.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/sortBy.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/sortBy.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/sortBy.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/sortBy.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/sortBy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/sortBy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/sortBy.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/sortBy.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/toArray', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { @@ -60197,21 +57901,13 @@ enifed('ember-runtime/tests/suites/enumerable/toArray', ['exports', 'ember-runti exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/toArray.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/toArray.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/toArray.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/toArray.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/toArray.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/toArray.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/toArray.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/toArray.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/toArray.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/enumerable/uniq', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { @@ -60249,57 +57945,39 @@ enifed('ember-runtime/tests/suites/enumerable/uniq', ['exports', 'ember-runtime/ exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/uniq.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/uniq.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/uniq.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/uniq.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/uniq.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/uniq.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/uniq.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/uniq.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/uniq.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/tests/suites/enumerable/uniqBy', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { +enifed('ember-runtime/tests/suites/enumerable/uniqBy', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { 'use strict'; var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); suite.module('uniqBy'); - if (true) { - suite.test('should return new instance with duplicates removed', function () { - var numbers = this.newObject([{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 1, value: 'one' }]); - deepEqual(numbers.uniqBy('id'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }]); - }); - } + suite.test('should return new instance with duplicates removed', function () { + var numbers = this.newObject([{ id: 1, value: 'one' }, { id: 2, value: 'two' }, { id: 1, value: 'one' }]); + deepEqual(numbers.uniqBy('id'), [{ id: 1, value: 'one' }, { id: 2, value: 'two' }]); + }); exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/uniqBy.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/uniqBy.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/uniqBy.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/uniqBy.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/uniqBy.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/uniqBy.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/uniqBy.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/uniqBy.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/uniqBy.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/tests/suites/enumerable/without', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { +enifed('ember-runtime/tests/suites/enumerable/without', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { 'use strict'; var suite = _emberRuntimeTestsSuitesSuite.SuiteModuleBuilder.create(); @@ -60321,21 +57999,19 @@ enifed('ember-runtime/tests/suites/enumerable/without', ['exports', 'ember-runti deepEqual(this.toArray(obj), before, 'should not have changed original'); }); - if (true) { - suite.test('should remove NaN value', function () { - var before = undefined, - after = undefined, - obj = undefined, - ret = undefined; + suite.test('should remove NaN value', function () { + var before = undefined, + after = undefined, + obj = undefined, + ret = undefined; - before = [].concat(this.newFixture(2), [NaN]); - after = [before[0], before[1]]; - obj = this.newObject(before); + before = [].concat(this.newFixture(2), [NaN]); + after = [before[0], before[1]]; + obj = this.newObject(before); - ret = obj.without(NaN); - deepEqual(this.toArray(ret), after, 'should have removed item'); - }); - } + ret = obj.without(NaN); + deepEqual(this.toArray(ret), after, 'should have removed item'); + }); suite.test('should return same instance if object not found', function () { var item = undefined, @@ -60351,21 +58027,13 @@ enifed('ember-runtime/tests/suites/enumerable/without', ['exports', 'ember-runti exports.default = suite; }); -enifed('ember-runtime/tests/suites/enumerable/without.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/enumerable'); - test('ember-runtime/tests/suites/enumerable/without.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/enumerable/without.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/enumerable/without.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/enumerable/without.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/enumerable'); - QUnit.test('ember-runtime/tests/suites/enumerable/without.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/enumerable/without.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/enumerable/without.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/enumerable/without.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array', ['exports', 'ember-runtime/tests/suites/array', 'ember-runtime/tests/suites/mutable_array/insertAt', 'ember-runtime/tests/suites/mutable_array/popObject', 'ember-runtime/tests/suites/mutable_array/pushObject', 'ember-runtime/tests/suites/mutable_array/pushObjects', 'ember-runtime/tests/suites/mutable_array/removeAt', 'ember-runtime/tests/suites/mutable_array/replace', 'ember-runtime/tests/suites/mutable_array/shiftObject', 'ember-runtime/tests/suites/mutable_array/unshiftObject', 'ember-runtime/tests/suites/mutable_array/reverseObjects'], function (exports, _emberRuntimeTestsSuitesArray, _emberRuntimeTestsSuitesMutable_arrayInsertAt, _emberRuntimeTestsSuitesMutable_arrayPopObject, _emberRuntimeTestsSuitesMutable_arrayPushObject, _emberRuntimeTestsSuitesMutable_arrayPushObjects, _emberRuntimeTestsSuitesMutable_arrayRemoveAt, _emberRuntimeTestsSuitesMutable_arrayReplace, _emberRuntimeTestsSuitesMutable_arrayShiftObject, _emberRuntimeTestsSuitesMutable_arrayUnshiftObject, _emberRuntimeTestsSuitesMutable_arrayReverseObjects) { @@ -60384,21 +58052,13 @@ enifed('ember-runtime/tests/suites/mutable_array', ['exports', 'ember-runtime/te exports.default = MutableArrayTests; }); -enifed('ember-runtime/tests/suites/mutable_array.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites'); - test('ember-runtime/tests/suites/mutable_array.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites'); - QUnit.test('ember-runtime/tests/suites/mutable_array.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/addObject', ['exports', 'ember-metal', 'ember-runtime/tests/suites/suite'], function (exports, _emberMetal, _emberRuntimeTestsSuitesSuite) { @@ -60463,21 +58123,13 @@ enifed('ember-runtime/tests/suites/mutable_array/addObject', ['exports', 'ember- exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/addObject.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/addObject.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/addObject.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/addObject.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/addObject.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/addObject.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/addObject.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/addObject.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/addObject.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/clear', ['exports', 'ember-metal', 'ember-runtime/tests/suites/suite'], function (exports, _emberMetal, _emberRuntimeTestsSuitesSuite) { @@ -60530,21 +58182,13 @@ enifed('ember-runtime/tests/suites/mutable_array/clear', ['exports', 'ember-meta exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/clear.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/clear.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/clear.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/clear.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/clear.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/clear.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/clear.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/clear.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/clear.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/insertAt', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { @@ -60739,21 +58383,13 @@ enifed('ember-runtime/tests/suites/mutable_array/insertAt', ['exports', 'ember-r exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/insertAt.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/insertAt.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/insertAt.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/insertAt.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/insertAt.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/insertAt.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/insertAt.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/insertAt.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/insertAt.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/popObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { @@ -60825,21 +58461,13 @@ enifed('ember-runtime/tests/suites/mutable_array/popObject', ['exports', 'ember- exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/popObject.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/popObject.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/popObject.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/popObject.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/popObject.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/popObject.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/popObject.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/popObject.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/popObject.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/pushObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { @@ -60900,21 +58528,13 @@ enifed('ember-runtime/tests/suites/mutable_array/pushObject', ['exports', 'ember exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/pushObject.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/pushObject.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/pushObject.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/pushObject.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/pushObject.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/pushObject.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/pushObject.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/pushObject.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/pushObject.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/pushObjects', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { @@ -60934,21 +58554,13 @@ enifed('ember-runtime/tests/suites/mutable_array/pushObjects', ['exports', 'embe exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/pushObjects.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/pushObjects.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/pushObjects.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/pushObjects.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/pushObjects.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/pushObjects.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/pushObjects.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/pushObjects.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/pushObjects.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/removeAt', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal', 'ember-runtime/mixins/mutable_array'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal, _emberRuntimeMixinsMutable_array) { @@ -61093,21 +58705,13 @@ enifed('ember-runtime/tests/suites/mutable_array/removeAt', ['exports', 'ember-r exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/removeAt.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/removeAt.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/removeAt.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/removeAt.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/removeAt.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/removeAt.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/removeAt.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/removeAt.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/removeAt.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/removeObject', ['exports', 'ember-metal', 'ember-runtime/tests/suites/suite'], function (exports, _emberMetal, _emberRuntimeTestsSuitesSuite) { @@ -61173,21 +58777,13 @@ enifed('ember-runtime/tests/suites/mutable_array/removeObject', ['exports', 'emb exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/removeObject.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/removeObject.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/removeObject.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/removeObject.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/removeObject.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/removeObject.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/removeObject.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/removeObject.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/removeObject.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/replace', ['exports', 'ember-runtime/tests/suites/suite'], function (exports, _emberRuntimeTestsSuitesSuite) { @@ -61345,21 +58941,13 @@ enifed('ember-runtime/tests/suites/mutable_array/replace', ['exports', 'ember-ru exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/replace.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/replace.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/replace.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/replace.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/replace.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/replace.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/replace.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/replace.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/replace.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/reverseObjects', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { @@ -61391,21 +58979,13 @@ enifed('ember-runtime/tests/suites/mutable_array/reverseObjects', ['exports', 'e exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/reverseObjects.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/reverseObjects.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/reverseObjects.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/reverseObjects.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/reverseObjects.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/reverseObjects.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/reverseObjects.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/reverseObjects.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/reverseObjects.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/setObjects', ['exports', 'ember-metal', 'ember-runtime/tests/suites/suite'], function (exports, _emberMetal, _emberRuntimeTestsSuitesSuite) { @@ -61457,21 +59037,13 @@ enifed('ember-runtime/tests/suites/mutable_array/setObjects', ['exports', 'ember exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/setObjects.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/setObjects.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/setObjects.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/setObjects.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/setObjects.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/setObjects.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/setObjects.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/setObjects.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/setObjects.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/shiftObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { @@ -61545,21 +59117,13 @@ enifed('ember-runtime/tests/suites/mutable_array/shiftObject', ['exports', 'embe exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/shiftObject.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/shiftObject.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/shiftObject.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/shiftObject.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/shiftObject.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/shiftObject.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/shiftObject.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/shiftObject.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/shiftObject.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/unshiftObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { @@ -61643,21 +59207,13 @@ enifed('ember-runtime/tests/suites/mutable_array/unshiftObject', ['exports', 'em exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/unshiftObject.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/unshiftObject.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/unshiftObject.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/unshiftObject.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/unshiftObject.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/unshiftObject.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/unshiftObject.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/unshiftObject.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/unshiftObject.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_array/unshiftObjects', ['exports', 'ember-metal', 'ember-runtime/tests/suites/suite'], function (exports, _emberMetal, _emberRuntimeTestsSuitesSuite) { @@ -61740,21 +59296,13 @@ enifed('ember-runtime/tests/suites/mutable_array/unshiftObjects', ['exports', 'e exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_array/unshiftObjects.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/mutable_array'); - test('ember-runtime/tests/suites/mutable_array/unshiftObjects.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_array/unshiftObjects.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_array/unshiftObjects.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_array/unshiftObjects.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_array'); - QUnit.test('ember-runtime/tests/suites/mutable_array/unshiftObjects.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_array/unshiftObjects.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_array/unshiftObjects.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_array/unshiftObjects.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_enumerable', ['exports', 'ember-runtime/tests/suites/enumerable', 'ember-runtime/tests/suites/mutable_enumerable/addObject', 'ember-runtime/tests/suites/mutable_enumerable/removeObject', 'ember-runtime/tests/suites/mutable_enumerable/removeObjects'], function (exports, _emberRuntimeTestsSuitesEnumerable, _emberRuntimeTestsSuitesMutable_enumerableAddObject, _emberRuntimeTestsSuitesMutable_enumerableRemoveObject, _emberRuntimeTestsSuitesMutable_enumerableRemoveObjects) { @@ -61767,21 +59315,13 @@ enifed('ember-runtime/tests/suites/mutable_enumerable', ['exports', 'ember-runti exports.default = MutableEnumerableTests; }); -enifed('ember-runtime/tests/suites/mutable_enumerable.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites'); - test('ember-runtime/tests/suites/mutable_enumerable.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_enumerable.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_enumerable.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_enumerable.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites'); - QUnit.test('ember-runtime/tests/suites/mutable_enumerable.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_enumerable.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_enumerable.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_enumerable.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_enumerable/addObject', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal) { @@ -61855,21 +59395,13 @@ enifed('ember-runtime/tests/suites/mutable_enumerable/addObject', ['exports', 'e exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_enumerable/addObject.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/mutable_enumerable'); - test('ember-runtime/tests/suites/mutable_enumerable/addObject.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_enumerable/addObject.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_enumerable/addObject.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_enumerable/addObject.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_enumerable'); - QUnit.test('ember-runtime/tests/suites/mutable_enumerable/addObject.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_enumerable/addObject.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_enumerable/addObject.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_enumerable/addObject.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_enumerable/removeObject', ['exports', 'ember-metal', 'ember-runtime/tests/suites/suite', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeTestsSuitesSuite, _emberRuntimeSystemNative_array) { @@ -61945,21 +59477,13 @@ enifed('ember-runtime/tests/suites/mutable_enumerable/removeObject', ['exports', exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_enumerable/removeObject.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_enumerable/removeObject.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/suites/mutable_enumerable'); - test('ember-runtime/tests/suites/mutable_enumerable/removeObject.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_enumerable/removeObject.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_enumerable/removeObject.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_enumerable'); - QUnit.test('ember-runtime/tests/suites/mutable_enumerable/removeObject.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_enumerable/removeObject.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_enumerable/removeObject.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_enumerable/removeObject.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/mutable_enumerable/removeObjects', ['exports', 'ember-runtime/tests/suites/suite', 'ember-metal', 'ember-runtime/system/native_array'], function (exports, _emberRuntimeTestsSuitesSuite, _emberMetal, _emberRuntimeSystemNative_array) { @@ -62145,21 +59669,13 @@ enifed('ember-runtime/tests/suites/mutable_enumerable/removeObjects', ['exports' exports.default = suite; }); -enifed('ember-runtime/tests/suites/mutable_enumerable/removeObjects.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites/mutable_enumerable'); - test('ember-runtime/tests/suites/mutable_enumerable/removeObjects.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/mutable_enumerable/removeObjects.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/mutable_enumerable/removeObjects.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/mutable_enumerable/removeObjects.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites/mutable_enumerable'); - QUnit.test('ember-runtime/tests/suites/mutable_enumerable/removeObjects.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/mutable_enumerable/removeObjects.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/mutable_enumerable/removeObjects.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/mutable_enumerable/removeObjects.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/suites/suite', ['exports', 'ember-utils', 'ember-runtime/system/object', 'ember-metal'], function (exports, _emberUtils, _emberRuntimeSystemObject, _emberMetal) { @@ -62313,21 +59829,13 @@ enifed('ember-runtime/tests/suites/suite', ['exports', 'ember-utils', 'ember-run exports.Suite = Suite; exports.default = Suite; }); -enifed('ember-runtime/tests/suites/suite.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/suites'); - test('ember-runtime/tests/suites/suite.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/suites/suite.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/suites/suite.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/suites/suite.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/suites'); - QUnit.test('ember-runtime/tests/suites/suite.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/suites/suite.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/suites/suite.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/suites/suite.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/application/base_test', ['exports', 'ember-runtime/system/namespace', 'ember-runtime/system/application'], function (exports, _emberRuntimeSystemNamespace, _emberRuntimeSystemApplication) { @@ -62339,21 +59847,13 @@ enifed('ember-runtime/tests/system/application/base_test', ['exports', 'ember-ru ok(_emberRuntimeSystemNamespace.default.detect(_emberRuntimeSystemApplication.default), 'Ember.Application subclass of Ember.Namespace'); }); }); -enifed('ember-runtime/tests/system/application/base_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/application'); - test('ember-runtime/tests/system/application/base_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/application/base_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/application/base_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/application/base_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/application'); - QUnit.test('ember-runtime/tests/system/application/base_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/application/base_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/application/base_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/application/base_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/array_proxy/arranged_content_test', ['exports', 'ember-metal', 'ember-runtime/system/array_proxy', 'ember-runtime/system/native_array', 'ember-runtime/mixins/array'], function (exports, _emberMetal, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemNative_array, _emberRuntimeMixinsArray) { @@ -62753,21 +60253,13 @@ enifed('ember-runtime/tests/system/array_proxy/arranged_content_test', ['exports equal(didChangeCallCount, 2); }); }); -enifed('ember-runtime/tests/system/array_proxy/arranged_content_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/array_proxy'); - test('ember-runtime/tests/system/array_proxy/arranged_content_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/array_proxy/arranged_content_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/array_proxy/arranged_content_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/array_proxy/arranged_content_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/array_proxy'); - QUnit.test('ember-runtime/tests/system/array_proxy/arranged_content_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/array_proxy/arranged_content_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/array_proxy/arranged_content_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/array_proxy/arranged_content_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/array_proxy/content_change_test', ['exports', 'ember-metal', 'ember-runtime/computed/computed_macros', 'ember-runtime/system/array_proxy', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeComputedComputed_macros, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemNative_array) { @@ -62895,21 +60387,13 @@ enifed('ember-runtime/tests/system/array_proxy/content_change_test', ['exports', equal(didChangeCallCount, 2); }); }); -enifed('ember-runtime/tests/system/array_proxy/content_change_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/array_proxy/content_change_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/array_proxy'); - test('ember-runtime/tests/system/array_proxy/content_change_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/array_proxy/content_change_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/array_proxy/content_change_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/array_proxy'); - QUnit.test('ember-runtime/tests/system/array_proxy/content_change_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/array_proxy/content_change_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/array_proxy/content_change_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/array_proxy/content_change_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/array_proxy/content_update_test', ['exports', 'ember-metal', 'ember-runtime/system/array_proxy', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemNative_array) { @@ -62937,21 +60421,13 @@ enifed('ember-runtime/tests/system/array_proxy/content_update_test', ['exports', ok(observerCalled, 'contentArrayDidChange is invoked'); }); }); -enifed('ember-runtime/tests/system/array_proxy/content_update_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/array_proxy'); - test('ember-runtime/tests/system/array_proxy/content_update_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/array_proxy/content_update_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/array_proxy/content_update_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/array_proxy/content_update_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/array_proxy'); - QUnit.test('ember-runtime/tests/system/array_proxy/content_update_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/array_proxy/content_update_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/array_proxy/content_update_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/array_proxy/content_update_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/array_proxy/length_test', ['exports', 'ember-runtime/system/array_proxy', 'ember-runtime/system/object', 'ember-metal', 'ember-runtime/system/native_array'], function (exports, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemObject, _emberMetal, _emberRuntimeSystemNative_array) { @@ -63016,21 +60492,13 @@ enifed('ember-runtime/tests/system/array_proxy/length_test', ['exports', 'ember- equal(eCalled, 2, 'expected observer `colors.content.[]` to be called TWICE'); }); }); -enifed('ember-runtime/tests/system/array_proxy/length_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/array_proxy'); - test('ember-runtime/tests/system/array_proxy/length_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/array_proxy/length_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/array_proxy/length_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/array_proxy/length_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/array_proxy'); - QUnit.test('ember-runtime/tests/system/array_proxy/length_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/array_proxy/length_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/array_proxy/length_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/array_proxy/length_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/array_proxy/suite_test', ['exports', 'ember-runtime/tests/suites/mutable_array', 'ember-runtime/system/array_proxy', 'ember-metal', 'ember-runtime/system/native_array'], function (exports, _emberRuntimeTestsSuitesMutable_array, _emberRuntimeSystemArray_proxy, _emberMetal, _emberRuntimeSystemNative_array) { @@ -63053,21 +60521,13 @@ enifed('ember-runtime/tests/system/array_proxy/suite_test', ['exports', 'ember-r } }).run(); }); -enifed('ember-runtime/tests/system/array_proxy/suite_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/array_proxy'); - test('ember-runtime/tests/system/array_proxy/suite_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/array_proxy/suite_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/array_proxy/suite_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/array_proxy/suite_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/array_proxy'); - QUnit.test('ember-runtime/tests/system/array_proxy/suite_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/array_proxy/suite_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/array_proxy/suite_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/array_proxy/suite_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/array_proxy/watching_and_listening_test', ['exports', 'ember-metal', 'ember-runtime/system/array_proxy', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemNative_array) { @@ -63202,21 +60662,13 @@ enifed('ember-runtime/tests/system/array_proxy/watching_and_listening_test', ['e equal(_emberMetal.watcherCount(item2c, 'id'), 3); }); }); -enifed('ember-runtime/tests/system/array_proxy/watching_and_listening_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/array_proxy'); - test('ember-runtime/tests/system/array_proxy/watching_and_listening_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/array_proxy/watching_and_listening_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/array_proxy/watching_and_listening_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/array_proxy/watching_and_listening_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/array_proxy'); - QUnit.test('ember-runtime/tests/system/array_proxy/watching_and_listening_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/array_proxy/watching_and_listening_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/array_proxy/watching_and_listening_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/array_proxy/watching_and_listening_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/core_object_test', ['exports', 'ember-runtime/system/core_object', 'ember-metal/property_set', 'ember-metal/mixin'], function (exports, _emberRuntimeSystemCore_object, _emberMetalProperty_set, _emberMetalMixin) { @@ -63296,21 +60748,13 @@ enifed('ember-runtime/tests/system/core_object_test', ['exports', 'ember-runtime equal(callCount, 1); }); }); -enifed('ember-runtime/tests/system/core_object_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/core_object_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system'); - test('ember-runtime/tests/system/core_object_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/core_object_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/core_object_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system'); - QUnit.test('ember-runtime/tests/system/core_object_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/core_object_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/core_object_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/core_object_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/lazy_load_test', ['exports', 'ember-metal', 'ember-runtime/system/lazy_load'], function (exports, _emberMetal, _emberRuntimeSystemLazy_load) { @@ -63389,21 +60833,13 @@ enifed('ember-runtime/tests/system/lazy_load_test', ['exports', 'ember-metal', ' }); } }); -enifed('ember-runtime/tests/system/lazy_load_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system'); - test('ember-runtime/tests/system/lazy_load_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/lazy_load_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/lazy_load_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/lazy_load_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system'); - QUnit.test('ember-runtime/tests/system/lazy_load_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/lazy_load_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/lazy_load_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/lazy_load_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/namespace/base_test', ['exports', 'ember-environment', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/system/namespace'], function (exports, _emberEnvironment, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeSystemNamespace) { @@ -63534,21 +60970,13 @@ enifed('ember-runtime/tests/system/namespace/base_test', ['exports', 'ember-envi equal(_emberRuntimeSystemNamespace.default.byName('CF'), undefined, 'namespace can not be found after destroyed'); }); }); -enifed('ember-runtime/tests/system/namespace/base_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/namespace'); - test('ember-runtime/tests/system/namespace/base_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/namespace/base_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/namespace/base_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/namespace/base_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/namespace'); - QUnit.test('ember-runtime/tests/system/namespace/base_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/namespace/base_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/namespace/base_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/namespace/base_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/native_array/a_test', ['exports', 'ember-runtime/mixins/array', 'ember-runtime/system/native_array'], function (exports, _emberRuntimeMixinsArray, _emberRuntimeSystemNative_array) { @@ -63564,21 +60992,13 @@ enifed('ember-runtime/tests/system/native_array/a_test', ['exports', 'ember-runt ok(_emberRuntimeMixinsArray.default.detect(_emberRuntimeSystemNative_array.A([1, 2])), 'returned an ember array'); }); }); -enifed('ember-runtime/tests/system/native_array/a_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/native_array'); - test('ember-runtime/tests/system/native_array/a_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/native_array/a_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/native_array/a_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/native_array/a_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/native_array'); - QUnit.test('ember-runtime/tests/system/native_array/a_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/native_array/a_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/native_array/a_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/native_array/a_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/native_array/copyable_suite_test', ['exports', 'ember-utils', 'ember-runtime/system/native_array', 'ember-runtime/tests/suites/copyable'], function (exports, _emberUtils, _emberRuntimeSystemNative_array, _emberRuntimeTestsSuitesCopyable) { @@ -63621,21 +61041,13 @@ enifed('ember-runtime/tests/system/native_array/copyable_suite_test', ['exports' ok(copiedArray[0] !== array[0], 'objects inside should be unique'); }); }); -enifed('ember-runtime/tests/system/native_array/copyable_suite_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/native_array'); - test('ember-runtime/tests/system/native_array/copyable_suite_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/native_array/copyable_suite_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/native_array/copyable_suite_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/native_array/copyable_suite_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/native_array'); - QUnit.test('ember-runtime/tests/system/native_array/copyable_suite_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/native_array/copyable_suite_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/native_array/copyable_suite_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/native_array/copyable_suite_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/native_array/suite_test', ['exports', 'ember-runtime/system/native_array', 'ember-runtime/tests/suites/mutable_array'], function (exports, _emberRuntimeSystemNative_array, _emberRuntimeTestsSuitesMutable_array) { @@ -63657,21 +61069,13 @@ enifed('ember-runtime/tests/system/native_array/suite_test', ['exports', 'ember- } }).run(); }); -enifed('ember-runtime/tests/system/native_array/suite_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/native_array/suite_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/native_array'); - test('ember-runtime/tests/system/native_array/suite_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/native_array/suite_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/native_array/suite_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/native_array'); - QUnit.test('ember-runtime/tests/system/native_array/suite_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/native_array/suite_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/native_array/suite_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/native_array/suite_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/computed_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject) { @@ -63943,21 +61347,13 @@ enifed('ember-runtime/tests/system/object/computed_test', ['exports', 'ember-met ok(_emberMetal.get(SubClass.create(), 'foo'), 'FOO', 'super value is fetched'); }); }); -enifed('ember-runtime/tests/system/object/computed_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/computed_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/computed_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object/computed_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/computed_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/computed_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/computed_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/computed_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/computed_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/create_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { @@ -64105,21 +61501,13 @@ enifed('ember-runtime/tests/system/object/create_test', ['exports', 'ember-metal ok(!m.peekBindings(), 'A binding map is not allocated'); }); }); -enifed('ember-runtime/tests/system/object/create_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/create_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/create_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object/create_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/create_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/create_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/create_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/create_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/create_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/destroy_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject) { @@ -64290,21 +61678,13 @@ enifed('ember-runtime/tests/system/object/destroy_test', ['exports', 'ember-meta ok(foo.get('value'), 'foo is synced when the binding is updated in the willDestroy hook'); }); }); -enifed('ember-runtime/tests/system/object/destroy_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/destroy_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/destroy_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object/destroy_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/destroy_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/destroy_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/destroy_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/destroy_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/destroy_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/detectInstance_test', ['exports', 'ember-runtime/system/object'], function (exports, _emberRuntimeSystemObject) { @@ -64343,21 +61723,13 @@ enifed('ember-runtime/tests/system/object/detectInstance_test', ['exports', 'emb ok(C.detectInstance(c), 'c is an instance of C'); }); }); -enifed('ember-runtime/tests/system/object/detectInstance_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/detectInstance_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/detectInstance_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object/detectInstance_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/detectInstance_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/detectInstance_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/detectInstance_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/detectInstance_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/detectInstance_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/detect_test', ['exports', 'ember-runtime/system/object'], function (exports, _emberRuntimeSystemObject) { @@ -64391,21 +61763,219 @@ enifed('ember-runtime/tests/system/object/detect_test', ['exports', 'ember-runti ok(C.detect(C), 'C is a C class'); }); }); -enifed('ember-runtime/tests/system/object/detect_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/detect_test.lint-test', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('ESLint | ember-runtime/tests/system/object/detect_test.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-runtime/tests/system/object/detect_test.js should pass ESLint\n\n'); + }); +}); +enifed('ember-runtime/tests/system/object/es-compatibility-test', ['exports', 'ember-runtime/system/object', 'ember-metal'], function (exports, _emberRuntimeSystemObject, _emberMetal) { 'use strict'; - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/detect_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/detect_test.js should pass jscs.'); + QUnit.module('EmberObject ES Compatibility'); + + QUnit.test('extending an Ember.Object', function (assert) { + var calls = []; + + var MyObject = (function (_EmberObject) { + babelHelpers.inherits(MyObject, _EmberObject); + + function MyObject() { + calls.push('constructor'); + _EmberObject.apply(this, arguments); + this.postInitProperty = 'post-init-property'; + } + + MyObject.prototype.init = function init() { + var _EmberObject$prototype$init; + + calls.push('init'); + (_EmberObject$prototype$init = _EmberObject.prototype.init).call.apply(_EmberObject$prototype$init, [this].concat(babelHelpers.slice.call(arguments))); + this.initProperty = 'init-property'; + }; + + return MyObject; + })(_emberRuntimeSystemObject.default); + + var myObject = MyObject.create({ passedProperty: 'passed-property' }); + + assert.deepEqual(calls, ['constructor', 'init'], 'constructor then init called (create)'); + assert.equal(myObject.postInitProperty, 'post-init-property', 'constructor property available on instance (create)'); + assert.equal(myObject.initProperty, 'init-property', 'init property available on instance (create)'); + assert.equal(myObject.passedProperty, 'passed-property', 'passed property available on instance (create)'); + + calls = []; + myObject = new MyObject({ passedProperty: 'passed-property' }); + + assert.deepEqual(calls, ['constructor', 'init'], 'constructor then init called (new)'); + assert.equal(myObject.postInitProperty, 'post-init-property', 'constructor property available on instance (new)'); + assert.equal(myObject.initProperty, 'init-property', 'init property available on instance (new)'); + assert.equal(myObject.passedProperty, 'passed-property', 'passed property available on instance (new)'); + }); + + QUnit.test('using super', function (assert) { + var calls = []; + + var SuperSuperObject = _emberRuntimeSystemObject.default.extend({ + method: function () { + calls.push('super-super-method'); + } + }); + + var SuperObject = SuperSuperObject.extend({ + method: function () { + this._super(); + calls.push('super-method'); + } + }); + + var MyObject = (function (_SuperObject) { + babelHelpers.inherits(MyObject, _SuperObject); + + function MyObject() { + _SuperObject.apply(this, arguments); + } + + MyObject.prototype.method = function method() { + _SuperObject.prototype.method.call(this); + calls.push('method'); + }; + + return MyObject; + })(SuperObject); + + var myObject = new MyObject(); + myObject.method(); + + assert.deepEqual(calls, ['super-super-method', 'super-method', 'method'], 'chain of prototype methods called with super'); + }); + + QUnit.test('using mixins', function (assert) { + var Mixin1 = _emberMetal.Mixin.create({ + property1: 'data-1' + }); + + var Mixin2 = _emberMetal.Mixin.create({ + property2: 'data-2' + }); + + var MyObject = (function (_EmberObject$extend) { + babelHelpers.inherits(MyObject, _EmberObject$extend); + + function MyObject() { + _EmberObject$extend.apply(this, arguments); + } + + return MyObject; + })(_emberRuntimeSystemObject.default.extend(Mixin1, Mixin2)); + + var myObject = new MyObject(); + assert.equal(myObject.property1, 'data-1', 'includes the first mixin'); + assert.equal(myObject.property2, 'data-2', 'includes the second mixin'); + }); + + QUnit.test('using instanceof', function (assert) { + var MyObject = (function (_EmberObject2) { + babelHelpers.inherits(MyObject, _EmberObject2); + + function MyObject() { + _EmberObject2.apply(this, arguments); + } + + return MyObject; + })(_emberRuntimeSystemObject.default); + + var myObject1 = MyObject.create(); + var myObject2 = new MyObject(); + + assert.ok(myObject1 instanceof MyObject); + assert.ok(myObject1 instanceof _emberRuntimeSystemObject.default); + + assert.ok(myObject2 instanceof MyObject); + assert.ok(myObject2 instanceof _emberRuntimeSystemObject.default); + }); + + QUnit.test('extending an ES subclass of EmberObject', function (assert) { + var calls = []; + + var SubEmberObject = (function (_EmberObject3) { + babelHelpers.inherits(SubEmberObject, _EmberObject3); + + function SubEmberObject() { + calls.push('constructor'); + _EmberObject3.apply(this, arguments); + } + + SubEmberObject.prototype.init = function init() { + var _EmberObject3$prototype$init; + + calls.push('init'); + (_EmberObject3$prototype$init = _EmberObject3.prototype.init).call.apply(_EmberObject3$prototype$init, [this].concat(babelHelpers.slice.call(arguments))); + }; + + return SubEmberObject; + })(_emberRuntimeSystemObject.default); + + var MyObject = (function (_SubEmberObject) { + babelHelpers.inherits(MyObject, _SubEmberObject); + + function MyObject() { + _SubEmberObject.apply(this, arguments); + } + + return MyObject; + })(SubEmberObject); + + MyObject.create(); + assert.deepEqual(calls, ['constructor', 'init'], 'constructor then init called (create)'); + + calls = []; + new MyObject(); + assert.deepEqual(calls, ['constructor', 'init'], 'constructor then init called (new)'); + }); + + // TODO: Needs to be fixed. Currently only `init` is called. + QUnit.skip('calling extend on an ES subclass of EmberObject', function (assert) { + var calls = []; + + var SubEmberObject = (function (_EmberObject4) { + babelHelpers.inherits(SubEmberObject, _EmberObject4); + + function SubEmberObject() { + calls.push('constructor'); + _EmberObject4.apply(this, arguments); + } + + SubEmberObject.prototype.init = function init() { + var _EmberObject4$prototype$init; + + calls.push('init'); + (_EmberObject4$prototype$init = _EmberObject4.prototype.init).call.apply(_EmberObject4$prototype$init, [this].concat(babelHelpers.slice.call(arguments))); + }; + + return SubEmberObject; + })(_emberRuntimeSystemObject.default); + + var MyObject = SubEmberObject.extend({}); + + MyObject.create(); + assert.deepEqual(calls, ['constructor', 'init'], 'constructor then init called (create)'); + + calls = []; + new MyObject(); + assert.deepEqual(calls, ['constructor', 'init'], 'constructor then init called (new)'); }); }); -enifed('ember-runtime/tests/system/object/detect_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/es-compatibility-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/detect_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/es-compatibility-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/detect_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/es-compatibility-test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/events_test', ['exports', 'ember-runtime/system/object', 'ember-runtime/mixins/evented'], function (exports, _emberRuntimeSystemObject, _emberRuntimeMixinsEvented) { @@ -64560,21 +62130,13 @@ enifed('ember-runtime/tests/system/object/events_test', ['exports', 'ember-runti equal(ret, obj, '#one returns self'); }); }); -enifed('ember-runtime/tests/system/object/events_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/events_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/events_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/events_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object/events_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/events_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/events_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/events_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/events_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/extend_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { @@ -64676,21 +62238,13 @@ enifed('ember-runtime/tests/system/object/extend_test', ['exports', 'ember-metal deepEqual(_emberMetal.get(yetAnother.constructor, 'things'), ['foo', 'baz'], 'subclass should have base class\' and its own'); }); }); -enifed('ember-runtime/tests/system/object/extend_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/extend_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/extend_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/extend_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object/extend_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/extend_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/extend_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/extend_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/extend_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/observer_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject) { @@ -64904,21 +62458,13 @@ enifed('ember-runtime/tests/system/object/observer_test', ['exports', 'ember-met equal(changed, true, 'child should have been notified of change to path'); }); }); -enifed('ember-runtime/tests/system/object/observer_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/observer_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/observer_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/observer_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object/observer_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/observer_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/observer_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/observer_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/observer_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/reopenClass_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { @@ -64954,21 +62500,13 @@ enifed('ember-runtime/tests/system/object/reopenClass_test', ['exports', 'ember- equal(_emberMetal.get(SubSub, 'bar'), 'BAR', 'Adds property'); }); }); -enifed('ember-runtime/tests/system/object/reopenClass_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/reopenClass_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/reopenClass_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object/reopenClass_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/reopenClass_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/reopenClass_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/reopenClass_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/reopenClass_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/reopenClass_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/reopen_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { @@ -65016,21 +62554,13 @@ enifed('ember-runtime/tests/system/object/reopen_test', ['exports', 'ember-metal equal(Subclass.create().get('trololol'), true, 'reopen works'); }); }); -enifed('ember-runtime/tests/system/object/reopen_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/reopen_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/reopen_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/reopen_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object/reopen_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/reopen_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/reopen_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/reopen_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/reopen_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/strict-mode-test', ['exports', 'ember-runtime/system/object'], function (exports, _emberRuntimeSystemObject) { @@ -65062,21 +62592,13 @@ enifed('ember-runtime/tests/system/object/strict-mode-test', ['exports', 'ember- equal(bar.callBlah(), 'bar', 'can call local function without call/apply'); }); }); -enifed('ember-runtime/tests/system/object/strict-mode-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/strict-mode-test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/strict-mode-test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object/strict-mode-test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/strict-mode-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/strict-mode-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/strict-mode-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/strict-mode-test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/strict-mode-test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/subclasses_test', ['exports', 'ember-metal', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberRuntimeSystemObject) { @@ -65129,21 +62651,13 @@ enifed('ember-runtime/tests/system/object/subclasses_test', ['exports', 'ember-m equal(subSub.get('greeting'), 'hello world'); }); }); -enifed('ember-runtime/tests/system/object/subclasses_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/subclasses_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/subclasses_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/subclasses_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object/subclasses_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/subclasses_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/subclasses_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/subclasses_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/subclasses_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object/toString_test', ['exports', 'ember-utils', 'ember-environment', 'ember-runtime/system/object', 'ember-runtime/system/namespace'], function (exports, _emberUtils, _emberEnvironment, _emberRuntimeSystemObject, _emberRuntimeSystemNamespace) { @@ -65161,6 +62675,10 @@ enifed('ember-runtime/tests/system/object/toString_test', ['exports', 'ember-uti } }); + QUnit.test('NAME_KEY slot is present on Class', function () { + ok(_emberRuntimeSystemObject.default.extend().hasOwnProperty(_emberUtils.NAME_KEY), 'Ember Class\'s have a NAME_KEY slot'); + }); + QUnit.test('toString() returns the same value if called twice', function () { var Foo = _emberRuntimeSystemNamespace.default.create(); Foo.toString = function () { @@ -65239,28 +62757,20 @@ enifed('ember-runtime/tests/system/object/toString_test', ['exports', 'ember-uti var bar = Bar.create(); // simulate these classes being defined on a Namespace - Foo[_emberUtils.GUID_KEY + '_name'] = 'Foo'; - Bar[_emberUtils.GUID_KEY + '_name'] = 'Bar'; + Foo[_emberUtils.NAME_KEY] = 'Foo'; + Bar[_emberUtils.NAME_KEY] = 'Bar'; equal(bar.toString(), '', 'does not include toStringExtension part'); equal(foo.toString(), '', 'Includes toStringExtension result'); }); }); -enifed('ember-runtime/tests/system/object/toString_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object/toString_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/object'); - test('ember-runtime/tests/system/object/toString_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object/toString_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object/toString_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/object'); - QUnit.test('ember-runtime/tests/system/object/toString_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object/toString_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object/toString_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object/toString_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/object_proxy_test', ['exports', 'ember-metal', 'internal-test-helpers', 'ember-runtime/system/object_proxy'], function (exports, _emberMetal, _internalTestHelpers, _emberRuntimeSystemObject_proxy) { @@ -65460,21 +62970,13 @@ enifed('ember-runtime/tests/system/object_proxy_test', ['exports', 'ember-metal' equal(get(proxyObject, 'prop'), undefined, 'sets the `undefined` value to the proxied content'); }); }); -enifed('ember-runtime/tests/system/object_proxy_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system'); - test('ember-runtime/tests/system/object_proxy_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/object_proxy_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/object_proxy_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/object_proxy_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system'); - QUnit.test('ember-runtime/tests/system/object_proxy_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/object_proxy_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/object_proxy_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/object_proxy_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/string/camelize_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { @@ -65551,21 +63053,13 @@ enifed('ember-runtime/tests/system/string/camelize_test', ['exports', 'ember-env } }); }); -enifed('ember-runtime/tests/system/string/camelize_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/string'); - test('ember-runtime/tests/system/string/camelize_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/string/camelize_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/string/camelize_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/string/camelize_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/string'); - QUnit.test('ember-runtime/tests/system/string/camelize_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/string/camelize_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/string/camelize_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/string/camelize_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/string/capitalize_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { @@ -65635,21 +63129,13 @@ enifed('ember-runtime/tests/system/string/capitalize_test', ['exports', 'ember-e } }); }); -enifed('ember-runtime/tests/system/string/capitalize_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/string/capitalize_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/string'); - test('ember-runtime/tests/system/string/capitalize_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/string/capitalize_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/string/capitalize_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/string'); - QUnit.test('ember-runtime/tests/system/string/capitalize_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/string/capitalize_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/string/capitalize_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/string/capitalize_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/string/classify_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { @@ -65688,21 +63174,13 @@ enifed('ember-runtime/tests/system/string/classify_test', ['exports', 'ember-env test('InnerHTML', 'InnerHTML', 'does nothing with classified string'); test('_FooBar', '_FooBar', 'does nothing with classified prefixed string'); }); -enifed('ember-runtime/tests/system/string/classify_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/string/classify_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/string'); - test('ember-runtime/tests/system/string/classify_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/string/classify_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/string/classify_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/string'); - QUnit.test('ember-runtime/tests/system/string/classify_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/string/classify_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/string/classify_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/string/classify_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/string/dasherize_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { @@ -65772,21 +63250,13 @@ enifed('ember-runtime/tests/system/string/dasherize_test', ['exports', 'ember-en } }); }); -enifed('ember-runtime/tests/system/string/dasherize_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/string/dasherize_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/string'); - test('ember-runtime/tests/system/string/dasherize_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/string/dasherize_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/string/dasherize_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/string'); - QUnit.test('ember-runtime/tests/system/string/dasherize_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/string/dasherize_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/string/dasherize_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/string/dasherize_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/string/decamelize_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { @@ -65849,21 +63319,13 @@ enifed('ember-runtime/tests/system/string/decamelize_test', ['exports', 'ember-e } }); }); -enifed('ember-runtime/tests/system/string/decamelize_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/string'); - test('ember-runtime/tests/system/string/decamelize_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/string/decamelize_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/string/decamelize_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/string/decamelize_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/string'); - QUnit.test('ember-runtime/tests/system/string/decamelize_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/string/decamelize_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/string/decamelize_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/string/decamelize_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/string/fmt_string_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { @@ -65916,21 +63378,13 @@ enifed('ember-runtime/tests/system/string/fmt_string_test', ['exports', 'ember-e equal(_emberRuntimeSystemString.fmt('%@ %@', ['John'], 'Doe'), '[John] Doe'); }); }); -enifed('ember-runtime/tests/system/string/fmt_string_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/string/fmt_string_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/string'); - test('ember-runtime/tests/system/string/fmt_string_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/string/fmt_string_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/string/fmt_string_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/string'); - QUnit.test('ember-runtime/tests/system/string/fmt_string_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/string/fmt_string_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/string/fmt_string_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/string/fmt_string_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/string/loc_test', ['exports', 'ember-metal', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberMetal, _emberEnvironment, _emberRuntimeSystemString) { @@ -65994,21 +63448,13 @@ enifed('ember-runtime/tests/system/string/loc_test', ['exports', 'ember-metal', }); }); // ES6TODO Ember.STRINGS -enifed('ember-runtime/tests/system/string/loc_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/string'); - test('ember-runtime/tests/system/string/loc_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/string/loc_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/string/loc_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/string/loc_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/string'); - QUnit.test('ember-runtime/tests/system/string/loc_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/string/loc_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/string/loc_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/string/loc_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/string/underscore_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { @@ -66071,21 +63517,13 @@ enifed('ember-runtime/tests/system/string/underscore_test', ['exports', 'ember-e } }); }); -enifed('ember-runtime/tests/system/string/underscore_test.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/string/underscore_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime/tests/system/string'); - test('ember-runtime/tests/system/string/underscore_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/string/underscore_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/string/underscore_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime/tests/system/string'); - QUnit.test('ember-runtime/tests/system/string/underscore_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/string/underscore_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/string/underscore_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/string/underscore_test.js should pass ESLint\n\n'); }); }); enifed('ember-runtime/tests/system/string/w_test', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { @@ -66120,429 +63558,238 @@ enifed('ember-runtime/tests/system/string/w_test', ['exports', 'ember-environmen } }); }); -enifed('ember-runtime/tests/system/string/w_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-runtime/tests/system/string'); - test('ember-runtime/tests/system/string/w_test.js should pass jscs', function () { - ok(true, 'ember-runtime/tests/system/string/w_test.js should pass jscs.'); - }); -}); -enifed('ember-runtime/tests/system/string/w_test.jshint', ['exports'], function (exports) { +enifed('ember-runtime/tests/system/string/w_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-runtime/tests/system/string'); - QUnit.test('ember-runtime/tests/system/string/w_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/tests/system/string/w_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/tests/system/string/w_test.js should pass jshint.'); + assert.ok(true, 'ember-runtime/tests/system/string/w_test.js should pass ESLint\n\n'); }); }); -enifed('ember-runtime/utils.jscs-test', ['exports'], function (exports) { +enifed('ember-runtime/utils.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-runtime'); - test('ember-runtime/utils.js should pass jscs', function () { - ok(true, 'ember-runtime/utils.js should pass jscs.'); - }); -}); -enifed('ember-runtime/utils.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-runtime'); - QUnit.test('ember-runtime/utils.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-runtime/utils.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-runtime/utils.js should pass jshint.'); - }); -}); -enifed('ember-template-compiler/compat.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler'); - test('ember-template-compiler/compat.js should pass jscs', function () { - ok(true, 'ember-template-compiler/compat.js should pass jscs.'); + assert.ok(true, 'ember-runtime/utils.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/compat.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/compat.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler'); - QUnit.test('ember-template-compiler/compat.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/compat.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/compat.js should pass jshint.'); - }); -}); -enifed('ember-template-compiler/index.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler'); - test('ember-template-compiler/index.js should pass jscs', function () { - ok(true, 'ember-template-compiler/index.js should pass jscs.'); + assert.ok(true, 'ember-template-compiler/compat.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/index.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/index.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler'); - QUnit.test('ember-template-compiler/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/index.js should pass jshint.'); - }); -}); -enifed('ember-template-compiler/plugins/assert-reserved-named-arguments.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/assert-reserved-named-arguments.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/assert-reserved-named-arguments.js should pass jscs.'); + assert.ok(true, 'ember-template-compiler/index.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/assert-reserved-named-arguments.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/assert-reserved-named-arguments.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/assert-reserved-named-arguments.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/assert-reserved-named-arguments.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/assert-reserved-named-arguments.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/plugins/assert-reserved-named-arguments.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/deprecate-render-model.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/deprecate-render-model.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/deprecate-render-model.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/deprecate-render-model.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/plugins/deprecate-render-model.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/deprecate-render-model.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/deprecate-render-model.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/deprecate-render-model.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/plugins/deprecate-render-model.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/index.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/deprecate-render.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/index.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/index.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/plugins/index.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/deprecate-render.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/index.js should pass jshint.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-action-syntax.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-action-syntax.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-action-syntax.js should pass jscs.'); + assert.ok(true, 'ember-template-compiler/plugins/deprecate-render.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-action-syntax.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/index.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-action-syntax.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-action-syntax.js should pass jshint.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-angle-bracket-components.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-angle-bracket-components.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-angle-bracket-components.js should pass jscs.'); + assert.ok(true, 'ember-template-compiler/plugins/index.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-angle-bracket-components.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-action-syntax.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-angle-bracket-components.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-action-syntax.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-angle-bracket-components.js should pass jshint.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-attrs-into-args.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-attrs-into-args.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-attrs-into-args.js should pass jscs.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-action-syntax.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-attrs-into-args.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-angle-bracket-components.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-attrs-into-args.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-angle-bracket-components.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-attrs-into-args.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-angle-bracket-components.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-each-in-into-each.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-attrs-into-args.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-each-in-into-each.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-each-in-into-each.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-each-in-into-each.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-each-in-into-each.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-attrs-into-args.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-each-in-into-each.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-attrs-into-args.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-has-block-syntax.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-each-in-into-each.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-has-block-syntax.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-has-block-syntax.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-has-block-syntax.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-has-block-syntax.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-each-in-into-each.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-has-block-syntax.js should pass jshint.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-inline-link-to.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-inline-link-to.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-inline-link-to.js should pass jscs.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-each-in-into-each.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-inline-link-to.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-has-block-syntax.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-inline-link-to.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-has-block-syntax.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-inline-link-to.js should pass jshint.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-input-on-to-onEvent.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-input-on-to-onEvent.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-input-on-to-onEvent.js should pass jscs.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-has-block-syntax.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-input-on-to-onEvent.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-inline-link-to.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-input-on-to-onEvent.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-inline-link-to.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-input-on-to-onEvent.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-inline-link-to.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-input-type-syntax.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-input-on-to-onEvent.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-input-type-syntax.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-input-type-syntax.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-input-type-syntax.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-input-type-syntax.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-input-on-to-onEvent.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-input-type-syntax.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-input-on-to-onEvent.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-item-class.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-input-type-syntax.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-item-class.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-item-class.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-item-class.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-item-class.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-input-type-syntax.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-item-class.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-input-type-syntax.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-old-binding-syntax.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-item-class.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-old-binding-syntax.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-old-binding-syntax.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-old-binding-syntax.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-old-binding-syntax.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-item-class.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-old-binding-syntax.js should pass jshint.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-old-class-binding-syntax.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-old-class-binding-syntax.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-old-class-binding-syntax.js should pass jscs.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-item-class.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-old-class-binding-syntax.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-old-binding-syntax.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-old-class-binding-syntax.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-old-binding-syntax.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-old-class-binding-syntax.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-old-binding-syntax.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-old-class-binding-syntax.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-old-class-binding-syntax.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.js should pass jshint.'); - }); -}); -enifed('ember-template-compiler/plugins/transform-top-level-components.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/plugins'); - test('ember-template-compiler/plugins/transform-top-level-components.js should pass jscs', function () { - ok(true, 'ember-template-compiler/plugins/transform-top-level-components.js should pass jscs.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-old-class-binding-syntax.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/plugins/transform-top-level-components.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/plugins'); - QUnit.test('ember-template-compiler/plugins/transform-top-level-components.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/plugins/transform-top-level-components.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-quoted-bindings-into-just-bindings.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/system/bootstrap.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/plugins/transform-top-level-components.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/system'); - test('ember-template-compiler/system/bootstrap.js should pass jscs', function () { - ok(true, 'ember-template-compiler/system/bootstrap.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/system/bootstrap.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-template-compiler/system'); - QUnit.test('ember-template-compiler/system/bootstrap.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/plugins/transform-top-level-components.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/system/bootstrap.js should pass jshint.'); - }); -}); -enifed('ember-template-compiler/system/calculate-location-display.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/system'); - test('ember-template-compiler/system/calculate-location-display.js should pass jscs', function () { - ok(true, 'ember-template-compiler/system/calculate-location-display.js should pass jscs.'); + assert.ok(true, 'ember-template-compiler/plugins/transform-top-level-components.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/system/calculate-location-display.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/system/bootstrap.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/system'); - QUnit.test('ember-template-compiler/system/calculate-location-display.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/system/bootstrap.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/system/calculate-location-display.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/system/bootstrap.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/system/compile-options.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/system/calculate-location-display.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/system'); - test('ember-template-compiler/system/compile-options.js should pass jscs', function () { - ok(true, 'ember-template-compiler/system/compile-options.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/system/compile-options.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-template-compiler/system'); - QUnit.test('ember-template-compiler/system/compile-options.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/system/calculate-location-display.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/system/compile-options.js should pass jshint.'); - }); -}); -enifed('ember-template-compiler/system/compile.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/system'); - test('ember-template-compiler/system/compile.js should pass jscs', function () { - ok(true, 'ember-template-compiler/system/compile.js should pass jscs.'); + assert.ok(true, 'ember-template-compiler/system/calculate-location-display.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/system/compile.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/system/compile-options.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/system'); - QUnit.test('ember-template-compiler/system/compile.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/system/compile-options.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/system/compile.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/system/compile-options.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/system/precompile.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/system/compile.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/system'); - test('ember-template-compiler/system/precompile.js should pass jscs', function () { - ok(true, 'ember-template-compiler/system/precompile.js should pass jscs.'); + QUnit.module('ESLint | ember-template-compiler/system/compile.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/system/compile.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/system/precompile.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/system/precompile.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/system'); - QUnit.test('ember-template-compiler/system/precompile.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/system/precompile.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/system/precompile.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/system/precompile.js should pass ESLint\n\n'); }); }); enifed('ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test', ['exports', 'ember-template-compiler/index'], function (exports, _emberTemplateCompilerIndex) { @@ -66572,21 +63819,13 @@ enifed('ember-template-compiler/tests/plugins/assert-reserved-named-arguments-te }, '\'@foo\' is not a valid path. (\'baz/foo-bar\' @ L1:C17) '); }); }); -enifed('ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/tests/plugins'); - test('ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.js should pass jscs', function () { - ok(true, 'ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/tests/plugins'); - QUnit.test('ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.js should pass ESLint\n\n'); }); }); enifed('ember-template-compiler/tests/plugins/deprecate-render-model-test', ['exports', 'ember-template-compiler/index'], function (exports, _emberTemplateCompilerIndex) { @@ -66606,21 +63845,39 @@ enifed('ember-template-compiler/tests/plugins/deprecate-render-model-test', ['ex }, expectedMessage); }); }); -enifed('ember-template-compiler/tests/plugins/deprecate-render-model-test.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/tests/plugins/deprecate-render-model-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/tests/plugins'); - test('ember-template-compiler/tests/plugins/deprecate-render-model-test.js should pass jscs', function () { - ok(true, 'ember-template-compiler/tests/plugins/deprecate-render-model-test.js should pass jscs.'); + QUnit.module('ESLint | ember-template-compiler/tests/plugins/deprecate-render-model-test.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/tests/plugins/deprecate-render-model-test.js should pass ESLint\n\n'); }); }); -enifed('ember-template-compiler/tests/plugins/deprecate-render-model-test.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/tests/plugins/deprecate-render-test', ['exports', 'ember-template-compiler/index'], function (exports, _emberTemplateCompilerIndex) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/tests/plugins'); - QUnit.test('ember-template-compiler/tests/plugins/deprecate-render-model-test.js should pass jshint', function (assert) { + QUnit.module('ember-template-compiler: deprecate-render'); + + QUnit.test('Using `{{render` without a model provides a deprecation', function () { + expect(1); + + var expectedMessage = 'Please refactor `{{render "foo-bar"}}` to a component and' + ' invoke via `{{foo-bar}}`. (\'baz/foo-bar\' @ L1:C0) '; + + expectDeprecation(function () { + _emberTemplateCompilerIndex.compile('{{render "foo-bar"}}', { + moduleName: 'baz/foo-bar' + }); + }, expectedMessage); + }); +}); +enifed('ember-template-compiler/tests/plugins/deprecate-render-test.lint-test', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('ESLint | ember-template-compiler/tests/plugins/deprecate-render-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/tests/plugins/deprecate-render-model-test.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/tests/plugins/deprecate-render-test.js should pass ESLint\n\n'); }); }); enifed('ember-template-compiler/tests/plugins/transform-inline-link-to-test', ['exports', 'ember-template-compiler/index'], function (exports, _emberTemplateCompilerIndex) { @@ -66636,21 +63893,13 @@ enifed('ember-template-compiler/tests/plugins/transform-inline-link-to-test', [' }); }); }); -enifed('ember-template-compiler/tests/plugins/transform-inline-link-to-test.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/tests/plugins/transform-inline-link-to-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-template-compiler/tests/plugins'); - test('ember-template-compiler/tests/plugins/transform-inline-link-to-test.js should pass jscs', function () { - ok(true, 'ember-template-compiler/tests/plugins/transform-inline-link-to-test.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/tests/plugins/transform-inline-link-to-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-template-compiler/tests/plugins'); - QUnit.test('ember-template-compiler/tests/plugins/transform-inline-link-to-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/tests/plugins/transform-inline-link-to-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/tests/plugins/transform-inline-link-to-test.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/tests/plugins/transform-inline-link-to-test.js should pass ESLint\n\n'); }); }); enifed('ember-template-compiler/tests/plugins/transform-input-on-test', ['exports', 'ember-template-compiler/index'], function (exports, _emberTemplateCompilerIndex) { @@ -66698,21 +63947,45 @@ enifed('ember-template-compiler/tests/plugins/transform-input-on-test', ['export }, 'Using \'{{input on="asdf" ...}}\' without specifying an action (\'foo/bar/baz\' @ L1:C0) will do nothing.'); }); }); -enifed('ember-template-compiler/tests/plugins/transform-input-on-test.jscs-test', ['exports'], function (exports) { +enifed('ember-template-compiler/tests/plugins/transform-input-on-test.lint-test', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('ESLint | ember-template-compiler/tests/plugins/transform-input-on-test.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-template-compiler/tests/plugins/transform-input-on-test.js should pass ESLint\n\n'); + }); +}); +enifed('ember-template-compiler/tests/plugins/transform-input-type-syntax-test', ['exports', 'ember-template-compiler/index'], function (exports, _emberTemplateCompilerIndex) { 'use strict'; - module('JSCS - ember-template-compiler/tests/plugins'); - test('ember-template-compiler/tests/plugins/transform-input-on-test.js should pass jscs', function () { - ok(true, 'ember-template-compiler/tests/plugins/transform-input-on-test.js should pass jscs.'); + QUnit.module('ember-template-compiler: input type syntax'); + + QUnit.test('Can compile an {{input}} helper that has a sub-expression value as its type', function () { + expect(0); + + _emberTemplateCompilerIndex.compile('{{input type=(if true \'password\' \'text\')}}'); + }); + + QUnit.test('Can compile an {{input}} helper with a string literal type', function () { + expect(0); + + _emberTemplateCompilerIndex.compile('{{input type=\'text\'}}'); + }); + + QUnit.test('Can compile an {{input}} helper with a type stored in a var', function () { + expect(0); + + _emberTemplateCompilerIndex.compile('{{input type=_type}}'); }); }); -enifed('ember-template-compiler/tests/plugins/transform-input-on-test.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/tests/plugins/transform-input-type-syntax-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/tests/plugins'); - QUnit.test('ember-template-compiler/tests/plugins/transform-input-on-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/tests/plugins/transform-input-type-syntax-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/tests/plugins/transform-input-on-test.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/tests/plugins/transform-input-type-syntax-test.js should pass ESLint\n\n'); }); }); enifed('ember-template-compiler/tests/system/bootstrap-test', ['exports', 'ember-metal', 'ember-views', 'ember-glimmer', 'ember-template-compiler/system/bootstrap', 'internal-test-helpers'], function (exports, _emberMetal, _emberViews, _emberGlimmer, _emberTemplateCompilerSystemBootstrap, _internalTestHelpers) { @@ -66833,21 +64106,13 @@ enifed('ember-template-compiler/tests/system/bootstrap-test', ['exports', 'ember }, /Template named "[^"]+" already exists\./, 'duplicate templates should not be allowed'); }); }); -enifed('ember-template-compiler/tests/system/bootstrap-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/tests/system'); - test('ember-template-compiler/tests/system/bootstrap-test.js should pass jscs', function () { - ok(true, 'ember-template-compiler/tests/system/bootstrap-test.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/tests/system/bootstrap-test.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/tests/system/bootstrap-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/tests/system'); - QUnit.test('ember-template-compiler/tests/system/bootstrap-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/tests/system/bootstrap-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/tests/system/bootstrap-test.js should pass jshint.'); + assert.ok(true, 'ember-template-compiler/tests/system/bootstrap-test.js should pass ESLint\n\n'); }); }); enifed('ember-template-compiler/tests/system/compile_options_test', ['exports', 'ember-template-compiler/index'], function (exports, _emberTemplateCompilerIndex) { @@ -66870,548 +64135,292 @@ enifed('ember-template-compiler/tests/system/compile_options_test', ['exports', } }); }); -enifed('ember-template-compiler/tests/system/compile_options_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-template-compiler/tests/system'); - test('ember-template-compiler/tests/system/compile_options_test.js should pass jscs', function () { - ok(true, 'ember-template-compiler/tests/system/compile_options_test.js should pass jscs.'); - }); -}); -enifed('ember-template-compiler/tests/system/compile_options_test.jshint', ['exports'], function (exports) { +enifed('ember-template-compiler/tests/system/compile_options_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-template-compiler/tests/system'); - QUnit.test('ember-template-compiler/tests/system/compile_options_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-template-compiler/tests/system/compile_options_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-template-compiler/tests/system/compile_options_test.js should pass jshint.'); - }); -}); -enifed('ember-testing/adapters/adapter.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/adapters'); - test('ember-testing/adapters/adapter.js should pass jscs', function () { - ok(true, 'ember-testing/adapters/adapter.js should pass jscs.'); + assert.ok(true, 'ember-template-compiler/tests/system/compile_options_test.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/adapters/adapter.jshint', ['exports'], function (exports) { +enifed('ember-testing/adapters/adapter.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/adapters'); - QUnit.test('ember-testing/adapters/adapter.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/adapters/adapter.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/adapters/adapter.js should pass jshint.'); + assert.ok(true, 'ember-testing/adapters/adapter.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/adapters/qunit.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/adapters/qunit.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/adapters'); - test('ember-testing/adapters/qunit.js should pass jscs', function () { - ok(true, 'ember-testing/adapters/qunit.js should pass jscs.'); - }); -}); -enifed('ember-testing/adapters/qunit.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/adapters'); - QUnit.test('ember-testing/adapters/qunit.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/adapters/qunit.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/adapters/qunit.js should pass jshint.'); + assert.ok(true, 'ember-testing/adapters/qunit.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/events.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/events.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing'); - test('ember-testing/events.js should pass jscs', function () { - ok(true, 'ember-testing/events.js should pass jscs.'); - }); -}); -enifed('ember-testing/events.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing'); - QUnit.test('ember-testing/events.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/events.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/events.js should pass jshint.'); - }); -}); -enifed('ember-testing/ext/application.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/ext'); - test('ember-testing/ext/application.js should pass jscs', function () { - ok(true, 'ember-testing/ext/application.js should pass jscs.'); + assert.ok(true, 'ember-testing/events.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/ext/application.jshint', ['exports'], function (exports) { +enifed('ember-testing/ext/application.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/ext'); - QUnit.test('ember-testing/ext/application.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/ext/application.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/ext/application.js should pass jshint.'); - }); -}); -enifed('ember-testing/ext/rsvp.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/ext'); - test('ember-testing/ext/rsvp.js should pass jscs', function () { - ok(true, 'ember-testing/ext/rsvp.js should pass jscs.'); + assert.ok(true, 'ember-testing/ext/application.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/ext/rsvp.jshint', ['exports'], function (exports) { +enifed('ember-testing/ext/rsvp.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/ext'); - QUnit.test('ember-testing/ext/rsvp.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/ext/rsvp.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/ext/rsvp.js should pass jshint.'); - }); -}); -enifed('ember-testing/helpers.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing'); - test('ember-testing/helpers.js should pass jscs', function () { - ok(true, 'ember-testing/helpers.js should pass jscs.'); + assert.ok(true, 'ember-testing/ext/rsvp.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers.jshint', ['exports'], function (exports) { +enifed('ember-testing/helpers.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing'); - QUnit.test('ember-testing/helpers.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers.js should pass jshint.'); + assert.ok(true, 'ember-testing/helpers.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/and_then.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/helpers/and_then.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/and_then.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/and_then.js should pass jscs.'); - }); -}); -enifed('ember-testing/helpers/and_then.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/and_then.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/and_then.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/and_then.js should pass jshint.'); + assert.ok(true, 'ember-testing/helpers/and_then.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/click.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/helpers/click.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/click.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/click.js should pass jscs.'); - }); -}); -enifed('ember-testing/helpers/click.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/click.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/click.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/click.js should pass jshint.'); - }); -}); -enifed('ember-testing/helpers/current_path.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/current_path.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/current_path.js should pass jscs.'); + assert.ok(true, 'ember-testing/helpers/click.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/current_path.jshint', ['exports'], function (exports) { +enifed('ember-testing/helpers/current_path.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/current_path.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/current_path.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/current_path.js should pass jshint.'); - }); -}); -enifed('ember-testing/helpers/current_route_name.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/current_route_name.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/current_route_name.js should pass jscs.'); + assert.ok(true, 'ember-testing/helpers/current_path.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/current_route_name.jshint', ['exports'], function (exports) { +enifed('ember-testing/helpers/current_route_name.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/current_route_name.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/current_route_name.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/current_route_name.js should pass jshint.'); + assert.ok(true, 'ember-testing/helpers/current_route_name.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/current_url.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/helpers/current_url.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/current_url.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/current_url.js should pass jscs.'); - }); -}); -enifed('ember-testing/helpers/current_url.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/current_url.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/current_url.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/current_url.js should pass jshint.'); + assert.ok(true, 'ember-testing/helpers/current_url.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/fill_in.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/helpers/fill_in.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/fill_in.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/fill_in.js should pass jscs.'); - }); -}); -enifed('ember-testing/helpers/fill_in.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/fill_in.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/fill_in.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/fill_in.js should pass jshint.'); + assert.ok(true, 'ember-testing/helpers/fill_in.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/find.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/helpers/find.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/find.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/find.js should pass jscs.'); - }); -}); -enifed('ember-testing/helpers/find.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/find.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/find.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/find.js should pass jshint.'); - }); -}); -enifed('ember-testing/helpers/find_with_assert.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/find_with_assert.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/find_with_assert.js should pass jscs.'); + assert.ok(true, 'ember-testing/helpers/find.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/find_with_assert.jshint', ['exports'], function (exports) { +enifed('ember-testing/helpers/find_with_assert.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/find_with_assert.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/find_with_assert.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/find_with_assert.js should pass jshint.'); + assert.ok(true, 'ember-testing/helpers/find_with_assert.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/key_event.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/helpers/key_event.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/key_event.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/key_event.js should pass jscs.'); - }); -}); -enifed('ember-testing/helpers/key_event.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/key_event.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/key_event.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/key_event.js should pass jshint.'); - }); -}); -enifed('ember-testing/helpers/pause_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/pause_test.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/pause_test.js should pass jscs.'); + assert.ok(true, 'ember-testing/helpers/key_event.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/pause_test.jshint', ['exports'], function (exports) { +enifed('ember-testing/helpers/pause_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/pause_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/pause_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/pause_test.js should pass jshint.'); + assert.ok(true, 'ember-testing/helpers/pause_test.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/trigger_event.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/helpers/trigger_event.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/trigger_event.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/trigger_event.js should pass jscs.'); - }); -}); -enifed('ember-testing/helpers/trigger_event.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/trigger_event.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/trigger_event.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/trigger_event.js should pass jshint.'); - }); -}); -enifed('ember-testing/helpers/visit.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/visit.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/visit.js should pass jscs.'); + assert.ok(true, 'ember-testing/helpers/trigger_event.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/visit.jshint', ['exports'], function (exports) { +enifed('ember-testing/helpers/visit.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/visit.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/visit.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/visit.js should pass jshint.'); + assert.ok(true, 'ember-testing/helpers/visit.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/helpers/wait.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/helpers/wait.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/helpers'); - test('ember-testing/helpers/wait.js should pass jscs', function () { - ok(true, 'ember-testing/helpers/wait.js should pass jscs.'); - }); -}); -enifed('ember-testing/helpers/wait.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/helpers'); - QUnit.test('ember-testing/helpers/wait.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/helpers/wait.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/helpers/wait.js should pass jshint.'); - }); -}); -enifed('ember-testing/index.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing'); - test('ember-testing/index.js should pass jscs', function () { - ok(true, 'ember-testing/index.js should pass jscs.'); + assert.ok(true, 'ember-testing/helpers/wait.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/index.jshint', ['exports'], function (exports) { +enifed('ember-testing/index.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing'); - QUnit.test('ember-testing/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/index.js should pass jshint.'); - }); -}); -enifed('ember-testing/initializers.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing'); - test('ember-testing/initializers.js should pass jscs', function () { - ok(true, 'ember-testing/initializers.js should pass jscs.'); + assert.ok(true, 'ember-testing/index.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/initializers.jshint', ['exports'], function (exports) { +enifed('ember-testing/initializers.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing'); - QUnit.test('ember-testing/initializers.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/initializers.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/initializers.js should pass jshint.'); - }); -}); -enifed('ember-testing/setup_for_testing.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing'); - test('ember-testing/setup_for_testing.js should pass jscs', function () { - ok(true, 'ember-testing/setup_for_testing.js should pass jscs.'); + assert.ok(true, 'ember-testing/initializers.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/setup_for_testing.jshint', ['exports'], function (exports) { +enifed('ember-testing/setup_for_testing.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing'); - QUnit.test('ember-testing/setup_for_testing.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/setup_for_testing.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/setup_for_testing.js should pass jshint.'); + assert.ok(true, 'ember-testing/setup_for_testing.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/support.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/support.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing'); - test('ember-testing/support.js should pass jscs', function () { - ok(true, 'ember-testing/support.js should pass jscs.'); - }); -}); -enifed('ember-testing/support.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing'); - QUnit.test('ember-testing/support.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/support.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/support.js should pass jshint.'); + assert.ok(true, 'ember-testing/support.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/test.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing'); - test('ember-testing/test.js should pass jscs', function () { - ok(true, 'ember-testing/test.js should pass jscs.'); - }); -}); -enifed('ember-testing/test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing'); - QUnit.test('ember-testing/test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/test.js should pass jshint.'); - }); -}); -enifed('ember-testing/test/adapter.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/test'); - test('ember-testing/test/adapter.js should pass jscs', function () { - ok(true, 'ember-testing/test/adapter.js should pass jscs.'); + assert.ok(true, 'ember-testing/test.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/test/adapter.jshint', ['exports'], function (exports) { +enifed('ember-testing/test/adapter.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/test'); - QUnit.test('ember-testing/test/adapter.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/test/adapter.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/test/adapter.js should pass jshint.'); - }); -}); -enifed('ember-testing/test/helpers.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/test'); - test('ember-testing/test/helpers.js should pass jscs', function () { - ok(true, 'ember-testing/test/helpers.js should pass jscs.'); + assert.ok(true, 'ember-testing/test/adapter.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/test/helpers.jshint', ['exports'], function (exports) { +enifed('ember-testing/test/helpers.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/test'); - QUnit.test('ember-testing/test/helpers.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/test/helpers.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/test/helpers.js should pass jshint.'); - }); -}); -enifed('ember-testing/test/on_inject_helpers.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/test'); - test('ember-testing/test/on_inject_helpers.js should pass jscs', function () { - ok(true, 'ember-testing/test/on_inject_helpers.js should pass jscs.'); + assert.ok(true, 'ember-testing/test/helpers.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/test/on_inject_helpers.jshint', ['exports'], function (exports) { +enifed('ember-testing/test/on_inject_helpers.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/test'); - QUnit.test('ember-testing/test/on_inject_helpers.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/test/on_inject_helpers.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/test/on_inject_helpers.js should pass jshint.'); + assert.ok(true, 'ember-testing/test/on_inject_helpers.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/test/pending_requests.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/test/pending_requests.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/test'); - test('ember-testing/test/pending_requests.js should pass jscs', function () { - ok(true, 'ember-testing/test/pending_requests.js should pass jscs.'); - }); -}); -enifed('ember-testing/test/pending_requests.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/test'); - QUnit.test('ember-testing/test/pending_requests.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/test/pending_requests.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/test/pending_requests.js should pass jshint.'); + assert.ok(true, 'ember-testing/test/pending_requests.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/test/promise.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/test/promise.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/test'); - test('ember-testing/test/promise.js should pass jscs', function () { - ok(true, 'ember-testing/test/promise.js should pass jscs.'); - }); -}); -enifed('ember-testing/test/promise.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/test'); - QUnit.test('ember-testing/test/promise.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/test/promise.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/test/promise.js should pass jshint.'); - }); -}); -enifed('ember-testing/test/run.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/test'); - test('ember-testing/test/run.js should pass jscs', function () { - ok(true, 'ember-testing/test/run.js should pass jscs.'); + assert.ok(true, 'ember-testing/test/promise.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/test/run.jshint', ['exports'], function (exports) { +enifed('ember-testing/test/run.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/test'); - QUnit.test('ember-testing/test/run.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/test/run.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/test/run.js should pass jshint.'); - }); -}); -enifed('ember-testing/test/waiters.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/test'); - test('ember-testing/test/waiters.js should pass jscs', function () { - ok(true, 'ember-testing/test/waiters.js should pass jscs.'); + assert.ok(true, 'ember-testing/test/run.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/test/waiters.jshint', ['exports'], function (exports) { +enifed('ember-testing/test/waiters.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/test'); - QUnit.test('ember-testing/test/waiters.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/test/waiters.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/test/waiters.js should pass jshint.'); + assert.ok(true, 'ember-testing/test/waiters.js should pass ESLint\n\n'); }); }); enifed('ember-testing/tests/acceptance_test', ['exports', 'ember-metal', 'ember-views', 'ember-testing/test', 'ember-testing/adapters/qunit', 'ember-testing/initializers', 'ember-application', 'ember-routing', 'ember-template-compiler', 'ember-runtime', 'ember-glimmer'], function (exports, _emberMetal, _emberViews, _emberTestingTest, _emberTestingAdaptersQunit, _emberTestingInitializers, _emberApplication, _emberRouting, _emberTemplateCompiler, _emberRuntime, _emberGlimmer) { @@ -67810,21 +64819,13 @@ enifed('ember-testing/tests/acceptance_test', ['exports', 'ember-metal', 'ember- }); }); // ensure the initializer is setup -enifed('ember-testing/tests/acceptance_test.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/tests/acceptance_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/tests'); - test('ember-testing/tests/acceptance_test.js should pass jscs', function () { - ok(true, 'ember-testing/tests/acceptance_test.js should pass jscs.'); - }); -}); -enifed('ember-testing/tests/acceptance_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/tests'); - QUnit.test('ember-testing/tests/acceptance_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/tests/acceptance_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/tests/acceptance_test.js should pass jshint.'); + assert.ok(true, 'ember-testing/tests/acceptance_test.js should pass ESLint\n\n'); }); }); enifed('ember-testing/tests/adapters/adapter_test', ['exports', 'ember-metal', 'ember-testing/adapters/adapter'], function (exports, _emberMetal, _emberTestingAdaptersAdapter) { @@ -67862,21 +64863,13 @@ enifed('ember-testing/tests/adapters/adapter_test', ['exports', 'ember-metal', ' equal(thrown, error); }); }); -enifed('ember-testing/tests/adapters/adapter_test.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/tests/adapters/adapter_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/tests/adapters'); - test('ember-testing/tests/adapters/adapter_test.js should pass jscs', function () { - ok(true, 'ember-testing/tests/adapters/adapter_test.js should pass jscs.'); - }); -}); -enifed('ember-testing/tests/adapters/adapter_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/tests/adapters'); - QUnit.test('ember-testing/tests/adapters/adapter_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/tests/adapters/adapter_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/tests/adapters/adapter_test.js should pass jshint.'); + assert.ok(true, 'ember-testing/tests/adapters/adapter_test.js should pass ESLint\n\n'); }); }); enifed('ember-testing/tests/adapters/qunit_test', ['exports', 'ember-metal', 'ember-testing/adapters/qunit'], function (exports, _emberMetal, _emberTestingAdaptersQunit) { @@ -67931,31 +64924,24 @@ enifed('ember-testing/tests/adapters/qunit_test', ['exports', 'ember-metal', 'em } }); }); -enifed('ember-testing/tests/adapters/qunit_test.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/tests/adapters/qunit_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/tests/adapters'); - test('ember-testing/tests/adapters/qunit_test.js should pass jscs', function () { - ok(true, 'ember-testing/tests/adapters/qunit_test.js should pass jscs.'); - }); -}); -enifed('ember-testing/tests/adapters/qunit_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/tests/adapters'); - QUnit.test('ember-testing/tests/adapters/qunit_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/tests/adapters/qunit_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/tests/adapters/qunit_test.js should pass jshint.'); + assert.ok(true, 'ember-testing/tests/adapters/qunit_test.js should pass ESLint\n\n'); }); }); enifed('ember-testing/tests/adapters_test', ['exports', 'ember-metal', 'ember-testing/test', 'ember-testing/adapters/adapter', 'ember-testing/adapters/qunit', 'ember-application'], function (exports, _emberMetal, _emberTestingTest, _emberTestingAdaptersAdapter, _emberTestingAdaptersQunit, _emberApplication) { 'use strict'; - var App, originalAdapter; + var App, originalAdapter, originalQUnit; QUnit.module('ember-testing Adapters', { setup: function () { originalAdapter = _emberTestingTest.default.adapter; + originalQUnit = window.QUnit; }, teardown: function () { _emberMetal.run(App, App.destroy); @@ -67963,6 +64949,7 @@ enifed('ember-testing/tests/adapters_test', ['exports', 'ember-metal', 'ember-te App = null; _emberTestingTest.default.adapter = originalAdapter; + window.QUnit = originalQUnit; } }); @@ -67985,7 +64972,7 @@ enifed('ember-testing/tests/adapters_test', ['exports', 'ember-metal', 'ember-te _emberTestingTest.default.adapter.asyncStart(); }); - QUnit.test('QUnitAdapter is used by default', function () { + QUnit.test('QUnitAdapter is used by default (if QUnit is available)', function () { expect(1); _emberTestingTest.default.adapter = null; @@ -67997,22 +64984,30 @@ enifed('ember-testing/tests/adapters_test', ['exports', 'ember-metal', 'ember-te ok(_emberTestingTest.default.adapter instanceof _emberTestingAdaptersQunit.default); }); -}); -enifed('ember-testing/tests/adapters_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - module('JSCS - ember-testing/tests'); - test('ember-testing/tests/adapters_test.js should pass jscs', function () { - ok(true, 'ember-testing/tests/adapters_test.js should pass jscs.'); + QUnit.test('Adapter is used by default (if QUnit is not available)', function () { + expect(2); + + delete window.QUnit; + + _emberTestingTest.default.adapter = null; + + _emberMetal.run(function () { + App = _emberApplication.Application.create(); + App.setupForTesting(); + }); + + ok(_emberTestingTest.default.adapter instanceof _emberTestingAdaptersAdapter.default); + ok(!(_emberTestingTest.default.adapter instanceof _emberTestingAdaptersQunit.default)); }); }); -enifed('ember-testing/tests/adapters_test.jshint', ['exports'], function (exports) { +enifed('ember-testing/tests/adapters_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/tests'); - QUnit.test('ember-testing/tests/adapters_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/tests/adapters_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/tests/adapters_test.js should pass jshint.'); + assert.ok(true, 'ember-testing/tests/adapters_test.js should pass ESLint\n\n'); }); }); enifed('ember-testing/tests/ext/rsvp_test', ['exports', 'ember-testing/ext/rsvp', 'ember-testing/test/adapter', 'ember-metal'], function (exports, _emberTestingExtRsvp, _emberTestingTestAdapter, _emberMetal) { @@ -68100,21 +65095,13 @@ enifed('ember-testing/tests/ext/rsvp_test', ['exports', 'ember-testing/ext/rsvp' }); }); }); -enifed('ember-testing/tests/ext/rsvp_test.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/tests/ext/rsvp_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/tests/ext'); - test('ember-testing/tests/ext/rsvp_test.js should pass jscs', function () { - ok(true, 'ember-testing/tests/ext/rsvp_test.js should pass jscs.'); - }); -}); -enifed('ember-testing/tests/ext/rsvp_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/tests/ext'); - QUnit.test('ember-testing/tests/ext/rsvp_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/tests/ext/rsvp_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/tests/ext/rsvp_test.js should pass jshint.'); + assert.ok(true, 'ember-testing/tests/ext/rsvp_test.js should pass ESLint\n\n'); }); }); enifed('ember-testing/tests/helper_registration_test', ['exports', 'ember-metal', 'ember-testing/test', 'ember-application'], function (exports, _emberMetal, _emberTestingTest, _emberApplication) { @@ -68200,21 +65187,13 @@ enifed('ember-testing/tests/helper_registration_test', ['exports', 'ember-metal' ok(!helperContainer.boot, 'once unregistered the helper is not added to the helperContainer'); }); }); -enifed('ember-testing/tests/helper_registration_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/tests'); - test('ember-testing/tests/helper_registration_test.js should pass jscs', function () { - ok(true, 'ember-testing/tests/helper_registration_test.js should pass jscs.'); - }); -}); -enifed('ember-testing/tests/helper_registration_test.jshint', ['exports'], function (exports) { +enifed('ember-testing/tests/helper_registration_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/tests'); - QUnit.test('ember-testing/tests/helper_registration_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/tests/helper_registration_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/tests/helper_registration_test.js should pass jshint.'); + assert.ok(true, 'ember-testing/tests/helper_registration_test.js should pass ESLint\n\n'); }); }); enifed('ember-testing/tests/helpers_test', ['exports', 'ember-routing', 'ember-runtime', 'ember-metal', 'ember-views', 'ember-glimmer', 'ember-testing/test', 'ember-testing/helpers', 'ember-testing/initializers', 'ember-testing/setup_for_testing', 'ember-application', 'ember-template-compiler', 'ember-testing/test/pending_requests', 'ember-testing/test/adapter', 'ember-testing/test/waiters'], function (exports, _emberRouting, _emberRuntime, _emberMetal, _emberViews, _emberGlimmer, _emberTestingTest, _emberTestingHelpers, _emberTestingInitializers, _emberTestingSetup_for_testing, _emberApplication, _emberTemplateCompiler, _emberTestingTestPending_requests, _emberTestingTestAdapter, _emberTestingTestWaiters) { @@ -68822,7 +65801,7 @@ enifed('ember-testing/tests/helpers_test', ['exports', 'ember-routing', 'ember-r QUnit.test('`fillIn` takes context into consideration', function () { expect(2); - var fillIn, find, visit, andThen, wait; + var fillIn, find, visit, andThen; _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('
    {{input type="text" id="first" class="current"}}
    {{input type="text" id="second" class="current"}}')); @@ -68832,7 +65811,6 @@ enifed('ember-testing/tests/helpers_test', ['exports', 'ember-routing', 'ember-r find = App.testHelpers.find; visit = App.testHelpers.visit; andThen = App.testHelpers.andThen; - wait = App.testHelpers.wait; visit('/'); fillIn('.current', '#parent', 'current value'); @@ -68996,7 +65974,7 @@ enifed('ember-testing/tests/helpers_test', ['exports', 'ember-routing', 'ember-r App.testHelpers.pauseTest(); }); - if (false) { + if (_emberMetal.isFeatureEnabled('ember-testing-resume-test')) { QUnit.test('resumeTest resumes paused tests', function () { expect(1); @@ -69263,21 +66241,13 @@ enifed('ember-testing/tests/helpers_test', ['exports', 'ember-routing', 'ember-r }); // ensure that the helpers are loaded // ensure the initializer is setup -enifed('ember-testing/tests/helpers_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/tests'); - test('ember-testing/tests/helpers_test.js should pass jscs', function () { - ok(true, 'ember-testing/tests/helpers_test.js should pass jscs.'); - }); -}); -enifed('ember-testing/tests/helpers_test.jshint', ['exports'], function (exports) { +enifed('ember-testing/tests/helpers_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/tests'); - QUnit.test('ember-testing/tests/helpers_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/tests/helpers_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/tests/helpers_test.js should pass jshint.'); + assert.ok(true, 'ember-testing/tests/helpers_test.js should pass ESLint\n\n'); }); }); enifed('ember-testing/tests/integration_test', ['exports', 'ember-metal', 'ember-runtime', 'ember-views', 'ember-testing/test', 'ember-routing', 'ember-application', 'ember-template-compiler', 'ember-glimmer'], function (exports, _emberMetal, _emberRuntime, _emberViews, _emberTestingTest, _emberRouting, _emberApplication, _emberTemplateCompiler, _emberGlimmer) { @@ -69391,21 +66361,13 @@ enifed('ember-testing/tests/integration_test', ['exports', 'ember-metal', 'ember }); }); }); -enifed('ember-testing/tests/integration_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/tests'); - test('ember-testing/tests/integration_test.js should pass jscs', function () { - ok(true, 'ember-testing/tests/integration_test.js should pass jscs.'); - }); -}); -enifed('ember-testing/tests/integration_test.jshint', ['exports'], function (exports) { +enifed('ember-testing/tests/integration_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/tests'); - QUnit.test('ember-testing/tests/integration_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/tests/integration_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/tests/integration_test.js should pass jshint.'); + assert.ok(true, 'ember-testing/tests/integration_test.js should pass ESLint\n\n'); }); }); enifed('ember-testing/tests/reexports_test', ['exports', 'ember', 'internal-test-helpers'], function (exports, _ember, _internalTestHelpers) { @@ -69430,21 +66392,13 @@ enifed('ember-testing/tests/reexports_test', ['exports', 'ember', 'internal-test }); }); }); -enifed('ember-testing/tests/reexports_test.jscs-test', ['exports'], function (exports) { +enifed('ember-testing/tests/reexports_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-testing/tests'); - test('ember-testing/tests/reexports_test.js should pass jscs', function () { - ok(true, 'ember-testing/tests/reexports_test.js should pass jscs.'); - }); -}); -enifed('ember-testing/tests/reexports_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-testing/tests'); - QUnit.test('ember-testing/tests/reexports_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/tests/reexports_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/tests/reexports_test.js should pass jshint.'); + assert.ok(true, 'ember-testing/tests/reexports_test.js should pass ESLint\n\n'); }); }); enifed('ember-testing/tests/simple_setup', ['exports', 'ember-metal', 'ember-views'], function (exports, _emberMetal, _emberViews) { @@ -69463,24 +66417,16 @@ enifed('ember-testing/tests/simple_setup', ['exports', 'ember-metal', 'ember-vie } }); }); -enifed('ember-testing/tests/simple_setup.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/tests'); - test('ember-testing/tests/simple_setup.js should pass jscs', function () { - ok(true, 'ember-testing/tests/simple_setup.js should pass jscs.'); - }); -}); -enifed('ember-testing/tests/simple_setup.jshint', ['exports'], function (exports) { +enifed('ember-testing/tests/simple_setup.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/tests'); - QUnit.test('ember-testing/tests/simple_setup.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/tests/simple_setup.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/tests/simple_setup.js should pass jshint.'); + assert.ok(true, 'ember-testing/tests/simple_setup.js should pass ESLint\n\n'); }); }); -enifed('ember-testing/tests/test/waiters-test', ['exports', 'ember-metal', 'ember-testing/test/waiters'], function (exports, _emberMetal, _emberTestingTestWaiters) { +enifed('ember-testing/tests/test/waiters-test', ['exports', 'ember-testing/test/waiters'], function (exports, _emberTestingTestWaiters) { 'use strict'; var Waiters = (function () { @@ -69634,270 +66580,164 @@ enifed('ember-testing/tests/test/waiters-test', ['exports', 'ember-metal', 'embe this.waiters.register(); var waiters = undefined; - if (true) { - expectDeprecation(function () { - waiters = _emberTestingTestWaiters.generateDeprecatedWaitersArray(); - }, /Usage of `Ember.Test.waiters` is deprecated/); - } else { + expectDeprecation(function () { waiters = _emberTestingTestWaiters.generateDeprecatedWaitersArray(); - } + }, /Usage of `Ember.Test.waiters` is deprecated/); assert.deepEqual(waiters, [[null, waiter1], [null, waiter2]]); }); }); -enifed('ember-testing/tests/test/waiters-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-testing/tests/test'); - test('ember-testing/tests/test/waiters-test.js should pass jscs', function () { - ok(true, 'ember-testing/tests/test/waiters-test.js should pass jscs.'); - }); -}); -enifed('ember-testing/tests/test/waiters-test.jshint', ['exports'], function (exports) { +enifed('ember-testing/tests/test/waiters-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-testing/tests/test'); - QUnit.test('ember-testing/tests/test/waiters-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-testing/tests/test/waiters-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-testing/tests/test/waiters-test.js should pass jshint.'); + assert.ok(true, 'ember-testing/tests/test/waiters-test.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/apply-str.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/apply-str.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils'); - test('ember-utils/apply-str.js should pass jscs', function () { - ok(true, 'ember-utils/apply-str.js should pass jscs.'); - }); -}); -enifed('ember-utils/apply-str.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/apply-str.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/apply-str.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/apply-str.js should pass jshint.'); - }); -}); -enifed('ember-utils/assign.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-utils'); - test('ember-utils/assign.js should pass jscs', function () { - ok(true, 'ember-utils/assign.js should pass jscs.'); + assert.ok(true, 'ember-utils/apply-str.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/assign.jshint', ['exports'], function (exports) { +enifed('ember-utils/assign.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/assign.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/assign.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/assign.js should pass jshint.'); + assert.ok(true, 'ember-utils/assign.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/dictionary.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/dictionary.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils'); - test('ember-utils/dictionary.js should pass jscs', function () { - ok(true, 'ember-utils/dictionary.js should pass jscs.'); - }); -}); -enifed('ember-utils/dictionary.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/dictionary.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/dictionary.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/dictionary.js should pass jshint.'); + assert.ok(true, 'ember-utils/dictionary.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/empty-object.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/empty-object.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils'); - test('ember-utils/empty-object.js should pass jscs', function () { - ok(true, 'ember-utils/empty-object.js should pass jscs.'); - }); -}); -enifed('ember-utils/empty-object.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/empty-object.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/empty-object.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/empty-object.js should pass jshint.'); + assert.ok(true, 'ember-utils/empty-object.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/guid.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/guid.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils'); - test('ember-utils/guid.js should pass jscs', function () { - ok(true, 'ember-utils/guid.js should pass jscs.'); - }); -}); -enifed('ember-utils/guid.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/guid.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/guid.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/guid.js should pass jshint.'); - }); -}); -enifed('ember-utils/index.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-utils'); - test('ember-utils/index.js should pass jscs', function () { - ok(true, 'ember-utils/index.js should pass jscs.'); + assert.ok(true, 'ember-utils/guid.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/index.jshint', ['exports'], function (exports) { +enifed('ember-utils/index.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/index.js should pass jshint.'); - }); -}); -enifed('ember-utils/inspect.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-utils'); - test('ember-utils/inspect.js should pass jscs', function () { - ok(true, 'ember-utils/inspect.js should pass jscs.'); + assert.ok(true, 'ember-utils/index.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/inspect.jshint', ['exports'], function (exports) { +enifed('ember-utils/inspect.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/inspect.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/inspect.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/inspect.js should pass jshint.'); + assert.ok(true, 'ember-utils/inspect.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/intern.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/intern.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils'); - test('ember-utils/intern.js should pass jscs', function () { - ok(true, 'ember-utils/intern.js should pass jscs.'); - }); -}); -enifed('ember-utils/intern.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/intern.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/intern.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/intern.js should pass jshint.'); + assert.ok(true, 'ember-utils/intern.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/invoke.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/invoke.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils'); - test('ember-utils/invoke.js should pass jscs', function () { - ok(true, 'ember-utils/invoke.js should pass jscs.'); - }); -}); -enifed('ember-utils/invoke.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/invoke.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/invoke.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/invoke.js should pass jshint.'); - }); -}); -enifed('ember-utils/lookup-descriptor.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-utils'); - test('ember-utils/lookup-descriptor.js should pass jscs', function () { - ok(true, 'ember-utils/lookup-descriptor.js should pass jscs.'); + assert.ok(true, 'ember-utils/invoke.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/lookup-descriptor.jshint', ['exports'], function (exports) { +enifed('ember-utils/lookup-descriptor.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/lookup-descriptor.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/lookup-descriptor.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/lookup-descriptor.js should pass jshint.'); + assert.ok(true, 'ember-utils/lookup-descriptor.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/make-array.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/make-array.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils'); - test('ember-utils/make-array.js should pass jscs', function () { - ok(true, 'ember-utils/make-array.js should pass jscs.'); - }); -}); -enifed('ember-utils/make-array.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/make-array.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/make-array.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/make-array.js should pass jshint.'); + assert.ok(true, 'ember-utils/make-array.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/owner.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/name.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils'); - test('ember-utils/owner.js should pass jscs', function () { - ok(true, 'ember-utils/owner.js should pass jscs.'); - }); -}); -enifed('ember-utils/owner.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/owner.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/name.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/owner.js should pass jshint.'); + assert.ok(true, 'ember-utils/name.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/super.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/owner.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils'); - test('ember-utils/super.js should pass jscs', function () { - ok(true, 'ember-utils/super.js should pass jscs.'); + QUnit.module('ESLint | ember-utils/owner.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/owner.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/super.jshint', ['exports'], function (exports) { +enifed('ember-utils/proxy-utils.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/super.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/proxy-utils.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/super.js should pass jshint.'); + assert.ok(true, 'ember-utils/proxy-utils.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/symbol.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/super.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils'); - test('ember-utils/symbol.js should pass jscs', function () { - ok(true, 'ember-utils/symbol.js should pass jscs.'); + QUnit.module('ESLint | ember-utils/super.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/super.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/symbol.jshint', ['exports'], function (exports) { +enifed('ember-utils/symbol.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/symbol.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/symbol.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/symbol.js should pass jshint.'); + assert.ok(true, 'ember-utils/symbol.js should pass ESLint\n\n'); }); }); enifed('ember-utils/tests/assign_test', ['exports', 'ember-utils/assign'], function (exports, _emberUtilsAssign) { @@ -69919,21 +66759,13 @@ enifed('ember-utils/tests/assign_test', ['exports', 'ember-utils/assign'], funct deepEqual(a2, { a: 4 }); }); }); -enifed('ember-utils/tests/assign_test.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/tests/assign_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils/tests'); - test('ember-utils/tests/assign_test.js should pass jscs', function () { - ok(true, 'ember-utils/tests/assign_test.js should pass jscs.'); - }); -}); -enifed('ember-utils/tests/assign_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-utils/tests'); - QUnit.test('ember-utils/tests/assign_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/tests/assign_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/tests/assign_test.js should pass jshint.'); + assert.ok(true, 'ember-utils/tests/assign_test.js should pass ESLint\n\n'); }); }); enifed('ember-utils/tests/can_invoke_test', ['exports', 'ember-utils/index'], function (exports, _emberUtilsIndex) { @@ -69970,21 +66802,13 @@ enifed('ember-utils/tests/can_invoke_test', ['exports', 'ember-utils/index'], fu equal(_emberUtilsIndex.canInvoke(obj, 'foobar'), false); }); }); -enifed('ember-utils/tests/can_invoke_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-utils/tests'); - test('ember-utils/tests/can_invoke_test.js should pass jscs', function () { - ok(true, 'ember-utils/tests/can_invoke_test.js should pass jscs.'); - }); -}); -enifed('ember-utils/tests/can_invoke_test.jshint', ['exports'], function (exports) { +enifed('ember-utils/tests/can_invoke_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-utils/tests'); - QUnit.test('ember-utils/tests/can_invoke_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/tests/can_invoke_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/tests/can_invoke_test.js should pass jshint.'); + assert.ok(true, 'ember-utils/tests/can_invoke_test.js should pass ESLint\n\n'); }); }); enifed('ember-utils/tests/checkHasSuper_test', ['exports', 'ember-environment', 'ember-utils/index'], function (exports, _emberEnvironment, _emberUtilsIndex) { @@ -70001,21 +66825,13 @@ enifed('ember-utils/tests/checkHasSuper_test', ['exports', 'ember-environment', }); } }); -enifed('ember-utils/tests/checkHasSuper_test.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/tests/checkHasSuper_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils/tests'); - test('ember-utils/tests/checkHasSuper_test.js should pass jscs', function () { - ok(true, 'ember-utils/tests/checkHasSuper_test.js should pass jscs.'); - }); -}); -enifed('ember-utils/tests/checkHasSuper_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-utils/tests'); - QUnit.test('ember-utils/tests/checkHasSuper_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/tests/checkHasSuper_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/tests/checkHasSuper_test.js should pass jshint.'); + assert.ok(true, 'ember-utils/tests/checkHasSuper_test.js should pass ESLint\n\n'); }); }); enifed('ember-utils/tests/generate_guid_test', ['exports', 'ember-utils/index'], function (exports, _emberUtilsIndex) { @@ -70029,21 +66845,13 @@ enifed('ember-utils/tests/generate_guid_test', ['exports', 'ember-utils/index'], ok(_emberUtilsIndex.generateGuid(a, 'tyrell').indexOf('tyrell') > -1, 'guid can be prefixed'); }); }); -enifed('ember-utils/tests/generate_guid_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-utils/tests'); - test('ember-utils/tests/generate_guid_test.js should pass jscs', function () { - ok(true, 'ember-utils/tests/generate_guid_test.js should pass jscs.'); - }); -}); -enifed('ember-utils/tests/generate_guid_test.jshint', ['exports'], function (exports) { +enifed('ember-utils/tests/generate_guid_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-utils/tests'); - QUnit.test('ember-utils/tests/generate_guid_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/tests/generate_guid_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/tests/generate_guid_test.js should pass jshint.'); + assert.ok(true, 'ember-utils/tests/generate_guid_test.js should pass ESLint\n\n'); }); }); enifed('ember-utils/tests/guid_for_test', ['exports', 'ember-utils/index'], function (exports, _emberUtilsIndex) { @@ -70131,21 +66939,13 @@ enifed('ember-utils/tests/guid_for_test', ['exports', 'ember-utils/index'], func nanGuid(a); }); }); -enifed('ember-utils/tests/guid_for_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-utils/tests'); - test('ember-utils/tests/guid_for_test.js should pass jscs', function () { - ok(true, 'ember-utils/tests/guid_for_test.js should pass jscs.'); - }); -}); -enifed('ember-utils/tests/guid_for_test.jshint', ['exports'], function (exports) { +enifed('ember-utils/tests/guid_for_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-utils/tests'); - QUnit.test('ember-utils/tests/guid_for_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/tests/guid_for_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/tests/guid_for_test.js should pass jshint.'); + assert.ok(true, 'ember-utils/tests/guid_for_test.js should pass ESLint\n\n'); }); }); enifed('ember-utils/tests/inspect_test', ['exports', 'ember-utils/index'], function (exports, _emberUtilsIndex) { @@ -70218,21 +67018,61 @@ enifed('ember-utils/tests/inspect_test', ['exports', 'ember-utils/index'], funct } }); }); -enifed('ember-utils/tests/inspect_test.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/tests/inspect_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils/tests'); - test('ember-utils/tests/inspect_test.js should pass jscs', function () { - ok(true, 'ember-utils/tests/inspect_test.js should pass jscs.'); + QUnit.module('ESLint | ember-utils/tests/inspect_test.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-utils/tests/inspect_test.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/tests/inspect_test.jshint', ['exports'], function (exports) { +enifed('ember-utils/tests/make_array_test', ['exports', 'ember-utils/make-array'], function (exports, _emberUtilsMakeArray) { 'use strict'; - QUnit.module('JSHint - ember-utils/tests'); - QUnit.test('ember-utils/tests/inspect_test.js should pass jshint', function (assert) { + QUnit.module('Ember.makeArray'); + + QUnit.test('undefined', function () { + deepEqual(_emberUtilsMakeArray.default(), []); + deepEqual(_emberUtilsMakeArray.default(undefined), []); + }); + + QUnit.test('null', function () { + deepEqual(_emberUtilsMakeArray.default(null), []); + }); + + QUnit.test('string', function () { + deepEqual(_emberUtilsMakeArray.default('lindsay'), ['lindsay']); + }); + + QUnit.test('number', function () { + deepEqual(_emberUtilsMakeArray.default(0), [0]); + deepEqual(_emberUtilsMakeArray.default(1), [1]); + }); + + QUnit.test('array', function () { + deepEqual(_emberUtilsMakeArray.default([1, 2, 42]), [1, 2, 42]); + }); + + QUnit.test('true', function () { + deepEqual(_emberUtilsMakeArray.default(true), [true]); + }); + + QUnit.test('false', function () { + deepEqual(_emberUtilsMakeArray.default(false), [false]); + }); + + QUnit.test('object', function () { + deepEqual(_emberUtilsMakeArray.default({}), [{}]); + }); +}); +enifed('ember-utils/tests/make_array_test.lint-test', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('ESLint | ember-utils/tests/make_array_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/tests/inspect_test.js should pass jshint.'); + assert.ok(true, 'ember-utils/tests/make_array_test.js should pass ESLint\n\n'); }); }); enifed('ember-utils/tests/to-string-test', ['exports', 'ember-utils/index'], function (exports, _emberUtilsIndex) { @@ -70256,21 +67096,13 @@ enifed('ember-utils/tests/to-string-test', ['exports', 'ember-utils/index'], fun strictEqual(_emberUtilsIndex.toString(obj), ({}).toString()); }); }); -enifed('ember-utils/tests/to-string-test.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/tests/to-string-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils/tests'); - test('ember-utils/tests/to-string-test.js should pass jscs', function () { - ok(true, 'ember-utils/tests/to-string-test.js should pass jscs.'); - }); -}); -enifed('ember-utils/tests/to-string-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-utils/tests'); - QUnit.test('ember-utils/tests/to-string-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/tests/to-string-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/tests/to-string-test.js should pass jshint.'); + assert.ok(true, 'ember-utils/tests/to-string-test.js should pass ESLint\n\n'); }); }); enifed('ember-utils/tests/try_invoke_test', ['exports', 'ember-utils/index'], function (exports, _emberUtilsIndex) { @@ -70311,480 +67143,265 @@ enifed('ember-utils/tests/try_invoke_test', ['exports', 'ember-utils/index'], fu equal(_emberUtilsIndex.tryInvoke(obj, 'aMethodThatTakesArguments', [true, true]), true); }); }); -enifed('ember-utils/tests/try_invoke_test.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/tests/try_invoke_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-utils/tests'); - test('ember-utils/tests/try_invoke_test.js should pass jscs', function () { - ok(true, 'ember-utils/tests/try_invoke_test.js should pass jscs.'); - }); -}); -enifed('ember-utils/tests/try_invoke_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-utils/tests'); - QUnit.test('ember-utils/tests/try_invoke_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/tests/try_invoke_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/tests/try_invoke_test.js should pass jshint.'); - }); -}); -enifed('ember-utils/to-string.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-utils'); - test('ember-utils/to-string.js should pass jscs', function () { - ok(true, 'ember-utils/to-string.js should pass jscs.'); + assert.ok(true, 'ember-utils/tests/try_invoke_test.js should pass ESLint\n\n'); }); }); -enifed('ember-utils/to-string.jshint', ['exports'], function (exports) { +enifed('ember-utils/to-string.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-utils'); - QUnit.test('ember-utils/to-string.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/to-string.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-utils/to-string.js should pass jshint.'); + assert.ok(true, 'ember-utils/to-string.js should pass ESLint\n\n'); }); }); -enifed('ember-views/compat/attrs.jscs-test', ['exports'], function (exports) { +enifed('ember-utils/weak-map-utils.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-views/compat'); - test('ember-views/compat/attrs.js should pass jscs', function () { - ok(true, 'ember-views/compat/attrs.js should pass jscs.'); - }); -}); -enifed('ember-views/compat/attrs.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-views/compat'); - QUnit.test('ember-views/compat/attrs.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-utils/weak-map-utils.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/compat/attrs.js should pass jshint.'); + assert.ok(true, 'ember-utils/weak-map-utils.js should pass ESLint\n\n'); }); }); -enifed('ember-views/compat/fallback-view-registry.jscs-test', ['exports'], function (exports) { +enifed('ember-views/compat/attrs.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-views/compat'); - test('ember-views/compat/fallback-view-registry.js should pass jscs', function () { - ok(true, 'ember-views/compat/fallback-view-registry.js should pass jscs.'); - }); -}); -enifed('ember-views/compat/fallback-view-registry.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-views/compat'); - QUnit.test('ember-views/compat/fallback-view-registry.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/compat/attrs.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/compat/fallback-view-registry.js should pass jshint.'); + assert.ok(true, 'ember-views/compat/attrs.js should pass ESLint\n\n'); }); }); -enifed('ember-views/component_lookup.jscs-test', ['exports'], function (exports) { +enifed('ember-views/compat/fallback-view-registry.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-views'); - test('ember-views/component_lookup.js should pass jscs', function () { - ok(true, 'ember-views/component_lookup.js should pass jscs.'); - }); -}); -enifed('ember-views/component_lookup.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-views'); - QUnit.test('ember-views/component_lookup.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/compat/fallback-view-registry.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/component_lookup.js should pass jshint.'); - }); -}); -enifed('ember-views/index.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views'); - test('ember-views/index.js should pass jscs', function () { - ok(true, 'ember-views/index.js should pass jscs.'); + assert.ok(true, 'ember-views/compat/fallback-view-registry.js should pass ESLint\n\n'); }); }); -enifed('ember-views/index.jshint', ['exports'], function (exports) { +enifed('ember-views/component_lookup.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views'); - QUnit.test('ember-views/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/component_lookup.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/index.js should pass jshint.'); + assert.ok(true, 'ember-views/component_lookup.js should pass ESLint\n\n'); }); }); -enifed('ember-views/mixins/action_support.jscs-test', ['exports'], function (exports) { +enifed('ember-views/index.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-views/mixins'); - test('ember-views/mixins/action_support.js should pass jscs', function () { - ok(true, 'ember-views/mixins/action_support.js should pass jscs.'); - }); -}); -enifed('ember-views/mixins/action_support.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-views/mixins'); - QUnit.test('ember-views/mixins/action_support.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/mixins/action_support.js should pass jshint.'); - }); -}); -enifed('ember-views/mixins/child_views_support.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/mixins'); - test('ember-views/mixins/child_views_support.js should pass jscs', function () { - ok(true, 'ember-views/mixins/child_views_support.js should pass jscs.'); + assert.ok(true, 'ember-views/index.js should pass ESLint\n\n'); }); }); -enifed('ember-views/mixins/child_views_support.jshint', ['exports'], function (exports) { +enifed('ember-views/mixins/action_support.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/mixins'); - QUnit.test('ember-views/mixins/child_views_support.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/mixins/action_support.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/mixins/child_views_support.js should pass jshint.'); - }); -}); -enifed('ember-views/mixins/class_names_support.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/mixins'); - test('ember-views/mixins/class_names_support.js should pass jscs', function () { - ok(true, 'ember-views/mixins/class_names_support.js should pass jscs.'); + assert.ok(true, 'ember-views/mixins/action_support.js should pass ESLint\n\n'); }); }); -enifed('ember-views/mixins/class_names_support.jshint', ['exports'], function (exports) { +enifed('ember-views/mixins/child_views_support.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/mixins'); - QUnit.test('ember-views/mixins/class_names_support.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/mixins/child_views_support.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/mixins/class_names_support.js should pass jshint.'); - }); -}); -enifed('ember-views/mixins/text_support.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/mixins'); - test('ember-views/mixins/text_support.js should pass jscs', function () { - ok(true, 'ember-views/mixins/text_support.js should pass jscs.'); + assert.ok(true, 'ember-views/mixins/child_views_support.js should pass ESLint\n\n'); }); }); -enifed('ember-views/mixins/text_support.jshint', ['exports'], function (exports) { +enifed('ember-views/mixins/class_names_support.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/mixins'); - QUnit.test('ember-views/mixins/text_support.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/mixins/class_names_support.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/mixins/text_support.js should pass jshint.'); - }); -}); -enifed('ember-views/mixins/view_state_support.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/mixins'); - test('ember-views/mixins/view_state_support.js should pass jscs', function () { - ok(true, 'ember-views/mixins/view_state_support.js should pass jscs.'); + assert.ok(true, 'ember-views/mixins/class_names_support.js should pass ESLint\n\n'); }); }); -enifed('ember-views/mixins/view_state_support.jshint', ['exports'], function (exports) { +enifed('ember-views/mixins/text_support.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/mixins'); - QUnit.test('ember-views/mixins/view_state_support.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/mixins/text_support.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/mixins/view_state_support.js should pass jshint.'); + assert.ok(true, 'ember-views/mixins/text_support.js should pass ESLint\n\n'); }); }); -enifed('ember-views/mixins/view_support.jscs-test', ['exports'], function (exports) { +enifed('ember-views/mixins/view_state_support.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-views/mixins'); - test('ember-views/mixins/view_support.js should pass jscs', function () { - ok(true, 'ember-views/mixins/view_support.js should pass jscs.'); - }); -}); -enifed('ember-views/mixins/view_support.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-views/mixins'); - QUnit.test('ember-views/mixins/view_support.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/mixins/view_state_support.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/mixins/view_support.js should pass jshint.'); + assert.ok(true, 'ember-views/mixins/view_state_support.js should pass ESLint\n\n'); }); }); -enifed('ember-views/system/action_manager.jscs-test', ['exports'], function (exports) { +enifed('ember-views/mixins/view_support.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-views/system'); - test('ember-views/system/action_manager.js should pass jscs', function () { - ok(true, 'ember-views/system/action_manager.js should pass jscs.'); - }); -}); -enifed('ember-views/system/action_manager.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-views/system'); - QUnit.test('ember-views/system/action_manager.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/mixins/view_support.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/system/action_manager.js should pass jshint.'); - }); -}); -enifed('ember-views/system/event_dispatcher.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/system'); - test('ember-views/system/event_dispatcher.js should pass jscs', function () { - ok(true, 'ember-views/system/event_dispatcher.js should pass jscs.'); + assert.ok(true, 'ember-views/mixins/view_support.js should pass ESLint\n\n'); }); }); -enifed('ember-views/system/event_dispatcher.jshint', ['exports'], function (exports) { +enifed('ember-views/system/action_manager.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/system'); - QUnit.test('ember-views/system/event_dispatcher.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/system/action_manager.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/system/event_dispatcher.js should pass jshint.'); - }); -}); -enifed('ember-views/system/ext.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/system'); - test('ember-views/system/ext.js should pass jscs', function () { - ok(true, 'ember-views/system/ext.js should pass jscs.'); + assert.ok(true, 'ember-views/system/action_manager.js should pass ESLint\n\n'); }); }); -enifed('ember-views/system/ext.jshint', ['exports'], function (exports) { +enifed('ember-views/system/event_dispatcher.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/system'); - QUnit.test('ember-views/system/ext.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/system/event_dispatcher.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/system/ext.js should pass jshint.'); - }); -}); -enifed('ember-views/system/jquery.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/system'); - test('ember-views/system/jquery.js should pass jscs', function () { - ok(true, 'ember-views/system/jquery.js should pass jscs.'); + assert.ok(true, 'ember-views/system/event_dispatcher.js should pass ESLint\n\n'); }); }); -enifed('ember-views/system/jquery.jshint', ['exports'], function (exports) { +enifed('ember-views/system/ext.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/system'); - QUnit.test('ember-views/system/jquery.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/system/ext.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/system/jquery.js should pass jshint.'); - }); -}); -enifed('ember-views/system/lookup_partial.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/system'); - test('ember-views/system/lookup_partial.js should pass jscs', function () { - ok(true, 'ember-views/system/lookup_partial.js should pass jscs.'); + assert.ok(true, 'ember-views/system/ext.js should pass ESLint\n\n'); }); }); -enifed('ember-views/system/lookup_partial.jshint', ['exports'], function (exports) { +enifed('ember-views/system/jquery.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/system'); - QUnit.test('ember-views/system/lookup_partial.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/system/jquery.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/system/lookup_partial.js should pass jshint.'); + assert.ok(true, 'ember-views/system/jquery.js should pass ESLint\n\n'); }); }); -enifed('ember-views/system/utils.jscs-test', ['exports'], function (exports) { +enifed('ember-views/system/lookup_partial.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-views/system'); - test('ember-views/system/utils.js should pass jscs', function () { - ok(true, 'ember-views/system/utils.js should pass jscs.'); - }); -}); -enifed('ember-views/system/utils.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-views/system'); - QUnit.test('ember-views/system/utils.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/system/lookup_partial.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/system/utils.js should pass jshint.'); - }); -}); -enifed('ember-views/utils/lookup-component.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/utils'); - test('ember-views/utils/lookup-component.js should pass jscs', function () { - ok(true, 'ember-views/utils/lookup-component.js should pass jscs.'); + assert.ok(true, 'ember-views/system/lookup_partial.js should pass ESLint\n\n'); }); }); -enifed('ember-views/utils/lookup-component.jshint', ['exports'], function (exports) { +enifed('ember-views/system/utils.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/utils'); - QUnit.test('ember-views/utils/lookup-component.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/system/utils.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/utils/lookup-component.js should pass jshint.'); + assert.ok(true, 'ember-views/system/utils.js should pass ESLint\n\n'); }); }); -enifed('ember-views/views/core_view.jscs-test', ['exports'], function (exports) { +enifed('ember-views/utils/lookup-component.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-views/views'); - test('ember-views/views/core_view.js should pass jscs', function () { - ok(true, 'ember-views/views/core_view.js should pass jscs.'); - }); -}); -enifed('ember-views/views/core_view.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-views/views'); - QUnit.test('ember-views/views/core_view.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/utils/lookup-component.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/views/core_view.js should pass jshint.'); + assert.ok(true, 'ember-views/utils/lookup-component.js should pass ESLint\n\n'); }); }); -enifed('ember-views/views/states.jscs-test', ['exports'], function (exports) { +enifed('ember-views/views/core_view.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-views/views'); - test('ember-views/views/states.js should pass jscs', function () { - ok(true, 'ember-views/views/states.js should pass jscs.'); - }); -}); -enifed('ember-views/views/states.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-views/views'); - QUnit.test('ember-views/views/states.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/views/core_view.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/views/states.js should pass jshint.'); + assert.ok(true, 'ember-views/views/core_view.js should pass ESLint\n\n'); }); }); -enifed('ember-views/views/states/default.jscs-test', ['exports'], function (exports) { +enifed('ember-views/views/states.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-views/views/states'); - test('ember-views/views/states/default.js should pass jscs', function () { - ok(true, 'ember-views/views/states/default.js should pass jscs.'); - }); -}); -enifed('ember-views/views/states/default.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-views/views/states'); - QUnit.test('ember-views/views/states/default.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/views/states.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/views/states/default.js should pass jshint.'); - }); -}); -enifed('ember-views/views/states/destroying.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/views/states'); - test('ember-views/views/states/destroying.js should pass jscs', function () { - ok(true, 'ember-views/views/states/destroying.js should pass jscs.'); + assert.ok(true, 'ember-views/views/states.js should pass ESLint\n\n'); }); }); -enifed('ember-views/views/states/destroying.jshint', ['exports'], function (exports) { +enifed('ember-views/views/states/default.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/views/states'); - QUnit.test('ember-views/views/states/destroying.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/views/states/default.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/views/states/destroying.js should pass jshint.'); + assert.ok(true, 'ember-views/views/states/default.js should pass ESLint\n\n'); }); }); -enifed('ember-views/views/states/has_element.jscs-test', ['exports'], function (exports) { +enifed('ember-views/views/states/destroying.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember-views/views/states'); - test('ember-views/views/states/has_element.js should pass jscs', function () { - ok(true, 'ember-views/views/states/has_element.js should pass jscs.'); - }); -}); -enifed('ember-views/views/states/has_element.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember-views/views/states'); - QUnit.test('ember-views/views/states/has_element.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/views/states/destroying.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/views/states/has_element.js should pass jshint.'); - }); -}); -enifed('ember-views/views/states/in_dom.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/views/states'); - test('ember-views/views/states/in_dom.js should pass jscs', function () { - ok(true, 'ember-views/views/states/in_dom.js should pass jscs.'); + assert.ok(true, 'ember-views/views/states/destroying.js should pass ESLint\n\n'); }); }); -enifed('ember-views/views/states/in_dom.jshint', ['exports'], function (exports) { +enifed('ember-views/views/states/has_element.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/views/states'); - QUnit.test('ember-views/views/states/in_dom.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/views/states/has_element.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/views/states/in_dom.js should pass jshint.'); - }); -}); -enifed('ember-views/views/states/pre_render.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/views/states'); - test('ember-views/views/states/pre_render.js should pass jscs', function () { - ok(true, 'ember-views/views/states/pre_render.js should pass jscs.'); + assert.ok(true, 'ember-views/views/states/has_element.js should pass ESLint\n\n'); }); }); -enifed('ember-views/views/states/pre_render.jshint', ['exports'], function (exports) { +enifed('ember-views/views/states/in_dom.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/views/states'); - QUnit.test('ember-views/views/states/pre_render.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/views/states/in_dom.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/views/states/pre_render.js should pass jshint.'); - }); -}); -enifed('ember-views/views/view.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember-views/views'); - test('ember-views/views/view.js should pass jscs', function () { - ok(true, 'ember-views/views/view.js should pass jscs.'); + assert.ok(true, 'ember-views/views/states/in_dom.js should pass ESLint\n\n'); }); }); -enifed('ember-views/views/view.jshint', ['exports'], function (exports) { +enifed('ember-views/views/states/pre_render.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember-views/views'); - QUnit.test('ember-views/views/view.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember-views/views/states/pre_render.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember-views/views/view.js should pass jshint.'); + assert.ok(true, 'ember-views/views/states/pre_render.js should pass ESLint\n\n'); }); }); -enifed('ember/index.jscs-test', ['exports'], function (exports) { +enifed('ember-views/views/view.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember'); - test('ember/index.js should pass jscs', function () { - ok(true, 'ember/index.js should pass jscs.'); + QUnit.module('ESLint | ember-views/views/view.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember-views/views/view.js should pass ESLint\n\n'); }); }); -enifed('ember/index.jshint', ['exports'], function (exports) { +enifed('ember/index.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember'); - QUnit.test('ember/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/index.js should pass jshint.'); + assert.ok(true, 'ember/index.js should pass ESLint\n\n'); }); }); enifed('ember/tests/application_lifecycle_test', ['exports', 'ember-application', 'ember-routing', 'ember-metal', 'ember-glimmer', 'ember-views', 'ember-template-compiler'], function (exports, _emberApplication, _emberRouting, _emberMetal, _emberGlimmer, _emberViews, _emberTemplateCompiler) { @@ -71007,21 +67624,13 @@ enifed('ember/tests/application_lifecycle_test', ['exports', 'ember-application' }); }); }); -enifed('ember/tests/application_lifecycle_test.jscs-test', ['exports'], function (exports) { +enifed('ember/tests/application_lifecycle_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember/tests'); - test('ember/tests/application_lifecycle_test.js should pass jscs', function () { - ok(true, 'ember/tests/application_lifecycle_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/application_lifecycle_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember/tests'); - QUnit.test('ember/tests/application_lifecycle_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/application_lifecycle_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/application_lifecycle_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/application_lifecycle_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/component_registration_test', ['exports', 'ember-runtime', 'ember-metal', 'ember-application', 'ember-routing', 'ember-template-compiler', 'ember-glimmer', 'ember-views'], function (exports, _emberRuntime, _emberMetal, _emberApplication, _emberRouting, _emberTemplateCompiler, _emberGlimmer, _emberViews) { @@ -71382,21 +67991,13 @@ enifed('ember/tests/component_registration_test', ['exports', 'ember-runtime', ' _emberViews.jQuery('#fizzbuzz', '#wrapper').click(); }); }); -enifed('ember/tests/component_registration_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests'); - test('ember/tests/component_registration_test.js should pass jscs', function () { - ok(true, 'ember/tests/component_registration_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/component_registration_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/component_registration_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests'); - QUnit.test('ember/tests/component_registration_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/component_registration_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/component_registration_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/component_registration_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/controller_test', ['exports', 'ember-runtime', 'ember-routing', 'ember-metal', 'ember-template-compiler', 'ember-application', 'ember-glimmer', 'ember-views'], function (exports, _emberRuntime, _emberRouting, _emberMetal, _emberTemplateCompiler, _emberApplication, _emberGlimmer, _emberViews) { @@ -71472,21 +68073,13 @@ enifed('ember/tests/controller_test', ['exports', 'ember-runtime', 'ember-routin _emberMetal.run(App, 'advanceReadiness'); } }); -enifed('ember/tests/controller_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests'); - test('ember/tests/controller_test.js should pass jscs', function () { - ok(true, 'ember/tests/controller_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/controller_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/controller_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests'); - QUnit.test('ember/tests/controller_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/controller_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/controller_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/controller_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/global-api-test', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { @@ -71510,21 +68103,13 @@ enifed('ember/tests/global-api-test', ['exports', 'ember-metal', 'ember-runtime' confirmExport('Ember.Helper.helper'); confirmExport('Ember.isArray', _emberRuntime.isArray); }); -enifed('ember/tests/global-api-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests'); - test('ember/tests/global-api-test.js should pass jscs', function () { - ok(true, 'ember/tests/global-api-test.js should pass jscs.'); - }); -}); -enifed('ember/tests/global-api-test.jshint', ['exports'], function (exports) { +enifed('ember/tests/global-api-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests'); - QUnit.test('ember/tests/global-api-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/global-api-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/global-api-test.js should pass jshint.'); + assert.ok(true, 'ember/tests/global-api-test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/helpers/helper_registration_test', ['exports', 'ember-runtime', 'ember-metal', 'ember-template-compiler', 'ember-glimmer', 'ember-application', 'ember-routing', 'ember-views'], function (exports, _emberRuntime, _emberMetal, _emberTemplateCompiler, _emberGlimmer, _emberApplication, _emberRouting, _emberViews) { @@ -71559,6 +68144,7 @@ enifed('ember/tests/helpers/helper_registration_test', ['exports', 'ember-runtim location: 'none' }); + // We shouldn't be testing this appInstance = App.__deprecatedInstance__; if (callback) { @@ -71643,21 +68229,13 @@ enifed('ember/tests/helpers/helper_registration_test', ['exports', 'ember-runtim ok(serviceCalled, 'service was injected, method called'); }); }); -enifed('ember/tests/helpers/helper_registration_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests/helpers'); - test('ember/tests/helpers/helper_registration_test.js should pass jscs', function () { - ok(true, 'ember/tests/helpers/helper_registration_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/helpers/helper_registration_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/helpers/helper_registration_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests/helpers'); - QUnit.test('ember/tests/helpers/helper_registration_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/helpers/helper_registration_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/helpers/helper_registration_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/helpers/helper_registration_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/helpers/link_to_test', ['exports', 'ember-console', 'ember-runtime', 'ember-metal', 'ember-routing', 'ember-application', 'ember-views', 'ember-template-compiler', 'ember-glimmer'], function (exports, _emberConsole, _emberRuntime, _emberMetal, _emberRouting, _emberApplication, _emberViews, _emberTemplateCompiler, _emberGlimmer) { @@ -71771,7 +68349,7 @@ enifed('ember/tests/helpers/link_to_test', ['exports', 'ember-console', 'ember-r equal(_emberViews.jQuery('#home-link:not(.active)', '#qunit-fixture').length, 1, 'The other link was rendered without active class'); }); - if (false) { + if (_emberMetal.isFeatureEnabled('ember-improved-instrumentation')) { QUnit.test('The {{link-to}} helper fires an interaction event', function (assert) { assert.expect(2); Router.map(function (match) { @@ -73233,21 +69811,13 @@ enifed('ember/tests/helpers/link_to_test', ['exports', 'ember-console', 'ember-r shouldBeActive('#parent-link'); }); }); -enifed('ember/tests/helpers/link_to_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests/helpers'); - test('ember/tests/helpers/link_to_test.js should pass jscs', function () { - ok(true, 'ember/tests/helpers/link_to_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/helpers/link_to_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/helpers/link_to_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests/helpers'); - QUnit.test('ember/tests/helpers/link_to_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/helpers/link_to_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/helpers/link_to_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/helpers/link_to_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test', ['exports', 'ember-runtime', 'ember-routing', 'ember-metal', 'ember-template-compiler', 'ember-application', 'ember-views', 'ember-glimmer'], function (exports, _emberRuntime, _emberRouting, _emberMetal, _emberTemplateCompiler, _emberApplication, _emberViews, _emberGlimmer) { @@ -73255,7 +69825,6 @@ enifed('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test', [' var Router = undefined, App = undefined, - router = undefined, registry = undefined, container = undefined; @@ -73263,7 +69832,7 @@ enifed('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test', [' otherDefer = undefined; function bootApplication() { - router = container.lookup('router:main'); + container.lookup('router:main'); _emberMetal.run(App, 'advanceReadiness'); } @@ -73442,21 +70011,13 @@ enifed('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test', [' assertHasClass('ember-transitioning-out', $index, false, $about, false, $other, false); }); }); -enifed('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests/helpers/link_to_test'); - test('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js should pass jscs', function () { - ok(true, 'ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests/helpers/link_to_test'); - QUnit.test('ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/helpers/link_to_test/link_to_with_query_params_test', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing', 'ember-template-compiler', 'ember-application', 'ember-views', 'ember-glimmer'], function (exports, _emberMetal, _emberRuntime, _emberRouting, _emberTemplateCompiler, _emberApplication, _emberViews, _emberGlimmer) { @@ -73929,21 +70490,13 @@ enifed('ember/tests/helpers/link_to_test/link_to_with_query_params_test', ['expo shouldBeActive('#foos-link'); }); }); -enifed('ember/tests/helpers/link_to_test/link_to_with_query_params_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests/helpers/link_to_test'); - test('ember/tests/helpers/link_to_test/link_to_with_query_params_test.js should pass jscs', function () { - ok(true, 'ember/tests/helpers/link_to_test/link_to_with_query_params_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/helpers/link_to_test/link_to_with_query_params_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/helpers/link_to_test/link_to_with_query_params_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests/helpers/link_to_test'); - QUnit.test('ember/tests/helpers/link_to_test/link_to_with_query_params_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/helpers/link_to_test/link_to_with_query_params_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/helpers/link_to_test/link_to_with_query_params_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/helpers/link_to_test/link_to_with_query_params_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/homepage_example_test', ['exports', 'ember-routing', 'ember-metal', 'ember-application', 'ember-runtime', 'ember-template-compiler', 'ember-views', 'ember-glimmer'], function (exports, _emberRouting, _emberMetal, _emberApplication, _emberRuntime, _emberTemplateCompiler, _emberViews, _emberGlimmer) { @@ -74020,21 +70573,13 @@ enifed('ember/tests/homepage_example_test', ['exports', 'ember-routing', 'ember- equal($fixture.find('li:nth-of-type(2)').text(), 'Hello, Yehuda Katz!'); }); }); -enifed('ember/tests/homepage_example_test.jscs-test', ['exports'], function (exports) { +enifed('ember/tests/homepage_example_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember/tests'); - test('ember/tests/homepage_example_test.js should pass jscs', function () { - ok(true, 'ember/tests/homepage_example_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/homepage_example_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember/tests'); - QUnit.test('ember/tests/homepage_example_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/homepage_example_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/homepage_example_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/homepage_example_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/integration/multiple-app-test', ['exports', 'ember-metal', 'ember-template-compiler', 'ember-application', 'ember-glimmer', 'ember-views'], function (exports, _emberMetal, _emberTemplateCompiler, _emberApplication, _emberGlimmer, _emberViews) { @@ -74107,21 +70652,13 @@ enifed('ember/tests/integration/multiple-app-test', ['exports', 'ember-metal', ' assert.deepEqual(actions, ['#app-2', '#app-1']); }); }); -enifed('ember/tests/integration/multiple-app-test.jscs-test', ['exports'], function (exports) { +enifed('ember/tests/integration/multiple-app-test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember/tests/integration'); - test('ember/tests/integration/multiple-app-test.js should pass jscs', function () { - ok(true, 'ember/tests/integration/multiple-app-test.js should pass jscs.'); - }); -}); -enifed('ember/tests/integration/multiple-app-test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember/tests/integration'); - QUnit.test('ember/tests/integration/multiple-app-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/integration/multiple-app-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/integration/multiple-app-test.js should pass jshint.'); + assert.ok(true, 'ember/tests/integration/multiple-app-test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/reexports_test', ['exports', 'ember/index', 'internal-test-helpers', 'ember-metal'], function (exports, _emberIndex, _internalTestHelpers, _emberMetal) { @@ -74145,7 +70682,7 @@ enifed('ember/tests/reexports_test', ['exports', 'ember/index', 'internal-test-h ['computed', 'ember-metal'], ['computed.alias', 'ember-metal', 'alias'], ['ComputedProperty', 'ember-metal'], ['cacheFor', 'ember-metal'], ['deprecate', 'ember-metal'], ['deprecateFunc', 'ember-metal'], ['assert', 'ember-metal'], ['warn', 'ember-metal'], ['debug', 'ember-metal'], ['runInDebug', 'ember-metal'], ['merge', 'ember-metal'], ['instrument', 'ember-metal'], ['Instrumentation.instrument', 'ember-metal', 'instrument'], ['Instrumentation.subscribe', 'ember-metal', 'instrumentationSubscribe'], ['Instrumentation.unsubscribe', 'ember-metal', 'instrumentationUnsubscribe'], ['Instrumentation.reset', 'ember-metal', 'instrumentationReset'], ['testing', 'ember-metal', { get: 'isTesting', set: 'setTesting' }], ['onerror', 'ember-metal', { get: 'getOnerror', set: 'setOnerror' }], // ['create'], TODO: figure out what to do here // ['keys'], TODO: figure out what to do here - ['FEATURES', 'ember-metal'], ['FEATURES.isEnabled', 'ember-metal', 'isFeatureEnabled'], ['Error', 'ember-metal'], ['META_DESC', 'ember-metal'], ['meta', 'ember-metal'], ['get', 'ember-metal'], ['set', 'ember-metal'], ['_getPath', 'ember-metal'], ['getWithDefault', 'ember-metal'], ['trySet', 'ember-metal'], ['_Cache', 'ember-metal', 'Cache'], ['on', 'ember-metal'], ['addListener', 'ember-metal'], ['removeListener', 'ember-metal'], ['_suspendListener', 'ember-metal', 'suspendListener'], ['_suspendListeners', 'ember-metal', 'suspendListeners'], ['sendEvent', 'ember-metal'], ['hasListeners', 'ember-metal'], ['watchedEvents', 'ember-metal'], ['listenersFor', 'ember-metal'], ['accumulateListeners', 'ember-metal'], ['isNone', 'ember-metal'], ['isEmpty', 'ember-metal'], ['isBlank', 'ember-metal'], ['isPresent', 'ember-metal'], ['_Backburner', 'backburner', 'default'], ['run', 'ember-metal'], ['_ObserverSet', 'ember-metal', 'ObserverSet'], ['propertyWillChange', 'ember-metal'], ['propertyDidChange', 'ember-metal'], ['overrideChains', 'ember-metal'], ['beginPropertyChanges', 'ember-metal'], ['beginPropertyChanges', 'ember-metal'], ['endPropertyChanges', 'ember-metal'], ['changeProperties', 'ember-metal'], ['defineProperty', 'ember-metal'], ['watchKey', 'ember-metal'], ['unwatchKey', 'ember-metal'], ['removeChainWatcher', 'ember-metal'], ['_ChainNode', 'ember-metal', 'ChainNode'], ['finishChains', 'ember-metal'], ['watchPath', 'ember-metal'], ['unwatchPath', 'ember-metal'], ['watch', 'ember-metal'], ['isWatching', 'ember-metal'], ['unwatch', 'ember-metal'], ['destroy', 'ember-metal'], ['libraries', 'ember-metal'], ['OrderedSet', 'ember-metal'], ['Map', 'ember-metal'], ['MapWithDefault', 'ember-metal'], ['getProperties', 'ember-metal'], ['setProperties', 'ember-metal'], ['expandProperties', 'ember-metal'], ['NAME_KEY', 'ember-metal'], ['addObserver', 'ember-metal'], ['observersFor', 'ember-metal'], ['removeObserver', 'ember-metal'], ['_suspendObserver', 'ember-metal'], ['_suspendObservers', 'ember-metal'], ['required', 'ember-metal'], ['aliasMethod', 'ember-metal'], ['observer', 'ember-metal'], ['immediateObserver', 'ember-metal', '_immediateObserver'], ['mixin', 'ember-metal'], ['Mixin', 'ember-metal'], ['bind', 'ember-metal'], ['Binding', 'ember-metal'], ['isGlobalPath', 'ember-metal'], + ['FEATURES', 'ember-metal'], ['FEATURES.isEnabled', 'ember-metal', 'isFeatureEnabled'], ['Error', 'ember-metal'], ['META_DESC', 'ember-metal'], ['meta', 'ember-metal'], ['get', 'ember-metal'], ['set', 'ember-metal'], ['_getPath', 'ember-metal'], ['getWithDefault', 'ember-metal'], ['trySet', 'ember-metal'], ['_Cache', 'ember-metal', 'Cache'], ['on', 'ember-metal'], ['addListener', 'ember-metal'], ['removeListener', 'ember-metal'], ['_suspendListener', 'ember-metal', 'suspendListener'], ['_suspendListeners', 'ember-metal', 'suspendListeners'], ['sendEvent', 'ember-metal'], ['hasListeners', 'ember-metal'], ['watchedEvents', 'ember-metal'], ['listenersFor', 'ember-metal'], ['accumulateListeners', 'ember-metal'], ['isNone', 'ember-metal'], ['isEmpty', 'ember-metal'], ['isBlank', 'ember-metal'], ['isPresent', 'ember-metal'], ['_Backburner', 'backburner', 'default'], ['run', 'ember-metal'], ['_ObserverSet', 'ember-metal', 'ObserverSet'], ['propertyWillChange', 'ember-metal'], ['propertyDidChange', 'ember-metal'], ['overrideChains', 'ember-metal'], ['beginPropertyChanges', 'ember-metal'], ['beginPropertyChanges', 'ember-metal'], ['endPropertyChanges', 'ember-metal'], ['changeProperties', 'ember-metal'], ['defineProperty', 'ember-metal'], ['watchKey', 'ember-metal'], ['unwatchKey', 'ember-metal'], ['removeChainWatcher', 'ember-metal'], ['_ChainNode', 'ember-metal', 'ChainNode'], ['finishChains', 'ember-metal'], ['watchPath', 'ember-metal'], ['unwatchPath', 'ember-metal'], ['watch', 'ember-metal'], ['isWatching', 'ember-metal'], ['unwatch', 'ember-metal'], ['destroy', 'ember-metal'], ['libraries', 'ember-metal'], ['OrderedSet', 'ember-metal'], ['Map', 'ember-metal'], ['MapWithDefault', 'ember-metal'], ['getProperties', 'ember-metal'], ['setProperties', 'ember-metal'], ['expandProperties', 'ember-metal'], ['NAME_KEY', 'ember-utils'], ['addObserver', 'ember-metal'], ['observersFor', 'ember-metal'], ['removeObserver', 'ember-metal'], ['_suspendObserver', 'ember-metal'], ['_suspendObservers', 'ember-metal'], ['required', 'ember-metal'], ['aliasMethod', 'ember-metal'], ['observer', 'ember-metal'], ['immediateObserver', 'ember-metal', '_immediateObserver'], ['mixin', 'ember-metal'], ['Mixin', 'ember-metal'], ['bind', 'ember-metal'], ['Binding', 'ember-metal'], ['isGlobalPath', 'ember-metal'], // ember-views ['$', 'ember-views', 'jQuery'], ['ViewUtils.isSimpleClick', 'ember-views', 'isSimpleClick'], ['ViewUtils.getViewElement', 'ember-views', 'getViewElement'], ['ViewUtils.getViewBounds', 'ember-views', 'getViewBounds'], ['ViewUtils.getViewClientRects', 'ember-views', 'getViewClientRects'], ['ViewUtils.getViewBoundingClientRect', 'ember-views', 'getViewBoundingClientRect'], ['ViewUtils.getRootViews', 'ember-views', 'getRootViews'], ['ViewUtils.getChildViews', 'ember-views', 'getChildViews'], ['TextSupport', 'ember-views'], ['ComponentLookup', 'ember-views'], ['EventDispatcher', 'ember-views'], @@ -74178,33 +70715,23 @@ enifed('ember/tests/reexports_test', ['exports', 'ember/index', 'internal-test-h }); }); - if (true) { - QUnit.test('Ember.String.isHTMLSafe exports correctly', function (assert) { - _internalTestHelpers.confirmExport(_emberIndex.default, assert, 'String.isHTMLSafe', 'ember-glimmer', 'isHTMLSafe'); - }); - } + QUnit.test('Ember.String.isHTMLSafe exports correctly', function (assert) { + _internalTestHelpers.confirmExport(_emberIndex.default, assert, 'String.isHTMLSafe', 'ember-glimmer', 'isHTMLSafe'); + }); - if (false) { + if (_emberMetal.isFeatureEnabled('ember-metal-weakmap')) { QUnit.test('Ember.WeakMap exports correctly', function (assert) { _internalTestHelpers.confirmExport(_emberIndex.default, assert, 'WeakMap', 'ember-metal', 'WeakMap'); }); } }); -enifed('ember/tests/reexports_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests'); - test('ember/tests/reexports_test.js should pass jscs', function () { - ok(true, 'ember/tests/reexports_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/reexports_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/reexports_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests'); - QUnit.test('ember/tests/reexports_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/reexports_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/reexports_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/reexports_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-console', 'ember-runtime', 'ember-routing', 'ember-metal', 'ember-glimmer', 'ember-views', 'ember-template-compiler', 'ember-application', 'router'], function (exports, _emberUtils, _emberConsole, _emberRuntime, _emberRouting, _emberMetal, _emberGlimmer, _emberViews, _emberTemplateCompiler, _emberApplication, _router) { @@ -75501,7 +72028,6 @@ enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-conso var post1 = {}; var post2 = {}; var post3 = {}; - var currentPost = undefined; var share1 = {}; var share2 = {}; var share3 = {}; @@ -75547,15 +72073,12 @@ enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-conso bootApplication(); - currentPost = post1; handleURL('/posts/1/comments'); handleURL('/posts/1/shares/1'); - currentPost = post2; handleURL('/posts/2/comments'); handleURL('/posts/2/shares/2'); - currentPost = post3; handleURL('/posts/3/comments'); handleURL('/posts/3/shares/3'); }); @@ -75572,7 +72095,6 @@ enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-conso var post1 = {}; var post2 = {}; var post3 = {}; - var currentPost = undefined; var posts = { 1: post1, @@ -75596,13 +72118,8 @@ enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-conso bootApplication(); - currentPost = post1; handleURL('/posts/1/comments'); - - currentPost = post2; handleURL('/posts/2/comments'); - - currentPost = post3; handleURL('/posts/3/comments'); }); @@ -76427,6 +72944,8 @@ enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-conso }); QUnit.test('Route will assert if you try to explicitly render {into: ...} a missing template', function () { + expectDeprecation(/Rendering into a {{render}} helper that resolves to an {{outlet}} is deprecated./); + Router.map(function () { this.route('home', { path: '/' }); }); @@ -77621,7 +74140,12 @@ enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-conso }); QUnit.test('Can this.render({into:...}) the render helper', function () { - _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + expectDeprecation(/Rendering into a {{render}} helper that resolves to an {{outlet}} is deprecated./); + + expectDeprecation(function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + }, /Please refactor [\w\{\}"` ]+ to a component/); + _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('other')); _emberGlimmer.setTemplate('bar', _emberTemplateCompiler.compile('bar')); @@ -77648,7 +74172,12 @@ enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-conso }); QUnit.test('Can disconnect from the render helper', function () { - _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + expectDeprecation(/Rendering into a {{render}} helper that resolves to an {{outlet}} is deprecated./); + + expectDeprecation(function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + }, /Please refactor [\w\{\}"` ]+ to a component/); + _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('other')); @@ -77673,7 +74202,12 @@ enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-conso }); QUnit.test('Can this.render({into:...}) the render helper\'s children', function () { - _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + expectDeprecation(/Rendering into a {{render}} helper that resolves to an {{outlet}} is deprecated./); + + expectDeprecation(function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + }, /Please refactor [\w\{\}"` ]+ to a component/); + _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); _emberGlimmer.setTemplate('other', _emberTemplateCompiler.compile('other')); @@ -77702,7 +74236,12 @@ enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-conso }); QUnit.test('Can disconnect from the render helper\'s children', function () { - _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + expectDeprecation(/Rendering into a {{render}} helper that resolves to an {{outlet}} is deprecated./); + + expectDeprecation(function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + }, /Please refactor [\w\{\}"` ]+ to a component/); + _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); _emberGlimmer.setTemplate('other', _emberTemplateCompiler.compile('other')); @@ -77729,8 +74268,16 @@ enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-conso }); QUnit.test('Can this.render({into:...}) nested render helpers', function () { - _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); - _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); + expectDeprecation(/Rendering into a {{render}} helper that resolves to an {{outlet}} is deprecated./); + + expectDeprecation(function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + }, /Please refactor [\w\{\}"` ]+ to a component/); + + expectDeprecation(function () { + _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); + }, /Please refactor [\w\{\}"` ]+ to a component/); + _emberGlimmer.setTemplate('cart', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('other')); _emberGlimmer.setTemplate('baz', _emberTemplateCompiler.compile('baz')); @@ -77757,8 +74304,16 @@ enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-conso }); QUnit.test('Can disconnect from nested render helpers', function () { - _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); - _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); + expectDeprecation(/Rendering into a {{render}} helper that resolves to an {{outlet}} is deprecated./); + + expectDeprecation(function () { + _emberGlimmer.setTemplate('application', _emberTemplateCompiler.compile('{{render "sidebar"}}')); + }, /Please refactor [\w\{\}"` ]+ to a component/); + + expectDeprecation(function () { + _emberGlimmer.setTemplate('sidebar', _emberTemplateCompiler.compile('')); + }, /Please refactor [\w\{\}"` ]+ to a component/); + _emberGlimmer.setTemplate('cart', _emberTemplateCompiler.compile('
    {{outlet}}
    ')); _emberGlimmer.setTemplate('index', _emberTemplateCompiler.compile('other')); @@ -77983,21 +74538,13 @@ enifed('ember/tests/routing/basic_test', ['exports', 'ember-utils', 'ember-conso equal(router._toplevelView, null, 'the toplevelView was not reinitialized'); }); }); -enifed('ember/tests/routing/basic_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests/routing'); - test('ember/tests/routing/basic_test.js should pass jscs', function () { - ok(true, 'ember/tests/routing/basic_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/routing/basic_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/routing/basic_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests/routing'); - QUnit.test('ember/tests/routing/basic_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/routing/basic_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/routing/basic_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/routing/basic_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'ember-metal', 'ember-routing', 'ember-views', 'internal-test-helpers'], function (exports, _emberRuntime, _emberMetal, _emberRouting, _emberViews, _internalTestHelpers) { @@ -78579,6 +75126,36 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em }); }; + _class.prototype['@test multiple QP value changes only cause a single model refresh'] = function testMultipleQPValueChangesOnlyCauseASingleModelRefresh(assert) { + var _this11 = this; + + assert.expect(2); + + this.setSingleQPController('index', 'alex', 'lol'); + this.setSingleQPController('index', 'steely', 'lel'); + + var refreshCount = 0; + this.registerRoute('index', _emberRouting.Route.extend({ + queryParams: { + alex: { + refreshModel: true + }, + steely: { + refreshModel: true + } + }, + refresh: function () { + refreshCount++; + } + })); + + return this.visitAndAssert('/').then(function () { + var indexController = _this11.getController('index'); + _emberMetal.run(indexController, 'setProperties', { alex: 'fran', steely: 'david' }); + assert.equal(refreshCount, 1, 'index refresh hook only run once'); + }); + }; + _class.prototype['@test refreshModel does not cause a second transition during app boot '] = function testRefreshModelDoesNotCauseASecondTransitionDuringAppBoot(assert) { assert.expect(1); @@ -78600,7 +75177,7 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em }; _class.prototype['@test queryParams are updated when a controller property is set and the route is refreshed. Issue #13263 '] = function testQueryParamsAreUpdatedWhenAControllerPropertyIsSetAndTheRouteIsRefreshedIssue13263(assert) { - var _this11 = this; + var _this12 = this; this.registerTemplate('application', '{{foo}}{{outlet}}'); @@ -78626,16 +75203,16 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em _emberMetal.run(_emberViews.jQuery('#test-button'), 'click'); assert.equal(_emberViews.jQuery('#test-value').text().trim(), '2'); - _this11.assertCurrentPath('/?foo=2'); + _this12.assertCurrentPath('/?foo=2'); _emberMetal.run(_emberViews.jQuery('#test-button'), 'click'); assert.equal(_emberViews.jQuery('#test-value').text().trim(), '3'); - _this11.assertCurrentPath('/?foo=3'); + _this12.assertCurrentPath('/?foo=3'); }); }; _class.prototype['@test Use Ember.get to retrieve query params \'refreshModel\' configuration'] = function testUseEmberGetToRetrieveQueryParamsRefreshModelConfiguration(assert) { - var _this12 = this; + var _this13 = this; assert.expect(7); @@ -78671,8 +75248,8 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em assert.equal(appModelCount, 1); assert.equal(indexModelCount, 1); - var indexController = _this12.getController('index'); - _this12.setAndFlush(indexController, 'omg', 'lex'); + var indexController = _this13.getController('index'); + _this13.setAndFlush(indexController, 'omg', 'lex'); assert.equal(appModelCount, 1); assert.equal(indexModelCount, 2); @@ -78680,7 +75257,7 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em }; _class.prototype['@test can use refreshModel even with URL changes that remove QPs from address bar'] = function testCanUseRefreshModelEvenWithURLChangesThatRemoveQPsFromAddressBar(assert) { - var _this13 = this; + var _this14 = this; assert.expect(4); @@ -78708,15 +75285,15 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visitAndAssert('/?omg=foo').then(function () { - _this13.transitionTo('/'); + _this14.transitionTo('/'); - var indexController = _this13.getController('index'); + var indexController = _this14.getController('index'); assert.equal(indexController.get('omg'), 'lol'); }); }; _class.prototype['@test can opt into a replace query by specifying replace:true in the Route config hash'] = function testCanOptIntoAReplaceQueryBySpecifyingReplaceTrueInTheRouteConfigHash(assert) { - var _this14 = this; + var _this15 = this; assert.expect(2); @@ -78731,14 +75308,14 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visitAndAssert('/').then(function () { - var appController = _this14.getController('application'); - _this14.expectedReplaceURL = '/?alex=wallace'; - _this14.setAndFlush(appController, 'alex', 'wallace'); + var appController = _this15.getController('application'); + _this15.expectedReplaceURL = '/?alex=wallace'; + _this15.setAndFlush(appController, 'alex', 'wallace'); }); }; _class.prototype['@test Route query params config can be configured using property name instead of URL key'] = function testRouteQueryParamsConfigCanBeConfiguredUsingPropertyNameInsteadOfURLKey(assert) { - var _this15 = this; + var _this16 = this; assert.expect(2); @@ -78755,14 +75332,14 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visitAndAssert('/').then(function () { - var appController = _this15.getController('application'); - _this15.expectedReplaceURL = '/?commit_by=igor_seb'; - _this15.setAndFlush(appController, 'commitBy', 'igor_seb'); + var appController = _this16.getController('application'); + _this16.expectedReplaceURL = '/?commit_by=igor_seb'; + _this16.setAndFlush(appController, 'commitBy', 'igor_seb'); }); }; _class.prototype['@test An explicit replace:false on a changed QP always wins and causes a pushState'] = function testAnExplicitReplaceFalseOnAChangedQPAlwaysWinsAndCausesAPushState(assert) { - var _this16 = this; + var _this17 = this; assert.expect(3); @@ -78784,14 +75361,14 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visit('/').then(function () { - var appController = _this16.getController('application'); - _this16.expectedPushURL = '/?alex=wallace&steely=jan'; + var appController = _this17.getController('application'); + _this17.expectedPushURL = '/?alex=wallace&steely=jan'; _emberMetal.run(appController, 'setProperties', { alex: 'wallace', steely: 'jan' }); - _this16.expectedPushURL = '/?alex=wallace&steely=fran'; + _this17.expectedPushURL = '/?alex=wallace&steely=fran'; _emberMetal.run(appController, 'setProperties', { steely: 'fran' }); - _this16.expectedReplaceURL = '/?alex=sriracha&steely=fran'; + _this17.expectedReplaceURL = '/?alex=sriracha&steely=fran'; _emberMetal.run(appController, 'setProperties', { alex: 'sriracha' }); }); }; @@ -78829,7 +75406,7 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em }; _class.prototype['@test Use Ember.get to retrieve query params \'replace\' configuration'] = function testUseEmberGetToRetrieveQueryParamsReplaceConfiguration(assert) { - var _this17 = this; + var _this18 = this; assert.expect(2); @@ -78845,14 +75422,14 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visitAndAssert('/').then(function () { - var appController = _this17.getController('application'); - _this17.expectedReplaceURL = '/?alex=wallace'; - _this17.setAndFlush(appController, 'alex', 'wallace'); + var appController = _this18.getController('application'); + _this18.expectedReplaceURL = '/?alex=wallace'; + _this18.setAndFlush(appController, 'alex', 'wallace'); }); }; _class.prototype['@test can override incoming QP values in setupController'] = function testCanOverrideIncomingQPValuesInSetupController(assert) { - var _this18 = this; + var _this19 = this; assert.expect(3); @@ -78875,13 +75452,13 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visitAndAssert('/about').then(function () { - _this18.transitionTo('index'); - _this18.assertCurrentPath('/?omg=OVERRIDE'); + _this19.transitionTo('index'); + _this19.assertCurrentPath('/?omg=OVERRIDE'); }); }; _class.prototype['@test can override incoming QP array values in setupController'] = function testCanOverrideIncomingQPArrayValuesInSetupController(assert) { - var _this19 = this; + var _this20 = this; assert.expect(3); @@ -78904,29 +75481,29 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visitAndAssert('/about').then(function () { - _this19.transitionTo('index'); - _this19.assertCurrentPath('/?omg=' + encodeURIComponent(JSON.stringify(['OVERRIDE']))); + _this20.transitionTo('index'); + _this20.assertCurrentPath('/?omg=' + encodeURIComponent(JSON.stringify(['OVERRIDE']))); }); }; _class.prototype['@test URL transitions that remove QPs still register as QP changes'] = function testURLTransitionsThatRemoveQPsStillRegisterAsQPChanges(assert) { - var _this20 = this; + var _this21 = this; assert.expect(2); this.setSingleQPController('index', 'omg', 'lol'); return this.visit('/?omg=borf').then(function () { - var indexController = _this20.getController('index'); + var indexController = _this21.getController('index'); assert.equal(indexController.get('omg'), 'borf'); - _this20.transitionTo('/'); + _this21.transitionTo('/'); assert.equal(indexController.get('omg'), 'lol'); }); }; _class.prototype['@test Subresource naming style is supported'] = function testSubresourceNamingStyleIsSupported(assert) { - var _this21 = this; + var _this22 = this; assert.expect(5); @@ -78946,35 +75523,35 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em assert.equal(_emberViews.jQuery('#two').attr('href'), '/abcdef/zoo?bar=456&foo=123'); _emberMetal.run(_emberViews.jQuery('#one'), 'click'); - _this21.assertCurrentPath('/abcdef?foo=123'); + _this22.assertCurrentPath('/abcdef?foo=123'); _emberMetal.run(_emberViews.jQuery('#two'), 'click'); - _this21.assertCurrentPath('/abcdef/zoo?bar=456&foo=123'); + _this22.assertCurrentPath('/abcdef/zoo?bar=456&foo=123'); }); }; _class.prototype['@test transitionTo supports query params'] = function testTransitionToSupportsQueryParams(assert) { - var _this22 = this; + var _this23 = this; this.setSingleQPController('index', 'foo', 'lol'); return this.visitAndAssert('/').then(function () { - _this22.transitionTo({ queryParams: { foo: 'borf' } }); - _this22.assertCurrentPath('/?foo=borf', 'shorthand supported'); + _this23.transitionTo({ queryParams: { foo: 'borf' } }); + _this23.assertCurrentPath('/?foo=borf', 'shorthand supported'); - _this22.transitionTo({ queryParams: { 'index:foo': 'blaf' } }); - _this22.assertCurrentPath('/?foo=blaf', 'longform supported'); + _this23.transitionTo({ queryParams: { 'index:foo': 'blaf' } }); + _this23.assertCurrentPath('/?foo=blaf', 'longform supported'); - _this22.transitionTo({ queryParams: { 'index:foo': false } }); - _this22.assertCurrentPath('/?foo=false', 'longform supported (bool)'); + _this23.transitionTo({ queryParams: { 'index:foo': false } }); + _this23.assertCurrentPath('/?foo=false', 'longform supported (bool)'); - _this22.transitionTo({ queryParams: { foo: false } }); - _this22.assertCurrentPath('/?foo=false', 'shorhand supported (bool)'); + _this23.transitionTo({ queryParams: { foo: false } }); + _this23.assertCurrentPath('/?foo=false', 'shorhand supported (bool)'); }); }; _class.prototype['@test transitionTo supports query params (multiple)'] = function testTransitionToSupportsQueryParamsMultiple(assert) { - var _this23 = this; + var _this24 = this; this.registerController('index', _emberRuntime.Controller.extend({ queryParams: ['foo', 'bar'], @@ -78983,37 +75560,37 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visitAndAssert('/').then(function () { - _this23.transitionTo({ queryParams: { foo: 'borf' } }); - _this23.assertCurrentPath('/?foo=borf', 'shorthand supported'); + _this24.transitionTo({ queryParams: { foo: 'borf' } }); + _this24.assertCurrentPath('/?foo=borf', 'shorthand supported'); - _this23.transitionTo({ queryParams: { 'index:foo': 'blaf' } }); - _this23.assertCurrentPath('/?foo=blaf', 'longform supported'); + _this24.transitionTo({ queryParams: { 'index:foo': 'blaf' } }); + _this24.assertCurrentPath('/?foo=blaf', 'longform supported'); - _this23.transitionTo({ queryParams: { 'index:foo': false } }); - _this23.assertCurrentPath('/?foo=false', 'longform supported (bool)'); + _this24.transitionTo({ queryParams: { 'index:foo': false } }); + _this24.assertCurrentPath('/?foo=false', 'longform supported (bool)'); - _this23.transitionTo({ queryParams: { foo: false } }); - _this23.assertCurrentPath('/?foo=false', 'shorhand supported (bool)'); + _this24.transitionTo({ queryParams: { foo: false } }); + _this24.assertCurrentPath('/?foo=false', 'shorhand supported (bool)'); }); }; _class.prototype['@test setting controller QP to empty string doesn\'t generate null in URL'] = function testSettingControllerQPToEmptyStringDoesnTGenerateNullInURL(assert) { - var _this24 = this; + var _this25 = this; assert.expect(1); this.setSingleQPController('index', 'foo', '123'); return this.visit('/').then(function () { - var controller = _this24.getController('index'); + var controller = _this25.getController('index'); - _this24.expectedPushURL = '/?foo='; - _this24.setAndFlush(controller, 'foo', ''); + _this25.expectedPushURL = '/?foo='; + _this25.setAndFlush(controller, 'foo', ''); }); }; _class.prototype['@test setting QP to empty string doesn\'t generate null in URL'] = function testSettingQPToEmptyStringDoesnTGenerateNullInURL(assert) { - var _this25 = this; + var _this26 = this; assert.expect(1); @@ -79026,15 +75603,15 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visit('/').then(function () { - var controller = _this25.getController('index'); + var controller = _this26.getController('index'); - _this25.expectedPushURL = '/?foo='; - _this25.setAndFlush(controller, 'foo', ''); + _this26.expectedPushURL = '/?foo='; + _this26.setAndFlush(controller, 'foo', ''); }); }; _class.prototype['@test A default boolean value deserializes QPs as booleans rather than strings'] = function testADefaultBooleanValueDeserializesQPsAsBooleansRatherThanStrings(assert) { - var _this26 = this; + var _this27 = this; assert.expect(3); @@ -79047,16 +75624,16 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visit('/?foo=true').then(function () { - var controller = _this26.getController('index'); + var controller = _this27.getController('index'); assert.equal(controller.get('foo'), true); - _this26.transitionTo('/?foo=false'); + _this27.transitionTo('/?foo=false'); assert.equal(controller.get('foo'), false); }); }; _class.prototype['@test Query param without value are empty string'] = function testQueryParamWithoutValueAreEmptyString(assert) { - var _this27 = this; + var _this28 = this; assert.expect(1); @@ -79066,13 +75643,13 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visit('/?foo=').then(function () { - var controller = _this27.getController('index'); + var controller = _this28.getController('index'); assert.equal(controller.get('foo'), ''); }); }; _class.prototype['@test Array query params can be set'] = function testArrayQueryParamsCanBeSet(assert) { - var _this28 = this; + var _this29 = this; assert.expect(2); @@ -79083,48 +75660,48 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em this.setSingleQPController('home', 'foo', []); return this.visit('/').then(function () { - var controller = _this28.getController('home'); + var controller = _this29.getController('home'); - _this28.setAndFlush(controller, 'foo', [1, 2]); - _this28.assertCurrentPath('/?foo=%5B1%2C2%5D'); + _this29.setAndFlush(controller, 'foo', [1, 2]); + _this29.assertCurrentPath('/?foo=%5B1%2C2%5D'); - _this28.setAndFlush(controller, 'foo', [3, 4]); - _this28.assertCurrentPath('/?foo=%5B3%2C4%5D'); + _this29.setAndFlush(controller, 'foo', [3, 4]); + _this29.assertCurrentPath('/?foo=%5B3%2C4%5D'); }); }; _class.prototype['@test (de)serialization: arrays'] = function testDeSerializationArrays(assert) { - var _this29 = this; + var _this30 = this; assert.expect(4); this.setSingleQPController('index', 'foo', [1]); return this.visitAndAssert('/').then(function () { - _this29.transitionTo({ queryParams: { foo: [2, 3] } }); - _this29.assertCurrentPath('/?foo=%5B2%2C3%5D', 'shorthand supported'); - _this29.transitionTo({ queryParams: { 'index:foo': [4, 5] } }); - _this29.assertCurrentPath('/?foo=%5B4%2C5%5D', 'longform supported'); - _this29.transitionTo({ queryParams: { foo: [] } }); - _this29.assertCurrentPath('/?foo=%5B%5D', 'longform supported'); + _this30.transitionTo({ queryParams: { foo: [2, 3] } }); + _this30.assertCurrentPath('/?foo=%5B2%2C3%5D', 'shorthand supported'); + _this30.transitionTo({ queryParams: { 'index:foo': [4, 5] } }); + _this30.assertCurrentPath('/?foo=%5B4%2C5%5D', 'longform supported'); + _this30.transitionTo({ queryParams: { foo: [] } }); + _this30.assertCurrentPath('/?foo=%5B%5D', 'longform supported'); }); }; _class.prototype['@test Url with array query param sets controller property to array'] = function testUrlWithArrayQueryParamSetsControllerPropertyToArray(assert) { - var _this30 = this; + var _this31 = this; assert.expect(1); this.setSingleQPController('index', 'foo', ''); return this.visit('/?foo[]=1&foo[]=2&foo[]=3').then(function () { - var controller = _this30.getController('index'); + var controller = _this31.getController('index'); assert.deepEqual(controller.get('foo'), ['1', '2', '3']); }); }; _class.prototype['@test Array query params can be pushed/popped'] = function testArrayQueryParamsCanBePushedPopped(assert) { - var _this31 = this; + var _this32 = this; assert.expect(17); @@ -79135,44 +75712,44 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em this.setSingleQPController('home', 'foo', _emberRuntime.A()); return this.visitAndAssert('/').then(function () { - var controller = _this31.getController('home'); + var controller = _this32.getController('home'); _emberMetal.run(controller.foo, 'pushObject', 1); - _this31.assertCurrentPath('/?foo=%5B1%5D'); + _this32.assertCurrentPath('/?foo=%5B1%5D'); assert.deepEqual(controller.foo, [1]); _emberMetal.run(controller.foo, 'popObject'); - _this31.assertCurrentPath('/'); + _this32.assertCurrentPath('/'); assert.deepEqual(controller.foo, []); _emberMetal.run(controller.foo, 'pushObject', 1); - _this31.assertCurrentPath('/?foo=%5B1%5D'); + _this32.assertCurrentPath('/?foo=%5B1%5D'); assert.deepEqual(controller.foo, [1]); _emberMetal.run(controller.foo, 'popObject'); - _this31.assertCurrentPath('/'); + _this32.assertCurrentPath('/'); assert.deepEqual(controller.foo, []); _emberMetal.run(controller.foo, 'pushObject', 1); - _this31.assertCurrentPath('/?foo=%5B1%5D'); + _this32.assertCurrentPath('/?foo=%5B1%5D'); assert.deepEqual(controller.foo, [1]); _emberMetal.run(controller.foo, 'pushObject', 2); - _this31.assertCurrentPath('/?foo=%5B1%2C2%5D'); + _this32.assertCurrentPath('/?foo=%5B1%2C2%5D'); assert.deepEqual(controller.foo, [1, 2]); _emberMetal.run(controller.foo, 'popObject'); - _this31.assertCurrentPath('/?foo=%5B1%5D'); + _this32.assertCurrentPath('/?foo=%5B1%5D'); assert.deepEqual(controller.foo, [1]); _emberMetal.run(controller.foo, 'unshiftObject', 'lol'); - _this31.assertCurrentPath('/?foo=%5B%22lol%22%2C1%5D'); + _this32.assertCurrentPath('/?foo=%5B%22lol%22%2C1%5D'); assert.deepEqual(controller.foo, ['lol', 1]); }); }; _class.prototype['@test Overwriting with array with same content shouldn\'t refire update'] = function testOverwritingWithArrayWithSameContentShouldnTRefireUpdate(assert) { - var _this32 = this; + var _this33 = this; assert.expect(4); @@ -79192,16 +75769,16 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em return this.visitAndAssert('/').then(function () { assert.equal(modelCount, 1); - var controller = _this32.getController('home'); - _this32.setAndFlush(controller, 'model', _emberRuntime.A([1])); + var controller = _this33.getController('home'); + _this33.setAndFlush(controller, 'model', _emberRuntime.A([1])); assert.equal(modelCount, 1); - _this32.assertCurrentPath('/'); + _this33.assertCurrentPath('/'); }); }; _class.prototype['@test Defaulting to params hash as the model should not result in that params object being watched'] = function testDefaultingToParamsHashAsTheModelShouldNotResultInThatParamsObjectBeingWatched(assert) { - var _this33 = this; + var _this34 = this; assert.expect(1); @@ -79223,7 +75800,7 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visit('/').then(function () { - _this33.transitionTo('other'); + _this34.transitionTo('other'); }); }; @@ -79250,7 +75827,7 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em }; _class.prototype['@test opting into replace does not affect transitions between routes'] = function testOptingIntoReplaceDoesNotAffectTransitionsBetweenRoutes(assert) { - var _this34 = this; + var _this35 = this; assert.expect(5); @@ -79272,27 +75849,27 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visit('/').then(function () { - var controller = _this34.getController('bar'); + var controller = _this35.getController('bar'); - _this34.expectedPushURL = '/foo'; + _this35.expectedPushURL = '/foo'; _emberMetal.run(_emberViews.jQuery('#foo-link'), 'click'); - _this34.expectedPushURL = '/bar'; + _this35.expectedPushURL = '/bar'; _emberMetal.run(_emberViews.jQuery('#bar-no-qp-link'), 'click'); - _this34.expectedReplaceURL = '/bar?raytiley=woot'; - _this34.setAndFlush(controller, 'raytiley', 'woot'); + _this35.expectedReplaceURL = '/bar?raytiley=woot'; + _this35.setAndFlush(controller, 'raytiley', 'woot'); - _this34.expectedPushURL = '/foo'; + _this35.expectedPushURL = '/foo'; _emberMetal.run(_emberViews.jQuery('#foo-link'), 'click'); - _this34.expectedPushURL = '/bar?raytiley=isthebest'; + _this35.expectedPushURL = '/bar?raytiley=isthebest'; _emberMetal.run(_emberViews.jQuery('#bar-link'), 'click'); }); }; _class.prototype['@test undefined isn\'t serialized or deserialized into a string'] = function testUndefinedIsnTSerializedOrDeserializedIntoAString(assert) { - var _this35 = this; + var _this36 = this; assert.expect(4); @@ -79313,10 +75890,10 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visitAndAssert('/').then(function () { - assert.equal(_this35.$('#the-link').attr('href'), '/example', 'renders without undefined qp serialized'); + assert.equal(_this36.$('#the-link').attr('href'), '/example', 'renders without undefined qp serialized'); - return _this35.transitionTo('example', { queryParams: { foo: undefined } }).then(function () { - _this35.assertCurrentPath('/example'); + return _this36.transitionTo('example', { queryParams: { foo: undefined } }).then(function () { + _this36.assertCurrentPath('/example'); }); }); }; @@ -79334,7 +75911,7 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em }; _class.prototype['@test warn user that Route\'s queryParams configuration must be an Object, not an Array'] = function testWarnUserThatRouteSQueryParamsConfigurationMustBeAnObjectNotAnArray(assert) { - var _this36 = this; + var _this37 = this; assert.expect(1); @@ -79343,12 +75920,12 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); expectAssertion(function () { - _this36.visit('/'); + _this37.visit('/'); }, 'You passed in `[{"commitBy":{"replace":true}}]` as the value for `queryParams` but `queryParams` cannot be an Array'); }; _class.prototype['@test handle route names that clash with Object.prototype properties'] = function testHandleRouteNamesThatClashWithObjectPrototypeProperties(assert) { - var _this37 = this; + var _this38 = this; assert.expect(1); @@ -79365,8 +75942,8 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em })); return this.visit('/').then(function () { - _this37.transitionTo('constructor', { queryParams: { foo: '999' } }); - var controller = _this37.getController('constructor'); + _this38.transitionTo('constructor', { queryParams: { foo: '999' } }); + var controller = _this38.getController('constructor'); assert.equal(_emberMetal.get(controller, 'foo'), '999'); }); }; @@ -79374,21 +75951,13 @@ enifed('ember/tests/routing/query_params_test', ['exports', 'ember-runtime', 'em return _class; })(_internalTestHelpers.QueryParamTestCase)); }); -enifed('ember/tests/routing/query_params_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests/routing'); - test('ember/tests/routing/query_params_test.js should pass jscs', function () { - ok(true, 'ember/tests/routing/query_params_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/routing/query_params_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/routing/query_params_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests/routing'); - QUnit.test('ember/tests/routing/query_params_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/routing/query_params_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/routing/query_params_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/routing/query_params_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test', ['exports', 'ember-runtime', 'ember-routing', 'ember-metal', 'ember-views', 'internal-test-helpers'], function (exports, _emberRuntime, _emberRouting, _emberMetal, _emberViews, _internalTestHelpers) { @@ -80284,24 +76853,16 @@ enifed('ember/tests/routing/query_params_test/model_dependent_state_with_query_p return _class3; })(ModelDependentQPTestCase)); }); -enifed('ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests/routing/query_params_test'); - test('ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js should pass jscs', function () { - ok(true, 'ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests/routing/query_params_test'); - QUnit.test('ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js should pass ESLint\n\n'); }); }); -enifed('ember/tests/routing/query_params_test/overlapping_query_params_test', ['exports', 'ember-runtime', 'ember-metal', 'internal-test-helpers'], function (exports, _emberRuntime, _emberMetal, _internalTestHelpers) { +enifed('ember/tests/routing/query_params_test/overlapping_query_params_test', ['exports', 'ember-runtime', 'ember-routing', 'ember-metal', 'internal-test-helpers'], function (exports, _emberRuntime, _emberRouting, _emberMetal, _internalTestHelpers) { 'use strict'; _internalTestHelpers.moduleFor('Query Params - overlapping query param property names', (function (_QueryParamTestCase) { @@ -80422,21 +76983,38 @@ enifed('ember/tests/routing/query_params_test/overlapping_query_params_test', [' }); }; - _class.prototype['@test query params in the same route hierarchy with the same url key get auto-scoped'] = function testQueryParamsInTheSameRouteHierarchyWithTheSameUrlKeyGetAutoScoped(assert) { + _class.prototype['@test query params does not error when a query parameter exists for route instances that share a controller'] = function testQueryParamsDoesNotErrorWhenAQueryParameterExistsForRouteInstancesThatShareAController(assert) { var _this5 = this; assert.expect(1); + var parentController = _emberRuntime.Controller.extend({ + queryParams: { page: 'page' } + }); + this.registerController('parent', parentController); + this.registerRoute('parent.child', _emberRouting.Route.extend({ controllerName: 'parent' })); + + return this.setupBase('/parent').then(function () { + _this5.transitionTo('parent.child', { queryParams: { page: 2 } }); + _this5.assertCurrentPath('/parent/child?page=2'); + }); + }; + + _class.prototype['@test query params in the same route hierarchy with the same url key get auto-scoped'] = function testQueryParamsInTheSameRouteHierarchyWithTheSameUrlKeyGetAutoScoped(assert) { + var _this6 = this; + + assert.expect(1); + this.setMappedQPController('parent'); this.setMappedQPController('parent.child'); expectAssertion(function () { - _this5.setupBase(); + _this6.setupBase(); }, 'You\'re not allowed to have more than one controller property map to the same query param key, but both `parent:page` and `parent.child:page` map to `parentPage`. You can fix this by mapping one of the controller properties to a different query param key via the `as` config option, e.g. `page: { as: \'other-page\' }`'); }; _class.prototype['@test Support shared but overridable mixin pattern'] = function testSupportSharedButOverridableMixinPattern(assert) { - var _this6 = this; + var _this7 = this; assert.expect(7); @@ -80452,18 +77030,18 @@ enifed('ember/tests/routing/query_params_test/overlapping_query_params_test', [' this.registerController('parent.child', _emberRuntime.Controller.extend(HasPage)); return this.setupBase().then(function () { - _this6.assertCurrentPath('/parent/child'); + _this7.assertCurrentPath('/parent/child'); - var parentController = _this6.getController('parent'); - var parentChildController = _this6.getController('parent.child'); + var parentController = _this7.getController('parent'); + var parentChildController = _this7.getController('parent.child'); - _this6.setAndFlush(parentChildController, 'page', 2); - _this6.assertCurrentPath('/parent/child?page=2'); + _this7.setAndFlush(parentChildController, 'page', 2); + _this7.assertCurrentPath('/parent/child?page=2'); assert.equal(parentController.get('page'), 1); assert.equal(parentChildController.get('page'), 2); - _this6.setAndFlush(parentController, 'page', 2); - _this6.assertCurrentPath('/parent/child?page=2&yespage=2'); + _this7.setAndFlush(parentController, 'page', 2); + _this7.assertCurrentPath('/parent/child?page=2&yespage=2'); assert.equal(parentController.get('page'), 2); assert.equal(parentChildController.get('page'), 2); }); @@ -80472,21 +77050,13 @@ enifed('ember/tests/routing/query_params_test/overlapping_query_params_test', [' return _class; })(_internalTestHelpers.QueryParamTestCase)); }); -enifed('ember/tests/routing/query_params_test/overlapping_query_params_test.jscs-test', ['exports'], function (exports) { +enifed('ember/tests/routing/query_params_test/overlapping_query_params_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember/tests/routing/query_params_test'); - test('ember/tests/routing/query_params_test/overlapping_query_params_test.js should pass jscs', function () { - ok(true, 'ember/tests/routing/query_params_test/overlapping_query_params_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/routing/query_params_test/overlapping_query_params_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember/tests/routing/query_params_test'); - QUnit.test('ember/tests/routing/query_params_test/overlapping_query_params_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/routing/query_params_test/overlapping_query_params_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/routing/query_params_test/overlapping_query_params_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/routing/query_params_test/overlapping_query_params_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/routing/query_params_test/query_param_async_get_handler_test', ['exports', 'ember-runtime', 'ember-routing', 'internal-test-helpers'], function (exports, _emberRuntime, _emberRouting, _internalTestHelpers) { @@ -80716,21 +77286,13 @@ enifed('ember/tests/routing/query_params_test/query_param_async_get_handler_test return _class; })(_internalTestHelpers.QueryParamTestCase)); }); -enifed('ember/tests/routing/query_params_test/query_param_async_get_handler_test.jscs-test', ['exports'], function (exports) { +enifed('ember/tests/routing/query_params_test/query_param_async_get_handler_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember/tests/routing/query_params_test'); - test('ember/tests/routing/query_params_test/query_param_async_get_handler_test.js should pass jscs', function () { - ok(true, 'ember/tests/routing/query_params_test/query_param_async_get_handler_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/routing/query_params_test/query_param_async_get_handler_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember/tests/routing/query_params_test'); - QUnit.test('ember/tests/routing/query_params_test/query_param_async_get_handler_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/routing/query_params_test/query_param_async_get_handler_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/routing/query_params_test/query_param_async_get_handler_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/routing/query_params_test/query_param_async_get_handler_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/routing/query_params_test/query_params_paramless_link_to_test', ['exports', 'ember-runtime', 'ember-views', 'internal-test-helpers'], function (exports, _emberRuntime, _emberViews, _internalTestHelpers) { @@ -80769,21 +77331,13 @@ enifed('ember/tests/routing/query_params_test/query_params_paramless_link_to_tes return _class; })(_internalTestHelpers.QueryParamTestCase)); }); -enifed('ember/tests/routing/query_params_test/query_params_paramless_link_to_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests/routing/query_params_test'); - test('ember/tests/routing/query_params_test/query_params_paramless_link_to_test.js should pass jscs', function () { - ok(true, 'ember/tests/routing/query_params_test/query_params_paramless_link_to_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/routing/query_params_test/query_params_paramless_link_to_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/routing/query_params_test/query_params_paramless_link_to_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests/routing/query_params_test'); - QUnit.test('ember/tests/routing/query_params_test/query_params_paramless_link_to_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/routing/query_params_test/query_params_paramless_link_to_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/routing/query_params_test/query_params_paramless_link_to_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/routing/query_params_test/query_params_paramless_link_to_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/routing/query_params_test/shared_state_test', ['exports', 'ember-runtime', 'ember', 'ember-metal', 'ember-views', 'internal-test-helpers'], function (exports, _emberRuntime, _ember, _emberMetal, _emberViews, _internalTestHelpers) { @@ -80867,21 +77421,13 @@ enifed('ember/tests/routing/query_params_test/shared_state_test', ['exports', 'e return _class; })(_internalTestHelpers.QueryParamTestCase)); }); -enifed('ember/tests/routing/query_params_test/shared_state_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests/routing/query_params_test'); - test('ember/tests/routing/query_params_test/shared_state_test.js should pass jscs', function () { - ok(true, 'ember/tests/routing/query_params_test/shared_state_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/routing/query_params_test/shared_state_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/routing/query_params_test/shared_state_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests/routing/query_params_test'); - QUnit.test('ember/tests/routing/query_params_test/shared_state_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/routing/query_params_test/shared_state_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/routing/query_params_test/shared_state_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/routing/query_params_test/shared_state_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/routing/router_map_test', ['exports', 'ember-metal', 'ember-template-compiler', 'ember-application', 'ember-routing', 'ember-views', 'ember-glimmer'], function (exports, _emberMetal, _emberTemplateCompiler, _emberApplication, _emberRouting, _emberViews, _emberGlimmer) { @@ -80971,21 +77517,586 @@ enifed('ember/tests/routing/router_map_test', ['exports', 'ember-metal', 'ember- equal(_emberViews.jQuery('#qunit-fixture').text(), 'Goodbye!', 'The goodbye template was rendered'); }); }); -enifed('ember/tests/routing/router_map_test.jscs-test', ['exports'], function (exports) { +enifed('ember/tests/routing/router_map_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember/tests/routing'); - test('ember/tests/routing/router_map_test.js should pass jscs', function () { - ok(true, 'ember/tests/routing/router_map_test.js should pass jscs.'); + QUnit.module('ESLint | ember/tests/routing/router_map_test.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/router_map_test.js should pass ESLint\n\n'); }); }); -enifed('ember/tests/routing/router_map_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/routing/router_service_test/basic_test', ['exports', 'ember-runtime', 'ember-glimmer', 'ember-routing', 'ember-metal', 'internal-test-helpers'], function (exports, _emberRuntime, _emberGlimmer, _emberRouting, _emberMetal, _internalTestHelpers) { 'use strict'; - QUnit.module('JSHint - ember/tests/routing'); - QUnit.test('ember/tests/routing/router_map_test.js should pass jshint', function (assert) { + if (_emberMetal.isFeatureEnabled('ember-routing-router-service')) { + _internalTestHelpers.moduleFor('Router Service - main', (function (_RouterTestCase) { + babelHelpers.inherits(_class, _RouterTestCase); + + function _class() { + _RouterTestCase.apply(this, arguments); + } + + _class.prototype['@test RouterService#currentRouteName is correctly set for top level route'] = function testRouterServiceCurrentRouteNameIsCorrectlySetForTopLevelRoute(assert) { + var _this = this; + + assert.expect(1); + + return this.visit('/').then(function () { + assert.equal(_this.routerService.get('currentRouteName'), 'parent.index'); + }); + }; + + _class.prototype['@test RouterService#currentRouteName is correctly set for child route'] = function testRouterServiceCurrentRouteNameIsCorrectlySetForChildRoute(assert) { + var _this2 = this; + + assert.expect(1); + + return this.visit('/child').then(function () { + assert.equal(_this2.routerService.get('currentRouteName'), 'parent.child'); + }); + }; + + _class.prototype['@test RouterService#currentRouteName is correctly set after transition'] = function testRouterServiceCurrentRouteNameIsCorrectlySetAfterTransition(assert) { + var _this3 = this; + + assert.expect(1); + + return this.visit('/child').then(function () { + return _this3.routerService.transitionTo('parent.sister'); + }).then(function () { + assert.equal(_this3.routerService.get('currentRouteName'), 'parent.sister'); + }); + }; + + _class.prototype['@test RouterService#currentRouteName is correctly set on each transition'] = function testRouterServiceCurrentRouteNameIsCorrectlySetOnEachTransition(assert) { + var _this4 = this; + + assert.expect(3); + + return this.visit('/child').then(function () { + assert.equal(_this4.routerService.get('currentRouteName'), 'parent.child'); + + return _this4.visit('/sister'); + }).then(function () { + assert.equal(_this4.routerService.get('currentRouteName'), 'parent.sister'); + + return _this4.visit('/brother'); + }).then(function () { + assert.equal(_this4.routerService.get('currentRouteName'), 'parent.brother'); + }); + }; + + _class.prototype['@test RouterService#rootURL is correctly set to the default value'] = function testRouterServiceRootURLIsCorrectlySetToTheDefaultValue(assert) { + var _this5 = this; + + assert.expect(1); + + return this.visit('/').then(function () { + assert.equal(_this5.routerService.get('rootURL'), '/'); + }); + }; + + _class.prototype['@test RouterService#rootURL is correctly set to a custom value'] = function testRouterServiceRootURLIsCorrectlySetToACustomValue(assert) { + var _this6 = this; + + assert.expect(1); + + this.registerRoute('parent.index', _emberRouting.Route.extend({ + init: function () { + this._super(); + _emberMetal.set(this.router, 'rootURL', '/homepage'); + } + })); + + return this.visit('/').then(function () { + assert.equal(_this6.routerService.get('rootURL'), '/homepage'); + }); + }; + + _class.prototype['@test RouterService#location is correctly delegated from router:main'] = function testRouterServiceLocationIsCorrectlyDelegatedFromRouterMain(assert) { + var _this7 = this; + + assert.expect(2); + + return this.visit('/').then(function () { + var location = _this7.routerService.get('location'); + assert.ok(location); + assert.ok(location instanceof _emberRouting.NoneLocation); + }); + }; + + return _class; + })(_internalTestHelpers.RouterTestCase)); + } +}); +enifed('ember/tests/routing/router_service_test/basic_test.lint-test', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('ESLint | ember/tests/routing/router_service_test/basic_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/routing/router_map_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/routing/router_service_test/basic_test.js should pass ESLint\n\n'); + }); +}); +enifed('ember/tests/routing/router_service_test/currenturl_lifecycle_test', ['exports', 'ember-runtime', 'ember-glimmer', 'ember-routing', 'ember-metal', 'internal-test-helpers'], function (exports, _emberRuntime, _emberGlimmer, _emberRouting, _emberMetal, _internalTestHelpers) { + 'use strict'; + + if (_emberMetal.isFeatureEnabled('ember-routing-router-service')) { + (function () { + var results = []; + var ROUTE_NAMES = ['index', 'child', 'sister', 'brother']; + + var InstrumentedRoute = _emberRouting.Route.extend({ + routerService: _emberRuntime.inject.service('router'), + + beforeModel: function () { + var service = _emberMetal.get(this, 'routerService'); + results.push([service.get('currentRouteName'), 'beforeModel', service.get('currentURL')]); + }, + + model: function () { + var service = _emberMetal.get(this, 'routerService'); + results.push([service.get('currentRouteName'), 'model', service.get('currentURL')]); + }, + + afterModel: function () { + var service = _emberMetal.get(this, 'routerService'); + results.push([service.get('currentRouteName'), 'afterModel', service.get('currentURL')]); + } + }); + + _internalTestHelpers.moduleFor('Router Service - currentURL', (function (_RouterTestCase) { + babelHelpers.inherits(_class, _RouterTestCase); + + function _class() { + var _this = this; + + _RouterTestCase.call(this); + + results = []; + + ROUTE_NAMES.forEach(function (name) { + var routeName = 'parent.' + name; + _this.registerRoute(routeName, InstrumentedRoute.extend()); + _this.registerTemplate(routeName, '{{current-url}}'); + }); + + this.registerComponent('current-url', { + ComponentClass: _emberGlimmer.Component.extend({ + routerService: _emberRuntime.inject.service('router'), + currentURL: _emberRuntime.readOnly('routerService.currentURL') + }), + template: '{{currentURL}}' + }); + } + + _class.prototype['@test RouterService#currentURL is correctly set for top level route'] = function testRouterServiceCurrentURLIsCorrectlySetForTopLevelRoute(assert) { + var _this2 = this; + + assert.expect(1); + + return this.visit('/').then(function () { + assert.equal(_this2.routerService.get('currentURL'), '/'); + }); + }; + + _class.prototype['@test RouterService#currentURL is correctly set for child route'] = function testRouterServiceCurrentURLIsCorrectlySetForChildRoute(assert) { + var _this3 = this; + + assert.expect(1); + + return this.visit('/child').then(function () { + assert.equal(_this3.routerService.get('currentURL'), '/child'); + }); + }; + + _class.prototype['@test RouterService#currentURL is correctly set after transition'] = function testRouterServiceCurrentURLIsCorrectlySetAfterTransition(assert) { + var _this4 = this; + + assert.expect(1); + + return this.visit('/child').then(function () { + return _this4.routerService.transitionTo('parent.sister'); + }).then(function () { + assert.equal(_this4.routerService.get('currentURL'), '/sister'); + }); + }; + + _class.prototype['@test RouterService#currentURL is correctly set on each transition'] = function testRouterServiceCurrentURLIsCorrectlySetOnEachTransition(assert) { + var _this5 = this; + + assert.expect(3); + + return this.visit('/child').then(function () { + assert.equal(_this5.routerService.get('currentURL'), '/child'); + + return _this5.visit('/sister'); + }).then(function () { + assert.equal(_this5.routerService.get('currentURL'), '/sister'); + + return _this5.visit('/brother'); + }).then(function () { + assert.equal(_this5.routerService.get('currentURL'), '/brother'); + }); + }; + + _class.prototype['@test RouterService#currentURL is not set during lifecycle hooks'] = function testRouterServiceCurrentURLIsNotSetDuringLifecycleHooks(assert) { + var _this6 = this; + + assert.expect(2); + + return this.visit('/').then(function () { + assert.deepEqual(results, [[null, 'beforeModel', null], [null, 'model', null], [null, 'afterModel', null]]); + + results = []; + + return _this6.visit('/child'); + }).then(function () { + assert.deepEqual(results, [['parent.index', 'beforeModel', '/'], ['parent.index', 'model', '/'], ['parent.index', 'afterModel', '/']]); + }); + }; + + _class.prototype['@test RouterService#currentURL is correctly set with component after consecutive visits'] = function testRouterServiceCurrentURLIsCorrectlySetWithComponentAfterConsecutiveVisits(assert) { + var _this7 = this; + + assert.expect(3); + + return this.visit('/').then(function () { + _this7.assertText('/'); + + return _this7.visit('/child'); + }).then(function () { + _this7.assertText('/child'); + + return _this7.visit('/'); + }).then(function () { + _this7.assertText('/'); + }); + }; + + return _class; + })(_internalTestHelpers.RouterTestCase)); + })(); + } +}); +enifed('ember/tests/routing/router_service_test/currenturl_lifecycle_test.lint-test', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('ESLint | ember/tests/routing/router_service_test/currenturl_lifecycle_test.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/router_service_test/currenturl_lifecycle_test.js should pass ESLint\n\n'); + }); +}); +enifed('ember/tests/routing/router_service_test/replaceWith_test', ['exports', 'ember-routing', 'internal-test-helpers', 'router', 'ember-metal'], function (exports, _emberRouting, _internalTestHelpers, _router, _emberMetal) { + 'use strict'; + + if (_emberMetal.isFeatureEnabled('ember-routing-router-service')) { + _internalTestHelpers.moduleFor('Router Service - replaceWith', (function (_RouterTestCase) { + babelHelpers.inherits(_class, _RouterTestCase); + + function _class() { + _RouterTestCase.call(this); + + var testCase = this; + testCase.state = []; + + this.application.register('location:test', _emberRouting.NoneLocation.extend({ + setURL: function (path) { + testCase.state.push(path); + this.set('path', path); + }, + + replaceURL: function (path) { + testCase.state.splice(testCase.state.length - 1, 1, path); + this.set('path', path); + } + })); + } + + _class.prototype['@test RouterService#replaceWith returns a Transition'] = function testRouterServiceReplaceWithReturnsATransition(assert) { + var _this = this; + + assert.expect(1); + + var transition = undefined; + + return this.visit('/').then(function () { + transition = _this.routerService.replaceWith('parent.child'); + + assert.ok(transition instanceof _router.Transition); + + return transition; + }); + }; + + _class.prototype['@test RouterService#replaceWith with basic route replaces location'] = function testRouterServiceReplaceWithWithBasicRouteReplacesLocation(assert) { + var _this2 = this; + + assert.expect(1); + + return this.visit('/').then(function () { + return _this2.routerService.transitionTo('parent.child'); + }).then(function () { + return _this2.routerService.transitionTo('parent.sister'); + }).then(function () { + return _this2.routerService.replaceWith('parent.brother'); + }).then(function () { + assert.deepEqual(_this2.state, ['/', '/child', '/brother']); + }); + }; + + _class.prototype['@test RouterService#replaceWith transitioning back to previously visited route replaces location'] = function testRouterServiceReplaceWithTransitioningBackToPreviouslyVisitedRouteReplacesLocation(assert) { + var _this3 = this; + + assert.expect(1); + + return this.visit('/').then(function () { + return _this3.routerService.transitionTo('parent.child'); + }).then(function () { + return _this3.routerService.transitionTo('parent.sister'); + }).then(function () { + return _this3.routerService.transitionTo('parent.brother'); + }).then(function () { + return _this3.routerService.replaceWith('parent.sister'); + }).then(function () { + assert.deepEqual(_this3.state, ['/', '/child', '/sister', '/sister']); + }); + }; + + babelHelpers.createClass(_class, [{ + key: 'routerOptions', + get: function () { + return { + location: 'test' + }; + } + }]); + return _class; + })(_internalTestHelpers.RouterTestCase)); + } +}); +enifed('ember/tests/routing/router_service_test/replaceWith_test.lint-test', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('ESLint | ember/tests/routing/router_service_test/replaceWith_test.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/router_service_test/replaceWith_test.js should pass ESLint\n\n'); + }); +}); +enifed('ember/tests/routing/router_service_test/transitionTo_test', ['exports', 'ember-runtime', 'ember-glimmer', 'ember-routing', 'ember-metal', 'internal-test-helpers', 'router'], function (exports, _emberRuntime, _emberGlimmer, _emberRouting, _emberMetal, _internalTestHelpers, _router) { + 'use strict'; + + if (_emberMetal.isFeatureEnabled('ember-routing-router-service')) { + _internalTestHelpers.moduleFor('Router Service - transitionTo', (function (_RouterTestCase) { + babelHelpers.inherits(_class, _RouterTestCase); + + function _class() { + _RouterTestCase.call(this); + + var testCase = this; + testCase.state = []; + + this.application.register('location:test', _emberRouting.NoneLocation.extend({ + setURL: function (path) { + testCase.state.push(path); + this.set('path', path); + }, + + replaceURL: function (path) { + testCase.state.splice(testCase.state.length - 1, 1, path); + this.set('path', path); + } + })); + } + + _class.prototype['@test RouterService#transitionTo returns a Transition'] = function testRouterServiceTransitionToReturnsATransition(assert) { + var _this = this; + + assert.expect(1); + + var transition = undefined; + + return this.visit('/').then(function () { + transition = _this.routerService.transitionTo('parent.child'); + + assert.ok(transition instanceof _router.Transition); + + return transition; + }); + }; + + _class.prototype['@test RouterService#transitionTo with basic route updates location'] = function testRouterServiceTransitionToWithBasicRouteUpdatesLocation(assert) { + var _this2 = this; + + assert.expect(1); + + return this.visit('/').then(function () { + return _this2.routerService.transitionTo('parent.child'); + }).then(function () { + return _this2.routerService.transitionTo('parent.sister'); + }).then(function () { + return _this2.routerService.transitionTo('parent.brother'); + }).then(function () { + assert.deepEqual(_this2.state, ['/', '/child', '/sister', '/brother']); + }); + }; + + _class.prototype['@test RouterService#transitionTo transitioning back to previously visited route updates location'] = function testRouterServiceTransitionToTransitioningBackToPreviouslyVisitedRouteUpdatesLocation(assert) { + var _this3 = this; + + assert.expect(1); + + return this.visit('/').then(function () { + return _this3.routerService.transitionTo('parent.child'); + }).then(function () { + return _this3.routerService.transitionTo('parent.sister'); + }).then(function () { + return _this3.routerService.transitionTo('parent.brother'); + }).then(function () { + return _this3.routerService.transitionTo('parent.sister'); + }).then(function () { + assert.deepEqual(_this3.state, ['/', '/child', '/sister', '/brother', '/sister']); + }); + }; + + _class.prototype['@test RouterService#transitionTo with basic route'] = function testRouterServiceTransitionToWithBasicRoute(assert) { + var _this4 = this; + + assert.expect(1); + + var componentInstance = undefined; + + this.registerTemplate('parent.index', '{{foo-bar}}'); + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmer.Component.extend({ + routerService: _emberRuntime.inject.service('router'), + init: function () { + this._super(); + componentInstance = this; + }, + actions: { + transitionToSister: function () { + _emberMetal.get(this, 'routerService').transitionTo('parent.sister'); + } + } + }), + template: 'foo-bar' + }); + + return this.visit('/').then(function () { + _emberMetal.run(function () { + componentInstance.send('transitionToSister'); + }); + + assert.equal(_this4.routerService.get('currentRouteName'), 'parent.sister'); + }); + }; + + _class.prototype['@test RouterService#transitionTo with dynamic segment'] = function testRouterServiceTransitionToWithDynamicSegment(assert) { + var _this5 = this; + + assert.expect(3); + + var componentInstance = undefined; + var dynamicModel = { id: 1, contents: 'much dynamicism' }; + + this.registerTemplate('parent.index', '{{foo-bar}}'); + this.registerTemplate('dynamic', '{{model.contents}}'); + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmer.Component.extend({ + routerService: _emberRuntime.inject.service('router'), + init: function () { + this._super(); + componentInstance = this; + }, + actions: { + transitionToDynamic: function () { + _emberMetal.get(this, 'routerService').transitionTo('dynamic', dynamicModel); + } + } + }), + template: 'foo-bar' + }); + + return this.visit('/').then(function () { + _emberMetal.run(function () { + componentInstance.send('transitionToDynamic'); + }); + + assert.equal(_this5.routerService.get('currentRouteName'), 'dynamic'); + assert.equal(_this5.routerService.get('currentURL'), '/dynamic/1'); + _this5.assertText('much dynamicism'); + }); + }; + + _class.prototype['@test RouterService#transitionTo with dynamic segment and model hook'] = function testRouterServiceTransitionToWithDynamicSegmentAndModelHook(assert) { + var _this6 = this; + + assert.expect(3); + + var componentInstance = undefined; + var dynamicModel = { id: 1, contents: 'much dynamicism' }; + + this.registerRoute('dynamic', _emberRouting.Route.extend({ + model: function () { + return dynamicModel; + } + })); + + this.registerTemplate('parent.index', '{{foo-bar}}'); + this.registerTemplate('dynamic', '{{model.contents}}'); + + this.registerComponent('foo-bar', { + ComponentClass: _emberGlimmer.Component.extend({ + routerService: _emberRuntime.inject.service('router'), + init: function () { + this._super(); + componentInstance = this; + }, + actions: { + transitionToDynamic: function () { + _emberMetal.get(this, 'routerService').transitionTo('dynamic', 1); + } + } + }), + template: 'foo-bar' + }); + + return this.visit('/').then(function () { + _emberMetal.run(function () { + componentInstance.send('transitionToDynamic'); + }); + + assert.equal(_this6.routerService.get('currentRouteName'), 'dynamic'); + assert.equal(_this6.routerService.get('currentURL'), '/dynamic/1'); + _this6.assertText('much dynamicism'); + }); + }; + + babelHelpers.createClass(_class, [{ + key: 'routerOptions', + get: function () { + return { + location: 'test' + }; + } + }]); + return _class; + })(_internalTestHelpers.RouterTestCase)); + } +}); +enifed('ember/tests/routing/router_service_test/transitionTo_test.lint-test', ['exports'], function (exports) { + 'use strict'; + + QUnit.module('ESLint | ember/tests/routing/router_service_test/transitionTo_test.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'ember/tests/routing/router_service_test/transitionTo_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/routing/substates_test', ['exports', 'ember-runtime', 'ember-routing', 'ember-metal', 'ember-template-compiler', 'ember-application', 'ember-views', 'ember-glimmer'], function (exports, _emberRuntime, _emberRouting, _emberMetal, _emberTemplateCompiler, _emberApplication, _emberViews, _emberGlimmer) { @@ -80996,7 +78107,6 @@ enifed('ember/tests/routing/substates_test', ['exports', 'ember-runtime', 'ember templates = undefined, router = undefined, container = undefined, - registry = undefined, counter = undefined; function step(expectedValue, description) { @@ -81041,7 +78151,6 @@ enifed('ember/tests/routing/substates_test', ['exports', 'ember-runtime', 'ember Router = App.Router; container = App.__container__; - registry = App.__registry__; templates = { application: '
    {{outlet}}
    ', @@ -81586,8 +78695,6 @@ enifed('ember/tests/routing/substates_test', ['exports', 'ember-runtime', 'ember QUnit.test('errors that are bubbled are thrown at a higher level if not handled', function () { expect(3); - var handledError = undefined; - templates['grandma'] = 'GRANDMA {{outlet}}'; Router.map(function () { @@ -81612,9 +78719,6 @@ enifed('ember/tests/routing/substates_test', ['exports', 'ember-runtime', 'ember actions: { error: function (err) { step(2, 'MomSallyRoute#error'); - - handledError = err; - return true; } } @@ -82049,21 +79153,13 @@ enifed('ember/tests/routing/substates_test', ['exports', 'ember-runtime', 'ember equal(_emberViews.jQuery('#app', '#qunit-fixture').text(), 'INDEX'); }); }); -enifed('ember/tests/routing/substates_test.jscs-test', ['exports'], function (exports) { +enifed('ember/tests/routing/substates_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember/tests/routing'); - test('ember/tests/routing/substates_test.js should pass jscs', function () { - ok(true, 'ember/tests/routing/substates_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/routing/substates_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember/tests/routing'); - QUnit.test('ember/tests/routing/substates_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/routing/substates_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/routing/substates_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/routing/substates_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/routing/toplevel_dom_test', ['exports', 'ember-metal', 'ember-template-compiler', 'ember-application', 'ember-views', 'ember-routing', 'ember-glimmer'], function (exports, _emberMetal, _emberTemplateCompiler, _emberApplication, _emberViews, _emberRouting, _emberGlimmer) { @@ -82071,14 +79167,13 @@ enifed('ember/tests/routing/toplevel_dom_test', ['exports', 'ember-metal', 'embe var App = undefined, templates = undefined, - router = undefined, container = undefined; function bootApplication() { for (var _name in templates) { _emberGlimmer.setTemplate(_name, _emberTemplateCompiler.compile(templates[_name])); } - router = container.lookup('router:main'); + container.lookup('router:main'); _emberMetal.run(App, 'advanceReadiness'); } @@ -82122,21 +79217,13 @@ enifed('ember/tests/routing/toplevel_dom_test', ['exports', 'ember-metal', 'embe equal(_emberViews.jQuery('#qunit-fixture > .ember-view').text(), 'hello world'); }); }); -enifed('ember/tests/routing/toplevel_dom_test.jscs-test', ['exports'], function (exports) { +enifed('ember/tests/routing/toplevel_dom_test.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - ember/tests/routing'); - test('ember/tests/routing/toplevel_dom_test.js should pass jscs', function () { - ok(true, 'ember/tests/routing/toplevel_dom_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/routing/toplevel_dom_test.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - ember/tests/routing'); - QUnit.test('ember/tests/routing/toplevel_dom_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/routing/toplevel_dom_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/routing/toplevel_dom_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/routing/toplevel_dom_test.js should pass ESLint\n\n'); }); }); enifed('ember/tests/view_instrumentation_test', ['exports', 'ember-metal', 'ember-views', 'ember-application', 'ember-template-compiler', 'ember-glimmer'], function (exports, _emberMetal, _emberViews, _emberApplication, _emberTemplateCompiler, _emberGlimmer) { @@ -82203,327 +79290,184 @@ enifed('ember/tests/view_instrumentation_test', ['exports', 'ember-metal', 'embe assert.ok(called, 'instrumentation called on transition to non-view backed route'); }); }); -enifed('ember/tests/view_instrumentation_test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - ember/tests'); - test('ember/tests/view_instrumentation_test.js should pass jscs', function () { - ok(true, 'ember/tests/view_instrumentation_test.js should pass jscs.'); - }); -}); -enifed('ember/tests/view_instrumentation_test.jshint', ['exports'], function (exports) { +enifed('ember/tests/view_instrumentation_test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - ember/tests'); - QUnit.test('ember/tests/view_instrumentation_test.js should pass jshint', function (assert) { + QUnit.module('ESLint | ember/tests/view_instrumentation_test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'ember/tests/view_instrumentation_test.js should pass jshint.'); + assert.ok(true, 'ember/tests/view_instrumentation_test.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/apply-mixins.jscs-test', ['exports'], function (exports) { +enifed('internal-test-helpers/apply-mixins.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - internal-test-helpers'); - test('internal-test-helpers/apply-mixins.js should pass jscs', function () { - ok(true, 'internal-test-helpers/apply-mixins.js should pass jscs.'); - }); -}); -enifed('internal-test-helpers/apply-mixins.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - internal-test-helpers'); - QUnit.test('internal-test-helpers/apply-mixins.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/apply-mixins.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/apply-mixins.js should pass jshint.'); - }); -}); -enifed('internal-test-helpers/build-owner.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - internal-test-helpers'); - test('internal-test-helpers/build-owner.js should pass jscs', function () { - ok(true, 'internal-test-helpers/build-owner.js should pass jscs.'); + assert.ok(true, 'internal-test-helpers/apply-mixins.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/build-owner.jshint', ['exports'], function (exports) { +enifed('internal-test-helpers/build-owner.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - internal-test-helpers'); - QUnit.test('internal-test-helpers/build-owner.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/build-owner.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/build-owner.js should pass jshint.'); - }); -}); -enifed('internal-test-helpers/confirm-export.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - internal-test-helpers'); - test('internal-test-helpers/confirm-export.js should pass jscs', function () { - ok(true, 'internal-test-helpers/confirm-export.js should pass jscs.'); + assert.ok(true, 'internal-test-helpers/build-owner.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/confirm-export.jshint', ['exports'], function (exports) { +enifed('internal-test-helpers/confirm-export.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - internal-test-helpers'); - QUnit.test('internal-test-helpers/confirm-export.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/confirm-export.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/confirm-export.js should pass jshint.'); + assert.ok(true, 'internal-test-helpers/confirm-export.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/equal-inner-html.jscs-test', ['exports'], function (exports) { +enifed('internal-test-helpers/equal-inner-html.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - internal-test-helpers'); - test('internal-test-helpers/equal-inner-html.js should pass jscs', function () { - ok(true, 'internal-test-helpers/equal-inner-html.js should pass jscs.'); - }); -}); -enifed('internal-test-helpers/equal-inner-html.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - internal-test-helpers'); - QUnit.test('internal-test-helpers/equal-inner-html.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/equal-inner-html.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/equal-inner-html.js should pass jshint.'); - }); -}); -enifed('internal-test-helpers/equal-tokens.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - internal-test-helpers'); - test('internal-test-helpers/equal-tokens.js should pass jscs', function () { - ok(true, 'internal-test-helpers/equal-tokens.js should pass jscs.'); + assert.ok(true, 'internal-test-helpers/equal-inner-html.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/equal-tokens.jshint', ['exports'], function (exports) { +enifed('internal-test-helpers/equal-tokens.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - internal-test-helpers'); - QUnit.test('internal-test-helpers/equal-tokens.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/equal-tokens.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/equal-tokens.js should pass jshint.'); + assert.ok(true, 'internal-test-helpers/equal-tokens.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/factory.jscs-test', ['exports'], function (exports) { +enifed('internal-test-helpers/factory.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - internal-test-helpers'); - test('internal-test-helpers/factory.js should pass jscs', function () { - ok(true, 'internal-test-helpers/factory.js should pass jscs.'); - }); -}); -enifed('internal-test-helpers/factory.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - internal-test-helpers'); - QUnit.test('internal-test-helpers/factory.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/factory.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/factory.js should pass jshint.'); + assert.ok(true, 'internal-test-helpers/factory.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/index.jscs-test', ['exports'], function (exports) { +enifed('internal-test-helpers/index.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - internal-test-helpers'); - test('internal-test-helpers/index.js should pass jscs', function () { - ok(true, 'internal-test-helpers/index.js should pass jscs.'); - }); -}); -enifed('internal-test-helpers/index.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - internal-test-helpers'); - QUnit.test('internal-test-helpers/index.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/index.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/index.js should pass jshint.'); + assert.ok(true, 'internal-test-helpers/index.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/matchers.jscs-test', ['exports'], function (exports) { +enifed('internal-test-helpers/matchers.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - internal-test-helpers'); - test('internal-test-helpers/matchers.js should pass jscs', function () { - ok(true, 'internal-test-helpers/matchers.js should pass jscs.'); - }); -}); -enifed('internal-test-helpers/matchers.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - internal-test-helpers'); - QUnit.test('internal-test-helpers/matchers.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/matchers.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/matchers.js should pass jshint.'); - }); -}); -enifed('internal-test-helpers/module-for.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - internal-test-helpers'); - test('internal-test-helpers/module-for.js should pass jscs', function () { - ok(true, 'internal-test-helpers/module-for.js should pass jscs.'); + assert.ok(true, 'internal-test-helpers/matchers.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/module-for.jshint', ['exports'], function (exports) { +enifed('internal-test-helpers/module-for.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - internal-test-helpers'); - QUnit.test('internal-test-helpers/module-for.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/module-for.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/module-for.js should pass jshint.'); - }); -}); -enifed('internal-test-helpers/run.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - internal-test-helpers'); - test('internal-test-helpers/run.js should pass jscs', function () { - ok(true, 'internal-test-helpers/run.js should pass jscs.'); + assert.ok(true, 'internal-test-helpers/module-for.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/run.jshint', ['exports'], function (exports) { +enifed('internal-test-helpers/run.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - internal-test-helpers'); - QUnit.test('internal-test-helpers/run.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/run.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/run.js should pass jshint.'); - }); -}); -enifed('internal-test-helpers/strip.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - internal-test-helpers'); - test('internal-test-helpers/strip.js should pass jscs', function () { - ok(true, 'internal-test-helpers/strip.js should pass jscs.'); + assert.ok(true, 'internal-test-helpers/run.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/strip.jshint', ['exports'], function (exports) { +enifed('internal-test-helpers/strip.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - internal-test-helpers'); - QUnit.test('internal-test-helpers/strip.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/strip.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/strip.js should pass jshint.'); + assert.ok(true, 'internal-test-helpers/strip.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/test-cases/abstract-application.jscs-test', ['exports'], function (exports) { +enifed('internal-test-helpers/test-cases/abstract-application.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - internal-test-helpers/test-cases'); - test('internal-test-helpers/test-cases/abstract-application.js should pass jscs', function () { - ok(true, 'internal-test-helpers/test-cases/abstract-application.js should pass jscs.'); - }); -}); -enifed('internal-test-helpers/test-cases/abstract-application.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - internal-test-helpers/test-cases'); - QUnit.test('internal-test-helpers/test-cases/abstract-application.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/test-cases/abstract-application.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/test-cases/abstract-application.js should pass jshint.'); - }); -}); -enifed('internal-test-helpers/test-cases/abstract-rendering.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - internal-test-helpers/test-cases'); - test('internal-test-helpers/test-cases/abstract-rendering.js should pass jscs', function () { - ok(true, 'internal-test-helpers/test-cases/abstract-rendering.js should pass jscs.'); + assert.ok(true, 'internal-test-helpers/test-cases/abstract-application.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/test-cases/abstract-rendering.jshint', ['exports'], function (exports) { +enifed('internal-test-helpers/test-cases/abstract-rendering.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - internal-test-helpers/test-cases'); - QUnit.test('internal-test-helpers/test-cases/abstract-rendering.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/test-cases/abstract-rendering.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/test-cases/abstract-rendering.js should pass jshint.'); + assert.ok(true, 'internal-test-helpers/test-cases/abstract-rendering.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/test-cases/abstract.jscs-test', ['exports'], function (exports) { +enifed('internal-test-helpers/test-cases/abstract.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - internal-test-helpers/test-cases'); - test('internal-test-helpers/test-cases/abstract.js should pass jscs', function () { - ok(true, 'internal-test-helpers/test-cases/abstract.js should pass jscs.'); - }); -}); -enifed('internal-test-helpers/test-cases/abstract.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - internal-test-helpers/test-cases'); - QUnit.test('internal-test-helpers/test-cases/abstract.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/test-cases/abstract.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/test-cases/abstract.js should pass jshint.'); - }); -}); -enifed('internal-test-helpers/test-cases/application.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - internal-test-helpers/test-cases'); - test('internal-test-helpers/test-cases/application.js should pass jscs', function () { - ok(true, 'internal-test-helpers/test-cases/application.js should pass jscs.'); + assert.ok(true, 'internal-test-helpers/test-cases/abstract.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/test-cases/application.jshint', ['exports'], function (exports) { +enifed('internal-test-helpers/test-cases/application.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - internal-test-helpers/test-cases'); - QUnit.test('internal-test-helpers/test-cases/application.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/test-cases/application.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/test-cases/application.js should pass jshint.'); - }); -}); -enifed('internal-test-helpers/test-cases/query-param.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - internal-test-helpers/test-cases'); - test('internal-test-helpers/test-cases/query-param.js should pass jscs', function () { - ok(true, 'internal-test-helpers/test-cases/query-param.js should pass jscs.'); + assert.ok(true, 'internal-test-helpers/test-cases/application.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/test-cases/query-param.jshint', ['exports'], function (exports) { +enifed('internal-test-helpers/test-cases/query-param.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - internal-test-helpers/test-cases'); - QUnit.test('internal-test-helpers/test-cases/query-param.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/test-cases/query-param.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/test-cases/query-param.js should pass jshint.'); + assert.ok(true, 'internal-test-helpers/test-cases/query-param.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/test-cases/rendering.jscs-test', ['exports'], function (exports) { +enifed('internal-test-helpers/test-cases/rendering.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - internal-test-helpers/test-cases'); - test('internal-test-helpers/test-cases/rendering.js should pass jscs', function () { - ok(true, 'internal-test-helpers/test-cases/rendering.js should pass jscs.'); - }); -}); -enifed('internal-test-helpers/test-cases/rendering.jshint', ['exports'], function (exports) { - 'use strict'; - - QUnit.module('JSHint - internal-test-helpers/test-cases'); - QUnit.test('internal-test-helpers/test-cases/rendering.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/test-cases/rendering.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/test-cases/rendering.js should pass jshint.'); + assert.ok(true, 'internal-test-helpers/test-cases/rendering.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/test-groups.jscs-test', ['exports'], function (exports) { +enifed('internal-test-helpers/test-cases/router.lint-test', ['exports'], function (exports) { 'use strict'; - module('JSCS - internal-test-helpers'); - test('internal-test-helpers/test-groups.js should pass jscs', function () { - ok(true, 'internal-test-helpers/test-groups.js should pass jscs.'); + QUnit.module('ESLint | internal-test-helpers/test-cases/router.js'); + QUnit.test('should pass ESLint', function (assert) { + assert.expect(1); + assert.ok(true, 'internal-test-helpers/test-cases/router.js should pass ESLint\n\n'); }); }); -enifed('internal-test-helpers/test-groups.jshint', ['exports'], function (exports) { +enifed('internal-test-helpers/test-groups.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - internal-test-helpers'); - QUnit.test('internal-test-helpers/test-groups.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/test-groups.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/test-groups.js should pass jshint.'); + assert.ok(true, 'internal-test-helpers/test-groups.js should pass ESLint\n\n'); }); }); enifed('internal-test-helpers/tests/index-test', ['exports'], function (exports) { @@ -82535,21 +79479,13 @@ enifed('internal-test-helpers/tests/index-test', ['exports'], function (exports) assert.ok(true, 'each package needs at least one test to be able to run through `npm test`'); }); }); -enifed('internal-test-helpers/tests/index-test.jscs-test', ['exports'], function (exports) { - 'use strict'; - - module('JSCS - internal-test-helpers/tests'); - test('internal-test-helpers/tests/index-test.js should pass jscs', function () { - ok(true, 'internal-test-helpers/tests/index-test.js should pass jscs.'); - }); -}); -enifed('internal-test-helpers/tests/index-test.jshint', ['exports'], function (exports) { +enifed('internal-test-helpers/tests/index-test.lint-test', ['exports'], function (exports) { 'use strict'; - QUnit.module('JSHint - internal-test-helpers/tests'); - QUnit.test('internal-test-helpers/tests/index-test.js should pass jshint', function (assert) { + QUnit.module('ESLint | internal-test-helpers/tests/index-test.js'); + QUnit.test('should pass ESLint', function (assert) { assert.expect(1); - assert.ok(true, 'internal-test-helpers/tests/index-test.js should pass jshint.'); + assert.ok(true, 'internal-test-helpers/tests/index-test.js should pass ESLint\n\n'); }); }); }()); diff --git a/ember.debug.js b/ember.debug.js index d007629de..330c0e997 100644 --- a/ember.debug.js +++ b/ember.debug.js @@ -1,16 +1,16 @@ ;(function() { /*! * @overview Ember - JavaScript Application Framework - * @copyright Copyright 2011-2016 Tilde Inc. and contributors + * @copyright Copyright 2011-2017 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.10.2-with-backtracking + * @version 2.12.0-canary-with-backtracking */ var enifed, requireModule, Ember; -var mainContext = this; +var mainContext = this; // Used in ember-environment/lib/global.js (function() { var isNode = typeof window === 'undefined' && @@ -112,8 +112,6 @@ var mainContext = this; } })(); -var babelHelpers; - function classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); @@ -186,59950 +184,51441 @@ babelHelpers = { defaults: defaults }; -enifed('backburner', ['exports'], function (exports) { 'use strict'; - -var NUMBER = /\d+/; +enifed('@glimmer/node', ['exports', '@glimmer/runtime'], function (exports, _glimmerRuntime) { + 'use strict'; -function each(collection, callback) { - for (var i = 0; i < collection.length; i++) { - callback(collection[i]); - } -} + var NodeDOMTreeConstruction = (function (_DOMTreeConstruction) { + babelHelpers.inherits(NodeDOMTreeConstruction, _DOMTreeConstruction); -function isString(suspect) { - return typeof suspect === 'string'; -} + function NodeDOMTreeConstruction(doc) { + _DOMTreeConstruction.call(this, doc); + } -function isFunction(suspect) { - return typeof suspect === 'function'; -} + // override to prevent usage of `this.document` until after the constructor -function isNumber(suspect) { - return typeof suspect === 'number'; -} + NodeDOMTreeConstruction.prototype.setupUselessElement = function setupUselessElement() {}; -function isCoercableNumber(number) { - return isNumber(number) || NUMBER.test(number); -} + NodeDOMTreeConstruction.prototype.insertHTMLBefore = function insertHTMLBefore(parent, html, reference) { + var prev = reference ? reference.previousSibling : parent.lastChild; + var raw = this.document.createRawHTMLSection(html); + parent.insertBefore(raw, reference); + var first = prev ? prev.nextSibling : parent.firstChild; + var last = reference ? reference.previousSibling : parent.lastChild; + return new _glimmerRuntime.ConcreteBounds(parent, first, last); + }; -function binarySearch(time, timers) { - var start = 0; - var end = timers.length - 2; - var middle, l; + // override to avoid SVG detection/work when in node (this is not needed in SSR) - while (start < end) { - // since timers is an array of pairs 'l' will always - // be an integer - l = (end - start) / 2; + NodeDOMTreeConstruction.prototype.createElement = function createElement(tag) { + return this.document.createElement(tag); + }; - // compensate for the index in case even number - // of pairs inside timers - middle = start + l - (l % 2); + // override to avoid namespace shenanigans when in node (this is not needed in SSR) - if (time >= timers[middle]) { - start = middle + 2; - } else { - end = middle; - } - } + NodeDOMTreeConstruction.prototype.setAttribute = function setAttribute(element, name, value) { + element.setAttribute(name, value); + }; - return (time >= timers[start]) ? start + 2 : start; -} + return NodeDOMTreeConstruction; + })(_glimmerRuntime.DOMTreeConstruction); -function Queue(name, options, globalOptions) { - this.name = name; - this.globalOptions = globalOptions || {}; - this.options = options; - this._queue = []; - this.targetQueues = {}; - this._queueBeingFlushed = undefined; -} + exports.NodeDOMTreeConstruction = NodeDOMTreeConstruction; +}); +enifed("@glimmer/reference", ["exports", "@glimmer/util"], function (exports, _glimmerUtil) { + "use strict"; -Queue.prototype = { - push: function(target, method, args, stack) { - var queue = this._queue; - queue.push(target, method, args, stack); + var CONSTANT = 0; + var INITIAL = 1; + var VOLATILE = NaN; - return { - queue: this, - target: target, - method: method - }; - }, + var RevisionTag = (function () { + function RevisionTag() {} - pushUniqueWithoutGuid: function(target, method, args, stack) { - var queue = this._queue; + RevisionTag.prototype.validate = function validate(snapshot) { + return this.value() === snapshot; + }; - for (var i = 0, l = queue.length; i < l; i += 4) { - var currentTarget = queue[i]; - var currentMethod = queue[i+1]; + return RevisionTag; + })(); - if (currentTarget === target && currentMethod === method) { - queue[i+2] = args; // replace args - queue[i+3] = stack; // replace stack - return; - } - } + var $REVISION = INITIAL; - queue.push(target, method, args, stack); - }, + var DirtyableTag = (function (_RevisionTag) { + babelHelpers.inherits(DirtyableTag, _RevisionTag); - targetQueue: function(targetQueue, target, method, args, stack) { - var queue = this._queue; + function DirtyableTag() { + var revision = arguments.length <= 0 || arguments[0] === undefined ? $REVISION : arguments[0]; - for (var i = 0, l = targetQueue.length; i < l; i += 2) { - var currentMethod = targetQueue[i]; - var currentIndex = targetQueue[i + 1]; + _RevisionTag.call(this); + this.revision = revision; + } - if (currentMethod === method) { - queue[currentIndex + 2] = args; // replace args - queue[currentIndex + 3] = stack; // replace stack - return; - } - } + DirtyableTag.prototype.value = function value() { + return this.revision; + }; - targetQueue.push( - method, - queue.push(target, method, args, stack) - 4 - ); - }, + DirtyableTag.prototype.dirty = function dirty() { + this.revision = ++$REVISION; + }; - pushUniqueWithGuid: function(guid, target, method, args, stack) { - var hasLocalQueue = this.targetQueues[guid]; + return DirtyableTag; + })(RevisionTag); - if (hasLocalQueue) { - this.targetQueue(hasLocalQueue, target, method, args, stack); - } else { - this.targetQueues[guid] = [ - method, - this._queue.push(target, method, args, stack) - 4 - ]; + function combineTagged(tagged) { + var optimized = []; + for (var i = 0, l = tagged.length; i < l; i++) { + var tag = tagged[i].tag; + if (tag === VOLATILE_TAG) return VOLATILE_TAG; + if (tag === CONSTANT_TAG) continue; + optimized.push(tag); + } + return _combine(optimized); + } + function combineSlice(slice) { + var optimized = []; + var node = slice.head(); + while (node !== null) { + var tag = node.tag; + if (tag === VOLATILE_TAG) return VOLATILE_TAG; + if (tag !== CONSTANT_TAG) optimized.push(tag); + node = slice.nextNode(node); + } + return _combine(optimized); + } + function combine(tags) { + var optimized = []; + for (var i = 0, l = tags.length; i < l; i++) { + var tag = tags[i]; + if (tag === VOLATILE_TAG) return VOLATILE_TAG; + if (tag === CONSTANT_TAG) continue; + optimized.push(tag); + } + return _combine(optimized); + } + function _combine(tags) { + switch (tags.length) { + case 0: + return CONSTANT_TAG; + case 1: + return tags[0]; + case 2: + return new TagsPair(tags[0], tags[1]); + default: + return new TagsCombinator(tags); + } + ; } - return { - queue: this, - target: target, - method: method - }; - }, + var CachedTag = (function (_RevisionTag2) { + babelHelpers.inherits(CachedTag, _RevisionTag2); - pushUnique: function(target, method, args, stack) { - var KEY = this.globalOptions.GUID_KEY; + function CachedTag() { + _RevisionTag2.apply(this, arguments); + this.lastChecked = null; + this.lastValue = null; + } - if (target && KEY) { - var guid = target[KEY]; - if (guid) { - return this.pushUniqueWithGuid(guid, target, method, args, stack); - } - } + CachedTag.prototype.value = function value() { + var lastChecked = this.lastChecked; + var lastValue = this.lastValue; - this.pushUniqueWithoutGuid(target, method, args, stack); + if (lastChecked !== $REVISION) { + this.lastChecked = $REVISION; + this.lastValue = lastValue = this.compute(); + } + return this.lastValue; + }; - return { - queue: this, - target: target, - method: method - }; - }, + CachedTag.prototype.invalidate = function invalidate() { + this.lastChecked = null; + }; - invoke: function(target, method, args /*, onError, errorRecordedForStack */) { - if (args && args.length > 0) { - method.apply(target, args); - } else { - method.call(target); - } - }, + return CachedTag; + })(RevisionTag); - invokeWithOnError: function(target, method, args, onError, errorRecordedForStack) { - try { - if (args && args.length > 0) { - method.apply(target, args); - } else { - method.call(target); - } - } catch(error) { - onError(error, errorRecordedForStack); - } - }, + var TagsPair = (function (_CachedTag) { + babelHelpers.inherits(TagsPair, _CachedTag); - flush: function(sync) { - var queue = this._queue; - var length = queue.length; + function TagsPair(first, second) { + _CachedTag.call(this); + this.first = first; + this.second = second; + } - if (length === 0) { - return; - } + TagsPair.prototype.compute = function compute() { + return Math.max(this.first.value(), this.second.value()); + }; - var globalOptions = this.globalOptions; - var options = this.options; - var before = options && options.before; - var after = options && options.after; - var onError = globalOptions.onError || (globalOptions.onErrorTarget && - globalOptions.onErrorTarget[globalOptions.onErrorMethod]); - var target, method, args, errorRecordedForStack; - var invoke = onError ? this.invokeWithOnError : this.invoke; + return TagsPair; + })(CachedTag); - this.targetQueues = Object.create(null); - var queueItems = this._queueBeingFlushed = this._queue.slice(); - this._queue = []; + var TagsCombinator = (function (_CachedTag2) { + babelHelpers.inherits(TagsCombinator, _CachedTag2); - if (before) { - before(); - } + function TagsCombinator(tags) { + _CachedTag2.call(this); + this.tags = tags; + } - for (var i = 0; i < length; i += 4) { - target = queueItems[i]; - method = queueItems[i+1]; - args = queueItems[i+2]; - errorRecordedForStack = queueItems[i+3]; // Debugging assistance + TagsCombinator.prototype.compute = function compute() { + var tags = this.tags; - if (isString(method)) { - method = target[method]; - } + var max = -1; + for (var i = 0; i < tags.length; i++) { + var value = tags[i].value(); + max = Math.max(value, max); + } + return max; + }; - // method could have been nullified / canceled during flush - if (method) { - // - // ** Attention intrepid developer ** - // - // To find out the stack of this task when it was scheduled onto - // the run loop, add the following to your app.js: - // - // Ember.run.backburner.DEBUG = true; // NOTE: This slows your app, don't leave it on in production. - // - // Once that is in place, when you are at a breakpoint and navigate - // here in the stack explorer, you can look at `errorRecordedForStack.stack`, - // which will be the captured stack when this job was scheduled. - // - // One possible long-term solution is the following Chrome issue: - // https://bugs.chromium.org/p/chromium/issues/detail?id=332624 - // - invoke(target, method, args, onError, errorRecordedForStack); - } - } + return TagsCombinator; + })(CachedTag); - if (after) { - after(); - } + var UpdatableTag = (function (_CachedTag3) { + babelHelpers.inherits(UpdatableTag, _CachedTag3); - this._queueBeingFlushed = undefined; + function UpdatableTag(tag) { + _CachedTag3.call(this); + this.tag = tag; + this.lastUpdated = INITIAL; + } - if (sync !== false && - this._queue.length > 0) { - // check if new items have been added - this.flush(true); - } - }, + ////////// - cancel: function(actionToCancel) { - var queue = this._queue, currentTarget, currentMethod, i, l; - var target = actionToCancel.target; - var method = actionToCancel.method; - var GUID_KEY = this.globalOptions.GUID_KEY; + UpdatableTag.prototype.compute = function compute() { + return Math.max(this.lastUpdated, this.tag.value()); + }; - if (GUID_KEY && this.targetQueues && target) { - var targetQueue = this.targetQueues[target[GUID_KEY]]; + UpdatableTag.prototype.update = function update(tag) { + if (tag !== this.tag) { + this.tag = tag; + this.lastUpdated = $REVISION; + this.invalidate(); + } + }; - if (targetQueue) { - for (i = 0, l = targetQueue.length; i < l; i++) { - if (targetQueue[i] === method) { - targetQueue.splice(i, 1); - } + return UpdatableTag; + })(CachedTag); + + var CONSTANT_TAG = new ((function (_RevisionTag3) { + babelHelpers.inherits(ConstantTag, _RevisionTag3); + + function ConstantTag() { + _RevisionTag3.apply(this, arguments); } - } - } - for (i = 0, l = queue.length; i < l; i += 4) { - currentTarget = queue[i]; - currentMethod = queue[i+1]; + ConstantTag.prototype.value = function value() { + return CONSTANT; + }; - if (currentTarget === target && - currentMethod === method) { - queue.splice(i, 4); - return true; - } - } + return ConstantTag; + })(RevisionTag))(); + var VOLATILE_TAG = new ((function (_RevisionTag4) { + babelHelpers.inherits(VolatileTag, _RevisionTag4); - // if not found in current queue - // could be in the queue that is being flushed - queue = this._queueBeingFlushed; + function VolatileTag() { + _RevisionTag4.apply(this, arguments); + } - if (!queue) { - return; - } + VolatileTag.prototype.value = function value() { + return VOLATILE; + }; - for (i = 0, l = queue.length; i < l; i += 4) { - currentTarget = queue[i]; - currentMethod = queue[i+1]; + return VolatileTag; + })(RevisionTag))(); + var CURRENT_TAG = new ((function (_DirtyableTag) { + babelHelpers.inherits(CurrentTag, _DirtyableTag); - if (currentTarget === target && - currentMethod === method) { - // don't mess with array during flush - // just nullify the method - queue[i+1] = null; - return true; - } - } - } -}; + function CurrentTag() { + _DirtyableTag.apply(this, arguments); + } -function DeferredActionQueues(queueNames, options) { - var queues = this.queues = {}; - this.queueNames = queueNames = queueNames || []; + CurrentTag.prototype.value = function value() { + return $REVISION; + }; - this.options = options; + return CurrentTag; + })(DirtyableTag))(); - each(queueNames, function(queueName) { - queues[queueName] = new Queue(queueName, options[queueName], options); - }); -} + var CachedReference = (function () { + function CachedReference() { + this.lastRevision = null; + this.lastValue = null; + } -function noSuchQueue(name) { - throw new Error('You attempted to schedule an action in a queue (' + name + ') that doesn\'t exist'); -} + CachedReference.prototype.value = function value() { + var tag = this.tag; + var lastRevision = this.lastRevision; + var lastValue = this.lastValue; -function noSuchMethod(name) { - throw new Error('You attempted to schedule an action in a queue (' + name + ') for a method that doesn\'t exist'); -} + if (!lastRevision || !tag.validate(lastRevision)) { + lastValue = this.lastValue = this.compute(); + this.lastRevision = tag.value(); + } + return lastValue; + }; -DeferredActionQueues.prototype = { - schedule: function(name, target, method, args, onceFlag, stack) { - var queues = this.queues; - var queue = queues[name]; + CachedReference.prototype.invalidate = function invalidate() { + this.lastRevision = null; + }; - if (!queue) { - noSuchQueue(name); - } + return CachedReference; + })(); - if (!method) { - noSuchMethod(name); - } + var MapperReference = (function (_CachedReference) { + babelHelpers.inherits(MapperReference, _CachedReference); - if (onceFlag) { - return queue.pushUnique(target, method, args, stack); - } else { - return queue.push(target, method, args, stack); - } - }, + function MapperReference(reference, mapper) { + _CachedReference.call(this); + this.tag = reference.tag; + this.reference = reference; + this.mapper = mapper; + } - flush: function() { - var queues = this.queues; - var queueNames = this.queueNames; - var queueName, queue; - var queueNameIndex = 0; - var numberOfQueues = queueNames.length; + MapperReference.prototype.compute = function compute() { + var reference = this.reference; + var mapper = this.mapper; - while (queueNameIndex < numberOfQueues) { - queueName = queueNames[queueNameIndex]; - queue = queues[queueName]; + return mapper(reference.value()); + }; - var numberOfQueueItems = queue._queue.length; + return MapperReference; + })(CachedReference); - if (numberOfQueueItems === 0) { - queueNameIndex++; - } else { - queue.flush(false /* async */); - queueNameIndex = 0; - } + function map(reference, mapper) { + return new MapperReference(reference, mapper); } - } -}; - -function Backburner(queueNames, options) { - this.queueNames = queueNames; - this.options = options || {}; - if (!this.options.defaultQueue) { - this.options.defaultQueue = queueNames[0]; - } - this.instanceStack = []; - this._debouncees = []; - this._throttlers = []; - this._eventCallbacks = { - end: [], - begin: [] - }; - - var _this = this; - this._boundClearItems = function() { - clearItems(); - }; - - this._timerTimeoutId = undefined; - this._timers = []; + ////////// - this._platform = this.options._platform || { - setTimeout: function (fn, ms) { - return setTimeout(fn, ms); - }, - clearTimeout: function (id) { - clearTimeout(id); - } - }; + var ReferenceCache = (function () { + function ReferenceCache(reference) { + this.lastValue = null; + this.lastRevision = null; + this.initialized = false; + this.tag = reference.tag; + this.reference = reference; + } - this._boundRunExpiredTimers = function () { - _this._runExpiredTimers(); - }; -} + ReferenceCache.prototype.peek = function peek() { + if (!this.initialized) { + return this.initialize(); + } + return this.lastValue; + }; -Backburner.prototype = { - begin: function() { - var options = this.options; - var onBegin = options && options.onBegin; - var previousInstance = this.currentInstance; + ReferenceCache.prototype.revalidate = function revalidate() { + if (!this.initialized) { + return this.initialize(); + } + var reference = this.reference; + var lastRevision = this.lastRevision; - if (previousInstance) { - this.instanceStack.push(previousInstance); - } + var tag = reference.tag; + if (tag.validate(lastRevision)) return NOT_MODIFIED; + this.lastRevision = tag.value(); + var lastValue = this.lastValue; - this.currentInstance = new DeferredActionQueues(this.queueNames, options); - this._trigger('begin', this.currentInstance, previousInstance); - if (onBegin) { - onBegin(this.currentInstance, previousInstance); - } - }, + var value = reference.value(); + if (value === lastValue) return NOT_MODIFIED; + this.lastValue = value; + return value; + }; - end: function() { - var options = this.options; - var onEnd = options && options.onEnd; - var currentInstance = this.currentInstance; - var nextInstance = null; + ReferenceCache.prototype.initialize = function initialize() { + var reference = this.reference; - // Prevent double-finally bug in Safari 6.0.2 and iOS 6 - // This bug appears to be resolved in Safari 6.0.5 and iOS 7 - var finallyAlreadyCalled = false; - try { - currentInstance.flush(); - } finally { - if (!finallyAlreadyCalled) { - finallyAlreadyCalled = true; + var value = this.lastValue = reference.value(); + this.lastRevision = reference.tag.value(); + this.initialized = true; + return value; + }; - this.currentInstance = null; + return ReferenceCache; + })(); - if (this.instanceStack.length) { - nextInstance = this.instanceStack.pop(); - this.currentInstance = nextInstance; - } - this._trigger('end', currentInstance, nextInstance); - if (onEnd) { - onEnd(currentInstance, nextInstance); - } - } + var NOT_MODIFIED = "adb3b78e-3d22-4e4b-877a-6317c2c5c145"; + function isModified(value) { + return value !== NOT_MODIFIED; } - }, - /** - 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. + var ConstReference = (function () { + function ConstReference(inner) { + this.inner = inner; + this.tag = CONSTANT_TAG; + } - @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); - } - } - }, + ConstReference.prototype.value = function value() { + return this.inner; + }; - 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'); - } - }, + return ConstReference; + })(); - 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'); + function isConst(reference) { + return reference.tag === CONSTANT_TAG; } - }, - - run: function(/* target, method, args */) { - var length = arguments.length; - var method, target, args; - if (length === 1) { - method = arguments[0]; - target = null; - } else { - target = arguments[0]; - method = arguments[1]; - } + var ListItem = (function (_ListNode) { + babelHelpers.inherits(ListItem, _ListNode); - if (isString(method)) { - method = target[method]; - } + function ListItem(iterable, result) { + _ListNode.call(this, iterable.valueReferenceFor(result)); + this.retained = false; + this.seen = false; + this.key = result.key; + this.iterable = iterable; + this.memo = iterable.memoReferenceFor(result); + } - if (length > 2) { - args = new Array(length - 2); - for (var i = 0, l = length - 2; i < l; i++) { - args[i] = arguments[i + 2]; - } - } else { - args = []; - } + ListItem.prototype.update = function update(item) { + this.retained = true; + this.iterable.updateValueReference(this.value, item); + this.iterable.updateMemoReference(this.memo, item); + }; - var onError = getOnError(this.options); + ListItem.prototype.shouldRemove = function shouldRemove() { + return !this.retained; + }; - this.begin(); + ListItem.prototype.reset = function reset() { + this.retained = false; + this.seen = false; + }; - // guard against Safari 6's double-finally bug - var didFinally = false; + return ListItem; + })(_glimmerUtil.ListNode); - if (onError) { - try { - return method.apply(target, args); - } catch(error) { - onError(error); - } finally { - if (!didFinally) { - didFinally = true; - this.end(); - } - } - } else { - try { - return method.apply(target, args); - } finally { - if (!didFinally) { - didFinally = true; - this.end(); + var IterationArtifacts = (function () { + function IterationArtifacts(iterable) { + this.map = _glimmerUtil.dict(); + this.list = new _glimmerUtil.LinkedList(); + this.tag = iterable.tag; + this.iterable = iterable; } - } - } - }, - /* - Join the passed method with an existing queue and execute immediately, - if there isn't one use `Backburner#run`. + IterationArtifacts.prototype.isEmpty = function isEmpty() { + var iterator = this.iterator = this.iterable.iterate(); + return iterator.isEmpty(); + }; - The join method is like the run method except that it will schedule into - an existing queue if one already exists. In either case, the join method will - immediately execute the passed in function and return its result. + IterationArtifacts.prototype.iterate = function iterate() { + var iterator = this.iterator || this.iterable.iterate(); + this.iterator = null; + return iterator; + }; - @method join - @param {Object} target - @param {Function} method The method to be executed - @param {any} args The method arguments - @return method result - */ - join: function(/* target, method, args */) { - if (!this.currentInstance) { - return this.run.apply(this, arguments); - } + IterationArtifacts.prototype.has = function has(key) { + return !!this.map[key]; + }; - var length = arguments.length; - var method, target; + IterationArtifacts.prototype.get = function get(key) { + return this.map[key]; + }; - if (length === 1) { - method = arguments[0]; - target = null; - } else { - target = arguments[0]; - method = arguments[1]; - } + IterationArtifacts.prototype.wasSeen = function wasSeen(key) { + var node = this.map[key]; + return node && node.seen; + }; - if (isString(method)) { - method = target[method]; - } + IterationArtifacts.prototype.append = function append(item) { + var map = this.map; + var list = this.list; + var iterable = this.iterable; - if (length === 1) { - return method(); - } else if (length === 2) { - return method.call(target); - } else { - var args = new Array(length - 2); - for (var i = 0, l = length - 2; i < l; i++) { - args[i] = arguments[i + 2]; - } - return method.apply(target, args); - } - }, + var node = map[item.key] = new ListItem(iterable, item); + list.append(node); + return node; + }; + IterationArtifacts.prototype.insertBefore = function insertBefore(item, reference) { + var map = this.map; + var list = this.list; + var iterable = this.iterable; - /* - Defer the passed function to run inside the specified queue. + var node = map[item.key] = new ListItem(iterable, item); + node.retained = true; + list.insertBefore(node, reference); + return node; + }; - @method defer - @param {String} queueName - @param {Object} target - @param {Function|String} method The method or method name to be executed - @param {any} args The method arguments - @return method result - */ - defer: function(queueName /* , target, method, args */) { - var length = arguments.length; - var method, target, args; + IterationArtifacts.prototype.move = function move(item, reference) { + var list = this.list; - if (length === 2) { - method = arguments[1]; - target = null; - } else { - target = arguments[1]; - method = arguments[2]; - } + item.retained = true; + list.remove(item); + list.insertBefore(item, reference); + }; - if (isString(method)) { - method = target[method]; - } + IterationArtifacts.prototype.remove = function remove(item) { + var list = this.list; - var stack = this.DEBUG ? new Error() : undefined; + list.remove(item); + delete this.map[item.key]; + }; - if (length > 3) { - args = new Array(length - 3); - for (var i = 3; i < length; i++) { - args[i-3] = arguments[i]; - } - } else { - args = undefined; - } + IterationArtifacts.prototype.nextNode = function nextNode(item) { + return this.list.nextNode(item); + }; - if (!this.currentInstance) { createAutorun(this); } - return this.currentInstance.schedule(queueName, target, method, args, false, stack); - }, + IterationArtifacts.prototype.head = function head() { + return this.list.head(); + }; - deferOnce: function(queueName /* , target, method, args */) { - var length = arguments.length; - var method, target, args; + return IterationArtifacts; + })(); - if (length === 2) { - method = arguments[1]; - target = null; - } else { - target = arguments[1]; - method = arguments[2]; - } + var ReferenceIterator = (function () { + // if anyone needs to construct this object with something other than + // an iterable, let @wycats know. - if (isString(method)) { - method = target[method]; - } + function ReferenceIterator(iterable) { + this.iterator = null; + var artifacts = new IterationArtifacts(iterable); + this.artifacts = artifacts; + } - var stack = this.DEBUG ? new Error() : undefined; + ReferenceIterator.prototype.next = function next() { + var artifacts = this.artifacts; - if (length > 3) { - args = new Array(length - 3); - for (var i = 3; i < length; i++) { - args[i-3] = arguments[i]; - } - } else { - args = undefined; - } + var iterator = this.iterator = this.iterator || artifacts.iterate(); + var item = iterator.next(); + if (!item) return null; + return artifacts.append(item); + }; - if (!this.currentInstance) { - createAutorun(this); - } - return this.currentInstance.schedule(queueName, target, method, args, true, stack); - }, + return ReferenceIterator; + })(); - setTimeout: function() { - var l = arguments.length; - var args = new Array(l); + var Phase; + (function (Phase) { + Phase[Phase["Append"] = 0] = "Append"; + Phase[Phase["Prune"] = 1] = "Prune"; + Phase[Phase["Done"] = 2] = "Done"; + })(Phase || (Phase = {})); - for (var x = 0; x < l; x++) { - args[x] = arguments[x]; - } + var IteratorSynchronizer = (function () { + function IteratorSynchronizer(_ref) { + var target = _ref.target; + var artifacts = _ref.artifacts; - var length = args.length, - method, wait, target, - methodOrTarget, methodOrWait, methodOrArgs; + this.target = target; + this.artifacts = artifacts; + this.iterator = artifacts.iterate(); + this.current = artifacts.head(); + } - if (length === 0) { - return; - } else if (length === 1) { - method = args.shift(); - wait = 0; - } else if (length === 2) { - methodOrTarget = args[0]; - methodOrWait = args[1]; + IteratorSynchronizer.prototype.sync = function sync() { + var phase = Phase.Append; + while (true) { + switch (phase) { + case Phase.Append: + phase = this.nextAppend(); + break; + case Phase.Prune: + phase = this.nextPrune(); + break; + case Phase.Done: + this.nextDone(); + return; + } + } + }; - if (isFunction(methodOrWait) || isFunction(methodOrTarget[methodOrWait])) { - target = args.shift(); - method = args.shift(); - wait = 0; - } else if (isCoercableNumber(methodOrWait)) { - method = args.shift(); - wait = args.shift(); - } else { - method = args.shift(); - wait = 0; - } - } else { - var last = args[args.length - 1]; + IteratorSynchronizer.prototype.advanceToKey = function advanceToKey(key) { + var current = this.current; + var artifacts = this.artifacts; - if (isCoercableNumber(last)) { - wait = args.pop(); - } else { - wait = 0; - } + var seek = current; + while (seek && seek.key !== key) { + seek.seen = true; + seek = artifacts.nextNode(seek); + } + this.current = seek && artifacts.nextNode(seek); + }; - methodOrTarget = args[0]; - methodOrArgs = args[1]; + IteratorSynchronizer.prototype.nextAppend = function nextAppend() { + var iterator = this.iterator; + var current = this.current; + var artifacts = this.artifacts; - if (isFunction(methodOrArgs) || (isString(methodOrArgs) && - methodOrTarget !== null && - methodOrArgs in methodOrTarget)) { - target = args.shift(); - method = args.shift(); - } else { - method = args.shift(); - } - } - - var executeAt = Date.now() + parseInt(wait !== wait ? 0 : wait, 10); - - if (isString(method)) { - method = target[method]; - } - - var onError = getOnError(this.options); + var item = iterator.next(); + if (item === null) { + return this.startPrune(); + } + var key = item.key; - function fn() { - if (onError) { - try { - method.apply(target, args); - } catch (e) { - onError(e); - } - } else { - method.apply(target, args); - } - } + if (current && current.key === key) { + this.nextRetain(item); + } else if (artifacts.has(key)) { + this.nextMove(item); + } else { + this.nextInsert(item); + } + return Phase.Append; + }; - return this._setTimeout(fn, executeAt); - }, + IteratorSynchronizer.prototype.nextRetain = function nextRetain(item) { + var artifacts = this.artifacts; + var current = this.current; - _setTimeout: function (fn, executeAt) { - if (this._timers.length === 0) { - this._timers.push(executeAt, fn); - this._installTimerTimeout(); - return fn; - } + current = _glimmerUtil.expect(current, 'BUG: current is empty'); + current.update(item); + this.current = artifacts.nextNode(current); + this.target.retain(item.key, current.value, current.memo); + }; - // find position to insert - var i = binarySearch(executeAt, this._timers); + IteratorSynchronizer.prototype.nextMove = function nextMove(item) { + var current = this.current; + var artifacts = this.artifacts; + var target = this.target; + var key = item.key; - this._timers.splice(i, 0, executeAt, fn); + var found = artifacts.get(item.key); + found.update(item); + if (artifacts.wasSeen(item.key)) { + artifacts.move(found, current); + target.move(found.key, found.value, found.memo, current ? current.key : null); + } else { + this.advanceToKey(key); + } + }; - // we should be the new earliest timer if i == 0 - if (i === 0) { - this._reinstallTimerTimeout(); - } + IteratorSynchronizer.prototype.nextInsert = function nextInsert(item) { + var artifacts = this.artifacts; + var target = this.target; + var current = this.current; - return fn; - }, + var node = artifacts.insertBefore(item, current); + target.insert(node.key, node.value, node.memo, current ? current.key : null); + }; - throttle: function(target, method /* , args, wait, [immediate] */) { - var backburner = this; - var args = new Array(arguments.length); - for (var i = 0; i < arguments.length; i++) { - args[i] = arguments[i]; - } - var immediate = args.pop(); - var wait, throttler, index, timer; + IteratorSynchronizer.prototype.startPrune = function startPrune() { + this.current = this.artifacts.head(); + return Phase.Prune; + }; - if (isNumber(immediate) || isString(immediate)) { - wait = immediate; - immediate = true; - } else { - wait = args.pop(); - } + IteratorSynchronizer.prototype.nextPrune = function nextPrune() { + var artifacts = this.artifacts; + var target = this.target; + var current = this.current; - wait = parseInt(wait, 10); + if (current === null) { + return Phase.Done; + } + var node = current; + this.current = artifacts.nextNode(node); + if (node.shouldRemove()) { + artifacts.remove(node); + target.delete(node.key); + } else { + node.reset(); + } + return Phase.Prune; + }; - index = findThrottler(target, method, this._throttlers); - if (index > -1) { return this._throttlers[index]; } // throttled + IteratorSynchronizer.prototype.nextDone = function nextDone() { + this.target.done(); + }; - timer = this._platform.setTimeout(function() { - if (!immediate) { - backburner.run.apply(backburner, args); - } - var index = findThrottler(target, method, backburner._throttlers); - if (index > -1) { - backburner._throttlers.splice(index, 1); - } - }, wait); + return IteratorSynchronizer; + })(); - if (immediate) { - this.run.apply(this, args); + function referenceFromParts(root, parts) { + var reference = root; + for (var i = 0; i < parts.length; i++) { + reference = reference.get(parts[i]); + } + return reference; } - throttler = [target, method, timer]; + exports.ConstReference = ConstReference; + exports.isConst = isConst; + exports.ListItem = ListItem; + exports.referenceFromParts = referenceFromParts; + exports.IterationArtifacts = IterationArtifacts; + exports.ReferenceIterator = ReferenceIterator; + exports.IteratorSynchronizer = IteratorSynchronizer; + exports.CONSTANT = CONSTANT; + exports.INITIAL = INITIAL; + exports.VOLATILE = VOLATILE; + exports.RevisionTag = RevisionTag; + exports.DirtyableTag = DirtyableTag; + exports.combineTagged = combineTagged; + exports.combineSlice = combineSlice; + exports.combine = combine; + exports.CachedTag = CachedTag; + exports.UpdatableTag = UpdatableTag; + exports.CONSTANT_TAG = CONSTANT_TAG; + exports.VOLATILE_TAG = VOLATILE_TAG; + exports.CURRENT_TAG = CURRENT_TAG; + exports.CachedReference = CachedReference; + exports.map = map; + exports.ReferenceCache = ReferenceCache; + exports.isModified = isModified; +}); +enifed('@glimmer/runtime',['exports','@glimmer/util','@glimmer/reference','@glimmer/wire-format'],function(exports,_glimmerUtil,_glimmerReference,_glimmerWireFormat){'use strict';var PrimitiveReference=(function(_ConstReference){babelHelpers.inherits(PrimitiveReference,_ConstReference);function PrimitiveReference(value){_ConstReference.call(this,value);}PrimitiveReference.create = function create(value){if(value === undefined){return UNDEFINED_REFERENCE;}else if(value === null){return NULL_REFERENCE;}else if(value === true){return TRUE_REFERENCE;}else if(value === false){return FALSE_REFERENCE;}else if(typeof value === 'number'){return new ValueReference(value);}else {return new StringReference(value);}};PrimitiveReference.prototype.get = function get(_key){return UNDEFINED_REFERENCE;};return PrimitiveReference;})(_glimmerReference.ConstReference);var StringReference=(function(_PrimitiveReference){babelHelpers.inherits(StringReference,_PrimitiveReference);function StringReference(){_PrimitiveReference.apply(this,arguments);this.lengthReference = null;}StringReference.prototype.get = function get(key){if(key === 'length'){var lengthReference=this.lengthReference;if(lengthReference === null){lengthReference = this.lengthReference = new ValueReference(this.inner.length);}return lengthReference;}else {return _PrimitiveReference.prototype.get.call(this,key);}};return StringReference;})(PrimitiveReference);var ValueReference=(function(_PrimitiveReference2){babelHelpers.inherits(ValueReference,_PrimitiveReference2);function ValueReference(value){_PrimitiveReference2.call(this,value);}return ValueReference;})(PrimitiveReference);var UNDEFINED_REFERENCE=new ValueReference(undefined);var NULL_REFERENCE=new ValueReference(null);var TRUE_REFERENCE=new ValueReference(true);var FALSE_REFERENCE=new ValueReference(false);var ConditionalReference=(function(){function ConditionalReference(inner){this.inner = inner;this.tag = inner.tag;}ConditionalReference.prototype.value = function value(){return this.toBool(this.inner.value());};ConditionalReference.prototype.toBool = function toBool(value){return !!value;};return ConditionalReference;})();var Constants=(function(){function Constants(){ // `0` means NULL +this.references = [];this.strings = [];this.expressions = [];this.arrays = [];this.slices = [];this.blocks = [];this.functions = [];this.others = [];this.NULL_REFERENCE = this.reference(NULL_REFERENCE);this.UNDEFINED_REFERENCE = this.reference(UNDEFINED_REFERENCE);}Constants.prototype.getReference = function getReference(value){return this.references[value - 1];};Constants.prototype.reference = function reference(value){var index=this.references.length;this.references.push(value);return index + 1;};Constants.prototype.getString = function getString(value){return this.strings[value - 1];};Constants.prototype.string = function string(value){var index=this.strings.length;this.strings.push(value);return index + 1;};Constants.prototype.getExpression = function getExpression(value){return this.expressions[value - 1];};Constants.prototype.expression = function expression(value){var index=this.expressions.length;this.expressions.push(value);return index + 1;};Constants.prototype.getArray = function getArray(value){return this.arrays[value - 1];};Constants.prototype.array = function array(values){var index=this.arrays.length;this.arrays.push(values);return index + 1;};Constants.prototype.getSlice = function getSlice(value){return this.slices[value - 1];};Constants.prototype.slice = function slice(_slice2){ // TODO: Put the entire program in one big array +var index=this.slices.length;this.slices.push(_slice2);return index + 1;};Constants.prototype.getBlock = function getBlock(value){return this.blocks[value - 1];};Constants.prototype.block = function block(_block2){var index=this.blocks.length;this.blocks.push(_block2);return index + 1;};Constants.prototype.getFunction = function getFunction(value){return this.functions[value - 1];};Constants.prototype.function = function _function(f){var index=this.functions.length;this.functions.push(f);return index + 1;};Constants.prototype.getOther = function getOther(value){return this.others[value - 1];};Constants.prototype.other = function other(_other){var index=this.others.length;this.others.push(_other);return index + 1;};return Constants;})();var AppendOpcodes=(function(){function AppendOpcodes(){this.evaluateOpcode = _glimmerUtil.fillNulls(51 /* EvaluatePartial */ + 1);}AppendOpcodes.prototype.add = function add(name,evaluate){this.evaluateOpcode[name] = evaluate;};AppendOpcodes.prototype.construct = function construct(name,_debug,op1,op2,op3){return [name | 0,(op1 || 0) | 0,(op2 || 0) | 0,(op3 || 0) | 0];};AppendOpcodes.prototype.evaluate = function evaluate(vm,opcode){_glimmerUtil.LOGGER.debug('[VM] OPCODE: ' + opcode.type);var func=this.evaluateOpcode[opcode.type];func(vm,opcode);};return AppendOpcodes;})();var APPEND_OPCODES=new AppendOpcodes();var AbstractOpcode=(function(){function AbstractOpcode(){_glimmerUtil.initializeGuid(this);}AbstractOpcode.prototype.toJSON = function toJSON(){return {guid:this._guid,type:this.type};};return AbstractOpcode;})();var UpdatingOpcode=(function(_AbstractOpcode){babelHelpers.inherits(UpdatingOpcode,_AbstractOpcode);function UpdatingOpcode(){_AbstractOpcode.apply(this,arguments);this.next = null;this.prev = null;}return UpdatingOpcode;})(AbstractOpcode);APPEND_OPCODES.add(20, /* OpenBlock */function(vm,_ref){var _getBlock=_ref.op1;var _args=_ref.op2;var inner=vm.constants.getOther(_getBlock);var rawArgs=vm.constants.getExpression(_args);var args=null;var block=inner.evaluate(vm);if(block){args = rawArgs.evaluate(vm);} // FIXME: can we avoid doing this when we don't have a block? +vm.pushCallerScope();if(block){vm.invokeBlock(block,args || null);}});APPEND_OPCODES.add(21, /* CloseBlock */function(vm){return vm.popScope();});APPEND_OPCODES.add(0, /* PushChildScope */function(vm){return vm.pushChildScope();});APPEND_OPCODES.add(1, /* PopScope */function(vm){return vm.popScope();});APPEND_OPCODES.add(2, /* PushDynamicScope */function(vm){return vm.pushDynamicScope();});APPEND_OPCODES.add(3, /* PopDynamicScope */function(vm){return vm.popDynamicScope();});APPEND_OPCODES.add(4, /* Put */function(vm,_ref2){var reference=_ref2.op1;vm.frame.setOperand(vm.constants.getReference(reference));});APPEND_OPCODES.add(5, /* EvaluatePut */function(vm,_ref3){var expression=_ref3.op1;var expr=vm.constants.getExpression(expression);vm.evaluateOperand(expr);});APPEND_OPCODES.add(6, /* PutArgs */function(vm,_ref4){var args=_ref4.op1;vm.evaluateArgs(vm.constants.getExpression(args));});APPEND_OPCODES.add(7, /* BindPositionalArgs */function(vm,_ref5){var _symbols=_ref5.op1;var symbols=vm.constants.getArray(_symbols);vm.bindPositionalArgs(symbols);});APPEND_OPCODES.add(8, /* BindNamedArgs */function(vm,_ref6){var _names=_ref6.op1;var _symbols=_ref6.op2;var names=vm.constants.getArray(_names);var symbols=vm.constants.getArray(_symbols);vm.bindNamedArgs(names,symbols);});APPEND_OPCODES.add(9, /* BindBlocks */function(vm,_ref7){var _names=_ref7.op1;var _symbols=_ref7.op2;var names=vm.constants.getArray(_names);var symbols=vm.constants.getArray(_symbols);vm.bindBlocks(names,symbols);});APPEND_OPCODES.add(10, /* BindPartialArgs */function(vm,_ref8){var symbol=_ref8.op1;vm.bindPartialArgs(symbol);});APPEND_OPCODES.add(11, /* BindCallerScope */function(vm){return vm.bindCallerScope();});APPEND_OPCODES.add(12, /* BindDynamicScope */function(vm,_ref9){var _names=_ref9.op1;var names=vm.constants.getArray(_names);vm.bindDynamicScope(names);});APPEND_OPCODES.add(13, /* Enter */function(vm,_ref10){var slice=_ref10.op1;return vm.enter(slice);});APPEND_OPCODES.add(14, /* Exit */function(vm){return vm.exit();});APPEND_OPCODES.add(15, /* Evaluate */function(vm,_ref11){var _block=_ref11.op1;var block=vm.constants.getBlock(_block);var args=vm.frame.getArgs();vm.invokeBlock(block,args);});APPEND_OPCODES.add(16, /* Jump */function(vm,_ref12){var target=_ref12.op1;return vm.goto(target);});APPEND_OPCODES.add(17, /* JumpIf */function(vm,_ref13){var target=_ref13.op1;var reference=vm.frame.getCondition();if(_glimmerReference.isConst(reference)){if(reference.value()){vm.goto(target);}}else {var cache=new _glimmerReference.ReferenceCache(reference);if(cache.peek()){vm.goto(target);}vm.updateWith(new Assert(cache));}});APPEND_OPCODES.add(18, /* JumpUnless */function(vm,_ref14){var target=_ref14.op1;var reference=vm.frame.getCondition();if(_glimmerReference.isConst(reference)){if(!reference.value()){vm.goto(target);}}else {var cache=new _glimmerReference.ReferenceCache(reference);if(!cache.peek()){vm.goto(target);}vm.updateWith(new Assert(cache));}});var ConstTest=function(ref,_env){return new _glimmerReference.ConstReference(!!ref.value());};var SimpleTest=function(ref,_env){return ref;};var EnvironmentTest=function(ref,env){return env.toConditionalReference(ref);};APPEND_OPCODES.add(19, /* Test */function(vm,_ref15){var _func=_ref15.op1;var operand=vm.frame.getOperand();var func=vm.constants.getFunction(_func);vm.frame.setCondition(func(operand,vm.env));});var Assert=(function(_UpdatingOpcode){babelHelpers.inherits(Assert,_UpdatingOpcode);function Assert(cache){_UpdatingOpcode.call(this);this.type = "assert";this.tag = cache.tag;this.cache = cache;}Assert.prototype.evaluate = function evaluate(vm){var cache=this.cache;if(_glimmerReference.isModified(cache.revalidate())){vm.throw();}};Assert.prototype.toJSON = function toJSON(){var type=this.type;var _guid=this._guid;var cache=this.cache;var expected=undefined;try{expected = JSON.stringify(cache.peek());}catch(e) {expected = String(cache.peek());}return {guid:_guid,type:type,args:[],details:{expected:expected}};};return Assert;})(UpdatingOpcode);var JumpIfNotModifiedOpcode=(function(_UpdatingOpcode2){babelHelpers.inherits(JumpIfNotModifiedOpcode,_UpdatingOpcode2);function JumpIfNotModifiedOpcode(tag,target){_UpdatingOpcode2.call(this);this.target = target;this.type = "jump-if-not-modified";this.tag = tag;this.lastRevision = tag.value();}JumpIfNotModifiedOpcode.prototype.evaluate = function evaluate(vm){var tag=this.tag;var target=this.target;var lastRevision=this.lastRevision;if(!vm.alwaysRevalidate && tag.validate(lastRevision)){vm.goto(target);}};JumpIfNotModifiedOpcode.prototype.didModify = function didModify(){this.lastRevision = this.tag.value();};JumpIfNotModifiedOpcode.prototype.toJSON = function toJSON(){return {guid:this._guid,type:this.type,args:[JSON.stringify(this.target.inspect())]};};return JumpIfNotModifiedOpcode;})(UpdatingOpcode);var DidModifyOpcode=(function(_UpdatingOpcode3){babelHelpers.inherits(DidModifyOpcode,_UpdatingOpcode3);function DidModifyOpcode(target){_UpdatingOpcode3.call(this);this.target = target;this.type = "did-modify";this.tag = _glimmerReference.CONSTANT_TAG;}DidModifyOpcode.prototype.evaluate = function evaluate(){this.target.didModify();};return DidModifyOpcode;})(UpdatingOpcode);var LabelOpcode=(function(){function LabelOpcode(label){this.tag = _glimmerReference.CONSTANT_TAG;this.type = "label";this.label = null;this.prev = null;this.next = null;_glimmerUtil.initializeGuid(this);if(label)this.label = label;}LabelOpcode.prototype.evaluate = function evaluate(){};LabelOpcode.prototype.inspect = function inspect(){return this.label + ' [' + this._guid + ']';};LabelOpcode.prototype.toJSON = function toJSON(){return {guid:this._guid,type:this.type,args:[JSON.stringify(this.inspect())]};};return LabelOpcode;})();var EMPTY_ARRAY=_glimmerUtil.HAS_NATIVE_WEAKMAP?Object.freeze([]):[];var EMPTY_DICT=_glimmerUtil.HAS_NATIVE_WEAKMAP?Object.freeze(_glimmerUtil.dict()):_glimmerUtil.dict();var CompiledPositionalArgs=(function(){function CompiledPositionalArgs(values){this.values = values;this.length = values.length;}CompiledPositionalArgs.create = function create(values){if(values.length){return new this(values);}else {return COMPILED_EMPTY_POSITIONAL_ARGS;}};CompiledPositionalArgs.empty = function empty(){return COMPILED_EMPTY_POSITIONAL_ARGS;};CompiledPositionalArgs.prototype.evaluate = function evaluate(vm){var values=this.values;var length=this.length;var references=new Array(length);for(var i=0;i < length;i++) {references[i] = values[i].evaluate(vm);}return EvaluatedPositionalArgs.create(references);};CompiledPositionalArgs.prototype.toJSON = function toJSON(){return '[' + this.values.map(function(value){return value.toJSON();}).join(", ") + ']';};return CompiledPositionalArgs;})();var COMPILED_EMPTY_POSITIONAL_ARGS=new ((function(_CompiledPositionalArgs){babelHelpers.inherits(_class,_CompiledPositionalArgs);function _class(){_CompiledPositionalArgs.call(this,EMPTY_ARRAY);}_class.prototype.evaluate = function evaluate(_vm){return EVALUATED_EMPTY_POSITIONAL_ARGS;};_class.prototype.toJSON = function toJSON(){return '';};return _class;})(CompiledPositionalArgs))();var EvaluatedPositionalArgs=(function(){function EvaluatedPositionalArgs(values){this.values = values;this.tag = _glimmerReference.combineTagged(values);this.length = values.length;}EvaluatedPositionalArgs.create = function create(values){return new this(values);};EvaluatedPositionalArgs.empty = function empty(){return EVALUATED_EMPTY_POSITIONAL_ARGS;};EvaluatedPositionalArgs.prototype.at = function at(index){var values=this.values;var length=this.length;return index < length?values[index]:UNDEFINED_REFERENCE;};EvaluatedPositionalArgs.prototype.value = function value(){var values=this.values;var length=this.length;var ret=new Array(length);for(var i=0;i < length;i++) {ret[i] = values[i].value();}return ret;};return EvaluatedPositionalArgs;})();var EVALUATED_EMPTY_POSITIONAL_ARGS=new ((function(_EvaluatedPositionalArgs){babelHelpers.inherits(_class2,_EvaluatedPositionalArgs);function _class2(){_EvaluatedPositionalArgs.call(this,EMPTY_ARRAY);}_class2.prototype.at = function at(){return UNDEFINED_REFERENCE;};_class2.prototype.value = function value(){return this.values;};return _class2;})(EvaluatedPositionalArgs))();var CompiledNamedArgs=(function(){function CompiledNamedArgs(keys,values){this.keys = keys;this.values = values;this.length = keys.length;_glimmerUtil.assert(keys.length === values.length,'Keys and values do not have the same length');}CompiledNamedArgs.empty = function empty(){return COMPILED_EMPTY_NAMED_ARGS;};CompiledNamedArgs.create = function create(map){var keys=Object.keys(map);var length=keys.length;if(length > 0){var values=[];for(var i=0;i < length;i++) {values[i] = map[keys[i]];}return new this(keys,values);}else {return COMPILED_EMPTY_NAMED_ARGS;}};CompiledNamedArgs.prototype.evaluate = function evaluate(vm){var keys=this.keys;var values=this.values;var length=this.length;var evaluated=new Array(length);for(var i=0;i < length;i++) {evaluated[i] = values[i].evaluate(vm);}return new EvaluatedNamedArgs(keys,evaluated);};CompiledNamedArgs.prototype.toJSON = function toJSON(){var keys=this.keys;var values=this.values;var inner=keys.map(function(key,i){return key + ': ' + values[i].toJSON();}).join(", ");return '{' + inner + '}';};return CompiledNamedArgs;})();var COMPILED_EMPTY_NAMED_ARGS=new ((function(_CompiledNamedArgs){babelHelpers.inherits(_class3,_CompiledNamedArgs);function _class3(){_CompiledNamedArgs.call(this,EMPTY_ARRAY,EMPTY_ARRAY);}_class3.prototype.evaluate = function evaluate(_vm){return EVALUATED_EMPTY_NAMED_ARGS;};_class3.prototype.toJSON = function toJSON(){return '';};return _class3;})(CompiledNamedArgs))();var EvaluatedNamedArgs=(function(){function EvaluatedNamedArgs(keys,values){var _map=arguments.length <= 2 || arguments[2] === undefined?null:arguments[2];this.keys = keys;this.values = values;this._map = _map;this.tag = _glimmerReference.combineTagged(values);this.length = keys.length;_glimmerUtil.assert(keys.length === values.length,'Keys and values do not have the same length');}EvaluatedNamedArgs.create = function create(map){var keys=Object.keys(map);var length=keys.length;if(length > 0){var values=new Array(length);for(var i=0;i < length;i++) {values[i] = map[keys[i]];}return new this(keys,values,map);}else {return EVALUATED_EMPTY_NAMED_ARGS;}};EvaluatedNamedArgs.empty = function empty(){return EVALUATED_EMPTY_NAMED_ARGS;};EvaluatedNamedArgs.prototype.get = function get(key){var keys=this.keys;var values=this.values;var index=keys.indexOf(key);return index === -1?UNDEFINED_REFERENCE:values[index];};EvaluatedNamedArgs.prototype.has = function has(key){return this.keys.indexOf(key) !== -1;};EvaluatedNamedArgs.prototype.value = function value(){var keys=this.keys;var values=this.values;var out=_glimmerUtil.dict();for(var i=0;i < keys.length;i++) {var key=keys[i];var ref=values[i];out[key] = ref.value();}return out;};babelHelpers.createClass(EvaluatedNamedArgs,[{key:'map',get:function(){var map=this._map;if(map){return map;}map = this._map = _glimmerUtil.dict();var keys=this.keys;var values=this.values;var length=this.length;for(var i=0;i < length;i++) {map[keys[i]] = values[i];}return map;}}]);return EvaluatedNamedArgs;})();var EVALUATED_EMPTY_NAMED_ARGS=new ((function(_EvaluatedNamedArgs){babelHelpers.inherits(_class4,_EvaluatedNamedArgs);function _class4(){_EvaluatedNamedArgs.call(this,EMPTY_ARRAY,EMPTY_ARRAY,EMPTY_DICT);}_class4.prototype.get = function get(){return UNDEFINED_REFERENCE;};_class4.prototype.has = function has(_key){return false;};_class4.prototype.value = function value(){return EMPTY_DICT;};return _class4;})(EvaluatedNamedArgs))();var EMPTY_BLOCKS={default:null,inverse:null};var CompiledArgs=(function(){function CompiledArgs(positional,named,blocks){this.positional = positional;this.named = named;this.blocks = blocks;this.type = "compiled-args";}CompiledArgs.create = function create(positional,named,blocks){if(positional === COMPILED_EMPTY_POSITIONAL_ARGS && named === COMPILED_EMPTY_NAMED_ARGS && blocks === EMPTY_BLOCKS){return this.empty();}else {return new this(positional,named,blocks);}};CompiledArgs.empty = function empty(){return COMPILED_EMPTY_ARGS;};CompiledArgs.prototype.evaluate = function evaluate(vm){var positional=this.positional;var named=this.named;var blocks=this.blocks;return EvaluatedArgs.create(positional.evaluate(vm),named.evaluate(vm),blocks);};return CompiledArgs;})();var COMPILED_EMPTY_ARGS=new ((function(_CompiledArgs){babelHelpers.inherits(_class5,_CompiledArgs);function _class5(){_CompiledArgs.call(this,COMPILED_EMPTY_POSITIONAL_ARGS,COMPILED_EMPTY_NAMED_ARGS,EMPTY_BLOCKS);}_class5.prototype.evaluate = function evaluate(_vm){return EMPTY_EVALUATED_ARGS;};return _class5;})(CompiledArgs))();var EvaluatedArgs=(function(){function EvaluatedArgs(positional,named,blocks){this.positional = positional;this.named = named;this.blocks = blocks;this.tag = _glimmerReference.combineTagged([positional,named]);}EvaluatedArgs.empty = function empty(){return EMPTY_EVALUATED_ARGS;};EvaluatedArgs.create = function create(positional,named,blocks){return new this(positional,named,blocks);};EvaluatedArgs.positional = function positional(values){var blocks=arguments.length <= 1 || arguments[1] === undefined?EMPTY_BLOCKS:arguments[1];return new this(EvaluatedPositionalArgs.create(values),EVALUATED_EMPTY_NAMED_ARGS,blocks);};EvaluatedArgs.named = function named(map){var blocks=arguments.length <= 1 || arguments[1] === undefined?EMPTY_BLOCKS:arguments[1];return new this(EVALUATED_EMPTY_POSITIONAL_ARGS,EvaluatedNamedArgs.create(map),blocks);};return EvaluatedArgs;})();var EMPTY_EVALUATED_ARGS=new EvaluatedArgs(EVALUATED_EMPTY_POSITIONAL_ARGS,EVALUATED_EMPTY_NAMED_ARGS,EMPTY_BLOCKS);APPEND_OPCODES.add(22, /* PutDynamicComponent */function(vm){var reference=vm.frame.getOperand();var cache=_glimmerReference.isConst(reference)?undefined:new _glimmerReference.ReferenceCache(reference);var definition=cache?cache.peek():reference.value();vm.frame.setImmediate(definition);if(cache){vm.updateWith(new Assert(cache));}});APPEND_OPCODES.add(23, /* PutComponent */function(vm,_ref16){var _component=_ref16.op1;var definition=vm.constants.getOther(_component);vm.frame.setImmediate(definition);});APPEND_OPCODES.add(24, /* OpenComponent */function(vm,_ref17){var _args=_ref17.op1;var _shadow=_ref17.op2;var rawArgs=vm.constants.getExpression(_args);var shadow=vm.constants.getBlock(_shadow);var definition=vm.frame.getImmediate();var dynamicScope=vm.pushDynamicScope();var callerScope=vm.scope();var manager=definition.manager;var args=manager.prepareArgs(definition,rawArgs.evaluate(vm),dynamicScope);var hasDefaultBlock=!!args.blocks.default; // TODO Cleanup? +var component=manager.create(vm.env,definition,args,dynamicScope,vm.getSelf(),hasDefaultBlock);var destructor=manager.getDestructor(component);if(destructor)vm.newDestroyable(destructor);var layout=manager.layoutFor(definition,component,vm.env);var selfRef=manager.getSelf(component);vm.beginCacheGroup();vm.stack().pushSimpleBlock();vm.pushRootScope(selfRef,layout.symbols);vm.invokeLayout(args,layout,callerScope,component,manager,shadow);vm.updateWith(new UpdateComponentOpcode(definition.name,component,manager,args,dynamicScope));}); // export class DidCreateElementOpcode extends Opcode { +// public type = "did-create-element"; +// evaluate(vm: VM) { +// let manager = vm.frame.getManager(); +// let component = vm.frame.getComponent(); +// let action = 'DidCreateElementOpcode#evaluate'; +// manager.didCreateElement(component, vm.stack().expectConstructing(action), vm.stack().expectOperations(action)); +// } +// toJSON(): OpcodeJSON { +// return { +// guid: this._guid, +// type: this.type, +// args: ["$ARGS"] +// }; +// } +// } +APPEND_OPCODES.add(25, /* DidCreateElement */function(vm){var manager=vm.frame.getManager();var component=vm.frame.getComponent();var action='DidCreateElementOpcode#evaluate';manager.didCreateElement(component,vm.stack().expectConstructing(action),vm.stack().expectOperations(action));}); // export class ShadowAttributesOpcode extends Opcode { +// public type = "shadow-attributes"; +// evaluate(vm: VM) { +// let shadow = vm.frame.getShadow(); +// vm.pushCallerScope(); +// if (!shadow) return; +// vm.invokeBlock(shadow, EvaluatedArgs.empty()); +// } +// toJSON(): OpcodeJSON { +// return { +// guid: this._guid, +// type: this.type, +// args: ["$ARGS"] +// }; +// } +// } +// Slow path for non-specialized component invocations. Uses an internal +// named lookup on the args. +APPEND_OPCODES.add(26, /* ShadowAttributes */function(vm){var shadow=vm.frame.getShadow();vm.pushCallerScope();if(!shadow)return;vm.invokeBlock(shadow,EvaluatedArgs.empty());}); // export class DidRenderLayoutOpcode extends Opcode { +// public type = "did-render-layout"; +// evaluate(vm: VM) { +// let manager = vm.frame.getManager(); +// let component = vm.frame.getComponent(); +// let bounds = vm.stack().popBlock(); +// manager.didRenderLayout(component, bounds); +// vm.env.didCreate(component, manager); +// vm.updateWith(new DidUpdateLayoutOpcode(manager, component, bounds)); +// } +// } +APPEND_OPCODES.add(27, /* DidRenderLayout */function(vm){var manager=vm.frame.getManager();var component=vm.frame.getComponent();var bounds=vm.stack().popBlock();manager.didRenderLayout(component,bounds);vm.env.didCreate(component,manager);vm.updateWith(new DidUpdateLayoutOpcode(manager,component,bounds));}); // export class CloseComponentOpcode extends Opcode { +// public type = "close-component"; +// evaluate(vm: VM) { +// vm.popScope(); +// vm.popDynamicScope(); +// vm.commitCacheGroup(); +// } +// } +APPEND_OPCODES.add(28, /* CloseComponent */function(vm){vm.popScope();vm.popDynamicScope();vm.commitCacheGroup();});var UpdateComponentOpcode=(function(_UpdatingOpcode4){babelHelpers.inherits(UpdateComponentOpcode,_UpdatingOpcode4);function UpdateComponentOpcode(name,component,manager,args,dynamicScope){_UpdatingOpcode4.call(this);this.name = name;this.component = component;this.manager = manager;this.args = args;this.dynamicScope = dynamicScope;this.type = "update-component";var componentTag=manager.getTag(component);if(componentTag){this.tag = _glimmerReference.combine([args.tag,componentTag]);}else {this.tag = args.tag;}}UpdateComponentOpcode.prototype.evaluate = function evaluate(_vm){var component=this.component;var manager=this.manager;var args=this.args;var dynamicScope=this.dynamicScope;manager.update(component,args,dynamicScope);};UpdateComponentOpcode.prototype.toJSON = function toJSON(){return {guid:this._guid,type:this.type,args:[JSON.stringify(this.name)]};};return UpdateComponentOpcode;})(UpdatingOpcode);var DidUpdateLayoutOpcode=(function(_UpdatingOpcode5){babelHelpers.inherits(DidUpdateLayoutOpcode,_UpdatingOpcode5);function DidUpdateLayoutOpcode(manager,component,bounds){_UpdatingOpcode5.call(this);this.manager = manager;this.component = component;this.bounds = bounds;this.type = "did-update-layout";this.tag = _glimmerReference.CONSTANT_TAG;}DidUpdateLayoutOpcode.prototype.evaluate = function evaluate(vm){var manager=this.manager;var component=this.component;var bounds=this.bounds;manager.didUpdateLayout(component,bounds);vm.env.didUpdate(component,manager);};return DidUpdateLayoutOpcode;})(UpdatingOpcode);var Cursor=function Cursor(element,nextSibling){this.element = element;this.nextSibling = nextSibling;};var ConcreteBounds=(function(){function ConcreteBounds(parentNode,first,last){this.parentNode = parentNode;this.first = first;this.last = last;}ConcreteBounds.prototype.parentElement = function parentElement(){return this.parentNode;};ConcreteBounds.prototype.firstNode = function firstNode(){return this.first;};ConcreteBounds.prototype.lastNode = function lastNode(){return this.last;};return ConcreteBounds;})();var SingleNodeBounds=(function(){function SingleNodeBounds(parentNode,node){this.parentNode = parentNode;this.node = node;}SingleNodeBounds.prototype.parentElement = function parentElement(){return this.parentNode;};SingleNodeBounds.prototype.firstNode = function firstNode(){return this.node;};SingleNodeBounds.prototype.lastNode = function lastNode(){return this.node;};return SingleNodeBounds;})();function single(parent,node){return new SingleNodeBounds(parent,node);}function moveBounds(bounds,reference){var parent=bounds.parentElement();var first=bounds.firstNode();var last=bounds.lastNode();var node=first;while(node) {var next=node.nextSibling;parent.insertBefore(node,reference);if(node === last)return next;node = next;}return null;}function clear(bounds){var parent=bounds.parentElement();var first=bounds.firstNode();var last=bounds.lastNode();var node=first;while(node) {var next=node.nextSibling;parent.removeChild(node);if(node === last)return next;node = next;}return null;}function isSafeString(value){return !!value && typeof value['toHTML'] === 'function';}function isNode(value){return value !== null && typeof value === 'object' && typeof value['nodeType'] === 'number';}function isString(value){return typeof value === 'string';}var Upsert=function Upsert(bounds){this.bounds = bounds;};function cautiousInsert(dom,cursor,value){if(isString(value)){return TextUpsert.insert(dom,cursor,value);}if(isSafeString(value)){return SafeStringUpsert.insert(dom,cursor,value);}if(isNode(value)){return NodeUpsert.insert(dom,cursor,value);}throw _glimmerUtil.unreachable();}function trustingInsert(dom,cursor,value){if(isString(value)){return HTMLUpsert.insert(dom,cursor,value);}if(isNode(value)){return NodeUpsert.insert(dom,cursor,value);}throw _glimmerUtil.unreachable();}var TextUpsert=(function(_Upsert){babelHelpers.inherits(TextUpsert,_Upsert);TextUpsert.insert = function insert(dom,cursor,value){var textNode=dom.createTextNode(value);dom.insertBefore(cursor.element,textNode,cursor.nextSibling);var bounds=new SingleNodeBounds(cursor.element,textNode);return new TextUpsert(bounds,textNode);};function TextUpsert(bounds,textNode){_Upsert.call(this,bounds);this.textNode = textNode;}TextUpsert.prototype.update = function update(_dom,value){if(isString(value)){var textNode=this.textNode;textNode.nodeValue = value;return true;}else {return false;}};return TextUpsert;})(Upsert);var HTMLUpsert=(function(_Upsert2){babelHelpers.inherits(HTMLUpsert,_Upsert2);function HTMLUpsert(){_Upsert2.apply(this,arguments);}HTMLUpsert.insert = function insert(dom,cursor,value){var bounds=dom.insertHTMLBefore(cursor.element,value,cursor.nextSibling);return new HTMLUpsert(bounds);};HTMLUpsert.prototype.update = function update(dom,value){if(isString(value)){var bounds=this.bounds;var parentElement=bounds.parentElement();var nextSibling=clear(bounds);this.bounds = dom.insertHTMLBefore(parentElement,nextSibling,value);return true;}else {return false;}};return HTMLUpsert;})(Upsert);var SafeStringUpsert=(function(_Upsert3){babelHelpers.inherits(SafeStringUpsert,_Upsert3);function SafeStringUpsert(bounds,lastStringValue){_Upsert3.call(this,bounds);this.lastStringValue = lastStringValue;}SafeStringUpsert.insert = function insert(dom,cursor,value){var stringValue=value.toHTML();var bounds=dom.insertHTMLBefore(cursor.element,stringValue,cursor.nextSibling);return new SafeStringUpsert(bounds,stringValue);};SafeStringUpsert.prototype.update = function update(dom,value){if(isSafeString(value)){var stringValue=value.toHTML();if(stringValue !== this.lastStringValue){var bounds=this.bounds;var parentElement=bounds.parentElement();var nextSibling=clear(bounds);this.bounds = dom.insertHTMLBefore(parentElement,nextSibling,stringValue);this.lastStringValue = stringValue;}return true;}else {return false;}};return SafeStringUpsert;})(Upsert);var NodeUpsert=(function(_Upsert4){babelHelpers.inherits(NodeUpsert,_Upsert4);function NodeUpsert(){_Upsert4.apply(this,arguments);}NodeUpsert.insert = function insert(dom,cursor,node){dom.insertBefore(cursor.element,node,cursor.nextSibling);return new NodeUpsert(single(cursor.element,node));};NodeUpsert.prototype.update = function update(dom,value){if(isNode(value)){var bounds=this.bounds;var parentElement=bounds.parentElement();var nextSibling=clear(bounds);this.bounds = dom.insertNodeBefore(parentElement,value,nextSibling);return true;}else {return false;}};return NodeUpsert;})(Upsert);var COMPONENT_DEFINITION_BRAND='COMPONENT DEFINITION [id=e59c754e-61eb-4392-8c4a-2c0ac72bfcd4]';function isComponentDefinition(obj){return typeof obj === 'object' && obj && obj[COMPONENT_DEFINITION_BRAND];}var ComponentDefinition=function ComponentDefinition(name,manager,ComponentClass){this[COMPONENT_DEFINITION_BRAND] = true;this.name = name;this.manager = manager;this.ComponentClass = ComponentClass;};var CompiledExpression=(function(){function CompiledExpression(){}CompiledExpression.prototype.toJSON = function toJSON(){return 'UNIMPL: ' + this.type.toUpperCase();};return CompiledExpression;})();APPEND_OPCODES.add(29, /* Text */function(vm,_ref18){var text=_ref18.op1;vm.stack().appendText(vm.constants.getString(text));});APPEND_OPCODES.add(30, /* Comment */function(vm,_ref19){var text=_ref19.op1;vm.stack().appendComment(vm.constants.getString(text));});APPEND_OPCODES.add(32, /* OpenElement */function(vm,_ref20){var tag=_ref20.op1;vm.stack().openElement(vm.constants.getString(tag));});APPEND_OPCODES.add(33, /* PushRemoteElement */function(vm){var reference=vm.frame.getOperand();var cache=_glimmerReference.isConst(reference)?undefined:new _glimmerReference.ReferenceCache(reference);var element=cache?cache.peek():reference.value();vm.stack().pushRemoteElement(element);if(cache){vm.updateWith(new Assert(cache));}});APPEND_OPCODES.add(34, /* PopRemoteElement */function(vm){return vm.stack().popRemoteElement();});APPEND_OPCODES.add(35, /* OpenComponentElement */function(vm,_ref21){var _tag=_ref21.op1;var tag=vm.constants.getString(_tag);vm.stack().openElement(tag,new ComponentElementOperations(vm.env));});APPEND_OPCODES.add(36, /* OpenDynamicElement */function(vm){var tagName=vm.frame.getOperand().value();vm.stack().openElement(tagName);});var ClassList=(function(){function ClassList(){this.list = null;this.isConst = true;}ClassList.prototype.append = function append(reference){var list=this.list;var isConst$$=this.isConst;if(list === null)list = this.list = [];list.push(reference);this.isConst = isConst$$ && _glimmerReference.isConst(reference);};ClassList.prototype.toReference = function toReference(){var list=this.list;var isConst$$=this.isConst;if(!list)return NULL_REFERENCE;if(isConst$$)return PrimitiveReference.create(toClassName(list));return new ClassListReference(list);};return ClassList;})();var ClassListReference=(function(_CachedReference){babelHelpers.inherits(ClassListReference,_CachedReference);function ClassListReference(list){_CachedReference.call(this);this.list = [];this.tag = _glimmerReference.combineTagged(list);this.list = list;}ClassListReference.prototype.compute = function compute(){return toClassName(this.list);};return ClassListReference;})(_glimmerReference.CachedReference);function toClassName(list){var ret=[];for(var i=0;i < list.length;i++) {var value=list[i].value();if(value !== false && value !== null && value !== undefined)ret.push(value);}return ret.length === 0?null:ret.join(' ');}var SimpleElementOperations=(function(){function SimpleElementOperations(env){this.env = env;this.opcodes = null;this.classList = null;}SimpleElementOperations.prototype.addStaticAttribute = function addStaticAttribute(element,name,value){if(name === 'class'){this.addClass(PrimitiveReference.create(value));}else {this.env.getAppendOperations().setAttribute(element,name,value);}};SimpleElementOperations.prototype.addStaticAttributeNS = function addStaticAttributeNS(element,namespace,name,value){this.env.getAppendOperations().setAttribute(element,name,value,namespace);};SimpleElementOperations.prototype.addDynamicAttribute = function addDynamicAttribute(element,name,reference,isTrusting){if(name === 'class'){this.addClass(reference);}else {var attributeManager=this.env.attributeFor(element,name,isTrusting);var attribute=new DynamicAttribute(element,attributeManager,name,reference);this.addAttribute(attribute);}};SimpleElementOperations.prototype.addDynamicAttributeNS = function addDynamicAttributeNS(element,namespace,name,reference,isTrusting){var attributeManager=this.env.attributeFor(element,name,isTrusting,namespace);var nsAttribute=new DynamicAttribute(element,attributeManager,name,reference,namespace);this.addAttribute(nsAttribute);};SimpleElementOperations.prototype.flush = function flush(element,vm){var env=vm.env;var opcodes=this.opcodes;var classList=this.classList;for(var i=0;opcodes && i < opcodes.length;i++) {vm.updateWith(opcodes[i]);}if(classList){var attributeManager=env.attributeFor(element,'class',false);var attribute=new DynamicAttribute(element,attributeManager,'class',classList.toReference());var opcode=attribute.flush(env);if(opcode){vm.updateWith(opcode);}}this.opcodes = null;this.classList = null;};SimpleElementOperations.prototype.addClass = function addClass(reference){var classList=this.classList;if(!classList){classList = this.classList = new ClassList();}classList.append(reference);};SimpleElementOperations.prototype.addAttribute = function addAttribute(attribute){var opcode=attribute.flush(this.env);if(opcode){var opcodes=this.opcodes;if(!opcodes){opcodes = this.opcodes = [];}opcodes.push(opcode);}};return SimpleElementOperations;})();var ComponentElementOperations=(function(){function ComponentElementOperations(env){this.env = env;this.attributeNames = null;this.attributes = null;this.classList = null;}ComponentElementOperations.prototype.addStaticAttribute = function addStaticAttribute(element,name,value){if(name === 'class'){this.addClass(PrimitiveReference.create(value));}else if(this.shouldAddAttribute(name)){this.addAttribute(name,new StaticAttribute(element,name,value));}};ComponentElementOperations.prototype.addStaticAttributeNS = function addStaticAttributeNS(element,namespace,name,value){if(this.shouldAddAttribute(name)){this.addAttribute(name,new StaticAttribute(element,name,value,namespace));}};ComponentElementOperations.prototype.addDynamicAttribute = function addDynamicAttribute(element,name,reference,isTrusting){if(name === 'class'){this.addClass(reference);}else if(this.shouldAddAttribute(name)){var attributeManager=this.env.attributeFor(element,name,isTrusting);var attribute=new DynamicAttribute(element,attributeManager,name,reference);this.addAttribute(name,attribute);}};ComponentElementOperations.prototype.addDynamicAttributeNS = function addDynamicAttributeNS(element,namespace,name,reference,isTrusting){if(this.shouldAddAttribute(name)){var attributeManager=this.env.attributeFor(element,name,isTrusting,namespace);var nsAttribute=new DynamicAttribute(element,attributeManager,name,reference,namespace);this.addAttribute(name,nsAttribute);}};ComponentElementOperations.prototype.flush = function flush(element,vm){var env=this.env;var attributes=this.attributes;var classList=this.classList;for(var i=0;attributes && i < attributes.length;i++) {var opcode=attributes[i].flush(env);if(opcode){vm.updateWith(opcode);}}if(classList){var attributeManager=env.attributeFor(element,'class',false);var attribute=new DynamicAttribute(element,attributeManager,'class',classList.toReference());var opcode=attribute.flush(env);if(opcode){vm.updateWith(opcode);}}};ComponentElementOperations.prototype.shouldAddAttribute = function shouldAddAttribute(name){return !this.attributeNames || this.attributeNames.indexOf(name) === -1;};ComponentElementOperations.prototype.addClass = function addClass(reference){var classList=this.classList;if(!classList){classList = this.classList = new ClassList();}classList.append(reference);};ComponentElementOperations.prototype.addAttribute = function addAttribute(name,attribute){var attributeNames=this.attributeNames;var attributes=this.attributes;if(!attributeNames){attributeNames = this.attributeNames = [];attributes = this.attributes = [];}attributeNames.push(name);_glimmerUtil.unwrap(attributes).push(attribute);};return ComponentElementOperations;})();APPEND_OPCODES.add(37, /* FlushElement */function(vm){var stack=vm.stack();var action='FlushElementOpcode#evaluate';stack.expectOperations(action).flush(stack.expectConstructing(action),vm);stack.flushElement();});APPEND_OPCODES.add(38, /* CloseElement */function(vm){return vm.stack().closeElement();});APPEND_OPCODES.add(39, /* PopElement */function(vm){return vm.stack().popElement();});APPEND_OPCODES.add(40, /* StaticAttr */function(vm,_ref22){var _name=_ref22.op1;var _value=_ref22.op2;var _namespace=_ref22.op3;var name=vm.constants.getString(_name);var value=vm.constants.getString(_value);if(_namespace){var namespace=vm.constants.getString(_namespace);vm.stack().setStaticAttributeNS(namespace,name,value);}else {vm.stack().setStaticAttribute(name,value);}});APPEND_OPCODES.add(41, /* Modifier */function(vm,_ref23){var _name=_ref23.op1;var _manager=_ref23.op2;var _args=_ref23.op3;var manager=vm.constants.getOther(_manager);var rawArgs=vm.constants.getExpression(_args);var stack=vm.stack();var element=stack.constructing;var updateOperations=stack.updateOperations;var args=rawArgs.evaluate(vm);var dynamicScope=vm.dynamicScope();var modifier=manager.create(element,args,dynamicScope,updateOperations);vm.env.scheduleInstallModifier(modifier,manager);var destructor=manager.getDestructor(modifier);if(destructor){vm.newDestroyable(destructor);}vm.updateWith(new UpdateModifierOpcode(manager,modifier,args));});var UpdateModifierOpcode=(function(_UpdatingOpcode6){babelHelpers.inherits(UpdateModifierOpcode,_UpdatingOpcode6);function UpdateModifierOpcode(manager,modifier,args){_UpdatingOpcode6.call(this);this.manager = manager;this.modifier = modifier;this.args = args;this.type = "update-modifier";this.tag = args.tag;this.lastUpdated = args.tag.value();}UpdateModifierOpcode.prototype.evaluate = function evaluate(vm){var manager=this.manager;var modifier=this.modifier;var tag=this.tag;var lastUpdated=this.lastUpdated;if(!tag.validate(lastUpdated)){vm.env.scheduleUpdateModifier(modifier,manager);this.lastUpdated = tag.value();}};UpdateModifierOpcode.prototype.toJSON = function toJSON(){return {guid:this._guid,type:this.type,args:[JSON.stringify(this.args)]};};return UpdateModifierOpcode;})(UpdatingOpcode);var StaticAttribute=(function(){function StaticAttribute(element,name,value,namespace){this.element = element;this.name = name;this.value = value;this.namespace = namespace;}StaticAttribute.prototype.flush = function flush(env){env.getAppendOperations().setAttribute(this.element,this.name,this.value,this.namespace);return null;};return StaticAttribute;})();var DynamicAttribute=(function(){function DynamicAttribute(element,attributeManager,name,reference,namespace){this.element = element;this.attributeManager = attributeManager;this.name = name;this.reference = reference;this.namespace = namespace;this.cache = null;this.tag = reference.tag;}DynamicAttribute.prototype.patch = function patch(env){var element=this.element;var cache=this.cache;var value=_glimmerUtil.expect(cache,'must patch after flush').revalidate();if(_glimmerReference.isModified(value)){this.attributeManager.updateAttribute(env,element,value,this.namespace);}};DynamicAttribute.prototype.flush = function flush(env){var reference=this.reference;var element=this.element;if(_glimmerReference.isConst(reference)){var value=reference.value();this.attributeManager.setAttribute(env,element,value,this.namespace);return null;}else {var cache=this.cache = new _glimmerReference.ReferenceCache(reference);var value=cache.peek();this.attributeManager.setAttribute(env,element,value,this.namespace);return new PatchElementOpcode(this);}};DynamicAttribute.prototype.toJSON = function toJSON(){var element=this.element;var namespace=this.namespace;var name=this.name;var cache=this.cache;var formattedElement=formatElement(element);var lastValue=_glimmerUtil.expect(cache,'must serialize after flush').peek();if(namespace){return {element:formattedElement,type:'attribute',namespace:namespace,name:name,lastValue:lastValue};}return {element:formattedElement,type:'attribute',namespace:namespace === undefined?null:namespace,name:name,lastValue:lastValue};};return DynamicAttribute;})();function formatElement(element){return JSON.stringify('<' + element.tagName.toLowerCase() + ' />');}APPEND_OPCODES.add(42, /* DynamicAttrNS */function(vm,_ref24){var _name=_ref24.op1;var _namespace=_ref24.op2;var trusting=_ref24.op3;var name=vm.constants.getString(_name);var namespace=vm.constants.getString(_namespace);var reference=vm.frame.getOperand();vm.stack().setDynamicAttributeNS(namespace,name,reference,!!trusting);});APPEND_OPCODES.add(43, /* DynamicAttr */function(vm,_ref25){var _name=_ref25.op1;var trusting=_ref25.op2;var name=vm.constants.getString(_name);var reference=vm.frame.getOperand();vm.stack().setDynamicAttribute(name,reference,!!trusting);});var PatchElementOpcode=(function(_UpdatingOpcode7){babelHelpers.inherits(PatchElementOpcode,_UpdatingOpcode7);function PatchElementOpcode(operation){_UpdatingOpcode7.call(this);this.type = "patch-element";this.tag = operation.tag;this.operation = operation;}PatchElementOpcode.prototype.evaluate = function evaluate(vm){this.operation.patch(vm.env);};PatchElementOpcode.prototype.toJSON = function toJSON(){var _guid=this._guid;var type=this.type;var operation=this.operation;return {guid:_guid,type:type,details:operation.toJSON()};};return PatchElementOpcode;})(UpdatingOpcode);var First=(function(){function First(node){this.node = node;}First.prototype.firstNode = function firstNode(){return this.node;};return First;})();var Last=(function(){function Last(node){this.node = node;}Last.prototype.lastNode = function lastNode(){return this.node;};return Last;})();var Fragment=(function(){function Fragment(bounds){this.bounds = bounds;}Fragment.prototype.parentElement = function parentElement(){return this.bounds.parentElement();};Fragment.prototype.firstNode = function firstNode(){return this.bounds.firstNode();};Fragment.prototype.lastNode = function lastNode(){return this.bounds.lastNode();};Fragment.prototype.update = function update(bounds){this.bounds = bounds;};return Fragment;})();var ElementStack=(function(){function ElementStack(env,parentNode,nextSibling){this.constructing = null;this.operations = null;this.elementStack = new _glimmerUtil.Stack();this.nextSiblingStack = new _glimmerUtil.Stack();this.blockStack = new _glimmerUtil.Stack();this.env = env;this.dom = env.getAppendOperations();this.updateOperations = env.getDOM();this.element = parentNode;this.nextSibling = nextSibling;this.defaultOperations = new SimpleElementOperations(env);this.elementStack.push(this.element);this.nextSiblingStack.push(this.nextSibling);}ElementStack.forInitialRender = function forInitialRender(env,parentNode,nextSibling){return new ElementStack(env,parentNode,nextSibling);};ElementStack.resume = function resume(env,tracker,nextSibling){var parentNode=tracker.parentElement();var stack=new ElementStack(env,parentNode,nextSibling);stack.pushBlockTracker(tracker);return stack;};ElementStack.prototype.expectConstructing = function expectConstructing(method){return _glimmerUtil.expect(this.constructing,method + ' should only be called while constructing an element');};ElementStack.prototype.expectOperations = function expectOperations(method){return _glimmerUtil.expect(this.operations,method + ' should only be called while constructing an element');};ElementStack.prototype.block = function block(){return _glimmerUtil.expect(this.blockStack.current,"Expected a current block tracker");};ElementStack.prototype.popElement = function popElement(){var elementStack=this.elementStack;var nextSiblingStack=this.nextSiblingStack;var topElement=elementStack.pop();nextSiblingStack.pop();_glimmerUtil.LOGGER.debug('-> element stack ' + this.elementStack.toArray().map(function(e){return e.tagName;}).join(', '));this.element = _glimmerUtil.expect(elementStack.current,"can't pop past the last element");this.nextSibling = nextSiblingStack.current;return topElement;};ElementStack.prototype.pushSimpleBlock = function pushSimpleBlock(){var tracker=new SimpleBlockTracker(this.element);this.pushBlockTracker(tracker);return tracker;};ElementStack.prototype.pushUpdatableBlock = function pushUpdatableBlock(){var tracker=new UpdatableBlockTracker(this.element);this.pushBlockTracker(tracker);return tracker;};ElementStack.prototype.pushBlockTracker = function pushBlockTracker(tracker){var isRemote=arguments.length <= 1 || arguments[1] === undefined?false:arguments[1];var current=this.blockStack.current;if(current !== null){current.newDestroyable(tracker);if(!isRemote){current.newBounds(tracker);}}this.blockStack.push(tracker);return tracker;};ElementStack.prototype.pushBlockList = function pushBlockList(list){var tracker=new BlockListTracker(this.element,list);var current=this.blockStack.current;if(current !== null){current.newDestroyable(tracker);current.newBounds(tracker);}this.blockStack.push(tracker);return tracker;};ElementStack.prototype.popBlock = function popBlock(){this.block().finalize(this);return _glimmerUtil.expect(this.blockStack.pop(),"Expected popBlock to return a block");};ElementStack.prototype.openElement = function openElement(tag){var operations=arguments.length <= 1 || arguments[1] === undefined?this.defaultOperations:arguments[1];var element=this.dom.createElement(tag,this.element);this.constructing = element;this.operations = operations;return element;};ElementStack.prototype.flushElement = function flushElement(){var parent=this.element;var element=_glimmerUtil.expect(this.constructing,'flushElement should only be called when constructing an element');this.dom.insertBefore(parent,element,this.nextSibling);this.constructing = null;this.operations = null;this.pushElement(element);this.block().openElement(element);};ElementStack.prototype.pushRemoteElement = function pushRemoteElement(element){this.pushElement(element);var tracker=new RemoteBlockTracker(element);this.pushBlockTracker(tracker,true);};ElementStack.prototype.popRemoteElement = function popRemoteElement(){this.popBlock();this.popElement();};ElementStack.prototype.pushElement = function pushElement(element){this.element = element;this.elementStack.push(element);_glimmerUtil.LOGGER.debug('-> element stack ' + this.elementStack.toArray().map(function(e){return e.tagName;}).join(', '));this.nextSibling = null;this.nextSiblingStack.push(null);};ElementStack.prototype.newDestroyable = function newDestroyable(d){this.block().newDestroyable(d);};ElementStack.prototype.newBounds = function newBounds(bounds){this.block().newBounds(bounds);};ElementStack.prototype.appendText = function appendText(string){var dom=this.dom;var text=dom.createTextNode(string);dom.insertBefore(this.element,text,this.nextSibling);this.block().newNode(text);return text;};ElementStack.prototype.appendComment = function appendComment(string){var dom=this.dom;var comment=dom.createComment(string);dom.insertBefore(this.element,comment,this.nextSibling);this.block().newNode(comment);return comment;};ElementStack.prototype.setStaticAttribute = function setStaticAttribute(name,value){this.expectOperations('setStaticAttribute').addStaticAttribute(this.expectConstructing('setStaticAttribute'),name,value);};ElementStack.prototype.setStaticAttributeNS = function setStaticAttributeNS(namespace,name,value){this.expectOperations('setStaticAttributeNS').addStaticAttributeNS(this.expectConstructing('setStaticAttributeNS'),namespace,name,value);};ElementStack.prototype.setDynamicAttribute = function setDynamicAttribute(name,reference,isTrusting){this.expectOperations('setDynamicAttribute').addDynamicAttribute(this.expectConstructing('setDynamicAttribute'),name,reference,isTrusting);};ElementStack.prototype.setDynamicAttributeNS = function setDynamicAttributeNS(namespace,name,reference,isTrusting){this.expectOperations('setDynamicAttributeNS').addDynamicAttributeNS(this.expectConstructing('setDynamicAttributeNS'),namespace,name,reference,isTrusting);};ElementStack.prototype.closeElement = function closeElement(){this.block().closeElement();this.popElement();};return ElementStack;})();var SimpleBlockTracker=(function(){function SimpleBlockTracker(parent){this.parent = parent;this.first = null;this.last = null;this.destroyables = null;this.nesting = 0;}SimpleBlockTracker.prototype.destroy = function destroy(){var destroyables=this.destroyables;if(destroyables && destroyables.length){for(var i=0;i < destroyables.length;i++) {destroyables[i].destroy();}}};SimpleBlockTracker.prototype.parentElement = function parentElement(){return this.parent;};SimpleBlockTracker.prototype.firstNode = function firstNode(){return this.first && this.first.firstNode();};SimpleBlockTracker.prototype.lastNode = function lastNode(){return this.last && this.last.lastNode();};SimpleBlockTracker.prototype.openElement = function openElement(element){this.newNode(element);this.nesting++;};SimpleBlockTracker.prototype.closeElement = function closeElement(){this.nesting--;};SimpleBlockTracker.prototype.newNode = function newNode(node){if(this.nesting !== 0)return;if(!this.first){this.first = new First(node);}this.last = new Last(node);};SimpleBlockTracker.prototype.newBounds = function newBounds(bounds){if(this.nesting !== 0)return;if(!this.first){this.first = bounds;}this.last = bounds;};SimpleBlockTracker.prototype.newDestroyable = function newDestroyable(d){this.destroyables = this.destroyables || [];this.destroyables.push(d);};SimpleBlockTracker.prototype.finalize = function finalize(stack){if(!this.first){stack.appendComment('');}};return SimpleBlockTracker;})();var RemoteBlockTracker=(function(_SimpleBlockTracker){babelHelpers.inherits(RemoteBlockTracker,_SimpleBlockTracker);function RemoteBlockTracker(){_SimpleBlockTracker.apply(this,arguments);}RemoteBlockTracker.prototype.destroy = function destroy(){_SimpleBlockTracker.prototype.destroy.call(this);clear(this);};return RemoteBlockTracker;})(SimpleBlockTracker);var UpdatableBlockTracker=(function(_SimpleBlockTracker2){babelHelpers.inherits(UpdatableBlockTracker,_SimpleBlockTracker2);function UpdatableBlockTracker(){_SimpleBlockTracker2.apply(this,arguments);}UpdatableBlockTracker.prototype.reset = function reset(env){var destroyables=this.destroyables;if(destroyables && destroyables.length){for(var i=0;i < destroyables.length;i++) {env.didDestroy(destroyables[i]);}}var nextSibling=clear(this);this.destroyables = null;this.first = null;this.last = null;return nextSibling;};return UpdatableBlockTracker;})(SimpleBlockTracker);var BlockListTracker=(function(){function BlockListTracker(parent,boundList){this.parent = parent;this.boundList = boundList;this.parent = parent;this.boundList = boundList;}BlockListTracker.prototype.destroy = function destroy(){this.boundList.forEachNode(function(node){return node.destroy();});};BlockListTracker.prototype.parentElement = function parentElement(){return this.parent;};BlockListTracker.prototype.firstNode = function firstNode(){var head=this.boundList.head();return head && head.firstNode();};BlockListTracker.prototype.lastNode = function lastNode(){var tail=this.boundList.tail();return tail && tail.lastNode();};BlockListTracker.prototype.openElement = function openElement(_element){_glimmerUtil.assert(false,'Cannot openElement directly inside a block list');};BlockListTracker.prototype.closeElement = function closeElement(){_glimmerUtil.assert(false,'Cannot closeElement directly inside a block list');};BlockListTracker.prototype.newNode = function newNode(_node){_glimmerUtil.assert(false,'Cannot create a new node directly inside a block list');};BlockListTracker.prototype.newBounds = function newBounds(_bounds){};BlockListTracker.prototype.newDestroyable = function newDestroyable(_d){};BlockListTracker.prototype.finalize = function finalize(_stack){};return BlockListTracker;})();var CompiledValue=(function(_CompiledExpression){babelHelpers.inherits(CompiledValue,_CompiledExpression);function CompiledValue(value){_CompiledExpression.call(this);this.type = "value";this.reference = PrimitiveReference.create(value);}CompiledValue.prototype.evaluate = function evaluate(_vm){return this.reference;};CompiledValue.prototype.toJSON = function toJSON(){return JSON.stringify(this.reference.value());};return CompiledValue;})(CompiledExpression);var CompiledHasBlock=(function(_CompiledExpression2){babelHelpers.inherits(CompiledHasBlock,_CompiledExpression2);function CompiledHasBlock(inner){_CompiledExpression2.call(this);this.inner = inner;this.type = "has-block";}CompiledHasBlock.prototype.evaluate = function evaluate(vm){var block=this.inner.evaluate(vm);return PrimitiveReference.create(!!block);};CompiledHasBlock.prototype.toJSON = function toJSON(){return 'has-block(' + this.inner.toJSON() + ')';};return CompiledHasBlock;})(CompiledExpression);var CompiledHasBlockParams=(function(_CompiledExpression3){babelHelpers.inherits(CompiledHasBlockParams,_CompiledExpression3);function CompiledHasBlockParams(inner){_CompiledExpression3.call(this);this.inner = inner;this.type = "has-block-params";}CompiledHasBlockParams.prototype.evaluate = function evaluate(vm){var block=this.inner.evaluate(vm);var hasLocals=block && block.symbolTable.getSymbols().locals;return PrimitiveReference.create(!!hasLocals);};CompiledHasBlockParams.prototype.toJSON = function toJSON(){return 'has-block-params(' + this.inner.toJSON() + ')';};return CompiledHasBlockParams;})(CompiledExpression);var CompiledGetBlockBySymbol=(function(){function CompiledGetBlockBySymbol(symbol,debug){this.symbol = symbol;this.debug = debug;}CompiledGetBlockBySymbol.prototype.evaluate = function evaluate(vm){return vm.scope().getBlock(this.symbol);};CompiledGetBlockBySymbol.prototype.toJSON = function toJSON(){return 'get-block($' + this.symbol + '(' + this.debug + '))';};return CompiledGetBlockBySymbol;})();var CompiledInPartialGetBlock=(function(){function CompiledInPartialGetBlock(symbol,name){this.symbol = symbol;this.name = name;}CompiledInPartialGetBlock.prototype.evaluate = function evaluate(vm){var symbol=this.symbol;var name=this.name;var args=vm.scope().getPartialArgs(symbol);return args.blocks[name];};CompiledInPartialGetBlock.prototype.toJSON = function toJSON(){return 'get-block($' + this.symbol + '($ARGS).' + this.name + '))';};return CompiledInPartialGetBlock;})();var CompiledLookup=(function(_CompiledExpression4){babelHelpers.inherits(CompiledLookup,_CompiledExpression4);function CompiledLookup(base,path){_CompiledExpression4.call(this);this.base = base;this.path = path;this.type = "lookup";}CompiledLookup.create = function create(base,path){if(path.length === 0){return base;}else {return new this(base,path);}};CompiledLookup.prototype.evaluate = function evaluate(vm){var base=this.base;var path=this.path;return _glimmerReference.referenceFromParts(base.evaluate(vm),path);};CompiledLookup.prototype.toJSON = function toJSON(){return this.base.toJSON() + '.' + this.path.join('.');};return CompiledLookup;})(CompiledExpression);var CompiledSelf=(function(_CompiledExpression5){babelHelpers.inherits(CompiledSelf,_CompiledExpression5);function CompiledSelf(){_CompiledExpression5.apply(this,arguments);}CompiledSelf.prototype.evaluate = function evaluate(vm){return vm.getSelf();};CompiledSelf.prototype.toJSON = function toJSON(){return 'self';};return CompiledSelf;})(CompiledExpression);var CompiledSymbol=(function(_CompiledExpression6){babelHelpers.inherits(CompiledSymbol,_CompiledExpression6);function CompiledSymbol(symbol,debug){_CompiledExpression6.call(this);this.symbol = symbol;this.debug = debug;}CompiledSymbol.prototype.evaluate = function evaluate(vm){return vm.referenceForSymbol(this.symbol);};CompiledSymbol.prototype.toJSON = function toJSON(){return '$' + this.symbol + '(' + this.debug + ')';};return CompiledSymbol;})(CompiledExpression);var CompiledInPartialName=(function(_CompiledExpression7){babelHelpers.inherits(CompiledInPartialName,_CompiledExpression7);function CompiledInPartialName(symbol,name){_CompiledExpression7.call(this);this.symbol = symbol;this.name = name;}CompiledInPartialName.prototype.evaluate = function evaluate(vm){var symbol=this.symbol;var name=this.name;var args=vm.scope().getPartialArgs(symbol);return args.named.get(name);};CompiledInPartialName.prototype.toJSON = function toJSON(){return '$' + this.symbol + '($ARGS).' + this.name;};return CompiledInPartialName;})(CompiledExpression);var CompiledHelper=(function(_CompiledExpression8){babelHelpers.inherits(CompiledHelper,_CompiledExpression8);function CompiledHelper(name,helper,args,symbolTable){_CompiledExpression8.call(this);this.name = name;this.helper = helper;this.args = args;this.symbolTable = symbolTable;this.type = "helper";}CompiledHelper.prototype.evaluate = function evaluate(vm){var helper=this.helper;return helper(vm,this.args.evaluate(vm),this.symbolTable);};CompiledHelper.prototype.toJSON = function toJSON(){return '`' + this.name.join('.') + '($ARGS)`';};return CompiledHelper;})(CompiledExpression);var CompiledConcat=(function(){function CompiledConcat(parts){this.parts = parts;this.type = "concat";}CompiledConcat.prototype.evaluate = function evaluate(vm){var parts=new Array(this.parts.length);for(var i=0;i < this.parts.length;i++) {parts[i] = this.parts[i].evaluate(vm);}return new ConcatReference(parts);};CompiledConcat.prototype.toJSON = function toJSON(){return 'concat(' + this.parts.map(function(expr){return expr.toJSON();}).join(", ") + ')';};return CompiledConcat;})();var ConcatReference=(function(_CachedReference2){babelHelpers.inherits(ConcatReference,_CachedReference2);function ConcatReference(parts){_CachedReference2.call(this);this.parts = parts;this.tag = _glimmerReference.combineTagged(parts);}ConcatReference.prototype.compute = function compute(){var parts=new Array();for(var i=0;i < this.parts.length;i++) {var value=this.parts[i].value();if(value !== null && value !== undefined){parts[i] = castToString(value);}}if(parts.length > 0){return parts.join('');}return null;};return ConcatReference;})(_glimmerReference.CachedReference);function castToString(value){if(typeof value['toString'] !== 'function'){return '';}return String(value);}var CompiledFunctionExpression=(function(_CompiledExpression9){babelHelpers.inherits(CompiledFunctionExpression,_CompiledExpression9);function CompiledFunctionExpression(func,symbolTable){_CompiledExpression9.call(this);this.func = func;this.symbolTable = symbolTable;this.type = "function";this.func = func;}CompiledFunctionExpression.prototype.evaluate = function evaluate(vm){var func=this.func;var symbolTable=this.symbolTable;return func(vm,symbolTable);};CompiledFunctionExpression.prototype.toJSON = function toJSON(){var func=this.func;if(func.name){return '`' + func.name + '(...)`';}else {return "`func(...)`";}};return CompiledFunctionExpression;})(CompiledExpression);function debugCallback(context,get){console.info('Use `context`, and `get()` to debug this template.'); /* tslint:disable */debugger; /* tslint:enable */return {context:context,get:get};}function getter(vm,builder){return function(path){var parts=path.split('.');if(parts[0] === 'this'){parts[0] = null;}return compileRef(parts,builder).evaluate(vm);};}var callback=debugCallback; // For testing purposes +function setDebuggerCallback(cb){callback = cb;}function resetDebuggerCallback(){callback = debugCallback;}var Compilers=(function(){function Compilers(){this.names = _glimmerUtil.dict();this.funcs = [];}Compilers.prototype.add = function add(name,func){this.funcs.push(func);this.names[name] = this.funcs.length - 1;};Compilers.prototype.compile = function compile(sexp,builder){var name=sexp[0];var index=this.names[name];var func=this.funcs[index];_glimmerUtil.assert(!!func,'expected an implementation for ' + sexp[0]);return func(sexp,builder);};return Compilers;})();var STATEMENTS=new Compilers();STATEMENTS.add('text',function(sexp,builder){builder.text(sexp[1]);});STATEMENTS.add('comment',function(sexp,builder){builder.comment(sexp[1]);});STATEMENTS.add('close-element',function(_sexp,builder){_glimmerUtil.LOGGER.trace('close-element statement');builder.closeElement();});STATEMENTS.add('flush-element',function(_sexp,builder){builder.flushElement();});STATEMENTS.add('modifier',function(sexp,builder){var path=sexp[1];var params=sexp[2];var hash=sexp[3];var args=compileArgs(params,hash,builder);if(builder.env.hasModifier(path,builder.symbolTable)){builder.modifier(path[0],args);}else {throw new Error('Compile Error ' + path.join('.') + ' is not a modifier: Helpers may not be used in the element form.');}});STATEMENTS.add('static-attr',function(sexp,builder){var name=sexp[1];var value=sexp[2];var namespace=sexp[3];builder.staticAttr(name,namespace,value);});STATEMENTS.add('any-dynamic-attr',function(sexp,builder){var name=sexp[1];var value=sexp[2];var namespace=sexp[3];var trusting=sexp[4];builder.putValue(value);if(namespace){builder.dynamicAttrNS(name,namespace,trusting);}else {builder.dynamicAttr(name,trusting);}});STATEMENTS.add('open-element',function(sexp,builder){_glimmerUtil.LOGGER.trace('open-element statement');builder.openPrimitiveElement(sexp[1]);});STATEMENTS.add('optimized-append',function(sexp,builder){var value=sexp[1];var trustingMorph=sexp[2];var _builder$env$macros=builder.env.macros();var inlines=_builder$env$macros.inlines;var returned=inlines.compile(sexp,builder) || value;if(returned === true)return;builder.putValue(returned[1]);if(trustingMorph){builder.trustingAppend();}else {builder.cautiousAppend();}});STATEMENTS.add('unoptimized-append',function(sexp,builder){var value=sexp[1];var trustingMorph=sexp[2];var _builder$env$macros2=builder.env.macros();var inlines=_builder$env$macros2.inlines;var returned=inlines.compile(sexp,builder) || value;if(returned === true)return;if(trustingMorph){builder.guardedTrustingAppend(returned[1]);}else {builder.guardedCautiousAppend(returned[1]);}});STATEMENTS.add('nested-block',function(sexp,builder){var _builder$env$macros3=builder.env.macros();var blocks=_builder$env$macros3.blocks;blocks.compile(sexp,builder);});STATEMENTS.add('scanned-block',function(sexp,builder){var path=sexp[1];var params=sexp[2];var hash=sexp[3];var template=sexp[4];var inverse=sexp[5];var templateBlock=template && template.scan();var inverseBlock=inverse && inverse.scan();var _builder$env$macros4=builder.env.macros();var blocks=_builder$env$macros4.blocks;blocks.compile(['nested-block',path,params,hash,templateBlock,inverseBlock],builder);});STATEMENTS.add('scanned-component',function(sexp,builder){var tag=sexp[1];var attrs=sexp[2];var rawArgs=sexp[3];var rawBlock=sexp[4];var block=rawBlock && rawBlock.scan();var args=compileBlockArgs(null,rawArgs,{default:block,inverse:null},builder);var definition=builder.env.getComponentDefinition([tag],builder.symbolTable);builder.putComponentDefinition(definition);builder.openComponent(args,attrs.scan());builder.closeComponent();});STATEMENTS.add('static-partial',function(sexp,builder){var name=sexp[1];if(!builder.env.hasPartial(name,builder.symbolTable)){throw new Error('Compile Error: Could not find a partial named "' + name + '"');}var definition=builder.env.lookupPartial(name,builder.symbolTable);builder.putPartialDefinition(definition);builder.evaluatePartial();});STATEMENTS.add('dynamic-partial',function(sexp,builder){var name=sexp[1];builder.startLabels();builder.putValue(name);builder.test('simple');builder.enter('BEGIN','END');builder.label('BEGIN');builder.jumpUnless('END');builder.putDynamicPartialDefinition();builder.evaluatePartial();builder.label('END');builder.exit();builder.stopLabels();});STATEMENTS.add('yield',function(sexp,builder){var to=sexp[1];var params=sexp[2];var args=compileArgs(params,null,builder);builder.yield(args,to);});STATEMENTS.add('debugger',function(sexp,builder){builder.putValue(['function',function(vm){var context=vm.getSelf().value();var get=function(path){return getter(vm,builder)(path).value();};callback(context,get);}]);return sexp;});var EXPRESSIONS=new Compilers();function expr(expression,builder){if(Array.isArray(expression)){return EXPRESSIONS.compile(expression,builder);}else {return new CompiledValue(expression);}}EXPRESSIONS.add('unknown',function(sexp,builder){var path=sexp[1];if(builder.env.hasHelper(path,builder.symbolTable)){return new CompiledHelper(path,builder.env.lookupHelper(path,builder.symbolTable),CompiledArgs.empty(),builder.symbolTable);}else {return compileRef(path,builder);}});EXPRESSIONS.add('concat',function(sexp,builder){var params=sexp[1].map(function(p){return expr(p,builder);});return new CompiledConcat(params);});EXPRESSIONS.add('function',function(sexp,builder){return new CompiledFunctionExpression(sexp[1],builder.symbolTable);});EXPRESSIONS.add('helper',function(sexp,builder){var env=builder.env;var symbolTable=builder.symbolTable;var path=sexp[1];var params=sexp[2];var hash=sexp[3];if(env.hasHelper(path,symbolTable)){var args=compileArgs(params,hash,builder);return new CompiledHelper(path,env.lookupHelper(path,symbolTable),args,symbolTable);}else {throw new Error('Compile Error: ' + path.join('.') + ' is not a helper');}});EXPRESSIONS.add('get',function(sexp,builder){return compileRef(sexp[1],builder);});EXPRESSIONS.add('undefined',function(_sexp,_builder){return new CompiledValue(undefined);});EXPRESSIONS.add('arg',function(sexp,builder){var parts=sexp[1];var head=parts[0];var named=undefined,partial=undefined;if(named = builder.symbolTable.getSymbol('named',head)){var path=parts.slice(1);var inner=new CompiledSymbol(named,head);return CompiledLookup.create(inner,path);}else if(partial = builder.symbolTable.getPartialArgs()){var path=parts.slice(1);var inner=new CompiledInPartialName(partial,head);return CompiledLookup.create(inner,path);}else {throw new Error('[BUG] @' + parts.join('.') + ' is not a valid lookup path.');}});EXPRESSIONS.add('has-block',function(sexp,builder){var blockName=sexp[1];var yields=undefined,partial=undefined;if(yields = builder.symbolTable.getSymbol('yields',blockName)){var inner=new CompiledGetBlockBySymbol(yields,blockName);return new CompiledHasBlock(inner);}else if(partial = builder.symbolTable.getPartialArgs()){var inner=new CompiledInPartialGetBlock(partial,blockName);return new CompiledHasBlock(inner);}else {throw new Error('[BUG] ${blockName} is not a valid block name.');}});EXPRESSIONS.add('has-block-params',function(sexp,builder){var blockName=sexp[1];var yields=undefined,partial=undefined;if(yields = builder.symbolTable.getSymbol('yields',blockName)){var inner=new CompiledGetBlockBySymbol(yields,blockName);return new CompiledHasBlockParams(inner);}else if(partial = builder.symbolTable.getPartialArgs()){var inner=new CompiledInPartialGetBlock(partial,blockName);return new CompiledHasBlockParams(inner);}else {throw new Error('[BUG] ${blockName} is not a valid block name.');}});function compileArgs(params,hash,builder){var compiledParams=compileParams(params,builder);var compiledHash=compileHash(hash,builder);return CompiledArgs.create(compiledParams,compiledHash,EMPTY_BLOCKS);}function compileBlockArgs(params,hash,blocks,builder){var compiledParams=compileParams(params,builder);var compiledHash=compileHash(hash,builder);return CompiledArgs.create(compiledParams,compiledHash,blocks);}function compileBaselineArgs(args,builder){var params=args[0];var hash=args[1];var _default=args[2];var inverse=args[3];return CompiledArgs.create(compileParams(params,builder),compileHash(hash,builder),{default:_default,inverse:inverse});}function compileParams(params,builder){if(!params || params.length === 0)return COMPILED_EMPTY_POSITIONAL_ARGS;var compiled=params.map(function(p){return expr(p,builder);});return CompiledPositionalArgs.create(compiled);}function compileHash(hash,builder){if(!hash)return COMPILED_EMPTY_NAMED_ARGS;var keys=hash[0];var values=hash[1];if(keys.length === 0)return COMPILED_EMPTY_NAMED_ARGS;var compiled=values.map(function(p){return expr(p,builder);});return new CompiledNamedArgs(keys,compiled);}function compileRef(parts,builder){var head=parts[0];var local=undefined;if(head === null){var inner=new CompiledSelf();var path=parts.slice(1);return CompiledLookup.create(inner,path);}else if(local = builder.symbolTable.getSymbol('local',head)){var path=parts.slice(1);var inner=new CompiledSymbol(local,head);return CompiledLookup.create(inner,path);}else {var inner=new CompiledSelf();return CompiledLookup.create(inner,parts);}}var Blocks=(function(){function Blocks(){this.names = _glimmerUtil.dict();this.funcs = [];}Blocks.prototype.add = function add(name,func){this.funcs.push(func);this.names[name] = this.funcs.length - 1;};Blocks.prototype.addMissing = function addMissing(func){this.missing = func;};Blocks.prototype.compile = function compile(sexp,builder){ // assert(sexp[1].length === 1, 'paths in blocks are not supported'); +var name=sexp[1][0];var index=this.names[name];if(index === undefined){_glimmerUtil.assert(!!this.missing,name + ' not found, and no catch-all block handler was registered');var func=this.missing;var handled=func(sexp,builder);_glimmerUtil.assert(!!handled,name + ' not found, and the catch-all block handler didn\'t handle it');}else {var func=this.funcs[index];func(sexp,builder);}};return Blocks;})();var BLOCKS=new Blocks();var Inlines=(function(){function Inlines(){this.names = _glimmerUtil.dict();this.funcs = [];}Inlines.prototype.add = function add(name,func){this.funcs.push(func);this.names[name] = this.funcs.length - 1;};Inlines.prototype.addMissing = function addMissing(func){this.missing = func;};Inlines.prototype.compile = function compile(sexp,builder){var value=sexp[1]; // TODO: Fix this so that expression macros can return +// things like components, so that {{component foo}} +// is the same as {{(component foo)}} +if(!Array.isArray(value))return ['expr',value];var path=undefined;var params=undefined;var hash=undefined;if(value[0] === 'helper'){path = value[1];params = value[2];hash = value[3];}else if(value[0] === 'unknown'){path = value[1];params = hash = null;}else {return ['expr',value];}if(path.length > 1 && !params && !hash){return ['expr',value];}var name=path[0];var index=this.names[name];if(index === undefined && this.missing){var func=this.missing;var returned=func(path,params,hash,builder);return returned === false?['expr',value]:returned;}else if(index !== undefined){var func=this.funcs[index];var returned=func(path,params,hash,builder);return returned === false?['expr',value]:returned;}else {return ['expr',value];}};return Inlines;})();var INLINES=new Inlines();populateBuiltins(BLOCKS,INLINES);function populateBuiltins(){var blocks=arguments.length <= 0 || arguments[0] === undefined?new Blocks():arguments[0];var inlines=arguments.length <= 1 || arguments[1] === undefined?new Inlines():arguments[1];blocks.add('if',function(sexp,builder){ // PutArgs +// Test(Environment) +// Enter(BEGIN, END) +// BEGIN: Noop +// JumpUnless(ELSE) +// Evaluate(default) +// Jump(END) +// ELSE: Noop +// Evalulate(inverse) +// END: Noop +// Exit +var params=sexp[2];var hash=sexp[3];var _default=sexp[4];var inverse=sexp[5];var args=compileArgs(params,hash,builder);builder.putArgs(args);builder.test('environment');builder.labelled(null,function(b){if(_default && inverse){b.jumpUnless('ELSE');b.evaluate(_default);b.jump('END');b.label('ELSE');b.evaluate(inverse);}else if(_default){b.jumpUnless('END');b.evaluate(_default);}else {throw _glimmerUtil.unreachable();}});});blocks.add('unless',function(sexp,builder){ // PutArgs +// Test(Environment) +// Enter(BEGIN, END) +// BEGIN: Noop +// JumpUnless(ELSE) +// Evaluate(default) +// Jump(END) +// ELSE: Noop +// Evalulate(inverse) +// END: Noop +// Exit +var params=sexp[2];var hash=sexp[3];var _default=sexp[4];var inverse=sexp[5];var args=compileArgs(params,hash,builder);builder.putArgs(args);builder.test('environment');builder.labelled(null,function(b){if(_default && inverse){b.jumpIf('ELSE');b.evaluate(_default);b.jump('END');b.label('ELSE');b.evaluate(inverse);}else if(_default){b.jumpIf('END');b.evaluate(_default);}else {throw _glimmerUtil.unreachable();}});});blocks.add('with',function(sexp,builder){ // PutArgs +// Test(Environment) +// Enter(BEGIN, END) +// BEGIN: Noop +// JumpUnless(ELSE) +// Evaluate(default) +// Jump(END) +// ELSE: Noop +// Evalulate(inverse) +// END: Noop +// Exit +var params=sexp[2];var hash=sexp[3];var _default=sexp[4];var inverse=sexp[5];var args=compileArgs(params,hash,builder);builder.putArgs(args);builder.test('environment');builder.labelled(null,function(b){if(_default && inverse){b.jumpUnless('ELSE');b.evaluate(_default);b.jump('END');b.label('ELSE');b.evaluate(inverse);}else if(_default){b.jumpUnless('END');b.evaluate(_default);}else {throw _glimmerUtil.unreachable();}});});blocks.add('each',function(sexp,builder){ // Enter(BEGIN, END) +// BEGIN: Noop +// PutArgs +// PutIterable +// JumpUnless(ELSE) +// EnterList(BEGIN2, END2) +// ITER: Noop +// NextIter(BREAK) +// EnterWithKey(BEGIN2, END2) +// BEGIN2: Noop +// PushChildScope +// Evaluate(default) +// PopScope +// END2: Noop +// Exit +// Jump(ITER) +// BREAK: Noop +// ExitList +// Jump(END) +// ELSE: Noop +// Evalulate(inverse) +// END: Noop +// Exit +var params=sexp[2];var hash=sexp[3];var _default=sexp[4];var inverse=sexp[5];var args=compileArgs(params,hash,builder);builder.labelled(args,function(b){b.putIterator();if(inverse){b.jumpUnless('ELSE');}else {b.jumpUnless('END');}b.iter(function(b){b.evaluate(_glimmerUtil.unwrap(_default));});if(inverse){b.jump('END');b.label('ELSE');b.evaluate(inverse);}});});return {blocks:blocks,inlines:inlines};}var badProtocols=['javascript:','vbscript:'];var badTags=['A','BODY','LINK','IMG','IFRAME','BASE','FORM'];var badTagsForDataURI=['EMBED'];var badAttributes=['href','src','background','action'];var badAttributesForDataURI=['src'];function has(array,item){return array.indexOf(item) !== -1;}function checkURI(tagName,attribute){return (tagName === null || has(badTags,tagName)) && has(badAttributes,attribute);}function checkDataURI(tagName,attribute){if(tagName === null)return false;return has(badTagsForDataURI,tagName) && has(badAttributesForDataURI,attribute);}function requiresSanitization(tagName,attribute){return checkURI(tagName,attribute) || checkDataURI(tagName,attribute);}function sanitizeAttributeValue(env,element,attribute,value){var tagName=null;if(value === null || value === undefined){return value;}if(isSafeString(value)){return value.toHTML();}if(!element){tagName = null;}else {tagName = element.tagName.toUpperCase();}var str=normalizeTextValue(value);if(checkURI(tagName,attribute)){var protocol=env.protocolForURL(str);if(has(badProtocols,protocol)){return 'unsafe:' + str;}}if(checkDataURI(tagName,attribute)){return 'unsafe:' + str;}return str;} /* + * @method normalizeProperty + * @param element {HTMLElement} + * @param slotName {String} + * @returns {Object} { name, type } + */function normalizeProperty(element,slotName){var type=undefined,normalized=undefined;if(slotName in element){normalized = slotName;type = 'prop';}else {var lower=slotName.toLowerCase();if(lower in element){type = 'prop';normalized = lower;}else {type = 'attr';normalized = slotName;}}if(type === 'prop' && (normalized.toLowerCase() === 'style' || preferAttr(element.tagName,normalized))){type = 'attr';}return {normalized:normalized,type:type};} // properties that MUST be set as attributes, due to: +// * browser bug +// * strange spec outlier +var ATTR_OVERRIDES={ // phantomjs < 2.0 lets you set it as a prop but won't reflect it +// back to the attribute. button.getAttribute('type') === null +BUTTON:{type:true,form:true},INPUT:{ // Some version of IE (like IE9) actually throw an exception +// if you set input.type = 'something-unknown' +type:true,form:true, // Chrome 46.0.2464.0: 'autocorrect' in document.createElement('input') === false +// Safari 8.0.7: 'autocorrect' in document.createElement('input') === false +// Mobile Safari (iOS 8.4 simulator): 'autocorrect' in document.createElement('input') === true +autocorrect:true, // Chrome 54.0.2840.98: 'list' in document.createElement('input') === true +// Safari 9.1.3: 'list' in document.createElement('input') === false +list:true}, // element.form is actually a legitimate readOnly property, that is to be +// mutated, but must be mutated by setAttribute... +SELECT:{form:true},OPTION:{form:true},TEXTAREA:{form:true},LABEL:{form:true},FIELDSET:{form:true},LEGEND:{form:true},OBJECT:{form:true}};function preferAttr(tagName,propName){var tag=ATTR_OVERRIDES[tagName.toUpperCase()];return tag && tag[propName.toLowerCase()] || false;}var innerHTMLWrapper={colgroup:{depth:2,before:'',after:'
    '},table:{depth:1,before:'',after:'
    '},tbody:{depth:2,before:'',after:'
    '},tfoot:{depth:2,before:'',after:'
    '},thead:{depth:2,before:'',after:'
    '},tr:{depth:3,before:'',after:'
    '}}; // Patch: innerHTML Fix +// Browsers: IE9 +// Reason: IE9 don't allow us to set innerHTML on col, colgroup, frameset, +// html, style, table, tbody, tfoot, thead, title, tr. +// Fix: Wrap the innerHTML we are about to set in its parents, apply the +// wrapped innerHTML on a div, then move the unwrapped nodes into the +// target position. +function domChanges(document,DOMChangesClass){if(!document)return DOMChangesClass;if(!shouldApplyFix(document)){return DOMChangesClass;}var div=document.createElement('div');return (function(_DOMChangesClass){babelHelpers.inherits(DOMChangesWithInnerHTMLFix,_DOMChangesClass);function DOMChangesWithInnerHTMLFix(){_DOMChangesClass.apply(this,arguments);}DOMChangesWithInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent,nextSibling,html){if(html === null || html === ''){return _DOMChangesClass.prototype.insertHTMLBefore.call(this,parent,nextSibling,html);}var parentTag=parent.tagName.toLowerCase();var wrapper=innerHTMLWrapper[parentTag];if(wrapper === undefined){return _DOMChangesClass.prototype.insertHTMLBefore.call(this,parent,nextSibling,html);}return fixInnerHTML(parent,wrapper,div,html,nextSibling);};return DOMChangesWithInnerHTMLFix;})(DOMChangesClass);}function treeConstruction(document,DOMTreeConstructionClass){if(!document)return DOMTreeConstructionClass;if(!shouldApplyFix(document)){return DOMTreeConstructionClass;}var div=document.createElement('div');return (function(_DOMTreeConstructionClass){babelHelpers.inherits(DOMTreeConstructionWithInnerHTMLFix,_DOMTreeConstructionClass);function DOMTreeConstructionWithInnerHTMLFix(){_DOMTreeConstructionClass.apply(this,arguments);}DOMTreeConstructionWithInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent,html,reference){if(html === null || html === ''){return _DOMTreeConstructionClass.prototype.insertHTMLBefore.call(this,parent,html,reference);}var parentTag=parent.tagName.toLowerCase();var wrapper=innerHTMLWrapper[parentTag];if(wrapper === undefined){return _DOMTreeConstructionClass.prototype.insertHTMLBefore.call(this,parent,html,reference);}return fixInnerHTML(parent,wrapper,div,html,reference);};return DOMTreeConstructionWithInnerHTMLFix;})(DOMTreeConstructionClass);}function fixInnerHTML(parent,wrapper,div,html,reference){var wrappedHtml=wrapper.before + html + wrapper.after;div.innerHTML = wrappedHtml;var parentNode=div;for(var i=0;i < wrapper.depth;i++) {parentNode = parentNode.childNodes[0];}var _moveNodesBefore=moveNodesBefore(parentNode,parent,reference);var first=_moveNodesBefore[0];var last=_moveNodesBefore[1];return new ConcreteBounds(parent,first,last);}function shouldApplyFix(document){var table=document.createElement('table');try{table.innerHTML = '';}catch(e) {}finally {if(table.childNodes.length !== 0){ // It worked as expected, no fix required +return false;}}return true;}var SVG_NAMESPACE$1='http://www.w3.org/2000/svg'; // Patch: insertAdjacentHTML on SVG Fix +// Browsers: Safari, IE, Edge, Firefox ~33-34 +// Reason: insertAdjacentHTML does not exist on SVG elements in Safari. It is +// present but throws an exception on IE and Edge. Old versions of +// Firefox create nodes in the incorrect namespace. +// Fix: Since IE and Edge silently fail to create SVG nodes using +// innerHTML, and because Firefox may create nodes in the incorrect +// namespace using innerHTML on SVG elements, an HTML-string wrapping +// approach is used. A pre/post SVG tag is added to the string, then +// that whole string is added to a div. The created nodes are plucked +// out and applied to the target location on DOM. +function domChanges$1(document,DOMChangesClass,svgNamespace){if(!document)return DOMChangesClass;if(!shouldApplyFix$1(document,svgNamespace)){return DOMChangesClass;}var div=document.createElement('div');return (function(_DOMChangesClass2){babelHelpers.inherits(DOMChangesWithSVGInnerHTMLFix,_DOMChangesClass2);function DOMChangesWithSVGInnerHTMLFix(){_DOMChangesClass2.apply(this,arguments);}DOMChangesWithSVGInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent,nextSibling,html){if(html === null || html === ''){return _DOMChangesClass2.prototype.insertHTMLBefore.call(this,parent,nextSibling,html);}if(parent.namespaceURI !== svgNamespace){return _DOMChangesClass2.prototype.insertHTMLBefore.call(this,parent,nextSibling,html);}return fixSVG(parent,div,html,nextSibling);};return DOMChangesWithSVGInnerHTMLFix;})(DOMChangesClass);}function treeConstruction$1(document,TreeConstructionClass,svgNamespace){if(!document)return TreeConstructionClass;if(!shouldApplyFix$1(document,svgNamespace)){return TreeConstructionClass;}var div=document.createElement('div');return (function(_TreeConstructionClass){babelHelpers.inherits(TreeConstructionWithSVGInnerHTMLFix,_TreeConstructionClass);function TreeConstructionWithSVGInnerHTMLFix(){_TreeConstructionClass.apply(this,arguments);}TreeConstructionWithSVGInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent,html,reference){if(html === null || html === ''){return _TreeConstructionClass.prototype.insertHTMLBefore.call(this,parent,html,reference);}if(parent.namespaceURI !== svgNamespace){return _TreeConstructionClass.prototype.insertHTMLBefore.call(this,parent,html,reference);}return fixSVG(parent,div,html,reference);};return TreeConstructionWithSVGInnerHTMLFix;})(TreeConstructionClass);}function fixSVG(parent,div,html,reference){ // IE, Edge: also do not correctly support using `innerHTML` on SVG +// namespaced elements. So here a wrapper is used. +var wrappedHtml='' + html + '';div.innerHTML = wrappedHtml;var _moveNodesBefore2=moveNodesBefore(div.firstChild,parent,reference);var first=_moveNodesBefore2[0];var last=_moveNodesBefore2[1];return new ConcreteBounds(parent,first,last);}function shouldApplyFix$1(document,svgNamespace){var svg=document.createElementNS(svgNamespace,'svg');try{svg['insertAdjacentHTML']('beforeEnd','');}catch(e) {}finally { // FF: Old versions will create a node in the wrong namespace +if(svg.childNodes.length === 1 && _glimmerUtil.unwrap(svg.firstChild).namespaceURI === SVG_NAMESPACE$1){ // The test worked as expected, no fix required +return false;}return true;}} // Patch: Adjacent text node merging fix +// Browsers: IE, Edge, Firefox w/o inspector open +// Reason: These browsers will merge adjacent text nodes. For exmaple given +//
    Hello
    with div.insertAdjacentHTML(' world') browsers +// with proper behavior will populate div.childNodes with two items. +// These browsers will populate it with one merged node instead. +// Fix: Add these nodes to a wrapper element, then iterate the childNodes +// of that wrapper and move the nodes to their target location. Note +// that potential SVG bugs will have been handled before this fix. +// Note that this fix must only apply to the previous text node, as +// the base implementation of `insertHTMLBefore` already handles +// following text nodes correctly. +function domChanges$2(document,DOMChangesClass){if(!document)return DOMChangesClass;if(!shouldApplyFix$2(document)){return DOMChangesClass;}return (function(_DOMChangesClass3){babelHelpers.inherits(DOMChangesWithTextNodeMergingFix,_DOMChangesClass3);function DOMChangesWithTextNodeMergingFix(document){_DOMChangesClass3.call(this,document);this.uselessComment = document.createComment('');}DOMChangesWithTextNodeMergingFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent,nextSibling,html){if(html === null){return _DOMChangesClass3.prototype.insertHTMLBefore.call(this,parent,nextSibling,html);}var didSetUselessComment=false;var nextPrevious=nextSibling?nextSibling.previousSibling:parent.lastChild;if(nextPrevious && nextPrevious instanceof Text){didSetUselessComment = true;parent.insertBefore(this.uselessComment,nextSibling);}var bounds=_DOMChangesClass3.prototype.insertHTMLBefore.call(this,parent,nextSibling,html);if(didSetUselessComment){parent.removeChild(this.uselessComment);}return bounds;};return DOMChangesWithTextNodeMergingFix;})(DOMChangesClass);}function treeConstruction$2(document,TreeConstructionClass){if(!document)return TreeConstructionClass;if(!shouldApplyFix$2(document)){return TreeConstructionClass;}return (function(_TreeConstructionClass2){babelHelpers.inherits(TreeConstructionWithTextNodeMergingFix,_TreeConstructionClass2);function TreeConstructionWithTextNodeMergingFix(document){_TreeConstructionClass2.call(this,document);this.uselessComment = this.createComment('');}TreeConstructionWithTextNodeMergingFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent,html,reference){if(html === null){return _TreeConstructionClass2.prototype.insertHTMLBefore.call(this,parent,html,reference);}var didSetUselessComment=false;var nextPrevious=reference?reference.previousSibling:parent.lastChild;if(nextPrevious && nextPrevious instanceof Text){didSetUselessComment = true;parent.insertBefore(this.uselessComment,reference);}var bounds=_TreeConstructionClass2.prototype.insertHTMLBefore.call(this,parent,html,reference);if(didSetUselessComment){parent.removeChild(this.uselessComment);}return bounds;};return TreeConstructionWithTextNodeMergingFix;})(TreeConstructionClass);}function shouldApplyFix$2(document){var mergingTextDiv=document.createElement('div');mergingTextDiv.innerHTML = 'first';mergingTextDiv.insertAdjacentHTML('beforeEnd','second');if(mergingTextDiv.childNodes.length === 2){ // It worked as expected, no fix required +return false;}return true;}var SVG_NAMESPACE='http://www.w3.org/2000/svg'; // http://www.w3.org/TR/html/syntax.html#html-integration-point +var SVG_INTEGRATION_POINTS={foreignObject:1,desc:1,title:1}; // http://www.w3.org/TR/html/syntax.html#adjust-svg-attributes +// TODO: Adjust SVG attributes +// http://www.w3.org/TR/html/syntax.html#parsing-main-inforeign +// TODO: Adjust SVG elements +// http://www.w3.org/TR/html/syntax.html#parsing-main-inforeign +var BLACKLIST_TABLE=Object.create(null);["b","big","blockquote","body","br","center","code","dd","div","dl","dt","em","embed","h1","h2","h3","h4","h5","h6","head","hr","i","img","li","listing","main","meta","nobr","ol","p","pre","ruby","s","small","span","strong","strike","sub","sup","table","tt","u","ul","var"].forEach(function(tag){return BLACKLIST_TABLE[tag] = 1;});var WHITESPACE=/[\t-\r \xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/;var doc=typeof document === 'undefined'?null:document;function isWhitespace(string){return WHITESPACE.test(string);}function moveNodesBefore(source,target,nextSibling){var first=source.firstChild;var last=null;var current=first;while(current) {last = current;current = current.nextSibling;target.insertBefore(last,nextSibling);}return [first,last];}var DOM;(function(DOM){var TreeConstruction=(function(){function TreeConstruction(document){this.document = document;this.setupUselessElement();}TreeConstruction.prototype.setupUselessElement = function setupUselessElement(){this.uselessElement = this.document.createElement('div');};TreeConstruction.prototype.createElement = function createElement(tag,context){var isElementInSVGNamespace=undefined,isHTMLIntegrationPoint=undefined;if(context){isElementInSVGNamespace = context.namespaceURI === SVG_NAMESPACE || tag === 'svg';isHTMLIntegrationPoint = SVG_INTEGRATION_POINTS[context.tagName];}else {isElementInSVGNamespace = tag === 'svg';isHTMLIntegrationPoint = false;}if(isElementInSVGNamespace && !isHTMLIntegrationPoint){ // FIXME: This does not properly handle with color, face, or +// size attributes, which is also disallowed by the spec. We should fix +// this. +if(BLACKLIST_TABLE[tag]){throw new Error('Cannot create a ' + tag + ' inside an SVG context');}return this.document.createElementNS(SVG_NAMESPACE,tag);}else {return this.document.createElement(tag);}};TreeConstruction.prototype.createElementNS = function createElementNS(namespace,tag){return this.document.createElementNS(namespace,tag);};TreeConstruction.prototype.setAttribute = function setAttribute(element,name,value,namespace){if(namespace){element.setAttributeNS(namespace,name,value);}else {element.setAttribute(name,value);}};TreeConstruction.prototype.createTextNode = function createTextNode(text){return this.document.createTextNode(text);};TreeConstruction.prototype.createComment = function createComment(data){return this.document.createComment(data);};TreeConstruction.prototype.insertBefore = function insertBefore(parent,node,reference){parent.insertBefore(node,reference);};TreeConstruction.prototype.insertHTMLBefore = function insertHTMLBefore(parent,html,reference){return _insertHTMLBefore(this.uselessElement,parent,reference,html);};return TreeConstruction;})();DOM.TreeConstruction = TreeConstruction;var appliedTreeContruction=TreeConstruction;appliedTreeContruction = treeConstruction$2(doc,appliedTreeContruction);appliedTreeContruction = treeConstruction(doc,appliedTreeContruction);appliedTreeContruction = treeConstruction$1(doc,appliedTreeContruction,SVG_NAMESPACE);DOM.DOMTreeConstruction = appliedTreeContruction;})(DOM || (DOM = {}));var DOMChanges=(function(){function DOMChanges(document){this.document = document;this.namespace = null;this.uselessElement = this.document.createElement('div');}DOMChanges.prototype.setAttribute = function setAttribute(element,name,value){element.setAttribute(name,value);};DOMChanges.prototype.setAttributeNS = function setAttributeNS(element,namespace,name,value){element.setAttributeNS(namespace,name,value);};DOMChanges.prototype.removeAttribute = function removeAttribute(element,name){element.removeAttribute(name);};DOMChanges.prototype.removeAttributeNS = function removeAttributeNS(element,namespace,name){element.removeAttributeNS(namespace,name);};DOMChanges.prototype.createTextNode = function createTextNode(text){return this.document.createTextNode(text);};DOMChanges.prototype.createComment = function createComment(data){return this.document.createComment(data);};DOMChanges.prototype.createElement = function createElement(tag,context){var isElementInSVGNamespace=undefined,isHTMLIntegrationPoint=undefined;if(context){isElementInSVGNamespace = context.namespaceURI === SVG_NAMESPACE || tag === 'svg';isHTMLIntegrationPoint = SVG_INTEGRATION_POINTS[context.tagName];}else {isElementInSVGNamespace = tag === 'svg';isHTMLIntegrationPoint = false;}if(isElementInSVGNamespace && !isHTMLIntegrationPoint){ // FIXME: This does not properly handle with color, face, or +// size attributes, which is also disallowed by the spec. We should fix +// this. +if(BLACKLIST_TABLE[tag]){throw new Error('Cannot create a ' + tag + ' inside an SVG context');}return this.document.createElementNS(SVG_NAMESPACE,tag);}else {return this.document.createElement(tag);}};DOMChanges.prototype.insertHTMLBefore = function insertHTMLBefore(_parent,nextSibling,html){return _insertHTMLBefore(this.uselessElement,_parent,nextSibling,html);};DOMChanges.prototype.insertNodeBefore = function insertNodeBefore(parent,node,reference){if(isDocumentFragment(node)){var firstChild=node.firstChild;var lastChild=node.lastChild;this.insertBefore(parent,node,reference);return new ConcreteBounds(parent,firstChild,lastChild);}else {this.insertBefore(parent,node,reference);return new SingleNodeBounds(parent,node);}};DOMChanges.prototype.insertTextBefore = function insertTextBefore(parent,nextSibling,text){var textNode=this.createTextNode(text);this.insertBefore(parent,textNode,nextSibling);return textNode;};DOMChanges.prototype.insertBefore = function insertBefore(element,node,reference){element.insertBefore(node,reference);};DOMChanges.prototype.insertAfter = function insertAfter(element,node,reference){this.insertBefore(element,node,reference.nextSibling);};return DOMChanges;})();function _insertHTMLBefore(_useless,_parent,_nextSibling,html){ // TypeScript vendored an old version of the DOM spec where `insertAdjacentHTML` +// only exists on `HTMLElement` but not on `Element`. We actually work with the +// newer version of the DOM API here (and monkey-patch this method in `./compat` +// when we detect older browsers). This is a hack to work around this limitation. +var parent=_parent;var useless=_useless;var nextSibling=_nextSibling;var prev=nextSibling?nextSibling.previousSibling:parent.lastChild;var last=undefined;if(html === null || html === ''){return new ConcreteBounds(parent,null,null);}if(nextSibling === null){parent.insertAdjacentHTML('beforeEnd',html);last = parent.lastChild;}else if(nextSibling instanceof HTMLElement){nextSibling.insertAdjacentHTML('beforeBegin',html);last = nextSibling.previousSibling;}else { // Non-element nodes do not support insertAdjacentHTML, so add an +// element and call it on that element. Then remove the element. +// +// This also protects Edge, IE and Firefox w/o the inspector open +// from merging adjacent text nodes. See ./compat/text-node-merging-fix.ts +parent.insertBefore(useless,nextSibling);useless.insertAdjacentHTML('beforeBegin',html);last = useless.previousSibling;parent.removeChild(useless);}var first=prev?prev.nextSibling:parent.firstChild;return new ConcreteBounds(parent,first,last);}function isDocumentFragment(node){return node.nodeType === Node.DOCUMENT_FRAGMENT_NODE;}var helper=DOMChanges;helper = domChanges$2(doc,helper);helper = domChanges(doc,helper);helper = domChanges$1(doc,helper,SVG_NAMESPACE);var helper$1=helper;var DOMTreeConstruction=DOM.DOMTreeConstruction;function defaultManagers(element,attr,_isTrusting,_namespace){var tagName=element.tagName;var isSVG=element.namespaceURI === SVG_NAMESPACE;if(isSVG){return defaultAttributeManagers(tagName,attr);}var _normalizeProperty=normalizeProperty(element,attr);var type=_normalizeProperty.type;var normalized=_normalizeProperty.normalized;if(type === 'attr'){return defaultAttributeManagers(tagName,normalized);}else {return defaultPropertyManagers(tagName,normalized);}}function defaultPropertyManagers(tagName,attr){if(requiresSanitization(tagName,attr)){return new SafePropertyManager(attr);}if(isUserInputValue(tagName,attr)){return INPUT_VALUE_PROPERTY_MANAGER;}if(isOptionSelected(tagName,attr)){return OPTION_SELECTED_MANAGER;}return new PropertyManager(attr);}function defaultAttributeManagers(tagName,attr){if(requiresSanitization(tagName,attr)){return new SafeAttributeManager(attr);}return new AttributeManager(attr);}function readDOMAttr(element,attr){var isSVG=element.namespaceURI === SVG_NAMESPACE;var _normalizeProperty2=normalizeProperty(element,attr);var type=_normalizeProperty2.type;var normalized=_normalizeProperty2.normalized;if(isSVG){return element.getAttribute(normalized);}if(type === 'attr'){return element.getAttribute(normalized);}{return element[normalized];}};var AttributeManager=(function(){function AttributeManager(attr){this.attr = attr;}AttributeManager.prototype.setAttribute = function setAttribute(env,element,value,namespace){var dom=env.getAppendOperations();var normalizedValue=normalizeAttributeValue(value);if(!isAttrRemovalValue(normalizedValue)){dom.setAttribute(element,this.attr,normalizedValue,namespace);}};AttributeManager.prototype.updateAttribute = function updateAttribute(env,element,value,namespace){if(value === null || value === undefined || value === false){if(namespace){env.getDOM().removeAttributeNS(element,namespace,this.attr);}else {env.getDOM().removeAttribute(element,this.attr);}}else {this.setAttribute(env,element,value);}};return AttributeManager;})();;var PropertyManager=(function(_AttributeManager){babelHelpers.inherits(PropertyManager,_AttributeManager);function PropertyManager(){_AttributeManager.apply(this,arguments);}PropertyManager.prototype.setAttribute = function setAttribute(_env,element,value,_namespace){if(!isAttrRemovalValue(value)){element[this.attr] = value;}};PropertyManager.prototype.removeAttribute = function removeAttribute(env,element,namespace){ // TODO this sucks but to preserve properties first and to meet current +// semantics we must do this. +var attr=this.attr;if(namespace){env.getDOM().removeAttributeNS(element,namespace,attr);}else {env.getDOM().removeAttribute(element,attr);}};PropertyManager.prototype.updateAttribute = function updateAttribute(env,element,value,namespace){ // ensure the property is always updated +element[this.attr] = value;if(isAttrRemovalValue(value)){this.removeAttribute(env,element,namespace);}};return PropertyManager;})(AttributeManager);;function normalizeAttributeValue(value){if(value === false || value === undefined || value === null){return null;}if(value === true){return '';} // onclick function etc in SSR +if(typeof value === 'function'){return null;}return String(value);}function isAttrRemovalValue(value){return value === null || value === undefined;}var SafePropertyManager=(function(_PropertyManager){babelHelpers.inherits(SafePropertyManager,_PropertyManager);function SafePropertyManager(){_PropertyManager.apply(this,arguments);}SafePropertyManager.prototype.setAttribute = function setAttribute(env,element,value){_PropertyManager.prototype.setAttribute.call(this,env,element,sanitizeAttributeValue(env,element,this.attr,value));};SafePropertyManager.prototype.updateAttribute = function updateAttribute(env,element,value){_PropertyManager.prototype.updateAttribute.call(this,env,element,sanitizeAttributeValue(env,element,this.attr,value));};return SafePropertyManager;})(PropertyManager);function isUserInputValue(tagName,attribute){return (tagName === 'INPUT' || tagName === 'TEXTAREA') && attribute === 'value';}var InputValuePropertyManager=(function(_AttributeManager2){babelHelpers.inherits(InputValuePropertyManager,_AttributeManager2);function InputValuePropertyManager(){_AttributeManager2.apply(this,arguments);}InputValuePropertyManager.prototype.setAttribute = function setAttribute(_env,element,value){var input=element;input.value = normalizeTextValue(value);};InputValuePropertyManager.prototype.updateAttribute = function updateAttribute(_env,element,value){var input=element;var currentValue=input.value;var normalizedValue=normalizeTextValue(value);if(currentValue !== normalizedValue){input.value = normalizedValue;}};return InputValuePropertyManager;})(AttributeManager);var INPUT_VALUE_PROPERTY_MANAGER=new InputValuePropertyManager('value');function isOptionSelected(tagName,attribute){return tagName === 'OPTION' && attribute === 'selected';}var OptionSelectedManager=(function(_PropertyManager2){babelHelpers.inherits(OptionSelectedManager,_PropertyManager2);function OptionSelectedManager(){_PropertyManager2.apply(this,arguments);}OptionSelectedManager.prototype.setAttribute = function setAttribute(_env,element,value){if(value !== null && value !== undefined && value !== false){var option=element;option.selected = true;}};OptionSelectedManager.prototype.updateAttribute = function updateAttribute(_env,element,value){var option=element;if(value){option.selected = true;}else {option.selected = false;}};return OptionSelectedManager;})(PropertyManager);var OPTION_SELECTED_MANAGER=new OptionSelectedManager('selected');var SafeAttributeManager=(function(_AttributeManager3){babelHelpers.inherits(SafeAttributeManager,_AttributeManager3);function SafeAttributeManager(){_AttributeManager3.apply(this,arguments);}SafeAttributeManager.prototype.setAttribute = function setAttribute(env,element,value){_AttributeManager3.prototype.setAttribute.call(this,env,element,sanitizeAttributeValue(env,element,this.attr,value));};SafeAttributeManager.prototype.updateAttribute = function updateAttribute(env,element,value,_namespace){_AttributeManager3.prototype.updateAttribute.call(this,env,element,sanitizeAttributeValue(env,element,this.attr,value));};return SafeAttributeManager;})(AttributeManager);var Scope=(function(){function Scope(references){var callerScope=arguments.length <= 1 || arguments[1] === undefined?null:arguments[1];this.callerScope = null;this.slots = references;this.callerScope = callerScope;}Scope.root = function root(self){var size=arguments.length <= 1 || arguments[1] === undefined?0:arguments[1];var refs=new Array(size + 1);for(var i=0;i <= size;i++) {refs[i] = UNDEFINED_REFERENCE;}return new Scope(refs).init({self:self});};Scope.prototype.init = function init(_ref26){var self=_ref26.self;this.slots[0] = self;return this;};Scope.prototype.getSelf = function getSelf(){return this.slots[0];};Scope.prototype.getSymbol = function getSymbol(symbol){return this.slots[symbol];};Scope.prototype.getBlock = function getBlock(symbol){return this.slots[symbol];};Scope.prototype.getPartialArgs = function getPartialArgs(symbol){return this.slots[symbol];};Scope.prototype.bindSymbol = function bindSymbol(symbol,value){this.slots[symbol] = value;};Scope.prototype.bindBlock = function bindBlock(symbol,value){this.slots[symbol] = value;};Scope.prototype.bindPartialArgs = function bindPartialArgs(symbol,value){this.slots[symbol] = value;};Scope.prototype.bindCallerScope = function bindCallerScope(scope){this.callerScope = scope;};Scope.prototype.getCallerScope = function getCallerScope(){return this.callerScope;};Scope.prototype.child = function child(){return new Scope(this.slots.slice(),this.callerScope);};return Scope;})();var Transaction=(function(){function Transaction(){this.scheduledInstallManagers = [];this.scheduledInstallModifiers = [];this.scheduledUpdateModifierManagers = [];this.scheduledUpdateModifiers = [];this.createdComponents = [];this.createdManagers = [];this.updatedComponents = [];this.updatedManagers = [];this.destructors = [];}Transaction.prototype.didCreate = function didCreate(component,manager){this.createdComponents.push(component);this.createdManagers.push(manager);};Transaction.prototype.didUpdate = function didUpdate(component,manager){this.updatedComponents.push(component);this.updatedManagers.push(manager);};Transaction.prototype.scheduleInstallModifier = function scheduleInstallModifier(modifier,manager){this.scheduledInstallManagers.push(manager);this.scheduledInstallModifiers.push(modifier);};Transaction.prototype.scheduleUpdateModifier = function scheduleUpdateModifier(modifier,manager){this.scheduledUpdateModifierManagers.push(manager);this.scheduledUpdateModifiers.push(modifier);};Transaction.prototype.didDestroy = function didDestroy(d){this.destructors.push(d);};Transaction.prototype.commit = function commit(){var createdComponents=this.createdComponents;var createdManagers=this.createdManagers;for(var i=0;i < createdComponents.length;i++) {var component=createdComponents[i];var manager=createdManagers[i];manager.didCreate(component);}var updatedComponents=this.updatedComponents;var updatedManagers=this.updatedManagers;for(var i=0;i < updatedComponents.length;i++) {var component=updatedComponents[i];var manager=updatedManagers[i];manager.didUpdate(component);}var destructors=this.destructors;for(var i=0;i < destructors.length;i++) {destructors[i].destroy();}var scheduledInstallManagers=this.scheduledInstallManagers;var scheduledInstallModifiers=this.scheduledInstallModifiers;for(var i=0;i < scheduledInstallManagers.length;i++) {var manager=scheduledInstallManagers[i];var modifier=scheduledInstallModifiers[i];manager.install(modifier);}var scheduledUpdateModifierManagers=this.scheduledUpdateModifierManagers;var scheduledUpdateModifiers=this.scheduledUpdateModifiers;for(var i=0;i < scheduledUpdateModifierManagers.length;i++) {var manager=scheduledUpdateModifierManagers[i];var modifier=scheduledUpdateModifiers[i];manager.update(modifier);}};return Transaction;})();var Opcode=(function(){function Opcode(array){this.array = array;this.offset = 0;}babelHelpers.createClass(Opcode,[{key:'type',get:function(){return this.array[this.offset];}},{key:'op1',get:function(){return this.array[this.offset + 1];}},{key:'op2',get:function(){return this.array[this.offset + 2];}},{key:'op3',get:function(){return this.array[this.offset + 3];}}]);return Opcode;})();var Program=(function(){function Program(){this.opcodes = new _glimmerUtil.A(0x100000);this._offset = 0;this._opcode = new Opcode(this.opcodes);}Program.prototype.opcode = function opcode(offset){this._opcode.offset = offset;return this._opcode;};Program.prototype.set = function set(pos,opcode){var type=opcode[0];var op1=opcode[1];var op2=opcode[2];var op3=opcode[3];this.opcodes[pos] = type;this.opcodes[pos + 1] = op1;this.opcodes[pos + 2] = op2;this.opcodes[pos + 3] = op3;};Program.prototype.push = function push(opcode){var offset=this._offset;var type=opcode[0];var op1=opcode[1];var op2=opcode[2];var op3=opcode[3];this.opcodes[this._offset++] = type;this.opcodes[this._offset++] = op1;this.opcodes[this._offset++] = op2;this.opcodes[this._offset++] = op3;return offset;};babelHelpers.createClass(Program,[{key:'next',get:function(){return this._offset;}},{key:'current',get:function(){return this._offset - 4;}}]);return Program;})();var Environment=(function(){function Environment(_ref27){var appendOperations=_ref27.appendOperations;var updateOperations=_ref27.updateOperations;this._macros = null;this._transaction = null;this.constants = new Constants();this.program = new Program();this.appendOperations = appendOperations;this.updateOperations = updateOperations;}Environment.prototype.toConditionalReference = function toConditionalReference(reference){return new ConditionalReference(reference);};Environment.prototype.getAppendOperations = function getAppendOperations(){return this.appendOperations;};Environment.prototype.getDOM = function getDOM(){return this.updateOperations;};Environment.prototype.getIdentity = function getIdentity(object){return _glimmerUtil.ensureGuid(object) + '';};Environment.prototype.begin = function begin(){_glimmerUtil.assert(!this._transaction,'Cannot start a nested transaction');this._transaction = new Transaction();};Environment.prototype.didCreate = function didCreate(component,manager){this.transaction.didCreate(component,manager);};Environment.prototype.didUpdate = function didUpdate(component,manager){this.transaction.didUpdate(component,manager);};Environment.prototype.scheduleInstallModifier = function scheduleInstallModifier(modifier,manager){this.transaction.scheduleInstallModifier(modifier,manager);};Environment.prototype.scheduleUpdateModifier = function scheduleUpdateModifier(modifier,manager){this.transaction.scheduleUpdateModifier(modifier,manager);};Environment.prototype.didDestroy = function didDestroy(d){this.transaction.didDestroy(d);};Environment.prototype.commit = function commit(){this.transaction.commit();this._transaction = null;};Environment.prototype.attributeFor = function attributeFor(element,attr,isTrusting,namespace){return defaultManagers(element,attr,isTrusting,namespace === undefined?null:namespace);};Environment.prototype.macros = function macros(){var macros=this._macros;if(!macros){this._macros = macros = populateBuiltins();}return macros;};babelHelpers.createClass(Environment,[{key:'transaction',get:function(){return _glimmerUtil.expect(this._transaction,'must be in a transaction');}}]);return Environment;})();var RenderResult=(function(){function RenderResult(env,updating,bounds){this.env = env;this.updating = updating;this.bounds = bounds;}RenderResult.prototype.rerender = function rerender(){var _ref28=arguments.length <= 0 || arguments[0] === undefined?{alwaysRevalidate:false}:arguments[0];var _ref28$alwaysRevalidate=_ref28.alwaysRevalidate;var alwaysRevalidate=_ref28$alwaysRevalidate === undefined?false:_ref28$alwaysRevalidate;var env=this.env;var updating=this.updating;var vm=new UpdatingVM(env,{alwaysRevalidate:alwaysRevalidate});vm.execute(updating,this);};RenderResult.prototype.parentElement = function parentElement(){return this.bounds.parentElement();};RenderResult.prototype.firstNode = function firstNode(){return this.bounds.firstNode();};RenderResult.prototype.lastNode = function lastNode(){return this.bounds.lastNode();};RenderResult.prototype.opcodes = function opcodes(){return this.updating;};RenderResult.prototype.handleException = function handleException(){throw "this should never happen";};RenderResult.prototype.destroy = function destroy(){this.bounds.destroy();clear(this.bounds);};return RenderResult;})();var CapturedFrame=function CapturedFrame(operand,args,condition){this.operand = operand;this.args = args;this.condition = condition;};var Frame=(function(){function Frame(ops){var component=arguments.length <= 1 || arguments[1] === undefined?null:arguments[1];var manager=arguments.length <= 2 || arguments[2] === undefined?null:arguments[2];var shadow=arguments.length <= 3 || arguments[3] === undefined?null:arguments[3];this.ops = ops;this.component = component;this.manager = manager;this.shadow = shadow;this.operand = null;this.immediate = null;this.args = null;this.callerScope = null;this.blocks = null;this.condition = null;this.iterator = null;this.key = null;this.ip = ops[0];}Frame.prototype.capture = function capture(){return new CapturedFrame(this.operand,this.args,this.condition);};Frame.prototype.restore = function restore(frame){this.operand = frame['operand'];this.args = frame['args'];this.condition = frame['condition'];};return Frame;})();var FrameStack=(function(){function FrameStack(){this.frames = [];this.frame = null;}FrameStack.prototype.push = function push(ops){var component=arguments.length <= 1 || arguments[1] === undefined?null:arguments[1];var manager=arguments.length <= 2 || arguments[2] === undefined?null:arguments[2];var shadow=arguments.length <= 3 || arguments[3] === undefined?null:arguments[3];var frame=this.frame === null?this.frame = 0:++this.frame;if(this.frames.length <= frame){this.frames.push(null);}this.frames[frame] = new Frame(ops,component,manager,shadow);};FrameStack.prototype.pop = function pop(){var frames=this.frames;var frame=this.frame;frames[_glimmerUtil.expect(frame,'only pop after pushing')] = null;this.frame = frame === 0?null:frame - 1;};FrameStack.prototype.capture = function capture(){return this.currentFrame.capture();};FrameStack.prototype.restore = function restore(frame){this.currentFrame.restore(frame);};FrameStack.prototype.getOps = function getOps(){return this.currentFrame.ops;};FrameStack.prototype.getCurrent = function getCurrent(){return this.currentFrame.ip;};FrameStack.prototype.setCurrent = function setCurrent(ip){return this.currentFrame.ip = ip;};FrameStack.prototype.getOperand = function getOperand(){return _glimmerUtil.unwrap(this.currentFrame.operand);};FrameStack.prototype.setOperand = function setOperand(operand){return this.currentFrame.operand = operand;};FrameStack.prototype.getImmediate = function getImmediate(){return this.currentFrame.immediate;};FrameStack.prototype.setImmediate = function setImmediate(value){return this.currentFrame.immediate = value;}; // FIXME: These options are required in practice by the existing code, but +// figure out why. +FrameStack.prototype.getArgs = function getArgs(){return this.currentFrame.args;};FrameStack.prototype.setArgs = function setArgs(args){return this.currentFrame.args = args;};FrameStack.prototype.getCondition = function getCondition(){return _glimmerUtil.unwrap(this.currentFrame.condition);};FrameStack.prototype.setCondition = function setCondition(condition){return this.currentFrame.condition = condition;};FrameStack.prototype.getIterator = function getIterator(){return _glimmerUtil.unwrap(this.currentFrame.iterator);};FrameStack.prototype.setIterator = function setIterator(iterator){return this.currentFrame.iterator = iterator;};FrameStack.prototype.getKey = function getKey(){return this.currentFrame.key;};FrameStack.prototype.setKey = function setKey(key){return this.currentFrame.key = key;};FrameStack.prototype.getBlocks = function getBlocks(){return _glimmerUtil.unwrap(this.currentFrame.blocks);};FrameStack.prototype.setBlocks = function setBlocks(blocks){return this.currentFrame.blocks = blocks;};FrameStack.prototype.getCallerScope = function getCallerScope(){return _glimmerUtil.unwrap(this.currentFrame.callerScope);};FrameStack.prototype.setCallerScope = function setCallerScope(callerScope){return this.currentFrame.callerScope = callerScope;};FrameStack.prototype.getComponent = function getComponent(){return _glimmerUtil.unwrap(this.currentFrame.component);};FrameStack.prototype.getManager = function getManager(){return _glimmerUtil.unwrap(this.currentFrame.manager);};FrameStack.prototype.getShadow = function getShadow(){return this.currentFrame.shadow;};FrameStack.prototype.goto = function goto(ip){this.setCurrent(ip);};FrameStack.prototype.hasOpcodes = function hasOpcodes(){return this.frame !== null;};FrameStack.prototype.nextStatement = function nextStatement(env){var ip=this.frames[_glimmerUtil.unwrap(this.frame)].ip;var ops=this.getOps();if(ip <= ops[1]){var program=env.program;this.setCurrent(ip + 4);return program.opcode(ip);}else {this.pop();return null;}};babelHelpers.createClass(FrameStack,[{key:'currentFrame',get:function(){return this.frames[_glimmerUtil.unwrap(this.frame)];}}]);return FrameStack;})();var VM=(function(){function VM(env,scope,dynamicScope,elementStack){this.env = env;this.elementStack = elementStack;this.dynamicScopeStack = new _glimmerUtil.Stack();this.scopeStack = new _glimmerUtil.Stack();this.updatingOpcodeStack = new _glimmerUtil.Stack();this.cacheGroups = new _glimmerUtil.Stack();this.listBlockStack = new _glimmerUtil.Stack();this.frame = new FrameStack();this.env = env;this.constants = env.constants;this.elementStack = elementStack;this.scopeStack.push(scope);this.dynamicScopeStack.push(dynamicScope);}VM.initial = function initial(env,self,dynamicScope,elementStack,size){var scope=Scope.root(self,size);return new VM(env,scope,dynamicScope,elementStack);};VM.prototype.capture = function capture(){return {env:this.env,scope:this.scope(),dynamicScope:this.dynamicScope(),frame:this.frame.capture()};};VM.prototype.goto = function goto(ip){ // assert(this.frame.getOps().contains(op), `Illegal jump to ${op.label}`); +this.frame.goto(ip);};VM.prototype.beginCacheGroup = function beginCacheGroup(){this.cacheGroups.push(this.updating().tail());};VM.prototype.commitCacheGroup = function commitCacheGroup(){ // JumpIfNotModified(END) +// (head) +// (....) +// (tail) +// DidModify +// END: Noop +var END=new LabelOpcode("END");var opcodes=this.updating();var marker=this.cacheGroups.pop();var head=marker?opcodes.nextNode(marker):opcodes.head();var tail=opcodes.tail();var tag=_glimmerReference.combineSlice(new _glimmerUtil.ListSlice(head,tail));var guard=new JumpIfNotModifiedOpcode(tag,END);opcodes.insertBefore(guard,head);opcodes.append(new DidModifyOpcode(guard));opcodes.append(END);};VM.prototype.enter = function enter(sliceId){var updating=new _glimmerUtil.LinkedList();var tracker=this.stack().pushUpdatableBlock();var state=this.capture();var slice=this.constants.getSlice(sliceId);var tryOpcode=new TryOpcode(slice,state,tracker,updating);this.didEnter(tryOpcode,updating);};VM.prototype.enterWithKey = function enterWithKey(key,ops){var updating=new _glimmerUtil.LinkedList();var tracker=this.stack().pushUpdatableBlock();var state=this.capture();var tryOpcode=new TryOpcode(ops,state,tracker,updating);this.listBlock().map[key] = tryOpcode;this.didEnter(tryOpcode,updating);};VM.prototype.enterList = function enterList(ops){var updating=new _glimmerUtil.LinkedList();var tracker=this.stack().pushBlockList(updating);var state=this.capture();var artifacts=this.frame.getIterator().artifacts;var opcode=new ListBlockOpcode(ops,state,tracker,updating,artifacts);this.listBlockStack.push(opcode);this.didEnter(opcode,updating);};VM.prototype.didEnter = function didEnter(opcode,updating){this.updateWith(opcode);this.updatingOpcodeStack.push(updating);};VM.prototype.exit = function exit(){this.stack().popBlock();this.updatingOpcodeStack.pop();var parent=this.updating().tail();parent.didInitializeChildren();};VM.prototype.exitList = function exitList(){this.exit();this.listBlockStack.pop();};VM.prototype.updateWith = function updateWith(opcode){this.updating().append(opcode);};VM.prototype.listBlock = function listBlock(){return _glimmerUtil.expect(this.listBlockStack.current,'expected a list block');};VM.prototype.updating = function updating(){return _glimmerUtil.expect(this.updatingOpcodeStack.current,'expected updating opcode on the updating opcode stack');};VM.prototype.stack = function stack(){return this.elementStack;};VM.prototype.scope = function scope(){return _glimmerUtil.expect(this.scopeStack.current,'expected scope on the scope stack');};VM.prototype.dynamicScope = function dynamicScope(){return _glimmerUtil.expect(this.dynamicScopeStack.current,'expected dynamic scope on the dynamic scope stack');};VM.prototype.pushFrame = function pushFrame(block,args,callerScope){this.frame.push(block.slice);if(args)this.frame.setArgs(args);if(args && args.blocks)this.frame.setBlocks(args.blocks);if(callerScope)this.frame.setCallerScope(callerScope);};VM.prototype.pushComponentFrame = function pushComponentFrame(layout,args,callerScope,component,manager,shadow){this.frame.push(layout.slice,component,manager,shadow);if(args)this.frame.setArgs(args);if(args && args.blocks)this.frame.setBlocks(args.blocks);if(callerScope)this.frame.setCallerScope(callerScope);};VM.prototype.pushEvalFrame = function pushEvalFrame(slice){this.frame.push(slice);};VM.prototype.pushChildScope = function pushChildScope(){this.scopeStack.push(this.scope().child());};VM.prototype.pushCallerScope = function pushCallerScope(){this.scopeStack.push(_glimmerUtil.expect(this.scope().getCallerScope(),'pushCallerScope is called when a caller scope is present'));};VM.prototype.pushDynamicScope = function pushDynamicScope(){var child=this.dynamicScope().child();this.dynamicScopeStack.push(child);return child;};VM.prototype.pushRootScope = function pushRootScope(self,size){var scope=Scope.root(self,size);this.scopeStack.push(scope);return scope;};VM.prototype.popScope = function popScope(){this.scopeStack.pop();};VM.prototype.popDynamicScope = function popDynamicScope(){this.dynamicScopeStack.pop();};VM.prototype.newDestroyable = function newDestroyable(d){this.stack().newDestroyable(d);}; /// SCOPE HELPERS +VM.prototype.getSelf = function getSelf(){return this.scope().getSelf();};VM.prototype.referenceForSymbol = function referenceForSymbol(symbol){return this.scope().getSymbol(symbol);};VM.prototype.getArgs = function getArgs(){return this.frame.getArgs();}; /// EXECUTION +VM.prototype.resume = function resume(opcodes,frame){return this.execute(opcodes,function(vm){return vm.frame.restore(frame);});};VM.prototype.execute = function execute(opcodes,initialize){_glimmerUtil.LOGGER.debug("[VM] Begin program execution");var elementStack=this.elementStack;var frame=this.frame;var updatingOpcodeStack=this.updatingOpcodeStack;var env=this.env;elementStack.pushSimpleBlock();updatingOpcodeStack.push(new _glimmerUtil.LinkedList());frame.push(opcodes);if(initialize)initialize(this);var opcode=undefined;while(frame.hasOpcodes()) {if(opcode = frame.nextStatement(this.env)){_glimmerUtil.LOGGER.trace(opcode);APPEND_OPCODES.evaluate(this,opcode);}}_glimmerUtil.LOGGER.debug("[VM] Completed program execution");return new RenderResult(env,_glimmerUtil.expect(updatingOpcodeStack.pop(),'there should be a final updating opcode stack'),elementStack.popBlock());};VM.prototype.evaluateOpcode = function evaluateOpcode(opcode){APPEND_OPCODES.evaluate(this,opcode);}; // Make sure you have opcodes that push and pop a scope around this opcode +// if you need to change the scope. +VM.prototype.invokeBlock = function invokeBlock(block,args){var compiled=block.compile(this.env);this.pushFrame(compiled,args);};VM.prototype.invokePartial = function invokePartial(block){var compiled=block.compile(this.env);this.pushFrame(compiled);};VM.prototype.invokeLayout = function invokeLayout(args,layout,callerScope,component,manager,shadow){this.pushComponentFrame(layout,args,callerScope,component,manager,shadow);};VM.prototype.evaluateOperand = function evaluateOperand(expr){this.frame.setOperand(expr.evaluate(this));};VM.prototype.evaluateArgs = function evaluateArgs(args){var evaledArgs=this.frame.setArgs(args.evaluate(this));this.frame.setOperand(evaledArgs.positional.at(0));};VM.prototype.bindPositionalArgs = function bindPositionalArgs(symbols){var args=_glimmerUtil.expect(this.frame.getArgs(),'bindPositionalArgs assumes a previous setArgs');var positional=args.positional;var scope=this.scope();for(var i=0;i < symbols.length;i++) {scope.bindSymbol(symbols[i],positional.at(i));}};VM.prototype.bindNamedArgs = function bindNamedArgs(names,symbols){var args=_glimmerUtil.expect(this.frame.getArgs(),'bindNamedArgs assumes a previous setArgs');var scope=this.scope();var named=args.named;for(var i=0;i < names.length;i++) {var _name2=this.constants.getString(names[i]);scope.bindSymbol(symbols[i],named.get(_name2));}};VM.prototype.bindBlocks = function bindBlocks(names,symbols){var blocks=this.frame.getBlocks();var scope=this.scope();for(var i=0;i < names.length;i++) {var _name3=this.constants.getString(names[i]);scope.bindBlock(symbols[i],blocks && blocks[_name3] || null);}};VM.prototype.bindPartialArgs = function bindPartialArgs(symbol){var args=_glimmerUtil.expect(this.frame.getArgs(),'bindPartialArgs assumes a previous setArgs');var scope=this.scope();_glimmerUtil.assert(args,"Cannot bind named args");scope.bindPartialArgs(symbol,args);};VM.prototype.bindCallerScope = function bindCallerScope(){var callerScope=this.frame.getCallerScope();var scope=this.scope();_glimmerUtil.assert(callerScope,"Cannot bind caller scope");scope.bindCallerScope(callerScope);};VM.prototype.bindDynamicScope = function bindDynamicScope(names){var args=_glimmerUtil.expect(this.frame.getArgs(),'bindDynamicScope assumes a previous setArgs');var scope=this.dynamicScope();_glimmerUtil.assert(args,"Cannot bind dynamic scope");for(var i=0;i < names.length;i++) {var _name4=this.constants.getString(names[i]);scope.set(_name4,args.named.get(_name4));}};return VM;})();var UpdatingVM=(function(){function UpdatingVM(env,_ref29){var _ref29$alwaysRevalidate=_ref29.alwaysRevalidate;var alwaysRevalidate=_ref29$alwaysRevalidate === undefined?false:_ref29$alwaysRevalidate;this.frameStack = new _glimmerUtil.Stack();this.env = env;this.constants = env.constants;this.dom = env.getDOM();this.alwaysRevalidate = alwaysRevalidate;}UpdatingVM.prototype.execute = function execute(opcodes,handler){var frameStack=this.frameStack;this.try(opcodes,handler);while(true) {if(frameStack.isEmpty())break;var opcode=this.frame.nextStatement();if(opcode === null){this.frameStack.pop();continue;}_glimmerUtil.LOGGER.debug('[VM] OP ' + opcode.type);_glimmerUtil.LOGGER.trace(opcode);opcode.evaluate(this);}};UpdatingVM.prototype.goto = function goto(op){this.frame.goto(op);};UpdatingVM.prototype.try = function _try(ops,handler){this.frameStack.push(new UpdatingVMFrame(this,ops,handler));};UpdatingVM.prototype.throw = function _throw(){this.frame.handleException();this.frameStack.pop();};UpdatingVM.prototype.evaluateOpcode = function evaluateOpcode(opcode){opcode.evaluate(this);};babelHelpers.createClass(UpdatingVM,[{key:'frame',get:function(){return _glimmerUtil.expect(this.frameStack.current,'bug: expected a frame');}}]);return UpdatingVM;})();var BlockOpcode=(function(_UpdatingOpcode8){babelHelpers.inherits(BlockOpcode,_UpdatingOpcode8);function BlockOpcode(ops,state,bounds,children){_UpdatingOpcode8.call(this);this.ops = ops;this.type = "block";this.next = null;this.prev = null;var env=state.env;var scope=state.scope;var dynamicScope=state.dynamicScope;var frame=state.frame;this.children = children;this.env = env;this.scope = scope;this.dynamicScope = dynamicScope;this.frame = frame;this.bounds = bounds;}BlockOpcode.prototype.parentElement = function parentElement(){return this.bounds.parentElement();};BlockOpcode.prototype.firstNode = function firstNode(){return this.bounds.firstNode();};BlockOpcode.prototype.lastNode = function lastNode(){return this.bounds.lastNode();};BlockOpcode.prototype.evaluate = function evaluate(vm){vm.try(this.children,null);};BlockOpcode.prototype.destroy = function destroy(){this.bounds.destroy();};BlockOpcode.prototype.didDestroy = function didDestroy(){this.env.didDestroy(this.bounds);};BlockOpcode.prototype.toJSON = function toJSON(){var details=_glimmerUtil.dict();details["guid"] = '' + this._guid;return {guid:this._guid,type:this.type,details:details,children:this.children.toArray().map(function(op){return op.toJSON();})};};return BlockOpcode;})(UpdatingOpcode);var TryOpcode=(function(_BlockOpcode){babelHelpers.inherits(TryOpcode,_BlockOpcode);function TryOpcode(ops,state,bounds,children){_BlockOpcode.call(this,ops,state,bounds,children);this.type = "try";this.tag = this._tag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG);}TryOpcode.prototype.didInitializeChildren = function didInitializeChildren(){this._tag.update(_glimmerReference.combineSlice(this.children));};TryOpcode.prototype.evaluate = function evaluate(vm){vm.try(this.children,this);};TryOpcode.prototype.handleException = function handleException(){var env=this.env;var scope=this.scope;var ops=this.ops;var dynamicScope=this.dynamicScope;var frame=this.frame;var elementStack=ElementStack.resume(this.env,this.bounds,this.bounds.reset(env));var vm=new VM(env,scope,dynamicScope,elementStack);var result=vm.resume(ops,frame);this.children = result.opcodes();this.didInitializeChildren();};TryOpcode.prototype.toJSON = function toJSON(){var json=_BlockOpcode.prototype.toJSON.call(this);var details=json["details"];if(!details){details = json["details"] = {};}return _BlockOpcode.prototype.toJSON.call(this);};return TryOpcode;})(BlockOpcode);var ListRevalidationDelegate=(function(){function ListRevalidationDelegate(opcode,marker){this.opcode = opcode;this.marker = marker;this.didInsert = false;this.didDelete = false;this.map = opcode.map;this.updating = opcode['children'];}ListRevalidationDelegate.prototype.insert = function insert(key,item,memo,before){var map=this.map;var opcode=this.opcode;var updating=this.updating;var nextSibling=null;var reference=null;if(before){reference = map[before];nextSibling = reference['bounds'].firstNode();}else {nextSibling = this.marker;}var vm=opcode.vmForInsertion(nextSibling);var tryOpcode=null;vm.execute(opcode.ops,function(vm){vm.frame.setArgs(EvaluatedArgs.positional([item,memo]));vm.frame.setOperand(item);vm.frame.setCondition(new _glimmerReference.ConstReference(true));vm.frame.setKey(key);var state=vm.capture();var tracker=vm.stack().pushUpdatableBlock();tryOpcode = new TryOpcode(opcode.ops,state,tracker,vm.updating());});tryOpcode.didInitializeChildren();updating.insertBefore(tryOpcode,reference);map[key] = tryOpcode;this.didInsert = true;};ListRevalidationDelegate.prototype.retain = function retain(_key,_item,_memo){};ListRevalidationDelegate.prototype.move = function move(key,_item,_memo,before){var map=this.map;var updating=this.updating;var entry=map[key];var reference=map[before] || null;if(before){moveBounds(entry,reference.firstNode());}else {moveBounds(entry,this.marker);}updating.remove(entry);updating.insertBefore(entry,reference);};ListRevalidationDelegate.prototype.delete = function _delete(key){var map=this.map;var opcode=map[key];opcode.didDestroy();clear(opcode);this.updating.remove(opcode);delete map[key];this.didDelete = true;};ListRevalidationDelegate.prototype.done = function done(){this.opcode.didInitializeChildren(this.didInsert || this.didDelete);};return ListRevalidationDelegate;})();var ListBlockOpcode=(function(_BlockOpcode2){babelHelpers.inherits(ListBlockOpcode,_BlockOpcode2);function ListBlockOpcode(ops,state,bounds,children,artifacts){_BlockOpcode2.call(this,ops,state,bounds,children);this.type = "list-block";this.map = _glimmerUtil.dict();this.lastIterated = _glimmerReference.INITIAL;this.artifacts = artifacts;var _tag=this._tag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG);this.tag = _glimmerReference.combine([artifacts.tag,_tag]);}ListBlockOpcode.prototype.didInitializeChildren = function didInitializeChildren(){var listDidChange=arguments.length <= 0 || arguments[0] === undefined?true:arguments[0];this.lastIterated = this.artifacts.tag.value();if(listDidChange){this._tag.update(_glimmerReference.combineSlice(this.children));}};ListBlockOpcode.prototype.evaluate = function evaluate(vm){var artifacts=this.artifacts;var lastIterated=this.lastIterated;if(!artifacts.tag.validate(lastIterated)){var bounds=this.bounds;var dom=vm.dom;var marker=dom.createComment('');dom.insertAfter(bounds.parentElement(),marker,_glimmerUtil.expect(bounds.lastNode(),"can't insert after an empty bounds"));var target=new ListRevalidationDelegate(this,marker);var synchronizer=new _glimmerReference.IteratorSynchronizer({target:target,artifacts:artifacts});synchronizer.sync();this.parentElement().removeChild(marker);} // Run now-updated updating opcodes +_BlockOpcode2.prototype.evaluate.call(this,vm);};ListBlockOpcode.prototype.vmForInsertion = function vmForInsertion(nextSibling){var env=this.env;var scope=this.scope;var dynamicScope=this.dynamicScope;var elementStack=ElementStack.forInitialRender(this.env,this.bounds.parentElement(),nextSibling);return new VM(env,scope,dynamicScope,elementStack);};ListBlockOpcode.prototype.toJSON = function toJSON(){var json=_BlockOpcode2.prototype.toJSON.call(this);var map=this.map;var inner=Object.keys(map).map(function(key){return JSON.stringify(key) + ': ' + map[key]._guid;}).join(", ");var details=json["details"];if(!details){details = json["details"] = {};}details["map"] = '{' + inner + '}';return json;};return ListBlockOpcode;})(BlockOpcode);var UpdatingVMFrame=(function(){function UpdatingVMFrame(vm,ops,exceptionHandler){this.vm = vm;this.ops = ops;this.exceptionHandler = exceptionHandler;this.vm = vm;this.ops = ops;this.current = ops.head();}UpdatingVMFrame.prototype.goto = function goto(op){this.current = op;};UpdatingVMFrame.prototype.nextStatement = function nextStatement(){var current=this.current;var ops=this.ops;if(current)this.current = ops.nextNode(current);return current;};UpdatingVMFrame.prototype.handleException = function handleException(){if(this.exceptionHandler){this.exceptionHandler.handleException();}};return UpdatingVMFrame;})();var CompiledBlock=function CompiledBlock(slice){this.start = slice[0];this.end = slice[1];this.slice = slice;};var CompiledProgram=(function(_CompiledBlock){babelHelpers.inherits(CompiledProgram,_CompiledBlock);function CompiledProgram(slice,symbols){_CompiledBlock.call(this,slice);this.symbols = symbols;}return CompiledProgram;})(CompiledBlock);function entryPoint(meta){return new ProgramSymbolTable(meta);}function layout(meta,wireNamed,wireYields,hasPartials){var _symbols3=symbols(wireNamed,wireYields,hasPartials);var named=_symbols3.named;var yields=_symbols3.yields;var partialSymbol=_symbols3.partialSymbol;var size=_symbols3.size;return new ProgramSymbolTable(meta,named,yields,partialSymbol,size);}function block(parent,locals){var localsMap=null;var program=parent['program'];if(locals.length !== 0){(function(){var map=localsMap = _glimmerUtil.dict();locals.forEach(function(l){return map[l] = program.size++;});})();}return new BlockSymbolTable(parent,program,localsMap);}function symbols(named,yields,hasPartials){var yieldsMap=null;var namedMap=null;var size=1;if(yields.length !== 0){(function(){var map=yieldsMap = _glimmerUtil.dict();yields.forEach(function(y){return map[y] = size++;});})();}if(named.length !== 0){(function(){var map=namedMap = _glimmerUtil.dict();named.forEach(function(y){return map[y] = size++;});})();}var partialSymbol=hasPartials?size++:null;return {named:namedMap,yields:yieldsMap,partialSymbol:partialSymbol,size:size};}var ProgramSymbolTable=(function(){function ProgramSymbolTable(meta){var named=arguments.length <= 1 || arguments[1] === undefined?null:arguments[1];var yields=arguments.length <= 2 || arguments[2] === undefined?null:arguments[2];var partialArgs=arguments.length <= 3 || arguments[3] === undefined?null:arguments[3];var size=arguments.length <= 4 || arguments[4] === undefined?1:arguments[4];this.meta = meta;this.named = named;this.yields = yields;this.partialArgs = partialArgs;this.size = size;this.program = this;}ProgramSymbolTable.prototype.getMeta = function getMeta(){return this.meta;};ProgramSymbolTable.prototype.getSymbols = function getSymbols(){return {named:this.named,yields:this.yields,locals:null,partialArgs:this.partialArgs};};ProgramSymbolTable.prototype.getSymbol = function getSymbol(kind,name){if(kind === 'local')return null;return this[kind] && this[kind][name];};ProgramSymbolTable.prototype.getPartialArgs = function getPartialArgs(){return this.partialArgs || 0;};return ProgramSymbolTable;})();var BlockSymbolTable=(function(){function BlockSymbolTable(parent,program,locals){this.parent = parent;this.program = program;this.locals = locals;}BlockSymbolTable.prototype.getMeta = function getMeta(){return this.program.getMeta();};BlockSymbolTable.prototype.getSymbols = function getSymbols(){return {named:null,yields:null,locals:this.locals,partialArgs:null};};BlockSymbolTable.prototype.getSymbol = function getSymbol(kind,name){if(kind === 'local'){return this.getLocal(name);}else {return this.program.getSymbol(kind,name);}};BlockSymbolTable.prototype.getLocal = function getLocal(name){var locals=this.locals;var parent=this.parent;var symbol=locals && locals[name];if(!symbol && parent){symbol = parent.getSymbol('local',name);}return symbol;};BlockSymbolTable.prototype.getPartialArgs = function getPartialArgs(){return this.program.getPartialArgs();};return BlockSymbolTable;})();var Specialize=(function(){function Specialize(){this.names = _glimmerUtil.dict();this.funcs = [];}Specialize.prototype.add = function add(name,func){this.funcs.push(func);this.names[name] = this.funcs.length - 1;};Specialize.prototype.specialize = function specialize(sexp,table){var name=sexp[0];var index=this.names[name];if(index === undefined)return sexp;var func=this.funcs[index];_glimmerUtil.assert(!!func,'expected a specialization for ' + sexp[0]);return func(sexp,table);};return Specialize;})();var SPECIALIZE=new Specialize();var E=_glimmerWireFormat.Expressions;SPECIALIZE.add('append',function(sexp,_symbolTable){var path=sexp[1];if(Array.isArray(path) && (E.isUnknown(path) || E.isGet(path))){if(path[1].length !== 1){return ['unoptimized-append',sexp[1],sexp[2]];}}return ['optimized-append',sexp[1],sexp[2]];});SPECIALIZE.add('dynamic-attr',function(sexp,_symbolTable){return ['any-dynamic-attr',sexp[1],sexp[2],sexp[3],false];});SPECIALIZE.add('trusting-attr',function(sexp,_symbolTable){return ['any-dynamic-attr',sexp[1],sexp[2],sexp[3],true];});SPECIALIZE.add('partial',function(sexp,_table){var expression=sexp[1];if(typeof expression === 'string'){return ['static-partial',expression];}else {return ['dynamic-partial',expression];}});function compileStatement(statement,builder){var refined=SPECIALIZE.specialize(statement,builder.symbolTable);STATEMENTS.compile(refined,builder);}var Template=function Template(statements,symbolTable){this.statements = statements;this.symbolTable = symbolTable;};var Layout=(function(_Template){babelHelpers.inherits(Layout,_Template);function Layout(){_Template.apply(this,arguments);}return Layout;})(Template);var EntryPoint=(function(_Template2){babelHelpers.inherits(EntryPoint,_Template2);function EntryPoint(){_Template2.apply(this,arguments);}EntryPoint.prototype.compile = function compile(env){var table=this.symbolTable;var b=builder(env,table);for(var i=0;i < this.statements.length;i++) {var statement=this.statements[i];var refined=SPECIALIZE.specialize(statement,table);STATEMENTS.compile(refined,b);}return new CompiledProgram(b.toSlice(),this.symbolTable.size);};return EntryPoint;})(Template);var InlineBlock=(function(_Template3){babelHelpers.inherits(InlineBlock,_Template3);function InlineBlock(){_Template3.apply(this,arguments);}InlineBlock.prototype.splat = function splat(builder){var table=builder.symbolTable;var locals=table.getSymbols().locals;if(locals){builder.pushChildScope();builder.bindPositionalArgsForLocals(locals);}for(var i=0;i < this.statements.length;i++) {var statement=this.statements[i];var refined=SPECIALIZE.specialize(statement,table);STATEMENTS.compile(refined,builder);}if(locals){builder.popScope();}};InlineBlock.prototype.compile = function compile(env){var table=this.symbolTable;var b=builder(env,table);this.splat(b);return new CompiledBlock(b.toSlice());};return InlineBlock;})(Template);var PartialBlock=(function(_Template4){babelHelpers.inherits(PartialBlock,_Template4);function PartialBlock(){_Template4.apply(this,arguments);}PartialBlock.prototype.compile = function compile(env){var table=this.symbolTable;var b=builder(env,table);for(var i=0;i < this.statements.length;i++) {var statement=this.statements[i];var refined=SPECIALIZE.specialize(statement,table);STATEMENTS.compile(refined,b);}return new CompiledProgram(b.toSlice(),table.size);};return PartialBlock;})(Template);var Scanner=(function(){function Scanner(block,meta,env){this.block = block;this.meta = meta;this.env = env;}Scanner.prototype.scanEntryPoint = function scanEntryPoint(){var block=this.block;var meta=this.meta;var symbolTable=entryPoint(meta);var child=scanBlock(block,symbolTable,this.env);return new EntryPoint(child.statements,symbolTable);};Scanner.prototype.scanLayout = function scanLayout(){var block=this.block;var meta=this.meta;var named=block.named;var yields=block.yields;var hasPartials=block.hasPartials;var symbolTable=layout(meta,named,yields,hasPartials);var child=scanBlock(block,symbolTable,this.env);return new Layout(child.statements,symbolTable);};Scanner.prototype.scanPartial = function scanPartial(symbolTable){var block=this.block;var child=scanBlock(block,symbolTable,this.env);return new PartialBlock(child.statements,symbolTable);};return Scanner;})();function scanBlock(_ref30,symbolTable,env){var statements=_ref30.statements;return new RawInlineBlock(env,symbolTable,statements).scan();}var BaselineSyntax;(function(BaselineSyntax){BaselineSyntax.isScannedComponent = _glimmerWireFormat.is('scanned-component');BaselineSyntax.isPrimitiveElement = _glimmerWireFormat.is('open-primitive-element');BaselineSyntax.isOptimizedAppend = _glimmerWireFormat.is('optimized-append');BaselineSyntax.isUnoptimizedAppend = _glimmerWireFormat.is('unoptimized-append');BaselineSyntax.isAnyAttr = _glimmerWireFormat.is('any-dynamic-attr');BaselineSyntax.isStaticPartial = _glimmerWireFormat.is('static-partial');BaselineSyntax.isDynamicPartial = _glimmerWireFormat.is('dynamic-partial');BaselineSyntax.isFunctionExpression = _glimmerWireFormat.is('function');BaselineSyntax.isNestedBlock = _glimmerWireFormat.is('nested-block');BaselineSyntax.isScannedBlock = _glimmerWireFormat.is('scanned-block');BaselineSyntax.isDebugger = _glimmerWireFormat.is('debugger');var NestedBlock;(function(NestedBlock){function defaultBlock(sexp){return sexp[4];}NestedBlock.defaultBlock = defaultBlock;function inverseBlock(sexp){return sexp[5];}NestedBlock.inverseBlock = inverseBlock;function params(sexp){return sexp[2];}NestedBlock.params = params;function hash(sexp){return sexp[3];}NestedBlock.hash = hash;})(NestedBlock = BaselineSyntax.NestedBlock || (BaselineSyntax.NestedBlock = {}));})(BaselineSyntax || (exports.BaselineSyntax = BaselineSyntax = {}));var RawInlineBlock=(function(){function RawInlineBlock(env,table,statements){this.env = env;this.table = table;this.statements = statements;}RawInlineBlock.prototype.scan = function scan(){var buffer=[];for(var i=0;i < this.statements.length;i++) {var statement=this.statements[i];if(_glimmerWireFormat.Statements.isBlock(statement)){buffer.push(this.specializeBlock(statement));}else if(_glimmerWireFormat.Statements.isComponent(statement)){buffer.push.apply(buffer,this.specializeComponent(statement));}else {buffer.push(statement);}}return new InlineBlock(buffer,this.table);};RawInlineBlock.prototype.specializeBlock = function specializeBlock(block$$){var path=block$$[1];var params=block$$[2];var hash=block$$[3];var template=block$$[4];var inverse=block$$[5];return ['scanned-block',path,params,hash,this.child(template),this.child(inverse)];};RawInlineBlock.prototype.specializeComponent = function specializeComponent(sexp){var tag=sexp[1];var component=sexp[2];if(this.env.hasComponentDefinition([tag],this.table)){var child=this.child(component);var attrs=new RawInlineBlock(this.env,this.table,component.attrs);return [['scanned-component',tag,attrs,component.args,child]];}else {var buf=[];buf.push(['open-element',tag,[]]);buf.push.apply(buf,component.attrs);buf.push(['flush-element']);buf.push.apply(buf,component.statements);buf.push(['close-element']);return buf;}};RawInlineBlock.prototype.child = function child(block$$){if(!block$$)return null;var table=block(this.table,block$$.locals);return new RawInlineBlock(this.env,table,block$$.statements);};return RawInlineBlock;})();function compileLayout(compilable,env){var builder=new ComponentLayoutBuilder(env);compilable.compile(builder);return builder.compile();}var ComponentLayoutBuilder=(function(){function ComponentLayoutBuilder(env){this.env = env;}ComponentLayoutBuilder.prototype.wrapLayout = function wrapLayout(layout){this.inner = new WrappedBuilder(this.env,layout);};ComponentLayoutBuilder.prototype.fromLayout = function fromLayout(layout){this.inner = new UnwrappedBuilder(this.env,layout);};ComponentLayoutBuilder.prototype.compile = function compile(){return this.inner.compile();};babelHelpers.createClass(ComponentLayoutBuilder,[{key:'tag',get:function(){return this.inner.tag;}},{key:'attrs',get:function(){return this.inner.attrs;}}]);return ComponentLayoutBuilder;})();var WrappedBuilder=(function(){function WrappedBuilder(env,layout){this.env = env;this.layout = layout;this.tag = new ComponentTagBuilder();this.attrs = new ComponentAttrsBuilder();}WrappedBuilder.prototype.compile = function compile(){ //========DYNAMIC +// PutValue(TagExpr) +// Test +// JumpUnless(BODY) +// OpenDynamicPrimitiveElement +// DidCreateElement +// ...attr statements... +// FlushElement +// BODY: Noop +// ...body statements... +// PutValue(TagExpr) +// Test +// JumpUnless(END) +// CloseElement +// END: Noop +// DidRenderLayout +// Exit +// +//========STATIC +// OpenPrimitiveElementOpcode +// DidCreateElement +// ...attr statements... +// FlushElement +// ...body statements... +// CloseElement +// DidRenderLayout +// Exit +var env=this.env;var layout=this.layout;var symbolTable=layout.symbolTable;var b=builder(env,layout.symbolTable);b.startLabels();var dynamicTag=this.tag.getDynamic();var staticTag=undefined;if(dynamicTag){b.putValue(dynamicTag);b.test('simple');b.jumpUnless('BODY');b.openDynamicPrimitiveElement();b.didCreateElement();this.attrs['buffer'].forEach(function(statement){return compileStatement(statement,b);});b.flushElement();b.label('BODY');}else if(staticTag = this.tag.getStatic()){b.openPrimitiveElement(staticTag);b.didCreateElement();this.attrs['buffer'].forEach(function(statement){return compileStatement(statement,b);});b.flushElement();}b.preludeForLayout(layout);layout.statements.forEach(function(statement){return compileStatement(statement,b);});if(dynamicTag){b.putValue(dynamicTag);b.test('simple');b.jumpUnless('END');b.closeElement();b.label('END');}else if(staticTag){b.closeElement();}b.didRenderLayout();b.stopLabels();return new CompiledProgram(b.toSlice(),symbolTable.size);};return WrappedBuilder;})();function isOpenElement(value){var type=value[0];return type === 'open-element' || type === 'open-primitive-element';}var UnwrappedBuilder=(function(){function UnwrappedBuilder(env,layout){this.env = env;this.layout = layout;this.attrs = new ComponentAttrsBuilder();}UnwrappedBuilder.prototype.compile = function compile(){var env=this.env;var layout=this.layout;var b=builder(env,layout.symbolTable);b.startLabels();b.preludeForLayout(layout);var attrs=this.attrs['buffer'];var attrsInserted=false;for(var i=0;i < layout.statements.length;i++) {var statement=layout.statements[i];if(!attrsInserted && isOpenElement(statement)){b.openComponentElement(statement[1]);b.didCreateElement();b.shadowAttributes();attrs.forEach(function(statement){return compileStatement(statement,b);});attrsInserted = true;}else {compileStatement(statement,b);}}b.didRenderLayout();b.stopLabels();return new CompiledProgram(b.toSlice(),layout.symbolTable.size);};babelHelpers.createClass(UnwrappedBuilder,[{key:'tag',get:function(){throw new Error('BUG: Cannot call `tag` on an UnwrappedBuilder');}}]);return UnwrappedBuilder;})();var ComponentTagBuilder=(function(){function ComponentTagBuilder(){this.isDynamic = null;this.isStatic = null;this.staticTagName = null;this.dynamicTagName = null;}ComponentTagBuilder.prototype.getDynamic = function getDynamic(){if(this.isDynamic){return this.dynamicTagName;}};ComponentTagBuilder.prototype.getStatic = function getStatic(){if(this.isStatic){return this.staticTagName;}};ComponentTagBuilder.prototype.static = function _static(tagName){this.isStatic = true;this.staticTagName = tagName;};ComponentTagBuilder.prototype.dynamic = function dynamic(tagName){this.isDynamic = true;this.dynamicTagName = ['function',tagName];};return ComponentTagBuilder;})();var ComponentAttrsBuilder=(function(){function ComponentAttrsBuilder(){this.buffer = [];}ComponentAttrsBuilder.prototype.static = function _static(name,value){this.buffer.push(['static-attr',name,value,null]);};ComponentAttrsBuilder.prototype.dynamic = function dynamic(name,value){this.buffer.push(['dynamic-attr',name,['function',value],null]);};return ComponentAttrsBuilder;})();var ComponentBuilder=(function(){function ComponentBuilder(builder){this.builder = builder;this.env = builder.env;}ComponentBuilder.prototype.static = function _static(definition,args,_symbolTable,shadow){this.builder.unit(function(b){b.putComponentDefinition(definition);b.openComponent(compileBaselineArgs(args,b),shadow);b.closeComponent();});};ComponentBuilder.prototype.dynamic = function dynamic(definitionArgs,definition,args,_symbolTable,shadow){this.builder.unit(function(b){b.putArgs(compileArgs(definitionArgs[0],definitionArgs[1],b));b.putValue(['function',definition]);b.test('simple');b.enter('BEGIN','END');b.label('BEGIN');b.jumpUnless('END');b.putDynamicComponentDefinition();b.openComponent(compileBaselineArgs(args,b),shadow);b.closeComponent();b.label('END');b.exit();});};return ComponentBuilder;})();function builder(env,symbolTable){return new OpcodeBuilder(symbolTable,env);}function appendOpcode(name,op1,op2,op3){return APPEND_OPCODES.construct(name,null,op1,op2,op3);}var Labels=(function(){function Labels(){this.labels = _glimmerUtil.dict();this.jumps = [];this.ranges = [];}Labels.prototype.label = function label(name,index){this.labels[name] = index;};Labels.prototype.jump = function jump(at,Target,target){this.jumps.push({at:at,target:target,Target:Target});};Labels.prototype.range = function range(at,Range,start,end){this.ranges.push({at:at,start:start,end:end,Range:Range});};Labels.prototype.patch = function patch(constants,opcodes){for(var i=0;i < this.jumps.length;i++) {var _jumps$i=this.jumps[i];var at=_jumps$i.at;var target=_jumps$i.target;var Target=_jumps$i.Target;opcodes.set(at,APPEND_OPCODES.construct(Target,null,this.labels[target]));}for(var i=0;i < this.ranges.length;i++) {var _ranges$i=this.ranges[i];var at=_ranges$i.at;var start=_ranges$i.start;var end=_ranges$i.end;var _Range=_ranges$i.Range;var slice=constants.slice([this.labels[start],this.labels[end] - 1]);opcodes.set(at,APPEND_OPCODES.construct(_Range,null,slice));}};return Labels;})();var BasicOpcodeBuilder=(function(){function BasicOpcodeBuilder(symbolTable,env,program){this.symbolTable = symbolTable;this.env = env;this.program = program;this.labelsStack = new _glimmerUtil.Stack();this.constants = env.constants;this.start = program.next;}BasicOpcodeBuilder.prototype.opcode = function opcode(name,op1,op2,op3){this.push(appendOpcode(name,op1,op2,op3));};BasicOpcodeBuilder.prototype.push = function push(op){ // console.log(`pushing ${op && op.type}`); +if(op === null){this.program.push([0,0,0,0]);}else {this.program.push(op);}};BasicOpcodeBuilder.prototype.toSlice = function toSlice(){return [this.start,this.program.current];}; // helpers +BasicOpcodeBuilder.prototype.startLabels = function startLabels(){this.labelsStack.push(new Labels());};BasicOpcodeBuilder.prototype.stopLabels = function stopLabels(){var label=_glimmerUtil.expect(this.labelsStack.pop(),'unbalanced push and pop labels');label.patch(this.constants,this.program);}; // partials +BasicOpcodeBuilder.prototype.putPartialDefinition = function putPartialDefinition(_definition){var definition=this.constants.other(_definition);this.opcode(50, /* PutPartial */definition);};BasicOpcodeBuilder.prototype.putDynamicPartialDefinition = function putDynamicPartialDefinition(){this.opcode(49, /* PutDynamicPartial */this.constants.other(this.symbolTable));};BasicOpcodeBuilder.prototype.evaluatePartial = function evaluatePartial(){this.opcode(51, /* EvaluatePartial */this.constants.other(this.symbolTable),this.constants.other(_glimmerUtil.dict()));}; // components +BasicOpcodeBuilder.prototype.putComponentDefinition = function putComponentDefinition(definition){this.opcode(23, /* PutComponent */this.other(definition));};BasicOpcodeBuilder.prototype.putDynamicComponentDefinition = function putDynamicComponentDefinition(){this.opcode(22 /* PutDynamicComponent */);};BasicOpcodeBuilder.prototype.openComponent = function openComponent(args,shadow){this.opcode(24, /* OpenComponent */this.args(args),shadow?this.block(shadow):0);};BasicOpcodeBuilder.prototype.didCreateElement = function didCreateElement(){this.opcode(25 /* DidCreateElement */);};BasicOpcodeBuilder.prototype.shadowAttributes = function shadowAttributes(){this.opcode(26 /* ShadowAttributes */);this.opcode(21 /* CloseBlock */);};BasicOpcodeBuilder.prototype.didRenderLayout = function didRenderLayout(){this.opcode(27 /* DidRenderLayout */);};BasicOpcodeBuilder.prototype.closeComponent = function closeComponent(){this.opcode(28 /* CloseComponent */);}; // content +BasicOpcodeBuilder.prototype.dynamicContent = function dynamicContent(Opcode){this.opcode(31, /* DynamicContent */this.other(Opcode));};BasicOpcodeBuilder.prototype.cautiousAppend = function cautiousAppend(){this.dynamicContent(new OptimizedCautiousAppendOpcode());};BasicOpcodeBuilder.prototype.trustingAppend = function trustingAppend(){this.dynamicContent(new OptimizedTrustingAppendOpcode());};BasicOpcodeBuilder.prototype.guardedCautiousAppend = function guardedCautiousAppend(expression){this.dynamicContent(new GuardedCautiousAppendOpcode(this.compileExpression(expression),this.symbolTable));};BasicOpcodeBuilder.prototype.guardedTrustingAppend = function guardedTrustingAppend(expression){this.dynamicContent(new GuardedTrustingAppendOpcode(this.compileExpression(expression),this.symbolTable));}; // dom +BasicOpcodeBuilder.prototype.text = function text(_text){this.opcode(29, /* Text */this.constants.string(_text));};BasicOpcodeBuilder.prototype.openPrimitiveElement = function openPrimitiveElement(tag){this.opcode(32, /* OpenElement */this.constants.string(tag));};BasicOpcodeBuilder.prototype.openComponentElement = function openComponentElement(tag){this.opcode(35, /* OpenComponentElement */this.constants.string(tag));};BasicOpcodeBuilder.prototype.openDynamicPrimitiveElement = function openDynamicPrimitiveElement(){this.opcode(36 /* OpenDynamicElement */);};BasicOpcodeBuilder.prototype.flushElement = function flushElement(){this.opcode(37 /* FlushElement */);};BasicOpcodeBuilder.prototype.closeElement = function closeElement(){this.opcode(38 /* CloseElement */);};BasicOpcodeBuilder.prototype.staticAttr = function staticAttr(_name,_namespace,_value){var name=this.constants.string(_name);var namespace=_namespace?this.constants.string(_namespace):0;var value=this.constants.string(_value);this.opcode(40, /* StaticAttr */name,value,namespace);};BasicOpcodeBuilder.prototype.dynamicAttrNS = function dynamicAttrNS(_name,_namespace,trusting){var name=this.constants.string(_name);var namespace=this.constants.string(_namespace);this.opcode(42, /* DynamicAttrNS */name,namespace,trusting | 0);};BasicOpcodeBuilder.prototype.dynamicAttr = function dynamicAttr(_name,trusting){var name=this.constants.string(_name);this.opcode(43, /* DynamicAttr */name,trusting | 0);};BasicOpcodeBuilder.prototype.comment = function comment(_comment){var comment=this.constants.string(_comment);this.opcode(30, /* Comment */comment);};BasicOpcodeBuilder.prototype.modifier = function modifier(_name,_args){var args=this.constants.expression(this.compile(_args));var _modifierManager=this.env.lookupModifier([_name],this.symbolTable);var modifierManager=this.constants.other(_modifierManager);var name=this.constants.string(_name);this.opcode(41, /* Modifier */name,modifierManager,args);}; // lists +BasicOpcodeBuilder.prototype.putIterator = function putIterator(){this.opcode(44 /* PutIterator */);};BasicOpcodeBuilder.prototype.enterList = function enterList(start,end){this.push(null);this.labels.range(this.pos,45, /* EnterList */start,end);};BasicOpcodeBuilder.prototype.exitList = function exitList(){this.opcode(46 /* ExitList */);};BasicOpcodeBuilder.prototype.enterWithKey = function enterWithKey(start,end){this.push(null);this.labels.range(this.pos,47, /* EnterWithKey */start,end);};BasicOpcodeBuilder.prototype.nextIter = function nextIter(end){this.push(null);this.labels.jump(this.pos,48, /* NextIter */end);}; // vm +BasicOpcodeBuilder.prototype.openBlock = function openBlock(_args,_inner){var args=this.constants.expression(this.compile(_args));var inner=this.constants.other(_inner);this.opcode(20, /* OpenBlock */inner,args);};BasicOpcodeBuilder.prototype.closeBlock = function closeBlock(){this.opcode(21 /* CloseBlock */);};BasicOpcodeBuilder.prototype.pushRemoteElement = function pushRemoteElement(){this.opcode(33 /* PushRemoteElement */);};BasicOpcodeBuilder.prototype.popRemoteElement = function popRemoteElement(){this.opcode(34 /* PopRemoteElement */);};BasicOpcodeBuilder.prototype.popElement = function popElement(){this.opcode(39 /* PopElement */);};BasicOpcodeBuilder.prototype.label = function label(name){this.labels.label(name,this.nextPos);};BasicOpcodeBuilder.prototype.pushChildScope = function pushChildScope(){this.opcode(0 /* PushChildScope */);};BasicOpcodeBuilder.prototype.popScope = function popScope(){this.opcode(1 /* PopScope */);};BasicOpcodeBuilder.prototype.pushDynamicScope = function pushDynamicScope(){this.opcode(2 /* PushDynamicScope */);};BasicOpcodeBuilder.prototype.popDynamicScope = function popDynamicScope(){this.opcode(3 /* PopDynamicScope */);};BasicOpcodeBuilder.prototype.putNull = function putNull(){this.opcode(4, /* Put */this.constants.NULL_REFERENCE);};BasicOpcodeBuilder.prototype.putValue = function putValue(_expression){var expr=this.constants.expression(this.compileExpression(_expression));this.opcode(5, /* EvaluatePut */expr);};BasicOpcodeBuilder.prototype.putArgs = function putArgs(_args){var args=this.constants.expression(this.compile(_args));this.opcode(6, /* PutArgs */args);};BasicOpcodeBuilder.prototype.bindDynamicScope = function bindDynamicScope(_names){this.opcode(12, /* BindDynamicScope */this.names(_names));};BasicOpcodeBuilder.prototype.bindPositionalArgs = function bindPositionalArgs(_names,_symbols){this.opcode(7, /* BindPositionalArgs */this.names(_names),this.symbols(_symbols));};BasicOpcodeBuilder.prototype.bindNamedArgs = function bindNamedArgs(_names,_symbols){this.opcode(8, /* BindNamedArgs */this.names(_names),this.symbols(_symbols));};BasicOpcodeBuilder.prototype.bindBlocks = function bindBlocks(_names,_symbols){this.opcode(9, /* BindBlocks */this.names(_names),this.symbols(_symbols));};BasicOpcodeBuilder.prototype.enter = function enter(_enter,exit){this.push(null);this.labels.range(this.pos,13, /* Enter */_enter,exit);};BasicOpcodeBuilder.prototype.exit = function exit(){this.opcode(14 /* Exit */);};BasicOpcodeBuilder.prototype.evaluate = function evaluate(_block){var block=this.constants.block(_block);this.opcode(15, /* Evaluate */block);};BasicOpcodeBuilder.prototype.test = function test(testFunc){var _func=undefined;if(testFunc === 'const'){_func = ConstTest;}else if(testFunc === 'simple'){_func = SimpleTest;}else if(testFunc === 'environment'){_func = EnvironmentTest;}else if(typeof testFunc === 'function'){_func = testFunc;}else {throw new Error('unreachable');}var func=this.constants.function(_func);this.opcode(19, /* Test */func);};BasicOpcodeBuilder.prototype.jump = function jump(target){this.push(null);this.labels.jump(this.pos,16, /* Jump */target);};BasicOpcodeBuilder.prototype.jumpIf = function jumpIf(target){this.push(null);this.labels.jump(this.pos,17, /* JumpIf */target);};BasicOpcodeBuilder.prototype.jumpUnless = function jumpUnless(target){this.push(null);this.labels.jump(this.pos,18, /* JumpUnless */target);};BasicOpcodeBuilder.prototype.names = function names(_names){var _this=this;var names=_names.map(function(n){return _this.constants.string(n);});return this.constants.array(names);};BasicOpcodeBuilder.prototype.symbols = function symbols(_symbols2){return this.constants.array(_symbols2);};BasicOpcodeBuilder.prototype.other = function other(value){return this.constants.other(value);};BasicOpcodeBuilder.prototype.args = function args(_args2){return this.constants.expression(this.compile(_args2));};BasicOpcodeBuilder.prototype.block = function block(_block3){return this.constants.block(_block3);};babelHelpers.createClass(BasicOpcodeBuilder,[{key:'pos',get:function(){return this.program.current;}},{key:'nextPos',get:function(){return this.program.next;}},{key:'labels',get:function(){return _glimmerUtil.expect(this.labelsStack.current,'bug: not in a label stack');}}]);return BasicOpcodeBuilder;})();function isCompilableExpression(expr){return expr && typeof expr['compile'] === 'function';}var OpcodeBuilder=(function(_BasicOpcodeBuilder){babelHelpers.inherits(OpcodeBuilder,_BasicOpcodeBuilder);function OpcodeBuilder(symbolTable,env){var program=arguments.length <= 2 || arguments[2] === undefined?env.program:arguments[2];return (function(){_BasicOpcodeBuilder.call(this,symbolTable,env,program);this.component = new ComponentBuilder(this);}).apply(this,arguments);}OpcodeBuilder.prototype.compile = function compile(expr){if(isCompilableExpression(expr)){return expr.compile(this);}else {return expr;}};OpcodeBuilder.prototype.compileExpression = function compileExpression(expression){if(expression instanceof CompiledExpression){return expression;}else {return expr(expression,this);}};OpcodeBuilder.prototype.bindPositionalArgsForLocals = function bindPositionalArgsForLocals(locals){var symbols=Object.keys(locals).map(function(name){return locals[name];});this.opcode(7, /* BindPositionalArgs */this.symbols(symbols));};OpcodeBuilder.prototype.preludeForLayout = function preludeForLayout(layout){var _this2=this;var symbols=layout.symbolTable.getSymbols();if(symbols.named){(function(){var named=symbols.named;var namedNames=Object.keys(named);var namedSymbols=namedNames.map(function(n){return named[n];});_this2.opcode(8, /* BindNamedArgs */_this2.names(namedNames),_this2.symbols(namedSymbols));})();}this.opcode(11 /* BindCallerScope */);if(symbols.yields){(function(){var yields=symbols.yields;var yieldNames=Object.keys(yields);var yieldSymbols=yieldNames.map(function(n){return yields[n];});_this2.opcode(9, /* BindBlocks */_this2.names(yieldNames),_this2.symbols(yieldSymbols));})();}if(symbols.partialArgs){this.opcode(10, /* BindPartialArgs */symbols.partialArgs);}};OpcodeBuilder.prototype.yield = function _yield(args,to){var yields=undefined,partial=undefined;var inner=undefined;if(yields = this.symbolTable.getSymbol('yields',to)){inner = new CompiledGetBlockBySymbol(yields,to);}else if(partial = this.symbolTable.getPartialArgs()){inner = new CompiledInPartialGetBlock(partial,to);}else {throw new Error('[BUG] ${to} is not a valid block name.');}this.openBlock(args,inner);this.closeBlock();}; // TODO +// come back to this +OpcodeBuilder.prototype.labelled = function labelled(args,callback){if(args)this.putArgs(args);this.startLabels();this.enter('BEGIN','END');this.label('BEGIN');callback(this,'BEGIN','END');this.label('END');this.exit();this.stopLabels();}; // TODO +// come back to this +OpcodeBuilder.prototype.iter = function iter(callback){this.startLabels();this.enterList('BEGIN','END');this.label('ITER');this.nextIter('BREAK');this.enterWithKey('BEGIN','END');this.label('BEGIN');callback(this,'BEGIN','END');this.label('END');this.exit();this.jump('ITER');this.label('BREAK');this.exitList();this.stopLabels();}; // TODO +// come back to this +OpcodeBuilder.prototype.unit = function unit(callback){this.startLabels();callback(this);this.stopLabels();};return OpcodeBuilder;})(BasicOpcodeBuilder);APPEND_OPCODES.add(31, /* DynamicContent */function(vm,_ref31){var append=_ref31.op1;var opcode=vm.constants.getOther(append);opcode.evaluate(vm);});function isEmpty(value){return value === null || value === undefined || typeof value['toString'] !== 'function';}function normalizeTextValue(value){if(isEmpty(value)){return '';}return String(value);}function normalizeTrustedValue(value){if(isEmpty(value)){return '';}if(isString(value)){return value;}if(isSafeString(value)){return value.toHTML();}if(isNode(value)){return value;}return String(value);}function normalizeValue(value){if(isEmpty(value)){return '';}if(isString(value)){return value;}if(isSafeString(value) || isNode(value)){return value;}return String(value);}var AppendDynamicOpcode=(function(){function AppendDynamicOpcode(){}AppendDynamicOpcode.prototype.evaluate = function evaluate(vm){var reference=vm.frame.getOperand();var normalized=this.normalize(reference);var value=undefined,cache=undefined;if(_glimmerReference.isConst(reference)){value = normalized.value();}else {cache = new _glimmerReference.ReferenceCache(normalized);value = cache.peek();}var stack=vm.stack();var upsert=this.insert(vm.env.getAppendOperations(),stack,value);var bounds=new Fragment(upsert.bounds);stack.newBounds(bounds);if(cache /* i.e. !isConst(reference) */){vm.updateWith(this.updateWith(vm,reference,cache,bounds,upsert));}};return AppendDynamicOpcode;})();var GuardedAppendOpcode=(function(_AppendDynamicOpcode){babelHelpers.inherits(GuardedAppendOpcode,_AppendDynamicOpcode);function GuardedAppendOpcode(expression,symbolTable){_AppendDynamicOpcode.call(this);this.expression = expression;this.symbolTable = symbolTable;this.deopted = null;}GuardedAppendOpcode.prototype.evaluate = function evaluate(vm){if(this.deopted){vm.pushEvalFrame(this.deopted);}else {vm.evaluateOperand(this.expression);var value=vm.frame.getOperand().value();if(isComponentDefinition(value)){vm.pushEvalFrame(this.deopt(vm.env));}else {_AppendDynamicOpcode.prototype.evaluate.call(this,vm);}}};GuardedAppendOpcode.prototype.deopt = function deopt(env){var _this3=this; // At compile time, we determined that this append callsite might refer +// to a local variable/property lookup that resolves to a component +// definition at runtime. +// +// We could have eagerly compiled this callsite into something like this: +// +// {{#if (is-component-definition foo)}} +// {{component foo}} +// {{else}} +// {{foo}} +// {{/if}} +// +// However, in practice, there might be a large amout of these callsites +// and most of them would resolve to a simple value lookup. Therefore, we +// tried to be optimistic and assumed that the callsite will resolve to +// appending a simple value. +// +// However, we have reached here because at runtime, the guard conditional +// have detected that this callsite is indeed referring to a component +// definition object. Since this is likely going to be true for other +// instances of the same callsite, it is now appropiate to deopt into the +// expanded version that handles both cases. The compilation would look +// like this: +// +// PutValue(expression) +// Test(is-component-definition) +// Enter(BEGIN, END) +// BEGIN: Noop +// JumpUnless(VALUE) +// PutDynamicComponentDefinitionOpcode +// OpenComponent +// CloseComponent +// Jump(END) +// VALUE: Noop +// OptimizedAppend +// END: Noop +// Exit +// +// Keep in mind that even if we *don't* reach here at initial render time, +// it is still possible (although quite rare) that the simple value we +// encounter during initial render could later change into a component +// definition object at update time. That is handled by the "lazy deopt" +// code on the update side (scroll down for the next big block of comment). +var dsl=new OpcodeBuilder(this.symbolTable,env);dsl.putValue(this.expression);dsl.test(IsComponentDefinitionReference.create);dsl.labelled(null,function(dsl,_BEGIN,END){dsl.jumpUnless('VALUE');dsl.putDynamicComponentDefinition();dsl.openComponent(CompiledArgs.empty());dsl.closeComponent();dsl.jump(END);dsl.label('VALUE');dsl.dynamicContent(new _this3.AppendOpcode());});var deopted=this.deopted = dsl.toSlice(); // From this point on, we have essentially replaced ourselves with a new set +// of opcodes. Since we will always be executing the new/deopted code, it's +// a good idea (as a pattern) to null out any unneeded fields here to avoid +// holding on to unneeded/stale objects: +// QUESTION: Shouldn't this whole object be GCed? If not, why not? +this.expression = null;return deopted;};return GuardedAppendOpcode;})(AppendDynamicOpcode);var IsComponentDefinitionReference=(function(_ConditionalReference){babelHelpers.inherits(IsComponentDefinitionReference,_ConditionalReference);function IsComponentDefinitionReference(){_ConditionalReference.apply(this,arguments);}IsComponentDefinitionReference.create = function create(inner){return new IsComponentDefinitionReference(inner);};IsComponentDefinitionReference.prototype.toBool = function toBool(value){return isComponentDefinition(value);};return IsComponentDefinitionReference;})(ConditionalReference);var UpdateOpcode=(function(_UpdatingOpcode9){babelHelpers.inherits(UpdateOpcode,_UpdatingOpcode9);function UpdateOpcode(cache,bounds,upsert){_UpdatingOpcode9.call(this);this.cache = cache;this.bounds = bounds;this.upsert = upsert;this.tag = cache.tag;}UpdateOpcode.prototype.evaluate = function evaluate(vm){var value=this.cache.revalidate();if(_glimmerReference.isModified(value)){var bounds=this.bounds;var upsert=this.upsert;var dom=vm.dom;if(!this.upsert.update(dom,value)){var cursor=new Cursor(bounds.parentElement(),clear(bounds));upsert = this.upsert = this.insert(vm.env.getAppendOperations(),cursor,value);}bounds.update(upsert.bounds);}};UpdateOpcode.prototype.toJSON = function toJSON(){var guid=this._guid;var type=this.type;var cache=this.cache;return {guid:guid,type:type,details:{lastValue:JSON.stringify(cache.peek())}};};return UpdateOpcode;})(UpdatingOpcode);var GuardedUpdateOpcode=(function(_UpdateOpcode){babelHelpers.inherits(GuardedUpdateOpcode,_UpdateOpcode);function GuardedUpdateOpcode(reference,cache,bounds,upsert,appendOpcode,state){_UpdateOpcode.call(this,cache,bounds,upsert);this.reference = reference;this.appendOpcode = appendOpcode;this.state = state;this.deopted = null;this.tag = this._tag = new _glimmerReference.UpdatableTag(this.tag);}GuardedUpdateOpcode.prototype.evaluate = function evaluate(vm){if(this.deopted){vm.evaluateOpcode(this.deopted);}else {if(isComponentDefinition(this.reference.value())){this.lazyDeopt(vm);}else {_UpdateOpcode.prototype.evaluate.call(this,vm);}}};GuardedUpdateOpcode.prototype.lazyDeopt = function lazyDeopt(vm){ // Durign initial render, we know that the reference does not contain a +// component definition, so we optimistically assumed that this append +// is just a normal append. However, at update time, we discovered that +// the reference has switched into containing a component definition, so +// we need to do a "lazy deopt", simulating what would have happened if +// we had decided to perform the deopt in the first place during initial +// render. +// +// More concretely, we would have expanded the curly into a if/else, and +// based on whether the value is a component definition or not, we would +// have entered either the dynamic component branch or the simple value +// branch. +// +// Since we rendered a simple value during initial render (and all the +// updates up until this point), we need to pretend that the result is +// produced by the "VALUE" branch of the deopted append opcode: +// +// Try(BEGIN, END) +// Assert(IsComponentDefinition, expected=false) +// OptimizedUpdate +// +// In this case, because the reference has switched from being a simple +// value into a component definition, what would have happened is that +// the assert would throw, causing the Try opcode to teardown the bounds +// and rerun the original append opcode. +// +// Since the Try opcode would have nuked the updating opcodes anyway, we +// wouldn't have to worry about simulating those. All we have to do is to +// execute the Try opcode and immediately throw. +var bounds=this.bounds;var appendOpcode=this.appendOpcode;var state=this.state;var env=vm.env;var slice=appendOpcode.deopt(env);var enter=_glimmerUtil.expect(env.program.opcode(slice[0] + 8),'hardcoded deopt location');var ops=vm.constants.getSlice(enter.op1);var tracker=new UpdatableBlockTracker(bounds.parentElement());tracker.newBounds(this.bounds);var children=new _glimmerUtil.LinkedList();state.frame['condition'] = IsComponentDefinitionReference.create(_glimmerUtil.expect(state.frame['operand'],'operand should be populated'));var deopted=this.deopted = new TryOpcode(ops,state,tracker,children);this._tag.update(deopted.tag);vm.evaluateOpcode(deopted);vm.throw(); // From this point on, we have essentially replaced ourselve with a new +// opcode. Since we will always be executing the new/deopted code, it's a +// good idea (as a pattern) to null out any unneeded fields here to avoid +// holding on to unneeded/stale objects: +// QUESTION: Shouldn't this whole object be GCed? If not, why not? +this._tag = null;this.reference = null;this.cache = null;this.bounds = null;this.upsert = null;this.appendOpcode = null;this.state = null;};GuardedUpdateOpcode.prototype.toJSON = function toJSON(){var guid=this._guid;var type=this.type;var deopted=this.deopted;if(deopted){return {guid:guid,type:type,deopted:true,children:[deopted.toJSON()]};}else {return _UpdateOpcode.prototype.toJSON.call(this);}};return GuardedUpdateOpcode;})(UpdateOpcode);var OptimizedCautiousAppendOpcode=(function(_AppendDynamicOpcode2){babelHelpers.inherits(OptimizedCautiousAppendOpcode,_AppendDynamicOpcode2);function OptimizedCautiousAppendOpcode(){_AppendDynamicOpcode2.apply(this,arguments);this.type = 'optimized-cautious-append';}OptimizedCautiousAppendOpcode.prototype.normalize = function normalize(reference){return _glimmerReference.map(reference,normalizeValue);};OptimizedCautiousAppendOpcode.prototype.insert = function insert(dom,cursor,value){return cautiousInsert(dom,cursor,value);};OptimizedCautiousAppendOpcode.prototype.updateWith = function updateWith(_vm,_reference,cache,bounds,upsert){return new OptimizedCautiousUpdateOpcode(cache,bounds,upsert);};return OptimizedCautiousAppendOpcode;})(AppendDynamicOpcode);var OptimizedCautiousUpdateOpcode=(function(_UpdateOpcode2){babelHelpers.inherits(OptimizedCautiousUpdateOpcode,_UpdateOpcode2);function OptimizedCautiousUpdateOpcode(){_UpdateOpcode2.apply(this,arguments);this.type = 'optimized-cautious-update';}OptimizedCautiousUpdateOpcode.prototype.insert = function insert(dom,cursor,value){return cautiousInsert(dom,cursor,value);};return OptimizedCautiousUpdateOpcode;})(UpdateOpcode);var GuardedCautiousAppendOpcode=(function(_GuardedAppendOpcode){babelHelpers.inherits(GuardedCautiousAppendOpcode,_GuardedAppendOpcode);function GuardedCautiousAppendOpcode(){_GuardedAppendOpcode.apply(this,arguments);this.type = 'guarded-cautious-append';this.AppendOpcode = OptimizedCautiousAppendOpcode;}GuardedCautiousAppendOpcode.prototype.normalize = function normalize(reference){return _glimmerReference.map(reference,normalizeValue);};GuardedCautiousAppendOpcode.prototype.insert = function insert(dom,cursor,value){return cautiousInsert(dom,cursor,value);};GuardedCautiousAppendOpcode.prototype.updateWith = function updateWith(vm,reference,cache,bounds,upsert){return new GuardedCautiousUpdateOpcode(reference,cache,bounds,upsert,this,vm.capture());};return GuardedCautiousAppendOpcode;})(GuardedAppendOpcode);var GuardedCautiousUpdateOpcode=(function(_GuardedUpdateOpcode){babelHelpers.inherits(GuardedCautiousUpdateOpcode,_GuardedUpdateOpcode);function GuardedCautiousUpdateOpcode(){_GuardedUpdateOpcode.apply(this,arguments);this.type = 'guarded-cautious-update';}GuardedCautiousUpdateOpcode.prototype.insert = function insert(dom,cursor,value){return cautiousInsert(dom,cursor,value);};return GuardedCautiousUpdateOpcode;})(GuardedUpdateOpcode);var OptimizedTrustingAppendOpcode=(function(_AppendDynamicOpcode3){babelHelpers.inherits(OptimizedTrustingAppendOpcode,_AppendDynamicOpcode3);function OptimizedTrustingAppendOpcode(){_AppendDynamicOpcode3.apply(this,arguments);this.type = 'optimized-trusting-append';}OptimizedTrustingAppendOpcode.prototype.normalize = function normalize(reference){return _glimmerReference.map(reference,normalizeTrustedValue);};OptimizedTrustingAppendOpcode.prototype.insert = function insert(dom,cursor,value){return trustingInsert(dom,cursor,value);};OptimizedTrustingAppendOpcode.prototype.updateWith = function updateWith(_vm,_reference,cache,bounds,upsert){return new OptimizedTrustingUpdateOpcode(cache,bounds,upsert);};return OptimizedTrustingAppendOpcode;})(AppendDynamicOpcode);var OptimizedTrustingUpdateOpcode=(function(_UpdateOpcode3){babelHelpers.inherits(OptimizedTrustingUpdateOpcode,_UpdateOpcode3);function OptimizedTrustingUpdateOpcode(){_UpdateOpcode3.apply(this,arguments);this.type = 'optimized-trusting-update';}OptimizedTrustingUpdateOpcode.prototype.insert = function insert(dom,cursor,value){return trustingInsert(dom,cursor,value);};return OptimizedTrustingUpdateOpcode;})(UpdateOpcode);var GuardedTrustingAppendOpcode=(function(_GuardedAppendOpcode2){babelHelpers.inherits(GuardedTrustingAppendOpcode,_GuardedAppendOpcode2);function GuardedTrustingAppendOpcode(){_GuardedAppendOpcode2.apply(this,arguments);this.type = 'guarded-trusting-append';this.AppendOpcode = OptimizedTrustingAppendOpcode;}GuardedTrustingAppendOpcode.prototype.normalize = function normalize(reference){return _glimmerReference.map(reference,normalizeTrustedValue);};GuardedTrustingAppendOpcode.prototype.insert = function insert(dom,cursor,value){return trustingInsert(dom,cursor,value);};GuardedTrustingAppendOpcode.prototype.updateWith = function updateWith(vm,reference,cache,bounds,upsert){return new GuardedTrustingUpdateOpcode(reference,cache,bounds,upsert,this,vm.capture());};return GuardedTrustingAppendOpcode;})(GuardedAppendOpcode);var GuardedTrustingUpdateOpcode=(function(_GuardedUpdateOpcode2){babelHelpers.inherits(GuardedTrustingUpdateOpcode,_GuardedUpdateOpcode2);function GuardedTrustingUpdateOpcode(){_GuardedUpdateOpcode2.apply(this,arguments);this.type = 'trusting-update';}GuardedTrustingUpdateOpcode.prototype.insert = function insert(dom,cursor,value){return trustingInsert(dom,cursor,value);};return GuardedTrustingUpdateOpcode;})(GuardedUpdateOpcode);APPEND_OPCODES.add(49, /* PutDynamicPartial */function(vm,_ref32){var _symbolTable=_ref32.op1;var env=vm.env;var symbolTable=vm.constants.getOther(_symbolTable);function lookupPartial(name){var normalized=String(name);if(!env.hasPartial(normalized,symbolTable)){throw new Error('Could not find a partial named "' + normalized + '"');}return env.lookupPartial(normalized,symbolTable);}var reference=_glimmerReference.map(vm.frame.getOperand(),lookupPartial);var cache=_glimmerReference.isConst(reference)?undefined:new _glimmerReference.ReferenceCache(reference);var definition=cache?cache.peek():reference.value();vm.frame.setImmediate(definition);if(cache){vm.updateWith(new Assert(cache));}});APPEND_OPCODES.add(50, /* PutPartial */function(vm,_ref33){var _definition=_ref33.op1;var definition=vm.constants.getOther(_definition);vm.frame.setImmediate(definition);});APPEND_OPCODES.add(51, /* EvaluatePartial */function(vm,_ref34){var _symbolTable=_ref34.op1;var _cache=_ref34.op2;var symbolTable=vm.constants.getOther(_symbolTable);var cache=vm.constants.getOther(_cache);var _vm$frame$getImmediate=vm.frame.getImmediate();var template=_vm$frame$getImmediate.template;var block=cache[template.id];if(!block){block = template.asPartial(symbolTable);}vm.invokePartial(block);});var IterablePresenceReference=(function(){function IterablePresenceReference(artifacts){this.tag = artifacts.tag;this.artifacts = artifacts;}IterablePresenceReference.prototype.value = function value(){return !this.artifacts.isEmpty();};return IterablePresenceReference;})();APPEND_OPCODES.add(44, /* PutIterator */function(vm){var listRef=vm.frame.getOperand();var args=_glimmerUtil.expect(vm.frame.getArgs(),'PutIteratorOpcode expects a populated args register');var iterable=vm.env.iterableFor(listRef,args);var iterator=new _glimmerReference.ReferenceIterator(iterable);vm.frame.setIterator(iterator);vm.frame.setCondition(new IterablePresenceReference(iterator.artifacts));});APPEND_OPCODES.add(45, /* EnterList */function(vm,_ref35){var _slice=_ref35.op1;vm.enterList(vm.constants.getSlice(_slice));});APPEND_OPCODES.add(46, /* ExitList */function(vm){return vm.exitList();});APPEND_OPCODES.add(47, /* EnterWithKey */function(vm,_ref36){var _slice=_ref36.op2;var key=_glimmerUtil.expect(vm.frame.getKey(),'EnterWithKeyOpcode expects a populated key register');var slice=vm.constants.getSlice(_slice);vm.enterWithKey(key,slice);});var TRUE_REF=new _glimmerReference.ConstReference(true);var FALSE_REF=new _glimmerReference.ConstReference(false);APPEND_OPCODES.add(48, /* NextIter */function(vm,_ref37){var end=_ref37.op1;var item=vm.frame.getIterator().next();if(item){vm.frame.setCondition(TRUE_REF);vm.frame.setKey(item.key);vm.frame.setOperand(item.value);vm.frame.setArgs(EvaluatedArgs.positional([item.value,item.memo]));}else {vm.frame.setCondition(FALSE_REF);vm.goto(end);}});var clientId=0;function templateFactory(_ref38){var templateId=_ref38.id;var meta=_ref38.meta;var block=_ref38.block;var parsedBlock=undefined;var id=templateId || 'client-' + clientId++;var create=function(env,envMeta){var newMeta=envMeta?_glimmerUtil.assign({},envMeta,meta):meta;if(!parsedBlock){parsedBlock = JSON.parse(block);}return template(parsedBlock,id,newMeta,env);};return {id:id,meta:meta,create:create};}function template(block,id,meta,env){var scanner=new Scanner(block,meta,env);var entryPoint=undefined;var asEntryPoint=function(){if(!entryPoint)entryPoint = scanner.scanEntryPoint();return entryPoint;};var layout=undefined;var asLayout=function(){if(!layout)layout = scanner.scanLayout();return layout;};var asPartial=function(symbols){return scanner.scanPartial(symbols);};var render=function(self,appendTo,dynamicScope){var elementStack=ElementStack.forInitialRender(env,appendTo,null);var compiled=asEntryPoint().compile(env);var vm=VM.initial(env,self,dynamicScope,elementStack,compiled.symbols);return vm.execute(compiled.slice);};return {id:id,meta:meta,_block:block,asEntryPoint:asEntryPoint,asLayout:asLayout,asPartial:asPartial,render:render};}var DynamicVarReference=(function(){function DynamicVarReference(scope,nameRef){this.scope = scope;this.nameRef = nameRef;var varTag=this.varTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG);this.tag = _glimmerReference.combine([nameRef.tag,varTag]);}DynamicVarReference.prototype.value = function value(){return this.getVar().value();};DynamicVarReference.prototype.get = function get(key){return this.getVar().get(key);};DynamicVarReference.prototype.getVar = function getVar(){var name=String(this.nameRef.value());var ref=this.scope.get(name);this.varTag.update(ref.tag);return ref;};return DynamicVarReference;})();function getDynamicVar(vm,args,_symbolTable){var scope=vm.dynamicScope();var nameRef=args.positional.at(0);return new DynamicVarReference(scope,nameRef);}var PartialDefinition=function PartialDefinition(name,template){this.name = name;this.template = template;};var NodeType;(function(NodeType){NodeType[NodeType["Element"] = 0] = "Element";NodeType[NodeType["Attribute"] = 1] = "Attribute";NodeType[NodeType["Text"] = 2] = "Text";NodeType[NodeType["CdataSection"] = 3] = "CdataSection";NodeType[NodeType["EntityReference"] = 4] = "EntityReference";NodeType[NodeType["Entity"] = 5] = "Entity";NodeType[NodeType["ProcessingInstruction"] = 6] = "ProcessingInstruction";NodeType[NodeType["Comment"] = 7] = "Comment";NodeType[NodeType["Document"] = 8] = "Document";NodeType[NodeType["DocumentType"] = 9] = "DocumentType";NodeType[NodeType["DocumentFragment"] = 10] = "DocumentFragment";NodeType[NodeType["Notation"] = 11] = "Notation";})(NodeType || (NodeType = {}));var Simple=Object.freeze({get NodeType(){return NodeType;}});exports.Simple = Simple;exports.templateFactory = templateFactory;exports.NULL_REFERENCE = NULL_REFERENCE;exports.UNDEFINED_REFERENCE = UNDEFINED_REFERENCE;exports.PrimitiveReference = PrimitiveReference;exports.ConditionalReference = ConditionalReference;exports.OpcodeBuilderDSL = OpcodeBuilder;exports.compileLayout = compileLayout;exports.CompiledBlock = CompiledBlock;exports.CompiledProgram = CompiledProgram;exports.IAttributeManager = AttributeManager;exports.AttributeManager = AttributeManager;exports.PropertyManager = PropertyManager;exports.INPUT_VALUE_PROPERTY_MANAGER = INPUT_VALUE_PROPERTY_MANAGER;exports.defaultManagers = defaultManagers;exports.defaultAttributeManagers = defaultAttributeManagers;exports.defaultPropertyManagers = defaultPropertyManagers;exports.readDOMAttr = readDOMAttr;exports.normalizeTextValue = normalizeTextValue;exports.CompiledExpression = CompiledExpression;exports.CompiledArgs = CompiledArgs;exports.CompiledNamedArgs = CompiledNamedArgs;exports.CompiledPositionalArgs = CompiledPositionalArgs;exports.EvaluatedArgs = EvaluatedArgs;exports.EvaluatedNamedArgs = EvaluatedNamedArgs;exports.EvaluatedPositionalArgs = EvaluatedPositionalArgs;exports.getDynamicVar = getDynamicVar;exports.BlockMacros = Blocks;exports.InlineMacros = Inlines;exports.compileArgs = compileArgs;exports.setDebuggerCallback = setDebuggerCallback;exports.resetDebuggerCallback = resetDebuggerCallback;exports.BaselineSyntax = BaselineSyntax;exports.Layout = Layout;exports.UpdatingVM = UpdatingVM;exports.RenderResult = RenderResult;exports.isSafeString = isSafeString;exports.Scope = Scope;exports.Environment = Environment;exports.PartialDefinition = PartialDefinition;exports.ComponentDefinition = ComponentDefinition;exports.isComponentDefinition = isComponentDefinition;exports.DOMChanges = helper$1;exports.IDOMChanges = DOMChanges;exports.DOMTreeConstruction = DOMTreeConstruction;exports.isWhitespace = isWhitespace;exports.insertHTMLBefore = _insertHTMLBefore;exports.ElementStack = ElementStack;exports.ConcreteBounds = ConcreteBounds;}); +enifed('@glimmer/util', ['exports'], function (exports) { + // There is a small whitelist of namespaced attributes specially + // enumerated in + // https://www.w3.org/TR/html/syntax.html#attributes-0 + // + // > When a foreign element has one of the namespaced attributes given by + // > the local name and namespace of the first and second cells of a row + // > from the following table, it must be written using the name given by + // > the third cell from the same row. + // + // In all other cases, colons are interpreted as a regular character + // with no special meaning: + // + // > No other namespaced attribute can be expressed in the HTML syntax. + 'use strict'; - this._throttlers.push(throttler); + var XLINK = 'http://www.w3.org/1999/xlink'; + var XML = 'http://www.w3.org/XML/1998/namespace'; + var XMLNS = 'http://www.w3.org/2000/xmlns/'; + var WHITELIST = { + 'xlink:actuate': XLINK, + 'xlink:arcrole': XLINK, + 'xlink:href': XLINK, + 'xlink:role': XLINK, + 'xlink:show': XLINK, + 'xlink:title': XLINK, + 'xlink:type': XLINK, + 'xml:base': XML, + 'xml:lang': XML, + 'xml:space': XML, + 'xmlns': XMLNS, + 'xmlns:xlink': XMLNS + }; + function getAttrNamespace(attrName) { + return WHITELIST[attrName] || null; + } - return throttler; - }, + // tslint:disable-line + function unwrap(val) { + if (val === null || val === undefined) throw new Error('Expected value to be present'); + return val; + } + function expect(val, message) { + if (val === null || val === undefined) throw new Error(message); + return val; + } + function unreachable() { + return new Error('unreachable'); + } - debounce: function(target, method /* , args, wait, [immediate] */) { - var backburner = this; - var args = new Array(arguments.length); - for (var i = 0; i < arguments.length; i++) { - args[i] = arguments[i]; + // import Logger from './logger'; + // let alreadyWarned = false; + // import Logger from './logger'; + function debugAssert(test, msg) { + // if (!alreadyWarned) { + // alreadyWarned = true; + // Logger.warn("Don't leave debug assertions on in public builds"); + // } + if (!test) { + throw new Error(msg || "assertion failure"); + } } - var immediate = args.pop(); - var wait, index, debouncee, timer; + var LogLevel; + (function (LogLevel) { + LogLevel[LogLevel["Trace"] = 0] = "Trace"; + LogLevel[LogLevel["Debug"] = 1] = "Debug"; + LogLevel[LogLevel["Warn"] = 2] = "Warn"; + LogLevel[LogLevel["Error"] = 3] = "Error"; + })(LogLevel || (exports.LogLevel = LogLevel = {})); - if (isNumber(immediate) || isString(immediate)) { - wait = immediate; - immediate = false; - } else { - wait = args.pop(); - } + var NullConsole = (function () { + function NullConsole() {} - wait = parseInt(wait, 10); - // Remove debouncee - index = findDebouncee(target, method, this._debouncees); + NullConsole.prototype.log = function log(_message) {}; - if (index > -1) { - debouncee = this._debouncees[index]; - this._debouncees.splice(index, 1); - this._platform.clearTimeout(debouncee[2]); - } + NullConsole.prototype.warn = function warn(_message) {}; - timer = this._platform.setTimeout(function() { - if (!immediate) { - backburner.run.apply(backburner, args); - } - var index = findDebouncee(target, method, backburner._debouncees); - if (index > -1) { - backburner._debouncees.splice(index, 1); - } - }, wait); + NullConsole.prototype.error = function error(_message) {}; - if (immediate && index === -1) { - backburner.run.apply(backburner, args); - } + NullConsole.prototype.trace = function trace() {}; - debouncee = [ - target, - method, - timer - ]; + return NullConsole; + })(); - backburner._debouncees.push(debouncee); + var ALWAYS = undefined; - return debouncee; - }, + var Logger = (function () { + function Logger(_ref) { + var console = _ref.console; + var level = _ref.level; - cancelTimers: function() { - each(this._throttlers, this._boundClearItems); - this._throttlers = []; + this.f = ALWAYS; + this.force = ALWAYS; + this.console = console; + this.level = level; + } - each(this._debouncees, this._boundClearItems); - this._debouncees = []; + Logger.prototype.skipped = function skipped(level) { + return level < this.level; + }; - this._clearTimerTimeout(); - this._timers = []; + Logger.prototype.trace = function trace(message) { + var _ref2 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - if (this._autorun) { - this._platform.clearTimeout(this._autorun); - this._autorun = null; - } - }, + var _ref2$stackTrace = _ref2.stackTrace; + var stackTrace = _ref2$stackTrace === undefined ? false : _ref2$stackTrace; - hasTimers: function() { - return !!this._timers.length || !!this._debouncees.length || !!this._throttlers.length || this._autorun; - }, + if (this.skipped(LogLevel.Trace)) return; + this.console.log(message); + if (stackTrace) this.console.trace(); + }; - cancel: function (timer) { - var timerType = typeof timer; + Logger.prototype.debug = function debug(message) { + var _ref3 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - if (timer && timerType === 'object' && timer.queue && timer.method) { // we're cancelling a deferOnce - return timer.queue.cancel(timer); - } else if (timerType === 'function') { // we're cancelling a setTimeout - for (var i = 0, l = this._timers.length; i < l; i += 2) { - if (this._timers[i + 1] === timer) { - this._timers.splice(i, 2); // remove the two elements - if (i === 0) { - this._reinstallTimerTimeout(); - } - return true; - } - } - } else if (Object.prototype.toString.call(timer) === '[object Array]'){ // we're cancelling a throttle or debounce - return this._cancelItem(findThrottler, this._throttlers, timer) || - this._cancelItem(findDebouncee, this._debouncees, timer); - } else { - return; // timer was null or not a timer - } - }, + var _ref3$stackTrace = _ref3.stackTrace; + var stackTrace = _ref3$stackTrace === undefined ? false : _ref3$stackTrace; - _cancelItem: function(findMethod, array, timer){ - var item, index; + if (this.skipped(LogLevel.Debug)) return; + this.console.log(message); + if (stackTrace) this.console.trace(); + }; - if (timer.length < 3) { return false; } + Logger.prototype.warn = function warn(message) { + var _ref4 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - index = findMethod(timer[0], timer[1], array); + var _ref4$stackTrace = _ref4.stackTrace; + var stackTrace = _ref4$stackTrace === undefined ? false : _ref4$stackTrace; - if (index > -1) { + if (this.skipped(LogLevel.Warn)) return; + this.console.warn(message); + if (stackTrace) this.console.trace(); + }; - item = array[index]; + Logger.prototype.error = function error(message) { + if (this.skipped(LogLevel.Error)) return; + this.console.error(message); + }; - if (item[2] === timer[2]) { - array.splice(index, 1); - this._platform.clearTimeout(timer[2]); - return true; - } - } + return Logger; + })(); - return false; - }, + var _console = typeof console === 'undefined' ? new NullConsole() : console; + ALWAYS = new Logger({ console: _console, level: LogLevel.Trace }); + var LOG_LEVEL = LogLevel.Warn; + var logger = new Logger({ console: _console, level: LOG_LEVEL }); - _runExpiredTimers: function () { - this._timerTimeoutId = undefined; - this.run(this, this._scheduleExpiredTimers); - }, + var objKeys = Object.keys; - _scheduleExpiredTimers: function () { - var n = Date.now(); - var timers = this._timers; - var i = 0; - var l = timers.length; - for (; i < l; i += 2) { - var executeAt = timers[i]; - var fn = timers[i+1]; - if (executeAt <= n) { - this.schedule(this.options.defaultQueue, null, fn); - } else { - break; - } + function assign(obj) { + for (var i = 1; i < arguments.length; i++) { + var assignment = arguments[i]; + if (assignment === null || typeof assignment !== 'object') continue; + var keys = objKeys(assignment); + for (var j = 0; j < keys.length; j++) { + var key = keys[j]; + obj[key] = assignment[key]; + } + } + return obj; + } + function fillNulls(count) { + var arr = new Array(count); + for (var i = 0; i < count; i++) { + arr[i] = null; + } + return arr; } - timers.splice(0, i); - this._installTimerTimeout(); - }, - - _reinstallTimerTimeout: function () { - this._clearTimerTimeout(); - this._installTimerTimeout(); - }, - _clearTimerTimeout: function () { - if (!this._timerTimeoutId) { - return; + var GUID = 0; + function initializeGuid(object) { + return object._guid = ++GUID; + } + function ensureGuid(object) { + return object._guid || initializeGuid(object); } - this._platform.clearTimeout(this._timerTimeoutId); - this._timerTimeoutId = undefined; - }, - _installTimerTimeout: function () { - if (!this._timers.length) { - return; + var proto = Object.create(null, { + // without this, we will always still end up with (new + // EmptyObject()).constructor === Object + constructor: { + value: undefined, + enumerable: false, + writable: true + } + }); + function EmptyObject() {} + EmptyObject.prototype = proto; + function dict() { + // let d = Object.create(null); + // d.x = 1; + // delete d.x; + // return d; + return new EmptyObject(); } - var minExpiresAt = this._timers[0]; - var n = Date.now(); - var wait = Math.max(0, minExpiresAt - n); - this._timerTimeoutId = this._platform.setTimeout(this._boundRunExpiredTimers, wait); - } -}; -Backburner.prototype.schedule = Backburner.prototype.defer; -Backburner.prototype.scheduleOnce = Backburner.prototype.deferOnce; -Backburner.prototype.later = Backburner.prototype.setTimeout; + var DictSet = (function () { + function DictSet() { + this.dict = dict(); + } -function getOnError(options) { - return options.onError || (options.onErrorTarget && options.onErrorTarget[options.onErrorMethod]); -} + DictSet.prototype.add = function add(obj) { + if (typeof obj === 'string') this.dict[obj] = obj;else this.dict[ensureGuid(obj)] = obj; + return this; + }; -function createAutorun(backburner) { - var setTimeout = backburner._platform.setTimeout; - backburner.begin(); - backburner._autorun = setTimeout(function() { - backburner._autorun = null; - backburner.end(); - }, 0); -} + DictSet.prototype.delete = function _delete(obj) { + if (typeof obj === 'string') delete this.dict[obj];else if (obj._guid) delete this.dict[obj._guid]; + }; -function findDebouncee(target, method, debouncees) { - return findItem(target, method, debouncees); -} + DictSet.prototype.forEach = function forEach(callback) { + var dict = this.dict; -function findThrottler(target, method, throttlers) { - return findItem(target, method, throttlers); -} + Object.keys(dict).forEach(function (key) { + return callback(dict[key]); + }); + }; -function findItem(target, method, collection) { - var item; - var index = -1; + DictSet.prototype.toArray = function toArray() { + return Object.keys(this.dict); + }; - for (var i = 0, l = collection.length; i < l; i++) { - item = collection[i]; - if (item[0] === target && item[1] === method) { - index = i; - break; - } - } - - return index; -} + return DictSet; + })(); -function clearItems(item) { - this._platform.clearTimeout(item[2]); -} + var Stack = (function () { + function Stack() { + this.stack = []; + this.current = null; + } -exports['default'] = Backburner; + Stack.prototype.toArray = function toArray() { + return this.stack; + }; -Object.defineProperty(exports, '__esModule', { value: true }); + Stack.prototype.push = function push(item) { + this.current = item; + this.stack.push(item); + }; -}); -enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'ember-metal'], function (exports, _emberUtils, _emberEnvironment, _emberMetal) { - 'use strict'; + Stack.prototype.pop = function pop() { + var item = this.stack.pop(); + var len = this.stack.length; + this.current = len === 0 ? null : this.stack[len - 1]; + return item === undefined ? null : item; + }; - exports.default = Container; - exports.buildFakeContainerWithDeprecations = buildFakeContainerWithDeprecations; + Stack.prototype.isEmpty = function isEmpty() { + return this.stack.length === 0; + }; - var CONTAINER_OVERRIDE = _emberUtils.symbol('CONTAINER_OVERRIDE'); + return Stack; + })(); - /** - 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 - objects. - - The public API for `Container` is still in flux and should not be considered - stable. - - @private - @class Container - */ + var ListNode = function ListNode(value) { + this.next = null; + this.prev = null; + this.value = value; + }; - function Container(registry, options) { - this.registry = registry; - this.owner = options && options.owner ? options.owner : null; - this.cache = _emberUtils.dictionary(options && options.cache ? options.cache : null); - this.factoryCache = _emberUtils.dictionary(options && options.factoryCache ? options.factoryCache : null); - this.validationCache = _emberUtils.dictionary(options && options.validationCache ? options.validationCache : null); - this._fakeContainerToInject = buildFakeContainerWithDeprecations(this); - this[CONTAINER_OVERRIDE] = undefined; - this.isDestroyed = false; - } + var LinkedList = (function () { + function LinkedList() { + this.clear(); + } - Container.prototype = { - /** - @private - @property owner - @type Object - */ - owner: null, + LinkedList.fromSlice = function fromSlice(slice) { + var list = new LinkedList(); + slice.forEachNode(function (n) { + return list.append(n.clone()); + }); + return list; + }; - /** - @private - @property registry - @type Registry - @since 1.11.0 - */ - registry: null, + LinkedList.prototype.head = function head() { + return this._head; + }; - /** - @private - @property cache - @type InheritingDict - */ - cache: null, + LinkedList.prototype.tail = function tail() { + return this._tail; + }; - /** - @private - @property factoryCache - @type InheritingDict - */ - factoryCache: null, + LinkedList.prototype.clear = function clear() { + this._head = this._tail = null; + }; - /** - @private - @property validationCache - @type InheritingDict - */ - validationCache: null, + LinkedList.prototype.isEmpty = function isEmpty() { + return this._head === null; + }; - /** - Given a fullName return a corresponding instance. - The default behaviour is for lookup to return a singleton instance. - The singleton is scoped to the container, allowing multiple containers - to all have their own locally scoped singletons. - ```javascript - let registry = new Registry(); - let container = registry.container(); - registry.register('api:twitter', Twitter); - let twitter = container.lookup('api:twitter'); - twitter instanceof Twitter; // => true - // by default the container will return singletons - let twitter2 = container.lookup('api:twitter'); - twitter2 instanceof Twitter; // => true - twitter === twitter2; //=> true - ``` - If singletons are not wanted, an optional flag can be provided at lookup. - ```javascript - let registry = new Registry(); - let container = registry.container(); - registry.register('api:twitter', Twitter); - let twitter = container.lookup('api:twitter', { singleton: false }); - let twitter2 = container.lookup('api:twitter', { singleton: false }); - twitter === twitter2; //=> false - ``` - @private - @method lookup - @param {String} fullName - @param {Object} [options] - @param {String} [options.source] The fullname of the request source (used for local lookup) - @return {any} - */ - lookup: function (fullName, options) { - _emberMetal.assert('fullName must be a proper full name', this.registry.validateFullName(fullName)); - return lookup(this, this.registry.normalize(fullName), options); - }, + LinkedList.prototype.toArray = function toArray() { + var out = []; + this.forEachNode(function (n) { + return out.push(n); + }); + return out; + }; - /** - Given a fullName, return the corresponding factory. - @private - @method lookupFactory - @param {String} fullName - @param {Object} [options] - @param {String} [options.source] The fullname of the request source (used for local lookup) - @return {any} - */ - lookupFactory: function (fullName, options) { - _emberMetal.assert('fullName must be a proper full name', this.registry.validateFullName(fullName)); - return factoryFor(this, this.registry.normalize(fullName), options); - }, + LinkedList.prototype.splice = function splice(start, end, reference) { + var before = undefined; + if (reference === null) { + before = this._tail; + this._tail = end; + } else { + before = reference.prev; + end.next = reference; + reference.prev = end; + } + if (before) { + before.next = start; + start.prev = before; + } + }; - /** - A depth first traversal, destroying the container, its descendant containers and all - their managed objects. - @private - @method destroy - */ - destroy: function () { - eachDestroyable(this, function (item) { - if (item.destroy) { - item.destroy(); - } - }); + LinkedList.prototype.nextNode = function nextNode(node) { + return node.next; + }; - this.isDestroyed = true; - }, + LinkedList.prototype.prevNode = function prevNode(node) { + return node.prev; + }; - /** - Clear either the entire cache or just the cache for a particular key. - @private - @method reset - @param {String} fullName optional key to reset; if missing, resets everything - */ - reset: function (fullName) { - if (arguments.length > 0) { - resetMember(this, this.registry.normalize(fullName)); - } else { - resetCache(this); - } - }, + LinkedList.prototype.forEachNode = function forEachNode(callback) { + var node = this._head; + while (node !== null) { + callback(node); + node = node.next; + } + }; - /** - Returns an object that can be used to provide an owner to a - manually created instance. - @private - @method ownerInjection - @returns { Object } - */ - ownerInjection: function () { - var _ref; + LinkedList.prototype.contains = function contains(needle) { + var node = this._head; + while (node !== null) { + if (node === needle) return true; + node = node.next; + } + return false; + }; - return _ref = {}, _ref[_emberUtils.OWNER] = this.owner, _ref; - } - }; + LinkedList.prototype.insertBefore = function insertBefore(node) { + var reference = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; - function isSingleton(container, fullName) { - return container.registry.getOption(fullName, 'singleton') !== false; - } + if (reference === null) return this.append(node); + if (reference.prev) reference.prev.next = node;else this._head = node; + node.prev = reference.prev; + node.next = reference; + reference.prev = node; + return node; + }; - function lookup(container, fullName) { - var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + LinkedList.prototype.append = function append(node) { + var tail = this._tail; + if (tail) { + tail.next = node; + node.prev = tail; + node.next = null; + } else { + this._head = node; + } + return this._tail = node; + }; - if (options.source) { - fullName = container.registry.expandLocalLookup(fullName, options); + LinkedList.prototype.pop = function pop() { + if (this._tail) return this.remove(this._tail); + return null; + }; - // if expandLocalLookup returns falsey, we do not support local lookup - if (!fullName) { - return; - } - } + LinkedList.prototype.prepend = function prepend(node) { + if (this._head) return this.insertBefore(node, this._head); + return this._head = this._tail = node; + }; - if (container.cache[fullName] !== undefined && options.singleton !== false) { - return container.cache[fullName]; - } + LinkedList.prototype.remove = function remove(node) { + if (node.prev) node.prev.next = node.next;else this._head = node.next; + if (node.next) node.next.prev = node.prev;else this._tail = node.prev; + return node; + }; - var value = instantiate(container, fullName); + return LinkedList; + })(); - if (value === undefined) { - return; - } + var ListSlice = (function () { + function ListSlice(head, tail) { + this._head = head; + this._tail = tail; + } - if (isSingleton(container, fullName) && options.singleton !== false) { - container.cache[fullName] = value; - } + ListSlice.toList = function toList(slice) { + var list = new LinkedList(); + slice.forEachNode(function (n) { + return list.append(n.clone()); + }); + return list; + }; - return value; - } + ListSlice.prototype.forEachNode = function forEachNode(callback) { + var node = this._head; + while (node !== null) { + callback(node); + node = this.nextNode(node); + } + }; - function markInjectionsAsDynamic(injections) { - injections._dynamic = true; - } + ListSlice.prototype.contains = function contains(needle) { + var node = this._head; + while (node !== null) { + if (node === needle) return true; + node = node.next; + } + return false; + }; - function areInjectionsDynamic(injections) { - return !!injections._dynamic; - } + ListSlice.prototype.head = function head() { + return this._head; + }; - function buildInjections() /* container, ...injections */{ - var hash = {}; + ListSlice.prototype.tail = function tail() { + return this._tail; + }; - if (arguments.length > 1) { - var container = arguments[0]; - var injections = []; - var injection = undefined; + ListSlice.prototype.toArray = function toArray() { + var out = []; + this.forEachNode(function (n) { + return out.push(n); + }); + return out; + }; - for (var i = 1; i < arguments.length; i++) { - if (arguments[i]) { - injections = injections.concat(arguments[i]); - } - } + ListSlice.prototype.nextNode = function nextNode(node) { + if (node === this._tail) return null; + return node.next; + }; - container.registry.validateInjections(injections); + ListSlice.prototype.prevNode = function prevNode(node) { + if (node === this._head) return null; + return node.prev; + }; - for (var i = 0; i < injections.length; i++) { - injection = injections[i]; - hash[injection.property] = lookup(container, injection.fullName); - if (!isSingleton(container, injection.fullName)) { - markInjectionsAsDynamic(hash); - } - } - } + ListSlice.prototype.isEmpty = function isEmpty() { + return false; + }; - return hash; - } + return ListSlice; + })(); - function factoryFor(container, fullName) { - var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + var EMPTY_SLICE = new ListSlice(null, null); - var registry = container.registry; + var HAS_TYPED_ARRAYS = typeof Uint32Array !== 'undefined'; + var A = undefined; + if (HAS_TYPED_ARRAYS) { + A = Uint32Array; + } else { + A = Array; + } + var A$1 = A; - if (options.source) { - fullName = registry.expandLocalLookup(fullName, options); + var HAS_NATIVE_WEAKMAP = (function () { + // detect if `WeakMap` is even present + var hasWeakMap = typeof WeakMap === 'function'; + if (!hasWeakMap) { + return false; + } + var instance = new WeakMap(); + // use `Object`'s `.toString` directly to prevent us from detecting + // polyfills as native weakmaps + return Object.prototype.toString.call(instance) === '[object WeakMap]'; + })(); - // if expandLocalLookup returns falsey, we do not support local lookup - if (!fullName) { - return; - } - } + exports.getAttrNamespace = getAttrNamespace; + exports.assert = debugAssert; + exports.LOGGER = logger; + exports.Logger = Logger; + exports.LogLevel = LogLevel; + exports.assign = assign; + exports.fillNulls = fillNulls; + exports.ensureGuid = ensureGuid; + exports.initializeGuid = initializeGuid; + exports.Stack = Stack; + exports.DictSet = DictSet; + exports.dict = dict; + exports.EMPTY_SLICE = EMPTY_SLICE; + exports.LinkedList = LinkedList; + exports.ListNode = ListNode; + exports.ListSlice = ListSlice; + exports.A = A$1; + exports.HAS_NATIVE_WEAKMAP = HAS_NATIVE_WEAKMAP; + exports.unwrap = unwrap; + exports.expect = expect; + exports.unreachable = unreachable; +}); +enifed('@glimmer/wire-format', ['exports'], function (exports) { + 'use strict'; - var cache = container.factoryCache; - if (cache[fullName]) { - return cache[fullName]; - } - var factory = registry.resolve(fullName); - if (factory === undefined) { - return; + function is(variant) { + return function (value) { + return value[0] === variant; + }; } + var Expressions; + (function (Expressions) { + Expressions.isUnknown = is('unknown'); + Expressions.isArg = is('arg'); + Expressions.isGet = is('get'); + Expressions.isConcat = is('concat'); + Expressions.isHelper = is('helper'); + Expressions.isHasBlock = is('has-block'); + Expressions.isHasBlockParams = is('has-block-params'); + Expressions.isUndefined = is('undefined'); + function isPrimitiveValue(value) { + if (value === null) { + return true; + } + return typeof value !== 'object'; + } + Expressions.isPrimitiveValue = isPrimitiveValue; + })(Expressions || (exports.Expressions = Expressions = {})); + var Statements; + (function (Statements) { + Statements.isText = is('text'); + Statements.isAppend = is('append'); + Statements.isComment = is('comment'); + Statements.isModifier = is('modifier'); + Statements.isBlock = is('block'); + Statements.isComponent = is('component'); + Statements.isOpenElement = is('open-element'); + Statements.isFlushElement = is('flush-element'); + Statements.isCloseElement = is('close-element'); + Statements.isStaticAttr = is('static-attr'); + Statements.isDynamicAttr = is('dynamic-attr'); + Statements.isYield = is('yield'); + Statements.isPartial = is('partial'); + Statements.isDynamicArg = is('dynamic-arg'); + Statements.isStaticArg = is('static-arg'); + Statements.isTrustingAttr = is('trusting-attr'); + Statements.isDebugger = is('debugger'); + function isAttribute(val) { + return val[0] === 'static-attr' || val[0] === 'dynamic-attr'; + } + Statements.isAttribute = isAttribute; + function isArgument(val) { + return val[0] === 'static-arg' || val[0] === 'dynamic-arg'; + } + Statements.isArgument = isArgument; + function isParameter(val) { + return isAttribute(val) || isArgument(val); + } + Statements.isParameter = isParameter; + function getParameterName(s) { + return s[1]; + } + Statements.getParameterName = getParameterName; + })(Statements || (exports.Statements = Statements = {})); - var type = fullName.split(':')[0]; - if (!factory || typeof factory.extend !== 'function' || !_emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS && type === 'model') { - if (factory && typeof factory._onLookup === 'function') { - factory._onLookup(fullName); - } + exports.is = is; + exports.Expressions = Expressions; + exports.Statements = Statements; +}); +enifed('backburner', ['exports'], function (exports) { 'use strict'; - // TODO: think about a 'safe' merge style extension - // for now just fallback to create time injection - cache[fullName] = factory; - return factory; - } else { - var injections = injectionsFor(container, fullName); - var factoryInjections = factoryInjectionsFor(container, fullName); - var cacheable = !areInjectionsDynamic(injections) && !areInjectionsDynamic(factoryInjections); +var NUMBER = /\d+/; - factoryInjections._toString = registry.makeToString(factory, fullName); +function each(collection, callback) { + for (var i = 0; i < collection.length; i++) { + callback(collection[i]); + } +} - var injectedFactory = factory.extend(injections); +function isString(suspect) { + return typeof suspect === 'string'; +} - // TODO - remove all `container` injections when Ember reaches v3.0.0 - injectDeprecatedContainer(injectedFactory.prototype, container); - injectedFactory.reopenClass(factoryInjections); +function isFunction(suspect) { + return typeof suspect === 'function'; +} - if (factory && typeof factory._onLookup === 'function') { - factory._onLookup(fullName); - } +function isNumber(suspect) { + return typeof suspect === 'number'; +} - if (cacheable) { - cache[fullName] = injectedFactory; - } +function isCoercableNumber(number) { + return isNumber(number) || NUMBER.test(number); +} - return injectedFactory; - } - } +function binarySearch(time, timers) { + var start = 0; + var end = timers.length - 2; + var middle, l; - function injectionsFor(container, fullName) { - var registry = container.registry; - var splitName = fullName.split(':'); - var type = splitName[0]; + while (start < end) { + // since timers is an array of pairs 'l' will always + // be an integer + l = (end - start) / 2; - var injections = buildInjections(container, registry.getTypeInjections(type), registry.getInjections(fullName)); - injections._debugContainerKey = fullName; - - _emberUtils.setOwner(injections, container.owner); + // compensate for the index in case even number + // of pairs inside timers + middle = start + l - (l % 2); - return injections; + if (time >= timers[middle]) { + start = middle + 2; + } else { + end = middle; + } } - function factoryInjectionsFor(container, fullName) { - var registry = container.registry; - var splitName = fullName.split(':'); - var type = splitName[0]; + return (time >= timers[start]) ? start + 2 : start; +} - var factoryInjections = buildInjections(container, registry.getFactoryTypeInjections(type), registry.getFactoryInjections(fullName)); - factoryInjections._debugContainerKey = fullName; +function Queue(name, options, globalOptions) { + this.name = name; + this.globalOptions = globalOptions || {}; + this.options = options; + this._queue = []; + this.targetQueues = {}; + this._queueBeingFlushed = undefined; +} - return factoryInjections; - } +Queue.prototype = { + push: function(target, method, args, stack) { + var queue = this._queue; + queue.push(target, method, args, stack); - function instantiate(container, fullName) { - var factory = factoryFor(container, fullName); - var lazyInjections = undefined, - validationCache = undefined; + return { + queue: this, + target: target, + method: method + }; + }, - if (container.registry.getOption(fullName, 'instantiate') === false) { - return factory; - } + pushUniqueWithoutGuid: function(target, method, args, stack) { + var queue = this._queue; - if (factory) { - if (typeof factory.create !== 'function') { - throw new Error('Failed to create an instance of \'' + fullName + '\'. Most likely an improperly defined class or' + ' an invalid module export.'); + for (var i = 0, l = queue.length; i < l; i += 4) { + var currentTarget = queue[i]; + var currentMethod = queue[i+1]; + + if (currentTarget === target && currentMethod === method) { + queue[i+2] = args; // replace args + queue[i+3] = stack; // replace stack + return; } + } - validationCache = container.validationCache; + queue.push(target, method, args, stack); + }, - _emberMetal.runInDebug(function () { - // Ensure that all lazy injections are valid at instantiation time - if (!validationCache[fullName] && typeof factory._lazyInjections === 'function') { - lazyInjections = factory._lazyInjections(); - lazyInjections = container.registry.normalizeInjectionsHash(lazyInjections); + targetQueue: function(targetQueue, target, method, args, stack) { + var queue = this._queue; - container.registry.validateInjections(lazyInjections); - } - }); + for (var i = 0, l = targetQueue.length; i < l; i += 2) { + var currentMethod = targetQueue[i]; + var currentIndex = targetQueue[i + 1]; - validationCache[fullName] = true; + if (currentMethod === method) { + queue[currentIndex + 2] = args; // replace args + queue[currentIndex + 3] = stack; // replace stack + return; + } + } - var obj = undefined; + targetQueue.push( + method, + queue.push(target, method, args, stack) - 4 + ); + }, - if (typeof factory.extend === 'function') { - // assume the factory was extendable and is already injected - obj = factory.create(); - } else { - // assume the factory was extendable - // to create time injections - // TODO: support new'ing for instantiation and merge injections for pure JS Functions - var injections = injectionsFor(container, fullName); + pushUniqueWithGuid: function(guid, target, method, args, stack) { + var hasLocalQueue = this.targetQueues[guid]; - // Ensure that a container is available to an object during instantiation. - // TODO - remove when Ember reaches v3.0.0 - // This "fake" container will be replaced after instantiation with a - // property that raises deprecations every time it is accessed. - injections.container = container._fakeContainerToInject; - obj = factory.create(injections); + if (hasLocalQueue) { + this.targetQueue(hasLocalQueue, target, method, args, stack); + } else { + this.targetQueues[guid] = [ + method, + this._queue.push(target, method, args, stack) - 4 + ]; + } - // TODO - remove when Ember reaches v3.0.0 - if (!Object.isFrozen(obj) && 'container' in obj) { - injectDeprecatedContainer(obj, container); - } - } + return { + queue: this, + target: target, + method: method + }; + }, - return obj; + pushUnique: function(target, method, args, stack) { + var KEY = this.globalOptions.GUID_KEY; + + if (target && KEY) { + var guid = target[KEY]; + if (guid) { + return this.pushUniqueWithGuid(guid, target, method, args, stack); + } } - } - // TODO - remove when Ember reaches v3.0.0 - function injectDeprecatedContainer(object, container) { - Object.defineProperty(object, 'container', { - configurable: true, - enumerable: false, - get: function () { - _emberMetal.deprecate('Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.', false, { id: 'ember-application.injected-container', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_injected-container-access' }); - return this[CONTAINER_OVERRIDE] || container; - }, + this.pushUniqueWithoutGuid(target, method, args, stack); - set: function (value) { - _emberMetal.deprecate('Providing the `container` property to ' + this + ' is deprecated. Please use `Ember.setOwner` or `owner.ownerInjection()` instead to provide an owner to the instance being created.', false, { id: 'ember-application.injected-container', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_injected-container-access' }); + return { + queue: this, + target: target, + method: method + }; + }, - this[CONTAINER_OVERRIDE] = value; + invoke: function(target, method, args /*, onError, errorRecordedForStack */) { + if (args && args.length > 0) { + method.apply(target, args); + } else { + method.call(target); + } + }, - return value; + invokeWithOnError: function(target, method, args, onError, errorRecordedForStack) { + try { + if (args && args.length > 0) { + method.apply(target, args); + } else { + method.call(target); } - }); - } - - function eachDestroyable(container, callback) { - var cache = container.cache; - var keys = Object.keys(cache); + } catch(error) { + onError(error, errorRecordedForStack); + } + }, - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var value = cache[key]; + flush: function(sync) { + var queue = this._queue; + var length = queue.length; - if (container.registry.getOption(key, 'instantiate') !== false) { - callback(value); - } + if (length === 0) { + return; } - } - function resetCache(container) { - eachDestroyable(container, function (value) { - if (value.destroy) { - value.destroy(); - } - }); + var globalOptions = this.globalOptions; + var options = this.options; + var before = options && options.before; + var after = options && options.after; + var onError = globalOptions.onError || (globalOptions.onErrorTarget && + globalOptions.onErrorTarget[globalOptions.onErrorMethod]); + var target, method, args, errorRecordedForStack; + var invoke = onError ? this.invokeWithOnError : this.invoke; - container.cache.dict = _emberUtils.dictionary(null); - } + this.targetQueues = Object.create(null); + var queueItems = this._queueBeingFlushed = this._queue.slice(); + this._queue = []; - function resetMember(container, fullName) { - var member = container.cache[fullName]; + if (before) { + before(); + } - delete container.factoryCache[fullName]; + for (var i = 0; i < length; i += 4) { + target = queueItems[i]; + method = queueItems[i+1]; + args = queueItems[i+2]; + errorRecordedForStack = queueItems[i+3]; // Debugging assistance - if (member) { - delete container.cache[fullName]; + if (isString(method)) { + method = target[method]; + } - if (member.destroy) { - member.destroy(); + // method could have been nullified / canceled during flush + if (method) { + // + // ** Attention intrepid developer ** + // + // To find out the stack of this task when it was scheduled onto + // the run loop, add the following to your app.js: + // + // Ember.run.backburner.DEBUG = true; // NOTE: This slows your app, don't leave it on in production. + // + // Once that is in place, when you are at a breakpoint and navigate + // here in the stack explorer, you can look at `errorRecordedForStack.stack`, + // which will be the captured stack when this job was scheduled. + // + // One possible long-term solution is the following Chrome issue: + // https://bugs.chromium.org/p/chromium/issues/detail?id=332624 + // + invoke(target, method, args, onError, errorRecordedForStack); } } - } - - function buildFakeContainerWithDeprecations(container) { - var fakeContainer = {}; - var propertyMappings = { - lookup: 'lookup', - lookupFactory: '_lookupFactory' - }; - for (var containerProperty in propertyMappings) { - fakeContainer[containerProperty] = buildFakeContainerFunction(container, containerProperty, propertyMappings[containerProperty]); + if (after) { + after(); } - return fakeContainer; - } + this._queueBeingFlushed = undefined; - function buildFakeContainerFunction(container, containerProperty, ownerProperty) { - return function () { - _emberMetal.deprecate('Using the injected `container` is deprecated. Please use the `getOwner` helper to access the owner of this object and then call `' + ownerProperty + '` instead.', false, { - id: 'ember-application.injected-container', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x#toc_injected-container-access' - }); - return container[containerProperty].apply(container, arguments); - }; - } -}); -enifed('container/index', ['exports', 'container/registry', 'container/container'], function (exports, _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 - */ + if (sync !== false && + this._queue.length > 0) { + // check if new items have been added + this.flush(true); + } + }, - 'use strict'; + cancel: function(actionToCancel) { + var queue = this._queue, currentTarget, currentMethod, i, l; + var target = actionToCancel.target; + var method = actionToCancel.method; + var GUID_KEY = this.globalOptions.GUID_KEY; - exports.Registry = _containerRegistry.default; - exports.privatize = _containerRegistry.privatize; - exports.Container = _containerContainer.default; - exports.buildFakeContainerWithDeprecations = _containerContainer.buildFakeContainerWithDeprecations; -}); -enifed('container/registry', ['exports', 'ember-utils', 'ember-metal', 'container/container'], function (exports, _emberUtils, _emberMetal, _containerContainer) { - 'use strict'; + if (GUID_KEY && this.targetQueues && target) { + var targetQueue = this.targetQueues[target[GUID_KEY]]; - exports.default = Registry; - exports.privatize = privatize; + if (targetQueue) { + for (i = 0, l = targetQueue.length; i < l; i++) { + if (targetQueue[i] === method) { + targetQueue.splice(i, 1); + } + } + } + } - var VALID_FULL_NAME_REGEXP = /^[^:]+:[^:]+$/; + for (i = 0, l = queue.length; i < l; i += 4) { + currentTarget = queue[i]; + currentMethod = queue[i+1]; - /** - A registry used to store factory and option information keyed - by type. - - A `Registry` stores the factory and option information needed by a - `Container` to instantiate and cache objects. - - The API for `Registry` is still in flux and should not be considered stable. - - @private - @class Registry - @since 1.11.0 - */ + if (currentTarget === target && + currentMethod === method) { + queue.splice(i, 4); + return true; + } + } - function Registry(options) { - this.fallback = options && options.fallback ? options.fallback : null; + // if not found in current queue + // could be in the queue that is being flushed + queue = this._queueBeingFlushed; - if (options && options.resolver) { - this.resolver = options.resolver; + if (!queue) { + return; + } - if (typeof this.resolver === 'function') { - deprecateResolverFunction(this); + for (i = 0, l = queue.length; i < l; i += 4) { + currentTarget = queue[i]; + currentMethod = queue[i+1]; + + if (currentTarget === target && + currentMethod === method) { + // don't mess with array during flush + // just nullify the method + queue[i+1] = null; + return true; } } + } +}; - this.registrations = _emberUtils.dictionary(options && options.registrations ? options.registrations : null); +function DeferredActionQueues(queueNames, options) { + var queues = this.queues = {}; + this.queueNames = queueNames = queueNames || []; - this._typeInjections = _emberUtils.dictionary(null); - this._injections = _emberUtils.dictionary(null); - this._factoryTypeInjections = _emberUtils.dictionary(null); - this._factoryInjections = _emberUtils.dictionary(null); + this.options = options; - this._localLookupCache = new _emberUtils.EmptyObject(); - this._normalizeCache = _emberUtils.dictionary(null); - this._resolveCache = _emberUtils.dictionary(null); - this._failCache = _emberUtils.dictionary(null); + each(queueNames, function(queueName) { + queues[queueName] = new Queue(queueName, options[queueName], options); + }); +} - this._options = _emberUtils.dictionary(null); - this._typeOptions = _emberUtils.dictionary(null); - } +function noSuchQueue(name) { + throw new Error('You attempted to schedule an action in a queue (' + name + ') that doesn\'t exist'); +} - Registry.prototype = { - /** - A backup registry for resolving registrations when no matches can be found. - @private - @property fallback - @type Registry - */ - fallback: null, +function noSuchMethod(name) { + throw new Error('You attempted to schedule an action in a queue (' + name + ') for a method that doesn\'t exist'); +} - /** - An object that has a `resolve` method that resolves a name. - @private - @property resolver - @type Resolver - */ - resolver: null, +DeferredActionQueues.prototype = { + schedule: function(name, target, method, args, onceFlag, stack) { + var queues = this.queues; + var queue = queues[name]; - /** - @private - @property registrations - @type InheritingDict - */ - registrations: null, + if (!queue) { + noSuchQueue(name); + } - /** - @private - @property _typeInjections - @type InheritingDict - */ - _typeInjections: null, + if (!method) { + noSuchMethod(name); + } - /** - @private - @property _injections - @type InheritingDict - */ - _injections: null, + if (onceFlag) { + return queue.pushUnique(target, method, args, stack); + } else { + return queue.push(target, method, args, stack); + } + }, - /** - @private - @property _factoryTypeInjections - @type InheritingDict - */ - _factoryTypeInjections: null, + flush: function() { + var queues = this.queues; + var queueNames = this.queueNames; + var queueName, queue; + var queueNameIndex = 0; + var numberOfQueues = queueNames.length; - /** - @private - @property _factoryInjections - @type InheritingDict - */ - _factoryInjections: null, + while (queueNameIndex < numberOfQueues) { + queueName = queueNames[queueNameIndex]; + queue = queues[queueName]; - /** - @private - @property _normalizeCache - @type InheritingDict - */ - _normalizeCache: null, + var numberOfQueueItems = queue._queue.length; - /** - @private - @property _resolveCache - @type InheritingDict - */ - _resolveCache: null, + if (numberOfQueueItems === 0) { + queueNameIndex++; + } else { + queue.flush(false /* async */); + queueNameIndex = 0; + } + } + } +}; - /** - @private - @property _options - @type InheritingDict - */ - _options: null, +function Backburner(queueNames, options) { + this.queueNames = queueNames; + this.options = options || {}; + if (!this.options.defaultQueue) { + this.options.defaultQueue = queueNames[0]; + } + this.instanceStack = []; + this._debouncees = []; + this._throttlers = []; + this._eventCallbacks = { + end: [], + begin: [] + }; - /** - @private - @property _typeOptions - @type InheritingDict - */ - _typeOptions: null, + var _this = this; + this._boundClearItems = function() { + clearItems(); + }; - /** - Creates a container based on this registry. - @private - @method container - @param {Object} options - @return {Container} created container - */ - container: function (options) { - return new _containerContainer.default(this, options); - }, + this._timerTimeoutId = undefined; + this._timers = []; - /** - Registers a factory for later injection. - Example: - ```javascript - let registry = new Registry(); - registry.register('model:user', Person, {singleton: false }); - registry.register('fruit:favorite', Orange); - registry.register('communication:main', Email, {singleton: false}); - ``` - @private - @method register - @param {String} fullName - @param {Function} factory - @param {Object} options - */ - register: function (fullName, factory) { - var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; - - _emberMetal.assert('fullName must be a proper full name', this.validateFullName(fullName)); - - if (factory === undefined) { - throw new TypeError('Attempting to register an unknown factory: \'' + fullName + '\''); - } - - var normalizedName = this.normalize(fullName); + this._platform = this.options._platform || { + setTimeout: function (fn, ms) { + return setTimeout(fn, ms); + }, + clearTimeout: function (id) { + clearTimeout(id); + } + }; - if (this._resolveCache[normalizedName]) { - throw new Error('Cannot re-register: \'' + fullName + '\', as it has already been resolved.'); - } + this._boundRunExpiredTimers = function () { + _this._runExpiredTimers(); + }; +} - delete this._failCache[normalizedName]; - this.registrations[normalizedName] = factory; - this._options[normalizedName] = options; - }, +Backburner.prototype = { + begin: function() { + var options = this.options; + var onBegin = options && options.onBegin; + var previousInstance = this.currentInstance; - /** - Unregister a fullName - ```javascript - let registry = new Registry(); - registry.register('model:user', User); - registry.resolve('model:user').create() instanceof User //=> true - registry.unregister('model:user') - registry.resolve('model:user') === undefined //=> true - ``` - @private - @method unregister - @param {String} fullName - */ - unregister: function (fullName) { - _emberMetal.assert('fullName must be a proper full name', this.validateFullName(fullName)); + if (previousInstance) { + this.instanceStack.push(previousInstance); + } - var normalizedName = this.normalize(fullName); + this.currentInstance = new DeferredActionQueues(this.queueNames, options); + this._trigger('begin', this.currentInstance, previousInstance); + if (onBegin) { + onBegin(this.currentInstance, previousInstance); + } + }, - this._localLookupCache = new _emberUtils.EmptyObject(); + end: function() { + var options = this.options; + var onEnd = options && options.onEnd; + var currentInstance = this.currentInstance; + var nextInstance = null; - delete this.registrations[normalizedName]; - delete this._resolveCache[normalizedName]; - delete this._failCache[normalizedName]; - delete this._options[normalizedName]; - }, + // Prevent double-finally bug in Safari 6.0.2 and iOS 6 + // This bug appears to be resolved in Safari 6.0.5 and iOS 7 + var finallyAlreadyCalled = false; + try { + currentInstance.flush(); + } finally { + if (!finallyAlreadyCalled) { + finallyAlreadyCalled = true; - /** - Given a fullName return the corresponding factory. - By default `resolve` will retrieve the factory from - the registry. - ```javascript - let registry = new Registry(); - registry.register('api:twitter', Twitter); - registry.resolve('api:twitter') // => Twitter - ``` - Optionally the registry can be provided with a custom resolver. - If provided, `resolve` will first provide the custom resolver - the opportunity to resolve the fullName, otherwise it will fallback - to the registry. - ```javascript - let registry = new Registry(); - registry.resolver = function(fullName) { - // lookup via the module system of choice - }; - // the twitter factory is added to the module system - registry.resolve('api:twitter') // => Twitter - ``` - @private - @method resolve - @param {String} fullName - @param {Object} [options] - @param {String} [options.source] the fullname of the request source (used for local lookups) - @return {Function} fullName's factory - */ - resolve: function (fullName, options) { - _emberMetal.assert('fullName must be a proper full name', this.validateFullName(fullName)); - var factory = resolve(this, this.normalize(fullName), options); - if (factory === undefined && this.fallback) { - var _fallback; + this.currentInstance = null; - factory = (_fallback = this.fallback).resolve.apply(_fallback, arguments); + if (this.instanceStack.length) { + nextInstance = this.instanceStack.pop(); + this.currentInstance = nextInstance; + } + this._trigger('end', currentInstance, nextInstance); + if (onEnd) { + onEnd(currentInstance, nextInstance); + } } - return factory; - }, + } + }, - /** - A hook that can be used to describe how the resolver will - attempt to find the factory. - For example, the default Ember `.describe` returns the full - class name (including namespace) where Ember's resolver expects - to find the `fullName`. - @private - @method describe - @param {String} fullName - @return {string} described fullName - */ - describe: function (fullName) { - if (this.resolver && this.resolver.lookupDescription) { - return this.resolver.lookupDescription(fullName); - } else if (this.fallback) { - return this.fallback.describe(fullName); - } else { - return fullName; - } - }, + /** + 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. - /** - A hook to enable custom fullName normalization behaviour - @private - @method normalizeFullName - @param {String} fullName - @return {string} normalized fullName - */ - normalizeFullName: function (fullName) { - if (this.resolver && this.resolver.normalize) { - return this.resolver.normalize(fullName); - } else if (this.fallback) { - return this.fallback.normalizeFullName(fullName); - } else { - return fullName; + @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); } - }, + } + }, - /** - Normalize a fullName based on the application's conventions - @private - @method normalize - @param {String} fullName - @return {string} normalized fullName - */ - normalize: function (fullName) { - return this._normalizeCache[fullName] || (this._normalizeCache[fullName] = this.normalizeFullName(fullName)); - }, + 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'); + } + }, - /** - @method makeToString - @private - @param {any} factory - @param {string} fullName - @return {function} toString function - */ - makeToString: function (factory, fullName) { - if (this.resolver && this.resolver.makeToString) { - return this.resolver.makeToString(factory, fullName); - } else if (this.fallback) { - return this.fallback.makeToString(factory, fullName); - } else { - return factory.toString(); + 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--; + } + } } - }, - - /** - Given a fullName check if the container is aware of its factory - or singleton instance. - @private - @method has - @param {String} fullName - @param {Object} [options] - @param {String} [options.source] the fullname of the request source (used for local lookups) - @return {Boolean} - */ - has: function (fullName, options) { - if (!this.isValidFullName(fullName)) { - return false; + 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'); + } + }, - var source = options && options.source && this.normalize(options.source); + run: function(/* target, method, args */) { + var length = arguments.length; + var method, target, args; - return has(this, this.normalize(fullName), source); - }, + if (length === 1) { + method = arguments[0]; + target = null; + } else { + target = arguments[0]; + method = arguments[1]; + } - /** - Allow registering options for all factories of a type. - ```javascript - let registry = new Registry(); - let container = registry.container(); - // if all of type `connection` must not be singletons - registry.optionsForType('connection', { singleton: false }); - registry.register('connection:twitter', TwitterConnection); - registry.register('connection:facebook', FacebookConnection); - let twitter = container.lookup('connection:twitter'); - let twitter2 = container.lookup('connection:twitter'); - twitter === twitter2; // => false - let facebook = container.lookup('connection:facebook'); - let facebook2 = container.lookup('connection:facebook'); - facebook === facebook2; // => false - ``` - @private - @method optionsForType - @param {String} type - @param {Object} options - */ - optionsForType: function (type, options) { - this._typeOptions[type] = options; - }, + if (isString(method)) { + method = target[method]; + } - getOptionsForType: function (type) { - var optionsForType = this._typeOptions[type]; - if (optionsForType === undefined && this.fallback) { - optionsForType = this.fallback.getOptionsForType(type); + if (length > 2) { + args = new Array(length - 2); + for (var i = 0, l = length - 2; i < l; i++) { + args[i] = arguments[i + 2]; } - return optionsForType; - }, + } else { + args = []; + } - /** - @private - @method options - @param {String} fullName - @param {Object} options - */ - options: function (fullName) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + var onError = getOnError(this.options); - var normalizedName = this.normalize(fullName); - this._options[normalizedName] = options; - }, + this.begin(); - getOptions: function (fullName) { - var normalizedName = this.normalize(fullName); - var options = this._options[normalizedName]; + // guard against Safari 6's double-finally bug + var didFinally = false; - if (options === undefined && this.fallback) { - options = this.fallback.getOptions(fullName); + if (onError) { + try { + return method.apply(target, args); + } catch(error) { + onError(error); + } finally { + if (!didFinally) { + didFinally = true; + this.end(); + } } - return options; - }, - - getOption: function (fullName, optionName) { - var options = this._options[fullName]; - - if (options && options[optionName] !== undefined) { - return options[optionName]; + } else { + try { + return method.apply(target, args); + } finally { + if (!didFinally) { + didFinally = true; + this.end(); + } } + } + }, - var type = fullName.split(':')[0]; - options = this._typeOptions[type]; - - if (options && options[optionName] !== undefined) { - return options[optionName]; - } else if (this.fallback) { - return this.fallback.getOption(fullName, optionName); - } - }, + /* + Join the passed method with an existing queue and execute immediately, + if there isn't one use `Backburner#run`. - /** - 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. - For example, provided each object of type `controller` needed a `router`. - one would do the following: - ```javascript - let registry = new Registry(); - let container = registry.container(); - registry.register('router:main', Router); - registry.register('controller:user', UserController); - registry.register('controller:post', PostController); - registry.typeInjection('controller', 'router', 'router:main'); - let user = container.lookup('controller:user'); - let post = container.lookup('controller:post'); - user.router instanceof Router; //=> true - post.router instanceof Router; //=> true - // both controllers share the same router - user.router === post.router; //=> true - ``` - @private - @method typeInjection - @param {String} type - @param {String} property - @param {String} fullName - */ - typeInjection: function (type, property, fullName) { - _emberMetal.assert('fullName must be a proper full name', this.validateFullName(fullName)); + The join method is like the run method except that it will schedule into + an existing queue if one already exists. In either case, the join method will + immediately execute the passed in function and return its result. - var fullNameType = fullName.split(':')[0]; - if (fullNameType === type) { - throw new Error('Cannot inject a \'' + fullName + '\' on other ' + type + '(s).'); - } + @method join + @param {Object} target + @param {Function} method The method to be executed + @param {any} args The method arguments + @return method result + */ + join: function(/* target, method, args */) { + if (!this.currentInstance) { + return this.run.apply(this, arguments); + } - var injections = this._typeInjections[type] || (this._typeInjections[type] = []); + var length = arguments.length; + var method, target; - injections.push({ - property: property, - fullName: fullName - }); - }, + if (length === 1) { + method = arguments[0]; + target = null; + } else { + target = arguments[0]; + method = arguments[1]; + } - /** - Defines injection rules. - These rules are used to inject dependencies onto objects when they - are instantiated. - Two forms of injections are possible: - * Injecting one fullName on another fullName - * Injecting one fullName on a type - Example: - ```javascript - let registry = new Registry(); - let container = registry.container(); - registry.register('source:main', Source); - registry.register('model:user', User); - registry.register('model:post', Post); - // injecting one fullName on another fullName - // eg. each user model gets a post model - registry.injection('model:user', 'post', 'model:post'); - // injecting one fullName on another type - registry.injection('model', 'source', 'source:main'); - let user = container.lookup('model:user'); - let post = container.lookup('model:post'); - user.source instanceof Source; //=> true - post.source instanceof Source; //=> true - user.post instanceof Post; //=> true - // and both models share the same source - user.source === post.source; //=> true - ``` - @private - @method injection - @param {String} factoryName - @param {String} property - @param {String} injectionName - */ - injection: function (fullName, property, injectionName) { - this.validateFullName(injectionName); - var normalizedInjectionName = this.normalize(injectionName); + if (isString(method)) { + method = target[method]; + } - if (fullName.indexOf(':') === -1) { - return this.typeInjection(fullName, property, normalizedInjectionName); + if (length === 1) { + return method(); + } else if (length === 2) { + return method.call(target); + } else { + var args = new Array(length - 2); + for (var i = 0, l = length - 2; i < l; i++) { + args[i] = arguments[i + 2]; } + return method.apply(target, args); + } + }, - _emberMetal.assert('fullName must be a proper full name', this.validateFullName(fullName)); - var normalizedName = this.normalize(fullName); - var injections = this._injections[normalizedName] || (this._injections[normalizedName] = []); + /* + Defer the passed function to run inside the specified queue. - injections.push({ - property: property, - fullName: normalizedInjectionName - }); - }, + @method defer + @param {String} queueName + @param {Object} target + @param {Function|String} method The method or method name to be executed + @param {any} args The method arguments + @return method result + */ + defer: function(queueName /* , target, method, args */) { + var length = arguments.length; + var method, target, args; - /** - Used only via `factoryInjection`. - Provides a specialized form of injection, specifically enabling - all factory of one type to be injected with a reference to another - object. - For example, provided each factory of type `model` needed a `store`. - one would do the following: - ```javascript - let registry = new Registry(); - registry.register('store:main', SomeStore); - registry.factoryTypeInjection('model', 'store', 'store:main'); - let store = registry.lookup('store:main'); - let UserFactory = registry.lookupFactory('model:user'); - UserFactory.store instanceof SomeStore; //=> true - ``` - @private - @method factoryTypeInjection - @param {String} type - @param {String} property - @param {String} fullName - */ - factoryTypeInjection: function (type, property, fullName) { - var injections = this._factoryTypeInjections[type] || (this._factoryTypeInjections[type] = []); - - injections.push({ - property: property, - fullName: this.normalize(fullName) - }); - }, + if (length === 2) { + method = arguments[1]; + target = null; + } else { + target = arguments[1]; + method = arguments[2]; + } - /** - Defines factory injection rules. - Similar to regular injection rules, but are run against factories, via - `Registry#lookupFactory`. - These rules are used to inject objects onto factories when they - are looked up. - Two forms of injections are possible: - * Injecting one fullName on another fullName - * Injecting one fullName on a type - Example: - ```javascript - let registry = new Registry(); - let container = registry.container(); - registry.register('store:main', Store); - registry.register('store:secondary', OtherStore); - registry.register('model:user', User); - registry.register('model:post', Post); - // injecting one fullName on another type - registry.factoryInjection('model', 'store', 'store:main'); - // injecting one fullName on another fullName - registry.factoryInjection('model:post', 'secondaryStore', 'store:secondary'); - let UserFactory = container.lookupFactory('model:user'); - let PostFactory = container.lookupFactory('model:post'); - let store = container.lookup('store:main'); - UserFactory.store instanceof Store; //=> true - UserFactory.secondaryStore instanceof OtherStore; //=> false - PostFactory.store instanceof Store; //=> true - PostFactory.secondaryStore instanceof OtherStore; //=> true - // and both models share the same source instance - UserFactory.store === PostFactory.store; //=> true - ``` - @private - @method factoryInjection - @param {String} factoryName - @param {String} property - @param {String} injectionName - */ - factoryInjection: function (fullName, property, injectionName) { - var normalizedName = this.normalize(fullName); - var normalizedInjectionName = this.normalize(injectionName); + if (isString(method)) { + method = target[method]; + } - this.validateFullName(injectionName); + var stack = this.DEBUG ? new Error() : undefined; - if (fullName.indexOf(':') === -1) { - return this.factoryTypeInjection(normalizedName, property, normalizedInjectionName); + if (length > 3) { + args = new Array(length - 3); + for (var i = 3; i < length; i++) { + args[i-3] = arguments[i]; } + } else { + args = undefined; + } - var injections = this._factoryInjections[normalizedName] || (this._factoryInjections[normalizedName] = []); + if (!this.currentInstance) { createAutorun(this); } + return this.currentInstance.schedule(queueName, target, method, args, false, stack); + }, - injections.push({ - property: property, - fullName: normalizedInjectionName - }); - }, + deferOnce: function(queueName /* , target, method, args */) { + var length = arguments.length; + var method, target, args; - /** - @private - @method knownForType - @param {String} type the type to iterate over - */ - knownForType: function (type) { - var fallbackKnown = undefined, - resolverKnown = undefined; + if (length === 2) { + method = arguments[1]; + target = null; + } else { + target = arguments[1]; + method = arguments[2]; + } - var localKnown = _emberUtils.dictionary(null); - var registeredNames = Object.keys(this.registrations); - for (var index = 0; index < registeredNames.length; index++) { - var fullName = registeredNames[index]; - var itemType = fullName.split(':')[0]; + if (isString(method)) { + method = target[method]; + } - if (itemType === type) { - localKnown[fullName] = true; - } - } + var stack = this.DEBUG ? new Error() : undefined; - if (this.fallback) { - fallbackKnown = this.fallback.knownForType(type); + if (length > 3) { + args = new Array(length - 3); + for (var i = 3; i < length; i++) { + args[i-3] = arguments[i]; } + } else { + args = undefined; + } - if (this.resolver && this.resolver.knownForType) { - resolverKnown = this.resolver.knownForType(type); - } + if (!this.currentInstance) { + createAutorun(this); + } + return this.currentInstance.schedule(queueName, target, method, args, true, stack); + }, - return _emberUtils.assign({}, fallbackKnown, localKnown, resolverKnown); - }, + setTimeout: function() { + var l = arguments.length; + var args = new Array(l); - validateFullName: function (fullName) { - if (!this.isValidFullName(fullName)) { - throw new TypeError('Invalid Fullname, expected: \'type:name\' got: ' + fullName); - } + for (var x = 0; x < l; x++) { + args[x] = arguments[x]; + } - return true; - }, + var length = args.length, + method, wait, target, + methodOrTarget, methodOrWait, methodOrArgs; - isValidFullName: function (fullName) { - return !!VALID_FULL_NAME_REGEXP.test(fullName); - }, + if (length === 0) { + return; + } else if (length === 1) { + method = args.shift(); + wait = 0; + } else if (length === 2) { + methodOrTarget = args[0]; + methodOrWait = args[1]; - validateInjections: function (injections) { - if (!injections) { - return; + if (isFunction(methodOrWait) || isFunction(methodOrTarget[methodOrWait])) { + target = args.shift(); + method = args.shift(); + wait = 0; + } else if (isCoercableNumber(methodOrWait)) { + method = args.shift(); + wait = args.shift(); + } else { + method = args.shift(); + wait = 0; } + } else { + var last = args[args.length - 1]; - var fullName = undefined; + if (isCoercableNumber(last)) { + wait = args.pop(); + } else { + wait = 0; + } - for (var i = 0; i < injections.length; i++) { - fullName = injections[i].fullName; + methodOrTarget = args[0]; + methodOrArgs = args[1]; - if (!this.has(fullName)) { - throw new Error('Attempting to inject an unknown injection: \'' + fullName + '\''); - } + if (isFunction(methodOrArgs) || (isString(methodOrArgs) && + methodOrTarget !== null && + methodOrArgs in methodOrTarget)) { + target = args.shift(); + method = args.shift(); + } else { + method = args.shift(); } - }, + } - normalizeInjectionsHash: function (hash) { - var injections = []; + var executeAt = Date.now() + parseInt(wait !== wait ? 0 : wait, 10); - for (var key in hash) { - if (hash.hasOwnProperty(key)) { - _emberMetal.assert('Expected a proper full name, given \'' + hash[key] + '\'', this.validateFullName(hash[key])); + if (isString(method)) { + method = target[method]; + } - injections.push({ - property: key, - fullName: hash[key] - }); + var onError = getOnError(this.options); + + function fn() { + if (onError) { + try { + method.apply(target, args); + } catch (e) { + onError(e); } + } else { + method.apply(target, args); } + } - return injections; - }, + return this._setTimeout(fn, executeAt); + }, - getInjections: function (fullName) { - var injections = this._injections[fullName] || []; - if (this.fallback) { - injections = injections.concat(this.fallback.getInjections(fullName)); - } - return injections; - }, + _setTimeout: function (fn, executeAt) { + if (this._timers.length === 0) { + this._timers.push(executeAt, fn); + this._installTimerTimeout(); + return fn; + } - getTypeInjections: function (type) { - var injections = this._typeInjections[type] || []; - if (this.fallback) { - injections = injections.concat(this.fallback.getTypeInjections(type)); - } - return injections; - }, + // find position to insert + var i = binarySearch(executeAt, this._timers); - getFactoryInjections: function (fullName) { - var injections = this._factoryInjections[fullName] || []; - if (this.fallback) { - injections = injections.concat(this.fallback.getFactoryInjections(fullName)); - } - return injections; - }, + this._timers.splice(i, 0, executeAt, fn); - getFactoryTypeInjections: function (type) { - var injections = this._factoryTypeInjections[type] || []; - if (this.fallback) { - injections = injections.concat(this.fallback.getFactoryTypeInjections(type)); - } - return injections; + // we should be the new earliest timer if i == 0 + if (i === 0) { + this._reinstallTimerTimeout(); } - }; - - function deprecateResolverFunction(registry) { - _emberMetal.deprecate('Passing a `resolver` function into a Registry is deprecated. Please pass in a Resolver object with a `resolve` method.', false, { id: 'ember-application.registry-resolver-as-function', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_registry-resolver-as-function' }); - registry.resolver = { - resolve: registry.resolver - }; - } - /** - Given a fullName and a source fullName returns the fully resolved - fullName. Used to allow for local lookup. - - ```javascript - let registry = new Registry(); - - // the twitter factory is added to the module system - registry.expandLocalLookup('component:post-title', { source: 'template:post' }) // => component:post/post-title - ``` - - @private - @method expandLocalLookup - @param {String} fullName - @param {Object} [options] - @param {String} [options.source] the fullname of the request source (used for local lookups) - @return {String} fullName - */ - Registry.prototype.expandLocalLookup = function Registry_expandLocalLookup(fullName, options) { - if (this.resolver && this.resolver.expandLocalLookup) { - _emberMetal.assert('fullName must be a proper full name', this.validateFullName(fullName)); - _emberMetal.assert('options.source must be provided to expandLocalLookup', options && options.source); - _emberMetal.assert('options.source must be a proper full name', this.validateFullName(options.source)); + return fn; + }, - var normalizedFullName = this.normalize(fullName); - var normalizedSource = this.normalize(options.source); + throttle: function(target, method /* , args, wait, [immediate] */) { + var backburner = this; + var args = new Array(arguments.length); + for (var i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + var immediate = args.pop(); + var wait, throttler, index, timer; - return expandLocalLookup(this, normalizedFullName, normalizedSource); - } else if (this.fallback) { - return this.fallback.expandLocalLookup(fullName, options); + if (isNumber(immediate) || isString(immediate)) { + wait = immediate; + immediate = true; } else { - return null; + wait = args.pop(); } - }; - function expandLocalLookup(registry, normalizedName, normalizedSource) { - var cache = registry._localLookupCache; - var normalizedNameCache = cache[normalizedName]; + wait = parseInt(wait, 10); - if (!normalizedNameCache) { - normalizedNameCache = cache[normalizedName] = new _emberUtils.EmptyObject(); - } + index = findThrottler(target, method, this._throttlers); + if (index > -1) { return this._throttlers[index]; } // throttled - var cached = normalizedNameCache[normalizedSource]; + timer = this._platform.setTimeout(function() { + if (!immediate) { + backburner.run.apply(backburner, args); + } + var index = findThrottler(target, method, backburner._throttlers); + if (index > -1) { + backburner._throttlers.splice(index, 1); + } + }, wait); - if (cached !== undefined) { - return cached; + if (immediate) { + this.run.apply(this, args); } - var expanded = registry.resolver.expandLocalLookup(normalizedName, normalizedSource); + throttler = [target, method, timer]; - return normalizedNameCache[normalizedSource] = expanded; - } + this._throttlers.push(throttler); - function resolve(registry, normalizedName, options) { - if (options && options.source) { - // when `source` is provided expand normalizedName - // and source into the full normalizedName - normalizedName = registry.expandLocalLookup(normalizedName, options); + return throttler; + }, - // if expandLocalLookup returns falsey, we do not support local lookup - if (!normalizedName) { - return; - } + debounce: function(target, method /* , args, wait, [immediate] */) { + var backburner = this; + var args = new Array(arguments.length); + for (var i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; } - var cached = registry._resolveCache[normalizedName]; - if (cached !== undefined) { - return cached; + var immediate = args.pop(); + var wait, index, debouncee, timer; + + if (isNumber(immediate) || isString(immediate)) { + wait = immediate; + immediate = false; + } else { + wait = args.pop(); } - if (registry._failCache[normalizedName]) { - return; + + wait = parseInt(wait, 10); + // Remove debouncee + index = findDebouncee(target, method, this._debouncees); + + if (index > -1) { + debouncee = this._debouncees[index]; + this._debouncees.splice(index, 1); + this._platform.clearTimeout(debouncee[2]); } - var resolved = undefined; + timer = this._platform.setTimeout(function() { + if (!immediate) { + backburner.run.apply(backburner, args); + } + var index = findDebouncee(target, method, backburner._debouncees); + if (index > -1) { + backburner._debouncees.splice(index, 1); + } + }, wait); - if (registry.resolver) { - resolved = registry.resolver.resolve(normalizedName); + if (immediate && index === -1) { + backburner.run.apply(backburner, args); } - if (resolved === undefined) { - resolved = registry.registrations[normalizedName]; + debouncee = [ + target, + method, + timer + ]; + + backburner._debouncees.push(debouncee); + + return debouncee; + }, + + cancelTimers: function() { + each(this._throttlers, this._boundClearItems); + this._throttlers = []; + + each(this._debouncees, this._boundClearItems); + this._debouncees = []; + + this._clearTimerTimeout(); + this._timers = []; + + if (this._autorun) { + this._platform.clearTimeout(this._autorun); + this._autorun = null; } + }, - if (resolved === undefined) { - registry._failCache[normalizedName] = true; + hasTimers: function() { + return !!this._timers.length || !!this._debouncees.length || !!this._throttlers.length || this._autorun; + }, + + cancel: function (timer) { + var timerType = typeof timer; + + if (timer && timerType === 'object' && timer.queue && timer.method) { // we're cancelling a deferOnce + return timer.queue.cancel(timer); + } else if (timerType === 'function') { // we're cancelling a setTimeout + for (var i = 0, l = this._timers.length; i < l; i += 2) { + if (this._timers[i + 1] === timer) { + this._timers.splice(i, 2); // remove the two elements + if (i === 0) { + this._reinstallTimerTimeout(); + } + return true; + } + } + } else if (Object.prototype.toString.call(timer) === '[object Array]'){ // we're cancelling a throttle or debounce + return this._cancelItem(findThrottler, this._throttlers, timer) || + this._cancelItem(findDebouncee, this._debouncees, timer); } else { - registry._resolveCache[normalizedName] = resolved; + return; // timer was null or not a timer } + }, - return resolved; - } + _cancelItem: function(findMethod, array, timer){ + var item, index; - function has(registry, fullName, source) { - return registry.resolve(fullName, { source: source }) !== undefined; - } + if (timer.length < 3) { return false; } - var privateNames = _emberUtils.dictionary(null); - var privateSuffix = '' + Math.random() + Date.now(); + index = findMethod(timer[0], timer[1], array); - function privatize(_ref) { - var fullName = _ref[0]; + if (index > -1) { - var name = privateNames[fullName]; - if (name) { - return name; + item = array[index]; + + if (item[2] === timer[2]) { + array.splice(index, 1); + this._platform.clearTimeout(timer[2]); + return true; + } } - var _fullName$split = fullName.split(':'); + return false; + }, - var type = _fullName$split[0]; - var rawName = _fullName$split[1]; + _runExpiredTimers: function () { + this._timerTimeoutId = undefined; + this.run(this, this._scheduleExpiredTimers); + }, - return privateNames[fullName] = _emberUtils.intern(type + ':' + rawName + '-' + privateSuffix); - } -}); -enifed('dag-map', ['exports'], function (exports) { 'use strict'; + _scheduleExpiredTimers: function () { + var n = Date.now(); + var timers = this._timers; + var i = 0; + var l = timers.length; + for (; i < l; i += 2) { + var executeAt = timers[i]; + var fn = timers[i+1]; + if (executeAt <= n) { + this.schedule(this.options.defaultQueue, null, fn); + } else { + break; + } + } + timers.splice(0, i); + this._installTimerTimeout(); + }, -/** - * A topologically ordered map of key/value pairs with a simple API for adding constraints. - * - * Edges can forward reference keys that have not been added yet (the forward reference will - * map the key to undefined). - */ -var DAG = (function () { - function DAG() { - this._vertices = new Vertices(); - } - /** - * Adds a key/value pair with dependencies on other key/value pairs. - * - * @public - * @param key The key of the vertex to be added. - * @param value The value of that vertex. - * @param before A key or array of keys of the vertices that must - * be visited before this vertex. - * @param after An string or array of strings with the keys of the - * vertices that must be after this vertex is visited. - */ - DAG.prototype.add = function (key, value, before, after) { - if (!key) - throw new Error('argument `key` is required'); - var vertices = this._vertices; - var v = vertices.add(key); - v.val = value; - if (before) { - if (typeof before === "string") { - vertices.addEdge(v, vertices.add(before)); - } - else { - for (var i = 0; i < before.length; i++) { - vertices.addEdge(v, vertices.add(before[i])); - } - } - } - if (after) { - if (typeof after === "string") { - vertices.addEdge(vertices.add(after), v); - } - else { - for (var i = 0; i < after.length; i++) { - vertices.addEdge(vertices.add(after[i]), v); - } - } - } - }; - /** - * @deprecated please use add. - */ - DAG.prototype.addEdges = function (key, value, before, after) { - this.add(key, value, before, after); - }; - /** - * Visits key/value pairs in topological order. - * - * @public - * @param callback The function to be invoked with each key/value. - */ - DAG.prototype.each = function (callback) { - this._vertices.walk(callback); - }; - /** - * @deprecated please use each. - */ - DAG.prototype.topsort = function (callback) { - this.each(callback); - }; - return DAG; -}()); -/** @private */ -var Vertices = (function () { - function Vertices() { - this.length = 0; - this.stack = new IntStack(); - this.path = new IntStack(); - this.result = new IntStack(); + _reinstallTimerTimeout: function () { + this._clearTimerTimeout(); + this._installTimerTimeout(); + }, + + _clearTimerTimeout: function () { + if (!this._timerTimeoutId) { + return; } - Vertices.prototype.add = function (key) { - if (!key) - throw new Error("missing key"); - var l = this.length | 0; - var vertex; - for (var i = 0; i < l; i++) { - vertex = this[i]; - if (vertex.key === key) - return vertex; - } - this.length = l + 1; - return this[l] = { - idx: l, - key: key, - val: undefined, - out: false, - flag: false, - length: 0 - }; - }; - Vertices.prototype.addEdge = function (v, w) { - this.check(v, w.key); - var l = w.length | 0; - for (var i = 0; i < l; i++) { - if (w[i] === v.idx) - return; - } - w.length = l + 1; - w[l] = v.idx; - v.out = true; - }; - Vertices.prototype.walk = function (cb) { - this.reset(); - for (var i = 0; i < this.length; i++) { - var vertex = this[i]; - if (vertex.out) - continue; - this.visit(vertex, ""); - } - this.each(this.result, cb); - }; - Vertices.prototype.check = function (v, w) { - if (v.key === w) { - throw new Error("cycle detected: " + w + " <- " + w); - } - // quick check - if (v.length === 0) - return; - // shallow check - for (var i = 0; i < v.length; i++) { - var key = this[v[i]].key; - if (key === w) { - throw new Error("cycle detected: " + w + " <- " + v.key + " <- " + w); - } - } - // deep check - this.reset(); - this.visit(v, w); - if (this.path.length > 0) { - var msg_1 = "cycle detected: " + w; - this.each(this.path, function (key) { - msg_1 += " <- " + key; - }); - throw new Error(msg_1); - } - }; - Vertices.prototype.reset = function () { - this.stack.length = 0; - this.path.length = 0; - this.result.length = 0; - for (var i = 0, l = this.length; i < l; i++) { - this[i].flag = false; - } - }; - Vertices.prototype.visit = function (start, search) { - var _a = this, stack = _a.stack, path = _a.path, result = _a.result; - stack.push(start.idx); - while (stack.length) { - var index = stack.pop() | 0; - if (index >= 0) { - // enter - var vertex = this[index]; - if (vertex.flag) - continue; - vertex.flag = true; - path.push(index); - if (search === vertex.key) - break; - // push exit - stack.push(~index); - this.pushIncoming(vertex); - } - else { - // exit - path.pop(); - result.push(~index); - } - } - }; - Vertices.prototype.pushIncoming = function (incomming) { - var stack = this.stack; - for (var i = incomming.length - 1; i >= 0; i--) { - var index = incomming[i]; - if (!this[index].flag) { - stack.push(index); - } - } - }; - Vertices.prototype.each = function (indices, cb) { - for (var i = 0, l = indices.length; i < l; i++) { - var vertex = this[indices[i]]; - cb(vertex.key, vertex.val); - } - }; - return Vertices; -}()); -/** @private */ -var IntStack = (function () { - function IntStack() { - this.length = 0; + this._platform.clearTimeout(this._timerTimeoutId); + this._timerTimeoutId = undefined; + }, + + _installTimerTimeout: function () { + if (!this._timers.length) { + return; } - IntStack.prototype.push = function (n) { - this[this.length++] = n | 0; - }; - IntStack.prototype.pop = function () { - return this[--this.length] | 0; - }; - return IntStack; -}()); + var minExpiresAt = this._timers[0]; + var n = Date.now(); + var wait = Math.max(0, minExpiresAt - n); + this._timerTimeoutId = this._platform.setTimeout(this._boundRunExpiredTimers, wait); + } +}; -exports['default'] = DAG; +Backburner.prototype.schedule = Backburner.prototype.defer; +Backburner.prototype.scheduleOnce = Backburner.prototype.deferOnce; +Backburner.prototype.later = Backburner.prototype.setTimeout; -Object.defineProperty(exports, '__esModule', { value: true }); +function getOnError(options) { + return options.onError || (options.onErrorTarget && options.onErrorTarget[options.onErrorMethod]); +} -}); -enifed('ember-application/index', ['exports', 'ember-application/initializers/dom-templates', 'ember-application/system/application', 'ember-application/system/application-instance', 'ember-application/system/resolver', 'ember-application/system/engine', 'ember-application/system/engine-instance', 'ember-application/system/engine-parent'], function (exports, _emberApplicationInitializersDomTemplates, _emberApplicationSystemApplication, _emberApplicationSystemApplicationInstance, _emberApplicationSystemResolver, _emberApplicationSystemEngine, _emberApplicationSystemEngineInstance, _emberApplicationSystemEngineParent) { - /** - @module ember - @submodule ember-application - */ +function createAutorun(backburner) { + var setTimeout = backburner._platform.setTimeout; + backburner.begin(); + backburner._autorun = setTimeout(function() { + backburner._autorun = null; + backburner.end(); + }, 0); +} - 'use strict'; +function findDebouncee(target, method, debouncees) { + return findItem(target, method, debouncees); +} - exports.Application = _emberApplicationSystemApplication.default; - exports.ApplicationInstance = _emberApplicationSystemApplicationInstance.default; - exports.Resolver = _emberApplicationSystemResolver.default; - exports.Engine = _emberApplicationSystemEngine.default; - exports.EngineInstance = _emberApplicationSystemEngineInstance.default; - exports.getEngineParent = _emberApplicationSystemEngineParent.getEngineParent; - exports.setEngineParent = _emberApplicationSystemEngineParent.setEngineParent; +function findThrottler(target, method, throttlers) { + return findItem(target, method, throttlers); +} - // add domTemplates initializer (only does something if `ember-template-compiler` - // is loaded already) -}); -enifed('ember-application/initializers/dom-templates', ['exports', 'require', 'ember-glimmer', 'ember-environment', 'ember-application/system/application'], function (exports, _require, _emberGlimmer, _emberEnvironment, _emberApplicationSystemApplication) { - 'use strict'; +function findItem(target, method, collection) { + var item; + var index = -1; - var bootstrap = function () {}; + for (var i = 0, l = collection.length; i < l; i++) { + item = collection[i]; + if (item[0] === target && item[1] === method) { + index = i; + break; + } + } - _emberApplicationSystemApplication.default.initializer({ - name: 'domTemplates', - initialize: function () { - var bootstrapModuleId = 'ember-template-compiler/system/bootstrap'; - var context = undefined; - if (_emberEnvironment.environment.hasDOM && _require.has(bootstrapModuleId)) { - bootstrap = _require.default(bootstrapModuleId).default; - context = document; - } + return index; +} - bootstrap({ context: context, hasTemplate: _emberGlimmer.hasTemplate, setTemplate: _emberGlimmer.setTemplate }); - } - }); -}); -enifed('ember-application/system/application-instance', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-environment', 'ember-views', 'ember-application/system/engine-instance'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberEnvironment, _emberViews, _emberApplicationSystemEngineInstance) { - /** - @module ember - @submodule ember-application - */ +function clearItems(item) { + this._platform.clearTimeout(item[2]); +} + +exports['default'] = Backburner; +Object.defineProperty(exports, '__esModule', { value: true }); + +}); +enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'ember-metal'], function (exports, _emberUtils, _emberEnvironment, _emberMetal) { + /* globals Proxy */ 'use strict'; - var BootOptions = undefined; + var _Container$prototype; + + exports.default = Container; + exports.buildFakeContainerWithDeprecations = buildFakeContainerWithDeprecations; + var CONTAINER_OVERRIDE = _emberUtils.symbol('CONTAINER_OVERRIDE'); + var FACTORY_FOR = _emberUtils.symbol('FACTORY_FOR'); + exports.FACTORY_FOR = FACTORY_FOR; + var LOOKUP_FACTORY = _emberUtils.symbol('LOOKUP_FACTORY'); + + exports.LOOKUP_FACTORY = LOOKUP_FACTORY; /** - The `ApplicationInstance` encapsulates all of the stateful aspects of a - running `Application`. - - At a high-level, we break application boot into two distinct phases: - - * Definition time, where all of the classes, templates, and other - dependencies are loaded (typically in the browser). - * Run time, where we begin executing the application once everything - has loaded. + A container used to instantiate and cache objects. - Definition time can be expensive and only needs to happen once since it is - an idempotent operation. For example, between test runs and FastBoot - requests, the application stays the same. It is only the state that we want - to reset. + Every `Container` must be associated with a `Registry`, which is referenced + to determine the factory and options that should be used to instantiate + objects. - That state is what the `ApplicationInstance` manages: it is responsible for - creating the container that contains all application state, and disposing of - it once the particular test run or FastBoot request has finished. + The public API for `Container` is still in flux and should not be considered + stable. - @public - @class Ember.ApplicationInstance - @extends Ember.EngineInstance - */ + @private + @class Container + */ - var ApplicationInstance = _emberApplicationSystemEngineInstance.default.extend({ + function Container(registry, options) { + this.registry = registry; + this.owner = options && options.owner ? options.owner : null; + this.cache = _emberUtils.dictionary(options && options.cache ? options.cache : null); + this.factoryCache = _emberUtils.dictionary(options && options.factoryCache ? options.factoryCache : null); + this.validationCache = _emberUtils.dictionary(options && options.validationCache ? options.validationCache : null); + this._fakeContainerToInject = buildFakeContainerWithDeprecations(this); + this[CONTAINER_OVERRIDE] = undefined; + this.isDestroyed = false; + } + + Container.prototype = (_Container$prototype = { /** - The `Application` for which this is an instance. - @property {Ember.Application} application - @private - */ - application: null, + @private + @property owner + @type Object + */ + owner: null, /** - The DOM events for which the event dispatcher should listen. - By default, the application's `Ember.EventDispatcher` listens - for a set of standard DOM events, such as `mousedown` and - `keyup`, and delegates them to your application's `Ember.View` - instances. - @private - @property {Object} customEvents - */ - customEvents: null, + @private + @property registry + @type Registry + @since 1.11.0 + */ + registry: null, /** - The root DOM element of the Application as an element or a - [jQuery-compatible selector - string](http://api.jquery.com/category/selectors/). - @private - @property {String|DOMElement} rootElement - */ - rootElement: null, + @private + @property cache + @type InheritingDict + */ + cache: null, - init: function () { - this._super.apply(this, arguments); + /** + @private + @property factoryCache + @type InheritingDict + */ + factoryCache: null, - // Register this instance in the per-instance registry. - // - // Why do we need to register the instance in the first place? - // Because we need a good way for the root route (a.k.a ApplicationRoute) - // to notify us when it has created the root-most view. That view is then - // appended to the rootElement, in the case of apps, to the fixture harness - // in tests, or rendered to a string in the case of FastBoot. - this.register('-application-instance:main', this, { instantiate: false }); + /** + @private + @property validationCache + @type InheritingDict + */ + validationCache: null, + + /** + Given a fullName return a corresponding instance. + The default behaviour is for lookup to return a singleton instance. + The singleton is scoped to the container, allowing multiple containers + to all have their own locally scoped singletons. + ```javascript + let registry = new Registry(); + let container = registry.container(); + registry.register('api:twitter', Twitter); + let twitter = container.lookup('api:twitter'); + twitter instanceof Twitter; // => true + // by default the container will return singletons + let twitter2 = container.lookup('api:twitter'); + twitter2 instanceof Twitter; // => true + twitter === twitter2; //=> true + ``` + If singletons are not wanted, an optional flag can be provided at lookup. + ```javascript + let registry = new Registry(); + let container = registry.container(); + registry.register('api:twitter', Twitter); + let twitter = container.lookup('api:twitter', { singleton: false }); + let twitter2 = container.lookup('api:twitter', { singleton: false }); + twitter === twitter2; //=> false + ``` + @private + @method lookup + @param {String} fullName + @param {Object} [options] + @param {String} [options.source] The fullname of the request source (used for local lookup) + @return {any} + */ + lookup: function (fullName, options) { + _emberMetal.assert('fullName must be a proper full name', this.registry.validateFullName(fullName)); + return lookup(this, this.registry.normalize(fullName), options); }, /** - Overrides the base `EngineInstance._bootSync` method with concerns relevant - to booting application (instead of engine) instances. - This method should only contain synchronous boot concerns. Asynchronous - boot concerns should eventually be moved to the `boot` method, which - returns a promise. - Until all boot code has been made asynchronous, we need to continue to - expose this method for use *internally* in places where we need to boot an - instance synchronously. - @private - */ - _bootSync: function (options) { - if (this._booted) { - return this; - } + Given a fullName, return the corresponding factory. + @private + @method lookupFactory + @param {String} fullName + @param {Object} [options] + @param {String} [options.source] The fullname of the request source (used for local lookup) + @return {any} + */ + lookupFactory: function (fullName, options) { + _emberMetal.assert('fullName must be a proper full name', this.registry.validateFullName(fullName)); - options = new BootOptions(options); + _emberMetal.deprecate('Using "_lookupFactory" is deprecated. Please use container.factoryFor instead.', !true, { id: 'container-lookupFactory', until: '2.13.0', url: 'TODO' }); - this.setupRegistry(options); + return deprecatedFactoryFor(this, this.registry.normalize(fullName), options); + } - if (options.rootElement) { - this.rootElement = options.rootElement; + }, _Container$prototype[LOOKUP_FACTORY] = function (fullName, options) { + _emberMetal.assert('fullName must be a proper full name', this.registry.validateFullName(fullName)); + return deprecatedFactoryFor(this, this.registry.normalize(fullName), options); + }, _Container$prototype[FACTORY_FOR] = function (fullName) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + if (_emberMetal.isFeatureEnabled('ember-no-double-extend')) { + if (true) { + return this.factoryFor(fullName, options); } else { - this.rootElement = this.application.rootElement; + /* This throws in case of a poorly designed build */ + throw new Error('If ember-no-double-extend is enabled, ember-factory-for must also be enabled'); } + } + var factory = this[LOOKUP_FACTORY](fullName, options); + if (factory === undefined) { + return; + } + var manager = new DeprecatedFactoryManager(this, factory, fullName); - if (options.location) { - var router = _emberMetal.get(this, 'router'); - _emberMetal.set(router, 'location', options.location); + _emberMetal.runInDebug(function () { + manager = wrapManagerInDeprecationProxy(manager); + }); + + return manager; + }, _Container$prototype.destroy = function () { + eachDestroyable(this, function (item) { + if (item.destroy) { + item.destroy(); } + }); - this.application.runInstanceInitializers(this); + this.isDestroyed = true; + }, _Container$prototype.reset = function (fullName) { + if (arguments.length > 0) { + resetMember(this, this.registry.normalize(fullName)); + } else { + resetCache(this); + } + }, _Container$prototype.ownerInjection = function () { + var _ref; - if (options.isInteractive) { - this.setupEventDispatcher(); - } + return _ref = {}, _ref[_emberUtils.OWNER] = this.owner, _ref; + }, _Container$prototype); - this._booted = true; + /* + * Wrap a factory manager in a proxy which will not permit properties to be + * set on the manager. + */ + function wrapManagerInDeprecationProxy(manager) { + if (_emberUtils.HAS_NATIVE_PROXY) { + var _ret = (function () { + var validator = { + get: function (obj, prop) { + if (prop !== 'class' && prop !== 'create') { + throw new Error('You attempted to access "' + prop + '" on a factory manager created by container#factoryFor. "' + prop + '" is not a member of a factory manager."'); + } - return this; - }, + return obj[prop]; + }, + set: function (obj, prop, value) { + throw new Error('You attempted to set "' + prop + '" on a factory manager created by container#factoryFor. A factory manager is a read-only construct.'); + } + }; - setupRegistry: function (options) { - this.constructor.setupRegistry(this.__registry__, options); - }, + // Note: + // We have to proxy access to the manager here so that private property + // access doesn't cause the above errors to occur. + var m = manager; + var proxiedManager = { + class: m.class, + create: function (props) { + return m.create(props); + } + }; - router: _emberMetal.computed(function () { - return this.lookup('router:main'); - }).readOnly(), + return { + v: new Proxy(proxiedManager, validator) + }; + })(); - /** - This hook is called by the root-most Route (a.k.a. the ApplicationRoute) - when it has finished creating the root View. By default, we simply take the - view and append it to the `rootElement` specified on the Application. - In cases like FastBoot and testing, we can override this hook and implement - custom behavior, such as serializing to a string and sending over an HTTP - socket rather than appending to DOM. - @param view {Ember.View} the root-most view - @private - */ - didCreateRootView: function (view) { - view.appendTo(this.rootElement); - }, + if (typeof _ret === 'object') return _ret.v; + } - /** - Tells the router to start routing. The router will ask the location for the - current URL of the page to determine the initial URL to start routing to. - To start the app at a specific URL, call `handleURL` instead. - @private - */ - startRouting: function () { - var router = _emberMetal.get(this, 'router'); - router.startRouting(); - this._didSetupRouter = true; - }, + return manager; + } + if (true) { /** - @private - Sets up the router, initializing the child router and configuring the - location before routing begins. - Because setup should only occur once, multiple calls to `setupRouter` - beyond the first call have no effect. - */ - setupRouter: function () { - if (this._didSetupRouter) { - return; + Given a fullName, return the corresponding factory. The consumer of the factory + is responsible for the destruction of any factory instances, as there is no + way for the container to ensure instances are destroyed when it itself is + destroyed. + @public + @method factoryFor + @param {String} fullName + @param {Object} [options] + @param {String} [options.source] The fullname of the request source (used for local lookup) + @return {any} + */ + Container.prototype.factoryFor = function _factoryFor(fullName) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + var normalizedName = this.registry.normalize(fullName); + _emberMetal.assert('fullName must be a proper full name', this.registry.validateFullName(normalizedName)); + + if (options.source) { + normalizedName = this.registry.expandLocalLookup(fullName, options); + // if expandLocalLookup returns falsey, we do not support local lookup + if (!normalizedName) { + return; + } } - this._didSetupRouter = true; - var router = _emberMetal.get(this, 'router'); - router.setupRouter(); - }, + var factory = this.registry.resolve(normalizedName); - /** - Directs the router to route to a particular URL. This is useful in tests, - for example, to tell the app to start at a particular URL. - @param url {String} the URL the router should route to - @private - */ - handleURL: function (url) { - var router = _emberMetal.get(this, 'router'); + if (factory === undefined) { + return; + } - this.setupRouter(); - return router.handleURL(url); - }, + var manager = new FactoryManager(this, factory, fullName, normalizedName); - /** - @private - */ - setupEventDispatcher: function () { - var dispatcher = this.lookup('event_dispatcher:main'); - var applicationCustomEvents = _emberMetal.get(this.application, 'customEvents'); - var instanceCustomEvents = _emberMetal.get(this, 'customEvents'); + _emberMetal.runInDebug(function () { + manager = wrapManagerInDeprecationProxy(manager); + }); - var customEvents = _emberUtils.assign({}, applicationCustomEvents, instanceCustomEvents); - dispatcher.setup(customEvents, this.rootElement); + return manager; + }; + } - return dispatcher; - }, + function isSingleton(container, fullName) { + return container.registry.getOption(fullName, 'singleton') !== false; + } - /** - Returns the current URL of the app instance. This is useful when your - app does not update the browsers URL bar (i.e. it uses the `'none'` - location adapter). - @public - @return {String} the current URL - */ - getURL: function () { - var router = _emberMetal.get(this, 'router'); - return _emberMetal.get(router, 'url'); - }, + function shouldInstantiate(container, fullName) { + return container.registry.getOption(fullName, 'instantiate') !== false; + } - // `instance.visit(url)` should eventually replace `instance.handleURL()`; - // the test helpers can probably be switched to use this implementation too + function lookup(container, fullName) { + var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; - /** - Navigate the instance to a particular URL. This is useful in tests, for - example, or to tell the app to start at a particular URL. This method - returns a promise that resolves with the app instance when the transition - is complete, or rejects if the transion was aborted due to an error. - @public - @param url {String} the destination URL - @return {Promise} - */ - visit: function (url) { - var _this = this; + if (options.source) { + fullName = container.registry.expandLocalLookup(fullName, options); - this.setupRouter(); + // if expandLocalLookup returns falsey, we do not support local lookup + if (!fullName) { + return; + } + } - var bootOptions = this.__container__.lookup('-environment:main'); + if (container.cache[fullName] !== undefined && options.singleton !== false) { + return container.cache[fullName]; + } - var router = _emberMetal.get(this, 'router'); + if (true) { + return instantiateFactory(container, fullName, options); + } else { + var factory = deprecatedFactoryFor(container, fullName); + var value = instantiate(factory, {}, container, fullName); - var handleTransitionResolve = function () { - if (!bootOptions.options.shouldRender) { - // No rendering is needed, and routing has completed, simply return. - return _this; - } else { - return new _emberRuntime.RSVP.Promise(function (resolve) { - // Resolve once rendering is completed. `router.handleURL` returns the transition (as a thennable) - // which resolves once the transition is completed, but the transition completion only queues up - // a scheduled revalidation (into the `render` queue) in the Renderer. - // - // This uses `run.schedule('afterRender', ....)` to resolve after that rendering has completed. - _emberMetal.run.schedule('afterRender', null, resolve, _this); - }); - } - }; + if (value === undefined) { + return; + } - var handleTransitionReject = function (error) { - if (error.error) { - throw error.error; - } else if (error.name === 'TransitionAborted' && router.router.activeTransition) { - return router.router.activeTransition.then(handleTransitionResolve, handleTransitionReject); - } else if (error.name === 'TransitionAborted') { - throw new Error(error.message); - } else { - throw error; - } - }; + if (isSingleton(container, fullName) && options.singleton !== false) { + container.cache[fullName] = value; + } - var location = _emberMetal.get(router, 'location'); + return value; + } + } - // Keeps the location adapter's internal URL in-sync - location.setURL(url); + function isSingletonClass(container, fullName, _ref2) { + var instantiate = _ref2.instantiate; + var singleton = _ref2.singleton; - // getURL returns the set url with the rootURL stripped off - return router.handleURL(location.getURL()).then(handleTransitionResolve, handleTransitionReject); - } - }); + return singleton !== false && isSingleton(container, fullName) && !instantiate && !shouldInstantiate(container, fullName); + } - ApplicationInstance.reopenClass({ - /** - @private - @method setupRegistry - @param {Registry} registry - @param {BootOptions} options - */ - setupRegistry: function (registry) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + function isSingletonInstance(container, fullName, _ref3) { + var instantiate = _ref3.instantiate; + var singleton = _ref3.singleton; - if (!options.toEnvironment) { - options = new BootOptions(options); - } + return singleton !== false && isSingleton(container, fullName) && instantiate !== false && shouldInstantiate(container, fullName); + } - registry.register('-environment:main', options.toEnvironment(), { instantiate: false }); - registry.register('service:-document', options.document, { instantiate: false }); + function isFactoryClass(container, fullname, _ref4) { + var instantiate = _ref4.instantiate; + var singleton = _ref4.singleton; - this._super(registry, options); - } - }); + return (singleton === false || !isSingleton(container, fullname)) && instantiate === false && !shouldInstantiate(container, fullname); + } - /** - A list of boot-time configuration options for customizing the behavior of - an `Ember.ApplicationInstance`. - - This is an interface class that exists purely to document the available - options; you do not need to construct it manually. Simply pass a regular - JavaScript object containing the desired options into methods that require - one of these options object: - - ```javascript - MyApp.visit("/", { location: "none", rootElement: "#container" }); - ``` - - Not all combinations of the supported options are valid. See the documentation - on `Ember.Application#visit` for the supported configurations. - - Internal, experimental or otherwise unstable flags are marked as private. - - @class BootOptions - @namespace Ember.ApplicationInstance - @public - */ - BootOptions = function BootOptions() { - var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + function isFactoryInstance(container, fullName, _ref5) { + var instantiate = _ref5.instantiate; + var singleton = _ref5.singleton; - /** - Provide a specific instance of jQuery. This is useful in conjunction with - the `document` option, as it allows you to use a copy of `jQuery` that is - appropriately bound to the foreign `document` (e.g. a jsdom). - This is highly experimental and support very incomplete at the moment. - @property jQuery - @type Object - @default auto-detected - @private - */ - this.jQuery = _emberViews.jQuery; // This default is overridable below + return (singleton !== false || isSingleton(container, fullName)) && instantiate !== false && shouldInstantiate(container, fullName); + } - /** - Interactive mode: whether we need to set up event delegation and invoke - lifecycle callbacks on Components. - @property isInteractive - @type boolean - @default auto-detected - @private - */ - this.isInteractive = _emberEnvironment.environment.hasDOM; // This default is overridable below + function instantiateFactory(container, fullName, options) { + var factoryManager = container[FACTORY_FOR](fullName); - /** - Run in a full browser environment. - When this flag is set to `false`, it will disable most browser-specific - and interactive features. Specifically: - * It does not use `jQuery` to append the root view; the `rootElement` - (either specified as a subsequent option or on the application itself) - must already be an `Element` in the given `document` (as opposed to a - string selector). - * It does not set up an `EventDispatcher`. - * It does not run any `Component` lifecycle hooks (such as `didInsertElement`). - * It sets the `location` option to `"none"`. (If you would like to use - the location adapter specified in the app's router instead, you can also - specify `{ location: null }` to specifically opt-out.) - @property isBrowser - @type boolean - @default auto-detected - @public - */ - if (options.isBrowser !== undefined) { - this.isBrowser = !!options.isBrowser; - } else { - this.isBrowser = _emberEnvironment.environment.hasDOM; + if (factoryManager === undefined) { + return; } - if (!this.isBrowser) { - this.jQuery = null; - this.isInteractive = false; - this.location = 'none'; + // SomeClass { singleton: true, instantiate: true } | { singleton: true } | { instantiate: true } | {} + // By default majority of objects fall into this case + if (isSingletonInstance(container, fullName, options)) { + return container.cache[fullName] = factoryManager.create(); } - /** - Disable rendering completely. - When this flag is set to `true`, it will disable the entire rendering - pipeline. Essentially, this puts the app into "routing-only" mode. No - templates will be rendered, and no Components will be created. - @property shouldRender - @type boolean - @default true - @public - */ - if (options.shouldRender !== undefined) { - this.shouldRender = !!options.shouldRender; - } else { - this.shouldRender = true; + // SomeClass { singleton: false, instantiate: true } + if (isFactoryInstance(container, fullName, options)) { + return factoryManager.create(); } - if (!this.shouldRender) { - this.jQuery = null; - this.isInteractive = false; + // SomeClass { singleton: true, instantiate: false } | { instantiate: false } | { singleton: false, instantiation: false } + if (isSingletonClass(container, fullName, options) || isFactoryClass(container, fullName, options)) { + return factoryManager.class; } - /** - If present, render into the given `Document` object instead of the - global `window.document` object. - In practice, this is only useful in non-browser environment or in - non-interactive mode, because Ember's `jQuery` dependency is - implicitly bound to the current document, causing event delegation - to not work properly when the app is rendered into a foreign - document object (such as an iframe's `contentDocument`). - In non-browser mode, this could be a "`Document`-like" object as - Ember only interact with a small subset of the DOM API in non- - interactive mode. While the exact requirements have not yet been - formalized, the `SimpleDOM` library's implementation is known to - work. - @property document - @type Document - @default the global `document` object - @public - */ - if (options.document) { - this.document = options.document; - } else { - this.document = typeof document !== 'undefined' ? document : null; - } + throw new Error('Could not create factory'); + } - /** - If present, overrides the application's `rootElement` property on - the instance. This is useful for testing environment, where you - might want to append the root view to a fixture area. - In non-browser mode, because Ember does not have access to jQuery, - this options must be specified as a DOM `Element` object instead of - a selector string. - See the documentation on `Ember.Applications`'s `rootElement` for - details. - @property rootElement - @type String|Element - @default null - @public - */ - if (options.rootElement) { - this.rootElement = options.rootElement; + function markInjectionsAsDynamic(injections) { + injections._dynamic = true; + } + + function areInjectionsDynamic(injections) { + return !!injections._dynamic; + } + + function buildInjections() /* container, ...injections */{ + var _arguments = arguments; + + var hash = {}; + + if (arguments.length > 1) { + (function () { + var container = _arguments[0]; + var injections = []; + var injection = undefined; + + for (var i = 1; i < _arguments.length; i++) { + if (_arguments[i]) { + injections = injections.concat(_arguments[i]); + } + } + + _emberMetal.runInDebug(function () { + container.registry.validateInjections(injections); + }); + + for (var i = 0; i < injections.length; i++) { + injection = injections[i]; + hash[injection.property] = lookup(container, injection.fullName); + if (!isSingleton(container, injection.fullName)) { + markInjectionsAsDynamic(hash); + } + } + })(); } - // Set these options last to give the user a chance to override the - // defaults from the "combo" options like `isBrowser` (although in - // practice, the resulting combination is probably invalid) + return hash; + } - /** - If present, overrides the router's `location` property with this - value. This is useful for environments where trying to modify the - URL would be inappropriate. - @property location - @type string - @default null - @public - */ - if (options.location !== undefined) { - this.location = options.location; + function deprecatedFactoryFor(container, fullName) { + var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + + var registry = container.registry; + + if (options.source) { + fullName = registry.expandLocalLookup(fullName, options); + // if expandLocalLookup returns falsey, we do not support local lookup + if (!fullName) { + return; + } } - if (options.jQuery !== undefined) { - this.jQuery = options.jQuery; + var cache = container.factoryCache; + if (cache[fullName]) { + return cache[fullName]; + } + var factory = registry.resolve(fullName); + if (factory === undefined) { + return; } - if (options.isInteractive !== undefined) { - this.isInteractive = !!options.isInteractive; + var type = fullName.split(':')[0]; + if (!factory || typeof factory.extend !== 'function' || !_emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS && type === 'model') { + if (factory && typeof factory._onLookup === 'function') { + factory._onLookup(fullName); + } + + // TODO: think about a 'safe' merge style extension + // for now just fallback to create time injection + cache[fullName] = factory; + return factory; + } else { + var injections = injectionsFor(container, fullName); + var factoryInjections = factoryInjectionsFor(container, fullName); + var cacheable = !areInjectionsDynamic(injections) && !areInjectionsDynamic(factoryInjections); + + factoryInjections[_emberUtils.NAME_KEY] = registry.makeToString(factory, fullName); + + var injectedFactory = factory.extend(injections); + + // TODO - remove all `container` injections when Ember reaches v3.0.0 + injectDeprecatedContainer(injectedFactory.prototype, container); + injectedFactory.reopenClass(factoryInjections); + + if (factory && typeof factory._onLookup === 'function') { + factory._onLookup(fullName); + } + + if (cacheable) { + cache[fullName] = injectedFactory; + } + + return injectedFactory; } - }; + } - BootOptions.prototype.toEnvironment = function () { - var env = _emberUtils.assign({}, _emberEnvironment.environment); - // For compatibility with existing code - env.hasDOM = this.isBrowser; - env.isInteractive = this.isInteractive; - env.options = this; - return env; - }; + function injectionsFor(container, fullName) { + var registry = container.registry; + var splitName = fullName.split(':'); + var type = splitName[0]; - Object.defineProperty(ApplicationInstance.prototype, 'container', { - configurable: true, - enumerable: false, - get: function () { - var instance = this; - return { - lookup: function () { - _emberMetal.deprecate('Using `ApplicationInstance.container.lookup` is deprecated. Please use `ApplicationInstance.lookup` instead.', false, { - id: 'ember-application.app-instance-container', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-applicationinstance-container' - }); - return instance.lookup.apply(instance, arguments); + var injections = buildInjections(container, registry.getTypeInjections(type), registry.getInjections(fullName)); + injections._debugContainerKey = fullName; + + _emberUtils.setOwner(injections, container.owner); + + return injections; + } + + function instantiate(factory, props, container, fullName) { + var lazyInjections = undefined, + validationCache = undefined; + + props = props || {}; + + if (container.registry.getOption(fullName, 'instantiate') === false) { + return factory; + } + + if (factory) { + if (typeof factory.create !== 'function') { + throw new Error('Failed to create an instance of \'' + fullName + '\'. Most likely an improperly defined class or' + ' an invalid module export.'); + } + + validationCache = container.validationCache; + + _emberMetal.runInDebug(function () { + // Ensure that all lazy injections are valid at instantiation time + if (!validationCache[fullName] && typeof factory._lazyInjections === 'function') { + lazyInjections = factory._lazyInjections(); + lazyInjections = container.registry.normalizeInjectionsHash(lazyInjections); + + container.registry.validateInjections(lazyInjections); } - }; + }); + + validationCache[fullName] = true; + + var obj = undefined; + + if (typeof factory.extend === 'function') { + // assume the factory was extendable and is already injected + obj = factory.create(props); + } else { + // assume the factory was extendable + // to create time injections + // TODO: support new'ing for instantiation and merge injections for pure JS Functions + var injections = injectionsFor(container, fullName); + + // Ensure that a container is available to an object during instantiation. + // TODO - remove when Ember reaches v3.0.0 + // This "fake" container will be replaced after instantiation with a + // property that raises deprecations every time it is accessed. + injections.container = container._fakeContainerToInject; + obj = factory.create(_emberUtils.assign({}, injections, props)); + + // TODO - remove when Ember reaches v3.0.0 + if (!Object.isFrozen(obj) && 'container' in obj) { + injectDeprecatedContainer(obj, container); + } + } + + return obj; } - }); + } - Object.defineProperty(ApplicationInstance.prototype, 'registry', { - configurable: true, - enumerable: false, - get: function () { - return _emberRuntime.buildFakeRegistryWithDeprecations(this, 'ApplicationInstance'); + function factoryInjectionsFor(container, fullName) { + var registry = container.registry; + var splitName = fullName.split(':'); + var type = splitName[0]; + + var factoryInjections = buildInjections(container, registry.getFactoryTypeInjections(type), registry.getFactoryInjections(fullName)); + factoryInjections._debugContainerKey = fullName; + + return factoryInjections; + } + + // TODO - remove when Ember reaches v3.0.0 + function injectDeprecatedContainer(object, container) { + Object.defineProperty(object, 'container', { + configurable: true, + enumerable: false, + get: function () { + _emberMetal.deprecate('Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.', false, { id: 'ember-application.injected-container', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_injected-container-access' }); + return this[CONTAINER_OVERRIDE] || container; + }, + + set: function (value) { + _emberMetal.deprecate('Providing the `container` property to ' + this + ' is deprecated. Please use `Ember.setOwner` or `owner.ownerInjection()` instead to provide an owner to the instance being created.', false, { id: 'ember-application.injected-container', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_injected-container-access' }); + + this[CONTAINER_OVERRIDE] = value; + + return value; + } + }); + } + + function eachDestroyable(container, callback) { + var cache = container.cache; + var keys = Object.keys(cache); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = cache[key]; + + if (container.registry.getOption(key, 'instantiate') !== false) { + callback(value); + } } - }); + } - exports.default = ApplicationInstance; -}); -enifed('ember-application/system/application', ['exports', 'ember-utils', 'ember-environment', 'ember-metal', 'ember-runtime', 'ember-views', 'ember-routing', 'ember-application/system/application-instance', 'container', 'ember-application/system/engine', 'ember-glimmer'], function (exports, _emberUtils, _emberEnvironment, _emberMetal, _emberRuntime, _emberViews, _emberRouting, _emberApplicationSystemApplicationInstance, _container, _emberApplicationSystemEngine, _emberGlimmer) { - /** - @module ember - @submodule ember-application - */ - 'use strict'; + function resetCache(container) { + eachDestroyable(container, function (value) { + if (value.destroy) { + value.destroy(); + } + }); - exports._resetLegacyAddonWarnings = _resetLegacyAddonWarnings; + container.cache.dict = _emberUtils.dictionary(null); + } - var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); + function resetMember(container, fullName) { + var member = container.cache[fullName]; - var librariesRegistered = false; + delete container.factoryCache[fullName]; + + if (member) { + delete container.cache[fullName]; + + if (member.destroy) { + member.destroy(); + } + } + } - var warnedAboutLegacyViewAddon = false; - var warnedAboutLegacyControllerAddon = false; + function buildFakeContainerWithDeprecations(container) { + var fakeContainer = {}; + var propertyMappings = { + lookup: 'lookup', + lookupFactory: '_lookupFactory' + }; - // For testing + for (var containerProperty in propertyMappings) { + fakeContainer[containerProperty] = buildFakeContainerFunction(container, containerProperty, propertyMappings[containerProperty]); + } - function _resetLegacyAddonWarnings() { - warnedAboutLegacyViewAddon = false; - warnedAboutLegacyControllerAddon = false; + return fakeContainer; } - /** - An instance of `Ember.Application` is the starting point for every Ember - application. It helps to instantiate, initialize and coordinate the many - objects that make up your app. - - Each Ember app has one and only one `Ember.Application` object. In fact, the - very first thing you should do in your application is create the instance: - - ```javascript - window.App = Ember.Application.create(); - ``` - - Typically, the application object is the only global variable. All other - classes in your app should be properties on the `Ember.Application` instance, - which highlights its first role: a global namespace. - - For example, if you define a view class, it might look like this: - - ```javascript - App.MyView = Ember.View.extend(); - ``` - - By default, calling `Ember.Application.create()` will automatically initialize - your application by calling the `Ember.Application.initialize()` method. If - you need to delay initialization, you can call your app's `deferReadiness()` - method. When you are ready for your app to be initialized, call its - `advanceReadiness()` method. - - You can define a `ready` method on the `Ember.Application` instance, which - will be run by Ember when the application is initialized. - - Because `Ember.Application` inherits from `Ember.Namespace`, any classes - you create will have useful string representations when calling `toString()`. - See the `Ember.Namespace` documentation for more information. - - While you can think of your `Ember.Application` as a container that holds the - other classes in your application, there are several other responsibilities - going on under-the-hood that you may want to understand. - - ### Event Delegation - - Ember uses a technique called _event delegation_. This allows the framework - to set up a global, shared event listener instead of requiring each view to - do it manually. For example, instead of each view registering its own - `mousedown` listener on its associated element, Ember sets up a `mousedown` - listener on the `body`. - - If a `mousedown` event occurs, Ember will look at the target of the event and - start walking up the DOM node tree, finding corresponding views and invoking - their `mouseDown` method as it goes. - - `Ember.Application` has a number of default events that it listens for, as - well as a mapping from lowercase events to camel-cased view method names. For - example, the `keypress` event causes the `keyPress` method on the view to be - called, the `dblclick` event causes `doubleClick` to be called, and so on. - - If there is a bubbling browser event that Ember does not listen for by - default, you can specify custom events and their corresponding view method - names by setting the application's `customEvents` property: - - ```javascript - let App = Ember.Application.create({ - customEvents: { - // add support for the paste event - paste: 'paste' - } - }); - ``` - - To prevent Ember from setting up a listener for a default event, - specify the event name with a `null` value in the `customEvents` - property: - - ```javascript - let App = Ember.Application.create({ - customEvents: { - // prevent listeners for mouseenter/mouseleave events - mouseenter: null, - mouseleave: null + function buildFakeContainerFunction(container, containerProperty, ownerProperty) { + return function () { + _emberMetal.deprecate('Using the injected `container` is deprecated. Please use the `getOwner` helper to access the owner of this object and then call `' + ownerProperty + '` instead.', false, { + id: 'ember-application.injected-container', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x#toc_injected-container-access' + }); + return container[containerProperty].apply(container, arguments); + }; + } + + var DeprecatedFactoryManager = (function () { + function DeprecatedFactoryManager(container, factory, fullName) { + babelHelpers.classCallCheck(this, DeprecatedFactoryManager); + + this.container = container; + this.class = factory; + this.fullName = fullName; + } + + DeprecatedFactoryManager.prototype.create = function create() { + var props = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + + return instantiate(this.class, props, this.container, this.fullName); + }; + + return DeprecatedFactoryManager; + })(); + + var FactoryManager = (function () { + function FactoryManager(container, factory, fullName, normalizedName) { + babelHelpers.classCallCheck(this, FactoryManager); + + this.container = container; + this.class = factory; + this.fullName = fullName; + this.normalizedName = normalizedName; + } + + FactoryManager.prototype.create = function create() { + var _this = this; + + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + + var injections = injectionsFor(this.container, this.normalizedName); + var props = _emberUtils.assign({}, injections, options); + + props[_emberUtils.NAME_KEY] = this.container.registry.makeToString(this.class, this.fullName); + + _emberMetal.runInDebug(function () { + var lazyInjections = undefined; + var validationCache = _this.container.validationCache; + // Ensure that all lazy injections are valid at instantiation time + if (!validationCache[_this.fullName] && _this.class && typeof _this.class._lazyInjections === 'function') { + lazyInjections = _this.class._lazyInjections(); + lazyInjections = _this.container.registry.normalizeInjectionsHash(lazyInjections); + + _this.container.registry.validateInjections(lazyInjections); + } + + validationCache[_this.fullName] = true; + }); + + if (!this.class.create) { + throw new Error('Failed to create an instance of \'' + this.normalizedName + '\'. Most likely an improperly defined class or' + ' an invalid module export.'); } - }); - ``` - - By default, the application sets up these event listeners on the document - body. However, in cases where you are embedding an Ember application inside - an existing page, you may want it to set up the listeners on an element - inside the body. - - For example, if only events inside a DOM element with the ID of `ember-app` - should be delegated, set your application's `rootElement` property: - - ```javascript - let App = Ember.Application.create({ - rootElement: '#ember-app' - }); - ``` - - 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 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: - - ```javascript - Ember.Application.initializer({ - name: 'api-adapter', - - initialize: function(application) { - application.register('api-adapter:main', ApiAdapter); + + if (this.class.prototype) { + injectDeprecatedContainer(this.class.prototype, this.container); } - }); - ``` - - Initializers provide an opportunity to access the internal registry, which - organizes the different components of an Ember application. Additionally - they provide a chance to access the instantiated application. Beyond - being used for libraries, initializers are also a great way to organize - dependency injection or setup in your own application. - - ### Routing - - In addition to creating your application's router, `Ember.Application` is - also responsible for telling the router when to start routing. Transitions - between routes can be logged with the `LOG_TRANSITIONS` flag, and more - detailed intra-transition logging can be logged with - the `LOG_TRANSITIONS_INTERNAL` flag: - - ```javascript - let App = Ember.Application.create({ - LOG_TRANSITIONS: true, // basic logging of successful transitions - LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps - }); - ``` + + return this.class.create(props); + }; + + return FactoryManager; + })(); +}); + +/* + * This internal version of factoryFor swaps between the public API for + * factoryFor (class is the registered class) and a transition implementation + * (class is the double-extended class). It is *not* the public API version + * of factoryFor, which always returns the registered class. + */ + +/** + A depth first traversal, destroying the container, its descendant containers and all + their managed objects. + @private + @method destroy + */ + +/** + Clear either the entire cache or just the cache for a particular key. + @private + @method reset + @param {String} fullName optional key to reset; if missing, resets everything + */ + +/** + Returns an object that can be used to provide an owner to a + manually created instance. + @private + @method ownerInjection + @returns { Object } +*/ +enifed('container/index', ['exports', 'container/registry', 'container/container'], function (exports, _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 + */ + + 'use strict'; + + exports.Registry = _containerRegistry.default; + exports.privatize = _containerRegistry.privatize; + exports.Container = _containerContainer.default; + exports.buildFakeContainerWithDeprecations = _containerContainer.buildFakeContainerWithDeprecations; + exports.FACTORY_FOR = _containerContainer.FACTORY_FOR; + exports.LOOKUP_FACTORY = _containerContainer.LOOKUP_FACTORY; +}); +enifed('container/registry', ['exports', 'ember-utils', 'ember-metal', 'container/container'], function (exports, _emberUtils, _emberMetal, _containerContainer) { + 'use strict'; + + exports.default = Registry; + exports.privatize = privatize; + + var VALID_FULL_NAME_REGEXP = /^[^:]+:[^:]+$/; + + /** + A registry used to store factory and option information keyed + by type. - By default, the router will begin trying to translate the current URL into - application state once the browser emits the `DOMContentReady` event. If you - need to defer routing, you can call the application's `deferReadiness()` - method. Once routing can begin, call the `advanceReadiness()` method. + A `Registry` stores the factory and option information needed by a + `Container` to instantiate and cache objects. - If there is any setup required before routing begins, you can implement a - `ready()` method on your app that will be invoked immediately before routing - begins. + The API for `Registry` is still in flux and should not be considered stable. - @class Application - @namespace Ember - @extends Ember.Engine - @uses RegistryProxyMixin - @public + @private + @class Registry + @since 1.11.0 */ - var Application = _emberApplicationSystemEngine.default.extend({ - _suppressDeferredDeprecation: true, + function Registry(options) { + this.fallback = options && options.fallback ? options.fallback : null; - /** - The root DOM element of the Application. This can be specified as an - element or a - [jQuery-compatible selector string](http://api.jquery.com/category/selectors/). - This is the element that will be passed to the Application's, - `eventDispatcher`, which sets up the listeners for event delegation. Every - view in your application should be a child of the element you specify here. - @property rootElement - @type DOMElement - @default 'body' - @public - */ - rootElement: 'body', + if (options && options.resolver) { + this.resolver = options.resolver; - /** - The `Ember.EventDispatcher` responsible for delegating events to this - application's views. - The event dispatcher is created by the application at initialization time - and sets up event listeners on the DOM element described by the - application's `rootElement` property. - See the documentation for `Ember.EventDispatcher` for more information. - @property eventDispatcher - @type Ember.EventDispatcher - @default null - @public - */ - eventDispatcher: null, + if (typeof this.resolver === 'function') { + deprecateResolverFunction(this); + } + } - /** - The DOM events for which the event dispatcher should listen. - By default, the application's `Ember.EventDispatcher` listens - for a set of standard DOM events, such as `mousedown` and - `keyup`, and delegates them to your application's `Ember.View` - instances. - If you would like additional bubbling events to be delegated to your - views, set your `Ember.Application`'s `customEvents` property - to a hash containing the DOM event name as the key and the - corresponding view method name as the value. Setting an event to - a value of `null` will prevent a default event listener from being - added for that event. - To add new events to be listened to: - ```javascript - let App = Ember.Application.create({ - customEvents: { - // add support for the paste event - paste: 'paste' - } - }); - ``` - To prevent default events from being listened to: - ```javascript - let App = Ember.Application.create({ - customEvents: { - // remove support for mouseenter / mouseleave events - mouseenter: null, - mouseleave: null - } - }); - ``` - @property customEvents - @type Object - @default null - @public - */ - customEvents: null, + this.registrations = _emberUtils.dictionary(options && options.registrations ? options.registrations : null); + + this._typeInjections = _emberUtils.dictionary(null); + this._injections = _emberUtils.dictionary(null); + this._factoryTypeInjections = _emberUtils.dictionary(null); + this._factoryInjections = _emberUtils.dictionary(null); + + this._localLookupCache = new _emberUtils.EmptyObject(); + this._normalizeCache = _emberUtils.dictionary(null); + this._resolveCache = _emberUtils.dictionary(null); + this._failCache = _emberUtils.dictionary(null); + + this._options = _emberUtils.dictionary(null); + this._typeOptions = _emberUtils.dictionary(null); + } + Registry.prototype = { /** - Whether the application should automatically start routing and render - templates to the `rootElement` on DOM ready. While default by true, - other environments such as FastBoot or a testing harness can set this - property to `false` and control the precise timing and behavior of the boot - process. - @property autoboot - @type Boolean - @default true + A backup registry for resolving registrations when no matches can be found. @private - */ - autoboot: true, + @property fallback + @type Registry + */ + fallback: null, /** - Whether the application should be configured for the legacy "globals mode". - Under this mode, the Application object serves as a global namespace for all - classes. - ```javascript - let App = Ember.Application.create({ - ... - }); - App.Router.reopen({ - location: 'none' - }); - App.Router.map({ - ... - }); - App.MyComponent = Ember.Component.extend({ - ... - }); - ``` - This flag also exposes other internal APIs that assumes the existence of - a special "default instance", like `App.__container__.lookup(...)`. - This option is currently not configurable, its value is derived from - the `autoboot` flag – disabling `autoboot` also implies opting-out of - globals mode support, although they are ultimately orthogonal concerns. - Some of the global modes features are already deprecated in 1.x. The - existence of this flag is to untangle the globals mode code paths from - the autoboot code paths, so that these legacy features can be reviewed - for deprecation/removal separately. - Forcing the (autoboot=true, _globalsMode=false) here and running the tests - would reveal all the places where we are still relying on these legacy - behavior internally (mostly just tests). - @property _globalsMode - @type Boolean - @default true + An object that has a `resolve` method that resolves a name. @private - */ - _globalsMode: true, - - init: function (options) { - this._super.apply(this, arguments); - - if (!this.$) { - this.$ = _emberViews.jQuery; - } - - registerLibraries(); - logLibraryVersions(); + @property resolver + @type Resolver + */ + resolver: null, - // Start off the number of deferrals at 1. This will be decremented by - // the Application's own `boot` method. - this._readinessDeferrals = 1; - this._booted = false; + /** + @private + @property registrations + @type InheritingDict + */ + registrations: null, - this.autoboot = this._globalsMode = !!this.autoboot; + /** + @private + @property _typeInjections + @type InheritingDict + */ + _typeInjections: null, - if (this._globalsMode) { - this._prepareForGlobalsMode(); - } + /** + @private + @property _injections + @type InheritingDict + */ + _injections: null, - if (this.autoboot) { - this.waitForDOMReady(); - } - }, + /** + @private + @property _factoryTypeInjections + @type InheritingDict + */ + _factoryTypeInjections: null, /** - Create an ApplicationInstance for this application. - @private - @method buildInstance - @return {Ember.ApplicationInstance} the application instance - */ - buildInstance: function () { - var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + @private + @property _factoryInjections + @type InheritingDict + */ + _factoryInjections: null, - options.base = this; - options.application = this; - return _emberApplicationSystemApplicationInstance.default.create(options); - }, + /** + @private + @property _normalizeCache + @type InheritingDict + */ + _normalizeCache: null, /** - Enable the legacy globals mode by allowing this application to act - as a global namespace. See the docs on the `_globalsMode` property - for details. - Most of these features are already deprecated in 1.x, so we can - stop using them internally and try to remove them. - @private - @method _prepareForGlobalsMode - */ - _prepareForGlobalsMode: function () { - // 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`. - this.Router = (this.Router || _emberRouting.Router).extend(); + @private + @property _resolveCache + @type InheritingDict + */ + _resolveCache: null, - this._buildDeprecatedInstance(); - }, + /** + @private + @property _options + @type InheritingDict + */ + _options: null, - /* - Build the deprecated instance for legacy globals mode support. - Called when creating and resetting the application. - This is orthogonal to autoboot: the deprecated instance needs to - be created at Application construction (not boot) time to expose - App.__container__. If autoboot sees that this instance exists, - it will continue booting it to avoid doing unncessary work (as - opposed to building a new instance at boot time), but they are - otherwise unrelated. - @private - @method _buildDeprecatedInstance - */ - _buildDeprecatedInstance: function () { - // Build a default instance - var instance = this.buildInstance(); + /** + @private + @property _typeOptions + @type InheritingDict + */ + _typeOptions: null, - // Legacy support for App.__container__ and other global methods - // on App that rely on a single, default instance. - this.__deprecatedInstance__ = instance; - this.__container__ = instance.__container__; + /** + Creates a container based on this registry. + @private + @method container + @param {Object} options + @return {Container} created container + */ + container: function (options) { + return new _containerContainer.default(this, options); }, /** - Automatically kick-off the boot process for the application once the - DOM has become ready. - The initialization itself is scheduled on the actions queue which - ensures that code-loading finishes before booting. - If you are asynchronously loading code, you should call `deferReadiness()` - to defer booting, and then call `advanceReadiness()` once all of your code - has finished loading. - @private - @method waitForDOMReady - */ - waitForDOMReady: function () { - if (!this.$ || this.$.isReady) { - _emberMetal.run.schedule('actions', this, 'domReady'); - } else { - this.$().ready(_emberMetal.run.bind(this, 'domReady')); - } - }, + Registers a factory for later injection. + Example: + ```javascript + let registry = new Registry(); + registry.register('model:user', Person, {singleton: false }); + registry.register('fruit:favorite', Orange); + registry.register('communication:main', Email, {singleton: false}); + ``` + @private + @method register + @param {String} fullName + @param {Function} factory + @param {Object} options + */ + register: function (fullName, factory) { + var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; - /** - This is the autoboot flow: - 1. Boot the app by calling `this.boot()` - 2. Create an instance (or use the `__deprecatedInstance__` in globals mode) - 3. Boot the instance by calling `instance.boot()` - 4. Invoke the `App.ready()` callback - 5. Kick-off routing on the instance - Ideally, this is all we would need to do: - ```javascript - _autoBoot() { - this.boot().then(() => { - let instance = (this._globalsMode) ? this.__deprecatedInstance__ : this.buildInstance(); - return instance.boot(); - }).then((instance) => { - App.ready(); - instance.startRouting(); - }); - } - ``` - Unfortunately, we cannot actually write this because we need to participate - in the "synchronous" boot process. While the code above would work fine on - the initial boot (i.e. DOM ready), when `App.reset()` is called, we need to - boot a new instance synchronously (see the documentation on `_bootSync()` - for details). - Because of this restriction, the actual logic of this method is located - inside `didBecomeReady()`. - @private - @method domReady - */ - domReady: function () { - if (this.isDestroyed) { - return; + _emberMetal.assert('fullName must be a proper full name', this.validateFullName(fullName)); + + if (factory === undefined) { + throw new TypeError('Attempting to register an unknown factory: \'' + fullName + '\''); } - this._bootSync(); + var normalizedName = this.normalize(fullName); - // Continues to `didBecomeReady` + if (this._resolveCache[normalizedName]) { + throw new Error('Cannot re-register: \'' + fullName + '\', as it has already been resolved.'); + } + + delete this._failCache[normalizedName]; + this.registrations[normalizedName] = factory; + this._options[normalizedName] = options; }, /** - Use this to defer readiness until some condition is true. - Example: - ```javascript - let App = Ember.Application.create(); - App.deferReadiness(); - // Ember.$ is a reference to the jQuery object/function - Ember.$.getJSON('/auth-token', function(token) { - App.token = token; - App.advanceReadiness(); - }); - ``` - This allows you to perform asynchronous setup logic and defer - booting your application until the setup has finished. - However, if the setup requires a loading UI, it might be better - to use the router for this purpose. - @method deferReadiness - @public - */ - deferReadiness: function () { - _emberMetal.assert('You must call deferReadiness on an instance of Ember.Application', this instanceof Application); - _emberMetal.assert('You cannot defer readiness since the `ready()` hook has already been called.', this._readinessDeferrals > 0); - this._readinessDeferrals++; + Unregister a fullName + ```javascript + let registry = new Registry(); + registry.register('model:user', User); + registry.resolve('model:user').create() instanceof User //=> true + registry.unregister('model:user') + registry.resolve('model:user') === undefined //=> true + ``` + @private + @method unregister + @param {String} fullName + */ + unregister: function (fullName) { + _emberMetal.assert('fullName must be a proper full name', this.validateFullName(fullName)); + + var normalizedName = this.normalize(fullName); + + this._localLookupCache = new _emberUtils.EmptyObject(); + + delete this.registrations[normalizedName]; + delete this._resolveCache[normalizedName]; + delete this._failCache[normalizedName]; + delete this._options[normalizedName]; }, /** - Call `advanceReadiness` after any asynchronous setup logic has completed. - Each call to `deferReadiness` must be matched by a call to `advanceReadiness` - or the application will never become ready and routing will not begin. - @method advanceReadiness - @see {Ember.Application#deferReadiness} - @public - */ - advanceReadiness: function () { - _emberMetal.assert('You must call advanceReadiness on an instance of Ember.Application', this instanceof Application); - this._readinessDeferrals--; + Given a fullName return the corresponding factory. + By default `resolve` will retrieve the factory from + the registry. + ```javascript + let registry = new Registry(); + registry.register('api:twitter', Twitter); + registry.resolve('api:twitter') // => Twitter + ``` + Optionally the registry can be provided with a custom resolver. + If provided, `resolve` will first provide the custom resolver + the opportunity to resolve the fullName, otherwise it will fallback + to the registry. + ```javascript + let registry = new Registry(); + registry.resolver = function(fullName) { + // lookup via the module system of choice + }; + // the twitter factory is added to the module system + registry.resolve('api:twitter') // => Twitter + ``` + @private + @method resolve + @param {String} fullName + @param {Object} [options] + @param {String} [options.source] the fullname of the request source (used for local lookups) + @return {Function} fullName's factory + */ + resolve: function (fullName, options) { + _emberMetal.assert('fullName must be a proper full name', this.validateFullName(fullName)); + var factory = resolve(this, this.normalize(fullName), options); + if (factory === undefined && this.fallback) { + var _fallback; - if (this._readinessDeferrals === 0) { - _emberMetal.run.once(this, this.didBecomeReady); + factory = (_fallback = this.fallback).resolve.apply(_fallback, arguments); } + return factory; }, /** - Initialize the application and return a promise that resolves with the `Ember.Application` - object when the boot process is complete. - Run any application 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. - By default, this method is called automatically on "DOM ready"; however, if autoboot - is disabled, this is automatically called when the first application instance is - created via `visit`. - @private - @method boot - @return {Promise} - */ - boot: function () { - if (this._bootPromise) { - return this._bootPromise; + A hook that can be used to describe how the resolver will + attempt to find the factory. + For example, the default Ember `.describe` returns the full + class name (including namespace) where Ember's resolver expects + to find the `fullName`. + @private + @method describe + @param {String} fullName + @return {string} described fullName + */ + describe: function (fullName) { + if (this.resolver && this.resolver.lookupDescription) { + return this.resolver.lookupDescription(fullName); + } else if (this.fallback) { + return this.fallback.describe(fullName); + } else { + return fullName; } + }, - try { - this._bootSync(); - } catch (_) { - // Ignore th error: in the asynchronous boot path, the error is already reflected - // in the promise rejection + /** + A hook to enable custom fullName normalization behaviour + @private + @method normalizeFullName + @param {String} fullName + @return {string} normalized fullName + */ + normalizeFullName: function (fullName) { + if (this.resolver && this.resolver.normalize) { + return this.resolver.normalize(fullName); + } else if (this.fallback) { + return this.fallback.normalizeFullName(fullName); + } else { + return fullName; } + }, - return this._bootPromise; + /** + Normalize a fullName based on the application's conventions + @private + @method normalize + @param {String} fullName + @return {string} normalized fullName + */ + normalize: function (fullName) { + return this._normalizeCache[fullName] || (this._normalizeCache[fullName] = this.normalizeFullName(fullName)); }, /** - Unfortunately, a lot of existing code assumes the booting process is - "synchronous". Specifically, a lot of tests assumes the last call to - `app.advanceReadiness()` or `app.reset()` will result in the app being - fully-booted when the current runloop completes. - We would like new code (like the `visit` API) to stop making this assumption, - so we created the asynchronous version above that returns a promise. But until - we have migrated all the code, we would have to expose this method for use - *internally* in places where we need to boot an app "synchronously". - @private - */ - _bootSync: function () { - if (this._booted) { - return; + @method makeToString + @private + @param {any} factory + @param {string} fullName + @return {function} toString function + */ + makeToString: function (factory, fullName) { + if (this.resolver && this.resolver.makeToString) { + return this.resolver.makeToString(factory, fullName); + } else if (this.fallback) { + return this.fallback.makeToString(factory, fullName); + } else { + return factory.toString(); } + }, - // Even though this returns synchronously, we still need to make sure the - // boot promise exists for book-keeping purposes: if anything went wrong in - // the boot process, we need to store the error as a rejection on the boot - // promise so that a future caller of `boot()` can tell what failed. - var defer = this._bootResolver = new _emberRuntime.RSVP.defer(); - this._bootPromise = defer.promise; + /** + Given a fullName check if the container is aware of its factory + or singleton instance. + @private + @method has + @param {String} fullName + @param {Object} [options] + @param {String} [options.source] the fullname of the request source (used for local lookups) + @return {Boolean} + */ + has: function (fullName, options) { + if (!this.isValidFullName(fullName)) { + return false; + } - try { - this.runInitializers(); - _emberRuntime.runLoadHooks('application', this); - this.advanceReadiness(); - // Continues to `didBecomeReady` - } catch (error) { - // For the asynchronous boot path - defer.reject(error); + var source = options && options.source && this.normalize(options.source); - // For the synchronous boot path - throw error; - } + return has(this, this.normalize(fullName), source); }, /** - Reset the application. This is typically used only in tests. It cleans up - the application in the following order: - 1. Deactivate existing routes - 2. Destroy all objects in the container - 3. Create a new application container - 4. Re-route to the existing url - Typical Example: - ```javascript - let App; - run(function() { - App = Ember.Application.create(); - }); - module('acceptance test', { - setup: function() { - App.reset(); - } - }); - test('first test', function() { - // App is freshly reset - }); - test('second test', function() { - // App is again freshly reset - }); - ``` - Advanced Example: - Occasionally you may want to prevent the app from initializing during - setup. This could enable extra configuration, or enable asserting prior - to the app becoming ready. - ```javascript - let App; - run(function() { - App = Ember.Application.create(); - }); - module('acceptance test', { - setup: function() { - run(function() { - App.reset(); - App.deferReadiness(); - }); - } - }); - test('first test', function() { - ok(true, 'something before app is initialized'); - run(function() { - App.advanceReadiness(); - }); - ok(true, 'something after app is initialized'); - }); - ``` - @method reset - @public - */ - reset: function () { - _emberMetal.assert('Calling reset() on instances of `Ember.Application` is not\n supported when globals mode is disabled; call `visit()` to\n create new `Ember.ApplicationInstance`s and dispose them\n via their `destroy()` method instead.', this._globalsMode && this.autoboot); - - var instance = this.__deprecatedInstance__; - - this._readinessDeferrals = 1; - this._bootPromise = null; - this._bootResolver = null; - this._booted = false; + Allow registering options for all factories of a type. + ```javascript + let registry = new Registry(); + let container = registry.container(); + // if all of type `connection` must not be singletons + registry.optionsForType('connection', { singleton: false }); + registry.register('connection:twitter', TwitterConnection); + registry.register('connection:facebook', FacebookConnection); + let twitter = container.lookup('connection:twitter'); + let twitter2 = container.lookup('connection:twitter'); + twitter === twitter2; // => false + let facebook = container.lookup('connection:facebook'); + let facebook2 = container.lookup('connection:facebook'); + facebook === facebook2; // => false + ``` + @private + @method optionsForType + @param {String} type + @param {Object} options + */ + optionsForType: function (type, options) { + this._typeOptions[type] = options; + }, - function handleReset() { - _emberMetal.run(instance, 'destroy'); - this._buildDeprecatedInstance(); - _emberMetal.run.schedule('actions', this, '_bootSync'); + getOptionsForType: function (type) { + var optionsForType = this._typeOptions[type]; + if (optionsForType === undefined && this.fallback) { + optionsForType = this.fallback.getOptionsForType(type); } - - _emberMetal.run.join(this, handleReset); + return optionsForType; }, /** - @private - @method didBecomeReady - */ - didBecomeReady: function () { - try { - // TODO: Is this still needed for _globalsMode = false? - if (!_emberMetal.isTesting()) { - // Eagerly name all classes that are already loaded - _emberRuntime.Namespace.processAll(); - _emberRuntime.setNamespaceSearchDisabled(true); - } - - // See documentation on `_autoboot()` for details - if (this.autoboot) { - var instance = undefined; + @private + @method options + @param {String} fullName + @param {Object} options + */ + options: function (fullName) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - if (this._globalsMode) { - // If we already have the __deprecatedInstance__ lying around, boot it to - // avoid unnecessary work - instance = this.__deprecatedInstance__; - } else { - // Otherwise, build an instance and boot it. This is currently unreachable, - // because we forced _globalsMode to === autoboot; but having this branch - // allows us to locally toggle that flag for weeding out legacy globals mode - // dependencies independently - instance = this.buildInstance(); - } + var normalizedName = this.normalize(fullName); + this._options[normalizedName] = options; + }, - instance._bootSync(); + getOptions: function (fullName) { + var normalizedName = this.normalize(fullName); + var options = this._options[normalizedName]; - // TODO: App.ready() is not called when autoboot is disabled, is this correct? - this.ready(); + if (options === undefined && this.fallback) { + options = this.fallback.getOptions(fullName); + } + return options; + }, - instance.startRouting(); - } + getOption: function (fullName, optionName) { + var options = this._options[fullName]; - // For the asynchronous boot path - this._bootResolver.resolve(this); + if (options && options[optionName] !== undefined) { + return options[optionName]; + } - // For the synchronous boot path - this._booted = true; - } catch (error) { - // For the asynchronous boot path - this._bootResolver.reject(error); + var type = fullName.split(':')[0]; + options = this._typeOptions[type]; - // For the synchronous boot path - throw error; + if (options && options[optionName] !== undefined) { + return options[optionName]; + } else if (this.fallback) { + return this.fallback.getOption(fullName, optionName); } }, /** - Called when the Application has become ready, immediately before routing - begins. The call will be delayed until the DOM has become ready. - @event ready - @public - */ - ready: function () { - return this; - }, - - // This method must be moved to the application instance object - willDestroy: function () { - this._super.apply(this, arguments); - _emberRuntime.setNamespaceSearchDisabled(false); - this._booted = false; - this._bootPromise = null; - this._bootResolver = null; + 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. + For example, provided each object of type `controller` needed a `router`. + one would do the following: + ```javascript + let registry = new Registry(); + let container = registry.container(); + registry.register('router:main', Router); + registry.register('controller:user', UserController); + registry.register('controller:post', PostController); + registry.typeInjection('controller', 'router', 'router:main'); + let user = container.lookup('controller:user'); + let post = container.lookup('controller:post'); + user.router instanceof Router; //=> true + post.router instanceof Router; //=> true + // both controllers share the same router + user.router === post.router; //=> true + ``` + @private + @method typeInjection + @param {String} type + @param {String} property + @param {String} fullName + */ + typeInjection: function (type, property, fullName) { + _emberMetal.assert('fullName must be a proper full name', this.validateFullName(fullName)); - if (_emberRuntime._loaded.application === this) { - _emberRuntime._loaded.application = undefined; + var fullNameType = fullName.split(':')[0]; + if (fullNameType === type) { + throw new Error('Cannot inject a \'' + fullName + '\' on other ' + type + '(s).'); } - if (this._globalsMode && this.__deprecatedInstance__) { - this.__deprecatedInstance__.destroy(); - } + var injections = this._typeInjections[type] || (this._typeInjections[type] = []); + + injections.push({ + property: property, + fullName: fullName + }); }, /** - Boot a new instance of `Ember.ApplicationInstance` for the current - application and navigate it to the given `url`. Returns a `Promise` that - resolves with the instance when the initial routing and rendering is - complete, or rejects with any error that occured during the boot process. - When `autoboot` is disabled, calling `visit` would first cause the - application to boot, which runs the application initializers. - This method also takes a hash of boot-time configuration options for - customizing the instance's behavior. See the documentation on - `Ember.ApplicationInstance.BootOptions` for details. - `Ember.ApplicationInstance.BootOptions` is an interface class that exists - purely to document the available options; you do not need to construct it - manually. Simply pass a regular JavaScript object containing of the - desired options: - ```javascript - MyApp.visit("/", { location: "none", rootElement: "#container" }); - ``` - ### Supported Scenarios - While the `BootOptions` class exposes a large number of knobs, not all - combinations of them are valid; certain incompatible combinations might - result in unexpected behavior. - For example, booting the instance in the full browser environment - while specifying a foriegn `document` object (e.g. `{ isBrowser: true, - document: iframe.contentDocument }`) does not work correctly today, - largely due to Ember's jQuery dependency. - Currently, there are three officially supported scenarios/configurations. - Usages outside of these scenarios are not guaranteed to work, but please - feel free to file bug reports documenting your experience and any issues - you encountered to help expand support. - #### Browser Applications (Manual Boot) - The setup is largely similar to how Ember works out-of-the-box. Normally, - Ember will boot a default instance for your Application on "DOM ready". - However, you can customize this behavior by disabling `autoboot`. - For example, this allows you to render a miniture demo of your application - into a specific area on your marketing website: - ```javascript - import MyApp from 'my-app'; - $(function() { - let App = MyApp.create({ autoboot: false }); - let options = { - // Override the router's location adapter to prevent it from updating - // the URL in the address bar - location: 'none', - // Override the default `rootElement` on the app to render into a - // specific `div` on the page - rootElement: '#demo' - }; - // Start the app at the special demo URL - App.visit('/demo', options); - }); - ```` - Or perhaps you might want to boot two instances of your app on the same - page for a split-screen multiplayer experience: - ```javascript - import MyApp from 'my-app'; - $(function() { - let App = MyApp.create({ autoboot: false }); - let sessionId = MyApp.generateSessionID(); - let player1 = App.visit(`/matches/join?name=Player+1&session=${sessionId}`, { rootElement: '#left', location: 'none' }); - let player2 = App.visit(`/matches/join?name=Player+2&session=${sessionId}`, { rootElement: '#right', location: 'none' }); - Promise.all([player1, player2]).then(() => { - // Both apps have completed the initial render - $('#loading').fadeOut(); - }); - }); - ``` - Do note that each app instance maintains their own registry/container, so - they will run in complete isolation by default. - #### Server-Side Rendering (also known as FastBoot) - This setup allows you to run your Ember app in a server environment using - Node.js and render its content into static HTML for SEO purposes. - ```javascript - const HTMLSerializer = new SimpleDOM.HTMLSerializer(SimpleDOM.voidMap); - function renderURL(url) { - let dom = new SimpleDOM.Document(); - let rootElement = dom.body; - let options = { isBrowser: false, document: dom, rootElement: rootElement }; - return MyApp.visit(options).then(instance => { - try { - return HTMLSerializer.serialize(rootElement.firstChild); - } finally { - instance.destroy(); - } - }); - } - ``` - In this scenario, because Ember does not have access to a global `document` - object in the Node.js environment, you must provide one explicitly. In practice, - in the non-browser environment, the stand-in `document` object only need to - implement a limited subset of the full DOM API. The `SimpleDOM` library is known - to work. - Since there is no access to jQuery in the non-browser environment, you must also - specify a DOM `Element` object in the same `document` for the `rootElement` option - (as opposed to a selector string like `"body"`). - See the documentation on the `isBrowser`, `document` and `rootElement` properties - on `Ember.ApplicationInstance.BootOptions` for details. - #### Server-Side Resource Discovery - This setup allows you to run the routing layer of your Ember app in a server - environment using Node.js and completely disable rendering. This allows you - to simulate and discover the resources (i.e. AJAX requests) needed to fufill - a given request and eagerly "push" these resources to the client. - ```app/initializers/network-service.js - import BrowserNetworkService from 'app/services/network/browser'; - import NodeNetworkService from 'app/services/network/node'; - // Inject a (hypothetical) service for abstracting all AJAX calls and use - // the appropiate implementaion on the client/server. This also allows the - // server to log all the AJAX calls made during a particular request and use - // that for resource-discovery purpose. - export function initialize(application) { - if (window) { // browser - application.register('service:network', BrowserNetworkService); - } else { // node - application.register('service:network', NodeNetworkService); - } - application.inject('route', 'network', 'service:network'); - }; - export default { - name: 'network-service', - initialize: initialize - }; - ``` - ```app/routes/post.js - import Ember from 'ember'; - // An example of how the (hypothetical) service is used in routes. - export default Ember.Route.extend({ - model(params) { - return this.network.fetch(`/api/posts/${params.post_id}.json`); - }, - afterModel(post) { - if (post.isExternalContent) { - return this.network.fetch(`/api/external/?url=${post.externalURL}`); - } else { - return post; - } - } - }); - ``` - ```javascript - // Finally, put all the pieces together - function discoverResourcesFor(url) { - return MyApp.visit(url, { isBrowser: false, shouldRender: false }).then(instance => { - let networkService = instance.lookup('service:network'); - return networkService.requests; // => { "/api/posts/123.json": "..." } - }); + Defines injection rules. + These rules are used to inject dependencies onto objects when they + are instantiated. + Two forms of injections are possible: + * Injecting one fullName on another fullName + * Injecting one fullName on a type + Example: + ```javascript + let registry = new Registry(); + let container = registry.container(); + registry.register('source:main', Source); + registry.register('model:user', User); + registry.register('model:post', Post); + // injecting one fullName on another fullName + // eg. each user model gets a post model + registry.injection('model:user', 'post', 'model:post'); + // injecting one fullName on another type + registry.injection('model', 'source', 'source:main'); + let user = container.lookup('model:user'); + let post = container.lookup('model:post'); + user.source instanceof Source; //=> true + post.source instanceof Source; //=> true + user.post instanceof Post; //=> true + // and both models share the same source + user.source === post.source; //=> true + ``` + @private + @method injection + @param {String} factoryName + @param {String} property + @param {String} injectionName + */ + injection: function (fullName, property, injectionName) { + this.validateFullName(injectionName); + var normalizedInjectionName = this.normalize(injectionName); + + if (fullName.indexOf(':') === -1) { + return this.typeInjection(fullName, property, normalizedInjectionName); } - ``` - @public - @method visit - @param url {String} The initial URL to navigate to - @param options {Ember.ApplicationInstance.BootOptions} - @return {Promise} - */ - visit: function (url, options) { - var _this = this; - return this.boot().then(function () { - var instance = _this.buildInstance(); + _emberMetal.assert('fullName must be a proper full name', this.validateFullName(fullName)); + var normalizedName = this.normalize(fullName); - return instance.boot(options).then(function () { - return instance.visit(url); - }).catch(function (error) { - _emberMetal.run(instance, 'destroy'); - throw error; - }); - }); - } - }); + var injections = this._injections[normalizedName] || (this._injections[normalizedName] = []); - Object.defineProperty(Application.prototype, 'registry', { - configurable: true, - enumerable: false, - get: function () { - return _emberRuntime.buildFakeRegistryWithDeprecations(this, 'Application'); - } - }); + injections.push({ + property: property, + fullName: normalizedInjectionName + }); + }, - Application.reopenClass({ /** - This creates a registry with the default Ember naming conventions. - It also configures the registry: - * registered views are created every time they are looked up (they are - not singletons) - * registered templates are not factories; the registered value is - returned directly. - * the router receives the application as its `namespace` property - * all controllers receive the router as their `target` and `controllers` - properties - * 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 - @method buildRegistry - @static - @param {Ember.Application} namespace the application for which to - build the registry - @return {Ember.Registry} the built registry + Used only via `factoryInjection`. + Provides a specialized form of injection, specifically enabling + all factory of one type to be injected with a reference to another + object. + For example, provided each factory of type `model` needed a `store`. + one would do the following: + ```javascript + let registry = new Registry(); + registry.register('store:main', SomeStore); + registry.factoryTypeInjection('model', 'store', 'store:main'); + let store = registry.lookup('store:main'); + let UserFactory = registry.lookupFactory('model:user'); + UserFactory.store instanceof SomeStore; //=> true + ``` @private - */ - buildRegistry: function (application) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - - var registry = this._super.apply(this, arguments); - - commonSetupRegistry(registry); - - _emberGlimmer.setupApplicationRegistry(registry); - - return registry; - } - }); - - function commonSetupRegistry(registry) { - registry.register('-view-registry:main', { create: function () { - return _emberUtils.dictionary(null); - } }); - - registry.register('route:basic', _emberRouting.Route); - registry.register('event_dispatcher:main', _emberViews.EventDispatcher); - - registry.injection('router:main', 'namespace', 'application:main'); + @method factoryTypeInjection + @param {String} type + @param {String} property + @param {String} fullName + */ + factoryTypeInjection: function (type, property, fullName) { + var injections = this._factoryTypeInjections[type] || (this._factoryTypeInjections[type] = []); - registry.register('location:auto', _emberRouting.AutoLocation); - registry.register('location:hash', _emberRouting.HashLocation); - registry.register('location:history', _emberRouting.HistoryLocation); - registry.register('location:none', _emberRouting.NoneLocation); + injections.push({ + property: property, + fullName: this.normalize(fullName) + }); + }, - registry.register(_container.privatize(_templateObject), _emberRouting.BucketCache); - } + /** + Defines factory injection rules. + Similar to regular injection rules, but are run against factories, via + `Registry#lookupFactory`. + These rules are used to inject objects onto factories when they + are looked up. + Two forms of injections are possible: + * Injecting one fullName on another fullName + * Injecting one fullName on a type + Example: + ```javascript + let registry = new Registry(); + let container = registry.container(); + registry.register('store:main', Store); + registry.register('store:secondary', OtherStore); + registry.register('model:user', User); + registry.register('model:post', Post); + // injecting one fullName on another type + registry.factoryInjection('model', 'store', 'store:main'); + // injecting one fullName on another fullName + registry.factoryInjection('model:post', 'secondaryStore', 'store:secondary'); + let UserFactory = container.lookupFactory('model:user'); + let PostFactory = container.lookupFactory('model:post'); + let store = container.lookup('store:main'); + UserFactory.store instanceof Store; //=> true + UserFactory.secondaryStore instanceof OtherStore; //=> false + PostFactory.store instanceof Store; //=> true + PostFactory.secondaryStore instanceof OtherStore; //=> true + // and both models share the same source instance + UserFactory.store === PostFactory.store; //=> true + ``` + @private + @method factoryInjection + @param {String} factoryName + @param {String} property + @param {String} injectionName + */ + factoryInjection: function (fullName, property, injectionName) { + var normalizedName = this.normalize(fullName); + var normalizedInjectionName = this.normalize(injectionName); - function registerLibraries() { - if (!librariesRegistered) { - librariesRegistered = true; + this.validateFullName(injectionName); - if (_emberEnvironment.environment.hasDOM && typeof _emberViews.jQuery === 'function') { - _emberMetal.libraries.registerCoreLibrary('jQuery', _emberViews.jQuery().jquery); + if (fullName.indexOf(':') === -1) { + return this.factoryTypeInjection(normalizedName, property, normalizedInjectionName); } - } - } - function logLibraryVersions() { - if (_emberEnvironment.ENV.LOG_VERSION) { - // we only need to see this once per Application#init - _emberEnvironment.ENV.LOG_VERSION = false; - var libs = _emberMetal.libraries._registry; + var injections = this._factoryInjections[normalizedName] || (this._factoryInjections[normalizedName] = []); - var nameLengths = libs.map(function (item) { - return _emberMetal.get(item, 'name.length'); + injections.push({ + property: property, + fullName: normalizedInjectionName }); + }, - var maxNameLength = Math.max.apply(this, nameLengths); - - _emberMetal.debug('-------------------------------'); - for (var i = 0; i < libs.length; i++) { - var lib = libs[i]; - var spaces = new Array(maxNameLength - lib.name.length + 1).join(' '); - _emberMetal.debug([lib.name, spaces, ' : ', lib.version].join('')); - } - _emberMetal.debug('-------------------------------'); - } - } - - exports.default = Application; -}); -enifed('ember-application/system/engine-instance', ['exports', 'ember-utils', 'ember-runtime', 'ember-metal', 'container', 'ember-application/system/engine-parent'], function (exports, _emberUtils, _emberRuntime, _emberMetal, _container, _emberApplicationSystemEngineParent) { - /** - @module ember - @submodule ember-application - */ - - 'use strict'; - - var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); - - /** - The `EngineInstance` encapsulates all of the stateful aspects of a - running `Engine`. - - @public - @class Ember.EngineInstance - @extends Ember.Object - @uses RegistryProxyMixin - @uses ContainerProxyMixin - */ - - var EngineInstance = _emberRuntime.Object.extend(_emberRuntime.RegistryProxyMixin, _emberRuntime.ContainerProxyMixin, { /** - The base `Engine` for which this is an instance. - @property {Ember.Engine} engine - @private + @private + @method knownForType + @param {String} type the type to iterate over */ - base: null, - - init: function () { - this._super.apply(this, arguments); - - _emberUtils.guidFor(this); + knownForType: function (type) { + var fallbackKnown = undefined, + resolverKnown = undefined; - var base = this.base; + var localKnown = _emberUtils.dictionary(null); + var registeredNames = Object.keys(this.registrations); + for (var index = 0; index < registeredNames.length; index++) { + var fullName = registeredNames[index]; + var itemType = fullName.split(':')[0]; - if (!base) { - base = this.application; - this.base = base; + if (itemType === type) { + localKnown[fullName] = true; + } } - // Create a per-instance registry that will use the application's registry - // as a fallback for resolving registrations. - var registry = this.__registry__ = new _container.Registry({ - fallback: base.__registry__ - }); + if (this.fallback) { + fallbackKnown = this.fallback.knownForType(type); + } - // Create a per-instance container from the instance's registry - this.__container__ = registry.container({ owner: this }); + if (this.resolver && this.resolver.knownForType) { + resolverKnown = this.resolver.knownForType(type); + } - this._booted = false; + return _emberUtils.assign({}, fallbackKnown, localKnown, resolverKnown); }, - /** - Initialize the `Ember.EngineInstance` and return a promise that resolves - with the instance itself when the boot process is complete. - The primary task here is to run any registered instance initializers. - See the documentation on `BootOptions` for the options it takes. - @private - @method boot - @param options {Object} - @return {Promise} - */ - boot: function (options) { - var _this = this; - - if (this._bootPromise) { - return this._bootPromise; + validateFullName: function (fullName) { + if (!this.isValidFullName(fullName)) { + throw new TypeError('Invalid Fullname, expected: \'type:name\' got: ' + fullName); } - this._bootPromise = new _emberRuntime.RSVP.Promise(function (resolve) { - return resolve(_this._bootSync(options)); - }); + return true; + }, - return this._bootPromise; + isValidFullName: function (fullName) { + return !!VALID_FULL_NAME_REGEXP.test(fullName); }, - /** - Unfortunately, a lot of existing code assumes booting an instance is - synchronous – specifically, a lot of tests assume the last call to - `app.advanceReadiness()` or `app.reset()` will result in a new instance - being fully-booted when the current runloop completes. - We would like new code (like the `visit` API) to stop making this - assumption, so we created the asynchronous version above that returns a - promise. But until we have migrated all the code, we would have to expose - this method for use *internally* in places where we need to boot an instance - synchronously. - @private - */ - _bootSync: function (options) { - if (this._booted) { - return this; + validateInjections: function (injections) { + if (!injections) { + return; } - _emberMetal.assert('An engine instance\'s parent must be set via `setEngineParent(engine, parent)` prior to calling `engine.boot()`.', _emberApplicationSystemEngineParent.getEngineParent(this)); + var fullName = undefined; - this.cloneParentDependencies(); + for (var i = 0; i < injections.length; i++) { + fullName = injections[i].fullName; - this.setupRegistry(options); + _emberMetal.assert('Attempting to inject an unknown injection: \'' + fullName + '\'', this.has(fullName)); + } + }, - this.base.runInstanceInitializers(this); + normalizeInjectionsHash: function (hash) { + var injections = []; - this._booted = true; + for (var key in hash) { + if (hash.hasOwnProperty(key)) { + _emberMetal.assert('Expected a proper full name, given \'' + hash[key] + '\'', this.validateFullName(hash[key])); - return this; - }, + injections.push({ + property: key, + fullName: hash[key] + }); + } + } - setupRegistry: function () { - var options = arguments.length <= 0 || arguments[0] === undefined ? this.__container__.lookup('-environment:main') : arguments[0]; + return injections; + }, - this.constructor.setupRegistry(this.__registry__, options); + getInjections: function (fullName) { + var injections = this._injections[fullName] || []; + if (this.fallback) { + injections = injections.concat(this.fallback.getInjections(fullName)); + } + return injections; }, - /** - Unregister a factory. - Overrides `RegistryProxy#unregister` in order to clear any cached instances - of the unregistered factory. - @public - @method unregister - @param {String} fullName - */ - unregister: function (fullName) { - this.__container__.reset(fullName); - this._super.apply(this, arguments); + getTypeInjections: function (type) { + var injections = this._typeInjections[type] || []; + if (this.fallback) { + injections = injections.concat(this.fallback.getTypeInjections(type)); + } + return injections; }, - /** - @private - */ - willDestroy: function () { - this._super.apply(this, arguments); - _emberMetal.run(this.__container__, 'destroy'); + getFactoryInjections: function (fullName) { + var injections = this._factoryInjections[fullName] || []; + if (this.fallback) { + injections = injections.concat(this.fallback.getFactoryInjections(fullName)); + } + return injections; }, - /** - 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]; - - var Engine = this.lookup('engine:' + name); - - if (!Engine) { - throw new _emberMetal.Error('You attempted to mount the engine \'' + name + '\', but it is not registered with its parent.'); + getFactoryTypeInjections: function (type) { + var injections = this._factoryTypeInjections[type] || []; + if (this.fallback) { + injections = injections.concat(this.fallback.getFactoryTypeInjections(type)); } + return injections; + } + }; - var engineInstance = Engine.buildInstance(options); + function deprecateResolverFunction(registry) { + _emberMetal.deprecate('Passing a `resolver` function into a Registry is deprecated. Please pass in a Resolver object with a `resolve` method.', false, { id: 'ember-application.registry-resolver-as-function', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_registry-resolver-as-function' }); + registry.resolver = { + resolve: registry.resolver + }; + } - _emberApplicationSystemEngineParent.setEngineParent(engineInstance, this); + /** + Given a fullName and a source fullName returns the fully resolved + fullName. Used to allow for local lookup. + + ```javascript + let registry = new Registry(); + + // the twitter factory is added to the module system + registry.expandLocalLookup('component:post-title', { source: 'template:post' }) // => component:post/post-title + ``` + + @private + @method expandLocalLookup + @param {String} fullName + @param {Object} [options] + @param {String} [options.source] the fullname of the request source (used for local lookups) + @return {String} fullName + */ + Registry.prototype.expandLocalLookup = function Registry_expandLocalLookup(fullName, options) { + if (this.resolver && this.resolver.expandLocalLookup) { + _emberMetal.assert('fullName must be a proper full name', this.validateFullName(fullName)); + _emberMetal.assert('options.source must be provided to expandLocalLookup', options && options.source); + _emberMetal.assert('options.source must be a proper full name', this.validateFullName(options.source)); - return engineInstance; - }, + var normalizedFullName = this.normalize(fullName); + var normalizedSource = this.normalize(options.source); - /** - Clone dependencies shared between an engine instance and its parent. - @private - @method cloneParentDependencies - */ - cloneParentDependencies: function () { - var _this2 = this; + return expandLocalLookup(this, normalizedFullName, normalizedSource); + } else if (this.fallback) { + return this.fallback.expandLocalLookup(fullName, options); + } else { + return null; + } + }; - var parent = _emberApplicationSystemEngineParent.getEngineParent(this); + function expandLocalLookup(registry, normalizedName, normalizedSource) { + var cache = registry._localLookupCache; + var normalizedNameCache = cache[normalizedName]; - var registrations = ['route:basic', 'event_dispatcher:main', 'service:-routing', 'service:-glimmer-environment']; + if (!normalizedNameCache) { + normalizedNameCache = cache[normalizedName] = new _emberUtils.EmptyObject(); + } - registrations.forEach(function (key) { - return _this2.register(key, parent.resolveRegistration(key)); - }); + var cached = normalizedNameCache[normalizedSource]; - var env = parent.lookup('-environment:main'); - this.register('-environment:main', env, { instantiate: false }); + if (cached !== undefined) { + return cached; + } - var singletons = ['router:main', _container.privatize(_templateObject), '-view-registry:main', 'renderer:-' + (env.isInteractive ? 'dom' : 'inert')]; + var expanded = registry.resolver.expandLocalLookup(normalizedName, normalizedSource); - singletons.forEach(function (key) { - return _this2.register(key, parent.lookup(key), { instantiate: false }); - }); + return normalizedNameCache[normalizedSource] = expanded; + } - this.inject('view', '_environment', '-environment:main'); - this.inject('route', '_environment', '-environment:main'); - } - }); + function resolve(registry, normalizedName, options) { + if (options && options.source) { + // when `source` is provided expand normalizedName + // and source into the full normalizedName + normalizedName = registry.expandLocalLookup(normalizedName, options); - EngineInstance.reopenClass({ - /** - @private - @method setupRegistry - @param {Registry} registry - @param {BootOptions} options - */ - setupRegistry: function (registry, options) { - // when no options/environment is present, do nothing - if (!options) { + // if expandLocalLookup returns falsey, we do not support local lookup + if (!normalizedName) { return; } + } - registry.injection('view', '_environment', '-environment:main'); - registry.injection('route', '_environment', '-environment:main'); + var cached = registry._resolveCache[normalizedName]; + if (cached !== undefined) { + return cached; + } + if (registry._failCache[normalizedName]) { + return; + } - if (options.isInteractive) { - registry.injection('view', 'renderer', 'renderer:-dom'); - registry.injection('component', 'renderer', 'renderer:-dom'); - } else { - registry.injection('view', 'renderer', 'renderer:-inert'); - registry.injection('component', 'renderer', 'renderer:-inert'); - } + var resolved = undefined; + + if (registry.resolver) { + resolved = registry.resolver.resolve(normalizedName); } - }); - exports.default = EngineInstance; -}); -enifed('ember-application/system/engine-parent', ['exports', 'ember-utils'], function (exports, _emberUtils) { - 'use strict'; + if (resolved === undefined) { + resolved = registry.registrations[normalizedName]; + } - exports.getEngineParent = getEngineParent; - exports.setEngineParent = setEngineParent; - var ENGINE_PARENT = _emberUtils.symbol('ENGINE_PARENT'); + if (resolved === undefined) { + registry._failCache[normalizedName] = true; + } else { + registry._resolveCache[normalizedName] = resolved; + } - exports.ENGINE_PARENT = ENGINE_PARENT; - /** - `getEngineParent` retrieves an engine instance's parent instance. - - @method getEngineParent - @param {EngineInstance} engine An engine instance. - @return {EngineInstance} The parent engine instance. - @for Ember - @public - */ + return resolved; + } - function getEngineParent(engine) { - return engine[ENGINE_PARENT]; + function has(registry, fullName, source) { + return registry.resolve(fullName, { source: source }) !== undefined; } - /** - `setEngineParent` sets an engine instance's parent instance. - - @method setEngineParent - @param {EngineInstance} engine An engine instance. - @param {EngineInstance} parent The parent engine instance. - @private - */ + var privateNames = _emberUtils.dictionary(null); + var privateSuffix = '' + Math.random() + Date.now(); - function setEngineParent(engine, parent) { - engine[ENGINE_PARENT] = parent; + function privatize(_ref) { + var fullName = _ref[0]; + + var name = privateNames[fullName]; + if (name) { + return name; + } + + var _fullName$split = fullName.split(':'); + + var type = _fullName$split[0]; + var rawName = _fullName$split[1]; + + return privateNames[fullName] = _emberUtils.intern(type + ':' + rawName + '-' + privateSuffix); } }); -enifed('ember-application/system/engine', ['exports', 'ember-utils', 'ember-runtime', 'container', 'dag-map', 'ember-metal', 'ember-application/system/resolver', 'ember-application/system/engine-instance', 'ember-routing', 'ember-extension-support', 'ember-views', 'ember-glimmer'], function (exports, _emberUtils, _emberRuntime, _container, _dagMap, _emberMetal, _emberApplicationSystemResolver, _emberApplicationSystemEngineInstance, _emberRouting, _emberExtensionSupport, _emberViews, _emberGlimmer) { +enifed('dag-map', ['exports'], function (exports) { 'use strict'; + +/** + * A map of key/value pairs with dependencies contraints that can be traversed + * in topological order and is checked for cycles. + * + * @class DAG + * @constructor + */ +var DAG = (function () { + function DAG() { + this._vertices = new Vertices(); + } + /** + * Adds a key/value pair with dependencies on other key/value pairs. + * + * @public + * @method addEdges + * @param {string[]} key The key of the vertex to be added. + * @param {any} value The value of that vertex. + * @param {string[]|string|undefined} before A key or array of keys of the vertices that must + * be visited before this vertex. + * @param {string[]|string|undefined} after An string or array of strings with the keys of the + * vertices that must be after this vertex is visited. + */ + DAG.prototype.add = function (key, value, before, after) { + var vertices = this._vertices; + var v = vertices.add(key); + v.val = value; + if (before) { + if (typeof before === "string") { + vertices.addEdge(v, vertices.add(before)); + } + else { + for (var i = 0; i < before.length; i++) { + vertices.addEdge(v, vertices.add(before[i])); + } + } + } + if (after) { + if (typeof after === "string") { + vertices.addEdge(vertices.add(after), v); + } + else { + for (var i = 0; i < after.length; i++) { + vertices.addEdge(vertices.add(after[i]), v); + } + } + } + }; + /** + * Visits key/value pairs in topological order. + * + * @public + * @method topsort + * @param {Function} fn The function to be invoked with each key/value. + */ + DAG.prototype.topsort = function (callback) { + this._vertices.topsort(callback); + }; + return DAG; +}()); +var Vertices = (function () { + function Vertices() { + this.stack = new IntStack(); + this.result = new IntStack(); + this.vertices = []; + } + Vertices.prototype.add = function (key) { + if (!key) + throw new Error("missing key"); + var vertices = this.vertices; + var i = 0; + var vertex; + for (; i < vertices.length; i++) { + vertex = vertices[i]; + if (vertex.key === key) + return vertex; + } + return vertices[i] = { + id: i, + key: key, + val: null, + inc: null, + out: false, + mark: false + }; + }; + Vertices.prototype.addEdge = function (v, w) { + this.check(v, w.key); + var inc = w.inc; + if (!inc) { + w.inc = [v.id]; + } + else { + var i = 0; + for (; i < inc.length; i++) { + if (inc[i] === v.id) + return; + } + inc[i] = v.id; + } + v.out = true; + }; + Vertices.prototype.topsort = function (cb) { + this.reset(); + var vertices = this.vertices; + for (var i = 0; i < vertices.length; i++) { + var vertex = vertices[i]; + if (vertex.out) + continue; + this.visit(vertex, undefined); + } + this.each(cb); + }; + Vertices.prototype.check = function (v, w) { + if (v.key === w) { + throw new Error("cycle detected: " + w + " <- " + w); + } + var inc = v.inc; + // quick check + if (!inc || inc.length === 0) + return; + var vertices = this.vertices; + // shallow check + for (var i = 0; i < inc.length; i++) { + var key = vertices[inc[i]].key; + if (key === w) { + throw new Error("cycle detected: " + w + " <- " + v.key + " <- " + w); + } + } + // deep check + this.reset(); + this.visit(v, w); + if (this.result.len > 0) { + var msg_1 = "cycle detected: " + w; + this.each(function (key) { + msg_1 += " <- " + key; + }); + throw new Error(msg_1); + } + }; + Vertices.prototype.each = function (cb) { + var _a = this, result = _a.result, vertices = _a.vertices; + for (var i = 0; i < result.len; i++) { + var vertex = vertices[result.stack[i]]; + cb(vertex.key, vertex.val); + } + }; + // reuse between cycle check and topsort + Vertices.prototype.reset = function () { + this.stack.len = 0; + this.result.len = 0; + var vertices = this.vertices; + for (var i = 0; i < vertices.length; i++) { + vertices[i].mark = false; + } + }; + Vertices.prototype.visit = function (start, search) { + var _a = this, stack = _a.stack, result = _a.result, vertices = _a.vertices; + stack.push(start.id); + while (stack.len) { + var index = stack.pop(); + if (index < 0) { + index = ~index; + if (search) { + result.pop(); + } + else { + result.push(index); + } + } + else { + var vertex = vertices[index]; + if (vertex.mark) { + continue; + } + if (search) { + result.push(index); + if (search === vertex.key) { + return; + } + } + vertex.mark = true; + stack.push(~index); + var incoming = vertex.inc; + if (incoming) { + var i = incoming.length; + while (i--) { + index = incoming[i]; + if (!vertices[index].mark) { + stack.push(index); + } + } + } + } + } + }; + return Vertices; +}()); +var IntStack = (function () { + function IntStack() { + this.stack = [0, 0, 0, 0, 0, 0]; + this.len = 0; + } + IntStack.prototype.push = function (n) { + this.stack[this.len++] = n; + }; + IntStack.prototype.pop = function () { + return this.stack[--this.len]; + }; + return IntStack; +}()); + +exports['default'] = DAG; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}); +enifed('ember-application/index', ['exports', 'ember-application/initializers/dom-templates', 'ember-application/system/application', 'ember-application/system/application-instance', 'ember-application/system/resolver', 'ember-application/system/engine', 'ember-application/system/engine-instance', 'ember-application/system/engine-parent'], function (exports, _emberApplicationInitializersDomTemplates, _emberApplicationSystemApplication, _emberApplicationSystemApplicationInstance, _emberApplicationSystemResolver, _emberApplicationSystemEngine, _emberApplicationSystemEngineInstance, _emberApplicationSystemEngineParent) { /** @module ember @submodule ember-application */ + 'use strict'; - var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); + exports.Application = _emberApplicationSystemApplication.default; + exports.ApplicationInstance = _emberApplicationSystemApplicationInstance.default; + exports.Resolver = _emberApplicationSystemResolver.default; + exports.Engine = _emberApplicationSystemEngine.default; + exports.EngineInstance = _emberApplicationSystemEngineInstance.default; + exports.getEngineParent = _emberApplicationSystemEngineParent.getEngineParent; + exports.setEngineParent = _emberApplicationSystemEngineParent.setEngineParent; - function props(obj) { - var properties = []; + // add domTemplates initializer (only does something if `ember-template-compiler` + // is loaded already) +}); +enifed('ember-application/initializers/dom-templates', ['exports', 'require', 'ember-glimmer', 'ember-environment', 'ember-application/system/application'], function (exports, _require, _emberGlimmer, _emberEnvironment, _emberApplicationSystemApplication) { + 'use strict'; - for (var key in obj) { - properties.push(key); + var bootstrap = function () {}; + + _emberApplicationSystemApplication.default.initializer({ + name: 'domTemplates', + initialize: function () { + var bootstrapModuleId = 'ember-template-compiler/system/bootstrap'; + var context = undefined; + if (_emberEnvironment.environment.hasDOM && _require.has(bootstrapModuleId)) { + bootstrap = _require.default(bootstrapModuleId).default; + context = document; + } + + bootstrap({ context: context, hasTemplate: _emberGlimmer.hasTemplate, setTemplate: _emberGlimmer.setTemplate }); } + }); +}); +enifed('ember-application/system/application-instance', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-environment', 'ember-views', 'ember-application/system/engine-instance'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberEnvironment, _emberViews, _emberApplicationSystemEngineInstance) { + /** + @module ember + @submodule ember-application + */ - return properties; - } + 'use strict'; + + var BootOptions = undefined; /** - The `Engine` class contains core functionality for both applications and - engines. + The `ApplicationInstance` encapsulates all of the stateful aspects of a + running `Application`. - Each engine manages a registry that's used for dependency injection and - exposed through `RegistryProxy`. + At a high-level, we break application boot into two distinct phases: - Engines also manage initializers and instance initializers. + * Definition time, where all of the classes, templates, and other + dependencies are loaded (typically in the browser). + * Run time, where we begin executing the application once everything + has loaded. - Engines can spawn `EngineInstance` instances via `buildInstance()`. + Definition time can be expensive and only needs to happen once since it is + an idempotent operation. For example, between test runs and FastBoot + requests, the application stays the same. It is only the state that we want + to reset. + + That state is what the `ApplicationInstance` manages: it is responsible for + creating the container that contains all application state, and disposing of + it once the particular test run or FastBoot request has finished. - @class Engine - @namespace Ember - @extends Ember.Namespace - @uses RegistryProxy @public + @class Ember.ApplicationInstance + @extends Ember.EngineInstance */ - var Engine = _emberRuntime.Namespace.extend(_emberRuntime.RegistryProxyMixin, { - init: function () { - this._super.apply(this, arguments); - - this.buildRegistry(); - }, + var ApplicationInstance = _emberApplicationSystemEngineInstance.default.extend({ /** - A private flag indicating whether an engine's initializers have run yet. - @private - @property _initializersRan + The `Application` for which this is an instance. + @property {Ember.Application} application + @private */ - _initializersRan: false, + application: null, /** - Ensure that initializers are run once, and only once, per engine. + The DOM events for which the event dispatcher should listen. + By default, the application's `Ember.EventDispatcher` listens + for a set of standard DOM events, such as `mousedown` and + `keyup`, and delegates them to your application's `Ember.View` + instances. @private - @method ensureInitializers + @property {Object} customEvents */ - ensureInitializers: function () { - if (!this._initializersRan) { - this.runInitializers(); - this._initializersRan = true; - } - }, + customEvents: null, /** - Create an EngineInstance for this engine. + The root DOM element of the Application as an element or a + [jQuery-compatible selector + string](http://api.jquery.com/category/selectors/). @private - @method buildInstance - @return {Ember.EngineInstance} the engine instance + @property {String|DOMElement} rootElement */ - buildInstance: function () { - var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + rootElement: null, - this.ensureInitializers(); - options.base = this; - return _emberApplicationSystemEngineInstance.default.create(options); + init: function () { + this._super.apply(this, arguments); + + // Register this instance in the per-instance registry. + // + // Why do we need to register the instance in the first place? + // Because we need a good way for the root route (a.k.a ApplicationRoute) + // to notify us when it has created the root-most view. That view is then + // appended to the rootElement, in the case of apps, to the fixture harness + // in tests, or rendered to a string in the case of FastBoot. + this.register('-application-instance:main', this, { instantiate: false }); }, /** - Build and configure the registry for the current engine. + Overrides the base `EngineInstance._bootSync` method with concerns relevant + to booting application (instead of engine) instances. + This method should only contain synchronous boot concerns. Asynchronous + boot concerns should eventually be moved to the `boot` method, which + returns a promise. + Until all boot code has been made asynchronous, we need to continue to + expose this method for use *internally* in places where we need to boot an + instance synchronously. @private - @method buildRegistry - @return {Ember.Registry} the configured registry */ - buildRegistry: function () { - var registry = this.__registry__ = this.constructor.buildRegistry(this); - - return registry; - }, + _bootSync: function (options) { + if (this._booted) { + return this; + } - /** - @private - @method initializer - */ - initializer: function (options) { - this.constructor.initializer(options); - }, + options = new BootOptions(options); - /** - @private - @method instanceInitializer - */ - instanceInitializer: function (options) { - this.constructor.instanceInitializer(options); - }, + this.setupRegistry(options); - /** - @private - @method runInitializers - */ - runInitializers: function () { - var _this = this; + if (options.rootElement) { + this.rootElement = options.rootElement; + } else { + this.rootElement = this.application.rootElement; + } - this._runInitializer('initializers', function (name, initializer) { - _emberMetal.assert('No application initializer named \'' + name + '\'', !!initializer); - if (initializer.initialize.length === 2) { - _emberMetal.deprecate('The `initialize` method for Application initializer \'' + name + '\' should take only one argument - `App`, an instance of an `Application`.', false, { - id: 'ember-application.app-initializer-initialize-arguments', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_initializer-arity' - }); + if (options.location) { + var router = _emberMetal.get(this, 'router'); + _emberMetal.set(router, 'location', options.location); + } - initializer.initialize(_this.__registry__, _this); - } else { - initializer.initialize(_this); - } - }); - }, + this.application.runInstanceInitializers(this); - /** - @private - @since 1.12.0 - @method runInstanceInitializers - */ - runInstanceInitializers: function (instance) { - this._runInitializer('instanceInitializers', function (name, initializer) { - _emberMetal.assert('No instance initializer named \'' + name + '\'', !!initializer); - initializer.initialize(instance); - }); - }, + if (options.isInteractive) { + this.setupEventDispatcher(); + } - _runInitializer: function (bucketName, cb) { - var initializersByName = _emberMetal.get(this.constructor, bucketName); - var initializers = props(initializersByName); - var graph = new _dagMap.default(); - var initializer = undefined; + this._booted = true; - for (var i = 0; i < initializers.length; i++) { - initializer = initializersByName[initializers[i]]; - graph.add(initializer.name, initializer, initializer.before, initializer.after); - } + return this; + }, - graph.topsort(cb); - } - }); + setupRegistry: function (options) { + this.constructor.setupRegistry(this.__registry__, options); + }, - Engine.reopenClass({ - initializers: new _emberUtils.EmptyObject(), - instanceInitializers: new _emberUtils.EmptyObject(), + router: _emberMetal.computed(function () { + return this.lookup('router:main'); + }).readOnly(), /** - The goal of initializers should be to register dependencies and injections. - This phase runs once. Because these initializers may load code, they are - allowed to defer application readiness and advance it. If you need to access - the container or store you should use an InstanceInitializer that will be run - after all initializers and therefore after all code is loaded and the app is - ready. - Initializer receives an object which has the following attributes: - `name`, `before`, `after`, `initialize`. The only required attribute is - `initialize`, all others are optional. - * `name` allows you to specify under which name the initializer is registered. - This must be a unique name, as trying to register two initializers with the - same name will result in an error. - ```javascript - Ember.Application.initializer({ - name: 'namedInitializer', - initialize: function(application) { - Ember.debug('Running namedInitializer!'); - } - }); - ``` - * `before` and `after` are used to ensure that this initializer is ran prior - or after the one identified by the value. This value can be a single string - or an array of strings, referencing the `name` of other initializers. - An example of ordering initializers, we create an initializer named `first`: - ```javascript - Ember.Application.initializer({ - name: 'first', - initialize: function(application) { - Ember.debug('First initializer!'); - } - }); - // DEBUG: First initializer! - ``` - We add another initializer named `second`, specifying that it should run - after the initializer named `first`: - ```javascript - Ember.Application.initializer({ - name: 'second', - after: 'first', - initialize: function(application) { - Ember.debug('Second initializer!'); - } - }); - // DEBUG: First initializer! - // DEBUG: Second initializer! - ``` - Afterwards we add a further initializer named `pre`, this time specifying - that it should run before the initializer named `first`: - ```javascript - Ember.Application.initializer({ - name: 'pre', - before: 'first', - initialize: function(application) { - Ember.debug('Pre initializer!'); - } - }); - // DEBUG: Pre initializer! - // DEBUG: First initializer! - // DEBUG: Second initializer! - ``` - Finally we add an initializer named `post`, specifying it should run after - both the `first` and the `second` initializers: - ```javascript - Ember.Application.initializer({ - name: 'post', - after: ['first', 'second'], - initialize: function(application) { - Ember.debug('Post initializer!'); - } - }); - // DEBUG: Pre initializer! - // DEBUG: First initializer! - // DEBUG: Second initializer! - // DEBUG: Post initializer! - ``` - * `initialize` is a callback function that receives one argument, - `application`, on which you can operate. - Example of using `application` to register an adapter: - ```javascript - Ember.Application.initializer({ - name: 'api-adapter', - initialize: function(application) { - application.register('api-adapter:main', ApiAdapter); - } - }); - ``` - @method initializer - @param initializer {Object} - @public + This hook is called by the root-most Route (a.k.a. the ApplicationRoute) + when it has finished creating the root View. By default, we simply take the + view and append it to the `rootElement` specified on the Application. + In cases like FastBoot and testing, we can override this hook and implement + custom behavior, such as serializing to a string and sending over an HTTP + socket rather than appending to DOM. + @param view {Ember.View} the root-most view + @private */ - - initializer: buildInitializerMethod('initializers', 'initializer'), + didCreateRootView: function (view) { + view.appendTo(this.rootElement); + }, /** - Instance initializers run after all initializers have run. Because - instance initializers run after the app is fully set up. We have access - to the store, container, and other items. However, these initializers run - after code has loaded and are not allowed to defer readiness. - Instance initializer receives an object which has the following attributes: - `name`, `before`, `after`, `initialize`. The only required attribute is - `initialize`, all others are optional. - * `name` allows you to specify under which name the instanceInitializer is - registered. This must be a unique name, as trying to register two - instanceInitializer with the same name will result in an error. - ```javascript - Ember.Application.instanceInitializer({ - name: 'namedinstanceInitializer', - initialize: function(application) { - Ember.debug('Running namedInitializer!'); - } - }); - ``` - * `before` and `after` are used to ensure that this initializer is ran prior - or after the one identified by the value. This value can be a single string - or an array of strings, referencing the `name` of other initializers. - * See Ember.Application.initializer for discussion on the usage of before - and after. - Example instanceInitializer to preload data into the store. - ```javascript - Ember.Application.initializer({ - name: 'preload-data', - initialize: function(application) { - var userConfig, userConfigEncoded, store; - // We have a HTML escaped JSON representation of the user's basic - // configuration generated server side and stored in the DOM of the main - // index.html file. This allows the app to have access to a set of data - // without making any additional remote calls. Good for basic data that is - // needed for immediate rendering of the page. Keep in mind, this data, - // like all local models and data can be manipulated by the user, so it - // should not be relied upon for security or authorization. - // - // Grab the encoded data from the meta tag - userConfigEncoded = Ember.$('head meta[name=app-user-config]').attr('content'); - // Unescape the text, then parse the resulting JSON into a real object - userConfig = JSON.parse(unescape(userConfigEncoded)); - // Lookup the store - store = application.lookup('service:store'); - // Push the encoded JSON into the store - store.pushPayload(userConfig); - } - }); - ``` - @method instanceInitializer - @param instanceInitializer - @public + Tells the router to start routing. The router will ask the location for the + current URL of the page to determine the initial URL to start routing to. + To start the app at a specific URL, call `handleURL` instead. + @private */ - instanceInitializer: buildInitializerMethod('instanceInitializers', 'instance initializer'), + startRouting: function () { + var router = _emberMetal.get(this, 'router'); + router.startRouting(); + this._didSetupRouter = true; + }, /** - This creates a registry with the default Ember naming conventions. - It also configures the registry: - * registered views are created every time they are looked up (they are - not singletons) - * registered templates are not factories; the registered value is - returned directly. - * the router receives the application as its `namespace` property - * all controllers receive the router as their `target` and `controllers` - properties - * 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 - @method buildRegistry - @static - @param {Ember.Application} namespace the application for which to - build the registry - @return {Ember.Registry} the built registry @private + Sets up the router, initializing the child router and configuring the + location before routing begins. + Because setup should only occur once, multiple calls to `setupRouter` + beyond the first call have no effect. */ - buildRegistry: function (namespace) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - - var registry = new _container.Registry({ - resolver: resolverFor(namespace) - }); - - registry.set = _emberMetal.set; - - registry.register('application:main', namespace, { instantiate: false }); - - commonSetupRegistry(registry); - _emberGlimmer.setupEngineRegistry(registry); + setupRouter: function () { + if (this._didSetupRouter) { + return; + } + this._didSetupRouter = true; - return registry; + var router = _emberMetal.get(this, 'router'); + router.setupRouter(); }, /** - Set this to provide an alternate class to `Ember.DefaultResolver` - @deprecated Use 'Resolver' instead - @property resolver - @public + Directs the router to route to a particular URL. This is useful in tests, + for example, to tell the app to start at a particular URL. + @param url {String} the URL the router should route to + @private */ - resolver: null, + handleURL: function (url) { + var router = _emberMetal.get(this, 'router'); + + this.setupRouter(); + return router.handleURL(url); + }, /** - Set this to provide an alternate class to `Ember.DefaultResolver` - @property resolver - @public + @private */ - Resolver: null - }); - - /** - This function defines the default lookup rules for container lookups: - - * templates are looked up on `Ember.TEMPLATES` - * other names are looked up on the application after classifying the name. - For example, `controller:post` looks up `App.PostController` by default. - * if the default lookup fails, look for registered classes on the container - - This allows the application to register default injections in the container - that could be overridden by the normal naming convention. - - @private - @method resolverFor - @param {Ember.Namespace} namespace the namespace to look for classes - @return {*} the resolved value for a given lookup - */ - function resolverFor(namespace) { - var ResolverClass = namespace.get('Resolver') || _emberApplicationSystemResolver.default; - - return ResolverClass.create({ - namespace: namespace - }); - } - - function buildInitializerMethod(bucketName, humanName) { - return function (initializer) { - // If this is the first initializer being added to a subclass, we are going to reopen the class - // to make sure we have a new `initializers` object, which extends from the parent class' using - // prototypal inheritance. Without this, attempting to add initializers to the subclass would - // pollute the parent class as well as other subclasses. - if (this.superclass[bucketName] !== undefined && this.superclass[bucketName] === this[bucketName]) { - var attrs = {}; - attrs[bucketName] = Object.create(this[bucketName]); - this.reopenClass(attrs); - } + setupEventDispatcher: function () { + var dispatcher = this.lookup('event_dispatcher:main'); + var applicationCustomEvents = _emberMetal.get(this.application, 'customEvents'); + var instanceCustomEvents = _emberMetal.get(this, 'customEvents'); - _emberMetal.assert('The ' + humanName + ' \'' + initializer.name + '\' has already been registered', !this[bucketName][initializer.name]); - _emberMetal.assert('An ' + humanName + ' cannot be registered without an initialize function', _emberUtils.canInvoke(initializer, 'initialize')); - _emberMetal.assert('An ' + humanName + ' cannot be registered without a name property', initializer.name !== undefined); + var customEvents = _emberUtils.assign({}, applicationCustomEvents, instanceCustomEvents); + dispatcher.setup(customEvents, this.rootElement); - this[bucketName][initializer.name] = initializer; - }; - } + return dispatcher; + }, - function commonSetupRegistry(registry) { - registry.optionsForType('component', { singleton: false }); - registry.optionsForType('view', { singleton: false }); + /** + Returns the current URL of the app instance. This is useful when your + app does not update the browsers URL bar (i.e. it uses the `'none'` + location adapter). + @public + @return {String} the current URL + */ + getURL: function () { + var router = _emberMetal.get(this, 'router'); + return _emberMetal.get(router, 'url'); + }, - registry.register('controller:basic', _emberRuntime.Controller, { instantiate: false }); + // `instance.visit(url)` should eventually replace `instance.handleURL()`; + // the test helpers can probably be switched to use this implementation too - registry.injection('view', '_viewRegistry', '-view-registry:main'); - registry.injection('renderer', '_viewRegistry', '-view-registry:main'); - registry.injection('event_dispatcher:main', '_viewRegistry', '-view-registry:main'); + /** + Navigate the instance to a particular URL. This is useful in tests, for + example, or to tell the app to start at a particular URL. This method + returns a promise that resolves with the app instance when the transition + is complete, or rejects if the transion was aborted due to an error. + @public + @param url {String} the destination URL + @return {Promise} + */ + visit: function (url) { + var _this = this; - registry.injection('route', '_topLevelViewTemplate', 'template:-outlet'); + this.setupRouter(); - registry.injection('view:-outlet', 'namespace', 'application:main'); + var bootOptions = this.__container__.lookup('-environment:main'); - registry.injection('controller', 'target', 'router:main'); - registry.injection('controller', 'namespace', 'application:main'); + var router = _emberMetal.get(this, 'router'); - registry.injection('router', '_bucketCache', _container.privatize(_templateObject)); - registry.injection('route', '_bucketCache', _container.privatize(_templateObject)); + var handleTransitionResolve = function () { + if (!bootOptions.options.shouldRender) { + // No rendering is needed, and routing has completed, simply return. + return _this; + } else { + return new _emberRuntime.RSVP.Promise(function (resolve) { + // Resolve once rendering is completed. `router.handleURL` returns the transition (as a thennable) + // which resolves once the transition is completed, but the transition completion only queues up + // a scheduled revalidation (into the `render` queue) in the Renderer. + // + // This uses `run.schedule('afterRender', ....)` to resolve after that rendering has completed. + _emberMetal.run.schedule('afterRender', null, resolve, _this); + }); + } + }; - registry.injection('route', 'router', 'router:main'); + var handleTransitionReject = function (error) { + if (error.error) { + throw error.error; + } else if (error.name === 'TransitionAborted' && router.router.activeTransition) { + return router.router.activeTransition.then(handleTransitionResolve, handleTransitionReject); + } else if (error.name === 'TransitionAborted') { + throw new Error(error.message); + } else { + throw error; + } + }; - // Register the routing service... - registry.register('service:-routing', _emberRouting.RoutingService); - // Then inject the app router into it - registry.injection('service:-routing', 'router', 'router:main'); + var location = _emberMetal.get(router, 'location'); - // DEBUGGING - registry.register('resolver-for-debugging:main', registry.resolver, { instantiate: false }); - registry.injection('container-debug-adapter:main', 'resolver', 'resolver-for-debugging:main'); - registry.injection('data-adapter:main', 'containerDebugAdapter', 'container-debug-adapter:main'); - // Custom resolver authors may want to register their own ContainerDebugAdapter with this key + // Keeps the location adapter's internal URL in-sync + location.setURL(url); - registry.register('container-debug-adapter:main', _emberExtensionSupport.ContainerDebugAdapter); + // getURL returns the set url with the rootURL stripped off + return router.handleURL(location.getURL()).then(handleTransitionResolve, handleTransitionReject); + } + }); - registry.register('component-lookup:main', _emberViews.ComponentLookup); - } + ApplicationInstance.reopenClass({ + /** + @private + @method setupRegistry + @param {Registry} registry + @param {BootOptions} options + */ + setupRegistry: function (registry) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - exports.default = Engine; -}); -enifed('ember-application/system/resolver', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-application/utils/validate-type', 'ember-glimmer'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberApplicationUtilsValidateType, _emberGlimmer) { - /** - @module ember - @submodule ember-application - */ + if (!options.toEnvironment) { + options = new BootOptions(options); + } - 'use strict'; + registry.register('-environment:main', options.toEnvironment(), { instantiate: false }); + registry.register('service:-document', options.document, { instantiate: false }); - var Resolver = _emberRuntime.Object.extend({ - /* - This will be set to the Application instance when it is - created. - @property namespace - */ - namespace: null, - normalize: null, // required - resolve: null, // required - parseName: null, // required - lookupDescription: null, // required - makeToString: null, // required - resolveOther: null, // required - _logLookup: null // required + this._super(registry, options); + } }); - exports.Resolver = Resolver; /** - The DefaultResolver defines the default lookup rules to resolve - container lookups before consulting the container for registered - items: - - * templates are looked up on `Ember.TEMPLATES` - * other names are looked up on the application after converting - the name. For example, `controller:post` looks up - `App.PostController` by default. - * there are some nuances (see examples below) - - ### How Resolving Works - - The container calls this object's `resolve` method with the - `fullName` argument. - - It first parses the fullName into an object using `parseName`. - - Then it checks for the presence of a type-specific instance - method of the form `resolve[Type]` and calls it if it exists. - For example if it was resolving 'template:post', it would call - the `resolveTemplate` method. - - Its last resort is to call the `resolveOther` method. + A list of boot-time configuration options for customizing the behavior of + an `Ember.ApplicationInstance`. - The methods of this object are designed to be easy to override - in a subclass. For example, you could enhance how a template - is resolved like so: + This is an interface class that exists purely to document the available + options; you do not need to construct it manually. Simply pass a regular + JavaScript object containing the desired options into methods that require + one of these options object: ```javascript - App = Ember.Application.create({ - Resolver: Ember.DefaultResolver.extend({ - resolveTemplate: function(parsedName) { - let resolvedTemplate = this._super(parsedName); - if (resolvedTemplate) { return resolvedTemplate; } - return Ember.TEMPLATES['not_found']; - } - }) - }); + MyApp.visit("/", { location: "none", rootElement: "#container" }); ``` - Some examples of how names are resolved: + Not all combinations of the supported options are valid. See the documentation + on `Ember.Application#visit` for the supported configurations. - ``` - 'template:post' //=> Ember.TEMPLATES['post'] - 'template:posts/byline' //=> Ember.TEMPLATES['posts/byline'] - 'template:posts.byline' //=> Ember.TEMPLATES['posts/byline'] - 'template:blogPost' //=> Ember.TEMPLATES['blogPost'] - // OR - // Ember.TEMPLATES['blog_post'] - 'controller:post' //=> App.PostController - 'controller:posts.index' //=> App.PostsIndexController - 'controller:blog/post' //=> Blog.PostController - 'controller:basic' //=> Ember.Controller - 'route:post' //=> App.PostRoute - 'route:posts.index' //=> App.PostsIndexRoute - 'route:blog/post' //=> Blog.PostRoute - 'route:basic' //=> Ember.Route - 'view:post' //=> App.PostView - 'view:posts.index' //=> App.PostsIndexView - 'view:blog/post' //=> Blog.PostView - 'view:basic' //=> Ember.View - 'foo:post' //=> App.PostFoo - 'model:post' //=> App.Post - ``` + Internal, experimental or otherwise unstable flags are marked as private. - @class DefaultResolver - @namespace Ember - @extends Ember.Object + @class BootOptions + @namespace Ember.ApplicationInstance @public */ - - exports.default = _emberRuntime.Object.extend({ - /** - This will be set to the Application instance when it is - created. - @property namespace - @public - */ - namespace: null, - - init: function () { - this._parseNameCache = _emberUtils.dictionary(null); - }, - normalize: function (fullName) { - var _fullName$split = fullName.split(':', 2); - - var type = _fullName$split[0]; - var name = _fullName$split[1]; - - _emberMetal.assert('Tried to normalize a container name without a colon (:) in it. ' + 'You probably tried to lookup a name that did not contain a type, ' + 'a colon, and a name. A proper lookup name would be `view:post`.', fullName.split(':').length === 2); - - if (type !== 'template') { - var result = name; - - if (result.indexOf('.') > -1) { - 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(); - }); - } - - if (name.indexOf('-') > -1) { - result = result.replace(/-(.)/g, function (m) { - return m.charAt(1).toUpperCase(); - }); - } - - return type + ':' + result; - } else { - return fullName; - } - }, - - /** - This method is called via the container's resolver method. - It parses the provided `fullName` and then looks up and - returns the appropriate template or class. - @method resolve - @param {String} fullName the lookup string - @return {Object} the resolved factory - @public - */ - resolve: function (fullName) { - var parsedName = this.parseName(fullName); - var resolveMethodName = parsedName.resolveMethodName; - var resolved; - - if (this[resolveMethodName]) { - resolved = this[resolveMethodName](parsedName); - } - - resolved = resolved || this.resolveOther(parsedName); - - if (parsedName.root && parsedName.root.LOG_RESOLVER) { - this._logLookup(resolved, parsedName); - } - - if (resolved) { - _emberApplicationUtilsValidateType.default(resolved, parsedName); - } - - return resolved; - }, + BootOptions = function BootOptions() { + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; /** - Convert the string name of the form 'type:name' to - a Javascript object with the parsed aspects of the name - broken out. - @param {String} fullName the lookup string - @method parseName - @protected + Provide a specific instance of jQuery. This is useful in conjunction with + the `document` option, as it allows you to use a copy of `jQuery` that is + appropriately bound to the foreign `document` (e.g. a jsdom). + This is highly experimental and support very incomplete at the moment. + @property jQuery + @type Object + @default auto-detected + @private */ - - parseName: function (fullName) { - return this._parseNameCache[fullName] || (this._parseNameCache[fullName] = this._parseName(fullName)); - }, - - _parseName: function (fullName) { - var _fullName$split2 = fullName.split(':'); - - var type = _fullName$split2[0]; - var fullNameWithoutType = _fullName$split2[1]; - - var name = fullNameWithoutType; - var namespace = _emberMetal.get(this, 'namespace'); - var root = namespace; - var lastSlashIndex = name.lastIndexOf('/'); - var dirname = lastSlashIndex !== -1 ? name.slice(0, lastSlashIndex) : null; - - if (type !== 'template' && lastSlashIndex !== -1) { - var parts = name.split('/'); - name = parts[parts.length - 1]; - var namespaceName = _emberRuntime.String.capitalize(parts.slice(0, -1).join('.')); - root = _emberRuntime.Namespace.byName(namespaceName); - - _emberMetal.assert('You are looking for a ' + name + ' ' + type + ' in the ' + namespaceName + ' namespace, but the namespace could not be found', root); - } - - var resolveMethodName = fullNameWithoutType === 'main' ? 'Main' : _emberRuntime.String.classify(type); - - if (!(name && type)) { - throw new TypeError('Invalid fullName: `' + fullName + '`, must be of the form `type:name` '); - } - - return { - fullName: fullName, - type: type, - fullNameWithoutType: fullNameWithoutType, - dirname: dirname, - name: name, - root: root, - resolveMethodName: 'resolve' + resolveMethodName - }; - }, + this.jQuery = _emberViews.jQuery; // This default is overridable below /** - 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. - @param {String} fullName the lookup string - @method lookupDescription - @protected + Interactive mode: whether we need to set up event delegation and invoke + lifecycle callbacks on Components. + @property isInteractive + @type boolean + @default auto-detected + @private */ - lookupDescription: function (fullName) { - var parsedName = this.parseName(fullName); - var description = undefined; - - if (parsedName.type === 'template') { - return 'template at ' + parsedName.fullNameWithoutType.replace(/\./g, '/'); - } - - description = parsedName.root + '.' + _emberRuntime.String.classify(parsedName.name).replace(/\./g, ''); - - if (parsedName.type !== 'model') { - description += _emberRuntime.String.classify(parsedName.type); - } - - return description; - }, - - makeToString: function (factory, fullName) { - return factory.toString(); - }, + this.isInteractive = _emberEnvironment.environment.hasDOM; // This default is overridable below /** - Given a parseName object (output from `parseName`), apply - the conventions expected by `Ember.Router` - @param {Object} parsedName a parseName object with the parsed - fullName lookup string - @method useRouterNaming - @protected - */ - useRouterNaming: function (parsedName) { - parsedName.name = parsedName.name.replace(/\./g, '_'); - if (parsedName.name === 'basic') { - parsedName.name = ''; - } - }, - /** - Look up the template in Ember.TEMPLATES - @param {Object} parsedName a parseName object with the parsed - fullName lookup string - @method resolveTemplate - @protected + Run in a full browser environment. + When this flag is set to `false`, it will disable most browser-specific + and interactive features. Specifically: + * It does not use `jQuery` to append the root view; the `rootElement` + (either specified as a subsequent option or on the application itself) + must already be an `Element` in the given `document` (as opposed to a + string selector). + * It does not set up an `EventDispatcher`. + * It does not run any `Component` lifecycle hooks (such as `didInsertElement`). + * It sets the `location` option to `"none"`. (If you would like to use + the location adapter specified in the app's router instead, you can also + specify `{ location: null }` to specifically opt-out.) + @property isBrowser + @type boolean + @default auto-detected + @public */ - resolveTemplate: function (parsedName) { - var templateName = parsedName.fullNameWithoutType.replace(/\./g, '/'); + if (options.isBrowser !== undefined) { + this.isBrowser = !!options.isBrowser; + } else { + this.isBrowser = _emberEnvironment.environment.hasDOM; + } - return _emberGlimmer.getTemplate(templateName) || _emberGlimmer.getTemplate(_emberRuntime.String.decamelize(templateName)); - }, + if (!this.isBrowser) { + this.jQuery = null; + this.isInteractive = false; + this.location = 'none'; + } /** - Lookup the view using `resolveOther` - @param {Object} parsedName a parseName object with the parsed - fullName lookup string - @method resolveView - @protected + Disable rendering completely. + When this flag is set to `true`, it will disable the entire rendering + pipeline. Essentially, this puts the app into "routing-only" mode. No + templates will be rendered, and no Components will be created. + @property shouldRender + @type boolean + @default true + @public */ - resolveView: function (parsedName) { - this.useRouterNaming(parsedName); - return this.resolveOther(parsedName); - }, + if (options.shouldRender !== undefined) { + this.shouldRender = !!options.shouldRender; + } else { + this.shouldRender = true; + } - /** - Lookup the controller using `resolveOther` - @param {Object} parsedName a parseName object with the parsed - fullName lookup string - @method resolveController - @protected - */ - resolveController: function (parsedName) { - this.useRouterNaming(parsedName); - return this.resolveOther(parsedName); - }, - /** - Lookup the route using `resolveOther` - @param {Object} parsedName a parseName object with the parsed - fullName lookup string - @method resolveRoute - @protected - */ - resolveRoute: function (parsedName) { - this.useRouterNaming(parsedName); - return this.resolveOther(parsedName); - }, + if (!this.shouldRender) { + this.jQuery = null; + this.isInteractive = false; + } /** - Lookup the model on the Application namespace - @param {Object} parsedName a parseName object with the parsed - fullName lookup string - @method resolveModel - @protected + If present, render into the given `Document` object instead of the + global `window.document` object. + In practice, this is only useful in non-browser environment or in + non-interactive mode, because Ember's `jQuery` dependency is + implicitly bound to the current document, causing event delegation + to not work properly when the app is rendered into a foreign + document object (such as an iframe's `contentDocument`). + In non-browser mode, this could be a "`Document`-like" object as + Ember only interact with a small subset of the DOM API in non- + interactive mode. While the exact requirements have not yet been + formalized, the `SimpleDOM` library's implementation is known to + work. + @property document + @type Document + @default the global `document` object + @public */ - resolveModel: function (parsedName) { - var className = _emberRuntime.String.classify(parsedName.name); - var factory = _emberMetal.get(parsedName.root, className); + if (options.document) { + this.document = options.document; + } else { + this.document = typeof document !== 'undefined' ? document : null; + } - return factory; - }, - /** - Look up the specified object (from parsedName) on the appropriate - namespace (usually on the Application) - @param {Object} parsedName a parseName object with the parsed - fullName lookup string - @method resolveHelper - @protected - */ - resolveHelper: function (parsedName) { - return this.resolveOther(parsedName); - }, /** - Look up the specified object (from parsedName) on the appropriate - namespace (usually on the Application) - @param {Object} parsedName a parseName object with the parsed - fullName lookup string - @method resolveOther - @protected - */ - resolveOther: function (parsedName) { - var className = _emberRuntime.String.classify(parsedName.name) + _emberRuntime.String.classify(parsedName.type); - var factory = _emberMetal.get(parsedName.root, className); - return factory; - }, + If present, overrides the application's `rootElement` property on + the instance. This is useful for testing environment, where you + might want to append the root view to a fixture area. + In non-browser mode, because Ember does not have access to jQuery, + this options must be specified as a DOM `Element` object instead of + a selector string. + See the documentation on `Ember.Applications`'s `rootElement` for + details. + @property rootElement + @type String|Element + @default null + @public + */ + if (options.rootElement) { + this.rootElement = options.rootElement; + } - resolveMain: function (parsedName) { - var className = _emberRuntime.String.classify(parsedName.type); - return _emberMetal.get(parsedName.root, className); - }, + // Set these options last to give the user a chance to override the + // defaults from the "combo" options like `isBrowser` (although in + // practice, the resulting combination is probably invalid) /** - @method _logLookup - @param {Boolean} found - @param {Object} parsedName - @private + If present, overrides the router's `location` property with this + value. This is useful for environments where trying to modify the + URL would be inappropriate. + @property location + @type string + @default null + @public */ - _logLookup: function (found, parsedName) { - var symbol = undefined, - padding = undefined; - - if (found) { - symbol = '[✓]'; - } else { - symbol = '[ ]'; - } - - if (parsedName.fullName.length > 60) { - padding = '.'; - } else { - padding = new Array(60 - parsedName.fullName.length).join('.'); - } - - _emberMetal.info(symbol, parsedName.fullName, padding, this.lookupDescription(parsedName.fullName)); - }, + if (options.location !== undefined) { + this.location = options.location; + } - /** - Used to iterate all items of a given type. - @method knownForType - @param {String} type the type to search for - @private - */ - knownForType: function (type) { - var namespace = _emberMetal.get(this, 'namespace'); - var suffix = _emberRuntime.String.classify(type); - var typeRegexp = new RegExp(suffix + '$'); + if (options.jQuery !== undefined) { + this.jQuery = options.jQuery; + } - var known = _emberUtils.dictionary(null); - var knownKeys = Object.keys(namespace); - for (var index = 0; index < knownKeys.length; index++) { - var _name = knownKeys[index]; + if (options.isInteractive !== undefined) { + this.isInteractive = !!options.isInteractive; + } + }; - if (typeRegexp.test(_name)) { - var containerName = this.translateToContainerFullname(type, _name); + BootOptions.prototype.toEnvironment = function () { + var env = _emberUtils.assign({}, _emberEnvironment.environment); + // For compatibility with existing code + env.hasDOM = this.isBrowser; + env.isInteractive = this.isInteractive; + env.options = this; + return env; + }; - known[containerName] = true; + Object.defineProperty(ApplicationInstance.prototype, 'container', { + configurable: true, + enumerable: false, + get: function () { + var instance = this; + return { + lookup: function () { + _emberMetal.deprecate('Using `ApplicationInstance.container.lookup` is deprecated. Please use `ApplicationInstance.lookup` instead.', false, { + id: 'ember-application.app-instance-container', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-applicationinstance-container' + }); + return instance.lookup.apply(instance, arguments); } - } - - return known; - }, - - /** - Converts provided name from the backing namespace into a container lookup name. - Examples: - App.FooBarHelper -> helper:foo-bar - App.THelper -> helper:t - @method translateToContainerFullname - @param {String} type - @param {String} name - @private - */ - - translateToContainerFullname: function (type, name) { - var suffix = _emberRuntime.String.classify(type); - var namePrefix = name.slice(0, suffix.length * -1); - var dasherizedName = _emberRuntime.String.dasherize(namePrefix); + }; + } + }); - return type + ':' + dasherizedName; + Object.defineProperty(ApplicationInstance.prototype, 'registry', { + configurable: true, + enumerable: false, + get: function () { + return _emberRuntime.buildFakeRegistryWithDeprecations(this, 'ApplicationInstance'); } }); + + exports.default = ApplicationInstance; }); -enifed('ember-application/utils/validate-type', ['exports', 'ember-metal'], function (exports, _emberMetal) { +enifed('ember-application/system/application', ['exports', 'ember-utils', 'ember-environment', 'ember-metal', 'ember-runtime', 'ember-views', 'ember-routing', 'ember-application/system/application-instance', 'container', 'ember-application/system/engine', 'ember-glimmer'], function (exports, _emberUtils, _emberEnvironment, _emberMetal, _emberRuntime, _emberViews, _emberRouting, _emberApplicationSystemApplicationInstance, _container, _emberApplicationSystemEngine, _emberGlimmer) { /** @module ember @submodule ember-application */ - 'use strict'; - exports.default = validateType; - - var VALIDATED_TYPES = { - route: ['assert', 'isRouteFactory', 'Ember.Route'], - component: ['deprecate', 'isComponentFactory', 'Ember.Component'], - view: ['deprecate', 'isViewFactory', 'Ember.View'], - service: ['deprecate', 'isServiceFactory', 'Ember.Service'] - }; - - function validateType(resolvedType, parsedName) { - var validationAttributes = VALIDATED_TYPES[parsedName.type]; - - if (!validationAttributes) { - return; - } - - var action = validationAttributes[0]; - var factoryFlag = validationAttributes[1]; - var expectedType = validationAttributes[2]; - - if (action === 'deprecate') { - _emberMetal.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 { - _emberMetal.assert('Expected ' + parsedName.fullName + ' to resolve to an ' + expectedType + ' but ' + ('instead it was ' + resolvedType + '.'), !!resolvedType[factoryFlag]); - } - } -}); -enifed('ember-console/index', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { - 'use strict'; + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); - function K() {} - - function consoleMethod(name) { - var consoleObj = undefined; - if (_emberEnvironment.context.imports.console) { - consoleObj = _emberEnvironment.context.imports.console; - } else if (typeof console !== 'undefined') { - consoleObj = console; - } - - var method = typeof consoleObj === 'object' ? consoleObj[name] : null; - - if (typeof method !== 'function') { - return; - } - - if (typeof method.bind === 'function') { - return method.bind(consoleObj); - } - - return function () { - method.apply(consoleObj, arguments); - }; - } - - function assertPolyfill(test, message) { - if (!test) { - try { - // attempt to preserve the stack - throw new Error('assertion failed: ' + message); - } catch (error) { - setTimeout(function () { - throw error; - }, 0); - } - } - } + var librariesRegistered = false; /** - Inside Ember-Metal, simply uses the methods from `imports.console`. - Override this to provide more robust logging functionality. + An instance of `Ember.Application` is the starting point for every Ember + application. It helps to instantiate, initialize and coordinate the many + objects that make up your app. - @class Logger + Each Ember app has one and only one `Ember.Application` object. In fact, the + very first thing you should do in your application is create the instance: + + ```javascript + window.App = Ember.Application.create(); + ``` + + Typically, the application object is the only global variable. All other + classes in your app should be properties on the `Ember.Application` instance, + which highlights its first role: a global namespace. + + For example, if you define a view class, it might look like this: + + ```javascript + App.MyView = Ember.View.extend(); + ``` + + By default, calling `Ember.Application.create()` will automatically initialize + your application by calling the `Ember.Application.initialize()` method. If + you need to delay initialization, you can call your app's `deferReadiness()` + method. When you are ready for your app to be initialized, call its + `advanceReadiness()` method. + + You can define a `ready` method on the `Ember.Application` instance, which + will be run by Ember when the application is initialized. + + Because `Ember.Application` inherits from `Ember.Namespace`, any classes + you create will have useful string representations when calling `toString()`. + See the `Ember.Namespace` documentation for more information. + + While you can think of your `Ember.Application` as a container that holds the + other classes in your application, there are several other responsibilities + going on under-the-hood that you may want to understand. + + ### Event Delegation + + Ember uses a technique called _event delegation_. This allows the framework + to set up a global, shared event listener instead of requiring each view to + do it manually. For example, instead of each view registering its own + `mousedown` listener on its associated element, Ember sets up a `mousedown` + listener on the `body`. + + If a `mousedown` event occurs, Ember will look at the target of the event and + start walking up the DOM node tree, finding corresponding views and invoking + their `mouseDown` method as it goes. + + `Ember.Application` has a number of default events that it listens for, as + well as a mapping from lowercase events to camel-cased view method names. For + example, the `keypress` event causes the `keyPress` method on the view to be + called, the `dblclick` event causes `doubleClick` to be called, and so on. + + If there is a bubbling browser event that Ember does not listen for by + default, you can specify custom events and their corresponding view method + names by setting the application's `customEvents` property: + + ```javascript + let App = Ember.Application.create({ + customEvents: { + // add support for the paste event + paste: 'paste' + } + }); + ``` + + To prevent Ember from setting up a listener for a default event, + specify the event name with a `null` value in the `customEvents` + property: + + ```javascript + let App = Ember.Application.create({ + customEvents: { + // prevent listeners for mouseenter/mouseleave events + mouseenter: null, + mouseleave: null + } + }); + ``` + + By default, the application sets up these event listeners on the document + body. However, in cases where you are embedding an Ember application inside + an existing page, you may want it to set up the listeners on an element + inside the body. + + For example, if only events inside a DOM element with the ID of `ember-app` + should be delegated, set your application's `rootElement` property: + + ```javascript + let App = Ember.Application.create({ + rootElement: '#ember-app' + }); + ``` + + 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 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: + + ```javascript + Ember.Application.initializer({ + name: 'api-adapter', + + initialize: function(application) { + application.register('api-adapter:main', ApiAdapter); + } + }); + ``` + + Initializers provide an opportunity to access the internal registry, which + organizes the different components of an Ember application. Additionally + they provide a chance to access the instantiated application. Beyond + being used for libraries, initializers are also a great way to organize + dependency injection or setup in your own application. + + ### Routing + + In addition to creating your application's router, `Ember.Application` is + also responsible for telling the router when to start routing. Transitions + between routes can be logged with the `LOG_TRANSITIONS` flag, and more + detailed intra-transition logging can be logged with + the `LOG_TRANSITIONS_INTERNAL` flag: + + ```javascript + let App = Ember.Application.create({ + LOG_TRANSITIONS: true, // basic logging of successful transitions + LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps + }); + ``` + + By default, the router will begin trying to translate the current URL into + application state once the browser emits the `DOMContentReady` event. If you + need to defer routing, you can call the application's `deferReadiness()` + method. Once routing can begin, call the `advanceReadiness()` method. + + If there is any setup required before routing begins, you can implement a + `ready()` method on your app that will be invoked immediately before routing + begins. + + @class Application @namespace Ember + @extends Ember.Engine + @uses RegistryProxyMixin @public */ - exports.default = { + + var Application = _emberApplicationSystemEngine.default.extend({ /** - Logs the arguments to the console. - You can pass as many arguments as you want and they will be joined together with a space. - ```javascript - var foo = 1; - Ember.Logger.log('log value of foo:', foo); - // "log value of foo: 1" will be printed to the console - ``` - @method log - @for Ember.Logger - @param {*} arguments - @public + The root DOM element of the Application. This can be specified as an + element or a + [jQuery-compatible selector string](http://api.jquery.com/category/selectors/). + This is the element that will be passed to the Application's, + `eventDispatcher`, which sets up the listeners for event delegation. Every + view in your application should be a child of the element you specify here. + @property rootElement + @type DOMElement + @default 'body' + @public */ - log: consoleMethod('log') || K, + rootElement: 'body', /** - Prints the arguments to the console with a warning icon. - You can pass as many arguments as you want and they will be joined together with a space. - ```javascript - Ember.Logger.warn('Something happened!'); - // "Something happened!" will be printed to the console with a warning icon. - ``` - @method warn - @for Ember.Logger - @param {*} arguments - @public + The `Ember.EventDispatcher` responsible for delegating events to this + application's views. + The event dispatcher is created by the application at initialization time + and sets up event listeners on the DOM element described by the + application's `rootElement` property. + See the documentation for `Ember.EventDispatcher` for more information. + @property eventDispatcher + @type Ember.EventDispatcher + @default null + @public */ - warn: consoleMethod('warn') || K, + eventDispatcher: null, /** - Prints the arguments to the console with an error icon, red text and a stack trace. - You can pass as many arguments as you want and they will be joined together with a space. + The DOM events for which the event dispatcher should listen. + By default, the application's `Ember.EventDispatcher` listens + for a set of standard DOM events, such as `mousedown` and + `keyup`, and delegates them to your application's `Ember.View` + instances. + If you would like additional bubbling events to be delegated to your + views, set your `Ember.Application`'s `customEvents` property + to a hash containing the DOM event name as the key and the + corresponding view method name as the value. Setting an event to + a value of `null` will prevent a default event listener from being + added for that event. + To add new events to be listened to: ```javascript - Ember.Logger.error('Danger! Danger!'); - // "Danger! Danger!" will be printed to the console in red text. + let App = Ember.Application.create({ + customEvents: { + // add support for the paste event + paste: 'paste' + } + }); ``` - @method error - @for Ember.Logger - @param {*} arguments - @public - */ - error: consoleMethod('error') || K, - - /** - Logs the arguments to the console. - You can pass as many arguments as you want and they will be joined together with a space. + To prevent default events from being listened to: ```javascript - var foo = 1; - Ember.Logger.info('log value of foo:', foo); - // "log value of foo: 1" will be printed to the console + let App = Ember.Application.create({ + customEvents: { + // remove support for mouseenter / mouseleave events + mouseenter: null, + mouseleave: null + } + }); ``` - @method info - @for Ember.Logger - @param {*} arguments - @public + @property customEvents + @type Object + @default null + @public */ - info: consoleMethod('info') || K, + customEvents: null, /** - Logs the arguments to the console in blue text. - You can pass as many arguments as you want and they will be joined together with a space. - ```javascript - var foo = 1; - Ember.Logger.debug('log value of foo:', foo); - // "log value of foo: 1" will be printed to the console - ``` - @method debug - @for Ember.Logger - @param {*} arguments - @public + Whether the application should automatically start routing and render + templates to the `rootElement` on DOM ready. While default by true, + other environments such as FastBoot or a testing harness can set this + property to `false` and control the precise timing and behavior of the boot + process. + @property autoboot + @type Boolean + @default true + @private */ - debug: consoleMethod('debug') || consoleMethod('info') || K, + autoboot: true, /** - If the value passed into `Ember.Logger.assert` is not truthy it will throw an error with a stack trace. + Whether the application should be configured for the legacy "globals mode". + Under this mode, the Application object serves as a global namespace for all + classes. ```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. + let App = Ember.Application.create({ + ... + }); + App.Router.reopen({ + location: 'none' + }); + App.Router.map({ + ... + }); + App.MyComponent = Ember.Component.extend({ + ... + }); ``` - @method assert - @for Ember.Logger - @param {Boolean} bool Value to test - @param {String} message Assertion message on failed - @public + This flag also exposes other internal APIs that assumes the existence of + a special "default instance", like `App.__container__.lookup(...)`. + This option is currently not configurable, its value is derived from + the `autoboot` flag – disabling `autoboot` also implies opting-out of + globals mode support, although they are ultimately orthogonal concerns. + Some of the global modes features are already deprecated in 1.x. The + existence of this flag is to untangle the globals mode code paths from + the autoboot code paths, so that these legacy features can be reviewed + for deprecation/removal separately. + Forcing the (autoboot=true, _globalsMode=false) here and running the tests + would reveal all the places where we are still relying on these legacy + behavior internally (mostly just tests). + @property _globalsMode + @type Boolean + @default true + @private */ - assert: consoleMethod('assert') || assertPolyfill - }; -}); -enifed('ember-debug/deprecate', ['exports', 'ember-metal', 'ember-console', 'ember-environment', 'ember-debug/handlers'], function (exports, _emberMetal, _emberConsole, _emberEnvironment, _emberDebugHandlers) { - /*global __fail__*/ - - 'use strict'; - - exports.registerHandler = registerHandler; - exports.default = deprecate; - - function registerHandler(handler) { - _emberDebugHandlers.registerHandler('deprecate', handler); - } - - function formatMessage(_message, options) { - var message = _message; - - if (options && options.id) { - message = message + (' [deprecation id: ' + options.id + ']'); - } + _globalsMode: true, - if (options && options.url) { - message += ' See ' + options.url + ' for more details.'; - } + init: function (options) { + this._super.apply(this, arguments); - return message; - } + if (!this.$) { + this.$ = _emberViews.jQuery; + } - registerHandler(function logDeprecationToConsole(message, options) { - var updatedMessage = formatMessage(message, options); + registerLibraries(); + _emberMetal.runInDebug(function () { + return logLibraryVersions(); + }); - _emberConsole.default.warn('DEPRECATION: ' + updatedMessage); - }); + // Start off the number of deferrals at 1. This will be decremented by + // the Application's own `boot` method. + this._readinessDeferrals = 1; + this._booted = false; - var captureErrorForStack = undefined; + this.autoboot = this._globalsMode = !!this.autoboot; - if (new Error().stack) { - captureErrorForStack = function () { - return new Error(); - }; - } else { - captureErrorForStack = function () { - try { - __fail__.fail(); - } catch (e) { - return e; + if (this._globalsMode) { + this._prepareForGlobalsMode(); } - }; - } - - registerHandler(function logDeprecationStackTrace(message, options, next) { - if (_emberEnvironment.ENV.LOG_STACKTRACE_ON_DEPRECATION) { - var stackStr = ''; - var error = captureErrorForStack(); - var stack = undefined; - - if (error.stack) { - if (error['arguments']) { - // Chrome - stack = error.stack.replace(/^\s+at\s+/gm, '').replace(/^([^\(]+?)([\n$])/gm, '{anonymous}($1)$2').replace(/^Object.\s*\(([^\)]+)\)/gm, '{anonymous}($1)').split('\n'); - stack.shift(); - } else { - // Firefox - stack = error.stack.replace(/(?:\n@:0)?\s+$/m, '').replace(/^\(/gm, '{anonymous}(').split('\n'); - } - stackStr = '\n ' + stack.slice(2).join('\n '); + if (this.autoboot) { + this.waitForDOMReady(); } + }, - var updatedMessage = formatMessage(message, options); + /** + Create an ApplicationInstance for this application. + @private + @method buildInstance + @return {Ember.ApplicationInstance} the application instance + */ + buildInstance: function () { + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - _emberConsole.default.warn('DEPRECATION: ' + updatedMessage + stackStr); - } else { - next.apply(undefined, arguments); - } - }); + options.base = this; + options.application = this; + return _emberApplicationSystemApplicationInstance.default.create(options); + }, - registerHandler(function raiseOnDeprecation(message, options, next) { - if (_emberEnvironment.ENV.RAISE_ON_DEPRECATION) { - var updatedMessage = formatMessage(message); + /** + Enable the legacy globals mode by allowing this application to act + as a global namespace. See the docs on the `_globalsMode` property + for details. + Most of these features are already deprecated in 1.x, so we can + stop using them internally and try to remove them. + @private + @method _prepareForGlobalsMode + */ + _prepareForGlobalsMode: function () { + // 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`. + this.Router = (this.Router || _emberRouting.Router).extend(); - throw new _emberMetal.Error(updatedMessage); - } else { - next.apply(undefined, arguments); - } - }); + this._buildDeprecatedInstance(); + }, - var missingOptionsDeprecation = 'When calling `Ember.deprecate` you ' + 'must provide an `options` hash as the third parameter. ' + '`options` should include `id` and `until` properties.'; - exports.missingOptionsDeprecation = missingOptionsDeprecation; - var missingOptionsIdDeprecation = 'When calling `Ember.deprecate` you must provide `id` in options.'; - exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation; - var missingOptionsUntilDeprecation = 'When calling `Ember.deprecate` you must provide `until` in options.'; + /* + Build the deprecated instance for legacy globals mode support. + Called when creating and resetting the application. + This is orthogonal to autoboot: the deprecated instance needs to + be created at Application construction (not boot) time to expose + App.__container__. If autoboot sees that this instance exists, + it will continue booting it to avoid doing unncessary work (as + opposed to building a new instance at boot time), but they are + otherwise unrelated. + @private + @method _buildDeprecatedInstance + */ + _buildDeprecatedInstance: function () { + // Build a default instance + var instance = this.buildInstance(); - exports.missingOptionsUntilDeprecation = missingOptionsUntilDeprecation; - /** - @module ember - @submodule ember-debug - */ + // Legacy support for App.__container__ and other global methods + // on App that rely on a single, default instance. + this.__deprecatedInstance__ = instance; + this.__container__ = instance.__container__; + }, - /** - Display a deprecation warning with the provided message and a stack trace - (Chrome and Firefox only). - - * In a production build, this method is defined as an empty function (NOP). - Uses of this method in Ember itself are stripped from the ember.prod.js build. - - @method deprecate - @param {String} message A description of the deprecation. - @param {Boolean} test A boolean. If falsy, the deprecation will be displayed. - @param {Object} options - @param {String} options.id A unique id for this deprecation. The id can be - used by Ember debugging tools to change the behavior (raise, log or silence) - for that specific deprecation. The id should be namespaced by dots, e.g. - "view.helper.select". - @param {string} options.until The version of Ember when this deprecation - warning will be removed. - @param {String} [options.url] An optional url to the transition guide on the - emberjs.com website. - @for Ember - @public - @since 1.0.0 - */ + /** + Automatically kick-off the boot process for the application once the + DOM has become ready. + The initialization itself is scheduled on the actions queue which + ensures that code-loading finishes before booting. + If you are asynchronously loading code, you should call `deferReadiness()` + to defer booting, and then call `advanceReadiness()` once all of your code + has finished loading. + @private + @method waitForDOMReady + */ + waitForDOMReady: function () { + if (!this.$ || this.$.isReady) { + _emberMetal.run.schedule('actions', this, 'domReady'); + } else { + this.$().ready(_emberMetal.run.bind(this, 'domReady')); + } + }, - function deprecate(message, test, options) { - if (!options || !options.id && !options.until) { - deprecate(missingOptionsDeprecation, false, { - id: 'ember-debug.deprecate-options-missing', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' - }); - } + /** + This is the autoboot flow: + 1. Boot the app by calling `this.boot()` + 2. Create an instance (or use the `__deprecatedInstance__` in globals mode) + 3. Boot the instance by calling `instance.boot()` + 4. Invoke the `App.ready()` callback + 5. Kick-off routing on the instance + Ideally, this is all we would need to do: + ```javascript + _autoBoot() { + this.boot().then(() => { + let instance = (this._globalsMode) ? this.__deprecatedInstance__ : this.buildInstance(); + return instance.boot(); + }).then((instance) => { + App.ready(); + instance.startRouting(); + }); + } + ``` + Unfortunately, we cannot actually write this because we need to participate + in the "synchronous" boot process. While the code above would work fine on + the initial boot (i.e. DOM ready), when `App.reset()` is called, we need to + boot a new instance synchronously (see the documentation on `_bootSync()` + for details). + Because of this restriction, the actual logic of this method is located + inside `didBecomeReady()`. + @private + @method domReady + */ + domReady: function () { + if (this.isDestroyed) { + return; + } - if (options && !options.id) { - deprecate(missingOptionsIdDeprecation, false, { - id: 'ember-debug.deprecate-id-missing', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' - }); - } + this._bootSync(); - if (options && !options.until) { - deprecate(missingOptionsUntilDeprecation, options && options.until, { - id: 'ember-debug.deprecate-until-missing', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' - }); - } + // Continues to `didBecomeReady` + }, - _emberDebugHandlers.invoke.apply(undefined, ['deprecate'].concat(babelHelpers.slice.call(arguments))); - } -}); -enifed("ember-debug/handlers", ["exports"], function (exports) { - "use strict"; + /** + Use this to defer readiness until some condition is true. + Example: + ```javascript + let App = Ember.Application.create(); + App.deferReadiness(); + // Ember.$ is a reference to the jQuery object/function + Ember.$.getJSON('/auth-token', function(token) { + App.token = token; + App.advanceReadiness(); + }); + ``` + This allows you to perform asynchronous setup logic and defer + booting your application until the setup has finished. + However, if the setup requires a loading UI, it might be better + to use the router for this purpose. + @method deferReadiness + @public + */ + deferReadiness: function () { + _emberMetal.assert('You must call deferReadiness on an instance of Ember.Application', this instanceof Application); + _emberMetal.assert('You cannot defer readiness since the `ready()` hook has already been called.', this._readinessDeferrals > 0); + this._readinessDeferrals++; + }, - exports.registerHandler = registerHandler; - exports.invoke = invoke; - var HANDLERS = {}; + /** + Call `advanceReadiness` after any asynchronous setup logic has completed. + Each call to `deferReadiness` must be matched by a call to `advanceReadiness` + or the application will never become ready and routing will not begin. + @method advanceReadiness + @see {Ember.Application#deferReadiness} + @public + */ + advanceReadiness: function () { + _emberMetal.assert('You must call advanceReadiness on an instance of Ember.Application', this instanceof Application); + this._readinessDeferrals--; - exports.HANDLERS = HANDLERS; + if (this._readinessDeferrals === 0) { + _emberMetal.run.once(this, this.didBecomeReady); + } + }, - function registerHandler(type, callback) { - var nextHandler = HANDLERS[type] || function () {}; + /** + Initialize the application and return a promise that resolves with the `Ember.Application` + object when the boot process is complete. + Run any application 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. + By default, this method is called automatically on "DOM ready"; however, if autoboot + is disabled, this is automatically called when the first application instance is + created via `visit`. + @private + @method boot + @return {Promise} + */ + boot: function () { + if (this._bootPromise) { + return this._bootPromise; + } - HANDLERS[type] = function (message, options) { - callback(message, options, nextHandler); - }; - } + try { + this._bootSync(); + } catch (_) { + // Ignore th error: in the asynchronous boot path, the error is already reflected + // in the promise rejection + } - function invoke(type, message, test, options) { - if (test) { - return; - } + return this._bootPromise; + }, - var handlerForType = HANDLERS[type]; + /** + Unfortunately, a lot of existing code assumes the booting process is + "synchronous". Specifically, a lot of tests assumes the last call to + `app.advanceReadiness()` or `app.reset()` will result in the app being + fully-booted when the current runloop completes. + We would like new code (like the `visit` API) to stop making this assumption, + so we created the asynchronous version above that returns a promise. But until + we have migrated all the code, we would have to expose this method for use + *internally* in places where we need to boot an app "synchronously". + @private + */ + _bootSync: function () { + if (this._booted) { + return; + } - if (!handlerForType) { - return; - } + // Even though this returns synchronously, we still need to make sure the + // boot promise exists for book-keeping purposes: if anything went wrong in + // the boot process, we need to store the error as a rejection on the boot + // promise so that a future caller of `boot()` can tell what failed. + var defer = this._bootResolver = new _emberRuntime.RSVP.defer(); + this._bootPromise = defer.promise; - if (handlerForType) { - handlerForType(message, options); - } - } -}); -enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'ember-console', 'ember-debug/deprecate', 'ember-debug/warn'], function (exports, _emberMetal, _emberEnvironment, _emberConsole, _emberDebugDeprecate, _emberDebugWarn) { - 'use strict'; + try { + this.runInitializers(); + _emberRuntime.runLoadHooks('application', this); + this.advanceReadiness(); + // Continues to `didBecomeReady` + } catch (error) { + // For the asynchronous boot path + defer.reject(error); - exports._warnIfUsingStrippedFeatureFlags = _warnIfUsingStrippedFeatureFlags; + // For the synchronous boot path + throw error; + } + }, - /** - @module ember - @submodule ember-debug - */ + /** + Reset the application. This is typically used only in tests. It cleans up + the application in the following order: + 1. Deactivate existing routes + 2. Destroy all objects in the container + 3. Create a new application container + 4. Re-route to the existing url + Typical Example: + ```javascript + let App; + run(function() { + App = Ember.Application.create(); + }); + module('acceptance test', { + setup: function() { + App.reset(); + } + }); + test('first test', function() { + // App is freshly reset + }); + test('second test', function() { + // App is again freshly reset + }); + ``` + Advanced Example: + Occasionally you may want to prevent the app from initializing during + setup. This could enable extra configuration, or enable asserting prior + to the app becoming ready. + ```javascript + let App; + run(function() { + App = Ember.Application.create(); + }); + module('acceptance test', { + setup: function() { + run(function() { + App.reset(); + App.deferReadiness(); + }); + } + }); + test('first test', function() { + ok(true, 'something before app is initialized'); + run(function() { + App.advanceReadiness(); + }); + ok(true, 'something after app is initialized'); + }); + ``` + @method reset + @public + */ + reset: function () { + _emberMetal.assert('Calling reset() on instances of `Ember.Application` is not\n supported when globals mode is disabled; call `visit()` to\n create new `Ember.ApplicationInstance`s and dispose them\n via their `destroy()` method instead.', this._globalsMode && this.autoboot); - /** - @class Ember - @public - */ + var instance = this.__deprecatedInstance__; - /** - Define an assertion that will throw an exception if the condition is not met. - - * In a production build, this method is defined as an empty function (NOP). - Uses of this method in Ember itself are stripped from the ember.prod.js build. - - ```javascript - // Test for truthiness - Ember.assert('Must pass a valid object', obj); - - // Fail unconditionally - Ember.assert('This code path should never be run'); - ``` - - @method assert - @param {String} desc A description of the assertion. This will become - the text of the Error thrown if the assertion fails. - @param {Boolean} test Must be truthy for the assertion to pass. If - falsy, an exception will be thrown. - @public - @since 1.0.0 - */ - _emberMetal.setDebugFunction('assert', function assert(desc, test) { - if (!test) { - throw new _emberMetal.Error('Assertion Failed: ' + desc); - } - }); + this._readinessDeferrals = 1; + this._bootPromise = null; + this._bootResolver = null; + this._booted = false; - /** - Display a debug notice. - - * In a production build, this method is defined as an empty function (NOP). - Uses of this method in Ember itself are stripped from the ember.prod.js build. - - ```javascript - Ember.debug('I\'m a debug notice!'); - ``` - - @method debug - @param {String} message A debug message to display. - @public - */ - _emberMetal.setDebugFunction('debug', function debug(message) { - _emberConsole.default.debug('DEBUG: ' + message); - }); + function handleReset() { + _emberMetal.run(instance, 'destroy'); + this._buildDeprecatedInstance(); + _emberMetal.run.schedule('actions', this, '_bootSync'); + } - /** - Display an info notice. - - * In a production build, this method is defined as an empty function (NOP). - Uses of this method in Ember itself are stripped from the ember.prod.js build. - - @method info - @private - */ - _emberMetal.setDebugFunction('info', function info() { - _emberConsole.default.info.apply(undefined, arguments); - }); + _emberMetal.run.join(this, handleReset); + }, - /** - Alias an old, deprecated method with its new counterpart. - - Display a deprecation warning with the provided message and a stack trace - (Chrome and Firefox only) when the assigned method is called. - - * In a production build, this method is defined as an empty function (NOP). - - ```javascript - Ember.oldMethod = Ember.deprecateFunc('Please use the new, updated method', Ember.newMethod); - ``` - - @method deprecateFunc - @param {String} message A description of the deprecation. - @param {Object} [options] The options object for Ember.deprecate. - @param {Function} func The new function called to replace its deprecated counterpart. - @return {Function} A new function that wraps the original function with a deprecation warning - @private - */ - _emberMetal.setDebugFunction('deprecateFunc', function deprecateFunc() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } + /** + @private + @method didBecomeReady + */ + didBecomeReady: function () { + try { + // TODO: Is this still needed for _globalsMode = false? + if (!_emberMetal.isTesting()) { + // Eagerly name all classes that are already loaded + _emberRuntime.Namespace.processAll(); + _emberRuntime.setNamespaceSearchDisabled(true); + } - if (args.length === 3) { - var _ret = (function () { - var message = args[0]; - var options = args[1]; - var func = args[2]; + // See documentation on `_autoboot()` for details + if (this.autoboot) { + var instance = undefined; - return { - v: function () { - _emberMetal.deprecate(message, false, options); - return func.apply(this, arguments); + if (this._globalsMode) { + // If we already have the __deprecatedInstance__ lying around, boot it to + // avoid unnecessary work + instance = this.__deprecatedInstance__; + } else { + // Otherwise, build an instance and boot it. This is currently unreachable, + // because we forced _globalsMode to === autoboot; but having this branch + // allows us to locally toggle that flag for weeding out legacy globals mode + // dependencies independently + instance = this.buildInstance(); } - }; - })(); - - if (typeof _ret === 'object') return _ret.v; - } else { - var _ret2 = (function () { - var message = args[0]; - var func = args[1]; - return { - v: function () { - _emberMetal.deprecate(message); - return func.apply(this, arguments); - } - }; - })(); + instance._bootSync(); - if (typeof _ret2 === 'object') return _ret2.v; - } - }); + // TODO: App.ready() is not called when autoboot is disabled, is this correct? + this.ready(); - /** - Run a function meant for debugging. - - * In a production build, this method is defined as an empty function (NOP). - Uses of this method in Ember itself are stripped from the ember.prod.js build. - - ```javascript - Ember.runInDebug(() => { - Ember.Component.reopen({ - didInsertElement() { - console.log("I'm happy"); + instance.startRouting(); } - }); - }); - ``` - - @method runInDebug - @param {Function} func The function to be executed. - @since 1.5.0 - @public - */ - _emberMetal.setDebugFunction('runInDebug', function runInDebug(func) { - func(); - }); - - _emberMetal.setDebugFunction('debugSeal', function debugSeal(obj) { - Object.seal(obj); - }); - _emberMetal.setDebugFunction('debugFreeze', function debugFreeze(obj) { - Object.freeze(obj); - }); + // For the asynchronous boot path + this._bootResolver.resolve(this); - _emberMetal.setDebugFunction('deprecate', _emberDebugDeprecate.default); + // For the synchronous boot path + this._booted = true; + } catch (error) { + // For the asynchronous boot path + this._bootResolver.reject(error); - _emberMetal.setDebugFunction('warn', _emberDebugWarn.default); + // For the synchronous boot path + throw error; + } + }, - /** - Will call `Ember.warn()` if ENABLE_OPTIONAL_FEATURES or - any specific FEATURES flag is truthy. - - This method is called automatically in debug canary builds. - - @private - @method _warnIfUsingStrippedFeatureFlags - @return {void} - */ + /** + Called when the Application has become ready, immediately before routing + begins. The call will be delayed until the DOM has become ready. + @event ready + @public + */ + ready: function () { + return this; + }, - function _warnIfUsingStrippedFeatureFlags(FEATURES, knownFeatures, featuresWereStripped) { - if (featuresWereStripped) { - _emberMetal.warn('Ember.ENV.ENABLE_OPTIONAL_FEATURES is only available in canary builds.', !_emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES, { id: 'ember-debug.feature-flag-with-features-stripped' }); + // This method must be moved to the application instance object + willDestroy: function () { + this._super.apply(this, arguments); + _emberRuntime.setNamespaceSearchDisabled(false); + this._booted = false; + this._bootPromise = null; + this._bootResolver = null; - var keys = Object.keys(FEATURES || {}); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (key === 'isEnabled' || !(key in knownFeatures)) { - continue; - } + if (_emberRuntime._loaded.application === this) { + _emberRuntime._loaded.application = undefined; + } - _emberMetal.warn('FEATURE["' + key + '"] is set as enabled, but FEATURE flags are only available in canary builds.', !FEATURES[key], { id: 'ember-debug.feature-flag-with-features-stripped' }); + if (this._globalsMode && this.__deprecatedInstance__) { + this.__deprecatedInstance__.destroy(); } - } - } + }, - if (!_emberMetal.isTesting()) { - (function () { - // Complain if they're using FEATURE flags in builds other than canary - _emberMetal.FEATURES['features-stripped-test'] = true; - var featuresWereStripped = true; - - if (false) { - featuresWereStripped = false; + /** + Boot a new instance of `Ember.ApplicationInstance` for the current + application and navigate it to the given `url`. Returns a `Promise` that + resolves with the instance when the initial routing and rendering is + complete, or rejects with any error that occured during the boot process. + When `autoboot` is disabled, calling `visit` would first cause the + application to boot, which runs the application initializers. + This method also takes a hash of boot-time configuration options for + customizing the instance's behavior. See the documentation on + `Ember.ApplicationInstance.BootOptions` for details. + `Ember.ApplicationInstance.BootOptions` is an interface class that exists + purely to document the available options; you do not need to construct it + manually. Simply pass a regular JavaScript object containing of the + desired options: + ```javascript + MyApp.visit("/", { location: "none", rootElement: "#container" }); + ``` + ### Supported Scenarios + While the `BootOptions` class exposes a large number of knobs, not all + combinations of them are valid; certain incompatible combinations might + result in unexpected behavior. + For example, booting the instance in the full browser environment + while specifying a foriegn `document` object (e.g. `{ isBrowser: true, + document: iframe.contentDocument }`) does not work correctly today, + largely due to Ember's jQuery dependency. + Currently, there are three officially supported scenarios/configurations. + Usages outside of these scenarios are not guaranteed to work, but please + feel free to file bug reports documenting your experience and any issues + you encountered to help expand support. + #### Browser Applications (Manual Boot) + The setup is largely similar to how Ember works out-of-the-box. Normally, + Ember will boot a default instance for your Application on "DOM ready". + However, you can customize this behavior by disabling `autoboot`. + For example, this allows you to render a miniture demo of your application + into a specific area on your marketing website: + ```javascript + import MyApp from 'my-app'; + $(function() { + let App = MyApp.create({ autoboot: false }); + let options = { + // Override the router's location adapter to prevent it from updating + // the URL in the address bar + location: 'none', + // Override the default `rootElement` on the app to render into a + // specific `div` on the page + rootElement: '#demo' + }; + // Start the app at the special demo URL + App.visit('/demo', options); + }); + ```` + Or perhaps you might want to boot two instances of your app on the same + page for a split-screen multiplayer experience: + ```javascript + import MyApp from 'my-app'; + $(function() { + let App = MyApp.create({ autoboot: false }); + let sessionId = MyApp.generateSessionID(); + let player1 = App.visit(`/matches/join?name=Player+1&session=${sessionId}`, { rootElement: '#left', location: 'none' }); + let player2 = App.visit(`/matches/join?name=Player+2&session=${sessionId}`, { rootElement: '#right', location: 'none' }); + Promise.all([player1, player2]).then(() => { + // Both apps have completed the initial render + $('#loading').fadeOut(); + }); + }); + ``` + Do note that each app instance maintains their own registry/container, so + they will run in complete isolation by default. + #### Server-Side Rendering (also known as FastBoot) + This setup allows you to run your Ember app in a server environment using + Node.js and render its content into static HTML for SEO purposes. + ```javascript + const HTMLSerializer = new SimpleDOM.HTMLSerializer(SimpleDOM.voidMap); + function renderURL(url) { + let dom = new SimpleDOM.Document(); + let rootElement = dom.body; + let options = { isBrowser: false, document: dom, rootElement: rootElement }; + return MyApp.visit(options).then(instance => { + try { + return HTMLSerializer.serialize(rootElement.firstChild); + } finally { + instance.destroy(); + } + }); } + ``` + In this scenario, because Ember does not have access to a global `document` + object in the Node.js environment, you must provide one explicitly. In practice, + in the non-browser environment, the stand-in `document` object only need to + implement a limited subset of the full DOM API. The `SimpleDOM` library is known + to work. + Since there is no access to jQuery in the non-browser environment, you must also + specify a DOM `Element` object in the same `document` for the `rootElement` option + (as opposed to a selector string like `"body"`). + See the documentation on the `isBrowser`, `document` and `rootElement` properties + on `Ember.ApplicationInstance.BootOptions` for details. + #### Server-Side Resource Discovery + This setup allows you to run the routing layer of your Ember app in a server + environment using Node.js and completely disable rendering. This allows you + to simulate and discover the resources (i.e. AJAX requests) needed to fufill + a given request and eagerly "push" these resources to the client. + ```app/initializers/network-service.js + import BrowserNetworkService from 'app/services/network/browser'; + import NodeNetworkService from 'app/services/network/node'; + // Inject a (hypothetical) service for abstracting all AJAX calls and use + // the appropiate implementaion on the client/server. This also allows the + // server to log all the AJAX calls made during a particular request and use + // that for resource-discovery purpose. + export function initialize(application) { + if (window) { // browser + application.register('service:network', BrowserNetworkService); + } else { // node + application.register('service:network', NodeNetworkService); + } + application.inject('route', 'network', 'service:network'); + }; + export default { + name: 'network-service', + initialize: initialize + }; + ``` + ```app/routes/post.js + import Ember from 'ember'; + // An example of how the (hypothetical) service is used in routes. + export default Ember.Route.extend({ + model(params) { + return this.network.fetch(`/api/posts/${params.post_id}.json`); + }, + afterModel(post) { + if (post.isExternalContent) { + return this.network.fetch(`/api/external/?url=${post.externalURL}`); + } else { + return post; + } + } + }); + ``` + ```javascript + // Finally, put all the pieces together + function discoverResourcesFor(url) { + return MyApp.visit(url, { isBrowser: false, shouldRender: false }).then(instance => { + let networkService = instance.lookup('service:network'); + return networkService.requests; // => { "/api/posts/123.json": "..." } + }); + } + ``` + @public + @method visit + @param url {String} The initial URL to navigate to + @param options {Ember.ApplicationInstance.BootOptions} + @return {Promise} + */ + visit: function (url, options) { + var _this = this; - delete _emberMetal.FEATURES['features-stripped-test']; - _warnIfUsingStrippedFeatureFlags(_emberEnvironment.ENV.FEATURES, _emberMetal.DEFAULT_FEATURES, featuresWereStripped); - - // Inform the developer about the Ember Inspector if not installed. - var isFirefox = _emberEnvironment.environment.isFirefox; - var isChrome = _emberEnvironment.environment.isChrome; - - if (typeof window !== 'undefined' && (isFirefox || isChrome) && window.addEventListener) { - window.addEventListener('load', function () { - if (document.documentElement && document.documentElement.dataset && !document.documentElement.dataset.emberExtension) { - var downloadURL; + return this.boot().then(function () { + var instance = _this.buildInstance(); - if (isChrome) { - downloadURL = 'https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi'; - } else if (isFirefox) { - downloadURL = 'https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/'; - } + return instance.boot(options).then(function () { + return instance.visit(url); + }).catch(function (error) { + _emberMetal.run(instance, 'destroy'); + throw error; + }); + }); + } + }); - _emberMetal.debug('For more advanced debugging, install the Ember Inspector from ' + downloadURL); - } - }, false); - } - })(); - } - /** - @public - @class Ember.Debug - */ - _emberMetal.default.Debug = {}; + Object.defineProperty(Application.prototype, 'registry', { + configurable: true, + enumerable: false, + get: function () { + return _emberRuntime.buildFakeRegistryWithDeprecations(this, 'Application'); + } + }); - /** - Allows for runtime registration of handler functions that override the default deprecation behavior. - Deprecations are invoked by calls to [Ember.deprecate](http://emberjs.com/api/classes/Ember.html#method_deprecate). - The following example demonstrates its usage by registering a handler that throws an error if the - message contains the word "should", otherwise defers to the default handler. - - ```javascript - Ember.Debug.registerDeprecationHandler((message, options, next) => { - if (message.indexOf('should') !== -1) { - throw new Error(`Deprecation message with should: ${message}`); - } else { - // defer to whatever handler was registered before this one - next(message, options); - } - }); - ``` - - The handler function takes the following arguments: - -
      -
    • message - The message received from the deprecation call.
    • -
    • options - An object passed in with the deprecation call containing additional information including:
    • -
        -
      • id - An id of the deprecation in the form of package-name.specific-deprecation.
      • -
      • until - The Ember version number the feature and deprecation will be removed in.
      • -
      -
    • next - A function that calls into the previously registered handler.
    • -
    - - @public - @static - @method registerDeprecationHandler - @param handler {Function} A function to handle deprecation calls. - @since 2.1.0 - */ - _emberMetal.default.Debug.registerDeprecationHandler = _emberDebugDeprecate.registerHandler; - /** - Allows for runtime registration of handler functions that override the default warning behavior. - Warnings are invoked by calls made to [Ember.warn](http://emberjs.com/api/classes/Ember.html#method_warn). - The following example demonstrates its usage by registering a handler that does nothing overriding Ember's - default warning behavior. - - ```javascript - // next is not called, so no warnings get the default behavior - Ember.Debug.registerWarnHandler(() => {}); - ``` - - The handler function takes the following arguments: - -
      -
    • message - The message received from the warn call.
    • -
    • options - An object passed in with the warn call containing additional information including:
    • -
        -
      • id - An id of the warning in the form of package-name.specific-warning.
      • -
      -
    • next - A function that calls into the previously registered handler.
    • -
    - - @public - @static - @method registerWarnHandler - @param handler {Function} A function to handle warnings. - @since 2.1.0 - */ - _emberMetal.default.Debug.registerWarnHandler = _emberDebugWarn.registerHandler; + Application.reopenClass({ + /** + This creates a registry with the default Ember naming conventions. + It also configures the registry: + * registered views are created every time they are looked up (they are + not singletons) + * registered templates are not factories; the registered value is + returned directly. + * the router receives the application as its `namespace` property + * all controllers receive the router as their `target` and `controllers` + properties + * 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 + @method buildRegistry + @static + @param {Ember.Application} namespace the application for which to + build the registry + @return {Ember.Registry} the built registry + @private + */ + buildRegistry: function (application) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - /* - We are transitioning away from `ember.js` to `ember.debug.js` to make - it much clearer that it is only for local development purposes. - - This flag value is changed by the tooling (by a simple string replacement) - so that if `ember.js` (which must be output for backwards compat reasons) is - used a nice helpful warning message will be printed out. - */ - var runningNonEmberDebugJS = false; - exports.runningNonEmberDebugJS = runningNonEmberDebugJS; - if (runningNonEmberDebugJS) { - _emberMetal.warn('Please use `ember.debug.js` instead of `ember.js` for development and debugging.'); - } -}); -// reexports -enifed('ember-debug/warn', ['exports', 'ember-console', 'ember-metal', 'ember-debug/handlers'], function (exports, _emberConsole, _emberMetal, _emberDebugHandlers) { - 'use strict'; + var registry = this._super.apply(this, arguments); - exports.registerHandler = registerHandler; - exports.default = warn; + commonSetupRegistry(registry); - function registerHandler(handler) { - _emberDebugHandlers.registerHandler('warn', handler); - } + _emberGlimmer.setupApplicationRegistry(registry); - registerHandler(function logWarning(message, options) { - _emberConsole.default.warn('WARNING: ' + message); - if ('trace' in _emberConsole.default) { - _emberConsole.default.trace(); + return registry; } }); - var missingOptionsDeprecation = 'When calling `Ember.warn` you ' + 'must provide an `options` hash as the third parameter. ' + '`options` should include an `id` property.'; - exports.missingOptionsDeprecation = missingOptionsDeprecation; - var missingOptionsIdDeprecation = 'When calling `Ember.warn` you must provide `id` in options.'; + function commonSetupRegistry(registry) { + registry.register('-view-registry:main', { create: function () { + return _emberUtils.dictionary(null); + } }); - exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation; - /** - @module ember - @submodule ember-debug - */ + registry.register('route:basic', _emberRouting.Route); + registry.register('event_dispatcher:main', _emberViews.EventDispatcher); - /** - Display a warning with the provided message. - - * In a production build, this method is defined as an empty function (NOP). - Uses of this method in Ember itself are stripped from the ember.prod.js build. - - @method warn - @param {String} message A warning to display. - @param {Boolean} test An optional boolean. If falsy, the warning - will be displayed. - @param {Object} options An object that can be used to pass a unique - `id` for this warning. The `id` can be used by Ember debugging tools - to change the behavior (raise, log, or silence) for that specific warning. - The `id` should be namespaced by dots, e.g. "ember-debug.feature-flag-with-features-stripped" - @for Ember - @public - @since 1.0.0 - */ + registry.injection('router:main', 'namespace', 'application:main'); - function warn(message, test, options) { - if (!options) { - _emberMetal.deprecate(missingOptionsDeprecation, false, { - id: 'ember-debug.warn-options-missing', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' - }); - } + registry.register('location:auto', _emberRouting.AutoLocation); + registry.register('location:hash', _emberRouting.HashLocation); + registry.register('location:history', _emberRouting.HistoryLocation); + registry.register('location:none', _emberRouting.NoneLocation); - if (options && !options.id) { - _emberMetal.deprecate(missingOptionsIdDeprecation, false, { - id: 'ember-debug.warn-id-missing', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' - }); - } + registry.register(_container.privatize(_templateObject), _emberRouting.BucketCache); - _emberDebugHandlers.invoke.apply(undefined, ['warn'].concat(babelHelpers.slice.call(arguments))); + if (_emberMetal.isFeatureEnabled('ember-routing-router-service')) { + registry.register('service:router', _emberRouting.RouterService); + registry.injection('service:router', 'router', 'router:main'); + } } -}); -enifed('ember-environment/global', ['exports'], function (exports) { - /* globals global, window, self, mainContext */ - // from lodash to catch fake globals - 'use strict'; + function registerLibraries() { + if (!librariesRegistered) { + librariesRegistered = true; - function checkGlobal(value) { - return value && value.Object === Object ? value : undefined; + if (_emberEnvironment.environment.hasDOM && typeof _emberViews.jQuery === 'function') { + _emberMetal.libraries.registerCoreLibrary('jQuery', _emberViews.jQuery().jquery); + } + } } - // element ids can ruin global miss checks - function checkElementIdShadowing(value) { - return value && value.nodeType === undefined ? value : undefined; - } + function logLibraryVersions() { + var _this2 = this; - // export real global - exports.default = checkGlobal(checkElementIdShadowing(typeof global === 'object' && global)) || checkGlobal(typeof self === 'object' && self) || checkGlobal(typeof window === 'object' && window) || mainContext || // set before strict mode in Ember loader/wrapper - new Function('return this')(); - // eval outside of strict mode -}); -enifed('ember-environment/index', ['exports', 'ember-environment/global', 'ember-environment/utils'], function (exports, _emberEnvironmentGlobal, _emberEnvironmentUtils) { - /* globals module */ - 'use strict'; + _emberMetal.runInDebug(function () { + if (_emberEnvironment.ENV.LOG_VERSION) { + // we only need to see this once per Application#init + _emberEnvironment.ENV.LOG_VERSION = false; + var libs = _emberMetal.libraries._registry; - /** - 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 - backwards compatibility with earlier versions of Ember). The `EmberENV` - hash must be created before loading Ember. - - @class EmberENV - @type Object - @public - */ - var ENV = typeof _emberEnvironmentGlobal.default.EmberENV === 'object' && _emberEnvironmentGlobal.default.EmberENV || typeof _emberEnvironmentGlobal.default.ENV === 'object' && _emberEnvironmentGlobal.default.ENV || {}; + var nameLengths = libs.map(function (item) { + return _emberMetal.get(item, 'name.length'); + }); - exports.ENV = ENV; - // ENABLE_ALL_FEATURES was documented, but you can't actually enable non optional features. - if (ENV.ENABLE_ALL_FEATURES) { - ENV.ENABLE_OPTIONAL_FEATURES = true; + var maxNameLength = Math.max.apply(_this2, nameLengths); + + _emberMetal.debug('-------------------------------'); + for (var i = 0; i < libs.length; i++) { + var lib = libs[i]; + var spaces = new Array(maxNameLength - lib.name.length + 1).join(' '); + _emberMetal.debug([lib.name, spaces, ' : ', lib.version].join('')); + } + _emberMetal.debug('-------------------------------'); + } + }); } + exports.default = Application; +}); +enifed('ember-application/system/engine-instance', ['exports', 'ember-utils', 'ember-runtime', 'ember-metal', 'container', 'ember-application/system/engine-parent'], function (exports, _emberUtils, _emberRuntime, _emberMetal, _container, _emberApplicationSystemEngineParent) { /** - Determines whether Ember should add to `Array`, `Function`, and `String` - native object prototypes, a few extra methods in order to provide a more - friendly API. - - We generally recommend leaving this option set to true however, if you need - to turn it off, you can add the configuration property - `EXTEND_PROTOTYPES` to `EmberENV` and set it to `false`. - - Note, when disabled (the default configuration for Ember Addons), you will - instead have to access all methods and functions from the Ember - namespace. - - @property EXTEND_PROTOTYPES - @type Boolean - @default true - @for EmberENV - @public + @module ember + @submodule ember-application */ - ENV.EXTEND_PROTOTYPES = _emberEnvironmentUtils.normalizeExtendPrototypes(ENV.EXTEND_PROTOTYPES); - /** - The `LOG_STACKTRACE_ON_DEPRECATION` property, when true, tells Ember to log - a full stack trace during deprecation warnings. - - @property LOG_STACKTRACE_ON_DEPRECATION - @type Boolean - @default true - @for EmberENV - @public - */ - ENV.LOG_STACKTRACE_ON_DEPRECATION = _emberEnvironmentUtils.defaultTrue(ENV.LOG_STACKTRACE_ON_DEPRECATION); + 'use strict'; - /** - The `LOG_VERSION` property, when true, tells Ember to log versions of all - dependent libraries in use. - - @property LOG_VERSION - @type Boolean - @default true - @for EmberENV - @public - */ - ENV.LOG_VERSION = _emberEnvironmentUtils.defaultTrue(ENV.LOG_VERSION); + var _EmberObject$extend; - // default false - ENV.MODEL_FACTORY_INJECTIONS = _emberEnvironmentUtils.defaultFalse(ENV.MODEL_FACTORY_INJECTIONS); + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); /** - Debug parameter you can turn on. This will log all bindings that fire to - the console. This should be disabled in production code. Note that you - can also enable this from the console or temporarily. + The `EngineInstance` encapsulates all of the stateful aspects of a + running `Engine`. - @property LOG_BINDINGS - @for EmberENV - @type Boolean - @default false @public + @class Ember.EngineInstance + @extends Ember.Object + @uses RegistryProxyMixin + @uses ContainerProxyMixin */ - ENV.LOG_BINDINGS = _emberEnvironmentUtils.defaultFalse(ENV.LOG_BINDINGS); - ENV.RAISE_ON_DEPRECATION = _emberEnvironmentUtils.defaultFalse(ENV.RAISE_ON_DEPRECATION); + var EngineInstance = _emberRuntime.Object.extend(_emberRuntime.RegistryProxyMixin, _emberRuntime.ContainerProxyMixin, (_EmberObject$extend = { + /** + The base `Engine` for which this is an instance. + @property {Ember.Engine} engine + @private + */ + base: null, - // check if window exists and actually is the global - var hasDOM = typeof window !== 'undefined' && window === _emberEnvironmentGlobal.default && window.document && window.document.createElement && !ENV.disableBrowserEnvironment; // is this a public thing? + init: function () { + this._super.apply(this, arguments); - // legacy imports/exports/lookup stuff (should we keep this??) - var originalContext = _emberEnvironmentGlobal.default.Ember || {}; + _emberUtils.guidFor(this); - var context = { - // import jQuery - imports: originalContext.imports || _emberEnvironmentGlobal.default, - // export Ember - exports: originalContext.exports || _emberEnvironmentGlobal.default, - // search for Namespaces - lookup: originalContext.lookup || _emberEnvironmentGlobal.default - }; + var base = this.base; - exports.context = context; - // TODO: cleanup single source of truth issues with this stuff - var environment = hasDOM ? { - hasDOM: true, - isChrome: !!window.chrome && !window.opera, - isFirefox: typeof InstallTrigger !== 'undefined', - isPhantom: !!window.callPhantom, - location: window.location, - history: window.history, - userAgent: window.navigator.userAgent, - window: window - } : { - hasDOM: false, - isChrome: false, - isFirefox: false, - isPhantom: false, - location: null, - history: null, - userAgent: 'Lynx (textmode)', - window: null - }; - exports.environment = environment; -}); -enifed("ember-environment/utils", ["exports"], function (exports) { - "use strict"; + if (!base) { + base = this.application; + this.base = base; + } - exports.defaultTrue = defaultTrue; - exports.defaultFalse = defaultFalse; - exports.normalizeExtendPrototypes = normalizeExtendPrototypes; + // Create a per-instance registry that will use the application's registry + // as a fallback for resolving registrations. + var registry = this.__registry__ = new _container.Registry({ + fallback: base.__registry__ + }); - function defaultTrue(v) { - return v === false ? false : true; - } + // Create a per-instance container from the instance's registry + this.__container__ = registry.container({ owner: this }); - function defaultFalse(v) { - return v === true ? true : false; - } + this._booted = false; + }, - function normalizeExtendPrototypes(obj) { - if (obj === false) { - return { String: false, Array: false, Function: false }; - } else if (!obj || obj === true) { - return { String: true, Array: true, Function: true }; - } else { - return { - String: defaultTrue(obj.String), - Array: defaultTrue(obj.Array), - Function: defaultTrue(obj.Function) - }; - } - } -}); -enifed('ember-extension-support/container_debug_adapter', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { - 'use strict'; + /** + Initialize the `Ember.EngineInstance` and return a promise that resolves + with the instance itself when the boot process is complete. + The primary task here is to run any registered instance initializers. + See the documentation on `BootOptions` for the options it takes. + @private + @method boot + @param options {Object} + @return {Promise} + */ + boot: function (options) { + var _this = this; - /** - @module ember - @submodule ember-extension-support - */ + if (this._bootPromise) { + return this._bootPromise; + } - /** - The `ContainerDebugAdapter` helps the container and resolver interface - with tools that debug Ember such as the - [Ember Extension](https://github.com/tildeio/ember-extension) - for Chrome and Firefox. - - This class can be extended by a custom resolver implementer - to override some of the methods with library-specific code. - - The methods likely to be overridden are: - - * `canCatalogEntriesByType` - * `catalogEntriesByType` - - The adapter will need to be registered - in the application's container as `container-debug-adapter:main`. - - Example: - - ```javascript - Application.initializer({ - name: "containerDebugAdapter", - - initialize(application) { - application.register('container-debug-adapter:main', require('app/container-debug-adapter')); + this._bootPromise = new _emberRuntime.RSVP.Promise(function (resolve) { + return resolve(_this._bootSync(options)); + }); + + return this._bootPromise; + }, + + /** + Unfortunately, a lot of existing code assumes booting an instance is + synchronous – specifically, a lot of tests assume the last call to + `app.advanceReadiness()` or `app.reset()` will result in a new instance + being fully-booted when the current runloop completes. + We would like new code (like the `visit` API) to stop making this + assumption, so we created the asynchronous version above that returns a + promise. But until we have migrated all the code, we would have to expose + this method for use *internally* in places where we need to boot an instance + synchronously. + @private + */ + _bootSync: function (options) { + if (this._booted) { + return this; } - }); - ``` - - @class ContainerDebugAdapter - @namespace Ember - @extends Ember.Object - @since 1.5.0 - @public - */ - exports.default = _emberRuntime.Object.extend({ + + _emberMetal.assert('An engine instance\'s parent must be set via `setEngineParent(engine, parent)` prior to calling `engine.boot()`.', _emberApplicationSystemEngineParent.getEngineParent(this)); + + this.cloneParentDependencies(); + + this.setupRegistry(options); + + this.base.runInstanceInitializers(this); + + this._booted = true; + + return this; + }, + + setupRegistry: function () { + var options = arguments.length <= 0 || arguments[0] === undefined ? this.__container__.lookup('-environment:main') : arguments[0]; + + this.constructor.setupRegistry(this.__registry__, options); + }, + /** - The resolver instance of the application - being debugged. This property will be injected - on creation. - @property resolver - @default null + Unregister a factory. + Overrides `RegistryProxy#unregister` in order to clear any cached instances + of the unregistered factory. @public + @method unregister + @param {String} fullName + */ + unregister: function (fullName) { + this.__container__.reset(fullName); + this._super.apply(this, arguments); + }, + + /** + @private */ - resolver: null, + willDestroy: function () { + this._super.apply(this, arguments); + _emberMetal.run(this.__container__, 'destroy'); + }, /** - Returns true if it is possible to catalog a list of available - classes in the resolver for a given type. - @method canCatalogEntriesByType - @param {String} type The type. e.g. "model", "controller", "route". - @return {boolean} whether a list is available for this type. - @public + 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} */ - canCatalogEntriesByType: function (type) { - if (type === 'model' || type === 'template') { - return false; + buildChildEngineInstance: function (name) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + var Engine = this.lookup('engine:' + name); + + if (!Engine) { + throw new _emberMetal.Error('You attempted to mount the engine \'' + name + '\', but it is not registered with its parent.'); } - return true; + var engineInstance = Engine.buildInstance(options); + + _emberApplicationSystemEngineParent.setEngineParent(engineInstance, this); + + return engineInstance; }, /** - Returns the available classes a given type. - @method catalogEntriesByType - @param {String} type The type. e.g. "model", "controller", "route". - @return {Array} An array of strings. - @public + Clone dependencies shared between an engine instance and its parent. + @private + @method cloneParentDependencies */ - catalogEntriesByType: function (type) { - var namespaces = _emberRuntime.A(_emberRuntime.Namespace.NAMESPACES); - var types = _emberRuntime.A(); - var typeSuffixRegex = new RegExp(_emberRuntime.String.classify(type) + '$'); + cloneParentDependencies: function () { + var _this2 = this; - namespaces.forEach(function (namespace) { - if (namespace !== _emberMetal.default) { - for (var key in namespace) { - if (!namespace.hasOwnProperty(key)) { - continue; - } - if (typeSuffixRegex.test(key)) { - var klass = namespace[key]; - if (_emberRuntime.typeOf(klass) === 'class') { - types.push(_emberRuntime.String.dasherize(key.replace(typeSuffixRegex, ''))); - } - } - } - } + var parent = _emberApplicationSystemEngineParent.getEngineParent(this); + + var registrations = ['route:basic', 'event_dispatcher:main', 'service:-routing', 'service:-glimmer-environment']; + + registrations.forEach(function (key) { + return _this2.register(key, parent.resolveRegistration(key)); }); - return types; + + var env = parent.lookup('-environment:main'); + this.register('-environment:main', env, { instantiate: false }); + + var singletons = ['router:main', _container.privatize(_templateObject), '-view-registry:main', 'renderer:-' + (env.isInteractive ? 'dom' : 'inert')]; + + singletons.forEach(function (key) { + return _this2.register(key, parent.lookup(key), { instantiate: false }); + }); + + this.inject('view', '_environment', '-environment:main'); + this.inject('route', '_environment', '-environment:main'); + } + + }, _EmberObject$extend[_container.FACTORY_FOR] = function (fullName, options) { + return this.__container__[_container.FACTORY_FOR](fullName, options); + }, _EmberObject$extend[_container.LOOKUP_FACTORY] = function (fullName, options) { + return this.__container__[_container.LOOKUP_FACTORY](fullName, options); + }, _EmberObject$extend)); + + EngineInstance.reopenClass({ + /** + @private + @method setupRegistry + @param {Registry} registry + @param {BootOptions} options + */ + setupRegistry: function (registry, options) { + // when no options/environment is present, do nothing + if (!options) { + return; + } + + registry.injection('view', '_environment', '-environment:main'); + registry.injection('route', '_environment', '-environment:main'); + + if (options.isInteractive) { + registry.injection('view', 'renderer', 'renderer:-dom'); + registry.injection('component', 'renderer', 'renderer:-dom'); + } else { + registry.injection('view', 'renderer', 'renderer:-inert'); + registry.injection('component', 'renderer', 'renderer:-inert'); + } } }); + + exports.default = EngineInstance; }); -// Ember as namespace -enifed('ember-extension-support/data_adapter', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-application'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberApplication) { +enifed('ember-application/system/engine-parent', ['exports', 'ember-utils'], function (exports, _emberUtils) { 'use strict'; + exports.getEngineParent = getEngineParent; + exports.setEngineParent = setEngineParent; + var ENGINE_PARENT = _emberUtils.symbol('ENGINE_PARENT'); + + exports.ENGINE_PARENT = ENGINE_PARENT; /** - @module ember - @submodule ember-extension-support + `getEngineParent` retrieves an engine instance's parent instance. + + @method getEngineParent + @param {EngineInstance} engine An engine instance. + @return {EngineInstance} The parent engine instance. + @for Ember + @public */ + function getEngineParent(engine) { + return engine[ENGINE_PARENT]; + } + /** - The `DataAdapter` helps a data persistence library - interface with tools that debug Ember such - as the [Ember Extension](https://github.com/tildeio/ember-extension) - for Chrome and Firefox. - - This class will be extended by a persistence library - which will override some of the methods with - library-specific code. - - The methods likely to be overridden are: - - * `getFilters` - * `detect` - * `columnsForType` - * `getRecords` - * `getRecordColumnValues` - * `getRecordKeywords` - * `getRecordFilterValues` - * `getRecordColor` - * `observeRecord` + `setEngineParent` sets an engine instance's parent instance. - The adapter will need to be registered - in the application's container as `dataAdapter:main`. + @method setEngineParent + @param {EngineInstance} engine An engine instance. + @param {EngineInstance} parent The parent engine instance. + @private + */ + + function setEngineParent(engine, parent) { + engine[ENGINE_PARENT] = parent; + } +}); +enifed('ember-application/system/engine', ['exports', 'ember-utils', 'ember-runtime', 'container', 'dag-map', 'ember-metal', 'ember-application/system/resolver', 'ember-application/system/engine-instance', 'ember-routing', 'ember-extension-support', 'ember-views', 'ember-glimmer'], function (exports, _emberUtils, _emberRuntime, _container, _dagMap, _emberMetal, _emberApplicationSystemResolver, _emberApplicationSystemEngineInstance, _emberRouting, _emberExtensionSupport, _emberViews, _emberGlimmer) { + /** + @module ember + @submodule ember-application + */ + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); + + function props(obj) { + var properties = []; + + for (var key in obj) { + properties.push(key); + } + + return properties; + } + + /** + The `Engine` class contains core functionality for both applications and + engines. - Example: + Each engine manages a registry that's used for dependency injection and + exposed through `RegistryProxy`. - ```javascript - Application.initializer({ - name: "data-adapter", + Engines also manage initializers and instance initializers. - initialize: function(application) { - application.register('data-adapter:main', DS.DataAdapter); - } - }); - ``` + Engines can spawn `EngineInstance` instances via `buildInstance()`. - @class DataAdapter + @class Engine @namespace Ember - @extends EmberObject + @extends Ember.Namespace + @uses RegistryProxy @public */ - exports.default = _emberRuntime.Object.extend({ + var Engine = _emberRuntime.Namespace.extend(_emberRuntime.RegistryProxyMixin, { init: function () { this._super.apply(this, arguments); - this.releaseMethods = _emberRuntime.A(); + + this.buildRegistry(); }, /** - The container-debug-adapter which is used - to list all models. - @property containerDebugAdapter - @default undefined - @since 1.5.0 - @public - **/ - containerDebugAdapter: undefined, + A private flag indicating whether an engine's initializers have run yet. + @private + @property _initializersRan + */ + _initializersRan: false, /** - The number of attributes to send - as columns. (Enough to make the record - identifiable). + Ensure that initializers are run once, and only once, per engine. @private - @property attributeLimit - @default 3 - @since 1.3.0 + @method ensureInitializers */ - attributeLimit: 3, + ensureInitializers: function () { + if (!this._initializersRan) { + this.runInitializers(); + this._initializersRan = true; + } + }, /** - Ember Data > v1.0.0-beta.18 - requires string model names to be passed - around instead of the actual factories. - This is a stamp for the Ember Inspector - to differentiate between the versions - to be able to support older versions too. - @public - @property acceptsModelName - */ - acceptsModelName: true, + Create an EngineInstance for this engine. + @private + @method buildInstance + @return {Ember.EngineInstance} the engine instance + */ + buildInstance: function () { + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + + this.ensureInitializers(); + options.base = this; + return _emberApplicationSystemEngineInstance.default.create(options); + }, /** - Stores all methods that clear observers. - These methods will be called on destruction. + Build and configure the registry for the current engine. @private - @property releaseMethods - @since 1.3.0 + @method buildRegistry + @return {Ember.Registry} the configured registry */ - releaseMethods: _emberRuntime.A(), + buildRegistry: function () { + var registry = this.__registry__ = this.constructor.buildRegistry(this); + + return registry; + }, /** - Specifies how records can be filtered. - Records returned will need to have a `filterValues` - property with a key for every name in the returned array. - @public - @method getFilters - @return {Array} List of objects defining filters. - The object should have a `name` and `desc` property. + @private + @method initializer */ - getFilters: function () { - return _emberRuntime.A(); + initializer: function (options) { + this.constructor.initializer(options); }, /** - Fetch the model types and observe them for changes. - @public - @method watchModelTypes - @param {Function} typesAdded Callback to call to add types. - Takes an array of objects containing wrapped types (returned from `wrapModelType`). - @param {Function} typesUpdated Callback to call when a type has changed. - Takes an array of objects containing wrapped types. - @return {Function} Method to call to remove all observers + @private + @method instanceInitializer */ - watchModelTypes: function (typesAdded, typesUpdated) { + instanceInitializer: function (options) { + this.constructor.instanceInitializer(options); + }, + + /** + @private + @method runInitializers + */ + runInitializers: function () { var _this = this; - var modelTypes = this.getModelTypes(); - var releaseMethods = _emberRuntime.A(); - var typesToSend = undefined; + this._runInitializer('initializers', function (name, initializer) { + _emberMetal.assert('No application initializer named \'' + name + '\'', !!initializer); + if (initializer.initialize.length === 2) { + _emberMetal.deprecate('The `initialize` method for Application initializer \'' + name + '\' should take only one argument - `App`, an instance of an `Application`.', false, { + id: 'ember-application.app-initializer-initialize-arguments', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_initializer-arity' + }); - typesToSend = modelTypes.map(function (type) { - var klass = type.klass; - var wrapped = _this.wrapModelType(klass, type.name); - releaseMethods.push(_this.observeModelType(type.name, typesUpdated)); - return wrapped; + initializer.initialize(_this.__registry__, _this); + } else { + initializer.initialize(_this); + } }); - - typesAdded(typesToSend); - - var release = function () { - releaseMethods.forEach(function (fn) { - return fn(); - }); - _this.releaseMethods.removeObject(release); - }; - this.releaseMethods.pushObject(release); - return release; - }, - - _nameToClass: function (type) { - if (typeof type === 'string') { - type = _emberUtils.getOwner(this)._lookupFactory('model:' + type); - } - return type; }, /** - Fetch the records of a given type and observe them for changes. - @public - @method watchRecords - @param {String} modelName The model name. - @param {Function} recordsAdded Callback to call to add records. - Takes an array of objects containing wrapped records. - The object should have the following properties: - columnValues: {Object} The key and value of a table cell. - object: {Object} The actual record object. - @param {Function} recordsUpdated Callback to call when a record has changed. - Takes an array of objects containing wrapped records. - @param {Function} recordsRemoved Callback to call when a record has removed. - Takes the following parameters: - index: The array index where the records were removed. - count: The number of records removed. - @return {Function} Method to call to remove all observers. + @private + @since 1.12.0 + @method runInstanceInitializers */ - watchRecords: function (modelName, recordsAdded, recordsUpdated, recordsRemoved) { - var _this2 = this; + runInstanceInitializers: function (instance) { + this._runInitializer('instanceInitializers', function (name, initializer) { + _emberMetal.assert('No instance initializer named \'' + name + '\'', !!initializer); + initializer.initialize(instance); + }); + }, - var releaseMethods = _emberRuntime.A(); - var klass = this._nameToClass(modelName); - var records = this.getRecords(klass, modelName); - var release = undefined; + _runInitializer: function (bucketName, cb) { + var initializersByName = _emberMetal.get(this.constructor, bucketName); + var initializers = props(initializersByName); + var graph = new _dagMap.default(); + var initializer = undefined; - function recordUpdated(updatedRecord) { - recordsUpdated([updatedRecord]); + for (var i = 0; i < initializers.length; i++) { + initializer = initializersByName[initializers[i]]; + graph.add(initializer.name, initializer, initializer.before, initializer.after); } - var recordsToSend = records.map(function (record) { - releaseMethods.push(_this2.observeRecord(record, recordUpdated)); - return _this2.wrapRecord(record); - }); + graph.topsort(cb); + } + }); - var contentDidChange = function (array, idx, removedCount, addedCount) { - for (var i = idx; i < idx + addedCount; i++) { - var record = _emberRuntime.objectAt(array, i); - var wrapped = _this2.wrapRecord(record); - releaseMethods.push(_this2.observeRecord(record, recordUpdated)); - recordsAdded([wrapped]); - } + Engine.reopenClass({ + initializers: new _emberUtils.EmptyObject(), + instanceInitializers: new _emberUtils.EmptyObject(), - if (removedCount) { - recordsRemoved(idx, removedCount); + /** + The goal of initializers should be to register dependencies and injections. + This phase runs once. Because these initializers may load code, they are + allowed to defer application readiness and advance it. If you need to access + the container or store you should use an InstanceInitializer that will be run + after all initializers and therefore after all code is loaded and the app is + ready. + Initializer receives an object which has the following attributes: + `name`, `before`, `after`, `initialize`. The only required attribute is + `initialize`, all others are optional. + * `name` allows you to specify under which name the initializer is registered. + This must be a unique name, as trying to register two initializers with the + same name will result in an error. + ```javascript + Ember.Application.initializer({ + name: 'namedInitializer', + initialize: function(application) { + Ember.debug('Running namedInitializer!'); } - }; - - var observer = { didChange: contentDidChange, willChange: function () { - return this; - } }; - _emberRuntime.addArrayObserver(records, this, observer); - - release = function () { - releaseMethods.forEach(function (fn) { - return fn(); - }); - _emberRuntime.removeArrayObserver(records, _this2, observer); - _this2.releaseMethods.removeObject(release); - }; + }); + ``` + * `before` and `after` are used to ensure that this initializer is ran prior + or after the one identified by the value. This value can be a single string + or an array of strings, referencing the `name` of other initializers. + An example of ordering initializers, we create an initializer named `first`: + ```javascript + Ember.Application.initializer({ + name: 'first', + initialize: function(application) { + Ember.debug('First initializer!'); + } + }); + // DEBUG: First initializer! + ``` + We add another initializer named `second`, specifying that it should run + after the initializer named `first`: + ```javascript + Ember.Application.initializer({ + name: 'second', + after: 'first', + initialize: function(application) { + Ember.debug('Second initializer!'); + } + }); + // DEBUG: First initializer! + // DEBUG: Second initializer! + ``` + Afterwards we add a further initializer named `pre`, this time specifying + that it should run before the initializer named `first`: + ```javascript + Ember.Application.initializer({ + name: 'pre', + before: 'first', + initialize: function(application) { + Ember.debug('Pre initializer!'); + } + }); + // DEBUG: Pre initializer! + // DEBUG: First initializer! + // DEBUG: Second initializer! + ``` + Finally we add an initializer named `post`, specifying it should run after + both the `first` and the `second` initializers: + ```javascript + Ember.Application.initializer({ + name: 'post', + after: ['first', 'second'], + initialize: function(application) { + Ember.debug('Post initializer!'); + } + }); + // DEBUG: Pre initializer! + // DEBUG: First initializer! + // DEBUG: Second initializer! + // DEBUG: Post initializer! + ``` + * `initialize` is a callback function that receives one argument, + `application`, on which you can operate. + Example of using `application` to register an adapter: + ```javascript + Ember.Application.initializer({ + name: 'api-adapter', + initialize: function(application) { + application.register('api-adapter:main', ApiAdapter); + } + }); + ``` + @method initializer + @param initializer {Object} + @public + */ - recordsAdded(recordsToSend); + initializer: buildInitializerMethod('initializers', 'initializer'), - this.releaseMethods.pushObject(release); - return release; - }, + /** + Instance initializers run after all initializers have run. Because + instance initializers run after the app is fully set up. We have access + to the store, container, and other items. However, these initializers run + after code has loaded and are not allowed to defer readiness. + Instance initializer receives an object which has the following attributes: + `name`, `before`, `after`, `initialize`. The only required attribute is + `initialize`, all others are optional. + * `name` allows you to specify under which name the instanceInitializer is + registered. This must be a unique name, as trying to register two + instanceInitializer with the same name will result in an error. + ```javascript + Ember.Application.instanceInitializer({ + name: 'namedinstanceInitializer', + initialize: function(application) { + Ember.debug('Running namedInitializer!'); + } + }); + ``` + * `before` and `after` are used to ensure that this initializer is ran prior + or after the one identified by the value. This value can be a single string + or an array of strings, referencing the `name` of other initializers. + * See Ember.Application.initializer for discussion on the usage of before + and after. + Example instanceInitializer to preload data into the store. + ```javascript + Ember.Application.initializer({ + name: 'preload-data', + initialize: function(application) { + var userConfig, userConfigEncoded, store; + // We have a HTML escaped JSON representation of the user's basic + // configuration generated server side and stored in the DOM of the main + // index.html file. This allows the app to have access to a set of data + // without making any additional remote calls. Good for basic data that is + // needed for immediate rendering of the page. Keep in mind, this data, + // like all local models and data can be manipulated by the user, so it + // should not be relied upon for security or authorization. + // + // Grab the encoded data from the meta tag + userConfigEncoded = Ember.$('head meta[name=app-user-config]').attr('content'); + // Unescape the text, then parse the resulting JSON into a real object + userConfig = JSON.parse(unescape(userConfigEncoded)); + // Lookup the store + store = application.lookup('service:store'); + // Push the encoded JSON into the store + store.pushPayload(userConfig); + } + }); + ``` + @method instanceInitializer + @param instanceInitializer + @public + */ + instanceInitializer: buildInitializerMethod('instanceInitializers', 'instance initializer'), /** - Clear all observers before destruction + This creates a registry with the default Ember naming conventions. + It also configures the registry: + * registered views are created every time they are looked up (they are + not singletons) + * registered templates are not factories; the registered value is + returned directly. + * the router receives the application as its `namespace` property + * all controllers receive the router as their `target` and `controllers` + properties + * 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 + @method buildRegistry + @static + @param {Ember.Application} namespace the application for which to + build the registry + @return {Ember.Registry} the built registry @private - @method willDestroy */ - willDestroy: function () { - this._super.apply(this, arguments); - this.releaseMethods.forEach(function (fn) { - return fn(); + buildRegistry: function (namespace) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + var registry = new _container.Registry({ + resolver: resolverFor(namespace) }); - }, - /** - Detect whether a class is a model. - Test that against the model class - of your persistence library. - @private - @method detect - @param {Class} klass The class to test. - @return boolean Whether the class is a model class or not. - */ - detect: function (klass) { - return false; + registry.set = _emberMetal.set; + + registry.register('application:main', namespace, { instantiate: false }); + + commonSetupRegistry(registry); + _emberGlimmer.setupEngineRegistry(registry); + + return registry; }, /** - Get the columns for a given model type. - @private - @method columnsForType - @param {Class} type The model type. - @return {Array} An array of columns of the following format: - name: {String} The name of the column. - desc: {String} Humanized description (what would show in a table column name). + Set this to provide an alternate class to `Ember.DefaultResolver` + @deprecated Use 'Resolver' instead + @property resolver + @public */ - columnsForType: function (type) { - return _emberRuntime.A(); - }, + resolver: null, /** - Adds observers to a model type class. - @private - @method observeModelType - @param {String} modelName The model type name. - @param {Function} typesUpdated Called when a type is modified. - @return {Function} The function to call to remove observers. + Set this to provide an alternate class to `Ember.DefaultResolver` + @property resolver + @public */ + Resolver: null + }); - observeModelType: function (modelName, typesUpdated) { - var _this3 = this; + /** + This function defines the default lookup rules for container lookups: + + * templates are looked up on `Ember.TEMPLATES` + * other names are looked up on the application after classifying the name. + For example, `controller:post` looks up `App.PostController` by default. + * if the default lookup fails, look for registered classes on the container + + This allows the application to register default injections in the container + that could be overridden by the normal naming convention. + + @private + @method resolverFor + @param {Ember.Namespace} namespace the namespace to look for classes + @return {*} the resolved value for a given lookup + */ + function resolverFor(namespace) { + var ResolverClass = namespace.get('Resolver') || _emberApplicationSystemResolver.default; - var klass = this._nameToClass(modelName); - var records = this.getRecords(klass, modelName); + return ResolverClass.create({ + namespace: namespace + }); + } - function onChange() { - typesUpdated([this.wrapModelType(klass, modelName)]); + function buildInitializerMethod(bucketName, humanName) { + return function (initializer) { + // If this is the first initializer being added to a subclass, we are going to reopen the class + // to make sure we have a new `initializers` object, which extends from the parent class' using + // prototypal inheritance. Without this, attempting to add initializers to the subclass would + // pollute the parent class as well as other subclasses. + if (this.superclass[bucketName] !== undefined && this.superclass[bucketName] === this[bucketName]) { + var attrs = {}; + attrs[bucketName] = Object.create(this[bucketName]); + this.reopenClass(attrs); } - var observer = { - didChange: function () { - _emberMetal.run.scheduleOnce('actions', this, onChange); - }, - willChange: function () { - return this; - } - }; + _emberMetal.assert('The ' + humanName + ' \'' + initializer.name + '\' has already been registered', !this[bucketName][initializer.name]); + _emberMetal.assert('An ' + humanName + ' cannot be registered without an initialize function', _emberUtils.canInvoke(initializer, 'initialize')); + _emberMetal.assert('An ' + humanName + ' cannot be registered without a name property', initializer.name !== undefined); - _emberRuntime.addArrayObserver(records, this, observer); + this[bucketName][initializer.name] = initializer; + }; + } - var release = function () { - return _emberRuntime.removeArrayObserver(records, _this3, observer); - }; + function commonSetupRegistry(registry) { + registry.optionsForType('component', { singleton: false }); + registry.optionsForType('view', { singleton: false }); - return release; - }, + registry.register('controller:basic', _emberRuntime.Controller, { instantiate: false }); - /** - Wraps a given model type and observes changes to it. - @private - @method wrapModelType - @param {Class} klass A model class. - @param {String} modelName Name of the class. - @return {Object} Contains the wrapped type and the function to remove observers - Format: - type: {Object} The wrapped type. - The wrapped type has the following format: - name: {String} The name of the type. - count: {Integer} The number of records available. - columns: {Columns} An array of columns to describe the record. - object: {Class} The actual Model type class. - release: {Function} The function to remove observers. - */ - wrapModelType: function (klass, name) { - var records = this.getRecords(klass, name); - var typeToSend = undefined; + registry.injection('view', '_viewRegistry', '-view-registry:main'); + registry.injection('renderer', '_viewRegistry', '-view-registry:main'); + registry.injection('event_dispatcher:main', '_viewRegistry', '-view-registry:main'); - typeToSend = { - name: name, - count: _emberMetal.get(records, 'length'), - columns: this.columnsForType(klass), - object: klass - }; + registry.injection('route', '_topLevelViewTemplate', 'template:-outlet'); - return typeToSend; - }, + registry.injection('view:-outlet', 'namespace', 'application:main'); - /** - Fetches all models defined in the application. - @private - @method getModelTypes - @return {Array} Array of model types. - */ - getModelTypes: function () { - var _this4 = this; + registry.injection('controller', 'target', 'router:main'); + registry.injection('controller', 'namespace', 'application:main'); - var containerDebugAdapter = this.get('containerDebugAdapter'); - var types = undefined; + registry.injection('router', '_bucketCache', _container.privatize(_templateObject)); + registry.injection('route', '_bucketCache', _container.privatize(_templateObject)); - if (containerDebugAdapter.canCatalogEntriesByType('model')) { - types = containerDebugAdapter.catalogEntriesByType('model'); - } else { - types = this._getObjectsOnNamespaces(); - } + registry.injection('route', 'router', 'router:main'); - // New adapters return strings instead of classes. - types = _emberRuntime.A(types).map(function (name) { - return { - klass: _this4._nameToClass(name), - name: name - }; - }); - types = _emberRuntime.A(types).filter(function (type) { - return _this4.detect(type.klass); - }); + // Register the routing service... + registry.register('service:-routing', _emberRouting.RoutingService); + // Then inject the app router into it + registry.injection('service:-routing', 'router', 'router:main'); - return _emberRuntime.A(types); - }, + // DEBUGGING + registry.register('resolver-for-debugging:main', registry.resolver, { instantiate: false }); + registry.injection('container-debug-adapter:main', 'resolver', 'resolver-for-debugging:main'); + registry.injection('data-adapter:main', 'containerDebugAdapter', 'container-debug-adapter:main'); + // Custom resolver authors may want to register their own ContainerDebugAdapter with this key - /** - Loops over all namespaces and all objects - attached to them. - @private - @method _getObjectsOnNamespaces - @return {Array} Array of model type strings. - */ - _getObjectsOnNamespaces: function () { - var _this5 = this; + registry.register('container-debug-adapter:main', _emberExtensionSupport.ContainerDebugAdapter); - var namespaces = _emberRuntime.A(_emberRuntime.Namespace.NAMESPACES); - var types = _emberRuntime.A(); + registry.register('component-lookup:main', _emberViews.ComponentLookup); + } - namespaces.forEach(function (namespace) { - for (var key in namespace) { - if (!namespace.hasOwnProperty(key)) { - continue; - } - // Even though we will filter again in `getModelTypes`, - // we should not call `lookupFactory` on non-models - // (especially when `EmberENV.MODEL_FACTORY_INJECTIONS` is `true`) - if (!_this5.detect(namespace[key])) { - continue; - } - var _name = _emberRuntime.String.dasherize(key); - if (!(namespace instanceof _emberApplication.Application) && namespace.toString()) { - _name = namespace + '/' + _name; - } - types.push(_name); - } - }); - return types; - }, + exports.default = Engine; +}); +enifed('ember-application/system/resolver', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-application/utils/validate-type', 'ember-glimmer'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberApplicationUtilsValidateType, _emberGlimmer) { + /** + @module ember + @submodule ember-application + */ - /** - Fetches all loaded records for a given type. - @private - @method getRecords - @return {Array} An array of records. - This array will be observed for changes, - so it should update when new records are added/removed. - */ - getRecords: function (type) { - return _emberRuntime.A(); - }, + 'use strict'; - /** - Wraps a record and observers changes to it. - @private - @method wrapRecord - @param {Object} record The record instance. - @return {Object} The wrapped record. Format: - columnValues: {Array} - searchKeywords: {Array} + var Resolver = _emberRuntime.Object.extend({ + /* + This will be set to the Application instance when it is + created. + @property namespace */ - wrapRecord: function (record) { - var recordToSend = { object: record }; - - recordToSend.columnValues = this.getRecordColumnValues(record); - recordToSend.searchKeywords = this.getRecordKeywords(record); - recordToSend.filterValues = this.getRecordFilterValues(record); - recordToSend.color = this.getRecordColor(record); - - return recordToSend; - }, - - /** - Gets the values for each column. - @private - @method getRecordColumnValues - @return {Object} Keys should match column names defined - by the model type. - */ - getRecordColumnValues: function (record) { - return {}; - }, - - /** - Returns keywords to match when searching records. - @private - @method getRecordKeywords - @return {Array} Relevant keywords for search. - */ - getRecordKeywords: function (record) { - return _emberRuntime.A(); - }, - - /** - Returns the values of filters defined by `getFilters`. - @private - @method getRecordFilterValues - @param {Object} record The record instance. - @return {Object} The filter values. - */ - getRecordFilterValues: function (record) { - return {}; - }, - - /** - Each record can have a color that represents its state. - @private - @method getRecordColor - @param {Object} record The record instance - @return {String} The records color. - Possible options: black, red, blue, green. - */ - getRecordColor: function (record) { - return null; - }, - - /** - Observes all relevant properties and re-sends the wrapped record - when a change occurs. - @private - @method observerRecord - @param {Object} record The record instance. - @param {Function} recordUpdated The callback to call when a record is updated. - @return {Function} The function to call to remove all observers. - */ - observeRecord: function (record, recordUpdated) { - return function () {}; - } + namespace: null, + normalize: null, // required + resolve: null, // required + parseName: null, // required + lookupDescription: null, // required + makeToString: null, // required + resolveOther: null, // required + _logLookup: null // required }); -}); -enifed('ember-extension-support/index', ['exports', 'ember-extension-support/data_adapter', 'ember-extension-support/container_debug_adapter'], function (exports, _emberExtensionSupportData_adapter, _emberExtensionSupportContainer_debug_adapter) { - /** - @module ember - @submodule ember-extension-support - */ - - 'use strict'; - - exports.DataAdapter = _emberExtensionSupportData_adapter.default; - exports.ContainerDebugAdapter = _emberExtensionSupportContainer_debug_adapter.default; -}); -enifed('ember-glimmer/component', ['exports', 'ember-utils', 'ember-views', 'ember-runtime', 'ember-metal', 'ember-glimmer/utils/references', 'glimmer-reference', 'glimmer-runtime'], function (exports, _emberUtils, _emberViews, _emberRuntime, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference, _glimmerRuntime) { - 'use strict'; - - var _CoreView$extend; - - var DIRTY_TAG = _emberUtils.symbol('DIRTY_TAG'); - exports.DIRTY_TAG = DIRTY_TAG; - var ARGS = _emberUtils.symbol('ARGS'); - exports.ARGS = ARGS; - var ROOT_REF = _emberUtils.symbol('ROOT_REF'); - exports.ROOT_REF = ROOT_REF; - var IS_DISPATCHING_ATTRS = _emberUtils.symbol('IS_DISPATCHING_ATTRS'); - exports.IS_DISPATCHING_ATTRS = IS_DISPATCHING_ATTRS; - var HAS_BLOCK = _emberUtils.symbol('HAS_BLOCK'); - exports.HAS_BLOCK = HAS_BLOCK; - var BOUNDS = _emberUtils.symbol('BOUNDS'); - - exports.BOUNDS = BOUNDS; - /** - @module ember - @submodule ember-glimmer - */ + exports.Resolver = Resolver; /** - An `Ember.Component` is a view that is completely - isolated. Properties accessed in its templates go - to the view object and actions are targeted at - the view object. There is no access to the - surrounding context or outer controller; all - contextual information must be passed in. - - The easiest way to create an `Ember.Component` is via - a template. If you name a template - `components/my-foo`, you will be able to use - `{{my-foo}}` in other templates, which will make - an instance of the isolated component. + The DefaultResolver defines the default lookup rules to resolve + container lookups before consulting the container for registered + items: - ```handlebars - {{app-profile person=currentUser}} - ``` + * templates are looked up on `Ember.TEMPLATES` + * other names are looked up on the application after converting + the name. For example, `controller:post` looks up + `App.PostController` by default. + * there are some nuances (see examples below) - ```handlebars - -

    {{person.title}}

    - -

    {{person.signature}}

    - ``` + ### How Resolving Works - You can use `yield` inside a template to - include the **contents** of any block attached to - the component. The block will be executed in the - context of the surrounding context or outer controller: + The container calls this object's `resolve` method with the + `fullName` argument. - ```handlebars - {{#app-profile person=currentUser}} -

    Admin mode

    - {{! Executed in the controller's context. }} - {{/app-profile}} - ``` + It first parses the fullName into an object using `parseName`. - ```handlebars - -

    {{person.title}}

    - {{! Executed in the component's context. }} - {{yield}} {{! block contents }} - ``` + Then it checks for the presence of a type-specific instance + method of the form `resolve[Type]` and calls it if it exists. + For example if it was resolving 'template:post', it would call + the `resolveTemplate` method. - If you want to customize the component, in order to - handle events or actions, you implement a subclass - of `Ember.Component` named after the name of the - component. Note that `Component` needs to be appended to the name of - your subclass like `AppProfileComponent`. + Its last resort is to call the `resolveOther` method. - For example, you could implement the action - `hello` for the `app-profile` component: + The methods of this object are designed to be easy to override + in a subclass. For example, you could enhance how a template + is resolved like so: ```javascript - App.AppProfileComponent = Ember.Component.extend({ - actions: { - hello: function(name) { - console.log("Hello", name); + App = Ember.Application.create({ + Resolver: Ember.DefaultResolver.extend({ + resolveTemplate: function(parsedName) { + let resolvedTemplate = this._super(parsedName); + if (resolvedTemplate) { return resolvedTemplate; } + return Ember.TEMPLATES['not_found']; } - } + }) }); ``` - And then use it in the component's template: + Some examples of how names are resolved: - ```handlebars - -

    {{person.title}}

    - {{yield}} - ``` - Components must have a `-` in their name to avoid - conflicts with built-in controls that wrap HTML - elements. This is consistent with the same - requirement in web components. + 'template:post' //=> Ember.TEMPLATES['post'] + 'template:posts/byline' //=> Ember.TEMPLATES['posts/byline'] + 'template:posts.byline' //=> Ember.TEMPLATES['posts/byline'] + 'template:blogPost' //=> Ember.TEMPLATES['blogPost'] + // OR + // Ember.TEMPLATES['blog_post'] + 'controller:post' //=> App.PostController + 'controller:posts.index' //=> App.PostsIndexController + 'controller:blog/post' //=> Blog.PostController + 'controller:basic' //=> Ember.Controller + 'route:post' //=> App.PostRoute + 'route:posts.index' //=> App.PostsIndexRoute + 'route:blog/post' //=> Blog.PostRoute + 'route:basic' //=> Ember.Route + 'view:post' //=> App.PostView + 'view:posts.index' //=> App.PostsIndexView + 'view:blog/post' //=> Blog.PostView + 'view:basic' //=> Ember.View + 'foo:post' //=> App.PostFoo + 'model:post' //=> App.Post + ``` - @class Component + @class DefaultResolver @namespace Ember - @extends Ember.CoreView - @uses Ember.TargetActionSupport - @uses Ember.ClassNamesSupport - @uses Ember.ActionSupport - @uses Ember.ViewMixin + @extends Ember.Object @public */ - var Component = _emberViews.CoreView.extend(_emberViews.ChildViewsSupport, _emberViews.ViewStateSupport, _emberViews.ClassNamesSupport, _emberRuntime.TargetActionSupport, _emberViews.ActionSupport, _emberViews.ViewMixin, (_CoreView$extend = { - isComponent: true, + + exports.default = _emberRuntime.Object.extend({ + /** + This will be set to the Application instance when it is + created. + @property namespace + @public + */ + namespace: null, init: function () { - var _this = this; + this._parseNameCache = _emberUtils.dictionary(null); + }, + normalize: function (fullName) { + var _fullName$split = fullName.split(':', 2); - this._super.apply(this, arguments); - this[IS_DISPATCHING_ATTRS] = false; - this[DIRTY_TAG] = new _glimmerReference.DirtyableTag(); - this[ROOT_REF] = new _emberGlimmerUtilsReferences.RootReference(this); - this[BOUNDS] = null; + var type = _fullName$split[0]; + var name = _fullName$split[1]; - // If a `defaultLayout` was specified move it to the `layout` prop. - // `layout` is no longer a CP, so this just ensures that the `defaultLayout` - // logic is supported with a deprecation - if (this.defaultLayout && !this.layout) { - _emberMetal.deprecate('Specifying `defaultLayout` to ' + this + ' is deprecated. Please use `layout` instead.', false, { - id: 'ember-views.component.defaultLayout', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-component-defaultlayout' - }); + _emberMetal.assert('Tried to normalize a container name without a colon (:) in it. ' + 'You probably tried to lookup a name that did not contain a type, ' + 'a colon, and a name. A proper lookup name would be `view:post`.', fullName.split(':').length === 2); - this.layout = this.defaultLayout; - } + if (type !== 'template') { + var result = name; - // If in a tagless component, assert that no event handlers are defined - _emberMetal.assert('You can not define a function that handles DOM events in the `' + this + '` tagless component since it doesn\'t have any DOM element.', this.tagName !== '' || !this.renderer._destinedForDOM || !(function () { - var eventDispatcher = _emberUtils.getOwner(_this).lookup('event_dispatcher:main'); - var events = eventDispatcher && eventDispatcher._finalEvents || {}; + if (result.indexOf('.') > -1) { + result = result.replace(/\.(.)/g, function (m) { + return m.charAt(1).toUpperCase(); + }); + } - for (var key in events) { - var methodName = events[key]; + if (name.indexOf('_') > -1) { + result = result.replace(/_(.)/g, function (m) { + return m.charAt(1).toUpperCase(); + }); + } - if (typeof _this[methodName] === 'function') { - return true; // indicate that the assertion should be triggered - } + if (name.indexOf('-') > -1) { + result = result.replace(/-(.)/g, function (m) { + return m.charAt(1).toUpperCase(); + }); } - })()); - }, - rerender: function () { - this[DIRTY_TAG].dirty(); - this._super(); + return type + ':' + result; + } else { + return fullName; + } }, - __defineNonEnumerable: function (property) { - this[property.name] = property.descriptor.value; - } + /** + This method is called via the container's resolver method. + It parses the provided `fullName` and then looks up and + returns the appropriate template or class. + @method resolve + @param {String} fullName the lookup string + @return {Object} the resolved factory + @public + */ + resolve: function (fullName) { + var _this = this; - }, _CoreView$extend[_emberMetal.PROPERTY_DID_CHANGE] = function (key) { - if (this[IS_DISPATCHING_ATTRS]) { - return; - } + var parsedName = this.parseName(fullName); + var resolveMethodName = parsedName.resolveMethodName; + var resolved = undefined; - var args = undefined, - reference = undefined; + if (this[resolveMethodName]) { + resolved = this[resolveMethodName](parsedName); + } - if ((args = this[ARGS]) && (reference = args[key])) { - if (reference[_emberGlimmerUtilsReferences.UPDATE]) { - reference[_emberGlimmerUtilsReferences.UPDATE](_emberMetal.get(this, key)); + resolved = resolved || this.resolveOther(parsedName); + + _emberMetal.runInDebug(function () { + if (parsedName.root && parsedName.root.LOG_RESOLVER) { + _this._logLookup(resolved, parsedName); + } + }); + + if (resolved) { + _emberApplicationUtilsValidateType.default(resolved, parsedName); } - } - }, _CoreView$extend.getAttr = function (key) { - // TODO Intimate API should be deprecated - return this.get(key); - }, _CoreView$extend.readDOMAttr = function (name) { - var element = _emberViews.getViewElement(this); - return _glimmerRuntime.readDOMAttr(element, name); - }, _CoreView$extend)); - /** - The WAI-ARIA role of the control represented by this view. For example, a - button may have a role of type 'button', or a pane may have a role of - type 'alertdialog'. This property is used by assistive software to help - visually challenged users navigate rich web applications. - The full list of valid WAI-ARIA roles is available at: - [http://www.w3.org/TR/wai-aria/roles#roles_categorization](http://www.w3.org/TR/wai-aria/roles#roles_categorization) - @property ariaRole - @type String - @default null - @public - */ + return resolved; + }, - /** - Enables components to take a list of parameters as arguments. - For example, a component that takes two parameters with the names - `name` and `age`: - ```javascript - let MyComponent = Ember.Component.extend; - MyComponent.reopenClass({ - positionalParams: ['name', 'age'] - }); - ``` - It can then be invoked like this: - ```hbs - {{my-component "John" 38}} - ``` - The parameters can be referred to just like named parameters: - ```hbs - Name: {{attrs.name}}, Age: {{attrs.age}}. - ``` - Using a string instead of an array allows for an arbitrary number of - parameters: - ```javascript - let MyComponent = Ember.Component.extend; - MyComponent.reopenClass({ - positionalParams: 'names' - }); - ``` - It can then be invoked like this: - ```hbs - {{my-component "John" "Michael" "Scott"}} - ``` - The parameters can then be referred to by enumerating over the list: - ```hbs - {{#each attrs.names as |name|}}{{name}}{{/each}} - ``` - @static - @public - @property positionalParams - @since 1.13.0 - */ + /** + Convert the string name of the form 'type:name' to + a Javascript object with the parsed aspects of the name + broken out. + @param {String} fullName the lookup string + @method parseName + @protected + */ - /** - Called when the attributes passed into the component have been updated. - Called both during the initial render of a container and during a rerender. - Can be used in place of an observer; code placed here will be executed - every time any attribute updates. - @method didReceiveAttrs - @public - @since 1.13.0 - */ + parseName: function (fullName) { + return this._parseNameCache[fullName] || (this._parseNameCache[fullName] = this._parseName(fullName)); + }, - /** - Called when the attributes passed into the component have been updated. - Called both during the initial render of a container and during a rerender. - Can be used in place of an observer; code placed here will be executed - every time any attribute updates. - @event didReceiveAttrs - @public - @since 1.13.0 - */ + _parseName: function (fullName) { + var _fullName$split2 = fullName.split(':'); - /** - Called after a component has been rendered, both on initial render and - in subsequent rerenders. - @method didRender - @public - @since 1.13.0 - */ + var type = _fullName$split2[0]; + var fullNameWithoutType = _fullName$split2[1]; - /** - Called after a component has been rendered, both on initial render and - in subsequent rerenders. - @event didRender - @public - @since 1.13.0 - */ + var name = fullNameWithoutType; + var namespace = _emberMetal.get(this, 'namespace'); + var root = namespace; + var lastSlashIndex = name.lastIndexOf('/'); + var dirname = lastSlashIndex !== -1 ? name.slice(0, lastSlashIndex) : null; - /** - Called before a component has been rendered, both on initial render and - in subsequent rerenders. - @method willRender - @public - @since 1.13.0 - */ + if (type !== 'template' && lastSlashIndex !== -1) { + var parts = name.split('/'); + name = parts[parts.length - 1]; + var namespaceName = _emberRuntime.String.capitalize(parts.slice(0, -1).join('.')); + root = _emberRuntime.Namespace.byName(namespaceName); - /** - Called before a component has been rendered, both on initial render and - in subsequent rerenders. - @event willRender - @public - @since 1.13.0 - */ + _emberMetal.assert('You are looking for a ' + name + ' ' + type + ' in the ' + namespaceName + ' namespace, but the namespace could not be found', root); + } - /** - Called when the attributes passed into the component have been changed. - Called only during a rerender, not during an initial render. - @method didUpdateAttrs - @public - @since 1.13.0 - */ + var resolveMethodName = fullNameWithoutType === 'main' ? 'Main' : _emberRuntime.String.classify(type); - /** - Called when the attributes passed into the component have been changed. - Called only during a rerender, not during an initial render. - @event didUpdateAttrs - @public - @since 1.13.0 - */ + if (!(name && type)) { + throw new TypeError('Invalid fullName: `' + fullName + '`, must be of the form `type:name` '); + } - /** - Called when the component is about to update and rerender itself. - Called only during a rerender, not during an initial render. - @method willUpdate - @public - @since 1.13.0 - */ + return { + fullName: fullName, + type: type, + fullNameWithoutType: fullNameWithoutType, + dirname: dirname, + name: name, + root: root, + resolveMethodName: 'resolve' + resolveMethodName + }; + }, - /** - Called when the component is about to update and rerender itself. - Called only during a rerender, not during an initial render. - @event willUpdate - @public - @since 1.13.0 - */ + /** + 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. + @param {String} fullName the lookup string + @method lookupDescription + @protected + */ + lookupDescription: function (fullName) { + var parsedName = this.parseName(fullName); + var description = undefined; - /** - Called when the component has updated and rerendered itself. - Called only during a rerender, not during an initial render. - @method didUpdate - @public - @since 1.13.0 - */ + if (parsedName.type === 'template') { + return 'template at ' + parsedName.fullNameWithoutType.replace(/\./g, '/'); + } - /** - Called when the component has updated and rerendered itself. - Called only during a rerender, not during an initial render. - @event didUpdate - @public - @since 1.13.0 - */ + description = parsedName.root + '.' + _emberRuntime.String.classify(parsedName.name).replace(/\./g, ''); - /** - If `false`, the view will appear hidden in DOM. - @property isVisible - @type Boolean - @default null - @public - */ - Component[_emberMetal.NAME_KEY] = 'Ember.Component'; + if (parsedName.type !== 'model') { + description += _emberRuntime.String.classify(parsedName.type); + } - Component.reopenClass({ - isComponentFactory: true, - positionalParams: [] - }); + return description; + }, - exports.default = Component; -}); + makeToString: function (factory, fullName) { + return factory.toString(); + }, -/** - Normally, Ember's component model is "write-only". The component takes a - bunch of attributes that it got passed in, and uses them to render its - template. - One nice thing about this model is that if you try to set a value to the - same thing as last time, Ember (through HTMLBars) will avoid doing any - work on the DOM. - This is not just a performance optimization. If an attribute has not - changed, it is important not to clobber the element's "hidden state". - For example, if you set an input's `value` to the same value as before, - it will clobber selection state and cursor position. In other words, - setting an attribute is not **always** idempotent. - This method provides a way to read an element's attribute and also - update the last value Ember knows about at the same time. This makes - setting an attribute idempotent. - In particular, what this means is that if you get an `` element's - `value` attribute and then re-render the template with the same value, - it will avoid clobbering the cursor and selection position. - Since most attribute sets are idempotent in the browser, you typically - can get away with reading attributes using jQuery, but the most reliable - way to do so is through this method. - @method readDOMAttr - @param {String} name the name of the attribute - @return String - @public - */ -enifed('ember-glimmer/components/checkbox', ['exports', 'ember-metal', 'ember-glimmer/component', 'ember-glimmer/templates/empty'], function (exports, _emberMetal, _emberGlimmerComponent, _emberGlimmerTemplatesEmpty) { - 'use strict'; + /** + Given a parseName object (output from `parseName`), apply + the conventions expected by `Ember.Router` + @param {Object} parsedName a parseName object with the parsed + fullName lookup string + @method useRouterNaming + @protected + */ + useRouterNaming: function (parsedName) { + parsedName.name = parsedName.name.replace(/\./g, '_'); + if (parsedName.name === 'basic') { + parsedName.name = ''; + } + }, + /** + Look up the template in Ember.TEMPLATES + @param {Object} parsedName a parseName object with the parsed + fullName lookup string + @method resolveTemplate + @protected + */ + resolveTemplate: function (parsedName) { + var templateName = parsedName.fullNameWithoutType.replace(/\./g, '/'); + + return _emberGlimmer.getTemplate(templateName) || _emberGlimmer.getTemplate(_emberRuntime.String.decamelize(templateName)); + }, + + /** + Lookup the view using `resolveOther` + @param {Object} parsedName a parseName object with the parsed + fullName lookup string + @method resolveView + @protected + */ + resolveView: function (parsedName) { + this.useRouterNaming(parsedName); + return this.resolveOther(parsedName); + }, + + /** + Lookup the controller using `resolveOther` + @param {Object} parsedName a parseName object with the parsed + fullName lookup string + @method resolveController + @protected + */ + resolveController: function (parsedName) { + this.useRouterNaming(parsedName); + return this.resolveOther(parsedName); + }, + /** + Lookup the route using `resolveOther` + @param {Object} parsedName a parseName object with the parsed + fullName lookup string + @method resolveRoute + @protected + */ + resolveRoute: function (parsedName) { + this.useRouterNaming(parsedName); + return this.resolveOther(parsedName); + }, + + /** + Lookup the model on the Application namespace + @param {Object} parsedName a parseName object with the parsed + fullName lookup string + @method resolveModel + @protected + */ + resolveModel: function (parsedName) { + var className = _emberRuntime.String.classify(parsedName.name); + var factory = _emberMetal.get(parsedName.root, className); + + return factory; + }, + /** + Look up the specified object (from parsedName) on the appropriate + namespace (usually on the Application) + @param {Object} parsedName a parseName object with the parsed + fullName lookup string + @method resolveHelper + @protected + */ + resolveHelper: function (parsedName) { + return this.resolveOther(parsedName); + }, + /** + Look up the specified object (from parsedName) on the appropriate + namespace (usually on the Application) + @param {Object} parsedName a parseName object with the parsed + fullName lookup string + @method resolveOther + @protected + */ + resolveOther: function (parsedName) { + var className = _emberRuntime.String.classify(parsedName.name) + _emberRuntime.String.classify(parsedName.type); + var factory = _emberMetal.get(parsedName.root, className); + return factory; + }, + + resolveMain: function (parsedName) { + var className = _emberRuntime.String.classify(parsedName.type); + return _emberMetal.get(parsedName.root, className); + }, + + /** + @method _logLookup + @param {Boolean} found + @param {Object} parsedName + @private + */ + _logLookup: function (found, parsedName) { + var symbol = undefined, + padding = undefined; + + if (found) { + symbol = '[✓]'; + } else { + symbol = '[ ]'; + } + + if (parsedName.fullName.length > 60) { + padding = '.'; + } else { + padding = new Array(60 - parsedName.fullName.length).join('.'); + } + + _emberMetal.info(symbol, parsedName.fullName, padding, this.lookupDescription(parsedName.fullName)); + }, + + /** + Used to iterate all items of a given type. + @method knownForType + @param {String} type the type to search for + @private + */ + knownForType: function (type) { + var namespace = _emberMetal.get(this, 'namespace'); + var suffix = _emberRuntime.String.classify(type); + var typeRegexp = new RegExp(suffix + '$'); + + var known = _emberUtils.dictionary(null); + var knownKeys = Object.keys(namespace); + for (var index = 0; index < knownKeys.length; index++) { + var _name = knownKeys[index]; + + if (typeRegexp.test(_name)) { + var containerName = this.translateToContainerFullname(type, _name); + + known[containerName] = true; + } + } + + return known; + }, + + /** + Converts provided name from the backing namespace into a container lookup name. + Examples: + App.FooBarHelper -> helper:foo-bar + App.THelper -> helper:t + @method translateToContainerFullname + @param {String} type + @param {String} name + @private + */ + + translateToContainerFullname: function (type, name) { + var suffix = _emberRuntime.String.classify(type); + var namePrefix = name.slice(0, suffix.length * -1); + var dasherizedName = _emberRuntime.String.dasherize(namePrefix); + return type + ':' + dasherizedName; + } + }); +}); +enifed('ember-application/utils/validate-type', ['exports', 'ember-metal'], function (exports, _emberMetal) { /** @module ember - @submodule ember-views + @submodule ember-application */ + 'use strict'; + + exports.default = validateType; + + var VALIDATED_TYPES = { + route: ['assert', 'isRouteFactory', 'Ember.Route'], + component: ['deprecate', 'isComponentFactory', 'Ember.Component'], + view: ['deprecate', 'isViewFactory', 'Ember.View'], + service: ['deprecate', 'isServiceFactory', 'Ember.Service'] + }; + + function validateType(resolvedType, parsedName) { + var validationAttributes = VALIDATED_TYPES[parsedName.type]; + + if (!validationAttributes) { + return; + } + + var action = validationAttributes[0]; + var factoryFlag = validationAttributes[1]; + var expectedType = validationAttributes[2]; + + if (action === 'deprecate') { + _emberMetal.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 { + _emberMetal.assert('Expected ' + parsedName.fullName + ' to resolve to an ' + expectedType + ' but ' + ('instead it was ' + resolvedType + '.'), !!resolvedType[factoryFlag]); + } + } +}); +enifed('ember-console/index', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { + 'use strict'; + + function K() {} + + function consoleMethod(name) { + var consoleObj = undefined; + if (_emberEnvironment.context.imports.console) { + consoleObj = _emberEnvironment.context.imports.console; + } else if (typeof console !== 'undefined') { + consoleObj = console; + } + + var method = typeof consoleObj === 'object' ? consoleObj[name] : null; + + if (typeof method !== 'function') { + return; + } + + if (typeof method.bind === 'function') { + return method.bind(consoleObj); + } + + return function () { + method.apply(consoleObj, arguments); + }; + } + + function assertPolyfill(test, message) { + if (!test) { + try { + // attempt to preserve the stack + throw new Error('assertion failed: ' + message); + } catch (error) { + setTimeout(function () { + throw error; + }, 0); + } + } + } + /** - The internal class used to create text inputs when the `{{input}}` - helper is used with `type` of `checkbox`. - - See [Ember.Templates.helpers.input](/api/classes/Ember.Templates.helpers.html#method_input) for usage details. - - ## Direct manipulation of `checked` - - The `checked` attribute of an `Ember.Checkbox` object should always be set - through the Ember object or by interacting with its rendered element - representation via the mouse, keyboard, or touch. Updating the value of the - checkbox via jQuery will result in the checked value of the object and its - element losing synchronization. - - ## Layout and LayoutName properties - - Because HTML `input` elements are self closing `layout` and `layoutName` - properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s - layout section for more information. + Inside Ember-Metal, simply uses the methods from `imports.console`. + Override this to provide more robust logging functionality. - @class Checkbox + @class Logger @namespace Ember - @extends Ember.Component @public */ - exports.default = _emberGlimmerComponent.default.extend({ - layout: _emberGlimmerTemplatesEmpty.default, - classNames: ['ember-checkbox'], + 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. + ```javascript + var foo = 1; + Ember.Logger.log('log value of foo:', foo); + // "log value of foo: 1" will be printed to the console + ``` + @method log + @for Ember.Logger + @param {*} arguments + @public + */ + log: consoleMethod('log') || K, - tagName: 'input', + /** + Prints the arguments to the console with a warning icon. + You can pass as many arguments as you want and they will be joined together with a space. + ```javascript + Ember.Logger.warn('Something happened!'); + // "Something happened!" will be printed to the console with a warning icon. + ``` + @method warn + @for Ember.Logger + @param {*} arguments + @public + */ + warn: consoleMethod('warn') || K, - attributeBindings: ['type', 'checked', 'indeterminate', 'disabled', 'tabindex', 'name', 'autofocus', 'required', 'form'], + /** + Prints the arguments to the console with an error icon, red text and a stack trace. + You can pass as many arguments as you want and they will be joined together with a space. + ```javascript + Ember.Logger.error('Danger! Danger!'); + // "Danger! Danger!" will be printed to the console in red text. + ``` + @method error + @for Ember.Logger + @param {*} arguments + @public + */ + error: consoleMethod('error') || K, - type: 'checkbox', - checked: false, - disabled: false, - indeterminate: false, + /** + Logs the arguments to the console. + You can pass as many arguments as you want and they will be joined together with a space. + ```javascript + var foo = 1; + Ember.Logger.info('log value of foo:', foo); + // "log value of foo: 1" will be printed to the console + ``` + @method info + @for Ember.Logger + @param {*} arguments + @public + */ + info: consoleMethod('info') || K, - didInsertElement: function () { - this._super.apply(this, arguments); - _emberMetal.get(this, 'element').indeterminate = !!_emberMetal.get(this, 'indeterminate'); - }, + /** + Logs the arguments to the console in blue text. + You can pass as many arguments as you want and they will be joined together with a space. + ```javascript + var foo = 1; + Ember.Logger.debug('log value of foo:', foo); + // "log value of foo: 1" will be printed to the console + ``` + @method debug + @for Ember.Logger + @param {*} arguments + @public + */ + debug: consoleMethod('debug') || consoleMethod('info') || K, - change: function () { - _emberMetal.set(this, 'checked', this.$().prop('checked')); + /** + 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 + }; +}); +enifed('ember-debug/deprecate', ['exports', 'ember-metal', 'ember-console', 'ember-environment', 'ember-debug/handlers'], function (exports, _emberMetal, _emberConsole, _emberEnvironment, _emberDebugHandlers) { + /*global __fail__*/ + + 'use strict'; + + exports.registerHandler = registerHandler; + exports.default = deprecate; + + function registerHandler(handler) { + _emberDebugHandlers.registerHandler('deprecate', handler); + } + + function formatMessage(_message, options) { + var message = _message; + + if (options && options.id) { + message = message + (' [deprecation id: ' + options.id + ']'); + } + + if (options && options.url) { + message += ' See ' + options.url + ' for more details.'; + } + + return message; + } + + registerHandler(function logDeprecationToConsole(message, options) { + var updatedMessage = formatMessage(message, options); + + _emberConsole.default.warn('DEPRECATION: ' + updatedMessage); + }); + + var captureErrorForStack = undefined; + + if (new Error().stack) { + captureErrorForStack = function () { + return new Error(); + }; + } else { + captureErrorForStack = function () { + try { + __fail__.fail(); + } catch (e) { + return e; + } + }; + } + + registerHandler(function logDeprecationStackTrace(message, options, next) { + if (_emberEnvironment.ENV.LOG_STACKTRACE_ON_DEPRECATION) { + var stackStr = ''; + var error = captureErrorForStack(); + var stack = undefined; + + if (error.stack) { + if (error['arguments']) { + // Chrome + stack = error.stack.replace(/^\s+at\s+/gm, '').replace(/^([^\(]+?)([\n$])/gm, '{anonymous}($1)$2').replace(/^Object.\s*\(([^\)]+)\)/gm, '{anonymous}($1)').split('\n'); + stack.shift(); + } else { + // Firefox + stack = error.stack.replace(/(?:\n@:0)?\s+$/m, '').replace(/^\(/gm, '{anonymous}(').split('\n'); + } + + stackStr = '\n ' + stack.slice(2).join('\n '); + } + + var updatedMessage = formatMessage(message, options); + + _emberConsole.default.warn('DEPRECATION: ' + updatedMessage + stackStr); + } else { + next.apply(undefined, arguments); } }); -}); -enifed('ember-glimmer/components/link-to', ['exports', 'ember-console', 'ember-metal', 'ember-runtime', 'ember-views', 'ember-glimmer/templates/link-to', 'ember-glimmer/component'], function (exports, _emberConsole, _emberMetal, _emberRuntime, _emberViews, _emberGlimmerTemplatesLinkTo, _emberGlimmerComponent) { + + registerHandler(function raiseOnDeprecation(message, options, next) { + if (_emberEnvironment.ENV.RAISE_ON_DEPRECATION) { + var updatedMessage = formatMessage(message); + + throw new _emberMetal.Error(updatedMessage); + } else { + next.apply(undefined, arguments); + } + }); + + var missingOptionsDeprecation = 'When calling `Ember.deprecate` you ' + 'must provide an `options` hash as the third parameter. ' + '`options` should include `id` and `until` properties.'; + exports.missingOptionsDeprecation = missingOptionsDeprecation; + var missingOptionsIdDeprecation = 'When calling `Ember.deprecate` you must provide `id` in options.'; + exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation; + var missingOptionsUntilDeprecation = 'When calling `Ember.deprecate` you must provide `until` in options.'; + + exports.missingOptionsUntilDeprecation = missingOptionsUntilDeprecation; /** @module ember - @submodule ember-glimmer + @submodule ember-debug */ /** - The `{{link-to}}` component 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 - element: + Display a deprecation warning with the provided message and a stack trace + (Chrome and Firefox only). - ```handlebars - {{#link-to 'photoGallery'}} - Great Hamster Photos - {{/link-to}} - ``` + * In a production build, this method is defined as an empty function (NOP). + Uses of this method in Ember itself are stripped from the ember.prod.js build. - You can also use an inline form of `{{link-to}}` component by - passing the link text as the first argument - to the component: + @method deprecate + @param {String} message A description of the deprecation. + @param {Boolean} test A boolean. If falsy, the deprecation will be displayed. + @param {Object} options + @param {String} options.id A unique id for this deprecation. The id can be + used by Ember debugging tools to change the behavior (raise, log or silence) + for that specific deprecation. The id should be namespaced by dots, e.g. + "view.helper.select". + @param {string} options.until The version of Ember when this deprecation + warning will be removed. + @param {String} [options.url] An optional url to the transition guide on the + emberjs.com website. + @for Ember + @public + @since 1.0.0 + */ + + function deprecate(message, test, options) { + if (!options || !options.id && !options.until) { + deprecate(missingOptionsDeprecation, false, { + id: 'ember-debug.deprecate-options-missing', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' + }); + } + + if (options && !options.id) { + deprecate(missingOptionsIdDeprecation, false, { + id: 'ember-debug.deprecate-id-missing', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' + }); + } + + if (options && !options.until) { + deprecate(missingOptionsUntilDeprecation, options && options.until, { + id: 'ember-debug.deprecate-until-missing', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' + }); + } + + _emberDebugHandlers.invoke.apply(undefined, ['deprecate'].concat(babelHelpers.slice.call(arguments))); + } +}); +enifed("ember-debug/handlers", ["exports"], function (exports) { + "use strict"; + + exports.registerHandler = registerHandler; + exports.invoke = invoke; + var HANDLERS = {}; + + exports.HANDLERS = HANDLERS; + + function registerHandler(type, callback) { + var nextHandler = HANDLERS[type] || function () {}; + + HANDLERS[type] = function (message, options) { + callback(message, options, nextHandler); + }; + } + + function invoke(type, message, test, options) { + if (test) { + return; + } + + var handlerForType = HANDLERS[type]; + + if (!handlerForType) { + return; + } + + if (handlerForType) { + handlerForType(message, options); + } + } +}); +enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'ember-console', 'ember-debug/deprecate', 'ember-debug/warn'], function (exports, _emberMetal, _emberEnvironment, _emberConsole, _emberDebugDeprecate, _emberDebugWarn) { + 'use strict'; + + exports._warnIfUsingStrippedFeatureFlags = _warnIfUsingStrippedFeatureFlags; + + /** + @module ember + @submodule ember-debug + */ + + /** + @class Ember + @public + */ + + /** + Define an assertion that will throw an exception if the condition is not met. - ```handlebars - {{link-to 'Great Hamster Photos' 'photoGallery'}} - ``` + * In a production build, this method is defined as an empty function (NOP). + Uses of this method in Ember itself are stripped from the ember.prod.js build. - Both will result in: + ```javascript + // Test for truthiness + Ember.assert('Must pass a valid object', obj); - ```html - - Great Hamster Photos - + // Fail unconditionally + Ember.assert('This code path should never be run'); ``` - ### Supplying a tagName - By default `{{link-to}}` renders an `` element. This can - be overridden for a single use of `{{link-to}}` by supplying - a `tagName` option: + @method assert + @param {String} desc A description of the assertion. This will become + the text of the Error thrown if the assertion fails. + @param {Boolean} test Must be truthy for the assertion to pass. If + falsy, an exception will be thrown. + @public + @since 1.0.0 + */ + _emberMetal.setDebugFunction('assert', function assert(desc, test) { + if (!test) { + throw new _emberMetal.Error('Assertion Failed: ' + desc); + } + }); + + /** + Display a debug notice. - ```handlebars - {{#link-to 'photoGallery' tagName="li"}} - Great Hamster Photos - {{/link-to}} - ``` + * In a production build, this method is defined as an empty function (NOP). + Uses of this method in Ember itself are stripped from the ember.prod.js build. - ```html -
  • - Great Hamster Photos -
  • + ```javascript + Ember.debug('I\'m a debug notice!'); ``` - To override this option for your entire application, see - "Overriding Application-wide Defaults". + @method debug + @param {String} message A debug message to display. + @public + */ + _emberMetal.setDebugFunction('debug', function debug(message) { + _emberConsole.default.debug('DEBUG: ' + message); + }); + + /** + Display an info notice. - ### Disabling the `link-to` component - By default `{{link-to}}` is enabled. - any passed value to the `disabled` component property will disable - the `link-to` component. + * In a production build, this method is defined as an empty function (NOP). + Uses of this method in Ember itself are stripped from the ember.prod.js build. - static use: the `disabled` option: + @method info + @private + */ + _emberMetal.setDebugFunction('info', function info() { + _emberConsole.default.info.apply(undefined, arguments); + }); + + /** + Alias an old, deprecated method with its new counterpart. - ```handlebars - {{#link-to 'photoGallery' disabled=true}} - Great Hamster Photos - {{/link-to}} - ``` + Display a deprecation warning with the provided message and a stack trace + (Chrome and Firefox only) when the assigned method is called. - dynamic use: the `disabledWhen` option: + * In a production build, this method is defined as an empty function (NOP). - ```handlebars - {{#link-to 'photoGallery' disabledWhen=controller.someProperty}} - Great Hamster Photos - {{/link-to}} + ```javascript + Ember.oldMethod = Ember.deprecateFunc('Please use the new, updated method', Ember.newMethod); ``` - any passed value to `disabled` will disable it except `undefined`. - to ensure that only `true` disable the `link-to` component you can - override the global behaviour of `Ember.LinkComponent`. + @method deprecateFunc + @param {String} message A description of the deprecation. + @param {Object} [options] The options object for Ember.deprecate. + @param {Function} func The new function called to replace its deprecated counterpart. + @return {Function} A new function that wraps the original function with a deprecation warning + @private + */ + _emberMetal.setDebugFunction('deprecateFunc', function deprecateFunc() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + if (args.length === 3) { + var _ret = (function () { + var message = args[0]; + var options = args[1]; + var func = args[2]; + + return { + v: function () { + _emberMetal.deprecate(message, false, options); + return func.apply(this, arguments); + } + }; + })(); + + if (typeof _ret === 'object') return _ret.v; + } else { + var _ret2 = (function () { + var message = args[0]; + var func = args[1]; + + return { + v: function () { + _emberMetal.deprecate(message); + return func.apply(this, arguments); + } + }; + })(); + + if (typeof _ret2 === 'object') return _ret2.v; + } + }); + + /** + Run a function meant for debugging. + + * In a production build, this method is defined as an empty function (NOP). + Uses of this method in Ember itself are stripped from the ember.prod.js build. ```javascript - Ember.LinkComponent.reopen({ - disabled: Ember.computed(function(key, value) { - if (value !== undefined) { - this.set('_isDisabled', value === true); + Ember.runInDebug(() => { + Ember.Component.reopen({ + didInsertElement() { + console.log("I'm happy"); } - return value === true ? get(this, 'disabledClass') : false; - }) + }); }); ``` - see "Overriding Application-wide Defaults" for more. - - ### Handling `href` - `{{link-to}}` will use your application's Router to - fill the element's `href` property with a url that - matches the path to the supplied `routeName` for your - router's configured `Location` scheme, which defaults - to Ember.HashLocation. - - ### Handling current route - `{{link-to}}` will apply a CSS class name of 'active' - when the application's current route matches - the supplied routeName. For example, if the application's - current route is 'photoGallery.recent' the following - use of `{{link-to}}`: - - ```handlebars - {{#link-to 'photoGallery.recent'}} - Great Hamster Photos - {{/link-to}} - ``` - - will result in - - ```html -
    - Great Hamster Photos - - ``` - - The CSS class name used for active classes can be customized - for a single use of `{{link-to}}` by passing an `activeClass` - option: - - ```handlebars - {{#link-to 'photoGallery.recent' activeClass="current-url"}} - Great Hamster Photos - {{/link-to}} - ``` - - ```html - - Great Hamster Photos - - ``` - - To override this option for your entire application, see - "Overriding Application-wide Defaults". - - ### Keeping a link active for other routes - - If you need a link to be 'active' even when it doesn't match - the current route, you can use the `current-when` argument. - - ```handlebars - {{#link-to 'photoGallery' current-when='photos'}} - Photo Gallery - {{/link-to}} - ``` - - This may be helpful for keeping links active for: - - * non-nested routes that are logically related - * some secondary menu approaches - * 'top navigation' with 'sub navigation' scenarios - - A link will be active if `current-when` is `true` or the current - route is the route this link would transition to. - - To match multiple routes 'space-separate' the routes: + @method runInDebug + @param {Function} func The function to be executed. + @since 1.5.0 + @public + */ + _emberMetal.setDebugFunction('runInDebug', function runInDebug(func) { + func(); + }); + + _emberMetal.setDebugFunction('debugSeal', function debugSeal(obj) { + Object.seal(obj); + }); + + _emberMetal.setDebugFunction('debugFreeze', function debugFreeze(obj) { + Object.freeze(obj); + }); + + _emberMetal.setDebugFunction('deprecate', _emberDebugDeprecate.default); + + _emberMetal.setDebugFunction('warn', _emberDebugWarn.default); + + /** + Will call `Ember.warn()` if ENABLE_OPTIONAL_FEATURES or + any specific FEATURES flag is truthy. - ```handlebars - {{#link-to 'gallery' current-when='photos drawings paintings'}} - Art Gallery - {{/link-to}} - ``` + This method is called automatically in debug canary builds. - ### Supplying a model - An optional model argument can be used for routes whose - paths contain dynamic segments. This argument will become - the model context of the linked route: + @private + @method _warnIfUsingStrippedFeatureFlags + @return {void} + */ + + function _warnIfUsingStrippedFeatureFlags(FEATURES, knownFeatures, featuresWereStripped) { + if (featuresWereStripped) { + _emberMetal.warn('Ember.ENV.ENABLE_OPTIONAL_FEATURES is only available in canary builds.', !_emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES, { id: 'ember-debug.feature-flag-with-features-stripped' }); + + var keys = Object.keys(FEATURES || {}); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (key === 'isEnabled' || !(key in knownFeatures)) { + continue; + } + + _emberMetal.warn('FEATURE["' + key + '"] is set as enabled, but FEATURE flags are only available in canary builds.', !FEATURES[key], { id: 'ember-debug.feature-flag-with-features-stripped' }); + } + } + } + + if (!_emberMetal.isTesting()) { + (function () { + // Complain if they're using FEATURE flags in builds other than canary + _emberMetal.FEATURES['features-stripped-test'] = true; + var featuresWereStripped = true; + + if (_emberMetal.isFeatureEnabled('features-stripped-test')) { + featuresWereStripped = false; + } + + delete _emberMetal.FEATURES['features-stripped-test']; + _warnIfUsingStrippedFeatureFlags(_emberEnvironment.ENV.FEATURES, _emberMetal.DEFAULT_FEATURES, featuresWereStripped); + + // Inform the developer about the Ember Inspector if not installed. + var isFirefox = _emberEnvironment.environment.isFirefox; + var isChrome = _emberEnvironment.environment.isChrome; + + if (typeof window !== 'undefined' && (isFirefox || isChrome) && window.addEventListener) { + window.addEventListener('load', function () { + if (document.documentElement && document.documentElement.dataset && !document.documentElement.dataset.emberExtension) { + var downloadURL = undefined; + + if (isChrome) { + downloadURL = 'https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi'; + } else if (isFirefox) { + downloadURL = 'https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/'; + } + + _emberMetal.debug('For more advanced debugging, install the Ember Inspector from ' + downloadURL); + } + }, false); + } + })(); + } + /** + @public + @class Ember.Debug + */ + _emberMetal.default.Debug = {}; + + /** + Allows for runtime registration of handler functions that override the default deprecation behavior. + Deprecations are invoked by calls to [Ember.deprecate](http://emberjs.com/api/classes/Ember.html#method_deprecate). + The following example demonstrates its usage by registering a handler that throws an error if the + message contains the word "should", otherwise defers to the default handler. ```javascript - Router.map(function() { - this.route("photoGallery", {path: "hamster-photos/:photo_id"}); + Ember.Debug.registerDeprecationHandler((message, options, next) => { + if (message.indexOf('should') !== -1) { + throw new Error(`Deprecation message with should: ${message}`); + } else { + // defer to whatever handler was registered before this one + next(message, options); + } }); ``` - ```handlebars - {{#link-to 'photoGallery' aPhoto}} - {{aPhoto.title}} - {{/link-to}} - ``` + The handler function takes the following arguments: - ```html - - Tomster - - ``` +
      +
    • message - The message received from the deprecation call.
    • +
    • options - An object passed in with the deprecation call containing additional information including:
    • +
        +
      • id - An id of the deprecation in the form of package-name.specific-deprecation.
      • +
      • until - The Ember version number the feature and deprecation will be removed in.
      • +
      +
    • next - A function that calls into the previously registered handler.
    • +
    - ### Supplying multiple models - For deep-linking to route paths that contain multiple - dynamic segments, multiple model arguments can be used. - As the router transitions through the route path, each - supplied model argument will become the context for the - route with the dynamic segments: + @public + @static + @method registerDeprecationHandler + @param handler {Function} A function to handle deprecation calls. + @since 2.1.0 + */ + _emberMetal.default.Debug.registerDeprecationHandler = _emberDebugDeprecate.registerHandler; + /** + Allows for runtime registration of handler functions that override the default warning behavior. + Warnings are invoked by calls made to [Ember.warn](http://emberjs.com/api/classes/Ember.html#method_warn). + The following example demonstrates its usage by registering a handler that does nothing overriding Ember's + default warning behavior. ```javascript - Router.map(function() { - this.route("photoGallery", { path: "hamster-photos/:photo_id" }, function() { - this.route("comment", {path: "comments/:comment_id"}); - }); - }); + // next is not called, so no warnings get the default behavior + Ember.Debug.registerWarnHandler(() => {}); ``` - This argument will become the model context of the linked route: - ```handlebars - {{#link-to 'photoGallery.comment' aPhoto comment}} - {{comment.body}} - {{/link-to}} - ``` + The handler function takes the following arguments: - ```html - - A+++ would snuggle again. - - ``` +
      +
    • message - The message received from the warn call.
    • +
    • options - An object passed in with the warn call containing additional information including:
    • +
        +
      • id - An id of the warning in the form of package-name.specific-warning.
      • +
      +
    • next - A function that calls into the previously registered handler.
    • +
    - ### Supplying an explicit dynamic segment value - If you don't have a model object available to pass to `{{link-to}}`, - an optional string or integer argument can be passed for routes whose - paths contain dynamic segments. This argument will become the value - of the dynamic segment: - - ```javascript - Router.map(function() { - this.route("photoGallery", { path: "hamster-photos/:photo_id" }); - }); - ``` - - ```handlebars - {{#link-to 'photoGallery' aPhotoId}} - {{aPhoto.title}} - {{/link-to}} - ``` - - ```html - - Tomster - - ``` - - When transitioning into the linked route, the `model` hook will - be triggered with parameters including this passed identifier. - - ### Allowing Default Action - - By default the `{{link-to}}` component prevents the default browser action - by calling `preventDefault()` as this sort of action bubbling is normally - handled internally and we do not want to take the browser to a new URL (for - example). - - If you need to override this behavior specify `preventDefault=false` in - your template: + @public + @static + @method registerWarnHandler + @param handler {Function} A function to handle warnings. + @since 2.1.0 + */ + _emberMetal.default.Debug.registerWarnHandler = _emberDebugWarn.registerHandler; + + /* + We are transitioning away from `ember.js` to `ember.debug.js` to make + it much clearer that it is only for local development purposes. - ```handlebars - {{#link-to 'photoGallery' aPhotoId preventDefault=false}} - {{aPhotoId.title}} - {{/link-to}} - ``` + This flag value is changed by the tooling (by a simple string replacement) + so that if `ember.js` (which must be output for backwards compat reasons) is + used a nice helpful warning message will be printed out. + */ + var runningNonEmberDebugJS = false; + exports.runningNonEmberDebugJS = runningNonEmberDebugJS; + if (runningNonEmberDebugJS) { + _emberMetal.warn('Please use `ember.debug.js` instead of `ember.js` for development and debugging.'); + } +}); +// reexports +enifed('ember-debug/warn', ['exports', 'ember-console', 'ember-metal', 'ember-debug/handlers'], function (exports, _emberConsole, _emberMetal, _emberDebugHandlers) { + 'use strict'; + + exports.registerHandler = registerHandler; + exports.default = warn; + + function registerHandler(handler) { + _emberDebugHandlers.registerHandler('warn', handler); + } + + registerHandler(function logWarning(message, options) { + _emberConsole.default.warn('WARNING: ' + message); + if ('trace' in _emberConsole.default) { + _emberConsole.default.trace(); + } + }); + + var missingOptionsDeprecation = 'When calling `Ember.warn` you ' + 'must provide an `options` hash as the third parameter. ' + '`options` should include an `id` property.'; + exports.missingOptionsDeprecation = missingOptionsDeprecation; + var missingOptionsIdDeprecation = 'When calling `Ember.warn` you must provide `id` in options.'; + + exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation; + /** + @module ember + @submodule ember-debug + */ + + /** + Display a warning with the provided message. - ### Overriding attributes - You can override any given property of the `Ember.LinkComponent` - that is generated by the `{{link-to}}` component by passing - key/value pairs, like so: + * In a production build, this method is defined as an empty function (NOP). + Uses of this method in Ember itself are stripped from the ember.prod.js build. - ```handlebars - {{#link-to aPhoto tagName='li' title='Following this link will change your life' classNames='pic sweet'}} - Uh-mazing! - {{/link-to}} - ``` + @method warn + @param {String} message A warning to display. + @param {Boolean} test An optional boolean. If falsy, the warning + will be displayed. + @param {Object} options An object that can be used to pass a unique + `id` for this warning. The `id` can be used by Ember debugging tools + to change the behavior (raise, log, or silence) for that specific warning. + The `id` should be namespaced by dots, e.g. "ember-debug.feature-flag-with-features-stripped" + @for Ember + @public + @since 1.0.0 + */ + + function warn(message, test, options) { + if (!options) { + _emberMetal.deprecate(missingOptionsDeprecation, false, { + id: 'ember-debug.warn-options-missing', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' + }); + } + + if (options && !options.id) { + _emberMetal.deprecate(missingOptionsIdDeprecation, false, { + id: 'ember-debug.warn-id-missing', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' + }); + } + + _emberDebugHandlers.invoke.apply(undefined, ['warn'].concat(babelHelpers.slice.call(arguments))); + } +}); +enifed('ember-environment/global', ['exports'], function (exports) { + /* globals global, window, self, mainContext */ + + // from lodash to catch fake globals + 'use strict'; + + function checkGlobal(value) { + return value && value.Object === Object ? value : undefined; + } + + // element ids can ruin global miss checks + function checkElementIdShadowing(value) { + return value && value.nodeType === undefined ? value : undefined; + } + + // export real global + exports.default = checkGlobal(checkElementIdShadowing(typeof global === 'object' && global)) || checkGlobal(typeof self === 'object' && self) || checkGlobal(typeof window === 'object' && window) || mainContext || // set before strict mode in Ember loader/wrapper + new Function('return this')(); + // eval outside of strict mode +}); +enifed('ember-environment/index', ['exports', 'ember-environment/global', 'ember-environment/utils'], function (exports, _emberEnvironmentGlobal, _emberEnvironmentUtils) { + /* globals module */ + 'use strict'; + + /** + 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 + backwards compatibility with earlier versions of Ember). The `EmberENV` + hash must be created before loading Ember. - See [Ember.LinkComponent](/api/classes/Ember.LinkComponent.html) for a - complete list of overrideable properties. Be sure to also - check out inherited properties of `LinkComponent`. + @class EmberENV + @type Object + @public + */ + var ENV = typeof _emberEnvironmentGlobal.default.EmberENV === 'object' && _emberEnvironmentGlobal.default.EmberENV || typeof _emberEnvironmentGlobal.default.ENV === 'object' && _emberEnvironmentGlobal.default.ENV || {}; + + exports.ENV = ENV; + // ENABLE_ALL_FEATURES was documented, but you can't actually enable non optional features. + if (ENV.ENABLE_ALL_FEATURES) { + ENV.ENABLE_OPTIONAL_FEATURES = true; + } + + /** + Determines whether Ember should add to `Array`, `Function`, and `String` + native object prototypes, a few extra methods in order to provide a more + friendly API. - ### Overriding Application-wide Defaults - ``{{link-to}}`` creates an instance of `Ember.LinkComponent` - for rendering. To override options for your entire - application, reopen `Ember.LinkComponent` and supply the - desired values: + We generally recommend leaving this option set to true however, if you need + to turn it off, you can add the configuration property + `EXTEND_PROTOTYPES` to `EmberENV` and set it to `false`. - ``` javascript - Ember.LinkComponent.reopen({ - activeClass: "is-active", - tagName: 'li' - }) - ``` + Note, when disabled (the default configuration for Ember Addons), you will + instead have to access all methods and functions from the Ember + namespace. - It is also possible to override the default event in - this manner: + @property EXTEND_PROTOTYPES + @type Boolean + @default true + @for EmberENV + @public + */ + ENV.EXTEND_PROTOTYPES = _emberEnvironmentUtils.normalizeExtendPrototypes(ENV.EXTEND_PROTOTYPES); + + /** + The `LOG_STACKTRACE_ON_DEPRECATION` property, when true, tells Ember to log + a full stack trace during deprecation warnings. - ``` javascript - Ember.LinkComponent.reopen({ - eventName: 'customEventName' - }); - ``` + @property LOG_STACKTRACE_ON_DEPRECATION + @type Boolean + @default true + @for EmberENV + @public + */ + ENV.LOG_STACKTRACE_ON_DEPRECATION = _emberEnvironmentUtils.defaultTrue(ENV.LOG_STACKTRACE_ON_DEPRECATION); + + /** + The `LOG_VERSION` property, when true, tells Ember to log versions of all + dependent libraries in use. - @method link-to - @for Ember.Templates.helpers - @param {String} routeName - @param {Object} [context]* - @param [options] {Object} Handlebars key/value pairs of options, you can override any property of Ember.LinkComponent - @return {String} HTML string - @see {Ember.LinkComponent} + @property LOG_VERSION + @type Boolean + @default true + @for EmberENV @public */ + ENV.LOG_VERSION = _emberEnvironmentUtils.defaultTrue(ENV.LOG_VERSION); - 'use strict'; + // default false + ENV.MODEL_FACTORY_INJECTIONS = _emberEnvironmentUtils.defaultFalse(ENV.MODEL_FACTORY_INJECTIONS); /** - `Ember.LinkComponent` renders an element whose `click` event triggers a - transition of the application's instance of `Ember.Router` to - a supplied route by name. - - `Ember.LinkComponent` components are invoked with {{#link-to}}. Properties - of this class can be overridden with `reopen` to customize application-wide - behavior. + Debug parameter you can turn on. This will log all bindings that fire to + the console. This should be disabled in production code. Note that you + can also enable this from the console or temporarily. - @class LinkComponent - @namespace Ember - @extends Ember.Component - @see {Ember.Templates.helpers.link-to} - @private - **/ - var LinkComponent = _emberGlimmerComponent.default.extend({ - layout: _emberGlimmerTemplatesLinkTo.default, - - tagName: 'a', + @property LOG_BINDINGS + @for EmberENV + @type Boolean + @default false + @public + */ + ENV.LOG_BINDINGS = _emberEnvironmentUtils.defaultFalse(ENV.LOG_BINDINGS); - /** - @deprecated Use current-when instead. - @property currentWhen - @private - */ - currentWhen: _emberRuntime.deprecatingAlias('current-when', { id: 'ember-routing-view.deprecated-current-when', until: '3.0.0' }), + ENV.RAISE_ON_DEPRECATION = _emberEnvironmentUtils.defaultFalse(ENV.RAISE_ON_DEPRECATION); - /** - Used to determine when this `LinkComponent` is active. - @property currentWhen - @public - */ - 'current-when': null, + // check if window exists and actually is the global + var hasDOM = typeof window !== 'undefined' && window === _emberEnvironmentGlobal.default && window.document && window.document.createElement && !ENV.disableBrowserEnvironment; // is this a public thing? - /** - Sets the `title` attribute of the `LinkComponent`'s HTML element. - @property title - @default null - @public - **/ - title: null, + // legacy imports/exports/lookup stuff (should we keep this??) + var originalContext = _emberEnvironmentGlobal.default.Ember || {}; - /** - Sets the `rel` attribute of the `LinkComponent`'s HTML element. - @property rel - @default null - @public - **/ - rel: null, + var context = { + // import jQuery + imports: originalContext.imports || _emberEnvironmentGlobal.default, + // export Ember + exports: originalContext.exports || _emberEnvironmentGlobal.default, + // search for Namespaces + lookup: originalContext.lookup || _emberEnvironmentGlobal.default + }; - /** - Sets the `tabindex` attribute of the `LinkComponent`'s HTML element. - @property tabindex - @default null - @public - **/ - tabindex: null, + exports.context = context; + // TODO: cleanup single source of truth issues with this stuff + var environment = hasDOM ? { + hasDOM: true, + isChrome: !!window.chrome && !window.opera, + isFirefox: typeof InstallTrigger !== 'undefined', + isPhantom: !!window.callPhantom, + location: window.location, + history: window.history, + userAgent: window.navigator.userAgent, + window: window + } : { + hasDOM: false, + isChrome: false, + isFirefox: false, + isPhantom: false, + location: null, + history: null, + userAgent: 'Lynx (textmode)', + window: null + }; + exports.environment = environment; +}); +enifed("ember-environment/utils", ["exports"], function (exports) { + "use strict"; - /** - Sets the `target` attribute of the `LinkComponent`'s HTML element. - @since 1.8.0 - @property target - @default null - @public - **/ - target: null, + exports.defaultTrue = defaultTrue; + exports.defaultFalse = defaultFalse; + exports.normalizeExtendPrototypes = normalizeExtendPrototypes; - /** - The CSS class to apply to `LinkComponent`'s element when its `active` - property is `true`. - @property activeClass - @type String - @default active - @public - **/ - activeClass: 'active', + function defaultTrue(v) { + return v === false ? false : true; + } - /** - The CSS class to apply to `LinkComponent`'s element when its `loading` - property is `true`. - @property loadingClass - @type String - @default loading - @private - **/ - loadingClass: 'loading', + function defaultFalse(v) { + return v === true ? true : false; + } - /** - The CSS class to apply to a `LinkComponent`'s element when its `disabled` - property is `true`. - @property disabledClass - @type String - @default disabled - @private - **/ - disabledClass: 'disabled', - _isDisabled: false, + function normalizeExtendPrototypes(obj) { + if (obj === false) { + return { String: false, Array: false, Function: false }; + } else if (!obj || obj === true) { + return { String: true, Array: true, Function: true }; + } else { + return { + String: defaultTrue(obj.String), + Array: defaultTrue(obj.Array), + Function: defaultTrue(obj.Function) + }; + } + } +}); +enifed('ember-extension-support/container_debug_adapter', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { + 'use strict'; - /** - Determines whether the `LinkComponent` will trigger routing via - the `replaceWith` routing strategy. - @property replace - @type Boolean - @default false - @public - **/ - replace: false, + /** + @module ember + @submodule ember-extension-support + */ + /** + The `ContainerDebugAdapter` helps the container and resolver interface + with tools that debug Ember such as the + [Ember Extension](https://github.com/tildeio/ember-extension) + for Chrome and Firefox. + + This class can be extended by a custom resolver implementer + to override some of the methods with library-specific code. + + The methods likely to be overridden are: + + * `canCatalogEntriesByType` + * `catalogEntriesByType` + + The adapter will need to be registered + in the application's container as `container-debug-adapter:main`. + + Example: + + ```javascript + Application.initializer({ + name: "containerDebugAdapter", + + initialize(application) { + application.register('container-debug-adapter:main', require('app/container-debug-adapter')); + } + }); + ``` + + @class ContainerDebugAdapter + @namespace Ember + @extends Ember.Object + @since 1.5.0 + @public + */ + exports.default = _emberRuntime.Object.extend({ /** - By default the `{{link-to}}` component 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'] + The resolver instance of the application + being debugged. This property will be injected + on creation. + @property resolver + @default null @public */ - attributeBindings: ['href', 'title', 'rel', 'tabindex', 'target'], + resolver: null, /** - By default the `{{link-to}}` component will bind to the `active`, `loading`, - and `disabled` classes. It is discouraged to override these directly. - @property classNameBindings - @type Array - @default ['active', 'loading', 'disabled', 'ember-transitioning-in', 'ember-transitioning-out'] + Returns true if it is possible to catalog a list of available + classes in the resolver for a given type. + @method canCatalogEntriesByType + @param {String} type The type. e.g. "model", "controller", "route". + @return {boolean} whether a list is available for this type. @public */ - classNameBindings: ['active', 'loading', 'disabled', 'transitioningIn', 'transitioningOut'], + canCatalogEntriesByType: function (type) { + if (type === 'model' || type === 'template') { + return false; + } - /** - By default the `{{link-to}}` component responds to the `click` event. You - can override this globally by setting this property to your custom - event name. - This is particularly useful on mobile when one wants to avoid the 300ms - click delay using some sort of custom `tap` event. - @property eventName - @type String - @default click - @private - */ - eventName: 'click', + return true; + }, - // this is doc'ed here so it shows up in the events - // section of the API documentation, which is where - // people will likely go looking for it. /** - Triggers the `LinkComponent`'s routing behavior. If - `eventName` is changed to a value other than `click` - the routing behavior will trigger on that custom event - instead. - @event click - @private + Returns the available classes a given type. + @method catalogEntriesByType + @param {String} type The type. e.g. "model", "controller", "route". + @return {Array} An array of strings. + @public */ + catalogEntriesByType: function (type) { + var namespaces = _emberRuntime.A(_emberRuntime.Namespace.NAMESPACES); + var types = _emberRuntime.A(); + var typeSuffixRegex = new RegExp(_emberRuntime.String.classify(type) + '$'); - /** - An overridable method called when `LinkComponent` objects are instantiated. - Example: - ```javascript - App.MyLinkComponent = Ember.LinkComponent.extend({ - init: function() { - this._super(...arguments); - Ember.Logger.log('Event is ' + this.get('eventName')); + namespaces.forEach(function (namespace) { + if (namespace !== _emberMetal.default) { + for (var key in namespace) { + if (!namespace.hasOwnProperty(key)) { + continue; + } + if (typeSuffixRegex.test(key)) { + var klass = namespace[key]; + if (_emberRuntime.typeOf(klass) === 'class') { + types.push(_emberRuntime.String.dasherize(key.replace(typeSuffixRegex, ''))); + } + } + } } }); - ``` - NOTE: If you do override `init` for a framework class like `Ember.View`, - be sure to call `this._super(...arguments)` in your - `init` declaration! If you don't, Ember may not have an opportunity to - do important setup work, and you'll see strange behavior in your - application. - @method init - @private - */ + return types; + } + }); +}); +// Ember as namespace +enifed('ember-extension-support/data_adapter', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'container', 'ember-application'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _container, _emberApplication) { + 'use strict'; + + /** + @module ember + @submodule ember-extension-support + */ + + /** + The `DataAdapter` helps a data persistence library + interface with tools that debug Ember such + as the [Ember Extension](https://github.com/tildeio/ember-extension) + for Chrome and Firefox. + + This class will be extended by a persistence library + which will override some of the methods with + library-specific code. + + The methods likely to be overridden are: + + * `getFilters` + * `detect` + * `columnsForType` + * `getRecords` + * `getRecordColumnValues` + * `getRecordKeywords` + * `getRecordFilterValues` + * `getRecordColor` + * `observeRecord` + + The adapter will need to be registered + in the application's container as `dataAdapter:main`. + + Example: + + ```javascript + Application.initializer({ + name: "data-adapter", + + initialize: function(application) { + application.register('data-adapter:main', DS.DataAdapter); + } + }); + ``` + + @class DataAdapter + @namespace Ember + @extends EmberObject + @public + */ + exports.default = _emberRuntime.Object.extend({ init: function () { this._super.apply(this, arguments); - - // Map desired event name to invoke function - var eventName = _emberMetal.get(this, 'eventName'); - this.on(eventName, this, this._invoke); + this.releaseMethods = _emberRuntime.A(); }, - _routing: _emberRuntime.inject.service('-routing'), + /** + The container-debug-adapter which is used + to list all models. + @property containerDebugAdapter + @default undefined + @since 1.5.0 + @public + **/ + containerDebugAdapter: undefined, /** - Accessed as a classname binding to apply the `LinkComponent`'s `disabledClass` - CSS `class` to the element when the link is disabled. - When `true` interactions with the element will not trigger route changes. - @property disabled - @private + The number of attributes to send + as columns. (Enough to make the record + identifiable). + @private + @property attributeLimit + @default 3 + @since 1.3.0 */ - disabled: _emberMetal.computed({ - get: function (key, value) { - return false; - }, - set: function (key, value) { - if (value !== undefined) { - this.set('_isDisabled', value); - } + attributeLimit: 3, - return value ? _emberMetal.get(this, 'disabledClass') : false; - } - }), + /** + Ember Data > v1.0.0-beta.18 + requires string model names to be passed + around instead of the actual factories. + This is a stamp for the Ember Inspector + to differentiate between the versions + to be able to support older versions too. + @public + @property acceptsModelName + */ + acceptsModelName: true, - _computeActive: function (routerState) { - if (_emberMetal.get(this, 'loading')) { - return false; - } + /** + Stores all methods that clear observers. + These methods will be called on destruction. + @private + @property releaseMethods + @since 1.3.0 + */ + releaseMethods: _emberRuntime.A(), - var routing = _emberMetal.get(this, '_routing'); - var models = _emberMetal.get(this, 'models'); - var resolvedQueryParams = _emberMetal.get(this, 'resolvedQueryParams'); + /** + Specifies how records can be filtered. + Records returned will need to have a `filterValues` + property with a key for every name in the returned array. + @public + @method getFilters + @return {Array} List of objects defining filters. + The object should have a `name` and `desc` property. + */ + getFilters: function () { + return _emberRuntime.A(); + }, - var currentWhen = _emberMetal.get(this, 'current-when'); - var isCurrentWhenSpecified = !!currentWhen; - currentWhen = currentWhen || _emberMetal.get(this, 'qualifiedRouteName'); - currentWhen = currentWhen.split(' '); + /** + Fetch the model types and observe them for changes. + @public + @method watchModelTypes + @param {Function} typesAdded Callback to call to add types. + Takes an array of objects containing wrapped types (returned from `wrapModelType`). + @param {Function} typesUpdated Callback to call when a type has changed. + Takes an array of objects containing wrapped types. + @return {Function} Method to call to remove all observers + */ + watchModelTypes: function (typesAdded, typesUpdated) { + var _this = this; - for (var i = 0; i < currentWhen.length; i++) { - if (routing.isActiveForRoute(models, resolvedQueryParams, currentWhen[i], routerState, isCurrentWhenSpecified)) { - return _emberMetal.get(this, 'activeClass'); - } - } + var modelTypes = this.getModelTypes(); + var releaseMethods = _emberRuntime.A(); + var typesToSend = undefined; - return false; + typesToSend = modelTypes.map(function (type) { + var klass = type.klass; + var wrapped = _this.wrapModelType(klass, type.name); + releaseMethods.push(_this.observeModelType(type.name, typesUpdated)); + return wrapped; + }); + + typesAdded(typesToSend); + + var release = function () { + releaseMethods.forEach(function (fn) { + return fn(); + }); + _this.releaseMethods.removeObject(release); + }; + this.releaseMethods.pushObject(release); + return release; + }, + + _nameToClass: function (type) { + if (typeof type === 'string') { + var owner = _emberUtils.getOwner(this); + type = owner[_container.FACTORY_FOR]('model:' + type).class; + } + return type; }, /** - Accessed as a classname binding to apply the `LinkComponent`'s `activeClass` - CSS `class` to the element when the link is active. - A `LinkComponent` is considered active when its `currentWhen` property is `true` - or the application's current route is the route the `LinkComponent` would trigger - transitions into. - The `currentWhen` property can match against multiple routes by separating - route names using the ` ` (space) character. - @property active - @private + Fetch the records of a given type and observe them for changes. + @public + @method watchRecords + @param {String} modelName The model name. + @param {Function} recordsAdded Callback to call to add records. + Takes an array of objects containing wrapped records. + The object should have the following properties: + columnValues: {Object} The key and value of a table cell. + object: {Object} The actual record object. + @param {Function} recordsUpdated Callback to call when a record has changed. + Takes an array of objects containing wrapped records. + @param {Function} recordsRemoved Callback to call when a record has removed. + Takes the following parameters: + index: The array index where the records were removed. + count: The number of records removed. + @return {Function} Method to call to remove all observers. */ - active: _emberMetal.computed('attrs.params', '_routing.currentState', function computeLinkToComponentActive() { - var currentState = _emberMetal.get(this, '_routing.currentState'); - if (!currentState) { - return false; - } + watchRecords: function (modelName, recordsAdded, recordsUpdated, recordsRemoved) { + var _this2 = this; - return this._computeActive(currentState); - }), + var releaseMethods = _emberRuntime.A(); + var klass = this._nameToClass(modelName); + var records = this.getRecords(klass, modelName); + var release = undefined; - willBeActive: _emberMetal.computed('_routing.targetState', function computeLinkToComponentWillBeActive() { - var routing = _emberMetal.get(this, '_routing'); - var targetState = _emberMetal.get(routing, 'targetState'); - if (_emberMetal.get(routing, 'currentState') === targetState) { - return; + function recordUpdated(updatedRecord) { + recordsUpdated([updatedRecord]); } - return !!this._computeActive(targetState); - }), + var recordsToSend = records.map(function (record) { + releaseMethods.push(_this2.observeRecord(record, recordUpdated)); + return _this2.wrapRecord(record); + }); - transitioningIn: _emberMetal.computed('active', 'willBeActive', function computeLinkToComponentTransitioningIn() { - var willBeActive = _emberMetal.get(this, 'willBeActive'); - if (typeof willBeActive === 'undefined') { - return false; - } + var contentDidChange = function (array, idx, removedCount, addedCount) { + for (var i = idx; i < idx + addedCount; i++) { + var record = _emberRuntime.objectAt(array, i); + var wrapped = _this2.wrapRecord(record); + releaseMethods.push(_this2.observeRecord(record, recordUpdated)); + recordsAdded([wrapped]); + } - return !_emberMetal.get(this, 'active') && willBeActive && 'ember-transitioning-in'; - }), + if (removedCount) { + recordsRemoved(idx, removedCount); + } + }; - transitioningOut: _emberMetal.computed('active', 'willBeActive', function computeLinkToComponentTransitioningOut() { - var willBeActive = _emberMetal.get(this, 'willBeActive'); - if (typeof willBeActive === 'undefined') { - return false; - } + var observer = { didChange: contentDidChange, willChange: function () { + return this; + } }; + _emberRuntime.addArrayObserver(records, this, observer); - return _emberMetal.get(this, 'active') && !willBeActive && 'ember-transitioning-out'; - }), + release = function () { + releaseMethods.forEach(function (fn) { + return fn(); + }); + _emberRuntime.removeArrayObserver(records, _this2, observer); + _this2.releaseMethods.removeObject(release); + }; + + recordsAdded(recordsToSend); + + this.releaseMethods.pushObject(release); + return release; + }, /** - Event handler that invokes the link, activating the associated route. - @method _invoke - @param {Event} event + Clear all observers before destruction @private + @method willDestroy */ - _invoke: function (event) { - if (!_emberViews.isSimpleClick(event)) { - return true; - } + willDestroy: function () { + this._super.apply(this, arguments); + this.releaseMethods.forEach(function (fn) { + return fn(); + }); + }, - var preventDefault = _emberMetal.get(this, 'preventDefault'); - var targetAttribute = _emberMetal.get(this, 'target'); + /** + Detect whether a class is a model. + Test that against the model class + of your persistence library. + @private + @method detect + @param {Class} klass The class to test. + @return boolean Whether the class is a model class or not. + */ + detect: function (klass) { + return false; + }, - if (preventDefault !== false) { - if (!targetAttribute || targetAttribute === '_self') { - event.preventDefault(); - } - } + /** + Get the columns for a given model type. + @private + @method columnsForType + @param {Class} type The model type. + @return {Array} An array of columns of the following format: + name: {String} The name of the column. + desc: {String} Humanized description (what would show in a table column name). + */ + columnsForType: function (type) { + return _emberRuntime.A(); + }, - if (_emberMetal.get(this, 'bubbles') === false) { - event.stopPropagation(); - } + /** + Adds observers to a model type class. + @private + @method observeModelType + @param {String} modelName The model type name. + @param {Function} typesUpdated Called when a type is modified. + @return {Function} The function to call to remove observers. + */ - if (_emberMetal.get(this, '_isDisabled')) { - return false; - } + observeModelType: function (modelName, typesUpdated) { + var _this3 = this; - if (_emberMetal.get(this, 'loading')) { - _emberConsole.default.warn('This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid.'); - return false; - } + var klass = this._nameToClass(modelName); + var records = this.getRecords(klass, modelName); - if (targetAttribute && targetAttribute !== '_self') { - return false; + function onChange() { + typesUpdated([this.wrapModelType(klass, modelName)]); } - var qualifiedRouteName = _emberMetal.get(this, 'qualifiedRouteName'); - var models = _emberMetal.get(this, 'models'); - var queryParams = _emberMetal.get(this, 'queryParams.values'); - var shouldReplace = _emberMetal.get(this, 'replace'); + var observer = { + didChange: function () { + _emberMetal.run.scheduleOnce('actions', this, onChange); + }, + willChange: function () { + return this; + } + }; - var payload = { - queryParams: queryParams, - routeName: qualifiedRouteName + _emberRuntime.addArrayObserver(records, this, observer); + + var release = function () { + return _emberRuntime.removeArrayObserver(records, _this3, observer); }; - _emberMetal.flaggedInstrument('interaction.link-to', payload, this._generateTransition(payload, qualifiedRouteName, models, queryParams, shouldReplace)); + return release; }, - _generateTransition: function (payload, qualifiedRouteName, models, queryParams, shouldReplace) { - var routing = _emberMetal.get(this, '_routing'); - return function () { - payload.transition = routing.transitionTo(qualifiedRouteName, models, queryParams, shouldReplace); + /** + Wraps a given model type and observes changes to it. + @private + @method wrapModelType + @param {Class} klass A model class. + @param {String} modelName Name of the class. + @return {Object} Contains the wrapped type and the function to remove observers + Format: + type: {Object} The wrapped type. + The wrapped type has the following format: + name: {String} The name of the type. + count: {Integer} The number of records available. + columns: {Columns} An array of columns to describe the record. + object: {Class} The actual Model type class. + release: {Function} The function to remove observers. + */ + wrapModelType: function (klass, name) { + var records = this.getRecords(klass, name); + var typeToSend = undefined; + + typeToSend = { + name: name, + count: _emberMetal.get(records, 'length'), + columns: this.columnsForType(klass), + object: klass }; - }, - queryParams: null, + return typeToSend; + }, - qualifiedRouteName: _emberMetal.computed('targetRouteName', '_routing.currentState', function computeLinkToComponentQualifiedRouteName() { - var params = _emberMetal.get(this, 'params').slice(); - var lastParam = params[params.length - 1]; - if (lastParam && lastParam.isQueryParams) { - params.pop(); - } - var onlyQueryParamsSupplied = this[_emberGlimmerComponent.HAS_BLOCK] ? params.length === 0 : params.length === 1; - if (onlyQueryParamsSupplied) { - return _emberMetal.get(this, '_routing.currentRouteName'); - } - return _emberMetal.get(this, 'targetRouteName'); - }), + /** + Fetches all models defined in the application. + @private + @method getModelTypes + @return {Array} Array of model types. + */ + getModelTypes: function () { + var _this4 = this; - resolvedQueryParams: _emberMetal.computed('queryParams', function computeLinkToComponentResolvedQueryParams() { - var resolvedQueryParams = {}; - var queryParams = _emberMetal.get(this, 'queryParams'); + var containerDebugAdapter = this.get('containerDebugAdapter'); + var types = undefined; - if (!queryParams) { - return resolvedQueryParams; + if (containerDebugAdapter.canCatalogEntriesByType('model')) { + types = containerDebugAdapter.catalogEntriesByType('model'); + } else { + types = this._getObjectsOnNamespaces(); } - var values = queryParams.values; - for (var key in values) { - if (!values.hasOwnProperty(key)) { - continue; - } - resolvedQueryParams[key] = values[key]; - } + // New adapters return strings instead of classes. + types = _emberRuntime.A(types).map(function (name) { + return { + klass: _this4._nameToClass(name), + name: name + }; + }); + types = _emberRuntime.A(types).filter(function (type) { + return _this4.detect(type.klass); + }); - return resolvedQueryParams; - }), + return _emberRuntime.A(types); + }, /** - Sets the element's `href` attribute to the url for - the `LinkComponent`'s targeted route. - If the `LinkComponent`'s `tagName` is changed to a value other - than `a`, this property will be ignored. - @property href - @private + Loops over all namespaces and all objects + attached to them. + @private + @method _getObjectsOnNamespaces + @return {Array} Array of model type strings. */ - href: _emberMetal.computed('models', 'qualifiedRouteName', function computeLinkToComponentHref() { - if (_emberMetal.get(this, 'tagName') !== 'a') { - return; - } - - var qualifiedRouteName = _emberMetal.get(this, 'qualifiedRouteName'); - var models = _emberMetal.get(this, 'models'); - - if (_emberMetal.get(this, 'loading')) { - return _emberMetal.get(this, 'loadingHref'); - } + _getObjectsOnNamespaces: function () { + var _this5 = this; - var routing = _emberMetal.get(this, '_routing'); - var queryParams = _emberMetal.get(this, 'queryParams.values'); + var namespaces = _emberRuntime.A(_emberRuntime.Namespace.NAMESPACES); + var types = _emberRuntime.A(); - _emberMetal.runInDebug(function () { - /* - * Unfortunately, to get decent error messages, we need to do this. - * In some future state we should be able to use a "feature flag" - * which allows us to strip this without needing to call it twice. - * - * if (isDebugBuild()) { - * // Do the useful debug thing, probably including try/catch. - * } else { - * // Do the performant thing. - * } - */ - try { - routing.generateURL(qualifiedRouteName, models, queryParams); - } catch (e) { - _emberMetal.assert('You attempted to define a `{{link-to "' + qualifiedRouteName + '"}}` but did not pass the parameters required for generating its dynamic segments. ' + e.message); + namespaces.forEach(function (namespace) { + for (var key in namespace) { + if (!namespace.hasOwnProperty(key)) { + continue; + } + // Even though we will filter again in `getModelTypes`, + // we should not call `lookupFactory` on non-models + // (especially when `EmberENV.MODEL_FACTORY_INJECTIONS` is `true`) + if (!_this5.detect(namespace[key])) { + continue; + } + var _name = _emberRuntime.String.dasherize(key); + if (!(namespace instanceof _emberApplication.Application) && namespace.toString()) { + _name = namespace + '/' + _name; + } + types.push(_name); } }); - - return routing.generateURL(qualifiedRouteName, models, queryParams); - }), - - loading: _emberMetal.computed('_modelsAreLoaded', 'qualifiedRouteName', function computeLinkToComponentLoading() { - var qualifiedRouteName = _emberMetal.get(this, 'qualifiedRouteName'); - var modelsAreLoaded = _emberMetal.get(this, '_modelsAreLoaded'); - - if (!modelsAreLoaded || qualifiedRouteName == null) { - return _emberMetal.get(this, 'loadingClass'); - } - }), - - _modelsAreLoaded: _emberMetal.computed('models', function computeLinkToComponentModelsAreLoaded() { - var models = _emberMetal.get(this, 'models'); - for (var i = 0; i < models.length; i++) { - if (models[i] == null) { - return false; - } - } - - return true; - }), - - _getModels: function (params) { - var modelCount = params.length - 1; - var models = new Array(modelCount); - - for (var i = 0; i < modelCount; i++) { - var value = params[i + 1]; - - while (_emberRuntime.ControllerMixin.detect(value)) { - _emberMetal.deprecate('Providing `{{link-to}}` with a param that is wrapped in a controller is deprecated. ' + (this.parentView ? 'Please update `' + this.parentView + '` to use `{{link-to "post" someController.model}}` instead.' : ''), false, { id: 'ember-routing-views.controller-wrapped-param', until: '3.0.0' }); - value = value.get('model'); - } - - models[i] = value; - } - - return models; + return types; }, /** - The default href value to use while a link-to is loading. - Only applies when tagName is 'a' - @property loadingHref - @type String - @default # - @private + Fetches all loaded records for a given type. + @private + @method getRecords + @return {Array} An array of records. + This array will be observed for changes, + so it should update when new records are added/removed. */ - loadingHref: '#', - - didReceiveAttrs: function () { - var queryParams = undefined; - - var params = _emberMetal.get(this, 'params'); - - if (params) { - // Do not mutate params in place - params = params.slice(); - } + getRecords: function (type) { + return _emberRuntime.A(); + }, - _emberMetal.assert('You must provide one or more parameters to the link-to component.', (function () { - if (!params) { - return false; - } + /** + Wraps a record and observers changes to it. + @private + @method wrapRecord + @param {Object} record The record instance. + @return {Object} The wrapped record. Format: + columnValues: {Array} + searchKeywords: {Array} + */ + wrapRecord: function (record) { + var recordToSend = { object: record }; - return params.length; - })()); + recordToSend.columnValues = this.getRecordColumnValues(record); + recordToSend.searchKeywords = this.getRecordKeywords(record); + recordToSend.filterValues = this.getRecordFilterValues(record); + recordToSend.color = this.getRecordColor(record); - var disabledWhen = _emberMetal.get(this, 'disabledWhen'); - if (disabledWhen !== undefined) { - this.set('disabled', disabledWhen); - } + return recordToSend; + }, - // Process the positional arguments, in order. - // 1. Inline link title comes first, if present. - if (!this[_emberGlimmerComponent.HAS_BLOCK]) { - this.set('linkTitle', params.shift()); - } + /** + Gets the values for each column. + @private + @method getRecordColumnValues + @return {Object} Keys should match column names defined + by the model type. + */ + getRecordColumnValues: function (record) { + return {}; + }, - // 2. `targetRouteName` is now always at index 0. - this.set('targetRouteName', params[0]); + /** + Returns keywords to match when searching records. + @private + @method getRecordKeywords + @return {Array} Relevant keywords for search. + */ + getRecordKeywords: function (record) { + return _emberRuntime.A(); + }, - // 3. The last argument (if still remaining) is the `queryParams` object. - var lastParam = params[params.length - 1]; + /** + Returns the values of filters defined by `getFilters`. + @private + @method getRecordFilterValues + @param {Object} record The record instance. + @return {Object} The filter values. + */ + getRecordFilterValues: function (record) { + return {}; + }, - if (lastParam && lastParam.isQueryParams) { - queryParams = params.pop(); - } else { - queryParams = { values: {} }; - } - this.set('queryParams', queryParams); + /** + Each record can have a color that represents its state. + @private + @method getRecordColor + @param {Object} record The record instance + @return {String} The records color. + Possible options: black, red, blue, green. + */ + getRecordColor: function (record) { + return null; + }, - // 4. Any remaining indices (excepting `targetRouteName` at 0) are `models`. - if (params.length > 1) { - this.set('models', this._getModels(params)); - } else { - this.set('models', []); - } + /** + Observes all relevant properties and re-sends the wrapped record + when a change occurs. + @private + @method observerRecord + @param {Object} record The record instance. + @param {Function} recordUpdated The callback to call when a record is updated. + @return {Function} The function to call to remove all observers. + */ + observeRecord: function (record, recordUpdated) { + return function () {}; } }); +}); +enifed('ember-extension-support/index', ['exports', 'ember-extension-support/data_adapter', 'ember-extension-support/container_debug_adapter'], function (exports, _emberExtensionSupportData_adapter, _emberExtensionSupportContainer_debug_adapter) { + /** + @module ember + @submodule ember-extension-support + */ - LinkComponent.toString = function () { - return 'LinkComponent'; - }; - - LinkComponent.reopenClass({ - positionalParams: 'params' - }); + 'use strict'; - exports.default = LinkComponent; + exports.DataAdapter = _emberExtensionSupportData_adapter.default; + exports.ContainerDebugAdapter = _emberExtensionSupportContainer_debug_adapter.default; }); -enifed('ember-glimmer/components/text_area', ['exports', 'ember-glimmer/component', 'ember-views', 'ember-glimmer/templates/empty'], function (exports, _emberGlimmerComponent, _emberViews, _emberGlimmerTemplatesEmpty) { +enifed('ember-glimmer/component', ['exports', 'ember-utils', 'ember-views', 'ember-runtime', 'ember-metal', 'ember-glimmer/utils/references', '@glimmer/reference', '@glimmer/runtime'], function (exports, _emberUtils, _emberViews, _emberRuntime, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference, _glimmerRuntime) { + 'use strict'; + + var _CoreView$extend; + + var DIRTY_TAG = _emberUtils.symbol('DIRTY_TAG'); + exports.DIRTY_TAG = DIRTY_TAG; + var ARGS = _emberUtils.symbol('ARGS'); + exports.ARGS = ARGS; + var ROOT_REF = _emberUtils.symbol('ROOT_REF'); + exports.ROOT_REF = ROOT_REF; + var IS_DISPATCHING_ATTRS = _emberUtils.symbol('IS_DISPATCHING_ATTRS'); + exports.IS_DISPATCHING_ATTRS = IS_DISPATCHING_ATTRS; + var HAS_BLOCK = _emberUtils.symbol('HAS_BLOCK'); + exports.HAS_BLOCK = HAS_BLOCK; + var BOUNDS = _emberUtils.symbol('BOUNDS'); + + exports.BOUNDS = BOUNDS; /** @module ember @submodule ember-glimmer */ - 'use strict'; /** - `{{textarea}}` inserts a new instance of ` + ``` - Bound: - In the following example, the `writtenWords` property on `App.ApplicationController` - will be updated live as the user types 'Lots of text that IS bound' into - the text area of their browser's window. + ## HTML `class` Attribute - ```javascript - App.ApplicationController = Ember.Controller.extend({ - writtenWords: "Lots of text that IS bound" + The HTML `class` attribute of a component's tag can be set by providing a + `classNames` property that is set to an array of strings: + + ```app/components/my-widget.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + classNames: ['my-class', 'my-other-class'] }); ``` - ```handlebars - {{textarea value=writtenWords}} + Will result in component instances with an HTML representation of: + + ```html +
    ``` - Would result in the following HTML: + `class` attribute values can also be set by providing a `classNameBindings` + property set to an array of properties names for the component. The return value + of these properties will be added as part of the value for the components's `class` + attribute. These properties can be computed properties: + + ```app/components/my-widget.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + classNameBindings: ['propertyA', 'propertyB'], + propertyA: 'from-a', + propertyB: Ember.computed(function() { + if (someLogic) { return 'from-b'; } + }) + }); + ``` + + Will result in component instances with an HTML representation of: ```html - +
    ``` - If you wanted a one way binding between the text area and a div tag - somewhere else on your screen, you could use `Ember.computed.oneWay`: + If the value of a class name binding returns a boolean the property name + itself will be used as the class name if the property is true. + The class name will not be added if the value is `false` or `undefined`. - ```javascript - App.ApplicationController = Ember.Controller.extend({ - writtenWords: "Lots of text that IS bound", - outputWrittenWords: Ember.computed.oneWay("writtenWords") + ```app/components/my-widget.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + classNameBindings: ['hovered'], + hovered: true }); ``` - ```handlebars - {{textarea value=writtenWords}} -
    - {{outputWrittenWords}} -
    + Will result in component instances with an HTML representation of: + + ```html +
    ``` - Would result in the following HTML: + When using boolean class name bindings you can supply a string value other + than the property name for use as the `class` HTML attribute by appending the + preferred value after a ":" character when defining the binding: + + ```app/components/my-widget.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + classNameBindings: ['awesome:so-very-cool'], + awesome: true + }); + ``` + + Will result in component instances with an HTML representation of: ```html - - <-- the following div will be updated in real time as you type --> -
    - Lots of text that IS bound -
    +
    ``` - Finally, this example really shows the power and ease of Ember when two - properties are bound to eachother via `Ember.computed.alias`. Type into - either text area box and they'll both stay in sync. Note that - `Ember.computed.alias` costs more in terms of performance, so only use it when - your really binding in both directions: + Boolean value class name bindings whose property names are in a + camelCase-style format will be converted to a dasherized format: - ```javascript - App.ApplicationController = Ember.Controller.extend({ - writtenWords: "Lots of text that IS bound", - twoWayWrittenWords: Ember.computed.alias("writtenWords") + ```app/components/my-widget.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + classNameBindings: ['isUrgent'], + isUrgent: true }); ``` - ```handlebars - {{textarea value=writtenWords}} - {{textarea value=twoWayWrittenWords}} + Will result in component instances with an HTML representation of: + + ```html +
    + ``` + + Class name bindings can also refer to object values that are found by + traversing a path relative to the component itself: + + ```app/components/my-widget.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + classNameBindings: ['messages.empty'], + messages: Ember.Object.create({ + empty: true + }) + }); ``` + Will result in component instances with an HTML representation of: + ```html - - <-- both updated in real time --> - +
    ``` - ### Actions + If you want to add a class name for a property which evaluates to true and + and a different class name if it evaluates to false, you can pass a binding + like this: - The helper can send multiple actions based on user events. - The action property defines the action which is send when - the user presses the return key. + ```app/components/my-widget.js + import Ember from 'ember'; - ```handlebars - {{input action="submit"}} + export default Ember.Component.extend({ + classNameBindings: ['isEnabled:enabled:disabled'], + isEnabled: true + }); ``` - The helper allows some user events to send actions. + Will result in component instances with an HTML representation of: - * `enter` - * `insert-newline` - * `escape-press` - * `focus-in` - * `focus-out` - * `key-press` + ```html +
    + ``` - For example, if you desire an action to be sent when the input is blurred, - you only need to setup the action name to the event name property. + When isEnabled is `false`, the resulting HTML representation looks like + this: - ```handlebars - {{textarea focus-in="alertMessage"}} + ```html +
    ``` - See more about [Text Support Actions](/api/classes/Ember.TextArea.html) + This syntax offers the convenience to add a class if a property is `false`: - ### Extension + ```app/components/my-widget.js + import Ember from 'ember'; - Internally, `{{textarea}}` creates an instance of `Ember.TextArea`, passing - arguments from the helper to `Ember.TextArea`'s `create` method. You can - extend the capabilities of text areas in your application by reopening this - class. For example, if you are building a Bootstrap project where `data-*` - attributes are used, you can globally add support for a `data-*` attribute - on all `{{textarea}}`s' in your app by reopening `Ember.TextArea` or - `Ember.TextSupport` and adding it to the `attributeBindings` concatenated - property: + // Applies no class when isEnabled is true and class 'disabled' when isEnabled is false + export default Ember.Component.extend({ + classNameBindings: ['isEnabled::disabled'], + isEnabled: true + }); + ``` - ```javascript - Ember.TextArea.reopen({ - attributeBindings: ['data-error'] + Will result in component instances with an HTML representation of: + + ```html +
    + ``` + + When the `isEnabled` property on the component is set to `false`, it will result + in component instances with an HTML representation of: + + ```html +
    + ``` + + Updates to the value of a class name binding will result in automatic + update of the HTML `class` attribute in the component's rendered HTML + representation. If the value becomes `false` or `undefined` the class name + will be removed. + Both `classNames` and `classNameBindings` are concatenated properties. See + [Ember.Object](/api/classes/Ember.Object.html) documentation for more + information about concatenated properties. + + + ## HTML Attributes + + The HTML attribute section of a component's tag can be set by providing an + `attributeBindings` property set to an array of property names on the component. + The return value of these properties will be used as the value of the component's + HTML associated attribute: + + ```app/components/my-anchor.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + tagName: 'a', + attributeBindings: ['href'], + href: 'http://google.com' }); ``` - Keep in mind when writing `Ember.TextArea` subclasses that `Ember.TextArea` - itself extends `Ember.Component`. Expect isolated component semantics, not - legacy 1.x view semantics (like `controller` being present). + Will result in component instances with an HTML representation of: - See more about [Ember components](/api/classes/Ember.Component.html) + ```html + + ``` - @method textarea - @for Ember.Templates.helpers - @param {Hash} options - @public - */ - - /** - The internal class used to create textarea element when the `{{textarea}}` - helper is used. + One property can be mapped on to another by placing a ":" between + the source property and the destination property: - See [Ember.Templates.helpers.textarea](/api/classes/Ember.Templates.helpers.html#method_textarea) for usage details. + ```app/components/my-anchor.js + import Ember from 'ember'; - ## Layout and LayoutName properties + export default Ember.Component.extend({ + tagName: 'a', + attributeBindings: ['url:href'], + url: 'http://google.com' + }); + ``` - Because HTML `textarea` elements do not contain inner HTML the `layout` and - `layoutName` properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s - layout section for more information. + Will result in component instances with an HTML representation of: - @class TextArea - @namespace Ember - @extends Ember.Component - @uses Ember.TextSupport - @public - */ - exports.default = _emberGlimmerComponent.default.extend(_emberViews.TextSupport, { - classNames: ['ember-text-area'], - - layout: _emberGlimmerTemplatesEmpty.default, - - tagName: 'textarea', - attributeBindings: ['rows', 'cols', 'name', 'selectionEnd', 'selectionStart', 'wrap', 'lang', 'dir', 'value'], - rows: null, - cols: null - }); -}); -enifed('ember-glimmer/components/text_field', ['exports', 'ember-utils', 'ember-metal', 'ember-environment', 'ember-glimmer/component', 'ember-glimmer/templates/empty', 'ember-views'], function (exports, _emberUtils, _emberMetal, _emberEnvironment, _emberGlimmerComponent, _emberGlimmerTemplatesEmpty, _emberViews) { - /** - @module ember - @submodule ember-views - */ - 'use strict'; - - var inputTypeTestElement = undefined; - var inputTypes = new _emberUtils.EmptyObject(); - function canSetTypeOfInput(type) { - if (type in inputTypes) { - return inputTypes[type]; - } - - // if running in outside of a browser always return the - // original type - if (!_emberEnvironment.environment.hasDOM) { - inputTypes[type] = type; - - return type; - } - - if (!inputTypeTestElement) { - inputTypeTestElement = document.createElement('input'); - } - - try { - inputTypeTestElement.type = type; - } catch (e) {} - - return inputTypes[type] = inputTypeTestElement.type === type; - } - - /** + ```html + + ``` - The internal class used to create text inputs when the `{{input}}` - helper is used with `type` of `text`. + Namespaced attributes (e.g. `xlink:href`) are supported, but have to be + mapped, since `:` is not a valid character for properties in Javascript: - See [Ember.Templates.helpers.input](/api/classes/Ember.Templates.helpers.html#method_input) for usage details. + ```app/components/my-use.js + import Ember from 'ember'; - ## Layout and LayoutName properties + export default Ember.Component.extend({ + tagName: 'use', + attributeBindings: ['xlinkHref:xlink:href'], + xlinkHref: '#triangle' + }); + ``` - Because HTML `input` elements are self closing `layout` and `layoutName` - properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s - layout section for more information. + Will result in component instances with an HTML representation of: - @class TextField + ```html + + ``` + + If the return value of an `attributeBindings` monitored property is a boolean + the attribute will be present or absent depending on the value: + + ```app/components/my-text-input.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + tagName: 'input', + attributeBindings: ['disabled'], + disabled: false + }); + ``` + + Will result in a component instance with an HTML representation of: + + ```html + + ``` + + `attributeBindings` can refer to computed properties: + + ```app/components/my-text-input.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + tagName: 'input', + attributeBindings: ['disabled'], + disabled: Ember.computed(function() { + if (someLogic) { + return true; + } else { + return false; + } + }) + }); + ``` + + To prevent setting an attribute altogether, use `null` or `undefined` as the + return value of the `attributeBindings` monitored property: + + ```app/components/my-text-input.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + tagName: 'form', + attributeBindings: ['novalidate'], + novalidate: null + }); + ``` + + Updates to the property of an attribute binding will result in automatic + update of the HTML attribute in the component's rendered HTML representation. + `attributeBindings` is a concatenated property. See [Ember.Object](/api/classes/Ember.Object.html) + documentation for more information about concatenated properties. + + + ## Layouts + + See [Ember.Templates.helpers.yield](/api/classes/Ember.Templates.helpers.html#method_yield) + for more information. + + + ## Responding to Browser Events + + Components can respond to user-initiated events in one of three ways: method + implementation, through an event manager, and through `{{action}}` helper use + in their template or layout. + + + ### Method Implementation + + Components can respond to user-initiated events by implementing a method that + matches the event name. A `jQuery.Event` object will be passed as the + argument to this method. + + ```app/components/my-widget.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + click(event) { + // will be called when an instance's + // rendered element is clicked + } + }); + ``` + + + ### `{{action}}` Helper + + See [Ember.Templates.helpers.action](/api/classes/Ember.Templates.helpers.html#method_action). + + + ### Event Names + + All of the event handling approaches described above respond to the same set + of events. The names of the built-in events are listed below. (The hash of + built-in events exists in `Ember.EventDispatcher`.) Additional, custom events + can be registered by using `Ember.Application.customEvents`. + + Touch events: + + * `touchStart` + * `touchMove` + * `touchEnd` + * `touchCancel` + + Keyboard events: + + * `keyDown` + * `keyUp` + * `keyPress` + + Mouse events: + + * `mouseDown` + * `mouseUp` + * `contextMenu` + * `click` + * `doubleClick` + * `mouseMove` + * `focusIn` + * `focusOut` + * `mouseEnter` + * `mouseLeave` + + Form events: + + * `submit` + * `change` + * `focusIn` + * `focusOut` + * `input` + + HTML5 drag and drop events: + + * `dragStart` + * `drag` + * `dragEnter` + * `dragLeave` + * `dragOver` + * `dragEnd` + * `drop` + + @class Component @namespace Ember - @extends Ember.Component - @uses Ember.TextSupport + @extends Ember.CoreView + @uses Ember.TargetActionSupport + @uses Ember.ClassNamesSupport + @uses Ember.ActionSupport + @uses Ember.ViewMixin + @uses Ember.ViewStateSupport @public */ - exports.default = _emberGlimmerComponent.default.extend(_emberViews.TextSupport, { - layout: _emberGlimmerTemplatesEmpty.default, - classNames: ['ember-text-field'], - tagName: 'input', - attributeBindings: ['accept', 'autocomplete', 'autosave', 'dir', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget', 'height', 'inputmode', 'lang', 'list', 'max', 'min', 'multiple', 'name', 'pattern', 'size', 'step', 'type', 'value', 'width'], - - /** - The `value` attribute of the input element. As the user inputs text, this - property is updated live. - @property value - @type String - @default "" - @public - */ - value: '', + var Component = _emberViews.CoreView.extend(_emberViews.ChildViewsSupport, _emberViews.ViewStateSupport, _emberViews.ClassNamesSupport, _emberRuntime.TargetActionSupport, _emberViews.ActionSupport, _emberViews.ViewMixin, (_CoreView$extend = { + isComponent: true, - /** - The `type` attribute of the input element. - @property type - @type String - @default "text" - @public - */ - type: _emberMetal.computed({ - get: function () { - return 'text'; - }, + init: function () { + var _this = this; - set: function (key, value) { - var type = 'text'; + this._super.apply(this, arguments); + this[IS_DISPATCHING_ATTRS] = false; + this[DIRTY_TAG] = new _glimmerReference.DirtyableTag(); + this[ROOT_REF] = new _emberGlimmerUtilsReferences.RootReference(this); + this[BOUNDS] = null; - if (canSetTypeOfInput(value)) { - type = value; - } + // If a `defaultLayout` was specified move it to the `layout` prop. + // `layout` is no longer a CP, so this just ensures that the `defaultLayout` + // logic is supported with a deprecation + if (this.defaultLayout && !this.layout) { + _emberMetal.deprecate('Specifying `defaultLayout` to ' + this + ' is deprecated. Please use `layout` instead.', false, { + id: 'ember-views.component.defaultLayout', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-component-defaultlayout' + }); - return type; + this.layout = this.defaultLayout; } - }), - - /** - The `size` of the text field in characters. - @property size - @type String - @default null - @public - */ - size: null, - - /** - The `pattern` attribute of input element. - @property pattern - @type String - @default null - @public - */ - pattern: null, - /** - The `min` attribute of input element used with `type="number"` or `type="range"`. - @property min - @type String - @default null - @since 1.4.0 - @public - */ - min: null, + // If in a tagless component, assert that no event handlers are defined + _emberMetal.assert('You can not define a function that handles DOM events in the `' + this + '` tagless component since it doesn\'t have any DOM element.', this.tagName !== '' || !this.renderer._destinedForDOM || !(function () { + var eventDispatcher = _emberUtils.getOwner(_this).lookup('event_dispatcher:main'); + var events = eventDispatcher && eventDispatcher._finalEvents || {}; - /** - The `max` attribute of input element used with `type="number"` or `type="range"`. - @property max - @type String - @default null - @since 1.4.0 - @public - */ - max: null - }); -}); -enifed('ember-glimmer/dom', ['exports', 'glimmer-runtime', 'glimmer-node'], function (exports, _glimmerRuntime, _glimmerNode) { - 'use strict'; + for (var key in events) { + var methodName = events[key]; - exports.DOMChanges = _glimmerRuntime.DOMChanges; - exports.DOMTreeConstruction = _glimmerRuntime.DOMTreeConstruction; - exports.NodeDOMTreeConstruction = _glimmerNode.NodeDOMTreeConstruction; -}); -enifed('ember-glimmer/environment', ['exports', 'ember-utils', 'ember-metal', 'ember-views', 'glimmer-runtime', 'ember-glimmer/syntax/curly-component', 'ember-glimmer/syntax', 'ember-glimmer/syntax/dynamic-component', 'ember-glimmer/utils/iterable', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/if-unless', 'ember-glimmer/utils/bindings', 'ember-glimmer/helpers/action', 'ember-glimmer/helpers/component', 'ember-glimmer/helpers/concat', 'ember-glimmer/helpers/debugger', 'ember-glimmer/helpers/get', 'ember-glimmer/helpers/hash', 'ember-glimmer/helpers/loc', 'ember-glimmer/helpers/log', 'ember-glimmer/helpers/mut', 'ember-glimmer/helpers/readonly', 'ember-glimmer/helpers/unbound', 'ember-glimmer/helpers/-class', 'ember-glimmer/helpers/-input-type', 'ember-glimmer/helpers/query-param', 'ember-glimmer/helpers/each-in', 'ember-glimmer/helpers/-normalize-class', 'ember-glimmer/helpers/-html-safe', 'ember-glimmer/protocol-for-url', 'ember-glimmer/modifiers/action'], function (exports, _emberUtils, _emberMetal, _emberViews, _glimmerRuntime, _emberGlimmerSyntaxCurlyComponent, _emberGlimmerSyntax, _emberGlimmerSyntaxDynamicComponent, _emberGlimmerUtilsIterable, _emberGlimmerUtilsReferences, _emberGlimmerHelpersIfUnless, _emberGlimmerUtilsBindings, _emberGlimmerHelpersAction, _emberGlimmerHelpersComponent, _emberGlimmerHelpersConcat, _emberGlimmerHelpersDebugger, _emberGlimmerHelpersGet, _emberGlimmerHelpersHash, _emberGlimmerHelpersLoc, _emberGlimmerHelpersLog, _emberGlimmerHelpersMut, _emberGlimmerHelpersReadonly, _emberGlimmerHelpersUnbound, _emberGlimmerHelpersClass, _emberGlimmerHelpersInputType, _emberGlimmerHelpersQueryParam, _emberGlimmerHelpersEachIn, _emberGlimmerHelpersNormalizeClass, _emberGlimmerHelpersHtmlSafe, _emberGlimmerProtocolForUrl, _emberGlimmerModifiersAction) { - 'use strict'; + if (typeof _this[methodName] === 'function') { + return true; // indicate that the assertion should be triggered + } + } + })()); - var builtInComponents = { - textarea: '-text-area' - }; + _emberMetal.assert('You cannot use a computed property for the component\'s `tagName` (' + this + ').', !(this.tagName && this.tagName.isDescriptor)); + }, - var Environment = (function (_GlimmerEnvironment) { - babelHelpers.inherits(Environment, _GlimmerEnvironment); + rerender: function () { + this[DIRTY_TAG].dirty(); + this._super(); + }, - Environment.create = function create(options) { - return new Environment(options); - }; + __defineNonEnumerable: function (property) { + this[property.name] = property.descriptor.value; + } - function Environment(_ref) { - var _this = this; + }, _CoreView$extend[_emberMetal.PROPERTY_DID_CHANGE] = function (key) { + if (this[IS_DISPATCHING_ATTRS]) { + return; + } - var owner = _ref[_emberUtils.OWNER]; - babelHelpers.classCallCheck(this, Environment); + var args = undefined, + reference = undefined; - _GlimmerEnvironment.apply(this, arguments); - this.owner = owner; - this.isInteractive = owner.lookup('-environment:main').isInteractive; + if ((args = this[ARGS]) && (reference = args[key])) { + if (reference[_emberGlimmerUtilsReferences.UPDATE]) { + reference[_emberGlimmerUtilsReferences.UPDATE](_emberMetal.get(this, key)); + } + } + }, _CoreView$extend.getAttr = function (key) { + // TODO Intimate API should be deprecated + return this.get(key); + }, _CoreView$extend.readDOMAttr = function (name) { + var element = _emberViews.getViewElement(this); + return _glimmerRuntime.readDOMAttr(element, name); + }, _CoreView$extend)); - // can be removed once https://github.com/tildeio/glimmer/pull/305 lands - this.destroyedComponents = undefined; + /** + The WAI-ARIA role of the control represented by this view. For example, a + button may have a role of type 'button', or a pane may have a role of + type 'alertdialog'. This property is used by assistive software to help + visually challenged users navigate rich web applications. + The full list of valid WAI-ARIA roles is available at: + [http://www.w3.org/TR/wai-aria/roles#roles_categorization](http://www.w3.org/TR/wai-aria/roles#roles_categorization) + @property ariaRole + @type String + @default null + @public + */ - _emberGlimmerProtocolForUrl.default(this); + /** + Enables components to take a list of parameters as arguments. + For example, a component that takes two parameters with the names + `name` and `age`: + ```javascript + let MyComponent = Ember.Component.extend; + MyComponent.reopenClass({ + positionalParams: ['name', 'age'] + }); + ``` + It can then be invoked like this: + ```hbs + {{my-component "John" 38}} + ``` + The parameters can be referred to just like named parameters: + ```hbs + Name: {{name}}, Age: {{age}}. + ``` + Using a string instead of an array allows for an arbitrary number of + parameters: + ```javascript + let MyComponent = Ember.Component.extend; + MyComponent.reopenClass({ + positionalParams: 'names' + }); + ``` + It can then be invoked like this: + ```hbs + {{my-component "John" "Michael" "Scott"}} + ``` + The parameters can then be referred to by enumerating over the list: + ```hbs + {{#each names as |name|}}{{name}}{{/each}} + ``` + @static + @public + @property positionalParams + @since 1.13.0 + */ - this._definitionCache = new _emberMetal.Cache(2000, function (_ref2) { - var name = _ref2.name; - var source = _ref2.source; - var owner = _ref2.owner; + /** + Called when the attributes passed into the component have been updated. + Called both during the initial render of a container and during a rerender. + Can be used in place of an observer; code placed here will be executed + every time any attribute updates. + @method didReceiveAttrs + @public + @since 1.13.0 + */ - var _lookupComponent = _emberViews.lookupComponent(owner, name, { source: source }); + /** + Called when the attributes passed into the component have been updated. + Called both during the initial render of a container and during a rerender. + Can be used in place of an observer; code placed here will be executed + every time any attribute updates. + @event didReceiveAttrs + @public + @since 1.13.0 + */ - var ComponentClass = _lookupComponent.component; - var layout = _lookupComponent.layout; + /** + Called after a component has been rendered, both on initial render and + in subsequent rerenders. + @method didRender + @public + @since 1.13.0 + */ - if (ComponentClass || layout) { - return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentDefinition(name, ComponentClass, layout); - } - }, function (_ref3) { - var name = _ref3.name; - var source = _ref3.source; - var owner = _ref3.owner; + /** + Called after a component has been rendered, both on initial render and + in subsequent rerenders. + @event didRender + @public + @since 1.13.0 + */ - var expandedName = source && owner._resolveLocalLookupName(name, source) || name; - var ownerGuid = _emberUtils.guidFor(owner); + /** + Called before a component has been rendered, both on initial render and + in subsequent rerenders. + @method willRender + @public + @since 1.13.0 + */ - return ownerGuid + '|' + expandedName; - }); + /** + Called before a component has been rendered, both on initial render and + in subsequent rerenders. + @event willRender + @public + @since 1.13.0 + */ - this._templateCache = new _emberMetal.Cache(1000, function (_ref4) { - var Template = _ref4.Template; - var owner = _ref4.owner; + /** + Called when the attributes passed into the component have been changed. + Called only during a rerender, not during an initial render. + @method didUpdateAttrs + @public + @since 1.13.0 + */ - if (Template.create) { - var _Template$create; + /** + Called when the attributes passed into the component have been changed. + Called only during a rerender, not during an initial render. + @event didUpdateAttrs + @public + @since 1.13.0 + */ - // we received a factory - return Template.create((_Template$create = { env: _this }, _Template$create[_emberUtils.OWNER] = owner, _Template$create)); - } else { - // we were provided an instance already - return Template; - } - }, function (_ref5) { - var Template = _ref5.Template; - var owner = _ref5.owner; - return _emberUtils.guidFor(owner) + '|' + Template.id; - }); + /** + Called when the component is about to update and rerender itself. + Called only during a rerender, not during an initial render. + @method willUpdate + @public + @since 1.13.0 + */ - this._compilerCache = new _emberMetal.Cache(10, function (Compiler) { - return new _emberMetal.Cache(2000, function (template) { - var compilable = new Compiler(template); - return _glimmerRuntime.compileLayout(compilable, _this); - }, function (template) { - var owner = template.meta.owner; - return _emberUtils.guidFor(owner) + '|' + template.id; - }); - }, function (Compiler) { - return Compiler.id; - }); + /** + Called when the component is about to update and rerender itself. + Called only during a rerender, not during an initial render. + @event willUpdate + @public + @since 1.13.0 + */ - this.builtInModifiers = { - action: new _emberGlimmerModifiersAction.default() - }; + /** + Called when the component has updated and rerendered itself. + Called only during a rerender, not during an initial render. + @method didUpdate + @public + @since 1.13.0 + */ - this.builtInHelpers = { - if: _emberGlimmerHelpersIfUnless.inlineIf, - action: _emberGlimmerHelpersAction.default, - component: _emberGlimmerHelpersComponent.default, - concat: _emberGlimmerHelpersConcat.default, - debugger: _emberGlimmerHelpersDebugger.default, - get: _emberGlimmerHelpersGet.default, - hash: _emberGlimmerHelpersHash.default, - loc: _emberGlimmerHelpersLoc.default, - log: _emberGlimmerHelpersLog.default, - mut: _emberGlimmerHelpersMut.default, - 'query-params': _emberGlimmerHelpersQueryParam.default, - readonly: _emberGlimmerHelpersReadonly.default, - unbound: _emberGlimmerHelpersUnbound.default, - unless: _emberGlimmerHelpersIfUnless.inlineUnless, - '-class': _emberGlimmerHelpersClass.default, - '-each-in': _emberGlimmerHelpersEachIn.default, - '-input-type': _emberGlimmerHelpersInputType.default, - '-normalize-class': _emberGlimmerHelpersNormalizeClass.default, - '-html-safe': _emberGlimmerHelpersHtmlSafe.default, - '-get-dynamic-var': _glimmerRuntime.getDynamicVar - }; - } + /** + Called when the component has updated and rerendered itself. + Called only during a rerender, not during an initial render. + @event didUpdate + @public + @since 1.13.0 + */ - // Hello future traveler, welcome to the world of syntax refinement. - // The method below is called by Glimmer's runtime compiler to allow - // us to take generic statement syntax and refine it to more meaniful - // syntax for Ember's use case. This on the fly switch-a-roo sounds fine - // and dandy, however Ember has precedence on statement refinement that you - // need to be aware of. The presendence for language constructs is as follows: - // - // ------------------------ - // Native & Built-in Syntax - // ------------------------ - // User-land components - // ------------------------ - // User-land helpers - // ------------------------ - // - // The one caveat here is that Ember also allows for dashed references that are - // not a component or helper: - // - // export default Component.extend({ - // 'foo-bar': 'LAME' - // }); - // - // {{foo-bar}} - // - // The heuristic for the above situation is a dashed "key" in inline form - // that does not resolve to a defintion. In this case refine statement simply - // isn't going to return any syntax and the Glimmer engine knows how to handle - // this case. + /** + A component may contain a layout. A layout is a regular template but + supersedes the `template` property during rendering. It is the + responsibility of the layout template to retrieve the `template` + property from the component (or alternatively, call `Handlebars.helpers.yield`, + `{{yield}}`) to render it in the correct location. + This is useful for a component 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 + @public + */ - Environment.prototype.refineStatement = function refineStatement(statement, symbolTable) { - var _this2 = this; + /** + The name of the layout to lookup if no layout is provided. + By default `Ember.Component` will lookup a template with this name in + `Ember.TEMPLATES` (a shared global object). + @property layoutName + @type String + @default null + @private + */ - // 1. resolve any native syntax – if, unless, with, each, and partial - var nativeSyntax = _GlimmerEnvironment.prototype.refineStatement.call(this, statement, symbolTable); + /** + Returns a jQuery object for this component's element. If you pass in a selector + string, this method will return a jQuery object, using the current element + as its buffer. + For example, calling `component.$('li')` will return a jQuery object containing + all of the `li` elements inside the DOM element of this component. + @method $ + @param {String} [selector] a jQuery-compatible selector string + @return {jQuery} the jQuery object for the DOM node + @public + */ - if (nativeSyntax) { - return nativeSyntax; + /** + The HTML `id` of the component's element in the DOM. You can provide this + value yourself but it must be unique (just as in HTML): + ```handlebars + {{my-component elementId="a-really-cool-id"}} + ``` + If not manually set a default value will be provided by the framework. + Once rendered an element's `elementId` is considered immutable and you + should never change it. If you need to compute a dynamic value for the + `elementId`, you should do this when the component or element is being + instantiated: + ```javascript + export default Ember.Component.extend({ + init() { + this._super(...arguments); + var index = this.get('index'); + this.set('elementId', `component-id${index}`); } + }); + ``` + @property elementId + @type String + @public + */ - var appendType = statement.appendType; - var isSimple = statement.isSimple; - var isInline = statement.isInline; - var isBlock = statement.isBlock; - var isModifier = statement.isModifier; - var key = statement.key; - var path = statement.path; - var args = statement.args; + /** + If `false`, the view will appear hidden in DOM. + @property isVisible + @type Boolean + @default null + @public + */ + Component[_emberUtils.NAME_KEY] = 'Ember.Component'; - _emberMetal.assert('You attempted to overwrite the built-in helper "' + key + '" which is not allowed. Please rename the helper.', !(this.builtInHelpers[key] && this.owner.hasRegistration('helper:' + key))); + Component.reopenClass({ + isComponentFactory: true, + positionalParams: [] + }); - if (isSimple && (isInline || isBlock) && appendType !== 'get') { - // 2. built-in syntax - - var RefinedSyntax = _emberGlimmerSyntax.findSyntaxBuilder(key); - if (RefinedSyntax) { - return RefinedSyntax.create(this, args, symbolTable); - } - - var internalKey = builtInComponents[key]; - var definition = null; - - if (internalKey) { - definition = this.getComponentDefinition([internalKey], symbolTable); - } else if (key.indexOf('-') >= 0) { - definition = this.getComponentDefinition(path, symbolTable); - } - - if (definition) { - _emberGlimmerUtilsBindings.wrapComponentClassAttribute(args); - - return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentSyntax(args, definition, symbolTable); - } - - _emberMetal.assert('A component or helper named "' + key + '" could not be found', !isBlock || this.hasHelper(path, symbolTable)); - } - - if (isInline && !isSimple && appendType !== 'helper') { - return statement.original.deopt(); - } - - if (!isSimple && path) { - return _emberGlimmerSyntaxDynamicComponent.DynamicComponentSyntax.fromPath(this, path, args, symbolTable); - } - - _emberMetal.assert('Helpers may not be used in the block form, for example {{#' + key + '}}{{/' + key + '}}. Please use a component, or alternatively use the helper in combination with a built-in Ember helper, for example {{#if (' + key + ')}}{{/if}}.', !isBlock || !this.hasHelper(path, symbolTable)); - - _emberMetal.assert('Helpers may not be used in the element form.', (function () { - if (nativeSyntax) { - return true; - } - if (!key) { - return true; - } - - if (isModifier && !_this2.hasModifier(path, symbolTable) && _this2.hasHelper(path, symbolTable)) { - return false; - } - - return true; - })()); - }; - - Environment.prototype.hasComponentDefinition = function hasComponentDefinition() { - return false; - }; - - Environment.prototype.getComponentDefinition = function getComponentDefinition(path, symbolTable) { - var name = path[0]; - var blockMeta = symbolTable.getMeta(); - var owner = blockMeta.owner; - var source = blockMeta.moduleName && 'template:' + blockMeta.moduleName; - - return this._definitionCache.get({ name: name, source: source, owner: owner }); - }; - - // normally templates should be exported at the proper module name - // and cached in the container, but this cache supports templates - // that have been set directly on the component's layout property - - Environment.prototype.getTemplate = function getTemplate(Template, owner) { - return this._templateCache.get({ Template: Template, owner: owner }); - }; - - // a Compiler can wrap the template so it needs its own cache - - Environment.prototype.getCompiledBlock = function getCompiledBlock(Compiler, template) { - var compilerCache = this._compilerCache.get(Compiler); - return compilerCache.get(template); - }; - - Environment.prototype.hasPartial = function hasPartial(name, symbolTable) { - var _symbolTable$getMeta = symbolTable.getMeta(); - - var owner = _symbolTable$getMeta.owner; - - return _emberViews.hasPartial(name, owner); - }; - - Environment.prototype.lookupPartial = function lookupPartial(name, symbolTable) { - var _symbolTable$getMeta2 = symbolTable.getMeta(); - - var owner = _symbolTable$getMeta2.owner; - - var partial = { - template: _emberViews.lookupPartial(name, owner) - }; - - if (partial.template) { - return partial; - } else { - throw new Error(name + ' is not a partial'); - } - }; - - Environment.prototype.hasHelper = function hasHelper(nameParts, symbolTable) { - _emberMetal.assert('The first argument passed into `hasHelper` should be an array', Array.isArray(nameParts)); - - // helpers are not allowed to include a dot in their invocation - if (nameParts.length > 1) { - return false; - } - - var name = nameParts[0]; - - if (this.builtInHelpers[name]) { - return true; - } - - var blockMeta = symbolTable.getMeta(); - var owner = blockMeta.owner; - var options = { source: 'template:' + blockMeta.moduleName }; - - return owner.hasRegistration('helper:' + name, options) || owner.hasRegistration('helper:' + name); - }; - - Environment.prototype.lookupHelper = function lookupHelper(nameParts, symbolTable) { - _emberMetal.assert('The first argument passed into `lookupHelper` should be an array', Array.isArray(nameParts)); - - var name = nameParts[0]; - var helper = this.builtInHelpers[name]; - - if (helper) { - return helper; - } - - var blockMeta = symbolTable.getMeta(); - var owner = blockMeta.owner; - var options = blockMeta.moduleName && { source: 'template:' + blockMeta.moduleName } || {}; - - helper = owner.lookup('helper:' + name, options) || owner.lookup('helper:' + name); - - // TODO: try to unify this into a consistent protocol to avoid wasteful closure allocations - if (helper.isHelperInstance) { - return function (vm, args) { - return _emberGlimmerUtilsReferences.SimpleHelperReference.create(helper.compute, args); - }; - } else if (helper.isHelperFactory) { - return function (vm, args) { - return _emberGlimmerUtilsReferences.ClassBasedHelperReference.create(helper, vm, args); - }; - } else { - throw new Error(nameParts + ' is not a helper'); - } - }; - - Environment.prototype.hasModifier = function hasModifier(nameParts) { - _emberMetal.assert('The first argument passed into `hasModifier` should be an array', Array.isArray(nameParts)); - - // modifiers are not allowed to include a dot in their invocation - if (nameParts.length > 1) { - return false; - } - - return !!this.builtInModifiers[nameParts[0]]; - }; - - Environment.prototype.lookupModifier = function lookupModifier(nameParts) { - _emberMetal.assert('The first argument passed into `lookupModifier` should be an array', Array.isArray(nameParts)); - - var modifier = this.builtInModifiers[nameParts[0]]; - - if (modifier) { - return modifier; - } else { - throw new Error(nameParts + ' is not a modifier'); - } - }; - - Environment.prototype.toConditionalReference = function toConditionalReference(reference) { - return _emberGlimmerUtilsReferences.ConditionalReference.create(reference); - }; - - Environment.prototype.iterableFor = function iterableFor(ref, args) { - var keyPath = args.named.get('key').value(); - return _emberGlimmerUtilsIterable.default(ref, keyPath); - }; - - Environment.prototype.scheduleInstallModifier = function scheduleInstallModifier() { - if (this.isInteractive) { - var _GlimmerEnvironment$prototype$scheduleInstallModifier; - - (_GlimmerEnvironment$prototype$scheduleInstallModifier = _GlimmerEnvironment.prototype.scheduleInstallModifier).call.apply(_GlimmerEnvironment$prototype$scheduleInstallModifier, [this].concat(babelHelpers.slice.call(arguments))); - } - }; - - Environment.prototype.scheduleUpdateModifier = function scheduleUpdateModifier() { - if (this.isInteractive) { - var _GlimmerEnvironment$prototype$scheduleUpdateModifier; - - (_GlimmerEnvironment$prototype$scheduleUpdateModifier = _GlimmerEnvironment.prototype.scheduleUpdateModifier).call.apply(_GlimmerEnvironment$prototype$scheduleUpdateModifier, [this].concat(babelHelpers.slice.call(arguments))); - } - }; - - Environment.prototype.didDestroy = function didDestroy(destroyable) { - destroyable.destroy(); - }; - - Environment.prototype.begin = function begin() { - this.inTransaction = true; - - _GlimmerEnvironment.prototype.begin.call(this); - - this.destroyedComponents = []; - }; - - Environment.prototype.commit = function commit() { - // components queued for destruction must be destroyed before firing - // `didCreate` to prevent errors when removing and adding a component - // with the same name (would throw an error when added to view registry) - for (var i = 0; i < this.destroyedComponents.length; i++) { - this.destroyedComponents[i].destroy(); - } - - _GlimmerEnvironment.prototype.commit.call(this); - - this.inTransaction = false; - }; - - return Environment; - })(_glimmerRuntime.Environment); - - exports.default = Environment; - - _emberMetal.runInDebug(function () { - var StyleAttributeManager = (function (_AttributeManager) { - babelHelpers.inherits(StyleAttributeManager, _AttributeManager); - - function StyleAttributeManager() { - babelHelpers.classCallCheck(this, StyleAttributeManager); - - _AttributeManager.apply(this, arguments); - } + exports.default = Component; +}); - StyleAttributeManager.prototype.setAttribute = function setAttribute(dom, element, value) { - var _AttributeManager$prototype$setAttribute; +/** + Normally, Ember's component model is "write-only". The component takes a + bunch of attributes that it got passed in, and uses them to render its + template. + One nice thing about this model is that if you try to set a value to the + same thing as last time, Ember (through HTMLBars) will avoid doing any + work on the DOM. + This is not just a performance optimization. If an attribute has not + changed, it is important not to clobber the element's "hidden state". + For example, if you set an input's `value` to the same value as before, + it will clobber selection state and cursor position. In other words, + setting an attribute is not **always** idempotent. + This method provides a way to read an element's attribute and also + update the last value Ember knows about at the same time. This makes + setting an attribute idempotent. + In particular, what this means is that if you get an `` element's + `value` attribute and then re-render the template with the same value, + it will avoid clobbering the cursor and selection position. + Since most attribute sets are idempotent in the browser, you typically + can get away with reading attributes using jQuery, but the most reliable + way to do so is through this method. + @method readDOMAttr + @param {String} name the name of the attribute + @return String + @public + */ +enifed('ember-glimmer/components/checkbox', ['exports', 'ember-metal', 'ember-glimmer/component', 'ember-glimmer/templates/empty'], function (exports, _emberMetal, _emberGlimmerComponent, _emberGlimmerTemplatesEmpty) { + 'use strict'; - _emberMetal.warn(_emberViews.STYLE_WARNING, (function () { - if (value === null || value === undefined || _glimmerRuntime.isSafeString(value)) { - return true; - } - return false; - })(), { id: 'ember-htmlbars.style-xss-warning' }); - (_AttributeManager$prototype$setAttribute = _AttributeManager.prototype.setAttribute).call.apply(_AttributeManager$prototype$setAttribute, [this].concat(babelHelpers.slice.call(arguments))); - }; + /** + @module ember + @submodule ember-views + */ - StyleAttributeManager.prototype.updateAttribute = function updateAttribute(dom, element, value) { - var _AttributeManager$prototype$updateAttribute; + /** + The internal class used to create text inputs when the `{{input}}` + helper is used with `type` of `checkbox`. + + See [Ember.Templates.helpers.input](/api/classes/Ember.Templates.helpers.html#method_input) for usage details. + + ## Direct manipulation of `checked` + + The `checked` attribute of an `Ember.Checkbox` object should always be set + through the Ember object or by interacting with its rendered element + representation via the mouse, keyboard, or touch. Updating the value of the + checkbox via jQuery will result in the checked value of the object and its + element losing synchronization. + + ## Layout and LayoutName properties + + Because HTML `input` elements are self closing `layout` and `layoutName` + properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s + layout section for more information. + + @class Checkbox + @namespace Ember + @extends Ember.Component + @public + */ + exports.default = _emberGlimmerComponent.default.extend({ + layout: _emberGlimmerTemplatesEmpty.default, + classNames: ['ember-checkbox'], - _emberMetal.warn(_emberViews.STYLE_WARNING, (function () { - if (value === null || value === undefined || _glimmerRuntime.isSafeString(value)) { - return true; - } - return false; - })(), { id: 'ember-htmlbars.style-xss-warning' }); - (_AttributeManager$prototype$updateAttribute = _AttributeManager.prototype.updateAttribute).call.apply(_AttributeManager$prototype$updateAttribute, [this].concat(babelHelpers.slice.call(arguments))); - }; + tagName: 'input', - return StyleAttributeManager; - })(_glimmerRuntime.AttributeManager); + attributeBindings: ['type', 'checked', 'indeterminate', 'disabled', 'tabindex', 'name', 'autofocus', 'required', 'form'], - var STYLE_ATTRIBUTE_MANANGER = new StyleAttributeManager('style'); + type: 'checkbox', + checked: false, + disabled: false, + indeterminate: false, - Environment.prototype.attributeFor = function (element, attribute, isTrusting, namespace) { - if (attribute === 'style' && !isTrusting) { - return STYLE_ATTRIBUTE_MANANGER; - } + didInsertElement: function () { + this._super.apply(this, arguments); + _emberMetal.get(this, 'element').indeterminate = !!_emberMetal.get(this, 'indeterminate'); + }, - return _glimmerRuntime.Environment.prototype.attributeFor.call(this, element, attribute, isTrusting); - }; + change: function () { + _emberMetal.set(this, 'checked', this.$().prop('checked')); + } }); }); -enifed('ember-glimmer/helper', ['exports', 'ember-utils', 'ember-runtime', 'glimmer-reference'], function (exports, _emberUtils, _emberRuntime, _glimmerReference) { +enifed('ember-glimmer/components/link-to', ['exports', 'ember-console', 'ember-metal', 'ember-runtime', 'ember-views', 'ember-glimmer/templates/link-to', 'ember-glimmer/component'], function (exports, _emberConsole, _emberMetal, _emberRuntime, _emberViews, _emberGlimmerTemplatesLinkTo, _emberGlimmerComponent) { /** @module ember @submodule ember-glimmer */ - 'use strict'; - - exports.helper = helper; - var RECOMPUTE_TAG = _emberUtils.symbol('RECOMPUTE_TAG'); - - exports.RECOMPUTE_TAG = RECOMPUTE_TAG; /** - Ember Helpers are functions that can compute values, and are used in templates. - For example, this code calls a helper named `format-currency`: + The `{{link-to}}` component 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 + element: ```handlebars -
    {{format-currency cents currency="$"}}
    + {{#link-to 'photoGallery'}} + Great Hamster Photos + {{/link-to}} ``` - Additionally a helper can be called as a nested helper (sometimes called a - subexpression). In this example, the computed value of a helper is passed - to a component named `show-money`: + You can also use an inline form of `{{link-to}}` component by + passing the link text as the first argument + to the component: ```handlebars - {{show-money amount=(format-currency cents currency="$")}} + {{link-to 'Great Hamster Photos' 'photoGallery'}} ``` - Helpers defined using a class must provide a `compute` function. For example: + Both will result in: - ```js - export default Ember.Helper.extend({ - compute(params, hash) { - let cents = params[0]; - let currency = hash.currency; - return `${currency}${cents * 0.01}`; - } - }); + ```html + + Great Hamster Photos + ``` - Each time the input to a helper changes, the `compute` function will be - called again. + ### Supplying a tagName + By default `{{link-to}}` renders an `` element. This can + be overridden for a single use of `{{link-to}}` by supplying + a `tagName` option: - As instances, these helpers also have access to the container an will accept - injected dependencies. + ```handlebars + {{#link-to 'photoGallery' tagName="li"}} + Great Hamster Photos + {{/link-to}} + ``` - Additionally, class helpers can call `recompute` to force a new computation. + ```html +
  • + Great Hamster Photos +
  • + ``` - @class Ember.Helper - @public - @since 1.13.0 - */ - var Helper = _emberRuntime.FrameworkObject.extend({ - isHelperInstance: true, - - init: function () { - this._super.apply(this, arguments); - this[RECOMPUTE_TAG] = new _glimmerReference.DirtyableTag(); - }, - - /** - 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 - session service changes: - ```js - // app/helpers/current-user-email.js - export default Ember.Helper.extend({ - session: Ember.inject.service(), - onNewUser: Ember.observer('session.currentUser', function() { - this.recompute(); - }), - compute() { - return this.get('session.currentUser.email'); - } - }); - ``` - @method recompute - @public - @since 1.13.0 - */ - recompute: function () { - this[RECOMPUTE_TAG].dirty(); - } - - /** - Override this function when writing a class-based helper. - @method compute - @param {Array} params The positional arguments to the helper - @param {Object} hash The named arguments to the helper - @public - @since 1.13.0 - */ - }); - - Helper.reopenClass({ - isHelperFactory: true - }); - - /** - In many cases, the ceremony of a full `Ember.Helper` class is not required. - The `helper` method create pure-function helpers without instances. For - example: + To override this option for your entire application, see + "Overriding Application-wide Defaults". - ```js - // app/helpers/format-currency.js - export default Ember.Helper.helper(function(params, hash) { - let cents = params[0]; - let currency = hash.currency; - return `${currency}${cents * 0.01}`; + ### Disabling the `link-to` component + By default `{{link-to}}` is enabled. + any passed value to the `disabled` component property will disable + the `link-to` component. + + static use: the `disabled` option: + + ```handlebars + {{#link-to 'photoGallery' disabled=true}} + Great Hamster Photos + {{/link-to}} + ``` + + dynamic use: the `disabledWhen` option: + + ```handlebars + {{#link-to 'photoGallery' disabledWhen=controller.someProperty}} + Great Hamster Photos + {{/link-to}} + ``` + + any passed value to `disabled` will disable it except `undefined`. + to ensure that only `true` disable the `link-to` component you can + override the global behaviour of `Ember.LinkComponent`. + + ```javascript + Ember.LinkComponent.reopen({ + disabled: Ember.computed(function(key, value) { + if (value !== undefined) { + this.set('_isDisabled', value === true); + } + return value === true ? get(this, 'disabledClass') : false; + }) }); ``` - @static - @param {Function} helper The helper function - @method helper - @public - @since 1.13.0 - */ - - function helper(helperFn) { - return { - isHelperInstance: true, - compute: helperFn - }; - } - - exports.default = Helper; -}); -enifed('ember-glimmer/helpers/-class', ['exports', 'ember-glimmer/utils/references', 'ember-runtime'], function (exports, _emberGlimmerUtilsReferences, _emberRuntime) { - 'use strict'; - - function classHelper(_ref) { - var positional = _ref.positional; - - var path = positional.at(0); - var args = positional.length; - var value = path.value(); - - if (value === true) { - if (args > 1) { - return _emberRuntime.String.dasherize(positional.at(1).value()); - } - return null; - } - - if (value === false) { - if (args > 2) { - return _emberRuntime.String.dasherize(positional.at(2).value()); - } - return null; - } - - return value; - } - - exports.default = function (vm, args) { - return new _emberGlimmerUtilsReferences.InternalHelperReference(classHelper, args); - }; -}); -enifed('ember-glimmer/helpers/-html-safe', ['exports', 'ember-glimmer/utils/references', 'ember-glimmer/utils/string'], function (exports, _emberGlimmerUtilsReferences, _emberGlimmerUtilsString) { - 'use strict'; - - function htmlSafe(_ref) { - var positional = _ref.positional; - - var path = positional.at(0); - return new _emberGlimmerUtilsString.SafeString(path.value()); - } - - exports.default = function (vm, args) { - return new _emberGlimmerUtilsReferences.InternalHelperReference(htmlSafe, args); - }; -}); -enifed('ember-glimmer/helpers/-input-type', ['exports', 'ember-glimmer/utils/references'], function (exports, _emberGlimmerUtilsReferences) { - 'use strict'; - - function inputTypeHelper(_ref) { - var positional = _ref.positional; - var named = _ref.named; - - var type = positional.at(0).value(); - if (type === 'checkbox') { - return '-checkbox'; - } - return '-text-field'; - } - - exports.default = function (vm, args) { - return new _emberGlimmerUtilsReferences.InternalHelperReference(inputTypeHelper, args); - }; -}); -enifed('ember-glimmer/helpers/-normalize-class', ['exports', 'ember-glimmer/utils/references', 'ember-runtime'], function (exports, _emberGlimmerUtilsReferences, _emberRuntime) { - 'use strict'; - - function normalizeClass(_ref) { - var positional = _ref.positional; - var named = _ref.named; - - var classNameParts = positional.at(0).value().split('.'); - var className = classNameParts[classNameParts.length - 1]; - var value = positional.at(1).value(); - - if (value === true) { - return _emberRuntime.String.dasherize(className); - } else if (!value && value !== 0) { - return ''; - } else { - return String(value); - } - } - - exports.default = function (vm, args) { - return new _emberGlimmerUtilsReferences.InternalHelperReference(normalizeClass, args); - }; -}); -enifed('ember-glimmer/helpers/action', ['exports', 'ember-utils', 'ember-metal', 'ember-glimmer/utils/references', 'glimmer-runtime', 'glimmer-reference'], function (exports, _emberUtils, _emberMetal, _emberGlimmerUtilsReferences, _glimmerRuntime, _glimmerReference) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; - - var INVOKE = _emberUtils.symbol('INVOKE'); - exports.INVOKE = INVOKE; - var ACTION = _emberUtils.symbol('ACTION'); - - exports.ACTION = ACTION; - /** - The `{{action}}` helper provides a way to pass triggers for behavior (usually - just a function) between components, and into components from controllers. + see "Overriding Application-wide Defaults" for more. - ### Passing functions with the action helper + ### Handling `href` + `{{link-to}}` will use your application's Router to + fill the element's `href` property with a url that + matches the path to the supplied `routeName` for your + router's configured `Location` scheme, which defaults + to Ember.HashLocation. - There are three contexts an action helper can be used in. The first two - contexts to discuss are attribute context, and Handlebars value context. + ### Handling current route + `{{link-to}}` will apply a CSS class name of 'active' + when the application's current route matches + the supplied routeName. For example, if the application's + current route is 'photoGallery.recent' the following + use of `{{link-to}}`: ```handlebars - {{! An example of attribute context }} -
    - {{! Examples of Handlebars value context }} - {{input on-input=(action "save")}} - {{yield (action "refreshData") andAnotherParam}} + {{#link-to 'photoGallery.recent'}} + Great Hamster Photos + {{/link-to}} ``` - In these contexts, - the helper is called a "closure action" helper. Its behavior is simple: - If passed a function name, read that function off the `actions` property - of the current context. Once that function is read (or if a function was - passed), create a closure over that function and any arguments. - The resulting value of an action helper used this way is simply a function. + will result in - For example, in the attribute context: + ```html +
    + Great Hamster Photos + + ``` + + The CSS class name used for active classes can be customized + for a single use of `{{link-to}}` by passing an `activeClass` + option: ```handlebars - {{! An example of attribute context }} -
    + {{#link-to 'photoGallery.recent' activeClass="current-url"}} + Great Hamster Photos + {{/link-to}} ``` - The resulting template render logic would be: - - ```js - var div = document.createElement('div'); - var actionFunction = (function(context){ - return function() { - return context.actions.save.apply(context, arguments); - }; - })(context); - div.onclick = actionFunction; + ```html + + Great Hamster Photos + ``` - Thus when the div is clicked, the action on that context is called. - Because the `actionFunction` is just a function, closure actions can be - passed between components and still execute in the correct context. + To override this option for your entire application, see + "Overriding Application-wide Defaults". - Here is an example action handler on a component: + ### Keeping a link active for other routes - ```js - export default Ember.Component.extend({ - actions: { - save() { - this.get('model').save(); - } - } - }); + If you need a link to be 'active' even when it doesn't match + the current route, you can use the `current-when` argument. + + ```handlebars + {{#link-to 'photoGallery' current-when='photos'}} + Photo Gallery + {{/link-to}} ``` - Actions are always looked up on the `actions` property of the current context. - This avoids collisions in the naming of common actions, such as `destroy`. - Two options can be passed to the `action` helper when it is used in this way. + This may be helpful for keeping links active for: - * `target=someProperty` will look to `someProperty` instead of the current - context for the `actions` hash. This can be useful when targetting a - service for actions. - * `value="target.value"` will read the path `target.value` off the first - argument to the action when it is called and rewrite the first argument - to be that value. This is useful when attaching actions to event listeners. + * non-nested routes that are logically related + * some secondary menu approaches + * 'top navigation' with 'sub navigation' scenarios - ### Invoking an action + A link will be active if `current-when` is `true` or the current + route is the route this link would transition to. - Closure actions curry both their scope and any arguments. When invoked, any - additional arguments are added to the already curried list. - Actions should be invoked using the [sendAction](/api/classes/Ember.Component.html#method_sendAction) - method. The first argument to `sendAction` is the action to be called, and - additional arguments are passed to the action function. This has interesting - properties combined with currying of arguments. For example: + To match multiple routes 'space-separate' the routes: - ```js - export default Ember.Component.extend({ - actions: { - // Usage {{input on-input=(action (action 'setName' model) value="target.value")}} - setName(model, name) { - model.set('name', name); - } - } - }); + ```handlebars + {{#link-to 'gallery' current-when='photos drawings paintings'}} + Art Gallery + {{/link-to}} ``` - The first argument (`model`) was curried over, and the run-time argument (`event`) - becomes a second argument. Action calls can be nested this way because each simply - returns a function. Any function can be passed to the `{{action}}` helper, including - other actions. - - Actions invoked with `sendAction` have the same currying behavior as demonstrated - with `on-input` above. For example: + ### Supplying a model + An optional model argument can be used for routes whose + paths contain dynamic segments. This argument will become + the model context of the linked route: - ```js - export default Ember.Component.extend({ - actions: { - setName(model, name) { - model.set('name', name); - } - } + ```javascript + Router.map(function() { + this.route("photoGallery", {path: "hamster-photos/:photo_id"}); }); ``` ```handlebars - {{my-input submit=(action 'setName' model)}} + {{#link-to 'photoGallery' aPhoto}} + {{aPhoto.title}} + {{/link-to}} ``` - ```js - // app/components/my-component.js - export default Ember.Component.extend({ - click() { - // Note that model is not passed, it was curried in the template - this.sendAction('submit', 'bob'); - } - }); + ```html + + Tomster + ``` - ### Attaching actions to DOM elements + ### Supplying multiple models + For deep-linking to route paths that contain multiple + dynamic segments, multiple model arguments can be used. + As the router transitions through the route path, each + supplied model argument will become the context for the + route with the dynamic segments: - The third context of the `{{action}}` helper can be called "element space". - For example: + ```javascript + Router.map(function() { + this.route("photoGallery", { path: "hamster-photos/:photo_id" }, function() { + this.route("comment", {path: "comments/:comment_id"}); + }); + }); + ``` + This argument will become the model context of the linked route: ```handlebars - {{! An example of element space }} -
    + {{#link-to 'photoGallery.comment' aPhoto comment}} + {{comment.body}} + {{/link-to}} ``` - Used this way, the `{{action}}` helper provides a useful shortcut for - registering an HTML element in a template for a single DOM event and - forwarding that interaction to the template's context (controller or component). - If the context of a template is a controller, actions used this way will - bubble to routes when the controller does not implement the specified action. - Once an action hits a route, it will bubble through the route hierarchy. - - ### Event Propagation - - `{{action}}` helpers called in element space can control event bubbling. Note - that the closure style actions cannot. - - Events triggered through the action helper will automatically have - `.preventDefault()` called on them. You do not need to do so in your event - handlers. If you need to allow event propagation (to handle file inputs for - example) you can supply the `preventDefault=false` option to the `{{action}}` helper: - - ```handlebars -
    - - -
    + ```html + + A+++ would snuggle again. + ``` - To disable bubbling, pass `bubbles=false` to the helper: + ### Supplying an explicit dynamic segment value + If you don't have a model object available to pass to `{{link-to}}`, + an optional string or integer argument can be passed for routes whose + paths contain dynamic segments. This argument will become the value + of the dynamic segment: - ```handlebars - + ```javascript + Router.map(function() { + this.route("photoGallery", { path: "hamster-photos/:photo_id" }); + }); ``` - To disable bubbling with closure style actions you must create your own - wrapper helper that makes use of `event.stopPropagation()`: - ```handlebars -
    Hello
    + {{#link-to 'photoGallery' aPhotoId}} + {{aPhoto.title}} + {{/link-to}} ``` - ```js - // app/helpers/disable-bubbling.js - import Ember from 'ember'; - export function disableBubbling([action]) { - return function(event) { - event.stopPropagation(); - return action(event); - }; - } - export default Ember.Helper.helper(disableBubbling); + ```html + + Tomster + ``` - If you need the default handler to trigger you should either register your - own event handler, or use event methods on your view class. See - ["Responding to Browser Events"](/api/classes/Ember.View.html#toc_responding-to-browser-events) - in the documentation for Ember.View for more information. - - ### Specifying DOM event type - - `{{action}}` helpers called in element space can specify an event type. - By default the `{{action}}` helper registers for DOM `click` events. You can - supply an `on` option to the helper to specify a different DOM event name: - - ```handlebars -
    - click me -
    - ``` + When transitioning into the linked route, the `model` hook will + be triggered with parameters including this passed identifier. - See ["Event Names"](/api/classes/Ember.View.html#toc_event-names) for a list of - acceptable DOM event names. + ### Allowing Default Action - ### Specifying whitelisted modifier keys + By default the `{{link-to}}` component prevents the default browser action + by calling `preventDefault()` as this sort of action bubbling is normally + handled internally and we do not want to take the browser to a new URL (for + example). - `{{action}}` helpers called in element space can specify modifier keys. - By default the `{{action}}` helper will ignore click events with pressed modifier - keys. You can supply an `allowedKeys` option to specify which keys should not be ignored. + If you need to override this behavior specify `preventDefault=false` in + your template: ```handlebars -
    - click me -
    + {{#link-to 'photoGallery' aPhotoId preventDefault=false}} + {{aPhotoId.title}} + {{/link-to}} ``` - This way the action will fire when clicking with the alt key pressed down. - Alternatively, supply "any" to the `allowedKeys` option to accept any combination of modifier keys. + ### Overriding attributes + You can override any given property of the `Ember.LinkComponent` + that is generated by the `{{link-to}}` component by passing + key/value pairs, like so: ```handlebars -
    - click me with any key pressed -
    + {{#link-to aPhoto tagName='li' title='Following this link will change your life' classNames='pic sweet'}} + Uh-mazing! + {{/link-to}} ``` - ### Specifying a Target + See [Ember.LinkComponent](/api/classes/Ember.LinkComponent.html) for a + complete list of overrideable properties. Be sure to also + check out inherited properties of `LinkComponent`. - A `target` option can be provided to the helper to change - which object will receive the method call. This option must be a path - to an object, accessible in the current context: + ### Overriding Application-wide Defaults + ``{{link-to}}`` creates an instance of `Ember.LinkComponent` + for rendering. To override options for your entire + application, reopen `Ember.LinkComponent` and supply the + desired values: - ```handlebars - {{! app/templates/application.hbs }} -
    - click me -
    + ``` javascript + Ember.LinkComponent.reopen({ + activeClass: "is-active", + tagName: 'li' + }) ``` - ```javascript - // app/controllers/application.js - export default Ember.Controller.extend({ - someService: Ember.inject.service() + It is also possible to override the default event in + this manner: + + ``` javascript + Ember.LinkComponent.reopen({ + eventName: 'customEventName' }); ``` - @method action + @method link-to @for Ember.Templates.helpers + @param {String} routeName + @param {Object} [context]* + @param [options] {Object} Handlebars key/value pairs of options, you can override any property of Ember.LinkComponent + @return {String} HTML string + @see {Ember.LinkComponent} @public */ - exports.default = function (vm, args) { - var named = args.named; - var positional = args.positional; - - // The first two argument slots are reserved. - // pos[0] is the context (or `this`) - // pos[1] is the action name or function - // Anything else is an action argument. - var context = positional.at(0); - var action = positional.at(1); + 'use strict'; - // TODO: Is there a better way of doing this? - var debugKey = action._propertyKey; + /** + `Ember.LinkComponent` renders an element whose `click` event triggers a + transition of the application's instance of `Ember.Router` to + a supplied route by name. + + `Ember.LinkComponent` components are invoked with {{#link-to}}. Properties + of this class can be overridden with `reopen` to customize application-wide + behavior. + + @class LinkComponent + @namespace Ember + @extends Ember.Component + @see {Ember.Templates.helpers.link-to} + @public + **/ + var LinkComponent = _emberGlimmerComponent.default.extend({ + layout: _emberGlimmerTemplatesLinkTo.default, - var restArgs = undefined; + tagName: 'a', - if (positional.length === 2) { - restArgs = _glimmerRuntime.EvaluatedPositionalArgs.empty(); - } else { - restArgs = _glimmerRuntime.EvaluatedPositionalArgs.create(positional.values.slice(2)); - } + /** + @deprecated Use current-when instead. + @property currentWhen + @private + */ + currentWhen: _emberRuntime.deprecatingAlias('current-when', { id: 'ember-routing-view.deprecated-current-when', until: '3.0.0' }), - var target = named.has('target') ? named.get('target') : context; - var processArgs = makeArgsProcessor(named.has('value') && named.get('value'), restArgs); + /** + Used to determine when this `LinkComponent` is active. + @property currentWhen + @public + */ + 'current-when': null, - var fn = undefined; + /** + Sets the `title` attribute of the `LinkComponent`'s HTML element. + @property title + @default null + @public + **/ + title: null, - if (typeof action[INVOKE] === 'function') { - fn = makeClosureAction(action, action, action[INVOKE], processArgs, debugKey); - } else if (_glimmerReference.isConst(target) && _glimmerReference.isConst(action)) { - fn = makeClosureAction(context.value(), target.value(), action.value(), processArgs, debugKey); - } else { - fn = makeDynamicClosureAction(context.value(), target, action, processArgs, debugKey); - } + /** + Sets the `rel` attribute of the `LinkComponent`'s HTML element. + @property rel + @default null + @public + **/ + rel: null, - fn[ACTION] = true; + /** + Sets the `tabindex` attribute of the `LinkComponent`'s HTML element. + @property tabindex + @default null + @public + **/ + tabindex: null, - return new _emberGlimmerUtilsReferences.UnboundReference(fn); - }; + /** + Sets the `target` attribute of the `LinkComponent`'s HTML element. + @since 1.8.0 + @property target + @default null + @public + **/ + target: null, - function NOOP(args) { - return args; - } + /** + The CSS class to apply to `LinkComponent`'s element when its `active` + property is `true`. + @property activeClass + @type String + @default active + @public + **/ + activeClass: 'active', - function makeArgsProcessor(valuePathRef, actionArgsRef) { - var mergeArgs = null; + /** + The CSS class to apply to `LinkComponent`'s element when its `loading` + property is `true`. + @property loadingClass + @type String + @default loading + @private + **/ + loadingClass: 'loading', - if (actionArgsRef.length > 0) { - mergeArgs = function (args) { - return actionArgsRef.value().concat(args); - }; - } - - var readValue = null; - - if (valuePathRef) { - readValue = function (args) { - var valuePath = valuePathRef.value(); + /** + The CSS class to apply to a `LinkComponent`'s element when its `disabled` + property is `true`. + @property disabledClass + @type String + @default disabled + @private + **/ + disabledClass: 'disabled', + _isDisabled: false, - if (valuePath && args.length > 0) { - args[0] = _emberMetal.get(args[0], valuePath); - } + /** + Determines whether the `LinkComponent` will trigger routing via + the `replaceWith` routing strategy. + @property replace + @type Boolean + @default false + @public + **/ + replace: false, - return args; - }; - } + /** + By default the `{{link-to}}` component 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'] + @public + */ + attributeBindings: ['href', 'title', 'rel', 'tabindex', 'target'], - if (mergeArgs && readValue) { - return function (args) { - return readValue(mergeArgs(args)); - }; - } else { - return mergeArgs || readValue || NOOP; - } - } + /** + By default the `{{link-to}}` component will bind to the `active`, `loading`, + and `disabled` classes. It is discouraged to override these directly. + @property classNameBindings + @type Array + @default ['active', 'loading', 'disabled', 'ember-transitioning-in', 'ember-transitioning-out'] + @public + */ + classNameBindings: ['active', 'loading', 'disabled', 'transitioningIn', 'transitioningOut'], - function makeDynamicClosureAction(context, targetRef, actionRef, processArgs, debugKey) { - // We don't allow undefined/null values, so this creates a throw-away action to trigger the assertions - _emberMetal.runInDebug(function () { - makeClosureAction(context, targetRef.value(), actionRef.value(), processArgs, debugKey); - }); + /** + By default the `{{link-to}}` component responds to the `click` event. You + can override this globally by setting this property to your custom + event name. + This is particularly useful on mobile when one wants to avoid the 300ms + click delay using some sort of custom `tap` event. + @property eventName + @type String + @default click + @private + */ + eventName: 'click', - return function () { - return makeClosureAction(context, targetRef.value(), actionRef.value(), processArgs, debugKey).apply(undefined, arguments); - }; - } + // this is doc'ed here so it shows up in the events + // section of the API documentation, which is where + // people will likely go looking for it. + /** + Triggers the `LinkComponent`'s routing behavior. If + `eventName` is changed to a value other than `click` + the routing behavior will trigger on that custom event + instead. + @event click + @private + */ - function makeClosureAction(context, target, action, processArgs, debugKey) { - var self = undefined, - fn = undefined; + /** + An overridable method called when `LinkComponent` objects are instantiated. + Example: + ```javascript + App.MyLinkComponent = Ember.LinkComponent.extend({ + init: function() { + this._super(...arguments); + Ember.Logger.log('Event is ' + this.get('eventName')); + } + }); + ``` + NOTE: If you do override `init` for a framework class like `Ember.View`, + be sure to call `this._super(...arguments)` in your + `init` declaration! If you don't, Ember may not have an opportunity to + do important setup work, and you'll see strange behavior in your + application. + @method init + @private + */ + init: function () { + this._super.apply(this, arguments); - _emberMetal.assert('Action passed is null or undefined in (action) from ' + target + '.', !_emberMetal.isNone(action)); + // Map desired event name to invoke function + var eventName = _emberMetal.get(this, 'eventName'); + this.on(eventName, this, this._invoke); + }, - if (typeof action[INVOKE] === 'function') { - self = action; - fn = action[INVOKE]; - } else { - var typeofAction = typeof action; + _routing: _emberRuntime.inject.service('-routing'), - if (typeofAction === 'string') { - self = target; - fn = target.actions && target.actions[action]; + /** + Accessed as a classname binding to apply the `LinkComponent`'s `disabledClass` + CSS `class` to the element when the link is disabled. + When `true` interactions with the element will not trigger route changes. + @property disabled + @private + */ + disabled: _emberMetal.computed({ + get: function (key, value) { + return false; + }, + set: function (key, value) { + if (value !== undefined) { + this.set('_isDisabled', value); + } - _emberMetal.assert('An action named \'' + action + '\' was not found in ' + target, fn); - } else if (typeofAction === 'function') { - self = context; - fn = action; - } else { - _emberMetal.assert('An action could not be made for `' + (debugKey || action) + '` in ' + target + '. Please confirm that you are using either a quoted action name (i.e. `(action \'' + (debugKey || 'myAction') + '\')`) or a function available in ' + target + '.', false); + return value ? _emberMetal.get(this, 'disabledClass') : false; } - } + }), - return function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; + _computeActive: function (routerState) { + if (_emberMetal.get(this, 'loading')) { + return false; } - var payload = { target: self, args: args, label: 'glimmer-closure-action' }; - return _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { - return _emberMetal.run.join.apply(_emberMetal.run, [self, fn].concat(processArgs(args))); - }); - }; - } -}); -enifed('ember-glimmer/helpers/component', ['exports', 'ember-utils', 'ember-glimmer/utils/references', 'ember-glimmer/syntax/curly-component', 'glimmer-runtime', 'ember-metal'], function (exports, _emberUtils, _emberGlimmerUtilsReferences, _emberGlimmerSyntaxCurlyComponent, _glimmerRuntime, _emberMetal) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; + var routing = _emberMetal.get(this, '_routing'); + var models = _emberMetal.get(this, 'models'); + var resolvedQueryParams = _emberMetal.get(this, 'resolvedQueryParams'); - /** - 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. - `{{component}}`'s primary use is for cases where you want to dynamically - change which type of component is rendered as the state of your application - changes. The provided block will be applied as the template for the component. - Given an empty `` the following template: - - ```handlebars - {{! application.hbs }} - {{component infographicComponentName}} - ``` - - And the following application code: - - ```javascript - export default Ember.Controller.extend({ - infographicComponentName: computed('isMarketOpen', { - get() { - if (this.get('isMarketOpen')) { - return 'live-updating-chart'; - } else { - return 'market-close-summary'; - } + var currentWhen = _emberMetal.get(this, 'current-when'); + var isCurrentWhenSpecified = !!currentWhen; + currentWhen = currentWhen || _emberMetal.get(this, 'qualifiedRouteName'); + currentWhen = currentWhen.split(' '); + + for (var i = 0; i < currentWhen.length; i++) { + if (routing.isActiveForRoute(models, resolvedQueryParams, currentWhen[i], routerState, isCurrentWhenSpecified)) { + return _emberMetal.get(this, 'activeClass'); } - }) - }); - ``` - - The `live-updating-chart` component will be appended when `isMarketOpen` is - `true`, and the `market-close-summary` component will be appended when - `isMarketOpen` is `false`. If the value changes while the app is running, - the component will be automatically swapped out accordingly. - Note: You should not use this helper when you are consistently rendering the same - component. In that case, use standard component syntax, for example: - - ```handlebars - {{! application.hbs }} - {{live-updating-chart}} - ``` - - ## Nested Usage - - The `component` helper can be used to package a component path with initial attrs. - The included attrs can then be merged during the final invocation. - For example, given a `person-form` component with the following template: - - ```handlebars - {{yield (hash - nameInput=(component "my-input-component" value=model.name placeholder="First Name"))}} - ``` - - The following snippet: - - ``` - {{#person-form as |form|}} - {{component form.nameInput placeholder="Username"}} - {{/person-form}} - ``` - - would output an input whose value is already bound to `model.name` and `placeholder` - is "Username". - - @method component - @since 1.11.0 - @for Ember.Templates.helpers - @public - */ + } - var ClosureComponentReference = (function (_CachedReference) { - babelHelpers.inherits(ClosureComponentReference, _CachedReference); + return false; + }, - ClosureComponentReference.create = function create(args, symbolTable, env) { - return new ClosureComponentReference(args, symbolTable, env); - }; + /** + Accessed as a classname binding to apply the `LinkComponent`'s `activeClass` + CSS `class` to the element when the link is active. + A `LinkComponent` is considered active when its `currentWhen` property is `true` + or the application's current route is the route the `LinkComponent` would trigger + transitions into. + The `currentWhen` property can match against multiple routes by separating + route names using the ` ` (space) character. + @property active + @private + */ + active: _emberMetal.computed('attrs.params', '_routing.currentState', function computeLinkToComponentActive() { + var currentState = _emberMetal.get(this, '_routing.currentState'); + if (!currentState) { + return false; + } - function ClosureComponentReference(args, symbolTable, env) { - babelHelpers.classCallCheck(this, ClosureComponentReference); + return this._computeActive(currentState); + }), - _CachedReference.call(this); - this.defRef = args.positional.at(0); - this.env = env; - this.tag = args.positional.at(0).tag; - this.symbolTable = symbolTable; - this.args = args; - this.lastDefinition = undefined; - this.lastName = undefined; - } + willBeActive: _emberMetal.computed('_routing.targetState', function computeLinkToComponentWillBeActive() { + var routing = _emberMetal.get(this, '_routing'); + var targetState = _emberMetal.get(routing, 'targetState'); + if (_emberMetal.get(routing, 'currentState') === targetState) { + return; + } - ClosureComponentReference.prototype.compute = function compute() { - // TODO: Figure out how to extract this because it's nearly identical to - // DynamicComponentReference::compute(). The only differences besides - // currying are in the assertion messages. - var args = this.args; - var defRef = this.defRef; - var env = this.env; - var symbolTable = this.symbolTable; - var lastDefinition = this.lastDefinition; - var lastName = this.lastName; + return !!this._computeActive(targetState); + }), - var nameOrDef = defRef.value(); - var definition = null; + transitioningIn: _emberMetal.computed('active', 'willBeActive', function computeLinkToComponentTransitioningIn() { + var willBeActive = _emberMetal.get(this, 'willBeActive'); + if (typeof willBeActive === 'undefined') { + return false; + } - if (nameOrDef && nameOrDef === lastName) { - return lastDefinition; + return !_emberMetal.get(this, 'active') && willBeActive && 'ember-transitioning-in'; + }), + + transitioningOut: _emberMetal.computed('active', 'willBeActive', function computeLinkToComponentTransitioningOut() { + var willBeActive = _emberMetal.get(this, 'willBeActive'); + if (typeof willBeActive === 'undefined') { + return false; } - this.lastName = nameOrDef; + return _emberMetal.get(this, 'active') && !willBeActive && 'ember-transitioning-out'; + }), - if (typeof nameOrDef === 'string') { - definition = env.getComponentDefinition([nameOrDef], symbolTable); - _emberMetal.assert('The component helper cannot be used without a valid component name. You used "' + nameOrDef + '" via (component "' + nameOrDef + '")', definition); - } else if (_glimmerRuntime.isComponentDefinition(nameOrDef)) { - definition = nameOrDef; - } else { - _emberMetal.assert('You cannot create a component from ' + nameOrDef + ' using the {{component}} helper', nameOrDef); - return null; + /** + Event handler that invokes the link, activating the associated route. + @method _invoke + @param {Event} event + @private + */ + _invoke: function (event) { + if (!_emberViews.isSimpleClick(event)) { + return true; } - var newDef = createCurriedDefinition(definition, args); + var preventDefault = _emberMetal.get(this, 'preventDefault'); + var targetAttribute = _emberMetal.get(this, 'target'); - this.lastDefinition = newDef; + if (preventDefault !== false) { + if (!targetAttribute || targetAttribute === '_self') { + event.preventDefault(); + } + } - return newDef; - }; + if (_emberMetal.get(this, 'bubbles') === false) { + event.stopPropagation(); + } - return ClosureComponentReference; - })(_emberGlimmerUtilsReferences.CachedReference); + if (_emberMetal.get(this, '_isDisabled')) { + return false; + } - exports.ClosureComponentReference = ClosureComponentReference; + if (_emberMetal.get(this, 'loading')) { + _emberConsole.default.warn('This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid.'); + return false; + } - function createCurriedDefinition(definition, args) { - var curriedArgs = curryArgs(definition, args); + if (targetAttribute && targetAttribute !== '_self') { + return false; + } - return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentDefinition(definition.name, definition.ComponentClass, definition.template, curriedArgs); - } + var qualifiedRouteName = _emberMetal.get(this, 'qualifiedRouteName'); + var models = _emberMetal.get(this, 'models'); + var queryParams = _emberMetal.get(this, 'queryParams.values'); + var shouldReplace = _emberMetal.get(this, 'replace'); - function curryArgs(definition, newArgs) { - var args = definition.args; - var ComponentClass = definition.ComponentClass; - var positionalParams = ComponentClass.positionalParams; + var payload = { + queryParams: queryParams, + routeName: qualifiedRouteName + }; - // The args being passed in are from the (component ...) invocation, - // so the first positional argument is actually the name or component - // definition. It needs to be dropped in order for any actual positional - // args to coincide with the ComponentClass's positionParams. + _emberMetal.flaggedInstrument('interaction.link-to', payload, this._generateTransition(payload, qualifiedRouteName, models, queryParams, shouldReplace)); + }, - // For "normal" curly components this slicing is done at the syntax layer, - // but we don't have that luxury here. + _generateTransition: function (payload, qualifiedRouteName, models, queryParams, shouldReplace) { + var routing = _emberMetal.get(this, '_routing'); + return function () { + payload.transition = routing.transitionTo(qualifiedRouteName, models, queryParams, shouldReplace); + }; + }, - var _newArgs$positional$values = newArgs.positional.values; + queryParams: null, - var slicedPositionalArgs = _newArgs$positional$values.slice(1); + qualifiedRouteName: _emberMetal.computed('targetRouteName', '_routing.currentState', function computeLinkToComponentQualifiedRouteName() { + var params = _emberMetal.get(this, 'params').slice(); + var lastParam = params[params.length - 1]; + if (lastParam && lastParam.isQueryParams) { + params.pop(); + } + var onlyQueryParamsSupplied = this[_emberGlimmerComponent.HAS_BLOCK] ? params.length === 0 : params.length === 1; + if (onlyQueryParamsSupplied) { + return _emberMetal.get(this, '_routing.currentRouteName'); + } + return _emberMetal.get(this, 'targetRouteName'); + }), - if (positionalParams && slicedPositionalArgs.length) { - _emberGlimmerSyntaxCurlyComponent.validatePositionalParameters(newArgs.named, slicedPositionalArgs, positionalParams); - } + resolvedQueryParams: _emberMetal.computed('queryParams', function computeLinkToComponentResolvedQueryParams() { + var resolvedQueryParams = {}; + var queryParams = _emberMetal.get(this, 'queryParams'); - var isRest = typeof positionalParams === 'string'; + if (!queryParams) { + return resolvedQueryParams; + } - // For non-rest position params, we need to perform the position -> name mapping - // at each layer to avoid a collision later when the args are used to construct - // the component instance (inside of processArgs(), inside of create()). - var positionalToNamedParams = {}; + var values = queryParams.values; + for (var key in values) { + if (!values.hasOwnProperty(key)) { + continue; + } + resolvedQueryParams[key] = values[key]; + } - if (!isRest && positionalParams && positionalParams.length > 0) { - var limit = Math.min(positionalParams.length, slicedPositionalArgs.length); + return resolvedQueryParams; + }), - for (var i = 0; i < limit; i++) { - var _name = positionalParams[i]; - positionalToNamedParams[_name] = slicedPositionalArgs[i]; + /** + Sets the element's `href` attribute to the url for + the `LinkComponent`'s targeted route. + If the `LinkComponent`'s `tagName` is changed to a value other + than `a`, this property will be ignored. + @property href + @private + */ + href: _emberMetal.computed('models', 'qualifiedRouteName', function computeLinkToComponentHref() { + if (_emberMetal.get(this, 'tagName') !== 'a') { + return; } - slicedPositionalArgs.length = 0; // Throw them away since you're merged in. - } + var qualifiedRouteName = _emberMetal.get(this, 'qualifiedRouteName'); + var models = _emberMetal.get(this, 'models'); - // args (aka 'oldArgs') may be undefined or simply be empty args, so - // we need to fall back to an empty array or object. - var oldNamed = args && args.named && args.named.map || {}; - var oldPositional = args && args.positional && args.positional.values || []; + if (_emberMetal.get(this, 'loading')) { + return _emberMetal.get(this, 'loadingHref'); + } - // Merge positional arrays - var mergedPositional = new Array(Math.max(oldPositional.length, slicedPositionalArgs.length)); - mergedPositional.splice.apply(mergedPositional, [0, oldPositional.length].concat(oldPositional)); - mergedPositional.splice.apply(mergedPositional, [0, slicedPositionalArgs.length].concat(slicedPositionalArgs)); + var routing = _emberMetal.get(this, '_routing'); + var queryParams = _emberMetal.get(this, 'queryParams.values'); - // Merge named maps - var mergedNamed = _emberUtils.assign({}, oldNamed, positionalToNamedParams, newArgs.named.map); + _emberMetal.runInDebug(function () { + /* + * Unfortunately, to get decent error messages, we need to do this. + * In some future state we should be able to use a "feature flag" + * which allows us to strip this without needing to call it twice. + * + * if (isDebugBuild()) { + * // Do the useful debug thing, probably including try/catch. + * } else { + * // Do the performant thing. + * } + */ + try { + routing.generateURL(qualifiedRouteName, models, queryParams); + } catch (e) { + _emberMetal.assert('You attempted to define a `{{link-to "' + qualifiedRouteName + '"}}` but did not pass the parameters required for generating its dynamic segments. ' + e.message); + } + }); - var mergedArgs = _glimmerRuntime.EvaluatedArgs.create(_glimmerRuntime.EvaluatedPositionalArgs.create(mergedPositional), _glimmerRuntime.EvaluatedNamedArgs.create(mergedNamed), _glimmerRuntime.Blocks.empty()); + return routing.generateURL(qualifiedRouteName, models, queryParams); + }), - return mergedArgs; - } + loading: _emberMetal.computed('_modelsAreLoaded', 'qualifiedRouteName', function computeLinkToComponentLoading() { + var qualifiedRouteName = _emberMetal.get(this, 'qualifiedRouteName'); + var modelsAreLoaded = _emberMetal.get(this, '_modelsAreLoaded'); - exports.default = function (vm, args, symbolTable) { - return ClosureComponentReference.create(args, symbolTable, vm.env); - }; -}); -enifed('ember-glimmer/helpers/concat', ['exports', 'ember-glimmer/utils/references', 'glimmer-runtime'], function (exports, _emberGlimmerUtilsReferences, _glimmerRuntime) { - 'use strict'; + if (!modelsAreLoaded || qualifiedRouteName == null) { + return _emberMetal.get(this, 'loadingClass'); + } + }), - /** - @module ember - @submodule ember-glimmer - */ + _modelsAreLoaded: _emberMetal.computed('models', function computeLinkToComponentModelsAreLoaded() { + var models = _emberMetal.get(this, 'models'); + for (var i = 0; i < models.length; i++) { + if (models[i] == null) { + return false; + } + } - /** - Concatenates the given arguments into a string. - - Example: - - ```handlebars - {{some-component name=(concat firstName " " lastName)}} - - {{! would pass name=" " to the component}} - ``` - - @public - @method concat - @for Ember.Templates.helpers - @since 1.13.0 - */ - function concat(_ref) { - var positional = _ref.positional; + return true; + }), - return positional.value().map(_glimmerRuntime.normalizeTextValue).join(''); - } + _getModels: function (params) { + var modelCount = params.length - 1; + var models = new Array(modelCount); - exports.default = function (vm, args) { - return new _emberGlimmerUtilsReferences.InternalHelperReference(concat, args); - }; -}); -enifed('ember-glimmer/helpers/debugger', ['exports', 'ember-metal/debug', 'glimmer-runtime'], function (exports, _emberMetalDebug, _glimmerRuntime) { - /*jshint debug:true*/ + for (var i = 0; i < modelCount; i++) { + var value = params[i + 1]; - /** - @module ember - @submodule ember-htmlbars - */ + while (_emberRuntime.ControllerMixin.detect(value)) { + _emberMetal.deprecate('Providing `{{link-to}}` with a param that is wrapped in a controller is deprecated. ' + (this.parentView ? 'Please update `' + this.parentView + '` to use `{{link-to "post" someController.model}}` instead.' : ''), false, { id: 'ember-routing-views.controller-wrapped-param', until: '3.0.0' }); + value = value.get('model'); + } - 'use strict'; + models[i] = value; + } - exports.default = debuggerHelper; - exports.setDebuggerCallback = setDebuggerCallback; - exports.resetDebuggerCallback = resetDebuggerCallback; + return models; + }, - /** - Execute the `debugger` statement in the current template's context. - - ```handlebars - {{debugger}} - ``` - - When using the debugger helper you will have access to a `get` function. This - function retrieves values available in the context of the template. - For example, if you're wondering why a value `{{foo}}` isn't rendering as - expected within a template, you could place a `{{debugger}}` statement and, - when the `debugger;` breakpoint is hit, you can attempt to retrieve this value: - - ``` - > get('foo') - ``` - - `get` is also aware of block variables. So in this situation - - ```handlebars - {{#each items as |item|}} - {{debugger}} - {{/each}} - ``` - - You'll be able to get values from the current item: - - ``` - > get('item.name') - ``` - - You can also access the context of the view to make sure it is the object that - you expect: - - ``` - > context - ``` - - @method debugger - @for Ember.Templates.helpers - @public - */ - function defaultCallback(context, get) { - /* jshint debug: true */ + /** + The default href value to use while a link-to is loading. + Only applies when tagName is 'a' + @property loadingHref + @type String + @default # + @private + */ + loadingHref: '#', - _emberMetalDebug.info('Use `context`, and `get()` to debug this template.'); + didReceiveAttrs: function () { + var queryParams = undefined; - debugger; - } + var params = _emberMetal.get(this, 'params'); - var callback = defaultCallback; + if (params) { + // Do not mutate params in place + params = params.slice(); + } - function debuggerHelper(vm, args, symbolTable) { - var context = vm.getSelf().value(); + _emberMetal.assert('You must provide one or more parameters to the link-to component.', (function () { + if (!params) { + return false; + } - // Note: this is totally an overkill since we are only compiling - // expressions, but this is the only kind of SymbolLookup we can - // construct. The symbol table itself should really be sufficient - // here – we should refactor the Glimmer code to make that possible. - var symbolLookup = new _glimmerRuntime.CompileIntoList(vm.env, symbolTable); + return params.length; + })()); - function get(path) { - // Problem: technically, we are getting a `PublicVM` here, but to - // evaluate an expression it requires the full VM. We happen to know - // that they are the same thing, so this would work for now. However - // this might break in the future. - return _glimmerRuntime.GetSyntax.build(path).compile(symbolLookup).evaluate(vm).value(); - } + var disabledWhen = _emberMetal.get(this, 'disabledWhen'); + if (disabledWhen !== undefined) { + this.set('disabled', disabledWhen); + } - callback(context, get); + // Process the positional arguments, in order. + // 1. Inline link title comes first, if present. + if (!this[_emberGlimmerComponent.HAS_BLOCK]) { + this.set('linkTitle', params.shift()); + } - return _glimmerRuntime.UNDEFINED_REFERENCE; - } + // 2. `targetRouteName` is now always at index 0. + this.set('targetRouteName', params[0]); - // These are exported for testing + // 3. The last argument (if still remaining) is the `queryParams` object. + var lastParam = params[params.length - 1]; - function setDebuggerCallback(newCallback) { - callback = newCallback; - } + if (lastParam && lastParam.isQueryParams) { + queryParams = params.pop(); + } else { + queryParams = { values: {} }; + } + this.set('queryParams', queryParams); - function resetDebuggerCallback() { - callback = defaultCallback; - } + // 4. Any remaining indices (excepting `targetRouteName` at 0) are `models`. + if (params.length > 1) { + this.set('models', this._getModels(params)); + } else { + this.set('models', []); + } + } + }); + + LinkComponent.toString = function () { + return 'LinkComponent'; + }; + + LinkComponent.reopenClass({ + positionalParams: 'params' + }); + + exports.default = LinkComponent; }); -enifed('ember-glimmer/helpers/each-in', ['exports', 'ember-utils'], function (exports, _emberUtils) { +enifed('ember-glimmer/components/text_area', ['exports', 'ember-glimmer/component', 'ember-views', 'ember-glimmer/templates/empty'], function (exports, _emberGlimmerComponent, _emberViews, _emberGlimmerTemplatesEmpty) { /** @module ember @submodule ember-glimmer */ 'use strict'; - exports.isEachIn = isEachIn; - /** - The `{{#each}}` helper loops over elements in a collection. It is an extension - of the base Handlebars `{{#each}}` helper. - The default behavior of `{{#each}}` is to yield its inner block once for every - item in an array passing the item as the first block parameter. + `{{textarea}}` inserts a new instance of ` ``` - ### Specifying Keys + Bound: - The `key` option is used to tell Ember how to determine if the array being - iterated over with `{{#each}}` has changed between renders. By helping Ember - detect that some elements in the array are the same, DOM elements can be - re-used, significantly improving rendering speed. + In the following example, the `writtenWords` property on `App.ApplicationController` + will be updated live as the user types 'Lots of text that IS bound' into + the text area of their browser's window. - For example, here's the `{{#each}}` helper with its `key` set to `id`: + ```javascript + App.ApplicationController = Ember.Controller.extend({ + writtenWords: "Lots of text that IS bound" + }); + ``` ```handlebars - {{#each model key="id" as |item|}} - {{/each}} + {{textarea value=writtenWords}} ``` - When this `{{#each}}` re-renders, Ember will match up the previously rendered - items (and reorder the generated DOM elements) based on each item's `id` - property. - By default the item's own reference is used. + Would result in the following HTML: - ### {{else}} condition + ```html + + ``` - `{{#each}}` can have a matching `{{else}}`. The contents of this block will render - if the collection is empty. + If you wanted a one way binding between the text area and a div tag + somewhere else on your screen, you could use `Ember.computed.oneWay`: + + ```javascript + App.ApplicationController = Ember.Controller.extend({ + writtenWords: "Lots of text that IS bound", + outputWrittenWords: Ember.computed.oneWay("writtenWords") + }); + ``` ```handlebars - {{#each developers as |person|}} - {{person.name}} - {{else}} -

    Sorry, nobody is available for this task.

    - {{/each}} + {{textarea value=writtenWords}} +
    + {{outputWrittenWords}} +
    ``` - @method each - @for Ember.Templates.helpers - @public - */ - - /** - The `{{each-in}}` helper loops over properties on an object. + Would result in the following HTML: - For example, given a `user` object that looks like: + ```html + + <-- the following div will be updated in real time as you type --> +
    + Lots of text that IS bound +
    + ``` + + Finally, this example really shows the power and ease of Ember when two + properties are bound to eachother via `Ember.computed.alias`. Type into + either text area box and they'll both stay in sync. Note that + `Ember.computed.alias` costs more in terms of performance, so only use it when + your really binding in both directions: ```javascript - { - "name": "Shelly Sails", - "age": 42 - } + App.ApplicationController = Ember.Controller.extend({ + writtenWords: "Lots of text that IS bound", + twoWayWrittenWords: Ember.computed.alias("writtenWords") + }); ``` - This template would display all properties on the `user` - object in a list: - ```handlebars -
      - {{#each-in user as |key value|}} -
    • {{key}}: {{value}}
    • - {{/each-in}} -
    + {{textarea value=writtenWords}} + {{textarea value=twoWayWrittenWords}} ``` - Outputting their name and age. + ```html + + <-- both updated in real time --> + + ``` - @method each-in - @for Ember.Templates.helpers - @public - @since 2.1.0 - */ - var EACH_IN_REFERENCE = _emberUtils.symbol('EACH_IN'); - - function isEachIn(ref) { - return ref && ref[EACH_IN_REFERENCE]; - } - - exports.default = function (vm, args) { - var ref = Object.create(args.positional.at(0)); - ref[EACH_IN_REFERENCE] = true; - return ref; - }; -}); -enifed('ember-glimmer/helpers/get', ['exports', 'ember-metal', 'ember-glimmer/utils/references', 'glimmer-reference'], function (exports, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference) { - 'use strict'; - - /** - @module ember - @submodule ember-glimmer - */ - - /** - Dynamically look up a property on an object. The second argument to `{{get}}` - should have a string value, although it can be bound. + ### Actions - For example, these two usages are equivilent: + The helper can send multiple actions based on user events. + The action property defines the action which is send when + the user presses the return key. ```handlebars - {{person.height}} - {{get person "height"}} + {{input action="submit"}} ``` - If there were several facts about a person, the `{{get}}` helper can dynamically - pick one: + The helper allows some user events to send actions. - ```handlebars - {{get person factName}} - ``` + * `enter` + * `insert-newline` + * `escape-press` + * `focus-in` + * `focus-out` + * `key-press` - For a more complex example, this template would allow the user to switch - between showing the user's height and weight with a click: + For example, if you desire an action to be sent when the input is blurred, + you only need to setup the action name to the event name property. ```handlebars - {{get person factName}} - - + {{textarea focus-in="alertMessage"}} ``` - The `{{get}}` helper can also respect mutable values itself. For example: + See more about [Text Support Actions](/api/classes/Ember.TextArea.html) - ```handlebars - {{input value=(mut (get person factName)) type="text"}} - - + ### Extension + + Internally, `{{textarea}}` creates an instance of `Ember.TextArea`, passing + arguments from the helper to `Ember.TextArea`'s `create` method. You can + extend the capabilities of text areas in your application by reopening this + class. For example, if you are building a Bootstrap project where `data-*` + attributes are used, you can globally add support for a `data-*` attribute + on all `{{textarea}}`s' in your app by reopening `Ember.TextArea` or + `Ember.TextSupport` and adding it to the `attributeBindings` concatenated + property: + + ```javascript + Ember.TextArea.reopen({ + attributeBindings: ['data-error'] + }); ``` - Would allow the user to swap what fact is being displayed, and also edit - that fact via a two-way mutable binding. + Keep in mind when writing `Ember.TextArea` subclasses that `Ember.TextArea` + itself extends `Ember.Component`. Expect isolated component semantics, not + legacy 1.x view semantics (like `controller` being present). - @public - @method get + See more about [Ember components](/api/classes/Ember.Component.html) + + @method textarea @for Ember.Templates.helpers - @since 2.1.0 - */ - - exports.default = function (vm, args) { - return GetHelperReference.create(args.positional.at(0), args.positional.at(1)); - }; - - var GetHelperReference = (function (_CachedReference) { - babelHelpers.inherits(GetHelperReference, _CachedReference); + @param {Hash} options + @public + */ - GetHelperReference.create = function create(sourceReference, pathReference) { - if (_glimmerReference.isConst(pathReference)) { - var parts = pathReference.value().split('.'); - return _glimmerReference.referenceFromParts(sourceReference, parts); - } else { - return new GetHelperReference(sourceReference, pathReference); - } - }; + /** + The internal class used to create textarea element when the `{{textarea}}` + helper is used. + + See [Ember.Templates.helpers.textarea](/api/classes/Ember.Templates.helpers.html#method_textarea) for usage details. + + ## Layout and LayoutName properties + + Because HTML `textarea` elements do not contain inner HTML the `layout` and + `layoutName` properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s + layout section for more information. + + @class TextArea + @namespace Ember + @extends Ember.Component + @uses Ember.TextSupport + @public + */ + exports.default = _emberGlimmerComponent.default.extend(_emberViews.TextSupport, { + classNames: ['ember-text-area'], - function GetHelperReference(sourceReference, pathReference) { - babelHelpers.classCallCheck(this, GetHelperReference); + layout: _emberGlimmerTemplatesEmpty.default, - _CachedReference.call(this); - this.sourceReference = sourceReference; - this.pathReference = pathReference; + tagName: 'textarea', + attributeBindings: ['rows', 'cols', 'name', 'selectionEnd', 'selectionStart', 'wrap', 'lang', 'dir', 'value'], + rows: null, + cols: null + }); +}); +enifed('ember-glimmer/components/text_field', ['exports', 'ember-utils', 'ember-metal', 'ember-environment', 'ember-glimmer/component', 'ember-glimmer/templates/empty', 'ember-views'], function (exports, _emberUtils, _emberMetal, _emberEnvironment, _emberGlimmerComponent, _emberGlimmerTemplatesEmpty, _emberViews) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; - this.lastPath = null; - this.innerReference = null; + var inputTypeTestElement = undefined; + var inputTypes = new _emberUtils.EmptyObject(); + function canSetTypeOfInput(type) { + if (type in inputTypes) { + return inputTypes[type]; + } - var innerTag = this.innerTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); + // if running in outside of a browser always return the + // original type + if (!_emberEnvironment.environment.hasDOM) { + inputTypes[type] = type; - this.tag = _glimmerReference.combine([sourceReference.tag, pathReference.tag, innerTag]); + return type; } - GetHelperReference.prototype.compute = function compute() { - var lastPath = this.lastPath; - var innerReference = this.innerReference; - var innerTag = this.innerTag; + if (!inputTypeTestElement) { + inputTypeTestElement = document.createElement('input'); + } - var path = this.lastPath = this.pathReference.value(); + try { + inputTypeTestElement.type = type; + } catch (e) { + // ignored + } - if (path !== lastPath) { - if (path) { - var pathType = typeof path; + return inputTypes[type] = inputTypeTestElement.type === type; + } - if (pathType === 'string') { - innerReference = this.innerReference = _glimmerReference.referenceFromParts(this.sourceReference, path.split('.')); - } else if (pathType === 'number') { - innerReference = this.innerReference = this.sourceReference.get(path); - } + /** + + The internal class used to create text inputs when the `{{input}}` + helper is used with `type` of `text`. + + See [Ember.Templates.helpers.input](/api/classes/Ember.Templates.helpers.html#method_input) for usage details. + + ## Layout and LayoutName properties + + Because HTML `input` elements are self closing `layout` and `layoutName` + properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s + layout section for more information. + + @class TextField + @namespace Ember + @extends Ember.Component + @uses Ember.TextSupport + @public + */ + exports.default = _emberGlimmerComponent.default.extend(_emberViews.TextSupport, { + layout: _emberGlimmerTemplatesEmpty.default, + classNames: ['ember-text-field'], + tagName: 'input', + attributeBindings: ['accept', 'autocomplete', 'autosave', 'dir', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget', 'height', 'inputmode', 'lang', 'list', 'max', 'min', 'multiple', 'name', 'pattern', 'size', 'step', 'type', 'value', 'width'], - innerTag.update(innerReference.tag); - } else { - innerReference = this.innerReference = null; - innerTag.update(_glimmerReference.CONSTANT_TAG); - } - } + /** + The `value` attribute of the input element. As the user inputs text, this + property is updated live. + @property value + @type String + @default "" + @public + */ + value: '', - return innerReference ? innerReference.value() : null; - }; + /** + The `type` attribute of the input element. + @property type + @type String + @default "text" + @public + */ + type: _emberMetal.computed({ + get: function () { + return 'text'; + }, - GetHelperReference.prototype[_emberGlimmerUtilsReferences.UPDATE] = function (value) { - _emberMetal.set(this.sourceReference.value(), this.pathReference.value(), value); - }; + set: function (key, value) { + var type = 'text'; - return GetHelperReference; - })(_emberGlimmerUtilsReferences.CachedReference); -}); -enifed("ember-glimmer/helpers/hash", ["exports"], function (exports) { - /** - @module ember - @submodule ember-glimmer - */ + if (canSetTypeOfInput(value)) { + type = value; + } - /** - Use the `{{hash}}` helper to create a hash to pass as an option to your - components. This is specially useful for contextual components where you can - just yield a hash: - - ```handlebars - {{yield (hash - name='Sarah' - title=office - )}} - ``` - - Would result in an object such as: - - ```js - { name: 'Sarah', title: this.get('office') } - ``` - - Where the `title` is bound to updates of the `office` property. - - @method hash - @for Ember.Templates.helpers - @param {Object} options - @return {Object} Hash + return type; + } + }), + + /** + The `size` of the text field in characters. + @property size + @type String + @default null @public */ + size: null, - "use strict"; + /** + The `pattern` attribute of input element. + @property pattern + @type String + @default null + @public + */ + pattern: null, - exports.default = function (vm, args) { - return args.named; - }; + /** + The `min` attribute of input element used with `type="number"` or `type="range"`. + @property min + @type String + @default null + @since 1.4.0 + @public + */ + min: null, + + /** + The `max` attribute of input element used with `type="number"` or `type="range"`. + @property max + @type String + @default null + @since 1.4.0 + @public + */ + max: null + }); }); -enifed('ember-glimmer/helpers/if-unless', ['exports', 'ember-metal', 'ember-glimmer/utils/references', 'glimmer-reference'], function (exports, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference) { - /** - @module ember - @submodule ember-glimmer - */ +enifed('ember-glimmer/dom', ['exports', '@glimmer/runtime', '@glimmer/node'], function (exports, _glimmerRuntime, _glimmerNode) { + 'use strict'; + exports.DOMChanges = _glimmerRuntime.DOMChanges; + exports.DOMTreeConstruction = _glimmerRuntime.DOMTreeConstruction; + exports.NodeDOMTreeConstruction = _glimmerNode.NodeDOMTreeConstruction; +}); +enifed('ember-glimmer/environment', ['exports', 'ember-utils', 'ember-metal', 'ember-views', '@glimmer/runtime', 'ember-glimmer/syntax/curly-component', 'ember-glimmer/syntax', 'ember-glimmer/utils/iterable', 'ember-glimmer/utils/references', 'ember-glimmer/utils/debug-stack', 'ember-glimmer/helpers/if-unless', 'ember-glimmer/helpers/action', 'ember-glimmer/helpers/component', 'ember-glimmer/helpers/concat', 'ember-glimmer/helpers/get', 'ember-glimmer/helpers/hash', 'ember-glimmer/helpers/loc', 'ember-glimmer/helpers/log', 'ember-glimmer/helpers/mut', 'ember-glimmer/helpers/readonly', 'ember-glimmer/helpers/unbound', 'ember-glimmer/helpers/-class', 'ember-glimmer/helpers/-input-type', 'ember-glimmer/helpers/query-param', 'ember-glimmer/helpers/each-in', 'ember-glimmer/helpers/-normalize-class', 'ember-glimmer/helpers/-html-safe', 'ember-glimmer/protocol-for-url', 'container', 'ember-glimmer/modifiers/action'], function (exports, _emberUtils, _emberMetal, _emberViews, _glimmerRuntime, _emberGlimmerSyntaxCurlyComponent, _emberGlimmerSyntax, _emberGlimmerUtilsIterable, _emberGlimmerUtilsReferences, _emberGlimmerUtilsDebugStack, _emberGlimmerHelpersIfUnless, _emberGlimmerHelpersAction, _emberGlimmerHelpersComponent, _emberGlimmerHelpersConcat, _emberGlimmerHelpersGet, _emberGlimmerHelpersHash, _emberGlimmerHelpersLoc, _emberGlimmerHelpersLog, _emberGlimmerHelpersMut, _emberGlimmerHelpersReadonly, _emberGlimmerHelpersUnbound, _emberGlimmerHelpersClass, _emberGlimmerHelpersInputType, _emberGlimmerHelpersQueryParam, _emberGlimmerHelpersEachIn, _emberGlimmerHelpersNormalizeClass, _emberGlimmerHelpersHtmlSafe, _emberGlimmerProtocolForUrl, _container, _emberGlimmerModifiersAction) { 'use strict'; - exports.inlineIf = inlineIf; - exports.inlineUnless = inlineUnless; + var Environment = (function (_GlimmerEnvironment) { + babelHelpers.inherits(Environment, _GlimmerEnvironment); - /** - 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`, `NaN` or an empty array, the block will not be rendered. - - ```handlebars - {{! will not render if foo is falsey}} - {{#if foo}} - Welcome to the {{foo.bar}} - {{/if}} - ``` - - You can also specify a template to show if the property is falsey by using - the `else` helper. - - ```handlebars - {{! is it raining outside?}} - {{#if isRaining}} - Yes, grab an umbrella! - {{else}} - No, it's lovely outside! - {{/if}} - ``` - - You are also able to combine `else` and `if` helpers to create more complex - conditional logic. - - ```handlebars - {{#if isMorning}} - Good morning - {{else if isAfternoon}} - Good afternoon - {{else}} - Good night - {{/if}} - ``` - - You can use `if` inline to conditionally render a single property or string. - This helper acts like a ternary operator. If the first property is truthy, - the second argument will be displayed, if not, the third argument will be - displayed - - ```handlebars - {{if useLongGreeting "Hello" "Hi"}} Dave - ``` - - Finally, you can use the `if` helper inside another helper as a subexpression. - - ```handlebars - {{some-component height=(if isBig "100" "10")}} - ``` - - @method if - @for Ember.Templates.helpers - @public - */ + Environment.create = function create(options) { + return new Environment(options); + }; - var ConditionalHelperReference = (function (_CachedReference) { - babelHelpers.inherits(ConditionalHelperReference, _CachedReference); + function Environment(_ref) { + var _this = this; - ConditionalHelperReference.create = function create(_condRef, _truthyRef, _falsyRef) { - var condRef = _emberGlimmerUtilsReferences.ConditionalReference.create(_condRef); - var truthyRef = _truthyRef || _emberGlimmerUtilsReferences.UNDEFINED_REFERENCE; - var falsyRef = _falsyRef || _emberGlimmerUtilsReferences.UNDEFINED_REFERENCE; + var owner = _ref[_emberUtils.OWNER]; + babelHelpers.classCallCheck(this, Environment); - if (_glimmerReference.isConst(condRef)) { - return condRef.value() ? truthyRef : falsyRef; - } else { - return new ConditionalHelperReference(condRef, truthyRef, falsyRef); - } - }; + _GlimmerEnvironment.apply(this, arguments); + this.owner = owner; + this.isInteractive = owner.lookup('-environment:main').isInteractive; - function ConditionalHelperReference(cond, truthy, falsy) { - babelHelpers.classCallCheck(this, ConditionalHelperReference); + // can be removed once https://github.com/tildeio/glimmer/pull/305 lands + this.destroyedComponents = undefined; - _CachedReference.call(this); + _emberGlimmerProtocolForUrl.default(this); - this.branchTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - this.tag = _glimmerReference.combine([cond.tag, this.branchTag]); + this._definitionCache = new _emberMetal.Cache(2000, function (_ref2) { + var name = _ref2.name; + var source = _ref2.source; + var owner = _ref2.owner; - this.cond = cond; - this.truthy = truthy; - this.falsy = falsy; - } + var _lookupComponent = _emberViews.lookupComponent(owner, name, { source: source }); - /** - The inline `if` helper conditionally renders a single property or string. - This helper acts like a ternary operator. If the first property is truthy, - the second argument will be displayed, otherwise, the third argument will be - displayed - - ```handlebars - {{if useLongGreeting "Hello" "Hi"}} Alex - ``` - - You can use the `if` helper inside another helper as a subexpression. - - ```handlebars - {{some-component height=(if isBig "100" "10")}} - ``` - - @method if - @for Ember.Templates.helpers - @public - */ + var componentFactory = _lookupComponent.component; + var layout = _lookupComponent.layout; - ConditionalHelperReference.prototype.compute = function compute() { - var cond = this.cond; - var truthy = this.truthy; - var falsy = this.falsy; + if (componentFactory || layout) { + return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentDefinition(name, componentFactory, layout); + } + }, function (_ref3) { + var name = _ref3.name; + var source = _ref3.source; + var owner = _ref3.owner; - var branch = cond.value() ? truthy : falsy; + var expandedName = source && owner._resolveLocalLookupName(name, source) || name; + var ownerGuid = _emberUtils.guidFor(owner); - this.branchTag.update(branch.tag); + return ownerGuid + '|' + expandedName; + }); - return branch.value(); - }; + this._templateCache = new _emberMetal.Cache(1000, function (_ref4) { + var Template = _ref4.Template; + var owner = _ref4.owner; - return ConditionalHelperReference; - })(_emberGlimmerUtilsReferences.CachedReference); + if (Template.create) { + var _Template$create; - function inlineIf(vm, _ref) { - var positional = _ref.positional; + // we received a factory + return Template.create((_Template$create = { env: _this }, _Template$create[_emberUtils.OWNER] = owner, _Template$create)); + } else { + // we were provided an instance already + return Template; + } + }, function (_ref5) { + var Template = _ref5.Template; + var owner = _ref5.owner; + return _emberUtils.guidFor(owner) + '|' + Template.id; + }); - switch (positional.length) { - case 2: - return ConditionalHelperReference.create(positional.at(0), positional.at(1), null); - case 3: - return ConditionalHelperReference.create(positional.at(0), positional.at(1), positional.at(2)); - default: - _emberMetal.assert('The inline form of the `if` helper expects two or three arguments, e.g. ' + '`{{if trialExpired "Expired" expiryDate}}`.'); - } - } + this._compilerCache = new _emberMetal.Cache(10, function (Compiler) { + return new _emberMetal.Cache(2000, function (template) { + var compilable = new Compiler(template); + return _glimmerRuntime.compileLayout(compilable, _this); + }, function (template) { + var owner = template.meta.owner; + return _emberUtils.guidFor(owner) + '|' + template.id; + }); + }, function (Compiler) { + return Compiler.id; + }); - /** - The inline `unless` helper conditionally renders a single property or string. - This helper acts like a ternary operator. If the first property is falsy, - the second argument will be displayed, otherwise, the third argument will be - displayed - - ```handlebars - {{unless useLongGreeting "Hi" "Hello"}} Ben - ``` - - You can use the `unless` helper inside another helper as a subexpression. - - ```handlebars - {{some-component height=(unless isBig "10" "100")}} - ``` - - @method unless - @for Ember.Templates.helpers - @public - */ + this.builtInModifiers = { + action: new _emberGlimmerModifiersAction.default() + }; - function inlineUnless(vm, _ref2) { - var positional = _ref2.positional; + this.builtInHelpers = { + if: _emberGlimmerHelpersIfUnless.inlineIf, + action: _emberGlimmerHelpersAction.default, + component: _emberGlimmerHelpersComponent.default, + concat: _emberGlimmerHelpersConcat.default, + get: _emberGlimmerHelpersGet.default, + hash: _emberGlimmerHelpersHash.default, + loc: _emberGlimmerHelpersLoc.default, + log: _emberGlimmerHelpersLog.default, + mut: _emberGlimmerHelpersMut.default, + 'query-params': _emberGlimmerHelpersQueryParam.default, + readonly: _emberGlimmerHelpersReadonly.default, + unbound: _emberGlimmerHelpersUnbound.default, + unless: _emberGlimmerHelpersIfUnless.inlineUnless, + '-class': _emberGlimmerHelpersClass.default, + '-each-in': _emberGlimmerHelpersEachIn.default, + '-input-type': _emberGlimmerHelpersInputType.default, + '-normalize-class': _emberGlimmerHelpersNormalizeClass.default, + '-html-safe': _emberGlimmerHelpersHtmlSafe.default, + '-get-dynamic-var': _glimmerRuntime.getDynamicVar + }; - switch (positional.length) { - case 2: - return ConditionalHelperReference.create(positional.at(0), null, positional.at(1)); - case 3: - return ConditionalHelperReference.create(positional.at(0), positional.at(2), positional.at(1)); - default: - _emberMetal.assert('The inline form of the `unless` helper expects two or three arguments, e.g. ' + '`{{unless isFirstLogin "Welcome back!"}}`.'); + _emberMetal.runInDebug(function () { + return _this.debugStack = new _emberGlimmerUtilsDebugStack.default(); + }); } - } -}); -enifed('ember-glimmer/helpers/loc', ['exports', 'ember-glimmer/utils/references', 'ember-runtime'], function (exports, _emberGlimmerUtilsReferences, _emberRuntime) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; - /** - Calls [Ember.String.loc](/api/classes/Ember.String.html#method_loc) with the - provided string. This is a convenient way to localize text within a template. - For example: - - ```javascript - Ember.STRINGS = { - '_welcome_': 'Bonjour' + Environment.prototype.macros = function macros() { + var macros = _GlimmerEnvironment.prototype.macros.call(this); + _emberGlimmerSyntax.populateMacros(macros.blocks, macros.inlines); + return macros; }; - ``` - - ```handlebars -
    - {{loc '_welcome_'}} -
    - ``` - - ```html -
    - Bonjour -
    - ``` - - See [Ember.String.loc](/api/classes/Ember.String.html#method_loc) for how to - set up localized string references. - - @method loc - @for Ember.Templates.helpers - @param {String} str The string to format. - @see {Ember.String#loc} - @public - */ - function locHelper(_ref) { - var positional = _ref.positional; - return _emberRuntime.String.loc.apply(null, positional.value()); - } + Environment.prototype.hasComponentDefinition = function hasComponentDefinition() { + return false; + }; - exports.default = function (vm, args) { - return new _emberGlimmerUtilsReferences.InternalHelperReference(locHelper, args); - }; -}); -enifed('ember-glimmer/helpers/log', ['exports', 'ember-glimmer/utils/references', 'ember-console'], function (exports, _emberGlimmerUtilsReferences, _emberConsole) { - 'use strict'; + Environment.prototype.getComponentDefinition = function getComponentDefinition(path, symbolTable) { + var name = path[0]; + var blockMeta = symbolTable.getMeta(); + var owner = blockMeta.owner; + var source = blockMeta.moduleName && 'template:' + blockMeta.moduleName; - /** - `log` allows you to output the value of variables in the current rendering - context. `log` also accepts primitive types such as strings or numbers. - - ```handlebars - {{log "myVariable:" myVariable }} - ``` - - @method log - @for Ember.Templates.helpers - @param {Array} params - @public - */ - function log(_ref) { - var positional = _ref.positional; + return this._definitionCache.get({ name: name, source: source, owner: owner }); + }; - _emberConsole.default.log.apply(null, positional.value()); - } + // normally templates should be exported at the proper module name + // and cached in the container, but this cache supports templates + // that have been set directly on the component's layout property - exports.default = function (vm, args) { - return new _emberGlimmerUtilsReferences.InternalHelperReference(log, args); - }; -}); + Environment.prototype.getTemplate = function getTemplate(Template, owner) { + return this._templateCache.get({ Template: Template, owner: owner }); + }; -/** -@module ember -@submodule ember-glimmer -*/ -enifed('ember-glimmer/helpers/mut', ['exports', 'ember-utils', 'ember-metal', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/action'], function (exports, _emberUtils, _emberMetal, _emberGlimmerUtilsReferences, _emberGlimmerHelpersAction) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; + // a Compiler can wrap the template so it needs its own cache - exports.isMut = isMut; - exports.unMut = unMut; + Environment.prototype.getCompiledBlock = function getCompiledBlock(Compiler, template) { + var compilerCache = this._compilerCache.get(Compiler); + return compilerCache.get(template); + }; - /** - 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 component__. - - To specify that a parameter is mutable, when invoking the child `Component`: - - ```handlebars - {{my-child childClickCount=(mut totalClicks)}} - ``` - - The child `Component` can then modify the parent's value just by modifying its own - property: - - ```javascript - // my-child.js - export default Component.extend({ - click() { - this.incrementProperty('childClickCount'); - } - }); - ``` - - Additionally, the `mut` helper can be combined with the `action` helper to - mutate a value. For example: - - ```handlebars - {{my-child childClickCount=totalClicks click-count-change=(action (mut totalClicks))}} - ``` - - The child `Component` would invoke the action with the new click value: - - ```javascript - // my-child.js - export default Component.extend({ - click() { - this.get('clickCountChange')(this.get('childClickCount') + 1); + Environment.prototype.hasPartial = function hasPartial(name, symbolTable) { + var _symbolTable$getMeta = symbolTable.getMeta(); + + var owner = _symbolTable$getMeta.owner; + + return _emberViews.hasPartial(name, owner); + }; + + Environment.prototype.lookupPartial = function lookupPartial(name, symbolTable) { + var _symbolTable$getMeta2 = symbolTable.getMeta(); + + var owner = _symbolTable$getMeta2.owner; + + var partial = { + template: _emberViews.lookupPartial(name, owner) + }; + + if (partial.template) { + return partial; + } else { + throw new Error(name + ' is not a partial'); } - }); - ``` - - The `mut` helper changes the `totalClicks` value to what was provided as the action argument. - - The `mut` helper, when used with `action`, will return a function that - sets the value passed to `mut` to its first argument. This works like any other - closure action and interacts with the other features `action` provides. - As an example, we can create a button that increments a value passing the value - directly to the `action`: + }; + + Environment.prototype.hasHelper = function hasHelper(nameParts, symbolTable) { + _emberMetal.assert('The first argument passed into `hasHelper` should be an array', Array.isArray(nameParts)); + + // helpers are not allowed to include a dot in their invocation + if (nameParts.length > 1) { + return false; + } + + var name = nameParts[0]; + + if (this.builtInHelpers[name]) { + return true; + } + + var blockMeta = symbolTable.getMeta(); + var owner = blockMeta.owner; + var options = { source: 'template:' + blockMeta.moduleName }; + + return owner.hasRegistration('helper:' + name, options) || owner.hasRegistration('helper:' + name); + }; + + Environment.prototype.lookupHelper = function lookupHelper(nameParts, symbolTable) { + _emberMetal.assert('The first argument passed into `lookupHelper` should be an array', Array.isArray(nameParts)); + + var name = nameParts[0]; + var helper = this.builtInHelpers[name]; + + if (helper) { + return helper; + } + + var blockMeta = symbolTable.getMeta(); + var owner = blockMeta.owner; + var options = blockMeta.moduleName && { source: 'template:' + blockMeta.moduleName } || {}; + + if (true) { + var _ret = (function () { + var helperFactory = owner[_container.FACTORY_FOR]('helper:' + name, options) || owner[_container.FACTORY_FOR]('helper:' + name); + + // TODO: try to unify this into a consistent protocol to avoid wasteful closure allocations + if (helperFactory.class.isHelperInstance) { + return { + v: function (vm, args) { + return _emberGlimmerUtilsReferences.SimpleHelperReference.create(helperFactory.class.compute, args); + } + }; + } else if (helperFactory.class.isHelperFactory) { + if (!_emberMetal.isFeatureEnabled('ember-no-double-extend')) { + helperFactory = helperFactory.create(); + } + return { + v: function (vm, args) { + return _emberGlimmerUtilsReferences.ClassBasedHelperReference.create(helperFactory, vm, args); + } + }; + } else { + throw new Error(nameParts + ' is not a helper'); + } + })(); + + if (typeof _ret === 'object') return _ret.v; + } else { + var _ret2 = (function () { + var helperFactory = owner.lookup('helper:' + name, options) || owner.lookup('helper:' + name); + + // TODO: try to unify this into a consistent protocol to avoid wasteful closure allocations + if (helperFactory.isHelperInstance) { + return { + v: function (vm, args) { + return _emberGlimmerUtilsReferences.SimpleHelperReference.create(helperFactory.compute, args); + } + }; + } else if (helperFactory.isHelperFactory) { + return { + v: function (vm, args) { + return _emberGlimmerUtilsReferences.ClassBasedHelperReference.create(helperFactory, vm, args); + } + }; + } else { + throw new Error(nameParts + ' is not a helper'); + } + })(); + + if (typeof _ret2 === 'object') return _ret2.v; + } + }; + + Environment.prototype.hasModifier = function hasModifier(nameParts) { + _emberMetal.assert('The first argument passed into `hasModifier` should be an array', Array.isArray(nameParts)); + + // modifiers are not allowed to include a dot in their invocation + if (nameParts.length > 1) { + return false; + } + + return !!this.builtInModifiers[nameParts[0]]; + }; + + Environment.prototype.lookupModifier = function lookupModifier(nameParts) { + _emberMetal.assert('The first argument passed into `lookupModifier` should be an array', Array.isArray(nameParts)); + + var modifier = this.builtInModifiers[nameParts[0]]; + + if (modifier) { + return modifier; + } else { + throw new Error(nameParts + ' is not a modifier'); + } + }; + + Environment.prototype.toConditionalReference = function toConditionalReference(reference) { + return _emberGlimmerUtilsReferences.ConditionalReference.create(reference); + }; + + Environment.prototype.iterableFor = function iterableFor(ref, args) { + var keyPath = args.named.get('key').value(); + return _emberGlimmerUtilsIterable.default(ref, keyPath); + }; + + Environment.prototype.scheduleInstallModifier = function scheduleInstallModifier() { + if (this.isInteractive) { + var _GlimmerEnvironment$prototype$scheduleInstallModifier; + + (_GlimmerEnvironment$prototype$scheduleInstallModifier = _GlimmerEnvironment.prototype.scheduleInstallModifier).call.apply(_GlimmerEnvironment$prototype$scheduleInstallModifier, [this].concat(babelHelpers.slice.call(arguments))); + } + }; + + Environment.prototype.scheduleUpdateModifier = function scheduleUpdateModifier() { + if (this.isInteractive) { + var _GlimmerEnvironment$prototype$scheduleUpdateModifier; + + (_GlimmerEnvironment$prototype$scheduleUpdateModifier = _GlimmerEnvironment.prototype.scheduleUpdateModifier).call.apply(_GlimmerEnvironment$prototype$scheduleUpdateModifier, [this].concat(babelHelpers.slice.call(arguments))); + } + }; + + Environment.prototype.didDestroy = function didDestroy(destroyable) { + destroyable.destroy(); + }; + + Environment.prototype.begin = function begin() { + this.inTransaction = true; + + _GlimmerEnvironment.prototype.begin.call(this); + + this.destroyedComponents = []; + }; + + Environment.prototype.commit = function commit() { + // components queued for destruction must be destroyed before firing + // `didCreate` to prevent errors when removing and adding a component + // with the same name (would throw an error when added to view registry) + for (var i = 0; i < this.destroyedComponents.length; i++) { + this.destroyedComponents[i].destroy(); + } + + _GlimmerEnvironment.prototype.commit.call(this); + + this.inTransaction = false; + }; + + return Environment; + })(_glimmerRuntime.Environment); + + exports.default = Environment; + + _emberMetal.runInDebug(function () { + var StyleAttributeManager = (function (_AttributeManager) { + babelHelpers.inherits(StyleAttributeManager, _AttributeManager); + + function StyleAttributeManager() { + babelHelpers.classCallCheck(this, StyleAttributeManager); + + _AttributeManager.apply(this, arguments); + } + + StyleAttributeManager.prototype.setAttribute = function setAttribute(dom, element, value) { + var _AttributeManager$prototype$setAttribute; + + _emberMetal.warn(_emberViews.STYLE_WARNING, (function () { + if (value === null || value === undefined || _glimmerRuntime.isSafeString(value)) { + return true; + } + return false; + })(), { id: 'ember-htmlbars.style-xss-warning' }); + (_AttributeManager$prototype$setAttribute = _AttributeManager.prototype.setAttribute).call.apply(_AttributeManager$prototype$setAttribute, [this].concat(babelHelpers.slice.call(arguments))); + }; + + StyleAttributeManager.prototype.updateAttribute = function updateAttribute(dom, element, value) { + var _AttributeManager$prototype$updateAttribute; + + _emberMetal.warn(_emberViews.STYLE_WARNING, (function () { + if (value === null || value === undefined || _glimmerRuntime.isSafeString(value)) { + return true; + } + return false; + })(), { id: 'ember-htmlbars.style-xss-warning' }); + (_AttributeManager$prototype$updateAttribute = _AttributeManager.prototype.updateAttribute).call.apply(_AttributeManager$prototype$updateAttribute, [this].concat(babelHelpers.slice.call(arguments))); + }; + + return StyleAttributeManager; + })(_glimmerRuntime.AttributeManager); + + var STYLE_ATTRIBUTE_MANANGER = new StyleAttributeManager('style'); + + Environment.prototype.attributeFor = function (element, attribute, isTrusting, namespace) { + if (attribute === 'style' && !isTrusting) { + return STYLE_ATTRIBUTE_MANANGER; + } + + return _glimmerRuntime.Environment.prototype.attributeFor.call(this, element, attribute, isTrusting); + }; + }); +}); +enifed('ember-glimmer/helper', ['exports', 'ember-utils', 'ember-runtime', '@glimmer/reference'], function (exports, _emberUtils, _emberRuntime, _glimmerReference) { + /** + @module ember + @submodule ember-glimmer + */ + + 'use strict'; + + exports.helper = helper; + var RECOMPUTE_TAG = _emberUtils.symbol('RECOMPUTE_TAG'); + + exports.RECOMPUTE_TAG = RECOMPUTE_TAG; + /** + Ember Helpers are functions that can compute values, and are used in templates. + For example, this code calls a helper named `format-currency`: ```handlebars - {{! inc helper is not provided by Ember }} - +
    {{format-currency cents currency="$"}}
    ``` - You can also use the `value` option: + Additionally a helper can be called as a nested helper (sometimes called a + subexpression). In this example, the computed value of a helper is passed + to a component named `show-money`: ```handlebars - + {{show-money amount=(format-currency cents currency="$")}} ``` - @method mut - @param {Object} [attr] the "two-way" attribute that can be modified. - @for Ember.Templates.helpers + Helpers defined using a class must provide a `compute` function. For example: + + ```js + export default Ember.Helper.extend({ + compute(params, hash) { + let cents = params[0]; + let currency = hash.currency; + return `${currency}${cents * 0.01}`; + } + }); + ``` + + Each time the input to a helper changes, the `compute` function will be + called again. + + As instances, these helpers also have access to the container an will accept + injected dependencies. + + Additionally, class helpers can call `recompute` to force a new computation. + + @class Ember.Helper @public + @since 1.13.0 */ - var MUT_REFERENCE = _emberUtils.symbol('MUT'); - var SOURCE = _emberUtils.symbol('SOURCE'); + var Helper = _emberRuntime.FrameworkObject.extend({ + isHelperInstance: true, - function isMut(ref) { - return ref && ref[MUT_REFERENCE]; + init: function () { + this._super.apply(this, arguments); + this[RECOMPUTE_TAG] = new _glimmerReference.DirtyableTag(); + }, + + /** + 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 + session service changes: + ```js + // app/helpers/current-user-email.js + export default Ember.Helper.extend({ + session: Ember.inject.service(), + onNewUser: Ember.observer('session.currentUser', function() { + this.recompute(); + }), + compute() { + return this.get('session.currentUser.email'); + } + }); + ``` + @method recompute + @public + @since 1.13.0 + */ + recompute: function () { + this[RECOMPUTE_TAG].dirty(); + } + + /** + Override this function when writing a class-based helper. + @method compute + @param {Array} params The positional arguments to the helper + @param {Object} hash The named arguments to the helper + @public + @since 1.13.0 + */ + }); + + Helper.reopenClass({ + isHelperFactory: true + }); + + /** + In many cases, the ceremony of a full `Ember.Helper` class is not required. + The `helper` method create pure-function helpers without instances. For + example: + + ```js + // app/helpers/format-currency.js + export default Ember.Helper.helper(function(params, hash) { + let cents = params[0]; + let currency = hash.currency; + return `${currency}${cents * 0.01}`; + }); + ``` + + @static + @param {Function} helper The helper function + @method helper + @public + @since 1.13.0 + */ + + function helper(helperFn) { + return { + isHelperInstance: true, + compute: helperFn + }; } - function unMut(ref) { - return ref[SOURCE] || ref; + exports.default = Helper; +}); +enifed('ember-glimmer/helpers/-class', ['exports', 'ember-glimmer/utils/references', 'ember-runtime'], function (exports, _emberGlimmerUtilsReferences, _emberRuntime) { + 'use strict'; + + function classHelper(_ref) { + var positional = _ref.positional; + + var path = positional.at(0); + var args = positional.length; + var value = path.value(); + + if (value === true) { + if (args > 1) { + return _emberRuntime.String.dasherize(positional.at(1).value()); + } + return null; + } + + if (value === false) { + if (args > 2) { + return _emberRuntime.String.dasherize(positional.at(2).value()); + } + return null; + } + + return value; } exports.default = function (vm, args) { - var rawRef = args.positional.at(0); + return new _emberGlimmerUtilsReferences.InternalHelperReference(classHelper, args); + }; +}); +enifed('ember-glimmer/helpers/-html-safe', ['exports', 'ember-glimmer/utils/references', 'ember-glimmer/utils/string'], function (exports, _emberGlimmerUtilsReferences, _emberGlimmerUtilsString) { + 'use strict'; - if (isMut(rawRef)) { - return rawRef; - } + function htmlSafe(_ref) { + var positional = _ref.positional; - // TODO: Improve this error message. This covers at least two distinct - // cases: - // - // 1. (mut "not a path") – passing a literal, result from a helper - // invocation, etc - // - // 2. (mut receivedValue) – passing a value received from the caller - // that was originally derived from a literal, result from a helper - // invocation, etc - // - // This message is alright for the first case, but could be quite - // confusing for the second case. - _emberMetal.assert('You can only pass a path to mut', rawRef[_emberGlimmerUtilsReferences.UPDATE]); + var path = positional.at(0); + return new _emberGlimmerUtilsString.SafeString(path.value()); + } - var wrappedRef = Object.create(rawRef); + exports.default = function (vm, args) { + return new _emberGlimmerUtilsReferences.InternalHelperReference(htmlSafe, args); + }; +}); +enifed('ember-glimmer/helpers/-input-type', ['exports', 'ember-glimmer/utils/references'], function (exports, _emberGlimmerUtilsReferences) { + 'use strict'; - wrappedRef[SOURCE] = rawRef; - wrappedRef[_emberGlimmerHelpersAction.INVOKE] = rawRef[_emberGlimmerUtilsReferences.UPDATE]; - wrappedRef[MUT_REFERENCE] = true; + function inputTypeHelper(_ref) { + var positional = _ref.positional; + var named = _ref.named; - return wrappedRef; + var type = positional.at(0).value(); + if (type === 'checkbox') { + return '-checkbox'; + } + return '-text-field'; + } + + exports.default = function (vm, args) { + return new _emberGlimmerUtilsReferences.InternalHelperReference(inputTypeHelper, args); }; }); -enifed('ember-glimmer/helpers/query-param', ['exports', 'ember-utils', 'ember-glimmer/utils/references', 'ember-metal', 'ember-routing'], function (exports, _emberUtils, _emberGlimmerUtilsReferences, _emberMetal, _emberRouting) { - /** - @module ember - @submodule ember-glimmer - */ +enifed('ember-glimmer/helpers/-normalize-class', ['exports', 'ember-glimmer/utils/references', 'ember-runtime'], function (exports, _emberGlimmerUtilsReferences, _emberRuntime) { 'use strict'; - /** - This is a helper to be used in conjunction with the link-to helper. - It will supply url query parameters to the target route. - - Example - - ```handlebars - {{#link-to 'posts' (query-params direction="asc")}}Sort{{/link-to}} - ``` - - @method query-params - @for Ember.Templates.helpers - @param {Object} hash takes a hash of query parameters - @return {Object} A `QueryParams` object for `{{link-to}}` - @public - */ - function queryParams(_ref) { + function normalizeClass(_ref) { var positional = _ref.positional; var named = _ref.named; - _emberMetal.assert('The `query-params` helper only accepts hash parameters, e.g. (query-params queryParamPropertyName=\'foo\') as opposed to just (query-params \'foo\')', positional.value().length === 0); + var classNameParts = positional.at(0).value().split('.'); + var className = classNameParts[classNameParts.length - 1]; + var value = positional.at(1).value(); - return _emberRouting.QueryParams.create({ - values: _emberUtils.assign({}, named.value()) - }); + if (value === true) { + return _emberRuntime.String.dasherize(className); + } else if (!value && value !== 0) { + return ''; + } else { + return String(value); + } } exports.default = function (vm, args) { - return new _emberGlimmerUtilsReferences.InternalHelperReference(queryParams, args); + return new _emberGlimmerUtilsReferences.InternalHelperReference(normalizeClass, args); }; }); -enifed('ember-glimmer/helpers/readonly', ['exports', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/mut'], function (exports, _emberGlimmerUtilsReferences, _emberGlimmerHelpersMut) { +enifed('ember-glimmer/helpers/action', ['exports', 'ember-utils', 'ember-metal', 'ember-glimmer/utils/references', '@glimmer/runtime', '@glimmer/reference'], function (exports, _emberUtils, _emberMetal, _emberGlimmerUtilsReferences, _glimmerRuntime, _glimmerReference) { /** @module ember @submodule ember-glimmer */ 'use strict'; + var INVOKE = _emberUtils.symbol('INVOKE'); + exports.INVOKE = INVOKE; + var ACTION = _emberUtils.symbol('ACTION'); + + exports.ACTION = ACTION; /** - The `readonly` helper let's you specify that a binding is one-way only, - instead of two-way. - When you pass a `readonly` binding from an outer context (e.g. parent component), - to to an inner context (e.g. child component), you are saying that changing that - property in the inner context does not change the value in the outer context. + The `{{action}}` helper provides a way to pass triggers for behavior (usually + just a function) between components, and into components from controllers. - To specify that a binding is read-only, when invoking the child `Component`: + ### Passing functions with the action helper - ```app/components/my-parent.js - export default Component.extend({ - totalClicks: 3 - }); - ``` + There are three contexts an action helper can be used in. The first two + contexts to discuss are attribute context, and Handlebars value context. - ```app/templates/components/my-parent.hbs - {{log totalClicks}} // -> 3 - {{my-child childClickCount=(readonly totalClicks)}} + ```handlebars + {{! An example of attribute context }} +
    + {{! Examples of Handlebars value context }} + {{input on-input=(action "save")}} + {{yield (action "refreshData") andAnotherParam}} ``` - Now, when you update `childClickCount`: - - ```app/components/my-child.js - export default Component.extend({ - click() { - this.incrementProperty('childClickCount'); - } - }); - ``` + In these contexts, + the helper is called a "closure action" helper. Its behavior is simple: + If passed a function name, read that function off the `actions` property + of the current context. Once that function is read (or if a function was + passed), create a closure over that function and any arguments. + The resulting value of an action helper used this way is simply a function. - The value updates in the child component, but not the parent component: + For example, in the attribute context: - ```app/templates/components/my-child.hbs - {{log childClickCount}} //-> 4 + ```handlebars + {{! An example of attribute context }} +
    ``` - ```app/templates/components/my-parent.hbs - {{log totalClicks}} //-> 3 - {{my-child childClickCount=(readonly totalClicks)}} + The resulting template render logic would be: + + ```js + var div = document.createElement('div'); + var actionFunction = (function(context){ + return function() { + return context.actions.save.apply(context, arguments); + }; + })(context); + div.onclick = actionFunction; ``` - ### Objects and Arrays - - When passing a property that is a complex object (e.g. object, array) instead of a primitive object (e.g. number, string), - only the reference to the object is protected using the readonly helper. - This means that you can change properties of the object both on the parent component, as well as the child component. - The `readonly` binding behaves similar to the `const` keyword in JavaScript. + Thus when the div is clicked, the action on that context is called. + Because the `actionFunction` is just a function, closure actions can be + passed between components and still execute in the correct context. - Let's look at an example: + Here is an example action handler on a component: - First let's set up the parent component: + ```js + import Ember from 'ember'; - ```app/components/my-parent.js export default Ember.Component.extend({ - clicks: null, - - init() { - this._super(...arguments); - this.set('clicks', { total: 3 }); + actions: { + save() { + this.get('model').save(); + } } }); ``` - ```app/templates/components/my-parent.hbs - {{log clicks.total}} //-> 3 - {{my-child childClicks=(readonly clicks)}} - ``` + Actions are always looked up on the `actions` property of the current context. + This avoids collisions in the naming of common actions, such as `destroy`. + Two options can be passed to the `action` helper when it is used in this way. - Now, if you update the `total` property of `childClicks`: + * `target=someProperty` will look to `someProperty` instead of the current + context for the `actions` hash. This can be useful when targetting a + service for actions. + * `value="target.value"` will read the path `target.value` off the first + argument to the action when it is called and rewrite the first argument + to be that value. This is useful when attaching actions to event listeners. - ```app/components/my-child.js + ### Invoking an action + + Closure actions curry both their scope and any arguments. When invoked, any + additional arguments are added to the already curried list. + Actions should be invoked using the [sendAction](/api/classes/Ember.Component.html#method_sendAction) + method. The first argument to `sendAction` is the action to be called, and + additional arguments are passed to the action function. This has interesting + properties combined with currying of arguments. For example: + + ```js export default Ember.Component.extend({ - click() { - this.get('clicks').incrementProperty('total'); + actions: { + // Usage {{input on-input=(action (action 'setName' model) value="target.value")}} + setName(model, name) { + model.set('name', name); + } } }); ``` - You will see the following happen: - - ```app/templates/components/my-parent.hbs - {{log clicks.total}} //-> 4 - {{my-child childClicks=(readonly clicks)}} - ``` + The first argument (`model`) was curried over, and the run-time argument (`event`) + becomes a second argument. Action calls can be nested this way because each simply + returns a function. Any function can be passed to the `{{action}}` helper, including + other actions. - ```app/templates/components/my-child.hbs - {{log childClicks.total}} //-> 4 - ``` + Actions invoked with `sendAction` have the same currying behavior as demonstrated + with `on-input` above. For example: - @method readonly - @param {Object} [attr] the read-only attribute. - @for Ember.Templates.helpers - @private - */ - - exports.default = function (vm, args) { - var ref = _emberGlimmerHelpersMut.unMut(args.positional.at(0)); - - var wrapped = Object.create(ref); - - wrapped[_emberGlimmerUtilsReferences.UPDATE] = undefined; - - return wrapped; - }; -}); -enifed('ember-glimmer/helpers/unbound', ['exports', 'ember-metal', 'ember-glimmer/utils/references'], function (exports, _emberMetal, _emberGlimmerUtilsReferences) { - /** - @module ember - @submodule ember-glimmer - */ - - 'use strict'; - - /** - 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: + ```app/components/my-input.js + import Ember from 'ember'; - ```handlebars - {{unbound name}} + export default Ember.Component.extend({ + actions: { + setName(model, name) { + model.set('name', 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)}} + {{my-input submit=(action 'setName' model)}} ``` - The `unbound` helper only accepts a single argument, and it return an - unbound value. - - @method unbound - @for Ember.Templates.helpers - @public - */ - - exports.default = function (vm, args) { - _emberMetal.assert('unbound helper cannot be called with multiple params or hash params', args.positional.values.length === 1 && args.named.keys.length === 0); - - return _emberGlimmerUtilsReferences.UnboundReference.create(args.positional.at(0).value()); - }; -}); -enifed('ember-glimmer/index', ['exports', 'ember-glimmer/helpers/action', 'ember-glimmer/templates/root', 'ember-glimmer/syntax', 'ember-glimmer/template', 'ember-glimmer/components/checkbox', 'ember-glimmer/components/text_field', 'ember-glimmer/components/text_area', 'ember-glimmer/components/link-to', 'ember-glimmer/component', 'ember-glimmer/helper', 'ember-glimmer/environment', 'ember-glimmer/make-bound-helper', 'ember-glimmer/utils/string', 'ember-glimmer/renderer', 'ember-glimmer/template_registry', 'ember-glimmer/setup-registry', 'ember-glimmer/dom'], function (exports, _emberGlimmerHelpersAction, _emberGlimmerTemplatesRoot, _emberGlimmerSyntax, _emberGlimmerTemplate, _emberGlimmerComponentsCheckbox, _emberGlimmerComponentsText_field, _emberGlimmerComponentsText_area, _emberGlimmerComponentsLinkTo, _emberGlimmerComponent, _emberGlimmerHelper, _emberGlimmerEnvironment, _emberGlimmerMakeBoundHelper, _emberGlimmerUtilsString, _emberGlimmerRenderer, _emberGlimmerTemplate_registry, _emberGlimmerSetupRegistry, _emberGlimmerDom) { - /** - [Glimmer](https://github.com/tildeio/glimmer) is a [Handlebars](http://handlebarsjs.com/) - compatible templating engine used by Ember.js. - 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' - }); - ``` + ```app/components/my-component.js + import Ember from 'ember'; - ```handlebars - {{! app/components/person.hbs }} - {{name}} -
    {{name}}
    - + export default Ember.Component.extend({ + click() { + // Note that model is not passed, it was curried in the template + this.sendAction('submit', 'bob'); + } + }); ``` - Any time the "name" property on the component changes, the DOM will be - updated. + ### Attaching actions to DOM elements - Properties can be chained as well: + The third context of the `{{action}}` helper can be called "element space". + For example: ```handlebars - {{aUserModel.name}} -
    {{listOfUsers.firstObject.name}}
    + {{! An example of element space }} +
    ``` - ### Using Ember helpers + Used this way, the `{{action}}` helper provides a useful shortcut for + registering an HTML element in a template for a single DOM event and + forwarding that interaction to the template's context (controller or component). + If the context of a template is a controller, actions used this way will + bubble to routes when the controller does not implement the specified action. + Once an action hits a route, it will bubble through the route hierarchy. - When content is passed in mustaches `{{}}`, Ember will first try to find a helper - or component with that name. For example, the `if` helper: + ### Event Propagation - ```handlebars - {{if name "I have a name" "I have no name"}} - - ``` + `{{action}}` helpers called in element space can control event bubbling. Note + that the closure style actions cannot. - 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: + Events triggered through the action helper will automatically have + `.preventDefault()` called on them. You do not need to do so in your event + handlers. If you need to allow event propagation (to handle file inputs for + example) you can supply the `preventDefault=false` option to the `{{action}}` helper: ```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: + To disable bubbling, pass `bubbles=false` to the helper: ```handlebars - + ``` - 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-glimmer - @main ember-glimmer - @public - */ - - /** - 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 - `{{with}}` block. - - If the aliased property is "falsey", for example: `false`, `undefined` `null`, `""`, `0`, NaN or - an empty array, the block will not be rendered. + To disable bubbling with closure style actions you must create your own + wrapper helper that makes use of `event.stopPropagation()`: ```handlebars - {{! Will only render if user.posts contains items}} - {{#with user.posts as |blogPosts|}} -
    - There are {{blogPosts.length}} blog posts written by {{user.name}}. -
    - {{#each blogPosts as |post|}} -
  • {{post.title}}
  • - {{/each}} - {{/with}} +
    Hello
    ``` - Without the `as` operator, it would be impossible to reference `user.name` in the example above. - - NOTE: The alias should not reuse a name from the bound property path. - - For example: `{{#with foo.bar as |foo|}}` is not supported because it attempts to alias using - the first part of the property path, `foo`. Instead, use `{{#with foo.bar as |baz|}}`. - - @method with - @for Ember.Templates.helpers - @param {Object} options - @return {String} HTML string - @public - */ - - /** - Execute the `debugger` statement in the current template's context. + ```app/helpers/disable-bubbling.js + import Ember from 'ember'; - ```handlebars - {{debugger}} + export function disableBubbling([action]) { + return function(event) { + event.stopPropagation(); + return action(event); + }; + } + export default Ember.Helper.helper(disableBubbling); ``` - When using the debugger helper you will have access to a `get` function. This - function retrieves values available in the context of the template. - For example, if you're wondering why a value `{{foo}}` isn't rendering as - expected within a template, you could place a `{{debugger}}` statement and, - when the `debugger;` breakpoint is hit, you can attempt to retrieve this value: + If you need the default handler to trigger you should either register your + own event handler, or use event methods on your view class. See + ["Responding to Browser Events"](/api/classes/Ember.View.html#toc_responding-to-browser-events) + in the documentation for Ember.View for more information. - ``` - > get('foo') - ``` + ### Specifying DOM event type - `get` is also aware of keywords. So in this situation + `{{action}}` helpers called in element space can specify an event type. + By default the `{{action}}` helper registers for DOM `click` events. You can + supply an `on` option to the helper to specify a different DOM event name: ```handlebars - {{#each items as |item|}} - {{debugger}} - {{/each}} +
    + click me +
    ``` - You'll be able to get values from the current item: + See ["Event Names"](/api/classes/Ember.View.html#toc_event-names) for a list of + acceptable DOM event names. - ``` - > get('item.name') - ``` + ### Specifying whitelisted modifier keys - You can also access the context of the view to make sure it is the object that - you expect: + `{{action}}` helpers called in element space can specify modifier keys. + By default the `{{action}}` helper will ignore click events with pressed modifier + keys. You can supply an `allowedKeys` option to specify which keys should not be ignored. - ``` - > context + ```handlebars +
    + click me +
    ``` - @method debugger - @for Ember.Templates.helpers - @public - */ - - /** - The `partial` helper renders another template without - changing the template context: + This way the action will fire when clicking with the alt key pressed down. + Alternatively, supply "any" to the `allowedKeys` option to accept any combination of modifier keys. ```handlebars - {{foo}} - {{partial "nav"}} +
    + click me with any key pressed +
    ``` - The above example template will render a template named - "-nav", which has the same context as the parent template - it's rendered into, so if the "-nav" template also referenced - `{{foo}}`, it would print the same thing as the `{{foo}}` - in the above example. + ### Specifying a Target - If a "-nav" template isn't found, the `partial` helper will - fall back to a template named "nav". + A `target` option can be provided to the helper to change + which object will receive the method call. This option must be a path + to an object, accessible in the current context: - ### Bound template names + ```app/templates/application.hbs +
    + click me +
    + ``` - The parameter supplied to `partial` can also be a path - to a property containing a template name, e.g.: + ```app/controllers/application.js + import Ember from 'ember'; - ```handlebars - {{partial someTemplateName}} + export default Ember.Controller.extend({ + someService: Ember.inject.service() + }); ``` - The above example will look up the value of `someTemplateName` - on the template context (e.g. a controller) and use that - value as the name of the template to render. If the resolved - value is falsy, nothing will be rendered. If `someTemplateName` - changes, the partial will be re-rendered using the new template - name. - - @method partial + @method action @for Ember.Templates.helpers - @param {String} partialName The name of the template to render minus the leading underscore. @public */ - 'use strict'; + exports.default = function (vm, args) { + var named = args.named; + var positional = args.positional; - exports.INVOKE = _emberGlimmerHelpersAction.INVOKE; - exports.RootTemplate = _emberGlimmerTemplatesRoot.default; - exports.registerSyntax = _emberGlimmerSyntax.registerSyntax; - exports.template = _emberGlimmerTemplate.default; - exports.Checkbox = _emberGlimmerComponentsCheckbox.default; - exports.TextField = _emberGlimmerComponentsText_field.default; - exports.TextArea = _emberGlimmerComponentsText_area.default; - exports.LinkComponent = _emberGlimmerComponentsLinkTo.default; - exports.Component = _emberGlimmerComponent.default; - exports.Helper = _emberGlimmerHelper.default; - exports.helper = _emberGlimmerHelper.helper; - exports.Environment = _emberGlimmerEnvironment.default; - exports.makeBoundHelper = _emberGlimmerMakeBoundHelper.default; - exports.SafeString = _emberGlimmerUtilsString.SafeString; - exports.escapeExpression = _emberGlimmerUtilsString.escapeExpression; - exports.htmlSafe = _emberGlimmerUtilsString.htmlSafe; - exports.isHTMLSafe = _emberGlimmerUtilsString.isHTMLSafe; - exports._getSafeString = _emberGlimmerUtilsString.getSafeString; - exports.Renderer = _emberGlimmerRenderer.Renderer; - exports.InertRenderer = _emberGlimmerRenderer.InertRenderer; - exports.InteractiveRenderer = _emberGlimmerRenderer.InteractiveRenderer; - exports.getTemplate = _emberGlimmerTemplate_registry.getTemplate; - exports.setTemplate = _emberGlimmerTemplate_registry.setTemplate; - exports.hasTemplate = _emberGlimmerTemplate_registry.hasTemplate; - exports.getTemplates = _emberGlimmerTemplate_registry.getTemplates; - exports.setTemplates = _emberGlimmerTemplate_registry.setTemplates; - exports.setupEngineRegistry = _emberGlimmerSetupRegistry.setupEngineRegistry; - exports.setupApplicationRegistry = _emberGlimmerSetupRegistry.setupApplicationRegistry; - exports.DOMChanges = _emberGlimmerDom.DOMChanges; - exports.NodeDOMTreeConstruction = _emberGlimmerDom.NodeDOMTreeConstruction; - exports.DOMTreeConstruction = _emberGlimmerDom.DOMTreeConstruction; -}); -enifed('ember-glimmer/make-bound-helper', ['exports', 'ember-metal', 'ember-glimmer/helper'], function (exports, _emberMetal, _emberGlimmerHelper) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; + // The first two argument slots are reserved. + // pos[0] is the context (or `this`) + // pos[1] is the action name or function + // Anything else is an action argument. + var context = positional.at(0); + var action = positional.at(1); - exports.default = makeBoundHelper; + // TODO: Is there a better way of doing this? + var debugKey = action._propertyKey; - /** - 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 - value and any changes to the bound property cause the helper function to be re-run with the updated - values. - - * `params` - An array of resolved ordered parameters. - * `hash` - An object containing the hash parameters. - - For example: - - * With an unquoted ordered parameter: - - ```javascript - {{x-capitalize foo}} - ``` - - Assuming `foo` was set to `"bar"`, the bound helper would receive `["bar"]` as its first argument, and - an empty hash as its second. - - * With a quoted ordered parameter: - - ```javascript - {{x-capitalize "foo"}} - ``` - - The bound helper would receive `["foo"]` as its first argument, and an empty hash as its second. - - * With an unquoted hash parameter: - - ```javascript - {{x-repeat "foo" count=repeatCount}} - ``` - - Assuming that `repeatCount` resolved to 2, the bound helper would receive `["foo"]` as its first argument, - and { count: 2 } as its second. - - @private - @method makeBoundHelper - @for Ember.HTMLBars - @param {Function} fn - @since 1.10.0 - */ + var restArgs = undefined; - function makeBoundHelper(fn) { - _emberMetal.deprecate('Using `Ember.HTMLBars.makeBoundHelper` is deprecated. Please refactor to use `Ember.Helper` or `Ember.Helper.helper`.', false, { id: 'ember-htmlbars.make-bound-helper', until: '3.0.0' }); - return _emberGlimmerHelper.helper(fn); - } -}); -enifed('ember-glimmer/modifiers/action', ['exports', 'ember-utils', 'ember-metal', 'ember-views', 'ember-glimmer/helpers/action'], function (exports, _emberUtils, _emberMetal, _emberViews, _emberGlimmerHelpersAction) { - 'use strict'; + if (positional.length === 2) { + restArgs = _glimmerRuntime.EvaluatedPositionalArgs.empty(); + } else { + restArgs = _glimmerRuntime.EvaluatedPositionalArgs.create(positional.values.slice(2)); + } - var MODIFIERS = ['alt', 'shift', 'meta', 'ctrl']; - var POINTER_EVENT_TYPE_REGEX = /^click|mouse|touch/; + var target = named.has('target') ? named.get('target') : context; + var processArgs = makeArgsProcessor(named.has('value') && named.get('value'), restArgs); - function isAllowedEvent(event, allowedKeys) { - if (allowedKeys === null || typeof allowedKeys === 'undefined') { - if (POINTER_EVENT_TYPE_REGEX.test(event.type)) { - return _emberViews.isSimpleClick(event); - } else { - allowedKeys = ''; - } - } + var fn = undefined; - if (allowedKeys.indexOf('any') >= 0) { - return true; + if (typeof action[INVOKE] === 'function') { + fn = makeClosureAction(action, action, action[INVOKE], processArgs, debugKey); + } else if (_glimmerReference.isConst(target) && _glimmerReference.isConst(action)) { + fn = makeClosureAction(context.value(), target.value(), action.value(), processArgs, debugKey); + } else { + fn = makeDynamicClosureAction(context.value(), target, action, processArgs, debugKey); } - for (var i = 0; i < MODIFIERS.length; i++) { - if (event[MODIFIERS[i] + 'Key'] && allowedKeys.indexOf(MODIFIERS[i]) === -1) { - return false; - } - } + fn[ACTION] = true; - return true; + return new _emberGlimmerUtilsReferences.UnboundReference(fn); + }; + + function NOOP(args) { + return args; } - var ActionHelper = { - // registeredActions is re-exported for compatibility with older plugins - // that were using this undocumented API. - registeredActions: _emberViews.ActionManager.registeredActions, + function makeArgsProcessor(valuePathRef, actionArgsRef) { + var mergeArgs = null; - registerAction: function (actionState) { - var actionId = actionState.actionId; + if (actionArgsRef.length > 0) { + mergeArgs = function (args) { + return actionArgsRef.value().concat(args); + }; + } - var actions = _emberViews.ActionManager.registeredActions[actionId]; - - if (!actions) { - actions = _emberViews.ActionManager.registeredActions[actionId] = []; - } - - actions.push(actionState); - - return actionId; - }, - - unregisterAction: function (actionState) { - var actionId = actionState.actionId; - - var actions = _emberViews.ActionManager.registeredActions[actionId]; - - if (!actions) { - return; - } + var readValue = null; - var index = actions.indexOf(actionState); + if (valuePathRef) { + readValue = function (args) { + var valuePath = valuePathRef.value(); - if (index !== -1) { - actions.splice(index, 1); - } + if (valuePath && args.length > 0) { + args[0] = _emberMetal.get(args[0], valuePath); + } - if (actions.length === 0) { - delete _emberViews.ActionManager.registeredActions[actionId]; - } + return args; + }; } - }; - - exports.ActionHelper = ActionHelper; - - var ActionState = (function () { - function ActionState(element, actionId, actionName, actionArgs, namedArgs, positionalArgs, implicitTarget, dom) { - babelHelpers.classCallCheck(this, ActionState); - this.element = element; - this.actionId = actionId; - this.actionName = actionName; - this.actionArgs = actionArgs; - this.namedArgs = namedArgs; - this.positional = positionalArgs; - this.implicitTarget = implicitTarget; - this.dom = dom; - this.eventName = this.getEventName(); + if (mergeArgs && readValue) { + return function (args) { + return readValue(mergeArgs(args)); + }; + } else { + return mergeArgs || readValue || NOOP; } + } - // implements ModifierManager + function makeDynamicClosureAction(context, targetRef, actionRef, processArgs, debugKey) { + // We don't allow undefined/null values, so this creates a throw-away action to trigger the assertions + _emberMetal.runInDebug(function () { + makeClosureAction(context, targetRef.value(), actionRef.value(), processArgs, debugKey); + }); - ActionState.prototype.getEventName = function getEventName() { - return this.namedArgs.get('on').value() || 'click'; + return function () { + return makeClosureAction(context, targetRef.value(), actionRef.value(), processArgs, debugKey).apply(undefined, arguments); }; + } - ActionState.prototype.getActionArgs = function getActionArgs() { - var result = new Array(this.actionArgs.length); - - for (var i = 0; i < this.actionArgs.length; i++) { - result[i] = this.actionArgs[i].value(); - } + function makeClosureAction(context, target, action, processArgs, debugKey) { + var self = undefined, + fn = undefined; - return result; - }; + _emberMetal.assert('Action passed is null or undefined in (action) from ' + target + '.', !_emberMetal.isNone(action)); - ActionState.prototype.getTarget = function getTarget() { - var implicitTarget = this.implicitTarget; - var namedArgs = this.namedArgs; + if (typeof action[INVOKE] === 'function') { + self = action; + fn = action[INVOKE]; + } else { + var typeofAction = typeof action; - var target = undefined; + if (typeofAction === 'string') { + self = target; + fn = target.actions && target.actions[action]; - if (namedArgs.has('target')) { - target = namedArgs.get('target').value(); + _emberMetal.assert('An action named \'' + action + '\' was not found in ' + target, fn); + } else if (typeofAction === 'function') { + self = context; + fn = action; } else { - target = implicitTarget.value(); - } - - return target; - }; - - ActionState.prototype.handler = function handler(event) { - var _this = this; - - var actionName = this.actionName; - var namedArgs = this.namedArgs; - - var bubbles = namedArgs.get('bubbles'); - var preventDefault = namedArgs.get('preventDefault'); - var allowedKeys = namedArgs.get('allowedKeys'); - var target = this.getTarget(); - - if (!isAllowedEvent(event, allowedKeys.value())) { - return true; + _emberMetal.assert('An action could not be made for `' + (debugKey || action) + '` in ' + target + '. Please confirm that you are using either a quoted action name (i.e. `(action \'' + (debugKey || 'myAction') + '\')`) or a function available in ' + target + '.', false); } + } - if (preventDefault.value() !== false) { - event.preventDefault(); + return function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } - if (bubbles.value() === false) { - event.stopPropagation(); - } + var payload = { target: self, args: args, label: '@glimmer/closure-action' }; + return _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { + return _emberMetal.run.join.apply(_emberMetal.run, [self, fn].concat(processArgs(args))); + }); + }; + } +}); +enifed('ember-glimmer/helpers/component', ['exports', 'ember-utils', 'ember-glimmer/utils/references', 'ember-glimmer/syntax/curly-component', '@glimmer/runtime', 'ember-metal'], function (exports, _emberUtils, _emberGlimmerUtilsReferences, _emberGlimmerSyntaxCurlyComponent, _glimmerRuntime, _emberMetal) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; - _emberMetal.run(function () { - var args = _this.getActionArgs(); - var payload = { - args: args, - target: target - }; - if (typeof actionName[_emberGlimmerHelpersAction.INVOKE] === 'function') { - _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { - actionName[_emberGlimmerHelpersAction.INVOKE].apply(actionName, args); - }); - return; - } - if (typeof actionName === 'function') { - _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { - actionName.apply(target, args); - }); - return; + /** + 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. + `{{component}}`'s primary use is for cases where you want to dynamically + change which type of component is rendered as the state of your application + changes. This helper has three modes: inline, block, and nested. + + ### Inline Form + + Given the following template: + + ```app/application.hbs + {{component infographicComponentName}} + ``` + + And the following application code: + + ```app/controllers/application.js + export default Ember.Controller.extend({ + infographicComponentName: computed('isMarketOpen', { + get() { + if (this.get('isMarketOpen')) { + return 'live-updating-chart'; + } else { + return 'market-close-summary'; + } } - payload.name = actionName; - if (target.send) { - _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { - target.send.apply(target, [actionName].concat(args)); - }); - } else { - _emberMetal.assert('The action \'' + actionName + '\' did not exist on ' + target, typeof target[actionName] === 'function'); - _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { - target[actionName].apply(target, args); - }); + }) + }); + ``` + + The `live-updating-chart` component will be appended when `isMarketOpen` is + `true`, and the `market-close-summary` component will be appended when + `isMarketOpen` is `false`. If the value changes while the app is running, + the component will be automatically swapped out accordingly. + Note: You should not use this helper when you are consistently rendering the same + component. In that case, use standard component syntax, for example: + + ```app/templates/application.hbs + {{live-updating-chart}} + ``` + + ### Block Form + + Using the block form of this helper is similar to using the block form + of a component. Given the following application template: + + ```app/templates/application.hbs + {{#component infographicComponentName}} + Last update: {{lastUpdateTimestamp}} + {{/component}} + ``` + + The following controller code: + + ```app/controllers/application.js + export default Ember.Controller.extend({ + lastUpdateTimestamp: computed(function() { + return new Date(); + }), + + infographicComponentName: computed('isMarketOpen', { + get() { + if (this.get('isMarketOpen')) { + return 'live-updating-chart'; + } else { + return 'market-close-summary'; + } } - }); - }; + }) + }); + ``` + + And the following component template: + + ```app/templates/components/live-updating-chart.hbs + {{! chart }} + {{yield}} + ``` + + The `Last Update: {{lastUpdateTimestamp}}` will be rendered in place of the `{{yield}}`. + + ### Nested Usage + + The `component` helper can be used to package a component path with initial attrs. + The included attrs can then be merged during the final invocation. + For example, given a `person-form` component with the following template: + + ```app/templates/components/person-form.hbs + {{yield (hash + nameInput=(component "my-input-component" value=model.name placeholder="First Name") + )}} + ``` + + When yielding the component via the `hash` helper, the component is invocked directly. + See the following snippet: + + ``` + {{#person-form as |form|}} + {{form.nameInput placeholder="Username"}} + {{/person-form}} + ``` + + Which outputs an input whose value is already bound to `model.name` and `placeholder` + is "Username". + + When yielding the component without the hash helper use the `component` helper. + For example, below is a `full-name` component template: + + ```handlebars + {{yield (component "my-input-component" value=model.name placeholder="Name")}} + ``` + + ``` + {{#full-name as |field|}} + {{component field placeholder="Full name"}} + {{/full-name}} + ``` + + @method component + @since 1.11.0 + @for Ember.Templates.helpers + @public + */ - ActionState.prototype.destroy = function destroy() { - ActionHelper.unregisterAction(this); - }; + var ClosureComponentReference = (function (_CachedReference) { + babelHelpers.inherits(ClosureComponentReference, _CachedReference); - return ActionState; - })(); + ClosureComponentReference.create = function create(args, symbolTable, env) { + return new ClosureComponentReference(args, symbolTable, env); + }; - exports.ActionState = ActionState; + function ClosureComponentReference(args, symbolTable, env) { + babelHelpers.classCallCheck(this, ClosureComponentReference); - var ActionModifierManager = (function () { - function ActionModifierManager() { - babelHelpers.classCallCheck(this, ActionModifierManager); + _CachedReference.call(this); + this.defRef = args.positional.at(0); + this.env = env; + this.tag = args.positional.at(0).tag; + this.symbolTable = symbolTable; + this.args = args; + this.lastDefinition = undefined; + this.lastName = undefined; } - ActionModifierManager.prototype.create = function create(element, args, dynamicScope, dom) { - var named = args.named; - var positional = args.positional; - - var implicitTarget = undefined; - var actionName = undefined; - var actionNameRef = undefined; - if (positional.length > 1) { - implicitTarget = positional.at(0); - actionNameRef = positional.at(1); + ClosureComponentReference.prototype.compute = function compute() { + // TODO: Figure out how to extract this because it's nearly identical to + // DynamicComponentReference::compute(). The only differences besides + // currying are in the assertion messages. + var args = this.args; + var defRef = this.defRef; + var env = this.env; + var symbolTable = this.symbolTable; + var lastDefinition = this.lastDefinition; + var lastName = this.lastName; - if (actionNameRef[_emberGlimmerHelpersAction.INVOKE]) { - actionName = actionNameRef; - } else { - var actionLabel = actionNameRef._propertyKey; - actionName = actionNameRef.value(); + var nameOrDef = defRef.value(); + var definition = null; - _emberMetal.assert('You specified a quoteless path, `' + actionLabel + '`, to the ' + '{{action}} helper which did not resolve to an action name (a ' + 'string). Perhaps you meant to use a quoted actionName? (e.g. ' + '{{action "' + actionLabel + '"}}).', typeof actionName === 'string' || typeof actionName === 'function'); - } + if (nameOrDef && nameOrDef === lastName) { + return lastDefinition; } - var actionArgs = []; - // The first two arguments are (1) `this` and (2) the action name. - // Everything else is a param. - for (var i = 2; i < positional.length; i++) { - actionArgs.push(positional.at(i)); - } + this.lastName = nameOrDef; - var actionId = _emberUtils.uuid(); - return new ActionState(element, actionId, actionName, actionArgs, named, positional, implicitTarget, dom); - }; + if (typeof nameOrDef === 'string') { + _emberMetal.assert('You cannot use the input helper as a contextual helper. Please extend Ember.TextField or Ember.Checkbox to use it as a contextual component.', nameOrDef !== 'input'); + _emberMetal.assert('You cannot use the textarea helper as a contextual helper. Please extend Ember.TextArea to use it as a contextual component.', nameOrDef !== 'textarea'); + definition = env.getComponentDefinition([nameOrDef], symbolTable); + _emberMetal.assert('The component helper cannot be used without a valid component name. You used "' + nameOrDef + '" via (component "' + nameOrDef + '")', definition); + } else if (_glimmerRuntime.isComponentDefinition(nameOrDef)) { + definition = nameOrDef; + } else { + _emberMetal.assert('You cannot create a component from ' + nameOrDef + ' using the {{component}} helper', nameOrDef); + return null; + } - ActionModifierManager.prototype.install = function install(actionState) { - var dom = actionState.dom; - var element = actionState.element; - var actionId = actionState.actionId; + var newDef = createCurriedDefinition(definition, args); - ActionHelper.registerAction(actionState); + this.lastDefinition = newDef; - dom.setAttribute(element, 'data-ember-action', ''); - dom.setAttribute(element, 'data-ember-action-' + actionId, actionId); + return newDef; }; - ActionModifierManager.prototype.update = function update(actionState) { - var positional = actionState.positional; - - var actionNameRef = positional.at(1); - - if (!actionNameRef[_emberGlimmerHelpersAction.INVOKE]) { - actionState.actionName = actionNameRef.value(); - } - actionState.eventName = actionState.getEventName(); - - // Not sure if this is needed? If we mutate the actionState is that good enough? - ActionHelper.unregisterAction(actionState); - ActionHelper.registerAction(actionState); - }; + return ClosureComponentReference; + })(_emberGlimmerUtilsReferences.CachedReference); - ActionModifierManager.prototype.getDestructor = function getDestructor(modifier) { - return modifier; - }; + exports.ClosureComponentReference = ClosureComponentReference; - return ActionModifierManager; - })(); + function createCurriedDefinition(definition, args) { + var curriedArgs = curryArgs(definition, args); - exports.default = ActionModifierManager; -}); -enifed('ember-glimmer/protocol-for-url', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { - /* globals module, URL */ + return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentDefinition(definition.name, definition.ComponentClass, definition.template, curriedArgs); + } - 'use strict'; + var EMPTY_BLOCKS = { + default: null, + inverse: null + }; - exports.default = installProtocolForURL; + _emberMetal.runInDebug(function () { + EMPTY_BLOCKS = Object.freeze(EMPTY_BLOCKS); + }); - var nodeURL = undefined; - var parsingNode = undefined; + function curryArgs(definition, newArgs) { + var args = definition.args; + var ComponentClass = definition.ComponentClass; - function installProtocolForURL(environment) { - var protocol = undefined; + var positionalParams = ComponentClass.class.positionalParams; - if (_emberEnvironment.environment.hasDOM) { - protocol = browserProtocolForURL.call(environment, 'foobar:baz'); - } + // The args being passed in are from the (component ...) invocation, + // so the first positional argument is actually the name or component + // definition. It needs to be dropped in order for any actual positional + // args to coincide with the ComponentClass's positionParams. - // Test to see if our DOM implementation parses - // and normalizes URLs. - if (protocol === 'foobar:') { - // Swap in the method that doesn't do this test now that - // we know it works. - environment.protocolForURL = browserProtocolForURL; - } else if (typeof URL === 'object') { - // URL globally provided, likely from FastBoot's sandbox - nodeURL = URL; - environment.protocolForURL = nodeProtocolForURL; - } else if (typeof module === 'object' && typeof module.require === 'function') { - // Otherwise, we need to fall back to our own URL parsing. - // Global `require` is shadowed by Ember's loader so we have to use the fully - // qualified `module.require`. - nodeURL = module.require('url'); - environment.protocolForURL = nodeProtocolForURL; - } else { - throw new Error('Could not find valid URL parsing mechanism for URL Sanitization'); - } - } + // For "normal" curly components this slicing is done at the syntax layer, + // but we don't have that luxury here. - function browserProtocolForURL(url) { - if (!parsingNode) { - parsingNode = document.createElement('a'); - } + var _newArgs$positional$values = newArgs.positional.values; - parsingNode.href = url; - return parsingNode.protocol; - } + var slicedPositionalArgs = _newArgs$positional$values.slice(1); - function nodeProtocolForURL(url) { - var protocol = null; - if (typeof url === 'string') { - protocol = nodeURL.parse(url).protocol; + if (positionalParams && slicedPositionalArgs.length) { + _emberGlimmerSyntaxCurlyComponent.validatePositionalParameters(newArgs.named, slicedPositionalArgs, positionalParams); } - return protocol === null ? ':' : protocol; - } -}); -enifed('ember-glimmer/renderer', ['exports', 'ember-glimmer/utils/references', 'ember-metal', 'glimmer-reference', 'ember-views', 'ember-glimmer/component', 'ember-glimmer/syntax/curly-component', 'ember-glimmer/syntax/outlet'], function (exports, _emberGlimmerUtilsReferences, _emberMetal, _glimmerReference, _emberViews, _emberGlimmerComponent, _emberGlimmerSyntaxCurlyComponent, _emberGlimmerSyntaxOutlet) { - 'use strict'; - var runInTransaction = undefined; + var isRest = typeof positionalParams === 'string'; - if (true || true) { - runInTransaction = _emberMetal.runInTransaction; - } else { - runInTransaction = function (context, methodName) { - context[methodName](); - return false; - }; - } + // For non-rest position params, we need to perform the position -> name mapping + // at each layer to avoid a collision later when the args are used to construct + // the component instance (inside of processArgs(), inside of create()). + var positionalToNamedParams = {}; - var backburner = _emberMetal.run.backburner; + if (!isRest && positionalParams && positionalParams.length > 0) { + var limit = Math.min(positionalParams.length, slicedPositionalArgs.length); - var DynamicScope = (function () { - function DynamicScope(view, outletState, rootOutletState, targetObject) { - babelHelpers.classCallCheck(this, DynamicScope); + for (var i = 0; i < limit; i++) { + var _name = positionalParams[i]; + positionalToNamedParams[_name] = slicedPositionalArgs[i]; + } - this.view = view; - this.outletState = outletState; - this.rootOutletState = rootOutletState; + slicedPositionalArgs.length = 0; // Throw them away since you're merged in. } - DynamicScope.prototype.child = function child() { - return new DynamicScope(this.view, this.outletState, this.rootOutletState); - }; + // args (aka 'oldArgs') may be undefined or simply be empty args, so + // we need to fall back to an empty array or object. + var oldNamed = args && args.named && args.named.map || {}; + var oldPositional = args && args.positional && args.positional.values || []; - DynamicScope.prototype.get = function get(key) { - _emberMetal.assert('Using `-get-dynamic-scope` is only supported for `outletState` (you used `' + key + '`).', key === 'outletState'); - return this.outletState; - }; + // Merge positional arrays + var mergedPositional = new Array(Math.max(oldPositional.length, slicedPositionalArgs.length)); + mergedPositional.splice.apply(mergedPositional, [0, oldPositional.length].concat(oldPositional)); + mergedPositional.splice.apply(mergedPositional, [0, slicedPositionalArgs.length].concat(slicedPositionalArgs)); - DynamicScope.prototype.set = function set(key, value) { - _emberMetal.assert('Using `-with-dynamic-scope` is only supported for `outletState` (you used `' + key + '`).', key === 'outletState'); - this.outletState = value; - return value; - }; + // Merge named maps + var mergedNamed = _emberUtils.assign({}, oldNamed, positionalToNamedParams, newArgs.named.map); - return DynamicScope; - })(); + var mergedArgs = _glimmerRuntime.EvaluatedArgs.create(_glimmerRuntime.EvaluatedPositionalArgs.create(mergedPositional), _glimmerRuntime.EvaluatedNamedArgs.create(mergedNamed), EMPTY_BLOCKS); - var RootState = (function () { - function RootState(root, env, template, self, parentElement, dynamicScope) { - var _this = this; + return mergedArgs; + } - babelHelpers.classCallCheck(this, RootState); + exports.default = function (vm, args, symbolTable) { + return ClosureComponentReference.create(args, symbolTable, vm.env); + }; +}); +enifed('ember-glimmer/helpers/concat', ['exports', 'ember-glimmer/utils/references', '@glimmer/runtime'], function (exports, _emberGlimmerUtilsReferences, _glimmerRuntime) { + 'use strict'; - _emberMetal.assert('You cannot render `' + self.value() + '` without a template.', template); + /** + @module ember + @submodule ember-glimmer + */ - this.id = _emberViews.getViewId(root); - this.env = env; - this.root = root; - this.result = undefined; - this.shouldReflush = false; - this.destroyed = false; - this._removing = false; + /** + Concatenates the given arguments into a string. + + Example: + + ```handlebars + {{some-component name=(concat firstName " " lastName)}} + + {{! would pass name=" " to the component}} + ``` + + @public + @method concat + @for Ember.Templates.helpers + @since 1.13.0 + */ + function concat(_ref) { + var positional = _ref.positional; - var options = this.options = { - alwaysRevalidate: false - }; + return positional.value().map(_glimmerRuntime.normalizeTextValue).join(''); + } - this.render = function () { - var result = _this.result = template.render(self, parentElement, dynamicScope); + exports.default = function (vm, args) { + return new _emberGlimmerUtilsReferences.InternalHelperReference(concat, args); + }; +}); +enifed('ember-glimmer/helpers/each-in', ['exports', 'ember-utils'], function (exports, _emberUtils) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; - // override .render function after initial render - _this.render = function () { - result.rerender(options); - }; - }; - } + exports.isEachIn = isEachIn; - RootState.prototype.isFor = function isFor(possibleRoot) { - return this.root === possibleRoot; - }; + /** + The `{{#each}}` helper loops over elements in a collection. It is an extension + of the base Handlebars `{{#each}}` helper. + The default behavior of `{{#each}}` is to yield its inner block once for every + item in an array passing the item as the first block parameter. + + ```javascript + var developers = [{ name: 'Yehuda' },{ name: 'Tom' }, { name: 'Paul' }]; + ``` + + ```handlebars + {{#each developers key="name" as |person|}} + {{person.name}} + {{! `this` is whatever it was outside the #each }} + {{/each}} + ``` + + The same rules apply to arrays of primitives. + + ```javascript + var developerNames = ['Yehuda', 'Tom', 'Paul'] + ``` + + ```handlebars + {{#each developerNames key="@index" as |name|}} + {{name}} + {{/each}} + ``` + + During iteration, the index of each item in the array is provided as a second block parameter. + + ```handlebars +
      + {{#each people as |person index|}} +
    • Hello, {{person.name}}! You're number {{index}} in line
    • + {{/each}} +
    + ``` + + ### Specifying Keys + + The `key` option is used to tell Ember how to determine if the array being + iterated over with `{{#each}}` has changed between renders. By helping Ember + detect that some elements in the array are the same, DOM elements can be + re-used, significantly improving rendering speed. + + For example, here's the `{{#each}}` helper with its `key` set to `id`: + + ```handlebars + {{#each model key="id" as |item|}} + {{/each}} + ``` + + When this `{{#each}}` re-renders, Ember will match up the previously rendered + items (and reorder the generated DOM elements) based on each item's `id` + property. + By default the item's own reference is used. + + ### {{else}} condition + + `{{#each}}` can have a matching `{{else}}`. The contents of this block will render + if the collection is empty. + + ```handlebars + {{#each developers as |person|}} + {{person.name}} + {{else}} +

    Sorry, nobody is available for this task.

    + {{/each}} + ``` + + @method each + @for Ember.Templates.helpers + @public + */ - RootState.prototype.destroy = function destroy() { - var result = this.result; - var env = this.env; + /** + The `{{each-in}}` helper loops over properties on an object. + + For example, given a `user` object that looks like: + + ```javascript + { + "name": "Shelly Sails", + "age": 42 + } + ``` + + This template would display all properties on the `user` + object in a list: + + ```handlebars +
      + {{#each-in user as |key value|}} +
    • {{key}}: {{value}}
    • + {{/each-in}} +
    + ``` + + Outputting their name and age. + + @method each-in + @for Ember.Templates.helpers + @public + @since 2.1.0 + */ + var EACH_IN_REFERENCE = _emberUtils.symbol('EACH_IN'); - this.destroyed = true; + function isEachIn(ref) { + return ref && ref[EACH_IN_REFERENCE]; + } - this.env = null; - this.root = null; - this.result = null; - this.render = null; + exports.default = function (vm, args) { + var ref = Object.create(args.positional.at(0)); + ref[EACH_IN_REFERENCE] = true; + return ref; + }; +}); +enifed('ember-glimmer/helpers/get', ['exports', 'ember-metal', 'ember-glimmer/utils/references', '@glimmer/reference'], function (exports, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference) { + 'use strict'; - if (result) { - /* - Handles these scenarios: - * When roots are removed during standard rendering process, a transaction exists already - `.begin()` / `.commit()` are not needed. - * When roots are being destroyed manually (`component.append(); component.destroy() case), no - transaction exists already. - * When roots are being destroyed during `Renderer#destroy`, no transaction exists - */ - var needsTransaction = !env.inTransaction; + /** + @module ember + @submodule ember-glimmer + */ - if (needsTransaction) { - env.begin(); - } + /** + 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}} + + + ``` + + The `{{get}}` helper can also respect mutable values itself. For example: + + ```handlebars + {{input value=(mut (get person factName)) type="text"}} + + + ``` + + 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 + @since 2.1.0 + */ - result.destroy(); + exports.default = function (vm, args) { + return GetHelperReference.create(args.positional.at(0), args.positional.at(1)); + }; - if (needsTransaction) { - env.commit(); - } + var GetHelperReference = (function (_CachedReference) { + babelHelpers.inherits(GetHelperReference, _CachedReference); + + GetHelperReference.create = function create(sourceReference, pathReference) { + if (_glimmerReference.isConst(pathReference)) { + var parts = pathReference.value().split('.'); + return _glimmerReference.referenceFromParts(sourceReference, parts); + } else { + return new GetHelperReference(sourceReference, pathReference); } }; - return RootState; - })(); - - var renderers = []; + function GetHelperReference(sourceReference, pathReference) { + babelHelpers.classCallCheck(this, GetHelperReference); - _emberMetal.setHasViews(function () { - return renderers.length > 0; - }); + _CachedReference.call(this); + this.sourceReference = sourceReference; + this.pathReference = pathReference; - function register(renderer) { - _emberMetal.assert('Cannot register the same renderer twice', renderers.indexOf(renderer) === -1); - renderers.push(renderer); - } + this.lastPath = null; + this.innerReference = null; - function deregister(renderer) { - var index = renderers.indexOf(renderer); - _emberMetal.assert('Cannot deregister unknown unregistered renderer', index !== -1); - renderers.splice(index, 1); - } + var innerTag = this.innerTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - function loopBegin() { - for (var i = 0; i < renderers.length; i++) { - renderers[i]._scheduleRevalidate(); + this.tag = _glimmerReference.combine([sourceReference.tag, pathReference.tag, innerTag]); } - } - function K() {} + GetHelperReference.prototype.compute = function compute() { + var lastPath = this.lastPath; + var innerReference = this.innerReference; + var innerTag = this.innerTag; - var loops = 0; - function loopEnd(current, next) { - for (var i = 0; i < renderers.length; i++) { - if (!renderers[i]._isValid()) { - if (loops > 10) { - loops = 0; - // TODO: do something better - renderers[i].destroy(); - throw new Error('infinite rendering invalidation detected'); + var path = this.lastPath = this.pathReference.value(); + + if (path !== lastPath) { + if (path) { + var pathType = typeof path; + + if (pathType === 'string') { + innerReference = this.innerReference = _glimmerReference.referenceFromParts(this.sourceReference, path.split('.')); + } else if (pathType === 'number') { + innerReference = this.innerReference = this.sourceReference.get(path); + } + + innerTag.update(innerReference.tag); + } else { + innerReference = this.innerReference = null; + innerTag.update(_glimmerReference.CONSTANT_TAG); } - loops++; - return backburner.join(null, K); } - } - loops = 0; - } - backburner.on('begin', loopBegin); - backburner.on('end', loopEnd); + return innerReference ? innerReference.value() : null; + }; - var Renderer = (function () { - function Renderer(env, rootTemplate) { - var _viewRegistry = arguments.length <= 2 || arguments[2] === undefined ? _emberViews.fallbackViewRegistry : arguments[2]; + GetHelperReference.prototype[_emberGlimmerUtilsReferences.UPDATE] = function (value) { + _emberMetal.set(this.sourceReference.value(), this.pathReference.value(), value); + }; - var destinedForDOM = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3]; - babelHelpers.classCallCheck(this, Renderer); + return GetHelperReference; + })(_emberGlimmerUtilsReferences.CachedReference); +}); +enifed("ember-glimmer/helpers/hash", ["exports"], function (exports) { + /** + @module ember + @submodule ember-glimmer + */ - this._env = env; - this._rootTemplate = rootTemplate; - this._viewRegistry = _viewRegistry; - this._destinedForDOM = destinedForDOM; - this._destroyed = false; - this._roots = []; - this._lastRevision = null; - this._isRenderingRoots = false; - this._removedRoots = []; - } + /** + Use the `{{hash}}` helper to create a hash to pass as an option to your + components. This is specially useful for contextual components where you can + just yield a hash: + + ```handlebars + {{yield (hash + name='Sarah' + title=office + )}} + ``` + + Would result in an object such as: + + ```js + { name: 'Sarah', title: this.get('office') } + ``` + + Where the `title` is bound to updates of the `office` property. + + @method hash + @for Ember.Templates.helpers + @param {Object} options + @return {Object} Hash + @since 2.3.0 + @public + */ - // renderer HOOKS + "use strict"; - Renderer.prototype.appendOutletView = function appendOutletView(view, target) { - var definition = new _emberGlimmerSyntaxOutlet.TopLevelOutletComponentDefinition(view); - var outletStateReference = view.toReference(); - var targetObject = view.outletState.render.controller; + exports.default = function (vm, args) { + return args.named; + }; +}); +enifed('ember-glimmer/helpers/if-unless', ['exports', 'ember-metal', 'ember-glimmer/utils/references', '@glimmer/reference'], function (exports, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference) { + /** + @module ember + @submodule ember-glimmer + */ - this._appendDefinition(view, definition, target, outletStateReference, targetObject); - }; + 'use strict'; - Renderer.prototype.appendTo = function appendTo(view, target) { - var rootDef = new _emberGlimmerSyntaxCurlyComponent.RootComponentDefinition(view); + exports.inlineIf = inlineIf; + exports.inlineUnless = inlineUnless; - this._appendDefinition(view, rootDef, target); - }; + /** + 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`, `NaN` or an empty array, the block will not be rendered. + + ```handlebars + {{! will not render if foo is falsey}} + {{#if foo}} + Welcome to the {{foo.bar}} + {{/if}} + ``` + + You can also specify a template to show if the property is falsey by using + the `else` helper. + + ```handlebars + {{! is it raining outside?}} + {{#if isRaining}} + Yes, grab an umbrella! + {{else}} + No, it's lovely outside! + {{/if}} + ``` + + You are also able to combine `else` and `if` helpers to create more complex + conditional logic. + + ```handlebars + {{#if isMorning}} + Good morning + {{else if isAfternoon}} + Good afternoon + {{else}} + Good night + {{/if}} + ``` + + You can use `if` inline to conditionally render a single property or string. + This helper acts like a ternary operator. If the first property is truthy, + the second argument will be displayed, if not, the third argument will be + displayed + + ```handlebars + {{if useLongGreeting "Hello" "Hi"}} Dave + ``` + + Finally, you can use the `if` helper inside another helper as a subexpression. + + ```handlebars + {{some-component height=(if isBig "100" "10")}} + ``` + + @method if + @for Ember.Templates.helpers + @public + */ - Renderer.prototype._appendDefinition = function _appendDefinition(root, definition, target) { - var outletStateReference = arguments.length <= 3 || arguments[3] === undefined ? _glimmerReference.UNDEFINED_REFERENCE : arguments[3]; - var targetObject = arguments.length <= 4 || arguments[4] === undefined ? null : arguments[4]; + var ConditionalHelperReference = (function (_CachedReference) { + babelHelpers.inherits(ConditionalHelperReference, _CachedReference); - var self = new _emberGlimmerUtilsReferences.RootReference(definition); - var dynamicScope = new DynamicScope(null, outletStateReference, outletStateReference, true, targetObject); - var rootState = new RootState(root, this._env, this._rootTemplate, self, target, dynamicScope); + ConditionalHelperReference.create = function create(_condRef, _truthyRef, _falsyRef) { + var condRef = _emberGlimmerUtilsReferences.ConditionalReference.create(_condRef); + var truthyRef = _truthyRef || _emberGlimmerUtilsReferences.UNDEFINED_REFERENCE; + var falsyRef = _falsyRef || _emberGlimmerUtilsReferences.UNDEFINED_REFERENCE; - this._renderRoot(rootState); + if (_glimmerReference.isConst(condRef)) { + return condRef.value() ? truthyRef : falsyRef; + } else { + return new ConditionalHelperReference(condRef, truthyRef, falsyRef); + } }; - Renderer.prototype.rerender = function rerender(view) { - this._scheduleRevalidate(); - }; + function ConditionalHelperReference(cond, truthy, falsy) { + babelHelpers.classCallCheck(this, ConditionalHelperReference); - Renderer.prototype.register = function register(view) { - var id = _emberViews.getViewId(view); - _emberMetal.assert('Attempted to register a view with an id already in use: ' + id, !this._viewRegistry[id]); - this._viewRegistry[id] = view; - }; + _CachedReference.call(this); - Renderer.prototype.unregister = function unregister(view) { - delete this._viewRegistry[_emberViews.getViewId(view)]; - }; + this.branchTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); + this.tag = _glimmerReference.combine([cond.tag, this.branchTag]); - Renderer.prototype.remove = function remove(view) { - view._transitionTo('destroying'); + this.cond = cond; + this.truthy = truthy; + this.falsy = falsy; + } - this.cleanupRootFor(view); + /** + The inline `if` helper conditionally renders a single property or string. + This helper acts like a ternary operator. If the first property is truthy, + the second argument will be displayed, otherwise, the third argument will be + displayed + + ```handlebars + {{if useLongGreeting "Hello" "Hi"}} Alex + ``` + + You can use the `if` helper inside another helper as a subexpression. + + ```handlebars + {{some-component height=(if isBig "100" "10")}} + ``` + + @method if + @for Ember.Templates.helpers + @public + */ - _emberViews.setViewElement(view, null); + ConditionalHelperReference.prototype.compute = function compute() { + var cond = this.cond; + var truthy = this.truthy; + var falsy = this.falsy; - if (this._destinedForDOM) { - view.trigger('didDestroyElement'); - } + var branch = cond.value() ? truthy : falsy; - if (!view.isDestroying) { - view.destroy(); - } + this.branchTag.update(branch.tag); + + return branch.value(); }; - Renderer.prototype.cleanupRootFor = function cleanupRootFor(view) { - // no need to cleanup roots if we have already been destroyed - if (this._destroyed) { - return; - } + return ConditionalHelperReference; + })(_emberGlimmerUtilsReferences.CachedReference); - var roots = this._roots; + function inlineIf(vm, _ref) { + var positional = _ref.positional; - // traverse in reverse so we can remove items - // without mucking up the index - var i = this._roots.length; - while (i--) { - var root = roots[i]; - if (root.isFor(view)) { - root.destroy(); - } - } - }; - - Renderer.prototype.destroy = function destroy() { - if (this._destroyed) { - return; - } - this._destroyed = true; - this._clearAllRoots(); - }; - - Renderer.prototype.getElement = function getElement(view) { - // overriden in the subclasses - }; - - Renderer.prototype.getBounds = function getBounds(view) { - var bounds = view[_emberGlimmerComponent.BOUNDS]; - - var parentElement = bounds.parentElement(); - var firstNode = bounds.firstNode(); - var lastNode = bounds.lastNode(); - - return { parentElement: parentElement, firstNode: firstNode, lastNode: lastNode }; - }; - - Renderer.prototype.createElement = function createElement(tagName) { - return this._env.getAppendOperations().createElement(tagName); - }; - - Renderer.prototype._renderRoot = function _renderRoot(root) { - var roots = this._roots; - - roots.push(root); - - if (roots.length === 1) { - register(this); - } - - this._renderRootsTransaction(); - }; - - Renderer.prototype._renderRoots = function _renderRoots() { - var roots = this._roots; - var env = this._env; - var removedRoots = this._removedRoots; - - var globalShouldReflush = undefined, - initialRootsLength = undefined; - - do { - env.begin(); - - // ensure that for the first iteration of the loop - // each root is processed - initialRootsLength = roots.length; - globalShouldReflush = false; - - for (var i = 0; i < roots.length; i++) { - var root = roots[i]; - - if (root.destroyed) { - // add to the list of roots to be removed - // they will be removed from `this._roots` later - removedRoots.push(root); - - // skip over roots that have been marked as destroyed - continue; - } - - var shouldReflush = root.shouldReflush; - - // when processing non-initial reflush loops, - // do not process more roots than needed - if (i >= initialRootsLength && !shouldReflush) { - continue; - } - - root.options.alwaysRevalidate = shouldReflush; - // track shouldReflush based on this roots render result - shouldReflush = root.shouldReflush = runInTransaction(root, 'render'); - - // globalShouldReflush should be `true` if *any* of - // the roots need to reflush - globalShouldReflush = globalShouldReflush || shouldReflush; - } - - this._lastRevision = _glimmerReference.CURRENT_TAG.value(); - - env.commit(); - } while (globalShouldReflush || roots.length > initialRootsLength); - - // remove any roots that were destroyed during this transaction - while (removedRoots.length) { - var root = removedRoots.pop(); - - var rootIndex = roots.indexOf(root); - roots.splice(rootIndex, 1); - } - - if (this._roots.length === 0) { - deregister(this); - } - }; - - Renderer.prototype._renderRootsTransaction = function _renderRootsTransaction() { - if (this._isRenderingRoots) { - // currently rendering roots, a new root was added and will - // be processed by the existing _renderRoots invocation - return; - } - - // used to prevent calling _renderRoots again (see above) - // while we are actively rendering roots - this._isRenderingRoots = true; - - var completedWithoutError = false; - try { - this._renderRoots(); - completedWithoutError = true; - } finally { - if (!completedWithoutError) { - this._lastRevision = _glimmerReference.CURRENT_TAG.value(); - } - this._isRenderingRoots = false; - } - }; - - Renderer.prototype._clearAllRoots = function _clearAllRoots() { - var roots = this._roots; - for (var i = 0; i < roots.length; i++) { - var root = roots[i]; - root.destroy(); - } - - this._removedRoots.length = 0; - this._roots = null; - - // if roots were present before destroying - // deregister this renderer instance - if (roots.length) { - deregister(this); - } - }; - - Renderer.prototype._scheduleRevalidate = function _scheduleRevalidate() { - backburner.scheduleOnce('render', this, this._revalidate); - }; - - Renderer.prototype._isValid = function _isValid() { - return this._destroyed || this._roots.length === 0 || _glimmerReference.CURRENT_TAG.validate(this._lastRevision); - }; - - Renderer.prototype._revalidate = function _revalidate() { - if (this._isValid()) { - return; - } - this._renderRootsTransaction(); - }; - - return Renderer; - })(); - - var InertRenderer = (function (_Renderer) { - babelHelpers.inherits(InertRenderer, _Renderer); - - function InertRenderer() { - babelHelpers.classCallCheck(this, InertRenderer); - - _Renderer.apply(this, arguments); + switch (positional.length) { + case 2: + return ConditionalHelperReference.create(positional.at(0), positional.at(1), null); + case 3: + return ConditionalHelperReference.create(positional.at(0), positional.at(1), positional.at(2)); + default: + _emberMetal.assert('The inline form of the `if` helper expects two or three arguments, e.g. ' + '`{{if trialExpired "Expired" expiryDate}}`.'); } + } - InertRenderer.create = function create(_ref) { - var env = _ref.env; - var rootTemplate = _ref.rootTemplate; - var _viewRegistry = _ref._viewRegistry; - - return new this(env, rootTemplate, _viewRegistry, false); - }; - - InertRenderer.prototype.getElement = function getElement(view) { - throw new Error('Accessing `this.element` is not allowed in non-interactive environments (such as FastBoot).'); - }; - - return InertRenderer; - })(Renderer); - - exports.InertRenderer = InertRenderer; - - var InteractiveRenderer = (function (_Renderer2) { - babelHelpers.inherits(InteractiveRenderer, _Renderer2); + /** + The inline `unless` helper conditionally renders a single property or string. + This helper acts like a ternary operator. If the first property is falsy, + the second argument will be displayed, otherwise, the third argument will be + displayed + + ```handlebars + {{unless useLongGreeting "Hi" "Hello"}} Ben + ``` + + You can use the `unless` helper inside another helper as a subexpression. + + ```handlebars + {{some-component height=(unless isBig "10" "100")}} + ``` + + @method unless + @for Ember.Templates.helpers + @public + */ - function InteractiveRenderer() { - babelHelpers.classCallCheck(this, InteractiveRenderer); + function inlineUnless(vm, _ref2) { + var positional = _ref2.positional; - _Renderer2.apply(this, arguments); + switch (positional.length) { + case 2: + return ConditionalHelperReference.create(positional.at(0), null, positional.at(1)); + case 3: + return ConditionalHelperReference.create(positional.at(0), positional.at(2), positional.at(1)); + default: + _emberMetal.assert('The inline form of the `unless` helper expects two or three arguments, e.g. ' + '`{{unless isFirstLogin "Welcome back!"}}`.'); } + } +}); +enifed('ember-glimmer/helpers/loc', ['exports', 'ember-glimmer/utils/references', 'ember-runtime'], function (exports, _emberGlimmerUtilsReferences, _emberRuntime) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; - InteractiveRenderer.create = function create(_ref2) { - var env = _ref2.env; - var rootTemplate = _ref2.rootTemplate; - var _viewRegistry = _ref2._viewRegistry; - - return new this(env, rootTemplate, _viewRegistry, true); - }; - - InteractiveRenderer.prototype.getElement = function getElement(view) { - return _emberViews.getViewElement(view); + /** + Calls [Ember.String.loc](/api/classes/Ember.String.html#method_loc) with the + provided string. This is a convenient way to localize text within a template. + For example: + + ```javascript + Ember.STRINGS = { + '_welcome_': 'Bonjour' }; + ``` + + ```handlebars +
    + {{loc '_welcome_'}} +
    + ``` + + ```html +
    + Bonjour +
    + ``` + + See [Ember.String.loc](/api/classes/Ember.String.html#method_loc) for how to + set up localized string references. + + @method loc + @for Ember.Templates.helpers + @param {String} str The string to format. + @see {Ember.String#loc} + @public + */ + function locHelper(_ref) { + var positional = _ref.positional; - return InteractiveRenderer; - })(Renderer); + return _emberRuntime.String.loc.apply(null, positional.value()); + } - exports.InteractiveRenderer = InteractiveRenderer; + exports.default = function (vm, args) { + return new _emberGlimmerUtilsReferences.InternalHelperReference(locHelper, args); + }; }); -enifed('ember-glimmer/setup-registry', ['exports', 'ember-environment', 'container', 'ember-glimmer/renderer', 'ember-glimmer/dom', 'ember-glimmer/views/outlet', 'ember-glimmer/components/text_field', 'ember-glimmer/components/text_area', 'ember-glimmer/components/checkbox', 'ember-glimmer/components/link-to', 'ember-glimmer/component', 'ember-glimmer/templates/component', 'ember-glimmer/templates/root', 'ember-glimmer/templates/outlet', 'ember-glimmer/environment'], function (exports, _emberEnvironment, _container, _emberGlimmerRenderer, _emberGlimmerDom, _emberGlimmerViewsOutlet, _emberGlimmerComponentsText_field, _emberGlimmerComponentsText_area, _emberGlimmerComponentsCheckbox, _emberGlimmerComponentsLinkTo, _emberGlimmerComponent, _emberGlimmerTemplatesComponent, _emberGlimmerTemplatesRoot, _emberGlimmerTemplatesOutlet, _emberGlimmerEnvironment) { +enifed('ember-glimmer/helpers/log', ['exports', 'ember-glimmer/utils/references', 'ember-console'], function (exports, _emberGlimmerUtilsReferences, _emberConsole) { 'use strict'; - exports.setupApplicationRegistry = setupApplicationRegistry; - exports.setupEngineRegistry = setupEngineRegistry; - - var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['template:-root'], ['template:-root']), - _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['template:components/-default'], ['template:components/-default']), - _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['component:-default'], ['component:-default']); + /** + `log` allows you to output the value of variables in the current rendering + context. `log` also accepts primitive types such as strings or numbers. + + ```handlebars + {{log "myVariable:" myVariable }} + ``` + + @method log + @for Ember.Templates.helpers + @param {Array} params + @public + */ + function log(_ref) { + var positional = _ref.positional; - function setupApplicationRegistry(registry) { - registry.injection('service:-glimmer-environment', 'appendOperations', 'service:-dom-tree-construction'); - registry.injection('renderer', 'env', 'service:-glimmer-environment'); + _emberConsole.default.log.apply(null, positional.value()); + } - registry.register(_container.privatize(_templateObject), _emberGlimmerTemplatesRoot.default); - registry.injection('renderer', 'rootTemplate', _container.privatize(_templateObject)); + exports.default = function (vm, args) { + return new _emberGlimmerUtilsReferences.InternalHelperReference(log, args); + }; +}); - registry.register('renderer:-dom', _emberGlimmerRenderer.InteractiveRenderer); - registry.register('renderer:-inert', _emberGlimmerRenderer.InertRenderer); +/** +@module ember +@submodule ember-glimmer +*/ +enifed('ember-glimmer/helpers/mut', ['exports', 'ember-utils', 'ember-metal', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/action'], function (exports, _emberUtils, _emberMetal, _emberGlimmerUtilsReferences, _emberGlimmerHelpersAction) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; - if (_emberEnvironment.environment.hasDOM) { - registry.injection('service:-glimmer-environment', 'updateOperations', 'service:-dom-changes'); - } + exports.isMut = isMut; + exports.unMut = unMut; - registry.register('service:-dom-changes', { - create: function (_ref) { - var document = _ref.document; - return new _emberGlimmerDom.DOMChanges(document); + /** + 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 component__. + + To specify that a parameter is mutable, when invoking the child `Component`: + + ```handlebars + {{my-child childClickCount=(mut totalClicks)}} + ``` + + The child `Component` can then modify the parent's value just by modifying its own + property: + + ```javascript + // my-child.js + export default Component.extend({ + click() { + this.incrementProperty('childClickCount'); } }); - - registry.register('service:-dom-tree-construction', { - create: function (_ref2) { - var document = _ref2.document; - - var Implementation = _emberEnvironment.environment.hasDOM ? _emberGlimmerDom.DOMTreeConstruction : _emberGlimmerDom.NodeDOMTreeConstruction; - return new Implementation(document); + ``` + + Note that for curly components (`{{my-component}}`) the bindings are already mutable, + making the `mut` unnecessary. + + Additionally, the `mut` helper can be combined with the `action` helper to + mutate a value. For example: + + ```handlebars + {{my-child childClickCount=totalClicks click-count-change=(action (mut totalClicks))}} + ``` + + The child `Component` would invoke the action with the new click value: + + ```javascript + // my-child.js + export default Component.extend({ + click() { + this.get('click-count-change')(this.get('childClickCount') + 1); } }); - } - - function setupEngineRegistry(registry) { - registry.register('view:-outlet', _emberGlimmerViewsOutlet.default); - registry.register('template:-outlet', _emberGlimmerTemplatesOutlet.default); - registry.injection('view:-outlet', 'template', 'template:-outlet'); - - registry.injection('service:-dom-changes', 'document', 'service:-document'); - registry.injection('service:-dom-tree-construction', 'document', 'service:-document'); - - registry.register(_container.privatize(_templateObject2), _emberGlimmerTemplatesComponent.default); - - registry.register('service:-glimmer-environment', _emberGlimmerEnvironment.default); - registry.injection('template', 'env', 'service:-glimmer-environment'); - - registry.optionsForType('helper', { instantiate: false }); - - registry.register('component:-text-field', _emberGlimmerComponentsText_field.default); - registry.register('component:-text-area', _emberGlimmerComponentsText_area.default); - registry.register('component:-checkbox', _emberGlimmerComponentsCheckbox.default); - registry.register('component:link-to', _emberGlimmerComponentsLinkTo.default); - registry.register(_container.privatize(_templateObject3), _emberGlimmerComponent.default); - } -}); -enifed('ember-glimmer/syntax', ['exports', 'ember-glimmer/syntax/render', 'ember-glimmer/syntax/outlet', 'ember-glimmer/syntax/mount', 'ember-glimmer/syntax/dynamic-component', 'ember-glimmer/syntax/input', 'glimmer-runtime'], function (exports, _emberGlimmerSyntaxRender, _emberGlimmerSyntaxOutlet, _emberGlimmerSyntaxMount, _emberGlimmerSyntaxDynamicComponent, _emberGlimmerSyntaxInput, _glimmerRuntime) { - 'use strict'; - - exports.registerSyntax = registerSyntax; - exports.findSyntaxBuilder = findSyntaxBuilder; - - var syntaxKeys = []; - var syntaxes = []; + ``` + + The `mut` helper changes the `totalClicks` value to what was provided as the action argument. + + The `mut` helper, when used with `action`, will return a function that + sets the value passed to `mut` to its first argument. This works like any other + closure action and interacts with the other features `action` provides. + As an example, we can create a button that increments a value passing the value + directly to the `action`: + + ```handlebars + {{! inc helper is not provided by Ember }} + + ``` + + You can also use the `value` option: + + ```handlebars + + ``` + + @method mut + @param {Object} [attr] the "two-way" attribute that can be modified. + @for Ember.Templates.helpers + @public + */ + var MUT_REFERENCE = _emberUtils.symbol('MUT'); + var SOURCE = _emberUtils.symbol('SOURCE'); - function registerSyntax(key, syntax) { - syntaxKeys.push(key); - syntaxes.push(syntax); + function isMut(ref) { + return ref && ref[MUT_REFERENCE]; } - function findSyntaxBuilder(key) { - var index = syntaxKeys.indexOf(key); - - if (index > -1) { - return syntaxes[index]; - } + function unMut(ref) { + return ref[SOURCE] || ref; } - registerSyntax('render', _emberGlimmerSyntaxRender.RenderSyntax); - registerSyntax('outlet', _emberGlimmerSyntaxOutlet.OutletSyntax); - registerSyntax('mount', _emberGlimmerSyntaxMount.MountSyntax); - registerSyntax('component', _emberGlimmerSyntaxDynamicComponent.DynamicComponentSyntax); - registerSyntax('input', _emberGlimmerSyntaxInput.InputSyntax); + exports.default = function (vm, args) { + var rawRef = args.positional.at(0); - registerSyntax('-with-dynamic-vars', (function () { - function _class() { - babelHelpers.classCallCheck(this, _class); + if (isMut(rawRef)) { + return rawRef; } - _class.create = function create(environment, args, symbolTable) { - return new _glimmerRuntime.WithDynamicVarsSyntax(args); - }; - - return _class; - })()); + // TODO: Improve this error message. This covers at least two distinct + // cases: + // + // 1. (mut "not a path") – passing a literal, result from a helper + // invocation, etc + // + // 2. (mut receivedValue) – passing a value received from the caller + // that was originally derived from a literal, result from a helper + // invocation, etc + // + // This message is alright for the first case, but could be quite + // confusing for the second case. + _emberMetal.assert('You can only pass a path to mut', rawRef[_emberGlimmerUtilsReferences.UPDATE]); - registerSyntax('-in-element', (function () { - function _class2() { - babelHelpers.classCallCheck(this, _class2); - } + var wrappedRef = Object.create(rawRef); - _class2.create = function create(environment, args, symbolTable) { - return new _glimmerRuntime.InElementSyntax(args); - }; + wrappedRef[SOURCE] = rawRef; + wrappedRef[_emberGlimmerHelpersAction.INVOKE] = rawRef[_emberGlimmerUtilsReferences.UPDATE]; + wrappedRef[MUT_REFERENCE] = true; - return _class2; - })()); + return wrappedRef; + }; }); -enifed('ember-glimmer/syntax/curly-component', ['exports', 'ember-utils', 'glimmer-runtime', 'ember-glimmer/utils/bindings', 'ember-glimmer/component', 'ember-metal', 'ember-views', 'ember-glimmer/utils/process-args', 'container'], function (exports, _emberUtils, _glimmerRuntime, _emberGlimmerUtilsBindings, _emberGlimmerComponent, _emberMetal, _emberViews, _emberGlimmerUtilsProcessArgs, _container) { +enifed('ember-glimmer/helpers/query-param', ['exports', 'ember-utils', 'ember-glimmer/utils/references', 'ember-metal', 'ember-routing'], function (exports, _emberUtils, _emberGlimmerUtilsReferences, _emberMetal, _emberRouting) { + /** + @module ember + @submodule ember-glimmer + */ 'use strict'; - exports.validatePositionalParameters = validatePositionalParameters; + /** + This is a helper to be used in conjunction with the link-to helper. + It will supply url query parameters to the target route. + + Example + + ```handlebars + {{#link-to 'posts' (query-params direction="asc")}}Sort{{/link-to}} + ``` + + @method query-params + @for Ember.Templates.helpers + @param {Object} hash takes a hash of query parameters + @return {Object} A `QueryParams` object for `{{link-to}}` + @public + */ + function queryParams(_ref) { + var positional = _ref.positional; + var named = _ref.named; - var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['template:components/-default'], ['template:components/-default']); + _emberMetal.assert('The `query-params` helper only accepts hash parameters, e.g. (query-params queryParamPropertyName=\'foo\') as opposed to just (query-params \'foo\')', positional.value().length === 0); - var DEFAULT_LAYOUT = _container.privatize(_templateObject); + return _emberRouting.QueryParams.create({ + values: _emberUtils.assign({}, named.value()) + }); + } - function processComponentInitializationAssertions(component, props) { - _emberMetal.assert('classNameBindings must not have spaces in them: ' + component.toString(), (function () { - var classNameBindings = component.classNameBindings; - - for (var i = 0; i < classNameBindings.length; i++) { - var binding = classNameBindings[i]; - if (binding.split(' ').length > 1) { - return false; - } - } - return true; - })()); - - _emberMetal.assert('You cannot use `classNameBindings` on a tag-less component: ' + component.toString(), (function () { - var classNameBindings = component.classNameBindings; - var tagName = component.tagName; - - return tagName !== '' || !classNameBindings || classNameBindings.length === 0; - })()); - - _emberMetal.assert('You cannot use `elementId` on a tag-less component: ' + component.toString(), (function () { - var elementId = component.elementId; - var tagName = component.tagName; - - return tagName !== '' || props.id === elementId || !elementId && elementId !== ''; - })()); - - _emberMetal.assert('You cannot use `attributeBindings` on a tag-less component: ' + component.toString(), (function () { - var attributeBindings = component.attributeBindings; - var tagName = component.tagName; - - return tagName !== '' || !attributeBindings || attributeBindings.length === 0; - })()); - } + exports.default = function (vm, args) { + return new _emberGlimmerUtilsReferences.InternalHelperReference(queryParams, args); + }; +}); +enifed('ember-glimmer/helpers/readonly', ['exports', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/mut'], function (exports, _emberGlimmerUtilsReferences, _emberGlimmerHelpersMut) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; - function validatePositionalParameters(named, positional, positionalParamsDefinition) { - _emberMetal.runInDebug(function () { - if (!named || !positional || !positional.length) { - return; + /** + The `readonly` helper let's you specify that a binding is one-way only, + instead of two-way. + When you pass a `readonly` binding from an outer context (e.g. parent component), + to to an inner context (e.g. child component), you are saying that changing that + property in the inner context does not change the value in the outer context. + + To specify that a binding is read-only, when invoking the child `Component`: + + ```app/components/my-parent.js + export default Component.extend({ + totalClicks: 3 + }); + ``` + + ```app/templates/components/my-parent.hbs + {{log totalClicks}} // -> 3 + {{my-child childClickCount=(readonly totalClicks)}} + ``` + + Now, when you update `childClickCount`: + + ```app/components/my-child.js + export default Component.extend({ + click() { + this.incrementProperty('childClickCount'); } - - var paramType = typeof positionalParamsDefinition; - - if (paramType === 'string') { - _emberMetal.assert('You cannot specify positional parameters and the hash argument `' + positionalParamsDefinition + '`.', !named.has(positionalParamsDefinition)); - } else { - if (positional.length < positionalParamsDefinition.length) { - positionalParamsDefinition = positionalParamsDefinition.slice(0, positional.length); - } - - for (var i = 0; i < positionalParamsDefinition.length; i++) { - var _name = positionalParamsDefinition[i]; - - _emberMetal.assert('You cannot specify both a positional param (at position ' + i + ') and the hash argument `' + _name + '`.', !named.has(_name)); - } + }); + ``` + + The value updates in the child component, but not the parent component: + + ```app/templates/components/my-child.hbs + {{log childClickCount}} //-> 4 + ``` + + ```app/templates/components/my-parent.hbs + {{log totalClicks}} //-> 3 + {{my-child childClickCount=(readonly totalClicks)}} + ``` + + ### Objects and Arrays + + When passing a property that is a complex object (e.g. object, array) instead of a primitive object (e.g. number, string), + only the reference to the object is protected using the readonly helper. + This means that you can change properties of the object both on the parent component, as well as the child component. + The `readonly` binding behaves similar to the `const` keyword in JavaScript. + + Let's look at an example: + + First let's set up the parent component: + + ```app/components/my-parent.js + export default Ember.Component.extend({ + clicks: null, + + init() { + this._super(...arguments); + this.set('clicks', { total: 3 }); } }); - } - - function aliasIdToElementId(args, props) { - if (args.named.has('id')) { - _emberMetal.assert('You cannot invoke a component with both \'id\' and \'elementId\' at the same time.', !args.named.has('elementId')); - props.elementId = props.id; - } - } - - // We must traverse the attributeBindings in reverse keeping track of - // what has already been applied. This is essentially refining the concated - // properties applying right to left. - function applyAttributeBindings(element, attributeBindings, component, operations) { - var seen = []; - var i = attributeBindings.length - 1; - - while (i !== -1) { - var binding = attributeBindings[i]; - var parsed = _emberGlimmerUtilsBindings.AttributeBinding.parse(binding); - var attribute = parsed[1]; - - if (seen.indexOf(attribute) === -1) { - seen.push(attribute); - _emberGlimmerUtilsBindings.AttributeBinding.install(element, component, parsed, operations); + ``` + + ```app/templates/components/my-parent.hbs + {{log clicks.total}} //-> 3 + {{my-child childClicks=(readonly clicks)}} + ``` + + Now, if you update the `total` property of `childClicks`: + + ```app/components/my-child.js + export default Ember.Component.extend({ + click() { + this.get('clicks').incrementProperty('total'); } + }); + ``` + + You will see the following happen: + + ```app/templates/components/my-parent.hbs + {{log clicks.total}} //-> 4 + {{my-child childClicks=(readonly clicks)}} + ``` + + ```app/templates/components/my-child.hbs + {{log childClicks.total}} //-> 4 + ``` + + @method readonly + @param {Object} [attr] the read-only attribute. + @for Ember.Templates.helpers + @private + */ - i--; - } - - if (seen.indexOf('id') === -1) { - operations.addStaticAttribute(element, 'id', component.elementId); - } - - if (seen.indexOf('style') === -1) { - _emberGlimmerUtilsBindings.IsVisibleBinding.install(element, component, operations); - } - } - - var CurlyComponentSyntax = (function (_StatementSyntax) { -babelHelpers.inherits(CurlyComponentSyntax, _StatementSyntax); - - function CurlyComponentSyntax(args, definition, symbolTable) { -babelHelpers.classCallCheck(this, CurlyComponentSyntax); - - _StatementSyntax.call(this); - this.args = args; - this.definition = definition; - this.symbolTable = symbolTable; - this.shadow = null; - } - - CurlyComponentSyntax.prototype.compile = function compile(builder) { - builder.component.static(this.definition, this.args, this.symbolTable, this.shadow); - }; - - return CurlyComponentSyntax; - })(_glimmerRuntime.StatementSyntax); - - exports.CurlyComponentSyntax = CurlyComponentSyntax; + exports.default = function (vm, args) { + var ref = _emberGlimmerHelpersMut.unMut(args.positional.at(0)); - function NOOP() {} + var wrapped = Object.create(ref); - var ComponentStateBucket = (function () { - function ComponentStateBucket(environment, component, args, finalizer) { -babelHelpers.classCallCheck(this, ComponentStateBucket); + wrapped[_emberGlimmerUtilsReferences.UPDATE] = undefined; - this.environment = environment; - this.component = component; - this.classRef = null; - this.args = args; - this.argsRevision = args.tag.value(); - this.finalizer = finalizer; - } + return wrapped; + }; +}); +enifed('ember-glimmer/helpers/unbound', ['exports', 'ember-metal', 'ember-glimmer/utils/references'], function (exports, _emberMetal, _emberGlimmerUtilsReferences) { + /** + @module ember + @submodule ember-glimmer + */ - ComponentStateBucket.prototype.destroy = function destroy() { - var component = this.component; - var environment = this.environment; + 'use strict'; - if (environment.isInteractive) { - component.trigger('willDestroyElement'); - component.trigger('willClearRender'); - } + /** + 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 + */ - environment.destroyedComponents.push(component); - }; + exports.default = function (vm, args) { + _emberMetal.assert('unbound helper cannot be called with multiple params or hash params', args.positional.values.length === 1 && args.named.keys.length === 0); - ComponentStateBucket.prototype.finalize = function finalize() { - var finalizer = this.finalizer; + return _emberGlimmerUtilsReferences.UnboundReference.create(args.positional.at(0).value()); + }; +}); +enifed('ember-glimmer/index', ['exports', 'ember-glimmer/helpers/action', 'ember-glimmer/templates/root', 'ember-glimmer/template', 'ember-glimmer/components/checkbox', 'ember-glimmer/components/text_field', 'ember-glimmer/components/text_area', 'ember-glimmer/components/link-to', 'ember-glimmer/component', 'ember-glimmer/helper', 'ember-glimmer/environment', 'ember-glimmer/make-bound-helper', 'ember-glimmer/utils/string', 'ember-glimmer/renderer', 'ember-glimmer/template_registry', 'ember-glimmer/setup-registry', 'ember-glimmer/dom'], function (exports, _emberGlimmerHelpersAction, _emberGlimmerTemplatesRoot, _emberGlimmerTemplate, _emberGlimmerComponentsCheckbox, _emberGlimmerComponentsText_field, _emberGlimmerComponentsText_area, _emberGlimmerComponentsLinkTo, _emberGlimmerComponent, _emberGlimmerHelper, _emberGlimmerEnvironment, _emberGlimmerMakeBoundHelper, _emberGlimmerUtilsString, _emberGlimmerRenderer, _emberGlimmerTemplate_registry, _emberGlimmerSetupRegistry, _emberGlimmerDom) { + /** + [Glimmer](https://github.com/tildeio/glimmer) is a [Handlebars](http://handlebarsjs.com/) + compatible templating engine used by Ember.js. + 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}} +
    {{name}}
    + + ``` + + Any time the "name" property on the component changes, the DOM will be + updated. + + Properties can be chained as well: + + ```handlebars + {{aUserModel.name}} +
    {{listOfUsers.firstObject.name}}
    + ``` + + ### 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"}} + + ``` + + 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 + + ``` + + 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-glimmer + @main ember-glimmer + @public + */ - finalizer(); - this.finalizer = NOOP; - }; + /** + 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 + `{{with}}` block. + + If the aliased property is "falsey", for example: `false`, `undefined` `null`, `""`, `0`, NaN or + an empty array, the block will not be rendered. + + ```handlebars + {{! Will only render if user.posts contains items}} + {{#with user.posts as |blogPosts|}} +
    + There are {{blogPosts.length}} blog posts written by {{user.name}}. +
    + {{#each blogPosts as |post|}} +
  • {{post.title}}
  • + {{/each}} + {{/with}} + ``` + + Without the `as` operator, it would be impossible to reference `user.name` in the example above. + + NOTE: The alias should not reuse a name from the bound property path. + + For example: `{{#with foo.bar as |foo|}}` is not supported because it attempts to alias using + the first part of the property path, `foo`. Instead, use `{{#with foo.bar as |baz|}}`. + + @method with + @for Ember.Templates.helpers + @param {Object} options + @return {String} HTML string + @public + */ - return ComponentStateBucket; - })(); + /** + Execute the `debugger` statement in the current template's context. + + ```handlebars + {{debugger}} + ``` + + When using the debugger helper you will have access to a `get` function. This + function retrieves values available in the context of the template. + For example, if you're wondering why a value `{{foo}}` isn't rendering as + expected within a template, you could place a `{{debugger}}` statement and, + when the `debugger;` breakpoint is hit, you can attempt to retrieve this value: + + ``` + > get('foo') + ``` + + `get` is also aware of keywords. So in this situation + + ```handlebars + {{#each items as |item|}} + {{debugger}} + {{/each}} + ``` + + You'll be able to get values from the current item: + + ``` + > get('item.name') + ``` + + You can also access the context of the view to make sure it is the object that + you expect: + + ``` + > context + ``` + + @method debugger + @for Ember.Templates.helpers + @public + */ - function initialRenderInstrumentDetails(component) { - return component.instrumentDetails({ initialRender: true }); - } + /** + The `partial` helper renders another template without + changing the template context: + + ```handlebars + {{foo}} + {{partial "nav"}} + ``` + + The above example template will render a template named + "-nav", which has the same context as the parent template + it's rendered into, so if the "-nav" template also referenced + `{{foo}}`, it would print the same thing as the `{{foo}}` + in the above example. + + If a "-nav" template isn't found, the `partial` helper will + fall back to a template named "nav". + + ### Bound template names + + The parameter supplied to `partial` can also be a path + to a property containing a template name, e.g.: + + ```handlebars + {{partial someTemplateName}} + ``` + + The above example will look up the value of `someTemplateName` + on the template context (e.g. a controller) and use that + value as the name of the template to render. If the resolved + value is falsy, nothing will be rendered. If `someTemplateName` + changes, the partial will be re-rendered using the new template + name. + + @method partial + @for Ember.Templates.helpers + @param {String} partialName The name of the template to render minus the leading underscore. + @public + */ - function rerenderInstrumentDetails(component) { - return component.instrumentDetails({ initialRender: false }); - } + 'use strict'; - var CurlyComponentManager = (function () { - function CurlyComponentManager() { -babelHelpers.classCallCheck(this, CurlyComponentManager); - } + exports.INVOKE = _emberGlimmerHelpersAction.INVOKE; + exports.RootTemplate = _emberGlimmerTemplatesRoot.default; + exports.template = _emberGlimmerTemplate.default; + exports.Checkbox = _emberGlimmerComponentsCheckbox.default; + exports.TextField = _emberGlimmerComponentsText_field.default; + exports.TextArea = _emberGlimmerComponentsText_area.default; + exports.LinkComponent = _emberGlimmerComponentsLinkTo.default; + exports.Component = _emberGlimmerComponent.default; + exports.Helper = _emberGlimmerHelper.default; + exports.helper = _emberGlimmerHelper.helper; + exports.Environment = _emberGlimmerEnvironment.default; + exports.makeBoundHelper = _emberGlimmerMakeBoundHelper.default; + exports.SafeString = _emberGlimmerUtilsString.SafeString; + exports.escapeExpression = _emberGlimmerUtilsString.escapeExpression; + exports.htmlSafe = _emberGlimmerUtilsString.htmlSafe; + exports.isHTMLSafe = _emberGlimmerUtilsString.isHTMLSafe; + exports._getSafeString = _emberGlimmerUtilsString.getSafeString; + exports.Renderer = _emberGlimmerRenderer.Renderer; + exports.InertRenderer = _emberGlimmerRenderer.InertRenderer; + exports.InteractiveRenderer = _emberGlimmerRenderer.InteractiveRenderer; + exports.getTemplate = _emberGlimmerTemplate_registry.getTemplate; + exports.setTemplate = _emberGlimmerTemplate_registry.setTemplate; + exports.hasTemplate = _emberGlimmerTemplate_registry.hasTemplate; + exports.getTemplates = _emberGlimmerTemplate_registry.getTemplates; + exports.setTemplates = _emberGlimmerTemplate_registry.setTemplates; + exports.setupEngineRegistry = _emberGlimmerSetupRegistry.setupEngineRegistry; + exports.setupApplicationRegistry = _emberGlimmerSetupRegistry.setupApplicationRegistry; + exports.DOMChanges = _emberGlimmerDom.DOMChanges; + exports.NodeDOMTreeConstruction = _emberGlimmerDom.NodeDOMTreeConstruction; + exports.DOMTreeConstruction = _emberGlimmerDom.DOMTreeConstruction; +}); +enifed('ember-glimmer/make-bound-helper', ['exports', 'ember-metal', 'ember-glimmer/helper'], function (exports, _emberMetal, _emberGlimmerHelper) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; - CurlyComponentManager.prototype.prepareArgs = function prepareArgs(definition, args) { - validatePositionalParameters(args.named, args.positional.values, definition.ComponentClass.positionalParams); - - return _emberGlimmerUtilsProcessArgs.gatherArgs(args, definition); - }; - - CurlyComponentManager.prototype.create = function create(environment, definition, args, dynamicScope, callerSelfRef, hasBlock) { - var parentView = dynamicScope.view; - - var klass = definition.ComponentClass; - var processedArgs = _emberGlimmerUtilsProcessArgs.ComponentArgs.create(args); - - var _processedArgs$value = processedArgs.value(); - - var props = _processedArgs$value.props; - - aliasIdToElementId(args, props); - - props.parentView = parentView; - props[_emberGlimmerComponent.HAS_BLOCK] = hasBlock; - - props._targetObject = callerSelfRef.value(); - - var component = klass.create(props); - - var finalizer = _emberMetal._instrumentStart('render.component', initialRenderInstrumentDetails, component); - - dynamicScope.view = component; - - if (parentView !== null) { - parentView.appendChild(component); - } - - // We usually do this in the `didCreateElement`, but that hook doesn't fire for tagless components - if (component.tagName === '') { - if (environment.isInteractive) { - component.trigger('willRender'); - } - - component._transitionTo('hasElement'); - - if (environment.isInteractive) { - component.trigger('willInsertElement'); - } - } - - var bucket = new ComponentStateBucket(environment, component, processedArgs, finalizer); - - if (args.named.has('class')) { - bucket.classRef = args.named.get('class'); - } - - processComponentInitializationAssertions(component, props); - - if (environment.isInteractive && component.tagName !== '') { - component.trigger('willRender'); - } - - return bucket; - }; - - CurlyComponentManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { - var template = definition.template; - if (!template) { - var component = bucket.component; - - template = this.templateFor(component, env); - } - return env.getCompiledBlock(CurlyComponentLayoutCompiler, template); - }; - - CurlyComponentManager.prototype.templateFor = function templateFor(component, env) { - var Template = _emberMetal.get(component, 'layout'); - var owner = component[_emberUtils.OWNER]; - if (Template) { - return env.getTemplate(Template, owner); - } - var layoutName = _emberMetal.get(component, 'layoutName'); - if (layoutName) { - var template = owner.lookup('template:' + layoutName); - if (template) { - return template; - } - } - return owner.lookup(DEFAULT_LAYOUT); - }; - - CurlyComponentManager.prototype.getSelf = function getSelf(_ref) { - var component = _ref.component; - - return component[_emberGlimmerComponent.ROOT_REF]; - }; - - CurlyComponentManager.prototype.didCreateElement = function didCreateElement(_ref2, element, operations) { - var component = _ref2.component; - var classRef = _ref2.classRef; - var environment = _ref2.environment; - - _emberViews.setViewElement(component, element); - - var attributeBindings = component.attributeBindings; - var classNames = component.classNames; - var classNameBindings = component.classNameBindings; - - if (attributeBindings && attributeBindings.length) { - applyAttributeBindings(element, attributeBindings, component, operations); - } else { - operations.addStaticAttribute(element, 'id', component.elementId); - _emberGlimmerUtilsBindings.IsVisibleBinding.install(element, component, operations); - } - - if (classRef) { - operations.addDynamicAttribute(element, 'class', classRef); - } - - if (classNames && classNames.length) { - classNames.forEach(function (name) { - operations.addStaticAttribute(element, 'class', name); - }); - } - - if (classNameBindings && classNameBindings.length) { - classNameBindings.forEach(function (binding) { - _emberGlimmerUtilsBindings.ClassNameBinding.install(element, component, binding, operations); - }); - } - - component._transitionTo('hasElement'); - - if (environment.isInteractive) { - component.trigger('willInsertElement'); - } - }; - - CurlyComponentManager.prototype.didRenderLayout = function didRenderLayout(bucket, bounds) { - bucket.component[_emberGlimmerComponent.BOUNDS] = bounds; - bucket.finalize(); - }; - - CurlyComponentManager.prototype.getTag = function getTag(_ref3) { - var component = _ref3.component; - - return component[_emberGlimmerComponent.DIRTY_TAG]; - }; - - CurlyComponentManager.prototype.didCreate = function didCreate(_ref4) { - var component = _ref4.component; - var environment = _ref4.environment; - - if (environment.isInteractive) { - component._transitionTo('inDOM'); - component.trigger('didInsertElement'); - component.trigger('didRender'); - } - }; - - CurlyComponentManager.prototype.update = function update(bucket, _, dynamicScope) { - var component = bucket.component; - var args = bucket.args; - var argsRevision = bucket.argsRevision; - var environment = bucket.environment; - - bucket.finalizer = _emberMetal._instrumentStart('render.component', rerenderInstrumentDetails, component); - - if (!args.tag.validate(argsRevision)) { - var _args$value = args.value(); - - var attrs = _args$value.attrs; - var props = _args$value.props; - - bucket.argsRevision = args.tag.value(); - - var oldAttrs = component.attrs; - var newAttrs = attrs; - - component[_emberGlimmerComponent.IS_DISPATCHING_ATTRS] = true; - component.setProperties(props); - component[_emberGlimmerComponent.IS_DISPATCHING_ATTRS] = false; - - component.trigger('didUpdateAttrs', { oldAttrs: oldAttrs, newAttrs: newAttrs }); - component.trigger('didReceiveAttrs', { oldAttrs: oldAttrs, newAttrs: newAttrs }); - } - - if (environment.isInteractive) { - component.trigger('willUpdate'); - component.trigger('willRender'); - } - }; - - CurlyComponentManager.prototype.didUpdateLayout = function didUpdateLayout(bucket) { - bucket.finalize(); - }; - - CurlyComponentManager.prototype.didUpdate = function didUpdate(_ref5) { - var component = _ref5.component; - var environment = _ref5.environment; - - if (environment.isInteractive) { - component.trigger('didUpdate'); - component.trigger('didRender'); - } - }; - - CurlyComponentManager.prototype.getDestructor = function getDestructor(stateBucket) { - return stateBucket; - }; - - return CurlyComponentManager; - })(); - - var MANAGER = new CurlyComponentManager(); - - var TopComponentManager = (function (_CurlyComponentManager) { -babelHelpers.inherits(TopComponentManager, _CurlyComponentManager); - - function TopComponentManager() { -babelHelpers.classCallCheck(this, TopComponentManager); - - _CurlyComponentManager.apply(this, arguments); - } - - TopComponentManager.prototype.create = function create(environment, definition, args, dynamicScope, currentScope, hasBlock) { - var component = definition.ComponentClass; - - var finalizer = _emberMetal._instrumentStart('render.component', initialRenderInstrumentDetails, component); - - dynamicScope.view = component; - - // We usually do this in the `didCreateElement`, but that hook doesn't fire for tagless components - if (component.tagName === '') { - if (environment.isInteractive) { - component.trigger('willRender'); - } - - component._transitionTo('hasElement'); - - if (environment.isInteractive) { - component.trigger('willInsertElement'); - } - } - - processComponentInitializationAssertions(component, {}); - - return new ComponentStateBucket(environment, component, args, finalizer); - }; - - return TopComponentManager; - })(CurlyComponentManager); - - var ROOT_MANAGER = new TopComponentManager(); - - function tagName(vm) { - var tagName = vm.dynamicScope().view.tagName; - - return _glimmerRuntime.PrimitiveReference.create(tagName === '' ? null : tagName || 'div'); - } - - function ariaRole(vm) { - return vm.getSelf().get('ariaRole'); - } - - var CurlyComponentDefinition = (function (_ComponentDefinition) { -babelHelpers.inherits(CurlyComponentDefinition, _ComponentDefinition); - - function CurlyComponentDefinition(name, ComponentClass, template, args) { -babelHelpers.classCallCheck(this, CurlyComponentDefinition); - - _ComponentDefinition.call(this, name, MANAGER, ComponentClass); - this.template = template; - this.args = args; - } - - return CurlyComponentDefinition; - })(_glimmerRuntime.ComponentDefinition); - - exports.CurlyComponentDefinition = CurlyComponentDefinition; - - var RootComponentDefinition = (function (_ComponentDefinition2) { -babelHelpers.inherits(RootComponentDefinition, _ComponentDefinition2); - - function RootComponentDefinition(instance) { -babelHelpers.classCallCheck(this, RootComponentDefinition); - - _ComponentDefinition2.call(this, '-root', ROOT_MANAGER, instance); - this.template = undefined; - this.args = undefined; - } - - return RootComponentDefinition; - })(_glimmerRuntime.ComponentDefinition); - - exports.RootComponentDefinition = RootComponentDefinition; - - var CurlyComponentLayoutCompiler = (function () { - function CurlyComponentLayoutCompiler(template) { -babelHelpers.classCallCheck(this, CurlyComponentLayoutCompiler); - - this.template = template; - } - - CurlyComponentLayoutCompiler.prototype.compile = function compile(builder) { - builder.wrapLayout(this.template.asLayout()); - builder.tag.dynamic(tagName); - builder.attrs.dynamic('role', ariaRole); - builder.attrs.static('class', 'ember-view'); - }; - - return CurlyComponentLayoutCompiler; - })(); - - CurlyComponentLayoutCompiler.id = 'curly'; -}); -enifed('ember-glimmer/syntax/dynamic-component', ['exports', 'glimmer-runtime', 'glimmer-reference', 'ember-metal'], function (exports, _glimmerRuntime, _glimmerReference, _emberMetal) { - 'use strict'; - - function dynamicComponentFor(vm, symbolTable) { - var env = vm.env; - var args = vm.getArgs(); - var nameRef = args.positional.at(0); - - return new DynamicComponentReference({ nameRef: nameRef, env: env, symbolTable: symbolTable }); - } - - var DynamicComponentSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(DynamicComponentSyntax, _StatementSyntax); - - // for {{component componentName}} - - DynamicComponentSyntax.create = function create(environment, args, symbolTable) { - var definitionArgs = _glimmerRuntime.ArgsSyntax.fromPositionalArgs(args.positional.slice(0, 1)); - var invocationArgs = _glimmerRuntime.ArgsSyntax.build(args.positional.slice(1), args.named, args.blocks); - - return new this(definitionArgs, invocationArgs, symbolTable); - }; - - // Transforms {{foo.bar with=args}} or {{#foo.bar with=args}}{{/foo.bar}} - // into {{component foo.bar with=args}} or - // {{#component foo.bar with=args}}{{/component}} - // with all of it's arguments - - DynamicComponentSyntax.fromPath = function fromPath(environment, path, args, symbolTable) { - var positional = _glimmerRuntime.ArgsSyntax.fromPositionalArgs(_glimmerRuntime.PositionalArgsSyntax.build([_glimmerRuntime.GetSyntax.build(path.join('.'))])); - - return new this(positional, args, symbolTable); - }; - - function DynamicComponentSyntax(definitionArgs, args, symbolTable) { - babelHelpers.classCallCheck(this, DynamicComponentSyntax); - - _StatementSyntax.call(this); - this.definition = dynamicComponentFor; - this.definitionArgs = definitionArgs; - this.args = args; - this.symbolTable = symbolTable; - this.shadow = null; - } - - DynamicComponentSyntax.prototype.compile = function compile(builder) { - builder.component.dynamic(this.definitionArgs, this.definition, this.args, this.symbolTable, this.shadow); - }; - - return DynamicComponentSyntax; - })(_glimmerRuntime.StatementSyntax); - - exports.DynamicComponentSyntax = DynamicComponentSyntax; - - var DynamicComponentReference = (function () { - function DynamicComponentReference(_ref) { - var nameRef = _ref.nameRef; - var env = _ref.env; - var symbolTable = _ref.symbolTable; - var args = _ref.args; - babelHelpers.classCallCheck(this, DynamicComponentReference); - - this.tag = nameRef.tag; - this.nameRef = nameRef; - this.env = env; - this.symbolTable = symbolTable; - this.args = args; - } - - DynamicComponentReference.prototype.value = function value() { - var env = this.env; - var nameRef = this.nameRef; - var symbolTable = this.symbolTable; - - var nameOrDef = nameRef.value(); - - if (typeof nameOrDef === 'string') { - var definition = env.getComponentDefinition([nameOrDef], symbolTable); - - _emberMetal.assert('Could not find component named "' + nameOrDef + '" (no component or template with that name was found)', definition); - - return definition; - } else if (_glimmerRuntime.isComponentDefinition(nameOrDef)) { - return nameOrDef; - } else { - return null; - } - }; - - DynamicComponentReference.prototype.get = function get() { - return _glimmerReference.UNDEFINED_REFERENCE; - }; - - return DynamicComponentReference; - })(); -}); -enifed('ember-glimmer/syntax/input', ['exports', 'ember-metal', 'ember-glimmer/syntax/curly-component', 'ember-glimmer/syntax/dynamic-component', 'ember-glimmer/utils/bindings'], function (exports, _emberMetal, _emberGlimmerSyntaxCurlyComponent, _emberGlimmerSyntaxDynamicComponent, _emberGlimmerUtilsBindings) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; - - function buildTextFieldSyntax(args, getDefinition, symbolTable) { - var definition = getDefinition('-text-field'); - _emberGlimmerUtilsBindings.wrapComponentClassAttribute(args); - return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentSyntax(args, definition, symbolTable); - } + exports.default = makeBoundHelper; /** - The `{{input}}` helper lets you create an HTML `` component. - It causes an `Ember.TextField` component to be rendered. For more info, - see the [Ember.TextField](/api/classes/Ember.TextField.html) docs and - the [templates guide](http://emberjs.com/guides/templates/input-helpers/). - - ```handlebars - {{input value="987"}} - ``` - - renders as: - - ```HTML - - ``` - - ### Text field - - If no `type` option is specified, a default of type 'text' is used. - Many of the standard HTML attributes may be passed to this helper. - - - - - - - - - - - -
    `readonly``required``autofocus`
    `value``placeholder``disabled`
    `size``tabindex``maxlength`
    `name``min``max`
    `pattern``accept``autocomplete`
    `autosave``formaction``formenctype`
    `formmethod``formnovalidate``formtarget`
    `height``inputmode``multiple`
    `step``width``form`
    `selectionDirection``spellcheck` 
    - When set to a quoted string, these values will be directly applied to the HTML - element. When left unquoted, these values will be bound to a property on the - template's current rendering context (most typically a controller instance). - A very common use of this helper is to bind the `value` of an input to an Object's attribute: - - ```handlebars - Search: - {{input value=searchWord}} - ``` - - In this example, the inital value in the `` will be set to the value of `searchWord`. - If the user changes the text, the value of `searchWord` will also be updated. - - ### Actions - - The helper can send multiple actions based on user events. - The action property defines the action which is sent when - the user presses the return key. - - ```handlebars - {{input action="submit"}} - ``` - - The helper allows some user events to send actions. - - * `enter` - * `insert-newline` - * `escape-press` - * `focus-in` - * `focus-out` - * `key-press` - * `key-up` - - For example, if you desire an action to be sent when the input is blurred, - you only need to setup the action name to the event name property. - - ```handlebars - {{input focus-out="alertMessage"}} - ``` - See more about [Text Support Actions](/api/classes/Ember.TextField.html) + 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 + value and any changes to the bound property cause the helper function to be re-run with the updated + values. - ### Extending `Ember.TextField` + * `params` - An array of resolved ordered parameters. + * `hash` - An object containing the hash parameters. - Internally, `{{input type="text"}}` creates an instance of `Ember.TextField`, passing - arguments from the helper to `Ember.TextField`'s `create` method. You can extend the - capabilities of text inputs in your applications by reopening this class. For example, - if you are building a Bootstrap project where `data-*` attributes are used, you - can add one to the `TextField`'s `attributeBindings` property: + For example: - ```javascript - Ember.TextField.reopen({ - attributeBindings: ['data-error'] - }); - ``` + * With an unquoted ordered parameter: - Keep in mind when writing `Ember.TextField` subclasses that `Ember.TextField` - itself extends `Ember.Component`. Expect isolated component semantics, not - legacy 1.x view semantics (like `controller` being present). - See more about [Ember components](/api/classes/Ember.Component.html) + ```javascript + {{x-capitalize foo}} + ``` - ### Checkbox + Assuming `foo` was set to `"bar"`, the bound helper would receive `["bar"]` as its first argument, and + an empty hash as its second. - Checkboxes are special forms of the `{{input}}` helper. To create a ``: + * With a quoted ordered parameter: - ```handlebars - Emberize Everything: - {{input type="checkbox" name="isEmberized" checked=isEmberized}} - ``` + ```javascript + {{x-capitalize "foo"}} + ``` - This will bind checked state of this checkbox to the value of `isEmberized` -- if either one changes, - it will be reflected in the other. + The bound helper would receive `["foo"]` as its first argument, and an empty hash as its second. - The following HTML attributes can be set via the helper: + * With an unquoted hash parameter: - * `checked` - * `disabled` - * `tabindex` - * `indeterminate` - * `name` - * `autofocus` - * `form` + ```javascript + {{x-repeat "foo" count=repeatCount}} + ``` - ### Extending `Ember.Checkbox` + Assuming that `repeatCount` resolved to 2, the bound helper would receive `["foo"]` as its first argument, + and { count: 2 } as its second. - Internally, `{{input type="checkbox"}}` creates an instance of `Ember.Checkbox`, passing - arguments from the helper to `Ember.Checkbox`'s `create` method. You can extend the - capablilties of checkbox inputs in your applications by reopening this class. For example, - if you wanted to add a css class to all checkboxes in your application: - - ```javascript - Ember.Checkbox.reopen({ - classNames: ['my-app-checkbox'] - }); - ``` - - @method input - @for Ember.Templates.helpers - @param {Hash} options - @public - */ - var InputSyntax = { - create: function (environment, args, symbolTable) { - var getDefinition = function (path) { - return environment.getComponentDefinition([path], symbolTable); - }; - - if (args.named.has('type')) { - var typeArg = args.named.at('type'); - if (typeArg.type === 'value') { - if (typeArg.value === 'checkbox') { - _emberMetal.assert('{{input type=\'checkbox\'}} does not support setting `value=someBooleanValue`; ' + 'you must use `checked=someBooleanValue` instead.', !args.named.has('value')); - - _emberGlimmerUtilsBindings.wrapComponentClassAttribute(args); - var definition = getDefinition('-checkbox'); - return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentSyntax(args, definition, symbolTable); - } else { - return buildTextFieldSyntax(args, getDefinition, symbolTable); - } - } - } else { - return buildTextFieldSyntax(args, getDefinition, symbolTable); - } - - return _emberGlimmerSyntaxDynamicComponent.DynamicComponentSyntax.create(environment, args, symbolTable); - } - }; - exports.InputSyntax = InputSyntax; -}); -enifed('ember-glimmer/syntax/mount', ['exports', 'glimmer-runtime', 'glimmer-reference', 'ember-metal', 'ember-glimmer/utils/references', 'ember-routing', 'ember-glimmer/syntax/outlet'], function (exports, _glimmerRuntime, _glimmerReference, _emberMetal, _emberGlimmerUtilsReferences, _emberRouting, _emberGlimmerSyntaxOutlet) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; - - /** - The `{{mount}}` helper lets you embed a routeless engine in a template. - Mounting an engine will cause an instance to be booted and its `application` - template to be rendered. - - For example, the following template mounts the `ember-chat` engine: - - ```handlebars - {{! application.hbs }} - {{mount "ember-chat"}} - ``` - - Currently, the engine name is the only argument that can be passed to - `{{mount}}`. - - @method mount - @for Ember.Templates.helpers - @category ember-application-engines - @public - */ - - var MountSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(MountSyntax, _StatementSyntax); - - MountSyntax.create = function create(env, args, symbolTable) { - _emberMetal.assert('You can only pass a single argument to the {{mount}} helper, e.g. {{mount "chat-engine"}}.', args.positional.length === 1 && args.named.length === 0); - - _emberMetal.assert('The first argument of {{mount}} must be quoted, e.g. {{mount "chat-engine"}}.', args.positional.at(0).type === 'value' && typeof args.positional.at(0).inner() === 'string'); - - var name = args.positional.at(0).inner(); - - _emberMetal.assert('You used `{{mount \'' + name + '\'}}`, but the engine \'' + name + '\' can not be found.', env.owner.hasRegistration('engine:' + name)); - - var definition = new MountDefinition(name, env); - - return new MountSyntax(definition, symbolTable); - }; - - function MountSyntax(definition, symbolTable) { - babelHelpers.classCallCheck(this, MountSyntax); - - _StatementSyntax.call(this); - this.definition = definition; - this.symbolTable = symbolTable; - } - - MountSyntax.prototype.compile = function compile(builder) { - builder.component.static(this.definition, _glimmerRuntime.ArgsSyntax.empty(), null, this.symbolTable, null); - }; - - return MountSyntax; - })(_glimmerRuntime.StatementSyntax); - - exports.MountSyntax = MountSyntax; - - var MountManager = (function () { - function MountManager() { - babelHelpers.classCallCheck(this, MountManager); - } - - MountManager.prototype.prepareArgs = function prepareArgs(definition, args) { - return args; - }; - - MountManager.prototype.create = function create(environment, _ref, args, dynamicScope) { - var name = _ref.name; - var env = _ref.env; - - dynamicScope.outletState = _glimmerReference.UNDEFINED_REFERENCE; - - var engine = env.owner.buildChildEngineInstance(name); - - engine.boot(); - - return { engine: engine }; - }; - - MountManager.prototype.layoutFor = function layoutFor(definition, _ref2, env) { - var engine = _ref2.engine; - - var template = engine.lookup('template:application'); - return env.getCompiledBlock(_emberGlimmerSyntaxOutlet.OutletLayoutCompiler, template); - }; - - MountManager.prototype.getSelf = function getSelf(_ref3) { - var engine = _ref3.engine; - - var factory = engine._lookupFactory('controller:application') || _emberRouting.generateControllerFactory(engine, 'application'); - return new _emberGlimmerUtilsReferences.RootReference(factory.create()); - }; - - MountManager.prototype.getTag = function getTag() { - return null; - }; - - MountManager.prototype.getDestructor = function getDestructor(_ref4) { - var engine = _ref4.engine; - - return engine; - }; - - MountManager.prototype.didCreateElement = function didCreateElement() {}; - - MountManager.prototype.didRenderLayout = function didRenderLayout() {}; - - MountManager.prototype.didCreate = function didCreate(state) {}; - - MountManager.prototype.update = function update(state, args, dynamicScope) {}; - - MountManager.prototype.didUpdateLayout = function didUpdateLayout() {}; - - MountManager.prototype.didUpdate = function didUpdate(state) {}; - - return MountManager; - })(); - - var MOUNT_MANAGER = new MountManager(); - - var MountDefinition = (function (_ComponentDefinition) { - babelHelpers.inherits(MountDefinition, _ComponentDefinition); - - function MountDefinition(name, env) { - babelHelpers.classCallCheck(this, MountDefinition); - - _ComponentDefinition.call(this, name, MOUNT_MANAGER, null); - this.env = env; - } - - return MountDefinition; - })(_glimmerRuntime.ComponentDefinition); -}); -enifed('ember-glimmer/syntax/outlet', ['exports', 'ember-utils', 'glimmer-runtime', 'ember-metal', 'ember-glimmer/utils/references', 'glimmer-reference'], function (exports, _emberUtils, _glimmerRuntime, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; - - function outletComponentFor(vm) { - var _vm$dynamicScope = vm.dynamicScope(); - - var outletState = _vm$dynamicScope.outletState; - - var args = vm.getArgs(); - var outletNameRef = undefined; - if (args.positional.length === 0) { - outletNameRef = new _glimmerReference.ConstReference('main'); - } else { - outletNameRef = args.positional.at(0); - } - - return new OutletComponentReference(outletNameRef, outletState); - } - - /** - The `{{outlet}}` helper lets you specify where a child route will render in - your template. An important use of the `{{outlet}}` helper is in your - application's `application.hbs` file: - - ```handlebars - {{! app/templates/application.hbs }} - - {{my-header}} -
    - - {{outlet}} -
    - - {{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' }); - } - }); - ``` - - 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. - - @method outlet - @param {String} [name] - @for Ember.Templates.helpers - @public - */ - - var OutletSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(OutletSyntax, _StatementSyntax); - - OutletSyntax.create = function create(environment, args, symbolTable) { - var definitionArgs = _glimmerRuntime.ArgsSyntax.fromPositionalArgs(args.positional.slice(0, 1)); - return new this(environment, definitionArgs, symbolTable); - }; - - function OutletSyntax(environment, args, symbolTable) { - babelHelpers.classCallCheck(this, OutletSyntax); - - _StatementSyntax.call(this); - this.definitionArgs = args; - this.definition = outletComponentFor; - this.args = _glimmerRuntime.ArgsSyntax.empty(); - this.symbolTable = symbolTable; - this.shadow = null; - } - - OutletSyntax.prototype.compile = function compile(builder) { - builder.component.dynamic(this.definitionArgs, this.definition, this.args, this.symbolTable, this.shadow); - }; - - return OutletSyntax; - })(_glimmerRuntime.StatementSyntax); - - exports.OutletSyntax = OutletSyntax; - - var OutletComponentReference = (function () { - function OutletComponentReference(outletNameRef, parentOutletStateRef) { - babelHelpers.classCallCheck(this, OutletComponentReference); - - this.outletNameRef = outletNameRef; - this.parentOutletStateRef = parentOutletStateRef; - this.definition = null; - this.lastState = null; - var outletStateTag = this.outletStateTag = new _glimmerReference.UpdatableTag(parentOutletStateRef.tag); - this.tag = _glimmerReference.combine([outletStateTag.tag, outletNameRef.tag]); - } - - OutletComponentReference.prototype.value = function value() { - var outletNameRef = this.outletNameRef; - var parentOutletStateRef = this.parentOutletStateRef; - var definition = this.definition; - var lastState = this.lastState; - - var outletName = outletNameRef.value(); - var outletStateRef = parentOutletStateRef.get('outlets').get(outletName); - var newState = this.lastState = outletStateRef.value(); - - this.outletStateTag.update(outletStateRef.tag); - - definition = revalidate(definition, lastState, newState); - - var hasTemplate = newState && newState.render.template; - - if (definition) { - return definition; - } else if (hasTemplate) { - return this.definition = new OutletComponentDefinition(outletName, newState.render.template); - } else { - return this.definition = null; - } - }; - - return OutletComponentReference; - })(); - - function revalidate(definition, lastState, newState) { - if (!lastState && !newState) { - return definition; - } - - if (!lastState && newState || lastState && !newState) { - return null; - } - - if (newState.render.template === lastState.render.template && newState.render.controller === lastState.render.controller) { - return definition; - } - - return null; - } - - function instrumentationPayload(_ref) { - var _ref$render = _ref.render; - var name = _ref$render.name; - var outlet = _ref$render.outlet; - - return { object: name + ':' + outlet }; - } - - function NOOP() {} - - var StateBucket = (function () { - function StateBucket(outletState) { - babelHelpers.classCallCheck(this, StateBucket); - - this.outletState = outletState; - this.instrument(); - } - - StateBucket.prototype.instrument = function instrument() { - this.finalizer = _emberMetal._instrumentStart('render.outlet', instrumentationPayload, this.outletState); - }; - - StateBucket.prototype.finalize = function finalize() { - var finalizer = this.finalizer; - - finalizer(); - this.finalizer = NOOP; - }; - - return StateBucket; - })(); - - var OutletComponentManager = (function () { - function OutletComponentManager() { - babelHelpers.classCallCheck(this, OutletComponentManager); - } - - OutletComponentManager.prototype.prepareArgs = function prepareArgs(definition, args) { - return args; - }; - - OutletComponentManager.prototype.create = function create(environment, definition, args, dynamicScope) { - var outletStateReference = dynamicScope.outletState = dynamicScope.outletState.get('outlets').get(definition.outletName); - var outletState = outletStateReference.value(); - return new StateBucket(outletState); - }; - - OutletComponentManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { - return env.getCompiledBlock(OutletLayoutCompiler, definition.template); - }; - - OutletComponentManager.prototype.getSelf = function getSelf(_ref2) { - var outletState = _ref2.outletState; - - return new _emberGlimmerUtilsReferences.RootReference(outletState.render.controller); - }; - - OutletComponentManager.prototype.getTag = function getTag() { - return null; - }; - - OutletComponentManager.prototype.getDestructor = function getDestructor() { - return null; - }; - - OutletComponentManager.prototype.didRenderLayout = function didRenderLayout(bucket) { - bucket.finalize(); - }; - - OutletComponentManager.prototype.didCreateElement = function didCreateElement() {}; - - OutletComponentManager.prototype.didCreate = function didCreate(state) {}; - - OutletComponentManager.prototype.update = function update(bucket) {}; - - OutletComponentManager.prototype.didUpdateLayout = function didUpdateLayout(bucket) {}; - - OutletComponentManager.prototype.didUpdate = function didUpdate(state) {}; - - return OutletComponentManager; - })(); - - var MANAGER = new OutletComponentManager(); - - var TopLevelOutletComponentManager = (function (_OutletComponentManager) { - babelHelpers.inherits(TopLevelOutletComponentManager, _OutletComponentManager); - - function TopLevelOutletComponentManager() { - babelHelpers.classCallCheck(this, TopLevelOutletComponentManager); - - _OutletComponentManager.apply(this, arguments); - } - - TopLevelOutletComponentManager.prototype.create = function create(environment, definition, args, dynamicScope) { - return new StateBucket(dynamicScope.outletState.value()); - }; - - TopLevelOutletComponentManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { - return env.getCompiledBlock(TopLevelOutletLayoutCompiler, definition.template); - }; - - return TopLevelOutletComponentManager; - })(OutletComponentManager); - - var TOP_LEVEL_MANAGER = new TopLevelOutletComponentManager(); - - var TopLevelOutletComponentDefinition = (function (_ComponentDefinition) { - babelHelpers.inherits(TopLevelOutletComponentDefinition, _ComponentDefinition); - - function TopLevelOutletComponentDefinition(instance) { - babelHelpers.classCallCheck(this, TopLevelOutletComponentDefinition); - - _ComponentDefinition.call(this, 'outlet', TOP_LEVEL_MANAGER, instance); - this.template = instance.template; - _emberUtils.generateGuid(this); - } - - return TopLevelOutletComponentDefinition; - })(_glimmerRuntime.ComponentDefinition); - - exports.TopLevelOutletComponentDefinition = TopLevelOutletComponentDefinition; - - var TopLevelOutletLayoutCompiler = (function () { - function TopLevelOutletLayoutCompiler(template) { - babelHelpers.classCallCheck(this, TopLevelOutletLayoutCompiler); - - this.template = template; - } - - TopLevelOutletLayoutCompiler.prototype.compile = function compile(builder) { - builder.wrapLayout(this.template.asLayout()); - builder.tag.static('div'); - builder.attrs.static('id', _emberUtils.guidFor(this)); - builder.attrs.static('class', 'ember-view'); - }; - - return TopLevelOutletLayoutCompiler; - })(); - - TopLevelOutletLayoutCompiler.id = 'top-level-outlet'; - - var OutletComponentDefinition = (function (_ComponentDefinition2) { - babelHelpers.inherits(OutletComponentDefinition, _ComponentDefinition2); - - function OutletComponentDefinition(outletName, template) { - babelHelpers.classCallCheck(this, OutletComponentDefinition); - - _ComponentDefinition2.call(this, 'outlet', MANAGER, null); - this.outletName = outletName; - this.template = template; - _emberUtils.generateGuid(this); - } - - return OutletComponentDefinition; - })(_glimmerRuntime.ComponentDefinition); - - var OutletLayoutCompiler = (function () { - function OutletLayoutCompiler(template) { - babelHelpers.classCallCheck(this, OutletLayoutCompiler); - - this.template = template; - } - - OutletLayoutCompiler.prototype.compile = function compile(builder) { - builder.wrapLayout(this.template.asLayout()); - }; - - return OutletLayoutCompiler; - })(); - - exports.OutletLayoutCompiler = OutletLayoutCompiler; - - OutletLayoutCompiler.id = 'outlet'; -}); -enifed('ember-glimmer/syntax/render', ['exports', 'glimmer-runtime', 'glimmer-reference', 'ember-metal', 'ember-glimmer/utils/references', 'ember-routing', 'ember-glimmer/syntax/outlet'], function (exports, _glimmerRuntime, _glimmerReference, _emberMetal, _emberGlimmerUtilsReferences, _emberRouting, _emberGlimmerSyntaxOutlet) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; - - function makeComponentDefinition(vm) { - var env = vm.env; - var args = vm.getArgs(); - var nameRef = args.positional.at(0); - - _emberMetal.assert('The first argument of {{render}} must be quoted, e.g. {{render "sidebar"}}.', _glimmerReference.isConst(nameRef)); - _emberMetal.assert('The second argument of {{render}} must be a path, e.g. {{render "post" post}}.', args.positional.length === 1 || !_glimmerReference.isConst(args.positional.at(1))); - - var templateName = nameRef.value(); - - _emberMetal.assert('You used `{{render \'' + templateName + '\'}}`, but \'' + templateName + '\' can not be found as a template.', env.owner.hasRegistration('template:' + templateName)); - - var template = env.owner.lookup('template:' + templateName); - - var controllerName = undefined; - - if (args.named.has('controller')) { - var controllerNameRef = args.named.get('controller'); - - _emberMetal.assert('The controller argument for {{render}} must be quoted, e.g. {{render "sidebar" controller="foo"}}.', _glimmerReference.isConst(controllerNameRef)); - - controllerName = controllerNameRef.value(); - - _emberMetal.assert('The controller name you supplied \'' + controllerName + '\' did not resolve to a controller.', env.owner.hasRegistration('controller:' + controllerName)); - } else { - controllerName = templateName; - } - - if (args.positional.length === 1) { - return new _glimmerReference.ConstReference(new RenderDefinition(controllerName, template, env, SINGLETON_RENDER_MANAGER)); - } else { - return new _glimmerReference.ConstReference(new RenderDefinition(controllerName, template, env, NON_SINGLETON_RENDER_MANAGER)); - } - } - - /** - Calling ``{{render}}`` from within a template will insert another - template that matches the provided name. The inserted template will - access its properties on its own controller (rather than the controller - of the parent template). - - If a view class with the same name exists, the view class also will be used. - Note: A given controller may only be used *once* in your app in this manner. - A singleton instance of the controller will be created for you. - - Example: - - ```javascript - App.NavigationController = Ember.Controller.extend({ - who: "world" - }); - ``` - - ```handlebars - - Hello, {{who}}. - ``` - - ```handlebars - -

    My great app

    - {{render "navigation"}} - ``` - - ```html -

    My great app

    -
    - Hello, world. -
    - ``` - - Optionally you may provide a second argument: a property path - that will be bound to the `model` property of the controller. - If a `model` property path is specified, then a new instance of the - controller will be created and `{{render}}` can be used multiple times - with the same name. - - For example if you had this `author` template. - - ```handlebars -
    - Written by {{firstName}} {{lastName}}. - Total Posts: {{postCount}} -
    - ``` - - You could render it inside the `post` template using the `render` helper. - - ```handlebars -
    -

    {{title}}

    -
    {{body}}
    - {{render "author" author}} -
    - ``` - - @method render - @for Ember.Templates.helpers - @param {String} name - @param {Object?} context - @param {Hash} options - @return {String} HTML string - @public - */ - - var RenderSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(RenderSyntax, _StatementSyntax); - - RenderSyntax.create = function create(environment, args, symbolTable) { - return new this(environment, args, symbolTable); - }; - - function RenderSyntax(environment, args, symbolTable) { - babelHelpers.classCallCheck(this, RenderSyntax); - - _StatementSyntax.call(this); - this.definitionArgs = args; - this.definition = makeComponentDefinition; - this.args = _glimmerRuntime.ArgsSyntax.fromPositionalArgs(args.positional.slice(1, 2)); - this.symbolTable = symbolTable; - this.shadow = null; - } - - RenderSyntax.prototype.compile = function compile(builder) { - builder.component.dynamic(this.definitionArgs, this.definition, this.args, this.symbolTable, this.shadow); - }; - - return RenderSyntax; - })(_glimmerRuntime.StatementSyntax); - - exports.RenderSyntax = RenderSyntax; - - var AbstractRenderManager = (function () { - function AbstractRenderManager() { - babelHelpers.classCallCheck(this, AbstractRenderManager); - } - - AbstractRenderManager.prototype.prepareArgs = function prepareArgs(definition, args) { - return args; - }; - - /* abstract create(environment, definition, args, dynamicScope); */ - - AbstractRenderManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { - return env.getCompiledBlock(_emberGlimmerSyntaxOutlet.OutletLayoutCompiler, definition.template); - }; - - AbstractRenderManager.prototype.getSelf = function getSelf(_ref) { - var controller = _ref.controller; - - return new _emberGlimmerUtilsReferences.RootReference(controller); - }; - - AbstractRenderManager.prototype.getTag = function getTag() { - return null; - }; - - AbstractRenderManager.prototype.getDestructor = function getDestructor() { - return null; - }; - - AbstractRenderManager.prototype.didCreateElement = function didCreateElement() {}; - - AbstractRenderManager.prototype.didRenderLayout = function didRenderLayout() {}; - - AbstractRenderManager.prototype.didCreate = function didCreate() {}; - - AbstractRenderManager.prototype.update = function update() {}; - - AbstractRenderManager.prototype.didUpdateLayout = function didUpdateLayout() {}; - - AbstractRenderManager.prototype.didUpdate = function didUpdate() {}; - - return AbstractRenderManager; - })(); - - var SingletonRenderManager = (function (_AbstractRenderManager) { - babelHelpers.inherits(SingletonRenderManager, _AbstractRenderManager); - - function SingletonRenderManager() { - babelHelpers.classCallCheck(this, SingletonRenderManager); - - _AbstractRenderManager.apply(this, arguments); - } - - SingletonRenderManager.prototype.create = function create(environment, definition, args, dynamicScope) { - var name = definition.name; - var env = definition.env; - - var controller = env.owner.lookup('controller:' + name) || _emberRouting.generateController(env.owner, name); - - if (dynamicScope.rootOutletState) { - dynamicScope.outletState = dynamicScope.rootOutletState.getOrphan(name); - } - - return { controller: controller }; - }; - - return SingletonRenderManager; - })(AbstractRenderManager); - - var SINGLETON_RENDER_MANAGER = new SingletonRenderManager(); - - var NonSingletonRenderManager = (function (_AbstractRenderManager2) { - babelHelpers.inherits(NonSingletonRenderManager, _AbstractRenderManager2); - - function NonSingletonRenderManager() { - babelHelpers.classCallCheck(this, NonSingletonRenderManager); - - _AbstractRenderManager2.apply(this, arguments); - } - - NonSingletonRenderManager.prototype.create = function create(environment, definition, args, dynamicScope) { - var name = definition.name; - var env = definition.env; - - var modelRef = args.positional.at(0); - - var factory = env.owner._lookupFactory('controller:' + name) || _emberRouting.generateControllerFactory(env.owner, name); - var controller = factory.create({ model: modelRef.value() }); - - if (dynamicScope.rootOutletState) { - dynamicScope.outletState = dynamicScope.rootOutletState.getOrphan(name); - } - - return { controller: controller }; - }; - - NonSingletonRenderManager.prototype.update = function update(_ref2, args, dynamicScope) { - var controller = _ref2.controller; - - controller.set('model', args.positional.at(0).value()); - }; - - NonSingletonRenderManager.prototype.getDestructor = function getDestructor(_ref3) { - var controller = _ref3.controller; - - return controller; - }; - - return NonSingletonRenderManager; - })(AbstractRenderManager); - - var NON_SINGLETON_RENDER_MANAGER = new NonSingletonRenderManager(); - - var RenderDefinition = (function (_ComponentDefinition) { - babelHelpers.inherits(RenderDefinition, _ComponentDefinition); - - function RenderDefinition(name, template, env, manager) { - babelHelpers.classCallCheck(this, RenderDefinition); - - _ComponentDefinition.call(this, 'render', manager, null); - - this.name = name; - this.template = template; - this.env = env; - } - - return RenderDefinition; - })(_glimmerRuntime.ComponentDefinition); -}); -enifed('ember-glimmer/template', ['exports', 'ember-utils', 'glimmer-runtime'], function (exports, _emberUtils, _glimmerRuntime) { - 'use strict'; - - exports.default = template; - - function template(json) { - var factory = _glimmerRuntime.templateFactory(json); - - return { - id: factory.id, - meta: factory.meta, - create: function (props) { - return factory.create(props.env, { owner: props[_emberUtils.OWNER] }); - } - }; - } -}); -enifed("ember-glimmer/template_registry", ["exports"], function (exports) { - // STATE within a module is frowned apon, this exists - // to support Ember.TEMPLATES but shield ember internals from this legacy - // global API. - "use strict"; - - exports.setTemplates = setTemplates; - exports.getTemplates = getTemplates; - exports.getTemplate = getTemplate; - exports.hasTemplate = hasTemplate; - exports.setTemplate = setTemplate; - var TEMPLATES = {}; - - function setTemplates(templates) { - TEMPLATES = templates; - } - - function getTemplates() { - return TEMPLATES; - } - - function getTemplate(name) { - if (TEMPLATES.hasOwnProperty(name)) { - return TEMPLATES[name]; - } - } - - function hasTemplate(name) { - return TEMPLATES.hasOwnProperty(name); - } - - function setTemplate(name, template) { - return TEMPLATES[name] = template; - } -}); -enifed("ember-glimmer/templates/component", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { - "use strict"; - - exports.default = _emberGlimmerTemplate.default({ "id": "ZoGfVsSJ", "block": "{\"statements\":[[\"yield\",\"default\"]],\"locals\":[],\"named\":[],\"yields\":[\"default\"],\"blocks\":[],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/component.hbs" } }); -}); -enifed("ember-glimmer/templates/empty", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { - "use strict"; - - exports.default = _emberGlimmerTemplate.default({ "id": "qEHL4OLi", "block": "{\"statements\":[],\"locals\":[],\"named\":[],\"yields\":[],\"blocks\":[],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/empty.hbs" } }); -}); -enifed("ember-glimmer/templates/link-to", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { - "use strict"; - - exports.default = _emberGlimmerTemplate.default({ "id": "Ca7iQMR7", "block": "{\"statements\":[[\"block\",[\"if\"],[[\"get\",[\"linkTitle\"]]],null,1,0]],\"locals\":[],\"named\":[],\"yields\":[\"default\"],\"blocks\":[{\"statements\":[[\"yield\",\"default\"]],\"locals\":[]},{\"statements\":[[\"append\",[\"unknown\",[\"linkTitle\"]],false]],\"locals\":[]}],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/link-to.hbs" } }); -}); -enifed("ember-glimmer/templates/outlet", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { - "use strict"; - - exports.default = _emberGlimmerTemplate.default({ "id": "sYQo9vi/", "block": "{\"statements\":[[\"append\",[\"unknown\",[\"outlet\"]],false]],\"locals\":[],\"named\":[],\"yields\":[],\"blocks\":[],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/outlet.hbs" } }); -}); -enifed("ember-glimmer/templates/root", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { - "use strict"; - - exports.default = _emberGlimmerTemplate.default({ "id": "Eaf3RPY3", "block": "{\"statements\":[[\"append\",[\"helper\",[\"component\"],[[\"get\",[null]]],null],false]],\"locals\":[],\"named\":[],\"yields\":[],\"blocks\":[],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/root.hbs" } }); -}); -enifed('ember-glimmer/utils/bindings', ['exports', 'glimmer-reference', 'glimmer-runtime', 'ember-metal', 'ember-runtime', 'ember-glimmer/component', 'ember-glimmer/utils/string'], function (exports, _glimmerReference, _glimmerRuntime, _emberMetal, _emberRuntime, _emberGlimmerComponent, _emberGlimmerUtilsString) { - 'use strict'; - - exports.wrapComponentClassAttribute = wrapComponentClassAttribute; - - function referenceForKey(component, key) { - return component[_emberGlimmerComponent.ROOT_REF].get(key); - } - - function referenceForParts(component, parts) { - var isAttrs = parts[0] === 'attrs'; - - // TODO deprecate this - if (isAttrs) { - parts.shift(); - - if (parts.length === 1) { - return referenceForKey(component, parts[0]); - } - } - - return _glimmerReference.referenceFromParts(component[_emberGlimmerComponent.ROOT_REF], parts); - } - - // TODO we should probably do this transform at build time - - function wrapComponentClassAttribute(args) { - var named = args.named; - - var index = named.keys.indexOf('class'); - - if (index !== -1) { - var _named$values$index = named.values[index]; - var ref = _named$values$index.ref; - var type = _named$values$index.type; - - if (type === 'get') { - var propName = ref.parts[ref.parts.length - 1]; - named.values[index] = _glimmerRuntime.HelperSyntax.fromSpec(['helper', ['-class'], [['get', ref.parts], propName], null]); - } - } - - return args; - } - - var AttributeBinding = { - parse: function (microsyntax) { - var colonIndex = microsyntax.indexOf(':'); - - if (colonIndex === -1) { - _emberMetal.assert('You cannot use class as an attributeBinding, use classNameBindings instead.', microsyntax !== 'class'); - return [microsyntax, microsyntax, true]; - } else { - var prop = microsyntax.substring(0, colonIndex); - var attribute = microsyntax.substring(colonIndex + 1); - - _emberMetal.assert('You cannot use class as an attributeBinding, use classNameBindings instead.', attribute !== 'class'); - - return [prop, attribute, false]; - } - }, - - install: function (element, component, parsed, operations) { - var prop = parsed[0]; - var attribute = parsed[1]; - var isSimple = parsed[2]; - - if (attribute === 'id') { - var elementId = _emberMetal.get(component, prop); - if (elementId === undefined || elementId === null) { - elementId = component.elementId; - } - operations.addStaticAttribute(element, 'id', elementId); - return; - } - - var isPath = prop.indexOf('.') > -1; - var reference = isPath ? referenceForParts(component, prop.split('.')) : referenceForKey(component, prop); - - _emberMetal.assert('Illegal attributeBinding: \'' + prop + '\' is not a valid attribute name.', !(isSimple && isPath)); - - if (attribute === 'style') { - reference = new StyleBindingReference(reference, referenceForKey(component, 'isVisible')); - } - - operations.addDynamicAttribute(element, attribute, reference); - } - }; - - exports.AttributeBinding = AttributeBinding; - var DISPLAY_NONE = 'display: none;'; - var SAFE_DISPLAY_NONE = _emberGlimmerUtilsString.htmlSafe(DISPLAY_NONE); - - var StyleBindingReference = (function (_CachedReference) { - babelHelpers.inherits(StyleBindingReference, _CachedReference); - - function StyleBindingReference(inner, isVisible) { - babelHelpers.classCallCheck(this, StyleBindingReference); - - _CachedReference.call(this); - - this.tag = _glimmerReference.combine([inner.tag, isVisible.tag]); - this.inner = inner; - this.isVisible = isVisible; - } - - StyleBindingReference.prototype.compute = function compute() { - var value = this.inner.value(); - var isVisible = this.isVisible.value(); - - if (isVisible !== false) { - return value; - } else if (!value && value !== 0) { - return SAFE_DISPLAY_NONE; - } else { - var style = value + ' ' + DISPLAY_NONE; - return _emberGlimmerUtilsString.isHTMLSafe(value) ? _emberGlimmerUtilsString.htmlSafe(style) : style; - } - }; - - return StyleBindingReference; - })(_glimmerReference.CachedReference); - - var IsVisibleBinding = { - install: function (element, component, operations) { - operations.addDynamicAttribute(element, 'style', _glimmerReference.map(referenceForKey(component, 'isVisible'), this.mapStyleValue)); - }, - - mapStyleValue: function (isVisible) { - return isVisible === false ? SAFE_DISPLAY_NONE : null; - } - }; - - exports.IsVisibleBinding = IsVisibleBinding; - var ClassNameBinding = { - install: function (element, component, microsyntax, operations) { - var _microsyntax$split = microsyntax.split(':'); - - var prop = _microsyntax$split[0]; - var truthy = _microsyntax$split[1]; - var falsy = _microsyntax$split[2]; - - var isStatic = prop === ''; - - if (isStatic) { - operations.addStaticAttribute(element, 'class', truthy); - } else { - var isPath = prop.indexOf('.') > -1; - var parts = isPath && prop.split('.'); - var value = isPath ? referenceForParts(component, parts) : referenceForKey(component, prop); - var ref = undefined; - - if (truthy === undefined) { - ref = new SimpleClassNameBindingReference(value, isPath ? parts[parts.length - 1] : prop); - } else { - ref = new ColonClassNameBindingReference(value, truthy, falsy); - } - - operations.addDynamicAttribute(element, 'class', ref); - } - } - }; - - exports.ClassNameBinding = ClassNameBinding; - - var SimpleClassNameBindingReference = (function (_CachedReference2) { - babelHelpers.inherits(SimpleClassNameBindingReference, _CachedReference2); - - function SimpleClassNameBindingReference(inner, path) { - babelHelpers.classCallCheck(this, SimpleClassNameBindingReference); - - _CachedReference2.call(this); - - this.tag = inner.tag; - this.inner = inner; - this.path = path; - this.dasherizedPath = null; - } - - SimpleClassNameBindingReference.prototype.compute = function compute() { - var value = this.inner.value(); - - if (value === true) { - var path = this.path; - var dasherizedPath = this.dasherizedPath; - - return dasherizedPath || (this.dasherizedPath = _emberRuntime.String.dasherize(path)); - } else if (value || value === 0) { - return value; - } else { - return null; - } - }; - - return SimpleClassNameBindingReference; - })(_glimmerReference.CachedReference); - - var ColonClassNameBindingReference = (function (_CachedReference3) { - babelHelpers.inherits(ColonClassNameBindingReference, _CachedReference3); - - function ColonClassNameBindingReference(inner, truthy, falsy) { - babelHelpers.classCallCheck(this, ColonClassNameBindingReference); - - _CachedReference3.call(this); - - this.tag = inner.tag; - this.inner = inner; - this.truthy = truthy || null; - this.falsy = falsy || null; - } - - ColonClassNameBindingReference.prototype.compute = function compute() { - var inner = this.inner; - var truthy = this.truthy; - var falsy = this.falsy; - - return inner.value() ? truthy : falsy; - }; - - return ColonClassNameBindingReference; - })(_glimmerReference.CachedReference); -}); -enifed('ember-glimmer/utils/iterable', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/each-in', 'glimmer-reference'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberGlimmerUtilsReferences, _emberGlimmerHelpersEachIn, _glimmerReference) { - 'use strict'; - - exports.default = iterableFor; - - var ITERATOR_KEY_GUID = 'be277757-bbbe-4620-9fcb-213ef433cca2'; - - function iterableFor(ref, keyPath) { - if (_emberGlimmerHelpersEachIn.isEachIn(ref)) { - return new EachInIterable(ref, keyForEachIn(keyPath)); - } else { - return new ArrayIterable(ref, keyForArray(keyPath)); - } - } - - function keyForEachIn(keyPath) { - switch (keyPath) { - case '@index': - case undefined: - case null: - return index; - case '@identity': - return identity; - default: - return function (item) { - return _emberMetal.get(item, keyPath); - }; - } - } - - function keyForArray(keyPath) { - switch (keyPath) { - case '@index': - return index; - case '@identity': - case undefined: - case null: - return identity; - default: - return function (item) { - return _emberMetal.get(item, keyPath); - }; - } - } - - function index(item, index) { - return String(index); - } - - function identity(item) { - switch (typeof item) { - case 'string': - case 'number': - return String(item); - default: - return _emberUtils.guidFor(item); - } - } - - function ensureUniqueKey(seen, key) { - var seenCount = seen[key]; - - if (seenCount) { - seen[key]++; - return '' + key + ITERATOR_KEY_GUID + seenCount; - } else { - seen[key] = 1; - } - - return key; - } - - var ArrayIterator = (function () { - function ArrayIterator(array, keyFor) { - babelHelpers.classCallCheck(this, ArrayIterator); - - this.array = array; - this.length = array.length; - this.keyFor = keyFor; - this.position = 0; - this.seen = new _emberUtils.EmptyObject(); - } - - ArrayIterator.prototype.isEmpty = function isEmpty() { - return false; - }; - - ArrayIterator.prototype.next = function next() { - var array = this.array; - var length = this.length; - var keyFor = this.keyFor; - var position = this.position; - var seen = this.seen; - - if (position >= length) { - return null; - } - - var value = array[position]; - var memo = position; - var key = ensureUniqueKey(seen, keyFor(value, memo)); - - this.position++; - - return { key: key, value: value, memo: memo }; - }; - - return ArrayIterator; - })(); - - var EmberArrayIterator = (function () { - function EmberArrayIterator(array, keyFor) { - babelHelpers.classCallCheck(this, EmberArrayIterator); - - this.array = array; - this.length = _emberMetal.get(array, 'length'); - this.keyFor = keyFor; - this.position = 0; - this.seen = new _emberUtils.EmptyObject(); - } - - EmberArrayIterator.prototype.isEmpty = function isEmpty() { - return this.length === 0; - }; - - EmberArrayIterator.prototype.next = function next() { - var array = this.array; - var length = this.length; - var keyFor = this.keyFor; - var position = this.position; - var seen = this.seen; - - if (position >= length) { - return null; - } - - var value = _emberRuntime.objectAt(array, position); - var memo = position; - var key = ensureUniqueKey(seen, keyFor(value, memo)); - - this.position++; - - return { key: key, value: value, memo: memo }; - }; - - return EmberArrayIterator; - })(); - - var ObjectKeysIterator = (function () { - function ObjectKeysIterator(keys, values, keyFor) { - babelHelpers.classCallCheck(this, ObjectKeysIterator); - - this.keys = keys; - this.values = values; - this.keyFor = keyFor; - this.position = 0; - this.seen = new _emberUtils.EmptyObject(); - } - - ObjectKeysIterator.prototype.isEmpty = function isEmpty() { - return this.keys.length === 0; - }; - - ObjectKeysIterator.prototype.next = function next() { - var keys = this.keys; - var values = this.values; - var keyFor = this.keyFor; - var position = this.position; - var seen = this.seen; - - if (position >= keys.length) { - return null; - } - - var value = values[position]; - var memo = keys[position]; - var key = ensureUniqueKey(seen, keyFor(value, memo)); - - this.position++; - - return { key: key, value: value, memo: memo }; - }; - - return ObjectKeysIterator; - })(); - - var EmptyIterator = (function () { - function EmptyIterator() { - babelHelpers.classCallCheck(this, EmptyIterator); - } - - EmptyIterator.prototype.isEmpty = function isEmpty() { - return true; - }; - - EmptyIterator.prototype.next = function next() { - throw new Error('Cannot call next() on an empty iterator'); - }; - - return EmptyIterator; - })(); - - var EMPTY_ITERATOR = new EmptyIterator(); - - var EachInIterable = (function () { - function EachInIterable(ref, keyFor) { - babelHelpers.classCallCheck(this, EachInIterable); - - this.ref = ref; - this.keyFor = keyFor; - - var valueTag = this.valueTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - - this.tag = _glimmerReference.combine([ref.tag, valueTag]); - } - - EachInIterable.prototype.iterate = function iterate() { - var ref = this.ref; - var keyFor = this.keyFor; - var valueTag = this.valueTag; - - var iterable = ref.value(); - - valueTag.update(_emberMetal.tagFor(iterable)); - - if (_emberMetal.isProxy(iterable)) { - iterable = _emberMetal.get(iterable, 'content'); - } - - var typeofIterable = typeof iterable; - - if (iterable && (typeofIterable === 'object' || typeofIterable === 'function')) { - var keys = Object.keys(iterable); - var values = keys.map(function (key) { - return iterable[key]; - }); - return keys.length > 0 ? new ObjectKeysIterator(keys, values, keyFor) : EMPTY_ITERATOR; - } else { - return EMPTY_ITERATOR; - } - }; - - // {{each-in}} yields |key value| instead of |value key|, so the memo and - // value are flipped - - EachInIterable.prototype.valueReferenceFor = function valueReferenceFor(item) { - return new _emberGlimmerUtilsReferences.UpdatablePrimitiveReference(item.memo); - }; - - EachInIterable.prototype.updateValueReference = function updateValueReference(reference, item) { - reference.update(item.memo); - }; - - EachInIterable.prototype.memoReferenceFor = function memoReferenceFor(item) { - return new _emberGlimmerUtilsReferences.UpdatableReference(item.value); - }; - - EachInIterable.prototype.updateMemoReference = function updateMemoReference(reference, item) { - reference.update(item.value); - }; - - return EachInIterable; - })(); - - var ArrayIterable = (function () { - function ArrayIterable(ref, keyFor) { - babelHelpers.classCallCheck(this, ArrayIterable); - - this.ref = ref; - this.keyFor = keyFor; - - var valueTag = this.valueTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - - this.tag = _glimmerReference.combine([ref.tag, valueTag]); - } - - ArrayIterable.prototype.iterate = function iterate() { - var ref = this.ref; - var keyFor = this.keyFor; - var valueTag = this.valueTag; - - var iterable = ref.value(); - - valueTag.update(_emberMetal.tagForProperty(iterable, '[]')); - - if (!iterable || typeof iterable !== 'object') { - return EMPTY_ITERATOR; - } - - if (Array.isArray(iterable)) { - return iterable.length > 0 ? new ArrayIterator(iterable, keyFor) : EMPTY_ITERATOR; - } else if (_emberRuntime.isEmberArray(iterable)) { - return _emberMetal.get(iterable, 'length') > 0 ? new EmberArrayIterator(iterable, keyFor) : EMPTY_ITERATOR; - } else if (typeof iterable.forEach === 'function') { - var _ret = (function () { - var array = []; - iterable.forEach(function (item) { - array.push(item); - }); - return { - v: array.length > 0 ? new ArrayIterator(array, keyFor) : EMPTY_ITERATOR - }; - })(); - - if (typeof _ret === 'object') return _ret.v; - } else { - return EMPTY_ITERATOR; - } - }; - - ArrayIterable.prototype.valueReferenceFor = function valueReferenceFor(item) { - return new _emberGlimmerUtilsReferences.UpdatableReference(item.value); - }; - - ArrayIterable.prototype.updateValueReference = function updateValueReference(reference, item) { - reference.update(item.value); - }; - - ArrayIterable.prototype.memoReferenceFor = function memoReferenceFor(item) { - return new _emberGlimmerUtilsReferences.UpdatablePrimitiveReference(item.memo); - }; - - ArrayIterable.prototype.updateMemoReference = function updateMemoReference(reference, item) { - reference.update(item.memo); - }; - - return ArrayIterable; - })(); -}); -enifed('ember-glimmer/utils/process-args', ['exports', 'ember-utils', 'glimmer-reference', 'ember-glimmer/component', 'ember-glimmer/utils/references', 'ember-views', 'ember-glimmer/helpers/action', 'glimmer-runtime'], function (exports, _emberUtils, _glimmerReference, _emberGlimmerComponent, _emberGlimmerUtilsReferences, _emberViews, _emberGlimmerHelpersAction, _glimmerRuntime) { - 'use strict'; - - exports.gatherArgs = gatherArgs; - - // Maps all variants of positional and dynamically scoped arguments - // into the named arguments. Input `args` and return value are both - // `EvaluatedArgs`. - - function gatherArgs(args, definition) { - var namedMap = gatherNamedMap(args, definition); - var positionalValues = gatherPositionalValues(args, definition); - return mergeArgs(namedMap, positionalValues, args.blocks, definition.ComponentClass); - } - - function gatherNamedMap(args, definition) { - var namedMap = args.named.map; - if (definition.args) { - return _emberUtils.assign({}, definition.args.named.map, namedMap); - } else { - return namedMap; - } - } - - function gatherPositionalValues(args, definition) { - var positionalValues = args.positional.values; - if (definition.args) { - var oldPositional = definition.args.positional.values; - var newPositional = []; - newPositional.push.apply(newPositional, oldPositional); - newPositional.splice.apply(newPositional, [0, positionalValues.length].concat(positionalValues)); - return newPositional; - } else { - return positionalValues; - } - } - - function mergeArgs(namedMap, positionalValues, blocks, componentClass) { - var positionalParamsDefinition = componentClass.positionalParams; - - if (positionalParamsDefinition && positionalParamsDefinition.length > 0 && positionalValues.length > 0) { - if (typeof positionalParamsDefinition === 'string') { - namedMap = mergeRestArg(namedMap, positionalValues, positionalParamsDefinition); - } else { - namedMap = mergePositionalParams(namedMap, positionalValues, positionalParamsDefinition); - } - } - return _glimmerRuntime.EvaluatedArgs.named(namedMap, blocks); - } - - var EMPTY_ARGS = { - tag: _glimmerReference.CONSTANT_TAG, - value: function () { - var _props; - - return { attrs: {}, props: (_props = { attrs: {} }, _props[_emberGlimmerComponent.ARGS] = {}, _props) }; - } - }; - - // ComponentArgs takes EvaluatedNamedArgs and converts them into the - // inputs needed by CurlyComponents (attrs and props, with mutable - // cells, etc). - - var ComponentArgs = (function () { - ComponentArgs.create = function create(args) { - if (args.named.keys.length === 0) { - return EMPTY_ARGS; - } else { - return new ComponentArgs(args.named); - } - }; - - function ComponentArgs(namedArgs) { - babelHelpers.classCallCheck(this, ComponentArgs); - - this.tag = namedArgs.tag; - this.namedArgs = namedArgs; - } - - ComponentArgs.prototype.value = function value() { - var namedArgs = this.namedArgs; - - var keys = namedArgs.keys; - var attrs = namedArgs.value(); - var props = new _emberUtils.EmptyObject(); - var args = new _emberUtils.EmptyObject(); - - props[_emberGlimmerComponent.ARGS] = args; - - for (var i = 0, l = keys.length; i < l; i++) { - var _name = keys[i]; - var ref = namedArgs.get(_name); - var value = attrs[_name]; - - if (typeof value === 'function' && value[_emberGlimmerHelpersAction.ACTION]) { - attrs[_name] = value; - } else if (ref[_emberGlimmerUtilsReferences.UPDATE]) { - attrs[_name] = new MutableCell(ref, value); - } - - args[_name] = ref; - props[_name] = value; - } - - props.attrs = attrs; - - return { attrs: attrs, props: props }; - }; - - return ComponentArgs; - })(); - - exports.ComponentArgs = ComponentArgs; - - function mergeRestArg(namedMap, positionalValues, restArgName) { - var mergedNamed = _emberUtils.assign({}, namedMap); - mergedNamed[restArgName] = _glimmerRuntime.EvaluatedPositionalArgs.create(positionalValues); - return mergedNamed; - } - - function mergePositionalParams(namedMap, values, positionalParamNames) { - var mergedNamed = _emberUtils.assign({}, namedMap); - var length = Math.min(values.length, positionalParamNames.length); - for (var i = 0; i < length; i++) { - var _name2 = positionalParamNames[i]; - mergedNamed[_name2] = values[i]; - } - return mergedNamed; - } - - var REF = _emberUtils.symbol('REF'); - - var MutableCell = (function () { - function MutableCell(ref, value) { - babelHelpers.classCallCheck(this, MutableCell); - - this[_emberViews.MUTABLE_CELL] = true; - this[REF] = ref; - this.value = value; - } - - MutableCell.prototype.update = function update(val) { - this[REF][_emberGlimmerUtilsReferences.UPDATE](val); - }; - - return MutableCell; - })(); -}); -enifed('ember-glimmer/utils/references', ['exports', 'ember-utils', 'ember-metal', 'glimmer-reference', 'glimmer-runtime', 'ember-glimmer/utils/to-bool', 'ember-glimmer/helper'], function (exports, _emberUtils, _emberMetal, _glimmerReference, _glimmerRuntime, _emberGlimmerUtilsToBool, _emberGlimmerHelper) { - 'use strict'; - - var UPDATE = _emberUtils.symbol('UPDATE'); - - exports.UPDATE = UPDATE; - exports.NULL_REFERENCE = _glimmerRuntime.NULL_REFERENCE; - exports.UNDEFINED_REFERENCE = _glimmerRuntime.UNDEFINED_REFERENCE; - - // @abstract - // @implements PathReference - - var EmberPathReference = (function () { - function EmberPathReference() { - babelHelpers.classCallCheck(this, EmberPathReference); - } - - // @abstract - - // @abstract get tag() - // @abstract value() - - EmberPathReference.prototype.get = function get(key) { - return PropertyReference.create(this, key); - }; - - return EmberPathReference; - })(); - - var CachedReference = (function (_EmberPathReference) { - babelHelpers.inherits(CachedReference, _EmberPathReference); - - function CachedReference() { - babelHelpers.classCallCheck(this, CachedReference); - - _EmberPathReference.call(this); - this._lastRevision = null; - this._lastValue = null; - } - - // @implements PathReference - - CachedReference.prototype.value = function value() { - var tag = this.tag; - var _lastRevision = this._lastRevision; - var _lastValue = this._lastValue; - - if (!_lastRevision || !tag.validate(_lastRevision)) { - _lastValue = this._lastValue = this.compute(); - this._lastRevision = tag.value(); - } - - return _lastValue; - }; - - // @abstract compute() - return CachedReference; - })(EmberPathReference); - - exports.CachedReference = CachedReference; - - var RootReference = (function (_ConstReference) { - babelHelpers.inherits(RootReference, _ConstReference); - - function RootReference(value) { - babelHelpers.classCallCheck(this, RootReference); - - _ConstReference.call(this, value); - this.children = new _emberUtils.EmptyObject(); - } - - RootReference.prototype.get = function get(propertyKey) { - var ref = this.children[propertyKey]; - - if (!ref) { - ref = this.children[propertyKey] = new RootPropertyReference(this.inner, propertyKey); - } - - return ref; - }; - - return RootReference; - })(_glimmerReference.ConstReference); - - exports.RootReference = RootReference; - - var TwoWayFlushDetectionTag = undefined; - - if (true || true) { - TwoWayFlushDetectionTag = (function () { - function _class(tag, key, ref) { - babelHelpers.classCallCheck(this, _class); - - this.tag = tag; - this.parent = null; - this.key = key; - this.ref = ref; - } - - _class.prototype.value = function value() { - return this.tag.value(); - }; - - _class.prototype.validate = function validate(ticket) { - var parent = this.parent; - var key = this.key; - - var isValid = this.tag.validate(ticket); - - if (isValid && parent) { - _emberMetal.didRender(parent, key, this.ref); - } - - return isValid; - }; - - _class.prototype.didCompute = function didCompute(parent) { - this.parent = parent; - _emberMetal.didRender(parent, this.key, this.ref); - }; - - return _class; - })(); - } - - var PropertyReference = (function (_CachedReference) { - babelHelpers.inherits(PropertyReference, _CachedReference); - - function PropertyReference() { - babelHelpers.classCallCheck(this, PropertyReference); - - _CachedReference.apply(this, arguments); - } - - PropertyReference.create = function create(parentReference, propertyKey) { - if (_glimmerReference.isConst(parentReference)) { - return new RootPropertyReference(parentReference.value(), propertyKey); - } else { - return new NestedPropertyReference(parentReference, propertyKey); - } - }; - - PropertyReference.prototype.get = function get(key) { - return new NestedPropertyReference(this, key); - }; - - return PropertyReference; - })(CachedReference); - - exports.PropertyReference = PropertyReference; - - var RootPropertyReference = (function (_PropertyReference) { - babelHelpers.inherits(RootPropertyReference, _PropertyReference); - - function RootPropertyReference(parentValue, propertyKey) { - babelHelpers.classCallCheck(this, RootPropertyReference); - - _PropertyReference.call(this); - - this._parentValue = parentValue; - this._propertyKey = propertyKey; - - if (true || true) { - this.tag = new TwoWayFlushDetectionTag(_emberMetal.tagForProperty(parentValue, propertyKey), propertyKey, this); - } else { - this.tag = _emberMetal.tagForProperty(parentValue, propertyKey); - } - - if (true) { - _emberMetal.watchKey(parentValue, propertyKey); - } - } - - RootPropertyReference.prototype.compute = function compute() { - var _parentValue = this._parentValue; - var _propertyKey = this._propertyKey; - - if (true || true) { - this.tag.didCompute(_parentValue); - } - - return _emberMetal.get(_parentValue, _propertyKey); - }; - - RootPropertyReference.prototype[UPDATE] = function (value) { - _emberMetal.set(this._parentValue, this._propertyKey, value); - }; - - return RootPropertyReference; - })(PropertyReference); - - exports.RootPropertyReference = RootPropertyReference; - - var NestedPropertyReference = (function (_PropertyReference2) { - babelHelpers.inherits(NestedPropertyReference, _PropertyReference2); - - function NestedPropertyReference(parentReference, propertyKey) { - babelHelpers.classCallCheck(this, NestedPropertyReference); - - _PropertyReference2.call(this); - - var parentReferenceTag = parentReference.tag; - var parentObjectTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - - this._parentReference = parentReference; - this._parentObjectTag = parentObjectTag; - this._propertyKey = propertyKey; - - if (true || true) { - var tag = _glimmerReference.combine([parentReferenceTag, parentObjectTag]); - this.tag = new TwoWayFlushDetectionTag(tag, propertyKey, this); - } else { - this.tag = _glimmerReference.combine([parentReferenceTag, parentObjectTag]); - } - } - - NestedPropertyReference.prototype.compute = function compute() { - var _parentReference = this._parentReference; - var _parentObjectTag = this._parentObjectTag; - var _propertyKey = this._propertyKey; - - var parentValue = _parentReference.value(); - - _parentObjectTag.update(_emberMetal.tagForProperty(parentValue, _propertyKey)); - - if (typeof parentValue === 'string' && _propertyKey === 'length') { - return parentValue.length; - } - - if (typeof parentValue === 'object' && parentValue) { - if (true) { - _emberMetal.watchKey(parentValue, _propertyKey); - } - - if (true || true) { - this.tag.didCompute(parentValue); - } - - return _emberMetal.get(parentValue, _propertyKey); - } else { - return undefined; - } - }; - - NestedPropertyReference.prototype[UPDATE] = function (value) { - var parent = this._parentReference.value(); - _emberMetal.set(parent, this._propertyKey, value); - }; - - return NestedPropertyReference; - })(PropertyReference); - - exports.NestedPropertyReference = NestedPropertyReference; - - var UpdatableReference = (function (_EmberPathReference2) { - babelHelpers.inherits(UpdatableReference, _EmberPathReference2); - - function UpdatableReference(value) { - babelHelpers.classCallCheck(this, UpdatableReference); - - _EmberPathReference2.call(this); - - this.tag = new _glimmerReference.DirtyableTag(); - this._value = value; - } - - UpdatableReference.prototype.value = function value() { - return this._value; - }; - - UpdatableReference.prototype.update = function update(value) { - var _value = this._value; - - if (value !== _value) { - this.tag.dirty(); - this._value = value; - } - }; - - return UpdatableReference; - })(EmberPathReference); - - exports.UpdatableReference = UpdatableReference; - - var UpdatablePrimitiveReference = (function (_UpdatableReference) { - babelHelpers.inherits(UpdatablePrimitiveReference, _UpdatableReference); - - function UpdatablePrimitiveReference() { - babelHelpers.classCallCheck(this, UpdatablePrimitiveReference); - - _UpdatableReference.apply(this, arguments); - } - - UpdatablePrimitiveReference.prototype.get = function get() { - return _glimmerRuntime.UNDEFINED_REFERENCE; - }; - - return UpdatablePrimitiveReference; - })(UpdatableReference); - - exports.UpdatablePrimitiveReference = UpdatablePrimitiveReference; - - var ConditionalReference = (function (_GlimmerConditionalReference) { - babelHelpers.inherits(ConditionalReference, _GlimmerConditionalReference); - - ConditionalReference.create = function create(reference) { - if (_glimmerReference.isConst(reference)) { - var value = reference.value(); - - if (_emberMetal.isProxy(value)) { - return new RootPropertyReference(value, 'isTruthy'); - } else { - return _glimmerRuntime.PrimitiveReference.create(_emberGlimmerUtilsToBool.default(value)); - } - } - - return new ConditionalReference(reference); - }; - - function ConditionalReference(reference) { - babelHelpers.classCallCheck(this, ConditionalReference); - - _GlimmerConditionalReference.call(this, reference); - - this.objectTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - this.tag = _glimmerReference.combine([reference.tag, this.objectTag]); - } - - ConditionalReference.prototype.toBool = function toBool(predicate) { - if (_emberMetal.isProxy(predicate)) { - this.objectTag.update(_emberMetal.tagForProperty(predicate, 'isTruthy')); - return _emberMetal.get(predicate, 'isTruthy'); - } else { - this.objectTag.update(_emberMetal.tagFor(predicate)); - return _emberGlimmerUtilsToBool.default(predicate); - } - }; - - return ConditionalReference; - })(_glimmerRuntime.ConditionalReference); - - exports.ConditionalReference = ConditionalReference; - - var SimpleHelperReference = (function (_CachedReference2) { - babelHelpers.inherits(SimpleHelperReference, _CachedReference2); - - SimpleHelperReference.create = function create(helper, args) { - if (_glimmerReference.isConst(args)) { - var _ret = (function () { - var positional = args.positional; - var named = args.named; - - var positionalValue = positional.value(); - var namedValue = named.value(); - - _emberMetal.runInDebug(function () { - Object.freeze(positionalValue); - Object.freeze(namedValue); - }); - - var result = helper(positionalValue, namedValue); - - if (result === null) { - return { - v: _glimmerRuntime.NULL_REFERENCE - }; - } else if (result === undefined) { - return { - v: _glimmerRuntime.UNDEFINED_REFERENCE - }; - } else if (typeof result === 'object') { - return { - v: new RootReference(result) - }; - } else { - return { - v: _glimmerRuntime.PrimitiveReference.create(result) - }; - } - })(); - - if (typeof _ret === 'object') return _ret.v; - } else { - return new SimpleHelperReference(helper, args); - } - }; - - function SimpleHelperReference(helper, args) { - babelHelpers.classCallCheck(this, SimpleHelperReference); - - _CachedReference2.call(this); - - this.tag = args.tag; - this.helper = helper; - this.args = args; - } - - SimpleHelperReference.prototype.compute = function compute() { - var helper = this.helper; - var _args = this.args; - var positional = _args.positional; - var named = _args.named; - - var positionalValue = positional.value(); - var namedValue = named.value(); - - _emberMetal.runInDebug(function () { - Object.freeze(positionalValue); - Object.freeze(namedValue); - }); - - return helper(positionalValue, namedValue); - }; - - return SimpleHelperReference; - })(CachedReference); - - exports.SimpleHelperReference = SimpleHelperReference; - - var ClassBasedHelperReference = (function (_CachedReference3) { - babelHelpers.inherits(ClassBasedHelperReference, _CachedReference3); - - ClassBasedHelperReference.create = function create(helperClass, vm, args) { - var instance = helperClass.create(); - vm.newDestroyable(instance); - return new ClassBasedHelperReference(instance, args); - }; - - function ClassBasedHelperReference(instance, args) { - babelHelpers.classCallCheck(this, ClassBasedHelperReference); - - _CachedReference3.call(this); - - this.tag = _glimmerReference.combine([instance[_emberGlimmerHelper.RECOMPUTE_TAG], args.tag]); - this.instance = instance; - this.args = args; - } - - ClassBasedHelperReference.prototype.compute = function compute() { - var instance = this.instance; - var _args2 = this.args; - var positional = _args2.positional; - var named = _args2.named; - - var positionalValue = positional.value(); - var namedValue = named.value(); - - _emberMetal.runInDebug(function () { - Object.freeze(positionalValue); - Object.freeze(namedValue); - }); - - return instance.compute(positionalValue, namedValue); - }; - - return ClassBasedHelperReference; - })(CachedReference); - - exports.ClassBasedHelperReference = ClassBasedHelperReference; - - var InternalHelperReference = (function (_CachedReference4) { - babelHelpers.inherits(InternalHelperReference, _CachedReference4); - - function InternalHelperReference(helper, args) { - babelHelpers.classCallCheck(this, InternalHelperReference); - - _CachedReference4.call(this); - - this.tag = args.tag; - this.helper = helper; - this.args = args; - } - - // @implements PathReference - - InternalHelperReference.prototype.compute = function compute() { - var helper = this.helper; - var args = this.args; - - return helper(args); - }; - - return InternalHelperReference; - })(CachedReference); - - exports.InternalHelperReference = InternalHelperReference; - - var UnboundReference = (function (_ConstReference2) { - babelHelpers.inherits(UnboundReference, _ConstReference2); - - function UnboundReference() { - babelHelpers.classCallCheck(this, UnboundReference); - - _ConstReference2.apply(this, arguments); - } - - UnboundReference.create = function create(value) { - if (value === null) { - return _glimmerRuntime.NULL_REFERENCE; - } else if (value === undefined) { - return _glimmerRuntime.UNDEFINED_REFERENCE; - } else if (typeof value === 'object') { - return new UnboundReference(value); - } else { - return _glimmerRuntime.PrimitiveReference.create(value); - } - }; - - UnboundReference.prototype.get = function get(key) { - return new UnboundReference(_emberMetal.get(this.inner, key)); - }; - - return UnboundReference; - })(_glimmerReference.ConstReference); - - exports.UnboundReference = UnboundReference; -}); -enifed('ember-glimmer/utils/string', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-glimmer - */ - - 'use strict'; - - exports.getSafeString = getSafeString; - exports.escapeExpression = escapeExpression; - exports.htmlSafe = htmlSafe; - exports.isHTMLSafe = isHTMLSafe; - - var SafeString = (function () { - function SafeString(string) { - babelHelpers.classCallCheck(this, SafeString); - - this.string = string; - } - - SafeString.prototype.toString = function toString() { - return '' + this.string; - }; - - SafeString.prototype.toHTML = function toHTML() { - return this.toString(); - }; - - return SafeString; - })(); - - exports.SafeString = SafeString; - - function getSafeString() { - _emberMetal.deprecate('Ember.Handlebars.SafeString is deprecated in favor of Ember.String.htmlSafe', !true, { - id: 'ember-htmlbars.ember-handlebars-safestring', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x#toc_use-ember-string-htmlsafe-over-ember-handlebars-safestring' - }); - - return SafeString; - } - - var escape = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - // jscs:disable - "'": ''', - // jscs:enable - '`': '`', - '=': '=' - }; - - var possible = /[&<>"'`=]/; - var badChars = /[&<>"'`=]/g; - - function escapeChar(chr) { - return escape[chr]; - } - - function escapeExpression(string) { - if (typeof string !== 'string') { - // don't escape SafeStrings, since they're already safe - if (string && string.toHTML) { - return string.toHTML(); - } else if (string == null) { - return ''; - } else if (!string) { - return string + ''; - } - - // Force a string conversion as this will be done by the append regardless and - // the regex test will do this transparently behind the scenes, causing issues if - // an object's to string has escaped characters in it. - string = '' + string; - } - - if (!possible.test(string)) { - return string; - } - return string.replace(badChars, escapeChar); - } - - /** - 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. - - ```javascript - Ember.String.htmlSafe('
    someString
    ') - ``` - - @method htmlSafe - @for Ember.String - @static - @return {Handlebars.SafeString} A string that will not be HTML escaped by Handlebars. - @public - */ - - function htmlSafe(str) { - if (str === null || str === undefined) { - str = ''; - } else if (typeof str !== 'string') { - str = '' + str; - } - return new SafeString(str); - } - - /** - Detects if a string was decorated using `Ember.String.htmlSafe`. - - ```javascript - var plainString = 'plain string', - safeString = Ember.String.htmlSafe('
    someValue
    '); - - Ember.String.isHTMLSafe(plainString); // false - Ember.String.isHTMLSafe(safeString); // true - ``` - - @method isHTMLSafe - @for Ember.String - @static - @return {Boolean} `true` if the string was decorated with `htmlSafe`, `false` otherwise. - @public - */ - - function isHTMLSafe(str) { - return str && typeof str.toHTML === 'function'; - } -}); -enifed('ember-glimmer/utils/to-bool', ['exports', 'ember-runtime', 'ember-metal'], function (exports, _emberRuntime, _emberMetal) { - 'use strict'; - - exports.default = toBool; - - function toBool(predicate) { - if (!predicate) { - return false; - } - - if (predicate === true) { - return true; - } - - if (_emberRuntime.isArray(predicate)) { - return _emberMetal.get(predicate, 'length') !== 0; - } - - return true; - } -}); -enifed('ember-glimmer/views/outlet', ['exports', 'ember-utils', 'glimmer-reference', 'ember-environment', 'ember-metal'], function (exports, _emberUtils, _glimmerReference, _emberEnvironment, _emberMetal) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; - - var OutletStateReference = (function () { - function OutletStateReference(outletView) { - babelHelpers.classCallCheck(this, OutletStateReference); - - this.outletView = outletView; - this.tag = outletView._tag; - } - - // So this is a relic of the past that SHOULD go away - // in 3.0. Preferably it is deprecated in the release that - // follows the Glimmer release. - - OutletStateReference.prototype.get = function get(key) { - return new ChildOutletStateReference(this, key); - }; - - OutletStateReference.prototype.value = function value() { - return this.outletView.outletState; - }; - - OutletStateReference.prototype.getOrphan = function getOrphan(name) { - return new OrphanedOutletStateReference(this, name); - }; - - OutletStateReference.prototype.update = function update(state) { - this.outletView.setOutletState(state); - }; - - return OutletStateReference; - })(); - - var OrphanedOutletStateReference = (function (_OutletStateReference) { - babelHelpers.inherits(OrphanedOutletStateReference, _OutletStateReference); - - function OrphanedOutletStateReference(root, name) { - babelHelpers.classCallCheck(this, OrphanedOutletStateReference); - - _OutletStateReference.call(this, root.outletView); - this.root = root; - this.name = name; - } - - OrphanedOutletStateReference.prototype.value = function value() { - var rootState = this.root.value(); - - var orphans = rootState.outlets.main.outlets.__ember_orphans__; - - if (!orphans) { - return null; - } - - var matched = orphans.outlets[this.name]; - - if (!matched) { - return null; - } - - var state = new _emberUtils.EmptyObject(); - state[matched.render.outlet] = matched; - matched.wasUsed = true; - return { outlets: state }; - }; - - return OrphanedOutletStateReference; - })(OutletStateReference); - - var ChildOutletStateReference = (function () { - function ChildOutletStateReference(parent, key) { - babelHelpers.classCallCheck(this, ChildOutletStateReference); - - this.parent = parent; - this.key = key; - this.tag = parent.tag; - } - - ChildOutletStateReference.prototype.get = function get(key) { - return new ChildOutletStateReference(this, key); - }; - - ChildOutletStateReference.prototype.value = function value() { - return this.parent.value()[this.key]; - }; - - return ChildOutletStateReference; - })(); - - var OutletView = (function () { - OutletView.extend = function extend(injections) { - return (function (_OutletView) { - babelHelpers.inherits(_class, _OutletView); - - function _class() { - babelHelpers.classCallCheck(this, _class); - - _OutletView.apply(this, arguments); - } - - _class.create = function create(options) { - if (options) { - return _OutletView.create.call(this, _emberUtils.assign({}, injections, options)); - } else { - return _OutletView.create.call(this, injections); - } - }; - - return _class; - })(OutletView); - }; - - OutletView.reopenClass = function reopenClass(injections) { - _emberUtils.assign(this, injections); - }; - - OutletView.create = function create(options) { - var _environment = options._environment; - var renderer = options.renderer; - var template = options.template; - - var owner = options[_emberUtils.OWNER]; - return new OutletView(_environment, renderer, owner, template); - }; - - function OutletView(_environment, renderer, owner, template) { - babelHelpers.classCallCheck(this, OutletView); - - this._environment = _environment; - this.renderer = renderer; - this.owner = owner; - this.template = template; - this.outletState = null; - this._tag = new _glimmerReference.DirtyableTag(); - } - - OutletView.prototype.appendTo = function appendTo(selector) { - var env = this._environment || _emberEnvironment.environment; - var target = undefined; - - if (env.hasDOM) { - target = typeof selector === 'string' ? document.querySelector(selector) : selector; - } else { - target = selector; - } - - _emberMetal.run.schedule('render', this.renderer, 'appendOutletView', this, target); - }; - - OutletView.prototype.rerender = function rerender() {}; - - OutletView.prototype.setOutletState = function setOutletState(state) { - this.outletState = { - outlets: { - main: state - }, - render: { - owner: undefined, - into: undefined, - outlet: 'main', - name: '-top-level', - controller: undefined, - ViewClass: undefined, - template: undefined - } - }; - this._tag.dirty(); - }; - - OutletView.prototype.toReference = function toReference() { - return new OutletStateReference(this); - }; - - OutletView.prototype.destroy = function destroy() {}; - - return OutletView; - })(); - - exports.default = OutletView; -}); -enifed('ember-metal/alias', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/error', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/meta', 'ember-metal/dependent_keys'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalError, _emberMetalProperties, _emberMetalComputed, _emberMetalMeta, _emberMetalDependent_keys) { - 'use strict'; - - exports.default = alias; - exports.AliasedProperty = AliasedProperty; - - var CONSUMED = {}; - - function alias(altKey) { - return new AliasedProperty(altKey); - } - - function AliasedProperty(altKey) { - this.isDescriptor = true; - this.altKey = altKey; - this._dependentKeys = [altKey]; - } - - AliasedProperty.prototype = Object.create(_emberMetalProperties.Descriptor.prototype); - - AliasedProperty.prototype.setup = function (obj, keyName) { - _emberMetalDebug.assert('Setting alias \'' + keyName + '\' on self', this.altKey !== keyName); - var meta = _emberMetalMeta.meta(obj); - if (meta.peekWatching(keyName)) { - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); - } - }; - - AliasedProperty.prototype.teardown = function (obj, keyName) { - var meta = _emberMetalMeta.meta(obj); - if (meta.peekWatching(keyName)) { - _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); - } - }; - - AliasedProperty.prototype.willWatch = function (obj, keyName) { - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); - }; - - AliasedProperty.prototype.didUnwatch = function (obj, keyName) { - _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); - }; - - AliasedProperty.prototype.get = function AliasedProperty_get(obj, keyName) { - var ret = _emberMetalProperty_get.get(obj, this.altKey); - var meta = _emberMetalMeta.meta(obj); - var cache = meta.writableCache(); - if (cache[keyName] !== CONSUMED) { - cache[keyName] = CONSUMED; - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); - } - return ret; - }; - - AliasedProperty.prototype.set = function AliasedProperty_set(obj, keyName, value) { - return _emberMetalProperty_set.set(obj, this.altKey, value); - }; - - AliasedProperty.prototype.readOnly = function () { - this.set = AliasedProperty_readOnlySet; - return this; - }; - - function AliasedProperty_readOnlySet(obj, keyName, value) { - throw new _emberMetalError.default('Cannot set read-only property \'' + keyName + '\' on object: ' + _emberUtils.inspect(obj)); - } - - AliasedProperty.prototype.oneWay = function () { - this.set = AliasedProperty_oneWaySet; - return this; - }; - - function AliasedProperty_oneWaySet(obj, keyName, value) { - _emberMetalProperties.defineProperty(obj, keyName, null); - return _emberMetalProperty_set.set(obj, keyName, value); - } - - // Backwards compatibility with Ember Data. - AliasedProperty.prototype._meta = undefined; - AliasedProperty.prototype.meta = _emberMetalComputed.ComputedProperty.prototype.meta; -}); -enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember-environment', 'ember-metal/run_loop', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/events', 'ember-metal/observer', 'ember-metal/path_cache'], function (exports, _emberUtils, _emberConsole, _emberEnvironment, _emberMetalRun_loop, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalEvents, _emberMetalObserver, _emberMetalPath_cache) { - 'use strict'; - - exports.bind = bind; - - /** - @module ember - @submodule ember-metal - */ - - // .......................................................... - // BINDING - // - - function Binding(toPath, fromPath) { - // Configuration - this._from = fromPath; - this._to = toPath; - this._oneWay = undefined; - - // State - this._direction = undefined; - this._readyToSync = undefined; - this._fromObj = undefined; - this._fromPath = undefined; - this._toObj = undefined; - } - - /** - @class Binding - @namespace Ember - @deprecated See http://emberjs.com/deprecations/v2.x#toc_ember-binding - @public - */ - - Binding.prototype = { - /** - This copies the Binding so it can be connected to another object. - @method copy - @return {Ember.Binding} `this` - @public - */ - copy: function () { - var copy = new Binding(this._to, this._from); - if (this._oneWay) { - copy._oneWay = true; - } - return copy; - }, - - // .......................................................... - // CONFIG - // - - /** - This will set `from` property path to the specified value. It will not - attempt to resolve this property path to an actual object until you - connect the binding. - The binding will search for the property path starting at the root object - you pass when you `connect()` the binding. It follows the same rules as - `get()` - see that method for more information. - @method from - @param {String} path The property path to connect to. - @return {Ember.Binding} `this` - @public - */ - from: function (path) { - this._from = path; - return this; - }, - - /** - This will set the `to` property path to the specified value. It will not - attempt to resolve this property path to an actual object until you - connect the binding. - The binding will search for the property path starting at the root object - you pass when you `connect()` the binding. It follows the same rules as - `get()` - see that method for more information. - @method to - @param {String|Tuple} path A property path or tuple. - @return {Ember.Binding} `this` - @public - */ - to: function (path) { - this._to = path; - return this; - }, - - /** - Configures the binding as one way. A one-way binding will relay changes - on the `from` side to the `to` side, but not the other way around. This - means that if you change the `to` side directly, the `from` side may have - a different value. - @method oneWay - @return {Ember.Binding} `this` - @public - */ - oneWay: function () { - this._oneWay = true; - return this; - }, - - /** - @method toString - @return {String} string representation of binding - @public - */ - toString: function () { - var oneWay = this._oneWay ? '[oneWay]' : ''; - return 'Ember.Binding<' + _emberUtils.guidFor(this) + '>(' + this._from + ' -> ' + this._to + ')' + oneWay; - }, - - // .......................................................... - // CONNECT AND SYNC - // - - /** - Attempts to connect this binding instance so that it can receive and relay - changes. This method will raise an exception if you have not set the - from/to properties yet. - @method connect - @param {Object} obj The root object for this binding. - @return {Ember.Binding} `this` - @public - */ - connect: function (obj) { - _emberMetalDebug.assert('Must pass a valid object to Ember.Binding.connect()', !!obj); - - var fromObj = undefined, - fromPath = undefined, - possibleGlobal = undefined; - - // If the binding's "from" path could be interpreted as a global, verify - // whether the path refers to a global or not by consulting `Ember.lookup`. - if (_emberMetalPath_cache.isGlobalPath(this._from)) { - var _name = _emberMetalPath_cache.getFirstKey(this._from); - possibleGlobal = _emberEnvironment.context.lookup[_name]; - - if (possibleGlobal) { - fromObj = possibleGlobal; - fromPath = _emberMetalPath_cache.getTailPath(this._from); - } - } - - if (fromObj === undefined) { - fromObj = obj; - fromPath = this._from; - } - - _emberMetalProperty_set.trySet(obj, this._to, _emberMetalProperty_get.get(fromObj, fromPath)); - - // Add an observer on the object to be notified when the binding should be updated. - _emberMetalObserver.addObserver(fromObj, fromPath, this, 'fromDidChange'); - - // If the binding is a two-way binding, also set up an observer on the target. - if (!this._oneWay) { - _emberMetalObserver.addObserver(obj, this._to, this, 'toDidChange'); - } - - _emberMetalEvents.addListener(obj, 'willDestroy', this, 'disconnect'); - - fireDeprecations(obj, this._to, this._from, possibleGlobal, this._oneWay, !possibleGlobal && !this._oneWay); - - this._readyToSync = true; - this._fromObj = fromObj; - this._fromPath = fromPath; - this._toObj = obj; - - return this; - }, - - /** - Disconnects the binding instance. Changes will no longer be relayed. You - will not usually need to call this method. - @method disconnect - @return {Ember.Binding} `this` - @public - */ - disconnect: function () { - _emberMetalDebug.assert('Must pass a valid object to Ember.Binding.disconnect()', !!this._toObj); - - // Remove an observer on the object so we're no longer notified of - // changes that should update bindings. - _emberMetalObserver.removeObserver(this._fromObj, this._fromPath, this, 'fromDidChange'); - - // If the binding is two-way, remove the observer from the target as well. - if (!this._oneWay) { - _emberMetalObserver.removeObserver(this._toObj, this._to, this, 'toDidChange'); - } - - this._readyToSync = false; // Disable scheduled syncs... - return this; - }, - - // .......................................................... - // PRIVATE - // - - /* Called when the from side changes. */ - fromDidChange: function (target) { - this._scheduleSync('fwd'); - }, - - /* Called when the to side changes. */ - toDidChange: function (target) { - this._scheduleSync('back'); - }, - - _scheduleSync: function (dir) { - var existingDir = this._direction; - - // If we haven't scheduled the binding yet, schedule it. - if (existingDir === undefined) { - _emberMetalRun_loop.default.schedule('sync', this, '_sync'); - this._direction = dir; - } - - // If both a 'back' and 'fwd' sync have been scheduled on the same object, - // default to a 'fwd' sync so that it remains deterministic. - if (existingDir === 'back' && dir === 'fwd') { - this._direction = 'fwd'; - } - }, - - _sync: function () { - var log = _emberEnvironment.ENV.LOG_BINDINGS; - - var toObj = this._toObj; - - // Don't synchronize destroyed objects or disconnected bindings. - if (toObj.isDestroyed || !this._readyToSync) { - return; - } - - // Get the direction of the binding for the object we are - // synchronizing from. - var direction = this._direction; - - var fromObj = this._fromObj; - var fromPath = this._fromPath; - - this._direction = undefined; - - // If we're synchronizing from the remote object... - if (direction === 'fwd') { - var fromValue = _emberMetalProperty_get.get(fromObj, fromPath); - if (log) { - _emberConsole.default.log(' ', this.toString(), '->', fromValue, fromObj); - } - if (this._oneWay) { - _emberMetalProperty_set.trySet(toObj, this._to, fromValue); - } else { - _emberMetalObserver._suspendObserver(toObj, this._to, this, 'toDidChange', function () { - _emberMetalProperty_set.trySet(toObj, this._to, fromValue); - }); - } - // If we're synchronizing *to* the remote object. - } else if (direction === 'back') { - var toValue = _emberMetalProperty_get.get(toObj, this._to); - if (log) { - _emberConsole.default.log(' ', this.toString(), '<-', toValue, toObj); - } - _emberMetalObserver._suspendObserver(fromObj, fromPath, this, 'fromDidChange', function () { - _emberMetalProperty_set.trySet(fromObj, fromPath, toValue); - }); - } - } - - }; - - function fireDeprecations(obj, toPath, fromPath, deprecateGlobal, deprecateOneWay, deprecateAlias) { - var deprecateGlobalMessage = '`Ember.Binding` is deprecated. Since you' + ' are binding to a global consider using a service instead.'; - var deprecateOneWayMessage = '`Ember.Binding` is deprecated. Since you' + ' are using a `oneWay` binding consider using a `readOnly` computed' + ' property instead.'; - var deprecateAliasMessage = '`Ember.Binding` is deprecated. Consider' + ' using an `alias` computed property instead.'; - - var objectInfo = 'The `' + toPath + '` property of `' + obj + '` is an `Ember.Binding` connected to `' + fromPath + '`, but '; - _emberMetalDebug.deprecate(objectInfo + deprecateGlobalMessage, !deprecateGlobal, { - id: 'ember-metal.binding', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x#toc_ember-binding' - }); - _emberMetalDebug.deprecate(objectInfo + deprecateOneWayMessage, !deprecateOneWay, { - id: 'ember-metal.binding', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x#toc_ember-binding' - }); - _emberMetalDebug.deprecate(objectInfo + deprecateAliasMessage, !deprecateAlias, { - id: 'ember-metal.binding', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x#toc_ember-binding' - }); - } - - function mixinProperties(to, from) { - for (var key in from) { - if (from.hasOwnProperty(key)) { - to[key] = from[key]; - } - } - } - - mixinProperties(Binding, { - - /* - See `Ember.Binding.from`. - @method from - @static - */ - from: function (from) { - var C = this; - return new C(undefined, from); - }, - - /* - See `Ember.Binding.to`. - @method to - @static - */ - to: function (to) { - var C = this; - return new C(to, undefined); - } - }); - /** - An `Ember.Binding` connects the properties of two objects so that whenever - the value of one property changes, the other property will be changed also. - - ## Automatic Creation of Bindings with `/^*Binding/`-named Properties. - - You do not usually create Binding objects directly but instead describe - bindings in your class or object definition using automatic binding - detection. - - Properties ending in a `Binding` suffix will be converted to `Ember.Binding` - instances. The value of this property should be a string representing a path - to another object or a custom binding instance created using Binding helpers - (see "One Way Bindings"): - - ``` - valueBinding: "MyApp.someController.title" - ``` - - This will create a binding from `MyApp.someController.title` to the `value` - property of your object instance automatically. Now the two values will be - kept in sync. - - ## One Way Bindings - - One especially useful binding customization you can use is the `oneWay()` - helper. This helper tells Ember that you are only interested in - receiving changes on the object you are binding from. For example, if you - are binding to a preference and you want to be notified if the preference - has changed, but your object will not be changing the preference itself, you - could do: - - ``` - bigTitlesBinding: Ember.Binding.oneWay("MyApp.preferencesController.bigTitles") - ``` - - This way if the value of `MyApp.preferencesController.bigTitles` changes the - `bigTitles` property of your object will change also. However, if you - change the value of your `bigTitles` property, it will not update the - `preferencesController`. - - One way bindings are almost twice as fast to setup and twice as fast to - execute because the binding only has to worry about changes to one side. - - You should consider using one way bindings anytime you have an object that - may be created frequently and you do not intend to change a property; only - to monitor it for changes (such as in the example above). - - ## Adding Bindings Manually - - All of the examples above show you how to configure a custom binding, but the - result of these customizations will be a binding template, not a fully active - Binding instance. The binding will actually become active only when you - instantiate the object the binding belongs to. It is useful, however, to - understand what actually happens when the binding is activated. - - For a binding to function it must have at least a `from` property and a `to` - property. The `from` property path points to the object/key that you want to - bind from while the `to` path points to the object/key you want to bind to. - - When you define a custom binding, you are usually describing the property - you want to bind from (such as `MyApp.someController.value` in the examples - above). When your object is created, it will automatically assign the value - you want to bind `to` based on the name of your binding key. In the - examples above, during init, Ember objects will effectively call - something like this on your binding: - - ```javascript - binding = Ember.Binding.from("valueBinding").to("value"); - ``` - - This creates a new binding instance based on the template you provide, and - sets the to path to the `value` property of the new object. Now that the - binding is fully configured with a `from` and a `to`, it simply needs to be - connected to become active. This is done through the `connect()` method: - - ```javascript - binding.connect(this); - ``` - - Note that when you connect a binding you pass the object you want it to be - connected to. This object will be used as the root for both the from and - to side of the binding when inspecting relative paths. This allows the - binding to be automatically inherited by subclassed objects as well. - - This also allows you to bind between objects using the paths you declare in - `from` and `to`: - - ```javascript - // Example 1 - binding = Ember.Binding.from("App.someObject.value").to("value"); - binding.connect(this); - - // Example 2 - binding = Ember.Binding.from("parentView.value").to("App.someObject.value"); - binding.connect(this); - ``` - - Now that the binding is connected, it will observe both the from and to side - and relay changes. - - If you ever needed to do so (you almost never will, but it is useful to - understand this anyway), you could manually create an active binding by - using the `Ember.bind()` helper method. (This is the same method used by - to setup your bindings on objects): - - ```javascript - Ember.bind(MyApp.anotherObject, "value", "MyApp.someController.value"); - ``` - - Both of these code fragments have the same effect as doing the most friendly - form of binding creation like so: - - ```javascript - MyApp.anotherObject = Ember.Object.create({ - valueBinding: "MyApp.someController.value", - - // OTHER CODE FOR THIS OBJECT... - }); - ``` - - Ember's built in binding creation method makes it easy to automatically - create bindings for you. You should always use the highest-level APIs - available, even if you understand how it works underneath. - - @class Binding - @namespace Ember - @since Ember 0.9 - @public - */ - // Ember.Binding = Binding; ES6TODO: where to put this? - - /** - Global helper method to create a new binding. Just pass the root object - along with a `to` and `from` path to create and connect the binding. - - @method bind - @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 bind(obj, to, from) { - return new Binding(to, from).connect(obj); - } - - exports.Binding = Binding; -}); -enifed('ember-metal/cache', ['exports', 'ember-utils', 'ember-metal/meta'], function (exports, _emberUtils, _emberMetalMeta) { - 'use strict'; - - var Cache = (function () { - function Cache(limit, func, key, store) { - babelHelpers.classCallCheck(this, Cache); - - this.size = 0; - this.misses = 0; - this.hits = 0; - this.limit = limit; - this.func = func; - this.key = key; - this.store = store || new DefaultStore(); - } - - Cache.prototype.get = function get(obj) { - var key = this.key === undefined ? obj : this.key(obj); - var value = this.store.get(key); - if (value === undefined) { - this.misses++; - value = this._set(key, this.func(obj)); - } else if (value === _emberMetalMeta.UNDEFINED) { - this.hits++; - value = undefined; - } else { - this.hits++; - // nothing to translate - } - - return value; - }; - - Cache.prototype.set = function set(obj, value) { - var key = this.key === undefined ? obj : this.key(obj); - return this._set(key, value); - }; - - Cache.prototype._set = function _set(key, value) { - if (this.limit > this.size) { - this.size++; - if (value === undefined) { - this.store.set(key, _emberMetalMeta.UNDEFINED); - } else { - this.store.set(key, value); - } - } - - return value; - }; - - Cache.prototype.purge = function purge() { - this.store.clear(); - this.size = 0; - this.hits = 0; - this.misses = 0; - }; - - return Cache; - })(); - - exports.default = Cache; - - var DefaultStore = (function () { - function DefaultStore() { - babelHelpers.classCallCheck(this, DefaultStore); - - this.data = new _emberUtils.EmptyObject(); - } - - DefaultStore.prototype.get = function get(key) { - return this.data[key]; - }; - - DefaultStore.prototype.set = function set(key, value) { - this.data[key] = value; - }; - - DefaultStore.prototype.clear = function clear() { - this.data = new _emberUtils.EmptyObject(); - }; - - return DefaultStore; - })(); -}); -enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_get', 'ember-metal/meta', 'ember-metal/watch_key', 'ember-metal/watch_path'], function (exports, _emberUtils, _emberMetalProperty_get, _emberMetalMeta, _emberMetalWatch_key, _emberMetalWatch_path) { - 'use strict'; - - exports.finishChains = finishChains; - - var FIRST_KEY = /^([^\.]+)/; - - function firstKey(path) { - return path.match(FIRST_KEY)[0]; - } - - function isObject(obj) { - return typeof obj === 'object' && obj; - } - - function isVolatile(obj) { - return !(isObject(obj) && obj.isDescriptor && obj._volatile === false); - } - - function ChainWatchers() { - // chain nodes that reference a key in this obj by key - // we only create ChainWatchers when we are going to add them - // so create this upfront - this.chains = new _emberUtils.EmptyObject(); - } - - 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; i < nodes.length; 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; i < nodes.length; 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 object and path that - // will be/are invalidated by this key change, depending on - // 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; i < nodes.length; 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; i < affected.length; i += 2) { - var obj = affected[i]; - var path = affected[i + 1]; - callback(obj, path); - } - } - }; - - function makeChainWatcher() { - return new ChainWatchers(); - } - - function addChainWatcher(obj, keyName, node) { - var m = _emberMetalMeta.meta(obj); - m.writableChainWatchers(makeChainWatcher).add(keyName, node); - _emberMetalWatch_key.watchKey(obj, keyName, m); - } - - function removeChainWatcher(obj, keyName, node, _meta) { - if (!isObject(obj)) { - return; - } - - var meta = _meta || _emberMetalMeta.peekMeta(obj); - - if (!meta || !meta.readableChainWatchers()) { - return; - } - - // make meta writable - meta = _emberMetalMeta.meta(obj); - - meta.readableChainWatchers().remove(keyName, node); - - _emberMetalWatch_key.unwatchKey(obj, keyName, meta); - } - - // 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 - // pass null for parent and key and object for value. - function ChainNode(parent, key, value) { - this._parent = parent; - this._key = key; - - // _watching is true when calling get(this._parent, this._key) will - // return the value of this node. - // - // It is false for the root of a chain (because we have no parent) - // and for global paths (because the parent node is the object with - // the observer on it) - this._watching = value === undefined; - - this._chains = undefined; - this._object = undefined; - this.count = 0; - - this._value = value; - this._paths = {}; - if (this._watching) { - var obj = parent.value(); - - if (!isObject(obj)) { - return; - } - - this._object = obj; - - addChainWatcher(this._object, this._key, this); - } - } - - function lazyGet(obj, key) { - if (!isObject(obj)) { - return; - } - - var meta = _emberMetalMeta.peekMeta(obj); - - // check if object meant only to be a prototype - if (meta && meta.proto === obj) { - return; - } - - // Use `get` if the return value is an EachProxy or an uncacheable value. - if (isVolatile(obj[key])) { - return _emberMetalProperty_get.get(obj, key); - // Otherwise attempt to get the cached value of the computed property - } else { - var cache = meta.readableCache(); - if (cache && key in cache) { - return cache[key]; - } - } - } - - ChainNode.prototype = { - value: function () { - if (this._value === undefined && this._watching) { - var obj = this._parent.value(); - this._value = lazyGet(obj, this._key); - } - return this._value; - }, - - destroy: function () { - if (this._watching) { - var obj = this._object; - if (obj) { - removeChainWatcher(obj, this._key, this); - } - this._watching = false; // so future calls do nothing - } - }, - - // copies a top level object only - copy: function (obj) { - var ret = new ChainNode(null, null, obj); - var paths = this._paths; - var path = undefined; - - for (path in paths) { - // this check will also catch non-number vals. - if (paths[path] <= 0) { - continue; - } - ret.add(path); - } - return ret; - }, - - // called on the root node of a chain to setup watchers on the specified - // path. - add: function (path) { - var paths = this._paths; - paths[path] = (paths[path] || 0) + 1; - - var key = firstKey(path); - var tail = path.slice(key.length + 1); - - this.chain(key, tail); - }, - - // called on the root node of a chain to teardown watcher on the specified - // path - remove: function (path) { - var paths = this._paths; - if (paths[path] > 0) { - paths[path]--; - } - - var key = firstKey(path); - var tail = path.slice(key.length + 1); - - this.unchain(key, tail); - }, - - chain: function (key, path) { - var chains = this._chains; - var node = undefined; - if (chains === undefined) { - chains = this._chains = new _emberUtils.EmptyObject(); - } else { - node = chains[key]; - } - - if (node === undefined) { - node = chains[key] = new ChainNode(this, key, undefined); - } - - node.count++; // count chains... - - // chain rest of path if there is one - if (path) { - key = firstKey(path); - path = path.slice(key.length + 1); - node.chain(key, path); - } - }, - - unchain: function (key, path) { - var chains = this._chains; - var node = chains[key]; - - // unchain rest of path first... - if (path && path.length > 1) { - var nextKey = firstKey(path); - var nextPath = path.slice(nextKey.length + 1); - node.unchain(nextKey, nextPath); - } - - // delete node if needed. - node.count--; - if (node.count <= 0) { - chains[node._key] = undefined; - node.destroy(); - } - }, - - notify: function (revalidate, affected) { - if (revalidate && this._watching) { - var parentValue = this._parent.value(); - - if (parentValue !== this._object) { - if (this._object) { - removeChainWatcher(this._object, this._key, this); - } - - if (isObject(parentValue)) { - this._object = parentValue; - addChainWatcher(parentValue, this._key, this); - } else { - this._object = undefined; - } - } - this._value = undefined; - } - - // then notify chains... - var chains = this._chains; - var node = undefined; - if (chains) { - for (var key in chains) { - node = chains[key]; - if (node !== undefined) { - node.notify(revalidate, affected); - } - } - } - - if (affected && this._parent) { - this._parent.populateAffected(this._key, 1, affected); - } - }, - - populateAffected: function (path, depth, affected) { - if (this._key) { - path = this._key + '.' + path; - } - - if (this._parent) { - this._parent.populateAffected(path, depth + 1, affected); - } else { - if (depth > 1) { - affected.push(this.value(), path); - } - } - } - }; - - function finishChains(obj) { - // We only create meta if we really have to - var m = _emberMetalMeta.peekMeta(obj); - if (m) { - m = _emberMetalMeta.meta(obj); - - // finish any current chains node watchers that reference obj - var chainWatchers = m.readableChainWatchers(); - if (chainWatchers) { - chainWatchers.revalidateAll(); - } - // ensure that if we have inherited any chains they have been - // copied onto our own meta. - if (m.readableChains()) { - m.writableChains(_emberMetalWatch_path.makeChainNode); - } - } - } - - exports.removeChainWatcher = removeChainWatcher; - exports.ChainNode = ChainNode; -}); -enifed('ember-metal/computed', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/property_set', 'ember-metal/meta', 'ember-metal/expand_properties', 'ember-metal/error', 'ember-metal/properties', 'ember-metal/property_events', 'ember-metal/dependent_keys'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalProperty_set, _emberMetalMeta, _emberMetalExpand_properties, _emberMetalError, _emberMetalProperties, _emberMetalProperty_events, _emberMetalDependent_keys) { - 'use strict'; - - exports.default = computed; - - /** - @module ember - @submodule ember-metal - */ - - var DEEP_EACH_REGEX = /\.@each\.[^.]+\./; - - /** - A computed property transforms an object literal with object's accessor function(s) into a property. - - By default the function backing the computed property will only be called - once and the result will be cached. You can specify various properties - that your computed property depends on. This will force the cached - result to be recomputed if the dependencies are modified. - - In the following example we declare a computed property - `fullName` - by calling - `.Ember.computed()` with property dependencies (`firstName` and `lastName`) as leading arguments and getter accessor function. The `fullName` getter function - will be called once (regardless of how many times it is accessed) as long - as its dependencies have not changed. Once `firstName` or `lastName` are updated - any future calls (or anything bound) to `fullName` will incorporate the new - values. - - ```javascript - let Person = Ember.Object.extend({ - // these will be supplied by `create` - firstName: null, - lastName: null, - - fullName: Ember.computed('firstName', 'lastName', function() { - let firstName = this.get('firstName'), - lastName = this.get('lastName'); - - return firstName + ' ' + lastName; - }) - }); - - let tom = Person.create({ - firstName: 'Tom', - lastName: 'Dale' - }); - - tom.get('fullName') // 'Tom Dale' - ``` - - You can also define what Ember should do when setting a computed property by providing additional function (`set`) in hash argument. - If you try to set a computed property, it will try to invoke setter accessor function with the key and - value you want to set it to as arguments. - - ```javascript - let Person = Ember.Object.extend({ - // these will be supplied by `create` - firstName: null, - lastName: null, - - fullName: Ember.computed('firstName', 'lastName', { - get(key) { - let firstName = this.get('firstName'), - lastName = this.get('lastName'); - - return firstName + ' ' + lastName; - }, - set(key, value) { - let [firstName, lastName] = value.split(' '); - - this.set('firstName', firstName); - this.set('lastName', lastName); - - return value; - } - }) - }); - - let person = Person.create(); - - person.set('fullName', 'Peter Wagenet'); - person.get('firstName'); // 'Peter' - person.get('lastName'); // 'Wagenet' - ``` - - You can overwrite computed property with normal property (no longer computed), that won't change if dependencies change, if you set computed property and it won't have setter accessor function defined. - - You can also mark computed property as `.readOnly()` and block all attempts to set it. - - ```javascript - let Person = Ember.Object.extend({ - // these will be supplied by `create` - firstName: null, - lastName: null, - - fullName: Ember.computed('firstName', 'lastName', { - get(key) { - let firstName = this.get('firstName'); - let lastName = this.get('lastName'); - - return firstName + ' ' + lastName; - } - }).readOnly() - }); - - let person = Person.create(); - person.set('fullName', 'Peter Wagenet'); // Uncaught Error: Cannot set read-only property "fullName" on object: <(...):emberXXX> - ``` - - Additional resources: - - [New CP syntax RFC](https://github.com/emberjs/rfcs/blob/master/text/0011-improved-cp-syntax.md) - - [New computed syntax explained in "Ember 1.12 released" ](http://emberjs.com/blog/2015/05/13/ember-1-12-released.html#toc_new-computed-syntax) - - @class ComputedProperty - @namespace Ember - @public - */ - function ComputedProperty(config, opts) { - this.isDescriptor = true; - if (typeof config === 'function') { - this._getter = config; - } else { - _emberMetalDebug.assert('Ember.computed expects a function or an object as last argument.', typeof config === 'object' && !Array.isArray(config)); - _emberMetalDebug.assert('Config object passed to an Ember.computed can only contain `get` or `set` keys.', (function () { - var keys = Object.keys(config); - for (var i = 0; i < keys.length; i++) { - if (keys[i] !== 'get' && keys[i] !== 'set') { - return false; - } - } - return true; - })()); - this._getter = config.get; - this._setter = config.set; - } - _emberMetalDebug.assert('Computed properties must receive a getter or a setter, you passed none.', !!this._getter || !!this._setter); - this._dependentKeys = undefined; - this._suspended = undefined; - this._meta = undefined; - this._volatile = false; - this._dependentKeys = opts && opts.dependentKeys; - this._readOnly = false; - } - - ComputedProperty.prototype = new _emberMetalProperties.Descriptor(); - ComputedProperty.prototype.constructor = ComputedProperty; - - var ComputedPropertyPrototype = ComputedProperty.prototype; - - /** - Call on a computed property to set it into non-cached mode. When in this - mode the computed property will not automatically cache the return value. - - It also does not automatically fire any change events. You must manually notify - any changes if you want to observe this property. - - Dependency keys have no effect on volatile properties as they are for cache - invalidation and notification when cached value is invalidated. - - ```javascript - let outsideService = Ember.Object.extend({ - value: Ember.computed(function() { - return OutsideService.getValue(); - }).volatile() - }).create(); - ``` - - @method volatile - @return {Ember.ComputedProperty} this - @chainable - @public - */ - ComputedPropertyPrototype.volatile = function () { - this._volatile = true; - return this; - }; - - /** - Call on a computed property to set it into read-only mode. When in this - mode the computed property will throw an error when set. - - ```javascript - let Person = Ember.Object.extend({ - guid: Ember.computed(function() { - return 'guid-guid-guid'; - }).readOnly() - }); - - let person = Person.create(); - - person.set('guid', 'new-guid'); // will throw an exception - ``` - - @method readOnly - @return {Ember.ComputedProperty} this - @chainable - @public - */ - ComputedPropertyPrototype.readOnly = function () { - this._readOnly = true; - _emberMetalDebug.assert('Computed properties that define a setter using the new syntax cannot be read-only', !(this._readOnly && this._setter && this._setter !== this._getter)); - return this; - }; - - /** - Sets the dependent keys on this computed property. Pass any number of - arguments containing key paths that this computed property depends on. - - ```javascript - let President = Ember.Object.extend({ - fullName: Ember.computed(function() { - return this.get('firstName') + ' ' + this.get('lastName'); - - // Tell Ember that this computed property depends on firstName - // and lastName - }).property('firstName', 'lastName') - }); - - let president = President.create({ - firstName: 'Barack', - lastName: 'Obama' - }); - - president.get('fullName'); // 'Barack Obama' - ``` - - @method property - @param {String} path* zero or more property paths - @return {Ember.ComputedProperty} this - @chainable - @public - */ - ComputedPropertyPrototype.property = function () { - var args = []; - - function addArg(property) { - _emberMetalDebug.warn('Dependent keys containing @each only work one level deep. ' + ('You used the key "' + property + '" which is invalid. ') + 'Please create an intermediary computed property.', DEEP_EACH_REGEX.test(property) === false, { id: 'ember-metal.computed-deep-each' }); - args.push(property); - } - - for (var i = 0; i < arguments.length; i++) { - _emberMetalExpand_properties.default(arguments[i], addArg); - } - - this._dependentKeys = args; - return this; - }; - - /** - In some cases, you may want to annotate computed properties with additional - metadata about how they function or what values they operate on. For example, - computed property functions may close over variables that are then no longer - available for introspection. - - You can pass a hash of these values to a computed property like this: - - ``` - person: Ember.computed(function() { - let personId = this.get('personId'); - return App.Person.create({ id: personId }); - }).meta({ type: App.Person }) - ``` - - The hash that you pass to the `meta()` function will be saved on the - computed property descriptor under the `_meta` key. Ember runtime - exposes a public API for retrieving these values from classes, - via the `metaForProperty()` function. - - @method meta - @param {Object} meta - @chainable - @public - */ - ComputedPropertyPrototype.meta = function (meta) { - if (arguments.length === 0) { - return this._meta || {}; - } else { - this._meta = meta; - return this; - } - }; - - // invalidate cache when CP key changes - ComputedPropertyPrototype.didChange = function (obj, keyName) { - // _suspended is set via a CP.set to ensure we don't clear - // the cached value set by the setter - if (this._volatile || this._suspended === obj) { - return; - } - - // don't create objects just to invalidate - var meta = _emberMetalMeta.peekMeta(obj); - if (!meta || meta.source !== obj) { - return; - } - - var cache = meta.readableCache(); - if (cache && cache[keyName] !== undefined) { - cache[keyName] = undefined; - _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); - } - }; - - ComputedPropertyPrototype.get = function (obj, keyName) { - if (this._volatile) { - return this._getter.call(obj, keyName); - } - - var meta = _emberMetalMeta.meta(obj); - var cache = meta.writableCache(); - - var result = cache[keyName]; - if (result === _emberMetalMeta.UNDEFINED) { - return undefined; - } else if (result !== undefined) { - return result; - } - - var ret = this._getter.call(obj, keyName); - if (ret === undefined) { - cache[keyName] = _emberMetalMeta.UNDEFINED; - } else { - cache[keyName] = ret; - } - - var chainWatchers = meta.readableChainWatchers(); - if (chainWatchers) { - chainWatchers.revalidate(keyName); - } - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); - - return ret; - }; - - ComputedPropertyPrototype.set = function computedPropertySetEntry(obj, keyName, value) { - if (this._readOnly) { - this._throwReadOnlyError(obj, keyName); - } - - if (!this._setter) { - return this.clobberSet(obj, keyName, value); - } - - if (this._volatile) { - return this.volatileSet(obj, keyName, value); - } - - return this.setWithSuspend(obj, keyName, value); - }; - - ComputedPropertyPrototype._throwReadOnlyError = function computedPropertyThrowReadOnlyError(obj, keyName) { - throw new _emberMetalError.default('Cannot set read-only property "' + keyName + '" on object: ' + _emberUtils.inspect(obj)); - }; - - ComputedPropertyPrototype.clobberSet = function computedPropertyClobberSet(obj, keyName, value) { - var cachedValue = cacheFor(obj, keyName); - _emberMetalProperties.defineProperty(obj, keyName, null, cachedValue); - _emberMetalProperty_set.set(obj, keyName, value); - return value; - }; - - ComputedPropertyPrototype.volatileSet = function computedPropertyVolatileSet(obj, keyName, value) { - return this._setter.call(obj, keyName, value); - }; - - ComputedPropertyPrototype.setWithSuspend = function computedPropertySetWithSuspend(obj, keyName, value) { - var oldSuspended = this._suspended; - this._suspended = obj; - try { - return this._set(obj, keyName, value); - } finally { - this._suspended = oldSuspended; - } - }; - - ComputedPropertyPrototype._set = function computedPropertySet(obj, keyName, value) { - // cache requires own meta - var meta = _emberMetalMeta.meta(obj); - // either there is a writable cache or we need one to update - var cache = meta.writableCache(); - var hadCachedValue = false; - var cachedValue = undefined; - if (cache[keyName] !== undefined) { - if (cache[keyName] !== _emberMetalMeta.UNDEFINED) { - cachedValue = cache[keyName]; - } - hadCachedValue = true; - } - - var ret = this._setter.call(obj, keyName, value, cachedValue); - - // allows setter to return the same value that is cached already - if (hadCachedValue && cachedValue === ret) { - return ret; - } - - _emberMetalProperty_events.propertyWillChange(obj, keyName); - - if (hadCachedValue) { - cache[keyName] = undefined; - } - - if (!hadCachedValue) { - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); - } - - if (ret === undefined) { - cache[keyName] = _emberMetalMeta.UNDEFINED; - } else { - cache[keyName] = ret; - } - - _emberMetalProperty_events.propertyDidChange(obj, keyName); - - return ret; - }; - - /* called before property is overridden */ - ComputedPropertyPrototype.teardown = function (obj, keyName) { - if (this._volatile) { - return; - } - var meta = _emberMetalMeta.meta(obj); - var cache = meta.readableCache(); - if (cache && cache[keyName] !== undefined) { - _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); - cache[keyName] = undefined; - } - }; - - /** - This helper returns a new property descriptor that wraps the passed - computed property function. You can use this helper to define properties - with mixins or via `Ember.defineProperty()`. - - If you pass a function as an argument, it will be used as a getter. A computed - property defined in this way might look like this: - - ```js - let Person = Ember.Object.extend({ - init() { - this._super(...arguments); - - this.firstName = 'Betty'; - this.lastName = 'Jones'; - }, - - fullName: Ember.computed('firstName', 'lastName', function() { - return `${this.get('firstName')} ${this.get('lastName')}`; - }) - }); - - let client = Person.create(); - - client.get('fullName'); // 'Betty Jones' - - client.set('lastName', 'Fuller'); - client.get('fullName'); // 'Betty Fuller' - ``` - - You can pass a hash with two functions, `get` and `set`, as an - argument to provide both a getter and setter: - - ```js - let Person = Ember.Object.extend({ - init() { - this._super(...arguments); - - this.firstName = 'Betty'; - this.lastName = 'Jones'; - }, - - fullName: Ember.computed('firstName', 'lastName', { - get(key) { - return `${this.get('firstName')} ${this.get('lastName')}`; - }, - set(key, value) { - let [firstName, lastName] = value.split(/\s+/); - this.setProperties({ firstName, lastName }); - return value; - } - }); - }) - - let client = Person.create(); - client.get('firstName'); // 'Betty' - - client.set('fullName', 'Carroll Fuller'); - client.get('firstName'); // 'Carroll' - ``` - - The `set` function should accept two parameters, `key` and `value`. The value - returned from `set` will be the new value of the property. - - _Note: This is the preferred way to define computed properties when writing third-party - libraries that depend on or use Ember, since there is no guarantee that the user - will have [prototype Extensions](http://emberjs.com/guides/configuring-ember/disabling-prototype-extensions/) enabled._ - - The alternative syntax, with prototype extensions, might look like: - - ```js - fullName: function() { - return this.get('firstName') + ' ' + this.get('lastName'); - }.property('firstName', 'lastName') - ``` - - @class computed - @namespace Ember - @constructor - @static - @param {String} [dependentKeys*] Optional dependent keys that trigger this computed property. - @param {Function} func The computed property function. - @return {Ember.ComputedProperty} property descriptor instance - @public - */ - - function computed(func) { - var args = undefined; - - if (arguments.length > 1) { - args = [].slice.call(arguments); - func = args.pop(); - } - - var cp = new ComputedProperty(func); - - if (args) { - cp.property.apply(cp, args); - } - - return cp; - } - - /** - Returns the cached value for a property, if one exists. - This can be useful for peeking at the value of a computed - property that is generated lazily, without accidentally causing - it to be created. - - @method cacheFor - @for Ember - @param {Object} obj the object whose property you want to check - @param {String} key the name of the property whose cached value you want - to return - @return {Object} the cached value - @public - */ - function cacheFor(obj, key) { - var meta = _emberMetalMeta.peekMeta(obj); - var cache = meta && meta.source === obj && meta.readableCache(); - var ret = cache && cache[key]; - - if (ret === _emberMetalMeta.UNDEFINED) { - return undefined; - } - return ret; - } - - cacheFor.set = function (cache, key, value) { - if (value === undefined) { - cache[key] = _emberMetalMeta.UNDEFINED; - } else { - cache[key] = value; - } - }; - - cacheFor.get = function (cache, key) { - var ret = cache[key]; - if (ret === _emberMetalMeta.UNDEFINED) { - return undefined; - } - return ret; - }; - - cacheFor.remove = function (cache, key) { - cache[key] = undefined; - }; - - exports.ComputedProperty = ComputedProperty; - exports.computed = computed; - exports.cacheFor = cacheFor; -}); -enifed('ember-metal/core', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { - 'use strict'; - - /** - @module ember - @submodule ember-metal - */ - - /** - This namespace contains all Ember methods and functions. Future versions of - Ember may overwrite this namespace and therefore, you should avoid adding any - new properties. - - At the heart of Ember is Ember-Runtime, a set of core functions that provide - cross-platform compatibility and object property observing. Ember-Runtime is - small and performance-focused so you can use it alongside other - cross-platform libraries such as jQuery. For more details, see - [Ember-Runtime](http://emberjs.com/api/modules/ember-runtime.html). - - @class Ember - @static - @public - */ - var Ember = typeof _emberEnvironment.context.imports.Ember === 'object' && _emberEnvironment.context.imports.Ember || {}; - - // Make sure these are set whether Ember was already defined or not - Ember.isNamespace = true; - Ember.toString = function () { - return 'Ember'; - }; - - // .......................................................... - // BOOTSTRAP - // - - exports.default = Ember; -}); -enifed("ember-metal/debug", ["exports"], function (exports) { - "use strict"; - - exports.getDebugFunction = getDebugFunction; - exports.setDebugFunction = setDebugFunction; - exports.assert = assert; - exports.info = info; - exports.warn = warn; - exports.debug = debug; - exports.deprecate = deprecate; - exports.deprecateFunc = deprecateFunc; - exports.runInDebug = runInDebug; - exports.debugSeal = debugSeal; - exports.debugFreeze = debugFreeze; - var debugFunctions = { - assert: function () {}, - info: function () {}, - warn: function () {}, - debug: function () {}, - deprecate: function () {}, - deprecateFunc: function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return args[args.length - 1]; - }, - runInDebug: function () {}, - debugSeal: function () {}, - debugFreeze: function () {} - }; - - exports.debugFunctions = debugFunctions; - - function getDebugFunction(name) { - return debugFunctions[name]; - } - - function setDebugFunction(name, fn) { - debugFunctions[name] = fn; - } - - function assert() { - return debugFunctions.assert.apply(undefined, arguments); - } - - function info() { - return debugFunctions.info.apply(undefined, arguments); - } - - function warn() { - return debugFunctions.warn.apply(undefined, arguments); - } - - function debug() { - return debugFunctions.debug.apply(undefined, arguments); - } - - function deprecate() { - return debugFunctions.deprecate.apply(undefined, arguments); - } - - function deprecateFunc() { - return debugFunctions.deprecateFunc.apply(undefined, arguments); - } - - function runInDebug() { - return debugFunctions.runInDebug.apply(undefined, arguments); - } - - function debugSeal() { - return debugFunctions.debugSeal.apply(undefined, arguments); - } - - function debugFreeze() { - return debugFunctions.debugFreeze.apply(undefined, arguments); - } -}); -enifed('ember-metal/dependent_keys', ['exports', 'ember-metal/watching'], function (exports, _emberMetalWatching) { - 'no use strict'; - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - - exports.addDependentKeys = addDependentKeys; - exports.removeDependentKeys = removeDependentKeys; - - /** - @module ember - @submodule ember-metal - */ - - // .......................................................... - // DEPENDENT KEYS - // - - function addDependentKeys(desc, obj, keyName, meta) { - // the descriptor has a list of dependent keys, so - // add all of its dependent keys. - var idx = undefined, - depKey = undefined; - var depKeys = desc._dependentKeys; - if (!depKeys) { - return; - } - - for (idx = 0; idx < depKeys.length; idx++) { - depKey = depKeys[idx]; - // Increment the number of times depKey depends on keyName. - meta.writeDeps(depKey, keyName, (meta.peekDeps(depKey, keyName) || 0) + 1); - // Watch the depKey - _emberMetalWatching.watch(obj, depKey, meta); - } - } - - function removeDependentKeys(desc, obj, keyName, meta) { - // the descriptor has a list of dependent keys, so - // remove all of its dependent keys. - var depKeys = desc._dependentKeys; - if (!depKeys) { - return; - } - - for (var idx = 0; idx < depKeys.length; idx++) { - var depKey = depKeys[idx]; - // Decrement the number of times depKey depends on keyName. - meta.writeDeps(depKey, keyName, (meta.peekDeps(depKey, keyName) || 0) - 1); - // Unwatch the depKey - _emberMetalWatching.unwatch(obj, depKey, meta); - } - } -}); -enifed('ember-metal/deprecate_property', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set'], function (exports, _emberMetalDebug, _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. - - @method deprecateProperty - @param {Object} object The object to add the deprecated property to. - @param {String} deprecatedKey The property to add (and print deprecation warnings upon accessing). - @param {String} newKey The property that will be aliased. - @private - @since 1.7.0 - */ - - function deprecateProperty(object, deprecatedKey, newKey, options) { - function _deprecate() { - _emberMetalDebug.deprecate('Usage of `' + deprecatedKey + '` is deprecated, use `' + newKey + '` instead.', false, options); - } - - Object.defineProperty(object, deprecatedKey, { - configurable: true, - enumerable: false, - set: function (value) { - _deprecate(); - _emberMetalProperty_set.set(this, newKey, value); - }, - get: function () { - _deprecate(); - return _emberMetalProperty_get.get(this, newKey); - } - }); - } -}); -enifed('ember-metal/descriptor', ['exports', 'ember-metal/properties'], function (exports, _emberMetalProperties) { - 'use strict'; - - exports.default = descriptor; - - function descriptor(desc) { - return new Descriptor(desc); - } - - /** - A wrapper for a native ES5 descriptor. In an ideal world, we wouldn't need - this at all, however, the way we currently flatten/merge our mixins require - a special value to denote a descriptor. - - @class Descriptor - @private - */ - - var Descriptor = (function (_EmberDescriptor) { - babelHelpers.inherits(Descriptor, _EmberDescriptor); - - function Descriptor(desc) { - babelHelpers.classCallCheck(this, Descriptor); - - _EmberDescriptor.call(this); - this.desc = desc; - } - - Descriptor.prototype.setup = function setup(obj, key) { - Object.defineProperty(obj, key, this.desc); - }; - - Descriptor.prototype.teardown = function teardown(obj, key) {}; - - return Descriptor; - })(_emberMetalProperties.Descriptor); -}); -enifed("ember-metal/error", ["exports"], function (exports) { - - /** - A subclass of the JavaScript Error object for use in Ember. - - @class Error - @namespace Ember - @extends Error - @constructor - @public - */ - "use strict"; - - exports.default = EmberError; - - function EmberError(message) { - if (!(this instanceof EmberError)) { - return new EmberError(message); - } - - var error = Error.call(this, message); - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, EmberError); - } else { - this.stack = error.stack; - } - - this.description = error.description; - this.fileName = error.fileName; - this.lineNumber = error.lineNumber; - this.message = error.message; - this.name = error.name; - this.number = error.number; - this.code = error.code; - } - - EmberError.prototype = Object.create(Error.prototype); -}); -enifed('ember-metal/error_handler', ['exports', 'ember-console', 'ember-metal/testing'], function (exports, _emberConsole, _emberMetalTesting) { - 'use strict'; - - exports.getOnerror = getOnerror; - exports.setOnerror = setOnerror; - exports.dispatchError = dispatchError; - exports.setDispatchOverride = setDispatchOverride; - - // To maintain stacktrace consistency across browsers - var getStack = function (error) { - var stack = error.stack; - var message = error.message; - - if (stack && stack.indexOf(message) === -1) { - stack = message + '\n' + stack; - } - - return stack; - }; - - var onerror = undefined; - // Ember.onerror getter - - function getOnerror() { - return onerror; - } - - // Ember.onerror setter - - function setOnerror(handler) { - onerror = handler; - } - - var dispatchOverride = undefined; - // dispatch error - - function dispatchError(error) { - if (dispatchOverride) { - dispatchOverride(error); - } else { - defaultDispatch(error); - } - } - - // allows testing adapter to override dispatch - - function setDispatchOverride(handler) { - dispatchOverride = handler; - } - - function defaultDispatch(error) { - if (_emberMetalTesting.isTesting()) { - throw error; - } - if (onerror) { - onerror(error); - } else { - _emberConsole.default.error(getStack(error)); - } - } -}); -enifed('ember-metal/events', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/meta', 'ember-metal/meta_listeners'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalMeta, _emberMetalMeta_listeners) { - 'no use strict'; - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - - /** - @module ember - @submodule ember-metal - */ - exports.accumulateListeners = accumulateListeners; - exports.addListener = addListener; - exports.removeListener = removeListener; - exports.suspendListener = suspendListener; - exports.suspendListeners = suspendListeners; - exports.watchedEvents = watchedEvents; - exports.sendEvent = sendEvent; - exports.hasListeners = hasListeners; - exports.listenersFor = listenersFor; - exports.on = on; - - /* - The event system uses a series of nested hashes to store listeners on an - object. When a listener is registered, or when an event arrives, these - hashes are consulted to determine which target and action pair to invoke. - - The hashes are stored in the object's meta hash, and look like this: - - // Object's meta hash - { - listeners: { // variable name: `listenerSet` - "foo:changed": [ // variable name: `actions` - target, method, flags - ] - } - } - - */ - - function indexOf(array, target, method) { - var index = -1; - // hashes are added to the end of the event array - // so it makes sense to start searching at the end - // of the array and search in reverse - for (var i = array.length - 3; i >= 0; i -= 3) { - if (target === array[i] && method === array[i + 1]) { - index = i; - break; - } - } - return index; - } - - function accumulateListeners(obj, eventName, otherActions) { - var meta = _emberMetalMeta.peekMeta(obj); - if (!meta) { - return; - } - var actions = meta.matchingListeners(eventName); - var newActions = []; - - for (var i = actions.length - 3; i >= 0; i -= 3) { - var target = actions[i]; - var method = actions[i + 1]; - var flags = actions[i + 2]; - var actionIndex = indexOf(otherActions, target, method); - - if (actionIndex === -1) { - otherActions.push(target, method, flags); - newActions.push(target, method, flags); - } - } - - return newActions; - } - - /** - Add an event listener - - @method addListener - @for Ember - @param obj - @param {String} eventName - @param {Object|Function} target A target object or a function - @param {Function|String} method A function or the name of a function to be called on `target` - @param {Boolean} once A flag whether a function should only be called once - @public - */ - - function addListener(obj, eventName, target, method, once) { - _emberMetalDebug.assert('You must pass at least an object and event name to Ember.addListener', !!obj && !!eventName); - - _emberMetalDebug.deprecate('didInitAttrs called in ' + (obj && obj.toString && obj.toString()) + '.', eventName !== 'didInitAttrs', { - id: 'ember-views.did-init-attrs', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x#toc_ember-component-didinitattrs' - }); - - if (!method && 'function' === typeof target) { - method = target; - target = null; - } - - var flags = 0; - if (once) { - flags |= _emberMetalMeta_listeners.ONCE; - } - - _emberMetalMeta.meta(obj).addToListeners(eventName, target, method, flags); - - if ('function' === typeof obj.didAddListener) { - obj.didAddListener(eventName, target, method); - } - } - - /** - Remove an event listener - - Arguments should match those passed to `Ember.addListener`. - - @method removeListener - @for Ember - @param obj - @param {String} eventName - @param {Object|Function} target A target object or a function - @param {Function|String} method A function or the name of a function to be called on `target` - @public - */ - - function removeListener(obj, eventName, target, method) { - _emberMetalDebug.assert('You must pass at least an object and event name to Ember.removeListener', !!obj && !!eventName); - - if (!method && 'function' === typeof target) { - method = target; - target = null; - } - - _emberMetalMeta.meta(obj).removeFromListeners(eventName, target, method, function () { - if ('function' === typeof obj.didRemoveListener) { - obj.didRemoveListener.apply(obj, arguments); - } - }); - } - - /** - Suspend listener during callback. - - This should only be used by the target of the event listener - when it is taking an action that would cause the event, e.g. - an object might suspend its property change listener while it is - setting that property. - - @method suspendListener - @for Ember - - @private - @param obj - @param {String} eventName - @param {Object|Function} target A target object or a function - @param {Function|String} method A function or the name of a function to be called on `target` - @param {Function} callback - */ - - function suspendListener(obj, eventName, target, method, callback) { - return suspendListeners(obj, [eventName], target, method, callback); - } - - /** - Suspends multiple listeners during a callback. - - @method suspendListeners - @for Ember - - @private - @param obj - @param {Array} eventNames Array of event names - @param {Object|Function} target A target object or a function - @param {Function|String} method A function or the name of a function to be called on `target` - @param {Function} callback - */ - - function suspendListeners(obj, eventNames, target, method, callback) { - if (!method && 'function' === typeof target) { - method = target; - target = null; - } - return _emberMetalMeta.meta(obj).suspendListeners(eventNames, target, method, callback); - } - - /** - Return a list of currently watched events - - @private - @method watchedEvents - @for Ember - @param obj - */ - - function watchedEvents(obj) { - return _emberMetalMeta.meta(obj).watchedEvents(); - } - - /** - Send an event. The execution of suspended listeners - is skipped, and once listeners are removed. A listener without - a target is executed on the passed object. If an array of actions - is not passed, the actions stored on the passed object are invoked. - - @method sendEvent - @for Ember - @param obj - @param {String} eventName - @param {Array} params Optional parameters for each listener. - @param {Array} actions Optional array of actions (listeners). - @return true - @public - */ - - function sendEvent(obj, eventName, params, actions) { - if (!actions) { - var meta = _emberMetalMeta.peekMeta(obj); - actions = meta && meta.matchingListeners(eventName); - } - - if (!actions || actions.length === 0) { - return; - } - - for (var i = actions.length - 3; i >= 0; i -= 3) { - // looping in reverse for once listeners - var target = actions[i]; - var method = actions[i + 1]; - var flags = actions[i + 2]; - - if (!method) { - continue; - } - if (flags & _emberMetalMeta_listeners.SUSPENDED) { - continue; - } - if (flags & _emberMetalMeta_listeners.ONCE) { - removeListener(obj, eventName, target, method); - } - if (!target) { - target = obj; - } - if ('string' === typeof method) { - if (params) { - _emberUtils.applyStr(target, method, params); - } else { - target[method](); - } - } else { - if (params) { - method.apply(target, params); - } else { - method.call(target); - } - } - } - return true; - } - - /** - @private - @method hasListeners - @for Ember - @param obj - @param {String} eventName - */ - - function hasListeners(obj, eventName) { - var meta = _emberMetalMeta.peekMeta(obj); - if (!meta) { - return false; - } - return meta.matchingListeners(eventName).length > 0; - } - - /** - @private - @method listenersFor - @for Ember - @param obj - @param {String} eventName - */ - - function listenersFor(obj, eventName) { - var ret = []; - var meta = _emberMetalMeta.peekMeta(obj); - var actions = meta && meta.matchingListeners(eventName); - - if (!actions) { - return ret; - } - - for (var i = 0; i < actions.length; i += 3) { - var target = actions[i]; - var method = actions[i + 1]; - ret.push([target, method]); - } - - return ret; - } - - /** - Define a property as a function that should be executed when - a specified event or events are triggered. - - - ``` javascript - let Job = Ember.Object.extend({ - logCompleted: Ember.on('completed', function() { - console.log('Job completed!'); - }) - }); - - let job = Job.create(); - - Ember.sendEvent(job, 'completed'); // Logs 'Job completed!' - ``` - - @method on - @for Ember - @param {String} eventNames* - @param {Function} func - @return func - @public - */ - - function on() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - var func = args.pop(); - var events = args; - func.__ember_listens__ = events; - return func; - } -}); -enifed('ember-metal/expand_properties', ['exports', 'ember-metal/debug'], function (exports, _emberMetalDebug) { - 'use strict'; - - exports.default = expandProperties; - - /** - @module ember - @submodule ember-metal - */ - - var SPLIT_REGEX = /\{|\}/; - var END_WITH_EACH_REGEX = /\.@each$/; - - /** - Expands `pattern`, invoking `callback` for each expansion. - - The only pattern supported is brace-expansion, anything else will be passed - once to `callback` directly. - - Example - - ```js - function echo(arg){ console.log(arg); } - - 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}.[]', 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 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. - */ - - function expandProperties(pattern, callback) { - _emberMetalDebug.assert('A computed property key must be a string', typeof pattern === 'string'); - _emberMetalDebug.assert('Brace expanded properties cannot contain spaces, e.g. "user.{firstName, lastName}" should be "user.{firstName,lastName}"', pattern.indexOf(' ') === -1); - _emberMetalDebug.assert('Brace expanded properties have to be balanced and cannot be nested, pattern: ' + pattern, (function (str) { - var inBrace = 0; - var char = undefined; - for (var i = 0; i < str.length; i++) { - char = str.charAt(i); - - if (char === '{') { - inBrace++; - } else if (char === '}') { - inBrace--; - } - - if (inBrace > 1 || inBrace < 0) { - return false; - } - } - - return true; - })(pattern)); - - var parts = pattern.split(SPLIT_REGEX); - var properties = [parts]; - - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; - if (part.indexOf(',') >= 0) { - properties = duplicateAndReplace(properties, part.split(','), i); - } - } - - for (var i = 0; i < properties.length; i++) { - callback(properties[i].join('').replace(END_WITH_EACH_REGEX, '.[]')); - } - } - - function duplicateAndReplace(properties, currentParts, index) { - var all = []; - - properties.forEach(function (property) { - currentParts.forEach(function (part) { - var current = property.slice(0); - current[index] = part; - all.push(current); - }); - }); - - return all; - } -}); -enifed('ember-metal/features', ['exports', 'ember-utils', 'ember-environment', 'ember/features'], function (exports, _emberUtils, _emberEnvironment, _emberFeatures) { - 'use strict'; - - exports.default = isEnabled; - - /** - The hash of enabled Canary features. Add to this, any canary features - before creating your application. - - Alternatively (and recommended), you can also define `EmberENV.FEATURES` - if you need to enable features flagged at runtime. - - @class FEATURES - @namespace Ember - @static - @since 1.1.0 - @public - */ - var FEATURES = _emberUtils.assign(_emberFeatures.default, _emberEnvironment.ENV.FEATURES); - - exports.FEATURES = FEATURES; - /** - Determine whether the specified `feature` is enabled. Used by Ember's - build tools to exclude experimental features from beta/stable builds. - - You can define the following configuration options: - - * `EmberENV.ENABLE_OPTIONAL_FEATURES` - enable any features that have not been explicitly - enabled/disabled. - - @method isEnabled - @param {String} feature The feature to check - @return {Boolean} - @for Ember.FEATURES - @since 1.1.0 - @public - */ - - function isEnabled(feature) { - var featureValue = FEATURES[feature]; - - if (featureValue === true || featureValue === false || featureValue === undefined) { - return featureValue; - } else if (_emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES) { - return true; - } else { - return false; - } - } - - exports.DEFAULT_FEATURES = _emberFeatures.default; -}); -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: - - ```javascript - Ember.getProperties(record, 'firstName', 'lastName', 'zipCode'); - // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } - ``` - - is equivalent to: - - ```javascript - Ember.getProperties(record, ['firstName', 'lastName', 'zipCode']); - // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } - ``` - - @method getProperties - @for Ember - @param {Object} obj - @param {String...|Array} list of keys to get - @return {Object} - @public - */ - - function getProperties(obj) { - var ret = {}; - var propertyNames = arguments; - var i = 1; - - if (arguments.length === 2 && Array.isArray(arguments[1])) { - i = 0; - propertyNames = arguments[1]; - } - for (; i < propertyNames.length; i++) { - ret[propertyNames[i]] = _emberMetalProperty_get.get(obj, propertyNames[i]); - } - return ret; - } -}); -enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/merge', 'ember-metal/debug', 'ember-metal/instrumentation', 'ember-metal/testing', 'ember-metal/error_handler', 'ember-metal/meta', 'ember-metal/error', 'ember-metal/cache', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/weak_map', 'ember-metal/events', 'ember-metal/is_none', 'ember-metal/is_empty', 'ember-metal/is_blank', 'ember-metal/is_present', 'ember-metal/run_loop', 'ember-metal/observer_set', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/watch_key', 'ember-metal/chains', 'ember-metal/watch_path', 'ember-metal/watching', 'ember-metal/libraries', 'ember-metal/map', 'ember-metal/get_properties', 'ember-metal/set_properties', 'ember-metal/expand_properties', 'ember-metal/observer', 'ember-metal/mixin', 'ember-metal/binding', 'ember-metal/path_cache', 'ember-metal/injected_property', 'ember-metal/tags', 'ember-metal/replace', 'ember-metal/transaction', 'ember-metal/is_proxy', 'ember-metal/descriptor'], function (exports, _require, _emberMetalCore, _emberMetalComputed, _emberMetalAlias, _emberMetalMerge, _emberMetalDebug, _emberMetalInstrumentation, _emberMetalTesting, _emberMetalError_handler, _emberMetalMeta, _emberMetalError, _emberMetalCache, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalWeak_map, _emberMetalEvents, _emberMetalIs_none, _emberMetalIs_empty, _emberMetalIs_blank, _emberMetalIs_present, _emberMetalRun_loop, _emberMetalObserver_set, _emberMetalProperty_events, _emberMetalProperties, _emberMetalWatch_key, _emberMetalChains, _emberMetalWatch_path, _emberMetalWatching, _emberMetalLibraries, _emberMetalMap, _emberMetalGet_properties, _emberMetalSet_properties, _emberMetalExpand_properties, _emberMetalObserver, _emberMetalMixin, _emberMetalBinding, _emberMetalPath_cache, _emberMetalInjected_property, _emberMetalTags, _emberMetalReplace, _emberMetalTransaction, _emberMetalIs_proxy, _emberMetalDescriptor) { - /** - @module ember - @submodule ember-metal - */ - - 'use strict'; - - exports.default = _emberMetalCore.default; - // reexports - exports.computed = _emberMetalComputed.default; - exports.cacheFor = _emberMetalComputed.cacheFor; - exports.ComputedProperty = _emberMetalComputed.ComputedProperty; - exports.alias = _emberMetalAlias.default; - exports.merge = _emberMetalMerge.default; - exports.assert = _emberMetalDebug.assert; - exports.info = _emberMetalDebug.info; - exports.warn = _emberMetalDebug.warn; - exports.debug = _emberMetalDebug.debug; - exports.deprecate = _emberMetalDebug.deprecate; - exports.deprecateFunc = _emberMetalDebug.deprecateFunc; - exports.runInDebug = _emberMetalDebug.runInDebug; - exports.setDebugFunction = _emberMetalDebug.setDebugFunction; - exports.getDebugFunction = _emberMetalDebug.getDebugFunction; - exports.debugSeal = _emberMetalDebug.debugSeal; - exports.debugFreeze = _emberMetalDebug.debugFreeze; - exports.instrument = _emberMetalInstrumentation.instrument; - exports.flaggedInstrument = _emberMetalInstrumentation.flaggedInstrument; - exports._instrumentStart = _emberMetalInstrumentation._instrumentStart; - exports.instrumentationReset = _emberMetalInstrumentation.reset; - exports.instrumentationSubscribe = _emberMetalInstrumentation.subscribe; - exports.instrumentationUnsubscribe = _emberMetalInstrumentation.unsubscribe; - exports.isTesting = _emberMetalTesting.isTesting; - exports.setTesting = _emberMetalTesting.setTesting; - exports.getOnerror = _emberMetalError_handler.getOnerror; - exports.setOnerror = _emberMetalError_handler.setOnerror; - exports.dispatchError = _emberMetalError_handler.dispatchError; - exports.setDispatchOverride = _emberMetalError_handler.setDispatchOverride; - exports.META_DESC = _emberMetalMeta.META_DESC; - exports.meta = _emberMetalMeta.meta; - exports.peekMeta = _emberMetalMeta.peekMeta; - exports.Error = _emberMetalError.default; - exports.Cache = _emberMetalCache.default; - exports.isFeatureEnabled = _emberMetalFeatures.default; - exports.FEATURES = _emberMetalFeatures.FEATURES; - exports.DEFAULT_FEATURES = _emberMetalFeatures.DEFAULT_FEATURES; - exports._getPath = _emberMetalProperty_get._getPath; - exports.get = _emberMetalProperty_get.get; - exports.getWithDefault = _emberMetalProperty_get.getWithDefault; - exports.set = _emberMetalProperty_set.set; - exports.trySet = _emberMetalProperty_set.trySet; - exports.WeakMap = _emberMetalWeak_map.default; - exports.accumulateListeners = _emberMetalEvents.accumulateListeners; - exports.addListener = _emberMetalEvents.addListener; - exports.hasListeners = _emberMetalEvents.hasListeners; - exports.listenersFor = _emberMetalEvents.listenersFor; - exports.on = _emberMetalEvents.on; - exports.removeListener = _emberMetalEvents.removeListener; - exports.sendEvent = _emberMetalEvents.sendEvent; - exports.suspendListener = _emberMetalEvents.suspendListener; - exports.suspendListeners = _emberMetalEvents.suspendListeners; - exports.watchedEvents = _emberMetalEvents.watchedEvents; - exports.isNone = _emberMetalIs_none.default; - exports.isEmpty = _emberMetalIs_empty.default; - exports.isBlank = _emberMetalIs_blank.default; - exports.isPresent = _emberMetalIs_present.default; - exports.run = _emberMetalRun_loop.default; - exports.ObserverSet = _emberMetalObserver_set.default; - exports.beginPropertyChanges = _emberMetalProperty_events.beginPropertyChanges; - exports.changeProperties = _emberMetalProperty_events.changeProperties; - exports.endPropertyChanges = _emberMetalProperty_events.endPropertyChanges; - exports.overrideChains = _emberMetalProperty_events.overrideChains; - exports.propertyDidChange = _emberMetalProperty_events.propertyDidChange; - exports.propertyWillChange = _emberMetalProperty_events.propertyWillChange; - exports.PROPERTY_DID_CHANGE = _emberMetalProperty_events.PROPERTY_DID_CHANGE; - exports.defineProperty = _emberMetalProperties.defineProperty; - exports.Descriptor = _emberMetalProperties.Descriptor; - exports.watchKey = _emberMetalWatch_key.watchKey; - exports.unwatchKey = _emberMetalWatch_key.unwatchKey; - exports.ChainNode = _emberMetalChains.ChainNode; - exports.finishChains = _emberMetalChains.finishChains; - exports.removeChainWatcher = _emberMetalChains.removeChainWatcher; - exports.watchPath = _emberMetalWatch_path.watchPath; - exports.unwatchPath = _emberMetalWatch_path.unwatchPath; - exports.destroy = _emberMetalWatching.destroy; - exports.isWatching = _emberMetalWatching.isWatching; - exports.unwatch = _emberMetalWatching.unwatch; - exports.watch = _emberMetalWatching.watch; - exports.watcherCount = _emberMetalWatching.watcherCount; - exports.libraries = _emberMetalLibraries.default; - exports.Map = _emberMetalMap.Map; - exports.MapWithDefault = _emberMetalMap.MapWithDefault; - exports.OrderedSet = _emberMetalMap.OrderedSet; - exports.getProperties = _emberMetalGet_properties.default; - exports.setProperties = _emberMetalSet_properties.default; - exports.expandProperties = _emberMetalExpand_properties.default; - exports._suspendObserver = _emberMetalObserver._suspendObserver; - exports._suspendObservers = _emberMetalObserver._suspendObservers; - exports.addObserver = _emberMetalObserver.addObserver; - exports.observersFor = _emberMetalObserver.observersFor; - exports.removeObserver = _emberMetalObserver.removeObserver; - exports._addBeforeObserver = _emberMetalObserver._addBeforeObserver; - exports._removeBeforeObserver = _emberMetalObserver._removeBeforeObserver; - exports.NAME_KEY = _emberMetalMixin.NAME_KEY; - exports.Mixin = _emberMetalMixin.Mixin; - exports.aliasMethod = _emberMetalMixin.aliasMethod; - exports._immediateObserver = _emberMetalMixin._immediateObserver; - exports._beforeObserver = _emberMetalMixin._beforeObserver; - exports.mixin = _emberMetalMixin.mixin; - exports.observer = _emberMetalMixin.observer; - exports.required = _emberMetalMixin.required; - exports.REQUIRED = _emberMetalMixin.REQUIRED; - exports.hasUnprocessedMixins = _emberMetalMixin.hasUnprocessedMixins; - exports.clearUnprocessedMixins = _emberMetalMixin.clearUnprocessedMixins; - exports.detectBinding = _emberMetalMixin.detectBinding; - exports.Binding = _emberMetalBinding.Binding; - exports.bind = _emberMetalBinding.bind; - exports.isGlobalPath = _emberMetalPath_cache.isGlobalPath; - exports.InjectedProperty = _emberMetalInjected_property.default; - exports.setHasViews = _emberMetalTags.setHasViews; - exports.tagForProperty = _emberMetalTags.tagForProperty; - exports.tagFor = _emberMetalTags.tagFor; - exports.markObjectAsDirty = _emberMetalTags.markObjectAsDirty; - exports.replace = _emberMetalReplace.default; - exports.runInTransaction = _emberMetalTransaction.default; - exports.didRender = _emberMetalTransaction.didRender; - exports.assertNotRendered = _emberMetalTransaction.assertNotRendered; - exports.isProxy = _emberMetalIs_proxy.isProxy; - exports.descriptor = _emberMetalDescriptor.default; - - // TODO: this needs to be deleted once we refactor the build tooling - // do this for side-effects of updating Ember.assert, warn, etc when - // ember-debug is present - // This needs to be called before any deprecateFunc - - if (_require.has('ember-debug')) { - _require.default('ember-debug'); - } -}); -enifed('ember-metal/injected_property', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/properties'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalComputed, _emberMetalAlias, _emberMetalProperties) { - 'use strict'; - - exports.default = InjectedProperty; - - /** - Read-only property that returns the result of a container lookup. - - @class InjectedProperty - @namespace Ember - @constructor - @param {String} type The container type the property will lookup - @param {String} name (optional) The name the property will lookup, defaults - to the property's name - @private - */ - - function InjectedProperty(type, name) { - this.type = type; - this.name = name; - - this._super$Constructor(injectedPropertyGet); - AliasedPropertyPrototype.oneWay.call(this); - } - - function injectedPropertyGet(keyName) { - var desc = this[keyName]; - var owner = _emberUtils.getOwner(this) || this.container; // fallback to `container` for backwards compat - - _emberMetalDebug.assert('InjectedProperties should be defined with the Ember.inject computed property macros.', desc && desc.isDescriptor && desc.type); - _emberMetalDebug.assert('Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container.', owner); - - return owner.lookup(desc.type + ':' + (desc.name || keyName)); - } - - InjectedProperty.prototype = Object.create(_emberMetalProperties.Descriptor.prototype); - - var InjectedPropertyPrototype = InjectedProperty.prototype; - var ComputedPropertyPrototype = _emberMetalComputed.ComputedProperty.prototype; - var AliasedPropertyPrototype = _emberMetalAlias.AliasedProperty.prototype; - - InjectedPropertyPrototype._super$Constructor = _emberMetalComputed.ComputedProperty; - - InjectedPropertyPrototype.get = ComputedPropertyPrototype.get; - InjectedPropertyPrototype.readOnly = ComputedPropertyPrototype.readOnly; - InjectedPropertyPrototype.teardown = ComputedPropertyPrototype.teardown; -}); -enifed('ember-metal/instrumentation', ['exports', 'ember-environment', 'ember-metal/features'], function (exports, _emberEnvironment, _emberMetalFeatures) { - 'use strict'; - - exports.instrument = instrument; - exports._instrumentStart = _instrumentStart; - exports.subscribe = subscribe; - exports.unsubscribe = unsubscribe; - exports.reset = reset; - - /** - The purpose of the Ember Instrumentation module is - to provide efficient, general-purpose instrumentation - for Ember. - - Subscribe to a listener by using `Ember.subscribe`: - - ```javascript - Ember.subscribe("render", { - before(name, timestamp, payload) { - - }, - - after(name, timestamp, payload) { - - } - }); - ``` - - If you return a value from the `before` callback, that same - value will be passed as a fourth parameter to the `after` - callback. - - Instrument a block of code by using `Ember.instrument`: - - ```javascript - Ember.instrument("render.handlebars", payload, function() { - // rendering logic - }, binding); - ``` - - Event names passed to `Ember.instrument` are namespaced - by periods, from more general to more specific. Subscribers - can listen for events by whatever level of granularity they - are interested in. - - In the above example, the event is `render.handlebars`, - and the subscriber listened for all events beginning with - `render`. It would receive callbacks for events named - `render`, `render.handlebars`, `render.container`, or - even `render.handlebars.layout`. - - @class Instrumentation - @namespace Ember - @static - @private - */ - var subscribers = []; - exports.subscribers = subscribers; - var cache = {}; - - function populateListeners(name) { - var listeners = []; - var subscriber = undefined; - - for (var i = 0; i < subscribers.length; i++) { - subscriber = subscribers[i]; - if (subscriber.regex.test(name)) { - listeners.push(subscriber.object); - } - } - - cache[name] = listeners; - return listeners; - } - - var time = (function () { - var perf = 'undefined' !== typeof window ? window.performance || {} : {}; - var fn = perf.now || perf.mozNow || perf.webkitNow || perf.msNow || perf.oNow; - // fn.bind will be available in all the browsers that support the advanced window.performance... ;-) - return fn ? fn.bind(perf) : function () { - return +new Date(); - }; - })(); - - /** - Notifies event's subscribers, calls `before` and `after` hooks. - - @method instrument - @namespace Ember.Instrumentation - - @param {String} [name] Namespaced event name. - @param {Object} _payload - @param {Function} callback Function that you're instrumenting. - @param {Object} binding Context that instrument function is called with. - @private - */ - - function instrument(name, _payload, callback, binding) { - if (arguments.length <= 3 && typeof _payload === 'function') { - binding = callback; - callback = _payload; - _payload = undefined; - } - if (subscribers.length === 0) { - return callback.call(binding); - } - var payload = _payload || {}; - var finalizer = _instrumentStart(name, function () { - return payload; - }); - - if (finalizer) { - return withFinalizer(callback, finalizer, payload, binding); - } else { - return callback.call(binding); - } - } - - var flaggedInstrument = undefined; - 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 { - result = callback.call(binding); - } catch (e) { - payload.exception = e; - result = payload; - } finally { - finalizer(); - return result; - } - } - - function NOOP() {} - - // private for now - - function _instrumentStart(name, _payload, _payloadParam) { - if (subscribers.length === 0) { - return NOOP; - } - - var listeners = cache[name]; - - if (!listeners) { - listeners = populateListeners(name); - } - - if (listeners.length === 0) { - return NOOP; - } - - var payload = _payload(_payloadParam); - - var STRUCTURED_PROFILE = _emberEnvironment.ENV.STRUCTURED_PROFILE; - var timeName = undefined; - if (STRUCTURED_PROFILE) { - timeName = name + ': ' + payload.object; - console.time(timeName); - } - - var beforeValues = new Array(listeners.length); - var i = undefined, - listener = undefined; - var timestamp = time(); - for (i = 0; i < listeners.length; i++) { - listener = listeners[i]; - beforeValues[i] = listener.before(name, timestamp, payload); - } - - return function _instrumentEnd() { - var i = undefined, - listener = undefined; - var timestamp = time(); - for (i = 0; i < listeners.length; i++) { - listener = listeners[i]; - if (typeof listener.after === 'function') { - listener.after(name, timestamp, payload, beforeValues[i]); - } - } - - if (STRUCTURED_PROFILE) { - console.timeEnd(timeName); - } - }; - } - - /** - Subscribes to a particular event or instrumented block of code. - - @method subscribe - @namespace Ember.Instrumentation - - @param {String} [pattern] Namespaced event name. - @param {Object} [object] Before and After hooks. - - @return {Subscriber} - @private - */ - - function subscribe(pattern, object) { - var paths = pattern.split('.'); - var path = undefined; - var regex = []; - - for (var i = 0; i < paths.length; i++) { - path = paths[i]; - if (path === '*') { - regex.push('[^\\.]*'); - } else { - regex.push(path); - } - } - - regex = regex.join('\\.'); - regex = regex + '(\\..*)?'; - - var subscriber = { - pattern: pattern, - regex: new RegExp('^' + regex + '$'), - object: object - }; - - subscribers.push(subscriber); - cache = {}; - - return subscriber; - } - - /** - Unsubscribes from a particular event or instrumented block of code. - - @method unsubscribe - @namespace Ember.Instrumentation - - @param {Object} [subscriber] - @private - */ - - function unsubscribe(subscriber) { - var index = undefined; - - for (var i = 0; i < subscribers.length; i++) { - if (subscribers[i] === subscriber) { - index = i; - } - } - - subscribers.splice(index, 1); - cache = {}; - } - - /** - Resets `Ember.Instrumentation` by flushing list of subscribers. - - @method reset - @namespace Ember.Instrumentation - @private - */ - - function reset() { - 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. - - ```javascript - Ember.isBlank(); // true - Ember.isBlank(null); // true - Ember.isBlank(undefined); // true - Ember.isBlank(''); // true - Ember.isBlank([]); // true - Ember.isBlank('\n\t'); // true - Ember.isBlank(' '); // true - Ember.isBlank({}); // false - Ember.isBlank('\n\t Hello'); // false - Ember.isBlank('Hello world'); // false - Ember.isBlank([1,2,3]); // false - ``` - - @method isBlank - @for Ember - @param {Object} obj Value to test - @return {Boolean} - @since 1.5.0 - @public - */ - - 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'; - - exports.default = isEmpty; - - /** - Verifies that a value is `null` or an empty string, empty array, - or empty function. - - Constrains the rules on `Ember.isNone` by returning true for empty - string and empty arrays. - - ```javascript - Ember.isEmpty(); // true - Ember.isEmpty(null); // true - Ember.isEmpty(undefined); // true - Ember.isEmpty(''); // true - Ember.isEmpty([]); // true - Ember.isEmpty({}); // false - Ember.isEmpty('Adam Hawkins'); // false - Ember.isEmpty([0,1,2]); // false - Ember.isEmpty('\n\t'); // false - Ember.isEmpty(' '); // false - ``` - - @method isEmpty - @for Ember - @param {Object} obj Value to test - @return {Boolean} - @public - */ - - function isEmpty(obj) { - var none = _emberMetalIs_none.default(obj); - if (none) { - return none; - } - - if (typeof obj.size === 'number') { - return !obj.size; - } - - var objectType = typeof obj; - - if (objectType === 'object') { - var size = _emberMetalProperty_get.get(obj, 'size'); - if (typeof size === 'number') { - return !size; - } - } - - if (typeof obj.length === 'number' && objectType !== 'function') { - return !obj.length; - } - - if (objectType === 'object') { - var _length = _emberMetalProperty_get.get(obj, 'length'); - if (typeof _length === 'number') { - return !_length; - } - } - - return false; - } -}); -enifed("ember-metal/is_none", ["exports"], function (exports) { - /** - Returns true if the passed value is null or undefined. This avoids errors - from JSLint complaining about use of ==, which can be technically - confusing. - - ```javascript - Ember.isNone(); // true - Ember.isNone(null); // true - Ember.isNone(undefined); // true - Ember.isNone(''); // false - Ember.isNone([]); // false - Ember.isNone(function() {}); // false - ``` - - @method isNone - @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`. - - ```javascript - Ember.isPresent(); // false - Ember.isPresent(null); // false - Ember.isPresent(undefined); // false - Ember.isPresent(''); // false - Ember.isPresent(' '); // false - Ember.isPresent('\n\t'); // false - Ember.isPresent([]); // false - Ember.isPresent({ length: 0 }) // false - Ember.isPresent(false); // true - Ember.isPresent(true); // true - Ember.isPresent('string'); // true - Ember.isPresent(0); // true - Ember.isPresent(function() {}) // true - Ember.isPresent({}); // true - Ember.isPresent(false); // true - Ember.isPresent('\n\t Hello'); // true - Ember.isPresent([1,2,3]); // true - ``` - - @method isPresent - @for Ember - @param {Object} obj Value to test - @return {Boolean} - @since 1.8.0 - @public - */ - - function isPresent(obj) { - return !_emberMetalIs_blank.default(obj); - } -}); -enifed('ember-metal/is_proxy', ['exports', 'ember-metal/meta'], function (exports, _emberMetalMeta) { - 'use strict'; - - exports.isProxy = isProxy; - - function isProxy(value) { - if (typeof value === 'object' && value) { - var meta = _emberMetalMeta.peekMeta(value); - return meta && meta.isProxy(); - } - - return false; - } -}); -enifed('ember-metal/libraries', ['exports', 'ember-metal/debug', 'ember-metal/features'], function (exports, _emberMetalDebug, _emberMetalFeatures) { - 'use strict'; - - exports.Libraries = Libraries; - - /** - Helper class that allows you to register your library with Ember. - - Singleton created at `Ember.libraries`. - - @class Libraries - @constructor - @private - */ - - function Libraries() { - this._registry = []; - this._coreLibIndex = 0; - } - - Libraries.prototype = { - constructor: Libraries, - - _getLibraryByName: function (name) { - var libs = this._registry; - var count = libs.length; - - for (var i = 0; i < count; i++) { - if (libs[i].name === name) { - return libs[i]; - } - } - }, - - register: function (name, version, isCoreLibrary) { - var index = this._registry.length; - - if (!this._getLibraryByName(name)) { - if (isCoreLibrary) { - index = this._coreLibIndex++; - } - this._registry.splice(index, 0, { name: name, version: version }); - } else { - _emberMetalDebug.warn('Library "' + name + '" is already registered with Ember.', false, { id: 'ember-metal.libraries-register' }); - } - }, - - registerCoreLibrary: function (name, version) { - this.register(name, version, true); - }, - - deRegister: function (name) { - var lib = this._getLibraryByName(name); - var index = undefined; - - if (lib) { - index = this._registry.indexOf(lib); - 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-utils'], function (exports, _emberUtils) { - /** - @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) { - throw new TypeError('Constructor ' + name + ' requires \'new\''); - } - - function copyNull(obj) { - var output = new _emberUtils.EmptyObject(); - - for (var prop in obj) { - // hasOwnPropery is not needed because obj is new EmptyObject(); - output[prop] = obj[prop]; - } - - return output; - } - - function copyMap(original, newObject) { - var keys = original._keys.copy(); - var values = copyNull(original._values); - - newObject._keys = keys; - newObject._values = values; - newObject.size = original.size; - - return newObject; - } - - /** - This class is used internally by Ember and Ember Data. - Please do not use it at this time. We plan to clean it up - and add many tests soon. - - @class OrderedSet - @namespace Ember - @constructor - @private - */ - function OrderedSet() { - if (this instanceof OrderedSet) { - this.clear(); - this._silenceRemoveDeprecation = false; - } else { - missingNew('OrderedSet'); - } - } - - /** - @method create - @static - @return {Ember.OrderedSet} - @private - */ - OrderedSet.create = function () { - var Constructor = this; - - return new Constructor(); - }; - - OrderedSet.prototype = { - constructor: OrderedSet, - /** - @method clear - @private - */ - clear: function () { - this.presenceSet = new _emberUtils.EmptyObject(); - this.list = []; - this.size = 0; - }, - - /** - @method add - @param obj - @param guid (optional, and for internal use) - @return {Ember.OrderedSet} - @private - */ - add: function (obj, _guid) { - var guid = _guid || _emberUtils.guidFor(obj); - var presenceSet = this.presenceSet; - var list = this.list; - - if (presenceSet[guid] !== true) { - presenceSet[guid] = true; - this.size = list.push(obj); - } - - return this; - }, - - /** - @since 1.8.0 - @method delete - @param obj - @param _guid (optional and for internal use only) - @return {Boolean} - @private - */ - delete: function (obj, _guid) { - var guid = _guid || _emberUtils.guidFor(obj); - var presenceSet = this.presenceSet; - var list = this.list; - - if (presenceSet[guid] === true) { - delete presenceSet[guid]; - var index = list.indexOf(obj); - if (index > -1) { - list.splice(index, 1); - } - this.size = list.length; - return true; - } else { - return false; - } - }, - - /** - @method isEmpty - @return {Boolean} - @private - */ - isEmpty: function () { - return this.size === 0; - }, - - /** - @method has - @param obj - @return {Boolean} - @private - */ - has: function (obj) { - if (this.size === 0) { - return false; - } - - var guid = _emberUtils.guidFor(obj); - var presenceSet = this.presenceSet; - - return presenceSet[guid] === true; - }, - - /** - @method forEach - @param {Function} fn - @param self - @private - */ - forEach: function (fn /*, ...thisArg*/) { - if (typeof fn !== 'function') { - missingFunction(fn); - } - - if (this.size === 0) { - return; - } - - var list = this.list; - - if (arguments.length === 2) { - for (var i = 0; i < list.length; i++) { - fn.call(arguments[1], list[i]); - } - } else { - for (var i = 0; i < list.length; i++) { - fn(list[i]); - } - } - }, - - /** - @method toArray - @return {Array} - @private - */ - toArray: function () { - return this.list.slice(); - }, - - /** - @method copy - @return {Ember.OrderedSet} - @private - */ - copy: function () { - var Constructor = this.constructor; - var set = new Constructor(); - - set._silenceRemoveDeprecation = this._silenceRemoveDeprecation; - set.presenceSet = copyNull(this.presenceSet); - set.list = this.toArray(); - set.size = this.size; - - return set; - } - }; - - /** - A Map stores values indexed by keys. Unlike JavaScript's - default Objects, the keys of a Map can be any JavaScript - object. - - Internally, a Map has two data structures: - - 1. `keys`: an OrderedSet of all of the existing keys - 2. `values`: a JavaScript Object indexed by the `Ember.guidFor(key)` - - When a key/value pair is added for the first time, we - add the key to the `keys` OrderedSet, and create or - replace an entry in `values`. When an entry is deleted, - we delete its entry in `keys` and `values`. - - @class Map - @namespace Ember - @private - @constructor - */ - function Map() { - if (this instanceof Map) { - this._keys = OrderedSet.create(); - this._keys._silenceRemoveDeprecation = true; - this._values = new _emberUtils.EmptyObject(); - this.size = 0; - } else { - missingNew('Map'); - } - } - - /** - @method create - @static - @private - */ - Map.create = function () { - var Constructor = this; - return new Constructor(); - }; - - Map.prototype = { - constructor: Map, - - /** - This property will change as the number of objects in the map changes. - @since 1.8.0 - @property size - @type number - @default 0 - @private - */ - size: 0, - - /** - Retrieve the value associated with a given key. - @method get - @param {*} key - @return {*} the value associated with the key, or `undefined` - @private - */ - get: function (key) { - if (this.size === 0) { - return; - } - - var values = this._values; - var guid = _emberUtils.guidFor(key); - - return values[guid]; - }, - - /** - Adds a value to the map. If a value for the given key has already been - provided, the new value will replace the old value. - @method set - @param {*} key - @param {*} value - @return {Ember.Map} - @private - */ - set: function (key, value) { - var keys = this._keys; - var values = this._values; - var guid = _emberUtils.guidFor(key); - - // ensure we don't store -0 - var k = key === -0 ? 0 : key; - - keys.add(k, guid); - - values[guid] = value; - - this.size = keys.size; - - return this; - }, - - /** - Removes a value from the map for an associated key. - @since 1.8.0 - @method delete - @param {*} key - @return {Boolean} true if an item was removed, false otherwise - @private - */ - delete: function (key) { - if (this.size === 0) { - return false; - } - // don't use ES6 "delete" because it will be annoying - // to use in browsers that are not ES6 friendly; - var keys = this._keys; - var values = this._values; - var guid = _emberUtils.guidFor(key); - - if (keys.delete(key, guid)) { - delete values[guid]; - this.size = keys.size; - return true; - } else { - return false; - } - }, - - /** - Check whether a key is present. - @method has - @param {*} key - @return {Boolean} true if the item was present, false otherwise - @private - */ - has: function (key) { - return this._keys.has(key); - }, - - /** - Iterate over all the keys and values. Calls the function once - for each key, passing in value, key, and the map being iterated over, - in that order. - The keys are guaranteed to be iterated over in insertion order. - @method forEach - @param {Function} callback - @param {*} self if passed, the `this` value inside the - callback. By default, `this` is the map. - @private - */ - forEach: function (callback /*, ...thisArg*/) { - if (typeof callback !== 'function') { - missingFunction(callback); - } - - if (this.size === 0) { - return; - } - - var map = this; - var cb = undefined, - thisArg = undefined; - - if (arguments.length === 2) { - thisArg = arguments[1]; - cb = function (key) { - return callback.call(thisArg, map.get(key), key, map); - }; - } else { - cb = function (key) { - return callback(map.get(key), key, map); - }; - } - - this._keys.forEach(cb); - }, - - /** - @method clear - @private - */ - clear: function () { - this._keys.clear(); - this._values = new _emberUtils.EmptyObject(); - this.size = 0; - }, - - /** - @method copy - @return {Ember.Map} - @private - */ - copy: function () { - return copyMap(this, new Map()); - } - }; - - /** - @class MapWithDefault - @namespace Ember - @extends Ember.Map - @private - @constructor - @param [options] - @param {*} [options.defaultValue] - */ - function MapWithDefault(options) { - this._super$constructor(); - this.defaultValue = options.defaultValue; - } - - /** - @method create - @static - @param [options] - @param {*} [options.defaultValue] - @return {Ember.MapWithDefault|Ember.Map} If options are passed, returns - `Ember.MapWithDefault` otherwise returns `Ember.Map` - @private - */ - MapWithDefault.create = function (options) { - if (options) { - return new MapWithDefault(options); - } else { - return new Map(); - } - }; - - MapWithDefault.prototype = Object.create(Map.prototype); - MapWithDefault.prototype.constructor = MapWithDefault; - MapWithDefault.prototype._super$constructor = Map; - MapWithDefault.prototype._super$get = Map.prototype.get; - - /** - Retrieve the value associated with a given key. - - @method get - @param {*} key - @return {*} the value associated with the key, or the default value - @private - */ - MapWithDefault.prototype.get = function (key) { - var hasValue = this.has(key); - - if (hasValue) { - return this._super$get(key); - } else { - var defaultValue = this.defaultValue(key); - this.set(key, defaultValue); - return defaultValue; - } - }; - - /** - @method copy - @return {Ember.MapWithDefault} - @private - */ - MapWithDefault.prototype.copy = function () { - var Constructor = this.constructor; - return copyMap(this, new Constructor({ - defaultValue: this.defaultValue - })); - }; - - exports.default = Map; - exports.OrderedSet = OrderedSet; - exports.Map = Map; - exports.MapWithDefault = MapWithDefault; -}); -enifed('ember-metal/merge', ['exports'], function (exports) { - /** - Merge the contents of two objects together into the first object. - - ```javascript - Ember.merge({ first: 'Tom' }, { last: 'Dale' }); // { first: 'Tom', last: 'Dale' } - var a = { first: 'Yehuda' }; - var b = { last: 'Katz' }; - Ember.merge(a, b); // a == { first: 'Yehuda', last: 'Katz' }, b == { last: 'Katz' } - ``` - - @method merge - @for Ember - @param {Object} original The object to merge into - @param {Object} updates The object to copy properties from - @return {Object} - @public - */ - 'use strict'; - - exports.default = merge; - - function merge(original, updates) { - if (!updates || typeof updates !== 'object') { - return original; - } - - var props = Object.keys(updates); - var prop = undefined; - - for (var i = 0; i < props.length; i++) { - prop = props[i]; - original[prop] = updates[prop]; - } - - return original; - } -}); -enifed('ember-metal/meta', ['exports', 'ember-utils', 'ember-metal/features', 'ember-metal/meta_listeners', 'ember-metal/debug', 'ember-metal/chains'], function (exports, _emberUtils, _emberMetalFeatures, _emberMetalMeta_listeners, _emberMetalDebug, _emberMetalChains) { - 'no use strict'; - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - - exports.Meta = Meta; - exports.deleteMeta = deleteMeta; - exports.meta = meta; - - var counters = { - peekCalls: 0, - peekParentCalls: 0, - peekPrototypeWalks: 0, - setCalls: 0, - deleteCalls: 0, - metaCalls: 0, - metaInstantiated: 0 - }; - - /** - @module ember-metal - */ - - /* - This declares several meta-programmed members on the Meta class. Such - meta! - - In general, the `readable` variants will give you an object (if it - already exists) that you can read but should not modify. The - `writable` variants will give you a mutable object, and they will - create it if it didn't already exist. - - The following methods will get generated metaprogrammatically, and - I'm including them here for greppability: - - writableCache, readableCache, writeWatching, - peekWatching, clearWatching, writeMixins, - peekMixins, clearMixins, writeBindings, - peekBindings, clearBindings, writeValues, - peekValues, clearValues, writeDeps, forEachInDeps - writableChainWatchers, readableChainWatchers, writableChains, - readableChains, writableTag, readableTag, writableTags, - readableTags - */ - var members = { - cache: ownMap, - weak: ownMap, - watching: inheritedMap, - mixins: inheritedMap, - bindings: inheritedMap, - values: inheritedMap, - chainWatchers: ownCustomObject, - chains: inheritedCustomObject, - tag: ownCustomObject, - tags: ownMap - }; - - // FLAGS - var SOURCE_DESTROYING = 1 << 1; - var SOURCE_DESTROYED = 1 << 2; - var META_DESTROYED = 1 << 3; - var IS_PROXY = 1 << 4; - - if (true || true) { - members.lastRendered = ownMap; - members.lastRenderedFrom = ownMap; // FIXME: not used in production, remove me from prod builds - } - - var memberNames = Object.keys(members); - var META_FIELD = '__ember_meta__'; - - function Meta(obj, parentMeta) { - _emberMetalDebug.runInDebug(function () { - return counters.metaInstantiated++; - }); - - this._cache = undefined; - this._weak = undefined; - this._watching = undefined; - this._mixins = undefined; - this._bindings = undefined; - this._values = undefined; - this._deps = undefined; - this._chainWatchers = undefined; - this._chains = undefined; - this._tag = undefined; - this._tags = undefined; - - // initial value for all flags right now is false - // see FLAGS const for detailed list of flags used - this._flags = 0; - - // used only internally - this.source = obj; - - // when meta(obj).proto === obj, the object is intended to be only a - // prototype and doesn't need to actually be observable itself - this.proto = undefined; - - // The next meta in our inheritance chain. We (will) track this - // explicitly instead of using prototypical inheritance because we - // have detailed knowledge of how each property should really be - // inherited, and we can optimize it much better than JS runtimes. - this.parent = parentMeta; - - if (true || true) { - this._lastRendered = undefined; - this._lastRenderedFrom = undefined; // FIXME: not used in production, remove me from prod builds - } - - this._initializeListeners(); - } - - Meta.prototype.isInitialized = function (obj) { - return this.proto !== obj; - }; - - var NODE_STACK = []; - - Meta.prototype.destroy = function () { - if (this.isMetaDestroyed()) { - return; - } - - // remove chainWatchers to remove circular references that would prevent GC - var node = undefined, - nodes = undefined, - key = undefined, - nodeObject = undefined; - node = this.readableChains(); - if (node) { - NODE_STACK.push(node); - // process tree - while (NODE_STACK.length > 0) { - node = NODE_STACK.pop(); - // push children - nodes = node._chains; - if (nodes) { - for (key in nodes) { - if (nodes[key] !== undefined) { - NODE_STACK.push(nodes[key]); - } - } - } - - // remove chainWatcher in node object - if (node._watching) { - nodeObject = node._object; - if (nodeObject) { - var foreignMeta = peekMeta(nodeObject); - // avoid cleaning up chain watchers when both current and - // foreign objects are being destroyed - // if both are being destroyed manual cleanup is not needed - // as they will be GC'ed and no non-destroyed references will - // be remaining - if (foreignMeta && !foreignMeta.isSourceDestroying()) { - _emberMetalChains.removeChainWatcher(nodeObject, node._key, node, foreignMeta); - } - } - } - } - } - - this.setMetaDestroyed(); - }; - - for (var _name in _emberMetalMeta_listeners.protoMethods) { - Meta.prototype[_name] = _emberMetalMeta_listeners.protoMethods[_name]; - } - memberNames.forEach(function (name) { - return members[name](name, Meta); - }); - - Meta.prototype.isSourceDestroying = function isSourceDestroying() { - return (this._flags & SOURCE_DESTROYING) !== 0; - }; - - Meta.prototype.setSourceDestroying = function setSourceDestroying() { - this._flags |= SOURCE_DESTROYING; - }; - - Meta.prototype.isSourceDestroyed = function isSourceDestroyed() { - return (this._flags & SOURCE_DESTROYED) !== 0; - }; - - Meta.prototype.setSourceDestroyed = function setSourceDestroyed() { - this._flags |= SOURCE_DESTROYED; - }; - - Meta.prototype.isMetaDestroyed = function isMetaDestroyed() { - return (this._flags & META_DESTROYED) !== 0; - }; - - Meta.prototype.setMetaDestroyed = function setMetaDestroyed() { - this._flags |= META_DESTROYED; - }; - - Meta.prototype.isProxy = function isProxy() { - return (this._flags & IS_PROXY) !== 0; - }; - - Meta.prototype.setProxy = function setProxy() { - this._flags |= IS_PROXY; - }; - - // Implements a member that is a lazily created, non-inheritable - // POJO. - function ownMap(name, Meta) { - var key = memberProperty(name); - var capitalized = capitalize(name); - Meta.prototype['writable' + capitalized] = function () { - return this._getOrCreateOwnMap(key); - }; - Meta.prototype['readable' + capitalized] = function () { - return this[key]; - }; - } - - Meta.prototype._getOrCreateOwnMap = function (key) { - var ret = this[key]; - if (!ret) { - ret = this[key] = new _emberUtils.EmptyObject(); - } - return ret; - }; - - // Implements a member that is a lazily created POJO with inheritable - // values. - function inheritedMap(name, Meta) { - var key = memberProperty(name); - var capitalized = capitalize(name); - - Meta.prototype['write' + capitalized] = function (subkey, value) { - _emberMetalDebug.assert('Cannot call write' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); - - var map = this._getOrCreateOwnMap(key); - map[subkey] = value; - }; - - Meta.prototype['peek' + capitalized] = function (subkey) { - return this._findInherited(key, subkey); - }; - - Meta.prototype['forEach' + capitalized] = function (fn) { - var pointer = this; - var seen = new _emberUtils.EmptyObject(); - while (pointer !== undefined) { - var map = pointer[key]; - if (map) { - for (var _key in map) { - if (!seen[_key]) { - seen[_key] = true; - fn(_key, map[_key]); - } - } - } - pointer = pointer.parent; - } - }; - - Meta.prototype['clear' + capitalized] = function () { - _emberMetalDebug.assert('Cannot call clear' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); - - this[key] = undefined; - }; - - Meta.prototype['deleteFrom' + capitalized] = function (subkey) { - delete this._getOrCreateOwnMap(key)[subkey]; - }; - - Meta.prototype['hasIn' + capitalized] = function (subkey) { - return this._findInherited(key, subkey) !== undefined; - }; - } - - Meta.prototype._getInherited = function (key) { - var pointer = this; - while (pointer !== undefined) { - if (pointer[key]) { - return pointer[key]; - } - pointer = pointer.parent; - } - }; - - Meta.prototype._findInherited = function (key, subkey) { - var pointer = this; - while (pointer !== undefined) { - var map = pointer[key]; - if (map) { - var value = map[subkey]; - if (value !== undefined) { - return value; - } - } - pointer = pointer.parent; - } - }; - - var UNDEFINED = _emberUtils.symbol('undefined'); - - exports.UNDEFINED = UNDEFINED; - // Implements a member that provides a lazily created map of maps, - // with inheritance at both levels. - Meta.prototype.writeDeps = function writeDeps(subkey, itemkey, value) { - _emberMetalDebug.assert('Cannot call writeDeps after the object is destroyed.', !this.isMetaDestroyed()); - - var outerMap = this._getOrCreateOwnMap('_deps'); - var innerMap = outerMap[subkey]; - if (!innerMap) { - innerMap = outerMap[subkey] = new _emberUtils.EmptyObject(); - } - innerMap[itemkey] = value; - }; - - Meta.prototype.peekDeps = function peekDeps(subkey, itemkey) { - var pointer = this; - while (pointer !== undefined) { - var map = pointer._deps; - if (map) { - var value = map[subkey]; - if (value) { - if (value[itemkey] !== undefined) { - return value[itemkey]; - } - } - } - pointer = pointer.parent; - } - }; - - Meta.prototype.hasDeps = function hasDeps(subkey) { - var pointer = this; - while (pointer !== undefined) { - if (pointer._deps && pointer._deps[subkey]) { - return true; - } - pointer = pointer.parent; - } - return false; - }; - - Meta.prototype.forEachInDeps = function forEachInDeps(subkey, fn) { - return this._forEachIn('_deps', subkey, fn); - }; - - Meta.prototype._forEachIn = function (key, subkey, fn) { - var pointer = this; - var seen = new _emberUtils.EmptyObject(); - var calls = []; - while (pointer !== undefined) { - var map = pointer[key]; - if (map) { - var innerMap = map[subkey]; - if (innerMap) { - for (var innerKey in innerMap) { - if (!seen[innerKey]) { - seen[innerKey] = true; - calls.push([innerKey, innerMap[innerKey]]); - } - } - } - } - pointer = pointer.parent; - } - for (var i = 0; i < calls.length; i++) { - var _calls$i = calls[i]; - var innerKey = _calls$i[0]; - var value = _calls$i[1]; - - fn(innerKey, value); - } - }; - - // Implements a member that provides a non-heritable, lazily-created - // object using the method you provide. - function ownCustomObject(name, Meta) { - var key = memberProperty(name); - var capitalized = capitalize(name); - Meta.prototype['writable' + capitalized] = function (create) { - _emberMetalDebug.assert('Cannot call writable' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); - - var ret = this[key]; - if (!ret) { - ret = this[key] = create(this.source); - } - return ret; - }; - Meta.prototype['readable' + capitalized] = function () { - return this[key]; - }; - } - - // Implements a member that provides an inheritable, lazily-created - // object using the method you provide. We will derived children from - // their parents by calling your object's `copy()` method. - function inheritedCustomObject(name, Meta) { - var key = memberProperty(name); - var capitalized = capitalize(name); - Meta.prototype['writable' + capitalized] = function (create) { - _emberMetalDebug.assert('Cannot call writable' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); - - var ret = this[key]; - if (!ret) { - if (this.parent) { - ret = this[key] = this.parent['writable' + capitalized](create).copy(this.source); - } else { - ret = this[key] = create(this.source); - } - } - return ret; - }; - Meta.prototype['readable' + capitalized] = function () { - return this._getInherited(key); - }; - } - - function memberProperty(name) { - return '_' + name; - } - - // there's a more general-purpose capitalize in ember-runtime, but we - // don't want to make ember-metal depend on ember-runtime. - function capitalize(name) { - return name.replace(/^\w/, function (m) { - return m.toUpperCase(); - }); - } - - var META_DESC = { - writable: true, - configurable: true, - enumerable: false, - value: null - }; - - exports.META_DESC = META_DESC; - var EMBER_META_PROPERTY = { - name: META_FIELD, - descriptor: META_DESC - }; - - if (true) { - 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 = _emberUtils.lookupDescriptor(obj, key); - var isMandatorySetter = descriptor && descriptor.set && descriptor.set.isMandatorySetter; - - if (isMandatorySetter) { - this.writeValues(key, value); - } else { - obj[key] = value; - } - }; - } - - var HAS_NATIVE_WEAKMAP = (function () { - // detect if `WeakMap` is even present - var hasWeakMap = typeof WeakMap === 'function'; - if (!hasWeakMap) { - return false; - } - - var instance = new WeakMap(); - // use `Object`'s `.toString` directly to prevent us from detecting - // polyfills as native weakmaps - return Object.prototype.toString.call(instance) === '[object WeakMap]'; - })(); - - var setMeta = undefined, - peekMeta = undefined; - - // choose the one appropriate for given platform - if (HAS_NATIVE_WEAKMAP) { - (function () { - var getPrototypeOf = Object.getPrototypeOf; - var metaStore = new WeakMap(); - - exports.setMeta = setMeta = function WeakMap_setMeta(obj, meta) { - _emberMetalDebug.runInDebug(function () { - return counters.setCalls++; - }); - metaStore.set(obj, meta); - }; - - exports.peekMeta = peekMeta = function WeakMap_peekMeta(obj) { - _emberMetalDebug.runInDebug(function () { - return counters.peekCalls++; - }); - - return metaStore.get(obj); - }; - - exports.peekMeta = peekMeta = function WeakMap_peekParentMeta(obj) { - var pointer = obj; - var meta = undefined; - while (pointer) { - meta = metaStore.get(pointer); - // jshint loopfunc:true - _emberMetalDebug.runInDebug(function () { - return counters.peekCalls++; - }); - // stop if we find a `null` value, since - // that means the meta was deleted - // any other truthy value is a "real" meta - if (meta === null || meta) { - return meta; - } - - pointer = getPrototypeOf(pointer); - _emberMetalDebug.runInDebug(function () { - return counters.peakPrototypeWalks++; - }); - } - }; - })(); - } else { - exports.setMeta = setMeta = function Fallback_setMeta(obj, meta) { - // if `null` already, just set it to the new value - // otherwise define property first - if (obj[META_FIELD] !== null) { - if (obj.__defineNonEnumerable) { - obj.__defineNonEnumerable(EMBER_META_PROPERTY); - } else { - Object.defineProperty(obj, META_FIELD, META_DESC); - } - } - - obj[META_FIELD] = meta; - }; - - exports.peekMeta = peekMeta = function Fallback_peekMeta(obj) { - return obj[META_FIELD]; - }; - } - - function deleteMeta(obj) { - _emberMetalDebug.runInDebug(function () { - return counters.deleteCalls++; - }); - - var meta = peekMeta(obj); - if (meta) { - meta.destroy(); - } - } - - /** - Retrieves the meta hash for an object. If `writable` is true ensures the - hash is writable for this object as well. - - The meta object contains information about computed property descriptors as - well as any watched properties and other information. You generally will - not access this information directly but instead work with higher level - methods that manipulate this hash indirectly. - - @method meta - @for Ember - @private - - @param {Object} obj The object to retrieve meta for - @param {Boolean} [writable=true] Pass `false` if you do not intend to modify - the meta hash, allowing the method to avoid making an unnecessary copy. - @return {Object} the meta hash for an object - */ - - function meta(obj) { - _emberMetalDebug.runInDebug(function () { - return counters.metaCalls++; - }); - - var maybeMeta = peekMeta(obj); - var parent = undefined; - - // remove this code, in-favor of explicit parent - if (maybeMeta) { - if (maybeMeta.source === obj) { - return maybeMeta; - } - parent = maybeMeta; - } - - var newMeta = new Meta(obj, parent); - setMeta(obj, newMeta); - return newMeta; - } - - exports.peekMeta = peekMeta; - exports.setMeta = setMeta; - exports.counters = counters; -}); -enifed('ember-metal/meta_listeners', ['exports'], function (exports) { - /* - When we render a rich template hierarchy, the set of events that - *might* happen tends to be much larger than the set of events that - actually happen. This implies that we should make listener creation & - destruction cheap, even at the cost of making event dispatch more - expensive. - - Thus we store a new listener with a single push and no new - allocations, without even bothering to do deduplication -- we can - save that for dispatch time, if an event actually happens. - */ - - /* listener flags */ - 'use strict'; - - var ONCE = 1; - exports.ONCE = ONCE; - var SUSPENDED = 2; - - exports.SUSPENDED = SUSPENDED; - var protoMethods = { - - addToListeners: function (eventName, target, method, flags) { - if (!this._listeners) { - this._listeners = []; - } - this._listeners.push(eventName, target, method, flags); - }, - - _finalizeListeners: function () { - if (this._listenersFinalized) { - return; - } - if (!this._listeners) { - this._listeners = []; - } - var pointer = this.parent; - while (pointer) { - var listeners = pointer._listeners; - if (listeners) { - this._listeners = this._listeners.concat(listeners); - } - if (pointer._listenersFinalized) { - break; - } - pointer = pointer.parent; - } - this._listenersFinalized = true; - }, - - removeFromListeners: function (eventName, target, method, didRemove) { - var pointer = this; - while (pointer) { - var listeners = pointer._listeners; - if (listeners) { - for (var index = listeners.length - 4; index >= 0; index -= 4) { - if (listeners[index] === eventName && (!method || listeners[index + 1] === target && listeners[index + 2] === method)) { - if (pointer === this) { - // we are modifying our own list, so we edit directly - if (typeof didRemove === 'function') { - didRemove(eventName, target, listeners[index + 2]); - } - listeners.splice(index, 4); - } else { - // we are trying to remove an inherited listener, so we do - // just-in-time copying to detach our own listeners from - // our inheritance chain. - this._finalizeListeners(); - return this.removeFromListeners(eventName, target, method); - } - } - } - } - if (pointer._listenersFinalized) { - break; - } - pointer = pointer.parent; - } - }, - - matchingListeners: function (eventName) { - var pointer = this; - var result = []; - while (pointer) { - var listeners = pointer._listeners; - if (listeners) { - for (var index = 0; index < listeners.length - 3; index += 4) { - if (listeners[index] === eventName) { - pushUniqueListener(result, listeners, index); - } - } - } - if (pointer._listenersFinalized) { - break; - } - pointer = pointer.parent; - } - var sus = this._suspendedListeners; - if (sus) { - for (var susIndex = 0; susIndex < sus.length - 2; susIndex += 3) { - if (eventName === sus[susIndex]) { - for (var resultIndex = 0; resultIndex < result.length - 2; resultIndex += 3) { - if (result[resultIndex] === sus[susIndex + 1] && result[resultIndex + 1] === sus[susIndex + 2]) { - result[resultIndex + 2] |= SUSPENDED; - } - } - } - } - } - return result; - }, - - suspendListeners: function (eventNames, target, method, callback) { - var sus = this._suspendedListeners; - if (!sus) { - sus = this._suspendedListeners = []; - } - for (var i = 0; i < eventNames.length; i++) { - sus.push(eventNames[i], target, method); - } - try { - return callback.call(target); - } finally { - if (sus.length === eventNames.length) { - this._suspendedListeners = undefined; - } else { - for (var i = sus.length - 3; i >= 0; i -= 3) { - if (sus[i + 1] === target && sus[i + 2] === method && eventNames.indexOf(sus[i]) !== -1) { - sus.splice(i, 3); - } - } - } - } - }, - - watchedEvents: function () { - var pointer = this; - var names = {}; - while (pointer) { - var listeners = pointer._listeners; - if (listeners) { - for (var index = 0; index < listeners.length - 3; index += 4) { - names[listeners[index]] = true; - } - } - if (pointer._listenersFinalized) { - break; - } - pointer = pointer.parent; - } - return Object.keys(names); - }, - - _initializeListeners: function () { - this._listeners = undefined; - this._listenersFinalized = undefined; - this._suspendedListeners = undefined; - } - }; - - exports.protoMethods = protoMethods; - function pushUniqueListener(destination, source, index) { - var target = source[index + 1]; - var method = source[index + 2]; - for (var destinationIndex = 0; destinationIndex < destination.length - 2; destinationIndex += 3) { - if (destination[destinationIndex] === target && destination[destinationIndex + 1] === method) { - return; - } - } - destination.push(target, method, source[index + 3]); - } -}); -enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'ember-metal/debug', 'ember-metal/meta', 'ember-metal/expand_properties', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/binding', 'ember-metal/observer', 'ember-metal/events'], function (exports, _emberUtils, _emberMetalError, _emberMetalDebug, _emberMetalMeta, _emberMetalExpand_properties, _emberMetalProperties, _emberMetalComputed, _emberMetalBinding, _emberMetalObserver, _emberMetalEvents) { - 'no use strict'; - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - - /** - @module ember - @submodule ember-metal - */ - exports.detectBinding = detectBinding; - exports.mixin = mixin; - exports.default = Mixin; - exports.hasUnprocessedMixins = hasUnprocessedMixins; - exports.clearUnprocessedMixins = clearUnprocessedMixins; - exports.required = required; - exports.aliasMethod = aliasMethod; - exports.observer = observer; - exports._immediateObserver = _immediateObserver; - exports._beforeObserver = _beforeObserver; - - function ROOT() {} - ROOT.__hasSuper = false; - - var a_slice = [].slice; - - function isMethod(obj) { - return 'function' === typeof obj && obj.isMethod !== false && obj !== Boolean && obj !== Object && obj !== Number && obj !== Array && obj !== Date && obj !== String; - } - - var CONTINUE = {}; - - function mixinProperties(mixinsMeta, mixin) { - var guid = undefined; - - if (mixin instanceof Mixin) { - guid = _emberUtils.guidFor(mixin); - if (mixinsMeta.peekMixins(guid)) { - return CONTINUE; - } - mixinsMeta.writeMixins(guid, mixin); - return mixin.properties; - } else { - return mixin; // apply anonymous mixin properties - } - } - - function concatenatedMixinProperties(concatProp, props, values, base) { - var concats = undefined; - - // reset before adding each new mixin to pickup concats from previous - concats = values[concatProp] || base[concatProp]; - if (props[concatProp]) { - concats = concats ? concats.concat(props[concatProp]) : props[concatProp]; - } - - return concats; - } - - function giveDescriptorSuper(meta, key, property, values, descs, base) { - var superProperty = undefined; - - // Computed properties override methods, and do not call super to them - if (values[key] === undefined) { - // Find the original descriptor in a parent mixin - superProperty = descs[key]; - } - - // If we didn't find the original descriptor in a parent mixin, find - // it on the original object. - if (!superProperty) { - var possibleDesc = base[key]; - var superDesc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - superProperty = superDesc; - } - - if (superProperty === undefined || !(superProperty instanceof _emberMetalComputed.ComputedProperty)) { - return property; - } - - // Since multiple mixins may inherit from the same parent, we need - // to clone the computed property so that other mixins do not receive - // the wrapped version. - property = Object.create(property); - property._getter = _emberUtils.wrap(property._getter, superProperty._getter); - if (superProperty._setter) { - if (property._setter) { - property._setter = _emberUtils.wrap(property._setter, superProperty._setter); - } else { - property._setter = superProperty._setter; - } - } - - return property; - } - - function giveMethodSuper(obj, key, method, values, descs) { - var superMethod = undefined; - - // Methods overwrite computed properties, and do not call super to them. - if (descs[key] === undefined) { - // Find the original method in a parent mixin - superMethod = values[key]; - } - - // If we didn't find the original value in a parent mixin, find it in - // the original object - superMethod = superMethod || obj[key]; - - // Only wrap the new method if the original method was a function - if (superMethod === undefined || 'function' !== typeof superMethod) { - return method; - } - - return _emberUtils.wrap(method, superMethod); - } - - function applyConcatenatedProperties(obj, key, value, values) { - var baseValue = values[key] || obj[key]; - - if (baseValue) { - if ('function' === typeof baseValue.concat) { - if (value === null || value === undefined) { - return baseValue; - } else { - return baseValue.concat(value); - } - } else { - return _emberUtils.makeArray(baseValue).concat(value); - } - } else { - return _emberUtils.makeArray(value); - } - } - - function applyMergedProperties(obj, key, value, values) { - var baseValue = values[key] || obj[key]; - - _emberMetalDebug.runInDebug(function () { - if (Array.isArray(value)) { - // use conditional to avoid stringifying every time - _emberMetalDebug.assert('You passed in `' + JSON.stringify(value) + '` as the value for `' + key + '` but `' + key + '` cannot be an Array', false); - } - }); - - if (!baseValue) { - return value; - } - - var newBase = _emberUtils.assign({}, baseValue); - var hasFunction = false; - - for (var prop in value) { - if (!value.hasOwnProperty(prop)) { - continue; - } - - var propValue = value[prop]; - if (isMethod(propValue)) { - // TODO: support for Computed Properties, etc? - hasFunction = true; - newBase[prop] = giveMethodSuper(obj, prop, propValue, baseValue, {}); - } else { - newBase[prop] = propValue; - } - } - - if (hasFunction) { - newBase._super = ROOT; - } - - return newBase; - } - - function addNormalizedProperty(base, key, value, meta, descs, values, concats, mergings) { - if (value instanceof _emberMetalProperties.Descriptor) { - if (value === REQUIRED && descs[key]) { - return CONTINUE; - } - - // Wrap descriptor function to implement - // _super() if needed - if (value._getter) { - value = giveDescriptorSuper(meta, key, value, values, descs, base); - } - - descs[key] = value; - values[key] = undefined; - } else { - if (concats && concats.indexOf(key) >= 0 || key === 'concatenatedProperties' || key === 'mergedProperties') { - value = applyConcatenatedProperties(base, key, value, values); - } else if (mergings && mergings.indexOf(key) >= 0) { - value = applyMergedProperties(base, key, value, values); - } else if (isMethod(value)) { - value = giveMethodSuper(base, key, value, values, descs); - } - - descs[key] = undefined; - values[key] = value; - } - } - - function mergeMixins(mixins, m, descs, values, base, keys) { - var currentMixin = undefined, - props = undefined, - key = undefined, - concats = undefined, - mergings = undefined; - - function removeKeys(keyName) { - delete descs[keyName]; - delete values[keyName]; - } - - for (var i = 0; i < mixins.length; i++) { - currentMixin = mixins[i]; - _emberMetalDebug.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(currentMixin), typeof currentMixin === 'object' && currentMixin !== null && Object.prototype.toString.call(currentMixin) !== '[object Array]'); - - props = mixinProperties(m, currentMixin); - if (props === CONTINUE) { - continue; - } - - if (props) { - if (base.willMergeMixin) { - base.willMergeMixin(props); - } - concats = concatenatedMixinProperties('concatenatedProperties', props, values, base); - mergings = concatenatedMixinProperties('mergedProperties', props, values, base); - - for (key in props) { - if (!props.hasOwnProperty(key)) { - continue; - } - keys.push(key); - addNormalizedProperty(base, key, props[key], m, descs, values, concats, mergings); - } - - // manually copy toString() because some JS engines do not enumerate it - if (props.hasOwnProperty('toString')) { - base.toString = props.toString; - } - } else if (currentMixin.mixins) { - mergeMixins(currentMixin.mixins, m, descs, values, base, keys); - if (currentMixin._without) { - currentMixin._without.forEach(removeKeys); - } - } - } - } - - function detectBinding(key) { - var length = key.length; - - return length > 7 && key.charCodeAt(length - 7) === 66 && key.indexOf('inding', length - 6) !== -1; - } - - // warm both paths of above function - detectBinding('notbound'); - detectBinding('fooBinding'); - - function connectBindings(obj, m) { - // TODO Mixin.apply(instance) should disconnect binding if exists - m.forEachBindings(function (key, binding) { - if (binding) { - var to = key.slice(0, -7); // strip Binding off end - if (binding instanceof _emberMetalBinding.Binding) { - binding = binding.copy(); // copy prototypes' instance - binding.to(to); - } else { - // binding is string path - binding = new _emberMetalBinding.Binding(to, binding); - } - binding.connect(obj); - obj[key] = binding; - } - }); - // mark as applied - m.clearBindings(); - } - - function finishPartial(obj, m) { - connectBindings(obj, m || _emberMetalMeta.meta(obj)); - return obj; - } - - function followAlias(obj, desc, m, descs, values) { - var altKey = desc.methodName; - var value = undefined; - var possibleDesc = undefined; - if (descs[altKey] || values[altKey]) { - value = values[altKey]; - desc = descs[altKey]; - } else if ((possibleDesc = obj[altKey]) && possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor) { - desc = possibleDesc; - value = undefined; - } else { - desc = undefined; - value = obj[altKey]; - } - - return { desc: desc, value: value }; - } - - function updateObserversAndListeners(obj, key, observerOrListener, pathsKey, updateMethod) { - var paths = observerOrListener[pathsKey]; - - if (paths) { - for (var i = 0; i < paths.length; i++) { - updateMethod(obj, paths[i], null, key); - } - } - } - - function replaceObserversAndListeners(obj, key, observerOrListener) { - var prev = obj[key]; - - if ('function' === typeof prev) { - updateObserversAndListeners(obj, key, prev, '__ember_observesBefore__', _emberMetalObserver._removeBeforeObserver); - updateObserversAndListeners(obj, key, prev, '__ember_observes__', _emberMetalObserver.removeObserver); - updateObserversAndListeners(obj, key, prev, '__ember_listens__', _emberMetalEvents.removeListener); - } - - if ('function' === typeof observerOrListener) { - updateObserversAndListeners(obj, key, observerOrListener, '__ember_observesBefore__', _emberMetalObserver._addBeforeObserver); - updateObserversAndListeners(obj, key, observerOrListener, '__ember_observes__', _emberMetalObserver.addObserver); - updateObserversAndListeners(obj, key, observerOrListener, '__ember_listens__', _emberMetalEvents.addListener); - } - } - - function applyMixin(obj, mixins, partial) { - var descs = {}; - var values = {}; - var m = _emberMetalMeta.meta(obj); - var keys = []; - var key = undefined, - value = undefined, - desc = undefined; - - obj._super = ROOT; - - // Go through all mixins and hashes passed in, and: - // - // * Handle concatenated properties - // * Handle merged properties - // * Set up _super wrapping if necessary - // * Set up computed property descriptors - // * Copying `toString` in broken browsers - mergeMixins(mixins, m, descs, values, obj, keys); - - for (var i = 0; i < keys.length; i++) { - key = keys[i]; - if (key === 'constructor' || !values.hasOwnProperty(key)) { - continue; - } - - desc = descs[key]; - value = values[key]; - - if (desc === REQUIRED) { - continue; - } - - while (desc && desc instanceof Alias) { - var followed = followAlias(obj, desc, m, descs, values); - desc = followed.desc; - value = followed.value; - } - - if (desc === undefined && value === undefined) { - continue; - } - - replaceObserversAndListeners(obj, key, value); - - if (detectBinding(key)) { - m.writeBindings(key, value); - } - - _emberMetalProperties.defineProperty(obj, key, desc, value, m); - } - - if (!partial) { - // don't apply to prototype - finishPartial(obj, m); - } - - return obj; - } - - /** - @method mixin - @for Ember - @param obj - @param mixins* - @return obj - @private - */ - - function mixin(obj) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - applyMixin(obj, args, false); - return obj; - } - - var NAME_KEY = _emberUtils.GUID_KEY + '_name'; - - exports.NAME_KEY = NAME_KEY; - /** - The `Ember.Mixin` class allows you to create mixins, whose properties can be - added to other classes. For instance, - - ```javascript - const EditableMixin = Ember.Mixin.create({ - edit() { - console.log('starting to edit'); - this.set('isEditing', true); - }, - isEditing: false - }); - - // Mix mixins into classes by passing them as the first arguments to - // `.extend.` - const Comment = Ember.Object.extend(EditableMixin, { - post: null - }); - - let comment = Comment.create(post: somePost); - comment.edit(); // outputs 'starting to edit' - ``` - - Note that Mixins are created with `Ember.Mixin.create`, not - `Ember.Mixin.extend`. - - Note that mixins extend a constructor's prototype so arrays and object literals - defined as properties will be shared amongst objects that implement the mixin. - If you want to define a property in a mixin that is not shared, you can define - it either as a computed property or have it be created on initialization of the object. - - ```javascript - // filters array will be shared amongst any object implementing mixin - const FilterableMixin = Ember.Mixin.create({ - filters: Ember.A() - }); - - // filters will be a separate array for every object implementing the mixin - const FilterableMixin = Ember.Mixin.create({ - filters: Ember.computed(function() { - return Ember.A(); - }) - }); - - // filters will be created as a separate array during the object's initialization - const Filterable = Ember.Mixin.create({ - init() { - this._super(...arguments); - this.set("filters", Ember.A()); - } - }); - ``` - - @class Mixin - @namespace Ember - @public - */ - - function Mixin(args, properties) { - this.properties = properties; - - var length = args && args.length; - - if (length > 0) { - var m = new Array(length); - - for (var i = 0; i < length; i++) { - var x = args[i]; - if (x instanceof Mixin) { - m[i] = x; - } else { - m[i] = new Mixin(undefined, x); - } - } - - this.mixins = m; - } else { - this.mixins = undefined; - } - this.ownerConstructor = undefined; - this._without = undefined; - this[_emberUtils.GUID_KEY] = null; - this[NAME_KEY] = null; - _emberMetalDebug.debugSeal(this); - } - - Mixin._apply = applyMixin; - - Mixin.applyPartial = function (obj) { - var args = a_slice.call(arguments, 1); - return applyMixin(obj, args, true); - }; - - Mixin.finishPartial = finishPartial; - - var unprocessedFlag = false; - - function hasUnprocessedMixins() { - return unprocessedFlag; - } - - function clearUnprocessedMixins() { - unprocessedFlag = false; - } - - /** - @method create - @static - @param arguments* - @public - */ - Mixin.create = function () { - // ES6TODO: this relies on a global state? - unprocessedFlag = true; - var M = this; - - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - return new M(args, undefined); - }; - - var MixinPrototype = Mixin.prototype; - - /** - @method reopen - @param arguments* - @private - */ - MixinPrototype.reopen = function () { - var currentMixin = undefined; - - if (this.properties) { - currentMixin = new Mixin(undefined, this.properties); - this.properties = undefined; - this.mixins = [currentMixin]; - } else if (!this.mixins) { - this.mixins = []; - } - - var mixins = this.mixins; - var idx = undefined; - - for (idx = 0; idx < arguments.length; idx++) { - currentMixin = arguments[idx]; - _emberMetalDebug.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(currentMixin), typeof currentMixin === 'object' && currentMixin !== null && Object.prototype.toString.call(currentMixin) !== '[object Array]'); - - if (currentMixin instanceof Mixin) { - mixins.push(currentMixin); - } else { - mixins.push(new Mixin(undefined, currentMixin)); - } - } - - return this; - }; - - /** - @method apply - @param obj - @return applied object - @private - */ - MixinPrototype.apply = function (obj) { - return applyMixin(obj, [this], false); - }; - - MixinPrototype.applyPartial = function (obj) { - return applyMixin(obj, [this], true); - }; - - MixinPrototype.toString = Object.toString; - - function _detect(curMixin, targetMixin, seen) { - var guid = _emberUtils.guidFor(curMixin); - - if (seen[guid]) { - return false; - } - seen[guid] = true; - - if (curMixin === targetMixin) { - return true; - } - var mixins = curMixin.mixins; - var loc = mixins ? mixins.length : 0; - while (--loc >= 0) { - if (_detect(mixins[loc], targetMixin, seen)) { - return true; - } - } - return false; - } - - /** - @method detect - @param obj - @return {Boolean} - @private - */ - MixinPrototype.detect = function (obj) { - if (typeof obj !== 'object' || obj === null) { - return false; - } - if (obj instanceof Mixin) { - return _detect(obj, this, {}); - } - var m = _emberMetalMeta.peekMeta(obj); - if (!m) { - return false; - } - return !!m.peekMixins(_emberUtils.guidFor(this)); - }; - - MixinPrototype.without = function () { - var ret = new Mixin([this]); - - for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - - ret._without = args; - return ret; - }; - - function _keys(ret, mixin, seen) { - if (seen[_emberUtils.guidFor(mixin)]) { - return; - } - seen[_emberUtils.guidFor(mixin)] = true; - - if (mixin.properties) { - var props = Object.keys(mixin.properties); - for (var i = 0; i < props.length; i++) { - var key = props[i]; - ret[key] = true; - } - } else if (mixin.mixins) { - mixin.mixins.forEach(function (x) { - return _keys(ret, x, seen); - }); - } - } - - MixinPrototype.keys = function () { - var keys = {}; - var seen = {}; - - _keys(keys, this, seen); - var ret = Object.keys(keys); - return ret; - }; - - _emberMetalDebug.debugSeal(MixinPrototype); - - // returns the mixins currently applied to the specified object - // TODO: Make Ember.mixin - Mixin.mixins = function (obj) { - var m = _emberMetalMeta.peekMeta(obj); - var ret = []; - if (!m) { - return ret; - } - - m.forEachMixins(function (key, currentMixin) { - // skip primitive mixins since these are always anonymous - if (!currentMixin.properties) { - ret.push(currentMixin); - } - }); - - return ret; - }; - - var REQUIRED = new _emberMetalProperties.Descriptor(); - REQUIRED.toString = function () { - return '(Required Property)'; - }; - - /** - Denotes a required property for a mixin - - @method required - @for Ember - @private - */ - - function required() { - _emberMetalDebug.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; - this.methodName = methodName; - } - - Alias.prototype = new _emberMetalProperties.Descriptor(); - - /** - Makes a method available via an additional name. - - ```javascript - App.Person = Ember.Object.extend({ - name: function() { - return 'Tomhuda Katzdale'; - }, - moniker: Ember.aliasMethod('name') - }); - - let goodGuy = App.Person.create(); - - goodGuy.name(); // 'Tomhuda Katzdale' - goodGuy.moniker(); // 'Tomhuda Katzdale' - ``` - - @method aliasMethod - @for Ember - @param {String} methodName name of the method to alias - @public - */ - - function aliasMethod(methodName) { - return new Alias(methodName); - } - - // .......................................................... - // OBSERVER HELPER - // - - /** - Specify a method that observes property changes. - - ```javascript - Ember.Object.extend({ - valueObserver: Ember.observer('value', function() { - // Executes whenever the "value" property changes - }) - }); - ``` - - Also available as `Function.prototype.observes` if prototype extensions are - enabled. - - @method observer - @for Ember - @param {String} propertyNames* - @param {Function} func - @return func - @public - */ - - function observer() { - for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { - args[_key4] = arguments[_key4]; - } - - var func = args.slice(-1)[0]; - var paths = undefined; - - var addWatchedProperty = function (path) { - paths.push(path); - }; - var _paths = args.slice(0, -1); - - if (typeof func !== 'function') { - // revert to old, soft-deprecated argument ordering - _emberMetalDebug.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 _emberMetalError.default('Ember.observer called without a function'); - } - - func.__ember_observes__ = paths; - return func; - } - - /** - Specify a method that observes property changes. - - ```javascript - Ember.Object.extend({ - valueObserver: Ember.immediateObserver('value', function() { - // Executes whenever the "value" property changes - }) - }); - ``` - - In the future, `Ember.observer` may become asynchronous. In this event, - `Ember.immediateObserver` will maintain the synchronous behavior. - - Also available as `Function.prototype.observesImmediately` if prototype extensions are - enabled. - - @method _immediateObserver - @for Ember - @param {String} propertyNames* - @param {Function} func - @deprecated Use `Ember.observer` instead. - @return func - @private - */ - - function _immediateObserver() { - _emberMetalDebug.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; i < arguments.length; i++) { - var arg = arguments[i]; - _emberMetalDebug.assert('Immediate observers must observe internal properties only, not properties on other objects.', typeof arg !== 'string' || arg.indexOf('.') === -1); - } - - return observer.apply(this, arguments); - } - - /** - When observers fire, they are called with the arguments `obj`, `keyName`. - - Note, `@each.property` observer is called per each add or replace of an element - and it's not called with a specific enumeration item. - - A `_beforeObserver` fires before a property changes. - - @method beforeObserver - @for Ember - @param {String} propertyNames* - @param {Function} func - @return func - @deprecated - @private - */ - - function _beforeObserver() { - for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { - args[_key5] = arguments[_key5]; - } - - var func = args.slice(-1)[0]; - var paths = undefined; - - var addWatchedProperty = function (path) { - paths.push(path); - }; - - var _paths = args.slice(0, -1); - - if (typeof func !== 'function') { - // revert to old, soft-deprecated argument ordering - - 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 _emberMetalError.default('_beforeObserver called without a function'); - } - - func.__ember_observesBefore__ = paths; - return func; - } - - exports.Mixin = Mixin; - exports.required = required; - exports.REQUIRED = REQUIRED; -}); -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; - exports._suspendObservers = _suspendObservers; - exports._removeBeforeObserver = _removeBeforeObserver; - - /** - @module ember-metal - */ - - var AFTER_OBSERVERS = ':change'; - var BEFORE_OBSERVERS = ':before'; - - function changeEvent(keyName) { - return keyName + AFTER_OBSERVERS; - } - - function beforeEvent(keyName) { - return keyName + BEFORE_OBSERVERS; - } - - /** - @method addObserver - @for Ember - @param obj - @param {String} _path - @param {Object|Function} target - @param {Function|String} [method] - @public - */ - - function addObserver(obj, _path, target, method) { - _emberMetalEvents.addListener(obj, changeEvent(_path), target, method); - _emberMetalWatching.watch(obj, _path); - - return this; - } - - function observersFor(obj, path) { - return _emberMetalEvents.listenersFor(obj, changeEvent(path)); - } - - /** - @method removeObserver - @for Ember - @param obj - @param {String} path - @param {Object|Function} target - @param {Function|String} [method] - @public - */ - - function removeObserver(obj, path, target, method) { - _emberMetalWatching.unwatch(obj, path); - _emberMetalEvents.removeListener(obj, changeEvent(path), target, method); - - return this; - } - - /** - @method _addBeforeObserver - @for Ember - @param obj - @param {String} path - @param {Object|Function} target - @param {Function|String} [method] - @deprecated - @private - */ - - function _addBeforeObserver(obj, path, target, method) { - _emberMetalEvents.addListener(obj, beforeEvent(path), target, method); - _emberMetalWatching.watch(obj, path); - - return this; - } - - // Suspend observer during callback. - // - // This should only be used by the target of the observer - // while it is setting the observed path. - - function _suspendObserver(obj, path, target, method, callback) { - return _emberMetalEvents.suspendListener(obj, changeEvent(path), target, method, callback); - } - - function _suspendObservers(obj, paths, target, method, callback) { - var events = paths.map(changeEvent); - return _emberMetalEvents.suspendListeners(obj, events, target, method, callback); - } - - /** - @method removeBeforeObserver - @for Ember - @param obj - @param {String} path - @param {Object|Function} target - @param {Function|String} [method] - @deprecated - @private - */ - - function _removeBeforeObserver(obj, path, target, method) { - _emberMetalWatching.unwatch(obj, path); - _emberMetalEvents.removeListener(obj, beforeEvent(path), target, method); - - return this; - } -}); -enifed('ember-metal/observer_set', ['exports', 'ember-utils', 'ember-metal/events'], function (exports, _emberUtils, _emberMetalEvents) { - 'use strict'; - - exports.default = ObserverSet; - - /* - this.observerSet = { - [senderGuid]: { // variable name: `keySet` - [keyName]: listIndex - } - }, - this.observers = [ - { - sender: obj, - keyName: keyName, - eventName: eventName, - listeners: [ - [target, method, flags] - ] - }, - ... - ] - */ - - function ObserverSet() { - this.clear(); - } - - ObserverSet.prototype.add = function (sender, keyName, eventName) { - var observerSet = this.observerSet; - var observers = this.observers; - var senderGuid = _emberUtils.guidFor(sender); - var keySet = observerSet[senderGuid]; - var index = undefined; - - if (!keySet) { - observerSet[senderGuid] = keySet = {}; - } - index = keySet[keyName]; - if (index === undefined) { - index = observers.push({ - sender: sender, - keyName: keyName, - eventName: eventName, - listeners: [] - }) - 1; - keySet[keyName] = index; - } - return observers[index].listeners; - }; - - ObserverSet.prototype.flush = function () { - var observers = this.observers; - var i = undefined, - observer = undefined, - sender = undefined; - this.clear(); - for (i = 0; i < observers.length; ++i) { - observer = observers[i]; - sender = observer.sender; - if (sender.isDestroying || sender.isDestroyed) { - continue; - } - _emberMetalEvents.sendEvent(sender, observer.eventName, [sender, observer.keyName], observer.listeners); - } - }; - - ObserverSet.prototype.clear = function () { - 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; - exports.getTailPath = getTailPath; - - var IS_GLOBAL = /^[A-Z$]/; - var IS_GLOBAL_PATH = /^[A-Z$].*[\.]/; - var HAS_THIS = 'this.'; - - var isGlobalCache = new _emberMetalCache.default(1000, function (key) { - return IS_GLOBAL.test(key); - }); - var isGlobalPathCache = new _emberMetalCache.default(1000, function (key) { - return IS_GLOBAL_PATH.test(key); - }); - var hasThisCache = new _emberMetalCache.default(1000, function (key) { - return key.lastIndexOf(HAS_THIS, 0) === 0; - }); - var firstDotIndexCache = new _emberMetalCache.default(1000, function (key) { - return key.indexOf('.'); - }); - - var firstKeyCache = new _emberMetalCache.default(1000, function (path) { - var index = firstDotIndexCache.get(path); - if (index === -1) { - return path; - } else { - return path.slice(0, index); - } - }); - - var tailPathCache = new _emberMetalCache.default(1000, function (path) { - var index = firstDotIndexCache.get(path); - if (index !== -1) { - return path.slice(index + 1); - } - }); - - var caches = { - isGlobalCache: isGlobalCache, - isGlobalPathCache: isGlobalPathCache, - hasThisCache: hasThisCache, - firstDotIndexCache: firstDotIndexCache, - firstKeyCache: firstKeyCache, - tailPathCache: tailPathCache - }; - - exports.caches = caches; - - function isGlobal(path) { - return isGlobalCache.get(path); - } - - function isGlobalPath(path) { - return isGlobalPathCache.get(path); - } - - function hasThis(path) { - return hasThisCache.get(path); - } - - function isPath(path) { - return firstDotIndexCache.get(path) !== -1; - } - - function getFirstKey(path) { - return firstKeyCache.get(path); - } - - function getTailPath(path) { - return tailPathCache.get(path); - } -}); -enifed('ember-metal/properties', ['exports', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/meta', 'ember-metal/property_events'], function (exports, _emberMetalDebug, _emberMetalFeatures, _emberMetalMeta, _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.INHERITING_GETTER_FUNCTION = INHERITING_GETTER_FUNCTION; - exports.defineProperty = defineProperty; - - // .......................................................... - // DESCRIPTOR - // - - /** - Objects of this type can implement an interface to respond to requests to - get and set. The default implementation handles simple properties. - - @class Descriptor - @private - */ - - function Descriptor() { - this.isDescriptor = true; - } - - var REDEFINE_SUPPORTED = (function () { - // https://github.com/spalger/kibana/commit/b7e35e6737df585585332857a4c397dc206e7ff9 - var a = Object.create(Object.prototype, { - prop: { - configurable: true, - value: 1 - } - }); - - Object.defineProperty(a, 'prop', { - configurable: true, - value: 2 - }); - - return a.prop === 2; - })(); - // .......................................................... - // DEFINING PROPERTIES API - // - - function MANDATORY_SETTER_FUNCTION(name) { - function SETTER_FUNCTION(value) { - var m = _emberMetalMeta.peekMeta(this); - if (!m.isInitialized(this)) { - m.writeValues(name, value); - } else { - _emberMetalDebug.assert('You must use Ember.set() to set the `' + name + '` property (of ' + this + ') to `' + value + '`.', false); - } - } - - SETTER_FUNCTION.isMandatorySetter = true; - return SETTER_FUNCTION; - } - - function DEFAULT_GETTER_FUNCTION(name) { - return function GETTER_FUNCTION() { - var meta = _emberMetalMeta.peekMeta(this); - return meta && meta.peekValues(name); - }; - } - - function INHERITING_GETTER_FUNCTION(name) { - function IGETTER_FUNCTION() { - var meta = _emberMetalMeta.peekMeta(this); - var val = meta && meta.readInheritedValue('values', name); - - if (val === _emberMetalMeta.UNDEFINED) { - var proto = Object.getPrototypeOf(this); - return proto && proto[name]; - } else { - return val; - } - } - - IGETTER_FUNCTION.isInheritingGetter = true; - return IGETTER_FUNCTION; - } - - /** - NOTE: This is a low-level method used by other parts of the API. You almost - never want to call this method directly. Instead you should use - `Ember.mixin()` to define new properties. - - Defines a property on an object. This method works much like the ES5 - `Object.defineProperty()` method except that it can also accept computed - properties and other special descriptors. - - Normally this method takes only three parameters. However if you pass an - instance of `Descriptor` as the third param then you can pass an - optional value as the fourth parameter. This is often more efficient than - creating new descriptor hashes for each property. - - ## Examples - - ```javascript - // ES5 compatible mode - Ember.defineProperty(contact, 'firstName', { - writable: true, - configurable: false, - enumerable: true, - value: 'Charles' - }); - - // define a simple property - Ember.defineProperty(contact, 'lastName', undefined, 'Jolley'); - - // define a computed property - Ember.defineProperty(contact, 'fullName', Ember.computed('firstName', 'lastName', function() { - return this.firstName+' '+this.lastName; - })); - ``` - - @private - @method defineProperty - @for Ember - @param {Object} obj the object to define this property on. This may be a prototype. - @param {String} keyName the name of the property - @param {Descriptor} [desc] an instance of `Descriptor` (typically a - computed property) or an ES5 descriptor. - You must provide this or `data` but not both. - @param {*} [data] something other than a descriptor, that will - become the explicit value of this property. - */ - - function defineProperty(obj, keyName, desc, data, meta) { - var possibleDesc = undefined, - existingDesc = undefined, - watching = undefined, - value = undefined; - - if (!meta) { - meta = _emberMetalMeta.meta(obj); - } - var watchEntry = meta.peekWatching(keyName); - possibleDesc = obj[keyName]; - existingDesc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - watching = watchEntry !== undefined && watchEntry > 0; - - if (existingDesc) { - existingDesc.teardown(obj, keyName); - } - - if (desc instanceof Descriptor) { - value = desc; - if (true) { - 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; - - if (true) { - 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); - } - } - - // if key is being watched, override chains that - // were initialized with the prototype - if (watching) { - _emberMetalProperty_events.overrideChains(obj, keyName, meta); - } - - // The `value` passed to the `didDefineProperty` hook is - // either the descriptor or data, whichever was passed. - if (obj.didDefineProperty) { - obj.didDefineProperty(obj, keyName, value); - } - - return this; - } - - function handleBrokenPhantomDefineProperty(obj, keyName, desc) { - // https://github.com/ariya/phantomjs/issues/11856 - Object.defineProperty(obj, keyName, { configurable: true, writable: true, value: 'iCry' }); - Object.defineProperty(obj, keyName, desc); - } -}); -enifed('ember-metal/property_events', ['exports', 'ember-utils', 'ember-metal/meta', 'ember-metal/events', 'ember-metal/tags', 'ember-metal/observer_set', 'ember-metal/features', 'ember-metal/transaction'], function (exports, _emberUtils, _emberMetalMeta, _emberMetalEvents, _emberMetalTags, _emberMetalObserver_set, _emberMetalFeatures, _emberMetalTransaction) { - 'use strict'; - - var PROPERTY_DID_CHANGE = _emberUtils.symbol('PROPERTY_DID_CHANGE'); - - exports.PROPERTY_DID_CHANGE = PROPERTY_DID_CHANGE; - var beforeObserverSet = new _emberMetalObserver_set.default(); - var observerSet = new _emberMetalObserver_set.default(); - var deferred = 0; - - // .......................................................... - // PROPERTY CHANGES - // - - /** - This function is called just before an object property is about to change. - It will notify any before observers and prepare caches among other things. - - Normally you will not need to call this method directly but if for some - reason you can't directly watch a property you can invoke this method - manually along with `Ember.propertyDidChange()` which you should call just - after the property value changes. - - @method propertyWillChange - @for Ember - @param {Object} obj The object with the property that will change - @param {String} keyName The property key (or path) that will change. - @return {void} - @private - */ - function propertyWillChange(obj, keyName, _meta) { - var meta = _meta || _emberMetalMeta.peekMeta(obj); - - if (meta && !meta.isInitialized(obj)) { - return; - } - - var watching = meta && meta.peekWatching(keyName) > 0; - var possibleDesc = obj[keyName]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - if (desc && desc.willChange) { - desc.willChange(obj, keyName); - } - - if (watching) { - dependentKeysWillChange(obj, keyName, meta); - chainsWillChange(obj, keyName, meta); - notifyBeforeObservers(obj, keyName, meta); - } - } - - /** - This function is called just after an object property has changed. - It will notify any observers and clear caches among other things. - - Normally you will not need to call this method directly but if for some - reason you can't directly watch a property you can invoke this method - manually along with `Ember.propertyWillChange()` which you should call just - before the property value changes. - - @method propertyDidChange - @for Ember - @param {Object} obj The object with the property that will change - @param {String} keyName The property key (or path) that will change. - @param {Meta} meta The objects meta. - @return {void} - @private - */ - function propertyDidChange(obj, keyName, _meta) { - var meta = _meta || _emberMetalMeta.peekMeta(obj); - - if (meta && !meta.isInitialized(obj)) { - return; - } - - var watching = meta && meta.peekWatching(keyName) > 0; - var possibleDesc = obj[keyName]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - // shouldn't this mean that we're watching this key? - if (desc && desc.didChange) { - desc.didChange(obj, keyName); - } - - if (watching) { - if (meta.hasDeps(keyName)) { - dependentKeysDidChange(obj, keyName, meta); - } - - chainsDidChange(obj, keyName, meta, false); - notifyObservers(obj, keyName, meta); - } - - if (obj[PROPERTY_DID_CHANGE]) { - obj[PROPERTY_DID_CHANGE](keyName); - } - - if (meta && meta.isSourceDestroying()) { - return; - } - - _emberMetalTags.markObjectAsDirty(meta, keyName); - - if (true || true) { - _emberMetalTransaction.assertNotRendered(obj, keyName, meta); - } - } - - var WILL_SEEN = undefined, - DID_SEEN = undefined; - // called whenever a property is about to change to clear the cache of any dependent keys (and notify those properties of changes, etc...) - function dependentKeysWillChange(obj, depKey, meta) { - if (meta && meta.isSourceDestroying()) { - return; - } - - if (meta && meta.hasDeps(depKey)) { - var seen = WILL_SEEN; - var _top = !seen; - - if (_top) { - seen = WILL_SEEN = {}; - } - - iterDeps(propertyWillChange, obj, depKey, seen, meta); - - if (_top) { - WILL_SEEN = null; - } - } - } - - // called whenever a property has just changed to update dependent keys - function dependentKeysDidChange(obj, depKey, meta) { - if (meta && meta.isSourceDestroying()) { - return; - } - - if (meta && meta.hasDeps(depKey)) { - var seen = DID_SEEN; - var _top2 = !seen; - - if (_top2) { - seen = DID_SEEN = {}; - } - - iterDeps(propertyDidChange, obj, depKey, seen, meta); - - if (_top2) { - DID_SEEN = null; - } - } - } - - function iterDeps(method, obj, depKey, seen, meta) { - var possibleDesc = undefined, - desc = undefined; - var guid = _emberUtils.guidFor(obj); - var current = seen[guid]; - - if (!current) { - current = seen[guid] = {}; - } - - if (current[depKey]) { - return; - } - - current[depKey] = true; - - meta.forEachInDeps(depKey, function (key, value) { - if (!value) { - return; - } - - possibleDesc = obj[key]; - desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - if (desc && desc._suspended === obj) { - return; - } - - method(obj, key, meta); - }); - } - - function chainsWillChange(obj, keyName, meta) { - var chainWatchers = meta.readableChainWatchers(); - if (chainWatchers) { - chainWatchers.notify(keyName, false, propertyWillChange); - } - } - - function chainsDidChange(obj, keyName, meta) { - var chainWatchers = meta.readableChainWatchers(); - if (chainWatchers) { - chainWatchers.notify(keyName, true, propertyDidChange); - } - } - - function overrideChains(obj, keyName, meta) { - var chainWatchers = meta.readableChainWatchers(); - if (chainWatchers) { - chainWatchers.revalidate(keyName); - } - } - - /** - @method beginPropertyChanges - @chainable - @private - */ - function beginPropertyChanges() { - deferred++; - } - - /** - @method endPropertyChanges - @private - */ - function endPropertyChanges() { - deferred--; - if (deferred <= 0) { - beforeObserverSet.clear(); - observerSet.flush(); - } - } - - /** - Make a series of property changes together in an - exception-safe way. - - ```javascript - Ember.changeProperties(function() { - obj1.set('foo', mayBlowUpWhenSet); - obj2.set('bar', baz); - }); - ``` - - @method changeProperties - @param {Function} callback - @param [binding] - @private - */ - function changeProperties(callback, binding) { - beginPropertyChanges(); - try { - callback.call(binding); - } finally { - endPropertyChanges.call(binding); - } - } - - function notifyBeforeObservers(obj, keyName, meta) { - if (meta && meta.isSourceDestroying()) { - return; - } - - var eventName = keyName + ':before'; - var listeners = undefined, - added = undefined; - if (deferred) { - listeners = beforeObserverSet.add(obj, keyName, eventName); - added = _emberMetalEvents.accumulateListeners(obj, eventName, listeners); - _emberMetalEvents.sendEvent(obj, eventName, [obj, keyName], added); - } else { - _emberMetalEvents.sendEvent(obj, eventName, [obj, keyName]); - } - } - - function notifyObservers(obj, keyName, meta) { - if (meta && meta.isSourceDestroying()) { - return; - } - - var eventName = keyName + ':change'; - var listeners = undefined; - if (deferred) { - listeners = observerSet.add(obj, keyName, eventName); - _emberMetalEvents.accumulateListeners(obj, eventName, listeners); - } else { - _emberMetalEvents.sendEvent(obj, eventName, [obj, keyName]); - } - } - - exports.propertyWillChange = propertyWillChange; - exports.propertyDidChange = propertyDidChange; - exports.overrideChains = overrideChains; - exports.beginPropertyChanges = beginPropertyChanges; - exports.endPropertyChanges = endPropertyChanges; - exports.changeProperties = changeProperties; -}); -enifed('ember-metal/property_get', ['exports', 'ember-metal/debug', 'ember-metal/path_cache'], function (exports, _emberMetalDebug, _emberMetalPath_cache) { - /** - @module ember-metal - */ - - 'use strict'; - - exports.get = get; - exports._getPath = _getPath; - exports.getWithDefault = getWithDefault; - - var ALLOWABLE_TYPES = { - object: true, - function: true, - string: true - }; - - // .......................................................... - // 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 - // object. - - /** - Gets the value of a property on an object. If the property is computed, - the function will be invoked. If the property is not defined but the - object implements the `unknownProperty` method then that will be invoked. - - ```javascript - Ember.get(obj, "name"); - ``` - - If you plan to run on IE8 and older browsers then you should use this - method anytime you want to retrieve a property on an object that you don't - know for sure is private. (Properties beginning with an underscore '_' - are considered private.) - - On all newer browsers, you only need to use this method to retrieve - properties if the property might not be defined on the object and you want - to respect the `unknownProperty` handler. Otherwise you can ignore this - method. - - Note that if the object itself is `undefined`, this method will throw - an error. - - @method get - @for Ember - @param {Object} obj The object to retrieve from. - @param {String} keyName The property key to retrieve - @return {Object} the property value or `null`. - @public - */ - - function get(obj, keyName) { - _emberMetalDebug.assert('Get must be called with two arguments; an object and a property key', arguments.length === 2); - _emberMetalDebug.assert('Cannot call get with \'' + keyName + '\' on an undefined object.', obj !== undefined && obj !== null); - _emberMetalDebug.assert('The key provided to get must be a string, you passed ' + keyName, typeof keyName === 'string'); - _emberMetalDebug.assert('\'this\' in paths is not supported', !_emberMetalPath_cache.hasThis(keyName)); - _emberMetalDebug.assert('Cannot call `Ember.get` with an empty string', keyName !== ''); - - var value = obj[keyName]; - var desc = value !== null && typeof value === 'object' && value.isDescriptor ? value : undefined; - var ret = undefined; - - if (desc === undefined && _emberMetalPath_cache.isPath(keyName)) { - return _getPath(obj, keyName); - } - - if (desc) { - return desc.get(obj, keyName); - } else { - ret = value; - - if (ret === undefined && 'object' === typeof obj && !(keyName in obj) && 'function' === typeof obj.unknownProperty) { - return obj.unknownProperty(keyName); - } - - return ret; - } - } - - function _getPath(root, path) { - var obj = root; - var parts = path.split('.'); - - for (var i = 0; i < parts.length; i++) { - if (!isGettable(obj)) { - return undefined; - } - - obj = get(obj, parts[i]); - - if (obj && obj.isDestroyed) { - return undefined; - } - } - - return obj; - } - - function isGettable(obj) { - if (obj == null) { - return false; - } - - return ALLOWABLE_TYPES[typeof obj]; - } - - /** - Retrieves the value of a property from an Object, or a default value in the - case that the property returns `undefined`. - - ```javascript - Ember.getWithDefault(person, 'lastName', 'Doe'); - ``` - - @method getWithDefault - @for Ember - @param {Object} obj The object to retrieve from. - @param {String} keyName The name of the property to retrieve - @param {Object} defaultValue The value to return if the property value is undefined - @return {Object} The property value or the defaultValue. - @public - */ - - function getWithDefault(root, key, defaultValue) { - var value = get(root, key); - - if (value === undefined) { - return defaultValue; - } - return value; - } - - exports.default = get; -}); -enifed('ember-metal/property_set', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_events', 'ember-metal/error', 'ember-metal/path_cache', 'ember-metal/meta'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_events, _emberMetalError, _emberMetalPath_cache, _emberMetalMeta) { - 'use strict'; - - exports.set = set; - exports.trySet = trySet; - - /** - 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. - - ```javascript - Ember.set(obj, "name", value); - ``` - - @method set - @for Ember - @param {Object} obj The object to modify. - @param {String} keyName The property key to set - @param {Object} value The value to set - @return {Object} the passed value. - @public - */ - - function set(obj, keyName, value, tolerant) { - _emberMetalDebug.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); - _emberMetalDebug.assert('Cannot call set with \'' + keyName + '\' on an undefined object.', obj && typeof obj === 'object' || typeof obj === 'function'); - _emberMetalDebug.assert('The key provided to set must be a string, you passed ' + keyName, typeof keyName === 'string'); - _emberMetalDebug.assert('\'this\' in paths is not supported', !_emberMetalPath_cache.hasThis(keyName)); - _emberMetalDebug.assert('calling set on destroyed object: ' + _emberUtils.toString(obj) + '.' + keyName + ' = ' + _emberUtils.toString(value), !obj.isDestroyed); - - if (_emberMetalPath_cache.isPath(keyName)) { - return setPath(obj, keyName, value, tolerant); - } - - var meta = _emberMetalMeta.peekMeta(obj); - var possibleDesc = obj[keyName]; - - var desc = undefined, - currentValue = undefined; - if (possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor) { - desc = possibleDesc; - } else { - currentValue = possibleDesc; - } - - if (desc) { - /* computed property */ - desc.set(obj, keyName, value); - } else if (obj.setUnknownProperty && currentValue === undefined && !(keyName in obj)) { - /* unknown property */ - _emberMetalDebug.assert('setUnknownProperty must be a function', typeof obj.setUnknownProperty === 'function'); - obj.setUnknownProperty(keyName, value); - } else if (currentValue === value) { - /* no change */ - return value; - } else { - _emberMetalProperty_events.propertyWillChange(obj, keyName); - - if (true) { - setWithMandatorySetter(meta, obj, keyName, value); - } else { - obj[keyName] = value; - } - - _emberMetalProperty_events.propertyDidChange(obj, keyName); - } - - return value; - } - - if (true) { - 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) { - // get the last part of the path - var keyName = path.slice(path.lastIndexOf('.') + 1); - - // get the first part of the part - path = path === keyName ? keyName : path.slice(0, path.length - (keyName.length + 1)); - - // unless the path is this, look up the first part to - // get the root - if (path !== 'this') { - root = _emberMetalProperty_get._getPath(root, path); - } - - if (!keyName || keyName.length === 0) { - throw new _emberMetalError.default('Property set failed: You passed an empty path'); - } - - if (!root) { - if (tolerant) { - return; - } else { - throw new _emberMetalError.default('Property set failed: object in path "' + path + '" could not be found or was destroyed.'); - } - } - - return set(root, keyName, value); - } - - /** - Error-tolerant form of `Ember.set`. Will not blow up if any part of the - chain is `undefined`, `null`, or destroyed. - - This is primarily used when syncing bindings, which may try to update after - an object has been destroyed. - - @method trySet - @for Ember - @param {Object} root The object to modify. - @param {String} path The property path to set - @param {Object} value The value to set - @public - */ - - function trySet(root, path, value) { - return set(root, path, value, true); - } -}); -enifed("ember-metal/replace", ["exports"], function (exports) { - "use strict"; - - exports.default = replace; - var splice = Array.prototype.splice; - - 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; - var ends = amt; - var count = undefined, - chunk = undefined; - - while (args.length) { - count = ends > size ? size : ends; - if (count <= 0) { - count = 0; - } - - chunk = args.splice(0, size); - chunk = [start, count].concat(chunk); - - start += size; - ends -= count; - - ret = ret.concat(splice.apply(array, chunk)); - } - return ret; - } -}); -enifed('ember-metal/run_loop', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/testing', 'ember-metal/error_handler', 'ember-metal/property_events', 'backburner'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalTesting, _emberMetalError_handler, _emberMetalProperty_events, _backburner) { - 'use strict'; - - exports.default = run; - - function onBegin(current) { - run.currentRunLoop = current; - } - - function onEnd(current, next) { - run.currentRunLoop = next; - } - - var onErrorTarget = { - get onerror() { - return _emberMetalError_handler.getOnerror(); - }, - set onerror(handler) { - return _emberMetalError_handler.setOnerror(handler); - } - }; - - var backburner = new _backburner.default(['sync', 'actions', 'destroy'], { - GUID_KEY: _emberUtils.GUID_KEY, - sync: { - before: _emberMetalProperty_events.beginPropertyChanges, - after: _emberMetalProperty_events.endPropertyChanges - }, - defaultQueue: 'actions', - onBegin: onBegin, - onEnd: onEnd, - onErrorTarget: onErrorTarget, - onErrorMethod: 'onerror' - }); - - // .......................................................... - // run - this is ideally the only public API the dev sees - // - - /** - Runs the passed target and method inside of a RunLoop, ensuring any - deferred actions including bindings and views updates are flushed at the - end. - - Normally you should not need to invoke this method yourself. However if - you are implementing raw event handlers when interfacing with other - libraries or plugins, you should probably wrap all of your code inside this - call. - - ```javascript - run(function() { - // code to be executed within a RunLoop - }); - ``` - - @class run - @namespace Ember - @static - @constructor - @param {Object} [target] target of method to call - @param {Function|String} method Method to invoke. - May be a function or a string. If you pass a string - then it will be looked up on the passed target. - @param {Object} [args*] Any additional arguments you wish to pass to the method. - @return {Object} return value from invoking the passed function. - @public - */ - - function run() { - return backburner.run.apply(backburner, arguments); - } - - /** - If no run-loop is present, it creates a new one. If a run loop is - present it will queue itself to run on the existing run-loops action - queue. - - Please note: This is not for normal usage, and should be used sparingly. - - If invoked when not within a run loop: - - ```javascript - run.join(function() { - // creates a new run-loop - }); - ``` - - Alternatively, if called within an existing run loop: - - ```javascript - run(function() { - // creates a new run-loop - run.join(function() { - // joins with the existing run-loop, and queues for invocation on - // the existing run-loops action queue. - }); - }); - ``` - - @method join - @namespace Ember - @param {Object} [target] target of method to call - @param {Function|String} method Method to invoke. - May be a function or a string. If you pass a string - then it will be looked up on the passed target. - @param {Object} [args*] Any additional arguments you wish to pass to the method. - @return {Object} Return value from invoking the passed function. Please note, - when called within an existing loop, no return value is possible. - @public - */ - run.join = function () { - return backburner.join.apply(backburner, arguments); - }; - - /** - Allows you to specify which context to call the specified function in while - adding the execution of that function to the Ember run loop. This ability - makes this method a great way to asynchronously integrate third-party libraries - into your Ember application. - - `run.bind` takes two main arguments, the desired context and the function to - invoke in that context. Any additional arguments will be supplied as arguments - to the function that is passed in. - - Let's use the creation of a TinyMCE component as an example. Currently, - TinyMCE provides a setup configuration option we can use to do some processing - after the TinyMCE instance is initialized but before it is actually rendered. - We can use that setup option to do some additional setup for our component. - The component itself could look something like the following: - - ```javascript - App.RichTextEditorComponent = Ember.Component.extend({ - initializeTinyMCE: Ember.on('didInsertElement', function() { - tinymce.init({ - selector: '#' + this.$().prop('id'), - setup: Ember.run.bind(this, this.setupEditor) - }); - }), - - setupEditor: function(editor) { - this.set('editor', editor); - - editor.on('change', function() { - console.log('content changed!'); - }); - } - }); - ``` - - In this example, we use Ember.run.bind to bind the setupEditor method to the - context of the App.RichTextEditorComponent and to have the invocation of that - method be safely handled and executed by the Ember run loop. - - @method bind - @namespace Ember - @param {Object} [target] target of method to call - @param {Function|String} method Method to invoke. - May be a function or a string. If you pass a string - then it will be looked up on the passed target. - @param {Object} [args*] Any additional arguments you wish to pass to the method. - @return {Function} returns a new function that will always have a particular context - @since 1.4.0 - @public - */ - run.bind = function () { - for (var _len = arguments.length, curried = Array(_len), _key = 0; _key < _len; _key++) { - curried[_key] = arguments[_key]; - } - - return function () { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - return run.join.apply(run, curried.concat(args)); - }; - }; - - run.backburner = backburner; - run.currentRunLoop = null; - run.queues = backburner.queueNames; - - /** - Begins a new RunLoop. Any deferred actions invoked after the begin will - be buffered until you invoke a matching call to `run.end()`. This is - a lower-level way to use a RunLoop instead of using `run()`. - - ```javascript - run.begin(); - // code to be executed within a RunLoop - run.end(); - ``` - - @method begin - @return {void} - @public - */ - run.begin = function () { - backburner.begin(); - }; - - /** - Ends a RunLoop. This must be called sometime after you call - `run.begin()` to flush any deferred actions. This is a lower-level way - to use a RunLoop instead of using `run()`. - - ```javascript - run.begin(); - // code to be executed within a RunLoop - run.end(); - ``` - - @method end - @return {void} - @public - */ - run.end = function () { - backburner.end(); - }; - - /** - Array of named queues. This array determines the order in which queues - are flushed at the end of the RunLoop. You can define your own queues by - simply adding the queue name to this array. Normally you should not need - to inspect or modify this property. - - @property queues - @type Array - @default ['sync', 'actions', 'destroy'] - @private - */ - - /** - Adds the passed target/method and any optional arguments to the named - queue to be executed at the end of the RunLoop. If you have not already - started a RunLoop when calling this method one will be started for you - automatically. - - At the end of a RunLoop, any methods scheduled in this way will be invoked. - Methods will be invoked in an order matching the named queues defined in - the `run.queues` property. - - ```javascript - run.schedule('sync', this, function() { - // this will be executed in the first RunLoop queue, when bindings are synced - console.log('scheduled on sync queue'); - }); - - run.schedule('actions', this, function() { - // this will be executed in the 'actions' queue, after bindings have synced. - console.log('scheduled on actions queue'); - }); - - // Note the functions will be run in order based on the run queues order. - // Output would be: - // scheduled on sync queue - // scheduled on actions queue - ``` - - @method schedule - @param {String} queue The name of the queue to schedule against. - Default queues are 'sync' and 'actions' - @param {Object} [target] target object to use as the context when invoking a method. - @param {String|Function} method The method to invoke. If you pass a string it - will be resolved on the target object at the time the scheduled item is - invoked allowing you to change the target function. - @param {Object} [arguments*] Optional arguments to be passed to the queued method. - @return {*} Timer information for use in cancelling, see `run.cancel`. - @public - */ - run.schedule = function () /* queue, target, method */{ - _emberMetalDebug.assert('You have turned on testing mode, which disabled the run-loop\'s autorun. ' + 'You will need to wrap any code with asynchronous side-effects in a run', run.currentRunLoop || !_emberMetalTesting.isTesting()); - - return backburner.schedule.apply(backburner, arguments); - }; - - // Used by global test teardown - run.hasScheduledTimers = function () { - return backburner.hasTimers(); - }; - - // Used by global test teardown - run.cancelTimers = function () { - backburner.cancelTimers(); - }; - - /** - Immediately flushes any events scheduled in the 'sync' queue. Bindings - use this queue so this method is a useful way to immediately force all - bindings in the application to sync. - - You should call this method anytime you need any changed state to propagate - throughout the app immediately without repainting the UI (which happens - in the later 'render' queue added by the `ember-views` package). - - ```javascript - run.sync(); - ``` - - @method sync - @return {void} - @private - */ - run.sync = function () { - if (backburner.currentInstance) { - backburner.currentInstance.queues.sync.flush(); - } - }; - - /** - Invokes the passed target/method and optional arguments after a specified - period of time. The last parameter of this method must always be a number - of milliseconds. - - You should use this method whenever you need to run some action after a - period of time instead of using `setTimeout()`. This method will ensure that - items that expire during the same script execution cycle all execute - together, which is often more efficient than using a real setTimeout. - - ```javascript - run.later(myContext, function() { - // code here will execute within a RunLoop in about 500ms with this == myContext - }, 500); - ``` - - @method later - @param {Object} [target] target of method to invoke - @param {Function|String} method The method to invoke. - If you pass a string it will be resolved on the - target at the time the method is invoked. - @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 () /*target, method*/{ - return backburner.later.apply(backburner, arguments); - }; - - /** - Schedule a function to run one time during the current RunLoop. This is equivalent - to calling `scheduleOnce` with the "actions" queue. - - @method once - @param {Object} [target] The target of the method to invoke. - @param {Function|String} method The method to invoke. - If you pass a string it will be resolved on the - 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.once = function () { - _emberMetalDebug.assert('You have turned on testing mode, which disabled the run-loop\'s autorun. ' + 'You will need to wrap any code with asynchronous side-effects in a run', run.currentRunLoop || !_emberMetalTesting.isTesting()); - - for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - - args.unshift('actions'); - return backburner.scheduleOnce.apply(backburner, args); - }; - - /** - Schedules a function to run one time in a given queue of the current RunLoop. - Calling this method with the same queue/target/method combination will have - no effect (past the initial call). - - Note that although you can pass optional arguments these will not be - considered when looking for duplicates. New arguments will replace previous - calls. - - ```javascript - function sayHi() { - console.log('hi'); - } - - run(function() { - run.scheduleOnce('afterRender', myContext, sayHi); - run.scheduleOnce('afterRender', myContext, sayHi); - // sayHi will only be executed once, in the afterRender queue of the RunLoop - }); - ``` - - Also note that passing an anonymous function to `run.scheduleOnce` will - not prevent additional calls with an identical anonymous function from - scheduling the items multiple times, e.g.: - - ```javascript - function scheduleIt() { - run.scheduleOnce('actions', myContext, function() { - console.log('Closure'); - }); - } - - scheduleIt(); - scheduleIt(); - - // "Closure" will print twice, even though we're using `run.scheduleOnce`, - // because the function we pass to it is anonymous and won't match the - // previously scheduled operation. - ``` - - Available queues, and their order, can be found at `run.queues` - - @method scheduleOnce - @param {String} [queue] The name of the queue to schedule against. Default queues are 'sync' and 'actions'. - @param {Object} [target] The target of the method to invoke. - @param {Function|String} method The method to invoke. - If you pass a string it will be resolved on the - 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 () /*queue, target, method*/{ - _emberMetalDebug.assert('You have turned on testing mode, which disabled the run-loop\'s autorun. ' + 'You will need to wrap any code with asynchronous side-effects in a run', run.currentRunLoop || !_emberMetalTesting.isTesting()); - return backburner.scheduleOnce.apply(backburner, arguments); - }; - - /** - Schedules an item to run from within a separate run loop, after - control has been returned to the system. This is equivalent to calling - `run.later` with a wait time of 1ms. - - ```javascript - run.next(myContext, function() { - // code to be executed in the next run loop, - // which will be scheduled after the current one - }); - ``` - - Multiple operations scheduled with `run.next` will coalesce - into the same later run loop, along with any other operations - scheduled by `run.later` that expire right around the same - time that `run.next` operations will fire. - - Note that there are often alternatives to using `run.next`. - For instance, if you'd like to schedule an operation to happen - after all DOM element operations have completed within the current - run loop, you can make use of the `afterRender` run loop queue (added - by the `ember-views` package, along with the preceding `render` queue - where all the DOM element operations happen). - - Example: - - ```javascript - export default Ember.Component.extend({ - didInsertElement() { - this._super(...arguments); - run.scheduleOnce('afterRender', this, 'processChildElements'); - }, - - processChildElements() { - // ... do something with component's child component - // elements after they've finished rendering, which - // can't be done within this component's - // `didInsertElement` hook because that gets run - // before the child elements have been added to the DOM. - } - }); - ``` - - One benefit of the above approach compared to using `run.next` is - that you will be able to perform DOM/CSS operations before unprocessed - elements are rendered to the screen, which may prevent flickering or - other artifacts caused by delaying processing until after rendering. - - The other major benefit to the above approach is that `run.next` - introduces an element of non-determinism, which can make things much - harder to test, due to its reliance on `setTimeout`; it's much harder - to guarantee the order of scheduled operations when they are scheduled - outside of the current run loop, i.e. with `run.next`. - - @method next - @param {Object} [target] target of method to invoke - @param {Function|String} method The method to invoke. - If you pass a string it will be resolved on the - 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.next = function () { - for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { - args[_key4] = arguments[_key4]; - } - - args.push(1); - return backburner.later.apply(backburner, args); - }; - - /** - Cancels a scheduled item. Must be a value returned by `run.later()`, - `run.once()`, `run.scheduleOnce()`, `run.next()`, `run.debounce()`, or - `run.throttle()`. - - ```javascript - let runNext = run.next(myContext, function() { - // will not be executed - }); - - run.cancel(runNext); - - let runLater = run.later(myContext, function() { - // will not be executed - }, 500); - - run.cancel(runLater); - - let runScheduleOnce = run.scheduleOnce('afterRender', myContext, function() { - // will not be executed - }); - - run.cancel(runScheduleOnce); - - let runOnce = run.once(myContext, function() { - // will not be executed - }); - - run.cancel(runOnce); - - let throttle = run.throttle(myContext, function() { - // will not be executed - }, 1, false); - - run.cancel(throttle); - - let debounce = run.debounce(myContext, function() { - // will not be executed - }, 1); - - run.cancel(debounce); - - let debounceImmediate = run.debounce(myContext, function() { - // will be executed since we passed in true (immediate) - }, 100, true); - - // the 100ms delay until this method can be called again will be cancelled - run.cancel(debounceImmediate); - ``` - - @method cancel - @param {Object} timer Timer object to cancel - @return {Boolean} true if cancelled or false/undefined if it wasn't found - @public - */ - run.cancel = function (timer) { - return backburner.cancel(timer); - }; - - /** - Delay calling the target method until the debounce period has elapsed - with no additional debounce calls. If `debounce` is called again before - the specified time has elapsed, the timer is reset and the entire period - must pass again before the target method is called. - - This method should be used when an event may be called multiple times - but the action should only be called once when the event is done firing. - A common example is for scroll events where you only want updates to - happen once scrolling has ceased. - - ```javascript - function whoRan() { - console.log(this.name + ' ran.'); - } - - let myContext = { name: 'debounce' }; - - run.debounce(myContext, whoRan, 150); - - // less than 150ms passes - run.debounce(myContext, whoRan, 150); - - // 150ms passes - // whoRan is invoked with context myContext - // console logs 'debounce ran.' one time. - ``` - - Immediate allows you to run the function immediately, but debounce - other calls for this function until the wait time has elapsed. If - `debounce` is called again before the specified time has elapsed, - the timer is reset and the entire period must pass again before - the method can be called again. - - ```javascript - function whoRan() { - console.log(this.name + ' ran.'); - } - - let myContext = { name: 'debounce' }; - - run.debounce(myContext, whoRan, 150, true); - - // console logs 'debounce ran.' one time immediately. - // 100ms passes - run.debounce(myContext, whoRan, 150, true); - - // 150ms passes and nothing else is logged to the console and - // the debouncee is no longer being watched - run.debounce(myContext, whoRan, 150, true); - - // console logs 'debounce ran.' one time immediately. - // 150ms passes and nothing else is logged to the console and - // the debouncee is no longer being watched - - ``` - - @method debounce - @param {Object} [target] target of method to invoke - @param {Function|String} method The method to invoke. - May be a function or a string. If you pass a string - then it will be looked up on the passed target. - @param {Object} [args*] Optional arguments to pass to the timeout. - @param {Number} wait Number of milliseconds to wait. - @param {Boolean} immediate Trigger the function on the leading instead - of the trailing edge of the wait interval. Defaults to false. - @return {Array} Timer information for use in cancelling, see `run.cancel`. - @public - */ - run.debounce = function () { - return backburner.debounce.apply(backburner, arguments); - }; - - /** - Ensure that the target method is never called more frequently than - the specified spacing period. The target method is called immediately. - - ```javascript - function whoRan() { - console.log(this.name + ' ran.'); - } - - let myContext = { name: 'throttle' }; - - run.throttle(myContext, whoRan, 150); - // whoRan is invoked with context myContext - // console logs 'throttle ran.' - - // 50ms passes - run.throttle(myContext, whoRan, 150); - - // 50ms passes - run.throttle(myContext, whoRan, 150); - - // 150ms passes - run.throttle(myContext, whoRan, 150); - // whoRan is invoked with context myContext - // console logs 'throttle ran.' - ``` - - @method throttle - @param {Object} [target] target of method to invoke - @param {Function|String} method The method to invoke. - May be a function or a string. If you pass a string - then it will be looked up on the passed target. - @param {Object} [args*] Optional arguments to pass to the timeout. - @param {Number} spacing Number of milliseconds to space out requests. - @param {Boolean} immediate Trigger the function on the leading instead - of the trailing edge of the wait interval. Defaults to true. - @return {Array} Timer information for use in cancelling, see `run.cancel`. - @public - */ - run.throttle = function () { - return backburner.throttle.apply(backburner, arguments); - }; - - /** - Add a new named queue after the specified queue. - - The queue to add will only be added once. - - @method _addQueue - @param {String} name the name of the queue to add. - @param {String} after the name of the queue to add after. - @private - */ - run._addQueue = function (name, after) { - if (run.queues.indexOf(name) === -1) { - run.queues.splice(run.queues.indexOf(after) + 1, 0, name); - } - }; -}); -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 - observers will be buffered. - - ```javascript - let anObject = Ember.Object.create(); - - anObject.setProperties({ - firstName: 'Stanley', - lastName: 'Stuart', - age: 21 - }); - ``` - - @method setProperties - @param obj - @param {Object} properties - @return properties - @public - */ - - function setProperties(obj, properties) { - if (!properties || typeof properties !== 'object') { - return properties; - } - _emberMetalProperty_events.changeProperties(function () { - var props = Object.keys(properties); - var propertyName = undefined; - - for (var i = 0; i < props.length; i++) { - propertyName = props[i]; - - _emberMetalProperty_set.set(obj, propertyName, properties[propertyName]); - } - }); - return properties; - } -}); -enifed('ember-metal/tags', ['exports', 'glimmer-reference', 'ember-metal/meta', 'require', 'ember-metal/is_proxy'], function (exports, _glimmerReference, _emberMetalMeta, _require, _emberMetalIs_proxy) { - 'use strict'; - - exports.setHasViews = setHasViews; - exports.tagForProperty = tagForProperty; - exports.tagFor = tagFor; - exports.markObjectAsDirty = markObjectAsDirty; - - var hasViews = function () { - return false; - }; - - function setHasViews(fn) { - hasViews = fn; - } - - function makeTag() { - return new _glimmerReference.DirtyableTag(); - } - - function tagForProperty(object, propertyKey, _meta) { - if (_emberMetalIs_proxy.isProxy(object)) { - return tagFor(object, _meta); - } - - if (typeof object === 'object' && object) { - var meta = _meta || _emberMetalMeta.meta(object); - var tags = meta.writableTags(); - var tag = tags[propertyKey]; - if (tag) { - return tag; - } - - return tags[propertyKey] = makeTag(); - } else { - return _glimmerReference.CONSTANT_TAG; - } - } - - function tagFor(object, _meta) { - if (typeof object === 'object' && object) { - var meta = _meta || _emberMetalMeta.meta(object); - return meta.writableTag(makeTag); - } else { - return _glimmerReference.CONSTANT_TAG; - } - } - - function markObjectAsDirty(meta, propertyKey) { - var objectTag = meta && meta.readableTag(); - - if (objectTag) { - objectTag.dirty(); - } - - var tags = meta && meta.readableTags(); - var propertyTag = tags && tags[propertyKey]; - - if (propertyTag) { - propertyTag.dirty(); - } - - if (objectTag || propertyTag) { - ensureRunloop(); - } - } - - var run = undefined; - - function K() {} - - function ensureRunloop() { - if (!run) { - run = _require.default('ember-metal/run_loop').default; - } - - if (hasViews() && !run.backburner.currentInstance) { - run.schedule('actions', K); - } - } -}); -enifed("ember-metal/testing", ["exports"], function (exports) { - "use strict"; - - exports.isTesting = isTesting; - exports.setTesting = setTesting; - var testing = false; - - function isTesting() { - return testing; - } - - function setTesting(value) { - testing = !!value; - } -}); -enifed('ember-metal/transaction', ['exports', 'ember-metal/meta', 'ember-metal/debug', 'ember-metal/features'], function (exports, _emberMetalMeta, _emberMetalDebug, _emberMetalFeatures) { - 'use strict'; - - var runInTransaction = undefined, - didRender = undefined, - assertNotRendered = undefined; - - var raise = _emberMetalDebug.assert; - if (true) { - raise = function (message, test) { - _emberMetalDebug.deprecate(message, test, { id: 'ember-views.render-double-modify', until: '3.0.0' }); - }; - } - - var implication = undefined; - if (true) { - implication = 'will be removed in Ember 3.0.'; - } else if (true) { - implication = 'is no longer supported. See https://github.com/emberjs/ember.js/issues/13948 for more details.'; - } - - if (true || true) { - (function () { - var counter = 0; - var inTransaction = false; - var shouldReflush = undefined; - - exports.default = runInTransaction = function (context, methodName) { - shouldReflush = false; - inTransaction = true; - context[methodName](); - inTransaction = false; - counter++; - return shouldReflush; - }; - - exports.didRender = didRender = function (object, key, reference) { - if (!inTransaction) { - return; - } - var meta = _emberMetalMeta.meta(object); - var lastRendered = meta.writableLastRendered(); - lastRendered[key] = counter; - - _emberMetalDebug.runInDebug(function () { - var lastRenderedFrom = meta.writableLastRenderedFrom(); - lastRenderedFrom[key] = reference; - }); - }; - - exports.assertNotRendered = assertNotRendered = function (object, key, _meta) { - var meta = _meta || _emberMetalMeta.meta(object); - var lastRendered = meta.readableLastRendered(); - - if (lastRendered && lastRendered[key] === counter) { - raise((function () { - var ref = meta.readableLastRenderedFrom(); - var parts = []; - var lastRef = ref[key]; - - var label = undefined; - - if (lastRef) { - while (lastRef && lastRef._propertyKey) { - parts.unshift(lastRef._propertyKey); - lastRef = lastRef._parentReference; - } - - label = parts.join(); - } else { - label = 'the same value'; - } - - return 'You modified ' + parts.join('.') + ' twice on ' + object + ' in a single render. This was unreliable and slow in Ember 1.x and ' + implication; - })(), false); - - shouldReflush = true; - } - }; - })(); - } else { - exports.default = runInTransaction = function () { - throw new Error('Cannot call runInTransaction without Glimmer'); - }; - - exports.didRender = didRender = function () { - throw new Error('Cannot call didRender without Glimmer'); - }; - - exports.assertNotRendered = assertNotRendered = function () { - throw new Error('Cannot call assertNotRendered without Glimmer'); - }; - } - - exports.default = runInTransaction; - exports.didRender = didRender; - exports.assertNotRendered = assertNotRendered; -}); -enifed('ember-metal/watch_key', ['exports', 'ember-utils', 'ember-metal/features', 'ember-metal/meta', 'ember-metal/properties'], function (exports, _emberUtils, _emberMetalFeatures, _emberMetalMeta, _emberMetalProperties) { - 'use strict'; - - exports.watchKey = watchKey; - exports.unwatchKey = unwatchKey; - - var handleMandatorySetter = undefined; - - function watchKey(obj, keyName, meta) { - if (typeof obj !== 'object' || obj === null) { - return; - } - var m = meta || _emberMetalMeta.meta(obj); - - // activate watching first time - if (!m.peekWatching(keyName)) { - m.writeWatching(keyName, 1); - - var possibleDesc = obj[keyName]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - if (desc && desc.willWatch) { - desc.willWatch(obj, keyName); - } - - if ('function' === typeof obj.willWatchProperty) { - obj.willWatchProperty(keyName); - } - - if (true) { - // NOTE: this is dropped for prod + minified builds - handleMandatorySetter(m, obj, keyName); - } - } else { - m.writeWatching(keyName, (m.peekWatching(keyName) || 0) + 1); - } - } - - if (true) { - (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 = _emberUtils.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) { - if (typeof obj !== 'object' || obj === null) { - return; - } - var meta = _meta || _emberMetalMeta.meta(obj); - - // do nothing of this object has already been destroyed - if (meta.isSourceDestroyed()) { - return; - } - - var count = meta.peekWatching(keyName); - if (count === 1) { - meta.writeWatching(keyName, 0); - - var possibleDesc = obj[keyName]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - if (desc && desc.didUnwatch) { - desc.didUnwatch(obj, keyName); - } - - if ('function' === typeof obj.didUnwatchProperty) { - obj.didUnwatchProperty(keyName); - } - - if (true) { - // 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 = _emberUtils.lookupDescriptor(obj, keyName); - - if (maybeMandatoryDescriptor.set && maybeMandatoryDescriptor.set.isMandatorySetter) { - if (maybeMandatoryDescriptor.get && maybeMandatoryDescriptor.get.isInheritingGetter) { - var possibleValue = meta.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: meta.peekValues(keyName) - }); - meta.deleteFromValues(keyName); - } - } - } - } else if (count > 1) { - meta.writeWatching(keyName, count - 1); - } - } -}); -enifed('ember-metal/watch_path', ['exports', 'ember-metal/meta', 'ember-metal/chains'], function (exports, _emberMetalMeta, _emberMetalChains) { - 'use strict'; - - exports.makeChainNode = makeChainNode; - 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 - // the current object. - function chainsFor(obj, meta) { - return (meta || _emberMetalMeta.meta(obj)).writableChains(makeChainNode); - } - - function makeChainNode(obj) { - return new _emberMetalChains.ChainNode(null, null, obj); - } - - function watchPath(obj, keyPath, meta) { - if (typeof obj !== 'object' || obj === null) { - return; - } - var m = meta || _emberMetalMeta.meta(obj); - var counter = m.peekWatching(keyPath) || 0; - if (!counter) { - // activate watching first time - m.writeWatching(keyPath, 1); - chainsFor(obj, m).add(keyPath); - } else { - m.writeWatching(keyPath, counter + 1); - } - } - - function unwatchPath(obj, keyPath, meta) { - if (typeof obj !== 'object' || obj === null) { - return; - } - var m = meta || _emberMetalMeta.meta(obj); - var counter = m.peekWatching(keyPath) || 0; - - if (counter === 1) { - m.writeWatching(keyPath, 0); - chainsFor(obj, m).remove(keyPath); - } else if (counter > 1) { - m.writeWatching(keyPath, counter - 1); - } - } -}); -enifed('ember-metal/watching', ['exports', 'ember-metal/watch_key', 'ember-metal/watch_path', 'ember-metal/path_cache', 'ember-metal/meta'], function (exports, _emberMetalWatch_key, _emberMetalWatch_path, _emberMetalPath_cache, _emberMetalMeta) { - /** - @module ember-metal - */ - - 'use strict'; - - exports.isWatching = isWatching; - exports.watcherCount = watcherCount; - exports.unwatch = unwatch; - exports.destroy = destroy; - - /** - Starts watching a property on an object. Whenever the property changes, - invokes `Ember.propertyWillChange` and `Ember.propertyDidChange`. This is the - primitive used by observers and dependent keys; usually you will never call - this method directly but instead use higher level methods like - `Ember.addObserver()` - - @private - @method watch - @for Ember - @param obj - @param {String} _keyPath - */ - function watch(obj, _keyPath, m) { - if (!_emberMetalPath_cache.isPath(_keyPath)) { - _emberMetalWatch_key.watchKey(obj, _keyPath, m); - } else { - _emberMetalWatch_path.watchPath(obj, _keyPath, m); - } - } - - exports.watch = watch; - - function isWatching(obj, key) { - if (typeof obj !== 'object' || obj === null) { - return false; - } - var meta = _emberMetalMeta.peekMeta(obj); - return (meta && meta.peekWatching(key)) > 0; - } - - function watcherCount(obj, key) { - var meta = _emberMetalMeta.peekMeta(obj); - return meta && meta.peekWatching(key) || 0; - } - - function unwatch(obj, _keyPath, m) { - if (!_emberMetalPath_cache.isPath(_keyPath)) { - _emberMetalWatch_key.unwatchKey(obj, _keyPath, m); - } else { - _emberMetalWatch_path.unwatchPath(obj, _keyPath, m); - } - } - - /** - Tears down the meta on an object so that it can be garbage collected. - Multiple calls will have no effect. - - @method destroy - @for Ember - @param {Object} obj the object to destroy - @return {void} - @private - */ - - function destroy(obj) { - _emberMetalMeta.deleteMeta(obj); - } -}); -enifed('ember-metal/weak_map', ['exports', 'ember-utils', 'ember-metal/meta'], function (exports, _emberUtils, _emberMetalMeta) { - 'use strict'; - - exports.default = WeakMap; - - var id = 0; - - // Returns whether Type(value) is Object according to the terminology in the spec - function isObject(value) { - return typeof value === 'object' && value !== null || typeof value === 'function'; - } - - /* - * @class Ember.WeakMap - * @public - * @category ember-metal-weakmap - * - * A partial polyfill for [WeakMap](http://www.ecma-international.org/ecma-262/6.0/#sec-weakmap-objects). - * - * There is a small but important caveat. This implementation assumes that the - * weak map will live longer (in the sense of garbage collection) than all of its - * keys, otherwise it is possible to leak the values stored in the weak map. In - * practice, most use cases satisfy this limitation which is why it is included - * in ember-metal. - */ - - function WeakMap(iterable) { - if (!(this instanceof WeakMap)) { - throw new TypeError('Constructor WeakMap requires \'new\''); - } - - this._id = _emberUtils.GUID_KEY + id++; - - if (iterable === null || iterable === undefined) { - return; - } else if (Array.isArray(iterable)) { - for (var i = 0; i < iterable.length; i++) { - var _iterable$i = iterable[i]; - var key = _iterable$i[0]; - var value = _iterable$i[1]; - - this.set(key, value); - } - } else { - throw new TypeError('The weak map constructor polyfill only supports an array argument'); - } - } - - /* - * @method get - * @param key {Object | Function} - * @return {Any} stored value - */ - WeakMap.prototype.get = function (obj) { - if (!isObject(obj)) { - return undefined; - } - - var meta = _emberMetalMeta.peekMeta(obj); - if (meta) { - var map = meta.readableWeak(); - if (map) { - if (map[this._id] === _emberMetalMeta.UNDEFINED) { - return undefined; - } - - return map[this._id]; - } - } - }; - - /* - * @method set - * @param key {Object | Function} - * @param value {Any} - * @return {WeakMap} the weak map - */ - WeakMap.prototype.set = function (obj, value) { - if (!isObject(obj)) { - throw new TypeError('Invalid value used as weak map key'); - } - - if (value === undefined) { - value = _emberMetalMeta.UNDEFINED; - } - - _emberMetalMeta.meta(obj).writableWeak()[this._id] = value; - - return this; - }; - - /* - * @method has - * @param key {Object | Function} - * @return {boolean} if the key exists - */ - WeakMap.prototype.has = function (obj) { - if (!isObject(obj)) { - return false; - } - - var meta = _emberMetalMeta.peekMeta(obj); - if (meta) { - var map = meta.readableWeak(); - if (map) { - return map[this._id] !== undefined; - } - } - - return false; - }; - - /* - * @method delete - * @param key {Object | Function} - * @return {boolean} if the key was deleted - */ - WeakMap.prototype.delete = function (obj) { - if (this.has(obj)) { - delete _emberMetalMeta.meta(obj).writableWeak()[this._id]; - return true; - } else { - return false; - } - }; - - /* - * @method toString - * @return {String} - */ - WeakMap.prototype.toString = function () { - return '[object WeakMap]'; - }; -}); -enifed('ember-routing/ext/controller', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/utils'], function (exports, _emberMetal, _emberRuntime, _emberRoutingUtils) { - 'use strict'; - - /** - @module ember - @submodule ember-routing - */ - - _emberRuntime.ControllerMixin.reopen({ - concatenatedProperties: ['queryParams'], - - /** - Defines which query parameters the controller accepts. - If you give the names `['category','page']` it will bind - the values of these query parameters to the variables - `this.category` and `this.page` - @property queryParams - @public - */ - queryParams: null, - - /** - This property is updated to various different callback functions depending on - the current "state" of the backing route. It is used by - `Ember.Controller.prototype._qpChanged`. - The methods backing each state can be found in the `Ember.Route.prototype._qp` computed - property return value (the `.states` property). The current values are listed here for - the sanity of future travelers: - * `inactive` - This state is used when this controller instance is not part of the active - route heirarchy. Set in `Ember.Route.prototype._reset` (a `router.js` microlib hook) and - `Ember.Route.prototype.actions.finalizeQueryParamChange`. - * `active` - This state is used when this controller instance is part of the active - route heirarchy. Set in `Ember.Route.prototype.actions.finalizeQueryParamChange`. - * `allowOverrides` - This state is used in `Ember.Route.prototype.setup` (`route.js` microlib hook). - @method _qpDelegate - @private - */ - _qpDelegate: null, // set by route - - /** - During `Ember.Route#setup` observers are created to invoke this method - when any of the query params declared in `Ember.Controller#queryParams` property - are changed. - When invoked this method uses the currently active query param update delegate - (see `Ember.Controller.prototype._qpDelegate` for details) and invokes it with - the QP key/value being changed. - @method _qpChanged - @private - */ - _qpChanged: function (controller, _prop) { - var prop = _prop.substr(0, _prop.length - 3); - - var delegate = controller._qpDelegate; - var value = _emberMetal.get(controller, prop); - delegate(prop, value); - }, - - /** - Transition the application into another route. The route may - be either a single route or route path: - ```javascript - aController.transitionToRoute('blogPosts'); - aController.transitionToRoute('blogPosts.recentEntries'); - ``` - Optionally supply a model for the route in question. The model - will be serialized into the URL using the `serialize` hook of - the route: - ```javascript - aController.transitionToRoute('blogPost', aPost); - ``` - If a literal is passed (such as a number or a string), it will - be treated as an identifier instead. In this case, the `model` - hook of the route will be triggered: - ```javascript - aController.transitionToRoute('blogPost', 1); - ``` - Multiple models will be applied last to first recursively up the - route tree. - ```javascript - App.Router.map(function() { - this.route('blogPost', { path: ':blogPostId' }, function() { - this.route('blogComment', { path: ':blogCommentId', resetNamespace: true }); - }); - }); - aController.transitionToRoute('blogComment', aPost, aComment); - aController.transitionToRoute('blogComment', 1, 13); - ``` - It is also possible to pass a URL (a string that starts with a - `/`). This is intended for testing and debugging purposes and - should rarely be used in production code. - ```javascript - aController.transitionToRoute('/'); - aController.transitionToRoute('/blog/post/1/comment/13'); - aController.transitionToRoute('/blog/posts?sort=title'); - ``` - An options hash with a `queryParams` property may be provided as - the final argument to add query parameters to the destination URL. - ```javascript - aController.transitionToRoute('blogPost', 1, { - queryParams: { showComments: 'true' } - }); - // if you just want to transition the query parameters without changing the route - aController.transitionToRoute({ queryParams: { sort: 'date' } }); - ``` - See also [replaceRoute](/api/classes/Ember.ControllerMixin.html#method_replaceRoute). - @param {String} name the name of the route or a URL - @param {...Object} models the model(s) or identifier(s) to be used - while transitioning to the route. - @param {Object} [options] optional hash with a queryParams property - containing a mapping of query parameters - @for Ember.ControllerMixin - @method transitionToRoute - @public - */ - transitionToRoute: function () { - // target may be either another controller or a router - var target = _emberMetal.get(this, 'target'); - var method = target.transitionToRoute || target.transitionTo; - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return method.apply(target, _emberRoutingUtils.prefixRouteNameArg(this, args)); - }, - - /** - Transition into another route while replacing the current URL, if possible. - This will replace the current history entry instead of adding a new one. - Beside that, it is identical to `transitionToRoute` in all other respects. - ```javascript - aController.replaceRoute('blogPosts'); - aController.replaceRoute('blogPosts.recentEntries'); - ``` - Optionally supply a model for the route in question. The model - will be serialized into the URL using the `serialize` hook of - the route: - ```javascript - aController.replaceRoute('blogPost', aPost); - ``` - If a literal is passed (such as a number or a string), it will - be treated as an identifier instead. In this case, the `model` - hook of the route will be triggered: - ```javascript - aController.replaceRoute('blogPost', 1); - ``` - Multiple models will be applied last to first recursively up the - route tree. - ```javascript - App.Router.map(function() { - this.route('blogPost', { path: ':blogPostId' }, function() { - this.route('blogComment', { path: ':blogCommentId', resetNamespace: true }); - }); - }); - aController.replaceRoute('blogComment', aPost, aComment); - aController.replaceRoute('blogComment', 1, 13); - ``` - It is also possible to pass a URL (a string that starts with a - `/`). This is intended for testing and debugging purposes and - should rarely be used in production code. - ```javascript - aController.replaceRoute('/'); - aController.replaceRoute('/blog/post/1/comment/13'); - ``` - @param {String} name the name of the route or a URL - @param {...Object} models the model(s) or identifier(s) to be used - while transitioning to the route. - @for Ember.ControllerMixin - @method replaceRoute - @public - */ - replaceRoute: function () { - // target may be either another controller or a router - var target = _emberMetal.get(this, 'target'); - var method = target.replaceRoute || target.replaceWith; - - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - return method.apply(target, _emberRoutingUtils.prefixRouteNameArg(target, args)); - } - }); - - exports.default = _emberRuntime.ControllerMixin; -}); -enifed('ember-routing/ext/run_loop', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; - - /** - @module ember - @submodule ember-views - */ - - // Add a new named queue after the 'actions' queue (where RSVP promises - // resolve), which is used in router transitions to prevent unnecessary - // loading state entry if all context promises resolve on the - // 'actions' queue first. - _emberMetal.run._addQueue('routerTransitions', 'actions'); -}); -enifed('ember-routing/index', ['exports', '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/system/query_params', 'ember-routing/services/routing', 'ember-routing/system/cache'], function (exports, _emberRoutingExtRun_loop, _emberRoutingExtController, _emberRoutingLocationApi, _emberRoutingLocationNone_location, _emberRoutingLocationHash_location, _emberRoutingLocationHistory_location, _emberRoutingLocationAuto_location, _emberRoutingSystemGenerate_controller, _emberRoutingSystemController_for, _emberRoutingSystemDsl, _emberRoutingSystemRouter, _emberRoutingSystemRoute, _emberRoutingSystemQuery_params, _emberRoutingServicesRouting, _emberRoutingSystemCache) { - /** - @module ember - @submodule ember-routing - */ - - // ES6TODO: Cleanup modules with side-effects below - 'use strict'; - - exports.Location = _emberRoutingLocationApi.default; - exports.NoneLocation = _emberRoutingLocationNone_location.default; - exports.HashLocation = _emberRoutingLocationHash_location.default; - exports.HistoryLocation = _emberRoutingLocationHistory_location.default; - exports.AutoLocation = _emberRoutingLocationAuto_location.default; - exports.generateController = _emberRoutingSystemGenerate_controller.default; - exports.generateControllerFactory = _emberRoutingSystemGenerate_controller.generateControllerFactory; - exports.controllerFor = _emberRoutingSystemController_for.default; - exports.RouterDSL = _emberRoutingSystemDsl.default; - exports.Router = _emberRoutingSystemRouter.default; - exports.Route = _emberRoutingSystemRoute.default; - exports.QueryParams = _emberRoutingSystemQuery_params.default; - exports.RoutingService = _emberRoutingServicesRouting.default; - exports.BucketCache = _emberRoutingSystemCache.default; -}); -enifed('ember-routing/location/api', ['exports', 'ember-metal', 'ember-environment', 'ember-routing/location/util'], function (exports, _emberMetal, _emberEnvironment, _emberRoutingLocationUtil) { - 'use strict'; - - /** - @module ember - @submodule ember-routing - */ - - /** - Ember.Location returns an instance of the correct implementation of - the `location` API. - - ## Implementations - - You can pass an implementation name (`hash`, `history`, `none`) to force a - particular implementation to be used in your application. - - ### HashLocation - - Using `HashLocation` results in URLs with a `#` (hash sign) separating the - server side URL portion of the URL from the portion that is used by Ember. - This relies upon the `hashchange` event existing in the browser. - - Example: - - ```javascript - App.Router.map(function() { - this.route('posts', function() { - this.route('new'); - }); - }); - - App.Router.reopen({ - location: 'hash' - }); - ``` - - This will result in a posts.new url of `/#/posts/new`. - - ### HistoryLocation - - Using `HistoryLocation` results in URLs that are indistinguishable from a - standard URL. This relies upon the browser's `history` API. - - Example: - - ```javascript - App.Router.map(function() { - this.route('posts', function() { - this.route('new'); - }); - }); - - App.Router.reopen({ - location: 'history' - }); - ``` - - This will result in a posts.new url of `/posts/new`. - - Keep in mind that your server must serve the Ember app at all the routes you - define. - - ### AutoLocation - - Using `AutoLocation`, the router will use the best Location class supported by - the browser it is running in. - - Browsers that support the `history` API will use `HistoryLocation`, those that - do not, but still support the `hashchange` event will use `HashLocation`, and - in the rare case neither is supported will use `NoneLocation`. - - Example: - - ```javascript - App.Router.map(function() { - this.route('posts', function() { - this.route('new'); - }); - }); - - App.Router.reopen({ - location: 'auto' - }); - ``` - - This will result in a posts.new url of `/posts/new` for modern browsers that - support the `history` api or `/#/posts/new` for older ones, like Internet - Explorer 9 and below. - - When a user visits a link to your application, they will be automatically - upgraded or downgraded to the appropriate `Location` class, with the URL - transformed accordingly, if needed. - - Keep in mind that since some of your users will use `HistoryLocation`, your - server must serve the Ember app at all the routes you define. - - ### NoneLocation - - Using `NoneLocation` causes Ember to not store the applications URL state - in the actual URL. This is generally used for testing purposes, and is one - of the changes made when calling `App.setupForTesting()`. - - ## Location API - - Each location implementation must provide the following methods: - - * implementation: returns the string name used to reference the implementation. - * getURL: returns the current URL. - * setURL(path): sets the current URL. - * replaceURL(path): replace the current URL (optional). - * onUpdateURL(callback): triggers the callback when the URL changes. - * formatURL(url): formats `url` to be placed into `href` attribute. - * detect() (optional): instructs the location to do any feature detection - necessary. If the location needs to redirect to a different URL, it - can cancel routing by setting the `cancelRouterSetup` property on itself - to `false`. - - Calling setURL or replaceURL will not trigger onUpdateURL callbacks. - - ## Custom implementation - - Ember scans `app/locations/*` for extending the Location API. - - Example: - - ```javascript - import Ember from 'ember'; - - export default Ember.HistoryLocation.extend({ - implementation: 'history-url-logging', - - pushState: function (path) { - console.log(path); - this._super.apply(this, arguments); - } - }); - ``` - - @class Location - @namespace Ember - @static - @private - */ - exports.default = { - /** - This is deprecated in favor of using the container to lookup the location - implementation as desired. - For example: - ```javascript - // Given a location registered as follows: - container.register('location:history-test', HistoryTestLocation); - // You could create a new instance via: - container.lookup('location:history-test'); - ``` - @method create - @param {Object} options - @return {Object} an instance of an implementation of the `location` API - @deprecated Use the container to lookup the location implementation that you - need. - @private - */ - create: function (options) { - var implementation = options && options.implementation; - _emberMetal.assert('Ember.Location.create: you must specify a \'implementation\' option', !!implementation); - - var implementationClass = this.implementations[implementation]; - _emberMetal.assert('Ember.Location.create: ' + implementation + ' is not a valid implementation', !!implementationClass); - - return implementationClass.create.apply(implementationClass, arguments); - }, - - implementations: {}, - _location: _emberEnvironment.environment.location, - - /** - Returns the current `location.hash` by parsing location.href since browsers - inconsistently URL-decode `location.hash`. - https://bugzilla.mozilla.org/show_bug.cgi?id=483304 - @private - @method getHash - @since 1.4.0 - */ - _getHash: function () { - return _emberRoutingLocationUtil.getHash(this.location); - } - }; -}); -enifed('ember-routing/location/auto_location', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-environment', 'ember-routing/location/util'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberEnvironment, _emberRoutingLocationUtil) { - 'use strict'; - - exports.getHistoryPath = getHistoryPath; - exports.getHashPath = getHashPath; - - /** - @module ember - @submodule ember-routing - */ - - /** - Ember.AutoLocation will select the best location option based off browser - support with the priority order: history, hash, none. - - Clean pushState paths accessed by hashchange-only browsers will be redirected - to the hash-equivalent and vice versa so future transitions are consistent. - - Keep in mind that since some of your users will use `HistoryLocation`, your - server must serve the Ember app at all the routes you define. - - @class AutoLocation - @namespace Ember - @static - @private - */ - exports.default = _emberRuntime.Object.extend({ - /** - @private - The browser's `location` object. This is typically equivalent to - `window.location`, but may be overridden for testing. - @property location - @default environment.location - */ - location: _emberEnvironment.environment.location, - - /** - @private - The browser's `history` object. This is typically equivalent to - `window.history`, but may be overridden for testing. - @since 1.5.1 - @property history - @default environment.history - */ - history: _emberEnvironment.environment.history, - - /** - @private - The user agent's global variable. In browsers, this will be `window`. - @since 1.11 - @property global - @default window - */ - global: _emberEnvironment.environment.window, - - /** - @private - The browser's `userAgent`. This is typically equivalent to - `navigator.userAgent`, but may be overridden for testing. - @since 1.5.1 - @property userAgent - @default environment.history - */ - userAgent: _emberEnvironment.environment.userAgent, - - /** - @private - This property is used by the router to know whether to cancel the routing - setup process, which is needed while we redirect the browser. - @since 1.5.1 - @property cancelRouterSetup - @default false - */ - cancelRouterSetup: false, - - /** - @private - Will be pre-pended to path upon state change. - @since 1.5.1 - @property rootURL - @default '/' - */ - rootURL: '/', - - /** - Called by the router to instruct the location to do any feature detection - necessary. In the case of AutoLocation, we detect whether to use history - or hash concrete implementations. - @private - */ - detect: function () { - var rootURL = this.rootURL; - - _emberMetal.assert('rootURL must end with a trailing forward slash e.g. "/app/"', rootURL.charAt(rootURL.length - 1) === '/'); - - var implementation = detectImplementation({ - location: this.location, - history: this.history, - userAgent: this.userAgent, - rootURL: rootURL, - documentMode: this.documentMode, - global: this.global - }); - - if (implementation === false) { - _emberMetal.set(this, 'cancelRouterSetup', true); - implementation = 'none'; - } - - var concrete = _emberUtils.getOwner(this).lookup('location:' + implementation); - _emberMetal.set(concrete, 'rootURL', rootURL); - - _emberMetal.assert('Could not find location \'' + implementation + '\'.', !!concrete); - - _emberMetal.set(this, 'concreteImplementation', concrete); - }, - - initState: delegateToConcreteImplementation('initState'), - getURL: delegateToConcreteImplementation('getURL'), - setURL: delegateToConcreteImplementation('setURL'), - replaceURL: delegateToConcreteImplementation('replaceURL'), - onUpdateURL: delegateToConcreteImplementation('onUpdateURL'), - formatURL: delegateToConcreteImplementation('formatURL'), - - willDestroy: function () { - var concreteImplementation = _emberMetal.get(this, 'concreteImplementation'); - - if (concreteImplementation) { - concreteImplementation.destroy(); - } - } - }); - - function delegateToConcreteImplementation(methodName) { - return function () { - var concreteImplementation = _emberMetal.get(this, 'concreteImplementation'); - _emberMetal.assert('AutoLocation\'s detect() method should be called before calling any other hooks.', !!concreteImplementation); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _emberUtils.tryInvoke(concreteImplementation, methodName, args); - }; - } - - /* - Given the browser's `location`, `history` and `userAgent`, and a configured - root URL, this function detects whether the browser supports the [History - API](https://developer.mozilla.org/en-US/docs/Web/API/History) and returns a - string representing the Location object to use based on its determination. - - For example, if the page loads in an evergreen browser, this function would - return the string "history", meaning the history API and thus HistoryLocation - should be used. If the page is loaded in IE8, it will return the string - "hash," indicating that the History API should be simulated by manipulating the - hash portion of the location. - - */ - - function detectImplementation(options) { - var location = options.location; - var userAgent = options.userAgent; - var history = options.history; - var documentMode = options.documentMode; - var global = options.global; - var rootURL = options.rootURL; - - var implementation = 'none'; - var cancelRouterSetup = false; - var currentPath = _emberRoutingLocationUtil.getFullPath(location); - - if (_emberRoutingLocationUtil.supportsHistory(userAgent, history)) { - var historyPath = getHistoryPath(rootURL, location); - - // If the browser supports history and we have a history path, we can use - // the history location with no redirects. - if (currentPath === historyPath) { - return 'history'; - } else { - if (currentPath.substr(0, 2) === '/#') { - history.replaceState({ path: historyPath }, null, historyPath); - implementation = 'history'; - } else { - cancelRouterSetup = true; - _emberRoutingLocationUtil.replacePath(location, historyPath); - } - } - } else if (_emberRoutingLocationUtil.supportsHashChange(documentMode, global)) { - var hashPath = getHashPath(rootURL, location); - - // Be sure we're using a hashed path, otherwise let's switch over it to so - // we start off clean and consistent. We'll count an index path with no - // hash as "good enough" as well. - if (currentPath === hashPath || currentPath === '/' && hashPath === '/#/') { - implementation = 'hash'; - } else { - // Our URL isn't in the expected hash-supported format, so we want to - // cancel the router setup and replace the URL to start off clean - cancelRouterSetup = true; - _emberRoutingLocationUtil.replacePath(location, hashPath); - } - } - - if (cancelRouterSetup) { - return false; - } - - return implementation; - } - - /** - @private - - Returns the current path as it should appear for HistoryLocation supported - browsers. This may very well differ from the real current path (e.g. if it - starts off as a hashed URL) - */ - - function getHistoryPath(rootURL, location) { - var path = _emberRoutingLocationUtil.getPath(location); - var hash = _emberRoutingLocationUtil.getHash(location); - var query = _emberRoutingLocationUtil.getQuery(location); - var rootURLIndex = path.indexOf(rootURL); - var routeHash = undefined, - hashParts = undefined; - - _emberMetal.assert('Path ' + path + ' does not start with the provided rootURL ' + rootURL, rootURLIndex === 0); - - // By convention, Ember.js routes using HashLocation are required to start - // with `#/`. Anything else should NOT be considered a route and should - // be passed straight through, without transformation. - if (hash.substr(0, 2) === '#/') { - // There could be extra hash segments after the route - hashParts = hash.substr(1).split('#'); - // The first one is always the route url - routeHash = hashParts.shift(); - - // If the path already has a trailing slash, remove the one - // from the hashed route so we don't double up. - if (path.slice(-1) === '/') { - routeHash = routeHash.substr(1); - } - - // This is the "expected" final order - path = path + routeHash + query; - - if (hashParts.length) { - path += '#' + hashParts.join('#'); - } - } else { - path = path + query + hash; - } - - return path; - } - - /** - @private - - Returns the current path as it should appear for HashLocation supported - browsers. This may very well differ from the real current path. - - @method _getHashPath - */ - - function getHashPath(rootURL, location) { - var path = rootURL; - var historyPath = getHistoryPath(rootURL, location); - var routePath = historyPath.substr(rootURL.length); - - if (routePath !== '') { - if (routePath.charAt(0) !== '/') { - routePath = '/' + routePath; - } - - path += '#' + routePath; - } - - return path; - } -}); -enifed('ember-routing/location/hash_location', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/location/api'], function (exports, _emberMetal, _emberRuntime, _emberRoutingLocationApi) { - 'use strict'; - - /** - @module ember - @submodule ember-routing - */ - - /** - `Ember.HashLocation` implements the location API using the browser's - hash. At present, it relies on a `hashchange` event existing in the - browser. - - @class HashLocation - @namespace Ember - @extends Ember.Object - @private - */ - exports.default = _emberRuntime.Object.extend({ - implementation: 'hash', - - init: function () { - _emberMetal.set(this, 'location', _emberMetal.get(this, '_location') || window.location); - - this._hashchangeHandler = undefined; - }, - - /** - @private - Returns normalized location.hash - @since 1.5.1 - @method getHash - */ - getHash: _emberRoutingLocationApi.default._getHash, - - /** - Returns the normalized URL, constructed from `location.hash`. - e.g. `#/foo` => `/foo` as well as `#/foo#bar` => `/foo#bar`. - By convention, hashed paths must begin with a forward slash, otherwise they - are not treated as a path so we can distinguish intent. - @private - @method getURL - */ - getURL: function () { - var originalPath = this.getHash().substr(1); - var outPath = originalPath; - - if (outPath.charAt(0) !== '/') { - outPath = '/'; - - // Only add the # if the path isn't empty. - // We do NOT want `/#` since the ampersand - // is only included (conventionally) when - // the location.hash has a value - if (originalPath) { - outPath += '#' + originalPath; - } - } - - return outPath; - }, - - /** - Set the `location.hash` and remembers what was set. This prevents - `onUpdateURL` callbacks from triggering when the hash was set by - `HashLocation`. - @private - @method setURL - @param path {String} - */ - setURL: function (path) { - _emberMetal.get(this, 'location').hash = path; - _emberMetal.set(this, 'lastSetURL', path); - }, - - /** - Uses location.replace to update the url without a page reload - or history modification. - @private - @method replaceURL - @param path {String} - */ - replaceURL: function (path) { - _emberMetal.get(this, 'location').replace('#' + path); - _emberMetal.set(this, 'lastSetURL', path); - }, - - /** - Register a callback to be invoked when the hash changes. These - callbacks will execute when the user presses the back or forward - button, but not after `setURL` is invoked. - @private - @method onUpdateURL - @param callback {Function} - */ - onUpdateURL: function (callback) { - var _this = this; - - this._removeEventListener(); - - this._hashchangeHandler = function () { - _emberMetal.run(function () { - var path = _this.getURL(); - if (_emberMetal.get(_this, 'lastSetURL') === path) { - return; - } - - _emberMetal.set(_this, 'lastSetURL', null); - - callback(path); - }); - }; - - window.addEventListener('hashchange', this._hashchangeHandler); - }, - - /** - Given a URL, formats it to be placed into the page as part - of an element's `href` attribute. - This is used, for example, when using the {{action}} helper - to generate a URL based on an event. - @private - @method formatURL - @param url {String} - */ - formatURL: function (url) { - return '#' + url; - }, - - /** - Cleans up the HashLocation event listener. - @private - @method willDestroy - */ - willDestroy: function () { - this._removeEventListener(); - }, - - _removeEventListener: function () { - if (this._hashchangeHandler) { - window.removeEventListener('hashchange', this._hashchangeHandler); - } - } - }); -}); -enifed('ember-routing/location/history_location', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/location/api'], function (exports, _emberMetal, _emberRuntime, _emberRoutingLocationApi) { - 'use strict'; - - /** - @module ember - @submodule ember-routing - */ - - var popstateFired = false; - - /** - Ember.HistoryLocation implements the location API using the browser's - history.pushState API. - - @class HistoryLocation - @namespace Ember - @extends Ember.Object - @private - */ - exports.default = _emberRuntime.Object.extend({ - implementation: 'history', - - init: function () { - this._super.apply(this, arguments); - - var base = document.querySelector('base'); - var baseURL = base ? base.getAttribute('href') : ''; - - _emberMetal.set(this, 'baseURL', baseURL); - _emberMetal.set(this, 'location', _emberMetal.get(this, 'location') || window.location); - - this._popstateHandler = undefined; - }, - - /** - Used to set state on first call to setURL - @private - @method initState - */ - initState: function () { - var history = _emberMetal.get(this, 'history') || window.history; - _emberMetal.set(this, 'history', history); - - if (history && 'state' in history) { - this.supportsHistory = true; - } - - this.replaceState(this.formatURL(this.getURL())); - }, - - /** - Will be pre-pended to path upon state change - @property rootURL - @default '/' - @private - */ - rootURL: '/', - - /** - Returns the current `location.pathname` without `rootURL` or `baseURL` - @private - @method getURL - @return url {String} - */ - getURL: function () { - var location = _emberMetal.get(this, 'location'); - var path = location.pathname; - - var rootURL = _emberMetal.get(this, 'rootURL'); - var baseURL = _emberMetal.get(this, 'baseURL'); - - // remove trailing slashes if they exists - rootURL = rootURL.replace(/\/$/, ''); - baseURL = baseURL.replace(/\/$/, ''); - - // remove baseURL and rootURL from start of path - var url = path.replace(new RegExp('^' + baseURL + '(?=/|$)'), '').replace(new RegExp('^' + rootURL + '(?=/|$)'), ''); - - var search = location.search || ''; - url += search; - url += this.getHash(); - - return url; - }, - - /** - Uses `history.pushState` to update the url without a page reload. - @private - @method setURL - @param path {String} - */ - setURL: function (path) { - var state = this.getState(); - path = this.formatURL(path); - - if (!state || state.path !== path) { - this.pushState(path); - } - }, - - /** - Uses `history.replaceState` to update the url without a page reload - or history modification. - @private - @method replaceURL - @param path {String} - */ - replaceURL: function (path) { - var state = this.getState(); - path = this.formatURL(path); - - if (!state || state.path !== path) { - this.replaceState(path); - } - }, - - /** - Get the current `history.state`. Checks for if a polyfill is - required and if so fetches this._historyState. The state returned - from getState may be null if an iframe has changed a window's - history. - @private - @method getState - @return state {Object} - */ - getState: function () { - if (this.supportsHistory) { - return _emberMetal.get(this, 'history').state; - } - - return this._historyState; - }, - - /** - Pushes a new state. - @private - @method pushState - @param path {String} - */ - pushState: function (path) { - var state = { path: path }; - - _emberMetal.get(this, 'history').pushState(state, null, path); - - this._historyState = state; - - // used for webkit workaround - this._previousURL = this.getURL(); - }, - - /** - Replaces the current state. - @private - @method replaceState - @param path {String} - */ - replaceState: function (path) { - var state = { path: path }; - _emberMetal.get(this, 'history').replaceState(state, null, path); - - this._historyState = state; - - // used for webkit workaround - this._previousURL = this.getURL(); - }, - - /** - Register a callback to be invoked whenever the browser - history changes, including using forward and back buttons. - @private - @method onUpdateURL - @param callback {Function} - */ - onUpdateURL: function (callback) { - var _this = this; - - this._removeEventListener(); - - this._popstateHandler = function () { - // Ignore initial page load popstate event in Chrome - if (!popstateFired) { - popstateFired = true; - if (_this.getURL() === _this._previousURL) { - return; - } - } - callback(_this.getURL()); - }; - - window.addEventListener('popstate', this._popstateHandler); - }, - - /** - Used when using `{{action}}` helper. The url is always appended to the rootURL. - @private - @method formatURL - @param url {String} - @return formatted url {String} - */ - formatURL: function (url) { - var rootURL = _emberMetal.get(this, 'rootURL'); - var baseURL = _emberMetal.get(this, 'baseURL'); - - if (url !== '') { - // remove trailing slashes if they exists - rootURL = rootURL.replace(/\/$/, ''); - baseURL = baseURL.replace(/\/$/, ''); - } else if (baseURL.match(/^\//) && rootURL.match(/^\//)) { - // if baseURL and rootURL both start with a slash - // ... remove trailing slash from baseURL if it exists - baseURL = baseURL.replace(/\/$/, ''); - } - - return baseURL + rootURL + url; - }, - - /** - Cleans up the HistoryLocation event listener. - @private - @method willDestroy - */ - willDestroy: function () { - this._removeEventListener(); - }, - - /** - @private - Returns normalized location.hash - @method getHash - */ - getHash: _emberRoutingLocationApi.default._getHash, - - _removeEventListener: function () { - if (this._popstateHandler) { - window.removeEventListener('popstate', this._popstateHandler); - } - } - }); -}); -enifed('ember-routing/location/none_location', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { - 'use strict'; - - /** - @module ember - @submodule ember-routing - */ - - /** - Ember.NoneLocation does not interact with the browser. It is useful for - testing, or when you need to manage state with your Router, but temporarily - don't want it to muck with the URL (for example when you embed your - application in a larger page). - - @class NoneLocation - @namespace Ember - @extends Ember.Object - @private - */ - exports.default = _emberRuntime.Object.extend({ - implementation: 'none', - path: '', - - detect: function () { - var rootURL = this.rootURL; - - _emberMetal.assert('rootURL must end with a trailing forward slash e.g. "/app/"', rootURL.charAt(rootURL.length - 1) === '/'); - }, - - /** - Will be pre-pended to path. - @private - @property rootURL - @default '/' - */ - rootURL: '/', - - /** - Returns the current path without `rootURL`. - @private - @method getURL - @return {String} path - */ - getURL: function () { - var path = _emberMetal.get(this, 'path'); - var rootURL = _emberMetal.get(this, 'rootURL'); - - // remove trailing slashes if they exists - rootURL = rootURL.replace(/\/$/, ''); - - // remove rootURL from url - return path.replace(new RegExp('^' + rootURL + '(?=/|$)'), ''); - }, - - /** - Set the path and remembers what was set. Using this method - to change the path will not invoke the `updateURL` callback. - @private - @method setURL - @param path {String} - */ - setURL: function (path) { - _emberMetal.set(this, 'path', path); - }, - - /** - Register a callback to be invoked when the path changes. These - callbacks will execute when the user presses the back or forward - button, but not after `setURL` is invoked. - @private - @method onUpdateURL - @param callback {Function} - */ - onUpdateURL: function (callback) { - this.updateCallback = callback; - }, - - /** - Sets the path and calls the `updateURL` callback. - @private - @method handleURL - @param callback {Function} - */ - handleURL: function (url) { - _emberMetal.set(this, 'path', url); - this.updateCallback(url); - }, - - /** - Given a URL, formats it to be placed into the page as part - of an element's `href` attribute. - This is used, for example, when using the {{action}} helper - to generate a URL based on an event. - @private - @method formatURL - @param url {String} - @return {String} url - */ - formatURL: function (url) { - var rootURL = _emberMetal.get(this, 'rootURL'); - - if (url !== '') { - // remove trailing slashes if they exists - rootURL = rootURL.replace(/\/$/, ''); - } - - return rootURL + 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; - - function getPath(location) { - var pathname = location.pathname; - // Various versions of IE/Opera don't always return a leading slash - if (pathname.charAt(0) !== '/') { - pathname = '/' + pathname; - } - - return pathname; - } - - /** - @private - - Returns the current `location.search`. - */ - - function getQuery(location) { - return location.search; - } - - /** - @private - - Returns the current `location.hash` by parsing location.href since browsers - inconsistently URL-decode `location.hash`. - - Should be passed the browser's `location` object as the first argument. - - https://bugzilla.mozilla.org/show_bug.cgi?id=483304 - */ - - function getHash(location) { - var href = location.href; - var hashIndex = href.indexOf('#'); - - if (hashIndex === -1) { - return ''; - } else { - return href.substr(hashIndex); - } - } - - function getFullPath(location) { - return getPath(location) + getQuery(location) + getHash(location); - } - - function getOrigin(location) { - var origin = location.origin; - - // Older browsers, especially IE, don't have origin - if (!origin) { - origin = location.protocol + '//' + location.hostname; - - if (location.port) { - origin += ':' + location.port; - } - } - - return origin; - } - - /* - `documentMode` only exist in Internet Explorer, and it's tested because IE8 running in - IE7 compatibility mode claims to support `onhashchange` but actually does not. - - `global` is an object that may have an `onhashchange` property. - - @private - @function supportsHashChange - */ - - function supportsHashChange(documentMode, global) { - return 'onhashchange' in global && (documentMode === undefined || documentMode > 7); - } - - /* - `userAgent` is a user agent string. We use user agent testing here, because - the stock Android browser is known to have buggy versions of the History API, - in some Android versions. - - @private - @function supportsHistory - */ - - function supportsHistory(userAgent, history) { - // Boosted from Modernizr: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js - // The stock browser on Android 2.2 & 2.3, and 4.0.x returns positive on history support - // Unfortunately support is really buggy and there is no clean way to detect - // these bugs, so we fall back to a user agent sniff :( - - // We only want Android 2 and 4.0, stock browser, and not Chrome which identifies - // itself as 'Mobile Safari' as well, nor Windows Phone. - if ((userAgent.indexOf('Android 2.') !== -1 || userAgent.indexOf('Android 4.0') !== -1) && userAgent.indexOf('Mobile Safari') !== -1 && userAgent.indexOf('Chrome') === -1 && userAgent.indexOf('Windows Phone') === -1) { - return false; - } - - return !!(history && 'pushState' in history); - } - - /** - Replaces the current location, making sure we explicitly include the origin - to prevent redirecting to a different origin. - - @private - */ - - function replacePath(location, path) { - location.replace(getOrigin(location) + path); - } -}); -enifed('ember-routing/services/routing', ['exports', 'ember-utils', 'ember-runtime', 'ember-metal', 'ember-routing/utils'], function (exports, _emberUtils, _emberRuntime, _emberMetal, _emberRoutingUtils) { - /** - @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 - the set of API needed for components to control routing without interacting - with router internals. - - @private - @class RoutingService - */ - exports.default = _emberRuntime.Service.extend({ - router: null, - - targetState: _emberRuntime.readOnly('router.targetState'), - currentState: _emberRuntime.readOnly('router.currentState'), - currentRouteName: _emberRuntime.readOnly('router.currentRouteName'), - currentPath: _emberRuntime.readOnly('router.currentPath'), - - availableRoutes: function () { - return Object.keys(_emberMetal.get(this, 'router').router.recognizer.names); - }, - - hasRoute: function (routeName) { - return _emberMetal.get(this, 'router').hasRoute(routeName); - }, - - transitionTo: function (routeName, models, queryParams, shouldReplace) { - var router = _emberMetal.get(this, 'router'); - - var transition = router._doTransition(routeName, models, queryParams); - - if (shouldReplace) { - transition.method('replace'); - } - - return transition; - }, - - normalizeQueryParams: function (routeName, models, queryParams) { - var router = _emberMetal.get(this, 'router'); - router._prepareQueryParams(routeName, models, queryParams); - }, - - generateURL: function (routeName, models, queryParams) { - var router = _emberMetal.get(this, 'router'); - if (!router.router) { - return; - } - - var visibleQueryParams = {}; - _emberUtils.assign(visibleQueryParams, queryParams); - - this.normalizeQueryParams(routeName, models, visibleQueryParams); - - var args = _emberRoutingUtils.routeArgs(routeName, models, visibleQueryParams); - return router.generate.apply(router, args); - }, - - isActiveForRoute: function (contexts, queryParams, routeName, routerState, isCurrentWhenSpecified) { - var router = _emberMetal.get(this, 'router'); - - var handlers = router.router.recognizer.handlersFor(routeName); - var leafName = handlers[handlers.length - 1].handler; - var maximumContexts = numberOfContextsAcceptedByHandler(routeName, handlers); - - // NOTE: any ugliness in the calculation of activeness is largely - // due to the fact that we support automatic normalizing of - // `resource` -> `resource.index`, even though there might be - // dynamic segments / query params defined on `resource.index` - // which complicates (and makes somewhat ambiguous) the calculation - // of activeness for links that link to `resource` instead of - // directly to `resource.index`. - - // if we don't have enough contexts revert back to full route name - // this is because the leaf route will use one of the contexts - if (contexts.length > maximumContexts) { - routeName = leafName; - } - - return routerState.isActiveIntent(routeName, contexts, queryParams, !isCurrentWhenSpecified); - } - }); - - function numberOfContextsAcceptedByHandler(handler, handlerInfos) { - var req = 0; - for (var i = 0; i < handlerInfos.length; i++) { - req = req + handlerInfos[i].names.length; - if (handlerInfos[i].handler === handler) { - break; - } - } - - return req; - } -}); -enifed('ember-routing/system/cache', ['exports', 'ember-utils', 'ember-runtime'], function (exports, _emberUtils, _emberRuntime) { - 'use strict'; - - /** - A two-tiered cache with support for fallback values when doing lookups. - Uses "buckets" and then "keys" to cache values. - - @private - @class BucketCache - */ - exports.default = _emberRuntime.Object.extend({ - init: function () { - this.cache = new _emberUtils.EmptyObject(); - }, - - has: function (bucketKey) { - return !!this.cache[bucketKey]; - }, - - stash: function (bucketKey, key, value) { - var bucket = this.cache[bucketKey]; - - if (!bucket) { - bucket = this.cache[bucketKey] = new _emberUtils.EmptyObject(); - } - - bucket[key] = value; - }, - - lookup: function (bucketKey, prop, defaultValue) { - var cache = this.cache; - if (!this.has(bucketKey)) { - return defaultValue; - } - - var bucket = cache[bucketKey]; - if (prop in bucket && bucket[prop] !== undefined) { - return bucket[prop]; - } else { - return defaultValue; - } - } - }); -}); -enifed("ember-routing/system/controller_for", ["exports"], function (exports) { - /** - @module ember - @submodule ember-routing - */ - - /** - Finds a controller instance. - - @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-utils', 'ember-metal'], function (exports, _emberUtils, _emberMetal) { - 'use strict'; - - /** - @module ember - @submodule ember-routing - */ - - function DSL(name, options) { - this.parent = name; - this.enableLoadingSubstates = options && options.enableLoadingSubstates; - this.matches = []; - this.explicitIndex = undefined; - this.options = options; - } - - exports.default = DSL; - - DSL.prototype = { - route: function (name, options, callback) { - var dummyErrorRoute = '/_unused_dummy_error_path_route_' + name + '/:error'; - if (arguments.length === 2 && typeof options === 'function') { - callback = options; - options = {}; - } - - if (arguments.length === 1) { - options = {}; - } - - _emberMetal.assert('\'' + name + '\' cannot be used as a route name.', (function () { - if (options.overrideNameAssertion === true) { - return true; - } - - return ['array', 'basic', 'object', 'application'].indexOf(name) === -1; - })()); - - if (this.enableLoadingSubstates) { - createRoute(this, name + '_loading', { resetNamespace: options.resetNamespace }); - createRoute(this, name + '_error', { resetNamespace: options.resetNamespace, path: dummyErrorRoute }); - } - - if (callback) { - var fullName = getFullName(this, name, options.resetNamespace); - var dsl = new DSL(fullName, this.options); - - createRoute(dsl, 'loading'); - createRoute(dsl, 'error', { path: dummyErrorRoute }); - - callback.call(dsl); - - createRoute(this, name, options, dsl.generate()); - } else { - createRoute(this, name, options); - } - }, - - push: function (url, name, callback, serialize) { - var parts = name.split('.'); - - if (this.options.engineInfo) { - var localFullName = name.slice(this.options.engineInfo.fullName.length + 1); - var routeInfo = _emberUtils.assign({ localFullName: localFullName }, this.options.engineInfo); - - if (serialize) { - routeInfo.serializeMethod = serialize; - } - - this.options.addRouteForEngine(name, routeInfo); - } else if (serialize) { - throw new Error('Defining a route serializer on route \'' + name + '\' outside an Engine is not allowed.'); - } - - if (url === '' || url === '/' || parts[parts.length - 1] === 'index') { - this.explicitIndex = true; - } - - this.matches.push([url, name, callback]); - }, - - resource: function (name, options, callback) { - if (arguments.length === 2 && typeof options === 'function') { - callback = options; - options = {}; - } - - if (arguments.length === 1) { - options = {}; - } - - options.resetNamespace = true; - _emberMetal.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; - - if (!this.explicitIndex) { - this.route('index', { path: '/' }); - } - - return function (match) { - for (var i = 0; i < dslMatches.length; i++) { - var dslMatch = dslMatches[i]; - match(dslMatch[0]).to(dslMatch[1], dslMatch[2]); - } - }; - } - }; - - function canNest(dsl) { - return dsl.parent && dsl.parent !== 'application'; - } - - function getFullName(dsl, name, resetNamespace) { - if (canNest(dsl) && resetNamespace !== true) { - return dsl.parent + '.' + name; - } else { - return name; - } - } - - function createRoute(dsl, name, options, callback) { - options = options || {}; - - var fullName = getFullName(dsl, name, options.resetNamespace); - - if (typeof options.path !== 'string') { - options.path = '/' + name; - } - - dsl.push(options.path, fullName, callback, options.serialize); - } - - DSL.map = function (callback) { - var dsl = new DSL(); - callback.call(dsl); - return dsl; - }; - - var uuid = 0; - - DSL.prototype.mount = function (_name, _options) { - var options = _options || {}; - var engineRouteMap = this.options.resolveRouteMap(_name); - var name = _name; - - if (options.as) { - name = options.as; - } - - var fullName = getFullName(this, name, options.resetNamespace); - - var engineInfo = { - name: _name, - instanceId: uuid++, - mountPoint: fullName, - fullName: fullName - }; - - var path = options.path; - - if (typeof path !== 'string') { - path = '/' + name; - } - - var callback = undefined; - var dummyErrorRoute = '/_unused_dummy_error_path_route_' + name + '/:error'; - if (engineRouteMap) { - var shouldResetEngineInfo = false; - var oldEngineInfo = this.options.engineInfo; - if (oldEngineInfo) { - shouldResetEngineInfo = true; - this.options.engineInfo = engineInfo; - } - - var optionsForChild = _emberUtils.assign({ engineInfo: engineInfo }, this.options); - var childDSL = new DSL(fullName, optionsForChild); - - createRoute(childDSL, 'loading'); - createRoute(childDSL, 'error', { path: dummyErrorRoute }); - - engineRouteMap.call(childDSL); - - callback = childDSL.generate(); - - if (shouldResetEngineInfo) { - this.options.engineInfo = oldEngineInfo; - } - } - - var localFullName = 'application'; - var routeInfo = _emberUtils.assign({ localFullName: localFullName }, engineInfo); - - if (this.enableLoadingSubstates) { - // These values are important to register the loading routes under their - // proper names for the Router and within the Engine's registry. - var substateName = name + '_loading'; - var _localFullName = 'application_loading'; - var _routeInfo = _emberUtils.assign({ localFullName: _localFullName }, engineInfo); - createRoute(this, substateName, { resetNamespace: options.resetNamespace }); - this.options.addRouteForEngine(substateName, _routeInfo); - - substateName = name + '_error'; - _localFullName = 'application_error'; - _routeInfo = _emberUtils.assign({ localFullName: _localFullName }, engineInfo); - createRoute(this, substateName, { resetNamespace: options.resetNamespace, path: dummyErrorRoute }); - this.options.addRouteForEngine(substateName, _routeInfo); - } - - this.options.addRouteForEngine(fullName, routeInfo); - - this.push(path, fullName, callback); - }; -}); -enifed('ember-routing/system/generate_controller', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; - - exports.generateControllerFactory = generateControllerFactory; - exports.default = generateController; - - /** - @module ember - @submodule ember-routing - */ - - /** - Generates a controller factory - - @for Ember - @method generateControllerFactory - @private - */ - - function generateControllerFactory(owner, controllerName) { - var Factory = owner._lookupFactory('controller:basic').extend({ - isGenerated: true, - toString: function () { - return '(generated ' + controllerName + ' controller)'; - } - }); - - var fullName = 'controller:' + controllerName; - - owner.register(fullName, Factory); - - return Factory; - } - - /** - Generates and instantiates a controller extending from `controller:basic` - if present, or `Ember.Controller` if not. - - @for Ember - @method generateController - @private - @since 1.3.0 - */ - - function generateController(owner, controllerName) { - generateControllerFactory(owner, controllerName); - - var fullName = 'controller:' + controllerName; - var instance = owner.lookup(fullName); - - if (_emberMetal.get(instance, 'namespace.LOG_ACTIVE_GENERATION')) { - _emberMetal.info('generated -> ' + fullName, { fullName: fullName }); - } - - return instance; - } -}); -enifed('ember-routing/system/query_params', ['exports', 'ember-runtime'], function (exports, _emberRuntime) { - 'use strict'; - - exports.default = _emberRuntime.Object.extend({ - isQueryParams: true, - values: null - }); -}); -enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-routing/system/generate_controller', 'ember-routing/utils'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberRoutingSystemGenerate_controller, _emberRoutingUtils) { - 'use strict'; - - exports.defaultSerialize = defaultSerialize; - exports.hasDefaultSerialize = hasDefaultSerialize; - var slice = Array.prototype.slice; - - function K() { - return this; - } - - function defaultSerialize(model, params) { - if (params.length < 1) { - return; - } - if (!model) { - return; - } - - var name = params[0]; - var object = {}; - - if (params.length === 1) { - if (name in model) { - object[name] = _emberMetal.get(model, name); - } else if (/_id$/.test(name)) { - object[name] = _emberMetal.get(model, 'id'); - } - } else { - object = _emberMetal.getProperties(model, params); - } - - return object; - } - - var DEFAULT_SERIALIZE = _emberUtils.symbol('DEFAULT_SERIALIZE'); - - defaultSerialize[DEFAULT_SERIALIZE] = true; - - function hasDefaultSerialize(route) { - return !!route.serialize[DEFAULT_SERIALIZE]; - } - - /** - @module ember - @submodule ember-routing - */ - - /** - The `Ember.Route` class is used to define individual routes. Refer to - the [routing guide](http://emberjs.com/guides/routing/) for documentation. - - @class Route - @namespace Ember - @extends Ember.Object - @uses Ember.ActionHandler - @uses Ember.Evented - @since 1.0.0 - @public - */ - var Route = _emberRuntime.Object.extend(_emberRuntime.ActionHandler, _emberRuntime.Evented, { - /** - Configuration hash for this route's queryParams. The possible - configuration options and their defaults are as follows - (assuming a query param whose controller property is `page`): - ```javascript - queryParams: { - page: { - // By default, controller query param properties don't - // cause a full transition when they are changed, but - // rather only cause the URL to update. Setting - // `refreshModel` to true will cause an "in-place" - // transition to occur, whereby the model hooks for - // this route (and any child routes) will re-fire, allowing - // you to reload models (e.g., from the server) using the - // updated query param values. - refreshModel: false, - // By default, changes to controller query param properties - // cause the URL to update via `pushState`, which means an - // item will be added to the browser's history, allowing - // you to use the back button to restore the app to the - // previous state before the query param property was changed. - // Setting `replace` to true will use `replaceState` (or its - // hash location equivalent), which causes no browser history - // item to be added. This options name and default value are - // the same as the `link-to` helper's `replace` option. - replace: false, - // By default, the query param URL key is the same name as - // the controller property name. Use `as` to specify a - // different URL key. - as: 'page' - } - } - ``` - @property queryParams - @for Ember.Route - @type Object - @since 1.6.0 - @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 - @since 1.0.0 - @public - */ - - /** - Sets the name for this route, including a fully resolved name for routes - inside engines. - @private - @method _setRouteName - @param {String} name - */ - _setRouteName: function (name) { - this.routeName = name; - this.fullRouteName = getEngineRouteName(_emberUtils.getOwner(this), name); - }, - - /** - Populates the QP meta information in the BucketCache. - @private - @method _populateQPMeta - */ - _populateQPMeta: function () { - this._bucketCache.stash('route-meta', this.fullRouteName, this.get('_qp')); - }, - - /** - @private - @property _qp - */ - _qp: _emberMetal.computed(function () { - var _this = this; - - var controllerProto = undefined, - combinedQueryParameterConfiguration = undefined; - - var controllerName = this.controllerName || this.routeName; - var definedControllerClass = _emberUtils.getOwner(this)._lookupFactory('controller:' + controllerName); - var queryParameterConfiguraton = _emberMetal.get(this, 'queryParams'); - var hasRouterDefinedQueryParams = !!Object.keys(queryParameterConfiguraton).length; - - if (definedControllerClass) { - // the developer has authored a controller class in their application for this route - // access the prototype, find its query params and normalize their object shape - // them merge in the query params for the route. As a mergedProperty, Route#queryParams is always - // at least `{}` - controllerProto = definedControllerClass.proto(); - - var controllerDefinedQueryParameterConfiguration = _emberMetal.get(controllerProto, 'queryParams'); - var normalizedControllerQueryParameterConfiguration = _emberRoutingUtils.normalizeControllerQueryParams(controllerDefinedQueryParameterConfiguration); - combinedQueryParameterConfiguration = mergeEachQueryParams(normalizedControllerQueryParameterConfiguration, queryParameterConfiguraton); - } 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(_emberUtils.getOwner(this), controllerName); - controllerProto = generatedControllerClass.proto(); - combinedQueryParameterConfiguration = queryParameterConfiguraton; - } - - var qps = []; - var map = {}; - var propertyNames = []; - - for (var propName in combinedQueryParameterConfiguration) { - if (!combinedQueryParameterConfiguration.hasOwnProperty(propName)) { - continue; - } - - // to support the dubious feature of using unknownProperty - // on queryParams configuration - if (propName === 'unknownProperty' || propName === '_super') { - // possible todo: issue deprecation warning? - continue; - } - - var desc = combinedQueryParameterConfiguration[propName]; - var scope = desc.scope || 'model'; - var parts = undefined; - - if (scope === 'controller') { - parts = []; - } - - var urlKey = desc.as || this.serializeQueryParamKey(propName); - var defaultValue = _emberMetal.get(controllerProto, propName); - - if (Array.isArray(defaultValue)) { - defaultValue = _emberRuntime.A(defaultValue.slice()); - } - - var type = desc.type || _emberRuntime.typeOf(defaultValue); - - var defaultValueSerialized = this.serializeQueryParam(defaultValue, urlKey, type); - var scopedPropertyName = controllerName + ':' + propName; - var qp = { - undecoratedDefaultValue: _emberMetal.get(controllerProto, propName), - defaultValue: defaultValue, - serializedDefaultValue: defaultValueSerialized, - serializedValue: defaultValueSerialized, - - type: type, - urlKey: urlKey, - prop: propName, - scopedPropertyName: scopedPropertyName, - controllerName: controllerName, - route: this, - parts: parts, // provided later when stashNames is called if 'model' scope - values: null, // provided later when setup is called. no idea why. - scope: scope - }; - - map[propName] = map[urlKey] = map[scopedPropertyName] = qp; - qps.push(qp); - propertyNames.push(propName); - } - - return { - qps: qps, - map: map, - propertyNames: propertyNames, - states: { - /* - Called when a query parameter changes in the URL, this route cares - about that query parameter, but the route is not currently - in the active route hierarchy. - */ - inactive: function (prop, value) { - var qp = map[prop]; - _this._qpChanged(prop, value, qp); - }, - /* - Called when a query parameter changes in the URL, this route cares - about that query parameter, and the route is currently - in the active route hierarchy. - */ - active: function (prop, value) { - var qp = map[prop]; - _this._qpChanged(prop, value, qp); - return _this._activeQPChanged(map[prop], value); - }, - /* - Called when a value of a query parameter this route handles changes in a controller - and the route is currently in the active route hierarchy. - */ - allowOverrides: function (prop, value) { - var qp = map[prop]; - _this._qpChanged(prop, value, qp); - return _this._updatingQPChanged(map[prop]); - } - } - }; - }), - - /** - @private - @property _names - */ - _names: null, - - /** - @private - @method _stashNames - */ - _stashNames: function (_handlerInfo, dynamicParent) { - var handlerInfo = _handlerInfo; - if (this._names) { - return; - } - var names = this._names = handlerInfo._names; - - if (!names.length) { - handlerInfo = dynamicParent; - names = handlerInfo && handlerInfo._names || []; - } - - var qps = _emberMetal.get(this, '_qp.qps'); - - var namePaths = new Array(names.length); - for (var a = 0; a < names.length; ++a) { - namePaths[a] = handlerInfo.name + '.' + names[a]; - } - - for (var i = 0; i < qps.length; ++i) { - var qp = qps[i]; - if (qp.scope === 'model') { - qp.parts = namePaths; - } - } - }, - - /** - @private - @property _activeQPChanged - */ - _activeQPChanged: function (qp, value) { - var router = this.router; - router._activeQPChanged(qp.scopedPropertyName, value); - }, - - /** - @private - @method _updatingQPChanged - */ - _updatingQPChanged: function (qp) { - var router = this.router; - router._updatingQPChanged(qp.urlKey); - }, - - mergedProperties: ['queryParams'], - - /** - Returns a hash containing the parameters of an ancestor route. - Example - ```javascript - App.Router.map(function() { - this.route('member', { path: ':name' }, function() { - this.route('interest', { path: ':interest' }); - }); - }); - App.MemberRoute = Ember.Route.extend({ - queryParams: { - memberQp: { refreshModel: true } - } - }); - App.MemberInterestRoute = Ember.Route.extend({ - queryParams: { - interestQp: { refreshModel: true } - }, - model() { - return this.paramsFor('member'); - } - }); - ``` - If we visit `/turing/maths?memberQp=member&interestQp=interest` the model for - the `member.interest` route is hash with: - * `name`: `turing` - * `memberQp`: `member` - @method paramsFor - @param {String} name - @return {Object} hash containing the parameters of the route `name` - @since 1.4.0 - @public - */ - paramsFor: function (name) { - var _this2 = this; - - var route = _emberUtils.getOwner(this).lookup('route:' + name); - - if (!route) { - return {}; - } - - var transition = this.router.router.activeTransition; - var state = transition ? transition.state : this.router.router.state; - - var fullName = route.fullRouteName; - var params = _emberUtils.assign({}, state.params[fullName]); - var queryParams = getQueryParamsFor(route, state); - - return Object.keys(queryParams).reduce(function (params, key) { - _emberMetal.assert('The route \'' + _this2.routeName + '\' has both a dynamic segment and query param with name \'' + key + '\'. Please rename one to avoid collisions.', !params[key]); - params[key] = queryParams[key]; - return params; - }, params); - }, - - /** - Serializes the query parameter key - @method serializeQueryParamKey - @param {String} controllerPropertyName - @private - */ - serializeQueryParamKey: function (controllerPropertyName) { - return controllerPropertyName; - }, - - /** - Serializes value of the query parameter based on defaultValueType - @method serializeQueryParam - @param {Object} value - @param {String} urlKey - @param {String} defaultValueType - @private - */ - serializeQueryParam: function (value, urlKey, defaultValueType) { - // urlKey isn't used here, but anyone overriding - // can use it to provide serialization specific - // to a certain query param. - return this.router._serializeQueryParam(value, defaultValueType); - }, - - /** - Deserializes value of the query parameter based on defaultValueType - @method deserializeQueryParam - @param {Object} value - @param {String} urlKey - @param {String} defaultValueType - @private - */ - deserializeQueryParam: function (value, urlKey, defaultValueType) { - // urlKey isn't used here, but anyone overriding - // can use it to provide deserialization specific - // to a certain query param. - return this.router._deserializeQueryParam(value, defaultValueType); - }, - - /** - @private - @property _optionsForQueryParam - */ - _optionsForQueryParam: function (qp) { - return _emberMetal.get(this, 'queryParams.' + qp.urlKey) || _emberMetal.get(this, 'queryParams.' + qp.prop) || {}; - }, - - /** - A hook you can use to reset controller values either when the model - changes or the route is exiting. - ```javascript - App.ArticlesRoute = Ember.Route.extend({ - // ... - resetController: function(controller, isExiting, transition) { - if (isExiting) { - controller.set('page', 1); - } - } - }); - ``` - @method resetController - @param {Controller} controller instance - @param {Boolean} isExiting - @param {Object} transition - @since 1.7.0 - @public - */ - resetController: K, - - /** - @private - @method exit - */ - exit: function () { - this.deactivate(); - this.trigger('deactivate'); - this.teardownViews(); - }, - - /** - @private - @method _reset - @since 1.7.0 - */ - _reset: function (isExiting, transition) { - var controller = this.controller; - controller._qpDelegate = _emberMetal.get(this, '_qp.states.inactive'); - - this.resetController(controller, isExiting, transition); - }, - - /** - @private - @method enter - */ - enter: function () { - this.connections = []; - this.activate(); - this.trigger('activate'); - }, - - /** - The name of the template to use by default when rendering this routes - template. - ```javascript - let PostsList = Ember.Route.extend({ - templateName: 'posts/list' - }); - App.PostsIndexRoute = PostsList.extend(); - App.PostsArchivedRoute = PostsList.extend(); - ``` - @property templateName - @type String - @default null - @since 1.4.0 - @public - */ - templateName: null, - - /** - The name of the controller to associate with this route. - By default, Ember will lookup a route's controller that matches the name - of the route (i.e. `App.PostController` for `App.PostRoute`). However, - if you would like to define a specific controller to use, you can do so - using this property. - This is useful in many ways, as the controller specified will be: - * passed to the `setupController` method. - * used as the controller for the template being rendered by the route. - * returned from a call to `controllerFor` for the route. - @property controllerName - @type String - @default null - @since 1.4.0 - @public - */ - controllerName: null, - - /** - The `willTransition` action is fired at the beginning of any - attempted transition with a `Transition` object as the sole - argument. This action can be used for aborting, redirecting, - or decorating the transition from the currently active routes. - A good example is preventing navigation when a form is - half-filled out: - ```javascript - App.ContactFormRoute = Ember.Route.extend({ - actions: { - willTransition: function(transition) { - if (this.controller.get('userHasEnteredData')) { - this.controller.displayNavigationConfirm(); - transition.abort(); - } - } - } - }); - ``` - You can also redirect elsewhere by calling - `this.transitionTo('elsewhere')` from within `willTransition`. - Note that `willTransition` will not be fired for the - redirecting `transitionTo`, since `willTransition` doesn't - fire when there is already a transition underway. If you want - subsequent `willTransition` actions to fire for the redirecting - transition, you must first explicitly call - `transition.abort()`. - To allow the `willTransition` event to continue bubbling to the parent - route, use `return true;`. When the `willTransition` method has a - return value of `true` then the parent route's `willTransition` method - will be fired, enabling "bubbling" behavior for the event. - @event willTransition - @param {Transition} transition - @since 1.0.0 - @public - */ - - /** - The `didTransition` action is fired after a transition has - successfully been completed. This occurs after the normal model - hooks (`beforeModel`, `model`, `afterModel`, `setupController`) - have resolved. The `didTransition` action has no arguments, - however, it can be useful for tracking page views or resetting - state on the controller. - ```javascript - App.LoginRoute = Ember.Route.extend({ - actions: { - didTransition: function() { - this.controller.get('errors.base').clear(); - return true; // Bubble the didTransition event - } - } - }); - ``` - @event didTransition - @since 1.2.0 - @public - */ - - /** - The `loading` action is fired on the route when a route's `model` - hook returns a promise that is not already resolved. The current - `Transition` object is the first parameter and the route that - triggered the loading event is the second parameter. - ```javascript - App.ApplicationRoute = Ember.Route.extend({ - actions: { - loading: function(transition, route) { - let controller = this.controllerFor('foo'); - controller.set('currentlyLoading', true); - transition.finally(function() { - controller.set('currentlyLoading', false); - }); - } - } - }); - ``` - @event loading - @param {Transition} transition - @param {Ember.Route} route The route that triggered the loading event - @since 1.2.0 - @public - */ - - /** - When attempting to transition into a route, any of the hooks - may return a promise that rejects, at which point an `error` - action will be fired on the partially-entered routes, allowing - for per-route error handling logic, or shared error handling - logic defined on a parent route. - Here is an example of an error handler that will be invoked - for rejected promises from the various hooks on the route, - as well as any unhandled errors from child routes: - ```javascript - App.AdminRoute = Ember.Route.extend({ - beforeModel: function() { - return Ember.RSVP.reject('bad things!'); - }, - actions: { - error: function(error, transition) { - // Assuming we got here due to the error in `beforeModel`, - // we can expect that error === "bad things!", - // but a promise model rejecting would also - // call this hook, as would any errors encountered - // in `afterModel`. - // The `error` hook is also provided the failed - // `transition`, which can be stored and later - // `.retry()`d if desired. - this.transitionTo('login'); - } - } - }); - ``` - `error` actions that bubble up all the way to `ApplicationRoute` - will fire a default error handler that logs the error. You can - specify your own global default error handler by overriding the - `error` handler on `ApplicationRoute`: - ```javascript - App.ApplicationRoute = Ember.Route.extend({ - actions: { - error: function(error, transition) { - this.controllerFor('banner').displayError(error.message); - } - } - }); - ``` - @event error - @param {Error} error - @param {Transition} transition - @since 1.0.0 - @public - */ - - /** - This event is triggered when the router enters the route. It is - not executed when the model for the route changes. - ```javascript - App.ApplicationRoute = Ember.Route.extend({ - collectAnalytics: function(){ - collectAnalytics(); - }.on('activate') - }); - ``` - @event activate - @since 1.9.0 - @public - */ - - /** - This event is triggered when the router completely exits this - route. It is not executed when the model for the route changes. - ```javascript - App.IndexRoute = Ember.Route.extend({ - trackPageLeaveAnalytics: function(){ - trackPageLeaveAnalytics(); - }.on('deactivate') - }); - ``` - @event deactivate - @since 1.9.0 - @public - */ - - /** - The controller associated with this route. - Example - ```javascript - App.FormRoute = Ember.Route.extend({ - actions: { - willTransition: function(transition) { - if (this.controller.get('userHasEnteredData') && - !confirm('Are you sure you want to abandon progress?')) { - transition.abort(); - } else { - // Bubble the `willTransition` action so that - // parent routes can decide whether or not to abort. - return true; - } - } - } - }); - ``` - @property controller - @type Ember.Controller - @since 1.6.0 - @public - */ - - actions: { - - /** - This action is called when one or more query params have changed. Bubbles. - @method queryParamsDidChange - @param changed {Object} Keys are names of query params that have changed. - @param totalPresent {Object} Keys are names of query params that are currently set. - @param removed {Object} Keys are names of query params that have been removed. - @returns {boolean} - @private - */ - queryParamsDidChange: function (changed, totalPresent, removed) { - var qpMap = _emberMetal.get(this, '_qp').map; - - var totalChanged = Object.keys(changed).concat(Object.keys(removed)); - for (var i = 0; i < totalChanged.length; ++i) { - var qp = qpMap[totalChanged[i]]; - if (qp && _emberMetal.get(this._optionsForQueryParam(qp), 'refreshModel') && this.router.currentState) { - this.refresh(); - } - } - - return true; - }, - - finalizeQueryParamChange: function (params, finalParams, transition) { - if (this.fullRouteName !== 'application') { - return true; - } - - // Transition object is absent for intermediate transitions. - if (!transition) { - return; - } - - var handlerInfos = transition.state.handlerInfos; - var router = this.router; - var qpMeta = router._queryParamsFor(handlerInfos); - var changes = router._qpUpdates; - var replaceUrl = undefined; - - _emberRoutingUtils.stashParamNames(router, handlerInfos); - - for (var i = 0; i < qpMeta.qps.length; ++i) { - var qp = qpMeta.qps[i]; - var route = qp.route; - var controller = route.controller; - var presentKey = qp.urlKey in params && qp.urlKey; - - // Do a reverse lookup to see if the changed query - // param URL key corresponds to a QP property on - // this controller. - var value = undefined, - svalue = undefined; - if (changes && qp.urlKey in changes) { - // Value updated in/before setupController - value = _emberMetal.get(controller, qp.prop); - svalue = route.serializeQueryParam(value, qp.urlKey, qp.type); - } else { - if (presentKey) { - svalue = params[presentKey]; - value = route.deserializeQueryParam(svalue, qp.urlKey, qp.type); - } else { - // No QP provided; use default value. - svalue = qp.serializedDefaultValue; - value = copyDefaultValue(qp.defaultValue); - } - } - - controller._qpDelegate = _emberMetal.get(route, '_qp.states.inactive'); - - var thisQueryParamChanged = svalue !== qp.serializedValue; - if (thisQueryParamChanged) { - if (transition.queryParamsOnly && replaceUrl !== false) { - var options = route._optionsForQueryParam(qp); - var replaceConfigValue = _emberMetal.get(options, 'replace'); - if (replaceConfigValue) { - replaceUrl = true; - } else if (replaceConfigValue === false) { - // Explicit pushState wins over any other replaceStates. - replaceUrl = false; - } - } - - _emberMetal.set(controller, qp.prop, value); - } - - // Stash current serialized value of controller. - qp.serializedValue = svalue; - - var thisQueryParamHasDefaultValue = qp.serializedDefaultValue === svalue; - if (!thisQueryParamHasDefaultValue) { - finalParams.push({ - value: svalue, - visible: true, - key: presentKey || qp.urlKey - }); - } - } - - if (replaceUrl) { - transition.method('replace'); - } - - qpMeta.qps.forEach(function (qp) { - var routeQpMeta = _emberMetal.get(qp.route, '_qp'); - var finalizedController = qp.route.controller; - finalizedController._qpDelegate = _emberMetal.get(routeQpMeta, 'states.active'); - }); - - router._qpUpdates = 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 - @since 1.0.0 - @public - */ - deactivate: K, - - /** - This hook is executed when the router enters the route. It is not executed - when the model for the route changes. - @method activate - @since 1.0.0 - @public - */ - activate: K, - - /** - Transition the application into another route. The route may - be either a single route or route path: - ```javascript - this.transitionTo('blogPosts'); - this.transitionTo('blogPosts.recentEntries'); - ``` - Optionally supply a model for the route in question. The model - will be serialized into the URL using the `serialize` hook of - the route: - ```javascript - this.transitionTo('blogPost', aPost); - ``` - If a literal is passed (such as a number or a string), it will - be treated as an identifier instead. In this case, the `model` - hook of the route will be triggered: - ```javascript - this.transitionTo('blogPost', 1); - ``` - Multiple models will be applied last to first recursively up the - route tree. - ```javascript - App.Router.map(function() { - this.route('blogPost', { path:':blogPostId' }, function() { - this.route('blogComment', { path: ':blogCommentId', resetNamespace: true }); - }); - }); - this.transitionTo('blogComment', aPost, aComment); - this.transitionTo('blogComment', 1, 13); - ``` - It is also possible to pass a URL (a string that starts with a - `/`). This is intended for testing and debugging purposes and - should rarely be used in production code. - ```javascript - this.transitionTo('/'); - this.transitionTo('/blog/post/1/comment/13'); - this.transitionTo('/blog/posts?sort=title'); - ``` - An options hash with a `queryParams` property may be provided as - the final argument to add query parameters to the destination URL. - ```javascript - this.transitionTo('blogPost', 1, { - queryParams: { showComments: 'true' } - }); - // if you just want to transition the query parameters without changing the route - this.transitionTo({ queryParams: { sort: 'date' } }); - ``` - See also [replaceWith](#method_replaceWith). - Simple Transition Example - ```javascript - App.Router.map(function() { - this.route('index'); - this.route('secret'); - this.route('fourOhFour', { path: '*:' }); - }); - App.IndexRoute = Ember.Route.extend({ - actions: { - moveToSecret: function(context) { - if (authorized()) { - this.transitionTo('secret', context); - } else { - this.transitionTo('fourOhFour'); - } - } - } - }); - ``` - Transition to a nested route - ```javascript - App.Router.map(function() { - this.route('articles', { path: '/articles' }, function() { - this.route('new'); - }); - }); - App.IndexRoute = Ember.Route.extend({ - actions: { - transitionToNewArticle: function() { - this.transitionTo('articles.new'); - } - } - }); - ``` - Multiple Models Example - ```javascript - App.Router.map(function() { - this.route('index'); - this.route('breakfast', { path: ':breakfastId' }, function() { - this.route('cereal', { path: ':cerealId', resetNamespace: true }); - }); - }); - App.IndexRoute = Ember.Route.extend({ - actions: { - moveToChocolateCereal: function() { - let cereal = { cerealId: 'ChocolateYumminess' }; - let breakfast = { breakfastId: 'CerealAndMilk' }; - this.transitionTo('cereal', breakfast, cereal); - } - } - }); - ``` - Nested Route with Query String Example - ```javascript - App.Router.map(function() { - this.route('fruits', function() { - this.route('apples'); - }); - }); - App.IndexRoute = Ember.Route.extend({ - actions: { - transitionToApples: function() { - this.transitionTo('fruits.apples', { queryParams: { color: 'red' } }); - } - } - }); - ``` - @method transitionTo - @param {String} name the name of the route or a URL - @param {...Object} models the model(s) or identifier(s) to be used while - transitioning to the route. - @param {Object} [options] optional hash with a queryParams property - containing a mapping of query parameters - @return {Transition} the transition object associated with this - attempted transition - @since 1.0.0 - @public - */ - transitionTo: function (name, context) { - var router = this.router; - return router.transitionTo.apply(router, _emberRoutingUtils.prefixRouteNameArg(this, arguments)); - }, - - /** - Perform a synchronous transition into another route without attempting - to resolve promises, update the URL, or abort any currently active - asynchronous transitions (i.e. regular transitions caused by - `transitionTo` or URL changes). - This method is handy for performing intermediate transitions on the - way to a final destination route, and is called internally by the - default implementations of the `error` and `loading` handlers. - @method intermediateTransitionTo - @param {String} name the name of the route - @param {...Object} models the model(s) to be used while transitioning - to the route. - @since 1.2.0 - @public - */ - intermediateTransitionTo: function () { - var router = this.router; - router.intermediateTransitionTo.apply(router, _emberRoutingUtils.prefixRouteNameArg(this, arguments)); - }, - - /** - Refresh the model on this route and any child routes, firing the - `beforeModel`, `model`, and `afterModel` hooks in a similar fashion - to how routes are entered when transitioning in from other route. - The current route params (e.g. `article_id`) will be passed in - to the respective model hooks, and if a different model is returned, - `setupController` and associated route hooks will re-fire as well. - An example usage of this method is re-querying the server for the - latest information using the same parameters as when the route - was first entered. - Note that this will cause `model` hooks to fire even on routes - that were provided a model object when the route was initially - entered. - @method refresh - @return {Transition} the transition object associated with this - attempted transition - @since 1.4.0 - @public - */ - refresh: function () { - return this.router.router.refresh(this); - }, - - /** - Transition into another route while replacing the current URL, if possible. - This will replace the current history entry instead of adding a new one. - Beside that, it is identical to `transitionTo` in all other respects. See - 'transitionTo' for additional information regarding multiple models. - Example - ```javascript - App.Router.map(function() { - this.route('index'); - this.route('secret'); - }); - App.SecretRoute = Ember.Route.extend({ - afterModel: function() { - if (!authorized()){ - this.replaceWith('index'); - } - } - }); - ``` - @method replaceWith - @param {String} name the name of the route or a URL - @param {...Object} models the model(s) or identifier(s) to be used while - transitioning to the route. - @return {Transition} the transition object associated with this - attempted transition - @since 1.0.0 - @public - */ - replaceWith: function () { - var router = this.router; - return router.replaceWith.apply(router, _emberRoutingUtils.prefixRouteNameArg(this, arguments)); - }, - - /** - Sends an action to the router, which will delegate it to the currently - active route hierarchy per the bubbling rules explained under `actions`. - Example - ```javascript - App.Router.map(function() { - this.route('index'); - }); - App.ApplicationRoute = Ember.Route.extend({ - actions: { - track: function(arg) { - console.log(arg, 'was clicked'); - } - } - }); - App.IndexRoute = Ember.Route.extend({ - actions: { - trackIfDebug: function(arg) { - if (debug) { - this.send('track', arg); - } - } - } - }); - ``` - @method send - @param {String} name the name of the action to trigger - @param {...*} args - @since 1.0.0 - @public - */ - send: function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - if (this.router && this.router.router || !_emberMetal.isTesting()) { - var _router; - - (_router = this.router).send.apply(_router, args); - } else { - var _name2 = args[0]; - args = slice.call(args, 1); - var action = this.actions[_name2]; - if (action) { - return this.actions[_name2].apply(this, args); - } - } - }, - - /** - This hook is the entry point for router.js - @private - @method setup - */ - setup: function (context, transition) { - var _this3 = this; - - var controller = undefined; - - var controllerName = this.controllerName || this.routeName; - var definedController = this.controllerFor(controllerName, true); - - if (!definedController) { - controller = this.generateController(controllerName); - } else { - controller = definedController; - } - - // Assign the route's controller so that it can more easily be - // referenced in action handlers. Side effects. Side effects everywhere. - if (!this.controller) { - var propNames = _emberMetal.get(this, '_qp.propertyNames'); - addQueryParamsObservers(controller, propNames); - this.controller = controller; - } - - var queryParams = _emberMetal.get(this, '_qp'); - - var states = queryParams.states; - - controller._qpDelegate = states.allowOverrides; - - if (transition) { - (function () { - // Update the model dep values used to calculate cache keys. - _emberRoutingUtils.stashParamNames(_this3.router, transition.state.handlerInfos); - - var params = transition.params; - var allParams = queryParams.propertyNames; - var cache = _this3._bucketCache; - - allParams.forEach(function (prop) { - var aQp = queryParams.map[prop]; - - aQp.values = params; - var cacheKey = _emberRoutingUtils.calculateCacheKey(aQp.controllerName, aQp.parts, aQp.values); - - if (cache) { - var value = cache.lookup(cacheKey, prop, aQp.undecoratedDefaultValue); - _emberMetal.set(controller, prop, value); - } - }); - })(); - } - - if (transition) { - var qpValues = getQueryParamsFor(this, transition.state); - controller.setProperties(qpValues); - } - - this.setupController(controller, context, transition); - - if (this._environment.options.shouldRender) { - 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 - value in the cache so if this route becomes active, the cache value has been updated. - */ - _qpChanged: function (prop, value, qp) { - if (!qp) { - return; - } - - var cacheKey = _emberRoutingUtils.calculateCacheKey(qp.controllerName, qp.parts, qp.values); - - // Update model-dep cache - var cache = this._bucketCache; - if (cache) { - cache.stash(cacheKey, prop, value); - } - }, - /** - This hook is the first of the route entry validation hooks - called when an attempt is made to transition into a route - or one of its children. It is called before `model` and - `afterModel`, and is appropriate for cases when: - 1) A decision can be made to redirect elsewhere without - needing to resolve the model first. - 2) Any async operations need to occur first before the - model is attempted to be resolved. - This hook is provided the current `transition` attempt - as a parameter, which can be used to `.abort()` the transition, - save it for a later `.retry()`, or retrieve values set - on it from a previous hook. You can also just call - `this.transitionTo` to another route to implicitly - abort the `transition`. - You can return a promise from this hook to pause the - transition until the promise resolves (or rejects). This could - be useful, for instance, for retrieving async code from - the server that is required to enter a route. - ```javascript - App.PostRoute = Ember.Route.extend({ - beforeModel: function(transition) { - if (!App.Post) { - return Ember.$.getScript('/models/post.js'); - } - } - }); - ``` - If `App.Post` doesn't exist in the above example, - `beforeModel` will use jQuery's `getScript`, which - returns a promise that resolves after the server has - successfully retrieved and executed the code from the - server. Note that if an error were to occur, it would - be passed to the `error` hook on `Ember.Route`, but - it's also possible to handle errors specific to - `beforeModel` right from within the hook (to distinguish - from the shared error handling behavior of the `error` - hook): - ```javascript - App.PostRoute = Ember.Route.extend({ - beforeModel: function(transition) { - if (!App.Post) { - let self = this; - return Ember.$.getScript('post.js').then(null, function(e) { - self.transitionTo('help'); - // Note that the above transitionTo will implicitly - // halt the transition. If you were to return - // nothing from this promise reject handler, - // according to promise semantics, that would - // convert the reject into a resolve and the - // transition would continue. To propagate the - // error so that it'd be handled by the `error` - // hook, you would have to - return Ember.RSVP.reject(e); - }); - } - } - }); - ``` - @method beforeModel - @param {Transition} transition - @return {Promise} if the value returned from this hook is - a promise, the transition will pause until the transition - resolves. Otherwise, non-promise return values are not - utilized in any way. - @since 1.0.0 - @public - */ - beforeModel: K, - - /** - This hook is called after this route's model has resolved. - It follows identical async/promise semantics to `beforeModel` - but is provided the route's resolved model in addition to - the `transition`, and is therefore suited to performing - logic that can only take place after the model has already - resolved. - ```javascript - App.PostsRoute = Ember.Route.extend({ - afterModel: function(posts, transition) { - if (posts.get('length') === 1) { - this.transitionTo('post.show', posts.get('firstObject')); - } - } - }); - ``` - Refer to documentation for `beforeModel` for a description - of transition-pausing semantics when a promise is returned - from this hook. - @method afterModel - @param {Object} resolvedModel the value returned from `model`, - or its resolved value if it was a promise - @param {Transition} transition - @return {Promise} if the value returned from this hook is - a promise, the transition will pause until the transition - resolves. Otherwise, non-promise return values are not - utilized in any way. - @since 1.0.0 - @public - */ - afterModel: K, - - /** - A hook you can implement to optionally redirect to another route. - If you call `this.transitionTo` from inside of this hook, this route - will not be entered in favor of the other hook. - `redirect` and `afterModel` behave very similarly and are - called almost at the same time, but they have an important - distinction in the case that, from one of these hooks, a - redirect into a child route of this route occurs: redirects - from `afterModel` essentially invalidate the current attempt - to enter this route, and will result in this route's `beforeModel`, - `model`, and `afterModel` hooks being fired again within - the new, redirecting transition. Redirects that occur within - the `redirect` hook, on the other hand, will _not_ cause - these hooks to be fired again the second time around; in - other words, by the time the `redirect` hook has been called, - both the resolved model and attempted entry into this route - are considered to be fully validated. - @method redirect - @param {Object} model the model for this route - @param {Transition} transition the transition object associated with the current transition - @since 1.0.0 - @public - */ - redirect: K, - - /** - Called when the context is changed by router.js. - @private - @method contextDidChange - */ - contextDidChange: function () { - this.currentModel = this.context; - }, - - /** - A hook you can implement to convert the URL into the model for - this route. - ```javascript - App.Router.map(function() { - this.route('post', { path: '/posts/:post_id' }); - }); - ``` - The model for the `post` route is `store.findRecord('post', params.post_id)`. - By default, if your route has a dynamic segment ending in `_id`: - * The model class is determined from the segment (`post_id`'s - class is `App.Post`) - * The find method is called on the model class with the value of - the dynamic segment. - Note that for routes with dynamic segments, this hook is not always - executed. If the route is entered through a transition (e.g. when - using the `link-to` Handlebars helper or the `transitionTo` method - of routes), and a model context is already provided this hook - is not called. - A model context does not include a primitive string or number, - which does cause the model hook to be called. - Routes without dynamic segments will always execute the model hook. - ```javascript - // no dynamic segment, model hook always called - this.transitionTo('posts'); - // model passed in, so model hook not called - thePost = store.findRecord('post', 1); - this.transitionTo('post', thePost); - // integer passed in, model hook is called - this.transitionTo('post', 1); - // model id passed in, model hook is called - // useful for forcing the hook to execute - thePost = store.findRecord('post', 1); - this.transitionTo('post', thePost.id); - ``` - This hook follows the asynchronous/promise semantics - described in the documentation for `beforeModel`. In particular, - if a promise returned from `model` fails, the error will be - handled by the `error` hook on `Ember.Route`. - Example - ```javascript - App.PostRoute = Ember.Route.extend({ - model: function(params) { - return this.store.findRecord('post', params.post_id); - } - }); - ``` - @method model - @param {Object} params the parameters extracted from the URL - @param {Transition} transition - @return {Object|Promise} the model for this route. If - a promise is returned, the transition will pause until - the promise resolves, and the resolved value of the promise - will be used as the model for this route. - @since 1.0.0 - @public - */ - model: function (params, transition) { - var match = undefined, - name = undefined, - sawParams = undefined, - value = undefined; - var queryParams = _emberMetal.get(this, '_qp.map'); - - for (var prop in params) { - if (prop === 'queryParams' || queryParams && prop in queryParams) { - continue; - } - - if (match = prop.match(/^(.*)_id$/)) { - name = match[1]; - value = params[prop]; - } - sawParams = true; - } - - if (!name && sawParams) { - return _emberRuntime.copy(params); - } else if (!name) { - if (transition.resolveIndex < 1) { - return; - } - - var parentModel = transition.state.handlerInfos[transition.resolveIndex - 1].context; - - return parentModel; - } - - return this.findModel(name, value); - }, - - /** - @private - @method deserialize - @param {Object} params the parameters extracted from the URL - @param {Transition} transition - @return {Object|Promise} the model for this route. - Router.js hook. - */ - deserialize: function (params, transition) { - return this.model(this.paramsFor(this.routeName), transition); - }, - - /** - @method findModel - @param {String} type the model type - @param {Object} value the value passed to find - @private - */ - findModel: function () { - var store = _emberMetal.get(this, 'store'); - return store.find.apply(store, arguments); - }, - - /** - Store property provides a hook for data persistence libraries to inject themselves. - By default, this store property provides the exact same functionality previously - in the model hook. - Currently, the required interface is: - `store.find(modelName, findArguments)` - @method store - @param {Object} store - @private - */ - store: _emberMetal.computed(function () { - var owner = _emberUtils.getOwner(this); - var routeName = this.routeName; - var namespace = _emberMetal.get(this, 'router.namespace'); - - return { - find: function (name, value) { - var modelClass = owner._lookupFactory('model:' + name); - - _emberMetal.assert('You used the dynamic segment ' + name + '_id in your route ' + routeName + ', but ' + namespace + '.' + _emberRuntime.String.classify(name) + ' did not exist and you did not override your route\'s `model` hook.', !!modelClass); - - if (!modelClass) { - return; - } - - _emberMetal.assert(_emberRuntime.String.classify(name) + ' has no method `find`.', typeof modelClass.find === 'function'); - - return modelClass.find(value); - } - }; - }), - - /** - A hook you can implement to convert the route's model into parameters - for the URL. - ```javascript - App.Router.map(function() { - this.route('post', { path: '/posts/:post_id' }); - }); - App.PostRoute = Ember.Route.extend({ - model: function(params) { - // the server returns `{ id: 12 }` - return Ember.$.getJSON('/posts/' + params.post_id); - }, - serialize: function(model) { - // this will make the URL `/posts/12` - return { post_id: model.id }; - } - }); - ``` - The default `serialize` method will insert the model's `id` into the - route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'. - If the route has multiple dynamic segments or does not contain '_id', `serialize` - will return `Ember.getProperties(model, params)` - This method is called when `transitionTo` is called with a context - in order to populate the URL. - @method serialize - @param {Object} model the routes model - @param {Array} params an Array of parameter names for the current - route (in the example, `['post_id']`. - @return {Object} the serialized parameters - @since 1.0.0 - @public - */ - serialize: defaultSerialize, - - /** - A hook you can use to setup the controller for the current route. - This method is called with the controller for the current route and the - model supplied by the `model` hook. - By default, the `setupController` hook sets the `model` property of - the controller to the `model`. - If you implement the `setupController` hook in your Route, it will - prevent this default behavior. If you want to preserve that behavior - when implementing your `setupController` function, make sure to call - `_super`: - ```javascript - App.PhotosRoute = Ember.Route.extend({ - model: function() { - return this.store.findAll('photo'); - }, - setupController: function(controller, model) { - // Call _super for default behavior - this._super(controller, model); - // Implement your custom setup after - this.controllerFor('application').set('showingPhotos', true); - } - }); - ``` - The provided controller will be one resolved based on the name - of this route. - If no explicit controller is defined, Ember will automatically create one. - As an example, consider the router: - ```javascript - App.Router.map(function() { - this.route('post', { path: '/posts/:post_id' }); - }); - ``` - For the `post` route, a controller named `App.PostController` would - be used if it is defined. If it is not defined, a basic `Ember.Controller` - instance would be used. - Example - ```javascript - App.PostRoute = Ember.Route.extend({ - setupController: function(controller, model) { - controller.set('model', model); - } - }); - ``` - @method setupController - @param {Controller} controller instance - @param {Object} model - @since 1.0.0 - @public - */ - setupController: function (controller, context, transition) { - if (controller && context !== undefined) { - _emberMetal.set(controller, 'model', context); - } - }, - - /** - Returns the controller for a particular route or name. - The controller instance must already have been created, either through entering the - associated route or using `generateController`. - ```javascript - App.PostRoute = Ember.Route.extend({ - setupController: function(controller, post) { - this._super(controller, post); - this.controllerFor('posts').set('currentPost', post); - } - }); - ``` - @method controllerFor - @param {String} name the name of the route or controller - @return {Ember.Controller} - @since 1.0.0 - @public - */ - controllerFor: function (name, _skipAssert) { - var owner = _emberUtils.getOwner(this); - var route = owner.lookup('route:' + name); - var controller = undefined; - - if (route && route.controllerName) { - name = route.controllerName; - } - - controller = owner.lookup('controller:' + name); - - // NOTE: We're specifically checking that skipAssert is true, because according - // to the old API the second parameter was model. We do not want people who - // passed a model to skip the assertion. - _emberMetal.assert('The controller named \'' + name + '\' could not be found. Make sure that this route exists and has already been entered at least once. If you are accessing a controller not associated with a route, make sure the controller class is explicitly defined.', controller || _skipAssert === true); - - return controller; - }, - - /** - Generates a controller for a route. - Example - ```javascript - App.PostRoute = Ember.Route.extend({ - setupController: function(controller, post) { - this._super(controller, post); - this.generateController('posts'); - } - }); - ``` - @method generateController - @param {String} name the name of the controller - @private - */ - generateController: function (name) { - var owner = _emberUtils.getOwner(this); - - return _emberRoutingSystemGenerate_controller.default(owner, name); - }, - - /** - Returns the resolved model of a parent (or any ancestor) route - in a route hierarchy. During a transition, all routes - must resolve a model object, and if a route - needs access to a parent route's model in order to - resolve a model (or just reuse the model from a parent), - it can call `this.modelFor(theNameOfParentRoute)` to - retrieve it. If the ancestor route's model was a promise, - its resolved result is returned. - Example - ```javascript - App.Router.map(function() { - this.route('post', { path: '/post/:post_id' }, function() { - this.route('comments', { resetNamespace: true }); - }); - }); - App.CommentsRoute = Ember.Route.extend({ - afterModel: function() { - this.set('post', this.modelFor('post')); - } - }); - ``` - @method modelFor - @param {String} name the name of the route - @return {Object} the model object - @since 1.0.0 - @public - */ - modelFor: function (_name) { - var name = undefined; - var owner = _emberUtils.getOwner(this); - - // Only change the route name when there is an active transition. - // Otherwise, use the passed in route name. - if (owner.routable && this.router && this.router.router.activeTransition) { - name = getEngineRouteName(owner, _name); - } else { - name = _name; - } - - var route = _emberUtils.getOwner(this).lookup('route:' + name); - var transition = this.router ? this.router.router.activeTransition : null; - - // If we are mid-transition, we want to try and look up - // resolved parent contexts on the current transitionEvent. - if (transition) { - var modelLookupName = route && route.routeName || name; - if (transition.resolvedModels.hasOwnProperty(modelLookupName)) { - return transition.resolvedModels[modelLookupName]; - } - } - - return route && route.currentModel; - }, - - /** - A hook you can use to render the template for the current route. - This method is called with the controller for the current route and the - model supplied by the `model` hook. By default, it renders the route's - template, configured with the controller for the route. - This method can be overridden to set up and render additional or - alternative templates. - ```javascript - App.PostsRoute = Ember.Route.extend({ - renderTemplate: function(controller, model) { - let favController = this.controllerFor('favoritePost'); - // Render the `favoritePost` template into - // the outlet `posts`, and display the `favoritePost` - // controller. - this.render('favoritePost', { - outlet: 'posts', - controller: favController - }); - } - }); - ``` - @method renderTemplate - @param {Object} controller the route's controller - @param {Object} model the route's model - @since 1.0.0 - @public - */ - renderTemplate: function (controller, model) { - this.render(); - }, - - /** - `render` is used to render a template into a region of another template - (indicated by an `{{outlet}}`). `render` is used both during the entry - phase of routing (via the `renderTemplate` hook) and later in response to - user interaction. - For example, given the following minimal router and templates: - ```javascript - Router.map(function() { - this.route('photos'); - }); - ``` - ```handlebars - -
    - {{outlet "anOutletName"}} -
    - ``` - ```handlebars - -

    Photos

    - ``` - You can render `photos.hbs` into the `"anOutletName"` outlet of - `application.hbs` by calling `render`: - ```javascript - // posts route - Ember.Route.extend({ - renderTemplate: function() { - this.render('photos', { - into: 'application', - outlet: 'anOutletName' - }) - } - }); - ``` - `render` additionally allows you to supply which `controller` and - `model` objects should be loaded and associated with the rendered template. - ```javascript - // posts route - Ember.Route.extend({ - renderTemplate: function(controller, model){ - this.render('posts', { // the template to render, referenced by name - into: 'application', // the template to render into, referenced by name - outlet: 'anOutletName', // the outlet inside `options.template` to render into. - controller: 'someControllerName', // the controller to use for this template, referenced by name - model: model // the model to set on `options.controller`. - }) - } - }); - ``` - The string values provided for the template name, and controller - will eventually pass through to the resolver for lookup. See - Ember.Resolver for how these are mapped to JavaScript objects in your - application. The template to render into needs to be related to either the - current route or one of its ancestors. - Not all options need to be passed to `render`. Default values will be used - based on the name of the route specified in the router or the Route's - `controllerName` and `templateName` properties. - For example: - ```javascript - // router - Router.map(function() { - this.route('index'); - this.route('post', { path: '/posts/:post_id' }); - }); - ``` - ```javascript - // post route - PostRoute = App.Route.extend({ - renderTemplate: function() { - this.render(); // all defaults apply - } - }); - ``` - The name of the `PostRoute`, defined by the router, is `post`. - The following equivalent default options will be applied when - the Route calls `render`: - ```javascript - // - this.render('post', { // the template name associated with 'post' Route - into: 'application', // the parent route to 'post' Route - outlet: 'main', // {{outlet}} and {{outlet 'main'}} are synonymous, - controller: 'post', // the controller associated with the 'post' Route - }) - ``` - By default the controller's `model` will be the route's model, so it does not - need to be passed unless you wish to change which model is being used. - @method render - @param {String} name the name of the template to render - @param {Object} [options] the options - @param {String} [options.into] the template to render into, - referenced by name. Defaults to the parent template - @param {String} [options.outlet] the outlet inside `options.template` to render into. - Defaults to 'main' - @param {String|Object} [options.controller] the controller to use for this template, - referenced by name or as a controller instance. Defaults to the Route's paired controller - @param {Object} [options.model] the model object to set on `options.controller`. - Defaults to the return value of the Route's model hook - @since 1.0.0 - @public - */ - render: function (_name, options) { - _emberMetal.assert('The name in the given arguments is undefined', arguments.length > 0 ? !_emberMetal.isNone(arguments[0]) : true); - - var namePassed = typeof _name === 'string' && !!_name; - var isDefaultRender = arguments.length === 0 || _emberMetal.isEmpty(arguments[0]); - var name = undefined; - - if (typeof _name === 'object' && !options) { - name = this.templateName || this.routeName; - options = _name; - } else { - name = _name; - } - - var renderOptions = buildRenderOptions(this, namePassed, isDefaultRender, name, options); - this.connections.push(renderOptions); - _emberMetal.run.once(this.router, '_setOutlets'); - }, - - /** - Disconnects a view that has been rendered into an outlet. - You may pass any or all of the following options to `disconnectOutlet`: - * `outlet`: the name of the outlet to clear (default: 'main') - * `parentView`: the name of the view containing the outlet to clear - (default: the view rendered by the parent route) - Example: - ```javascript - App.ApplicationRoute = App.Route.extend({ - actions: { - showModal: function(evt) { - this.render(evt.modalName, { - outlet: 'modal', - into: 'application' - }); - }, - hideModal: function(evt) { - this.disconnectOutlet({ - outlet: 'modal', - parentView: 'application' - }); - } - } - }); - ``` - Alternatively, you can pass the `outlet` name directly as a string. - Example: - ```javascript - hideModal: function(evt) { - this.disconnectOutlet('modal'); - } - ``` - @method disconnectOutlet - @param {Object|String} options the options hash or outlet name - @since 1.0.0 - @public - */ - disconnectOutlet: function (options) { - var outletName = undefined; - var parentView = undefined; - 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 _emberMetal.Error('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++) { - // This non-local state munging is sadly necessary to maintain - // backward compatibility with our existing semantics, which allow - // any route to disconnectOutlet things originally rendered by any - // other route. This should all get cut in 2.0. - this.router.router.currentHandlerInfos[i].handler._disconnectOutlet(outletName, parentView); - } - }, - - _disconnectOutlet: function (outletName, parentView) { - var parent = parentRoute(this); - if (parent && parentView === parent.routeName) { - parentView = undefined; - } - for (var i = 0; i < this.connections.length; i++) { - var connection = this.connections[i]; - if (connection.outlet === outletName && connection.into === parentView) { - // This neuters the disconnected outlet such that it doesn't - // render anything, but it leaves an entry in the outlet - // 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, - controller: undefined, - template: undefined, - ViewClass: undefined - }; - _emberMetal.run.once(this.router, '_setOutlets'); - } - } - }, - - willDestroy: function () { - this.teardownViews(); - }, - - /** - @private - @method teardownViews - */ - teardownViews: function () { - if (this.connections && this.connections.length > 0) { - this.connections = []; - _emberMetal.run.once(this.router, '_setOutlets'); - } - } - }); - - _emberRuntime.deprecateUnderscoreActions(Route); - - Route.reopenClass({ - isRouteFactory: true - }); - - function parentRoute(route) { - var handlerInfo = handlerInfoFor(route, route.router.router.state.handlerInfos, -1); - return handlerInfo && handlerInfo.handler; - } - - function handlerInfoFor(route, handlerInfos, _offset) { - if (!handlerInfos) { - return; - } - - var offset = _offset || 0; - var current = undefined; - for (var i = 0; i < handlerInfos.length; i++) { - current = handlerInfos[i].handler; - if (current === route) { - return handlerInfos[i + offset]; - } - } - } - - function buildRenderOptions(route, namePassed, isDefaultRender, _name, options) { - var into = options && options.into && options.into.replace(/\//g, '.'); - var outlet = options && options.outlet || 'main'; - - var name = undefined, - templateName = undefined; - if (_name) { - name = _name.replace(/\//g, '.'); - templateName = name; - } else { - name = route.routeName; - templateName = route.templateName || name; - } - - var owner = _emberUtils.getOwner(route); - var controller = options && options.controller; - if (!controller) { - if (namePassed) { - controller = owner.lookup('controller:' + name) || route.controllerName || route.routeName; - } else { - controller = route.controllerName || owner.lookup('controller:' + name); - } - } - - if (typeof controller === 'string') { - var controllerName = controller; - controller = owner.lookup('controller:' + controllerName); - if (!controller) { - throw new _emberMetal.Error('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 _emberMetal.Error('You passed undefined as the outlet name.'); - } - - if (options && options.model) { - controller.set('model', options.model); - } - - var template = owner.lookup('template:' + templateName); - - var parent = undefined; - if (into && (parent = parentRoute(route)) && into === parentRoute(route).routeName) { - into = undefined; - } - - var renderOptions = { - owner: owner, - into: into, - outlet: outlet, - name: name, - controller: controller, - template: template || route._topLevelViewTemplate, - ViewClass: undefined - }; - - _emberMetal.assert('Could not find "' + name + '" template, view, or component.', isDefaultRender || template); - - var LOG_VIEW_LOOKUPS = _emberMetal.get(route.router, 'namespace.LOG_VIEW_LOOKUPS'); - if (LOG_VIEW_LOOKUPS && !template) { - _emberMetal.info('Could not find "' + name + '" template. Nothing will be rendered', { fullName: 'template:' + name }); - } - - return renderOptions; - } - - function getFullQueryParams(router, state) { - if (state.fullQueryParams) { - return state.fullQueryParams; - } - - state.fullQueryParams = {}; - _emberUtils.assign(state.fullQueryParams, state.queryParams); - - router._deserializeQueryParams(state.handlerInfos, state.fullQueryParams); - return state.fullQueryParams; - } - - function getQueryParamsFor(route, state) { - state.queryParamsFor = state.queryParamsFor || {}; - var name = route.fullRouteName; - - if (state.queryParamsFor[name]) { - return state.queryParamsFor[name]; - } - - var fullQueryParams = getFullQueryParams(route.router, state); - - var params = state.queryParamsFor[name] = {}; - - // Copy over all the query params for this route/controller into params hash. - var qpMeta = _emberMetal.get(route, '_qp'); - var qps = qpMeta.qps; - for (var i = 0; i < qps.length; ++i) { - // Put deserialized qp on params hash. - var qp = qps[i]; - - var qpValueWasPassedIn = (qp.prop in fullQueryParams); - params[qp.prop] = qpValueWasPassedIn ? fullQueryParams[qp.prop] : copyDefaultValue(qp.defaultValue); - } - - return params; - } - - function copyDefaultValue(value) { - if (Array.isArray(value)) { - return _emberRuntime.A(value.slice()); - } - return value; - } - - /* - Merges all query parameters from a controller with those from - a route, returning a new object and avoiding any mutations to - the existing objects. - */ - function mergeEachQueryParams(controllerQP, routeQP) { - var keysAlreadyMergedOrSkippable = undefined; - var qps = {}; - - 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)) { - continue; - } - - var newControllerParameterConfiguration = {}; - _emberUtils.assign(newControllerParameterConfiguration, controllerQP[cqpName]); - _emberUtils.assign(newControllerParameterConfiguration, routeQP[cqpName]); - - qps[cqpName] = newControllerParameterConfiguration; - - // allows us to skip this QP when we check route QPs. - keysAlreadyMergedOrSkippable[cqpName] = true; - } - - // loop over all route qps, skipping those that were merged in the first pass - // because they also appear in controller qps - for (var rqpName in routeQP) { - if (!routeQP.hasOwnProperty(rqpName) || keysAlreadyMergedOrSkippable[rqpName]) { - continue; - } - - var newRouteParameterConfiguration = {}; - _emberUtils.assign(newRouteParameterConfiguration, routeQP[rqpName], controllerQP[rqpName]); - qps[rqpName] = newRouteParameterConfiguration; - } - - return qps; - } - - function addQueryParamsObservers(controller, propNames) { - propNames.forEach(function (prop) { - controller.addObserver(prop + '.[]', controller, controller._qpChanged); - }); - } - - function getEngineRouteName(engine, routeName) { - if (engine.routable) { - var prefix = engine.mountPoint; - - if (routeName === 'application') { - return prefix; - } else { - return prefix + '.' + routeName; - } - } - - return routeName; - } - - exports.default = Route; -}); -enifed('ember-routing/system/router', ['exports', 'ember-utils', 'ember-console', 'ember-metal', 'ember-runtime', 'ember-routing/system/route', 'ember-routing/system/dsl', 'ember-routing/location/api', 'ember-routing/utils', 'ember-routing/system/router_state', 'router'], function (exports, _emberUtils, _emberConsole, _emberMetal, _emberRuntime, _emberRoutingSystemRoute, _emberRoutingSystemDsl, _emberRoutingLocationApi, _emberRoutingUtils, _emberRoutingSystemRouter_state, _router4) { - 'use strict'; - - exports.triggerEvent = triggerEvent; - - function K() { - return this; - } - - var slice = Array.prototype.slice; - - /** - The `Ember.Router` class manages the application state and URLs. Refer to - the [routing guide](http://emberjs.com/guides/routing/) for documentation. - - @class Router - @namespace Ember - @extends Ember.Object - @uses Ember.Evented - @public - */ - var EmberRouter = _emberRuntime.Object.extend(_emberRuntime.Evented, { - /** - The `location` property determines the type of URL's that your - application will use. - The following location types are currently available: - * `history` - use the browser's history API to make the URLs look just like any standard URL - * `hash` - use `#` to separate the server part of the URL from the Ember part: `/blog/#/posts/new` - * `none` - do not store the Ember URL in the actual browser URL (mainly used for testing) - * `auto` - use the best option based on browser capabilites: `history` if possible, then `hash` if possible, otherwise `none` - Note: If using ember-cli, this value is defaulted to `auto` by the `locationType` setting of `/config/environment.js` - @property location - @default 'hash' - @see {Ember.Location} - @public - */ - location: 'hash', - - /** - Represents the URL of the root of the application, often '/'. This prefix is - assumed on all routes defined on this router. - @property rootURL - @default '/' - @public - */ - rootURL: '/', - - _initRouterJs: function () { - var router = this.router = new _router4.default(); - router.triggerEvent = triggerEvent; - - router._triggerWillChangeContext = K; - router._triggerWillLeave = K; - - var dslCallbacks = this.constructor.dslCallbacks || [K]; - var dsl = this._buildDSL(); - - dsl.route('application', { path: '/', resetNamespace: true, overrideNameAssertion: true }, function () { - for (var i = 0; i < dslCallbacks.length; i++) { - dslCallbacks[i].call(this); - } - }); - - if (_emberMetal.get(this, 'namespace.LOG_TRANSITIONS_INTERNAL')) { - router.log = _emberConsole.default.debug; - } - - router.map(dsl.generate()); - }, - - _buildDSL: function () { - var moduleBasedResolver = this._hasModuleBasedResolver(); - var options = { - enableLoadingSubstates: !!moduleBasedResolver - }; - - var owner = _emberUtils.getOwner(this); - var router = this; - - options.resolveRouteMap = function (name) { - return owner._lookupFactory('route-map:' + name); - }; - - options.addRouteForEngine = function (name, engineInfo) { - if (!router._engineInfoByRoute[name]) { - router._engineInfoByRoute[name] = engineInfo; - } - }; - - return new _emberRoutingSystemDsl.default(null, options); - }, - - init: function () { - this._super.apply(this, arguments); - - this._qpCache = new _emberUtils.EmptyObject(); - this._resetQueuedQueryParameterChanges(); - this._handledErrors = _emberUtils.dictionary(null); - this._engineInstances = new _emberUtils.EmptyObject(); - this._engineInfoByRoute = new _emberUtils.EmptyObject(); - }, - - /* - Resets all pending query paramter changes. - Called after transitioning to a new route - based on query parameter changes. - */ - _resetQueuedQueryParameterChanges: function () { - this._queuedQPChanges = {}; - }, - - /** - Represents the current URL. - @method url - @return {String} The current URL. - @private - */ - url: _emberMetal.computed(function () { - return _emberMetal.get(this, 'location').getURL(); - }), - - _hasModuleBasedResolver: function () { - var owner = _emberUtils.getOwner(this); - - if (!owner) { - return false; - } - - var resolver = owner.application && owner.application.__registry__ && owner.application.__registry__.resolver; - - if (!resolver) { - return false; - } - - return !!resolver.moduleBasedResolver; - }, - - /** - Initializes the current router instance and sets up the change handling - event listeners used by the instances `location` implementation. - A property named `initialURL` will be used to determine the initial URL. - If no value is found `/` will be used. - @method startRouting - @private - */ - startRouting: function () { - var initialURL = _emberMetal.get(this, 'initialURL'); - - if (this.setupRouter()) { - if (typeof initialURL === 'undefined') { - initialURL = _emberMetal.get(this, 'location').getURL(); - } - var initialTransition = this.handleURL(initialURL); - if (initialTransition && initialTransition.error) { - throw initialTransition.error; - } - } - }, - - setupRouter: function () { - var _this = this; - - this._initRouterJs(); - this._setupLocation(); - - var router = this.router; - var location = _emberMetal.get(this, 'location'); - - // Allow the Location class to cancel the router setup while it refreshes - // the page - if (_emberMetal.get(location, 'cancelRouterSetup')) { - return false; - } - - this._setupRouter(router, location); - - location.onUpdateURL(function (url) { - _this.handleURL(url); - }); - - return true; - }, - - /** - Handles updating the paths and notifying any listeners of the URL - change. - Triggers the router level `didTransition` hook. - For example, to notify google analytics when the route changes, - you could use this hook. (Note: requires also including GA scripts, etc.) - ```javascript - let Router = Ember.Router.extend({ - location: config.locationType, - didTransition: function() { - this._super(...arguments); - return ga('send', 'pageview', { - 'page': this.get('url'), - 'title': this.get('url') - }); - } - }); - ``` - @method didTransition - @public - @since 1.2.0 - */ - didTransition: function (infos) { - updatePaths(this); - - this._cancelSlowTransitionTimer(); - - this.notifyPropertyChange('url'); - this.set('currentState', this.targetState); - - // Put this in the runloop so url will be accurate. Seems - // less surprising than didTransition being out of sync. - _emberMetal.run.once(this, this.trigger, 'didTransition'); - - if (_emberMetal.get(this, 'namespace').LOG_TRANSITIONS) { - _emberConsole.default.log('Transitioned into \'' + EmberRouter._routePath(infos) + '\''); - } - }, - - _setOutlets: function () { - // This is triggered async during Ember.Route#willDestroy. - // If the router is also being destroyed we do not want to - // to create another this._toplevelView (and leak the renderer) - if (this.isDestroying || this.isDestroyed) { - return; - } + @private + @method makeBoundHelper + @for Ember.HTMLBars + @param {Function} fn + @since 1.10.0 + */ - var handlerInfos = this.router.currentHandlerInfos; - var route = undefined; - var defaultParentState = undefined; - var liveRoutes = null; + function makeBoundHelper(fn) { + _emberMetal.deprecate('Using `Ember.HTMLBars.makeBoundHelper` is deprecated. Please refactor to use `Ember.Helper` or `Ember.Helper.helper`.', false, { id: 'ember-htmlbars.make-bound-helper', until: '3.0.0' }); + return _emberGlimmerHelper.helper(fn); + } +}); +enifed('ember-glimmer/modifiers/action', ['exports', 'ember-utils', 'ember-metal', 'ember-views', 'ember-glimmer/helpers/action'], function (exports, _emberUtils, _emberMetal, _emberViews, _emberGlimmerHelpersAction) { + 'use strict'; - if (!handlerInfos) { - return; - } + var MODIFIERS = ['alt', 'shift', 'meta', 'ctrl']; + var POINTER_EVENT_TYPE_REGEX = /^click|mouse|touch/; - for (var i = 0; i < handlerInfos.length; i++) { - route = handlerInfos[i].handler; - var connections = route.connections; - var ownState = undefined; - for (var j = 0; j < connections.length; j++) { - var appended = appendLiveRoute(liveRoutes, defaultParentState, connections[j]); - liveRoutes = appended.liveRoutes; - if (appended.ownState.render.name === route.routeName || appended.ownState.render.outlet === 'main') { - ownState = appended.ownState; - } - } - if (connections.length === 0) { - ownState = representEmptyRoute(liveRoutes, defaultParentState, route); - } - defaultParentState = ownState; + function isAllowedEvent(event, allowedKeys) { + if (allowedKeys === null || typeof allowedKeys === 'undefined') { + if (POINTER_EVENT_TYPE_REGEX.test(event.type)) { + return _emberViews.isSimpleClick(event); + } else { + allowedKeys = ''; } + } - // when a transitionTo happens after the validation phase - // during the initial transition _setOutlets is called - // when no routes are active. However, it will get called - // again with the correct values during the next turn of - // the runloop - if (!liveRoutes) { - return; - } + if (allowedKeys.indexOf('any') >= 0) { + return true; + } - if (!this._toplevelView) { - var owner = _emberUtils.getOwner(this); - var OutletView = owner._lookupFactory('view:-outlet'); - this._toplevelView = OutletView.create(); - this._toplevelView.setOutletState(liveRoutes); - var instance = owner.lookup('-application-instance:main'); - instance.didCreateRootView(this._toplevelView); - } else { - this._toplevelView.setOutletState(liveRoutes); + for (var i = 0; i < MODIFIERS.length; i++) { + if (event[MODIFIERS[i] + 'Key'] && allowedKeys.indexOf(MODIFIERS[i]) === -1) { + return false; } - }, + } - /** - Handles notifying any listeners of an impending URL - change. - Triggers the router level `willTransition` hook. - @method willTransition - @public - @since 1.11.0 - */ - willTransition: function (oldInfos, newInfos, transition) { - _emberMetal.run.once(this, this.trigger, 'willTransition', transition); + return true; + } - if (_emberMetal.get(this, 'namespace').LOG_TRANSITIONS) { - _emberConsole.default.log('Preparing to transition from \'' + EmberRouter._routePath(oldInfos) + '\' to \'' + EmberRouter._routePath(newInfos) + '\''); - } - }, + var ActionHelper = { + // registeredActions is re-exported for compatibility with older plugins + // that were using this undocumented API. + registeredActions: _emberViews.ActionManager.registeredActions, - handleURL: function (url) { - // Until we have an ember-idiomatic way of accessing #hashes, we need to - // remove it because router.js doesn't know how to handle it. - url = url.split(/#(.+)?/)[0]; - return this._doURLTransition('handleURL', url); - }, + registerAction: function (actionState) { + var actionId = actionState.actionId; - _doURLTransition: function (routerJsMethod, url) { - var transition = this.router[routerJsMethod](url || '/'); - didBeginTransition(transition, this); - return transition; + _emberViews.ActionManager.registeredActions[actionId] = actionState; + + return actionId; }, - /** - Transition the application into another route. The route may - be either a single route or route path: - See [Route.transitionTo](http://emberjs.com/api/classes/Ember.Route.html#method_transitionTo) for more info. - @method transitionTo - @param {String} name the name of the route or a URL - @param {...Object} models the model(s) or identifier(s) to be used while - transitioning to the route. - @param {Object} [options] optional hash with a queryParams property - containing a mapping of query parameters - @return {Transition} the transition object associated with this - attempted transition - @public - */ - transitionTo: function () { - var queryParams = undefined; + unregisterAction: function (actionState) { + var actionId = actionState.actionId; - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } + delete _emberViews.ActionManager.registeredActions[actionId]; + } + }; - if (resemblesURL(args[0])) { - return this._doURLTransition('transitionTo', args[0]); - } + exports.ActionHelper = ActionHelper; - var possibleQueryParams = args[args.length - 1]; - if (possibleQueryParams && possibleQueryParams.hasOwnProperty('queryParams')) { - queryParams = args.pop().queryParams; - } else { - queryParams = {}; - } + var ActionState = (function () { + function ActionState(element, actionId, actionName, actionArgs, namedArgs, positionalArgs, implicitTarget, dom) { + babelHelpers.classCallCheck(this, ActionState); - var targetRouteName = args.shift(); - return this._doTransition(targetRouteName, args, queryParams); - }, + this.element = element; + this.actionId = actionId; + this.actionName = actionName; + this.actionArgs = actionArgs; + this.namedArgs = namedArgs; + this.positional = positionalArgs; + this.implicitTarget = implicitTarget; + this.dom = dom; + this.eventName = this.getEventName(); + } - intermediateTransitionTo: function () { - var _router; + // implements ModifierManager - (_router = this.router).intermediateTransitionTo.apply(_router, arguments); + ActionState.prototype.getEventName = function getEventName() { + return this.namedArgs.get('on').value() || 'click'; + }; - updatePaths(this); + ActionState.prototype.getActionArgs = function getActionArgs() { + var result = new Array(this.actionArgs.length); - var infos = this.router.currentHandlerInfos; - if (_emberMetal.get(this, 'namespace').LOG_TRANSITIONS) { - _emberConsole.default.log('Intermediate-transitioned into \'' + EmberRouter._routePath(infos) + '\''); + for (var i = 0; i < this.actionArgs.length; i++) { + result[i] = this.actionArgs[i].value(); } - }, - replaceWith: function () { - return this.transitionTo.apply(this, arguments).method('replace'); - }, + return result; + }; - generate: function () { - var _router2; + ActionState.prototype.getTarget = function getTarget() { + var implicitTarget = this.implicitTarget; + var namedArgs = this.namedArgs; - var url = (_router2 = this.router).generate.apply(_router2, arguments); - return this.location.formatURL(url); - }, + var target = undefined; - /** - Determines if the supplied route is currently active. - @method isActive - @param routeName - @return {Boolean} - @private - */ - isActive: function (routeName) { - var router = this.router; - return router.isActive.apply(router, arguments); - }, + if (namedArgs.has('target')) { + target = namedArgs.get('target').value(); + } else { + target = implicitTarget.value(); + } - /** - An alternative form of `isActive` that doesn't require - manual concatenation of the arguments into a single - array. - @method isActiveIntent - @param routeName - @param models - @param queryParams - @return {Boolean} - @private - @since 1.7.0 - */ - isActiveIntent: function (routeName, models, queryParams) { - return this.currentState.isActiveIntent(routeName, models, queryParams); - }, + return target; + }; - send: function (name, context) { - var _router3; + ActionState.prototype.handler = function handler(event) { + var _this = this; - (_router3 = this.router).trigger.apply(_router3, arguments); - }, + var actionName = this.actionName; + var namedArgs = this.namedArgs; - /** - Does this router instance have the given route. - @method hasRoute - @return {Boolean} - @private - */ - hasRoute: function (route) { - return this.router.hasRoute(route); - }, + var bubbles = namedArgs.get('bubbles'); + var preventDefault = namedArgs.get('preventDefault'); + var allowedKeys = namedArgs.get('allowedKeys'); + var target = this.getTarget(); - /** - Resets the state of the router by clearing the current route - handlers and deactivating them. - @private - @method reset - */ - reset: function () { - if (this.router) { - this.router.reset(); + if (!isAllowedEvent(event, allowedKeys.value())) { + return true; } - }, - willDestroy: function () { - if (this._toplevelView) { - this._toplevelView.destroy(); - this._toplevelView = null; + if (preventDefault.value() !== false) { + event.preventDefault(); } - this._super.apply(this, arguments); - - this.reset(); + if (bubbles.value() === false) { + event.stopPropagation(); + } - var instances = this._engineInstances; - for (var _name in instances) { - for (var id in instances[_name]) { - _emberMetal.run(instances[_name][id], 'destroy'); + _emberMetal.run(function () { + var args = _this.getActionArgs(); + var payload = { + args: args, + target: target + }; + if (typeof actionName[_emberGlimmerHelpersAction.INVOKE] === 'function') { + _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { + actionName[_emberGlimmerHelpersAction.INVOKE].apply(actionName, args); + }); + return; } - } - }, + if (typeof actionName === 'function') { + _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { + actionName.apply(target, args); + }); + return; + } + payload.name = actionName; + if (target.send) { + _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { + target.send.apply(target, [actionName].concat(args)); + }); + } else { + _emberMetal.assert('The action \'' + actionName + '\' did not exist on ' + target, typeof target[actionName] === 'function'); + _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { + target[actionName].apply(target, args); + }); + } + }); + }; - /* - Called when an active route's query parameter has changed. - These changes are batched into a runloop run and trigger - a single transition. - */ - _activeQPChanged: function (queryParameterName, newValue) { - this._queuedQPChanges[queryParameterName] = newValue; - _emberMetal.run.once(this, this._fireQueryParamTransition); - }, + ActionState.prototype.destroy = function destroy() { + ActionHelper.unregisterAction(this); + }; - _updatingQPChanged: function (queryParameterName) { - if (!this._qpUpdates) { - this._qpUpdates = {}; - } - this._qpUpdates[queryParameterName] = true; - }, + return ActionState; + })(); - /* - Triggers a transition to a route based on query parameter changes. - This is called once per runloop, to batch changes. - e.g. - if these methods are called in succession: - this._activeQPChanged('foo', '10'); - // results in _queuedQPChanges = { foo: '10' } - this._activeQPChanged('bar', false); - // results in _queuedQPChanges = { foo: '10', bar: false } - _queuedQPChanges will represent both of these changes - and the transition using `transitionTo` will be triggered - once. - */ - _fireQueryParamTransition: function () { - this.transitionTo({ queryParams: this._queuedQPChanges }); - this._resetQueuedQueryParameterChanges(); - }, + exports.ActionState = ActionState; - _setupLocation: function () { - var location = _emberMetal.get(this, 'location'); - var rootURL = _emberMetal.get(this, 'rootURL'); - var owner = _emberUtils.getOwner(this); + var ActionModifierManager = (function () { + function ActionModifierManager() { + babelHelpers.classCallCheck(this, ActionModifierManager); + } - if ('string' === typeof location && owner) { - var resolvedLocation = owner.lookup('location:' + location); + ActionModifierManager.prototype.create = function create(element, args, dynamicScope, dom) { + var named = args.named; + var positional = args.positional; - if ('undefined' !== typeof resolvedLocation) { - location = _emberMetal.set(this, 'location', resolvedLocation); + var implicitTarget = undefined; + var actionName = undefined; + var actionNameRef = undefined; + if (positional.length > 1) { + implicitTarget = positional.at(0); + actionNameRef = positional.at(1); + + if (actionNameRef[_emberGlimmerHelpersAction.INVOKE]) { + actionName = actionNameRef; } else { - // Allow for deprecated registration of custom location API's - var options = { - implementation: location - }; + var actionLabel = actionNameRef._propertyKey; + actionName = actionNameRef.value(); - location = _emberMetal.set(this, 'location', _emberRoutingLocationApi.default.create(options)); + _emberMetal.assert('You specified a quoteless path, `' + actionLabel + '`, to the ' + '{{action}} helper which did not resolve to an action name (a ' + 'string). Perhaps you meant to use a quoted actionName? (e.g. ' + '{{action "' + actionLabel + '"}}).', typeof actionName === 'string' || typeof actionName === 'function'); } } - if (location !== null && typeof location === 'object') { - if (rootURL) { - _emberMetal.set(location, 'rootURL', rootURL); - } + var actionArgs = []; + // The first two arguments are (1) `this` and (2) the action name. + // Everything else is a param. + for (var i = 2; i < positional.length; i++) { + actionArgs.push(positional.at(i)); + } - // Allow the location to do any feature detection, such as AutoLocation - // detecting history support. This gives it a chance to set its - // `cancelRouterSetup` property which aborts routing. - if (typeof location.detect === 'function') { - location.detect(); - } + var actionId = _emberUtils.uuid(); + return new ActionState(element, actionId, actionName, actionArgs, named, positional, implicitTarget, dom); + }; - // ensure that initState is called AFTER the rootURL is set on - // the location instance - if (typeof location.initState === 'function') { - location.initState(); - } + ActionModifierManager.prototype.install = function install(actionState) { + var dom = actionState.dom; + var element = actionState.element; + var actionId = actionState.actionId; + + ActionHelper.registerAction(actionState); + + dom.setAttribute(element, 'data-ember-action', ''); + dom.setAttribute(element, 'data-ember-action-' + actionId, actionId); + }; + + ActionModifierManager.prototype.update = function update(actionState) { + var positional = actionState.positional; + + var actionNameRef = positional.at(1); + + if (!actionNameRef[_emberGlimmerHelpersAction.INVOKE]) { + actionState.actionName = actionNameRef.value(); } - }, + actionState.eventName = actionState.getEventName(); - _getHandlerFunction: function () { - var _this2 = this; + // Not sure if this is needed? If we mutate the actionState is that good enough? + ActionHelper.unregisterAction(actionState); + ActionHelper.registerAction(actionState); + }; - var seen = new _emberUtils.EmptyObject(); - var owner = _emberUtils.getOwner(this); + ActionModifierManager.prototype.getDestructor = function getDestructor(modifier) { + return modifier; + }; - return function (name) { - var routeName = name; - var routeOwner = owner; - var engineInfo = _this2._engineInfoByRoute[routeName]; + return ActionModifierManager; + })(); - if (engineInfo) { - var engineInstance = _this2._getEngineInstance(engineInfo); + exports.default = ActionModifierManager; +}); +enifed('ember-glimmer/protocol-for-url', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { + /* globals module, URL */ - routeOwner = engineInstance; - routeName = engineInfo.localFullName; - } + 'use strict'; - var fullRouteName = 'route:' + routeName; + exports.default = installProtocolForURL; - var handler = routeOwner.lookup(fullRouteName); + var nodeURL = undefined; + var parsingNode = undefined; - if (seen[name]) { - return handler; - } + function installProtocolForURL(environment) { + var protocol = undefined; - seen[name] = true; + if (_emberEnvironment.environment.hasDOM) { + protocol = browserProtocolForURL.call(environment, 'foobar:baz'); + } - if (!handler) { - var DefaultRoute = routeOwner._lookupFactory('route:basic'); + // Test to see if our DOM implementation parses + // and normalizes URLs. + if (protocol === 'foobar:') { + // Swap in the method that doesn't do this test now that + // we know it works. + environment.protocolForURL = browserProtocolForURL; + } else if (typeof URL === 'object') { + // URL globally provided, likely from FastBoot's sandbox + nodeURL = URL; + environment.protocolForURL = nodeProtocolForURL; + } else if (typeof module === 'object' && typeof module.require === 'function') { + // Otherwise, we need to fall back to our own URL parsing. + // Global `require` is shadowed by Ember's loader so we have to use the fully + // qualified `module.require`. + nodeURL = module.require('url'); + environment.protocolForURL = nodeProtocolForURL; + } else { + throw new Error('Could not find valid URL parsing mechanism for URL Sanitization'); + } + } - routeOwner.register(fullRouteName, DefaultRoute.extend()); - handler = routeOwner.lookup(fullRouteName); + function browserProtocolForURL(url) { + if (!parsingNode) { + parsingNode = document.createElement('a'); + } - if (_emberMetal.get(_this2, 'namespace.LOG_ACTIVE_GENERATION')) { - _emberMetal.info('generated -> ' + fullRouteName, { fullName: fullRouteName }); - } - } + parsingNode.href = url; + return parsingNode.protocol; + } - handler._setRouteName(routeName); - handler._populateQPMeta(); + function nodeProtocolForURL(url) { + var protocol = null; + if (typeof url === 'string') { + protocol = nodeURL.parse(url).protocol; + } + return protocol === null ? ':' : protocol; + } +}); +enifed('ember-glimmer/renderer', ['exports', 'ember-glimmer/utils/references', 'ember-metal', '@glimmer/reference', 'ember-views', 'ember-glimmer/component', 'ember-glimmer/syntax/curly-component', 'ember-glimmer/syntax/outlet'], function (exports, _emberGlimmerUtilsReferences, _emberMetal, _glimmerReference, _emberViews, _emberGlimmerComponent, _emberGlimmerSyntaxCurlyComponent, _emberGlimmerSyntaxOutlet) { + 'use strict'; - if (engineInfo && !_emberRoutingSystemRoute.hasDefaultSerialize(handler)) { - throw new Error('Defining a custom serialize method on an Engine route is not supported.'); - } + var backburner = _emberMetal.run.backburner; - return handler; - }; - }, + var DynamicScope = (function () { + function DynamicScope(view, outletState, rootOutletState, targetObject) { + babelHelpers.classCallCheck(this, DynamicScope); - _getSerializerFunction: function () { - var _this3 = this; + this.view = view; + this.outletState = outletState; + this.rootOutletState = rootOutletState; + } - return function (name) { - var engineInfo = _this3._engineInfoByRoute[name]; + DynamicScope.prototype.child = function child() { + return new DynamicScope(this.view, this.outletState, this.rootOutletState); + }; + + DynamicScope.prototype.get = function get(key) { + _emberMetal.assert('Using `-get-dynamic-scope` is only supported for `outletState` (you used `' + key + '`).', key === 'outletState'); + return this.outletState; + }; + + DynamicScope.prototype.set = function set(key, value) { + _emberMetal.assert('Using `-with-dynamic-scope` is only supported for `outletState` (you used `' + key + '`).', key === 'outletState'); + this.outletState = value; + return value; + }; - // If this is not an Engine route, we fall back to the handler for serialization - if (!engineInfo) { - return; - } + return DynamicScope; + })(); - return engineInfo.serializeMethod || _emberRoutingSystemRoute.defaultSerialize; - }; - }, + var RootState = (function () { + function RootState(root, env, template, self, parentElement, dynamicScope) { + var _this = this; - _setupRouter: function (router, location) { - var lastURL = undefined; - var emberRouter = this; + babelHelpers.classCallCheck(this, RootState); - router.getHandler = this._getHandlerFunction(); - router.getSerializer = this._getSerializerFunction(); + _emberMetal.assert('You cannot render `' + self.value() + '` without a template.', template); - var doUpdateURL = function () { - location.setURL(lastURL); - }; + this.id = _emberViews.getViewId(root); + this.env = env; + this.root = root; + this.result = undefined; + this.shouldReflush = false; + this.destroyed = false; + this._removing = false; - router.updateURL = function (path) { - lastURL = path; - _emberMetal.run.once(doUpdateURL); + var options = this.options = { + alwaysRevalidate: false }; - if (location.replaceURL) { - (function () { - var doReplaceURL = function () { - location.replaceURL(lastURL); - }; - - router.replaceURL = function (path) { - lastURL = path; - _emberMetal.run.once(doReplaceURL); - }; - })(); - } + this.render = function () { + var result = _this.result = template.render(self, parentElement, dynamicScope); - router.didTransition = function (infos) { - emberRouter.didTransition(infos); + // override .render function after initial render + _this.render = function () { + result.rerender(options); + }; }; + } - router.willTransition = function (oldInfos, newInfos, transition) { - emberRouter.willTransition(oldInfos, newInfos, transition); - }; - }, + RootState.prototype.isFor = function isFor(possibleRoot) { + return this.root === possibleRoot; + }; - /** - Serializes the given query params according to their QP meta information. - @private - @method _serializeQueryParams - @param {Arrray} handlerInfos - @param {Object} queryParams - @return {Void} - */ - _serializeQueryParams: function (handlerInfos, queryParams) { - var _this4 = this; + RootState.prototype.destroy = function destroy() { + var result = this.result; + var env = this.env; - forEachQueryParam(this, handlerInfos, queryParams, function (key, value, qp) { - if (qp) { - delete queryParams[key]; - queryParams[qp.urlKey] = qp.route.serializeQueryParam(value, qp.urlKey, qp.type); - } else if (value === undefined) { - return; // We don't serialize undefined values - } else { - queryParams[key] = _this4._serializeQueryParam(value, _emberRuntime.typeOf(value)); - } - }); - }, + this.destroyed = true; - /** - Serializes the value of a query parameter based on a type - @private - @method _serializeQueryParam - @param {Object} value - @param {String} type - */ - _serializeQueryParam: function (value, type) { - if (type === 'array') { - return JSON.stringify(value); - } + this.env = null; + this.root = null; + this.result = null; + this.render = null; - return '' + value; - }, + if (result) { + /* + Handles these scenarios: + * When roots are removed during standard rendering process, a transaction exists already + `.begin()` / `.commit()` are not needed. + * When roots are being destroyed manually (`component.append(); component.destroy() case), no + transaction exists already. + * When roots are being destroyed during `Renderer#destroy`, no transaction exists + */ + var needsTransaction = !env.inTransaction; - /** - Deserializes the given query params according to their QP meta information. - @private - @method _deserializeQueryParams - @param {Array} handlerInfos - @param {Object} queryParams - @return {Void} - */ - _deserializeQueryParams: function (handlerInfos, queryParams) { - forEachQueryParam(this, handlerInfos, queryParams, function (key, value, qp) { - // If we don't have QP meta info for a given key, then we do nothing - // because all values will be treated as strings - if (qp) { - delete queryParams[key]; - queryParams[qp.prop] = qp.route.deserializeQueryParam(value, qp.urlKey, qp.type); + if (needsTransaction) { + env.begin(); } - }); - }, - - /** - Deserializes the value of a query parameter based on a default type - @private - @method _deserializeQueryParam - @param {Object} value - @param {String} defaultType - */ - _deserializeQueryParam: function (value, defaultType) { - if (defaultType === 'boolean') { - return value === 'true' ? true : false; - } else if (defaultType === 'number') { - return Number(value).valueOf(); - } else if (defaultType === 'array') { - return _emberRuntime.A(JSON.parse(value)); - } - return value; - }, + result.destroy(); - /** - Removes (prunes) any query params with default values from the given QP - object. Default values are determined from the QP meta information per key. - @private - @method _pruneDefaultQueryParamValues - @param {Array} handlerInfos - @param {Object} queryParams - @return {Void} - */ - _pruneDefaultQueryParamValues: function (handlerInfos, queryParams) { - var qps = this._queryParamsFor(handlerInfos); - for (var key in queryParams) { - var qp = qps.map[key]; - if (qp && qp.serializedDefaultValue === queryParams[key]) { - delete queryParams[key]; + if (needsTransaction) { + env.commit(); } } - }, - - _doTransition: function (_targetRouteName, models, _queryParams) { - var targetRouteName = _targetRouteName || _emberRoutingUtils.getActiveTargetName(this.router); - _emberMetal.assert('The route ' + targetRouteName + ' was not found', targetRouteName && this.router.hasRoute(targetRouteName)); + }; - var queryParams = {}; + return RootState; + })(); - this._processActiveTransitionQueryParams(targetRouteName, models, queryParams, _queryParams); + var renderers = []; - _emberUtils.assign(queryParams, _queryParams); - this._prepareQueryParams(targetRouteName, models, queryParams); + _emberMetal.setHasViews(function () { + return renderers.length > 0; + }); - var transitionArgs = _emberRoutingUtils.routeArgs(targetRouteName, models, queryParams); - var transition = this.router.transitionTo.apply(this.router, transitionArgs); + function register(renderer) { + _emberMetal.assert('Cannot register the same renderer twice', renderers.indexOf(renderer) === -1); + renderers.push(renderer); + } - didBeginTransition(transition, this); + function deregister(renderer) { + var index = renderers.indexOf(renderer); + _emberMetal.assert('Cannot deregister unknown unregistered renderer', index !== -1); + renderers.splice(index, 1); + } - return transition; - }, + function loopBegin() { + for (var i = 0; i < renderers.length; i++) { + renderers[i]._scheduleRevalidate(); + } + } - _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; - } + function K() {} - var unchangedQPs = {}; - var qpUpdates = this._qpUpdates || {}; - for (var key in this.router.activeTransition.queryParams) { - if (!qpUpdates[key]) { - unchangedQPs[key] = this.router.activeTransition.queryParams[key]; + var loops = 0; + function loopEnd(current, next) { + for (var i = 0; i < renderers.length; i++) { + if (!renderers[i]._isValid()) { + if (loops > 10) { + loops = 0; + // TODO: do something better + renderers[i].destroy(); + throw new Error('infinite rendering invalidation detected'); } + loops++; + return backburner.join(null, K); } + } + loops = 0; + } - // 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); - _emberUtils.assign(queryParams, unchangedQPs); - }, - - /** - Prepares the query params for a URL or Transition. Restores any undefined QP - keys/values, serializes all values, and then prunes any default values. - @private - @method _prepareQueryParams - @param {String} targetRouteName - @param {Array} models - @param {Object} queryParams - @return {Void} - */ - _prepareQueryParams: function (targetRouteName, models, queryParams) { - var state = calculatePostTransitionState(this, targetRouteName, models); - this._hydrateUnsuppliedQueryParams(state, queryParams); - this._serializeQueryParams(state.handlerInfos, queryParams); - this._pruneDefaultQueryParamValues(state.handlerInfos, queryParams); - }, + backburner.on('begin', loopBegin); + backburner.on('end', loopEnd); - /** - Returns the meta information for the query params of a given route. This - will be overriden to allow support for lazy routes. - @private - @method _getQPMeta - @param {HandlerInfo} handlerInfo - @return {Object} - */ - _getQPMeta: function (handlerInfo) { - var route = handlerInfo.handler; - return route && _emberMetal.get(route, '_qp'); - }, + var Renderer = (function () { + function Renderer(env, rootTemplate) { + var _viewRegistry = arguments.length <= 2 || arguments[2] === undefined ? _emberViews.fallbackViewRegistry : arguments[2]; - /** - Returns a merged query params meta object for a given set of handlerInfos. - Useful for knowing what query params are available for a given route hierarchy. - @private - @method _queryParamsFor - @param {Array} handlerInfos - @return {Object} - */ - _queryParamsFor: function (handlerInfos) { - var leafRouteName = handlerInfos[handlerInfos.length - 1].name; - if (this._qpCache[leafRouteName]) { - return this._qpCache[leafRouteName]; - } + var destinedForDOM = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3]; + babelHelpers.classCallCheck(this, Renderer); - var shouldCache = true; - var qpsByUrlKey = {}; - var map = {}; - var qps = []; + this._env = env; + this._rootTemplate = rootTemplate; + this._viewRegistry = _viewRegistry; + this._destinedForDOM = destinedForDOM; + this._destroyed = false; + this._roots = []; + this._lastRevision = null; + this._isRenderingRoots = false; + this._removedRoots = []; + } - for (var i = 0; i < handlerInfos.length; ++i) { - var qpMeta = this._getQPMeta(handlerInfos[i]); + // renderer HOOKS - if (!qpMeta) { - shouldCache = false; - continue; - } + Renderer.prototype.appendOutletView = function appendOutletView(view, target) { + var definition = new _emberGlimmerSyntaxOutlet.TopLevelOutletComponentDefinition(view); + var outletStateReference = view.toReference(); + var targetObject = view.outletState.render.controller; - // Loop over each QP to make sure we don't have any collisions by urlKey - for (var _i = 0; _i < qpMeta.qps.length; _i++) { - var qp = qpMeta.qps[_i]; - var urlKey = qp.urlKey; + this._appendDefinition(view, definition, target, outletStateReference, targetObject); + }; - if (qpsByUrlKey[urlKey]) { - var otherQP = qpsByUrlKey[urlKey]; - _emberMetal.assert('You\'re not allowed to have more than one controller property map to the same query param key, but both `' + otherQP.scopedPropertyName + '` and `' + qp.scopedPropertyName + '` map to `' + 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. `' + otherQP.prop + ': { as: \'other-' + otherQP.prop + '\' }`', false); - } + Renderer.prototype.appendTo = function appendTo(view, target) { + var rootDef = new _emberGlimmerSyntaxCurlyComponent.RootComponentDefinition(view); - qpsByUrlKey[urlKey] = qp; - qps.push(qp); - } + this._appendDefinition(view, rootDef, target); + }; - _emberUtils.assign(map, qpMeta.map); - } + Renderer.prototype._appendDefinition = function _appendDefinition(root, definition, target) { + var outletStateReference = arguments.length <= 3 || arguments[3] === undefined ? _glimmerReference.UNDEFINED_REFERENCE : arguments[3]; + var targetObject = arguments.length <= 4 || arguments[4] === undefined ? null : arguments[4]; - var finalQPMeta = { - qps: qps, - map: map - }; + var self = new _emberGlimmerUtilsReferences.RootReference(definition); + var dynamicScope = new DynamicScope(null, outletStateReference, outletStateReference, true, targetObject); + var rootState = new RootState(root, this._env, this._rootTemplate, self, target, dynamicScope); - if (shouldCache) { - this._qpCache[leafRouteName] = finalQPMeta; - } + this._renderRoot(rootState); + }; - return finalQPMeta; - }, + Renderer.prototype.rerender = function rerender(view) { + this._scheduleRevalidate(); + }; - /** - Maps all query param keys to their fully scoped property name of the form - `controllerName:propName`. - @private - @method _fullyScopeQueryParams - @param {String} leafRouteName - @param {Array} contexts - @param {Object} queryParams - @return {Void} - */ - _fullyScopeQueryParams: function (leafRouteName, contexts, queryParams) { - var state = calculatePostTransitionState(this, leafRouteName, contexts); - var handlerInfos = state.handlerInfos; + Renderer.prototype.register = function register(view) { + var id = _emberViews.getViewId(view); + _emberMetal.assert('Attempted to register a view with an id already in use: ' + id, !this._viewRegistry[id]); + this._viewRegistry[id] = view; + }; - for (var i = 0, len = handlerInfos.length; i < len; ++i) { - var qpMeta = this._getQPMeta(handlerInfos[i]); + Renderer.prototype.unregister = function unregister(view) { + delete this._viewRegistry[_emberViews.getViewId(view)]; + }; - if (!qpMeta) { - continue; - } + Renderer.prototype.remove = function remove(view) { + view._transitionTo('destroying'); - for (var j = 0, qpLen = qpMeta.qps.length; j < qpLen; ++j) { - var qp = qpMeta.qps[j]; + this.cleanupRootFor(view); - var presentProp = qp.prop in queryParams && qp.prop || qp.scopedPropertyName in queryParams && qp.scopedPropertyName || qp.urlKey in queryParams && qp.urlKey; + _emberViews.setViewElement(view, null); - if (presentProp) { - if (presentProp !== qp.scopedPropertyName) { - queryParams[qp.scopedPropertyName] = queryParams[presentProp]; - delete queryParams[presentProp]; - } - } - } + if (this._destinedForDOM) { + view.trigger('didDestroyElement'); } - }, - - /** - Hydrates (adds/restores) any query params that have pre-existing values into - the given queryParams hash. This is what allows query params to be "sticky" - and restore their last known values for their scope. - @private - @method _hydrateUnsuppliedQueryParams - @param {TransitionState} state - @param {Object} queryParams - @return {Void} - */ - _hydrateUnsuppliedQueryParams: function (state, queryParams) { - var handlerInfos = state.handlerInfos; - var appCache = this._bucketCache; - - for (var i = 0; i < handlerInfos.length; ++i) { - var qpMeta = this._getQPMeta(handlerInfos[i]); - - if (!qpMeta) { - continue; - } - - 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]; - } - } else { - var cacheKey = _emberRoutingUtils.calculateCacheKey(qp.controllerName, qp.parts, state.params); - queryParams[qp.scopedPropertyName] = appCache.lookup(cacheKey, qp.prop, qp.defaultValue); - } - } + if (!view.isDestroying) { + view.destroy(); } - }, - - _scheduleLoadingEvent: function (transition, originRoute) { - this._cancelSlowTransitionTimer(); - this._slowTransitionTimer = _emberMetal.run.scheduleOnce('routerTransitions', this, '_handleSlowTransition', transition, originRoute); - }, - - currentState: null, - targetState: null, + }; - _handleSlowTransition: function (transition, originRoute) { - if (!this.router.activeTransition) { - // Don't fire an event if we've since moved on from - // the transition that put us in a loading state. + Renderer.prototype.cleanupRootFor = function cleanupRootFor(view) { + // no need to cleanup roots if we have already been destroyed + if (this._destroyed) { return; } - this.set('targetState', _emberRoutingSystemRouter_state.default.create({ - emberRouter: this, - routerJs: this.router, - routerJsState: this.router.activeTransition.state - })); - - transition.trigger(true, 'loading', transition, originRoute); - }, + var roots = this._roots; - _cancelSlowTransitionTimer: function () { - if (this._slowTransitionTimer) { - _emberMetal.run.cancel(this._slowTransitionTimer); + // traverse in reverse so we can remove items + // without mucking up the index + var i = this._roots.length; + while (i--) { + var root = roots[i]; + if (root.isFor(view)) { + root.destroy(); + } } - this._slowTransitionTimer = null; - }, - - // These three helper functions are used to ensure errors aren't - // re-raised if they're handled in a route's error action. - _markErrorAsHandled: function (errorGuid) { - this._handledErrors[errorGuid] = true; - }, - - _isErrorHandled: function (errorGuid) { - return this._handledErrors[errorGuid]; - }, - - _clearHandledError: function (errorGuid) { - delete this._handledErrors[errorGuid]; - }, - - _getEngineInstance: function (_ref) { - var name = _ref.name; - var instanceId = _ref.instanceId; - var mountPoint = _ref.mountPoint; - - var engineInstances = this._engineInstances; + }; - if (!engineInstances[name]) { - engineInstances[name] = new _emberUtils.EmptyObject(); + Renderer.prototype.destroy = function destroy() { + if (this._destroyed) { + return; } + this._destroyed = true; + this._clearAllRoots(); + }; - var engineInstance = engineInstances[name][instanceId]; - - if (!engineInstance) { - var owner = _emberUtils.getOwner(this); - - _emberMetal.assert('You attempted to mount the engine \'' + name + '\' in your router map, but the engine can not be found.', owner.hasRegistration('engine:' + name)); - - engineInstance = owner.buildChildEngineInstance(name, { - routable: true, - mountPoint: mountPoint - }); + Renderer.prototype.getElement = function getElement(view) { + // overriden in the subclasses + }; - engineInstance.boot(); + Renderer.prototype.getBounds = function getBounds(view) { + var bounds = view[_emberGlimmerComponent.BOUNDS]; - engineInstances[name][instanceId] = engineInstance; - } + var parentElement = bounds.parentElement(); + var firstNode = bounds.firstNode(); + var lastNode = bounds.lastNode(); - return engineInstance; - } - }); + return { parentElement: parentElement, firstNode: firstNode, lastNode: lastNode }; + }; - /* - Helper function for iterating over routes in a set of handlerInfos that are - at or above the given origin route. Example: if `originRoute` === 'foo.bar' - and the handlerInfos given were for 'foo.bar.baz', then the given callback - will be invoked with the routes for 'foo.bar', 'foo', and 'application' - individually. - - If the callback returns anything other than `true`, then iteration will stop. - - @private - @param {Route} originRoute - @param {Array} handlerInfos - @param {Function} callback - @return {Void} - */ - function forEachRouteAbove(originRoute, handlerInfos, callback) { - var originRouteFound = false; + Renderer.prototype.createElement = function createElement(tagName) { + return this._env.getAppendOperations().createElement(tagName); + }; - for (var i = handlerInfos.length - 1; i >= 0; --i) { - var handlerInfo = handlerInfos[i]; - var route = handlerInfo.handler; + Renderer.prototype._renderRoot = function _renderRoot(root) { + var roots = this._roots; - if (originRoute === route) { - originRouteFound = true; - } + roots.push(root); - if (!originRouteFound) { - continue; + if (roots.length === 1) { + register(this); } - if (callback(route) !== true) { - return; - } - } - } + this._renderRootsTransaction(); + }; - // These get invoked when an action bubbles above ApplicationRoute - // and are not meant to be overridable. - var defaultActionHandlers = { + Renderer.prototype._renderRoots = function _renderRoots() { + var roots = this._roots; + var env = this._env; + var removedRoots = this._removedRoots; - willResolveModel: function (transition, originRoute) { - originRoute.router._scheduleLoadingEvent(transition, originRoute); - }, + var globalShouldReflush = undefined, + initialRootsLength = undefined; - // Attempt to find an appropriate error route or substate to enter. - error: function (error, transition, originRoute) { - var handlerInfos = transition.state.handlerInfos; - var router = originRoute.router; + do { + env.begin(); - forEachRouteAbove(originRoute, handlerInfos, function (route) { - // Check for the existence of an 'error' route. - // We don't check for an 'error' route on the originRoute, since that would - // technically be below where we're at in the route hierarchy. - if (originRoute !== route) { - var errorRouteName = findRouteStateName(route, 'error'); - if (errorRouteName) { - router.intermediateTransitionTo(errorRouteName, error); - return false; - } - } + // ensure that for the first iteration of the loop + // each root is processed + initialRootsLength = roots.length; + globalShouldReflush = false; - // Check for an 'error' substate route - var errorSubstateName = findRouteSubstateName(route, 'error'); - if (errorSubstateName) { - router.intermediateTransitionTo(errorSubstateName, error); - return false; - } + for (var i = 0; i < roots.length; i++) { + var root = roots[i]; - return true; - }); + if (root.destroyed) { + // add to the list of roots to be removed + // they will be removed from `this._roots` later + removedRoots.push(root); - logError(error, 'Error while processing route: ' + transition.targetName); - }, + // skip over roots that have been marked as destroyed + continue; + } - // Attempt to find an appropriate loading route or substate to enter. - loading: function (transition, originRoute) { - var handlerInfos = transition.state.handlerInfos; - var router = originRoute.router; + var shouldReflush = root.shouldReflush; - forEachRouteAbove(originRoute, handlerInfos, function (route) { - // Check for the existence of a 'loading' route. - // We don't check for a 'loading' route on the originRoute, since that would - // technically be below where we're at in the route hierarchy. - if (originRoute !== route) { - var loadingRouteName = findRouteStateName(route, 'loading'); - if (loadingRouteName) { - router.intermediateTransitionTo(loadingRouteName); - return false; + // when processing non-initial reflush loops, + // do not process more roots than needed + if (i >= initialRootsLength && !shouldReflush) { + continue; } - } - // Check for loading substate - var loadingSubstateName = findRouteSubstateName(route, 'loading'); - if (loadingSubstateName) { - router.intermediateTransitionTo(loadingSubstateName); - return false; + root.options.alwaysRevalidate = shouldReflush; + // track shouldReflush based on this roots render result + shouldReflush = root.shouldReflush = _emberMetal.runInTransaction(root, 'render'); + + // globalShouldReflush should be `true` if *any* of + // the roots need to reflush + globalShouldReflush = globalShouldReflush || shouldReflush; } - // Don't bubble above pivot route. - return transition.pivotHandler !== route; - }); - } - }; + this._lastRevision = _glimmerReference.CURRENT_TAG.value(); - function logError(_error, initialMessage) { - var errorArgs = []; - var error = undefined; - if (_error && typeof _error === 'object' && typeof _error.errorThrown === 'object') { - error = _error.errorThrown; - } else { - error = _error; - } + env.commit(); + } while (globalShouldReflush || roots.length > initialRootsLength); - if (initialMessage) { - errorArgs.push(initialMessage); - } + // remove any roots that were destroyed during this transaction + while (removedRoots.length) { + var root = removedRoots.pop(); - if (error) { - if (error.message) { - errorArgs.push(error.message); + var rootIndex = roots.indexOf(root); + roots.splice(rootIndex, 1); } - if (error.stack) { - errorArgs.push(error.stack); + + if (this._roots.length === 0) { + deregister(this); } + }; - if (typeof error === 'string') { - errorArgs.push(error); + Renderer.prototype._renderRootsTransaction = function _renderRootsTransaction() { + if (this._isRenderingRoots) { + // currently rendering roots, a new root was added and will + // be processed by the existing _renderRoots invocation + return; } - } - _emberConsole.default.error.apply(this, errorArgs); - } + // used to prevent calling _renderRoots again (see above) + // while we are actively rendering roots + this._isRenderingRoots = true; - /** - Finds the name of the substate route if it exists for the given route. A - substate route is of the form `route_state`, such as `foo_loading`. - - @private - @param {Route} route - @param {String} state - @return {String} - */ - function findRouteSubstateName(route, state) { - var router = route.router; - var owner = _emberUtils.getOwner(route); + var completedWithoutError = false; + try { + this._renderRoots(); + completedWithoutError = true; + } finally { + if (!completedWithoutError) { + this._lastRevision = _glimmerReference.CURRENT_TAG.value(); + } + this._isRenderingRoots = false; + } + }; - var routeName = route.routeName; - var substateName = routeName + '_' + state; + Renderer.prototype._clearAllRoots = function _clearAllRoots() { + var roots = this._roots; + for (var i = 0; i < roots.length; i++) { + var root = roots[i]; + root.destroy(); + } - var routeNameFull = route.fullRouteName; - var substateNameFull = routeNameFull + '_' + state; + this._removedRoots.length = 0; + this._roots = null; - return routeHasBeenDefined(owner, router, substateName, substateNameFull) ? substateNameFull : ''; - } + // if roots were present before destroying + // deregister this renderer instance + if (roots.length) { + deregister(this); + } + }; - /** - Finds the name of the state route if it exists for the given route. A state - route is of the form `route.state`, such as `foo.loading`. Properly Handles - `application` named routes. - - @private - @param {Route} route - @param {String} state - @return {String} - */ - function findRouteStateName(route, state) { - var router = route.router; - var owner = _emberUtils.getOwner(route); + Renderer.prototype._scheduleRevalidate = function _scheduleRevalidate() { + backburner.scheduleOnce('render', this, this._revalidate); + }; - var routeName = route.routeName; - var stateName = routeName === 'application' ? state : routeName + '.' + state; + Renderer.prototype._isValid = function _isValid() { + return this._destroyed || this._roots.length === 0 || _glimmerReference.CURRENT_TAG.validate(this._lastRevision); + }; - var routeNameFull = route.fullRouteName; - var stateNameFull = routeNameFull === 'application' ? state : routeNameFull + '.' + state; + Renderer.prototype._revalidate = function _revalidate() { + if (this._isValid()) { + return; + } + this._renderRootsTransaction(); + }; - return routeHasBeenDefined(owner, router, stateName, stateNameFull) ? stateNameFull : ''; - } + return Renderer; + })(); - /** - Determines whether or not a route has been defined by checking that the route - is in the Router's map and the owner has a registration for that route. - - @private - @param {Owner} owner - @param {Ember.Router} router - @param {String} localName - @param {String} fullName - @return {Boolean} - */ - function routeHasBeenDefined(owner, router, localName, fullName) { - var routerHasRoute = router.hasRoute(fullName); - var ownerHasRoute = owner.hasRegistration('template:' + localName) || owner.hasRegistration('route:' + localName); - return routerHasRoute && ownerHasRoute; - } + var InertRenderer = (function (_Renderer) { + babelHelpers.inherits(InertRenderer, _Renderer); - function triggerEvent(handlerInfos, ignoreFailure, args) { - var name = args.shift(); + function InertRenderer() { + babelHelpers.classCallCheck(this, InertRenderer); - if (!handlerInfos) { - if (ignoreFailure) { - return; - } - throw new _emberMetal.Error('Can\'t trigger action \'' + name + '\' because your app hasn\'t finished transitioning into its first route. To trigger an action on destination routes during a transition, you can call `.send()` on the `Transition` object passed to the `model/beforeModel/afterModel` hooks.'); + _Renderer.apply(this, arguments); } - var eventWasHandled = false; - var handlerInfo = undefined, - handler = undefined; - - for (var i = handlerInfos.length - 1; i >= 0; i--) { - handlerInfo = handlerInfos[i]; - handler = handlerInfo.handler; + InertRenderer.create = function create(_ref) { + var env = _ref.env; + var rootTemplate = _ref.rootTemplate; + var _viewRegistry = _ref._viewRegistry; - if (handler && handler.actions && handler.actions[name]) { - if (handler.actions[name].apply(handler, args) === true) { - eventWasHandled = true; - } else { - // Should only hit here if a non-bubbling error action is triggered on a route. - if (name === 'error') { - var errorId = _emberUtils.guidFor(args[0]); - handler.router._markErrorAsHandled(errorId); - } - return; - } - } - } + return new this(env, rootTemplate, _viewRegistry, false); + }; - if (defaultActionHandlers[name]) { - defaultActionHandlers[name].apply(null, args); - return; - } + InertRenderer.prototype.getElement = function getElement(view) { + throw new Error('Accessing `this.element` is not allowed in non-interactive environments (such as FastBoot).'); + }; - if (!eventWasHandled && !ignoreFailure) { - throw new _emberMetal.Error('Nothing handled the action \'' + name + '\'. If you did handle the action, this error can be caused by returning true from an action handler in a controller, causing the action to bubble.'); - } - } + return InertRenderer; + })(Renderer); - function calculatePostTransitionState(emberRouter, leafRouteName, contexts) { - var routerjs = emberRouter.router; - var state = routerjs.applyIntent(leafRouteName, contexts); - var handlerInfos = state.handlerInfos; - var params = state.params; + exports.InertRenderer = InertRenderer; - for (var i = 0; i < handlerInfos.length; ++i) { - var handlerInfo = handlerInfos[i]; + var InteractiveRenderer = (function (_Renderer2) { + babelHelpers.inherits(InteractiveRenderer, _Renderer2); - // If the handlerInfo is not resolved, we serialize the context into params - if (!handlerInfo.isResolved) { - params[handlerInfo.name] = handlerInfo.serialize(handlerInfo.context); - } else { - params[handlerInfo.name] = handlerInfo.params; - } - } - return state; - } + function InteractiveRenderer() { + babelHelpers.classCallCheck(this, InteractiveRenderer); - function updatePaths(router) { - var infos = router.router.currentHandlerInfos; - if (infos.length === 0) { - return; + _Renderer2.apply(this, arguments); } - var path = EmberRouter._routePath(infos); - var currentRouteName = infos[infos.length - 1].name; + InteractiveRenderer.create = function create(_ref2) { + var env = _ref2.env; + var rootTemplate = _ref2.rootTemplate; + var _viewRegistry = _ref2._viewRegistry; - _emberMetal.set(router, 'currentPath', path); - _emberMetal.set(router, 'currentRouteName', currentRouteName); + return new this(env, rootTemplate, _viewRegistry, true); + }; - var appController = _emberUtils.getOwner(router).lookup('controller:application'); + InteractiveRenderer.prototype.getElement = function getElement(view) { + return _emberViews.getViewElement(view); + }; - if (!appController) { - // appController might not exist when top-level loading/error - // substates have been entered since ApplicationRoute hasn't - // actually been entered at that point. - return; - } + return InteractiveRenderer; + })(Renderer); - if (!('currentPath' in appController)) { - _emberMetal.defineProperty(appController, 'currentPath'); - } + exports.InteractiveRenderer = InteractiveRenderer; +}); +enifed('ember-glimmer/setup-registry', ['exports', 'ember-environment', 'container', 'ember-glimmer/renderer', 'ember-glimmer/dom', 'ember-glimmer/views/outlet', 'ember-glimmer/components/text_field', 'ember-glimmer/components/text_area', 'ember-glimmer/components/checkbox', 'ember-glimmer/components/link-to', 'ember-glimmer/component', 'ember-glimmer/templates/component', 'ember-glimmer/templates/root', 'ember-glimmer/templates/outlet', 'ember-glimmer/environment'], function (exports, _emberEnvironment, _container, _emberGlimmerRenderer, _emberGlimmerDom, _emberGlimmerViewsOutlet, _emberGlimmerComponentsText_field, _emberGlimmerComponentsText_area, _emberGlimmerComponentsCheckbox, _emberGlimmerComponentsLinkTo, _emberGlimmerComponent, _emberGlimmerTemplatesComponent, _emberGlimmerTemplatesRoot, _emberGlimmerTemplatesOutlet, _emberGlimmerEnvironment) { + 'use strict'; - _emberMetal.set(appController, 'currentPath', path); + exports.setupApplicationRegistry = setupApplicationRegistry; + exports.setupEngineRegistry = setupEngineRegistry; - if (!('currentRouteName' in appController)) { - _emberMetal.defineProperty(appController, 'currentRouteName'); - } + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['template:-root'], ['template:-root']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['template:components/-default'], ['template:components/-default']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['component:-default'], ['component:-default']); - _emberMetal.set(appController, 'currentRouteName', currentRouteName); - } + function setupApplicationRegistry(registry) { + registry.injection('service:-glimmer-environment', 'appendOperations', 'service:-dom-tree-construction'); + registry.injection('renderer', 'env', 'service:-glimmer-environment'); - EmberRouter.reopenClass({ - router: null, + registry.register(_container.privatize(_templateObject), _emberGlimmerTemplatesRoot.default); + registry.injection('renderer', 'rootTemplate', _container.privatize(_templateObject)); - /** - The `Router.map` function allows you to define mappings from URLs to routes - in your application. These mappings are defined within the - supplied callback function using `this.route`. - The first parameter is the name of the route which is used by default as the - path name as well. - The second parameter is the optional options hash. Available options are: - * `path`: allows you to provide your own path as well as mark dynamic - segments. - * `resetNamespace`: false by default; when nesting routes, ember will - combine the route names to form the fully-qualified route name, which is - used with `{{link-to}}` or manually transitioning to routes. Setting - `resetNamespace: true` will cause the route not to inherit from its - parent route's names. This is handy for preventing extremely long route names. - Keep in mind that the actual URL path behavior is still retained. - The third parameter is a function, which can be used to nest routes. - Nested routes, by default, will have the parent route tree's route name and - path prepended to it's own. - ```javascript - App.Router.map(function(){ - this.route('post', { path: '/post/:post_id' }, function() { - this.route('edit'); - this.route('comments', { resetNamespace: true }, function() { - this.route('new'); - }); - }); - }); - ``` - For more detailed documentation and examples please see - [the guides](http://emberjs.com/guides/routing/defining-your-routes/). - @method map - @param callback - @public - */ - map: function (callback) { - if (!this.dslCallbacks) { - this.dslCallbacks = []; - this.reopenClass({ dslCallbacks: this.dslCallbacks }); - } + registry.register('renderer:-dom', _emberGlimmerRenderer.InteractiveRenderer); + registry.register('renderer:-inert', _emberGlimmerRenderer.InertRenderer); - this.dslCallbacks.push(callback); + if (_emberEnvironment.environment.hasDOM) { + registry.injection('service:-glimmer-environment', 'updateOperations', 'service:-dom-changes'); + } - return this; - }, + registry.register('service:-dom-changes', { + create: function (_ref) { + var document = _ref.document; - _routePath: function (handlerInfos) { - var path = []; + return new _emberGlimmerDom.DOMChanges(document); + } + }); - // We have to handle coalescing resource names that - // are prefixed with their parent's names, e.g. - // ['foo', 'foo.bar.baz'] => 'foo.bar.baz', not 'foo.foo.bar.baz' + registry.register('service:-dom-tree-construction', { + create: function (_ref2) { + var document = _ref2.document; - function intersectionMatches(a1, a2) { - for (var i = 0; i < a1.length; ++i) { - if (a1[i] !== a2[i]) { - return false; - } - } - return true; + var Implementation = _emberEnvironment.environment.hasDOM ? _emberGlimmerDom.DOMTreeConstruction : _emberGlimmerDom.NodeDOMTreeConstruction; + return new Implementation(document); } + }); + } - var name = undefined, - nameParts = undefined, - oldNameParts = undefined; - for (var i = 1; i < handlerInfos.length; i++) { - name = handlerInfos[i].name; - nameParts = name.split('.'); - oldNameParts = slice.call(path); + function setupEngineRegistry(registry) { + registry.register('view:-outlet', _emberGlimmerViewsOutlet.default); + registry.register('template:-outlet', _emberGlimmerTemplatesOutlet.default); + registry.injection('view:-outlet', 'template', 'template:-outlet'); - while (oldNameParts.length) { - if (intersectionMatches(oldNameParts, nameParts)) { - break; - } - oldNameParts.shift(); - } + registry.injection('service:-dom-changes', 'document', 'service:-document'); + registry.injection('service:-dom-tree-construction', 'document', 'service:-document'); - path.push.apply(path, nameParts.slice(oldNameParts.length)); - } + registry.register(_container.privatize(_templateObject2), _emberGlimmerTemplatesComponent.default); - return path.join('.'); - } - }); + registry.register('service:-glimmer-environment', _emberGlimmerEnvironment.default); + registry.injection('template', 'env', 'service:-glimmer-environment'); - function didBeginTransition(transition, router) { - var routerState = _emberRoutingSystemRouter_state.default.create({ - emberRouter: router, - routerJs: router.router, - routerJsState: transition.state - }); + registry.optionsForType('helper', { instantiate: false }); + + registry.register('component:-text-field', _emberGlimmerComponentsText_field.default); + registry.register('component:-text-area', _emberGlimmerComponentsText_area.default); + registry.register('component:-checkbox', _emberGlimmerComponentsCheckbox.default); + registry.register('component:link-to', _emberGlimmerComponentsLinkTo.default); + registry.register(_container.privatize(_templateObject3), _emberGlimmerComponent.default); + } +}); +enifed('ember-glimmer/syntax', ['exports', 'ember-glimmer/syntax/render', 'ember-glimmer/syntax/outlet', 'ember-glimmer/syntax/mount', 'ember-glimmer/syntax/dynamic-component', 'ember-glimmer/utils/bindings', 'ember-glimmer/syntax/-with-dynamic-vars', 'ember-glimmer/syntax/-in-element', 'ember-glimmer/syntax/input', 'ember-glimmer/syntax/-text-area', 'ember-metal'], function (exports, _emberGlimmerSyntaxRender, _emberGlimmerSyntaxOutlet, _emberGlimmerSyntaxMount, _emberGlimmerSyntaxDynamicComponent, _emberGlimmerUtilsBindings, _emberGlimmerSyntaxWithDynamicVars, _emberGlimmerSyntaxInElement, _emberGlimmerSyntaxInput, _emberGlimmerSyntaxTextArea, _emberMetal) { + 'use strict'; - if (!router.currentState) { - router.set('currentState', routerState); - } - router.set('targetState', routerState); + exports.registerMacros = registerMacros; + exports.populateMacros = populateMacros; - transition.promise = transition.catch(function (error) { - var errorId = _emberUtils.guidFor(error); + function refineInlineSyntax(path, params, hash, builder) { + var name = path[0]; - if (router._isErrorHandled(errorId)) { - router._clearHandledError(errorId); - } else { - throw error; - } - }); - } + _emberMetal.assert('You attempted to overwrite the built-in helper "' + name + '" which is not allowed. Please rename the helper.', !(builder.env.builtInHelpers[name] && builder.env.owner.hasRegistration('helper:' + name))); - function resemblesURL(str) { - return typeof str === 'string' && (str === '' || str.charAt(0) === '/'); - } + if (path.length > 1) { + return _emberGlimmerSyntaxDynamicComponent.closureComponentMacro(path, params, hash, null, null, builder); + } - function forEachQueryParam(router, handlerInfos, queryParams, callback) { - var qpCache = router._queryParamsFor(handlerInfos); + var symbolTable = builder.symbolTable; - for (var key in queryParams) { - if (!queryParams.hasOwnProperty(key)) { - continue; - } - var value = queryParams[key]; - var qp = qpCache.map[key]; + var definition = undefined; + if (name.indexOf('-') > -1) { + definition = builder.env.getComponentDefinition(path, symbolTable); + } - callback(key, value, qp); + if (definition) { + _emberGlimmerUtilsBindings.wrapComponentClassAttribute(hash); + builder.component.static(definition, [params, hash, null, null], symbolTable); + return true; } + + return false; } - function findLiveRoute(liveRoutes, name) { - if (!liveRoutes) { - return; + function refineBlockSyntax(sexp, builder) { + var path = sexp[1]; + var params = sexp[2]; + var hash = sexp[3]; + var _default = sexp[4]; + var inverse = sexp[5]; + var name = path[0]; + + if (path.length > 1) { + return _emberGlimmerSyntaxDynamicComponent.closureComponentMacro(path, params, hash, _default, inverse, builder); } - var stack = [liveRoutes]; - while (stack.length > 0) { - var test = stack.shift(); - if (test.render.name === name) { - return test; - } - var outlets = test.outlets; - for (var outletName in outlets) { - stack.push(outlets[outletName]); - } + + if (name.indexOf('-') === -1) { + return false; } - } - function appendLiveRoute(liveRoutes, defaultParentState, renderOptions) { - var target = undefined; - var myState = { - render: renderOptions, - outlets: new _emberUtils.EmptyObject(), - wasUsed: false - }; - if (renderOptions.into) { - target = findLiveRoute(liveRoutes, renderOptions.into); - } else { - target = defaultParentState; + var symbolTable = builder.symbolTable; + + var definition = undefined; + if (name.indexOf('-') > -1) { + definition = builder.env.getComponentDefinition(path, symbolTable); } - if (target) { - _emberMetal.set(target.outlets, renderOptions.outlet, myState); - } else { - if (renderOptions.into) { - // Megahax time. Post-3.0-breaking-changes, we will just assert - // right here that the user tried to target a nonexistent - // thing. But for now we still need to support the `render` - // helper, and people are allowed to target templates rendered - // by the render helper. So instead we defer doing anyting with - // these orphan renders until afterRender. - appendOrphan(liveRoutes, renderOptions.into, myState); - } else { - liveRoutes = myState; - } + + if (definition) { + _emberGlimmerUtilsBindings.wrapComponentClassAttribute(hash); + builder.component.static(definition, [params, hash, _default, inverse], symbolTable); + return true; } - return { - liveRoutes: liveRoutes, - ownState: myState - }; + + _emberMetal.assert('A component or helper named "' + name + '" could not be found', builder.env.hasHelper(path, symbolTable)); + + _emberMetal.assert('Helpers may not be used in the block form, for example {{#' + name + '}}{{/' + name + '}}. Please use a component, or alternatively use the helper in combination with a built-in Ember helper, for example {{#if (' + name + ')}}{{/if}}.', !builder.env.hasHelper(path, symbolTable)); + + return false; } - function appendOrphan(liveRoutes, into, myState) { - if (!liveRoutes.outlets.__ember_orphans__) { - liveRoutes.outlets.__ember_orphans__ = { - render: { - name: '__ember_orphans__' - }, - outlets: new _emberUtils.EmptyObject() - }; - } - liveRoutes.outlets.__ember_orphans__.outlets[into] = myState; - _emberMetal.run.schedule('afterRender', function () { - // `wasUsed` gets set by the render helper. - _emberMetal.assert('You attempted to render into \'' + into + '\' but it was not found', liveRoutes.outlets.__ember_orphans__.outlets[into].wasUsed); - }); + var experimentalMacros = []; + + // This is a private API to allow for expiremental macros + // to be created in user space. Registering a macro should + // should be done in an initializer. + + function registerMacros(macro) { + experimentalMacros.push(macro); } - function representEmptyRoute(liveRoutes, defaultParentState, route) { - // the route didn't render anything - var alreadyAppended = findLiveRoute(liveRoutes, route.routeName); - if (alreadyAppended) { - // But some other route has already rendered our default - // template, so that becomes the default target for any - // children we may have. - return alreadyAppended; - } else { - // Create an entry to represent our default template name, - // just so other routes can target it and inherit its place - // in the outlet hierarchy. - defaultParentState.outlets.main = { - render: { - name: route.routeName, - outlet: 'main' - }, - outlets: {} - }; - return defaultParentState; + function populateMacros(blocks, inlines) { + inlines.add('outlet', _emberGlimmerSyntaxOutlet.outletMacro); + inlines.add('component', _emberGlimmerSyntaxDynamicComponent.inlineComponentMacro); + inlines.add('render', _emberGlimmerSyntaxRender.renderMacro); + inlines.add('mount', _emberGlimmerSyntaxMount.mountMacro); + inlines.add('input', _emberGlimmerSyntaxInput.inputMacro); + inlines.add('textarea', _emberGlimmerSyntaxTextArea.textAreaMacro); + inlines.addMissing(refineInlineSyntax); + blocks.add('component', _emberGlimmerSyntaxDynamicComponent.blockComponentMacro); + blocks.add('-with-dynamic-vars', _emberGlimmerSyntaxWithDynamicVars._withDynamicVarsMacro); + blocks.add('-in-element', _emberGlimmerSyntaxInElement._inElementMacro); + blocks.addMissing(refineBlockSyntax); + + for (var i = 0; i < experimentalMacros.length; i++) { + var macro = experimentalMacros[i]; + macro(blocks, inlines); } - } - exports.default = EmberRouter; -}); + experimentalMacros = []; -/** -@module ember -@submodule ember-routing -*/ -enifed('ember-routing/system/router_state', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime'], function (exports, _emberUtils, _emberMetal, _emberRuntime) { + return { blocks: blocks, inlines: inlines }; + } +}); +enifed('ember-glimmer/syntax/-in-element', ['exports', '@glimmer/runtime', '@glimmer/util'], function (exports, _glimmerRuntime, _glimmerUtil) { 'use strict'; - exports.default = _emberRuntime.Object.extend({ - emberRouter: null, - routerJs: null, - routerJsState: null, - - isActiveIntent: function (routeName, models, queryParams, queryParamsMustMatch) { - var state = this.routerJsState; - if (!this.routerJs.isActiveIntent(routeName, models, null, state)) { - return false; - } + exports._inElementMacro = _inElementMacro; + var _BaselineSyntax$NestedBlock = _glimmerRuntime.BaselineSyntax.NestedBlock; + var defaultBlock = _BaselineSyntax$NestedBlock.defaultBlock; + var params = _BaselineSyntax$NestedBlock.params; + var hash = _BaselineSyntax$NestedBlock.hash; - var emptyQueryParams = _emberMetal.isEmpty(Object.keys(queryParams)); + function _inElementMacro(sexp, builder) { + var block = defaultBlock(sexp); + var args = _glimmerRuntime.compileArgs(params(sexp), hash(sexp), builder); - if (queryParamsMustMatch && !emptyQueryParams) { - var visibleQueryParams = {}; - _emberUtils.assign(visibleQueryParams, queryParams); + builder.putArgs(args); + builder.test('simple'); - this.emberRouter._prepareQueryParams(routeName, models, visibleQueryParams); - return shallowEqual(visibleQueryParams, state.queryParams); - } + builder.labelled(null, function (b) { + b.jumpUnless('END'); + b.pushRemoteElement(); + b.evaluate(_glimmerUtil.unwrap(block)); + b.popRemoteElement(); + }); + } +}); +enifed('ember-glimmer/syntax/-text-area', ['exports', 'ember-glimmer/utils/bindings'], function (exports, _emberGlimmerUtilsBindings) { + 'use strict'; - return true; - } - }); + exports.textAreaMacro = textAreaMacro; - function shallowEqual(a, b) { - var k = undefined; - for (k in a) { - if (a.hasOwnProperty(k) && a[k] !== b[k]) { - return false; - } - } - for (k in b) { - if (b.hasOwnProperty(k) && a[k] !== b[k]) { - return false; - } - } + function textAreaMacro(path, params, hash, builder) { + var definition = builder.env.getComponentDefinition(['-text-area'], builder.symbolTable); + _emberGlimmerUtilsBindings.wrapComponentClassAttribute(hash); + builder.component.static(definition, [params, hash, null, null], builder.symbolTable); return true; } }); -enifed('ember-routing/utils', ['exports', 'ember-utils', 'ember-metal'], function (exports, _emberUtils, _emberMetal) { +enifed('ember-glimmer/syntax/-with-dynamic-vars', ['exports', '@glimmer/runtime', '@glimmer/util'], function (exports, _glimmerRuntime, _glimmerUtil) { 'use strict'; - exports.routeArgs = routeArgs; - exports.getActiveTargetName = getActiveTargetName; - exports.stashParamNames = stashParamNames; - exports.calculateCacheKey = calculateCacheKey; - exports.normalizeControllerQueryParams = normalizeControllerQueryParams; - exports.prefixRouteNameArg = prefixRouteNameArg; + exports._withDynamicVarsMacro = _withDynamicVarsMacro; + var _BaselineSyntax$NestedBlock = _glimmerRuntime.BaselineSyntax.NestedBlock; + var defaultBlock = _BaselineSyntax$NestedBlock.defaultBlock; + var params = _BaselineSyntax$NestedBlock.params; + var hash = _BaselineSyntax$NestedBlock.hash; - var ALL_PERIODS_REGEX = /\./g; + function _withDynamicVarsMacro(sexp, builder) { + var block = defaultBlock(sexp); + var args = _glimmerRuntime.compileArgs(params(sexp), hash(sexp), builder); - function routeArgs(targetRouteName, models, queryParams) { - var args = []; - if (typeof targetRouteName === 'string') { - args.push('' + targetRouteName); - } - args.push.apply(args, models); - args.push({ queryParams: queryParams }); - return args; + builder.unit(function (b) { + b.putArgs(args); + b.pushDynamicScope(); + b.bindDynamicScope(args.named.keys); + b.evaluate(_glimmerUtil.unwrap(block)); + b.popDynamicScope(); + }); } +}); +enifed('ember-glimmer/syntax/abstract-manager', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - function getActiveTargetName(router) { - var handlerInfos = router.activeTransition ? router.activeTransition.state.handlerInfos : router.state.handlerInfos; - return handlerInfos[handlerInfos.length - 1].name; - } + var AbstractManager = function AbstractManager() { + babelHelpers.classCallCheck(this, AbstractManager); + }; - function stashParamNames(router, handlerInfos) { - if (handlerInfos._namesStashed) { - return; - } + _emberMetal.runInDebug(function () { + AbstractManager.prototype._pushToDebugStack = function (name, environment) { + this.debugStack = environment.debugStack; + this.debugStack.push(name); + }; - // This helper exists because router.js/route-recognizer.js awkwardly - // keeps separate a handlerInfo's list of parameter names depending - // on whether a URL transition or named transition is happening. - // Hopefully we can remove this in the future. - var targetRouteName = handlerInfos[handlerInfos.length - 1].name; - var recogHandlers = router.router.recognizer.handlersFor(targetRouteName); - var dynamicParent = null; + AbstractManager.prototype._pushEngineToDebugStack = function (name, environment) { + this.debugStack = environment.debugStack; + this.debugStack.pushEngine(name); + }; + }); - for (var i = 0; i < handlerInfos.length; ++i) { - var handlerInfo = handlerInfos[i]; - var names = recogHandlers[i].names; + exports.default = AbstractManager; +}); +enifed('ember-glimmer/syntax/curly-component', ['exports', 'ember-utils', '@glimmer/runtime', 'ember-glimmer/utils/bindings', 'ember-glimmer/component', 'ember-metal', 'ember-views', 'ember-glimmer/utils/process-args', 'container', 'ember-glimmer/syntax/abstract-manager'], function (exports, _emberUtils, _glimmerRuntime, _emberGlimmerUtilsBindings, _emberGlimmerComponent, _emberMetal, _emberViews, _emberGlimmerUtilsProcessArgs, _container, _emberGlimmerSyntaxAbstractManager) { + 'use strict'; - if (names.length) { - dynamicParent = handlerInfo; - } + exports.validatePositionalParameters = validatePositionalParameters; - handlerInfo._names = names; + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['template:components/-default'], ['template:components/-default']); - var route = handlerInfo.handler; - route._stashNames(handlerInfo, dynamicParent); - } + var DEFAULT_LAYOUT = _container.privatize(_templateObject); - handlerInfos._namesStashed = true; - } + function processComponentInitializationAssertions(component, props) { + _emberMetal.assert('classNameBindings must not have spaces in them: ' + component.toString(), (function () { + var classNameBindings = component.classNameBindings; - function _calculateCacheValuePrefix(prefix, part) { - // calculates the dot seperated sections from prefix that are also - // at the start of part - which gives us the route name + for (var i = 0; i < classNameBindings.length; i++) { + var binding = classNameBindings[i]; + if (binding.split(' ').length > 1) { + return false; + } + } + return true; + })()); - // given : prefix = site.article.comments, part = site.article.id - // - returns: site.article (use get(values[site.article], 'id') to get the dynamic part - used below) + _emberMetal.assert('You cannot use `classNameBindings` on a tag-less component: ' + component.toString(), (function () { + var classNameBindings = component.classNameBindings; + var tagName = component.tagName; - // given : prefix = site.article, part = site.article.id - // - returns: site.article. (use get(values[site.article], 'id') to get the dynamic part - used below) + return tagName !== '' || !classNameBindings || classNameBindings.length === 0; + })()); - var prefixParts = prefix.split('.'); - var currPrefix = ''; + _emberMetal.assert('You cannot use `elementId` on a tag-less component: ' + component.toString(), (function () { + var elementId = component.elementId; + var tagName = component.tagName; - for (var i = 0; i < prefixParts.length; i++) { - var currPart = prefixParts.slice(0, i + 1).join('.'); - if (part.indexOf(currPart) !== 0) { - break; - } - currPrefix = currPart; - } + return tagName !== '' || props.id === elementId || !elementId && elementId !== ''; + })()); - return currPrefix; - } + _emberMetal.assert('You cannot use `attributeBindings` on a tag-less component: ' + component.toString(), (function () { + var attributeBindings = component.attributeBindings; + var tagName = component.tagName; - /* - Stolen from Controller - */ + return tagName !== '' || !attributeBindings || attributeBindings.length === 0; + })()); + } - function calculateCacheKey(prefix, _parts, values) { - var parts = _parts || []; - var suffixes = ''; - for (var i = 0; i < parts.length; ++i) { - var part = parts[i]; - var cacheValuePrefix = _calculateCacheValuePrefix(prefix, part); - var value = undefined; - if (values) { - if (cacheValuePrefix && cacheValuePrefix in values) { - var partRemovedPrefix = part.indexOf(cacheValuePrefix) === 0 ? part.substr(cacheValuePrefix.length + 1) : part; - value = _emberMetal.get(values[cacheValuePrefix], partRemovedPrefix); - } else { - value = _emberMetal.get(values, part); - } + function validatePositionalParameters(named, positional, positionalParamsDefinition) { + _emberMetal.runInDebug(function () { + if (!named || !positional || !positional.length) { + return; } - suffixes += '::' + part + ':' + value; - } - return prefix + suffixes.replace(ALL_PERIODS_REGEX, '-'); - } - /* - Controller-defined query parameters can come in three shapes: - - Array - queryParams: ['foo', 'bar'] - Array of simple objects where value is an alias - queryParams: [ - { - 'foo': 'rename_foo_to_this' - }, - { - 'bar': 'call_bar_this_instead' - } - ] - Array of fully defined objects - queryParams: [ - { - 'foo': { - as: 'rename_foo_to_this' - }, - } - { - 'bar': { - as: 'call_bar_this_instead', - scope: 'controller' - } + var paramType = typeof positionalParamsDefinition; + + if (paramType === 'string') { + _emberMetal.assert('You cannot specify positional parameters and the hash argument `' + positionalParamsDefinition + '`.', !named.has(positionalParamsDefinition)); + } else { + if (positional.length < positionalParamsDefinition.length) { + positionalParamsDefinition = positionalParamsDefinition.slice(0, positional.length); } - ] - - This helper normalizes all three possible styles into the - 'Array of fully defined objects' style. - */ - function normalizeControllerQueryParams(queryParams) { - if (queryParams._qpMap) { - return queryParams._qpMap; - } + for (var i = 0; i < positionalParamsDefinition.length; i++) { + var _name = positionalParamsDefinition[i]; - var qpMap = queryParams._qpMap = {}; + _emberMetal.assert('You cannot specify both a positional param (at position ' + i + ') and the hash argument `' + _name + '`.', !named.has(_name)); + } + } + }); + } - for (var i = 0; i < queryParams.length; ++i) { - accumulateQueryParamDescriptors(queryParams[i], qpMap); + function aliasIdToElementId(args, props) { + if (args.named.has('id')) { + _emberMetal.assert('You cannot invoke a component with both \'id\' and \'elementId\' at the same time.', !args.named.has('elementId')); + props.elementId = props.id; } - - return qpMap; } - function accumulateQueryParamDescriptors(_desc, accum) { - var desc = _desc; - var tmp = undefined; - if (typeof desc === 'string') { - tmp = {}; - tmp[desc] = { as: null }; - desc = tmp; - } + // We must traverse the attributeBindings in reverse keeping track of + // what has already been applied. This is essentially refining the concated + // properties applying right to left. + function applyAttributeBindings(element, attributeBindings, component, operations) { + var seen = []; + var i = attributeBindings.length - 1; - for (var key in desc) { - if (!desc.hasOwnProperty(key)) { - return; - } + while (i !== -1) { + var binding = attributeBindings[i]; + var parsed = _emberGlimmerUtilsBindings.AttributeBinding.parse(binding); + var attribute = parsed[1]; - var singleDesc = desc[key]; - if (typeof singleDesc === 'string') { - singleDesc = { as: singleDesc }; + if (seen.indexOf(attribute) === -1) { + seen.push(attribute); + _emberGlimmerUtilsBindings.AttributeBinding.install(element, component, parsed, operations); } - tmp = accum[key] || { as: null, scope: 'model' }; - _emberUtils.assign(tmp, singleDesc); + i--; + } - accum[key] = tmp; + if (seen.indexOf('id') === -1) { + operations.addStaticAttribute(element, 'id', component.elementId); } - } - /* - Check if a routeName resembles a url instead - - @private - */ - function resemblesURL(str) { - return typeof str === 'string' && (str === '' || str.charAt(0) === '/'); + if (seen.indexOf('style') === -1) { + _emberGlimmerUtilsBindings.IsVisibleBinding.install(element, component, operations); + } } - /* - Returns an arguments array where the route name arg is prefixed based on the mount point - - @private - */ + function NOOP() {} - function prefixRouteNameArg(route, args) { - var routeName = args[0]; - var owner = _emberUtils.getOwner(route); - var prefix = owner.mountPoint; + var ComponentStateBucket = (function () { + function ComponentStateBucket(environment, component, args, finalizer) { +babelHelpers.classCallCheck(this, ComponentStateBucket); - // only alter the routeName if it's actually referencing a route. - if (owner.routable && typeof routeName === 'string') { - if (resemblesURL(routeName)) { - throw new _emberMetal.Error('Programmatic transitions by URL cannot be used within an Engine. Please use the route name instead.'); - } else { - routeName = prefix + '.' + routeName; - args[0] = routeName; - } + this.environment = environment; + this.component = component; + this.classRef = null; + this.args = args; + this.argsRevision = args.tag.value(); + this.finalizer = finalizer; } - return args; - } -}); -enifed('ember-runtime/compare', ['exports', 'ember-runtime/utils', 'ember-runtime/mixins/comparable'], function (exports, _emberRuntimeUtils, _emberRuntimeMixinsComparable) { - 'use strict'; + ComponentStateBucket.prototype.destroy = function destroy() { + var component = this.component; + var environment = this.environment; - exports.default = compare; + if (environment.isInteractive) { + component.trigger('willDestroyElement'); + component.trigger('willClearRender'); + } - var TYPE_ORDER = { - 'undefined': 0, - 'null': 1, - 'boolean': 2, - 'number': 3, - 'string': 4, - 'array': 5, - 'object': 6, - 'instance': 7, - 'function': 8, - 'class': 9, - 'date': 10 - }; + environment.destroyedComponents.push(component); + }; - // - // the spaceship operator - // - // `. ___ - // __,' __`. _..----....____ - // __...--.'``;. ,. ;``--..__ .' ,-._ _.-' - // _..-''-------' `' `' `' O ``-''._ (,;') _,' - // ,'________________ \`-._`-',' - // `._ ```````````------...___ '-.._'-: - // ```--.._ ,. ````--...__\-. - // `.--. `-` "INFINITY IS LESS ____ | |` - // `. `. THAN BEYOND" ,'`````. ; ;` - // `._`. __________ `. \'__/` - // `-:._____/______/___/____`. \ ` - // | `._ `. \ - // `._________`-. `. `.___ - // SSt `------'` - function spaceship(a, b) { - var diff = a - b; - return (diff > 0) - (diff < 0); - } + ComponentStateBucket.prototype.finalize = function finalize() { + var finalizer = this.finalizer; - /** - Compares two javascript values and returns: - - - -1 if the first is smaller than the second, - - 0 if both are equal, - - 1 if the first is greater than the second. - - ```javascript - Ember.compare('hello', 'hello'); // 0 - Ember.compare('abc', 'dfg'); // -1 - Ember.compare(2, 1); // 1 - ``` - - If the types of the two objects are different precedence occurs in the - following order, with types earlier in the list considered `<` types - later in the list: - - - undefined - - null - - boolean - - number - - string - - array - - object - - instance - - function - - class - - date - - ```javascript - Ember.compare('hello', 50); // 1 - Ember.compare(50, 'hello'); // -1 - ``` - - @method compare - @for Ember - @param {Object} v First value to compare - @param {Object} w Second value to compare - @return {Number} -1 if v < w, 0 if v = w and 1 if v > w. - @public - */ + finalizer(); + this.finalizer = NOOP; + }; - function compare(v, w) { - if (v === w) { - return 0; - } + return ComponentStateBucket; + })(); - var type1 = _emberRuntimeUtils.typeOf(v); - var type2 = _emberRuntimeUtils.typeOf(w); + function initialRenderInstrumentDetails(component) { + return component.instrumentDetails({ initialRender: true }); + } - if (_emberRuntimeMixinsComparable.default) { - if (type1 === 'instance' && _emberRuntimeMixinsComparable.default.detect(v) && v.constructor.compare) { - return v.constructor.compare(v, w); - } + function rerenderInstrumentDetails(component) { + return component.instrumentDetails({ initialRender: false }); + } - if (type2 === 'instance' && _emberRuntimeMixinsComparable.default.detect(w) && w.constructor.compare) { - return w.constructor.compare(w, v) * -1; - } - } + var CurlyComponentManager = (function (_AbstractManager) { +babelHelpers.inherits(CurlyComponentManager, _AbstractManager); - var res = spaceship(TYPE_ORDER[type1], TYPE_ORDER[type2]); + function CurlyComponentManager() { +babelHelpers.classCallCheck(this, CurlyComponentManager); - if (res !== 0) { - return res; + _AbstractManager.apply(this, arguments); } - // types are equal - so we have to check values now - switch (type1) { - case 'boolean': - case 'number': - return spaceship(v, w); - - case 'string': - return spaceship(v.localeCompare(w), 0); + CurlyComponentManager.prototype.prepareArgs = function prepareArgs(definition, args) { + if (definition.ComponentClass) { + validatePositionalParameters(args.named, args.positional.values, definition.ComponentClass.class.positionalParams); + } - case 'array': - var vLen = v.length; - var wLen = w.length; - var len = Math.min(vLen, wLen); - - for (var i = 0; i < len; i++) { - var r = compare(v[i], w[i]); - if (r !== 0) { - return r; - } - } + return _emberGlimmerUtilsProcessArgs.gatherArgs(args, definition); + }; - // all elements are equal now - // shorter array should be ordered first - return spaceship(vLen, wLen); + CurlyComponentManager.prototype.create = function create(environment, definition, args, dynamicScope, callerSelfRef, hasBlock) { + var _this = this; - case 'instance': - if (_emberRuntimeMixinsComparable.default && _emberRuntimeMixinsComparable.default.detect(v)) { - return v.compare(v, w); - } - return 0; + _emberMetal.runInDebug(function () { + return _this._pushToDebugStack('component:' + definition.name, environment); + }); - case 'date': - return spaceship(v.getTime(), w.getTime()); + var parentView = dynamicScope.view; - default: - return 0; - } - } -}); -enifed('ember-runtime/computed/computed_macros', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; + var factory = definition.ComponentClass; - exports.empty = empty; - exports.notEmpty = notEmpty; - exports.none = none; - exports.not = not; - exports.bool = bool; - exports.match = match; - exports.equal = equal; - exports.gt = gt; - exports.gte = gte; - exports.lt = lt; - exports.lte = lte; - exports.oneWay = oneWay; - exports.readOnly = readOnly; - exports.deprecatingAlias = deprecatingAlias; + var processedArgs = _emberGlimmerUtilsProcessArgs.ComponentArgs.create(args); - /** - @module ember - @submodule ember-metal - */ + var _processedArgs$value = processedArgs.value(); - function expandPropertiesToArray(predicateName, properties) { - var expandedProperties = []; + var props = _processedArgs$value.props; - function extractProperty(entry) { - expandedProperties.push(entry); - } + aliasIdToElementId(args, props); - for (var i = 0; i < properties.length; i++) { - var property = properties[i]; - _emberMetal.assert('Dependent keys passed to Ember.computed.' + predicateName + '() can\'t have spaces.', property.indexOf(' ') < 0); + props.parentView = parentView; + props[_emberGlimmerComponent.HAS_BLOCK] = hasBlock; - _emberMetal.expandProperties(property, extractProperty); - } + props._targetObject = callerSelfRef.value(); - return expandedProperties; - } + var component = factory.create(props); - function generateComputedWithPredicate(name, predicate) { - return function () { - for (var _len = arguments.length, properties = Array(_len), _key = 0; _key < _len; _key++) { - properties[_key] = arguments[_key]; - } + var finalizer = _emberMetal._instrumentStart('render.component', initialRenderInstrumentDetails, component); - var expandedProperties = expandPropertiesToArray(name, properties); + dynamicScope.view = component; - var computedFunc = _emberMetal.computed(function () { - var lastIdx = expandedProperties.length - 1; + if (parentView !== null) { + parentView.appendChild(component); + } - for (var i = 0; i < lastIdx; i++) { - var value = _emberMetal.get(this, expandedProperties[i]); - if (!predicate(value)) { - return value; - } + // We usually do this in the `didCreateElement`, but that hook doesn't fire for tagless components + if (component.tagName === '') { + if (environment.isInteractive) { + component.trigger('willRender'); } - return _emberMetal.get(this, expandedProperties[lastIdx]); - }); - - return computedFunc.property.apply(computedFunc, expandedProperties); - }; - } + component._transitionTo('hasElement'); - /** - A computed property that returns true if the value of the dependent - property is null, an empty string, empty array, or empty function. - - Example - - ```javascript - let ToDoList = Ember.Object.extend({ - isDone: Ember.computed.empty('todos') - }); - - let todoList = ToDoList.create({ - todos: ['Unit Test', 'Documentation', 'Release'] - }); - - todoList.get('isDone'); // false - todoList.get('todos').clear(); - todoList.get('isDone'); // true - ``` - - @since 1.6.0 - @method empty - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which negate - the original value for property - @public - */ + if (environment.isInteractive) { + component.trigger('willInsertElement'); + } + } - function empty(dependentKey) { - return _emberMetal.computed(dependentKey + '.length', function () { - return _emberMetal.isEmpty(_emberMetal.get(this, dependentKey)); - }); - } + var bucket = new ComponentStateBucket(environment, component, processedArgs, finalizer); - /** - A computed property that returns true if the value of the dependent - property is NOT null, an empty string, empty array, or empty function. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - hasStuff: Ember.computed.notEmpty('backpack') - }); - - let hamster = Hamster.create({ backpack: ['Food', 'Sleeping Bag', 'Tent'] }); - - hamster.get('hasStuff'); // true - hamster.get('backpack').clear(); // [] - hamster.get('hasStuff'); // false - ``` - - @method notEmpty - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which returns true if - original value for property is not empty. - @public - */ + if (args.named.has('class')) { + bucket.classRef = args.named.get('class'); + } - function notEmpty(dependentKey) { - return _emberMetal.computed(dependentKey + '.length', function () { - return !_emberMetal.isEmpty(_emberMetal.get(this, dependentKey)); - }); - } + processComponentInitializationAssertions(component, props); - /** - A computed property that returns true if the value of the dependent - property is null or undefined. This avoids errors from JSLint complaining - about use of ==, which can be technically confusing. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - isHungry: Ember.computed.none('food') - }); - - let hamster = Hamster.create(); - - hamster.get('isHungry'); // true - hamster.set('food', 'Banana'); - hamster.get('isHungry'); // false - hamster.set('food', null); - hamster.get('isHungry'); // true - ``` - - @method none - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which - returns true if original value for property is null or undefined. - @public - */ + if (environment.isInteractive && component.tagName !== '') { + component.trigger('willRender'); + } - function none(dependentKey) { - return _emberMetal.computed(dependentKey, function () { - return _emberMetal.isNone(_emberMetal.get(this, dependentKey)); - }); - } + return bucket; + }; - /** - A computed property that returns the inverse boolean value - of the original value for the dependent property. - - Example - - ```javascript - let User = Ember.Object.extend({ - isAnonymous: Ember.computed.not('loggedIn') - }); - - let user = User.create({loggedIn: false}); - - user.get('isAnonymous'); // true - user.set('loggedIn', true); - user.get('isAnonymous'); // false - ``` - - @method not - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which returns - inverse of the original value for property - @public - */ + CurlyComponentManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { + var template = definition.template; + if (!template) { + var component = bucket.component; - function not(dependentKey) { - return _emberMetal.computed(dependentKey, function () { - return !_emberMetal.get(this, dependentKey); - }); - } + template = this.templateFor(component, env); + } + return env.getCompiledBlock(CurlyComponentLayoutCompiler, template); + }; - /** - A computed property that converts the provided dependent property - into a boolean value. - - ```javascript - let Hamster = Ember.Object.extend({ - hasBananas: Ember.computed.bool('numBananas') - }); - - let hamster = Hamster.create(); - - hamster.get('hasBananas'); // false - hamster.set('numBananas', 0); - hamster.get('hasBananas'); // false - hamster.set('numBananas', 1); - hamster.get('hasBananas'); // true - hamster.set('numBananas', null); - hamster.get('hasBananas'); // false - ``` - - @method bool - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which converts - to boolean the original value for property - @public - */ + CurlyComponentManager.prototype.templateFor = function templateFor(component, env) { + var Template = _emberMetal.get(component, 'layout'); + var owner = component[_emberUtils.OWNER]; + if (Template) { + return env.getTemplate(Template, owner); + } + var layoutName = _emberMetal.get(component, 'layoutName'); + if (layoutName) { + var template = owner.lookup('template:' + layoutName); + if (template) { + return template; + } + } + return owner.lookup(DEFAULT_LAYOUT); + }; - function bool(dependentKey) { - return _emberMetal.computed(dependentKey, function () { - return !!_emberMetal.get(this, dependentKey); - }); - } + CurlyComponentManager.prototype.getSelf = function getSelf(_ref) { + var component = _ref.component; - /** - A computed property which matches the original value for the - dependent property against a given RegExp, returning `true` - if the value matches the RegExp and `false` if it does not. - - Example - - ```javascript - let User = Ember.Object.extend({ - hasValidEmail: Ember.computed.match('email', /^.+@.+\..+$/) - }); - - let user = User.create({loggedIn: false}); - - user.get('hasValidEmail'); // false - user.set('email', ''); - user.get('hasValidEmail'); // false - user.set('email', 'ember_hamster@example.com'); - user.get('hasValidEmail'); // true - ``` - - @method match - @for Ember.computed - @param {String} dependentKey - @param {RegExp} regexp - @return {Ember.ComputedProperty} computed property which match - the original value for property against a given RegExp - @public - */ + return component[_emberGlimmerComponent.ROOT_REF]; + }; - function match(dependentKey, regexp) { - return _emberMetal.computed(dependentKey, function () { - var value = _emberMetal.get(this, dependentKey); + CurlyComponentManager.prototype.didCreateElement = function didCreateElement(_ref2, element, operations) { + var component = _ref2.component; + var classRef = _ref2.classRef; + var environment = _ref2.environment; - return typeof value === 'string' ? regexp.test(value) : false; - }); - } + _emberViews.setViewElement(component, element); - /** - A computed property that returns true if the provided dependent property - is equal to the given value. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - napTime: Ember.computed.equal('state', 'sleepy') - }); - - let hamster = Hamster.create(); - - hamster.get('napTime'); // false - hamster.set('state', 'sleepy'); - hamster.get('napTime'); // true - hamster.set('state', 'hungry'); - hamster.get('napTime'); // false - ``` - - @method equal - @for Ember.computed - @param {String} dependentKey - @param {String|Number|Object} value - @return {Ember.ComputedProperty} computed property which returns true if - the original value for property is equal to the given value. - @public - */ + var attributeBindings = component.attributeBindings; + var classNames = component.classNames; + var classNameBindings = component.classNameBindings; - function equal(dependentKey, value) { - return _emberMetal.computed(dependentKey, function () { - return _emberMetal.get(this, dependentKey) === value; - }); - } + if (attributeBindings && attributeBindings.length) { + applyAttributeBindings(element, attributeBindings, component, operations); + } else { + operations.addStaticAttribute(element, 'id', component.elementId); + _emberGlimmerUtilsBindings.IsVisibleBinding.install(element, component, operations); + } - /** - A computed property that returns true if the provided dependent property - is greater than the provided value. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - hasTooManyBananas: Ember.computed.gt('numBananas', 10) - }); - - let hamster = Hamster.create(); - - hamster.get('hasTooManyBananas'); // false - hamster.set('numBananas', 3); - hamster.get('hasTooManyBananas'); // false - hamster.set('numBananas', 11); - hamster.get('hasTooManyBananas'); // true - ``` - - @method gt - @for Ember.computed - @param {String} dependentKey - @param {Number} value - @return {Ember.ComputedProperty} computed property which returns true if - the original value for property is greater than given value. - @public - */ + if (classRef) { + operations.addDynamicAttribute(element, 'class', classRef); + } - function gt(dependentKey, value) { - return _emberMetal.computed(dependentKey, function () { - return _emberMetal.get(this, dependentKey) > value; - }); - } + if (classNames && classNames.length) { + classNames.forEach(function (name) { + operations.addStaticAttribute(element, 'class', name); + }); + } - /** - A computed property that returns true if the provided dependent property - is greater than or equal to the provided value. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - hasTooManyBananas: Ember.computed.gte('numBananas', 10) - }); - - let hamster = Hamster.create(); - - hamster.get('hasTooManyBananas'); // false - hamster.set('numBananas', 3); - hamster.get('hasTooManyBananas'); // false - hamster.set('numBananas', 10); - hamster.get('hasTooManyBananas'); // true - ``` - - @method gte - @for Ember.computed - @param {String} dependentKey - @param {Number} value - @return {Ember.ComputedProperty} computed property which returns true if - the original value for property is greater or equal then given value. - @public - */ + if (classNameBindings && classNameBindings.length) { + classNameBindings.forEach(function (binding) { + _emberGlimmerUtilsBindings.ClassNameBinding.install(element, component, binding, operations); + }); + } - function gte(dependentKey, value) { - return _emberMetal.computed(dependentKey, function () { - return _emberMetal.get(this, dependentKey) >= value; - }); - } + component._transitionTo('hasElement'); - /** - A computed property that returns true if the provided dependent property - is less than the provided value. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - needsMoreBananas: Ember.computed.lt('numBananas', 3) - }); - - let hamster = Hamster.create(); - - hamster.get('needsMoreBananas'); // true - hamster.set('numBananas', 3); - hamster.get('needsMoreBananas'); // false - hamster.set('numBananas', 2); - hamster.get('needsMoreBananas'); // true - ``` - - @method lt - @for Ember.computed - @param {String} dependentKey - @param {Number} value - @return {Ember.ComputedProperty} computed property which returns true if - the original value for property is less then given value. - @public - */ + if (environment.isInteractive) { + component.trigger('willInsertElement'); + } + }; - function lt(dependentKey, value) { - return _emberMetal.computed(dependentKey, function () { - return _emberMetal.get(this, dependentKey) < value; - }); - } + CurlyComponentManager.prototype.didRenderLayout = function didRenderLayout(bucket, bounds) { + var _this2 = this; - /** - A computed property that returns true if the provided dependent property - is less than or equal to the provided value. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - needsMoreBananas: Ember.computed.lte('numBananas', 3) - }); - - let hamster = Hamster.create(); - - hamster.get('needsMoreBananas'); // true - hamster.set('numBananas', 5); - hamster.get('needsMoreBananas'); // false - hamster.set('numBananas', 3); - hamster.get('needsMoreBananas'); // true - ``` - - @method lte - @for Ember.computed - @param {String} dependentKey - @param {Number} value - @return {Ember.ComputedProperty} computed property which returns true if - the original value for property is less or equal than given value. - @public - */ + bucket.component[_emberGlimmerComponent.BOUNDS] = bounds; + bucket.finalize(); - function lte(dependentKey, value) { - return _emberMetal.computed(dependentKey, function () { - return _emberMetal.get(this, dependentKey) <= value; - }); - } + _emberMetal.runInDebug(function () { + return _this2.debugStack.pop(); + }); + }; - /** - A computed property that performs a logical `and` on the - original values for the provided dependent properties. - - You may pass in more than two properties and even use - property brace expansion. The computed property will - return the first falsy value or last truthy value - just like JavaScript's `&&` operator. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - readyForCamp: Ember.computed.and('hasTent', 'hasBackpack'), - readyForHike: Ember.computed.and('hasWalkingStick', 'hasBackpack') - }); - - let tomster = Hamster.create(); - - tomster.get('readyForCamp'); // false - tomster.set('hasTent', true); - tomster.get('readyForCamp'); // false - tomster.set('hasBackpack', true); - tomster.get('readyForCamp'); // true - tomster.set('hasBackpack', 'Yes'); - tomster.get('readyForCamp'); // 'Yes' - tomster.set('hasWalkingStick', null); - tomster.get('readyForHike'); // null - ``` - - @method and - @for Ember.computed - @param {String} dependentKey* - @return {Ember.ComputedProperty} computed property which performs - a logical `and` on the values of all the original values for properties. - @public - */ - var and = generateComputedWithPredicate('and', function (value) { - return value; - }); + CurlyComponentManager.prototype.getTag = function getTag(_ref3) { + var component = _ref3.component; - exports.and = and; - /** - A computed property which performs a logical `or` on the - original values for the provided dependent properties. - - You may pass in more than two properties and even use - property brace expansion. The computed property will - return the first truthy value or last falsy value just - like JavaScript's `||` operator. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - readyForRain: Ember.computed.or('hasJacket', 'hasUmbrella'), - readyForBeach: Ember.computed.or('{hasSunscreen,hasUmbrella}') - }); - - let tomster = Hamster.create(); - - tomster.get('readyForRain'); // undefined - tomster.set('hasUmbrella', true); - tomster.get('readyForRain'); // true - tomster.set('hasJacket', 'Yes'); - tomster.get('readyForRain'); // 'Yes' - tomster.set('hasSunscreen', 'Check'); - tomster.get('readyForBeach'); // 'Check' - ``` - - @method or - @for Ember.computed - @param {String} dependentKey* - @return {Ember.ComputedProperty} computed property which performs - a logical `or` on the values of all the original values for properties. - @public - */ - var or = generateComputedWithPredicate('or', function (value) { - return !value; - }); + return component[_emberGlimmerComponent.DIRTY_TAG]; + }; - exports.or = or; - /** - Creates a new property that is an alias for another property - on an object. Calls to `get` or `set` this property behave as - though they were called on the original property. - - ```javascript - let Person = Ember.Object.extend({ - name: 'Alex Matchneer', - nomen: Ember.computed.alias('name') - }); - - let alex = Person.create(); - - alex.get('nomen'); // 'Alex Matchneer' - alex.get('name'); // 'Alex Matchneer' - - alex.set('nomen', '@machty'); - alex.get('name'); // '@machty' - ``` - - @method alias - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which creates an - alias to the original value for property. - @public - */ + CurlyComponentManager.prototype.didCreate = function didCreate(_ref4) { + var component = _ref4.component; + var environment = _ref4.environment; - /** - Where `computed.alias` aliases `get` and `set`, and allows for bidirectional - data flow, `computed.oneWay` only provides an aliased `get`. The `set` will - not mutate the upstream property, rather causes the current property to - become the value set. This causes the downstream property to permanently - diverge from the upstream property. - - Example - - ```javascript - let User = Ember.Object.extend({ - firstName: null, - lastName: null, - nickName: Ember.computed.oneWay('firstName') - }); - - let teddy = User.create({ - firstName: 'Teddy', - lastName: 'Zeenny' - }); - - teddy.get('nickName'); // 'Teddy' - teddy.set('nickName', 'TeddyBear'); // 'TeddyBear' - teddy.get('firstName'); // 'Teddy' - ``` - - @method oneWay - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which creates a - one way computed property to the original value for property. - @public - */ + if (environment.isInteractive) { + component._transitionTo('inDOM'); + component.trigger('didInsertElement'); + component.trigger('didRender'); + } + }; - function oneWay(dependentKey) { - return _emberMetal.alias(dependentKey).oneWay(); - } + CurlyComponentManager.prototype.update = function update(bucket, _, dynamicScope) { + var _this3 = this; - /** - This is a more semantically meaningful alias of `computed.oneWay`, - whose name is somewhat ambiguous as to which direction the data flows. - - @method reads - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which creates a - one way computed property to the original value for property. - @public - */ + var component = bucket.component; + var args = bucket.args; + var argsRevision = bucket.argsRevision; + var environment = bucket.environment; - /** - Where `computed.oneWay` provides oneWay bindings, `computed.readOnly` provides - a readOnly one way binding. Very often when using `computed.oneWay` one does - not also want changes to propagate back up, as they will replace the value. - - This prevents the reverse flow, and also throws an exception when it occurs. - - Example - - ```javascript - let User = Ember.Object.extend({ - firstName: null, - lastName: null, - nickName: Ember.computed.readOnly('firstName') - }); - - let teddy = User.create({ - firstName: 'Teddy', - lastName: 'Zeenny' - }); - - teddy.get('nickName'); // 'Teddy' - teddy.set('nickName', 'TeddyBear'); // throws Exception - // throw new Ember.Error('Cannot Set: nickName on: ' );` - teddy.get('firstName'); // 'Teddy' - ``` - - @method readOnly - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which creates a - one way computed property to the original value for property. - @since 1.5.0 - @public - */ + _emberMetal.runInDebug(function () { + return _this3._pushToDebugStack(component._debugContainerKey, environment); + }); - function readOnly(dependentKey) { - return _emberMetal.alias(dependentKey).readOnly(); - } + bucket.finalizer = _emberMetal._instrumentStart('render.component', rerenderInstrumentDetails, component); - /** - Creates a new property that is an alias for another property - on an object. Calls to `get` or `set` this property behave as - though they were called on the original property, but also - print a deprecation warning. - - ```javascript - let Hamster = Ember.Object.extend({ - bananaCount: Ember.computed.deprecatingAlias('cavendishCount', { - id: 'hamster.deprecate-banana', - until: '3.0.0' - }) - }); - - let hamster = Hamster.create(); - - hamster.set('bananaCount', 5); // Prints a deprecation warning. - hamster.get('cavendishCount'); // 5 - ``` - - @method deprecatingAlias - @for Ember.computed - @param {String} dependentKey - @param {Object} options Options for `Ember.deprecate`. - @return {Ember.ComputedProperty} computed property which creates an - alias with a deprecation to the original value for property. - @since 1.7.0 - @public - */ + if (!args.tag.validate(argsRevision)) { + var _args$value = args.value(); - function deprecatingAlias(dependentKey, options) { - return _emberMetal.computed(dependentKey, { - get: function (key) { - _emberMetal.deprecate('Usage of `' + key + '` is deprecated, use `' + dependentKey + '` instead.', false, options); - return _emberMetal.get(this, dependentKey); - }, - set: function (key, value) { - _emberMetal.deprecate('Usage of `' + key + '` is deprecated, use `' + dependentKey + '` instead.', false, options); - _emberMetal.set(this, dependentKey, value); - return value; - } - }); - } -}); -enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/compare', 'ember-runtime/utils', 'ember-runtime/system/native_array'], function (exports, _emberUtils, _emberMetal, _emberRuntimeCompare, _emberRuntimeUtils, _emberRuntimeSystemNative_array) { - /** - @module ember - @submodule ember-runtime - */ + var attrs = _args$value.attrs; + var props = _args$value.props; - 'use strict'; + bucket.argsRevision = args.tag.value(); - exports.sum = sum; - exports.max = max; - exports.min = min; - exports.map = map; - exports.mapBy = mapBy; - exports.filter = filter; - exports.filterBy = filterBy; - exports.uniq = uniq; - exports.uniqBy = uniqBy; - exports.intersect = intersect; - exports.setDiff = setDiff; - exports.collect = collect; - exports.sort = sort; + var oldAttrs = component.attrs; + var newAttrs = attrs; - function reduceMacro(dependentKey, callback, initialValue) { - return _emberMetal.computed(dependentKey + '.[]', function () { - var _this = this; + component[_emberGlimmerComponent.IS_DISPATCHING_ATTRS] = true; + component.setProperties(props); + component[_emberGlimmerComponent.IS_DISPATCHING_ATTRS] = false; - var arr = _emberMetal.get(this, dependentKey); + _emberViews.dispatchLifeCycleHook(component, 'didUpdateAttrs', oldAttrs, newAttrs); + _emberViews.dispatchLifeCycleHook(component, 'didReceiveAttrs', oldAttrs, newAttrs); + } - if (arr === null || typeof arr !== 'object') { - return initialValue; + if (environment.isInteractive) { + component.trigger('willUpdate'); + component.trigger('willRender'); } + }; - return arr.reduce(function (previousValue, currentValue, index, array) { - return callback.call(_this, previousValue, currentValue, index, array); - }, initialValue); - }).readOnly(); - } + CurlyComponentManager.prototype.didUpdateLayout = function didUpdateLayout(bucket) { + var _this4 = this; - function arrayMacro(dependentKey, callback) { - // This is a bit ugly - var propertyName = undefined; - if (/@each/.test(dependentKey)) { - propertyName = dependentKey.replace(/\.@each.*$/, ''); - } else { - propertyName = dependentKey; - dependentKey += '.[]'; - } + bucket.finalize(); - return _emberMetal.computed(dependentKey, function () { - var value = _emberMetal.get(this, propertyName); - if (_emberRuntimeUtils.isArray(value)) { - return _emberRuntimeSystemNative_array.A(callback.call(this, value)); - } else { - return _emberRuntimeSystemNative_array.A(); + _emberMetal.runInDebug(function () { + return _this4.debugStack.pop(); + }); + }; + + CurlyComponentManager.prototype.didUpdate = function didUpdate(_ref5) { + var component = _ref5.component; + var environment = _ref5.environment; + + if (environment.isInteractive) { + component.trigger('didUpdate'); + component.trigger('didRender'); } - }).readOnly(); - } + }; - function multiArrayMacro(dependentKeys, callback) { - var args = dependentKeys.map(function (key) { - return key + '.[]'; - }); + CurlyComponentManager.prototype.getDestructor = function getDestructor(stateBucket) { + return stateBucket; + }; - args.push(function () { - return _emberRuntimeSystemNative_array.A(callback.call(this, dependentKeys)); - }); + return CurlyComponentManager; + })(_emberGlimmerSyntaxAbstractManager.default); - return _emberMetal.computed.apply(this, args).readOnly(); - } + var MANAGER = new CurlyComponentManager(); - /** - A computed property that returns the sum of the values - in the dependent array. - - @method sum - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computes the sum of all values in the dependentKey's array - @since 1.4.0 - @public - */ + var TopComponentManager = (function (_CurlyComponentManager) { +babelHelpers.inherits(TopComponentManager, _CurlyComponentManager); - function sum(dependentKey) { - return reduceMacro(dependentKey, function (sum, item) { - return sum + item; - }, 0); - } + function TopComponentManager() { +babelHelpers.classCallCheck(this, TopComponentManager); - /** - A computed property that calculates the maximum value in the - dependent array. This will return `-Infinity` when the dependent - array is empty. - - ```javascript - let Person = Ember.Object.extend({ - childAges: Ember.computed.mapBy('children', 'age'), - maxChildAge: Ember.computed.max('childAges') - }); - - let lordByron = Person.create({ children: [] }); - - lordByron.get('maxChildAge'); // -Infinity - lordByron.get('children').pushObject({ - name: 'Augusta Ada Byron', age: 7 - }); - lordByron.get('maxChildAge'); // 7 - lordByron.get('children').pushObjects([{ - name: 'Allegra Byron', - age: 5 - }, { - name: 'Elizabeth Medora Leigh', - age: 8 - }]); - lordByron.get('maxChildAge'); // 8 - ``` - - If the types of the arguments are not numbers, - they will be converted to numbers and the type - of the return value will always be `Number`. - For example, the max of a list of Date objects will be - the highest timestamp as a `Number`. - This behavior is consistent with `Math.max`. - - @method max - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computes the largest value in the dependentKey's array - @public - */ + _CurlyComponentManager.apply(this, arguments); + } - function max(dependentKey) { - return reduceMacro(dependentKey, function (max, item) { - return Math.max(max, item); - }, -Infinity); - } + TopComponentManager.prototype.create = function create(environment, definition, args, dynamicScope, currentScope, hasBlock) { + var _this5 = this; - /** - A computed property that calculates the minimum value in the - dependent array. This will return `Infinity` when the dependent - array is empty. - - ```javascript - let Person = Ember.Object.extend({ - childAges: Ember.computed.mapBy('children', 'age'), - minChildAge: Ember.computed.min('childAges') - }); - - let lordByron = Person.create({ children: [] }); - - lordByron.get('minChildAge'); // Infinity - lordByron.get('children').pushObject({ - name: 'Augusta Ada Byron', age: 7 - }); - lordByron.get('minChildAge'); // 7 - lordByron.get('children').pushObjects([{ - name: 'Allegra Byron', - age: 5 - }, { - name: 'Elizabeth Medora Leigh', - age: 8 - }]); - lordByron.get('minChildAge'); // 5 - ``` - - If the types of the arguments are not numbers, - they will be converted to numbers and the type - of the return value will always be `Number`. - For example, the min of a list of Date objects will be - the lowest timestamp as a `Number`. - This behavior is consistent with `Math.min`. - - @method min - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computes the smallest value in the dependentKey's array - @public - */ + var component = definition.ComponentClass.create(); - function min(dependentKey) { - return reduceMacro(dependentKey, function (min, item) { - return Math.min(min, item); - }, Infinity); - } + _emberMetal.runInDebug(function () { + return _this5._pushToDebugStack(component._debugContainerKey, environment); + }); - /** - Returns an array mapped via the callback - - The callback method you provide should have the following signature. - `item` is the current item in the iteration. - `index` is the integer index of the current item in the iteration. - - ```javascript - function(item, index); - ``` - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - excitingChores: Ember.computed.map('chores', function(chore, index) { - return chore.toUpperCase() + '!'; - }) - }); - - let hamster = Hamster.create({ - chores: ['clean', 'write more unit tests'] - }); - - hamster.get('excitingChores'); // ['CLEAN!', 'WRITE MORE UNIT TESTS!'] - ``` - - @method map - @for Ember.computed - @param {String} dependentKey - @param {Function} callback - @return {Ember.ComputedProperty} an array mapped via the callback - @public - */ + var finalizer = _emberMetal._instrumentStart('render.component', initialRenderInstrumentDetails, component); - function map(dependentKey, callback) { - return arrayMacro(dependentKey, function (value) { - return value.map(callback, this); - }); - } + dynamicScope.view = component; - /** - Returns an array mapped to the specified key. - - ```javascript - let Person = Ember.Object.extend({ - childAges: Ember.computed.mapBy('children', 'age') - }); - - let lordByron = Person.create({ children: [] }); - - lordByron.get('childAges'); // [] - lordByron.get('children').pushObject({ name: 'Augusta Ada Byron', age: 7 }); - lordByron.get('childAges'); // [7] - lordByron.get('children').pushObjects([{ - name: 'Allegra Byron', - age: 5 - }, { - name: 'Elizabeth Medora Leigh', - age: 8 - }]); - lordByron.get('childAges'); // [7, 5, 8] - ``` - - @method mapBy - @for Ember.computed - @param {String} dependentKey - @param {String} propertyKey - @return {Ember.ComputedProperty} an array mapped to the specified key - @public - */ + // We usually do this in the `didCreateElement`, but that hook doesn't fire for tagless components + if (component.tagName === '') { + if (environment.isInteractive) { + component.trigger('willRender'); + } - function mapBy(dependentKey, propertyKey) { - _emberMetal.assert('Ember.computed.mapBy expects a property string for its second argument, ' + 'perhaps you meant to use "map"', typeof propertyKey === 'string'); + component._transitionTo('hasElement'); - return map(dependentKey + '.@each.' + propertyKey, function (item) { - return _emberMetal.get(item, propertyKey); - }); - } + if (environment.isInteractive) { + component.trigger('willInsertElement'); + } + } - /** - Filters the array by the callback. - - The callback method you provide should have the following signature. - `item` is the current item in the iteration. - `index` is the integer index of the current item in the iteration. - `array` is the dependant array itself. - - ```javascript - function(item, index, array); - ``` - - ```javascript - let Hamster = Ember.Object.extend({ - remainingChores: Ember.computed.filter('chores', function(chore, index, array) { - return !chore.done; - }) - }); - - let hamster = Hamster.create({ - chores: [ - { name: 'cook', done: true }, - { name: 'clean', done: true }, - { name: 'write more unit tests', done: false } - ] - }); - - hamster.get('remainingChores'); // [{name: 'write more unit tests', done: false}] - ``` - - @method filter - @for Ember.computed - @param {String} dependentKey - @param {Function} callback - @return {Ember.ComputedProperty} the filtered array - @public - */ + processComponentInitializationAssertions(component, {}); - function filter(dependentKey, callback) { - return arrayMacro(dependentKey, function (value) { - return value.filter(callback, this); - }); - } + return new ComponentStateBucket(environment, component, args, finalizer); + }; - /** - Filters the array by the property and value - - ```javascript - let Hamster = Ember.Object.extend({ - remainingChores: Ember.computed.filterBy('chores', 'done', false) - }); - - let hamster = Hamster.create({ - chores: [ - { name: 'cook', done: true }, - { name: 'clean', done: true }, - { name: 'write more unit tests', done: false } - ] - }); - - hamster.get('remainingChores'); // [{ name: 'write more unit tests', done: false }] - ``` - - @method filterBy - @for Ember.computed - @param {String} dependentKey - @param {String} propertyKey - @param {*} value - @return {Ember.ComputedProperty} the filtered array - @public - */ + return TopComponentManager; + })(CurlyComponentManager); - function filterBy(dependentKey, propertyKey, value) { - var callback = undefined; + var ROOT_MANAGER = new TopComponentManager(); - if (arguments.length === 2) { - callback = function (item) { - return _emberMetal.get(item, propertyKey); - }; - } else { - callback = function (item) { - return _emberMetal.get(item, propertyKey) === value; - }; - } + function tagName(vm) { + var tagName = vm.dynamicScope().view.tagName; - return filter(dependentKey + '.@each.' + propertyKey, callback); + return _glimmerRuntime.PrimitiveReference.create(tagName === '' ? null : tagName || 'div'); } - /** - A computed property which returns a new array with all the unique - elements from one or more dependent arrays. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - uniqueFruits: Ember.computed.uniq('fruits') - }); - - let hamster = Hamster.create({ - fruits: [ - 'banana', - 'grape', - 'kale', - 'banana' - ] - }); - - hamster.get('uniqueFruits'); // ['banana', 'grape', 'kale'] - ``` - - @method uniq - @for Ember.computed - @param {String} propertyKey* - @return {Ember.ComputedProperty} computes a new array with all the - unique elements from the dependent array - @public - */ + function ariaRole(vm) { + return vm.getSelf().get('ariaRole'); + } - function uniq() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; + var CurlyComponentDefinition = (function (_ComponentDefinition) { +babelHelpers.inherits(CurlyComponentDefinition, _ComponentDefinition); + + function CurlyComponentDefinition(name, ComponentClass, template, args) { +babelHelpers.classCallCheck(this, CurlyComponentDefinition); + + _ComponentDefinition.call(this, name, MANAGER, ComponentClass); + this.template = template; + this.args = args; } - return multiArrayMacro(args, function (dependentKeys) { - var _this2 = this; + return CurlyComponentDefinition; + })(_glimmerRuntime.ComponentDefinition); - var uniq = _emberRuntimeSystemNative_array.A(); + exports.CurlyComponentDefinition = CurlyComponentDefinition; - dependentKeys.forEach(function (dependentKey) { - var value = _emberMetal.get(_this2, dependentKey); - if (_emberRuntimeUtils.isArray(value)) { - value.forEach(function (item) { - if (uniq.indexOf(item) === -1) { - uniq.push(item); - } - }); + var RootComponentDefinition = (function (_ComponentDefinition2) { +babelHelpers.inherits(RootComponentDefinition, _ComponentDefinition2); + + function RootComponentDefinition(instance) { +babelHelpers.classCallCheck(this, RootComponentDefinition); + + _ComponentDefinition2.call(this, '-root', ROOT_MANAGER, { + class: instance.constructor, + create: function () { + return instance; } }); + this.template = undefined; + this.args = undefined; + } - return uniq; - }); + return RootComponentDefinition; + })(_glimmerRuntime.ComponentDefinition); + + exports.RootComponentDefinition = RootComponentDefinition; + + var CurlyComponentLayoutCompiler = (function () { + function CurlyComponentLayoutCompiler(template) { +babelHelpers.classCallCheck(this, CurlyComponentLayoutCompiler); + + this.template = template; + } + + CurlyComponentLayoutCompiler.prototype.compile = function compile(builder) { + builder.wrapLayout(this.template.asLayout()); + builder.tag.dynamic(tagName); + builder.attrs.dynamic('role', ariaRole); + builder.attrs.static('class', 'ember-view'); + }; + + return CurlyComponentLayoutCompiler; + })(); + + CurlyComponentLayoutCompiler.id = 'curly'; +}); +enifed('ember-glimmer/syntax/dynamic-component', ['exports', '@glimmer/runtime', '@glimmer/reference', 'ember-metal'], function (exports, _glimmerRuntime, _glimmerReference, _emberMetal) { + 'use strict'; + + exports.closureComponentMacro = closureComponentMacro; + exports.dynamicComponentMacro = dynamicComponentMacro; + exports.blockComponentMacro = blockComponentMacro; + exports.inlineComponentMacro = inlineComponentMacro; + + function dynamicComponentFor(vm, symbolTable) { + var env = vm.env; + var args = vm.getArgs(); + var nameRef = args.positional.at(0); + + return new DynamicComponentReference({ nameRef: nameRef, env: env, symbolTable: symbolTable }); } - /** - A computed property which returns a new array with all the unique - elements from an array, with uniqueness determined by specific key. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - uniqueFruits: Ember.computed.uniqBy('fruits', 'id') - }); - let hamster = Hamster.create({ - fruits: [ - { id: 1, 'banana' }, - { id: 2, 'grape' }, - { id: 3, 'peach' }, - { id: 1, 'banana' } - ] - }); - hamster.get('uniqueFruits'); // [ { id: 1, 'banana' }, { id: 2, 'grape' }, { id: 3, 'peach' }] - ``` - - @method uniqBy - @for Ember.computed - @param {String} dependentKey - @param {String} propertyKey - @return {Ember.ComputedProperty} computes a new array with all the - unique elements from the dependent array - @public - */ + function closureComponentMacro(path, params, hash, _default, inverse, builder) { + var definitionArgs = [[['get', path]], hash, _default, inverse]; + var args = [params, hash, _default, inverse]; + builder.component.dynamic(definitionArgs, dynamicComponentFor, args, builder.symbolTable); + return true; + } - function uniqBy(dependentKey, propertyKey) { - return _emberMetal.computed(dependentKey + '.[]', function () { - var uniq = _emberRuntimeSystemNative_array.A(); - var seen = new _emberUtils.EmptyObject(); - var list = _emberMetal.get(this, dependentKey); - if (_emberRuntimeUtils.isArray(list)) { - list.forEach(function (item) { - var guid = _emberUtils.guidFor(_emberMetal.get(item, propertyKey)); - if (!(guid in seen)) { - seen[guid] = true; - uniq.push(item); - } - }); - } - return uniq; - }).readOnly(); + function dynamicComponentMacro(params, hash, _default, inverse, builder) { + var definitionArgs = [params.slice(0, 1), null, null, null]; + var args = [params.slice(1), hash, null, null]; + builder.component.dynamic(definitionArgs, dynamicComponentFor, args, builder.symbolTable); + return true; } - /** - Alias for [Ember.computed.uniq](/api/#method_computed_uniq). - - @method union - @for Ember.computed - @param {String} propertyKey* - @return {Ember.ComputedProperty} computes a new array with all the - unique elements from the dependent array - @public - */ - var union = uniq; + function blockComponentMacro(sexp, builder) { + var params = sexp[2]; + var hash = sexp[3]; + var _default = sexp[4]; + var inverse = sexp[5]; - exports.union = union; - /** - A computed property which returns a new array with all the duplicated - elements from two or more dependent arrays. - - Example - - ```javascript - let obj = Ember.Object.extend({ - friendsInCommon: Ember.computed.intersect('adaFriends', 'charlesFriends') - }).create({ - adaFriends: ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'], - charlesFriends: ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock'] - }); - - obj.get('friendsInCommon'); // ['William King', 'Mary Somerville'] - ``` - - @method intersect - @for Ember.computed - @param {String} propertyKey* - @return {Ember.ComputedProperty} computes a new array with all the - duplicated elements from the dependent arrays - @public - */ + var definitionArgs = [params.slice(0, 1), null, null, null]; + var args = [params.slice(1), hash, _default, inverse]; + builder.component.dynamic(definitionArgs, dynamicComponentFor, args, builder.symbolTable); + return true; + } - function intersect() { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; + function inlineComponentMacro(path, params, hash, builder) { + var definitionArgs = [params.slice(0, 1), null, null, null]; + var args = [params.slice(1), hash, null, null]; + builder.component.dynamic(definitionArgs, dynamicComponentFor, args, builder.symbolTable); + return true; + } + + var DynamicComponentReference = (function () { + function DynamicComponentReference(_ref) { + var nameRef = _ref.nameRef; + var env = _ref.env; + var symbolTable = _ref.symbolTable; + var args = _ref.args; + babelHelpers.classCallCheck(this, DynamicComponentReference); + + this.tag = nameRef.tag; + this.nameRef = nameRef; + this.env = env; + this.symbolTable = symbolTable; + this.args = args; } - return multiArrayMacro(args, function (dependentKeys) { - var _this3 = this; + DynamicComponentReference.prototype.value = function value() { + var env = this.env; + var nameRef = this.nameRef; + var symbolTable = this.symbolTable; - var arrays = dependentKeys.map(function (dependentKey) { - var array = _emberMetal.get(_this3, dependentKey); + var nameOrDef = nameRef.value(); - return _emberRuntimeUtils.isArray(array) ? array : []; - }); + if (typeof nameOrDef === 'string') { + var definition = env.getComponentDefinition([nameOrDef], symbolTable); - var results = arrays.pop().filter(function (candidate) { - for (var i = 0; i < arrays.length; i++) { - var found = false; - var array = arrays[i]; - for (var j = 0; j < array.length; j++) { - if (array[j] === candidate) { - found = true; - break; - } - } + _emberMetal.assert('Could not find component named "' + nameOrDef + '" (no component or template with that name was found)', definition); - if (found === false) { - return false; - } - } + return definition; + } else if (_glimmerRuntime.isComponentDefinition(nameOrDef)) { + return nameOrDef; + } else { + return null; + } + }; - return true; - }); + DynamicComponentReference.prototype.get = function get() { + return _glimmerReference.UNDEFINED_REFERENCE; + }; - return _emberRuntimeSystemNative_array.A(results); - }); + return DynamicComponentReference; + })(); +}); +enifed('ember-glimmer/syntax/input', ['exports', 'ember-metal', 'ember-glimmer/utils/bindings', 'ember-glimmer/syntax/dynamic-component'], function (exports, _emberMetal, _emberGlimmerUtilsBindings, _emberGlimmerSyntaxDynamicComponent) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; + + exports.inputMacro = inputMacro; + + function buildTextFieldSyntax(params, hash, builder) { + var definition = builder.env.getComponentDefinition(['-text-field'], builder.symbolTable); + builder.component.static(definition, [params, hash, null, null], builder.symbolTable); + return true; } /** - A computed property which returns a new array with all the - properties from the first dependent array that are not in the second - dependent array. + The `{{input}}` helper lets you create an HTML `` component. + It causes an `Ember.TextField` component to be rendered. For more info, + see the [Ember.TextField](/api/classes/Ember.TextField.html) docs and + the [templates guide](http://emberjs.com/guides/templates/input-helpers/). + + ```handlebars + {{input value="987"}} + ``` + + renders as: + + ```HTML + + ``` + + ### Text field + + If no `type` option is specified, a default of type 'text' is used. + Many of the standard HTML attributes may be passed to this helper. + + + + + + + + + + + +
    `readonly``required``autofocus`
    `value``placeholder``disabled`
    `size``tabindex``maxlength`
    `name``min``max`
    `pattern``accept``autocomplete`
    `autosave``formaction``formenctype`
    `formmethod``formnovalidate``formtarget`
    `height``inputmode``multiple`
    `step``width``form`
    `selectionDirection``spellcheck` 
    + When set to a quoted string, these values will be directly applied to the HTML + element. When left unquoted, these values will be bound to a property on the + template's current rendering context (most typically a controller instance). + A very common use of this helper is to bind the `value` of an input to an Object's attribute: + + ```handlebars + Search: + {{input value=searchWord}} + ``` + + In this example, the inital value in the `` will be set to the value of `searchWord`. + If the user changes the text, the value of `searchWord` will also be updated. + + ### Actions + + The helper can send multiple actions based on user events. + The action property defines the action which is sent when + the user presses the return key. + + ```handlebars + {{input action="submit"}} + ``` + + The helper allows some user events to send actions. + + * `enter` + * `insert-newline` + * `escape-press` + * `focus-in` + * `focus-out` + * `key-press` + * `key-up` + + For example, if you desire an action to be sent when the input is blurred, + you only need to setup the action name to the event name property. + + ```handlebars + {{input focus-out="alertMessage"}} + ``` + See more about [Text Support Actions](/api/classes/Ember.TextField.html) - Example + ### Extending `Ember.TextField` + + Internally, `{{input type="text"}}` creates an instance of `Ember.TextField`, passing + arguments from the helper to `Ember.TextField`'s `create` method. You can extend the + capabilities of text inputs in your applications by reopening this class. For example, + if you are building a Bootstrap project where `data-*` attributes are used, you + can add one to the `TextField`'s `attributeBindings` property: ```javascript - let Hamster = Ember.Object.extend({ - likes: ['banana', 'grape', 'kale'], - wants: Ember.computed.setDiff('likes', 'fruits') + Ember.TextField.reopen({ + attributeBindings: ['data-error'] }); + ``` - let hamster = Hamster.create({ - fruits: [ - 'grape', - 'kale', - ] - }); + Keep in mind when writing `Ember.TextField` subclasses that `Ember.TextField` + itself extends `Ember.Component`. Expect isolated component semantics, not + legacy 1.x view semantics (like `controller` being present). + See more about [Ember components](/api/classes/Ember.Component.html) - hamster.get('wants'); // ['banana'] + ### Checkbox + + Checkboxes are special forms of the `{{input}}` helper. To create a ``: + + ```handlebars + Emberize Everything: + {{input type="checkbox" name="isEmberized" checked=isEmberized}} ``` - @method setDiff - @for Ember.computed - @param {String} setAProperty - @param {String} setBProperty - @return {Ember.ComputedProperty} computes a new array with all the - items from the first dependent array that are not in the second - dependent array - @public - */ - - function setDiff(setAProperty, setBProperty) { - if (arguments.length !== 2) { - throw new _emberMetal.Error('setDiff requires exactly two dependent arrays.'); - } - - return _emberMetal.computed(setAProperty + '.[]', setBProperty + '.[]', function () { - var setA = this.get(setAProperty); - var setB = this.get(setBProperty); - - if (!_emberRuntimeUtils.isArray(setA)) { - return _emberRuntimeSystemNative_array.A(); - } - if (!_emberRuntimeUtils.isArray(setB)) { - return _emberRuntimeSystemNative_array.A(setA); - } - - return setA.filter(function (x) { - return setB.indexOf(x) === -1; - }); - }).readOnly(); - } - - /** - A computed property that returns the array of values - for the provided dependent properties. + This will bind checked state of this checkbox to the value of `isEmberized` -- if either one changes, + it will be reflected in the other. - Example + The following HTML attributes can be set via the helper: - ```javascript - let Hamster = Ember.Object.extend({ - clothes: Ember.computed.collect('hat', 'shirt') - }); + * `checked` + * `disabled` + * `tabindex` + * `indeterminate` + * `name` + * `autofocus` + * `form` - let hamster = Hamster.create(); + ### Extending `Ember.Checkbox` - hamster.get('clothes'); // [null, null] - hamster.set('hat', 'Camp Hat'); - hamster.set('shirt', 'Camp Shirt'); - hamster.get('clothes'); // ['Camp Hat', 'Camp Shirt'] + Internally, `{{input type="checkbox"}}` creates an instance of `Ember.Checkbox`, passing + arguments from the helper to `Ember.Checkbox`'s `create` method. You can extend the + capablilties of checkbox inputs in your applications by reopening this class. For example, + if you wanted to add a css class to all checkboxes in your application: + + ```javascript + Ember.Checkbox.reopen({ + classNames: ['my-app-checkbox'] + }); ``` - @method collect - @for Ember.computed - @param {String} dependentKey* - @return {Ember.ComputedProperty} computed property which maps - values of all passed in properties to an array. + @method input + @for Ember.Templates.helpers + @param {Hash} options @public */ - function collect() { - for (var _len3 = arguments.length, dependentKeys = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - dependentKeys[_key3] = arguments[_key3]; + function inputMacro(path, params, hash, builder) { + var keys = undefined; + var values = undefined; + var typeIndex = -1; + var valueIndex = -1; + + if (hash) { + keys = hash[0]; + values = hash[1]; + typeIndex = keys.indexOf('type'); + valueIndex = keys.indexOf('value'); } - return multiArrayMacro(dependentKeys, function () { - var properties = _emberMetal.getProperties(this, dependentKeys); - var res = _emberRuntimeSystemNative_array.A(); - for (var key in properties) { - if (properties.hasOwnProperty(key)) { - if (_emberMetal.isNone(properties[key])) { - res.push(null); - } else { - res.push(properties[key]); - } + if (!params) { + params = []; + } + + if (typeIndex > -1) { + var typeArg = values[typeIndex]; + if (!Array.isArray(typeArg)) { + if (typeArg === 'checkbox') { + _emberMetal.assert('{{input type=\'checkbox\'}} does not support setting `value=someBooleanValue`; ' + 'you must use `checked=someBooleanValue` instead.', valueIndex === -1); + + _emberGlimmerUtilsBindings.wrapComponentClassAttribute(hash); + + var definition = builder.env.getComponentDefinition(['-checkbox'], builder.symbolTable); + builder.component.static(definition, [params, hash, null, null], builder.symbolTable); + return true; + } else { + return buildTextFieldSyntax(params, hash, builder); } } - return res; - }); + } else { + return buildTextFieldSyntax(params, hash, builder); + } + + return _emberGlimmerSyntaxDynamicComponent.dynamicComponentMacro(params, hash, null, null, builder); } +}); +enifed('ember-glimmer/syntax/mount', ['exports', '@glimmer/runtime', '@glimmer/reference', 'ember-metal', 'ember-glimmer/utils/references', 'ember-routing', 'ember-glimmer/syntax/outlet', 'container', 'ember-glimmer/syntax/abstract-manager'], function (exports, _glimmerRuntime, _glimmerReference, _emberMetal, _emberGlimmerUtilsReferences, _emberRouting, _emberGlimmerSyntaxOutlet, _container, _emberGlimmerSyntaxAbstractManager) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; + + exports.mountMacro = mountMacro; /** - A computed property which returns a new array with all the - properties from the first dependent array sorted based on a property - or sort function. + The `{{mount}}` helper lets you embed a routeless engine in a template. + Mounting an engine will cause an instance to be booted and its `application` + template to be rendered. - The callback method you provide should have the following signature: + For example, the following template mounts the `ember-chat` engine: - ```javascript - function(itemA, itemB); + ```handlebars + {{! application.hbs }} + {{mount "ember-chat"}} ``` - - `itemA` the first item to compare. - - `itemB` the second item to compare. - - This function should return negative number (e.g. `-1`) when `itemA` should come before - `itemB`. It should return positive number (e.g. `1`) when `itemA` should come after - `itemB`. If the `itemA` and `itemB` are equal this function should return `0`. - - Therefore, if this function is comparing some numeric values, simple `itemA - itemB` or - `itemA.get( 'foo' ) - itemB.get( 'foo' )` can be used instead of series of `if`. - - Example - - ```javascript - let ToDoList = Ember.Object.extend({ - // using standard ascending sort - todosSorting: ['name'], - sortedTodos: Ember.computed.sort('todos', 'todosSorting'), - - // using descending sort - todosSortingDesc: ['name:desc'], - sortedTodosDesc: Ember.computed.sort('todos', 'todosSortingDesc'), - - // using a custom sort function - priorityTodos: Ember.computed.sort('todos', function(a, b){ - if (a.priority > b.priority) { - return 1; - } else if (a.priority < b.priority) { - return -1; - } - - return 0; - }) - }); - - let todoList = ToDoList.create({todos: [ - { name: 'Unit Test', priority: 2 }, - { name: 'Documentation', priority: 3 }, - { name: 'Release', priority: 1 } - ]}); - - todoList.get('sortedTodos'); // [{ name:'Documentation', priority:3 }, { name:'Release', priority:1 }, { name:'Unit Test', priority:2 }] - todoList.get('sortedTodosDesc'); // [{ name:'Unit Test', priority:2 }, { name:'Release', priority:1 }, { name:'Documentation', priority:3 }] - todoList.get('priorityTodos'); // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }] - ``` + Currently, the engine name is the only argument that can be passed to + `{{mount}}`. - @method sort - @for Ember.computed - @param {String} itemsKey - @param {String or Function} sortDefinition a dependent key to an - array of sort properties (add `:desc` to the arrays sort properties to sort descending) or a function to use when sorting - @return {Ember.ComputedProperty} computes a new sorted array based - on the sort property array or callback function + @method mount + @for Ember.Templates.helpers + @category ember-application-engines @public */ - function sort(itemsKey, sortDefinition) { - _emberMetal.assert('Ember.computed.sort requires two arguments: an array key to sort and ' + 'either a sort properties key or sort function', arguments.length === 2); + function mountMacro(path, params, hash, builder) { + _emberMetal.assert('You can only pass a single argument to the {{mount}} helper, e.g. {{mount "chat-engine"}}.', params.length === 1 && hash === null); - if (typeof sortDefinition === 'function') { - return customSort(itemsKey, sortDefinition); - } else { - return propertySort(itemsKey, sortDefinition); - } + var name = params[0]; + + _emberMetal.assert('The first argument of {{mount}} must be quoted, e.g. {{mount "chat-engine"}}.', typeof name === 'string'); + + _emberMetal.assert('You used `{{mount \'' + name + '\'}}`, but the engine \'' + name + '\' can not be found.', builder.env.owner.hasRegistration('engine:' + name)); + + builder.component.static(new MountDefinition(name, builder.env), [params, hash, null, null], builder.symbolTable); + return true; } - function customSort(itemsKey, comparator) { - return arrayMacro(itemsKey, function (value) { - var _this4 = this; + var MountManager = (function (_AbstractManager) { + babelHelpers.inherits(MountManager, _AbstractManager); - return value.slice().sort(function (x, y) { - return comparator.call(_this4, x, y); + function MountManager() { + babelHelpers.classCallCheck(this, MountManager); + + _AbstractManager.apply(this, arguments); + } + + MountManager.prototype.prepareArgs = function prepareArgs(definition, args) { + return args; + }; + + MountManager.prototype.create = function create(environment, _ref, args, dynamicScope) { + var name = _ref.name; + var env = _ref.env; + + var _this = this; + + _emberMetal.runInDebug(function () { + return _this._pushEngineToDebugStack('engine:' + name, env); }); - }); - } - // This one needs to dynamically set up and tear down observers on the itemsKey - // depending on the sortProperties - function propertySort(itemsKey, sortPropertiesKey) { - var cp = new _emberMetal.ComputedProperty(function (key) { - var _this5 = this; + dynamicScope.outletState = _glimmerReference.UNDEFINED_REFERENCE; - var itemsKeyIsAtThis = itemsKey === '@this'; - var sortProperties = _emberMetal.get(this, sortPropertiesKey); + var engine = env.owner.buildChildEngineInstance(name); - _emberMetal.assert('The sort definition for \'' + key + '\' on ' + this + ' must be a function or an array of strings', _emberRuntimeUtils.isArray(sortProperties) && sortProperties.every(function (s) { - return typeof s === 'string'; - })); + engine.boot(); - var normalizedSortProperties = normalizeSortProperties(sortProperties); + return { engine: engine }; + }; - // Add/remove property observers as required. - var activeObserversMap = cp._activeObserverMap || (cp._activeObserverMap = new _emberMetal.WeakMap()); - var activeObservers = activeObserversMap.get(this); + MountManager.prototype.layoutFor = function layoutFor(definition, _ref2, env) { + var engine = _ref2.engine; - if (activeObservers) { - activeObservers.forEach(function (args) { - return _emberMetal.removeObserver.apply(null, args); - }); - } + var template = engine.lookup('template:application'); + return env.getCompiledBlock(_emberGlimmerSyntaxOutlet.OutletLayoutCompiler, template); + }; - function sortPropertyDidChange() { - this.notifyPropertyChange(key); - } + MountManager.prototype.getSelf = function getSelf(_ref3) { + var engine = _ref3.engine; - activeObservers = normalizedSortProperties.map(function (_ref) { - var prop = _ref[0]; + var applicationFactory = engine[_container.FACTORY_FOR]('controller:application'); + var factory = applicationFactory || _emberRouting.generateControllerFactory(engine, 'application'); + return new _emberGlimmerUtilsReferences.RootReference(factory.create()); + }; - var path = itemsKeyIsAtThis ? '@each.' + prop : itemsKey + '.@each.' + prop; - var args = [_this5, path, sortPropertyDidChange]; - _emberMetal.addObserver.apply(null, args); - return args; - }); + MountManager.prototype.getTag = function getTag() { + return null; + }; - activeObserversMap.set(this, activeObservers); + MountManager.prototype.getDestructor = function getDestructor(_ref4) { + var engine = _ref4.engine; - // Sort and return the array. - var items = itemsKeyIsAtThis ? this : _emberMetal.get(this, itemsKey); + return engine; + }; - if (_emberRuntimeUtils.isArray(items)) { - return sortByNormalizedSortProperties(items, normalizedSortProperties); - } else { - return _emberRuntimeSystemNative_array.A(); - } - }); + MountManager.prototype.didCreateElement = function didCreateElement() {}; - cp._activeObserverMap = undefined; + MountManager.prototype.didRenderLayout = function didRenderLayout() { + var _this2 = this; - return cp.property(sortPropertiesKey + '.[]').readOnly(); - } + _emberMetal.runInDebug(function () { + return _this2.debugStack.pop(); + }); + }; - function normalizeSortProperties(sortProperties) { - return sortProperties.map(function (p) { - var _p$split = p.split(':'); + MountManager.prototype.didCreate = function didCreate(state) {}; - var prop = _p$split[0]; - var direction = _p$split[1]; + MountManager.prototype.update = function update(state, args, dynamicScope) {}; - direction = direction || 'asc'; + MountManager.prototype.didUpdateLayout = function didUpdateLayout() {}; - return [prop, direction]; - }); - } + MountManager.prototype.didUpdate = function didUpdate(state) {}; - function sortByNormalizedSortProperties(items, normalizedSortProperties) { - return _emberRuntimeSystemNative_array.A(items.slice().sort(function (itemA, itemB) { - for (var i = 0; i < normalizedSortProperties.length; i++) { - var _normalizedSortProperties$i = normalizedSortProperties[i]; - var prop = _normalizedSortProperties$i[0]; - var direction = _normalizedSortProperties$i[1]; + return MountManager; + })(_emberGlimmerSyntaxAbstractManager.default); - var result = _emberRuntimeCompare.default(_emberMetal.get(itemA, prop), _emberMetal.get(itemB, prop)); - if (result !== 0) { - return direction === 'desc' ? -1 * result : result; - } - } + var MOUNT_MANAGER = new MountManager(); - return 0; - })); - } -}); -enifed('ember-runtime/controllers/controller', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/mixins/controller', 'ember-runtime/inject', 'ember-runtime/mixins/action_handler'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeMixinsController, _emberRuntimeInject, _emberRuntimeMixinsAction_handler) { - 'use strict'; + var MountDefinition = (function (_ComponentDefinition) { + babelHelpers.inherits(MountDefinition, _ComponentDefinition); + + function MountDefinition(name, env) { + babelHelpers.classCallCheck(this, MountDefinition); + + _ComponentDefinition.call(this, name, MOUNT_MANAGER, null); + this.env = env; + } + return MountDefinition; + })(_glimmerRuntime.ComponentDefinition); +}); +enifed('ember-glimmer/syntax/outlet', ['exports', 'ember-utils', '@glimmer/runtime', 'ember-metal', 'ember-glimmer/utils/references', 'ember-glimmer/syntax/abstract-manager', '@glimmer/reference'], function (exports, _emberUtils, _glimmerRuntime, _emberMetal, _emberGlimmerUtilsReferences, _emberGlimmerSyntaxAbstractManager, _glimmerReference) { /** @module ember - @submodule ember-runtime + @submodule ember-glimmer */ + 'use strict'; - /** - @class Controller - @namespace Ember - @extends Ember.Object - @uses Ember.ControllerMixin - @public - */ - var Controller = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsController.default); + exports.outletMacro = outletMacro; - _emberRuntimeMixinsAction_handler.deprecateUnderscoreActions(Controller); + function outletComponentFor(vm) { + var _vm$dynamicScope = vm.dynamicScope(); - function controllerInjectionHelper(factory) { - _emberMetal.assert('Defining an injected controller property on a ' + 'non-controller is not allowed.', _emberRuntimeMixinsController.default.detect(factory.PrototypeMixin)); + var outletState = _vm$dynamicScope.outletState; + + var args = vm.getArgs(); + var outletNameRef = undefined; + if (args.positional.length === 0) { + outletNameRef = new _glimmerReference.ConstReference('main'); + } else { + outletNameRef = args.positional.at(0); + } + + return new OutletComponentReference(outletNameRef, outletState); } /** - Creates a property that lazily looks up another controller in the container. - Can only be used when defining another controller. + 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: - Example: + ```handlebars + {{! app/templates/application.hbs }} + + {{my-header}} +
    + + {{outlet}} +
    + + {{my-footer}} + ``` - ```javascript - App.PostController = Ember.Controller.extend({ - posts: Ember.inject.controller() - }); + 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"}} ``` - This example will create a `posts` property on the `post` controller that - looks up the `posts` controller in the container, making it easy to - reference other controllers. This is functionally equivalent to: + Your routes can then render into a specific one of these `outlet`s by specifying the `outlet` + attribute in your `renderTemplate` function: ```javascript - App.PostController = Ember.Controller.extend({ - needs: 'posts', - posts: Ember.computed.alias('controllers.posts') + // app/routes/menu.js + export default Ember.Route.extend({ + renderTemplate() { + this.render({ outlet: 'menu' }); + } }); ``` - @method controller - @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 + 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. + + @method outlet + @param {String} [name] + @for Ember.Templates.helpers @public */ - _emberRuntimeInject.createInjectionHelper('controller', controllerInjectionHelper); - - exports.default = Controller; -}); -enifed('ember-runtime/copy', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/mixins/copyable'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeMixinsCopyable) { - 'use strict'; - - exports.default = copy; - - function _copy(obj, deep, seen, copies) { - var ret = undefined, - loc = undefined, - key = undefined; - // primitive data types are immutable, just return them. - if (typeof obj !== 'object' || obj === null) { - return obj; + function outletMacro(path, params, hash, builder) { + if (!params) { + params = []; } + var definitionArgs = [params.slice(0, 1), null, null, null]; + builder.component.dynamic(definitionArgs, outletComponentFor, _glimmerRuntime.CompiledArgs.empty(), builder.symbolTable, null); + return true; + } - // avoid cyclical loops - if (deep && (loc = seen.indexOf(obj)) >= 0) { - return copies[loc]; - } + var OutletComponentReference = (function () { + function OutletComponentReference(outletNameRef, parentOutletStateRef) { + babelHelpers.classCallCheck(this, OutletComponentReference); - _emberMetal.assert('Cannot clone an Ember.Object that does not implement Ember.Copyable', !(obj instanceof _emberRuntimeSystemObject.default) || _emberRuntimeMixinsCopyable.default && _emberRuntimeMixinsCopyable.default.detect(obj)); + this.outletNameRef = outletNameRef; + this.parentOutletStateRef = parentOutletStateRef; + this.definition = null; + this.lastState = null; + var outletStateTag = this.outletStateTag = new _glimmerReference.UpdatableTag(parentOutletStateRef.tag); + this.tag = _glimmerReference.combine([outletStateTag.tag, outletNameRef.tag]); + } - // IMPORTANT: this specific test will detect a native array only. Any other - // object will need to implement Copyable. - if (Array.isArray(obj)) { - ret = obj.slice(); + OutletComponentReference.prototype.value = function value() { + var outletNameRef = this.outletNameRef; + var parentOutletStateRef = this.parentOutletStateRef; + var definition = this.definition; + var lastState = this.lastState; - if (deep) { - loc = ret.length; + var outletName = outletNameRef.value(); + var outletStateRef = parentOutletStateRef.get('outlets').get(outletName); + var newState = this.lastState = outletStateRef.value(); - while (--loc >= 0) { - ret[loc] = _copy(ret[loc], deep, seen, copies); - } - } - } else if (_emberRuntimeMixinsCopyable.default && _emberRuntimeMixinsCopyable.default.detect(obj)) { - ret = obj.copy(deep, seen, copies); - } else if (obj instanceof Date) { - ret = new Date(obj.getTime()); - } else { - ret = {}; + this.outletStateTag.update(outletStateRef.tag); - for (key in obj) { - // support Null prototype - if (!Object.prototype.hasOwnProperty.call(obj, key)) { - continue; - } + definition = revalidate(definition, lastState, newState); - // Prevents browsers that don't respect non-enumerability from - // copying internal Ember properties - if (key.substring(0, 2) === '__') { - continue; - } + var hasTemplate = newState && newState.render.template; - ret[key] = deep ? _copy(obj[key], deep, seen, copies) : obj[key]; + if (definition) { + return definition; + } else if (hasTemplate) { + return this.definition = new OutletComponentDefinition(outletName, newState.render.template); + } else { + return this.definition = null; } - } - - if (deep) { - seen.push(obj); - copies.push(ret); - } + }; - return ret; - } + return OutletComponentReference; + })(); - /** - Creates a shallow copy of the passed object. A deep copy of the object is - returned if the optional `deep` argument is `true`. - - If the passed object implements the `Ember.Copyable` interface, then this - function will delegate to the object's `copy()` method and return the - result. See `Ember.Copyable` for further details. - - For primitive values (which are immutable in JavaScript), the passed object - is simply returned. - - @method copy - @for Ember - @param {Object} obj The object to clone - @param {Boolean} [deep=false] If true, a deep copy of the object is made. - @return {Object} The copied object - @public - */ + function revalidate(definition, lastState, newState) { + if (!lastState && !newState) { + return definition; + } - function copy(obj, deep) { - // fast paths - if ('object' !== typeof obj || obj === null) { - return obj; // can't copy primitives + if (!lastState && newState || lastState && !newState) { + return null; } - if (_emberRuntimeMixinsCopyable.default && _emberRuntimeMixinsCopyable.default.detect(obj)) { - return obj.copy(deep); + if (newState.render.template === lastState.render.template && newState.render.controller === lastState.render.controller) { + return definition; } - return _copy(obj, deep, deep ? [] : null, deep ? [] : null); + return null; } -}); -enifed('ember-runtime/ext/function', ['exports', 'ember-environment', 'ember-metal'], function (exports, _emberEnvironment, _emberMetal) { - /** - @module ember - @submodule ember-runtime - */ - 'use strict'; + function instrumentationPayload(_ref) { + var _ref$render = _ref.render; + var name = _ref$render.name; + var outlet = _ref$render.outlet; - var a_slice = Array.prototype.slice; - var FunctionPrototype = Function.prototype; + return { object: name + ':' + outlet }; + } - if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.Function) { - /** - The `property` extension of Javascript's Function prototype is available - when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is - `true`, which is the default. - Computed properties allow you to treat a function like a property: - ```javascript - MyApp.President = Ember.Object.extend({ - firstName: '', - lastName: '', - fullName: function() { - return this.get('firstName') + ' ' + this.get('lastName'); - }.property() // Call this flag to mark the function as a property - }); - let president = MyApp.President.create({ - firstName: 'Barack', - lastName: 'Obama' - }); - president.get('fullName'); // 'Barack Obama' - ``` - Treating a function like a property is useful because they can work with - bindings, just like any other property. - Many computed properties have dependencies on other properties. For - example, in the above example, the `fullName` property depends on - `firstName` and `lastName` to determine its value. You can tell Ember - about these dependencies like this: - ```javascript - MyApp.President = Ember.Object.extend({ - firstName: '', - lastName: '', - fullName: function() { - return this.get('firstName') + ' ' + this.get('lastName'); - // Tell Ember.js that this computed property depends on firstName - // and lastName - }.property('firstName', 'lastName') - }); - ``` - 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/classes/Ember.computed.html). - @method property - @for Function - @public - */ - FunctionPrototype.property = function () { - var ret = _emberMetal.computed(this); - // ComputedProperty.prototype.property expands properties; no need for us to - // do so here. - return ret.property.apply(ret, arguments); + function NOOP() {} + + var StateBucket = (function () { + function StateBucket(outletState) { + babelHelpers.classCallCheck(this, StateBucket); + + this.outletState = outletState; + this.instrument(); + } + + StateBucket.prototype.instrument = function instrument() { + this.finalizer = _emberMetal._instrumentStart('render.outlet', instrumentationPayload, this.outletState); }; - /** - The `observes` extension of Javascript's Function prototype is available - when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is - true, which is the default. - You can observe property changes simply by adding the `observes` - call to the end of your method declarations in classes that you write. - For example: - ```javascript - Ember.Object.extend({ - valueObserver: function() { - // Executes whenever the "value" property changes - }.observes('value') - }); - ``` - In the future this method may become asynchronous. - See `Ember.observer`. - @method observes - @for Function - @public - */ - FunctionPrototype.observes = function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } + StateBucket.prototype.finalize = function finalize() { + var finalizer = this.finalizer; - args.push(this); - return _emberMetal.observer.apply(this, args); + finalizer(); + this.finalizer = NOOP; }; - FunctionPrototype._observesImmediately = function () { - _emberMetal.assert('Immediate observers must observe internal properties only, ' + 'not properties on other objects.', function checkIsInternalProperty() { - for (var i = 0; i < arguments.length; i++) { - if (arguments[i].indexOf('.') !== -1) { - return false; - } - } - return true; - }); + return StateBucket; + })(); - // observes handles property expansion - return this.observes.apply(this, arguments); + var OutletComponentManager = (function (_AbstractManager) { + babelHelpers.inherits(OutletComponentManager, _AbstractManager); + + function OutletComponentManager() { + babelHelpers.classCallCheck(this, OutletComponentManager); + + _AbstractManager.apply(this, arguments); + } + + OutletComponentManager.prototype.prepareArgs = function prepareArgs(definition, args) { + return args; }; - /** - The `observesImmediately` extension of Javascript's Function prototype is - available when `EmberENV.EXTEND_PROTOTYPES` or - `EmberENV.EXTEND_PROTOTYPES.Function` is true, which is the default. - You can observe property changes simply by adding the `observesImmediately` - call to the end of your method declarations in classes that you write. - For example: - ```javascript - Ember.Object.extend({ - valueObserver: function() { - // Executes immediately after the "value" property changes - }.observesImmediately('value') - }); - ``` - In the future, `observes` may become asynchronous. In this event, - `observesImmediately` will maintain the synchronous behavior. - See `Ember.immediateObserver`. - @method observesImmediately - @for Function - @deprecated - @private - */ - FunctionPrototype.observesImmediately = _emberMetal.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 `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is - true, which is the default. - You can listen for events simply by adding the `on` call to the end of - your method declarations in classes or mixins that you write. For example: - ```javascript - Ember.Mixin.create({ - doSomethingWithElement: function() { - // Executes whenever the "didInsertElement" event fires - }.on('didInsertElement') + OutletComponentManager.prototype.create = function create(environment, definition, args, dynamicScope) { + var _this = this; + + _emberMetal.runInDebug(function () { + return _this._pushToDebugStack('template:' + definition.template.meta.moduleName, environment); }); - ``` - See `Ember.on`. - @method on - @for Function - @public - */ - FunctionPrototype.on = function () { - var events = a_slice.call(arguments); - this.__ember_listens__ = events; - return this; + var outletStateReference = dynamicScope.outletState = dynamicScope.outletState.get('outlets').get(definition.outletName); + var outletState = outletStateReference.value(); + return new StateBucket(outletState); }; - } -}); -enifed('ember-runtime/ext/rsvp', ['exports', 'rsvp', 'ember-metal'], function (exports, _rsvp, _emberMetal) { - 'use strict'; - - exports.onerrorDefault = onerrorDefault; - var backburner = _emberMetal.run.backburner; - _emberMetal.run._addQueue('rsvpAfter', 'destroy'); + OutletComponentManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { + return env.getCompiledBlock(OutletLayoutCompiler, definition.template); + }; - _rsvp.configure('async', function (callback, promise) { - backburner.schedule('actions', null, callback, promise); - }); + OutletComponentManager.prototype.getSelf = function getSelf(_ref2) { + var outletState = _ref2.outletState; - _rsvp.configure('after', function (cb) { - backburner.schedule('rsvpAfter', null, cb); - }); + return new _emberGlimmerUtilsReferences.RootReference(outletState.render.controller); + }; - _rsvp.on('error', onerrorDefault); + OutletComponentManager.prototype.getTag = function getTag() { + return null; + }; - function onerrorDefault(reason) { - var error = errorFor(reason); - if (error) { - _emberMetal.dispatchError(error); - } - } + OutletComponentManager.prototype.getDestructor = function getDestructor() { + return null; + }; - function errorFor(reason) { - if (!reason) return; + OutletComponentManager.prototype.didRenderLayout = function didRenderLayout(bucket) { + var _this2 = this; - if (reason.errorThrown) { - return unwrapErrorThrown(reason); - } + bucket.finalize(); - if (reason.name === 'UnrecognizedURLError') { - _emberMetal.assert('The URL \'' + reason.message + '\' did not match any routes in your application', false); - return; - } + _emberMetal.runInDebug(function () { + return _this2.debugStack.pop(); + }); + }; - if (reason.name === 'TransitionAborted') { - return; - } + OutletComponentManager.prototype.didCreateElement = function didCreateElement() {}; - return reason; - } + OutletComponentManager.prototype.didCreate = function didCreate(state) {}; - function unwrapErrorThrown(reason) { - var error = reason.errorThrown; - if (typeof error === 'string') { - error = new Error(error); - } - Object.defineProperty(error, '__reason_with_error_thrown__', { - value: reason, - enumerable: false - }); - return error; - } + OutletComponentManager.prototype.update = function update(bucket) {}; - exports.default = _rsvp; -}); -enifed('ember-runtime/ext/string', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { - /** - @module ember - @submodule ember-runtime - */ + OutletComponentManager.prototype.didUpdateLayout = function didUpdateLayout(bucket) {}; - 'use strict'; + OutletComponentManager.prototype.didUpdate = function didUpdate(state) {}; - var StringPrototype = String.prototype; + return OutletComponentManager; + })(_emberGlimmerSyntaxAbstractManager.default); - if (_emberEnvironment.ENV.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]; - } + var MANAGER = new OutletComponentManager(); - return _emberRuntimeSystemString.fmt(this, args); - }; + var TopLevelOutletComponentManager = (function (_OutletComponentManager) { + babelHelpers.inherits(TopLevelOutletComponentManager, _OutletComponentManager); - /** - See [Ember.String.w](/api/classes/Ember.String.html#method_w). - @method w - @for String - @private - */ - StringPrototype.w = function () { - return _emberRuntimeSystemString.w(this); - }; + function TopLevelOutletComponentManager() { + babelHelpers.classCallCheck(this, TopLevelOutletComponentManager); - /** - See [Ember.String.loc](/api/classes/Ember.String.html#method_loc). - @method loc - @for String - @private - */ - StringPrototype.loc = function () { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } + _OutletComponentManager.apply(this, arguments); + } - return _emberRuntimeSystemString.loc(this, args); - }; + TopLevelOutletComponentManager.prototype.create = function create(environment, definition, args, dynamicScope) { + var _this3 = this; - /** - See [Ember.String.camelize](/api/classes/Ember.String.html#method_camelize). - @method camelize - @for String - @private - */ - StringPrototype.camelize = function () { - return _emberRuntimeSystemString.camelize(this); - }; + _emberMetal.runInDebug(function () { + return _this3._pushToDebugStack('template:' + definition.template.meta.moduleName, environment); + }); - /** - See [Ember.String.decamelize](/api/classes/Ember.String.html#method_decamelize). - @method decamelize - @for String - @private - */ - StringPrototype.decamelize = function () { - return _emberRuntimeSystemString.decamelize(this); + return new StateBucket(dynamicScope.outletState.value()); }; - /** - See [Ember.String.dasherize](/api/classes/Ember.String.html#method_dasherize). - @method dasherize - @for String - @private - */ - StringPrototype.dasherize = function () { - return _emberRuntimeSystemString.dasherize(this); + TopLevelOutletComponentManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { + return env.getCompiledBlock(TopLevelOutletLayoutCompiler, definition.template); }; - /** - See [Ember.String.underscore](/api/classes/Ember.String.html#method_underscore). - @method underscore - @for String - @private - */ - StringPrototype.underscore = function () { - return _emberRuntimeSystemString.underscore(this); - }; + return TopLevelOutletComponentManager; + })(OutletComponentManager); - /** - See [Ember.String.classify](/api/classes/Ember.String.html#method_classify). - @method classify - @for String - @private - */ - StringPrototype.classify = function () { - return _emberRuntimeSystemString.classify(this); - }; + var TOP_LEVEL_MANAGER = new TopLevelOutletComponentManager(); - /** - See [Ember.String.capitalize](/api/classes/Ember.String.html#method_capitalize). - @method capitalize - @for String - @private - */ - StringPrototype.capitalize = function () { - return _emberRuntimeSystemString.capitalize(this); - }; - } -}); -enifed('ember-runtime/index', ['exports', 'ember-runtime/ext/string', 'ember-runtime/ext/function', 'ember-runtime/system/object', 'ember-runtime/system/string', 'ember-runtime/mixins/registry_proxy', 'ember-runtime/mixins/container_proxy', 'ember-runtime/copy', 'ember-runtime/inject', 'ember-runtime/compare', 'ember-runtime/is-equal', 'ember-runtime/mixins/array', 'ember-runtime/mixins/comparable', 'ember-runtime/system/namespace', 'ember-runtime/system/array_proxy', 'ember-runtime/system/object_proxy', 'ember-runtime/system/core_object', 'ember-runtime/system/native_array', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/copyable', 'ember-runtime/mixins/enumerable', 'ember-runtime/mixins/freezable', 'ember-runtime/mixins/-proxy', 'ember-runtime/system/lazy_load', 'ember-runtime/mixins/observable', '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/computed_macros', 'ember-runtime/computed/reduce_computed_macros', 'ember-runtime/controllers/controller', 'ember-runtime/mixins/controller', 'ember-runtime/system/service', 'ember-runtime/ext/rsvp', 'ember-runtime/utils', 'ember-runtime/string_registry'], function (exports, _emberRuntimeExtString, _emberRuntimeExtFunction, _emberRuntimeSystemObject, _emberRuntimeSystemString, _emberRuntimeMixinsRegistry_proxy, _emberRuntimeMixinsContainer_proxy, _emberRuntimeCopy, _emberRuntimeInject, _emberRuntimeCompare, _emberRuntimeIsEqual, _emberRuntimeMixinsArray, _emberRuntimeMixinsComparable, _emberRuntimeSystemNamespace, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemObject_proxy, _emberRuntimeSystemCore_object, _emberRuntimeSystemNative_array, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsFreezable, _emberRuntimeMixinsProxy, _emberRuntimeSystemLazy_load, _emberRuntimeMixinsObservable, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsTarget_action_support, _emberRuntimeMixinsEvented, _emberRuntimeMixinsPromise_proxy, _emberRuntimeComputedComputed_macros, _emberRuntimeComputedReduce_computed_macros, _emberRuntimeControllersController, _emberRuntimeMixinsController, _emberRuntimeSystemService, _emberRuntimeExtRsvp, _emberRuntimeUtils, _emberRuntimeString_registry) { - /** - @module ember - @submodule ember-runtime - */ + var TopLevelOutletComponentDefinition = (function (_ComponentDefinition) { + babelHelpers.inherits(TopLevelOutletComponentDefinition, _ComponentDefinition); - 'use strict'; + function TopLevelOutletComponentDefinition(instance) { + babelHelpers.classCallCheck(this, TopLevelOutletComponentDefinition); - exports.Object = _emberRuntimeSystemObject.default; - exports.FrameworkObject = _emberRuntimeSystemObject.FrameworkObject; - exports.String = _emberRuntimeSystemString.default; - exports.RegistryProxyMixin = _emberRuntimeMixinsRegistry_proxy.default; - exports.buildFakeRegistryWithDeprecations = _emberRuntimeMixinsRegistry_proxy.buildFakeRegistryWithDeprecations; - exports.ContainerProxyMixin = _emberRuntimeMixinsContainer_proxy.default; - exports.copy = _emberRuntimeCopy.default; - exports.inject = _emberRuntimeInject.default; - exports.compare = _emberRuntimeCompare.default; - exports.isEqual = _emberRuntimeIsEqual.default; - exports.Array = _emberRuntimeMixinsArray.default; - exports.objectAt = _emberRuntimeMixinsArray.objectAt; - exports.isEmberArray = _emberRuntimeMixinsArray.isEmberArray; - exports.addArrayObserver = _emberRuntimeMixinsArray.addArrayObserver; - exports.removeArrayObserver = _emberRuntimeMixinsArray.removeArrayObserver; - exports.Comparable = _emberRuntimeMixinsComparable.default; - exports.Namespace = _emberRuntimeSystemNamespace.default; - exports.isNamespaceSearchDisabled = _emberRuntimeSystemNamespace.isSearchDisabled; - exports.setNamespaceSearchDisabled = _emberRuntimeSystemNamespace.setSearchDisabled; - exports.ArrayProxy = _emberRuntimeSystemArray_proxy.default; - exports.ObjectProxy = _emberRuntimeSystemObject_proxy.default; - exports.CoreObject = _emberRuntimeSystemCore_object.default; - exports.NativeArray = _emberRuntimeSystemNative_array.default; - exports.A = _emberRuntimeSystemNative_array.A; - exports.ActionHandler = _emberRuntimeMixinsAction_handler.default; - exports.deprecateUnderscoreActions = _emberRuntimeMixinsAction_handler.deprecateUnderscoreActions; - exports.Copyable = _emberRuntimeMixinsCopyable.default; - exports.Enumerable = _emberRuntimeMixinsEnumerable.default; - exports.Freezable = _emberRuntimeMixinsFreezable.Freezable; - exports.FROZEN_ERROR = _emberRuntimeMixinsFreezable.FROZEN_ERROR; - exports._ProxyMixin = _emberRuntimeMixinsProxy.default; - exports.onLoad = _emberRuntimeSystemLazy_load.onLoad; - exports.runLoadHooks = _emberRuntimeSystemLazy_load.runLoadHooks; - exports._loaded = _emberRuntimeSystemLazy_load._loaded; - exports.Observable = _emberRuntimeMixinsObservable.default; - exports.MutableEnumerable = _emberRuntimeMixinsMutable_enumerable.default; - exports.MutableArray = _emberRuntimeMixinsMutable_array.default; - exports.removeAt = _emberRuntimeMixinsMutable_array.removeAt; - exports.TargetActionSupport = _emberRuntimeMixinsTarget_action_support.default; - exports.Evented = _emberRuntimeMixinsEvented.default; - exports.PromiseProxyMixin = _emberRuntimeMixinsPromise_proxy.default; - exports.empty = _emberRuntimeComputedComputed_macros.empty; - exports.notEmpty = _emberRuntimeComputedComputed_macros.notEmpty; - exports.none = _emberRuntimeComputedComputed_macros.none; - exports.not = _emberRuntimeComputedComputed_macros.not; - exports.bool = _emberRuntimeComputedComputed_macros.bool; - exports.match = _emberRuntimeComputedComputed_macros.match; - exports.equal = _emberRuntimeComputedComputed_macros.equal; - exports.gt = _emberRuntimeComputedComputed_macros.gt; - exports.gte = _emberRuntimeComputedComputed_macros.gte; - exports.lt = _emberRuntimeComputedComputed_macros.lt; - exports.lte = _emberRuntimeComputedComputed_macros.lte; - exports.oneWay = _emberRuntimeComputedComputed_macros.oneWay; - exports.readOnly = _emberRuntimeComputedComputed_macros.readOnly; - exports.deprecatingAlias = _emberRuntimeComputedComputed_macros.deprecatingAlias; - exports.and = _emberRuntimeComputedComputed_macros.and; - exports.or = _emberRuntimeComputedComputed_macros.or; - exports.sum = _emberRuntimeComputedReduce_computed_macros.sum; - exports.min = _emberRuntimeComputedReduce_computed_macros.min; - exports.max = _emberRuntimeComputedReduce_computed_macros.max; - exports.map = _emberRuntimeComputedReduce_computed_macros.map; - exports.sort = _emberRuntimeComputedReduce_computed_macros.sort; - exports.setDiff = _emberRuntimeComputedReduce_computed_macros.setDiff; - exports.mapBy = _emberRuntimeComputedReduce_computed_macros.mapBy; - exports.filter = _emberRuntimeComputedReduce_computed_macros.filter; - exports.filterBy = _emberRuntimeComputedReduce_computed_macros.filterBy; - exports.uniq = _emberRuntimeComputedReduce_computed_macros.uniq; - exports.uniqBy = _emberRuntimeComputedReduce_computed_macros.uniqBy; - exports.union = _emberRuntimeComputedReduce_computed_macros.union; - exports.intersect = _emberRuntimeComputedReduce_computed_macros.intersect; - exports.collect = _emberRuntimeComputedReduce_computed_macros.collect; - exports.Controller = _emberRuntimeControllersController.default; - exports.ControllerMixin = _emberRuntimeMixinsController.default; - exports.Service = _emberRuntimeSystemService.default; - exports.RSVP = _emberRuntimeExtRsvp.default; - exports.onerrorDefault = _emberRuntimeExtRsvp.onerrorDefault; - // just for side effect of extending Ember.RSVP - exports.isArray = _emberRuntimeUtils.isArray; - exports.typeOf = _emberRuntimeUtils.typeOf; - exports.getStrings = _emberRuntimeString_registry.getStrings; - exports.setStrings = _emberRuntimeString_registry.setStrings; -}); -// just for side effect of extending String.prototype -// just for side effect of extending Function.prototype -enifed('ember-runtime/inject', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; + _ComponentDefinition.call(this, 'outlet', TOP_LEVEL_MANAGER, instance); + this.template = instance.template; + _emberUtils.generateGuid(this); + } - exports.default = inject; - exports.createInjectionHelper = createInjectionHelper; - exports.validatePropertyInjections = validatePropertyInjections; + return TopLevelOutletComponentDefinition; + })(_glimmerRuntime.ComponentDefinition); - /** - Namespace for injection helper methods. - - @class inject - @namespace Ember - @static - @public - */ + exports.TopLevelOutletComponentDefinition = TopLevelOutletComponentDefinition; - function inject() { - _emberMetal.assert('Injected properties must be created through helpers, see \'' + Object.keys(inject).join('"', '"') + '\''); - } + var TopLevelOutletLayoutCompiler = (function () { + function TopLevelOutletLayoutCompiler(template) { + babelHelpers.classCallCheck(this, TopLevelOutletLayoutCompiler); - // Dictionary of injection validations by type, added to by `createInjectionHelper` - var typeValidators = {}; + this.template = template; + } - /** - This method allows other Ember modules to register injection helpers for a - given container type. Helpers are exported to the `inject` namespace as the - container type itself. - - @private - @method createInjectionHelper - @since 1.10.0 - @for Ember - @param {String} type The container type the helper will inject - @param {Function} validator A validation callback that is executed at mixin-time - */ + TopLevelOutletLayoutCompiler.prototype.compile = function compile(builder) { + builder.wrapLayout(this.template.asLayout()); + builder.tag.static('div'); + builder.attrs.static('id', _emberUtils.guidFor(this)); + builder.attrs.static('class', 'ember-view'); + }; - function createInjectionHelper(type, validator) { - typeValidators[type] = validator; + return TopLevelOutletLayoutCompiler; + })(); - inject[type] = function (name) { - return new _emberMetal.InjectedProperty(type, name); + TopLevelOutletLayoutCompiler.id = 'top-level-outlet'; + + var OutletComponentDefinition = (function (_ComponentDefinition2) { + babelHelpers.inherits(OutletComponentDefinition, _ComponentDefinition2); + + function OutletComponentDefinition(outletName, template) { + babelHelpers.classCallCheck(this, OutletComponentDefinition); + + _ComponentDefinition2.call(this, 'outlet', MANAGER, null); + this.outletName = outletName; + this.template = template; + _emberUtils.generateGuid(this); + } + + return OutletComponentDefinition; + })(_glimmerRuntime.ComponentDefinition); + + var OutletLayoutCompiler = (function () { + function OutletLayoutCompiler(template) { + babelHelpers.classCallCheck(this, OutletLayoutCompiler); + + this.template = template; + } + + OutletLayoutCompiler.prototype.compile = function compile(builder) { + builder.wrapLayout(this.template.asLayout()); }; - } + return OutletLayoutCompiler; + })(); + + exports.OutletLayoutCompiler = OutletLayoutCompiler; + + OutletLayoutCompiler.id = 'outlet'; +}); +enifed('ember-glimmer/syntax/render', ['exports', '@glimmer/runtime', '@glimmer/reference', 'ember-metal', 'ember-glimmer/utils/references', 'ember-routing', 'ember-glimmer/syntax/outlet', 'container', 'ember-glimmer/syntax/abstract-manager'], function (exports, _glimmerRuntime, _glimmerReference, _emberMetal, _emberGlimmerUtilsReferences, _emberRouting, _emberGlimmerSyntaxOutlet, _container, _emberGlimmerSyntaxAbstractManager) { /** - Validation function that runs per-type validation functions once for each - injected type encountered. - - @private - @method validatePropertyInjections - @since 1.10.0 - @for Ember - @param {Object} factory The factory object + @module ember + @submodule ember-glimmer */ + 'use strict'; - function validatePropertyInjections(factory) { - var proto = factory.proto(); - var types = []; + exports.renderMacro = renderMacro; - for (var key in proto) { - var desc = proto[key]; - if (desc instanceof _emberMetal.InjectedProperty && types.indexOf(desc.type) === -1) { - types.push(desc.type); - } - } + function makeComponentDefinition(vm) { + var env = vm.env; + var args = vm.getArgs(); + var nameRef = args.positional.at(0); - if (types.length) { - for (var i = 0; i < types.length; i++) { - var validator = typeValidators[types[i]]; + _emberMetal.assert('The first argument of {{render}} must be quoted, e.g. {{render "sidebar"}}.', _glimmerReference.isConst(nameRef)); + _emberMetal.assert('The second argument of {{render}} must be a path, e.g. {{render "post" post}}.', args.positional.length === 1 || !_glimmerReference.isConst(args.positional.at(1))); - if (typeof validator === 'function') { - validator(factory); - } - } + var templateName = nameRef.value(); + + _emberMetal.assert('You used `{{render \'' + templateName + '\'}}`, but \'' + templateName + '\' can not be found as a template.', env.owner.hasRegistration('template:' + templateName)); + + var template = env.owner.lookup('template:' + templateName); + + var controllerName = undefined; + + if (args.named.has('controller')) { + var controllerNameRef = args.named.get('controller'); + + _emberMetal.assert('The controller argument for {{render}} must be quoted, e.g. {{render "sidebar" controller="foo"}}.', _glimmerReference.isConst(controllerNameRef)); + + controllerName = controllerNameRef.value(); + + _emberMetal.assert('The controller name you supplied \'' + controllerName + '\' did not resolve to a controller.', env.owner.hasRegistration('controller:' + controllerName)); + } else { + controllerName = templateName; } - return true; + if (args.positional.length === 1) { + return new _glimmerReference.ConstReference(new RenderDefinition(controllerName, template, env, SINGLETON_RENDER_MANAGER)); + } else { + return new _glimmerReference.ConstReference(new RenderDefinition(controllerName, template, env, NON_SINGLETON_RENDER_MANAGER)); + } } -}); -enifed('ember-runtime/is-equal', ['exports'], function (exports) { + /** - Compares two objects, returning true if they are equal. + Calling ``{{render}}`` from within a template will insert another + template that matches the provided name. The inserted template will + access its properties on its own controller (rather than the controller + of the parent template). - ```javascript - Ember.isEqual('hello', 'hello'); // true - Ember.isEqual(1, 2); // false - ``` + If a view class with the same name exists, the view class also will be used. + Note: A given controller may only be used *once* in your app in this manner. + A singleton instance of the controller will be created for you. - `isEqual` is a more specific comparison than a triple equal comparison. - It will call the `isEqual` instance method on the objects being - compared, allowing finer control over when objects should be considered - equal to each other. + Example: ```javascript - let Person = Ember.Object.extend({ - isEqual(other) { return this.ssn == other.ssn; } + App.NavigationController = Ember.Controller.extend({ + who: "world" }); + ``` - let personA = Person.create({name: 'Muhammad Ali', ssn: '123-45-6789'}); - let personB = Person.create({name: 'Cassius Clay', ssn: '123-45-6789'}); + ```handlebars + + Hello, {{who}}. + ``` - Ember.isEqual(personA, personB); // true + ```handlebars + +

    My great app

    + {{render "navigation"}} ``` - Due to the expense of array comparisons, collections will never be equal to - each other even if each of their items are equal to each other. + ```html +

    My great app

    +
    + Hello, world. +
    + ``` - ```javascript - Ember.isEqual([4, 2], [4, 2]); // false + Optionally you may provide a second argument: a property path + that will be bound to the `model` property of the controller. + If a `model` property path is specified, then a new instance of the + controller will be created and `{{render}}` can be used multiple times + with the same name. + + For example if you had this `author` template. + + ```handlebars +
    + Written by {{firstName}} {{lastName}}. + Total Posts: {{postCount}} +
    ``` - @method isEqual - @for Ember - @param {Object} a first object to compare - @param {Object} b second object to compare - @return {Boolean} + You could render it inside the `post` template using the `render` helper. + + ```handlebars +
    +

    {{title}}

    +
    {{body}}
    + {{render "author" author}} +
    + ``` + + @method render + @for Ember.Templates.helpers + @param {String} name + @param {Object?} context + @param {Hash} options + @return {String} HTML string @public */ - 'use strict'; - - exports.default = isEqual; - - function isEqual(a, b) { - if (a && typeof a.isEqual === 'function') { - return a.isEqual(b); - } - if (a instanceof Date && b instanceof Date) { - return a.getTime() === b.getTime(); + function renderMacro(path, params, hash, builder) { + if (!params) { + params = []; } - - return a === b; - } -}); -enifed('ember-runtime/mixins/-proxy', ['exports', 'glimmer-reference', 'ember-metal', 'ember-runtime/computed/computed_macros'], function (exports, _glimmerReference, _emberMetal, _emberRuntimeComputedComputed_macros) { - /** - @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 - _emberMetal.propertyWillChange(this, key); - } - - function contentPropertyDidChange(content, contentKey) { - var key = contentKey.slice(8); // remove "content." - if (key in this) { - return; - } // if shadowed in proxy - _emberMetal.propertyDidChange(this, key); + var definitionArgs = [params.slice(0), hash, null, null]; + var args = [params.slice(1), hash, null, null]; + builder.component.dynamic(definitionArgs, makeComponentDefinition, args, builder.symbolTable); + return true; } - var ProxyTag = (function (_CachedTag) { - babelHelpers.inherits(ProxyTag, _CachedTag); - - function ProxyTag(proxy) { - babelHelpers.classCallCheck(this, ProxyTag); - - _CachedTag.call(this); + var AbstractRenderManager = (function (_AbstractManager) { + babelHelpers.inherits(AbstractRenderManager, _AbstractManager); - var content = _emberMetal.get(proxy, 'content'); + function AbstractRenderManager() { + babelHelpers.classCallCheck(this, AbstractRenderManager); - this.proxy = proxy; - this.proxyWrapperTag = new _glimmerReference.DirtyableTag(); - this.proxyContentTag = new _glimmerReference.UpdatableTag(_emberMetal.tagFor(content)); + _AbstractManager.apply(this, arguments); } - /** - `Ember.ProxyMixin` forwards all properties not defined by the proxy itself - to a proxied `content` object. See Ember.ObjectProxy for more details. - - @class ProxyMixin - @namespace Ember - @private - */ - - ProxyTag.prototype.compute = function compute() { - return Math.max(this.proxyWrapperTag.value(), this.proxyContentTag.value()); + AbstractRenderManager.prototype.prepareArgs = function prepareArgs(definition, args) { + return args; }; - ProxyTag.prototype.dirty = function dirty() { - this.proxyWrapperTag.dirty(); - }; + /* abstract create(environment, definition, args, dynamicScope); */ - ProxyTag.prototype.contentDidChange = function contentDidChange() { - var content = _emberMetal.get(this.proxy, 'content'); - this.proxyContentTag.update(_emberMetal.tagFor(content)); + AbstractRenderManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { + return env.getCompiledBlock(_emberGlimmerSyntaxOutlet.OutletLayoutCompiler, definition.template); }; - return ProxyTag; - })(_glimmerReference.CachedTag); - - exports.default = _emberMetal.Mixin.create({ - /** - The object whose properties will be forwarded. - @property content - @type Ember.Object - @default null - @private - */ - content: null, + AbstractRenderManager.prototype.getSelf = function getSelf(_ref) { + var controller = _ref.controller; - init: function () { - this._super.apply(this, arguments); - _emberMetal.meta(this).setProxy(); - }, + return new _emberGlimmerUtilsReferences.RootReference(controller); + }; - _initializeTag: _emberMetal.on('init', function () { - _emberMetal.meta(this)._tag = new ProxyTag(this); - }), + AbstractRenderManager.prototype.getTag = function getTag() { + return null; + }; - _contentDidChange: _emberMetal.observer('content', function () { - _emberMetal.assert('Can\'t set Proxy\'s content to itself', _emberMetal.get(this, 'content') !== this); - _emberMetal.tagFor(this).contentDidChange(); - }), + AbstractRenderManager.prototype.getDestructor = function getDestructor() { + return null; + }; - isTruthy: _emberRuntimeComputedComputed_macros.bool('content'), + AbstractRenderManager.prototype.didCreateElement = function didCreateElement() {}; - _debugContainerKey: null, + AbstractRenderManager.prototype.didRenderLayout = function didRenderLayout() {}; - willWatchProperty: function (key) { - var contentKey = 'content.' + key; - _emberMetal._addBeforeObserver(this, contentKey, null, contentPropertyWillChange); - _emberMetal.addObserver(this, contentKey, null, contentPropertyDidChange); - }, + AbstractRenderManager.prototype.didCreate = function didCreate() {}; - didUnwatchProperty: function (key) { - var contentKey = 'content.' + key; - _emberMetal._removeBeforeObserver(this, contentKey, null, contentPropertyWillChange); - _emberMetal.removeObserver(this, contentKey, null, contentPropertyDidChange); - }, + AbstractRenderManager.prototype.update = function update() {}; - unknownProperty: function (key) { - var content = _emberMetal.get(this, 'content'); - if (content) { - _emberMetal.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 _emberMetal.get(content, key); - } - }, + AbstractRenderManager.prototype.didUpdateLayout = function didUpdateLayout() {}; - setUnknownProperty: function (key, value) { - var m = _emberMetal.meta(this); - if (m.proto === this) { - // if marked as prototype then just defineProperty - // rather than delegate - _emberMetal.defineProperty(this, key, null, value); - return value; - } + AbstractRenderManager.prototype.didUpdate = function didUpdate() {}; - var content = _emberMetal.get(this, 'content'); - _emberMetal.assert('Cannot delegate set(\'' + key + '\', ' + value + ') to the \'content\' property of object proxy ' + this + ': its \'content\' is undefined.', content); + return AbstractRenderManager; + })(_emberGlimmerSyntaxAbstractManager.default); - _emberMetal.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 _emberMetal.set(content, key, value); - } + _emberMetal.runInDebug(function () { + AbstractRenderManager.prototype.didRenderLayout = function () { + this.debugStack.pop(); + }; }); -}); -enifed('ember-runtime/mixins/action_handler', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-runtime - */ - - 'use strict'; - exports.deprecateUnderscoreActions = deprecateUnderscoreActions; + var SingletonRenderManager = (function (_AbstractRenderManager) { + babelHelpers.inherits(SingletonRenderManager, _AbstractRenderManager); - /** - `Ember.ActionHandler` is available on some familiar classes including - `Ember.Route`, `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.) - - @class ActionHandler - @namespace Ember - @private - */ - var ActionHandler = _emberMetal.Mixin.create({ - mergedProperties: ['actions'], + function SingletonRenderManager() { + babelHelpers.classCallCheck(this, SingletonRenderManager); - /** - 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 - from within a template and the application's current route is this route. - Actions can also be invoked from other parts of your application - via `ActionHandler#send`. - The `actions` hash will inherit action handlers from - the `actions` hash defined on extended parent classes - or mixins rather than just replace the entire hash, e.g.: - ```js - App.CanDisplayBanner = Ember.Mixin.create({ - actions: { - displayBanner(msg) { - // ... - } - } - }); - App.WelcomeRoute = Ember.Route.extend(App.CanDisplayBanner, { - actions: { - playMusic() { - // ... - } - } - }); - // `WelcomeRoute`, when active, will be able to respond - // to both actions, since the actions hash is merged rather - // then replaced when extending mixins / parent classes. - this.send('displayBanner'); - this.send('playMusic'); - ``` - Within a Controller, Route or Component's action handler, - the value of the `this` context is the Controller, Route or - Component object: - ```js - App.SongRoute = Ember.Route.extend({ - actions: { - myAction() { - this.controllerFor("song"); - this.transitionTo("other.route"); - ... - } - } - }); - ``` - It is also possible to call `this._super(...arguments)` from within an - action handler if it overrides a handler defined on a parent - class or mixin: - Take for example the following routes: - ```js - App.DebugRoute = Ember.Mixin.create({ - actions: { - debugRouteInformation() { - console.debug("trololo"); - } - } - }); - App.AnnoyingDebugRoute = Ember.Route.extend(App.DebugRoute, { - actions: { - debugRouteInformation() { - // also call the debugRouteInformation of mixed in App.DebugRoute - this._super(...arguments); - // show additional annoyance - window.alert(...); - } - } - }); - ``` - ## Bubbling - By default, an action will stop bubbling once a handler defined - on the `actions` hash handles it. To continue bubbling the action, - you must return `true` from the handler: - ```js - App.Router.map(function() { - this.route("album", function() { - this.route("song"); - }); - }); - App.AlbumRoute = Ember.Route.extend({ - actions: { - startPlaying: function() { - } - } - }); - App.AlbumSongRoute = Ember.Route.extend({ - actions: { - startPlaying() { - // ... - if (actionShouldAlsoBeTriggeredOnParentRoute) { - return true; - } - } - } - }); - ``` - @property actions - @type Object - @default null - @public - */ + _AbstractRenderManager.apply(this, arguments); + } - /** - 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 - not be found in the `ActionHandler`'s `actions` hash or if the - action target function returns `true`. - Example - ```js - App.WelcomeRoute = Ember.Route.extend({ - actions: { - playTheme() { - this.send('playMusic', 'theme.mp3'); - }, - playMusic(track) { - // ... - } - } + SingletonRenderManager.prototype.create = function create(environment, definition, args, dynamicScope) { + var _this = this; + + var name = definition.name; + var env = definition.env; + + var controller = env.owner.lookup('controller:' + name) || _emberRouting.generateController(env.owner, name); + + _emberMetal.runInDebug(function () { + return _this._pushToDebugStack('controller:' + name + ' (with the render helper)', environment); }); - ``` - @method send - @param {String} actionName The action to trigger - @param {*} context a context to send with the action - @public - */ - send: function (actionName) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; + + if (dynamicScope.rootOutletState) { + dynamicScope.outletState = dynamicScope.rootOutletState.getOrphan(name); } - var target = undefined; + return { controller: controller }; + }; - if (this.actions && this.actions[actionName]) { - var shouldBubble = this.actions[actionName].apply(this, args) === true; - if (!shouldBubble) { - return; - } - } + return SingletonRenderManager; + })(AbstractRenderManager); + + var SINGLETON_RENDER_MANAGER = new SingletonRenderManager(); - if (target = _emberMetal.get(this, 'target')) { - var _target; + var NonSingletonRenderManager = (function (_AbstractRenderManager2) { + babelHelpers.inherits(NonSingletonRenderManager, _AbstractRenderManager2); - _emberMetal.assert('The `target` for ' + this + ' (' + target + ') does not have a `send` method', typeof target.send === 'function'); - (_target = target).send.apply(_target, arguments); - } - }, + function NonSingletonRenderManager() { + babelHelpers.classCallCheck(this, NonSingletonRenderManager); - willMergeMixin: function (props) { - _emberMetal.assert('Specifying `_actions` and `actions` in the same mixin is not supported.', !props.actions || !props._actions); + _AbstractRenderManager2.apply(this, arguments); + } - if (props._actions) { - _emberMetal.deprecate('Specifying actions in `_actions` is deprecated, please use `actions` instead.', false, { id: 'ember-runtime.action-handler-_actions', until: '3.0.0' }); + NonSingletonRenderManager.prototype.create = function create(environment, definition, args, dynamicScope) { + var _this2 = this; - props.actions = props._actions; - delete props._actions; + var name = definition.name; + var env = definition.env; + + var modelRef = args.positional.at(0); + var controllerFactory = env.owner[_container.FACTORY_FOR]('controller:' + name); + + var factory = controllerFactory || _emberRouting.generateControllerFactory(env.owner, name); + var controller = factory.create({ model: modelRef.value() }); + + _emberMetal.runInDebug(function () { + return _this2._pushToDebugStack('controller:' + name + ' (with the render helper)', environment); + }); + + if (dynamicScope.rootOutletState) { + dynamicScope.outletState = dynamicScope.rootOutletState.getOrphan(name); } + + return { controller: controller }; + }; + + NonSingletonRenderManager.prototype.update = function update(_ref2, args, dynamicScope) { + var controller = _ref2.controller; + + controller.set('model', args.positional.at(0).value()); + }; + + NonSingletonRenderManager.prototype.getDestructor = function getDestructor(_ref3) { + var controller = _ref3.controller; + + return controller; + }; + + return NonSingletonRenderManager; + })(AbstractRenderManager); + + var NON_SINGLETON_RENDER_MANAGER = new NonSingletonRenderManager(); + + var RenderDefinition = (function (_ComponentDefinition) { + babelHelpers.inherits(RenderDefinition, _ComponentDefinition); + + function RenderDefinition(name, template, env, manager) { + babelHelpers.classCallCheck(this, RenderDefinition); + + _ComponentDefinition.call(this, 'render', manager, null); + + this.name = name; + this.template = template; + this.env = env; } - }); - exports.default = ActionHandler; + return RenderDefinition; + })(_glimmerRuntime.ComponentDefinition); +}); +enifed('ember-glimmer/template', ['exports', 'ember-utils', '@glimmer/runtime'], function (exports, _emberUtils, _glimmerRuntime) { + 'use strict'; - function deprecateUnderscoreActions(factory) { - Object.defineProperty(factory.prototype, '_actions', { - configurable: true, - enumerable: false, - set: function (value) { - _emberMetal.assert('You cannot set `_actions` on ' + this + ', please use `actions` instead.'); - }, - get: function () { - _emberMetal.deprecate('Usage of `_actions` is deprecated, use `actions` instead.', false, { id: 'ember-runtime.action-handler-_actions', until: '3.0.0' }); - return _emberMetal.get(this, 'actions'); + exports.default = template; + + function template(json) { + var factory = _glimmerRuntime.templateFactory(json); + + return { + id: factory.id, + meta: factory.meta, + create: function (props) { + return factory.create(props.env, { owner: props[_emberUtils.OWNER] }); } - }); + }; } }); -enifed('ember-runtime/mixins/array', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/mixins/enumerable', 'ember-runtime/system/each_proxy'], function (exports, _emberUtils, _emberMetal, _emberRuntimeMixinsEnumerable, _emberRuntimeSystemEach_proxy) { - /** - @module ember - @submodule ember-runtime - */ +enifed("ember-glimmer/template_registry", ["exports"], function (exports) { + // STATE within a module is frowned apon, this exists + // to support Ember.TEMPLATES but shield ember internals from this legacy + // global API. + "use strict"; - // .......................................................... - // HELPERS - // + exports.setTemplates = setTemplates; + exports.getTemplates = getTemplates; + exports.getTemplate = getTemplate; + exports.hasTemplate = hasTemplate; + exports.setTemplate = setTemplate; + var TEMPLATES = {}; + + function setTemplates(templates) { + TEMPLATES = templates; + } + + function getTemplates() { + return TEMPLATES; + } + + function getTemplate(name) { + if (TEMPLATES.hasOwnProperty(name)) { + return TEMPLATES[name]; + } + } + + function hasTemplate(name) { + return TEMPLATES.hasOwnProperty(name); + } + + function setTemplate(name, template) { + return TEMPLATES[name] = template; + } +}); +enifed("ember-glimmer/templates/component", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { + "use strict"; + + exports.default = _emberGlimmerTemplate.default({ "id": "2aYM5QYc", "block": "{\"statements\":[[\"yield\",\"default\"]],\"locals\":[],\"named\":[],\"yields\":[\"default\"],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/component.hbs" } }); +}); +enifed("ember-glimmer/templates/empty", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { + "use strict"; + + exports.default = _emberGlimmerTemplate.default({ "id": "5QJJjniM", "block": "{\"statements\":[],\"locals\":[],\"named\":[],\"yields\":[],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/empty.hbs" } }); +}); +enifed("ember-glimmer/templates/link-to", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { + "use strict"; + + exports.default = _emberGlimmerTemplate.default({ "id": "Y2DX6qHQ", "block": "{\"statements\":[[\"block\",[\"if\"],[[\"get\",[\"linkTitle\"]]],null,{\"statements\":[[\"append\",[\"unknown\",[\"linkTitle\"]],false]],\"locals\":[]},{\"statements\":[[\"yield\",\"default\"]],\"locals\":[]}]],\"locals\":[],\"named\":[],\"yields\":[\"default\"],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/link-to.hbs" } }); +}); +enifed("ember-glimmer/templates/outlet", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { + "use strict"; + + exports.default = _emberGlimmerTemplate.default({ "id": "xyZMyWzn", "block": "{\"statements\":[[\"append\",[\"unknown\",[\"outlet\"]],false]],\"locals\":[],\"named\":[],\"yields\":[],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/outlet.hbs" } }); +}); +enifed("ember-glimmer/templates/root", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { + "use strict"; + + exports.default = _emberGlimmerTemplate.default({ "id": "/KBRNPqv", "block": "{\"statements\":[[\"append\",[\"helper\",[\"component\"],[[\"get\",[null]]],null],false]],\"locals\":[],\"named\":[],\"yields\":[],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/root.hbs" } }); +}); +enifed('ember-glimmer/utils/bindings', ['exports', '@glimmer/reference', 'ember-metal', 'ember-runtime', 'ember-glimmer/component', 'ember-glimmer/utils/string'], function (exports, _glimmerReference, _emberMetal, _emberRuntime, _emberGlimmerComponent, _emberGlimmerUtilsString) { 'use strict'; - var _Mixin$create; + exports.wrapComponentClassAttribute = wrapComponentClassAttribute; - exports.addArrayObserver = addArrayObserver; - exports.removeArrayObserver = removeArrayObserver; - exports.objectAt = objectAt; - exports.arrayContentWillChange = arrayContentWillChange; - exports.arrayContentDidChange = arrayContentDidChange; - exports.isEmberArray = isEmberArray; + function referenceForKey(component, key) { + return component[_emberGlimmerComponent.ROOT_REF].get(key); + } - function arrayObserversHelper(obj, target, opts, operation, notify) { - var willChange = opts && opts.willChange || 'arrayWillChange'; - var didChange = opts && opts.didChange || 'arrayDidChange'; - var hasObservers = _emberMetal.get(obj, 'hasArrayObservers'); + function referenceForParts(component, parts) { + var isAttrs = parts[0] === 'attrs'; - if (hasObservers === notify) { - _emberMetal.propertyWillChange(obj, 'hasArrayObservers'); + // TODO deprecate this + if (isAttrs) { + parts.shift(); + + if (parts.length === 1) { + return referenceForKey(component, parts[0]); + } } - operation(obj, '@array:before', target, willChange); - operation(obj, '@array:change', target, didChange); + return _glimmerReference.referenceFromParts(component[_emberGlimmerComponent.ROOT_REF], parts); + } - if (hasObservers === notify) { - _emberMetal.propertyDidChange(obj, 'hasArrayObservers'); + // TODO we should probably do this transform at build time + + function wrapComponentClassAttribute(hash) { + if (!hash) { + return hash; } - return obj; - } + var keys = hash[0]; + var values = hash[1]; - function addArrayObserver(array, target, opts) { - return arrayObserversHelper(array, target, opts, _emberMetal.addListener, false); - } + var index = keys.indexOf('class'); - function removeArrayObserver(array, target, opts) { - return arrayObserversHelper(array, target, opts, _emberMetal.removeListener, true); - } + if (index !== -1) { + var _values$index = values[index]; + var type = _values$index[0]; - function objectAt(content, idx) { - if (content.objectAt) { - return content.objectAt(idx); + if (type === 'get') { + var getExp = values[index]; + var path = getExp[1]; + var propName = path[path.length - 1]; + hash[1][index] = ['helper', ['-class'], [getExp, propName]]; + } } - return content[idx]; + return hash; } - function arrayContentWillChange(array, startIdx, removeAmt, addAmt) { - var removing = undefined, - lim = undefined; + var AttributeBinding = { + parse: function (microsyntax) { + var colonIndex = microsyntax.indexOf(':'); - // if no args are passed assume everything changes - if (startIdx === undefined) { - startIdx = 0; - removeAmt = addAmt = -1; - } else { - if (removeAmt === undefined) { - removeAmt = -1; + if (colonIndex === -1) { + _emberMetal.assert('You cannot use class as an attributeBinding, use classNameBindings instead.', microsyntax !== 'class'); + return [microsyntax, microsyntax, true]; + } else { + var prop = microsyntax.substring(0, colonIndex); + var attribute = microsyntax.substring(colonIndex + 1); + + _emberMetal.assert('You cannot use class as an attributeBinding, use classNameBindings instead.', attribute !== 'class'); + + return [prop, attribute, false]; } + }, - if (addAmt === undefined) { - addAmt = -1; + install: function (element, component, parsed, operations) { + var prop = parsed[0]; + var attribute = parsed[1]; + var isSimple = parsed[2]; + + if (attribute === 'id') { + var elementId = _emberMetal.get(component, prop); + if (elementId === undefined || elementId === null) { + elementId = component.elementId; + } + operations.addStaticAttribute(element, 'id', elementId); + return; } - } - if (array.__each) { - array.__each.arrayWillChange(array, startIdx, removeAmt, addAmt); + var isPath = prop.indexOf('.') > -1; + var reference = isPath ? referenceForParts(component, prop.split('.')) : referenceForKey(component, prop); + + _emberMetal.assert('Illegal attributeBinding: \'' + prop + '\' is not a valid attribute name.', !(isSimple && isPath)); + + if (attribute === 'style') { + reference = new StyleBindingReference(reference, referenceForKey(component, 'isVisible')); + } + + operations.addDynamicAttribute(element, attribute, reference); } + }; - _emberMetal.sendEvent(array, '@array:before', [array, startIdx, removeAmt, addAmt]); + exports.AttributeBinding = AttributeBinding; + var DISPLAY_NONE = 'display: none;'; + var SAFE_DISPLAY_NONE = _emberGlimmerUtilsString.htmlSafe(DISPLAY_NONE); - if (startIdx >= 0 && removeAmt >= 0 && _emberMetal.get(array, 'hasEnumerableObservers')) { - removing = []; - lim = startIdx + removeAmt; + var StyleBindingReference = (function (_CachedReference) { + babelHelpers.inherits(StyleBindingReference, _CachedReference); - for (var idx = startIdx; idx < lim; idx++) { - removing.push(objectAt(array, idx)); + function StyleBindingReference(inner, isVisible) { + babelHelpers.classCallCheck(this, StyleBindingReference); + + _CachedReference.call(this); + + this.tag = _glimmerReference.combine([inner.tag, isVisible.tag]); + this.inner = inner; + this.isVisible = isVisible; + } + + StyleBindingReference.prototype.compute = function compute() { + var value = this.inner.value(); + var isVisible = this.isVisible.value(); + + if (isVisible !== false) { + return value; + } else if (!value && value !== 0) { + return SAFE_DISPLAY_NONE; + } else { + var style = value + ' ' + DISPLAY_NONE; + return _emberGlimmerUtilsString.isHTMLSafe(value) ? _emberGlimmerUtilsString.htmlSafe(style) : style; } - } else { - removing = removeAmt; + }; + + return StyleBindingReference; + })(_glimmerReference.CachedReference); + + var IsVisibleBinding = { + install: function (element, component, operations) { + operations.addDynamicAttribute(element, 'style', _glimmerReference.map(referenceForKey(component, 'isVisible'), this.mapStyleValue)); + }, + + mapStyleValue: function (isVisible) { + return isVisible === false ? SAFE_DISPLAY_NONE : null; } + }; - array.enumerableContentWillChange(removing, addAmt); + exports.IsVisibleBinding = IsVisibleBinding; + var ClassNameBinding = { + install: function (element, component, microsyntax, operations) { + var _microsyntax$split = microsyntax.split(':'); - return array; - } + var prop = _microsyntax$split[0]; + var truthy = _microsyntax$split[1]; + var falsy = _microsyntax$split[2]; - function arrayContentDidChange(array, startIdx, removeAmt, addAmt) { - // if no args are passed assume everything changes - if (startIdx === undefined) { - startIdx = 0; - removeAmt = addAmt = -1; - } else { - if (removeAmt === undefined) { - removeAmt = -1; - } + var isStatic = prop === ''; - if (addAmt === undefined) { - addAmt = -1; + if (isStatic) { + operations.addStaticAttribute(element, 'class', truthy); + } else { + var isPath = prop.indexOf('.') > -1; + var parts = isPath && prop.split('.'); + var value = isPath ? referenceForParts(component, parts) : referenceForKey(component, prop); + var ref = undefined; + + if (truthy === undefined) { + ref = new SimpleClassNameBindingReference(value, isPath ? parts[parts.length - 1] : prop); + } else { + ref = new ColonClassNameBindingReference(value, truthy, falsy); + } + + operations.addDynamicAttribute(element, 'class', ref); } } + }; - var adding = undefined; - if (startIdx >= 0 && addAmt >= 0 && _emberMetal.get(array, 'hasEnumerableObservers')) { - adding = []; - var lim = startIdx + addAmt; + exports.ClassNameBinding = ClassNameBinding; - for (var idx = startIdx; idx < lim; idx++) { - adding.push(objectAt(array, idx)); - } - } else { - adding = addAmt; + var SimpleClassNameBindingReference = (function (_CachedReference2) { + babelHelpers.inherits(SimpleClassNameBindingReference, _CachedReference2); + + function SimpleClassNameBindingReference(inner, path) { + babelHelpers.classCallCheck(this, SimpleClassNameBindingReference); + + _CachedReference2.call(this); + + this.tag = inner.tag; + this.inner = inner; + this.path = path; + this.dasherizedPath = null; } - array.enumerableContentDidChange(removeAmt, adding); + SimpleClassNameBindingReference.prototype.compute = function compute() { + var value = this.inner.value(); - if (array.__each) { - array.__each.arrayDidChange(array, startIdx, removeAmt, addAmt); + if (value === true) { + var path = this.path; + var dasherizedPath = this.dasherizedPath; + + return dasherizedPath || (this.dasherizedPath = _emberRuntime.String.dasherize(path)); + } else if (value || value === 0) { + return value; + } else { + return null; + } + }; + + return SimpleClassNameBindingReference; + })(_glimmerReference.CachedReference); + + var ColonClassNameBindingReference = (function (_CachedReference3) { + babelHelpers.inherits(ColonClassNameBindingReference, _CachedReference3); + + function ColonClassNameBindingReference(inner, truthy, falsy) { + babelHelpers.classCallCheck(this, ColonClassNameBindingReference); + + _CachedReference3.call(this); + + this.tag = inner.tag; + this.inner = inner; + this.truthy = truthy || null; + this.falsy = falsy || null; } - _emberMetal.sendEvent(array, '@array:change', [array, startIdx, removeAmt, addAmt]); + ColonClassNameBindingReference.prototype.compute = function compute() { + var inner = this.inner; + var truthy = this.truthy; + var falsy = this.falsy; - var meta = _emberMetal.peekMeta(array); - var cache = meta && meta.readableCache(); + return inner.value() ? truthy : falsy; + }; - if (cache) { - if (cache.firstObject !== undefined && objectAt(array, 0) !== _emberMetal.cacheFor.get(cache, 'firstObject')) { - _emberMetal.propertyWillChange(array, 'firstObject'); - _emberMetal.propertyDidChange(array, 'firstObject'); + return ColonClassNameBindingReference; + })(_glimmerReference.CachedReference); +}); +enifed('ember-glimmer/utils/debug-stack', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; + + var DebugStack = undefined; + + _emberMetal.runInDebug(function () { + var Element = function Element(name) { + babelHelpers.classCallCheck(this, Element); + + this.name = name; + }; + + var TemplateElement = (function (_Element) { + babelHelpers.inherits(TemplateElement, _Element); + + function TemplateElement() { + babelHelpers.classCallCheck(this, TemplateElement); + + _Element.apply(this, arguments); } - if (cache.lastObject !== undefined && objectAt(array, _emberMetal.get(array, 'length') - 1) !== _emberMetal.cacheFor.get(cache, 'lastObject')) { - _emberMetal.propertyWillChange(array, 'lastObject'); - _emberMetal.propertyDidChange(array, 'lastObject'); + + return TemplateElement; + })(Element); + + var EngineElement = (function (_Element2) { + babelHelpers.inherits(EngineElement, _Element2); + + function EngineElement() { + babelHelpers.classCallCheck(this, EngineElement); + + _Element2.apply(this, arguments); } - } - return array; - } - var EMBER_ARRAY = _emberUtils.symbol('EMBER_ARRAY'); + return EngineElement; + })(Element); - function isEmberArray(obj) { - return obj && !!obj[EMBER_ARRAY]; - } + DebugStack = (function () { + function DebugStack() { + babelHelpers.classCallCheck(this, DebugStack); - // .......................................................... - // ARRAY - // - /** - This mixin implements Observer-friendly Array-like behavior. It is not a - concrete implementation, but it can be used up by other classes that want - to appear like arrays. - - For example, ArrayProxy is a concrete classes that can - be instantiated to implement array-like behavior. Both of these classes use - the Array Mixin by way of the MutableArray mixin, which allows observable - changes to be made to the underlying array. - - Unlike `Ember.Enumerable,` this mixin defines methods specifically for - collections that provide index-ordered access to their contents. When you - are designing code that needs to accept any kind of Array-like object, you - should use these methods instead of Array primitives because these will - properly notify observers of changes to the array. - - Although these methods are efficient, they do add a layer of indirection to - your application so it is a good idea to use them only when you need the - flexibility of using both true JavaScript arrays and "virtual" arrays such - as controllers and collections. - - You can use the methods defined in this module to access and modify array - contents in a KVO-friendly way. You can also be notified whenever the - membership of an array changes by using `.observes('myArray.[]')`. - - To support `Ember.Array` in your own class, you must override two - primitives to use it: `length()` and `objectAt()`. - - Note that the Ember.Array mixin also incorporates the `Ember.Enumerable` - mixin. All `Ember.Array`-like objects are also enumerable. - - @class Array - @namespace Ember - @uses Ember.Enumerable - @since Ember 0.9.0 - @public - */ - var ArrayMixin = _emberMetal.Mixin.create(_emberRuntimeMixinsEnumerable.default, (_Mixin$create = {}, _Mixin$create[EMBER_ARRAY] = true, _Mixin$create.length = null, _Mixin$create.objectAt = function (idx) { - if (idx < 0 || idx >= _emberMetal.get(this, 'length')) { - return undefined; - } + this._stack = []; + } + + DebugStack.prototype.push = function push(name) { + this._stack.push(new TemplateElement(name)); + }; - return _emberMetal.get(this, idx); - }, _Mixin$create.objectsAt = function (indexes) { - var _this = this; + DebugStack.prototype.pushEngine = function pushEngine(name) { + this._stack.push(new EngineElement(name)); + }; - return indexes.map(function (idx) { - return objectAt(_this, idx); - }); - }, _Mixin$create.nextObject = function (idx) { - return objectAt(this, idx); - }, _Mixin$create['[]'] = _emberMetal.computed({ - get: function (key) { - return this; - }, - set: function (key, value) { - this.replace(0, _emberMetal.get(this, 'length'), value); - return this; - } - }), _Mixin$create.firstObject = _emberMetal.computed(function () { - return objectAt(this, 0); - }).readOnly(), _Mixin$create.lastObject = _emberMetal.computed(function () { - return objectAt(this, _emberMetal.get(this, 'length') - 1); - }).readOnly(), _Mixin$create.contains = function (obj) { - if (true) { - _emberMetal.deprecate('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.', false, { id: 'ember-runtime.enumerable-contains', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_enumerable-contains' }); - } + DebugStack.prototype.pop = function pop() { + var element = this._stack.pop(); - return this.indexOf(obj) >= 0; - }, _Mixin$create.slice = function (beginIndex, endIndex) { - var ret = _emberMetal.default.A(); - var length = _emberMetal.get(this, 'length'); + if (element) { + return element.name; + } + }; - if (_emberMetal.isNone(beginIndex)) { - beginIndex = 0; - } + DebugStack.prototype.peek = function peek() { + var template = this._currentTemplate(); + var engine = this._currentEngine(); - if (_emberMetal.isNone(endIndex) || endIndex > length) { - endIndex = length; - } + if (engine) { + return '"' + template + '" (in "' + engine + '")'; + } else if (template) { + return '"' + template + '"'; + } + }; - if (beginIndex < 0) { - beginIndex = length + beginIndex; + DebugStack.prototype._currentTemplate = function _currentTemplate() { + return this._getCurrentByType(TemplateElement); + }; + + DebugStack.prototype._currentEngine = function _currentEngine() { + return this._getCurrentByType(EngineElement); + }; + + DebugStack.prototype._getCurrentByType = function _getCurrentByType(type) { + for (var i = this._stack.length; i >= 0; i--) { + var element = this._stack[i]; + if (element instanceof type) { + return element.name; + } + } + }; + + return DebugStack; + })(); + }); + + exports.default = DebugStack; +}); +enifed('ember-glimmer/utils/iterable', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/each-in', '@glimmer/reference'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberGlimmerUtilsReferences, _emberGlimmerHelpersEachIn, _glimmerReference) { + 'use strict'; + + exports.default = iterableFor; + + var ITERATOR_KEY_GUID = 'be277757-bbbe-4620-9fcb-213ef433cca2'; + + function iterableFor(ref, keyPath) { + if (_emberGlimmerHelpersEachIn.isEachIn(ref)) { + return new EachInIterable(ref, keyForEachIn(keyPath)); + } else { + return new ArrayIterable(ref, keyForArray(keyPath)); } + } - if (endIndex < 0) { - endIndex = length + endIndex; + function keyForEachIn(keyPath) { + switch (keyPath) { + case '@index': + case undefined: + case null: + return index; + case '@identity': + return identity; + default: + return function (item) { + return _emberMetal.get(item, keyPath); + }; } + } - while (beginIndex < endIndex) { - ret[ret.length] = objectAt(this, beginIndex++); + function keyForArray(keyPath) { + switch (keyPath) { + case '@index': + return index; + case '@identity': + case undefined: + case null: + return identity; + default: + return function (item) { + return _emberMetal.get(item, keyPath); + }; } + } - return ret; - }, _Mixin$create.indexOf = function (object, startAt) { - var len = _emberMetal.get(this, 'length'); + function index(item, index) { + return String(index); + } - if (startAt === undefined) { - startAt = 0; + function identity(item) { + switch (typeof item) { + case 'string': + case 'number': + return String(item); + default: + return _emberUtils.guidFor(item); } + } - if (startAt < 0) { - startAt += len; - } + function ensureUniqueKey(seen, key) { + var seenCount = seen[key]; - for (var idx = startAt; idx < len; idx++) { - if (objectAt(this, idx) === object) { - return idx; - } + if (seenCount) { + seen[key]++; + return '' + key + ITERATOR_KEY_GUID + seenCount; + } else { + seen[key] = 1; } - return -1; - }, _Mixin$create.lastIndexOf = function (object, startAt) { - var len = _emberMetal.get(this, 'length'); + return key; + } - if (startAt === undefined || startAt >= len) { - startAt = len - 1; - } + var ArrayIterator = (function () { + function ArrayIterator(array, keyFor) { + babelHelpers.classCallCheck(this, ArrayIterator); - if (startAt < 0) { - startAt += len; + this.array = array; + this.length = array.length; + this.keyFor = keyFor; + this.position = 0; + this.seen = new _emberUtils.EmptyObject(); } - for (var idx = startAt; idx >= 0; idx--) { - if (objectAt(this, idx) === object) { - return idx; + ArrayIterator.prototype.isEmpty = function isEmpty() { + return false; + }; + + ArrayIterator.prototype.next = function next() { + var array = this.array; + var length = this.length; + var keyFor = this.keyFor; + var position = this.position; + var seen = this.seen; + + if (position >= length) { + return null; } - } - return -1; - }, _Mixin$create.addArrayObserver = function (target, opts) { - return addArrayObserver(this, target, opts); - }, _Mixin$create.removeArrayObserver = function (target, opts) { - return removeArrayObserver(this, target, opts); - }, _Mixin$create.hasArrayObservers = _emberMetal.computed(function () { - return _emberMetal.hasListeners(this, '@array:change') || _emberMetal.hasListeners(this, '@array:before'); - }), _Mixin$create.arrayContentWillChange = function (startIdx, removeAmt, addAmt) { - return arrayContentWillChange(this, startIdx, removeAmt, addAmt); - }, _Mixin$create.arrayContentDidChange = function (startIdx, removeAmt, addAmt) { - return arrayContentDidChange(this, startIdx, removeAmt, addAmt); - }, _Mixin$create['@each'] = _emberMetal.computed(function () { - // TODO use Symbol or add to meta - if (!this.__each) { - this.__each = new _emberRuntimeSystemEach_proxy.default(this); - } + var value = array[position]; + var memo = position; + var key = ensureUniqueKey(seen, keyFor(value, memo)); - return this.__each; - }).volatile().readOnly(), _Mixin$create)); + this.position++; - if (true) { - 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 = _emberMetal.get(this, 'length'); + return { key: key, value: value, memo: memo }; + }; - if (startAt === undefined) { - startAt = 0; - } + return ArrayIterator; + })(); - if (startAt < 0) { - startAt += len; - } + var EmberArrayIterator = (function () { + function EmberArrayIterator(array, keyFor) { + babelHelpers.classCallCheck(this, EmberArrayIterator); - for (var idx = startAt; idx < len; idx++) { - var currentObj = objectAt(this, idx); + this.array = array; + this.length = _emberMetal.get(array, 'length'); + this.keyFor = keyFor; + this.position = 0; + this.seen = new _emberUtils.EmptyObject(); + } - // SameValueZero comparison (NaN !== NaN) - if (obj === currentObj || obj !== obj && currentObj !== currentObj) { - return true; - } - } + EmberArrayIterator.prototype.isEmpty = function isEmpty() { + return this.length === 0; + }; - return false; + EmberArrayIterator.prototype.next = function next() { + var array = this.array; + var length = this.length; + var keyFor = this.keyFor; + var position = this.position; + var seen = this.seen; + + if (position >= length) { + return null; } - }); - } - exports.default = ArrayMixin; -}); -// ES6TODO: Ember.A + var value = _emberRuntime.objectAt(array, position); + var memo = position; + var key = ensureUniqueKey(seen, keyFor(value, memo)); -/** - __Required.__ You must implement this method to apply this mixin. - Your array must support the `length` property. Your replace methods should - set this property whenever it changes. - @property {Number} length - @public -*/ + this.position++; -/** - Returns the object at the given `index`. If the given `index` is negative - or is greater or equal than the array length, returns `undefined`. - This is one of the primitives you must implement to support `Ember.Array`. - If your object supports retrieving the value of an array item using `get()` - (i.e. `myArray.get(0)`), then you do not need to implement this method - yourself. - ```javascript - let arr = ['a', 'b', 'c', 'd']; - arr.objectAt(0); // 'a' - arr.objectAt(3); // 'd' - arr.objectAt(-1); // undefined - arr.objectAt(4); // undefined - arr.objectAt(5); // undefined - ``` - @method objectAt - @param {Number} idx The index of the item to return. - @return {*} item at index or undefined - @public -*/ + return { key: key, value: value, memo: memo }; + }; -/** - This returns the objects at the specified indexes, using `objectAt`. - ```javascript - let arr = ['a', 'b', 'c', 'd']; - arr.objectsAt([0, 1, 2]); // ['a', 'b', 'c'] - arr.objectsAt([2, 3, 4]); // ['c', 'd', undefined] - ``` - @method objectsAt - @param {Array} indexes An array of indexes of items to return. - @return {Array} - @public - */ + return EmberArrayIterator; + })(); -// overrides Ember.Enumerable version + var ObjectKeysIterator = (function () { + function ObjectKeysIterator(keys, values, keyFor) { + babelHelpers.classCallCheck(this, ObjectKeysIterator); -/** - This is the handler for the special array content property. If you get - this property, it will return this. If you set this property to a new - array, it will replace the current content. - This property overrides the default property defined in `Ember.Enumerable`. - @property [] - @return this - @public -*/ + this.keys = keys; + this.values = values; + this.keyFor = keyFor; + this.position = 0; + this.seen = new _emberUtils.EmptyObject(); + } -// optimized version from Enumerable + ObjectKeysIterator.prototype.isEmpty = function isEmpty() { + return this.keys.length === 0; + }; -// Add any extra methods to Ember.Array that are native to the built-in Array. -/** - Returns a new array that is a slice of the receiver. This implementation - uses the observable array methods to retrieve the objects for the new - slice. - ```javascript - let arr = ['red', 'green', 'blue']; - arr.slice(0); // ['red', 'green', 'blue'] - arr.slice(0, 2); // ['red', 'green'] - arr.slice(1, 100); // ['green', 'blue'] - ``` - @method slice - @param {Number} beginIndex (Optional) index to begin slicing from. - @param {Number} endIndex (Optional) index to end the slice at (but not included). - @return {Array} New array with specified slice - @public -*/ + ObjectKeysIterator.prototype.next = function next() { + var keys = this.keys; + var values = this.values; + var keyFor = this.keyFor; + var position = this.position; + var seen = this.seen; -/** - Returns the index of the given object's first occurrence. - If no `startAt` argument is given, the starting location to - search is 0. If it's negative, will count backward from - the end of the array. Returns -1 if no match is found. - ```javascript - let arr = ['a', 'b', 'c', 'd', 'a']; - arr.indexOf('a'); // 0 - arr.indexOf('z'); // -1 - arr.indexOf('a', 2); // 4 - arr.indexOf('a', -1); // 4 - arr.indexOf('b', 3); // -1 - arr.indexOf('a', 100); // -1 - ``` - @method indexOf - @param {Object} object the item to search for - @param {Number} startAt optional starting location to search, default 0 - @return {Number} index or -1 if not found - @public -*/ + if (position >= keys.length) { + return null; + } -/** - Returns the index of the given object's last occurrence. - If no `startAt` argument is given, the search starts from - the last position. If it's negative, will count backward - from the end of the array. Returns -1 if no match is found. - ```javascript - let arr = ['a', 'b', 'c', 'd', 'a']; - arr.lastIndexOf('a'); // 4 - arr.lastIndexOf('z'); // -1 - arr.lastIndexOf('a', 2); // 0 - arr.lastIndexOf('a', -1); // 4 - arr.lastIndexOf('b', 3); // 1 - arr.lastIndexOf('a', 100); // 4 - ``` - @method lastIndexOf - @param {Object} object the item to search for - @param {Number} startAt optional starting location to search, default 0 - @return {Number} index or -1 if not found - @public -*/ + var value = values[position]; + var memo = keys[position]; + var key = ensureUniqueKey(seen, keyFor(value, memo)); -// .......................................................... -// ARRAY OBSERVERS -// + this.position++; -/** - Adds an array observer to the receiving array. The array observer object - normally must implement two methods: - * `arrayWillChange(observedObj, start, removeCount, addCount)` - This method will be - called just before the array is modified. - * `arrayDidChange(observedObj, start, removeCount, addCount)` - This method will be - called just after the array is modified. - Both callbacks will be passed the observed object, starting index of the - change as well as a count of the items to be removed and added. You can use - these callbacks to optionally inspect the array during the change, clear - caches, or do any other bookkeeping necessary. - In addition to passing a target, you can also include an options hash - which you can use to override the method names that will be invoked on the - target. - @method addArrayObserver - @param {Object} target The observer object. - @param {Object} opts Optional hash of configuration options including - `willChange` and `didChange` option. - @return {Ember.Array} receiver - @public -*/ + return { key: key, value: value, memo: memo }; + }; -/** - Removes an array observer from the object if the observer is current - registered. Calling this method multiple times with the same object will - have no effect. - @method removeArrayObserver - @param {Object} target The object observing the array. - @param {Object} opts Optional hash of configuration options including - `willChange` and `didChange` option. - @return {Ember.Array} receiver - @public -*/ + return ObjectKeysIterator; + })(); -/** - Becomes true whenever the array currently has observers watching changes - on the array. - @property {Boolean} hasArrayObservers - @public -*/ + var EmptyIterator = (function () { + function EmptyIterator() { + babelHelpers.classCallCheck(this, EmptyIterator); + } -/** - If you are implementing an object that supports `Ember.Array`, call this - method just before the array content changes to notify any observers and - invalidate any related properties. Pass the starting index of the change - as well as a delta of the amounts to change. - @method arrayContentWillChange - @param {Number} startIdx The starting index in the array that will change. - @param {Number} removeAmt The number of items that will be removed. If you - pass `null` assumes 0 - @param {Number} addAmt The number of items that will be added. If you - pass `null` assumes 0. - @return {Ember.Array} receiver - @public -*/ + EmptyIterator.prototype.isEmpty = function isEmpty() { + return true; + }; -/** - If you are implementing an object that supports `Ember.Array`, call this - method just after the array content changes to notify any observers and - invalidate any related properties. Pass the starting index of the change - as well as a delta of the amounts to change. - @method arrayContentDidChange - @param {Number} startIdx The starting index in the array that did change. - @param {Number} removeAmt The number of items that were removed. If you - pass `null` assumes 0 - @param {Number} addAmt The number of items that were added. If you - pass `null` assumes 0. - @return {Ember.Array} receiver - @public -*/ + EmptyIterator.prototype.next = function next() { + throw new Error('Cannot call next() on an empty iterator'); + }; -/** - Returns a special object that can be used to observe individual properties - on the array. Just get an equivalent property on this object and it will - return an enumerable that maps automatically to the named key on the - member objects. - `@each` should only be used in a non-terminal context. Example: - ```javascript - myMethod: computed('posts.@each.author', function(){ - ... - }); - ``` - If you merely want to watch for the array being changed, like an object being - replaced, added or removed, use `[]` instead of `@each`. - ```javascript - myMethod: computed('posts.[]', function(){ - ... - }); - ``` - @property @each - @public -*/ -enifed('ember-runtime/mixins/comparable', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; + return EmptyIterator; + })(); - /** - @module ember - @submodule ember-runtime - */ + var EMPTY_ITERATOR = new EmptyIterator(); - /** - Implements some standard methods for comparing objects. Add this mixin to - any class you create that can compare its instances. - - You should implement the `compare()` method. - - @class Comparable - @namespace Ember - @since Ember 0.9 - @private - */ - exports.default = _emberMetal.Mixin.create({ + var EachInIterable = (function () { + function EachInIterable(ref, keyFor) { + babelHelpers.classCallCheck(this, EachInIterable); - /** - __Required.__ You must implement this method to apply this mixin. - Override to return the result of the comparison of the two parameters. The - compare method should return: - - `-1` if `a < b` - - `0` if `a == b` - - `1` if `a > b` - Default implementation raises an exception. - @method compare - @param a {Object} the first object to compare - @param b {Object} the second object to compare - @return {Number} the result of the comparison - @private - */ - compare: null - }); -}); -enifed('ember-runtime/mixins/container_proxy', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-runtime - */ - 'use strict'; + this.ref = ref; + this.keyFor = keyFor; - /** - ContainerProxyMixin is used to provide public access to specific - container functionality. - - @class ContainerProxyMixin - @private - */ - exports.default = _emberMetal.Mixin.create({ - /** - The container stores state. - @private - @property {Ember.Container} __container__ - */ - __container__: null, + var valueTag = this.valueTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - /** - Returns an object that can be used to provide an owner to a - manually created instance. - Example: - ``` - let owner = Ember.getOwner(this); - User.create( - owner.ownerInjection(), - { username: 'rwjblue' } - ) - ``` - @public - @method ownerInjection - @return {Object} - */ - ownerInjection: function () { - return this.__container__.ownerInjection(); - }, + this.tag = _glimmerReference.combine([ref.tag, valueTag]); + } - /** - Given a fullName return a corresponding instance. - The default behaviour is for lookup to return a singleton instance. - The singleton is scoped to the container, allowing multiple containers - to all have their own locally scoped singletons. - ```javascript - let registry = new Registry(); - let container = registry.container(); - registry.register('api:twitter', Twitter); - let twitter = container.lookup('api:twitter'); - twitter instanceof Twitter; // => true - // by default the container will return singletons - let twitter2 = container.lookup('api:twitter'); - twitter2 instanceof Twitter; // => true - twitter === twitter2; //=> true - ``` - If singletons are not wanted an optional flag can be provided at lookup. - ```javascript - let registry = new Registry(); - let container = registry.container(); - registry.register('api:twitter', Twitter); - let twitter = container.lookup('api:twitter', { singleton: false }); - let twitter2 = container.lookup('api:twitter', { singleton: false }); - twitter === twitter2; //=> false - ``` - @public - @method lookup - @param {String} fullName - @param {Object} options - @return {any} - */ - lookup: function (fullName, options) { - return this.__container__.lookup(fullName, options); - }, + EachInIterable.prototype.iterate = function iterate() { + var ref = this.ref; + var keyFor = this.keyFor; + var valueTag = this.valueTag; - /** - Given a fullName return the corresponding factory. - @private - @method _lookupFactory - @param {String} fullName - @return {any} - */ - _lookupFactory: function (fullName, options) { - return this.__container__.lookupFactory(fullName, options); - }, + var iterable = ref.value(); - /** - Given a name and a source path, resolve the fullName - @private - @method _resolveLocalLookupName - @param {String} fullName - @param {String} source - @return {String} - */ - _resolveLocalLookupName: function (name, source) { - return this.__container__.registry.expandLocalLookup('component:' + name, { - source: source - }); - }, + valueTag.update(_emberMetal.tagFor(iterable)); - /** - @private - */ - willDestroy: function () { - this._super.apply(this, arguments); + if (_emberMetal.isProxy(iterable)) { + iterable = _emberMetal.get(iterable, 'content'); + } + + var typeofIterable = typeof iterable; - if (this.__container__) { - _emberMetal.run(this.__container__, 'destroy'); + if (iterable && (typeofIterable === 'object' || typeofIterable === 'function')) { + var keys = Object.keys(iterable); + var values = keys.map(function (key) { + return iterable[key]; + }); + return keys.length > 0 ? new ObjectKeysIterator(keys, values, keyFor) : EMPTY_ITERATOR; + } else { + return EMPTY_ITERATOR; } - } - }); -}); -enifed('ember-runtime/mixins/controller', ['exports', 'ember-metal', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/controller_content_model_alias_deprecation'], function (exports, _emberMetal, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsController_content_model_alias_deprecation) { - 'use strict'; + }; - /** - @class ControllerMixin - @namespace Ember - @uses Ember.ActionHandler - @private - */ - exports.default = _emberMetal.Mixin.create(_emberRuntimeMixinsAction_handler.default, _emberRuntimeMixinsController_content_model_alias_deprecation.default, { - /* ducktype as a controller */ - isController: true, + // {{each-in}} yields |key value| instead of |value key|, so the memo and + // value are flipped - /** - The object to which actions from the view should be sent. - For example, when a Handlebars template uses the `{{action}}` helper, - it will attempt to send the action to the view's controller's `target`. - By default, the value of the target property is set to the router, and - is injected when a controller is instantiated. This injection is applied - as part of the application's initialization process. In most cases the - `target` property will automatically be set to the logical consumer of - actions for the controller. - @property target - @default null - @public - */ - target: null, + EachInIterable.prototype.valueReferenceFor = function valueReferenceFor(item) { + return new _emberGlimmerUtilsReferences.UpdatablePrimitiveReference(item.memo); + }; - store: null, + EachInIterable.prototype.updateValueReference = function updateValueReference(reference, item) { + reference.update(item.memo); + }; - /** - The controller's current model. When retrieving or modifying a controller's - model, this property should be used instead of the `content` property. - @property model - @public - */ - model: null, + EachInIterable.prototype.memoReferenceFor = function memoReferenceFor(item) { + return new _emberGlimmerUtilsReferences.UpdatableReference(item.value); + }; - /** - @private - */ - content: _emberMetal.alias('model') + EachInIterable.prototype.updateMemoReference = function updateMemoReference(reference, item) { + reference.update(item.value); + }; - }); -}); -enifed('ember-runtime/mixins/controller_content_model_alias_deprecation', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; + return EachInIterable; + })(); - /* - The ControllerContentModelAliasDeprecation mixin is used to provide a useful - deprecation warning when specifying `content` directly on a `Ember.Controller` - (without also specifying `model`). - - Ember versions prior to 1.7 used `model` as an alias of `content`, but due to - much confusion this alias was reversed (so `content` is now an alias of `model). - - This change reduces many caveats with model/content, and also sets a - simple ground rule: Never set a controllers content, rather always set - its model and ember will do the right thing. - - Used internally by Ember in `Ember.Controller`. - */ - exports.default = _emberMetal.Mixin.create({ - /** - @private - Moves `content` to `model` at extend time if a `model` 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) { - // Calling super is only OK here since we KNOW that - // there is another Mixin loaded first. - this._super.apply(this, arguments); + var ArrayIterable = (function () { + function ArrayIterable(ref, keyFor) { + babelHelpers.classCallCheck(this, ArrayIterable); - var modelSpecified = !!props.model; + this.ref = ref; + this.keyFor = keyFor; - if (props.content && !modelSpecified) { - props.model = props.content; - delete props['content']; + var valueTag = this.valueTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - _emberMetal.deprecate('Do not specify `content` on a Controller, use `model` instead.', false, { id: 'ember-runtime.will-merge-mixin', until: '3.0.0' }); - } + this.tag = _glimmerReference.combine([ref.tag, valueTag]); } - }); -}); -enifed('ember-runtime/mixins/copyable', ['exports', 'ember-metal', 'ember-runtime/mixins/freezable'], function (exports, _emberMetal, _emberRuntimeMixinsFreezable) { - /** - @module ember - @submodule ember-runtime - */ - 'use strict'; + ArrayIterable.prototype.iterate = function iterate() { + var ref = this.ref; + var keyFor = this.keyFor; + var valueTag = this.valueTag; - /** - 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. - - You should generally implement the `copy()` method to return a copy of the - receiver. - - Note that `frozenCopy()` will only work if you also implement - `Ember.Freezable`. - - @class Copyable - @namespace Ember - @since Ember 0.9 - @private - */ - exports.default = _emberMetal.Mixin.create({ - /** - __Required.__ You must implement this method to apply this mixin. - Override to return a copy of the receiver. Default implementation raises - an exception. - @method copy - @param {Boolean} deep if `true`, a deep copy of the object should be made - @return {Object} copy of receiver - @private - */ - copy: null, + var iterable = ref.value(); - /** - If the object implements `Ember.Freezable`, then this will return a new - copy if the object is not frozen and the receiver if the object is frozen. - Raises an exception if you try to call this method on a object that does - not support freezing. - You should use this method whenever you want a copy of a freezable object - since a freezable object can simply return itself without actually - consuming more memory. - @method frozenCopy - @return {Object} copy of receiver or receiver - @deprecated Use `Object.freeze` instead. - @private - */ - frozenCopy: function () { - _emberMetal.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 _emberMetal.get(this, 'isFrozen') ? this : this.copy().freeze(); + valueTag.update(_emberMetal.tagForProperty(iterable, '[]')); + + if (!iterable || typeof iterable !== 'object') { + return EMPTY_ITERATOR; + } + + if (Array.isArray(iterable)) { + return iterable.length > 0 ? new ArrayIterator(iterable, keyFor) : EMPTY_ITERATOR; + } else if (_emberRuntime.isEmberArray(iterable)) { + return _emberMetal.get(iterable, 'length') > 0 ? new EmberArrayIterator(iterable, keyFor) : EMPTY_ITERATOR; + } else if (typeof iterable.forEach === 'function') { + var _ret = (function () { + var array = []; + iterable.forEach(function (item) { + array.push(item); + }); + return { + v: array.length > 0 ? new ArrayIterator(array, keyFor) : EMPTY_ITERATOR + }; + })(); + + if (typeof _ret === 'object') return _ret.v; } else { - throw new _emberMetal.Error(this + ' does not support freezing'); + return EMPTY_ITERATOR; } - } - }); -}); -enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/compare', 'require'], function (exports, _emberUtils, _emberMetal, _emberRuntimeCompare, _require) { - /** - @module ember - @submodule ember-runtime - */ + }; - // .......................................................... - // HELPERS - // + ArrayIterable.prototype.valueReferenceFor = function valueReferenceFor(item) { + return new _emberGlimmerUtilsReferences.UpdatableReference(item.value); + }; + + ArrayIterable.prototype.updateValueReference = function updateValueReference(reference, item) { + reference.update(item.value); + }; + + ArrayIterable.prototype.memoReferenceFor = function memoReferenceFor(item) { + return new _emberGlimmerUtilsReferences.UpdatablePrimitiveReference(item.memo); + }; + + ArrayIterable.prototype.updateMemoReference = function updateMemoReference(reference, item) { + reference.update(item.memo); + }; + return ArrayIterable; + })(); +}); +enifed('ember-glimmer/utils/process-args', ['exports', 'ember-utils', '@glimmer/reference', 'ember-glimmer/component', 'ember-glimmer/utils/references', 'ember-views', 'ember-glimmer/helpers/action', '@glimmer/runtime'], function (exports, _emberUtils, _glimmerReference, _emberGlimmerComponent, _emberGlimmerUtilsReferences, _emberViews, _emberGlimmerHelpersAction, _glimmerRuntime) { 'use strict'; - var _emberA = undefined; + exports.gatherArgs = gatherArgs; - function emberA() { - return (_emberA || (_emberA = _require.default('ember-runtime/system/native_array').A))(); + // Maps all variants of positional and dynamically scoped arguments + // into the named arguments. Input `args` and return value are both + // `EvaluatedArgs`. + + function gatherArgs(args, definition) { + var namedMap = gatherNamedMap(args, definition); + var positionalValues = gatherPositionalValues(args, definition); + return mergeArgs(namedMap, positionalValues, args.blocks, definition.ComponentClass.class); } - var contexts = []; + function gatherNamedMap(args, definition) { + var namedMap = args.named.map; + if (definition.args) { + return _emberUtils.assign({}, definition.args.named.map, namedMap); + } else { + return namedMap; + } + } - function popCtx() { - return contexts.length === 0 ? {} : contexts.pop(); + function gatherPositionalValues(args, definition) { + var positionalValues = args.positional.values; + if (definition.args) { + var oldPositional = definition.args.positional.values; + var newPositional = []; + newPositional.push.apply(newPositional, oldPositional); + newPositional.splice.apply(newPositional, [0, positionalValues.length].concat(positionalValues)); + return newPositional; + } else { + return positionalValues; + } } - function pushCtx(ctx) { - contexts.push(ctx); - return null; + function mergeArgs(namedMap, positionalValues, blocks, componentClass) { + var positionalParamsDefinition = componentClass.positionalParams; + + if (positionalParamsDefinition && positionalParamsDefinition.length > 0 && positionalValues.length > 0) { + if (typeof positionalParamsDefinition === 'string') { + namedMap = mergeRestArg(namedMap, positionalValues, positionalParamsDefinition); + } else { + namedMap = mergePositionalParams(namedMap, positionalValues, positionalParamsDefinition); + } + } + return _glimmerRuntime.EvaluatedArgs.named(namedMap, blocks); } - function iter(key, value) { - var valueProvided = arguments.length === 2; + var EMPTY_ARGS = { + tag: _glimmerReference.CONSTANT_TAG, + value: function () { + var _props; - function i(item) { - var cur = _emberMetal.get(item, key); - return valueProvided ? value === cur : !!cur; + return { attrs: {}, props: (_props = { attrs: {} }, _props[_emberGlimmerComponent.ARGS] = {}, _props) }; } + }; - return i; - } + // ComponentArgs takes EvaluatedNamedArgs and converts them into the + // inputs needed by CurlyComponents (attrs and props, with mutable + // cells, etc). - /** - This mixin defines the common interface implemented by enumerable objects - in Ember. Most of these methods follow the standard Array iteration - API defined up to JavaScript 1.8 (excluding language-specific features that - cannot be emulated in older versions of JavaScript). - - This mixin is applied automatically to the Array class on page load, so you - can use any of these methods on simple arrays. If Array already implements - one of these methods, the mixin will not override them. - - ## Writing Your Own Enumerable - - To make your own custom class enumerable, you need two items: - - 1. You must have a length property. This property should change whenever - the number of items in your enumerable object changes. If you use this - with an `Ember.Object` subclass, you should be sure to change the length - property using `set().` - - 2. You must implement `nextObject().` See documentation. - - Once you have these two methods implemented, apply the `Ember.Enumerable` mixin - to your class and you will be able to enumerate the contents of your object - like any other collection. - - ## Using Ember Enumeration with Other Libraries - - Many other libraries provide some kind of iterator or enumeration like - facility. This is often where the most common API conflicts occur. - Ember's API is designed to be as friendly as possible with other - libraries by implementing only methods that mostly correspond to the - JavaScript 1.8 API. - - @class Enumerable - @namespace Ember - @since Ember 0.9 - @private - */ - var Enumerable = _emberMetal.Mixin.create({ + var ComponentArgs = (function () { + ComponentArgs.create = function create(args) { + if (args.named.keys.length === 0) { + return EMPTY_ARGS; + } else { + return new ComponentArgs(args.named); + } + }; - /** - __Required.__ You must implement this method to apply this mixin. - Implement this method to make your class enumerable. - This method will be called repeatedly during enumeration. The index value - will always begin with 0 and increment monotonically. You don't have to - rely on the index value to determine what object to return, but you should - always check the value and start from the beginning when you see the - requested index is 0. - The `previousObject` is the object that was returned from the last call - to `nextObject` for the current iteration. This is a useful way to - manage iteration if you are tracing a linked list, for example. - Finally the context parameter will always contain a hash you can use as - a "scratchpad" to maintain any other state you need in order to iterate - properly. The context object is reused and is not reset between - iterations so make sure you setup the context with a fresh state whenever - the index parameter is 0. - Generally iterators will continue to call `nextObject` until the index - reaches the current length-1. If you run out of data before this - time for some reason, you should simply return undefined. - The default implementation of this method simply looks up the index. - This works great on any Array-like objects. - @method nextObject - @param {Number} index the current index of the iteration - @param {Object} previousObject the value returned by the last call to - `nextObject`. - @param {Object} context a context object you can use to maintain state. - @return {Object} the next object in the iteration or undefined - @private - */ - nextObject: null, + function ComponentArgs(namedArgs) { + babelHelpers.classCallCheck(this, ComponentArgs); - /** - Helper method returns the first object from a collection. This is usually - used by bindings and other parts of the framework to extract a single - object if the enumerable contains only one item. - If you override this method, you should implement it so that it will - always return the same value each time it is called. If your enumerable - contains only one object, this method should always return that object. - If your enumerable is empty, this method should return `undefined`. - ```javascript - let arr = ['a', 'b', 'c']; - arr.get('firstObject'); // 'a' - let arr = []; - arr.get('firstObject'); // undefined - ``` - @property firstObject - @return {Object} the object or undefined - @readOnly - @public - */ - firstObject: _emberMetal.computed('[]', function () { - if (_emberMetal.get(this, 'length') === 0) { - return undefined; + this.tag = namedArgs.tag; + this.namedArgs = namedArgs; + } + + ComponentArgs.prototype.value = function value() { + var namedArgs = this.namedArgs; + + var keys = namedArgs.keys; + var attrs = namedArgs.value(); + var props = new _emberUtils.EmptyObject(); + var args = new _emberUtils.EmptyObject(); + + props[_emberGlimmerComponent.ARGS] = args; + + for (var i = 0, l = keys.length; i < l; i++) { + var _name = keys[i]; + var ref = namedArgs.get(_name); + var value = attrs[_name]; + + if (typeof value === 'function' && value[_emberGlimmerHelpersAction.ACTION]) { + attrs[_name] = value; + } else if (ref[_emberGlimmerUtilsReferences.UPDATE]) { + attrs[_name] = new MutableCell(ref, value); + } + + args[_name] = ref; + props[_name] = value; } - // handle generic enumerables - var context = popCtx(); - var ret = this.nextObject(0, null, context); + props.attrs = attrs; - pushCtx(context); + return { attrs: attrs, props: props }; + }; - return ret; - }).readOnly(), + return ComponentArgs; + })(); - /** - Helper method returns the last object from a collection. If your enumerable - contains only one object, this method should always return that object. - If your enumerable is empty, this method should return `undefined`. - ```javascript - let arr = ['a', 'b', 'c']; - arr.get('lastObject'); // 'c' - let arr = []; - arr.get('lastObject'); // undefined - ``` - @property lastObject - @return {Object} the last object or undefined - @readOnly - @public - */ - lastObject: _emberMetal.computed('[]', function () { - var len = _emberMetal.get(this, 'length'); + exports.ComponentArgs = ComponentArgs; - if (len === 0) { - return undefined; - } + function mergeRestArg(namedMap, positionalValues, restArgName) { + var mergedNamed = _emberUtils.assign({}, namedMap); + mergedNamed[restArgName] = _glimmerRuntime.EvaluatedPositionalArgs.create(positionalValues); + return mergedNamed; + } - var context = popCtx(); - var idx = 0; - var last = null; - var cur = undefined; + function mergePositionalParams(namedMap, values, positionalParamNames) { + var mergedNamed = _emberUtils.assign({}, namedMap); + var length = Math.min(values.length, positionalParamNames.length); + for (var i = 0; i < length; i++) { + var _name2 = positionalParamNames[i]; + mergedNamed[_name2] = values[i]; + } + return mergedNamed; + } - do { - last = cur; - cur = this.nextObject(idx++, last, context); - } while (cur !== undefined); + var REF = _emberUtils.symbol('REF'); - pushCtx(context); + var MutableCell = (function () { + function MutableCell(ref, value) { + babelHelpers.classCallCheck(this, MutableCell); - return last; - }).readOnly(), + this[_emberViews.MUTABLE_CELL] = true; + this[REF] = ref; + this.value = value; + } - /** - Returns `true` if the passed object can be found in the receiver. The - default version will iterate through the enumerable until the object - is found. You may want to override this with a more efficient version. - ```javascript - let arr = ['a', 'b', 'c']; - arr.contains('a'); // true - arr.contains('z'); // false - ``` - @method contains - @deprecated Use `Enumerable#includes` instead. See http://emberjs.com/deprecations/v2.x#toc_enumerable-contains - @param {Object} obj The object to search for. - @return {Boolean} `true` if object is found in enumerable. - @public - */ - contains: function (obj) { - if (true) { - _emberMetal.deprecate('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.', false, { id: 'ember-runtime.enumerable-contains', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_enumerable-contains' }); - } + MutableCell.prototype.update = function update(val) { + this[REF][_emberGlimmerUtilsReferences.UPDATE](val); + }; - var found = this.find(function (item) { - return item === obj; - }); + return MutableCell; + })(); +}); +enifed('ember-glimmer/utils/references', ['exports', 'ember-utils', 'ember-metal', '@glimmer/reference', '@glimmer/runtime', 'ember-glimmer/utils/to-bool', 'ember-glimmer/helper'], function (exports, _emberUtils, _emberMetal, _glimmerReference, _glimmerRuntime, _emberGlimmerUtilsToBool, _emberGlimmerHelper) { + 'use strict'; - return found !== undefined; - }, + var UPDATE = _emberUtils.symbol('UPDATE'); - /** - Iterates through the enumerable, calling the passed function on each - item. This method corresponds to the `forEach()` method defined in - JavaScript 1.6. - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(item, index, enumerable); - ``` - - `item` is the current item in the iteration. - - `index` is the current index in the iteration. - - `enumerable` is the enumerable object itself. - Note that in addition to a callback, you can also pass an optional target - object that will be set as `this` on the context. This is a good way - 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 - @public - */ - forEach: function (callback, target) { - if (typeof callback !== 'function') { - throw new TypeError(); - } + exports.UPDATE = UPDATE; + exports.NULL_REFERENCE = _glimmerRuntime.NULL_REFERENCE; + exports.UNDEFINED_REFERENCE = _glimmerRuntime.UNDEFINED_REFERENCE; - var context = popCtx(); - var len = _emberMetal.get(this, 'length'); - var last = null; + // @abstract + // @implements PathReference - if (target === undefined) { - target = null; - } + var EmberPathReference = (function () { + function EmberPathReference() { + babelHelpers.classCallCheck(this, EmberPathReference); + } - for (var idx = 0; idx < len; idx++) { - var next = this.nextObject(idx, last, context); - callback.call(target, next, idx, this); - last = next; - } + // @abstract - last = null; - context = pushCtx(context); + // @abstract get tag() + // @abstract value() - return this; - }, + EmberPathReference.prototype.get = function get(key) { + return PropertyReference.create(this, key); + }; - /** - Alias for `mapBy` - @method getEach - @param {String} key name of the property - @return {Array} The mapped array. - @public - */ - getEach: _emberMetal.aliasMethod('mapBy'), + return EmberPathReference; + })(); - /** - Sets the value on the named property for each member. This is more - ergonomic than using other methods defined on this helper. If the object - implements Ember.Observable, the value will be changed to `set(),` otherwise - it will be set directly. `null` objects are skipped. - @method setEach - @param {String} key The key to set - @param {Object} value The object to set - @return {Object} receiver - @public - */ - setEach: function (key, value) { - return this.forEach(function (item) { - return _emberMetal.set(item, key, value); - }); - }, + var CachedReference = (function (_EmberPathReference) { + babelHelpers.inherits(CachedReference, _EmberPathReference); - /** - Maps all of the items in the enumeration to another value, returning - a new array. This method corresponds to `map()` defined in JavaScript 1.6. - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(item, index, enumerable); - ``` - - `item` is the current item in the iteration. - - `index` is the current index in the iteration. - - `enumerable` is the enumerable object itself. - It should return the mapped value. - Note that in addition to a callback, you can also pass an optional target - object that will be set as `this` on the context. This is a good way - to give your iterator function access to the current object. - @method map - @param {Function} callback The callback to execute - @param {Object} [target] The target object to use - @return {Array} The mapped array. - @public - */ - map: function (callback, target) { - var ret = emberA(); + function CachedReference() { + babelHelpers.classCallCheck(this, CachedReference); - this.forEach(function (x, idx, i) { - return ret[idx] = callback.call(target, x, idx, i); - }); + _EmberPathReference.call(this); + this._lastRevision = null; + this._lastValue = null; + } - return ret; - }, + // @implements PathReference - /** - Similar to map, this specialized function returns the value of the named - property on all items in the enumeration. - @method mapBy - @param {String} key name of the property - @return {Array} The mapped array. - @public - */ - mapBy: function (key) { - return this.map(function (next) { - return _emberMetal.get(next, key); - }); - }, + CachedReference.prototype.value = function value() { + var tag = this.tag; + var _lastRevision = this._lastRevision; + var _lastValue = this._lastValue; - /** - Returns an array with all of the items in the enumeration that the passed - function returns true for. This method corresponds to `filter()` defined in - JavaScript 1.6. - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(item, index, enumerable); - ``` - - `item` is the current item in the iteration. - - `index` is the current index in the iteration. - - `enumerable` is the enumerable object itself. - It should return `true` to include the item in the results, `false` - otherwise. - Note that in addition to a callback, you can also pass an optional target - object that will be set as `this` on the context. This is a good way - to give your iterator function access to the current object. - @method filter - @param {Function} callback The callback to execute - @param {Object} [target] The target object to use - @return {Array} A filtered array. - @public - */ - filter: function (callback, target) { - var ret = emberA(); + if (!_lastRevision || !tag.validate(_lastRevision)) { + _lastValue = this._lastValue = this.compute(); + this._lastRevision = tag.value(); + } - this.forEach(function (x, idx, i) { - if (callback.call(target, x, idx, i)) { - ret.push(x); - } - }); + return _lastValue; + }; - return ret; - }, + // @abstract compute() + return CachedReference; + })(EmberPathReference); - /** - Returns an array with all of the items in the enumeration where the passed - function returns false. This method is the inverse of filter(). - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(item, index, enumerable); - ``` - - *item* is the current item in the iteration. - - *index* is the current index in the iteration - - *enumerable* is the enumerable object itself. - It should return a falsey value to include the item in the results. - Note that in addition to a callback, you can also pass an optional target - object that will be set as "this" on the context. This is a good way - to give your iterator function access to the current object. - @method reject - @param {Function} callback The callback to execute - @param {Object} [target] The target object to use - @return {Array} A rejected array. - @public - */ - reject: function (callback, target) { - return this.filter(function () { - return !callback.apply(target, arguments); - }); - }, + exports.CachedReference = CachedReference; - /** - Returns an array with just the items with the matched property. You - can pass an optional second argument with the target value. Otherwise - this will match any property that evaluates to `true`. - @method filterBy - @param {String} key the property to test - @param {*} [value] optional value to test against. - @return {Array} filtered array - @public - */ - filterBy: function (key, value) { - return this.filter(iter.apply(this, arguments)); - }, + var RootReference = (function (_ConstReference) { + babelHelpers.inherits(RootReference, _ConstReference); - /** - Returns an array with the items that do not have truthy values for - key. You can pass an optional second argument with the target value. Otherwise - this will match any property that evaluates to false. - @method rejectBy - @param {String} key the property to test - @param {String} [value] optional value to test against. - @return {Array} rejected array - @public - */ - rejectBy: function (key, value) { - var exactValue = function (item) { - return _emberMetal.get(item, key) === value; - }; - var hasValue = function (item) { - return !!_emberMetal.get(item, key); - }; - var use = arguments.length === 2 ? exactValue : hasValue; + function RootReference(value) { + babelHelpers.classCallCheck(this, RootReference); - return this.reject(use); - }, + _ConstReference.call(this, value); + this.children = new _emberUtils.EmptyObject(); + } - /** - Returns the first item in the array for which the callback returns true. - This method works similar to the `filter()` method defined in JavaScript 1.6 - except that it will stop working on the array once a match is found. - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(item, index, enumerable); - ``` - - `item` is the current item in the iteration. - - `index` is the current index in the iteration. - - `enumerable` is the enumerable object itself. - It should return the `true` to include the item in the results, `false` - otherwise. - Note that in addition to a callback, you can also pass an optional target - object that will be set as `this` on the context. This is a good way - to give your iterator function access to the current object. - @method find - @param {Function} callback The callback to execute - @param {Object} [target] The target object to use - @return {Object} Found item or `undefined`. - @public - */ - find: function (callback, target) { - var len = _emberMetal.get(this, 'length'); + RootReference.prototype.get = function get(propertyKey) { + var ref = this.children[propertyKey]; - if (target === undefined) { - target = null; + if (!ref) { + ref = this.children[propertyKey] = new RootPropertyReference(this.inner, propertyKey); } - var context = popCtx(); - var found = false; - var last = null; - var next = undefined, - ret = undefined; + return ref; + }; - for (var idx = 0; idx < len && !found; idx++) { - next = this.nextObject(idx, last, context); + return RootReference; + })(_glimmerReference.ConstReference); - if (found = callback.call(target, next, idx, this)) { - ret = next; - } + exports.RootReference = RootReference; - last = next; + var TwoWayFlushDetectionTag = undefined; + + if (true || true) { + TwoWayFlushDetectionTag = (function () { + function _class(tag, key, ref) { + babelHelpers.classCallCheck(this, _class); + + this.tag = tag; + this.parent = null; + this.key = key; + this.ref = ref; } - next = last = null; - context = pushCtx(context); + _class.prototype.value = function value() { + return this.tag.value(); + }; - return ret; - }, + _class.prototype.validate = function validate(ticket) { + var parent = this.parent; + var key = this.key; - /** - Returns the first item with a property matching the passed value. You - can pass an optional second argument with the target value. Otherwise - this will match any property that evaluates to `true`. - This method works much like the more generic `find()` method. - @method findBy - @param {String} key the property to test - @param {String} [value] optional value to test against. - @return {Object} found item or `undefined` - @public - */ - findBy: function (key, value) { - return this.find(iter.apply(this, arguments)); - }, + var isValid = this.tag.validate(ticket); - /** - Returns `true` if the passed function returns true for every item in the - enumeration. This corresponds with the `every()` method in JavaScript 1.6. - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(item, index, enumerable); - ``` - - `item` is the current item in the iteration. - - `index` is the current index in the iteration. - - `enumerable` is the enumerable object itself. - It should return the `true` or `false`. - Note that in addition to a callback, you can also pass an optional target - object that will be set as `this` on the context. This is a good way - to give your iterator function access to the current object. - Example Usage: - ```javascript - if (people.every(isEngineer)) { - Paychecks.addBigBonus(); - } - ``` - @method every - @param {Function} callback The callback to execute - @param {Object} [target] The target object to use - @return {Boolean} - @public - */ - every: function (callback, target) { - return !this.find(function (x, idx, i) { - return !callback.call(target, x, idx, i); - }); - }, + if (isValid && parent) { + _emberMetal.didRender(parent, key, this.ref); + } - /** - Returns `true` if the passed property resolves to the value of the second - argument for all items in the enumerable. This method is often simpler/faster - than using a callback. - @method isEvery - @param {String} key the property to test - @param {String} [value] optional value to test against. Defaults to `true` - @return {Boolean} - @since 1.3.0 - @public - */ - isEvery: function (key, value) { - return this.every(iter.apply(this, arguments)); - }, + return isValid; + }; - /** - Returns `true` if the passed function returns true for any item in the - enumeration. This corresponds with the `some()` method in JavaScript 1.6. - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(item, index, enumerable); - ``` - - `item` is the current item in the iteration. - - `index` is the current index in the iteration. - - `enumerable` is the enumerable object itself. - It should return the `true` to include the item in the results, `false` - otherwise. - Note that in addition to a callback, you can also pass an optional target - object that will be set as `this` on the context. This is a good way - to give your iterator function access to the current object. - Usage Example: - ```javascript - if (people.any(isManager)) { - Paychecks.addBiggerBonus(); - } - ``` - @method any - @param {Function} callback The callback to execute - @param {Object} [target] The target object to use - @return {Boolean} `true` if the passed function returns `true` for any item - @public - */ - any: function (callback, target) { - var len = _emberMetal.get(this, 'length'); - var context = popCtx(); - var found = false; - var last = null; - var next = undefined; + _class.prototype.didCompute = function didCompute(parent) { + this.parent = parent; + _emberMetal.didRender(parent, this.key, this.ref); + }; - if (target === undefined) { - target = null; - } + return _class; + })(); + } - for (var idx = 0; idx < len && !found; idx++) { - next = this.nextObject(idx, last, context); - found = callback.call(target, next, idx, this); - last = next; - } + var PropertyReference = (function (_CachedReference) { + babelHelpers.inherits(PropertyReference, _CachedReference); - next = last = null; - context = pushCtx(context); - return found; - }, + function PropertyReference() { + babelHelpers.classCallCheck(this, PropertyReference); - /** - Returns `true` if the passed property resolves to the value of the second - argument for any item in the enumerable. This method is often simpler/faster - than using a callback. - @method isAny - @param {String} key the property to test - @param {String} [value] optional value to test against. Defaults to `true` - @return {Boolean} - @since 1.3.0 - @public - */ - isAny: function (key, value) { - return this.any(iter.apply(this, arguments)); - }, + _CachedReference.apply(this, arguments); + } - /** - This will combine the values of the enumerator into a single value. It - is a useful way to collect a summary value from an enumeration. This - corresponds to the `reduce()` method defined in JavaScript 1.8. - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(previousValue, item, index, enumerable); - ``` - - `previousValue` is the value returned by the last call to the iterator. - - `item` is the current item in the iteration. - - `index` is the current index in the iteration. - - `enumerable` is the enumerable object itself. - Return the new cumulative value. - In addition to the callback you can also pass an `initialValue`. An error - will be raised if you do not pass an initial value and the enumerator is - empty. - Note that unlike the other methods, this method does not allow you to - pass a target object to set as this for the callback. It's part of the - spec. Sorry. - @method reduce - @param {Function} callback The callback to execute - @param {Object} initialValue Initial value for the reduce - @param {String} reducerProperty internal use only. - @return {Object} The reduced value. - @public - */ - reduce: function (callback, initialValue, reducerProperty) { - if (typeof callback !== 'function') { - throw new TypeError(); + PropertyReference.create = function create(parentReference, propertyKey) { + if (_glimmerReference.isConst(parentReference)) { + return new RootPropertyReference(parentReference.value(), propertyKey); + } else { + return new NestedPropertyReference(parentReference, propertyKey); } + }; - var ret = initialValue; + PropertyReference.prototype.get = function get(key) { + return new NestedPropertyReference(this, key); + }; - this.forEach(function (item, i) { - ret = callback(ret, item, i, this, reducerProperty); - }, this); + return PropertyReference; + })(CachedReference); - return ret; - }, + exports.PropertyReference = PropertyReference; - /** - Invokes the named method on every object in the receiver that - implements it. This method corresponds to the implementation in - Prototype 1.6. - @method invoke - @param {String} methodName the name of the method - @param {Object...} args optional arguments to pass as well. - @return {Array} return values from calling invoke. - @public - */ - invoke: function (methodName) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; + var RootPropertyReference = (function (_PropertyReference) { + babelHelpers.inherits(RootPropertyReference, _PropertyReference); + + function RootPropertyReference(parentValue, propertyKey) { + babelHelpers.classCallCheck(this, RootPropertyReference); + + _PropertyReference.call(this); + + this._parentValue = parentValue; + this._propertyKey = propertyKey; + + if (true || true) { + this.tag = new TwoWayFlushDetectionTag(_emberMetal.tagForProperty(parentValue, propertyKey), propertyKey, this); + } else { + this.tag = _emberMetal.tagForProperty(parentValue, propertyKey); } - var ret = emberA(); + if (true) { + _emberMetal.watchKey(parentValue, propertyKey); + } + } - this.forEach(function (x, idx) { - var method = x && x[methodName]; + RootPropertyReference.prototype.compute = function compute() { + var _parentValue = this._parentValue; + var _propertyKey = this._propertyKey; - if ('function' === typeof method) { - ret[idx] = args ? method.apply(x, args) : x[methodName](); - } - }, this); + if (true || true) { + this.tag.didCompute(_parentValue); + } - return ret; - }, + return _emberMetal.get(_parentValue, _propertyKey); + }; - /** - Simply converts the enumerable into a genuine array. The order is not - guaranteed. Corresponds to the method implemented by Prototype. - @method toArray - @return {Array} the enumerable as an array. - @public - */ - toArray: function () { - var ret = emberA(); + RootPropertyReference.prototype[UPDATE] = function (value) { + _emberMetal.set(this._parentValue, this._propertyKey, value); + }; - this.forEach(function (o, idx) { - return ret[idx] = o; - }); + return RootPropertyReference; + })(PropertyReference); - return ret; - }, + exports.RootPropertyReference = RootPropertyReference; - /** - Returns a copy of the array with all `null` and `undefined` elements removed. - ```javascript - let arr = ['a', null, 'c', undefined]; - arr.compact(); // ['a', 'c'] - ``` - @method compact - @return {Array} the array without null and undefined elements. - @public - */ - compact: function () { - return this.filter(function (value) { - return value != null; - }); - }, + var NestedPropertyReference = (function (_PropertyReference2) { + babelHelpers.inherits(NestedPropertyReference, _PropertyReference2); - /** - Returns a new enumerable that excludes the passed value. The default - implementation returns an array regardless of the receiver type. - If the receiver does not contain the value it returns the original enumerable. - ```javascript - let arr = ['a', 'b', 'a', 'c']; - arr.without('a'); // ['b', 'c'] - ``` - @method without - @param {Object} value - @return {Ember.Enumerable} - @public - */ - without: function (value) { - if (!this.contains(value)) { - return this; // nothing to do + function NestedPropertyReference(parentReference, propertyKey) { + babelHelpers.classCallCheck(this, NestedPropertyReference); + + _PropertyReference2.call(this); + + var parentReferenceTag = parentReference.tag; + var parentObjectTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); + + this._parentReference = parentReference; + this._parentObjectTag = parentObjectTag; + this._propertyKey = propertyKey; + + if (true || true) { + var tag = _glimmerReference.combine([parentReferenceTag, parentObjectTag]); + this.tag = new TwoWayFlushDetectionTag(tag, propertyKey, this); + } else { + this.tag = _glimmerReference.combine([parentReferenceTag, parentObjectTag]); } + } - var ret = emberA(); + NestedPropertyReference.prototype.compute = function compute() { + var _parentReference = this._parentReference; + var _parentObjectTag = this._parentObjectTag; + var _propertyKey = this._propertyKey; - this.forEach(function (k) { - if (k !== value) { - ret[ret.length] = k; - } - }); + var parentValue = _parentReference.value(); - return ret; - }, + _parentObjectTag.update(_emberMetal.tagForProperty(parentValue, _propertyKey)); - /** - Returns a new enumerable that contains only unique values. The default - implementation returns an array regardless of the receiver type. - ```javascript - let arr = ['a', 'a', 'b', 'b']; - arr.uniq(); // ['a', 'b'] - ``` - This only works on primitive data types, e.g. Strings, Numbers, etc. - @method uniq - @return {Ember.Enumerable} - @public - */ - uniq: function () { - var ret = emberA(); + if (typeof parentValue === 'string' && _propertyKey === 'length') { + return parentValue.length; + } - this.forEach(function (k) { - if (ret.indexOf(k) < 0) { - ret.push(k); + if (typeof parentValue === 'object' && parentValue) { + if (true) { + _emberMetal.watchKey(parentValue, _propertyKey); } - }); - return ret; - }, + if (true || true) { + this.tag.didCompute(parentValue); + } - /** - This property will trigger anytime the enumerable's content changes. - You can observe this property to be notified of changes to the enumerable's - content. - For plain enumerables, this property is read only. `Array` overrides - this method. - @property [] - @type Array - @return this - @private - */ - '[]': _emberMetal.computed({ - get: function (key) { - return this; + return _emberMetal.get(parentValue, _propertyKey); + } else { + return undefined; } - }), + }; - // .......................................................... - // ENUMERABLE OBSERVERS - // + NestedPropertyReference.prototype[UPDATE] = function (value) { + var parent = this._parentReference.value(); + _emberMetal.set(parent, this._propertyKey, value); + }; - /** - Registers an enumerable observer. Must implement `Ember.EnumerableObserver` - mixin. - @method addEnumerableObserver - @param {Object} target - @param {Object} [opts] - @return this - @private - */ - addEnumerableObserver: function (target, opts) { - var willChange = opts && opts.willChange || 'enumerableWillChange'; - var didChange = opts && opts.didChange || 'enumerableDidChange'; - var hasObservers = _emberMetal.get(this, 'hasEnumerableObservers'); + return NestedPropertyReference; + })(PropertyReference); - if (!hasObservers) { - _emberMetal.propertyWillChange(this, 'hasEnumerableObservers'); - } + exports.NestedPropertyReference = NestedPropertyReference; - _emberMetal.addListener(this, '@enumerable:before', target, willChange); - _emberMetal.addListener(this, '@enumerable:change', target, didChange); + var UpdatableReference = (function (_EmberPathReference2) { + babelHelpers.inherits(UpdatableReference, _EmberPathReference2); - if (!hasObservers) { - _emberMetal.propertyDidChange(this, 'hasEnumerableObservers'); - } + function UpdatableReference(value) { + babelHelpers.classCallCheck(this, UpdatableReference); - return this; - }, + _EmberPathReference2.call(this); - /** - Removes a registered enumerable observer. - @method removeEnumerableObserver - @param {Object} target - @param {Object} [opts] - @return this - @private - */ - removeEnumerableObserver: function (target, opts) { - var willChange = opts && opts.willChange || 'enumerableWillChange'; - var didChange = opts && opts.didChange || 'enumerableDidChange'; - var hasObservers = _emberMetal.get(this, 'hasEnumerableObservers'); + this.tag = new _glimmerReference.DirtyableTag(); + this._value = value; + } - if (hasObservers) { - _emberMetal.propertyWillChange(this, 'hasEnumerableObservers'); - } + UpdatableReference.prototype.value = function value() { + return this._value; + }; - _emberMetal.removeListener(this, '@enumerable:before', target, willChange); - _emberMetal.removeListener(this, '@enumerable:change', target, didChange); + UpdatableReference.prototype.update = function update(value) { + var _value = this._value; - if (hasObservers) { - _emberMetal.propertyDidChange(this, 'hasEnumerableObservers'); + if (value !== _value) { + this.tag.dirty(); + this._value = value; } + }; - return this; - }, + return UpdatableReference; + })(EmberPathReference); - /** - Becomes true whenever the array currently has observers watching changes - on the array. - @property hasEnumerableObservers - @type Boolean - @private - */ - hasEnumerableObservers: _emberMetal.computed(function () { - return _emberMetal.hasListeners(this, '@enumerable:change') || _emberMetal.hasListeners(this, '@enumerable:before'); - }), + exports.UpdatableReference = UpdatableReference; - /** - Invoke this method just before the contents of your enumerable will - change. You can either omit the parameters completely or pass the objects - to be removed or added if available or just a count. - @method enumerableContentWillChange - @param {Ember.Enumerable|Number} removing An enumerable of the objects to - be removed or the number of items to be removed. - @param {Ember.Enumerable|Number} adding An enumerable of the objects to be - added or the number of items to be added. - @chainable - @private - */ - enumerableContentWillChange: function (removing, adding) { - var removeCnt = undefined, - addCnt = undefined, - hasDelta = undefined; + var UpdatablePrimitiveReference = (function (_UpdatableReference) { + babelHelpers.inherits(UpdatablePrimitiveReference, _UpdatableReference); - if ('number' === typeof removing) { - removeCnt = removing; - } else if (removing) { - removeCnt = _emberMetal.get(removing, 'length'); - } else { - removeCnt = removing = -1; + function UpdatablePrimitiveReference() { + babelHelpers.classCallCheck(this, UpdatablePrimitiveReference); + + _UpdatableReference.apply(this, arguments); + } + + UpdatablePrimitiveReference.prototype.get = function get() { + return _glimmerRuntime.UNDEFINED_REFERENCE; + }; + + return UpdatablePrimitiveReference; + })(UpdatableReference); + + exports.UpdatablePrimitiveReference = UpdatablePrimitiveReference; + + var ConditionalReference = (function (_GlimmerConditionalReference) { + babelHelpers.inherits(ConditionalReference, _GlimmerConditionalReference); + + ConditionalReference.create = function create(reference) { + if (_glimmerReference.isConst(reference)) { + var value = reference.value(); + + if (_emberMetal.isProxy(value)) { + return new RootPropertyReference(value, 'isTruthy'); + } else { + return _glimmerRuntime.PrimitiveReference.create(_emberGlimmerUtilsToBool.default(value)); + } } - if ('number' === typeof adding) { - addCnt = adding; - } else if (adding) { - addCnt = _emberMetal.get(adding, 'length'); + return new ConditionalReference(reference); + }; + + function ConditionalReference(reference) { + babelHelpers.classCallCheck(this, ConditionalReference); + + _GlimmerConditionalReference.call(this, reference); + + this.objectTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); + this.tag = _glimmerReference.combine([reference.tag, this.objectTag]); + } + + ConditionalReference.prototype.toBool = function toBool(predicate) { + if (_emberMetal.isProxy(predicate)) { + this.objectTag.update(_emberMetal.tagForProperty(predicate, 'isTruthy')); + return _emberMetal.get(predicate, 'isTruthy'); } else { - addCnt = adding = -1; + this.objectTag.update(_emberMetal.tagFor(predicate)); + return _emberGlimmerUtilsToBool.default(predicate); } + }; - hasDelta = addCnt < 0 || removeCnt < 0 || addCnt - removeCnt !== 0; + return ConditionalReference; + })(_glimmerRuntime.ConditionalReference); - if (removing === -1) { - removing = null; - } + exports.ConditionalReference = ConditionalReference; - if (adding === -1) { - adding = null; - } + var SimpleHelperReference = (function (_CachedReference2) { + babelHelpers.inherits(SimpleHelperReference, _CachedReference2); - _emberMetal.propertyWillChange(this, '[]'); + SimpleHelperReference.create = function create(helper, args) { + if (_glimmerReference.isConst(args)) { + var _ret = (function () { + var positional = args.positional; + var named = args.named; - if (hasDelta) { - _emberMetal.propertyWillChange(this, 'length'); + var positionalValue = positional.value(); + var namedValue = named.value(); + + _emberMetal.runInDebug(function () { + if (_emberUtils.HAS_NATIVE_WEAKMAP) { + Object.freeze(positionalValue); + Object.freeze(namedValue); + } + }); + + var result = helper(positionalValue, namedValue); + + if (result === null) { + return { + v: _glimmerRuntime.NULL_REFERENCE + }; + } else if (result === undefined) { + return { + v: _glimmerRuntime.UNDEFINED_REFERENCE + }; + } else if (typeof result === 'object') { + return { + v: new RootReference(result) + }; + } else { + return { + v: _glimmerRuntime.PrimitiveReference.create(result) + }; + } + })(); + + if (typeof _ret === 'object') return _ret.v; + } else { + return new SimpleHelperReference(helper, args); } + }; - _emberMetal.sendEvent(this, '@enumerable:before', [this, removing, adding]); + function SimpleHelperReference(helper, args) { + babelHelpers.classCallCheck(this, SimpleHelperReference); - return this; - }, + _CachedReference2.call(this); - /** - Invoke this method when the contents of your enumerable has changed. - This will notify any observers watching for content changes. If you are - implementing an ordered enumerable (such as an array), also pass the - start and end values where the content changed so that it can be used to - notify range observers. - @method enumerableContentDidChange - @param {Ember.Enumerable|Number} removing An enumerable of the objects to - be removed or the number of items to be removed. - @param {Ember.Enumerable|Number} adding An enumerable of the objects to - be added or the number of items to be added. - @chainable - @private - */ - enumerableContentDidChange: function (removing, adding) { - var removeCnt = undefined, - addCnt = undefined, - hasDelta = undefined; + this.tag = args.tag; + this.helper = helper; + this.args = args; + } + + SimpleHelperReference.prototype.compute = function compute() { + var helper = this.helper; + var _args = this.args; + var positional = _args.positional; + var named = _args.named; + + var positionalValue = positional.value(); + var namedValue = named.value(); - if ('number' === typeof removing) { - removeCnt = removing; - } else if (removing) { - removeCnt = _emberMetal.get(removing, 'length'); - } else { - removeCnt = removing = -1; - } + _emberMetal.runInDebug(function () { + if (_emberUtils.HAS_NATIVE_WEAKMAP) { + Object.freeze(positionalValue); + Object.freeze(namedValue); + } + }); - if ('number' === typeof adding) { - addCnt = adding; - } else if (adding) { - addCnt = _emberMetal.get(adding, 'length'); - } else { - addCnt = adding = -1; - } + return helper(positionalValue, namedValue); + }; - hasDelta = addCnt < 0 || removeCnt < 0 || addCnt - removeCnt !== 0; + return SimpleHelperReference; + })(CachedReference); - if (removing === -1) { - removing = null; - } + exports.SimpleHelperReference = SimpleHelperReference; - if (adding === -1) { - adding = null; - } + var ClassBasedHelperReference = (function (_CachedReference3) { + babelHelpers.inherits(ClassBasedHelperReference, _CachedReference3); - _emberMetal.sendEvent(this, '@enumerable:change', [this, removing, adding]); + ClassBasedHelperReference.create = function create(helperClass, vm, args) { + var instance = helperClass.create(); + vm.newDestroyable(instance); + return new ClassBasedHelperReference(instance, args); + }; - if (hasDelta) { - _emberMetal.propertyDidChange(this, 'length'); - } + function ClassBasedHelperReference(instance, args) { + babelHelpers.classCallCheck(this, ClassBasedHelperReference); - _emberMetal.propertyDidChange(this, '[]'); + _CachedReference3.call(this); - return this; - }, + this.tag = _glimmerReference.combine([instance[_emberGlimmerHelper.RECOMPUTE_TAG], args.tag]); + this.instance = instance; + this.args = args; + } - /** - Converts the enumerable into an array and sorts by the keys - specified in the argument. - 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 - @public - */ - sortBy: function () { - var sortKeys = arguments; + ClassBasedHelperReference.prototype.compute = function compute() { + var instance = this.instance; + var _args2 = this.args; + var positional = _args2.positional; + var named = _args2.named; - return this.toArray().sort(function (a, b) { - for (var i = 0; i < sortKeys.length; i++) { - var key = sortKeys[i]; - var propA = _emberMetal.get(a, key); - var propB = _emberMetal.get(b, key); - // return 1 or -1 else continue to the next sortKey - var compareValue = _emberRuntimeCompare.default(propA, propB); + var positionalValue = positional.value(); + var namedValue = named.value(); - if (compareValue) { - return compareValue; - } + _emberMetal.runInDebug(function () { + if (_emberUtils.HAS_NATIVE_WEAKMAP) { + Object.freeze(positionalValue); + Object.freeze(namedValue); } - return 0; }); - } - }); - 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 - let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }]; - arr.uniqBy('value'); // [{ value: 'a' }, { value: 'b' }] - ``` - @method uniqBy - @return {Ember.Enumerable} - @public - */ + return instance.compute(positionalValue, namedValue); + }; - uniqBy: function (key) { - var ret = emberA(); - var seen = new _emberUtils.EmptyObject(); + return ClassBasedHelperReference; + })(CachedReference); - this.forEach(function (item) { - var guid = _emberUtils.guidFor(_emberMetal.get(item, key)); - if (!(guid in seen)) { - seen[guid] = true; - ret.push(item); - } - }); + exports.ClassBasedHelperReference = ClassBasedHelperReference; - return ret; - } - }); - } + var InternalHelperReference = (function (_CachedReference4) { + babelHelpers.inherits(InternalHelperReference, _CachedReference4); - if (true) { - 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) { - _emberMetal.assert('Enumerable#includes cannot accept a second argument "startAt" as enumerable items are unordered.', arguments.length === 1); + function InternalHelperReference(helper, args) { + babelHelpers.classCallCheck(this, InternalHelperReference); - var len = _emberMetal.get(this, 'length'); - var idx = undefined, - next = undefined; - var last = null; - var found = false; + _CachedReference4.call(this); - var context = popCtx(); + this.tag = args.tag; + this.helper = helper; + this.args = args; + } - for (idx = 0; idx < len && !found; idx++) { - next = this.nextObject(idx, last, context); + // @implements PathReference - found = obj === next || obj !== obj && next !== next; + InternalHelperReference.prototype.compute = function compute() { + var helper = this.helper; + var args = this.args; - last = next; - } + return helper(args); + }; - next = last = null; - context = pushCtx(context); + return InternalHelperReference; + })(CachedReference); - return found; - }, + exports.InternalHelperReference = InternalHelperReference; - without: function (value) { - if (!this.includes(value)) { - return this; // nothing to do - } + var UnboundReference = (function (_ConstReference2) { + babelHelpers.inherits(UnboundReference, _ConstReference2); - var ret = emberA(); + function UnboundReference() { + babelHelpers.classCallCheck(this, UnboundReference); - this.forEach(function (k) { - // SameValueZero comparison (NaN !== NaN) - if (!(k === value || k !== k && value !== value)) { - ret[ret.length] = k; - } - }); + _ConstReference2.apply(this, arguments); + } - return ret; + UnboundReference.create = function create(value) { + if (value === null) { + return _glimmerRuntime.NULL_REFERENCE; + } else if (value === undefined) { + return _glimmerRuntime.UNDEFINED_REFERENCE; + } else if (typeof value === 'object') { + return new UnboundReference(value); + } else { + return _glimmerRuntime.PrimitiveReference.create(value); } - }); - } + }; - exports.default = Enumerable; -}); -enifed('ember-runtime/mixins/evented', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; + UnboundReference.prototype.get = function get(key) { + return new UnboundReference(_emberMetal.get(this.inner, key)); + }; + + return UnboundReference; + })(_glimmerReference.ConstReference); + exports.UnboundReference = UnboundReference; +}); +enifed('ember-glimmer/utils/string', ['exports', 'ember-metal'], function (exports, _emberMetal) { /** @module ember - @submodule ember-runtime + @submodule ember-glimmer */ - /** - This mixin allows for Ember objects to subscribe to and emit events. - - ```javascript - App.Person = Ember.Object.extend(Ember.Evented, { - greet: function() { - // ... - this.trigger('greet'); - } - }); - - var person = App.Person.create(); - - person.on('greet', function() { - console.log('Our person has greeted'); - }); - - person.greet(); - - // outputs: 'Our person has greeted' - ``` - - You can also chain multiple event subscriptions: - - ```javascript - person.on('greet', function() { - console.log('Our person has greeted'); - }).one('greet', function() { - console.log('Offer one-time special'); - }).off('event', this, forgetThis); - ``` - - @class Evented - @namespace Ember - @public - */ - exports.default = _emberMetal.Mixin.create({ + 'use strict'; - /** - Subscribes to a named event with given function. - ```javascript - person.on('didLoad', function() { - // fired once the person has loaded - }); - ``` - An optional target can be passed in as the 2nd argument that will - be set as the "this" for the callback. This is a good way to give your - function access to the object triggering the event. When the target - parameter is used the callback becomes the third argument. - @method on - @param {String} name The name of the event - @param {Object} [target] The "this" binding for the callback - @param {Function} method The callback to execute - @return this - @public - */ - on: function (name, target, method) { - _emberMetal.addListener(this, name, target, method); - return this; - }, + exports.getSafeString = getSafeString; + exports.escapeExpression = escapeExpression; + exports.htmlSafe = htmlSafe; + exports.isHTMLSafe = isHTMLSafe; - /** - Subscribes a function to a named event and then cancels the subscription - after the first time the event is triggered. It is good to use ``one`` when - you only care about the first time an event has taken place. - This function takes an optional 2nd argument that will become the "this" - value for the callback. If this argument is passed then the 3rd argument - becomes the function. - @method one - @param {String} name The name of the event - @param {Object} [target] The "this" binding for the callback - @param {Function} method The callback to execute - @return this - @public - */ - one: function (name, target, method) { - if (!method) { - method = target; - target = null; - } + var SafeString = (function () { + function SafeString(string) { + babelHelpers.classCallCheck(this, SafeString); - _emberMetal.addListener(this, name, target, method, true); - return this; - }, + this.string = string; + } - /** - Triggers a named event for the object. Any additional arguments - will be passed as parameters to the functions that are subscribed to the - event. - ```javascript - person.on('didEat', function(food) { - console.log('person ate some ' + food); - }); - person.trigger('didEat', 'broccoli'); - // outputs: person ate some broccoli - ``` - @method trigger - @param {String} name The name of the event - @param {Object...} args Optional arguments to pass on - @public - */ - trigger: function (name) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } + SafeString.prototype.toString = function toString() { + return '' + this.string; + }; - _emberMetal.sendEvent(this, name, args); - }, + SafeString.prototype.toHTML = function toHTML() { + return this.toString(); + }; - /** - Cancels subscription for given name, target, and method. - @method off - @param {String} name The name of the event - @param {Object} target The target of the subscription - @param {Function} method The function of the subscription - @return this - @public - */ - off: function (name, target, method) { - _emberMetal.removeListener(this, name, target, method); - return this; - }, + return SafeString; + })(); - /** - Checks to see if object has any subscriptions for named event. - @method has - @param {String} name The name of the event - @return {Boolean} does the object have a subscription for event - @public - */ - has: function (name) { - return _emberMetal.hasListeners(this, name); + exports.SafeString = SafeString; + + function getSafeString() { + _emberMetal.deprecate('Ember.Handlebars.SafeString is deprecated in favor of Ember.String.htmlSafe', false, { + id: 'ember-htmlbars.ember-handlebars-safestring', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x#toc_use-ember-string-htmlsafe-over-ember-handlebars-safestring' + }); + + return SafeString; + } + + var escape = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + // jscs:disable + "'": ''', + // jscs:enable + '`': '`', + '=': '=' + }; + + var possible = /[&<>"'`=]/; + var badChars = /[&<>"'`=]/g; + + function escapeChar(chr) { + return escape[chr]; + } + + function escapeExpression(string) { + if (typeof string !== 'string') { + // don't escape SafeStrings, since they're already safe + if (string && string.toHTML) { + return string.toHTML(); + } else if (string == null) { + return ''; + } else if (!string) { + return string + ''; + } + + // Force a string conversion as this will be done by the append regardless and + // the regex test will do this transparently behind the scenes, causing issues if + // an object's to string has escaped characters in it. + string = '' + string; } - }); -}); -enifed('ember-runtime/mixins/freezable', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-runtime - */ - 'use strict'; + if (!possible.test(string)) { + return string; + } + return string.replace(badChars, escapeChar); + } /** - 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. - - ## Enforcement - - To fully support freezing in your subclass, you must include this mixin and - override any method that might alter any property on the object to instead - raise an exception. You can check the state of an object by checking the - `isFrozen` property. - - Although future versions of JavaScript may support language-level freezing - object objects, that is not the case today. Even if an object is freezable, - it is still technically possible to modify the object, even though it could - break other parts of your application that do not expect a frozen object to - change. It is, therefore, very important that you always respect the - `isFrozen` property on all freezable objects. - - ## Example Usage - - The example below shows a simple object that implement the `Ember.Freezable` - protocol. + 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. ```javascript - Contact = Ember.Object.extend(Ember.Freezable, { - firstName: null, - lastName: null, - - // swaps the names - swapNames: function() { - if (this.get('isFrozen')) throw Ember.FROZEN_ERROR; - var tmp = this.get('firstName'); - this.set('firstName', this.get('lastName')); - this.set('lastName', tmp); - return this; - } - - }); - - c = Contact.create({ firstName: "John", lastName: "Doe" }); - c.swapNames(); // returns c - c.freeze(); - c.swapNames(); // EXCEPTION + Ember.String.htmlSafe('
    someString
    ') ``` - ## Copying - - Usually the `Ember.Freezable` protocol is implemented in cooperation with the - `Ember.Copyable` protocol, which defines a `frozenCopy()` method that will - return a frozen object, if the object implements this method as well. - - @class Freezable - @namespace Ember - @since Ember 0.9 - @deprecated Use `Object.freeze` instead. - @private + @method htmlSafe + @for Ember.String + @static + @return {Handlebars.SafeString} A string that will not be HTML escaped by Handlebars. + @public */ - var Freezable = _emberMetal.Mixin.create({ - - init: function () { - _emberMetal.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 - whether your object is frozen or not. - @property isFrozen - @type Boolean - @private - */ - isFrozen: false, - - /** - Freezes the object. Once this method has been called the object should - no longer allow any properties to be edited. - @method freeze - @return {Object} receiver - @private - */ - freeze: function () { - if (_emberMetal.get(this, 'isFrozen')) { - return this; - } - _emberMetal.set(this, 'isFrozen', true); - return this; + function htmlSafe(str) { + if (str === null || str === undefined) { + str = ''; + } else if (typeof str !== 'string') { + str = '' + str; } + return new SafeString(str); + } - }); - - exports.Freezable = Freezable; - var FROZEN_ERROR = 'Frozen object cannot be modified.'; - exports.FROZEN_ERROR = FROZEN_ERROR; -}); -enifed('ember-runtime/mixins/mutable_array', ['exports', 'ember-metal', 'ember-runtime/mixins/array', 'ember-runtime/mixins/mutable_enumerable', 'ember-runtime/mixins/enumerable'], function (exports, _emberMetal, _emberRuntimeMixinsArray, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeMixinsEnumerable) { /** - @module ember - @submodule ember-runtime + Detects if a string was decorated using `Ember.String.htmlSafe`. + + ```javascript + var plainString = 'plain string', + safeString = Ember.String.htmlSafe('
    someValue
    '); + + Ember.String.isHTMLSafe(plainString); // false + Ember.String.isHTMLSafe(safeString); // true + ``` + + @method isHTMLSafe + @for Ember.String + @static + @return {Boolean} `true` if the string was decorated with `htmlSafe`, `false` otherwise. + @public */ + function isHTMLSafe(str) { + return str && typeof str.toHTML === 'function'; + } +}); +enifed('ember-glimmer/utils/to-bool', ['exports', 'ember-runtime', 'ember-metal'], function (exports, _emberRuntime, _emberMetal) { 'use strict'; - exports.removeAt = removeAt; - var OUT_OF_RANGE_EXCEPTION = 'Index out of range'; - var EMPTY = []; - - // .......................................................... - // HELPERS - // + exports.default = toBool; - function removeAt(array, start, len) { - if ('number' === typeof start) { - if (start < 0 || start >= _emberMetal.get(array, 'length')) { - throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); - } + function toBool(predicate) { + if (!predicate) { + return false; + } - // fast case - if (len === undefined) { - len = 1; - } + if (predicate === true) { + return true; + } - array.replace(start, len, EMPTY); + if (_emberRuntime.isArray(predicate)) { + return _emberMetal.get(predicate, 'length') !== 0; } - return array; + return true; } - +}); +enifed('ember-glimmer/views/outlet', ['exports', 'ember-utils', '@glimmer/reference', 'ember-environment', 'ember-metal'], function (exports, _emberUtils, _glimmerReference, _emberEnvironment, _emberMetal) { /** - 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. - - It is important to use the methods in this class to modify arrays so that - changes are observable. This allows the binding system in Ember to function - correctly. - - - Note that an Array can change even if it does not implement this mixin. - For example, one might implement a SparseArray that cannot be directly - modified, but if its underlying enumerable changes, it will change also. - - @class MutableArray - @namespace Ember - @uses Ember.Array - @uses Ember.MutableEnumerable - @public + @module ember + @submodule ember-glimmer */ - exports.default = _emberMetal.Mixin.create(_emberRuntimeMixinsArray.default, _emberRuntimeMixinsMutable_enumerable.default, { + 'use strict'; - /** - __Required.__ You must implement this method to apply this mixin. - This is one of the primitives you must implement to support `Ember.Array`. - You should replace amt objects started at idx with the objects in the - passed array. You should also call `this.enumerableContentDidChange()` - @method replace - @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* - @public - */ - replace: null, + var OutletStateReference = (function () { + function OutletStateReference(outletView) { + babelHelpers.classCallCheck(this, OutletStateReference); - /** - Remove all elements from the array. This is useful if you - want to reuse an existing array without having to recreate it. - ```javascript - let colors = ['red', 'green', 'blue']; - color.length(); // 3 - colors.clear(); // [] - colors.length(); // 0 - ``` - @method clear - @return {Ember.Array} An empty Array. - @public - */ - clear: function () { - var len = _emberMetal.get(this, 'length'); - if (len === 0) { - return this; - } + this.outletView = outletView; + this.tag = outletView._tag; + } - this.replace(0, len, EMPTY); - return this; - }, + // So this is a relic of the past that SHOULD go away + // in 3.0. Preferably it is deprecated in the release that + // follows the Glimmer release. - /** - This will use the primitive `replace()` method to insert an object at the - specified index. - ```javascript - let colors = ['red', 'green', 'blue']; - colors.insertAt(2, 'yellow'); // ['red', 'green', 'yellow', 'blue'] - colors.insertAt(5, 'orange'); // Error: Index out of range - ``` - @method insertAt - @param {Number} idx index of insert the object at. - @param {Object} object object to insert - @return {Ember.Array} receiver - @public - */ - insertAt: function (idx, object) { - if (idx > _emberMetal.get(this, 'length')) { - throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); - } + OutletStateReference.prototype.get = function get(key) { + return new ChildOutletStateReference(this, key); + }; - this.replace(idx, 0, [object]); - return this; - }, + OutletStateReference.prototype.value = function value() { + return this.outletView.outletState; + }; - /** - Remove an object at the specified index using the `replace()` primitive - method. You can pass either a single index, or a start and a length. - If you pass a start and length that is beyond the - length this method will throw an `OUT_OF_RANGE_EXCEPTION`. - ```javascript - let colors = ['red', 'green', 'blue', 'yellow', 'orange']; - colors.removeAt(0); // ['green', 'blue', 'yellow', 'orange'] - colors.removeAt(2, 2); // ['green', 'blue'] - colors.removeAt(4, 2); // Error: Index out of range - ``` - @method removeAt - @param {Number} start index, start of range - @param {Number} len length of passing range - @return {Ember.Array} receiver - @public - */ - removeAt: function (start, len) { - return removeAt(this, start, len); - }, + OutletStateReference.prototype.getOrphan = function getOrphan(name) { + return new OrphanedOutletStateReference(this, name); + }; - /** - Push the object onto the end of the array. Works just like `push()` but it - is KVO-compliant. - ```javascript - let colors = ['red', 'green']; - colors.pushObject('black'); // ['red', 'green', 'black'] - colors.pushObject(['yellow']); // ['red', 'green', ['yellow']] - ``` - @method pushObject - @param {*} obj object to push - @return object same object passed as a param - @public - */ - pushObject: function (obj) { - this.insertAt(_emberMetal.get(this, 'length'), obj); - return obj; - }, + OutletStateReference.prototype.update = function update(state) { + this.outletView.setOutletState(state); + }; - /** - Add the objects in the passed numerable to the end of the array. Defers - notifying observers of the change until all objects are added. - ```javascript - let colors = ['red']; - colors.pushObjects(['yellow', 'orange']); // ['red', 'yellow', 'orange'] - ``` - @method pushObjects - @param {Ember.Enumerable} objects the objects to add - @return {Ember.Array} receiver - @public - */ - pushObjects: function (objects) { - if (!(_emberRuntimeMixinsEnumerable.default.detect(objects) || Array.isArray(objects))) { - throw new TypeError('Must pass Ember.Enumerable to Ember.MutableArray#pushObjects'); - } - this.replace(_emberMetal.get(this, 'length'), 0, objects); - return this; - }, + return OutletStateReference; + })(); - /** - Pop object from array or nil if none are left. Works just like `pop()` but - it is KVO-compliant. - ```javascript - let colors = ['red', 'green', 'blue']; - colors.popObject(); // 'blue' - console.log(colors); // ['red', 'green'] - ``` - @method popObject - @return object - @public - */ - popObject: function () { - var len = _emberMetal.get(this, 'length'); - if (len === 0) { + var OrphanedOutletStateReference = (function (_OutletStateReference) { + babelHelpers.inherits(OrphanedOutletStateReference, _OutletStateReference); + + function OrphanedOutletStateReference(root, name) { + babelHelpers.classCallCheck(this, OrphanedOutletStateReference); + + _OutletStateReference.call(this, root.outletView); + this.root = root; + this.name = name; + } + + OrphanedOutletStateReference.prototype.value = function value() { + var rootState = this.root.value(); + + var orphans = rootState.outlets.main.outlets.__ember_orphans__; + + if (!orphans) { return null; } - var ret = _emberRuntimeMixinsArray.objectAt(this, len - 1); - this.removeAt(len - 1, 1); - return ret; - }, + var matched = orphans.outlets[this.name]; - /** - Shift an object from start of array or nil if none are left. Works just - like `shift()` but it is KVO-compliant. - ```javascript - let colors = ['red', 'green', 'blue']; - colors.shiftObject(); // 'red' - console.log(colors); // ['green', 'blue'] - ``` - @method shiftObject - @return object - @public - */ - shiftObject: function () { - if (_emberMetal.get(this, 'length') === 0) { + if (!matched) { return null; } - var ret = _emberRuntimeMixinsArray.objectAt(this, 0); - this.removeAt(0); - return ret; - }, + var state = new _emberUtils.EmptyObject(); + state[matched.render.outlet] = matched; + matched.wasUsed = true; + return { outlets: state }; + }; - /** - Unshift an object to start of array. Works just like `unshift()` but it is - KVO-compliant. - ```javascript - let colors = ['red']; - colors.unshiftObject('yellow'); // ['yellow', 'red'] - colors.unshiftObject(['black']); // [['black'], 'yellow', 'red'] - ``` - @method unshiftObject - @param {*} obj object to unshift - @return object same object passed as a param - @public - */ - unshiftObject: function (obj) { - this.insertAt(0, obj); - return obj; - }, + return OrphanedOutletStateReference; + })(OutletStateReference); - /** - Adds the named objects to the beginning of the array. Defers notifying - observers until all objects have been added. - ```javascript - let colors = ['red']; - colors.unshiftObjects(['black', 'white']); // ['black', 'white', 'red'] - colors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function - ``` - @method unshiftObjects - @param {Ember.Enumerable} objects the objects to add - @return {Ember.Array} receiver - @public - */ - unshiftObjects: function (objects) { - this.replace(0, 0, objects); - return this; - }, + var ChildOutletStateReference = (function () { + function ChildOutletStateReference(parent, key) { + babelHelpers.classCallCheck(this, ChildOutletStateReference); - /** - Reverse objects in the array. Works just like `reverse()` but it is - KVO-compliant. - @method reverseObjects - @return {Ember.Array} receiver - @public - */ - reverseObjects: function () { - var len = _emberMetal.get(this, 'length'); - if (len === 0) { - return this; - } + this.parent = parent; + this.key = key; + this.tag = parent.tag; + } - var objects = this.toArray().reverse(); - this.replace(0, len, objects); - return this; - }, + ChildOutletStateReference.prototype.get = function get(key) { + return new ChildOutletStateReference(this, key); + }; - /** - Replace all the receiver's content with content of the argument. - If argument is an empty array receiver will be cleared. - ```javascript - let colors = ['red', 'green', 'blue']; - colors.setObjects(['black', 'white']); // ['black', 'white'] - colors.setObjects([]); // [] - ``` - @method setObjects - @param {Ember.Array} objects array whose content will be used for replacing - the content of the receiver - @return {Ember.Array} receiver with the new content - @public - */ - setObjects: function (objects) { - if (objects.length === 0) { - return this.clear(); - } + ChildOutletStateReference.prototype.value = function value() { + return this.parent.value()[this.key]; + }; - var len = _emberMetal.get(this, 'length'); - this.replace(0, len, objects); - return this; - }, + return ChildOutletStateReference; + })(); - // .......................................................... - // IMPLEMENT Ember.MutableEnumerable - // + var OutletView = (function () { + OutletView.extend = function extend(injections) { + return (function (_OutletView) { + babelHelpers.inherits(_class, _OutletView); - /** - Remove all occurrences of an object in the array. - ```javascript - let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago']; - cities.removeObject('Chicago'); // ['Berlin', 'Lima'] - cities.removeObject('Lima'); // ['Berlin'] - cities.removeObject('Tokyo') // ['Berlin'] - ``` - @method removeObject - @param {*} obj object to remove - @return {Ember.Array} receiver - @public - */ - removeObject: function (obj) { - var loc = _emberMetal.get(this, 'length') || 0; - while (--loc >= 0) { - var curObject = _emberRuntimeMixinsArray.objectAt(this, loc); + function _class() { + babelHelpers.classCallCheck(this, _class); - if (curObject === obj) { - this.removeAt(loc); + _OutletView.apply(this, arguments); } - } - return this; - }, - /** - Push the object onto the end of the array if it is not already - present in the array. - ```javascript - let cities = ['Chicago', 'Berlin']; - cities.addObject('Lima'); // ['Chicago', 'Berlin', 'Lima'] - cities.addObject('Berlin'); // ['Chicago', 'Berlin', 'Lima'] - ``` - @method addObject - @param {*} obj object to add, if not already present - @return {Ember.Array} receiver - @public - */ - addObject: function (obj) { - var included = undefined; + _class.create = function create(options) { + if (options) { + return _OutletView.create.call(this, _emberUtils.assign({}, injections, options)); + } else { + return _OutletView.create.call(this, injections); + } + }; - if (true) { - included = this.includes(obj); + return _class; + })(OutletView); + }; + + OutletView.reopenClass = function reopenClass(injections) { + _emberUtils.assign(this, injections); + }; + + OutletView.create = function create(options) { + var _environment = options._environment; + var renderer = options.renderer; + var template = options.template; + + var owner = options[_emberUtils.OWNER]; + return new OutletView(_environment, renderer, owner, template); + }; + + function OutletView(_environment, renderer, owner, template) { + babelHelpers.classCallCheck(this, OutletView); + + this._environment = _environment; + this.renderer = renderer; + this.owner = owner; + this.template = template; + this.outletState = null; + this._tag = new _glimmerReference.DirtyableTag(); + } + + OutletView.prototype.appendTo = function appendTo(selector) { + var env = this._environment || _emberEnvironment.environment; + var target = undefined; + + if (env.hasDOM) { + target = typeof selector === 'string' ? document.querySelector(selector) : selector; } else { - included = this.contains(obj); + target = selector; } - if (!included) { - this.pushObject(obj); - } + _emberMetal.run.schedule('render', this.renderer, 'appendOutletView', this, target); + }; - return this; - } - }); + OutletView.prototype.rerender = function rerender() {}; + + OutletView.prototype.setOutletState = function setOutletState(state) { + this.outletState = { + outlets: { + main: state + }, + render: { + owner: undefined, + into: undefined, + outlet: 'main', + name: '-top-level', + controller: undefined, + ViewClass: undefined, + template: undefined + } + }; + this._tag.dirty(); + }; + + OutletView.prototype.toReference = function toReference() { + return new OutletStateReference(this); + }; + + OutletView.prototype.destroy = function destroy() {}; + + return OutletView; + })(); + + exports.default = OutletView; }); -enifed('ember-runtime/mixins/mutable_enumerable', ['exports', 'ember-runtime/mixins/enumerable', 'ember-metal'], function (exports, _emberRuntimeMixinsEnumerable, _emberMetal) { +enifed('ember-metal/alias', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/error', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/meta', 'ember-metal/dependent_keys'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalError, _emberMetalProperties, _emberMetalComputed, _emberMetalMeta, _emberMetalDependent_keys) { 'use strict'; - /** - @module ember - @submodule ember-runtime - */ + exports.default = alias; - /** - This mixin defines the API for modifying generic enumerables. These methods - can be applied to an object regardless of whether it is ordered or - unordered. - - Note that an Enumerable can change even if it does not implement this mixin. - For example, a MappedEnumerable cannot be directly modified but if its - underlying enumerable changes, it will change also. - - ## Adding Objects - - To add an object to an enumerable, use the `addObject()` method. This - method will only add the object to the enumerable if the object is not - already present and is of a type supported by the enumerable. - - ```javascript - set.addObject(contact); - ``` - - ## Removing Objects - - To remove an object from an enumerable, use the `removeObject()` method. This - will only remove the object if it is present in the enumerable, otherwise - this method has no effect. - - ```javascript - set.removeObject(contact); - ``` - - ## Implementing In Your Own Code - - If you are implementing an object and want to support this API, just include - this mixin in your class and implement the required methods. In your unit - tests, be sure to apply the Ember.MutableEnumerableTests to your object. - - @class MutableEnumerable - @namespace Ember - @uses Ember.Enumerable - @public - */ - exports.default = _emberMetal.Mixin.create(_emberRuntimeMixinsEnumerable.default, { + var CONSUMED = {}; - /** - __Required.__ You must implement this method to apply this mixin. - Attempts to add the passed object to the receiver if the object is not - already present in the collection. If the object is present, this method - has no effect. - If the passed object is of a type not supported by the receiver, - then this method should raise an exception. - @method addObject - @param {Object} object The object to add to the enumerable. - @return {Object} the passed object - @public - */ - addObject: null, + function alias(altKey) { + return new AliasedProperty(altKey); + } + + var AliasedProperty = (function (_Descriptor) { + babelHelpers.inherits(AliasedProperty, _Descriptor); + + function AliasedProperty(altKey) { + babelHelpers.classCallCheck(this, AliasedProperty); + + _Descriptor.call(this); + this.isDescriptor = true; + this.altKey = altKey; + this._dependentKeys = [altKey]; + } + + AliasedProperty.prototype.setup = function setup(obj, keyName) { + _emberMetalDebug.assert('Setting alias \'' + keyName + '\' on self', this.altKey !== keyName); + var meta = _emberMetalMeta.meta(obj); + if (meta.peekWatching(keyName)) { + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); + } + }; - /** - Adds each object in the passed enumerable to the receiver. - @method addObjects - @param {Ember.Enumerable} objects the objects to add. - @return {Object} receiver - @public - */ - addObjects: function (objects) { - var _this = this; + AliasedProperty.prototype.teardown = function teardown(obj, keyName) { + var meta = _emberMetalMeta.meta(obj); + if (meta.peekWatching(keyName)) { + _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); + } + }; - _emberMetal.beginPropertyChanges(this); - objects.forEach(function (obj) { - return _this.addObject(obj); - }); - _emberMetal.endPropertyChanges(this); - return this; - }, + AliasedProperty.prototype.willWatch = function willWatch(obj, keyName) { + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); + }; - /** - __Required.__ You must implement this method to apply this mixin. - Attempts to remove the passed object from the receiver collection if the - object is present in the collection. If the object is not present, - this method has no effect. - If the passed object is of a type not supported by the receiver, - then this method should raise an exception. - @method removeObject - @param {Object} object The object to remove from the enumerable. - @return {Object} the passed object - @public - */ - removeObject: null, + AliasedProperty.prototype.didUnwatch = function didUnwatch(obj, keyName) { + _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); + }; - /** - Removes each object in the passed enumerable from the receiver. - @method removeObjects - @param {Ember.Enumerable} objects the objects to remove - @return {Object} receiver - @public - */ - removeObjects: function (objects) { - _emberMetal.beginPropertyChanges(this); - for (var i = objects.length - 1; i >= 0; i--) { - this.removeObject(objects[i]); + AliasedProperty.prototype.get = function get(obj, keyName) { + var ret = _emberMetalProperty_get.get(obj, this.altKey); + var meta = _emberMetalMeta.meta(obj); + var cache = meta.writableCache(); + if (cache[keyName] !== CONSUMED) { + cache[keyName] = CONSUMED; + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); } - _emberMetal.endPropertyChanges(this); + return ret; + }; + + AliasedProperty.prototype.set = function set(obj, keyName, value) { + return _emberMetalProperty_set.set(obj, this.altKey, value); + }; + + AliasedProperty.prototype.readOnly = function readOnly() { + this.set = AliasedProperty_readOnlySet; return this; - } - }); + }; + + AliasedProperty.prototype.oneWay = function oneWay() { + this.set = AliasedProperty_oneWaySet; + return this; + }; + + return AliasedProperty; + })(_emberMetalProperties.Descriptor); + + exports.AliasedProperty = AliasedProperty; + + function AliasedProperty_readOnlySet(obj, keyName, value) { + throw new _emberMetalError.default('Cannot set read-only property \'' + keyName + '\' on object: ' + _emberUtils.inspect(obj)); + } + + function AliasedProperty_oneWaySet(obj, keyName, value) { + _emberMetalProperties.defineProperty(obj, keyName, null); + return _emberMetalProperty_set.set(obj, keyName, value); + } + + // Backwards compatibility with Ember Data. + AliasedProperty.prototype._meta = undefined; + AliasedProperty.prototype.meta = _emberMetalComputed.ComputedProperty.prototype.meta; }); -enifed('ember-runtime/mixins/observable', ['exports', 'ember-metal'], function (exports, _emberMetal) { +enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember-environment', 'ember-metal/run_loop', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/events', 'ember-metal/observer', 'ember-metal/path_cache'], function (exports, _emberUtils, _emberConsole, _emberEnvironment, _emberMetalRun_loop, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalEvents, _emberMetalObserver, _emberMetalPath_cache) { + 'use strict'; + + exports.bind = bind; + /** @module ember - @submodule ember-runtime + @submodule ember-metal */ - 'use strict'; + // .......................................................... + // BINDING + // - /** - ## Overview - - This mixin provides properties and property observing functionality, core - features of the Ember object model. - - Properties and observers allow one object to observe changes to a - property on another object. This is one of the fundamental ways that - models, controllers and views communicate with each other in an Ember - application. - - Any object that has this mixin applied can be used in observer - operations. That includes `Ember.Object` and most objects you will - interact with as you write your Ember application. - - Note that you will not generally apply this mixin to classes yourself, - but you will use the features provided by this module frequently, so it - is important to understand how to use it. - - ## Using `get()` and `set()` - - Because of Ember's support for bindings and observers, you will always - access properties using the get method, and set properties using the - set method. This allows the observing objects to be notified and - computed properties to be handled properly. - - More documentation about `get` and `set` are below. - - ## Observing Property Changes - - You typically observe property changes simply by using the `Ember.observer` - function in classes that you write. - - For example: - - ```javascript - Ember.Object.extend({ - valueObserver: Ember.observer('value', function(sender, key, value, rev) { - // Executes whenever the "value" property changes - // See the addObserver method for more information about the callback arguments - }) - }); - ``` - - Although this is the most common way to add an observer, this capability - is actually built into the `Ember.Object` class on top of two methods - defined in this mixin: `addObserver` and `removeObserver`. You can use - these two methods to add and remove observers yourself if you need to - do so at runtime. - - To add an observer for a property, call: - - ```javascript - object.addObserver('propertyKey', targetObject, targetAction) - ``` - - This will call the `targetAction` method on the `targetObject` whenever - the value of the `propertyKey` changes. - - Note that if `propertyKey` is a computed property, the observer will be - called when any of the property dependencies are changed, even if the - resulting value of the computed property is unchanged. This is necessary - because computed properties are not computed until `get` is called. - - @class Observable - @namespace Ember - @public - */ - exports.default = _emberMetal.Mixin.create({ + var Binding = (function () { + function Binding(toPath, fromPath) { + babelHelpers.classCallCheck(this, Binding); + + // Configuration + this._from = fromPath; + this._to = toPath; + this._oneWay = undefined; + + // State + this._direction = undefined; + this._readyToSync = undefined; + this._fromObj = undefined; + this._fromPath = undefined; + this._toObj = undefined; + } /** - Retrieves the value of a property from the object. - This method is usually similar to using `object[keyName]` or `object.keyName`, - however it supports both computed properties and the unknownProperty - handler. - Because `get` unifies the syntax for accessing all these kinds - of properties, it can make many refactorings easier, such as replacing a - simple property with a computed property, or vice versa. - ### Computed Properties - Computed properties are methods defined with the `property` modifier - declared at the end, such as: - ```javascript - fullName: Ember.computed('firstName', 'lastName', function() { - return this.get('firstName') + ' ' + this.get('lastName'); - }) - ``` - When you call `get` on a computed property, the function will be - called and the return value will be returned instead of the function - itself. - ### Unknown Properties - Likewise, if you try to call `get` on a property whose value is - `undefined`, the `unknownProperty()` method will be called on the object. - If this method returns any value other than `undefined`, it will be returned - instead. This allows you to implement "virtual" properties that are - not defined upfront. - @method get - @param {String} keyName The property to retrieve - @return {Object} The property value or undefined. + @class Binding + @namespace Ember + @deprecated See http://emberjs.com/deprecations/v2.x#toc_ember-binding @public */ - get: function (keyName) { - return _emberMetal.get(this, keyName); - }, /** - To get the values of multiple properties at once, call `getProperties` - with a list of strings or an array: - ```javascript - record.getProperties('firstName', 'lastName', 'zipCode'); - // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } - ``` - is equivalent to: - ```javascript - record.getProperties(['firstName', 'lastName', 'zipCode']); - // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } - ``` - @method getProperties - @param {String...|Array} list of keys to get - @return {Object} + This copies the Binding so it can be connected to another object. + @method copy + @return {Ember.Binding} `this` @public */ - getProperties: function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - return _emberMetal.getProperties.apply(null, [this].concat(args)); - }, + Binding.prototype.copy = function copy() { + var copy = new Binding(this._to, this._from); + if (this._oneWay) { + copy._oneWay = true; + } + return copy; + }; - /** - Sets the provided key or path to the value. - ```javascript - record.set("key", value); - ``` - This method is generally very similar to calling `object["key"] = value` or - `object.key = value`, except that it provides support for computed - properties, the `setUnknownProperty()` method and property observers. - ### Computed Properties - If you try to set a value on a key that has a computed property handler - defined (see the `get()` method for an example), then `set()` will call - that method, passing both the value and key instead of simply changing - the value itself. This is useful for those times when you need to - implement a property that is composed of one or more member - properties. - ### Unknown Properties - If you try to set a value on a key that is undefined in the target - object, then the `setUnknownProperty()` handler will be called instead. This - gives you an opportunity to implement complex "virtual" properties that - are not predefined on the object. If `setUnknownProperty()` returns - undefined, then `set()` will simply set the value on the object. - ### Property Observers - In addition to changing the property, `set()` will also register a property - change with the object. Unless you have placed this call inside of a - `beginPropertyChanges()` and `endPropertyChanges(),` any "local" observers - (i.e. observer methods declared on the same object), will be called - immediately. Any "remote" observers (i.e. observer methods declared on - another object) will be placed in a queue and called at a later time in a - coalesced manner. - @method set - @param {String} keyName The property to set - @param {Object} value The value to set or `null`. - @return {Object} The passed value - @public - */ - set: function (keyName, value) { - return _emberMetal.set(this, keyName, value); - }, + // .......................................................... + // CONFIG + // /** - Sets a list of properties at once. These properties are set inside - a single `beginPropertyChanges` and `endPropertyChanges` batch, so - observers will be buffered. - ```javascript - record.setProperties({ firstName: 'Charles', lastName: 'Jolley' }); - ``` - @method setProperties - @param {Object} hash the hash of keys and values to set - @return {Object} The passed in hash + This will set `from` property path to the specified value. It will not + attempt to resolve this property path to an actual object until you + connect the binding. + The binding will search for the property path starting at the root object + you pass when you `connect()` the binding. It follows the same rules as + `get()` - see that method for more information. + @method from + @param {String} path The property path to connect to. + @return {Ember.Binding} `this` @public */ - setProperties: function (hash) { - return _emberMetal.setProperties(this, hash); - }, - - /** - Begins a grouping of property changes. - You can use this method to group property changes so that notifications - will not be sent until the changes are finished. If you plan to make a - large number of changes to an object at one time, you should call this - method at the beginning of the changes to begin deferring change - notifications. When you are done making changes, call - `endPropertyChanges()` to deliver the deferred change notifications and end - deferring. - @method beginPropertyChanges - @return {Ember.Observable} - @private - */ - beginPropertyChanges: function () { - _emberMetal.beginPropertyChanges(); - return this; - }, - /** - Ends a grouping of property changes. - You can use this method to group property changes so that notifications - will not be sent until the changes are finished. If you plan to make a - large number of changes to an object at one time, you should call - `beginPropertyChanges()` at the beginning of the changes to defer change - notifications. When you are done making changes, call this method to - deliver the deferred change notifications and end deferring. - @method endPropertyChanges - @return {Ember.Observable} - @private - */ - endPropertyChanges: function () { - _emberMetal.endPropertyChanges(); + Binding.prototype.from = function from(path) { + this._from = path; return this; - }, + }; /** - Notify the observer system that a property is about to change. - Sometimes you need to change a value directly or indirectly without - actually calling `get()` or `set()` on it. In this case, you can use this - method and `propertyDidChange()` instead. Calling these two methods - together will notify all observers that the property has potentially - changed value. - Note that you must always call `propertyWillChange` and `propertyDidChange` - as a pair. If you do not, it may get the property change groups out of - order and cause notifications to be delivered more often than you would - like. - @method propertyWillChange - @param {String} keyName The property key that is about to change. - @return {Ember.Observable} - @private + This will set the `to` property path to the specified value. It will not + attempt to resolve this property path to an actual object until you + connect the binding. + The binding will search for the property path starting at the root object + you pass when you `connect()` the binding. It follows the same rules as + `get()` - see that method for more information. + @method to + @param {String|Tuple} path A property path or tuple. + @return {Ember.Binding} `this` + @public */ - propertyWillChange: function (keyName) { - _emberMetal.propertyWillChange(this, keyName); - return this; - }, - /** - Notify the observer system that a property has just changed. - Sometimes you need to change a value directly or indirectly without - actually calling `get()` or `set()` on it. In this case, you can use this - method and `propertyWillChange()` instead. Calling these two methods - together will notify all observers that the property has potentially - changed value. - Note that you must always call `propertyWillChange` and `propertyDidChange` - as a pair. If you do not, it may get the property change groups out of - order and cause notifications to be delivered more often than you would - like. - @method propertyDidChange - @param {String} keyName The property key that has just changed. - @return {Ember.Observable} - @private - */ - propertyDidChange: function (keyName) { - _emberMetal.propertyDidChange(this, keyName); + Binding.prototype.to = function to(path) { + this._to = path; return this; - }, + }; /** - Convenience method to call `propertyWillChange` and `propertyDidChange` in - succession. - @method notifyPropertyChange - @param {String} keyName The property key to be notified about. - @return {Ember.Observable} + Configures the binding as one way. A one-way binding will relay changes + on the `from` side to the `to` side, but not the other way around. This + means that if you change the `to` side directly, the `from` side may have + a different value. + @method oneWay + @return {Ember.Binding} `this` @public */ - notifyPropertyChange: function (keyName) { - this.propertyWillChange(keyName); - this.propertyDidChange(keyName); + + Binding.prototype.oneWay = function oneWay() { + this._oneWay = true; return this; - }, + }; /** - Adds an observer on a property. - This is the core method used to register an observer for a property. - Once you call this method, any time the key's value is set, your observer - will be notified. Note that the observers are triggered any time the - value is set, regardless of whether it has actually changed. Your - observer should be prepared to handle that. - You can also pass an optional context parameter to this method. The - context will be passed to your observer method whenever it is triggered. - Note that if you add the same target/method pair on a key multiple times - with different context parameters, your observer will only be called once - with the last context you passed. - ### Observer Methods - Observer methods you pass should generally have the following signature if - you do not pass a `context` parameter: - ```javascript - fooDidChange: function(sender, key, value, rev) { }; - ``` - The sender is the object that changed. The key is the property that - changes. The value property is currently reserved and unused. The rev - is the last property revision of the object when it changed, which you can - use to detect if the key value has really changed or not. - If you pass a `context` parameter, the context will be passed before the - revision like so: - ```javascript - fooDidChange: function(sender, key, value, context, rev) { }; - ``` - Usually you will not need the value, context or revision parameters at - the end. In this case, it is common to write observer methods that take - only a sender and key value as parameters or, if you aren't interested in - any of these values, to write an observer that has no parameters at all. - @method addObserver - @param {String} key The key to observer - @param {Object} target The target object to invoke - @param {String|Function} method The method to invoke. + @method toString + @return {String} string representation of binding @public */ - addObserver: function (key, target, method) { - _emberMetal.addObserver(this, key, target, method); - }, - /** - Remove an observer you have previously registered on this object. Pass - the same key, target, and method you passed to `addObserver()` and your - target will no longer receive notifications. - @method removeObserver - @param {String} key The key to observer - @param {Object} target The target object to invoke - @param {String|Function} method The method to invoke. - @public - */ - removeObserver: function (key, target, method) { - _emberMetal.removeObserver(this, key, target, method); - }, + Binding.prototype.toString = function toString() { + var oneWay = this._oneWay ? '[oneWay]' : ''; + return 'Ember.Binding<' + _emberUtils.guidFor(this) + '>(' + this._from + ' -> ' + this._to + ')' + oneWay; + }; - /** - Returns `true` if the object currently has observers registered for a - particular key. You can use this method to potentially defer performing - an expensive action until someone begins observing a particular property - on the object. - @method hasObserverFor - @param {String} key Key to check - @return {Boolean} - @private - */ - hasObserverFor: function (key) { - return _emberMetal.hasListeners(this, key + ':change'); - }, + // .......................................................... + // CONNECT AND SYNC + // /** - Retrieves the value of a property, or a default value in the case that the - property returns `undefined`. - ```javascript - person.getWithDefault('lastName', 'Doe'); - ``` - @method getWithDefault - @param {String} keyName The name of the property to retrieve - @param {Object} defaultValue The value to return if the property value is undefined - @return {Object} The property value or the defaultValue. + Attempts to connect this binding instance so that it can receive and relay + changes. This method will raise an exception if you have not set the + from/to properties yet. + @method connect + @param {Object} obj The root object for this binding. + @return {Ember.Binding} `this` @public */ - getWithDefault: function (keyName, defaultValue) { - return _emberMetal.getWithDefault(this, keyName, defaultValue); - }, - /** - Set the value of a property to the current value plus some amount. - ```javascript - person.incrementProperty('age'); - team.incrementProperty('score', 2); - ``` - @method incrementProperty - @param {String} keyName The name of the property to increment - @param {Number} increment The amount to increment by. Defaults to 1 - @return {Number} The new property value - @public - */ - incrementProperty: function (keyName, increment) { - if (_emberMetal.isNone(increment)) { - increment = 1; + Binding.prototype.connect = function connect(obj) { + _emberMetalDebug.assert('Must pass a valid object to Ember.Binding.connect()', !!obj); + + var fromObj = undefined, + fromPath = undefined, + possibleGlobal = undefined; + + // If the binding's "from" path could be interpreted as a global, verify + // whether the path refers to a global or not by consulting `Ember.lookup`. + if (_emberMetalPath_cache.isGlobalPath(this._from)) { + var _name = _emberMetalPath_cache.getFirstKey(this._from); + possibleGlobal = _emberEnvironment.context.lookup[_name]; + + if (possibleGlobal) { + fromObj = possibleGlobal; + fromPath = _emberMetalPath_cache.getTailPath(this._from); + } } - _emberMetal.assert('Must pass a numeric value to incrementProperty', !isNaN(parseFloat(increment)) && isFinite(increment)); - return _emberMetal.set(this, keyName, (parseFloat(_emberMetal.get(this, keyName)) || 0) + increment); - }, + + if (fromObj === undefined) { + fromObj = obj; + fromPath = this._from; + } + + _emberMetalProperty_set.trySet(obj, this._to, _emberMetalProperty_get.get(fromObj, fromPath)); + + // Add an observer on the object to be notified when the binding should be updated. + _emberMetalObserver.addObserver(fromObj, fromPath, this, 'fromDidChange'); + + // If the binding is a two-way binding, also set up an observer on the target. + if (!this._oneWay) { + _emberMetalObserver.addObserver(obj, this._to, this, 'toDidChange'); + } + + _emberMetalEvents.addListener(obj, 'willDestroy', this, 'disconnect'); + + fireDeprecations(obj, this._to, this._from, possibleGlobal, this._oneWay, !possibleGlobal && !this._oneWay); + + this._readyToSync = true; + this._fromObj = fromObj; + this._fromPath = fromPath; + this._toObj = obj; + + return this; + }; /** - Set the value of a property to the current value minus some amount. - ```javascript - player.decrementProperty('lives'); - orc.decrementProperty('health', 5); - ``` - @method decrementProperty - @param {String} keyName The name of the property to decrement - @param {Number} decrement The amount to decrement by. Defaults to 1 - @return {Number} The new property value + Disconnects the binding instance. Changes will no longer be relayed. You + will not usually need to call this method. + @method disconnect + @return {Ember.Binding} `this` @public */ - decrementProperty: function (keyName, decrement) { - if (_emberMetal.isNone(decrement)) { - decrement = 1; + + Binding.prototype.disconnect = function disconnect() { + _emberMetalDebug.assert('Must pass a valid object to Ember.Binding.disconnect()', !!this._toObj); + + // Remove an observer on the object so we're no longer notified of + // changes that should update bindings. + _emberMetalObserver.removeObserver(this._fromObj, this._fromPath, this, 'fromDidChange'); + + // If the binding is two-way, remove the observer from the target as well. + if (!this._oneWay) { + _emberMetalObserver.removeObserver(this._toObj, this._to, this, 'toDidChange'); } - _emberMetal.assert('Must pass a numeric value to decrementProperty', !isNaN(parseFloat(decrement)) && isFinite(decrement)); - return _emberMetal.set(this, keyName, (_emberMetal.get(this, keyName) || 0) - decrement); - }, - /** - Set the value of a boolean property to the opposite of its - current value. - ```javascript - starship.toggleProperty('warpDriveEngaged'); - ``` - @method toggleProperty - @param {String} keyName The name of the property to toggle - @return {Boolean} The new property value - @public - */ - toggleProperty: function (keyName) { - return _emberMetal.set(this, keyName, !_emberMetal.get(this, keyName)); - }, + this._readyToSync = false; // Disable scheduled syncs... + return this; + }; - /** - Returns the cached value of a computed property, if it exists. - This allows you to inspect the value of a computed property - without accidentally invoking it if it is intended to be - generated lazily. - @method cacheFor - @param {String} keyName - @return {Object} The cached value of the computed property, if any - @public - */ - cacheFor: function (keyName) { - return _emberMetal.cacheFor(this, keyName); - }, + // .......................................................... + // PRIVATE + // - // intended for debugging purposes - observersForKey: function (keyName) { - return _emberMetal.observersFor(this, keyName); - } - }); -}); -enifed('ember-runtime/mixins/promise_proxy', ['exports', 'ember-metal', 'ember-runtime/computed/computed_macros'], function (exports, _emberMetal, _emberRuntimeComputedComputed_macros) { - 'use strict'; + /* Called when the from side changes. */ - /** - @module ember - @submodule ember-runtime - */ + Binding.prototype.fromDidChange = function fromDidChange(target) { + this._scheduleSync('fwd'); + }; - function tap(proxy, promise) { - _emberMetal.setProperties(proxy, { - isFulfilled: false, - isRejected: false - }); + /* Called when the to side changes. */ - return promise.then(function (value) { - if (!proxy.isDestroyed && !proxy.isDestroying) { - _emberMetal.setProperties(proxy, { - content: value, - isFulfilled: true - }); + Binding.prototype.toDidChange = function toDidChange(target) { + this._scheduleSync('back'); + }; + + Binding.prototype._scheduleSync = function _scheduleSync(dir) { + var existingDir = this._direction; + + // If we haven't scheduled the binding yet, schedule it. + if (existingDir === undefined) { + _emberMetalRun_loop.default.schedule('sync', this, '_sync'); + this._direction = dir; } - return value; - }, function (reason) { - if (!proxy.isDestroyed && !proxy.isDestroying) { - _emberMetal.setProperties(proxy, { - reason: reason, - isRejected: true - }); + + // If both a 'back' and 'fwd' sync have been scheduled on the same object, + // default to a 'fwd' sync so that it remains deterministic. + if (existingDir === 'back' && dir === 'fwd') { + this._direction = 'fwd'; } - throw reason; - }, 'Ember: PromiseProxy'); + }; + + Binding.prototype._sync = function _sync() { + var _this = this; + + var log = _emberEnvironment.ENV.LOG_BINDINGS; + + var toObj = this._toObj; + + // Don't synchronize destroyed objects or disconnected bindings. + if (toObj.isDestroyed || !this._readyToSync) { + return; + } + + // Get the direction of the binding for the object we are + // synchronizing from. + var direction = this._direction; + + var fromObj = this._fromObj; + var fromPath = this._fromPath; + + this._direction = undefined; + + // If we're synchronizing from the remote object... + if (direction === 'fwd') { + (function () { + var fromValue = _emberMetalProperty_get.get(fromObj, fromPath); + if (log) { + _emberConsole.default.log(' ', _this.toString(), '->', fromValue, fromObj); + } + if (_this._oneWay) { + _emberMetalProperty_set.trySet(toObj, _this._to, fromValue); + } else { + _emberMetalObserver._suspendObserver(toObj, _this._to, _this, 'toDidChange', function () { + _emberMetalProperty_set.trySet(toObj, this._to, fromValue); + }); + } + // If we're synchronizing *to* the remote object. + })(); + } else if (direction === 'back') { + (function () { + var toValue = _emberMetalProperty_get.get(toObj, _this._to); + if (log) { + _emberConsole.default.log(' ', _this.toString(), '<-', toValue, toObj); + } + _emberMetalObserver._suspendObserver(fromObj, fromPath, _this, 'fromDidChange', function () { + _emberMetalProperty_set.trySet(fromObj, fromPath, toValue); + }); + })(); + } + }; + + return Binding; + })(); + + function fireDeprecations(obj, toPath, fromPath, deprecateGlobal, deprecateOneWay, deprecateAlias) { + var deprecateGlobalMessage = '`Ember.Binding` is deprecated. Since you' + ' are binding to a global consider using a service instead.'; + var deprecateOneWayMessage = '`Ember.Binding` is deprecated. Since you' + ' are using a `oneWay` binding consider using a `readOnly` computed' + ' property instead.'; + var deprecateAliasMessage = '`Ember.Binding` is deprecated. Consider' + ' using an `alias` computed property instead.'; + + var objectInfo = 'The `' + toPath + '` property of `' + obj + '` is an `Ember.Binding` connected to `' + fromPath + '`, but '; + _emberMetalDebug.deprecate(objectInfo + deprecateGlobalMessage, !deprecateGlobal, { + id: 'ember-metal.binding', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x#toc_ember-binding' + }); + _emberMetalDebug.deprecate(objectInfo + deprecateOneWayMessage, !deprecateOneWay, { + id: 'ember-metal.binding', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x#toc_ember-binding' + }); + _emberMetalDebug.deprecate(objectInfo + deprecateAliasMessage, !deprecateAlias, { + id: 'ember-metal.binding', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x#toc_ember-binding' + }); + } + + function mixinProperties(to, from) { + for (var key in from) { + if (from.hasOwnProperty(key)) { + to[key] = from[key]; + } + } } + mixinProperties(Binding, { + + /* + See `Ember.Binding.from`. + @method from + @static + */ + from: function (from) { + var C = this; + return new C(undefined, from); + }, + + /* + See `Ember.Binding.to`. + @method to + @static + */ + to: function (to) { + var C = this; + return new C(to, undefined); + } + }); /** - A low level mixin making ObjectProxy promise-aware. + An `Ember.Binding` connects the properties of two objects so that whenever + the value of one property changes, the other property will be changed also. + + ## Automatic Creation of Bindings with `/^*Binding/`-named Properties. + + You do not usually create Binding objects directly but instead describe + bindings in your class or object definition using automatic binding + detection. + + Properties ending in a `Binding` suffix will be converted to `Ember.Binding` + instances. The value of this property should be a string representing a path + to another object or a custom binding instance created using Binding helpers + (see "One Way Bindings"): + + ``` + valueBinding: "MyApp.someController.title" + ``` + + This will create a binding from `MyApp.someController.title` to the `value` + property of your object instance automatically. Now the two values will be + kept in sync. + + ## One Way Bindings + + One especially useful binding customization you can use is the `oneWay()` + helper. This helper tells Ember that you are only interested in + receiving changes on the object you are binding from. For example, if you + are binding to a preference and you want to be notified if the preference + has changed, but your object will not be changing the preference itself, you + could do: + + ``` + bigTitlesBinding: Ember.Binding.oneWay("MyApp.preferencesController.bigTitles") + ``` + + This way if the value of `MyApp.preferencesController.bigTitles` changes the + `bigTitles` property of your object will change also. However, if you + change the value of your `bigTitles` property, it will not update the + `preferencesController`. + + One way bindings are almost twice as fast to setup and twice as fast to + execute because the binding only has to worry about changes to one side. + + You should consider using one way bindings anytime you have an object that + may be created frequently and you do not intend to change a property; only + to monitor it for changes (such as in the example above). + + ## Adding Bindings Manually + + All of the examples above show you how to configure a custom binding, but the + result of these customizations will be a binding template, not a fully active + Binding instance. The binding will actually become active only when you + instantiate the object the binding belongs to. It is useful, however, to + understand what actually happens when the binding is activated. + + For a binding to function it must have at least a `from` property and a `to` + property. The `from` property path points to the object/key that you want to + bind from while the `to` path points to the object/key you want to bind to. + + When you define a custom binding, you are usually describing the property + you want to bind from (such as `MyApp.someController.value` in the examples + above). When your object is created, it will automatically assign the value + you want to bind `to` based on the name of your binding key. In the + examples above, during init, Ember objects will effectively call + something like this on your binding: ```javascript - let ObjectPromiseProxy = Ember.ObjectProxy.extend(Ember.PromiseProxyMixin); + binding = Ember.Binding.from("valueBinding").to("value"); + ``` - let proxy = ObjectPromiseProxy.create({ - promise: Ember.RSVP.cast($.getJSON('/some/remote/data.json')) - }); + This creates a new binding instance based on the template you provide, and + sets the to path to the `value` property of the new object. Now that the + binding is fully configured with a `from` and a `to`, it simply needs to be + connected to become active. This is done through the `connect()` method: - proxy.then(function(json){ - // the json - }, function(reason) { - // the reason why you have no json - }); + ```javascript + binding.connect(this); ``` - the proxy has bindable attributes which - track the promises life cycle + Note that when you connect a binding you pass the object you want it to be + connected to. This object will be used as the root for both the from and + to side of the binding when inspecting relative paths. This allows the + binding to be automatically inherited by subclassed objects as well. + + This also allows you to bind between objects using the paths you declare in + `from` and `to`: ```javascript - proxy.get('isPending') //=> true - proxy.get('isSettled') //=> false - proxy.get('isRejected') //=> false - proxy.get('isFulfilled') //=> false + // Example 1 + binding = Ember.Binding.from("App.someObject.value").to("value"); + binding.connect(this); + + // Example 2 + binding = Ember.Binding.from("parentView.value").to("App.someObject.value"); + binding.connect(this); ``` - When the $.getJSON completes, and the promise is fulfilled - with json, the life cycle attributes will update accordingly. - Note that $.getJSON doesn't return an ECMA specified promise, - it is useful to wrap this with an `RSVP.cast` so that it behaves - as a spec compliant promise. + Now that the binding is connected, it will observe both the from and to side + and relay changes. + + If you ever needed to do so (you almost never will, but it is useful to + understand this anyway), you could manually create an active binding by + using the `Ember.bind()` helper method. (This is the same method used by + to setup your bindings on objects): ```javascript - proxy.get('isPending') //=> false - proxy.get('isSettled') //=> true - proxy.get('isRejected') //=> false - proxy.get('isFulfilled') //=> true + Ember.bind(MyApp.anotherObject, "value", "MyApp.someController.value"); ``` - As the proxy is an ObjectProxy, and the json now its content, - all the json properties will be available directly from the proxy. + Both of these code fragments have the same effect as doing the most friendly + form of binding creation like so: ```javascript - // Assuming the following json: - { - firstName: 'Stefan', - lastName: 'Penner' - } + MyApp.anotherObject = Ember.Object.create({ + valueBinding: "MyApp.someController.value", - // both properties will accessible on the proxy - proxy.get('firstName') //=> 'Stefan' - proxy.get('lastName') //=> 'Penner' + // OTHER CODE FOR THIS OBJECT... + }); ``` - @class Ember.PromiseProxyMixin + Ember's built in binding creation method makes it easy to automatically + create bindings for you. You should always use the highest-level APIs + available, even if you understand how it works underneath. + + @class Binding + @namespace Ember + @since Ember 0.9 @public */ - exports.default = _emberMetal.Mixin.create({ - /** - If the proxied promise is rejected this will contain the reason - provided. - @property reason - @default null - @public - */ - reason: null, + // Ember.Binding = Binding; ES6TODO: where to put this? - /** - Once the proxied promise has settled this will become `false`. - @property isPending - @default true - @public - */ - isPending: _emberRuntimeComputedComputed_macros.not('isSettled').readOnly(), + /** + Global helper method to create a new binding. Just pass the root object + along with a `to` and `from` path to create and connect the binding. + + @method bind + @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 bind(obj, to, from) { + return new Binding(to, from).connect(obj); + } + + exports.Binding = Binding; +}); +enifed('ember-metal/cache', ['exports', 'ember-utils', 'ember-metal/meta'], function (exports, _emberUtils, _emberMetalMeta) { + 'use strict'; + + var Cache = (function () { + function Cache(limit, func, key, store) { + babelHelpers.classCallCheck(this, Cache); + + this.size = 0; + this.misses = 0; + this.hits = 0; + this.limit = limit; + this.func = func; + this.key = key; + this.store = store || new DefaultStore(); + } + + Cache.prototype.get = function get(obj) { + var key = this.key === undefined ? obj : this.key(obj); + var value = this.store.get(key); + if (value === undefined) { + this.misses++; + value = this._set(key, this.func(obj)); + } else if (value === _emberMetalMeta.UNDEFINED) { + this.hits++; + value = undefined; + } else { + this.hits++; + // nothing to translate + } + + return value; + }; + + Cache.prototype.set = function set(obj, value) { + var key = this.key === undefined ? obj : this.key(obj); + return this._set(key, value); + }; + + Cache.prototype._set = function _set(key, value) { + if (this.limit > this.size) { + this.size++; + if (value === undefined) { + this.store.set(key, _emberMetalMeta.UNDEFINED); + } else { + this.store.set(key, value); + } + } + + return value; + }; + + Cache.prototype.purge = function purge() { + this.store.clear(); + this.size = 0; + this.hits = 0; + this.misses = 0; + }; + + return Cache; + })(); + + exports.default = Cache; + + var DefaultStore = (function () { + function DefaultStore() { + babelHelpers.classCallCheck(this, DefaultStore); + + this.data = new _emberUtils.EmptyObject(); + } + + DefaultStore.prototype.get = function get(key) { + return this.data[key]; + }; + + DefaultStore.prototype.set = function set(key, value) { + this.data[key] = value; + }; + + DefaultStore.prototype.clear = function clear() { + this.data = new _emberUtils.EmptyObject(); + }; + + return DefaultStore; + })(); +}); +enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_get', 'ember-metal/meta', 'ember-metal/watch_key', 'ember-metal/computed', 'ember-metal/watch_path'], function (exports, _emberUtils, _emberMetalProperty_get, _emberMetalMeta, _emberMetalWatch_key, _emberMetalComputed, _emberMetalWatch_path) { + 'use strict'; + + exports.finishChains = finishChains; + + var FIRST_KEY = /^([^\.]+)/; + + function firstKey(path) { + return path.match(FIRST_KEY)[0]; + } + + function isObject(obj) { + return typeof obj === 'object' && obj; + } + + function isVolatile(obj) { + return !(isObject(obj) && obj.isDescriptor && obj._volatile === false); + } + + var ChainWatchers = (function () { + function ChainWatchers() { + babelHelpers.classCallCheck(this, ChainWatchers); + + // chain nodes that reference a key in this obj by key + // we only create ChainWatchers when we are going to add them + // so create this upfront + this.chains = new _emberUtils.EmptyObject(); + } + + ChainWatchers.prototype.add = function add(key, node) { + var nodes = this.chains[key]; + if (nodes === undefined) { + this.chains[key] = [node]; + } else { + nodes.push(node); + } + }; + + ChainWatchers.prototype.remove = function remove(key, node) { + var nodes = this.chains[key]; + if (nodes) { + for (var i = 0; i < nodes.length; i++) { + if (nodes[i] === node) { + nodes.splice(i, 1); + break; + } + } + } + }; - /** - Once the proxied promise has settled this will become `true`. - @property isSettled - @default false - @public - */ - isSettled: _emberRuntimeComputedComputed_macros.or('isRejected', 'isFulfilled').readOnly(), + ChainWatchers.prototype.has = function has(key, node) { + var nodes = this.chains[key]; + if (nodes) { + for (var i = 0; i < nodes.length; i++) { + if (nodes[i] === node) { + return true; + } + } + } + return false; + }; - /** - Will become `true` if the proxied promise is rejected. - @property isRejected - @default false - @public - */ - isRejected: false, + ChainWatchers.prototype.revalidateAll = function revalidateAll() { + for (var key in this.chains) { + this.notify(key, true, undefined); + } + }; - /** - Will become `true` if the proxied promise is fulfilled. - @property isFulfilled - @default false - @public - */ - isFulfilled: false, + ChainWatchers.prototype.revalidate = function revalidate(key) { + this.notify(key, true, undefined); + }; - /** - The promise whose fulfillment value is being proxied by this object. - This property must be specified upon creation, and should not be - changed once created. - Example: - ```javascript - Ember.ObjectProxy.extend(Ember.PromiseProxyMixin).create({ - promise: - }); - ``` - @property promise - @public - */ - promise: _emberMetal.computed({ - get: function () { - throw new _emberMetal.Error('PromiseProxy\'s promise must be set'); - }, - set: function (key, promise) { - return tap(this, promise); + // 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 object and path that + // will be/are invalidated by this key change, depending on + // whether the revalidate flag is passed + + ChainWatchers.prototype.notify = function notify(key, revalidate, callback) { + var nodes = this.chains[key]; + if (nodes === undefined || nodes.length === 0) { + return; } - }), - /** - An alias to the proxied promise's `then`. - See RSVP.Promise.then. - @method then - @param {Function} callback - @return {RSVP.Promise} - @public - */ - then: promiseAlias('then'), + var affected = undefined; - /** - An alias to the proxied promise's `catch`. - See RSVP.Promise.catch. - @method catch - @param {Function} callback - @return {RSVP.Promise} - @since 1.3.0 - @public - */ - 'catch': promiseAlias('catch'), + if (callback) { + affected = []; + } - /** - An alias to the proxied promise's `finally`. - See RSVP.Promise.finally. - @method finally - @param {Function} callback - @return {RSVP.Promise} - @since 1.3.0 - @public - */ - 'finally': promiseAlias('finally') + for (var i = 0; i < nodes.length; i++) { + nodes[i].notify(revalidate, affected); + } - }); + if (callback === undefined) { + return; + } - function promiseAlias(name) { - return function () { - var promise = _emberMetal.get(this, 'promise'); - return promise[name].apply(promise, arguments); + // we gather callbacks so we don't notify them during revalidation + for (var i = 0; i < affected.length; i += 2) { + var obj = affected[i]; + var path = affected[i + 1]; + callback(obj, path); + } }; + + return ChainWatchers; + })(); + + function makeChainWatcher() { + return new ChainWatchers(); } -}); -enifed('ember-runtime/mixins/registry_proxy', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-runtime - */ - 'use strict'; + function addChainWatcher(obj, keyName, node) { + var m = _emberMetalMeta.meta(obj); + m.writableChainWatchers(makeChainWatcher).add(keyName, node); + _emberMetalWatch_key.watchKey(obj, keyName, m); + } - exports.buildFakeRegistryWithDeprecations = buildFakeRegistryWithDeprecations; + function removeChainWatcher(obj, keyName, node, _meta) { + if (!isObject(obj)) { + return; + } - /** - RegistryProxyMixin is used to provide public access to specific - registry functionality. - - @class RegistryProxyMixin - @private - */ - exports.default = _emberMetal.Mixin.create({ - __registry__: null, + var meta = _meta || _emberMetalMeta.peekMeta(obj); - /** - Given a fullName return the corresponding factory. - @public - @method resolveRegistration - @param {String} fullName - @return {Function} fullName's factory - */ - resolveRegistration: registryAlias('resolve'), + if (!meta || !meta.readableChainWatchers()) { + return; + } - /** - Registers a factory that can be used for dependency injection (with - `inject`) or for service lookup. Each factory is registered with - a full name including two parts: `type:name`. - A simple example: - ```javascript - let App = Ember.Application.create(); - App.Orange = Ember.Object.extend(); - App.register('fruit:favorite', App.Orange); - ``` - Ember will resolve factories from the `App` namespace automatically. - For example `App.CarsController` will be discovered and returned if - an application requests `controller:cars`. - An example of registering a controller with a non-standard name: - ```javascript - let App = Ember.Application.create(); - let Session = Ember.Controller.extend(); - App.register('controller:session', Session); - // The Session controller can now be treated like a normal controller, - // despite its non-standard name. - App.ApplicationController = Ember.Controller.extend({ - needs: ['session'] - }); - ``` - Registered factories are **instantiated** by having `create` - called on them. Additionally they are **singletons**, each time - they are looked up they return the same instance. - Some examples modifying that default behavior: - ```javascript - let App = Ember.Application.create(); - App.Person = Ember.Object.extend(); - App.Orange = Ember.Object.extend(); - App.Email = Ember.Object.extend(); - App.session = Ember.Object.create(); - App.register('model:user', App.Person, { singleton: false }); - App.register('fruit:favorite', App.Orange); - App.register('communication:main', App.Email, { singleton: false }); - App.register('session', App.session, { instantiate: false }); - ``` - @method register - @param fullName {String} type:name (e.g., 'model:user') - @param factory {Function} (e.g., App.Person) - @param options {Object} (optional) disable instantiation or singleton usage - @public - */ - register: registryAlias('register'), + // make meta writable + meta = _emberMetalMeta.meta(obj); - /** - Unregister a factory. - ```javascript - let App = Ember.Application.create(); - let User = Ember.Object.extend(); - App.register('model:user', User); - App.resolveRegistration('model:user').create() instanceof User //=> true - App.unregister('model:user') - App.resolveRegistration('model:user') === undefined //=> true - ``` - @public - @method unregister - @param {String} fullName - */ - unregister: registryAlias('unregister'), + meta.readableChainWatchers().remove(keyName, node); - /** - Check if a factory is registered. - @public - @method hasRegistration - @param {String} fullName - @return {Boolean} - */ - hasRegistration: registryAlias('has'), + _emberMetalWatch_key.unwatchKey(obj, keyName, meta); + } - /** - Register an option for a particular factory. - @public - @method registerOption - @param {String} fullName - @param {String} optionName - @param {Object} options - */ - registerOption: registryAlias('option'), + // 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 + // pass null for parent and key and object for value. - /** - Return a specific registered option for a particular factory. - @public - @method registeredOption - @param {String} fullName - @param {String} optionName - @return {Object} options - */ - registeredOption: registryAlias('getOption'), + var ChainNode = (function () { + function ChainNode(parent, key, value) { + babelHelpers.classCallCheck(this, ChainNode); - /** - Register options for a particular factory. - @public - @method registerOptions - @param {String} fullName - @param {Object} options - */ - registerOptions: registryAlias('options'), + this._parent = parent; + this._key = key; - /** - Return registered options for a particular factory. - @public - @method registeredOptions - @param {String} fullName - @return {Object} options - */ - registeredOptions: registryAlias('getOptions'), + // _watching is true when calling get(this._parent, this._key) will + // return the value of this node. + // + // It is false for the root of a chain (because we have no parent) + // and for global paths (because the parent node is the object with + // the observer on it) + this._watching = value === undefined; - /** - Allow registering options for all factories of a type. - ```javascript - let App = Ember.Application.create(); - let appInstance = App.buildInstance(); - // if all of type `connection` must not be singletons - appInstance.optionsForType('connection', { singleton: false }); - appInstance.register('connection:twitter', TwitterConnection); - appInstance.register('connection:facebook', FacebookConnection); - let twitter = appInstance.lookup('connection:twitter'); - let twitter2 = appInstance.lookup('connection:twitter'); - twitter === twitter2; // => false - let facebook = appInstance.lookup('connection:facebook'); - let facebook2 = appInstance.lookup('connection:facebook'); - facebook === facebook2; // => false - ``` - @public - @method registerOptionsForType - @param {String} type - @param {Object} options - */ - registerOptionsForType: registryAlias('optionsForType'), + this._chains = undefined; + this._object = undefined; + this.count = 0; - /** - Return the registered options for all factories of a type. - @public - @method registeredOptionsForType - @param {String} type - @return {Object} options - */ - registeredOptionsForType: registryAlias('getOptionsForType'), + this._value = value; + this._paths = {}; + if (this._watching) { + var obj = parent.value(); - /** - Define a dependency injection onto a specific factory or all factories - of a type. - When Ember instantiates a controller, view, or other framework component - it can attach a dependency to that component. This is often used to - provide services to a set of framework components. - An example of providing a session object to all controllers: - ```javascript - let App = Ember.Application.create(); - let Session = Ember.Object.extend({ isAuthenticated: false }); - // A factory must be registered before it can be injected - App.register('session:main', Session); - // Inject 'session:main' onto all factories of the type 'controller' - // with the name 'session' - App.inject('controller', 'session', 'session:main'); - App.IndexController = Ember.Controller.extend({ - isLoggedIn: Ember.computed.alias('session.isAuthenticated') - }); - ``` - Injections can also be performed on specific factories. - ```javascript - App.inject(, , ) - App.inject('route', 'source', 'source:main') - App.inject('route:application', 'email', 'model:email') - ``` - It is important to note that injections can only be performed on - classes that are instantiated by Ember itself. Instantiating a class - directly (via `create` or `new`) bypasses the dependency injection - system. - **Note:** Ember-Data instantiates its models in a unique manner, and consequently - injections onto models (or all models) will not work as expected. Injections - on models can be enabled by setting `EmberENV.MODEL_FACTORY_INJECTIONS` - to `true`. - @public - @method inject - @param factoryNameOrType {String} - @param property {String} - @param injectionName {String} - **/ - inject: registryAlias('injection') - }); + if (!isObject(obj)) { + return; + } - function registryAlias(name) { - return function () { - var _registry__; + this._object = obj; - return (_registry__ = this.__registry__)[name].apply(_registry__, arguments); + addChainWatcher(this._object, this._key, this); + } + } + + ChainNode.prototype.value = function value() { + if (this._value === undefined && this._watching) { + var obj = this._parent.value(); + this._value = lazyGet(obj, this._key); + } + return this._value; }; - } - function buildFakeRegistryWithDeprecations(instance, typeForMessage) { - var fakeRegistry = {}; - var registryProps = { - resolve: 'resolveRegistration', - register: 'register', - unregister: 'unregister', - has: 'hasRegistration', - option: 'registerOption', - options: 'registerOptions', - getOptions: 'registeredOptions', - optionsForType: 'registerOptionsForType', - getOptionsForType: 'registeredOptionsForType', - injection: 'inject' + ChainNode.prototype.destroy = function destroy() { + if (this._watching) { + var obj = this._object; + if (obj) { + removeChainWatcher(obj, this._key, this); + } + this._watching = false; // so future calls do nothing + } }; - for (var deprecatedProperty in registryProps) { - fakeRegistry[deprecatedProperty] = buildFakeRegistryFunction(instance, typeForMessage, deprecatedProperty, registryProps[deprecatedProperty]); - } + // copies a top level object only - return fakeRegistry; - } + ChainNode.prototype.copy = function copy(obj) { + var ret = new ChainNode(null, null, obj); + var paths = this._paths; + var path = undefined; - function buildFakeRegistryFunction(instance, typeForMessage, deprecatedProperty, nonDeprecatedProperty) { - return function () { - _emberMetal.deprecate('Using `' + typeForMessage + '.registry.' + deprecatedProperty + '` is deprecated. Please use `' + typeForMessage + '.' + nonDeprecatedProperty + '` instead.', false, { - id: 'ember-application.app-instance-registry', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-application-registry-ember-applicationinstance-registry' - }); - return instance[nonDeprecatedProperty].apply(instance, arguments); + for (path in paths) { + // this check will also catch non-number vals. + if (paths[path] <= 0) { + continue; + } + ret.add(path); + } + return ret; }; - } -}); -enifed('ember-runtime/mixins/target_action_support', ['exports', 'ember-environment', 'ember-metal'], function (exports, _emberEnvironment, _emberMetal) { - /** - @module ember - @submodule ember-runtime - */ - 'use strict'; + // called on the root node of a chain to setup watchers on the specified + // path. - /** - `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 - usually the best choice. This mixin is most often useful when you are - doing more complex event handling in Components. - - @class TargetActionSupport - @namespace Ember - @extends Ember.Mixin - @private - */ - exports.default = _emberMetal.Mixin.create({ - target: null, - action: null, - actionContext: null, + ChainNode.prototype.add = function add(path) { + var paths = this._paths; + paths[path] = (paths[path] || 0) + 1; - actionContextObject: _emberMetal.computed('actionContext', function () { - var actionContext = _emberMetal.get(this, 'actionContext'); + var key = firstKey(path); + var tail = path.slice(key.length + 1); - if (typeof actionContext === 'string') { - var value = _emberMetal.get(this, actionContext); - if (value === undefined) { - value = _emberMetal.get(_emberEnvironment.context.lookup, actionContext); - } - return value; - } else { - return actionContext; - } - }), + this.chain(key, tail); + }; - /** - Send an `action` with an `actionContext` to a `target`. The action, actionContext - and target will be retrieved from properties of the object. For example: - ```javascript - App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, { - target: Ember.computed.alias('controller'), - action: 'save', - actionContext: Ember.computed.alias('context'), - click() { - this.triggerAction(); // Sends the `save` action, along with the current context - // to the current controller - } - }); - ``` - The `target`, `action`, and `actionContext` can be provided as properties of - an optional object argument to `triggerAction` as well. - ```javascript - App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, { - click() { - this.triggerAction({ - action: 'save', - target: this.get('controller'), - actionContext: this.get('context') - }); // Sends the `save` action, along with the current context - // to the current controller - } - }); - ``` - The `actionContext` defaults to the object you are mixing `TargetActionSupport` into. - But `target` and `action` must be specified either as properties or with the argument - to `triggerAction`, or a combination: - ```javascript - App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, { - target: Ember.computed.alias('controller'), - click() { - this.triggerAction({ - action: 'save' - }); // Sends the `save` action, along with a reference to `this`, - // to the current controller + // called on the root node of a chain to teardown watcher on the specified + // path + + ChainNode.prototype.remove = function remove(path) { + var paths = this._paths; + if (paths[path] > 0) { + paths[path]--; } - }); - ``` - @method triggerAction - @param opts {Object} (optional, with the optional keys action, target and/or actionContext) - @return {Boolean} true if the action was sent successfully and did not return false - @private - */ - triggerAction: function () { - var opts = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - var action = opts.action || _emberMetal.get(this, 'action'); - var target = opts.target; + var key = firstKey(path); + var tail = path.slice(key.length + 1); + + this.unchain(key, tail); + }; + + ChainNode.prototype.chain = function chain(key, path) { + var chains = this._chains; + var node = undefined; + if (chains === undefined) { + chains = this._chains = new _emberUtils.EmptyObject(); + } else { + node = chains[key]; + } - if (!target) { - target = getTarget(this); + if (node === undefined) { + node = chains[key] = new ChainNode(this, key, undefined); } - var actionContext = opts.actionContext; + node.count++; // count chains... - function args(options, actionName) { - var ret = []; - if (actionName) { - ret.push(actionName); - } + // chain rest of path if there is one + if (path) { + key = firstKey(path); + path = path.slice(key.length + 1); + node.chain(key, path); + } + }; - return ret.concat(options); + ChainNode.prototype.unchain = function unchain(key, path) { + var chains = this._chains; + var node = chains[key]; + + // unchain rest of path first... + if (path && path.length > 1) { + var nextKey = firstKey(path); + var nextPath = path.slice(nextKey.length + 1); + node.unchain(nextKey, nextPath); } - if (typeof actionContext === 'undefined') { - actionContext = _emberMetal.get(this, 'actionContextObject') || this; + // delete node if needed. + node.count--; + if (node.count <= 0) { + chains[node._key] = undefined; + node.destroy(); } + }; - if (target && action) { - var ret = undefined; + ChainNode.prototype.notify = function notify(revalidate, affected) { + if (revalidate && this._watching) { + var parentValue = this._parent.value(); - if (target.send) { - ret = target.send.apply(target, args(actionContext, action)); - } else { - _emberMetal.assert('The action \'' + action + '\' did not exist on ' + target, typeof target[action] === 'function'); - ret = target[action].apply(target, args(actionContext)); + if (parentValue !== this._object) { + if (this._object) { + removeChainWatcher(this._object, this._key, this); + } + + if (isObject(parentValue)) { + this._object = parentValue; + addChainWatcher(parentValue, this._key, this); + } else { + this._object = undefined; + } } + this._value = undefined; + } - if (ret !== false) { - ret = true; + // then notify chains... + var chains = this._chains; + var node = undefined; + if (chains) { + for (var key in chains) { + node = chains[key]; + if (node !== undefined) { + node.notify(revalidate, affected); + } } + } - return ret; + if (affected && this._parent) { + this._parent.populateAffected(this._key, 1, affected); + } + }; + + ChainNode.prototype.populateAffected = function populateAffected(path, depth, affected) { + if (this._key) { + path = this._key + '.' + path; + } + + if (this._parent) { + this._parent.populateAffected(path, depth + 1, affected); } else { - return false; + if (depth > 1) { + affected.push(this.value(), path); + } } - } - }); + }; - function getTarget(instance) { - // TODO: Deprecate specifying `targetObject` - var target = _emberMetal.get(instance, 'targetObject'); + return ChainNode; + })(); - // if a `targetObject` CP was provided, use it - if (target) { - return target; + function lazyGet(obj, key) { + if (!isObject(obj)) { + return; } - // if _targetObject use it - if (instance._targetObject) { - return instance._targetObject; + var meta = _emberMetalMeta.peekMeta(obj); + + // check if object meant only to be a prototype + if (meta && meta.proto === obj) { + return; } - target = _emberMetal.get(instance, 'target'); - if (target) { - if (typeof target === 'string') { - var value = _emberMetal.get(instance, target); - if (value === undefined) { - value = _emberMetal.get(_emberEnvironment.context.lookup, target); + // Use `get` if the return value is an EachProxy or an uncacheable value. + if (isVolatile(obj[key])) { + return _emberMetalProperty_get.get(obj, key); + // Otherwise attempt to get the cached value of the computed property + } else { + var cache = meta.readableCache(); + if (cache) { + return _emberMetalComputed.cacheFor.get(cache, key); } - - return value; - } else { - return target; } - } - - return null; } -}); -enifed("ember-runtime/string_registry", ["exports"], function (exports) { - // STATE within a module is frowned apon, this exists - // to support Ember.STRINGS but shield ember internals from this legacy global - // API. - "use strict"; - - exports.setStrings = setStrings; - exports.getStrings = getStrings; - exports.get = get; - var STRINGS = {}; - function setStrings(strings) { - STRINGS = strings; - } + function finishChains(obj) { + // We only create meta if we really have to + var m = _emberMetalMeta.peekMeta(obj); + if (m) { + m = _emberMetalMeta.meta(obj); - function getStrings() { - return STRINGS; + // finish any current chains node watchers that reference obj + var chainWatchers = m.readableChainWatchers(); + if (chainWatchers) { + chainWatchers.revalidateAll(); + } + // ensure that if we have inherited any chains they have been + // copied onto our own meta. + if (m.readableChains()) { + m.writableChains(_emberMetalWatch_path.makeChainNode); + } + } } - function get(name) { - return STRINGS[name]; - } + exports.removeChainWatcher = removeChainWatcher; + exports.ChainNode = ChainNode; }); -enifed('ember-runtime/system/application', ['exports', 'ember-runtime/system/namespace'], function (exports, _emberRuntimeSystemNamespace) { +enifed('ember-metal/computed', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/property_set', 'ember-metal/meta', 'ember-metal/expand_properties', 'ember-metal/error', 'ember-metal/properties', 'ember-metal/property_events', 'ember-metal/dependent_keys'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalProperty_set, _emberMetalMeta, _emberMetalExpand_properties, _emberMetalError, _emberMetalProperties, _emberMetalProperty_events, _emberMetalDependent_keys) { 'use strict'; - exports.default = _emberRuntimeSystemNamespace.default.extend(); -}); -enifed('ember-runtime/system/array_proxy', ['exports', 'ember-metal', 'ember-runtime/utils', 'ember-runtime/system/object', 'ember-runtime/mixins/mutable_array', 'ember-runtime/mixins/enumerable', 'ember-runtime/mixins/array'], function (exports, _emberMetal, _emberRuntimeUtils, _emberRuntimeSystemObject, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsArray) { - 'use strict'; + exports.default = computed; /** @module ember - @submodule ember-runtime + @submodule ember-metal */ - var OUT_OF_RANGE_EXCEPTION = 'Index out of range'; - var EMPTY = []; - - function K() { - return this; - } + var DEEP_EACH_REGEX = /\.@each\.[^.]+\./; /** - An ArrayProxy wraps any other object that implements `Ember.Array` and/or - `Ember.MutableArray,` forwarding all requests. This makes it very useful for - a number of binding use cases or other cases where being able to swap - out the underlying array is useful. + A computed property transforms an object literal with object's accessor function(s) into a property. - A simple example of usage: + By default the function backing the computed property will only be called + once and the result will be cached. You can specify various properties + that your computed property depends on. This will force the cached + result to be recomputed if the dependencies are modified. + + In the following example we declare a computed property - `fullName` - by calling + `.Ember.computed()` with property dependencies (`firstName` and `lastName`) as leading arguments and getter accessor function. The `fullName` getter function + will be called once (regardless of how many times it is accessed) as long + as its dependencies have not changed. Once `firstName` or `lastName` are updated + any future calls (or anything bound) to `fullName` will incorporate the new + values. ```javascript - let pets = ['dog', 'cat', 'fish']; - let ap = Ember.ArrayProxy.create({ content: Ember.A(pets) }); + let Person = Ember.Object.extend({ + // these will be supplied by `create` + firstName: null, + lastName: null, - ap.get('firstObject'); // 'dog' - ap.set('content', ['amoeba', 'paramecium']); - ap.get('firstObject'); // 'amoeba' + fullName: Ember.computed('firstName', 'lastName', function() { + let firstName = this.get('firstName'), + lastName = this.get('lastName'); + + return firstName + ' ' + lastName; + }) + }); + + let tom = Person.create({ + firstName: 'Tom', + lastName: 'Dale' + }); + + tom.get('fullName') // 'Tom Dale' ``` - This class can also be useful as a layer to transform the contents of - an array, as they are accessed. This can be done by overriding - `objectAtContent`: + You can also define what Ember should do when setting a computed property by providing additional function (`set`) in hash argument. + If you try to set a computed property, it will try to invoke setter accessor function with the key and + value you want to set it to as arguments. ```javascript - let pets = ['dog', 'cat', 'fish']; - let ap = Ember.ArrayProxy.create({ - content: Ember.A(pets), - objectAtContent: function(idx) { - return this.get('content').objectAt(idx).toUpperCase(); + let Person = Ember.Object.extend({ + // these will be supplied by `create` + firstName: null, + lastName: null, + + fullName: Ember.computed('firstName', 'lastName', { + get(key) { + let firstName = this.get('firstName'), + lastName = this.get('lastName'); + + return firstName + ' ' + lastName; + }, + set(key, value) { + let [firstName, lastName] = value.split(' '); + + this.set('firstName', firstName); + this.set('lastName', lastName); + + return value; } + }) }); - ap.get('firstObject'); // . 'DOG' + let person = Person.create(); + + person.set('fullName', 'Peter Wagenet'); + person.get('firstName'); // 'Peter' + person.get('lastName'); // 'Wagenet' ``` - @class ArrayProxy + You can overwrite computed property with normal property (no longer computed), that won't change if dependencies change, if you set computed property and it won't have setter accessor function defined. + + You can also mark computed property as `.readOnly()` and block all attempts to set it. + + ```javascript + let Person = Ember.Object.extend({ + // these will be supplied by `create` + firstName: null, + lastName: null, + + fullName: Ember.computed('firstName', 'lastName', { + get(key) { + let firstName = this.get('firstName'); + let lastName = this.get('lastName'); + + return firstName + ' ' + lastName; + } + }).readOnly() + }); + + let person = Person.create(); + person.set('fullName', 'Peter Wagenet'); // Uncaught Error: Cannot set read-only property "fullName" on object: <(...):emberXXX> + ``` + + Additional resources: + - [New CP syntax RFC](https://github.com/emberjs/rfcs/blob/master/text/0011-improved-cp-syntax.md) + - [New computed syntax explained in "Ember 1.12 released" ](http://emberjs.com/blog/2015/05/13/ember-1-12-released.html#toc_new-computed-syntax) + + @class ComputedProperty @namespace Ember - @extends Ember.Object - @uses Ember.MutableArray @public */ - exports.default = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsMutable_array.default, { + function ComputedProperty(config, opts) { + this.isDescriptor = true; + if (typeof config === 'function') { + this._getter = config; + } else { + _emberMetalDebug.assert('Ember.computed expects a function or an object as last argument.', typeof config === 'object' && !Array.isArray(config)); + _emberMetalDebug.assert('Config object passed to an Ember.computed can only contain `get` or `set` keys.', (function () { + var keys = Object.keys(config); + for (var i = 0; i < keys.length; i++) { + if (keys[i] !== 'get' && keys[i] !== 'set') { + return false; + } + } + return true; + })()); + this._getter = config.get; + this._setter = config.set; + } + _emberMetalDebug.assert('Computed properties must receive a getter or a setter, you passed none.', !!this._getter || !!this._setter); + this._dependentKeys = undefined; + this._suspended = undefined; + this._meta = undefined; + this._volatile = false; + this._dependentKeys = opts && opts.dependentKeys; + this._readOnly = false; + } - /** - The content array. Must be an object that implements `Ember.Array` and/or - `Ember.MutableArray.` - @property content - @type Ember.Array - @private - */ - content: null, + ComputedProperty.prototype = new _emberMetalProperties.Descriptor(); + ComputedProperty.prototype.constructor = ComputedProperty; - /** - The array that the proxy pretends to be. In the default `ArrayProxy` - implementation, this and `content` are the same. Subclasses of `ArrayProxy` - can override this property to provide things like sorting and filtering. - @property arrangedContent - @private - */ - arrangedContent: _emberMetal.alias('content'), + var ComputedPropertyPrototype = ComputedProperty.prototype; - /** - Should actually retrieve the object at the specified index from the - content. You can override this method in subclasses to transform the - content item to something new. - This method will only be called if content is non-`null`. - @method objectAtContent - @param {Number} idx The index to retrieve. - @return {Object} the value or undefined if none found - @public - */ - objectAtContent: function (idx) { - return _emberRuntimeMixinsArray.objectAt(_emberMetal.get(this, 'arrangedContent'), idx); - }, + /** + Call on a computed property to set it into non-cached mode. When in this + mode the computed property will not automatically cache the return value. + + It also does not automatically fire any change events. You must manually notify + any changes if you want to observe this property. + + Dependency keys have no effect on volatile properties as they are for cache + invalidation and notification when cached value is invalidated. + + ```javascript + let outsideService = Ember.Object.extend({ + value: Ember.computed(function() { + return OutsideService.getValue(); + }).volatile() + }).create(); + ``` + + @method volatile + @return {Ember.ComputedProperty} this + @chainable + @public + */ + ComputedPropertyPrototype.volatile = function () { + this._volatile = true; + return this; + }; - /** - Should actually replace the specified objects on the content array. - You can override this method in subclasses to transform the content item - into something new. - This method will only be called if content is non-`null`. - @method replaceContent - @param {Number} idx The starting index - @param {Number} amt The number of items to remove from the content. - @param {Array} objects Optional array of objects to insert or null if no - objects. - @return {void} - @private - */ - replaceContent: function (idx, amt, objects) { - _emberMetal.get(this, 'content').replace(idx, amt, objects); - }, + /** + Call on a computed property to set it into read-only mode. When in this + mode the computed property will throw an error when set. + + ```javascript + let Person = Ember.Object.extend({ + guid: Ember.computed(function() { + return 'guid-guid-guid'; + }).readOnly() + }); + + let person = Person.create(); + + person.set('guid', 'new-guid'); // will throw an exception + ``` + + @method readOnly + @return {Ember.ComputedProperty} this + @chainable + @public + */ + ComputedPropertyPrototype.readOnly = function () { + this._readOnly = true; + _emberMetalDebug.assert('Computed properties that define a setter using the new syntax cannot be read-only', !(this._readOnly && this._setter && this._setter !== this._getter)); + return this; + }; - /** - Invoked when the content property is about to change. Notifies observers that the - entire array content will change. - @private - @method _contentWillChange - */ - _contentWillChange: _emberMetal._beforeObserver('content', function () { - this._teardownContent(); - }), + /** + Sets the dependent keys on this computed property. Pass any number of + arguments containing key paths that this computed property depends on. + + ```javascript + let President = Ember.Object.extend({ + fullName: Ember.computed(function() { + return this.get('firstName') + ' ' + this.get('lastName'); + + // Tell Ember that this computed property depends on firstName + // and lastName + }).property('firstName', 'lastName') + }); + + let president = President.create({ + firstName: 'Barack', + lastName: 'Obama' + }); + + president.get('fullName'); // 'Barack Obama' + ``` + + @method property + @param {String} path* zero or more property paths + @return {Ember.ComputedProperty} this + @chainable + @public + */ + ComputedPropertyPrototype.property = function () { + var args = []; - _teardownContent: function () { - var content = _emberMetal.get(this, 'content'); + function addArg(property) { + _emberMetalDebug.warn('Dependent keys containing @each only work one level deep. ' + ('You used the key "' + property + '" which is invalid. ') + 'Please create an intermediary computed property.', DEEP_EACH_REGEX.test(property) === false, { id: 'ember-metal.computed-deep-each' }); + args.push(property); + } - if (content) { - _emberRuntimeMixinsArray.removeArrayObserver(content, this, { - willChange: 'contentArrayWillChange', - didChange: 'contentArrayDidChange' - }); - } - }, + for (var i = 0; i < arguments.length; i++) { + _emberMetalExpand_properties.default(arguments[i], addArg); + } - /** - Override to implement content array `willChange` observer. - @method contentArrayWillChange - @param {Ember.Array} contentArray the content array - @param {Number} start starting index of the change - @param {Number} removeCount count of items removed - @param {Number} addCount count of items added - @private - */ - contentArrayWillChange: K, - /** - Override to implement content array `didChange` observer. - @method contentArrayDidChange - @param {Ember.Array} contentArray the content array - @param {Number} start starting index of the change - @param {Number} removeCount count of items removed - @param {Number} addCount count of items added - @private - */ - contentArrayDidChange: K, + this._dependentKeys = args; + return this; + }; + + /** + In some cases, you may want to annotate computed properties with additional + metadata about how they function or what values they operate on. For example, + computed property functions may close over variables that are then no longer + available for introspection. + + You can pass a hash of these values to a computed property like this: + + ``` + person: Ember.computed(function() { + let personId = this.get('personId'); + return App.Person.create({ id: personId }); + }).meta({ type: App.Person }) + ``` + + The hash that you pass to the `meta()` function will be saved on the + computed property descriptor under the `_meta` key. Ember runtime + exposes a public API for retrieving these values from classes, + via the `metaForProperty()` function. + + @method meta + @param {Object} meta + @chainable + @public + */ + ComputedPropertyPrototype.meta = function (meta) { + if (arguments.length === 0) { + return this._meta || {}; + } else { + this._meta = meta; + return this; + } + }; - /** - Invoked when the content property changes. Notifies observers that the - entire array content has changed. - @private - @method _contentDidChange - */ - _contentDidChange: _emberMetal.observer('content', function () { - var content = _emberMetal.get(this, 'content'); + // invalidate cache when CP key changes + ComputedPropertyPrototype.didChange = function (obj, keyName) { + // _suspended is set via a CP.set to ensure we don't clear + // the cached value set by the setter + if (this._volatile || this._suspended === obj) { + return; + } - _emberMetal.assert('Can\'t set ArrayProxy\'s content to itself', content !== this); + // don't create objects just to invalidate + var meta = _emberMetalMeta.peekMeta(obj); + if (!meta || meta.source !== obj) { + return; + } - this._setupContent(); - }), + var cache = meta.readableCache(); + if (cache && cache[keyName] !== undefined) { + cache[keyName] = undefined; + _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); + } + }; - _setupContent: function () { - var content = _emberMetal.get(this, 'content'); + ComputedPropertyPrototype.get = function (obj, keyName) { + if (this._volatile) { + return this._getter.call(obj, keyName); + } - if (content) { - _emberMetal.assert('ArrayProxy expects an Array or Ember.ArrayProxy, but you passed ' + typeof content, _emberRuntimeUtils.isArray(content) || content.isDestroyed); + var meta = _emberMetalMeta.meta(obj); + var cache = meta.writableCache(); - _emberRuntimeMixinsArray.addArrayObserver(content, this, { - willChange: 'contentArrayWillChange', - didChange: 'contentArrayDidChange' - }); - } - }, + var result = cache[keyName]; + if (result === _emberMetalMeta.UNDEFINED) { + return undefined; + } else if (result !== undefined) { + return result; + } - _arrangedContentWillChange: _emberMetal._beforeObserver('arrangedContent', function () { - var arrangedContent = _emberMetal.get(this, 'arrangedContent'); - var len = arrangedContent ? _emberMetal.get(arrangedContent, 'length') : 0; + var ret = this._getter.call(obj, keyName); + if (ret === undefined) { + cache[keyName] = _emberMetalMeta.UNDEFINED; + } else { + cache[keyName] = ret; + } - this.arrangedContentArrayWillChange(this, 0, len, undefined); - this.arrangedContentWillChange(this); + var chainWatchers = meta.readableChainWatchers(); + if (chainWatchers) { + chainWatchers.revalidate(keyName); + } + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); - this._teardownArrangedContent(arrangedContent); - }), + return ret; + }; - _arrangedContentDidChange: _emberMetal.observer('arrangedContent', function () { - var arrangedContent = _emberMetal.get(this, 'arrangedContent'); - var len = arrangedContent ? _emberMetal.get(arrangedContent, 'length') : 0; + ComputedPropertyPrototype.set = function computedPropertySetEntry(obj, keyName, value) { + if (this._readOnly) { + this._throwReadOnlyError(obj, keyName); + } - _emberMetal.assert('Can\'t set ArrayProxy\'s content to itself', arrangedContent !== this); + if (!this._setter) { + return this.clobberSet(obj, keyName, value); + } - this._setupArrangedContent(); + if (this._volatile) { + return this.volatileSet(obj, keyName, value); + } - this.arrangedContentDidChange(this); - this.arrangedContentArrayDidChange(this, 0, undefined, len); - }), + return this.setWithSuspend(obj, keyName, value); + }; - _setupArrangedContent: function () { - var arrangedContent = _emberMetal.get(this, 'arrangedContent'); + ComputedPropertyPrototype._throwReadOnlyError = function computedPropertyThrowReadOnlyError(obj, keyName) { + throw new _emberMetalError.default('Cannot set read-only property "' + keyName + '" on object: ' + _emberUtils.inspect(obj)); + }; - if (arrangedContent) { - _emberMetal.assert('ArrayProxy expects an Array or Ember.ArrayProxy, but you passed ' + typeof arrangedContent, _emberRuntimeUtils.isArray(arrangedContent) || arrangedContent.isDestroyed); + ComputedPropertyPrototype.clobberSet = function computedPropertyClobberSet(obj, keyName, value) { + var cachedValue = cacheFor(obj, keyName); + _emberMetalProperties.defineProperty(obj, keyName, null, cachedValue); + _emberMetalProperty_set.set(obj, keyName, value); + return value; + }; - _emberRuntimeMixinsArray.addArrayObserver(arrangedContent, this, { - willChange: 'arrangedContentArrayWillChange', - didChange: 'arrangedContentArrayDidChange' - }); - } - }, + ComputedPropertyPrototype.volatileSet = function computedPropertyVolatileSet(obj, keyName, value) { + return this._setter.call(obj, keyName, value); + }; - _teardownArrangedContent: function () { - var arrangedContent = _emberMetal.get(this, 'arrangedContent'); + ComputedPropertyPrototype.setWithSuspend = function computedPropertySetWithSuspend(obj, keyName, value) { + var oldSuspended = this._suspended; + this._suspended = obj; + try { + return this._set(obj, keyName, value); + } finally { + this._suspended = oldSuspended; + } + }; - if (arrangedContent) { - _emberRuntimeMixinsArray.removeArrayObserver(arrangedContent, this, { - willChange: 'arrangedContentArrayWillChange', - didChange: 'arrangedContentArrayDidChange' - }); + ComputedPropertyPrototype._set = function computedPropertySet(obj, keyName, value) { + // cache requires own meta + var meta = _emberMetalMeta.meta(obj); + // either there is a writable cache or we need one to update + var cache = meta.writableCache(); + var hadCachedValue = false; + var cachedValue = undefined; + if (cache[keyName] !== undefined) { + if (cache[keyName] !== _emberMetalMeta.UNDEFINED) { + cachedValue = cache[keyName]; } - }, - - arrangedContentWillChange: K, - arrangedContentDidChange: K, + hadCachedValue = true; + } - objectAt: function (idx) { - return _emberMetal.get(this, 'content') && this.objectAtContent(idx); - }, + var ret = this._setter.call(obj, keyName, value, cachedValue); - length: _emberMetal.computed(function () { - var arrangedContent = _emberMetal.get(this, 'arrangedContent'); - return arrangedContent ? _emberMetal.get(arrangedContent, 'length') : 0; - // No dependencies since Enumerable notifies length of change - }), + // allows setter to return the same value that is cached already + if (hadCachedValue && cachedValue === ret) { + return ret; + } - _replace: function (idx, amt, objects) { - var content = _emberMetal.get(this, 'content'); - _emberMetal.assert('The content property of ' + this.constructor + ' should be set before modifying it', content); - if (content) { - this.replaceContent(idx, amt, objects); - } + _emberMetalProperty_events.propertyWillChange(obj, keyName); - return this; - }, + if (hadCachedValue) { + cache[keyName] = undefined; + } - replace: function () { - if (_emberMetal.get(this, 'arrangedContent') === _emberMetal.get(this, 'content')) { - this._replace.apply(this, arguments); - } else { - throw new _emberMetal.Error('Using replace on an arranged ArrayProxy is not allowed.'); - } - }, + if (!hadCachedValue) { + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); + } - _insertAt: function (idx, object) { - if (idx > _emberMetal.get(this, 'content.length')) { - throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); - } + if (ret === undefined) { + cache[keyName] = _emberMetalMeta.UNDEFINED; + } else { + cache[keyName] = ret; + } - this._replace(idx, 0, [object]); - return this; - }, + _emberMetalProperty_events.propertyDidChange(obj, keyName); - insertAt: function (idx, object) { - if (_emberMetal.get(this, 'arrangedContent') === _emberMetal.get(this, 'content')) { - return this._insertAt(idx, object); - } else { - throw new _emberMetal.Error('Using insertAt on an arranged ArrayProxy is not allowed.'); - } - }, + return ret; + }; - removeAt: function (start, len) { - if ('number' === typeof start) { - var content = _emberMetal.get(this, 'content'); - var arrangedContent = _emberMetal.get(this, 'arrangedContent'); - var indices = []; + /* called before property is overridden */ + ComputedPropertyPrototype.teardown = function (obj, keyName) { + if (this._volatile) { + return; + } + var meta = _emberMetalMeta.meta(obj); + var cache = meta.readableCache(); + if (cache && cache[keyName] !== undefined) { + _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); + cache[keyName] = undefined; + } + }; - if (start < 0 || start >= _emberMetal.get(this, 'length')) { - throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); + /** + This helper returns a new property descriptor that wraps the passed + computed property function. You can use this helper to define properties + with mixins or via `Ember.defineProperty()`. + + If you pass a function as an argument, it will be used as a getter. A computed + property defined in this way might look like this: + + ```js + let Person = Ember.Object.extend({ + init() { + this._super(...arguments); + + this.firstName = 'Betty'; + this.lastName = 'Jones'; + }, + + fullName: Ember.computed('firstName', 'lastName', function() { + return `${this.get('firstName')} ${this.get('lastName')}`; + }) + }); + + let client = Person.create(); + + client.get('fullName'); // 'Betty Jones' + + client.set('lastName', 'Fuller'); + client.get('fullName'); // 'Betty Fuller' + ``` + + You can pass a hash with two functions, `get` and `set`, as an + argument to provide both a getter and setter: + + ```js + let Person = Ember.Object.extend({ + init() { + this._super(...arguments); + + this.firstName = 'Betty'; + this.lastName = 'Jones'; + }, + + fullName: Ember.computed('firstName', 'lastName', { + get(key) { + return `${this.get('firstName')} ${this.get('lastName')}`; + }, + set(key, value) { + let [firstName, lastName] = value.split(/\s+/); + this.setProperties({ firstName, lastName }); + return value; } + }) + }); + + let client = Person.create(); + client.get('firstName'); // 'Betty' + + client.set('fullName', 'Carroll Fuller'); + client.get('firstName'); // 'Carroll' + ``` + + The `set` function should accept two parameters, `key` and `value`. The value + returned from `set` will be the new value of the property. + + _Note: This is the preferred way to define computed properties when writing third-party + libraries that depend on or use Ember, since there is no guarantee that the user + will have [prototype Extensions](http://emberjs.com/guides/configuring-ember/disabling-prototype-extensions/) enabled._ + + The alternative syntax, with prototype extensions, might look like: + + ```js + fullName: function() { + return this.get('firstName') + ' ' + this.get('lastName'); + }.property('firstName', 'lastName') + ``` + + @class computed + @namespace Ember + @constructor + @static + @param {String} [dependentKeys*] Optional dependent keys that trigger this computed property. + @param {Function} func The computed property function. + @return {Ember.ComputedProperty} property descriptor instance + @public + */ - if (len === undefined) { - len = 1; - } + function computed(func) { + var args = undefined; - // Get a list of indices in original content to remove - for (var i = start; i < start + len; i++) { - // Use arrangedContent here so we avoid confusion with objects transformed by objectAtContent - indices.push(content.indexOf(_emberRuntimeMixinsArray.objectAt(arrangedContent, i))); - } + if (arguments.length > 1) { + args = [].slice.call(arguments); + func = args.pop(); + } - // Replace in reverse order since indices will change - indices.sort(function (a, b) { - return b - a; - }); + var cp = new ComputedProperty(func); - _emberMetal.beginPropertyChanges(); - for (var i = 0; i < indices.length; i++) { - this._replace(indices[i], 1, EMPTY); - } - _emberMetal.endPropertyChanges(); - } + if (args) { + cp.property.apply(cp, args); + } - return this; - }, + return cp; + } - pushObject: function (obj) { - this._insertAt(_emberMetal.get(this, 'content.length'), obj); - return obj; - }, + /** + Returns the cached value for a property, if one exists. + This can be useful for peeking at the value of a computed + property that is generated lazily, without accidentally causing + it to be created. + + @method cacheFor + @for Ember + @param {Object} obj the object whose property you want to check + @param {String} key the name of the property whose cached value you want + to return + @return {Object} the cached value + @public + */ + function cacheFor(obj, key) { + var meta = _emberMetalMeta.peekMeta(obj); + var cache = meta && meta.source === obj && meta.readableCache(); + var ret = cache && cache[key]; - pushObjects: function (objects) { - if (!(_emberRuntimeMixinsEnumerable.default.detect(objects) || _emberRuntimeUtils.isArray(objects))) { - throw new TypeError('Must pass Ember.Enumerable to Ember.MutableArray#pushObjects'); - } - this._replace(_emberMetal.get(this, 'length'), 0, objects); - return this; - }, + if (ret === _emberMetalMeta.UNDEFINED) { + return undefined; + } + return ret; + } - setObjects: function (objects) { - if (objects.length === 0) { - return this.clear(); - } + cacheFor.set = function (cache, key, value) { + if (value === undefined) { + cache[key] = _emberMetalMeta.UNDEFINED; + } else { + cache[key] = value; + } + }; - var len = _emberMetal.get(this, 'length'); - this._replace(0, len, objects); - return this; - }, + cacheFor.get = function (cache, key) { + var ret = cache[key]; + if (ret === _emberMetalMeta.UNDEFINED) { + return undefined; + } + return ret; + }; - unshiftObject: function (obj) { - this._insertAt(0, obj); - return obj; - }, + cacheFor.remove = function (cache, key) { + cache[key] = undefined; + }; - unshiftObjects: function (objects) { - this._replace(0, 0, objects); - return this; - }, + exports.ComputedProperty = ComputedProperty; + exports.computed = computed; + exports.cacheFor = cacheFor; +}); +enifed('ember-metal/core', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { + 'use strict'; - slice: function () { - var arr = this.toArray(); - return arr.slice.apply(arr, arguments); - }, + /** + @module ember + @submodule ember-metal + */ - arrangedContentArrayWillChange: function (item, idx, removedCnt, addedCnt) { - this.arrayContentWillChange(idx, removedCnt, addedCnt); - }, + /** + This namespace contains all Ember methods and functions. Future versions of + Ember may overwrite this namespace and therefore, you should avoid adding any + new properties. + + At the heart of Ember is Ember-Runtime, a set of core functions that provide + cross-platform compatibility and object property observing. Ember-Runtime is + small and performance-focused so you can use it alongside other + cross-platform libraries such as jQuery. For more details, see + [Ember-Runtime](http://emberjs.com/api/modules/ember-runtime.html). + + @class Ember + @static + @public + */ + var Ember = typeof _emberEnvironment.context.imports.Ember === 'object' && _emberEnvironment.context.imports.Ember || {}; - arrangedContentArrayDidChange: function (item, idx, removedCnt, addedCnt) { - this.arrayContentDidChange(idx, removedCnt, addedCnt); - }, + // Make sure these are set whether Ember was already defined or not + Ember.isNamespace = true; + Ember.toString = function () { + return 'Ember'; + }; - init: function () { - this._super.apply(this, arguments); - this._setupContent(); - this._setupArrangedContent(); - }, + // .......................................................... + // BOOTSTRAP + // - willDestroy: function () { - this._teardownArrangedContent(); - this._teardownContent(); - } - }); + exports.default = Ember; }); -enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/mixins/action_handler', 'ember-runtime/inject'], function (exports, _emberUtils, _emberMetal, _emberRuntimeMixinsAction_handler, _emberRuntimeInject) { - 'no use strict'; - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed +enifed("ember-metal/debug", ["exports"], function (exports) { + "use strict"; - /** - @module ember - @submodule ember-runtime - */ + exports.getDebugFunction = getDebugFunction; + exports.setDebugFunction = setDebugFunction; + exports.assert = assert; + exports.info = info; + exports.warn = warn; + exports.debug = debug; + exports.deprecate = deprecate; + exports.deprecateFunc = deprecateFunc; + exports.runInDebug = runInDebug; + exports.debugSeal = debugSeal; + exports.debugFreeze = debugFreeze; + var debugFunctions = { + assert: function () {}, + info: function () {}, + warn: function () {}, + debug: function () {}, + deprecate: function () {}, + deprecateFunc: function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - // using ember-metal/lib/main here to ensure that ember-debug is setup - // if present + return args[args.length - 1]; + }, + runInDebug: function () {}, + debugSeal: function () {}, + debugFreeze: function () {} + }; - var _Mixin$create; + exports.debugFunctions = debugFunctions; - var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['.'], ['.']); + function getDebugFunction(name) { + return debugFunctions[name]; + } - var schedule = _emberMetal.run.schedule; - var applyMixin = _emberMetal.Mixin._apply; - var finishPartial = _emberMetal.Mixin.finishPartial; - var reopen = _emberMetal.Mixin.prototype.reopen; - var hasCachedComputedProperties = false; + function setDebugFunction(name, fn) { + debugFunctions[name] = fn; + } - var POST_INIT = _emberUtils.symbol('POST_INIT'); + function assert() { + return debugFunctions.assert.apply(undefined, arguments); + } - exports.POST_INIT = POST_INIT; - function makeCtor() { - // Note: avoid accessing any properties on the object since it makes the - // method a lot faster. This is glue code so we want it to be as fast as - // possible. + function info() { + return debugFunctions.info.apply(undefined, arguments); + } - var wasApplied = false; - var initProperties; + function warn() { + return debugFunctions.warn.apply(undefined, arguments); + } - var Class = function () { - if (!wasApplied) { - Class.proto(); // prepare prototype... - } + function debug() { + return debugFunctions.debug.apply(undefined, arguments); + } - if (arguments.length > 0) { - initProperties = [arguments[0]]; - } + function deprecate() { + return debugFunctions.deprecate.apply(undefined, arguments); + } - this.__defineNonEnumerable(_emberUtils.GUID_KEY_PROPERTY); - var m = _emberMetal.meta(this); - var proto = m.proto; - m.proto = this; - if (initProperties) { - // capture locally so we can clear the closed over variable - var props = initProperties; - initProperties = null; + function deprecateFunc() { + return debugFunctions.deprecateFunc.apply(undefined, arguments); + } - var concatenatedProperties = this.concatenatedProperties; - var mergedProperties = this.mergedProperties; + function runInDebug() { + return debugFunctions.runInDebug.apply(undefined, arguments); + } - for (var i = 0; i < props.length; i++) { - var properties = props[i]; + function debugSeal() { + return debugFunctions.debugSeal.apply(undefined, arguments); + } - _emberMetal.assert('Ember.Object.create no longer supports mixing in other ' + 'definitions, use .extend & .create separately instead.', !(properties instanceof _emberMetal.Mixin)); + function debugFreeze() { + return debugFunctions.debugFreeze.apply(undefined, arguments); + } +}); +enifed('ember-metal/dependent_keys', ['exports', 'ember-metal/watching'], function (exports, _emberMetalWatching) { + 'no use strict'; + // Remove "use strict"; from transpiled module until + // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - if (typeof properties !== 'object' && properties !== undefined) { - throw new _emberMetal.Error('Ember.Object.create only accepts objects.'); - } + exports.addDependentKeys = addDependentKeys; + exports.removeDependentKeys = removeDependentKeys; - if (!properties) { - continue; - } + /** + @module ember + @submodule ember-metal + */ - var keyNames = Object.keys(properties); + // .......................................................... + // DEPENDENT KEYS + // - for (var j = 0; j < keyNames.length; j++) { - var keyName = keyNames[j]; - var value = properties[keyName]; + function addDependentKeys(desc, obj, keyName, meta) { + // the descriptor has a list of dependent keys, so + // add all of its dependent keys. + var idx = undefined, + depKey = undefined; + var depKeys = desc._dependentKeys; + if (!depKeys) { + return; + } - if (_emberMetal.detectBinding(keyName)) { - m.writeBindings(keyName, value); - } + for (idx = 0; idx < depKeys.length; idx++) { + depKey = depKeys[idx]; + // Increment the number of times depKey depends on keyName. + meta.writeDeps(depKey, keyName, (meta.peekDeps(depKey, keyName) || 0) + 1); + // Watch the depKey + _emberMetalWatching.watch(obj, depKey, meta); + } + } - var possibleDesc = this[keyName]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; + function removeDependentKeys(desc, obj, keyName, meta) { + // the descriptor has a list of dependent keys, so + // remove all of its dependent keys. + var depKeys = desc._dependentKeys; + if (!depKeys) { + return; + } - _emberMetal.assert('Ember.Object.create no longer supports defining computed ' + 'properties. Define computed properties using extend() or reopen() ' + 'before calling create().', !(value instanceof _emberMetal.ComputedProperty)); - _emberMetal.assert('Ember.Object.create no longer supports defining methods that call _super.', !(typeof value === 'function' && value.toString().indexOf('._super') !== -1)); - _emberMetal.assert('`actions` must be provided at extend time, not at create time, ' + 'when Ember.ActionHandler is used (i.e. views, controllers & routes).', !(keyName === 'actions' && _emberRuntimeMixinsAction_handler.default.detect(this))); + for (var idx = 0; idx < depKeys.length; idx++) { + var depKey = depKeys[idx]; + // Decrement the number of times depKey depends on keyName. + meta.writeDeps(depKey, keyName, (meta.peekDeps(depKey, keyName) || 0) - 1); + // Unwatch the depKey + _emberMetalWatching.unwatch(obj, depKey, meta); + } + } +}); +enifed('ember-metal/deprecate_property', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set) { + /** + @module ember + @submodule ember-metal + */ - if (concatenatedProperties && concatenatedProperties.length > 0 && concatenatedProperties.indexOf(keyName) >= 0) { - var baseValue = this[keyName]; + 'use strict'; - if (baseValue) { - if ('function' === typeof baseValue.concat) { - value = baseValue.concat(value); - } else { - value = _emberUtils.makeArray(baseValue).concat(value); - } - } else { - value = _emberUtils.makeArray(value); - } - } + exports.deprecateProperty = deprecateProperty; - if (mergedProperties && mergedProperties.length && mergedProperties.indexOf(keyName) >= 0) { - var originalValue = this[keyName]; + /** + Used internally to allow changing properties in a backwards compatible way, and print a helpful + deprecation warning. + + @method deprecateProperty + @param {Object} object The object to add the deprecated property to. + @param {String} deprecatedKey The property to add (and print deprecation warnings upon accessing). + @param {String} newKey The property that will be aliased. + @private + @since 1.7.0 + */ - value = _emberUtils.assign({}, originalValue, value); - } + function deprecateProperty(object, deprecatedKey, newKey, options) { + function _deprecate() { + _emberMetalDebug.deprecate('Usage of `' + deprecatedKey + '` is deprecated, use `' + newKey + '` instead.', false, options); + } - if (desc) { - desc.set(this, keyName, value); - } else { - if (typeof this.setUnknownProperty === 'function' && !(keyName in this)) { - this.setUnknownProperty(keyName, value); - } else { - if (true) { - _emberMetal.defineProperty(this, keyName, null, value); // setup mandatory setter - } else { - this[keyName] = value; - } - } - } - } - } + Object.defineProperty(object, deprecatedKey, { + configurable: true, + enumerable: false, + set: function (value) { + _deprecate(); + _emberMetalProperty_set.set(this, newKey, value); + }, + get: function () { + _deprecate(); + return _emberMetalProperty_get.get(this, newKey); } + }); + } +}); +enifed('ember-metal/descriptor', ['exports', 'ember-metal/properties'], function (exports, _emberMetalProperties) { + 'use strict'; - finishPartial(this, m); + exports.default = descriptor; - this.init.apply(this, arguments); + function descriptor(desc) { + return new Descriptor(desc); + } - this[POST_INIT](); + /** + A wrapper for a native ES5 descriptor. In an ideal world, we wouldn't need + this at all, however, the way we currently flatten/merge our mixins require + a special value to denote a descriptor. + + @class Descriptor + @private + */ - m.proto = proto; - _emberMetal.finishChains(this); - _emberMetal.sendEvent(this, 'init'); - }; + var Descriptor = (function (_EmberDescriptor) { + babelHelpers.inherits(Descriptor, _EmberDescriptor); - Class.toString = _emberMetal.Mixin.prototype.toString; - Class.willReopen = function () { - if (wasApplied) { - Class.PrototypeMixin = _emberMetal.Mixin.create(Class.PrototypeMixin); - } + function Descriptor(desc) { + babelHelpers.classCallCheck(this, Descriptor); - wasApplied = false; - }; + _EmberDescriptor.call(this); + this.desc = desc; + } - Class._initProperties = function (args) { - initProperties = args; + Descriptor.prototype.setup = function setup(obj, key) { + Object.defineProperty(obj, key, this.desc); }; - Class.proto = function () { - var superclass = Class.superclass; - if (superclass) { - superclass.proto(); - } - - if (!wasApplied) { - wasApplied = true; - Class.PrototypeMixin.applyPartial(Class.prototype); - } - - return this.prototype; - }; + Descriptor.prototype.teardown = function teardown(obj, key) {}; - return Class; - } + return Descriptor; + })(_emberMetalProperties.Descriptor); +}); +enifed("ember-metal/error", ["exports"], function (exports) { /** - @class CoreObject + A subclass of the JavaScript Error object for use in Ember. + + @class Error @namespace Ember + @extends Error + @constructor @public */ - var CoreObject = makeCtor(); - CoreObject.toString = function () { - return 'Ember.CoreObject'; - }; - CoreObject.PrototypeMixin = _emberMetal.Mixin.create((_Mixin$create = { - reopen: function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } + "use strict"; - applyMixin(this, args, true); - return this; - }, + var EmberError = (function (_Error) { + babelHelpers.inherits(EmberError, _Error); - /** - An overridable method called when objects are instantiated. By default, - does nothing unless it is overridden during class definition. - Example: - ```javascript - const Person = Ember.Object.extend({ - init() { - alert(`Name is ${this.get('name')}`); - } - }); - let steve = Person.create({ - name: "Steve" - }); - // alerts 'Name is Steve'. - ``` - NOTE: If you do override `init` for a framework class like `Ember.View`, - be sure to call `this._super(...arguments)` in your - `init` declaration! If you don't, Ember may not have an opportunity to - do important setup work, and you'll see strange behavior in your - application. - @method init - @public - */ - init: function () {} + function EmberError(message) { + babelHelpers.classCallCheck(this, EmberError); - }, _Mixin$create[POST_INIT] = function () {}, _Mixin$create.__defineNonEnumerable = function (property) { - Object.defineProperty(this, property.name, property.descriptor); - //this[property.name] = property.descriptor.value; - }, _Mixin$create.concatenatedProperties = null, _Mixin$create.mergedProperties = null, _Mixin$create.isDestroyed = _emberMetal.descriptor({ - get: function () { - return _emberMetal.meta(this).isSourceDestroyed(); - }, + _Error.call(this); - set: function (value) { - // prevent setting while applying mixins - if (typeof value === 'object' && value !== null && value.isDescriptor) { - return; + if (!(this instanceof EmberError)) { + return new EmberError(message); } - _emberMetal.assert(('You cannot set `' + this + '.isDestroyed` directly, please use ').destroy()(_templateObject), false); - } - }), _Mixin$create.isDestroying = _emberMetal.descriptor({ - get: function () { - return _emberMetal.meta(this).isSourceDestroying(); - }, + var error = Error.call(this, message); - set: function (value) { - // prevent setting while applying mixins - if (typeof value === 'object' && value !== null && value.isDescriptor) { - return; + if (Error.captureStackTrace) { + Error.captureStackTrace(this, EmberError); + } else { + this.stack = error.stack; } - _emberMetal.assert(('You cannot set `' + this + '.isDestroying` directly, please use ').destroy()(_templateObject), false); - } - }), _Mixin$create.destroy = function () { - var m = _emberMetal.meta(this); - if (m.isSourceDestroying()) { - return; - } - - m.setSourceDestroying(); - - schedule('actions', this, this.willDestroy); - schedule('destroy', this, this._scheduledDestroy, m); - - return this; - }, _Mixin$create.willDestroy = function () {}, _Mixin$create._scheduledDestroy = function (m) { - if (m.isSourceDestroyed()) { - return; - } - _emberMetal.destroy(this); - m.setSourceDestroyed(); - }, _Mixin$create.bind = function (to, from) { - if (!(from instanceof _emberMetal.Binding)) { - from = _emberMetal.Binding.from(from); + this.description = error.description; + this.fileName = error.fileName; + this.lineNumber = error.lineNumber; + this.message = error.message; + this.name = error.name; + this.number = error.number; + this.code = error.code; } - from.to(to).connect(this); - return from; - }, _Mixin$create.toString = function () { - var hasToStringExtension = typeof this.toStringExtension === 'function'; - var extension = hasToStringExtension ? ':' + this.toStringExtension() : ''; - var ret = '<' + this.constructor.toString() + ':' + _emberUtils.guidFor(this) + extension + '>'; - - return ret; - }, _Mixin$create)); - - CoreObject.PrototypeMixin.ownerConstructor = CoreObject; - CoreObject.__super__ = null; + return EmberError; + })(Error); - var ClassMixinProps = { + exports.default = EmberError; +}); +enifed('ember-metal/error_handler', ['exports', 'ember-console', 'ember-metal/testing'], function (exports, _emberConsole, _emberMetalTesting) { + 'use strict'; - ClassMixin: _emberMetal.REQUIRED, + exports.getOnerror = getOnerror; + exports.setOnerror = setOnerror; + exports.dispatchError = dispatchError; + exports.setDispatchOverride = setDispatchOverride; - PrototypeMixin: _emberMetal.REQUIRED, + // To maintain stacktrace consistency across browsers + var getStack = function (error) { + var stack = error.stack; + var message = error.message; - isClass: true, + if (stack && !stack.includes(message)) { + stack = message + '\n' + stack; + } - isMethod: false, - /** - Creates a new subclass. - ```javascript - const Person = Ember.Object.extend({ - say(thing) { - alert(thing); - } - }); - ``` - This defines a new subclass of Ember.Object: `Person`. It contains one method: `say()`. - You can also create a subclass from any existing class by calling its `extend()` method. - For example, you might want to create a subclass of Ember's built-in `Ember.Component` class: - ```javascript - const PersonComponent = Ember.Component.extend({ - tagName: 'li', - classNameBindings: ['isAdministrator'] - }); - ``` - When defining a subclass, you can override methods but still access the - implementation of your parent class by calling the special `_super()` method: - ```javascript - const Person = Ember.Object.extend({ - say(thing) { - var name = this.get('name'); - alert(`${name} says: ${thing}`); - } - }); - const Soldier = Person.extend({ - say(thing) { - this._super(`${thing}, sir!`); - }, - march(numberOfHours) { - alert(`${this.get('name')} marches for ${numberOfHours} hours.`); - } - }); - let yehuda = Soldier.create({ - name: "Yehuda Katz" - }); - yehuda.say("Yes"); // alerts "Yehuda Katz says: Yes, sir!" - ``` - The `create()` on line #17 creates an *instance* of the `Soldier` class. - The `extend()` on line #8 creates a *subclass* of `Person`. Any instance - of the `Person` class will *not* have the `march()` method. - You can also pass `Mixin` classes to add additional properties to the subclass. - ```javascript - const Person = Ember.Object.extend({ - say(thing) { - alert(`${this.get('name')} says: ${thing}`); - } - }); - const SingingMixin = Mixin.create({ - sing(thing){ - alert(`${this.get('name')} sings: la la la ${thing}`); - } - }); - const BroadwayStar = Person.extend(SingingMixin, { - dance() { - alert(`${this.get('name')} dances: tap tap tap tap `); - } - }); - ``` - The `BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`. - @method extend - @static - @param {Mixin} [mixins]* One or more Mixin classes - @param {Object} [arguments]* Object containing values to use within the new class - @public - */ - extend: function () { - var Class = makeCtor(); - var proto; - Class.ClassMixin = _emberMetal.Mixin.create(this.ClassMixin); - Class.PrototypeMixin = _emberMetal.Mixin.create(this.PrototypeMixin); + return stack; + }; - Class.ClassMixin.ownerConstructor = Class; - Class.PrototypeMixin.ownerConstructor = Class; + var onerror = undefined; + // Ember.onerror getter - reopen.apply(Class.PrototypeMixin, arguments); + function getOnerror() { + return onerror; + } - Class.superclass = this; - Class.__super__ = this.prototype; + // Ember.onerror setter - proto = Class.prototype = Object.create(this.prototype); - proto.constructor = Class; - _emberUtils.generateGuid(proto); - _emberMetal.meta(proto).proto = proto; // this will disable observers on prototype + function setOnerror(handler) { + onerror = handler; + } - Class.ClassMixin.apply(Class); - return Class; - }, + var dispatchOverride = undefined; + // dispatch error - /** - Creates an instance of a class. Accepts either no arguments, or an object - containing values to initialize the newly instantiated object with. - ```javascript - const Person = Ember.Object.extend({ - helloWorld() { - alert(`Hi, my name is ${this.get('name')}`); - } - }); - let tom = Person.create({ - name: 'Tom Dale' - }); - tom.helloWorld(); // alerts "Hi, my name is Tom Dale". - ``` - `create` will call the `init` function if defined during - `Ember.AnyObject.extend` - If no arguments are passed to `create`, it will not set values to the new - instance during initialization: - ```javascript - let noName = Person.create(); - noName.helloWorld(); // alerts undefined - ``` - NOTE: For performance reasons, you cannot declare methods or computed - properties during `create`. You should instead declare methods and computed - properties when using `extend`. - @method create - @static - @param [arguments]* - @public - */ - create: function () { - var C = this; + function dispatchError(error) { + if (dispatchOverride) { + dispatchOverride(error); + } else { + defaultDispatch(error); + } + } - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } + // allows testing adapter to override dispatch - if (args.length > 0) { - this._initProperties(args); - } - return new C(); - }, + function setDispatchOverride(handler) { + dispatchOverride = handler; + } - /** - Augments a constructor's prototype with additional - properties and functions: - ```javascript - const MyObject = Ember.Object.extend({ - name: 'an object' - }); - o = MyObject.create(); - o.get('name'); // 'an object' - MyObject.reopen({ - say(msg){ - console.log(msg); - } - }) - o2 = MyObject.create(); - o2.say("hello"); // logs "hello" - o.say("goodbye"); // logs "goodbye" - ``` - To add functions and properties to the constructor itself, - see `reopenClass` - @method reopen - @public - */ - reopen: function () { - this.willReopen(); - reopen.apply(this.PrototypeMixin, arguments); - return this; - }, + function defaultDispatch(error) { + if (_emberMetalTesting.isTesting()) { + throw error; + } + if (onerror) { + onerror(error); + } else { + _emberConsole.default.error(getStack(error)); + } + } +}); +enifed('ember-metal/events', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/meta', 'ember-metal/meta_listeners'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalMeta, _emberMetalMeta_listeners) { + 'no use strict'; + // Remove "use strict"; from transpiled module until + // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - /** - Augments a constructor's own properties and functions: - ```javascript - const MyObject = Ember.Object.extend({ - name: 'an object' - }); - MyObject.reopenClass({ - canBuild: false - }); - MyObject.canBuild; // false - o = MyObject.create(); - ``` - In other words, this creates static properties and functions for the class. - These are only available on the class and not on any instance of that class. - ```javascript - const Person = Ember.Object.extend({ - name: "", - sayHello() { - alert("Hello. My name is " + this.get('name')); - } - }); - Person.reopenClass({ - species: "Homo sapiens", - createPerson(newPersonsName){ - return Person.create({ - name:newPersonsName - }); - } - }); - let tom = Person.create({ - name: "Tom Dale" - }); - let yehuda = Person.createPerson("Yehuda Katz"); - tom.sayHello(); // "Hello. My name is Tom Dale" - yehuda.sayHello(); // "Hello. My name is Yehuda Katz" - alert(Person.species); // "Homo sapiens" - ``` - Note that `species` and `createPerson` are *not* valid on the `tom` and `yehuda` - variables. They are only valid on `Person`. - To add functions and properties to instances of - a constructor by extending the constructor's prototype - see `reopen` - @method reopenClass - @public - */ - reopenClass: function () { - reopen.apply(this.ClassMixin, arguments); - applyMixin(this, arguments, false); - return this; - }, + /** + @module ember + @submodule ember-metal + */ + exports.accumulateListeners = accumulateListeners; + exports.addListener = addListener; + exports.removeListener = removeListener; + exports.suspendListener = suspendListener; + exports.suspendListeners = suspendListeners; + exports.watchedEvents = watchedEvents; + exports.sendEvent = sendEvent; + exports.hasListeners = hasListeners; + exports.listenersFor = listenersFor; + exports.on = on; - detect: function (obj) { - if ('function' !== typeof obj) { - return false; - } - while (obj) { - if (obj === this) { - return true; + /* + The event system uses a series of nested hashes to store listeners on an + object. When a listener is registered, or when an event arrives, these + hashes are consulted to determine which target and action pair to invoke. + + The hashes are stored in the object's meta hash, and look like this: + + // Object's meta hash + { + listeners: { // variable name: `listenerSet` + "foo:changed": [ // variable name: `actions` + target, method, flags + ] + } } - obj = obj.superclass; - } - return false; - }, - - detectInstance: function (obj) { - return obj instanceof this; - }, - - /** - In some cases, you may want to annotate computed properties with additional - metadata about how they function or what values they operate on. For - example, computed property functions may close over variables that are then - no longer available for introspection. - You can pass a hash of these values to a computed property like this: - ```javascript - person: Ember.computed(function() { - var personId = this.get('personId'); - return Person.create({ id: personId }); - }).meta({ type: Person }) - ``` - Once you've done this, you can retrieve the values saved to the computed - property from your class like this: - ```javascript - MyClass.metaForProperty('person'); - ``` - This will return the original hash that was passed to `meta()`. - @static - @method metaForProperty - @param key {String} property name - @private - */ - metaForProperty: function (key) { - var proto = this.proto(); - var possibleDesc = proto[key]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - _emberMetal.assert('metaForProperty() could not find a computed property ' + 'with key \'' + key + '\'.', !!desc && desc instanceof _emberMetal.ComputedProperty); - return desc._meta || {}; - }, - - _computedProperties: _emberMetal.computed(function () { - hasCachedComputedProperties = true; - var proto = this.proto(); - var property; - var properties = []; - - for (var name in proto) { - property = proto[name]; + + */ - if (property && property.isDescriptor) { - properties.push({ - name: name, - meta: property._meta - }); - } + function indexOf(array, target, method) { + var index = -1; + // hashes are added to the end of the event array + // so it makes sense to start searching at the end + // of the array and search in reverse + for (var i = array.length - 3; i >= 0; i -= 3) { + if (target === array[i] && method === array[i + 1]) { + index = i; + break; } - return properties; - }).readOnly(), + } + return index; + } - /** - Iterate over each computed property for the class, passing its name - and any associated metadata (see `metaForProperty`) to the callback. - @static - @method eachComputedProperty - @param {Function} callback - @param {Object} binding - @private - */ - eachComputedProperty: function (callback, binding) { - var property; - var empty = {}; + function accumulateListeners(obj, eventName, otherActions) { + var meta = _emberMetalMeta.peekMeta(obj); + if (!meta) { + return; + } + var actions = meta.matchingListeners(eventName); + var newActions = []; - var properties = _emberMetal.get(this, '_computedProperties'); + for (var i = actions.length - 3; i >= 0; i -= 3) { + var target = actions[i]; + var method = actions[i + 1]; + var flags = actions[i + 2]; + var actionIndex = indexOf(otherActions, target, method); - for (var i = 0; i < properties.length; i++) { - property = properties[i]; - callback.call(binding || this, property.name, property.meta || empty); + if (actionIndex === -1) { + otherActions.push(target, method, flags); + newActions.push(target, method, flags); } } - }; - function injectedPropertyAssertion() { - _emberMetal.assert('Injected properties are invalid', _emberRuntimeInject.validatePropertyInjections(this)); + return newActions; } - _emberMetal.runInDebug(function () { - /** - Provides lookup-time type validation for injected properties. - @private - @method _onLookup - */ - ClassMixinProps._onLookup = injectedPropertyAssertion; - }); - /** - Returns a hash of property names and container names that injected - properties will lookup on the container lazily. + Add an event listener - @method _lazyInjections - @return {Object} Hash of all lazy injected property keys to container names - @private + @method addListener + @for Ember + @param obj + @param {String} eventName + @param {Object|Function} target A target object or a function + @param {Function|String} method A function or the name of a function to be called on `target` + @param {Boolean} once A flag whether a function should only be called once + @public */ - ClassMixinProps._lazyInjections = function () { - var injections = {}; - var proto = this.proto(); - var key, desc; - for (key in proto) { - desc = proto[key]; - if (desc instanceof _emberMetal.InjectedProperty) { - injections[key] = desc.type + ':' + (desc.name || key); - } - } - - return injections; - }; - - var ClassMixin = _emberMetal.Mixin.create(ClassMixinProps); - - ClassMixin.ownerConstructor = CoreObject; - - CoreObject.ClassMixin = ClassMixin; - - ClassMixin.apply(CoreObject); + function addListener(obj, eventName, target, method, once) { + _emberMetalDebug.assert('You must pass at least an object and event name to Ember.addListener', !!obj && !!eventName); - CoreObject.reopen({ - didDefineProperty: function (proto, key, value) { - if (hasCachedComputedProperties === false) { - return; - } - if (value instanceof _emberMetal.ComputedProperty) { - var cache = _emberMetal.meta(this.constructor).readableCache(); + _emberMetalDebug.deprecate('didInitAttrs called in ' + (obj && obj.toString && obj.toString()) + '.', eventName !== 'didInitAttrs', { + id: 'ember-views.did-init-attrs', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x#toc_ember-component-didinitattrs' + }); - if (cache && cache._computedProperties !== undefined) { - cache._computedProperties = undefined; - } - } + if (!method && 'function' === typeof target) { + method = target; + target = null; } - }); - - exports.default = CoreObject; -}); -// Private, and only for didInitAttrs willRecieveAttrs - -/** - 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 - the subclass overrides a property with the same name that is defined - in the superclass. However, there are some cases where it is preferable - to build up a property's value by combining the superclass' property - value with the subclass' value. An example of this in use within Ember - is the `classNames` property of `Ember.View`. - Here is some sample code showing the difference between a concatenated - property and a normal one: - ```javascript - const Bar = Ember.Object.extend({ - // Configure which properties to concatenate - concatenatedProperties: ['concatenatedProperty'], - someNonConcatenatedProperty: ['bar'], - concatenatedProperty: ['bar'] - }); - const FooBar = Bar.extend({ - someNonConcatenatedProperty: ['foo'], - concatenatedProperty: ['foo'] - }); - let fooBar = FooBar.create(); - fooBar.get('someNonConcatenatedProperty'); // ['foo'] - fooBar.get('concatenatedProperty'); // ['bar', 'foo'] - ``` - This behavior extends to object creation as well. Continuing the - above example: - ```javascript - let fooBar = FooBar.create({ - someNonConcatenatedProperty: ['baz'], - concatenatedProperty: ['baz'] - }) - fooBar.get('someNonConcatenatedProperty'); // ['baz'] - fooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz'] - ``` - Adding a single property that is not an array will just add it in the array: - ```javascript - let fooBar = FooBar.create({ - concatenatedProperty: 'baz' - }) - view.get('concatenatedProperty'); // ['bar', 'foo', 'baz'] - ``` - Using the `concatenatedProperties` property, we can tell Ember to mix the - content of the properties. - In `Ember.Component` the `classNames`, `classNameBindings` and - `attributeBindings` properties are concatenated. - This feature is available for you to use throughout the Ember object model, - although typical app developers are likely to use it infrequently. Since - it changes expectations about behavior of properties, you should properly - document its usage in each individual concatenated property (to not - mislead your users to think they can override the property in a subclass). - @property concatenatedProperties - @type Array - @default null - @public -*/ -/** - Defines the properties that will be merged from the superclass - (instead of overridden). - By default, when you extend an Ember class a property defined in - the subclass overrides a property with the same name that is defined - in the superclass. However, there are some cases where it is preferable - to build up a property's value by merging the superclass property value - with the subclass property's value. An example of this in use within Ember - is the `queryParams` property of routes. - Here is some sample code showing the difference between a merged - property and a normal one: - ```javascript - const Bar = Ember.Object.extend({ - // Configure which properties are to be merged - mergedProperties: ['mergedProperty'], - someNonMergedProperty: { - nonMerged: 'superclass value of nonMerged' - }, - mergedProperty: { - page: {replace: false}, - limit: {replace: true} - } - }); - const FooBar = Bar.extend({ - someNonMergedProperty: { - completelyNonMerged: 'subclass value of nonMerged' - }, - mergedProperty: { - limit: {replace: false} + var flags = 0; + if (once) { + flags |= _emberMetalMeta_listeners.ONCE; } - }); - let fooBar = FooBar.create(); - fooBar.get('someNonMergedProperty'); - // => { completelyNonMerged: 'subclass value of nonMerged' } - // - // Note the entire object, including the nonMerged property of - // the superclass object, has been replaced - fooBar.get('mergedProperty'); - // => { - // page: {replace: false}, - // limit: {replace: false} - // } - // - // Note the page remains from the superclass, and the - // `limit` property's value of `false` has been merged from - // the subclass. - ``` - This behavior is not available during object `create` calls. It is only - available at `extend` time. - In `Ember.Route` the `queryParams` property is merged. - This feature is available for you to use throughout the Ember object model, - although typical app developers are likely to use it infrequently. Since - it changes expectations about behavior of properties, you should properly - document its usage in each individual merged property (to not - mislead your users to think they can override the property in a subclass). - @property mergedProperties - @type Array - @default null - @public -*/ - -/** - Destroyed object property flag. - if this property is `true` the observers and bindings were already - removed by the effect of calling the `destroy()` method. - @property isDestroyed - @default false - @public -*/ -/** - Destruction scheduled flag. The `destroy()` method has been called. - The object stays intact until the end of the run loop at which point - the `isDestroyed` flag is set. - @property isDestroying - @default false - @public -*/ + _emberMetalMeta.meta(obj).addToListeners(eventName, target, method, flags); -/** - Destroys an object by setting the `isDestroyed` flag and removing its - metadata, which effectively destroys observers and bindings. - If you try to set a property on a destroyed object, an exception will be - raised. - Note that destruction is scheduled for the end of the run loop and does not - happen immediately. It will set an isDestroying flag immediately. - @method destroy - @return {Ember.Object} receiver - @public -*/ + if ('function' === typeof obj.didAddListener) { + obj.didAddListener(eventName, target, method); + } + } -/** - Override to implement teardown. - @method willDestroy - @public -*/ + /** + Remove an event listener + + Arguments should match those passed to `Ember.addListener`. + + @method removeListener + @for Ember + @param obj + @param {String} eventName + @param {Object|Function} target A target object or a function + @param {Function|String} method A function or the name of a function to be called on `target` + @public + */ -/** - Invoked by the run loop to actually destroy the object. This is - scheduled for execution by the `destroy` method. - @private - @method _scheduledDestroy -*/ + function removeListener(obj, eventName, target, method) { + _emberMetalDebug.assert('You must pass at least an object and event name to Ember.removeListener', !!obj && !!eventName); -/** - Returns a string representation which attempts to provide more information - than Javascript's `toString` typically does, in a generic way for all Ember - objects. - ```javascript - const Person = Ember.Object.extend() - person = Person.create() - person.toString() //=> "" - ``` - If the object's class is not defined on an Ember namespace, it will - indicate it is a subclass of the registered superclass: - ```javascript - const Student = Person.extend() - let student = Student.create() - student.toString() //=> "<(subclass of Person):ember1025>" - ``` - If the method `toStringExtension` is defined, its return value will be - included in the output. - ```javascript - const Teacher = Person.extend({ - toStringExtension() { - return this.get('fullName'); + if (!method && 'function' === typeof target) { + method = target; + target = null; } - }); - teacher = Teacher.create() - teacher.toString(); //=> "" - ``` - @method toString - @return {String} string representation - @public -*/ -enifed('ember-runtime/system/each_proxy', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/mixins/array'], function (exports, _emberUtils, _emberMetal, _emberRuntimeMixinsArray) { - 'use strict'; - exports.default = EachProxy; + _emberMetalMeta.meta(obj).removeFromListeners(eventName, target, method, function () { + if ('function' === typeof obj.didRemoveListener) { + obj.didRemoveListener.apply(obj, arguments); + } + }); + } /** - 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 + Suspend listener during callback. + + This should only be used by the target of the event listener + when it is taking an action that would cause the event, e.g. + an object might suspend its property change listener while it is + setting that property. + + @method suspendListener + @for Ember + @private + @param obj + @param {String} eventName + @param {Object|Function} target A target object or a function + @param {Function|String} method A function or the name of a function to be called on `target` + @param {Function} callback */ - function EachProxy(content) { - this._content = content; - this._keys = undefined; - this.__ember_meta__ = null; + function suspendListener(obj, eventName, target, method, callback) { + return suspendListeners(obj, [eventName], target, method, callback); } - EachProxy.prototype = { - __defineNonEnumerable: function (property) { - this[property.name] = property.descriptor.value; - }, + /** + Suspends multiple listeners during a callback. + + @method suspendListeners + @for Ember + + @private + @param obj + @param {Array} eventNames Array of event names + @param {Object|Function} target A target object or a function + @param {Function|String} method A function or the name of a function to be called on `target` + @param {Function} callback + */ - // .......................................................... - // ARRAY CHANGES - // Invokes whenever the content array itself changes. + function suspendListeners(obj, eventNames, target, method, callback) { + if (!method && 'function' === typeof target) { + method = target; + target = null; + } + return _emberMetalMeta.meta(obj).suspendListeners(eventNames, target, method, callback); + } - arrayWillChange: function (content, idx, removedCnt, addedCnt) { - var keys = this._keys; - var lim = removedCnt > 0 ? idx + removedCnt : -1; - for (var key in keys) { - if (lim > 0) { - removeObserverForContentKey(content, key, this, idx, lim); - } - _emberMetal.propertyWillChange(this, key); - } - }, + /** + Return a list of currently watched events + + @private + @method watchedEvents + @for Ember + @param obj + */ - arrayDidChange: function (content, idx, removedCnt, addedCnt) { - var keys = this._keys; - var lim = addedCnt > 0 ? idx + addedCnt : -1; - for (var key in keys) { - if (lim > 0) { - addObserverForContentKey(content, key, this, idx, lim); - } - _emberMetal.propertyDidChange(this, key); - } - }, + function watchedEvents(obj) { + return _emberMetalMeta.meta(obj).watchedEvents(); + } - // .......................................................... - // LISTEN FOR NEW OBSERVERS AND OTHER EVENT LISTENERS - // Start monitoring keys based on who is listening... + /** + Send an event. The execution of suspended listeners + is skipped, and once listeners are removed. A listener without + a target is executed on the passed object. If an array of actions + is not passed, the actions stored on the passed object are invoked. + + @method sendEvent + @for Ember + @param obj + @param {String} eventName + @param {Array} params Optional parameters for each listener. + @param {Array} actions Optional array of actions (listeners). + @return true + @public + */ - willWatchProperty: function (property) { - this.beginObservingContentKey(property); - }, + function sendEvent(obj, eventName, params, actions) { + if (!actions) { + var meta = _emberMetalMeta.peekMeta(obj); + actions = meta && meta.matchingListeners(eventName); + } - didUnwatchProperty: function (property) { - this.stopObservingContentKey(property); - }, + if (!actions || actions.length === 0) { + return; + } - // .......................................................... - // CONTENT KEY OBSERVING - // Actual watch keys on the source content. + for (var i = actions.length - 3; i >= 0; i -= 3) { + // looping in reverse for once listeners + var target = actions[i]; + var method = actions[i + 1]; + var flags = actions[i + 2]; - beginObservingContentKey: function (keyName) { - var keys = this._keys; - if (!keys) { - keys = this._keys = new _emberUtils.EmptyObject(); + if (!method) { + continue; } - - if (!keys[keyName]) { - keys[keyName] = 1; - var content = this._content; - var len = _emberMetal.get(content, 'length'); - - addObserverForContentKey(content, keyName, this, 0, len); - } else { - keys[keyName]++; + if (flags & _emberMetalMeta_listeners.SUSPENDED) { + continue; } - }, - - stopObservingContentKey: function (keyName) { - var keys = this._keys; - if (keys && keys[keyName] > 0 && --keys[keyName] <= 0) { - var content = this._content; - var len = _emberMetal.get(content, 'length'); - - removeObserverForContentKey(content, keyName, this, 0, len); + if (flags & _emberMetalMeta_listeners.ONCE) { + removeListener(obj, eventName, target, method); } - }, - - contentKeyWillChange: function (obj, keyName) { - _emberMetal.propertyWillChange(this, keyName); - }, - - contentKeyDidChange: function (obj, keyName) { - _emberMetal.propertyDidChange(this, keyName); - } - }; - - function addObserverForContentKey(content, keyName, proxy, idx, loc) { - while (--loc >= idx) { - var item = _emberRuntimeMixinsArray.objectAt(content, loc); - if (item) { - _emberMetal.assert('When using @each to observe the array ' + content + ', the array must return an object', typeof item === 'object'); - _emberMetal._addBeforeObserver(item, keyName, proxy, 'contentKeyWillChange'); - _emberMetal.addObserver(item, keyName, proxy, 'contentKeyDidChange'); + if (!target) { + target = obj; } - } - } - - function removeObserverForContentKey(content, keyName, proxy, idx, loc) { - while (--loc >= idx) { - var item = _emberRuntimeMixinsArray.objectAt(content, loc); - if (item) { - _emberMetal._removeBeforeObserver(item, keyName, proxy, 'contentKeyWillChange'); - _emberMetal.removeObserver(item, keyName, proxy, 'contentKeyDidChange'); + if ('string' === typeof method) { + if (params) { + _emberUtils.applyStr(target, method, params); + } else { + target[method](); + } + } else { + if (params) { + method.apply(target, params); + } else { + method.call(target); + } } } + return true; } -}); -enifed('ember-runtime/system/lazy_load', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { - /*globals CustomEvent */ - - 'use strict'; - - exports.onLoad = onLoad; - exports.runLoadHooks = runLoadHooks; /** - @module ember - @submodule ember-runtime + @private + @method hasListeners + @for Ember + @param obj + @param {String} eventName */ - var loadHooks = _emberEnvironment.ENV.EMBER_LOAD_HOOKS || {}; - var loaded = {}; - var _loaded = loaded; + function hasListeners(obj, eventName) { + var meta = _emberMetalMeta.peekMeta(obj); + if (!meta) { + return false; + } + return meta.matchingListeners(eventName).length > 0; + } - 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 - resolved from a string into the object: - - ``` javascript - Ember.onLoad('Ember.Application' function(hbars) { - hbars.registerHelper(...); - }); - ``` - - @method onLoad - @for Ember - @param name {String} name of hook - @param callback {Function} callback to be called @private + @method listenersFor + @for Ember + @param obj + @param {String} eventName */ - function onLoad(name, callback) { - var object = loaded[name]; + function listenersFor(obj, eventName) { + var ret = []; + var meta = _emberMetalMeta.peekMeta(obj); + var actions = meta && meta.matchingListeners(eventName); - loadHooks[name] = loadHooks[name] || []; - loadHooks[name].push(callback); + if (!actions) { + return ret; + } - if (object) { - callback(object); + for (var i = 0; i < actions.length; i += 3) { + var target = actions[i]; + var method = actions[i + 1]; + ret.push([target, method]); } + + return ret; } /** - Called when an Ember.js package (e.g Ember.Application) has finished - loading. Triggers any callbacks registered for this event. + Define a property as a function that should be executed when + a specified event or events are triggered. - @method runLoadHooks + + ``` javascript + let Job = Ember.Object.extend({ + logCompleted: Ember.on('completed', function() { + console.log('Job completed!'); + }) + }); + + let job = Job.create(); + + Ember.sendEvent(job, 'completed'); // Logs 'Job completed!' + ``` + + @method on @for Ember - @param name {String} name of hook - @param object {Object} object to pass to callbacks - @private + @param {String} eventNames* + @param {Function} func + @return func + @public */ - function runLoadHooks(name, object) { - loaded[name] = object; - var window = _emberEnvironment.environment.window; - - if (window && typeof CustomEvent === 'function') { - var _event = new CustomEvent(name, { detail: object, name: name }); - window.dispatchEvent(_event); + function on() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } - if (loadHooks[name]) { - loadHooks[name].forEach(function (callback) { - return callback(object); - }); - } + var func = args.pop(); + var events = args; + func.__ember_listens__ = events; + return func; } }); -enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal', 'ember-environment', 'ember-runtime/system/object'], function (exports, _emberUtils, _emberMetal, _emberEnvironment, _emberRuntimeSystemObject) { - /** - @module ember - @submodule ember-runtime - */ +enifed('ember-metal/expand_properties', ['exports', 'ember-metal/debug'], function (exports, _emberMetalDebug) { 'use strict'; - exports.isSearchDisabled = isSearchDisabled; - exports.setSearchDisabled = setSearchDisabled; - - var searchDisabled = false; + exports.default = expandProperties; - function isSearchDisabled() { - return searchDisabled; - } + /** + @module ember + @submodule ember-metal + */ - function setSearchDisabled(flag) { - searchDisabled = !!flag; - } + var SPLIT_REGEX = /\{|\}/; + var END_WITH_EACH_REGEX = /\.@each$/; /** - 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. + Expands `pattern`, invoking `callback` for each expansion. - # Example Usage + The only pattern supported is brace-expansion, anything else will be passed + once to `callback` directly. - ```javascript - MyFramework = Ember.Namespace.create({ - VERSION: '1.0.0' - }); + Example + + ```js + function echo(arg){ console.log(arg); } + + 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}.[]', 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' ``` - @class Namespace - @namespace Ember - @extends Ember.Object - @public + @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. */ - var Namespace = _emberRuntimeSystemObject.default.extend({ - isNamespace: true, - init: function () { - Namespace.NAMESPACES.push(this); - Namespace.PROCESSED = false; - }, + function expandProperties(pattern, callback) { + _emberMetalDebug.assert('A computed property key must be a string', typeof pattern === 'string'); + _emberMetalDebug.assert('Brace expanded properties cannot contain spaces, e.g. "user.{firstName, lastName}" should be "user.{firstName,lastName}"', pattern.indexOf(' ') === -1); + _emberMetalDebug.assert('Brace expanded properties have to be balanced and cannot be nested, pattern: ' + pattern, (function (str) { + var inBrace = 0; + var char = undefined; + for (var i = 0; i < str.length; i++) { + char = str.charAt(i); - toString: function () { - var name = _emberMetal.get(this, 'name') || _emberMetal.get(this, 'modulePrefix'); - if (name) { - return name; - } + if (char === '{') { + inBrace++; + } else if (char === '}') { + inBrace--; + } - findNamespaces(); - return this[_emberMetal.NAME_KEY]; - }, + if (inBrace > 1 || inBrace < 0) { + return false; + } + } - nameClasses: function () { - processNamespace([this.toString()], this, {}); - }, + return true; + })(pattern)); - destroy: function () { - var namespaces = Namespace.NAMESPACES; - var toString = this.toString(); + var parts = pattern.split(SPLIT_REGEX); + var properties = [parts]; - if (toString) { - _emberEnvironment.context.lookup[toString] = undefined; - delete Namespace.NAMESPACES_BY_ID[toString]; + for (var i = 0; i < parts.length; i++) { + var part = parts[i]; + if (part.indexOf(',') >= 0) { + properties = duplicateAndReplace(properties, part.split(','), i); } - namespaces.splice(namespaces.indexOf(this), 1); - this._super.apply(this, arguments); } - }); - - Namespace.reopenClass({ - NAMESPACES: [_emberMetal.default], - NAMESPACES_BY_ID: { - Ember: _emberMetal.default - }, - PROCESSED: false, - processAll: processAllNamespaces, - byName: function (name) { - if (!searchDisabled) { - processAllNamespaces(); - } - return NAMESPACES_BY_ID[name]; + for (var i = 0; i < properties.length; i++) { + callback(properties[i].join('').replace(END_WITH_EACH_REGEX, '.[]')); } - }); - - var NAMESPACES_BY_ID = Namespace.NAMESPACES_BY_ID; + } - var hasOwnProp = ({}).hasOwnProperty; + function duplicateAndReplace(properties, currentParts, index) { + var all = []; - function processNamespace(paths, root, seen) { - var idx = paths.length; + properties.forEach(function (property) { + currentParts.forEach(function (part) { + var current = property.slice(0); + current[index] = part; + all.push(current); + }); + }); - NAMESPACES_BY_ID[paths.join('.')] = root; + return all; + } +}); +enifed('ember-metal/features', ['exports', 'ember-utils', 'ember-environment', 'ember/features'], function (exports, _emberUtils, _emberEnvironment, _emberFeatures) { + 'use strict'; - // Loop over all of the keys in the namespace, looking for classes - for (var key in root) { - if (!hasOwnProp.call(root, key)) { - continue; - } - var obj = root[key]; + exports.default = isEnabled; - // If we are processing the `Ember` namespace, for example, the - // `paths` will start with `["Ember"]`. Every iteration through - // the loop will update the **second** element of this list with - // the key, so processing `Ember.View` will make the Array - // `['Ember', 'View']`. - paths[idx] = key; + /** + The hash of enabled Canary features. Add to this, any canary features + before creating your application. + + Alternatively (and recommended), you can also define `EmberENV.FEATURES` + if you need to enable features flagged at runtime. + + @class FEATURES + @namespace Ember + @static + @since 1.1.0 + @public + */ + var FEATURES = _emberUtils.assign(_emberFeatures.default, _emberEnvironment.ENV.FEATURES); - // If we have found an unprocessed class - if (obj && obj.toString === classToString && !obj[_emberMetal.NAME_KEY]) { - // Replace the class' `toString` with the dot-separated path - // and set its `NAME_KEY` - obj[_emberMetal.NAME_KEY] = paths.join('.'); + exports.FEATURES = FEATURES; + /** + Determine whether the specified `feature` is enabled. Used by Ember's + build tools to exclude experimental features from beta/stable builds. + + You can define the following configuration options: + + * `EmberENV.ENABLE_OPTIONAL_FEATURES` - enable any features that have not been explicitly + enabled/disabled. + + @method isEnabled + @param {String} feature The feature to check + @return {Boolean} + @for Ember.FEATURES + @since 1.1.0 + @public + */ - // Support nested namespaces - } else if (obj && obj.isNamespace) { - // Skip aliased namespaces - if (seen[_emberUtils.guidFor(obj)]) { - continue; - } - seen[_emberUtils.guidFor(obj)] = true; + function isEnabled(feature) { + var featureValue = FEATURES[feature]; - // Process the child namespace - processNamespace(paths, obj, seen); - } + if (featureValue === true || featureValue === false || featureValue === undefined) { + return featureValue; + } else if (_emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES) { + return true; + } else { + return false; } - - paths.length = idx; // cut out last item } - function isUppercase(code) { - return code >= 65 && // A - code <= 90; // Z - } + exports.DEFAULT_FEATURES = _emberFeatures.default; +}); +enifed('ember-metal/get_properties', ['exports', 'ember-metal/property_get'], function (exports, _emberMetalProperty_get) { + 'use strict'; - function tryIsNamespace(lookup, prop) { - try { - var obj = lookup[prop]; - return obj && obj.isNamespace && obj; - } catch (e) { - // continue - } - } + exports.default = getProperties; - function findNamespaces() { - if (Namespace.PROCESSED) { - return; - } - var lookup = _emberEnvironment.context.lookup; - var keys = Object.keys(lookup); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - // Only process entities that start with uppercase A-Z - if (!isUppercase(key.charCodeAt(0))) { - continue; - } - var obj = tryIsNamespace(lookup, key); - if (obj) { - obj[_emberMetal.NAME_KEY] = key; - } - } - } + /** + To get multiple properties at once, call `Ember.getProperties` + with an object followed by a list of strings or an array: + + ```javascript + Ember.getProperties(record, 'firstName', 'lastName', 'zipCode'); + // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } + ``` + + is equivalent to: + + ```javascript + Ember.getProperties(record, ['firstName', 'lastName', 'zipCode']); + // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } + ``` + + @method getProperties + @for Ember + @param {Object} obj + @param {String...|Array} list of keys to get + @return {Object} + @public + */ - function superClassString(mixin) { - var superclass = mixin.superclass; - if (superclass) { - if (superclass[_emberMetal.NAME_KEY]) { - return superclass[_emberMetal.NAME_KEY]; - } - return superClassString(superclass); - } - } + function getProperties(obj) { + var ret = {}; + var propertyNames = arguments; + var i = 1; - function classToString() { - if (!searchDisabled && !this[_emberMetal.NAME_KEY]) { - processAllNamespaces(); + if (arguments.length === 2 && Array.isArray(arguments[1])) { + i = 0; + propertyNames = arguments[1]; } - - var ret = undefined; - - if (this[_emberMetal.NAME_KEY]) { - ret = this[_emberMetal.NAME_KEY]; - } else if (this._toString) { - ret = this._toString; - } else { - var str = superClassString(this); - if (str) { - ret = '(subclass of ' + str + ')'; - } else { - ret = '(unknown mixin)'; - } - this.toString = makeToString(ret); + for (; i < propertyNames.length; i++) { + ret[propertyNames[i]] = _emberMetalProperty_get.get(obj, propertyNames[i]); } - return ret; } +}); +enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/merge', 'ember-metal/debug', 'ember-metal/instrumentation', 'ember-metal/testing', 'ember-metal/error_handler', 'ember-metal/meta', 'ember-metal/error', 'ember-metal/cache', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/weak_map', 'ember-metal/events', 'ember-metal/is_none', 'ember-metal/is_empty', 'ember-metal/is_blank', 'ember-metal/is_present', 'ember-metal/run_loop', 'ember-metal/observer_set', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/watch_key', 'ember-metal/chains', 'ember-metal/watch_path', 'ember-metal/watching', 'ember-metal/libraries', 'ember-metal/map', 'ember-metal/get_properties', 'ember-metal/set_properties', 'ember-metal/expand_properties', 'ember-metal/observer', 'ember-metal/mixin', 'ember-metal/binding', 'ember-metal/path_cache', 'ember-metal/injected_property', 'ember-metal/tags', 'ember-metal/replace', 'ember-metal/transaction', 'ember-metal/is_proxy', 'ember-metal/descriptor'], function (exports, _require, _emberMetalCore, _emberMetalComputed, _emberMetalAlias, _emberMetalMerge, _emberMetalDebug, _emberMetalInstrumentation, _emberMetalTesting, _emberMetalError_handler, _emberMetalMeta, _emberMetalError, _emberMetalCache, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalWeak_map, _emberMetalEvents, _emberMetalIs_none, _emberMetalIs_empty, _emberMetalIs_blank, _emberMetalIs_present, _emberMetalRun_loop, _emberMetalObserver_set, _emberMetalProperty_events, _emberMetalProperties, _emberMetalWatch_key, _emberMetalChains, _emberMetalWatch_path, _emberMetalWatching, _emberMetalLibraries, _emberMetalMap, _emberMetalGet_properties, _emberMetalSet_properties, _emberMetalExpand_properties, _emberMetalObserver, _emberMetalMixin, _emberMetalBinding, _emberMetalPath_cache, _emberMetalInjected_property, _emberMetalTags, _emberMetalReplace, _emberMetalTransaction, _emberMetalIs_proxy, _emberMetalDescriptor) { + /** + @module ember + @submodule ember-metal + */ - function processAllNamespaces() { - var unprocessedNamespaces = !Namespace.PROCESSED; - var unprocessedMixins = _emberMetal.hasUnprocessedMixins(); - - if (unprocessedNamespaces) { - findNamespaces(); - Namespace.PROCESSED = true; - } - - if (unprocessedNamespaces || unprocessedMixins) { - var namespaces = Namespace.NAMESPACES; - var namespace = undefined; + 'use strict'; - for (var i = 0; i < namespaces.length; i++) { - namespace = namespaces[i]; - processNamespace([namespace.toString()], namespace, {}); - } + exports.default = _emberMetalCore.default; + // reexports + exports.computed = _emberMetalComputed.default; + exports.cacheFor = _emberMetalComputed.cacheFor; + exports.ComputedProperty = _emberMetalComputed.ComputedProperty; + exports.alias = _emberMetalAlias.default; + exports.merge = _emberMetalMerge.default; + exports.assert = _emberMetalDebug.assert; + exports.info = _emberMetalDebug.info; + exports.warn = _emberMetalDebug.warn; + exports.debug = _emberMetalDebug.debug; + exports.deprecate = _emberMetalDebug.deprecate; + exports.deprecateFunc = _emberMetalDebug.deprecateFunc; + exports.runInDebug = _emberMetalDebug.runInDebug; + exports.setDebugFunction = _emberMetalDebug.setDebugFunction; + exports.getDebugFunction = _emberMetalDebug.getDebugFunction; + exports.debugSeal = _emberMetalDebug.debugSeal; + exports.debugFreeze = _emberMetalDebug.debugFreeze; + exports.instrument = _emberMetalInstrumentation.instrument; + exports.flaggedInstrument = _emberMetalInstrumentation.flaggedInstrument; + exports._instrumentStart = _emberMetalInstrumentation._instrumentStart; + exports.instrumentationReset = _emberMetalInstrumentation.reset; + exports.instrumentationSubscribe = _emberMetalInstrumentation.subscribe; + exports.instrumentationUnsubscribe = _emberMetalInstrumentation.unsubscribe; + exports.isTesting = _emberMetalTesting.isTesting; + exports.setTesting = _emberMetalTesting.setTesting; + exports.getOnerror = _emberMetalError_handler.getOnerror; + exports.setOnerror = _emberMetalError_handler.setOnerror; + exports.dispatchError = _emberMetalError_handler.dispatchError; + exports.setDispatchOverride = _emberMetalError_handler.setDispatchOverride; + exports.META_DESC = _emberMetalMeta.META_DESC; + exports.meta = _emberMetalMeta.meta; + exports.peekMeta = _emberMetalMeta.peekMeta; + exports.Error = _emberMetalError.default; + exports.Cache = _emberMetalCache.default; + exports.isFeatureEnabled = _emberMetalFeatures.default; + exports.FEATURES = _emberMetalFeatures.FEATURES; + exports.DEFAULT_FEATURES = _emberMetalFeatures.DEFAULT_FEATURES; + exports._getPath = _emberMetalProperty_get._getPath; + exports.get = _emberMetalProperty_get.get; + exports.getWithDefault = _emberMetalProperty_get.getWithDefault; + exports.set = _emberMetalProperty_set.set; + exports.trySet = _emberMetalProperty_set.trySet; + exports.WeakMap = _emberMetalWeak_map.default; + exports.accumulateListeners = _emberMetalEvents.accumulateListeners; + exports.addListener = _emberMetalEvents.addListener; + exports.hasListeners = _emberMetalEvents.hasListeners; + exports.listenersFor = _emberMetalEvents.listenersFor; + exports.on = _emberMetalEvents.on; + exports.removeListener = _emberMetalEvents.removeListener; + exports.sendEvent = _emberMetalEvents.sendEvent; + exports.suspendListener = _emberMetalEvents.suspendListener; + exports.suspendListeners = _emberMetalEvents.suspendListeners; + exports.watchedEvents = _emberMetalEvents.watchedEvents; + exports.isNone = _emberMetalIs_none.default; + exports.isEmpty = _emberMetalIs_empty.default; + exports.isBlank = _emberMetalIs_blank.default; + exports.isPresent = _emberMetalIs_present.default; + exports.run = _emberMetalRun_loop.default; + exports.ObserverSet = _emberMetalObserver_set.default; + exports.beginPropertyChanges = _emberMetalProperty_events.beginPropertyChanges; + exports.changeProperties = _emberMetalProperty_events.changeProperties; + exports.endPropertyChanges = _emberMetalProperty_events.endPropertyChanges; + exports.overrideChains = _emberMetalProperty_events.overrideChains; + exports.propertyDidChange = _emberMetalProperty_events.propertyDidChange; + exports.propertyWillChange = _emberMetalProperty_events.propertyWillChange; + exports.PROPERTY_DID_CHANGE = _emberMetalProperty_events.PROPERTY_DID_CHANGE; + exports.defineProperty = _emberMetalProperties.defineProperty; + exports.Descriptor = _emberMetalProperties.Descriptor; + exports.watchKey = _emberMetalWatch_key.watchKey; + exports.unwatchKey = _emberMetalWatch_key.unwatchKey; + exports.ChainNode = _emberMetalChains.ChainNode; + exports.finishChains = _emberMetalChains.finishChains; + exports.removeChainWatcher = _emberMetalChains.removeChainWatcher; + exports.watchPath = _emberMetalWatch_path.watchPath; + exports.unwatchPath = _emberMetalWatch_path.unwatchPath; + exports.destroy = _emberMetalWatching.destroy; + exports.isWatching = _emberMetalWatching.isWatching; + exports.unwatch = _emberMetalWatching.unwatch; + exports.watch = _emberMetalWatching.watch; + exports.watcherCount = _emberMetalWatching.watcherCount; + exports.libraries = _emberMetalLibraries.default; + exports.Map = _emberMetalMap.Map; + exports.MapWithDefault = _emberMetalMap.MapWithDefault; + exports.OrderedSet = _emberMetalMap.OrderedSet; + exports.getProperties = _emberMetalGet_properties.default; + exports.setProperties = _emberMetalSet_properties.default; + exports.expandProperties = _emberMetalExpand_properties.default; + exports._suspendObserver = _emberMetalObserver._suspendObserver; + exports._suspendObservers = _emberMetalObserver._suspendObservers; + exports.addObserver = _emberMetalObserver.addObserver; + exports.observersFor = _emberMetalObserver.observersFor; + exports.removeObserver = _emberMetalObserver.removeObserver; + exports._addBeforeObserver = _emberMetalObserver._addBeforeObserver; + exports._removeBeforeObserver = _emberMetalObserver._removeBeforeObserver; + exports.Mixin = _emberMetalMixin.Mixin; + exports.aliasMethod = _emberMetalMixin.aliasMethod; + exports._immediateObserver = _emberMetalMixin._immediateObserver; + exports._beforeObserver = _emberMetalMixin._beforeObserver; + exports.mixin = _emberMetalMixin.mixin; + exports.observer = _emberMetalMixin.observer; + exports.required = _emberMetalMixin.required; + exports.REQUIRED = _emberMetalMixin.REQUIRED; + exports.hasUnprocessedMixins = _emberMetalMixin.hasUnprocessedMixins; + exports.clearUnprocessedMixins = _emberMetalMixin.clearUnprocessedMixins; + exports.detectBinding = _emberMetalMixin.detectBinding; + exports.Binding = _emberMetalBinding.Binding; + exports.bind = _emberMetalBinding.bind; + exports.isGlobalPath = _emberMetalPath_cache.isGlobalPath; + exports.InjectedProperty = _emberMetalInjected_property.default; + exports.setHasViews = _emberMetalTags.setHasViews; + exports.tagForProperty = _emberMetalTags.tagForProperty; + exports.tagFor = _emberMetalTags.tagFor; + exports.markObjectAsDirty = _emberMetalTags.markObjectAsDirty; + exports.replace = _emberMetalReplace.default; + exports.runInTransaction = _emberMetalTransaction.default; + exports.didRender = _emberMetalTransaction.didRender; + exports.assertNotRendered = _emberMetalTransaction.assertNotRendered; + exports.isProxy = _emberMetalIs_proxy.isProxy; + exports.descriptor = _emberMetalDescriptor.default; - _emberMetal.clearUnprocessedMixins(); - } - } + // TODO: this needs to be deleted once we refactor the build tooling + // do this for side-effects of updating Ember.assert, warn, etc when + // ember-debug is present + // This needs to be called before any deprecateFunc - function makeToString(ret) { - return function () { - return ret; - }; + if (_require.has('ember-debug')) { + _require.default('ember-debug'); } - - _emberMetal.Mixin.prototype.toString = classToString; // ES6TODO: altering imported objects. SBB. - - exports.default = Namespace; }); -// Preloaded into namespaces -enifed('ember-runtime/system/native_array', ['exports', 'ember-metal', 'ember-environment', '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, _emberMetal, _emberEnvironment, _emberRuntimeMixinsArray, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsObservable, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsFreezable, _emberRuntimeCopy) { - /** - @module ember - @submodule ember-runtime - */ +enifed('ember-metal/injected_property', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/properties'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalComputed, _emberMetalAlias, _emberMetalProperties) { '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. + exports.default = InjectedProperty; /** - The NativeArray mixin contains the properties needed to make the native - Array support Ember.MutableArray and all of its dependent APIs. Unless you - have `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Array` set to - false, this will be applied automatically. Otherwise you can apply the mixin - at anytime by calling `Ember.NativeArray.apply(Array.prototype)`. + Read-only property that returns the result of a container lookup. - @class NativeArray + @class InjectedProperty @namespace Ember - @uses Ember.MutableArray - @uses Ember.Observable - @uses Ember.Copyable - @public + @constructor + @param {String} type The container type the property will lookup + @param {String} name (optional) The name the property will lookup, defaults + to the property's name + @private */ - var NativeArray = _emberMetal.Mixin.create(_emberRuntimeMixinsMutable_array.default, _emberRuntimeMixinsObservable.default, _emberRuntimeMixinsCopyable.default, { - - // because length is a built-in property we need to know to just get the - // original property. - get: function (key) { - if ('number' === typeof key) { - return this[key]; - } else { - return this._super(key); - } - }, - - objectAt: function (idx) { - return this[idx]; - }, - - // primitive for array support. - replace: function (idx, amt, objects) { - if (this.isFrozen) { - throw _emberRuntimeMixinsFreezable.FROZEN_ERROR; - } - - // if we replaced exactly the same number of items, then pass only the - // replaced range. Otherwise, pass the full remaining array length - // since everything has shifted - var len = objects ? _emberMetal.get(objects, 'length') : 0; - _emberRuntimeMixinsArray.arrayContentWillChange(this, idx, amt, len); - - if (len === 0) { - this.splice(idx, amt); - } else { - _emberMetal.replace(this, idx, amt, objects); - } - _emberRuntimeMixinsArray.arrayContentDidChange(this, idx, amt, len); - return this; - }, - - // If you ask for an unknown property, then try to collect the value - // from member items. - unknownProperty: function (key, value) { - var ret = undefined; // = this.reducedProperty(key, value); - if (value !== undefined && ret === undefined) { - ret = this[key] = value; - } - return ret; - }, + function InjectedProperty(type, name) { + this.type = type; + this.name = name; - indexOf: Array.prototype.indexOf, - lastIndexOf: Array.prototype.lastIndexOf, + this._super$Constructor(injectedPropertyGet); + AliasedPropertyPrototype.oneWay.call(this); + } - copy: function (deep) { - if (deep) { - return this.map(function (item) { - return _emberRuntimeCopy.default(item, true); - }); - } + function injectedPropertyGet(keyName) { + var desc = this[keyName]; + var owner = _emberUtils.getOwner(this) || this.container; // fallback to `container` for backwards compat - return this.slice(); - } - }); + _emberMetalDebug.assert('InjectedProperties should be defined with the Ember.inject computed property macros.', desc && desc.isDescriptor && desc.type); + _emberMetalDebug.assert('Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container.', owner); - // Remove any methods implemented natively so we don't override them - var ignore = ['length']; - NativeArray.keys().forEach(function (methodName) { - if (Array.prototype[methodName]) { - ignore.push(methodName); - } - }); + return owner.lookup(desc.type + ':' + (desc.name || keyName)); + } - exports.NativeArray // TODO: only use default export - = NativeArray = NativeArray.without.apply(NativeArray, ignore); + InjectedProperty.prototype = Object.create(_emberMetalProperties.Descriptor.prototype); - /** - Creates an `Ember.NativeArray` from an Array like object. - Does not modify the original object. Ember.A is not needed if - `EmberENV.EXTEND_PROTOTYPES` is `true` (the default value). However, - it is recommended that you use Ember.A when creating addons for - ember or when you can not guarantee that `EmberENV.EXTEND_PROTOTYPES` - will be `true`. - - Example - - ```js - export default Ember.Component.extend({ - tagName: 'ul', - classNames: ['pagination'], - - init() { - this._super(...arguments); - - if (!this.get('content')) { - this.set('content', Ember.A()); - } - } - }); - ``` - - @method A - @for Ember - @return {Ember.NativeArray} - @public - */ - var A = undefined; + var InjectedPropertyPrototype = InjectedProperty.prototype; + var ComputedPropertyPrototype = _emberMetalComputed.ComputedProperty.prototype; + var AliasedPropertyPrototype = _emberMetalAlias.AliasedProperty.prototype; - if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.Array) { - NativeArray.apply(Array.prototype); - exports.A = A = function (arr) { - return arr || []; - }; - } else { - exports.A = A = function (arr) { - if (!arr) { - arr = []; - } - return _emberRuntimeMixinsArray.default.detect(arr) ? arr : NativeArray.apply(arr); - }; - } + InjectedPropertyPrototype._super$Constructor = _emberMetalComputed.ComputedProperty; - _emberMetal.default.A = A; - exports.A = A; - exports.NativeArray = NativeArray; - exports.default = NativeArray; + InjectedPropertyPrototype.get = ComputedPropertyPrototype.get; + InjectedPropertyPrototype.readOnly = ComputedPropertyPrototype.readOnly; + InjectedPropertyPrototype.teardown = ComputedPropertyPrototype.teardown; }); -// Ember.A circular -enifed('ember-runtime/system/object', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/system/core_object', 'ember-runtime/mixins/observable'], function (exports, _emberUtils, _emberMetal, _emberRuntimeSystemCore_object, _emberRuntimeMixinsObservable) { - /** - @module ember - @submodule ember-runtime - */ +enifed('ember-metal/instrumentation', ['exports', 'ember-environment', 'ember-metal/features'], function (exports, _emberEnvironment, _emberMetalFeatures) { + /* eslint no-console:off */ + /* global console */ '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. - - @class Object - @namespace Ember - @extends Ember.CoreObject - @uses Ember.Observable - @public - */ - var EmberObject = _emberRuntimeSystemCore_object.default.extend(_emberRuntimeMixinsObservable.default); - EmberObject.toString = function () { - return 'Ember.Object'; - }; - - var FrameworkObject = EmberObject; - - exports.FrameworkObject = FrameworkObject; - _emberMetal.runInDebug(function () { - var _EmberObject$extend; - - var INIT_WAS_CALLED = _emberUtils.symbol('INIT_WAS_CALLED'); - var ASSERT_INIT_WAS_CALLED = _emberUtils.symbol('ASSERT_INIT_WAS_CALLED'); - - exports.FrameworkObject = FrameworkObject = EmberObject.extend((_EmberObject$extend = { - init: function () { - this._super.apply(this, arguments); - this[INIT_WAS_CALLED] = true; - } - - }, _EmberObject$extend[ASSERT_INIT_WAS_CALLED] = _emberMetal.on('init', function () { - _emberMetal.assert('You must call `this._super(...arguments);` when overriding `init` on a framework object. Please update ' + this + ' to call `this._super(...arguments);` from `init`.', this[INIT_WAS_CALLED]); - }), _EmberObject$extend)); - }); - - exports.default = EmberObject; -}); -enifed('ember-runtime/system/object_proxy', ['exports', 'ember-runtime/system/object', 'ember-runtime/mixins/-proxy'], function (exports, _emberRuntimeSystemObject, _emberRuntimeMixinsProxy) { - 'use strict'; + exports.instrument = instrument; + exports._instrumentStart = _instrumentStart; + exports.subscribe = subscribe; + exports.unsubscribe = unsubscribe; + exports.reset = reset; /** - `Ember.ObjectProxy` forwards all properties not defined by the proxy itself - to a proxied `content` object. - - ```javascript - object = Ember.Object.create({ - name: 'Foo' - }); + The purpose of the Ember Instrumentation module is + to provide efficient, general-purpose instrumentation + for Ember. - proxy = Ember.ObjectProxy.create({ - content: object - }); + Subscribe to a listener by using `Ember.subscribe`: - // Access and change existing properties - proxy.get('name') // 'Foo' - proxy.set('name', 'Bar'); - object.get('name') // 'Bar' + ```javascript + Ember.subscribe("render", { + before(name, timestamp, payload) { - // Create new 'description' property on `object` - proxy.set('description', 'Foo is a whizboo baz'); - object.get('description') // 'Foo is a whizboo baz' - ``` + }, - While `content` is unset, setting a property to be delegated will throw an - Error. + after(name, timestamp, payload) { - ```javascript - proxy = Ember.ObjectProxy.create({ - content: null, - flag: null + } }); - proxy.set('flag', true); - proxy.get('flag'); // true - proxy.get('foo'); // undefined - proxy.set('foo', 'data'); // throws Error ``` - Delegated properties can be bound to and will change when content is updated. + If you return a value from the `before` callback, that same + value will be passed as a fourth parameter to the `after` + callback. - Computed properties on the proxy itself can depend on delegated properties. + Instrument a block of code by using `Ember.instrument`: ```javascript - ProxyWithComputedProperty = Ember.ObjectProxy.extend({ - fullName: Ember.computed('firstName', 'lastName', function() { - var firstName = this.get('firstName'), - lastName = this.get('lastName'); - if (firstName && lastName) { - return firstName + ' ' + lastName; - } - return firstName || lastName; - }) - }); - - proxy = ProxyWithComputedProperty.create(); + Ember.instrument("render.handlebars", payload, function() { + // rendering logic + }, binding); + ``` - proxy.get('fullName'); // undefined - proxy.set('content', { - firstName: 'Tom', lastName: 'Dale' - }); // triggers property change for fullName on proxy + Event names passed to `Ember.instrument` are namespaced + by periods, from more general to more specific. Subscribers + can listen for events by whatever level of granularity they + are interested in. - proxy.get('fullName'); // 'Tom Dale' - ``` + In the above example, the event is `render.handlebars`, + and the subscriber listened for all events beginning with + `render`. It would receive callbacks for events named + `render`, `render.handlebars`, `render.container`, or + even `render.handlebars.layout`. - @class ObjectProxy + @class Instrumentation @namespace Ember - @extends Ember.Object - @extends Ember._ProxyMixin - @public + @static + @private */ + var subscribers = []; + exports.subscribers = subscribers; + var cache = {}; - 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'; + function populateListeners(name) { + var listeners = []; + var subscriber = undefined; - /** - 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. - - Example: - - ```javascript - App.ApplicationRoute = Ember.Route.extend({ - authManager: Ember.inject.service('auth'), - - model: function() { - return this.get('authManager').findCurrentUser(); + for (var i = 0; i < subscribers.length; i++) { + subscriber = subscribers[i]; + if (subscriber.regex.test(name)) { + listeners.push(subscriber.object); } - }); - ``` + } + + cache[name] = listeners; + return listeners; + } + + var time = (function () { + var perf = 'undefined' !== typeof window ? window.performance || {} : {}; + var fn = perf.now || perf.mozNow || perf.webkitNow || perf.msNow || perf.oNow; + // fn.bind will be available in all the browsers that support the advanced window.performance... ;-) + return fn ? fn.bind(perf) : function () { + return +new Date(); + }; + })(); + + /** + Notifies event's subscribers, calls `before` and `after` hooks. - This example will create an `authManager` property on the application route - that looks up the `auth` service in the container, making it easily - accessible in the `model` hook. + @method instrument + @namespace Ember.Instrumentation - @method service - @since 1.10.0 - @for Ember.inject - @param {String} name (optional) name of the service to inject, defaults to - the property's name - @return {Ember.InjectedProperty} injection descriptor instance - @public + @param {String} [name] Namespaced event name. + @param {Object} _payload + @param {Function} callback Function that you're instrumenting. + @param {Object} binding Context that instrument function is called with. + @private */ - _emberRuntimeInject.createInjectionHelper('service'); - /** - @class Service - @namespace Ember - @extends Ember.Object - @since 1.10.0 - @public - */ - var Service = _emberRuntimeSystemObject.default.extend(); + function instrument(name, _payload, callback, binding) { + if (arguments.length <= 3 && typeof _payload === 'function') { + binding = callback; + callback = _payload; + _payload = undefined; + } + if (subscribers.length === 0) { + return callback.call(binding); + } + var payload = _payload || {}; + var finalizer = _instrumentStart(name, function () { + return payload; + }); - Service.reopenClass({ - isServiceFactory: true - }); + if (finalizer) { + return withFinalizer(callback, finalizer, payload, binding); + } else { + return callback.call(binding); + } + } - exports.default = Service; -}); -enifed('ember-runtime/system/string', ['exports', 'ember-metal', 'ember-utils', 'ember-runtime/utils', 'ember-runtime/string_registry'], function (exports, _emberMetal, _emberUtils, _emberRuntimeUtils, _emberRuntimeString_registry) { - /** - @module ember - @submodule ember-runtime - */ - 'use strict'; + var flaggedInstrument = undefined; + if (_emberMetalFeatures.default('ember-improved-instrumentation')) { + exports.flaggedInstrument = flaggedInstrument = instrument; + } else { + exports.flaggedInstrument = flaggedInstrument = function (name, payload, callback) { + return callback(); + }; + } + exports.flaggedInstrument = flaggedInstrument; - var STRING_DASHERIZE_REGEXP = /[ _]/g; + function withFinalizer(callback, finalizer, payload, binding) { + var result = undefined; + try { + result = callback.call(binding); + } catch (e) { + payload.exception = e; + result = payload; + } finally { + finalizer(); + } + return result; + } - var STRING_DASHERIZE_CACHE = new _emberMetal.Cache(1000, function (key) { - return decamelize(key).replace(STRING_DASHERIZE_REGEXP, '-'); - }); + function NOOP() {} - var STRING_CAMELIZE_REGEXP_1 = /(\-|\_|\.|\s)+(.)?/g; - var STRING_CAMELIZE_REGEXP_2 = /(^|\/)([A-Z])/g; + // private for now - var CAMELIZE_CACHE = new _emberMetal.Cache(1000, function (key) { - return key.replace(STRING_CAMELIZE_REGEXP_1, function (match, separator, chr) { - return chr ? chr.toUpperCase() : ''; - }).replace(STRING_CAMELIZE_REGEXP_2, function (match, separator, chr) { - return match.toLowerCase(); - }); - }); + function _instrumentStart(name, _payload, _payloadParam) { + if (subscribers.length === 0) { + return NOOP; + } - var STRING_CLASSIFY_REGEXP_1 = /^(\-|_)+(.)?/; - var STRING_CLASSIFY_REGEXP_2 = /(.)(\-|\_|\.|\s)+(.)?/g; - var STRING_CLASSIFY_REGEXP_3 = /(^|\/|\.)([a-z])/g; + var listeners = cache[name]; - var CLASSIFY_CACHE = new _emberMetal.Cache(1000, function (str) { - var replace1 = function (match, separator, chr) { - return chr ? '_' + chr.toUpperCase() : ''; - }; - var replace2 = function (match, initialChar, separator, chr) { - return initialChar + (chr ? chr.toUpperCase() : ''); - }; - var parts = str.split('/'); - for (var i = 0; i < parts.length; i++) { - parts[i] = parts[i].replace(STRING_CLASSIFY_REGEXP_1, replace1).replace(STRING_CLASSIFY_REGEXP_2, replace2); + if (!listeners) { + listeners = populateListeners(name); } - return parts.join('/').replace(STRING_CLASSIFY_REGEXP_3, function (match, separator, chr) { - return match.toUpperCase(); - }); - }); - var STRING_UNDERSCORE_REGEXP_1 = /([a-z\d])([A-Z]+)/g; - var STRING_UNDERSCORE_REGEXP_2 = /\-|\s+/g; + if (listeners.length === 0) { + return NOOP; + } - var UNDERSCORE_CACHE = new _emberMetal.Cache(1000, function (str) { - return str.replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2').replace(STRING_UNDERSCORE_REGEXP_2, '_').toLowerCase(); - }); + var payload = _payload(_payloadParam); - var STRING_CAPITALIZE_REGEXP = /(^|\/)([a-z])/g; + var STRUCTURED_PROFILE = _emberEnvironment.ENV.STRUCTURED_PROFILE; + var timeName = undefined; + if (STRUCTURED_PROFILE) { + timeName = name + ': ' + payload.object; + console.time(timeName); + } - var CAPITALIZE_CACHE = new _emberMetal.Cache(1000, function (str) { - return str.replace(STRING_CAPITALIZE_REGEXP, function (match, separator, chr) { - return match.toUpperCase(); - }); - }); + var beforeValues = new Array(listeners.length); + var i = undefined, + listener = undefined; + var timestamp = time(); + for (i = 0; i < listeners.length; i++) { + listener = listeners[i]; + beforeValues[i] = listener.before(name, timestamp, payload); + } - var STRING_DECAMELIZE_REGEXP = /([a-z\d])([A-Z])/g; + return function _instrumentEnd() { + var i = undefined, + listener = undefined; + var timestamp = time(); + for (i = 0; i < listeners.length; i++) { + listener = listeners[i]; + if (typeof listener.after === 'function') { + listener.after(name, timestamp, payload, beforeValues[i]); + } + } - var DECAMELIZE_CACHE = new _emberMetal.Cache(1000, function (str) { - return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase(); - }); + if (STRUCTURED_PROFILE) { + console.timeEnd(timeName); + } + }; + } - function _fmt(str, formats) { - var cachedFormats = formats; + /** + Subscribes to a particular event or instrumented block of code. + + @method subscribe + @namespace Ember.Instrumentation + + @param {String} [pattern] Namespaced event name. + @param {Object} [object] Before and After hooks. + + @return {Subscriber} + @private + */ - if (!_emberRuntimeUtils.isArray(cachedFormats) || arguments.length > 2) { - cachedFormats = new Array(arguments.length - 1); + function subscribe(pattern, object) { + var paths = pattern.split('.'); + var path = undefined; + var regex = []; - for (var i = 1; i < arguments.length; i++) { - cachedFormats[i - 1] = arguments[i]; + for (var i = 0; i < paths.length; i++) { + path = paths[i]; + if (path === '*') { + regex.push('[^\\.]*'); + } else { + regex.push(path); } } - // first, replace any ORDERED replacements. - var idx = 0; // the current index for non-numerical replacements - return str.replace(/%@([0-9]+)?/g, function (s, argIndex) { - argIndex = argIndex ? parseInt(argIndex, 10) - 1 : idx++; - s = cachedFormats[argIndex]; - return s === null ? '(null)' : s === undefined ? '' : _emberUtils.inspect(s); - }); - } + regex = regex.join('\\.'); + regex = regex + '(\\..*)?'; - function fmt(str, formats) { - _emberMetal.deprecate('Ember.String.fmt is deprecated, use ES6 template strings instead.', false, { id: 'ember-string-utils.fmt', until: '3.0.0', url: 'http://babeljs.io/docs/learn-es2015/#template-strings' }); - return _fmt.apply(undefined, arguments); - } + var subscriber = { + pattern: pattern, + regex: new RegExp('^' + regex + '$'), + object: object + }; - function loc(str, formats) { - if (!_emberRuntimeUtils.isArray(formats) || arguments.length > 2) { - formats = Array.prototype.slice.call(arguments, 1); - } + subscribers.push(subscriber); + cache = {}; - str = _emberRuntimeString_registry.get(str) || str; - return _fmt(str, formats); + return subscriber; } - function w(str) { - return str.split(/\s+/); - } + /** + Unsubscribes from a particular event or instrumented block of code. + + @method unsubscribe + @namespace Ember.Instrumentation + + @param {Object} [subscriber] + @private + */ - function decamelize(str) { - return DECAMELIZE_CACHE.get(str); - } + function unsubscribe(subscriber) { + var index = undefined; - function dasherize(str) { - return STRING_DASHERIZE_CACHE.get(str); - } + for (var i = 0; i < subscribers.length; i++) { + if (subscribers[i] === subscriber) { + index = i; + } + } - function camelize(str) { - return CAMELIZE_CACHE.get(str); + subscribers.splice(index, 1); + cache = {}; } - function classify(str) { - return CLASSIFY_CACHE.get(str); - } + /** + Resets `Ember.Instrumentation` by flushing list of subscribers. + + @method reset + @namespace Ember.Instrumentation + @private + */ - function underscore(str) { - return UNDERSCORE_CACHE.get(str); + function reset() { + subscribers.length = 0; + cache = {}; } +}); +enifed('ember-metal/is_blank', ['exports', 'ember-metal/is_empty'], function (exports, _emberMetalIs_empty) { + 'use strict'; - function capitalize(str) { - return CAPITALIZE_CACHE.get(str); - } + exports.default = isBlank; /** - Defines string helper methods including string formatting and localization. - Unless `EmberENV.EXTEND_PROTOTYPES.String` is `false` these methods will also be - added to the `String.prototype` as well. + A value is blank if it is empty or a whitespace string. - @class String - @namespace Ember - @static + ```javascript + Ember.isBlank(); // true + Ember.isBlank(null); // true + Ember.isBlank(undefined); // true + Ember.isBlank(''); // true + Ember.isBlank([]); // true + Ember.isBlank('\n\t'); // true + Ember.isBlank(' '); // true + Ember.isBlank({}); // false + Ember.isBlank('\n\t Hello'); // false + Ember.isBlank('Hello world'); // false + Ember.isBlank([1,2,3]); // false + ``` + + @method isBlank + @for Ember + @param {Object} obj Value to test + @return {Boolean} + @since 1.5.0 @public */ - exports.default = { - /** - Apply formatting options to the string. This will look for occurrences - of "%@" in your string and substitute them with the arguments you pass into - this method. If you want to control the specific order of replacement, - you can add a number after the key as well to indicate which argument - you want to insert. - Ordered insertions are most useful when building loc strings where values - you need to insert may appear in different orders. - ```javascript - "Hello %@ %@".fmt('John', 'Doe'); // "Hello John Doe" - "Hello %@2, %@1".fmt('John', 'Doe'); // "Hello Doe, John" - ``` - @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: http://babeljs.io/docs/learn-es2015/#template-strings - */ - fmt: fmt, - - /** - Formats the passed string, but first looks up the string in the localized - strings hash. This is a convenient way to localize text. See - `Ember.String.fmt()` for more information on formatting. - Note that it is traditional but not required to prefix localized string - keys with an underscore or other character so you can easily identify - localized strings. - ```javascript - Ember.STRINGS = { - '_Hello World': 'Bonjour le monde', - '_Hello %@ %@': 'Bonjour %@ %@' - }; - Ember.String.loc("_Hello World"); // 'Bonjour le monde'; - Ember.String.loc("_Hello %@ %@", ["John", "Smith"]); // "Bonjour John Smith"; - ``` - @method loc - @param {String} str The string to format - @param {Array} formats Optional array of parameters to interpolate into string. - @return {String} formatted string - @public - */ - loc: loc, - - /** - Splits a string into separate units separated by spaces, eliminating any - empty strings in the process. This is a convenience method for split that - is mostly useful when applied to the `String.prototype`. - ```javascript - Ember.String.w("alpha beta gamma").forEach(function(key) { - console.log(key); - }); - // > alpha - // > beta - // > gamma - ``` - @method w - @param {String} str The string to split - @return {Array} array containing the split strings - @public - */ - w: w, - - /** - Converts a camelized string into all lower case separated by underscores. - ```javascript - 'innerHTML'.decamelize(); // 'inner_html' - 'action_name'.decamelize(); // 'action_name' - 'css-class-name'.decamelize(); // 'css-class-name' - 'my favorite items'.decamelize(); // 'my favorite items' - ``` - @method decamelize - @param {String} str The string to decamelize. - @return {String} the decamelized string. - @public - */ - decamelize: decamelize, - - /** - Replaces underscores, spaces, or camelCase with dashes. - ```javascript - 'innerHTML'.dasherize(); // 'inner-html' - 'action_name'.dasherize(); // 'action-name' - 'css-class-name'.dasherize(); // 'css-class-name' - 'my favorite items'.dasherize(); // 'my-favorite-items' - 'privateDocs/ownerInvoice'.dasherize(); // 'private-docs/owner-invoice' - ``` - @method dasherize - @param {String} str The string to dasherize. - @return {String} the dasherized string. - @public - */ - dasherize: dasherize, - - /** - Returns the lowerCamelCase form of a string. - ```javascript - 'innerHTML'.camelize(); // 'innerHTML' - 'action_name'.camelize(); // 'actionName' - 'css-class-name'.camelize(); // 'cssClassName' - 'my favorite items'.camelize(); // 'myFavoriteItems' - 'My Favorite Items'.camelize(); // 'myFavoriteItems' - 'private-docs/owner-invoice'.camelize(); // 'privateDocs/ownerInvoice' - ``` - @method camelize - @param {String} str The string to camelize. - @return {String} the camelized string. - @public - */ - camelize: camelize, - - /** - Returns the UpperCamelCase form of a string. - ```javascript - 'innerHTML'.classify(); // 'InnerHTML' - 'action_name'.classify(); // 'ActionName' - 'css-class-name'.classify(); // 'CssClassName' - 'my favorite items'.classify(); // 'MyFavoriteItems' - 'private-docs/owner-invoice'.classify(); // 'PrivateDocs/OwnerInvoice' - ``` - @method classify - @param {String} str the string to classify - @return {String} the classified string - @public - */ - classify: classify, - - /** - More general than decamelize. Returns the lower\_case\_and\_underscored - form of a string. - ```javascript - 'innerHTML'.underscore(); // 'inner_html' - 'action_name'.underscore(); // 'action_name' - 'css-class-name'.underscore(); // 'css_class_name' - 'my favorite items'.underscore(); // 'my_favorite_items' - 'privateDocs/ownerInvoice'.underscore(); // 'private_docs/owner_invoice' - ``` - @method underscore - @param {String} str The string to underscore. - @return {String} the underscored string. - @public - */ - underscore: underscore, - /** - Returns the Capitalized form of a string - ```javascript - 'innerHTML'.capitalize() // 'InnerHTML' - 'action_name'.capitalize() // 'Action_name' - 'css-class-name'.capitalize() // 'Css-class-name' - 'my favorite items'.capitalize() // 'My favorite items' - 'privateDocs/ownerInvoice'.capitalize(); // 'PrivateDocs/ownerInvoice' - ``` - @method capitalize - @param {String} str The string to capitalize. - @return {String} The capitalized string. - @public - */ - capitalize: capitalize - }; - exports.fmt = fmt; - exports.loc = loc; - exports.w = w; - exports.decamelize = decamelize; - exports.dasherize = dasherize; - exports.camelize = camelize; - exports.classify = classify; - exports.underscore = underscore; - exports.capitalize = capitalize; + function isBlank(obj) { + return _emberMetalIs_empty.default(obj) || typeof obj === 'string' && obj.match(/\S/) === null; + } }); -enifed('ember-runtime/utils', ['exports', 'ember-runtime/mixins/array', 'ember-runtime/system/object'], function (exports, _emberRuntimeMixinsArray, _emberRuntimeSystemObject) { +enifed('ember-metal/is_empty', ['exports', 'ember-metal/property_get', 'ember-metal/is_none'], function (exports, _emberMetalProperty_get, _emberMetalIs_none) { 'use strict'; - exports.isArray = isArray; - exports.typeOf = typeOf; - - // ........................................ - // TYPING & ARRAY MESSAGING - // - var TYPE_MAP = { - '[object Boolean]': 'boolean', - '[object Number]': 'number', - '[object String]': 'string', - '[object Function]': 'function', - '[object Array]': 'array', - '[object Date]': 'date', - '[object RegExp]': 'regexp', - '[object Object]': 'object', - '[object FileList]': 'filelist' - }; - - var toString = Object.prototype.toString; + exports.default = isEmpty; /** - Returns true if the passed object is an array or Array-like. - - Objects are considered Array-like if any of the following are true: - - - the object is a native Array - - the object has an objectAt property - - the object is an Object, and has a length property + Verifies that a value is `null` or an empty string, empty array, + or empty function. - Unlike `Ember.typeOf` this method returns true even if the passed object is - not formally an array but appears to be array-like (i.e. implements `Ember.Array`) + Constrains the rules on `Ember.isNone` by returning true for empty + string and empty arrays. ```javascript - Ember.isArray(); // false - Ember.isArray([]); // true - Ember.isArray(Ember.ArrayProxy.create({ content: [] })); // true + Ember.isEmpty(); // true + Ember.isEmpty(null); // true + Ember.isEmpty(undefined); // true + Ember.isEmpty(''); // true + Ember.isEmpty([]); // true + Ember.isEmpty({}); // false + Ember.isEmpty('Adam Hawkins'); // false + Ember.isEmpty([0,1,2]); // false + Ember.isEmpty('\n\t'); // false + Ember.isEmpty(' '); // false ``` - @method isArray + @method isEmpty @for Ember - @param {Object} obj The object to test - @return {Boolean} true if the passed object is an array or Array-like + @param {Object} obj Value to test + @return {Boolean} @public */ - function isArray(obj) { - if (!obj || obj.setInterval) { - return false; + function isEmpty(obj) { + var none = _emberMetalIs_none.default(obj); + if (none) { + return none; } - if (Array.isArray(obj)) { - return true; + + if (typeof obj.size === 'number') { + return !obj.size; } - if (_emberRuntimeMixinsArray.default.detect(obj)) { - return true; + + var objectType = typeof obj; + + if (objectType === 'object') { + var size = _emberMetalProperty_get.get(obj, 'size'); + if (typeof size === 'number') { + return !size; + } } - var type = typeOf(obj); - if ('array' === type) { - return true; + if (typeof obj.length === 'number' && objectType !== 'function') { + return !obj.length; } - if (obj.length !== undefined && 'object' === type) { - return true; + + if (objectType === 'object') { + var _length = _emberMetalProperty_get.get(obj, 'length'); + if (typeof _length === 'number') { + return !_length; + } } + return false; } - +}); +enifed("ember-metal/is_none", ["exports"], function (exports) { /** - Returns a consistent type for the passed object. - - Use this instead of the built-in `typeof` to get the type of an item. - It will return the same result across all browsers and includes a bit - more detail. Here is what will be returned: + Returns true if the passed value is null or undefined. This avoids errors + from JSLint complaining about use of ==, which can be technically + confusing. - | Return Value | Meaning | - |---------------|------------------------------------------------------| - | 'string' | String primitive or String object. | - | 'number' | Number primitive or Number object. | - | 'boolean' | Boolean primitive or Boolean object. | - | 'null' | Null value | - | 'undefined' | Undefined value | - | 'function' | A function | - | 'array' | An instance of Array | - | 'regexp' | An instance of RegExp | - | 'date' | An instance of Date | - | 'filelist' | An instance of FileList | - | 'class' | An Ember class (created using Ember.Object.extend()) | - | 'instance' | An Ember object instance | - | 'error' | An instance of the Error object | - | 'object' | A JavaScript object not inheriting from Ember.Object | + ```javascript + Ember.isNone(); // true + Ember.isNone(null); // true + Ember.isNone(undefined); // true + Ember.isNone(''); // false + Ember.isNone([]); // false + Ember.isNone(function() {}); // false + ``` - Examples: + @method isNone + @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`. ```javascript - Ember.typeOf(); // 'undefined' - Ember.typeOf(null); // 'null' - Ember.typeOf(undefined); // 'undefined' - Ember.typeOf('michael'); // 'string' - Ember.typeOf(new String('michael')); // 'string' - Ember.typeOf(101); // 'number' - Ember.typeOf(new Number(101)); // 'number' - Ember.typeOf(true); // 'boolean' - Ember.typeOf(new Boolean(true)); // 'boolean' - Ember.typeOf(Ember.makeArray); // 'function' - Ember.typeOf([1, 2, 90]); // 'array' - Ember.typeOf(/abc/); // 'regexp' - Ember.typeOf(new Date()); // 'date' - Ember.typeOf(event.target.files); // 'filelist' - Ember.typeOf(Ember.Object.extend()); // 'class' - Ember.typeOf(Ember.Object.create()); // 'instance' - Ember.typeOf(new Error('teamocil')); // 'error' - - // 'normal' JavaScript object - Ember.typeOf({ a: 'b' }); // 'object' + Ember.isPresent(); // false + Ember.isPresent(null); // false + Ember.isPresent(undefined); // false + Ember.isPresent(''); // false + Ember.isPresent(' '); // false + Ember.isPresent('\n\t'); // false + Ember.isPresent([]); // false + Ember.isPresent({ length: 0 }) // false + Ember.isPresent(false); // true + Ember.isPresent(true); // true + Ember.isPresent('string'); // true + Ember.isPresent(0); // true + Ember.isPresent(function() {}) // true + Ember.isPresent({}); // true + Ember.isPresent(false); // true + Ember.isPresent('\n\t Hello'); // true + Ember.isPresent([1,2,3]); // true ``` - @method typeOf + @method isPresent @for Ember - @param {Object} item the item to check - @return {String} the type + @param {Object} obj Value to test + @return {Boolean} + @since 1.8.0 @public */ - function typeOf(item) { - if (item === null) { - return 'null'; - } - if (item === undefined) { - return 'undefined'; - } - var ret = TYPE_MAP[toString.call(item)] || 'object'; + function isPresent(obj) { + return !_emberMetalIs_blank.default(obj); + } +}); +enifed('ember-metal/is_proxy', ['exports', 'ember-metal/meta'], function (exports, _emberMetalMeta) { + 'use strict'; - if (ret === 'function') { - if (_emberRuntimeSystemObject.default.detect(item)) { - ret = 'class'; - } - } else if (ret === 'object') { - if (item instanceof Error) { - ret = 'error'; - } else if (item instanceof _emberRuntimeSystemObject.default) { - ret = 'instance'; - } else if (item instanceof Date) { - ret = 'date'; - } + exports.isProxy = isProxy; + + function isProxy(value) { + if (typeof value === 'object' && value) { + var meta = _emberMetalMeta.peekMeta(value); + return meta && meta.isProxy(); } - return ret; + return false; } }); -enifed('ember-testing/adapters/adapter', ['exports', 'ember-runtime'], function (exports, _emberRuntime) { +enifed('ember-metal/libraries', ['exports', 'ember-metal/debug', 'ember-metal/features'], function (exports, _emberMetalDebug, _emberMetalFeatures) { 'use strict'; - function K() { - return this; - } - - /** - @module ember - @submodule ember-testing - */ - /** - The primary purpose of this class is to create hooks that can be implemented - by an adapter for various test frameworks. + Helper class that allows you to register your library with Ember. - @class Adapter - @namespace Ember.Test - @public + Singleton created at `Ember.libraries`. + + @class Libraries + @constructor + @private */ - exports.default = _emberRuntime.Object.extend({ - /** - This callback will be called whenever an async operation is about to start. - Override this to call your framework's methods that handle async - operations. - @public - @method asyncStart - */ - asyncStart: K, - /** - This callback will be called whenever an async operation has completed. - @public - @method asyncEnd - */ - asyncEnd: K, + var Libraries = (function () { + function Libraries() { + babelHelpers.classCallCheck(this, Libraries); - /** - Override this method with your testing framework's false assertion. - This function is called whenever an exception occurs causing the testing - promise to fail. - QUnit example: - ```javascript - exception: function(error) { - ok(false, error); - }; - ``` - @public - @method exception - @param {String} error The exception to be raised. - */ - exception: function (error) { - throw error; + this._registry = []; + this._coreLibIndex = 0; } - }); -}); -enifed('ember-testing/adapters/qunit', ['exports', 'ember-utils', 'ember-testing/adapters/adapter'], function (exports, _emberUtils, _emberTestingAdaptersAdapter) { - 'use strict'; - /** - This class implements the methods defined by Ember.Test.Adapter for the - QUnit testing framework. - - @class QUnitAdapter - @namespace Ember.Test - @extends Ember.Test.Adapter - @public - */ - exports.default = _emberTestingAdaptersAdapter.default.extend({ - asyncStart: function () { - QUnit.stop(); - }, - asyncEnd: function () { - QUnit.start(); + Libraries.prototype.isRegistered = function isRegistered(name) { + return !!this._getLibraryByName(name); + }; + + return Libraries; + })(); + + exports.Libraries = Libraries; + + Libraries.prototype = { + constructor: Libraries, + + _getLibraryByName: function (name) { + var libs = this._registry; + var count = libs.length; + + for (var i = 0; i < count; i++) { + if (libs[i].name === name) { + return libs[i]; + } + } }, - exception: function (error) { - ok(false, _emberUtils.inspect(error)); - } - }); -}); -enifed('ember-testing/events', ['exports', 'ember-views', 'ember-metal'], function (exports, _emberViews, _emberMetal) { - 'use strict'; - exports.focus = focus; - exports.fireEvent = fireEvent; + register: function (name, version, isCoreLibrary) { + var index = this._registry.length; - var DEFAULT_EVENT_OPTIONS = { canBubble: true, cancelable: true }; - var KEYBOARD_EVENT_TYPES = ['keydown', 'keypress', 'keyup']; - var MOUSE_EVENT_TYPES = ['click', 'mousedown', 'mouseup', 'dblclick', 'mouseenter', 'mouseleave', 'mousemove', 'mouseout', 'mouseover']; + if (!this._getLibraryByName(name)) { + if (isCoreLibrary) { + index = this._coreLibIndex++; + } + this._registry.splice(index, 0, { name: name, version: version }); + } else { + _emberMetalDebug.warn('Library "' + name + '" is already registered with Ember.', false, { id: 'ember-metal.libraries-register' }); + } + }, - function focus(el) { - if (!el) { - return; - } - var $el = _emberViews.jQuery(el); - if ($el.is(':input, [contenteditable=true]')) { - var type = $el.prop('type'); - if (type !== 'checkbox' && type !== 'radio' && type !== 'hidden') { - _emberMetal.run(null, function () { - // Firefox does not trigger the `focusin` event if the window - // does not have focus. If the document doesn't have focus just - // use trigger('focusin') instead. + registerCoreLibrary: function (name, version) { + this.register(name, version, true); + }, - if (!document.hasFocus || document.hasFocus()) { - el.focus(); - } else { - $el.trigger('focusin'); - } - }); + deRegister: function (name) { + var lib = this._getLibraryByName(name); + var index = undefined; + + if (lib) { + index = this._registry.indexOf(lib); + this._registry.splice(index, 1); } } + }; + + if (_emberMetalFeatures.default('ember-libraries-isregistered')) { + Libraries.prototype.isRegistered = function (name) { + return !!this._getLibraryByName(name); + }; } - function fireEvent(element, type) { - var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + exports.default = new Libraries(); +}); +enifed('ember-metal/map', ['exports', 'ember-utils'], function (exports, _emberUtils) { + /** + @module ember + @submodule ember-metal + */ - if (!element) { - return; - } - var event = undefined; - if (KEYBOARD_EVENT_TYPES.indexOf(type) > -1) { - event = buildKeyboardEvent(type, options); - } else if (MOUSE_EVENT_TYPES.indexOf(type) > -1) { - var rect = element.getBoundingClientRect(); - var x = rect.left + 1; - var y = rect.top + 1; - var simulatedCoordinates = { - screenX: x + 5, - screenY: y + 95, - clientX: x, - clientY: y - }; - event = buildMouseEvent(type, _emberViews.jQuery.extend(simulatedCoordinates, options)); - } else { - event = buildBasicEvent(type, options); - } - element.dispatchEvent(event); - } + /* + 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 buildBasicEvent(type) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + function missingFunction(fn) { + throw new TypeError(Object.prototype.toString.call(fn) + ' is not a function'); + } - var event = document.createEvent('Events'); - event.initEvent(type, true, true); - _emberViews.jQuery.extend(event, options); - return event; + function missingNew(name) { + throw new TypeError('Constructor ' + name + ' requires \'new\''); } - function buildMouseEvent(type) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + function copyNull(obj) { + var output = new _emberUtils.EmptyObject(); - var event = undefined; - try { - event = document.createEvent('MouseEvents'); - var eventOpts = _emberViews.jQuery.extend({}, DEFAULT_EVENT_OPTIONS, options); - event.initMouseEvent(type, eventOpts.canBubble, eventOpts.cancelable, window, eventOpts.detail, eventOpts.screenX, eventOpts.screenY, eventOpts.clientX, eventOpts.clientY, eventOpts.ctrlKey, eventOpts.altKey, eventOpts.shiftKey, eventOpts.metaKey, eventOpts.button, eventOpts.relatedTarget); - } catch (e) { - event = buildBasicEvent(type, options); + for (var prop in obj) { + // hasOwnPropery is not needed because obj is new EmptyObject(); + output[prop] = obj[prop]; } - return event; + + return output; } - function buildKeyboardEvent(type) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + function copyMap(original, newObject) { + var keys = original._keys.copy(); + var values = copyNull(original._values); - var event = undefined; - try { - event = document.createEvent('KeyEvents'); - var eventOpts = _emberViews.jQuery.extend({}, DEFAULT_EVENT_OPTIONS, options); - event.initKeyEvent(type, eventOpts.canBubble, eventOpts.cancelable, window, eventOpts.ctrlKey, eventOpts.altKey, eventOpts.shiftKey, eventOpts.metaKey, eventOpts.keyCode, eventOpts.charCode); - } catch (e) { - event = buildBasicEvent(type, options); + newObject._keys = keys; + newObject._values = values; + newObject.size = original.size; + + return newObject; + } + + /** + This class is used internally by Ember and Ember Data. + Please do not use it at this time. We plan to clean it up + and add many tests soon. + + @class OrderedSet + @namespace Ember + @constructor + @private + */ + function OrderedSet() { + if (this instanceof OrderedSet) { + this.clear(); + this._silenceRemoveDeprecation = false; + } else { + missingNew('OrderedSet'); } - return event; } -}); -enifed('ember-testing/ext/application', ['exports', 'ember-application', 'ember-testing/setup_for_testing', 'ember-testing/test/helpers', 'ember-testing/test/promise', 'ember-testing/test/run', 'ember-testing/test/on_inject_helpers', 'ember-testing/test/adapter'], function (exports, _emberApplication, _emberTestingSetup_for_testing, _emberTestingTestHelpers, _emberTestingTestPromise, _emberTestingTestRun, _emberTestingTestOn_inject_helpers, _emberTestingTestAdapter) { - 'use strict'; - _emberApplication.Application.reopen({ - /** - This property contains the testing helpers for the current application. These - are created once you call `injectTestHelpers` on your `Ember.Application` - instance. The included helpers are also available on the `window` object by - default, but can be used from this object on the individual application also. - @property testHelpers - @type {Object} - @default {} - @public - */ - testHelpers: {}, + /** + @method create + @static + @return {Ember.OrderedSet} + @private + */ + OrderedSet.create = function () { + var Constructor = this; - /** - This property will contain the original methods that were registered - on the `helperContainer` before `injectTestHelpers` is called. - When `removeTestHelpers` is called, these methods are restored to the - `helperContainer`. - @property originalMethods - @type {Object} - @default {} - @private - @since 1.3.0 - */ - originalMethods: {}, + return new Constructor(); + }; + OrderedSet.prototype = { + constructor: OrderedSet, /** - This property indicates whether or not this application is currently in - testing mode. This is set when `setupForTesting` is called on the current - application. - @property testing - @type {Boolean} - @default false - @since 1.3.0 - @public + @method clear + @private */ - testing: false, + clear: function () { + this.presenceSet = new _emberUtils.EmptyObject(); + this.list = []; + this.size = 0; + }, /** - This hook defers the readiness of the application, so that you can start - the app when your tests are ready to run. It also sets the router's - location to 'none', so that the window's location will not be modified - (preventing both accidental leaking of state between tests and interference - with your testing framework). - Example: - ``` - App.setupForTesting(); - ``` - @method setupForTesting - @public + @method add + @param obj + @param guid (optional, and for internal use) + @return {Ember.OrderedSet} + @private */ - setupForTesting: function () { - _emberTestingSetup_for_testing.default(); + add: function (obj, _guid) { + var guid = _guid || _emberUtils.guidFor(obj); + var presenceSet = this.presenceSet; + var list = this.list; - this.testing = true; + if (presenceSet[guid] !== true) { + presenceSet[guid] = true; + this.size = list.push(obj); + } - this.Router.reopen({ - location: 'none' - }); + return this; }, /** - This will be used as the container to inject the test helpers into. By - default the helpers are injected into `window`. - @property helperContainer - @type {Object} The object to be used for test helpers. - @default window - @since 1.2.0 + @since 1.8.0 + @method delete + @param obj + @param _guid (optional and for internal use only) + @return {Boolean} @private */ - helperContainer: null, - - /** - This injects the test helpers into the `helperContainer` object. If an object is provided - it will be used as the helperContainer. If `helperContainer` is not set it will default - to `window`. If a function of the same name has already been defined it will be cached - (so that it can be reset if the helper is removed with `unregisterHelper` or - `removeTestHelpers`). - Any callbacks registered with `onInjectHelpers` will be called once the - helpers have been injected. - Example: - ``` - App.injectTestHelpers(); - ``` - @method injectTestHelpers - @public - */ - injectTestHelpers: function (helperContainer) { - if (helperContainer) { - this.helperContainer = helperContainer; - } else { - this.helperContainer = window; - } + delete: function (obj, _guid) { + var guid = _guid || _emberUtils.guidFor(obj); + var presenceSet = this.presenceSet; + var list = this.list; - this.reopen({ - willDestroy: function () { - this._super.apply(this, arguments); - this.removeTestHelpers(); + if (presenceSet[guid] === true) { + delete presenceSet[guid]; + var index = list.indexOf(obj); + if (index > -1) { + list.splice(index, 1); } - }); - - this.testHelpers = {}; - for (var _name in _emberTestingTestHelpers.helpers) { - this.originalMethods[_name] = this.helperContainer[_name]; - this.testHelpers[_name] = this.helperContainer[_name] = helper(this, _name); - protoWrap(_emberTestingTestPromise.default.prototype, _name, helper(this, _name), _emberTestingTestHelpers.helpers[_name].meta.wait); + this.size = list.length; + return true; + } else { + return false; } - - _emberTestingTestOn_inject_helpers.invokeInjectHelpersCallbacks(this); }, /** - This removes all helpers that have been registered, and resets and functions - that were overridden by the helpers. - Example: - ```javascript - App.removeTestHelpers(); - ``` - @public - @method removeTestHelpers + @method isEmpty + @return {Boolean} + @private */ - removeTestHelpers: function () { - if (!this.helperContainer) { - return; - } - - for (var _name2 in _emberTestingTestHelpers.helpers) { - this.helperContainer[_name2] = this.originalMethods[_name2]; - delete _emberTestingTestPromise.default.prototype[_name2]; - delete this.testHelpers[_name2]; - delete this.originalMethods[_name2]; - } - } - }); - - // This method is no longer needed - // But still here for backwards compatibility - // of helper chaining - function protoWrap(proto, name, callback, isAsync) { - proto[name] = function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - if (isAsync) { - return callback.apply(this, args); - } else { - return this.then(function () { - return callback.apply(this, args); - }); - } - }; - } - - function helper(app, name) { - var fn = _emberTestingTestHelpers.helpers[name].method; - var meta = _emberTestingTestHelpers.helpers[name].meta; - if (!meta.wait) { - return function () { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - return fn.apply(app, [app].concat(args)); - }; - } + isEmpty: function () { + return this.size === 0; + }, - return function () { - for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; + /** + @method has + @param obj + @return {Boolean} + @private + */ + has: function (obj) { + if (this.size === 0) { + return false; } - var lastPromise = _emberTestingTestRun.default(function () { - return _emberTestingTestPromise.resolve(_emberTestingTestPromise.getLastPromise()); - }); + var guid = _emberUtils.guidFor(obj); + var presenceSet = this.presenceSet; - // wait for last helper's promise to resolve and then - // execute. To be safe, we need to tell the adapter we're going - // asynchronous here, because fn may not be invoked before we - // return. - _emberTestingTestAdapter.asyncStart(); - return lastPromise.then(function () { - return fn.apply(app, [app].concat(args)); - }).finally(_emberTestingTestAdapter.asyncEnd); - }; - } -}); -enifed('ember-testing/ext/rsvp', ['exports', 'ember-runtime', 'ember-metal', 'ember-testing/test/adapter'], function (exports, _emberRuntime, _emberMetal, _emberTestingTestAdapter) { - 'use strict'; + return presenceSet[guid] === true; + }, - _emberRuntime.RSVP.configure('async', function (callback, promise) { - // if schedule will cause autorun, we need to inform adapter - if (_emberMetal.isTesting() && !_emberMetal.run.backburner.currentInstance) { - _emberTestingTestAdapter.asyncStart(); - _emberMetal.run.backburner.schedule('actions', function () { - _emberTestingTestAdapter.asyncEnd(); - callback(promise); - }); - } else { - _emberMetal.run.backburner.schedule('actions', function () { - return callback(promise); - }); - } - }); + /** + @method forEach + @param {Function} fn + @param self + @private + */ + forEach: function (fn /*, ...thisArg*/) { + if (typeof fn !== 'function') { + missingFunction(fn); + } - exports.default = _emberRuntime.RSVP; -}); -enifed('ember-testing/helpers', ['exports', 'ember-metal', 'ember-testing/test/helpers', 'ember-testing/helpers/and_then', 'ember-testing/helpers/click', 'ember-testing/helpers/current_path', 'ember-testing/helpers/current_route_name', 'ember-testing/helpers/current_url', 'ember-testing/helpers/fill_in', 'ember-testing/helpers/find', 'ember-testing/helpers/find_with_assert', 'ember-testing/helpers/key_event', 'ember-testing/helpers/pause_test', 'ember-testing/helpers/trigger_event', 'ember-testing/helpers/visit', 'ember-testing/helpers/wait'], function (exports, _emberMetal, _emberTestingTestHelpers, _emberTestingHelpersAnd_then, _emberTestingHelpersClick, _emberTestingHelpersCurrent_path, _emberTestingHelpersCurrent_route_name, _emberTestingHelpersCurrent_url, _emberTestingHelpersFill_in, _emberTestingHelpersFind, _emberTestingHelpersFind_with_assert, _emberTestingHelpersKey_event, _emberTestingHelpersPause_test, _emberTestingHelpersTrigger_event, _emberTestingHelpersVisit, _emberTestingHelpersWait) { - 'use strict'; + if (this.size === 0) { + return; + } - _emberTestingTestHelpers.registerAsyncHelper('visit', _emberTestingHelpersVisit.default); - _emberTestingTestHelpers.registerAsyncHelper('click', _emberTestingHelpersClick.default); - _emberTestingTestHelpers.registerAsyncHelper('keyEvent', _emberTestingHelpersKey_event.default); - _emberTestingTestHelpers.registerAsyncHelper('fillIn', _emberTestingHelpersFill_in.default); - _emberTestingTestHelpers.registerAsyncHelper('wait', _emberTestingHelpersWait.default); - _emberTestingTestHelpers.registerAsyncHelper('andThen', _emberTestingHelpersAnd_then.default); - _emberTestingTestHelpers.registerAsyncHelper('pauseTest', _emberTestingHelpersPause_test.pauseTest); - _emberTestingTestHelpers.registerAsyncHelper('triggerEvent', _emberTestingHelpersTrigger_event.default); + var list = this.list; - _emberTestingTestHelpers.registerHelper('find', _emberTestingHelpersFind.default); - _emberTestingTestHelpers.registerHelper('findWithAssert', _emberTestingHelpersFind_with_assert.default); - _emberTestingTestHelpers.registerHelper('currentRouteName', _emberTestingHelpersCurrent_route_name.default); - _emberTestingTestHelpers.registerHelper('currentPath', _emberTestingHelpersCurrent_path.default); - _emberTestingTestHelpers.registerHelper('currentURL', _emberTestingHelpersCurrent_url.default); + if (arguments.length === 2) { + for (var i = 0; i < list.length; i++) { + fn.call(arguments[1], list[i]); + } + } else { + for (var i = 0; i < list.length; i++) { + fn(list[i]); + } + } + }, - if (false) { - _emberTestingTestHelpers.registerHelper('resumeTest', _emberTestingHelpersPause_test.resumeTest); - } -}); -enifed("ember-testing/helpers/and_then", ["exports"], function (exports) { - /** - @module ember - @submodule ember-testing - */ - "use strict"; + /** + @method toArray + @return {Array} + @private + */ + toArray: function () { + return this.list.slice(); + }, - exports.default = andThen; + /** + @method copy + @return {Ember.OrderedSet} + @private + */ + copy: function () { + var Constructor = this.constructor; + var set = new Constructor(); - function andThen(app, callback) { - return app.testHelpers.wait(callback(app)); - } -}); -enifed('ember-testing/helpers/click', ['exports', 'ember-testing/events'], function (exports, _emberTestingEvents) { - /** - @module ember - @submodule ember-testing - */ - 'use strict'; + set._silenceRemoveDeprecation = this._silenceRemoveDeprecation; + set.presenceSet = copyNull(this.presenceSet); + set.list = this.toArray(); + set.size = this.size; - exports.default = click; + return set; + } + }; /** - Clicks an element and triggers any actions triggered by the element's `click` - event. + A Map stores values indexed by keys. Unlike JavaScript's + default Objects, the keys of a Map can be any JavaScript + object. - Example: + Internally, a Map has two data structures: - ```javascript - click('.some-jQuery-selector').then(function() { - // assert something - }); - ``` + 1. `keys`: an OrderedSet of all of the existing keys + 2. `values`: a JavaScript Object indexed by the `Ember.guidFor(key)` - @method click - @param {String} selector jQuery selector for finding element on the DOM - @param {Object} context A DOM Element, Document, or jQuery to use as context - @return {RSVP.Promise} - @public + When a key/value pair is added for the first time, we + add the key to the `keys` OrderedSet, and create or + replace an entry in `values`. When an entry is deleted, + we delete its entry in `keys` and `values`. + + @class Map + @namespace Ember + @private + @constructor */ + function Map() { + if (this instanceof Map) { + this._keys = OrderedSet.create(); + this._keys._silenceRemoveDeprecation = true; + this._values = new _emberUtils.EmptyObject(); + this.size = 0; + } else { + missingNew('Map'); + } + } - function click(app, selector, context) { - var $el = app.testHelpers.findWithAssert(selector, context); - var el = $el[0]; + /** + @method create + @static + @private + */ + Map.create = function () { + var Constructor = this; + return new Constructor(); + }; - _emberTestingEvents.fireEvent(el, 'mousedown'); + Map.prototype = { + constructor: Map, - _emberTestingEvents.focus(el); + /** + This property will change as the number of objects in the map changes. + @since 1.8.0 + @property size + @type number + @default 0 + @private + */ + size: 0, - _emberTestingEvents.fireEvent(el, 'mouseup'); - _emberTestingEvents.fireEvent(el, 'click'); + /** + Retrieve the value associated with a given key. + @method get + @param {*} key + @return {*} the value associated with the key, or `undefined` + @private + */ + get: function (key) { + if (this.size === 0) { + return; + } - return app.testHelpers.wait(); - } -}); -enifed('ember-testing/helpers/current_path', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-testing - */ - 'use strict'; + var values = this._values; + var guid = _emberUtils.guidFor(key); - exports.default = currentPath; + return values[guid]; + }, - /** - Returns the current path. - - Example: - - ```javascript - function validateURL() { - equal(currentPath(), 'some.path.index', "correct path was transitioned into."); - } - - click('#some-link-id').then(validateURL); - ``` - - @method currentPath - @return {Object} The currently active path. - @since 1.5.0 - @public - */ + /** + Adds a value to the map. If a value for the given key has already been + provided, the new value will replace the old value. + @method set + @param {*} key + @param {*} value + @return {Ember.Map} + @private + */ + set: function (key, value) { + var keys = this._keys; + var values = this._values; + var guid = _emberUtils.guidFor(key); - function currentPath(app) { - var routingService = app.__container__.lookup('service:-routing'); - return _emberMetal.get(routingService, 'currentPath'); - } -}); -enifed('ember-testing/helpers/current_route_name', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-testing - */ - 'use strict'; + // ensure we don't store -0 + var k = key === -0 ? 0 : key; - exports.default = currentRouteName; + keys.add(k, guid); - /** - Returns the currently active route name. - Example: - ```javascript - function validateRouteName() { - equal(currentRouteName(), 'some.path', "correct route was transitioned into."); - } - visit('/some/path').then(validateRouteName) - ``` - @method currentRouteName - @return {Object} The name of the currently active route. - @since 1.5.0 - @public - */ + values[guid] = value; - function currentRouteName(app) { - var routingService = app.__container__.lookup('service:-routing'); - return _emberMetal.get(routingService, 'currentRouteName'); - } -}); -enifed('ember-testing/helpers/current_url', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-testing - */ - 'use strict'; + this.size = keys.size; - exports.default = currentURL; + return this; + }, - /** - Returns the current URL. - - Example: - - ```javascript - function validateURL() { - equal(currentURL(), '/some/path', "correct URL was transitioned into."); - } - - click('#some-link-id').then(validateURL); - ``` - - @method currentURL - @return {Object} The currently active URL. - @since 1.5.0 - @public - */ + /** + Removes a value from the map for an associated key. + @since 1.8.0 + @method delete + @param {*} key + @return {Boolean} true if an item was removed, false otherwise + @private + */ + delete: function (key) { + if (this.size === 0) { + return false; + } + // don't use ES6 "delete" because it will be annoying + // to use in browsers that are not ES6 friendly; + var keys = this._keys; + var values = this._values; + var guid = _emberUtils.guidFor(key); - function currentURL(app) { - var router = app.__container__.lookup('router:main'); - return _emberMetal.get(router, 'location').getURL(); - } -}); -enifed('ember-testing/helpers/fill_in', ['exports', 'ember-testing/events'], function (exports, _emberTestingEvents) { - /** - @module ember - @submodule ember-testing - */ - 'use strict'; + if (keys.delete(key, guid)) { + delete values[guid]; + this.size = keys.size; + return true; + } else { + return false; + } + }, - exports.default = fillIn; + /** + Check whether a key is present. + @method has + @param {*} key + @return {Boolean} true if the item was present, false otherwise + @private + */ + has: function (key) { + return this._keys.has(key); + }, - /** - Fills in an input element with some text. - - Example: - - ```javascript - fillIn('#email', 'you@example.com').then(function() { - // assert something - }); - ``` - - @method fillIn - @param {String} selector jQuery selector finding an input element on the DOM - to fill text with - @param {String} text text to place inside the input element - @return {RSVP.Promise} - @public - */ + /** + Iterate over all the keys and values. Calls the function once + for each key, passing in value, key, and the map being iterated over, + in that order. + The keys are guaranteed to be iterated over in insertion order. + @method forEach + @param {Function} callback + @param {*} self if passed, the `this` value inside the + callback. By default, `this` is the map. + @private + */ + forEach: function (callback /*, ...thisArg*/) { + if (typeof callback !== 'function') { + missingFunction(callback); + } - function fillIn(app, selector, contextOrText, text) { - var $el = undefined, - el = undefined, - context = undefined; - if (typeof text === 'undefined') { - text = contextOrText; - } else { - context = contextOrText; - } - $el = app.testHelpers.findWithAssert(selector, context); - el = $el[0]; - _emberTestingEvents.focus(el); + if (this.size === 0) { + return; + } - $el.eq(0).val(text); - _emberTestingEvents.fireEvent(el, 'input'); - _emberTestingEvents.fireEvent(el, 'change'); + var map = this; + var cb = undefined, + thisArg = undefined; - return app.testHelpers.wait(); + if (arguments.length === 2) { + thisArg = arguments[1]; + cb = function (key) { + return callback.call(thisArg, map.get(key), key, map); + }; + } else { + cb = function (key) { + return callback(map.get(key), key, map); + }; + } + + this._keys.forEach(cb); + }, + + /** + @method clear + @private + */ + clear: function () { + this._keys.clear(); + this._values = new _emberUtils.EmptyObject(); + this.size = 0; + }, + + /** + @method copy + @return {Ember.Map} + @private + */ + copy: function () { + return copyMap(this, new Map()); + } + }; + + /** + @class MapWithDefault + @namespace Ember + @extends Ember.Map + @private + @constructor + @param [options] + @param {*} [options.defaultValue] + */ + function MapWithDefault(options) { + this._super$constructor(); + this.defaultValue = options.defaultValue; } -}); -enifed('ember-testing/helpers/find', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** - @module ember - @submodule ember-testing + @method create + @static + @param [options] + @param {*} [options.defaultValue] + @return {Ember.MapWithDefault|Ember.Map} If options are passed, returns + `Ember.MapWithDefault` otherwise returns `Ember.Map` + @private */ - 'use strict'; + MapWithDefault.create = function (options) { + if (options) { + return new MapWithDefault(options); + } else { + return new Map(); + } + }; - exports.default = find; + MapWithDefault.prototype = Object.create(Map.prototype); + MapWithDefault.prototype.constructor = MapWithDefault; + MapWithDefault.prototype._super$constructor = Map; + MapWithDefault.prototype._super$get = Map.prototype.get; /** - Finds an element in the context of the app's container element. A simple alias - for `app.$(selector)`. - - Example: - - ```javascript - var $el = find('.my-selector'); - ``` - - With the `context` param: - - ```javascript - var $el = find('.my-selector', '.parent-element-class'); - ``` + Retrieve the value associated with a given key. - @method find - @param {String} selector jQuery string selector for element lookup - @param {String} [context] (optional) jQuery selector that will limit the selector - argument to find only within the context's children - @return {Object} jQuery object representing the results of the query - @public + @method get + @param {*} key + @return {*} the value associated with the key, or the default value + @private */ + MapWithDefault.prototype.get = function (key) { + var hasValue = this.has(key); + + if (hasValue) { + return this._super$get(key); + } else { + var defaultValue = this.defaultValue(key); + this.set(key, defaultValue); + return defaultValue; + } + }; - function find(app, selector, context) { - var $el = undefined; - context = context || _emberMetal.get(app, 'rootElement'); - $el = app.$(selector, context); - return $el; - } -}); -enifed('ember-testing/helpers/find_with_assert', ['exports'], function (exports) { /** - @module ember - @submodule ember-testing + @method copy + @return {Ember.MapWithDefault} + @private */ + MapWithDefault.prototype.copy = function () { + var Constructor = this.constructor; + return copyMap(this, new Constructor({ + defaultValue: this.defaultValue + })); + }; + + exports.default = Map; + exports.OrderedSet = OrderedSet; + exports.Map = Map; + exports.MapWithDefault = MapWithDefault; +}); +enifed('ember-metal/merge', ['exports'], function (exports) { /** - Like `find`, but throws an error if the element selector returns no results. - - Example: - - ```javascript - var $el = findWithAssert('.doesnt-exist'); // throws error - ``` - - With the `context` param: + Merge the contents of two objects together into the first object. ```javascript - var $el = findWithAssert('.selector-id', '.parent-element-class'); // assert will pass + Ember.merge({ first: 'Tom' }, { last: 'Dale' }); // { first: 'Tom', last: 'Dale' } + var a = { first: 'Yehuda' }; + var b = { last: 'Katz' }; + Ember.merge(a, b); // a == { first: 'Yehuda', last: 'Katz' }, b == { last: 'Katz' } ``` - @method findWithAssert - @param {String} selector jQuery selector string for finding an element within - the DOM - @param {String} [context] (optional) jQuery selector that will limit the - selector argument to find only within the context's children - @return {Object} jQuery object representing the results of the query - @throws {Error} throws error if jQuery object returned has a length of 0 + @method merge + @for Ember + @param {Object} original The object to merge into + @param {Object} updates The object to copy properties from + @return {Object} @public */ 'use strict'; - exports.default = findWithAssert; + exports.default = merge; - function findWithAssert(app, selector, context) { - var $el = app.testHelpers.find(selector, context); - if ($el.length === 0) { - throw new Error('Element ' + selector + ' not found.'); + function merge(original, updates) { + if (!updates || typeof updates !== 'object') { + return original; } - return $el; - } -}); -enifed('ember-testing/helpers/key_event', ['exports'], function (exports) { - /** - @module ember - @submodule ember-testing - */ - /** - Simulates a key event, e.g. `keypress`, `keydown`, `keyup` with the desired keyCode - Example: - ```javascript - keyEvent('.some-jQuery-selector', 'keypress', 13).then(function() { - // assert something - }); - ``` - @method keyEvent - @param {String} selector jQuery selector for finding element on the DOM - @param {String} type the type of key event, e.g. `keypress`, `keydown`, `keyup` - @param {Number} keyCode the keyCode of the simulated key event - @return {RSVP.Promise} - @since 1.5.0 - @public - */ - 'use strict'; - - exports.default = keyEvent; - function keyEvent(app, selector, contextOrType, typeOrKeyCode, keyCode) { - var context = undefined, - type = undefined; + var props = Object.keys(updates); + var prop = undefined; - if (typeof keyCode === 'undefined') { - context = null; - keyCode = typeOrKeyCode; - type = contextOrType; - } else { - context = contextOrType; - type = typeOrKeyCode; + for (var i = 0; i < props.length; i++) { + prop = props[i]; + original[prop] = updates[prop]; } - return app.testHelpers.triggerEvent(selector, context, type, { keyCode: keyCode, which: keyCode }); + return original; } }); -enifed('ember-testing/helpers/pause_test', ['exports', 'ember-runtime', 'ember-console', 'ember-metal'], function (exports, _emberRuntime, _emberConsole, _emberMetal) { - /** - @module ember - @submodule ember-testing - */ - 'use strict'; +enifed('ember-metal/meta', ['exports', 'ember-utils', 'ember-metal/features', 'ember-metal/meta_listeners', 'ember-metal/debug', 'ember-metal/chains', 'require'], function (exports, _emberUtils, _emberMetalFeatures, _emberMetalMeta_listeners, _emberMetalDebug, _emberMetalChains, _require) { + 'no use strict'; + // Remove "use strict"; from transpiled module until + // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - exports.resumeTest = resumeTest; - exports.pauseTest = pauseTest; + exports.deleteMeta = deleteMeta; + exports.meta = meta; - var resume = undefined; + var counters = { + peekCalls: 0, + peekParentCalls: 0, + peekPrototypeWalks: 0, + setCalls: 0, + deleteCalls: 0, + metaCalls: 0, + metaInstantiated: 0 + }; /** - Resumes a test paused by `pauseTest`. - - @method resumeTest - @return {void} - @public + @module ember-metal */ - function resumeTest() { - _emberMetal.assert('Testing has not been paused. There is nothing to resume.', resume); - resume(); - resume = undefined; - } - - /** - Pauses the current test - this is useful for debugging while testing or for test-driving. - It allows you to inspect the state of your application at any point. - Example (The test will pause before clicking the button): + /* + This declares several meta-programmed members on the Meta class. Such + meta! - ```javascript - visit('/') - return pauseTest(); - click('.btn'); - ``` - @since 1.9.0 - @method pauseTest - @return {Object} A promise that will never resolve - @public + In general, the `readable` variants will give you an object (if it + already exists) that you can read but should not modify. The + `writable` variants will give you a mutable object, and they will + create it if it didn't already exist. + + The following methods will get generated metaprogrammatically, and + I'm including them here for greppability: + + writableCache, readableCache, writeWatching, + peekWatching, clearWatching, writeMixins, + peekMixins, clearMixins, writeBindings, + peekBindings, clearBindings, writeValues, + peekValues, clearValues, writeDeps, forEachInDeps + writableChainWatchers, readableChainWatchers, writableChains, + readableChains, writableTag, readableTag, writableTags, + readableTags */ + var members = { + cache: ownMap, + weak: ownMap, + watching: inheritedMap, + mixins: inheritedMap, + bindings: inheritedMap, + values: inheritedMap, + chainWatchers: ownCustomObject, + chains: inheritedCustomObject, + tag: ownCustomObject, + tags: ownMap + }; - function pauseTest() { - if (false) { - _emberConsole.default.info('Testing paused. Use `resumeTest()` to continue.'); - } + // FLAGS + var SOURCE_DESTROYING = 1 << 1; + var SOURCE_DESTROYED = 1 << 2; + var META_DESTROYED = 1 << 3; + var IS_PROXY = 1 << 4; - return new _emberRuntime.RSVP.Promise(function (resolve) { - if (false) { - resume = resolve; - } - }, 'TestAdapter paused promise'); + if (true || true) { + members.lastRendered = ownMap; + if (_require.has('ember-debug')) { + //https://github.com/emberjs/ember.js/issues/14732 + members.lastRenderedReferenceMap = ownMap; + members.lastRenderedTemplateMap = ownMap; + } } -}); -enifed('ember-testing/helpers/trigger_event', ['exports', 'ember-testing/events'], function (exports, _emberTestingEvents) { - /** - @module ember - @submodule ember-testing - */ - 'use strict'; - exports.default = triggerEvent; + var memberNames = Object.keys(members); + var META_FIELD = '__ember_meta__'; - /** - Triggers the given DOM event on the element identified by the provided selector. - Example: - ```javascript - triggerEvent('#some-elem-id', 'blur'); - ``` - This is actually used internally by the `keyEvent` helper like so: - ```javascript - triggerEvent('#some-elem-id', 'keypress', { keyCode: 13 }); - ``` - @method triggerEvent - @param {String} selector jQuery selector for finding element on the DOM - @param {String} [context] jQuery selector that will limit the selector - argument to find only within the context's children - @param {String} type The event type to be triggered. - @param {Object} [options] The options to be passed to jQuery.Event. - @return {RSVP.Promise} - @since 1.5.0 - @public - */ + var Meta = (function () { + function Meta(obj, parentMeta) { + var _this = this; - function triggerEvent(app, selector, contextOrType, typeOrOptions, possibleOptions) { - var arity = arguments.length; - var context = undefined, - type = undefined, - options = undefined; + babelHelpers.classCallCheck(this, Meta); - if (arity === 3) { - // context and options are optional, so this is - // app, selector, type - context = null; - type = contextOrType; - options = {}; - } else if (arity === 4) { - // context and options are optional, so this is - if (typeof typeOrOptions === 'object') { - // either - // app, selector, type, options - context = null; - type = contextOrType; - options = typeOrOptions; - } else { - // or - // app, selector, context, type - context = contextOrType; - type = typeOrOptions; - options = {}; + _emberMetalDebug.runInDebug(function () { + return counters.metaInstantiated++; + }); + + this._cache = undefined; + this._weak = undefined; + this._watching = undefined; + this._mixins = undefined; + this._bindings = undefined; + this._values = undefined; + this._deps = undefined; + this._chainWatchers = undefined; + this._chains = undefined; + this._tag = undefined; + this._tags = undefined; + + // initial value for all flags right now is false + // see FLAGS const for detailed list of flags used + this._flags = 0; + + // used only internally + this.source = obj; + + // when meta(obj).proto === obj, the object is intended to be only a + // prototype and doesn't need to actually be observable itself + this.proto = undefined; + + // The next meta in our inheritance chain. We (will) track this + // explicitly instead of using prototypical inheritance because we + // have detailed knowledge of how each property should really be + // inherited, and we can optimize it much better than JS runtimes. + this.parent = parentMeta; + + if (true || true) { + this._lastRendered = undefined; + _emberMetalDebug.runInDebug(function () { + _this._lastRenderedReferenceMap = undefined; + _this._lastRenderedTemplateMap = undefined; + }); } - } else { - context = contextOrType; - type = typeOrOptions; - options = possibleOptions; + + this._initializeListeners(); } - var $el = app.testHelpers.findWithAssert(selector, context); - var el = $el[0]; + Meta.prototype.isInitialized = function isInitialized(obj) { + return this.proto !== obj; + }; - _emberTestingEvents.fireEvent(el, type, options); + Meta.prototype.destroy = function destroy() { + if (this.isMetaDestroyed()) { + return; + } - return app.testHelpers.wait(); - } -}); -enifed('ember-testing/helpers/visit', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-testing - */ - 'use strict'; + // remove chainWatchers to remove circular references that would prevent GC + var nodes = undefined, + key = undefined, + nodeObject = undefined; + var node = this.readableChains(); + if (node) { + NODE_STACK.push(node); + // process tree + while (NODE_STACK.length > 0) { + node = NODE_STACK.pop(); + // push children + nodes = node._chains; + if (nodes) { + for (key in nodes) { + if (nodes[key] !== undefined) { + NODE_STACK.push(nodes[key]); + } + } + } - exports.default = visit; + // remove chainWatcher in node object + if (node._watching) { + nodeObject = node._object; + if (nodeObject) { + var foreignMeta = peekMeta(nodeObject); + // avoid cleaning up chain watchers when both current and + // foreign objects are being destroyed + // if both are being destroyed manual cleanup is not needed + // as they will be GC'ed and no non-destroyed references will + // be remaining + if (foreignMeta && !foreignMeta.isSourceDestroying()) { + _emberMetalChains.removeChainWatcher(nodeObject, node._key, node, foreignMeta); + } + } + } + } + } - /** - Loads a route, sets up any controllers, and renders any templates associated - with the route as though a real user had triggered the route change while - using your app. - - Example: - - ```javascript - visit('posts/index').then(function() { - // assert something - }); - ``` - - @method visit - @param {String} url the name of the route - @return {RSVP.Promise} - @public - */ + this.setMetaDestroyed(); + }; - function visit(app, url) { - var router = app.__container__.lookup('router:main'); - var shouldHandleURL = false; + Meta.prototype.isSourceDestroying = function isSourceDestroying() { + return (this._flags & SOURCE_DESTROYING) !== 0; + }; - app.boot().then(function () { - router.location.setURL(url); + Meta.prototype.setSourceDestroying = function setSourceDestroying() { + this._flags |= SOURCE_DESTROYING; + }; - if (shouldHandleURL) { - _emberMetal.run(app.__deprecatedInstance__, 'handleURL', url); - } - }); + Meta.prototype.isSourceDestroyed = function isSourceDestroyed() { + return (this._flags & SOURCE_DESTROYED) !== 0; + }; - if (app._readinessDeferrals > 0) { - router['initialURL'] = url; - _emberMetal.run(app, 'advanceReadiness'); - delete router['initialURL']; - } else { - shouldHandleURL = true; - } + Meta.prototype.setSourceDestroyed = function setSourceDestroyed() { + this._flags |= SOURCE_DESTROYED; + }; - return app.testHelpers.wait(); - } -}); -enifed('ember-testing/helpers/wait', ['exports', 'ember-testing/test/waiters', 'ember-runtime', 'ember-metal', 'ember-testing/test/pending_requests'], function (exports, _emberTestingTestWaiters, _emberRuntime, _emberMetal, _emberTestingTestPending_requests) { - /** - @module ember - @submodule ember-testing - */ - 'use strict'; + Meta.prototype.isMetaDestroyed = function isMetaDestroyed() { + return (this._flags & META_DESTROYED) !== 0; + }; - exports.default = wait; + Meta.prototype.setMetaDestroyed = function setMetaDestroyed() { + this._flags |= META_DESTROYED; + }; - /** - Causes the run loop to process any pending events. This is used to ensure that - any async operations from other helpers (or your assertions) have been processed. - - This is most often used as the return value for the helper functions (see 'click', - 'fillIn','visit',etc). However, there is a method to register a test helper which - utilizes this method without the need to actually call `wait()` in your helpers. - - The `wait` helper is built into `registerAsyncHelper` by default. You will not need - to `return app.testHelpers.wait();` - the wait behavior is provided for you. - - Example: - - ```javascript - Ember.Test.registerAsyncHelper('loginUser', function(app, username, password) { - visit('secured/path/here') - .fillIn('#username', username) - .fillIn('#password', password) - .click('.submit'); - }); - - @method wait - @param {Object} value The value to be returned. - @return {RSVP.Promise} - @public - @since 1.0.0 - */ + Meta.prototype.isProxy = function isProxy() { + return (this._flags & IS_PROXY) !== 0; + }; - function wait(app, value) { - return new _emberRuntime.RSVP.Promise(function (resolve) { - var router = app.__container__.lookup('router:main'); + Meta.prototype.setProxy = function setProxy() { + this._flags |= IS_PROXY; + }; - // Every 10ms, poll for the async thing to have finished - var watcher = setInterval(function () { - // 1. If the router is loading, keep polling - var routerIsLoading = router.router && !!router.router.activeTransition; - if (routerIsLoading) { - return; - } + Meta.prototype._getOrCreateOwnMap = function _getOrCreateOwnMap(key) { + return this[key] || (this[key] = new _emberUtils.EmptyObject()); + }; - // 2. If there are pending Ajax requests, keep polling - if (_emberTestingTestPending_requests.pendingRequests()) { - return; + Meta.prototype._getInherited = function _getInherited(key) { + var pointer = this; + while (pointer !== undefined) { + if (pointer[key]) { + return pointer[key]; } + pointer = pointer.parent; + } + }; - // 3. If there are scheduled timers or we are inside of a run loop, keep polling - if (_emberMetal.run.hasScheduledTimers() || _emberMetal.run.currentRunLoop) { - return; + Meta.prototype._findInherited = function _findInherited(key, subkey) { + var pointer = this; + while (pointer !== undefined) { + var map = pointer[key]; + if (map) { + var value = map[subkey]; + if (value !== undefined) { + return value; + } } + pointer = pointer.parent; + } + }; - if (_emberTestingTestWaiters.checkWaiters()) { - return; + // Implements a member that provides a lazily created map of maps, + // with inheritance at both levels. + + Meta.prototype.writeDeps = function writeDeps(subkey, itemkey, value) { + _emberMetalDebug.assert('Cannot call writeDeps after the object is destroyed.', !this.isMetaDestroyed()); + + var outerMap = this._getOrCreateOwnMap('_deps'); + var innerMap = outerMap[subkey]; + if (!innerMap) { + innerMap = outerMap[subkey] = new _emberUtils.EmptyObject(); + } + innerMap[itemkey] = value; + }; + + Meta.prototype.peekDeps = function peekDeps(subkey, itemkey) { + var pointer = this; + while (pointer !== undefined) { + var map = pointer._deps; + if (map) { + var value = map[subkey]; + if (value) { + if (value[itemkey] !== undefined) { + return value[itemkey]; + } + } } + pointer = pointer.parent; + } + }; - // Stop polling - clearInterval(watcher); + Meta.prototype.hasDeps = function hasDeps(subkey) { + var pointer = this; + while (pointer !== undefined) { + if (pointer._deps && pointer._deps[subkey]) { + return true; + } + pointer = pointer.parent; + } + return false; + }; - // Synchronously resolve the promise - _emberMetal.run(null, resolve, value); - }, 10); - }); - } -}); -enifed('ember-testing/index', ['exports', 'ember-testing/support', 'ember-testing/ext/application', 'ember-testing/ext/rsvp', 'ember-testing/helpers', 'ember-testing/initializers', 'ember-testing/test', 'ember-testing/adapters/adapter', 'ember-testing/setup_for_testing', 'ember-testing/adapters/qunit'], function (exports, _emberTestingSupport, _emberTestingExtApplication, _emberTestingExtRsvp, _emberTestingHelpers, _emberTestingInitializers, _emberTestingTest, _emberTestingAdaptersAdapter, _emberTestingSetup_for_testing, _emberTestingAdaptersQunit) { - 'use strict'; + Meta.prototype.forEachInDeps = function forEachInDeps(subkey, fn) { + return this._forEachIn('_deps', subkey, fn); + }; - exports.Test = _emberTestingTest.default; - exports.Adapter = _emberTestingAdaptersAdapter.default; - exports.setupForTesting = _emberTestingSetup_for_testing.default; - exports.QUnitAdapter = _emberTestingAdaptersQunit.default; -}); -// to handle various edge cases -// setup RSVP + run loop integration -// adds helpers to helpers object in Test -// to setup initializer + Meta.prototype._forEachIn = function _forEachIn(key, subkey, fn) { + var pointer = this; + var seen = new _emberUtils.EmptyObject(); + var calls = []; + while (pointer !== undefined) { + var map = pointer[key]; + if (map) { + var innerMap = map[subkey]; + if (innerMap) { + for (var innerKey in innerMap) { + if (!seen[innerKey]) { + seen[innerKey] = true; + calls.push([innerKey, innerMap[innerKey]]); + } + } + } + } + pointer = pointer.parent; + } + for (var i = 0; i < calls.length; i++) { + var _calls$i = calls[i]; + var innerKey = _calls$i[0]; + var value = _calls$i[1]; -/** - @module ember - @submodule ember-testing -*/ -enifed('ember-testing/initializers', ['exports', 'ember-runtime'], function (exports, _emberRuntime) { - 'use strict'; + fn(innerKey, value); + } + }; - var name = 'deferReadiness in `testing` mode'; + Meta.prototype.readInheritedValue = function readInheritedValue(key, subkey) { + var internalKey = '_' + key; - _emberRuntime.onLoad('Ember.Application', function (Application) { - if (!Application.initializers[name]) { - Application.initializer({ - name: name, + var pointer = this; - initialize: function (application) { - if (application.testing) { - application.deferReadiness(); + while (pointer !== undefined) { + var map = pointer[internalKey]; + if (map) { + var value = map[subkey]; + if (value !== undefined || subkey in map) { + return map[subkey]; } } - }); - } - }); -}); -enifed('ember-testing/setup_for_testing', ['exports', 'ember-metal', 'ember-views', 'ember-testing/test/adapter', 'ember-testing/test/pending_requests', 'ember-testing/adapters/qunit'], function (exports, _emberMetal, _emberViews, _emberTestingTestAdapter, _emberTestingTestPending_requests, _emberTestingAdaptersQunit) { - 'use strict'; + pointer = pointer.parent; + } - exports.default = setupForTesting; + return UNDEFINED; + }; - /** - Sets Ember up for testing. This is useful to perform - basic setup steps in order to unit test. - - Use `App.setupForTesting` to perform integration tests (full - application testing). - - @method setupForTesting - @namespace Ember - @since 1.5.0 - @private - */ + Meta.prototype.writeValue = function writeValue(obj, key, value) { + var descriptor = _emberUtils.lookupDescriptor(obj, key); + var isMandatorySetter = descriptor && descriptor.set && descriptor.set.isMandatorySetter; + + if (isMandatorySetter) { + this.writeValues(key, value); + } else { + obj[key] = value; + } + }; - function setupForTesting() { - _emberMetal.setTesting(true); + return Meta; + })(); - var adapter = _emberTestingTestAdapter.getAdapter(); - // if adapter is not manually set default to QUnit - if (!adapter) { - _emberTestingTestAdapter.setAdapter(new _emberTestingAdaptersQunit.default()); - } + exports.Meta = Meta; - _emberViews.jQuery(document).off('ajaxSend', _emberTestingTestPending_requests.incrementPendingRequests); - _emberViews.jQuery(document).off('ajaxComplete', _emberTestingTestPending_requests.decrementPendingRequests); + var NODE_STACK = []; - _emberTestingTestPending_requests.clearPendingRequests(); + for (var _name in _emberMetalMeta_listeners.protoMethods) { + Meta.prototype[_name] = _emberMetalMeta_listeners.protoMethods[_name]; + } + memberNames.forEach(function (name) { + return members[name](name, Meta); + }); - _emberViews.jQuery(document).on('ajaxSend', _emberTestingTestPending_requests.incrementPendingRequests); - _emberViews.jQuery(document).on('ajaxComplete', _emberTestingTestPending_requests.decrementPendingRequests); + // Implements a member that is a lazily created, non-inheritable + // POJO. + function ownMap(name, Meta) { + var key = memberProperty(name); + var capitalized = capitalize(name); + Meta.prototype['writable' + capitalized] = function () { + return this._getOrCreateOwnMap(key); + }; + Meta.prototype['readable' + capitalized] = function () { + return this[key]; + }; } -}); -enifed('ember-testing/support', ['exports', 'ember-metal', 'ember-views', 'ember-environment'], function (exports, _emberMetal, _emberViews, _emberEnvironment) { - 'use strict'; - /** - @module ember - @submodule ember-testing - */ + // Implements a member that is a lazily created POJO with inheritable + // values. + function inheritedMap(name, Meta) { + var key = memberProperty(name); + var capitalized = capitalize(name); - var $ = _emberViews.jQuery; + Meta.prototype['write' + capitalized] = function (subkey, value) { + _emberMetalDebug.assert('Cannot call write' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); - /** - This method creates a checkbox and triggers the click event to fire the - passed in handler. It is used to correct for a bug in older versions - of jQuery (e.g 1.8.3). - - @private - @method testCheckboxClick - */ - function testCheckboxClick(handler) { - var input = document.createElement('input'); - $(input).attr('type', 'checkbox').css({ position: 'absolute', left: '-1000px', top: '-1000px' }).appendTo('body').on('click', handler).trigger('click').remove(); - } + var map = this._getOrCreateOwnMap(key); + map[subkey] = value; + }; - if (_emberEnvironment.environment.hasDOM && typeof $ === 'function') { - $(function () { - /* - Determine whether a checkbox checked using jQuery's "click" method will have - the correct value for its checked property. - If we determine that the current jQuery version exhibits this behavior, - patch it to work correctly as in the commit for the actual fix: - https://github.com/jquery/jquery/commit/1fb2f92. - */ - testCheckboxClick(function () { - if (!this.checked && !$.event.special.click) { - $.event.special.click = { - // For checkbox, fire native event so checked state will be right - trigger: function () { - if ($.nodeName(this, 'input') && this.type === 'checkbox' && this.click) { - this.click(); - return false; - } + Meta.prototype['peek' + capitalized] = function (subkey) { + return this._findInherited(key, subkey); + }; + + Meta.prototype['forEach' + capitalized] = function (fn) { + var pointer = this; + var seen = new _emberUtils.EmptyObject(); + while (pointer !== undefined) { + var map = pointer[key]; + if (map) { + for (var _key in map) { + if (!seen[_key]) { + seen[_key] = true; + fn(_key, map[_key]); } - }; + } } - }); + pointer = pointer.parent; + } + }; - // Try again to verify that the patch took effect or blow up. - testCheckboxClick(function () { - _emberMetal.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-testing/test/helpers', 'ember-testing/test/on_inject_helpers', 'ember-testing/test/promise', 'ember-testing/test/waiters', 'ember-testing/test/adapter', 'ember-metal'], function (exports, _emberTestingTestHelpers, _emberTestingTestOn_inject_helpers, _emberTestingTestPromise, _emberTestingTestWaiters, _emberTestingTestAdapter, _emberMetal) { - /** - @module ember - @submodule ember-testing - */ - 'use strict'; + Meta.prototype['clear' + capitalized] = function () { + _emberMetalDebug.assert('Cannot call clear' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); - /** - This is a container for an assortment of testing related functionality: - - * Choose your default test adapter (for your framework of choice). - * Register/Unregister additional test helpers. - * Setup callbacks to be fired when the test helpers are injected into - your application. - - @class Test - @namespace Ember - @public - */ - var Test = { - /** - Hash containing all known test helpers. - @property _helpers - @private - @since 1.7.0 - */ - _helpers: _emberTestingTestHelpers.helpers, + this[key] = undefined; + }; - registerHelper: _emberTestingTestHelpers.registerHelper, - registerAsyncHelper: _emberTestingTestHelpers.registerAsyncHelper, - unregisterHelper: _emberTestingTestHelpers.unregisterHelper, - onInjectHelpers: _emberTestingTestOn_inject_helpers.onInjectHelpers, - Promise: _emberTestingTestPromise.default, - promise: _emberTestingTestPromise.promise, - resolve: _emberTestingTestPromise.resolve, - registerWaiter: _emberTestingTestWaiters.registerWaiter, - unregisterWaiter: _emberTestingTestWaiters.unregisterWaiter - }; + Meta.prototype['deleteFrom' + capitalized] = function (subkey) { + delete this._getOrCreateOwnMap(key)[subkey]; + }; - if (true) { - Test.checkWaiters = _emberTestingTestWaiters.checkWaiters; + Meta.prototype['hasIn' + capitalized] = function (subkey) { + return this._findInherited(key, subkey) !== undefined; + }; } - /** - Used to allow ember-testing to communicate with a specific testing - framework. - - You can manually set it before calling `App.setupForTesting()`. - - Example: - - ```javascript - Ember.Test.adapter = MyCustomAdapter.create() - ``` - - If you do not set it, ember-testing will default to `Ember.Test.QUnitAdapter`. - - @public - @for Ember.Test - @property adapter - @type {Class} The adapter to be used. - @default Ember.Test.QUnitAdapter - */ - Object.defineProperty(Test, 'adapter', { - get: _emberTestingTestAdapter.getAdapter, - set: _emberTestingTestAdapter.setAdapter - }); - - Object.defineProperty(Test, 'waiters', { - get: _emberTestingTestWaiters.generateDeprecatedWaitersArray - }); + var UNDEFINED = _emberUtils.symbol('undefined'); - exports.default = Test; -}); -enifed('ember-testing/test/adapter', ['exports', 'ember-console', 'ember-metal'], function (exports, _emberConsole, _emberMetal) { - 'use strict'; + exports.UNDEFINED = UNDEFINED; + // Implements a member that provides a non-heritable, lazily-created + // object using the method you provide. + function ownCustomObject(name, Meta) { + var key = memberProperty(name); + var capitalized = capitalize(name); + Meta.prototype['writable' + capitalized] = function (create) { + _emberMetalDebug.assert('Cannot call writable' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); - exports.getAdapter = getAdapter; - exports.setAdapter = setAdapter; - exports.asyncStart = asyncStart; - exports.asyncEnd = asyncEnd; + var ret = this[key]; + if (!ret) { + ret = this[key] = create(this.source); + } + return ret; + }; + Meta.prototype['readable' + capitalized] = function () { + return this[key]; + }; + } - var adapter = undefined; + // Implements a member that provides an inheritable, lazily-created + // object using the method you provide. We will derived children from + // their parents by calling your object's `copy()` method. + function inheritedCustomObject(name, Meta) { + var key = memberProperty(name); + var capitalized = capitalize(name); + Meta.prototype['writable' + capitalized] = function (create) { + _emberMetalDebug.assert('Cannot call writable' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); - function getAdapter() { - return adapter; + var ret = this[key]; + if (!ret) { + if (this.parent) { + ret = this[key] = this.parent['writable' + capitalized](create).copy(this.source); + } else { + ret = this[key] = create(this.source); + } + } + return ret; + }; + Meta.prototype['readable' + capitalized] = function () { + return this._getInherited(key); + }; } - function setAdapter(value) { - adapter = value; - if (value) { - _emberMetal.setDispatchOverride(adapterDispatch); - } else { - _emberMetal.setDispatchOverride(null); - } + function memberProperty(name) { + return '_' + name; } - function asyncStart() { - if (adapter) { - adapter.asyncStart(); - } + // there's a more general-purpose capitalize in ember-runtime, but we + // don't want to make ember-metal depend on ember-runtime. + function capitalize(name) { + return name.replace(/^\w/, function (m) { + return m.toUpperCase(); + }); } - function asyncEnd() { - if (adapter) { - adapter.asyncEnd(); - } - } + var META_DESC = { + writable: true, + configurable: true, + enumerable: false, + value: null + }; - function adapterDispatch(error) { - adapter.exception(error); - _emberConsole.default.error(error.stack); - } -}); -enifed('ember-testing/test/helpers', ['exports', 'ember-testing/test/promise'], function (exports, _emberTestingTestPromise) { - 'use strict'; + exports.META_DESC = META_DESC; + var EMBER_META_PROPERTY = { + name: META_FIELD, + descriptor: META_DESC + }; - exports.registerHelper = registerHelper; - exports.registerAsyncHelper = registerAsyncHelper; - exports.unregisterHelper = unregisterHelper; - var helpers = {}; + if (true) { + Meta.prototype.readInheritedValue = function (key, subkey) { + var internalKey = '_' + key; - exports.helpers = helpers; - /** - `registerHelper` is used to register a test helper that will be injected - when `App.injectTestHelpers` is called. - - The helper method will always be called with the current Application as - the first parameter. - - For example: - - ```javascript - Ember.Test.registerHelper('boot', function(app) { - Ember.run(app, app.advanceReadiness); - }); - ``` - - This helper can later be called without arguments because it will be - called with `app` as the first parameter. - - ```javascript - App = Ember.Application.create(); - App.injectTestHelpers(); - boot(); - ``` - - @public - @for Ember.Test - @method registerHelper - @param {String} name The name of the helper method to add. - @param {Function} helperMethod - @param options {Object} - */ + var pointer = this; - function registerHelper(name, helperMethod) { - helpers[name] = { - method: helperMethod, - meta: { wait: false } + 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; }; - } - /** - `registerAsyncHelper` is used to register an async test helper that will be injected - when `App.injectTestHelpers` is called. - - The helper method will always be called with the current Application as - the first parameter. - - For example: - - ```javascript - Ember.Test.registerAsyncHelper('boot', function(app) { - Ember.run(app, app.advanceReadiness); - }); - ``` - - The advantage of an async helper is that it will not run - until the last async helper has completed. All async helpers - after it will wait for it complete before running. - - - For example: - - ```javascript - Ember.Test.registerAsyncHelper('deletePost', function(app, postId) { - click('.delete-' + postId); - }); - - // ... in your test - visit('/post/2'); - deletePost(2); - visit('/post/3'); - deletePost(3); - ``` - - @public - @for Ember.Test - @method registerAsyncHelper - @param {String} name The name of the helper method to add. - @param {Function} helperMethod - @since 1.2.0 - */ + Meta.prototype.writeValue = function (obj, key, value) { + var descriptor = _emberUtils.lookupDescriptor(obj, key); + var isMandatorySetter = descriptor && descriptor.set && descriptor.set.isMandatorySetter; - function registerAsyncHelper(name, helperMethod) { - helpers[name] = { - method: helperMethod, - meta: { wait: true } + if (isMandatorySetter) { + this.writeValues(key, value); + } else { + obj[key] = value; + } }; } - /** - Remove a previously added helper method. - - Example: - - ```javascript - Ember.Test.unregisterHelper('wait'); - ``` - - @public - @method unregisterHelper - @param {String} name The helper to remove. - */ + var setMeta = undefined, + peekMeta = undefined; - function unregisterHelper(name) { - delete helpers[name]; - delete _emberTestingTestPromise.default.prototype[name]; - } -}); -enifed("ember-testing/test/on_inject_helpers", ["exports"], function (exports) { - "use strict"; + // choose the one appropriate for given platform + if (_emberUtils.HAS_NATIVE_WEAKMAP) { + (function () { + var getPrototypeOf = Object.getPrototypeOf; + var metaStore = new WeakMap(); - exports.onInjectHelpers = onInjectHelpers; - exports.invokeInjectHelpersCallbacks = invokeInjectHelpersCallbacks; - var callbacks = []; + exports.setMeta = setMeta = function WeakMap_setMeta(obj, meta) { + _emberMetalDebug.runInDebug(function () { + return counters.setCalls++; + }); + metaStore.set(obj, meta); + }; - exports.callbacks = callbacks; - /** - Used to register callbacks to be fired whenever `App.injectTestHelpers` - is called. - - The callback will receive the current application as an argument. - - Example: - - ```javascript - Ember.Test.onInjectHelpers(function() { - Ember.$(document).ajaxSend(function() { - Test.pendingRequests++; - }); - - Ember.$(document).ajaxComplete(function() { - Test.pendingRequests--; - }); - }); - ``` - - @public - @for Ember.Test - @method onInjectHelpers - @param {Function} callback The function to be called. - */ + exports.peekMeta = peekMeta = function WeakMap_peekMeta(obj) { + _emberMetalDebug.runInDebug(function () { + return counters.peekCalls++; + }); - function onInjectHelpers(callback) { - callbacks.push(callback); - } + return metaStore.get(obj); + }; - function invokeInjectHelpersCallbacks(app) { - for (var i = 0; i < callbacks.length; i++) { - callbacks[i](app); - } + exports.peekMeta = peekMeta = function WeakMap_peekParentMeta(obj) { + var pointer = obj; + var meta = undefined; + while (pointer) { + meta = metaStore.get(pointer); + // jshint loopfunc:true + _emberMetalDebug.runInDebug(function () { + return counters.peekCalls++; + }); + // stop if we find a `null` value, since + // that means the meta was deleted + // any other truthy value is a "real" meta + if (meta === null || meta) { + return meta; + } + + pointer = getPrototypeOf(pointer); + _emberMetalDebug.runInDebug(function () { + return counters.peakPrototypeWalks++; + }); + } + }; + })(); + } else { + exports.setMeta = setMeta = function Fallback_setMeta(obj, meta) { + // if `null` already, just set it to the new value + // otherwise define property first + if (obj[META_FIELD] !== null) { + if (obj.__defineNonEnumerable) { + obj.__defineNonEnumerable(EMBER_META_PROPERTY); + } else { + Object.defineProperty(obj, META_FIELD, META_DESC); + } + } + + obj[META_FIELD] = meta; + }; + + exports.peekMeta = peekMeta = function Fallback_peekMeta(obj) { + return obj[META_FIELD]; + }; } -}); -enifed("ember-testing/test/pending_requests", ["exports"], function (exports) { - "use strict"; - exports.pendingRequests = pendingRequests; - exports.clearPendingRequests = clearPendingRequests; - exports.incrementPendingRequests = incrementPendingRequests; - exports.decrementPendingRequests = decrementPendingRequests; - var requests = []; + function deleteMeta(obj) { + _emberMetalDebug.runInDebug(function () { + return counters.deleteCalls++; + }); - function pendingRequests() { - return requests.length; + var meta = peekMeta(obj); + if (meta) { + meta.destroy(); + } } - function clearPendingRequests() { - requests.length = 0; - } + /** + Retrieves the meta hash for an object. If `writable` is true ensures the + hash is writable for this object as well. + + The meta object contains information about computed property descriptors as + well as any watched properties and other information. You generally will + not access this information directly but instead work with higher level + methods that manipulate this hash indirectly. + + @method meta + @for Ember + @private + + @param {Object} obj The object to retrieve meta for + @param {Boolean} [writable=true] Pass `false` if you do not intend to modify + the meta hash, allowing the method to avoid making an unnecessary copy. + @return {Object} the meta hash for an object + */ - function incrementPendingRequests(_, xhr) { - requests.push(xhr); - } + function meta(obj) { + _emberMetalDebug.runInDebug(function () { + return counters.metaCalls++; + }); - function decrementPendingRequests(_, xhr) { - for (var i = 0; i < requests.length; i++) { - if (xhr === requests[i]) { - requests.splice(i, 1); - break; + var maybeMeta = peekMeta(obj); + var parent = undefined; + + // remove this code, in-favor of explicit parent + if (maybeMeta) { + if (maybeMeta.source === obj) { + return maybeMeta; } + parent = maybeMeta; } + + var newMeta = new Meta(obj, parent); + setMeta(obj, newMeta); + return newMeta; } -}); -enifed('ember-testing/test/promise', ['exports', 'ember-runtime', 'ember-testing/test/run'], function (exports, _emberRuntime, _emberTestingTestRun) { - 'use strict'; - exports.promise = promise; - exports.resolve = resolve; - exports.getLastPromise = getLastPromise; + exports.peekMeta = peekMeta; + exports.setMeta = setMeta; + exports.counters = counters; +}); +enifed('ember-metal/meta_listeners', ['exports'], function (exports) { + /* + When we render a rich template hierarchy, the set of events that + *might* happen tends to be much larger than the set of events that + actually happen. This implies that we should make listener creation & + destruction cheap, even at the cost of making event dispatch more + expensive. + + Thus we store a new listener with a single push and no new + allocations, without even bothering to do deduplication -- we can + save that for dispatch time, if an event actually happens. + */ - var lastPromise = undefined; + /* listener flags */ + 'use strict'; - var TestPromise = (function (_RSVP$Promise) { - babelHelpers.inherits(TestPromise, _RSVP$Promise); + var ONCE = 1; + exports.ONCE = ONCE; + var SUSPENDED = 2; - function TestPromise() { - babelHelpers.classCallCheck(this, TestPromise); + exports.SUSPENDED = SUSPENDED; + var protoMethods = { - _RSVP$Promise.apply(this, arguments); - lastPromise = this; - } + addToListeners: function (eventName, target, method, flags) { + if (!this._listeners) { + this._listeners = []; + } + this._listeners.push(eventName, target, method, flags); + }, - /** - This returns a thenable tailored for testing. It catches failed - `onSuccess` callbacks and invokes the `Ember.Test.adapter.exception` - callback in the last chained then. - - This method should be returned by async helpers such as `wait`. - - @public - @for Ember.Test - @method promise - @param {Function} resolver The function used to resolve the promise. - @param {String} label An optional string for identifying the promise. - */ + _finalizeListeners: function () { + if (this._listenersFinalized) { + return; + } + if (!this._listeners) { + this._listeners = []; + } + var pointer = this.parent; + while (pointer) { + var listeners = pointer._listeners; + if (listeners) { + this._listeners = this._listeners.concat(listeners); + } + if (pointer._listenersFinalized) { + break; + } + pointer = pointer.parent; + } + this._listenersFinalized = true; + }, - TestPromise.prototype.then = function then(onFulfillment) { - var _RSVP$Promise$prototype$then; + removeFromListeners: function (eventName, target, method, didRemove) { + var pointer = this; + while (pointer) { + var listeners = pointer._listeners; + if (listeners) { + for (var index = listeners.length - 4; index >= 0; index -= 4) { + if (listeners[index] === eventName && (!method || listeners[index + 1] === target && listeners[index + 2] === method)) { + if (pointer === this) { + // we are modifying our own list, so we edit directly + if (typeof didRemove === 'function') { + didRemove(eventName, target, listeners[index + 2]); + } + listeners.splice(index, 4); + } else { + // we are trying to remove an inherited listener, so we do + // just-in-time copying to detach our own listeners from + // our inheritance chain. + this._finalizeListeners(); + return this.removeFromListeners(eventName, target, method); + } + } + } + } + if (pointer._listenersFinalized) { + break; + } + pointer = pointer.parent; + } + }, - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; + matchingListeners: function (eventName) { + var pointer = this; + var result = []; + while (pointer) { + var listeners = pointer._listeners; + if (listeners) { + for (var index = 0; index < listeners.length - 3; index += 4) { + if (listeners[index] === eventName) { + pushUniqueListener(result, listeners, index); + } + } + } + if (pointer._listenersFinalized) { + break; + } + pointer = pointer.parent; } + var sus = this._suspendedListeners; + if (sus) { + for (var susIndex = 0; susIndex < sus.length - 2; susIndex += 3) { + if (eventName === sus[susIndex]) { + for (var resultIndex = 0; resultIndex < result.length - 2; resultIndex += 3) { + if (result[resultIndex] === sus[susIndex + 1] && result[resultIndex + 1] === sus[susIndex + 2]) { + result[resultIndex + 2] |= SUSPENDED; + } + } + } + } + } + return result; + }, - return (_RSVP$Promise$prototype$then = _RSVP$Promise.prototype.then).call.apply(_RSVP$Promise$prototype$then, [this, function (result) { - return isolate(onFulfillment, result); - }].concat(args)); - }; + suspendListeners: function (eventNames, target, method, callback) { + var sus = this._suspendedListeners; + if (!sus) { + sus = this._suspendedListeners = []; + } + for (var i = 0; i < eventNames.length; i++) { + sus.push(eventNames[i], target, method); + } + try { + return callback.call(target); + } finally { + if (sus.length === eventNames.length) { + this._suspendedListeners = undefined; + } else { + for (var i = sus.length - 3; i >= 0; i -= 3) { + if (sus[i + 1] === target && sus[i + 2] === method && eventNames.indexOf(sus[i]) !== -1) { + sus.splice(i, 3); + } + } + } + } + }, - return TestPromise; - })(_emberRuntime.RSVP.Promise); + watchedEvents: function () { + var pointer = this; + var names = {}; + while (pointer) { + var listeners = pointer._listeners; + if (listeners) { + for (var index = 0; index < listeners.length - 3; index += 4) { + names[listeners[index]] = true; + } + } + if (pointer._listenersFinalized) { + break; + } + pointer = pointer.parent; + } + return Object.keys(names); + }, - exports.default = TestPromise; + _initializeListeners: function () { + this._listeners = undefined; + this._listenersFinalized = undefined; + this._suspendedListeners = undefined; + } + }; - function promise(resolver, label) { - var fullLabel = 'Ember.Test.promise: ' + (label || ''); - return new TestPromise(resolver, fullLabel); + exports.protoMethods = protoMethods; + function pushUniqueListener(destination, source, index) { + var target = source[index + 1]; + var method = source[index + 2]; + for (var destinationIndex = 0; destinationIndex < destination.length - 2; destinationIndex += 3) { + if (destination[destinationIndex] === target && destination[destinationIndex + 1] === method) { + return; + } + } + destination.push(target, method, source[index + 3]); } +}); +enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'ember-metal/debug', 'ember-metal/meta', 'ember-metal/expand_properties', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/binding', 'ember-metal/observer', 'ember-metal/events'], function (exports, _emberUtils, _emberMetalError, _emberMetalDebug, _emberMetalMeta, _emberMetalExpand_properties, _emberMetalProperties, _emberMetalComputed, _emberMetalBinding, _emberMetalObserver, _emberMetalEvents) { + 'no use strict'; + // Remove "use strict"; from transpiled module until + // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed /** - Replacement for `Ember.RSVP.resolve` - The only difference is this uses - an instance of `Ember.Test.Promise` - - @public - @for Ember.Test - @method resolve - @param {Mixed} The value to resolve - @since 1.2.0 + @module ember + @submodule ember-metal */ + exports.detectBinding = detectBinding; + exports.mixin = mixin; + exports.hasUnprocessedMixins = hasUnprocessedMixins; + exports.clearUnprocessedMixins = clearUnprocessedMixins; + exports.required = required; + exports.aliasMethod = aliasMethod; + exports.observer = observer; + exports._immediateObserver = _immediateObserver; + exports._beforeObserver = _beforeObserver; - function resolve(result, label) { - return TestPromise.resolve(result, label); - } + function ROOT() {} + ROOT.__hasSuper = false; - function getLastPromise() { - return lastPromise; - } + var a_slice = Array.prototype.slice; + var a_concat = Array.prototype.concat; + var isArray = Array.isArray; - // This method isolates nested async methods - // so that they don't conflict with other last promises. - // - // 1. Set `Ember.Test.lastPromise` to null - // 2. Invoke method - // 3. Return the last promise created during method - function isolate(onFulfillment, result) { - // Reset lastPromise for nested helpers - lastPromise = null; + function isMethod(obj) { + return 'function' === typeof obj && obj.isMethod !== false && obj !== Boolean && obj !== Object && obj !== Number && obj !== Array && obj !== Date && obj !== String; + } - var value = onFulfillment(result); + var CONTINUE = {}; - var promise = lastPromise; - lastPromise = null; + function mixinProperties(mixinsMeta, mixin) { + var guid = undefined; - // If the method returned a promise - // return that promise. If not, - // return the last async helper's promise - if (value && value instanceof TestPromise || !promise) { - return value; + if (mixin instanceof Mixin) { + guid = _emberUtils.guidFor(mixin); + if (mixinsMeta.peekMixins(guid)) { + return CONTINUE; + } + mixinsMeta.writeMixins(guid, mixin); + return mixin.properties; } else { - return _emberTestingTestRun.default(function () { - return resolve(promise).then(function () { - return value; - }); - }); + return mixin; // apply anonymous mixin properties } } -}); -enifed('ember-testing/test/run', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; - exports.default = run; - - function run(fn) { - if (!_emberMetal.run.currentRunLoop) { - return _emberMetal.run(fn); - } else { - return fn(); + function concatenatedMixinProperties(concatProp, props, values, base) { + // reset before adding each new mixin to pickup concats from previous + var concats = values[concatProp] || base[concatProp]; + if (props[concatProp]) { + concats = concats ? a_concat.call(concats, props[concatProp]) : props[concatProp]; } + return concats; } -}); -enifed('ember-testing/test/waiters', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; - exports.registerWaiter = registerWaiter; - exports.unregisterWaiter = unregisterWaiter; - exports.checkWaiters = checkWaiters; - exports.generateDeprecatedWaitersArray = generateDeprecatedWaitersArray; + function giveDescriptorSuper(meta, key, property, values, descs, base) { + var superProperty = undefined; - var contexts = []; - var callbacks = []; + // Computed properties override methods, and do not call super to them + if (values[key] === undefined) { + // Find the original descriptor in a parent mixin + superProperty = descs[key]; + } - /** - This allows ember-testing to play nicely with other asynchronous - events, such as an application that is waiting for a CSS3 - transition or an IndexDB transaction. The waiter runs periodically - after each async helper (i.e. `click`, `andThen`, `visit`, etc) has executed, - until the returning result is truthy. After the waiters finish, the next async helper - is executed and the process repeats. - - For example: - - ```javascript - Ember.Test.registerWaiter(function() { - return myPendingTransactions() == 0; - }); - ``` - The `context` argument allows you to optionally specify the `this` - with which your callback will be invoked. - - For example: - - ```javascript - Ember.Test.registerWaiter(MyDB, MyDB.hasPendingTransactions); - ``` - - @public - @for Ember.Test - @method registerWaiter - @param {Object} context (optional) - @param {Function} callback - @since 1.2.0 - */ + // If we didn't find the original descriptor in a parent mixin, find + // it on the original object. + if (!superProperty) { + var possibleDesc = base[key]; + var superDesc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - function registerWaiter(context, callback) { - if (arguments.length === 1) { - callback = context; - context = null; + superProperty = superDesc; } - if (indexOf(context, callback) > -1) { - return; + + if (superProperty === undefined || !(superProperty instanceof _emberMetalComputed.ComputedProperty)) { + return property; } - contexts.push(context); - callbacks.push(callback); + + // Since multiple mixins may inherit from the same parent, we need + // to clone the computed property so that other mixins do not receive + // the wrapped version. + property = Object.create(property); + property._getter = _emberUtils.wrap(property._getter, superProperty._getter); + if (superProperty._setter) { + if (property._setter) { + property._setter = _emberUtils.wrap(property._setter, superProperty._setter); + } else { + property._setter = superProperty._setter; + } + } + + return property; } - /** - `unregisterWaiter` is used to unregister a callback that was - registered with `registerWaiter`. - - @public - @for Ember.Test - @method unregisterWaiter - @param {Object} context (optional) - @param {Function} callback - @since 1.2.0 - */ + function giveMethodSuper(obj, key, method, values, descs) { + var superMethod = undefined; - function unregisterWaiter(context, callback) { - if (!callbacks.length) { - return; + // Methods overwrite computed properties, and do not call super to them. + if (descs[key] === undefined) { + // Find the original method in a parent mixin + superMethod = values[key]; } - if (arguments.length === 1) { - callback = context; - context = null; + + // If we didn't find the original value in a parent mixin, find it in + // the original object + superMethod = superMethod || obj[key]; + + // Only wrap the new method if the original method was a function + if (superMethod === undefined || 'function' !== typeof superMethod) { + return method; } - var i = indexOf(context, callback); - if (i === -1) { - return; + + return _emberUtils.wrap(method, superMethod); + } + + function applyConcatenatedProperties(obj, key, value, values) { + var baseValue = values[key] || obj[key]; + var ret = undefined; + + if (baseValue === null || baseValue === undefined) { + ret = _emberUtils.makeArray(value); + } else { + if (isArray(baseValue)) { + if (value === null || value === undefined) { + ret = baseValue; + } else { + ret = a_concat.call(baseValue, value); + } + } else { + ret = a_concat.call(_emberUtils.makeArray(baseValue), value); + } } - contexts.splice(i, 1); - callbacks.splice(i, 1); + + _emberMetalDebug.runInDebug(function () { + // it is possible to use concatenatedProperties with strings (which cannot be frozen) + // only freeze objects... + if (typeof ret === 'object' && ret !== null) { + // prevent mutating `concatenatedProperties` array after it is applied + Object.freeze(ret); + } + }); + + return ret; } - /** - Iterates through each registered test waiter, and invokes - its callback. If any waiter returns false, this method will return - true indicating that the waiters have not settled yet. - - This is generally used internally from the acceptance/integration test - infrastructure. - - @public - @for Ember.Test - @static - @method checkWaiters - */ + function applyMergedProperties(obj, key, value, values) { + var baseValue = values[key] || obj[key]; - function checkWaiters() { - if (!callbacks.length) { - return false; + _emberMetalDebug.runInDebug(function () { + if (isArray(value)) { + // use conditional to avoid stringifying every time + _emberMetalDebug.assert('You passed in `' + JSON.stringify(value) + '` as the value for `' + key + '` but `' + key + '` cannot be an Array', false); + } + }); + + if (!baseValue) { + return value; } - for (var i = 0; i < callbacks.length; i++) { - var context = contexts[i]; - var callback = callbacks[i]; - if (!callback.call(context)) { - return true; + + var newBase = _emberUtils.assign({}, baseValue); + var hasFunction = false; + + for (var prop in value) { + if (!value.hasOwnProperty(prop)) { + continue; } - } - return false; - } - function indexOf(context, callback) { - for (var i = 0; i < callbacks.length; i++) { - if (callbacks[i] === callback && contexts[i] === context) { - return i; + var propValue = value[prop]; + if (isMethod(propValue)) { + // TODO: support for Computed Properties, etc? + hasFunction = true; + newBase[prop] = giveMethodSuper(obj, prop, propValue, baseValue, {}); + } else { + newBase[prop] = propValue; } } - return -1; + + if (hasFunction) { + newBase._super = ROOT; + } + + return newBase; } - function generateDeprecatedWaitersArray() { - _emberMetal.deprecate('Usage of `Ember.Test.waiters` is deprecated. Please refactor to `Ember.Test.checkWaiters`.', !true, { until: '2.8.0', id: 'ember-testing.test-waiters' }); + function addNormalizedProperty(base, key, value, meta, descs, values, concats, mergings) { + if (value instanceof _emberMetalProperties.Descriptor) { + if (value === REQUIRED && descs[key]) { + return CONTINUE; + } - var array = new Array(callbacks.length); - for (var i = 0; i < callbacks.length; i++) { - var context = contexts[i]; - var callback = callbacks[i]; + // Wrap descriptor function to implement + // _super() if needed + if (value._getter) { + value = giveDescriptorSuper(meta, key, value, values, descs, base); + } - array[i] = [context, callback]; - } + descs[key] = value; + values[key] = undefined; + } else { + if (concats && concats.indexOf(key) >= 0 || key === 'concatenatedProperties' || key === 'mergedProperties') { + value = applyConcatenatedProperties(base, key, value, values); + } else if (mergings && mergings.indexOf(key) >= 0) { + value = applyMergedProperties(base, key, value, values); + } else if (isMethod(value)) { + value = giveMethodSuper(base, key, value, values, descs); + } - return array; + descs[key] = undefined; + values[key] = value; + } } -}); -enifed("ember-utils/apply-str", ["exports"], function (exports) { - /** - @param {Object} t target - @param {String} m method - @param {Array} a args - @private - */ - "use strict"; - exports.default = applyStr; + function mergeMixins(mixins, m, descs, values, base, keys) { + var currentMixin = undefined, + props = undefined, + key = undefined, + concats = undefined, + mergings = undefined; - function applyStr(t, m, a) { - var l = a && a.length; - if (!a || !l) { - return t[m](); - } - switch (l) { - case 1: - return t[m](a[0]); - case 2: - return t[m](a[0], a[1]); - case 3: - return t[m](a[0], a[1], a[2]); - case 4: - return t[m](a[0], a[1], a[2], a[3]); - case 5: - return t[m](a[0], a[1], a[2], a[3], a[4]); - default: - return t[m].apply(t, a); + function removeKeys(keyName) { + delete descs[keyName]; + delete values[keyName]; } - } -}); -enifed("ember-utils/assign", ["exports"], function (exports) { - /** - Copy properties from a source object to a target object. - - ```javascript - var a = { first: 'Yehuda' }; - var b = { last: 'Katz' }; - var c = { company: 'Tilde Inc.' }; - Ember.assign(a, b, c); // a === { first: 'Yehuda', last: 'Katz', company: 'Tilde Inc.' }, b === { last: 'Katz' }, c === { company: 'Tilde Inc.' } - ``` - - @method assign - @for Ember - @param {Object} original The object to assign into - @param {Object} ...args The objects to copy properties from - @return {Object} - @public - */ - "use strict"; - exports.default = assign; + for (var i = 0; i < mixins.length; i++) { + currentMixin = mixins[i]; + _emberMetalDebug.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(currentMixin), typeof currentMixin === 'object' && currentMixin !== null && Object.prototype.toString.call(currentMixin) !== '[object Array]'); - function assign(original) { - for (var i = 1; i < arguments.length; i++) { - var arg = arguments[i]; - if (!arg) { + props = mixinProperties(m, currentMixin); + if (props === CONTINUE) { continue; } - var updates = Object.keys(arg); + if (props) { + if (base.willMergeMixin) { + base.willMergeMixin(props); + } + concats = concatenatedMixinProperties('concatenatedProperties', props, values, base); + mergings = concatenatedMixinProperties('mergedProperties', props, values, base); - for (var _i = 0; _i < updates.length; _i++) { - var prop = updates[_i]; - original[prop] = arg[prop]; + for (key in props) { + if (!props.hasOwnProperty(key)) { + continue; + } + keys.push(key); + addNormalizedProperty(base, key, props[key], m, descs, values, concats, mergings); + } + + // manually copy toString() because some JS engines do not enumerate it + if (props.hasOwnProperty('toString')) { + base.toString = props.toString; + } + } else if (currentMixin.mixins) { + mergeMixins(currentMixin.mixins, m, descs, values, base, keys); + if (currentMixin._without) { + currentMixin._without.forEach(removeKeys); + } } } + } - return original; + function detectBinding(key) { + var length = key.length; + + return length > 7 && key.charCodeAt(length - 7) === 66 && key.indexOf('inding', length - 6) !== -1; } -}); -enifed('ember-utils/dictionary', ['exports', 'ember-utils/empty-object'], function (exports, _emberUtilsEmptyObject) { - 'use strict'; - exports.default = makeDictionary; + // warm both paths of above function + detectBinding('notbound'); + detectBinding('fooBinding'); - // 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. + function connectBindings(obj, m) { + // TODO Mixin.apply(instance) should disconnect binding if exists + m.forEachBindings(function (key, binding) { + if (binding) { + var to = key.slice(0, -7); // strip Binding off end + if (binding instanceof _emberMetalBinding.Binding) { + binding = binding.copy(); // copy prototypes' instance + binding.to(to); + } else { + // binding is string path + binding = new _emberMetalBinding.Binding(to, binding); + } + binding.connect(obj); + obj[key] = binding; + } + }); + // mark as applied + m.clearBindings(); + } - function makeDictionary(parent) { - var dict = undefined; - if (parent === null) { - dict = new _emberUtilsEmptyObject.default(); + function finishPartial(obj, m) { + connectBindings(obj, m || _emberMetalMeta.meta(obj)); + return obj; + } + + function followAlias(obj, desc, m, descs, values) { + var altKey = desc.methodName; + var value = undefined; + var possibleDesc = undefined; + if (descs[altKey] || values[altKey]) { + value = values[altKey]; + desc = descs[altKey]; + } else if ((possibleDesc = obj[altKey]) && possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor) { + desc = possibleDesc; + value = undefined; } else { - dict = Object.create(parent); + desc = undefined; + value = obj[altKey]; } - dict['_dict'] = null; - delete dict['_dict']; - return dict; + + return { desc: desc, value: value }; } -}); -enifed("ember-utils/empty-object", ["exports"], function (exports) { - // This exists because `Object.create(null)` is absurdly slow compared - // to `new EmptyObject()`. In either case, you want a null prototype - // when you're treating the object instances as arbitrary dictionaries - // and don't want your keys colliding with build-in methods on the - // default object prototype. - "use strict"; + function updateObserversAndListeners(obj, key, observerOrListener, pathsKey, updateMethod) { + var paths = observerOrListener[pathsKey]; - var proto = Object.create(null, { - // without this, we will always still end up with (new - // EmptyObject()).constructor === Object - constructor: { - value: undefined, - enumerable: false, - writable: true + if (paths) { + for (var i = 0; i < paths.length; i++) { + updateMethod(obj, paths[i], null, key); + } } - }); + } - function EmptyObject() {} - EmptyObject.prototype = proto; - exports.default = EmptyObject; -}); -enifed('ember-utils/guid', ['exports', 'ember-utils/intern'], function (exports, _emberUtilsIntern) { - 'use strict'; + function replaceObserversAndListeners(obj, key, observerOrListener) { + var prev = obj[key]; - exports.uuid = uuid; - exports.generateGuid = generateGuid; - exports.guidFor = guidFor; + if ('function' === typeof prev) { + updateObserversAndListeners(obj, key, prev, '__ember_observesBefore__', _emberMetalObserver._removeBeforeObserver); + updateObserversAndListeners(obj, key, prev, '__ember_observes__', _emberMetalObserver.removeObserver); + updateObserversAndListeners(obj, key, prev, '__ember_listens__', _emberMetalEvents.removeListener); + } - /** - Previously we used `Ember.$.uuid`, however `$.uuid` has been removed from - jQuery master. We'll just bootstrap our own uuid now. - - @private - @return {Number} the uuid - */ - var _uuid = 0; + if ('function' === typeof observerOrListener) { + updateObserversAndListeners(obj, key, observerOrListener, '__ember_observesBefore__', _emberMetalObserver._addBeforeObserver); + updateObserversAndListeners(obj, key, observerOrListener, '__ember_observes__', _emberMetalObserver.addObserver); + updateObserversAndListeners(obj, key, observerOrListener, '__ember_listens__', _emberMetalEvents.addListener); + } + } - /** - Generates a universally unique identifier. This method - is used internally by Ember for assisting with - the generation of GUID's and other unique identifiers. - - @public - @return {Number} [description] - */ + function applyMixin(obj, mixins, partial) { + var descs = {}; + var values = {}; + var m = _emberMetalMeta.meta(obj); + var keys = []; + var key = undefined, + value = undefined, + desc = undefined; - function uuid() { - return ++_uuid; - } + obj._super = ROOT; - /** - Prefix used for guids through out Ember. - @private - @property GUID_PREFIX - @for Ember - @type String - @final - */ - var GUID_PREFIX = 'ember'; + // Go through all mixins and hashes passed in, and: + // + // * Handle concatenated properties + // * Handle merged properties + // * Set up _super wrapping if necessary + // * Set up computed property descriptors + // * Copying `toString` in broken browsers + mergeMixins(mixins, m, descs, values, obj, keys); - // Used for guid generation... - var numberCache = []; - var stringCache = {}; + for (var i = 0; i < keys.length; i++) { + key = keys[i]; + if (key === 'constructor' || !values.hasOwnProperty(key)) { + continue; + } - /** - A unique key used to assign guids and other private metadata to objects. - If you inspect an object in your browser debugger you will often see these. - They can be safely ignored. - - On browsers that support it, these properties are added with enumeration - disabled so they won't show up when you iterate over your properties. - - @private - @property GUID_KEY - @for Ember - @type String - @final - */ - var GUID_KEY = _emberUtilsIntern.default('__ember' + +new Date()); + desc = descs[key]; + value = values[key]; - exports.GUID_KEY = GUID_KEY; - var GUID_DESC = { - writable: true, - configurable: true, - enumerable: false, - value: null - }; + if (desc === REQUIRED) { + continue; + } - exports.GUID_DESC = GUID_DESC; - var nullDescriptor = { - configurable: true, - writable: true, - enumerable: false, - value: null - }; + while (desc && desc instanceof Alias) { + var followed = followAlias(obj, desc, m, descs, values); + desc = followed.desc; + value = followed.value; + } - var GUID_KEY_PROPERTY = { - name: GUID_KEY, - descriptor: nullDescriptor - }; + if (desc === undefined && value === undefined) { + continue; + } + + replaceObserversAndListeners(obj, key, value); + + if (detectBinding(key)) { + m.writeBindings(key, value); + } + + _emberMetalProperties.defineProperty(obj, key, desc, value, m); + } + + if (!partial) { + // don't apply to prototype + finishPartial(obj, m); + } + + return obj; + } - exports.GUID_KEY_PROPERTY = GUID_KEY_PROPERTY; /** - Generates a new guid, optionally saving the guid to the object that you - pass in. You will rarely need to use this method. Instead you should - call `Ember.guidFor(obj)`, which return an existing guid if available. - - @private - @method generateGuid + @method mixin @for Ember - @param {Object} [obj] Object the guid will be used for. If passed in, the guid will - be saved on the object and reused whenever you pass the same object - again. - - If no object is passed, just generate a new guid. - @param {String} [prefix] Prefix to place in front of the guid. Useful when you want to - separate the guid into separate namespaces. - @return {String} the guid + @param obj + @param mixins* + @return obj + @private */ - function generateGuid(obj, prefix) { - if (!prefix) { - prefix = GUID_PREFIX; + function mixin(obj) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; } - var ret = prefix + uuid(); - if (obj) { - if (obj[GUID_KEY] === null) { - obj[GUID_KEY] = ret; - } else { - GUID_DESC.value = ret; - if (obj.__defineNonEnumerable) { - obj.__defineNonEnumerable(GUID_KEY_PROPERTY); - } else { - Object.defineProperty(obj, GUID_KEY, GUID_DESC); - } - } - } - return ret; + applyMixin(obj, args, false); + return obj; } /** - Returns a unique id for the object. If the object does not yet have a guid, - one will be assigned to it. You can call this on any object, - `Ember.Object`-based or not, but be aware that it will add a `_guid` - property. + The `Ember.Mixin` class allows you to create mixins, whose properties can be + added to other classes. For instance, - You can also use this method on DOM Element objects. + ```javascript + const EditableMixin = Ember.Mixin.create({ + edit() { + console.log('starting to edit'); + this.set('isEditing', true); + }, + isEditing: false + }); + + // Mix mixins into classes by passing them as the first arguments to + // `.extend.` + const Comment = Ember.Object.extend(EditableMixin, { + post: null + }); + + let comment = Comment.create(post: somePost); + comment.edit(); // outputs 'starting to edit' + ``` + + Note that Mixins are created with `Ember.Mixin.create`, not + `Ember.Mixin.extend`. + + Note that mixins extend a constructor's prototype so arrays and object literals + defined as properties will be shared amongst objects that implement the mixin. + If you want to define a property in a mixin that is not shared, you can define + it either as a computed property or have it be created on initialization of the object. + ```javascript + // filters array will be shared amongst any object implementing mixin + const FilterableMixin = Ember.Mixin.create({ + filters: Ember.A() + }); + + // filters will be a separate array for every object implementing the mixin + const FilterableMixin = Ember.Mixin.create({ + filters: Ember.computed(function() { + return Ember.A(); + }) + }); + + // filters will be created as a separate array during the object's initialization + const Filterable = Ember.Mixin.create({ + init() { + this._super(...arguments); + this.set("filters", Ember.A()); + } + }); + ``` + + @class Mixin + @namespace Ember @public - @method guidFor - @for Ember - @param {Object} obj any object, string, number, Element, or primitive - @return {String} the unique guid for this instance. */ - function guidFor(obj) { - var type = typeof obj; - var isObject = type === 'object' && obj !== null; - var isFunction = type === 'function'; + var Mixin = (function () { + function Mixin(args, properties) { + babelHelpers.classCallCheck(this, Mixin); - if ((isObject || isFunction) && obj[GUID_KEY]) { - return obj[GUID_KEY]; - } + this.properties = properties; - // special cases where we don't want to add a key to object - if (obj === undefined) { - return '(undefined)'; - } + var length = args && args.length; - if (obj === null) { - return '(null)'; + if (length > 0) { + var m = new Array(length); + + for (var i = 0; i < length; i++) { + var x = args[i]; + if (x instanceof Mixin) { + m[i] = x; + } else { + m[i] = new Mixin(undefined, x); + } + } + + this.mixins = m; + } else { + this.mixins = undefined; + } + this.ownerConstructor = undefined; + this._without = undefined; + this[_emberUtils.GUID_KEY] = null; + this[_emberUtils.NAME_KEY] = null; + _emberMetalDebug.debugSeal(this); } - var ret = undefined; + Mixin.applyPartial = function applyPartial(obj) { + var args = a_slice.call(arguments, 1); + return applyMixin(obj, args, true); + }; - // Don't allow prototype changes to String etc. to change the guidFor - switch (type) { - case 'number': - ret = numberCache[obj]; + /** + @method create + @static + @param arguments* + @public + */ + + Mixin.create = function create() { + // ES6TODO: this relies on a global state? + unprocessedFlag = true; + var M = this; + + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return new M(args, undefined); + }; - if (!ret) { - ret = numberCache[obj] = 'nu' + obj; - } + // returns the mixins currently applied to the specified object + // TODO: Make Ember.mixin + Mixin.mixins = function mixins(obj) { + var m = _emberMetalMeta.peekMeta(obj); + var ret = []; + if (!m) { return ret; + } - case 'string': - ret = stringCache[obj]; - - if (!ret) { - ret = stringCache[obj] = 'st' + uuid(); + m.forEachMixins(function (key, currentMixin) { + // skip primitive mixins since these are always anonymous + if (!currentMixin.properties) { + ret.push(currentMixin); } + }); - return ret; + return ret; + }; - case 'boolean': - return obj ? '(true)' : '(false)'; + return Mixin; + })(); - default: - if (obj === Object) { - return '(Object)'; - } + exports.default = Mixin; - if (obj === Array) { - return '(Array)'; - } + Mixin._apply = applyMixin; - ret = GUID_PREFIX + uuid(); + Mixin.finishPartial = finishPartial; - if (obj[GUID_KEY] === null) { - obj[GUID_KEY] = ret; - } else { - GUID_DESC.value = ret; + var unprocessedFlag = false; - if (obj.__defineNonEnumerable) { - obj.__defineNonEnumerable(GUID_KEY_PROPERTY); - } else { - Object.defineProperty(obj, GUID_KEY, GUID_DESC); - } - } - return ret; - } + function hasUnprocessedMixins() { + return unprocessedFlag; } -}); -enifed('ember-utils/index', ['exports', 'ember-utils/symbol', 'ember-utils/owner', 'ember-utils/assign', 'ember-utils/empty-object', 'ember-utils/dictionary', 'ember-utils/guid', 'ember-utils/intern', 'ember-utils/super', 'ember-utils/inspect', 'ember-utils/lookup-descriptor', 'ember-utils/invoke', 'ember-utils/make-array', 'ember-utils/apply-str', 'ember-utils/to-string'], function (exports, _emberUtilsSymbol, _emberUtilsOwner, _emberUtilsAssign, _emberUtilsEmptyObject, _emberUtilsDictionary, _emberUtilsGuid, _emberUtilsIntern, _emberUtilsSuper, _emberUtilsInspect, _emberUtilsLookupDescriptor, _emberUtilsInvoke, _emberUtilsMakeArray, _emberUtilsApplyStr, _emberUtilsToString) { - /* - This package will be eagerly parsed and should have no dependencies on external - packages. - - It is intended to be used to share utility methods that will be needed - by every Ember application (and is **not** a dumping ground of useful utilities). - - Utility methods that are needed in < 80% of cases should be placed - elsewhere (so they can be lazily evaluated / parsed). + + function clearUnprocessedMixins() { + unprocessedFlag = false; + } + + var MixinPrototype = Mixin.prototype; + + /** + @method reopen + @param arguments* + @private */ - 'use strict'; + MixinPrototype.reopen = function () { + var currentMixin = undefined; - exports.symbol = _emberUtilsSymbol.default; - exports.getOwner = _emberUtilsOwner.getOwner; - exports.setOwner = _emberUtilsOwner.setOwner; - exports.OWNER = _emberUtilsOwner.OWNER; - exports.assign = _emberUtilsAssign.default; - exports.EmptyObject = _emberUtilsEmptyObject.default; - exports.dictionary = _emberUtilsDictionary.default; - exports.uuid = _emberUtilsGuid.uuid; - exports.GUID_KEY = _emberUtilsGuid.GUID_KEY; - exports.GUID_DESC = _emberUtilsGuid.GUID_DESC; - exports.GUID_KEY_PROPERTY = _emberUtilsGuid.GUID_KEY_PROPERTY; - exports.generateGuid = _emberUtilsGuid.generateGuid; - exports.guidFor = _emberUtilsGuid.guidFor; - exports.intern = _emberUtilsIntern.default; - exports.checkHasSuper = _emberUtilsSuper.checkHasSuper; - exports.ROOT = _emberUtilsSuper.ROOT; - exports.wrap = _emberUtilsSuper.wrap; - exports.inspect = _emberUtilsInspect.default; - exports.lookupDescriptor = _emberUtilsLookupDescriptor.default; - exports.canInvoke = _emberUtilsInvoke.canInvoke; - exports.tryInvoke = _emberUtilsInvoke.tryInvoke; - exports.makeArray = _emberUtilsMakeArray.default; - exports.applyStr = _emberUtilsApplyStr.default; - exports.toString = _emberUtilsToString.default; -}); -enifed('ember-utils/inspect', ['exports'], function (exports) { - 'use strict'; + if (this.properties) { + currentMixin = new Mixin(undefined, this.properties); + this.properties = undefined; + this.mixins = [currentMixin]; + } else if (!this.mixins) { + this.mixins = []; + } - exports.default = inspect; - var objectToString = Object.prototype.toString; + var mixins = this.mixins; + var idx = undefined; + + for (idx = 0; idx < arguments.length; idx++) { + currentMixin = arguments[idx]; + _emberMetalDebug.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(currentMixin), typeof currentMixin === 'object' && currentMixin !== null && Object.prototype.toString.call(currentMixin) !== '[object Array]'); + + if (currentMixin instanceof Mixin) { + mixins.push(currentMixin); + } else { + mixins.push(new Mixin(undefined, currentMixin)); + } + } + + return this; + }; /** - Convenience method to inspect an object. This method will attempt to - convert the object into a useful string description. - - It is a pretty simple implementation. If you want something more robust, - use something like JSDump: https://github.com/NV/jsDump - - @method inspect - @for Ember - @param {Object} obj The object you want to inspect. - @return {String} A description of the object - @since 1.4.0 + @method apply + @param obj + @return applied object @private */ + MixinPrototype.apply = function (obj) { + return applyMixin(obj, [this], false); + }; - function inspect(obj) { - if (obj === null) { - return 'null'; + MixinPrototype.applyPartial = function (obj) { + return applyMixin(obj, [this], true); + }; + + MixinPrototype.toString = Object.toString; + + function _detect(curMixin, targetMixin, seen) { + var guid = _emberUtils.guidFor(curMixin); + + if (seen[guid]) { + return false; } - if (obj === undefined) { - return 'undefined'; + seen[guid] = true; + + if (curMixin === targetMixin) { + return true; } - if (Array.isArray(obj)) { - return '[' + obj + ']'; + var mixins = curMixin.mixins; + var loc = mixins ? mixins.length : 0; + while (--loc >= 0) { + if (_detect(mixins[loc], targetMixin, seen)) { + return true; + } } - // for non objects - var type = typeof obj; - if (type !== 'object' && type !== 'symbol') { - return '' + obj; + return false; + } + + /** + @method detect + @param obj + @return {Boolean} + @private + */ + MixinPrototype.detect = function (obj) { + if (typeof obj !== 'object' || obj === null) { + return false; } - // overridden toString - if (typeof obj.toString === 'function' && obj.toString !== objectToString) { - return obj.toString(); + if (obj instanceof Mixin) { + return _detect(obj, this, {}); + } + var m = _emberMetalMeta.peekMeta(obj); + if (!m) { + return false; } + return !!m.peekMixins(_emberUtils.guidFor(this)); + }; - // Object.prototype.toString === {}.toString - var v = undefined; - var ret = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - v = obj[key]; - if (v === 'toString') { - continue; - } // ignore useless items - if (typeof v === 'function') { - v = 'function() { ... }'; - } + MixinPrototype.without = function () { + var ret = new Mixin([this]); - if (v && typeof v.toString !== 'function') { - ret.push(key + ': ' + objectToString.call(v)); - } else { - ret.push(key + ': ' + v); - } + for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + + ret._without = args; + return ret; + }; + + function _keys(ret, mixin, seen) { + if (seen[_emberUtils.guidFor(mixin)]) { + return; + } + seen[_emberUtils.guidFor(mixin)] = true; + + if (mixin.properties) { + var props = Object.keys(mixin.properties); + for (var i = 0; i < props.length; i++) { + var key = props[i]; + ret[key] = true; } + } else if (mixin.mixins) { + mixin.mixins.forEach(function (x) { + return _keys(ret, x, seen); + }); } - return '{' + ret.join(', ') + '}'; } -}); -enifed("ember-utils/intern", ["exports"], function (exports) { + + MixinPrototype.keys = function () { + var keys = {}; + var seen = {}; + + _keys(keys, this, seen); + var ret = Object.keys(keys); + return ret; + }; + + _emberMetalDebug.debugSeal(MixinPrototype); + + var REQUIRED = new _emberMetalProperties.Descriptor(); + REQUIRED.toString = function () { + return '(Required Property)'; + }; + /** - Strongly hint runtimes to intern the provided string. - - When do I need to use this function? - - For the most part, never. Pre-mature optimization is bad, and often the - runtime does exactly what you need it to, and more often the trade-off isn't - worth it. - - Why? - - Runtimes store strings in at least 2 different representations: - Ropes and Symbols (interned strings). The Rope provides a memory efficient - data-structure for strings created from concatenation or some other string - manipulation like splitting. - - Unfortunately checking equality of different ropes can be quite costly as - runtimes must resort to clever string comparison algorithms. These - algorithms typically cost in proportion to the length of the string. - Luckily, this is where the Symbols (interned strings) shine. As Symbols are - unique by their string content, equality checks can be done by pointer - comparison. - - How do I know if my string is a rope or symbol? - - Typically (warning general sweeping statement, but truthy in runtimes at - present) static strings created as part of the JS source are interned. - Strings often used for comparisons can be interned at runtime if some - criteria are met. One of these criteria can be the size of the entire rope. - For example, in chrome 38 a rope longer then 12 characters will not - intern, nor will segments of that rope. - - Some numbers: http://jsperf.com/eval-vs-keys/8 - - Known Trick™ + Denotes a required property for a mixin + @method required + @for Ember @private - @return {String} interned version of the provided string */ - "use strict"; - exports.default = intern; + function required() { + _emberMetalDebug.deprecate('Ember.required is deprecated as its behavior is inconsistent and unreliable.', false, { id: 'ember-metal.required', until: '3.0.0' }); + return REQUIRED; + } - function intern(str) { - var obj = {}; - obj[str] = 1; - for (var key in obj) { - if (key === str) { - return key; - } - } - return str; + function Alias(methodName) { + this.isDescriptor = true; + this.methodName = methodName; } -}); -enifed('ember-utils/invoke', ['exports', 'ember-utils/apply-str'], function (exports, _emberUtilsApplyStr) { - 'use strict'; - exports.canInvoke = canInvoke; - exports.tryInvoke = tryInvoke; + Alias.prototype = new _emberMetalProperties.Descriptor(); /** - Checks to see if the `methodName` exists on the `obj`. + Makes a method available via an additional name. ```javascript - let foo = { bar: function() { return 'bar'; }, baz: null }; + App.Person = Ember.Object.extend({ + name: function() { + return 'Tomhuda Katzdale'; + }, + moniker: Ember.aliasMethod('name') + }); - Ember.canInvoke(foo, 'bar'); // true - Ember.canInvoke(foo, 'baz'); // false - Ember.canInvoke(foo, 'bat'); // false + let goodGuy = App.Person.create(); + + goodGuy.name(); // 'Tomhuda Katzdale' + goodGuy.moniker(); // 'Tomhuda Katzdale' ``` - @method canInvoke + @method aliasMethod @for Ember - @param {Object} obj The object to check for the method - @param {String} methodName The method name to check for - @return {Boolean} - @private + @param {String} methodName name of the method to alias + @public */ - function canInvoke(obj, methodName) { - return !!(obj && typeof obj[methodName] === 'function'); + function aliasMethod(methodName) { + return new Alias(methodName); } + // .......................................................... + // OBSERVER HELPER + // + /** - Checks to see if the `methodName` exists on the `obj`, - and if it does, invokes it with the arguments passed. + Specify a method that observes property changes. ```javascript - let d = new Date('03/15/2013'); - - Ember.tryInvoke(d, 'getTime'); // 1363320000000 - Ember.tryInvoke(d, 'setFullYear', [2014]); // 1394856000000 - Ember.tryInvoke(d, 'noSuchMethod', [2014]); // undefined + Ember.Object.extend({ + valueObserver: Ember.observer('value', function() { + // Executes whenever the "value" property changes + }) + }); ``` - @method tryInvoke + Also available as `Function.prototype.observes` if prototype extensions are + enabled. + + @method observer @for Ember - @param {Object} obj The object to check for the method - @param {String} methodName The method name to check for - @param {Array} [args] The arguments to pass to the method - @return {*} the return value of the invoked method or undefined if it cannot be invoked + @param {String} propertyNames* + @param {Function} func + @return func @public */ - function tryInvoke(obj, methodName, args) { - if (canInvoke(obj, methodName)) { - return args ? _emberUtilsApplyStr.default(obj, methodName, args) : _emberUtilsApplyStr.default(obj, methodName); + function observer() { + for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; } - } -}); -enifed("ember-utils/lookup-descriptor", ["exports"], function (exports) { - "use strict"; - exports.default = lookupDescriptor; + var func = args.slice(-1)[0]; + var paths = undefined; - function lookupDescriptor(obj, keyName) { - var current = obj; - while (current) { - var descriptor = Object.getOwnPropertyDescriptor(current, keyName); + var addWatchedProperty = function (path) { + paths.push(path); + }; + var _paths = args.slice(0, -1); - if (descriptor) { - return descriptor; - } + if (typeof func !== 'function') { + // revert to old, soft-deprecated argument ordering + _emberMetalDebug.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' }); - current = Object.getPrototypeOf(current); + func = args[0]; + _paths = args.slice(1); } - return null; - } -}); -enifed("ember-utils/make-array", ["exports"], function (exports) { - /** - Forces the passed object to be part of an array. If the object is already - an array, it will return the object. Otherwise, it will add the object to - an array. If obj is `null` or `undefined`, it will return an empty array. - - ```javascript - Ember.makeArray(); // [] - Ember.makeArray(null); // [] - Ember.makeArray(undefined); // [] - Ember.makeArray('lindsay'); // ['lindsay'] - Ember.makeArray([1, 2, 42]); // [1, 2, 42] - - let controller = Ember.ArrayProxy.create({ content: [] }); - - Ember.makeArray(controller) === controller; // true - ``` - - @method makeArray - @for Ember - @param {Object} obj the object - @return {Array} - @private - */ - "use strict"; - - exports.default = makeArray; + paths = []; - function makeArray(obj) { - if (obj === null || obj === undefined) { - return []; + for (var i = 0; i < _paths.length; ++i) { + _emberMetalExpand_properties.default(_paths[i], addWatchedProperty); } - return Array.isArray(obj) ? obj : [obj]; - } -}); -enifed('ember-utils/owner', ['exports', 'ember-utils/symbol'], function (exports, _emberUtilsSymbol) { - /** - @module ember - @submodule ember-runtime - */ - 'use strict'; + if (typeof func !== 'function') { + throw new _emberMetalError.default('Ember.observer called without a function'); + } - exports.getOwner = getOwner; - exports.setOwner = setOwner; - var OWNER = _emberUtilsSymbol.default('OWNER'); + func.__ember_observes__ = paths; + return func; + } - exports.OWNER = OWNER; /** - Framework objects in an Ember application (components, services, routes, etc.) - are created via a factory and dependency injection system. Each of these - objects is the responsibility of an "owner", which handled its - instantiation and manages its lifetime. - - `getOwner` fetches the owner object responsible for an instance. This can - be used to lookup or resolve other class instances, or register new factories - into the owner. - - For example, this component dynamically looks up a service based on the - `audioType` passed as an attribute: - - ``` - // app/components/play-audio.js - import Ember from 'ember'; + Specify a method that observes property changes. - // Usage: - // - // {{play-audio audioType=model.audioType audioFile=model.file}} - // - export default Ember.Component.extend({ - audioService: Ember.computed('audioType', function() { - let owner = Ember.getOwner(this); - return owner.lookup(`service:${this.get('audioType')}`); - }), - click() { - let player = this.get('audioService'); - player.play(this.get('audioFile')); - } + ```javascript + Ember.Object.extend({ + valueObserver: Ember.immediateObserver('value', function() { + // Executes whenever the "value" property changes + }) }); ``` - @method getOwner + In the future, `Ember.observer` may become asynchronous. In this event, + `Ember.immediateObserver` will maintain the synchronous behavior. + + Also available as `Function.prototype.observesImmediately` if prototype extensions are + enabled. + + @method _immediateObserver @for Ember - @param {Object} object An object with an owner. - @return {Object} An owner object. - @since 2.3.0 - @public + @param {String} propertyNames* + @param {Function} func + @deprecated Use `Ember.observer` instead. + @return func + @private */ - function getOwner(object) { - return object[OWNER]; + function _immediateObserver() { + _emberMetalDebug.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; i < arguments.length; i++) { + var arg = arguments[i]; + _emberMetalDebug.assert('Immediate observers must observe internal properties only, not properties on other objects.', typeof arg !== 'string' || arg.indexOf('.') === -1); + } + + return observer.apply(this, arguments); } /** - `setOwner` forces a new owner on a given object instance. This is primarily - useful in some testing cases. + When observers fire, they are called with the arguments `obj`, `keyName`. - @method setOwner + Note, `@each.property` observer is called per each add or replace of an element + and it's not called with a specific enumeration item. + + A `_beforeObserver` fires before a property changes. + + @method beforeObserver @for Ember - @param {Object} object An object with an owner. - @return {Object} An owner object. - @since 2.3.0 - @public + @param {String} propertyNames* + @param {Function} func + @return func + @deprecated + @private */ - function setOwner(object, owner) { - object[OWNER] = owner; - } -}); -enifed('ember-utils/super', ['exports'], function (exports) { - 'use strict'; - - exports.wrap = wrap; - var HAS_SUPER_PATTERN = /\.(_super|call\(this|apply\(this)/; - var fnToString = Function.prototype.toString; - - var checkHasSuper = (function () { - var sourceAvailable = fnToString.call(function () { - return this; - }).indexOf('return this') > -1; - - if (sourceAvailable) { - return function checkHasSuper(func) { - return HAS_SUPER_PATTERN.test(fnToString.call(func)); - }; + function _beforeObserver() { + for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { + args[_key5] = arguments[_key5]; } - return function checkHasSuper() { - return true; + var func = args.slice(-1)[0]; + var paths = undefined; + + var addWatchedProperty = function (path) { + paths.push(path); }; - })(); - exports.checkHasSuper = checkHasSuper; - function ROOT() {} - ROOT.__hasSuper = false; + var _paths = args.slice(0, -1); - function hasSuper(func) { - if (func.__hasSuper === undefined) { - func.__hasSuper = checkHasSuper(func); + if (typeof func !== 'function') { + // revert to old, soft-deprecated argument ordering + + func = args[0]; + _paths = args.slice(1); } - return func.__hasSuper; - } - /** - 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 - @method wrap - @for Ember - @param {Function} func The function to call - @param {Function} superFunc The super function. - @return {Function} wrapped function. - */ + paths = []; - function wrap(func, superFunc) { - if (!hasSuper(func)) { - return func; - } - // ensure an unwrapped super that calls _super is wrapped with a terminal _super - if (!superFunc.wrappedFunction && hasSuper(superFunc)) { - return _wrap(func, _wrap(superFunc, ROOT)); + for (var i = 0; i < _paths.length; ++i) { + _emberMetalExpand_properties.default(_paths[i], addWatchedProperty); } - return _wrap(func, superFunc); - } - function _wrap(func, superFunc) { - function superWrapper() { - var orig = this._super; - this._super = superFunc; - var ret = func.apply(this, arguments); - this._super = orig; - return ret; + if (typeof func !== 'function') { + throw new _emberMetalError.default('_beforeObserver called without a function'); } - superWrapper.wrappedFunction = func; - superWrapper.__ember_observes__ = func.__ember_observes__; - superWrapper.__ember_observesBefore__ = func.__ember_observesBefore__; - superWrapper.__ember_listens__ = func.__ember_listens__; - - return superWrapper; + func.__ember_observesBefore__ = paths; + return func; } -}); -enifed('ember-utils/symbol', ['exports', 'ember-utils/guid', 'ember-utils/intern'], function (exports, _emberUtilsGuid, _emberUtilsIntern) { - 'use strict'; - - exports.default = symbol; - function symbol(debugName) { - // TODO: Investigate using platform symbols, but we do not - // want to require non-enumerability for this API, which - // would introduce a large cost. - var id = _emberUtilsGuid.GUID_KEY + Math.floor(Math.random() * new Date()); - return _emberUtilsIntern.default('__' + debugName + '__ [id=' + id + ']'); - } + exports.Mixin = Mixin; + exports.REQUIRED = REQUIRED; }); -enifed("ember-utils/to-string", ["exports"], function (exports) { - "use strict"; +enifed('ember-metal/observer', ['exports', 'ember-metal/watching', 'ember-metal/events'], function (exports, _emberMetalWatching, _emberMetalEvents) { + 'use strict'; - exports.default = toString; - var objectToString = Object.prototype.toString; + exports.addObserver = addObserver; + exports.observersFor = observersFor; + exports.removeObserver = removeObserver; + exports._addBeforeObserver = _addBeforeObserver; + exports._suspendObserver = _suspendObserver; + exports._suspendObservers = _suspendObservers; + exports._removeBeforeObserver = _removeBeforeObserver; - /* - A `toString` util function that supports objects without a `toString` - method, e.g. an object created with `Object.create(null)`. + /** + @module ember-metal */ - function toString(obj) { - if (obj && obj.toString) { - return obj.toString(); - } else { - return objectToString.call(obj); - } + var AFTER_OBSERVERS = ':change'; + var BEFORE_OBSERVERS = ':before'; + + function changeEvent(keyName) { + return keyName + AFTER_OBSERVERS; } -}); -enifed('ember-views/compat/attrs', ['exports', 'ember-utils'], function (exports, _emberUtils) { - 'use strict'; - var MUTABLE_CELL = _emberUtils.symbol('MUTABLE_CELL'); - exports.MUTABLE_CELL = MUTABLE_CELL; -}); -enifed('ember-views/compat/fallback-view-registry', ['exports', 'ember-utils'], function (exports, _emberUtils) { - 'use strict'; + function beforeEvent(keyName) { + return keyName + BEFORE_OBSERVERS; + } - exports.default = _emberUtils.dictionary(null); -}); -enifed('ember-views/component_lookup', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { - 'use strict'; + /** + @method addObserver + @for Ember + @param obj + @param {String} _path + @param {Object|Function} target + @param {Function|String} [method] + @public + */ - exports.default = _emberRuntime.Object.extend({ - componentFor: function (name, owner, options) { - _emberMetal.assert('You cannot use \'' + name + '\' as a component name. Component names must contain a hyphen.', ~name.indexOf('-')); + function addObserver(obj, _path, target, method) { + _emberMetalEvents.addListener(obj, changeEvent(_path), target, method); + _emberMetalWatching.watch(obj, _path); - var fullName = 'component:' + name; - return owner._lookupFactory(fullName, options); - }, + return this; + } - layoutFor: function (name, owner, options) { - _emberMetal.assert('You cannot use \'' + name + '\' as a component name. Component names must contain a hyphen.', ~name.indexOf('-')); + function observersFor(obj, path) { + return _emberMetalEvents.listenersFor(obj, changeEvent(path)); + } - var templateFullName = 'template:components/' + name; - return owner.lookup(templateFullName, options); - } - }); -}); -enifed('ember-views/index', ['exports', 'ember-views/system/ext', 'ember-views/system/jquery', 'ember-views/system/utils', 'ember-views/system/event_dispatcher', 'ember-views/component_lookup', 'ember-views/mixins/text_support', 'ember-views/views/core_view', 'ember-views/mixins/class_names_support', 'ember-views/mixins/child_views_support', 'ember-views/mixins/view_state_support', 'ember-views/mixins/view_support', 'ember-views/mixins/action_support', 'ember-views/compat/attrs', 'ember-views/system/lookup_partial', 'ember-views/utils/lookup-component', 'ember-views/system/action_manager', 'ember-views/compat/fallback-view-registry'], function (exports, _emberViewsSystemExt, _emberViewsSystemJquery, _emberViewsSystemUtils, _emberViewsSystemEvent_dispatcher, _emberViewsComponent_lookup, _emberViewsMixinsText_support, _emberViewsViewsCore_view, _emberViewsMixinsClass_names_support, _emberViewsMixinsChild_views_support, _emberViewsMixinsView_state_support, _emberViewsMixinsView_support, _emberViewsMixinsAction_support, _emberViewsCompatAttrs, _emberViewsSystemLookup_partial, _emberViewsUtilsLookupComponent, _emberViewsSystemAction_manager, _emberViewsCompatFallbackViewRegistry) { /** - @module ember - @submodule ember-views + @method removeObserver + @for Ember + @param obj + @param {String} path + @param {Object|Function} target + @param {Function|String} [method] + @public */ - 'use strict'; + function removeObserver(obj, path, target, method) { + _emberMetalWatching.unwatch(obj, path); + _emberMetalEvents.removeListener(obj, changeEvent(path), target, method); + + return this; + } - exports.jQuery = _emberViewsSystemJquery.default; - exports.isSimpleClick = _emberViewsSystemUtils.isSimpleClick; - exports.getViewBounds = _emberViewsSystemUtils.getViewBounds; - exports.getViewClientRects = _emberViewsSystemUtils.getViewClientRects; - exports.getViewBoundingClientRect = _emberViewsSystemUtils.getViewBoundingClientRect; - exports.getRootViews = _emberViewsSystemUtils.getRootViews; - exports.getChildViews = _emberViewsSystemUtils.getChildViews; - exports.getViewId = _emberViewsSystemUtils.getViewId; - exports.getViewElement = _emberViewsSystemUtils.getViewElement; - exports.setViewElement = _emberViewsSystemUtils.setViewElement; - exports.STYLE_WARNING = _emberViewsSystemUtils.STYLE_WARNING; - exports.EventDispatcher = _emberViewsSystemEvent_dispatcher.default; - exports.ComponentLookup = _emberViewsComponent_lookup.default; - exports.TextSupport = _emberViewsMixinsText_support.default; - exports.CoreView = _emberViewsViewsCore_view.default; - exports.ClassNamesSupport = _emberViewsMixinsClass_names_support.default; - exports.ChildViewsSupport = _emberViewsMixinsChild_views_support.default; - exports.ViewStateSupport = _emberViewsMixinsView_state_support.default; - exports.ViewMixin = _emberViewsMixinsView_support.default; - exports.ActionSupport = _emberViewsMixinsAction_support.default; - exports.MUTABLE_CELL = _emberViewsCompatAttrs.MUTABLE_CELL; - exports.lookupPartial = _emberViewsSystemLookup_partial.default; - exports.hasPartial = _emberViewsSystemLookup_partial.hasPartial; - exports.lookupComponent = _emberViewsUtilsLookupComponent.default; - exports.ActionManager = _emberViewsSystemAction_manager.default; - exports.fallbackViewRegistry = _emberViewsCompatFallbackViewRegistry.default; -}); -// for the side effect of extending Ember.run.queues -enifed('ember-views/mixins/action_support', ['exports', 'ember-utils', 'ember-metal', 'ember-views/compat/attrs'], function (exports, _emberUtils, _emberMetal, _emberViewsCompatAttrs) { /** - @module ember - @submodule ember-views + @method _addBeforeObserver + @for Ember + @param obj + @param {String} path + @param {Object|Function} target + @param {Function|String} [method] + @deprecated + @private */ - 'use strict'; - function validateAction(component, actionName) { - if (actionName && actionName[_emberViewsCompatAttrs.MUTABLE_CELL]) { - actionName = actionName.value; - } + function _addBeforeObserver(obj, path, target, method) { + _emberMetalEvents.addListener(obj, beforeEvent(path), target, method); + _emberMetalWatching.watch(obj, path); - _emberMetal.assert('The default action was triggered on the component ' + component.toString() + ', but the action name (' + actionName + ') was not a string.', _emberMetal.isNone(actionName) || typeof actionName === 'string' || typeof actionName === 'function'); - return actionName; + return this; + } + + // Suspend observer during callback. + // + // This should only be used by the target of the observer + // while it is setting the observed path. + + function _suspendObserver(obj, path, target, method, callback) { + return _emberMetalEvents.suspendListener(obj, changeEvent(path), target, method, callback); + } + + function _suspendObservers(obj, paths, target, method, callback) { + var events = paths.map(changeEvent); + return _emberMetalEvents.suspendListeners(obj, events, target, method, callback); } /** - @class ActionSupport - @namespace Ember - @private + @method removeBeforeObserver + @for Ember + @param obj + @param {String} path + @param {Object|Function} target + @param {Function|String} [method] + @deprecated + @private */ - exports.default = _emberMetal.Mixin.create({ - /** - 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 - export default Ember.Component.extend({ - click() { - if (this.get('isPlaying')) { - this.sendAction('play'); - } else { - this.sendAction('stop'); - } - } - }); - ``` - The actions "play" and "stop" must be passed to this `play-button` component: - ```handlebars - {{! app/templates/application.hbs }} - {{play-button play=(action "musicStarted") stop=(action "musicStopped")}} - ``` - When the component receives a browser `click` event it translate this - interaction into application-specific semantics ("play" or "stop") and - calls the specified action. - ```javascript - // app/controller/application.js - export default Ember.Controller.extend({ - actions: { - musicStarted() { - // called when the play button is clicked - // and the music started playing - }, - musicStopped() { - // called when the play button is clicked - // and the music stopped playing - } - } - }); - ``` - If no action is passed to `sendAction` a default name of "action" - is assumed. - ```javascript - // app/components/next-button.js - export default Ember.Component.extend({ - click() { - this.sendAction(); - } - }); - ``` - ```handlebars - {{! app/templates/application.hbs }} - {{next-button action=(action "playNextSongInAlbum")}} - ``` - ```javascript - // app/controllers/application.js - App.ApplicationController = Ember.Controller.extend({ - actions: { - playNextSongInAlbum() { - ... - } - } - }); - ``` - @method sendAction - @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 = undefined; - // Send the default action - if (action === undefined) { - action = 'action'; - } - actionName = _emberMetal.get(this, 'attrs.' + action) || _emberMetal.get(this, action); - actionName = validateAction(this, actionName); + function _removeBeforeObserver(obj, path, target, method) { + _emberMetalWatching.unwatch(obj, path); + _emberMetalEvents.removeListener(obj, beforeEvent(path), target, method); - // If no action name for that action could be found, just abort. - if (actionName === undefined) { - return; - } + return this; + } +}); +enifed('ember-metal/observer_set', ['exports', 'ember-utils', 'ember-metal/events'], function (exports, _emberUtils, _emberMetalEvents) { + 'use strict'; - if (typeof actionName === 'function') { - actionName.apply(undefined, contexts); - } else { - this.triggerAction({ - action: actionName, - actionContext: contexts - }); + /* + this.observerSet = { + [senderGuid]: { // variable name: `keySet` + [keyName]: listIndex } }, + this.observers = [ + { + sender: obj, + keyName: keyName, + eventName: eventName, + listeners: [ + [target, method, flags] + ] + }, + ... + ] + */ - send: function (actionName) { - for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } + var ObserverSet = (function () { + function ObserverSet() { + babelHelpers.classCallCheck(this, ObserverSet); - var target = undefined; - var action = this.actions && this.actions[actionName]; + this.clear(); + } - if (action) { - var shouldBubble = action.apply(this, args) === true; - if (!shouldBubble) { - return; + ObserverSet.prototype.add = function add(sender, keyName, eventName) { + var observerSet = this.observerSet; + var observers = this.observers; + var senderGuid = _emberUtils.guidFor(sender); + var keySet = observerSet[senderGuid]; + var index = undefined; + + if (!keySet) { + observerSet[senderGuid] = keySet = {}; + } + index = keySet[keyName]; + if (index === undefined) { + index = observers.push({ + sender: sender, + keyName: keyName, + eventName: eventName, + listeners: [] + }) - 1; + keySet[keyName] = index; + } + return observers[index].listeners; + }; + + ObserverSet.prototype.flush = function flush() { + var observers = this.observers; + var i = undefined, + observer = undefined, + sender = undefined; + this.clear(); + for (i = 0; i < observers.length; ++i) { + observer = observers[i]; + sender = observer.sender; + if (sender.isDestroying || sender.isDestroyed) { + continue; } + _emberMetalEvents.sendEvent(sender, observer.eventName, [sender, observer.keyName], observer.listeners); } + }; - target = _emberMetal.get(this, 'target'); + ObserverSet.prototype.clear = function clear() { + this.observerSet = {}; + this.observers = []; + }; - if (target) { - var _target; + return ObserverSet; + })(); - _emberMetal.assert('The `target` for ' + this + ' (' + target + ') does not have a `send` method', typeof target.send === 'function'); - (_target = target).send.apply(_target, arguments); - } else { - _emberMetal.assert(_emberUtils.inspect(this) + ' had no action handler for: ' + actionName, action); - } - } - }); + exports.default = ObserverSet; }); -enifed('ember-views/mixins/child_views_support', ['exports', 'ember-utils', 'ember-metal', 'ember-views/system/utils'], function (exports, _emberUtils, _emberMetal, _emberViewsSystemUtils) { - /** - @module ember - @submodule ember-views - */ +enifed('ember-metal/path_cache', ['exports', 'ember-metal/cache'], function (exports, _emberMetalCache) { 'use strict'; - exports.default = _emberMetal.Mixin.create({ - init: function () { - this._super.apply(this, arguments); - _emberViewsSystemUtils.initChildViews(this); - }, + exports.isGlobal = isGlobal; + exports.isGlobalPath = isGlobalPath; + exports.hasThis = hasThis; + exports.isPath = isPath; + exports.getFirstKey = getFirstKey; + exports.getTailPath = getTailPath; - /** - Array of child views. You should never edit this array directly. - @property childViews - @type Array - @default [] - @private - */ - childViews: _emberMetal.descriptor({ - configurable: false, - enumerable: false, - get: function () { - return _emberViewsSystemUtils.getChildViews(this); - } - }), + var IS_GLOBAL = /^[A-Z$]/; + var IS_GLOBAL_PATH = /^[A-Z$].*[\.]/; + var HAS_THIS = 'this.'; + + var isGlobalCache = new _emberMetalCache.default(1000, function (key) { + return IS_GLOBAL.test(key); + }); + var isGlobalPathCache = new _emberMetalCache.default(1000, function (key) { + return IS_GLOBAL_PATH.test(key); + }); + var hasThisCache = new _emberMetalCache.default(1000, function (key) { + return key.lastIndexOf(HAS_THIS, 0) === 0; + }); + var firstDotIndexCache = new _emberMetalCache.default(1000, function (key) { + return key.indexOf('.'); + }); + + var firstKeyCache = new _emberMetalCache.default(1000, function (path) { + var index = firstDotIndexCache.get(path); + if (index === -1) { + return path; + } else { + return path.slice(0, index); + } + }); + + var tailPathCache = new _emberMetalCache.default(1000, function (path) { + var index = firstDotIndexCache.get(path); + if (index !== -1) { + return path.slice(index + 1); + } + }); + + var caches = { + isGlobalCache: isGlobalCache, + isGlobalPathCache: isGlobalPathCache, + hasThisCache: hasThisCache, + firstDotIndexCache: firstDotIndexCache, + firstKeyCache: firstKeyCache, + tailPathCache: tailPathCache + }; + + exports.caches = caches; + + function isGlobal(path) { + return isGlobalCache.get(path); + } - appendChild: function (view) { - this.linkChild(view); - _emberViewsSystemUtils.addChildView(this, view); - }, + function isGlobalPath(path) { + return isGlobalPathCache.get(path); + } - linkChild: function (instance) { - if (!_emberUtils.getOwner(instance)) { - _emberUtils.setOwner(instance, _emberUtils.getOwner(this)); - } - } - }); + function hasThis(path) { + return hasThisCache.get(path); + } + + function isPath(path) { + return firstDotIndexCache.get(path) !== -1; + } + + function getFirstKey(path) { + return firstKeyCache.get(path); + } + + function getTailPath(path) { + return tailPathCache.get(path); + } }); -enifed('ember-views/mixins/class_names_support', ['exports', 'ember-metal'], function (exports, _emberMetal) { +enifed('ember-metal/properties', ['exports', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/meta', 'ember-metal/property_events'], function (exports, _emberMetalDebug, _emberMetalFeatures, _emberMetalMeta, _emberMetalProperty_events) { /** - @module ember - @submodule ember-views + @module ember-metal */ 'use strict'; - var EMPTY_ARRAY = Object.freeze([]); + exports.Descriptor = Descriptor; + exports.MANDATORY_SETTER_FUNCTION = MANDATORY_SETTER_FUNCTION; + exports.DEFAULT_GETTER_FUNCTION = DEFAULT_GETTER_FUNCTION; + exports.INHERITING_GETTER_FUNCTION = INHERITING_GETTER_FUNCTION; + exports.defineProperty = defineProperty; + + // .......................................................... + // DESCRIPTOR + // /** - @class ClassNamesSupport - @namespace Ember + Objects of this type can implement an interface to respond to requests to + get and set. The default implementation handles simple properties. + + @class Descriptor @private */ - exports.default = _emberMetal.Mixin.create({ - concatenatedProperties: ['classNames', 'classNameBindings'], - init: function () { - this._super.apply(this, arguments); + function Descriptor() { + this.isDescriptor = true; + } - _emberMetal.assert('Only arrays are allowed for \'classNameBindings\'', Array.isArray(this.classNameBindings)); - this.classNameBindings = this.classNameBindings.slice(); + var REDEFINE_SUPPORTED = (function () { + // https://github.com/spalger/kibana/commit/b7e35e6737df585585332857a4c397dc206e7ff9 + var a = Object.create(Object.prototype, { + prop: { + configurable: true, + value: 1 + } + }); - _emberMetal.assert('Only arrays of static class strings are allowed for \'classNames\'. For dynamic classes, use \'classNameBindings\'.', Array.isArray(this.classNames)); - this.classNames = this.classNames.slice(); - }, + Object.defineProperty(a, 'prop', { + configurable: true, + value: 2 + }); - /** - Standard CSS class names to apply to the view's outer element. This - property automatically inherits any class names defined by the view's - superclasses as well. - @property classNames - @type Array - @default ['ember-view'] - @public - */ - classNames: EMPTY_ARRAY, + return a.prop === 2; + })(); + // .......................................................... + // DEFINING PROPERTIES API + // - /** - A list of properties of the view to apply as class names. If the property - is a string value, the value of that string will be applied as a class - name. - ```javascript - // Applies the 'high' class to the view element - Ember.Component.extend({ - classNameBindings: ['priority'], - priority: 'high' - }); - ``` - If the value of the property is a Boolean, the name of that property is - added as a dasherized class name. - ```javascript - // Applies the 'is-urgent' class to the view element - Ember.Component.extend({ - classNameBindings: ['isUrgent'], - isUrgent: true - }); - ``` - If you would prefer to use a custom value instead of the dasherized - property name, you can pass a binding like this: - ```javascript - // Applies the 'urgent' class to the view element - Ember.Component.extend({ - classNameBindings: ['isUrgent:urgent'], - isUrgent: true - }); - ``` - This list of properties is inherited from the component's superclasses as well. - @property classNameBindings - @type Array - @default [] - @public - */ - classNameBindings: EMPTY_ARRAY - }); -}); -enifed('ember-views/mixins/text_support', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { - /** - @module ember - @submodule ember-views - */ + function MANDATORY_SETTER_FUNCTION(name) { + function SETTER_FUNCTION(value) { + var m = _emberMetalMeta.peekMeta(this); + if (!m.isInitialized(this)) { + m.writeValues(name, value); + } else { + _emberMetalDebug.assert('You must use Ember.set() to set the `' + name + '` property (of ' + this + ') to `' + value + '`.', false); + } + } - 'use strict'; + SETTER_FUNCTION.isMandatorySetter = true; + return SETTER_FUNCTION; + } - var KEY_EVENTS = { - 13: 'insertNewline', - 27: 'cancel' - }; + function DEFAULT_GETTER_FUNCTION(name) { + return function GETTER_FUNCTION() { + var meta = _emberMetalMeta.peekMeta(this); + return meta && meta.peekValues(name); + }; + } + + function INHERITING_GETTER_FUNCTION(name) { + function IGETTER_FUNCTION() { + var meta = _emberMetalMeta.peekMeta(this); + var val = meta && meta.readInheritedValue('values', name); + + if (val === _emberMetalMeta.UNDEFINED) { + var proto = Object.getPrototypeOf(this); + return proto && proto[name]; + } else { + return val; + } + } + + IGETTER_FUNCTION.isInheritingGetter = true; + return IGETTER_FUNCTION; + } /** - `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 - value of the field passed in as the only argument unless the value of - the field is empty. In that case, the instance of the field itself is passed - in as the only argument. + NOTE: This is a low-level method used by other parts of the API. You almost + never want to call this method directly. Instead you should use + `Ember.mixin()` to define new properties. - Let's use the pressing of the escape key as an example. If you wanted to - invoke a controller action when a user presses the escape key while on your - field, you would use the `escape-press` attribute on your field like so: + Defines a property on an object. This method works much like the ES5 + `Object.defineProperty()` method except that it can also accept computed + properties and other special descriptors. - ```handlebars - {{! application.hbs}} + Normally this method takes only three parameters. However if you pass an + instance of `Descriptor` as the third param then you can pass an + optional value as the fourth parameter. This is often more efficient than + creating new descriptor hashes for each property. - {{input escape-press='alertUser'}} - ``` + ## Examples ```javascript - App = Ember.Application.create(); - - App.ApplicationController = Ember.Controller.extend({ - actions: { - alertUser: function ( currentValue ) { - alert( 'escape pressed, current value: ' + currentValue ); - } - } - }); - ``` - - The following chart is a visual representation of what takes place when the - escape key is pressed in this scenario: - - ``` - The Template - +---------------------------+ - | | - | escape-press='alertUser' | - | | TextSupport Mixin - +----+----------------------+ +-------------------------------+ - | | cancel method | - | escape button pressed | | - +-------------------------------> | checks for the `escape-press` | - | attribute and pulls out the | - +-------------------------------+ | `alertUser` value | - | action name 'alertUser' +-------------------------------+ - | sent to controller - v - Controller - +------------------------------------------ + - | | - | actions: { | - | alertUser: function( currentValue ){ | - | alert( 'the esc key was pressed!' ) | - | } | - | } | - | | - +-------------------------------------------+ - ``` - - Here are the events that we currently support along with the name of the - attribute you would need to use on your field. To reiterate, you would use the - attribute name like so: + // ES5 compatible mode + Ember.defineProperty(contact, 'firstName', { + writable: true, + configurable: false, + enumerable: true, + value: 'Charles' + }); - ```handlebars - {{input attribute-name='controllerAction'}} - ``` + // define a simple property + Ember.defineProperty(contact, 'lastName', undefined, 'Jolley'); - ``` - +--------------------+----------------+ - | | | - | event | attribute name | - +--------------------+----------------+ - | new line inserted | insert-newline | - | | | - | enter key pressed | insert-newline | - | | | - | cancel key pressed | escape-press | - | | | - | focusin | focus-in | - | | | - | focusout | focus-out | - | | | - | keypress | key-press | - | | | - | keyup | key-up | - | | | - | keydown | key-down | - +--------------------+----------------+ + // define a computed property + Ember.defineProperty(contact, 'fullName', Ember.computed('firstName', 'lastName', function() { + return this.firstName+' '+this.lastName; + })); ``` - @class TextSupport - @namespace Ember - @uses Ember.TargetActionSupport - @extends Ember.Mixin @private + @method defineProperty + @for Ember + @param {Object} obj the object to define this property on. This may be a prototype. + @param {String} keyName the name of the property + @param {Descriptor} [desc] an instance of `Descriptor` (typically a + computed property) or an ES5 descriptor. + You must provide this or `data` but not both. + @param {*} [data] something other than a descriptor, that will + become the explicit value of this property. */ - exports.default = _emberMetal.Mixin.create(_emberRuntime.TargetActionSupport, { - value: '', - - attributeBindings: ['autocapitalize', 'autocorrect', 'autofocus', 'disabled', 'form', 'maxlength', 'placeholder', 'readonly', 'required', 'selectionDirection', 'spellcheck', 'tabindex', 'title'], - placeholder: null, - disabled: false, - maxlength: null, - - init: function () { - this._super.apply(this, arguments); - this.on('paste', this, this._elementValueDidChange); - this.on('cut', this, this._elementValueDidChange); - this.on('input', this, this._elementValueDidChange); - }, - /** - The action to be sent when the user presses the return key. - This is similar to the `{{action}}` helper, but is fired when - the user presses the return key when editing a text field, and sends - the value of the field as the context. - @property action - @type String - @default null - @private - */ - action: null, + function defineProperty(obj, keyName, desc, data, meta) { + var possibleDesc = undefined, + existingDesc = undefined, + watching = undefined, + value = undefined; - /** - The event that should send the action. - Options are: - * `enter`: the user pressed enter - * `keyPress`: the user pressed a key - @property onEvent - @type String - @default enter - @private - */ - onEvent: 'enter', + if (!meta) { + meta = _emberMetalMeta.meta(obj); + } + var watchEntry = meta.peekWatching(keyName); + possibleDesc = obj[keyName]; + existingDesc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - /** - Whether the `keyUp` event that triggers an `action` to be sent continues - propagating to other views. - By default, when the user presses the return key on their keyboard and - the text field has an `action` set, the action will be sent to the view's - controller and the key event will stop propagating. - If you would like parent views to receive the `keyUp` event even after an - action has been dispatched, set `bubbles` to true. - @property bubbles - @type Boolean - @default false - @private - */ - bubbles: false, + watching = watchEntry !== undefined && watchEntry > 0; - interpretKeyEvents: function (event) { - var map = KEY_EVENTS; - var method = map[event.keyCode]; + if (existingDesc) { + existingDesc.teardown(obj, keyName); + } - this._elementValueDidChange(); - if (method) { - return this[method](event); + if (desc instanceof Descriptor) { + value = desc; + if (true) { + if (watching) { + Object.defineProperty(obj, keyName, { + configurable: true, + enumerable: true, + writable: true, + value: value + }); + } else { + obj[keyName] = value; + } + } else { + obj[keyName] = value; } - }, - - _elementValueDidChange: function () { - _emberMetal.set(this, 'value', this.element.value); - }, - - change: function (event) { - this._elementValueDidChange(event); - }, - - /** - Allows you to specify a controller action to invoke when either the `enter` - key is pressed or, in the case of the field being a textarea, when a newline - is inserted. To use this method, give your field an `insert-newline` - attribute. The value of that attribute should be the name of the action - in your controller that you wish to invoke. - For an example on how to use the `insert-newline` attribute, please - reference the example near the top of this file. - @method insertNewline - @param {Event} event - @private - */ - insertNewline: function (event) { - sendAction('enter', this, event); - sendAction('insert-newline', this, event); - }, - - /** - Allows you to specify a controller action to invoke when the escape button - is pressed. To use this method, give your field an `escape-press` - attribute. The value of that attribute should be the name of the action - in your controller that you wish to invoke. - For an example on how to use the `escape-press` attribute, please reference - the example near the top of this file. - @method cancel - @param {Event} event - @private - */ - cancel: function (event) { - sendAction('escape-press', this, event); - }, - - /** - Allows you to specify a controller action to invoke when a field receives - focus. To use this method, give your field a `focus-in` attribute. The value - of that attribute should be the name of the action in your controller - that you wish to invoke. - For an example on how to use the `focus-in` attribute, please reference the - example near the top of this file. - @method focusIn - @param {Event} event - @private - */ - focusIn: function (event) { - sendAction('focus-in', this, event); - }, - - /** - Allows you to specify a controller action to invoke when a field loses - focus. To use this method, give your field a `focus-out` attribute. The value - of that attribute should be the name of the action in your controller - that you wish to invoke. - For an example on how to use the `focus-out` attribute, please reference the - example near the top of this file. - @method focusOut - @param {Event} event - @private - */ - focusOut: function (event) { - this._elementValueDidChange(event); - sendAction('focus-out', this, event); - }, - - /** - Allows you to specify a controller action to invoke when a key is pressed. - To use this method, give your field a `key-press` attribute. The value of - that attribute should be the name of the action in your controller you - that wish to invoke. - For an example on how to use the `key-press` attribute, please reference the - example near the top of this file. - @method keyPress - @param {Event} event - @private - */ - keyPress: function (event) { - sendAction('key-press', this, event); - }, + if (desc.setup) { + desc.setup(obj, keyName); + } + } else { + if (desc == null) { + value = data; - /** - Allows you to specify a controller action to invoke when a key-up event is - fired. To use this method, give your field a `key-up` attribute. The value - of that attribute should be the name of the action in your controller - that you wish to invoke. - For an example on how to use the `key-up` attribute, please reference the - example near the top of this file. - @method keyUp - @param {Event} event - @private - */ - keyUp: function (event) { - this.interpretKeyEvents(event); + if (true) { + if (watching) { + meta.writeValues(keyName, data); - this.sendAction('key-up', _emberMetal.get(this, 'value'), event); - }, + var defaultDescriptor = { + configurable: true, + enumerable: true, + set: MANDATORY_SETTER_FUNCTION(keyName), + get: DEFAULT_GETTER_FUNCTION(keyName) + }; - /** - Allows you to specify a controller action to invoke when a key-down event is - fired. To use this method, give your field a `key-down` attribute. The value - of that attribute should be the name of the action in your controller that - you wish to invoke. - For an example on how to use the `key-down` attribute, please reference the - example near the top of this file. - @method keyDown - @param {Event} event - @private - */ - keyDown: function (event) { - this.sendAction('key-down', _emberMetal.get(this, 'value'), event); + 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); + } } - }); - // In principle, this shouldn't be necessary, but the legacy - // sendAction semantics for TextField are different from - // the component semantics so this method normalizes them. - function sendAction(eventName, view, event) { - var action = _emberMetal.get(view, 'attrs.' + eventName) || _emberMetal.get(view, eventName); - var on = _emberMetal.get(view, 'onEvent'); - var value = _emberMetal.get(view, 'value'); + // if key is being watched, override chains that + // were initialized with the prototype + if (watching) { + _emberMetalProperty_events.overrideChains(obj, keyName, meta); + } - // back-compat support for keyPress as an event name even though - // it's also a method name that consumes the event (and therefore - // incompatible with sendAction semantics). - if (on === eventName || on === 'keyPress' && eventName === 'key-press') { - view.sendAction('action', value); + // The `value` passed to the `didDefineProperty` hook is + // either the descriptor or data, whichever was passed. + if (obj.didDefineProperty) { + obj.didDefineProperty(obj, keyName, value); } - view.sendAction(eventName, value); + return this; + } - if (action || on === eventName) { - if (!_emberMetal.get(view, 'bubbles')) { - event.stopPropagation(); - } - } + function handleBrokenPhantomDefineProperty(obj, keyName, desc) { + // https://github.com/ariya/phantomjs/issues/11856 + Object.defineProperty(obj, keyName, { configurable: true, writable: true, value: 'iCry' }); + Object.defineProperty(obj, keyName, desc); } }); -enifed('ember-views/mixins/view_state_support', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-views - */ +enifed('ember-metal/property_events', ['exports', 'ember-utils', 'ember-metal/meta', 'ember-metal/events', 'ember-metal/tags', 'ember-metal/observer_set', 'ember-metal/features', 'ember-metal/transaction'], function (exports, _emberUtils, _emberMetalMeta, _emberMetalEvents, _emberMetalTags, _emberMetalObserver_set, _emberMetalFeatures, _emberMetalTransaction) { 'use strict'; - exports.default = _emberMetal.Mixin.create({ - _transitionTo: function (state) { - var priorState = this._currentState; - var currentState = this._currentState = this._states[state]; - this._state = state; - - if (priorState && priorState.exit) { - priorState.exit(this); - } - if (currentState.enter) { - currentState.enter(this); - } - } - }); -}); -enifed('ember-views/mixins/view_support', ['exports', 'ember-utils', 'ember-metal', 'ember-environment', 'ember-views/system/utils', 'ember-runtime/system/core_object', 'ember-views/system/jquery'], function (exports, _emberUtils, _emberMetal, _emberEnvironment, _emberViewsSystemUtils, _emberRuntimeSystemCore_object, _emberViewsSystemJquery) { - 'use strict'; + var PROPERTY_DID_CHANGE = _emberUtils.symbol('PROPERTY_DID_CHANGE'); - var _Mixin$create; + exports.PROPERTY_DID_CHANGE = PROPERTY_DID_CHANGE; + var beforeObserverSet = new _emberMetalObserver_set.default(); + var observerSet = new _emberMetalObserver_set.default(); + var deferred = 0; - function K() { - return this; - } + // .......................................................... + // PROPERTY CHANGES + // /** - @class ViewMixin - @namespace Ember - @private + This function is called just before an object property is about to change. + It will notify any before observers and prepare caches among other things. + + Normally you will not need to call this method directly but if for some + reason you can't directly watch a property you can invoke this method + manually along with `Ember.propertyDidChange()` which you should call just + after the property value changes. + + @method propertyWillChange + @for Ember + @param {Object} obj The object with the property that will change + @param {String} keyName The property key (or path) that will change. + @return {void} + @private */ - exports.default = _emberMetal.Mixin.create((_Mixin$create = { - concatenatedProperties: ['attributeBindings'] - }, _Mixin$create[_emberRuntimeSystemCore_object.POST_INIT] = function () { - this.trigger('didInitAttrs', { attrs: this.attrs }); - this.trigger('didReceiveAttrs', { newAttrs: this.attrs }); - }, _Mixin$create.nearestOfType = function (klass) { - var view = this.parentView; - var isOfType = klass instanceof _emberMetal.Mixin ? function (view) { - return klass.detect(view); - } : function (view) { - return klass.detect(view.constructor); - }; - - while (view) { - if (isOfType(view)) { - return view; - } - view = view.parentView; - } - }, _Mixin$create.nearestWithProperty = function (property) { - var view = this.parentView; + function propertyWillChange(obj, keyName, _meta) { + var meta = _meta || _emberMetalMeta.peekMeta(obj); - while (view) { - if (property in view) { - return view; - } - view = view.parentView; - } - }, _Mixin$create.rerender = function () { - return this._currentState.rerender(this); - }, _Mixin$create.element = _emberMetal.descriptor({ - configurable: false, - enumerable: false, - get: function () { - return this.renderer.getElement(this); - } - }), _Mixin$create.$ = function (sel) { - _emberMetal.assert('You cannot access this.$() on a component with `tagName: \'\'` specified.', this.tagName !== ''); - if (this.element) { - return sel ? _emberViewsSystemJquery.default(sel, this.element) : _emberViewsSystemJquery.default(this.element); + if (meta && !meta.isInitialized(obj)) { + return; } - }, _Mixin$create.appendTo = function (selector) { - var env = this._environment || _emberEnvironment.environment; - var target = undefined; - - if (env.hasDOM) { - target = typeof selector === 'string' ? document.querySelector(selector) : selector; - _emberMetal.assert('You tried to append to (' + selector + ') but that isn\'t in the DOM', target); - _emberMetal.assert('You cannot append to an existing Ember.View.', !_emberViewsSystemUtils.matches(target, '.ember-view')); - _emberMetal.assert('You cannot append to an existing Ember.View.', (function () { - var node = target.parentNode; - while (node) { - if (node.nodeType !== 9 && _emberViewsSystemUtils.matches(node, '.ember-view')) { - return false; - } - - node = node.parentNode; - } - - return true; - })()); - } else { - target = selector; + var watching = meta && meta.peekWatching(keyName) > 0; + var possibleDesc = obj[keyName]; + var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - _emberMetal.assert('You tried to append to a selector string (' + selector + ') in an environment without jQuery', typeof target !== 'string'); - _emberMetal.assert('You tried to append to a non-Element (' + selector + ') in an environment without jQuery', typeof selector.appendChild === 'function'); + if (desc && desc.willChange) { + desc.willChange(obj, keyName); } - this.renderer.appendTo(this, target); - - return this; - }, _Mixin$create.renderToElement = function (tagName) { - tagName = tagName || 'body'; - - var element = this.renderer.createElement(tagName); - - this.renderer.appendTo(this, element); - return element; - }, _Mixin$create.replaceIn = function (selector) { - var target = _emberViewsSystemJquery.default(selector); + if (watching) { + dependentKeysWillChange(obj, keyName, meta); + chainsWillChange(obj, keyName, meta); + notifyBeforeObservers(obj, keyName, meta); + } + } - _emberMetal.assert('You tried to replace in (' + selector + ') but that isn\'t in the DOM', target.length > 0); - _emberMetal.assert('You cannot replace an existing Ember.View.', !target.is('.ember-view') && !target.parents().is('.ember-view')); + /** + This function is called just after an object property has changed. + It will notify any observers and clear caches among other things. + + Normally you will not need to call this method directly but if for some + reason you can't directly watch a property you can invoke this method + manually along with `Ember.propertyWillChange()` which you should call just + before the property value changes. + + @method propertyDidChange + @for Ember + @param {Object} obj The object with the property that will change + @param {String} keyName The property key (or path) that will change. + @param {Meta} meta The objects meta. + @return {void} + @private + */ + function propertyDidChange(obj, keyName, _meta) { + var meta = _meta || _emberMetalMeta.peekMeta(obj); - this.renderer.replaceIn(this, target[0]); + if (meta && !meta.isInitialized(obj)) { + return; + } - return this; - }, _Mixin$create.append = function () { - return this.appendTo(document.body); - }, _Mixin$create.elementId = null, _Mixin$create.findElementInParentElement = function (parentElem) { - var id = '#' + this.elementId; - return _emberViewsSystemJquery.default(id)[0] || _emberViewsSystemJquery.default(id, parentElem)[0]; - }, _Mixin$create.willInsertElement = K, _Mixin$create.didInsertElement = K, _Mixin$create.willClearRender = K, _Mixin$create.destroy = function () { - this._super.apply(this, arguments); - this._currentState.destroy(this); - }, _Mixin$create.willDestroyElement = K, _Mixin$create.parentViewDidChange = K, _Mixin$create.tagName = null, _Mixin$create.init = function () { - this._super.apply(this, arguments); + var watching = meta && meta.peekWatching(keyName) > 0; + var possibleDesc = obj[keyName]; + var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - if (!this.elementId && this.tagName !== '') { - this.elementId = _emberUtils.guidFor(this); + // shouldn't this mean that we're watching this key? + if (desc && desc.didChange) { + desc.didChange(obj, keyName); } - _emberMetal.deprecate('[DEPRECATED] didInitAttrs called in ' + this.toString() + '.', typeof this.didInitAttrs !== 'function', { - id: 'ember-views.did-init-attrs', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x#toc_ember-component-didinitattrs' - }); + if (watching) { + if (meta.hasDeps(keyName)) { + dependentKeysDidChange(obj, keyName, meta); + } - _emberMetal.assert('Using a custom `.render` function is no longer supported.', !this.render); - }, _Mixin$create.__defineNonEnumerable = function (property) { - this[property.name] = property.descriptor.value; - }, _Mixin$create.handleEvent = function (eventName, evt) { - return this._currentState.handleEvent(this, eventName, evt); - }, _Mixin$create)); -}); + chainsDidChange(obj, keyName, meta, false); + notifyObservers(obj, keyName, meta); + } -// .......................................................... -// TEMPLATE SUPPORT -// + if (obj[PROPERTY_DID_CHANGE]) { + obj[PROPERTY_DID_CHANGE](keyName); + } -/** - Return the nearest ancestor that is an instance of the provided - class or mixin. - @method nearestOfType - @param {Class,Mixin} klass Subclass of Ember.View (or Ember.View itself), - or an instance of Ember.Mixin. - @return Ember.View - @deprecated use `yield` and contextual components for composition instead. - @private -*/ + if (meta && meta.isSourceDestroying()) { + return; + } -/** - Return the nearest ancestor that has a given property. - @method nearestWithProperty - @param {String} property A property name - @return Ember.View - @deprecated use `yield` and contextual components for composition instead. - @private -*/ + _emberMetalTags.markObjectAsDirty(meta, keyName); -/** - Renders the view again. This will work regardless of whether the - view is already in the DOM or not. If the view is in the DOM, the - rendering process will be deferred to give bindings a chance - to synchronize. - If children were added during the rendering process using `appendChild`, - `rerender` will remove them, because they will be added again - if needed by the next `render`. - In general, if the display of your view changes, you should modify - the DOM element directly instead of manually calling `rerender`, which can - be slow. - @method rerender - @public -*/ + if (true || true) { + _emberMetalTransaction.assertNotRendered(obj, keyName, meta); + } + } -// .......................................................... -// ELEMENT SUPPORT -// + var WILL_SEEN = undefined, + DID_SEEN = undefined; + // called whenever a property is about to change to clear the cache of any dependent keys (and notify those properties of changes, etc...) + function dependentKeysWillChange(obj, depKey, meta) { + if (meta && meta.isSourceDestroying()) { + return; + } -/** - Returns the current DOM element for the view. - @property element - @type DOMElement - @public -*/ + if (meta && meta.hasDeps(depKey)) { + var seen = WILL_SEEN; + var _top = !seen; -/** - Returns a jQuery object for this view's element. If you pass in a selector - string, this method will return a jQuery object, using the current element - as its buffer. - For example, calling `view.$('li')` will return a jQuery object containing - all of the `li` elements inside the DOM element of this view. - @method $ - @param {String} [selector] a jQuery-compatible selector string - @return {jQuery} the jQuery object for the DOM node - @public -*/ + if (_top) { + seen = WILL_SEEN = {}; + } -/** - Appends the view's element to the specified parent element. - Note that this method just schedules the view to be appended; the DOM - element will not be appended to the given element until all bindings have - finished synchronizing. - This is not typically a function that you will need to call directly when - building your application. If you do need to use `appendTo`, be sure that - the target element you are providing is associated with an `Ember.Application` - and does not have an ancestor element that is associated with an Ember view. - @method appendTo - @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object - @return {Ember.View} receiver - @private -*/ + iterDeps(propertyWillChange, obj, depKey, seen, meta); -/** - 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 - let element = view.renderToElement(); - element.tagName; // => "BODY" - ``` - You can override the kind of element rendered into and returned by - specifying an optional tag name as the first argument. - ```js - let element = view.renderToElement('table'); - element.tagName; // => "TABLE" - ``` - This method is useful if you want to render the view into an element that - is not in the document's body. Instead, a new `body` element, detached from - the DOM is returned. FastBoot uses this to serialize the rendered view into - a string for transmission over the network. - ```js - app.visit('/').then(function(instance) { - let element; - Ember.run(function() { - element = renderToElement(instance); - }); - res.send(serialize(element)); - }); - ``` - @method renderToElement - @param {String} tagName The tag of the element to create and render into. Defaults to "body". - @return {HTMLBodyElement} element - @private -*/ + if (_top) { + WILL_SEEN = null; + } + } + } -/** - Replaces the content of the specified parent element with this view's - element. If the view does not have an HTML representation yet, - the element will be generated automatically. - Note that this method just schedules the view to be appended; the DOM - element will not be appended to the given element until all bindings have - finished synchronizing - @method replaceIn - @param {String|DOMElement|jQuery} target A selector, element, HTML string, or jQuery object - @return {Ember.View} received - @private -*/ + // called whenever a property has just changed to update dependent keys + function dependentKeysDidChange(obj, depKey, meta) { + if (meta && meta.isSourceDestroying()) { + return; + } -/** - Appends the view's element to the document body. If the view does - not have an HTML representation yet - the element will be generated automatically. - If your application uses the `rootElement` property, you must append - the view within that element. Rendering views outside of the `rootElement` - is not supported. - Note that this method just schedules the view to be appended; the DOM - element will not be appended to the document body until all bindings have - finished synchronizing. - @method append - @return {Ember.View} receiver - @private -*/ + if (meta && meta.hasDeps(depKey)) { + var seen = DID_SEEN; + var _top2 = !seen; -/** - The HTML `id` of the view's element in the DOM. You can provide this - value yourself but it must be unique (just as in HTML): - ```handlebars - {{my-component elementId="a-really-cool-id"}} - ``` - If not manually set a default value will be provided by the framework. - Once rendered an element's `elementId` is considered immutable and you - should never change it. If you need to compute a dynamic value for the - `elementId`, you should do this when the component or element is being - instantiated: - ```javascript - export default Ember.Component.extend({ - init() { - this._super(...arguments); - let index = this.get('index'); - this.set('elementId', 'component-id' + index); + if (_top2) { + seen = DID_SEEN = {}; } - }); - ``` - @property elementId - @type String - @public -*/ -/** - Attempts to discover the element in the parent element. The default - implementation looks for an element with an ID of `elementId` (or the - view's guid if `elementId` is null). You can override this method to - provide your own form of lookup. For example, if you want to discover your - element using a CSS class name instead of an ID. - @method findElementInParentElement - @param {DOMElement} parentElement The parent's DOM element - @return {DOMElement} The discovered element - @private -*/ + iterDeps(propertyDidChange, obj, depKey, seen, meta); -/** - Called when a view is going to insert an element into the DOM. - @event willInsertElement - @public -*/ + if (_top2) { + DID_SEEN = null; + } + } + } -/** - Called when the element of the view has been inserted into the DOM. - Override this function to do any set up that requires an element - in the document body. - When a view has children, didInsertElement will be called on the - child view(s) first and on itself afterwards. - @event didInsertElement - @public -*/ + function iterDeps(method, obj, depKey, seen, meta) { + var possibleDesc = undefined, + desc = undefined; + var guid = _emberUtils.guidFor(obj); + var current = seen[guid]; -/** - Called when the view is about to rerender, but before anything has - been torn down. This is a good opportunity to tear down any manual - observers you have installed based on the DOM state - @event willClearRender - @public -*/ + if (!current) { + current = seen[guid] = {}; + } -/** - You must call `destroy` on a view to destroy the view (and all of its - child views). This will remove the view from any parent node, then make - sure that the DOM element managed by the view can be released by the - memory manager. - @method destroy - @private -*/ + if (current[depKey]) { + return; + } -/** - Called when the element of the view is going to be destroyed. Override - this function to do any teardown that requires an element, like removing - event listeners. - Please note: any property changes made during this event will have no - effect on object observers. - @event willDestroyElement - @public -*/ + current[depKey] = true; -/** - Called when the parentView property has changed. - @event parentViewDidChange - @private -*/ + meta.forEachInDeps(depKey, function (key, value) { + if (!value) { + return; + } -// .......................................................... -// STANDARD RENDER PROPERTIES -// + possibleDesc = obj[key]; + desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; -/** - Tag name for the view's outer element. The tag name is only used when an - element is first created. If you change the `tagName` for an element, you - must destroy and recreate the view element. - By default, the render buffer will use a `
    ` tag for views. - @property tagName - @type String - @default null - @public -*/ + if (desc && desc._suspended === obj) { + return; + } -// We leave this null by default so we can tell the difference between -// the default case and a user-specified tag. + method(obj, key, meta); + }); + } -// ....................................................... -// CORE DISPLAY METHODS -// + function chainsWillChange(obj, keyName, meta) { + var chainWatchers = meta.readableChainWatchers(); + if (chainWatchers) { + chainWatchers.notify(keyName, false, propertyWillChange); + } + } -/** - Setup a view, but do not finish waking it up. - * configure `childViews` - * register the view with the global views hash, which is used for event - dispatch - @method init - @private -*/ + function chainsDidChange(obj, keyName, meta) { + var chainWatchers = meta.readableChainWatchers(); + if (chainWatchers) { + chainWatchers.notify(keyName, true, propertyDidChange); + } + } -// ....................................................... -// EVENT HANDLING -// + function overrideChains(obj, keyName, meta) { + var chainWatchers = meta.readableChainWatchers(); + if (chainWatchers) { + chainWatchers.revalidate(keyName); + } + } -/** - Handle events from `Ember.EventDispatcher` - @method handleEvent - @param eventName {String} - @param evt {Event} - @private -*/ -enifed("ember-views/system/action_manager", ["exports"], function (exports) { /** - @module ember - @submodule ember-views + @method beginPropertyChanges + @chainable + @private */ + function beginPropertyChanges() { + deferred++; + } - "use strict"; - - exports.default = ActionManager; - - function ActionManager() {} + /** + @method endPropertyChanges + @private + */ + function endPropertyChanges() { + deferred--; + if (deferred <= 0) { + beforeObserverSet.clear(); + observerSet.flush(); + } + } /** - Global action id hash. + Make a series of property changes together in an + exception-safe way. + + ```javascript + Ember.changeProperties(function() { + obj1.set('foo', mayBlowUpWhenSet); + obj2.set('bar', baz); + }); + ``` + @method changeProperties + @param {Function} callback + @param [binding] @private - @property registeredActions - @type Object */ - ActionManager.registeredActions = {}; + function changeProperties(callback, binding) { + beginPropertyChanges(); + try { + callback.call(binding); + } finally { + endPropertyChanges.call(binding); + } + } + + function notifyBeforeObservers(obj, keyName, meta) { + if (meta && meta.isSourceDestroying()) { + return; + } + + var eventName = keyName + ':before'; + var listeners = undefined, + added = undefined; + if (deferred) { + listeners = beforeObserverSet.add(obj, keyName, eventName); + added = _emberMetalEvents.accumulateListeners(obj, eventName, listeners); + _emberMetalEvents.sendEvent(obj, eventName, [obj, keyName], added); + } else { + _emberMetalEvents.sendEvent(obj, eventName, [obj, keyName]); + } + } + + function notifyObservers(obj, keyName, meta) { + if (meta && meta.isSourceDestroying()) { + return; + } + + var eventName = keyName + ':change'; + var listeners = undefined; + if (deferred) { + listeners = observerSet.add(obj, keyName, eventName); + _emberMetalEvents.accumulateListeners(obj, eventName, listeners); + } else { + _emberMetalEvents.sendEvent(obj, eventName, [obj, keyName]); + } + } + + exports.propertyWillChange = propertyWillChange; + exports.propertyDidChange = propertyDidChange; + exports.overrideChains = overrideChains; + exports.beginPropertyChanges = beginPropertyChanges; + exports.endPropertyChanges = endPropertyChanges; + exports.changeProperties = changeProperties; }); -enifed('ember-views/system/event_dispatcher', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-views/system/jquery', 'ember-views/system/action_manager', 'ember-environment', 'ember-views/compat/fallback-view-registry'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberViewsSystemJquery, _emberViewsSystemAction_manager, _emberEnvironment, _emberViewsCompatFallbackViewRegistry) { +enifed('ember-metal/property_get', ['exports', 'ember-metal/debug', 'ember-metal/path_cache'], function (exports, _emberMetalDebug, _emberMetalPath_cache) { /** - @module ember - @submodule ember-views + @module ember-metal */ 'use strict'; - var ROOT_ELEMENT_CLASS = 'ember-application'; - var ROOT_ELEMENT_SELECTOR = '.' + ROOT_ELEMENT_CLASS; + exports.get = get; + exports._getPath = _getPath; + exports.getWithDefault = getWithDefault; + + var ALLOWABLE_TYPES = { + object: true, + function: true, + string: true + }; + + // .......................................................... + // 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 + // object. /** - `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 - called. + Gets the value of a property on an object. If the property is computed, + the function will be invoked. If the property is not defined but the + object implements the `unknownProperty` method then that will be invoked. - @class EventDispatcher - @namespace Ember - @private - @extends Ember.Object + ```javascript + Ember.get(obj, "name"); + ``` + + If you plan to run on IE8 and older browsers then you should use this + method anytime you want to retrieve a property on an object that you don't + know for sure is private. (Properties beginning with an underscore '_' + are considered private.) + + On all newer browsers, you only need to use this method to retrieve + properties if the property might not be defined on the object and you want + to respect the `unknownProperty` handler. Otherwise you can ignore this + method. + + Note that if the object itself is `undefined`, this method will throw + an error. + + @method get + @for Ember + @param {Object} obj The object to retrieve from. + @param {String} keyName The property key to retrieve + @return {Object} the property value or `null`. + @public */ - exports.default = _emberRuntime.Object.extend({ - - /** - The set of events names (and associated handler function names) to be setup - and dispatched by the `EventDispatcher`. Modifications to this list can be done - at setup time, generally via the `Ember.Application.customEvents` hash. - To add new events to be listened to: - ```javascript - let App = Ember.Application.create({ - customEvents: { - paste: 'paste' - } - }); - ``` - To prevent default events from being listened to: - ```javascript - let App = Ember.Application.create({ - customEvents: { - mouseenter: null, - mouseleave: null - } - }); - ``` - @property events - @type Object - @private - */ - events: { - touchstart: 'touchStart', - touchmove: 'touchMove', - touchend: 'touchEnd', - touchcancel: 'touchCancel', - keydown: 'keyDown', - keyup: 'keyUp', - keypress: 'keyPress', - mousedown: 'mouseDown', - mouseup: 'mouseUp', - contextmenu: 'contextMenu', - click: 'click', - dblclick: 'doubleClick', - mousemove: 'mouseMove', - focusin: 'focusIn', - focusout: 'focusOut', - mouseenter: 'mouseEnter', - mouseleave: 'mouseLeave', - submit: 'submit', - input: 'input', - change: 'change', - dragstart: 'dragStart', - drag: 'drag', - dragenter: 'dragEnter', - dragleave: 'dragLeave', - dragover: 'dragOver', - drop: 'drop', - dragend: 'dragEnd' - }, - /** - The root DOM element to which event listeners should be attached. Event - listeners will be attached to the document unless this is overridden. - Can be specified as a DOMElement or a selector string. - The default body is a string since this may be evaluated before document.body - exists in the DOM. - @private - @property rootElement - @type DOMElement - @default 'body' - */ - rootElement: 'body', + function get(obj, keyName) { + _emberMetalDebug.assert('Get must be called with two arguments; an object and a property key', arguments.length === 2); + _emberMetalDebug.assert('Cannot call get with \'' + keyName + '\' on an undefined object.', obj !== undefined && obj !== null); + _emberMetalDebug.assert('The key provided to get must be a string, you passed ' + keyName, typeof keyName === 'string'); + _emberMetalDebug.assert('\'this\' in paths is not supported', !_emberMetalPath_cache.hasThis(keyName)); + _emberMetalDebug.assert('Cannot call `Ember.get` with an empty string', keyName !== ''); - /** - It enables events to be dispatched to the view's `eventManager.` When present, - this object takes precedence over handling of events on the view itself. - Note that most Ember applications do not use this feature. If your app also - does not use it, consider setting this property to false to gain some performance - improvement by allowing the EventDispatcher to skip the search for the - `eventManager` on the view tree. - ```javascript - let EventDispatcher = Em.EventDispatcher.extend({ - events: { - click : 'click', - focusin : 'focusIn', - focusout : 'focusOut', - change : 'change' - }, - canDispatchToEventManager: false - }); - container.register('event_dispatcher:main', EventDispatcher); - ``` - @property canDispatchToEventManager - @type boolean - @default 'true' - @since 1.7.0 - @private - */ - canDispatchToEventManager: true, + var value = obj[keyName]; + var desc = value !== null && typeof value === 'object' && value.isDescriptor ? value : undefined; + var ret = undefined; - init: function () { - this._super(); - _emberMetal.assert('EventDispatcher should never be instantiated in fastboot mode. Please report this as an Ember bug.', _emberEnvironment.environment.hasDOM); - }, + if (desc === undefined && _emberMetalPath_cache.isPath(keyName)) { + return _getPath(obj, keyName); + } - /** - Sets up event listeners for standard browser events. - This will be called after the browser sends a `DOMContentReady` event. By - default, it will set up all of the listeners on the document body. If you - would like to register the listeners on a different element, set the event - dispatcher's `root` property. - @private - @method setup - @param addedEvents {Object} - */ - setup: function (addedEvents, rootElement) { - var event = undefined; - var events = this._finalEvents = _emberUtils.assign({}, _emberMetal.get(this, 'events'), addedEvents); + if (desc) { + return desc.get(obj, keyName); + } else { + ret = value; - if (!_emberMetal.isNone(rootElement)) { - _emberMetal.set(this, 'rootElement', rootElement); + if (ret === undefined && 'object' === typeof obj && !(keyName in obj) && 'function' === typeof obj.unknownProperty) { + return obj.unknownProperty(keyName); } - rootElement = _emberViewsSystemJquery.default(_emberMetal.get(this, 'rootElement')); - - _emberMetal.assert('You cannot use the same root element (' + (rootElement.selector || rootElement[0].tagName) + ') multiple times in an Ember.Application', !rootElement.is(ROOT_ELEMENT_SELECTOR)); - _emberMetal.assert('You cannot make a new Ember.Application using a root element that is a descendent of an existing Ember.Application', !rootElement.closest(ROOT_ELEMENT_SELECTOR).length); - _emberMetal.assert('You cannot make a new Ember.Application using a root element that is an ancestor of an existing Ember.Application', !rootElement.find(ROOT_ELEMENT_SELECTOR).length); + return ret; + } + } - rootElement.addClass(ROOT_ELEMENT_CLASS); + function _getPath(root, path) { + var obj = root; + var parts = path.split('.'); - if (!rootElement.is(ROOT_ELEMENT_SELECTOR)) { - throw new TypeError('Unable to add \'' + ROOT_ELEMENT_CLASS + '\' class to root element (' + (rootElement.selector || rootElement[0].tagName) + '). Make sure you set rootElement to the body or an element in the body.'); + for (var i = 0; i < parts.length; i++) { + if (!isGettable(obj)) { + return undefined; } - for (event in events) { - if (events.hasOwnProperty(event)) { - this.setupHandler(rootElement, event, events[event]); - } + obj = get(obj, parts[i]); + + if (obj && obj.isDestroyed) { + return undefined; } - }, + } - /** - Registers an event listener on the rootElement. If the given event is - triggered, the provided event handler will be triggered on the target view. - If the target view does not implement the event handler, or if the handler - returns `false`, the parent view will be called. The event will continue to - bubble to each successive parent view until it reaches the top. - @private - @method setupHandler - @param {Element} rootElement - @param {String} event the browser-originated event to listen to - @param {String} eventName the name of the method to call on the view - */ - setupHandler: function (rootElement, event, eventName) { - var self = this; + return obj; + } - var owner = _emberUtils.getOwner(this); - var viewRegistry = owner && owner.lookup('-view-registry:main') || _emberViewsCompatFallbackViewRegistry.default; + function isGettable(obj) { + if (obj == null) { + return false; + } - if (eventName === null) { - return; - } + return ALLOWABLE_TYPES[typeof obj]; + } - rootElement.on(event + '.ember', '.ember-view', function (evt, triggeringManager) { - var view = viewRegistry[this.id]; - var result = true; + /** + Retrieves the value of a property from an Object, or a default value in the + case that the property returns `undefined`. + + ```javascript + Ember.getWithDefault(person, 'lastName', 'Doe'); + ``` + + @method getWithDefault + @for Ember + @param {Object} obj The object to retrieve from. + @param {String} keyName The name of the property to retrieve + @param {Object} defaultValue The value to return if the property value is undefined + @return {Object} The property value or the defaultValue. + @public + */ - var manager = self.canDispatchToEventManager ? self._findNearestEventManager(view, eventName) : null; + function getWithDefault(root, key, defaultValue) { + var value = get(root, key); - if (manager && manager !== triggeringManager) { - result = self._dispatchEvent(manager, evt, eventName, view); - } else if (view) { - result = self._bubbleEvent(view, evt, eventName); - } + if (value === undefined) { + return defaultValue; + } + return value; + } - return result; - }); + exports.default = get; +}); +enifed('ember-metal/property_set', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_events', 'ember-metal/error', 'ember-metal/path_cache', 'ember-metal/meta'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_events, _emberMetalError, _emberMetalPath_cache, _emberMetalMeta) { + 'use strict'; - rootElement.on(event + '.ember', '[data-ember-action]', function (evt) { - var actionId = _emberViewsSystemJquery.default(evt.currentTarget).attr('data-ember-action'); - var actions = _emberViewsSystemAction_manager.default.registeredActions[actionId]; + exports.set = set; + exports.trySet = trySet; - // In Glimmer2 this attribute is set to an empty string and an additional - // attribute it set for each action on a given element. In this case, the - // attributes need to be read so that a proper set of action handlers can - // be coalesced. - if (actionId === '') { - var attributes = evt.currentTarget.attributes; - var attributeCount = attributes.length; + /** + 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. + + ```javascript + Ember.set(obj, "name", value); + ``` + + @method set + @for Ember + @param {Object} obj The object to modify. + @param {String} keyName The property key to set + @param {Object} value The value to set + @return {Object} the passed value. + @public + */ - actions = []; + function set(obj, keyName, value, tolerant) { + _emberMetalDebug.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); + _emberMetalDebug.assert('Cannot call set with \'' + keyName + '\' on an undefined object.', obj && typeof obj === 'object' || typeof obj === 'function'); + _emberMetalDebug.assert('The key provided to set must be a string, you passed ' + keyName, typeof keyName === 'string'); + _emberMetalDebug.assert('\'this\' in paths is not supported', !_emberMetalPath_cache.hasThis(keyName)); + _emberMetalDebug.assert('calling set on destroyed object: ' + _emberUtils.toString(obj) + '.' + keyName + ' = ' + _emberUtils.toString(value), !obj.isDestroyed); - for (var i = 0; i < attributeCount; i++) { - var attr = attributes.item(i); - var attrName = attr.name; + if (_emberMetalPath_cache.isPath(keyName)) { + return setPath(obj, keyName, value, tolerant); + } - if (attrName.indexOf('data-ember-action-') === 0) { - actions = actions.concat(_emberViewsSystemAction_manager.default.registeredActions[attr.value]); - } - } - } + var meta = _emberMetalMeta.peekMeta(obj); + var possibleDesc = obj[keyName]; - // We have to check for actions here since in some cases, jQuery will trigger - // an event on `removeChild` (i.e. focusout) after we've already torn down the - // action handlers for the view. - if (!actions) { - return; - } + var desc = undefined, + currentValue = undefined; + if (possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor) { + desc = possibleDesc; + } else { + currentValue = possibleDesc; + } - for (var index = 0; index < actions.length; index++) { - var action = actions[index]; + if (desc) { + /* computed property */ + desc.set(obj, keyName, value); + } else if (obj.setUnknownProperty && currentValue === undefined && !(keyName in obj)) { + /* unknown property */ + _emberMetalDebug.assert('setUnknownProperty must be a function', typeof obj.setUnknownProperty === 'function'); + obj.setUnknownProperty(keyName, value); + } else if (currentValue === value) { + /* no change */ + return value; + } else { + _emberMetalProperty_events.propertyWillChange(obj, keyName); - if (action && action.eventName === eventName) { - return action.handler(evt); - } - } - }); - }, + if (true) { + setWithMandatorySetter(meta, obj, keyName, value); + } else { + obj[keyName] = value; + } - _findNearestEventManager: function (view, eventName) { - var manager = null; + _emberMetalProperty_events.propertyDidChange(obj, keyName); + } - while (view) { - manager = _emberMetal.get(view, 'eventManager'); - if (manager && manager[eventName]) { - break; - } + return value; + } - view = _emberMetal.get(view, 'parentView'); + if (true) { + 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; } + }; - return manager; - }, - - _dispatchEvent: function (object, evt, eventName, view) { - var result = true; + var makeEnumerable = function (obj, key) { + var desc = Object.getOwnPropertyDescriptor(obj, key); - var handler = object[eventName]; - if (typeof handler === 'function') { - result = _emberMetal.run(object, handler, evt, view); - // Do not preventDefault in eventManagers. - evt.stopPropagation(); - } else { - result = this._bubbleEvent(view, evt, eventName); + if (desc && desc.set && desc.set.isMandatorySetter) { + desc.enumerable = true; + Object.defineProperty(obj, key, desc); } + }; + } - return result; - }, + function setPath(root, path, value, tolerant) { + // get the last part of the path + var keyName = path.slice(path.lastIndexOf('.') + 1); - _bubbleEvent: function (view, evt, eventName) { - return view.handleEvent(eventName, evt); - }, + // get the first part of the part + path = path === keyName ? keyName : path.slice(0, path.length - (keyName.length + 1)); - destroy: function () { - var rootElement = _emberMetal.get(this, 'rootElement'); - _emberViewsSystemJquery.default(rootElement).off('.ember', '**').removeClass(ROOT_ELEMENT_CLASS); - return this._super.apply(this, arguments); - }, + // unless the path is this, look up the first part to + // get the root + if (path !== 'this') { + root = _emberMetalProperty_get._getPath(root, path); + } - toString: function () { - return '(EventDispatcher)'; + if (!keyName || keyName.length === 0) { + throw new _emberMetalError.default('Property set failed: You passed an empty path'); } - }); -}); -enifed('ember-views/system/ext', ['exports', 'ember-metal'], function (exports, _emberMetal) { + + if (!root) { + if (tolerant) { + return; + } else { + throw new _emberMetalError.default('Property set failed: object in path "' + path + '" could not be found or was destroyed.'); + } + } + + return set(root, keyName, value); + } + /** - @module ember - @submodule ember-views + Error-tolerant form of `Ember.set`. Will not blow up if any part of the + chain is `undefined`, `null`, or destroyed. + + This is primarily used when syncing bindings, which may try to update after + an object has been destroyed. + + @method trySet + @for Ember + @param {Object} root The object to modify. + @param {String} path The property path to set + @param {Object} value The value to set + @public */ - 'use strict'; - - // Add a new named queue for rendering views that happens - // after bindings have synced, and a queue for scheduling actions - // that should occur after view rendering. - _emberMetal.run._addQueue('render', 'actions'); - _emberMetal.run._addQueue('afterRender', 'render'); + function trySet(root, path, value) { + return set(root, path, value, true); + } }); -enifed('ember-views/system/jquery', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { - 'use strict'; +enifed("ember-metal/replace", ["exports"], function (exports) { + "use strict"; - var jQuery = undefined; + exports.default = replace; + var splice = Array.prototype.splice; - if (_emberEnvironment.environment.hasDOM) { - jQuery = _emberEnvironment.context.imports.jQuery; + 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; + var ends = amt; + var count = undefined, + chunk = undefined; - if (jQuery) { - if (jQuery.event.addProp) { - jQuery.event.addProp('dataTransfer'); - } else { - // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dndevents - ['dragstart', 'drag', 'dragenter', 'dragleave', 'dragover', 'drop', 'dragend'].forEach(function (eventName) { - jQuery.event.fixHooks[eventName] = { - props: ['dataTransfer'] - }; - }); + while (args.length) { + count = ends > size ? size : ends; + if (count <= 0) { + count = 0; } + + chunk = args.splice(0, size); + chunk = [start, count].concat(chunk); + + start += size; + ends -= count; + + ret = ret.concat(splice.apply(array, chunk)); } + return ret; } - - exports.default = jQuery; }); -enifed('ember-views/system/lookup_partial', ['exports', 'ember-metal'], function (exports, _emberMetal) { +enifed('ember-metal/run_loop', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/testing', 'ember-metal/error_handler', 'ember-metal/property_events', 'backburner'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalTesting, _emberMetalError_handler, _emberMetalProperty_events, _backburner) { 'use strict'; - exports.default = lookupPartial; - exports.hasPartial = hasPartial; - - function parseUnderscoredName(templateName) { - var nameParts = templateName.split('/'); - var lastPart = nameParts[nameParts.length - 1]; + exports.default = run; - nameParts[nameParts.length - 1] = '_' + lastPart; + function onBegin(current) { + run.currentRunLoop = current; + } - return nameParts.join('/'); + function onEnd(current, next) { + run.currentRunLoop = next; } - function lookupPartial(templateName, owner) { - if (templateName == null) { - return; + var onErrorTarget = { + get onerror() { + return _emberMetalError_handler.getOnerror(); + }, + set onerror(handler) { + return _emberMetalError_handler.setOnerror(handler); } + }; - var template = templateFor(owner, parseUnderscoredName(templateName), templateName); - - _emberMetal.assert('Unable to find partial with name "' + templateName + '"', !!template); + var backburner = new _backburner.default(['sync', 'actions', 'destroy'], { + GUID_KEY: _emberUtils.GUID_KEY, + sync: { + before: _emberMetalProperty_events.beginPropertyChanges, + after: _emberMetalProperty_events.endPropertyChanges + }, + defaultQueue: 'actions', + onBegin: onBegin, + onEnd: onEnd, + onErrorTarget: onErrorTarget, + onErrorMethod: 'onerror' + }); - return template; - } + // .......................................................... + // run - this is ideally the only public API the dev sees + // - function hasPartial(name, owner) { - if (!owner) { - throw new _emberMetal.Error('Container was not found when looking up a views template. ' + 'This is most likely due to manually instantiating an Ember.View. ' + 'See: http://git.io/EKPpnA'); - } + /** + Runs the passed target and method inside of a RunLoop, ensuring any + deferred actions including bindings and views updates are flushed at the + end. + + Normally you should not need to invoke this method yourself. However if + you are implementing raw event handlers when interfacing with other + libraries or plugins, you should probably wrap all of your code inside this + call. + + ```javascript + run(function() { + // code to be executed within a RunLoop + }); + ``` + + @class run + @namespace Ember + @static + @constructor + @param {Object} [target] target of method to call + @param {Function|String} method Method to invoke. + May be a function or a string. If you pass a string + then it will be looked up on the passed target. + @param {Object} [args*] Any additional arguments you wish to pass to the method. + @return {Object} return value from invoking the passed function. + @public + */ - return owner.hasRegistration('template:' + parseUnderscoredName(name)) || owner.hasRegistration('template:' + name); + function run() { + return backburner.run.apply(backburner, arguments); } - function templateFor(owner, underscored, name) { - if (!name) { - return; - } - _emberMetal.assert('templateNames are not allowed to contain periods: ' + name, name.indexOf('.') === -1); + /** + If no run-loop is present, it creates a new one. If a run loop is + present it will queue itself to run on the existing run-loops action + queue. + + Please note: This is not for normal usage, and should be used sparingly. + + If invoked when not within a run loop: + + ```javascript + run.join(function() { + // creates a new run-loop + }); + ``` + + Alternatively, if called within an existing run loop: + + ```javascript + run(function() { + // creates a new run-loop + run.join(function() { + // joins with the existing run-loop, and queues for invocation on + // the existing run-loops action queue. + }); + }); + ``` + + @method join + @namespace Ember + @param {Object} [target] target of method to call + @param {Function|String} method Method to invoke. + May be a function or a string. If you pass a string + then it will be looked up on the passed target. + @param {Object} [args*] Any additional arguments you wish to pass to the method. + @return {Object} Return value from invoking the passed function. Please note, + when called within an existing loop, no return value is possible. + @public + */ + run.join = function () { + return backburner.join.apply(backburner, arguments); + }; - if (!owner) { - throw new _emberMetal.Error('Container was not found when looking up a views template. ' + 'This is most likely due to manually instantiating an Ember.View. ' + 'See: http://git.io/EKPpnA'); + /** + Allows you to specify which context to call the specified function in while + adding the execution of that function to the Ember run loop. This ability + makes this method a great way to asynchronously integrate third-party libraries + into your Ember application. + + `run.bind` takes two main arguments, the desired context and the function to + invoke in that context. Any additional arguments will be supplied as arguments + to the function that is passed in. + + Let's use the creation of a TinyMCE component as an example. Currently, + TinyMCE provides a setup configuration option we can use to do some processing + after the TinyMCE instance is initialized but before it is actually rendered. + We can use that setup option to do some additional setup for our component. + The component itself could look something like the following: + + ```javascript + App.RichTextEditorComponent = Ember.Component.extend({ + initializeTinyMCE: Ember.on('didInsertElement', function() { + tinymce.init({ + selector: '#' + this.$().prop('id'), + setup: Ember.run.bind(this, this.setupEditor) + }); + }), + + setupEditor: function(editor) { + this.set('editor', editor); + + editor.on('change', function() { + console.log('content changed!'); + }); + } + }); + ``` + + In this example, we use Ember.run.bind to bind the setupEditor method to the + context of the App.RichTextEditorComponent and to have the invocation of that + method be safely handled and executed by the Ember run loop. + + @method bind + @namespace Ember + @param {Object} [target] target of method to call + @param {Function|String} method Method to invoke. + May be a function or a string. If you pass a string + then it will be looked up on the passed target. + @param {Object} [args*] Any additional arguments you wish to pass to the method. + @return {Function} returns a new function that will always have a particular context + @since 1.4.0 + @public + */ + run.bind = function () { + for (var _len = arguments.length, curried = Array(_len), _key = 0; _key < _len; _key++) { + curried[_key] = arguments[_key]; } - return owner.lookup('template:' + underscored) || owner.lookup('template:' + name); - } -}); -enifed('ember-views/system/utils', ['exports', 'ember-utils'], function (exports, _emberUtils) { - /* globals Element */ - 'use strict'; + return function () { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - exports.isSimpleClick = isSimpleClick; - exports.getRootViews = getRootViews; - exports.getViewId = getViewId; - exports.getViewElement = getViewElement; - exports.initViewElement = initViewElement; - exports.setViewElement = setViewElement; - exports.getChildViews = getChildViews; - exports.initChildViews = initChildViews; - exports.addChildView = addChildView; - exports.collectChildViews = collectChildViews; - exports.getViewBounds = getViewBounds; - exports.getViewRange = getViewRange; - exports.getViewClientRects = getViewClientRects; - exports.getViewBoundingClientRect = getViewBoundingClientRect; - exports.matches = matches; + return run.join.apply(run, curried.concat(args)); + }; + }; + + run.backburner = backburner; + run.currentRunLoop = null; + run.queues = backburner.queueNames; /** - @module ember - @submodule ember-views + Begins a new RunLoop. Any deferred actions invoked after the begin will + be buffered until you invoke a matching call to `run.end()`. This is + a lower-level way to use a RunLoop instead of using `run()`. + + ```javascript + run.begin(); + // code to be executed within a RunLoop + run.end(); + ``` + + @method begin + @return {void} + @public */ + run.begin = function () { + backburner.begin(); + }; - 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; - } - - var STYLE_WARNING = '' + '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.'; + /** + Ends a RunLoop. This must be called sometime after you call + `run.begin()` to flush any deferred actions. This is a lower-level way + to use a RunLoop instead of using `run()`. + + ```javascript + run.begin(); + // code to be executed within a RunLoop + run.end(); + ``` + + @method end + @return {void} + @public + */ + run.end = function () { + backburner.end(); + }; - exports.STYLE_WARNING = STYLE_WARNING; /** + Array of named queues. This array determines the order in which queues + are flushed at the end of the RunLoop. You can define your own queues by + simply adding the queue name to this array. Normally you should not need + to inspect or modify this property. + + @property queues + @type Array + @default ['sync', 'actions', 'destroy'] @private - @method getRootViews - @param {Object} owner */ - function getRootViews(owner) { - var registry = owner.lookup('-view-registry:main'); - - var rootViews = []; + /** + Adds the passed target/method and any optional arguments to the named + queue to be executed at the end of the RunLoop. If you have not already + started a RunLoop when calling this method one will be started for you + automatically. + + At the end of a RunLoop, any methods scheduled in this way will be invoked. + Methods will be invoked in an order matching the named queues defined in + the `run.queues` property. + + ```javascript + run.schedule('sync', this, function() { + // this will be executed in the first RunLoop queue, when bindings are synced + console.log('scheduled on sync queue'); + }); + + run.schedule('actions', this, function() { + // this will be executed in the 'actions' queue, after bindings have synced. + console.log('scheduled on actions queue'); + }); + + // Note the functions will be run in order based on the run queues order. + // Output would be: + // scheduled on sync queue + // scheduled on actions queue + ``` + + @method schedule + @param {String} queue The name of the queue to schedule against. + Default queues are 'sync' and 'actions' + @param {Object} [target] target object to use as the context when invoking a method. + @param {String|Function} method The method to invoke. If you pass a string it + will be resolved on the target object at the time the scheduled item is + invoked allowing you to change the target function. + @param {Object} [arguments*] Optional arguments to be passed to the queued method. + @return {*} Timer information for use in cancelling, see `run.cancel`. + @public + */ + run.schedule = function () /* queue, target, method */{ + _emberMetalDebug.assert('You have turned on testing mode, which disabled the run-loop\'s autorun. ' + 'You will need to wrap any code with asynchronous side-effects in a run', run.currentRunLoop || !_emberMetalTesting.isTesting()); - Object.keys(registry).forEach(function (id) { - var view = registry[id]; + return backburner.schedule.apply(backburner, arguments); + }; - if (view.parentView === null) { - rootViews.push(view); - } - }); + // Used by global test teardown + run.hasScheduledTimers = function () { + return backburner.hasTimers(); + }; - return rootViews; - } + // Used by global test teardown + run.cancelTimers = function () { + backburner.cancelTimers(); + }; /** + Immediately flushes any events scheduled in the 'sync' queue. Bindings + use this queue so this method is a useful way to immediately force all + bindings in the application to sync. + + You should call this method anytime you need any changed state to propagate + throughout the app immediately without repainting the UI (which happens + in the later 'render' queue added by the `ember-views` package). + + ```javascript + run.sync(); + ``` + + @method sync + @return {void} @private - @method getViewId - @param {Ember.View} view - */ - - function getViewId(view) { - if (view.tagName === '') { - return _emberUtils.guidFor(view); - } else { - return view.elementId || _emberUtils.guidFor(view); + */ + run.sync = function () { + if (backburner.currentInstance) { + backburner.currentInstance.queues.sync.flush(); } - } + }; - var VIEW_ELEMENT = _emberUtils.symbol('VIEW_ELEMENT'); + /** + Invokes the passed target/method and optional arguments after a specified + period of time. The last parameter of this method must always be a number + of milliseconds. + + You should use this method whenever you need to run some action after a + period of time instead of using `setTimeout()`. This method will ensure that + items that expire during the same script execution cycle all execute + together, which is often more efficient than using a real setTimeout. + + ```javascript + run.later(myContext, function() { + // code here will execute within a RunLoop in about 500ms with this == myContext + }, 500); + ``` + + @method later + @param {Object} [target] target of method to invoke + @param {Function|String} method The method to invoke. + If you pass a string it will be resolved on the + target at the time the method is invoked. + @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 () /*target, method*/{ + return backburner.later.apply(backburner, arguments); + }; /** - @private - @method getViewElement - @param {Ember.View} view - */ - - function getViewElement(view) { - return view[VIEW_ELEMENT]; - } - - function initViewElement(view) { - view[VIEW_ELEMENT] = null; - } + Schedule a function to run one time during the current RunLoop. This is equivalent + to calling `scheduleOnce` with the "actions" queue. + + @method once + @param {Object} [target] The target of the method to invoke. + @param {Function|String} method The method to invoke. + If you pass a string it will be resolved on the + 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.once = function () { + _emberMetalDebug.assert('You have turned on testing mode, which disabled the run-loop\'s autorun. ' + 'You will need to wrap any code with asynchronous side-effects in a run', run.currentRunLoop || !_emberMetalTesting.isTesting()); - function setViewElement(view, element) { - return view[VIEW_ELEMENT] = element; - } + for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } - var CHILD_VIEW_IDS = _emberUtils.symbol('CHILD_VIEW_IDS'); + args.unshift('actions'); + return backburner.scheduleOnce.apply(backburner, args); + }; /** - @private - @method getChildViews - @param {Ember.View} view + Schedules a function to run one time in a given queue of the current RunLoop. + Calling this method with the same queue/target/method combination will have + no effect (past the initial call). + + Note that although you can pass optional arguments these will not be + considered when looking for duplicates. New arguments will replace previous + calls. + + ```javascript + function sayHi() { + console.log('hi'); + } + + run(function() { + run.scheduleOnce('afterRender', myContext, sayHi); + run.scheduleOnce('afterRender', myContext, sayHi); + // sayHi will only be executed once, in the afterRender queue of the RunLoop + }); + ``` + + Also note that passing an anonymous function to `run.scheduleOnce` will + not prevent additional calls with an identical anonymous function from + scheduling the items multiple times, e.g.: + + ```javascript + function scheduleIt() { + run.scheduleOnce('actions', myContext, function() { + console.log('Closure'); + }); + } + + scheduleIt(); + scheduleIt(); + + // "Closure" will print twice, even though we're using `run.scheduleOnce`, + // because the function we pass to it is anonymous and won't match the + // previously scheduled operation. + ``` + + Available queues, and their order, can be found at `run.queues` + + @method scheduleOnce + @param {String} [queue] The name of the queue to schedule against. Default queues are 'sync' and 'actions'. + @param {Object} [target] The target of the method to invoke. + @param {Function|String} method The method to invoke. + If you pass a string it will be resolved on the + 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 () /*queue, target, method*/{ + _emberMetalDebug.assert('You have turned on testing mode, which disabled the run-loop\'s autorun. ' + 'You will need to wrap any code with asynchronous side-effects in a run', run.currentRunLoop || !_emberMetalTesting.isTesting()); + return backburner.scheduleOnce.apply(backburner, arguments); + }; - function getChildViews(view) { - var owner = _emberUtils.getOwner(view); - var registry = owner.lookup('-view-registry:main'); - return collectChildViews(view, registry); - } - - function initChildViews(view) { - view[CHILD_VIEW_IDS] = []; - } - - function addChildView(parent, child) { - parent[CHILD_VIEW_IDS].push(getViewId(child)); - } - - function collectChildViews(view, registry) { - var ids = []; - var views = []; - - view[CHILD_VIEW_IDS].forEach(function (id) { - var view = registry[id]; - - if (view && !view.isDestroying && !view.isDestroyed && ids.indexOf(id) === -1) { - ids.push(id); - views.push(view); + /** + Schedules an item to run from within a separate run loop, after + control has been returned to the system. This is equivalent to calling + `run.later` with a wait time of 1ms. + + ```javascript + run.next(myContext, function() { + // code to be executed in the next run loop, + // which will be scheduled after the current one + }); + ``` + + Multiple operations scheduled with `run.next` will coalesce + into the same later run loop, along with any other operations + scheduled by `run.later` that expire right around the same + time that `run.next` operations will fire. + + Note that there are often alternatives to using `run.next`. + For instance, if you'd like to schedule an operation to happen + after all DOM element operations have completed within the current + run loop, you can make use of the `afterRender` run loop queue (added + by the `ember-views` package, along with the preceding `render` queue + where all the DOM element operations happen). + + Example: + + ```javascript + export default Ember.Component.extend({ + didInsertElement() { + this._super(...arguments); + run.scheduleOnce('afterRender', this, 'processChildElements'); + }, + + processChildElements() { + // ... do something with component's child component + // elements after they've finished rendering, which + // can't be done within this component's + // `didInsertElement` hook because that gets run + // before the child elements have been added to the DOM. } }); + ``` + + One benefit of the above approach compared to using `run.next` is + that you will be able to perform DOM/CSS operations before unprocessed + elements are rendered to the screen, which may prevent flickering or + other artifacts caused by delaying processing until after rendering. + + The other major benefit to the above approach is that `run.next` + introduces an element of non-determinism, which can make things much + harder to test, due to its reliance on `setTimeout`; it's much harder + to guarantee the order of scheduled operations when they are scheduled + outside of the current run loop, i.e. with `run.next`. + + @method next + @param {Object} [target] target of method to invoke + @param {Function|String} method The method to invoke. + If you pass a string it will be resolved on the + 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.next = function () { + for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; + } - view[CHILD_VIEW_IDS] = ids; - - return views; - } + args.push(1); + return backburner.later.apply(backburner, args); + }; /** - @private - @method getViewBounds - @param {Ember.View} view + Cancels a scheduled item. Must be a value returned by `run.later()`, + `run.once()`, `run.scheduleOnce()`, `run.next()`, `run.debounce()`, or + `run.throttle()`. + + ```javascript + let runNext = run.next(myContext, function() { + // will not be executed + }); + + run.cancel(runNext); + + let runLater = run.later(myContext, function() { + // will not be executed + }, 500); + + run.cancel(runLater); + + let runScheduleOnce = run.scheduleOnce('afterRender', myContext, function() { + // will not be executed + }); + + run.cancel(runScheduleOnce); + + let runOnce = run.once(myContext, function() { + // will not be executed + }); + + run.cancel(runOnce); + + let throttle = run.throttle(myContext, function() { + // will not be executed + }, 1, false); + + run.cancel(throttle); + + let debounce = run.debounce(myContext, function() { + // will not be executed + }, 1); + + run.cancel(debounce); + + let debounceImmediate = run.debounce(myContext, function() { + // will be executed since we passed in true (immediate) + }, 100, true); + + // the 100ms delay until this method can be called again will be cancelled + run.cancel(debounceImmediate); + ``` + + @method cancel + @param {Object} timer Timer object to cancel + @return {Boolean} true if cancelled or false/undefined if it wasn't found + @public */ - - function getViewBounds(view) { - return view.renderer.getBounds(view); - } + run.cancel = function (timer) { + return backburner.cancel(timer); + }; /** - @private - @method getViewRange - @param {Ember.View} view + Delay calling the target method until the debounce period has elapsed + with no additional debounce calls. If `debounce` is called again before + the specified time has elapsed, the timer is reset and the entire period + must pass again before the target method is called. + + This method should be used when an event may be called multiple times + but the action should only be called once when the event is done firing. + A common example is for scroll events where you only want updates to + happen once scrolling has ceased. + + ```javascript + function whoRan() { + console.log(this.name + ' ran.'); + } + + let myContext = { name: 'debounce' }; + + run.debounce(myContext, whoRan, 150); + + // less than 150ms passes + run.debounce(myContext, whoRan, 150); + + // 150ms passes + // whoRan is invoked with context myContext + // console logs 'debounce ran.' one time. + ``` + + Immediate allows you to run the function immediately, but debounce + other calls for this function until the wait time has elapsed. If + `debounce` is called again before the specified time has elapsed, + the timer is reset and the entire period must pass again before + the method can be called again. + + ```javascript + function whoRan() { + console.log(this.name + ' ran.'); + } + + let myContext = { name: 'debounce' }; + + run.debounce(myContext, whoRan, 150, true); + + // console logs 'debounce ran.' one time immediately. + // 100ms passes + run.debounce(myContext, whoRan, 150, true); + + // 150ms passes and nothing else is logged to the console and + // the debouncee is no longer being watched + run.debounce(myContext, whoRan, 150, true); + + // console logs 'debounce ran.' one time immediately. + // 150ms passes and nothing else is logged to the console and + // the debouncee is no longer being watched + + ``` + + @method debounce + @param {Object} [target] target of method to invoke + @param {Function|String} method The method to invoke. + May be a function or a string. If you pass a string + then it will be looked up on the passed target. + @param {Object} [args*] Optional arguments to pass to the timeout. + @param {Number} wait Number of milliseconds to wait. + @param {Boolean} immediate Trigger the function on the leading instead + of the trailing edge of the wait interval. Defaults to false. + @return {Array} Timer information for use in cancelling, see `run.cancel`. + @public */ - - function getViewRange(view) { - var bounds = getViewBounds(view); - - var range = document.createRange(); - range.setStartBefore(bounds.firstNode); - range.setEndAfter(bounds.lastNode); - - return range; - } + run.debounce = function () { + return backburner.debounce.apply(backburner, arguments); + }; /** - `getViewClientRects` provides information about the position of the border - box edges of a view relative to the viewport. + Ensure that the target method is never called more frequently than + the specified spacing period. The target method is called immediately. - It is only intended to be used by development tools like the Ember Inspector - and may not work on older browsers. + ```javascript + function whoRan() { + console.log(this.name + ' ran.'); + } - @private - @method getViewClientRects - @param {Ember.View} view + let myContext = { name: 'throttle' }; + + run.throttle(myContext, whoRan, 150); + // whoRan is invoked with context myContext + // console logs 'throttle ran.' + + // 50ms passes + run.throttle(myContext, whoRan, 150); + + // 50ms passes + run.throttle(myContext, whoRan, 150); + + // 150ms passes + run.throttle(myContext, whoRan, 150); + // whoRan is invoked with context myContext + // console logs 'throttle ran.' + ``` + + @method throttle + @param {Object} [target] target of method to invoke + @param {Function|String} method The method to invoke. + May be a function or a string. If you pass a string + then it will be looked up on the passed target. + @param {Object} [args*] Optional arguments to pass to the timeout. + @param {Number} spacing Number of milliseconds to space out requests. + @param {Boolean} immediate Trigger the function on the leading instead + of the trailing edge of the wait interval. Defaults to true. + @return {Array} Timer information for use in cancelling, see `run.cancel`. + @public */ - - function getViewClientRects(view) { - var range = getViewRange(view); - return range.getClientRects(); - } + run.throttle = function () { + return backburner.throttle.apply(backburner, arguments); + }; /** - `getViewBoundingClientRect` provides information about the position of the - bounding border box edges of a view relative to the viewport. + Add a new named queue after the specified queue. - It is only intended to be used by development tools like the Ember Inpsector - and may not work on older browsers. + The queue to add will only be added once. + @method _addQueue + @param {String} name the name of the queue to add. + @param {String} after the name of the queue to add after. @private - @method getViewBoundingClientRect - @param {Ember.View} view */ + run._addQueue = function (name, after) { + if (run.queues.indexOf(name) === -1) { + run.queues.splice(run.queues.indexOf(after) + 1, 0, name); + } + }; +}); +enifed('ember-metal/set_properties', ['exports', 'ember-metal/property_events', 'ember-metal/property_set'], function (exports, _emberMetalProperty_events, _emberMetalProperty_set) { + 'use strict'; - function getViewBoundingClientRect(view) { - var range = getViewRange(view); - return range.getBoundingClientRect(); - } + exports.default = setProperties; /** - Determines if the element matches the specified selector. + Set a list of properties on an object. These properties are set inside + a single `beginPropertyChanges` and `endPropertyChanges` batch, so + observers will be buffered. - @private - @method matches - @param {DOMElement} el - @param {String} selector + ```javascript + let anObject = Ember.Object.create(); + + anObject.setProperties({ + firstName: 'Stanley', + lastName: 'Stuart', + age: 21 + }); + ``` + + @method setProperties + @param obj + @param {Object} properties + @return properties + @public */ - var elMatches = typeof Element !== 'undefined' && (Element.prototype.matches || Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector); - exports.elMatches = elMatches; + function setProperties(obj, properties) { + if (!properties || typeof properties !== 'object') { + return properties; + } + _emberMetalProperty_events.changeProperties(function () { + var props = Object.keys(properties); + var propertyName = undefined; - function matches(el, selector) { - return elMatches.call(el, selector); + for (var i = 0; i < props.length; i++) { + propertyName = props[i]; + + _emberMetalProperty_set.set(obj, propertyName, properties[propertyName]); + } + }); + return properties; } }); -enifed('ember-views/utils/lookup-component', ['exports', 'container'], function (exports, _container) { +enifed('ember-metal/tags', ['exports', '@glimmer/reference', 'ember-metal/meta', 'require', 'ember-metal/is_proxy'], function (exports, _glimmerReference, _emberMetalMeta, _require, _emberMetalIs_proxy) { 'use strict'; - exports.default = lookupComponent; + exports.setHasViews = setHasViews; + exports.tagForProperty = tagForProperty; + exports.tagFor = tagFor; + exports.markObjectAsDirty = markObjectAsDirty; - var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['component:-default'], ['component:-default']); + var hasViews = function () { + return false; + }; - function lookupComponentPair(componentLookup, owner, name, options) { - var component = componentLookup.componentFor(name, owner, options); - var layout = componentLookup.layoutFor(name, owner, options); + function setHasViews(fn) { + hasViews = fn; + } - var result = { layout: layout, component: component }; + function makeTag() { + return new _glimmerReference.DirtyableTag(); + } + + function tagForProperty(object, propertyKey, _meta) { + if (_emberMetalIs_proxy.isProxy(object)) { + return tagFor(object, _meta); + } + + if (typeof object === 'object' && object) { + var meta = _meta || _emberMetalMeta.meta(object); + var tags = meta.writableTags(); + var tag = tags[propertyKey]; + if (tag) { + return tag; + } + + return tags[propertyKey] = makeTag(); + } else { + return _glimmerReference.CONSTANT_TAG; + } + } + + function tagFor(object, _meta) { + if (typeof object === 'object' && object) { + var meta = _meta || _emberMetalMeta.meta(object); + return meta.writableTag(makeTag); + } else { + return _glimmerReference.CONSTANT_TAG; + } + } + + function markObjectAsDirty(meta, propertyKey) { + var objectTag = meta && meta.readableTag(); + + if (objectTag) { + objectTag.dirty(); + } + + var tags = meta && meta.readableTags(); + var propertyTag = tags && tags[propertyKey]; - if (layout && !component) { - result.component = owner._lookupFactory(_container.privatize(_templateObject)); + if (propertyTag) { + propertyTag.dirty(); } - return result; + if (objectTag || propertyTag) { + ensureRunloop(); + } } - function lookupComponent(owner, name, options) { - var componentLookup = owner.lookup('component-lookup:main'); + var run = undefined; - var source = options && options.source; + function K() {} - if (source) { - var localResult = lookupComponentPair(componentLookup, owner, name, options); + function ensureRunloop() { + if (!run) { + run = _require.default('ember-metal/run_loop').default; + } - if (localResult.component || localResult.layout) { - return localResult; - } + if (hasViews() && !run.backburner.currentInstance) { + run.schedule('actions', K); } + } +}); +enifed("ember-metal/testing", ["exports"], function (exports) { + "use strict"; - return lookupComponentPair(componentLookup, owner, name); + exports.isTesting = isTesting; + exports.setTesting = setTesting; + var testing = false; + + function isTesting() { + return testing; + } + + function setTesting(value) { + testing = !!value; } }); -enifed('ember-views/views/core_view', ['exports', 'ember-runtime', 'ember-views/system/utils', 'ember-views/views/states'], function (exports, _emberRuntime, _emberViewsSystemUtils, _emberViewsViewsStates) { +enifed('ember-metal/transaction', ['exports', 'ember-metal/meta', 'ember-metal/debug', 'ember-metal/features'], function (exports, _emberMetalMeta, _emberMetalDebug, _emberMetalFeatures) { 'use strict'; - /** - `Ember.CoreView` is an abstract class that exists to give view-like behavior - to both Ember's main view class `Ember.Component` and other classes that don't need - the full functionality of `Ember.Component`. - - Unless you have specific needs for `CoreView`, you will use `Ember.Component` - in your applications. - - @class CoreView - @namespace Ember - @extends Ember.Object - @deprecated Use `Ember.Component` instead. - @uses Ember.Evented - @uses Ember.ActionHandler - @private - */ - var CoreView = _emberRuntime.FrameworkObject.extend(_emberRuntime.Evented, _emberRuntime.ActionHandler, { - isView: true, + var runInTransaction = undefined, + didRender = undefined, + assertNotRendered = undefined; - _states: _emberViewsViewsStates.cloneStates(_emberViewsViewsStates.states), + // detect-backtracking-rerender by default is debug build only + // detect-glimmer-allow-backtracking-rerender can be enabled in custom builds + if (true || true) { + (function () { + var counter = 0; + var inTransaction = false; + var shouldReflush = undefined; + var debugStack = undefined; - init: function () { - this._super.apply(this, arguments); - this._state = 'preRender'; - this._currentState = this._states.preRender; + exports.default = runInTransaction = function (context, methodName) { + shouldReflush = false; + inTransaction = true; + _emberMetalDebug.runInDebug(function () { + debugStack = context.env.debugStack; + }); + context[methodName](); + inTransaction = false; + counter++; + return shouldReflush; + }; - _emberViewsSystemUtils.initViewElement(this); + exports.didRender = didRender = function (object, key, reference) { + if (!inTransaction) { + return; + } + var meta = _emberMetalMeta.meta(object); + var lastRendered = meta.writableLastRendered(); + lastRendered[key] = counter; - if (!this.renderer) { - throw new Error('Cannot instantiate a component without a renderer. Please ensure that you are creating ' + this + ' with a proper container/registry.'); - } - }, + _emberMetalDebug.runInDebug(function () { + var referenceMap = meta.writableLastRenderedReferenceMap(); + referenceMap[key] = reference; - /** - If the view is currently inserted into the DOM of a parent view, this - property will point to the parent of the view. - @property parentView - @type Ember.View - @default null - @private - */ - parentView: null, + var templateMap = meta.writableLastRenderedTemplateMap(); + if (templateMap[key] === undefined) { + templateMap[key] = debugStack.peek(); + } + }); + }; - instrumentDetails: function (hash) { - hash.object = this.toString(); - hash.containerKey = this._debugContainerKey; - hash.view = this; - return hash; - }, + exports.assertNotRendered = assertNotRendered = function (object, key, _meta) { + var meta = _meta || _emberMetalMeta.meta(object); + var lastRendered = meta.readableLastRendered(); - /** - Override the default event firing from `Ember.Evented` to - also call methods with the given name. - @method trigger - @param name {String} - @private - */ - trigger: function () { - this._super.apply(this, arguments); - var name = arguments[0]; - var method = this[name]; - if (method) { - var args = new Array(arguments.length - 1); - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - return method.apply(this, args); - } - }, + if (lastRendered && lastRendered[key] === counter) { + _emberMetalDebug.runInDebug(function () { + var templateMap = meta.readableLastRenderedTemplateMap(); + var lastRenderedIn = templateMap[key]; + var currentlyIn = debugStack.peek(); - has: function (name) { - return _emberRuntime.typeOf(this[name]) === 'function' || this._super(name); - } - }); + var referenceMap = meta.readableLastRenderedReferenceMap(); + var lastRef = referenceMap[key]; + var parts = []; + var label = undefined; - _emberRuntime.deprecateUnderscoreActions(CoreView); + if (lastRef) { + while (lastRef && lastRef._propertyKey) { + parts.unshift(lastRef._propertyKey); + lastRef = lastRef._parentReference; + } - CoreView.reopenClass({ - isViewFactory: true - }); + label = parts.join('.'); + } else { + label = 'the same value'; + } - exports.default = CoreView; + var message = 'You modified "' + label + '" twice on ' + object + ' in a single render. It was rendered in ' + lastRenderedIn + ' and modified in ' + currentlyIn + '. This was unreliable and slow in Ember 1.x and'; + + if (true) { + _emberMetalDebug.deprecate(message + ' will be removed in Ember 3.0.', false, { id: 'ember-views.render-double-modify', until: '3.0.0' }); + } else { + _emberMetalDebug.assert(message + ' is no longer supported. See https://github.com/emberjs/ember.js/issues/13948 for more details.', false); + } + }); + + shouldReflush = true; + } + }; + })(); + } else { + // in production do nothing to detect reflushes + exports.default = runInTransaction = function (context, methodName) { + context[methodName](); + return false; + }; + } + + exports.default = runInTransaction; + exports.didRender = didRender; + exports.assertNotRendered = assertNotRendered; }); -enifed('ember-views/views/states', ['exports', 'ember-utils', '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, _emberUtils, _emberViewsViewsStatesDefault, _emberViewsViewsStatesPre_render, _emberViewsViewsStatesHas_element, _emberViewsViewsStatesIn_dom, _emberViewsViewsStatesDestroying) { +enifed('ember-metal/watch_key', ['exports', 'ember-utils', 'ember-metal/features', 'ember-metal/meta', 'ember-metal/properties'], function (exports, _emberUtils, _emberMetalFeatures, _emberMetalMeta, _emberMetalProperties) { 'use strict'; - exports.cloneStates = cloneStates; + exports.watchKey = watchKey; + exports.unwatchKey = unwatchKey; - function cloneStates(from) { - var into = {}; + var handleMandatorySetter = undefined; - into._default = {}; - into.preRender = Object.create(into._default); - into.destroying = Object.create(into._default); - into.hasElement = Object.create(into._default); - into.inDOM = Object.create(into.hasElement); + function watchKey(obj, keyName, meta) { + if (typeof obj !== 'object' || obj === null) { + return; + } + var m = meta || _emberMetalMeta.meta(obj); - for (var stateName in from) { - if (!from.hasOwnProperty(stateName)) { - continue; + // activate watching first time + if (!m.peekWatching(keyName)) { + m.writeWatching(keyName, 1); + + var possibleDesc = obj[keyName]; + var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; + if (desc && desc.willWatch) { + desc.willWatch(obj, keyName); } - _emberUtils.assign(into[stateName], from[stateName]); - } - return into; + if ('function' === typeof obj.willWatchProperty) { + obj.willWatchProperty(keyName); + } + + if (true) { + // NOTE: this is dropped for prod + minified builds + handleMandatorySetter(m, obj, keyName); + } + } else { + m.writeWatching(keyName, (m.peekWatching(keyName) || 0) + 1); + } } - /* - Describe how the specified actions should behave in the various - states that a view can exist in. Possible states: - - * preRender: when a view is first instantiated, and after its - element was destroyed, it is in the preRender state - * hasElement: the DOM representation of the view is created, - and is ready to be inserted - * inDOM: once a view has been inserted into the DOM it is in - the inDOM state. A view spends the vast majority of its - existence in this state. - * destroyed: once a view has been destroyed (using the destroy - method), it is in this state. No further actions can be invoked - on a destroyed view. - */ - var states = { - _default: _emberViewsViewsStatesDefault.default, - preRender: _emberViewsViewsStatesPre_render.default, - inDOM: _emberViewsViewsStatesIn_dom.default, - hasElement: _emberViewsViewsStatesHas_element.default, - destroying: _emberViewsViewsStatesDestroying.default - }; - exports.states = states; -}); -enifed('ember-views/views/states/default', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; + if (true) { + (function () { + var hasOwnProperty = function (obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); + }; - /** - @module ember - @submodule ember-views - */ - exports.default = { - // appendChild is only legal while rendering the buffer. - appendChild: function () { - throw new _emberMetal.Error('You can\'t use appendChild outside of the rendering process'); - }, + var propertyIsEnumerable = function (obj, key) { + return Object.prototype.propertyIsEnumerable.call(obj, key); + }; - // Handle events from `Ember.EventDispatcher` - handleEvent: function () { - return true; // continue event propagation - }, + // 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 = _emberUtils.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; - rerender: function () {}, + if (isDescriptor) { + return; + } - destroy: function () {} - }; -}); -enifed('ember-views/views/states/destroying', ['exports', 'ember-utils', 'ember-metal', 'ember-views/views/states/default'], function (exports, _emberUtils, _emberMetal, _emberViewsViewsStatesDefault) { - 'use strict'; + // 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 + }; - /** - @module ember - @submodule ember-views - */ + if (hasOwnProperty(obj, keyName)) { + m.writeValues(keyName, obj[keyName]); + desc.get = _emberMetalProperties.DEFAULT_GETTER_FUNCTION(keyName); + } else { + desc.get = _emberMetalProperties.INHERITING_GETTER_FUNCTION(keyName); + } - var destroying = Object.create(_emberViewsViewsStatesDefault.default); + Object.defineProperty(obj, keyName, desc); + } + }; + })(); + } - _emberUtils.assign(destroying, { - appendChild: function () { - throw new _emberMetal.Error('You can\'t call appendChild on a view being destroyed'); - }, - rerender: function () { - throw new _emberMetal.Error('You can\'t call rerender on a view being destroyed'); + function unwatchKey(obj, keyName, _meta) { + if (typeof obj !== 'object' || obj === null) { + return; } - }); + var meta = _meta || _emberMetalMeta.meta(obj); - exports.default = destroying; -}); -enifed('ember-views/views/states/has_element', ['exports', 'ember-utils', 'ember-views/views/states/default', 'ember-metal'], function (exports, _emberUtils, _emberViewsViewsStatesDefault, _emberMetal) { - 'use strict'; + // do nothing of this object has already been destroyed + if (meta.isSourceDestroyed()) { + return; + } - var hasElement = Object.create(_emberViewsViewsStatesDefault.default); + var count = meta.peekWatching(keyName); + if (count === 1) { + meta.writeWatching(keyName, 0); - _emberUtils.assign(hasElement, { + var possibleDesc = obj[keyName]; + var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - rerender: function (view) { - view.renderer.rerender(view); - }, + if (desc && desc.didUnwatch) { + desc.didUnwatch(obj, keyName); + } - destroy: function (view) { - view.renderer.remove(view); - }, + if ('function' === typeof obj.didUnwatchProperty) { + obj.didUnwatchProperty(keyName); + } - // Handle events from `Ember.EventDispatcher` - handleEvent: function (view, eventName, event) { - if (view.has(eventName)) { - // Handler should be able to re-dispatch events, so we don't - // preventDefault or stopPropagation. - return _emberMetal.flaggedInstrument('interaction.' + eventName, { event: event, view: view }, function () { - return _emberMetal.run.join(view, view.trigger, eventName, event); - }); - } else { - return true; // continue event propagation + if (true) { + // 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 = _emberUtils.lookupDescriptor(obj, keyName); + + if (maybeMandatoryDescriptor.set && maybeMandatoryDescriptor.set.isMandatorySetter) { + if (maybeMandatoryDescriptor.get && maybeMandatoryDescriptor.get.isInheritingGetter) { + var possibleValue = meta.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: meta.peekValues(keyName) + }); + meta.deleteFromValues(keyName); + } + } } + } else if (count > 1) { + meta.writeWatching(keyName, count - 1); } - }); - - exports.default = hasElement; + } }); -enifed('ember-views/views/states/in_dom', ['exports', 'ember-utils', 'ember-metal', 'ember-views/views/states/has_element'], function (exports, _emberUtils, _emberMetal, _emberViewsViewsStatesHas_element) { +enifed('ember-metal/watch_path', ['exports', 'ember-metal/meta', 'ember-metal/chains'], function (exports, _emberMetalMeta, _emberMetalChains) { 'use strict'; - /** - @module ember - @submodule ember-views - */ + exports.makeChainNode = makeChainNode; + exports.watchPath = watchPath; + exports.unwatchPath = unwatchPath; - var inDOM = Object.create(_emberViewsViewsStatesHas_element.default); + // get the chains for the current object. If the current object has + // chains inherited from the proto they will be cloned and reconfigured for + // the current object. + function chainsFor(obj, meta) { + return (meta || _emberMetalMeta.meta(obj)).writableChains(makeChainNode); + } - _emberUtils.assign(inDOM, { - enter: function (view) { - // Register the view for event handling. This hash is used by - // Ember.EventDispatcher to dispatch incoming events. - view.renderer.register(view); + function makeChainNode(obj) { + return new _emberMetalChains.ChainNode(null, null, obj); + } - _emberMetal.runInDebug(function () { - _emberMetal._addBeforeObserver(view, 'elementId', function () { - throw new _emberMetal.Error('Changing a view\'s elementId after creation is not allowed'); - }); - }); - }, + function watchPath(obj, keyPath, meta) { + if (typeof obj !== 'object' || obj === null) { + return; + } + var m = meta || _emberMetalMeta.meta(obj); + var counter = m.peekWatching(keyPath) || 0; + if (!counter) { + // activate watching first time + m.writeWatching(keyPath, 1); + chainsFor(obj, m).add(keyPath); + } else { + m.writeWatching(keyPath, counter + 1); + } + } - exit: function (view) { - view.renderer.unregister(view); + function unwatchPath(obj, keyPath, meta) { + if (typeof obj !== 'object' || obj === null) { + return; } - }); + var m = meta || _emberMetalMeta.meta(obj); + var counter = m.peekWatching(keyPath) || 0; - exports.default = inDOM; + if (counter === 1) { + m.writeWatching(keyPath, 0); + chainsFor(obj, m).remove(keyPath); + } else if (counter > 1) { + m.writeWatching(keyPath, counter - 1); + } + } }); -enifed('ember-views/views/states/pre_render', ['exports', 'ember-views/views/states/default'], function (exports, _emberViewsViewsStatesDefault) { - 'use strict'; - +enifed('ember-metal/watching', ['exports', 'ember-metal/watch_key', 'ember-metal/watch_path', 'ember-metal/path_cache', 'ember-metal/meta'], function (exports, _emberMetalWatch_key, _emberMetalWatch_path, _emberMetalPath_cache, _emberMetalMeta) { /** - @module ember - @submodule ember-views + @module ember-metal */ - exports.default = Object.create(_emberViewsViewsStatesDefault.default); -}); -enifed("ember-views/views/view", ["exports"], function (exports) { - "use strict"; -}); -/** -@module ember -@submodule ember-views -*/ + 'use strict'; -/** - `Ember.View` is the class in Ember responsible for encapsulating templates of - HTML content, combining templates with data to render as sections of a page's - DOM, and registering and responding to user-initiated events. + exports.isWatching = isWatching; + exports.watcherCount = watcherCount; + exports.unwatch = unwatch; + exports.destroy = destroy; + + /** + Starts watching a property on an object. Whenever the property changes, + invokes `Ember.propertyWillChange` and `Ember.propertyDidChange`. This is the + primitive used by observers and dependent keys; usually you will never call + this method directly but instead use higher level methods like + `Ember.addObserver()` + + @private + @method watch + @for Ember + @param obj + @param {String} _keyPath + */ + function watch(obj, _keyPath, m) { + if (!_emberMetalPath_cache.isPath(_keyPath)) { + _emberMetalWatch_key.watchKey(obj, _keyPath, m); + } else { + _emberMetalWatch_path.watchPath(obj, _keyPath, m); + } + } - ## HTML Tag + exports.watch = watch; - The default HTML tag name used for a view's DOM representation is `div`. This - can be customized by setting the `tagName` property. The following view - class: + function isWatching(obj, key) { + if (typeof obj !== 'object' || obj === null) { + return false; + } + var meta = _emberMetalMeta.peekMeta(obj); + return (meta && meta.peekWatching(key)) > 0; + } - ```javascript - ParagraphView = Ember.View.extend({ - tagName: 'em' - }); - ``` + function watcherCount(obj, key) { + var meta = _emberMetalMeta.peekMeta(obj); + return meta && meta.peekWatching(key) || 0; + } - Would result in instances with the following HTML: + function unwatch(obj, _keyPath, m) { + if (!_emberMetalPath_cache.isPath(_keyPath)) { + _emberMetalWatch_key.unwatchKey(obj, _keyPath, m); + } else { + _emberMetalWatch_path.unwatchPath(obj, _keyPath, m); + } + } - ```html - - ``` + /** + Tears down the meta on an object so that it can be garbage collected. + Multiple calls will have no effect. + + @method destroy + @for Ember + @param {Object} obj the object to destroy + @return {void} + @private + */ - ## HTML `class` Attribute + function destroy(obj) { + _emberMetalMeta.deleteMeta(obj); + } +}); +enifed('ember-metal/weak_map', ['exports', 'ember-utils', 'ember-metal/meta'], function (exports, _emberUtils, _emberMetalMeta) { + 'use strict'; - The HTML `class` attribute of a view's tag can be set by providing a - `classNames` property that is set to an array of strings: + exports.default = WeakMap; - ```javascript - MyView = Ember.View.extend({ - classNames: ['my-class', 'my-other-class'] - }); - ``` + var id = 0; - Will result in view instances with an HTML representation of: + // Returns whether Type(value) is Object according to the terminology in the spec + function isObject(value) { + return typeof value === 'object' && value !== null || typeof value === 'function'; + } - ```html -
    - ``` + /* + * @class Ember.WeakMap + * @public + * @category ember-metal-weakmap + * + * A partial polyfill for [WeakMap](http://www.ecma-international.org/ecma-262/6.0/#sec-weakmap-objects). + * + * There is a small but important caveat. This implementation assumes that the + * weak map will live longer (in the sense of garbage collection) than all of its + * keys, otherwise it is possible to leak the values stored in the weak map. In + * practice, most use cases satisfy this limitation which is why it is included + * in ember-metal. + */ - `class` attribute values can also be set by providing a `classNameBindings` - property set to an array of properties names for the view. The return value - of these properties will be added as part of the value for the view's `class` - attribute. These properties can be computed properties: + function WeakMap(iterable) { + if (!(this instanceof WeakMap)) { + throw new TypeError('Constructor WeakMap requires \'new\''); + } - ```javascript - MyView = Ember.View.extend({ - classNameBindings: ['propertyA', 'propertyB'], - propertyA: 'from-a', - propertyB: Ember.computed(function() { - if (someLogic) { return 'from-b'; } - }) - }); - ``` + this._id = _emberUtils.GUID_KEY + id++; - Will result in view instances with an HTML representation of: + if (iterable === null || iterable === undefined) { + return; + } else if (Array.isArray(iterable)) { + for (var i = 0; i < iterable.length; i++) { + var _iterable$i = iterable[i]; + var key = _iterable$i[0]; + var value = _iterable$i[1]; - ```html -
    - ``` + this.set(key, value); + } + } else { + throw new TypeError('The weak map constructor polyfill only supports an array argument'); + } + } - If the value of a class name binding returns a boolean the property name - itself will be used as the class name if the property is true. The class name - will not be added if the value is `false` or `undefined`. + /* + * @method get + * @param key {Object | Function} + * @return {Any} stored value + */ + WeakMap.prototype.get = function (obj) { + if (!isObject(obj)) { + return undefined; + } - ```javascript - MyView = Ember.View.extend({ - classNameBindings: ['hovered'], - hovered: true - }); - ``` + var meta = _emberMetalMeta.peekMeta(obj); + if (meta) { + var map = meta.readableWeak(); + if (map) { + if (map[this._id] === _emberMetalMeta.UNDEFINED) { + return undefined; + } - Will result in view instances with an HTML representation of: + return map[this._id]; + } + } + }; - ```html -
    - ``` + /* + * @method set + * @param key {Object | Function} + * @param value {Any} + * @return {WeakMap} the weak map + */ + WeakMap.prototype.set = function (obj, value) { + if (!isObject(obj)) { + throw new TypeError('Invalid value used as weak map key'); + } - When using boolean class name bindings you can supply a string value other - than the property name for use as the `class` HTML attribute by appending the - preferred value after a ":" character when defining the binding: + if (value === undefined) { + value = _emberMetalMeta.UNDEFINED; + } - ```javascript - MyView = Ember.View.extend({ - classNameBindings: ['awesome:so-very-cool'], - awesome: true - }); - ``` + _emberMetalMeta.meta(obj).writableWeak()[this._id] = value; - Will result in view instances with an HTML representation of: + return this; + }; - ```html -
    - ``` + /* + * @method has + * @param key {Object | Function} + * @return {boolean} if the key exists + */ + WeakMap.prototype.has = function (obj) { + if (!isObject(obj)) { + return false; + } - Boolean value class name bindings whose property names are in a - camelCase-style format will be converted to a dasherized format: + var meta = _emberMetalMeta.peekMeta(obj); + if (meta) { + var map = meta.readableWeak(); + if (map) { + return map[this._id] !== undefined; + } + } - ```javascript - MyView = Ember.View.extend({ - classNameBindings: ['isUrgent'], - isUrgent: true - }); - ``` + return false; + }; - Will result in view instances with an HTML representation of: + /* + * @method delete + * @param key {Object | Function} + * @return {boolean} if the key was deleted + */ + WeakMap.prototype.delete = function (obj) { + if (this.has(obj)) { + delete _emberMetalMeta.meta(obj).writableWeak()[this._id]; + return true; + } else { + return false; + } + }; - ```html -
    - ``` + /* + * @method toString + * @return {String} + */ + WeakMap.prototype.toString = function () { + return '[object WeakMap]'; + }; +}); +enifed('ember-routing/ext/controller', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/utils'], function (exports, _emberMetal, _emberRuntime, _emberRoutingUtils) { + 'use strict'; - Class name bindings can also refer to object values that are found by - traversing a path relative to the view itself: + /** + @module ember + @submodule ember-routing + */ - ```javascript - MyView = Ember.View.extend({ - classNameBindings: ['messages.empty'] - messages: Ember.Object.create({ - empty: true - }) - }); - ``` + _emberRuntime.ControllerMixin.reopen({ + concatenatedProperties: ['queryParams'], - Will result in view instances with an HTML representation of: + /** + Defines which query parameters the controller accepts. + If you give the names `['category','page']` it will bind + the values of these query parameters to the variables + `this.category` and `this.page` + @property queryParams + @public + */ + queryParams: null, - ```html -
    - ``` + /** + This property is updated to various different callback functions depending on + the current "state" of the backing route. It is used by + `Ember.Controller.prototype._qpChanged`. + The methods backing each state can be found in the `Ember.Route.prototype._qp` computed + property return value (the `.states` property). The current values are listed here for + the sanity of future travelers: + * `inactive` - This state is used when this controller instance is not part of the active + route heirarchy. Set in `Ember.Route.prototype._reset` (a `router.js` microlib hook) and + `Ember.Route.prototype.actions.finalizeQueryParamChange`. + * `active` - This state is used when this controller instance is part of the active + route heirarchy. Set in `Ember.Route.prototype.actions.finalizeQueryParamChange`. + * `allowOverrides` - This state is used in `Ember.Route.prototype.setup` (`route.js` microlib hook). + @method _qpDelegate + @private + */ + _qpDelegate: null, // set by route - If you want to add a class name for a property which evaluates to true and - and a different class name if it evaluates to false, you can pass a binding - like this: + /** + During `Ember.Route#setup` observers are created to invoke this method + when any of the query params declared in `Ember.Controller#queryParams` property + are changed. + When invoked this method uses the currently active query param update delegate + (see `Ember.Controller.prototype._qpDelegate` for details) and invokes it with + the QP key/value being changed. + @method _qpChanged + @private + */ + _qpChanged: function (controller, _prop) { + var prop = _prop.substr(0, _prop.length - 3); - ```javascript - // Applies 'enabled' class when isEnabled is true and 'disabled' when isEnabled is false - Ember.View.extend({ - classNameBindings: ['isEnabled:enabled:disabled'] - isEnabled: true - }); - ``` + var delegate = controller._qpDelegate; + var value = _emberMetal.get(controller, prop); + delegate(prop, value); + }, - Will result in view instances with an HTML representation of: + /** + Transition the application into another route. The route may + be either a single route or route path: + ```javascript + aController.transitionToRoute('blogPosts'); + aController.transitionToRoute('blogPosts.recentEntries'); + ``` + Optionally supply a model for the route in question. The model + will be serialized into the URL using the `serialize` hook of + the route: + ```javascript + aController.transitionToRoute('blogPost', aPost); + ``` + If a literal is passed (such as a number or a string), it will + be treated as an identifier instead. In this case, the `model` + hook of the route will be triggered: + ```javascript + aController.transitionToRoute('blogPost', 1); + ``` + Multiple models will be applied last to first recursively up the + route tree. + ```javascript + App.Router.map(function() { + this.route('blogPost', { path: ':blogPostId' }, function() { + this.route('blogComment', { path: ':blogCommentId', resetNamespace: true }); + }); + }); + aController.transitionToRoute('blogComment', aPost, aComment); + aController.transitionToRoute('blogComment', 1, 13); + ``` + It is also possible to pass a URL (a string that starts with a + `/`). This is intended for testing and debugging purposes and + should rarely be used in production code. + ```javascript + aController.transitionToRoute('/'); + aController.transitionToRoute('/blog/post/1/comment/13'); + aController.transitionToRoute('/blog/posts?sort=title'); + ``` + An options hash with a `queryParams` property may be provided as + the final argument to add query parameters to the destination URL. + ```javascript + aController.transitionToRoute('blogPost', 1, { + queryParams: { showComments: 'true' } + }); + // if you just want to transition the query parameters without changing the route + aController.transitionToRoute({ queryParams: { sort: 'date' } }); + ``` + See also [replaceRoute](/api/classes/Ember.ControllerMixin.html#method_replaceRoute). + @param {String} name the name of the route or a URL + @param {...Object} models the model(s) or identifier(s) to be used + while transitioning to the route. + @param {Object} [options] optional hash with a queryParams property + containing a mapping of query parameters + @for Ember.ControllerMixin + @method transitionToRoute + @public + */ + transitionToRoute: function () { + // target may be either another controller or a router + var target = _emberMetal.get(this, 'target'); + var method = target.transitionToRoute || target.transitionTo; - ```html -
    - ``` + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - When isEnabled is `false`, the resulting HTML representation looks like - this: + return method.apply(target, _emberRoutingUtils.prefixRouteNameArg(this, args)); + }, - ```html -
    - ``` + /** + Transition into another route while replacing the current URL, if possible. + This will replace the current history entry instead of adding a new one. + Beside that, it is identical to `transitionToRoute` in all other respects. + ```javascript + aController.replaceRoute('blogPosts'); + aController.replaceRoute('blogPosts.recentEntries'); + ``` + Optionally supply a model for the route in question. The model + will be serialized into the URL using the `serialize` hook of + the route: + ```javascript + aController.replaceRoute('blogPost', aPost); + ``` + If a literal is passed (such as a number or a string), it will + be treated as an identifier instead. In this case, the `model` + hook of the route will be triggered: + ```javascript + aController.replaceRoute('blogPost', 1); + ``` + Multiple models will be applied last to first recursively up the + route tree. + ```javascript + App.Router.map(function() { + this.route('blogPost', { path: ':blogPostId' }, function() { + this.route('blogComment', { path: ':blogCommentId', resetNamespace: true }); + }); + }); + aController.replaceRoute('blogComment', aPost, aComment); + aController.replaceRoute('blogComment', 1, 13); + ``` + It is also possible to pass a URL (a string that starts with a + `/`). This is intended for testing and debugging purposes and + should rarely be used in production code. + ```javascript + aController.replaceRoute('/'); + aController.replaceRoute('/blog/post/1/comment/13'); + ``` + @param {String} name the name of the route or a URL + @param {...Object} models the model(s) or identifier(s) to be used + while transitioning to the route. + @for Ember.ControllerMixin + @method replaceRoute + @public + */ + replaceRoute: function () { + // target may be either another controller or a router + var target = _emberMetal.get(this, 'target'); + var method = target.replaceRoute || target.replaceWith; - This syntax offers the convenience to add a class if a property is `false`: + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - ```javascript - // Applies no class when isEnabled is true and class 'disabled' when isEnabled is false - Ember.View.extend({ - classNameBindings: ['isEnabled::disabled'] - isEnabled: true + return method.apply(target, _emberRoutingUtils.prefixRouteNameArg(target, args)); + } }); - ``` - - Will result in view instances with an HTML representation of: - ```html -
    - ``` + exports.default = _emberRuntime.ControllerMixin; +}); +enifed('ember-routing/ext/run_loop', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - When the `isEnabled` property on the view is set to `false`, it will result - in view instances with an HTML representation of: + /** + @module ember + @submodule ember-views + */ - ```html -
    - ``` + // Add a new named queue after the 'actions' queue (where RSVP promises + // resolve), which is used in router transitions to prevent unnecessary + // loading state entry if all context promises resolve on the + // 'actions' queue first. + _emberMetal.run._addQueue('routerTransitions', 'actions'); +}); +enifed('ember-routing/index', ['exports', '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/system/query_params', 'ember-routing/services/routing', 'ember-routing/services/router', 'ember-routing/system/cache'], function (exports, _emberRoutingExtRun_loop, _emberRoutingExtController, _emberRoutingLocationApi, _emberRoutingLocationNone_location, _emberRoutingLocationHash_location, _emberRoutingLocationHistory_location, _emberRoutingLocationAuto_location, _emberRoutingSystemGenerate_controller, _emberRoutingSystemController_for, _emberRoutingSystemDsl, _emberRoutingSystemRouter, _emberRoutingSystemRoute, _emberRoutingSystemQuery_params, _emberRoutingServicesRouting, _emberRoutingServicesRouter, _emberRoutingSystemCache) { + /** + @module ember + @submodule ember-routing + */ - Updates to the value of a class name binding will result in automatic - update of the HTML `class` attribute in the view's rendered HTML - representation. If the value becomes `false` or `undefined` the class name - will be removed. + // ES6TODO: Cleanup modules with side-effects below + 'use strict'; - Both `classNames` and `classNameBindings` are concatenated properties. See - [Ember.Object](/api/classes/Ember.Object.html) documentation for more - information about concatenated properties. + exports.Location = _emberRoutingLocationApi.default; + exports.NoneLocation = _emberRoutingLocationNone_location.default; + exports.HashLocation = _emberRoutingLocationHash_location.default; + exports.HistoryLocation = _emberRoutingLocationHistory_location.default; + exports.AutoLocation = _emberRoutingLocationAuto_location.default; + exports.generateController = _emberRoutingSystemGenerate_controller.default; + exports.generateControllerFactory = _emberRoutingSystemGenerate_controller.generateControllerFactory; + exports.controllerFor = _emberRoutingSystemController_for.default; + exports.RouterDSL = _emberRoutingSystemDsl.default; + exports.Router = _emberRoutingSystemRouter.default; + exports.Route = _emberRoutingSystemRoute.default; + exports.QueryParams = _emberRoutingSystemQuery_params.default; + exports.RoutingService = _emberRoutingServicesRouting.default; + exports.RouterService = _emberRoutingServicesRouter.default; + exports.BucketCache = _emberRoutingSystemCache.default; +}); +enifed('ember-routing/location/api', ['exports', 'ember-metal', 'ember-environment', 'ember-routing/location/util'], function (exports, _emberMetal, _emberEnvironment, _emberRoutingLocationUtil) { + 'use strict'; - ## HTML Attributes + /** + @module ember + @submodule ember-routing + */ - The HTML attribute section of a view's tag can be set by providing an - `attributeBindings` property set to an array of property names on the view. - The return value of these properties will be used as the value of the view's - HTML associated attribute: + /** + Ember.Location returns an instance of the correct implementation of + the `location` API. + + ## Implementations + + You can pass an implementation name (`hash`, `history`, `none`) to force a + particular implementation to be used in your application. + + ### HashLocation + + Using `HashLocation` results in URLs with a `#` (hash sign) separating the + server side URL portion of the URL from the portion that is used by Ember. + This relies upon the `hashchange` event existing in the browser. + + Example: + + ```javascript + App.Router.map(function() { + this.route('posts', function() { + this.route('new'); + }); + }); + + App.Router.reopen({ + location: 'hash' + }); + ``` + + This will result in a posts.new url of `/#/posts/new`. + + ### HistoryLocation + + Using `HistoryLocation` results in URLs that are indistinguishable from a + standard URL. This relies upon the browser's `history` API. + + Example: + + ```javascript + App.Router.map(function() { + this.route('posts', function() { + this.route('new'); + }); + }); + + App.Router.reopen({ + location: 'history' + }); + ``` + + This will result in a posts.new url of `/posts/new`. + + Keep in mind that your server must serve the Ember app at all the routes you + define. + + ### AutoLocation + + Using `AutoLocation`, the router will use the best Location class supported by + the browser it is running in. + + Browsers that support the `history` API will use `HistoryLocation`, those that + do not, but still support the `hashchange` event will use `HashLocation`, and + in the rare case neither is supported will use `NoneLocation`. + + Example: + + ```javascript + App.Router.map(function() { + this.route('posts', function() { + this.route('new'); + }); + }); + + App.Router.reopen({ + location: 'auto' + }); + ``` + + This will result in a posts.new url of `/posts/new` for modern browsers that + support the `history` api or `/#/posts/new` for older ones, like Internet + Explorer 9 and below. + + When a user visits a link to your application, they will be automatically + upgraded or downgraded to the appropriate `Location` class, with the URL + transformed accordingly, if needed. + + Keep in mind that since some of your users will use `HistoryLocation`, your + server must serve the Ember app at all the routes you define. + + ### NoneLocation + + Using `NoneLocation` causes Ember to not store the applications URL state + in the actual URL. This is generally used for testing purposes, and is one + of the changes made when calling `App.setupForTesting()`. + + ## Location API + + Each location implementation must provide the following methods: + + * implementation: returns the string name used to reference the implementation. + * getURL: returns the current URL. + * setURL(path): sets the current URL. + * replaceURL(path): replace the current URL (optional). + * onUpdateURL(callback): triggers the callback when the URL changes. + * formatURL(url): formats `url` to be placed into `href` attribute. + * detect() (optional): instructs the location to do any feature detection + necessary. If the location needs to redirect to a different URL, it + can cancel routing by setting the `cancelRouterSetup` property on itself + to `false`. + + Calling setURL or replaceURL will not trigger onUpdateURL callbacks. + + ## Custom implementation + + Ember scans `app/locations/*` for extending the Location API. + + Example: + + ```javascript + import Ember from 'ember'; + + export default Ember.HistoryLocation.extend({ + implementation: 'history-url-logging', + + pushState: function (path) { + console.log(path); + this._super.apply(this, arguments); + } + }); + ``` + + @class Location + @namespace Ember + @static + @private + */ + exports.default = { + /** + This is deprecated in favor of using the container to lookup the location + implementation as desired. + For example: + ```javascript + // Given a location registered as follows: + container.register('location:history-test', HistoryTestLocation); + // You could create a new instance via: + container.lookup('location:history-test'); + ``` + @method create + @param {Object} options + @return {Object} an instance of an implementation of the `location` API + @deprecated Use the container to lookup the location implementation that you + need. + @private + */ + create: function (options) { + var implementation = options && options.implementation; + _emberMetal.assert('Ember.Location.create: you must specify a \'implementation\' option', !!implementation); - ```javascript - AnchorView = Ember.View.extend({ - tagName: 'a', - attributeBindings: ['href'], - href: 'http://google.com' - }); - ``` + var implementationClass = this.implementations[implementation]; + _emberMetal.assert('Ember.Location.create: ' + implementation + ' is not a valid implementation', !!implementationClass); - Will result in view instances with an HTML representation of: + return implementationClass.create.apply(implementationClass, arguments); + }, - ```html - - ``` + implementations: {}, + _location: _emberEnvironment.environment.location, - One property can be mapped on to another by placing a ":" between - the source property and the destination property: + /** + Returns the current `location.hash` by parsing location.href since browsers + inconsistently URL-decode `location.hash`. + https://bugzilla.mozilla.org/show_bug.cgi?id=483304 + @private + @method getHash + @since 1.4.0 + */ + _getHash: function () { + return _emberRoutingLocationUtil.getHash(this.location); + } + }; +}); +enifed('ember-routing/location/auto_location', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-environment', 'ember-routing/location/util'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberEnvironment, _emberRoutingLocationUtil) { + 'use strict'; - ```javascript - AnchorView = Ember.View.extend({ - tagName: 'a', - attributeBindings: ['url:href'], - url: 'http://google.com' - }); - ``` + exports.getHistoryPath = getHistoryPath; + exports.getHashPath = getHashPath; - Will result in view instances with an HTML representation of: + /** + @module ember + @submodule ember-routing + */ - ```html - - ``` + /** + Ember.AutoLocation will select the best location option based off browser + support with the priority order: history, hash, none. + + Clean pushState paths accessed by hashchange-only browsers will be redirected + to the hash-equivalent and vice versa so future transitions are consistent. + + Keep in mind that since some of your users will use `HistoryLocation`, your + server must serve the Ember app at all the routes you define. + + @class AutoLocation + @namespace Ember + @static + @private + */ + exports.default = _emberRuntime.Object.extend({ + /** + @private + The browser's `location` object. This is typically equivalent to + `window.location`, but may be overridden for testing. + @property location + @default environment.location + */ + location: _emberEnvironment.environment.location, - Namespaced attributes (e.g. `xlink:href`) are supported, but have to be - mapped, since `:` is not a valid character for properties in Javascript: + /** + @private + The browser's `history` object. This is typically equivalent to + `window.history`, but may be overridden for testing. + @since 1.5.1 + @property history + @default environment.history + */ + history: _emberEnvironment.environment.history, - ```javascript - UseView = Ember.View.extend({ - tagName: 'use', - attributeBindings: ['xlinkHref:xlink:href'], - xlinkHref: '#triangle' - }); - ``` - Will result in view instances with an HTML representation of: + /** + @private + The user agent's global variable. In browsers, this will be `window`. + @since 1.11 + @property global + @default window + */ + global: _emberEnvironment.environment.window, - ```html - - ``` + /** + @private + The browser's `userAgent`. This is typically equivalent to + `navigator.userAgent`, but may be overridden for testing. + @since 1.5.1 + @property userAgent + @default environment.history + */ + userAgent: _emberEnvironment.environment.userAgent, - If the return value of an `attributeBindings` monitored property is a boolean - the attribute will be present or absent depending on the value: + /** + @private + This property is used by the router to know whether to cancel the routing + setup process, which is needed while we redirect the browser. + @since 1.5.1 + @property cancelRouterSetup + @default false + */ + cancelRouterSetup: false, - ```javascript - MyTextInput = Ember.View.extend({ - tagName: 'input', - attributeBindings: ['disabled'], - disabled: false - }); - ``` + /** + @private + Will be pre-pended to path upon state change. + @since 1.5.1 + @property rootURL + @default '/' + */ + rootURL: '/', - Will result in a view instance with an HTML representation of: + /** + Called by the router to instruct the location to do any feature detection + necessary. In the case of AutoLocation, we detect whether to use history + or hash concrete implementations. + @private + */ + detect: function () { + var rootURL = this.rootURL; - ```html - - ``` + _emberMetal.assert('rootURL must end with a trailing forward slash e.g. "/app/"', rootURL.charAt(rootURL.length - 1) === '/'); - `attributeBindings` can refer to computed properties: + var implementation = detectImplementation({ + location: this.location, + history: this.history, + userAgent: this.userAgent, + rootURL: rootURL, + documentMode: this.documentMode, + global: this.global + }); - ```javascript - MyTextInput = Ember.View.extend({ - tagName: 'input', - attributeBindings: ['disabled'], - disabled: Ember.computed(function() { - if (someLogic) { - return true; - } else { - return false; + if (implementation === false) { + _emberMetal.set(this, 'cancelRouterSetup', true); + implementation = 'none'; } - }) - }); - ``` - - To prevent setting an attribute altogether, use `null` or `undefined` as the - return value of the `attributeBindings` monitored property: - - ```javascript - MyTextInput = Ember.View.extend({ - tagName: 'form', - attributeBindings: ['novalidate'], - novalidate: null - }); - ``` - - Updates to the property of an attribute binding will result in automatic - update of the HTML attribute in the view's rendered HTML representation. - - `attributeBindings` is a concatenated property. See [Ember.Object](/api/classes/Ember.Object.html) - documentation for more information about concatenated properties. - ## Layouts + var concrete = _emberUtils.getOwner(this).lookup('location:' + implementation); + _emberMetal.set(concrete, 'rootURL', rootURL); - Views can have a secondary template that wraps their main template. Like - primary templates, layouts can be any function that accepts an optional - context parameter and returns a string of HTML that will be inserted inside - view's tag. Views whose HTML element is self closing (e.g. ``) - cannot have a layout and this property will be ignored. + _emberMetal.assert('Could not find location \'' + implementation + '\'.', !!concrete); - Most typically in Ember a layout will be a compiled template. + _emberMetal.set(this, 'concreteImplementation', concrete); + }, - A view's layout can be set directly with the `layout` property or reference - an existing template by name with the `layoutName` property. + initState: delegateToConcreteImplementation('initState'), + getURL: delegateToConcreteImplementation('getURL'), + setURL: delegateToConcreteImplementation('setURL'), + replaceURL: delegateToConcreteImplementation('replaceURL'), + onUpdateURL: delegateToConcreteImplementation('onUpdateURL'), + formatURL: delegateToConcreteImplementation('formatURL'), - A template used as a layout must contain a single use of the - `{{yield}}` helper. The HTML contents of a view's rendered `template` will be - inserted at this location: + willDestroy: function () { + var concreteImplementation = _emberMetal.get(this, 'concreteImplementation'); - ```javascript - AViewWithLayout = Ember.View.extend({ - layout: Ember.HTMLBars.compile("
    {{yield}}
    "), - template: Ember.HTMLBars.compile("I got wrapped") + if (concreteImplementation) { + concreteImplementation.destroy(); + } + } }); - ``` - - Will result in view instances with an HTML representation of: - ```html -
    -
    - I got wrapped -
    -
    - ``` - - See [Ember.Templates.helpers.yield](/api/classes/Ember.Templates.helpers.html#method_yield) - for more information. - - ## Responding to Browser Events - - Views can respond to user-initiated events in one of three ways: method - implementation, through an event manager, and through `{{action}}` helper use - in their template or layout. - - ### Method Implementation + function delegateToConcreteImplementation(methodName) { + return function () { + var concreteImplementation = _emberMetal.get(this, 'concreteImplementation'); + _emberMetal.assert('AutoLocation\'s detect() method should be called before calling any other hooks.', !!concreteImplementation); - Views can respond to user-initiated events by implementing a method that - matches the event name. A `jQuery.Event` object will be passed as the - argument to this method. + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - ```javascript - AView = Ember.View.extend({ - click: function(event) { - // will be called when an instance's - // rendered element is clicked - } - }); - ``` + return _emberUtils.tryInvoke(concreteImplementation, methodName, args); + }; + } - ### Event Managers + /* + Given the browser's `location`, `history` and `userAgent`, and a configured + root URL, this function detects whether the browser supports the [History + API](https://developer.mozilla.org/en-US/docs/Web/API/History) and returns a + string representing the Location object to use based on its determination. + + For example, if the page loads in an evergreen browser, this function would + return the string "history", meaning the history API and thus HistoryLocation + should be used. If the page is loaded in IE8, it will return the string + "hash," indicating that the History API should be simulated by manipulating the + hash portion of the location. + + */ - Views can define an object as their `eventManager` property. This object can - then implement methods that match the desired event names. Matching events - that occur on the view's rendered HTML or the rendered HTML of any of its DOM - descendants will trigger this method. A `jQuery.Event` object will be passed - as the first argument to the method and an `Ember.View` object as the - second. The `Ember.View` will be the view whose rendered HTML was interacted - with. This may be the view with the `eventManager` property or one of its - descendant views. + function detectImplementation(options) { + var location = options.location; + var userAgent = options.userAgent; + var history = options.history; + var documentMode = options.documentMode; + var global = options.global; + var rootURL = options.rootURL; - ```javascript - AView = Ember.View.extend({ - eventManager: Ember.Object.create({ - doubleClick: function(event, view) { - // will be called when an instance's - // rendered element or any rendering - // of this view's descendant - // elements is clicked - } - }) - }); - ``` + var implementation = 'none'; + var cancelRouterSetup = false; + var currentPath = _emberRoutingLocationUtil.getFullPath(location); - An event defined for an event manager takes precedence over events of the - same name handled through methods on the view. + if (_emberRoutingLocationUtil.supportsHistory(userAgent, history)) { + var historyPath = getHistoryPath(rootURL, location); - ```javascript - AView = Ember.View.extend({ - mouseEnter: function(event) { - // will never trigger. - }, - eventManager: Ember.Object.create({ - mouseEnter: function(event, view) { - // takes precedence over AView#mouseEnter + // If the browser supports history and we have a history path, we can use + // the history location with no redirects. + if (currentPath === historyPath) { + return 'history'; + } else { + if (currentPath.substr(0, 2) === '/#') { + history.replaceState({ path: historyPath }, null, historyPath); + implementation = 'history'; + } else { + cancelRouterSetup = true; + _emberRoutingLocationUtil.replacePath(location, historyPath); + } } - }) - }); - ``` - - Similarly a view's event manager will take precedence for events of any views - rendered as a descendant. A method name that matches an event name will not - be called if the view instance was rendered inside the HTML representation of - a view that has an `eventManager` property defined that handles events of the - name. Events not handled by the event manager will still trigger method calls - on the descendant. + } else if (_emberRoutingLocationUtil.supportsHashChange(documentMode, global)) { + var hashPath = getHashPath(rootURL, location); - ```javascript - var App = Ember.Application.create(); - App.OuterView = Ember.View.extend({ - template: Ember.HTMLBars.compile("outer {{#view 'inner'}}inner{{/view}} outer"), - eventManager: Ember.Object.create({ - mouseEnter: function(event, view) { - // view might be instance of either - // OuterView or InnerView depending on - // where on the page the user interaction occurred + // Be sure we're using a hashed path, otherwise let's switch over it to so + // we start off clean and consistent. We'll count an index path with no + // hash as "good enough" as well. + if (currentPath === hashPath || currentPath === '/' && hashPath === '/#/') { + implementation = 'hash'; + } else { + // Our URL isn't in the expected hash-supported format, so we want to + // cancel the router setup and replace the URL to start off clean + cancelRouterSetup = true; + _emberRoutingLocationUtil.replacePath(location, hashPath); } - }) - }); - - App.InnerView = Ember.View.extend({ - click: function(event) { - // will be called if rendered inside - // an OuterView because OuterView's - // eventManager doesn't handle click events - }, - mouseEnter: function(event) { - // will never be called if rendered inside - // an OuterView. } - }); - ``` - - ### `{{action}}` Helper - - See [Ember.Templates.helpers.action](/api/classes/Ember.Templates.helpers.html#method_action). - - ### Event Names - - All of the event handling approaches described above respond to the same set - of events. The names of the built-in events are listed below. (The hash of - built-in events exists in `Ember.EventDispatcher`.) Additional, custom events - can be registered by using `Ember.Application.customEvents`. - - Touch events: - - * `touchStart` - * `touchMove` - * `touchEnd` - * `touchCancel` - - Keyboard events - - * `keyDown` - * `keyUp` - * `keyPress` - - Mouse events - - * `mouseDown` - * `mouseUp` - * `contextMenu` - * `click` - * `doubleClick` - * `mouseMove` - * `focusIn` - * `focusOut` - * `mouseEnter` - * `mouseLeave` - - Form events: - - * `submit` - * `change` - * `focusIn` - * `focusOut` - * `input` - - HTML5 drag and drop events: - - * `dragStart` - * `drag` - * `dragEnter` - * `dragLeave` - * `dragOver` - * `dragEnd` - * `drop` - - @class View - @namespace Ember - @extends Ember.CoreView - @deprecated See http://emberjs.com/deprecations/v1.x/#toc_ember-view - @uses Ember.ViewSupport - @uses Ember.ChildViewsSupport - @uses Ember.ClassNamesSupport - @uses Ember.AttributeBindingsSupport - @private -*/ -enifed("ember/features", ["exports"], function (exports) { - "use strict"; - - exports.default = { "features-stripped-test": false, "ember-libraries-isregistered": false, "ember-runtime-computed-uniq-by": true, "ember-improved-instrumentation": false, "ember-runtime-enumerable-includes": true, "ember-string-ishtmlsafe": true, "ember-testing-check-waiters": true, "ember-metal-weakmap": false, "ember-glimmer-allow-backtracking-rerender": true, "ember-testing-resume-test": false, "ember-glimmer-detect-backtracking-rerender": true, "mandatory-setter": true }; -}); -enifed('ember/index', ['exports', 'require', 'ember-environment', 'ember-utils', 'container', 'ember-metal', 'backburner', 'ember-console', 'ember-runtime', 'ember-glimmer', 'ember/version', 'ember-views', 'ember-routing', 'ember-application', 'ember-extension-support'], function (exports, _require, _emberEnvironment, _emberUtils, _container, _emberMetal, _backburner, _emberConsole, _emberRuntime, _emberGlimmer, _emberVersion, _emberViews, _emberRouting, _emberApplication, _emberExtensionSupport) { - 'use strict'; - - // ember-utils exports - _emberMetal.default.getOwner = _emberUtils.getOwner; - _emberMetal.default.setOwner = _emberUtils.setOwner; - _emberMetal.default.generateGuid = _emberUtils.generateGuid; - _emberMetal.default.GUID_KEY = _emberUtils.GUID_KEY; - _emberMetal.default.guidFor = _emberUtils.guidFor; - _emberMetal.default.inspect = _emberUtils.inspect; - _emberMetal.default.makeArray = _emberUtils.makeArray; - _emberMetal.default.canInvoke = _emberUtils.canInvoke; - _emberMetal.default.tryInvoke = _emberUtils.tryInvoke; - _emberMetal.default.wrap = _emberUtils.wrap; - _emberMetal.default.applyStr = _emberUtils.applyStr; - _emberMetal.default.uuid = _emberUtils.uuid; - _emberMetal.default.assign = Object.assign || _emberUtils.assign; - - // container exports - _emberMetal.default.Container = _container.Container; - _emberMetal.default.Registry = _container.Registry; - - // need to import this directly, to ensure the babel feature - // flag plugin works properly - - var computed = _emberMetal.computed; - computed.alias = _emberMetal.alias; - _emberMetal.default.computed = computed; - _emberMetal.default.ComputedProperty = _emberMetal.ComputedProperty; - _emberMetal.default.cacheFor = _emberMetal.cacheFor; - - _emberMetal.default.assert = _emberMetal.assert; - _emberMetal.default.warn = _emberMetal.warn; - _emberMetal.default.debug = _emberMetal.debug; - _emberMetal.default.deprecate = _emberMetal.deprecate; - _emberMetal.default.deprecateFunc = _emberMetal.deprecateFunc; - _emberMetal.default.runInDebug = _emberMetal.runInDebug; - _emberMetal.default.merge = _emberMetal.merge; - - _emberMetal.default.instrument = _emberMetal.instrument; - _emberMetal.default.subscribe = _emberMetal.instrumentationSubscribe; - _emberMetal.default.Instrumentation = { - instrument: _emberMetal.instrument, - subscribe: _emberMetal.instrumentationSubscribe, - unsubscribe: _emberMetal.instrumentationUnsubscribe, - reset: _emberMetal.instrumentationReset - }; - _emberMetal.default.Error = _emberMetal.Error; - _emberMetal.default.META_DESC = _emberMetal.META_DESC; - _emberMetal.default.meta = _emberMetal.meta; - _emberMetal.default.get = _emberMetal.get; - _emberMetal.default.getWithDefault = _emberMetal.getWithDefault; - _emberMetal.default._getPath = _emberMetal._getPath; - _emberMetal.default.set = _emberMetal.set; - _emberMetal.default.trySet = _emberMetal.trySet; - _emberMetal.default.FEATURES = _emberMetal.FEATURES; - _emberMetal.default.FEATURES.isEnabled = _emberMetal.isFeatureEnabled; - _emberMetal.default._Cache = _emberMetal.Cache; - _emberMetal.default.on = _emberMetal.on; - _emberMetal.default.addListener = _emberMetal.addListener; - _emberMetal.default.removeListener = _emberMetal.removeListener; - _emberMetal.default._suspendListener = _emberMetal.suspendListener; - _emberMetal.default._suspendListeners = _emberMetal.suspendListeners; - _emberMetal.default.sendEvent = _emberMetal.sendEvent; - _emberMetal.default.hasListeners = _emberMetal.hasListeners; - _emberMetal.default.watchedEvents = _emberMetal.watchedEvents; - _emberMetal.default.listenersFor = _emberMetal.listenersFor; - _emberMetal.default.accumulateListeners = _emberMetal.accumulateListeners; - _emberMetal.default.isNone = _emberMetal.isNone; - _emberMetal.default.isEmpty = _emberMetal.isEmpty; - _emberMetal.default.isBlank = _emberMetal.isBlank; - _emberMetal.default.isPresent = _emberMetal.isPresent; - _emberMetal.default.run = _emberMetal.run; - _emberMetal.default._ObserverSet = _emberMetal.ObserverSet; - _emberMetal.default.propertyWillChange = _emberMetal.propertyWillChange; - _emberMetal.default.propertyDidChange = _emberMetal.propertyDidChange; - _emberMetal.default.overrideChains = _emberMetal.overrideChains; - _emberMetal.default.beginPropertyChanges = _emberMetal.beginPropertyChanges; - _emberMetal.default.endPropertyChanges = _emberMetal.endPropertyChanges; - _emberMetal.default.changeProperties = _emberMetal.changeProperties; - _emberMetal.default.platform = { - defineProperty: true, - hasPropertyAccessors: true - }; - _emberMetal.default.defineProperty = _emberMetal.defineProperty; - _emberMetal.default.watchKey = _emberMetal.watchKey; - _emberMetal.default.unwatchKey = _emberMetal.unwatchKey; - _emberMetal.default.removeChainWatcher = _emberMetal.removeChainWatcher; - _emberMetal.default._ChainNode = _emberMetal.ChainNode; - _emberMetal.default.finishChains = _emberMetal.finishChains; - _emberMetal.default.watchPath = _emberMetal.watchPath; - _emberMetal.default.unwatchPath = _emberMetal.unwatchPath; - _emberMetal.default.watch = _emberMetal.watch; - _emberMetal.default.isWatching = _emberMetal.isWatching; - _emberMetal.default.unwatch = _emberMetal.unwatch; - _emberMetal.default.destroy = _emberMetal.destroy; - _emberMetal.default.libraries = _emberMetal.libraries; - _emberMetal.default.OrderedSet = _emberMetal.OrderedSet; - _emberMetal.default.Map = _emberMetal.Map; - _emberMetal.default.MapWithDefault = _emberMetal.MapWithDefault; - _emberMetal.default.getProperties = _emberMetal.getProperties; - _emberMetal.default.setProperties = _emberMetal.setProperties; - _emberMetal.default.expandProperties = _emberMetal.expandProperties; - _emberMetal.default.NAME_KEY = _emberMetal.NAME_KEY; - _emberMetal.default.addObserver = _emberMetal.addObserver; - _emberMetal.default.observersFor = _emberMetal.observersFor; - _emberMetal.default.removeObserver = _emberMetal.removeObserver; - _emberMetal.default._suspendObserver = _emberMetal._suspendObserver; - _emberMetal.default._suspendObservers = _emberMetal._suspendObservers; - _emberMetal.default.required = _emberMetal.required; - _emberMetal.default.aliasMethod = _emberMetal.aliasMethod; - _emberMetal.default.observer = _emberMetal.observer; - _emberMetal.default.immediateObserver = _emberMetal._immediateObserver; - _emberMetal.default.mixin = _emberMetal.mixin; - _emberMetal.default.Mixin = _emberMetal.Mixin; - _emberMetal.default.bind = _emberMetal.bind; - _emberMetal.default.Binding = _emberMetal.Binding; - _emberMetal.default.isGlobalPath = _emberMetal.isGlobalPath; + if (cancelRouterSetup) { + return false; + } - if (false) { - _emberMetal.default.WeakMap = _emberMetal.WeakMap; + return implementation; } - Object.defineProperty(_emberMetal.default, 'ENV', { - get: function () { - return _emberEnvironment.ENV; - }, - enumerable: false - }); - /** - The context that Ember searches for namespace instances on. + @private - @private - */ - Object.defineProperty(_emberMetal.default, 'lookup', { - get: function () { - return _emberEnvironment.context.lookup; - }, - set: function (value) { - _emberEnvironment.context.lookup = value; - }, - enumerable: false - }); + Returns the current path as it should appear for HistoryLocation supported + browsers. This may very well differ from the real current path (e.g. if it + starts off as a hashed URL) + */ - _emberMetal.default.EXTEND_PROTOTYPES = _emberEnvironment.ENV.EXTEND_PROTOTYPES; + function getHistoryPath(rootURL, location) { + var path = _emberRoutingLocationUtil.getPath(location); + var hash = _emberRoutingLocationUtil.getHash(location); + var query = _emberRoutingLocationUtil.getQuery(location); + var rootURLIndex = path.indexOf(rootURL); + var routeHash = undefined, + hashParts = undefined; - // BACKWARDS COMPAT ACCESSORS FOR ENV FLAGS - Object.defineProperty(_emberMetal.default, 'LOG_STACKTRACE_ON_DEPRECATION', { - get: function () { - return _emberEnvironment.ENV.LOG_STACKTRACE_ON_DEPRECATION; - }, - set: function (value) { - _emberEnvironment.ENV.LOG_STACKTRACE_ON_DEPRECATION = !!value; - }, - enumerable: false - }); + _emberMetal.assert('Path ' + path + ' does not start with the provided rootURL ' + rootURL, rootURLIndex === 0); - Object.defineProperty(_emberMetal.default, 'LOG_VERSION', { - get: function () { - return _emberEnvironment.ENV.LOG_VERSION; - }, - set: function (value) { - _emberEnvironment.ENV.LOG_VERSION = !!value; - }, - enumerable: false - }); + // By convention, Ember.js routes using HashLocation are required to start + // with `#/`. Anything else should NOT be considered a route and should + // be passed straight through, without transformation. + if (hash.substr(0, 2) === '#/') { + // There could be extra hash segments after the route + hashParts = hash.substr(1).split('#'); + // The first one is always the route url + routeHash = hashParts.shift(); - Object.defineProperty(_emberMetal.default, 'MODEL_FACTORY_INJECTIONS', { - get: function () { - return _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS; - }, - set: function (value) { - _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS = !!value; - }, - enumerable: false - }); + // If the path already has a trailing slash, remove the one + // from the hashed route so we don't double up. + if (path.charAt(path.length - 1) === '/') { + routeHash = routeHash.substr(1); + } + + // This is the "expected" final order + path += routeHash + query; + + if (hashParts.length) { + path += '#' + hashParts.join('#'); + } + } else { + path += query + hash; + } - Object.defineProperty(_emberMetal.default, 'LOG_BINDINGS', { - get: function () { - return _emberEnvironment.ENV.LOG_BINDINGS; - }, - set: function (value) { - _emberEnvironment.ENV.LOG_BINDINGS = !!value; - }, - enumerable: false - }); + return path; + } /** - A function may be assigned to `Ember.onerror` to be called when Ember - internals encounter an error. This is useful for specialized error handling - and reporting code. - - ```javascript - Ember.onerror = function(error) { - Em.$.ajax('/report-error', 'POST', { - stack: error.stack, - otherInformation: 'whatever app state you want to provide' - }); - }; - ``` + @private - Internally, `Ember.onerror` is used as Backburner's error handler. + Returns the current path as it should appear for HashLocation supported + browsers. This may very well differ from the real current path. - @event onerror - @for Ember - @param {Exception} error the error object - @public + @method _getHashPath */ - Object.defineProperty(_emberMetal.default, 'onerror', { - get: _emberMetal.getOnerror, - set: _emberMetal.setOnerror, - enumerable: false - }); + + function getHashPath(rootURL, location) { + var path = rootURL; + var historyPath = getHistoryPath(rootURL, location); + var routePath = historyPath.substr(rootURL.length); + + if (routePath !== '') { + if (routePath[0] !== '/') { + routePath = '/' + routePath; + } + + path += '#' + routePath; + } + + return path; + } +}); +enifed('ember-routing/location/hash_location', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/location/api'], function (exports, _emberMetal, _emberRuntime, _emberRoutingLocationApi) { + 'use strict'; /** - An empty function useful for some operations. Always returns `this`. + @module ember + @submodule ember-routing + */ + + /** + `Ember.HashLocation` implements the location API using the browser's + hash. At present, it relies on a `hashchange` event existing in the + browser. - @method K - @return {Object} - @public + @class HashLocation + @namespace Ember + @extends Ember.Object + @private */ - _emberMetal.default.K = function K() { - return this; - }; + exports.default = _emberRuntime.Object.extend({ + implementation: 'hash', - Object.defineProperty(_emberMetal.default, 'testing', { - get: _emberMetal.isTesting, - set: _emberMetal.setTesting, - enumerable: false - }); + init: function () { + _emberMetal.set(this, 'location', _emberMetal.get(this, '_location') || window.location); - if (!_require.has('ember-debug')) { - _emberMetal.default.Debug = { - registerDeprecationHandler: function () {}, - registerWarnHandler: function () {} - }; - } + this._hashchangeHandler = undefined; + }, - /** - @class Backburner - @for Ember - @private - */ - _emberMetal.default.Backburner = function () { - _emberMetal.deprecate('Usage of Ember.Backburner is deprecated.', false, { - id: 'ember-metal.ember-backburner', - until: '2.8.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-backburner' - }); + /** + @private + Returns normalized location.hash + @since 1.5.1 + @method getHash + */ + getHash: _emberRoutingLocationApi.default._getHash, - function BackburnerAlias(args) { - return _backburner.default.apply(this, args); - } + /** + Returns the normalized URL, constructed from `location.hash`. + e.g. `#/foo` => `/foo` as well as `#/foo#bar` => `/foo#bar`. + By convention, hashed paths must begin with a forward slash, otherwise they + are not treated as a path so we can distinguish intent. + @private + @method getURL + */ + getURL: function () { + var originalPath = this.getHash().substr(1); + var outPath = originalPath; - BackburnerAlias.prototype = _backburner.default.prototype; + if (outPath[0] !== '/') { + outPath = '/'; - return new BackburnerAlias(arguments); - }; + // Only add the # if the path isn't empty. + // We do NOT want `/#` since the ampersand + // is only included (conventionally) when + // the location.hash has a value + if (originalPath) { + outPath += '#' + originalPath; + } + } - _emberMetal.default._Backburner = _backburner.default; + return outPath; + }, - _emberMetal.default.Logger = _emberConsole.default; + /** + Set the `location.hash` and remembers what was set. This prevents + `onUpdateURL` callbacks from triggering when the hash was set by + `HashLocation`. + @private + @method setURL + @param path {String} + */ + setURL: function (path) { + _emberMetal.get(this, 'location').hash = path; + _emberMetal.set(this, 'lastSetURL', path); + }, - // ****ember-runtime**** + /** + Uses location.replace to update the url without a page reload + or history modification. + @private + @method replaceURL + @param path {String} + */ + replaceURL: function (path) { + _emberMetal.get(this, 'location').replace('#' + path); + _emberMetal.set(this, 'lastSetURL', path); + }, - _emberMetal.default.String = _emberRuntime.String; - _emberMetal.default.Object = _emberRuntime.Object; - _emberMetal.default._RegistryProxyMixin = _emberRuntime.RegistryProxyMixin; - _emberMetal.default._ContainerProxyMixin = _emberRuntime.ContainerProxyMixin; - _emberMetal.default.compare = _emberRuntime.compare; - _emberMetal.default.copy = _emberRuntime.copy; - _emberMetal.default.isEqual = _emberRuntime.isEqual; - _emberMetal.default.inject = _emberRuntime.inject; - _emberMetal.default.Array = _emberRuntime.Array; - _emberMetal.default.Comparable = _emberRuntime.Comparable; - _emberMetal.default.Enumerable = _emberRuntime.Enumerable; - _emberMetal.default.ArrayProxy = _emberRuntime.ArrayProxy; - _emberMetal.default.ObjectProxy = _emberRuntime.ObjectProxy; - _emberMetal.default.ActionHandler = _emberRuntime.ActionHandler; - _emberMetal.default.CoreObject = _emberRuntime.CoreObject; - _emberMetal.default.NativeArray = _emberRuntime.NativeArray; - _emberMetal.default.Copyable = _emberRuntime.Copyable; - _emberMetal.default.Freezable = _emberRuntime.Freezable; - _emberMetal.default.FROZEN_ERROR = _emberRuntime.FROZEN_ERROR; - _emberMetal.default.MutableEnumerable = _emberRuntime.MutableEnumerable; - _emberMetal.default.MutableArray = _emberRuntime.MutableArray; - _emberMetal.default.TargetActionSupport = _emberRuntime.TargetActionSupport; - _emberMetal.default.Evented = _emberRuntime.Evented; - _emberMetal.default.PromiseProxyMixin = _emberRuntime.PromiseProxyMixin; - _emberMetal.default.Observable = _emberRuntime.Observable; - _emberMetal.default.typeOf = _emberRuntime.typeOf; - _emberMetal.default.isArray = _emberRuntime.isArray; - _emberMetal.default.Object = _emberRuntime.Object; - _emberMetal.default.onLoad = _emberRuntime.onLoad; - _emberMetal.default.runLoadHooks = _emberRuntime.runLoadHooks; - _emberMetal.default.Controller = _emberRuntime.Controller; - _emberMetal.default.ControllerMixin = _emberRuntime.ControllerMixin; - _emberMetal.default.Service = _emberRuntime.Service; - _emberMetal.default._ProxyMixin = _emberRuntime._ProxyMixin; - _emberMetal.default.RSVP = _emberRuntime.RSVP; - _emberMetal.default.Namespace = _emberRuntime.Namespace; + /** + Register a callback to be invoked when the hash changes. These + callbacks will execute when the user presses the back or forward + button, but not after `setURL` is invoked. + @private + @method onUpdateURL + @param callback {Function} + */ + onUpdateURL: function (callback) { + var _this = this; - // ES6TODO: this seems a less than ideal way/place to add properties to Ember.computed - computed.empty = _emberRuntime.empty; - computed.notEmpty = _emberRuntime.notEmpty; - computed.none = _emberRuntime.none; - computed.not = _emberRuntime.not; - computed.bool = _emberRuntime.bool; - computed.match = _emberRuntime.match; - computed.equal = _emberRuntime.equal; - computed.gt = _emberRuntime.gt; - computed.gte = _emberRuntime.gte; - computed.lt = _emberRuntime.lt; - computed.lte = _emberRuntime.lte; - computed.oneWay = _emberRuntime.oneWay; - computed.reads = _emberRuntime.oneWay; - computed.readOnly = _emberRuntime.readOnly; - computed.deprecatingAlias = _emberRuntime.deprecatingAlias; - computed.and = _emberRuntime.and; - computed.or = _emberRuntime.or; - computed.any = _emberRuntime.any; + this._removeEventListener(); - computed.sum = _emberRuntime.sum; - computed.min = _emberRuntime.min; - computed.max = _emberRuntime.max; - computed.map = _emberRuntime.map; - computed.sort = _emberRuntime.sort; - computed.setDiff = _emberRuntime.setDiff; - computed.mapBy = _emberRuntime.mapBy; - computed.filter = _emberRuntime.filter; - computed.filterBy = _emberRuntime.filterBy; - computed.uniq = _emberRuntime.uniq; + this._hashchangeHandler = function () { + _emberMetal.run(function () { + var path = _this.getURL(); + if (_emberMetal.get(_this, 'lastSetURL') === path) { + return; + } - if (true) { - computed.uniqBy = _emberRuntime.uniqBy; - } - computed.union = _emberRuntime.union; - computed.intersect = _emberRuntime.intersect; - computed.collect = _emberRuntime.collect; + _emberMetal.set(_this, 'lastSetURL', null); - /** - Defines the hash of localized strings for the current language. Used by - the `Ember.String.loc()` helper. To localize, add string values to this - hash. - - @property STRINGS - @for Ember - @type Object - @private - */ - Object.defineProperty(_emberMetal.default, 'STRINGS', { - configurable: false, - get: _emberRuntime.getStrings, - set: _emberRuntime.setStrings + callback(path); + }); + }; + + window.addEventListener('hashchange', this._hashchangeHandler); + }, + + /** + Given a URL, formats it to be placed into the page as part + of an element's `href` attribute. + This is used, for example, when using the {{action}} helper + to generate a URL based on an event. + @private + @method formatURL + @param url {String} + */ + formatURL: function (url) { + return '#' + url; + }, + + /** + Cleans up the HashLocation event listener. + @private + @method willDestroy + */ + willDestroy: function () { + this._removeEventListener(); + }, + + _removeEventListener: function () { + if (this._hashchangeHandler) { + window.removeEventListener('hashchange', this._hashchangeHandler); + } + } }); +}); +enifed('ember-routing/location/history_location', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/location/api'], function (exports, _emberMetal, _emberRuntime, _emberRoutingLocationApi) { + 'use strict'; /** - Whether searching on the global for new Namespace instances is enabled. - - This is only exported here as to not break any addons. Given the new - visit API, you will have issues if you treat this as a indicator of - booted. - - Internally this is only exposing a flag in Namespace. - - @property BOOTED - @for Ember - @type Boolean - @private - */ - Object.defineProperty(_emberMetal.default, 'BOOTED', { - configurable: false, - enumerable: false, - get: _emberRuntime.isNamespaceSearchDisabled, - set: _emberRuntime.setNamespaceSearchDisabled - }); + @module ember + @submodule ember-routing + */ - _emberMetal.default.Component = _emberGlimmer.Component; - _emberGlimmer.Helper.helper = _emberGlimmer.helper; - _emberMetal.default.Helper = _emberGlimmer.Helper; - _emberMetal.default.Checkbox = _emberGlimmer.Checkbox; - _emberMetal.default.TextField = _emberGlimmer.TextField; - _emberMetal.default.TextArea = _emberGlimmer.TextArea; - _emberMetal.default.LinkComponent = _emberGlimmer.LinkComponent; + var popstateFired = false; - if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { - String.prototype.htmlSafe = function () { - return _emberGlimmer.htmlSafe(this); + var _uuid = undefined; + + if (_emberMetal.isFeatureEnabled('ember-unique-location-history-state')) { + _uuid = function _uuid() { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { + var r, v; + r = Math.random() * 16 | 0; + v = c === 'x' ? r : r & 3 | 8; + return v.toString(16); + }); }; } - var EmberHandlebars = _emberMetal.default.Handlebars = _emberMetal.default.Handlebars || {}; - var EmberHTMLBars = _emberMetal.default.HTMLBars = _emberMetal.default.HTMLBars || {}; - var EmberHandleBarsUtils = EmberHandlebars.Utils = EmberHandlebars.Utils || {}; + /** + Ember.HistoryLocation implements the location API using the browser's + history.pushState API. + + @class HistoryLocation + @namespace Ember + @extends Ember.Object + @private + */ + exports.default = _emberRuntime.Object.extend({ + implementation: 'history', - Object.defineProperty(EmberHandlebars, 'SafeString', { - get: _emberGlimmer._getSafeString - }); + init: function () { + this._super.apply(this, arguments); - EmberHTMLBars.template = EmberHandlebars.template = _emberGlimmer.template; - EmberHandleBarsUtils.escapeExpression = _emberGlimmer.escapeExpression; - _emberRuntime.String.htmlSafe = _emberGlimmer.htmlSafe; + var base = document.querySelector('base'); + var baseURL = ''; + if (base) { + baseURL = base.getAttribute('href'); + } - if (true) { - _emberRuntime.String.isHTMLSafe = _emberGlimmer.isHTMLSafe; - } - EmberHTMLBars.makeBoundHelper = _emberGlimmer.makeBoundHelper; + _emberMetal.set(this, 'baseURL', baseURL); + _emberMetal.set(this, 'location', _emberMetal.get(this, 'location') || window.location); - /** - 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. - - @property TEMPLATES - @for Ember - @type Object - @private - */ - Object.defineProperty(_emberMetal.default, 'TEMPLATES', { - get: _emberGlimmer.getTemplates, - set: _emberGlimmer.setTemplates, - configurable: false, - enumerable: false - }); + this._popstateHandler = undefined; + }, - exports.VERSION = _emberVersion.default; + /** + Used to set state on first call to setURL + @private + @method initState + */ + initState: function () { + var history = _emberMetal.get(this, 'history') || window.history; + _emberMetal.set(this, 'history', history); - /** - The semantic version - @property VERSION - @type String - @public - */ - _emberMetal.default.VERSION = _emberVersion.default; + if (history && 'state' in history) { + this.supportsHistory = true; + } - _emberMetal.libraries.registerCoreLibrary('Ember', _emberVersion.default); + this.replaceState(this.formatURL(this.getURL())); + }, - _emberMetal.default.create = _emberMetal.deprecateFunc('Ember.create is deprecated in favor of Object.create', { id: 'ember-metal.ember-create', until: '3.0.0' }, Object.create); - _emberMetal.default.keys = _emberMetal.deprecateFunc('Ember.keys is deprecated in favor of Object.keys', { id: 'ember-metal.ember.keys', until: '3.0.0' }, Object.keys); + /** + Will be pre-pended to path upon state change + @property rootURL + @default '/' + @private + */ + rootURL: '/', - // require the main entry points for each of these packages - // this is so that the global exports occur properly + /** + Returns the current `location.pathname` without `rootURL` or `baseURL` + @private + @method getURL + @return url {String} + */ + getURL: function () { + var location = _emberMetal.get(this, 'location'); + var path = location.pathname; - /** - Alias for jQuery - - @method $ - @for Ember - @public - */ - _emberMetal.default.$ = _emberViews.jQuery; + var rootURL = _emberMetal.get(this, 'rootURL'); + var baseURL = _emberMetal.get(this, 'baseURL'); - _emberMetal.default.ViewTargetActionSupport = _emberViews.ViewTargetActionSupport; + // remove trailing slashes if they exists + rootURL = rootURL.replace(/\/$/, ''); + baseURL = baseURL.replace(/\/$/, ''); - _emberMetal.default.ViewUtils = { - isSimpleClick: _emberViews.isSimpleClick, - getViewElement: _emberViews.getViewElement, - getViewBounds: _emberViews.getViewBounds, - getViewClientRects: _emberViews.getViewClientRects, - getViewBoundingClientRect: _emberViews.getViewBoundingClientRect, - getRootViews: _emberViews.getRootViews, - getChildViews: _emberViews.getChildViews - }; + // remove baseURL and rootURL from start of path + var url = path.replace(new RegExp('^' + baseURL + '(?=/|$)'), '').replace(new RegExp('^' + rootURL + '(?=/|$)'), ''); - _emberMetal.default.TextSupport = _emberViews.TextSupport; - _emberMetal.default.ComponentLookup = _emberViews.ComponentLookup; - _emberMetal.default.EventDispatcher = _emberViews.EventDispatcher; + var search = location.search || ''; + url += search + this.getHash(); - _emberMetal.default.Location = _emberRouting.Location; - _emberMetal.default.AutoLocation = _emberRouting.AutoLocation; - _emberMetal.default.HashLocation = _emberRouting.HashLocation; - _emberMetal.default.HistoryLocation = _emberRouting.HistoryLocation; - _emberMetal.default.NoneLocation = _emberRouting.NoneLocation; - _emberMetal.default.controllerFor = _emberRouting.controllerFor; - _emberMetal.default.generateControllerFactory = _emberRouting.generateControllerFactory; - _emberMetal.default.generateController = _emberRouting.generateController; - _emberMetal.default.RouterDSL = _emberRouting.RouterDSL; - _emberMetal.default.Router = _emberRouting.Router; - _emberMetal.default.Route = _emberRouting.Route; + return url; + }, - _emberMetal.default.Application = _emberApplication.Application; - _emberMetal.default.ApplicationInstance = _emberApplication.ApplicationInstance; - _emberMetal.default.Engine = _emberApplication.Engine; - _emberMetal.default.EngineInstance = _emberApplication.EngineInstance; - _emberMetal.default.DefaultResolver = _emberMetal.default.Resolver = _emberApplication.Resolver; + /** + Uses `history.pushState` to update the url without a page reload. + @private + @method setURL + @param path {String} + */ + setURL: function (path) { + var state = this.getState(); + path = this.formatURL(path); + + if (!state || state.path !== path) { + this.pushState(path); + } + }, + + /** + Uses `history.replaceState` to update the url without a page reload + or history modification. + @private + @method replaceURL + @param path {String} + */ + replaceURL: function (path) { + var state = this.getState(); + path = this.formatURL(path); + + if (!state || state.path !== path) { + this.replaceState(path); + } + }, + + /** + Get the current `history.state`. Checks for if a polyfill is + required and if so fetches this._historyState. The state returned + from getState may be null if an iframe has changed a window's + history. + The object returned will contain a `path` for the given state as well + as a unique state `id`. The state index will allow the app to distinguish + between two states with similar paths but should be unique from one another. + @private + @method getState + @return state {Object} + */ + getState: function () { + if (this.supportsHistory) { + return _emberMetal.get(this, 'history').state; + } - _emberRuntime.runLoadHooks('Ember.Application', _emberApplication.Application); + return this._historyState; + }, - _emberMetal.default.DataAdapter = _emberExtensionSupport.DataAdapter; - _emberMetal.default.ContainerDebugAdapter = _emberExtensionSupport.ContainerDebugAdapter; + /** + Pushes a new state. + @private + @method pushState + @param path {String} + */ + pushState: function (path) { + var state = { path: path }; + if (_emberMetal.isFeatureEnabled('ember-unique-location-history-state')) { + state.uuid = _uuid(); + } - if (_require.has('ember-template-compiler')) { - _require.default('ember-template-compiler'); - } + _emberMetal.get(this, 'history').pushState(state, null, path); - // do this to ensure that Ember.Test is defined properly on the global - // if it is present. - if (_require.has('ember-testing')) { - var testing = _require.default('ember-testing'); + this._historyState = state; - _emberMetal.default.Test = testing.Test; - _emberMetal.default.Test.Adapter = testing.Adapter; - _emberMetal.default.Test.QUnitAdapter = testing.QUnitAdapter; - _emberMetal.default.setupForTesting = testing.setupForTesting; - } + // used for webkit workaround + this._previousURL = this.getURL(); + }, - _emberRuntime.runLoadHooks('Ember'); + /** + Replaces the current state. + @private + @method replaceState + @param path {String} + */ + replaceState: function (path) { + var state = { path: path }; + if (_emberMetal.isFeatureEnabled('ember-unique-location-history-state')) { + state.uuid = _uuid(); + } - /** - @module ember - */ - exports.default = _emberMetal.default; + _emberMetal.get(this, 'history').replaceState(state, null, path); - /* globals module */ - if (typeof module === 'object' && module.exports) { - module.exports = _emberMetal.default; - } else { - _emberEnvironment.context.exports.Ember = _emberEnvironment.context.exports.Em = _emberMetal.default; - } -}); + this._historyState = state; -// ****ember-environment**** + // used for webkit workaround + this._previousURL = this.getURL(); + }, -// ****ember-metal**** + /** + Register a callback to be invoked whenever the browser + history changes, including using forward and back buttons. + @private + @method onUpdateURL + @param callback {Function} + */ + onUpdateURL: function (callback) { + var _this = this; -// computed macros + this._removeEventListener(); -// reduced computed macros -enifed("ember/version", ["exports"], function (exports) { - "use strict"; + this._popstateHandler = function () { + // Ignore initial page load popstate event in Chrome + if (!popstateFired) { + popstateFired = true; + if (_this.getURL() === _this._previousURL) { + return; + } + } + callback(_this.getURL()); + }; - exports.default = "2.10.2-with-backtracking"; -}); -enifed('internal-test-helpers/apply-mixins', ['exports', 'ember-utils'], function (exports, _emberUtils) { - 'use strict'; + window.addEventListener('popstate', this._popstateHandler); + }, - exports.default = applyMixins; + /** + Used when using `{{action}}` helper. The url is always appended to the rootURL. + @private + @method formatURL + @param url {String} + @return formatted url {String} + */ + formatURL: function (url) { + var rootURL = _emberMetal.get(this, 'rootURL'); + var baseURL = _emberMetal.get(this, 'baseURL'); - function isGenerator(mixin) { - return Array.isArray(mixin.cases) && typeof mixin.generate === 'function'; - } + if (url !== '') { + // remove trailing slashes if they exists + rootURL = rootURL.replace(/\/$/, ''); + baseURL = baseURL.replace(/\/$/, ''); + } else if (baseURL[0] === '/' && rootURL[0] === '/') { + // if baseURL and rootURL both start with a slash + // ... remove trailing slash from baseURL if it exists + baseURL = baseURL.replace(/\/$/, ''); + } - function applyMixins(TestClass) { - for (var _len = arguments.length, mixins = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - mixins[_key - 1] = arguments[_key]; - } + return baseURL + rootURL + url; + }, - mixins.forEach(function (mixinOrGenerator) { - var mixin = undefined; + /** + Cleans up the HistoryLocation event listener. + @private + @method willDestroy + */ + willDestroy: function () { + this._removeEventListener(); + }, - if (isGenerator(mixinOrGenerator)) { - (function () { - var generator = mixinOrGenerator; - mixin = {}; + /** + @private + Returns normalized location.hash + @method getHash + */ + getHash: _emberRoutingLocationApi.default._getHash, - generator.cases.forEach(function (value, idx) { - _emberUtils.assign(mixin, generator.generate(value, idx)); - }); - })(); - } else { - mixin = mixinOrGenerator; + _removeEventListener: function () { + if (this._popstateHandler) { + window.removeEventListener('popstate', this._popstateHandler); } - - _emberUtils.assign(TestClass.prototype, mixin); - }); - - return TestClass; - } + } + }); }); -enifed('internal-test-helpers/build-owner', ['exports', 'container', 'ember-routing', 'ember-application', 'ember-runtime'], function (exports, _container, _emberRouting, _emberApplication, _emberRuntime) { +enifed('ember-routing/location/none_location', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { 'use strict'; - exports.default = buildOwner; + /** + @module ember + @submodule ember-routing + */ - function buildOwner() { - var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + /** + Ember.NoneLocation does not interact with the browser. It is useful for + testing, or when you need to manage state with your Router, but temporarily + don't want it to muck with the URL (for example when you embed your + application in a larger page). + + @class NoneLocation + @namespace Ember + @extends Ember.Object + @private + */ + exports.default = _emberRuntime.Object.extend({ + implementation: 'none', + path: '', - var ownerOptions = options.ownerOptions || {}; - var resolver = options.resolver; - var bootOptions = options.bootOptions || {}; + detect: function () { + var rootURL = this.rootURL; - var Owner = _emberRuntime.Object.extend(_emberRuntime.RegistryProxyMixin, _emberRuntime.ContainerProxyMixin); + _emberMetal.assert('rootURL must end with a trailing forward slash e.g. "/app/"', rootURL.charAt(rootURL.length - 1) === '/'); + }, - var namespace = _emberRuntime.Object.create({ - Resolver: { create: function () { - return resolver; - } } - }); + /** + Will be pre-pended to path. + @private + @property rootURL + @default '/' + */ + rootURL: '/', - var fallbackRegistry = _emberApplication.Application.buildRegistry(namespace); - fallbackRegistry.register('router:main', _emberRouting.Router); + /** + Returns the current path without `rootURL`. + @private + @method getURL + @return {String} path + */ + getURL: function () { + var path = _emberMetal.get(this, 'path'); + var rootURL = _emberMetal.get(this, 'rootURL'); - var registry = new _container.Registry({ - fallback: fallbackRegistry - }); + // remove trailing slashes if they exists + rootURL = rootURL.replace(/\/$/, ''); - _emberApplication.ApplicationInstance.setupRegistry(registry, bootOptions); + // remove rootURL from url + return path.replace(new RegExp('^' + rootURL + '(?=/|$)'), ''); + }, - var owner = Owner.create({ - __registry__: registry, - __container__: null - }, ownerOptions); + /** + Set the path and remembers what was set. Using this method + to change the path will not invoke the `updateURL` callback. + @private + @method setURL + @param path {String} + */ + setURL: function (path) { + _emberMetal.set(this, 'path', path); + }, - var container = registry.container({ owner: owner }); - owner.__container__ = container; + /** + Register a callback to be invoked when the path changes. These + callbacks will execute when the user presses the back or forward + button, but not after `setURL` is invoked. + @private + @method onUpdateURL + @param callback {Function} + */ + onUpdateURL: function (callback) { + this.updateCallback = callback; + }, - return owner; - } -}); -enifed('internal-test-helpers/confirm-export', ['exports', 'require'], function (exports, _require) { - 'use strict'; + /** + Sets the path and calls the `updateURL` callback. + @private + @method handleURL + @param callback {Function} + */ + handleURL: function (url) { + _emberMetal.set(this, 'path', url); + this.updateCallback(url); + }, - exports.default = confirmExport; + /** + Given a URL, formats it to be placed into the page as part + of an element's `href` attribute. + This is used, for example, when using the {{action}} helper + to generate a URL based on an event. + @private + @method formatURL + @param url {String} + @return {String} url + */ + formatURL: function (url) { + var rootURL = _emberMetal.get(this, 'rootURL'); - function getDescriptor(obj, path) { - var parts = path.split('.'); - var value = obj; - for (var i = 0; i < parts.length - 1; i++) { - var part = parts[i]; - value = value[part]; - if (!value) { - return undefined; + if (url !== '') { + // remove trailing slashes if they exists + rootURL = rootURL.replace(/\/$/, ''); } - } - var last = parts[parts.length - 1]; - return Object.getOwnPropertyDescriptor(value, last); - } - function confirmExport(Ember, assert, path, moduleId, exportName) { - var desc = getDescriptor(Ember, path); - assert.ok(desc, 'the property exists on the global'); - - var mod = _require.default(moduleId); - if (typeof exportName === 'string') { - assert.equal(desc.value, mod[exportName], 'Ember.' + path + ' is exported correctly'); - assert.notEqual(mod[exportName], undefined, 'Ember.' + path + ' is not `undefined`'); - } else { - assert.equal(desc.get, mod[exportName.get], 'Ember.' + path + ' getter is exported correctly'); - assert.notEqual(desc.get, undefined, 'Ember.' + path + ' getter is not undefined'); - - if (exportName.set) { - assert.equal(desc.set, mod[exportName.set], 'Ember.' + path + ' setter is exported correctly'); - assert.notEqual(desc.set, undefined, 'Ember.' + path + ' setter is not undefined'); - } + return rootURL + url; } - } + }); }); -enifed('internal-test-helpers/equal-inner-html', ['exports'], function (exports) { - // detect side-effects of cloning svg elements in IE9-11 +enifed('ember-routing/location/util', ['exports'], function (exports) { + /** + @private + + Returns the current `location.pathname`, normalized for IE inconsistencies. + */ 'use strict'; - exports.default = equalInnerHTML; - var ieSVGInnerHTML = (function () { - if (!document.createElementNS) { - return false; - } - var div = document.createElement('div'); - var node = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); - div.appendChild(node); - var clone = div.cloneNode(true); - return clone.innerHTML === ''; - })(); + exports.getPath = getPath; + exports.getQuery = getQuery; + exports.getHash = getHash; + exports.getFullPath = getFullPath; + exports.getOrigin = getOrigin; + exports.supportsHashChange = supportsHashChange; + exports.supportsHistory = supportsHistory; + exports.replacePath = replacePath; - function normalizeInnerHTML(actualHTML) { - if (ieSVGInnerHTML) { - // Replace `` with ``, etc. - // drop namespace attribute - actualHTML = actualHTML.replace(/ xmlns="[^"]+"/, ''); - // replace self-closing elements - actualHTML = actualHTML.replace(/<([^ >]+) [^\/>]*\/>/gi, function (tag, tagName) { - return tag.slice(0, tag.length - 3) + '>'; - }); + function getPath(location) { + var pathname = location.pathname; + // Various versions of IE/Opera don't always return a leading slash + if (pathname[0] !== '/') { + pathname = '/' + pathname; } - return actualHTML; - } - - function equalInnerHTML(fragment, html) { - var actualHTML = normalizeInnerHTML(fragment.innerHTML); - QUnit.push(actualHTML === html, actualHTML, html); + return pathname; } -}); -enifed('internal-test-helpers/equal-tokens', ['exports', 'simple-html-tokenizer'], function (exports, _simpleHtmlTokenizer) { - 'use strict'; - - exports.default = equalTokens; - function generateTokens(containerOrHTML) { - if (typeof containerOrHTML === 'string') { - return { - tokens: _simpleHtmlTokenizer.tokenize(containerOrHTML), - html: containerOrHTML - }; - } else { - return { - tokens: _simpleHtmlTokenizer.tokenize(containerOrHTML.innerHTML), - html: containerOrHTML.innerHTML - }; - } - } + /** + @private + + Returns the current `location.search`. + */ - function normalizeTokens(tokens) { - tokens.forEach(function (token) { - if (token.type === 'StartTag') { - token.attributes = token.attributes.sort(function (a, b) { - if (a[0] > b[0]) { - return 1; - } - if (a[0] < b[0]) { - return -1; - } - return 0; - }); - } - }); + function getQuery(location) { + return location.search; } - function equalTokens(actualContainer, expectedHTML) { - var message = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; - - var actual = generateTokens(actualContainer); - var expected = generateTokens(expectedHTML); - - normalizeTokens(actual.tokens); - normalizeTokens(expected.tokens); + /** + @private + + Returns the current `location.hash` by parsing location.href since browsers + inconsistently URL-decode `location.hash`. + + Should be passed the browser's `location` object as the first argument. + + https://bugzilla.mozilla.org/show_bug.cgi?id=483304 + */ - var equiv = QUnit.equiv(actual.tokens, expected.tokens); + function getHash(location) { + var href = location.href; + var hashIndex = href.indexOf('#'); - if (equiv && expected.html !== actual.html) { - deepEqual(actual.tokens, expected.tokens, message); + if (hashIndex === -1) { + return ''; } else { - QUnit.push(QUnit.equiv(actual.tokens, expected.tokens), actual.html, expected.html, message); + return href.substr(hashIndex); } } -}); -enifed('internal-test-helpers/factory', ['exports'], function (exports) { - 'use strict'; - exports.default = factory; - function setProperties(object, properties) { - for (var key in properties) { - if (properties.hasOwnProperty(key)) { - object[key] = properties[key]; - } - } + function getFullPath(location) { + return getPath(location) + getQuery(location) + getHash(location); } - var guids = 0; + function getOrigin(location) { + var origin = location.origin; - function factory() { - /*jshint validthis: true */ + // Older browsers, especially IE, don't have origin + if (!origin) { + origin = location.protocol + '//' + location.hostname; - function Klass(options) { - setProperties(this, options); - this._guid = guids++; - this.isDestroyed = false; + if (location.port) { + origin += ':' + location.port; + } } - Klass.prototype.constructor = Klass; - Klass.prototype.destroy = function () { - this.isDestroyed = true; - }; + return origin; + } - Klass.prototype.toString = function () { - return ''; - }; + /* + `documentMode` only exist in Internet Explorer, and it's tested because IE8 running in + IE7 compatibility mode claims to support `onhashchange` but actually does not. + + `global` is an object that may have an `onhashchange` property. + + @private + @function supportsHashChange + */ - Klass.create = create; - Klass.extend = extend; - Klass.reopen = extend; - Klass.reopenClass = reopenClass; + function supportsHashChange(documentMode, global) { + return 'onhashchange' in global && (documentMode === undefined || documentMode > 7); + } - return Klass; + /* + `userAgent` is a user agent string. We use user agent testing here, because + the stock Android browser is known to have buggy versions of the History API, + in some Android versions. + + @private + @function supportsHistory + */ - function create(options) { - return new this.prototype.constructor(options); - } + function supportsHistory(userAgent, history) { + // Boosted from Modernizr: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js + // The stock browser on Android 2.2 & 2.3, and 4.0.x returns positive on history support + // Unfortunately support is really buggy and there is no clean way to detect + // these bugs, so we fall back to a user agent sniff :( - function reopenClass(options) { - setProperties(this, options); + // We only want Android 2 and 4.0, stock browser, and not Chrome which identifies + // itself as 'Mobile Safari' as well, nor Windows Phone. + if ((userAgent.indexOf('Android 2.') !== -1 || userAgent.indexOf('Android 4.0') !== -1) && userAgent.indexOf('Mobile Safari') !== -1 && userAgent.indexOf('Chrome') === -1 && userAgent.indexOf('Windows Phone') === -1) { + return false; } - function extend(options) { - function Child(options) { - Klass.call(this, options); - } + return !!(history && 'pushState' in history); + } + + /** + Replaces the current location, making sure we explicitly include the origin + to prevent redirecting to a different origin. + + @private + */ + + function replacePath(location, path) { + location.replace(getOrigin(location) + path); + } +}); +enifed('ember-routing/services/router', ['exports', 'ember-runtime', 'ember-metal', 'ember-routing/system/dsl'], function (exports, _emberRuntime, _emberMetal, _emberRoutingSystemDsl) { + /** + @module ember + @submodule ember-routing + */ - var Parent = this; + 'use strict'; - Child.prototype = new Parent(); - Child.prototype.constructor = Child; + /** + The Router service is the public API that provides component/view layer + access to the router. + + @public + @class RouterService + @category ember-routing-router-service + */ + var RouterService = _emberRuntime.Service.extend({ + currentRouteName: _emberRuntime.readOnly('router.currentRouteName'), + currentURL: _emberRuntime.readOnly('router.currentURL'), + location: _emberRuntime.readOnly('router.location'), + rootURL: _emberRuntime.readOnly('router.rootURL'), - setProperties(Child, Klass); - setProperties(Child.prototype, options); + /** + Transition the application into another route. The route may + be either a single route or route path: + See [Route.transitionTo](http://emberjs.com/api/classes/Ember.Route.html#method_transitionTo) for more info. + @method transitionTo + @category ember-routing-router-service + @param {String} name the name of the route or a URL + @param {...Object} models the model(s) or identifier(s) to be used while + transitioning to the route. + @param {Object} [options] optional hash with a queryParams property + containing a mapping of query parameters + @return {Transition} the transition object associated with this + attempted transition + @public + */ + transitionTo: function () { + var _router; - Child.create = create; - Child.extend = extend; - Child.reopen = extend; + return (_router = this.router).transitionTo.apply(_router, arguments); + }, - Child.reopenClass = reopenClass; + /** + Transition into another route while replacing the current URL, if possible. + The route may be either a single route or route path: + See [Route.replaceWith](http://emberjs.com/api/classes/Ember.Route.html#method_replaceWith) for more info. + @method replaceWith + @category ember-routing-router-service + @param {String} name the name of the route or a URL + @param {...Object} models the model(s) or identifier(s) to be used while + transitioning to the route. + @param {Object} [options] optional hash with a queryParams property + containing a mapping of query parameters + @return {Transition} the transition object associated with this + attempted transition + @public + */ + replaceWith: function () { + var _router2; - return Child; + return (_router2 = this.router).replaceWith.apply(_router2, arguments); } - } -}); -enifed('internal-test-helpers/index', ['exports', 'internal-test-helpers/factory', 'internal-test-helpers/build-owner', 'internal-test-helpers/confirm-export', 'internal-test-helpers/equal-inner-html', 'internal-test-helpers/equal-tokens', 'internal-test-helpers/module-for', 'internal-test-helpers/strip', 'internal-test-helpers/apply-mixins', 'internal-test-helpers/matchers', 'internal-test-helpers/run', 'internal-test-helpers/test-groups', 'internal-test-helpers/test-cases/abstract', 'internal-test-helpers/test-cases/abstract-application', 'internal-test-helpers/test-cases/application', 'internal-test-helpers/test-cases/query-param', 'internal-test-helpers/test-cases/abstract-rendering', 'internal-test-helpers/test-cases/rendering'], function (exports, _internalTestHelpersFactory, _internalTestHelpersBuildOwner, _internalTestHelpersConfirmExport, _internalTestHelpersEqualInnerHtml, _internalTestHelpersEqualTokens, _internalTestHelpersModuleFor, _internalTestHelpersStrip, _internalTestHelpersApplyMixins, _internalTestHelpersMatchers, _internalTestHelpersRun, _internalTestHelpersTestGroups, _internalTestHelpersTestCasesAbstract, _internalTestHelpersTestCasesAbstractApplication, _internalTestHelpersTestCasesApplication, _internalTestHelpersTestCasesQueryParam, _internalTestHelpersTestCasesAbstractRendering, _internalTestHelpersTestCasesRendering) { - 'use strict'; + }); - exports.factory = _internalTestHelpersFactory.default; - exports.buildOwner = _internalTestHelpersBuildOwner.default; - exports.confirmExport = _internalTestHelpersConfirmExport.default; - exports.equalInnerHTML = _internalTestHelpersEqualInnerHtml.default; - exports.equalTokens = _internalTestHelpersEqualTokens.default; - exports.moduleFor = _internalTestHelpersModuleFor.default; - exports.strip = _internalTestHelpersStrip.default; - exports.applyMixins = _internalTestHelpersApplyMixins.default; - exports.equalsElement = _internalTestHelpersMatchers.equalsElement; - exports.classes = _internalTestHelpersMatchers.classes; - exports.styles = _internalTestHelpersMatchers.styles; - exports.regex = _internalTestHelpersMatchers.regex; - exports.runAppend = _internalTestHelpersRun.runAppend; - exports.runDestroy = _internalTestHelpersRun.runDestroy; - exports.testBoth = _internalTestHelpersTestGroups.testBoth; - exports.testWithDefault = _internalTestHelpersTestGroups.testWithDefault; - exports.AbstractTestCase = _internalTestHelpersTestCasesAbstract.default; - exports.AbstractApplicationTestCase = _internalTestHelpersTestCasesAbstractApplication.default; - exports.ApplicationTestCase = _internalTestHelpersTestCasesApplication.default; - exports.QueryParamTestCase = _internalTestHelpersTestCasesQueryParam.default; - exports.AbstractRenderingTestCase = _internalTestHelpersTestCasesAbstractRendering.default; - exports.RenderingTestCase = _internalTestHelpersTestCasesRendering.default; + exports.default = RouterService; }); -enifed('internal-test-helpers/matchers', ['exports'], function (exports) { - 'use strict'; +enifed('ember-routing/services/routing', ['exports', 'ember-utils', 'ember-runtime', 'ember-metal', 'ember-routing/utils'], function (exports, _emberUtils, _emberRuntime, _emberMetal, _emberRoutingUtils) { + /** + @module ember + @submodule ember-routing + */ - exports.regex = regex; - exports.classes = classes; - exports.styles = styles; - exports.equalsElement = equalsElement; - var HTMLElement = window.HTMLElement; - var MATCHER_BRAND = '3d4ef194-13be-4ccf-8dc7-862eea02c93e'; + 'use strict'; - function isMatcher(obj) { - return typeof obj === 'object' && obj !== null && MATCHER_BRAND in obj; - } + /** + 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 + the set of API needed for components to control routing without interacting + with router internals. + + @private + @class RoutingService + */ + exports.default = _emberRuntime.Service.extend({ + router: null, - function equalsAttr(expected) { - var _ref; + targetState: _emberRuntime.readOnly('router.targetState'), + currentState: _emberRuntime.readOnly('router.currentState'), + currentRouteName: _emberRuntime.readOnly('router.currentRouteName'), + currentPath: _emberRuntime.readOnly('router.currentPath'), - return _ref = {}, _ref[MATCHER_BRAND] = true, _ref.match = function (actual) { - return expected === actual; - }, _ref.expected = function () { - return expected; - }, _ref.message = function () { - return 'should equal ' + this.expected(); - }, _ref; - } + availableRoutes: function () { + return Object.keys(_emberMetal.get(this, 'router').router.recognizer.names); + }, - function regex(r) { - var _ref2; + hasRoute: function (routeName) { + return _emberMetal.get(this, 'router').hasRoute(routeName); + }, - return _ref2 = {}, _ref2[MATCHER_BRAND] = true, _ref2.match = function (v) { - return r.test(v); - }, _ref2.expected = function () { - return r.toString(); - }, _ref2.message = function () { - return 'should match ' + this.expected(); - }, _ref2; - } + transitionTo: function (routeName, models, queryParams, shouldReplace) { + var router = _emberMetal.get(this, 'router'); - function classes(expected) { - var _ref3; + var transition = router._doTransition(routeName, models, queryParams); - return _ref3 = {}, _ref3[MATCHER_BRAND] = true, _ref3.match = function (actual) { - actual = actual.trim(); - return actual && expected.split(/\s+/).sort().join(' ') === actual.trim().split(/\s+/).sort().join(' '); - }, _ref3.expected = function () { - return expected; - }, _ref3.message = function () { - return 'should match ' + this.expected(); - }, _ref3; - } + if (shouldReplace) { + transition.method('replace'); + } - function styles(expected) { - var _ref4; + return transition; + }, - return _ref4 = {}, _ref4[MATCHER_BRAND] = true, _ref4.match = function (actual) { - // coerce `null` or `undefined` to an empty string - // needed for matching empty styles on IE9 - IE11 - actual = actual || ''; - actual = actual.trim(); + normalizeQueryParams: function (routeName, models, queryParams) { + var router = _emberMetal.get(this, 'router'); + router._prepareQueryParams(routeName, models, queryParams); + }, - return expected.split(';').map(function (s) { - return s.trim(); - }).filter(function (s) { - return s; - }).sort().join('; ') === actual.split(';').map(function (s) { - return s.trim(); - }).filter(function (s) { - return s; - }).sort().join('; '); - }, _ref4.expected = function () { - return expected; - }, _ref4.message = function () { - return 'should match ' + this.expected(); - }, _ref4; - } + generateURL: function (routeName, models, queryParams) { + var router = _emberMetal.get(this, 'router'); + if (!router.router) { + return; + } - function equalsElement(element, tagName, attributes, content) { - QUnit.push(element.tagName === tagName.toUpperCase(), element.tagName.toLowerCase(), tagName, 'expect tagName to be ' + tagName); + var visibleQueryParams = {}; + _emberUtils.assign(visibleQueryParams, queryParams); - var expectedAttrs = {}; - var expectedCount = 0; + this.normalizeQueryParams(routeName, models, visibleQueryParams); - for (var _name in attributes) { - var expected = attributes[_name]; - if (expected !== null) { - expectedCount++; - } + var args = _emberRoutingUtils.routeArgs(routeName, models, visibleQueryParams); + return router.generate.apply(router, args); + }, - var matcher = isMatcher(expected) ? expected : equalsAttr(expected); + isActiveForRoute: function (contexts, queryParams, routeName, routerState, isCurrentWhenSpecified) { + var router = _emberMetal.get(this, 'router'); - expectedAttrs[_name] = matcher; + var handlers = router.router.recognizer.handlersFor(routeName); + var leafName = handlers[handlers.length - 1].handler; + var maximumContexts = numberOfContextsAcceptedByHandler(routeName, handlers); - QUnit.push(expectedAttrs[_name].match(element.getAttribute(_name)), element.getAttribute(_name), matcher.expected(), 'Element\'s ' + _name + ' attribute ' + matcher.message()); - } + // NOTE: any ugliness in the calculation of activeness is largely + // due to the fact that we support automatic normalizing of + // `resource` -> `resource.index`, even though there might be + // dynamic segments / query params defined on `resource.index` + // which complicates (and makes somewhat ambiguous) the calculation + // of activeness for links that link to `resource` instead of + // directly to `resource.index`. - var actualAttributes = {}; + // if we don't have enough contexts revert back to full route name + // this is because the leaf route will use one of the contexts + if (contexts.length > maximumContexts) { + routeName = leafName; + } - for (var i = 0, l = element.attributes.length; i < l; i++) { - actualAttributes[element.attributes[i].name] = element.attributes[i].value; + return routerState.isActiveIntent(routeName, contexts, queryParams, !isCurrentWhenSpecified); } + }); - if (!(element instanceof HTMLElement)) { - QUnit.push(element instanceof HTMLElement, null, null, 'Element must be an HTML Element, not an SVG Element'); - } else { - QUnit.push(element.attributes.length === expectedCount || !attributes, element.attributes.length, expectedCount, 'Expected ' + expectedCount + ' attributes; got ' + element.outerHTML); - - if (content !== null) { - QUnit.push(element.innerHTML === content, element.innerHTML, content, 'The element had \'' + content + '\' as its content'); + function numberOfContextsAcceptedByHandler(handler, handlerInfos) { + var req = 0; + for (var i = 0; i < handlerInfos.length; i++) { + req += handlerInfos[i].names.length; + if (handlerInfos[i].handler === handler) { + break; } } + + return req; } }); -enifed('internal-test-helpers/module-for', ['exports', 'internal-test-helpers/apply-mixins'], function (exports, _internalTestHelpersApplyMixins) { +enifed('ember-routing/system/cache', ['exports', 'ember-utils', 'ember-runtime'], function (exports, _emberUtils, _emberRuntime) { 'use strict'; - exports.default = moduleFor; + /** + A two-tiered cache with support for fallback values when doing lookups. + Uses "buckets" and then "keys" to cache values. + + @private + @class BucketCache + */ + exports.default = _emberRuntime.Object.extend({ + init: function () { + this.cache = new _emberUtils.EmptyObject(); + }, - function moduleFor(description, TestClass) { - var context = undefined; + has: function (bucketKey) { + return !!this.cache[bucketKey]; + }, - QUnit.module(description, { - setup: function () { - context = new TestClass(); - }, + stash: function (bucketKey, key, value) { + var bucket = this.cache[bucketKey]; - teardown: function () { - context.teardown(); + if (!bucket) { + bucket = this.cache[bucketKey] = new _emberUtils.EmptyObject(); } - }); - for (var _len = arguments.length, mixins = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - mixins[_key - 2] = arguments[_key]; - } - - _internalTestHelpersApplyMixins.default(TestClass, mixins); - - var proto = TestClass.prototype; + bucket[key] = value; + }, - while (proto !== Object.prototype) { - Object.keys(proto).forEach(generateTest); - proto = Object.getPrototypeOf(proto); - } + lookup: function (bucketKey, prop, defaultValue) { + var cache = this.cache; + if (!this.has(bucketKey)) { + return defaultValue; + } - function generateTest(name) { - if (name.indexOf('@test ') === 0) { - QUnit.test(name.slice(5), function (assert) { - return context[name](assert); - }); - } else if (name.indexOf('@skip ') === 0) { - QUnit.skip(name.slice(5), function (assert) { - return context[name](assert); - }); + var bucket = cache[bucketKey]; + if (prop in bucket && bucket[prop] !== undefined) { + return bucket[prop]; + } else { + return defaultValue; } } - } + }); }); -enifed('internal-test-helpers/run', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; +enifed("ember-routing/system/controller_for", ["exports"], function (exports) { + /** + @module ember + @submodule ember-routing + */ - exports.runAppend = runAppend; - exports.runDestroy = runDestroy; + /** + Finds a controller instance. + + @for Ember + @method controllerFor + @private + */ + "use strict"; - function runAppend(view) { - _emberMetal.run(view, 'appendTo', '#qunit-fixture'); - } + exports.default = controllerFor; - function runDestroy(toDestroy) { - if (toDestroy) { - _emberMetal.run(toDestroy, 'destroy'); - } + function controllerFor(container, controllerName, lookupOptions) { + return container.lookup("controller:" + controllerName, lookupOptions); } }); -enifed('internal-test-helpers/strip', ['exports'], function (exports) { +enifed('ember-routing/system/dsl', ['exports', 'ember-utils', 'ember-metal'], function (exports, _emberUtils, _emberMetal) { 'use strict'; - exports.default = strip; + /** + @module ember + @submodule ember-routing + */ - function strip(_ref) { - for (var _len = arguments.length, values = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - values[_key - 1] = arguments[_key]; - } + var uuid = 0; - var strings = _ref; + var DSL = (function () { + function DSL(name, options) { + babelHelpers.classCallCheck(this, DSL); - var str = strings.map(function (string, index) { - var interpolated = values[index]; - return string + (interpolated !== undefined ? interpolated : ''); - }).join(''); - return str.split('\n').map(function (s) { - return s.trim(); - }).join(''); - } -}); -enifed('internal-test-helpers/test-cases/abstract-application', ['exports', 'ember-metal', 'ember-views', 'ember-application', 'ember-routing', 'ember-template-compiler', 'internal-test-helpers/test-cases/abstract', 'internal-test-helpers/run'], function (exports, _emberMetal, _emberViews, _emberApplication, _emberRouting, _emberTemplateCompiler, _internalTestHelpersTestCasesAbstract, _internalTestHelpersRun) { - 'use strict'; + this.parent = name; + this.enableLoadingSubstates = options && options.enableLoadingSubstates; + this.matches = []; + this.explicitIndex = undefined; + this.options = options; + } - var AbstractApplicationTestCase = (function (_AbstractTestCase) { - babelHelpers.inherits(AbstractApplicationTestCase, _AbstractTestCase); + DSL.prototype.route = function route(name, options, callback) { + if (options === undefined) options = {}; - function AbstractApplicationTestCase() { - babelHelpers.classCallCheck(this, AbstractApplicationTestCase); + var dummyErrorRoute = '/_unused_dummy_error_path_route_' + name + '/:error'; + if (arguments.length === 2 && typeof options === 'function') { + callback = options; + options = {}; + } - _AbstractTestCase.call(this); + _emberMetal.assert('\'' + name + '\' cannot be used as a route name.', (function () { + if (options.overrideNameAssertion === true) { + return true; + } - this.element = _emberViews.jQuery('#qunit-fixture')[0]; + return ['array', 'basic', 'object', 'application'].indexOf(name) === -1; + })()); - this.application = _emberMetal.run(_emberApplication.Application, 'create', this.applicationOptions); + if (this.enableLoadingSubstates) { + createRoute(this, name + '_loading', { resetNamespace: options.resetNamespace }); + createRoute(this, name + '_error', { resetNamespace: options.resetNamespace, path: dummyErrorRoute }); + } - this.router = this.application.Router = _emberRouting.Router.extend(this.routerOptions); + if (callback) { + var fullName = getFullName(this, name, options.resetNamespace); + var dsl = new DSL(fullName, this.options); - this.applicationInstance = null; - } + createRoute(dsl, 'loading'); + createRoute(dsl, 'error', { path: dummyErrorRoute }); - AbstractApplicationTestCase.prototype.teardown = function teardown() { - if (this.applicationInstance) { - _internalTestHelpersRun.runDestroy(this.applicationInstance); - } + callback.call(dsl); - _internalTestHelpersRun.runDestroy(this.application); + createRoute(this, name, options, dsl.generate()); + } else { + createRoute(this, name, options); + } }; - AbstractApplicationTestCase.prototype.visit = function visit(url, options) { - var _this = this; + DSL.prototype.push = function push(url, name, callback, serialize) { + var parts = name.split('.'); - var applicationInstance = this.applicationInstance; + if (this.options.engineInfo) { + var localFullName = name.slice(this.options.engineInfo.fullName.length + 1); + var routeInfo = _emberUtils.assign({ localFullName: localFullName }, this.options.engineInfo); - if (applicationInstance) { - return _emberMetal.run(applicationInstance, 'visit', url, options); - } else { - return _emberMetal.run(this.application, 'visit', url, options).then(function (instance) { - _this.applicationInstance = instance; - }); + if (serialize) { + routeInfo.serializeMethod = serialize; + } + + this.options.addRouteForEngine(name, routeInfo); + } else if (serialize) { + throw new Error('Defining a route serializer on route \'' + name + '\' outside an Engine is not allowed.'); } - }; - AbstractApplicationTestCase.prototype.transitionTo = function transitionTo() { - return _emberMetal.run.apply(undefined, [this.appRouter, 'transitionTo'].concat(babelHelpers.slice.call(arguments))); - }; + if (url === '' || url === '/' || parts[parts.length - 1] === 'index') { + this.explicitIndex = true; + } - AbstractApplicationTestCase.prototype.compile = function compile(string, options) { - return _emberTemplateCompiler.compile.apply(undefined, arguments); + this.matches.push([url, name, callback]); }; - AbstractApplicationTestCase.prototype.registerRoute = function registerRoute(name, route) { - this.application.register('route:' + name, route); - }; + DSL.prototype.resource = function resource(name, options, callback) { + if (options === undefined) options = {}; - AbstractApplicationTestCase.prototype.registerTemplate = function registerTemplate(name, template) { - this.application.register('template:' + name, this.compile(template, { - moduleName: name - })); + if (arguments.length === 2 && typeof options === 'function') { + callback = options; + options = {}; + } + + options.resetNamespace = true; + _emberMetal.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); }; - AbstractApplicationTestCase.prototype.registerComponent = function registerComponent(name, _ref) { - var _ref$ComponentClass = _ref.ComponentClass; - var ComponentClass = _ref$ComponentClass === undefined ? null : _ref$ComponentClass; - var _ref$template = _ref.template; - var template = _ref$template === undefined ? null : _ref$template; + DSL.prototype.generate = function generate() { + var dslMatches = this.matches; - if (ComponentClass) { - this.application.register('component:' + name, ComponentClass); + if (!this.explicitIndex) { + this.route('index', { path: '/' }); } - if (typeof template === 'string') { - this.application.register('template:components/' + name, this.compile(template, { - moduleName: 'components/' + name - })); - } + return function (match) { + for (var i = 0; i < dslMatches.length; i++) { + var dslMatch = dslMatches[i]; + match(dslMatch[0]).to(dslMatch[1], dslMatch[2]); + } + }; }; - AbstractApplicationTestCase.prototype.registerController = function registerController(name, controller) { - this.application.register('controller:' + name, controller); - }; + DSL.prototype.mount = function mount(_name) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - AbstractApplicationTestCase.prototype.registerEngine = function registerEngine(name, engine) { - this.application.register('engine:' + name, engine); - }; + var engineRouteMap = this.options.resolveRouteMap(_name); + var name = _name; - babelHelpers.createClass(AbstractApplicationTestCase, [{ - key: 'applicationOptions', - get: function () { - return { - rootElement: '#qunit-fixture', - autoboot: false - }; + if (options.as) { + name = options.as; } - }, { - key: 'routerOptions', - get: function () { - return { - location: 'none' - }; + + var fullName = getFullName(this, name, options.resetNamespace); + + var engineInfo = { + name: _name, + instanceId: uuid++, + mountPoint: fullName, + fullName: fullName + }; + + var path = options.path; + + if (typeof path !== 'string') { + path = '/' + name; } - }, { - key: 'appRouter', - get: function () { - return this.applicationInstance.lookup('router:main'); + + var callback = undefined; + var dummyErrorRoute = '/_unused_dummy_error_path_route_' + name + '/:error'; + if (engineRouteMap) { + var shouldResetEngineInfo = false; + var oldEngineInfo = this.options.engineInfo; + if (oldEngineInfo) { + shouldResetEngineInfo = true; + this.options.engineInfo = engineInfo; + } + + var optionsForChild = _emberUtils.assign({ engineInfo: engineInfo }, this.options); + var childDSL = new DSL(fullName, optionsForChild); + + createRoute(childDSL, 'loading'); + createRoute(childDSL, 'error', { path: dummyErrorRoute }); + + engineRouteMap.class.call(childDSL); + + callback = childDSL.generate(); + + if (shouldResetEngineInfo) { + this.options.engineInfo = oldEngineInfo; + } } - }]); - return AbstractApplicationTestCase; - })(_internalTestHelpersTestCasesAbstract.default); - exports.default = AbstractApplicationTestCase; + var localFullName = 'application'; + var routeInfo = _emberUtils.assign({ localFullName: localFullName }, engineInfo); + + if (this.enableLoadingSubstates) { + // These values are important to register the loading routes under their + // proper names for the Router and within the Engine's registry. + var substateName = name + '_loading'; + var _localFullName = 'application_loading'; + var _routeInfo = _emberUtils.assign({ localFullName: _localFullName }, engineInfo); + createRoute(this, substateName, { resetNamespace: options.resetNamespace }); + this.options.addRouteForEngine(substateName, _routeInfo); + + substateName = name + '_error'; + _localFullName = 'application_error'; + _routeInfo = _emberUtils.assign({ localFullName: _localFullName }, engineInfo); + createRoute(this, substateName, { resetNamespace: options.resetNamespace, path: dummyErrorRoute }); + this.options.addRouteForEngine(substateName, _routeInfo); + } + + this.options.addRouteForEngine(fullName, routeInfo); + + this.push(path, fullName, callback); + }; + + return DSL; + })(); + + exports.default = DSL; + + function canNest(dsl) { + return dsl.parent && dsl.parent !== 'application'; + } + + function getFullName(dsl, name, resetNamespace) { + if (canNest(dsl) && resetNamespace !== true) { + return dsl.parent + '.' + name; + } else { + return name; + } + } + + function createRoute(dsl, name, options, callback) { + if (options === undefined) options = {}; + + var fullName = getFullName(dsl, name, options.resetNamespace); + + if (typeof options.path !== 'string') { + options.path = '/' + name; + } + + dsl.push(options.path, fullName, callback, options.serialize); + } + + DSL.map = function (callback) { + var dsl = new DSL(); + callback.call(dsl); + return dsl; + }; }); -enifed('internal-test-helpers/test-cases/abstract-rendering', ['exports', 'ember-utils', 'ember-template-compiler', 'ember-views', 'ember-glimmer', 'internal-test-helpers/test-cases/abstract', 'internal-test-helpers/build-owner', 'internal-test-helpers/run'], function (exports, _emberUtils, _emberTemplateCompiler, _emberViews, _emberGlimmer, _internalTestHelpersTestCasesAbstract, _internalTestHelpersBuildOwner, _internalTestHelpersRun) { +enifed('ember-routing/system/generate_controller', ['exports', 'ember-metal', 'container'], function (exports, _emberMetal, _container) { 'use strict'; - var TextNode = window.Text; + exports.generateControllerFactory = generateControllerFactory; + exports.default = generateController; - var AbstractRenderingTestCase = (function (_AbstractTestCase) { - babelHelpers.inherits(AbstractRenderingTestCase, _AbstractTestCase); + /** + @module ember + @submodule ember-routing + */ - function AbstractRenderingTestCase() { - babelHelpers.classCallCheck(this, AbstractRenderingTestCase); + /** + Generates a controller factory + + @for Ember + @method generateControllerFactory + @private + */ - _AbstractTestCase.call(this); - var owner = this.owner = _internalTestHelpersBuildOwner.default({ - ownerOptions: this.getOwnerOptions(), - bootOptions: this.getBootOptions(), - resolver: this.getResolver() - }); + function generateControllerFactory(owner, controllerName, context) { + var Factory = owner[_container.FACTORY_FOR]('controller:basic').class; - this.renderer = this.owner.lookup('renderer:-dom'); - this.element = _emberViews.jQuery('#qunit-fixture')[0]; - this.component = null; + Factory = Factory.extend({ + toString: function () { + return '(generated ' + controllerName + ' controller)'; + } + }); - owner.register('event_dispatcher:main', _emberViews.EventDispatcher); - owner.inject('event_dispatcher:main', '_viewRegistry', '-view-registry:main'); - owner.lookup('event_dispatcher:main').setup(this.getCustomDispatcherEvents(), this.element); - } + var fullName = 'controller:' + controllerName; - AbstractRenderingTestCase.prototype.compile = function compile() { - return _emberTemplateCompiler.compile.apply(undefined, arguments); - }; + owner.register(fullName, Factory); - AbstractRenderingTestCase.prototype.getCustomDispatcherEvents = function getCustomDispatcherEvents() { - return {}; - }; + return Factory; + } - AbstractRenderingTestCase.prototype.getOwnerOptions = function getOwnerOptions() {}; + /** + Generates and instantiates a controller extending from `controller:basic` + if present, or `Ember.Controller` if not. + + @for Ember + @method generateController + @private + @since 1.3.0 + */ - AbstractRenderingTestCase.prototype.getBootOptions = function getBootOptions() {}; + function generateController(owner, controllerName) { + generateControllerFactory(owner, controllerName); - AbstractRenderingTestCase.prototype.getResolver = function getResolver() {}; + var fullName = 'controller:' + controllerName; + var instance = owner.lookup(fullName); - AbstractRenderingTestCase.prototype.teardown = function teardown() { - if (this.component) { - _internalTestHelpersRun.runDestroy(this.component); - } - if (this.owner) { - _internalTestHelpersRun.runDestroy(this.owner); + _emberMetal.runInDebug(function () { + if (_emberMetal.get(instance, 'namespace.LOG_ACTIVE_GENERATION')) { + _emberMetal.info('generated -> ' + fullName, { fullName: fullName }); } - }; + }); - AbstractRenderingTestCase.prototype.render = function render(templateStr) { - var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - var owner = this.owner; + return instance; + } +}); +enifed('ember-routing/system/query_params', ['exports', 'ember-runtime'], function (exports, _emberRuntime) { + 'use strict'; - owner.register('template:-top-level', this.compile(templateStr, { - moduleName: '-top-level' - })); + exports.default = _emberRuntime.Object.extend({ + isQueryParams: true, + values: null + }); +}); +enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-routing/system/generate_controller', 'ember-routing/utils', 'container'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberRoutingSystemGenerate_controller, _emberRoutingUtils, _container) { + 'use strict'; - var attrs = _emberUtils.assign({}, context, { - tagName: '', - layoutName: '-top-level' - }); + exports.defaultSerialize = defaultSerialize; + exports.hasDefaultSerialize = hasDefaultSerialize; + var slice = Array.prototype.slice; - owner.register('component:-top-level', _emberGlimmer.Component.extend(attrs)); + function K() { + return this; + } - this.component = owner.lookup('component:-top-level'); + function defaultSerialize(model, params) { + if (params.length < 1 || !model) { + return; + } - _internalTestHelpersRun.runAppend(this.component); - }; + var name = params[0]; + var object = {}; - AbstractRenderingTestCase.prototype.rerender = function rerender() { - this.component.rerender(); - }; + if (params.length === 1) { + if (name in model) { + object[name] = _emberMetal.get(model, name); + } else if (/_id$/.test(name)) { + object[name] = _emberMetal.get(model, 'id'); + } + } else { + object = _emberMetal.getProperties(model, params); + } - AbstractRenderingTestCase.prototype.registerHelper = function registerHelper(name, funcOrClassBody) { - var type = typeof funcOrClassBody; + return object; + } - if (type === 'function') { - this.owner.register('helper:' + name, _emberGlimmer.helper(funcOrClassBody)); - } else if (type === 'object' && type !== null) { - this.owner.register('helper:' + name, _emberGlimmer.Helper.extend(funcOrClassBody)); - } else { - throw new Error('Cannot register ' + funcOrClassBody + ' as a helper'); - } - }; + var DEFAULT_SERIALIZE = _emberUtils.symbol('DEFAULT_SERIALIZE'); - AbstractRenderingTestCase.prototype.registerPartial = function registerPartial(name, template) { - var owner = this.env.owner || this.owner; - if (typeof template === 'string') { - var moduleName = 'template:' + name; - owner.register(moduleName, this.compile(template, { moduleName: moduleName })); - } - }; + defaultSerialize[DEFAULT_SERIALIZE] = true; - AbstractRenderingTestCase.prototype.registerComponent = function registerComponent(name, _ref) { - var _ref$ComponentClass = _ref.ComponentClass; - var ComponentClass = _ref$ComponentClass === undefined ? null : _ref$ComponentClass; - var _ref$template = _ref.template; - var template = _ref$template === undefined ? null : _ref$template; - var owner = this.owner; + function hasDefaultSerialize(route) { + return !!route.serialize[DEFAULT_SERIALIZE]; + } - if (ComponentClass) { - owner.register('component:' + name, ComponentClass); - } + /** + @module ember + @submodule ember-routing + */ - if (typeof template === 'string') { - owner.register('template:components/' + name, this.compile(template, { - moduleName: 'components/' + name - })); + /** + The `Ember.Route` class is used to define individual routes. Refer to + the [routing guide](http://emberjs.com/guides/routing/) for documentation. + + @class Route + @namespace Ember + @extends Ember.Object + @uses Ember.ActionHandler + @uses Ember.Evented + @since 1.0.0 + @public + */ + var Route = _emberRuntime.Object.extend(_emberRuntime.ActionHandler, _emberRuntime.Evented, { + /** + Configuration hash for this route's queryParams. The possible + configuration options and their defaults are as follows + (assuming a query param whose controller property is `page`): + ```javascript + queryParams: { + page: { + // By default, controller query param properties don't + // cause a full transition when they are changed, but + // rather only cause the URL to update. Setting + // `refreshModel` to true will cause an "in-place" + // transition to occur, whereby the model hooks for + // this route (and any child routes) will re-fire, allowing + // you to reload models (e.g., from the server) using the + // updated query param values. + refreshModel: false, + // By default, changes to controller query param properties + // cause the URL to update via `pushState`, which means an + // item will be added to the browser's history, allowing + // you to use the back button to restore the app to the + // previous state before the query param property was changed. + // Setting `replace` to true will use `replaceState` (or its + // hash location equivalent), which causes no browser history + // item to be added. This options name and default value are + // the same as the `link-to` helper's `replace` option. + replace: false, + // By default, the query param URL key is the same name as + // the controller property name. Use `as` to specify a + // different URL key. + as: 'page' + } } - }; + ``` + @property queryParams + @for Ember.Route + @type Object + @since 1.6.0 + @public + */ + queryParams: {}, - AbstractRenderingTestCase.prototype.registerTemplate = function registerTemplate(name, template) { - var owner = this.owner; + /** + The name of the route, dot-delimited. + For example, a route found at `app/routes/posts/post.js` will have + a `routeName` of `posts.post`. + @property routeName + @for Ember.Route + @type String + @since 1.0.0 + @public + */ - if (typeof template === 'string') { - owner.register('template:' + name, this.compile(template, { - moduleName: name - })); - } else { - throw new Error('Registered template "' + name + '" must be a string'); - } - }; + /** + Sets the name for this route, including a fully resolved name for routes + inside engines. + @private + @method _setRouteName + @param {String} name + */ + _setRouteName: function (name) { + this.routeName = name; + this.fullRouteName = getEngineRouteName(_emberUtils.getOwner(this), name); + }, - AbstractRenderingTestCase.prototype.registerService = function registerService(name, klass) { - this.owner.register('service:' + name, klass); - }; + /** + Populates the QP meta information in the BucketCache. + @private + @method _populateQPMeta + */ + _populateQPMeta: function () { + this._bucketCache.stash('route-meta', this.fullRouteName, this.get('_qp')); + }, - AbstractRenderingTestCase.prototype.assertTextNode = function assertTextNode(node, text) { - if (!(node instanceof TextNode)) { - throw new Error('Expecting a text node, but got ' + node); - } + /** + @private + @property _qp + */ + _qp: _emberMetal.computed(function () { + var _this = this; - this.assert.strictEqual(node.textContent, text, 'node.textContent'); - }; + var controllerProto = undefined, + combinedQueryParameterConfiguration = undefined; - babelHelpers.createClass(AbstractRenderingTestCase, [{ - key: 'context', - get: function () { - return this.component; - } - }]); - return AbstractRenderingTestCase; - })(_internalTestHelpersTestCasesAbstract.default); + var controllerName = this.controllerName || this.routeName; + var owner = _emberUtils.getOwner(this); + var definedControllerClass = owner[_container.LOOKUP_FACTORY]('controller:' + controllerName); + var queryParameterConfiguraton = _emberMetal.get(this, 'queryParams'); + var hasRouterDefinedQueryParams = !!Object.keys(queryParameterConfiguraton).length; - exports.default = AbstractRenderingTestCase; -}); -enifed('internal-test-helpers/test-cases/abstract', ['exports', 'ember-utils', 'ember-metal', 'ember-views', 'internal-test-helpers/equal-inner-html', 'internal-test-helpers/equal-tokens', 'internal-test-helpers/matchers'], function (exports, _emberUtils, _emberMetal, _emberViews, _internalTestHelpersEqualInnerHtml, _internalTestHelpersEqualTokens, _internalTestHelpersMatchers) { - 'use strict'; + if (definedControllerClass) { + // the developer has authored a controller class in their application for this route + // access the prototype, find its query params and normalize their object shape + // them merge in the query params for the route. As a mergedProperty, Route#queryParams is always + // at least `{}` + controllerProto = definedControllerClass.proto(); - var TextNode = window.Text; - var HTMLElement = window.HTMLElement; - var Comment = window.Comment; + var controllerDefinedQueryParameterConfiguration = _emberMetal.get(controllerProto, 'queryParams'); + var normalizedControllerQueryParameterConfiguration = _emberRoutingUtils.normalizeControllerQueryParams(controllerDefinedQueryParameterConfiguration); + combinedQueryParameterConfiguration = mergeEachQueryParams(normalizedControllerQueryParameterConfiguration, queryParameterConfiguraton); + } 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(_emberUtils.getOwner(this), controllerName); + controllerProto = generatedControllerClass.proto(); + combinedQueryParameterConfiguration = queryParameterConfiguraton; + } - function isMarker(node) { - if (node instanceof Comment && node.textContent === '') { - return true; - } + var qps = []; + var map = {}; + var propertyNames = []; - if (node instanceof TextNode && node.textContent === '') { - return true; - } + for (var propName in combinedQueryParameterConfiguration) { + if (!combinedQueryParameterConfiguration.hasOwnProperty(propName)) { + continue; + } - return false; - } + // to support the dubious feature of using unknownProperty + // on queryParams configuration + if (propName === 'unknownProperty' || propName === '_super') { + // possible todo: issue deprecation warning? + continue; + } - var AbstractTestCase = (function () { - function AbstractTestCase() { - babelHelpers.classCallCheck(this, AbstractTestCase); + var desc = combinedQueryParameterConfiguration[propName]; + var scope = desc.scope || 'model'; + var parts = undefined; - this.element = null; - this.snapshot = null; - this.assert = QUnit.config.current.assert; - } + if (scope === 'controller') { + parts = []; + } - AbstractTestCase.prototype.teardown = function teardown() {}; + var urlKey = desc.as || this.serializeQueryParamKey(propName); + var defaultValue = _emberMetal.get(controllerProto, propName); - AbstractTestCase.prototype.runTask = function runTask(callback) { - _emberMetal.run(callback); - }; + if (Array.isArray(defaultValue)) { + defaultValue = _emberRuntime.A(defaultValue.slice()); + } - AbstractTestCase.prototype.runTaskNext = function runTaskNext(callback) { - _emberMetal.run.next(callback); - }; + var type = desc.type || _emberRuntime.typeOf(defaultValue); - // The following methods require `this.element` to work + var defaultValueSerialized = this.serializeQueryParam(defaultValue, urlKey, type); + var scopedPropertyName = controllerName + ':' + propName; + var qp = { + undecoratedDefaultValue: _emberMetal.get(controllerProto, propName), + defaultValue: defaultValue, + serializedDefaultValue: defaultValueSerialized, + serializedValue: defaultValueSerialized, - AbstractTestCase.prototype.nthChild = function nthChild(n) { - var i = 0; - var node = this.element.firstChild; + type: type, + urlKey: urlKey, + prop: propName, + scopedPropertyName: scopedPropertyName, + controllerName: controllerName, + route: this, + parts: parts, // provided later when stashNames is called if 'model' scope + values: null, // provided later when setup is called. no idea why. + scope: scope + }; - while (node) { - if (!isMarker(node)) { - i++; + map[propName] = map[urlKey] = map[scopedPropertyName] = qp; + qps.push(qp); + propertyNames.push(propName); + } + + return { + qps: qps, + map: map, + propertyNames: propertyNames, + states: { + /* + Called when a query parameter changes in the URL, this route cares + about that query parameter, but the route is not currently + in the active route hierarchy. + */ + inactive: function (prop, value) { + var qp = map[prop]; + _this._qpChanged(prop, value, qp); + }, + /* + Called when a query parameter changes in the URL, this route cares + about that query parameter, and the route is currently + in the active route hierarchy. + */ + active: function (prop, value) { + var qp = map[prop]; + _this._qpChanged(prop, value, qp); + return _this._activeQPChanged(map[prop], value); + }, + /* + Called when a value of a query parameter this route handles changes in a controller + and the route is currently in the active route hierarchy. + */ + allowOverrides: function (prop, value) { + var qp = map[prop]; + _this._qpChanged(prop, value, qp); + return _this._updatingQPChanged(map[prop]); + } } + }; + }), - if (i > n) { - break; - } else { - node = node.nextSibling; + /** + @private + @property _names + */ + _names: null, + + /** + @private + @method _stashNames + */ + _stashNames: function (handlerInfo, dynamicParent) { + if (this._names) { + return; + } + var names = this._names = handlerInfo._names; + + if (!names.length) { + handlerInfo = dynamicParent; + names = handlerInfo && handlerInfo._names || []; + } + + var qps = _emberMetal.get(this, '_qp.qps'); + + var namePaths = new Array(names.length); + for (var a = 0; a < names.length; ++a) { + namePaths[a] = handlerInfo.name + '.' + names[a]; + } + + for (var i = 0; i < qps.length; ++i) { + var qp = qps[i]; + if (qp.scope === 'model') { + qp.parts = namePaths; } } + }, - return node; - }; + /** + @private + @property _activeQPChanged + */ + _activeQPChanged: function (qp, value) { + var router = this.router; + router._activeQPChanged(qp.scopedPropertyName, value); + }, - AbstractTestCase.prototype.$ = function $(sel) { - return sel ? _emberViews.jQuery(sel, this.element) : _emberViews.jQuery(this.element); - }; + /** + @private + @method _updatingQPChanged + */ + _updatingQPChanged: function (qp) { + var router = this.router; + router._updatingQPChanged(qp.urlKey); + }, + + mergedProperties: ['queryParams'], + + /** + Returns a hash containing the parameters of an ancestor route. + Example + ```app/router.js + // ... + Router.map(function() { + this.route('member', { path: ':name' }, function() { + this.route('interest', { path: ':interest' }); + }); + }); + ``` + ```app/routes/member.js + export default Ember.Route.extend({ + queryParams: { + memberQp: { refreshModel: true } + } + }); + ``` + ```app/routes/member/interest.js + export default Ember.Route.extend({ + queryParams: { + interestQp: { refreshModel: true } + }, + model() { + return this.paramsFor('member'); + } + }); + ``` + If we visit `/turing/maths?memberQp=member&interestQp=interest` the model for + the `member.interest` route is hash with: + * `name`: `turing` + * `memberQp`: `member` + @method paramsFor + @param {String} name + @return {Object} hash containing the parameters of the route `name` + @since 1.4.0 + @public + */ + paramsFor: function (name) { + var _this2 = this; - AbstractTestCase.prototype.textValue = function textValue() { - return this.$().text(); - }; + var route = _emberUtils.getOwner(this).lookup('route:' + name); - AbstractTestCase.prototype.takeSnapshot = function takeSnapshot() { - var snapshot = this.snapshot = []; + if (!route) { + return {}; + } - var node = this.element.firstChild; + var transition = this.router.router.activeTransition; + var state = transition ? transition.state : this.router.router.state; - while (node) { - if (!isMarker(node)) { - snapshot.push(node); - } + var fullName = route.fullRouteName; + var params = _emberUtils.assign({}, state.params[fullName]); + var queryParams = getQueryParamsFor(route, state); - node = node.nextSibling; - } + return Object.keys(queryParams).reduce(function (params, key) { + _emberMetal.assert('The route \'' + _this2.routeName + '\' has both a dynamic segment and query param with name \'' + key + '\'. Please rename one to avoid collisions.', !params[key]); + params[key] = queryParams[key]; + return params; + }, params); + }, - return snapshot; - }; + /** + Serializes the query parameter key + @method serializeQueryParamKey + @param {String} controllerPropertyName + @private + */ + serializeQueryParamKey: function (controllerPropertyName) { + return controllerPropertyName; + }, - AbstractTestCase.prototype.assertText = function assertText(text) { - this.assert.strictEqual(this.textValue(), text, '#qunit-fixture content should be: `' + text + '`'); - }; + /** + Serializes value of the query parameter based on defaultValueType + @method serializeQueryParam + @param {Object} value + @param {String} urlKey + @param {String} defaultValueType + @private + */ + serializeQueryParam: function (value, urlKey, defaultValueType) { + // urlKey isn't used here, but anyone overriding + // can use it to provide serialization specific + // to a certain query param. + return this.router._serializeQueryParam(value, defaultValueType); + }, - AbstractTestCase.prototype.assertInnerHTML = function assertInnerHTML(html) { - _internalTestHelpersEqualInnerHtml.default(this.element, html); - }; + /** + Deserializes value of the query parameter based on defaultValueType + @method deserializeQueryParam + @param {Object} value + @param {String} urlKey + @param {String} defaultValueType + @private + */ + deserializeQueryParam: function (value, urlKey, defaultValueType) { + // urlKey isn't used here, but anyone overriding + // can use it to provide deserialization specific + // to a certain query param. + return this.router._deserializeQueryParam(value, defaultValueType); + }, - AbstractTestCase.prototype.assertHTML = function assertHTML(html) { - _internalTestHelpersEqualTokens.default(this.element, html, '#qunit-fixture content should be: `' + html + '`'); - }; + /** + @private + @property _optionsForQueryParam + */ + _optionsForQueryParam: function (qp) { + return _emberMetal.get(this, 'queryParams.' + qp.urlKey) || _emberMetal.get(this, 'queryParams.' + qp.prop) || {}; + }, - AbstractTestCase.prototype.assertElement = function assertElement(node, _ref) { - var _ref$ElementType = _ref.ElementType; - var ElementType = _ref$ElementType === undefined ? HTMLElement : _ref$ElementType; - var tagName = _ref.tagName; - var _ref$attrs = _ref.attrs; - var attrs = _ref$attrs === undefined ? null : _ref$attrs; - var _ref$content = _ref.content; - var content = _ref$content === undefined ? null : _ref$content; + /** + A hook you can use to reset controller values either when the model + changes or the route is exiting. + ```app/routes/articles.js + import Ember from 'ember'; + export default Ember.Route.extend({ + resetController(controller, isExiting, transition) { + if (isExiting) { + controller.set('page', 1); + } + } + }); + ``` + @method resetController + @param {Controller} controller instance + @param {Boolean} isExiting + @param {Object} transition + @since 1.7.0 + @public + */ + resetController: K, - if (!(node instanceof ElementType)) { - throw new Error('Expecting a ' + ElementType.name + ', but got ' + node); - } + /** + @private + @method exit + */ + exit: function () { + this.deactivate(); + this.trigger('deactivate'); + this.teardownViews(); + }, - _internalTestHelpersMatchers.equalsElement(node, tagName, attrs, content); - }; + /** + @private + @method _reset + @since 1.7.0 + */ + _reset: function (isExiting, transition) { + var controller = this.controller; + controller._qpDelegate = _emberMetal.get(this, '_qp.states.inactive'); - AbstractTestCase.prototype.assertComponentElement = function assertComponentElement(node, _ref2) { - var _ref2$ElementType = _ref2.ElementType; - var ElementType = _ref2$ElementType === undefined ? HTMLElement : _ref2$ElementType; - var _ref2$tagName = _ref2.tagName; - var tagName = _ref2$tagName === undefined ? 'div' : _ref2$tagName; - var _ref2$attrs = _ref2.attrs; - var attrs = _ref2$attrs === undefined ? null : _ref2$attrs; - var _ref2$content = _ref2.content; - var content = _ref2$content === undefined ? null : _ref2$content; + this.resetController(controller, isExiting, transition); + }, - attrs = _emberUtils.assign({}, { id: _internalTestHelpersMatchers.regex(/^ember\d*$/), class: _internalTestHelpersMatchers.classes('ember-view') }, attrs || {}); - this.assertElement(node, { ElementType: ElementType, tagName: tagName, attrs: attrs, content: content }); - }; + /** + @private + @method enter + */ + enter: function () { + this.connections = []; + this.activate(); + this.trigger('activate'); + }, - AbstractTestCase.prototype.assertSameNode = function assertSameNode(actual, expected) { - this.assert.strictEqual(actual, expected, 'DOM node stability'); - }; + /** + The name of the template to use by default when rendering this routes + template. + ```app/routes/posts/list.js + import Ember from 'ember'; + export default Ember.Route.extend({ + templateName: 'posts/list' + }); + ``` + ```app/routes/posts/index.js + import PostsList from '../posts/list'; + export default PostsList.extend(); + ``` + ```app/routes/posts/archived.js + import PostsList from '../posts/list'; + export default PostsList.extend(); + ``` + @property templateName + @type String + @default null + @since 1.4.0 + @public + */ + templateName: null, - AbstractTestCase.prototype.assertInvariants = function assertInvariants(oldSnapshot, newSnapshot) { - oldSnapshot = oldSnapshot || this.snapshot; - newSnapshot = newSnapshot || this.takeSnapshot(); + /** + The name of the controller to associate with this route. + By default, Ember will lookup a route's controller that matches the name + of the route (i.e. `App.PostController` for `App.PostRoute`). However, + if you would like to define a specific controller to use, you can do so + using this property. + This is useful in many ways, as the controller specified will be: + * passed to the `setupController` method. + * used as the controller for the template being rendered by the route. + * returned from a call to `controllerFor` for the route. + @property controllerName + @type String + @default null + @since 1.4.0 + @public + */ + controllerName: null, - this.assert.strictEqual(newSnapshot.length, oldSnapshot.length, 'Same number of nodes'); + /** + The `willTransition` action is fired at the beginning of any + attempted transition with a `Transition` object as the sole + argument. This action can be used for aborting, redirecting, + or decorating the transition from the currently active routes. + A good example is preventing navigation when a form is + half-filled out: + ```app/routes/contact-form.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + willTransition(transition) { + if (this.controller.get('userHasEnteredData')) { + this.controller.displayNavigationConfirm(); + transition.abort(); + } + } + } + }); + ``` + You can also redirect elsewhere by calling + `this.transitionTo('elsewhere')` from within `willTransition`. + Note that `willTransition` will not be fired for the + redirecting `transitionTo`, since `willTransition` doesn't + fire when there is already a transition underway. If you want + subsequent `willTransition` actions to fire for the redirecting + transition, you must first explicitly call + `transition.abort()`. + To allow the `willTransition` event to continue bubbling to the parent + route, use `return true;`. When the `willTransition` method has a + return value of `true` then the parent route's `willTransition` method + will be fired, enabling "bubbling" behavior for the event. + @event willTransition + @param {Transition} transition + @since 1.0.0 + @public + */ - for (var i = 0; i < oldSnapshot.length; i++) { - this.assertSameNode(newSnapshot[i], oldSnapshot[i]); - } - }; + /** + The `didTransition` action is fired after a transition has + successfully been completed. This occurs after the normal model + hooks (`beforeModel`, `model`, `afterModel`, `setupController`) + have resolved. The `didTransition` action has no arguments, + however, it can be useful for tracking page views or resetting + state on the controller. + ```app/routes/login.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + didTransition() { + this.controller.get('errors.base').clear(); + return true; // Bubble the didTransition event + } + } + }); + ``` + @event didTransition + @since 1.2.0 + @public + */ - AbstractTestCase.prototype.assertPartialInvariants = function assertPartialInvariants(start, end) { - this.assertInvariants(this.snapshot, this.takeSnapshot().slice(start, end)); - }; + /** + The `loading` action is fired on the route when a route's `model` + hook returns a promise that is not already resolved. The current + `Transition` object is the first parameter and the route that + triggered the loading event is the second parameter. + ```app/routes/application.js + export default Ember.Route.extend({ + actions: { + loading(transition, route) { + let controller = this.controllerFor('foo'); + controller.set('currentlyLoading', true); + transition.finally(function() { + controller.set('currentlyLoading', false); + }); + } + } + }); + ``` + @event loading + @param {Transition} transition + @param {Ember.Route} route The route that triggered the loading event + @since 1.2.0 + @public + */ - AbstractTestCase.prototype.assertStableRerender = function assertStableRerender() { - var _this = this; + /** + When attempting to transition into a route, any of the hooks + may return a promise that rejects, at which point an `error` + action will be fired on the partially-entered routes, allowing + for per-route error handling logic, or shared error handling + logic defined on a parent route. + Here is an example of an error handler that will be invoked + for rejected promises from the various hooks on the route, + as well as any unhandled errors from child routes: + ```app/routes/admin.js + import Ember from 'ember'; + export default Ember.Route.extend({ + beforeModel() { + return Ember.RSVP.reject('bad things!'); + }, + actions: { + error(error, transition) { + // Assuming we got here due to the error in `beforeModel`, + // we can expect that error === "bad things!", + // but a promise model rejecting would also + // call this hook, as would any errors encountered + // in `afterModel`. + // The `error` hook is also provided the failed + // `transition`, which can be stored and later + // `.retry()`d if desired. + this.transitionTo('login'); + } + } + }); + ``` + `error` actions that bubble up all the way to `ApplicationRoute` + will fire a default error handler that logs the error. You can + specify your own global default error handler by overriding the + `error` handler on `ApplicationRoute`: + ```app/routes/application.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + error(error, transition) { + this.controllerFor('banner').displayError(error.message); + } + } + }); + ``` + @event error + @param {Error} error + @param {Transition} transition + @since 1.0.0 + @public + */ - this.takeSnapshot(); - this.runTask(function () { - return _this.rerender(); + /** + This event is triggered when the router enters the route. It is + not executed when the model for the route changes. + ```app/routes/application.js + import Ember from 'ember'; + export default Ember.Route.extend({ + collectAnalytics: Ember.on('activate', function(){ + collectAnalytics(); + }) }); - this.assertInvariants(); - }; + ``` + @event activate + @since 1.9.0 + @public + */ - babelHelpers.createClass(AbstractTestCase, [{ - key: 'firstChild', - get: function () { - return this.nthChild(0); - } - }, { - key: 'nodesCount', - get: function () { - var count = 0; - var node = this.element.firstChild; + /** + This event is triggered when the router completely exits this + route. It is not executed when the model for the route changes. + ```app/routes/index.js + import Ember from 'ember'; + export default Ember.Route.extend({ + trackPageLeaveAnalytics: Ember.on('deactivate', function(){ + trackPageLeaveAnalytics(); + }) + }); + ``` + @event deactivate + @since 1.9.0 + @public + */ - while (node) { - if (!isMarker(node)) { - count++; + /** + The controller associated with this route. + Example + ```app/routes/form.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + willTransition(transition) { + if (this.controller.get('userHasEnteredData') && + !confirm('Are you sure you want to abandon progress?')) { + transition.abort(); + } else { + // Bubble the `willTransition` action so that + // parent routes can decide whether or not to abort. + return true; + } } - - node = node.nextSibling; } + }); + ``` + @property controller + @type Ember.Controller + @since 1.6.0 + @public + */ - return count; - } - }]); - return AbstractTestCase; - })(); - - exports.default = AbstractTestCase; -}); -enifed('internal-test-helpers/test-cases/application', ['exports', 'internal-test-helpers/test-cases/abstract-application'], function (exports, _internalTestHelpersTestCasesAbstractApplication) { - 'use strict'; + actions: { - var ApplicationTestCase = (function (_AbstractApplicationTestCase) { - babelHelpers.inherits(ApplicationTestCase, _AbstractApplicationTestCase); + /** + This action is called when one or more query params have changed. Bubbles. + @method queryParamsDidChange + @param changed {Object} Keys are names of query params that have changed. + @param totalPresent {Object} Keys are names of query params that are currently set. + @param removed {Object} Keys are names of query params that have been removed. + @returns {boolean} + @private + */ + queryParamsDidChange: function (changed, totalPresent, removed) { + var qpMap = _emberMetal.get(this, '_qp').map; - function ApplicationTestCase() { - babelHelpers.classCallCheck(this, ApplicationTestCase); + var totalChanged = Object.keys(changed).concat(Object.keys(removed)); + for (var i = 0; i < totalChanged.length; ++i) { + var qp = qpMap[totalChanged[i]]; + if (qp && _emberMetal.get(this._optionsForQueryParam(qp), 'refreshModel') && this.router.currentState) { + this.refresh(); + break; + } + } - _AbstractApplicationTestCase.apply(this, arguments); - } + return true; + }, - return ApplicationTestCase; - })(_internalTestHelpersTestCasesAbstractApplication.default); + finalizeQueryParamChange: function (params, finalParams, transition) { + if (this.fullRouteName !== 'application') { + return true; + } - exports.default = ApplicationTestCase; -}); -enifed('internal-test-helpers/test-cases/query-param', ['exports', 'ember-runtime', 'ember-routing', 'ember-metal', 'internal-test-helpers/test-cases/application'], function (exports, _emberRuntime, _emberRouting, _emberMetal, _internalTestHelpersTestCasesApplication) { - 'use strict'; + // Transition object is absent for intermediate transitions. + if (!transition) { + return; + } - var QueryParamTestCase = (function (_ApplicationTestCase) { - babelHelpers.inherits(QueryParamTestCase, _ApplicationTestCase); + var handlerInfos = transition.state.handlerInfos; + var router = this.router; + var qpMeta = router._queryParamsFor(handlerInfos); + var changes = router._qpUpdates; + var replaceUrl = undefined; - function QueryParamTestCase() { - babelHelpers.classCallCheck(this, QueryParamTestCase); + _emberRoutingUtils.stashParamNames(router, handlerInfos); - _ApplicationTestCase.call(this); + for (var i = 0; i < qpMeta.qps.length; ++i) { + var qp = qpMeta.qps[i]; + var route = qp.route; + var controller = route.controller; + var presentKey = qp.urlKey in params && qp.urlKey; - var testCase = this; - testCase.expectedPushURL = null; - testCase.expectedReplaceURL = null; - this.application.register('location:test', _emberRouting.NoneLocation.extend({ - setURL: function (path) { - if (testCase.expectedReplaceURL) { - testCase.assert.ok(false, 'pushState occurred but a replaceState was expected'); + // Do a reverse lookup to see if the changed query + // param URL key corresponds to a QP property on + // this controller. + var value = undefined, + svalue = undefined; + if (changes && qp.urlKey in changes) { + // Value updated in/before setupController + value = _emberMetal.get(controller, qp.prop); + svalue = route.serializeQueryParam(value, qp.urlKey, qp.type); + } else { + if (presentKey) { + svalue = params[presentKey]; + value = route.deserializeQueryParam(svalue, qp.urlKey, qp.type); + } else { + // No QP provided; use default value. + svalue = qp.serializedDefaultValue; + value = copyDefaultValue(qp.defaultValue); + } } - if (testCase.expectedPushURL) { - testCase.assert.equal(path, testCase.expectedPushURL, 'an expected pushState occurred'); - testCase.expectedPushURL = null; + controller._qpDelegate = _emberMetal.get(route, '_qp.states.inactive'); + + var thisQueryParamChanged = svalue !== qp.serializedValue; + if (thisQueryParamChanged) { + if (transition.queryParamsOnly && replaceUrl !== false) { + var options = route._optionsForQueryParam(qp); + var replaceConfigValue = _emberMetal.get(options, 'replace'); + if (replaceConfigValue) { + replaceUrl = true; + } else if (replaceConfigValue === false) { + // Explicit pushState wins over any other replaceStates. + replaceUrl = false; + } + } + + _emberMetal.set(controller, qp.prop, value); } - this.set('path', path); - }, - - replaceURL: function (path) { - if (testCase.expectedPushURL) { - testCase.assert.ok(false, 'replaceState occurred but a pushState was expected'); - } + // Stash current serialized value of controller. + qp.serializedValue = svalue; - if (testCase.expectedReplaceURL) { - testCase.assert.equal(path, testCase.expectedReplaceURL, 'an expected replaceState occurred'); - testCase.expectedReplaceURL = null; + var thisQueryParamHasDefaultValue = qp.serializedDefaultValue === svalue; + if (!thisQueryParamHasDefaultValue) { + finalParams.push({ + value: svalue, + visible: true, + key: presentKey || qp.urlKey + }); } - - this.set('path', path); } - })); - } - - QueryParamTestCase.prototype.visitAndAssert = function visitAndAssert(path) { - var _this = this; - - return this.visit.apply(this, arguments).then(function () { - _this.assertCurrentPath(path); - }); - }; - - QueryParamTestCase.prototype.getController = function getController(name) { - return this.applicationInstance.lookup('controller:' + name); - }; - QueryParamTestCase.prototype.getRoute = function getRoute(name) { - return this.applicationInstance.lookup('route:' + name); - }; + if (replaceUrl) { + transition.method('replace'); + } - QueryParamTestCase.prototype.setAndFlush = function setAndFlush(obj, prop, value) { - return _emberMetal.run(obj, 'set', prop, value); - }; + qpMeta.qps.forEach(function (qp) { + var routeQpMeta = _emberMetal.get(qp.route, '_qp'); + var finalizedController = qp.route.controller; + finalizedController._qpDelegate = _emberMetal.get(routeQpMeta, 'states.active'); + }); - QueryParamTestCase.prototype.assertCurrentPath = function assertCurrentPath(path) { - var message = arguments.length <= 1 || arguments[1] === undefined ? 'current path equals \'' + path + '\'' : arguments[1]; - return (function () { - this.assert.equal(this.appRouter.get('location.path'), path, message); - }).apply(this, arguments); - }; + router._qpUpdates = null; + } + }, /** - Sets up a Controller for a given route with a single query param and default - value. Can optionally extend the controller with an object. - @public - @method setSingleQPController + This hook is executed when the router completely exits this route. It is + not executed when the model for the route changes. + @method deactivate + @since 1.0.0 + @public */ - - QueryParamTestCase.prototype.setSingleQPController = function setSingleQPController(routeName) { - var param = arguments.length <= 1 || arguments[1] === undefined ? 'foo' : arguments[1]; - var defaultValue = arguments.length <= 2 || arguments[2] === undefined ? 'bar' : arguments[2]; - - var _Controller$extend; - - var options = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3]; - - this.registerController(routeName, _emberRuntime.Controller.extend((_Controller$extend = { - queryParams: [param] - }, _Controller$extend[param] = defaultValue, _Controller$extend), options)); - }; + deactivate: K, /** - Sets up a Controller for a given route with a custom property/url key mapping. - @public - @method setMappedQPController + This hook is executed when the router enters the route. It is not executed + when the model for the route changes. + @method activate + @since 1.0.0 + @public */ + activate: K, - QueryParamTestCase.prototype.setMappedQPController = function setMappedQPController(routeName) { - var prop = arguments.length <= 1 || arguments[1] === undefined ? 'page' : arguments[1]; - var urlKey = arguments.length <= 2 || arguments[2] === undefined ? 'parentPage' : arguments[2]; - var defaultValue = arguments.length <= 3 || arguments[3] === undefined ? 1 : arguments[3]; + /** + Transition the application into another route. The route may + be either a single route or route path: + ```javascript + this.transitionTo('blogPosts'); + this.transitionTo('blogPosts.recentEntries'); + ``` + Optionally supply a model for the route in question. The model + will be serialized into the URL using the `serialize` hook of + the route: + ```javascript + this.transitionTo('blogPost', aPost); + ``` + If a literal is passed (such as a number or a string), it will + be treated as an identifier instead. In this case, the `model` + hook of the route will be triggered: + ```javascript + this.transitionTo('blogPost', 1); + ``` + Multiple models will be applied last to first recursively up the + route tree. + ```app/routes.js + // ... + Router.map(function() { + this.route('blogPost', { path:':blogPostId' }, function() { + this.route('blogComment', { path: ':blogCommentId' }); + }); + }); + export default Router; + ``` + ```javascript + this.transitionTo('blogComment', aPost, aComment); + this.transitionTo('blogComment', 1, 13); + ``` + It is also possible to pass a URL (a string that starts with a + `/`). This is intended for testing and debugging purposes and + should rarely be used in production code. + ```javascript + this.transitionTo('/'); + this.transitionTo('/blog/post/1/comment/13'); + this.transitionTo('/blog/posts?sort=title'); + ``` + An options hash with a `queryParams` property may be provided as + the final argument to add query parameters to the destination URL. + ```javascript + this.transitionTo('blogPost', 1, { + queryParams: { showComments: 'true' } + }); + // if you just want to transition the query parameters without changing the route + this.transitionTo({ queryParams: { sort: 'date' } }); + ``` + See also [replaceWith](#method_replaceWith). + Simple Transition Example + ```app/routes.js + // ... + Router.map(function() { + this.route('index'); + this.route('secret'); + this.route('fourOhFour', { path: '*:' }); + }); + export default Router; + ``` + ```app/routes/index.js + import Ember from 'ember': + export Ember.Route.extend({ + actions: { + moveToSecret(context) { + if (authorized()) { + this.transitionTo('secret', context); + } else { + this.transitionTo('fourOhFour'); + } + } + } + }); + ``` + Transition to a nested route + ```app/router.js + // ... + Router.map(function() { + this.route('articles', { path: '/articles' }, function() { + this.route('new'); + }); + }); + export default Router; + ``` + ```app/routes/index.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + transitionToNewArticle() { + this.transitionTo('articles.new'); + } + } + }); + ``` + Multiple Models Example + ```app/router.js + // ... + Router.map(function() { + this.route('index'); + this.route('breakfast', { path: ':breakfastId' }, function() { + this.route('cereal', { path: ':cerealId' }); + }); + }); + export default Router; + ``` + ```app/routes/index.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + moveToChocolateCereal() { + let cereal = { cerealId: 'ChocolateYumminess' }; + let breakfast = { breakfastId: 'CerealAndMilk' }; + this.transitionTo('breakfast.cereal', breakfast, cereal); + } + } + }); + ``` + Nested Route with Query String Example + ```app/routes.js + // ... + Router.map(function() { + this.route('fruits', function() { + this.route('apples'); + }); + }); + export default Router; + ``` + ```app/routes/index.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + transitionToApples() { + this.transitionTo('fruits.apples', { queryParams: { color: 'red' } }); + } + } + }); + ``` + @method transitionTo + @param {String} name the name of the route or a URL + @param {...Object} models the model(s) or identifier(s) to be used while + transitioning to the route. + @param {Object} [options] optional hash with a queryParams property + containing a mapping of query parameters + @return {Transition} the transition object associated with this + attempted transition + @since 1.0.0 + @public + */ + transitionTo: function (name, context) { + var router = this.router; + return router.transitionTo.apply(router, _emberRoutingUtils.prefixRouteNameArg(this, arguments)); + }, - var _queryParams, _Controller$extend2; + /** + Perform a synchronous transition into another route without attempting + to resolve promises, update the URL, or abort any currently active + asynchronous transitions (i.e. regular transitions caused by + `transitionTo` or URL changes). + This method is handy for performing intermediate transitions on the + way to a final destination route, and is called internally by the + default implementations of the `error` and `loading` handlers. + @method intermediateTransitionTo + @param {String} name the name of the route + @param {...Object} models the model(s) to be used while transitioning + to the route. + @since 1.2.0 + @public + */ + intermediateTransitionTo: function () { + var router = this.router; + router.intermediateTransitionTo.apply(router, _emberRoutingUtils.prefixRouteNameArg(this, arguments)); + }, - var options = arguments.length <= 4 || arguments[4] === undefined ? {} : arguments[4]; + /** + Refresh the model on this route and any child routes, firing the + `beforeModel`, `model`, and `afterModel` hooks in a similar fashion + to how routes are entered when transitioning in from other route. + The current route params (e.g. `article_id`) will be passed in + to the respective model hooks, and if a different model is returned, + `setupController` and associated route hooks will re-fire as well. + An example usage of this method is re-querying the server for the + latest information using the same parameters as when the route + was first entered. + Note that this will cause `model` hooks to fire even on routes + that were provided a model object when the route was initially + entered. + @method refresh + @return {Transition} the transition object associated with this + attempted transition + @since 1.4.0 + @public + */ + refresh: function () { + return this.router.router.refresh(this); + }, - this.registerController(routeName, _emberRuntime.Controller.extend((_Controller$extend2 = { - queryParams: (_queryParams = {}, _queryParams[prop] = urlKey, _queryParams) - }, _Controller$extend2[prop] = defaultValue, _Controller$extend2), options)); - }; + /** + Transition into another route while replacing the current URL, if possible. + This will replace the current history entry instead of adding a new one. + Beside that, it is identical to `transitionTo` in all other respects. See + 'transitionTo' for additional information regarding multiple models. + Example + ```app/router.js + // ... + Router.map(function() { + this.route('index'); + this.route('secret'); + }); + export default Router; + ``` + ```app/routes/secret.js + import Ember from 'ember'; + export default Ember.Route.extend({ + afterModel() { + if (!authorized()){ + this.replaceWith('index'); + } + } + }); + ``` + @method replaceWith + @param {String} name the name of the route or a URL + @param {...Object} models the model(s) or identifier(s) to be used while + transitioning to the route. + @return {Transition} the transition object associated with this + attempted transition + @since 1.0.0 + @public + */ + replaceWith: function () { + var router = this.router; + return router.replaceWith.apply(router, _emberRoutingUtils.prefixRouteNameArg(this, arguments)); + }, - babelHelpers.createClass(QueryParamTestCase, [{ - key: 'routerOptions', - get: function () { - return { - location: 'test' - }; + /** + Sends an action to the router, which will delegate it to the currently + active route hierarchy per the bubbling rules explained under `actions`. + Example + ```app/router.js + // ... + Router.map(function() { + this.route('index'); + }); + export default Router; + ``` + ```app/routes/application.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + track(arg) { + console.log(arg, 'was clicked'); + } + } + }); + ``` + ```app/routes/index.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + trackIfDebug(arg) { + if (debug) { + this.send('track', arg); + } + } + } + }); + ``` + @method send + @param {String} name the name of the action to trigger + @param {...*} args + @since 1.0.0 + @public + */ + send: function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } - }]); - return QueryParamTestCase; - })(_internalTestHelpersTestCasesApplication.default); - - exports.default = QueryParamTestCase; -}); -enifed('internal-test-helpers/test-cases/rendering', ['exports', 'ember-views', 'internal-test-helpers/test-cases/abstract-rendering'], function (exports, _emberViews, _internalTestHelpersTestCasesAbstractRendering) { - 'use strict'; - - var RenderingTestCase = (function (_AbstractRenderingTestCase) { - babelHelpers.inherits(RenderingTestCase, _AbstractRenderingTestCase); - - function RenderingTestCase() { - babelHelpers.classCallCheck(this, RenderingTestCase); - - _AbstractRenderingTestCase.call(this); - var owner = this.owner; - - this.env = owner.lookup('service:-glimmer-environment'); - owner.register('component-lookup:main', _emberViews.ComponentLookup); - owner.registerOptionsForType('helper', { instantiate: false }); - owner.registerOptionsForType('component', { singleton: false }); - } - - return RenderingTestCase; - })(_internalTestHelpersTestCasesAbstractRendering.default); - - exports.default = RenderingTestCase; -}); -enifed('internal-test-helpers/test-groups', ['exports', 'ember-environment', 'ember-metal'], function (exports, _emberEnvironment, _emberMetal) { - 'use strict'; - - exports.testBoth = testBoth; - exports.testWithDefault = testWithDefault; - - // used by unit tests to test both accessor mode and non-accessor mode - - function testBoth(testname, callback) { - function emberget(x, y) { - return _emberMetal.get(x, y); - } - function emberset(x, y, z) { - return _emberMetal.set(x, y, z); - } - function aget(x, y) { - return x[y]; - } - function aset(x, y, z) { - return x[y] = z; - } - QUnit.test(testname + ' using getFromEmberMetal()/Ember.set()', function () { - callback(emberget, emberset); - }); + if (this.router && this.router.router || !_emberMetal.isTesting()) { + var _router; - QUnit.test(testname + ' using accessors', function () { - if (_emberEnvironment.ENV.USES_ACCESSORS) { - callback(aget, aset); + (_router = this.router).send.apply(_router, args); } else { - ok('SKIPPING ACCESSORS'); + var _name2 = args[0]; + args = slice.call(args, 1); + var action = this.actions[_name2]; + if (action) { + return this.actions[_name2].apply(this, args); + } } - }); - } - - function testWithDefault(testname, callback) { - function emberget(x, y) { - return _emberMetal.get(x, y); - } - function embergetwithdefault(x, y, z) { - return _emberMetal.getWithDefault(x, y, z); - } - function getwithdefault(x, y, z) { - return x.getWithDefault(y, z); - } - function emberset(x, y, z) { - return _emberMetal.set(x, y, z); - } - function aget(x, y) { - return x[y]; - } - function aset(x, y, z) { - return x[y] = z; - } - - QUnit.test(testname + ' using obj.get()', function () { - callback(emberget, emberset); - }); + }, - QUnit.test(testname + ' using obj.getWithDefault()', function () { - callback(getwithdefault, emberset); - }); + /** + This hook is the entry point for router.js + @private + @method setup + */ + setup: function (context, transition) { + var _this3 = this; - QUnit.test(testname + ' using getFromEmberMetal()', function () { - callback(emberget, emberset); - }); + var controller = undefined; - QUnit.test(testname + ' using Ember.getWithDefault()', function () { - callback(embergetwithdefault, emberset); - }); + var controllerName = this.controllerName || this.routeName; + var definedController = this.controllerFor(controllerName, true); - QUnit.test(testname + ' using accessors', function () { - if (_emberEnvironment.ENV.USES_ACCESSORS) { - callback(aget, aset); + if (!definedController) { + controller = this.generateController(controllerName); } else { - ok('SKIPPING ACCESSORS'); + controller = definedController; } - }); - } -}); -enifed('glimmer-node/index', ['exports', 'glimmer-node/lib/node-dom-helper'], function (exports, _glimmerNodeLibNodeDomHelper) { - 'use strict'; - exports.NodeDOMTreeConstruction = _glimmerNodeLibNodeDomHelper.default; -}); + // Assign the route's controller so that it can more easily be + // referenced in action handlers. Side effects. Side effects everywhere. + if (!this.controller) { + var propNames = _emberMetal.get(this, '_qp.propertyNames'); + addQueryParamsObservers(controller, propNames); + this.controller = controller; + } -enifed('glimmer-node/lib/node-dom-helper', ['exports', 'glimmer-runtime'], function (exports, _glimmerRuntime) { - 'use strict'; + var queryParams = _emberMetal.get(this, '_qp'); - var NodeDOMTreeConstruction = (function (_DOMTreeConstruction) { - babelHelpers.inherits(NodeDOMTreeConstruction, _DOMTreeConstruction); + var states = queryParams.states; - function NodeDOMTreeConstruction(doc) { - _DOMTreeConstruction.call(this, doc); - } + controller._qpDelegate = states.allowOverrides; - // override to prevent usage of `this.document` until after the constructor + if (transition) { + (function () { + // Update the model dep values used to calculate cache keys. + _emberRoutingUtils.stashParamNames(_this3.router, transition.state.handlerInfos); - NodeDOMTreeConstruction.prototype.setupUselessElement = function setupUselessElement() {}; + var params = transition.params; + var allParams = queryParams.propertyNames; + var cache = _this3._bucketCache; - NodeDOMTreeConstruction.prototype.insertHTMLBefore = function insertHTMLBefore(parent, html, reference) { - var prev = reference ? reference.previousSibling : parent.lastChild; - var raw = this.document.createRawHTMLSection(html); - parent.insertBefore(raw, reference); - var first = prev ? prev.nextSibling : parent.firstChild; - var last = reference ? reference.previousSibling : parent.lastChild; - return new _glimmerRuntime.ConcreteBounds(parent, first, last); - }; + allParams.forEach(function (prop) { + var aQp = queryParams.map[prop]; - // override to avoid SVG detection/work when in node (this is not needed in SSR) + aQp.values = params; + var cacheKey = _emberRoutingUtils.calculateCacheKey(aQp.route.fullRouteName, aQp.parts, aQp.values); - NodeDOMTreeConstruction.prototype.createElement = function createElement(tag) { - return this.document.createElement(tag); - }; + if (cache) { + var value = cache.lookup(cacheKey, prop, aQp.undecoratedDefaultValue); + _emberMetal.set(controller, prop, value); + } + }); + })(); + } - // override to avoid namespace shenanigans when in node (this is not needed in SSR) + if (transition) { + var qpValues = getQueryParamsFor(this, transition.state); + controller.setProperties(qpValues); + } - NodeDOMTreeConstruction.prototype.setAttribute = function setAttribute(element, name, value) { - element.setAttribute(name, value); - }; + this.setupController(controller, context, transition); - return NodeDOMTreeConstruction; - })(_glimmerRuntime.DOMTreeConstruction); + if (this._environment.options.shouldRender) { + this.renderTemplate(controller, context); + } + }, - exports.default = NodeDOMTreeConstruction; -}); + /* + 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 + value in the cache so if this route becomes active, the cache value has been updated. + */ + _qpChanged: function (prop, value, qp) { + if (!qp) { + return; + } -enifed('glimmer-reference/index', ['exports', 'glimmer-reference/lib/reference', 'glimmer-reference/lib/const', 'glimmer-reference/lib/validators', 'glimmer-reference/lib/utils', 'glimmer-reference/lib/iterable'], function (exports, _glimmerReferenceLibReference, _glimmerReferenceLibConst, _glimmerReferenceLibValidators, _glimmerReferenceLibUtils, _glimmerReferenceLibIterable) { - 'use strict'; + var cacheKey = _emberRoutingUtils.calculateCacheKey(qp.route.fullRouteName, qp.parts, qp.values); - exports.BasicReference = _glimmerReferenceLibReference.Reference; - exports.BasicPathReference = _glimmerReferenceLibReference.PathReference; - exports.ConstReference = _glimmerReferenceLibConst.ConstReference; - exports.isConst = _glimmerReferenceLibConst.isConst; - babelHelpers.defaults(exports, babelHelpers.interopExportWildcard(_glimmerReferenceLibValidators, babelHelpers.defaults)); - exports.Reference = _glimmerReferenceLibValidators.VersionedReference; - exports.PathReference = _glimmerReferenceLibValidators.VersionedPathReference; - exports.referenceFromParts = _glimmerReferenceLibUtils.referenceFromParts; - exports.IterationItem = _glimmerReferenceLibIterable.IterationItem; - exports.Iterator = _glimmerReferenceLibIterable.Iterator; - exports.Iterable = _glimmerReferenceLibIterable.Iterable; - exports.OpaqueIterator = _glimmerReferenceLibIterable.OpaqueIterator; - exports.OpaqueIterable = _glimmerReferenceLibIterable.OpaqueIterable; - exports.AbstractIterator = _glimmerReferenceLibIterable.AbstractIterator; - exports.AbstractIterable = _glimmerReferenceLibIterable.AbstractIterable; - exports.IterationArtifacts = _glimmerReferenceLibIterable.IterationArtifacts; - exports.ReferenceIterator = _glimmerReferenceLibIterable.ReferenceIterator; - exports.IteratorSynchronizer = _glimmerReferenceLibIterable.IteratorSynchronizer; - exports.IteratorSynchronizerDelegate = _glimmerReferenceLibIterable.IteratorSynchronizerDelegate; -}); - -enifed('glimmer-reference/lib/const', ['exports', 'glimmer-reference/lib/validators'], function (exports, _glimmerReferenceLibValidators) { - 'use strict'; + // Update model-dep cache + var cache = this._bucketCache; + if (cache) { + cache.stash(cacheKey, prop, value); + } + }, - exports.isConst = isConst; + /** + This hook is the first of the route entry validation hooks + called when an attempt is made to transition into a route + or one of its children. It is called before `model` and + `afterModel`, and is appropriate for cases when: + 1) A decision can be made to redirect elsewhere without + needing to resolve the model first. + 2) Any async operations need to occur first before the + model is attempted to be resolved. + This hook is provided the current `transition` attempt + as a parameter, which can be used to `.abort()` the transition, + save it for a later `.retry()`, or retrieve values set + on it from a previous hook. You can also just call + `this.transitionTo` to another route to implicitly + abort the `transition`. + You can return a promise from this hook to pause the + transition until the promise resolves (or rejects). This could + be useful, for instance, for retrieving async code from + the server that is required to enter a route. + @method beforeModel + @param {Transition} transition + @return {Promise} if the value returned from this hook is + a promise, the transition will pause until the transition + resolves. Otherwise, non-promise return values are not + utilized in any way. + @since 1.0.0 + @public + */ + beforeModel: K, - var ConstReference = (function () { - function ConstReference(inner) { - this.inner = inner; - this.tag = _glimmerReferenceLibValidators.CONSTANT_TAG; + /** + This hook is called after this route's model has resolved. + It follows identical async/promise semantics to `beforeModel` + but is provided the route's resolved model in addition to + the `transition`, and is therefore suited to performing + logic that can only take place after the model has already + resolved. + ```app/routes/posts.js + import Ember from 'ember'; + export default Ember.Route.extend({ + afterModel(posts, transition) { + if (posts.get('length') === 1) { + this.transitionTo('post.show', posts.get('firstObject')); + } } + }); + ``` + Refer to documentation for `beforeModel` for a description + of transition-pausing semantics when a promise is returned + from this hook. + @method afterModel + @param {Object} resolvedModel the value returned from `model`, + or its resolved value if it was a promise + @param {Transition} transition + @return {Promise} if the value returned from this hook is + a promise, the transition will pause until the transition + resolves. Otherwise, non-promise return values are not + utilized in any way. + @since 1.0.0 + @public + */ + afterModel: K, - ConstReference.prototype.value = function value() { - return this.inner; - }; - - return ConstReference; - })(); + /** + A hook you can implement to optionally redirect to another route. + If you call `this.transitionTo` from inside of this hook, this route + will not be entered in favor of the other hook. + `redirect` and `afterModel` behave very similarly and are + called almost at the same time, but they have an important + distinction in the case that, from one of these hooks, a + redirect into a child route of this route occurs: redirects + from `afterModel` essentially invalidate the current attempt + to enter this route, and will result in this route's `beforeModel`, + `model`, and `afterModel` hooks being fired again within + the new, redirecting transition. Redirects that occur within + the `redirect` hook, on the other hand, will _not_ cause + these hooks to be fired again the second time around; in + other words, by the time the `redirect` hook has been called, + both the resolved model and attempted entry into this route + are considered to be fully validated. + @method redirect + @param {Object} model the model for this route + @param {Transition} transition the transition object associated with the current transition + @since 1.0.0 + @public + */ + redirect: K, - exports.ConstReference = ConstReference; + /** + Called when the context is changed by router.js. + @private + @method contextDidChange + */ + contextDidChange: function () { + this.currentModel = this.context; + }, - function isConst(reference) { - return reference.tag === _glimmerReferenceLibValidators.CONSTANT_TAG; - } -}); + /** + A hook you can implement to convert the URL into the model for + this route. + ```app/router.js + // ... + Router.map(function() { + this.route('post', { path: '/posts/:post_id' }); + }); + export default Router; + ``` + The model for the `post` route is `store.findRecord('post', params.post_id)`. + By default, if your route has a dynamic segment ending in `_id`: + * The model class is determined from the segment (`post_id`'s + class is `App.Post`) + * The find method is called on the model class with the value of + the dynamic segment. + Note that for routes with dynamic segments, this hook is not always + executed. If the route is entered through a transition (e.g. when + using the `link-to` Handlebars helper or the `transitionTo` method + of routes), and a model context is already provided this hook + is not called. + A model context does not include a primitive string or number, + which does cause the model hook to be called. + Routes without dynamic segments will always execute the model hook. + ```javascript + // no dynamic segment, model hook always called + this.transitionTo('posts'); + // model passed in, so model hook not called + thePost = store.findRecord('post', 1); + this.transitionTo('post', thePost); + // integer passed in, model hook is called + this.transitionTo('post', 1); + // model id passed in, model hook is called + // useful for forcing the hook to execute + thePost = store.findRecord('post', 1); + this.transitionTo('post', thePost.id); + ``` + This hook follows the asynchronous/promise semantics + described in the documentation for `beforeModel`. In particular, + if a promise returned from `model` fails, the error will be + handled by the `error` hook on `Ember.Route`. + Example + ```app/routes/post.js + import Ember from 'ember'; + export default Ember.Route.extend({ + model(params) { + return this.store.findRecord('post', params.post_id); + } + }); + ``` + @method model + @param {Object} params the parameters extracted from the URL + @param {Transition} transition + @return {Object|Promise} the model for this route. If + a promise is returned, the transition will pause until + the promise resolves, and the resolved value of the promise + will be used as the model for this route. + @since 1.0.0 + @public + */ + model: function (params, transition) { + var name = undefined, + sawParams = undefined, + value = undefined; + var queryParams = _emberMetal.get(this, '_qp.map'); -enifed("glimmer-reference/lib/iterable", ["exports", "glimmer-util"], function (exports, _glimmerUtil) { - "use strict"; + for (var prop in params) { + if (prop === 'queryParams' || queryParams && prop in queryParams) { + continue; + } - var ListItem = (function (_ListNode) { - babelHelpers.inherits(ListItem, _ListNode); + var match = prop.match(/^(.*)_id$/); + if (match) { + name = match[1]; + value = params[prop]; + } + sawParams = true; + } - function ListItem(iterable, result) { - _ListNode.call(this, iterable.valueReferenceFor(result)); - this.retained = false; - this.seen = false; - this.key = result.key; - this.iterable = iterable; - this.memo = iterable.memoReferenceFor(result); + if (!name && sawParams) { + return _emberRuntime.copy(params); + } else if (!name) { + if (transition.resolveIndex < 1) { + return; } - ListItem.prototype.update = function update(item) { - this.retained = true; - this.iterable.updateValueReference(this.value, item); - this.iterable.updateMemoReference(this.memo, item); - }; + return transition.state.handlerInfos[transition.resolveIndex - 1].context; + } - ListItem.prototype.shouldRemove = function shouldRemove() { - return !this.retained; - }; + return this.findModel(name, value); + }, - ListItem.prototype.reset = function reset() { - this.retained = false; - this.seen = false; - }; + /** + @private + @method deserialize + @param {Object} params the parameters extracted from the URL + @param {Transition} transition + @return {Object|Promise} the model for this route. + Router.js hook. + */ + deserialize: function (params, transition) { + return this.model(this.paramsFor(this.routeName), transition); + }, - return ListItem; - })(_glimmerUtil.ListNode); + /** + @method findModel + @param {String} type the model type + @param {Object} value the value passed to find + @private + */ + findModel: function () { + var store = _emberMetal.get(this, 'store'); + return store.find.apply(store, arguments); + }, - exports.ListItem = ListItem; + /** + Store property provides a hook for data persistence libraries to inject themselves. + By default, this store property provides the exact same functionality previously + in the model hook. + Currently, the required interface is: + `store.find(modelName, findArguments)` + @method store + @param {Object} store + @private + */ + store: _emberMetal.computed(function () { + var owner = _emberUtils.getOwner(this); + var routeName = this.routeName; + var namespace = _emberMetal.get(this, 'router.namespace'); - var IterationArtifacts = (function () { - function IterationArtifacts(iterable) { - this.map = _glimmerUtil.dict(); - this.list = new _glimmerUtil.LinkedList(); - this.tag = iterable.tag; - this.iterable = iterable; - } + return { + find: function (name, value) { + var modelClass = owner[_container.FACTORY_FOR]('model:' + name); - IterationArtifacts.prototype.isEmpty = function isEmpty() { - var iterator = this.iterator = this.iterable.iterate(); - return iterator.isEmpty(); - }; + _emberMetal.assert('You used the dynamic segment ' + name + '_id in your route ' + routeName + ', but ' + namespace + '.' + _emberRuntime.String.classify(name) + ' did not exist and you did not override your route\'s `model` hook.', !!modelClass); - IterationArtifacts.prototype.iterate = function iterate() { - var iterator = this.iterator || this.iterable.iterate(); - this.iterator = null; - return iterator; - }; + if (!modelClass) { + return; + } - IterationArtifacts.prototype.has = function has(key) { - return !!this.map[key]; - }; + modelClass = modelClass.class; - IterationArtifacts.prototype.get = function get(key) { - return this.map[key]; - }; + _emberMetal.assert(_emberRuntime.String.classify(name) + ' has no method `find`.', typeof modelClass.find === 'function'); - IterationArtifacts.prototype.wasSeen = function wasSeen(key) { - var node = this.map[key]; - return node && node.seen; - }; + return modelClass.find(value); + } + }; + }), - IterationArtifacts.prototype.append = function append(item) { - var map = this.map; - var list = this.list; - var iterable = this.iterable; + /** + A hook you can implement to convert the route's model into parameters + for the URL. + ```app/router.js + // ... + Router.map(function() { + this.route('post', { path: '/posts/:post_id' }); + }); + ``` + ```app/routes/post.js + import Ember from 'ember'; + export default Ember.Route.extend({ + model(params) { + // the server returns `{ id: 12 }` + return Ember.$.getJSON('/posts/' + params.post_id); + }, + serialize(model) { + // this will make the URL `/posts/12` + return { post_id: model.id }; + } + }); + ``` + The default `serialize` method will insert the model's `id` into the + route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'. + If the route has multiple dynamic segments or does not contain '_id', `serialize` + will return `Ember.getProperties(model, params)` + This method is called when `transitionTo` is called with a context + in order to populate the URL. + @method serialize + @param {Object} model the routes model + @param {Array} params an Array of parameter names for the current + route (in the example, `['post_id']`. + @return {Object} the serialized parameters + @since 1.0.0 + @public + */ + serialize: defaultSerialize, - var node = map[item.key] = new ListItem(iterable, item); - list.append(node); - return node; - }; + /** + A hook you can use to setup the controller for the current route. + This method is called with the controller for the current route and the + model supplied by the `model` hook. + By default, the `setupController` hook sets the `model` property of + the controller to the `model`. + If you implement the `setupController` hook in your Route, it will + prevent this default behavior. If you want to preserve that behavior + when implementing your `setupController` function, make sure to call + `_super`: + ```app/routes/photos.js + import Ember from 'ebmer'; + export default Ember.Route.extend({ + model() { + return this.store.findAll('photo'); + }, + setupController(controller, model) { + // Call _super for default behavior + this._super(controller, model); + // Implement your custom setup after + this.controllerFor('application').set('showingPhotos', true); + } + }); + ``` + The provided controller will be one resolved based on the name + of this route. + If no explicit controller is defined, Ember will automatically create one. + As an example, consider the router: + ```app/router.js + // ... + Router.map(function() { + this.route('post', { path: '/posts/:post_id' }); + }); + export default Router; + ``` + For the `post` route, a controller named `App.PostController` would + be used if it is defined. If it is not defined, a basic `Ember.Controller` + instance would be used. + Example + ```app/routes/post.js + import Ember from 'ember'; + export default Ember.Route.extend({ + setupController(controller, model) { + controller.set('model', model); + } + }); + ``` + @method setupController + @param {Controller} controller instance + @param {Object} model + @since 1.0.0 + @public + */ + setupController: function (controller, context, transition) { + if (controller && context !== undefined) { + _emberMetal.set(controller, 'model', context); + } + }, - IterationArtifacts.prototype.insertBefore = function insertBefore(item, reference) { - var map = this.map; - var list = this.list; - var iterable = this.iterable; + /** + Returns the resolved model of the current route, or a parent (or any ancestor) + route in a route hierarchy. + The controller instance must already have been created, either through entering the + associated route or using `generateController`. + ```app/routes/post.js + import Ember from 'ember'; + export default Ember.Route.extend({ + setupController(controller, post) { + this._super(controller, post); + this.controllerFor('posts').set('currentPost', post); + } + }); + ``` + @method controllerFor + @param {String} name the name of the route or controller + @return {Ember.Controller} + @since 1.0.0 + @public + */ + controllerFor: function (name, _skipAssert) { + var owner = _emberUtils.getOwner(this); + var route = owner.lookup('route:' + name); + var controller = undefined; - var node = map[item.key] = new ListItem(iterable, item); - node.retained = true; - list.insertBefore(node, reference); - return node; - }; + if (route && route.controllerName) { + name = route.controllerName; + } - IterationArtifacts.prototype.move = function move(item, reference) { - var list = this.list; + controller = owner.lookup('controller:' + name); - item.retained = true; - list.remove(item); - list.insertBefore(item, reference); - }; + // NOTE: We're specifically checking that skipAssert is true, because according + // to the old API the second parameter was model. We do not want people who + // passed a model to skip the assertion. + _emberMetal.assert('The controller named \'' + name + '\' could not be found. Make sure that this route exists and has already been entered at least once. If you are accessing a controller not associated with a route, make sure the controller class is explicitly defined.', controller || _skipAssert === true); - IterationArtifacts.prototype.remove = function remove(item) { - var list = this.list; + return controller; + }, - list.remove(item); - delete this.map[item.key]; - }; + /** + Generates a controller for a route. + Example + ```app/routes/post.js + import Ember from 'ember'; + export default Ember.Route.extend({ + setupController(controller, post) { + this._super(controller, post); + this.generateController('posts'); + } + }); + ``` + @method generateController + @param {String} name the name of the controller + @private + */ + generateController: function (name) { + var owner = _emberUtils.getOwner(this); - IterationArtifacts.prototype.nextNode = function nextNode(item) { - return this.list.nextNode(item); - }; + return _emberRoutingSystemGenerate_controller.default(owner, name); + }, - IterationArtifacts.prototype.head = function head() { - return this.list.head(); - }; + /** + Returns the resolved model of a parent (or any ancestor) route + in a route hierarchy. During a transition, all routes + must resolve a model object, and if a route + needs access to a parent route's model in order to + resolve a model (or just reuse the model from a parent), + it can call `this.modelFor(theNameOfParentRoute)` to + retrieve it. If the ancestor route's model was a promise, + its resolved result is returned. + Example + ```app/router.js + // ... + Router.map(function() { + this.route('post', { path: '/posts/:post_id' }, function() { + this.route('comments'); + }); + }); + export default Router; + ``` + ```app/routes/comments.js + import Ember from 'ember'; + export default Ember.Route.extend({ + model() { + let post = this.modelFor('post'); + return post.get('comments'); + } + }); + ``` + @method modelFor + @param {String} name the name of the route + @return {Object} the model object + @since 1.0.0 + @public + */ + modelFor: function (_name) { + var name = undefined; + var owner = _emberUtils.getOwner(this); - return IterationArtifacts; - })(); + // Only change the route name when there is an active transition. + // Otherwise, use the passed in route name. + if (owner.routable && this.router && this.router.router.activeTransition) { + name = getEngineRouteName(owner, _name); + } else { + name = _name; + } + + var route = _emberUtils.getOwner(this).lookup('route:' + name); + var transition = this.router ? this.router.router.activeTransition : null; - exports.IterationArtifacts = IterationArtifacts; + // If we are mid-transition, we want to try and look up + // resolved parent contexts on the current transitionEvent. + if (transition) { + var modelLookupName = route && route.routeName || name; + if (transition.resolvedModels.hasOwnProperty(modelLookupName)) { + return transition.resolvedModels[modelLookupName]; + } + } - var ReferenceIterator = (function () { - // if anyone needs to construct this object with something other than - // an iterable, let @wycats know. + return route && route.currentModel; + }, - function ReferenceIterator(iterable) { - this.iterator = null; - var artifacts = new IterationArtifacts(iterable); - this.artifacts = artifacts; + /** + A hook you can use to render the template for the current route. + This method is called with the controller for the current route and the + model supplied by the `model` hook. By default, it renders the route's + template, configured with the controller for the route. + This method can be overridden to set up and render additional or + alternative templates. + ```app/routes/posts.js + import Ember from 'ember'; + export default Ember.Route.extend({ + renderTemplate(controller, model) { + let favController = this.controllerFor('favoritePost'); + // Render the `favoritePost` template into + // the outlet `posts`, and display the `favoritePost` + // controller. + this.render('favoritePost', { + outlet: 'posts', + controller: favController + }); } + }); + ``` + @method renderTemplate + @param {Object} controller the route's controller + @param {Object} model the route's model + @since 1.0.0 + @public + */ + renderTemplate: function (controller, model) { + this.render(); + }, - ReferenceIterator.prototype.next = function next() { - var artifacts = this.artifacts; - - var iterator = this.iterator = this.iterator || artifacts.iterate(); - var item = iterator.next(); - if (!item) return null; - return artifacts.append(item); - }; + /** + `render` is used to render a template into a region of another template + (indicated by an `{{outlet}}`). `render` is used both during the entry + phase of routing (via the `renderTemplate` hook) and later in response to + user interaction. + For example, given the following minimal router and templates: + ```app/router.js + // ... + Router.map(function() { + this.route('photos'); + }); + export default Router; + ``` + ```handlebars + +
    + {{outlet "anOutletName"}} +
    + ``` + ```handlebars + +

    Photos

    + ``` + You can render `photos.hbs` into the `"anOutletName"` outlet of + `application.hbs` by calling `render`: + ```app/routes/post.js + import Ember from 'ember'; + export default Ember.Route.extend({ + renderTemplate() { + this.render('photos', { + into: 'application', + outlet: 'anOutletName' + }) + } + }); + ``` + `render` additionally allows you to supply which `controller` and + `model` objects should be loaded and associated with the rendered template. + ```app/routes/posts.js + import Ember from 'ember'; + export default Ember.Route.extend({ + renderTemplate(controller, model){ + this.render('posts', { // the template to render, referenced by name + into: 'application', // the template to render into, referenced by name + outlet: 'anOutletName', // the outlet inside `options.template` to render into. + controller: 'someControllerName', // the controller to use for this template, referenced by name + model: model // the model to set on `options.controller`. + }) + } + }); + ``` + The string values provided for the template name, and controller + will eventually pass through to the resolver for lookup. See + Ember.Resolver for how these are mapped to JavaScript objects in your + application. The template to render into needs to be related to either the + current route or one of its ancestors. + Not all options need to be passed to `render`. Default values will be used + based on the name of the route specified in the router or the Route's + `controllerName` and `templateName` properties. + For example: + ```app/router.js + // ... + Router.map(function() { + this.route('index'); + this.route('post', { path: '/posts/:post_id' }); + }); + export default Router; + ``` + ```app/routes/post.js + import Ember from 'ember'; + export default Ember.Route.extend({ + renderTemplate() { + this.render(); // all defaults apply + } + }); + ``` + The name of the route, defined by the router, is `post`. + The following equivalent default options will be applied when + the Route calls `render`: + ```javascript + this.render('post', { // the template name associated with 'post' Route + into: 'application', // the parent route to 'post' Route + outlet: 'main', // {{outlet}} and {{outlet 'main'}} are synonymous, + controller: 'post', // the controller associated with the 'post' Route + }) + ``` + By default the controller's `model` will be the route's model, so it does not + need to be passed unless you wish to change which model is being used. + @method render + @param {String} name the name of the template to render + @param {Object} [options] the options + @param {String} [options.into] the template to render into, + referenced by name. Defaults to the parent template + @param {String} [options.outlet] the outlet inside `options.template` to render into. + Defaults to 'main' + @param {String|Object} [options.controller] the controller to use for this template, + referenced by name or as a controller instance. Defaults to the Route's paired controller + @param {Object} [options.model] the model object to set on `options.controller`. + Defaults to the return value of the Route's model hook + @since 1.0.0 + @public + */ + render: function (_name, options) { + _emberMetal.assert('The name in the given arguments is undefined', arguments.length > 0 ? !_emberMetal.isNone(arguments[0]) : true); - return ReferenceIterator; - })(); + var namePassed = typeof _name === 'string' && !!_name; + var isDefaultRender = arguments.length === 0 || _emberMetal.isEmpty(arguments[0]); + var name = undefined; - exports.ReferenceIterator = ReferenceIterator; + if (typeof _name === 'object' && !options) { + name = this.templateName || this.routeName; + options = _name; + } else { + name = _name; + } - var Phase; - (function (Phase) { - Phase[Phase["Append"] = 0] = "Append"; - Phase[Phase["Prune"] = 1] = "Prune"; - Phase[Phase["Done"] = 2] = "Done"; - })(Phase || (Phase = {})); + var renderOptions = buildRenderOptions(this, namePassed, isDefaultRender, name, options); + this.connections.push(renderOptions); + _emberMetal.run.once(this.router, '_setOutlets'); + }, - var IteratorSynchronizer = (function () { - function IteratorSynchronizer(_ref) { - var target = _ref.target; - var artifacts = _ref.artifacts; + /** + Disconnects a view that has been rendered into an outlet. + You may pass any or all of the following options to `disconnectOutlet`: + * `outlet`: the name of the outlet to clear (default: 'main') + * `parentView`: the name of the view containing the outlet to clear + (default: the view rendered by the parent route) + Example: + ```app/routes/application.js + import Ember from 'ember'; + export default App.Route.extend({ + actions: { + showModal(evt) { + this.render(evt.modalName, { + outlet: 'modal', + into: 'application' + }); + }, + hideModal(evt) { + this.disconnectOutlet({ + outlet: 'modal', + parentView: 'application' + }); + } + } + }); + ``` + Alternatively, you can pass the `outlet` name directly as a string. + Example: + ```app/routes/application.js + import Ember from 'ember'; + export default App.Route.extend({ + actions: { + showModal(evt) { + // ... + }, + hideModal(evt) { + this.disconnectOutlet('modal'); + } + } + }); + @method disconnectOutlet + @param {Object|String} options the options hash or outlet name + @since 1.0.0 + @public + */ + disconnectOutlet: function (options) { + var outletName = undefined; + var parentView = undefined; + if (!options || typeof options === 'string') { + outletName = options; + } else { + outletName = options.outlet; + parentView = options.parentView; - this.target = target; - this.artifacts = artifacts; - this.iterator = artifacts.iterate(); - this.current = artifacts.head(); + if (options && Object.keys(options).indexOf('outlet') !== -1 && typeof options.outlet === 'undefined') { + throw new _emberMetal.Error('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++) { + // This non-local state munging is sadly necessary to maintain + // backward compatibility with our existing semantics, which allow + // any route to disconnectOutlet things originally rendered by any + // other route. This should all get cut in 2.0. + this.router.router.currentHandlerInfos[i].handler._disconnectOutlet(outletName, parentView); + } + }, - IteratorSynchronizer.prototype.sync = function sync() { - var phase = Phase.Append; - while (true) { - switch (phase) { - case Phase.Append: - phase = this.nextAppend(); - break; - case Phase.Prune: - phase = this.nextPrune(); - break; - case Phase.Done: - this.nextDone(); - return; - } - } - }; + _disconnectOutlet: function (outletName, parentView) { + var parent = parentRoute(this); + if (parent && parentView === parent.routeName) { + parentView = undefined; + } + for (var i = 0; i < this.connections.length; i++) { + var connection = this.connections[i]; + if (connection.outlet === outletName && connection.into === parentView) { + // This neuters the disconnected outlet such that it doesn't + // render anything, but it leaves an entry in the outlet + // 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, + controller: undefined, + template: undefined, + ViewClass: undefined + }; + _emberMetal.run.once(this.router, '_setOutlets'); + } + } + }, - IteratorSynchronizer.prototype.advanceToKey = function advanceToKey(key) { - var current = this.current; - var artifacts = this.artifacts; + willDestroy: function () { + this.teardownViews(); + }, - var seek = current; - while (seek && seek.key !== key) { - seek.seen = true; - seek = artifacts.nextNode(seek); - } - this.current = seek && artifacts.nextNode(seek); - }; + /** + @private + @method teardownViews + */ + teardownViews: function () { + if (this.connections && this.connections.length > 0) { + this.connections = []; + _emberMetal.run.once(this.router, '_setOutlets'); + } + } + }); - IteratorSynchronizer.prototype.nextAppend = function nextAppend() { - var iterator = this.iterator; - var current = this.current; - var artifacts = this.artifacts; + _emberRuntime.deprecateUnderscoreActions(Route); - var item = iterator.next(); - if (item === null) { - return this.startPrune(); - } - var key = item.key; + Route.reopenClass({ + isRouteFactory: true + }); - if (current && current.key === key) { - this.nextRetain(item); - } else if (artifacts.has(key)) { - this.nextMove(item); - } else { - this.nextInsert(item); - } - return Phase.Append; - }; + function parentRoute(route) { + var handlerInfo = handlerInfoFor(route, route.router.router.state.handlerInfos, -1); + return handlerInfo && handlerInfo.handler; + } - IteratorSynchronizer.prototype.nextRetain = function nextRetain(item) { - var artifacts = this.artifacts; - var current = this.current; + function handlerInfoFor(route, handlerInfos) { + var offset = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2]; - current.update(item); - this.current = artifacts.nextNode(current); - this.target.retain(item.key, current.value, current.memo); - }; + if (!handlerInfos) { + return; + } - IteratorSynchronizer.prototype.nextMove = function nextMove(item) { - var current = this.current; - var artifacts = this.artifacts; - var target = this.target; - var key = item.key; + var current = undefined; + for (var i = 0; i < handlerInfos.length; i++) { + current = handlerInfos[i].handler; + if (current === route) { + return handlerInfos[i + offset]; + } + } + } - var found = artifacts.get(item.key); - found.update(item); - if (artifacts.wasSeen(item.key)) { - artifacts.move(found, current); - target.move(found.key, found.value, found.memo, current ? current.key : null); - } else { - this.advanceToKey(key); - } - }; + function buildRenderOptions(route, namePassed, isDefaultRender, _name, options) { + var into = options && options.into && options.into.replace(/\//g, '.'); + var outlet = options && options.outlet || 'main'; - IteratorSynchronizer.prototype.nextInsert = function nextInsert(item) { - var artifacts = this.artifacts; - var target = this.target; - var current = this.current; + var name = undefined, + templateName = undefined; + if (_name) { + name = _name.replace(/\//g, '.'); + templateName = name; + } else { + name = route.routeName; + templateName = route.templateName || name; + } - var node = artifacts.insertBefore(item, current); - target.insert(node.key, node.value, node.memo, current ? current.key : null); - }; + var owner = _emberUtils.getOwner(route); + var controller = options && options.controller; + if (!controller) { + if (namePassed) { + controller = owner.lookup('controller:' + name) || route.controllerName || route.routeName; + } else { + controller = route.controllerName || owner.lookup('controller:' + name); + } + } - IteratorSynchronizer.prototype.startPrune = function startPrune() { - this.current = this.artifacts.head(); - return Phase.Prune; - }; + if (typeof controller === 'string') { + var controllerName = controller; + controller = owner.lookup('controller:' + controllerName); + if (!controller) { + throw new _emberMetal.Error('You passed `controller: \'' + controllerName + '\'` into the `render` method, but no such controller could be found.'); + } + } - IteratorSynchronizer.prototype.nextPrune = function nextPrune() { - var artifacts = this.artifacts; - var target = this.target; - var current = this.current; + if (options && Object.keys(options).indexOf('outlet') !== -1 && typeof options.outlet === 'undefined') { + throw new _emberMetal.Error('You passed undefined as the outlet name.'); + } - if (current === null) { - return Phase.Done; - } - var node = current; - this.current = artifacts.nextNode(node); - if (node.shouldRemove()) { - artifacts.remove(node); - target.delete(node.key); - } else { - node.reset(); - } - return Phase.Prune; - }; + if (options && options.model) { + controller.set('model', options.model); + } - IteratorSynchronizer.prototype.nextDone = function nextDone() { - this.target.done(); - }; + var template = owner.lookup('template:' + templateName); - return IteratorSynchronizer; - })(); + var parent = undefined; + if (into && (parent = parentRoute(route)) && into === parent.routeName) { + into = undefined; + } - exports.IteratorSynchronizer = IteratorSynchronizer; -}); + var renderOptions = { + owner: owner, + into: into, + outlet: outlet, + name: name, + controller: controller, + template: template || route._topLevelViewTemplate, + ViewClass: undefined + }; -enifed("glimmer-reference/lib/reference", ["exports"], function (exports) { - "use strict"; -}); + _emberMetal.assert('Could not find "' + name + '" template, view, or component.', isDefaultRender || template); -enifed("glimmer-reference/lib/utils", ["exports"], function (exports) { - "use strict"; + _emberMetal.runInDebug(function () { + var LOG_VIEW_LOOKUPS = _emberMetal.get(route.router, 'namespace.LOG_VIEW_LOOKUPS'); + if (LOG_VIEW_LOOKUPS && !template) { + _emberMetal.info('Could not find "' + name + '" template. Nothing will be rendered', { fullName: 'template:' + name }); + } + }); - exports.referenceFromParts = referenceFromParts; + return renderOptions; + } - function referenceFromParts(root, parts) { - var reference = root; - for (var i = 0; i < parts.length; i++) { - reference = reference.get(parts[i]); - } - return reference; + function getFullQueryParams(router, state) { + if (state.fullQueryParams) { + return state.fullQueryParams; } -}); -enifed("glimmer-reference/lib/validators", ["exports"], function (exports) { - "use strict"; + state.fullQueryParams = {}; + _emberUtils.assign(state.fullQueryParams, state.queryParams); - exports.combineTagged = combineTagged; - exports.combineSlice = combineSlice; - exports.combine = combine; - exports.map = map; - exports.isModified = isModified; - var CONSTANT = 0; - exports.CONSTANT = CONSTANT; - var INITIAL = 1; - exports.INITIAL = INITIAL; - var VOLATILE = NaN; - exports.VOLATILE = VOLATILE; + router._deserializeQueryParams(state.handlerInfos, state.fullQueryParams); + return state.fullQueryParams; + } - var RevisionTag = (function () { - function RevisionTag() {} + function getQueryParamsFor(route, state) { + state.queryParamsFor = state.queryParamsFor || {}; + var name = route.fullRouteName; - RevisionTag.prototype.validate = function validate(snapshot) { - return this.value() === snapshot; - }; + if (state.queryParamsFor[name]) { + return state.queryParamsFor[name]; + } - return RevisionTag; - })(); + var fullQueryParams = getFullQueryParams(route.router, state); - exports.RevisionTag = RevisionTag; + var params = state.queryParamsFor[name] = {}; - var $REVISION = INITIAL; + // Copy over all the query params for this route/controller into params hash. + var qpMeta = _emberMetal.get(route, '_qp'); + var qps = qpMeta.qps; + for (var i = 0; i < qps.length; ++i) { + // Put deserialized qp on params hash. + var qp = qps[i]; + + var qpValueWasPassedIn = (qp.prop in fullQueryParams); + params[qp.prop] = qpValueWasPassedIn ? fullQueryParams[qp.prop] : copyDefaultValue(qp.defaultValue); + } + + return params; + } + + function copyDefaultValue(value) { + if (Array.isArray(value)) { + return _emberRuntime.A(value.slice()); + } + return value; + } - var DirtyableTag = (function (_RevisionTag) { - babelHelpers.inherits(DirtyableTag, _RevisionTag); + /* + Merges all query parameters from a controller with those from + a route, returning a new object and avoiding any mutations to + the existing objects. + */ + function mergeEachQueryParams(controllerQP, routeQP) { + var keysAlreadyMergedOrSkippable = undefined; + var qps = {}; - function DirtyableTag() { - var revision = arguments.length <= 0 || arguments[0] === undefined ? $REVISION : arguments[0]; + keysAlreadyMergedOrSkippable = { + defaultValue: true, + type: true, + scope: true, + as: true + }; - _RevisionTag.call(this); - this.revision = revision; - } + // 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)) { + continue; + } - DirtyableTag.prototype.value = function value() { - return this.revision; - }; + var newControllerParameterConfiguration = {}; + _emberUtils.assign(newControllerParameterConfiguration, controllerQP[cqpName]); + _emberUtils.assign(newControllerParameterConfiguration, routeQP[cqpName]); - DirtyableTag.prototype.dirty = function dirty() { - this.revision = ++$REVISION; - }; + qps[cqpName] = newControllerParameterConfiguration; - return DirtyableTag; - })(RevisionTag); + // allows us to skip this QP when we check route QPs. + keysAlreadyMergedOrSkippable[cqpName] = true; + } - exports.DirtyableTag = DirtyableTag; + // loop over all route qps, skipping those that were merged in the first pass + // because they also appear in controller qps + for (var rqpName in routeQP) { + if (!routeQP.hasOwnProperty(rqpName) || keysAlreadyMergedOrSkippable[rqpName]) { + continue; + } - function combineTagged(tagged) { - var optimized = []; - for (var i = 0, l = tagged.length; i < l; i++) { - var tag = tagged[i].tag; - if (tag === VOLATILE_TAG) return VOLATILE_TAG; - if (tag === CONSTANT_TAG) continue; - optimized.push(tag); - } - return _combine(optimized); + var newRouteParameterConfiguration = {}; + _emberUtils.assign(newRouteParameterConfiguration, routeQP[rqpName], controllerQP[rqpName]); + qps[rqpName] = newRouteParameterConfiguration; } - function combineSlice(slice) { - var optimized = []; - var node = slice.head(); - while (node !== null) { - var tag = node.tag; - if (tag === VOLATILE_TAG) return VOLATILE_TAG; - if (tag !== CONSTANT_TAG) optimized.push(tag); - node = slice.nextNode(node); - } - return _combine(optimized); - } + return qps; + } - function combine(tags) { - var optimized = []; - for (var i = 0, l = tags.length; i < l; i++) { - var tag = tags[i]; - if (tag === VOLATILE_TAG) return VOLATILE_TAG; - if (tag === CONSTANT_TAG) continue; - optimized.push(tag); - } - return _combine(optimized); - } + function addQueryParamsObservers(controller, propNames) { + propNames.forEach(function (prop) { + controller.addObserver(prop + '.[]', controller, controller._qpChanged); + }); + } - function _combine(tags) { - switch (tags.length) { - case 0: - return CONSTANT_TAG; - case 1: - return tags[0]; - case 2: - return new TagsPair(tags[0], tags[1]); - default: - return new TagsCombinator(tags); - } - ; + function getEngineRouteName(engine, routeName) { + if (engine.routable) { + var prefix = engine.mountPoint; + + if (routeName === 'application') { + return prefix; + } else { + return prefix + '.' + routeName; + } } - var CachedTag = (function (_RevisionTag2) { - babelHelpers.inherits(CachedTag, _RevisionTag2); + return routeName; + } - function CachedTag() { - _RevisionTag2.apply(this, arguments); - this.lastChecked = null; - this.lastValue = null; - } + exports.default = Route; +}); +enifed('ember-routing/system/router', ['exports', 'ember-utils', 'ember-console', 'ember-metal', 'ember-runtime', 'ember-routing/system/route', 'ember-routing/system/dsl', 'ember-routing/location/api', 'ember-routing/utils', 'ember-routing/system/router_state', 'container', 'router'], function (exports, _emberUtils, _emberConsole, _emberMetal, _emberRuntime, _emberRoutingSystemRoute, _emberRoutingSystemDsl, _emberRoutingLocationApi, _emberRoutingUtils, _emberRoutingSystemRouter_state, _container, _router5) { + 'use strict'; - CachedTag.prototype.value = function value() { - var lastChecked = this.lastChecked; - var lastValue = this.lastValue; + exports.triggerEvent = triggerEvent; - if (lastChecked !== $REVISION) { - this.lastChecked = $REVISION; - this.lastValue = lastValue = this.compute(); - } - return this.lastValue; - }; + function K() { + return this; + } - CachedTag.prototype.invalidate = function invalidate() { - this.lastChecked = null; - }; + var slice = Array.prototype.slice; - return CachedTag; - })(RevisionTag); + /** + The `Ember.Router` class manages the application state and URLs. Refer to + the [routing guide](http://emberjs.com/guides/routing/) for documentation. + + @class Router + @namespace Ember + @extends Ember.Object + @uses Ember.Evented + @public + */ + var EmberRouter = _emberRuntime.Object.extend(_emberRuntime.Evented, { + /** + The `location` property determines the type of URL's that your + application will use. + The following location types are currently available: + * `history` - use the browser's history API to make the URLs look just like any standard URL + * `hash` - use `#` to separate the server part of the URL from the Ember part: `/blog/#/posts/new` + * `none` - do not store the Ember URL in the actual browser URL (mainly used for testing) + * `auto` - use the best option based on browser capabilites: `history` if possible, then `hash` if possible, otherwise `none` + Note: If using ember-cli, this value is defaulted to `auto` by the `locationType` setting of `/config/environment.js` + @property location + @default 'hash' + @see {Ember.Location} + @public + */ + location: 'hash', - exports.CachedTag = CachedTag; + /** + Represents the URL of the root of the application, often '/'. This prefix is + assumed on all routes defined on this router. + @property rootURL + @default '/' + @public + */ + rootURL: '/', - var TagsPair = (function (_CachedTag) { - babelHelpers.inherits(TagsPair, _CachedTag); + _initRouterJs: function () { + var _this = this; - function TagsPair(first, second) { - _CachedTag.call(this); - this.first = first; - this.second = second; - } + var router = this.router = new _router5.default(); + router.triggerEvent = triggerEvent; - TagsPair.prototype.compute = function compute() { - return Math.max(this.first.value(), this.second.value()); - }; + router._triggerWillChangeContext = K; + router._triggerWillLeave = K; - return TagsPair; - })(CachedTag); + var dslCallbacks = this.constructor.dslCallbacks || [K]; + var dsl = this._buildDSL(); - var TagsCombinator = (function (_CachedTag2) { - babelHelpers.inherits(TagsCombinator, _CachedTag2); + dsl.route('application', { path: '/', resetNamespace: true, overrideNameAssertion: true }, function () { + for (var i = 0; i < dslCallbacks.length; i++) { + dslCallbacks[i].call(this); + } + }); - function TagsCombinator(tags) { - _CachedTag2.call(this); - this.tags = tags; + _emberMetal.runInDebug(function () { + if (_emberMetal.get(_this, 'namespace.LOG_TRANSITIONS_INTERNAL')) { + router.log = _emberConsole.default.debug; } + }); - TagsCombinator.prototype.compute = function compute() { - var tags = this.tags; + router.map(dsl.generate()); + }, - var max = -1; - for (var i = 0; i < tags.length; i++) { - var value = tags[i].value(); - max = Math.max(value, max); - } - return max; - }; + _buildDSL: function () { + var moduleBasedResolver = this._hasModuleBasedResolver(); + var options = { + enableLoadingSubstates: !!moduleBasedResolver + }; - return TagsCombinator; - })(CachedTag); + var owner = _emberUtils.getOwner(this); + var router = this; - var UpdatableTag = (function (_CachedTag3) { - babelHelpers.inherits(UpdatableTag, _CachedTag3); + options.resolveRouteMap = function (name) { + return owner[_container.FACTORY_FOR]('route-map:' + name); + }; - function UpdatableTag(tag) { - _CachedTag3.call(this); - this.tag = tag; - this.lastUpdated = INITIAL; + options.addRouteForEngine = function (name, engineInfo) { + if (!router._engineInfoByRoute[name]) { + router._engineInfoByRoute[name] = engineInfo; } + }; - ////////// + return new _emberRoutingSystemDsl.default(null, options); + }, - UpdatableTag.prototype.compute = function compute() { - return Math.max(this.lastUpdated, this.tag.value()); - }; + init: function () { + this._super.apply(this, arguments); - UpdatableTag.prototype.update = function update(tag) { - if (tag !== this.tag) { - this.tag = tag; - this.lastUpdated = $REVISION; - this.invalidate(); - } - }; + this.currentURL = null; + this.currentRouteName = null; + this.currentPath = null; - return UpdatableTag; - })(CachedTag); + this._qpCache = new _emberUtils.EmptyObject(); + this._resetQueuedQueryParameterChanges(); + this._handledErrors = _emberUtils.dictionary(null); + this._engineInstances = new _emberUtils.EmptyObject(); + this._engineInfoByRoute = new _emberUtils.EmptyObject(); + }, - exports.UpdatableTag = UpdatableTag; - var CONSTANT_TAG = new ((function (_RevisionTag3) { - babelHelpers.inherits(ConstantTag, _RevisionTag3); + /* + Resets all pending query paramter changes. + Called after transitioning to a new route + based on query parameter changes. + */ + _resetQueuedQueryParameterChanges: function () { + this._queuedQPChanges = {}; + }, - function ConstantTag() { - _RevisionTag3.apply(this, arguments); - } + /** + Represents the current URL. + @method url + @return {String} The current URL. + @private + */ + url: _emberMetal.computed(function () { + return _emberMetal.get(this, 'location').getURL(); + }), - ConstantTag.prototype.value = function value() { - return CONSTANT; - }; + _hasModuleBasedResolver: function () { + var owner = _emberUtils.getOwner(this); - return ConstantTag; - })(RevisionTag))(); - exports.CONSTANT_TAG = CONSTANT_TAG; - var VOLATILE_TAG = new ((function (_RevisionTag4) { - babelHelpers.inherits(VolatileTag, _RevisionTag4); + if (!owner) { + return false; + } - function VolatileTag() { - _RevisionTag4.apply(this, arguments); - } + var resolver = owner.application && owner.application.__registry__ && owner.application.__registry__.resolver; - VolatileTag.prototype.value = function value() { - return VOLATILE; - }; + if (!resolver) { + return false; + } - return VolatileTag; - })(RevisionTag))(); - exports.VOLATILE_TAG = VOLATILE_TAG; - var CURRENT_TAG = new ((function (_DirtyableTag) { - babelHelpers.inherits(CurrentTag, _DirtyableTag); + return !!resolver.moduleBasedResolver; + }, - function CurrentTag() { - _DirtyableTag.apply(this, arguments); + /** + Initializes the current router instance and sets up the change handling + event listeners used by the instances `location` implementation. + A property named `initialURL` will be used to determine the initial URL. + If no value is found `/` will be used. + @method startRouting + @private + */ + startRouting: function () { + var initialURL = _emberMetal.get(this, 'initialURL'); + + if (this.setupRouter()) { + if (typeof initialURL === 'undefined') { + initialURL = _emberMetal.get(this, 'location').getURL(); + } + var initialTransition = this.handleURL(initialURL); + if (initialTransition && initialTransition.error) { + throw initialTransition.error; } + } + }, - CurrentTag.prototype.value = function value() { - return $REVISION; - }; + setupRouter: function () { + var _this2 = this; - return CurrentTag; - })(DirtyableTag))(); - exports.CURRENT_TAG = CURRENT_TAG; + this._initRouterJs(); + this._setupLocation(); - var CachedReference = (function () { - function CachedReference() { - this.lastRevision = null; - this.lastValue = null; - } + var router = this.router; + var location = _emberMetal.get(this, 'location'); - CachedReference.prototype.value = function value() { - var tag = this.tag; - var lastRevision = this.lastRevision; - var lastValue = this.lastValue; + // Allow the Location class to cancel the router setup while it refreshes + // the page + if (_emberMetal.get(location, 'cancelRouterSetup')) { + return false; + } - if (!lastRevision || !tag.validate(lastRevision)) { - lastValue = this.lastValue = this.compute(); - this.lastRevision = tag.value(); - } - return lastValue; - }; + this._setupRouter(router, location); - CachedReference.prototype.invalidate = function invalidate() { - this.lastRevision = null; - }; + location.onUpdateURL(function (url) { + _this2.handleURL(url); + }); - return CachedReference; - })(); + return true; + }, - exports.CachedReference = CachedReference; + /** + Handles updating the paths and notifying any listeners of the URL + change. + Triggers the router level `didTransition` hook. + For example, to notify google analytics when the route changes, + you could use this hook. (Note: requires also including GA scripts, etc.) + ```javascript + let Router = Ember.Router.extend({ + location: config.locationType, + didTransition: function() { + this._super(...arguments); + return ga('send', 'pageview', { + 'page': this.get('url'), + 'title': this.get('url') + }); + } + }); + ``` + @method didTransition + @public + @since 1.2.0 + */ + didTransition: function (infos) { + var _this3 = this; - var MapperReference = (function (_CachedReference) { - babelHelpers.inherits(MapperReference, _CachedReference); + updatePaths(this); - function MapperReference(reference, mapper) { - _CachedReference.call(this); - this.tag = reference.tag; - this.reference = reference; - this.mapper = mapper; - } + this._cancelSlowTransitionTimer(); - MapperReference.prototype.compute = function compute() { - var reference = this.reference; - var mapper = this.mapper; + this.notifyPropertyChange('url'); + this.set('currentState', this.targetState); - return mapper(reference.value()); - }; + // Put this in the runloop so url will be accurate. Seems + // less surprising than didTransition being out of sync. + _emberMetal.run.once(this, this.trigger, 'didTransition'); - return MapperReference; - })(CachedReference); + _emberMetal.runInDebug(function () { + if (_emberMetal.get(_this3, 'namespace').LOG_TRANSITIONS) { + _emberConsole.default.log('Transitioned into \'' + EmberRouter._routePath(infos) + '\''); + } + }); + }, - function map(reference, mapper) { - return new MapperReference(reference, mapper); - } + _setOutlets: function () { + // This is triggered async during Ember.Route#willDestroy. + // If the router is also being destroyed we do not want to + // to create another this._toplevelView (and leak the renderer) + if (this.isDestroying || this.isDestroyed) { + return; + } - ////////// + var handlerInfos = this.router.currentHandlerInfos; + var route = undefined; + var defaultParentState = undefined; + var liveRoutes = null; - var ReferenceCache = (function () { - function ReferenceCache(reference) { - this.lastValue = null; - this.lastRevision = null; - this.initialized = false; - this.tag = reference.tag; - this.reference = reference; + if (!handlerInfos) { + return; + } + + for (var i = 0; i < handlerInfos.length; i++) { + route = handlerInfos[i].handler; + var connections = route.connections; + var ownState = undefined; + for (var j = 0; j < connections.length; j++) { + var appended = appendLiveRoute(liveRoutes, defaultParentState, connections[j]); + liveRoutes = appended.liveRoutes; + if (appended.ownState.render.name === route.routeName || appended.ownState.render.outlet === 'main') { + ownState = appended.ownState; + } } + if (connections.length === 0) { + ownState = representEmptyRoute(liveRoutes, defaultParentState, route); + } + defaultParentState = ownState; + } - ReferenceCache.prototype.peek = function peek() { - if (!this.initialized) { - return this.initialize(); - } - return this.lastValue; - }; + // when a transitionTo happens after the validation phase + // during the initial transition _setOutlets is called + // when no routes are active. However, it will get called + // again with the correct values during the next turn of + // the runloop + if (!liveRoutes) { + return; + } - ReferenceCache.prototype.revalidate = function revalidate() { - if (!this.initialized) { - return this.initialize(); - } - var reference = this.reference; - var lastRevision = this.lastRevision; + if (!this._toplevelView) { + var owner = _emberUtils.getOwner(this); + var OutletView = owner[_container.FACTORY_FOR]('view:-outlet'); + this._toplevelView = OutletView.create(); + this._toplevelView.setOutletState(liveRoutes); + var instance = owner.lookup('-application-instance:main'); + instance.didCreateRootView(this._toplevelView); + } else { + this._toplevelView.setOutletState(liveRoutes); + } + }, - var tag = reference.tag; - if (tag.validate(lastRevision)) return NOT_MODIFIED; - this.lastRevision = tag.value(); - var lastValue = this.lastValue; + /** + Handles notifying any listeners of an impending URL + change. + Triggers the router level `willTransition` hook. + @method willTransition + @public + @since 1.11.0 + */ + willTransition: function (oldInfos, newInfos, transition) { + var _this4 = this; - var value = reference.value(); - if (value === lastValue) return NOT_MODIFIED; - this.lastValue = value; - return value; - }; + _emberMetal.run.once(this, this.trigger, 'willTransition', transition); - ReferenceCache.prototype.initialize = function initialize() { - var reference = this.reference; + _emberMetal.runInDebug(function () { + if (_emberMetal.get(_this4, 'namespace').LOG_TRANSITIONS) { + _emberConsole.default.log('Preparing to transition from \'' + EmberRouter._routePath(oldInfos) + '\' to \'' + EmberRouter._routePath(newInfos) + '\''); + } + }); + }, - var value = this.lastValue = reference.value(); - this.lastRevision = reference.tag.value(); - this.initialized = true; - return value; - }; + handleURL: function (url) { + // Until we have an ember-idiomatic way of accessing #hashes, we need to + // remove it because router.js doesn't know how to handle it. + url = url.split(/#(.+)?/)[0]; + return this._doURLTransition('handleURL', url); + }, - return ReferenceCache; - })(); + _doURLTransition: function (routerJsMethod, url) { + var transition = this.router[routerJsMethod](url || '/'); + didBeginTransition(transition, this); + return transition; + }, - exports.ReferenceCache = ReferenceCache; + /** + Transition the application into another route. The route may + be either a single route or route path: + See [Route.transitionTo](http://emberjs.com/api/classes/Ember.Route.html#method_transitionTo) for more info. + @method transitionTo + @param {String} name the name of the route or a URL + @param {...Object} models the model(s) or identifier(s) to be used while + transitioning to the route. + @param {Object} [options] optional hash with a queryParams property + containing a mapping of query parameters + @return {Transition} the transition object associated with this + attempted transition + @public + */ + transitionTo: function () { + var queryParams = undefined; - var NOT_MODIFIED = "adb3b78e-3d22-4e4b-877a-6317c2c5c145"; + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - function isModified(value) { - return value !== NOT_MODIFIED; - } -}); + if (resemblesURL(args[0])) { + return this._doURLTransition('transitionTo', args[0]); + } -enifed('glimmer-runtime/index', ['exports', 'glimmer-runtime/lib/dom/interfaces', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/template', 'glimmer-runtime/lib/symbol-table', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/syntax/core', 'glimmer-runtime/lib/compiled/opcodes/builder', 'glimmer-runtime/lib/compiler', 'glimmer-runtime/lib/opcode-builder', 'glimmer-runtime/lib/compiled/blocks', 'glimmer-runtime/lib/dom/attribute-managers', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/compiled/expressions/function', 'glimmer-runtime/lib/helpers/get-dynamic-var', 'glimmer-runtime/lib/syntax/builtins/with-dynamic-vars', 'glimmer-runtime/lib/syntax/builtins/in-element', 'glimmer-runtime/lib/vm', 'glimmer-runtime/lib/upsert', 'glimmer-runtime/lib/environment', 'glimmer-runtime/lib/partial', 'glimmer-runtime/lib/component/interfaces', 'glimmer-runtime/lib/modifier/interfaces', 'glimmer-runtime/lib/dom/helper', 'glimmer-runtime/lib/builder', 'glimmer-runtime/lib/bounds'], function (exports, _glimmerRuntimeLibDomInterfaces, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibTemplate, _glimmerRuntimeLibSymbolTable, _glimmerRuntimeLibReferences, _glimmerRuntimeLibSyntaxCore, _glimmerRuntimeLibCompiledOpcodesBuilder, _glimmerRuntimeLibCompiler, _glimmerRuntimeLibOpcodeBuilder, _glimmerRuntimeLibCompiledBlocks, _glimmerRuntimeLibDomAttributeManagers, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerRuntimeLibCompiledExpressions, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibCompiledExpressionsFunction, _glimmerRuntimeLibHelpersGetDynamicVar, _glimmerRuntimeLibSyntaxBuiltinsWithDynamicVars, _glimmerRuntimeLibSyntaxBuiltinsInElement, _glimmerRuntimeLibVm, _glimmerRuntimeLibUpsert, _glimmerRuntimeLibEnvironment, _glimmerRuntimeLibPartial, _glimmerRuntimeLibComponentInterfaces, _glimmerRuntimeLibModifierInterfaces, _glimmerRuntimeLibDomHelper, _glimmerRuntimeLibBuilder, _glimmerRuntimeLibBounds) { - 'use strict'; + var possibleQueryParams = args[args.length - 1]; + if (possibleQueryParams && possibleQueryParams.hasOwnProperty('queryParams')) { + queryParams = args.pop().queryParams; + } else { + queryParams = {}; + } - exports.ATTRIBUTE_SYNTAX = _glimmerRuntimeLibSyntax.ATTRIBUTE; - exports.StatementSyntax = _glimmerRuntimeLibSyntax.Statement; - exports.ExpressionSyntax = _glimmerRuntimeLibSyntax.Expression; - exports.AttributeSyntax = _glimmerRuntimeLibSyntax.Attribute; - exports.StatementCompilationBuffer = _glimmerRuntimeLibSyntax.StatementCompilationBuffer; - exports.SymbolLookup = _glimmerRuntimeLibSyntax.SymbolLookup; - exports.CompileInto = _glimmerRuntimeLibSyntax.CompileInto; - exports.isAttribute = _glimmerRuntimeLibSyntax.isAttribute; - exports.templateFactory = _glimmerRuntimeLibTemplate.default; - exports.TemplateFactory = _glimmerRuntimeLibTemplate.TemplateFactory; - exports.Template = _glimmerRuntimeLibTemplate.Template; - exports.SymbolTable = _glimmerRuntimeLibSymbolTable.default; - exports.NULL_REFERENCE = _glimmerRuntimeLibReferences.NULL_REFERENCE; - exports.UNDEFINED_REFERENCE = _glimmerRuntimeLibReferences.UNDEFINED_REFERENCE; - exports.PrimitiveReference = _glimmerRuntimeLibReferences.PrimitiveReference; - exports.ConditionalReference = _glimmerRuntimeLibReferences.ConditionalReference; - exports.Blocks = _glimmerRuntimeLibSyntaxCore.Blocks; - exports.OptimizedAppend = _glimmerRuntimeLibSyntaxCore.OptimizedAppend; - exports.UnoptimizedAppend = _glimmerRuntimeLibSyntaxCore.UnoptimizedAppend; - exports.Unknown = _glimmerRuntimeLibSyntaxCore.Unknown; - exports.StaticAttr = _glimmerRuntimeLibSyntaxCore.StaticAttr; - exports.DynamicAttr = _glimmerRuntimeLibSyntaxCore.DynamicAttr; - exports.ArgsSyntax = _glimmerRuntimeLibSyntaxCore.Args; - exports.NamedArgsSyntax = _glimmerRuntimeLibSyntaxCore.NamedArgs; - exports.PositionalArgsSyntax = _glimmerRuntimeLibSyntaxCore.PositionalArgs; - exports.RefSyntax = _glimmerRuntimeLibSyntaxCore.Ref; - exports.GetNamedParameterSyntax = _glimmerRuntimeLibSyntaxCore.GetArgument; - exports.GetSyntax = _glimmerRuntimeLibSyntaxCore.Get; - exports.ValueSyntax = _glimmerRuntimeLibSyntaxCore.Value; - exports.OpenElement = _glimmerRuntimeLibSyntaxCore.OpenElement; - exports.HelperSyntax = _glimmerRuntimeLibSyntaxCore.Helper; - exports.BlockSyntax = _glimmerRuntimeLibSyntaxCore.Block; - exports.OpenPrimitiveElementSyntax = _glimmerRuntimeLibSyntaxCore.OpenPrimitiveElement; - exports.CloseElementSyntax = _glimmerRuntimeLibSyntaxCore.CloseElement; - exports.OpcodeBuilderDSL = _glimmerRuntimeLibCompiledOpcodesBuilder.default; - exports.Compiler = _glimmerRuntimeLibCompiler.default; - exports.Compilable = _glimmerRuntimeLibCompiler.Compilable; - exports.CompileIntoList = _glimmerRuntimeLibCompiler.CompileIntoList; - exports.compileLayout = _glimmerRuntimeLibCompiler.compileLayout; - exports.ComponentBuilder = _glimmerRuntimeLibOpcodeBuilder.ComponentBuilder; - exports.StaticDefinition = _glimmerRuntimeLibOpcodeBuilder.StaticDefinition; - exports.DynamicDefinition = _glimmerRuntimeLibOpcodeBuilder.DynamicDefinition; - exports.Block = _glimmerRuntimeLibCompiledBlocks.Block; - exports.CompiledBlock = _glimmerRuntimeLibCompiledBlocks.CompiledBlock; - exports.Layout = _glimmerRuntimeLibCompiledBlocks.Layout; - exports.InlineBlock = _glimmerRuntimeLibCompiledBlocks.InlineBlock; - exports.EntryPoint = _glimmerRuntimeLibCompiledBlocks.EntryPoint; - exports.IAttributeManager = _glimmerRuntimeLibDomAttributeManagers.AttributeManager; - exports.AttributeManager = _glimmerRuntimeLibDomAttributeManagers.AttributeManager; - exports.PropertyManager = _glimmerRuntimeLibDomAttributeManagers.PropertyManager; - exports.INPUT_VALUE_PROPERTY_MANAGER = _glimmerRuntimeLibDomAttributeManagers.INPUT_VALUE_PROPERTY_MANAGER; - exports.defaultManagers = _glimmerRuntimeLibDomAttributeManagers.defaultManagers; - exports.defaultAttributeManagers = _glimmerRuntimeLibDomAttributeManagers.defaultAttributeManagers; - exports.defaultPropertyManagers = _glimmerRuntimeLibDomAttributeManagers.defaultPropertyManagers; - exports.readDOMAttr = _glimmerRuntimeLibDomAttributeManagers.readDOMAttr; - exports.normalizeTextValue = _glimmerRuntimeLibCompiledOpcodesContent.normalizeTextValue; - exports.CompiledExpression = _glimmerRuntimeLibCompiledExpressions.CompiledExpression; - exports.CompiledArgs = _glimmerRuntimeLibCompiledExpressionsArgs.CompiledArgs; - exports.CompiledNamedArgs = _glimmerRuntimeLibCompiledExpressionsArgs.CompiledNamedArgs; - exports.CompiledPositionalArgs = _glimmerRuntimeLibCompiledExpressionsArgs.CompiledPositionalArgs; - exports.EvaluatedArgs = _glimmerRuntimeLibCompiledExpressionsArgs.EvaluatedArgs; - exports.EvaluatedNamedArgs = _glimmerRuntimeLibCompiledExpressionsArgs.EvaluatedNamedArgs; - exports.EvaluatedPositionalArgs = _glimmerRuntimeLibCompiledExpressionsArgs.EvaluatedPositionalArgs; - exports.FunctionExpression = _glimmerRuntimeLibCompiledExpressionsFunction.FunctionExpression; - exports.getDynamicVar = _glimmerRuntimeLibHelpersGetDynamicVar.default; - exports.WithDynamicVarsSyntax = _glimmerRuntimeLibSyntaxBuiltinsWithDynamicVars.default; - exports.InElementSyntax = _glimmerRuntimeLibSyntaxBuiltinsInElement.default; - exports.VM = _glimmerRuntimeLibVm.PublicVM; - exports.UpdatingVM = _glimmerRuntimeLibVm.UpdatingVM; - exports.RenderResult = _glimmerRuntimeLibVm.RenderResult; - exports.SafeString = _glimmerRuntimeLibUpsert.SafeString; - exports.isSafeString = _glimmerRuntimeLibUpsert.isSafeString; - exports.Scope = _glimmerRuntimeLibEnvironment.Scope; - exports.Environment = _glimmerRuntimeLibEnvironment.default; - exports.Helper = _glimmerRuntimeLibEnvironment.Helper; - exports.ParsedStatement = _glimmerRuntimeLibEnvironment.ParsedStatement; - exports.DynamicScope = _glimmerRuntimeLibEnvironment.DynamicScope; - exports.PartialDefinition = _glimmerRuntimeLibPartial.PartialDefinition; - exports.Component = _glimmerRuntimeLibComponentInterfaces.Component; - exports.ComponentClass = _glimmerRuntimeLibComponentInterfaces.ComponentClass; - exports.ComponentManager = _glimmerRuntimeLibComponentInterfaces.ComponentManager; - exports.ComponentDefinition = _glimmerRuntimeLibComponentInterfaces.ComponentDefinition; - exports.ComponentLayoutBuilder = _glimmerRuntimeLibComponentInterfaces.ComponentLayoutBuilder; - exports.ComponentAttrsBuilder = _glimmerRuntimeLibComponentInterfaces.ComponentAttrsBuilder; - exports.isComponentDefinition = _glimmerRuntimeLibComponentInterfaces.isComponentDefinition; - exports.ModifierManager = _glimmerRuntimeLibModifierInterfaces.ModifierManager; - exports.DOMChanges = _glimmerRuntimeLibDomHelper.default; - exports.IDOMChanges = _glimmerRuntimeLibDomHelper.DOMChanges; - exports.DOMTreeConstruction = _glimmerRuntimeLibDomHelper.DOMTreeConstruction; - exports.isWhitespace = _glimmerRuntimeLibDomHelper.isWhitespace; - exports.insertHTMLBefore = _glimmerRuntimeLibDomHelper.insertHTMLBefore; - exports.Simple = _glimmerRuntimeLibDomInterfaces; - exports.ElementStack = _glimmerRuntimeLibBuilder.ElementStack; - exports.ElementOperations = _glimmerRuntimeLibBuilder.ElementOperations; - exports.Bounds = _glimmerRuntimeLibBounds.default; - exports.ConcreteBounds = _glimmerRuntimeLibBounds.ConcreteBounds; -}); - -enifed("glimmer-runtime/lib/bounds", ["exports"], function (exports) { - "use strict"; + var targetRouteName = args.shift(); + return this._doTransition(targetRouteName, args, queryParams); + }, - exports.bounds = bounds; - exports.single = single; - exports.move = move; - exports.clear = clear; + intermediateTransitionTo: function () { + var _router, + _this5 = this; - var Cursor = function Cursor(element, nextSibling) { - this.element = element; - this.nextSibling = nextSibling; - }; + (_router = this.router).intermediateTransitionTo.apply(_router, arguments); - exports.Cursor = Cursor; + updatePaths(this); - var RealDOMBounds = (function () { - function RealDOMBounds(bounds) { - this.bounds = bounds; + _emberMetal.runInDebug(function () { + var infos = _this5.router.currentHandlerInfos; + if (_emberMetal.get(_this5, 'namespace').LOG_TRANSITIONS) { + _emberConsole.default.log('Intermediate-transitioned into \'' + EmberRouter._routePath(infos) + '\''); } + }); + }, - RealDOMBounds.prototype.parentElement = function parentElement() { - return this.bounds.parentElement(); - }; + replaceWith: function () { + return this.transitionTo.apply(this, arguments).method('replace'); + }, - RealDOMBounds.prototype.firstNode = function firstNode() { - return this.bounds.firstNode(); - }; + generate: function () { + var _router2; - RealDOMBounds.prototype.lastNode = function lastNode() { - return this.bounds.lastNode(); - }; + var url = (_router2 = this.router).generate.apply(_router2, arguments); + return this.location.formatURL(url); + }, - return RealDOMBounds; - })(); + /** + Determines if the supplied route is currently active. + @method isActive + @param routeName + @return {Boolean} + @private + */ + isActive: function (routeName) { + var router = this.router; + return router.isActive.apply(router, arguments); + }, - exports.RealDOMBounds = RealDOMBounds; + /** + An alternative form of `isActive` that doesn't require + manual concatenation of the arguments into a single + array. + @method isActiveIntent + @param routeName + @param models + @param queryParams + @return {Boolean} + @private + @since 1.7.0 + */ + isActiveIntent: function (routeName, models, queryParams) { + return this.currentState.isActiveIntent(routeName, models, queryParams); + }, - var ConcreteBounds = (function () { - function ConcreteBounds(parentNode, first, last) { - this.parentNode = parentNode; - this.first = first; - this.last = last; - } + send: function (name, context) { + var _router3; - ConcreteBounds.prototype.parentElement = function parentElement() { - return this.parentNode; - }; + (_router3 = this.router).trigger.apply(_router3, arguments); + }, - ConcreteBounds.prototype.firstNode = function firstNode() { - return this.first; - }; + /** + Does this router instance have the given route. + @method hasRoute + @return {Boolean} + @private + */ + hasRoute: function (route) { + return this.router.hasRoute(route); + }, - ConcreteBounds.prototype.lastNode = function lastNode() { - return this.last; - }; + /** + Resets the state of the router by clearing the current route + handlers and deactivating them. + @private + @method reset + */ + reset: function () { + if (this.router) { + this.router.reset(); + } + }, - return ConcreteBounds; - })(); + willDestroy: function () { + if (this._toplevelView) { + this._toplevelView.destroy(); + this._toplevelView = null; + } - exports.ConcreteBounds = ConcreteBounds; + this._super.apply(this, arguments); - var SingleNodeBounds = (function () { - function SingleNodeBounds(parentNode, node) { - this.parentNode = parentNode; - this.node = node; - } + this.reset(); - SingleNodeBounds.prototype.parentElement = function parentElement() { - return this.parentNode; - }; + var instances = this._engineInstances; + for (var _name in instances) { + for (var id in instances[_name]) { + _emberMetal.run(instances[_name][id], 'destroy'); + } + } + }, - SingleNodeBounds.prototype.firstNode = function firstNode() { - return this.node; - }; + /* + Called when an active route's query parameter has changed. + These changes are batched into a runloop run and trigger + a single transition. + */ + _activeQPChanged: function (queryParameterName, newValue) { + this._queuedQPChanges[queryParameterName] = newValue; + _emberMetal.run.once(this, this._fireQueryParamTransition); + }, - SingleNodeBounds.prototype.lastNode = function lastNode() { - return this.node; - }; + _updatingQPChanged: function (queryParameterName) { + if (!this._qpUpdates) { + this._qpUpdates = {}; + } + this._qpUpdates[queryParameterName] = true; + }, - return SingleNodeBounds; - })(); + /* + Triggers a transition to a route based on query parameter changes. + This is called once per runloop, to batch changes. + e.g. + if these methods are called in succession: + this._activeQPChanged('foo', '10'); + // results in _queuedQPChanges = { foo: '10' } + this._activeQPChanged('bar', false); + // results in _queuedQPChanges = { foo: '10', bar: false } + _queuedQPChanges will represent both of these changes + and the transition using `transitionTo` will be triggered + once. + */ + _fireQueryParamTransition: function () { + this.transitionTo({ queryParams: this._queuedQPChanges }); + this._resetQueuedQueryParameterChanges(); + }, - exports.SingleNodeBounds = SingleNodeBounds; + _setupLocation: function () { + var location = _emberMetal.get(this, 'location'); + var rootURL = _emberMetal.get(this, 'rootURL'); + var owner = _emberUtils.getOwner(this); - function bounds(parent, first, last) { - return new ConcreteBounds(parent, first, last); - } + if ('string' === typeof location && owner) { + var resolvedLocation = owner.lookup('location:' + location); - function single(parent, node) { - return new SingleNodeBounds(parent, node); - } + if ('undefined' !== typeof resolvedLocation) { + location = _emberMetal.set(this, 'location', resolvedLocation); + } else { + // Allow for deprecated registration of custom location API's + var options = { + implementation: location + }; - function move(bounds, reference) { - var parent = bounds.parentElement(); - var first = bounds.firstNode(); - var last = bounds.lastNode(); - var node = first; - while (node) { - var next = node.nextSibling; - parent.insertBefore(node, reference); - if (node === last) return next; - node = next; + location = _emberMetal.set(this, 'location', _emberRoutingLocationApi.default.create(options)); } - return null; - } + } - function clear(bounds) { - var parent = bounds.parentElement(); - var first = bounds.firstNode(); - var last = bounds.lastNode(); - var node = first; - while (node) { - var next = node.nextSibling; - parent.removeChild(node); - if (node === last) return next; - node = next; + if (location !== null && typeof location === 'object') { + if (rootURL) { + _emberMetal.set(location, 'rootURL', rootURL); } - return null; - } -}); -enifed('glimmer-runtime/lib/builder', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-util', 'glimmer-runtime/lib/compiled/opcodes/dom'], function (exports, _glimmerRuntimeLibBounds, _glimmerUtil, _glimmerRuntimeLibCompiledOpcodesDom) { - 'use strict'; + // Allow the location to do any feature detection, such as AutoLocation + // detecting history support. This gives it a chance to set its + // `cancelRouterSetup` property which aborts routing. + if (typeof location.detect === 'function') { + location.detect(); + } - var First = (function () { - function First(node) { - this.node = node; + // ensure that initState is called AFTER the rootURL is set on + // the location instance + if (typeof location.initState === 'function') { + location.initState(); } + } + }, - First.prototype.firstNode = function firstNode() { - return this.node; - }; + _getHandlerFunction: function () { + var _this6 = this; - return First; - })(); + var seen = new _emberUtils.EmptyObject(); + var owner = _emberUtils.getOwner(this); + + return function (name) { + var routeName = name; + var routeOwner = owner; + var engineInfo = _this6._engineInfoByRoute[routeName]; + + if (engineInfo) { + var engineInstance = _this6._getEngineInstance(engineInfo); - var Last = (function () { - function Last(node) { - this.node = node; + routeOwner = engineInstance; + routeName = engineInfo.localFullName; } - Last.prototype.lastNode = function lastNode() { - return this.node; - }; + var fullRouteName = 'route:' + routeName; - return Last; - })(); + var handler = routeOwner.lookup(fullRouteName); - var Fragment = (function () { - function Fragment(bounds) { - this.bounds = bounds; + if (seen[name]) { + return handler; } - Fragment.prototype.parentElement = function parentElement() { - return this.bounds.parentElement(); - }; + seen[name] = true; - Fragment.prototype.firstNode = function firstNode() { - return this.bounds.firstNode(); - }; + if (!handler) { + var DefaultRoute = routeOwner[_container.FACTORY_FOR]('route:basic').class; + routeOwner.register(fullRouteName, DefaultRoute.extend()); + handler = routeOwner.lookup(fullRouteName); - Fragment.prototype.lastNode = function lastNode() { - return this.bounds.lastNode(); - }; + _emberMetal.runInDebug(function () { + if (_emberMetal.get(_this6, 'namespace.LOG_ACTIVE_GENERATION')) { + _emberMetal.info('generated -> ' + fullRouteName, { fullName: fullRouteName }); + } + }); + } - Fragment.prototype.update = function update(bounds) { - this.bounds = bounds; - }; + handler._setRouteName(routeName); + handler._populateQPMeta(); - return Fragment; - })(); + if (engineInfo && !_emberRoutingSystemRoute.hasDefaultSerialize(handler)) { + throw new Error('Defining a custom serialize method on an Engine route is not supported.'); + } - exports.Fragment = Fragment; - - var ElementStack = (function () { - function ElementStack(env, parentNode, nextSibling) { - this.constructing = null; - this.operations = null; - this.elementStack = new _glimmerUtil.Stack(); - this.nextSiblingStack = new _glimmerUtil.Stack(); - this.blockStack = new _glimmerUtil.Stack(); - this.env = env; - this.dom = env.getAppendOperations(); - this.updateOperations = env.getDOM(); - this.element = parentNode; - this.nextSibling = nextSibling; - this.defaultOperations = new _glimmerRuntimeLibCompiledOpcodesDom.SimpleElementOperations(env); - this.elementStack.push(this.element); - this.nextSiblingStack.push(this.nextSibling); - } - - ElementStack.forInitialRender = function forInitialRender(env, parentNode, nextSibling) { - return new ElementStack(env, parentNode, nextSibling); - }; + return handler; + }; + }, - ElementStack.resume = function resume(env, tracker, nextSibling) { - var parentNode = tracker.parentElement(); - var stack = new ElementStack(env, parentNode, nextSibling); - stack.pushBlockTracker(tracker); - return stack; - }; + _getSerializerFunction: function () { + var _this7 = this; - ElementStack.prototype.block = function block() { - return this.blockStack.current; - }; + return function (name) { + var engineInfo = _this7._engineInfoByRoute[name]; - ElementStack.prototype.popElement = function popElement() { - var elementStack = this.elementStack; - var nextSiblingStack = this.nextSiblingStack; + // If this is not an Engine route, we fall back to the handler for serialization + if (!engineInfo) { + return; + } - var topElement = elementStack.pop(); - nextSiblingStack.pop(); - this.element = elementStack.current; - this.nextSibling = nextSiblingStack.current; - return topElement; - }; + return engineInfo.serializeMethod || _emberRoutingSystemRoute.defaultSerialize; + }; + }, - ElementStack.prototype.pushSimpleBlock = function pushSimpleBlock() { - var tracker = new SimpleBlockTracker(this.element); - this.pushBlockTracker(tracker); - return tracker; - }; + _setupRouter: function (router, location) { + var lastURL = undefined; + var emberRouter = this; - ElementStack.prototype.pushUpdatableBlock = function pushUpdatableBlock() { - var tracker = new UpdatableBlockTracker(this.element); - this.pushBlockTracker(tracker); - return tracker; - }; + router.getHandler = this._getHandlerFunction(); + router.getSerializer = this._getSerializerFunction(); - ElementStack.prototype.pushBlockTracker = function pushBlockTracker(tracker) { - var isRemote = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; + var doUpdateURL = function () { + location.setURL(lastURL); + _emberMetal.set(emberRouter, 'currentURL', lastURL); + }; - var current = this.blockStack.current; - if (current !== null) { - current.newDestroyable(tracker); - if (!isRemote) { - current.newBounds(tracker); - } - } - this.blockStack.push(tracker); - return tracker; - }; + router.updateURL = function (path) { + lastURL = path; + _emberMetal.run.once(doUpdateURL); + }; - ElementStack.prototype.pushBlockList = function pushBlockList(list) { - var tracker = new BlockListTracker(this.element, list); - var current = this.blockStack.current; - if (current !== null) { - current.newDestroyable(tracker); - current.newBounds(tracker); - } - this.blockStack.push(tracker); - return tracker; - }; + if (location.replaceURL) { + (function () { + var doReplaceURL = function () { + location.replaceURL(lastURL); + _emberMetal.set(emberRouter, 'currentURL', lastURL); + }; - ElementStack.prototype.popBlock = function popBlock() { - this.blockStack.current.finalize(this); - return this.blockStack.pop(); - }; + router.replaceURL = function (path) { + lastURL = path; + _emberMetal.run.once(doReplaceURL); + }; + })(); + } - ElementStack.prototype.openElement = function openElement(tag) { - var operations = arguments.length <= 1 || arguments[1] === undefined ? this.defaultOperations : arguments[1]; + router.didTransition = function (infos) { + emberRouter.didTransition(infos); + }; - var element = this.dom.createElement(tag, this.element); - this.constructing = element; - this.operations = operations; - return element; - }; + router.willTransition = function (oldInfos, newInfos, transition) { + emberRouter.willTransition(oldInfos, newInfos, transition); + }; + }, - ElementStack.prototype.flushElement = function flushElement() { - var parent = this.element; - var element = this.constructing; - this.dom.insertBefore(parent, element, this.nextSibling); - this.constructing = null; - this.operations = null; - this.pushElement(element); - this.blockStack.current.openElement(element); - }; + /** + Serializes the given query params according to their QP meta information. + @private + @method _serializeQueryParams + @param {Arrray} handlerInfos + @param {Object} queryParams + @return {Void} + */ + _serializeQueryParams: function (handlerInfos, queryParams) { + var _this8 = this; - ElementStack.prototype.pushRemoteElement = function pushRemoteElement(element) { - this.pushElement(element); - var tracker = new RemoteBlockTracker(element); - this.pushBlockTracker(tracker, true); - }; + forEachQueryParam(this, handlerInfos, queryParams, function (key, value, qp) { + if (qp) { + delete queryParams[key]; + queryParams[qp.urlKey] = qp.route.serializeQueryParam(value, qp.urlKey, qp.type); + } else if (value === undefined) { + return; // We don't serialize undefined values + } else { + queryParams[key] = _this8._serializeQueryParam(value, _emberRuntime.typeOf(value)); + } + }); + }, - ElementStack.prototype.popRemoteElement = function popRemoteElement() { - this.popBlock(); - this.popElement(); - }; + /** + Serializes the value of a query parameter based on a type + @private + @method _serializeQueryParam + @param {Object} value + @param {String} type + */ + _serializeQueryParam: function (value, type) { + if (type === 'array') { + return JSON.stringify(value); + } - ElementStack.prototype.pushElement = function pushElement(element) { - this.element = element; - this.elementStack.push(element); - this.nextSibling = null; - this.nextSiblingStack.push(null); - }; + return '' + value; + }, - ElementStack.prototype.newDestroyable = function newDestroyable(d) { - this.blockStack.current.newDestroyable(d); - }; + /** + Deserializes the given query params according to their QP meta information. + @private + @method _deserializeQueryParams + @param {Array} handlerInfos + @param {Object} queryParams + @return {Void} + */ + _deserializeQueryParams: function (handlerInfos, queryParams) { + forEachQueryParam(this, handlerInfos, queryParams, function (key, value, qp) { + // If we don't have QP meta info for a given key, then we do nothing + // because all values will be treated as strings + if (qp) { + delete queryParams[key]; + queryParams[qp.prop] = qp.route.deserializeQueryParam(value, qp.urlKey, qp.type); + } + }); + }, - ElementStack.prototype.newBounds = function newBounds(bounds) { - this.blockStack.current.newBounds(bounds); - }; + /** + Deserializes the value of a query parameter based on a default type + @private + @method _deserializeQueryParam + @param {Object} value + @param {String} defaultType + */ + _deserializeQueryParam: function (value, defaultType) { + if (defaultType === 'boolean') { + return value === 'true' ? true : false; + } else if (defaultType === 'number') { + return Number(value).valueOf(); + } else if (defaultType === 'array') { + return _emberRuntime.A(JSON.parse(value)); + } - ElementStack.prototype.appendText = function appendText(string) { - var dom = this.dom; + return value; + }, - var text = dom.createTextNode(string); - dom.insertBefore(this.element, text, this.nextSibling); - this.blockStack.current.newNode(text); - return text; - }; + /** + Removes (prunes) any query params with default values from the given QP + object. Default values are determined from the QP meta information per key. + @private + @method _pruneDefaultQueryParamValues + @param {Array} handlerInfos + @param {Object} queryParams + @return {Void} + */ + _pruneDefaultQueryParamValues: function (handlerInfos, queryParams) { + var qps = this._queryParamsFor(handlerInfos); + for (var key in queryParams) { + var qp = qps.map[key]; + if (qp && qp.serializedDefaultValue === queryParams[key]) { + delete queryParams[key]; + } + } + }, - ElementStack.prototype.appendComment = function appendComment(string) { - var dom = this.dom; + _doTransition: function (_targetRouteName, models, _queryParams) { + var _router4; - var comment = dom.createComment(string); - dom.insertBefore(this.element, comment, this.nextSibling); - this.blockStack.current.newNode(comment); - return comment; - }; + var targetRouteName = _targetRouteName || _emberRoutingUtils.getActiveTargetName(this.router); + _emberMetal.assert('The route ' + targetRouteName + ' was not found', targetRouteName && this.router.hasRoute(targetRouteName)); - ElementStack.prototype.setStaticAttribute = function setStaticAttribute(name, value) { - this.operations.addStaticAttribute(this.constructing, name, value); - }; + var queryParams = {}; - ElementStack.prototype.setStaticAttributeNS = function setStaticAttributeNS(namespace, name, value) { - this.operations.addStaticAttributeNS(this.constructing, namespace, name, value); - }; + this._processActiveTransitionQueryParams(targetRouteName, models, queryParams, _queryParams); - ElementStack.prototype.setDynamicAttribute = function setDynamicAttribute(name, reference, isTrusting) { - this.operations.addDynamicAttribute(this.constructing, name, reference, isTrusting); - }; + _emberUtils.assign(queryParams, _queryParams); + this._prepareQueryParams(targetRouteName, models, queryParams); - ElementStack.prototype.setDynamicAttributeNS = function setDynamicAttributeNS(namespace, name, reference, isTrusting) { - this.operations.addDynamicAttributeNS(this.constructing, namespace, name, reference, isTrusting); - }; + var transitionArgs = _emberRoutingUtils.routeArgs(targetRouteName, models, queryParams); + var transition = (_router4 = this.router).transitionTo.apply(_router4, transitionArgs); - ElementStack.prototype.closeElement = function closeElement() { - this.blockStack.current.closeElement(); - this.popElement(); - }; + didBeginTransition(transition, this); - return ElementStack; - })(); + return transition; + }, - exports.ElementStack = ElementStack; + _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 SimpleBlockTracker = (function () { - function SimpleBlockTracker(parent) { - this.parent = parent; - this.first = null; - this.last = null; - this.destroyables = null; - this.nesting = 0; + var unchangedQPs = {}; + var qpUpdates = this._qpUpdates || {}; + for (var key in this.router.activeTransition.queryParams) { + if (!qpUpdates[key]) { + unchangedQPs[key] = this.router.activeTransition.queryParams[key]; } + } - SimpleBlockTracker.prototype.destroy = function destroy() { - var destroyables = this.destroyables; + // 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); + _emberUtils.assign(queryParams, unchangedQPs); + }, - if (destroyables && destroyables.length) { - for (var i = 0; i < destroyables.length; i++) { - destroyables[i].destroy(); - } - } - }; + /** + Prepares the query params for a URL or Transition. Restores any undefined QP + keys/values, serializes all values, and then prunes any default values. + @private + @method _prepareQueryParams + @param {String} targetRouteName + @param {Array} models + @param {Object} queryParams + @return {Void} + */ + _prepareQueryParams: function (targetRouteName, models, queryParams) { + var state = calculatePostTransitionState(this, targetRouteName, models); + this._hydrateUnsuppliedQueryParams(state, queryParams); + this._serializeQueryParams(state.handlerInfos, queryParams); + this._pruneDefaultQueryParamValues(state.handlerInfos, queryParams); + }, - SimpleBlockTracker.prototype.parentElement = function parentElement() { - return this.parent; - }; + /** + Returns the meta information for the query params of a given route. This + will be overriden to allow support for lazy routes. + @private + @method _getQPMeta + @param {HandlerInfo} handlerInfo + @return {Object} + */ + _getQPMeta: function (handlerInfo) { + var route = handlerInfo.handler; + return route && _emberMetal.get(route, '_qp'); + }, + + /** + Returns a merged query params meta object for a given set of handlerInfos. + Useful for knowing what query params are available for a given route hierarchy. + @private + @method _queryParamsFor + @param {Array} handlerInfos + @return {Object} + */ + _queryParamsFor: function (handlerInfos) { + var leafRouteName = handlerInfos[handlerInfos.length - 1].name; + if (this._qpCache[leafRouteName]) { + return this._qpCache[leafRouteName]; + } + + var shouldCache = true; + var qpsByUrlKey = {}; + var map = {}; + var qps = []; - SimpleBlockTracker.prototype.firstNode = function firstNode() { - return this.first && this.first.firstNode(); - }; + for (var i = 0; i < handlerInfos.length; ++i) { + var qpMeta = this._getQPMeta(handlerInfos[i]); - SimpleBlockTracker.prototype.lastNode = function lastNode() { - return this.last && this.last.lastNode(); - }; + if (!qpMeta) { + shouldCache = false; + continue; + } - SimpleBlockTracker.prototype.openElement = function openElement(element) { - this.newNode(element); - this.nesting++; - }; + // Loop over each QP to make sure we don't have any collisions by urlKey + for (var _i = 0; _i < qpMeta.qps.length; _i++) { + var qp = qpMeta.qps[_i]; + var urlKey = qp.urlKey; + var qpOther = qpsByUrlKey[urlKey]; - SimpleBlockTracker.prototype.closeElement = function closeElement() { - this.nesting--; - }; + if (qpOther && qpOther.controllerName !== qp.controllerName) { + var otherQP = qpsByUrlKey[urlKey]; + _emberMetal.assert('You\'re not allowed to have more than one controller property map to the same query param key, but both `' + otherQP.scopedPropertyName + '` and `' + qp.scopedPropertyName + '` map to `' + 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. `' + otherQP.prop + ': { as: \'other-' + otherQP.prop + '\' }`', false); + } - SimpleBlockTracker.prototype.newNode = function newNode(node) { - if (this.nesting !== 0) return; - if (!this.first) { - this.first = new First(node); - } - this.last = new Last(node); - }; + qpsByUrlKey[urlKey] = qp; + qps.push(qp); + } - SimpleBlockTracker.prototype.newBounds = function newBounds(bounds) { - if (this.nesting !== 0) return; - if (!this.first) { - this.first = bounds; - } - this.last = bounds; - }; + _emberUtils.assign(map, qpMeta.map); + } - SimpleBlockTracker.prototype.newDestroyable = function newDestroyable(d) { - this.destroyables = this.destroyables || []; - this.destroyables.push(d); - }; + var finalQPMeta = { + qps: qps, + map: map + }; - SimpleBlockTracker.prototype.finalize = function finalize(stack) { - if (!this.first) { - stack.appendComment(''); - } - }; + if (shouldCache) { + this._qpCache[leafRouteName] = finalQPMeta; + } - return SimpleBlockTracker; - })(); + return finalQPMeta; + }, - exports.SimpleBlockTracker = SimpleBlockTracker; + /** + Maps all query param keys to their fully scoped property name of the form + `controllerName:propName`. + @private + @method _fullyScopeQueryParams + @param {String} leafRouteName + @param {Array} contexts + @param {Object} queryParams + @return {Void} + */ + _fullyScopeQueryParams: function (leafRouteName, contexts, queryParams) { + var state = calculatePostTransitionState(this, leafRouteName, contexts); + var handlerInfos = state.handlerInfos; - var RemoteBlockTracker = (function (_SimpleBlockTracker) { - babelHelpers.inherits(RemoteBlockTracker, _SimpleBlockTracker); + for (var i = 0, len = handlerInfos.length; i < len; ++i) { + var qpMeta = this._getQPMeta(handlerInfos[i]); - function RemoteBlockTracker() { - _SimpleBlockTracker.apply(this, arguments); + if (!qpMeta) { + continue; } - RemoteBlockTracker.prototype.destroy = function destroy() { - _SimpleBlockTracker.prototype.destroy.call(this); - _glimmerRuntimeLibBounds.clear(this); - }; - - return RemoteBlockTracker; - })(SimpleBlockTracker); + for (var j = 0, qpLen = qpMeta.qps.length; j < qpLen; ++j) { + var qp = qpMeta.qps[j]; - var UpdatableBlockTracker = (function (_SimpleBlockTracker2) { - babelHelpers.inherits(UpdatableBlockTracker, _SimpleBlockTracker2); + var presentProp = qp.prop in queryParams && qp.prop || qp.scopedPropertyName in queryParams && qp.scopedPropertyName || qp.urlKey in queryParams && qp.urlKey; - function UpdatableBlockTracker() { - _SimpleBlockTracker2.apply(this, arguments); + if (presentProp) { + if (presentProp !== qp.scopedPropertyName) { + queryParams[qp.scopedPropertyName] = queryParams[presentProp]; + delete queryParams[presentProp]; + } + } } + } + }, + + /** + Hydrates (adds/restores) any query params that have pre-existing values into + the given queryParams hash. This is what allows query params to be "sticky" + and restore their last known values for their scope. + @private + @method _hydrateUnsuppliedQueryParams + @param {TransitionState} state + @param {Object} queryParams + @return {Void} + */ + _hydrateUnsuppliedQueryParams: function (state, queryParams) { + var handlerInfos = state.handlerInfos; + var appCache = this._bucketCache; - UpdatableBlockTracker.prototype.reset = function reset(env) { - var destroyables = this.destroyables; + for (var i = 0; i < handlerInfos.length; ++i) { + var qpMeta = this._getQPMeta(handlerInfos[i]); - if (destroyables && destroyables.length) { - for (var i = 0; i < destroyables.length; i++) { - env.didDestroy(destroyables[i]); - } - } - var nextSibling = _glimmerRuntimeLibBounds.clear(this); - this.destroyables = null; - this.first = null; - this.last = null; - return nextSibling; - }; + if (!qpMeta) { + continue; + } - return UpdatableBlockTracker; - })(SimpleBlockTracker); + for (var j = 0, qpLen = qpMeta.qps.length; j < qpLen; ++j) { + var qp = qpMeta.qps[j]; - exports.UpdatableBlockTracker = UpdatableBlockTracker; + var presentProp = qp.prop in queryParams && qp.prop || qp.scopedPropertyName in queryParams && qp.scopedPropertyName || qp.urlKey in queryParams && qp.urlKey; - var BlockListTracker = (function () { - function BlockListTracker(parent, boundList) { - this.parent = parent; - this.boundList = boundList; - this.parent = parent; - this.boundList = boundList; + if (presentProp) { + if (presentProp !== qp.scopedPropertyName) { + queryParams[qp.scopedPropertyName] = queryParams[presentProp]; + delete queryParams[presentProp]; + } + } else { + var cacheKey = _emberRoutingUtils.calculateCacheKey(qp.route.fullRouteName, qp.parts, state.params); + queryParams[qp.scopedPropertyName] = appCache.lookup(cacheKey, qp.prop, qp.defaultValue); + } } + } + }, - BlockListTracker.prototype.destroy = function destroy() { - this.boundList.forEachNode(function (node) { - return node.destroy(); - }); - }; + _scheduleLoadingEvent: function (transition, originRoute) { + this._cancelSlowTransitionTimer(); + this._slowTransitionTimer = _emberMetal.run.scheduleOnce('routerTransitions', this, '_handleSlowTransition', transition, originRoute); + }, - BlockListTracker.prototype.parentElement = function parentElement() { - return this.parent; - }; + currentState: null, + targetState: null, - BlockListTracker.prototype.firstNode = function firstNode() { - return this.boundList.head().firstNode(); - }; + _handleSlowTransition: function (transition, originRoute) { + if (!this.router.activeTransition) { + // Don't fire an event if we've since moved on from + // the transition that put us in a loading state. + return; + } - BlockListTracker.prototype.lastNode = function lastNode() { - return this.boundList.tail().lastNode(); - }; + this.set('targetState', _emberRoutingSystemRouter_state.default.create({ + emberRouter: this, + routerJs: this.router, + routerJsState: this.router.activeTransition.state + })); - BlockListTracker.prototype.openElement = function openElement(element) { - _glimmerUtil.assert(false, 'Cannot openElement directly inside a block list'); - }; + transition.trigger(true, 'loading', transition, originRoute); + }, - BlockListTracker.prototype.closeElement = function closeElement() { - _glimmerUtil.assert(false, 'Cannot closeElement directly inside a block list'); - }; + _cancelSlowTransitionTimer: function () { + if (this._slowTransitionTimer) { + _emberMetal.run.cancel(this._slowTransitionTimer); + } + this._slowTransitionTimer = null; + }, - BlockListTracker.prototype.newNode = function newNode(node) { - _glimmerUtil.assert(false, 'Cannot create a new node directly inside a block list'); - }; + // These three helper functions are used to ensure errors aren't + // re-raised if they're handled in a route's error action. + _markErrorAsHandled: function (errorGuid) { + this._handledErrors[errorGuid] = true; + }, - BlockListTracker.prototype.newBounds = function newBounds(bounds) {}; + _isErrorHandled: function (errorGuid) { + return this._handledErrors[errorGuid]; + }, - BlockListTracker.prototype.newDestroyable = function newDestroyable(d) {}; + _clearHandledError: function (errorGuid) { + delete this._handledErrors[errorGuid]; + }, - BlockListTracker.prototype.finalize = function finalize(stack) {}; + _getEngineInstance: function (_ref) { + var name = _ref.name; + var instanceId = _ref.instanceId; + var mountPoint = _ref.mountPoint; - return BlockListTracker; - })(); -}); + var engineInstances = this._engineInstances; -enifed('glimmer-runtime/lib/compat/inner-html-fix', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/dom/helper'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibDomHelper) { - 'use strict'; + if (!engineInstances[name]) { + engineInstances[name] = new _emberUtils.EmptyObject(); + } - exports.domChanges = domChanges; - exports.treeConstruction = treeConstruction; - - var innerHTMLWrapper = { - colgroup: { depth: 2, before: '', after: '
    ' }, - table: { depth: 1, before: '', after: '
    ' }, - tbody: { depth: 2, before: '', after: '
    ' }, - tfoot: { depth: 2, before: '', after: '
    ' }, - thead: { depth: 2, before: '', after: '
    ' }, - tr: { depth: 3, before: '', after: '
    ' } - }; - // Patch: innerHTML Fix - // Browsers: IE9 - // Reason: IE9 don't allow us to set innerHTML on col, colgroup, frameset, - // html, style, table, tbody, tfoot, thead, title, tr. - // Fix: Wrap the innerHTML we are about to set in its parents, apply the - // wrapped innerHTML on a div, then move the unwrapped nodes into the - // target position. - - function domChanges(document, DOMChangesClass) { - if (!document) return DOMChangesClass; - if (!shouldApplyFix(document)) { - return DOMChangesClass; - } - var div = document.createElement('div'); - return (function (_DOMChangesClass) { - babelHelpers.inherits(DOMChangesWithInnerHTMLFix, _DOMChangesClass); - - function DOMChangesWithInnerHTMLFix() { - _DOMChangesClass.apply(this, arguments); - } + var engineInstance = engineInstances[name][instanceId]; - DOMChangesWithInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent, nextSibling, html) { - if (html === null || html === '') { - return _DOMChangesClass.prototype.insertHTMLBefore.call(this, parent, nextSibling, html); - } - var parentTag = parent.tagName.toLowerCase(); - var wrapper = innerHTMLWrapper[parentTag]; - if (wrapper === undefined) { - return _DOMChangesClass.prototype.insertHTMLBefore.call(this, parent, nextSibling, html); - } - return fixInnerHTML(parent, wrapper, div, html, nextSibling); - }; + if (!engineInstance) { + var owner = _emberUtils.getOwner(this); - return DOMChangesWithInnerHTMLFix; - })(DOMChangesClass); - } + _emberMetal.assert('You attempted to mount the engine \'' + name + '\' in your router map, but the engine can not be found.', owner.hasRegistration('engine:' + name)); - function treeConstruction(document, DOMTreeConstructionClass) { - if (!document) return DOMTreeConstructionClass; - if (!shouldApplyFix(document)) { - return DOMTreeConstructionClass; - } - var div = document.createElement('div'); - return (function (_DOMTreeConstructionClass) { - babelHelpers.inherits(DOMTreeConstructionWithInnerHTMLFix, _DOMTreeConstructionClass); + engineInstance = owner.buildChildEngineInstance(name, { + routable: true, + mountPoint: mountPoint + }); - function DOMTreeConstructionWithInnerHTMLFix() { - _DOMTreeConstructionClass.apply(this, arguments); - } + engineInstance.boot(); - DOMTreeConstructionWithInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent, html, reference) { - if (html === null || html === '') { - return _DOMTreeConstructionClass.prototype.insertHTMLBefore.call(this, parent, html, reference); - } - var parentTag = parent.tagName.toLowerCase(); - var wrapper = innerHTMLWrapper[parentTag]; - if (wrapper === undefined) { - return _DOMTreeConstructionClass.prototype.insertHTMLBefore.call(this, parent, html, reference); - } - return fixInnerHTML(parent, wrapper, div, html, reference); - }; + engineInstances[name][instanceId] = engineInstance; + } - return DOMTreeConstructionWithInnerHTMLFix; - })(DOMTreeConstructionClass); + return engineInstance; } + }); - function fixInnerHTML(parent, wrapper, div, html, reference) { - var wrappedHtml = wrapper.before + html + wrapper.after; - div.innerHTML = wrappedHtml; - var parentNode = div; - for (var i = 0; i < wrapper.depth; i++) { - parentNode = parentNode.childNodes[0]; - } + /* + Helper function for iterating over routes in a set of handlerInfos that are + at or above the given origin route. Example: if `originRoute` === 'foo.bar' + and the handlerInfos given were for 'foo.bar.baz', then the given callback + will be invoked with the routes for 'foo.bar', 'foo', and 'application' + individually. + + If the callback returns anything other than `true`, then iteration will stop. + + @private + @param {Route} originRoute + @param {Array} handlerInfos + @param {Function} callback + @return {Void} + */ + function forEachRouteAbove(originRoute, handlerInfos, callback) { + var originRouteFound = false; - var _moveNodesBefore = _glimmerRuntimeLibDomHelper.moveNodesBefore(parentNode, parent, reference); + for (var i = handlerInfos.length - 1; i >= 0; --i) { + var handlerInfo = handlerInfos[i]; + var route = handlerInfo.handler; - var first = _moveNodesBefore[0]; - var last = _moveNodesBefore[1]; + if (originRoute === route) { + originRouteFound = true; + } - return new _glimmerRuntimeLibBounds.ConcreteBounds(parent, first, last); - } - function shouldApplyFix(document) { - var table = document.createElement('table'); - try { - table.innerHTML = ''; - } catch (e) {} finally { - if (table.childNodes.length !== 0) { - // It worked as expected, no fix required - return false; - } - } - return true; - } -}); + if (!originRouteFound) { + continue; + } -enifed('glimmer-runtime/lib/compat/svg-inner-html-fix', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/dom/helper'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibDomHelper) { - 'use strict'; + if (callback(route) !== true) { + return; + } + } + } - exports.domChanges = domChanges; - exports.treeConstruction = treeConstruction; - - var SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; - // Patch: insertAdjacentHTML on SVG Fix - // Browsers: Safari, IE, Edge, Firefox ~33-34 - // Reason: insertAdjacentHTML does not exist on SVG elements in Safari. It is - // present but throws an exception on IE and Edge. Old versions of - // Firefox create nodes in the incorrect namespace. - // Fix: Since IE and Edge silently fail to create SVG nodes using - // innerHTML, and because Firefox may create nodes in the incorrect - // namespace using innerHTML on SVG elements, an HTML-string wrapping - // approach is used. A pre/post SVG tag is added to the string, then - // that whole string is added to a div. The created nodes are plucked - // out and applied to the target location on DOM. - - function domChanges(document, DOMChangesClass, svgNamespace) { - if (!document) return DOMChangesClass; - if (!shouldApplyFix(document, svgNamespace)) { - return DOMChangesClass; - } - var div = document.createElement('div'); - return (function (_DOMChangesClass) { - babelHelpers.inherits(DOMChangesWithSVGInnerHTMLFix, _DOMChangesClass); - - function DOMChangesWithSVGInnerHTMLFix() { - _DOMChangesClass.apply(this, arguments); - } + // These get invoked when an action bubbles above ApplicationRoute + // and are not meant to be overridable. + var defaultActionHandlers = { - DOMChangesWithSVGInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent, nextSibling, html) { - if (html === null || html === '') { - return _DOMChangesClass.prototype.insertHTMLBefore.call(this, parent, nextSibling, html); - } - if (parent.namespaceURI !== svgNamespace) { - return _DOMChangesClass.prototype.insertHTMLBefore.call(this, parent, nextSibling, html); - } - return fixSVG(parent, div, html, nextSibling); - }; + willResolveModel: function (transition, originRoute) { + originRoute.router._scheduleLoadingEvent(transition, originRoute); + }, - return DOMChangesWithSVGInnerHTMLFix; - })(DOMChangesClass); - } + // Attempt to find an appropriate error route or substate to enter. + error: function (error, transition, originRoute) { + var handlerInfos = transition.state.handlerInfos; + var router = originRoute.router; - function treeConstruction(document, TreeConstructionClass, svgNamespace) { - if (!document) return TreeConstructionClass; - if (!shouldApplyFix(document, svgNamespace)) { - return TreeConstructionClass; + forEachRouteAbove(originRoute, handlerInfos, function (route) { + // Check for the existence of an 'error' route. + // We don't check for an 'error' route on the originRoute, since that would + // technically be below where we're at in the route hierarchy. + if (originRoute !== route) { + var errorRouteName = findRouteStateName(route, 'error'); + if (errorRouteName) { + router.intermediateTransitionTo(errorRouteName, error); + return false; + } } - var div = document.createElement('div'); - return (function (_TreeConstructionClass) { - babelHelpers.inherits(TreeConstructionWithSVGInnerHTMLFix, _TreeConstructionClass); - function TreeConstructionWithSVGInnerHTMLFix() { - _TreeConstructionClass.apply(this, arguments); - } - - TreeConstructionWithSVGInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent, html, reference) { - if (html === null || html === '') { - return _TreeConstructionClass.prototype.insertHTMLBefore.call(this, parent, html, reference); - } - if (parent.namespaceURI !== svgNamespace) { - return _TreeConstructionClass.prototype.insertHTMLBefore.call(this, parent, html, reference); - } - return fixSVG(parent, div, html, reference); - }; - - return TreeConstructionWithSVGInnerHTMLFix; - })(TreeConstructionClass); - } + // Check for an 'error' substate route + var errorSubstateName = findRouteSubstateName(route, 'error'); + if (errorSubstateName) { + router.intermediateTransitionTo(errorSubstateName, error); + return false; + } - function fixSVG(parent, div, html, reference) { - // IE, Edge: also do not correctly support using `innerHTML` on SVG - // namespaced elements. So here a wrapper is used. - var wrappedHtml = '' + html + ''; - div.innerHTML = wrappedHtml; + return true; + }); - var _moveNodesBefore = _glimmerRuntimeLibDomHelper.moveNodesBefore(div.firstChild, parent, reference); + logError(error, 'Error while processing route: ' + transition.targetName); + }, - var first = _moveNodesBefore[0]; - var last = _moveNodesBefore[1]; + // Attempt to find an appropriate loading route or substate to enter. + loading: function (transition, originRoute) { + var handlerInfos = transition.state.handlerInfos; + var router = originRoute.router; - return new _glimmerRuntimeLibBounds.ConcreteBounds(parent, first, last); - } - function shouldApplyFix(document, svgNamespace) { - var svg = document.createElementNS(svgNamespace, 'svg'); - try { - svg['insertAdjacentHTML']('beforeEnd', ''); - } catch (e) {} finally { - // FF: Old versions will create a node in the wrong namespace - if (svg.childNodes.length === 1 && svg.firstChild.namespaceURI === SVG_NAMESPACE) { - // The test worked as expected, no fix required - return false; - } - svg = null; - return true; + forEachRouteAbove(originRoute, handlerInfos, function (route) { + // Check for the existence of a 'loading' route. + // We don't check for a 'loading' route on the originRoute, since that would + // technically be below where we're at in the route hierarchy. + if (originRoute !== route) { + var loadingRouteName = findRouteStateName(route, 'loading'); + if (loadingRouteName) { + router.intermediateTransitionTo(loadingRouteName); + return false; + } } - } -}); - -enifed('glimmer-runtime/lib/compat/text-node-merging-fix', ['exports'], function (exports) { - // Patch: Adjacent text node merging fix - // Browsers: IE, Edge, Firefox w/o inspector open - // Reason: These browsers will merge adjacent text nodes. For exmaple given - //
    Hello
    with div.insertAdjacentHTML(' world') browsers - // with proper behavior will populate div.childNodes with two items. - // These browsers will populate it with one merged node instead. - // Fix: Add these nodes to a wrapper element, then iterate the childNodes - // of that wrapper and move the nodes to their target location. Note - // that potential SVG bugs will have been handled before this fix. - // Note that this fix must only apply to the previous text node, as - // the base implementation of `insertHTMLBefore` already handles - // following text nodes correctly. - 'use strict'; - exports.domChanges = domChanges; - exports.treeConstruction = treeConstruction; - - function domChanges(document, DOMChangesClass) { - if (!document) return DOMChangesClass; - if (!shouldApplyFix(document)) { - return DOMChangesClass; + // Check for loading substate + var loadingSubstateName = findRouteSubstateName(route, 'loading'); + if (loadingSubstateName) { + router.intermediateTransitionTo(loadingSubstateName); + return false; } - return (function (_DOMChangesClass) { - babelHelpers.inherits(DOMChangesWithTextNodeMergingFix, _DOMChangesClass); - - function DOMChangesWithTextNodeMergingFix(document) { - _DOMChangesClass.call(this, document); - this.uselessComment = document.createComment(''); - } - DOMChangesWithTextNodeMergingFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent, nextSibling, html) { - if (html === null) { - return _DOMChangesClass.prototype.insertHTMLBefore.call(this, parent, nextSibling, html); - } - var didSetUselessComment = false; - var nextPrevious = nextSibling ? nextSibling.previousSibling : parent.lastChild; - if (nextPrevious && nextPrevious instanceof Text) { - didSetUselessComment = true; - parent.insertBefore(this.uselessComment, nextSibling); - } - var bounds = _DOMChangesClass.prototype.insertHTMLBefore.call(this, parent, nextSibling, html); - if (didSetUselessComment) { - parent.removeChild(this.uselessComment); - } - return bounds; - }; - - return DOMChangesWithTextNodeMergingFix; - })(DOMChangesClass); + // Don't bubble above pivot route. + return transition.pivotHandler !== route; + }); } + }; - function treeConstruction(document, TreeConstructionClass) { - if (!document) return TreeConstructionClass; - if (!shouldApplyFix(document)) { - return TreeConstructionClass; - } - return (function (_TreeConstructionClass) { - babelHelpers.inherits(TreeConstructionWithTextNodeMergingFix, _TreeConstructionClass); + function logError(_error, initialMessage) { + var errorArgs = []; + var error = undefined; + if (_error && typeof _error === 'object' && typeof _error.errorThrown === 'object') { + error = _error.errorThrown; + } else { + error = _error; + } - function TreeConstructionWithTextNodeMergingFix(document) { - _TreeConstructionClass.call(this, document); - this.uselessComment = this.createComment(''); - } + if (initialMessage) { + errorArgs.push(initialMessage); + } - TreeConstructionWithTextNodeMergingFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent, html, reference) { - if (html === null) { - return _TreeConstructionClass.prototype.insertHTMLBefore.call(this, parent, html, reference); - } - var didSetUselessComment = false; - var nextPrevious = reference ? reference.previousSibling : parent.lastChild; - if (nextPrevious && nextPrevious instanceof Text) { - didSetUselessComment = true; - parent.insertBefore(this.uselessComment, reference); - } - var bounds = _TreeConstructionClass.prototype.insertHTMLBefore.call(this, parent, html, reference); - if (didSetUselessComment) { - parent.removeChild(this.uselessComment); - } - return bounds; - }; + if (error) { + if (error.message) { + errorArgs.push(error.message); + } + if (error.stack) { + errorArgs.push(error.stack); + } - return TreeConstructionWithTextNodeMergingFix; - })(TreeConstructionClass); + if (typeof error === 'string') { + errorArgs.push(error); + } } - function shouldApplyFix(document) { - var mergingTextDiv = document.createElement('div'); - mergingTextDiv.innerHTML = 'first'; - mergingTextDiv.insertAdjacentHTML('beforeEnd', 'second'); - if (mergingTextDiv.childNodes.length === 2) { - mergingTextDiv = null; - // It worked as expected, no fix required - return false; - } - mergingTextDiv = null; - return true; - } -}); + _emberConsole.default.error.apply(this, errorArgs); + } -enifed('glimmer-runtime/lib/compiled/blocks', ['exports', 'glimmer-runtime/lib/utils', 'glimmer-runtime/lib/compiler'], function (exports, _glimmerRuntimeLibUtils, _glimmerRuntimeLibCompiler) { - 'use strict'; + /** + Finds the name of the substate route if it exists for the given route. A + substate route is of the form `route_state`, such as `foo_loading`. + + @private + @param {Route} route + @param {String} state + @return {String} + */ + function findRouteSubstateName(route, state) { + var router = route.router; + var owner = _emberUtils.getOwner(route); - var CompiledBlock = function CompiledBlock(ops, symbols) { - this.ops = ops; - this.symbols = symbols; - }; + var routeName = route.routeName; + var substateName = routeName + '_' + state; - exports.CompiledBlock = CompiledBlock; + var routeNameFull = route.fullRouteName; + var substateNameFull = routeNameFull + '_' + state; - var Block = function Block(program, symbolTable) { - this.program = program; - this.symbolTable = symbolTable; - this.compiled = null; - }; + return routeHasBeenDefined(owner, router, substateName, substateNameFull) ? substateNameFull : ''; + } - exports.Block = Block; + /** + Finds the name of the state route if it exists for the given route. A state + route is of the form `route.state`, such as `foo.loading`. Properly Handles + `application` named routes. + + @private + @param {Route} route + @param {String} state + @return {String} + */ + function findRouteStateName(route, state) { + var router = route.router; + var owner = _emberUtils.getOwner(route); - var InlineBlock = (function (_Block) { - babelHelpers.inherits(InlineBlock, _Block); + var routeName = route.routeName; + var stateName = routeName === 'application' ? state : routeName + '.' + state; - function InlineBlock(program, symbolTable) { - var locals = arguments.length <= 2 || arguments[2] === undefined ? _glimmerRuntimeLibUtils.EMPTY_ARRAY : arguments[2]; + var routeNameFull = route.fullRouteName; + var stateNameFull = routeNameFull === 'application' ? state : routeNameFull + '.' + state; - _Block.call(this, program, symbolTable); - this.locals = locals; - } + return routeHasBeenDefined(owner, router, stateName, stateNameFull) ? stateNameFull : ''; + } - InlineBlock.prototype.hasPositionalParameters = function hasPositionalParameters() { - return !!this.locals.length; - }; + /** + Determines whether or not a route has been defined by checking that the route + is in the Router's map and the owner has a registration for that route. + + @private + @param {Owner} owner + @param {Ember.Router} router + @param {String} localName + @param {String} fullName + @return {Boolean} + */ + function routeHasBeenDefined(owner, router, localName, fullName) { + var routerHasRoute = router.hasRoute(fullName); + var ownerHasRoute = owner.hasRegistration('template:' + localName) || owner.hasRegistration('route:' + localName); + return routerHasRoute && ownerHasRoute; + } - InlineBlock.prototype.compile = function compile(env) { - var compiled = this.compiled; - if (compiled) return compiled; - var ops = new _glimmerRuntimeLibCompiler.InlineBlockCompiler(this, env).compile(); - return this.compiled = new CompiledBlock(ops, this.symbolTable.size); - }; + function triggerEvent(handlerInfos, ignoreFailure, args) { + var name = args.shift(); - return InlineBlock; - })(Block); + if (!handlerInfos) { + if (ignoreFailure) { + return; + } + throw new _emberMetal.Error('Can\'t trigger action \'' + name + '\' because your app hasn\'t finished transitioning into its first route. To trigger an action on destination routes during a transition, you can call `.send()` on the `Transition` object passed to the `model/beforeModel/afterModel` hooks.'); + } - exports.InlineBlock = InlineBlock; + var eventWasHandled = false; + var handlerInfo = undefined, + handler = undefined; - var PartialBlock = (function (_InlineBlock) { - babelHelpers.inherits(PartialBlock, _InlineBlock); + for (var i = handlerInfos.length - 1; i >= 0; i--) { + handlerInfo = handlerInfos[i]; + handler = handlerInfo.handler; - function PartialBlock() { - _InlineBlock.apply(this, arguments); + if (handler && handler.actions && handler.actions[name]) { + if (handler.actions[name].apply(handler, args) === true) { + eventWasHandled = true; + } else { + // Should only hit here if a non-bubbling error action is triggered on a route. + if (name === 'error') { + var errorId = _emberUtils.guidFor(args[0]); + handler.router._markErrorAsHandled(errorId); + } + return; } + } + } - return PartialBlock; - })(InlineBlock); - - exports.PartialBlock = PartialBlock; + if (defaultActionHandlers[name]) { + defaultActionHandlers[name].apply(null, args); + return; + } - var TopLevelTemplate = (function (_Block2) { - babelHelpers.inherits(TopLevelTemplate, _Block2); + if (!eventWasHandled && !ignoreFailure) { + throw new _emberMetal.Error('Nothing handled the action \'' + name + '\'. If you did handle the action, this error can be caused by returning true from an action handler in a controller, causing the action to bubble.'); + } + } - function TopLevelTemplate() { - _Block2.apply(this, arguments); - } + function calculatePostTransitionState(emberRouter, leafRouteName, contexts) { + var routerjs = emberRouter.router; + var state = routerjs.applyIntent(leafRouteName, contexts); + var handlerInfos = state.handlerInfos; + var params = state.params; - return TopLevelTemplate; - })(Block); + for (var i = 0; i < handlerInfos.length; ++i) { + var handlerInfo = handlerInfos[i]; - exports.TopLevelTemplate = TopLevelTemplate; + // If the handlerInfo is not resolved, we serialize the context into params + if (!handlerInfo.isResolved) { + params[handlerInfo.name] = handlerInfo.serialize(handlerInfo.context); + } else { + params[handlerInfo.name] = handlerInfo.params; + } + } + return state; + } - var EntryPoint = (function (_TopLevelTemplate) { - babelHelpers.inherits(EntryPoint, _TopLevelTemplate); + function updatePaths(router) { + var infos = router.router.currentHandlerInfos; + if (infos.length === 0) { + return; + } - function EntryPoint() { - _TopLevelTemplate.apply(this, arguments); - } + var path = EmberRouter._routePath(infos); + var currentRouteName = infos[infos.length - 1].name; + var currentURL = router.get('location').getURL(); - EntryPoint.prototype.compile = function compile(env) { - var compiled = this.compiled; - if (compiled) return compiled; - var ops = new _glimmerRuntimeLibCompiler.EntryPointCompiler(this, env).compile(); - return this.compiled = new CompiledBlock(ops, this.symbolTable.size); - }; + _emberMetal.set(router, 'currentPath', path); + _emberMetal.set(router, 'currentRouteName', currentRouteName); + _emberMetal.set(router, 'currentURL', currentURL); - return EntryPoint; - })(TopLevelTemplate); + var appController = _emberUtils.getOwner(router).lookup('controller:application'); - exports.EntryPoint = EntryPoint; + if (!appController) { + // appController might not exist when top-level loading/error + // substates have been entered since ApplicationRoute hasn't + // actually been entered at that point. + return; + } - var Layout = (function (_TopLevelTemplate2) { - babelHelpers.inherits(Layout, _TopLevelTemplate2); + if (!('currentPath' in appController)) { + _emberMetal.defineProperty(appController, 'currentPath'); + } - function Layout(program, symbolTable, named, yields, hasPartials) { - _TopLevelTemplate2.call(this, program, symbolTable); - this.named = named; - this.yields = yields; - this.hasPartials = hasPartials; - this.hasNamedParameters = !!this.named.length; - this.hasYields = !!this.yields.length; - ; - } + _emberMetal.set(appController, 'currentPath', path); - return Layout; - })(TopLevelTemplate); + if (!('currentRouteName' in appController)) { + _emberMetal.defineProperty(appController, 'currentRouteName'); + } - exports.Layout = Layout; -}); + _emberMetal.set(appController, 'currentRouteName', currentRouteName); + } -enifed("glimmer-runtime/lib/compiled/expressions", ["exports"], function (exports) { - "use strict"; + EmberRouter.reopenClass({ + router: null, - var CompiledExpression = (function () { - function CompiledExpression() {} + /** + The `Router.map` function allows you to define mappings from URLs to routes + in your application. These mappings are defined within the + supplied callback function using `this.route`. + The first parameter is the name of the route which is used by default as the + path name as well. + The second parameter is the optional options hash. Available options are: + * `path`: allows you to provide your own path as well as mark dynamic + segments. + * `resetNamespace`: false by default; when nesting routes, ember will + combine the route names to form the fully-qualified route name, which is + used with `{{link-to}}` or manually transitioning to routes. Setting + `resetNamespace: true` will cause the route not to inherit from its + parent route's names. This is handy for preventing extremely long route names. + Keep in mind that the actual URL path behavior is still retained. + The third parameter is a function, which can be used to nest routes. + Nested routes, by default, will have the parent route tree's route name and + path prepended to it's own. + ```javascript + App.Router.map(function(){ + this.route('post', { path: '/post/:post_id' }, function() { + this.route('edit'); + this.route('comments', { resetNamespace: true }, function() { + this.route('new'); + }); + }); + }); + ``` + For more detailed documentation and examples please see + [the guides](http://emberjs.com/guides/routing/defining-your-routes/). + @method map + @param callback + @public + */ + map: function (callback) { + if (!this.dslCallbacks) { + this.dslCallbacks = []; + this.reopenClass({ dslCallbacks: this.dslCallbacks }); + } - CompiledExpression.prototype.toJSON = function toJSON() { - return "UNIMPL: " + this.type.toUpperCase(); - }; + this.dslCallbacks.push(callback); - return CompiledExpression; - })(); + return this; + }, - exports.CompiledExpression = CompiledExpression; -}); + _routePath: function (handlerInfos) { + var path = []; -enifed('glimmer-runtime/lib/compiled/expressions/args', ['exports', 'glimmer-runtime/lib/compiled/expressions/positional-args', 'glimmer-runtime/lib/compiled/expressions/named-args', 'glimmer-runtime/lib/syntax/core', 'glimmer-reference'], function (exports, _glimmerRuntimeLibCompiledExpressionsPositionalArgs, _glimmerRuntimeLibCompiledExpressionsNamedArgs, _glimmerRuntimeLibSyntaxCore, _glimmerReference) { - 'use strict'; + // We have to handle coalescing resource names that + // are prefixed with their parent's names, e.g. + // ['foo', 'foo.bar.baz'] => 'foo.bar.baz', not 'foo.foo.bar.baz' - var CompiledArgs = (function () { - function CompiledArgs(positional, named, blocks) { - this.positional = positional; - this.named = named; - this.blocks = blocks; + function intersectionMatches(a1, a2) { + for (var i = 0; i < a1.length; ++i) { + if (a1[i] !== a2[i]) { + return false; + } } + return true; + } - CompiledArgs.create = function create(positional, named, blocks) { - if (positional === _glimmerRuntimeLibCompiledExpressionsPositionalArgs.COMPILED_EMPTY_POSITIONAL_ARGS && named === _glimmerRuntimeLibCompiledExpressionsNamedArgs.COMPILED_EMPTY_NAMED_ARGS && blocks === _glimmerRuntimeLibSyntaxCore.EMPTY_BLOCKS) { - return this.empty(); - } else { - return new this(positional, named, blocks); - } - }; - - CompiledArgs.empty = function empty() { - return COMPILED_EMPTY_ARGS; - }; - - CompiledArgs.prototype.evaluate = function evaluate(vm) { - var positional = this.positional; - var named = this.named; - var blocks = this.blocks; + var name = undefined, + nameParts = undefined, + oldNameParts = undefined; + for (var i = 1; i < handlerInfos.length; i++) { + name = handlerInfos[i].name; + nameParts = name.split('.'); + oldNameParts = slice.call(path); - return EvaluatedArgs.create(positional.evaluate(vm), named.evaluate(vm), blocks); - }; + while (oldNameParts.length) { + if (intersectionMatches(oldNameParts, nameParts)) { + break; + } + oldNameParts.shift(); + } - return CompiledArgs; - })(); + path.push.apply(path, nameParts.slice(oldNameParts.length)); + } - exports.CompiledArgs = CompiledArgs; + return path.join('.'); + } + }); - var COMPILED_EMPTY_ARGS = new ((function (_CompiledArgs) { - babelHelpers.inherits(_class, _CompiledArgs); + function didBeginTransition(transition, router) { + var routerState = _emberRoutingSystemRouter_state.default.create({ + emberRouter: router, + routerJs: router.router, + routerJsState: transition.state + }); - function _class() { - _CompiledArgs.call(this, _glimmerRuntimeLibCompiledExpressionsPositionalArgs.COMPILED_EMPTY_POSITIONAL_ARGS, _glimmerRuntimeLibCompiledExpressionsNamedArgs.COMPILED_EMPTY_NAMED_ARGS, _glimmerRuntimeLibSyntaxCore.EMPTY_BLOCKS); - } + if (!router.currentState) { + router.set('currentState', routerState); + } + router.set('targetState', routerState); - _class.prototype.evaluate = function evaluate(vm) { - return EMPTY_EVALUATED_ARGS; - }; + transition.promise = transition.catch(function (error) { + var errorId = _emberUtils.guidFor(error); - return _class; - })(CompiledArgs))(); + if (router._isErrorHandled(errorId)) { + router._clearHandledError(errorId); + } else { + throw error; + } + }); + } - var EvaluatedArgs = (function () { - function EvaluatedArgs(positional, named, blocks) { - this.positional = positional; - this.named = named; - this.blocks = blocks; - this.tag = _glimmerReference.combineTagged([positional, named]); - } + function resemblesURL(str) { + return typeof str === 'string' && (str === '' || str[0] === '/'); + } - EvaluatedArgs.empty = function empty() { - return EMPTY_EVALUATED_ARGS; - }; + function forEachQueryParam(router, handlerInfos, queryParams, callback) { + var qpCache = router._queryParamsFor(handlerInfos); - EvaluatedArgs.create = function create(positional, named, blocks) { - return new this(positional, named, blocks); - }; + for (var key in queryParams) { + if (!queryParams.hasOwnProperty(key)) { + continue; + } + var value = queryParams[key]; + var qp = qpCache.map[key]; - EvaluatedArgs.positional = function positional(values) { - var blocks = arguments.length <= 1 || arguments[1] === undefined ? _glimmerRuntimeLibSyntaxCore.EMPTY_BLOCKS : arguments[1]; + callback(key, value, qp); + } + } - return new this(_glimmerRuntimeLibCompiledExpressionsPositionalArgs.EvaluatedPositionalArgs.create(values), _glimmerRuntimeLibCompiledExpressionsNamedArgs.EVALUATED_EMPTY_NAMED_ARGS, blocks); - }; + function findLiveRoute(liveRoutes, name) { + if (!liveRoutes) { + return; + } + var stack = [liveRoutes]; + while (stack.length > 0) { + var test = stack.shift(); + if (test.render.name === name) { + return test; + } + var outlets = test.outlets; + for (var outletName in outlets) { + stack.push(outlets[outletName]); + } + } + } - EvaluatedArgs.named = function named(map) { - var blocks = arguments.length <= 1 || arguments[1] === undefined ? _glimmerRuntimeLibSyntaxCore.EMPTY_BLOCKS : arguments[1]; + function appendLiveRoute(liveRoutes, defaultParentState, renderOptions) { + var target = undefined; + var myState = { + render: renderOptions, + outlets: new _emberUtils.EmptyObject(), + wasUsed: false + }; + if (renderOptions.into) { + target = findLiveRoute(liveRoutes, renderOptions.into); + } else { + target = defaultParentState; + } + if (target) { + _emberMetal.set(target.outlets, renderOptions.outlet, myState); + } else { + if (renderOptions.into) { + _emberMetal.deprecate('Rendering into a {{render}} helper that resolves to an {{outlet}} is deprecated.', false, { + id: 'ember-routing.top-level-render-helper', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_rendering-into-a-render-helper-that-resolves-to-an-outlet' + }); - return new this(_glimmerRuntimeLibCompiledExpressionsPositionalArgs.EVALUATED_EMPTY_POSITIONAL_ARGS, _glimmerRuntimeLibCompiledExpressionsNamedArgs.EvaluatedNamedArgs.create(map), blocks); - }; + // Megahax time. Post-3.0-breaking-changes, we will just assert + // right here that the user tried to target a nonexistent + // thing. But for now we still need to support the `render` + // helper, and people are allowed to target templates rendered + // by the render helper. So instead we defer doing anyting with + // these orphan renders until afterRender. + appendOrphan(liveRoutes, renderOptions.into, myState); + } else { + liveRoutes = myState; + } + } + return { + liveRoutes: liveRoutes, + ownState: myState + }; + } - return EvaluatedArgs; - })(); + function appendOrphan(liveRoutes, into, myState) { + if (!liveRoutes.outlets.__ember_orphans__) { + liveRoutes.outlets.__ember_orphans__ = { + render: { + name: '__ember_orphans__' + }, + outlets: new _emberUtils.EmptyObject() + }; + } + liveRoutes.outlets.__ember_orphans__.outlets[into] = myState; + _emberMetal.run.schedule('afterRender', function () { + // `wasUsed` gets set by the render helper. + _emberMetal.assert('You attempted to render into \'' + into + '\' but it was not found', liveRoutes.outlets.__ember_orphans__.outlets[into].wasUsed); + }); + } - exports.EvaluatedArgs = EvaluatedArgs; + function representEmptyRoute(liveRoutes, defaultParentState, route) { + // the route didn't render anything + var alreadyAppended = findLiveRoute(liveRoutes, route.routeName); + if (alreadyAppended) { + // But some other route has already rendered our default + // template, so that becomes the default target for any + // children we may have. + return alreadyAppended; + } else { + // Create an entry to represent our default template name, + // just so other routes can target it and inherit its place + // in the outlet hierarchy. + defaultParentState.outlets.main = { + render: { + name: route.routeName, + outlet: 'main' + }, + outlets: {} + }; + return defaultParentState; + } + } - var EMPTY_EVALUATED_ARGS = new EvaluatedArgs(_glimmerRuntimeLibCompiledExpressionsPositionalArgs.EVALUATED_EMPTY_POSITIONAL_ARGS, _glimmerRuntimeLibCompiledExpressionsNamedArgs.EVALUATED_EMPTY_NAMED_ARGS, _glimmerRuntimeLibSyntaxCore.EMPTY_BLOCKS); - exports.CompiledPositionalArgs = _glimmerRuntimeLibCompiledExpressionsPositionalArgs.CompiledPositionalArgs; - exports.EvaluatedPositionalArgs = _glimmerRuntimeLibCompiledExpressionsPositionalArgs.EvaluatedPositionalArgs; - exports.CompiledNamedArgs = _glimmerRuntimeLibCompiledExpressionsNamedArgs.CompiledNamedArgs; - exports.EvaluatedNamedArgs = _glimmerRuntimeLibCompiledExpressionsNamedArgs.EvaluatedNamedArgs; + exports.default = EmberRouter; }); -enifed("glimmer-runtime/lib/compiled/expressions/concat", ["exports", "glimmer-reference"], function (exports, _glimmerReference) { - "use strict"; - - var CompiledConcat = (function () { - function CompiledConcat(parts) { - this.parts = parts; - this.type = "concat"; - } - - CompiledConcat.prototype.evaluate = function evaluate(vm) { - var parts = new Array(this.parts.length); - for (var i = 0; i < this.parts.length; i++) { - parts[i] = this.parts[i].evaluate(vm); - } - return new ConcatReference(parts); - }; - - CompiledConcat.prototype.toJSON = function toJSON() { - return "concat(" + this.parts.map(function (expr) { - return expr.toJSON(); - }).join(", ") + ")"; - }; +/** +@module ember +@submodule ember-routing +*/ +enifed('ember-routing/system/router_state', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime'], function (exports, _emberUtils, _emberMetal, _emberRuntime) { + 'use strict'; - return CompiledConcat; - })(); + exports.default = _emberRuntime.Object.extend({ + emberRouter: null, + routerJs: null, + routerJsState: null, - exports.default = CompiledConcat; + isActiveIntent: function (routeName, models, queryParams, queryParamsMustMatch) { + var state = this.routerJsState; + if (!this.routerJs.isActiveIntent(routeName, models, null, state)) { + return false; + } - var ConcatReference = (function (_CachedReference) { - babelHelpers.inherits(ConcatReference, _CachedReference); + var emptyQueryParams = _emberMetal.isEmpty(Object.keys(queryParams)); - function ConcatReference(parts) { - _CachedReference.call(this); - this.parts = parts; - this.tag = _glimmerReference.combineTagged(parts); - } + if (queryParamsMustMatch && !emptyQueryParams) { + var visibleQueryParams = {}; + _emberUtils.assign(visibleQueryParams, queryParams); - ConcatReference.prototype.compute = function compute() { - var parts = new Array(); - for (var i = 0; i < this.parts.length; i++) { - var value = this.parts[i].value(); - if (value !== null && value !== undefined) { - parts[i] = castToString(this.parts[i].value()); - } - } - if (parts.length > 0) { - return parts.join(''); - } - return null; - }; + this.emberRouter._prepareQueryParams(routeName, models, visibleQueryParams); + return shallowEqual(visibleQueryParams, state.queryParams); + } - return ConcatReference; - })(_glimmerReference.CachedReference); + return true; + } + }); - function castToString(value) { - if (typeof value['toString'] !== 'function') { - return ''; - } - return String(value); + function shallowEqual(a, b) { + var k = undefined; + for (k in a) { + if (a.hasOwnProperty(k) && a[k] !== b[k]) { + return false; + } } + for (k in b) { + if (b.hasOwnProperty(k) && a[k] !== b[k]) { + return false; + } + } + return true; + } }); +enifed('ember-routing/utils', ['exports', 'ember-utils', 'ember-metal'], function (exports, _emberUtils, _emberMetal) { + 'use strict'; -enifed('glimmer-runtime/lib/compiled/expressions/function', ['exports', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/compiled/expressions'], function (exports, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibCompiledExpressions) { - 'use strict'; + exports.routeArgs = routeArgs; + exports.getActiveTargetName = getActiveTargetName; + exports.stashParamNames = stashParamNames; + exports.calculateCacheKey = calculateCacheKey; + exports.normalizeControllerQueryParams = normalizeControllerQueryParams; + exports.prefixRouteNameArg = prefixRouteNameArg; - exports.default = make; + var ALL_PERIODS_REGEX = /\./g; - function make(func) { - return new FunctionExpressionSyntax(func); + function routeArgs(targetRouteName, models, queryParams) { + var args = []; + if (typeof targetRouteName === 'string') { + args.push('' + targetRouteName); } + args.push.apply(args, models); + args.push({ queryParams: queryParams }); + return args; + } - var FunctionExpressionSyntax = (function (_ExpressionSyntax) { - babelHelpers.inherits(FunctionExpressionSyntax, _ExpressionSyntax); - - function FunctionExpressionSyntax(func) { - _ExpressionSyntax.call(this); - this.type = "function-expression"; - this.func = func; - } - - FunctionExpressionSyntax.prototype.compile = function compile(lookup, env, symbolTable) { - return new CompiledFunctionExpression(this.func, symbolTable); - }; - - return FunctionExpressionSyntax; - })(_glimmerRuntimeLibSyntax.Expression); + function getActiveTargetName(router) { + var handlerInfos = router.activeTransition ? router.activeTransition.state.handlerInfos : router.state.handlerInfos; + return handlerInfos[handlerInfos.length - 1].name; + } - var CompiledFunctionExpression = (function (_CompiledExpression) { - babelHelpers.inherits(CompiledFunctionExpression, _CompiledExpression); + function stashParamNames(router, handlerInfos) { + if (handlerInfos._namesStashed) { + return; + } - function CompiledFunctionExpression(func, symbolTable) { - _CompiledExpression.call(this); - this.func = func; - this.symbolTable = symbolTable; - this.type = "function"; - this.func = func; - } + // This helper exists because router.js/route-recognizer.js awkwardly + // keeps separate a handlerInfo's list of parameter names depending + // on whether a URL transition or named transition is happening. + // Hopefully we can remove this in the future. + var targetRouteName = handlerInfos[handlerInfos.length - 1].name; + var recogHandlers = router.router.recognizer.handlersFor(targetRouteName); + var dynamicParent = null; - CompiledFunctionExpression.prototype.evaluate = function evaluate(vm) { - var func = this.func; - var symbolTable = this.symbolTable; + for (var i = 0; i < handlerInfos.length; ++i) { + var handlerInfo = handlerInfos[i]; + var names = recogHandlers[i].names; - return func(vm, symbolTable); - }; + if (names.length) { + dynamicParent = handlerInfo; + } - CompiledFunctionExpression.prototype.toJSON = function toJSON() { - var func = this.func; + handlerInfo._names = names; - if (func.name) { - return '`' + func.name + '(...)`'; - } else { - return "`func(...)`"; - } - }; + var route = handlerInfo.handler; + route._stashNames(handlerInfo, dynamicParent); + } - return CompiledFunctionExpression; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); -}); + handlerInfos._namesStashed = true; + } -enifed('glimmer-runtime/lib/compiled/expressions/has-block', ['exports', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-runtime/lib/references'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerRuntimeLibReferences) { - 'use strict'; + function _calculateCacheValuePrefix(prefix, part) { + // calculates the dot seperated sections from prefix that are also + // at the start of part - which gives us the route name - var CompiledHasBlock = (function (_CompiledExpression) { - babelHelpers.inherits(CompiledHasBlock, _CompiledExpression); + // given : prefix = site.article.comments, part = site.article.id + // - returns: site.article (use get(values[site.article], 'id') to get the dynamic part - used below) - function CompiledHasBlock(inner) { - _CompiledExpression.call(this); - this.inner = inner; - this.type = "has-block"; - } + // given : prefix = site.article, part = site.article.id + // - returns: site.article. (use get(values[site.article], 'id') to get the dynamic part - used below) - CompiledHasBlock.prototype.evaluate = function evaluate(vm) { - var block = this.inner.evaluate(vm); - return _glimmerRuntimeLibReferences.PrimitiveReference.create(!!block); - }; + var prefixParts = prefix.split('.'); + var currPrefix = ''; - CompiledHasBlock.prototype.toJSON = function toJSON() { - return 'has-block(' + this.inner.toJSON() + ')'; - }; + for (var i = 0; i < prefixParts.length; i++) { + var currPart = prefixParts.slice(0, i + 1).join('.'); + if (part.indexOf(currPart) !== 0) { + break; + } + currPrefix = currPart; + } - return CompiledHasBlock; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); + return currPrefix; + } - exports.default = CompiledHasBlock; + /* + Stolen from Controller + */ - var CompiledHasBlockParams = (function (_CompiledExpression2) { - babelHelpers.inherits(CompiledHasBlockParams, _CompiledExpression2); + function calculateCacheKey(prefix, parts, values) { + if (parts === undefined) parts = []; - function CompiledHasBlockParams(inner) { - _CompiledExpression2.call(this); - this.inner = inner; - this.type = "has-block-params"; + var suffixes = ''; + for (var i = 0; i < parts.length; ++i) { + var part = parts[i]; + var cacheValuePrefix = _calculateCacheValuePrefix(prefix, part); + var value = undefined; + if (values) { + if (cacheValuePrefix && cacheValuePrefix in values) { + var partRemovedPrefix = part.indexOf(cacheValuePrefix) === 0 ? part.substr(cacheValuePrefix.length + 1) : part; + value = _emberMetal.get(values[cacheValuePrefix], partRemovedPrefix); + } else { + value = _emberMetal.get(values, part); } + } + suffixes += '::' + part + ':' + value; + } + return prefix + suffixes.replace(ALL_PERIODS_REGEX, '-'); + } - CompiledHasBlockParams.prototype.evaluate = function evaluate(vm) { - var block = this.inner.evaluate(vm); - return _glimmerRuntimeLibReferences.PrimitiveReference.create(!!(block && block.locals.length > 0)); - }; - - CompiledHasBlockParams.prototype.toJSON = function toJSON() { - return 'has-block-params(' + this.inner.toJSON() + ')'; - }; + /* + Controller-defined query parameters can come in three shapes: + + Array + queryParams: ['foo', 'bar'] + Array of simple objects where value is an alias + queryParams: [ + { + 'foo': 'rename_foo_to_this' + }, + { + 'bar': 'call_bar_this_instead' + } + ] + Array of fully defined objects + queryParams: [ + { + 'foo': { + as: 'rename_foo_to_this' + }, + } + { + 'bar': { + as: 'call_bar_this_instead', + scope: 'controller' + } + } + ] + + This helper normalizes all three possible styles into the + 'Array of fully defined objects' style. + */ - return CompiledHasBlockParams; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); + function normalizeControllerQueryParams(queryParams) { + var qpMap = {}; - exports.CompiledHasBlockParams = CompiledHasBlockParams; + for (var i = 0; i < queryParams.length; ++i) { + accumulateQueryParamDescriptors(queryParams[i], qpMap); + } - var CompiledGetBlockBySymbol = (function () { - function CompiledGetBlockBySymbol(symbol, debug) { - this.symbol = symbol; - this.debug = debug; - } + return qpMap; + } - CompiledGetBlockBySymbol.prototype.evaluate = function evaluate(vm) { - return vm.scope().getBlock(this.symbol); - }; + function accumulateQueryParamDescriptors(_desc, accum) { + var desc = _desc; + var tmp = undefined; + if (typeof desc === 'string') { + tmp = {}; + tmp[desc] = { as: null }; + desc = tmp; + } - CompiledGetBlockBySymbol.prototype.toJSON = function toJSON() { - return 'get-block($' + this.symbol + '(' + this.debug + '))'; - }; + for (var key in desc) { + if (!desc.hasOwnProperty(key)) { + return; + } - return CompiledGetBlockBySymbol; - })(); + var singleDesc = desc[key]; + if (typeof singleDesc === 'string') { + singleDesc = { as: singleDesc }; + } - exports.CompiledGetBlockBySymbol = CompiledGetBlockBySymbol; + tmp = accum[key] || { as: null, scope: 'model' }; + _emberUtils.assign(tmp, singleDesc); - var CompiledInPartialGetBlock = (function () { - function CompiledInPartialGetBlock(symbol, name) { - this.symbol = symbol; - this.name = name; - } + accum[key] = tmp; + } + } - CompiledInPartialGetBlock.prototype.evaluate = function evaluate(vm) { - var symbol = this.symbol; - var name = this.name; + /* + Check if a routeName resembles a url instead + + @private + */ + function resemblesURL(str) { + return typeof str === 'string' && (str === '' || str.charAt(0) === '/'); + } - var args = vm.scope().getPartialArgs(symbol); - return args.blocks[name]; - }; + /* + Returns an arguments array where the route name arg is prefixed based on the mount point + + @private + */ - CompiledInPartialGetBlock.prototype.toJSON = function toJSON() { - return 'get-block($' + this.symbol + '($ARGS).' + this.name + '))'; - }; + function prefixRouteNameArg(route, args) { + var routeName = args[0]; + var owner = _emberUtils.getOwner(route); + var prefix = owner.mountPoint; - return CompiledInPartialGetBlock; - })(); + // only alter the routeName if it's actually referencing a route. + if (owner.routable && typeof routeName === 'string') { + if (resemblesURL(routeName)) { + throw new _emberMetal.Error('Programmatic transitions by URL cannot be used within an Engine. Please use the route name instead.'); + } else { + routeName = prefix + '.' + routeName; + args[0] = routeName; + } + } - exports.CompiledInPartialGetBlock = CompiledInPartialGetBlock; + return args; + } }); +enifed('ember-runtime/compare', ['exports', 'ember-runtime/utils', 'ember-runtime/mixins/comparable'], function (exports, _emberRuntimeUtils, _emberRuntimeMixinsComparable) { + 'use strict'; -enifed('glimmer-runtime/lib/compiled/expressions/helper', ['exports', 'glimmer-runtime/lib/compiled/expressions'], function (exports, _glimmerRuntimeLibCompiledExpressions) { - 'use strict'; + exports.default = compare; + + var TYPE_ORDER = { + 'undefined': 0, + 'null': 1, + 'boolean': 2, + 'number': 3, + 'string': 4, + 'array': 5, + 'object': 6, + 'instance': 7, + 'function': 8, + 'class': 9, + 'date': 10 + }; - var CompiledHelper = (function (_CompiledExpression) { - babelHelpers.inherits(CompiledHelper, _CompiledExpression); + // + // the spaceship operator + // + // `. ___ + // __,' __`. _..----....____ + // __...--.'``;. ,. ;``--..__ .' ,-._ _.-' + // _..-''-------' `' `' `' O ``-''._ (,;') _,' + // ,'________________ \`-._`-',' + // `._ ```````````------...___ '-.._'-: + // ```--.._ ,. ````--...__\-. + // `.--. `-` "INFINITY IS LESS ____ | |` + // `. `. THAN BEYOND" ,'`````. ; ;` + // `._`. __________ `. \'__/` + // `-:._____/______/___/____`. \ ` + // | `._ `. \ + // `._________`-. `. `.___ + // SSt `------'` + function spaceship(a, b) { + var diff = a - b; + return (diff > 0) - (diff < 0); + } - function CompiledHelper(name, helper, args, symbolTable) { - _CompiledExpression.call(this); - this.name = name; - this.helper = helper; - this.args = args; - this.symbolTable = symbolTable; - this.type = "helper"; - } + /** + Compares two javascript values and returns: + + - -1 if the first is smaller than the second, + - 0 if both are equal, + - 1 if the first is greater than the second. + + ```javascript + Ember.compare('hello', 'hello'); // 0 + Ember.compare('abc', 'dfg'); // -1 + Ember.compare(2, 1); // 1 + ``` + + If the types of the two objects are different precedence occurs in the + following order, with types earlier in the list considered `<` types + later in the list: + + - undefined + - null + - boolean + - number + - string + - array + - object + - instance + - function + - class + - date + + ```javascript + Ember.compare('hello', 50); // 1 + Ember.compare(50, 'hello'); // -1 + ``` + + @method compare + @for Ember + @param {Object} v First value to compare + @param {Object} w Second value to compare + @return {Number} -1 if v < w, 0 if v = w and 1 if v > w. + @public + */ - CompiledHelper.prototype.evaluate = function evaluate(vm) { - var helper = this.helper; + function compare(v, w) { + if (v === w) { + return 0; + } - return helper(vm, this.args.evaluate(vm), this.symbolTable); - }; + var type1 = _emberRuntimeUtils.typeOf(v); + var type2 = _emberRuntimeUtils.typeOf(w); - CompiledHelper.prototype.toJSON = function toJSON() { - return '`' + this.name.join('.') + '($ARGS)`'; - }; + if (_emberRuntimeMixinsComparable.default) { + if (type1 === 'instance' && _emberRuntimeMixinsComparable.default.detect(v) && v.constructor.compare) { + return v.constructor.compare(v, w); + } - return CompiledHelper; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); + if (type2 === 'instance' && _emberRuntimeMixinsComparable.default.detect(w) && w.constructor.compare) { + return w.constructor.compare(w, v) * -1; + } + } - exports.default = CompiledHelper; -}); + var res = spaceship(TYPE_ORDER[type1], TYPE_ORDER[type2]); -enifed('glimmer-runtime/lib/compiled/expressions/lookups', ['exports', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-reference'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerReference) { - 'use strict'; + if (res !== 0) { + return res; + } - var CompiledLookup = (function (_CompiledExpression) { - babelHelpers.inherits(CompiledLookup, _CompiledExpression); + // types are equal - so we have to check values now + switch (type1) { + case 'boolean': + case 'number': + return spaceship(v, w); - function CompiledLookup(base, path) { - _CompiledExpression.call(this); - this.base = base; - this.path = path; - this.type = "lookup"; - } + case 'string': + return spaceship(v.localeCompare(w), 0); - CompiledLookup.create = function create(base, path) { - if (path.length === 0) { - return base; - } else { - return new this(base, path); + case 'array': + { + var vLen = v.length; + var wLen = w.length; + var len = Math.min(vLen, wLen); + + for (var i = 0; i < len; i++) { + var r = compare(v[i], w[i]); + if (r !== 0) { + return r; } - }; - - CompiledLookup.prototype.evaluate = function evaluate(vm) { - var base = this.base; - var path = this.path; - - return _glimmerReference.referenceFromParts(base.evaluate(vm), path); - }; - - CompiledLookup.prototype.toJSON = function toJSON() { - return this.base.toJSON() + '.' + this.path.join('.'); - }; - - return CompiledLookup; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); - - exports.default = CompiledLookup; - - var CompiledSelf = (function (_CompiledExpression2) { - babelHelpers.inherits(CompiledSelf, _CompiledExpression2); - - function CompiledSelf() { - _CompiledExpression2.apply(this, arguments); - } - - CompiledSelf.prototype.evaluate = function evaluate(vm) { - return vm.getSelf(); - }; - - CompiledSelf.prototype.toJSON = function toJSON() { - return 'self'; - }; - - return CompiledSelf; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); - - exports.CompiledSelf = CompiledSelf; - - var CompiledSymbol = (function (_CompiledExpression3) { - babelHelpers.inherits(CompiledSymbol, _CompiledExpression3); + } - function CompiledSymbol(symbol, debug) { - _CompiledExpression3.call(this); - this.symbol = symbol; - this.debug = debug; + // all elements are equal now + // shorter array should be ordered first + return spaceship(vLen, wLen); } - - CompiledSymbol.prototype.evaluate = function evaluate(vm) { - return vm.referenceForSymbol(this.symbol); - }; - - CompiledSymbol.prototype.toJSON = function toJSON() { - return '$' + this.symbol + '(' + this.debug + ')'; - }; - - return CompiledSymbol; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); - - exports.CompiledSymbol = CompiledSymbol; - - var CompiledInPartialName = (function (_CompiledExpression4) { - babelHelpers.inherits(CompiledInPartialName, _CompiledExpression4); - - function CompiledInPartialName(symbol, name) { - _CompiledExpression4.call(this); - this.symbol = symbol; - this.name = name; + case 'instance': + if (_emberRuntimeMixinsComparable.default && _emberRuntimeMixinsComparable.default.detect(v)) { + return v.compare(v, w); } + return 0; - CompiledInPartialName.prototype.evaluate = function evaluate(vm) { - var symbol = this.symbol; - var name = this.name; - - var args = vm.scope().getPartialArgs(symbol); - return args.named.get(name); - }; - - CompiledInPartialName.prototype.toJSON = function toJSON() { - return '$' + this.symbol + '($ARGS).' + this.name; - }; - - return CompiledInPartialName; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); + case 'date': + return spaceship(v.getTime(), w.getTime()); - exports.CompiledInPartialName = CompiledInPartialName; + default: + return 0; + } + } }); +enifed('ember-runtime/computed/computed_macros', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; -enifed('glimmer-runtime/lib/compiled/expressions/named-args', ['exports', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/utils', 'glimmer-reference', 'glimmer-util'], function (exports, _glimmerRuntimeLibReferences, _glimmerRuntimeLibUtils, _glimmerReference, _glimmerUtil) { - 'use strict'; + exports.empty = empty; + exports.notEmpty = notEmpty; + exports.none = none; + exports.not = not; + exports.bool = bool; + exports.match = match; + exports.equal = equal; + exports.gt = gt; + exports.gte = gte; + exports.lt = lt; + exports.lte = lte; + exports.oneWay = oneWay; + exports.readOnly = readOnly; + exports.deprecatingAlias = deprecatingAlias; - var CompiledNamedArgs = (function () { - function CompiledNamedArgs(keys, values) { - this.keys = keys; - this.values = values; - this.length = keys.length; - _glimmerUtil.assert(keys.length === values.length, 'Keys and values do not have the same length'); - } + /** + @module ember + @submodule ember-metal + */ - CompiledNamedArgs.empty = function empty() { - return COMPILED_EMPTY_NAMED_ARGS; - }; + function expandPropertiesToArray(predicateName, properties) { + var expandedProperties = []; - CompiledNamedArgs.create = function create(map) { - var keys = Object.keys(map); - var length = keys.length; - if (length > 0) { - var values = []; - for (var i = 0; i < length; i++) { - values[i] = map[keys[i]]; - } - return new this(keys, values); - } else { - return COMPILED_EMPTY_NAMED_ARGS; - } - }; + function extractProperty(entry) { + expandedProperties.push(entry); + } - CompiledNamedArgs.prototype.evaluate = function evaluate(vm) { - var keys = this.keys; - var values = this.values; - var length = this.length; + for (var i = 0; i < properties.length; i++) { + var property = properties[i]; + _emberMetal.assert('Dependent keys passed to Ember.computed.' + predicateName + '() can\'t have spaces.', property.indexOf(' ') < 0); - var evaluated = new Array(length); - for (var i = 0; i < length; i++) { - evaluated[i] = values[i].evaluate(vm); - } - return new EvaluatedNamedArgs(keys, evaluated); - }; + _emberMetal.expandProperties(property, extractProperty); + } - CompiledNamedArgs.prototype.toJSON = function toJSON() { - var keys = this.keys; - var values = this.values; + return expandedProperties; + } - var inner = keys.map(function (key, i) { - return key + ': ' + values[i].toJSON(); - }).join(", "); - return '{' + inner + '}'; - }; + function generateComputedWithPredicate(name, predicate) { + return function () { + for (var _len = arguments.length, properties = Array(_len), _key = 0; _key < _len; _key++) { + properties[_key] = arguments[_key]; + } - return CompiledNamedArgs; - })(); + var expandedProperties = expandPropertiesToArray(name, properties); - exports.CompiledNamedArgs = CompiledNamedArgs; - var COMPILED_EMPTY_NAMED_ARGS = new ((function (_CompiledNamedArgs) { - babelHelpers.inherits(_class, _CompiledNamedArgs); + var computedFunc = _emberMetal.computed(function () { + var lastIdx = expandedProperties.length - 1; - function _class() { - _CompiledNamedArgs.call(this, _glimmerRuntimeLibUtils.EMPTY_ARRAY, _glimmerRuntimeLibUtils.EMPTY_ARRAY); + for (var i = 0; i < lastIdx; i++) { + var value = _emberMetal.get(this, expandedProperties[i]); + if (!predicate(value)) { + return value; + } } - _class.prototype.evaluate = function evaluate(vm) { - return EVALUATED_EMPTY_NAMED_ARGS; - }; - - _class.prototype.toJSON = function toJSON() { - return ''; - }; - - return _class; - })(CompiledNamedArgs))(); - exports.COMPILED_EMPTY_NAMED_ARGS = COMPILED_EMPTY_NAMED_ARGS; - - var EvaluatedNamedArgs = (function () { - function EvaluatedNamedArgs(keys, values) { - var _map = arguments.length <= 2 || arguments[2] === undefined ? undefined : arguments[2]; - - this.keys = keys; - this.values = values; - this._map = _map; - this.tag = _glimmerReference.combineTagged(values); - this.length = keys.length; - _glimmerUtil.assert(keys.length === values.length, 'Keys and values do not have the same length'); - } - - EvaluatedNamedArgs.create = function create(map) { - var keys = Object.keys(map); - var length = keys.length; - if (length > 0) { - var values = new Array(length); - for (var i = 0; i < length; i++) { - values[i] = map[keys[i]]; - } - return new this(keys, values, map); - } else { - return EVALUATED_EMPTY_NAMED_ARGS; - } - }; - - EvaluatedNamedArgs.empty = function empty() { - return EVALUATED_EMPTY_NAMED_ARGS; - }; + return _emberMetal.get(this, expandedProperties[lastIdx]); + }); - EvaluatedNamedArgs.prototype.get = function get(key) { - var keys = this.keys; - var values = this.values; + return computedFunc.property.apply(computedFunc, expandedProperties); + }; + } - var index = keys.indexOf(key); - return index === -1 ? _glimmerRuntimeLibReferences.UNDEFINED_REFERENCE : values[index]; - }; + /** + A computed property that returns true if the value of the dependent + property is null, an empty string, empty array, or empty function. + + Example + + ```javascript + let ToDoList = Ember.Object.extend({ + isDone: Ember.computed.empty('todos') + }); + + let todoList = ToDoList.create({ + todos: ['Unit Test', 'Documentation', 'Release'] + }); + + todoList.get('isDone'); // false + todoList.get('todos').clear(); + todoList.get('isDone'); // true + ``` + + @since 1.6.0 + @method empty + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which negate + the original value for property + @public + */ - EvaluatedNamedArgs.prototype.has = function has(key) { - return this.keys.indexOf(key) !== -1; - }; + function empty(dependentKey) { + return _emberMetal.computed(dependentKey + '.length', function () { + return _emberMetal.isEmpty(_emberMetal.get(this, dependentKey)); + }); + } - EvaluatedNamedArgs.prototype.value = function value() { - var keys = this.keys; - var values = this.values; + /** + A computed property that returns true if the value of the dependent + property is NOT null, an empty string, empty array, or empty function. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + hasStuff: Ember.computed.notEmpty('backpack') + }); + + let hamster = Hamster.create({ backpack: ['Food', 'Sleeping Bag', 'Tent'] }); + + hamster.get('hasStuff'); // true + hamster.get('backpack').clear(); // [] + hamster.get('hasStuff'); // false + ``` + + @method notEmpty + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which returns true if + original value for property is not empty. + @public + */ - var out = _glimmerUtil.dict(); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var ref = values[i]; - out[key] = ref.value(); - } - return out; - }; + function notEmpty(dependentKey) { + return _emberMetal.computed(dependentKey + '.length', function () { + return !_emberMetal.isEmpty(_emberMetal.get(this, dependentKey)); + }); + } - babelHelpers.createClass(EvaluatedNamedArgs, [{ - key: 'map', - get: function () { - var map = this._map; + /** + A computed property that returns true if the value of the dependent + property is null or undefined. This avoids errors from JSLint complaining + about use of ==, which can be technically confusing. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + isHungry: Ember.computed.none('food') + }); + + let hamster = Hamster.create(); + + hamster.get('isHungry'); // true + hamster.set('food', 'Banana'); + hamster.get('isHungry'); // false + hamster.set('food', null); + hamster.get('isHungry'); // true + ``` + + @method none + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which + returns true if original value for property is null or undefined. + @public + */ - if (map) { - return map; - } - map = this._map = _glimmerUtil.dict(); - var keys = this.keys; - var values = this.values; - var length = this.length; + function none(dependentKey) { + return _emberMetal.computed(dependentKey, function () { + return _emberMetal.isNone(_emberMetal.get(this, dependentKey)); + }); + } - for (var i = 0; i < length; i++) { - map[keys[i]] = values[i]; - } - return map; - } - }]); - return EvaluatedNamedArgs; - })(); + /** + A computed property that returns the inverse boolean value + of the original value for the dependent property. + + Example + + ```javascript + let User = Ember.Object.extend({ + isAnonymous: Ember.computed.not('loggedIn') + }); + + let user = User.create({loggedIn: false}); + + user.get('isAnonymous'); // true + user.set('loggedIn', true); + user.get('isAnonymous'); // false + ``` + + @method not + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which returns + inverse of the original value for property + @public + */ - exports.EvaluatedNamedArgs = EvaluatedNamedArgs; - var EVALUATED_EMPTY_NAMED_ARGS = new ((function (_EvaluatedNamedArgs) { - babelHelpers.inherits(_class2, _EvaluatedNamedArgs); + function not(dependentKey) { + return _emberMetal.computed(dependentKey, function () { + return !_emberMetal.get(this, dependentKey); + }); + } - function _class2() { - _EvaluatedNamedArgs.call(this, _glimmerRuntimeLibUtils.EMPTY_ARRAY, _glimmerRuntimeLibUtils.EMPTY_ARRAY, _glimmerRuntimeLibUtils.EMPTY_DICT); - } + /** + A computed property that converts the provided dependent property + into a boolean value. + + ```javascript + let Hamster = Ember.Object.extend({ + hasBananas: Ember.computed.bool('numBananas') + }); + + let hamster = Hamster.create(); + + hamster.get('hasBananas'); // false + hamster.set('numBananas', 0); + hamster.get('hasBananas'); // false + hamster.set('numBananas', 1); + hamster.get('hasBananas'); // true + hamster.set('numBananas', null); + hamster.get('hasBananas'); // false + ``` + + @method bool + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which converts + to boolean the original value for property + @public + */ - _class2.prototype.get = function get() { - return _glimmerRuntimeLibReferences.UNDEFINED_REFERENCE; - }; + function bool(dependentKey) { + return _emberMetal.computed(dependentKey, function () { + return !!_emberMetal.get(this, dependentKey); + }); + } - _class2.prototype.has = function has(key) { - return false; - }; + /** + A computed property which matches the original value for the + dependent property against a given RegExp, returning `true` + if the value matches the RegExp and `false` if it does not. + + Example + + ```javascript + let User = Ember.Object.extend({ + hasValidEmail: Ember.computed.match('email', /^.+@.+\..+$/) + }); + + let user = User.create({loggedIn: false}); + + user.get('hasValidEmail'); // false + user.set('email', ''); + user.get('hasValidEmail'); // false + user.set('email', 'ember_hamster@example.com'); + user.get('hasValidEmail'); // true + ``` + + @method match + @for Ember.computed + @param {String} dependentKey + @param {RegExp} regexp + @return {Ember.ComputedProperty} computed property which match + the original value for property against a given RegExp + @public + */ - _class2.prototype.value = function value() { - return _glimmerRuntimeLibUtils.EMPTY_DICT; - }; + function match(dependentKey, regexp) { + return _emberMetal.computed(dependentKey, function () { + var value = _emberMetal.get(this, dependentKey); - return _class2; - })(EvaluatedNamedArgs))(); - exports.EVALUATED_EMPTY_NAMED_ARGS = EVALUATED_EMPTY_NAMED_ARGS; -}); + return typeof value === 'string' ? regexp.test(value) : false; + }); + } -enifed('glimmer-runtime/lib/compiled/expressions/positional-args', ['exports', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/utils', 'glimmer-reference'], function (exports, _glimmerRuntimeLibReferences, _glimmerRuntimeLibUtils, _glimmerReference) { - 'use strict'; + /** + A computed property that returns true if the provided dependent property + is equal to the given value. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + satisfied: Ember.computed.equal('percentCarrotsEaten', 100) + }); + + let hamster = Hamster.create(); + + hamster.get('satisfied'); // false + hamster.set('percentCarrotsEaten', 100); + hamster.get('satisfied'); // true + hamster.set('percentCarrotsEaten', 50); + hamster.get('satisfied'); // false + ``` + + @method equal + @for Ember.computed + @param {String} dependentKey + @param {String|Number|Object} value + @return {Ember.ComputedProperty} computed property which returns true if + the original value for property is equal to the given value. + @public + */ - var CompiledPositionalArgs = (function () { - function CompiledPositionalArgs(values) { - this.values = values; - this.length = values.length; - } + function equal(dependentKey, value) { + return _emberMetal.computed(dependentKey, function () { + return _emberMetal.get(this, dependentKey) === value; + }); + } - CompiledPositionalArgs.create = function create(values) { - if (values.length) { - return new this(values); - } else { - return COMPILED_EMPTY_POSITIONAL_ARGS; - } - }; + /** + A computed property that returns true if the provided dependent property + is greater than the provided value. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + hasTooManyBananas: Ember.computed.gt('numBananas', 10) + }); + + let hamster = Hamster.create(); + + hamster.get('hasTooManyBananas'); // false + hamster.set('numBananas', 3); + hamster.get('hasTooManyBananas'); // false + hamster.set('numBananas', 11); + hamster.get('hasTooManyBananas'); // true + ``` + + @method gt + @for Ember.computed + @param {String} dependentKey + @param {Number} value + @return {Ember.ComputedProperty} computed property which returns true if + the original value for property is greater than given value. + @public + */ - CompiledPositionalArgs.empty = function empty() { - return COMPILED_EMPTY_POSITIONAL_ARGS; - }; + function gt(dependentKey, value) { + return _emberMetal.computed(dependentKey, function () { + return _emberMetal.get(this, dependentKey) > value; + }); + } - CompiledPositionalArgs.prototype.evaluate = function evaluate(vm) { - var values = this.values; - var length = this.length; + /** + A computed property that returns true if the provided dependent property + is greater than or equal to the provided value. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + hasTooManyBananas: Ember.computed.gte('numBananas', 10) + }); + + let hamster = Hamster.create(); + + hamster.get('hasTooManyBananas'); // false + hamster.set('numBananas', 3); + hamster.get('hasTooManyBananas'); // false + hamster.set('numBananas', 10); + hamster.get('hasTooManyBananas'); // true + ``` + + @method gte + @for Ember.computed + @param {String} dependentKey + @param {Number} value + @return {Ember.ComputedProperty} computed property which returns true if + the original value for property is greater or equal then given value. + @public + */ - var references = new Array(length); - for (var i = 0; i < length; i++) { - references[i] = values[i].evaluate(vm); - } - return EvaluatedPositionalArgs.create(references); - }; + function gte(dependentKey, value) { + return _emberMetal.computed(dependentKey, function () { + return _emberMetal.get(this, dependentKey) >= value; + }); + } - CompiledPositionalArgs.prototype.toJSON = function toJSON() { - return '[' + this.values.map(function (value) { - return value.toJSON(); - }).join(", ") + ']'; - }; + /** + A computed property that returns true if the provided dependent property + is less than the provided value. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + needsMoreBananas: Ember.computed.lt('numBananas', 3) + }); + + let hamster = Hamster.create(); + + hamster.get('needsMoreBananas'); // true + hamster.set('numBananas', 3); + hamster.get('needsMoreBananas'); // false + hamster.set('numBananas', 2); + hamster.get('needsMoreBananas'); // true + ``` + + @method lt + @for Ember.computed + @param {String} dependentKey + @param {Number} value + @return {Ember.ComputedProperty} computed property which returns true if + the original value for property is less then given value. + @public + */ - return CompiledPositionalArgs; - })(); + function lt(dependentKey, value) { + return _emberMetal.computed(dependentKey, function () { + return _emberMetal.get(this, dependentKey) < value; + }); + } - exports.CompiledPositionalArgs = CompiledPositionalArgs; - var COMPILED_EMPTY_POSITIONAL_ARGS = new ((function (_CompiledPositionalArgs) { - babelHelpers.inherits(_class, _CompiledPositionalArgs); + /** + A computed property that returns true if the provided dependent property + is less than or equal to the provided value. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + needsMoreBananas: Ember.computed.lte('numBananas', 3) + }); + + let hamster = Hamster.create(); + + hamster.get('needsMoreBananas'); // true + hamster.set('numBananas', 5); + hamster.get('needsMoreBananas'); // false + hamster.set('numBananas', 3); + hamster.get('needsMoreBananas'); // true + ``` + + @method lte + @for Ember.computed + @param {String} dependentKey + @param {Number} value + @return {Ember.ComputedProperty} computed property which returns true if + the original value for property is less or equal than given value. + @public + */ - function _class() { - _CompiledPositionalArgs.call(this, _glimmerRuntimeLibUtils.EMPTY_ARRAY); - } + function lte(dependentKey, value) { + return _emberMetal.computed(dependentKey, function () { + return _emberMetal.get(this, dependentKey) <= value; + }); + } - _class.prototype.evaluate = function evaluate(vm) { - return EVALUATED_EMPTY_POSITIONAL_ARGS; - }; + /** + A computed property that performs a logical `and` on the + original values for the provided dependent properties. + + You may pass in more than two properties and even use + property brace expansion. The computed property will + return the first falsy value or last truthy value + just like JavaScript's `&&` operator. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + readyForCamp: Ember.computed.and('hasTent', 'hasBackpack'), + readyForHike: Ember.computed.and('hasWalkingStick', 'hasBackpack') + }); + + let tomster = Hamster.create(); + + tomster.get('readyForCamp'); // false + tomster.set('hasTent', true); + tomster.get('readyForCamp'); // false + tomster.set('hasBackpack', true); + tomster.get('readyForCamp'); // true + tomster.set('hasBackpack', 'Yes'); + tomster.get('readyForCamp'); // 'Yes' + tomster.set('hasWalkingStick', null); + tomster.get('readyForHike'); // null + ``` + + @method and + @for Ember.computed + @param {String} dependentKey* + @return {Ember.ComputedProperty} computed property which performs + a logical `and` on the values of all the original values for properties. + @public + */ + var and = generateComputedWithPredicate('and', function (value) { + return value; + }); - _class.prototype.toJSON = function toJSON() { - return ''; - }; + exports.and = and; + /** + A computed property which performs a logical `or` on the + original values for the provided dependent properties. + + You may pass in more than two properties and even use + property brace expansion. The computed property will + return the first truthy value or last falsy value just + like JavaScript's `||` operator. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + readyForRain: Ember.computed.or('hasJacket', 'hasUmbrella'), + readyForBeach: Ember.computed.or('{hasSunscreen,hasUmbrella}') + }); + + let tomster = Hamster.create(); + + tomster.get('readyForRain'); // undefined + tomster.set('hasUmbrella', true); + tomster.get('readyForRain'); // true + tomster.set('hasJacket', 'Yes'); + tomster.get('readyForRain'); // 'Yes' + tomster.set('hasSunscreen', 'Check'); + tomster.get('readyForBeach'); // 'Check' + ``` + + @method or + @for Ember.computed + @param {String} dependentKey* + @return {Ember.ComputedProperty} computed property which performs + a logical `or` on the values of all the original values for properties. + @public + */ + var or = generateComputedWithPredicate('or', function (value) { + return !value; + }); - return _class; - })(CompiledPositionalArgs))(); - exports.COMPILED_EMPTY_POSITIONAL_ARGS = COMPILED_EMPTY_POSITIONAL_ARGS; + exports.or = or; + /** + Creates a new property that is an alias for another property + on an object. Calls to `get` or `set` this property behave as + though they were called on the original property. + + ```javascript + let Person = Ember.Object.extend({ + name: 'Alex Matchneer', + nomen: Ember.computed.alias('name') + }); + + let alex = Person.create(); + + alex.get('nomen'); // 'Alex Matchneer' + alex.get('name'); // 'Alex Matchneer' + + alex.set('nomen', '@machty'); + alex.get('name'); // '@machty' + ``` + + @method alias + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which creates an + alias to the original value for property. + @public + */ - var EvaluatedPositionalArgs = (function () { - function EvaluatedPositionalArgs(values) { - this.values = values; - this.tag = _glimmerReference.combineTagged(values); - this.length = values.length; - } + /** + Where `computed.alias` aliases `get` and `set`, and allows for bidirectional + data flow, `computed.oneWay` only provides an aliased `get`. The `set` will + not mutate the upstream property, rather causes the current property to + become the value set. This causes the downstream property to permanently + diverge from the upstream property. + + Example + + ```javascript + let User = Ember.Object.extend({ + firstName: null, + lastName: null, + nickName: Ember.computed.oneWay('firstName') + }); + + let teddy = User.create({ + firstName: 'Teddy', + lastName: 'Zeenny' + }); + + teddy.get('nickName'); // 'Teddy' + teddy.set('nickName', 'TeddyBear'); // 'TeddyBear' + teddy.get('firstName'); // 'Teddy' + ``` + + @method oneWay + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which creates a + one way computed property to the original value for property. + @public + */ - EvaluatedPositionalArgs.create = function create(values) { - return new this(values); - }; + function oneWay(dependentKey) { + return _emberMetal.alias(dependentKey).oneWay(); + } - EvaluatedPositionalArgs.empty = function empty() { - return EVALUATED_EMPTY_POSITIONAL_ARGS; - }; + /** + This is a more semantically meaningful alias of `computed.oneWay`, + whose name is somewhat ambiguous as to which direction the data flows. + + @method reads + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which creates a + one way computed property to the original value for property. + @public + */ - EvaluatedPositionalArgs.prototype.at = function at(index) { - var values = this.values; - var length = this.length; + /** + Where `computed.oneWay` provides oneWay bindings, `computed.readOnly` provides + a readOnly one way binding. Very often when using `computed.oneWay` one does + not also want changes to propagate back up, as they will replace the value. + + This prevents the reverse flow, and also throws an exception when it occurs. + + Example + + ```javascript + let User = Ember.Object.extend({ + firstName: null, + lastName: null, + nickName: Ember.computed.readOnly('firstName') + }); + + let teddy = User.create({ + firstName: 'Teddy', + lastName: 'Zeenny' + }); + + teddy.get('nickName'); // 'Teddy' + teddy.set('nickName', 'TeddyBear'); // throws Exception + // throw new Ember.Error('Cannot Set: nickName on: ' );` + teddy.get('firstName'); // 'Teddy' + ``` + + @method readOnly + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which creates a + one way computed property to the original value for property. + @since 1.5.0 + @public + */ - return index < length ? values[index] : _glimmerRuntimeLibReferences.UNDEFINED_REFERENCE; - }; + function readOnly(dependentKey) { + return _emberMetal.alias(dependentKey).readOnly(); + } - EvaluatedPositionalArgs.prototype.value = function value() { - var values = this.values; - var length = this.length; + /** + Creates a new property that is an alias for another property + on an object. Calls to `get` or `set` this property behave as + though they were called on the original property, but also + print a deprecation warning. + + ```javascript + let Hamster = Ember.Object.extend({ + bananaCount: Ember.computed.deprecatingAlias('cavendishCount', { + id: 'hamster.deprecate-banana', + until: '3.0.0' + }) + }); + + let hamster = Hamster.create(); + + hamster.set('bananaCount', 5); // Prints a deprecation warning. + hamster.get('cavendishCount'); // 5 + ``` + + @method deprecatingAlias + @for Ember.computed + @param {String} dependentKey + @param {Object} options Options for `Ember.deprecate`. + @return {Ember.ComputedProperty} computed property which creates an + alias with a deprecation to the original value for property. + @since 1.7.0 + @public + */ - var ret = new Array(length); - for (var i = 0; i < length; i++) { - ret[i] = values[i].value(); - } - return ret; - }; + function deprecatingAlias(dependentKey, options) { + return _emberMetal.computed(dependentKey, { + get: function (key) { + _emberMetal.deprecate('Usage of `' + key + '` is deprecated, use `' + dependentKey + '` instead.', false, options); + return _emberMetal.get(this, dependentKey); + }, + set: function (key, value) { + _emberMetal.deprecate('Usage of `' + key + '` is deprecated, use `' + dependentKey + '` instead.', false, options); + _emberMetal.set(this, dependentKey, value); + return value; + } + }); + } +}); +enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/compare', 'ember-runtime/utils', 'ember-runtime/system/native_array'], function (exports, _emberUtils, _emberMetal, _emberRuntimeCompare, _emberRuntimeUtils, _emberRuntimeSystemNative_array) { + /** + @module ember + @submodule ember-runtime + */ - return EvaluatedPositionalArgs; - })(); + 'use strict'; - exports.EvaluatedPositionalArgs = EvaluatedPositionalArgs; - var EVALUATED_EMPTY_POSITIONAL_ARGS = new ((function (_EvaluatedPositionalArgs) { - babelHelpers.inherits(_class2, _EvaluatedPositionalArgs); + exports.sum = sum; + exports.max = max; + exports.min = min; + exports.map = map; + exports.mapBy = mapBy; + exports.filter = filter; + exports.filterBy = filterBy; + exports.uniq = uniq; + exports.uniqBy = uniqBy; + exports.intersect = intersect; + exports.setDiff = setDiff; + exports.collect = collect; + exports.sort = sort; - function _class2() { - _EvaluatedPositionalArgs.call(this, _glimmerRuntimeLibUtils.EMPTY_ARRAY); - } + function reduceMacro(dependentKey, callback, initialValue) { + return _emberMetal.computed(dependentKey + '.[]', function () { + var _this = this; - _class2.prototype.at = function at() { - return _glimmerRuntimeLibReferences.UNDEFINED_REFERENCE; - }; + var arr = _emberMetal.get(this, dependentKey); - _class2.prototype.value = function value() { - return this.values; - }; + if (arr === null || typeof arr !== 'object') { + return initialValue; + } - return _class2; - })(EvaluatedPositionalArgs))(); - exports.EVALUATED_EMPTY_POSITIONAL_ARGS = EVALUATED_EMPTY_POSITIONAL_ARGS; -}); + return arr.reduce(function (previousValue, currentValue, index, array) { + return callback.call(_this, previousValue, currentValue, index, array); + }, initialValue); + }).readOnly(); + } -enifed('glimmer-runtime/lib/compiled/expressions/value', ['exports', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-runtime/lib/references'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerRuntimeLibReferences) { - 'use strict'; + function arrayMacro(dependentKey, callback) { + // This is a bit ugly + var propertyName = undefined; + if (/@each/.test(dependentKey)) { + propertyName = dependentKey.replace(/\.@each.*$/, ''); + } else { + propertyName = dependentKey; + dependentKey += '.[]'; + } - var CompiledValue = (function (_CompiledExpression) { - babelHelpers.inherits(CompiledValue, _CompiledExpression); + return _emberMetal.computed(dependentKey, function () { + var value = _emberMetal.get(this, propertyName); + if (_emberRuntimeUtils.isArray(value)) { + return _emberRuntimeSystemNative_array.A(callback.call(this, value)); + } else { + return _emberRuntimeSystemNative_array.A(); + } + }).readOnly(); + } - function CompiledValue(value) { - _CompiledExpression.call(this); - this.type = "value"; - this.reference = _glimmerRuntimeLibReferences.PrimitiveReference.create(value); - } + function multiArrayMacro(dependentKeys, callback) { + var args = dependentKeys.map(function (key) { + return key + '.[]'; + }); - CompiledValue.prototype.evaluate = function evaluate(vm) { - return this.reference; - }; + args.push(function () { + return _emberRuntimeSystemNative_array.A(callback.call(this, dependentKeys)); + }); - CompiledValue.prototype.toJSON = function toJSON() { - return JSON.stringify(this.reference.value()); - }; + return _emberMetal.computed.apply(this, args).readOnly(); + } - return CompiledValue; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); + /** + A computed property that returns the sum of the values + in the dependent array. + + @method sum + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computes the sum of all values in the dependentKey's array + @since 1.4.0 + @public + */ - exports.default = CompiledValue; -}); + function sum(dependentKey) { + return reduceMacro(dependentKey, function (sum, item) { + return sum + item; + }, 0); + } -enifed('glimmer-runtime/lib/compiled/opcodes/builder', ['exports', 'glimmer-runtime/lib/compiled/opcodes/component', 'glimmer-runtime/lib/compiled/opcodes/partial', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-runtime/lib/compiled/opcodes/dom', 'glimmer-runtime/lib/compiled/opcodes/lists', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-util', 'glimmer-runtime/lib/utils'], function (exports, _glimmerRuntimeLibCompiledOpcodesComponent, _glimmerRuntimeLibCompiledOpcodesPartial, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerRuntimeLibCompiledOpcodesDom, _glimmerRuntimeLibCompiledOpcodesLists, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerUtil, _glimmerRuntimeLibUtils) { - 'use strict'; + /** + A computed property that calculates the maximum value in the + dependent array. This will return `-Infinity` when the dependent + array is empty. + + ```javascript + let Person = Ember.Object.extend({ + childAges: Ember.computed.mapBy('children', 'age'), + maxChildAge: Ember.computed.max('childAges') + }); + + let lordByron = Person.create({ children: [] }); + + lordByron.get('maxChildAge'); // -Infinity + lordByron.get('children').pushObject({ + name: 'Augusta Ada Byron', age: 7 + }); + lordByron.get('maxChildAge'); // 7 + lordByron.get('children').pushObjects([{ + name: 'Allegra Byron', + age: 5 + }, { + name: 'Elizabeth Medora Leigh', + age: 8 + }]); + lordByron.get('maxChildAge'); // 8 + ``` + + If the types of the arguments are not numbers, + they will be converted to numbers and the type + of the return value will always be `Number`. + For example, the max of a list of Date objects will be + the highest timestamp as a `Number`. + This behavior is consistent with `Math.max`. + + @method max + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computes the largest value in the dependentKey's array + @public + */ - var StatementCompilationBufferProxy = (function () { - function StatementCompilationBufferProxy(inner) { - this.inner = inner; - } + function max(dependentKey) { + return reduceMacro(dependentKey, function (max, item) { + return Math.max(max, item); + }, -Infinity); + } - StatementCompilationBufferProxy.prototype.toOpSeq = function toOpSeq() { - return this.inner.toOpSeq(); - }; + /** + A computed property that calculates the minimum value in the + dependent array. This will return `Infinity` when the dependent + array is empty. + + ```javascript + let Person = Ember.Object.extend({ + childAges: Ember.computed.mapBy('children', 'age'), + minChildAge: Ember.computed.min('childAges') + }); + + let lordByron = Person.create({ children: [] }); + + lordByron.get('minChildAge'); // Infinity + lordByron.get('children').pushObject({ + name: 'Augusta Ada Byron', age: 7 + }); + lordByron.get('minChildAge'); // 7 + lordByron.get('children').pushObjects([{ + name: 'Allegra Byron', + age: 5 + }, { + name: 'Elizabeth Medora Leigh', + age: 8 + }]); + lordByron.get('minChildAge'); // 5 + ``` + + If the types of the arguments are not numbers, + they will be converted to numbers and the type + of the return value will always be `Number`. + For example, the min of a list of Date objects will be + the lowest timestamp as a `Number`. + This behavior is consistent with `Math.min`. + + @method min + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computes the smallest value in the dependentKey's array + @public + */ - StatementCompilationBufferProxy.prototype.append = function append(opcode) { - this.inner.append(opcode); - }; + function min(dependentKey) { + return reduceMacro(dependentKey, function (min, item) { + return Math.min(min, item); + }, Infinity); + } - StatementCompilationBufferProxy.prototype.getLocalSymbol = function getLocalSymbol(name) { - return this.inner.getLocalSymbol(name); - }; + /** + Returns an array mapped via the callback + + The callback method you provide should have the following signature. + `item` is the current item in the iteration. + `index` is the integer index of the current item in the iteration. + + ```javascript + function(item, index); + ``` + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + excitingChores: Ember.computed.map('chores', function(chore, index) { + return chore.toUpperCase() + '!'; + }) + }); + + let hamster = Hamster.create({ + chores: ['clean', 'write more unit tests'] + }); + + hamster.get('excitingChores'); // ['CLEAN!', 'WRITE MORE UNIT TESTS!'] + ``` + + @method map + @for Ember.computed + @param {String} dependentKey + @param {Function} callback + @return {Ember.ComputedProperty} an array mapped via the callback + @public + */ - StatementCompilationBufferProxy.prototype.hasLocalSymbol = function hasLocalSymbol(name) { - return this.inner.hasLocalSymbol(name); - }; + function map(dependentKey, callback) { + return arrayMacro(dependentKey, function (value) { + return value.map(callback, this); + }); + } - StatementCompilationBufferProxy.prototype.getNamedSymbol = function getNamedSymbol(name) { - return this.inner.getNamedSymbol(name); - }; + /** + Returns an array mapped to the specified key. + + ```javascript + let Person = Ember.Object.extend({ + childAges: Ember.computed.mapBy('children', 'age') + }); + + let lordByron = Person.create({ children: [] }); + + lordByron.get('childAges'); // [] + lordByron.get('children').pushObject({ name: 'Augusta Ada Byron', age: 7 }); + lordByron.get('childAges'); // [7] + lordByron.get('children').pushObjects([{ + name: 'Allegra Byron', + age: 5 + }, { + name: 'Elizabeth Medora Leigh', + age: 8 + }]); + lordByron.get('childAges'); // [7, 5, 8] + ``` + + @method mapBy + @for Ember.computed + @param {String} dependentKey + @param {String} propertyKey + @return {Ember.ComputedProperty} an array mapped to the specified key + @public + */ - StatementCompilationBufferProxy.prototype.hasNamedSymbol = function hasNamedSymbol(name) { - return this.inner.hasNamedSymbol(name); - }; + function mapBy(dependentKey, propertyKey) { + _emberMetal.assert('Ember.computed.mapBy expects a property string for its second argument, ' + 'perhaps you meant to use "map"', typeof propertyKey === 'string'); - StatementCompilationBufferProxy.prototype.getBlockSymbol = function getBlockSymbol(name) { - return this.inner.getBlockSymbol(name); - }; + return map(dependentKey + '.@each.' + propertyKey, function (item) { + return _emberMetal.get(item, propertyKey); + }); + } - StatementCompilationBufferProxy.prototype.hasBlockSymbol = function hasBlockSymbol(name) { - return this.inner.hasBlockSymbol(name); - }; + /** + Filters the array by the callback. + + The callback method you provide should have the following signature. + `item` is the current item in the iteration. + `index` is the integer index of the current item in the iteration. + `array` is the dependant array itself. + + ```javascript + function(item, index, array); + ``` + + ```javascript + let Hamster = Ember.Object.extend({ + remainingChores: Ember.computed.filter('chores', function(chore, index, array) { + return !chore.done; + }) + }); + + let hamster = Hamster.create({ + chores: [ + { name: 'cook', done: true }, + { name: 'clean', done: true }, + { name: 'write more unit tests', done: false } + ] + }); + + hamster.get('remainingChores'); // [{name: 'write more unit tests', done: false}] + ``` + + @method filter + @for Ember.computed + @param {String} dependentKey + @param {Function} callback + @return {Ember.ComputedProperty} the filtered array + @public + */ - StatementCompilationBufferProxy.prototype.getPartialArgsSymbol = function getPartialArgsSymbol() { - return this.inner.getPartialArgsSymbol(); - }; + function filter(dependentKey, callback) { + return arrayMacro(dependentKey, function (value) { + return value.filter(callback, this); + }); + } - StatementCompilationBufferProxy.prototype.hasPartialArgsSymbol = function hasPartialArgsSymbol() { - return this.inner.hasPartialArgsSymbol(); - }; + /** + Filters the array by the property and value + + ```javascript + let Hamster = Ember.Object.extend({ + remainingChores: Ember.computed.filterBy('chores', 'done', false) + }); + + let hamster = Hamster.create({ + chores: [ + { name: 'cook', done: true }, + { name: 'clean', done: true }, + { name: 'write more unit tests', done: false } + ] + }); + + hamster.get('remainingChores'); // [{ name: 'write more unit tests', done: false }] + ``` + + @method filterBy + @for Ember.computed + @param {String} dependentKey + @param {String} propertyKey + @param {*} value + @return {Ember.ComputedProperty} the filtered array + @public + */ - babelHelpers.createClass(StatementCompilationBufferProxy, [{ - key: 'component', - get: function () { - return this.inner.component; - } - }]); - return StatementCompilationBufferProxy; - })(); + function filterBy(dependentKey, propertyKey, value) { + var callback = undefined; - exports.StatementCompilationBufferProxy = StatementCompilationBufferProxy; + if (arguments.length === 2) { + callback = function (item) { + return _emberMetal.get(item, propertyKey); + }; + } else { + callback = function (item) { + return _emberMetal.get(item, propertyKey) === value; + }; + } - var BasicOpcodeBuilder = (function (_StatementCompilationBufferProxy) { - babelHelpers.inherits(BasicOpcodeBuilder, _StatementCompilationBufferProxy); + return filter(dependentKey + '.@each.' + propertyKey, callback); + } - function BasicOpcodeBuilder(inner, symbolTable, env) { - _StatementCompilationBufferProxy.call(this, inner); - this.symbolTable = symbolTable; - this.env = env; - this.labelsStack = new _glimmerUtil.Stack(); - } + /** + A computed property which returns a new array with all the unique + elements from one or more dependent arrays. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + uniqueFruits: Ember.computed.uniq('fruits') + }); + + let hamster = Hamster.create({ + fruits: [ + 'banana', + 'grape', + 'kale', + 'banana' + ] + }); + + hamster.get('uniqueFruits'); // ['banana', 'grape', 'kale'] + ``` + + @method uniq + @for Ember.computed + @param {String} propertyKey* + @return {Ember.ComputedProperty} computes a new array with all the + unique elements from the dependent array + @public + */ - // helpers + function uniq() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - BasicOpcodeBuilder.prototype.startLabels = function startLabels() { - this.labelsStack.push(_glimmerUtil.dict()); - }; + return multiArrayMacro(args, function (dependentKeys) { + var _this2 = this; - BasicOpcodeBuilder.prototype.stopLabels = function stopLabels() { - this.labelsStack.pop(); - }; + var uniq = _emberRuntimeSystemNative_array.A(); - BasicOpcodeBuilder.prototype.labelFor = function labelFor(name) { - var labels = this.labels; - var label = labels[name]; - if (!label) { - label = labels[name] = new _glimmerRuntimeLibCompiledOpcodesVm.LabelOpcode(name); + dependentKeys.forEach(function (dependentKey) { + var value = _emberMetal.get(_this2, dependentKey); + if (_emberRuntimeUtils.isArray(value)) { + value.forEach(function (item) { + if (uniq.indexOf(item) === -1) { + uniq.push(item); } - return label; - }; + }); + } + }); - // partials + return uniq; + }); + } - BasicOpcodeBuilder.prototype.putPartialDefinition = function putPartialDefinition(definition) { - this.append(new _glimmerRuntimeLibCompiledOpcodesPartial.PutPartialDefinitionOpcode(definition)); - }; + /** + A computed property which returns a new array with all the unique + elements from an array, with uniqueness determined by specific key. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + uniqueFruits: Ember.computed.uniqBy('fruits', 'id') + }); + let hamster = Hamster.create({ + fruits: [ + { id: 1, 'banana' }, + { id: 2, 'grape' }, + { id: 3, 'peach' }, + { id: 1, 'banana' } + ] + }); + hamster.get('uniqueFruits'); // [ { id: 1, 'banana' }, { id: 2, 'grape' }, { id: 3, 'peach' }] + ``` + + @method uniqBy + @for Ember.computed + @param {String} dependentKey + @param {String} propertyKey + @return {Ember.ComputedProperty} computes a new array with all the + unique elements from the dependent array + @public + */ - BasicOpcodeBuilder.prototype.putDynamicPartialDefinition = function putDynamicPartialDefinition() { - this.append(new _glimmerRuntimeLibCompiledOpcodesPartial.PutDynamicPartialDefinitionOpcode(this.symbolTable)); - }; + function uniqBy(dependentKey, propertyKey) { + return _emberMetal.computed(dependentKey + '.[]', function () { + var uniq = _emberRuntimeSystemNative_array.A(); + var seen = new _emberUtils.EmptyObject(); + var list = _emberMetal.get(this, dependentKey); + if (_emberRuntimeUtils.isArray(list)) { + list.forEach(function (item) { + var guid = _emberUtils.guidFor(_emberMetal.get(item, propertyKey)); + if (!(guid in seen)) { + seen[guid] = true; + uniq.push(item); + } + }); + } + return uniq; + }).readOnly(); + } - BasicOpcodeBuilder.prototype.evaluatePartial = function evaluatePartial() { - this.append(new _glimmerRuntimeLibCompiledOpcodesPartial.EvaluatePartialOpcode(this.symbolTable)); - }; + /** + Alias for [Ember.computed.uniq](/api/#method_computed_uniq). + + @method union + @for Ember.computed + @param {String} propertyKey* + @return {Ember.ComputedProperty} computes a new array with all the + unique elements from the dependent array + @public + */ + var union = uniq; - // components + exports.union = union; + /** + A computed property which returns a new array with all the duplicated + elements from two or more dependent arrays. + + Example + + ```javascript + let obj = Ember.Object.extend({ + friendsInCommon: Ember.computed.intersect('adaFriends', 'charlesFriends') + }).create({ + adaFriends: ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'], + charlesFriends: ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock'] + }); + + obj.get('friendsInCommon'); // ['William King', 'Mary Somerville'] + ``` + + @method intersect + @for Ember.computed + @param {String} propertyKey* + @return {Ember.ComputedProperty} computes a new array with all the + duplicated elements from the dependent arrays + @public + */ - BasicOpcodeBuilder.prototype.putComponentDefinition = function putComponentDefinition(definition) { - this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.PutComponentDefinitionOpcode(definition)); - }; + function intersect() { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - BasicOpcodeBuilder.prototype.putDynamicComponentDefinition = function putDynamicComponentDefinition() { - this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.PutDynamicComponentDefinitionOpcode()); - }; + return multiArrayMacro(args, function (dependentKeys) { + var _this3 = this; - BasicOpcodeBuilder.prototype.openComponent = function openComponent(args) { - var shadow = arguments.length <= 1 || arguments[1] === undefined ? _glimmerRuntimeLibUtils.EMPTY_ARRAY : arguments[1]; + var arrays = dependentKeys.map(function (dependentKey) { + var array = _emberMetal.get(_this3, dependentKey); - this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.OpenComponentOpcode(this.compile(args), shadow)); - }; + return _emberRuntimeUtils.isArray(array) ? array : []; + }); - BasicOpcodeBuilder.prototype.didCreateElement = function didCreateElement() { - this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.DidCreateElementOpcode()); - }; + var results = arrays.pop().filter(function (candidate) { + for (var i = 0; i < arrays.length; i++) { + var found = false; + var array = arrays[i]; + for (var j = 0; j < array.length; j++) { + if (array[j] === candidate) { + found = true; + break; + } + } - BasicOpcodeBuilder.prototype.shadowAttributes = function shadowAttributes() { - this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.ShadowAttributesOpcode()); - }; + if (found === false) { + return false; + } + } - BasicOpcodeBuilder.prototype.didRenderLayout = function didRenderLayout() { - this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.DidRenderLayoutOpcode()); - }; + return true; + }); - BasicOpcodeBuilder.prototype.closeComponent = function closeComponent() { - this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.CloseComponentOpcode()); - }; + return _emberRuntimeSystemNative_array.A(results); + }); + } - // content + /** + A computed property which returns a new array with all the + properties from the first dependent array that are not in the second + dependent array. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + likes: ['banana', 'grape', 'kale'], + wants: Ember.computed.setDiff('likes', 'fruits') + }); + + let hamster = Hamster.create({ + fruits: [ + 'grape', + 'kale', + ] + }); + + hamster.get('wants'); // ['banana'] + ``` + + @method setDiff + @for Ember.computed + @param {String} setAProperty + @param {String} setBProperty + @return {Ember.ComputedProperty} computes a new array with all the + items from the first dependent array that are not in the second + dependent array + @public + */ - BasicOpcodeBuilder.prototype.cautiousAppend = function cautiousAppend() { - this.append(new _glimmerRuntimeLibCompiledOpcodesContent.OptimizedCautiousAppendOpcode()); - }; + function setDiff(setAProperty, setBProperty) { + if (arguments.length !== 2) { + throw new _emberMetal.Error('setDiff requires exactly two dependent arrays.'); + } - BasicOpcodeBuilder.prototype.trustingAppend = function trustingAppend() { - this.append(new _glimmerRuntimeLibCompiledOpcodesContent.OptimizedTrustingAppendOpcode()); - }; + return _emberMetal.computed(setAProperty + '.[]', setBProperty + '.[]', function () { + var setA = this.get(setAProperty); + var setB = this.get(setBProperty); - // dom + if (!_emberRuntimeUtils.isArray(setA)) { + return _emberRuntimeSystemNative_array.A(); + } + if (!_emberRuntimeUtils.isArray(setB)) { + return _emberRuntimeSystemNative_array.A(setA); + } - BasicOpcodeBuilder.prototype.text = function text(_text) { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.TextOpcode(_text)); - }; + return setA.filter(function (x) { + return setB.indexOf(x) === -1; + }); + }).readOnly(); + } - BasicOpcodeBuilder.prototype.openPrimitiveElement = function openPrimitiveElement(tag) { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.OpenPrimitiveElementOpcode(tag)); - }; + /** + A computed property that returns the array of values + for the provided dependent properties. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + clothes: Ember.computed.collect('hat', 'shirt') + }); + + let hamster = Hamster.create(); + + hamster.get('clothes'); // [null, null] + hamster.set('hat', 'Camp Hat'); + hamster.set('shirt', 'Camp Shirt'); + hamster.get('clothes'); // ['Camp Hat', 'Camp Shirt'] + ``` + + @method collect + @for Ember.computed + @param {String} dependentKey* + @return {Ember.ComputedProperty} computed property which maps + values of all passed in properties to an array. + @public + */ - BasicOpcodeBuilder.prototype.openComponentElement = function openComponentElement(tag) { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.OpenComponentElementOpcode(tag)); - }; + function collect() { + for (var _len3 = arguments.length, dependentKeys = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + dependentKeys[_key3] = arguments[_key3]; + } - BasicOpcodeBuilder.prototype.openDynamicPrimitiveElement = function openDynamicPrimitiveElement() { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.OpenDynamicPrimitiveElementOpcode()); - }; + return multiArrayMacro(dependentKeys, function () { + var properties = _emberMetal.getProperties(this, dependentKeys); + var res = _emberRuntimeSystemNative_array.A(); + for (var key in properties) { + if (properties.hasOwnProperty(key)) { + if (_emberMetal.isNone(properties[key])) { + res.push(null); + } else { + res.push(properties[key]); + } + } + } + return res; + }); + } - BasicOpcodeBuilder.prototype.flushElement = function flushElement() { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.FlushElementOpcode()); - }; + /** + A computed property which returns a new array with all the + properties from the first dependent array sorted based on a property + or sort function. + + The callback method you provide should have the following signature: + + ```javascript + function(itemA, itemB); + ``` + + - `itemA` the first item to compare. + - `itemB` the second item to compare. + + This function should return negative number (e.g. `-1`) when `itemA` should come before + `itemB`. It should return positive number (e.g. `1`) when `itemA` should come after + `itemB`. If the `itemA` and `itemB` are equal this function should return `0`. + + Therefore, if this function is comparing some numeric values, simple `itemA - itemB` or + `itemA.get( 'foo' ) - itemB.get( 'foo' )` can be used instead of series of `if`. + + Example + + ```javascript + let ToDoList = Ember.Object.extend({ + // using standard ascending sort + todosSorting: ['name'], + sortedTodos: Ember.computed.sort('todos', 'todosSorting'), + + // using descending sort + todosSortingDesc: ['name:desc'], + sortedTodosDesc: Ember.computed.sort('todos', 'todosSortingDesc'), + + // using a custom sort function + priorityTodos: Ember.computed.sort('todos', function(a, b){ + if (a.priority > b.priority) { + return 1; + } else if (a.priority < b.priority) { + return -1; + } + + return 0; + }) + }); + + let todoList = ToDoList.create({todos: [ + { name: 'Unit Test', priority: 2 }, + { name: 'Documentation', priority: 3 }, + { name: 'Release', priority: 1 } + ]}); + + todoList.get('sortedTodos'); // [{ name:'Documentation', priority:3 }, { name:'Release', priority:1 }, { name:'Unit Test', priority:2 }] + todoList.get('sortedTodosDesc'); // [{ name:'Unit Test', priority:2 }, { name:'Release', priority:1 }, { name:'Documentation', priority:3 }] + todoList.get('priorityTodos'); // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }] + ``` + + @method sort + @for Ember.computed + @param {String} itemsKey + @param {String or Function} sortDefinition a dependent key to an + array of sort properties (add `:desc` to the arrays sort properties to sort descending) or a function to use when sorting + @return {Ember.ComputedProperty} computes a new sorted array based + on the sort property array or callback function + @public + */ - BasicOpcodeBuilder.prototype.closeElement = function closeElement() { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.CloseElementOpcode()); - }; + function sort(itemsKey, sortDefinition) { + _emberMetal.assert('Ember.computed.sort requires two arguments: an array key to sort and ' + 'either a sort properties key or sort function', arguments.length === 2); - BasicOpcodeBuilder.prototype.staticAttr = function staticAttr(name, namespace, value) { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.StaticAttrOpcode(name, namespace, value)); - }; + if (typeof sortDefinition === 'function') { + return customSort(itemsKey, sortDefinition); + } else { + return propertySort(itemsKey, sortDefinition); + } + } - BasicOpcodeBuilder.prototype.dynamicAttrNS = function dynamicAttrNS(name, namespace, isTrusting) { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.DynamicAttrNSOpcode(name, namespace, isTrusting)); - }; + function customSort(itemsKey, comparator) { + return arrayMacro(itemsKey, function (value) { + var _this4 = this; - BasicOpcodeBuilder.prototype.dynamicAttr = function dynamicAttr(name, isTrusting) { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.DynamicAttrOpcode(name, isTrusting)); - }; + return value.slice().sort(function (x, y) { + return comparator.call(_this4, x, y); + }); + }); + } - BasicOpcodeBuilder.prototype.comment = function comment(_comment) { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.CommentOpcode(_comment)); - }; + // This one needs to dynamically set up and tear down observers on the itemsKey + // depending on the sortProperties + function propertySort(itemsKey, sortPropertiesKey) { + var cp = new _emberMetal.ComputedProperty(function (key) { + var _this5 = this; - // lists + var itemsKeyIsAtThis = itemsKey === '@this'; + var sortProperties = _emberMetal.get(this, sortPropertiesKey); - BasicOpcodeBuilder.prototype.putIterator = function putIterator() { - this.append(new _glimmerRuntimeLibCompiledOpcodesLists.PutIteratorOpcode()); - }; + _emberMetal.assert('The sort definition for \'' + key + '\' on ' + this + ' must be a function or an array of strings', _emberRuntimeUtils.isArray(sortProperties) && sortProperties.every(function (s) { + return typeof s === 'string'; + })); - BasicOpcodeBuilder.prototype.enterList = function enterList(start, end) { - this.append(new _glimmerRuntimeLibCompiledOpcodesLists.EnterListOpcode(this.labelFor(start), this.labelFor(end))); - }; + var normalizedSortProperties = normalizeSortProperties(sortProperties); - BasicOpcodeBuilder.prototype.exitList = function exitList() { - this.append(new _glimmerRuntimeLibCompiledOpcodesLists.ExitListOpcode()); - }; + // Add/remove property observers as required. + var activeObserversMap = cp._activeObserverMap || (cp._activeObserverMap = new _emberMetal.WeakMap()); + var activeObservers = activeObserversMap.get(this); - BasicOpcodeBuilder.prototype.enterWithKey = function enterWithKey(start, end) { - this.append(new _glimmerRuntimeLibCompiledOpcodesLists.EnterWithKeyOpcode(this.labelFor(start), this.labelFor(end))); - }; + if (activeObservers) { + activeObservers.forEach(function (args) { + return _emberMetal.removeObserver.apply(undefined, args); + }); + } - BasicOpcodeBuilder.prototype.nextIter = function nextIter(end) { - this.append(new _glimmerRuntimeLibCompiledOpcodesLists.NextIterOpcode(this.labelFor(end))); - }; + function sortPropertyDidChange() { + this.notifyPropertyChange(key); + } - // vm + activeObservers = normalizedSortProperties.map(function (_ref) { + var prop = _ref[0]; - BasicOpcodeBuilder.prototype.pushRemoteElement = function pushRemoteElement() { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.PushRemoteElementOpcode()); - }; + var path = itemsKeyIsAtThis ? '@each.' + prop : itemsKey + '.@each.' + prop; + var args = [_this5, path, sortPropertyDidChange]; + _emberMetal.addObserver.apply(undefined, args); + return args; + }); - BasicOpcodeBuilder.prototype.popRemoteElement = function popRemoteElement() { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.PopRemoteElementOpcode()); - }; + activeObserversMap.set(this, activeObservers); - BasicOpcodeBuilder.prototype.popElement = function popElement() { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.PopElementOpcode()); - }; + // Sort and return the array. + var items = itemsKeyIsAtThis ? this : _emberMetal.get(this, itemsKey); - BasicOpcodeBuilder.prototype.label = function label(name) { - this.append(this.labelFor(name)); - }; + if (_emberRuntimeUtils.isArray(items)) { + return sortByNormalizedSortProperties(items, normalizedSortProperties); + } else { + return _emberRuntimeSystemNative_array.A(); + } + }); - BasicOpcodeBuilder.prototype.pushChildScope = function pushChildScope() { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PushChildScopeOpcode()); - }; + cp._activeObserverMap = undefined; - BasicOpcodeBuilder.prototype.popScope = function popScope() { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PopScopeOpcode()); - }; + return cp.property(sortPropertiesKey + '.[]').readOnly(); + } - BasicOpcodeBuilder.prototype.pushDynamicScope = function pushDynamicScope() { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PushDynamicScopeOpcode()); - }; + function normalizeSortProperties(sortProperties) { + return sortProperties.map(function (p) { + var _p$split = p.split(':'); - BasicOpcodeBuilder.prototype.popDynamicScope = function popDynamicScope() { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PopDynamicScopeOpcode()); - }; + var prop = _p$split[0]; + var direction = _p$split[1]; - BasicOpcodeBuilder.prototype.putNull = function putNull() { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PutNullOpcode()); - }; + direction = direction || 'asc'; - BasicOpcodeBuilder.prototype.putValue = function putValue(expression) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PutValueOpcode(this.compile(expression))); - }; + return [prop, direction]; + }); + } - BasicOpcodeBuilder.prototype.putArgs = function putArgs(args) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PutArgsOpcode(this.compile(args))); - }; + function sortByNormalizedSortProperties(items, normalizedSortProperties) { + return _emberRuntimeSystemNative_array.A(items.slice().sort(function (itemA, itemB) { + for (var i = 0; i < normalizedSortProperties.length; i++) { + var _normalizedSortProperties$i = normalizedSortProperties[i]; + var prop = _normalizedSortProperties$i[0]; + var direction = _normalizedSortProperties$i[1]; - BasicOpcodeBuilder.prototype.bindDynamicScope = function bindDynamicScope(names) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.BindDynamicScopeOpcode(names)); - }; + var result = _emberRuntimeCompare.default(_emberMetal.get(itemA, prop), _emberMetal.get(itemB, prop)); + if (result !== 0) { + return direction === 'desc' ? -1 * result : result; + } + } - BasicOpcodeBuilder.prototype.bindPositionalArgs = function bindPositionalArgs(names, symbols) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.BindPositionalArgsOpcode(names, symbols)); - }; + return 0; + })); + } +}); +enifed('ember-runtime/controllers/controller', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/mixins/controller', 'ember-runtime/inject', 'ember-runtime/mixins/action_handler'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeMixinsController, _emberRuntimeInject, _emberRuntimeMixinsAction_handler) { + 'use strict'; - BasicOpcodeBuilder.prototype.bindNamedArgs = function bindNamedArgs(names, symbols) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.BindNamedArgsOpcode(names, symbols)); - }; + /** + @module ember + @submodule ember-runtime + */ - BasicOpcodeBuilder.prototype.bindBlocks = function bindBlocks(names, symbols) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.BindBlocksOpcode(names, symbols)); - }; + /** + @class Controller + @namespace Ember + @extends Ember.Object + @uses Ember.ControllerMixin + @public + */ + var Controller = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsController.default); - BasicOpcodeBuilder.prototype.enter = function enter(_enter, exit) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.EnterOpcode(this.labelFor(_enter), this.labelFor(exit))); - }; + _emberRuntimeMixinsAction_handler.deprecateUnderscoreActions(Controller); - BasicOpcodeBuilder.prototype.exit = function exit() { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.ExitOpcode()); - }; + function controllerInjectionHelper(factory) { + _emberMetal.assert('Defining an injected controller property on a ' + 'non-controller is not allowed.', _emberRuntimeMixinsController.default.detect(factory.PrototypeMixin)); + } - BasicOpcodeBuilder.prototype.evaluate = function evaluate(name, block) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.EvaluateOpcode(name, block)); - }; + /** + Creates a property that lazily looks up another controller in the container. + Can only be used when defining another controller. + + Example: + + ```javascript + App.PostController = Ember.Controller.extend({ + posts: Ember.inject.controller() + }); + ``` + + This example will create a `posts` property on the `post` controller that + looks up the `posts` controller in the container, making it easy to + reference other controllers. This is functionally equivalent to: + + ```javascript + App.PostController = Ember.Controller.extend({ + needs: 'posts', + posts: Ember.computed.alias('controllers.posts') + }); + ``` + + @method controller + @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 + @public + */ + _emberRuntimeInject.createInjectionHelper('controller', controllerInjectionHelper); - BasicOpcodeBuilder.prototype.test = function test(testFunc) { - if (testFunc === 'const') { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.TestOpcode(_glimmerRuntimeLibCompiledOpcodesVm.ConstTest)); - } else if (testFunc === 'simple') { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.TestOpcode(_glimmerRuntimeLibCompiledOpcodesVm.SimpleTest)); - } else if (testFunc === 'environment') { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.TestOpcode(_glimmerRuntimeLibCompiledOpcodesVm.EnvironmentTest)); - } else if (typeof testFunc === 'function') { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.TestOpcode(testFunc)); - } else { - throw new Error('unreachable'); - } - }; + exports.default = Controller; +}); +enifed('ember-runtime/copy', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/mixins/copyable'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeMixinsCopyable) { + 'use strict'; - BasicOpcodeBuilder.prototype.jump = function jump(target) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.JumpOpcode(this.labelFor(target))); - }; + exports.default = copy; - BasicOpcodeBuilder.prototype.jumpIf = function jumpIf(target) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.JumpIfOpcode(this.labelFor(target))); - }; + function _copy(obj, deep, seen, copies) { + var ret = undefined, + loc = undefined, + key = undefined; - BasicOpcodeBuilder.prototype.jumpUnless = function jumpUnless(target) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.JumpUnlessOpcode(this.labelFor(target))); - }; + // primitive data types are immutable, just return them. + if (typeof obj !== 'object' || obj === null) { + return obj; + } - babelHelpers.createClass(BasicOpcodeBuilder, [{ - key: 'labels', - get: function () { - return this.labelsStack.current; - } - }]); - return BasicOpcodeBuilder; - })(StatementCompilationBufferProxy); + // avoid cyclical loops + if (deep && (loc = seen.indexOf(obj)) >= 0) { + return copies[loc]; + } - exports.BasicOpcodeBuilder = BasicOpcodeBuilder; + _emberMetal.assert('Cannot clone an Ember.Object that does not implement Ember.Copyable', !(obj instanceof _emberRuntimeSystemObject.default) || _emberRuntimeMixinsCopyable.default && _emberRuntimeMixinsCopyable.default.detect(obj)); - function isCompilableExpression(expr) { - return expr && typeof expr['compile'] === 'function'; - } + // IMPORTANT: this specific test will detect a native array only. Any other + // object will need to implement Copyable. + if (Array.isArray(obj)) { + ret = obj.slice(); - var OpcodeBuilder = (function (_BasicOpcodeBuilder) { - babelHelpers.inherits(OpcodeBuilder, _BasicOpcodeBuilder); + if (deep) { + loc = ret.length; - function OpcodeBuilder() { - _BasicOpcodeBuilder.apply(this, arguments); + while (--loc >= 0) { + ret[loc] = _copy(ret[loc], deep, seen, copies); } + } + } else if (_emberRuntimeMixinsCopyable.default && _emberRuntimeMixinsCopyable.default.detect(obj)) { + ret = obj.copy(deep, seen, copies); + } else if (obj instanceof Date) { + ret = new Date(obj.getTime()); + } else { + ret = {}; - OpcodeBuilder.prototype.compile = function compile(expr) { - if (isCompilableExpression(expr)) { - return expr.compile(this, this.env, this.symbolTable); - } else { - return expr; - } - }; + for (key in obj) { + // support Null prototype + if (!Object.prototype.hasOwnProperty.call(obj, key)) { + continue; + } - OpcodeBuilder.prototype.bindPositionalArgsForBlock = function bindPositionalArgsForBlock(block) { - this.append(_glimmerRuntimeLibCompiledOpcodesVm.BindPositionalArgsOpcode.create(block)); - }; + // Prevents browsers that don't respect non-enumerability from + // copying internal Ember properties + if (key.substring(0, 2) === '__') { + continue; + } - OpcodeBuilder.prototype.preludeForLayout = function preludeForLayout(layout) { - if (layout.hasNamedParameters) { - this.append(_glimmerRuntimeLibCompiledOpcodesVm.BindNamedArgsOpcode.create(layout)); - } - if (layout.hasYields || layout.hasPartials) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.BindCallerScopeOpcode()); - } - if (layout.hasYields) { - this.append(_glimmerRuntimeLibCompiledOpcodesVm.BindBlocksOpcode.create(layout)); - } - if (layout.hasPartials) { - this.append(_glimmerRuntimeLibCompiledOpcodesVm.BindPartialArgsOpcode.create(layout)); - } - }; + ret[key] = deep ? _copy(obj[key], deep, seen, copies) : obj[key]; + } + } - // TODO - // come back to this - - OpcodeBuilder.prototype.block = function block(args, callback) { - if (args) this.putArgs(args); - this.startLabels(); - this.enter('BEGIN', 'END'); - this.label('BEGIN'); - callback(this, 'BEGIN', 'END'); - this.label('END'); - this.exit(); - this.stopLabels(); - }; + if (deep) { + seen.push(obj); + copies.push(ret); + } - // TODO - // come back to this - - OpcodeBuilder.prototype.iter = function iter(callback) { - this.startLabels(); - this.enterList('BEGIN', 'END'); - this.label('ITER'); - this.nextIter('BREAK'); - this.enterWithKey('BEGIN', 'END'); - this.label('BEGIN'); - callback(this, 'BEGIN', 'END'); - this.label('END'); - this.exit(); - this.jump('ITER'); - this.label('BREAK'); - this.exitList(); - this.stopLabels(); - }; + return ret; + } - // TODO - // come back to this + /** + Creates a shallow copy of the passed object. A deep copy of the object is + returned if the optional `deep` argument is `true`. + + If the passed object implements the `Ember.Copyable` interface, then this + function will delegate to the object's `copy()` method and return the + result. See `Ember.Copyable` for further details. + + For primitive values (which are immutable in JavaScript), the passed object + is simply returned. + + @method copy + @for Ember + @param {Object} obj The object to clone + @param {Boolean} [deep=false] If true, a deep copy of the object is made. + @return {Object} The copied object + @public + */ - OpcodeBuilder.prototype.unit = function unit(callback) { - this.startLabels(); - callback(this); - this.stopLabels(); - }; + function copy(obj, deep) { + // fast paths + if ('object' !== typeof obj || obj === null) { + return obj; // can't copy primitives + } - return OpcodeBuilder; - })(BasicOpcodeBuilder); + if (_emberRuntimeMixinsCopyable.default && _emberRuntimeMixinsCopyable.default.detect(obj)) { + return obj.copy(deep); + } - exports.default = OpcodeBuilder; + return _copy(obj, deep, deep ? [] : null, deep ? [] : null); + } }); +enifed('ember-runtime/ext/function', ['exports', 'ember-environment', 'ember-metal'], function (exports, _emberEnvironment, _emberMetal) { + /** + @module ember + @submodule ember-runtime + */ -enifed('glimmer-runtime/lib/compiled/opcodes/component', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-reference'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerReference) { - 'use strict'; + 'use strict'; - var PutDynamicComponentDefinitionOpcode = (function (_Opcode) { - babelHelpers.inherits(PutDynamicComponentDefinitionOpcode, _Opcode); + var a_slice = Array.prototype.slice; + var FunctionPrototype = Function.prototype; - function PutDynamicComponentDefinitionOpcode() { - _Opcode.apply(this, arguments); - this.type = "put-dynamic-component-definition"; - } + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.Function) { + /** + The `property` extension of Javascript's Function prototype is available + when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is + `true`, which is the default. + Computed properties allow you to treat a function like a property: + ```javascript + MyApp.President = Ember.Object.extend({ + firstName: '', + lastName: '', + fullName: function() { + return this.get('firstName') + ' ' + this.get('lastName'); + }.property() // Call this flag to mark the function as a property + }); + let president = MyApp.President.create({ + firstName: 'Barack', + lastName: 'Obama' + }); + president.get('fullName'); // 'Barack Obama' + ``` + Treating a function like a property is useful because they can work with + bindings, just like any other property. + Many computed properties have dependencies on other properties. For + example, in the above example, the `fullName` property depends on + `firstName` and `lastName` to determine its value. You can tell Ember + about these dependencies like this: + ```javascript + MyApp.President = Ember.Object.extend({ + firstName: '', + lastName: '', + fullName: function() { + return this.get('firstName') + ' ' + this.get('lastName'); + // Tell Ember.js that this computed property depends on firstName + // and lastName + }.property('firstName', 'lastName') + }); + ``` + 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/classes/Ember.computed.html). + @method property + @for Function + @public + */ + FunctionPrototype.property = function () { + var ret = _emberMetal.computed(this); + // ComputedProperty.prototype.property expands properties; no need for us to + // do so here. + return ret.property.apply(ret, arguments); + }; - PutDynamicComponentDefinitionOpcode.prototype.evaluate = function evaluate(vm) { - var reference = vm.frame.getOperand(); - var cache = _glimmerReference.isConst(reference) ? undefined : new _glimmerReference.ReferenceCache(reference); - var definition = cache ? cache.peek() : reference.value(); - vm.frame.setImmediate(definition); - if (cache) { - vm.updateWith(new _glimmerRuntimeLibCompiledOpcodesVm.Assert(cache)); - } - }; + /** + The `observes` extension of Javascript's Function prototype is available + when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is + true, which is the default. + You can observe property changes simply by adding the `observes` + call to the end of your method declarations in classes that you write. + For example: + ```javascript + Ember.Object.extend({ + valueObserver: function() { + // Executes whenever the "value" property changes + }.observes('value') + }); + ``` + In the future this method may become asynchronous. + See `Ember.observer`. + @method observes + @for Function + @public + */ + FunctionPrototype.observes = function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - PutDynamicComponentDefinitionOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$OPERAND"] - }; - }; + args.push(this); + return _emberMetal.observer.apply(this, args); + }; + + FunctionPrototype._observesImmediately = function () { + _emberMetal.assert('Immediate observers must observe internal properties only, ' + 'not properties on other objects.', function checkIsInternalProperty() { + for (var i = 0; i < arguments.length; i++) { + if (arguments[i].indexOf('.') !== -1) { + return false; + } + } + return true; + }); - return PutDynamicComponentDefinitionOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + // observes handles property expansion + return this.observes.apply(this, arguments); + }; + /** + The `observesImmediately` extension of Javascript's Function prototype is + available when `EmberENV.EXTEND_PROTOTYPES` or + `EmberENV.EXTEND_PROTOTYPES.Function` is true, which is the default. + You can observe property changes simply by adding the `observesImmediately` + call to the end of your method declarations in classes that you write. + For example: + ```javascript + Ember.Object.extend({ + valueObserver: function() { + // Executes immediately after the "value" property changes + }.observesImmediately('value') + }); + ``` + In the future, `observes` may become asynchronous. In this event, + `observesImmediately` will maintain the synchronous behavior. + See `Ember.immediateObserver`. + @method observesImmediately + @for Function + @deprecated + @private + */ + FunctionPrototype.observesImmediately = _emberMetal.deprecateFunc('Function#observesImmediately is deprecated. Use Function#observes instead', { id: 'ember-runtime.ext-function', until: '3.0.0' }, FunctionPrototype._observesImmediately); - exports.PutDynamicComponentDefinitionOpcode = PutDynamicComponentDefinitionOpcode; + /** + The `on` extension of Javascript's Function prototype is available + when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is + true, which is the default. + You can listen for events simply by adding the `on` call to the end of + your method declarations in classes or mixins that you write. For example: + ```javascript + Ember.Mixin.create({ + doSomethingWithElement: function() { + // Executes whenever the "didInsertElement" event fires + }.on('didInsertElement') + }); + ``` + See `Ember.on`. + @method on + @for Function + @public + */ + FunctionPrototype.on = function () { + var events = a_slice.call(arguments); + this.__ember_listens__ = events; - var PutComponentDefinitionOpcode = (function (_Opcode2) { - babelHelpers.inherits(PutComponentDefinitionOpcode, _Opcode2); + return this; + }; + } +}); +enifed('ember-runtime/ext/rsvp', ['exports', 'rsvp', 'ember-metal'], function (exports, _rsvp, _emberMetal) { + 'use strict'; - function PutComponentDefinitionOpcode(definition) { - _Opcode2.call(this); - this.definition = definition; - this.type = "put-component-definition"; - } + exports.onerrorDefault = onerrorDefault; - PutComponentDefinitionOpcode.prototype.evaluate = function evaluate(vm) { - vm.frame.setImmediate(this.definition); - }; + var backburner = _emberMetal.run.backburner; + _emberMetal.run._addQueue('rsvpAfter', 'destroy'); - PutComponentDefinitionOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.definition.name)] - }; - }; + _rsvp.configure('async', function (callback, promise) { + backburner.schedule('actions', null, callback, promise); + }); - return PutComponentDefinitionOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); - - exports.PutComponentDefinitionOpcode = PutComponentDefinitionOpcode; - - var OpenComponentOpcode = (function (_Opcode3) { - babelHelpers.inherits(OpenComponentOpcode, _Opcode3); - - function OpenComponentOpcode(args, shadow) { - _Opcode3.call(this); - this.args = args; - this.shadow = shadow; - this.type = "open-component"; - } - - OpenComponentOpcode.prototype.evaluate = function evaluate(vm) { - var rawArgs = this.args; - var shadow = this.shadow; - - var definition = vm.frame.getImmediate(); - var dynamicScope = vm.pushDynamicScope(); - var callerScope = vm.scope(); - var manager = definition.manager; - var args = manager.prepareArgs(definition, rawArgs.evaluate(vm), dynamicScope); - var hasDefaultBlock = !!args.blocks.default; // TODO Cleanup? - var component = manager.create(vm.env, definition, args, dynamicScope, vm.getSelf(), hasDefaultBlock); - var destructor = manager.getDestructor(component); - if (destructor) vm.newDestroyable(destructor); - var layout = manager.layoutFor(definition, component, vm.env); - var selfRef = manager.getSelf(component); - vm.beginCacheGroup(); - vm.stack().pushSimpleBlock(); - vm.pushRootScope(selfRef, layout.symbols); - vm.invokeLayout(args, layout, callerScope, component, manager, shadow); - vm.updateWith(new UpdateComponentOpcode(definition.name, component, manager, args, dynamicScope)); - }; + _rsvp.configure('after', function (cb) { + backburner.schedule('rsvpAfter', null, cb); + }); - OpenComponentOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$OPERAND"] - }; - }; + _rsvp.on('error', onerrorDefault); - return OpenComponentOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); - - exports.OpenComponentOpcode = OpenComponentOpcode; - - var UpdateComponentOpcode = (function (_UpdatingOpcode) { - babelHelpers.inherits(UpdateComponentOpcode, _UpdatingOpcode); - - function UpdateComponentOpcode(name, component, manager, args, dynamicScope) { - _UpdatingOpcode.call(this); - this.name = name; - this.component = component; - this.manager = manager; - this.args = args; - this.dynamicScope = dynamicScope; - this.type = "update-component"; - var componentTag = manager.getTag(component); - if (componentTag) { - this.tag = _glimmerReference.combine([args.tag, componentTag]); - } else { - this.tag = args.tag; - } - } + function onerrorDefault(reason) { + var error = errorFor(reason); + if (error) { + _emberMetal.dispatchError(error); + } + } - UpdateComponentOpcode.prototype.evaluate = function evaluate(vm) { - var component = this.component; - var manager = this.manager; - var args = this.args; - var dynamicScope = this.dynamicScope; + function errorFor(reason) { + if (!reason) return; - manager.update(component, args, dynamicScope); - }; + if (reason.errorThrown) { + return unwrapErrorThrown(reason); + } - UpdateComponentOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.name)] - }; - }; + if (reason.name === 'UnrecognizedURLError') { + _emberMetal.assert('The URL \'' + reason.message + '\' did not match any routes in your application', false); + return; + } - return UpdateComponentOpcode; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + if (reason.name === 'TransitionAborted') { + return; + } - exports.UpdateComponentOpcode = UpdateComponentOpcode; + return reason; + } - var DidCreateElementOpcode = (function (_Opcode4) { - babelHelpers.inherits(DidCreateElementOpcode, _Opcode4); + function unwrapErrorThrown(reason) { + var error = reason.errorThrown; + if (typeof error === 'string') { + error = new Error(error); + } + Object.defineProperty(error, '__reason_with_error_thrown__', { + value: reason, + enumerable: false + }); + return error; + } - function DidCreateElementOpcode() { - _Opcode4.apply(this, arguments); - this.type = "did-create-element"; - } + exports.default = _rsvp; +}); +enifed('ember-runtime/ext/string', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { + /** + @module ember + @submodule ember-runtime + */ - // Slow path for non-specialized component invocations. Uses an internal - // named lookup on the args. + 'use strict'; - DidCreateElementOpcode.prototype.evaluate = function evaluate(vm) { - var manager = vm.frame.getManager(); - var component = vm.frame.getComponent(); - manager.didCreateElement(component, vm.stack().constructing, vm.stack().operations); - }; + var StringPrototype = String.prototype; - DidCreateElementOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$ARGS"] - }; - }; + if (_emberEnvironment.ENV.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]; + } - return DidCreateElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return _emberRuntimeSystemString.fmt(this, args); + }; - exports.DidCreateElementOpcode = DidCreateElementOpcode; + /** + See [Ember.String.w](/api/classes/Ember.String.html#method_w). + @method w + @for String + @private + */ + StringPrototype.w = function () { + return _emberRuntimeSystemString.w(this); + }; - var ShadowAttributesOpcode = (function (_Opcode5) { - babelHelpers.inherits(ShadowAttributesOpcode, _Opcode5); + /** + See [Ember.String.loc](/api/classes/Ember.String.html#method_loc). + @method loc + @for String + @private + */ + StringPrototype.loc = function () { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - function ShadowAttributesOpcode() { - _Opcode5.apply(this, arguments); - this.type = "shadow-attributes"; - } + return _emberRuntimeSystemString.loc(this, args); + }; - ShadowAttributesOpcode.prototype.evaluate = function evaluate(vm) { - var shadow = vm.frame.getShadow(); - if (!shadow) return; + /** + See [Ember.String.camelize](/api/classes/Ember.String.html#method_camelize). + @method camelize + @for String + @private + */ + StringPrototype.camelize = function () { + return _emberRuntimeSystemString.camelize(this); + }; - var _vm$frame$getArgs = vm.frame.getArgs(); + /** + See [Ember.String.decamelize](/api/classes/Ember.String.html#method_decamelize). + @method decamelize + @for String + @private + */ + StringPrototype.decamelize = function () { + return _emberRuntimeSystemString.decamelize(this); + }; - var named = _vm$frame$getArgs.named; + /** + See [Ember.String.dasherize](/api/classes/Ember.String.html#method_dasherize). + @method dasherize + @for String + @private + */ + StringPrototype.dasherize = function () { + return _emberRuntimeSystemString.dasherize(this); + }; - shadow.forEach(function (name) { - vm.stack().setDynamicAttribute(name, named.get(name), false); - }); - }; + /** + See [Ember.String.underscore](/api/classes/Ember.String.html#method_underscore). + @method underscore + @for String + @private + */ + StringPrototype.underscore = function () { + return _emberRuntimeSystemString.underscore(this); + }; - ShadowAttributesOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$ARGS"] - }; - }; + /** + See [Ember.String.classify](/api/classes/Ember.String.html#method_classify). + @method classify + @for String + @private + */ + StringPrototype.classify = function () { + return _emberRuntimeSystemString.classify(this); + }; - return ShadowAttributesOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + See [Ember.String.capitalize](/api/classes/Ember.String.html#method_capitalize). + @method capitalize + @for String + @private + */ + StringPrototype.capitalize = function () { + return _emberRuntimeSystemString.capitalize(this); + }; + } +}); +enifed('ember-runtime/index', ['exports', 'ember-runtime/ext/string', 'ember-runtime/ext/function', 'ember-runtime/system/object', 'ember-runtime/system/string', 'ember-runtime/mixins/registry_proxy', 'ember-runtime/mixins/container_proxy', 'ember-runtime/copy', 'ember-runtime/inject', 'ember-runtime/compare', 'ember-runtime/is-equal', 'ember-runtime/mixins/array', 'ember-runtime/mixins/comparable', 'ember-runtime/system/namespace', 'ember-runtime/system/array_proxy', 'ember-runtime/system/object_proxy', 'ember-runtime/system/core_object', 'ember-runtime/system/native_array', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/copyable', 'ember-runtime/mixins/enumerable', 'ember-runtime/mixins/freezable', 'ember-runtime/mixins/-proxy', 'ember-runtime/system/lazy_load', 'ember-runtime/mixins/observable', '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/computed_macros', 'ember-runtime/computed/reduce_computed_macros', 'ember-runtime/controllers/controller', 'ember-runtime/mixins/controller', 'ember-runtime/system/service', 'ember-runtime/ext/rsvp', 'ember-runtime/utils', 'ember-runtime/string_registry'], function (exports, _emberRuntimeExtString, _emberRuntimeExtFunction, _emberRuntimeSystemObject, _emberRuntimeSystemString, _emberRuntimeMixinsRegistry_proxy, _emberRuntimeMixinsContainer_proxy, _emberRuntimeCopy, _emberRuntimeInject, _emberRuntimeCompare, _emberRuntimeIsEqual, _emberRuntimeMixinsArray, _emberRuntimeMixinsComparable, _emberRuntimeSystemNamespace, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemObject_proxy, _emberRuntimeSystemCore_object, _emberRuntimeSystemNative_array, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsFreezable, _emberRuntimeMixinsProxy, _emberRuntimeSystemLazy_load, _emberRuntimeMixinsObservable, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsTarget_action_support, _emberRuntimeMixinsEvented, _emberRuntimeMixinsPromise_proxy, _emberRuntimeComputedComputed_macros, _emberRuntimeComputedReduce_computed_macros, _emberRuntimeControllersController, _emberRuntimeMixinsController, _emberRuntimeSystemService, _emberRuntimeExtRsvp, _emberRuntimeUtils, _emberRuntimeString_registry) { + /** + @module ember + @submodule ember-runtime + */ - exports.ShadowAttributesOpcode = ShadowAttributesOpcode; + 'use strict'; - var DidRenderLayoutOpcode = (function (_Opcode6) { - babelHelpers.inherits(DidRenderLayoutOpcode, _Opcode6); + exports.Object = _emberRuntimeSystemObject.default; + exports.FrameworkObject = _emberRuntimeSystemObject.FrameworkObject; + exports.String = _emberRuntimeSystemString.default; + exports.RegistryProxyMixin = _emberRuntimeMixinsRegistry_proxy.default; + exports.buildFakeRegistryWithDeprecations = _emberRuntimeMixinsRegistry_proxy.buildFakeRegistryWithDeprecations; + exports.ContainerProxyMixin = _emberRuntimeMixinsContainer_proxy.default; + exports.copy = _emberRuntimeCopy.default; + exports.inject = _emberRuntimeInject.default; + exports.compare = _emberRuntimeCompare.default; + exports.isEqual = _emberRuntimeIsEqual.default; + exports.Array = _emberRuntimeMixinsArray.default; + exports.objectAt = _emberRuntimeMixinsArray.objectAt; + exports.isEmberArray = _emberRuntimeMixinsArray.isEmberArray; + exports.addArrayObserver = _emberRuntimeMixinsArray.addArrayObserver; + exports.removeArrayObserver = _emberRuntimeMixinsArray.removeArrayObserver; + exports.Comparable = _emberRuntimeMixinsComparable.default; + exports.Namespace = _emberRuntimeSystemNamespace.default; + exports.isNamespaceSearchDisabled = _emberRuntimeSystemNamespace.isSearchDisabled; + exports.setNamespaceSearchDisabled = _emberRuntimeSystemNamespace.setSearchDisabled; + exports.ArrayProxy = _emberRuntimeSystemArray_proxy.default; + exports.ObjectProxy = _emberRuntimeSystemObject_proxy.default; + exports.CoreObject = _emberRuntimeSystemCore_object.default; + exports.NativeArray = _emberRuntimeSystemNative_array.default; + exports.A = _emberRuntimeSystemNative_array.A; + exports.ActionHandler = _emberRuntimeMixinsAction_handler.default; + exports.deprecateUnderscoreActions = _emberRuntimeMixinsAction_handler.deprecateUnderscoreActions; + exports.Copyable = _emberRuntimeMixinsCopyable.default; + exports.Enumerable = _emberRuntimeMixinsEnumerable.default; + exports.Freezable = _emberRuntimeMixinsFreezable.Freezable; + exports.FROZEN_ERROR = _emberRuntimeMixinsFreezable.FROZEN_ERROR; + exports._ProxyMixin = _emberRuntimeMixinsProxy.default; + exports.onLoad = _emberRuntimeSystemLazy_load.onLoad; + exports.runLoadHooks = _emberRuntimeSystemLazy_load.runLoadHooks; + exports._loaded = _emberRuntimeSystemLazy_load._loaded; + exports.Observable = _emberRuntimeMixinsObservable.default; + exports.MutableEnumerable = _emberRuntimeMixinsMutable_enumerable.default; + exports.MutableArray = _emberRuntimeMixinsMutable_array.default; + exports.removeAt = _emberRuntimeMixinsMutable_array.removeAt; + exports.TargetActionSupport = _emberRuntimeMixinsTarget_action_support.default; + exports.Evented = _emberRuntimeMixinsEvented.default; + exports.PromiseProxyMixin = _emberRuntimeMixinsPromise_proxy.default; + exports.empty = _emberRuntimeComputedComputed_macros.empty; + exports.notEmpty = _emberRuntimeComputedComputed_macros.notEmpty; + exports.none = _emberRuntimeComputedComputed_macros.none; + exports.not = _emberRuntimeComputedComputed_macros.not; + exports.bool = _emberRuntimeComputedComputed_macros.bool; + exports.match = _emberRuntimeComputedComputed_macros.match; + exports.equal = _emberRuntimeComputedComputed_macros.equal; + exports.gt = _emberRuntimeComputedComputed_macros.gt; + exports.gte = _emberRuntimeComputedComputed_macros.gte; + exports.lt = _emberRuntimeComputedComputed_macros.lt; + exports.lte = _emberRuntimeComputedComputed_macros.lte; + exports.oneWay = _emberRuntimeComputedComputed_macros.oneWay; + exports.readOnly = _emberRuntimeComputedComputed_macros.readOnly; + exports.deprecatingAlias = _emberRuntimeComputedComputed_macros.deprecatingAlias; + exports.and = _emberRuntimeComputedComputed_macros.and; + exports.or = _emberRuntimeComputedComputed_macros.or; + exports.sum = _emberRuntimeComputedReduce_computed_macros.sum; + exports.min = _emberRuntimeComputedReduce_computed_macros.min; + exports.max = _emberRuntimeComputedReduce_computed_macros.max; + exports.map = _emberRuntimeComputedReduce_computed_macros.map; + exports.sort = _emberRuntimeComputedReduce_computed_macros.sort; + exports.setDiff = _emberRuntimeComputedReduce_computed_macros.setDiff; + exports.mapBy = _emberRuntimeComputedReduce_computed_macros.mapBy; + exports.filter = _emberRuntimeComputedReduce_computed_macros.filter; + exports.filterBy = _emberRuntimeComputedReduce_computed_macros.filterBy; + exports.uniq = _emberRuntimeComputedReduce_computed_macros.uniq; + exports.uniqBy = _emberRuntimeComputedReduce_computed_macros.uniqBy; + exports.union = _emberRuntimeComputedReduce_computed_macros.union; + exports.intersect = _emberRuntimeComputedReduce_computed_macros.intersect; + exports.collect = _emberRuntimeComputedReduce_computed_macros.collect; + exports.Controller = _emberRuntimeControllersController.default; + exports.ControllerMixin = _emberRuntimeMixinsController.default; + exports.Service = _emberRuntimeSystemService.default; + exports.RSVP = _emberRuntimeExtRsvp.default; + exports.onerrorDefault = _emberRuntimeExtRsvp.onerrorDefault; + // just for side effect of extending Ember.RSVP + exports.isArray = _emberRuntimeUtils.isArray; + exports.typeOf = _emberRuntimeUtils.typeOf; + exports.getStrings = _emberRuntimeString_registry.getStrings; + exports.setStrings = _emberRuntimeString_registry.setStrings; +}); +// just for side effect of extending String.prototype +// just for side effect of extending Function.prototype +enifed('ember-runtime/inject', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - function DidRenderLayoutOpcode() { - _Opcode6.apply(this, arguments); - this.type = "did-render-layout"; - } + exports.default = inject; + exports.createInjectionHelper = createInjectionHelper; + exports.validatePropertyInjections = validatePropertyInjections; - DidRenderLayoutOpcode.prototype.evaluate = function evaluate(vm) { - var manager = vm.frame.getManager(); - var component = vm.frame.getComponent(); - var bounds = vm.stack().popBlock(); - manager.didRenderLayout(component, bounds); - vm.env.didCreate(component, manager); - vm.updateWith(new DidUpdateLayoutOpcode(manager, component, bounds)); - }; + /** + Namespace for injection helper methods. + + @class inject + @namespace Ember + @static + @public + */ - return DidRenderLayoutOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + function inject() { + _emberMetal.assert('Injected properties must be created through helpers, see \'' + Object.keys(inject).join('"', '"') + '\''); + } - exports.DidRenderLayoutOpcode = DidRenderLayoutOpcode; + // Dictionary of injection validations by type, added to by `createInjectionHelper` + var typeValidators = {}; - var DidUpdateLayoutOpcode = (function (_UpdatingOpcode2) { - babelHelpers.inherits(DidUpdateLayoutOpcode, _UpdatingOpcode2); + /** + This method allows other Ember modules to register injection helpers for a + given container type. Helpers are exported to the `inject` namespace as the + container type itself. + + @private + @method createInjectionHelper + @since 1.10.0 + @for Ember + @param {String} type The container type the helper will inject + @param {Function} validator A validation callback that is executed at mixin-time + */ - function DidUpdateLayoutOpcode(manager, component, bounds) { - _UpdatingOpcode2.call(this); - this.manager = manager; - this.component = component; - this.bounds = bounds; - this.type = "did-update-layout"; - this.tag = _glimmerReference.CONSTANT_TAG; - } + function createInjectionHelper(type, validator) { + typeValidators[type] = validator; - DidUpdateLayoutOpcode.prototype.evaluate = function evaluate(vm) { - var manager = this.manager; - var component = this.component; - var bounds = this.bounds; + inject[type] = function (name) { + return new _emberMetal.InjectedProperty(type, name); + }; + } - manager.didUpdateLayout(component, bounds); - vm.env.didUpdate(component, manager); - }; + /** + Validation function that runs per-type validation functions once for each + injected type encountered. + + @private + @method validatePropertyInjections + @since 1.10.0 + @for Ember + @param {Object} factory The factory object + */ - return DidUpdateLayoutOpcode; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + function validatePropertyInjections(factory) { + var proto = factory.proto(); + var types = []; - exports.DidUpdateLayoutOpcode = DidUpdateLayoutOpcode; + for (var key in proto) { + var desc = proto[key]; + if (desc instanceof _emberMetal.InjectedProperty && types.indexOf(desc.type) === -1) { + types.push(desc.type); + } + } - var CloseComponentOpcode = (function (_Opcode7) { - babelHelpers.inherits(CloseComponentOpcode, _Opcode7); + if (types.length) { + for (var i = 0; i < types.length; i++) { + var validator = typeValidators[types[i]]; - function CloseComponentOpcode() { - _Opcode7.apply(this, arguments); - this.type = "close-component"; + if (typeof validator === 'function') { + validator(factory); } + } + } - CloseComponentOpcode.prototype.evaluate = function evaluate(vm) { - vm.popScope(); - vm.popDynamicScope(); - vm.commitCacheGroup(); - }; - - return CloseComponentOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); - - exports.CloseComponentOpcode = CloseComponentOpcode; + return true; + } }); +enifed('ember-runtime/is-equal', ['exports'], function (exports) { + /** + Compares two objects, returning true if they are equal. + + ```javascript + Ember.isEqual('hello', 'hello'); // true + Ember.isEqual(1, 2); // false + ``` + + `isEqual` is a more specific comparison than a triple equal comparison. + It will call the `isEqual` instance method on the objects being + compared, allowing finer control over when objects should be considered + equal to each other. + + ```javascript + let Person = Ember.Object.extend({ + isEqual(other) { return this.ssn == other.ssn; } + }); + + let personA = Person.create({name: 'Muhammad Ali', ssn: '123-45-6789'}); + let personB = Person.create({name: 'Cassius Clay', ssn: '123-45-6789'}); + + Ember.isEqual(personA, personB); // true + ``` + + Due to the expense of array comparisons, collections will never be equal to + each other even if each of their items are equal to each other. + + ```javascript + Ember.isEqual([4, 2], [4, 2]); // false + ``` + + @method isEqual + @for Ember + @param {Object} a first object to compare + @param {Object} b second object to compare + @return {Boolean} + @public + */ + 'use strict'; -enifed('glimmer-runtime/lib/compiled/opcodes/content', ['exports', 'glimmer-runtime/lib/upsert', 'glimmer-runtime/lib/component/interfaces', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/vm/update', 'glimmer-reference', 'glimmer-util', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/builder', 'glimmer-runtime/lib/compiler', 'glimmer-runtime/lib/compiled/opcodes/builder', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/syntax/core'], function (exports, _glimmerRuntimeLibUpsert, _glimmerRuntimeLibComponentInterfaces, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibVmUpdate, _glimmerReference, _glimmerUtil, _glimmerRuntimeLibBounds, _glimmerRuntimeLibBuilder, _glimmerRuntimeLibCompiler, _glimmerRuntimeLibCompiledOpcodesBuilder, _glimmerRuntimeLibReferences, _glimmerRuntimeLibSyntaxCore) { - 'use strict'; - - exports.normalizeTextValue = normalizeTextValue; - - function isEmpty(value) { - return value === null || value === undefined || typeof value['toString'] !== 'function'; - } + exports.default = isEqual; - function normalizeTextValue(value) { - if (isEmpty(value)) { - return ''; - } - return String(value); + function isEqual(a, b) { + if (a && typeof a.isEqual === 'function') { + return a.isEqual(b); } - function normalizeTrustedValue(value) { - if (isEmpty(value)) { - return ''; - } - if (_glimmerRuntimeLibUpsert.isString(value)) { - return value; - } - if (_glimmerRuntimeLibUpsert.isSafeString(value)) { - return value.toHTML(); - } - if (_glimmerRuntimeLibUpsert.isNode(value)) { - return value; - } - return String(value); - } - function normalizeValue(value) { - if (isEmpty(value)) { - return ''; - } - if (_glimmerRuntimeLibUpsert.isString(value)) { - return value; - } - if (_glimmerRuntimeLibUpsert.isSafeString(value) || _glimmerRuntimeLibUpsert.isNode(value)) { - return value; - } - return String(value); + if (a instanceof Date && b instanceof Date) { + return a.getTime() === b.getTime(); } - var AppendOpcode = (function (_Opcode) { - babelHelpers.inherits(AppendOpcode, _Opcode); - - function AppendOpcode() { - _Opcode.apply(this, arguments); - } - - AppendOpcode.prototype.evaluate = function evaluate(vm) { - var reference = vm.frame.getOperand(); - var normalized = this.normalize(reference); - var value = undefined, - cache = undefined; - if (_glimmerReference.isConst(reference)) { - value = normalized.value(); - } else { - cache = new _glimmerReference.ReferenceCache(normalized); - value = cache.peek(); - } - var stack = vm.stack(); - var upsert = this.insert(vm.env.getAppendOperations(), stack, value); - var bounds = new _glimmerRuntimeLibBuilder.Fragment(upsert.bounds); - stack.newBounds(bounds); - if (cache /* i.e. !isConst(reference) */) { - vm.updateWith(this.updateWith(vm, reference, cache, bounds, upsert)); - } - }; - - AppendOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$OPERAND"] - }; - }; - - return AppendOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return a === b; + } +}); +enifed('ember-runtime/mixins/-proxy', ['exports', '@glimmer/reference', 'ember-metal', 'ember-runtime/computed/computed_macros'], function (exports, _glimmerReference, _emberMetal, _emberRuntimeComputedComputed_macros) { + /** + @module ember + @submodule ember-runtime + */ - exports.AppendOpcode = AppendOpcode; + 'use strict'; - var GuardedAppendOpcode = (function (_AppendOpcode) { - babelHelpers.inherits(GuardedAppendOpcode, _AppendOpcode); + function contentPropertyWillChange(content, contentKey) { + var key = contentKey.slice(8); // remove "content." + if (key in this) { + return; + } // if shadowed in proxy + _emberMetal.propertyWillChange(this, key); + } - function GuardedAppendOpcode(expression, symbolTable) { - _AppendOpcode.call(this); - this.expression = expression; - this.symbolTable = symbolTable; - this.deopted = null; - } + function contentPropertyDidChange(content, contentKey) { + var key = contentKey.slice(8); // remove "content." + if (key in this) { + return; + } // if shadowed in proxy + _emberMetal.propertyDidChange(this, key); + } - GuardedAppendOpcode.prototype.evaluate = function evaluate(vm) { - if (this.deopted) { - vm.pushEvalFrame(this.deopted); - } else { - vm.evaluateOperand(this.expression); - var value = vm.frame.getOperand().value(); - if (_glimmerRuntimeLibComponentInterfaces.isComponentDefinition(value)) { - vm.pushEvalFrame(this.deopt(vm.env)); - } else { - _AppendOpcode.prototype.evaluate.call(this, vm); - } - } - }; + var ProxyTag = (function (_CachedTag) { + babelHelpers.inherits(ProxyTag, _CachedTag); - GuardedAppendOpcode.prototype.deopt = function deopt(env) { - var _this = this; + function ProxyTag(proxy) { + babelHelpers.classCallCheck(this, ProxyTag); - // At compile time, we determined that this append callsite might refer - // to a local variable/property lookup that resolves to a component - // definition at runtime. - // - // We could have eagerly compiled this callsite into something like this: - // - // {{#if (is-component-definition foo)}} - // {{component foo}} - // {{else}} - // {{foo}} - // {{/if}} - // - // However, in practice, there might be a large amout of these callsites - // and most of them would resolve to a simple value lookup. Therefore, we - // tried to be optimistic and assumed that the callsite will resolve to - // appending a simple value. - // - // However, we have reached here because at runtime, the guard conditional - // have detected that this callsite is indeed referring to a component - // definition object. Since this is likely going to be true for other - // instances of the same callsite, it is now appropiate to deopt into the - // expanded version that handles both cases. The compilation would look - // like this: - // - // PutValue(expression) - // Test(is-component-definition) - // Enter(BEGIN, END) - // BEGIN: Noop - // JumpUnless(VALUE) - // PutDynamicComponentDefinitionOpcode - // OpenComponent - // CloseComponent - // Jump(END) - // VALUE: Noop - // OptimizedAppend - // END: Noop - // Exit - // - // Keep in mind that even if we *don't* reach here at initial render time, - // it is still possible (although quite rare) that the simple value we - // encounter during initial render could later change into a component - // definition object at update time. That is handled by the "lazy deopt" - // code on the update side (scroll down for the next big block of comment). - var buffer = new _glimmerRuntimeLibCompiler.CompileIntoList(env, null); - var dsl = new _glimmerRuntimeLibCompiledOpcodesBuilder.default(buffer, this.symbolTable, env); - dsl.putValue(this.expression); - dsl.test(IsComponentDefinitionReference.create); - dsl.block(null, function (dsl, BEGIN, END) { - dsl.jumpUnless('VALUE'); - dsl.putDynamicComponentDefinition(); - dsl.openComponent(_glimmerRuntimeLibSyntaxCore.Args.empty()); - dsl.closeComponent(); - dsl.jump(END); - dsl.label('VALUE'); - dsl.append(new _this.AppendOpcode()); - }); - var deopted = this.deopted = dsl.toOpSeq(); - // From this point on, we have essentially replaced ourselve with a new set - // of opcodes. Since we will always be executing the new/deopted code, it's - // a good idea (as a pattern) to null out any unneeded fields here to avoid - // holding on to unneeded/stale objects: - this.expression = null; - return deopted; - }; + _CachedTag.call(this); - GuardedAppendOpcode.prototype.toJSON = function toJSON() { - var guid = this._guid; - var type = this.type; - var deopted = this.deopted; - - if (deopted) { - return { - guid: guid, - type: type, - deopted: true, - children: deopted.toArray().map(function (op) { - return op.toJSON(); - }) - }; - } else { - return { - guid: guid, - type: type, - args: [this.expression.toJSON()] - }; - } - }; + var content = _emberMetal.get(proxy, 'content'); - return GuardedAppendOpcode; - })(AppendOpcode); + this.proxy = proxy; + this.proxyWrapperTag = new _glimmerReference.DirtyableTag(); + this.proxyContentTag = new _glimmerReference.UpdatableTag(_emberMetal.tagFor(content)); + } - exports.GuardedAppendOpcode = GuardedAppendOpcode; + /** + `Ember.ProxyMixin` forwards all properties not defined by the proxy itself + to a proxied `content` object. See Ember.ObjectProxy for more details. + + @class ProxyMixin + @namespace Ember + @private + */ - var IsComponentDefinitionReference = (function (_ConditionalReference) { - babelHelpers.inherits(IsComponentDefinitionReference, _ConditionalReference); + ProxyTag.prototype.compute = function compute() { + return Math.max(this.proxyWrapperTag.value(), this.proxyContentTag.value()); + }; - function IsComponentDefinitionReference() { - _ConditionalReference.apply(this, arguments); - } + ProxyTag.prototype.dirty = function dirty() { + this.proxyWrapperTag.dirty(); + }; - IsComponentDefinitionReference.create = function create(inner) { - return new IsComponentDefinitionReference(inner); - }; + ProxyTag.prototype.contentDidChange = function contentDidChange() { + var content = _emberMetal.get(this.proxy, 'content'); + this.proxyContentTag.update(_emberMetal.tagFor(content)); + }; - IsComponentDefinitionReference.prototype.toBool = function toBool(value) { - return _glimmerRuntimeLibComponentInterfaces.isComponentDefinition(value); - }; + return ProxyTag; + })(_glimmerReference.CachedTag); - return IsComponentDefinitionReference; - })(_glimmerRuntimeLibReferences.ConditionalReference); + exports.default = _emberMetal.Mixin.create({ + /** + The object whose properties will be forwarded. + @property content + @type Ember.Object + @default null + @private + */ + content: null, - var UpdateOpcode = (function (_UpdatingOpcode) { - babelHelpers.inherits(UpdateOpcode, _UpdatingOpcode); + init: function () { + this._super.apply(this, arguments); + _emberMetal.meta(this).setProxy(); + }, - function UpdateOpcode(cache, bounds, upsert) { - _UpdatingOpcode.call(this); - this.cache = cache; - this.bounds = bounds; - this.upsert = upsert; - this.tag = cache.tag; - } + _initializeTag: _emberMetal.on('init', function () { + _emberMetal.meta(this)._tag = new ProxyTag(this); + }), - UpdateOpcode.prototype.evaluate = function evaluate(vm) { - var value = this.cache.revalidate(); - if (_glimmerReference.isModified(value)) { - var bounds = this.bounds; - var upsert = this.upsert; - var dom = vm.dom; + _contentDidChange: _emberMetal.observer('content', function () { + _emberMetal.assert('Can\'t set Proxy\'s content to itself', _emberMetal.get(this, 'content') !== this); + _emberMetal.tagFor(this).contentDidChange(); + }), - if (!this.upsert.update(dom, value)) { - var cursor = new _glimmerRuntimeLibBounds.Cursor(bounds.parentElement(), _glimmerRuntimeLibBounds.clear(bounds)); - upsert = this.upsert = this.insert(vm.env.getAppendOperations(), cursor, value); - } - bounds.update(upsert.bounds); - } - }; + isTruthy: _emberRuntimeComputedComputed_macros.bool('content'), - UpdateOpcode.prototype.toJSON = function toJSON() { - var guid = this._guid; - var type = this.type; - var cache = this.cache; + _debugContainerKey: null, - return { - guid: guid, - type: type, - details: { lastValue: JSON.stringify(cache.peek()) } - }; - }; + willWatchProperty: function (key) { + var contentKey = 'content.' + key; + _emberMetal._addBeforeObserver(this, contentKey, null, contentPropertyWillChange); + _emberMetal.addObserver(this, contentKey, null, contentPropertyDidChange); + }, - return UpdateOpcode; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + didUnwatchProperty: function (key) { + var contentKey = 'content.' + key; + _emberMetal._removeBeforeObserver(this, contentKey, null, contentPropertyWillChange); + _emberMetal.removeObserver(this, contentKey, null, contentPropertyDidChange); + }, - var GuardedUpdateOpcode = (function (_UpdateOpcode) { - babelHelpers.inherits(GuardedUpdateOpcode, _UpdateOpcode); + unknownProperty: function (key) { + var content = _emberMetal.get(this, 'content'); + if (content) { + _emberMetal.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 _emberMetal.get(content, key); + } + }, - function GuardedUpdateOpcode(reference, cache, bounds, upsert, appendOpcode, state) { - _UpdateOpcode.call(this, cache, bounds, upsert); - this.reference = reference; - this.appendOpcode = appendOpcode; - this.state = state; - this.deopted = null; - this.tag = this._tag = new _glimmerReference.UpdatableTag(this.tag); - } + setUnknownProperty: function (key, value) { + var m = _emberMetal.meta(this); + if (m.proto === this) { + // if marked as prototype then just defineProperty + // rather than delegate + _emberMetal.defineProperty(this, key, null, value); + return value; + } - GuardedUpdateOpcode.prototype.evaluate = function evaluate(vm) { - if (this.deopted) { - vm.evaluateOpcode(this.deopted); - } else { - if (_glimmerRuntimeLibComponentInterfaces.isComponentDefinition(this.reference.value())) { - this.lazyDeopt(vm); - } else { - _UpdateOpcode.prototype.evaluate.call(this, vm); - } - } - }; + var content = _emberMetal.get(this, 'content'); + _emberMetal.assert('Cannot delegate set(\'' + key + '\', ' + value + ') to the \'content\' property of object proxy ' + this + ': its \'content\' is undefined.', content); - GuardedUpdateOpcode.prototype.lazyDeopt = function lazyDeopt(vm) { - // Durign initial render, we know that the reference does not contain a - // component definition, so we optimistically assumed that this append - // is just a normal append. However, at update time, we discovered that - // the reference has switched into containing a component definition, so - // we need to do a "lazy deopt", simulating what would have happened if - // we had decided to perform the deopt in the first place during initial - // render. - // - // More concretely, we would have expanded the curly into a if/else, and - // based on whether the value is a component definition or not, we would - // have entered either the dynamic component branch or the simple value - // branch. - // - // Since we rendered a simple value during initial render (and all the - // updates up until this point), we need to pretend that the result is - // produced by the "VALUE" branch of the deopted append opcode: - // - // Try(BEGIN, END) - // Assert(IsComponentDefinition, expected=false) - // OptimizedUpdate - // - // In this case, because the reference has switched from being a simple - // value into a component definition, what would have happened is that - // the assert would throw, causing the Try opcode to teardown the bounds - // and rerun the original append opcode. - // - // Since the Try opcode would have nuked the updating opcodes anyway, we - // wouldn't have to worry about simulating those. All we have to do is to - // execute the Try opcode and immediately throw. - var bounds = this.bounds; - var appendOpcode = this.appendOpcode; - var state = this.state; - - var appendOps = appendOpcode.deopt(vm.env); - var enter = appendOps.head().next.next; - var ops = enter.slice; - var tracker = new _glimmerRuntimeLibBuilder.UpdatableBlockTracker(bounds.parentElement()); - tracker.newBounds(this.bounds); - var children = new _glimmerUtil.LinkedList(); - state.frame['condition'] = IsComponentDefinitionReference.create(state.frame['operand']); - var deopted = this.deopted = new _glimmerRuntimeLibVmUpdate.TryOpcode(ops, state, tracker, children); - this._tag.update(deopted.tag); - vm.evaluateOpcode(deopted); - vm.throw(); - // From this point on, we have essentially replaced ourselve with a new - // opcode. Since we will always be executing the new/deopted code, it's a - // good idea (as a pattern) to null out any unneeded fields here to avoid - // holding on to unneeded/stale objects: - this._tag = null; - this.reference = null; - this.cache = null; - this.bounds = null; - this.upsert = null; - this.appendOpcode = null; - this.state = null; - }; + _emberMetal.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 _emberMetal.set(content, key, value); + } + }); +}); +enifed('ember-runtime/mixins/action_handler', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-runtime + */ - GuardedUpdateOpcode.prototype.toJSON = function toJSON() { - var guid = this._guid; - var type = this.type; - var deopted = this.deopted; - - if (deopted) { - return { - guid: guid, - type: type, - deopted: true, - children: [deopted.toJSON()] - }; - } else { - return _UpdateOpcode.prototype.toJSON.call(this); - } - }; + 'use strict'; - return GuardedUpdateOpcode; - })(UpdateOpcode); + exports.deprecateUnderscoreActions = deprecateUnderscoreActions; - var OptimizedCautiousAppendOpcode = (function (_AppendOpcode2) { - babelHelpers.inherits(OptimizedCautiousAppendOpcode, _AppendOpcode2); + /** + `Ember.ActionHandler` is available on some familiar classes including + `Ember.Route`, `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.) + + @class ActionHandler + @namespace Ember + @private + */ + var ActionHandler = _emberMetal.Mixin.create({ + mergedProperties: ['actions'], - function OptimizedCautiousAppendOpcode() { - _AppendOpcode2.apply(this, arguments); - this.type = 'optimized-cautious-append'; + /** + 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 + from within a template and the application's current route is this route. + Actions can also be invoked from other parts of your application + via `ActionHandler#send`. + The `actions` hash will inherit action handlers from + the `actions` hash defined on extended parent classes + or mixins rather than just replace the entire hash, e.g.: + ```js + App.CanDisplayBanner = Ember.Mixin.create({ + actions: { + displayBanner(msg) { + // ... + } } - - OptimizedCautiousAppendOpcode.prototype.normalize = function normalize(reference) { - return _glimmerReference.map(reference, normalizeValue); - }; - - OptimizedCautiousAppendOpcode.prototype.insert = function insert(dom, cursor, value) { - return _glimmerRuntimeLibUpsert.cautiousInsert(dom, cursor, value); - }; - - OptimizedCautiousAppendOpcode.prototype.updateWith = function updateWith(vm, reference, cache, bounds, upsert) { - return new OptimizedCautiousUpdateOpcode(cache, bounds, upsert); - }; - - return OptimizedCautiousAppendOpcode; - })(AppendOpcode); - - exports.OptimizedCautiousAppendOpcode = OptimizedCautiousAppendOpcode; - - var OptimizedCautiousUpdateOpcode = (function (_UpdateOpcode2) { - babelHelpers.inherits(OptimizedCautiousUpdateOpcode, _UpdateOpcode2); - - function OptimizedCautiousUpdateOpcode() { - _UpdateOpcode2.apply(this, arguments); - this.type = 'optimized-cautious-update'; + }); + App.WelcomeRoute = Ember.Route.extend(App.CanDisplayBanner, { + actions: { + playMusic() { + // ... + } } - - OptimizedCautiousUpdateOpcode.prototype.insert = function insert(dom, cursor, value) { - return _glimmerRuntimeLibUpsert.cautiousInsert(dom, cursor, value); - }; - - return OptimizedCautiousUpdateOpcode; - })(UpdateOpcode); - - var GuardedCautiousAppendOpcode = (function (_GuardedAppendOpcode) { - babelHelpers.inherits(GuardedCautiousAppendOpcode, _GuardedAppendOpcode); - - function GuardedCautiousAppendOpcode() { - _GuardedAppendOpcode.apply(this, arguments); - this.type = 'guarded-cautious-append'; - this.AppendOpcode = OptimizedCautiousAppendOpcode; + }); + // `WelcomeRoute`, when active, will be able to respond + // to both actions, since the actions hash is merged rather + // then replaced when extending mixins / parent classes. + this.send('displayBanner'); + this.send('playMusic'); + ``` + Within a Controller, Route or Component's action handler, + the value of the `this` context is the Controller, Route or + Component object: + ```js + App.SongRoute = Ember.Route.extend({ + actions: { + myAction() { + this.controllerFor("song"); + this.transitionTo("other.route"); + ... + } } - - GuardedCautiousAppendOpcode.prototype.normalize = function normalize(reference) { - return _glimmerReference.map(reference, normalizeValue); - }; - - GuardedCautiousAppendOpcode.prototype.insert = function insert(dom, cursor, value) { - return _glimmerRuntimeLibUpsert.cautiousInsert(dom, cursor, value); - }; - - GuardedCautiousAppendOpcode.prototype.updateWith = function updateWith(vm, reference, cache, bounds, upsert) { - return new GuardedCautiousUpdateOpcode(reference, cache, bounds, upsert, this, vm.capture()); - }; - - return GuardedCautiousAppendOpcode; - })(GuardedAppendOpcode); - - exports.GuardedCautiousAppendOpcode = GuardedCautiousAppendOpcode; - - var GuardedCautiousUpdateOpcode = (function (_GuardedUpdateOpcode) { - babelHelpers.inherits(GuardedCautiousUpdateOpcode, _GuardedUpdateOpcode); - - function GuardedCautiousUpdateOpcode() { - _GuardedUpdateOpcode.apply(this, arguments); - this.type = 'guarded-cautious-update'; + }); + ``` + It is also possible to call `this._super(...arguments)` from within an + action handler if it overrides a handler defined on a parent + class or mixin: + Take for example the following routes: + ```js + App.DebugRoute = Ember.Mixin.create({ + actions: { + debugRouteInformation() { + console.debug("trololo"); + } } - - GuardedCautiousUpdateOpcode.prototype.insert = function insert(dom, cursor, value) { - return _glimmerRuntimeLibUpsert.cautiousInsert(dom, cursor, value); - }; - - return GuardedCautiousUpdateOpcode; - })(GuardedUpdateOpcode); - - var OptimizedTrustingAppendOpcode = (function (_AppendOpcode3) { - babelHelpers.inherits(OptimizedTrustingAppendOpcode, _AppendOpcode3); - - function OptimizedTrustingAppendOpcode() { - _AppendOpcode3.apply(this, arguments); - this.type = 'optimized-trusting-append'; + }); + App.AnnoyingDebugRoute = Ember.Route.extend(App.DebugRoute, { + actions: { + debugRouteInformation() { + // also call the debugRouteInformation of mixed in App.DebugRoute + this._super(...arguments); + // show additional annoyance + window.alert(...); + } + } + }); + ``` + ## Bubbling + By default, an action will stop bubbling once a handler defined + on the `actions` hash handles it. To continue bubbling the action, + you must return `true` from the handler: + ```js + App.Router.map(function() { + this.route("album", function() { + this.route("song"); + }); + }); + App.AlbumRoute = Ember.Route.extend({ + actions: { + startPlaying: function() { + } } - - OptimizedTrustingAppendOpcode.prototype.normalize = function normalize(reference) { - return _glimmerReference.map(reference, normalizeTrustedValue); - }; - - OptimizedTrustingAppendOpcode.prototype.insert = function insert(dom, cursor, value) { - return _glimmerRuntimeLibUpsert.trustingInsert(dom, cursor, value); - }; - - OptimizedTrustingAppendOpcode.prototype.updateWith = function updateWith(vm, reference, cache, bounds, upsert) { - return new OptimizedTrustingUpdateOpcode(cache, bounds, upsert); - }; - - return OptimizedTrustingAppendOpcode; - })(AppendOpcode); - - exports.OptimizedTrustingAppendOpcode = OptimizedTrustingAppendOpcode; - - var OptimizedTrustingUpdateOpcode = (function (_UpdateOpcode3) { - babelHelpers.inherits(OptimizedTrustingUpdateOpcode, _UpdateOpcode3); - - function OptimizedTrustingUpdateOpcode() { - _UpdateOpcode3.apply(this, arguments); - this.type = 'optimized-trusting-update'; + }); + App.AlbumSongRoute = Ember.Route.extend({ + actions: { + startPlaying() { + // ... + if (actionShouldAlsoBeTriggeredOnParentRoute) { + return true; + } + } } + }); + ``` + @property actions + @type Object + @default null + @public + */ - OptimizedTrustingUpdateOpcode.prototype.insert = function insert(dom, cursor, value) { - return _glimmerRuntimeLibUpsert.trustingInsert(dom, cursor, value); - }; - - return OptimizedTrustingUpdateOpcode; - })(UpdateOpcode); - - var GuardedTrustingAppendOpcode = (function (_GuardedAppendOpcode2) { - babelHelpers.inherits(GuardedTrustingAppendOpcode, _GuardedAppendOpcode2); - - function GuardedTrustingAppendOpcode() { - _GuardedAppendOpcode2.apply(this, arguments); - this.type = 'guarded-trusting-append'; - this.AppendOpcode = OptimizedTrustingAppendOpcode; + /** + 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 + not be found in the `ActionHandler`'s `actions` hash or if the + action target function returns `true`. + Example + ```js + App.WelcomeRoute = Ember.Route.extend({ + actions: { + playTheme() { + this.send('playMusic', 'theme.mp3'); + }, + playMusic(track) { + // ... + } } + }); + ``` + @method send + @param {String} actionName The action to trigger + @param {*} context a context to send with the action + @public + */ + send: function (actionName) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } - GuardedTrustingAppendOpcode.prototype.normalize = function normalize(reference) { - return _glimmerReference.map(reference, normalizeTrustedValue); - }; - - GuardedTrustingAppendOpcode.prototype.insert = function insert(dom, cursor, value) { - return _glimmerRuntimeLibUpsert.trustingInsert(dom, cursor, value); - }; - - GuardedTrustingAppendOpcode.prototype.updateWith = function updateWith(vm, reference, cache, bounds, upsert) { - return new GuardedTrustingUpdateOpcode(reference, cache, bounds, upsert, this, vm.capture()); - }; + if (this.actions && this.actions[actionName]) { + var shouldBubble = this.actions[actionName].apply(this, args) === true; + if (!shouldBubble) { + return; + } + } - return GuardedTrustingAppendOpcode; - })(GuardedAppendOpcode); + var target = _emberMetal.get(this, 'target'); + if (target) { + _emberMetal.assert('The `target` for ' + this + ' (' + target + ') does not have a `send` method', typeof target.send === 'function'); + target.send.apply(target, arguments); + } + }, - exports.GuardedTrustingAppendOpcode = GuardedTrustingAppendOpcode; + willMergeMixin: function (props) { + _emberMetal.assert('Specifying `_actions` and `actions` in the same mixin is not supported.', !props.actions || !props._actions); - var GuardedTrustingUpdateOpcode = (function (_GuardedUpdateOpcode2) { - babelHelpers.inherits(GuardedTrustingUpdateOpcode, _GuardedUpdateOpcode2); + if (props._actions) { + _emberMetal.deprecate('Specifying actions in `_actions` is deprecated, please use `actions` instead.', false, { id: 'ember-runtime.action-handler-_actions', until: '3.0.0' }); - function GuardedTrustingUpdateOpcode() { - _GuardedUpdateOpcode2.apply(this, arguments); - this.type = 'trusting-update'; - } + props.actions = props._actions; + delete props._actions; + } + } + }); - GuardedTrustingUpdateOpcode.prototype.insert = function insert(dom, cursor, value) { - return _glimmerRuntimeLibUpsert.trustingInsert(dom, cursor, value); - }; + exports.default = ActionHandler; - return GuardedTrustingUpdateOpcode; - })(GuardedUpdateOpcode); + function deprecateUnderscoreActions(factory) { + Object.defineProperty(factory.prototype, '_actions', { + configurable: true, + enumerable: false, + set: function (value) { + _emberMetal.assert('You cannot set `_actions` on ' + this + ', please use `actions` instead.'); + }, + get: function () { + _emberMetal.deprecate('Usage of `_actions` is deprecated, use `actions` instead.', false, { id: 'ember-runtime.action-handler-_actions', until: '3.0.0' }); + return _emberMetal.get(this, 'actions'); + } + }); + } }); +enifed('ember-runtime/mixins/array', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/mixins/enumerable', 'ember-runtime/system/each_proxy'], function (exports, _emberUtils, _emberMetal, _emberRuntimeMixinsEnumerable, _emberRuntimeSystemEach_proxy) { + /** + @module ember + @submodule ember-runtime + */ -enifed('glimmer-runtime/lib/compiled/opcodes/dom', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/compiled/opcodes/vm'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibReferences, _glimmerRuntimeLibCompiledOpcodesVm) { - 'use strict'; + // .......................................................... + // HELPERS + // + 'use strict'; - var TextOpcode = (function (_Opcode) { - babelHelpers.inherits(TextOpcode, _Opcode); + var _Mixin$create; - function TextOpcode(text) { - _Opcode.call(this); - this.text = text; - this.type = "text"; - } + exports.addArrayObserver = addArrayObserver; + exports.removeArrayObserver = removeArrayObserver; + exports.objectAt = objectAt; + exports.arrayContentWillChange = arrayContentWillChange; + exports.arrayContentDidChange = arrayContentDidChange; + exports.isEmberArray = isEmberArray; - TextOpcode.prototype.evaluate = function evaluate(vm) { - vm.stack().appendText(this.text); - }; + function arrayObserversHelper(obj, target, opts, operation, notify) { + var willChange = opts && opts.willChange || 'arrayWillChange'; + var didChange = opts && opts.didChange || 'arrayDidChange'; + var hasObservers = _emberMetal.get(obj, 'hasArrayObservers'); - TextOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.text)] - }; - }; + if (hasObservers === notify) { + _emberMetal.propertyWillChange(obj, 'hasArrayObservers'); + } - return TextOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + operation(obj, '@array:before', target, willChange); + operation(obj, '@array:change', target, didChange); - exports.TextOpcode = TextOpcode; + if (hasObservers === notify) { + _emberMetal.propertyDidChange(obj, 'hasArrayObservers'); + } - var OpenPrimitiveElementOpcode = (function (_Opcode2) { - babelHelpers.inherits(OpenPrimitiveElementOpcode, _Opcode2); + return obj; + } - function OpenPrimitiveElementOpcode(tag) { - _Opcode2.call(this); - this.tag = tag; - this.type = "open-primitive-element"; - } + function addArrayObserver(array, target, opts) { + return arrayObserversHelper(array, target, opts, _emberMetal.addListener, false); + } - OpenPrimitiveElementOpcode.prototype.evaluate = function evaluate(vm) { - vm.stack().openElement(this.tag); - }; + function removeArrayObserver(array, target, opts) { + return arrayObserversHelper(array, target, opts, _emberMetal.removeListener, true); + } - OpenPrimitiveElementOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.tag)] - }; - }; + function objectAt(content, idx) { + if (content.objectAt) { + return content.objectAt(idx); + } - return OpenPrimitiveElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return content[idx]; + } - exports.OpenPrimitiveElementOpcode = OpenPrimitiveElementOpcode; + function arrayContentWillChange(array, startIdx, removeAmt, addAmt) { + var removing = undefined, + lim = undefined; - var PushRemoteElementOpcode = (function (_Opcode3) { - babelHelpers.inherits(PushRemoteElementOpcode, _Opcode3); + // if no args are passed assume everything changes + if (startIdx === undefined) { + startIdx = 0; + removeAmt = addAmt = -1; + } else { + if (removeAmt === undefined) { + removeAmt = -1; + } - function PushRemoteElementOpcode() { - _Opcode3.apply(this, arguments); - this.type = "push-remote-element"; - } + if (addAmt === undefined) { + addAmt = -1; + } + } - PushRemoteElementOpcode.prototype.evaluate = function evaluate(vm) { - var reference = vm.frame.getOperand(); - var cache = _glimmerReference.isConst(reference) ? undefined : new _glimmerReference.ReferenceCache(reference); - var element = cache ? cache.peek() : reference.value(); - vm.stack().pushRemoteElement(element); - if (cache) { - vm.updateWith(new _glimmerRuntimeLibCompiledOpcodesVm.Assert(cache)); - } - }; + if (array.__each) { + array.__each.arrayWillChange(array, startIdx, removeAmt, addAmt); + } - PushRemoteElementOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ['$OPERAND'] - }; - }; + _emberMetal.sendEvent(array, '@array:before', [array, startIdx, removeAmt, addAmt]); - return PushRemoteElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + if (startIdx >= 0 && removeAmt >= 0 && _emberMetal.get(array, 'hasEnumerableObservers')) { + removing = []; + lim = startIdx + removeAmt; - exports.PushRemoteElementOpcode = PushRemoteElementOpcode; + for (var idx = startIdx; idx < lim; idx++) { + removing.push(objectAt(array, idx)); + } + } else { + removing = removeAmt; + } - var PopRemoteElementOpcode = (function (_Opcode4) { - babelHelpers.inherits(PopRemoteElementOpcode, _Opcode4); + array.enumerableContentWillChange(removing, addAmt); - function PopRemoteElementOpcode() { - _Opcode4.apply(this, arguments); - this.type = "pop-remote-element"; - } + return array; + } - PopRemoteElementOpcode.prototype.evaluate = function evaluate(vm) { - vm.stack().popRemoteElement(); - }; + function arrayContentDidChange(array, startIdx, removeAmt, addAmt) { + // if no args are passed assume everything changes + if (startIdx === undefined) { + startIdx = 0; + removeAmt = addAmt = -1; + } else { + if (removeAmt === undefined) { + removeAmt = -1; + } - return PopRemoteElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + if (addAmt === undefined) { + addAmt = -1; + } + } - exports.PopRemoteElementOpcode = PopRemoteElementOpcode; + var adding = undefined; + if (startIdx >= 0 && addAmt >= 0 && _emberMetal.get(array, 'hasEnumerableObservers')) { + adding = []; + var lim = startIdx + addAmt; - var OpenComponentElementOpcode = (function (_Opcode5) { - babelHelpers.inherits(OpenComponentElementOpcode, _Opcode5); + for (var idx = startIdx; idx < lim; idx++) { + adding.push(objectAt(array, idx)); + } + } else { + adding = addAmt; + } - function OpenComponentElementOpcode(tag) { - _Opcode5.call(this); - this.tag = tag; - this.type = "open-component-element"; - } + array.enumerableContentDidChange(removeAmt, adding); - OpenComponentElementOpcode.prototype.evaluate = function evaluate(vm) { - vm.stack().openElement(this.tag, new ComponentElementOperations(vm.env)); - }; + if (array.__each) { + array.__each.arrayDidChange(array, startIdx, removeAmt, addAmt); + } - OpenComponentElementOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.tag)] - }; - }; + _emberMetal.sendEvent(array, '@array:change', [array, startIdx, removeAmt, addAmt]); - return OpenComponentElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + var meta = _emberMetal.peekMeta(array); + var cache = meta && meta.readableCache(); - exports.OpenComponentElementOpcode = OpenComponentElementOpcode; + if (cache) { + if (cache.firstObject !== undefined && objectAt(array, 0) !== _emberMetal.cacheFor.get(cache, 'firstObject')) { + _emberMetal.propertyWillChange(array, 'firstObject'); + _emberMetal.propertyDidChange(array, 'firstObject'); + } + if (cache.lastObject !== undefined && objectAt(array, _emberMetal.get(array, 'length') - 1) !== _emberMetal.cacheFor.get(cache, 'lastObject')) { + _emberMetal.propertyWillChange(array, 'lastObject'); + _emberMetal.propertyDidChange(array, 'lastObject'); + } + } + return array; + } - var OpenDynamicPrimitiveElementOpcode = (function (_Opcode6) { - babelHelpers.inherits(OpenDynamicPrimitiveElementOpcode, _Opcode6); + var EMBER_ARRAY = _emberUtils.symbol('EMBER_ARRAY'); - function OpenDynamicPrimitiveElementOpcode() { - _Opcode6.apply(this, arguments); - this.type = "open-dynamic-primitive-element"; - } + function isEmberArray(obj) { + return obj && !!obj[EMBER_ARRAY]; + } - OpenDynamicPrimitiveElementOpcode.prototype.evaluate = function evaluate(vm) { - var tagName = vm.frame.getOperand().value(); - vm.stack().openElement(tagName); - }; + // .......................................................... + // ARRAY + // + /** + This mixin implements Observer-friendly Array-like behavior. It is not a + concrete implementation, but it can be used up by other classes that want + to appear like arrays. + + For example, ArrayProxy is a concrete classes that can + be instantiated to implement array-like behavior. Both of these classes use + the Array Mixin by way of the MutableArray mixin, which allows observable + changes to be made to the underlying array. + + Unlike `Ember.Enumerable,` this mixin defines methods specifically for + collections that provide index-ordered access to their contents. When you + are designing code that needs to accept any kind of Array-like object, you + should use these methods instead of Array primitives because these will + properly notify observers of changes to the array. + + Although these methods are efficient, they do add a layer of indirection to + your application so it is a good idea to use them only when you need the + flexibility of using both true JavaScript arrays and "virtual" arrays such + as controllers and collections. + + You can use the methods defined in this module to access and modify array + contents in a KVO-friendly way. You can also be notified whenever the + membership of an array changes by using `.observes('myArray.[]')`. + + To support `Ember.Array` in your own class, you must override two + primitives to use it: `length()` and `objectAt()`. + + Note that the Ember.Array mixin also incorporates the `Ember.Enumerable` + mixin. All `Ember.Array`-like objects are also enumerable. + + @class Array + @namespace Ember + @uses Ember.Enumerable + @since Ember 0.9.0 + @public + */ + var ArrayMixin = _emberMetal.Mixin.create(_emberRuntimeMixinsEnumerable.default, (_Mixin$create = {}, _Mixin$create[EMBER_ARRAY] = true, _Mixin$create.length = null, _Mixin$create.objectAt = function (idx) { + if (idx < 0 || idx >= _emberMetal.get(this, 'length')) { + return undefined; + } - OpenDynamicPrimitiveElementOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$OPERAND"] - }; - }; + return _emberMetal.get(this, idx); + }, _Mixin$create.objectsAt = function (indexes) { + var _this = this; - return OpenDynamicPrimitiveElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return indexes.map(function (idx) { + return objectAt(_this, idx); + }); + }, _Mixin$create.nextObject = function (idx) { + return objectAt(this, idx); + }, _Mixin$create['[]'] = _emberMetal.computed({ + get: function (key) { + return this; + }, + set: function (key, value) { + this.replace(0, _emberMetal.get(this, 'length'), value); + return this; + } + }), _Mixin$create.firstObject = _emberMetal.computed(function () { + return objectAt(this, 0); + }).readOnly(), _Mixin$create.lastObject = _emberMetal.computed(function () { + return objectAt(this, _emberMetal.get(this, 'length') - 1); + }).readOnly(), _Mixin$create.contains = function (obj) { + _emberMetal.deprecate('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.', false, { id: 'ember-runtime.enumerable-contains', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_enumerable-contains' }); - exports.OpenDynamicPrimitiveElementOpcode = OpenDynamicPrimitiveElementOpcode; + return this.indexOf(obj) >= 0; + }, _Mixin$create.slice = function (beginIndex, endIndex) { + var ret = _emberMetal.default.A(); + var length = _emberMetal.get(this, 'length'); - var ClassList = (function () { - function ClassList() { - this.list = null; - this.isConst = true; - } + if (_emberMetal.isNone(beginIndex)) { + beginIndex = 0; + } - ClassList.prototype.append = function append(reference) { - var list = this.list; - var isConst = this.isConst; + if (_emberMetal.isNone(endIndex) || endIndex > length) { + endIndex = length; + } - if (list === null) list = this.list = []; - list.push(reference); - this.isConst = isConst && _glimmerReference.isConst(reference); - }; + if (beginIndex < 0) { + beginIndex = length + beginIndex; + } - ClassList.prototype.toReference = function toReference() { - var list = this.list; - var isConst = this.isConst; + if (endIndex < 0) { + endIndex = length + endIndex; + } - if (!list) return _glimmerRuntimeLibReferences.NULL_REFERENCE; - if (isConst) return _glimmerRuntimeLibReferences.PrimitiveReference.create(toClassName(list)); - return new ClassListReference(list); - }; + while (beginIndex < endIndex) { + ret[ret.length] = objectAt(this, beginIndex++); + } - return ClassList; - })(); + return ret; + }, _Mixin$create.indexOf = function (object, startAt) { + var len = _emberMetal.get(this, 'length'); - var ClassListReference = (function (_CachedReference) { - babelHelpers.inherits(ClassListReference, _CachedReference); + if (startAt === undefined) { + startAt = 0; + } - function ClassListReference(list) { - _CachedReference.call(this); - this.list = []; - this.tag = _glimmerReference.combineTagged(list); - this.list = list; - } + if (startAt < 0) { + startAt += len; + } - ClassListReference.prototype.compute = function compute() { - return toClassName(this.list); - }; + for (var idx = startAt; idx < len; idx++) { + if (objectAt(this, idx) === object) { + return idx; + } + } - return ClassListReference; - })(_glimmerReference.CachedReference); + return -1; + }, _Mixin$create.lastIndexOf = function (object, startAt) { + var len = _emberMetal.get(this, 'length'); - function toClassName(list) { - var ret = []; - for (var i = 0; i < list.length; i++) { - var value = list[i].value(); - if (value !== false && value !== null && value !== undefined) ret.push(value); - } - return ret.length === 0 ? null : ret.join(' '); + if (startAt === undefined || startAt >= len) { + startAt = len - 1; } - var SimpleElementOperations = (function () { - function SimpleElementOperations(env) { - this.env = env; - this.opcodes = null; - this.classList = null; - } + if (startAt < 0) { + startAt += len; + } - SimpleElementOperations.prototype.addStaticAttribute = function addStaticAttribute(element, name, value) { - if (name === 'class') { - this.addClass(_glimmerRuntimeLibReferences.PrimitiveReference.create(value)); - } else { - this.env.getAppendOperations().setAttribute(element, name, value); - } - }; + for (var idx = startAt; idx >= 0; idx--) { + if (objectAt(this, idx) === object) { + return idx; + } + } - SimpleElementOperations.prototype.addStaticAttributeNS = function addStaticAttributeNS(element, namespace, name, value) { - this.env.getAppendOperations().setAttribute(element, name, value, namespace); - }; + return -1; + }, _Mixin$create.addArrayObserver = function (target, opts) { + return addArrayObserver(this, target, opts); + }, _Mixin$create.removeArrayObserver = function (target, opts) { + return removeArrayObserver(this, target, opts); + }, _Mixin$create.hasArrayObservers = _emberMetal.computed(function () { + return _emberMetal.hasListeners(this, '@array:change') || _emberMetal.hasListeners(this, '@array:before'); + }), _Mixin$create.arrayContentWillChange = function (startIdx, removeAmt, addAmt) { + return arrayContentWillChange(this, startIdx, removeAmt, addAmt); + }, _Mixin$create.arrayContentDidChange = function (startIdx, removeAmt, addAmt) { + return arrayContentDidChange(this, startIdx, removeAmt, addAmt); + }, _Mixin$create.includes = function (obj, startAt) { + var len = _emberMetal.get(this, 'length'); - SimpleElementOperations.prototype.addDynamicAttribute = function addDynamicAttribute(element, name, reference, isTrusting) { - if (name === 'class') { - this.addClass(reference); - } else { - var attributeManager = this.env.attributeFor(element, name, isTrusting); - var attribute = new DynamicAttribute(element, attributeManager, name, reference); - this.addAttribute(attribute); - } - }; + if (startAt === undefined) { + startAt = 0; + } - SimpleElementOperations.prototype.addDynamicAttributeNS = function addDynamicAttributeNS(element, namespace, name, reference, isTrusting) { - var attributeManager = this.env.attributeFor(element, name, isTrusting, namespace); - var nsAttribute = new DynamicAttribute(element, attributeManager, name, reference, namespace); - this.addAttribute(nsAttribute); - }; + if (startAt < 0) { + startAt += len; + } - SimpleElementOperations.prototype.flush = function flush(element, vm) { - var env = vm.env; - var opcodes = this.opcodes; - var classList = this.classList; + for (var idx = startAt; idx < len; idx++) { + var currentObj = objectAt(this, idx); - for (var i = 0; opcodes && i < opcodes.length; i++) { - vm.updateWith(opcodes[i]); - } - if (classList) { - var attributeManager = env.attributeFor(element, 'class', false); - var attribute = new DynamicAttribute(element, attributeManager, 'class', classList.toReference()); - var opcode = attribute.flush(env); - if (opcode) { - vm.updateWith(opcode); - } - } - this.opcodes = null; - this.classList = null; - }; + // SameValueZero comparison (NaN !== NaN) + if (obj === currentObj || obj !== obj && currentObj !== currentObj) { + return true; + } + } - SimpleElementOperations.prototype.addClass = function addClass(reference) { - var classList = this.classList; + return false; + }, _Mixin$create['@each'] = _emberMetal.computed(function () { + // TODO use Symbol or add to meta + if (!this.__each) { + this.__each = new _emberRuntimeSystemEach_proxy.default(this); + } - if (!classList) { - classList = this.classList = new ClassList(); - } - classList.append(reference); - }; + return this.__each; + }).volatile().readOnly(), _Mixin$create)); - SimpleElementOperations.prototype.addAttribute = function addAttribute(attribute) { - var opcode = attribute.flush(this.env); - if (opcode) { - var opcodes = this.opcodes; + exports.default = ArrayMixin; +}); +// ES6TODO: Ember.A - if (!opcodes) { - opcodes = this.opcodes = []; - } - opcodes.push(opcode); - } - }; +/** + __Required.__ You must implement this method to apply this mixin. + Your array must support the `length` property. Your replace methods should + set this property whenever it changes. + @property {Number} length + @public +*/ - return SimpleElementOperations; - })(); +/** + Returns the object at the given `index`. If the given `index` is negative + or is greater or equal than the array length, returns `undefined`. + This is one of the primitives you must implement to support `Ember.Array`. + If your object supports retrieving the value of an array item using `get()` + (i.e. `myArray.get(0)`), then you do not need to implement this method + yourself. + ```javascript + let arr = ['a', 'b', 'c', 'd']; + arr.objectAt(0); // 'a' + arr.objectAt(3); // 'd' + arr.objectAt(-1); // undefined + arr.objectAt(4); // undefined + arr.objectAt(5); // undefined + ``` + @method objectAt + @param {Number} idx The index of the item to return. + @return {*} item at index or undefined + @public +*/ - exports.SimpleElementOperations = SimpleElementOperations; +/** + This returns the objects at the specified indexes, using `objectAt`. + ```javascript + let arr = ['a', 'b', 'c', 'd']; + arr.objectsAt([0, 1, 2]); // ['a', 'b', 'c'] + arr.objectsAt([2, 3, 4]); // ['c', 'd', undefined] + ``` + @method objectsAt + @param {Array} indexes An array of indexes of items to return. + @return {Array} + @public + */ - var ComponentElementOperations = (function () { - function ComponentElementOperations(env) { - this.env = env; - this.attributeNames = null; - this.attributes = null; - this.classList = null; - } +// overrides Ember.Enumerable version - ComponentElementOperations.prototype.addStaticAttribute = function addStaticAttribute(element, name, value) { - if (name === 'class') { - this.addClass(_glimmerRuntimeLibReferences.PrimitiveReference.create(value)); - } else if (this.shouldAddAttribute(name)) { - this.addAttribute(name, new StaticAttribute(element, name, value)); - } - }; +/** + This is the handler for the special array content property. If you get + this property, it will return this. If you set this property to a new + array, it will replace the current content. + This property overrides the default property defined in `Ember.Enumerable`. + @property [] + @return this + @public +*/ - ComponentElementOperations.prototype.addStaticAttributeNS = function addStaticAttributeNS(element, namespace, name, value) { - if (this.shouldAddAttribute(name)) { - this.addAttribute(name, new StaticAttribute(element, name, value, namespace)); - } - }; +// optimized version from Enumerable - ComponentElementOperations.prototype.addDynamicAttribute = function addDynamicAttribute(element, name, reference, isTrusting) { - if (name === 'class') { - this.addClass(reference); - } else if (this.shouldAddAttribute(name)) { - var attributeManager = this.env.attributeFor(element, name, isTrusting); - var attribute = new DynamicAttribute(element, attributeManager, name, reference); - this.addAttribute(name, attribute); - } - }; +// Add any extra methods to Ember.Array that are native to the built-in Array. +/** + Returns a new array that is a slice of the receiver. This implementation + uses the observable array methods to retrieve the objects for the new + slice. + ```javascript + let arr = ['red', 'green', 'blue']; + arr.slice(0); // ['red', 'green', 'blue'] + arr.slice(0, 2); // ['red', 'green'] + arr.slice(1, 100); // ['green', 'blue'] + ``` + @method slice + @param {Number} beginIndex (Optional) index to begin slicing from. + @param {Number} endIndex (Optional) index to end the slice at (but not included). + @return {Array} New array with specified slice + @public +*/ + +/** + Returns the index of the given object's first occurrence. + If no `startAt` argument is given, the starting location to + search is 0. If it's negative, will count backward from + the end of the array. Returns -1 if no match is found. + ```javascript + let arr = ['a', 'b', 'c', 'd', 'a']; + arr.indexOf('a'); // 0 + arr.indexOf('z'); // -1 + arr.indexOf('a', 2); // 4 + arr.indexOf('a', -1); // 4 + arr.indexOf('b', 3); // -1 + arr.indexOf('a', 100); // -1 + ``` + @method indexOf + @param {Object} object the item to search for + @param {Number} startAt optional starting location to search, default 0 + @return {Number} index or -1 if not found + @public +*/ - ComponentElementOperations.prototype.addDynamicAttributeNS = function addDynamicAttributeNS(element, namespace, name, reference, isTrusting) { - if (this.shouldAddAttribute(name)) { - var attributeManager = this.env.attributeFor(element, name, isTrusting, namespace); - var nsAttribute = new DynamicAttribute(element, attributeManager, name, reference, namespace); - this.addAttribute(name, nsAttribute); - } - }; +/** + Returns the index of the given object's last occurrence. + If no `startAt` argument is given, the search starts from + the last position. If it's negative, will count backward + from the end of the array. Returns -1 if no match is found. + ```javascript + let arr = ['a', 'b', 'c', 'd', 'a']; + arr.lastIndexOf('a'); // 4 + arr.lastIndexOf('z'); // -1 + arr.lastIndexOf('a', 2); // 0 + arr.lastIndexOf('a', -1); // 4 + arr.lastIndexOf('b', 3); // 1 + arr.lastIndexOf('a', 100); // 4 + ``` + @method lastIndexOf + @param {Object} object the item to search for + @param {Number} startAt optional starting location to search, default 0 + @return {Number} index or -1 if not found + @public +*/ - ComponentElementOperations.prototype.flush = function flush(element, vm) { - var env = this.env; - var attributes = this.attributes; - var classList = this.classList; +// .......................................................... +// ARRAY OBSERVERS +// - for (var i = 0; attributes && i < attributes.length; i++) { - var opcode = attributes[i].flush(env); - if (opcode) { - vm.updateWith(opcode); - } - } - if (classList) { - var attributeManager = env.attributeFor(element, 'class', false); - var attribute = new DynamicAttribute(element, attributeManager, 'class', classList.toReference()); - var opcode = attribute.flush(env); - if (opcode) { - vm.updateWith(opcode); - } - } - }; +/** + Adds an array observer to the receiving array. The array observer object + normally must implement two methods: + * `arrayWillChange(observedObj, start, removeCount, addCount)` - This method will be + called just before the array is modified. + * `arrayDidChange(observedObj, start, removeCount, addCount)` - This method will be + called just after the array is modified. + Both callbacks will be passed the observed object, starting index of the + change as well as a count of the items to be removed and added. You can use + these callbacks to optionally inspect the array during the change, clear + caches, or do any other bookkeeping necessary. + In addition to passing a target, you can also include an options hash + which you can use to override the method names that will be invoked on the + target. + @method addArrayObserver + @param {Object} target The observer object. + @param {Object} opts Optional hash of configuration options including + `willChange` and `didChange` option. + @return {Ember.Array} receiver + @public +*/ - ComponentElementOperations.prototype.shouldAddAttribute = function shouldAddAttribute(name) { - return !this.attributeNames || this.attributeNames.indexOf(name) === -1; - }; +/** + Removes an array observer from the object if the observer is current + registered. Calling this method multiple times with the same object will + have no effect. + @method removeArrayObserver + @param {Object} target The object observing the array. + @param {Object} opts Optional hash of configuration options including + `willChange` and `didChange` option. + @return {Ember.Array} receiver + @public +*/ - ComponentElementOperations.prototype.addClass = function addClass(reference) { - var classList = this.classList; +/** + Becomes true whenever the array currently has observers watching changes + on the array. + @property {Boolean} hasArrayObservers + @public +*/ - if (!classList) { - classList = this.classList = new ClassList(); - } - classList.append(reference); - }; +/** + If you are implementing an object that supports `Ember.Array`, call this + method just before the array content changes to notify any observers and + invalidate any related properties. Pass the starting index of the change + as well as a delta of the amounts to change. + @method arrayContentWillChange + @param {Number} startIdx The starting index in the array that will change. + @param {Number} removeAmt The number of items that will be removed. If you + pass `null` assumes 0 + @param {Number} addAmt The number of items that will be added. If you + pass `null` assumes 0. + @return {Ember.Array} receiver + @public +*/ - ComponentElementOperations.prototype.addAttribute = function addAttribute(name, attribute) { - var attributeNames = this.attributeNames; - var attributes = this.attributes; +/** + If you are implementing an object that supports `Ember.Array`, call this + method just after the array content changes to notify any observers and + invalidate any related properties. Pass the starting index of the change + as well as a delta of the amounts to change. + @method arrayContentDidChange + @param {Number} startIdx The starting index in the array that did change. + @param {Number} removeAmt The number of items that were removed. If you + pass `null` assumes 0 + @param {Number} addAmt The number of items that were added. If you + pass `null` assumes 0. + @return {Ember.Array} receiver + @public +*/ - if (!attributeNames) { - attributeNames = this.attributeNames = []; - attributes = this.attributes = []; - } - attributeNames.push(name); - attributes.push(attribute); - }; +/** + 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 +*/ - return ComponentElementOperations; - })(); +/** + Returns a special object that can be used to observe individual properties + on the array. Just get an equivalent property on this object and it will + return an enumerable that maps automatically to the named key on the + member objects. + `@each` should only be used in a non-terminal context. Example: + ```javascript + myMethod: computed('posts.@each.author', function(){ + ... + }); + ``` + If you merely want to watch for the array being changed, like an object being + replaced, added or removed, use `[]` instead of `@each`. + ```javascript + myMethod: computed('posts.[]', function(){ + ... + }); + ``` + @property @each + @public +*/ +enifed('ember-runtime/mixins/comparable', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - exports.ComponentElementOperations = ComponentElementOperations; + /** + @module ember + @submodule ember-runtime + */ - var FlushElementOpcode = (function (_Opcode7) { - babelHelpers.inherits(FlushElementOpcode, _Opcode7); + /** + Implements some standard methods for comparing objects. Add this mixin to + any class you create that can compare its instances. + + You should implement the `compare()` method. + + @class Comparable + @namespace Ember + @since Ember 0.9 + @private + */ + exports.default = _emberMetal.Mixin.create({ - function FlushElementOpcode() { - _Opcode7.apply(this, arguments); - this.type = "flush-element"; - } + /** + __Required.__ You must implement this method to apply this mixin. + Override to return the result of the comparison of the two parameters. The + compare method should return: + - `-1` if `a < b` + - `0` if `a == b` + - `1` if `a > b` + Default implementation raises an exception. + @method compare + @param a {Object} the first object to compare + @param b {Object} the second object to compare + @return {Number} the result of the comparison + @private + */ + compare: null + }); +}); +enifed('ember-runtime/mixins/container_proxy', ['exports', 'ember-metal', 'container'], function (exports, _emberMetal, _container) { + /** + @module ember + @submodule ember-runtime + */ + 'use strict'; - FlushElementOpcode.prototype.evaluate = function evaluate(vm) { - var stack = vm.stack(); - stack.operations.flush(stack.constructing, vm); - stack.flushElement(); - }; + var _containerProxyMixin; - return FlushElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + ContainerProxyMixin is used to provide public access to specific + container functionality. + + @class ContainerProxyMixin + @private + */ + var containerProxyMixin = (_containerProxyMixin = { + /** + The container stores state. + @private + @property {Ember.Container} __container__ + */ + __container__: null, - exports.FlushElementOpcode = FlushElementOpcode; + /** + Returns an object that can be used to provide an owner to a + manually created instance. + Example: + ``` + let owner = Ember.getOwner(this); + User.create( + owner.ownerInjection(), + { username: 'rwjblue' } + ) + ``` + @public + @method ownerInjection + @since 2.3.0 + @return {Object} + */ + ownerInjection: function () { + return this.__container__.ownerInjection(); + }, - var CloseElementOpcode = (function (_Opcode8) { - babelHelpers.inherits(CloseElementOpcode, _Opcode8); + /** + Given a fullName return a corresponding instance. + The default behaviour is for lookup to return a singleton instance. + The singleton is scoped to the container, allowing multiple containers + to all have their own locally scoped singletons. + ```javascript + let registry = new Registry(); + let container = registry.container(); + registry.register('api:twitter', Twitter); + let twitter = container.lookup('api:twitter'); + twitter instanceof Twitter; // => true + // by default the container will return singletons + let twitter2 = container.lookup('api:twitter'); + twitter2 instanceof Twitter; // => true + twitter === twitter2; //=> true + ``` + If singletons are not wanted an optional flag can be provided at lookup. + ```javascript + let registry = new Registry(); + let container = registry.container(); + registry.register('api:twitter', Twitter); + let twitter = container.lookup('api:twitter', { singleton: false }); + let twitter2 = container.lookup('api:twitter', { singleton: false }); + twitter === twitter2; //=> false + ``` + @public + @method lookup + @param {String} fullName + @param {Object} options + @return {any} + */ + lookup: function (fullName, options) { + return this.__container__.lookup(fullName, options); + }, - function CloseElementOpcode() { - _Opcode8.apply(this, arguments); - this.type = "close-element"; - } + /** + Given a fullName return the corresponding factory. + @private + @method _lookupFactory + @param {String} fullName + @return {any} + */ + _lookupFactory: function (fullName, options) { + return this.__container__.lookupFactory(fullName, options); + } - CloseElementOpcode.prototype.evaluate = function evaluate(vm) { - vm.stack().closeElement(); - }; + }, _containerProxyMixin[_container.FACTORY_FOR] = function () { + var _container__; - return CloseElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return (_container__ = this.__container__)[_container.FACTORY_FOR].apply(_container__, arguments); + }, _containerProxyMixin[_container.LOOKUP_FACTORY] = function () { + var _container__2; - exports.CloseElementOpcode = CloseElementOpcode; + return (_container__2 = this.__container__)[_container.LOOKUP_FACTORY].apply(_container__2, arguments); + }, _containerProxyMixin._resolveLocalLookupName = function (name, source) { + return this.__container__.registry.expandLocalLookup('component:' + name, { + source: source + }); + }, _containerProxyMixin.willDestroy = function () { + this._super.apply(this, arguments); - var PopElementOpcode = (function (_Opcode9) { - babelHelpers.inherits(PopElementOpcode, _Opcode9); + if (this.__container__) { + _emberMetal.run(this.__container__, 'destroy'); + } + }, _containerProxyMixin); - function PopElementOpcode() { - _Opcode9.apply(this, arguments); - this.type = "pop-element"; - } + if (true) { + containerProxyMixin.factoryFor = function ContainerProxyMixin_factoryFor(fullName) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - PopElementOpcode.prototype.evaluate = function evaluate(vm) { - vm.stack().popElement(); - }; + return this.__container__.factoryFor(fullName, options); + }; + } - return PopElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + exports.default = _emberMetal.Mixin.create(containerProxyMixin); +}); - exports.PopElementOpcode = PopElementOpcode; +/** + Given a name and a source path, resolve the fullName + @private + @method _resolveLocalLookupName + @param {String} fullName + @param {String} source + @return {String} + */ - var StaticAttrOpcode = (function (_Opcode10) { - babelHelpers.inherits(StaticAttrOpcode, _Opcode10); +/** + @private + */ +enifed('ember-runtime/mixins/controller', ['exports', 'ember-metal', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/controller_content_model_alias_deprecation'], function (exports, _emberMetal, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsController_content_model_alias_deprecation) { + 'use strict'; - function StaticAttrOpcode(namespace, name, value) { - _Opcode10.call(this); - this.namespace = namespace; - this.name = name; - this.value = value; - this.type = "static-attr"; - } + /** + @class ControllerMixin + @namespace Ember + @uses Ember.ActionHandler + @private + */ + exports.default = _emberMetal.Mixin.create(_emberRuntimeMixinsAction_handler.default, _emberRuntimeMixinsController_content_model_alias_deprecation.default, { + /* ducktype as a controller */ + isController: true, - StaticAttrOpcode.prototype.evaluate = function evaluate(vm) { - var name = this.name; - var value = this.value; - var namespace = this.namespace; + /** + The object to which actions from the view should be sent. + For example, when a Handlebars template uses the `{{action}}` helper, + it will attempt to send the action to the view's controller's `target`. + By default, the value of the target property is set to the router, and + is injected when a controller is instantiated. This injection is applied + as part of the application's initialization process. In most cases the + `target` property will automatically be set to the logical consumer of + actions for the controller. + @property target + @default null + @public + */ + target: null, - if (namespace) { - vm.stack().setStaticAttributeNS(namespace, name, value); - } else { - vm.stack().setStaticAttribute(name, value); - } - }; + store: null, - StaticAttrOpcode.prototype.toJSON = function toJSON() { - var guid = this._guid; - var type = this.type; - var namespace = this.namespace; - var name = this.name; - var value = this.value; + /** + The controller's current model. When retrieving or modifying a controller's + model, this property should be used instead of the `content` property. + @property model + @public + */ + model: null, - var details = _glimmerUtil.dict(); - if (namespace) { - details["namespace"] = JSON.stringify(namespace); - } - details["name"] = JSON.stringify(name); - details["value"] = JSON.stringify(value); - return { guid: guid, type: type, details: details }; - }; + /** + @private + */ + content: _emberMetal.alias('model') - return StaticAttrOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + }); +}); +enifed('ember-runtime/mixins/controller_content_model_alias_deprecation', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - exports.StaticAttrOpcode = StaticAttrOpcode; + /* + The ControllerContentModelAliasDeprecation mixin is used to provide a useful + deprecation warning when specifying `content` directly on a `Ember.Controller` + (without also specifying `model`). + + Ember versions prior to 1.7 used `model` as an alias of `content`, but due to + much confusion this alias was reversed (so `content` is now an alias of `model). + + This change reduces many caveats with model/content, and also sets a + simple ground rule: Never set a controllers content, rather always set + its model and ember will do the right thing. + + Used internally by Ember in `Ember.Controller`. + */ + exports.default = _emberMetal.Mixin.create({ + /** + @private + Moves `content` to `model` at extend time if a `model` 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) { + // Calling super is only OK here since we KNOW that + // there is another Mixin loaded first. + this._super.apply(this, arguments); - var ModifierOpcode = (function (_Opcode11) { - babelHelpers.inherits(ModifierOpcode, _Opcode11); + var modelSpecified = !!props.model; - function ModifierOpcode(name, manager, args) { - _Opcode11.call(this); - this.name = name; - this.manager = manager; - this.args = args; - this.type = "modifier"; - } + if (props.content && !modelSpecified) { + props.model = props.content; + delete props['content']; - ModifierOpcode.prototype.evaluate = function evaluate(vm) { - var manager = this.manager; + _emberMetal.deprecate('Do not specify `content` on a Controller, use `model` instead.', false, { id: 'ember-runtime.will-merge-mixin', until: '3.0.0' }); + } + } + }); +}); +enifed('ember-runtime/mixins/copyable', ['exports', 'ember-metal', 'ember-runtime/mixins/freezable'], function (exports, _emberMetal, _emberRuntimeMixinsFreezable) { + /** + @module ember + @submodule ember-runtime + */ - var stack = vm.stack(); - var element = stack.constructing; - var updateOperations = stack.updateOperations; + 'use strict'; - var args = this.args.evaluate(vm); - var dynamicScope = vm.dynamicScope(); - var modifier = manager.create(element, args, dynamicScope, updateOperations); - vm.env.scheduleInstallModifier(modifier, manager); - var destructor = manager.getDestructor(modifier); - if (destructor) { - vm.newDestroyable(destructor); - } - vm.updateWith(new UpdateModifierOpcode(manager, modifier, args)); - }; + /** + 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. + + You should generally implement the `copy()` method to return a copy of the + receiver. + + Note that `frozenCopy()` will only work if you also implement + `Ember.Freezable`. + + @class Copyable + @namespace Ember + @since Ember 0.9 + @private + */ + exports.default = _emberMetal.Mixin.create({ + /** + __Required.__ You must implement this method to apply this mixin. + Override to return a copy of the receiver. Default implementation raises + an exception. + @method copy + @param {Boolean} deep if `true`, a deep copy of the object should be made + @return {Object} copy of receiver + @private + */ + copy: null, - ModifierOpcode.prototype.toJSON = function toJSON() { - var guid = this._guid; - var type = this.type; - var name = this.name; - var args = this.args; - - var details = _glimmerUtil.dict(); - details["type"] = JSON.stringify(type); - details["name"] = JSON.stringify(name); - details["args"] = JSON.stringify(args); - return { guid: guid, type: type, details: details }; - }; + /** + If the object implements `Ember.Freezable`, then this will return a new + copy if the object is not frozen and the receiver if the object is frozen. + Raises an exception if you try to call this method on a object that does + not support freezing. + You should use this method whenever you want a copy of a freezable object + since a freezable object can simply return itself without actually + consuming more memory. + @method frozenCopy + @return {Object} copy of receiver or receiver + @deprecated Use `Object.freeze` instead. + @private + */ + frozenCopy: function () { + _emberMetal.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 _emberMetal.get(this, 'isFrozen') ? this : this.copy().freeze(); + } else { + throw new _emberMetal.Error(this + ' does not support freezing'); + } + } + }); +}); +enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/compare', 'require'], function (exports, _emberUtils, _emberMetal, _emberRuntimeCompare, _require) { + /** + @module ember + @submodule ember-runtime + */ - return ModifierOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + // .......................................................... + // HELPERS + // - exports.ModifierOpcode = ModifierOpcode; + 'use strict'; - var UpdateModifierOpcode = (function (_UpdatingOpcode) { - babelHelpers.inherits(UpdateModifierOpcode, _UpdatingOpcode); + var _emberA = undefined; - function UpdateModifierOpcode(manager, modifier, args) { - _UpdatingOpcode.call(this); - this.manager = manager; - this.modifier = modifier; - this.args = args; - this.type = "update-modifier"; - this.tag = args.tag; - this.lastUpdated = args.tag.value(); - } + function emberA() { + return (_emberA || (_emberA = _require.default('ember-runtime/system/native_array').A))(); + } - UpdateModifierOpcode.prototype.evaluate = function evaluate(vm) { - var manager = this.manager; - var modifier = this.modifier; - var tag = this.tag; - var lastUpdated = this.lastUpdated; + var contexts = []; - if (!tag.validate(lastUpdated)) { - vm.env.scheduleUpdateModifier(modifier, manager); - this.lastUpdated = tag.value(); - } - }; + function popCtx() { + return contexts.length === 0 ? {} : contexts.pop(); + } - UpdateModifierOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.args)] - }; - }; + function pushCtx(ctx) { + contexts.push(ctx); + return null; + } - return UpdateModifierOpcode; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + function iter(key, value) { + var valueProvided = arguments.length === 2; - exports.UpdateModifierOpcode = UpdateModifierOpcode; + function i(item) { + var cur = _emberMetal.get(item, key); + return valueProvided ? value === cur : !!cur; + } - var StaticAttribute = (function () { - function StaticAttribute(element, name, value, namespace) { - this.element = element; - this.name = name; - this.value = value; - this.namespace = namespace; - } + return i; + } - StaticAttribute.prototype.flush = function flush(env) { - env.getAppendOperations().setAttribute(this.element, this.name, this.value, this.namespace); - return null; - }; + /** + This mixin defines the common interface implemented by enumerable objects + in Ember. Most of these methods follow the standard Array iteration + API defined up to JavaScript 1.8 (excluding language-specific features that + cannot be emulated in older versions of JavaScript). + + This mixin is applied automatically to the Array class on page load, so you + can use any of these methods on simple arrays. If Array already implements + one of these methods, the mixin will not override them. + + ## Writing Your Own Enumerable + + To make your own custom class enumerable, you need two items: + + 1. You must have a length property. This property should change whenever + the number of items in your enumerable object changes. If you use this + with an `Ember.Object` subclass, you should be sure to change the length + property using `set().` + + 2. You must implement `nextObject().` See documentation. + + Once you have these two methods implemented, apply the `Ember.Enumerable` mixin + to your class and you will be able to enumerate the contents of your object + like any other collection. + + ## Using Ember Enumeration with Other Libraries + + Many other libraries provide some kind of iterator or enumeration like + facility. This is often where the most common API conflicts occur. + Ember's API is designed to be as friendly as possible with other + libraries by implementing only methods that mostly correspond to the + JavaScript 1.8 API. + + @class Enumerable + @namespace Ember + @since Ember 0.9 + @private + */ + var Enumerable = _emberMetal.Mixin.create({ - return StaticAttribute; - })(); + /** + __Required.__ You must implement this method to apply this mixin. + Implement this method to make your class enumerable. + This method will be called repeatedly during enumeration. The index value + will always begin with 0 and increment monotonically. You don't have to + rely on the index value to determine what object to return, but you should + always check the value and start from the beginning when you see the + requested index is 0. + The `previousObject` is the object that was returned from the last call + to `nextObject` for the current iteration. This is a useful way to + manage iteration if you are tracing a linked list, for example. + Finally the context parameter will always contain a hash you can use as + a "scratchpad" to maintain any other state you need in order to iterate + properly. The context object is reused and is not reset between + iterations so make sure you setup the context with a fresh state whenever + the index parameter is 0. + Generally iterators will continue to call `nextObject` until the index + reaches the current length-1. If you run out of data before this + time for some reason, you should simply return undefined. + The default implementation of this method simply looks up the index. + This works great on any Array-like objects. + @method nextObject + @param {Number} index the current index of the iteration + @param {Object} previousObject the value returned by the last call to + `nextObject`. + @param {Object} context a context object you can use to maintain state. + @return {Object} the next object in the iteration or undefined + @private + */ + nextObject: null, - exports.StaticAttribute = StaticAttribute; + /** + Helper method returns the first object from a collection. This is usually + used by bindings and other parts of the framework to extract a single + object if the enumerable contains only one item. + If you override this method, you should implement it so that it will + always return the same value each time it is called. If your enumerable + contains only one object, this method should always return that object. + If your enumerable is empty, this method should return `undefined`. + ```javascript + let arr = ['a', 'b', 'c']; + arr.get('firstObject'); // 'a' + let arr = []; + arr.get('firstObject'); // undefined + ``` + @property firstObject + @return {Object} the object or undefined + @readOnly + @public + */ + firstObject: _emberMetal.computed('[]', function () { + if (_emberMetal.get(this, 'length') === 0) { + return undefined; + } - var DynamicAttribute = (function () { - function DynamicAttribute(element, attributeManager, name, reference, namespace) { - this.element = element; - this.attributeManager = attributeManager; - this.name = name; - this.reference = reference; - this.namespace = namespace; - this.tag = reference.tag; - this.cache = null; - } + // handle generic enumerables + var context = popCtx(); + var ret = this.nextObject(0, null, context); - DynamicAttribute.prototype.patch = function patch(env) { - var element = this.element; - var cache = this.cache; + pushCtx(context); - var value = cache.revalidate(); - if (_glimmerReference.isModified(value)) { - this.attributeManager.updateAttribute(env, element, value, this.namespace); - } - }; + return ret; + }).readOnly(), - DynamicAttribute.prototype.flush = function flush(env) { - var reference = this.reference; - var element = this.element; + /** + Helper method returns the last object from a collection. If your enumerable + contains only one object, this method should always return that object. + If your enumerable is empty, this method should return `undefined`. + ```javascript + let arr = ['a', 'b', 'c']; + arr.get('lastObject'); // 'c' + let arr = []; + arr.get('lastObject'); // undefined + ``` + @property lastObject + @return {Object} the last object or undefined + @readOnly + @public + */ + lastObject: _emberMetal.computed('[]', function () { + var len = _emberMetal.get(this, 'length'); - if (_glimmerReference.isConst(reference)) { - var value = reference.value(); - this.attributeManager.setAttribute(env, element, value, this.namespace); - return null; - } else { - var cache = this.cache = new _glimmerReference.ReferenceCache(reference); - var value = cache.peek(); - this.attributeManager.setAttribute(env, element, value, this.namespace); - return new PatchElementOpcode(this); - } - }; + if (len === 0) { + return undefined; + } - DynamicAttribute.prototype.toJSON = function toJSON() { - var element = this.element; - var namespace = this.namespace; - var name = this.name; - var cache = this.cache; - - var formattedElement = formatElement(element); - var lastValue = cache.peek(); - if (namespace) { - return { - element: formattedElement, - type: 'attribute', - namespace: namespace, - name: name, - lastValue: lastValue - }; - } - return { - element: formattedElement, - type: 'attribute', - namespace: namespace, - name: name, - lastValue: lastValue - }; - }; + var context = popCtx(); + var idx = 0; + var last = null; + var cur = undefined; - return DynamicAttribute; - })(); + do { + last = cur; + cur = this.nextObject(idx++, last, context); + } while (cur !== undefined); - exports.DynamicAttribute = DynamicAttribute; + pushCtx(context); - function formatElement(element) { - return JSON.stringify('<' + element.tagName.toLowerCase() + ' />'); - } + return last; + }).readOnly(), - var DynamicAttrNSOpcode = (function (_Opcode12) { - babelHelpers.inherits(DynamicAttrNSOpcode, _Opcode12); + /** + Returns `true` if the passed object can be found in the receiver. The + default version will iterate through the enumerable until the object + is found. You may want to override this with a more efficient version. + ```javascript + let arr = ['a', 'b', 'c']; + arr.contains('a'); // true + arr.contains('z'); // false + ``` + @method contains + @deprecated Use `Enumerable#includes` instead. See http://emberjs.com/deprecations/v2.x#toc_enumerable-contains + @param {Object} obj The object to search for. + @return {Boolean} `true` if object is found in enumerable. + @public + */ + contains: function (obj) { + _emberMetal.deprecate('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.', false, { id: 'ember-runtime.enumerable-contains', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_enumerable-contains' }); - function DynamicAttrNSOpcode(name, namespace, isTrusting) { - _Opcode12.call(this); - this.name = name; - this.namespace = namespace; - this.isTrusting = isTrusting; - this.type = "dynamic-attr"; - } + var found = this.find(function (item) { + return item === obj; + }); - DynamicAttrNSOpcode.prototype.evaluate = function evaluate(vm) { - var name = this.name; - var namespace = this.namespace; - var isTrusting = this.isTrusting; + return found !== undefined; + }, - var reference = vm.frame.getOperand(); - vm.stack().setDynamicAttributeNS(namespace, name, reference, isTrusting); - }; + /** + Iterates through the enumerable, calling the passed function on each + item. This method corresponds to the `forEach()` method defined in + JavaScript 1.6. + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(item, index, enumerable); + ``` + - `item` is the current item in the iteration. + - `index` is the current index in the iteration. + - `enumerable` is the enumerable object itself. + Note that in addition to a callback, you can also pass an optional target + object that will be set as `this` on the context. This is a good way + 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 + @public + */ + forEach: function (callback, target) { + if (typeof callback !== 'function') { + throw new TypeError(); + } - DynamicAttrNSOpcode.prototype.toJSON = function toJSON() { - var guid = this._guid; - var type = this.type; - var name = this.name; - var namespace = this.namespace; - - var details = _glimmerUtil.dict(); - details["name"] = JSON.stringify(name); - details["value"] = "$OPERAND"; - if (namespace) { - details["namespace"] = JSON.stringify(namespace); - } - return { guid: guid, type: type, details: details }; - }; + var context = popCtx(); + var len = _emberMetal.get(this, 'length'); + var last = null; - return DynamicAttrNSOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + if (target === undefined) { + target = null; + } - exports.DynamicAttrNSOpcode = DynamicAttrNSOpcode; + for (var idx = 0; idx < len; idx++) { + var next = this.nextObject(idx, last, context); + callback.call(target, next, idx, this); + last = next; + } - var DynamicAttrOpcode = (function (_Opcode13) { - babelHelpers.inherits(DynamicAttrOpcode, _Opcode13); + last = null; + context = pushCtx(context); - function DynamicAttrOpcode(name, isTrusting) { - _Opcode13.call(this); - this.name = name; - this.isTrusting = isTrusting; - this.type = "dynamic-attr"; - } + return this; + }, - DynamicAttrOpcode.prototype.evaluate = function evaluate(vm) { - var name = this.name; - var isTrusting = this.isTrusting; + /** + Alias for `mapBy` + @method getEach + @param {String} key name of the property + @return {Array} The mapped array. + @public + */ + getEach: _emberMetal.aliasMethod('mapBy'), - var reference = vm.frame.getOperand(); - vm.stack().setDynamicAttribute(name, reference, isTrusting); - }; + /** + Sets the value on the named property for each member. This is more + ergonomic than using other methods defined on this helper. If the object + implements Ember.Observable, the value will be changed to `set(),` otherwise + it will be set directly. `null` objects are skipped. + @method setEach + @param {String} key The key to set + @param {Object} value The object to set + @return {Object} receiver + @public + */ + setEach: function (key, value) { + return this.forEach(function (item) { + return _emberMetal.set(item, key, value); + }); + }, - DynamicAttrOpcode.prototype.toJSON = function toJSON() { - var guid = this._guid; - var type = this.type; - var name = this.name; + /** + Maps all of the items in the enumeration to another value, returning + a new array. This method corresponds to `map()` defined in JavaScript 1.6. + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(item, index, enumerable); + ``` + - `item` is the current item in the iteration. + - `index` is the current index in the iteration. + - `enumerable` is the enumerable object itself. + It should return the mapped value. + Note that in addition to a callback, you can also pass an optional target + object that will be set as `this` on the context. This is a good way + to give your iterator function access to the current object. + @method map + @param {Function} callback The callback to execute + @param {Object} [target] The target object to use + @return {Array} The mapped array. + @public + */ + map: function (callback, target) { + var ret = emberA(); - var details = _glimmerUtil.dict(); - details["name"] = JSON.stringify(name); - details["value"] = "$OPERAND"; - return { guid: guid, type: type, details: details }; - }; + this.forEach(function (x, idx, i) { + return ret[idx] = callback.call(target, x, idx, i); + }); - return DynamicAttrOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return ret; + }, - exports.DynamicAttrOpcode = DynamicAttrOpcode; + /** + Similar to map, this specialized function returns the value of the named + property on all items in the enumeration. + @method mapBy + @param {String} key name of the property + @return {Array} The mapped array. + @public + */ + mapBy: function (key) { + return this.map(function (next) { + return _emberMetal.get(next, key); + }); + }, - var PatchElementOpcode = (function (_UpdatingOpcode2) { - babelHelpers.inherits(PatchElementOpcode, _UpdatingOpcode2); + /** + Returns an array with all of the items in the enumeration that the passed + function returns true for. This method corresponds to `filter()` defined in + JavaScript 1.6. + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(item, index, enumerable); + ``` + - `item` is the current item in the iteration. + - `index` is the current index in the iteration. + - `enumerable` is the enumerable object itself. + It should return `true` to include the item in the results, `false` + otherwise. + Note that in addition to a callback, you can also pass an optional target + object that will be set as `this` on the context. This is a good way + to give your iterator function access to the current object. + @method filter + @param {Function} callback The callback to execute + @param {Object} [target] The target object to use + @return {Array} A filtered array. + @public + */ + filter: function (callback, target) { + var ret = emberA(); - function PatchElementOpcode(operation) { - _UpdatingOpcode2.call(this); - this.type = "patch-element"; - this.tag = operation.tag; - this.operation = operation; + this.forEach(function (x, idx, i) { + if (callback.call(target, x, idx, i)) { + ret.push(x); } + }); - PatchElementOpcode.prototype.evaluate = function evaluate(vm) { - this.operation.patch(vm.env); - }; - - PatchElementOpcode.prototype.toJSON = function toJSON() { - var _guid = this._guid; - var type = this.type; - var operation = this.operation; - - return { - guid: _guid, - type: type, - details: operation.toJSON() - }; - }; - - return PatchElementOpcode; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + return ret; + }, - exports.PatchElementOpcode = PatchElementOpcode; + /** + Returns an array with all of the items in the enumeration where the passed + function returns false. This method is the inverse of filter(). + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(item, index, enumerable); + ``` + - *item* is the current item in the iteration. + - *index* is the current index in the iteration + - *enumerable* is the enumerable object itself. + It should return a falsey value to include the item in the results. + Note that in addition to a callback, you can also pass an optional target + object that will be set as "this" on the context. This is a good way + to give your iterator function access to the current object. + @method reject + @param {Function} callback The callback to execute + @param {Object} [target] The target object to use + @return {Array} A rejected array. + @public + */ + reject: function (callback, target) { + return this.filter(function () { + return !callback.apply(target, arguments); + }); + }, - var CommentOpcode = (function (_Opcode14) { - babelHelpers.inherits(CommentOpcode, _Opcode14); + /** + Returns an array with just the items with the matched property. You + can pass an optional second argument with the target value. Otherwise + this will match any property that evaluates to `true`. + @method filterBy + @param {String} key the property to test + @param {*} [value] optional value to test against. + @return {Array} filtered array + @public + */ + filterBy: function (key, value) { + return this.filter(iter.apply(this, arguments)); + }, - function CommentOpcode(comment) { - _Opcode14.call(this); - this.comment = comment; - this.type = "comment"; - } + /** + Returns an array with the items that do not have truthy values for + key. You can pass an optional second argument with the target value. Otherwise + this will match any property that evaluates to false. + @method rejectBy + @param {String} key the property to test + @param {String} [value] optional value to test against. + @return {Array} rejected array + @public + */ + rejectBy: function (key, value) { + var exactValue = function (item) { + return _emberMetal.get(item, key) === value; + }; + var hasValue = function (item) { + return !!_emberMetal.get(item, key); + }; + var use = arguments.length === 2 ? exactValue : hasValue; - CommentOpcode.prototype.evaluate = function evaluate(vm) { - vm.stack().appendComment(this.comment); - }; + return this.reject(use); + }, - CommentOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.comment)] - }; - }; + /** + Returns the first item in the array for which the callback returns true. + This method works similar to the `filter()` method defined in JavaScript 1.6 + except that it will stop working on the array once a match is found. + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(item, index, enumerable); + ``` + - `item` is the current item in the iteration. + - `index` is the current index in the iteration. + - `enumerable` is the enumerable object itself. + It should return the `true` to include the item in the results, `false` + otherwise. + Note that in addition to a callback, you can also pass an optional target + object that will be set as `this` on the context. This is a good way + to give your iterator function access to the current object. + @method find + @param {Function} callback The callback to execute + @param {Object} [target] The target object to use + @return {Object} Found item or `undefined`. + @public + */ + find: function (callback, target) { + var len = _emberMetal.get(this, 'length'); - return CommentOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + if (target === undefined) { + target = null; + } - exports.CommentOpcode = CommentOpcode; -}); + var context = popCtx(); + var found = false; + var last = null; + var next = undefined, + ret = undefined; -enifed('glimmer-runtime/lib/compiled/opcodes/lists', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-util', 'glimmer-reference'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerUtil, _glimmerReference) { - 'use strict'; + for (var idx = 0; idx < len && !found; idx++) { + next = this.nextObject(idx, last, context); - var IterablePresenceReference = (function () { - function IterablePresenceReference(artifacts) { - this.tag = artifacts.tag; - this.artifacts = artifacts; + found = callback.call(target, next, idx, this); + if (found) { + ret = next; } - IterablePresenceReference.prototype.value = function value() { - return !this.artifacts.isEmpty(); - }; - - return IterablePresenceReference; - })(); - - var PutIteratorOpcode = (function (_Opcode) { - babelHelpers.inherits(PutIteratorOpcode, _Opcode); + last = next; + } - function PutIteratorOpcode() { - _Opcode.apply(this, arguments); - this.type = "put-iterator"; - } + next = last = null; + context = pushCtx(context); - PutIteratorOpcode.prototype.evaluate = function evaluate(vm) { - var listRef = vm.frame.getOperand(); - var args = vm.frame.getArgs(); - var iterable = vm.env.iterableFor(listRef, args); - var iterator = new _glimmerReference.ReferenceIterator(iterable); - vm.frame.setIterator(iterator); - vm.frame.setCondition(new IterablePresenceReference(iterator.artifacts)); - }; + return ret; + }, - return PutIteratorOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + Returns the first item with a property matching the passed value. You + can pass an optional second argument with the target value. Otherwise + this will match any property that evaluates to `true`. + This method works much like the more generic `find()` method. + @method findBy + @param {String} key the property to test + @param {String} [value] optional value to test against. + @return {Object} found item or `undefined` + @public + */ + findBy: function (key, value) { + return this.find(iter.apply(this, arguments)); + }, - exports.PutIteratorOpcode = PutIteratorOpcode; + /** + Returns `true` if the passed function returns true for every item in the + enumeration. This corresponds with the `every()` method in JavaScript 1.6. + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(item, index, enumerable); + ``` + - `item` is the current item in the iteration. + - `index` is the current index in the iteration. + - `enumerable` is the enumerable object itself. + It should return the `true` or `false`. + Note that in addition to a callback, you can also pass an optional target + object that will be set as `this` on the context. This is a good way + to give your iterator function access to the current object. + Example Usage: + ```javascript + if (people.every(isEngineer)) { + Paychecks.addBigBonus(); + } + ``` + @method every + @param {Function} callback The callback to execute + @param {Object} [target] The target object to use + @return {Boolean} + @public + */ + every: function (callback, target) { + return !this.find(function (x, idx, i) { + return !callback.call(target, x, idx, i); + }); + }, - var EnterListOpcode = (function (_Opcode2) { - babelHelpers.inherits(EnterListOpcode, _Opcode2); + /** + Returns `true` if the passed property resolves to the value of the second + argument for all items in the enumerable. This method is often simpler/faster + than using a callback. + @method isEvery + @param {String} key the property to test + @param {String} [value] optional value to test against. Defaults to `true` + @return {Boolean} + @since 1.3.0 + @public + */ + isEvery: function (key, value) { + return this.every(iter.apply(this, arguments)); + }, - function EnterListOpcode(start, end) { - _Opcode2.call(this); - this.type = "enter-list"; - this.slice = new _glimmerUtil.ListSlice(start, end); - } + /** + Returns `true` if the passed function returns true for any item in the + enumeration. This corresponds with the `some()` method in JavaScript 1.6. + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(item, index, enumerable); + ``` + - `item` is the current item in the iteration. + - `index` is the current index in the iteration. + - `enumerable` is the enumerable object itself. + It should return the `true` to include the item in the results, `false` + otherwise. + Note that in addition to a callback, you can also pass an optional target + object that will be set as `this` on the context. This is a good way + to give your iterator function access to the current object. + Usage Example: + ```javascript + if (people.any(isManager)) { + Paychecks.addBiggerBonus(); + } + ``` + @method any + @param {Function} callback The callback to execute + @param {Object} [target] The target object to use + @return {Boolean} `true` if the passed function returns `true` for any item + @public + */ + any: function (callback, target) { + var len = _emberMetal.get(this, 'length'); + var context = popCtx(); + var found = false; + var last = null; + var next = undefined; - EnterListOpcode.prototype.evaluate = function evaluate(vm) { - vm.enterList(this.slice); - }; + if (target === undefined) { + target = null; + } - EnterListOpcode.prototype.toJSON = function toJSON() { - var slice = this.slice; - var type = this.type; - var _guid = this._guid; + for (var idx = 0; idx < len && !found; idx++) { + next = this.nextObject(idx, last, context); + found = callback.call(target, next, idx, this); + last = next; + } - var begin = slice.head(); - var end = slice.tail(); - return { - guid: _guid, - type: type, - args: [JSON.stringify(begin.inspect()), JSON.stringify(end.inspect())] - }; - }; + next = last = null; + context = pushCtx(context); + return found; + }, - return EnterListOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + Returns `true` if the passed property resolves to the value of the second + argument for any item in the enumerable. This method is often simpler/faster + than using a callback. + @method isAny + @param {String} key the property to test + @param {String} [value] optional value to test against. Defaults to `true` + @return {Boolean} + @since 1.3.0 + @public + */ + isAny: function (key, value) { + return this.any(iter.apply(this, arguments)); + }, - exports.EnterListOpcode = EnterListOpcode; + /** + This will combine the values of the enumerator into a single value. It + is a useful way to collect a summary value from an enumeration. This + corresponds to the `reduce()` method defined in JavaScript 1.8. + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(previousValue, item, index, enumerable); + ``` + - `previousValue` is the value returned by the last call to the iterator. + - `item` is the current item in the iteration. + - `index` is the current index in the iteration. + - `enumerable` is the enumerable object itself. + Return the new cumulative value. + In addition to the callback you can also pass an `initialValue`. An error + will be raised if you do not pass an initial value and the enumerator is + empty. + Note that unlike the other methods, this method does not allow you to + pass a target object to set as this for the callback. It's part of the + spec. Sorry. + @method reduce + @param {Function} callback The callback to execute + @param {Object} initialValue Initial value for the reduce + @param {String} reducerProperty internal use only. + @return {Object} The reduced value. + @public + */ + reduce: function (callback, initialValue, reducerProperty) { + if (typeof callback !== 'function') { + throw new TypeError(); + } - var ExitListOpcode = (function (_Opcode3) { - babelHelpers.inherits(ExitListOpcode, _Opcode3); + var ret = initialValue; - function ExitListOpcode() { - _Opcode3.apply(this, arguments); - this.type = "exit-list"; - } + this.forEach(function (item, i) { + ret = callback(ret, item, i, this, reducerProperty); + }, this); - ExitListOpcode.prototype.evaluate = function evaluate(vm) { - vm.exitList(); - }; + return ret; + }, - return ExitListOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + Invokes the named method on every object in the receiver that + implements it. This method corresponds to the implementation in + Prototype 1.6. + @method invoke + @param {String} methodName the name of the method + @param {Object...} args optional arguments to pass as well. + @return {Array} return values from calling invoke. + @public + */ + invoke: function (methodName) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } - exports.ExitListOpcode = ExitListOpcode; + var ret = emberA(); - var EnterWithKeyOpcode = (function (_Opcode4) { - babelHelpers.inherits(EnterWithKeyOpcode, _Opcode4); + this.forEach(function (x, idx) { + var method = x && x[methodName]; - function EnterWithKeyOpcode(start, end) { - _Opcode4.call(this); - this.type = "enter-with-key"; - this.slice = new _glimmerUtil.ListSlice(start, end); + if ('function' === typeof method) { + ret[idx] = args ? method.apply(x, args) : x[methodName](); } + }, this); - EnterWithKeyOpcode.prototype.evaluate = function evaluate(vm) { - vm.enterWithKey(vm.frame.getKey(), this.slice); - }; + return ret; + }, - EnterWithKeyOpcode.prototype.toJSON = function toJSON() { - var slice = this.slice; - var _guid = this._guid; - var type = this.type; + /** + Simply converts the enumerable into a genuine array. The order is not + guaranteed. Corresponds to the method implemented by Prototype. + @method toArray + @return {Array} the enumerable as an array. + @public + */ + toArray: function () { + var ret = emberA(); - var begin = slice.head(); - var end = slice.tail(); - return { - guid: _guid, - type: type, - args: [JSON.stringify(begin.inspect()), JSON.stringify(end.inspect())] - }; - }; + this.forEach(function (o, idx) { + return ret[idx] = o; + }); - return EnterWithKeyOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return ret; + }, - exports.EnterWithKeyOpcode = EnterWithKeyOpcode; + /** + Returns a copy of the array with all `null` and `undefined` elements removed. + ```javascript + let arr = ['a', null, 'c', undefined]; + arr.compact(); // ['a', 'c'] + ``` + @method compact + @return {Array} the array without null and undefined elements. + @public + */ + compact: function () { + return this.filter(function (value) { + return value != null; + }); + }, - var TRUE_REF = new _glimmerReference.ConstReference(true); - var FALSE_REF = new _glimmerReference.ConstReference(false); + /** + Returns a new enumerable that excludes the passed value. The default + implementation returns an array regardless of the receiver type. + If the receiver does not contain the value it returns the original enumerable. + ```javascript + let arr = ['a', 'b', 'a', 'c']; + arr.without('a'); // ['b', 'c'] + ``` + @method without + @param {Object} value + @return {Ember.Enumerable} + @public + */ + without: function (value) { + if (!this.includes(value)) { + return this; // nothing to do + } - var NextIterOpcode = (function (_Opcode5) { - babelHelpers.inherits(NextIterOpcode, _Opcode5); + var ret = emberA(); - function NextIterOpcode(end) { - _Opcode5.call(this); - this.type = "next-iter"; - this.end = end; + this.forEach(function (k) { + // SameValueZero comparison (NaN !== NaN) + if (!(k === value || k !== k && value !== value)) { + ret[ret.length] = k; } + }); - NextIterOpcode.prototype.evaluate = function evaluate(vm) { - var item = vm.frame.getIterator().next(); - if (item) { - vm.frame.setCondition(TRUE_REF); - vm.frame.setKey(item.key); - vm.frame.setOperand(item.value); - vm.frame.setArgs(_glimmerRuntimeLibCompiledExpressionsArgs.EvaluatedArgs.positional([item.value, item.memo])); - } else { - vm.frame.setCondition(FALSE_REF); - vm.goto(this.end); - } - }; - - return NextIterOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); - - exports.NextIterOpcode = NextIterOpcode; -}); - -enifed('glimmer-runtime/lib/compiled/opcodes/partial', ['exports', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/opcodes/vm'], function (exports, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledOpcodesVm) { - 'use strict'; + return ret; + }, - var PutDynamicPartialDefinitionOpcode = (function (_Opcode) { - babelHelpers.inherits(PutDynamicPartialDefinitionOpcode, _Opcode); + /** + Returns a new enumerable that contains only unique values. The default + implementation returns an array regardless of the receiver type. + ```javascript + let arr = ['a', 'a', 'b', 'b']; + arr.uniq(); // ['a', 'b'] + ``` + This only works on primitive data types, e.g. Strings, Numbers, etc. + @method uniq + @return {Ember.Enumerable} + @public + */ + uniq: function () { + var ret = emberA(); - function PutDynamicPartialDefinitionOpcode(symbolTable) { - _Opcode.call(this); - this.symbolTable = symbolTable; - this.type = "put-dynamic-partial-definition"; + this.forEach(function (k) { + if (ret.indexOf(k) < 0) { + ret.push(k); } + }); - PutDynamicPartialDefinitionOpcode.prototype.evaluate = function evaluate(vm) { - var env = vm.env; - var symbolTable = this.symbolTable; - - function lookupPartial(name) { - var normalized = String(name); - if (!env.hasPartial(normalized, symbolTable)) { - throw new Error('Could not find a partial named "' + normalized + '"'); - } - return env.lookupPartial(normalized, symbolTable); - } - var reference = _glimmerReference.map(vm.frame.getOperand(), lookupPartial); - var cache = _glimmerReference.isConst(reference) ? undefined : new _glimmerReference.ReferenceCache(reference); - var definition = cache ? cache.peek() : reference.value(); - vm.frame.setImmediate(definition); - if (cache) { - vm.updateWith(new _glimmerRuntimeLibCompiledOpcodesVm.Assert(cache)); - } - }; - - PutDynamicPartialDefinitionOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$OPERAND"] - }; - }; - - return PutDynamicPartialDefinitionOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); - - exports.PutDynamicPartialDefinitionOpcode = PutDynamicPartialDefinitionOpcode; - - var PutPartialDefinitionOpcode = (function (_Opcode2) { - babelHelpers.inherits(PutPartialDefinitionOpcode, _Opcode2); + return ret; + }, - function PutPartialDefinitionOpcode(definition) { - _Opcode2.call(this); - this.definition = definition; - this.type = "put-partial-definition"; - } + /** + This property will trigger anytime the enumerable's content changes. + You can observe this property to be notified of changes to the enumerable's + content. + For plain enumerables, this property is read only. `Array` overrides + this method. + @property [] + @type Array + @return this + @private + */ + '[]': _emberMetal.computed({ + get: function (key) { + return this; + } + }), - PutPartialDefinitionOpcode.prototype.evaluate = function evaluate(vm) { - vm.frame.setImmediate(this.definition); - }; + // .......................................................... + // ENUMERABLE OBSERVERS + // - PutPartialDefinitionOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.definition.name)] - }; - }; + /** + Registers an enumerable observer. Must implement `Ember.EnumerableObserver` + mixin. + @method addEnumerableObserver + @param {Object} target + @param {Object} [opts] + @return this + @private + */ + addEnumerableObserver: function (target, opts) { + var willChange = opts && opts.willChange || 'enumerableWillChange'; + var didChange = opts && opts.didChange || 'enumerableDidChange'; + var hasObservers = _emberMetal.get(this, 'hasEnumerableObservers'); - return PutPartialDefinitionOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + if (!hasObservers) { + _emberMetal.propertyWillChange(this, 'hasEnumerableObservers'); + } - exports.PutPartialDefinitionOpcode = PutPartialDefinitionOpcode; + _emberMetal.addListener(this, '@enumerable:before', target, willChange); + _emberMetal.addListener(this, '@enumerable:change', target, didChange); - var EvaluatePartialOpcode = (function (_Opcode3) { - babelHelpers.inherits(EvaluatePartialOpcode, _Opcode3); + if (!hasObservers) { + _emberMetal.propertyDidChange(this, 'hasEnumerableObservers'); + } - function EvaluatePartialOpcode(symbolTable) { - _Opcode3.call(this); - this.symbolTable = symbolTable; - this.type = "evaluate-partial"; - this.cache = _glimmerUtil.dict(); - } + return this; + }, - EvaluatePartialOpcode.prototype.evaluate = function evaluate(vm) { - var _vm$frame$getImmediate = vm.frame.getImmediate(); + /** + Removes a registered enumerable observer. + @method removeEnumerableObserver + @param {Object} target + @param {Object} [opts] + @return this + @private + */ + removeEnumerableObserver: function (target, opts) { + var willChange = opts && opts.willChange || 'enumerableWillChange'; + var didChange = opts && opts.didChange || 'enumerableDidChange'; + var hasObservers = _emberMetal.get(this, 'hasEnumerableObservers'); - var template = _vm$frame$getImmediate.template; + if (hasObservers) { + _emberMetal.propertyWillChange(this, 'hasEnumerableObservers'); + } - var block = this.cache[template.id]; - if (!block) { - block = template.asPartial(this.symbolTable); - } - vm.invokePartial(block); - }; + _emberMetal.removeListener(this, '@enumerable:before', target, willChange); + _emberMetal.removeListener(this, '@enumerable:change', target, didChange); - EvaluatePartialOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$OPERAND"] - }; - }; + if (hasObservers) { + _emberMetal.propertyDidChange(this, 'hasEnumerableObservers'); + } - return EvaluatePartialOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return this; + }, - exports.EvaluatePartialOpcode = EvaluatePartialOpcode; -}); + /** + Becomes true whenever the array currently has observers watching changes + on the array. + @property hasEnumerableObservers + @type Boolean + @private + */ + hasEnumerableObservers: _emberMetal.computed(function () { + return _emberMetal.hasListeners(this, '@enumerable:change') || _emberMetal.hasListeners(this, '@enumerable:before'); + }), -enifed('glimmer-runtime/lib/compiled/opcodes/vm', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/references', 'glimmer-reference', 'glimmer-util'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibReferences, _glimmerReference, _glimmerUtil) { - 'use strict'; + /** + Invoke this method just before the contents of your enumerable will + change. You can either omit the parameters completely or pass the objects + to be removed or added if available or just a count. + @method enumerableContentWillChange + @param {Ember.Enumerable|Number} removing An enumerable of the objects to + be removed or the number of items to be removed. + @param {Ember.Enumerable|Number} adding An enumerable of the objects to be + added or the number of items to be added. + @chainable + @private + */ + enumerableContentWillChange: function (removing, adding) { + var removeCnt = undefined, + addCnt = undefined, + hasDelta = undefined; - var PushChildScopeOpcode = (function (_Opcode) { - babelHelpers.inherits(PushChildScopeOpcode, _Opcode); + if ('number' === typeof removing) { + removeCnt = removing; + } else if (removing) { + removeCnt = _emberMetal.get(removing, 'length'); + } else { + removeCnt = removing = -1; + } - function PushChildScopeOpcode() { - _Opcode.apply(this, arguments); - this.type = "push-child-scope"; - } + if ('number' === typeof adding) { + addCnt = adding; + } else if (adding) { + addCnt = _emberMetal.get(adding, 'length'); + } else { + addCnt = adding = -1; + } - PushChildScopeOpcode.prototype.evaluate = function evaluate(vm) { - vm.pushChildScope(); - }; + hasDelta = addCnt < 0 || removeCnt < 0 || addCnt - removeCnt !== 0; - return PushChildScopeOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + if (removing === -1) { + removing = null; + } - exports.PushChildScopeOpcode = PushChildScopeOpcode; + if (adding === -1) { + adding = null; + } - var PopScopeOpcode = (function (_Opcode2) { - babelHelpers.inherits(PopScopeOpcode, _Opcode2); + _emberMetal.propertyWillChange(this, '[]'); - function PopScopeOpcode() { - _Opcode2.apply(this, arguments); - this.type = "pop-scope"; - } + if (hasDelta) { + _emberMetal.propertyWillChange(this, 'length'); + } - PopScopeOpcode.prototype.evaluate = function evaluate(vm) { - vm.popScope(); - }; + _emberMetal.sendEvent(this, '@enumerable:before', [this, removing, adding]); - return PopScopeOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return this; + }, - exports.PopScopeOpcode = PopScopeOpcode; + /** + Invoke this method when the contents of your enumerable has changed. + This will notify any observers watching for content changes. If you are + implementing an ordered enumerable (such as an array), also pass the + start and end values where the content changed so that it can be used to + notify range observers. + @method enumerableContentDidChange + @param {Ember.Enumerable|Number} removing An enumerable of the objects to + be removed or the number of items to be removed. + @param {Ember.Enumerable|Number} adding An enumerable of the objects to + be added or the number of items to be added. + @chainable + @private + */ + enumerableContentDidChange: function (removing, adding) { + var removeCnt = undefined, + addCnt = undefined, + hasDelta = undefined; - var PushDynamicScopeOpcode = (function (_Opcode3) { - babelHelpers.inherits(PushDynamicScopeOpcode, _Opcode3); + if ('number' === typeof removing) { + removeCnt = removing; + } else if (removing) { + removeCnt = _emberMetal.get(removing, 'length'); + } else { + removeCnt = removing = -1; + } - function PushDynamicScopeOpcode() { - _Opcode3.apply(this, arguments); - this.type = "push-dynamic-scope"; - } + if ('number' === typeof adding) { + addCnt = adding; + } else if (adding) { + addCnt = _emberMetal.get(adding, 'length'); + } else { + addCnt = adding = -1; + } - PushDynamicScopeOpcode.prototype.evaluate = function evaluate(vm) { - vm.pushDynamicScope(); - }; + hasDelta = addCnt < 0 || removeCnt < 0 || addCnt - removeCnt !== 0; - return PushDynamicScopeOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + if (removing === -1) { + removing = null; + } - exports.PushDynamicScopeOpcode = PushDynamicScopeOpcode; + if (adding === -1) { + adding = null; + } - var PopDynamicScopeOpcode = (function (_Opcode4) { - babelHelpers.inherits(PopDynamicScopeOpcode, _Opcode4); + _emberMetal.sendEvent(this, '@enumerable:change', [this, removing, adding]); - function PopDynamicScopeOpcode() { - _Opcode4.apply(this, arguments); - this.type = "pop-dynamic-scope"; - } + if (hasDelta) { + _emberMetal.propertyDidChange(this, 'length'); + } - PopDynamicScopeOpcode.prototype.evaluate = function evaluate(vm) { - vm.popDynamicScope(); - }; + _emberMetal.propertyDidChange(this, '[]'); - return PopDynamicScopeOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return this; + }, - exports.PopDynamicScopeOpcode = PopDynamicScopeOpcode; + /** + Converts the enumerable into an array and sorts by the keys + specified in the argument. + 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 + @public + */ + sortBy: function () { + var sortKeys = arguments; - var PutNullOpcode = (function (_Opcode5) { - babelHelpers.inherits(PutNullOpcode, _Opcode5); + return this.toArray().sort(function (a, b) { + for (var i = 0; i < sortKeys.length; i++) { + var key = sortKeys[i]; + var propA = _emberMetal.get(a, key); + var propB = _emberMetal.get(b, key); + // return 1 or -1 else continue to the next sortKey + var compareValue = _emberRuntimeCompare.default(propA, propB); - function PutNullOpcode() { - _Opcode5.apply(this, arguments); - this.type = "put-null"; + if (compareValue) { + return compareValue; + } } + return 0; + }); + }, - PutNullOpcode.prototype.evaluate = function evaluate(vm) { - vm.frame.setOperand(_glimmerRuntimeLibReferences.NULL_REFERENCE); - }; - - return PutNullOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); - - exports.PutNullOpcode = PutNullOpcode; + /** + 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 + let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }]; + arr.uniqBy('value'); // [{ value: 'a' }, { value: 'b' }] + ``` + @method uniqBy + @return {Ember.Enumerable} + @public + */ - var PutValueOpcode = (function (_Opcode6) { - babelHelpers.inherits(PutValueOpcode, _Opcode6); + uniqBy: function (key) { + var ret = emberA(); + var seen = new _emberUtils.EmptyObject(); - function PutValueOpcode(expression) { - _Opcode6.call(this); - this.expression = expression; - this.type = "put-value"; + this.forEach(function (item) { + var guid = _emberUtils.guidFor(_emberMetal.get(item, key)); + if (!(guid in seen)) { + seen[guid] = true; + ret.push(item); } + }); - PutValueOpcode.prototype.evaluate = function evaluate(vm) { - vm.evaluateOperand(this.expression); - }; - - PutValueOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [this.expression.toJSON()] - }; - }; - - return PutValueOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return ret; + }, - exports.PutValueOpcode = PutValueOpcode; + /** + 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) { + _emberMetal.assert('Enumerable#includes cannot accept a second argument "startAt" as enumerable items are unordered.', arguments.length === 1); - var PutArgsOpcode = (function (_Opcode7) { - babelHelpers.inherits(PutArgsOpcode, _Opcode7); + var len = _emberMetal.get(this, 'length'); + var idx = undefined, + next = undefined; + var last = null; + var found = false; - function PutArgsOpcode(args) { - _Opcode7.call(this); - this.args = args; - this.type = "put-args"; - } + var context = popCtx(); - PutArgsOpcode.prototype.evaluate = function evaluate(vm) { - vm.evaluateArgs(this.args); - }; + for (idx = 0; idx < len && !found; idx++) { + next = this.nextObject(idx, last, context); - PutArgsOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - details: { - "positional": this.args.positional.toJSON(), - "named": this.args.named.toJSON() - } - }; - }; + found = obj === next || obj !== obj && next !== next; - return PutArgsOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + last = next; + } - exports.PutArgsOpcode = PutArgsOpcode; + next = last = null; + context = pushCtx(context); - var BindPositionalArgsOpcode = (function (_Opcode8) { - babelHelpers.inherits(BindPositionalArgsOpcode, _Opcode8); + return found; + } + }); - function BindPositionalArgsOpcode(names, symbols) { - _Opcode8.call(this); - this.names = names; - this.symbols = symbols; - this.type = "bind-positional-args"; - } + exports.default = Enumerable; +}); +enifed('ember-runtime/mixins/evented', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - BindPositionalArgsOpcode.create = function create(block) { - var names = block.locals; - var symbols = names.map(function (name) { - return block.symbolTable.getLocal(name); - }); - return new this(names, symbols); - }; + /** + @module ember + @submodule ember-runtime + */ - BindPositionalArgsOpcode.prototype.evaluate = function evaluate(vm) { - vm.bindPositionalArgs(this.symbols); - }; + /** + This mixin allows for Ember objects to subscribe to and emit events. + + ```javascript + App.Person = Ember.Object.extend(Ember.Evented, { + greet: function() { + // ... + this.trigger('greet'); + } + }); + + var person = App.Person.create(); + + person.on('greet', function() { + console.log('Our person has greeted'); + }); + + person.greet(); + + // outputs: 'Our person has greeted' + ``` + + You can also chain multiple event subscriptions: + + ```javascript + person.on('greet', function() { + console.log('Our person has greeted'); + }).one('greet', function() { + console.log('Offer one-time special'); + }).off('event', this, forgetThis); + ``` + + @class Evented + @namespace Ember + @public + */ + exports.default = _emberMetal.Mixin.create({ - BindPositionalArgsOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ['[' + this.names.map(function (name) { - return JSON.stringify(name); - }).join(", ") + ']'] - }; - }; + /** + Subscribes to a named event with given function. + ```javascript + person.on('didLoad', function() { + // fired once the person has loaded + }); + ``` + An optional target can be passed in as the 2nd argument that will + be set as the "this" for the callback. This is a good way to give your + function access to the object triggering the event. When the target + parameter is used the callback becomes the third argument. + @method on + @param {String} name The name of the event + @param {Object} [target] The "this" binding for the callback + @param {Function} method The callback to execute + @return this + @public + */ + on: function (name, target, method) { + _emberMetal.addListener(this, name, target, method); + return this; + }, - return BindPositionalArgsOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + Subscribes a function to a named event and then cancels the subscription + after the first time the event is triggered. It is good to use ``one`` when + you only care about the first time an event has taken place. + This function takes an optional 2nd argument that will become the "this" + value for the callback. If this argument is passed then the 3rd argument + becomes the function. + @method one + @param {String} name The name of the event + @param {Object} [target] The "this" binding for the callback + @param {Function} method The callback to execute + @return this + @public + */ + one: function (name, target, method) { + if (!method) { + method = target; + target = null; + } - exports.BindPositionalArgsOpcode = BindPositionalArgsOpcode; + _emberMetal.addListener(this, name, target, method, true); + return this; + }, - var BindNamedArgsOpcode = (function (_Opcode9) { - babelHelpers.inherits(BindNamedArgsOpcode, _Opcode9); + /** + Triggers a named event for the object. Any additional arguments + will be passed as parameters to the functions that are subscribed to the + event. + ```javascript + person.on('didEat', function(food) { + console.log('person ate some ' + food); + }); + person.trigger('didEat', 'broccoli'); + // outputs: person ate some broccoli + ``` + @method trigger + @param {String} name The name of the event + @param {Object...} args Optional arguments to pass on + @public + */ + trigger: function (name) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } - function BindNamedArgsOpcode(names, symbols) { - _Opcode9.call(this); - this.names = names; - this.symbols = symbols; - this.type = "bind-named-args"; - } + _emberMetal.sendEvent(this, name, args); + }, - BindNamedArgsOpcode.create = function create(layout) { - var names = layout.named; - var symbols = names.map(function (name) { - return layout.symbolTable.getNamed(name); - }); - return new this(names, symbols); - }; + /** + Cancels subscription for given name, target, and method. + @method off + @param {String} name The name of the event + @param {Object} target The target of the subscription + @param {Function} method The function of the subscription + @return this + @public + */ + off: function (name, target, method) { + _emberMetal.removeListener(this, name, target, method); + return this; + }, - BindNamedArgsOpcode.prototype.evaluate = function evaluate(vm) { - vm.bindNamedArgs(this.names, this.symbols); - }; + /** + Checks to see if object has any subscriptions for named event. + @method has + @param {String} name The name of the event + @return {Boolean} does the object have a subscription for event + @public + */ + has: function (name) { + return _emberMetal.hasListeners(this, name); + } + }); +}); +enifed('ember-runtime/mixins/freezable', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-runtime + */ - BindNamedArgsOpcode.prototype.toJSON = function toJSON() { - var names = this.names; - var symbols = this.symbols; + 'use strict'; - var args = names.map(function (name, i) { - return '$' + symbols[i] + ': $ARGS[' + name + ']'; - }); - return { - guid: this._guid, - type: this.type, - args: args - }; - }; + /** + 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. + + ## Enforcement + + To fully support freezing in your subclass, you must include this mixin and + override any method that might alter any property on the object to instead + raise an exception. You can check the state of an object by checking the + `isFrozen` property. + + Although future versions of JavaScript may support language-level freezing + object objects, that is not the case today. Even if an object is freezable, + it is still technically possible to modify the object, even though it could + break other parts of your application that do not expect a frozen object to + change. It is, therefore, very important that you always respect the + `isFrozen` property on all freezable objects. + + ## Example Usage + + The example below shows a simple object that implement the `Ember.Freezable` + protocol. + + ```javascript + Contact = Ember.Object.extend(Ember.Freezable, { + firstName: null, + lastName: null, + + // swaps the names + swapNames: function() { + if (this.get('isFrozen')) throw Ember.FROZEN_ERROR; + var tmp = this.get('firstName'); + this.set('firstName', this.get('lastName')); + this.set('lastName', tmp); + return this; + } + + }); + + c = Contact.create({ firstName: "John", lastName: "Doe" }); + c.swapNames(); // returns c + c.freeze(); + c.swapNames(); // EXCEPTION + ``` + + ## Copying + + Usually the `Ember.Freezable` protocol is implemented in cooperation with the + `Ember.Copyable` protocol, which defines a `frozenCopy()` method that will + return a frozen object, if the object implements this method as well. + + @class Freezable + @namespace Ember + @since Ember 0.9 + @deprecated Use `Object.freeze` instead. + @private + */ + var Freezable = _emberMetal.Mixin.create({ - return BindNamedArgsOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + init: function () { + _emberMetal.deprecate('`Ember.Freezable` is deprecated, use `Object.freeze` instead.', false, { id: 'ember-runtime.freezable-init', until: '3.0.0' }); + this._super.apply(this, arguments); + }, - exports.BindNamedArgsOpcode = BindNamedArgsOpcode; + /** + Set to `true` when the object is frozen. Use this property to detect + whether your object is frozen or not. + @property isFrozen + @type Boolean + @private + */ + isFrozen: false, - var BindBlocksOpcode = (function (_Opcode10) { - babelHelpers.inherits(BindBlocksOpcode, _Opcode10); + /** + Freezes the object. Once this method has been called the object should + no longer allow any properties to be edited. + @method freeze + @return {Object} receiver + @private + */ + freeze: function () { + if (_emberMetal.get(this, 'isFrozen')) { + return this; + } - function BindBlocksOpcode(names, symbols) { - _Opcode10.call(this); - this.names = names; - this.symbols = symbols; - this.type = "bind-blocks"; - } + _emberMetal.set(this, 'isFrozen', true); + return this; + } - BindBlocksOpcode.create = function create(layout) { - var names = layout.yields; - var symbols = names.map(function (name) { - return layout.symbolTable.getYield(name); - }); - return new this(names, symbols); - }; + }); - BindBlocksOpcode.prototype.evaluate = function evaluate(vm) { - vm.bindBlocks(this.names, this.symbols); - }; + exports.Freezable = Freezable; + var FROZEN_ERROR = 'Frozen object cannot be modified.'; + exports.FROZEN_ERROR = FROZEN_ERROR; +}); +enifed('ember-runtime/mixins/mutable_array', ['exports', 'ember-metal', 'ember-runtime/mixins/array', 'ember-runtime/mixins/mutable_enumerable', 'ember-runtime/mixins/enumerable'], function (exports, _emberMetal, _emberRuntimeMixinsArray, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeMixinsEnumerable) { + /** + @module ember + @submodule ember-runtime + */ - BindBlocksOpcode.prototype.toJSON = function toJSON() { - var names = this.names; - var symbols = this.symbols; + 'use strict'; - var args = names.map(function (name, i) { - return '$' + symbols[i] + ': $BLOCKS[' + name + ']'; - }); - return { - guid: this._guid, - type: this.type, - args: args - }; - }; + exports.removeAt = removeAt; + var OUT_OF_RANGE_EXCEPTION = 'Index out of range'; + var EMPTY = []; - return BindBlocksOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + // .......................................................... + // HELPERS + // - exports.BindBlocksOpcode = BindBlocksOpcode; + function removeAt(array, start, len) { + if ('number' === typeof start) { + if (start < 0 || start >= _emberMetal.get(array, 'length')) { + throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); + } - var BindPartialArgsOpcode = (function (_Opcode11) { - babelHelpers.inherits(BindPartialArgsOpcode, _Opcode11); + // fast case + if (len === undefined) { + len = 1; + } - function BindPartialArgsOpcode(symbol) { - _Opcode11.call(this); - this.symbol = symbol; - this.type = "bind-partial-args"; - } + array.replace(start, len, EMPTY); + } - BindPartialArgsOpcode.create = function create(layout) { - return new this(layout.symbolTable.getPartialArgs()); - }; + return array; + } - BindPartialArgsOpcode.prototype.evaluate = function evaluate(vm) { - vm.bindPartialArgs(this.symbol); - }; + /** + 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. + + It is important to use the methods in this class to modify arrays so that + changes are observable. This allows the binding system in Ember to function + correctly. + + + Note that an Array can change even if it does not implement this mixin. + For example, one might implement a SparseArray that cannot be directly + modified, but if its underlying enumerable changes, it will change also. + + @class MutableArray + @namespace Ember + @uses Ember.Array + @uses Ember.MutableEnumerable + @public + */ + exports.default = _emberMetal.Mixin.create(_emberRuntimeMixinsArray.default, _emberRuntimeMixinsMutable_enumerable.default, { - return BindPartialArgsOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + __Required.__ You must implement this method to apply this mixin. + This is one of the primitives you must implement to support `Ember.Array`. + You should replace amt objects started at idx with the objects in the + passed array. You should also call `this.enumerableContentDidChange()` + @method replace + @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* + @public + */ + replace: null, - exports.BindPartialArgsOpcode = BindPartialArgsOpcode; + /** + Remove all elements from the array. This is useful if you + want to reuse an existing array without having to recreate it. + ```javascript + let colors = ['red', 'green', 'blue']; + colors.length; // 3 + colors.clear(); // [] + colors.length; // 0 + ``` + @method clear + @return {Ember.Array} An empty Array. + @public + */ + clear: function () { + var len = _emberMetal.get(this, 'length'); + if (len === 0) { + return this; + } - var BindCallerScopeOpcode = (function (_Opcode12) { - babelHelpers.inherits(BindCallerScopeOpcode, _Opcode12); + this.replace(0, len, EMPTY); + return this; + }, - function BindCallerScopeOpcode() { - _Opcode12.apply(this, arguments); - this.type = "bind-caller-scope"; - } + /** + This will use the primitive `replace()` method to insert an object at the + specified index. + ```javascript + let colors = ['red', 'green', 'blue']; + colors.insertAt(2, 'yellow'); // ['red', 'green', 'yellow', 'blue'] + colors.insertAt(5, 'orange'); // Error: Index out of range + ``` + @method insertAt + @param {Number} idx index of insert the object at. + @param {Object} object object to insert + @return {Ember.Array} receiver + @public + */ + insertAt: function (idx, object) { + if (idx > _emberMetal.get(this, 'length')) { + throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); + } - BindCallerScopeOpcode.prototype.evaluate = function evaluate(vm) { - vm.bindCallerScope(); - }; + this.replace(idx, 0, [object]); + return this; + }, - return BindCallerScopeOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + Remove an object at the specified index using the `replace()` primitive + method. You can pass either a single index, or a start and a length. + If you pass a start and length that is beyond the + length this method will throw an `OUT_OF_RANGE_EXCEPTION`. + ```javascript + let colors = ['red', 'green', 'blue', 'yellow', 'orange']; + colors.removeAt(0); // ['green', 'blue', 'yellow', 'orange'] + colors.removeAt(2, 2); // ['green', 'blue'] + colors.removeAt(4, 2); // Error: Index out of range + ``` + @method removeAt + @param {Number} start index, start of range + @param {Number} len length of passing range + @return {Ember.Array} receiver + @public + */ + removeAt: function (start, len) { + return removeAt(this, start, len); + }, - exports.BindCallerScopeOpcode = BindCallerScopeOpcode; + /** + Push the object onto the end of the array. Works just like `push()` but it + is KVO-compliant. + ```javascript + let colors = ['red', 'green']; + colors.pushObject('black'); // ['red', 'green', 'black'] + colors.pushObject(['yellow']); // ['red', 'green', ['yellow']] + ``` + @method pushObject + @param {*} obj object to push + @return object same object passed as a param + @public + */ + pushObject: function (obj) { + this.insertAt(_emberMetal.get(this, 'length'), obj); + return obj; + }, - var BindDynamicScopeOpcode = (function (_Opcode13) { - babelHelpers.inherits(BindDynamicScopeOpcode, _Opcode13); + /** + Add the objects in the passed numerable to the end of the array. Defers + notifying observers of the change until all objects are added. + ```javascript + let colors = ['red']; + colors.pushObjects(['yellow', 'orange']); // ['red', 'yellow', 'orange'] + ``` + @method pushObjects + @param {Ember.Enumerable} objects the objects to add + @return {Ember.Array} receiver + @public + */ + pushObjects: function (objects) { + if (!(_emberRuntimeMixinsEnumerable.default.detect(objects) || Array.isArray(objects))) { + throw new TypeError('Must pass Ember.Enumerable to Ember.MutableArray#pushObjects'); + } + this.replace(_emberMetal.get(this, 'length'), 0, objects); + return this; + }, - function BindDynamicScopeOpcode(names) { - _Opcode13.call(this); - this.names = names; - this.type = "bind-dynamic-scope"; - } + /** + Pop object from array or nil if none are left. Works just like `pop()` but + it is KVO-compliant. + ```javascript + let colors = ['red', 'green', 'blue']; + colors.popObject(); // 'blue' + console.log(colors); // ['red', 'green'] + ``` + @method popObject + @return object + @public + */ + popObject: function () { + var len = _emberMetal.get(this, 'length'); + if (len === 0) { + return null; + } - BindDynamicScopeOpcode.prototype.evaluate = function evaluate(vm) { - vm.bindDynamicScope(this.names); - }; + var ret = _emberRuntimeMixinsArray.objectAt(this, len - 1); + this.removeAt(len - 1, 1); + return ret; + }, - return BindDynamicScopeOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + Shift an object from start of array or nil if none are left. Works just + like `shift()` but it is KVO-compliant. + ```javascript + let colors = ['red', 'green', 'blue']; + colors.shiftObject(); // 'red' + console.log(colors); // ['green', 'blue'] + ``` + @method shiftObject + @return object + @public + */ + shiftObject: function () { + if (_emberMetal.get(this, 'length') === 0) { + return null; + } - exports.BindDynamicScopeOpcode = BindDynamicScopeOpcode; + var ret = _emberRuntimeMixinsArray.objectAt(this, 0); + this.removeAt(0); + return ret; + }, - var EnterOpcode = (function (_Opcode14) { - babelHelpers.inherits(EnterOpcode, _Opcode14); + /** + Unshift an object to start of array. Works just like `unshift()` but it is + KVO-compliant. + ```javascript + let colors = ['red']; + colors.unshiftObject('yellow'); // ['yellow', 'red'] + colors.unshiftObject(['black']); // [['black'], 'yellow', 'red'] + ``` + @method unshiftObject + @param {*} obj object to unshift + @return object same object passed as a param + @public + */ + unshiftObject: function (obj) { + this.insertAt(0, obj); + return obj; + }, - function EnterOpcode(begin, end) { - _Opcode14.call(this); - this.type = "enter"; - this.slice = new _glimmerUtil.ListSlice(begin, end); - } + /** + Adds the named objects to the beginning of the array. Defers notifying + observers until all objects have been added. + ```javascript + let colors = ['red']; + colors.unshiftObjects(['black', 'white']); // ['black', 'white', 'red'] + colors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function + ``` + @method unshiftObjects + @param {Ember.Enumerable} objects the objects to add + @return {Ember.Array} receiver + @public + */ + unshiftObjects: function (objects) { + this.replace(0, 0, objects); + return this; + }, - EnterOpcode.prototype.evaluate = function evaluate(vm) { - vm.enter(this.slice); - }; + /** + Reverse objects in the array. Works just like `reverse()` but it is + KVO-compliant. + @method reverseObjects + @return {Ember.Array} receiver + @public + */ + reverseObjects: function () { + var len = _emberMetal.get(this, 'length'); + if (len === 0) { + return this; + } - EnterOpcode.prototype.toJSON = function toJSON() { - var slice = this.slice; - var type = this.type; - var _guid = this._guid; + var objects = this.toArray().reverse(); + this.replace(0, len, objects); + return this; + }, - var begin = slice.head(); - var end = slice.tail(); - return { - guid: _guid, - type: type, - args: [JSON.stringify(begin.inspect()), JSON.stringify(end.inspect())] - }; - }; + /** + Replace all the receiver's content with content of the argument. + If argument is an empty array receiver will be cleared. + ```javascript + let colors = ['red', 'green', 'blue']; + colors.setObjects(['black', 'white']); // ['black', 'white'] + colors.setObjects([]); // [] + ``` + @method setObjects + @param {Ember.Array} objects array whose content will be used for replacing + the content of the receiver + @return {Ember.Array} receiver with the new content + @public + */ + setObjects: function (objects) { + if (objects.length === 0) { + return this.clear(); + } - return EnterOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + var len = _emberMetal.get(this, 'length'); + this.replace(0, len, objects); + return this; + }, - exports.EnterOpcode = EnterOpcode; + // .......................................................... + // IMPLEMENT Ember.MutableEnumerable + // - var ExitOpcode = (function (_Opcode15) { - babelHelpers.inherits(ExitOpcode, _Opcode15); + /** + Remove all occurrences of an object in the array. + ```javascript + let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago']; + cities.removeObject('Chicago'); // ['Berlin', 'Lima'] + cities.removeObject('Lima'); // ['Berlin'] + cities.removeObject('Tokyo') // ['Berlin'] + ``` + @method removeObject + @param {*} obj object to remove + @return {Ember.Array} receiver + @public + */ + removeObject: function (obj) { + var loc = _emberMetal.get(this, 'length') || 0; + while (--loc >= 0) { + var curObject = _emberRuntimeMixinsArray.objectAt(this, loc); - function ExitOpcode() { - _Opcode15.apply(this, arguments); - this.type = "exit"; + if (curObject === obj) { + this.removeAt(loc); } + } + return this; + }, - ExitOpcode.prototype.evaluate = function evaluate(vm) { - vm.exit(); - }; - - return ExitOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + Push the object onto the end of the array if it is not already + present in the array. + ```javascript + let cities = ['Chicago', 'Berlin']; + cities.addObject('Lima'); // ['Chicago', 'Berlin', 'Lima'] + cities.addObject('Berlin'); // ['Chicago', 'Berlin', 'Lima'] + ``` + @method addObject + @param {*} obj object to add, if not already present + @return {Ember.Array} receiver + @public + */ + addObject: function (obj) { + var included = this.includes(obj); - exports.ExitOpcode = ExitOpcode; + if (!included) { + this.pushObject(obj); + } - var LabelOpcode = (function (_Opcode16) { - babelHelpers.inherits(LabelOpcode, _Opcode16); + return this; + } + }); +}); +enifed('ember-runtime/mixins/mutable_enumerable', ['exports', 'ember-runtime/mixins/enumerable', 'ember-metal'], function (exports, _emberRuntimeMixinsEnumerable, _emberMetal) { + 'use strict'; - function LabelOpcode(label) { - _Opcode16.call(this); - this.tag = _glimmerReference.CONSTANT_TAG; - this.type = "label"; - this.label = null; - this.prev = null; - this.next = null; - if (label) this.label = label; - } + /** + @module ember + @submodule ember-runtime + */ - LabelOpcode.prototype.evaluate = function evaluate() {}; + /** + This mixin defines the API for modifying generic enumerables. These methods + can be applied to an object regardless of whether it is ordered or + unordered. + + Note that an Enumerable can change even if it does not implement this mixin. + For example, a MappedEnumerable cannot be directly modified but if its + underlying enumerable changes, it will change also. + + ## Adding Objects + + To add an object to an enumerable, use the `addObject()` method. This + method will only add the object to the enumerable if the object is not + already present and is of a type supported by the enumerable. + + ```javascript + set.addObject(contact); + ``` + + ## Removing Objects + + To remove an object from an enumerable, use the `removeObject()` method. This + will only remove the object if it is present in the enumerable, otherwise + this method has no effect. + + ```javascript + set.removeObject(contact); + ``` + + ## Implementing In Your Own Code + + If you are implementing an object and want to support this API, just include + this mixin in your class and implement the required methods. In your unit + tests, be sure to apply the Ember.MutableEnumerableTests to your object. + + @class MutableEnumerable + @namespace Ember + @uses Ember.Enumerable + @public + */ + exports.default = _emberMetal.Mixin.create(_emberRuntimeMixinsEnumerable.default, { - LabelOpcode.prototype.inspect = function inspect() { - return this.label + ' [' + this._guid + ']'; - }; + /** + __Required.__ You must implement this method to apply this mixin. + Attempts to add the passed object to the receiver if the object is not + already present in the collection. If the object is present, this method + has no effect. + If the passed object is of a type not supported by the receiver, + then this method should raise an exception. + @method addObject + @param {Object} object The object to add to the enumerable. + @return {Object} the passed object + @public + */ + addObject: null, - LabelOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.inspect())] - }; - }; + /** + Adds each object in the passed enumerable to the receiver. + @method addObjects + @param {Ember.Enumerable} objects the objects to add. + @return {Object} receiver + @public + */ + addObjects: function (objects) { + var _this = this; - return LabelOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + _emberMetal.beginPropertyChanges(this); + objects.forEach(function (obj) { + return _this.addObject(obj); + }); + _emberMetal.endPropertyChanges(this); + return this; + }, - exports.LabelOpcode = LabelOpcode; + /** + __Required.__ You must implement this method to apply this mixin. + Attempts to remove the passed object from the receiver collection if the + object is present in the collection. If the object is not present, + this method has no effect. + If the passed object is of a type not supported by the receiver, + then this method should raise an exception. + @method removeObject + @param {Object} object The object to remove from the enumerable. + @return {Object} the passed object + @public + */ + removeObject: null, - var EvaluateOpcode = (function (_Opcode17) { - babelHelpers.inherits(EvaluateOpcode, _Opcode17); + /** + Removes each object in the passed enumerable from the receiver. + @method removeObjects + @param {Ember.Enumerable} objects the objects to remove + @return {Object} receiver + @public + */ + removeObjects: function (objects) { + _emberMetal.beginPropertyChanges(this); + for (var i = objects.length - 1; i >= 0; i--) { + this.removeObject(objects[i]); + } + _emberMetal.endPropertyChanges(this); + return this; + } + }); +}); +enifed('ember-runtime/mixins/observable', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-runtime + */ - function EvaluateOpcode(debug, block) { - _Opcode17.call(this); - this.debug = debug; - this.block = block; - this.type = "evaluate"; - } + 'use strict'; - EvaluateOpcode.prototype.evaluate = function evaluate(vm) { - vm.invokeBlock(this.block, vm.frame.getArgs()); - }; + /** + ## Overview + + This mixin provides properties and property observing functionality, core + features of the Ember object model. + + Properties and observers allow one object to observe changes to a + property on another object. This is one of the fundamental ways that + models, controllers and views communicate with each other in an Ember + application. + + Any object that has this mixin applied can be used in observer + operations. That includes `Ember.Object` and most objects you will + interact with as you write your Ember application. + + Note that you will not generally apply this mixin to classes yourself, + but you will use the features provided by this module frequently, so it + is important to understand how to use it. + + ## Using `get()` and `set()` + + Because of Ember's support for bindings and observers, you will always + access properties using the get method, and set properties using the + set method. This allows the observing objects to be notified and + computed properties to be handled properly. + + More documentation about `get` and `set` are below. + + ## Observing Property Changes + + You typically observe property changes simply by using the `Ember.observer` + function in classes that you write. + + For example: + + ```javascript + Ember.Object.extend({ + valueObserver: Ember.observer('value', function(sender, key, value, rev) { + // Executes whenever the "value" property changes + // See the addObserver method for more information about the callback arguments + }) + }); + ``` + + Although this is the most common way to add an observer, this capability + is actually built into the `Ember.Object` class on top of two methods + defined in this mixin: `addObserver` and `removeObserver`. You can use + these two methods to add and remove observers yourself if you need to + do so at runtime. + + To add an observer for a property, call: + + ```javascript + object.addObserver('propertyKey', targetObject, targetAction) + ``` + + This will call the `targetAction` method on the `targetObject` whenever + the value of the `propertyKey` changes. + + Note that if `propertyKey` is a computed property, the observer will be + called when any of the property dependencies are changed, even if the + resulting value of the computed property is unchanged. This is necessary + because computed properties are not computed until `get` is called. + + @class Observable + @namespace Ember + @public + */ + exports.default = _emberMetal.Mixin.create({ - EvaluateOpcode.prototype.toJSON = function toJSON() { - var guid = this._guid; - var type = this.type; - var debug = this.debug; - var block = this.block; - - var compiled = block['compiled']; - var children = undefined; - if (compiled) { - children = compiled.ops.toArray().map(function (op) { - return op.toJSON(); - }); - } else { - children = [{ guid: null, type: '[ UNCOMPILED BLOCK ]' }]; - } - return { - guid: guid, - type: type, - args: [debug], - children: children - }; - }; + /** + Retrieves the value of a property from the object. + This method is usually similar to using `object[keyName]` or `object.keyName`, + however it supports both computed properties and the unknownProperty + handler. + Because `get` unifies the syntax for accessing all these kinds + of properties, it can make many refactorings easier, such as replacing a + simple property with a computed property, or vice versa. + ### Computed Properties + Computed properties are methods defined with the `property` modifier + declared at the end, such as: + ```javascript + fullName: Ember.computed('firstName', 'lastName', function() { + return this.get('firstName') + ' ' + this.get('lastName'); + }) + ``` + When you call `get` on a computed property, the function will be + called and the return value will be returned instead of the function + itself. + ### Unknown Properties + Likewise, if you try to call `get` on a property whose value is + `undefined`, the `unknownProperty()` method will be called on the object. + If this method returns any value other than `undefined`, it will be returned + instead. This allows you to implement "virtual" properties that are + not defined upfront. + @method get + @param {String} keyName The property to retrieve + @return {Object} The property value or undefined. + @public + */ + get: function (keyName) { + return _emberMetal.get(this, keyName); + }, - return EvaluateOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + To get the values of multiple properties at once, call `getProperties` + with a list of strings or an array: + ```javascript + record.getProperties('firstName', 'lastName', 'zipCode'); + // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } + ``` + is equivalent to: + ```javascript + record.getProperties(['firstName', 'lastName', 'zipCode']); + // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } + ``` + @method getProperties + @param {String...|Array} list of keys to get + @return {Object} + @public + */ + getProperties: function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - exports.EvaluateOpcode = EvaluateOpcode; - var ConstTest = function (ref, env) { - return new _glimmerReference.ConstReference(!!ref.value()); - }; - exports.ConstTest = ConstTest; - var SimpleTest = function (ref, env) { - return ref; - }; - exports.SimpleTest = SimpleTest; - var EnvironmentTest = function (ref, env) { - return env.toConditionalReference(ref); - }; - exports.EnvironmentTest = EnvironmentTest; + return _emberMetal.getProperties.apply(undefined, [this].concat(args)); + }, - var TestOpcode = (function (_Opcode18) { - babelHelpers.inherits(TestOpcode, _Opcode18); + /** + Sets the provided key or path to the value. + ```javascript + record.set("key", value); + ``` + This method is generally very similar to calling `object["key"] = value` or + `object.key = value`, except that it provides support for computed + properties, the `setUnknownProperty()` method and property observers. + ### Computed Properties + If you try to set a value on a key that has a computed property handler + defined (see the `get()` method for an example), then `set()` will call + that method, passing both the value and key instead of simply changing + the value itself. This is useful for those times when you need to + implement a property that is composed of one or more member + properties. + ### Unknown Properties + If you try to set a value on a key that is undefined in the target + object, then the `setUnknownProperty()` handler will be called instead. This + gives you an opportunity to implement complex "virtual" properties that + are not predefined on the object. If `setUnknownProperty()` returns + undefined, then `set()` will simply set the value on the object. + ### Property Observers + In addition to changing the property, `set()` will also register a property + change with the object. Unless you have placed this call inside of a + `beginPropertyChanges()` and `endPropertyChanges(),` any "local" observers + (i.e. observer methods declared on the same object), will be called + immediately. Any "remote" observers (i.e. observer methods declared on + another object) will be placed in a queue and called at a later time in a + coalesced manner. + @method set + @param {String} keyName The property to set + @param {Object} value The value to set or `null`. + @return {Object} The passed value + @public + */ + set: function (keyName, value) { + return _emberMetal.set(this, keyName, value); + }, - function TestOpcode(testFunc) { - _Opcode18.call(this); - this.testFunc = testFunc; - this.type = "test"; - } + /** + Sets a list of properties at once. These properties are set inside + a single `beginPropertyChanges` and `endPropertyChanges` batch, so + observers will be buffered. + ```javascript + record.setProperties({ firstName: 'Charles', lastName: 'Jolley' }); + ``` + @method setProperties + @param {Object} hash the hash of keys and values to set + @return {Object} The passed in hash + @public + */ + setProperties: function (hash) { + return _emberMetal.setProperties(this, hash); + }, - TestOpcode.prototype.evaluate = function evaluate(vm) { - vm.frame.setCondition(this.testFunc(vm.frame.getOperand(), vm.env)); - }; + /** + Begins a grouping of property changes. + You can use this method to group property changes so that notifications + will not be sent until the changes are finished. If you plan to make a + large number of changes to an object at one time, you should call this + method at the beginning of the changes to begin deferring change + notifications. When you are done making changes, call + `endPropertyChanges()` to deliver the deferred change notifications and end + deferring. + @method beginPropertyChanges + @return {Ember.Observable} + @private + */ + beginPropertyChanges: function () { + _emberMetal.beginPropertyChanges(); + return this; + }, - TestOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$OPERAND", this.testFunc.name] - }; - }; + /** + Ends a grouping of property changes. + You can use this method to group property changes so that notifications + will not be sent until the changes are finished. If you plan to make a + large number of changes to an object at one time, you should call + `beginPropertyChanges()` at the beginning of the changes to defer change + notifications. When you are done making changes, call this method to + deliver the deferred change notifications and end deferring. + @method endPropertyChanges + @return {Ember.Observable} + @private + */ + endPropertyChanges: function () { + _emberMetal.endPropertyChanges(); + return this; + }, - return TestOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + Notify the observer system that a property is about to change. + Sometimes you need to change a value directly or indirectly without + actually calling `get()` or `set()` on it. In this case, you can use this + method and `propertyDidChange()` instead. Calling these two methods + together will notify all observers that the property has potentially + changed value. + Note that you must always call `propertyWillChange` and `propertyDidChange` + as a pair. If you do not, it may get the property change groups out of + order and cause notifications to be delivered more often than you would + like. + @method propertyWillChange + @param {String} keyName The property key that is about to change. + @return {Ember.Observable} + @private + */ + propertyWillChange: function (keyName) { + _emberMetal.propertyWillChange(this, keyName); + return this; + }, - exports.TestOpcode = TestOpcode; + /** + Notify the observer system that a property has just changed. + Sometimes you need to change a value directly or indirectly without + actually calling `get()` or `set()` on it. In this case, you can use this + method and `propertyWillChange()` instead. Calling these two methods + together will notify all observers that the property has potentially + changed value. + Note that you must always call `propertyWillChange` and `propertyDidChange` + as a pair. If you do not, it may get the property change groups out of + order and cause notifications to be delivered more often than you would + like. + @method propertyDidChange + @param {String} keyName The property key that has just changed. + @return {Ember.Observable} + @private + */ + propertyDidChange: function (keyName) { + _emberMetal.propertyDidChange(this, keyName); + return this; + }, - var JumpOpcode = (function (_Opcode19) { - babelHelpers.inherits(JumpOpcode, _Opcode19); + /** + Convenience method to call `propertyWillChange` and `propertyDidChange` in + succession. + @method notifyPropertyChange + @param {String} keyName The property key to be notified about. + @return {Ember.Observable} + @public + */ + notifyPropertyChange: function (keyName) { + this.propertyWillChange(keyName); + this.propertyDidChange(keyName); + return this; + }, - function JumpOpcode(target) { - _Opcode19.call(this); - this.target = target; - this.type = "jump"; + /** + Adds an observer on a property. + This is the core method used to register an observer for a property. + Once you call this method, any time the key's value is set, your observer + will be notified. Note that the observers are triggered any time the + value is set, regardless of whether it has actually changed. Your + observer should be prepared to handle that. + ### Observer Methods + Observer methods have the following signature: + ```javascript + export default Ember.Component.extend({ + init() { + this._super(...arguments); + this.addObserver('foo', this, 'fooDidChange'); + }, + fooDidChange(sender, key, value, rev) { + // your code } + }); + ``` + The `sender` is the object that changed. The `key` is the property that + changes. The `value` property is currently reserved and unused. The `rev` + is the last property revision of the object when it changed, which you can + use to detect if the key value has really changed or not. + Usually you will not need the value or revision parameters at + the end. In this case, it is common to write observer methods that take + only a sender and key value as parameters or, if you aren't interested in + any of these values, to write an observer that has no parameters at all. + @method addObserver + @param {String} key The key to observer + @param {Object} target The target object to invoke + @param {String|Function} method The method to invoke. + @public + */ + addObserver: function (key, target, method) { + _emberMetal.addObserver(this, key, target, method); + }, - JumpOpcode.prototype.evaluate = function evaluate(vm) { - vm.goto(this.target); - }; - - JumpOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.target.inspect())] - }; - }; + /** + Remove an observer you have previously registered on this object. Pass + the same key, target, and method you passed to `addObserver()` and your + target will no longer receive notifications. + @method removeObserver + @param {String} key The key to observer + @param {Object} target The target object to invoke + @param {String|Function} method The method to invoke. + @public + */ + removeObserver: function (key, target, method) { + _emberMetal.removeObserver(this, key, target, method); + }, - return JumpOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + Returns `true` if the object currently has observers registered for a + particular key. You can use this method to potentially defer performing + an expensive action until someone begins observing a particular property + on the object. + @method hasObserverFor + @param {String} key Key to check + @return {Boolean} + @private + */ + hasObserverFor: function (key) { + return _emberMetal.hasListeners(this, key + ':change'); + }, - exports.JumpOpcode = JumpOpcode; + /** + Retrieves the value of a property, or a default value in the case that the + property returns `undefined`. + ```javascript + person.getWithDefault('lastName', 'Doe'); + ``` + @method getWithDefault + @param {String} keyName The name of the property to retrieve + @param {Object} defaultValue The value to return if the property value is undefined + @return {Object} The property value or the defaultValue. + @public + */ + getWithDefault: function (keyName, defaultValue) { + return _emberMetal.getWithDefault(this, keyName, defaultValue); + }, - var JumpIfOpcode = (function (_JumpOpcode) { - babelHelpers.inherits(JumpIfOpcode, _JumpOpcode); + /** + Set the value of a property to the current value plus some amount. + ```javascript + person.incrementProperty('age'); + team.incrementProperty('score', 2); + ``` + @method incrementProperty + @param {String} keyName The name of the property to increment + @param {Number} increment The amount to increment by. Defaults to 1 + @return {Number} The new property value + @public + */ + incrementProperty: function (keyName, increment) { + if (_emberMetal.isNone(increment)) { + increment = 1; + } + _emberMetal.assert('Must pass a numeric value to incrementProperty', !isNaN(parseFloat(increment)) && isFinite(increment)); + return _emberMetal.set(this, keyName, (parseFloat(_emberMetal.get(this, keyName)) || 0) + increment); + }, - function JumpIfOpcode() { - _JumpOpcode.apply(this, arguments); - this.type = "jump-if"; - } + /** + Set the value of a property to the current value minus some amount. + ```javascript + player.decrementProperty('lives'); + orc.decrementProperty('health', 5); + ``` + @method decrementProperty + @param {String} keyName The name of the property to decrement + @param {Number} decrement The amount to decrement by. Defaults to 1 + @return {Number} The new property value + @public + */ + decrementProperty: function (keyName, decrement) { + if (_emberMetal.isNone(decrement)) { + decrement = 1; + } + _emberMetal.assert('Must pass a numeric value to decrementProperty', !isNaN(parseFloat(decrement)) && isFinite(decrement)); + return _emberMetal.set(this, keyName, (_emberMetal.get(this, keyName) || 0) - decrement); + }, - JumpIfOpcode.prototype.evaluate = function evaluate(vm) { - var reference = vm.frame.getCondition(); - if (_glimmerReference.isConst(reference)) { - if (reference.value()) { - _JumpOpcode.prototype.evaluate.call(this, vm); - } - } else { - var cache = new _glimmerReference.ReferenceCache(reference); - if (cache.peek()) { - _JumpOpcode.prototype.evaluate.call(this, vm); - } - vm.updateWith(new Assert(cache)); - } - }; + /** + Set the value of a boolean property to the opposite of its + current value. + ```javascript + starship.toggleProperty('warpDriveEngaged'); + ``` + @method toggleProperty + @param {String} keyName The name of the property to toggle + @return {Boolean} The new property value + @public + */ + toggleProperty: function (keyName) { + return _emberMetal.set(this, keyName, !_emberMetal.get(this, keyName)); + }, - return JumpIfOpcode; - })(JumpOpcode); + /** + Returns the cached value of a computed property, if it exists. + This allows you to inspect the value of a computed property + without accidentally invoking it if it is intended to be + generated lazily. + @method cacheFor + @param {String} keyName + @return {Object} The cached value of the computed property, if any + @public + */ + cacheFor: function (keyName) { + return _emberMetal.cacheFor(this, keyName); + }, - exports.JumpIfOpcode = JumpIfOpcode; + // intended for debugging purposes + observersForKey: function (keyName) { + return _emberMetal.observersFor(this, keyName); + } + }); +}); +enifed('ember-runtime/mixins/promise_proxy', ['exports', 'ember-metal', 'ember-runtime/computed/computed_macros'], function (exports, _emberMetal, _emberRuntimeComputedComputed_macros) { + 'use strict'; - var JumpUnlessOpcode = (function (_JumpOpcode2) { - babelHelpers.inherits(JumpUnlessOpcode, _JumpOpcode2); + /** + @module ember + @submodule ember-runtime + */ - function JumpUnlessOpcode() { - _JumpOpcode2.apply(this, arguments); - this.type = "jump-unless"; - } + function tap(proxy, promise) { + _emberMetal.setProperties(proxy, { + isFulfilled: false, + isRejected: false + }); - JumpUnlessOpcode.prototype.evaluate = function evaluate(vm) { - var reference = vm.frame.getCondition(); - if (_glimmerReference.isConst(reference)) { - if (!reference.value()) { - _JumpOpcode2.prototype.evaluate.call(this, vm); - } - } else { - var cache = new _glimmerReference.ReferenceCache(reference); - if (!cache.peek()) { - _JumpOpcode2.prototype.evaluate.call(this, vm); - } - vm.updateWith(new Assert(cache)); - } - }; + return promise.then(function (value) { + if (!proxy.isDestroyed && !proxy.isDestroying) { + _emberMetal.setProperties(proxy, { + content: value, + isFulfilled: true + }); + } + return value; + }, function (reason) { + if (!proxy.isDestroyed && !proxy.isDestroying) { + _emberMetal.setProperties(proxy, { + reason: reason, + isRejected: true + }); + } + throw reason; + }, 'Ember: PromiseProxy'); + } - return JumpUnlessOpcode; - })(JumpOpcode); + /** + A low level mixin making ObjectProxy promise-aware. + + ```javascript + let ObjectPromiseProxy = Ember.ObjectProxy.extend(Ember.PromiseProxyMixin); + + let proxy = ObjectPromiseProxy.create({ + promise: Ember.RSVP.cast($.getJSON('/some/remote/data.json')) + }); + + proxy.then(function(json){ + // the json + }, function(reason) { + // the reason why you have no json + }); + ``` + + the proxy has bindable attributes which + track the promises life cycle + + ```javascript + proxy.get('isPending') //=> true + proxy.get('isSettled') //=> false + proxy.get('isRejected') //=> false + proxy.get('isFulfilled') //=> false + ``` + + When the $.getJSON completes, and the promise is fulfilled + with json, the life cycle attributes will update accordingly. + Note that $.getJSON doesn't return an ECMA specified promise, + it is useful to wrap this with an `RSVP.cast` so that it behaves + as a spec compliant promise. + + ```javascript + proxy.get('isPending') //=> false + proxy.get('isSettled') //=> true + proxy.get('isRejected') //=> false + proxy.get('isFulfilled') //=> true + ``` + + As the proxy is an ObjectProxy, and the json now its content, + all the json properties will be available directly from the proxy. + + ```javascript + // Assuming the following json: + { + firstName: 'Stefan', + lastName: 'Penner' + } + + // both properties will accessible on the proxy + proxy.get('firstName') //=> 'Stefan' + proxy.get('lastName') //=> 'Penner' + ``` + + @class Ember.PromiseProxyMixin + @public + */ + exports.default = _emberMetal.Mixin.create({ + /** + If the proxied promise is rejected this will contain the reason + provided. + @property reason + @default null + @public + */ + reason: null, - exports.JumpUnlessOpcode = JumpUnlessOpcode; + /** + Once the proxied promise has settled this will become `false`. + @property isPending + @default true + @public + */ + isPending: _emberRuntimeComputedComputed_macros.not('isSettled').readOnly(), - var Assert = (function (_UpdatingOpcode) { - babelHelpers.inherits(Assert, _UpdatingOpcode); + /** + Once the proxied promise has settled this will become `true`. + @property isSettled + @default false + @public + */ + isSettled: _emberRuntimeComputedComputed_macros.or('isRejected', 'isFulfilled').readOnly(), - function Assert(cache) { - _UpdatingOpcode.call(this); - this.type = "assert"; - this.tag = cache.tag; - this.cache = cache; - } + /** + Will become `true` if the proxied promise is rejected. + @property isRejected + @default false + @public + */ + isRejected: false, - Assert.prototype.evaluate = function evaluate(vm) { - var cache = this.cache; + /** + Will become `true` if the proxied promise is fulfilled. + @property isFulfilled + @default false + @public + */ + isFulfilled: false, - if (_glimmerReference.isModified(cache.revalidate())) { - vm.throw(); - } - }; + /** + The promise whose fulfillment value is being proxied by this object. + This property must be specified upon creation, and should not be + changed once created. + Example: + ```javascript + Ember.ObjectProxy.extend(Ember.PromiseProxyMixin).create({ + promise: + }); + ``` + @property promise + @public + */ + promise: _emberMetal.computed({ + get: function () { + throw new _emberMetal.Error('PromiseProxy\'s promise must be set'); + }, + set: function (key, promise) { + return tap(this, promise); + } + }), - Assert.prototype.toJSON = function toJSON() { - var type = this.type; - var _guid = this._guid; - var cache = this.cache; + /** + An alias to the proxied promise's `then`. + See RSVP.Promise.then. + @method then + @param {Function} callback + @return {RSVP.Promise} + @public + */ + then: promiseAlias('then'), - var expected = undefined; - try { - expected = JSON.stringify(cache.peek()); - } catch (e) { - expected = String(cache.peek()); - } - return { - guid: _guid, - type: type, - args: [], - details: { expected: expected } - }; - }; + /** + An alias to the proxied promise's `catch`. + See RSVP.Promise.catch. + @method catch + @param {Function} callback + @return {RSVP.Promise} + @since 1.3.0 + @public + */ + 'catch': promiseAlias('catch'), - return Assert; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + /** + An alias to the proxied promise's `finally`. + See RSVP.Promise.finally. + @method finally + @param {Function} callback + @return {RSVP.Promise} + @since 1.3.0 + @public + */ + 'finally': promiseAlias('finally') - exports.Assert = Assert; + }); - var JumpIfNotModifiedOpcode = (function (_UpdatingOpcode2) { - babelHelpers.inherits(JumpIfNotModifiedOpcode, _UpdatingOpcode2); + function promiseAlias(name) { + return function () { + var promise = _emberMetal.get(this, 'promise'); + return promise[name].apply(promise, arguments); + }; + } +}); +enifed('ember-runtime/mixins/registry_proxy', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-runtime + */ - function JumpIfNotModifiedOpcode(tag, target) { - _UpdatingOpcode2.call(this); - this.target = target; - this.type = "jump-if-not-modified"; - this.tag = tag; - this.lastRevision = tag.value(); - } + 'use strict'; - JumpIfNotModifiedOpcode.prototype.evaluate = function evaluate(vm) { - var tag = this.tag; - var target = this.target; - var lastRevision = this.lastRevision; + exports.buildFakeRegistryWithDeprecations = buildFakeRegistryWithDeprecations; - if (!vm.alwaysRevalidate && tag.validate(lastRevision)) { - vm.goto(target); - } - }; + /** + RegistryProxyMixin is used to provide public access to specific + registry functionality. + + @class RegistryProxyMixin + @private + */ + exports.default = _emberMetal.Mixin.create({ + __registry__: null, - JumpIfNotModifiedOpcode.prototype.didModify = function didModify() { - this.lastRevision = this.tag.value(); - }; + /** + Given a fullName return the corresponding factory. + @public + @method resolveRegistration + @param {String} fullName + @return {Function} fullName's factory + */ + resolveRegistration: registryAlias('resolve'), - JumpIfNotModifiedOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.target.inspect())] - }; - }; + /** + Registers a factory that can be used for dependency injection (with + `inject`) or for service lookup. Each factory is registered with + a full name including two parts: `type:name`. + A simple example: + ```javascript + let App = Ember.Application.create(); + App.Orange = Ember.Object.extend(); + App.register('fruit:favorite', App.Orange); + ``` + Ember will resolve factories from the `App` namespace automatically. + For example `App.CarsController` will be discovered and returned if + an application requests `controller:cars`. + An example of registering a controller with a non-standard name: + ```javascript + let App = Ember.Application.create(); + let Session = Ember.Controller.extend(); + App.register('controller:session', Session); + // The Session controller can now be treated like a normal controller, + // despite its non-standard name. + App.ApplicationController = Ember.Controller.extend({ + needs: ['session'] + }); + ``` + Registered factories are **instantiated** by having `create` + called on them. Additionally they are **singletons**, each time + they are looked up they return the same instance. + Some examples modifying that default behavior: + ```javascript + let App = Ember.Application.create(); + App.Person = Ember.Object.extend(); + App.Orange = Ember.Object.extend(); + App.Email = Ember.Object.extend(); + App.session = Ember.Object.create(); + App.register('model:user', App.Person, { singleton: false }); + App.register('fruit:favorite', App.Orange); + App.register('communication:main', App.Email, { singleton: false }); + App.register('session', App.session, { instantiate: false }); + ``` + @method register + @param fullName {String} type:name (e.g., 'model:user') + @param factory {Function} (e.g., App.Person) + @param options {Object} (optional) disable instantiation or singleton usage + @public + */ + register: registryAlias('register'), - return JumpIfNotModifiedOpcode; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + /** + Unregister a factory. + ```javascript + let App = Ember.Application.create(); + let User = Ember.Object.extend(); + App.register('model:user', User); + App.resolveRegistration('model:user').create() instanceof User //=> true + App.unregister('model:user') + App.resolveRegistration('model:user') === undefined //=> true + ``` + @public + @method unregister + @param {String} fullName + */ + unregister: registryAlias('unregister'), - exports.JumpIfNotModifiedOpcode = JumpIfNotModifiedOpcode; + /** + Check if a factory is registered. + @public + @method hasRegistration + @param {String} fullName + @return {Boolean} + */ + hasRegistration: registryAlias('has'), - var DidModifyOpcode = (function (_UpdatingOpcode3) { - babelHelpers.inherits(DidModifyOpcode, _UpdatingOpcode3); + /** + Register an option for a particular factory. + @public + @method registerOption + @param {String} fullName + @param {String} optionName + @param {Object} options + */ + registerOption: registryAlias('option'), - function DidModifyOpcode(target) { - _UpdatingOpcode3.call(this); - this.target = target; - this.type = "did-modify"; - this.tag = _glimmerReference.CONSTANT_TAG; - } + /** + Return a specific registered option for a particular factory. + @public + @method registeredOption + @param {String} fullName + @param {String} optionName + @return {Object} options + */ + registeredOption: registryAlias('getOption'), - DidModifyOpcode.prototype.evaluate = function evaluate() { - this.target.didModify(); - }; + /** + Register options for a particular factory. + @public + @method registerOptions + @param {String} fullName + @param {Object} options + */ + registerOptions: registryAlias('options'), - return DidModifyOpcode; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + /** + Return registered options for a particular factory. + @public + @method registeredOptions + @param {String} fullName + @return {Object} options + */ + registeredOptions: registryAlias('getOptions'), - exports.DidModifyOpcode = DidModifyOpcode; -}); + /** + Allow registering options for all factories of a type. + ```javascript + let App = Ember.Application.create(); + let appInstance = App.buildInstance(); + // if all of type `connection` must not be singletons + appInstance.registerOptionsForType('connection', { singleton: false }); + appInstance.register('connection:twitter', TwitterConnection); + appInstance.register('connection:facebook', FacebookConnection); + let twitter = appInstance.lookup('connection:twitter'); + let twitter2 = appInstance.lookup('connection:twitter'); + twitter === twitter2; // => false + let facebook = appInstance.lookup('connection:facebook'); + let facebook2 = appInstance.lookup('connection:facebook'); + facebook === facebook2; // => false + ``` + @public + @method registerOptionsForType + @param {String} type + @param {Object} options + */ + registerOptionsForType: registryAlias('optionsForType'), -enifed('glimmer-runtime/lib/compiler', ['exports', 'glimmer-util', 'glimmer-runtime/lib/utils', 'glimmer-runtime/lib/syntax/core', 'glimmer-runtime/lib/compiled/blocks', 'glimmer-runtime/lib/compiled/expressions/function', 'glimmer-runtime/lib/compiled/opcodes/builder'], function (exports, _glimmerUtil, _glimmerRuntimeLibUtils, _glimmerRuntimeLibSyntaxCore, _glimmerRuntimeLibCompiledBlocks, _glimmerRuntimeLibCompiledExpressionsFunction, _glimmerRuntimeLibCompiledOpcodesBuilder) { - 'use strict'; + /** + Return the registered options for all factories of a type. + @public + @method registeredOptionsForType + @param {String} type + @return {Object} options + */ + registeredOptionsForType: registryAlias('getOptionsForType'), - exports.compileLayout = compileLayout; + /** + Define a dependency injection onto a specific factory or all factories + of a type. + When Ember instantiates a controller, view, or other framework component + it can attach a dependency to that component. This is often used to + provide services to a set of framework components. + An example of providing a session object to all controllers: + ```javascript + let App = Ember.Application.create(); + let Session = Ember.Object.extend({ isAuthenticated: false }); + // A factory must be registered before it can be injected + App.register('session:main', Session); + // Inject 'session:main' onto all factories of the type 'controller' + // with the name 'session' + App.inject('controller', 'session', 'session:main'); + App.IndexController = Ember.Controller.extend({ + isLoggedIn: Ember.computed.alias('session.isAuthenticated') + }); + ``` + Injections can also be performed on specific factories. + ```javascript + App.inject(, , ) + App.inject('route', 'source', 'source:main') + App.inject('route:application', 'email', 'model:email') + ``` + It is important to note that injections can only be performed on + classes that are instantiated by Ember itself. Instantiating a class + directly (via `create` or `new`) bypasses the dependency injection + system. + **Note:** Ember-Data instantiates its models in a unique manner, and consequently + injections onto models (or all models) will not work as expected. Injections + on models can be enabled by setting `EmberENV.MODEL_FACTORY_INJECTIONS` + to `true`. + @public + @method inject + @param factoryNameOrType {String} + @param property {String} + @param injectionName {String} + **/ + inject: registryAlias('injection') + }); - var Compiler = (function () { - function Compiler(block, env) { - this.block = block; - this.env = env; - this.current = block.program.head(); - this.symbolTable = block.symbolTable; - } + function registryAlias(name) { + return function () { + var _registry__; - Compiler.prototype.compileStatement = function compileStatement(statement, ops) { - this.env.statement(statement, this.symbolTable).compile(ops, this.env, this.symbolTable); - }; + return (_registry__ = this.__registry__)[name].apply(_registry__, arguments); + }; + } - return Compiler; - })(); + function buildFakeRegistryWithDeprecations(instance, typeForMessage) { + var fakeRegistry = {}; + var registryProps = { + resolve: 'resolveRegistration', + register: 'register', + unregister: 'unregister', + has: 'hasRegistration', + option: 'registerOption', + options: 'registerOptions', + getOptions: 'registeredOptions', + optionsForType: 'registerOptionsForType', + getOptionsForType: 'registeredOptionsForType', + injection: 'inject' + }; - function compileStatement(env, statement, ops, layout) { - env.statement(statement, layout.symbolTable).compile(ops, env, layout.symbolTable); + for (var deprecatedProperty in registryProps) { + fakeRegistry[deprecatedProperty] = buildFakeRegistryFunction(instance, typeForMessage, deprecatedProperty, registryProps[deprecatedProperty]); } - exports.default = Compiler; - var EntryPointCompiler = (function (_Compiler) { - babelHelpers.inherits(EntryPointCompiler, _Compiler); - - function EntryPointCompiler(template, env) { - _Compiler.call(this, template, env); - var list = new CompileIntoList(env, template.symbolTable); - this.ops = new _glimmerRuntimeLibCompiledOpcodesBuilder.default(list, template.symbolTable, env); - } + return fakeRegistry; + } - EntryPointCompiler.prototype.compile = function compile() { - var block = this.block; - var ops = this.ops; - var program = block.program; + function buildFakeRegistryFunction(instance, typeForMessage, deprecatedProperty, nonDeprecatedProperty) { + return function () { + _emberMetal.deprecate('Using `' + typeForMessage + '.registry.' + deprecatedProperty + '` is deprecated. Please use `' + typeForMessage + '.' + nonDeprecatedProperty + '` instead.', false, { + id: 'ember-application.app-instance-registry', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-application-registry-ember-applicationinstance-registry' + }); + return instance[nonDeprecatedProperty].apply(instance, arguments); + }; + } +}); +enifed('ember-runtime/mixins/target_action_support', ['exports', 'ember-environment', 'ember-metal'], function (exports, _emberEnvironment, _emberMetal) { + /** + @module ember + @submodule ember-runtime + */ - var current = program.head(); - while (current) { - var next = program.nextNode(current); - this.compileStatement(current, ops); - current = next; - } - return ops.toOpSeq(); - }; + 'use strict'; - EntryPointCompiler.prototype.append = function append(op) { - this.ops.append(op); - }; + /** + `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 + usually the best choice. This mixin is most often useful when you are + doing more complex event handling in Components. + + @class TargetActionSupport + @namespace Ember + @extends Ember.Mixin + @private + */ + exports.default = _emberMetal.Mixin.create({ + target: null, + action: null, + actionContext: null, - EntryPointCompiler.prototype.getLocalSymbol = function getLocalSymbol(name) { - return this.symbolTable.getLocal(name); - }; + actionContextObject: _emberMetal.computed('actionContext', function () { + var actionContext = _emberMetal.get(this, 'actionContext'); - EntryPointCompiler.prototype.getNamedSymbol = function getNamedSymbol(name) { - return this.symbolTable.getNamed(name); - }; + if (typeof actionContext === 'string') { + var value = _emberMetal.get(this, actionContext); + if (value === undefined) { + value = _emberMetal.get(_emberEnvironment.context.lookup, actionContext); + } + return value; + } else { + return actionContext; + } + }), - EntryPointCompiler.prototype.getYieldSymbol = function getYieldSymbol(name) { - return this.symbolTable.getYield(name); - }; + /** + Send an `action` with an `actionContext` to a `target`. The action, actionContext + and target will be retrieved from properties of the object. For example: + ```javascript + App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, { + target: Ember.computed.alias('controller'), + action: 'save', + actionContext: Ember.computed.alias('context'), + click() { + this.triggerAction(); // Sends the `save` action, along with the current context + // to the current controller + } + }); + ``` + The `target`, `action`, and `actionContext` can be provided as properties of + an optional object argument to `triggerAction` as well. + ```javascript + App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, { + click() { + this.triggerAction({ + action: 'save', + target: this.get('controller'), + actionContext: this.get('context') + }); // Sends the `save` action, along with the current context + // to the current controller + } + }); + ``` + The `actionContext` defaults to the object you are mixing `TargetActionSupport` into. + But `target` and `action` must be specified either as properties or with the argument + to `triggerAction`, or a combination: + ```javascript + App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, { + target: Ember.computed.alias('controller'), + click() { + this.triggerAction({ + action: 'save' + }); // Sends the `save` action, along with a reference to `this`, + // to the current controller + } + }); + ``` + @method triggerAction + @param opts {Object} (optional, with the optional keys action, target and/or actionContext) + @return {Boolean} true if the action was sent successfully and did not return false + @private + */ + triggerAction: function () { + var opts = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - return EntryPointCompiler; - })(Compiler); + var action = opts.action || _emberMetal.get(this, 'action'); + var target = opts.target; - exports.EntryPointCompiler = EntryPointCompiler; + if (!target) { + target = getTarget(this); + } - var InlineBlockCompiler = (function (_Compiler2) { - babelHelpers.inherits(InlineBlockCompiler, _Compiler2); + var actionContext = opts.actionContext; - function InlineBlockCompiler(block, env) { - _Compiler2.call(this, block, env); - this.block = block; - var list = new CompileIntoList(env, block.symbolTable); - this.ops = new _glimmerRuntimeLibCompiledOpcodesBuilder.default(list, block.symbolTable, env); + function args(options, actionName) { + var ret = []; + if (actionName) { + ret.push(actionName); } - InlineBlockCompiler.prototype.compile = function compile() { - var block = this.block; - var ops = this.ops; - var program = block.program; + return ret.concat(options); + } - var hasPositionalParameters = block.hasPositionalParameters(); - if (hasPositionalParameters) { - ops.pushChildScope(); - ops.bindPositionalArgsForBlock(block); - } - var current = program.head(); - while (current) { - var next = program.nextNode(current); - this.compileStatement(current, ops); - current = next; - } - if (hasPositionalParameters) { - ops.popScope(); - } - return ops.toOpSeq(); - }; + if (typeof actionContext === 'undefined') { + actionContext = _emberMetal.get(this, 'actionContextObject') || this; + } - return InlineBlockCompiler; - })(Compiler); + if (target && action) { + var ret = undefined; - exports.InlineBlockCompiler = InlineBlockCompiler; + if (target.send) { + var _target; - function compileLayout(compilable, env) { - var builder = new ComponentLayoutBuilder(env); - compilable.compile(builder); - return builder.compile(); - } + ret = (_target = target).send.apply(_target, args(actionContext, action)); + } else { + var _target2; - var ComponentLayoutBuilder = (function () { - function ComponentLayoutBuilder(env) { - this.env = env; + _emberMetal.assert('The action \'' + action + '\' did not exist on ' + target, typeof target[action] === 'function'); + ret = (_target2 = target)[action].apply(_target2, args(actionContext)); } - ComponentLayoutBuilder.prototype.empty = function empty() { - this.inner = new EmptyBuilder(this.env); - }; - - ComponentLayoutBuilder.prototype.wrapLayout = function wrapLayout(layout) { - this.inner = new WrappedBuilder(this.env, layout); - }; - - ComponentLayoutBuilder.prototype.fromLayout = function fromLayout(layout) { - this.inner = new UnwrappedBuilder(this.env, layout); - }; - - ComponentLayoutBuilder.prototype.compile = function compile() { - return this.inner.compile(); - }; - - babelHelpers.createClass(ComponentLayoutBuilder, [{ - key: 'tag', - get: function () { - return this.inner.tag; - } - }, { - key: 'attrs', - get: function () { - return this.inner.attrs; - } - }]); - return ComponentLayoutBuilder; - })(); - - var EmptyBuilder = (function () { - function EmptyBuilder(env) { - this.env = env; + if (ret !== false) { + ret = true; } - EmptyBuilder.prototype.compile = function compile() { - var env = this.env; - - var list = new CompileIntoList(env, null); - return new _glimmerRuntimeLibCompiledBlocks.CompiledBlock(list, 0); - }; - - babelHelpers.createClass(EmptyBuilder, [{ - key: 'tag', - get: function () { - throw new Error('Nope'); - } - }, { - key: 'attrs', - get: function () { - throw new Error('Nope'); - } - }]); - return EmptyBuilder; - })(); - - var WrappedBuilder = (function () { - function WrappedBuilder(env, layout) { - this.env = env; - this.layout = layout; - this.tag = new ComponentTagBuilder(); - this.attrs = new ComponentAttrsBuilder(); - } - - WrappedBuilder.prototype.compile = function compile() { - //========DYNAMIC - // PutValue(TagExpr) - // Test - // JumpUnless(BODY) - // OpenDynamicPrimitiveElement - // DidCreateElement - // ...attr statements... - // FlushElement - // BODY: Noop - // ...body statements... - // PutValue(TagExpr) - // Test - // JumpUnless(END) - // CloseElement - // END: Noop - // DidRenderLayout - // Exit - // - //========STATIC - // OpenPrimitiveElementOpcode - // DidCreateElement - // ...attr statements... - // FlushElement - // ...body statements... - // CloseElement - // DidRenderLayout - // Exit - var env = this.env; - var layout = this.layout; - - var symbolTable = layout.symbolTable; - var buffer = new CompileIntoList(env, layout.symbolTable); - var dsl = new _glimmerRuntimeLibCompiledOpcodesBuilder.default(buffer, layout.symbolTable, env); - dsl.startLabels(); - if (this.tag.isDynamic) { - dsl.putValue(this.tag.dynamicTagName); - dsl.test('simple'); - dsl.jumpUnless('BODY'); - dsl.openDynamicPrimitiveElement(); - dsl.didCreateElement(); - this.attrs['buffer'].forEach(function (statement) { - return compileStatement(env, statement, dsl, layout); - }); - dsl.flushElement(); - dsl.label('BODY'); - } else if (this.tag.isStatic) { - var tag = this.tag.staticTagName; - dsl.openPrimitiveElement(tag); - dsl.didCreateElement(); - this.attrs['buffer'].forEach(function (statement) { - return compileStatement(env, statement, dsl, layout); - }); - dsl.flushElement(); - } - dsl.preludeForLayout(layout); - layout.program.forEachNode(function (statement) { - return compileStatement(env, statement, dsl, layout); - }); - if (this.tag.isDynamic) { - dsl.putValue(this.tag.dynamicTagName); - dsl.test('simple'); - dsl.jumpUnless('END'); - dsl.closeElement(); - dsl.label('END'); - } else if (this.tag.isStatic) { - dsl.closeElement(); - } - dsl.didRenderLayout(); - dsl.stopLabels(); - return new _glimmerRuntimeLibCompiledBlocks.CompiledBlock(dsl.toOpSeq(), symbolTable.size); - }; - - return WrappedBuilder; - })(); + return ret; + } else { + return false; + } + } + }); - var UnwrappedBuilder = (function () { - function UnwrappedBuilder(env, layout) { - this.env = env; - this.layout = layout; - this.attrs = new ComponentAttrsBuilder(); - } - - UnwrappedBuilder.prototype.compile = function compile() { - var env = this.env; - var layout = this.layout; - - var buffer = new CompileIntoList(env, layout.symbolTable); - var dsl = new _glimmerRuntimeLibCompiledOpcodesBuilder.default(buffer, layout.symbolTable, env); - dsl.startLabels(); - dsl.preludeForLayout(layout); - var attrs = this.attrs['buffer']; - var attrsInserted = false; - this.layout.program.forEachNode(function (statement) { - if (!attrsInserted && isOpenElement(statement)) { - dsl.openComponentElement(statement.tag); - dsl.didCreateElement(); - dsl.shadowAttributes(); - attrs.forEach(function (statement) { - return compileStatement(env, statement, dsl, layout); - }); - attrsInserted = true; - } else { - compileStatement(env, statement, dsl, layout); - } - }); - dsl.didRenderLayout(); - dsl.stopLabels(); - return new _glimmerRuntimeLibCompiledBlocks.CompiledBlock(dsl.toOpSeq(), layout.symbolTable.size); - }; + function getTarget(instance) { + // TODO: Deprecate specifying `targetObject` + var target = _emberMetal.get(instance, 'targetObject'); - babelHelpers.createClass(UnwrappedBuilder, [{ - key: 'tag', - get: function () { - throw new Error('BUG: Cannot call `tag` on an UnwrappedBuilder'); - } - }]); - return UnwrappedBuilder; - })(); + // if a `targetObject` CP was provided, use it + if (target) { + return target; + } - function isOpenElement(syntax) { - return syntax instanceof _glimmerRuntimeLibSyntaxCore.OpenElement || syntax instanceof _glimmerRuntimeLibSyntaxCore.OpenPrimitiveElement; + // if _targetObject use it + if (instance._targetObject) { + return instance._targetObject; } - var ComponentTagBuilder = (function () { - function ComponentTagBuilder() { - this.isDynamic = null; - this.isStatic = null; - this.staticTagName = null; - this.dynamicTagName = null; + target = _emberMetal.get(instance, 'target'); + if (target) { + if (typeof target === 'string') { + var value = _emberMetal.get(instance, target); + if (value === undefined) { + value = _emberMetal.get(_emberEnvironment.context.lookup, target); } - ComponentTagBuilder.prototype.static = function _static(tagName) { - this.isStatic = true; - this.staticTagName = tagName; - }; - - ComponentTagBuilder.prototype.dynamic = function dynamic(tagName) { - this.isDynamic = true; - this.dynamicTagName = _glimmerRuntimeLibCompiledExpressionsFunction.default(tagName); - }; - - return ComponentTagBuilder; - })(); - - var ComponentAttrsBuilder = (function () { - function ComponentAttrsBuilder() { - this.buffer = []; - } + return value; + } else { + return target; + } + } - ComponentAttrsBuilder.prototype.static = function _static(name, value) { - this.buffer.push(new _glimmerRuntimeLibSyntaxCore.StaticAttr(name, value, null)); - }; + return null; + } +}); +enifed("ember-runtime/string_registry", ["exports"], function (exports) { + // STATE within a module is frowned apon, this exists + // to support Ember.STRINGS but shield ember internals from this legacy global + // API. + "use strict"; - ComponentAttrsBuilder.prototype.dynamic = function dynamic(name, value) { - this.buffer.push(new _glimmerRuntimeLibSyntaxCore.DynamicAttr(name, _glimmerRuntimeLibCompiledExpressionsFunction.default(value), null, false)); - }; + exports.setStrings = setStrings; + exports.getStrings = getStrings; + exports.get = get; + var STRINGS = {}; - return ComponentAttrsBuilder; - })(); + function setStrings(strings) { + STRINGS = strings; + } - var ComponentBuilder = (function () { - function ComponentBuilder(dsl) { - this.dsl = dsl; - this.env = dsl.env; - } + function getStrings() { + return STRINGS; + } - ComponentBuilder.prototype.static = function _static(definition, args, symbolTable) { - var shadow = arguments.length <= 3 || arguments[3] === undefined ? _glimmerRuntimeLibUtils.EMPTY_ARRAY : arguments[3]; + function get(name) { + return STRINGS[name]; + } +}); +enifed('ember-runtime/system/application', ['exports', 'ember-runtime/system/namespace'], function (exports, _emberRuntimeSystemNamespace) { + 'use strict'; - this.dsl.unit(function (dsl) { - dsl.putComponentDefinition(definition); - dsl.openComponent(args, shadow); - dsl.closeComponent(); - }); - }; + exports.default = _emberRuntimeSystemNamespace.default.extend(); +}); +enifed('ember-runtime/system/array_proxy', ['exports', 'ember-metal', 'ember-runtime/utils', 'ember-runtime/system/object', 'ember-runtime/mixins/mutable_array', 'ember-runtime/mixins/enumerable', 'ember-runtime/mixins/array'], function (exports, _emberMetal, _emberRuntimeUtils, _emberRuntimeSystemObject, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsArray) { + 'use strict'; - ComponentBuilder.prototype.dynamic = function dynamic(definitionArgs, definition, args, symbolTable) { - var shadow = arguments.length <= 4 || arguments[4] === undefined ? _glimmerRuntimeLibUtils.EMPTY_ARRAY : arguments[4]; - - this.dsl.unit(function (dsl) { - dsl.putArgs(definitionArgs); - dsl.putValue(_glimmerRuntimeLibCompiledExpressionsFunction.default(definition)); - dsl.test('simple'); - dsl.enter('BEGIN', 'END'); - dsl.label('BEGIN'); - dsl.jumpUnless('END'); - dsl.putDynamicComponentDefinition(); - dsl.openComponent(args, shadow); - dsl.closeComponent(); - dsl.label('END'); - dsl.exit(); - }); - }; + /** + @module ember + @submodule ember-runtime + */ - return ComponentBuilder; - })(); + var OUT_OF_RANGE_EXCEPTION = 'Index out of range'; + var EMPTY = []; - var CompileIntoList = (function (_LinkedList) { - babelHelpers.inherits(CompileIntoList, _LinkedList); + function K() { + return this; + } - function CompileIntoList(env, symbolTable) { - _LinkedList.call(this); - this.env = env; - this.symbolTable = symbolTable; - var dsl = new _glimmerRuntimeLibCompiledOpcodesBuilder.default(this, symbolTable, env); - this.component = new ComponentBuilder(dsl); + /** + An ArrayProxy wraps any other object that implements `Ember.Array` and/or + `Ember.MutableArray,` forwarding all requests. This makes it very useful for + a number of binding use cases or other cases where being able to swap + out the underlying array is useful. + + A simple example of usage: + + ```javascript + let pets = ['dog', 'cat', 'fish']; + let ap = Ember.ArrayProxy.create({ content: Ember.A(pets) }); + + ap.get('firstObject'); // 'dog' + ap.set('content', ['amoeba', 'paramecium']); + ap.get('firstObject'); // 'amoeba' + ``` + + This class can also be useful as a layer to transform the contents of + an array, as they are accessed. This can be done by overriding + `objectAtContent`: + + ```javascript + let pets = ['dog', 'cat', 'fish']; + let ap = Ember.ArrayProxy.create({ + content: Ember.A(pets), + objectAtContent: function(idx) { + return this.get('content').objectAt(idx).toUpperCase(); } + }); + + ap.get('firstObject'); // . 'DOG' + ``` + + @class ArrayProxy + @namespace Ember + @extends Ember.Object + @uses Ember.MutableArray + @public + */ + exports.default = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsMutable_array.default, { - CompileIntoList.prototype.getLocalSymbol = function getLocalSymbol(name) { - return this.symbolTable.getLocal(name); - }; - - CompileIntoList.prototype.hasLocalSymbol = function hasLocalSymbol(name) { - return typeof this.symbolTable.getLocal(name) === 'number'; - }; - - CompileIntoList.prototype.getNamedSymbol = function getNamedSymbol(name) { - return this.symbolTable.getNamed(name); - }; - - CompileIntoList.prototype.hasNamedSymbol = function hasNamedSymbol(name) { - return typeof this.symbolTable.getNamed(name) === 'number'; - }; - - CompileIntoList.prototype.getBlockSymbol = function getBlockSymbol(name) { - return this.symbolTable.getYield(name); - }; - - CompileIntoList.prototype.hasBlockSymbol = function hasBlockSymbol(name) { - return typeof this.symbolTable.getYield(name) === 'number'; - }; - - CompileIntoList.prototype.getPartialArgsSymbol = function getPartialArgsSymbol() { - return this.symbolTable.getPartialArgs(); - }; - - CompileIntoList.prototype.hasPartialArgsSymbol = function hasPartialArgsSymbol() { - return typeof this.symbolTable.getPartialArgs() === 'number'; - }; + /** + The content array. Must be an object that implements `Ember.Array` and/or + `Ember.MutableArray.` + @property content + @type Ember.Array + @private + */ + content: null, - CompileIntoList.prototype.toOpSeq = function toOpSeq() { - return this; - }; + /** + The array that the proxy pretends to be. In the default `ArrayProxy` + implementation, this and `content` are the same. Subclasses of `ArrayProxy` + can override this property to provide things like sorting and filtering. + @property arrangedContent + @private + */ + arrangedContent: _emberMetal.alias('content'), - return CompileIntoList; - })(_glimmerUtil.LinkedList); + /** + Should actually retrieve the object at the specified index from the + content. You can override this method in subclasses to transform the + content item to something new. + This method will only be called if content is non-`null`. + @method objectAtContent + @param {Number} idx The index to retrieve. + @return {Object} the value or undefined if none found + @public + */ + objectAtContent: function (idx) { + return _emberRuntimeMixinsArray.objectAt(_emberMetal.get(this, 'arrangedContent'), idx); + }, - exports.CompileIntoList = CompileIntoList; -}); + /** + Should actually replace the specified objects on the content array. + You can override this method in subclasses to transform the content item + into something new. + This method will only be called if content is non-`null`. + @method replaceContent + @param {Number} idx The starting index + @param {Number} amt The number of items to remove from the content. + @param {Array} objects Optional array of objects to insert or null if no + objects. + @return {void} + @private + */ + replaceContent: function (idx, amt, objects) { + _emberMetal.get(this, 'content').replace(idx, amt, objects); + }, -enifed('glimmer-runtime/lib/component/interfaces', ['exports'], function (exports) { - 'use strict'; + /** + Invoked when the content property is about to change. Notifies observers that the + entire array content will change. + @private + @method _contentWillChange + */ + _contentWillChange: _emberMetal._beforeObserver('content', function () { + this._teardownContent(); + }), - exports.isComponentDefinition = isComponentDefinition; - var COMPONENT_DEFINITION_BRAND = 'COMPONENT DEFINITION [id=e59c754e-61eb-4392-8c4a-2c0ac72bfcd4]'; + _teardownContent: function () { + var content = _emberMetal.get(this, 'content'); - function isComponentDefinition(obj) { - return typeof obj === 'object' && obj && obj[COMPONENT_DEFINITION_BRAND]; - } + if (content) { + _emberRuntimeMixinsArray.removeArrayObserver(content, this, { + willChange: 'contentArrayWillChange', + didChange: 'contentArrayDidChange' + }); + } + }, - var ComponentDefinition = function ComponentDefinition(name, manager, ComponentClass) { - this['COMPONENT DEFINITION [id=e59c754e-61eb-4392-8c4a-2c0ac72bfcd4]'] = true; - this.name = name; - this.manager = manager; - this.ComponentClass = ComponentClass; - }; + /** + Override to implement content array `willChange` observer. + @method contentArrayWillChange + @param {Ember.Array} contentArray the content array + @param {Number} start starting index of the change + @param {Number} removeCount count of items removed + @param {Number} addCount count of items added + @private + */ + contentArrayWillChange: K, + /** + Override to implement content array `didChange` observer. + @method contentArrayDidChange + @param {Ember.Array} contentArray the content array + @param {Number} start starting index of the change + @param {Number} removeCount count of items removed + @param {Number} addCount count of items added + @private + */ + contentArrayDidChange: K, - exports.ComponentDefinition = ComponentDefinition; -}); + /** + Invoked when the content property changes. Notifies observers that the + entire array content has changed. + @private + @method _contentDidChange + */ + _contentDidChange: _emberMetal.observer('content', function () { + var content = _emberMetal.get(this, 'content'); -enifed('glimmer-runtime/lib/dom/attribute-managers', ['exports', 'glimmer-runtime/lib/dom/sanitized-values', 'glimmer-runtime/lib/dom/props', 'glimmer-runtime/lib/dom/helper', 'glimmer-runtime/lib/compiled/opcodes/content'], function (exports, _glimmerRuntimeLibDomSanitizedValues, _glimmerRuntimeLibDomProps, _glimmerRuntimeLibDomHelper, _glimmerRuntimeLibCompiledOpcodesContent) { - 'use strict'; + _emberMetal.assert('Can\'t set ArrayProxy\'s content to itself', content !== this); - exports.defaultManagers = defaultManagers; - exports.defaultPropertyManagers = defaultPropertyManagers; - exports.defaultAttributeManagers = defaultAttributeManagers; - exports.readDOMAttr = readDOMAttr; + this._setupContent(); + }), - function defaultManagers(element, attr, isTrusting, namespace) { - var tagName = element.tagName; - var isSVG = element.namespaceURI === _glimmerRuntimeLibDomHelper.SVG_NAMESPACE; - if (isSVG) { - return defaultAttributeManagers(tagName, attr); - } + _setupContent: function () { + var content = _emberMetal.get(this, 'content'); - var _normalizeProperty = _glimmerRuntimeLibDomProps.normalizeProperty(element, attr); + if (content) { + _emberMetal.assert('ArrayProxy expects an Array or Ember.ArrayProxy, but you passed ' + typeof content, _emberRuntimeUtils.isArray(content) || content.isDestroyed); - var type = _normalizeProperty.type; - var normalized = _normalizeProperty.normalized; + _emberRuntimeMixinsArray.addArrayObserver(content, this, { + willChange: 'contentArrayWillChange', + didChange: 'contentArrayDidChange' + }); + } + }, - if (type === 'attr') { - return defaultAttributeManagers(tagName, normalized); - } else { - return defaultPropertyManagers(tagName, normalized); - } - } + _arrangedContentWillChange: _emberMetal._beforeObserver('arrangedContent', function () { + var arrangedContent = _emberMetal.get(this, 'arrangedContent'); + var len = arrangedContent ? _emberMetal.get(arrangedContent, 'length') : 0; - function defaultPropertyManagers(tagName, attr) { - if (_glimmerRuntimeLibDomSanitizedValues.requiresSanitization(tagName, attr)) { - return new SafePropertyManager(attr); - } - if (isUserInputValue(tagName, attr)) { - return INPUT_VALUE_PROPERTY_MANAGER; - } - if (isOptionSelected(tagName, attr)) { - return OPTION_SELECTED_MANAGER; - } - return new PropertyManager(attr); - } + this.arrangedContentArrayWillChange(this, 0, len, undefined); + this.arrangedContentWillChange(this); - function defaultAttributeManagers(tagName, attr) { - if (_glimmerRuntimeLibDomSanitizedValues.requiresSanitization(tagName, attr)) { - return new SafeAttributeManager(attr); - } - return new AttributeManager(attr); - } + this._teardownArrangedContent(arrangedContent); + }), - function readDOMAttr(element, attr) { - var isSVG = element.namespaceURI === _glimmerRuntimeLibDomHelper.SVG_NAMESPACE; + _arrangedContentDidChange: _emberMetal.observer('arrangedContent', function () { + var arrangedContent = _emberMetal.get(this, 'arrangedContent'); + var len = arrangedContent ? _emberMetal.get(arrangedContent, 'length') : 0; - var _normalizeProperty2 = _glimmerRuntimeLibDomProps.normalizeProperty(element, attr); + _emberMetal.assert('Can\'t set ArrayProxy\'s content to itself', arrangedContent !== this); - var type = _normalizeProperty2.type; - var normalized = _normalizeProperty2.normalized; + this._setupArrangedContent(); - if (isSVG) { - return element.getAttribute(normalized); - } - if (type === 'attr') { - return element.getAttribute(normalized); - } - { - return element[normalized]; - } - } + this.arrangedContentDidChange(this); + this.arrangedContentArrayDidChange(this, 0, undefined, len); + }), - ; + _setupArrangedContent: function () { + var arrangedContent = _emberMetal.get(this, 'arrangedContent'); - var AttributeManager = (function () { - function AttributeManager(attr) { - this.attr = attr; - } + if (arrangedContent) { + _emberMetal.assert('ArrayProxy expects an Array or Ember.ArrayProxy, but you passed ' + typeof arrangedContent, _emberRuntimeUtils.isArray(arrangedContent) || arrangedContent.isDestroyed); - AttributeManager.prototype.setAttribute = function setAttribute(env, element, value, namespace) { - var dom = env.getAppendOperations(); - var normalizedValue = normalizeAttributeValue(value); - if (!isAttrRemovalValue(normalizedValue)) { - dom.setAttribute(element, this.attr, normalizedValue, namespace); - } - }; + _emberRuntimeMixinsArray.addArrayObserver(arrangedContent, this, { + willChange: 'arrangedContentArrayWillChange', + didChange: 'arrangedContentArrayDidChange' + }); + } + }, - AttributeManager.prototype.updateAttribute = function updateAttribute(env, element, value, namespace) { - if (value === null || value === undefined || value === false) { - if (namespace) { - env.getDOM().removeAttributeNS(element, namespace, this.attr); - } else { - env.getDOM().removeAttribute(element, this.attr); - } - } else { - this.setAttribute(env, element, value); - } - }; + _teardownArrangedContent: function () { + var arrangedContent = _emberMetal.get(this, 'arrangedContent'); - return AttributeManager; - })(); + if (arrangedContent) { + _emberRuntimeMixinsArray.removeArrayObserver(arrangedContent, this, { + willChange: 'arrangedContentArrayWillChange', + didChange: 'arrangedContentArrayDidChange' + }); + } + }, - exports.AttributeManager = AttributeManager; + arrangedContentWillChange: K, + arrangedContentDidChange: K, - ; + objectAt: function (idx) { + return _emberMetal.get(this, 'content') && this.objectAtContent(idx); + }, - var PropertyManager = (function (_AttributeManager) { - babelHelpers.inherits(PropertyManager, _AttributeManager); + length: _emberMetal.computed(function () { + var arrangedContent = _emberMetal.get(this, 'arrangedContent'); + return arrangedContent ? _emberMetal.get(arrangedContent, 'length') : 0; + // No dependencies since Enumerable notifies length of change + }), - function PropertyManager() { - _AttributeManager.apply(this, arguments); - } + _replace: function (idx, amt, objects) { + var content = _emberMetal.get(this, 'content'); + _emberMetal.assert('The content property of ' + this.constructor + ' should be set before modifying it', content); + if (content) { + this.replaceContent(idx, amt, objects); + } - PropertyManager.prototype.setAttribute = function setAttribute(env, element, value, namespace) { - if (!isAttrRemovalValue(value)) { - element[this.attr] = value; - } - }; + return this; + }, - PropertyManager.prototype.removeAttribute = function removeAttribute(env, element, namespace) { - // TODO this sucks but to preserve properties first and to meet current - // semantics we must do this. - var attr = this.attr; + replace: function () { + if (_emberMetal.get(this, 'arrangedContent') === _emberMetal.get(this, 'content')) { + this._replace.apply(this, arguments); + } else { + throw new _emberMetal.Error('Using replace on an arranged ArrayProxy is not allowed.'); + } + }, - if (namespace) { - env.getDOM().removeAttributeNS(element, namespace, attr); - } else { - env.getDOM().removeAttribute(element, attr); - } - }; + _insertAt: function (idx, object) { + if (idx > _emberMetal.get(this, 'content.length')) { + throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); + } - PropertyManager.prototype.updateAttribute = function updateAttribute(env, element, value, namespace) { - // ensure the property is always updated - element[this.attr] = value; - if (isAttrRemovalValue(value)) { - this.removeAttribute(env, element, namespace); - } - }; + this._replace(idx, 0, [object]); + return this; + }, - return PropertyManager; - })(AttributeManager); + insertAt: function (idx, object) { + if (_emberMetal.get(this, 'arrangedContent') === _emberMetal.get(this, 'content')) { + return this._insertAt(idx, object); + } else { + throw new _emberMetal.Error('Using insertAt on an arranged ArrayProxy is not allowed.'); + } + }, - exports.PropertyManager = PropertyManager; + removeAt: function (start, len) { + if ('number' === typeof start) { + var content = _emberMetal.get(this, 'content'); + var arrangedContent = _emberMetal.get(this, 'arrangedContent'); + var indices = []; - ; - function normalizeAttributeValue(value) { - if (value === false || value === undefined || value === null) { - return null; - } - if (value === true) { - return ''; - } - // onclick function etc in SSR - if (typeof value === 'function') { - return null; + if (start < 0 || start >= _emberMetal.get(this, 'length')) { + throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); } - return String(value); - } - function isAttrRemovalValue(value) { - return value === null || value === undefined; - } - var SafePropertyManager = (function (_PropertyManager) { - babelHelpers.inherits(SafePropertyManager, _PropertyManager); - - function SafePropertyManager() { - _PropertyManager.apply(this, arguments); + if (len === undefined) { + len = 1; } - SafePropertyManager.prototype.setAttribute = function setAttribute(env, element, value) { - _PropertyManager.prototype.setAttribute.call(this, env, element, _glimmerRuntimeLibDomSanitizedValues.sanitizeAttributeValue(env, element, this.attr, value)); - }; - - SafePropertyManager.prototype.updateAttribute = function updateAttribute(env, element, value) { - _PropertyManager.prototype.updateAttribute.call(this, env, element, _glimmerRuntimeLibDomSanitizedValues.sanitizeAttributeValue(env, element, this.attr, value)); - }; - - return SafePropertyManager; - })(PropertyManager); - - function isUserInputValue(tagName, attribute) { - return (tagName === 'INPUT' || tagName === 'TEXTAREA') && attribute === 'value'; - } - - var InputValuePropertyManager = (function (_AttributeManager2) { - babelHelpers.inherits(InputValuePropertyManager, _AttributeManager2); - - function InputValuePropertyManager() { - _AttributeManager2.apply(this, arguments); + // Get a list of indices in original content to remove + for (var i = start; i < start + len; i++) { + // Use arrangedContent here so we avoid confusion with objects transformed by objectAtContent + indices.push(content.indexOf(_emberRuntimeMixinsArray.objectAt(arrangedContent, i))); } - InputValuePropertyManager.prototype.setAttribute = function setAttribute(env, element, value) { - var input = element; - input.value = _glimmerRuntimeLibCompiledOpcodesContent.normalizeTextValue(value); - }; - - InputValuePropertyManager.prototype.updateAttribute = function updateAttribute(env, element, value) { - var input = element; - var currentValue = input.value; - var normalizedValue = _glimmerRuntimeLibCompiledOpcodesContent.normalizeTextValue(value); - if (currentValue !== normalizedValue) { - input.value = normalizedValue; - } - }; - - return InputValuePropertyManager; - })(AttributeManager); - - var INPUT_VALUE_PROPERTY_MANAGER = new InputValuePropertyManager('value'); - exports.INPUT_VALUE_PROPERTY_MANAGER = INPUT_VALUE_PROPERTY_MANAGER; - function isOptionSelected(tagName, attribute) { - return tagName === 'OPTION' && attribute === 'selected'; - } - - var OptionSelectedManager = (function (_PropertyManager2) { - babelHelpers.inherits(OptionSelectedManager, _PropertyManager2); + // Replace in reverse order since indices will change + indices.sort(function (a, b) { + return b - a; + }); - function OptionSelectedManager() { - _PropertyManager2.apply(this, arguments); + _emberMetal.beginPropertyChanges(); + for (var i = 0; i < indices.length; i++) { + this._replace(indices[i], 1, EMPTY); } + _emberMetal.endPropertyChanges(); + } - OptionSelectedManager.prototype.setAttribute = function setAttribute(env, element, value) { - if (value !== null && value !== undefined && value !== false) { - var option = element; - option.selected = true; - } - }; + return this; + }, - OptionSelectedManager.prototype.updateAttribute = function updateAttribute(env, element, value) { - var option = element; - if (value) { - option.selected = true; - } else { - option.selected = false; - } - }; + pushObject: function (obj) { + this._insertAt(_emberMetal.get(this, 'content.length'), obj); + return obj; + }, - return OptionSelectedManager; - })(PropertyManager); + pushObjects: function (objects) { + if (!(_emberRuntimeMixinsEnumerable.default.detect(objects) || _emberRuntimeUtils.isArray(objects))) { + throw new TypeError('Must pass Ember.Enumerable to Ember.MutableArray#pushObjects'); + } + this._replace(_emberMetal.get(this, 'length'), 0, objects); + return this; + }, - var OPTION_SELECTED_MANAGER = new OptionSelectedManager('selected'); - exports.OPTION_SELECTED_MANAGER = OPTION_SELECTED_MANAGER; + setObjects: function (objects) { + if (objects.length === 0) { + return this.clear(); + } - var SafeAttributeManager = (function (_AttributeManager3) { - babelHelpers.inherits(SafeAttributeManager, _AttributeManager3); + var len = _emberMetal.get(this, 'length'); + this._replace(0, len, objects); + return this; + }, - function SafeAttributeManager() { - _AttributeManager3.apply(this, arguments); - } + unshiftObject: function (obj) { + this._insertAt(0, obj); + return obj; + }, - SafeAttributeManager.prototype.setAttribute = function setAttribute(env, element, value) { - _AttributeManager3.prototype.setAttribute.call(this, env, element, _glimmerRuntimeLibDomSanitizedValues.sanitizeAttributeValue(env, element, this.attr, value)); - }; + unshiftObjects: function (objects) { + this._replace(0, 0, objects); + return this; + }, - SafeAttributeManager.prototype.updateAttribute = function updateAttribute(env, element, value, namespace) { - _AttributeManager3.prototype.updateAttribute.call(this, env, element, _glimmerRuntimeLibDomSanitizedValues.sanitizeAttributeValue(env, element, this.attr, value)); - }; + slice: function () { + var arr = this.toArray(); + return arr.slice.apply(arr, arguments); + }, - return SafeAttributeManager; - })(AttributeManager); -}); + arrangedContentArrayWillChange: function (item, idx, removedCnt, addedCnt) { + this.arrayContentWillChange(idx, removedCnt, addedCnt); + }, -enifed('glimmer-runtime/lib/dom/helper', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/compat/inner-html-fix', 'glimmer-runtime/lib/compat/svg-inner-html-fix', 'glimmer-runtime/lib/compat/text-node-merging-fix', 'glimmer-runtime/lib/dom/interfaces'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibCompatInnerHtmlFix, _glimmerRuntimeLibCompatSvgInnerHtmlFix, _glimmerRuntimeLibCompatTextNodeMergingFix, _glimmerRuntimeLibDomInterfaces) { - 'use strict'; + arrangedContentArrayDidChange: function (item, idx, removedCnt, addedCnt) { + this.arrayContentDidChange(idx, removedCnt, addedCnt); + }, - exports.isWhitespace = isWhitespace; - exports.moveNodesBefore = moveNodesBefore; - exports.insertHTMLBefore = _insertHTMLBefore; - var SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; - exports.SVG_NAMESPACE = SVG_NAMESPACE; - // http://www.w3.org/TR/html/syntax.html#html-integration-point - var SVG_INTEGRATION_POINTS = { foreignObject: 1, desc: 1, title: 1 }; - // http://www.w3.org/TR/html/syntax.html#adjust-svg-attributes - // TODO: Adjust SVG attributes - // http://www.w3.org/TR/html/syntax.html#parsing-main-inforeign - // TODO: Adjust SVG elements - // http://www.w3.org/TR/html/syntax.html#parsing-main-inforeign - var BLACKLIST_TABLE = Object.create(null); - exports.BLACKLIST_TABLE = BLACKLIST_TABLE; - ["b", "big", "blockquote", "body", "br", "center", "code", "dd", "div", "dl", "dt", "em", "embed", "h1", "h2", "h3", "h4", "h5", "h6", "head", "hr", "i", "img", "li", "listing", "main", "meta", "nobr", "ol", "p", "pre", "ruby", "s", "small", "span", "strong", "strike", "sub", "sup", "table", "tt", "u", "ul", "var"].forEach(function (tag) { - return BLACKLIST_TABLE[tag] = 1; - }); - var WHITESPACE = /[\t-\r \xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/; - var doc = typeof document === 'undefined' ? undefined : document; - - function isWhitespace(string) { - return WHITESPACE.test(string); - } - - function moveNodesBefore(source, target, nextSibling) { - var first = source.firstChild; - var last = null; - var current = first; - while (current) { - last = current; - current = current.nextSibling; - target.insertBefore(last, nextSibling); - } - return [first, last]; - } - - var DOM; - exports.DOM = DOM; - (function (DOM) { - var TreeConstruction = (function () { - function TreeConstruction(document) { - this.document = document; - this.uselessElement = null; - this.setupUselessElement(); - } + init: function () { + this._super.apply(this, arguments); + this._setupContent(); + this._setupArrangedContent(); + }, - TreeConstruction.prototype.setupUselessElement = function setupUselessElement() { - this.uselessElement = this.document.createElement('div'); - }; + willDestroy: function () { + this._teardownArrangedContent(); + this._teardownContent(); + } + }); +}); +enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/mixins/action_handler', 'ember-runtime/inject'], function (exports, _emberUtils, _emberMetal, _emberRuntimeMixinsAction_handler, _emberRuntimeInject) { + 'no use strict'; + // Remove "use strict"; from transpiled module until + // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - TreeConstruction.prototype.createElement = function createElement(tag, context) { - var isElementInSVGNamespace = undefined, - isHTMLIntegrationPoint = undefined; - if (context) { - isElementInSVGNamespace = context.namespaceURI === SVG_NAMESPACE || tag === 'svg'; - isHTMLIntegrationPoint = SVG_INTEGRATION_POINTS[context.tagName]; - } else { - isElementInSVGNamespace = tag === 'svg'; - isHTMLIntegrationPoint = false; - } - if (isElementInSVGNamespace && !isHTMLIntegrationPoint) { - // FIXME: This does not properly handle with color, face, or - // size attributes, which is also disallowed by the spec. We should fix - // this. - if (BLACKLIST_TABLE[tag]) { - throw new Error('Cannot create a ' + tag + ' inside an SVG context'); - } - return this.document.createElementNS(SVG_NAMESPACE, tag); - } else { - return this.document.createElement(tag); - } - }; + /** + @module ember + @submodule ember-runtime + */ - TreeConstruction.prototype.createElementNS = function createElementNS(namespace, tag) { - return this.document.createElementNS(namespace, tag); - }; + // using ember-metal/lib/main here to ensure that ember-debug is setup + // if present - TreeConstruction.prototype.setAttribute = function setAttribute(element, name, value, namespace) { - if (namespace) { - element.setAttributeNS(namespace, name, value); - } else { - element.setAttribute(name, value); - } - }; + var _Mixin$create, _ClassMixinProps; - TreeConstruction.prototype.createTextNode = function createTextNode(text) { - return this.document.createTextNode(text); - }; + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['.'], ['.']); - TreeConstruction.prototype.createComment = function createComment(data) { - return this.document.createComment(data); - }; + var schedule = _emberMetal.run.schedule; + var applyMixin = _emberMetal.Mixin._apply; + var finishPartial = _emberMetal.Mixin.finishPartial; + var reopen = _emberMetal.Mixin.prototype.reopen; + var hasCachedComputedProperties = false; - TreeConstruction.prototype.insertBefore = function insertBefore(parent, node, reference) { - parent.insertBefore(node, reference); - }; + var POST_INIT = _emberUtils.symbol('POST_INIT'); - TreeConstruction.prototype.insertHTMLBefore = function insertHTMLBefore(parent, html, reference) { - return _insertHTMLBefore(this.uselessElement, parent, reference, html); - }; + exports.POST_INIT = POST_INIT; + function makeCtor() { + // Note: avoid accessing any properties on the object since it makes the + // method a lot faster. This is glue code so we want it to be as fast as + // possible. - return TreeConstruction; - })(); + var wasApplied = false; + var initProperties = undefined; - DOM.TreeConstruction = TreeConstruction; - var appliedTreeContruction = TreeConstruction; - appliedTreeContruction = _glimmerRuntimeLibCompatTextNodeMergingFix.treeConstruction(doc, appliedTreeContruction); - appliedTreeContruction = _glimmerRuntimeLibCompatInnerHtmlFix.treeConstruction(doc, appliedTreeContruction); - appliedTreeContruction = _glimmerRuntimeLibCompatSvgInnerHtmlFix.treeConstruction(doc, appliedTreeContruction, SVG_NAMESPACE); - DOM.DOMTreeConstruction = appliedTreeContruction; - })(DOM || (exports.DOM = DOM = {})); + var Class = (function () { + function Class() { +babelHelpers.classCallCheck(this, Class); - var DOMChanges = (function () { - function DOMChanges(document) { - this.document = document; - this.uselessElement = null; - this.namespace = null; - this.uselessElement = this.document.createElement('div'); + if (!wasApplied) { + Class.proto(); // prepare prototype... } - DOMChanges.prototype.setAttribute = function setAttribute(element, name, value) { - element.setAttribute(name, value); - }; - - DOMChanges.prototype.setAttributeNS = function setAttributeNS(element, namespace, name, value) { - element.setAttributeNS(namespace, name, value); - }; - - DOMChanges.prototype.removeAttribute = function removeAttribute(element, name) { - element.removeAttribute(name); - }; + if (arguments.length > 0) { + initProperties = [arguments[0]]; + } - DOMChanges.prototype.removeAttributeNS = function removeAttributeNS(element, namespace, name) { - element.removeAttributeNS(namespace, name); - }; + this.__defineNonEnumerable(_emberUtils.GUID_KEY_PROPERTY); + var m = _emberMetal.meta(this); + var proto = m.proto; + m.proto = this; + if (initProperties) { + // capture locally so we can clear the closed over variable + var props = initProperties; + initProperties = null; - DOMChanges.prototype.createTextNode = function createTextNode(text) { - return this.document.createTextNode(text); - }; + var concatenatedProperties = this.concatenatedProperties; + var mergedProperties = this.mergedProperties; - DOMChanges.prototype.createComment = function createComment(data) { - return this.document.createComment(data); - }; + for (var i = 0; i < props.length; i++) { + var properties = props[i]; + _emberMetal.assert('Ember.Object.create no longer supports mixing in other ' + 'definitions, use .extend & .create separately instead.', !(properties instanceof _emberMetal.Mixin)); - DOMChanges.prototype.createElement = function createElement(tag, context) { - var isElementInSVGNamespace = undefined, - isHTMLIntegrationPoint = undefined; - if (context) { - isElementInSVGNamespace = context.namespaceURI === SVG_NAMESPACE || tag === 'svg'; - isHTMLIntegrationPoint = SVG_INTEGRATION_POINTS[context.tagName]; - } else { - isElementInSVGNamespace = tag === 'svg'; - isHTMLIntegrationPoint = false; - } - if (isElementInSVGNamespace && !isHTMLIntegrationPoint) { - // FIXME: This does not properly handle with color, face, or - // size attributes, which is also disallowed by the spec. We should fix - // this. - if (BLACKLIST_TABLE[tag]) { - throw new Error('Cannot create a ' + tag + ' inside an SVG context'); - } - return this.document.createElementNS(SVG_NAMESPACE, tag); - } else { - return this.document.createElement(tag); + if (typeof properties !== 'object' && properties !== undefined) { + throw new _emberMetal.Error('Ember.Object.create only accepts objects.'); } - }; - - DOMChanges.prototype.insertHTMLBefore = function insertHTMLBefore(_parent, nextSibling, html) { - return _insertHTMLBefore(this.uselessElement, _parent, nextSibling, html); - }; - - DOMChanges.prototype.insertNodeBefore = function insertNodeBefore(parent, node, reference) { - if (isDocumentFragment(node)) { - var firstChild = node.firstChild; - var lastChild = node.lastChild; - this.insertBefore(parent, node, reference); - return new _glimmerRuntimeLibBounds.ConcreteBounds(parent, firstChild, lastChild); - } else { - this.insertBefore(parent, node, reference); - return new _glimmerRuntimeLibBounds.SingleNodeBounds(parent, node); + if (!properties) { + continue; } - }; - DOMChanges.prototype.insertTextBefore = function insertTextBefore(parent, nextSibling, text) { - var textNode = this.createTextNode(text); - this.insertBefore(parent, textNode, nextSibling); - return textNode; - }; + var keyNames = Object.keys(properties); - DOMChanges.prototype.insertBefore = function insertBefore(element, node, reference) { - element.insertBefore(node, reference); - }; + for (var j = 0; j < keyNames.length; j++) { + var keyName = keyNames[j]; + var value = properties[keyName]; - DOMChanges.prototype.insertAfter = function insertAfter(element, node, reference) { - this.insertBefore(element, node, reference.nextSibling); - }; + if (_emberMetal.detectBinding(keyName)) { + m.writeBindings(keyName, value); + } - return DOMChanges; - })(); + var possibleDesc = this[keyName]; + var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - exports.DOMChanges = DOMChanges; - - function _insertHTMLBefore(_useless, _parent, _nextSibling, html) { - // TypeScript vendored an old version of the DOM spec where `insertAdjacentHTML` - // only exists on `HTMLElement` but not on `Element`. We actually work with the - // newer version of the DOM API here (and monkey-patch this method in `./compat` - // when we detect older browsers). This is a hack to work around this limitation. - var parent = _parent; - var useless = _useless; - var nextSibling = _nextSibling; - var prev = nextSibling ? nextSibling.previousSibling : parent.lastChild; - var last = undefined; - if (html === null || html === '') { - return new _glimmerRuntimeLibBounds.ConcreteBounds(parent, null, null); - } - if (nextSibling === null) { - parent.insertAdjacentHTML('beforeEnd', html); - last = parent.lastChild; - } else if (nextSibling instanceof HTMLElement) { - nextSibling.insertAdjacentHTML('beforeBegin', html); - last = nextSibling.previousSibling; - } else { - // Non-element nodes do not support insertAdjacentHTML, so add an - // element and call it on that element. Then remove the element. - // - // This also protects Edge, IE and Firefox w/o the inspector open - // from merging adjacent text nodes. See ./compat/text-node-merging-fix.ts - parent.insertBefore(useless, nextSibling); - useless.insertAdjacentHTML('beforeBegin', html); - last = useless.previousSibling; - parent.removeChild(useless); - } - var first = prev ? prev.nextSibling : parent.firstChild; - return new _glimmerRuntimeLibBounds.ConcreteBounds(parent, first, last); - } + _emberMetal.assert('Ember.Object.create no longer supports defining computed ' + 'properties. Define computed properties using extend() or reopen() ' + 'before calling create().', !(value instanceof _emberMetal.ComputedProperty)); + _emberMetal.assert('Ember.Object.create no longer supports defining methods that call _super.', !(typeof value === 'function' && value.toString().indexOf('._super') !== -1)); + _emberMetal.assert('`actions` must be provided at extend time, not at create time, ' + 'when Ember.ActionHandler is used (i.e. views, controllers & routes).', !(keyName === 'actions' && _emberRuntimeMixinsAction_handler.default.detect(this))); - function isDocumentFragment(node) { - return node.nodeType === Node.DOCUMENT_FRAGMENT_NODE; - } - var helper = DOMChanges; - helper = _glimmerRuntimeLibCompatTextNodeMergingFix.domChanges(doc, helper); - helper = _glimmerRuntimeLibCompatInnerHtmlFix.domChanges(doc, helper); - helper = _glimmerRuntimeLibCompatSvgInnerHtmlFix.domChanges(doc, helper, SVG_NAMESPACE); - exports.default = helper; - var DOMTreeConstruction = DOM.DOMTreeConstruction; - exports.DOMTreeConstruction = DOMTreeConstruction; - exports.DOMNamespace = _glimmerRuntimeLibDomInterfaces.Namespace; -}); + if (concatenatedProperties && concatenatedProperties.length > 0 && concatenatedProperties.indexOf(keyName) >= 0) { + var baseValue = this[keyName]; -enifed("glimmer-runtime/lib/dom/interfaces", ["exports"], function (exports) { - "use strict"; + if (baseValue) { + if ('function' === typeof baseValue.concat) { + value = baseValue.concat(value); + } else { + value = _emberUtils.makeArray(baseValue).concat(value); + } + } else { + value = _emberUtils.makeArray(value); + } + } - var NodeType; - exports.NodeType = NodeType; - (function (NodeType) { - NodeType[NodeType["Element"] = 0] = "Element"; - NodeType[NodeType["Attribute"] = 1] = "Attribute"; - NodeType[NodeType["Text"] = 2] = "Text"; - NodeType[NodeType["CdataSection"] = 3] = "CdataSection"; - NodeType[NodeType["EntityReference"] = 4] = "EntityReference"; - NodeType[NodeType["Entity"] = 5] = "Entity"; - NodeType[NodeType["ProcessingInstruction"] = 6] = "ProcessingInstruction"; - NodeType[NodeType["Comment"] = 7] = "Comment"; - NodeType[NodeType["Document"] = 8] = "Document"; - NodeType[NodeType["DocumentType"] = 9] = "DocumentType"; - NodeType[NodeType["DocumentFragment"] = 10] = "DocumentFragment"; - NodeType[NodeType["Notation"] = 11] = "Notation"; - })(NodeType || (exports.NodeType = NodeType = {})); -}); - -enifed('glimmer-runtime/lib/dom/props', ['exports'], function (exports) { - /* - * @method normalizeProperty - * @param element {HTMLElement} - * @param slotName {String} - * @returns {Object} { name, type } - */ - 'use strict'; + if (mergedProperties && mergedProperties.length && mergedProperties.indexOf(keyName) >= 0) { + var originalValue = this[keyName]; - exports.normalizeProperty = normalizeProperty; - exports.normalizePropertyValue = normalizePropertyValue; + value = _emberUtils.assign({}, originalValue, value); + } - function normalizeProperty(element, slotName) { - var type = undefined, - normalized = undefined; - if (slotName in element) { - normalized = slotName; - type = 'prop'; - } else { - var lower = slotName.toLowerCase(); - if (lower in element) { - type = 'prop'; - normalized = lower; - } else { - type = 'attr'; - normalized = slotName; + if (desc) { + desc.set(this, keyName, value); + } else { + if (typeof this.setUnknownProperty === 'function' && !(keyName in this)) { + this.setUnknownProperty(keyName, value); + } else { + if (true) { + _emberMetal.defineProperty(this, keyName, null, value); // setup mandatory setter + } else { + this[keyName] = value; + } + } + } } + } } - if (type === 'prop' && (normalized.toLowerCase() === 'style' || preferAttr(element.tagName, normalized))) { - type = 'attr'; - } - return { normalized: normalized, type: type }; - } - - function normalizePropertyValue(value) { - if (value === '') { - return true; - } - return value; - } - - // properties that MUST be set as attributes, due to: - // * browser bug - // * strange spec outlier - var ATTR_OVERRIDES = { - // phantomjs < 2.0 lets you set it as a prop but won't reflect it - // back to the attribute. button.getAttribute('type') === null - BUTTON: { type: true, form: true }, - INPUT: { - // Some version of IE (like IE9) actually throw an exception - // if you set input.type = 'something-unknown' - type: true, - form: true, - // Chrome 46.0.2464.0: 'autocorrect' in document.createElement('input') === false - // Safari 8.0.7: 'autocorrect' in document.createElement('input') === false - // Mobile Safari (iOS 8.4 simulator): 'autocorrect' in document.createElement('input') === true - autocorrect: true, - // Chrome 54.0.2840.98: 'list' in document.createElement('input') === true - // Safari 9.1.3: 'list' in document.createElement('input') === false - list: true - }, - // element.form is actually a legitimate readOnly property, that is to be - // mutated, but must be mutated by setAttribute... - SELECT: { form: true }, - OPTION: { form: true }, - TEXTAREA: { form: true }, - LABEL: { form: true }, - FIELDSET: { form: true }, - LEGEND: { form: true }, - OBJECT: { form: true } - }; - function preferAttr(tagName, propName) { - var tag = ATTR_OVERRIDES[tagName.toUpperCase()]; - return tag && tag[propName.toLowerCase()] || false; - } -}); -enifed('glimmer-runtime/lib/dom/sanitized-values', ['exports', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-runtime/lib/upsert'], function (exports, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerRuntimeLibUpsert) { - 'use strict'; + finishPartial(this, m); - exports.requiresSanitization = requiresSanitization; - exports.sanitizeAttributeValue = sanitizeAttributeValue; + this.init.apply(this, arguments); - var badProtocols = ['javascript:', 'vbscript:']; - var badTags = ['A', 'BODY', 'LINK', 'IMG', 'IFRAME', 'BASE', 'FORM']; - var badTagsForDataURI = ['EMBED']; - var badAttributes = ['href', 'src', 'background', 'action']; - var badAttributesForDataURI = ['src']; - function has(array, item) { - return array.indexOf(item) !== -1; - } - function checkURI(tagName, attribute) { - return (tagName === null || has(badTags, tagName)) && has(badAttributes, attribute); - } - function checkDataURI(tagName, attribute) { - return has(badTagsForDataURI, tagName) && has(badAttributesForDataURI, attribute); - } + this[POST_INIT](); - function requiresSanitization(tagName, attribute) { - return checkURI(tagName, attribute) || checkDataURI(tagName, attribute); - } + m.proto = proto; + _emberMetal.finishChains(this); + _emberMetal.sendEvent(this, 'init'); + } - function sanitizeAttributeValue(env, element, attribute, value) { - var tagName = undefined; - if (value === null || value === undefined) { - return value; - } - if (_glimmerRuntimeLibUpsert.isSafeString(value)) { - return value.toHTML(); + Class.willReopen = function willReopen() { + if (wasApplied) { + Class.PrototypeMixin = _emberMetal.Mixin.create(Class.PrototypeMixin); } - if (!element) { - tagName = null; - } else { - tagName = element.tagName.toUpperCase(); - } - var str = _glimmerRuntimeLibCompiledOpcodesContent.normalizeTextValue(value); - if (checkURI(tagName, attribute)) { - var protocol = env.protocolForURL(str); - if (has(badProtocols, protocol)) { - return 'unsafe:' + str; - } - } - if (checkDataURI(tagName, attribute)) { - return 'unsafe:' + str; - } - return str; - } -}); -enifed('glimmer-runtime/lib/environment', ['exports', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/dom/attribute-managers', 'glimmer-util', 'glimmer-runtime/lib/syntax/core', 'glimmer-runtime/lib/syntax/builtins/if', 'glimmer-runtime/lib/syntax/builtins/unless', 'glimmer-runtime/lib/syntax/builtins/with', 'glimmer-runtime/lib/syntax/builtins/each'], function (exports, _glimmerRuntimeLibReferences, _glimmerRuntimeLibDomAttributeManagers, _glimmerUtil, _glimmerRuntimeLibSyntaxCore, _glimmerRuntimeLibSyntaxBuiltinsIf, _glimmerRuntimeLibSyntaxBuiltinsUnless, _glimmerRuntimeLibSyntaxBuiltinsWith, _glimmerRuntimeLibSyntaxBuiltinsEach) { - 'use strict'; + wasApplied = false; + }; - var Scope = (function () { - function Scope(references) { - var callerScope = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + Class._initProperties = function _initProperties(args) { + initProperties = args; + }; - this.callerScope = null; - this.slots = references; - this.callerScope = callerScope; + Class.proto = function proto() { + var superclass = Class.superclass; + if (superclass) { + superclass.proto(); } - Scope.root = function root(self) { - var size = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + if (!wasApplied) { + wasApplied = true; + Class.PrototypeMixin.applyPartial(Class.prototype); + } - var refs = new Array(size + 1); - for (var i = 0; i <= size; i++) { - refs[i] = _glimmerRuntimeLibReferences.UNDEFINED_REFERENCE; - } - return new Scope(refs).init({ self: self }); - }; + return this.prototype; + }; - Scope.prototype.init = function init(_ref) { - var self = _ref.self; + return Class; + })(); - this.slots[0] = self; - return this; - }; + Class.toString = _emberMetal.Mixin.prototype.toString; - Scope.prototype.getSelf = function getSelf() { - return this.slots[0]; - }; + return Class; + } - Scope.prototype.getSymbol = function getSymbol(symbol) { - return this.slots[symbol]; - }; + /** + @class CoreObject + @namespace Ember + @public + */ + var CoreObject = makeCtor(); + CoreObject.toString = function () { + return 'Ember.CoreObject'; + }; + CoreObject.PrototypeMixin = _emberMetal.Mixin.create((_Mixin$create = { + reopen: function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - Scope.prototype.getBlock = function getBlock(symbol) { - return this.slots[symbol]; - }; + applyMixin(this, args, true); + return this; + }, - Scope.prototype.getPartialArgs = function getPartialArgs(symbol) { - return this.slots[symbol]; - }; + /** + An overridable method called when objects are instantiated. By default, + does nothing unless it is overridden during class definition. + Example: + ```javascript + const Person = Ember.Object.extend({ + init() { + alert(`Name is ${this.get('name')}`); + } + }); + let steve = Person.create({ + name: "Steve" + }); + // alerts 'Name is Steve'. + ``` + NOTE: If you do override `init` for a framework class like `Ember.View`, + be sure to call `this._super(...arguments)` in your + `init` declaration! If you don't, Ember may not have an opportunity to + do important setup work, and you'll see strange behavior in your + application. + @method init + @public + */ + init: function () {} - Scope.prototype.bindSymbol = function bindSymbol(symbol, value) { - this.slots[symbol] = value; - }; + }, _Mixin$create[POST_INIT] = function () {}, _Mixin$create.__defineNonEnumerable = function (property) { + Object.defineProperty(this, property.name, property.descriptor); + //this[property.name] = property.descriptor.value; + }, _Mixin$create.concatenatedProperties = null, _Mixin$create.mergedProperties = null, _Mixin$create.isDestroyed = _emberMetal.descriptor({ + get: function () { + return _emberMetal.meta(this).isSourceDestroyed(); + }, - Scope.prototype.bindBlock = function bindBlock(symbol, value) { - this.slots[symbol] = value; - }; + set: function (value) { + // prevent setting while applying mixins + if (typeof value === 'object' && value !== null && value.isDescriptor) { + return; + } - Scope.prototype.bindPartialArgs = function bindPartialArgs(symbol, value) { - this.slots[symbol] = value; - }; + _emberMetal.assert(('You cannot set `' + this + '.isDestroyed` directly, please use ').destroy()(_templateObject), false); + } + }), _Mixin$create.isDestroying = _emberMetal.descriptor({ + get: function () { + return _emberMetal.meta(this).isSourceDestroying(); + }, - Scope.prototype.bindCallerScope = function bindCallerScope(scope) { - this.callerScope = scope; - }; + set: function (value) { + // prevent setting while applying mixins + if (typeof value === 'object' && value !== null && value.isDescriptor) { + return; + } - Scope.prototype.getCallerScope = function getCallerScope() { - return this.callerScope; - }; + _emberMetal.assert(('You cannot set `' + this + '.isDestroying` directly, please use ').destroy()(_templateObject), false); + } + }), _Mixin$create.destroy = function () { + var m = _emberMetal.meta(this); + if (m.isSourceDestroying()) { + return; + } - Scope.prototype.child = function child() { - return new Scope(this.slots.slice(), this.callerScope); - }; + m.setSourceDestroying(); - return Scope; - })(); + schedule('actions', this, this.willDestroy); + schedule('destroy', this, this._scheduledDestroy, m); - exports.Scope = Scope; + return this; + }, _Mixin$create.willDestroy = function () {}, _Mixin$create._scheduledDestroy = function (m) { + if (m.isSourceDestroyed()) { + return; + } + _emberMetal.destroy(this); + m.setSourceDestroyed(); + }, _Mixin$create.bind = function (to, from) { + if (!(from instanceof _emberMetal.Binding)) { + from = _emberMetal.Binding.from(from); + } + from.to(to).connect(this); + return from; + }, _Mixin$create.toString = function () { + var hasToStringExtension = typeof this.toStringExtension === 'function'; + var extension = hasToStringExtension ? ':' + this.toStringExtension() : ''; + var ret = '<' + (this[_emberUtils.NAME_KEY] || this.constructor.toString()) + ':' + _emberUtils.guidFor(this) + extension + '>'; - var Environment = (function () { - function Environment(_ref2) { - var appendOperations = _ref2.appendOperations; - var updateOperations = _ref2.updateOperations; + return ret; + }, _Mixin$create)); - this.scheduledInstallManagers = null; - this.scheduledInstallModifiers = null; - this.scheduledUpdateModifierManagers = null; - this.scheduledUpdateModifiers = null; - this.createdComponents = null; - this.createdManagers = null; - this.updatedComponents = null; - this.updatedManagers = null; - this.destructors = null; - this.appendOperations = appendOperations; - this.updateOperations = updateOperations; - } + CoreObject.PrototypeMixin.ownerConstructor = CoreObject; - Environment.prototype.toConditionalReference = function toConditionalReference(reference) { - return new _glimmerRuntimeLibReferences.ConditionalReference(reference); - }; + CoreObject.__super__ = null; - Environment.prototype.getAppendOperations = function getAppendOperations() { - return this.appendOperations; - }; + var ClassMixinProps = (_ClassMixinProps = { - Environment.prototype.getDOM = function getDOM() { - return this.updateOperations; - }; + ClassMixin: _emberMetal.REQUIRED, - Environment.prototype.getIdentity = function getIdentity(object) { - return _glimmerUtil.ensureGuid(object) + ''; - }; + PrototypeMixin: _emberMetal.REQUIRED, - Environment.prototype.statement = function statement(_statement, symbolTable) { - return this.refineStatement(parseStatement(_statement), symbolTable) || _statement; - }; + isClass: true, - Environment.prototype.refineStatement = function refineStatement(statement, symbolTable) { - var isSimple = statement.isSimple; - var isBlock = statement.isBlock; - var key = statement.key; - var args = statement.args; - - if (isSimple && isBlock) { - switch (key) { - case 'each': - return new _glimmerRuntimeLibSyntaxBuiltinsEach.default(args); - case 'if': - return new _glimmerRuntimeLibSyntaxBuiltinsIf.default(args); - case 'with': - return new _glimmerRuntimeLibSyntaxBuiltinsWith.default(args); - case 'unless': - return new _glimmerRuntimeLibSyntaxBuiltinsUnless.default(args); - } - } - }; + isMethod: false + }, _ClassMixinProps[_emberUtils.NAME_KEY] = null, _ClassMixinProps[_emberUtils.GUID_KEY] = null, _ClassMixinProps.extend = function () { + var Class = makeCtor(); + var proto = undefined; + Class.ClassMixin = _emberMetal.Mixin.create(this.ClassMixin); + Class.PrototypeMixin = _emberMetal.Mixin.create(this.PrototypeMixin); - Environment.prototype.begin = function begin() { - this.createdComponents = []; - this.createdManagers = []; - this.updatedComponents = []; - this.updatedManagers = []; - this.destructors = []; - this.scheduledInstallManagers = []; - this.scheduledInstallModifiers = []; - this.scheduledUpdateModifierManagers = []; - this.scheduledUpdateModifiers = []; - }; + Class.ClassMixin.ownerConstructor = Class; + Class.PrototypeMixin.ownerConstructor = Class; - Environment.prototype.didCreate = function didCreate(component, manager) { - this.createdComponents.push(component); - this.createdManagers.push(manager); - }; + reopen.apply(Class.PrototypeMixin, arguments); - Environment.prototype.didUpdate = function didUpdate(component, manager) { - this.updatedComponents.push(component); - this.updatedManagers.push(manager); - }; + Class.superclass = this; + Class.__super__ = this.prototype; - Environment.prototype.scheduleInstallModifier = function scheduleInstallModifier(modifier, manager) { - this.scheduledInstallManagers.push(manager); - this.scheduledInstallModifiers.push(modifier); - }; + proto = Class.prototype = Object.create(this.prototype); + proto.constructor = Class; + _emberUtils.generateGuid(proto); + _emberMetal.meta(proto).proto = proto; // this will disable observers on prototype - Environment.prototype.scheduleUpdateModifier = function scheduleUpdateModifier(modifier, manager) { - this.scheduledUpdateModifierManagers.push(manager); - this.scheduledUpdateModifiers.push(modifier); - }; + Class.ClassMixin.apply(Class); + return Class; + }, _ClassMixinProps.create = function () { + var C = this; - Environment.prototype.didDestroy = function didDestroy(d) { - this.destructors.push(d); - }; + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - Environment.prototype.commit = function commit() { - for (var i = 0; i < this.createdComponents.length; i++) { - var component = this.createdComponents[i]; - var manager = this.createdManagers[i]; - manager.didCreate(component); - } - for (var i = 0; i < this.updatedComponents.length; i++) { - var component = this.updatedComponents[i]; - var manager = this.updatedManagers[i]; - manager.didUpdate(component); - } - for (var i = 0; i < this.destructors.length; i++) { - this.destructors[i].destroy(); - } - for (var i = 0; i < this.scheduledInstallManagers.length; i++) { - var manager = this.scheduledInstallManagers[i]; - var modifier = this.scheduledInstallModifiers[i]; - manager.install(modifier); - } - for (var i = 0; i < this.scheduledUpdateModifierManagers.length; i++) { - var manager = this.scheduledUpdateModifierManagers[i]; - var modifier = this.scheduledUpdateModifiers[i]; - manager.update(modifier); - } - this.createdComponents = null; - this.createdManagers = null; - this.updatedComponents = null; - this.updatedManagers = null; - this.destructors = null; - this.scheduledInstallManagers = null; - this.scheduledInstallModifiers = null; - this.scheduledUpdateModifierManagers = null; - this.scheduledUpdateModifiers = null; - }; + if (args.length > 0) { + this._initProperties(args); + } + return new C(); + }, _ClassMixinProps.reopen = function () { + this.willReopen(); + reopen.apply(this.PrototypeMixin, arguments); + return this; + }, _ClassMixinProps.reopenClass = function () { + reopen.apply(this.ClassMixin, arguments); + applyMixin(this, arguments, false); + return this; + }, _ClassMixinProps.detect = function (obj) { + if ('function' !== typeof obj) { + return false; + } + while (obj) { + if (obj === this) { + return true; + } + obj = obj.superclass; + } + return false; + }, _ClassMixinProps.detectInstance = function (obj) { + return obj instanceof this; + }, _ClassMixinProps.metaForProperty = function (key) { + var proto = this.proto(); + var possibleDesc = proto[key]; + var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - Environment.prototype.attributeFor = function attributeFor(element, attr, isTrusting, namespace) { - return _glimmerRuntimeLibDomAttributeManagers.defaultManagers(element, attr, isTrusting, namespace); - }; + _emberMetal.assert('metaForProperty() could not find a computed property with key \'' + key + '\'.', !!desc && desc instanceof _emberMetal.ComputedProperty); + return desc._meta || {}; + }, _ClassMixinProps._computedProperties = _emberMetal.computed(function () { + hasCachedComputedProperties = true; + var proto = this.proto(); + var property = undefined; + var properties = []; - return Environment; - })(); + for (var _name in proto) { + property = proto[_name]; - exports.Environment = Environment; - exports.default = Environment; - - function parseStatement(statement) { - var type = statement.type; - var block = type === 'block' ? statement : null; - var append = type === 'optimized-append' ? statement : null; - var modifier = type === 'modifier' ? statement : null; - var appendType = append && append.value.type; - var args = undefined; - var path = undefined; - if (block) { - args = block.args; - path = block.path; - } else if (append && (appendType === 'unknown' || appendType === 'get')) { - var appendValue = append.value; - args = _glimmerRuntimeLibSyntaxCore.Args.empty(); - path = appendValue.ref.parts; - } else if (append && append.value.type === 'helper') { - var helper = append.value; - args = helper.args; - path = helper.ref.parts; - } else if (modifier) { - path = modifier.path; - args = modifier.args; - } - var key = undefined, - isSimple = undefined; - if (path) { - isSimple = path.length === 1; - key = path[0]; - } - return { - isSimple: isSimple, - path: path, - key: key, - args: args, - appendType: appendType, - original: statement, - isInline: !!append, - isBlock: !!block, - isModifier: !!modifier - }; + if (property && property.isDescriptor) { + properties.push({ + name: _name, + meta: property._meta + }); + } } -}); - -enifed('glimmer-runtime/lib/helpers/get-dynamic-var', ['exports', 'glimmer-reference'], function (exports, _glimmerReference) { - 'use strict'; + return properties; + }).readOnly(), _ClassMixinProps.eachComputedProperty = function (callback, binding) { + var property = undefined; + var empty = {}; - var DynamicVarReference = (function () { - function DynamicVarReference(scope, nameRef) { - this.scope = scope; - this.nameRef = nameRef; - var varTag = this.varTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - this.tag = _glimmerReference.combine([nameRef.tag, varTag]); - } + var properties = _emberMetal.get(this, '_computedProperties'); - DynamicVarReference.prototype.value = function value() { - return this.getVar().value(); - }; + for (var i = 0; i < properties.length; i++) { + property = properties[i]; + callback.call(binding || this, property.name, property.meta || empty); + } + }, _ClassMixinProps); - DynamicVarReference.prototype.get = function get(key) { - return this.getVar().get(key); - }; + function injectedPropertyAssertion() { + _emberMetal.assert('Injected properties are invalid', _emberRuntimeInject.validatePropertyInjections(this)); + } - DynamicVarReference.prototype.getVar = function getVar() { - var name = String(this.nameRef.value()); - var ref = this.scope.get(name); - this.varTag.update(ref.tag); - return ref; - }; + _emberMetal.runInDebug(function () { + /** + Provides lookup-time type validation for injected properties. + @private + @method _onLookup + */ + ClassMixinProps._onLookup = injectedPropertyAssertion; + }); - return DynamicVarReference; - })(); + /** + Returns a hash of property names and container names that injected + properties will lookup on the container lazily. + + @method _lazyInjections + @return {Object} Hash of all lazy injected property keys to container names + @private + */ + ClassMixinProps._lazyInjections = function () { + var injections = {}; + var proto = this.proto(); + var key = undefined; + var desc = undefined; - function getDynamicVar(vm, args, symbolTable) { - var scope = vm.dynamicScope(); - var nameRef = args.positional.at(0); - return new DynamicVarReference(scope, nameRef); + for (key in proto) { + desc = proto[key]; + if (desc instanceof _emberMetal.InjectedProperty) { + injections[key] = desc.type + ':' + (desc.name || key); + } } - exports.default = getDynamicVar; -}); -enifed("glimmer-runtime/lib/modifier/interfaces", ["exports"], function (exports) { - "use strict"; -}); - -enifed("glimmer-runtime/lib/opcode-builder", ["exports"], function (exports) { - "use strict"; -}); + return injections; + }; -enifed('glimmer-runtime/lib/opcodes', ['exports', 'glimmer-util'], function (exports, _glimmerUtil) { - 'use strict'; + var ClassMixin = _emberMetal.Mixin.create(ClassMixinProps); - exports.inspect = inspect; + ClassMixin.ownerConstructor = CoreObject; - var AbstractOpcode = (function () { - function AbstractOpcode() { - _glimmerUtil.initializeGuid(this); - } + CoreObject.ClassMixin = ClassMixin; - AbstractOpcode.prototype.toJSON = function toJSON() { - return { guid: this._guid, type: this.type }; - }; + ClassMixin.apply(CoreObject); - return AbstractOpcode; - })(); + CoreObject.reopen({ + didDefineProperty: function (proto, key, value) { + if (hasCachedComputedProperties === false) { + return; + } + if (value instanceof _emberMetal.ComputedProperty) { + var cache = _emberMetal.meta(this.constructor).readableCache(); - exports.AbstractOpcode = AbstractOpcode; + if (cache && cache._computedProperties !== undefined) { + cache._computedProperties = undefined; + } + } + } + }); - var Opcode = (function (_AbstractOpcode) { - babelHelpers.inherits(Opcode, _AbstractOpcode); + exports.default = CoreObject; +}); +// Private, and only for didInitAttrs willRecieveAttrs - function Opcode() { - _AbstractOpcode.apply(this, arguments); - this.next = null; - this.prev = null; - } +/** + 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 + the subclass overrides a property with the same name that is defined + in the superclass. However, there are some cases where it is preferable + to build up a property's value by combining the superclass' property + value with the subclass' value. An example of this in use within Ember + is the `classNames` property of `Ember.View`. + Here is some sample code showing the difference between a concatenated + property and a normal one: + ```javascript + const Bar = Ember.Object.extend({ + // Configure which properties to concatenate + concatenatedProperties: ['concatenatedProperty'], + someNonConcatenatedProperty: ['bar'], + concatenatedProperty: ['bar'] + }); + const FooBar = Bar.extend({ + someNonConcatenatedProperty: ['foo'], + concatenatedProperty: ['foo'] + }); + let fooBar = FooBar.create(); + fooBar.get('someNonConcatenatedProperty'); // ['foo'] + fooBar.get('concatenatedProperty'); // ['bar', 'foo'] + ``` + This behavior extends to object creation as well. Continuing the + above example: + ```javascript + let fooBar = FooBar.create({ + someNonConcatenatedProperty: ['baz'], + concatenatedProperty: ['baz'] + }) + fooBar.get('someNonConcatenatedProperty'); // ['baz'] + fooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz'] + ``` + Adding a single property that is not an array will just add it in the array: + ```javascript + let fooBar = FooBar.create({ + concatenatedProperty: 'baz' + }) + view.get('concatenatedProperty'); // ['bar', 'foo', 'baz'] + ``` + Using the `concatenatedProperties` property, we can tell Ember to mix the + content of the properties. + In `Ember.Component` the `classNames`, `classNameBindings` and + `attributeBindings` properties are concatenated. + This feature is available for you to use throughout the Ember object model, + although typical app developers are likely to use it infrequently. Since + it changes expectations about behavior of properties, you should properly + document its usage in each individual concatenated property (to not + mislead your users to think they can override the property in a subclass). + @property concatenatedProperties + @type Array + @default null + @public +*/ - return Opcode; - })(AbstractOpcode); +/** + Defines the properties that will be merged from the superclass + (instead of overridden). + By default, when you extend an Ember class a property defined in + the subclass overrides a property with the same name that is defined + in the superclass. However, there are some cases where it is preferable + to build up a property's value by merging the superclass property value + with the subclass property's value. An example of this in use within Ember + is the `queryParams` property of routes. + Here is some sample code showing the difference between a merged + property and a normal one: + ```javascript + const Bar = Ember.Object.extend({ + // Configure which properties are to be merged + mergedProperties: ['mergedProperty'], + someNonMergedProperty: { + nonMerged: 'superclass value of nonMerged' + }, + mergedProperty: { + page: {replace: false}, + limit: {replace: true} + } + }); + const FooBar = Bar.extend({ + someNonMergedProperty: { + completelyNonMerged: 'subclass value of nonMerged' + }, + mergedProperty: { + limit: {replace: false} + } + }); + let fooBar = FooBar.create(); + fooBar.get('someNonMergedProperty'); + // => { completelyNonMerged: 'subclass value of nonMerged' } + // + // Note the entire object, including the nonMerged property of + // the superclass object, has been replaced + fooBar.get('mergedProperty'); + // => { + // page: {replace: false}, + // limit: {replace: false} + // } + // + // Note the page remains from the superclass, and the + // `limit` property's value of `false` has been merged from + // the subclass. + ``` + This behavior is not available during object `create` calls. It is only + available at `extend` time. + In `Ember.Route` the `queryParams` property is merged. + This feature is available for you to use throughout the Ember object model, + although typical app developers are likely to use it infrequently. Since + it changes expectations about behavior of properties, you should properly + document its usage in each individual merged property (to not + mislead your users to think they can override the property in a subclass). + @property mergedProperties + @type Array + @default null + @public +*/ - exports.Opcode = Opcode; +/** + Destroyed object property flag. + if this property is `true` the observers and bindings were already + removed by the effect of calling the `destroy()` method. + @property isDestroyed + @default false + @public +*/ - var UpdatingOpcode = (function (_AbstractOpcode2) { - babelHelpers.inherits(UpdatingOpcode, _AbstractOpcode2); +/** + Destruction scheduled flag. The `destroy()` method has been called. + The object stays intact until the end of the run loop at which point + the `isDestroyed` flag is set. + @property isDestroying + @default false + @public +*/ - function UpdatingOpcode() { - _AbstractOpcode2.apply(this, arguments); - this.next = null; - this.prev = null; - } +/** + Destroys an object by setting the `isDestroyed` flag and removing its + metadata, which effectively destroys observers and bindings. + If you try to set a property on a destroyed object, an exception will be + raised. + Note that destruction is scheduled for the end of the run loop and does not + happen immediately. It will set an isDestroying flag immediately. + @method destroy + @return {Ember.Object} receiver + @public +*/ - return UpdatingOpcode; - })(AbstractOpcode); +/** + Override to implement teardown. + @method willDestroy + @public +*/ - exports.UpdatingOpcode = UpdatingOpcode; +/** + Invoked by the run loop to actually destroy the object. This is + scheduled for execution by the `destroy` method. + @private + @method _scheduledDestroy +*/ - function inspect(opcodes) { - var buffer = []; - opcodes.toArray().forEach(function (opcode, i) { - _inspect(opcode.toJSON(), buffer, 0, i); - }); - return buffer.join(''); +/** + Returns a string representation which attempts to provide more information + than Javascript's `toString` typically does, in a generic way for all Ember + objects. + ```javascript + const Person = Ember.Object.extend() + person = Person.create() + person.toString() //=> "" + ``` + If the object's class is not defined on an Ember namespace, it will + indicate it is a subclass of the registered superclass: + ```javascript + const Student = Person.extend() + let student = Student.create() + student.toString() //=> "<(subclass of Person):ember1025>" + ``` + If the method `toStringExtension` is defined, its return value will be + included in the output. + ```javascript + const Teacher = Person.extend({ + toStringExtension() { + return this.get('fullName'); } + }); + teacher = Teacher.create() + teacher.toString(); //=> "" + ``` + @method toString + @return {String} string representation + @public +*/ - function _inspect(opcode, buffer, level, index) { - var indentation = []; - for (var i = 0; i < level; i++) { - indentation.push(' '); - } - buffer.push.apply(buffer, indentation); - buffer.push(index + 1 + '. ' + opcode.type.toUpperCase()); - if (opcode.args || opcode.details) { - buffer.push('('); - if (opcode.args) { - buffer.push(opcode.args.join(', ')); - } - if (opcode.details) { - var keys = Object.keys(opcode.details); - if (keys.length) { - if (opcode.args && opcode.args.length) { - buffer.push(', '); - } - buffer.push(keys.map(function (key) { - return key + '=' + opcode.details[key]; - }).join(', ')); - } - } - buffer.push(')'); - } - buffer.push('\n'); - if (opcode.children && opcode.children.length) { - for (var i = 0; i < opcode.children.length; i++) { - _inspect(opcode.children[i], buffer, level + 1, i); - } - } +/** + Creates a new subclass. + ```javascript + const Person = Ember.Object.extend({ + say(thing) { + alert(thing); + } + }); + ``` + This defines a new subclass of Ember.Object: `Person`. It contains one method: `say()`. + You can also create a subclass from any existing class by calling its `extend()` method. + For example, you might want to create a subclass of Ember's built-in `Ember.Component` class: + ```javascript + const PersonComponent = Ember.Component.extend({ + tagName: 'li', + classNameBindings: ['isAdministrator'] + }); + ``` + When defining a subclass, you can override methods but still access the + implementation of your parent class by calling the special `_super()` method: + ```javascript + const Person = Ember.Object.extend({ + say(thing) { + let name = this.get('name'); + alert(`${name} says: ${thing}`); } -}); - -enifed("glimmer-runtime/lib/partial", ["exports"], function (exports) { - "use strict"; - - var PartialDefinition = function PartialDefinition(name, template) { - this.name = name; - this.template = template; - }; - - exports.PartialDefinition = PartialDefinition; -}); - -enifed('glimmer-runtime/lib/references', ['exports', 'glimmer-reference'], function (exports, _glimmerReference) { - 'use strict'; - - var PrimitiveReference = (function (_ConstReference) { - babelHelpers.inherits(PrimitiveReference, _ConstReference); - - function PrimitiveReference(value) { - _ConstReference.call(this, value); - } + }); + const Soldier = Person.extend({ + say(thing) { + this._super(`${thing}, sir!`); + }, + march(numberOfHours) { + alert(`${this.get('name')} marches for ${numberOfHours} hours.`); + } + }); + let yehuda = Soldier.create({ + name: "Yehuda Katz" + }); + yehuda.say("Yes"); // alerts "Yehuda Katz says: Yes, sir!" + ``` + The `create()` on line #17 creates an *instance* of the `Soldier` class. + The `extend()` on line #8 creates a *subclass* of `Person`. Any instance + of the `Person` class will *not* have the `march()` method. + You can also pass `Mixin` classes to add additional properties to the subclass. + ```javascript + const Person = Ember.Object.extend({ + say(thing) { + alert(`${this.get('name')} says: ${thing}`); + } + }); + const SingingMixin = Mixin.create({ + sing(thing){ + alert(`${this.get('name')} sings: la la la ${thing}`); + } + }); + const BroadwayStar = Person.extend(SingingMixin, { + dance() { + alert(`${this.get('name')} dances: tap tap tap tap `); + } + }); + ``` + The `BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`. + @method extend + @static + @param {Mixin} [mixins]* One or more Mixin classes + @param {Object} [arguments]* Object containing values to use within the new class + @public +*/ - PrimitiveReference.create = function create(value) { - if (value === undefined) { - return UNDEFINED_REFERENCE; - } else if (value === null) { - return NULL_REFERENCE; - } else if (value === true) { - return TRUE_REFERENCE; - } else if (value === false) { - return FALSE_REFERENCE; - } else if (typeof value === 'number') { - return new ValueReference(value); - } else { - return new StringReference(value); - } - }; +/** + Creates an instance of a class. Accepts either no arguments, or an object + containing values to initialize the newly instantiated object with. + ```javascript + const Person = Ember.Object.extend({ + helloWorld() { + alert(`Hi, my name is ${this.get('name')}`); + } + }); + let tom = Person.create({ + name: 'Tom Dale' + }); + tom.helloWorld(); // alerts "Hi, my name is Tom Dale". + ``` + `create` will call the `init` function if defined during + `Ember.AnyObject.extend` + If no arguments are passed to `create`, it will not set values to the new + instance during initialization: + ```javascript + let noName = Person.create(); + noName.helloWorld(); // alerts undefined + ``` + NOTE: For performance reasons, you cannot declare methods or computed + properties during `create`. You should instead declare methods and computed + properties when using `extend`. + @method create + @static + @param [arguments]* + @public +*/ - PrimitiveReference.prototype.get = function get(key) { - return UNDEFINED_REFERENCE; - }; +/** + Augments a constructor's prototype with additional + properties and functions: + ```javascript + const MyObject = Ember.Object.extend({ + name: 'an object' + }); + o = MyObject.create(); + o.get('name'); // 'an object' + MyObject.reopen({ + say(msg){ + console.log(msg); + } + }) + o2 = MyObject.create(); + o2.say("hello"); // logs "hello" + o.say("goodbye"); // logs "goodbye" + ``` + To add functions and properties to the constructor itself, + see `reopenClass` + @method reopen + @public +*/ - return PrimitiveReference; - })(_glimmerReference.ConstReference); +/** + Augments a constructor's own properties and functions: + ```javascript + const MyObject = Ember.Object.extend({ + name: 'an object' + }); + MyObject.reopenClass({ + canBuild: false + }); + MyObject.canBuild; // false + o = MyObject.create(); + ``` + In other words, this creates static properties and functions for the class. + These are only available on the class and not on any instance of that class. + ```javascript + const Person = Ember.Object.extend({ + name: "", + sayHello() { + alert("Hello. My name is " + this.get('name')); + } + }); + Person.reopenClass({ + species: "Homo sapiens", + createPerson(newPersonsName){ + return Person.create({ + name:newPersonsName + }); + } + }); + let tom = Person.create({ + name: "Tom Dale" + }); + let yehuda = Person.createPerson("Yehuda Katz"); + tom.sayHello(); // "Hello. My name is Tom Dale" + yehuda.sayHello(); // "Hello. My name is Yehuda Katz" + alert(Person.species); // "Homo sapiens" + ``` + Note that `species` and `createPerson` are *not* valid on the `tom` and `yehuda` + variables. They are only valid on `Person`. + To add functions and properties to instances of + a constructor by extending the constructor's prototype + see `reopen` + @method reopenClass + @public +*/ - exports.PrimitiveReference = PrimitiveReference; +/** + In some cases, you may want to annotate computed properties with additional + metadata about how they function or what values they operate on. For + example, computed property functions may close over variables that are then + no longer available for introspection. + You can pass a hash of these values to a computed property like this: + ```javascript + person: Ember.computed(function() { + let personId = this.get('personId'); + return Person.create({ id: personId }); + }).meta({ type: Person }) + ``` + Once you've done this, you can retrieve the values saved to the computed + property from your class like this: + ```javascript + MyClass.metaForProperty('person'); + ``` + This will return the original hash that was passed to `meta()`. + @static + @method metaForProperty + @param key {String} property name + @private +*/ - var StringReference = (function (_PrimitiveReference) { - babelHelpers.inherits(StringReference, _PrimitiveReference); +/** + Iterate over each computed property for the class, passing its name + and any associated metadata (see `metaForProperty`) to the callback. + @static + @method eachComputedProperty + @param {Function} callback + @param {Object} binding + @private +*/ +enifed('ember-runtime/system/each_proxy', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/mixins/array'], function (exports, _emberUtils, _emberMetal, _emberRuntimeMixinsArray) { + 'use strict'; - function StringReference() { - _PrimitiveReference.apply(this, arguments); - this.lengthReference = null; - } + exports.default = EachProxy; - StringReference.prototype.get = function get(key) { - if (key === 'length') { - var lengthReference = this.lengthReference; + /** + 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 + */ - if (lengthReference === null) { - lengthReference = this.lengthReference = new ValueReference(this.inner.length); - } - return lengthReference; - } else { - return _PrimitiveReference.prototype.get.call(this, key); - } - }; + function EachProxy(content) { + this._content = content; + this._keys = undefined; + this.__ember_meta__ = null; + } - return StringReference; - })(PrimitiveReference); + EachProxy.prototype = { + __defineNonEnumerable: function (property) { + this[property.name] = property.descriptor.value; + }, - var ValueReference = (function (_PrimitiveReference2) { - babelHelpers.inherits(ValueReference, _PrimitiveReference2); + // .......................................................... + // ARRAY CHANGES + // Invokes whenever the content array itself changes. - function ValueReference(value) { - _PrimitiveReference2.call(this, value); + arrayWillChange: function (content, idx, removedCnt, addedCnt) { + var keys = this._keys; + var lim = removedCnt > 0 ? idx + removedCnt : -1; + for (var key in keys) { + if (lim > 0) { + removeObserverForContentKey(content, key, this, idx, lim); } + _emberMetal.propertyWillChange(this, key); + } + }, - return ValueReference; - })(PrimitiveReference); - - var UNDEFINED_REFERENCE = new ValueReference(undefined); - exports.UNDEFINED_REFERENCE = UNDEFINED_REFERENCE; - var NULL_REFERENCE = new ValueReference(null); - exports.NULL_REFERENCE = NULL_REFERENCE; - var TRUE_REFERENCE = new ValueReference(true); - var FALSE_REFERENCE = new ValueReference(false); - - var ConditionalReference = (function () { - function ConditionalReference(inner) { - this.inner = inner; - this.tag = inner.tag; + arrayDidChange: function (content, idx, removedCnt, addedCnt) { + var keys = this._keys; + var lim = addedCnt > 0 ? idx + addedCnt : -1; + for (var key in keys) { + if (lim > 0) { + addObserverForContentKey(content, key, this, idx, lim); } + _emberMetal.propertyDidChange(this, key); + } + }, - ConditionalReference.prototype.value = function value() { - return this.toBool(this.inner.value()); - }; - - ConditionalReference.prototype.toBool = function toBool(value) { - return !!value; - }; - - return ConditionalReference; - })(); - - exports.ConditionalReference = ConditionalReference; -}); - -enifed('glimmer-runtime/lib/scanner', ['exports', 'glimmer-runtime/lib/syntax/statements', 'glimmer-runtime/lib/compiled/blocks', 'glimmer-util', 'glimmer-runtime/lib/symbol-table'], function (exports, _glimmerRuntimeLibSyntaxStatements, _glimmerRuntimeLibCompiledBlocks, _glimmerUtil, _glimmerRuntimeLibSymbolTable) { - 'use strict'; + // .......................................................... + // LISTEN FOR NEW OBSERVERS AND OTHER EVENT LISTENERS + // Start monitoring keys based on who is listening... - var Scanner = (function () { - function Scanner(block, meta, env) { - this.block = block; - this.meta = meta; - this.env = env; - } + willWatchProperty: function (property) { + this.beginObservingContentKey(property); + }, - Scanner.prototype.scanEntryPoint = function scanEntryPoint() { - var block = this.block; - var meta = this.meta; + didUnwatchProperty: function (property) { + this.stopObservingContentKey(property); + }, - var symbolTable = _glimmerRuntimeLibSymbolTable.default.forEntryPoint(meta); - var program = buildStatements(block, block.blocks, symbolTable, this.env); - return new _glimmerRuntimeLibCompiledBlocks.EntryPoint(program, symbolTable); - }; + // .......................................................... + // CONTENT KEY OBSERVING + // Actual watch keys on the source content. - Scanner.prototype.scanLayout = function scanLayout() { - var block = this.block; - var meta = this.meta; - var blocks = block.blocks; - var named = block.named; - var yields = block.yields; - var hasPartials = block.hasPartials; - - var symbolTable = _glimmerRuntimeLibSymbolTable.default.forLayout(named, yields, hasPartials, meta); - var program = buildStatements(block, blocks, symbolTable, this.env); - return new _glimmerRuntimeLibCompiledBlocks.Layout(program, symbolTable, named, yields, hasPartials); - }; + beginObservingContentKey: function (keyName) { + var keys = this._keys; + if (!keys) { + keys = this._keys = new _emberUtils.EmptyObject(); + } - Scanner.prototype.scanPartial = function scanPartial(symbolTable) { - var block = this.block; - var blocks = block.blocks; - var locals = block.locals; + if (!keys[keyName]) { + keys[keyName] = 1; + var content = this._content; + var len = _emberMetal.get(content, 'length'); - var program = buildStatements(block, blocks, symbolTable, this.env); - return new _glimmerRuntimeLibCompiledBlocks.PartialBlock(program, symbolTable, locals); - }; + addObserverForContentKey(content, keyName, this, 0, len); + } else { + keys[keyName]++; + } + }, - return Scanner; - })(); + stopObservingContentKey: function (keyName) { + var keys = this._keys; + if (keys && keys[keyName] > 0 && --keys[keyName] <= 0) { + var content = this._content; + var len = _emberMetal.get(content, 'length'); - exports.default = Scanner; + removeObserverForContentKey(content, keyName, this, 0, len); + } + }, - function buildStatements(_ref, blocks, symbolTable, env) { - var statements = _ref.statements; + contentKeyWillChange: function (obj, keyName) { + _emberMetal.propertyWillChange(this, keyName); + }, - if (statements.length === 0) return EMPTY_PROGRAM; - return new BlockScanner(statements, blocks, symbolTable, env).scan(); + contentKeyDidChange: function (obj, keyName) { + _emberMetal.propertyDidChange(this, keyName); } - var EMPTY_PROGRAM = _glimmerUtil.EMPTY_SLICE; - - var BlockScanner = (function () { - function BlockScanner(statements, blocks, symbolTable, env) { - this.blocks = blocks; - this.symbolTable = symbolTable; - this.stack = new _glimmerUtil.Stack(); - this.stack.push(new ChildBlockScanner(symbolTable)); - this.reader = new SyntaxReader(statements, symbolTable, this); - this.env = env; - } - - BlockScanner.prototype.scan = function scan() { - var statement = undefined; - while (statement = this.reader.next()) { - this.addStatement(statement); - } - return this.stack.current.program; - }; - - BlockScanner.prototype.blockFor = function blockFor(symbolTable, id) { - var block = this.blocks[id]; - var childTable = _glimmerRuntimeLibSymbolTable.default.forBlock(this.symbolTable, block.locals); - var program = buildStatements(block, this.blocks, childTable, this.env); - return new _glimmerRuntimeLibCompiledBlocks.InlineBlock(program, childTable, block.locals); - }; - - BlockScanner.prototype.startBlock = function startBlock(locals) { - var childTable = _glimmerRuntimeLibSymbolTable.default.forBlock(this.symbolTable, locals); - this.stack.push(new ChildBlockScanner(childTable)); - }; - - BlockScanner.prototype.endBlock = function endBlock(locals) { - var _stack$pop = this.stack.pop(); - - var program = _stack$pop.program; - var symbolTable = _stack$pop.symbolTable; - - var block = new _glimmerRuntimeLibCompiledBlocks.InlineBlock(program, symbolTable, locals); - this.addChild(block); - return block; - }; - - BlockScanner.prototype.addChild = function addChild(block) { - this.stack.current.addChild(block); - }; - - BlockScanner.prototype.addStatement = function addStatement(statement) { - this.stack.current.addStatement(statement.scan(this)); - }; - - BlockScanner.prototype.next = function next() { - return this.reader.next(); - }; - - return BlockScanner; - })(); - - exports.BlockScanner = BlockScanner; - - var ChildBlockScanner = (function () { - function ChildBlockScanner(symbolTable) { - this.symbolTable = symbolTable; - this.children = []; - this.program = new _glimmerUtil.LinkedList(); - } - - ChildBlockScanner.prototype.addChild = function addChild(block) { - this.children.push(block); - }; - - ChildBlockScanner.prototype.addStatement = function addStatement(statement) { - this.program.append(statement); - }; - - return ChildBlockScanner; - })(); + }; - var SyntaxReader = (function () { - function SyntaxReader(statements, symbolTable, scanner) { - this.statements = statements; - this.symbolTable = symbolTable; - this.scanner = scanner; - this.current = 0; - this.last = null; - } - - SyntaxReader.prototype.next = function next() { - var last = this.last; - if (last) { - this.last = null; - return last; - } else if (this.current === this.statements.length) { - return null; - } - var sexp = this.statements[this.current++]; - return _glimmerRuntimeLibSyntaxStatements.default(sexp, this.symbolTable, this.scanner); - }; + function addObserverForContentKey(content, keyName, proxy, idx, loc) { + while (--loc >= idx) { + var item = _emberRuntimeMixinsArray.objectAt(content, loc); + if (item) { + _emberMetal.assert('When using @each to observe the array ' + content + ', the array must return an object', typeof item === 'object'); + _emberMetal._addBeforeObserver(item, keyName, proxy, 'contentKeyWillChange'); + _emberMetal.addObserver(item, keyName, proxy, 'contentKeyDidChange'); + } + } + } - return SyntaxReader; - })(); + function removeObserverForContentKey(content, keyName, proxy, idx, loc) { + while (--loc >= idx) { + var item = _emberRuntimeMixinsArray.objectAt(content, loc); + if (item) { + _emberMetal._removeBeforeObserver(item, keyName, proxy, 'contentKeyWillChange'); + _emberMetal.removeObserver(item, keyName, proxy, 'contentKeyDidChange'); + } + } + } }); +enifed('ember-runtime/system/lazy_load', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { + /*globals CustomEvent */ -enifed('glimmer-runtime/lib/symbol-table', ['exports', 'glimmer-util'], function (exports, _glimmerUtil) { - 'use strict'; - - var SymbolTable = (function () { - function SymbolTable(parent) { - var meta = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; - - this.parent = parent; - this.meta = meta; - this.locals = _glimmerUtil.dict(); - this.named = _glimmerUtil.dict(); - this.yields = _glimmerUtil.dict(); - this.partialArgs = null; - this.size = 1; - this.top = parent ? parent.top : this; - } - - SymbolTable.forEntryPoint = function forEntryPoint(meta) { - return new SymbolTable(null, meta).initEntryPoint(); - }; - - SymbolTable.forLayout = function forLayout(named, yields, hasPartials, meta) { - return new SymbolTable(null, meta).initLayout(named, yields, hasPartials); - }; - - SymbolTable.forBlock = function forBlock(parent, locals) { - return new SymbolTable(parent, null).initBlock(locals); - }; - - SymbolTable.prototype.initEntryPoint = function initEntryPoint() { - return this; - }; - - SymbolTable.prototype.initBlock = function initBlock(locals) { - this.initPositionals(locals); - return this; - }; - - SymbolTable.prototype.initLayout = function initLayout(named, yields, hasPartials) { - this.initNamed(named); - this.initYields(yields); - this.initPartials(hasPartials); - return this; - }; + 'use strict'; - SymbolTable.prototype.initPositionals = function initPositionals(positionals) { - var _this = this; + exports.onLoad = onLoad; + exports.runLoadHooks = runLoadHooks; - if (positionals) positionals.forEach(function (s) { - return _this.locals[s] = _this.top.size++; - }); - return this; - }; + /** + @module ember + @submodule ember-runtime + */ - SymbolTable.prototype.initNamed = function initNamed(named) { - var _this2 = this; + var loadHooks = _emberEnvironment.ENV.EMBER_LOAD_HOOKS || {}; + var loaded = {}; + var _loaded = loaded; - if (named) named.forEach(function (s) { - return _this2.named[s] = _this2.top.size++; - }); - return this; - }; + 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 + resolved from a string into the object: + + ``` javascript + Ember.onLoad('Ember.Application' function(hbars) { + hbars.registerHelper(...); + }); + ``` + + @method onLoad + @for Ember + @param name {String} name of hook + @param callback {Function} callback to be called + @private + */ - SymbolTable.prototype.initYields = function initYields(yields) { - var _this3 = this; + function onLoad(name, callback) { + var object = loaded[name]; - if (yields) yields.forEach(function (b) { - return _this3.yields[b] = _this3.top.size++; - }); - return this; - }; + loadHooks[name] = loadHooks[name] || []; + loadHooks[name].push(callback); - SymbolTable.prototype.initPartials = function initPartials(hasPartials) { - if (hasPartials) this.top.partialArgs = this.top.size++; - return this; - }; + if (object) { + callback(object); + } + } - SymbolTable.prototype.getMeta = function getMeta() { - var meta = this.meta; - var parent = this.parent; + /** + Called when an Ember.js package (e.g Ember.Application) has finished + loading. Triggers any callbacks registered for this event. + + @method runLoadHooks + @for Ember + @param name {String} name of hook + @param object {Object} object to pass to callbacks + @private + */ - if (!meta && parent) { - meta = parent.getMeta(); - } - return meta; - }; + function runLoadHooks(name, object) { + loaded[name] = object; + var window = _emberEnvironment.environment.window; - SymbolTable.prototype.getYield = function getYield(name) { - var yields = this.yields; - var parent = this.parent; + if (window && typeof CustomEvent === 'function') { + var _event = new CustomEvent(name, { detail: object, name: name }); + window.dispatchEvent(_event); + } - var symbol = yields[name]; - if (!symbol && parent) { - symbol = parent.getYield(name); - } - return symbol; - }; + if (loadHooks[name]) { + loadHooks[name].forEach(function (callback) { + return callback(object); + }); + } + } +}); +enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal', 'ember-environment', 'ember-runtime/system/object'], function (exports, _emberUtils, _emberMetal, _emberEnvironment, _emberRuntimeSystemObject) { + /** + @module ember + @submodule ember-runtime + */ + 'use strict'; - SymbolTable.prototype.getNamed = function getNamed(name) { - var named = this.named; - var parent = this.parent; + exports.isSearchDisabled = isSearchDisabled; + exports.setSearchDisabled = setSearchDisabled; - var symbol = named[name]; - if (!symbol && parent) { - symbol = parent.getNamed(name); - } - return symbol; - }; + var searchDisabled = false; - SymbolTable.prototype.getLocal = function getLocal(name) { - var locals = this.locals; - var parent = this.parent; + function isSearchDisabled() { + return searchDisabled; + } - var symbol = locals[name]; - if (!symbol && parent) { - symbol = parent.getLocal(name); - } - return symbol; - }; + function setSearchDisabled(flag) { + searchDisabled = !!flag; + } - SymbolTable.prototype.getPartialArgs = function getPartialArgs() { - return this.top.partialArgs; - }; + /** + 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. + + # Example Usage + + ```javascript + MyFramework = Ember.Namespace.create({ + VERSION: '1.0.0' + }); + ``` + + @class Namespace + @namespace Ember + @extends Ember.Object + @public + */ + var Namespace = _emberRuntimeSystemObject.default.extend({ + isNamespace: true, - SymbolTable.prototype.isTop = function isTop() { - return this.top === this; - }; + init: function () { + Namespace.NAMESPACES.push(this); + Namespace.PROCESSED = false; + }, - return SymbolTable; - })(); + toString: function () { + var name = _emberMetal.get(this, 'name') || _emberMetal.get(this, 'modulePrefix'); + if (name) { + return name; + } - exports.default = SymbolTable; -}); + findNamespaces(); + return this[_emberUtils.NAME_KEY]; + }, -enifed("glimmer-runtime/lib/syntax", ["exports"], function (exports) { - "use strict"; + nameClasses: function () { + processNamespace([this.toString()], this, {}); + }, - exports.isAttribute = isAttribute; + destroy: function () { + var namespaces = Namespace.NAMESPACES; + var toString = this.toString(); - var Statement = (function () { - function Statement() { - this.next = null; - this.prev = null; - } + if (toString) { + _emberEnvironment.context.lookup[toString] = undefined; + delete Namespace.NAMESPACES_BY_ID[toString]; + } + namespaces.splice(namespaces.indexOf(this), 1); + this._super.apply(this, arguments); + } + }); - Statement.fromSpec = function fromSpec(spec, symbolTable, scanner) { - throw new Error("You need to implement fromSpec on " + this); - }; + Namespace.reopenClass({ + NAMESPACES: [_emberMetal.default], + NAMESPACES_BY_ID: { + Ember: _emberMetal.default + }, + PROCESSED: false, + processAll: processAllNamespaces, + byName: function (name) { + if (!searchDisabled) { + processAllNamespaces(); + } - Statement.prototype.clone = function clone() { - // not type safe but the alternative is extreme boilerplate per - // syntax subclass. - return new this.constructor(this); - }; + return NAMESPACES_BY_ID[name]; + } + }); - Statement.prototype.scan = function scan(scanner) { - return this; - }; + var NAMESPACES_BY_ID = Namespace.NAMESPACES_BY_ID; - return Statement; - })(); + var hasOwnProp = ({}).hasOwnProperty; - exports.Statement = Statement; + function processNamespace(paths, root, seen) { + var idx = paths.length; - var Expression = (function () { - function Expression() {} + NAMESPACES_BY_ID[paths.join('.')] = root; - Expression.fromSpec = function fromSpec(spec, blocks) { - throw new Error("You need to implement fromSpec on " + this); - }; + // Loop over all of the keys in the namespace, looking for classes + for (var key in root) { + if (!hasOwnProp.call(root, key)) { + continue; + } + var obj = root[key]; - return Expression; - })(); + // If we are processing the `Ember` namespace, for example, the + // `paths` will start with `["Ember"]`. Every iteration through + // the loop will update the **second** element of this list with + // the key, so processing `Ember.View` will make the Array + // `['Ember', 'View']`. + paths[idx] = key; - exports.Expression = Expression; - var ATTRIBUTE = "e1185d30-7cac-4b12-b26a-35327d905d92"; - exports.ATTRIBUTE = ATTRIBUTE; - var ARGUMENT = "0f3802314-d747-bbc5-0168-97875185c3rt"; - exports.ARGUMENT = ARGUMENT; + // If we have found an unprocessed class + if (obj && obj.toString === classToString && !obj[_emberUtils.NAME_KEY]) { + // Replace the class' `toString` with the dot-separated path + // and set its `NAME_KEY` + obj[_emberUtils.NAME_KEY] = paths.join('.'); - var Attribute = (function (_Statement) { - babelHelpers.inherits(Attribute, _Statement); + // Support nested namespaces + } else if (obj && obj.isNamespace) { + // Skip aliased namespaces + if (seen[_emberUtils.guidFor(obj)]) { + continue; + } + seen[_emberUtils.guidFor(obj)] = true; - function Attribute() { - _Statement.apply(this, arguments); - this["e1185d30-7cac-4b12-b26a-35327d905d92"] = true; + // Process the child namespace + processNamespace(paths, obj, seen); } + } + + paths.length = idx; // cut out last item + } - return Attribute; - })(Statement); + function isUppercase(code) { + return code >= 65 && // A + code <= 90; // Z + } - exports.Attribute = Attribute; + function tryIsNamespace(lookup, prop) { + try { + var obj = lookup[prop]; + return obj && obj.isNamespace && obj; + } catch (e) { + // continue + } + } - var Argument = (function (_Statement2) { - babelHelpers.inherits(Argument, _Statement2); + function findNamespaces() { + if (Namespace.PROCESSED) { + return; + } + var lookup = _emberEnvironment.context.lookup; + var keys = Object.keys(lookup); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + // Only process entities that start with uppercase A-Z + if (!isUppercase(key.charCodeAt(0))) { + continue; + } + var obj = tryIsNamespace(lookup, key); + if (obj) { + obj[_emberUtils.NAME_KEY] = key; + } + } + } - function Argument() { - _Statement2.apply(this, arguments); - this["0f3802314-d747-bbc5-0168-97875185c3rt"] = true; - } + function superClassString(mixin) { + var superclass = mixin.superclass; + if (superclass) { + if (superclass[_emberUtils.NAME_KEY]) { + return superclass[_emberUtils.NAME_KEY]; + } + return superClassString(superclass); + } + } - return Argument; - })(Statement); + function calculateToString(target) { + var str = undefined; - exports.Argument = Argument; + if (!searchDisabled) { + processAllNamespaces(); + // can also be set by processAllNamespaces + str = target[_emberUtils.NAME_KEY]; + if (str) { + return str; + } else { + str = superClassString(target); + str = str ? '(subclass of ' + str + ')' : str; + } + } + if (str) { + return str; + } else { + return '(unknown mixin)'; + } + } - function isAttribute(value) { - return value && value[ATTRIBUTE] === true; + function classToString() { + var name = this[_emberUtils.NAME_KEY]; + if (name) { + return name; } -}); -enifed('glimmer-runtime/lib/syntax/builtins/each', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { - 'use strict'; + return this[_emberUtils.NAME_KEY] = calculateToString(this); + } - var EachSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(EachSyntax, _StatementSyntax); - - function EachSyntax(args) { - _StatementSyntax.call(this); - this.args = args; - this.type = "each-statement"; - } - - EachSyntax.prototype.compile = function compile(dsl, env) { - // Enter(BEGIN, END) - // BEGIN: Noop - // PutArgs - // PutIterable - // JumpUnless(ELSE) - // EnterList(BEGIN2, END2) - // ITER: Noop - // NextIter(BREAK) - // EnterWithKey(BEGIN2, END2) - // BEGIN2: Noop - // PushChildScope - // Evaluate(default) - // PopScope - // END2: Noop - // Exit - // Jump(ITER) - // BREAK: Noop - // ExitList - // Jump(END) - // ELSE: Noop - // Evalulate(inverse) - // END: Noop - // Exit - var args = this.args; - var blocks = this.args.blocks; - - dsl.block(args, function (dsl, BEGIN, END) { - dsl.putIterator(); - if (blocks.inverse) { - dsl.jumpUnless('ELSE'); - } else { - dsl.jumpUnless(END); - } - dsl.iter(function (dsl, BEGIN, END) { - dsl.evaluate('default', blocks.default); - }); - if (blocks.inverse) { - dsl.jump(END); - dsl.label('ELSE'); - dsl.evaluate('inverse', blocks.inverse); - } - }); - }; + function processAllNamespaces() { + var unprocessedNamespaces = !Namespace.PROCESSED; + var unprocessedMixins = _emberMetal.hasUnprocessedMixins(); - return EachSyntax; - })(_glimmerRuntimeLibSyntax.Statement); + if (unprocessedNamespaces) { + findNamespaces(); + Namespace.PROCESSED = true; + } - exports.default = EachSyntax; -}); + if (unprocessedNamespaces || unprocessedMixins) { + var namespaces = Namespace.NAMESPACES; + var namespace = undefined; -enifed('glimmer-runtime/lib/syntax/builtins/if', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { - 'use strict'; + for (var i = 0; i < namespaces.length; i++) { + namespace = namespaces[i]; + processNamespace([namespace.toString()], namespace, {}); + } - var IfSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(IfSyntax, _StatementSyntax); - - function IfSyntax(args) { - _StatementSyntax.call(this); - this.args = args; - this.type = "if-statement"; - } - - IfSyntax.prototype.compile = function compile(dsl) { - // PutArgs - // Test(Environment) - // Enter(BEGIN, END) - // BEGIN: Noop - // JumpUnless(ELSE) - // Evaluate(default) - // Jump(END) - // ELSE: Noop - // Evalulate(inverse) - // END: Noop - // Exit - var args = this.args; - var blocks = this.args.blocks; - - dsl.putArgs(args); - dsl.test('environment'); - dsl.block(null, function (dsl, BEGIN, END) { - if (blocks.inverse) { - dsl.jumpUnless('ELSE'); - dsl.evaluate('default', blocks.default); - dsl.jump(END); - dsl.label('ELSE'); - dsl.evaluate('inverse', blocks.inverse); - } else { - dsl.jumpUnless(END); - dsl.evaluate('default', blocks.default); - } - }); - }; + _emberMetal.clearUnprocessedMixins(); + } + } - return IfSyntax; - })(_glimmerRuntimeLibSyntax.Statement); + _emberMetal.Mixin.prototype.toString = classToString; // ES6TODO: altering imported objects. SBB. - exports.default = IfSyntax; + exports.default = Namespace; }); +// Preloaded into namespaces +enifed('ember-runtime/system/native_array', ['exports', 'ember-metal', 'ember-environment', '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, _emberMetal, _emberEnvironment, _emberRuntimeMixinsArray, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsObservable, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsFreezable, _emberRuntimeCopy) { + /** + @module ember + @submodule ember-runtime + */ + 'use strict'; -enifed('glimmer-runtime/lib/syntax/builtins/in-element', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { - 'use strict'; + var _NativeArray; - var InElementSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(InElementSyntax, _StatementSyntax); + // 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. - function InElementSyntax(args) { - _StatementSyntax.call(this); - this.args = args; - this.type = "in-element-statement"; - } + /** + The NativeArray mixin contains the properties needed to make the native + Array support Ember.MutableArray and all of its dependent APIs. Unless you + have `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Array` set to + false, this will be applied automatically. Otherwise you can apply the mixin + at anytime by calling `Ember.NativeArray.apply(Array.prototype)`. + + @class NativeArray + @namespace Ember + @uses Ember.MutableArray + @uses Ember.Observable + @uses Ember.Copyable + @public + */ + var NativeArray = _emberMetal.Mixin.create(_emberRuntimeMixinsMutable_array.default, _emberRuntimeMixinsObservable.default, _emberRuntimeMixinsCopyable.default, { - InElementSyntax.prototype.compile = function compile(dsl, env) { - var args = this.args; - var blocks = this.args.blocks; + // because length is a built-in property we need to know to just get the + // original property. + get: function (key) { + if ('number' === typeof key) { + return this[key]; + } else { + return this._super(key); + } + }, - dsl.putArgs(args); - dsl.test('simple'); - dsl.block(null, function (dsl, BEGIN, END) { - dsl.jumpUnless(END); - dsl.pushRemoteElement(); - dsl.evaluate('default', blocks.default); - dsl.popRemoteElement(); - }); - }; + objectAt: function (idx) { + return this[idx]; + }, - return InElementSyntax; - })(_glimmerRuntimeLibSyntax.Statement); + // primitive for array support. + replace: function (idx, amt, objects) { + if (this.isFrozen) { + throw _emberRuntimeMixinsFreezable.FROZEN_ERROR; + } - exports.default = InElementSyntax; -}); + // if we replaced exactly the same number of items, then pass only the + // replaced range. Otherwise, pass the full remaining array length + // since everything has shifted + var len = objects ? _emberMetal.get(objects, 'length') : 0; + _emberRuntimeMixinsArray.arrayContentWillChange(this, idx, amt, len); -enifed("glimmer-runtime/lib/syntax/builtins/partial", ["exports", "glimmer-runtime/lib/syntax"], function (exports, _glimmerRuntimeLibSyntax) { - "use strict"; + if (len === 0) { + this.splice(idx, amt); + } else { + _emberMetal.replace(this, idx, amt, objects); + } - var StaticPartialSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(StaticPartialSyntax, _StatementSyntax); + _emberRuntimeMixinsArray.arrayContentDidChange(this, idx, amt, len); + return this; + }, - function StaticPartialSyntax(name) { - _StatementSyntax.call(this); - this.name = name; - this.type = "static-partial"; - } + // If you ask for an unknown property, then try to collect the value + // from member items. + unknownProperty: function (key, value) { + var ret = undefined; // = this.reducedProperty(key, value); + if (value !== undefined && ret === undefined) { + ret = this[key] = value; + } + return ret; + }, - StaticPartialSyntax.prototype.compile = function compile(dsl, env, symbolTable) { - var name = String(this.name.inner()); - if (!env.hasPartial(name, symbolTable)) { - throw new Error("Compile Error: " + name + " is not a partial"); - } - var definition = env.lookupPartial(name, symbolTable); - dsl.putPartialDefinition(definition); - dsl.evaluatePartial(); - }; + indexOf: Array.prototype.indexOf, + lastIndexOf: Array.prototype.lastIndexOf, + + copy: function (deep) { + if (deep) { + return this.map(function (item) { + return _emberRuntimeCopy.default(item, true); + }); + } - return StaticPartialSyntax; - })(_glimmerRuntimeLibSyntax.Statement); + return this.slice(); + } + }); - exports.StaticPartialSyntax = StaticPartialSyntax; + // Remove any methods implemented natively so we don't override them + var ignore = ['length']; + NativeArray.keys().forEach(function (methodName) { + if (Array.prototype[methodName]) { + ignore.push(methodName); + } + }); - var DynamicPartialSyntax = (function (_StatementSyntax2) { - babelHelpers.inherits(DynamicPartialSyntax, _StatementSyntax2); + exports.NativeArray // TODO: only use default export + = NativeArray = (_NativeArray = NativeArray).without.apply(_NativeArray, ignore); - function DynamicPartialSyntax(name) { - _StatementSyntax2.call(this); - this.name = name; - this.type = "dynamic-partial"; + /** + Creates an `Ember.NativeArray` from an Array like object. + Does not modify the original object. Ember.A is not needed if + `EmberENV.EXTEND_PROTOTYPES` is `true` (the default value). However, + it is recommended that you use Ember.A when creating addons for + ember or when you can not guarantee that `EmberENV.EXTEND_PROTOTYPES` + will be `true`. + + Example + + ```js + export default Ember.Component.extend({ + tagName: 'ul', + classNames: ['pagination'], + + init() { + this._super(...arguments); + + if (!this.get('content')) { + this.set('content', Ember.A()); } + } + }); + ``` + + @method A + @for Ember + @return {Ember.NativeArray} + @public + */ + var A = undefined; - DynamicPartialSyntax.prototype.compile = function compile(dsl) { - var name = this.name; + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.Array) { + NativeArray.apply(Array.prototype); + exports.A = A = function (arr) { + return arr || []; + }; + } else { + exports.A = A = function (arr) { + if (!arr) { + arr = []; + } + return _emberRuntimeMixinsArray.default.detect(arr) ? arr : NativeArray.apply(arr); + }; + } - dsl.startLabels(); - dsl.putValue(name); - dsl.test('simple'); - dsl.enter('BEGIN', 'END'); - dsl.label('BEGIN'); - dsl.jumpUnless('END'); - dsl.putDynamicPartialDefinition(); - dsl.evaluatePartial(); - dsl.label('END'); - dsl.exit(); - dsl.stopLabels(); - }; + _emberMetal.default.A = A; + exports.A = A; + exports.NativeArray = NativeArray; + exports.default = NativeArray; +}); +// Ember.A circular +enifed('ember-runtime/system/object', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/system/core_object', 'ember-runtime/mixins/observable'], function (exports, _emberUtils, _emberMetal, _emberRuntimeSystemCore_object, _emberRuntimeMixinsObservable) { + /** + @module ember + @submodule ember-runtime + */ - return DynamicPartialSyntax; - })(_glimmerRuntimeLibSyntax.Statement); + 'use strict'; - exports.DynamicPartialSyntax = DynamicPartialSyntax; -}); + /** + `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. + + @class Object + @namespace Ember + @extends Ember.CoreObject + @uses Ember.Observable + @public + */ + var EmberObject = _emberRuntimeSystemCore_object.default.extend(_emberRuntimeMixinsObservable.default); + EmberObject.toString = function () { + return 'Ember.Object'; + }; -enifed('glimmer-runtime/lib/syntax/builtins/unless', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { - 'use strict'; + var FrameworkObject = EmberObject; - var UnlessSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(UnlessSyntax, _StatementSyntax); - - function UnlessSyntax(args) { - _StatementSyntax.call(this); - this.args = args; - this.type = "unless-statement"; - } - - UnlessSyntax.prototype.compile = function compile(dsl, env) { - // PutArgs - // Enter(BEGIN, END) - // BEGIN: Noop - // Test(Environment) - // JumpIf(ELSE) - // Evaluate(default) - // Jump(END) - // ELSE: Noop - // Evalulate(inverse) - // END: Noop - // Exit - var args = this.args; - var blocks = this.args.blocks; - - dsl.putArgs(args); - dsl.test('environment'); - dsl.block(null, function (dsl) { - if (blocks.inverse) { - dsl.jumpIf('ELSE'); - dsl.evaluate('default', blocks.default); - dsl.jump('END'); - dsl.label('ELSE'); - dsl.evaluate('inverse', blocks.inverse); - } else { - dsl.jumpIf('END'); - dsl.evaluate('default', blocks.default); - } - }); - }; + exports.FrameworkObject = FrameworkObject; + _emberMetal.runInDebug(function () { + var _EmberObject$extend; - return UnlessSyntax; - })(_glimmerRuntimeLibSyntax.Statement); + var INIT_WAS_CALLED = _emberUtils.symbol('INIT_WAS_CALLED'); + var ASSERT_INIT_WAS_CALLED = _emberUtils.symbol('ASSERT_INIT_WAS_CALLED'); - exports.default = UnlessSyntax; -}); + exports.FrameworkObject = FrameworkObject = EmberObject.extend((_EmberObject$extend = { + init: function () { + this._super.apply(this, arguments); + this[INIT_WAS_CALLED] = true; + } -enifed('glimmer-runtime/lib/syntax/builtins/with-dynamic-vars', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { - 'use strict'; + }, _EmberObject$extend[ASSERT_INIT_WAS_CALLED] = _emberMetal.on('init', function () { + _emberMetal.assert('You must call `this._super(...arguments);` when overriding `init` on a framework object. Please update ' + this + ' to call `this._super(...arguments);` from `init`.', this[INIT_WAS_CALLED]); + }), _EmberObject$extend)); + }); - var WithDynamicVarsSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(WithDynamicVarsSyntax, _StatementSyntax); + exports.default = EmberObject; +}); +enifed('ember-runtime/system/object_proxy', ['exports', 'ember-runtime/system/object', 'ember-runtime/mixins/-proxy'], function (exports, _emberRuntimeSystemObject, _emberRuntimeMixinsProxy) { + 'use strict'; - function WithDynamicVarsSyntax(args) { - _StatementSyntax.call(this); - this.args = args; - this.type = "with-dynamic-vars-statement"; + /** + `Ember.ObjectProxy` forwards all properties not defined by the proxy itself + to a proxied `content` object. + + ```javascript + object = Ember.Object.create({ + name: 'Foo' + }); + + proxy = Ember.ObjectProxy.create({ + content: object + }); + + // Access and change existing properties + proxy.get('name') // 'Foo' + proxy.set('name', 'Bar'); + object.get('name') // 'Bar' + + // Create new 'description' property on `object` + proxy.set('description', 'Foo is a whizboo baz'); + object.get('description') // 'Foo is a whizboo baz' + ``` + + While `content` is unset, setting a property to be delegated will throw an + Error. + + ```javascript + proxy = Ember.ObjectProxy.create({ + content: null, + flag: null + }); + proxy.set('flag', true); + proxy.get('flag'); // true + proxy.get('foo'); // undefined + proxy.set('foo', 'data'); // throws Error + ``` + + Delegated properties can be bound to and will change when content is updated. + + Computed properties on the proxy itself can depend on delegated properties. + + ```javascript + ProxyWithComputedProperty = Ember.ObjectProxy.extend({ + fullName: Ember.computed('firstName', 'lastName', function() { + var firstName = this.get('firstName'), + lastName = this.get('lastName'); + if (firstName && lastName) { + return firstName + ' ' + lastName; } + return firstName || lastName; + }) + }); + + proxy = ProxyWithComputedProperty.create(); + + proxy.get('fullName'); // undefined + proxy.set('content', { + firstName: 'Tom', lastName: 'Dale' + }); // triggers property change for fullName on proxy + + proxy.get('fullName'); // 'Tom Dale' + ``` + + @class ObjectProxy + @namespace Ember + @extends Ember.Object + @extends Ember._ProxyMixin + @public + */ - WithDynamicVarsSyntax.prototype.compile = function compile(dsl, env) { - var args = this.args; - var blocks = this.args.blocks; + 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'; - dsl.unit(function (dsl) { - dsl.putArgs(args); - dsl.pushDynamicScope(); - dsl.bindDynamicScope(args.named.keys); - dsl.evaluate('default', blocks.default); - dsl.popDynamicScope(); - }); - }; + /** + 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. + + Example: + + ```javascript + App.ApplicationRoute = Ember.Route.extend({ + authManager: Ember.inject.service('auth'), + + model: function() { + return this.get('authManager').findCurrentUser(); + } + }); + ``` + + This example will create an `authManager` property on the application route + that looks up the `auth` service in the container, making it easily + accessible in the `model` hook. + + @method service + @since 1.10.0 + @for Ember.inject + @param {String} name (optional) name of the service to inject, defaults to + the property's name + @return {Ember.InjectedProperty} injection descriptor instance + @public + */ + _emberRuntimeInject.createInjectionHelper('service'); + + /** + @class Service + @namespace Ember + @extends Ember.Object + @since 1.10.0 + @public + */ + var Service = _emberRuntimeSystemObject.default.extend(); - return WithDynamicVarsSyntax; - })(_glimmerRuntimeLibSyntax.Statement); + Service.reopenClass({ + isServiceFactory: true + }); - exports.default = WithDynamicVarsSyntax; + exports.default = Service; }); +enifed('ember-runtime/system/string', ['exports', 'ember-metal', 'ember-utils', 'ember-runtime/utils', 'ember-runtime/string_registry'], function (exports, _emberMetal, _emberUtils, _emberRuntimeUtils, _emberRuntimeString_registry) { + /** + @module ember + @submodule ember-runtime + */ + 'use strict'; -enifed('glimmer-runtime/lib/syntax/builtins/with', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { - 'use strict'; + var STRING_DASHERIZE_REGEXP = /[ _]/g; - var WithSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(WithSyntax, _StatementSyntax); - - function WithSyntax(args) { - _StatementSyntax.call(this); - this.args = args; - this.type = "with-statement"; - } - - WithSyntax.prototype.compile = function compile(dsl, env) { - // PutArgs - // Test(Environment) - // Enter(BEGIN, END) - // BEGIN: Noop - // JumpUnless(ELSE) - // Evaluate(default) - // Jump(END) - // ELSE: Noop - // Evaluate(inverse) - // END: Noop - // Exit - var args = this.args; - var blocks = this.args.blocks; - - dsl.putArgs(args); - dsl.test('environment'); - dsl.block(null, function (dsl, BEGIN, END) { - if (blocks.inverse) { - dsl.jumpUnless('ELSE'); - dsl.evaluate('default', blocks.default); - dsl.jump(END); - dsl.label('ELSE'); - dsl.evaluate('inverse', blocks.inverse); - } else { - dsl.jumpUnless(END); - dsl.evaluate('default', blocks.default); - } - }); - }; + var STRING_DASHERIZE_CACHE = new _emberMetal.Cache(1000, function (key) { + return decamelize(key).replace(STRING_DASHERIZE_REGEXP, '-'); + }); - return WithSyntax; - })(_glimmerRuntimeLibSyntax.Statement); + var STRING_CAMELIZE_REGEXP_1 = /(\-|\_|\.|\s)+(.)?/g; + var STRING_CAMELIZE_REGEXP_2 = /(^|\/)([A-Z])/g; - exports.default = WithSyntax; -}); + var CAMELIZE_CACHE = new _emberMetal.Cache(1000, function (key) { + return key.replace(STRING_CAMELIZE_REGEXP_1, function (match, separator, chr) { + return chr ? chr.toUpperCase() : ''; + }).replace(STRING_CAMELIZE_REGEXP_2, function (match, separator, chr) { + return match.toLowerCase(); + }); + }); -enifed('glimmer-runtime/lib/syntax/core', ['exports', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/syntax/builtins/partial', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-runtime/lib/compiled/opcodes/component', 'glimmer-runtime/lib/compiled/opcodes/dom', 'glimmer-runtime/lib/syntax/expressions', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/compiled/expressions/value', 'glimmer-runtime/lib/compiled/expressions/lookups', 'glimmer-runtime/lib/compiled/expressions/has-block', 'glimmer-runtime/lib/compiled/expressions/helper', 'glimmer-runtime/lib/compiled/expressions/concat', 'glimmer-runtime/lib/utils', 'glimmer-runtime/lib/compiled/opcodes/content'], function (exports, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibSyntaxBuiltinsPartial, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerRuntimeLibCompiledOpcodesComponent, _glimmerRuntimeLibCompiledOpcodesDom, _glimmerRuntimeLibSyntaxExpressions, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibCompiledExpressionsValue, _glimmerRuntimeLibCompiledExpressionsLookups, _glimmerRuntimeLibCompiledExpressionsHasBlock, _glimmerRuntimeLibCompiledExpressionsHelper, _glimmerRuntimeLibCompiledExpressionsConcat, _glimmerRuntimeLibUtils, _glimmerRuntimeLibCompiledOpcodesContent) { - 'use strict'; + var STRING_CLASSIFY_REGEXP_1 = /^(\-|_)+(.)?/; + var STRING_CLASSIFY_REGEXP_2 = /(.)(\-|\_|\.|\s)+(.)?/g; + var STRING_CLASSIFY_REGEXP_3 = /(^|\/|\.)([a-z])/g; - var Block = (function (_StatementSyntax) { - babelHelpers.inherits(Block, _StatementSyntax); + var CLASSIFY_CACHE = new _emberMetal.Cache(1000, function (str) { + var replace1 = function (match, separator, chr) { + return chr ? '_' + chr.toUpperCase() : ''; + }; + var replace2 = function (match, initialChar, separator, chr) { + return initialChar + (chr ? chr.toUpperCase() : ''); + }; + var parts = str.split('/'); + for (var i = 0; i < parts.length; i++) { + parts[i] = parts[i].replace(STRING_CLASSIFY_REGEXP_1, replace1).replace(STRING_CLASSIFY_REGEXP_2, replace2); + } + return parts.join('/').replace(STRING_CLASSIFY_REGEXP_3, function (match, separator, chr) { + return match.toUpperCase(); + }); + }); - function Block(path, args) { - _StatementSyntax.call(this); - this.path = path; - this.args = args; - this.type = "block"; - } + var STRING_UNDERSCORE_REGEXP_1 = /([a-z\d])([A-Z]+)/g; + var STRING_UNDERSCORE_REGEXP_2 = /\-|\s+/g; - Block.fromSpec = function fromSpec(sexp, symbolTable, scanner) { - var path = sexp[1]; - var params = sexp[2]; - var hash = sexp[3]; - var templateId = sexp[4]; - var inverseId = sexp[5]; + var UNDERSCORE_CACHE = new _emberMetal.Cache(1000, function (str) { + return str.replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2').replace(STRING_UNDERSCORE_REGEXP_2, '_').toLowerCase(); + }); - var template = scanner.blockFor(symbolTable, templateId); - var inverse = typeof inverseId === 'number' ? scanner.blockFor(symbolTable, inverseId) : null; - var blocks = Blocks.fromSpec(template, inverse); - return new Block(path, Args.fromSpec(params, hash, blocks)); - }; + var STRING_CAPITALIZE_REGEXP = /(^|\/)([a-z])/g; - Block.build = function build(path, args) { - return new this(path, args); - }; + var CAPITALIZE_CACHE = new _emberMetal.Cache(1000, function (str) { + return str.replace(STRING_CAPITALIZE_REGEXP, function (match, separator, chr) { + return match.toUpperCase(); + }); + }); - Block.prototype.scan = function scan(scanner) { - var _args$blocks = this.args.blocks; - var _default = _args$blocks.default; - var inverse = _args$blocks.inverse; + var STRING_DECAMELIZE_REGEXP = /([a-z\d])([A-Z])/g; - if (_default) scanner.addChild(_default); - if (inverse) scanner.addChild(inverse); - return this; - }; + var DECAMELIZE_CACHE = new _emberMetal.Cache(1000, function (str) { + return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase(); + }); - Block.prototype.compile = function compile(ops) { - throw new Error("SyntaxError"); - }; + function _fmt(str, formats) { + var cachedFormats = formats; - return Block; - })(_glimmerRuntimeLibSyntax.Statement); + if (!_emberRuntimeUtils.isArray(cachedFormats) || arguments.length > 2) { + cachedFormats = new Array(arguments.length - 1); - exports.Block = Block; + for (var i = 1; i < arguments.length; i++) { + cachedFormats[i - 1] = arguments[i]; + } + } - var Append = (function (_StatementSyntax2) { - babelHelpers.inherits(Append, _StatementSyntax2); + // first, replace any ORDERED replacements. + var idx = 0; // the current index for non-numerical replacements + return str.replace(/%@([0-9]+)?/g, function (s, argIndex) { + argIndex = argIndex ? parseInt(argIndex, 10) - 1 : idx++; + s = cachedFormats[argIndex]; + return s === null ? '(null)' : s === undefined ? '' : _emberUtils.inspect(s); + }); + } - function Append(_ref) { - var value = _ref.value; - var trustingMorph = _ref.trustingMorph; + function fmt(str, formats) { + _emberMetal.deprecate('Ember.String.fmt is deprecated, use ES6 template strings instead.', false, { id: 'ember-string-utils.fmt', until: '3.0.0', url: 'http://babeljs.io/docs/learn-es2015/#template-strings' }); + return _fmt.apply(undefined, arguments); + } - _StatementSyntax2.call(this); - this.value = value; - this.trustingMorph = trustingMorph; - } + function loc(str, formats) { + if (!_emberRuntimeUtils.isArray(formats) || arguments.length > 2) { + formats = Array.prototype.slice.call(arguments, 1); + } - Append.fromSpec = function fromSpec(sexp) { - var value = sexp[1]; - var trustingMorph = sexp[2]; + str = _emberRuntimeString_registry.get(str) || str; + return _fmt(str, formats); + } - return new OptimizedAppend({ value: _glimmerRuntimeLibSyntaxExpressions.default(value), trustingMorph: trustingMorph }); - }; + function w(str) { + return str.split(/\s+/); + } - return Append; - })(_glimmerRuntimeLibSyntax.Statement); + function decamelize(str) { + return DECAMELIZE_CACHE.get(str); + } - exports.Append = Append; + function dasherize(str) { + return STRING_DASHERIZE_CACHE.get(str); + } - var OptimizedAppend = (function (_Append) { - babelHelpers.inherits(OptimizedAppend, _Append); + function camelize(str) { + return CAMELIZE_CACHE.get(str); + } - function OptimizedAppend() { - _Append.apply(this, arguments); - this.type = "optimized-append"; - } + function classify(str) { + return CLASSIFY_CACHE.get(str); + } - OptimizedAppend.prototype.deopt = function deopt() { - return new UnoptimizedAppend(this); - }; + function underscore(str) { + return UNDERSCORE_CACHE.get(str); + } - OptimizedAppend.prototype.compile = function compile(compiler, env, symbolTable) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesVm.PutValueOpcode(this.value.compile(compiler, env, symbolTable))); - if (this.trustingMorph) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesContent.OptimizedTrustingAppendOpcode()); - } else { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesContent.OptimizedCautiousAppendOpcode()); - } - }; + function capitalize(str) { + return CAPITALIZE_CACHE.get(str); + } - return OptimizedAppend; - })(Append); + /** + Defines string helper methods including string formatting and localization. + Unless `EmberENV.EXTEND_PROTOTYPES.String` is `false` these methods will also be + added to the `String.prototype` as well. + + @class String + @namespace Ember + @static + @public + */ + exports.default = { + /** + Apply formatting options to the string. This will look for occurrences + of "%@" in your string and substitute them with the arguments you pass into + this method. If you want to control the specific order of replacement, + you can add a number after the key as well to indicate which argument + you want to insert. + Ordered insertions are most useful when building loc strings where values + you need to insert may appear in different orders. + ```javascript + "Hello %@ %@".fmt('John', 'Doe'); // "Hello John Doe" + "Hello %@2, %@1".fmt('John', 'Doe'); // "Hello Doe, John" + ``` + @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: http://babeljs.io/docs/learn-es2015/#template-strings + */ + fmt: fmt, - exports.OptimizedAppend = OptimizedAppend; + /** + Formats the passed string, but first looks up the string in the localized + strings hash. This is a convenient way to localize text. See + `Ember.String.fmt()` for more information on formatting. + Note that it is traditional but not required to prefix localized string + keys with an underscore or other character so you can easily identify + localized strings. + ```javascript + Ember.STRINGS = { + '_Hello World': 'Bonjour le monde', + '_Hello %@ %@': 'Bonjour %@ %@' + }; + Ember.String.loc("_Hello World"); // 'Bonjour le monde'; + Ember.String.loc("_Hello %@ %@", ["John", "Smith"]); // "Bonjour John Smith"; + ``` + @method loc + @param {String} str The string to format + @param {Array} formats Optional array of parameters to interpolate into string. + @return {String} formatted string + @public + */ + loc: loc, - var UnoptimizedAppend = (function (_Append2) { - babelHelpers.inherits(UnoptimizedAppend, _Append2); + /** + Splits a string into separate units separated by spaces, eliminating any + empty strings in the process. This is a convenience method for split that + is mostly useful when applied to the `String.prototype`. + ```javascript + Ember.String.w("alpha beta gamma").forEach(function(key) { + console.log(key); + }); + // > alpha + // > beta + // > gamma + ``` + @method w + @param {String} str The string to split + @return {Array} array containing the split strings + @public + */ + w: w, - function UnoptimizedAppend() { - _Append2.apply(this, arguments); - this.type = "unoptimized-append"; - } + /** + Converts a camelized string into all lower case separated by underscores. + ```javascript + 'innerHTML'.decamelize(); // 'inner_html' + 'action_name'.decamelize(); // 'action_name' + 'css-class-name'.decamelize(); // 'css-class-name' + 'my favorite items'.decamelize(); // 'my favorite items' + ``` + @method decamelize + @param {String} str The string to decamelize. + @return {String} the decamelized string. + @public + */ + decamelize: decamelize, - UnoptimizedAppend.prototype.compile = function compile(compiler, env, symbolTable) { - var expression = this.value.compile(compiler, env, symbolTable); - if (this.trustingMorph) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesContent.GuardedTrustingAppendOpcode(expression, symbolTable)); - } else { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesContent.GuardedCautiousAppendOpcode(expression, symbolTable)); - } - }; + /** + Replaces underscores, spaces, or camelCase with dashes. + ```javascript + 'innerHTML'.dasherize(); // 'inner-html' + 'action_name'.dasherize(); // 'action-name' + 'css-class-name'.dasherize(); // 'css-class-name' + 'my favorite items'.dasherize(); // 'my-favorite-items' + 'privateDocs/ownerInvoice'.dasherize(); // 'private-docs/owner-invoice' + ``` + @method dasherize + @param {String} str The string to dasherize. + @return {String} the dasherized string. + @public + */ + dasherize: dasherize, - return UnoptimizedAppend; - })(Append); + /** + Returns the lowerCamelCase form of a string. + ```javascript + 'innerHTML'.camelize(); // 'innerHTML' + 'action_name'.camelize(); // 'actionName' + 'css-class-name'.camelize(); // 'cssClassName' + 'my favorite items'.camelize(); // 'myFavoriteItems' + 'My Favorite Items'.camelize(); // 'myFavoriteItems' + 'private-docs/owner-invoice'.camelize(); // 'privateDocs/ownerInvoice' + ``` + @method camelize + @param {String} str The string to camelize. + @return {String} the camelized string. + @public + */ + camelize: camelize, - exports.UnoptimizedAppend = UnoptimizedAppend; + /** + Returns the UpperCamelCase form of a string. + ```javascript + 'innerHTML'.classify(); // 'InnerHTML' + 'action_name'.classify(); // 'ActionName' + 'css-class-name'.classify(); // 'CssClassName' + 'my favorite items'.classify(); // 'MyFavoriteItems' + 'private-docs/owner-invoice'.classify(); // 'PrivateDocs/OwnerInvoice' + ``` + @method classify + @param {String} str the string to classify + @return {String} the classified string + @public + */ + classify: classify, - var MODIFIER_SYNTAX = "c0420397-8ff1-4241-882b-4b7a107c9632"; + /** + More general than decamelize. Returns the lower\_case\_and\_underscored + form of a string. + ```javascript + 'innerHTML'.underscore(); // 'inner_html' + 'action_name'.underscore(); // 'action_name' + 'css-class-name'.underscore(); // 'css_class_name' + 'my favorite items'.underscore(); // 'my_favorite_items' + 'privateDocs/ownerInvoice'.underscore(); // 'private_docs/owner_invoice' + ``` + @method underscore + @param {String} str The string to underscore. + @return {String} the underscored string. + @public + */ + underscore: underscore, - var Modifier = (function (_StatementSyntax3) { - babelHelpers.inherits(Modifier, _StatementSyntax3); + /** + Returns the Capitalized form of a string + ```javascript + 'innerHTML'.capitalize() // 'InnerHTML' + 'action_name'.capitalize() // 'Action_name' + 'css-class-name'.capitalize() // 'Css-class-name' + 'my favorite items'.capitalize() // 'My favorite items' + 'privateDocs/ownerInvoice'.capitalize(); // 'PrivateDocs/ownerInvoice' + ``` + @method capitalize + @param {String} str The string to capitalize. + @return {String} The capitalized string. + @public + */ + capitalize: capitalize + }; + exports.fmt = fmt; + exports.loc = loc; + exports.w = w; + exports.decamelize = decamelize; + exports.dasherize = dasherize; + exports.camelize = camelize; + exports.classify = classify; + exports.underscore = underscore; + exports.capitalize = capitalize; +}); +enifed('ember-runtime/utils', ['exports', 'ember-runtime/mixins/array', 'ember-runtime/system/object'], function (exports, _emberRuntimeMixinsArray, _emberRuntimeSystemObject) { + 'use strict'; - function Modifier(options) { - _StatementSyntax3.call(this); - this["c0420397-8ff1-4241-882b-4b7a107c9632"] = true; - this.type = "modifier"; - this.path = options.path; - this.args = options.args; - } + exports.isArray = isArray; + exports.typeOf = typeOf; - Modifier.fromSpec = function fromSpec(node) { - var path = node[1]; - var params = node[2]; - var hash = node[3]; + // ........................................ + // TYPING & ARRAY MESSAGING + // + var TYPE_MAP = { + '[object Boolean]': 'boolean', + '[object Number]': 'number', + '[object String]': 'string', + '[object Function]': 'function', + '[object Array]': 'array', + '[object Date]': 'date', + '[object RegExp]': 'regexp', + '[object Object]': 'object', + '[object FileList]': 'filelist' + }; - return new Modifier({ - path: path, - args: Args.fromSpec(params, hash, EMPTY_BLOCKS) - }); - }; + var toString = Object.prototype.toString; - Modifier.build = function build(path, options) { - return new Modifier({ - path: path, - params: options.params, - hash: options.hash - }); - }; + /** + Returns true if the passed object is an array or Array-like. + + Objects are considered Array-like if any of the following are true: + + - the object is a native Array + - the object has an objectAt property + - the object is an Object, and has a length property + + Unlike `Ember.typeOf` this method returns true even if the passed object is + not formally an array but appears to be array-like (i.e. implements `Ember.Array`) + + ```javascript + Ember.isArray(); // false + Ember.isArray([]); // true + Ember.isArray(Ember.ArrayProxy.create({ content: [] })); // true + ``` + + @method isArray + @for Ember + @param {Object} obj The object to test + @return {Boolean} true if the passed object is an array or Array-like + @public + */ - Modifier.prototype.compile = function compile(compiler, env, symbolTable) { - var args = this.args.compile(compiler, env, symbolTable); - if (env.hasModifier(this.path, symbolTable)) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.ModifierOpcode(this.path[0], env.lookupModifier(this.path, symbolTable), args)); - } else { - throw new Error('Compile Error: ' + this.path.join('.') + ' is not a modifier'); - } - }; + function isArray(obj) { + if (!obj || obj.setInterval) { + return false; + } + if (Array.isArray(obj)) { + return true; + } + if (_emberRuntimeMixinsArray.default.detect(obj)) { + return true; + } - return Modifier; - })(_glimmerRuntimeLibSyntax.Statement); + var type = typeOf(obj); + if ('array' === type) { + return true; + } + if (obj.length !== undefined && 'object' === type) { + return true; + } + return false; + } - exports.Modifier = Modifier; + /** + Returns a consistent type for the passed object. + + Use this instead of the built-in `typeof` to get the type of an item. + It will return the same result across all browsers and includes a bit + more detail. Here is what will be returned: + + | Return Value | Meaning | + |---------------|------------------------------------------------------| + | 'string' | String primitive or String object. | + | 'number' | Number primitive or Number object. | + | 'boolean' | Boolean primitive or Boolean object. | + | 'null' | Null value | + | 'undefined' | Undefined value | + | 'function' | A function | + | 'array' | An instance of Array | + | 'regexp' | An instance of RegExp | + | 'date' | An instance of Date | + | 'filelist' | An instance of FileList | + | 'class' | An Ember class (created using Ember.Object.extend()) | + | 'instance' | An Ember object instance | + | 'error' | An instance of the Error object | + | 'object' | A JavaScript object not inheriting from Ember.Object | + + Examples: + + ```javascript + Ember.typeOf(); // 'undefined' + Ember.typeOf(null); // 'null' + Ember.typeOf(undefined); // 'undefined' + Ember.typeOf('michael'); // 'string' + Ember.typeOf(new String('michael')); // 'string' + Ember.typeOf(101); // 'number' + Ember.typeOf(new Number(101)); // 'number' + Ember.typeOf(true); // 'boolean' + Ember.typeOf(new Boolean(true)); // 'boolean' + Ember.typeOf(Ember.makeArray); // 'function' + Ember.typeOf([1, 2, 90]); // 'array' + Ember.typeOf(/abc/); // 'regexp' + Ember.typeOf(new Date()); // 'date' + Ember.typeOf(event.target.files); // 'filelist' + Ember.typeOf(Ember.Object.extend()); // 'class' + Ember.typeOf(Ember.Object.create()); // 'instance' + Ember.typeOf(new Error('teamocil')); // 'error' + + // 'normal' JavaScript object + Ember.typeOf({ a: 'b' }); // 'object' + ``` + + @method typeOf + @for Ember + @param {Object} item the item to check + @return {String} the type + @public + */ - var StaticArg = (function (_ArgumentSyntax) { - babelHelpers.inherits(StaticArg, _ArgumentSyntax); + function typeOf(item) { + if (item === null) { + return 'null'; + } + if (item === undefined) { + return 'undefined'; + } + var ret = TYPE_MAP[toString.call(item)] || 'object'; - function StaticArg(name, value) { - _ArgumentSyntax.call(this); - this.name = name; - this.value = value; - this.type = "static-arg"; - } + if (ret === 'function') { + if (_emberRuntimeSystemObject.default.detect(item)) { + ret = 'class'; + } + } else if (ret === 'object') { + if (item instanceof Error) { + ret = 'error'; + } else if (item instanceof _emberRuntimeSystemObject.default) { + ret = 'instance'; + } else if (item instanceof Date) { + ret = 'date'; + } + } - StaticArg.fromSpec = function fromSpec(node) { - var name = node[1]; - var value = node[2]; + return ret; + } +}); +enifed('ember-testing/adapters/adapter', ['exports', 'ember-runtime'], function (exports, _emberRuntime) { + 'use strict'; - return new StaticArg(name, value); - }; + function K() { + return this; + } - StaticArg.build = function build(name, value) { - var namespace = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; + /** + @module ember + @submodule ember-testing + */ - return new this(name, value); - }; + /** + The primary purpose of this class is to create hooks that can be implemented + by an adapter for various test frameworks. + + @class Adapter + @namespace Ember.Test + @public + */ + exports.default = _emberRuntime.Object.extend({ + /** + This callback will be called whenever an async operation is about to start. + Override this to call your framework's methods that handle async + operations. + @public + @method asyncStart + */ + asyncStart: K, - StaticArg.prototype.compile = function compile() { - throw new Error('Cannot compiler StaticArg "' + this.name + '" as it is a delegate for ValueSyntax.'); - }; + /** + This callback will be called whenever an async operation has completed. + @public + @method asyncEnd + */ + asyncEnd: K, - StaticArg.prototype.valueSyntax = function valueSyntax() { - return Value.build(this.value); + /** + Override this method with your testing framework's false assertion. + This function is called whenever an exception occurs causing the testing + promise to fail. + QUnit example: + ```javascript + exception: function(error) { + ok(false, error); }; + ``` + @public + @method exception + @param {String} error The exception to be raised. + */ + exception: function (error) { + throw error; + } + }); +}); +enifed('ember-testing/adapters/qunit', ['exports', 'ember-utils', 'ember-testing/adapters/adapter'], function (exports, _emberUtils, _emberTestingAdaptersAdapter) { + 'use strict'; - return StaticArg; - })(_glimmerRuntimeLibSyntax.Argument); + /** + This class implements the methods defined by Ember.Test.Adapter for the + QUnit testing framework. + + @class QUnitAdapter + @namespace Ember.Test + @extends Ember.Test.Adapter + @public + */ + exports.default = _emberTestingAdaptersAdapter.default.extend({ + asyncStart: function () { + QUnit.stop(); + }, + asyncEnd: function () { + QUnit.start(); + }, + exception: function (error) { + ok(false, _emberUtils.inspect(error)); + } + }); +}); +enifed('ember-testing/events', ['exports', 'ember-views', 'ember-metal'], function (exports, _emberViews, _emberMetal) { + 'use strict'; - exports.StaticArg = StaticArg; + exports.focus = focus; + exports.fireEvent = fireEvent; - var DynamicArg = (function (_ArgumentSyntax2) { - babelHelpers.inherits(DynamicArg, _ArgumentSyntax2); + var DEFAULT_EVENT_OPTIONS = { canBubble: true, cancelable: true }; + var KEYBOARD_EVENT_TYPES = ['keydown', 'keypress', 'keyup']; + var MOUSE_EVENT_TYPES = ['click', 'mousedown', 'mouseup', 'dblclick', 'mouseenter', 'mouseleave', 'mousemove', 'mouseout', 'mouseover']; - function DynamicArg(name, value) { - var namespace = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; + function focus(el) { + if (!el) { + return; + } + var $el = _emberViews.jQuery(el); + if ($el.is(':input, [contenteditable=true]')) { + var type = $el.prop('type'); + if (type !== 'checkbox' && type !== 'radio' && type !== 'hidden') { + _emberMetal.run(null, function () { + // Firefox does not trigger the `focusin` event if the window + // does not have focus. If the document doesn't have focus just + // use trigger('focusin') instead. - _ArgumentSyntax2.call(this); - this.name = name; - this.value = value; - this.namespace = namespace; - this.type = 'dynamic-arg'; - } + if (!document.hasFocus || document.hasFocus()) { + el.focus(); + } else { + $el.trigger('focusin'); + } + }); + } + } + } - DynamicArg.fromSpec = function fromSpec(sexp) { - var name = sexp[1]; - var value = sexp[2]; + function fireEvent(element, type) { + var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; - return new DynamicArg(name, _glimmerRuntimeLibSyntaxExpressions.default(value)); - }; + if (!element) { + return; + } + var event = undefined; + if (KEYBOARD_EVENT_TYPES.indexOf(type) > -1) { + event = buildKeyboardEvent(type, options); + } else if (MOUSE_EVENT_TYPES.indexOf(type) > -1) { + var rect = element.getBoundingClientRect(); + var x = rect.left + 1; + var y = rect.top + 1; + var simulatedCoordinates = { + screenX: x + 5, + screenY: y + 95, + clientX: x, + clientY: y + }; + event = buildMouseEvent(type, _emberViews.jQuery.extend(simulatedCoordinates, options)); + } else { + event = buildBasicEvent(type, options); + } + element.dispatchEvent(event); + } - DynamicArg.build = function build(name, value) { - return new this(name, value); - }; + function buildBasicEvent(type) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - DynamicArg.prototype.compile = function compile() { - throw new Error('Cannot compile DynamicArg for "' + this.name + '" as it is delegate for ExpressionSyntax.'); - }; + var event = document.createEvent('Events'); + event.initEvent(type, true, true); + _emberViews.jQuery.extend(event, options); + return event; + } - DynamicArg.prototype.valueSyntax = function valueSyntax() { - return this.value; - }; + function buildMouseEvent(type) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - return DynamicArg; - })(_glimmerRuntimeLibSyntax.Argument); + var event = undefined; + try { + event = document.createEvent('MouseEvents'); + var eventOpts = _emberViews.jQuery.extend({}, DEFAULT_EVENT_OPTIONS, options); + event.initMouseEvent(type, eventOpts.canBubble, eventOpts.cancelable, window, eventOpts.detail, eventOpts.screenX, eventOpts.screenY, eventOpts.clientX, eventOpts.clientY, eventOpts.ctrlKey, eventOpts.altKey, eventOpts.shiftKey, eventOpts.metaKey, eventOpts.button, eventOpts.relatedTarget); + } catch (e) { + event = buildBasicEvent(type, options); + } + return event; + } - exports.DynamicArg = DynamicArg; + function buildKeyboardEvent(type) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - var TrustingAttr = (function () { - function TrustingAttr() {} + var event = undefined; + try { + event = document.createEvent('KeyEvents'); + var eventOpts = _emberViews.jQuery.extend({}, DEFAULT_EVENT_OPTIONS, options); + event.initKeyEvent(type, eventOpts.canBubble, eventOpts.cancelable, window, eventOpts.ctrlKey, eventOpts.altKey, eventOpts.shiftKey, eventOpts.metaKey, eventOpts.keyCode, eventOpts.charCode); + } catch (e) { + event = buildBasicEvent(type, options); + } + return event; + } +}); +enifed('ember-testing/ext/application', ['exports', 'ember-application', 'ember-testing/setup_for_testing', 'ember-testing/test/helpers', 'ember-testing/test/promise', 'ember-testing/test/run', 'ember-testing/test/on_inject_helpers', 'ember-testing/test/adapter'], function (exports, _emberApplication, _emberTestingSetup_for_testing, _emberTestingTestHelpers, _emberTestingTestPromise, _emberTestingTestRun, _emberTestingTestOn_inject_helpers, _emberTestingTestAdapter) { + 'use strict'; - TrustingAttr.fromSpec = function fromSpec(sexp) { - var name = sexp[1]; - var value = sexp[2]; - var namespace = sexp[3]; + _emberApplication.Application.reopen({ + /** + This property contains the testing helpers for the current application. These + are created once you call `injectTestHelpers` on your `Ember.Application` + instance. The included helpers are also available on the `window` object by + default, but can be used from this object on the individual application also. + @property testHelpers + @type {Object} + @default {} + @public + */ + testHelpers: {}, - return new DynamicAttr(name, _glimmerRuntimeLibSyntaxExpressions.default(value), namespace, true); - }; + /** + This property will contain the original methods that were registered + on the `helperContainer` before `injectTestHelpers` is called. + When `removeTestHelpers` is called, these methods are restored to the + `helperContainer`. + @property originalMethods + @type {Object} + @default {} + @private + @since 1.3.0 + */ + originalMethods: {}, - TrustingAttr.build = function build(name, value, isTrusting) { - var namespace = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3]; + /** + This property indicates whether or not this application is currently in + testing mode. This is set when `setupForTesting` is called on the current + application. + @property testing + @type {Boolean} + @default false + @since 1.3.0 + @public + */ + testing: false, - return new DynamicAttr(name, value, namespace, isTrusting); - }; + /** + This hook defers the readiness of the application, so that you can start + the app when your tests are ready to run. It also sets the router's + location to 'none', so that the window's location will not be modified + (preventing both accidental leaking of state between tests and interference + with your testing framework). + Example: + ``` + App.setupForTesting(); + ``` + @method setupForTesting + @public + */ + setupForTesting: function () { + _emberTestingSetup_for_testing.default(); - TrustingAttr.prototype.compile = function compile() { - throw new Error('Attempting to compile a TrustingAttr which is just a delegate for DynamicAttr.'); - }; + this.testing = true; - return TrustingAttr; - })(); + this.Router.reopen({ + location: 'none' + }); + }, - exports.TrustingAttr = TrustingAttr; + /** + This will be used as the container to inject the test helpers into. By + default the helpers are injected into `window`. + @property helperContainer + @type {Object} The object to be used for test helpers. + @default window + @since 1.2.0 + @private + */ + helperContainer: null, - var StaticAttr = (function (_AttributeSyntax) { - babelHelpers.inherits(StaticAttr, _AttributeSyntax); + /** + This injects the test helpers into the `helperContainer` object. If an object is provided + it will be used as the helperContainer. If `helperContainer` is not set it will default + to `window`. If a function of the same name has already been defined it will be cached + (so that it can be reset if the helper is removed with `unregisterHelper` or + `removeTestHelpers`). + Any callbacks registered with `onInjectHelpers` will be called once the + helpers have been injected. + Example: + ``` + App.injectTestHelpers(); + ``` + @method injectTestHelpers + @public + */ + injectTestHelpers: function (helperContainer) { + if (helperContainer) { + this.helperContainer = helperContainer; + } else { + this.helperContainer = window; + } - function StaticAttr(name, value, namespace) { - _AttributeSyntax.call(this); - this.name = name; - this.value = value; - this.namespace = namespace; - this["e1185d30-7cac-4b12-b26a-35327d905d92"] = true; - this.type = "static-attr"; - this.isTrusting = false; + this.reopen({ + willDestroy: function () { + this._super.apply(this, arguments); + this.removeTestHelpers(); } + }); - StaticAttr.fromSpec = function fromSpec(node) { - var name = node[1]; - var value = node[2]; - var namespace = node[3]; - - return new StaticAttr(name, value, namespace); - }; - - StaticAttr.build = function build(name, value) { - var namespace = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; + this.testHelpers = {}; + for (var _name in _emberTestingTestHelpers.helpers) { + this.originalMethods[_name] = this.helperContainer[_name]; + this.testHelpers[_name] = this.helperContainer[_name] = helper(this, _name); + protoWrap(_emberTestingTestPromise.default.prototype, _name, helper(this, _name), _emberTestingTestHelpers.helpers[_name].meta.wait); + } - return new this(name, value, namespace); - }; + _emberTestingTestOn_inject_helpers.invokeInjectHelpersCallbacks(this); + }, - StaticAttr.prototype.compile = function compile(compiler) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.StaticAttrOpcode(this.namespace, this.name, this.value)); - }; + /** + This removes all helpers that have been registered, and resets and functions + that were overridden by the helpers. + Example: + ```javascript + App.removeTestHelpers(); + ``` + @public + @method removeTestHelpers + */ + removeTestHelpers: function () { + if (!this.helperContainer) { + return; + } - StaticAttr.prototype.valueSyntax = function valueSyntax() { - return Value.build(this.value); - }; + for (var _name2 in _emberTestingTestHelpers.helpers) { + this.helperContainer[_name2] = this.originalMethods[_name2]; + delete _emberTestingTestPromise.default.prototype[_name2]; + delete this.testHelpers[_name2]; + delete this.originalMethods[_name2]; + } + } + }); - return StaticAttr; - })(_glimmerRuntimeLibSyntax.Attribute); + // This method is no longer needed + // But still here for backwards compatibility + // of helper chaining + function protoWrap(proto, name, callback, isAsync) { + proto[name] = function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - exports.StaticAttr = StaticAttr; + if (isAsync) { + return callback.apply(this, args); + } else { + return this.then(function () { + return callback.apply(this, args); + }); + } + }; + } - var DynamicAttr = (function (_AttributeSyntax2) { - babelHelpers.inherits(DynamicAttr, _AttributeSyntax2); + function helper(app, name) { + var fn = _emberTestingTestHelpers.helpers[name].method; + var meta = _emberTestingTestHelpers.helpers[name].meta; + if (!meta.wait) { + return function () { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - function DynamicAttr(name, value, namespace, isTrusting) { - if (namespace === undefined) namespace = undefined; + return fn.apply(app, [app].concat(args)); + }; + } - _AttributeSyntax2.call(this); - this.name = name; - this.value = value; - this.namespace = namespace; - this.isTrusting = isTrusting; - this["e1185d30-7cac-4b12-b26a-35327d905d92"] = true; - this.type = "dynamic-attr"; - } + return function () { + for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } - DynamicAttr.fromSpec = function fromSpec(sexp) { - var name = sexp[1]; - var value = sexp[2]; - var namespace = sexp[3]; + var lastPromise = _emberTestingTestRun.default(function () { + return _emberTestingTestPromise.resolve(_emberTestingTestPromise.getLastPromise()); + }); - return new DynamicAttr(name, _glimmerRuntimeLibSyntaxExpressions.default(value), namespace); - }; + // wait for last helper's promise to resolve and then + // execute. To be safe, we need to tell the adapter we're going + // asynchronous here, because fn may not be invoked before we + // return. + _emberTestingTestAdapter.asyncStart(); + return lastPromise.then(function () { + return fn.apply(app, [app].concat(args)); + }).finally(_emberTestingTestAdapter.asyncEnd); + }; + } +}); +enifed('ember-testing/ext/rsvp', ['exports', 'ember-runtime', 'ember-metal', 'ember-testing/test/adapter'], function (exports, _emberRuntime, _emberMetal, _emberTestingTestAdapter) { + 'use strict'; - DynamicAttr.build = function build(name, value) { - var isTrusting = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2]; - var namespace = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3]; + _emberRuntime.RSVP.configure('async', function (callback, promise) { + // if schedule will cause autorun, we need to inform adapter + if (_emberMetal.isTesting() && !_emberMetal.run.backburner.currentInstance) { + _emberTestingTestAdapter.asyncStart(); + _emberMetal.run.backburner.schedule('actions', function () { + _emberTestingTestAdapter.asyncEnd(); + callback(promise); + }); + } else { + _emberMetal.run.backburner.schedule('actions', function () { + return callback(promise); + }); + } + }); - return new this(name, value, namespace, isTrusting); - }; + exports.default = _emberRuntime.RSVP; +}); +enifed('ember-testing/helpers', ['exports', 'ember-metal', 'ember-testing/test/helpers', 'ember-testing/helpers/and_then', 'ember-testing/helpers/click', 'ember-testing/helpers/current_path', 'ember-testing/helpers/current_route_name', 'ember-testing/helpers/current_url', 'ember-testing/helpers/fill_in', 'ember-testing/helpers/find', 'ember-testing/helpers/find_with_assert', 'ember-testing/helpers/key_event', 'ember-testing/helpers/pause_test', 'ember-testing/helpers/trigger_event', 'ember-testing/helpers/visit', 'ember-testing/helpers/wait'], function (exports, _emberMetal, _emberTestingTestHelpers, _emberTestingHelpersAnd_then, _emberTestingHelpersClick, _emberTestingHelpersCurrent_path, _emberTestingHelpersCurrent_route_name, _emberTestingHelpersCurrent_url, _emberTestingHelpersFill_in, _emberTestingHelpersFind, _emberTestingHelpersFind_with_assert, _emberTestingHelpersKey_event, _emberTestingHelpersPause_test, _emberTestingHelpersTrigger_event, _emberTestingHelpersVisit, _emberTestingHelpersWait) { + 'use strict'; - DynamicAttr.prototype.compile = function compile(compiler, env, symbolTable) { - var namespace = this.namespace; - var value = this.value; + _emberTestingTestHelpers.registerAsyncHelper('visit', _emberTestingHelpersVisit.default); + _emberTestingTestHelpers.registerAsyncHelper('click', _emberTestingHelpersClick.default); + _emberTestingTestHelpers.registerAsyncHelper('keyEvent', _emberTestingHelpersKey_event.default); + _emberTestingTestHelpers.registerAsyncHelper('fillIn', _emberTestingHelpersFill_in.default); + _emberTestingTestHelpers.registerAsyncHelper('wait', _emberTestingHelpersWait.default); + _emberTestingTestHelpers.registerAsyncHelper('andThen', _emberTestingHelpersAnd_then.default); + _emberTestingTestHelpers.registerAsyncHelper('pauseTest', _emberTestingHelpersPause_test.pauseTest); + _emberTestingTestHelpers.registerAsyncHelper('triggerEvent', _emberTestingHelpersTrigger_event.default); - compiler.append(new _glimmerRuntimeLibCompiledOpcodesVm.PutValueOpcode(value.compile(compiler, env, symbolTable))); - if (namespace) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.DynamicAttrNSOpcode(this.name, this.namespace, this.isTrusting)); - } else { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.DynamicAttrOpcode(this.name, this.isTrusting)); - } - }; + _emberTestingTestHelpers.registerHelper('find', _emberTestingHelpersFind.default); + _emberTestingTestHelpers.registerHelper('findWithAssert', _emberTestingHelpersFind_with_assert.default); + _emberTestingTestHelpers.registerHelper('currentRouteName', _emberTestingHelpersCurrent_route_name.default); + _emberTestingTestHelpers.registerHelper('currentPath', _emberTestingHelpersCurrent_path.default); + _emberTestingTestHelpers.registerHelper('currentURL', _emberTestingHelpersCurrent_url.default); - DynamicAttr.prototype.valueSyntax = function valueSyntax() { - return this.value; - }; + if (_emberMetal.isFeatureEnabled('ember-testing-resume-test')) { + _emberTestingTestHelpers.registerHelper('resumeTest', _emberTestingHelpersPause_test.resumeTest); + } +}); +enifed("ember-testing/helpers/and_then", ["exports"], function (exports) { + /** + @module ember + @submodule ember-testing + */ + "use strict"; - return DynamicAttr; - })(_glimmerRuntimeLibSyntax.Attribute); + exports.default = andThen; - exports.DynamicAttr = DynamicAttr; + function andThen(app, callback) { + return app.testHelpers.wait(callback(app)); + } +}); +enifed('ember-testing/helpers/click', ['exports', 'ember-testing/events'], function (exports, _emberTestingEvents) { + /** + @module ember + @submodule ember-testing + */ + 'use strict'; - var FlushElement = (function (_StatementSyntax4) { - babelHelpers.inherits(FlushElement, _StatementSyntax4); + exports.default = click; - function FlushElement() { - _StatementSyntax4.apply(this, arguments); - this.type = "flush-element"; - } + /** + Clicks an element and triggers any actions triggered by the element's `click` + event. + + Example: + + ```javascript + click('.some-jQuery-selector').then(function() { + // assert something + }); + ``` + + @method click + @param {String} selector jQuery selector for finding element on the DOM + @param {Object} context A DOM Element, Document, or jQuery to use as context + @return {RSVP.Promise} + @public + */ - FlushElement.fromSpec = function fromSpec() { - return new FlushElement(); - }; + function click(app, selector, context) { + var $el = app.testHelpers.findWithAssert(selector, context); + var el = $el[0]; - FlushElement.build = function build() { - return new this(); - }; + _emberTestingEvents.fireEvent(el, 'mousedown'); - FlushElement.prototype.compile = function compile(compiler) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.FlushElementOpcode()); - }; + _emberTestingEvents.focus(el); - return FlushElement; - })(_glimmerRuntimeLibSyntax.Statement); + _emberTestingEvents.fireEvent(el, 'mouseup'); + _emberTestingEvents.fireEvent(el, 'click'); - exports.FlushElement = FlushElement; + return app.testHelpers.wait(); + } +}); +enifed('ember-testing/helpers/current_path', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-testing + */ + 'use strict'; - var CloseElement = (function (_StatementSyntax5) { - babelHelpers.inherits(CloseElement, _StatementSyntax5); + exports.default = currentPath; - function CloseElement() { - _StatementSyntax5.apply(this, arguments); - this.type = "close-element"; - } + /** + Returns the current path. + + Example: + + ```javascript + function validateURL() { + equal(currentPath(), 'some.path.index', "correct path was transitioned into."); + } + + click('#some-link-id').then(validateURL); + ``` + + @method currentPath + @return {Object} The currently active path. + @since 1.5.0 + @public + */ - CloseElement.fromSpec = function fromSpec() { - return new CloseElement(); - }; + function currentPath(app) { + var routingService = app.__container__.lookup('service:-routing'); + return _emberMetal.get(routingService, 'currentPath'); + } +}); +enifed('ember-testing/helpers/current_route_name', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-testing + */ + 'use strict'; - CloseElement.build = function build() { - return new this(); - }; + exports.default = currentRouteName; - CloseElement.prototype.compile = function compile(compiler) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.CloseElementOpcode()); - }; + /** + Returns the currently active route name. + Example: + ```javascript + function validateRouteName() { + equal(currentRouteName(), 'some.path', "correct route was transitioned into."); + } + visit('/some/path').then(validateRouteName) + ``` + @method currentRouteName + @return {Object} The name of the currently active route. + @since 1.5.0 + @public + */ - return CloseElement; - })(_glimmerRuntimeLibSyntax.Statement); + function currentRouteName(app) { + var routingService = app.__container__.lookup('service:-routing'); + return _emberMetal.get(routingService, 'currentRouteName'); + } +}); +enifed('ember-testing/helpers/current_url', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-testing + */ + 'use strict'; - exports.CloseElement = CloseElement; + exports.default = currentURL; - var Text = (function (_StatementSyntax6) { - babelHelpers.inherits(Text, _StatementSyntax6); + /** + Returns the current URL. + + Example: + + ```javascript + function validateURL() { + equal(currentURL(), '/some/path', "correct URL was transitioned into."); + } + + click('#some-link-id').then(validateURL); + ``` + + @method currentURL + @return {Object} The currently active URL. + @since 1.5.0 + @public + */ - function Text(content) { - _StatementSyntax6.call(this); - this.content = content; - this.type = "text"; - } + function currentURL(app) { + var router = app.__container__.lookup('router:main'); + return _emberMetal.get(router, 'location').getURL(); + } +}); +enifed('ember-testing/helpers/fill_in', ['exports', 'ember-testing/events'], function (exports, _emberTestingEvents) { + /** + @module ember + @submodule ember-testing + */ + 'use strict'; - Text.fromSpec = function fromSpec(node) { - var content = node[1]; + exports.default = fillIn; - return new Text(content); - }; + /** + Fills in an input element with some text. + + Example: + + ```javascript + fillIn('#email', 'you@example.com').then(function() { + // assert something + }); + ``` + + @method fillIn + @param {String} selector jQuery selector finding an input element on the DOM + to fill text with + @param {String} text text to place inside the input element + @return {RSVP.Promise} + @public + */ - Text.build = function build(content) { - return new this(content); - }; + function fillIn(app, selector, contextOrText, text) { + var $el = undefined, + el = undefined, + context = undefined; + if (typeof text === 'undefined') { + text = contextOrText; + } else { + context = contextOrText; + } + $el = app.testHelpers.findWithAssert(selector, context); + el = $el[0]; + _emberTestingEvents.focus(el); - Text.prototype.compile = function compile(dsl) { - dsl.text(this.content); - }; + $el.eq(0).val(text); + _emberTestingEvents.fireEvent(el, 'input'); + _emberTestingEvents.fireEvent(el, 'change'); - return Text; - })(_glimmerRuntimeLibSyntax.Statement); + return app.testHelpers.wait(); + } +}); +enifed('ember-testing/helpers/find', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-testing + */ + 'use strict'; - exports.Text = Text; + exports.default = find; - var Comment = (function (_StatementSyntax7) { - babelHelpers.inherits(Comment, _StatementSyntax7); + /** + Finds an element in the context of the app's container element. A simple alias + for `app.$(selector)`. + + Example: + + ```javascript + var $el = find('.my-selector'); + ``` + + With the `context` param: + + ```javascript + var $el = find('.my-selector', '.parent-element-class'); + ``` + + @method find + @param {String} selector jQuery string selector for element lookup + @param {String} [context] (optional) jQuery selector that will limit the selector + argument to find only within the context's children + @return {Object} jQuery object representing the results of the query + @public + */ - function Comment(comment) { - _StatementSyntax7.call(this); - this.comment = comment; - this.type = "comment"; - } + function find(app, selector, context) { + var $el = undefined; + context = context || _emberMetal.get(app, 'rootElement'); + $el = app.$(selector, context); + return $el; + } +}); +enifed('ember-testing/helpers/find_with_assert', ['exports'], function (exports) { + /** + @module ember + @submodule ember-testing + */ + /** + Like `find`, but throws an error if the element selector returns no results. + + Example: + + ```javascript + var $el = findWithAssert('.doesnt-exist'); // throws error + ``` + + With the `context` param: + + ```javascript + var $el = findWithAssert('.selector-id', '.parent-element-class'); // assert will pass + ``` + + @method findWithAssert + @param {String} selector jQuery selector string for finding an element within + the DOM + @param {String} [context] (optional) jQuery selector that will limit the + selector argument to find only within the context's children + @return {Object} jQuery object representing the results of the query + @throws {Error} throws error if jQuery object returned has a length of 0 + @public + */ + 'use strict'; - Comment.fromSpec = function fromSpec(sexp) { - var value = sexp[1]; + exports.default = findWithAssert; - return new Comment(value); - }; + function findWithAssert(app, selector, context) { + var $el = app.testHelpers.find(selector, context); + if ($el.length === 0) { + throw new Error('Element ' + selector + ' not found.'); + } + return $el; + } +}); +enifed('ember-testing/helpers/key_event', ['exports'], function (exports) { + /** + @module ember + @submodule ember-testing + */ + /** + Simulates a key event, e.g. `keypress`, `keydown`, `keyup` with the desired keyCode + Example: + ```javascript + keyEvent('.some-jQuery-selector', 'keypress', 13).then(function() { + // assert something + }); + ``` + @method keyEvent + @param {String} selector jQuery selector for finding element on the DOM + @param {String} type the type of key event, e.g. `keypress`, `keydown`, `keyup` + @param {Number} keyCode the keyCode of the simulated key event + @return {RSVP.Promise} + @since 1.5.0 + @public + */ + 'use strict'; - Comment.build = function build(value) { - return new this(value); - }; + exports.default = keyEvent; - Comment.prototype.compile = function compile(dsl) { - dsl.comment(this.comment); - }; + function keyEvent(app, selector, contextOrType, typeOrKeyCode, keyCode) { + var context = undefined, + type = undefined; - return Comment; - })(_glimmerRuntimeLibSyntax.Statement); + if (typeof keyCode === 'undefined') { + context = null; + keyCode = typeOrKeyCode; + type = contextOrType; + } else { + context = contextOrType; + type = typeOrKeyCode; + } - exports.Comment = Comment; + return app.testHelpers.triggerEvent(selector, context, type, { keyCode: keyCode, which: keyCode }); + } +}); +enifed('ember-testing/helpers/pause_test', ['exports', 'ember-runtime', 'ember-console', 'ember-metal'], function (exports, _emberRuntime, _emberConsole, _emberMetal) { + /** + @module ember + @submodule ember-testing + */ + 'use strict'; - var OpenElement = (function (_StatementSyntax8) { - babelHelpers.inherits(OpenElement, _StatementSyntax8); + exports.resumeTest = resumeTest; + exports.pauseTest = pauseTest; - function OpenElement(tag, blockParams, symbolTable) { - _StatementSyntax8.call(this); - this.tag = tag; - this.blockParams = blockParams; - this.symbolTable = symbolTable; - this.type = "open-element"; - } + var resume = undefined; - OpenElement.fromSpec = function fromSpec(sexp, symbolTable) { - var tag = sexp[1]; - var blockParams = sexp[2]; + /** + Resumes a test paused by `pauseTest`. + + @method resumeTest + @return {void} + @public + */ - return new OpenElement(tag, blockParams, symbolTable); - }; + function resumeTest() { + _emberMetal.assert('Testing has not been paused. There is nothing to resume.', resume); + resume(); + resume = undefined; + } - OpenElement.build = function build(tag, blockParams, symbolTable) { - return new this(tag, blockParams, symbolTable); - }; + /** + Pauses the current test - this is useful for debugging while testing or for test-driving. + It allows you to inspect the state of your application at any point. + Example (The test will pause before clicking the button): + + ```javascript + visit('/') + return pauseTest(); + click('.btn'); + ``` + @since 1.9.0 + @method pauseTest + @return {Object} A promise that will never resolve + @public + */ - OpenElement.prototype.scan = function scan(scanner) { - var tag = this.tag; + function pauseTest() { + if (_emberMetal.isFeatureEnabled('ember-testing-resume-test')) { + _emberConsole.default.info('Testing paused. Use `resumeTest()` to continue.'); + } - if (scanner.env.hasComponentDefinition([tag], this.symbolTable)) { - var _parameters = this.parameters(scanner); + return new _emberRuntime.RSVP.Promise(function (resolve) { + if (_emberMetal.isFeatureEnabled('ember-testing-resume-test')) { + resume = resolve; + } + }, 'TestAdapter paused promise'); + } +}); +enifed('ember-testing/helpers/trigger_event', ['exports', 'ember-testing/events'], function (exports, _emberTestingEvents) { + /** + @module ember + @submodule ember-testing + */ + 'use strict'; - var args = _parameters.args; - var attrs = _parameters.attrs; + exports.default = triggerEvent; - scanner.startBlock(this.blockParams); - this.tagContents(scanner); - var template = scanner.endBlock(this.blockParams); - args.blocks = Blocks.fromSpec(template); - return new Component(tag, attrs, args); - } else { - return new OpenPrimitiveElement(tag); - } - }; + /** + Triggers the given DOM event on the element identified by the provided selector. + Example: + ```javascript + triggerEvent('#some-elem-id', 'blur'); + ``` + This is actually used internally by the `keyEvent` helper like so: + ```javascript + triggerEvent('#some-elem-id', 'keypress', { keyCode: 13 }); + ``` + @method triggerEvent + @param {String} selector jQuery selector for finding element on the DOM + @param {String} [context] jQuery selector that will limit the selector + argument to find only within the context's children + @param {String} type The event type to be triggered. + @param {Object} [options] The options to be passed to jQuery.Event. + @return {RSVP.Promise} + @since 1.5.0 + @public + */ - OpenElement.prototype.compile = function compile(list, env) { - list.append(new _glimmerRuntimeLibCompiledOpcodesDom.OpenPrimitiveElementOpcode(this.tag)); - }; + function triggerEvent(app, selector, contextOrType, typeOrOptions, possibleOptions) { + var arity = arguments.length; + var context = undefined, + type = undefined, + options = undefined; - OpenElement.prototype.toIdentity = function toIdentity() { - var tag = this.tag; + if (arity === 3) { + // context and options are optional, so this is + // app, selector, type + context = null; + type = contextOrType; + options = {}; + } else if (arity === 4) { + // context and options are optional, so this is + if (typeof typeOrOptions === 'object') { + // either + // app, selector, type, options + context = null; + type = contextOrType; + options = typeOrOptions; + } else { + // or + // app, selector, context, type + context = contextOrType; + type = typeOrOptions; + options = {}; + } + } else { + context = contextOrType; + type = typeOrOptions; + options = possibleOptions; + } - return new OpenPrimitiveElement(tag); - }; + var $el = app.testHelpers.findWithAssert(selector, context); + var el = $el[0]; - OpenElement.prototype.parameters = function parameters(scanner) { - var current = scanner.next(); - var attrs = []; - var argKeys = []; - var argValues = []; - while (!(current instanceof FlushElement)) { - if (current[MODIFIER_SYNTAX]) { - throw new Error('Compile Error: Element modifiers are not allowed in components'); - } - var param = current; - if (current[_glimmerRuntimeLibSyntax.ATTRIBUTE]) { - attrs.push(param.name); - // REMOVE ME: attributes should not be treated as args - argKeys.push(param.name); - argValues.push(param.valueSyntax()); - } else if (current[_glimmerRuntimeLibSyntax.ARGUMENT]) { - argKeys.push(param.name); - argValues.push(param.valueSyntax()); - } else { - throw new Error("Expected FlushElement, but got ${current}"); - } - current = scanner.next(); - } - return { args: Args.fromNamedArgs(NamedArgs.build(argKeys, argValues)), attrs: attrs }; - }; + _emberTestingEvents.fireEvent(el, type, options); - OpenElement.prototype.tagContents = function tagContents(scanner) { - var nesting = 1; - while (true) { - var current = scanner.next(); - if (current instanceof CloseElement && --nesting === 0) { - break; - } - scanner.addStatement(current); - if (current instanceof OpenElement || current instanceof OpenPrimitiveElement) { - nesting++; - } - } - }; + return app.testHelpers.wait(); + } +}); +enifed('ember-testing/helpers/visit', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-testing + */ + 'use strict'; - return OpenElement; - })(_glimmerRuntimeLibSyntax.Statement); + exports.default = visit; - exports.OpenElement = OpenElement; + /** + Loads a route, sets up any controllers, and renders any templates associated + with the route as though a real user had triggered the route change while + using your app. + + Example: + + ```javascript + visit('posts/index').then(function() { + // assert something + }); + ``` + + @method visit + @param {String} url the name of the route + @return {RSVP.Promise} + @public + */ - var Component = (function (_StatementSyntax9) { - babelHelpers.inherits(Component, _StatementSyntax9); + function visit(app, url) { + var router = app.__container__.lookup('router:main'); + var shouldHandleURL = false; - function Component(tag, attrs, args) { - _StatementSyntax9.call(this); - this.tag = tag; - this.attrs = attrs; - this.args = args; - this.type = 'component'; - } - - Component.prototype.compile = function compile(list, env, symbolTable) { - var definition = env.getComponentDefinition([this.tag], symbolTable); - var args = this.args.compile(list, env, symbolTable); - var shadow = this.attrs; - list.append(new _glimmerRuntimeLibCompiledOpcodesComponent.PutComponentDefinitionOpcode(definition)); - list.append(new _glimmerRuntimeLibCompiledOpcodesComponent.OpenComponentOpcode(args, shadow)); - list.append(new _glimmerRuntimeLibCompiledOpcodesComponent.CloseComponentOpcode()); - }; + app.boot().then(function () { + router.location.setURL(url); - return Component; - })(_glimmerRuntimeLibSyntax.Statement); + if (shouldHandleURL) { + _emberMetal.run(app.__deprecatedInstance__, 'handleURL', url); + } + }); - exports.Component = Component; + if (app._readinessDeferrals > 0) { + router['initialURL'] = url; + _emberMetal.run(app, 'advanceReadiness'); + delete router['initialURL']; + } else { + shouldHandleURL = true; + } - var OpenPrimitiveElement = (function (_StatementSyntax10) { - babelHelpers.inherits(OpenPrimitiveElement, _StatementSyntax10); + return app.testHelpers.wait(); + } +}); +enifed('ember-testing/helpers/wait', ['exports', 'ember-testing/test/waiters', 'ember-runtime', 'ember-metal', 'ember-testing/test/pending_requests'], function (exports, _emberTestingTestWaiters, _emberRuntime, _emberMetal, _emberTestingTestPending_requests) { + /** + @module ember + @submodule ember-testing + */ + 'use strict'; - function OpenPrimitiveElement(tag) { - _StatementSyntax10.call(this); - this.tag = tag; - this.type = "open-primitive-element"; - } + exports.default = wait; - OpenPrimitiveElement.build = function build(tag) { - return new this(tag); - }; + /** + Causes the run loop to process any pending events. This is used to ensure that + any async operations from other helpers (or your assertions) have been processed. + + This is most often used as the return value for the helper functions (see 'click', + 'fillIn','visit',etc). However, there is a method to register a test helper which + utilizes this method without the need to actually call `wait()` in your helpers. + + The `wait` helper is built into `registerAsyncHelper` by default. You will not need + to `return app.testHelpers.wait();` - the wait behavior is provided for you. + + Example: + + ```javascript + Ember.Test.registerAsyncHelper('loginUser', function(app, username, password) { + visit('secured/path/here') + .fillIn('#username', username) + .fillIn('#password', password) + .click('.submit'); + }); + + @method wait + @param {Object} value The value to be returned. + @return {RSVP.Promise} + @public + @since 1.0.0 + */ - OpenPrimitiveElement.prototype.compile = function compile(compiler) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.OpenPrimitiveElementOpcode(this.tag)); - }; + function wait(app, value) { + return new _emberRuntime.RSVP.Promise(function (resolve) { + var router = app.__container__.lookup('router:main'); - return OpenPrimitiveElement; - })(_glimmerRuntimeLibSyntax.Statement); + // Every 10ms, poll for the async thing to have finished + var watcher = setInterval(function () { + // 1. If the router is loading, keep polling + var routerIsLoading = router.router && !!router.router.activeTransition; + if (routerIsLoading) { + return; + } - exports.OpenPrimitiveElement = OpenPrimitiveElement; + // 2. If there are pending Ajax requests, keep polling + if (_emberTestingTestPending_requests.pendingRequests()) { + return; + } - var Yield = (function (_StatementSyntax11) { - babelHelpers.inherits(Yield, _StatementSyntax11); + // 3. If there are scheduled timers or we are inside of a run loop, keep polling + if (_emberMetal.run.hasScheduledTimers() || _emberMetal.run.currentRunLoop) { + return; + } - function Yield(to, args) { - _StatementSyntax11.call(this); - this.to = to; - this.args = args; - this.type = "yield"; + if (_emberTestingTestWaiters.checkWaiters()) { + return; } - Yield.fromSpec = function fromSpec(sexp) { - var to = sexp[1]; - var params = sexp[2]; + // Stop polling + clearInterval(watcher); - var args = Args.fromSpec(params, null, EMPTY_BLOCKS); - return new Yield(to, args); - }; + // Synchronously resolve the promise + _emberMetal.run(null, resolve, value); + }, 10); + }); + } +}); +enifed('ember-testing/index', ['exports', 'ember-testing/support', 'ember-testing/ext/application', 'ember-testing/ext/rsvp', 'ember-testing/helpers', 'ember-testing/initializers', 'ember-testing/test', 'ember-testing/adapters/adapter', 'ember-testing/setup_for_testing', 'ember-testing/adapters/qunit'], function (exports, _emberTestingSupport, _emberTestingExtApplication, _emberTestingExtRsvp, _emberTestingHelpers, _emberTestingInitializers, _emberTestingTest, _emberTestingAdaptersAdapter, _emberTestingSetup_for_testing, _emberTestingAdaptersQunit) { + 'use strict'; - Yield.build = function build(params, to) { - var args = Args.fromPositionalArgs(PositionalArgs.build(params)); - return new this(to, args); - }; + exports.Test = _emberTestingTest.default; + exports.Adapter = _emberTestingAdaptersAdapter.default; + exports.setupForTesting = _emberTestingSetup_for_testing.default; + exports.QUnitAdapter = _emberTestingAdaptersQunit.default; +}); +// to handle various edge cases +// setup RSVP + run loop integration +// adds helpers to helpers object in Test +// to setup initializer - Yield.prototype.compile = function compile(dsl, env, symbolTable) { - var to = this.to; - - var args = this.args.compile(dsl, env, symbolTable); - if (dsl.hasBlockSymbol(to)) { - var symbol = dsl.getBlockSymbol(to); - var inner = new _glimmerRuntimeLibCompiledExpressionsHasBlock.CompiledGetBlockBySymbol(symbol, to); - dsl.append(new OpenBlockOpcode(inner, args)); - dsl.append(new CloseBlockOpcode()); - } else if (dsl.hasPartialArgsSymbol()) { - var symbol = dsl.getPartialArgsSymbol(); - var inner = new _glimmerRuntimeLibCompiledExpressionsHasBlock.CompiledInPartialGetBlock(symbol, to); - dsl.append(new OpenBlockOpcode(inner, args)); - dsl.append(new CloseBlockOpcode()); - } else { - throw new Error('[BUG] ${to} is not a valid block name.'); - } - }; +/** + @module ember + @submodule ember-testing +*/ +enifed('ember-testing/initializers', ['exports', 'ember-runtime'], function (exports, _emberRuntime) { + 'use strict'; - return Yield; - })(_glimmerRuntimeLibSyntax.Statement); + var name = 'deferReadiness in `testing` mode'; - exports.Yield = Yield; + _emberRuntime.onLoad('Ember.Application', function (Application) { + if (!Application.initializers[name]) { + Application.initializer({ + name: name, - function isStaticPartialName(exp) { - return exp.type === 'value'; + initialize: function (application) { + if (application.testing) { + application.deferReadiness(); + } + } + }); } + }); +}); +enifed('ember-testing/setup_for_testing', ['exports', 'ember-metal', 'ember-views', 'ember-testing/test/adapter', 'ember-testing/test/pending_requests', 'ember-testing/adapters/adapter', 'ember-testing/adapters/qunit'], function (exports, _emberMetal, _emberViews, _emberTestingTestAdapter, _emberTestingTestPending_requests, _emberTestingAdaptersAdapter, _emberTestingAdaptersQunit) { + /* global self */ - var Partial = (function (_StatementSyntax12) { - babelHelpers.inherits(Partial, _StatementSyntax12); - - function Partial() { - _StatementSyntax12.apply(this, arguments); - } + 'use strict'; - Partial.fromSpec = function fromSpec(sexp) { - var exp = sexp[1]; + exports.default = setupForTesting; - var name = _glimmerRuntimeLibSyntaxExpressions.default(exp); - if (isStaticPartialName(name)) { - return new _glimmerRuntimeLibSyntaxBuiltinsPartial.StaticPartialSyntax(name); - } else { - return new _glimmerRuntimeLibSyntaxBuiltinsPartial.DynamicPartialSyntax(name); - } - }; + /** + Sets Ember up for testing. This is useful to perform + basic setup steps in order to unit test. + + Use `App.setupForTesting` to perform integration tests (full + application testing). + + @method setupForTesting + @namespace Ember + @since 1.5.0 + @private + */ - return Partial; - })(_glimmerRuntimeLibSyntax.Statement); + function setupForTesting() { + _emberMetal.setTesting(true); - exports.Partial = Partial; + var adapter = _emberTestingTestAdapter.getAdapter(); + // if adapter is not manually set default to QUnit + if (!adapter) { + _emberTestingTestAdapter.setAdapter(typeof self.QUnit === 'undefined' ? new _emberTestingAdaptersAdapter.default() : new _emberTestingAdaptersQunit.default()); + } - var OpenBlockOpcode = (function (_Opcode) { - babelHelpers.inherits(OpenBlockOpcode, _Opcode); + _emberViews.jQuery(document).off('ajaxSend', _emberTestingTestPending_requests.incrementPendingRequests); + _emberViews.jQuery(document).off('ajaxComplete', _emberTestingTestPending_requests.decrementPendingRequests); - function OpenBlockOpcode(inner, args) { - _Opcode.call(this); - this.inner = inner; - this.args = args; - this.type = "open-block"; - } + _emberTestingTestPending_requests.clearPendingRequests(); - OpenBlockOpcode.prototype.evaluate = function evaluate(vm) { - var block = this.inner.evaluate(vm); - var args = undefined; - if (block) { - args = this.args.evaluate(vm); - } - // FIXME: can we avoid doing this when we don't have a block? - vm.pushCallerScope(); - if (block) { - vm.invokeBlock(block, args); - } - }; + _emberViews.jQuery(document).on('ajaxSend', _emberTestingTestPending_requests.incrementPendingRequests); + _emberViews.jQuery(document).on('ajaxComplete', _emberTestingTestPending_requests.decrementPendingRequests); + } +}); +enifed('ember-testing/support', ['exports', 'ember-metal', 'ember-views', 'ember-environment'], function (exports, _emberMetal, _emberViews, _emberEnvironment) { + 'use strict'; - OpenBlockOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - details: { - "block": this.inner.toJSON(), - "positional": this.args.positional.toJSON(), - "named": this.args.named.toJSON() - } - }; - }; + /** + @module ember + @submodule ember-testing + */ - return OpenBlockOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + var $ = _emberViews.jQuery; - var CloseBlockOpcode = (function (_Opcode2) { - babelHelpers.inherits(CloseBlockOpcode, _Opcode2); + /** + This method creates a checkbox and triggers the click event to fire the + passed in handler. It is used to correct for a bug in older versions + of jQuery (e.g 1.8.3). + + @private + @method testCheckboxClick + */ + function testCheckboxClick(handler) { + var input = document.createElement('input'); + $(input).attr('type', 'checkbox').css({ position: 'absolute', left: '-1000px', top: '-1000px' }).appendTo('body').on('click', handler).trigger('click').remove(); + } - function CloseBlockOpcode() { - _Opcode2.apply(this, arguments); - this.type = "close-block"; + if (_emberEnvironment.environment.hasDOM && typeof $ === 'function') { + $(function () { + /* + Determine whether a checkbox checked using jQuery's "click" method will have + the correct value for its checked property. + If we determine that the current jQuery version exhibits this behavior, + patch it to work correctly as in the commit for the actual fix: + https://github.com/jquery/jquery/commit/1fb2f92. + */ + testCheckboxClick(function () { + if (!this.checked && !$.event.special.click) { + $.event.special.click = { + // For checkbox, fire native event so checked state will be right + trigger: function () { + if ($.nodeName(this, 'input') && this.type === 'checkbox' && this.click) { + this.click(); + return false; + } + } + }; } + }); - CloseBlockOpcode.prototype.evaluate = function evaluate(vm) { - vm.popScope(); - }; + // Try again to verify that the patch took effect or blow up. + testCheckboxClick(function () { + _emberMetal.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-testing/test/helpers', 'ember-testing/test/on_inject_helpers', 'ember-testing/test/promise', 'ember-testing/test/waiters', 'ember-testing/test/adapter'], function (exports, _emberTestingTestHelpers, _emberTestingTestOn_inject_helpers, _emberTestingTestPromise, _emberTestingTestWaiters, _emberTestingTestAdapter) { + /** + @module ember + @submodule ember-testing + */ + 'use strict'; - return CloseBlockOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + This is a container for an assortment of testing related functionality: + + * Choose your default test adapter (for your framework of choice). + * Register/Unregister additional test helpers. + * Setup callbacks to be fired when the test helpers are injected into + your application. + + @class Test + @namespace Ember + @public + */ + var Test = { + /** + Hash containing all known test helpers. + @property _helpers + @private + @since 1.7.0 + */ + _helpers: _emberTestingTestHelpers.helpers, - exports.CloseBlockOpcode = CloseBlockOpcode; + registerHelper: _emberTestingTestHelpers.registerHelper, + registerAsyncHelper: _emberTestingTestHelpers.registerAsyncHelper, + unregisterHelper: _emberTestingTestHelpers.unregisterHelper, + onInjectHelpers: _emberTestingTestOn_inject_helpers.onInjectHelpers, + Promise: _emberTestingTestPromise.default, + promise: _emberTestingTestPromise.promise, + resolve: _emberTestingTestPromise.resolve, + registerWaiter: _emberTestingTestWaiters.registerWaiter, + unregisterWaiter: _emberTestingTestWaiters.unregisterWaiter, + checkWaiters: _emberTestingTestWaiters.checkWaiters + }; - var Value = (function (_ExpressionSyntax) { - babelHelpers.inherits(Value, _ExpressionSyntax); + /** + Used to allow ember-testing to communicate with a specific testing + framework. + + You can manually set it before calling `App.setupForTesting()`. + + Example: + + ```javascript + Ember.Test.adapter = MyCustomAdapter.create() + ``` + + If you do not set it, ember-testing will default to `Ember.Test.QUnitAdapter`. + + @public + @for Ember.Test + @property adapter + @type {Class} The adapter to be used. + @default Ember.Test.QUnitAdapter + */ + Object.defineProperty(Test, 'adapter', { + get: _emberTestingTestAdapter.getAdapter, + set: _emberTestingTestAdapter.setAdapter + }); - function Value(value) { - _ExpressionSyntax.call(this); - this.value = value; - this.type = "value"; - } + Object.defineProperty(Test, 'waiters', { + get: _emberTestingTestWaiters.generateDeprecatedWaitersArray + }); - Value.fromSpec = function fromSpec(value) { - return new Value(value); - }; + exports.default = Test; +}); +enifed('ember-testing/test/adapter', ['exports', 'ember-console', 'ember-metal'], function (exports, _emberConsole, _emberMetal) { + 'use strict'; - Value.build = function build(value) { - return new this(value); - }; + exports.getAdapter = getAdapter; + exports.setAdapter = setAdapter; + exports.asyncStart = asyncStart; + exports.asyncEnd = asyncEnd; - Value.prototype.inner = function inner() { - return this.value; - }; + var adapter = undefined; - Value.prototype.compile = function compile(compiler) { - return new _glimmerRuntimeLibCompiledExpressionsValue.default(this.value); - }; + function getAdapter() { + return adapter; + } - return Value; - })(_glimmerRuntimeLibSyntax.Expression); + function setAdapter(value) { + adapter = value; + if (value) { + _emberMetal.setDispatchOverride(adapterDispatch); + } else { + _emberMetal.setDispatchOverride(null); + } + } - exports.Value = Value; + function asyncStart() { + if (adapter) { + adapter.asyncStart(); + } + } - var GetArgument = (function (_ExpressionSyntax2) { - babelHelpers.inherits(GetArgument, _ExpressionSyntax2); + function asyncEnd() { + if (adapter) { + adapter.asyncEnd(); + } + } - function GetArgument(parts) { - _ExpressionSyntax2.call(this); - this.parts = parts; - this.type = "get-argument"; - } + function adapterDispatch(error) { + adapter.exception(error); + _emberConsole.default.error(error.stack); + } +}); +enifed('ember-testing/test/helpers', ['exports', 'ember-testing/test/promise'], function (exports, _emberTestingTestPromise) { + 'use strict'; - // this is separated out from Get because Unknown also has a ref, but it - // may turn out to be a helper + exports.registerHelper = registerHelper; + exports.registerAsyncHelper = registerAsyncHelper; + exports.unregisterHelper = unregisterHelper; + var helpers = {}; - GetArgument.fromSpec = function fromSpec(sexp) { - var parts = sexp[1]; + exports.helpers = helpers; + /** + `registerHelper` is used to register a test helper that will be injected + when `App.injectTestHelpers` is called. + + The helper method will always be called with the current Application as + the first parameter. + + For example: + + ```javascript + Ember.Test.registerHelper('boot', function(app) { + Ember.run(app, app.advanceReadiness); + }); + ``` + + This helper can later be called without arguments because it will be + called with `app` as the first parameter. + + ```javascript + App = Ember.Application.create(); + App.injectTestHelpers(); + boot(); + ``` + + @public + @for Ember.Test + @method registerHelper + @param {String} name The name of the helper method to add. + @param {Function} helperMethod + @param options {Object} + */ - return new GetArgument(parts); - }; + function registerHelper(name, helperMethod) { + helpers[name] = { + method: helperMethod, + meta: { wait: false } + }; + } - GetArgument.build = function build(path) { - return new this(path.split('.')); - }; + /** + `registerAsyncHelper` is used to register an async test helper that will be injected + when `App.injectTestHelpers` is called. + + The helper method will always be called with the current Application as + the first parameter. + + For example: + + ```javascript + Ember.Test.registerAsyncHelper('boot', function(app) { + Ember.run(app, app.advanceReadiness); + }); + ``` + + The advantage of an async helper is that it will not run + until the last async helper has completed. All async helpers + after it will wait for it complete before running. + + + For example: + + ```javascript + Ember.Test.registerAsyncHelper('deletePost', function(app, postId) { + click('.delete-' + postId); + }); + + // ... in your test + visit('/post/2'); + deletePost(2); + visit('/post/3'); + deletePost(3); + ``` + + @public + @for Ember.Test + @method registerAsyncHelper + @param {String} name The name of the helper method to add. + @param {Function} helperMethod + @since 1.2.0 + */ - GetArgument.prototype.compile = function compile(lookup) { - var parts = this.parts; - - var head = parts[0]; - if (lookup.hasNamedSymbol(head)) { - var symbol = lookup.getNamedSymbol(head); - var path = parts.slice(1); - var inner = new _glimmerRuntimeLibCompiledExpressionsLookups.CompiledSymbol(symbol, head); - return _glimmerRuntimeLibCompiledExpressionsLookups.default.create(inner, path); - } else if (lookup.hasPartialArgsSymbol()) { - var symbol = lookup.getPartialArgsSymbol(); - var path = parts.slice(1); - var inner = new _glimmerRuntimeLibCompiledExpressionsLookups.CompiledInPartialName(symbol, head); - return _glimmerRuntimeLibCompiledExpressionsLookups.default.create(inner, path); - } else { - throw new Error('[BUG] @' + this.parts.join('.') + ' is not a valid lookup path.'); - } - }; + function registerAsyncHelper(name, helperMethod) { + helpers[name] = { + method: helperMethod, + meta: { wait: true } + }; + } - return GetArgument; - })(_glimmerRuntimeLibSyntax.Expression); + /** + Remove a previously added helper method. + + Example: + + ```javascript + Ember.Test.unregisterHelper('wait'); + ``` + + @public + @method unregisterHelper + @param {String} name The helper to remove. + */ - exports.GetArgument = GetArgument; + function unregisterHelper(name) { + delete helpers[name]; + delete _emberTestingTestPromise.default.prototype[name]; + } +}); +enifed("ember-testing/test/on_inject_helpers", ["exports"], function (exports) { + "use strict"; - var Ref = (function (_ExpressionSyntax3) { - babelHelpers.inherits(Ref, _ExpressionSyntax3); + exports.onInjectHelpers = onInjectHelpers; + exports.invokeInjectHelpersCallbacks = invokeInjectHelpersCallbacks; + var callbacks = []; - function Ref(parts) { - _ExpressionSyntax3.call(this); - this.parts = parts; - this.type = "ref"; - } + exports.callbacks = callbacks; + /** + Used to register callbacks to be fired whenever `App.injectTestHelpers` + is called. + + The callback will receive the current application as an argument. + + Example: + + ```javascript + Ember.Test.onInjectHelpers(function() { + Ember.$(document).ajaxSend(function() { + Test.pendingRequests++; + }); + + Ember.$(document).ajaxComplete(function() { + Test.pendingRequests--; + }); + }); + ``` + + @public + @for Ember.Test + @method onInjectHelpers + @param {Function} callback The function to be called. + */ - Ref.build = function build(path) { - var parts = path.split('.'); - if (parts[0] === 'this') { - parts[0] = null; - } - return new this(parts); - }; + function onInjectHelpers(callback) { + callbacks.push(callback); + } - Ref.prototype.compile = function compile(lookup) { - var parts = this.parts; - - var head = parts[0]; - if (head === null) { - var inner = new _glimmerRuntimeLibCompiledExpressionsLookups.CompiledSelf(); - var path = parts.slice(1); - return _glimmerRuntimeLibCompiledExpressionsLookups.default.create(inner, path); - } else if (lookup.hasLocalSymbol(head)) { - var symbol = lookup.getLocalSymbol(head); - var path = parts.slice(1); - var inner = new _glimmerRuntimeLibCompiledExpressionsLookups.CompiledSymbol(symbol, head); - return _glimmerRuntimeLibCompiledExpressionsLookups.default.create(inner, path); - } else { - var inner = new _glimmerRuntimeLibCompiledExpressionsLookups.CompiledSelf(); - return _glimmerRuntimeLibCompiledExpressionsLookups.default.create(inner, parts); - } - }; + function invokeInjectHelpersCallbacks(app) { + for (var i = 0; i < callbacks.length; i++) { + callbacks[i](app); + } + } +}); +enifed("ember-testing/test/pending_requests", ["exports"], function (exports) { + "use strict"; - return Ref; - })(_glimmerRuntimeLibSyntax.Expression); + exports.pendingRequests = pendingRequests; + exports.clearPendingRequests = clearPendingRequests; + exports.incrementPendingRequests = incrementPendingRequests; + exports.decrementPendingRequests = decrementPendingRequests; + var requests = []; - exports.Ref = Ref; + function pendingRequests() { + return requests.length; + } - var Get = (function (_ExpressionSyntax4) { - babelHelpers.inherits(Get, _ExpressionSyntax4); + function clearPendingRequests() { + requests.length = 0; + } - function Get(ref) { - _ExpressionSyntax4.call(this); - this.ref = ref; - this.type = "get"; - } + function incrementPendingRequests(_, xhr) { + requests.push(xhr); + } - Get.fromSpec = function fromSpec(sexp) { - var parts = sexp[1]; + function decrementPendingRequests(_, xhr) { + for (var i = 0; i < requests.length; i++) { + if (xhr === requests[i]) { + requests.splice(i, 1); + break; + } + } + } +}); +enifed('ember-testing/test/promise', ['exports', 'ember-runtime', 'ember-testing/test/run'], function (exports, _emberRuntime, _emberTestingTestRun) { + 'use strict'; - return new this(new Ref(parts)); - }; + exports.promise = promise; + exports.resolve = resolve; + exports.getLastPromise = getLastPromise; - Get.build = function build(path) { - return new this(Ref.build(path)); - }; + var lastPromise = undefined; - Get.prototype.compile = function compile(compiler) { - return this.ref.compile(compiler); - }; + var TestPromise = (function (_RSVP$Promise) { + babelHelpers.inherits(TestPromise, _RSVP$Promise); - return Get; - })(_glimmerRuntimeLibSyntax.Expression); + function TestPromise() { + babelHelpers.classCallCheck(this, TestPromise); - exports.Get = Get; + _RSVP$Promise.apply(this, arguments); + lastPromise = this; + } - var Unknown = (function (_ExpressionSyntax5) { - babelHelpers.inherits(Unknown, _ExpressionSyntax5); + /** + This returns a thenable tailored for testing. It catches failed + `onSuccess` callbacks and invokes the `Ember.Test.adapter.exception` + callback in the last chained then. + + This method should be returned by async helpers such as `wait`. + + @public + @for Ember.Test + @method promise + @param {Function} resolver The function used to resolve the promise. + @param {String} label An optional string for identifying the promise. + */ - function Unknown(ref) { - _ExpressionSyntax5.call(this); - this.ref = ref; - this.type = "unknown"; - } + TestPromise.prototype.then = function then(onFulfillment) { + var _RSVP$Promise$prototype$then; - Unknown.fromSpec = function fromSpec(sexp) { - var path = sexp[1]; + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } - return new this(new Ref(path)); - }; + return (_RSVP$Promise$prototype$then = _RSVP$Promise.prototype.then).call.apply(_RSVP$Promise$prototype$then, [this, function (result) { + return isolate(onFulfillment, result); + }].concat(args)); + }; - Unknown.build = function build(path) { - return new this(Ref.build(path)); - }; + return TestPromise; + })(_emberRuntime.RSVP.Promise); - Unknown.prototype.compile = function compile(compiler, env, symbolTable) { - var ref = this.ref; + exports.default = TestPromise; - if (env.hasHelper(ref.parts, symbolTable)) { - return new _glimmerRuntimeLibCompiledExpressionsHelper.default(ref.parts, env.lookupHelper(ref.parts, symbolTable), _glimmerRuntimeLibCompiledExpressionsArgs.CompiledArgs.empty(), symbolTable); - } else { - return this.ref.compile(compiler); - } - }; + function promise(resolver, label) { + var fullLabel = 'Ember.Test.promise: ' + (label || ''); + return new TestPromise(resolver, fullLabel); + } - return Unknown; - })(_glimmerRuntimeLibSyntax.Expression); + /** + Replacement for `Ember.RSVP.resolve` + The only difference is this uses + an instance of `Ember.Test.Promise` + + @public + @for Ember.Test + @method resolve + @param {Mixed} The value to resolve + @since 1.2.0 + */ - exports.Unknown = Unknown; + function resolve(result, label) { + return TestPromise.resolve(result, label); + } - var Helper = (function (_ExpressionSyntax6) { - babelHelpers.inherits(Helper, _ExpressionSyntax6); + function getLastPromise() { + return lastPromise; + } - function Helper(ref, args) { - _ExpressionSyntax6.call(this); - this.ref = ref; - this.args = args; - this.type = "helper"; - } + // This method isolates nested async methods + // so that they don't conflict with other last promises. + // + // 1. Set `Ember.Test.lastPromise` to null + // 2. Invoke method + // 3. Return the last promise created during method + function isolate(onFulfillment, result) { + // Reset lastPromise for nested helpers + lastPromise = null; - Helper.fromSpec = function fromSpec(sexp) { - var path = sexp[1]; - var params = sexp[2]; - var hash = sexp[3]; + var value = onFulfillment(result); - return new Helper(new Ref(path), Args.fromSpec(params, hash, EMPTY_BLOCKS)); - }; + var promise = lastPromise; + lastPromise = null; - Helper.build = function build(path, positional, named) { - return new this(Ref.build(path), Args.build(positional, named, EMPTY_BLOCKS)); - }; + // If the method returned a promise + // return that promise. If not, + // return the last async helper's promise + if (value && value instanceof TestPromise || !promise) { + return value; + } else { + return _emberTestingTestRun.default(function () { + return resolve(promise).then(function () { + return value; + }); + }); + } + } +}); +enifed('ember-testing/test/run', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - Helper.prototype.compile = function compile(compiler, env, symbolTable) { - if (env.hasHelper(this.ref.parts, symbolTable)) { - var args = this.args; - var ref = this.ref; + exports.default = run; - return new _glimmerRuntimeLibCompiledExpressionsHelper.default(ref.parts, env.lookupHelper(ref.parts, symbolTable), args.compile(compiler, env, symbolTable), symbolTable); - } else { - throw new Error('Compile Error: ' + this.ref.parts.join('.') + ' is not a helper'); - } - }; + function run(fn) { + if (!_emberMetal.run.currentRunLoop) { + return _emberMetal.run(fn); + } else { + return fn(); + } + } +}); +enifed('ember-testing/test/waiters', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - return Helper; - })(_glimmerRuntimeLibSyntax.Expression); + exports.registerWaiter = registerWaiter; + exports.unregisterWaiter = unregisterWaiter; + exports.checkWaiters = checkWaiters; + exports.generateDeprecatedWaitersArray = generateDeprecatedWaitersArray; - exports.Helper = Helper; + var contexts = []; + var callbacks = []; - var HasBlock = (function (_ExpressionSyntax7) { - babelHelpers.inherits(HasBlock, _ExpressionSyntax7); + /** + This allows ember-testing to play nicely with other asynchronous + events, such as an application that is waiting for a CSS3 + transition or an IndexDB transaction. The waiter runs periodically + after each async helper (i.e. `click`, `andThen`, `visit`, etc) has executed, + until the returning result is truthy. After the waiters finish, the next async helper + is executed and the process repeats. + + For example: + + ```javascript + Ember.Test.registerWaiter(function() { + return myPendingTransactions() == 0; + }); + ``` + The `context` argument allows you to optionally specify the `this` + with which your callback will be invoked. + + For example: + + ```javascript + Ember.Test.registerWaiter(MyDB, MyDB.hasPendingTransactions); + ``` + + @public + @for Ember.Test + @method registerWaiter + @param {Object} context (optional) + @param {Function} callback + @since 1.2.0 + */ - function HasBlock(blockName) { - _ExpressionSyntax7.call(this); - this.blockName = blockName; - this.type = "has-block"; - } + function registerWaiter(context, callback) { + if (arguments.length === 1) { + callback = context; + context = null; + } + if (indexOf(context, callback) > -1) { + return; + } + contexts.push(context); + callbacks.push(callback); + } - HasBlock.fromSpec = function fromSpec(sexp) { - var blockName = sexp[1]; + /** + `unregisterWaiter` is used to unregister a callback that was + registered with `registerWaiter`. + + @public + @for Ember.Test + @method unregisterWaiter + @param {Object} context (optional) + @param {Function} callback + @since 1.2.0 + */ - return new HasBlock(blockName); - }; + function unregisterWaiter(context, callback) { + if (!callbacks.length) { + return; + } + if (arguments.length === 1) { + callback = context; + context = null; + } + var i = indexOf(context, callback); + if (i === -1) { + return; + } + contexts.splice(i, 1); + callbacks.splice(i, 1); + } - HasBlock.build = function build(blockName) { - return new this(blockName); - }; + /** + Iterates through each registered test waiter, and invokes + its callback. If any waiter returns false, this method will return + true indicating that the waiters have not settled yet. + + This is generally used internally from the acceptance/integration test + infrastructure. + + @public + @for Ember.Test + @static + @method checkWaiters + */ - HasBlock.prototype.compile = function compile(compiler, env) { - var blockName = this.blockName; - - if (compiler.hasBlockSymbol(blockName)) { - var symbol = compiler.getBlockSymbol(blockName); - var inner = new _glimmerRuntimeLibCompiledExpressionsHasBlock.CompiledGetBlockBySymbol(symbol, blockName); - return new _glimmerRuntimeLibCompiledExpressionsHasBlock.default(inner); - } else if (compiler.hasPartialArgsSymbol()) { - var symbol = compiler.getPartialArgsSymbol(); - var inner = new _glimmerRuntimeLibCompiledExpressionsHasBlock.CompiledInPartialGetBlock(symbol, blockName); - return new _glimmerRuntimeLibCompiledExpressionsHasBlock.default(inner); - } else { - throw new Error('[BUG] ${blockName} is not a valid block name.'); - } - }; + function checkWaiters() { + if (!callbacks.length) { + return false; + } + for (var i = 0; i < callbacks.length; i++) { + var context = contexts[i]; + var callback = callbacks[i]; + if (!callback.call(context)) { + return true; + } + } + return false; + } - return HasBlock; - })(_glimmerRuntimeLibSyntax.Expression); + function indexOf(context, callback) { + for (var i = 0; i < callbacks.length; i++) { + if (callbacks[i] === callback && contexts[i] === context) { + return i; + } + } + return -1; + } - exports.HasBlock = HasBlock; + function generateDeprecatedWaitersArray() { + _emberMetal.deprecate('Usage of `Ember.Test.waiters` is deprecated. Please refactor to `Ember.Test.checkWaiters`.', false, { until: '2.8.0', id: 'ember-testing.test-waiters' }); - var HasBlockParams = (function (_ExpressionSyntax8) { - babelHelpers.inherits(HasBlockParams, _ExpressionSyntax8); + var array = new Array(callbacks.length); + for (var i = 0; i < callbacks.length; i++) { + var context = contexts[i]; + var callback = callbacks[i]; - function HasBlockParams(blockName) { - _ExpressionSyntax8.call(this); - this.blockName = blockName; - this.type = "has-block-params"; - } + array[i] = [context, callback]; + } - HasBlockParams.fromSpec = function fromSpec(sexp) { - var blockName = sexp[1]; + return array; + } +}); +enifed("ember-utils/apply-str", ["exports"], function (exports) { + /** + @param {Object} t target + @param {String} m method + @param {Array} a args + @private + */ + "use strict"; - return new HasBlockParams(blockName); - }; + exports.default = applyStr; - HasBlockParams.build = function build(blockName) { - return new this(blockName); - }; + function applyStr(t, m, a) { + var l = a && a.length; + if (!a || !l) { + return t[m](); + } + switch (l) { + case 1: + return t[m](a[0]); + case 2: + return t[m](a[0], a[1]); + case 3: + return t[m](a[0], a[1], a[2]); + case 4: + return t[m](a[0], a[1], a[2], a[3]); + case 5: + return t[m](a[0], a[1], a[2], a[3], a[4]); + default: + return t[m].apply(t, a); + } + } +}); +enifed("ember-utils/assign", ["exports"], function (exports) { + /** + Copy properties from a source object to a target object. + + ```javascript + var a = { first: 'Yehuda' }; + var b = { last: 'Katz' }; + var c = { company: 'Tilde Inc.' }; + Ember.assign(a, b, c); // a === { first: 'Yehuda', last: 'Katz', company: 'Tilde Inc.' }, b === { last: 'Katz' }, c === { company: 'Tilde Inc.' } + ``` + + @method assign + @for Ember + @param {Object} original The object to assign into + @param {Object} ...args The objects to copy properties from + @return {Object} + @public + */ + "use strict"; - HasBlockParams.prototype.compile = function compile(compiler, env) { - var blockName = this.blockName; - - if (compiler.hasBlockSymbol(blockName)) { - var symbol = compiler.getBlockSymbol(blockName); - var inner = new _glimmerRuntimeLibCompiledExpressionsHasBlock.CompiledGetBlockBySymbol(symbol, blockName); - return new _glimmerRuntimeLibCompiledExpressionsHasBlock.CompiledHasBlockParams(inner); - } else if (compiler.hasPartialArgsSymbol()) { - var symbol = compiler.getPartialArgsSymbol(); - var inner = new _glimmerRuntimeLibCompiledExpressionsHasBlock.CompiledInPartialGetBlock(symbol, blockName); - return new _glimmerRuntimeLibCompiledExpressionsHasBlock.CompiledHasBlockParams(inner); - } else { - throw new Error('[BUG] ${blockName} is not a valid block name.'); - } - }; + exports.default = assign; - return HasBlockParams; - })(_glimmerRuntimeLibSyntax.Expression); + function assign(original) { + for (var i = 1; i < arguments.length; i++) { + var arg = arguments[i]; + if (!arg) { + continue; + } - exports.HasBlockParams = HasBlockParams; + var updates = Object.keys(arg); - var Concat = (function () { - function Concat(parts) { - this.parts = parts; - this.type = "concat"; - } + for (var _i = 0; _i < updates.length; _i++) { + var prop = updates[_i]; + original[prop] = arg[prop]; + } + } - Concat.fromSpec = function fromSpec(sexp) { - var params = sexp[1]; + return original; + } +}); +enifed('ember-utils/dictionary', ['exports', 'ember-utils/empty-object'], function (exports, _emberUtilsEmptyObject) { + 'use strict'; - return new Concat(params.map(_glimmerRuntimeLibSyntaxExpressions.default)); - }; + exports.default = makeDictionary; - Concat.build = function build(parts) { - return new this(parts); - }; + // 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. - Concat.prototype.compile = function compile(compiler, env, symbolTable) { - return new _glimmerRuntimeLibCompiledExpressionsConcat.default(this.parts.map(function (p) { - return p.compile(compiler, env, symbolTable); - })); - }; + function makeDictionary(parent) { + var dict = undefined; + if (parent === null) { + dict = new _emberUtilsEmptyObject.default(); + } else { + dict = Object.create(parent); + } + dict['_dict'] = null; + delete dict['_dict']; + return dict; + } +}); +enifed("ember-utils/empty-object", ["exports"], function (exports) { + // This exists because `Object.create(null)` is absurdly slow compared + // to `new EmptyObject()`. In either case, you want a null prototype + // when you're treating the object instances as arbitrary dictionaries + // and don't want your keys colliding with build-in methods on the + // default object prototype. - return Concat; - })(); + "use strict"; - exports.Concat = Concat; + var proto = Object.create(null, { + // without this, we will always still end up with (new + // EmptyObject()).constructor === Object + constructor: { + value: undefined, + enumerable: false, + writable: true + } + }); - var Blocks = (function () { - function Blocks(_default) { - var inverse = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + function EmptyObject() {} + EmptyObject.prototype = proto; + exports.default = EmptyObject; +}); +enifed('ember-utils/guid', ['exports', 'ember-utils/intern'], function (exports, _emberUtilsIntern) { + 'use strict'; - this.type = "blocks"; - this.default = _default; - this.inverse = inverse; - } + exports.uuid = uuid; + exports.generateGuid = generateGuid; + exports.guidFor = guidFor; - Blocks.fromSpec = function fromSpec(_default) { - var inverse = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + /** + Previously we used `Ember.$.uuid`, however `$.uuid` has been removed from + jQuery master. We'll just bootstrap our own uuid now. + + @private + @return {Number} the uuid + */ + var _uuid = 0; - return new Blocks(_default, inverse); - }; + /** + Generates a universally unique identifier. This method + is used internally by Ember for assisting with + the generation of GUID's and other unique identifiers. + + @public + @return {Number} [description] + */ - Blocks.empty = function empty() { - return EMPTY_BLOCKS; - }; + function uuid() { + return ++_uuid; + } - return Blocks; - })(); + /** + Prefix used for guids through out Ember. + @private + @property GUID_PREFIX + @for Ember + @type String + @final + */ + var GUID_PREFIX = 'ember'; - exports.Blocks = Blocks; - var EMPTY_BLOCKS = new ((function (_Blocks) { - babelHelpers.inherits(_class, _Blocks); + // Used for guid generation... + var numberCache = []; + var stringCache = {}; - function _class() { - _Blocks.call(this, null, null); - } + /** + A unique key used to assign guids and other private metadata to objects. + If you inspect an object in your browser debugger you will often see these. + They can be safely ignored. + + On browsers that support it, these properties are added with enumeration + disabled so they won't show up when you iterate over your properties. + + @private + @property GUID_KEY + @for Ember + @type String + @final + */ + var GUID_KEY = _emberUtilsIntern.default('__ember' + +new Date()); - return _class; - })(Blocks))(); - exports.EMPTY_BLOCKS = EMPTY_BLOCKS; + exports.GUID_KEY = GUID_KEY; + var GUID_DESC = { + writable: true, + configurable: true, + enumerable: false, + value: null + }; - var Args = (function () { - function Args(positional, named, blocks) { - this.positional = positional; - this.named = named; - this.blocks = blocks; - this.type = "args"; - } + exports.GUID_DESC = GUID_DESC; + var nullDescriptor = { + configurable: true, + writable: true, + enumerable: false, + value: null + }; - Args.empty = function empty() { - return EMPTY_ARGS; - }; + var GUID_KEY_PROPERTY = { + name: GUID_KEY, + descriptor: nullDescriptor + }; - Args.fromSpec = function fromSpec(positional, named, blocks) { - return new Args(PositionalArgs.fromSpec(positional), NamedArgs.fromSpec(named), blocks); - }; + exports.GUID_KEY_PROPERTY = GUID_KEY_PROPERTY; + /** + Generates a new guid, optionally saving the guid to the object that you + pass in. You will rarely need to use this method. Instead you should + call `Ember.guidFor(obj)`, which return an existing guid if available. + + @private + @method generateGuid + @for Ember + @param {Object} [obj] Object the guid will be used for. If passed in, the guid will + be saved on the object and reused whenever you pass the same object + again. + + If no object is passed, just generate a new guid. + @param {String} [prefix] Prefix to place in front of the guid. Useful when you want to + separate the guid into separate namespaces. + @return {String} the guid + */ - Args.fromPositionalArgs = function fromPositionalArgs(positional) { - var blocks = arguments.length <= 1 || arguments[1] === undefined ? EMPTY_BLOCKS : arguments[1]; + function generateGuid(obj, prefix) { + if (!prefix) { + prefix = GUID_PREFIX; + } - return new Args(positional, EMPTY_NAMED_ARGS, blocks); - }; + var ret = prefix + uuid(); + if (obj) { + if (obj[GUID_KEY] === null) { + obj[GUID_KEY] = ret; + } else { + GUID_DESC.value = ret; + if (obj.__defineNonEnumerable) { + obj.__defineNonEnumerable(GUID_KEY_PROPERTY); + } else { + Object.defineProperty(obj, GUID_KEY, GUID_DESC); + } + } + } + return ret; + } - Args.fromNamedArgs = function fromNamedArgs(named) { - var blocks = arguments.length <= 1 || arguments[1] === undefined ? EMPTY_BLOCKS : arguments[1]; + /** + Returns a unique id for the object. If the object does not yet have a guid, + one will be assigned to it. You can call this on any object, + `Ember.Object`-based or not, but be aware that it will add a `_guid` + property. + + You can also use this method on DOM Element objects. + + @public + @method guidFor + @for Ember + @param {Object} obj any object, string, number, Element, or primitive + @return {String} the unique guid for this instance. + */ - return new Args(EMPTY_POSITIONAL_ARGS, named, blocks); - }; + function guidFor(obj) { + var type = typeof obj; + var isObject = type === 'object' && obj !== null; + var isFunction = type === 'function'; - Args.build = function build(positional, named, blocks) { - if (positional === EMPTY_POSITIONAL_ARGS && named === EMPTY_NAMED_ARGS && blocks === EMPTY_BLOCKS) { - return EMPTY_ARGS; - } else { - return new this(positional, named, blocks); - } - }; + if ((isObject || isFunction) && obj[GUID_KEY]) { + return obj[GUID_KEY]; + } - Args.prototype.compile = function compile(compiler, env, symbolTable) { - var positional = this.positional; - var named = this.named; - var blocks = this.blocks; + // special cases where we don't want to add a key to object + if (obj === undefined) { + return '(undefined)'; + } - return _glimmerRuntimeLibCompiledExpressionsArgs.CompiledArgs.create(positional.compile(compiler, env, symbolTable), named.compile(compiler, env, symbolTable), blocks); - }; + if (obj === null) { + return '(null)'; + } - return Args; - })(); + var ret = undefined; - exports.Args = Args; + // Don't allow prototype changes to String etc. to change the guidFor + switch (type) { + case 'number': + ret = numberCache[obj]; - var PositionalArgs = (function () { - function PositionalArgs(values) { - this.values = values; - this.type = "positional"; - this.length = values.length; + if (!ret) { + ret = numberCache[obj] = 'nu' + obj; } - PositionalArgs.empty = function empty() { - return EMPTY_POSITIONAL_ARGS; - }; + return ret; - PositionalArgs.fromSpec = function fromSpec(sexp) { - if (!sexp || sexp.length === 0) return EMPTY_POSITIONAL_ARGS; - return new PositionalArgs(sexp.map(_glimmerRuntimeLibSyntaxExpressions.default)); - }; + case 'string': + ret = stringCache[obj]; - PositionalArgs.build = function build(exprs) { - if (exprs.length === 0) { - return EMPTY_POSITIONAL_ARGS; - } else { - return new this(exprs); - } - }; + if (!ret) { + ret = stringCache[obj] = 'st' + uuid(); + } - PositionalArgs.prototype.slice = function slice(start, end) { - return PositionalArgs.build(this.values.slice(start, end)); - }; + return ret; - PositionalArgs.prototype.at = function at(index) { - return this.values[index]; - }; + case 'boolean': + return obj ? '(true)' : '(false)'; - PositionalArgs.prototype.compile = function compile(compiler, env, symbolTable) { - return _glimmerRuntimeLibCompiledExpressionsArgs.CompiledPositionalArgs.create(this.values.map(function (v) { - return v.compile(compiler, env, symbolTable); - })); - }; + default: + if (obj === Object) { + return '(Object)'; + } - return PositionalArgs; - })(); + if (obj === Array) { + return '(Array)'; + } - exports.PositionalArgs = PositionalArgs; + ret = GUID_PREFIX + uuid(); - var EMPTY_POSITIONAL_ARGS = new ((function (_PositionalArgs) { - babelHelpers.inherits(_class2, _PositionalArgs); + if (obj[GUID_KEY] === null) { + obj[GUID_KEY] = ret; + } else { + GUID_DESC.value = ret; - function _class2() { - _PositionalArgs.call(this, _glimmerRuntimeLibUtils.EMPTY_ARRAY); + if (obj.__defineNonEnumerable) { + obj.__defineNonEnumerable(GUID_KEY_PROPERTY); + } else { + Object.defineProperty(obj, GUID_KEY, GUID_DESC); + } } + return ret; + } + } +}); +enifed('ember-utils/index', ['exports', 'ember-utils/symbol', 'ember-utils/owner', 'ember-utils/assign', 'ember-utils/empty-object', 'ember-utils/dictionary', 'ember-utils/guid', 'ember-utils/intern', 'ember-utils/super', 'ember-utils/inspect', 'ember-utils/lookup-descriptor', 'ember-utils/invoke', 'ember-utils/make-array', 'ember-utils/apply-str', 'ember-utils/name', 'ember-utils/to-string', 'ember-utils/weak-map-utils', 'ember-utils/proxy-utils'], function (exports, _emberUtilsSymbol, _emberUtilsOwner, _emberUtilsAssign, _emberUtilsEmptyObject, _emberUtilsDictionary, _emberUtilsGuid, _emberUtilsIntern, _emberUtilsSuper, _emberUtilsInspect, _emberUtilsLookupDescriptor, _emberUtilsInvoke, _emberUtilsMakeArray, _emberUtilsApplyStr, _emberUtilsName, _emberUtilsToString, _emberUtilsWeakMapUtils, _emberUtilsProxyUtils) { + /* + This package will be eagerly parsed and should have no dependencies on external + packages. + + It is intended to be used to share utility methods that will be needed + by every Ember application (and is **not** a dumping ground of useful utilities). + + Utility methods that are needed in < 80% of cases should be placed + elsewhere (so they can be lazily evaluated / parsed). + */ + 'use strict'; - _class2.prototype.slice = function slice(start, end) { - return this; - }; + exports.symbol = _emberUtilsSymbol.default; + exports.getOwner = _emberUtilsOwner.getOwner; + exports.setOwner = _emberUtilsOwner.setOwner; + exports.OWNER = _emberUtilsOwner.OWNER; + exports.assign = _emberUtilsAssign.default; + exports.EmptyObject = _emberUtilsEmptyObject.default; + exports.dictionary = _emberUtilsDictionary.default; + exports.uuid = _emberUtilsGuid.uuid; + exports.GUID_KEY = _emberUtilsGuid.GUID_KEY; + exports.GUID_DESC = _emberUtilsGuid.GUID_DESC; + exports.GUID_KEY_PROPERTY = _emberUtilsGuid.GUID_KEY_PROPERTY; + exports.generateGuid = _emberUtilsGuid.generateGuid; + exports.guidFor = _emberUtilsGuid.guidFor; + exports.intern = _emberUtilsIntern.default; + exports.checkHasSuper = _emberUtilsSuper.checkHasSuper; + exports.ROOT = _emberUtilsSuper.ROOT; + exports.wrap = _emberUtilsSuper.wrap; + exports.inspect = _emberUtilsInspect.default; + exports.lookupDescriptor = _emberUtilsLookupDescriptor.default; + exports.canInvoke = _emberUtilsInvoke.canInvoke; + exports.tryInvoke = _emberUtilsInvoke.tryInvoke; + exports.makeArray = _emberUtilsMakeArray.default; + exports.applyStr = _emberUtilsApplyStr.default; + exports.NAME_KEY = _emberUtilsName.default; + exports.toString = _emberUtilsToString.default; + exports.HAS_NATIVE_WEAKMAP = _emberUtilsWeakMapUtils.HAS_NATIVE_WEAKMAP; + exports.HAS_NATIVE_PROXY = _emberUtilsProxyUtils.HAS_NATIVE_PROXY; +}); +enifed('ember-utils/inspect', ['exports'], function (exports) { + 'use strict'; - _class2.prototype.at = function at(index) { - return undefined; // ??! - }; + exports.default = inspect; + var objectToString = Object.prototype.toString; - _class2.prototype.compile = function compile(compiler, env) { - return _glimmerRuntimeLibCompiledExpressionsArgs.CompiledPositionalArgs.empty(); - }; + /** + Convenience method to inspect an object. This method will attempt to + convert the object into a useful string description. + + It is a pretty simple implementation. If you want something more robust, + use something like JSDump: https://github.com/NV/jsDump + + @method inspect + @for Ember + @param {Object} obj The object you want to inspect. + @return {String} A description of the object + @since 1.4.0 + @private + */ - return _class2; - })(PositionalArgs))(); + function inspect(obj) { + if (obj === null) { + return 'null'; + } + if (obj === undefined) { + return 'undefined'; + } + if (Array.isArray(obj)) { + return '[' + obj + ']'; + } + // for non objects + var type = typeof obj; + if (type !== 'object' && type !== 'symbol') { + return '' + obj; + } + // overridden toString + if (typeof obj.toString === 'function' && obj.toString !== objectToString) { + return obj.toString(); + } - var NamedArgs = (function () { - function NamedArgs(keys, values) { - this.keys = keys; - this.values = values; - this.type = "named"; - this.length = keys.length; + // Object.prototype.toString === {}.toString + var v = undefined; + var ret = []; + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + v = obj[key]; + if (v === 'toString') { + continue; + } // ignore useless items + if (typeof v === 'function') { + v = 'function() { ... }'; } - NamedArgs.empty = function empty() { - return EMPTY_NAMED_ARGS; - }; + if (v && typeof v.toString !== 'function') { + ret.push(key + ': ' + objectToString.call(v)); + } else { + ret.push(key + ': ' + v); + } + } + } + return '{' + ret.join(', ') + '}'; + } +}); +enifed("ember-utils/intern", ["exports"], function (exports) { + /** + Strongly hint runtimes to intern the provided string. + + When do I need to use this function? + + For the most part, never. Pre-mature optimization is bad, and often the + runtime does exactly what you need it to, and more often the trade-off isn't + worth it. + + Why? + + Runtimes store strings in at least 2 different representations: + Ropes and Symbols (interned strings). The Rope provides a memory efficient + data-structure for strings created from concatenation or some other string + manipulation like splitting. + + Unfortunately checking equality of different ropes can be quite costly as + runtimes must resort to clever string comparison algorithms. These + algorithms typically cost in proportion to the length of the string. + Luckily, this is where the Symbols (interned strings) shine. As Symbols are + unique by their string content, equality checks can be done by pointer + comparison. + + How do I know if my string is a rope or symbol? + + Typically (warning general sweeping statement, but truthy in runtimes at + present) static strings created as part of the JS source are interned. + Strings often used for comparisons can be interned at runtime if some + criteria are met. One of these criteria can be the size of the entire rope. + For example, in chrome 38 a rope longer then 12 characters will not + intern, nor will segments of that rope. + + Some numbers: http://jsperf.com/eval-vs-keys/8 + + Known Trick™ + + @private + @return {String} interned version of the provided string + */ + "use strict"; - NamedArgs.fromSpec = function fromSpec(sexp) { - if (sexp === null || sexp === undefined) { - return EMPTY_NAMED_ARGS; - } - var keys = sexp[0]; - var exprs = sexp[1]; + exports.default = intern; - if (keys.length === 0) { - return EMPTY_NAMED_ARGS; - } - return new this(keys, exprs.map(function (expr) { - return _glimmerRuntimeLibSyntaxExpressions.default(expr); - })); - }; + function intern(str) { + var obj = {}; + obj[str] = 1; + for (var key in obj) { + if (key === str) { + return key; + } + } + return str; + } +}); +enifed('ember-utils/invoke', ['exports', 'ember-utils/apply-str'], function (exports, _emberUtilsApplyStr) { + 'use strict'; - NamedArgs.build = function build(keys, values) { - if (keys.length === 0) { - return EMPTY_NAMED_ARGS; - } else { - return new this(keys, values); - } - }; + exports.canInvoke = canInvoke; + exports.tryInvoke = tryInvoke; - NamedArgs.prototype.at = function at(key) { - var keys = this.keys; - var values = this.values; + /** + Checks to see if the `methodName` exists on the `obj`. + + ```javascript + let foo = { bar: function() { return 'bar'; }, baz: null }; + + Ember.canInvoke(foo, 'bar'); // true + Ember.canInvoke(foo, 'baz'); // false + Ember.canInvoke(foo, 'bat'); // false + ``` + + @method canInvoke + @for Ember + @param {Object} obj The object to check for the method + @param {String} methodName The method name to check for + @return {Boolean} + @private + */ - var index = keys.indexOf(key); - return values[index]; - }; + function canInvoke(obj, methodName) { + return !!(obj && typeof obj[methodName] === 'function'); + } - NamedArgs.prototype.has = function has(key) { - return this.keys.indexOf(key) !== -1; - }; + /** + Checks to see if the `methodName` exists on the `obj`, + and if it does, invokes it with the arguments passed. + + ```javascript + let d = new Date('03/15/2013'); + + Ember.tryInvoke(d, 'getTime'); // 1363320000000 + Ember.tryInvoke(d, 'setFullYear', [2014]); // 1394856000000 + Ember.tryInvoke(d, 'noSuchMethod', [2014]); // undefined + ``` + + @method tryInvoke + @for Ember + @param {Object} obj The object to check for the method + @param {String} methodName The method name to check for + @param {Array} [args] The arguments to pass to the method + @return {*} the return value of the invoked method or undefined if it cannot be invoked + @public + */ - NamedArgs.prototype.compile = function compile(compiler, env, symbolTable) { - var keys = this.keys; - var values = this.values; + function tryInvoke(obj, methodName, args) { + if (canInvoke(obj, methodName)) { + return args ? _emberUtilsApplyStr.default(obj, methodName, args) : _emberUtilsApplyStr.default(obj, methodName); + } + } +}); +enifed("ember-utils/lookup-descriptor", ["exports"], function (exports) { + "use strict"; - var compiledValues = new Array(values.length); - for (var i = 0; i < compiledValues.length; i++) { - compiledValues[i] = values[i].compile(compiler, env, symbolTable); - } - return new _glimmerRuntimeLibCompiledExpressionsArgs.CompiledNamedArgs(keys, compiledValues); - }; + exports.default = lookupDescriptor; - return NamedArgs; - })(); + function lookupDescriptor(obj, keyName) { + var current = obj; + while (current) { + var descriptor = Object.getOwnPropertyDescriptor(current, keyName); - exports.NamedArgs = NamedArgs; + if (descriptor) { + return descriptor; + } - var EMPTY_NAMED_ARGS = new ((function (_NamedArgs) { - babelHelpers.inherits(_class3, _NamedArgs); + current = Object.getPrototypeOf(current); + } - function _class3() { - _NamedArgs.call(this, _glimmerRuntimeLibUtils.EMPTY_ARRAY, _glimmerRuntimeLibUtils.EMPTY_ARRAY); - } + return null; + } +}); +enifed("ember-utils/make-array", ["exports"], function (exports) { + "use strict"; - _class3.prototype.at = function at(key) { - return undefined; // ??! - }; + exports.default = makeArray; + var isArray = Array.isArray; - _class3.prototype.has = function has(key) { - return false; - }; + /** + Forces the passed object to be part of an array. If the object is already + an array, it will return the object. Otherwise, it will add the object to + an array. If obj is `null` or `undefined`, it will return an empty array. + + ```javascript + Ember.makeArray(); // [] + Ember.makeArray(null); // [] + Ember.makeArray(undefined); // [] + Ember.makeArray('lindsay'); // ['lindsay'] + Ember.makeArray([1, 2, 42]); // [1, 2, 42] + + let controller = Ember.ArrayProxy.create({ content: [] }); + + Ember.makeArray(controller) === controller; // true + ``` + + @method makeArray + @for Ember + @param {Object} obj the object + @return {Array} + @private + */ - _class3.prototype.compile = function compile(compiler, env) { - return _glimmerRuntimeLibCompiledExpressionsArgs.CompiledNamedArgs.empty(); - }; + function makeArray(obj) { + if (obj === null || obj === undefined) { + return []; + } + return isArray(obj) ? obj : [obj]; + } +}); +enifed('ember-utils/name', ['exports', 'ember-utils/symbol'], function (exports, _emberUtilsSymbol) { + 'use strict'; - return _class3; - })(NamedArgs))(); - var EMPTY_ARGS = new ((function (_Args) { - babelHelpers.inherits(_class4, _Args); + exports.default = _emberUtilsSymbol.default('NAME_KEY'); +}); +enifed('ember-utils/owner', ['exports', 'ember-utils/symbol'], function (exports, _emberUtilsSymbol) { + /** + @module ember + @submodule ember-runtime + */ - function _class4() { - _Args.call(this, EMPTY_POSITIONAL_ARGS, EMPTY_NAMED_ARGS, EMPTY_BLOCKS); - } + 'use strict'; - _class4.prototype.compile = function compile(compiler, env) { - return _glimmerRuntimeLibCompiledExpressionsArgs.CompiledArgs.empty(); - }; + exports.getOwner = getOwner; + exports.setOwner = setOwner; + var OWNER = _emberUtilsSymbol.default('OWNER'); - return _class4; - })(Args))(); -}); + exports.OWNER = OWNER; + /** + Framework objects in an Ember application (components, services, routes, etc.) + are created via a factory and dependency injection system. Each of these + objects is the responsibility of an "owner", which handled its + instantiation and manages its lifetime. + + `getOwner` fetches the owner object responsible for an instance. This can + be used to lookup or resolve other class instances, or register new factories + into the owner. + + For example, this component dynamically looks up a service based on the + `audioType` passed as an attribute: + + ``` + // app/components/play-audio.js + import Ember from 'ember'; + + // Usage: + // + // {{play-audio audioType=model.audioType audioFile=model.file}} + // + export default Ember.Component.extend({ + audioService: Ember.computed('audioType', function() { + let owner = Ember.getOwner(this); + return owner.lookup(`service:${this.get('audioType')}`); + }), + click() { + let player = this.get('audioService'); + player.play(this.get('audioFile')); + } + }); + ``` + + @method getOwner + @for Ember + @param {Object} object An object with an owner. + @return {Object} An owner object. + @since 2.3.0 + @public + */ -enifed('glimmer-runtime/lib/syntax/expressions', ['exports', 'glimmer-runtime/lib/syntax/core', 'glimmer-wire-format'], function (exports, _glimmerRuntimeLibSyntaxCore, _glimmerWireFormat) { - 'use strict'; + function getOwner(object) { + return object[OWNER]; + } - var isArg = _glimmerWireFormat.Expressions.isArg; - var isConcat = _glimmerWireFormat.Expressions.isConcat; - var isGet = _glimmerWireFormat.Expressions.isGet; - var isHasBlock = _glimmerWireFormat.Expressions.isHasBlock; - var isHasBlockParams = _glimmerWireFormat.Expressions.isHasBlockParams; - var isHelper = _glimmerWireFormat.Expressions.isHelper; - var isUnknown = _glimmerWireFormat.Expressions.isUnknown; - var isPrimitiveValue = _glimmerWireFormat.Expressions.isPrimitiveValue; - var isUndefined = _glimmerWireFormat.Expressions.isUndefined; - - exports.default = function (sexp) { - if (isPrimitiveValue(sexp)) return _glimmerRuntimeLibSyntaxCore.Value.fromSpec(sexp); - if (isUndefined(sexp)) return _glimmerRuntimeLibSyntaxCore.Value.build(undefined); - if (isArg(sexp)) return _glimmerRuntimeLibSyntaxCore.GetArgument.fromSpec(sexp); - if (isConcat(sexp)) return _glimmerRuntimeLibSyntaxCore.Concat.fromSpec(sexp); - if (isGet(sexp)) return _glimmerRuntimeLibSyntaxCore.Get.fromSpec(sexp); - if (isHelper(sexp)) return _glimmerRuntimeLibSyntaxCore.Helper.fromSpec(sexp); - if (isUnknown(sexp)) return _glimmerRuntimeLibSyntaxCore.Unknown.fromSpec(sexp); - if (isHasBlock(sexp)) return _glimmerRuntimeLibSyntaxCore.HasBlock.fromSpec(sexp); - if (isHasBlockParams(sexp)) return _glimmerRuntimeLibSyntaxCore.HasBlockParams.fromSpec(sexp); - throw new Error('Unexpected wire format: ' + JSON.stringify(sexp)); - }; + /** + `setOwner` forces a new owner on a given object instance. This is primarily + useful in some testing cases. + + @method setOwner + @for Ember + @param {Object} object An object instance. + @param {Object} object The new owner object of the object instance. + @since 2.3.0 + @public + */ - ; + function setOwner(object, owner) { + object[OWNER] = owner; + } }); +enifed('ember-utils/proxy-utils', ['exports'], function (exports) { + 'use strict'; -enifed('glimmer-runtime/lib/syntax/statements', ['exports', 'glimmer-runtime/lib/syntax/core', 'glimmer-wire-format'], function (exports, _glimmerRuntimeLibSyntaxCore, _glimmerWireFormat) { - 'use strict'; - - var isYield = _glimmerWireFormat.Statements.isYield; - var isBlock = _glimmerWireFormat.Statements.isBlock; - var isPartial = _glimmerWireFormat.Statements.isPartial; - var isAppend = _glimmerWireFormat.Statements.isAppend; - var isDynamicAttr = _glimmerWireFormat.Statements.isDynamicAttr; - var isText = _glimmerWireFormat.Statements.isText; - var isComment = _glimmerWireFormat.Statements.isComment; - var isOpenElement = _glimmerWireFormat.Statements.isOpenElement; - var isFlushElement = _glimmerWireFormat.Statements.isFlushElement; - var isCloseElement = _glimmerWireFormat.Statements.isCloseElement; - var isStaticAttr = _glimmerWireFormat.Statements.isStaticAttr; - var isModifier = _glimmerWireFormat.Statements.isModifier; - var isDynamicArg = _glimmerWireFormat.Statements.isDynamicArg; - var isStaticArg = _glimmerWireFormat.Statements.isStaticArg; - var isTrustingAttr = _glimmerWireFormat.Statements.isTrustingAttr; - - exports.default = function (sexp, symbolTable, scanner) { - if (isYield(sexp)) return _glimmerRuntimeLibSyntaxCore.Yield.fromSpec(sexp); - if (isPartial(sexp)) return _glimmerRuntimeLibSyntaxCore.Partial.fromSpec(sexp); - if (isBlock(sexp)) return _glimmerRuntimeLibSyntaxCore.Block.fromSpec(sexp, symbolTable, scanner); - if (isAppend(sexp)) return _glimmerRuntimeLibSyntaxCore.OptimizedAppend.fromSpec(sexp); - if (isDynamicAttr(sexp)) return _glimmerRuntimeLibSyntaxCore.DynamicAttr.fromSpec(sexp); - if (isDynamicArg(sexp)) return _glimmerRuntimeLibSyntaxCore.DynamicArg.fromSpec(sexp); - if (isTrustingAttr(sexp)) return _glimmerRuntimeLibSyntaxCore.TrustingAttr.fromSpec(sexp); - if (isText(sexp)) return _glimmerRuntimeLibSyntaxCore.Text.fromSpec(sexp); - if (isComment(sexp)) return _glimmerRuntimeLibSyntaxCore.Comment.fromSpec(sexp); - if (isOpenElement(sexp)) return _glimmerRuntimeLibSyntaxCore.OpenElement.fromSpec(sexp, symbolTable); - if (isFlushElement(sexp)) return _glimmerRuntimeLibSyntaxCore.FlushElement.fromSpec(); - if (isCloseElement(sexp)) return _glimmerRuntimeLibSyntaxCore.CloseElement.fromSpec(); - if (isStaticAttr(sexp)) return _glimmerRuntimeLibSyntaxCore.StaticAttr.fromSpec(sexp); - if (isStaticArg(sexp)) return _glimmerRuntimeLibSyntaxCore.StaticArg.fromSpec(sexp); - if (isModifier(sexp)) return _glimmerRuntimeLibSyntaxCore.Modifier.fromSpec(sexp); - }; - - ; + var HAS_NATIVE_PROXY = typeof Proxy === 'function'; + exports.HAS_NATIVE_PROXY = HAS_NATIVE_PROXY; }); +enifed('ember-utils/super', ['exports'], function (exports) { + 'use strict'; -enifed('glimmer-runtime/lib/template', ['exports', 'glimmer-util', 'glimmer-runtime/lib/builder', 'glimmer-runtime/lib/vm', 'glimmer-runtime/lib/scanner'], function (exports, _glimmerUtil, _glimmerRuntimeLibBuilder, _glimmerRuntimeLibVm, _glimmerRuntimeLibScanner) { - 'use strict'; - - exports.default = templateFactory; - - var clientId = 0; - - function templateFactory(_ref) { - var id = _ref.id; - var meta = _ref.meta; - var block = _ref.block; + exports.wrap = wrap; + var HAS_SUPER_PATTERN = /\.(_super|call\(this|apply\(this)/; + var fnToString = Function.prototype.toString; - var parsedBlock = undefined; - if (!id) { - id = 'client-' + clientId++; - } - var create = function (env, envMeta) { - var newMeta = envMeta ? _glimmerUtil.assign({}, envMeta, meta) : meta; - if (!parsedBlock) { - parsedBlock = JSON.parse(block); - } - return template(parsedBlock, id, newMeta, env); - }; - return { id: id, meta: meta, create: create }; - } + var checkHasSuper = (function () { + var sourceAvailable = fnToString.call(function () { + return this; + }).indexOf('return this') > -1; - function template(block, id, meta, env) { - var scanner = new _glimmerRuntimeLibScanner.default(block, meta, env); - var entryPoint = undefined; - var asEntryPoint = function () { - if (!entryPoint) entryPoint = scanner.scanEntryPoint(); - return entryPoint; - }; - var layout = undefined; - var asLayout = function () { - if (!layout) layout = scanner.scanLayout(); - return layout; - }; - var asPartial = function (symbols) { - return scanner.scanPartial(symbols); - }; - var render = function (self, appendTo, dynamicScope) { - var elementStack = _glimmerRuntimeLibBuilder.ElementStack.forInitialRender(env, appendTo, null); - var compiled = asEntryPoint().compile(env); - var vm = _glimmerRuntimeLibVm.VM.initial(env, self, dynamicScope, elementStack, compiled.symbols); - return vm.execute(compiled.ops); - }; - return { id: id, meta: meta, _block: block, asEntryPoint: asEntryPoint, asLayout: asLayout, asPartial: asPartial, render: render }; + if (sourceAvailable) { + return function checkHasSuper(func) { + return HAS_SUPER_PATTERN.test(fnToString.call(func)); + }; } -}); -enifed('glimmer-runtime/lib/upsert', ['exports', 'glimmer-runtime/lib/bounds'], function (exports, _glimmerRuntimeLibBounds) { - 'use strict'; + return function checkHasSuper() { + return true; + }; + })(); - exports.isSafeString = isSafeString; - exports.isNode = isNode; - exports.isString = isString; - exports.cautiousInsert = cautiousInsert; - exports.trustingInsert = trustingInsert; + exports.checkHasSuper = checkHasSuper; + function ROOT() {} + ROOT.__hasSuper = false; - function isSafeString(value) { - return value && typeof value['toHTML'] === 'function'; + function hasSuper(func) { + if (func.__hasSuper === undefined) { + func.__hasSuper = checkHasSuper(func); } + return func.__hasSuper; + } - function isNode(value) { - return value !== null && typeof value === 'object' && typeof value['nodeType'] === 'number'; - } + /** + 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 + @method wrap + @for Ember + @param {Function} func The function to call + @param {Function} superFunc The super function. + @return {Function} wrapped function. + */ - function isString(value) { - return typeof value === 'string'; + function wrap(func, superFunc) { + if (!hasSuper(func)) { + return func; } - - var Upsert = function Upsert(bounds) { - this.bounds = bounds; - }; - - exports.default = Upsert; - - function cautiousInsert(dom, cursor, value) { - if (isString(value)) { - return TextUpsert.insert(dom, cursor, value); - } - if (isSafeString(value)) { - return SafeStringUpsert.insert(dom, cursor, value); - } - if (isNode(value)) { - return NodeUpsert.insert(dom, cursor, value); - } + // ensure an unwrapped super that calls _super is wrapped with a terminal _super + if (!superFunc.wrappedFunction && hasSuper(superFunc)) { + return _wrap(func, _wrap(superFunc, ROOT)); } + return _wrap(func, superFunc); + } - function trustingInsert(dom, cursor, value) { - if (isString(value)) { - return HTMLUpsert.insert(dom, cursor, value); - } - if (isNode(value)) { - return NodeUpsert.insert(dom, cursor, value); - } + function _wrap(func, superFunc) { + function superWrapper() { + var orig = this._super; + this._super = superFunc; + var ret = func.apply(this, arguments); + this._super = orig; + return ret; } - var TextUpsert = (function (_Upsert) { - babelHelpers.inherits(TextUpsert, _Upsert); - - function TextUpsert(bounds, textNode) { - _Upsert.call(this, bounds); - this.textNode = textNode; - } + superWrapper.wrappedFunction = func; + superWrapper.__ember_observes__ = func.__ember_observes__; + superWrapper.__ember_observesBefore__ = func.__ember_observesBefore__; + superWrapper.__ember_listens__ = func.__ember_listens__; - TextUpsert.insert = function insert(dom, cursor, value) { - var textNode = dom.createTextNode(value); - dom.insertBefore(cursor.element, textNode, cursor.nextSibling); - var bounds = new _glimmerRuntimeLibBounds.SingleNodeBounds(cursor.element, textNode); - return new TextUpsert(bounds, textNode); - }; + return superWrapper; + } +}); +enifed('ember-utils/symbol', ['exports', 'ember-utils/guid', 'ember-utils/intern'], function (exports, _emberUtilsGuid, _emberUtilsIntern) { + 'use strict'; - TextUpsert.prototype.update = function update(dom, value) { - if (isString(value)) { - var textNode = this.textNode; + exports.default = symbol; - textNode.nodeValue = value; - return true; - } else { - return false; - } - }; + function symbol(debugName) { + // TODO: Investigate using platform symbols, but we do not + // want to require non-enumerability for this API, which + // would introduce a large cost. + var id = _emberUtilsGuid.GUID_KEY + Math.floor(Math.random() * new Date()); + return _emberUtilsIntern.default('__' + debugName + '__ [id=' + id + ']'); + } +}); +enifed('ember-utils/to-string', ['exports'], function (exports) { + 'use strict'; - return TextUpsert; - })(Upsert); + exports.default = toString; + var objectToString = Object.prototype.toString; - var HTMLUpsert = (function (_Upsert2) { - babelHelpers.inherits(HTMLUpsert, _Upsert2); + /* + A `toString` util function that supports objects without a `toString` + method, e.g. an object created with `Object.create(null)`. + */ - function HTMLUpsert() { - _Upsert2.apply(this, arguments); - } + function toString(obj) { + if (obj && typeof obj.toString === 'function') { + return obj.toString(); + } else { + return objectToString.call(obj); + } + } +}); +enifed('ember-utils/weak-map-utils', ['exports'], function (exports) { + 'use strict'; - HTMLUpsert.insert = function insert(dom, cursor, value) { - var bounds = dom.insertHTMLBefore(cursor.element, value, cursor.nextSibling); - return new HTMLUpsert(bounds); - }; + var HAS_NATIVE_WEAKMAP = (function () { + // detect if `WeakMap` is even present + var hasWeakMap = typeof WeakMap === 'function'; + if (!hasWeakMap) { + return false; + } - HTMLUpsert.prototype.update = function update(dom, value) { - if (isString(value)) { - var bounds = this.bounds; + var instance = new WeakMap(); + // use `Object`'s `.toString` directly to prevent us from detecting + // polyfills as native weakmaps + return Object.prototype.toString.call(instance) === '[object WeakMap]'; + })(); + exports.HAS_NATIVE_WEAKMAP = HAS_NATIVE_WEAKMAP; +}); +enifed('ember-views/compat/attrs', ['exports', 'ember-utils'], function (exports, _emberUtils) { + 'use strict'; - var parentElement = bounds.parentElement(); - var nextSibling = _glimmerRuntimeLibBounds.clear(bounds); - this.bounds = dom.insertHTMLBefore(parentElement, nextSibling, value); - return true; - } else { - return false; - } - }; + var MUTABLE_CELL = _emberUtils.symbol('MUTABLE_CELL'); + exports.MUTABLE_CELL = MUTABLE_CELL; +}); +enifed('ember-views/compat/fallback-view-registry', ['exports', 'ember-utils'], function (exports, _emberUtils) { + 'use strict'; - return HTMLUpsert; - })(Upsert); + exports.default = _emberUtils.dictionary(null); +}); +enifed('ember-views/component_lookup', ['exports', 'ember-metal', 'ember-runtime', 'container'], function (exports, _emberMetal, _emberRuntime, _container) { + 'use strict'; - var SafeStringUpsert = (function (_Upsert3) { - babelHelpers.inherits(SafeStringUpsert, _Upsert3); + exports.default = _emberRuntime.Object.extend({ + componentFor: function (name, owner, options) { + _emberMetal.assert('You cannot use \'' + name + '\' as a component name. Component names must contain a hyphen.', ~name.indexOf('-')); + var fullName = 'component:' + name; + return owner[_container.FACTORY_FOR](fullName, options); + }, - function SafeStringUpsert(bounds, lastStringValue) { - _Upsert3.call(this, bounds); - this.lastStringValue = lastStringValue; - } + layoutFor: function (name, owner, options) { + _emberMetal.assert('You cannot use \'' + name + '\' as a component name. Component names must contain a hyphen.', ~name.indexOf('-')); - SafeStringUpsert.insert = function insert(dom, cursor, value) { - var stringValue = value.toHTML(); - var bounds = dom.insertHTMLBefore(cursor.element, stringValue, cursor.nextSibling); - return new SafeStringUpsert(bounds, stringValue); - }; + var templateFullName = 'template:components/' + name; + return owner.lookup(templateFullName, options); + } + }); +}); +enifed('ember-views/index', ['exports', 'ember-views/system/ext', 'ember-views/system/jquery', 'ember-views/system/utils', 'ember-views/system/event_dispatcher', 'ember-views/component_lookup', 'ember-views/mixins/text_support', 'ember-views/views/core_view', 'ember-views/mixins/class_names_support', 'ember-views/mixins/child_views_support', 'ember-views/mixins/view_state_support', 'ember-views/mixins/view_support', 'ember-views/mixins/action_support', 'ember-views/compat/attrs', 'ember-views/system/lookup_partial', 'ember-views/utils/lookup-component', 'ember-views/system/action_manager', 'ember-views/compat/fallback-view-registry'], function (exports, _emberViewsSystemExt, _emberViewsSystemJquery, _emberViewsSystemUtils, _emberViewsSystemEvent_dispatcher, _emberViewsComponent_lookup, _emberViewsMixinsText_support, _emberViewsViewsCore_view, _emberViewsMixinsClass_names_support, _emberViewsMixinsChild_views_support, _emberViewsMixinsView_state_support, _emberViewsMixinsView_support, _emberViewsMixinsAction_support, _emberViewsCompatAttrs, _emberViewsSystemLookup_partial, _emberViewsUtilsLookupComponent, _emberViewsSystemAction_manager, _emberViewsCompatFallbackViewRegistry) { + /** + @module ember + @submodule ember-views + */ - SafeStringUpsert.prototype.update = function update(dom, value) { - if (isSafeString(value)) { - var stringValue = value.toHTML(); - if (stringValue !== this.lastStringValue) { - var bounds = this.bounds; + 'use strict'; - var parentElement = bounds.parentElement(); - var nextSibling = _glimmerRuntimeLibBounds.clear(bounds); - this.bounds = dom.insertHTMLBefore(parentElement, nextSibling, stringValue); - this.lastStringValue = stringValue; - } - return true; - } else { - return false; - } - }; + exports.jQuery = _emberViewsSystemJquery.default; + exports.isSimpleClick = _emberViewsSystemUtils.isSimpleClick; + exports.getViewBounds = _emberViewsSystemUtils.getViewBounds; + exports.getViewClientRects = _emberViewsSystemUtils.getViewClientRects; + exports.getViewBoundingClientRect = _emberViewsSystemUtils.getViewBoundingClientRect; + exports.getRootViews = _emberViewsSystemUtils.getRootViews; + exports.getChildViews = _emberViewsSystemUtils.getChildViews; + exports.getViewId = _emberViewsSystemUtils.getViewId; + exports.getViewElement = _emberViewsSystemUtils.getViewElement; + exports.setViewElement = _emberViewsSystemUtils.setViewElement; + exports.STYLE_WARNING = _emberViewsSystemUtils.STYLE_WARNING; + exports.EventDispatcher = _emberViewsSystemEvent_dispatcher.default; + exports.ComponentLookup = _emberViewsComponent_lookup.default; + exports.TextSupport = _emberViewsMixinsText_support.default; + exports.CoreView = _emberViewsViewsCore_view.default; + exports.ClassNamesSupport = _emberViewsMixinsClass_names_support.default; + exports.ChildViewsSupport = _emberViewsMixinsChild_views_support.default; + exports.ViewStateSupport = _emberViewsMixinsView_state_support.default; + exports.ViewMixin = _emberViewsMixinsView_support.default; + exports.dispatchLifeCycleHook = _emberViewsMixinsView_support.dispatchLifeCycleHook; + exports.ActionSupport = _emberViewsMixinsAction_support.default; + exports.MUTABLE_CELL = _emberViewsCompatAttrs.MUTABLE_CELL; + exports.lookupPartial = _emberViewsSystemLookup_partial.default; + exports.hasPartial = _emberViewsSystemLookup_partial.hasPartial; + exports.lookupComponent = _emberViewsUtilsLookupComponent.default; + exports.ActionManager = _emberViewsSystemAction_manager.default; + exports.fallbackViewRegistry = _emberViewsCompatFallbackViewRegistry.default; +}); +// for the side effect of extending Ember.run.queues +enifed('ember-views/mixins/action_support', ['exports', 'ember-utils', 'ember-metal', 'ember-views/compat/attrs'], function (exports, _emberUtils, _emberMetal, _emberViewsCompatAttrs) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; - return SafeStringUpsert; - })(Upsert); + function validateAction(component, actionName) { + if (actionName && actionName[_emberViewsCompatAttrs.MUTABLE_CELL]) { + actionName = actionName.value; + } - var NodeUpsert = (function (_Upsert4) { - babelHelpers.inherits(NodeUpsert, _Upsert4); + _emberMetal.assert('The default action was triggered on the component ' + component.toString() + ', but the action name (' + actionName + ') was not a string.', _emberMetal.isNone(actionName) || typeof actionName === 'string' || typeof actionName === 'function'); + return actionName; + } - function NodeUpsert() { - _Upsert4.apply(this, arguments); + /** + @class ActionSupport + @namespace Ember + @private + */ + exports.default = _emberMetal.Mixin.create({ + /** + 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 + export default Ember.Component.extend({ + click() { + if (this.get('isPlaying')) { + this.sendAction('play'); + } else { + this.sendAction('stop'); + } + } + }); + ``` + The actions "play" and "stop" must be passed to this `play-button` component: + ```handlebars + {{! app/templates/application.hbs }} + {{play-button play=(action "musicStarted") stop=(action "musicStopped")}} + ``` + When the component receives a browser `click` event it translate this + interaction into application-specific semantics ("play" or "stop") and + calls the specified action. + ```javascript + // app/controller/application.js + export default Ember.Controller.extend({ + actions: { + musicStarted() { + // called when the play button is clicked + // and the music started playing + }, + musicStopped() { + // called when the play button is clicked + // and the music stopped playing + } + } + }); + ``` + If no action is passed to `sendAction` a default name of "action" + is assumed. + ```javascript + // app/components/next-button.js + export default Ember.Component.extend({ + click() { + this.sendAction(); + } + }); + ``` + ```handlebars + {{! app/templates/application.hbs }} + {{next-button action=(action "playNextSongInAlbum")}} + ``` + ```javascript + // app/controllers/application.js + App.ApplicationController = Ember.Controller.extend({ + actions: { + playNextSongInAlbum() { + ... + } } + }); + ``` + @method sendAction + @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]; + } - NodeUpsert.insert = function insert(dom, cursor, node) { - dom.insertBefore(cursor.element, node, cursor.nextSibling); - return new NodeUpsert(_glimmerRuntimeLibBounds.single(cursor.element, node)); - }; + var actionName = undefined; - NodeUpsert.prototype.update = function update(dom, value) { - if (isNode(value)) { - var bounds = this.bounds; + // Send the default action + if (action === undefined) { + action = 'action'; + } + actionName = _emberMetal.get(this, 'attrs.' + action) || _emberMetal.get(this, action); + actionName = validateAction(this, actionName); - var parentElement = bounds.parentElement(); - var nextSibling = _glimmerRuntimeLibBounds.clear(bounds); - this.bounds = dom.insertNodeBefore(parentElement, value, nextSibling); - return true; - } else { - return false; - } - }; + // If no action name for that action could be found, just abort. + if (actionName === undefined) { + return; + } - return NodeUpsert; - })(Upsert); -}); + if (typeof actionName === 'function') { + actionName.apply(undefined, contexts); + } else { + this.triggerAction({ + action: actionName, + actionContext: contexts + }); + } + }, -enifed('glimmer-runtime/lib/utils', ['exports', 'glimmer-util'], function (exports, _glimmerUtil) { - 'use strict'; + send: function (actionName) { + for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } - var HAS_NATIVE_WEAKMAP = (function () { - // detect if `WeakMap` is even present - var hasWeakMap = typeof WeakMap === 'function'; - if (!hasWeakMap) { - return false; - } - var instance = new WeakMap(); - // use `Object`'s `.toString` directly to prevent us from detecting - // polyfills as native weakmaps - return Object.prototype.toString.call(instance) === '[object WeakMap]'; - })(); - var EMPTY_ARRAY = HAS_NATIVE_WEAKMAP ? Object.freeze([]) : []; - exports.EMPTY_ARRAY = EMPTY_ARRAY; - var EMPTY_DICT = HAS_NATIVE_WEAKMAP ? Object.freeze(_glimmerUtil.dict()) : _glimmerUtil.dict(); - exports.EMPTY_DICT = EMPTY_DICT; + var action = this.actions && this.actions[actionName]; - var ListRange = (function () { - function ListRange(list, start, end) { - this.list = list; - this.start = start; - this.end = end; + if (action) { + var shouldBubble = action.apply(this, args) === true; + if (!shouldBubble) { + return; } + } - ListRange.prototype.at = function at(index) { - if (index >= this.list.length) return null; - return this.list[index]; - }; - - ListRange.prototype.min = function min() { - return this.start; - }; - - ListRange.prototype.max = function max() { - return this.end; - }; - - return ListRange; - })(); - - exports.ListRange = ListRange; + var target = _emberMetal.get(this, 'target'); + if (target) { + _emberMetal.assert('The `target` for ' + this + ' (' + target + ') does not have a `send` method', typeof target.send === 'function'); + target.send.apply(target, arguments); + } else { + _emberMetal.assert(_emberUtils.inspect(this) + ' had no action handler for: ' + actionName, action); + } + } + }); }); - -enifed('glimmer-runtime/lib/vm', ['exports', 'glimmer-runtime/lib/vm/append', 'glimmer-runtime/lib/vm/update', 'glimmer-runtime/lib/vm/render-result'], function (exports, _glimmerRuntimeLibVmAppend, _glimmerRuntimeLibVmUpdate, _glimmerRuntimeLibVmRenderResult) { +enifed('ember-views/mixins/child_views_support', ['exports', 'ember-utils', 'ember-metal', 'ember-views/system/utils'], function (exports, _emberUtils, _emberMetal, _emberViewsSystemUtils) { + /** + @module ember + @submodule ember-views + */ 'use strict'; - exports.VM = _glimmerRuntimeLibVmAppend.default; - exports.PublicVM = _glimmerRuntimeLibVmAppend.PublicVM; - exports.UpdatingVM = _glimmerRuntimeLibVmUpdate.default; - exports.RenderResult = _glimmerRuntimeLibVmRenderResult.default; -}); - -enifed('glimmer-runtime/lib/vm/append', ['exports', 'glimmer-runtime/lib/environment', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-runtime/lib/vm/update', 'glimmer-runtime/lib/vm/render-result', 'glimmer-runtime/lib/vm/frame'], function (exports, _glimmerRuntimeLibEnvironment, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerRuntimeLibVmUpdate, _glimmerRuntimeLibVmRenderResult, _glimmerRuntimeLibVmFrame) { - 'use strict'; - - var VM = (function () { - function VM(env, scope, dynamicScope, elementStack) { - this.env = env; - this.elementStack = elementStack; - this.dynamicScopeStack = new _glimmerUtil.Stack(); - this.scopeStack = new _glimmerUtil.Stack(); - this.updatingOpcodeStack = new _glimmerUtil.Stack(); - this.cacheGroups = new _glimmerUtil.Stack(); - this.listBlockStack = new _glimmerUtil.Stack(); - this.frame = new _glimmerRuntimeLibVmFrame.FrameStack(); - this.env = env; - this.elementStack = elementStack; - this.scopeStack.push(scope); - this.dynamicScopeStack.push(dynamicScope); - } - - VM.initial = function initial(env, self, dynamicScope, elementStack, size) { - var scope = _glimmerRuntimeLibEnvironment.Scope.root(self, size); - return new VM(env, scope, dynamicScope, elementStack); - }; - - VM.prototype.capture = function capture() { - return { - env: this.env, - scope: this.scope(), - dynamicScope: this.dynamicScope(), - frame: this.frame.capture() - }; - }; + exports.default = _emberMetal.Mixin.create({ + init: function () { + this._super.apply(this, arguments); + _emberViewsSystemUtils.initChildViews(this); + }, - VM.prototype.goto = function goto(op) { - // assert(this.frame.getOps().contains(op), `Illegal jump to ${op.label}`); - this.frame.goto(op); - }; + /** + Array of child views. You should never edit this array directly. + @property childViews + @type Array + @default [] + @private + */ + childViews: _emberMetal.descriptor({ + configurable: false, + enumerable: false, + get: function () { + return _emberViewsSystemUtils.getChildViews(this); + } + }), - VM.prototype.beginCacheGroup = function beginCacheGroup() { - this.cacheGroups.push(this.updatingOpcodeStack.current.tail()); - }; + appendChild: function (view) { + this.linkChild(view); + _emberViewsSystemUtils.addChildView(this, view); + }, - VM.prototype.commitCacheGroup = function commitCacheGroup() { - // JumpIfNotModified(END) - // (head) - // (....) - // (tail) - // DidModify - // END: Noop - var END = new _glimmerRuntimeLibCompiledOpcodesVm.LabelOpcode("END"); - var opcodes = this.updatingOpcodeStack.current; - var marker = this.cacheGroups.pop(); - var head = marker ? opcodes.nextNode(marker) : opcodes.head(); - var tail = opcodes.tail(); - var tag = _glimmerReference.combineSlice(new _glimmerUtil.ListSlice(head, tail)); - var guard = new _glimmerRuntimeLibCompiledOpcodesVm.JumpIfNotModifiedOpcode(tag, END); - opcodes.insertBefore(guard, head); - opcodes.append(new _glimmerRuntimeLibCompiledOpcodesVm.DidModifyOpcode(guard)); - opcodes.append(END); - }; + linkChild: function (instance) { + if (!_emberUtils.getOwner(instance)) { + _emberUtils.setOwner(instance, _emberUtils.getOwner(this)); + } + } + }); +}); +enifed('ember-views/mixins/class_names_support', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-views + */ - VM.prototype.enter = function enter(ops) { - var updating = new _glimmerUtil.LinkedList(); - var tracker = this.stack().pushUpdatableBlock(); - var state = this.capture(); - var tryOpcode = new _glimmerRuntimeLibVmUpdate.TryOpcode(ops, state, tracker, updating); - this.didEnter(tryOpcode, updating); - }; + 'use strict'; - VM.prototype.enterWithKey = function enterWithKey(key, ops) { - var updating = new _glimmerUtil.LinkedList(); - var tracker = this.stack().pushUpdatableBlock(); - var state = this.capture(); - var tryOpcode = new _glimmerRuntimeLibVmUpdate.TryOpcode(ops, state, tracker, updating); - this.listBlockStack.current.map[key] = tryOpcode; - this.didEnter(tryOpcode, updating); - }; + var EMPTY_ARRAY = Object.freeze([]); - VM.prototype.enterList = function enterList(ops) { - var updating = new _glimmerUtil.LinkedList(); - var tracker = this.stack().pushBlockList(updating); - var state = this.capture(); - var artifacts = this.frame.getIterator().artifacts; - var opcode = new _glimmerRuntimeLibVmUpdate.ListBlockOpcode(ops, state, tracker, updating, artifacts); - this.listBlockStack.push(opcode); - this.didEnter(opcode, updating); - }; + /** + @class ClassNamesSupport + @namespace Ember + @private + */ + exports.default = _emberMetal.Mixin.create({ + concatenatedProperties: ['classNames', 'classNameBindings'], - VM.prototype.didEnter = function didEnter(opcode, updating) { - this.updateWith(opcode); - this.updatingOpcodeStack.push(updating); - }; + init: function () { + this._super.apply(this, arguments); - VM.prototype.exit = function exit() { - this.stack().popBlock(); - this.updatingOpcodeStack.pop(); - var parent = this.updatingOpcodeStack.current.tail(); - parent.didInitializeChildren(); - }; + _emberMetal.assert('Only arrays are allowed for \'classNameBindings\'', Array.isArray(this.classNameBindings)); + _emberMetal.assert('Only arrays of static class strings are allowed for \'classNames\'. For dynamic classes, use \'classNameBindings\'.', Array.isArray(this.classNames)); + }, - VM.prototype.exitList = function exitList() { - this.exit(); - this.listBlockStack.pop(); - }; + /** + Standard CSS class names to apply to the view's outer element. This + property automatically inherits any class names defined by the view's + superclasses as well. + @property classNames + @type Array + @default ['ember-view'] + @public + */ + classNames: EMPTY_ARRAY, - VM.prototype.updateWith = function updateWith(opcode) { - this.updatingOpcodeStack.current.append(opcode); - }; + /** + A list of properties of the view to apply as class names. If the property + is a string value, the value of that string will be applied as a class + name. + ```javascript + // Applies the 'high' class to the view element + Ember.Component.extend({ + classNameBindings: ['priority'], + priority: 'high' + }); + ``` + If the value of the property is a Boolean, the name of that property is + added as a dasherized class name. + ```javascript + // Applies the 'is-urgent' class to the view element + Ember.Component.extend({ + classNameBindings: ['isUrgent'], + isUrgent: true + }); + ``` + If you would prefer to use a custom value instead of the dasherized + property name, you can pass a binding like this: + ```javascript + // Applies the 'urgent' class to the view element + Ember.Component.extend({ + classNameBindings: ['isUrgent:urgent'], + isUrgent: true + }); + ``` + This list of properties is inherited from the component's superclasses as well. + @property classNameBindings + @type Array + @default [] + @public + */ + classNameBindings: EMPTY_ARRAY + }); +}); +enifed('ember-views/mixins/text_support', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { + /** + @module ember + @submodule ember-views + */ - VM.prototype.stack = function stack() { - return this.elementStack; - }; + 'use strict'; - VM.prototype.scope = function scope() { - return this.scopeStack.current; - }; + var KEY_EVENTS = { + 13: 'insertNewline', + 27: 'cancel' + }; - VM.prototype.dynamicScope = function dynamicScope() { - return this.dynamicScopeStack.current; - }; + /** + `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 + value of the field passed in as the only argument unless the value of + the field is empty. In that case, the instance of the field itself is passed + in as the only argument. + + Let's use the pressing of the escape key as an example. If you wanted to + invoke a controller action when a user presses the escape key while on your + field, you would use the `escape-press` attribute on your field like so: + + ```handlebars + {{! application.hbs}} + + {{input escape-press='alertUser'}} + ``` + + ```javascript + App = Ember.Application.create(); + + App.ApplicationController = Ember.Controller.extend({ + actions: { + alertUser: function ( currentValue ) { + alert( 'escape pressed, current value: ' + currentValue ); + } + } + }); + ``` + + The following chart is a visual representation of what takes place when the + escape key is pressed in this scenario: + + ``` + The Template + +---------------------------+ + | | + | escape-press='alertUser' | + | | TextSupport Mixin + +----+----------------------+ +-------------------------------+ + | | cancel method | + | escape button pressed | | + +-------------------------------> | checks for the `escape-press` | + | attribute and pulls out the | + +-------------------------------+ | `alertUser` value | + | action name 'alertUser' +-------------------------------+ + | sent to controller + v + Controller + +------------------------------------------ + + | | + | actions: { | + | alertUser: function( currentValue ){ | + | alert( 'the esc key was pressed!' ) | + | } | + | } | + | | + +-------------------------------------------+ + ``` + + Here are the events that we currently support along with the name of the + attribute you would need to use on your field. To reiterate, you would use the + attribute name like so: + + ```handlebars + {{input attribute-name='controllerAction'}} + ``` + + ``` + +--------------------+----------------+ + | | | + | event | attribute name | + +--------------------+----------------+ + | new line inserted | insert-newline | + | | | + | enter key pressed | insert-newline | + | | | + | cancel key pressed | escape-press | + | | | + | focusin | focus-in | + | | | + | focusout | focus-out | + | | | + | keypress | key-press | + | | | + | keyup | key-up | + | | | + | keydown | key-down | + +--------------------+----------------+ + ``` + + @class TextSupport + @namespace Ember + @uses Ember.TargetActionSupport + @extends Ember.Mixin + @private + */ + exports.default = _emberMetal.Mixin.create(_emberRuntime.TargetActionSupport, { + value: '', - VM.prototype.pushFrame = function pushFrame(block, args, callerScope) { - this.frame.push(block.ops); - if (args) this.frame.setArgs(args); - if (args && args.blocks) this.frame.setBlocks(args.blocks); - if (callerScope) this.frame.setCallerScope(callerScope); - }; + attributeBindings: ['autocapitalize', 'autocorrect', 'autofocus', 'disabled', 'form', 'maxlength', 'placeholder', 'readonly', 'required', 'selectionDirection', 'spellcheck', 'tabindex', 'title'], + placeholder: null, + disabled: false, + maxlength: null, - VM.prototype.pushComponentFrame = function pushComponentFrame(layout, args, callerScope, component, manager, shadow) { - this.frame.push(layout.ops, component, manager, shadow); - if (args) this.frame.setArgs(args); - if (args && args.blocks) this.frame.setBlocks(args.blocks); - if (callerScope) this.frame.setCallerScope(callerScope); - }; + init: function () { + this._super.apply(this, arguments); + this.on('paste', this, this._elementValueDidChange); + this.on('cut', this, this._elementValueDidChange); + this.on('input', this, this._elementValueDidChange); + }, - VM.prototype.pushEvalFrame = function pushEvalFrame(ops) { - this.frame.push(ops); - }; + /** + The action to be sent when the user presses the return key. + This is similar to the `{{action}}` helper, but is fired when + the user presses the return key when editing a text field, and sends + the value of the field as the context. + @property action + @type String + @default null + @private + */ + action: null, - VM.prototype.pushChildScope = function pushChildScope() { - this.scopeStack.push(this.scopeStack.current.child()); - }; + /** + The event that should send the action. + Options are: + * `enter`: the user pressed enter + * `keyPress`: the user pressed a key + @property onEvent + @type String + @default enter + @private + */ + onEvent: 'enter', - VM.prototype.pushCallerScope = function pushCallerScope() { - this.scopeStack.push(this.scope().getCallerScope()); - }; + /** + Whether the `keyUp` event that triggers an `action` to be sent continues + propagating to other views. + By default, when the user presses the return key on their keyboard and + the text field has an `action` set, the action will be sent to the view's + controller and the key event will stop propagating. + If you would like parent views to receive the `keyUp` event even after an + action has been dispatched, set `bubbles` to true. + @property bubbles + @type Boolean + @default false + @private + */ + bubbles: false, - VM.prototype.pushDynamicScope = function pushDynamicScope() { - var child = this.dynamicScopeStack.current.child(); - this.dynamicScopeStack.push(child); - return child; - }; + interpretKeyEvents: function (event) { + var map = KEY_EVENTS; + var method = map[event.keyCode]; - VM.prototype.pushRootScope = function pushRootScope(self, size) { - var scope = _glimmerRuntimeLibEnvironment.Scope.root(self, size); - this.scopeStack.push(scope); - return scope; - }; + this._elementValueDidChange(); + if (method) { + return this[method](event); + } + }, - VM.prototype.popScope = function popScope() { - this.scopeStack.pop(); - }; + _elementValueDidChange: function () { + _emberMetal.set(this, 'value', this.element.value); + }, - VM.prototype.popDynamicScope = function popDynamicScope() { - this.dynamicScopeStack.pop(); - }; + change: function (event) { + this._elementValueDidChange(event); + }, - VM.prototype.newDestroyable = function newDestroyable(d) { - this.stack().newDestroyable(d); - }; + /** + Allows you to specify a controller action to invoke when either the `enter` + key is pressed or, in the case of the field being a textarea, when a newline + is inserted. To use this method, give your field an `insert-newline` + attribute. The value of that attribute should be the name of the action + in your controller that you wish to invoke. + For an example on how to use the `insert-newline` attribute, please + reference the example near the top of this file. + @method insertNewline + @param {Event} event + @private + */ + insertNewline: function (event) { + sendAction('enter', this, event); + sendAction('insert-newline', this, event); + }, - /// SCOPE HELPERS + /** + Allows you to specify a controller action to invoke when the escape button + is pressed. To use this method, give your field an `escape-press` + attribute. The value of that attribute should be the name of the action + in your controller that you wish to invoke. + For an example on how to use the `escape-press` attribute, please reference + the example near the top of this file. + @method cancel + @param {Event} event + @private + */ + cancel: function (event) { + sendAction('escape-press', this, event); + }, - VM.prototype.getSelf = function getSelf() { - return this.scope().getSelf(); - }; + /** + Allows you to specify a controller action to invoke when a field receives + focus. To use this method, give your field a `focus-in` attribute. The value + of that attribute should be the name of the action in your controller + that you wish to invoke. + For an example on how to use the `focus-in` attribute, please reference the + example near the top of this file. + @method focusIn + @param {Event} event + @private + */ + focusIn: function (event) { + sendAction('focus-in', this, event); + }, - VM.prototype.referenceForSymbol = function referenceForSymbol(symbol) { - return this.scope().getSymbol(symbol); - }; + /** + Allows you to specify a controller action to invoke when a field loses + focus. To use this method, give your field a `focus-out` attribute. The value + of that attribute should be the name of the action in your controller + that you wish to invoke. + For an example on how to use the `focus-out` attribute, please reference the + example near the top of this file. + @method focusOut + @param {Event} event + @private + */ + focusOut: function (event) { + this._elementValueDidChange(event); + sendAction('focus-out', this, event); + }, - VM.prototype.getArgs = function getArgs() { - return this.frame.getArgs(); - }; + /** + Allows you to specify a controller action to invoke when a key is pressed. + To use this method, give your field a `key-press` attribute. The value of + that attribute should be the name of the action in your controller you + that wish to invoke. + For an example on how to use the `key-press` attribute, please reference the + example near the top of this file. + @method keyPress + @param {Event} event + @private + */ + keyPress: function (event) { + sendAction('key-press', this, event); + }, - /// EXECUTION + /** + Allows you to specify a controller action to invoke when a key-up event is + fired. To use this method, give your field a `key-up` attribute. The value + of that attribute should be the name of the action in your controller + that you wish to invoke. + For an example on how to use the `key-up` attribute, please reference the + example near the top of this file. + @method keyUp + @param {Event} event + @private + */ + keyUp: function (event) { + this.interpretKeyEvents(event); - VM.prototype.resume = function resume(opcodes, frame) { - return this.execute(opcodes, function (vm) { - return vm.frame.restore(frame); - }); - }; + this.sendAction('key-up', _emberMetal.get(this, 'value'), event); + }, - VM.prototype.execute = function execute(opcodes, initialize) { - _glimmerUtil.LOGGER.debug("[VM] Begin program execution"); - var elementStack = this.elementStack; - var frame = this.frame; - var updatingOpcodeStack = this.updatingOpcodeStack; - var env = this.env; - - elementStack.pushSimpleBlock(); - updatingOpcodeStack.push(new _glimmerUtil.LinkedList()); - frame.push(opcodes); - if (initialize) initialize(this); - var opcode = undefined; - while (frame.hasOpcodes()) { - if (opcode = frame.nextStatement()) { - _glimmerUtil.LOGGER.debug('[VM] OP ' + opcode.type); - _glimmerUtil.LOGGER.trace(opcode); - opcode.evaluate(this); - } - } - _glimmerUtil.LOGGER.debug("[VM] Completed program execution"); - return new _glimmerRuntimeLibVmRenderResult.default(env, updatingOpcodeStack.pop(), elementStack.popBlock()); - }; + /** + Allows you to specify a controller action to invoke when a key-down event is + fired. To use this method, give your field a `key-down` attribute. The value + of that attribute should be the name of the action in your controller that + you wish to invoke. + For an example on how to use the `key-down` attribute, please reference the + example near the top of this file. + @method keyDown + @param {Event} event + @private + */ + keyDown: function (event) { + this.sendAction('key-down', _emberMetal.get(this, 'value'), event); + } + }); - VM.prototype.evaluateOpcode = function evaluateOpcode(opcode) { - opcode.evaluate(this); - }; + // In principle, this shouldn't be necessary, but the legacy + // sendAction semantics for TextField are different from + // the component semantics so this method normalizes them. + function sendAction(eventName, view, event) { + var action = _emberMetal.get(view, 'attrs.' + eventName) || _emberMetal.get(view, eventName); + var on = _emberMetal.get(view, 'onEvent'); + var value = _emberMetal.get(view, 'value'); - // Make sure you have opcodes that push and pop a scope around this opcode - // if you need to change the scope. + // back-compat support for keyPress as an event name even though + // it's also a method name that consumes the event (and therefore + // incompatible with sendAction semantics). + if (on === eventName || on === 'keyPress' && eventName === 'key-press') { + view.sendAction('action', value); + } - VM.prototype.invokeBlock = function invokeBlock(block, args) { - var compiled = block.compile(this.env); - this.pushFrame(compiled, args); - }; + view.sendAction(eventName, value); - VM.prototype.invokePartial = function invokePartial(block) { - var compiled = block.compile(this.env); - this.pushFrame(compiled); - }; + if (action || on === eventName) { + if (!_emberMetal.get(view, 'bubbles')) { + event.stopPropagation(); + } + } + } +}); +enifed('ember-views/mixins/view_state_support', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; - VM.prototype.invokeLayout = function invokeLayout(args, layout, callerScope, component, manager, shadow) { - this.pushComponentFrame(layout, args, callerScope, component, manager, shadow); - }; + exports.default = _emberMetal.Mixin.create({ + _transitionTo: function (state) { + var priorState = this._currentState; + var currentState = this._currentState = this._states[state]; + this._state = state; - VM.prototype.evaluateOperand = function evaluateOperand(expr) { - this.frame.setOperand(expr.evaluate(this)); - }; + if (priorState && priorState.exit) { + priorState.exit(this); + } + if (currentState.enter) { + currentState.enter(this); + } + } + }); +}); +enifed('ember-views/mixins/view_support', ['exports', 'ember-utils', 'ember-metal', 'ember-environment', 'ember-views/system/utils', 'ember-runtime/system/core_object', 'ember-views/system/jquery'], function (exports, _emberUtils, _emberMetal, _emberEnvironment, _emberViewsSystemUtils, _emberRuntimeSystemCore_object, _emberViewsSystemJquery) { + 'use strict'; - VM.prototype.evaluateArgs = function evaluateArgs(args) { - var evaledArgs = this.frame.setArgs(args.evaluate(this)); - this.frame.setOperand(evaledArgs.positional.at(0)); - }; + var _Mixin$create; - VM.prototype.bindPositionalArgs = function bindPositionalArgs(symbols) { - var args = this.frame.getArgs(); - _glimmerUtil.assert(args, "Cannot bind positional args"); - var positional = args.positional; + function K() { + return this; + } - var scope = this.scope(); - for (var i = 0; i < symbols.length; i++) { - scope.bindSymbol(symbols[i], positional.at(i)); - } - }; + var dispatchLifeCycleHook = function (component, hook, oldAttrs, newAttrs) { + component.trigger(hook, { attrs: newAttrs, oldAttrs: oldAttrs, newAttrs: newAttrs }); + }; - VM.prototype.bindNamedArgs = function bindNamedArgs(names, symbols) { - var args = this.frame.getArgs(); - var scope = this.scope(); - _glimmerUtil.assert(args, "Cannot bind named args"); - var named = args.named; + exports.dispatchLifeCycleHook = dispatchLifeCycleHook; + _emberMetal.runInDebug(function () { + var Attrs = (function () { + function Attrs(oldAttrs, newAttrs, message) { + babelHelpers.classCallCheck(this, Attrs); + + this._oldAttrs = oldAttrs; + this._newAttrs = newAttrs; + this._message = message; + } + + babelHelpers.createClass(Attrs, [{ + key: 'attrs', + get: function () { + return this.newAttrs; + } + }, { + key: 'oldAttrs', + get: function () { + _emberMetal.deprecate(this._message, false, { + id: 'ember-views.lifecycle-hook-arguments', + until: '2.13.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_arguments-in-component-lifecycle-hooks' + }); - for (var i = 0; i < names.length; i++) { - scope.bindSymbol(symbols[i], named.get(names[i])); - } - }; + return this._oldAttrs; + } + }, { + key: 'newAttrs', + get: function () { + _emberMetal.deprecate(this._message, false, { + id: 'ember-views.lifecycle-hook-arguments', + until: '2.13.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_arguments-in-component-lifecycle-hooks' + }); - VM.prototype.bindBlocks = function bindBlocks(names, symbols) { - var blocks = this.frame.getBlocks(); - var scope = this.scope(); - for (var i = 0; i < names.length; i++) { - scope.bindBlock(symbols[i], blocks && blocks[names[i]] || null); - } - }; + return this._newAttrs; + } + }]); + return Attrs; + })(); - VM.prototype.bindPartialArgs = function bindPartialArgs(symbol) { - var args = this.frame.getArgs(); - var scope = this.scope(); - _glimmerUtil.assert(args, "Cannot bind named args"); - scope.bindPartialArgs(symbol, args); - }; + exports.dispatchLifeCycleHook = dispatchLifeCycleHook = function (component, hook, oldAttrs, newAttrs) { + if (typeof component[hook] === 'function' && component[hook].length !== 0) { + // Already warned in init + component.trigger(hook, { attrs: newAttrs, oldAttrs: oldAttrs, newAttrs: newAttrs }); + } else { + component.trigger(hook, new Attrs(oldAttrs, newAttrs, '[DEPRECATED] Ember will stop passing arguments to component lifecycle hooks. Please change `' + component.toString() + '#' + hook + '` to stop taking arguments.')); + } + }; + }); - VM.prototype.bindCallerScope = function bindCallerScope() { - var callerScope = this.frame.getCallerScope(); - var scope = this.scope(); - _glimmerUtil.assert(callerScope, "Cannot bind caller scope"); - scope.bindCallerScope(callerScope); - }; + /** + @class ViewMixin + @namespace Ember + @private + */ + exports.default = _emberMetal.Mixin.create((_Mixin$create = { + concatenatedProperties: ['attributeBindings'] + }, _Mixin$create[_emberRuntimeSystemCore_object.POST_INIT] = function () { + dispatchLifeCycleHook(this, 'didInitAttrs', undefined, this.attrs); + dispatchLifeCycleHook(this, 'didReceiveAttrs', undefined, this.attrs); + }, _Mixin$create.nearestOfType = function (klass) { + var view = this.parentView; + var isOfType = klass instanceof _emberMetal.Mixin ? function (view) { + return klass.detect(view); + } : function (view) { + return klass.detect(view.constructor); + }; - VM.prototype.bindDynamicScope = function bindDynamicScope(names) { - var args = this.frame.getArgs(); - var scope = this.dynamicScope(); - _glimmerUtil.assert(args, "Cannot bind dynamic scope"); - for (var i = 0; i < names.length; i++) { - scope.set(names[i], args.named.get(names[i])); - } - }; + while (view) { + if (isOfType(view)) { + return view; + } + view = view.parentView; + } + }, _Mixin$create.nearestWithProperty = function (property) { + var view = this.parentView; - return VM; - })(); + while (view) { + if (property in view) { + return view; + } + view = view.parentView; + } + }, _Mixin$create.rerender = function () { + return this._currentState.rerender(this); + }, _Mixin$create.element = _emberMetal.descriptor({ + configurable: false, + enumerable: false, + get: function () { + return this.renderer.getElement(this); + } + }), _Mixin$create.$ = function (sel) { + _emberMetal.assert('You cannot access this.$() on a component with `tagName: \'\'` specified.', this.tagName !== ''); + if (this.element) { + return sel ? _emberViewsSystemJquery.default(sel, this.element) : _emberViewsSystemJquery.default(this.element); + } + }, _Mixin$create.appendTo = function (selector) { + var env = this._environment || _emberEnvironment.environment; + var target = undefined; - exports.default = VM; -}); + if (env.hasDOM) { + target = typeof selector === 'string' ? document.querySelector(selector) : selector; -enifed('glimmer-runtime/lib/vm/frame', ['exports'], function (exports) { - 'use strict'; + _emberMetal.assert('You tried to append to (' + selector + ') but that isn\'t in the DOM', target); + _emberMetal.assert('You cannot append to an existing Ember.View.', !_emberViewsSystemUtils.matches(target, '.ember-view')); + _emberMetal.assert('You cannot append to an existing Ember.View.', (function () { + var node = target.parentNode; + while (node) { + if (node.nodeType !== 9 && _emberViewsSystemUtils.matches(node, '.ember-view')) { + return false; + } - var CapturedFrame = function CapturedFrame(operand, args, condition) { - this.operand = operand; - this.args = args; - this.condition = condition; - }; - - exports.CapturedFrame = CapturedFrame; - - var Frame = (function () { - function Frame(ops) { - var component = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; - var manager = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; - var shadow = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3]; - - this.component = component; - this.manager = manager; - this.shadow = shadow; - this.operand = null; - this.immediate = null; - this.args = null; - this.callerScope = null; - this.blocks = null; - this.condition = null; - this.iterator = null; - this.key = null; - this.ops = ops; - this.op = ops.head(); + node = node.parentNode; } - Frame.prototype.capture = function capture() { - return new CapturedFrame(this.operand, this.args, this.condition); - }; - - Frame.prototype.restore = function restore(frame) { - this.operand = frame['operand']; - this.args = frame['args']; - this.condition = frame['condition']; - }; - - return Frame; - })(); + return true; + })()); + } else { + target = selector; - var FrameStack = (function () { - function FrameStack() { - this.frames = []; - this.frame = undefined; - } + _emberMetal.assert('You tried to append to a selector string (' + selector + ') in an environment without jQuery', typeof target !== 'string'); + _emberMetal.assert('You tried to append to a non-Element (' + selector + ') in an environment without jQuery', typeof selector.appendChild === 'function'); + } - FrameStack.prototype.push = function push(ops) { - var component = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; - var manager = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; - var shadow = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3]; + this.renderer.appendTo(this, target); - var frame = this.frame === undefined ? this.frame = 0 : ++this.frame; - if (this.frames.length <= frame) { - this.frames.push(null); - } - this.frames[frame] = new Frame(ops, component, manager, shadow); - }; + return this; + }, _Mixin$create.renderToElement = function () { + var tagName = arguments.length <= 0 || arguments[0] === undefined ? 'body' : arguments[0]; - FrameStack.prototype.pop = function pop() { - var frames = this.frames; - var frame = this.frame; + _emberMetal.deprecate('Using the `renderToElement` is deprecated in favor of `appendTo`. Called in ' + this.toString(), false, { + id: 'ember-views.render-to-element', + until: '2.12.0', + url: 'http://emberjs.com/deprecations/v2.x#toc_code-rendertoelement-code' + }); - frames[frame] = null; - this.frame = frame === 0 ? undefined : frame - 1; - }; + var element = this.renderer.createElement(tagName); - FrameStack.prototype.capture = function capture() { - return this.frames[this.frame].capture(); - }; + this.renderer.appendTo(this, element); + return element; + }, _Mixin$create.replaceIn = function (selector) { + var target = _emberViewsSystemJquery.default(selector); - FrameStack.prototype.restore = function restore(frame) { - this.frames[this.frame].restore(frame); - }; + _emberMetal.assert('You tried to replace in (' + selector + ') but that isn\'t in the DOM', target.length > 0); + _emberMetal.assert('You cannot replace an existing Ember.View.', !target.is('.ember-view') && !target.parents().is('.ember-view')); - FrameStack.prototype.getOps = function getOps() { - return this.frames[this.frame].ops; - }; + this.renderer.replaceIn(this, target[0]); - FrameStack.prototype.getCurrent = function getCurrent() { - return this.frames[this.frame].op; - }; + return this; + }, _Mixin$create.append = function () { + return this.appendTo(document.body); + }, _Mixin$create.elementId = null, _Mixin$create.findElementInParentElement = function (parentElem) { + var id = '#' + this.elementId; + return _emberViewsSystemJquery.default(id)[0] || _emberViewsSystemJquery.default(id, parentElem)[0]; + }, _Mixin$create.willInsertElement = K, _Mixin$create.didInsertElement = K, _Mixin$create.willClearRender = K, _Mixin$create.destroy = function () { + this._super.apply(this, arguments); + this._currentState.destroy(this); + }, _Mixin$create.willDestroyElement = K, _Mixin$create.parentViewDidChange = K, _Mixin$create.tagName = null, _Mixin$create.init = function () { + this._super.apply(this, arguments); - FrameStack.prototype.setCurrent = function setCurrent(op) { - return this.frames[this.frame].op = op; - }; + if (!this.elementId && this.tagName !== '') { + this.elementId = _emberUtils.guidFor(this); + } - FrameStack.prototype.getOperand = function getOperand() { - return this.frames[this.frame].operand; - }; + // if we find an `eventManager` property, deopt the + // `EventDispatcher`'s `canDispatchToEventManager` property + // if `null` + if (this.eventManager) { + var owner = _emberUtils.getOwner(this); + var dispatcher = owner && owner.lookup('event_dispatcher:main'); - FrameStack.prototype.setOperand = function setOperand(operand) { - return this.frames[this.frame].operand = operand; - }; + if (dispatcher && dispatcher.canDispatchToEventManager === null) { + dispatcher.canDispatchToEventManager = true; + } + } - FrameStack.prototype.getImmediate = function getImmediate() { - return this.frames[this.frame].immediate; - }; + _emberMetal.deprecate('[DEPRECATED] didInitAttrs called in ' + this.toString() + '.', typeof this.didInitAttrs !== 'function', { + id: 'ember-views.did-init-attrs', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x#toc_ember-component-didinitattrs' + }); - FrameStack.prototype.setImmediate = function setImmediate(value) { - return this.frames[this.frame].immediate = value; - }; + _emberMetal.deprecate('[DEPRECATED] Ember will stop passing arguments to component lifecycle hooks. Please change `' + this.toString() + '#didInitAttrs` to stop taking arguments.', typeof this.didInitAttrs !== 'function' || this.didInitAttrs.length === 0, { + id: 'ember-views.lifecycle-hook-arguments', + until: '2.13.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_arguments-in-component-lifecycle-hooks' + }); - FrameStack.prototype.getArgs = function getArgs() { - return this.frames[this.frame].args; - }; + _emberMetal.deprecate('[DEPRECATED] Ember will stop passing arguments to component lifecycle hooks. Please change `' + this.toString() + '#didReceiveAttrs` to stop taking arguments.', typeof this.didReceiveAttrs !== 'function' || this.didReceiveAttrs.length === 0, { + id: 'ember-views.lifecycle-hook-arguments', + until: '2.13.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_arguments-in-component-lifecycle-hooks' + }); - FrameStack.prototype.setArgs = function setArgs(args) { - var frame = this.frames[this.frame]; - return frame.args = args; - }; + _emberMetal.deprecate('[DEPRECATED] Ember will stop passing arguments to component lifecycle hooks. Please change `' + this.toString() + '#didUpdateAttrs` to stop taking arguments.', typeof this.didUpdateAttrs !== 'function' || this.didUpdateAttrs.length === 0, { + id: 'ember-views.lifecycle-hook-arguments', + until: '2.13.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_arguments-in-component-lifecycle-hooks' + }); - FrameStack.prototype.getCondition = function getCondition() { - return this.frames[this.frame].condition; - }; + _emberMetal.assert('Using a custom `.render` function is no longer supported.', !this.render); + }, _Mixin$create.__defineNonEnumerable = function (property) { + this[property.name] = property.descriptor.value; + }, _Mixin$create.handleEvent = function (eventName, evt) { + return this._currentState.handleEvent(this, eventName, evt); + }, _Mixin$create)); +}); - FrameStack.prototype.setCondition = function setCondition(condition) { - return this.frames[this.frame].condition = condition; - }; +// .......................................................... +// TEMPLATE SUPPORT +// - FrameStack.prototype.getIterator = function getIterator() { - return this.frames[this.frame].iterator; - }; +/** + Return the nearest ancestor that is an instance of the provided + class or mixin. + @method nearestOfType + @param {Class,Mixin} klass Subclass of Ember.View (or Ember.View itself), + or an instance of Ember.Mixin. + @return Ember.View + @deprecated use `yield` and contextual components for composition instead. + @private +*/ - FrameStack.prototype.setIterator = function setIterator(iterator) { - return this.frames[this.frame].iterator = iterator; - }; +/** + Return the nearest ancestor that has a given property. + @method nearestWithProperty + @param {String} property A property name + @return Ember.View + @deprecated use `yield` and contextual components for composition instead. + @private +*/ - FrameStack.prototype.getKey = function getKey() { - return this.frames[this.frame].key; - }; +/** + Renders the view again. This will work regardless of whether the + view is already in the DOM or not. If the view is in the DOM, the + rendering process will be deferred to give bindings a chance + to synchronize. + If children were added during the rendering process using `appendChild`, + `rerender` will remove them, because they will be added again + if needed by the next `render`. + In general, if the display of your view changes, you should modify + the DOM element directly instead of manually calling `rerender`, which can + be slow. + @method rerender + @public +*/ - FrameStack.prototype.setKey = function setKey(key) { - return this.frames[this.frame].key = key; - }; +// .......................................................... +// ELEMENT SUPPORT +// - FrameStack.prototype.getBlocks = function getBlocks() { - return this.frames[this.frame].blocks; - }; +/** + Returns the current DOM element for the view. + @property element + @type DOMElement + @public +*/ - FrameStack.prototype.setBlocks = function setBlocks(blocks) { - return this.frames[this.frame].blocks = blocks; - }; +/** + Returns a jQuery object for this view's element. If you pass in a selector + string, this method will return a jQuery object, using the current element + as its buffer. + For example, calling `view.$('li')` will return a jQuery object containing + all of the `li` elements inside the DOM element of this view. + @method $ + @param {String} [selector] a jQuery-compatible selector string + @return {jQuery} the jQuery object for the DOM node + @public +*/ - FrameStack.prototype.getCallerScope = function getCallerScope() { - return this.frames[this.frame].callerScope; - }; +/** + Appends the view's element to the specified parent element. + Note that this method just schedules the view to be appended; the DOM + element will not be appended to the given element until all bindings have + finished synchronizing. + This is not typically a function that you will need to call directly when + building your application. If you do need to use `appendTo`, be sure that + the target element you are providing is associated with an `Ember.Application` + and does not have an ancestor element that is associated with an Ember view. + @method appendTo + @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object + @return {Ember.View} receiver + @private +*/ - FrameStack.prototype.setCallerScope = function setCallerScope(callerScope) { - return this.frames[this.frame].callerScope = callerScope; - }; +/** + 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 + let element = view.renderToElement(); + element.tagName; // => "BODY" + ``` + You can override the kind of element rendered into and returned by + specifying an optional tag name as the first argument. + ```js + let element = view.renderToElement('table'); + element.tagName; // => "TABLE" + ``` + This method is useful if you want to render the view into an element that + is not in the document's body. Instead, a new `body` element, detached from + the DOM is returned. FastBoot uses this to serialize the rendered view into + a string for transmission over the network. + ```js + app.visit('/').then(function(instance) { + let element; + Ember.run(function() { + element = renderToElement(instance); + }); + res.send(serialize(element)); + }); + ``` + @method renderToElement + @param {String} tagName The tag of the element to create and render into. Defaults to "body". + @return {HTMLBodyElement} element + @deprecated Use appendTo instead. + @private +*/ - FrameStack.prototype.getComponent = function getComponent() { - return this.frames[this.frame].component; - }; +/** + Replaces the content of the specified parent element with this view's + element. If the view does not have an HTML representation yet, + the element will be generated automatically. + Note that this method just schedules the view to be appended; the DOM + element will not be appended to the given element until all bindings have + finished synchronizing + @method replaceIn + @param {String|DOMElement|jQuery} target A selector, element, HTML string, or jQuery object + @return {Ember.View} received + @private +*/ - FrameStack.prototype.getManager = function getManager() { - return this.frames[this.frame].manager; - }; +/** + Appends the view's element to the document body. If the view does + not have an HTML representation yet + the element will be generated automatically. + If your application uses the `rootElement` property, you must append + the view within that element. Rendering views outside of the `rootElement` + is not supported. + Note that this method just schedules the view to be appended; the DOM + element will not be appended to the document body until all bindings have + finished synchronizing. + @method append + @return {Ember.View} receiver + @private +*/ - FrameStack.prototype.getShadow = function getShadow() { - return this.frames[this.frame].shadow; - }; +/** + The HTML `id` of the view's element in the DOM. You can provide this + value yourself but it must be unique (just as in HTML): + ```handlebars + {{my-component elementId="a-really-cool-id"}} + ``` + If not manually set a default value will be provided by the framework. + Once rendered an element's `elementId` is considered immutable and you + should never change it. If you need to compute a dynamic value for the + `elementId`, you should do this when the component or element is being + instantiated: + ```javascript + export default Ember.Component.extend({ + init() { + this._super(...arguments); + let index = this.get('index'); + this.set('elementId', 'component-id' + index); + } + }); + ``` + @property elementId + @type String + @public +*/ - FrameStack.prototype.goto = function goto(op) { - this.setCurrent(op); - }; +/** + Attempts to discover the element in the parent element. The default + implementation looks for an element with an ID of `elementId` (or the + view's guid if `elementId` is null). You can override this method to + provide your own form of lookup. For example, if you want to discover your + element using a CSS class name instead of an ID. + @method findElementInParentElement + @param {DOMElement} parentElement The parent's DOM element + @return {DOMElement} The discovered element + @private +*/ - FrameStack.prototype.hasOpcodes = function hasOpcodes() { - return this.frame !== undefined; - }; +/** + Called when a view is going to insert an element into the DOM. + @event willInsertElement + @public +*/ - FrameStack.prototype.nextStatement = function nextStatement() { - var op = this.frames[this.frame].op; - var ops = this.getOps(); - if (op) { - this.setCurrent(ops.nextNode(op)); - return op; - } else { - this.pop(); - return null; - } - }; +/** + Called when the element of the view has been inserted into the DOM. + Override this function to do any set up that requires an element + in the document body. + When a view has children, didInsertElement will be called on the + child view(s) first and on itself afterwards. + @event didInsertElement + @public +*/ - return FrameStack; - })(); +/** + Called when the view is about to rerender, but before anything has + been torn down. This is a good opportunity to tear down any manual + observers you have installed based on the DOM state + @event willClearRender + @public +*/ - exports.FrameStack = FrameStack; -}); +/** + You must call `destroy` on a view to destroy the view (and all of its + child views). This will remove the view from any parent node, then make + sure that the DOM element managed by the view can be released by the + memory manager. + @method destroy + @private +*/ -enifed('glimmer-runtime/lib/vm/render-result', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/vm/update'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibVmUpdate) { - 'use strict'; +/** + Called when the element of the view is going to be destroyed. Override + this function to do any teardown that requires an element, like removing + event listeners. + Please note: any property changes made during this event will have no + effect on object observers. + @event willDestroyElement + @public +*/ - var RenderResult = (function () { - function RenderResult(env, updating, bounds) { - this.env = env; - this.updating = updating; - this.bounds = bounds; - } +/** + Called when the parentView property has changed. + @event parentViewDidChange + @private +*/ - RenderResult.prototype.rerender = function rerender() { - var _ref = arguments.length <= 0 || arguments[0] === undefined ? { alwaysRevalidate: false } : arguments[0]; +// .......................................................... +// STANDARD RENDER PROPERTIES +// - var _ref$alwaysRevalidate = _ref.alwaysRevalidate; - var alwaysRevalidate = _ref$alwaysRevalidate === undefined ? false : _ref$alwaysRevalidate; - var env = this.env; - var updating = this.updating; +/** + Tag name for the view's outer element. The tag name is only used when an + element is first created. If you change the `tagName` for an element, you + must destroy and recreate the view element. + By default, the render buffer will use a `
    ` tag for views. + @property tagName + @type String + @default null + @public +*/ - var vm = new _glimmerRuntimeLibVmUpdate.default(env, { alwaysRevalidate: alwaysRevalidate }); - vm.execute(updating, this); - }; +// We leave this null by default so we can tell the difference between +// the default case and a user-specified tag. - RenderResult.prototype.parentElement = function parentElement() { - return this.bounds.parentElement(); - }; +// ....................................................... +// CORE DISPLAY METHODS +// - RenderResult.prototype.firstNode = function firstNode() { - return this.bounds.firstNode(); - }; +/** + Setup a view, but do not finish waking it up. + * configure `childViews` + * register the view with the global views hash, which is used for event + dispatch + @method init + @private +*/ - RenderResult.prototype.lastNode = function lastNode() { - return this.bounds.lastNode(); - }; +// ....................................................... +// EVENT HANDLING +// - RenderResult.prototype.opcodes = function opcodes() { - return this.updating; - }; +/** + Handle events from `Ember.EventDispatcher` + @method handleEvent + @param eventName {String} + @param evt {Event} + @private +*/ +enifed("ember-views/system/action_manager", ["exports"], function (exports) { + /** + @module ember + @submodule ember-views + */ - RenderResult.prototype.handleException = function handleException() { - throw "this should never happen"; - }; + "use strict"; - RenderResult.prototype.destroy = function destroy() { - this.bounds.destroy(); - _glimmerRuntimeLibBounds.clear(this.bounds); - }; + exports.default = ActionManager; - return RenderResult; - })(); + function ActionManager() {} - exports.default = RenderResult; + /** + Global action id hash. + + @private + @property registeredActions + @type Object + */ + ActionManager.registeredActions = {}; }); +enifed('ember-views/system/event_dispatcher', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-views/system/jquery', 'ember-views/system/action_manager', 'ember-environment', 'ember-views/compat/fallback-view-registry'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberViewsSystemJquery, _emberViewsSystemAction_manager, _emberEnvironment, _emberViewsCompatFallbackViewRegistry) { + /** + @module ember + @submodule ember-views + */ -enifed('glimmer-runtime/lib/vm/update', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/builder', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/vm/append'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibBuilder, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibVmAppend) { - 'use strict'; + 'use strict'; - var UpdatingVM = (function () { - function UpdatingVM(env, _ref) { - var _ref$alwaysRevalidate = _ref.alwaysRevalidate; - var alwaysRevalidate = _ref$alwaysRevalidate === undefined ? false : _ref$alwaysRevalidate; + var ROOT_ELEMENT_CLASS = 'ember-application'; + var ROOT_ELEMENT_SELECTOR = '.' + ROOT_ELEMENT_CLASS; - this.frameStack = new _glimmerUtil.Stack(); - this.env = env; - this.dom = env.getDOM(); - this.alwaysRevalidate = alwaysRevalidate; - } + /** + `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 + called. + + @class EventDispatcher + @namespace Ember + @private + @extends Ember.Object + */ + exports.default = _emberRuntime.Object.extend({ - UpdatingVM.prototype.execute = function execute(opcodes, handler) { - var frameStack = this.frameStack; + /** + The set of events names (and associated handler function names) to be setup + and dispatched by the `EventDispatcher`. Modifications to this list can be done + at setup time, generally via the `Ember.Application.customEvents` hash. + To add new events to be listened to: + ```javascript + let App = Ember.Application.create({ + customEvents: { + paste: 'paste' + } + }); + ``` + To prevent default events from being listened to: + ```javascript + let App = Ember.Application.create({ + customEvents: { + mouseenter: null, + mouseleave: null + } + }); + ``` + @property events + @type Object + @private + */ + events: { + touchstart: 'touchStart', + touchmove: 'touchMove', + touchend: 'touchEnd', + touchcancel: 'touchCancel', + keydown: 'keyDown', + keyup: 'keyUp', + keypress: 'keyPress', + mousedown: 'mouseDown', + mouseup: 'mouseUp', + contextmenu: 'contextMenu', + click: 'click', + dblclick: 'doubleClick', + mousemove: 'mouseMove', + focusin: 'focusIn', + focusout: 'focusOut', + mouseenter: 'mouseEnter', + mouseleave: 'mouseLeave', + submit: 'submit', + input: 'input', + change: 'change', + dragstart: 'dragStart', + drag: 'drag', + dragenter: 'dragEnter', + dragleave: 'dragLeave', + dragover: 'dragOver', + drop: 'drop', + dragend: 'dragEnd' + }, - this.try(opcodes, handler); - while (true) { - if (frameStack.isEmpty()) break; - var opcode = this.frameStack.current.nextStatement(); - if (opcode === null) { - this.frameStack.pop(); - continue; - } - _glimmerUtil.LOGGER.debug('[VM] OP ' + opcode.type); - _glimmerUtil.LOGGER.trace(opcode); - opcode.evaluate(this); - } - }; + /** + The root DOM element to which event listeners should be attached. Event + listeners will be attached to the document unless this is overridden. + Can be specified as a DOMElement or a selector string. + The default body is a string since this may be evaluated before document.body + exists in the DOM. + @private + @property rootElement + @type DOMElement + @default 'body' + */ + rootElement: 'body', - UpdatingVM.prototype.goto = function goto(op) { - this.frameStack.current.goto(op); - }; + /** + It enables events to be dispatched to the view's `eventManager.` When present, + this object takes precedence over handling of events on the view itself. + Note that most Ember applications do not use this feature. If your app also + does not use it, consider setting this property to false to gain some performance + improvement by allowing the EventDispatcher to skip the search for the + `eventManager` on the view tree. + ```javascript + let EventDispatcher = Em.EventDispatcher.extend({ + events: { + click : 'click', + focusin : 'focusIn', + focusout : 'focusOut', + change : 'change' + }, + canDispatchToEventManager: false + }); + container.register('event_dispatcher:main', EventDispatcher); + ``` + @property canDispatchToEventManager + @type boolean + @default false + @since 1.7.0 + @private + */ + canDispatchToEventManager: null, - UpdatingVM.prototype.try = function _try(ops, handler) { - this.frameStack.push(new UpdatingVMFrame(this, ops, handler)); - }; + init: function () { + this._super(); + _emberMetal.assert('EventDispatcher should never be instantiated in fastboot mode. Please report this as an Ember bug.', _emberEnvironment.environment.hasDOM); + }, - UpdatingVM.prototype.throw = function _throw() { - this.frameStack.current.handleException(); - this.frameStack.pop(); - }; + /** + Sets up event listeners for standard browser events. + This will be called after the browser sends a `DOMContentReady` event. By + default, it will set up all of the listeners on the document body. If you + would like to register the listeners on a different element, set the event + dispatcher's `root` property. + @private + @method setup + @param addedEvents {Object} + */ + setup: function (addedEvents, rootElement) { + var event = undefined; + var events = this._finalEvents = _emberUtils.assign({}, _emberMetal.get(this, 'events'), addedEvents); - UpdatingVM.prototype.evaluateOpcode = function evaluateOpcode(opcode) { - opcode.evaluate(this); - }; + if (_emberMetal.isNone(rootElement)) { + rootElement = _emberMetal.get(this, 'rootElement'); + } else { + _emberMetal.set(this, 'rootElement', rootElement); + } - return UpdatingVM; - })(); + rootElement = _emberViewsSystemJquery.default(rootElement); - exports.default = UpdatingVM; + _emberMetal.assert('You cannot use the same root element (' + (rootElement.selector || rootElement[0].tagName) + ') multiple times in an Ember.Application', !rootElement.is(ROOT_ELEMENT_SELECTOR)); + _emberMetal.assert('You cannot make a new Ember.Application using a root element that is a descendent of an existing Ember.Application', !rootElement.closest(ROOT_ELEMENT_SELECTOR).length); + _emberMetal.assert('You cannot make a new Ember.Application using a root element that is an ancestor of an existing Ember.Application', !rootElement.find(ROOT_ELEMENT_SELECTOR).length); - var BlockOpcode = (function (_UpdatingOpcode) { - babelHelpers.inherits(BlockOpcode, _UpdatingOpcode); + rootElement.addClass(ROOT_ELEMENT_CLASS); - function BlockOpcode(ops, state, bounds, children) { - _UpdatingOpcode.call(this); - this.type = "block"; - this.next = null; - this.prev = null; - var env = state.env; - var scope = state.scope; - var dynamicScope = state.dynamicScope; - var frame = state.frame; + if (!rootElement.is(ROOT_ELEMENT_SELECTOR)) { + throw new TypeError('Unable to add \'' + ROOT_ELEMENT_CLASS + '\' class to root element (' + (rootElement.selector || rootElement[0].tagName) + '). Make sure you set rootElement to the body or an element in the body.'); + } - this.ops = ops; - this.children = children; - this.env = env; - this.scope = scope; - this.dynamicScope = dynamicScope; - this.frame = frame; - this.bounds = bounds; + for (event in events) { + if (events.hasOwnProperty(event)) { + this.setupHandler(rootElement, event, events[event]); } + } + }, - BlockOpcode.prototype.parentElement = function parentElement() { - return this.bounds.parentElement(); - }; + /** + Registers an event listener on the rootElement. If the given event is + triggered, the provided event handler will be triggered on the target view. + If the target view does not implement the event handler, or if the handler + returns `false`, the parent view will be called. The event will continue to + bubble to each successive parent view until it reaches the top. + @private + @method setupHandler + @param {Element} rootElement + @param {String} event the browser-originated event to listen to + @param {String} eventName the name of the method to call on the view + */ + setupHandler: function (rootElement, event, eventName) { + var self = this; - BlockOpcode.prototype.firstNode = function firstNode() { - return this.bounds.firstNode(); - }; + var owner = _emberUtils.getOwner(this); + var viewRegistry = owner && owner.lookup('-view-registry:main') || _emberViewsCompatFallbackViewRegistry.default; - BlockOpcode.prototype.lastNode = function lastNode() { - return this.bounds.lastNode(); - }; + if (eventName === null) { + return; + } - BlockOpcode.prototype.evaluate = function evaluate(vm) { - vm.try(this.children, null); - }; + rootElement.on(event + '.ember', '.ember-view', function (evt, triggeringManager) { + var view = viewRegistry[this.id]; + var result = true; - BlockOpcode.prototype.destroy = function destroy() { - this.bounds.destroy(); - }; + var manager = self.canDispatchToEventManager ? self._findNearestEventManager(view, eventName) : null; - BlockOpcode.prototype.didDestroy = function didDestroy() { - this.env.didDestroy(this.bounds); - }; + if (manager && manager !== triggeringManager) { + result = self._dispatchEvent(manager, evt, eventName, view); + } else if (view) { + result = self._bubbleEvent(view, evt, eventName); + } - BlockOpcode.prototype.toJSON = function toJSON() { - var begin = this.ops.head(); - var end = this.ops.tail(); - var details = _glimmerUtil.dict(); - details["guid"] = '' + this._guid; - details["begin"] = begin.inspect(); - details["end"] = end.inspect(); - return { - guid: this._guid, - type: this.type, - details: details, - children: this.children.toArray().map(function (op) { - return op.toJSON(); - }) - }; - }; + return result; + }); - return BlockOpcode; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + rootElement.on(event + '.ember', '[data-ember-action]', function (evt) { + var attributes = evt.currentTarget.attributes; - exports.BlockOpcode = BlockOpcode; + for (var i = 0; i < attributes.length; i++) { + var attr = attributes.item(i); + var attrName = attr.name; - var TryOpcode = (function (_BlockOpcode) { - babelHelpers.inherits(TryOpcode, _BlockOpcode); + if (attrName.lastIndexOf('data-ember-action-', 0) !== -1) { + var action = _emberViewsSystemAction_manager.default.registeredActions[attr.value]; - function TryOpcode(ops, state, bounds, children) { - _BlockOpcode.call(this, ops, state, bounds, children); - this.type = "try"; - this.tag = this._tag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); + if (action.eventName === eventName) { + action.handler(evt); + } + } } + }); + }, - TryOpcode.prototype.didInitializeChildren = function didInitializeChildren() { - this._tag.update(_glimmerReference.combineSlice(this.children)); - }; + _findNearestEventManager: function (view, eventName) { + var manager = null; - TryOpcode.prototype.evaluate = function evaluate(vm) { - vm.try(this.children, this); - }; + while (view) { + manager = _emberMetal.get(view, 'eventManager'); + if (manager && manager[eventName]) { + break; + } - TryOpcode.prototype.handleException = function handleException() { - var env = this.env; - var scope = this.scope; - var ops = this.ops; - var dynamicScope = this.dynamicScope; - var frame = this.frame; - - var elementStack = _glimmerRuntimeLibBuilder.ElementStack.resume(this.env, this.bounds, this.bounds.reset(env)); - var vm = new _glimmerRuntimeLibVmAppend.default(env, scope, dynamicScope, elementStack); - var result = vm.resume(ops, frame); - this.children = result.opcodes(); - this.didInitializeChildren(); - }; + view = _emberMetal.get(view, 'parentView'); + } - TryOpcode.prototype.toJSON = function toJSON() { - var json = _BlockOpcode.prototype.toJSON.call(this); - var begin = this.ops.head(); - var end = this.ops.tail(); - json["details"]["begin"] = JSON.stringify(begin.inspect()); - json["details"]["end"] = JSON.stringify(end.inspect()); - return _BlockOpcode.prototype.toJSON.call(this); - }; + return manager; + }, - return TryOpcode; - })(BlockOpcode); + _dispatchEvent: function (object, evt, eventName, view) { + var result = true; - exports.TryOpcode = TryOpcode; + var handler = object[eventName]; + if (typeof handler === 'function') { + result = _emberMetal.run(object, handler, evt, view); + // Do not preventDefault in eventManagers. + evt.stopPropagation(); + } else { + result = this._bubbleEvent(view, evt, eventName); + } - var ListRevalidationDelegate = (function () { - function ListRevalidationDelegate(opcode, marker) { - this.opcode = opcode; - this.marker = marker; - this.didInsert = false; - this.didDelete = false; - this.map = opcode.map; - this.updating = opcode['children']; - } + return result; + }, - ListRevalidationDelegate.prototype.insert = function insert(key, item, memo, before) { - var map = this.map; - var opcode = this.opcode; - var updating = this.updating; + _bubbleEvent: function (view, evt, eventName) { + return view.handleEvent(eventName, evt); + }, - var nextSibling = null; - var reference = null; - if (before) { - reference = map[before]; - nextSibling = reference.bounds.firstNode(); - } else { - nextSibling = this.marker; - } - var vm = opcode.vmForInsertion(nextSibling); - var tryOpcode = undefined; - vm.execute(opcode.ops, function (vm) { - vm.frame.setArgs(_glimmerRuntimeLibCompiledExpressionsArgs.EvaluatedArgs.positional([item, memo])); - vm.frame.setOperand(item); - vm.frame.setCondition(new _glimmerReference.ConstReference(true)); - vm.frame.setKey(key); - var state = vm.capture(); - var tracker = vm.stack().pushUpdatableBlock(); - tryOpcode = new TryOpcode(opcode.ops, state, tracker, vm.updatingOpcodeStack.current); - }); - tryOpcode.didInitializeChildren(); - updating.insertBefore(tryOpcode, reference); - map[key] = tryOpcode; - this.didInsert = true; - }; + destroy: function () { + var rootElement = _emberMetal.get(this, 'rootElement'); + _emberViewsSystemJquery.default(rootElement).off('.ember', '**').removeClass(ROOT_ELEMENT_CLASS); + return this._super.apply(this, arguments); + }, - ListRevalidationDelegate.prototype.retain = function retain(key, item, memo) {}; + toString: function () { + return '(EventDispatcher)'; + } + }); +}); +enifed('ember-views/system/ext', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-views + */ - ListRevalidationDelegate.prototype.move = function move(key, item, memo, before) { - var map = this.map; - var updating = this.updating; + 'use strict'; - var entry = map[key]; - var reference = map[before] || null; - if (before) { - _glimmerRuntimeLibBounds.move(entry, reference.firstNode()); - } else { - _glimmerRuntimeLibBounds.move(entry, this.marker); - } - updating.remove(entry); - updating.insertBefore(entry, reference); - }; + // Add a new named queue for rendering views that happens + // after bindings have synced, and a queue for scheduling actions + // that should occur after view rendering. + _emberMetal.run._addQueue('render', 'actions'); + _emberMetal.run._addQueue('afterRender', 'render'); +}); +enifed('ember-views/system/jquery', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { + 'use strict'; - ListRevalidationDelegate.prototype.delete = function _delete(key) { - var map = this.map; + var jQuery = undefined; - var opcode = map[key]; - opcode.didDestroy(); - _glimmerRuntimeLibBounds.clear(opcode); - this.updating.remove(opcode); - delete map[key]; - this.didDelete = true; - }; + if (_emberEnvironment.environment.hasDOM) { + jQuery = _emberEnvironment.context.imports.jQuery; - ListRevalidationDelegate.prototype.done = function done() { - this.opcode.didInitializeChildren(this.didInsert || this.didDelete); - }; + if (jQuery) { + if (jQuery.event.addProp) { + jQuery.event.addProp('dataTransfer'); + } else { + // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dndevents + ['dragstart', 'drag', 'dragenter', 'dragleave', 'dragover', 'drop', 'dragend'].forEach(function (eventName) { + jQuery.event.fixHooks[eventName] = { + props: ['dataTransfer'] + }; + }); + } + } + } - return ListRevalidationDelegate; - })(); + exports.default = jQuery; +}); +enifed('ember-views/system/lookup_partial', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - var ListBlockOpcode = (function (_BlockOpcode2) { - babelHelpers.inherits(ListBlockOpcode, _BlockOpcode2); + exports.default = lookupPartial; + exports.hasPartial = hasPartial; - function ListBlockOpcode(ops, state, bounds, children, artifacts) { - _BlockOpcode2.call(this, ops, state, bounds, children); - this.type = "list-block"; - this.map = _glimmerUtil.dict(); - this.lastIterated = _glimmerReference.INITIAL; - this.artifacts = artifacts; - var _tag = this._tag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - this.tag = _glimmerReference.combine([artifacts.tag, _tag]); - } + function parseUnderscoredName(templateName) { + var nameParts = templateName.split('/'); + var lastPart = nameParts[nameParts.length - 1]; - ListBlockOpcode.prototype.didInitializeChildren = function didInitializeChildren() { - var listDidChange = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0]; + nameParts[nameParts.length - 1] = '_' + lastPart; - this.lastIterated = this.artifacts.tag.value(); - if (listDidChange) { - this._tag.update(_glimmerReference.combineSlice(this.children)); - } - }; + return nameParts.join('/'); + } - ListBlockOpcode.prototype.evaluate = function evaluate(vm) { - var artifacts = this.artifacts; - var lastIterated = this.lastIterated; - - if (!artifacts.tag.validate(lastIterated)) { - var bounds = this.bounds; - var dom = vm.dom; - - var marker = dom.createComment(''); - dom.insertAfter(bounds.parentElement(), marker, bounds.lastNode()); - var target = new ListRevalidationDelegate(this, marker); - var synchronizer = new _glimmerReference.IteratorSynchronizer({ target: target, artifacts: artifacts }); - synchronizer.sync(); - this.parentElement().removeChild(marker); - } - // Run now-updated updating opcodes - _BlockOpcode2.prototype.evaluate.call(this, vm); - }; + function lookupPartial(templateName, owner) { + if (templateName == null) { + return; + } - ListBlockOpcode.prototype.vmForInsertion = function vmForInsertion(nextSibling) { - var env = this.env; - var scope = this.scope; - var dynamicScope = this.dynamicScope; + var template = templateFor(owner, parseUnderscoredName(templateName), templateName); - var elementStack = _glimmerRuntimeLibBuilder.ElementStack.forInitialRender(this.env, this.bounds.parentElement(), nextSibling); - return new _glimmerRuntimeLibVmAppend.default(env, scope, dynamicScope, elementStack); - }; + _emberMetal.assert('Unable to find partial with name "' + templateName + '"', !!template); - ListBlockOpcode.prototype.toJSON = function toJSON() { - var json = _BlockOpcode2.prototype.toJSON.call(this); - var map = this.map; - var inner = Object.keys(map).map(function (key) { - return JSON.stringify(key) + ': ' + map[key]._guid; - }).join(", "); - json["details"]["map"] = '{' + inner + '}'; - return json; - }; + return template; + } - return ListBlockOpcode; - })(BlockOpcode); + function hasPartial(name, owner) { + if (!owner) { + throw new _emberMetal.Error('Container was not found when looking up a views template. ' + 'This is most likely due to manually instantiating an Ember.View. ' + 'See: http://git.io/EKPpnA'); + } - exports.ListBlockOpcode = ListBlockOpcode; + return owner.hasRegistration('template:' + parseUnderscoredName(name)) || owner.hasRegistration('template:' + name); + } - var UpdatingVMFrame = (function () { - function UpdatingVMFrame(vm, ops, handler) { - this.vm = vm; - this.ops = ops; - this.current = ops.head(); - this.exceptionHandler = handler; - } + function templateFor(owner, underscored, name) { + if (!name) { + return; + } + _emberMetal.assert('templateNames are not allowed to contain periods: ' + name, name.indexOf('.') === -1); - UpdatingVMFrame.prototype.goto = function goto(op) { - this.current = op; - }; + if (!owner) { + throw new _emberMetal.Error('Container was not found when looking up a views template. ' + 'This is most likely due to manually instantiating an Ember.View. ' + 'See: http://git.io/EKPpnA'); + } - UpdatingVMFrame.prototype.nextStatement = function nextStatement() { - var current = this.current; - var ops = this.ops; + return owner.lookup('template:' + underscored) || owner.lookup('template:' + name); + } +}); +enifed('ember-views/system/utils', ['exports', 'ember-utils'], function (exports, _emberUtils) { + /* globals Element */ + 'use strict'; - if (current) this.current = ops.nextNode(current); - return current; - }; + exports.isSimpleClick = isSimpleClick; + exports.getRootViews = getRootViews; + exports.getViewId = getViewId; + exports.getViewElement = getViewElement; + exports.initViewElement = initViewElement; + exports.setViewElement = setViewElement; + exports.getChildViews = getChildViews; + exports.initChildViews = initChildViews; + exports.addChildView = addChildView; + exports.collectChildViews = collectChildViews; + exports.getViewBounds = getViewBounds; + exports.getViewRange = getViewRange; + exports.getViewClientRects = getViewClientRects; + exports.getViewBoundingClientRect = getViewBoundingClientRect; + exports.matches = matches; - UpdatingVMFrame.prototype.handleException = function handleException() { - this.exceptionHandler.handleException(); - }; + /** + @module ember + @submodule ember-views + */ - return UpdatingVMFrame; - })(); -}); + function isSimpleClick(event) { + var modifier = event.shiftKey || event.metaKey || event.altKey || event.ctrlKey; + var secondaryClick = event.which > 1; // IE9 may return undefined -enifed('glimmer-util/index', ['exports', 'glimmer-util/lib/namespaces', 'glimmer-util/lib/platform-utils', 'glimmer-util/lib/assert', 'glimmer-util/lib/logger', 'glimmer-util/lib/object-utils', 'glimmer-util/lib/guid', 'glimmer-util/lib/collections', 'glimmer-util/lib/list-utils'], function (exports, _glimmerUtilLibNamespaces, _glimmerUtilLibPlatformUtils, _glimmerUtilLibAssert, _glimmerUtilLibLogger, _glimmerUtilLibObjectUtils, _glimmerUtilLibGuid, _glimmerUtilLibCollections, _glimmerUtilLibListUtils) { - 'use strict'; + return !modifier && !secondaryClick; + } - exports.getAttrNamespace = _glimmerUtilLibNamespaces.getAttrNamespace; - exports.Option = _glimmerUtilLibPlatformUtils.Option; - exports.Maybe = _glimmerUtilLibPlatformUtils.Maybe; - exports.Opaque = _glimmerUtilLibPlatformUtils.Opaque; - exports.assert = _glimmerUtilLibAssert.default; - exports.LOGGER = _glimmerUtilLibLogger.default; - exports.Logger = _glimmerUtilLibLogger.Logger; - exports.LogLevel = _glimmerUtilLibLogger.LogLevel; - exports.assign = _glimmerUtilLibObjectUtils.assign; - exports.ensureGuid = _glimmerUtilLibGuid.ensureGuid; - exports.initializeGuid = _glimmerUtilLibGuid.initializeGuid; - exports.HasGuid = _glimmerUtilLibGuid.HasGuid; - exports.Stack = _glimmerUtilLibCollections.Stack; - exports.Dict = _glimmerUtilLibCollections.Dict; - exports.Set = _glimmerUtilLibCollections.Set; - exports.DictSet = _glimmerUtilLibCollections.DictSet; - exports.dict = _glimmerUtilLibCollections.dict; - exports.EMPTY_SLICE = _glimmerUtilLibListUtils.EMPTY_SLICE; - exports.LinkedList = _glimmerUtilLibListUtils.LinkedList; - exports.LinkedListNode = _glimmerUtilLibListUtils.LinkedListNode; - exports.ListNode = _glimmerUtilLibListUtils.ListNode; - exports.CloneableListNode = _glimmerUtilLibListUtils.CloneableListNode; - exports.ListSlice = _glimmerUtilLibListUtils.ListSlice; - exports.Slice = _glimmerUtilLibListUtils.Slice; -}); - -enifed("glimmer-util/lib/assert", ["exports"], function (exports) { - // import Logger from './logger'; - // let alreadyWarned = false; - "use strict"; + var STYLE_WARNING = '' + '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.'; - exports.debugAssert = debugAssert; - exports.prodAssert = prodAssert; + exports.STYLE_WARNING = STYLE_WARNING; + /** + @private + @method getRootViews + @param {Object} owner + */ - function debugAssert(test, msg) { - // if (!alreadyWarned) { - // alreadyWarned = true; - // Logger.warn("Don't leave debug assertions on in public builds"); - // } - if (!test) { - throw new Error(msg || "assertion failure"); - } - } + function getRootViews(owner) { + var registry = owner.lookup('-view-registry:main'); - function prodAssert() {} + var rootViews = []; - exports.default = debugAssert; -}); + Object.keys(registry).forEach(function (id) { + var view = registry[id]; -enifed('glimmer-util/lib/collections', ['exports', 'glimmer-util/lib/guid'], function (exports, _glimmerUtilLibGuid) { - 'use strict'; + if (view.parentView === null) { + rootViews.push(view); + } + }); - exports.dict = dict; + return rootViews; + } - var proto = Object.create(null, { - // without this, we will always still end up with (new - // EmptyObject()).constructor === Object - constructor: { - value: undefined, - enumerable: false, - writable: true - } - }); - function EmptyObject() {} - EmptyObject.prototype = proto; + /** + @private + @method getViewId + @param {Ember.View} view + */ - function dict() { - // let d = Object.create(null); - // d.x = 1; - // delete d.x; - // return d; - return new EmptyObject(); + function getViewId(view) { + if (view.tagName === '') { + return _emberUtils.guidFor(view); + } else { + return view.elementId || _emberUtils.guidFor(view); } + } - var DictSet = (function () { - function DictSet() { - this.dict = dict(); - } + var VIEW_ELEMENT = _emberUtils.symbol('VIEW_ELEMENT'); - DictSet.prototype.add = function add(obj) { - if (typeof obj === 'string') this.dict[obj] = obj;else this.dict[_glimmerUtilLibGuid.ensureGuid(obj)] = obj; - return this; - }; + /** + @private + @method getViewElement + @param {Ember.View} view + */ - DictSet.prototype.delete = function _delete(obj) { - if (typeof obj === 'string') delete this.dict[obj];else if (obj._guid) delete this.dict[obj._guid]; - }; + function getViewElement(view) { + return view[VIEW_ELEMENT]; + } - DictSet.prototype.forEach = function forEach(callback) { - var dict = this.dict; + function initViewElement(view) { + view[VIEW_ELEMENT] = null; + } - Object.keys(dict).forEach(function (key) { - return callback(dict[key]); - }); - }; + function setViewElement(view, element) { + return view[VIEW_ELEMENT] = element; + } - DictSet.prototype.toArray = function toArray() { - return Object.keys(this.dict); - }; + var CHILD_VIEW_IDS = _emberUtils.symbol('CHILD_VIEW_IDS'); - return DictSet; - })(); + /** + @private + @method getChildViews + @param {Ember.View} view + */ - exports.DictSet = DictSet; + function getChildViews(view) { + var owner = _emberUtils.getOwner(view); + var registry = owner.lookup('-view-registry:main'); + return collectChildViews(view, registry); + } - var Stack = (function () { - function Stack() { - this.stack = []; - this.current = null; - } + function initChildViews(view) { + view[CHILD_VIEW_IDS] = []; + } - Stack.prototype.push = function push(item) { - this.current = item; - this.stack.push(item); - }; + function addChildView(parent, child) { + parent[CHILD_VIEW_IDS].push(getViewId(child)); + } - Stack.prototype.pop = function pop() { - var item = this.stack.pop(); - var len = this.stack.length; - this.current = len === 0 ? null : this.stack[len - 1]; - return item; - }; + function collectChildViews(view, registry) { + var ids = []; + var views = []; - Stack.prototype.isEmpty = function isEmpty() { - return this.stack.length === 0; - }; + view[CHILD_VIEW_IDS].forEach(function (id) { + var view = registry[id]; - return Stack; - })(); + if (view && !view.isDestroying && !view.isDestroyed && ids.indexOf(id) === -1) { + ids.push(id); + views.push(view); + } + }); - exports.Stack = Stack; -}); + view[CHILD_VIEW_IDS] = ids; -enifed("glimmer-util/lib/guid", ["exports"], function (exports) { - "use strict"; + return views; + } - exports.initializeGuid = initializeGuid; - exports.ensureGuid = ensureGuid; - var GUID = 0; + /** + @private + @method getViewBounds + @param {Ember.View} view + */ - function initializeGuid(object) { - return object._guid = ++GUID; - } + function getViewBounds(view) { + return view.renderer.getBounds(view); + } - function ensureGuid(object) { - return object._guid || initializeGuid(object); - } -}); + /** + @private + @method getViewRange + @param {Ember.View} view + */ -enifed("glimmer-util/lib/list-utils", ["exports"], function (exports) { - "use strict"; + function getViewRange(view) { + var bounds = getViewBounds(view); - var ListNode = function ListNode(value) { - this.next = null; - this.prev = null; - this.value = value; - }; + var range = document.createRange(); + range.setStartBefore(bounds.firstNode); + range.setEndAfter(bounds.lastNode); - exports.ListNode = ListNode; + return range; + } - var LinkedList = (function () { - function LinkedList() { - this.clear(); - } + /** + `getViewClientRects` provides information about the position of the border + box edges of a view relative to the viewport. + + It is only intended to be used by development tools like the Ember Inspector + and may not work on older browsers. + + @private + @method getViewClientRects + @param {Ember.View} view + */ - LinkedList.fromSlice = function fromSlice(slice) { - var list = new LinkedList(); - slice.forEachNode(function (n) { - return list.append(n.clone()); - }); - return list; - }; + function getViewClientRects(view) { + var range = getViewRange(view); + return range.getClientRects(); + } - LinkedList.prototype.head = function head() { - return this._head; - }; + /** + `getViewBoundingClientRect` provides information about the position of the + bounding border box edges of a view relative to the viewport. + + It is only intended to be used by development tools like the Ember Inpsector + and may not work on older browsers. + + @private + @method getViewBoundingClientRect + @param {Ember.View} view + */ - LinkedList.prototype.tail = function tail() { - return this._tail; - }; + function getViewBoundingClientRect(view) { + var range = getViewRange(view); + return range.getBoundingClientRect(); + } - LinkedList.prototype.clear = function clear() { - this._head = this._tail = null; - }; + /** + Determines if the element matches the specified selector. + + @private + @method matches + @param {DOMElement} el + @param {String} selector + */ + var elMatches = typeof Element !== 'undefined' && (Element.prototype.matches || Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector); - LinkedList.prototype.isEmpty = function isEmpty() { - return this._head === null; - }; + exports.elMatches = elMatches; - LinkedList.prototype.toArray = function toArray() { - var out = []; - this.forEachNode(function (n) { - return out.push(n); - }); - return out; - }; + function matches(el, selector) { + return elMatches.call(el, selector); + } +}); +enifed('ember-views/utils/lookup-component', ['exports', 'container'], function (exports, _container) { + 'use strict'; - LinkedList.prototype.splice = function splice(start, end, reference) { - var before = undefined; - if (reference === null) { - before = this._tail; - this._tail = end; - } else { - before = reference.prev; - end.next = reference; - reference.prev = end; - } - if (before) { - before.next = start; - start.prev = before; - } - }; + exports.default = lookupComponent; - LinkedList.prototype.spliceList = function spliceList(list, reference) { - if (list.isEmpty()) return; - this.splice(list.head(), list.tail(), reference); - }; + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['component:-default'], ['component:-default']); - LinkedList.prototype.nextNode = function nextNode(node) { - return node.next; - }; + function lookupComponentPair(componentLookup, owner, name, options) { + var component = componentLookup.componentFor(name, owner, options); + var layout = componentLookup.layoutFor(name, owner, options); - LinkedList.prototype.prevNode = function prevNode(node) { - return node.prev; - }; + var result = { layout: layout, component: component }; - LinkedList.prototype.forEachNode = function forEachNode(callback) { - var node = this._head; - while (node !== null) { - callback(node); - node = node.next; - } - }; + if (layout && !component) { + result.component = owner[_container.FACTORY_FOR](_container.privatize(_templateObject)); + } - LinkedList.prototype.contains = function contains(needle) { - var node = this._head; - while (node !== null) { - if (node === needle) return true; - node = node.next; - } - return false; - }; + return result; + } - LinkedList.prototype.insertBefore = function insertBefore(node) { - var reference = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + function lookupComponent(owner, name, options) { + var componentLookup = owner.lookup('component-lookup:main'); - if (reference === null) return this.append(node); - if (reference.prev) reference.prev.next = node;else this._head = node; - node.prev = reference.prev; - node.next = reference; - reference.prev = node; - return node; - }; + var source = options && options.source; - LinkedList.prototype.append = function append(node) { - var tail = this._tail; - if (tail) { - tail.next = node; - node.prev = tail; - node.next = null; - } else { - this._head = node; - } - return this._tail = node; - }; + if (source) { + var localResult = lookupComponentPair(componentLookup, owner, name, options); - LinkedList.prototype.pop = function pop() { - if (this._tail) return this.remove(this._tail); - return null; - }; + if (localResult.component || localResult.layout) { + return localResult; + } + } - LinkedList.prototype.prepend = function prepend(node) { - if (this._head) return this.insertBefore(node, this._head); - return this._head = this._tail = node; - }; + return lookupComponentPair(componentLookup, owner, name); + } +}); +enifed('ember-views/views/core_view', ['exports', 'ember-runtime', 'ember-views/system/utils', 'ember-views/views/states'], function (exports, _emberRuntime, _emberViewsSystemUtils, _emberViewsViewsStates) { + 'use strict'; - LinkedList.prototype.remove = function remove(node) { - if (node.prev) node.prev.next = node.next;else this._head = node.next; - if (node.next) node.next.prev = node.prev;else this._tail = node.prev; - return node; - }; + /** + `Ember.CoreView` is an abstract class that exists to give view-like behavior + to both Ember's main view class `Ember.Component` and other classes that don't need + the full functionality of `Ember.Component`. + + Unless you have specific needs for `CoreView`, you will use `Ember.Component` + in your applications. + + @class CoreView + @namespace Ember + @extends Ember.Object + @deprecated Use `Ember.Component` instead. + @uses Ember.Evented + @uses Ember.ActionHandler + @private + */ + var CoreView = _emberRuntime.FrameworkObject.extend(_emberRuntime.Evented, _emberRuntime.ActionHandler, { + isView: true, - return LinkedList; - })(); + _states: _emberViewsViewsStates.cloneStates(_emberViewsViewsStates.states), - exports.LinkedList = LinkedList; + init: function () { + this._super.apply(this, arguments); + this._state = 'preRender'; + this._currentState = this._states.preRender; - var LinkedListRemover = (function () { - function LinkedListRemover(node) { - this.node = node; - } + _emberViewsSystemUtils.initViewElement(this); - LinkedListRemover.prototype.destroy = function destroy() { - var _node = this.node; - var prev = _node.prev; - var next = _node.next; + if (!this.renderer) { + throw new Error('Cannot instantiate a component without a renderer. Please ensure that you are creating ' + this + ' with a proper container/registry.'); + } + }, - prev.next = next; - next.prev = prev; - }; + /** + If the view is currently inserted into the DOM of a parent view, this + property will point to the parent of the view. + @property parentView + @type Ember.View + @default null + @private + */ + parentView: null, - return LinkedListRemover; - })(); + instrumentDetails: function (hash) { + hash.object = this.toString(); + hash.containerKey = this._debugContainerKey; + hash.view = this; + return hash; + }, - var ListSlice = (function () { - function ListSlice(head, tail) { - this._head = head; - this._tail = tail; + /** + Override the default event firing from `Ember.Evented` to + also call methods with the given name. + @method trigger + @param name {String} + @private + */ + trigger: function () { + this._super.apply(this, arguments); + var name = arguments[0]; + var method = this[name]; + if (method) { + var args = new Array(arguments.length - 1); + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; } + return method.apply(this, args); + } + }, - ListSlice.toList = function toList(slice) { - var list = new LinkedList(); - slice.forEachNode(function (n) { - return list.append(n.clone()); - }); - return list; - }; - - ListSlice.prototype.forEachNode = function forEachNode(callback) { - var node = this._head; - while (node !== null) { - callback(node); - node = this.nextNode(node); - } - }; + has: function (name) { + return _emberRuntime.typeOf(this[name]) === 'function' || this._super(name); + } + }); - ListSlice.prototype.contains = function contains(needle) { - var node = this._head; - while (node !== null) { - if (node === needle) return true; - node = node.next; - } - return false; - }; + _emberRuntime.deprecateUnderscoreActions(CoreView); - ListSlice.prototype.head = function head() { - return this._head; - }; + CoreView.reopenClass({ + isViewFactory: true + }); - ListSlice.prototype.tail = function tail() { - return this._tail; - }; + exports.default = CoreView; +}); +enifed('ember-views/views/states', ['exports', 'ember-utils', '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, _emberUtils, _emberViewsViewsStatesDefault, _emberViewsViewsStatesPre_render, _emberViewsViewsStatesHas_element, _emberViewsViewsStatesIn_dom, _emberViewsViewsStatesDestroying) { + 'use strict'; - ListSlice.prototype.toArray = function toArray() { - var out = []; - this.forEachNode(function (n) { - return out.push(n); - }); - return out; - }; + exports.cloneStates = cloneStates; - ListSlice.prototype.nextNode = function nextNode(node) { - if (node === this._tail) return null; - return node.next; - }; + function cloneStates(from) { + var into = {}; - ListSlice.prototype.prevNode = function prevNode(node) { - if (node === this._head) return null; - return node.prev; - }; + into._default = {}; + into.preRender = Object.create(into._default); + into.destroying = Object.create(into._default); + into.hasElement = Object.create(into._default); + into.inDOM = Object.create(into.hasElement); - ListSlice.prototype.isEmpty = function isEmpty() { - return false; - }; + for (var stateName in from) { + if (!from.hasOwnProperty(stateName)) { + continue; + } + _emberUtils.assign(into[stateName], from[stateName]); + } - return ListSlice; - })(); + return into; + } - exports.ListSlice = ListSlice; - var EMPTY_SLICE = new ListSlice(null, null); - exports.EMPTY_SLICE = EMPTY_SLICE; + /* + Describe how the specified actions should behave in the various + states that a view can exist in. Possible states: + + * preRender: when a view is first instantiated, and after its + element was destroyed, it is in the preRender state + * hasElement: the DOM representation of the view is created, + and is ready to be inserted + * inDOM: once a view has been inserted into the DOM it is in + the inDOM state. A view spends the vast majority of its + existence in this state. + * destroyed: once a view has been destroyed (using the destroy + method), it is in this state. No further actions can be invoked + on a destroyed view. + */ + var states = { + _default: _emberViewsViewsStatesDefault.default, + preRender: _emberViewsViewsStatesPre_render.default, + inDOM: _emberViewsViewsStatesIn_dom.default, + hasElement: _emberViewsViewsStatesHas_element.default, + destroying: _emberViewsViewsStatesDestroying.default + }; + exports.states = states; }); +enifed('ember-views/views/states/default', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; -enifed("glimmer-util/lib/logger", ["exports"], function (exports) { - "use strict"; - - var LogLevel; - exports.LogLevel = LogLevel; - (function (LogLevel) { - LogLevel[LogLevel["Trace"] = 0] = "Trace"; - LogLevel[LogLevel["Debug"] = 1] = "Debug"; - LogLevel[LogLevel["Warn"] = 2] = "Warn"; - LogLevel[LogLevel["Error"] = 3] = "Error"; - })(LogLevel || (exports.LogLevel = LogLevel = {})); - - var NullConsole = (function () { - function NullConsole() {} + /** + @module ember + @submodule ember-views + */ + exports.default = { + // appendChild is only legal while rendering the buffer. + appendChild: function () { + throw new _emberMetal.Error('You can\'t use appendChild outside of the rendering process'); + }, - NullConsole.prototype.log = function log(message) {}; + // Handle events from `Ember.EventDispatcher` + handleEvent: function () { + return true; // continue event propagation + }, - NullConsole.prototype.warn = function warn(message) {}; + rerender: function () {}, - NullConsole.prototype.error = function error(message) {}; + destroy: function () {} + }; +}); +enifed('ember-views/views/states/destroying', ['exports', 'ember-utils', 'ember-metal', 'ember-views/views/states/default'], function (exports, _emberUtils, _emberMetal, _emberViewsViewsStatesDefault) { + 'use strict'; - NullConsole.prototype.trace = function trace() {}; + /** + @module ember + @submodule ember-views + */ - return NullConsole; - })(); + var destroying = Object.create(_emberViewsViewsStatesDefault.default); - var Logger = (function () { - function Logger(_ref) { - var console = _ref.console; - var level = _ref.level; + _emberUtils.assign(destroying, { + appendChild: function () { + throw new _emberMetal.Error('You can\'t call appendChild on a view being destroyed'); + }, + rerender: function () { + throw new _emberMetal.Error('You can\'t call rerender on a view being destroyed'); + } + }); - this.f = ALWAYS; - this.force = ALWAYS; - this.console = console; - this.level = level; - } + exports.default = destroying; +}); +enifed('ember-views/views/states/has_element', ['exports', 'ember-utils', 'ember-views/views/states/default', 'ember-metal'], function (exports, _emberUtils, _emberViewsViewsStatesDefault, _emberMetal) { + 'use strict'; - Logger.prototype.skipped = function skipped(level) { - return level < this.level; - }; + var hasElement = Object.create(_emberViewsViewsStatesDefault.default); - Logger.prototype.trace = function trace(message) { - var _ref2 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + _emberUtils.assign(hasElement, { - var _ref2$stackTrace = _ref2.stackTrace; - var stackTrace = _ref2$stackTrace === undefined ? false : _ref2$stackTrace; + rerender: function (view) { + view.renderer.rerender(view); + }, - if (this.skipped(LogLevel.Trace)) return; - this.console.log(message); - if (stackTrace) this.console.trace(); - }; + destroy: function (view) { + view.renderer.remove(view); + }, - Logger.prototype.debug = function debug(message) { - var _ref3 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + // Handle events from `Ember.EventDispatcher` + handleEvent: function (view, eventName, event) { + if (view.has(eventName)) { + // Handler should be able to re-dispatch events, so we don't + // preventDefault or stopPropagation. + return _emberMetal.flaggedInstrument('interaction.' + eventName, { event: event, view: view }, function () { + return _emberMetal.run.join(view, view.trigger, eventName, event); + }); + } else { + return true; // continue event propagation + } + } + }); - var _ref3$stackTrace = _ref3.stackTrace; - var stackTrace = _ref3$stackTrace === undefined ? false : _ref3$stackTrace; + exports.default = hasElement; +}); +enifed('ember-views/views/states/in_dom', ['exports', 'ember-utils', 'ember-metal', 'ember-views/views/states/has_element'], function (exports, _emberUtils, _emberMetal, _emberViewsViewsStatesHas_element) { + 'use strict'; - if (this.skipped(LogLevel.Debug)) return; - this.console.log(message); - if (stackTrace) this.console.trace(); - }; + /** + @module ember + @submodule ember-views + */ - Logger.prototype.warn = function warn(message) { - var _ref4 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + var inDOM = Object.create(_emberViewsViewsStatesHas_element.default); - var _ref4$stackTrace = _ref4.stackTrace; - var stackTrace = _ref4$stackTrace === undefined ? false : _ref4$stackTrace; + _emberUtils.assign(inDOM, { + enter: function (view) { + // Register the view for event handling. This hash is used by + // Ember.EventDispatcher to dispatch incoming events. + view.renderer.register(view); - if (this.skipped(LogLevel.Warn)) return; - this.console.warn(message); - if (stackTrace) this.console.trace(); - }; + _emberMetal.runInDebug(function () { + _emberMetal._addBeforeObserver(view, 'elementId', function () { + throw new _emberMetal.Error('Changing a view\'s elementId after creation is not allowed'); + }); + }); + }, - Logger.prototype.error = function error(message) { - if (this.skipped(LogLevel.Error)) return; - this.console.error(message); - }; + exit: function (view) { + view.renderer.unregister(view); + } + }); - return Logger; - })(); + exports.default = inDOM; +}); +enifed('ember-views/views/states/pre_render', ['exports', 'ember-views/views/states/default'], function (exports, _emberViewsViewsStatesDefault) { + 'use strict'; - exports.Logger = Logger; + /** + @module ember + @submodule ember-views + */ - var _console = typeof console === 'undefined' ? new NullConsole() : console; - var ALWAYS = new Logger({ console: _console, level: LogLevel.Trace }); - var LOG_LEVEL = LogLevel.Warn; - exports.default = new Logger({ console: _console, level: LOG_LEVEL }); + exports.default = Object.create(_emberViewsViewsStatesDefault.default); }); +enifed("ember-views/views/view", ["exports"], function (exports) { + "use strict"; +}); +/** +@module ember +@submodule ember-views +*/ -enifed('glimmer-util/lib/namespaces', ['exports'], function (exports) { - // There is a small whitelist of namespaced attributes specially - // enumerated in - // https://www.w3.org/TR/html/syntax.html#attributes-0 - // - // > When a foreign element has one of the namespaced attributes given by - // > the local name and namespace of the first and second cells of a row - // > from the following table, it must be written using the name given by - // > the third cell from the same row. - // - // In all other cases, colons are interpreted as a regular character - // with no special meaning: - // - // > No other namespaced attribute can be expressed in the HTML syntax. - 'use strict'; - - exports.getAttrNamespace = getAttrNamespace; - var XLINK = 'http://www.w3.org/1999/xlink'; - var XML = 'http://www.w3.org/XML/1998/namespace'; - var XMLNS = 'http://www.w3.org/2000/xmlns/'; - var WHITELIST = { - 'xlink:actuate': XLINK, - 'xlink:arcrole': XLINK, - 'xlink:href': XLINK, - 'xlink:role': XLINK, - 'xlink:show': XLINK, - 'xlink:title': XLINK, - 'xlink:type': XLINK, - 'xml:base': XML, - 'xml:lang': XML, - 'xml:space': XML, - 'xmlns': XMLNS, - 'xmlns:xlink': XMLNS - }; +/** + @class View + @namespace Ember + @extends Ember.CoreView + @deprecated See http://emberjs.com/deprecations/v1.x/#toc_ember-view + @uses Ember.ViewSupport + @uses Ember.ChildViewsSupport + @uses Ember.ClassNamesSupport + @uses Ember.AttributeBindingsSupport + @private +*/ +enifed("ember/features", ["exports"], function (exports) { + "use strict"; - function getAttrNamespace(attrName) { - return WHITELIST[attrName] || null; - } + exports.default = { "features-stripped-test": null, "ember-libraries-isregistered": null, "ember-improved-instrumentation": null, "ember-metal-weakmap": null, "ember-glimmer-allow-backtracking-rerender": true, "ember-testing-resume-test": null, "ember-factory-for": true, "ember-no-double-extend": null, "ember-routing-router-service": null, "ember-unique-location-history-state": null, "ember-glimmer-detect-backtracking-rerender": true, "mandatory-setter": true }; }); +enifed('ember/index', ['exports', 'require', 'ember-environment', 'ember-utils', 'container', 'ember-metal', 'backburner', 'ember-console', 'ember-runtime', 'ember-glimmer', 'ember/version', 'ember-views', 'ember-routing', 'ember-application', 'ember-extension-support'], function (exports, _require, _emberEnvironment, _emberUtils, _container, _emberMetal, _backburner, _emberConsole, _emberRuntime, _emberGlimmer, _emberVersion, _emberViews, _emberRouting, _emberApplication, _emberExtensionSupport) { + 'use strict'; -enifed('glimmer-util/lib/object-utils', ['exports'], function (exports) { - 'use strict'; + // ember-utils exports + _emberMetal.default.getOwner = _emberUtils.getOwner; + _emberMetal.default.setOwner = _emberUtils.setOwner; + _emberMetal.default.generateGuid = _emberUtils.generateGuid; + _emberMetal.default.GUID_KEY = _emberUtils.GUID_KEY; + _emberMetal.default.guidFor = _emberUtils.guidFor; + _emberMetal.default.inspect = _emberUtils.inspect; + _emberMetal.default.makeArray = _emberUtils.makeArray; + _emberMetal.default.canInvoke = _emberUtils.canInvoke; + _emberMetal.default.tryInvoke = _emberUtils.tryInvoke; + _emberMetal.default.wrap = _emberUtils.wrap; + _emberMetal.default.applyStr = _emberUtils.applyStr; + _emberMetal.default.uuid = _emberUtils.uuid; + _emberMetal.default.assign = Object.assign || _emberUtils.assign; - exports.assign = assign; - var objKeys = Object.keys; + // container exports + _emberMetal.default.Container = _container.Container; + _emberMetal.default.Registry = _container.Registry; - function assign(obj) { - for (var i = 1; i < arguments.length; i++) { - var assignment = arguments[i]; - if (assignment === null || typeof assignment !== 'object') continue; - var keys = objKeys(assignment); - for (var j = 0; j < keys.length; j++) { - var key = keys[j]; - obj[key] = assignment[key]; - } - } - return obj; - } -}); + // need to import this directly, to ensure the babel feature + // flag plugin works properly -enifed("glimmer-util/lib/platform-utils", ["exports"], function (exports) { - "use strict"; + var computed = _emberMetal.computed; + computed.alias = _emberMetal.alias; + _emberMetal.default.computed = computed; + _emberMetal.default.ComputedProperty = _emberMetal.ComputedProperty; + _emberMetal.default.cacheFor = _emberMetal.cacheFor; - exports.unwrap = unwrap; + _emberMetal.default.assert = _emberMetal.assert; + _emberMetal.default.warn = _emberMetal.warn; + _emberMetal.default.debug = _emberMetal.debug; + _emberMetal.default.deprecate = _emberMetal.deprecate; + _emberMetal.default.deprecateFunc = _emberMetal.deprecateFunc; + _emberMetal.default.runInDebug = _emberMetal.runInDebug; + _emberMetal.default.merge = _emberMetal.merge; - function unwrap(val) { - if (val === null || val === undefined) throw new Error("Expected value to be present"); - return val; - } -}); + _emberMetal.default.instrument = _emberMetal.instrument; + _emberMetal.default.subscribe = _emberMetal.instrumentationSubscribe; + _emberMetal.default.Instrumentation = { + instrument: _emberMetal.instrument, + subscribe: _emberMetal.instrumentationSubscribe, + unsubscribe: _emberMetal.instrumentationUnsubscribe, + reset: _emberMetal.instrumentationReset + }; -enifed("glimmer-util/lib/quoting", ["exports"], function (exports) { - "use strict"; + _emberMetal.default.Error = _emberMetal.Error; + _emberMetal.default.META_DESC = _emberMetal.META_DESC; + _emberMetal.default.meta = _emberMetal.meta; + _emberMetal.default.get = _emberMetal.get; + _emberMetal.default.getWithDefault = _emberMetal.getWithDefault; + _emberMetal.default._getPath = _emberMetal._getPath; + _emberMetal.default.set = _emberMetal.set; + _emberMetal.default.trySet = _emberMetal.trySet; + _emberMetal.default.FEATURES = _emberMetal.FEATURES; + _emberMetal.default.FEATURES.isEnabled = _emberMetal.isFeatureEnabled; + _emberMetal.default._Cache = _emberMetal.Cache; + _emberMetal.default.on = _emberMetal.on; + _emberMetal.default.addListener = _emberMetal.addListener; + _emberMetal.default.removeListener = _emberMetal.removeListener; + _emberMetal.default._suspendListener = _emberMetal.suspendListener; + _emberMetal.default._suspendListeners = _emberMetal.suspendListeners; + _emberMetal.default.sendEvent = _emberMetal.sendEvent; + _emberMetal.default.hasListeners = _emberMetal.hasListeners; + _emberMetal.default.watchedEvents = _emberMetal.watchedEvents; + _emberMetal.default.listenersFor = _emberMetal.listenersFor; + _emberMetal.default.accumulateListeners = _emberMetal.accumulateListeners; + _emberMetal.default.isNone = _emberMetal.isNone; + _emberMetal.default.isEmpty = _emberMetal.isEmpty; + _emberMetal.default.isBlank = _emberMetal.isBlank; + _emberMetal.default.isPresent = _emberMetal.isPresent; + _emberMetal.default.run = _emberMetal.run; + _emberMetal.default._ObserverSet = _emberMetal.ObserverSet; + _emberMetal.default.propertyWillChange = _emberMetal.propertyWillChange; + _emberMetal.default.propertyDidChange = _emberMetal.propertyDidChange; + _emberMetal.default.overrideChains = _emberMetal.overrideChains; + _emberMetal.default.beginPropertyChanges = _emberMetal.beginPropertyChanges; + _emberMetal.default.endPropertyChanges = _emberMetal.endPropertyChanges; + _emberMetal.default.changeProperties = _emberMetal.changeProperties; + _emberMetal.default.platform = { + defineProperty: true, + hasPropertyAccessors: true + }; + _emberMetal.default.defineProperty = _emberMetal.defineProperty; + _emberMetal.default.watchKey = _emberMetal.watchKey; + _emberMetal.default.unwatchKey = _emberMetal.unwatchKey; + _emberMetal.default.removeChainWatcher = _emberMetal.removeChainWatcher; + _emberMetal.default._ChainNode = _emberMetal.ChainNode; + _emberMetal.default.finishChains = _emberMetal.finishChains; + _emberMetal.default.watchPath = _emberMetal.watchPath; + _emberMetal.default.unwatchPath = _emberMetal.unwatchPath; + _emberMetal.default.watch = _emberMetal.watch; + _emberMetal.default.isWatching = _emberMetal.isWatching; + _emberMetal.default.unwatch = _emberMetal.unwatch; + _emberMetal.default.destroy = _emberMetal.destroy; + _emberMetal.default.libraries = _emberMetal.libraries; + _emberMetal.default.OrderedSet = _emberMetal.OrderedSet; + _emberMetal.default.Map = _emberMetal.Map; + _emberMetal.default.MapWithDefault = _emberMetal.MapWithDefault; + _emberMetal.default.getProperties = _emberMetal.getProperties; + _emberMetal.default.setProperties = _emberMetal.setProperties; + _emberMetal.default.expandProperties = _emberMetal.expandProperties; + _emberMetal.default.NAME_KEY = _emberUtils.NAME_KEY; + _emberMetal.default.addObserver = _emberMetal.addObserver; + _emberMetal.default.observersFor = _emberMetal.observersFor; + _emberMetal.default.removeObserver = _emberMetal.removeObserver; + _emberMetal.default._suspendObserver = _emberMetal._suspendObserver; + _emberMetal.default._suspendObservers = _emberMetal._suspendObservers; + _emberMetal.default.required = _emberMetal.required; + _emberMetal.default.aliasMethod = _emberMetal.aliasMethod; + _emberMetal.default.observer = _emberMetal.observer; + _emberMetal.default.immediateObserver = _emberMetal._immediateObserver; + _emberMetal.default.mixin = _emberMetal.mixin; + _emberMetal.default.Mixin = _emberMetal.Mixin; + _emberMetal.default.bind = _emberMetal.bind; + _emberMetal.default.Binding = _emberMetal.Binding; + _emberMetal.default.isGlobalPath = _emberMetal.isGlobalPath; - exports.hash = hash; - exports.repeat = repeat; - function escapeString(str) { - str = str.replace(/\\/g, "\\\\"); - str = str.replace(/"/g, '\\"'); - str = str.replace(/\n/g, "\\n"); - return str; - } - exports.escapeString = escapeString; + if (_emberMetal.isFeatureEnabled('ember-metal-weakmap')) { + _emberMetal.default.WeakMap = _emberMetal.WeakMap; + } - function string(str) { - return '"' + escapeString(str) + '"'; - } - exports.string = string; + Object.defineProperty(_emberMetal.default, 'ENV', { + get: function () { + return _emberEnvironment.ENV; + }, + enumerable: false + }); + + /** + The context that Ember searches for namespace instances on. + + @private + */ + Object.defineProperty(_emberMetal.default, 'lookup', { + get: function () { + return _emberEnvironment.context.lookup; + }, + set: function (value) { + _emberEnvironment.context.lookup = value; + }, + enumerable: false + }); - function array(a) { - return "[" + a + "]"; - } - exports.array = array; + _emberMetal.default.EXTEND_PROTOTYPES = _emberEnvironment.ENV.EXTEND_PROTOTYPES; - function hash(pairs) { - return "{" + pairs.join(", ") + "}"; - } + // BACKWARDS COMPAT ACCESSORS FOR ENV FLAGS + Object.defineProperty(_emberMetal.default, 'LOG_STACKTRACE_ON_DEPRECATION', { + get: function () { + return _emberEnvironment.ENV.LOG_STACKTRACE_ON_DEPRECATION; + }, + set: function (value) { + _emberEnvironment.ENV.LOG_STACKTRACE_ON_DEPRECATION = !!value; + }, + enumerable: false + }); - function repeat(chars, times) { - var str = ""; - while (times--) { - str += chars; - } - return str; - } -}); + Object.defineProperty(_emberMetal.default, 'LOG_VERSION', { + get: function () { + return _emberEnvironment.ENV.LOG_VERSION; + }, + set: function (value) { + _emberEnvironment.ENV.LOG_VERSION = !!value; + }, + enumerable: false + }); -enifed('glimmer-wire-format/index', ['exports'], function (exports) { - 'use strict'; + Object.defineProperty(_emberMetal.default, 'MODEL_FACTORY_INJECTIONS', { + get: function () { + return _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS; + }, + set: function (value) { + _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS = !!value; + }, + enumerable: false + }); - function is(variant) { - return function (value) { - return value[0] === variant; - }; - } - var Expressions; - exports.Expressions = Expressions; - (function (Expressions) { - Expressions.isUnknown = is('unknown'); - Expressions.isArg = is('arg'); - Expressions.isGet = is('get'); - Expressions.isConcat = is('concat'); - Expressions.isHelper = is('helper'); - Expressions.isHasBlock = is('has-block'); - Expressions.isHasBlockParams = is('has-block-params'); - Expressions.isUndefined = is('undefined'); - function isPrimitiveValue(value) { - if (value === null) { - return true; - } - return typeof value !== 'object'; - } - Expressions.isPrimitiveValue = isPrimitiveValue; - })(Expressions || (exports.Expressions = Expressions = {})); - var Statements; - exports.Statements = Statements; - (function (Statements) { - Statements.isText = is('text'); - Statements.isAppend = is('append'); - Statements.isComment = is('comment'); - Statements.isModifier = is('modifier'); - Statements.isBlock = is('block'); - Statements.isOpenElement = is('open-element'); - Statements.isFlushElement = is('flush-element'); - Statements.isCloseElement = is('close-element'); - Statements.isStaticAttr = is('static-attr'); - Statements.isDynamicAttr = is('dynamic-attr'); - Statements.isYield = is('yield'); - Statements.isPartial = is('partial'); - Statements.isDynamicArg = is('dynamic-arg'); - Statements.isStaticArg = is('static-arg'); - Statements.isTrustingAttr = is('trusting-attr'); - })(Statements || (exports.Statements = Statements = {})); -}); + Object.defineProperty(_emberMetal.default, 'LOG_BINDINGS', { + get: function () { + return _emberEnvironment.ENV.LOG_BINDINGS; + }, + set: function (value) { + _emberEnvironment.ENV.LOG_BINDINGS = !!value; + }, + enumerable: false + }); -enifed('glimmer/index', ['exports', 'glimmer-compiler'], function (exports, _glimmerCompiler) { - /* - * @overview Glimmer - * @copyright Copyright 2011-2015 Tilde Inc. and contributors - * @license Licensed under MIT license - * See https://raw.githubusercontent.com/tildeio/glimmer/master/LICENSE - * @version VERSION_STRING_PLACEHOLDER - */ - 'use strict'; + /** + A function may be assigned to `Ember.onerror` to be called when Ember + internals encounter an error. This is useful for specialized error handling + and reporting code. + + ```javascript + Ember.onerror = function(error) { + Em.$.ajax('/report-error', 'POST', { + stack: error.stack, + otherInformation: 'whatever app state you want to provide' + }); + }; + ``` + + Internally, `Ember.onerror` is used as Backburner's error handler. + + @event onerror + @for Ember + @param {Exception} error the error object + @public + */ + Object.defineProperty(_emberMetal.default, 'onerror', { + get: _emberMetal.getOnerror, + set: _emberMetal.setOnerror, + enumerable: false + }); - exports.precompile = _glimmerCompiler.precompile; -}); + /** + An empty function useful for some operations. Always returns `this`. + + @method K + @return {Object} + @public + */ + function deprecatedEmberK() { + return this; + } -enifed('route-recognizer', ['exports'], function (exports) { 'use strict'; + Object.defineProperty(_emberMetal.default, 'K', { + get: function () { + _emberMetal.deprecate('Ember.K is deprecated in favor of defining a function inline.', false, { + id: 'ember-metal.ember-k', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x#toc_code-ember-k-code' + }); -function Target(path, matcher, delegate) { - this.path = path; - this.matcher = matcher; - this.delegate = delegate; -} + return deprecatedEmberK; + } + }); -Target.prototype = { - to: function(target, callback) { - var delegate = this.delegate; + Object.defineProperty(_emberMetal.default, 'testing', { + get: _emberMetal.isTesting, + set: _emberMetal.setTesting, + enumerable: false + }); - if (delegate && delegate.willAddRoute) { - target = delegate.willAddRoute(this.matcher.target, target); - } + if (!_require.has('ember-debug')) { + _emberMetal.default.Debug = { + registerDeprecationHandler: function () {}, + registerWarnHandler: function () {} + }; + } - this.matcher.add(this.path, target); + /** + @class Backburner + @for Ember + @private + */ + _emberMetal.default.Backburner = function () { + _emberMetal.deprecate('Usage of Ember.Backburner is deprecated.', false, { + id: 'ember-metal.ember-backburner', + until: '2.8.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-backburner' + }); - if (callback) { - if (callback.length === 0) { throw new Error("You must have an argument in the function passed to `to`"); } - this.matcher.addChild(this.path, target, callback, this.delegate); + function BackburnerAlias(args) { + return _backburner.default.apply(this, args); } - return this; - } -}; -function Matcher(target) { - this.routes = {}; - this.children = {}; - this.target = target; -} + BackburnerAlias.prototype = _backburner.default.prototype; -Matcher.prototype = { - add: function(path, handler) { - this.routes[path] = handler; - }, + return new BackburnerAlias(arguments); + }; - addChild: function(path, target, callback, delegate) { - var matcher = new Matcher(target); - this.children[path] = matcher; + _emberMetal.default._Backburner = _backburner.default; - var match = generateMatch(path, matcher, delegate); + _emberMetal.default.Logger = _emberConsole.default; - if (delegate && delegate.contextEntered) { - delegate.contextEntered(target, match); - } + // ****ember-runtime**** - callback(match); - } -}; + _emberMetal.default.String = _emberRuntime.String; + _emberMetal.default.Object = _emberRuntime.Object; + _emberMetal.default._RegistryProxyMixin = _emberRuntime.RegistryProxyMixin; + _emberMetal.default._ContainerProxyMixin = _emberRuntime.ContainerProxyMixin; + _emberMetal.default.compare = _emberRuntime.compare; + _emberMetal.default.copy = _emberRuntime.copy; + _emberMetal.default.isEqual = _emberRuntime.isEqual; + _emberMetal.default.inject = _emberRuntime.inject; + _emberMetal.default.Array = _emberRuntime.Array; + _emberMetal.default.Comparable = _emberRuntime.Comparable; + _emberMetal.default.Enumerable = _emberRuntime.Enumerable; + _emberMetal.default.ArrayProxy = _emberRuntime.ArrayProxy; + _emberMetal.default.ObjectProxy = _emberRuntime.ObjectProxy; + _emberMetal.default.ActionHandler = _emberRuntime.ActionHandler; + _emberMetal.default.CoreObject = _emberRuntime.CoreObject; + _emberMetal.default.NativeArray = _emberRuntime.NativeArray; + _emberMetal.default.Copyable = _emberRuntime.Copyable; + _emberMetal.default.Freezable = _emberRuntime.Freezable; + _emberMetal.default.FROZEN_ERROR = _emberRuntime.FROZEN_ERROR; + _emberMetal.default.MutableEnumerable = _emberRuntime.MutableEnumerable; + _emberMetal.default.MutableArray = _emberRuntime.MutableArray; + _emberMetal.default.TargetActionSupport = _emberRuntime.TargetActionSupport; + _emberMetal.default.Evented = _emberRuntime.Evented; + _emberMetal.default.PromiseProxyMixin = _emberRuntime.PromiseProxyMixin; + _emberMetal.default.Observable = _emberRuntime.Observable; + _emberMetal.default.typeOf = _emberRuntime.typeOf; + _emberMetal.default.isArray = _emberRuntime.isArray; + _emberMetal.default.Object = _emberRuntime.Object; + _emberMetal.default.onLoad = _emberRuntime.onLoad; + _emberMetal.default.runLoadHooks = _emberRuntime.runLoadHooks; + _emberMetal.default.Controller = _emberRuntime.Controller; + _emberMetal.default.ControllerMixin = _emberRuntime.ControllerMixin; + _emberMetal.default.Service = _emberRuntime.Service; + _emberMetal.default._ProxyMixin = _emberRuntime._ProxyMixin; + _emberMetal.default.RSVP = _emberRuntime.RSVP; + _emberMetal.default.Namespace = _emberRuntime.Namespace; -function generateMatch(startingPath, matcher, delegate) { - return function(path, nestedCallback) { - var fullPath = startingPath + path; + // ES6TODO: this seems a less than ideal way/place to add properties to Ember.computed + computed.empty = _emberRuntime.empty; + computed.notEmpty = _emberRuntime.notEmpty; + computed.none = _emberRuntime.none; + computed.not = _emberRuntime.not; + computed.bool = _emberRuntime.bool; + computed.match = _emberRuntime.match; + computed.equal = _emberRuntime.equal; + computed.gt = _emberRuntime.gt; + computed.gte = _emberRuntime.gte; + computed.lt = _emberRuntime.lt; + computed.lte = _emberRuntime.lte; + computed.oneWay = _emberRuntime.oneWay; + computed.reads = _emberRuntime.oneWay; + computed.readOnly = _emberRuntime.readOnly; + computed.deprecatingAlias = _emberRuntime.deprecatingAlias; + computed.and = _emberRuntime.and; + computed.or = _emberRuntime.or; + computed.any = _emberRuntime.any; - if (nestedCallback) { - nestedCallback(generateMatch(fullPath, matcher, delegate)); - } else { - return new Target(startingPath + path, matcher, delegate); - } - }; -} + computed.sum = _emberRuntime.sum; + computed.min = _emberRuntime.min; + computed.max = _emberRuntime.max; + computed.map = _emberRuntime.map; + computed.sort = _emberRuntime.sort; + computed.setDiff = _emberRuntime.setDiff; + computed.mapBy = _emberRuntime.mapBy; + computed.filter = _emberRuntime.filter; + computed.filterBy = _emberRuntime.filterBy; + computed.uniq = _emberRuntime.uniq; -function addRoute(routeArray, path, handler) { - var len = 0; - for (var i=0; i 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + mixins[_key - 1] = arguments[_key]; } - }, - put: function(charSpec) { - var state; + mixins.forEach(function (mixinOrGenerator) { + var mixin = undefined; - // If the character specification already exists in a child of the current - // state, just return that state. - if (state = this.get(charSpec)) { return state; } + if (isGenerator(mixinOrGenerator)) { + (function () { + var generator = mixinOrGenerator; + mixin = {}; - // Make a new state for the character spec - state = new State(charSpec); + generator.cases.forEach(function (value, idx) { + _emberUtils.assign(mixin, generator.generate(value, idx)); + }); + })(); + } else { + mixin = mixinOrGenerator; + } - // Insert the new state as a child of the current state - this.nextStates.push(state); + _emberUtils.assign(TestClass.prototype, mixin); + }); - // If this character specification repeats, insert the new state as a child - // of itself. Note that this will not trigger an infinite loop because each - // transition during recognition consumes a character. - if (charSpec.repeat) { - state.nextStates.push(state); - } + return TestClass; + } +}); +enifed('internal-test-helpers/build-owner', ['exports', 'container', 'ember-routing', 'ember-application', 'ember-metal', 'ember-runtime'], function (exports, _container, _emberRouting, _emberApplication, _emberMetal, _emberRuntime) { + 'use strict'; - // Return the new state - return state; - }, + exports.default = buildOwner; - // Find a list of child states matching the next character - match: function(ch) { - var nextStates = this.nextStates, - child, charSpec, chars; + function buildOwner() { + var _EmberObject$extend; - var returned = []; + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - for (var i=0; i'; + })(); -var RouteRecognizer = function() { - this.rootState = new State(); - this.names = {}; -}; + function normalizeInnerHTML(actualHTML) { + if (ieSVGInnerHTML) { + // Replace `` with ``, etc. + // drop namespace attribute + actualHTML = actualHTML.replace(/ xmlns="[^"]+"/, ''); + // replace self-closing elements + actualHTML = actualHTML.replace(/<([^ >]+) [^\/>]*\/>/gi, function (tag, tagName) { + return tag.slice(0, tag.length - 3) + '>'; + }); + } + return actualHTML; + } -RouteRecognizer.prototype = { - add: function(routes, options) { - var currentState = this.rootState, regex = "^", - types = { statics: 0, dynamics: 0, stars: 0 }, - handlers = new Array(routes.length), allSegments = [], name; + function equalInnerHTML(fragment, html) { + var actualHTML = normalizeInnerHTML(fragment.innerHTML); + QUnit.push(actualHTML === html, actualHTML, html); + } +}); +enifed('internal-test-helpers/equal-tokens', ['exports', 'simple-html-tokenizer'], function (exports, _simpleHtmlTokenizer) { + 'use strict'; - var isEmpty = true; + exports.default = equalTokens; - for (var i=0; i b[0]) { + return 1; + } + if (a[0] < b[0]) { + return -1; + } + return 0; + }); + } + }); + } - allSegments = allSegments.concat(segments); + function equalTokens(actualContainer, expectedHTML) { + var message = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; - for (var j=0; j'; + }; - if (!route) { throw new Error("There is no route named " + name); } + Klass.create = create; + Klass.extend = extend; + Klass.reopen = extend; + Klass.reopenClass = reopenClass; - var result = new Array(route.handlers.length); + return Klass; - for (var i=0; i 2 && key.slice(keyLength -2) === '[]') { - isArray = true; - key = key.slice(0, keyLength - 2); - if(!queryParams[key]) { - queryParams[key] = []; - } - } - value = pair[1] ? decodeQueryParamPart(pair[1]) : ''; - } - if (isArray) { - queryParams[key].push(value); - } else { - queryParams[key] = value; - } - } - return queryParams; - }, + return _ref2 = {}, _ref2[MATCHER_BRAND] = true, _ref2.match = function (v) { + return r.test(v); + }, _ref2.expected = function () { + return r.toString(); + }, _ref2.message = function () { + return 'should match ' + this.expected(); + }, _ref2; + } - recognize: function(path) { - var states = [ this.rootState ], - pathLen, i, queryStart, queryParams = {}, - hashStart, - isSlashDropped = false; + function classes(expected) { + var _ref3; - hashStart = path.indexOf('#'); - if (hashStart !== -1) { - path = path.substr(0, hashStart); - } + return _ref3 = {}, _ref3[MATCHER_BRAND] = true, _ref3.match = function (actual) { + actual = actual.trim(); + return actual && expected.split(/\s+/).sort().join(' ') === actual.trim().split(/\s+/).sort().join(' '); + }, _ref3.expected = function () { + return expected; + }, _ref3.message = function () { + return 'should match ' + this.expected(); + }, _ref3; + } - queryStart = path.indexOf('?'); - if (queryStart !== -1) { - var queryString = path.substr(queryStart + 1, path.length); - path = path.substr(0, queryStart); - queryParams = this.parseQueryString(queryString); - } + function styles(expected) { + var _ref4; - if (path.charAt(0) !== "/") { path = "/" + path; } - var originalPath = path; + return _ref4 = {}, _ref4[MATCHER_BRAND] = true, _ref4.match = function (actual) { + // coerce `null` or `undefined` to an empty string + // needed for matching empty styles on IE9 - IE11 + actual = actual || ''; + actual = actual.trim(); - if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS) { - path = normalizePath(path); - } else { - path = decodeURI(path); - originalPath = decodeURI(originalPath); - } + return expected.split(';').map(function (s) { + return s.trim(); + }).filter(function (s) { + return s; + }).sort().join('; ') === actual.split(';').map(function (s) { + return s.trim(); + }).filter(function (s) { + return s; + }).sort().join('; '); + }, _ref4.expected = function () { + return expected; + }, _ref4.message = function () { + return 'should match ' + this.expected(); + }, _ref4; + } - pathLen = path.length; - if (pathLen > 1 && path.charAt(pathLen - 1) === "/") { - path = path.substr(0, pathLen - 1); - originalPath = originalPath.substr(0, originalPath.length - 1); - isSlashDropped = true; - } + function equalsElement(element, tagName, attributes, content) { + QUnit.push(element.tagName === tagName.toUpperCase(), element.tagName.toLowerCase(), tagName, 'expect tagName to be ' + tagName); - for (i=0; i 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + mixins[_key - 2] = arguments[_key]; + } -var _isArray; -if (!Array.isArray) { - _isArray = function (x) { - return Object.prototype.toString.call(x) === "[object Array]"; - }; -} else { - _isArray = Array.isArray; -} + _internalTestHelpersApplyMixins.default(TestClass, mixins); -var isArray = _isArray; + var proto = TestClass.prototype; -/** - Determines if an object is Promise by checking if it is "thenable". -**/ -function isPromise(obj) { - return ((typeof obj === 'object' && obj !== null) || typeof obj === 'function') && typeof obj.then === 'function'; -} + while (proto !== Object.prototype) { + Object.keys(proto).forEach(generateTest); + proto = Object.getPrototypeOf(proto); + } -function merge(hash, other) { - for (var prop in other) { - if (other.hasOwnProperty(prop)) { hash[prop] = other[prop]; } + function generateTest(name) { + if (name.indexOf('@test ') === 0) { + QUnit.test(name.slice(5), function (assert) { + return context[name](assert); + }); + } else if (name.indexOf('@skip ') === 0) { + QUnit.skip(name.slice(5), function (assert) { + return context[name](assert); + }); + } + } } -} - -var oCreate = Object.create || function(proto) { - function F() {} - F.prototype = proto; - return new F(); -}; +}); +enifed('internal-test-helpers/run', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; -/** - @private + exports.runAppend = runAppend; + exports.runDestroy = runDestroy; - Extracts query params from the end of an array -**/ -function extractQueryParams(array) { - var len = (array && array.length), head, queryParams; + function runAppend(view) { + _emberMetal.run(view, 'appendTo', '#qunit-fixture'); + } - if(len && len > 0 && array[len - 1] && array[len - 1].hasOwnProperty('queryParams')) { - queryParams = array[len - 1].queryParams; - head = slice.call(array, 0, len - 1); - return [head, queryParams]; - } else { - return [array, null]; + function runDestroy(toDestroy) { + if (toDestroy) { + _emberMetal.run(toDestroy, 'destroy'); + } } -} +}); +enifed('internal-test-helpers/strip', ['exports'], function (exports) { + 'use strict'; -/** - @private + exports.default = strip; - Coerces query param properties and array elements into strings. -**/ -function coerceQueryParamsToString(queryParams) { - for (var key in queryParams) { - if (typeof queryParams[key] === 'number') { - queryParams[key] = '' + queryParams[key]; - } else if (isArray(queryParams[key])) { - for (var i = 0, l = queryParams[key].length; i < l; i++) { - queryParams[key][i] = '' + queryParams[key][i]; - } + function strip(_ref) { + for (var _len = arguments.length, values = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + values[_key - 1] = arguments[_key]; } - } -} -/** - @private - */ -function log(router, sequence, msg) { - if (!router.log) { return; } - if (arguments.length === 3) { - router.log("Transition #" + sequence + ": " + msg); - } else { - msg = sequence; - router.log(msg); + var strings = _ref; + + var str = strings.map(function (string, index) { + var interpolated = values[index]; + return string + (interpolated !== undefined ? interpolated : ''); + }).join(''); + return str.split('\n').map(function (s) { + return s.trim(); + }).join(''); } -} +}); +enifed('internal-test-helpers/test-cases/abstract-application', ['exports', 'ember-metal', 'ember-views', 'ember-application', 'ember-routing', 'ember-template-compiler', 'internal-test-helpers/test-cases/abstract', 'internal-test-helpers/run'], function (exports, _emberMetal, _emberViews, _emberApplication, _emberRouting, _emberTemplateCompiler, _internalTestHelpersTestCasesAbstract, _internalTestHelpersRun) { + 'use strict'; -function bind(context, fn) { - var boundArgs = arguments; - return function(value) { - var args = slice.call(boundArgs, 2); - args.push(value); - return fn.apply(context, args); - }; -} + var AbstractApplicationTestCase = (function (_AbstractTestCase) { + babelHelpers.inherits(AbstractApplicationTestCase, _AbstractTestCase); -function isParam(object) { - return (typeof object === "string" || object instanceof String || typeof object === "number" || object instanceof Number); -} + function AbstractApplicationTestCase() { + babelHelpers.classCallCheck(this, AbstractApplicationTestCase); + _AbstractTestCase.call(this); -function forEach(array, callback) { - for (var i=0, l=array.length; i < l && false !== callback(array[i]); i++) { } -} + this.element = _emberViews.jQuery('#qunit-fixture')[0]; -function trigger(router, handlerInfos, ignoreFailure, args) { - if (router.triggerEvent) { - router.triggerEvent(handlerInfos, ignoreFailure, args); - return; - } + this.application = _emberMetal.run(_emberApplication.Application, 'create', this.applicationOptions); - var name = args.shift(); + this.router = this.application.Router = _emberRouting.Router.extend(this.routerOptions); - if (!handlerInfos) { - if (ignoreFailure) { return; } - throw new Error("Could not trigger event '" + name + "'. There are no active handlers"); - } + this.applicationInstance = null; + } - var eventWasHandled = false; + AbstractApplicationTestCase.prototype.teardown = function teardown() { + if (this.applicationInstance) { + _internalTestHelpersRun.runDestroy(this.applicationInstance); + } - function delayedEvent(name, args, handler) { - handler.events[name].apply(handler, args); - } + _internalTestHelpersRun.runDestroy(this.application); + }; - for (var i=handlerInfos.length-1; i>=0; i--) { - var handlerInfo = handlerInfos[i], - handler = handlerInfo.handler; + AbstractApplicationTestCase.prototype.visit = function visit(url, options) { + var _this = this; - // If there is no handler, it means the handler hasn't resolved yet which - // means that we should trigger the event later when the handler is available - if (!handler) { - handlerInfo.handlerPromise.then(bind(null, delayedEvent, name, args)); - continue; - } + var applicationInstance = this.applicationInstance; - if (handler.events && handler.events[name]) { - if (handler.events[name].apply(handler, args) === true) { - eventWasHandled = true; + if (applicationInstance) { + return _emberMetal.run(applicationInstance, 'visit', url, options); } else { - return; + return _emberMetal.run(this.application, 'visit', url, options).then(function (instance) { + _this.applicationInstance = instance; + }); } - } - } + }; - // In the case that we got an UnrecognizedURLError as an event with no handler, - // let it bubble up - if (name === 'error' && args[0].name === 'UnrecognizedURLError') { - throw args[0]; - } else if (!eventWasHandled && !ignoreFailure) { - throw new Error("Nothing handled the event '" + name + "'."); - } -} + AbstractApplicationTestCase.prototype.transitionTo = function transitionTo() { + return _emberMetal.run.apply(undefined, [this.appRouter, 'transitionTo'].concat(babelHelpers.slice.call(arguments))); + }; -function getChangelist(oldObject, newObject) { - var key; - var results = { - all: {}, - changed: {}, - removed: {} - }; + AbstractApplicationTestCase.prototype.compile = function compile(string, options) { + return _emberTemplateCompiler.compile.apply(undefined, arguments); + }; - merge(results.all, newObject); + AbstractApplicationTestCase.prototype.registerRoute = function registerRoute(name, route) { + this.application.register('route:' + name, route); + }; - var didChange = false; - coerceQueryParamsToString(oldObject); - coerceQueryParamsToString(newObject); + AbstractApplicationTestCase.prototype.registerTemplate = function registerTemplate(name, template) { + this.application.register('template:' + name, this.compile(template, { + moduleName: name + })); + }; - // Calculate removals - for (key in oldObject) { - if (oldObject.hasOwnProperty(key)) { - if (!newObject.hasOwnProperty(key)) { - didChange = true; - results.removed[key] = oldObject[key]; + AbstractApplicationTestCase.prototype.registerComponent = function registerComponent(name, _ref) { + var _ref$ComponentClass = _ref.ComponentClass; + var ComponentClass = _ref$ComponentClass === undefined ? null : _ref$ComponentClass; + var _ref$template = _ref.template; + var template = _ref$template === undefined ? null : _ref$template; + + if (ComponentClass) { + this.application.register('component:' + name, ComponentClass); } - } - } - // Calculate changes - for (key in newObject) { - if (newObject.hasOwnProperty(key)) { - if (isArray(oldObject[key]) && isArray(newObject[key])) { - if (oldObject[key].length !== newObject[key].length) { - results.changed[key] = newObject[key]; - didChange = true; - } else { - for (var i = 0, l = oldObject[key].length; i < l; i++) { - if (oldObject[key][i] !== newObject[key][i]) { - results.changed[key] = newObject[key]; - didChange = true; - } - } - } + if (typeof template === 'string') { + this.application.register('template:components/' + name, this.compile(template, { + moduleName: 'components/' + name + })); } - else { - if (oldObject[key] !== newObject[key]) { - results.changed[key] = newObject[key]; - didChange = true; - } + }; + + AbstractApplicationTestCase.prototype.registerController = function registerController(name, controller) { + this.application.register('controller:' + name, controller); + }; + + AbstractApplicationTestCase.prototype.registerEngine = function registerEngine(name, engine) { + this.application.register('engine:' + name, engine); + }; + + babelHelpers.createClass(AbstractApplicationTestCase, [{ + key: 'applicationOptions', + get: function () { + return { + rootElement: '#qunit-fixture', + autoboot: false + }; } - } - } + }, { + key: 'routerOptions', + get: function () { + return { + location: 'none' + }; + } + }, { + key: 'appRouter', + get: function () { + return this.applicationInstance.lookup('router:main'); + } + }]); + return AbstractApplicationTestCase; + })(_internalTestHelpersTestCasesAbstract.default); - return didChange && results; -} + exports.default = AbstractApplicationTestCase; +}); +enifed('internal-test-helpers/test-cases/abstract-rendering', ['exports', 'ember-utils', 'ember-template-compiler', 'ember-views', 'ember-glimmer', 'internal-test-helpers/test-cases/abstract', 'internal-test-helpers/build-owner', 'internal-test-helpers/run'], function (exports, _emberUtils, _emberTemplateCompiler, _emberViews, _emberGlimmer, _internalTestHelpersTestCasesAbstract, _internalTestHelpersBuildOwner, _internalTestHelpersRun) { + 'use strict'; -function promiseLabel(label) { - return 'Router: ' + label; -} + var TextNode = window.Text; -function subclass(parentConstructor, proto) { - function C(props) { - parentConstructor.call(this, props || {}); - } - C.prototype = oCreate(parentConstructor.prototype); - merge(C.prototype, proto); - return C; -} + var AbstractRenderingTestCase = (function (_AbstractTestCase) { + babelHelpers.inherits(AbstractRenderingTestCase, _AbstractTestCase); -function resolveHook(obj, hookName) { - if (!obj) { return; } - var underscored = "_" + hookName; - return obj[underscored] && underscored || - obj[hookName] && hookName; -} + function AbstractRenderingTestCase() { + babelHelpers.classCallCheck(this, AbstractRenderingTestCase); -function callHook(obj, _hookName, arg1, arg2) { - var hookName = resolveHook(obj, _hookName); - return hookName && obj[hookName].call(obj, arg1, arg2); -} + _AbstractTestCase.call(this); + var owner = this.owner = _internalTestHelpersBuildOwner.default({ + ownerOptions: this.getOwnerOptions(), + bootOptions: this.getBootOptions(), + resolver: this.getResolver() + }); -function applyHook(obj, _hookName, args) { - var hookName = resolveHook(obj, _hookName); - if (hookName) { - if (args.length === 0) { - return obj[hookName].call(obj); - } else if (args.length === 1) { - return obj[hookName].call(obj, args[0]); - } else if (args.length === 2) { - return obj[hookName].call(obj, args[0], args[1]); - } else { - return obj[hookName].apply(obj, args); + this.renderer = this.owner.lookup('renderer:-dom'); + this.element = _emberViews.jQuery('#qunit-fixture')[0]; + this.component = null; + + owner.register('event_dispatcher:main', _emberViews.EventDispatcher); + owner.inject('event_dispatcher:main', '_viewRegistry', '-view-registry:main'); + owner.lookup('event_dispatcher:main').setup(this.getCustomDispatcherEvents(), this.element); } - } -} -function TransitionState() { - this.handlerInfos = []; - this.queryParams = {}; - this.params = {}; -} + AbstractRenderingTestCase.prototype.compile = function compile() { + return _emberTemplateCompiler.compile.apply(undefined, arguments); + }; -TransitionState.prototype = { - promiseLabel: function(label) { - var targetName = ''; - forEach(this.handlerInfos, function(handlerInfo) { - if (targetName !== '') { - targetName += '.'; - } - targetName += handlerInfo.name; - }); - return promiseLabel("'" + targetName + "': " + label); - }, + AbstractRenderingTestCase.prototype.getCustomDispatcherEvents = function getCustomDispatcherEvents() { + return {}; + }; - resolve: function(shouldContinue, payload) { - // First, calculate params for this state. This is useful - // information to provide to the various route hooks. - var params = this.params; - forEach(this.handlerInfos, function(handlerInfo) { - params[handlerInfo.name] = handlerInfo.params || {}; - }); + AbstractRenderingTestCase.prototype.getOwnerOptions = function getOwnerOptions() {}; - payload = payload || {}; - payload.resolveIndex = 0; + AbstractRenderingTestCase.prototype.getBootOptions = function getBootOptions() {}; - var currentState = this; - var wasAborted = false; + AbstractRenderingTestCase.prototype.getResolver = function getResolver() {}; - // The prelude RSVP.resolve() asyncs us into the promise land. - return rsvp.Promise.resolve(null, this.promiseLabel("Start transition")) - .then(resolveOneHandlerInfo, null, this.promiseLabel('Resolve handler'))['catch'](handleError, this.promiseLabel('Handle error')); + AbstractRenderingTestCase.prototype.teardown = function teardown() { + if (this.component) { + _internalTestHelpersRun.runDestroy(this.component); + } + if (this.owner) { + _internalTestHelpersRun.runDestroy(this.owner); + } + }; - function innerShouldContinue() { - return rsvp.Promise.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 rsvp.Promise.reject(reason); - }, currentState.promiseLabel("Handle abort")); - } + AbstractRenderingTestCase.prototype.render = function render(templateStr) { + var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + var owner = this.owner; - function handleError(error) { - // This is the only possible - // reject value of TransitionState#resolve - var handlerInfos = currentState.handlerInfos; - var errorHandlerIndex = payload.resolveIndex >= handlerInfos.length ? - handlerInfos.length - 1 : payload.resolveIndex; - return rsvp.Promise.reject({ - error: error, - handlerWithError: currentState.handlerInfos[errorHandlerIndex].handler, - wasAborted: wasAborted, - state: currentState + owner.register('template:-top-level', this.compile(templateStr, { + moduleName: '-top-level' + })); + + var attrs = _emberUtils.assign({}, context, { + tagName: '', + layoutName: '-top-level' }); - } - function proceed(resolvedHandlerInfo) { - var wasAlreadyResolved = currentState.handlerInfos[payload.resolveIndex].isResolved; + owner.register('component:-top-level', _emberGlimmer.Component.extend(attrs)); - // Swap the previously unresolved handlerInfo with - // the resolved handlerInfo - currentState.handlerInfos[payload.resolveIndex++] = resolvedHandlerInfo; + this.component = owner.lookup('component:-top-level'); - if (!wasAlreadyResolved) { - // Call the redirect hook. The reason we call it here - // vs. afterModel is so that redirects into child - // routes don't re-run the model hooks for this - // already-resolved route. - var handler = resolvedHandlerInfo.handler; - callHook(handler, 'redirect', resolvedHandlerInfo.context, payload); + _internalTestHelpersRun.runAppend(this.component); + }; + + AbstractRenderingTestCase.prototype.rerender = function rerender() { + this.component.rerender(); + }; + + AbstractRenderingTestCase.prototype.registerHelper = function registerHelper(name, funcOrClassBody) { + var type = typeof funcOrClassBody; + + if (type === 'function') { + this.owner.register('helper:' + name, _emberGlimmer.helper(funcOrClassBody)); + } else if (type === 'object' && type !== null) { + this.owner.register('helper:' + name, _emberGlimmer.Helper.extend(funcOrClassBody)); + } else { + throw new Error('Cannot register ' + funcOrClassBody + ' as a helper'); } + }; - // Proceed after ensuring that the redirect hook - // didn't abort this transition by transitioning elsewhere. - return innerShouldContinue().then(resolveOneHandlerInfo, null, currentState.promiseLabel('Resolve handler')); - } + AbstractRenderingTestCase.prototype.registerPartial = function registerPartial(name, template) { + var owner = this.env.owner || this.owner; + if (typeof template === 'string') { + var moduleName = 'template:' + name; + owner.register(moduleName, this.compile(template, { moduleName: moduleName })); + } + }; - function resolveOneHandlerInfo() { - if (payload.resolveIndex === currentState.handlerInfos.length) { - // This is is the only possible - // fulfill value of TransitionState#resolve - return { - error: null, - state: currentState - }; + AbstractRenderingTestCase.prototype.registerComponent = function registerComponent(name, _ref) { + var _ref$ComponentClass = _ref.ComponentClass; + var ComponentClass = _ref$ComponentClass === undefined ? null : _ref$ComponentClass; + var _ref$template = _ref.template; + var template = _ref$template === undefined ? null : _ref$template; + var owner = this.owner; + + if (ComponentClass) { + owner.register('component:' + name, ComponentClass); } - var handlerInfo = currentState.handlerInfos[payload.resolveIndex]; + if (typeof template === 'string') { + owner.register('template:components/' + name, this.compile(template, { + moduleName: 'components/' + name + })); + } + }; - return handlerInfo.resolve(innerShouldContinue, payload) - .then(proceed, null, currentState.promiseLabel('Proceed')); - } - } -}; + AbstractRenderingTestCase.prototype.registerTemplate = function registerTemplate(name, template) { + var owner = this.owner; -/** - A Transition is a thennable (a promise-like object) that represents - an attempt to transition to another route. It can be aborted, either - explicitly via `abort` or by attempting another transition while a - previous one is still underway. An aborted transition can also - be `retry()`d later. + if (typeof template === 'string') { + owner.register('template:' + name, this.compile(template, { + moduleName: name + })); + } else { + throw new Error('Registered template "' + name + '" must be a string'); + } + }; - @class Transition - @constructor - @param {Object} router - @param {Object} intent - @param {Object} state - @param {Object} error - @private - */ -function Transition(router, intent, state, error, previousTransition) { - var transition = this; - this.state = state || router.state; - this.intent = intent; - this.router = router; - this.data = this.intent && this.intent.data || {}; - this.resolvedModels = {}; - this.queryParams = {}; - this.promise = undefined; - this.error = undefined; - this.params = undefined; - this.handlerInfos = undefined; - this.targetName = undefined; - this.pivotHandler = undefined; - this.sequence = undefined; - this.isAborted = false; - this.isActive = true; + AbstractRenderingTestCase.prototype.registerService = function registerService(name, klass) { + this.owner.register('service:' + name, klass); + }; - if (error) { - this.promise = rsvp.Promise.reject(error); - this.error = error; - return; - } + AbstractRenderingTestCase.prototype.assertTextNode = function assertTextNode(node, text) { + if (!(node instanceof TextNode)) { + throw new Error('Expecting a text node, but got ' + node); + } - // if you're doing multiple redirects, need the new transition to know if it - // is actually part of the first transition or not. Any further redirects - // in the initial transition also need to know if they are part of the - // initial transition - this.isCausedByAbortingTransition = !!previousTransition; - this.isCausedByInitialTransition = ( - previousTransition && ( - previousTransition.isCausedByInitialTransition || - previousTransition.sequence === 0 - ) - ); + this.assert.strictEqual(node.textContent, text, 'node.textContent'); + }; + + babelHelpers.createClass(AbstractRenderingTestCase, [{ + key: 'context', + get: function () { + return this.component; + } + }]); + return AbstractRenderingTestCase; + })(_internalTestHelpersTestCasesAbstract.default); - if (state) { - this.params = state.params; - this.queryParams = state.queryParams; - this.handlerInfos = state.handlerInfos; + exports.default = AbstractRenderingTestCase; +}); +enifed('internal-test-helpers/test-cases/abstract', ['exports', 'ember-utils', 'ember-metal', 'ember-views', 'internal-test-helpers/equal-inner-html', 'internal-test-helpers/equal-tokens', 'internal-test-helpers/matchers'], function (exports, _emberUtils, _emberMetal, _emberViews, _internalTestHelpersEqualInnerHtml, _internalTestHelpersEqualTokens, _internalTestHelpersMatchers) { + 'use strict'; - var len = state.handlerInfos.length; - if (len) { - this.targetName = state.handlerInfos[len-1].name; - } + var TextNode = window.Text; + var HTMLElement = window.HTMLElement; + var Comment = window.Comment; - for (var i = 0; i < len; ++i) { - var handlerInfo = state.handlerInfos[i]; + function isMarker(node) { + if (node instanceof Comment && node.textContent === '') { + return true; + } - // TODO: this all seems hacky - if (!handlerInfo.isResolved) { break; } - this.pivotHandler = handlerInfo.handler; + if (node instanceof TextNode && node.textContent === '') { + return true; } - this.sequence = router.currentSequence++; - this.promise = state.resolve(checkForAbort, this)['catch']( - catchHandlerForTransition(transition), promiseLabel('Handle Abort')); - } else { - this.promise = rsvp.Promise.resolve(this.state); - this.params = {}; + return false; } - function checkForAbort() { - if (transition.isAborted) { - return rsvp.Promise.reject(undefined, promiseLabel("Transition aborted - reject")); - } - } -} + var AbstractTestCase = (function () { + function AbstractTestCase() { + babelHelpers.classCallCheck(this, AbstractTestCase); -function catchHandlerForTransition(transition) { - return function(result) { - if (result.wasAborted || transition.isAborted) { - return rsvp.Promise.reject(logAbort(transition)); - } else { - transition.trigger('error', result.error, transition, result.handlerWithError); - transition.abort(); - return rsvp.Promise.reject(result.error); + this.element = null; + this.snapshot = null; + this.assert = QUnit.config.current.assert; } - }; -} + AbstractTestCase.prototype.teardown = function teardown() {}; -Transition.prototype = { - targetName: null, - urlMethod: 'update', - intent: null, - pivotHandler: null, - resolveIndex: 0, - resolvedModels: null, - state: null, - queryParamsOnly: false, + AbstractTestCase.prototype.runTask = function runTask(callback) { + _emberMetal.run(callback); + }; - isTransition: true, + AbstractTestCase.prototype.runTaskNext = function runTaskNext(callback) { + _emberMetal.run.next(callback); + }; - isExiting: function(handler) { - var handlerInfos = this.handlerInfos; - for (var i = 0, len = handlerInfos.length; i < len; ++i) { - var handlerInfo = handlerInfos[i]; - if (handlerInfo.name === handler || handlerInfo.handler === handler) { - return false; - } - } - return true; - }, + // The following methods require `this.element` to work - /** - The Transition's internal promise. Calling `.then` on this property - is that same as calling `.then` on the Transition object itself, but - this property is exposed for when you want to pass around a - Transition's promise, but not the Transition object itself, since - Transition object can be externally `abort`ed, while the promise - cannot. + AbstractTestCase.prototype.nthChild = function nthChild(n) { + var i = 0; + var node = this.element.firstChild; - @property promise - @type {Object} - @public - */ - promise: null, + while (node) { + if (!isMarker(node)) { + i++; + } - /** - Custom state can be stored on a Transition's `data` object. - This can be useful for decorating a Transition within an earlier - hook and shared with a later hook. Properties set on `data` will - be copied to new transitions generated by calling `retry` on this - transition. + if (i > n) { + break; + } else { + node = node.nextSibling; + } + } - @property data - @type {Object} - @public - */ - data: null, + return node; + }; - /** - A standard promise hook that resolves if the transition - succeeds and rejects if it fails/redirects/aborts. + AbstractTestCase.prototype.$ = function $(sel) { + return sel ? _emberViews.jQuery(sel, this.element) : _emberViews.jQuery(this.element); + }; - Forwards to the internal `promise` property which you can - use in situations where you want to pass around a thennable, - but not the Transition itself. + AbstractTestCase.prototype.textValue = function textValue() { + return this.$().text(); + }; - @method then - @param {Function} onFulfilled - @param {Function} onRejected - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - @public - */ - then: function(onFulfilled, onRejected, label) { - return this.promise.then(onFulfilled, onRejected, label); - }, + AbstractTestCase.prototype.takeSnapshot = function takeSnapshot() { + var snapshot = this.snapshot = []; - /** + var node = this.element.firstChild; - Forwards to the internal `promise` property which you can - use in situations where you want to pass around a thennable, - but not the Transition itself. + while (node) { + if (!isMarker(node)) { + snapshot.push(node); + } - @method catch - @param {Function} onRejection - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - @public - */ - catch: function(onRejection, label) { - return this.promise.catch(onRejection, label); - }, + node = node.nextSibling; + } - /** + return snapshot; + }; - Forwards to the internal `promise` property which you can - use in situations where you want to pass around a thennable, - but not the Transition itself. + AbstractTestCase.prototype.assertText = function assertText(text) { + this.assert.strictEqual(this.textValue(), text, '#qunit-fixture content should be: `' + text + '`'); + }; - @method finally - @param {Function} callback - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - @public - */ - finally: function(callback, label) { - return this.promise.finally(callback, label); - }, + AbstractTestCase.prototype.assertInnerHTML = function assertInnerHTML(html) { + _internalTestHelpersEqualInnerHtml.default(this.element, html); + }; - /** - Aborts the Transition. Note you can also implicitly abort a transition - by initiating another transition while a previous one is underway. + AbstractTestCase.prototype.assertHTML = function assertHTML(html) { + _internalTestHelpersEqualTokens.default(this.element, html, '#qunit-fixture content should be: `' + html + '`'); + }; - @method abort - @return {Transition} this transition - @public - */ - abort: function() { - if (this.isAborted) { return this; } - 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; - }, + AbstractTestCase.prototype.assertElement = function assertElement(node, _ref) { + var _ref$ElementType = _ref.ElementType; + var ElementType = _ref$ElementType === undefined ? HTMLElement : _ref$ElementType; + var tagName = _ref.tagName; + var _ref$attrs = _ref.attrs; + var attrs = _ref$attrs === undefined ? null : _ref$attrs; + var _ref$content = _ref.content; + var content = _ref$content === undefined ? null : _ref$content; - /** + if (!(node instanceof ElementType)) { + throw new Error('Expecting a ' + ElementType.name + ', but got ' + node); + } - Retries a previously-aborted transition (making sure to abort the - transition if it's still active). Returns a new transition that - represents the new attempt to transition. + _internalTestHelpersMatchers.equalsElement(node, tagName, attrs, content); + }; - @method retry - @return {Transition} new transition - @public - */ - retry: function() { - // TODO: add tests for merged state retry()s - this.abort(); - return this.router.transitionByIntent(this.intent, false); - }, + AbstractTestCase.prototype.assertComponentElement = function assertComponentElement(node, _ref2) { + var _ref2$ElementType = _ref2.ElementType; + var ElementType = _ref2$ElementType === undefined ? HTMLElement : _ref2$ElementType; + var _ref2$tagName = _ref2.tagName; + var tagName = _ref2$tagName === undefined ? 'div' : _ref2$tagName; + var _ref2$attrs = _ref2.attrs; + var attrs = _ref2$attrs === undefined ? null : _ref2$attrs; + var _ref2$content = _ref2.content; + var content = _ref2$content === undefined ? null : _ref2$content; - /** + attrs = _emberUtils.assign({}, { id: _internalTestHelpersMatchers.regex(/^ember\d*$/), class: _internalTestHelpersMatchers.classes('ember-view') }, attrs || {}); + this.assertElement(node, { ElementType: ElementType, tagName: tagName, attrs: attrs, content: content }); + }; - Sets the URL-changing method to be employed at the end of a - successful transition. By default, a new Transition will just - use `updateURL`, but passing 'replace' to this method will - cause the URL to update using 'replaceWith' instead. Omitting - a parameter will disable the URL change, allowing for transitions - that don't update the URL at completion (this is also used for - handleURL, since the URL has already changed before the - transition took place). + AbstractTestCase.prototype.assertSameNode = function assertSameNode(actual, expected) { + this.assert.strictEqual(actual, expected, 'DOM node stability'); + }; - @method method - @param {String} method the type of URL-changing method to use - at the end of a transition. Accepted values are 'replace', - falsy values, or any other non-falsy value (which is - interpreted as an updateURL transition). + AbstractTestCase.prototype.assertInvariants = function assertInvariants(oldSnapshot, newSnapshot) { + oldSnapshot = oldSnapshot || this.snapshot; + newSnapshot = newSnapshot || this.takeSnapshot(); - @return {Transition} this transition - @public - */ - method: function(method) { - this.urlMethod = method; - return this; - }, + this.assert.strictEqual(newSnapshot.length, oldSnapshot.length, 'Same number of nodes'); - /** + for (var i = 0; i < oldSnapshot.length; i++) { + this.assertSameNode(newSnapshot[i], oldSnapshot[i]); + } + }; - Fires an event on the current list of resolved/resolving - handlers within this transition. Useful for firing events - on route hierarchies that haven't fully been entered yet. + AbstractTestCase.prototype.assertPartialInvariants = function assertPartialInvariants(start, end) { + this.assertInvariants(this.snapshot, this.takeSnapshot().slice(start, end)); + }; - Note: This method is also aliased as `send` + AbstractTestCase.prototype.assertStableRerender = function assertStableRerender() { + var _this = this; - @method trigger - @param {Boolean} [ignoreFailure=false] a boolean specifying whether unhandled events throw an error - @param {String} name the name of the event to fire - @public - */ - trigger: function (ignoreFailure) { - var args = slice.call(arguments); - if (typeof ignoreFailure === 'boolean') { - args.shift(); - } else { - // Throw errors on unhandled trigger events by default - ignoreFailure = false; - } - trigger(this.router, this.state.handlerInfos.slice(0, this.resolveIndex + 1), ignoreFailure, args); - }, + this.takeSnapshot(); + this.runTask(function () { + return _this.rerender(); + }); + this.assertInvariants(); + }; - /** - Transitions are aborted and their promises rejected - when redirects occur; this method returns a promise - that will follow any redirects that occur and fulfill - with the value fulfilled by any redirecting transitions - that occur. + babelHelpers.createClass(AbstractTestCase, [{ + key: 'firstChild', + get: function () { + return this.nthChild(0); + } + }, { + key: 'nodesCount', + get: function () { + var count = 0; + var node = this.element.firstChild; - @method followRedirects - @return {Promise} a promise that fulfills with the same - value that the final redirecting transition fulfills with - @public - */ - followRedirects: function() { - var router = this.router; - return this.promise['catch'](function(reason) { - if (router.activeTransition) { - return router.activeTransition.followRedirects(); + while (node) { + if (!isMarker(node)) { + count++; + } + + node = node.nextSibling; + } + + return count; } - return rsvp.Promise.reject(reason); - }); - }, + }]); + return AbstractTestCase; + })(); - toString: function() { - return "Transition (sequence " + this.sequence + ")"; - }, + exports.default = AbstractTestCase; +}); +enifed('internal-test-helpers/test-cases/application', ['exports', 'internal-test-helpers/test-cases/abstract-application'], function (exports, _internalTestHelpersTestCasesAbstractApplication) { + 'use strict'; - /** - @private - */ - log: function(message) { - log(this.router, this.sequence, message); - } -}; + var ApplicationTestCase = (function (_AbstractApplicationTestCase) { + babelHelpers.inherits(ApplicationTestCase, _AbstractApplicationTestCase); -// Alias 'trigger' as 'send' -Transition.prototype.send = Transition.prototype.trigger; + function ApplicationTestCase() { + babelHelpers.classCallCheck(this, ApplicationTestCase); -/** - @private + _AbstractApplicationTestCase.apply(this, arguments); + } - Logs and returns a TransitionAborted error. - */ -function logAbort(transition) { - log(transition.router, transition.sequence, "detected abort."); - return new TransitionAborted(); -} + return ApplicationTestCase; + })(_internalTestHelpersTestCasesAbstractApplication.default); -function TransitionAborted(message) { - this.message = (message || "TransitionAborted"); - this.name = "TransitionAborted"; -} + exports.default = ApplicationTestCase; +}); +enifed('internal-test-helpers/test-cases/query-param', ['exports', 'ember-runtime', 'ember-routing', 'ember-metal', 'internal-test-helpers/test-cases/application'], function (exports, _emberRuntime, _emberRouting, _emberMetal, _internalTestHelpersTestCasesApplication) { + 'use strict'; -function TransitionIntent(props) { - this.initialize(props); + var QueryParamTestCase = (function (_ApplicationTestCase) { + babelHelpers.inherits(QueryParamTestCase, _ApplicationTestCase); - // TODO: wat - this.data = this.data || {}; -} + function QueryParamTestCase() { + babelHelpers.classCallCheck(this, QueryParamTestCase); -TransitionIntent.prototype = { - initialize: null, - applyToState: null -}; + _ApplicationTestCase.call(this); -var DEFAULT_HANDLER = Object.freeze({}); + var testCase = this; + testCase.expectedPushURL = null; + testCase.expectedReplaceURL = null; + this.application.register('location:test', _emberRouting.NoneLocation.extend({ + setURL: function (path) { + if (testCase.expectedReplaceURL) { + testCase.assert.ok(false, 'pushState occurred but a replaceState was expected'); + } -function HandlerInfo(_props) { - var props = _props || {}; + if (testCase.expectedPushURL) { + testCase.assert.equal(path, testCase.expectedPushURL, 'an expected pushState occurred'); + testCase.expectedPushURL = null; + } - // Set a default handler to ensure consistent object shape - this._handler = DEFAULT_HANDLER; + this.set('path', path); + }, - if (props.handler) { - var name = props.name; + replaceURL: function (path) { + if (testCase.expectedPushURL) { + testCase.assert.ok(false, 'replaceState occurred but a pushState was expected'); + } - // Setup a handlerPromise so that we can wait for asynchronously loaded handlers - this.handlerPromise = rsvp.Promise.resolve(props.handler); + if (testCase.expectedReplaceURL) { + testCase.assert.equal(path, testCase.expectedReplaceURL, 'an expected replaceState occurred'); + testCase.expectedReplaceURL = null; + } - // Wait until the 'handler' property has been updated when chaining to a handler - // that is a promise - if (isPromise(props.handler)) { - this.handlerPromise = this.handlerPromise.then(bind(this, this.updateHandler)); - props.handler = undefined; - } else if (props.handler) { - // Store the name of the handler on the handler for easy checks later - props.handler._handlerName = name; + this.set('path', path); + } + })); } - } - merge(this, props); - this.initialize(props); -} + QueryParamTestCase.prototype.visitAndAssert = function visitAndAssert(path) { + var _this = this; -HandlerInfo.prototype = { - name: null, + return this.visit.apply(this, arguments).then(function () { + _this.assertCurrentPath(path); + }); + }; - getHandler: function() {}, + QueryParamTestCase.prototype.getController = function getController(name) { + return this.applicationInstance.lookup('controller:' + name); + }; - fetchHandler: function() { - var handler = this.getHandler(this.name); + QueryParamTestCase.prototype.getRoute = function getRoute(name) { + return this.applicationInstance.lookup('route:' + name); + }; - // Setup a handlerPromise so that we can wait for asynchronously loaded handlers - this.handlerPromise = rsvp.Promise.resolve(handler); + QueryParamTestCase.prototype.setAndFlush = function setAndFlush(obj, prop, value) { + return _emberMetal.run(obj, 'set', prop, value); + }; - // Wait until the 'handler' property has been updated when chaining to a handler - // that is a promise - if (isPromise(handler)) { - this.handlerPromise = this.handlerPromise.then(bind(this, this.updateHandler)); - } else if (handler) { - // Store the name of the handler on the handler for easy checks later - handler._handlerName = this.name; - return this.handler = handler; - } + QueryParamTestCase.prototype.assertCurrentPath = function assertCurrentPath(path) { + var message = arguments.length <= 1 || arguments[1] === undefined ? 'current path equals \'' + path + '\'' : arguments[1]; + return (function () { + this.assert.equal(this.appRouter.get('location.path'), path, message); + }).apply(this, arguments); + }; - return this.handler = undefined; - }, + /** + Sets up a Controller for a given route with a single query param and default + value. Can optionally extend the controller with an object. + @public + @method setSingleQPController + */ - _handlerPromise: undefined, + QueryParamTestCase.prototype.setSingleQPController = function setSingleQPController(routeName) { + var param = arguments.length <= 1 || arguments[1] === undefined ? 'foo' : arguments[1]; + var defaultValue = arguments.length <= 2 || arguments[2] === undefined ? 'bar' : arguments[2]; - params: null, - context: null, + var _Controller$extend; + + var options = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3]; + + this.registerController(routeName, _emberRuntime.Controller.extend((_Controller$extend = { + queryParams: [param] + }, _Controller$extend[param] = defaultValue, _Controller$extend), options)); + }; + + /** + Sets up a Controller for a given route with a custom property/url key mapping. + @public + @method setMappedQPController + */ - // Injected by the handler info factory. - factory: null, + QueryParamTestCase.prototype.setMappedQPController = function setMappedQPController(routeName) { + var prop = arguments.length <= 1 || arguments[1] === undefined ? 'page' : arguments[1]; + var urlKey = arguments.length <= 2 || arguments[2] === undefined ? 'parentPage' : arguments[2]; + var defaultValue = arguments.length <= 3 || arguments[3] === undefined ? 1 : arguments[3]; - initialize: function() {}, + var _queryParams, _Controller$extend2; - log: function(payload, message) { - if (payload.log) { - payload.log(this.name + ': ' + message); - } - }, + var options = arguments.length <= 4 || arguments[4] === undefined ? {} : arguments[4]; - promiseLabel: function(label) { - return promiseLabel("'" + this.name + "' " + label); - }, + this.registerController(routeName, _emberRuntime.Controller.extend((_Controller$extend2 = { + queryParams: (_queryParams = {}, _queryParams[prop] = urlKey, _queryParams) + }, _Controller$extend2[prop] = defaultValue, _Controller$extend2), options)); + }; - getUnresolved: function() { - return this; - }, + babelHelpers.createClass(QueryParamTestCase, [{ + key: 'routerOptions', + get: function () { + return { + location: 'test' + }; + } + }]); + return QueryParamTestCase; + })(_internalTestHelpersTestCasesApplication.default); - serialize: function() { - return this.params || {}; - }, + exports.default = QueryParamTestCase; +}); +enifed('internal-test-helpers/test-cases/rendering', ['exports', 'ember-views', 'internal-test-helpers/test-cases/abstract-rendering'], function (exports, _emberViews, _internalTestHelpersTestCasesAbstractRendering) { + 'use strict'; - updateHandler: function(handler) { - // Store the name of the handler on the handler for easy checks later - handler._handlerName = this.name; - return this.handler = handler; - }, + var RenderingTestCase = (function (_AbstractRenderingTestCase) { + babelHelpers.inherits(RenderingTestCase, _AbstractRenderingTestCase); - resolve: function(shouldContinue, payload) { - var checkForAbort = bind(this, this.checkForAbort, shouldContinue), - beforeModel = bind(this, this.runBeforeModelHook, payload), - model = bind(this, this.getModel, payload), - afterModel = bind(this, this.runAfterModelHook, payload), - becomeResolved = bind(this, this.becomeResolved, payload), - self = this; + function RenderingTestCase() { + babelHelpers.classCallCheck(this, RenderingTestCase); - return rsvp.Promise.resolve(this.handlerPromise, this.promiseLabel("Start handler")) - .then(function(handler) { - // We nest this chain in case the handlerPromise has an error so that - // we don't have to bubble it through every step - return rsvp.Promise.resolve(handler) - .then(checkForAbort, null, self.promiseLabel("Check for abort")) - .then(beforeModel, null, self.promiseLabel("Before model")) - .then(checkForAbort, null, self.promiseLabel("Check if aborted during 'beforeModel' hook")) - .then(model, null, self.promiseLabel("Model")) - .then(checkForAbort, null, self.promiseLabel("Check if aborted in 'model' hook")) - .then(afterModel, null, self.promiseLabel("After model")) - .then(checkForAbort, null, self.promiseLabel("Check if aborted in 'afterModel' hook")) - .then(becomeResolved, null, self.promiseLabel("Become resolved")); - }, function(error) { - throw error; - }); - }, + _AbstractRenderingTestCase.call(this); + var owner = this.owner; - runBeforeModelHook: function(payload) { - if (payload.trigger) { - payload.trigger(true, 'willResolveModel', payload, this.handler); + this.env = owner.lookup('service:-glimmer-environment'); + owner.register('component-lookup:main', _emberViews.ComponentLookup); + owner.registerOptionsForType('helper', { instantiate: false }); + owner.registerOptionsForType('component', { singleton: false }); } - return this.runSharedModelHook(payload, 'beforeModel', []); - }, - runAfterModelHook: function(payload, resolvedModel) { - // Stash the resolved model on the payload. - // This makes it possible for users to swap out - // the resolved model in afterModel. - var name = this.name; - this.stashResolvedModel(payload, resolvedModel); + return RenderingTestCase; + })(_internalTestHelpersTestCasesAbstractRendering.default); - 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")); - }, + exports.default = RenderingTestCase; +}); +enifed('internal-test-helpers/test-cases/router', ['exports', 'internal-test-helpers/test-cases/application'], function (exports, _internalTestHelpersTestCasesApplication) { + 'use strict'; - runSharedModelHook: function(payload, hookName, args) { - this.log(payload, "calling " + hookName + " hook"); + var RouterTestCase = (function (_ApplicationTestCase) { + babelHelpers.inherits(RouterTestCase, _ApplicationTestCase); - if (this.queryParams) { - args.push(this.queryParams); - } - args.push(payload); + function RouterTestCase() { + babelHelpers.classCallCheck(this, RouterTestCase); - var result = applyHook(this.handler, hookName, args); + _ApplicationTestCase.call(this); - if (result && result.isTransition) { - result = null; + this.router.map(function () { + this.route('parent', { path: '/' }, function () { + this.route('child'); + this.route('sister'); + this.route('brother'); + }); + this.route('dynamic', { path: '/dynamic/:post_id' }); + }); } - return rsvp.Promise.resolve(result, this.promiseLabel("Resolve value returned from one of the model hooks")); - }, - - // overridden by subclasses - getModel: null, + babelHelpers.createClass(RouterTestCase, [{ + key: 'routerService', + get: function () { + return this.applicationInstance.lookup('service:router'); + } + }]); + return RouterTestCase; + })(_internalTestHelpersTestCasesApplication.default); - checkForAbort: function(shouldContinue, promiseValue) { - return rsvp.Promise.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")); - }, + exports.default = RouterTestCase; +}); +enifed('internal-test-helpers/test-groups', ['exports', 'ember-environment', 'ember-metal'], function (exports, _emberEnvironment, _emberMetal) { + 'use strict'; - stashResolvedModel: function(payload, resolvedModel) { - payload.resolvedModels = payload.resolvedModels || {}; - payload.resolvedModels[this.name] = resolvedModel; - }, + exports.testBoth = testBoth; + exports.testWithDefault = testWithDefault; - becomeResolved: function(payload, resolvedContext) { - var params = this.serialize(resolvedContext); + // used by unit tests to test both accessor mode and non-accessor mode - if (payload) { - this.stashResolvedModel(payload, resolvedContext); - payload.params = payload.params || {}; - payload.params[this.name] = params; + function testBoth(testname, callback) { + function emberget(x, y) { + return _emberMetal.get(x, y); + } + function emberset(x, y, z) { + return _emberMetal.set(x, y, z); + } + function aget(x, y) { + return x[y]; + } + function aset(x, y, z) { + return x[y] = z; } - return this.factory('resolved', { - context: resolvedContext, - name: this.name, - handler: this.handler, - params: params + QUnit.test(testname + ' using getFromEmberMetal()/Ember.set()', function () { + callback(emberget, emberset); }); - }, - - shouldSupercede: function(other) { - // Prefer this newer handlerInfo over `other` if: - // 1) The other one doesn't exist - // 2) The names don't match - // 3) This handler has a context that doesn't match - // the other one (or the other one doesn't have one). - // 4) This handler has parameters that don't match the other. - if (!other) { return true; } - var contextsMatch = (other.context === this.context); - return other.name !== this.name || - (this.hasOwnProperty('context') && !contextsMatch) || - (this.hasOwnProperty('params') && !paramsMatch(this.params, other.params)); + QUnit.test(testname + ' using accessors', function () { + if (_emberEnvironment.ENV.USES_ACCESSORS) { + callback(aget, aset); + } else { + ok('SKIPPING ACCESSORS'); + } + }); } -}; -Object.defineProperty(HandlerInfo.prototype, 'handler', { - get: function() { - // _handler could be set to either a handler object or undefined, so we - // compare against a default reference to know when it's been set - if (this._handler !== DEFAULT_HANDLER) { - return this._handler; + function testWithDefault(testname, callback) { + function emberget(x, y) { + return _emberMetal.get(x, y); + } + function embergetwithdefault(x, y, z) { + return _emberMetal.getWithDefault(x, y, z); + } + function getwithdefault(x, y, z) { + return x.getWithDefault(y, z); + } + function emberset(x, y, z) { + return _emberMetal.set(x, y, z); + } + function aget(x, y) { + return x[y]; + } + function aset(x, y, z) { + return x[y] = z; } - return this.fetchHandler(); - }, - - set: function(handler) { - return this._handler = handler; - } -}); + QUnit.test(testname + ' using obj.get()', function () { + callback(emberget, emberset); + }); -Object.defineProperty(HandlerInfo.prototype, 'handlerPromise', { - get: function() { - if (this._handlerPromise) { - return this._handlerPromise; - } + QUnit.test(testname + ' using obj.getWithDefault()', function () { + callback(getwithdefault, emberset); + }); - this.fetchHandler(); + QUnit.test(testname + ' using getFromEmberMetal()', function () { + callback(emberget, emberset); + }); - return this._handlerPromise; - }, + QUnit.test(testname + ' using Ember.getWithDefault()', function () { + callback(embergetwithdefault, emberset); + }); - set: function(handlerPromise) { - return this._handlerPromise = handlerPromise; + QUnit.test(testname + ' using accessors', function () { + if (_emberEnvironment.ENV.USES_ACCESSORS) { + callback(aget, aset); + } else { + ok('SKIPPING ACCESSORS'); + } + }); } }); +enifed('route-recognizer', ['exports'], function (exports) { 'use strict'; -function paramsMatch(a, b) { - if ((!a) ^ (!b)) { - // Only one is null. - return false; - } - - if (!a) { - // Both must be null. - return true; - } +var createObject = Object.create; +function createMap() { + var map = createObject(null); + map["__"] = undefined; + delete map["__"]; + return map; +} - // Note: this assumes that both params have the same - // number of keys, but since we're comparing the - // same handlers, they should. - for (var k in a) { - if (a.hasOwnProperty(k) && a[k] !== b[k]) { - return false; +var Target = function Target(path, matcher, delegate) { + this.path = path; + this.matcher = matcher; + this.delegate = delegate; +}; +Target.prototype.to = function to (target, callback) { + var delegate = this.delegate; + if (delegate && delegate.willAddRoute) { + target = delegate.willAddRoute(this.matcher.target, target); } - } - return true; + this.matcher.add(this.path, target); + if (callback) { + if (callback.length === 0) { + throw new Error("You must have an argument in the function passed to `to`"); + } + this.matcher.addChild(this.path, target, callback, this.delegate); + } +}; +var Matcher = function Matcher(target) { + this.routes = createMap(); + this.children = createMap(); + this.target = target; +}; +Matcher.prototype.add = function add (path, target) { + this.routes[path] = target; +}; +Matcher.prototype.addChild = function addChild (path, target, callback, delegate) { + var matcher = new Matcher(target); + this.children[path] = matcher; + var match = generateMatch(path, matcher, delegate); + if (delegate && delegate.contextEntered) { + delegate.contextEntered(target, match); + } + callback(match); +}; +function generateMatch(startingPath, matcher, delegate) { + function match(path, callback) { + var fullPath = startingPath + path; + if (callback) { + callback(generateMatch(fullPath, matcher, delegate)); + } + else { + return new Target(fullPath, matcher, delegate); + } + } + ; + return match; } - -var ResolvedHandlerInfo = subclass(HandlerInfo, { - resolve: function(shouldContinue, payload) { - // A ResolvedHandlerInfo just resolved with itself. - if (payload && payload.resolvedModels) { - payload.resolvedModels[this.name] = this.context; +function addRoute(routeArray, path, handler) { + var len = 0; + for (var i = 0; i < routeArray.length; i++) { + len += routeArray[i].path.length; } - return rsvp.Promise.resolve(this, this.promiseLabel("Resolve")); - }, - - getUnresolved: function() { - return this.factory('param', { - name: this.name, - handler: this.handler, - params: this.params - }); - }, - - isResolved: true -}); - -var UnresolvedHandlerInfoByObject = subclass(HandlerInfo, { - getModel: function(payload) { - this.log(payload, this.name + ": resolving provided model"); - return rsvp.Promise.resolve(this.context); - }, - - initialize: function(props) { - this.names = props.names || []; - this.context = props.context; - }, + path = path.substr(len); + var route = { path: path, handler: handler }; + routeArray.push(route); +} +function eachRoute(baseRoute, matcher, callback, binding) { + var routes = matcher.routes; + var paths = Object.keys(routes); + for (var i = 0; i < paths.length; i++) { + var path = paths[i]; + var routeArray = baseRoute.slice(); + addRoute(routeArray, path, routes[path]); + var nested = matcher.children[path]; + if (nested) { + eachRoute(routeArray, nested, callback, binding); + } + else { + callback.call(binding, routeArray); + } + } +} +function map (callback, addRouteCallback) { + var matcher = new Matcher(); + callback(generateMatch("", matcher, this.delegate)); + eachRoute([], matcher, function (routes) { + if (addRouteCallback) { + addRouteCallback(this, routes); + } + else { + this.add(routes); + } + }, this); +} - /** - @private +// Normalizes percent-encoded values in `path` to upper-case and decodes percent-encoded +// values that are not reserved (i.e., unicode characters, emoji, etc). The reserved +// chars are "/" and "%". +// Safe to call multiple times on the same path. +// Normalizes percent-encoded values in `path` to upper-case and decodes percent-encoded +function normalizePath(path) { + return path.split("/") + .map(normalizeSegment) + .join("/"); +} +// We want to ensure the characters "%" and "/" remain in percent-encoded +// form when normalizing paths, so replace them with their encoded form after +// decoding the rest of the path +var SEGMENT_RESERVED_CHARS = /%|\//g; +function normalizeSegment(segment) { + if (segment.length < 3 || segment.indexOf("%") === -1) + { return segment; } + return decodeURIComponent(segment).replace(SEGMENT_RESERVED_CHARS, encodeURIComponent); +} +// We do not want to encode these characters when generating dynamic path segments +// See https://tools.ietf.org/html/rfc3986#section-3.3 +// sub-delims: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=" +// others allowed by RFC 3986: ":", "@" +// +// First encode the entire path segment, then decode any of the encoded special chars. +// +// The chars "!", "'", "(", ")", "*" do not get changed by `encodeURIComponent`, +// so the possible encoded chars are: +// ['%24', '%26', '%2B', '%2C', '%3B', '%3D', '%3A', '%40']. +var PATH_SEGMENT_ENCODINGS = /%(?:2(?:4|6|B|C)|3(?:B|D|A)|40)/g; +function encodePathSegment(str) { + return encodeURIComponent(str).replace(PATH_SEGMENT_ENCODINGS, decodeURIComponent); +} - Serializes a handler using its custom `serialize` method or - by a default that looks up the expected property name from - the dynamic segment. +var escapeRegex = /(\/|\.|\*|\+|\?|\||\(|\)|\[|\]|\{|\}|\\)/g; +var isArray = Array.isArray; +var hasOwnProperty = Object.prototype.hasOwnProperty; +function getParam(params, key) { + if (typeof params !== "object" || params === null) { + throw new Error("You must pass an object as the second argument to `generate`."); + } + if (!hasOwnProperty.call(params, key)) { + throw new Error("You must provide param `" + key + "` to `generate`."); + } + var value = params[key]; + var str = typeof value === "string" ? value : "" + value; + if (str.length === 0) { + throw new Error("You must provide a param `" + key + "`."); + } + return str; +} +var eachChar = []; +eachChar[0 /* Static */] = function (segment, currentState) { + var state = currentState; + var value = segment.value; + for (var i = 0; i < value.length; i++) { + var ch = value.charCodeAt(i); + state = state.put(ch, false, false); + } + return state; +}; +eachChar[1 /* Dynamic */] = function (_, currentState) { + return currentState.put(47 /* SLASH */, true, true); +}; +eachChar[2 /* Star */] = function (_, currentState) { + return currentState.put(-1 /* ANY */, false, true); +}; +eachChar[4 /* Epsilon */] = function (_, currentState) { + return currentState; +}; +var regex = []; +regex[0 /* Static */] = function (segment) { + return segment.value.replace(escapeRegex, "\\$1"); +}; +regex[1 /* Dynamic */] = function () { + return "([^/]+)"; +}; +regex[2 /* Star */] = function () { + return "(.+)"; +}; +regex[4 /* Epsilon */] = function () { + return ""; +}; +var generate = []; +generate[0 /* Static */] = function (segment) { + return segment.value; +}; +generate[1 /* Dynamic */] = function (segment, params) { + var value = getParam(params, segment.value); + if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS) { + return encodePathSegment(value); + } + else { + return value; + } +}; +generate[2 /* Star */] = function (segment, params) { + return getParam(params, segment.value); +}; +generate[4 /* Epsilon */] = function () { + return ""; +}; +// The `names` will be populated with the paramter name for each dynamic/star +// segment. `shouldDecodes` will be populated with a boolean for each dyanamic/star +// segment, indicating whether it should be decoded during recognition. +function parse(segments, route, names, types, shouldDecodes) { + // normalize route as not starting with a "/". Recognition will + // also normalize. + if (route.length > 0 && route.charCodeAt(0) === 47 /* SLASH */) { + route = route.substr(1); + } + var parts = route.split("/"); + for (var i = 0; i < parts.length; i++) { + var part = parts[i]; + var flags = 0; + var type = 0; + if (part === "") { + type = 4 /* Epsilon */; + } + else if (part.charCodeAt(0) === 58 /* COLON */) { + type = 1 /* Dynamic */; + } + else if (part.charCodeAt(0) === 42 /* STAR */) { + type = 2 /* Star */; + } + else { + type = 0 /* Static */; + } + flags = 2 << type; + if (flags & 12 /* Named */) { + part = part.slice(1); + names.push(part); + shouldDecodes.push((flags & 4 /* Decoded */) !== 0); + } + if (flags & 14 /* Counted */) { + types[type]++; + } + segments.push({ type: type, value: normalizeSegment(part) }); + } +} +function isEqualCharSpec(spec, char, negate) { + return spec.char === char && spec.negate === negate; +} +// A State has a character specification and (`charSpec`) and a list of possible +// subsequent states (`nextStates`). +// +// If a State is an accepting state, it will also have several additional +// properties: +// +// * `regex`: A regular expression that is used to extract parameters from paths +// that reached this accepting state. +// * `handlers`: Information on how to convert the list of captures into calls +// to registered handlers with the specified parameters +// * `types`: How many static, dynamic or star segments in this route. Used to +// decide which route to use if multiple registered routes match a path. +// +// Currently, State is implemented naively by looping over `nextStates` and +// comparing a character specification against a character. A more efficient +// implementation would use a hash of keys pointing at one or more next states. +var State = function State(states, id, char, negate, repeat) { + this.states = states; + this.id = id; + this.char = char; + this.negate = negate; + this.nextStates = repeat ? id : null; + this.pattern = ""; + this._regex = undefined; + this.handlers = undefined; + this.types = undefined; +}; +State.prototype.regex = function regex$1 () { + if (!this._regex) { + this._regex = new RegExp(this.pattern); + } + return this._regex; +}; +State.prototype.get = function get (char, negate) { + var this$1 = this; - @param {Object} model the model to be serialized for this handler - */ - serialize: function(_model) { - var model = _model || this.context, - names = this.names, - serializer = this.serializer || (this.handler && this.handler.serialize); + var nextStates = this.nextStates; + if (nextStates === null) + { return; } + if (isArray(nextStates)) { + for (var i = 0; i < nextStates.length; i++) { + var child = this$1.states[nextStates[i]]; + if (isEqualCharSpec(child, char, negate)) { + return child; + } + } + } + else { + var child$1 = this.states[nextStates]; + if (isEqualCharSpec(child$1, char, negate)) { + return child$1; + } + } +}; +State.prototype.put = function put (char, negate, repeat) { + var state; + // If the character specification already exists in a child of the current + // state, just return that state. + if (state = this.get(char, negate)) { + return state; + } + // Make a new state for the character spec + var states = this.states; + state = new State(states, states.length, char, negate, repeat); + states[states.length] = state; + // Insert the new state as a child of the current state + if (this.nextStates == null) { + this.nextStates = state.id; + } + else if (isArray(this.nextStates)) { + this.nextStates.push(state.id); + } + else { + this.nextStates = [this.nextStates, state.id]; + } + // Return the new state + return state; +}; +// Find a list of child states matching the next character +State.prototype.match = function match (ch) { + var this$1 = this; - var object = {}; - if (isParam(model)) { - object[names[0]] = model; - return object; + var nextStates = this.nextStates; + if (!nextStates) + { return []; } + var returned = []; + if (isArray(nextStates)) { + for (var i = 0; i < nextStates.length; i++) { + var child = this$1.states[nextStates[i]]; + if (isMatch(child, ch)) { + returned.push(child); + } + } + } + else { + var child$1 = this.states[nextStates]; + if (isMatch(child$1, ch)) { + returned.push(child$1); + } + } + return returned; +}; +function isMatch(spec, char) { + return spec.negate ? spec.char !== char && spec.char !== -1 /* ANY */ : spec.char === char || spec.char === -1 /* ANY */; +} +// This is a somewhat naive strategy, but should work in a lot of cases +// A better strategy would properly resolve /posts/:id/new and /posts/edit/:id. +// +// This strategy generally prefers more static and less dynamic matching. +// Specifically, it +// +// * prefers fewer stars to more, then +// * prefers using stars for less of the match to more, then +// * prefers fewer dynamic segments to more, then +// * prefers more static segments to more +function sortSolutions(states) { + return states.sort(function (a, b) { + var ref = a.types || [0, 0, 0]; + var astatics = ref[0]; + var adynamics = ref[1]; + var astars = ref[2]; + var ref$1 = b.types || [0, 0, 0]; + var bstatics = ref$1[0]; + var bdynamics = ref$1[1]; + var bstars = ref$1[2]; + if (astars !== bstars) { + return astars - bstars; + } + if (astars) { + if (astatics !== bstatics) { + return bstatics - astatics; + } + if (adynamics !== bdynamics) { + return bdynamics - adynamics; + } + } + if (adynamics !== bdynamics) { + return adynamics - bdynamics; + } + if (astatics !== bstatics) { + return bstatics - astatics; + } + return 0; + }); +} +function recognizeChar(states, ch) { + var nextStates = []; + for (var i = 0, l = states.length; i < l; i++) { + var state = states[i]; + nextStates = nextStates.concat(state.match(ch)); + } + return nextStates; +} +var RecognizeResults = function RecognizeResults(queryParams) { + this.length = 0; + this.queryParams = queryParams || {}; +}; +; +RecognizeResults.prototype.splice = Array.prototype.splice; +RecognizeResults.prototype.slice = Array.prototype.slice; +RecognizeResults.prototype.push = Array.prototype.push; +function findHandler(state, originalPath, queryParams) { + var handlers = state.handlers; + var regex = state.regex(); + if (!regex || !handlers) + { throw new Error("state not initialized"); } + var captures = originalPath.match(regex); + var currentCapture = 1; + var result = new RecognizeResults(queryParams); + result.length = handlers.length; + for (var i = 0; i < handlers.length; i++) { + var handler = handlers[i]; + var names = handler.names; + var shouldDecodes = handler.shouldDecodes; + var params = {}; + for (var j = 0; j < names.length; j++) { + var name = names[j]; + var capture = captures && captures[currentCapture++]; + if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS && shouldDecodes[j]) { + params[name] = capture && decodeURIComponent(capture); + } + else { + params[name] = capture; + } + } + result[i] = { handler: handler.handler, params: params, isDynamic: !!names.length }; + } + return result; +} +function decodeQueryParamPart(part) { + // http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1 + part = part.replace(/\+/gm, "%20"); + var result; + try { + result = decodeURIComponent(part); + } + catch (error) { + result = ""; + } + return result; +} +var RouteRecognizer = function RouteRecognizer() { + this.names = createMap(); + var states = []; + var state = new State(states, 0, -1 /* ANY */, true, false); + states[0] = state; + this.states = states; + this.rootState = state; +}; +RouteRecognizer.prototype.add = function add (routes, options) { + var currentState = this.rootState; + var pattern = "^"; + var types = [0, 0, 0]; + var handlers = new Array(routes.length); + var allSegments = []; + var isEmpty = true; + var j = 0; + for (var i = 0; i < routes.length; i++) { + var route = routes[i]; + var names = []; + var shouldDecodes = []; + parse(allSegments, route.path, names, types, shouldDecodes); + // preserve j so it points to the start of newly added segments + for (; j < allSegments.length; j++) { + var segment = allSegments[j]; + if (segment.type === 4 /* Epsilon */) { + continue; + } + isEmpty = false; + // Add a "/" for the new segment + currentState = currentState.put(47 /* SLASH */, false, false); + pattern += "/"; + // Add a representation of the segment to the NFA and regex + currentState = eachChar[segment.type](segment, currentState); + pattern += regex[segment.type](segment); + } + var handler = { handler: route.handler, names: names, shouldDecodes: shouldDecodes }; + handlers[i] = handler; + } + if (isEmpty) { + currentState = currentState.put(47 /* SLASH */, false, false); + pattern += "/"; + } + currentState.handlers = handlers; + currentState.pattern = pattern + "$"; + currentState.types = types; + var name; + if (typeof options === "object" && options !== null && options.as) { + name = options.as; } - - // Use custom serialize if it exists. - if (serializer) { - return serializer(model, names); + if (name) { + // if (this.names[name]) { + // throw new Error("You may not add a duplicate route named `" + name + "`."); + // } + this.names[name] = { + segments: allSegments, + handlers: handlers + }; } - - if (names.length !== 1) { return; } - - var name = names[0]; - - if (/_id$/.test(name)) { - object[name] = model.id; - } else { - object[name] = model; +}; +RouteRecognizer.prototype.handlersFor = function handlersFor (name) { + var route = this.names[name]; + if (!route) { + throw new Error("There is no route named " + name); } - return object; - } -}); - -// Generated by URL transitions and non-dynamic route segments in named Transitions. -var UnresolvedHandlerInfoByParam = subclass (HandlerInfo, { - initialize: function(props) { - this.params = props.params || {}; - }, - - getModel: function(payload) { - var fullParams = this.params; - if (payload && payload.queryParams) { - fullParams = {}; - merge(fullParams, this.params); - fullParams.queryParams = payload.queryParams; + var result = new Array(route.handlers.length); + for (var i = 0; i < route.handlers.length; i++) { + result[i] = route.handlers[i]; } - - var handler = this.handler; - var hookName = resolveHook(handler, 'deserialize') || - resolveHook(handler, 'model'); - - return this.runSharedModelHook(payload, hookName, [fullParams]); - } -}); - -handlerInfoFactory.klasses = { - resolved: ResolvedHandlerInfo, - param: UnresolvedHandlerInfoByParam, - object: UnresolvedHandlerInfoByObject + return result; }; - -function handlerInfoFactory(name, props) { - var Ctor = handlerInfoFactory.klasses[name], - handlerInfo = new Ctor(props || {}); - handlerInfo.factory = handlerInfoFactory; - return handlerInfo; -} - -var NamedTransitionIntent = subclass(TransitionIntent, { - name: null, - pivotHandler: null, - contexts: null, - queryParams: null, - - initialize: function(props) { - this.name = props.name; - this.pivotHandler = props.pivotHandler; - this.contexts = props.contexts || []; - this.queryParams = props.queryParams; - }, - - applyToState: function(oldState, recognizer, getHandler, isIntermediate, getSerializer) { - - var partitionedArgs = extractQueryParams([this.name].concat(this.contexts)), - pureArgs = partitionedArgs[0], - handlers = recognizer.handlersFor(pureArgs[0]); - - var targetRouteName = handlers[handlers.length-1].handler; - - return this.applyToHandlers(oldState, handlers, getHandler, targetRouteName, isIntermediate, null, getSerializer); - }, - - applyToHandlers: function(oldState, handlers, getHandler, targetRouteName, isIntermediate, checkingIfActive, getSerializer) { - - var i, len; - var newState = new TransitionState(); - var objects = this.contexts.slice(0); - - var invalidateIndex = handlers.length; - - // Pivot handlers are provided for refresh transitions - if (this.pivotHandler) { - for (i = 0, len = handlers.length; i < len; ++i) { - if (handlers[i].handler === this.pivotHandler._handlerName) { - invalidateIndex = i; - break; +RouteRecognizer.prototype.hasRoute = function hasRoute (name) { + return !!this.names[name]; +}; +RouteRecognizer.prototype.generate = function generate$1 (name, params) { + var route = this.names[name]; + var output = ""; + if (!route) { + throw new Error("There is no route named " + name); + } + var segments = route.segments; + for (var i = 0; i < segments.length; i++) { + var segment = segments[i]; + if (segment.type === 4 /* Epsilon */) { + continue; } - } + output += "/"; + output += generate[segment.type](segment, params); } - - for (i = handlers.length - 1; i >= 0; --i) { - var result = handlers[i]; - var name = result.handler; - - var oldHandlerInfo = oldState.handlerInfos[i]; - var newHandlerInfo = null; - - if (result.names.length > 0) { - if (i >= invalidateIndex) { - newHandlerInfo = this.createParamHandlerInfo(name, getHandler, result.names, objects, oldHandlerInfo); - } else { - var serializer = getSerializer(name); - newHandlerInfo = this.getHandlerInfoForDynamicSegment(name, getHandler, result.names, objects, oldHandlerInfo, targetRouteName, i, serializer); + if (output.charAt(0) !== "/") { + output = "/" + output; + } + if (params && params.queryParams) { + output += this.generateQueryString(params.queryParams); + } + return output; +}; +RouteRecognizer.prototype.generateQueryString = function generateQueryString (params) { + var pairs = []; + var keys = Object.keys(params); + keys.sort(); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = params[key]; + if (value == null) { + continue; } - } else { - // This route has no dynamic segment. - // Therefore treat as a param-based handlerInfo - // with empty params. This will cause the `model` - // hook to be called with empty params, which is desirable. - newHandlerInfo = this.createParamHandlerInfo(name, getHandler, result.names, objects, oldHandlerInfo); - } - - if (checkingIfActive) { - // If we're performing an isActive check, we want to - // serialize URL params with the provided context, but - // ignore mismatches between old and new context. - newHandlerInfo = newHandlerInfo.becomeResolved(null, newHandlerInfo.context); - var oldContext = oldHandlerInfo && oldHandlerInfo.context; - if (result.names.length > 0 && newHandlerInfo.context === oldContext) { - // If contexts match in isActive test, assume params also match. - // This allows for flexibility in not requiring that every last - // handler provide a `serialize` method - newHandlerInfo.params = oldHandlerInfo && oldHandlerInfo.params; + var pair = encodeURIComponent(key); + if (isArray(value)) { + for (var j = 0; j < value.length; j++) { + var arrayPair = key + "[]" + "=" + encodeURIComponent(value[j]); + pairs.push(arrayPair); + } } - newHandlerInfo.context = oldContext; - } + else { + pair += "=" + encodeURIComponent(value); + pairs.push(pair); + } + } + if (pairs.length === 0) { + return ""; + } + return "?" + pairs.join("&"); +}; +RouteRecognizer.prototype.parseQueryString = function parseQueryString (queryString) { + var pairs = queryString.split("&"); + var queryParams = {}; + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i].split("="), key = decodeQueryParamPart(pair[0]), keyLength = key.length, isArray = false, value = (void 0); + if (pair.length === 1) { + value = "true"; + } + else { + // Handle arrays + if (keyLength > 2 && key.slice(keyLength - 2) === "[]") { + isArray = true; + key = key.slice(0, keyLength - 2); + if (!queryParams[key]) { + queryParams[key] = []; + } + } + value = pair[1] ? decodeQueryParamPart(pair[1]) : ""; + } + if (isArray) { + queryParams[key].push(value); + } + else { + queryParams[key] = value; + } + } + return queryParams; +}; +RouteRecognizer.prototype.recognize = function recognize (path) { + var results; + var states = [this.rootState]; + var queryParams = {}; + var isSlashDropped = false; + var hashStart = path.indexOf("#"); + if (hashStart !== -1) { + path = path.substr(0, hashStart); + } + var queryStart = path.indexOf("?"); + if (queryStart !== -1) { + var queryString = path.substr(queryStart + 1, path.length); + path = path.substr(0, queryStart); + queryParams = this.parseQueryString(queryString); + } + if (path.charAt(0) !== "/") { + path = "/" + path; + } + var originalPath = path; + if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS) { + path = normalizePath(path); + } + else { + path = decodeURI(path); + originalPath = decodeURI(originalPath); + } + var pathLen = path.length; + if (pathLen > 1 && path.charAt(pathLen - 1) === "/") { + path = path.substr(0, pathLen - 1); + originalPath = originalPath.substr(0, originalPath.length - 1); + isSlashDropped = true; + } + for (var i = 0; i < path.length; i++) { + states = recognizeChar(states, path.charCodeAt(i)); + if (!states.length) { + break; + } + } + var solutions = []; + for (var i$1 = 0; i$1 < states.length; i$1++) { + if (states[i$1].handlers) { + solutions.push(states[i$1]); + } + } + states = sortSolutions(solutions); + 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.pattern && state.pattern.slice(-5) === "(.+)$") { + originalPath = originalPath + "/"; + } + results = findHandler(state, originalPath, queryParams); + } + return results; +}; +RouteRecognizer.VERSION = "0.3.0"; +// Set to false to opt-out of encoding and decoding path segments. +// See https://github.com/tildeio/route-recognizer/pull/55 +RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS = true; +RouteRecognizer.Normalizer = { + normalizeSegment: normalizeSegment, normalizePath: normalizePath, encodePathSegment: encodePathSegment +}; +RouteRecognizer.prototype.map = map; - var handlerToUse = oldHandlerInfo; - if (i >= invalidateIndex || newHandlerInfo.shouldSupercede(oldHandlerInfo)) { - invalidateIndex = Math.min(i, invalidateIndex); - handlerToUse = newHandlerInfo; - } +exports['default'] = RouteRecognizer; - if (isIntermediate && !checkingIfActive) { - handlerToUse = handlerToUse.becomeResolved(null, handlerToUse.context); - } +Object.defineProperty(exports, '__esModule', { value: true }); - newState.handlerInfos.unshift(handlerToUse); - } +}); +enifed('router', ['exports', 'route-recognizer', 'rsvp'], function (exports, RouteRecognizer, rsvp) { 'use strict'; - if (objects.length > 0) { - throw new Error("More context objects were passed than there are dynamic segments for the route: " + targetRouteName); - } +RouteRecognizer = 'default' in RouteRecognizer ? RouteRecognizer['default'] : RouteRecognizer; - if (!isIntermediate) { - this.invalidateChildren(newState.handlerInfos, invalidateIndex); - } +var slice = Array.prototype.slice; - merge(newState.queryParams, this.queryParams || {}); +var _isArray; +if (!Array.isArray) { + _isArray = function (x) { + return Object.prototype.toString.call(x) === "[object Array]"; + }; +} else { + _isArray = Array.isArray; +} - return newState; - }, +var isArray = _isArray; - invalidateChildren: function(handlerInfos, invalidateIndex) { - for (var i = invalidateIndex, l = handlerInfos.length; i < l; ++i) { - var handlerInfo = handlerInfos[i]; - handlerInfos[i] = handlerInfo.getUnresolved(); - } - }, +/** + Determines if an object is Promise by checking if it is "thenable". +**/ +function isPromise(obj) { + return ((typeof obj === 'object' && obj !== null) || typeof obj === 'function') && typeof obj.then === 'function'; +} - getHandlerInfoForDynamicSegment: function(name, getHandler, names, objects, oldHandlerInfo, targetRouteName, i, serializer) { - var objectToUse; - if (objects.length > 0) { +function merge(hash, other) { + for (var prop in other) { + if (other.hasOwnProperty(prop)) { hash[prop] = other[prop]; } + } +} - // Use the objects provided for this transition. - objectToUse = objects[objects.length - 1]; - if (isParam(objectToUse)) { - return this.createParamHandlerInfo(name, getHandler, names, objects, oldHandlerInfo); - } else { - objects.pop(); - } - } else if (oldHandlerInfo && oldHandlerInfo.name === name) { - // Reuse the matching oldHandlerInfo - return oldHandlerInfo; - } else { - if (this.preTransitionState) { - var preTransitionHandlerInfo = this.preTransitionState.handlerInfos[i]; - objectToUse = preTransitionHandlerInfo && preTransitionHandlerInfo.context; - } else { - // Ideally we should throw this error to provide maximal - // information to the user that not enough context objects - // were provided, but this proves too cumbersome in Ember - // in cases where inner template helpers are evaluated - // before parent helpers un-render, in which cases this - // error somewhat prematurely fires. - //throw new Error("Not enough context objects were provided to complete a transition to " + targetRouteName + ". Specifically, the " + name + " route needs an object that can be serialized into its dynamic URL segments [" + names.join(', ') + "]"); - return oldHandlerInfo; - } - } +var oCreate = Object.create || function(proto) { + function F() {} + F.prototype = proto; + return new F(); +}; - return handlerInfoFactory('object', { - name: name, - getHandler: getHandler, - serializer: serializer, - context: objectToUse, - names: names - }); - }, +/** + @private - createParamHandlerInfo: function(name, getHandler, names, objects, oldHandlerInfo) { - var params = {}; + Extracts query params from the end of an array +**/ +function extractQueryParams(array) { + var len = (array && array.length), head, queryParams; - // Soak up all the provided string/numbers - var numNames = names.length; - while (numNames--) { + if(len && len > 0 && array[len - 1] && array[len - 1].hasOwnProperty('queryParams')) { + queryParams = array[len - 1].queryParams; + head = slice.call(array, 0, len - 1); + return [head, queryParams]; + } else { + return [array, null]; + } +} - // Only use old params if the names match with the new handler - var oldParams = (oldHandlerInfo && name === oldHandlerInfo.name && oldHandlerInfo.params) || {}; +/** + @private - var peek = objects[objects.length - 1]; - var paramName = names[numNames]; - if (isParam(peek)) { - 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); - } + Coerces query param properties and array elements into strings. +**/ +function coerceQueryParamsToString(queryParams) { + for (var key in queryParams) { + if (typeof queryParams[key] === 'number') { + queryParams[key] = '' + queryParams[key]; + } else if (isArray(queryParams[key])) { + for (var i = 0, l = queryParams[key].length; i < l; i++) { + queryParams[key][i] = '' + queryParams[key][i]; } } - - return handlerInfoFactory('param', { - name: name, - getHandler: getHandler, - params: params - }); } -}); - +} /** - Promise reject reasons passed to promise rejection - handlers for failed transitions. + @private */ -function UnrecognizedURLError(message) { - this.message = (message || "UnrecognizedURLError"); - this.name = "UnrecognizedURLError"; - Error.call(this); +function log(router, sequence, msg) { + if (!router.log) { return; } + + if (arguments.length === 3) { + router.log("Transition #" + sequence + ": " + msg); + } else { + msg = sequence; + router.log(msg); + } } -UnrecognizedURLError.prototype = oCreate(Error.prototype); +function bind(context, fn) { + var boundArgs = arguments; + return function(value) { + var args = slice.call(boundArgs, 2); + args.push(value); + return fn.apply(context, args); + }; +} -var URLTransitionIntent = subclass(TransitionIntent, { - url: null, +function isParam(object) { + return (typeof object === "string" || object instanceof String || typeof object === "number" || object instanceof Number); +} - initialize: function(props) { - this.url = props.url; - }, - applyToState: function(oldState, recognizer, getHandler) { - var newState = new TransitionState(); +function forEach(array, callback) { + for (var i=0, l=array.length; i < l && false !== callback(array[i]); i++) { } +} - var results = recognizer.recognize(this.url), - i, len; +function trigger(router, handlerInfos, ignoreFailure, args) { + if (router.triggerEvent) { + router.triggerEvent(handlerInfos, ignoreFailure, args); + return; + } - if (!results) { - throw new UnrecognizedURLError(this.url); - } + var name = args.shift(); - var statesDiffer = false; - var url = this.url; + if (!handlerInfos) { + if (ignoreFailure) { return; } + throw new Error("Could not trigger event '" + name + "'. There are no active handlers"); + } - // Checks if a handler is accessible by URL. If it is not, an error is thrown. - // For the case where the handler is loaded asynchronously, the error will be - // thrown once it is loaded. - function checkHandlerAccessibility(handler) { - if (handler && handler.inaccessibleByURL) { - throw new UnrecognizedURLError(url); - } + var eventWasHandled = false; - return handler; - } + function delayedEvent(name, args, handler) { + handler.events[name].apply(handler, args); + } - for (i = 0, len = results.length; i < len; ++i) { - var result = results[i]; - var name = result.handler; - var newHandlerInfo = handlerInfoFactory('param', { - name: name, - getHandler: getHandler, - params: result.params - }); - var handler = newHandlerInfo.handler; + for (var i=handlerInfos.length-1; i>=0; i--) { + var handlerInfo = handlerInfos[i], + handler = handlerInfo.handler; - if (handler) { - checkHandlerAccessibility(handler); - } else { - // If the hanlder is being loaded asynchronously, check if we can - // access it after it has resolved - newHandlerInfo.handlerPromise = newHandlerInfo.handlerPromise.then(checkHandlerAccessibility); - } + // If there is no handler, it means the handler hasn't resolved yet which + // means that we should trigger the event later when the handler is available + if (!handler) { + handlerInfo.handlerPromise.then(bind(null, delayedEvent, name, args)); + continue; + } - var oldHandlerInfo = oldState.handlerInfos[i]; - if (statesDiffer || newHandlerInfo.shouldSupercede(oldHandlerInfo)) { - statesDiffer = true; - newState.handlerInfos[i] = newHandlerInfo; + if (handler.events && handler.events[name]) { + if (handler.events[name].apply(handler, args) === true) { + eventWasHandled = true; } else { - newState.handlerInfos[i] = oldHandlerInfo; + return; } } - - merge(newState.queryParams, results.queryParams); - - return newState; } -}); - -var pop = Array.prototype.pop; - -function Router(_options) { - var options = _options || {}; - this.getHandler = options.getHandler || this.getHandler; - this.getSerializer = options.getSerializer || this.getSerializer; - this.updateURL = options.updateURL || this.updateURL; - this.replaceURL = options.replaceURL || this.replaceURL; - this.didTransition = options.didTransition || this.didTransition; - this.willTransition = options.willTransition || this.willTransition; - this.delegate = options.delegate || this.delegate; - this.triggerEvent = options.triggerEvent || this.triggerEvent; - this.log = options.log || this.log; - this.dslCallBacks = []; // NOTE: set by Ember - this.state = undefined; - this.activeTransition = undefined; - this._changedQueryParams = undefined; - this.oldState = undefined; - this.currentHandlerInfos = undefined; - this.state = undefined; - this.currentSequence = 0; - this.recognizer = new RouteRecognizer(); - this.reset(); + // In the case that we got an UnrecognizedURLError as an event with no handler, + // let it bubble up + if (name === 'error' && args[0].name === 'UnrecognizedURLError') { + throw args[0]; + } else if (!eventWasHandled && !ignoreFailure) { + throw new Error("Nothing handled the event '" + name + "'."); + } } -function getTransitionByIntent(intent, isIntermediate) { - var wasTransitioning = !!this.activeTransition; - var oldState = wasTransitioning ? this.activeTransition.state : this.state; - var newTransition; +function getChangelist(oldObject, newObject) { + var key; + var results = { + all: {}, + changed: {}, + removed: {} + }; - var newState = intent.applyToState(oldState, this.recognizer, this.getHandler, isIntermediate, this.getSerializer); - var queryParamChangelist = getChangelist(oldState.queryParams, newState.queryParams); + merge(results.all, newObject); - if (handlerInfosEqual(newState.handlerInfos, oldState.handlerInfos)) { + var didChange = false; + coerceQueryParamsToString(oldObject); + coerceQueryParamsToString(newObject); - // This is a no-op transition. See if query params changed. - if (queryParamChangelist) { - newTransition = this.queryParamsTransition(queryParamChangelist, wasTransitioning, oldState, newState); - if (newTransition) { - return newTransition; + // Calculate removals + for (key in oldObject) { + if (oldObject.hasOwnProperty(key)) { + if (!newObject.hasOwnProperty(key)) { + didChange = true; + results.removed[key] = oldObject[key]; + } + } + } + + // Calculate changes + for (key in newObject) { + if (newObject.hasOwnProperty(key)) { + if (isArray(oldObject[key]) && isArray(newObject[key])) { + if (oldObject[key].length !== newObject[key].length) { + results.changed[key] = newObject[key]; + didChange = true; + } else { + for (var i = 0, l = oldObject[key].length; i < l; i++) { + if (oldObject[key][i] !== newObject[key][i]) { + results.changed[key] = newObject[key]; + didChange = true; + } + } + } + } + else { + if (oldObject[key] !== newObject[key]) { + results.changed[key] = newObject[key]; + didChange = true; + } } } - - // No-op. No need to create a new transition. - return this.activeTransition || new Transition(this); } - if (isIntermediate) { - setupContexts(this, newState); - return; - } - - // Create a new transition to the destination route. - newTransition = new Transition(this, intent, newState, undefined, this.activeTransition); - - // Abort and usurp any previously active transition. - if (this.activeTransition) { - this.activeTransition.abort(); - } - this.activeTransition = newTransition; + return didChange && results; +} - // 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, promiseLabel("Settle transition promise when transition is finalized")); +function promiseLabel(label) { + return 'Router: ' + label; +} - if (!wasTransitioning) { - notifyExistingHandlers(this, newState, newTransition); +function subclass(parentConstructor, proto) { + function C(props) { + parentConstructor.call(this, props || {}); } - - fireQueryParamDidChange(this, newState, queryParamChangelist); - - return newTransition; + C.prototype = oCreate(parentConstructor.prototype); + merge(C.prototype, proto); + return C; } -Router.prototype = { +function resolveHook(obj, hookName) { + if (!obj) { return; } + var underscored = "_" + hookName; + return obj[underscored] && underscored || + obj[hookName] && hookName; +} - /** - The main entry point into the router. The API is essentially - the same as the `map` method in `route-recognizer`. +function callHook(obj, _hookName, arg1, arg2) { + var hookName = resolveHook(obj, _hookName); + return hookName && obj[hookName].call(obj, arg1, arg2); +} - This method extracts the String handler at the last `.to()` - call and uses it as the name of the whole route. +function applyHook(obj, _hookName, args) { + var hookName = resolveHook(obj, _hookName); + if (hookName) { + if (args.length === 0) { + return obj[hookName].call(obj); + } else if (args.length === 1) { + return obj[hookName].call(obj, args[0]); + } else if (args.length === 2) { + return obj[hookName].call(obj, args[0], args[1]); + } else { + return obj[hookName].apply(obj, args); + } + } +} - @param {Function} callback - */ - map: function(callback) { - this.recognizer.delegate = this.delegate; +function TransitionState() { + this.handlerInfos = []; + this.queryParams = {}; + this.params = {}; +} - this.recognizer.map(callback, function(recognizer, routes) { - for (var i = routes.length - 1, proceed = true; i >= 0 && proceed; --i) { - var route = routes[i]; - recognizer.add(routes, { as: route.handler }); - proceed = route.path === '/' || route.path === '' || route.handler.slice(-6) === '.index'; +TransitionState.prototype = { + promiseLabel: function(label) { + var targetName = ''; + forEach(this.handlerInfos, function(handlerInfo) { + if (targetName !== '') { + targetName += '.'; } + targetName += handlerInfo.name; }); + return promiseLabel("'" + targetName + "': " + label); }, - hasRoute: function(route) { - return this.recognizer.hasRoute(route); - }, + resolve: function(shouldContinue, payload) { + // First, calculate params for this state. This is useful + // information to provide to the various route hooks. + var params = this.params; + forEach(this.handlerInfos, function(handlerInfo) { + params[handlerInfo.name] = handlerInfo.params || {}; + }); - getHandler: function() {}, + payload = payload || {}; + payload.resolveIndex = 0; - getSerializer: function() {}, + var currentState = this; + var wasAborted = false; - queryParamsTransition: function(changelist, wasTransitioning, oldState, newState) { - var router = this; + // The prelude RSVP.resolve() asyncs us into the promise land. + return rsvp.Promise.resolve(null, this.promiseLabel("Start transition")) + .then(resolveOneHandlerInfo, null, this.promiseLabel('Resolve handler'))['catch'](handleError, this.promiseLabel('Handle error')); - fireQueryParamDidChange(this, newState, changelist); + function innerShouldContinue() { + return rsvp.Promise.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 rsvp.Promise.reject(reason); + }, currentState.promiseLabel("Handle abort")); + } - if (!wasTransitioning && this.activeTransition) { - // One of the handlers in queryParamsDidChange - // caused a transition. Just return that transition. - return this.activeTransition; - } else { - // Running queryParamsDidChange didn't change anything. - // Just update query params and be on our way. + function handleError(error) { + // This is the only possible + // reject value of TransitionState#resolve + var handlerInfos = currentState.handlerInfos; + var errorHandlerIndex = payload.resolveIndex >= handlerInfos.length ? + handlerInfos.length - 1 : payload.resolveIndex; + return rsvp.Promise.reject({ + error: error, + handlerWithError: currentState.handlerInfos[errorHandlerIndex].handler, + wasAborted: wasAborted, + state: currentState + }); + } - // We have to return a noop transition that will - // perform a URL update at the end. This gives - // the user the ability to set the url update - // method (default is replaceState). - var newTransition = new Transition(this); - newTransition.queryParamsOnly = true; + function proceed(resolvedHandlerInfo) { + var wasAlreadyResolved = currentState.handlerInfos[payload.resolveIndex].isResolved; - oldState.queryParams = finalizeQueryParamChange(this, newState.handlerInfos, newState.queryParams, newTransition); + // Swap the previously unresolved handlerInfo with + // the resolved handlerInfo + currentState.handlerInfos[payload.resolveIndex++] = resolvedHandlerInfo; - newTransition.promise = newTransition.promise.then(function(result) { - updateURL(newTransition, oldState, true); - if (router.didTransition) { - router.didTransition(router.currentHandlerInfos); - } - return result; - }, null, promiseLabel("Transition complete")); - return newTransition; - } - }, + if (!wasAlreadyResolved) { + // Call the redirect hook. The reason we call it here + // vs. afterModel is so that redirects into child + // routes don't re-run the model hooks for this + // already-resolved route. + var handler = resolvedHandlerInfo.handler; + callHook(handler, 'redirect', resolvedHandlerInfo.context, payload); + } - // NOTE: this doesn't really belong here, but here - // it shall remain until our ES6 transpiler can - // handle cyclical deps. - transitionByIntent: function(intent/*, isIntermediate*/) { - try { - return getTransitionByIntent.apply(this, arguments); - } catch(e) { - return new Transition(this, intent, null, e); + // Proceed after ensuring that the redirect hook + // didn't abort this transition by transitioning elsewhere. + return innerShouldContinue().then(resolveOneHandlerInfo, null, currentState.promiseLabel('Resolve handler')); } - }, - /** - Clears the current and target route handlers and triggers exit - on each of them starting at the leaf and traversing up through - its ancestors. - */ - reset: function() { - if (this.state) { - forEach(this.state.handlerInfos.slice().reverse(), function(handlerInfo) { - var handler = handlerInfo.handler; - callHook(handler, 'exit'); - }); + function resolveOneHandlerInfo() { + if (payload.resolveIndex === currentState.handlerInfos.length) { + // This is is the only possible + // fulfill value of TransitionState#resolve + return { + error: null, + state: currentState + }; + } + + var handlerInfo = currentState.handlerInfos[payload.resolveIndex]; + + return handlerInfo.resolve(innerShouldContinue, payload) + .then(proceed, null, currentState.promiseLabel('Proceed')); } + } +}; - this.oldState = undefined; - this.state = new TransitionState(); - this.currentHandlerInfos = null; - }, +function TransitionAbortedError(message) { + if (!(this instanceof TransitionAbortedError)) { + return new TransitionAbortedError(message); + } - activeTransition: null, + var error = Error.call(this, message); - /** - var handler = handlerInfo.handler; - The entry point for handling a change to the URL (usually - via the back and forward button). + if (Error.captureStackTrace) { + Error.captureStackTrace(this, TransitionAbortedError); + } else { + this.stack = error.stack; + } - Returns an Array of handlers and the parameters associated - with those parameters. + this.description = error.description; + this.fileName = error.fileName; + this.lineNumber = error.lineNumber; + this.message = error.message || 'TransitionAborted'; + this.name = 'TransitionAborted'; + this.number = error.number; + this.code = error.code; +} - @param {String} url a URL to process +TransitionAbortedError.prototype = oCreate(Error.prototype); - @return {Array} an Array of `[handler, parameter]` tuples - */ - handleURL: function(url) { - // Perform a URL-based transition, but don't change - // the URL afterward, since it already happened. - var args = slice.call(arguments); - if (url.charAt(0) !== '/') { args[0] = '/' + url; } +/** + A Transition is a thennable (a promise-like object) that represents + an attempt to transition to another route. It can be aborted, either + explicitly via `abort` or by attempting another transition while a + previous one is still underway. An aborted transition can also + be `retry()`d later. - return doTransition(this, args).method(null); - }, + @class Transition + @constructor + @param {Object} router + @param {Object} intent + @param {Object} state + @param {Object} error + @private + */ +function Transition(router, intent, state, error, previousTransition) { + var transition = this; + this.state = state || router.state; + this.intent = intent; + this.router = router; + this.data = this.intent && this.intent.data || {}; + this.resolvedModels = {}; + this.queryParams = {}; + this.promise = undefined; + this.error = undefined; + this.params = undefined; + this.handlerInfos = undefined; + this.targetName = undefined; + this.pivotHandler = undefined; + this.sequence = undefined; + this.isAborted = false; + this.isActive = true; - /** - Hook point for updating the URL. + if (error) { + this.promise = rsvp.Promise.reject(error); + this.error = error; + return; + } - @param {String} url a URL to update to - */ - updateURL: function() { - throw new Error("updateURL is not implemented"); - }, + // if you're doing multiple redirects, need the new transition to know if it + // is actually part of the first transition or not. Any further redirects + // in the initial transition also need to know if they are part of the + // initial transition + this.isCausedByAbortingTransition = !!previousTransition; + this.isCausedByInitialTransition = ( + previousTransition && ( + previousTransition.isCausedByInitialTransition || + previousTransition.sequence === 0 + ) + ); - /** - Hook point for replacing the current URL, i.e. with replaceState + if (state) { + this.params = state.params; + this.queryParams = state.queryParams; + this.handlerInfos = state.handlerInfos; - By default this behaves the same as `updateURL` + var len = state.handlerInfos.length; + if (len) { + this.targetName = state.handlerInfos[len-1].name; + } - @param {String} url a URL to update to - */ - replaceURL: function(url) { - this.updateURL(url); - }, + for (var i = 0; i < len; ++i) { + var handlerInfo = state.handlerInfos[i]; - /** - Transition into the specified named route. + // TODO: this all seems hacky + if (!handlerInfo.isResolved) { break; } + this.pivotHandler = handlerInfo.handler; + } - If necessary, trigger the exit callback on any handlers - that are no longer represented by the target route. + this.sequence = router.currentSequence++; + this.promise = state.resolve(checkForAbort, this)['catch']( + catchHandlerForTransition(transition), promiseLabel('Handle Abort')); + } else { + this.promise = rsvp.Promise.resolve(this.state); + this.params = {}; + } - @param {String} name the name of the route - */ - transitionTo: function(/*name*/) { - return doTransition(this, arguments); - }, + function checkForAbort() { + if (transition.isAborted) { + return rsvp.Promise.reject(undefined, promiseLabel("Transition aborted - reject")); + } + } +} - intermediateTransitionTo: function(/*name*/) { - return doTransition(this, arguments, true); - }, +function catchHandlerForTransition(transition) { + return function(result) { + if (result.wasAborted || transition.isAborted) { + return rsvp.Promise.reject(logAbort(transition)); + } else { + transition.trigger('error', result.error, transition, result.handlerWithError); + transition.abort(); + return rsvp.Promise.reject(result.error); + } + }; +} - refresh: function(pivotHandler) { - var state = this.activeTransition ? this.activeTransition.state : this.state; - var handlerInfos = state.handlerInfos; - var params = {}; + +Transition.prototype = { + targetName: null, + urlMethod: 'update', + intent: null, + pivotHandler: null, + resolveIndex: 0, + resolvedModels: null, + state: null, + queryParamsOnly: false, + + isTransition: true, + + isExiting: function(handler) { + var handlerInfos = this.handlerInfos; for (var i = 0, len = handlerInfos.length; i < len; ++i) { var handlerInfo = handlerInfos[i]; - params[handlerInfo.name] = handlerInfo.params || {}; + if (handlerInfo.name === handler || handlerInfo.handler === handler) { + return false; + } } + return true; + }, - log(this, "Starting a refresh transition"); - var intent = new NamedTransitionIntent({ - name: handlerInfos[handlerInfos.length - 1].name, - pivotHandler: pivotHandler || handlerInfos[0].handler, - contexts: [], // TODO collect contexts...? - queryParams: this._changedQueryParams || state.queryParams || {} - }); + /** + The Transition's internal promise. Calling `.then` on this property + is that same as calling `.then` on the Transition object itself, but + this property is exposed for when you want to pass around a + Transition's promise, but not the Transition object itself, since + Transition object can be externally `abort`ed, while the promise + cannot. - return this.transitionByIntent(intent, false); - }, + @property promise + @type {Object} + @public + */ + promise: null, /** - Identical to `transitionTo` except that the current URL will be replaced - if possible. + Custom state can be stored on a Transition's `data` object. + This can be useful for decorating a Transition within an earlier + hook and shared with a later hook. Properties set on `data` will + be copied to new transitions generated by calling `retry` on this + transition. - This method is intended primarily for use with `replaceState`. + @property data + @type {Object} + @public + */ + data: null, - @param {String} name the name of the route - */ - replaceWith: function(/*name*/) { - return doTransition(this, arguments).method('replace'); + /** + A standard promise hook that resolves if the transition + succeeds and rejects if it fails/redirects/aborts. + + Forwards to the internal `promise` property which you can + use in situations where you want to pass around a thennable, + but not the Transition itself. + + @method then + @param {Function} onFulfilled + @param {Function} onRejected + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + @public + */ + then: function(onFulfilled, onRejected, label) { + return this.promise.then(onFulfilled, onRejected, label); }, /** - Take a named route and context objects and generate a - URL. - - @param {String} name the name of the route to generate - a URL for - @param {...Object} objects a list of objects to serialize - @return {String} a URL - */ - generate: function(handlerName) { + Forwards to the internal `promise` property which you can + use in situations where you want to pass around a thennable, + but not the Transition itself. - var partitionedArgs = extractQueryParams(slice.call(arguments, 1)), - suppliedParams = partitionedArgs[0], - queryParams = partitionedArgs[1]; + @method catch + @param {Function} onRejection + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + @public + */ + catch: function(onRejection, label) { + return this.promise.catch(onRejection, label); + }, - // Construct a TransitionIntent with the provided params - // and apply it to the present state of the router. - var intent = new NamedTransitionIntent({ name: handlerName, contexts: suppliedParams }); - var state = intent.applyToState(this.state, this.recognizer, this.getHandler, null, this.getSerializer); - var params = {}; + /** - for (var i = 0, len = state.handlerInfos.length; i < len; ++i) { - var handlerInfo = state.handlerInfos[i]; - var handlerParams = handlerInfo.serialize(); - merge(params, handlerParams); - } - params.queryParams = queryParams; + Forwards to the internal `promise` property which you can + use in situations where you want to pass around a thennable, + but not the Transition itself. - return this.recognizer.generate(handlerName, params); + @method finally + @param {Function} callback + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + @public + */ + finally: function(callback, label) { + return this.promise.finally(callback, label); }, - applyIntent: function(handlerName, contexts) { - var intent = new NamedTransitionIntent({ - name: handlerName, - contexts: contexts - }); + /** + Aborts the Transition. Note you can also implicitly abort a transition + by initiating another transition while a previous one is underway. - var state = this.activeTransition && this.activeTransition.state || this.state; - return intent.applyToState(state, this.recognizer, this.getHandler, null, this.getSerializer); + @method abort + @return {Transition} this transition + @public + */ + abort: function() { + if (this.isAborted) { return this; } + 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; }, - isActiveIntent: function(handlerName, contexts, queryParams, _state) { - var state = _state || this.state, - targetHandlerInfos = state.handlerInfos, - handlerInfo, len; + /** - if (!targetHandlerInfos.length) { return false; } + Retries a previously-aborted transition (making sure to abort the + transition if it's still active). Returns a new transition that + represents the new attempt to transition. - var targetHandler = targetHandlerInfos[targetHandlerInfos.length - 1].name; - var recogHandlers = this.recognizer.handlersFor(targetHandler); + @method retry + @return {Transition} new transition + @public + */ + retry: function() { + // TODO: add tests for merged state retry()s + this.abort(); + return this.router.transitionByIntent(this.intent, false); + }, - var index = 0; - for (len = recogHandlers.length; index < len; ++index) { - handlerInfo = targetHandlerInfos[index]; - if (handlerInfo.name === handlerName) { break; } - } + /** - if (index === recogHandlers.length) { - // The provided route name isn't even in the route hierarchy. - return false; - } + Sets the URL-changing method to be employed at the end of a + successful transition. By default, a new Transition will just + use `updateURL`, but passing 'replace' to this method will + cause the URL to update using 'replaceWith' instead. Omitting + a parameter will disable the URL change, allowing for transitions + that don't update the URL at completion (this is also used for + handleURL, since the URL has already changed before the + transition took place). - var testState = new TransitionState(); - testState.handlerInfos = targetHandlerInfos.slice(0, index + 1); - recogHandlers = recogHandlers.slice(0, index + 1); + @method method + @param {String} method the type of URL-changing method to use + at the end of a transition. Accepted values are 'replace', + falsy values, or any other non-falsy value (which is + interpreted as an updateURL transition). - var intent = new NamedTransitionIntent({ - name: targetHandler, - contexts: contexts - }); + @return {Transition} this transition + @public + */ + method: function(method) { + this.urlMethod = method; + return this; + }, - var newState = intent.applyToHandlers(testState, recogHandlers, this.getHandler, targetHandler, true, true, this.getSerializer); + /** - var handlersEqual = handlerInfosEqual(newState.handlerInfos, testState.handlerInfos); - if (!queryParams || !handlersEqual) { - return handlersEqual; - } + Fires an event on the current list of resolved/resolving + handlers within this transition. Useful for firing events + on route hierarchies that haven't fully been entered yet. - // Get a hash of QPs that will still be active on new route - var activeQPsOnNewHandler = {}; - merge(activeQPsOnNewHandler, queryParams); + Note: This method is also aliased as `send` - var activeQueryParams = state.queryParams; - for (var key in activeQueryParams) { - if (activeQueryParams.hasOwnProperty(key) && - activeQPsOnNewHandler.hasOwnProperty(key)) { - activeQPsOnNewHandler[key] = activeQueryParams[key]; - } + @method trigger + @param {Boolean} [ignoreFailure=false] a boolean specifying whether unhandled events throw an error + @param {String} name the name of the event to fire + @public + */ + trigger: function (ignoreFailure) { + var args = slice.call(arguments); + if (typeof ignoreFailure === 'boolean') { + args.shift(); + } else { + // Throw errors on unhandled trigger events by default + ignoreFailure = false; } - - return handlersEqual && !getChangelist(activeQPsOnNewHandler, queryParams); + trigger(this.router, this.state.handlerInfos.slice(0, this.resolveIndex + 1), ignoreFailure, args); }, - isActive: function(handlerName) { - var partitionedArgs = extractQueryParams(slice.call(arguments, 1)); - return this.isActiveIntent(handlerName, partitionedArgs[0], partitionedArgs[1]); + /** + Transitions are aborted and their promises rejected + when redirects occur; this method returns a promise + that will follow any redirects that occur and fulfill + with the value fulfilled by any redirecting transitions + that occur. + + @method followRedirects + @return {Promise} a promise that fulfills with the same + value that the final redirecting transition fulfills with + @public + */ + followRedirects: function() { + var router = this.router; + return this.promise['catch'](function(reason) { + if (router.activeTransition) { + return router.activeTransition.followRedirects(); + } + return rsvp.Promise.reject(reason); + }); }, - trigger: function(/*name*/) { - var args = slice.call(arguments); - trigger(this, this.currentHandlerInfos, false, args); + toString: function() { + return "Transition (sequence " + this.sequence + ")"; }, /** - Hook point for logging transition status updates. - - @param {String} message The message to log. - */ - log: null + @private + */ + log: function(message) { + log(this.router, this.sequence, message); + } }; -/** - @private - - Fires queryParamsDidChange event -*/ -function fireQueryParamDidChange(router, newState, queryParamChangelist) { - // If queryParams changed trigger event - if (queryParamChangelist) { - - // This is a little hacky but we need some way of storing - // changed query params given that no activeTransition - // is guaranteed to have occurred. - router._changedQueryParams = queryParamChangelist.all; - trigger(router, newState.handlerInfos, true, ['queryParamsDidChange', queryParamChangelist.changed, queryParamChangelist.all, queryParamChangelist.removed]); - router._changedQueryParams = null; - } -} +// Alias 'trigger' as 'send' +Transition.prototype.send = Transition.prototype.trigger; /** @private - Takes an Array of `HandlerInfo`s, figures out which ones are - exiting, entering, or changing contexts, and calls the - proper handler hooks. - - For example, consider the following tree of handlers. Each handler is - followed by the URL segment it handles. - - ``` - |~index ("/") - | |~posts ("/posts") - | | |-showPost ("/:id") - | | |-newPost ("/new") - | | |-editPost ("/edit") - | |~about ("/about/:id") - ``` + Logs and returns an instance of TransitionAbortedError. + */ +function logAbort(transition) { + log(transition.router, transition.sequence, "detected abort."); + return new TransitionAbortedError(); +} - Consider the following transitions: +function TransitionIntent(props) { + this.initialize(props); - 1. A URL transition to `/posts/1`. - 1. Triggers the `*model` callbacks on the - `index`, `posts`, and `showPost` handlers - 2. Triggers the `enter` callback on the same - 3. Triggers the `setup` callback on the same - 2. A direct transition to `newPost` - 1. Triggers the `exit` callback on `showPost` - 2. Triggers the `enter` callback on `newPost` - 3. Triggers the `setup` callback on `newPost` - 3. A direct transition to `about` with a specified - context object - 1. Triggers the `exit` callback on `newPost` - and `posts` - 2. Triggers the `serialize` callback on `about` - 3. Triggers the `enter` callback on `about` - 4. Triggers the `setup` callback on `about` + // TODO: wat + this.data = this.data || {}; +} - @param {Router} transition - @param {TransitionState} newState -*/ -function setupContexts(router, newState, transition) { - var partition = partitionHandlers(router.state, newState); - var i, l, handler; +TransitionIntent.prototype = { + initialize: null, + applyToState: null +}; - for (i=0, l=partition.exited.length; i= 0; --i) { - var handlerInfo = handlerInfos[i]; - merge(params, handlerInfo.params); - if (handlerInfo.handler.inaccessibleByURL) { - urlMethod = null; + if (this.queryParams) { + args.push(this.queryParams); } - } - - if (urlMethod) { - params.queryParams = transition._visibleQueryParams || state.queryParams; - var url = router.recognizer.generate(handlerName, params); - - // transitions during the initial transition must always use replaceURL. - // When the app boots, you are at a url, e.g. /foo. If some handler - // redirects to bar as part of the initial transition, you don't want to - // add a history entry for /foo. If you do, pressing back will immediately - // hit the redirect again and take you back to /bar, thus killing the back - // button - var initial = transition.isCausedByInitialTransition; + args.push(payload); - // say you are at / and you click a link to route /foo. In /foo's - // handler, the transition is aborted using replacewith('/bar'). - // Because the current url is still /, the history entry for / is - // removed from the history. Clicking back will take you to the page - // you were on before /, which is often not even the app, thus killing - // the back button. That's why updateURL is always correct for an - // aborting transition that's not the initial transition - var replaceAndNotAborting = ( - urlMethod === 'replace' && - !transition.isCausedByAbortingTransition - ); + var result = applyHook(this.handler, hookName, args); - if (initial || replaceAndNotAborting) { - router.replaceURL(url); - } else { - router.updateURL(url); + if (result && result.isTransition) { + result = null; } - } -} -/** - @private - - Updates the URL (if necessary) and calls `setupContexts` - to update the router's array of `currentHandlerInfos`. - */ -function finalizeTransition(transition, newState) { + return rsvp.Promise.resolve(result, this.promiseLabel("Resolve value returned from one of the model hooks")); + }, - try { - log(transition.router, transition.sequence, "Resolved all models on destination route; finalizing transition."); + // overridden by subclasses + getModel: null, - var router = transition.router, - handlerInfos = newState.handlerInfos; + checkForAbort: function(shouldContinue, promiseValue) { + return rsvp.Promise.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")); + }, - // Run all the necessary enter/setup/exit hooks - setupContexts(router, newState, transition); + stashResolvedModel: function(payload, resolvedModel) { + payload.resolvedModels = payload.resolvedModels || {}; + payload.resolvedModels[this.name] = resolvedModel; + }, - // Check if a redirect occurred in enter/setup - if (transition.isAborted) { - // TODO: cleaner way? distinguish b/w targetHandlerInfos? - router.state.handlerInfos = router.currentHandlerInfos; - return rsvp.Promise.reject(logAbort(transition)); + becomeResolved: function(payload, resolvedContext) { + var params = this.serialize(resolvedContext); + + if (payload) { + this.stashResolvedModel(payload, resolvedContext); + payload.params = payload.params || {}; + payload.params[this.name] = params; } - updateURL(transition, newState, transition.intent.url); + return this.factory('resolved', { + context: resolvedContext, + name: this.name, + handler: this.handler, + params: params + }); + }, - transition.isActive = false; - router.activeTransition = null; + shouldSupercede: function(other) { + // Prefer this newer handlerInfo over `other` if: + // 1) The other one doesn't exist + // 2) The names don't match + // 3) This handler has a context that doesn't match + // the other one (or the other one doesn't have one). + // 4) This handler has parameters that don't match the other. + if (!other) { return true; } - trigger(router, router.currentHandlerInfos, true, ['didTransition']); + var contextsMatch = (other.context === this.context); + return other.name !== this.name || + (this.hasOwnProperty('context') && !contextsMatch) || + (this.hasOwnProperty('params') && !paramsMatch(this.params, other.params)); + } +}; - if (router.didTransition) { - router.didTransition(router.currentHandlerInfos); +Object.defineProperty(HandlerInfo.prototype, 'handler', { + get: function() { + // _handler could be set to either a handler object or undefined, so we + // compare against a default reference to know when it's been set + if (this._handler !== DEFAULT_HANDLER) { + return this._handler; } - log(router, transition.sequence, "TRANSITION COMPLETE."); + return this.fetchHandler(); + }, - // Resolve with the final handler. - return handlerInfos[handlerInfos.length - 1].handler; - } catch(e) { - if (!(e instanceof TransitionAborted)) { - //var erroneousHandler = handlerInfos.pop(); - var infos = transition.state.handlerInfos; - transition.trigger(true, 'error', e, transition, infos[infos.length-1].handler); - transition.abort(); + set: function(handler) { + return this._handler = handler; + } +}); + +Object.defineProperty(HandlerInfo.prototype, 'handlerPromise', { + get: function() { + if (this._handlerPromise) { + return this._handlerPromise; } - throw e; - } -} + this.fetchHandler(); -/** - @private + return this._handlerPromise; + }, - Begins and returns a Transition based on the provided - arguments. Accepts arguments in the form of both URL - transitions and named transitions. + set: function(handlerPromise) { + return this._handlerPromise = handlerPromise; + } +}); - @param {Router} router - @param {Array[Object]} args arguments passed to transitionTo, - replaceWith, or handleURL -*/ -function doTransition(router, args, isIntermediate) { - // Normalize blank transitions to root URL transitions. - var name = args[0] || '/'; +function paramsMatch(a, b) { + if ((!a) ^ (!b)) { + // Only one is null. + return false; + } - var lastArg = args[args.length-1]; - var queryParams = {}; - if (lastArg && lastArg.hasOwnProperty('queryParams')) { - queryParams = pop.call(args).queryParams; + if (!a) { + // Both must be null. + return true; } - var intent; - if (args.length === 0) { + // Note: this assumes that both params have the same + // number of keys, but since we're comparing the + // same handlers, they should. + for (var k in a) { + if (a.hasOwnProperty(k) && a[k] !== b[k]) { + return false; + } + } + return true; +} - log(router, "Updating query params"); +var ResolvedHandlerInfo = subclass(HandlerInfo, { + resolve: function(shouldContinue, payload) { + // A ResolvedHandlerInfo just resolved with itself. + if (payload && payload.resolvedModels) { + payload.resolvedModels[this.name] = this.context; + } + return rsvp.Promise.resolve(this, this.promiseLabel("Resolve")); + }, - // A query param update is really just a transition - // into the route you're already on. - var handlerInfos = router.state.handlerInfos; - intent = new NamedTransitionIntent({ - name: handlerInfos[handlerInfos.length - 1].name, - contexts: [], - queryParams: queryParams + getUnresolved: function() { + return this.factory('param', { + name: this.name, + handler: this.handler, + params: this.params }); + }, - } else if (name.charAt(0) === '/') { + isResolved: true +}); - log(router, "Attempting URL transition to " + name); - intent = new URLTransitionIntent({ url: name }); +var UnresolvedHandlerInfoByObject = subclass(HandlerInfo, { + getModel: function(payload) { + this.log(payload, this.name + ": resolving provided model"); + return rsvp.Promise.resolve(this.context); + }, - } else { + initialize: function(props) { + this.names = props.names || []; + this.context = props.context; + }, - log(router, "Attempting transition to " + name); - intent = new NamedTransitionIntent({ - name: args[0], - contexts: slice.call(args, 1), - queryParams: queryParams - }); - } + /** + @private - return router.transitionByIntent(intent, isIntermediate); -} + Serializes a handler using its custom `serialize` method or + by a default that looks up the expected property name from + the dynamic segment. -function handlerInfosEqual(handlerInfos, otherHandlerInfos) { - if (handlerInfos.length !== otherHandlerInfos.length) { - return false; - } + @param {Object} model the model to be serialized for this handler + */ + serialize: function(_model) { + var model = _model || this.context, + names = this.names, + serializer = this.serializer || (this.handler && this.handler.serialize); - for (var i = 0, len = handlerInfos.length; i < len; ++i) { - if (handlerInfos[i] !== otherHandlerInfos[i]) { - return false; + var object = {}; + if (isParam(model)) { + object[names[0]] = model; + return object; } - } - return true; -} - -function finalizeQueryParamChange(router, resolvedHandlers, newQueryParams, transition) { - // We fire a finalizeQueryParamChange event which - // gives the new route hierarchy a chance to tell - // us which query params it's consuming and what - // their final values are. If a query param is - // no longer consumed in the final route hierarchy, - // its serialized segment will be removed - // from the URL. - for (var k in newQueryParams) { - if (newQueryParams.hasOwnProperty(k) && - newQueryParams[k] === null) { - delete newQueryParams[k]; + // Use custom serialize if it exists. + if (serializer) { + return serializer(model, names); } - } - var finalQueryParamsArray = []; - trigger(router, resolvedHandlers, true, ['finalizeQueryParamChange', newQueryParams, finalQueryParamsArray, transition]); + if (names.length !== 1) { return; } - if (transition) { - transition._visibleQueryParams = {}; - } + var name = names[0]; - var finalQueryParams = {}; - for (var i = 0, len = finalQueryParamsArray.length; i < len; ++i) { - var qp = finalQueryParamsArray[i]; - finalQueryParams[qp.key] = qp.value; - if (transition && qp.visible !== false) { - transition._visibleQueryParams[qp.key] = qp.value; + if (/_id$/.test(name)) { + object[name] = model.id; + } else { + object[name] = model; } + return object; } - return finalQueryParams; -} - -function notifyExistingHandlers(router, newState, newTransition) { - var oldHandlers = router.state.handlerInfos, - changing = [], - leavingIndex = null, - leaving, leavingChecker, i, oldHandlerLen, oldHandler, newHandler; +}); - oldHandlerLen = oldHandlers.length; - for (i = 0; i < oldHandlerLen; i++) { - oldHandler = oldHandlers[i]; - newHandler = newState.handlerInfos[i]; +// Generated by URL transitions and non-dynamic route segments in named Transitions. +var UnresolvedHandlerInfoByParam = subclass (HandlerInfo, { + initialize: function(props) { + this.params = props.params || {}; + }, - if (!newHandler || oldHandler.name !== newHandler.name) { - leavingIndex = i; - break; + getModel: function(payload) { + var fullParams = this.params; + if (payload && payload.queryParams) { + fullParams = {}; + merge(fullParams, this.params); + fullParams.queryParams = payload.queryParams; } - if (!newHandler.isResolved) { - changing.push(oldHandler); - } - } + var handler = this.handler; + var hookName = resolveHook(handler, 'deserialize') || + resolveHook(handler, 'model'); - if (leavingIndex !== null) { - leaving = oldHandlers.slice(leavingIndex, oldHandlerLen); - leavingChecker = function(name) { - for (var h = 0, len = leaving.length; h < len; h++) { - if (leaving[h].name === name) { - return true; - } - } - return false; - }; + return this.runSharedModelHook(payload, hookName, [fullParams]); } +}); - trigger(router, oldHandlers, true, ['willTransition', newTransition]); +handlerInfoFactory.klasses = { + resolved: ResolvedHandlerInfo, + param: UnresolvedHandlerInfoByParam, + object: UnresolvedHandlerInfoByObject +}; - if (router.willTransition) { - router.willTransition(oldHandlers, newState.handlerInfos, newTransition); - } +function handlerInfoFactory(name, props) { + var Ctor = handlerInfoFactory.klasses[name], + handlerInfo = new Ctor(props || {}); + handlerInfo.factory = handlerInfoFactory; + return handlerInfo; } -exports['default'] = Router; -exports.Transition = Transition; +var NamedTransitionIntent = subclass(TransitionIntent, { + name: null, + pivotHandler: null, + contexts: null, + queryParams: null, -Object.defineProperty(exports, '__esModule', { value: true }); + initialize: function(props) { + this.name = props.name; + this.pivotHandler = props.pivotHandler; + this.contexts = props.contexts || []; + this.queryParams = props.queryParams; + }, -}); -/*! - * @overview RSVP - a tiny implementation of Promises/A+. - * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors - * @license Licensed under MIT license - * See https://raw.githubusercontent.com/tildeio/rsvp.js/master/LICENSE - * @version 3.2.1 - */ + applyToState: function(oldState, recognizer, getHandler, isIntermediate, getSerializer) { -enifed('rsvp', ['exports'], function (exports) { 'use strict'; + var partitionedArgs = extractQueryParams([this.name].concat(this.contexts)), + pureArgs = partitionedArgs[0], + handlers = recognizer.handlersFor(pureArgs[0]); -function indexOf(callbacks, callback) { - for (var i=0, l=callbacks.length; i= 0; --i) { + var result = handlers[i]; + var name = result.handler; - ```javascript - var object = {}; + var oldHandlerInfo = oldState.handlerInfos[i]; + var newHandlerInfo = null; - RSVP.EventTarget.mixin(object); + if (result.names.length > 0) { + if (i >= invalidateIndex) { + newHandlerInfo = this.createParamHandlerInfo(name, getHandler, result.names, objects, oldHandlerInfo); + } else { + var serializer = getSerializer(name); + newHandlerInfo = this.getHandlerInfoForDynamicSegment(name, getHandler, result.names, objects, oldHandlerInfo, targetRouteName, i, serializer); + } + } else { + // This route has no dynamic segment. + // Therefore treat as a param-based handlerInfo + // with empty params. This will cause the `model` + // hook to be called with empty params, which is desirable. + newHandlerInfo = this.createParamHandlerInfo(name, getHandler, result.names, objects, oldHandlerInfo); + } - object.on('finished', function(event) { - // handle event - }); + if (checkingIfActive) { + // If we're performing an isActive check, we want to + // serialize URL params with the provided context, but + // ignore mismatches between old and new context. + newHandlerInfo = newHandlerInfo.becomeResolved(null, newHandlerInfo.context); + var oldContext = oldHandlerInfo && oldHandlerInfo.context; + if (result.names.length > 0 && newHandlerInfo.context === oldContext) { + // If contexts match in isActive test, assume params also match. + // This allows for flexibility in not requiring that every last + // handler provide a `serialize` method + newHandlerInfo.params = oldHandlerInfo && oldHandlerInfo.params; + } + newHandlerInfo.context = oldContext; + } - object.trigger('finished', { detail: value }); - ``` + var handlerToUse = oldHandlerInfo; + if (i >= invalidateIndex || newHandlerInfo.shouldSupercede(oldHandlerInfo)) { + invalidateIndex = Math.min(i, invalidateIndex); + handlerToUse = newHandlerInfo; + } - `EventTarget.mixin` also works with prototypes: + if (isIntermediate && !checkingIfActive) { + handlerToUse = handlerToUse.becomeResolved(null, handlerToUse.context); + } - ```javascript - var Person = function() {}; - RSVP.EventTarget.mixin(Person.prototype); + newState.handlerInfos.unshift(handlerToUse); + } - var yehuda = new Person(); - var tom = new Person(); + if (objects.length > 0) { + throw new Error("More context objects were passed than there are dynamic segments for the route: " + targetRouteName); + } - yehuda.on('poke', function(event) { - console.log('Yehuda says OW'); - }); + if (!isIntermediate) { + this.invalidateChildren(newState.handlerInfos, invalidateIndex); + } - tom.on('poke', function(event) { - console.log('Tom says OW'); - }); + merge(newState.queryParams, this.queryParams || {}); - yehuda.trigger('poke'); - tom.trigger('poke'); - ``` + return newState; + }, - @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']; - object._promiseCallbacks = undefined; - return object; + invalidateChildren: function(handlerInfos, invalidateIndex) { + for (var i = invalidateIndex, l = handlerInfos.length; i < l; ++i) { + var handlerInfo = handlerInfos[i]; + handlerInfos[i] = handlerInfo.getUnresolved(); + } }, - /** - Registers a callback to be executed when `eventName` is triggered + getHandlerInfoForDynamicSegment: function(name, getHandler, names, objects, oldHandlerInfo, targetRouteName, i, serializer) { + var objectToUse; + if (objects.length > 0) { - ```javascript - object.on('event', function(eventInfo){ - // handle the event + // Use the objects provided for this transition. + objectToUse = objects[objects.length - 1]; + if (isParam(objectToUse)) { + return this.createParamHandlerInfo(name, getHandler, names, objects, oldHandlerInfo); + } else { + objects.pop(); + } + } else if (oldHandlerInfo && oldHandlerInfo.name === name) { + // Reuse the matching oldHandlerInfo + return oldHandlerInfo; + } else { + if (this.preTransitionState) { + var preTransitionHandlerInfo = this.preTransitionState.handlerInfos[i]; + objectToUse = preTransitionHandlerInfo && preTransitionHandlerInfo.context; + } else { + // Ideally we should throw this error to provide maximal + // information to the user that not enough context objects + // were provided, but this proves too cumbersome in Ember + // in cases where inner template helpers are evaluated + // before parent helpers un-render, in which cases this + // error somewhat prematurely fires. + //throw new Error("Not enough context objects were provided to complete a transition to " + targetRouteName + ". Specifically, the " + name + " route needs an object that can be serialized into its dynamic URL segments [" + names.join(', ') + "]"); + return oldHandlerInfo; + } + } + + return handlerInfoFactory('object', { + name: name, + getHandler: getHandler, + serializer: serializer, + context: objectToUse, + names: names }); + }, - object.trigger('event'); - ``` + createParamHandlerInfo: function(name, getHandler, names, objects, oldHandlerInfo) { + var params = {}; - @method on - @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) { - if (typeof callback !== 'function') { - throw new TypeError('Callback must be a function'); + // Soak up all the provided string/numbers + var numNames = names.length; + while (numNames--) { + + // Only use old params if the names match with the new handler + var oldParams = (oldHandlerInfo && name === oldHandlerInfo.name && oldHandlerInfo.params) || {}; + + var peek = objects[objects.length - 1]; + var paramName = names[numNames]; + if (isParam(peek)) { + 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); + } + } } - var allCallbacks = callbacksFor(this), callbacks; + return handlerInfoFactory('param', { + name: name, + getHandler: getHandler, + params: params + }); + } +}); + +function UnrecognizedURLError(message) { + if (!(this instanceof UnrecognizedURLError)) { + return new UnrecognizedURLError(message); + } - callbacks = allCallbacks[eventName]; + var error = Error.call(this, message); - if (!callbacks) { - callbacks = allCallbacks[eventName] = []; - } + if (Error.captureStackTrace) { + Error.captureStackTrace(this, UnrecognizedURLError); + } else { + this.stack = error.stack; + } - if (indexOf(callbacks, callback) === -1) { - callbacks.push(callback); - } - }, + this.description = error.description; + this.fileName = error.fileName; + this.lineNumber = error.lineNumber; + this.message = error.message || 'UnrecognizedURL'; + this.name = 'UnrecognizedURLError'; + this.number = error.number; + this.code = error.code; +} - /** - You can use `off` to stop firing a particular callback for an event: +UnrecognizedURLError.prototype = oCreate(Error.prototype); - ```javascript - function doStuff() { // do stuff! } - object.on('stuff', doStuff); +var URLTransitionIntent = subclass(TransitionIntent, { + url: null, - object.trigger('stuff'); // doStuff will be called + initialize: function(props) { + this.url = props.url; + }, - // Unregister ONLY the doStuff callback - object.off('stuff', doStuff); - object.trigger('stuff'); // doStuff will NOT be called - ``` + applyToState: function(oldState, recognizer, getHandler) { + var newState = new TransitionState(); - If you don't pass a `callback` argument to `off`, ALL callbacks for the - event will not be executed when the event fires. For example: + var results = recognizer.recognize(this.url), + i, len; - ```javascript - var callback1 = function(){}; - var callback2 = function(){}; + if (!results) { + throw new UnrecognizedURLError(this.url); + } + + var statesDiffer = false; + var url = this.url; - object.on('stuff', callback1); - object.on('stuff', callback2); + // Checks if a handler is accessible by URL. If it is not, an error is thrown. + // For the case where the handler is loaded asynchronously, the error will be + // thrown once it is loaded. + function checkHandlerAccessibility(handler) { + if (handler && handler.inaccessibleByURL) { + throw new UnrecognizedURLError(url); + } - object.trigger('stuff'); // callback1 and callback2 will be executed. + return handler; + } - object.off('stuff'); - object.trigger('stuff'); // callback1 and callback2 will not be executed! - ``` + for (i = 0, len = results.length; i < len; ++i) { + var result = results[i]; + var name = result.handler; + var newHandlerInfo = handlerInfoFactory('param', { + name: name, + getHandler: getHandler, + params: result.params + }); + var handler = newHandlerInfo.handler; - @method off - @for RSVP.EventTarget - @private - @param {String} eventName event to stop listening to - @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) { - var allCallbacks = callbacksFor(this), callbacks, index; + if (handler) { + checkHandlerAccessibility(handler); + } else { + // If the hanlder is being loaded asynchronously, check if we can + // access it after it has resolved + newHandlerInfo.handlerPromise = newHandlerInfo.handlerPromise.then(checkHandlerAccessibility); + } - if (!callback) { - allCallbacks[eventName] = []; - return; + var oldHandlerInfo = oldState.handlerInfos[i]; + if (statesDiffer || newHandlerInfo.shouldSupercede(oldHandlerInfo)) { + statesDiffer = true; + newState.handlerInfos[i] = newHandlerInfo; + } else { + newState.handlerInfos[i] = oldHandlerInfo; + } } - callbacks = allCallbacks[eventName]; - - index = indexOf(callbacks, callback); - - if (index !== -1) { callbacks.splice(index, 1); } - }, + merge(newState.queryParams, results.queryParams); - /** - Use `trigger` to fire custom events. For example: + return newState; + } +}); - ```javascript - object.on('foo', function(){ - console.log('foo event happened!'); - }); - object.trigger('foo'); - // 'foo event happened!' logged to the console - ``` +var pop = Array.prototype.pop; - You can also pass a value as a second argument to `trigger` that will be - passed as an argument to all event listeners for the event: +function Router(_options) { + var options = _options || {}; + this.getHandler = options.getHandler || this.getHandler; + this.getSerializer = options.getSerializer || this.getSerializer; + this.updateURL = options.updateURL || this.updateURL; + this.replaceURL = options.replaceURL || this.replaceURL; + this.didTransition = options.didTransition || this.didTransition; + this.willTransition = options.willTransition || this.willTransition; + this.delegate = options.delegate || this.delegate; + this.triggerEvent = options.triggerEvent || this.triggerEvent; + this.log = options.log || this.log; + this.dslCallBacks = []; // NOTE: set by Ember + this.state = undefined; + this.activeTransition = undefined; + this._changedQueryParams = undefined; + this.oldState = undefined; + this.currentHandlerInfos = undefined; + this.state = undefined; + this.currentSequence = 0; - ```javascript - object.on('foo', function(value){ - console.log(value.name); - }); + this.recognizer = new RouteRecognizer(); + this.reset(); +} - object.trigger('foo', { name: 'bar' }); - // 'bar' logged to the console - ``` +function getTransitionByIntent(intent, isIntermediate) { + var wasTransitioning = !!this.activeTransition; + var oldState = wasTransitioning ? this.activeTransition.state : this.state; + var newTransition; - @method trigger - @for RSVP.EventTarget - @private - @param {String} eventName name of the event to be triggered - @param {*} options optional value to be passed to any event handlers for - the given `eventName` - */ - 'trigger': function(eventName, options, label) { - var allCallbacks = callbacksFor(this), callbacks, callback; + var newState = intent.applyToState(oldState, this.recognizer, this.getHandler, isIntermediate, this.getSerializer); + var queryParamChangelist = getChangelist(oldState.queryParams, newState.queryParams); - if (callbacks = allCallbacks[eventName]) { - // Don't cache the callbacks.length since it may grow - for (var i=0; i 1) { - throw new Error('Second argument not supported'); - } - if (typeof o !== 'object') { - throw new TypeError('Argument must be an object'); - } - F.prototype = o; - return new F(); -}); +Router.prototype = { -var queue = []; + /** + The main entry point into the router. The API is essentially + the same as the `map` method in `route-recognizer`. -function scheduleFlush() { - setTimeout(function() { - var entry; - for (var i = 0; i < queue.length; i++) { - entry = queue[i]; + This method extracts the String handler at the last `.to()` + call and uses it as the name of the whole route. - var payload = entry.payload; + @param {Function} callback + */ + map: function(callback) { + this.recognizer.delegate = this.delegate; - payload.guid = payload.key + payload.id; - payload.childGuid = payload.key + payload.childId; - if (payload.error) { - payload.stack = payload.error.stack; + this.recognizer.map(callback, function(recognizer, routes) { + for (var i = routes.length - 1, proceed = true; i >= 0 && proceed; --i) { + var route = routes[i]; + recognizer.add(routes, { as: route.handler }); + proceed = route.path === '/' || route.path === '' || route.handler.slice(-6) === '.index'; } + }); + }, - config['trigger'](entry.name, entry.payload); - } - queue.length = 0; - }, 50); -} + hasRoute: function(route) { + return this.recognizer.hasRoute(route); + }, -function instrument(eventName, promise, child) { - if (1 === queue.push({ - name: eventName, - payload: { - key: promise._guidKey, - id: promise._id, - eventName: eventName, - detail: promise._result, - childId: child && child._id, - label: promise._label, - timeStamp: now(), - error: config["instrument-with-stack"] ? new Error(promise._label) : null - }})) { - scheduleFlush(); - } - } + getHandler: function() {}, -/** - `RSVP.Promise.resolve` returns a promise that will become resolved with the - passed `value`. It is shorthand for the following: + getSerializer: function() {}, - ```javascript - var promise = new RSVP.Promise(function(resolve, reject){ - resolve(1); - }); + queryParamsTransition: function(changelist, wasTransitioning, oldState, newState) { + var router = this; - promise.then(function(value){ - // value === 1 - }); - ``` + fireQueryParamDidChange(this, newState, changelist); - Instead of writing the above, your code now simply becomes the following: + if (!wasTransitioning && this.activeTransition) { + // One of the handlers in queryParamsDidChange + // caused a transition. Just return that transition. + return this.activeTransition; + } else { + // Running queryParamsDidChange didn't change anything. + // Just update query params and be on our way. - ```javascript - var promise = RSVP.Promise.resolve(1); + // We have to return a noop transition that will + // perform a URL update at the end. This gives + // the user the ability to set the url update + // method (default is replaceState). + var newTransition = new Transition(this); + newTransition.queryParamsOnly = true; - promise.then(function(value){ - // value === 1 - }); - ``` + oldState.queryParams = finalizeQueryParamChange(this, newState.handlerInfos, newState.queryParams, newTransition); - @method resolve - @static - @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` -*/ -function resolve$1(object, label) { - /*jshint validthis:true */ - var Constructor = this; + newTransition.promise = newTransition.promise.then(function(result) { + updateURL(newTransition, oldState, true); + if (router.didTransition) { + router.didTransition(router.currentHandlerInfos); + } + return result; + }, null, promiseLabel("Transition complete")); + return newTransition; + } + }, - if (object && typeof object === 'object' && object.constructor === Constructor) { - return object; - } + // NOTE: this doesn't really belong here, but here + // it shall remain until our ES6 transpiler can + // handle cyclical deps. + transitionByIntent: function(intent/*, isIntermediate*/) { + try { + return getTransitionByIntent.apply(this, arguments); + } catch(e) { + return new Transition(this, intent, null, e); + } + }, - var promise = new Constructor(noop, label); - resolve(promise, object); - return promise; -} + /** + Clears the current and target route handlers and triggers exit + on each of them starting at the leaf and traversing up through + its ancestors. + */ + reset: function() { + if (this.state) { + forEach(this.state.handlerInfos.slice().reverse(), function(handlerInfo) { + var handler = handlerInfo.handler; + callHook(handler, 'exit'); + }); + } -function withOwnPromise() { - return new TypeError('A promises callback cannot return that same promise.'); -} + this.oldState = undefined; + this.state = new TransitionState(); + this.currentHandlerInfos = null; + }, -function noop() {} + activeTransition: null, -var PENDING = void 0; -var FULFILLED = 1; -var REJECTED = 2; + /** + var handler = handlerInfo.handler; + The entry point for handling a change to the URL (usually + via the back and forward button). -var GET_THEN_ERROR = new ErrorObject(); + Returns an Array of handlers and the parameters associated + with those parameters. -function getThen(promise) { - try { - return promise.then; - } catch(error) { - GET_THEN_ERROR.error = error; - return GET_THEN_ERROR; - } -} + @param {String} url a URL to process -function tryThen(then, value, fulfillmentHandler, rejectionHandler) { - try { - then.call(value, fulfillmentHandler, rejectionHandler); - } catch(e) { - return e; - } -} + @return {Array} an Array of `[handler, parameter]` tuples + */ + handleURL: function(url) { + // Perform a URL-based transition, but don't change + // the URL afterward, since it already happened. + var args = slice.call(arguments); + if (url.charAt(0) !== '/') { args[0] = '/' + url; } -function handleForeignThenable(promise, thenable, then) { - config.async(function(promise) { - var sealed = false; - var error = tryThen(then, thenable, function(value) { - if (sealed) { return; } - sealed = true; - if (thenable !== value) { - resolve(promise, value, undefined); - } else { - fulfill(promise, value); - } - }, function(reason) { - if (sealed) { return; } - sealed = true; + return doTransition(this, args).method(null); + }, - reject(promise, reason); - }, 'Settle: ' + (promise._label || ' unknown promise')); + /** + Hook point for updating the URL. - if (!sealed && error) { - sealed = true; - reject(promise, error); - } - }, promise); -} + @param {String} url a URL to update to + */ + updateURL: function() { + throw new Error("updateURL is not implemented"); + }, -function handleOwnThenable(promise, thenable) { - if (thenable._state === FULFILLED) { - fulfill(promise, thenable._result); - } else if (thenable._state === REJECTED) { - thenable._onError = null; - reject(promise, thenable._result); - } else { - subscribe(thenable, undefined, function(value) { - if (thenable !== value) { - resolve(promise, value, undefined); - } else { - fulfill(promise, value); - } - }, function(reason) { - reject(promise, reason); - }); - } -} + /** + Hook point for replacing the current URL, i.e. with replaceState -function handleMaybeThenable(promise, maybeThenable, then$$) { - if (maybeThenable.constructor === promise.constructor && - then$$ === then && - constructor.resolve === resolve$1) { - handleOwnThenable(promise, maybeThenable); - } else { - if (then$$ === GET_THEN_ERROR) { - reject(promise, GET_THEN_ERROR.error); - } else if (then$$ === undefined) { - fulfill(promise, maybeThenable); - } else if (isFunction(then$$)) { - handleForeignThenable(promise, maybeThenable, then$$); - } else { - fulfill(promise, maybeThenable); - } - } -} + By default this behaves the same as `updateURL` -function resolve(promise, value) { - if (promise === value) { - fulfill(promise, value); - } else if (objectOrFunction(value)) { - handleMaybeThenable(promise, value, getThen(value)); - } else { - fulfill(promise, value); - } -} + @param {String} url a URL to update to + */ + replaceURL: function(url) { + this.updateURL(url); + }, -function publishRejection(promise) { - if (promise._onError) { - promise._onError(promise._result); - } + /** + Transition into the specified named route. - publish(promise); -} + If necessary, trigger the exit callback on any handlers + that are no longer represented by the target route. -function fulfill(promise, value) { - if (promise._state !== PENDING) { return; } + @param {String} name the name of the route + */ + transitionTo: function(/*name*/) { + return doTransition(this, arguments); + }, - promise._result = value; - promise._state = FULFILLED; + intermediateTransitionTo: function(/*name*/) { + return doTransition(this, arguments, true); + }, - if (promise._subscribers.length === 0) { - if (config.instrument) { - instrument('fulfilled', promise); + refresh: function(pivotHandler) { + var state = this.activeTransition ? this.activeTransition.state : this.state; + var handlerInfos = state.handlerInfos; + var params = {}; + for (var i = 0, len = handlerInfos.length; i < len; ++i) { + var handlerInfo = handlerInfos[i]; + params[handlerInfo.name] = handlerInfo.params || {}; } - } else { - config.async(publish, promise); - } -} -function reject(promise, reason) { - if (promise._state !== PENDING) { return; } - promise._state = REJECTED; - promise._result = reason; - config.async(publishRejection, promise); -} + log(this, "Starting a refresh transition"); + var intent = new NamedTransitionIntent({ + name: handlerInfos[handlerInfos.length - 1].name, + pivotHandler: pivotHandler || handlerInfos[0].handler, + contexts: [], // TODO collect contexts...? + queryParams: this._changedQueryParams || state.queryParams || {} + }); -function subscribe(parent, child, onFulfillment, onRejection) { - var subscribers = parent._subscribers; - var length = subscribers.length; + return this.transitionByIntent(intent, false); + }, - parent._onError = null; + /** + Identical to `transitionTo` except that the current URL will be replaced + if possible. - subscribers[length] = child; - subscribers[length + FULFILLED] = onFulfillment; - subscribers[length + REJECTED] = onRejection; + This method is intended primarily for use with `replaceState`. - if (length === 0 && parent._state) { - config.async(publish, parent); - } -} + @param {String} name the name of the route + */ + replaceWith: function(/*name*/) { + return doTransition(this, arguments).method('replace'); + }, -function publish(promise) { - var subscribers = promise._subscribers; - var settled = promise._state; + /** + Take a named route and context objects and generate a + URL. - if (config.instrument) { - instrument(settled === FULFILLED ? 'fulfilled' : 'rejected', promise); - } + @param {String} name the name of the route to generate + a URL for + @param {...Object} objects a list of objects to serialize - if (subscribers.length === 0) { return; } + @return {String} a URL + */ + generate: function(handlerName) { - var child, callback, detail = promise._result; + var partitionedArgs = extractQueryParams(slice.call(arguments, 1)), + suppliedParams = partitionedArgs[0], + queryParams = partitionedArgs[1]; - for (var i = 0; i < subscribers.length; i += 3) { - child = subscribers[i]; - callback = subscribers[i + settled]; + // Construct a TransitionIntent with the provided params + // and apply it to the present state of the router. + var intent = new NamedTransitionIntent({ name: handlerName, contexts: suppliedParams }); + var state = intent.applyToState(this.state, this.recognizer, this.getHandler, null, this.getSerializer); + var params = {}; - if (child) { - invokeCallback(settled, child, callback, detail); - } else { - callback(detail); + for (var i = 0, len = state.handlerInfos.length; i < len; ++i) { + var handlerInfo = state.handlerInfos[i]; + var handlerParams = handlerInfo.serialize(); + merge(params, handlerParams); } - } + params.queryParams = queryParams; - promise._subscribers.length = 0; -} + return this.recognizer.generate(handlerName, params); + }, -function ErrorObject() { - this.error = null; -} + applyIntent: function(handlerName, contexts) { + var intent = new NamedTransitionIntent({ + name: handlerName, + contexts: contexts + }); -var TRY_CATCH_ERROR = new ErrorObject(); + var state = this.activeTransition && this.activeTransition.state || this.state; + return intent.applyToState(state, this.recognizer, this.getHandler, null, this.getSerializer); + }, -function tryCatch(callback, detail) { - try { - return callback(detail); - } catch(e) { - TRY_CATCH_ERROR.error = e; - return TRY_CATCH_ERROR; - } -} + isActiveIntent: function(handlerName, contexts, queryParams, _state) { + var state = _state || this.state, + targetHandlerInfos = state.handlerInfos, + handlerInfo, len; -function invokeCallback(settled, promise, callback, detail) { - var hasCallback = isFunction(callback), - value, error, succeeded, failed; + if (!targetHandlerInfos.length) { return false; } - if (hasCallback) { - value = tryCatch(callback, detail); + var targetHandler = targetHandlerInfos[targetHandlerInfos.length - 1].name; + var recogHandlers = this.recognizer.handlersFor(targetHandler); - if (value === TRY_CATCH_ERROR) { - failed = true; - error = value.error; - value = null; - } else { - succeeded = true; + var index = 0; + for (len = recogHandlers.length; index < len; ++index) { + handlerInfo = targetHandlerInfos[index]; + if (handlerInfo.name === handlerName) { break; } } - if (promise === value) { - reject(promise, withOwnPromise()); - return; + if (index === recogHandlers.length) { + // The provided route name isn't even in the route hierarchy. + return false; } - } else { - value = detail; - succeeded = true; - } - - 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); - } -} + var testState = new TransitionState(); + testState.handlerInfos = targetHandlerInfos.slice(0, index + 1); + recogHandlers = recogHandlers.slice(0, index + 1); -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); + var intent = new NamedTransitionIntent({ + name: targetHandler, + contexts: contexts }); - } catch(e) { - reject(promise, e); - } -} -function then(onFulfillment, onRejection, label) { - var parent = this; - var state = parent._state; + var newState = intent.applyToHandlers(testState, recogHandlers, this.getHandler, targetHandler, true, true, this.getSerializer); - if (state === FULFILLED && !onFulfillment || state === REJECTED && !onRejection) { - config.instrument && instrument('chained', parent, parent); - return parent; - } + var handlersEqual = handlerInfosEqual(newState.handlerInfos, testState.handlerInfos); + if (!queryParams || !handlersEqual) { + return handlersEqual; + } - parent._onError = null; + // Get a hash of QPs that will still be active on new route + var activeQPsOnNewHandler = {}; + merge(activeQPsOnNewHandler, queryParams); - var child = new parent.constructor(noop, label); - var result = parent._result; + var activeQueryParams = state.queryParams; + for (var key in activeQueryParams) { + if (activeQueryParams.hasOwnProperty(key) && + activeQPsOnNewHandler.hasOwnProperty(key)) { + activeQPsOnNewHandler[key] = activeQueryParams[key]; + } + } - config.instrument && instrument('chained', parent, child); + return handlersEqual && !getChangelist(activeQPsOnNewHandler, queryParams); + }, - if (state) { - var callback = arguments[state - 1]; - config.async(function(){ - invokeCallback(state, child, callback, result); - }); - } else { - subscribe(parent, child, onFulfillment, onRejection); - } + isActive: function(handlerName) { + var partitionedArgs = extractQueryParams(slice.call(arguments, 1)); + return this.isActiveIntent(handlerName, partitionedArgs[0], partitionedArgs[1]); + }, - return child; -} + trigger: function(/*name*/) { + var args = slice.call(arguments); + trigger(this, this.currentHandlerInfos, false, args); + }, -function makeSettledResult(state, position, value) { - if (state === FULFILLED) { - return { - state: 'fulfilled', - value: value - }; - } else { - return { - state: 'rejected', - reason: value - }; - } -} + /** + Hook point for logging transition status updates. -function Enumerator(Constructor, input, abortOnReject, label) { - this._instanceConstructor = Constructor; - this.promise = new Constructor(noop, label); - this._abortOnReject = abortOnReject; + @param {String} message The message to log. + */ + log: null +}; - if (this._validateInput(input)) { - this._input = input; - this.length = input.length; - this._remaining = input.length; +/** + @private - this._init(); + Fires queryParamsDidChange event +*/ +function fireQueryParamDidChange(router, newState, queryParamChangelist) { + // If queryParams changed trigger event + if (queryParamChangelist) { - if (this.length === 0) { - fulfill(this.promise, this._result); - } else { - this.length = this.length || 0; - this._enumerate(); - if (this._remaining === 0) { - fulfill(this.promise, this._result); - } - } - } else { - reject(this.promise, this._validationError()); + // This is a little hacky but we need some way of storing + // changed query params given that no activeTransition + // is guaranteed to have occurred. + router._changedQueryParams = queryParamChangelist.all; + trigger(router, newState.handlerInfos, true, ['queryParamsDidChange', queryParamChangelist.changed, queryParamChangelist.all, queryParamChangelist.removed]); + router._changedQueryParams = null; } } -Enumerator.prototype._validateInput = function(input) { - return isArray(input); -}; +/** + @private -Enumerator.prototype._validationError = function() { - return new Error('Array Methods must be provided an Array'); -}; + Takes an Array of `HandlerInfo`s, figures out which ones are + exiting, entering, or changing contexts, and calls the + proper handler hooks. -Enumerator.prototype._init = function() { - this._result = new Array(this.length); -}; + For example, consider the following tree of handlers. Each handler is + followed by the URL segment it handles. -Enumerator.prototype._enumerate = function() { - var length = this.length; - var promise = this.promise; - var input = this._input; + ``` + |~index ("/") + | |~posts ("/posts") + | | |-showPost ("/:id") + | | |-newPost ("/new") + | | |-editPost ("/edit") + | |~about ("/about/:id") + ``` - for (var i = 0; promise._state === PENDING && i < length; i++) { - this._eachEntry(input[i], i); - } -}; + Consider the following transitions: -Enumerator.prototype._settleMaybeThenable = function(entry, i) { - var c = this._instanceConstructor; - var resolve = c.resolve; + 1. A URL transition to `/posts/1`. + 1. Triggers the `*model` callbacks on the + `index`, `posts`, and `showPost` handlers + 2. Triggers the `enter` callback on the same + 3. Triggers the `setup` callback on the same + 2. A direct transition to `newPost` + 1. Triggers the `exit` callback on `showPost` + 2. Triggers the `enter` callback on `newPost` + 3. Triggers the `setup` callback on `newPost` + 3. A direct transition to `about` with a specified + context object + 1. Triggers the `exit` callback on `newPost` + and `posts` + 2. Triggers the `serialize` callback on `about` + 3. Triggers the `enter` callback on `about` + 4. Triggers the `setup` callback on `about` - if (resolve === resolve$1) { - var then$$ = getThen(entry); + @param {Router} transition + @param {TransitionState} newState +*/ +function setupContexts(router, newState, transition) { + var partition = partitionHandlers(router.state, newState); + var i, l, handler; - if (then$$ === then && - entry._state !== PENDING) { - entry._onError = null; - this._settledAt(entry._state, i, entry._result); - } else if (typeof then$$ !== 'function') { - this._remaining--; - this._result[i] = this._makeResult(FULFILLED, i, entry); - } else if (c === Promise) { - var promise = new c(noop); - handleMaybeThenable(promise, entry, then$$); - this._willSettleAt(promise, i); - } else { - this._willSettleAt(new c(function(resolve) { resolve(entry); }), i); - } - } else { - this._willSettleAt(resolve(entry), i); - } -}; + for (i=0, l=partition.exited.length; i= 0; --i) { + var handlerInfo = handlerInfos[i]; + merge(params, handlerInfo.params); + if (handlerInfo.handler.inaccessibleByURL) { + urlMethod = null; + } + } - @method reject - @static - @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$1(reason, label) { - /*jshint validthis:true */ - var Constructor = this; - var promise = new Constructor(noop, label); - reject(promise, reason); - return promise; -} + if (urlMethod) { + params.queryParams = transition._visibleQueryParams || state.queryParams; + var url = router.recognizer.generate(handlerName, params); -var guidKey = 'rsvp_' + now() + '-'; -var counter = 0; + // transitions during the initial transition must always use replaceURL. + // When the app boots, you are at a url, e.g. /foo. If some handler + // redirects to bar as part of the initial transition, you don't want to + // add a history entry for /foo. If you do, pressing back will immediately + // hit the redirect again and take you back to /bar, thus killing the back + // button + var initial = transition.isCausedByInitialTransition; -function needsResolver() { - throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); -} + // say you are at / and you click a link to route /foo. In /foo's + // handler, the transition is aborted using replacewith('/bar'). + // Because the current url is still /, the history entry for / is + // removed from the history. Clicking back will take you to the page + // you were on before /, which is often not even the app, thus killing + // the back button. That's why updateURL is always correct for an + // aborting transition that's not the initial transition + var replaceAndNotAborting = ( + urlMethod === 'replace' && + !transition.isCausedByAbortingTransition + ); -function needsNew() { - throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); + if (initial || replaceAndNotAborting) { + router.replaceURL(url); + } else { + router.updateURL(url); + } + } } /** - 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 - why the promise cannot be fulfilled. - - Terminology - ----------- - - - `promise` is an object or function with a `then` method whose behavior conforms to this specification. - - `thenable` is an object or function that defines a `then` method. - - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). - - `exception` is a value that is thrown using the throw statement. - - `reason` is a value that indicates why a promise was rejected. - - `settled` the final resting state of a promise, fulfilled or rejected. - - A promise can be in one of three states: pending, fulfilled, or rejected. + @private - Promises that are fulfilled have a fulfillment value and are in the fulfilled - state. Promises that are rejected have a rejection reason and are in the - rejected state. A fulfillment value is never a thenable. + Updates the URL (if necessary) and calls `setupContexts` + to update the router's array of `currentHandlerInfos`. + */ +function finalizeTransition(transition, newState) { - Promises can also be said to *resolve* a value. If this value is also a - promise, then the original promise's settled state will match the value's - settled state. So a promise that *resolves* a promise that rejects will - itself reject, and a promise that *resolves* a promise that fulfills will - itself fulfill. + try { + log(transition.router, transition.sequence, "Resolved all models on destination route; finalizing transition."); + var router = transition.router, + handlerInfos = newState.handlerInfos; - Basic Usage: - ------------ + // Run all the necessary enter/setup/exit hooks + setupContexts(router, newState, transition); - ```js - var promise = new Promise(function(resolve, reject) { - // on success - resolve(value); + // Check if a redirect occurred in enter/setup + if (transition.isAborted) { + // TODO: cleaner way? distinguish b/w targetHandlerInfos? + router.state.handlerInfos = router.currentHandlerInfos; + return rsvp.Promise.reject(logAbort(transition)); + } - // on failure - reject(reason); - }); + updateURL(transition, newState, transition.intent.url); - promise.then(function(value) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` + transition.isActive = false; + router.activeTransition = null; - Advanced Usage: - --------------- + trigger(router, router.currentHandlerInfos, true, ['didTransition']); - Promises shine when abstracting away asynchronous interactions such as - `XMLHttpRequest`s. + if (router.didTransition) { + router.didTransition(router.currentHandlerInfos); + } - ```js - function getJSON(url) { - return new Promise(function(resolve, reject){ - var xhr = new XMLHttpRequest(); + log(router, transition.sequence, "TRANSITION COMPLETE."); - xhr.open('GET', url); - xhr.onreadystatechange = handler; - xhr.responseType = 'json'; - xhr.setRequestHeader('Accept', 'application/json'); - xhr.send(); + // Resolve with the final handler. + return handlerInfos[handlerInfos.length - 1].handler; + } catch(e) { + if (!(e instanceof TransitionAbortedError)) { + //var erroneousHandler = handlerInfos.pop(); + var infos = transition.state.handlerInfos; + transition.trigger(true, 'error', e, transition, infos[infos.length-1].handler); + transition.abort(); + } - function handler() { - if (this.readyState === this.DONE) { - if (this.status === 200) { - resolve(this.response); - } else { - reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); - } - } - }; - }); + throw e; } +} - getJSON('/posts.json').then(function(json) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` - - Unlike callbacks, promises are great composable primitives. - - ```js - Promise.all([ - getJSON('/posts'), - getJSON('/comments') - ]).then(function(values){ - values[0] // => postsJSON - values[1] // => commentsJSON +/** + @private - return values; - }); - ``` + Begins and returns a Transition based on the provided + arguments. Accepts arguments in the form of both URL + transitions and named transitions. - @class RSVP.Promise - @param {function} resolver - @param {String} label optional string for labeling the promise. - Useful for tooling. - @constructor + @param {Router} router + @param {Array[Object]} args arguments passed to transitionTo, + replaceWith, or handleURL */ -function Promise(resolver, label) { - this._id = counter++; - this._label = label; - this._state = undefined; - this._result = undefined; - this._subscribers = []; - - config.instrument && instrument('created', this); +function doTransition(router, args, isIntermediate) { + // Normalize blank transitions to root URL transitions. + var name = args[0] || '/'; - if (noop !== resolver) { - typeof resolver !== 'function' && needsResolver(); - this instanceof Promise ? initializePromise(this, resolver) : needsNew(); + var lastArg = args[args.length-1]; + var queryParams = {}; + if (lastArg && lastArg.hasOwnProperty('queryParams')) { + queryParams = pop.call(args).queryParams; } -} - -Promise.cast = resolve$1; // deprecated -Promise.all = all; -Promise.race = race; -Promise.resolve = resolve$1; -Promise.reject = reject$1; -Promise.prototype = { - constructor: Promise, + var intent; + if (args.length === 0) { - _guidKey: guidKey, + log(router, "Updating query params"); - _onError: function (reason) { - var promise = this; - config.after(function() { - if (promise._onError) { - config['trigger']('error', reason, promise._label); - } + // A query param update is really just a transition + // into the route you're already on. + var handlerInfos = router.state.handlerInfos; + intent = new NamedTransitionIntent({ + name: handlerInfos[handlerInfos.length - 1].name, + contexts: [], + queryParams: queryParams }); - }, - -/** - 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 why the promise cannot be fulfilled. - - ```js - findUser().then(function(user){ - // user is available - }, function(reason){ - // user is unavailable, and you are given the reason why - }); - ``` - Chaining - -------- - - The return value of `then` is itself a promise. This second, 'downstream' - promise is resolved with the return value of the first promise's fulfillment - or rejection handler, or rejected if the handler throws an exception. - - ```js - findUser().then(function (user) { - return user.name; - }, function (reason) { - return 'default name'; - }).then(function (userName) { - // If `findUser` fulfilled, `userName` will be the user's name, otherwise it - // will be `'default name'` - }); + } else if (name.charAt(0) === '/') { - findUser().then(function (user) { - throw new Error('Found user, but still unhappy'); - }, function (reason) { - throw new Error('`findUser` rejected and we're unhappy'); - }).then(function (value) { - // never reached - }, function (reason) { - // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. - // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. - }); - ``` - If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. - - ```js - findUser().then(function (user) { - throw new PedagogicalException('Upstream error'); - }).then(function (value) { - // never reached - }).then(function (value) { - // never reached - }, function (reason) { - // The `PedgagocialException` is propagated all the way down to here - }); - ``` + log(router, "Attempting URL transition to " + name); + intent = new URLTransitionIntent({ url: name }); - Assimilation - ------------ + } else { - Sometimes the value you want to propagate to a downstream promise can only be - retrieved asynchronously. This can be achieved by returning a promise in the - fulfillment or rejection handler. The downstream promise will then be pending - until the returned promise is settled. This is called *assimilation*. + log(router, "Attempting transition to " + name); + intent = new NamedTransitionIntent({ + name: args[0], + contexts: slice.call(args, 1), + queryParams: queryParams + }); + } - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // The user's comments are now available - }); - ``` + return router.transitionByIntent(intent, isIntermediate); +} - If the assimliated promise rejects, then the downstream promise will also reject. +function handlerInfosEqual(handlerInfos, otherHandlerInfos) { + if (handlerInfos.length !== otherHandlerInfos.length) { + return false; + } - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // If `findCommentsByAuthor` fulfills, we'll have the value here - }, function (reason) { - // If `findCommentsByAuthor` rejects, we'll have the reason here - }); - ``` + for (var i = 0, len = handlerInfos.length; i < len; ++i) { + if (handlerInfos[i] !== otherHandlerInfos[i]) { + return false; + } + } + return true; +} - Simple Example - -------------- +function finalizeQueryParamChange(router, resolvedHandlers, newQueryParams, transition) { + // We fire a finalizeQueryParamChange event which + // gives the new route hierarchy a chance to tell + // us which query params it's consuming and what + // their final values are. If a query param is + // no longer consumed in the final route hierarchy, + // its serialized segment will be removed + // from the URL. - Synchronous Example + for (var k in newQueryParams) { + if (newQueryParams.hasOwnProperty(k) && + newQueryParams[k] === null) { + delete newQueryParams[k]; + } + } - ```javascript - var result; + var finalQueryParamsArray = []; + trigger(router, resolvedHandlers, true, ['finalizeQueryParamChange', newQueryParams, finalQueryParamsArray, transition]); - try { - result = findResult(); - // success - } catch(reason) { - // failure + if (transition) { + transition._visibleQueryParams = {}; } - ``` - Errback Example - - ```js - findResult(function(result, err){ - if (err) { - // failure - } else { - // success + var finalQueryParams = {}; + for (var i = 0, len = finalQueryParamsArray.length; i < len; ++i) { + var qp = finalQueryParamsArray[i]; + finalQueryParams[qp.key] = qp.value; + if (transition && qp.visible !== false) { + transition._visibleQueryParams[qp.key] = qp.value; } - }); - ``` - - Promise Example; + } + return finalQueryParams; +} - ```javascript - findResult().then(function(result){ - // success - }, function(reason){ - // failure - }); - ``` +function notifyExistingHandlers(router, newState, newTransition) { + var oldHandlers = router.state.handlerInfos, + changing = [], + leavingIndex = null, + leaving, leavingChecker, i, oldHandlerLen, oldHandler, newHandler; - Advanced Example - -------------- + oldHandlerLen = oldHandlers.length; + for (i = 0; i < oldHandlerLen; i++) { + oldHandler = oldHandlers[i]; + newHandler = newState.handlerInfos[i]; - Synchronous Example + if (!newHandler || oldHandler.name !== newHandler.name) { + leavingIndex = i; + break; + } - ```javascript - var author, books; + if (!newHandler.isResolved) { + changing.push(oldHandler); + } + } - try { - author = findAuthor(); - books = findBooksByAuthor(author); - // success - } catch(reason) { - // failure + if (leavingIndex !== null) { + leaving = oldHandlers.slice(leavingIndex, oldHandlerLen); + leavingChecker = function(name) { + for (var h = 0, len = leaving.length; h < len; h++) { + if (leaving[h].name === name) { + return true; + } + } + return false; + }; } - ``` - Errback Example + trigger(router, oldHandlers, true, ['willTransition', newTransition]); - ```js + if (router.willTransition) { + router.willTransition(oldHandlers, newState.handlerInfos, newTransition); + } +} - function foundBooks(books) { +exports['default'] = Router; +exports.Transition = Transition; - } +Object.defineProperty(exports, '__esModule', { value: true }); - function failure(reason) { +}); +enifed('rsvp', ['exports'], function (exports) { + 'use strict'; - } + var _rsvp; - findAuthor(function(author, err){ - if (err) { - failure(err); - // failure - } else { - try { - findBoooksByAuthor(author, function(books, err) { - if (err) { - failure(err); - } else { - try { - foundBooks(books); - } catch(reason) { - failure(reason); - } - } - }); - } catch(error) { - failure(err); + function indexOf(callbacks, callback) { + for (var i = 0, l = callbacks.length; i < l; i++) { + if (callbacks[i] === callback) { + return i; } - // success } - }); - ``` - Promise Example; - - ```javascript - findAuthor(). - then(findBooksByAuthor). - then(function(books){ - // found books - }).catch(function(reason){ - // something went wrong - }); - ``` + return -1; + } - @method then - @param {Function} onFulfillment - @param {Function} onRejection - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} -*/ - then: then, + function callbacksFor(object) { + var callbacks = object._promiseCallbacks; -/** - `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same - as the catch block of a try/catch statement. + if (!callbacks) { + callbacks = object._promiseCallbacks = {}; + } - ```js - function findAuthor(){ - throw new Error('couldn't find that author'); + return callbacks; } - // synchronous - try { - findAuthor(); - } catch(reason) { - // something went wrong - } + /** + @class RSVP.EventTarget + */ + var EventTarget = { - // async with promises - findAuthor().catch(function(reason){ - // something went wrong - }); - ``` + /** + `RSVP.EventTarget.mixin` extends an object with EventTarget methods. For + Example: + ```javascript + let object = {}; + RSVP.EventTarget.mixin(object); + object.on('finished', function(event) { + // handle event + }); + object.trigger('finished', { detail: value }); + ``` + `EventTarget.mixin` also works with prototypes: + ```javascript + let Person = function() {}; + RSVP.EventTarget.mixin(Person.prototype); + let yehuda = new Person(); + let tom = new Person(); + yehuda.on('poke', function(event) { + console.log('Yehuda says OW'); + }); + tom.on('poke', function(event) { + console.log('Tom says OW'); + }); + yehuda.trigger('poke'); + tom.trigger('poke'); + ``` + @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']; + object._promiseCallbacks = undefined; + return object; + }, - @method catch - @param {Function} onRejection - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} -*/ - 'catch': function(onRejection, label) { - return this.then(undefined, onRejection, label); - }, + /** + Registers a callback to be executed when `eventName` is triggered + ```javascript + object.on('event', function(eventInfo){ + // handle the event + }); + object.trigger('event'); + ``` + @method on + @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) { + if (typeof callback !== 'function') { + throw new TypeError('Callback must be a function'); + } -/** - `finally` will be invoked regardless of the promise's fate just as native - try/catch/finally behaves + var allCallbacks = callbacksFor(this), + callbacks = undefined; - Synchronous example: + callbacks = allCallbacks[eventName]; - ```js - findAuthor() { - if (Math.random() > 0.5) { - throw new Error(); - } - return new Author(); - } + if (!callbacks) { + callbacks = allCallbacks[eventName] = []; + } - try { - return findAuthor(); // succeed or fail - } catch(error) { - return findOtherAuther(); - } finally { - // always runs - // doesn't affect the return value - } - ``` + if (indexOf(callbacks, callback) === -1) { + callbacks.push(callback); + } + }, - Asynchronous example: + /** + You can use `off` to stop firing a particular callback for an event: + ```javascript + function doStuff() { // do stuff! } + object.on('stuff', doStuff); + object.trigger('stuff'); // doStuff will be called + // Unregister ONLY the doStuff callback + object.off('stuff', doStuff); + object.trigger('stuff'); // doStuff will NOT be called + ``` + If you don't pass a `callback` argument to `off`, ALL callbacks for the + event will not be executed when the event fires. For example: + ```javascript + let callback1 = function(){}; + let callback2 = function(){}; + object.on('stuff', callback1); + object.on('stuff', callback2); + object.trigger('stuff'); // callback1 and callback2 will be executed. + object.off('stuff'); + object.trigger('stuff'); // callback1 and callback2 will not be executed! + ``` + @method off + @for RSVP.EventTarget + @private + @param {String} eventName event to stop listening to + @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) { + var allCallbacks = callbacksFor(this), + callbacks = undefined, + index = undefined; - ```js - findAuthor().catch(function(reason){ - return findOtherAuther(); - }).finally(function(){ - // author was either found, or not - }); - ``` + if (!callback) { + allCallbacks[eventName] = []; + return; + } - @method finally - @param {Function} callback - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} -*/ - 'finally': function(callback, label) { - var promise = this; - var constructor = promise.constructor; + callbacks = allCallbacks[eventName]; - return promise.then(function(value) { - return constructor.resolve(callback()).then(function() { - return value; + index = indexOf(callbacks, callback); + + if (index !== -1) { + callbacks.splice(index, 1); + } + }, + + /** + Use `trigger` to fire custom events. For example: + ```javascript + object.on('foo', function(){ + console.log('foo event happened!'); }); - }, function(reason) { - return constructor.resolve(callback()).then(function() { - return constructor.reject(reason); + object.trigger('foo'); + // 'foo event happened!' logged to the console + ``` + You can also pass a value as a second argument to `trigger` that will be + passed as an argument to all event listeners for the event: + ```javascript + object.on('foo', function(value){ + console.log(value.name); }); - }, label); - } -}; + object.trigger('foo', { name: 'bar' }); + // 'bar' logged to the console + ``` + @method trigger + @for RSVP.EventTarget + @private + @param {String} eventName name of the event to be triggered + @param {*} options optional value to be passed to any event handlers for + the given `eventName` + */ + trigger: function (eventName, options, label) { + var allCallbacks = callbacksFor(this), + callbacks = undefined, + callback = undefined; -function Result() { - this.value = undefined; -} + if (callbacks = allCallbacks[eventName]) { + // Don't cache the callbacks.length since it may grow + for (var i = 0; i < callbacks.length; i++) { + callback = callbacks[i]; -var ERROR = new Result(); -var GET_THEN_ERROR$1 = new Result(); + callback(options, label); + } + } + } + }; -function getThen$1(obj) { - try { - return obj.then; - } catch(error) { - ERROR.value= error; - return ERROR; - } -} + var config = { + instrument: false + }; + EventTarget['mixin'](config); -function tryApply(f, s, a) { - try { - f.apply(s, a); - } catch(error) { - ERROR.value = error; - return ERROR; + 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); + return; + } + + if (arguments.length === 2) { + config[name] = value; + } else { + return config[name]; + } } -} -function makeObject(_, argumentNames) { - var obj = {}; - var name; - var i; - var length = _.length; - var args = new Array(length); + function objectOrFunction(x) { + return typeof x === 'function' || typeof x === 'object' && x !== null; + } - for (var x = 0; x < length; x++) { - args[x] = _[x]; + function isFunction(x) { + return typeof x === 'function'; } - for (i = 0; i < argumentNames.length; i++) { - name = argumentNames[i]; - obj[name] = args[i + 1]; + function isMaybeThenable(x) { + return typeof x === 'object' && x !== null; } - return obj; -} + var _isArray = undefined; + if (!Array.isArray) { + _isArray = function (x) { + return Object.prototype.toString.call(x) === '[object Array]'; + }; + } else { + _isArray = Array.isArray; + } -function arrayResult(_) { - var length = _.length; - var args = new Array(length - 1); + var isArray = _isArray; - for (var i = 1; i < length; i++) { - args[i - 1] = _[i]; - } + // Date.now is not available in browsers < IE9 + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now#Compatibility + var now = Date.now || function () { + return new Date().getTime(); + }; - return args; -} + function F() {} -function wrapThenable(then, promise) { - return { - then: function(onFulFillment, onRejection) { - return then.call(promise, onFulFillment, onRejection); + var o_create = Object.create || function (o) { + if (arguments.length > 1) { + throw new Error('Second argument not supported'); + } + if (typeof o !== 'object') { + throw new TypeError('Argument must be an object'); } + F.prototype = o; + return new F(); }; -} -/** - `RSVP.denodeify` takes a 'node-style' function and returns a function that - will return an `RSVP.Promise`. You can use `denodeify` in Node.js or the - browser when you'd prefer to use promises over using callbacks. For example, - `denodeify` transforms the following: + var queue = []; - ```javascript - var fs = require('fs'); + function scheduleFlush() { + setTimeout(function () { + for (var i = 0; i < queue.length; i++) { + var entry = queue[i]; - fs.readFile('myfile.txt', function(err, data){ - if (err) return handleError(err); - handleData(data); - }); - ``` + var payload = entry.payload; - into: + payload.guid = payload.key + payload.id; + payload.childGuid = payload.key + payload.childId; + if (payload.error) { + payload.stack = payload.error.stack; + } - ```javascript - var fs = require('fs'); - var readFile = RSVP.denodeify(fs.readFile); + config['trigger'](entry.name, entry.payload); + } + queue.length = 0; + }, 50); + } - readFile('myfile.txt').then(handleData, handleError); - ``` + function instrument(eventName, promise, child) { + if (1 === queue.push({ + name: eventName, + payload: { + key: promise._guidKey, + id: promise._id, + eventName: eventName, + detail: promise._result, + childId: child && child._id, + label: promise._label, + timeStamp: now(), + error: config["instrument-with-stack"] ? new Error(promise._label) : null + } })) { + scheduleFlush(); + } + } - If the node function has multiple success parameters, then `denodeify` - just returns the first one: + /** + `RSVP.Promise.resolve` returns a promise that will become resolved with the + passed `value`. It is shorthand for the following: + + ```javascript + let promise = new RSVP.Promise(function(resolve, reject){ + resolve(1); + }); + + promise.then(function(value){ + // value === 1 + }); + ``` + + Instead of writing the above, your code now simply becomes the following: + + ```javascript + let promise = RSVP.Promise.resolve(1); + + promise.then(function(value){ + // value === 1 + }); + ``` + + @method resolve + @static + @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` + */ + function resolve$1(object, label) { + /*jshint validthis:true */ + var Constructor = this; - ```javascript - var request = RSVP.denodeify(require('request')); + if (object && typeof object === 'object' && object.constructor === Constructor) { + return object; + } - request('http://example.com').then(function(res) { - // ... - }); - ``` + var promise = new Constructor(noop, label); + resolve(promise, object); + return promise; + } - However, if you need all success parameters, setting `denodeify`'s - second parameter to `true` causes it to return all success parameters - as an array: + function withOwnPromise() { + return new TypeError('A promises callback cannot return that same promise.'); + } - ```javascript - var request = RSVP.denodeify(require('request'), true); + function noop() {} - request('http://example.com').then(function(result) { - // result[0] -> res - // result[1] -> body - }); - ``` + var PENDING = void 0; + var FULFILLED = 1; + var REJECTED = 2; - Or if you pass it an array with names it returns the parameters as a hash: + var GET_THEN_ERROR = new ErrorObject(); - ```javascript - var request = RSVP.denodeify(require('request'), ['res', 'body']); + function getThen(promise) { + try { + return promise.then; + } catch (error) { + GET_THEN_ERROR.error = error; + return GET_THEN_ERROR; + } + } - request('http://example.com').then(function(result) { - // result.res - // result.body - }); - ``` + function tryThen(then, value, fulfillmentHandler, rejectionHandler) { + try { + then.call(value, fulfillmentHandler, rejectionHandler); + } catch (e) { + return e; + } + } - Sometimes you need to retain the `this`: + function handleForeignThenable(promise, thenable, then) { + config.async(function (promise) { + var sealed = false; + var error = tryThen(then, thenable, function (value) { + if (sealed) { + return; + } + sealed = true; + if (thenable !== value) { + resolve(promise, value, undefined); + } else { + fulfill(promise, value); + } + }, function (reason) { + if (sealed) { + return; + } + sealed = true; - ```javascript - var app = require('express')(); - var render = RSVP.denodeify(app.render.bind(app)); - ``` + reject(promise, reason); + }, 'Settle: ' + (promise._label || ' unknown promise')); - The denodified function inherits from the original function. It works in all - environments, except IE 10 and below. Consequently all properties of the original - function are available to you. However, any properties you change on the - denodeified function won't be changed on the original function. Example: + if (!sealed && error) { + sealed = true; + reject(promise, error); + } + }, promise); + } - ```javascript - var request = RSVP.denodeify(require('request')), - cookieJar = request.jar(); // <- Inheritance is used here + function handleOwnThenable(promise, thenable) { + if (thenable._state === FULFILLED) { + fulfill(promise, thenable._result); + } else if (thenable._state === REJECTED) { + thenable._onError = null; + reject(promise, thenable._result); + } else { + subscribe(thenable, undefined, function (value) { + if (thenable !== value) { + resolve(promise, value, undefined); + } else { + fulfill(promise, value); + } + }, function (reason) { + return reject(promise, reason); + }); + } + } - request('http://example.com', {jar: cookieJar}).then(function(res) { - // cookieJar.cookies holds now the cookies returned by example.com - }); - ``` + function handleMaybeThenable(promise, maybeThenable, then$$) { + if (maybeThenable.constructor === promise.constructor && then$$ === then && promise.constructor.resolve === resolve$1) { + handleOwnThenable(promise, maybeThenable); + } else { + if (then$$ === GET_THEN_ERROR) { + reject(promise, GET_THEN_ERROR.error); + } else if (then$$ === undefined) { + fulfill(promise, maybeThenable); + } else if (isFunction(then$$)) { + handleForeignThenable(promise, maybeThenable, then$$); + } else { + fulfill(promise, maybeThenable); + } + } + } - Using `denodeify` makes it easier to compose asynchronous operations instead - of using callbacks. For example, instead of: + function resolve(promise, value) { + if (promise === value) { + fulfill(promise, value); + } else if (objectOrFunction(value)) { + handleMaybeThenable(promise, value, getThen(value)); + } else { + fulfill(promise, value); + } + } - ```javascript - var fs = require('fs'); + function publishRejection(promise) { + if (promise._onError) { + promise._onError(promise._result); + } - fs.readFile('myfile.txt', function(err, data){ - if (err) { ... } // Handle error - fs.writeFile('myfile2.txt', data, function(err){ - if (err) { ... } // Handle error - console.log('done') - }); - }); - ``` + publish(promise); + } - you can chain the operations together using `then` from the returned promise: + function fulfill(promise, value) { + if (promise._state !== PENDING) { + return; + } - ```javascript - var fs = require('fs'); - var readFile = RSVP.denodeify(fs.readFile); - var writeFile = RSVP.denodeify(fs.writeFile); - - readFile('myfile.txt').then(function(data){ - return writeFile('myfile2.txt', data); - }).then(function(){ - console.log('done') - }).catch(function(error){ - // Handle error - }); - ``` + promise._result = value; + promise._state = FULFILLED; - @method denodeify - @static - @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} [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. - @return {Function} a function that wraps `nodeFunc` to return an - `RSVP.Promise` - @static -*/ -function denodeify(nodeFunc, options) { - var fn = function() { - var self = this; - var l = arguments.length; - var args = new Array(l + 1); - var arg; - var promiseInput = false; + if (promise._subscribers.length === 0) { + if (config.instrument) { + instrument('fulfilled', promise); + } + } else { + config.async(publish, promise); + } + } - for (var i = 0; i < l; ++i) { - arg = arguments[i]; + function reject(promise, reason) { + if (promise._state !== PENDING) { + return; + } + promise._state = REJECTED; + promise._result = reason; + config.async(publishRejection, promise); + } - if (!promiseInput) { - // TODO: clean this up - promiseInput = needsPromiseInput(arg); - if (promiseInput === GET_THEN_ERROR$1) { - var p = new Promise(noop); - reject(p, GET_THEN_ERROR$1.value); - return p; - } else if (promiseInput && promiseInput !== true) { - arg = wrapThenable(promiseInput, arg); - } - } - args[i] = arg; + function subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers; + var length = subscribers.length; + + parent._onError = null; + + subscribers[length] = child; + subscribers[length + FULFILLED] = onFulfillment; + subscribers[length + REJECTED] = onRejection; + + if (length === 0 && parent._state) { + config.async(publish, parent); } + } - var promise = new Promise(noop); + function publish(promise) { + var subscribers = promise._subscribers; + var settled = promise._state; - args[l] = function(err, val) { - if (err) - reject(promise, err); - else if (options === undefined) - resolve(promise, val); - else if (options === true) - resolve(promise, arrayResult(arguments)); - else if (isArray(options)) - resolve(promise, makeObject(arguments, options)); - else - resolve(promise, val); - }; + if (config.instrument) { + instrument(settled === FULFILLED ? 'fulfilled' : 'rejected', promise); + } - if (promiseInput) { - return handlePromiseInput(promise, args, nodeFunc, self); - } else { - return handleValueInput(promise, args, nodeFunc, self); + if (subscribers.length === 0) { + return; } - }; - fn.__proto__ = nodeFunc; + var child = undefined, + callback = undefined, + detail = promise._result; - return fn; -} + for (var i = 0; i < subscribers.length; i += 3) { + child = subscribers[i]; + callback = subscribers[i + settled]; + + if (child) { + invokeCallback(settled, child, callback, detail); + } else { + callback(detail); + } + } -function handleValueInput(promise, args, nodeFunc, self) { - var result = tryApply(nodeFunc, self, args); - if (result === ERROR) { - reject(promise, result.value); + promise._subscribers.length = 0; } - return promise; -} -function handlePromiseInput(promise, args, nodeFunc, self){ - return Promise.all(args).then(function(args){ - var result = tryApply(nodeFunc, self, args); - if (result === ERROR) { - reject(promise, result.value); - } - return promise; - }); -} + function ErrorObject() { + this.error = null; + } -function needsPromiseInput(arg) { - if (arg && typeof arg === 'object') { - if (arg.constructor === Promise) { - return true; - } else { - return getThen$1(arg); + var TRY_CATCH_ERROR = new ErrorObject(); + + function tryCatch(callback, detail) { + try { + return callback(detail); + } catch (e) { + TRY_CATCH_ERROR.error = e; + return TRY_CATCH_ERROR; } - } else { - return false; } -} - -/** - This is a convenient alias for `RSVP.Promise.all`. - @method all - @static - @for RSVP - @param {Array} array Array of promises. - @param {String} label An optional label. This is useful - for tooling. -*/ -function all$1(array, label) { - return Promise.all(array, label); -} + function invokeCallback(settled, promise, callback, detail) { + var hasCallback = isFunction(callback), + value = undefined, + error = undefined, + succeeded = undefined, + failed = undefined; -function AllSettled(Constructor, entries, label) { - this._superConstructor(Constructor, entries, false /* don't abort on reject */, label); -} + if (hasCallback) { + value = tryCatch(callback, detail); -AllSettled.prototype = o_create(Enumerator.prototype); -AllSettled.prototype._superConstructor = Enumerator; -AllSettled.prototype._makeResult = makeSettledResult; -AllSettled.prototype._validationError = function() { - return new Error('allSettled must be called with an array'); -}; + if (value === TRY_CATCH_ERROR) { + failed = true; + error = value.error; + value = null; + } else { + succeeded = true; + } -/** - `RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing - a fail-fast method, it waits until all the promises have returned and - shows you all the results. This is useful if you want to handle multiple - promises' failure states together as a set. + if (promise === value) { + reject(promise, withOwnPromise()); + return; + } + } else { + value = detail; + succeeded = true; + } - Returns a promise that is fulfilled when all the given promises have been - settled. The return promise is fulfilled with an array of the states of - the promises passed into the `promises` array argument. + 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); + } + } - Each state object will either indicate fulfillment or rejection, and - provide the corresponding value or reason. The states will take one of - the following formats: + function initializePromise(promise, resolver) { + var resolved = false; + try { + resolver(function (value) { + if (resolved) { + return; + } + resolved = true; + resolve(promise, value); + }, function (reason) { + if (resolved) { + return; + } + resolved = true; + reject(promise, reason); + }); + } catch (e) { + reject(promise, e); + } + } - ```javascript - { state: 'fulfilled', value: value } - or - { state: 'rejected', reason: reason } - ``` + function then(onFulfillment, onRejection, label) { + var _arguments = arguments; - Example: + var parent = this; + var state = parent._state; - ```javascript - var promise1 = RSVP.Promise.resolve(1); - var promise2 = RSVP.Promise.reject(new Error('2')); - var promise3 = RSVP.Promise.reject(new Error('3')); - var promises = [ promise1, promise2, promise3 ]; - - RSVP.allSettled(promises).then(function(array){ - // array == [ - // { state: 'fulfilled', value: 1 }, - // { state: 'rejected', reason: Error }, - // { state: 'rejected', reason: Error } - // ] - // Note that for the second item, reason.message will be '2', and for the - // third item, reason.message will be '3'. - }, function(error) { - // Not run. (This block would only be called if allSettled had failed, - // for instance if passed an incorrect argument type.) - }); - ``` + if (state === FULFILLED && !onFulfillment || state === REJECTED && !onRejection) { + config.instrument && instrument('chained', parent, parent); + return parent; + } - @method allSettled - @static - @for RSVP - @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. -*/ + parent._onError = null; -function allSettled(entries, label) { - return new AllSettled(Promise, entries, label).promise; -} + var child = new parent.constructor(noop, label); + var result = parent._result; -/** - This is a convenient alias for `RSVP.Promise.race`. + config.instrument && instrument('chained', parent, child); - @method race - @static - @for RSVP - @param {Array} array Array of promises. - @param {String} label An optional label. This is useful - for tooling. - */ -function race$1(array, label) { - return Promise.race(array, label); -} + if (state) { + (function () { + var callback = _arguments[state - 1]; + config.async(function () { + return invokeCallback(state, child, callback, result); + }); + })(); + } else { + subscribe(parent, child, onFulfillment, onRejection); + } -function PromiseHash(Constructor, object, label) { - this._superConstructor(Constructor, object, true, label); -} + return child; + } -PromiseHash.prototype = o_create(Enumerator.prototype); -PromiseHash.prototype._superConstructor = Enumerator; -PromiseHash.prototype._init = function() { - this._result = {}; -}; + function makeSettledResult(state, position, value) { + if (state === FULFILLED) { + return { + state: 'fulfilled', + value: value + }; + } else { + return { + state: 'rejected', + reason: value + }; + } + } -PromiseHash.prototype._validateInput = function(input) { - return input && typeof input === 'object'; -}; + function Enumerator(Constructor, input, abortOnReject, label) { + this._instanceConstructor = Constructor; + this.promise = new Constructor(noop, label); + this._abortOnReject = abortOnReject; -PromiseHash.prototype._validationError = function() { - return new Error('Promise.hash must be called with an object'); -}; + if (this._validateInput(input)) { + this._input = input; + this.length = input.length; + this._remaining = input.length; -PromiseHash.prototype._enumerate = function() { - var enumerator = this; - var promise = enumerator.promise; - var input = enumerator._input; - var results = []; + this._init(); - for (var key in input) { - if (promise._state === PENDING && Object.prototype.hasOwnProperty.call(input, key)) { - results.push({ - position: key, - entry: input[key] - }); + if (this.length === 0) { + fulfill(this.promise, this._result); + } else { + this.length = this.length || 0; + this._enumerate(); + if (this._remaining === 0) { + fulfill(this.promise, this._result); + } + } + } else { + reject(this.promise, this._validationError()); } } - var length = results.length; - enumerator._remaining = length; - var result; + Enumerator.prototype._validateInput = function (input) { + return isArray(input); + }; - for (var i = 0; promise._state === PENDING && i < length; i++) { - result = results[i]; - enumerator._eachEntry(result.entry, result.position); - } -}; + Enumerator.prototype._validationError = function () { + return new Error('Array Methods must be provided an Array'); + }; -/** - `RSVP.hash` is similar to `RSVP.all`, but takes an object instead of an array - for its `promises` argument. + Enumerator.prototype._init = function () { + this._result = new Array(this.length); + }; - Returns a promise that is fulfilled when all the given promises have been - fulfilled, or rejected if any of them become rejected. The returned promise - is fulfilled with a hash that has the same key names as the `promises` object - argument. If any of the values in the object are not promises, they will - simply be copied over to the fulfilled object. + Enumerator.prototype._enumerate = function () { + var length = this.length; + var promise = this.promise; + var input = this._input; - Example: + for (var i = 0; promise._state === PENDING && i < length; i++) { + this._eachEntry(input[i], i); + } + }; - ```javascript - var promises = { - myPromise: RSVP.resolve(1), - yourPromise: RSVP.resolve(2), - theirPromise: RSVP.resolve(3), - notAPromise: 4 + Enumerator.prototype._settleMaybeThenable = function (entry, i) { + var c = this._instanceConstructor; + var resolve = c.resolve; + + if (resolve === resolve$1) { + var then$$ = getThen(entry); + + if (then$$ === then && entry._state !== PENDING) { + entry._onError = null; + this._settledAt(entry._state, i, entry._result); + } else if (typeof then$$ !== 'function') { + this._remaining--; + this._result[i] = this._makeResult(FULFILLED, i, entry); + } else if (c === Promise) { + var promise = new c(noop); + handleMaybeThenable(promise, entry, then$$); + this._willSettleAt(promise, i); + } else { + this._willSettleAt(new c(function (resolve) { + return resolve(entry); + }), i); + } + } else { + this._willSettleAt(resolve(entry), i); + } }; - RSVP.hash(promises).then(function(hash){ - // hash here is an object that looks like: - // { - // myPromise: 1, - // yourPromise: 2, - // theirPromise: 3, - // notAPromise: 4 - // } - }); - ```` + Enumerator.prototype._eachEntry = function (entry, i) { + if (isMaybeThenable(entry)) { + this._settleMaybeThenable(entry, i); + } else { + this._remaining--; + this._result[i] = this._makeResult(FULFILLED, i, entry); + } + }; - If any of the `promises` given to `RSVP.hash` are rejected, the first promise - that is rejected will be given as the reason to the rejection handler. + Enumerator.prototype._settledAt = function (state, i, value) { + var promise = this.promise; - Example: + if (promise._state === PENDING) { + this._remaining--; - ```javascript - var promises = { - myPromise: RSVP.resolve(1), - rejectedPromise: RSVP.reject(new Error('rejectedPromise')), - anotherRejectedPromise: RSVP.reject(new Error('anotherRejectedPromise')), + if (this._abortOnReject && state === REJECTED) { + reject(promise, value); + } else { + this._result[i] = this._makeResult(state, i, value); + } + } + + if (this._remaining === 0) { + fulfill(promise, this._result); + } }; - RSVP.hash(promises).then(function(hash){ - // Code here never runs because there are rejected promises! - }, function(reason) { - // reason.message === 'rejectedPromise' - }); - ``` + Enumerator.prototype._makeResult = function (state, i, value) { + return value; + }; - An important note: `RSVP.hash` is intended for plain JavaScript objects that - are just a set of keys and values. `RSVP.hash` will NOT preserve prototype - chains. + Enumerator.prototype._willSettleAt = function (promise, i) { + var enumerator = this; - Example: + subscribe(promise, undefined, function (value) { + return enumerator._settledAt(FULFILLED, i, value); + }, function (reason) { + return enumerator._settledAt(REJECTED, i, reason); + }); + }; - ```javascript - function MyConstructor(){ - this.example = RSVP.resolve('Example'); + /** + `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 + rejected with the reason of the first passed promise to be rejected. It casts all + elements of the passed iterable to promises as it runs this algorithm. + + Example: + + ```javascript + let promise1 = RSVP.resolve(1); + let promise2 = RSVP.resolve(2); + let promise3 = RSVP.resolve(3); + let promises = [ promise1, promise2, promise3 ]; + + RSVP.Promise.all(promises).then(function(array){ + // The array here would be [ 1, 2, 3 ]; + }); + ``` + + If any of the `promises` given to `RSVP.all` are rejected, the first promise + that is rejected will be given as an argument to the returned promises's + rejection handler. For example: + + Example: + + ```javascript + let promise1 = RSVP.resolve(1); + let promise2 = RSVP.reject(new Error("2")); + let promise3 = RSVP.reject(new Error("3")); + let promises = [ promise1, promise2, promise3 ]; + + RSVP.Promise.all(promises).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(error) { + // error.message === "2" + }); + ``` + + @method all + @static + @param {Array} entries array of promises + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} promise that is fulfilled when all `promises` have been + fulfilled, or rejected if any of them become rejected. + @static + */ + function all(entries, label) { + return new Enumerator(this, entries, true, /* abort on reject */label).promise; } - MyConstructor.prototype = { - protoProperty: RSVP.resolve('Proto Property') - }; + /** + `RSVP.Promise.race` returns a new promise which is settled in the same way as the + first passed promise to settle. + + Example: + + ```javascript + let promise1 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 1'); + }, 200); + }); + + let promise2 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 2'); + }, 100); + }); + + RSVP.Promise.race([promise1, promise2]).then(function(result){ + // result === 'promise 2' because it was resolved before promise1 + // was resolved. + }); + ``` + + `RSVP.Promise.race` is deterministic in that only the state of the first + settled promise matters. For example, even if other promises given to the + `promises` array argument are resolved, but the first settled promise has + become rejected before the other promises became fulfilled, the returned + promise will become rejected: + + ```javascript + let promise1 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 1'); + }, 200); + }); + + let promise2 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + reject(new Error('promise 2')); + }, 100); + }); + + RSVP.Promise.race([promise1, promise2]).then(function(result){ + // Code here never runs + }, function(reason){ + // reason.message === 'promise 2' because promise 2 became rejected before + // promise 1 became fulfilled + }); + ``` + + An example real-world use case is implementing timeouts: + + ```javascript + RSVP.Promise.race([ajax('foo.json'), timeout(5000)]) + ``` + + @method race + @static + @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. + */ + function race(entries, label) { + /*jshint validthis:true */ + var Constructor = this; - var myObject = new MyConstructor(); + var promise = new Constructor(noop, label); - RSVP.hash(myObject).then(function(hash){ - // protoProperty will not be present, instead you will just have an - // object that looks like: - // { - // example: 'Example' - // } - // - // hash.hasOwnProperty('protoProperty'); // false - // 'undefined' === typeof hash.protoProperty - }); - ``` + if (!isArray(entries)) { + reject(promise, new TypeError('You must pass an array to race.')); + return promise; + } - @method hash - @static - @for RSVP - @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. -*/ -function hash(object, label) { - return new PromiseHash(Promise, object, label).promise; -} + for (var i = 0; promise._state === PENDING && i < entries.length; i++) { + subscribe(Constructor.resolve(entries[i]), undefined, function (value) { + return resolve(promise, value); + }, function (reason) { + return reject(promise, reason); + }); + } -function HashSettled(Constructor, object, label) { - this._superConstructor(Constructor, object, false, label); -} + return promise; + } + + /** + `RSVP.Promise.reject` returns a promise rejected with the passed `reason`. + It is shorthand for the following: + + ```javascript + let promise = new RSVP.Promise(function(resolve, reject){ + reject(new Error('WHOOPS')); + }); + + promise.then(function(value){ + // Code here doesn't run because the promise is rejected! + }, function(reason){ + // reason.message === 'WHOOPS' + }); + ``` + + Instead of writing the above, your code now simply becomes the following: + + ```javascript + let promise = RSVP.Promise.reject(new Error('WHOOPS')); + + promise.then(function(value){ + // Code here doesn't run because the promise is rejected! + }, function(reason){ + // reason.message === 'WHOOPS' + }); + ``` + + @method reject + @static + @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$1(reason, label) { + /*jshint validthis:true */ + var Constructor = this; + var promise = new Constructor(noop, label); + reject(promise, reason); + return promise; + } -HashSettled.prototype = o_create(PromiseHash.prototype); -HashSettled.prototype._superConstructor = Enumerator; -HashSettled.prototype._makeResult = makeSettledResult; + var guidKey = 'rsvp_' + now() + '-'; + var counter = 0; -HashSettled.prototype._validationError = function() { - return new Error('hashSettled must be called with an object'); -}; + function needsResolver() { + throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); + } -/** - `RSVP.hashSettled` is similar to `RSVP.allSettled`, but takes an object - instead of an array for its `promises` argument. + function needsNew() { + throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); + } + + /** + 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 + why the promise cannot be fulfilled. + + Terminology + ----------- + + - `promise` is an object or function with a `then` method whose behavior conforms to this specification. + - `thenable` is an object or function that defines a `then` method. + - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). + - `exception` is a value that is thrown using the throw statement. + - `reason` is a value that indicates why a promise was rejected. + - `settled` the final resting state of a promise, fulfilled or rejected. + + A promise can be in one of three states: pending, fulfilled, or rejected. + + Promises that are fulfilled have a fulfillment value and are in the fulfilled + state. Promises that are rejected have a rejection reason and are in the + rejected state. A fulfillment value is never a thenable. + + Promises can also be said to *resolve* a value. If this value is also a + promise, then the original promise's settled state will match the value's + settled state. So a promise that *resolves* a promise that rejects will + itself reject, and a promise that *resolves* a promise that fulfills will + itself fulfill. + + + Basic Usage: + ------------ + + ```js + let promise = new Promise(function(resolve, reject) { + // on success + resolve(value); + + // on failure + reject(reason); + }); + + promise.then(function(value) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Advanced Usage: + --------------- + + Promises shine when abstracting away asynchronous interactions such as + `XMLHttpRequest`s. + + ```js + function getJSON(url) { + return new Promise(function(resolve, reject){ + let xhr = new XMLHttpRequest(); + + xhr.open('GET', url); + xhr.onreadystatechange = handler; + xhr.responseType = 'json'; + xhr.setRequestHeader('Accept', 'application/json'); + xhr.send(); + + function handler() { + if (this.readyState === this.DONE) { + if (this.status === 200) { + resolve(this.response); + } else { + reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); + } + } + }; + }); + } + + getJSON('/posts.json').then(function(json) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Unlike callbacks, promises are great composable primitives. + + ```js + Promise.all([ + getJSON('/posts'), + getJSON('/comments') + ]).then(function(values){ + values[0] // => postsJSON + values[1] // => commentsJSON + + return values; + }); + ``` + + @class RSVP.Promise + @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 = []; - Unlike `RSVP.all` or `RSVP.hash`, which implement a fail-fast method, - but like `RSVP.allSettled`, `hashSettled` waits until all the - constituent promises have returned and then shows you all the results - with their states and values/reasons. This is useful if you want to - handle multiple promises' failure states together as a set. + config.instrument && instrument('created', this); - Returns a promise that is fulfilled when all the given promises have been - settled, or rejected if the passed parameters are invalid. + if (noop !== resolver) { + typeof resolver !== 'function' && needsResolver(); + this instanceof Promise ? initializePromise(this, resolver) : needsNew(); + } + } - The returned promise is fulfilled with a hash that has the same key names as - the `promises` object argument. If any of the values in the object are not - promises, they will be copied over to the fulfilled object and marked with state - 'fulfilled'. + Promise.cast = resolve$1; // deprecated + Promise.all = all; + Promise.race = race; + Promise.resolve = resolve$1; + Promise.reject = reject$1; - Example: + Promise.prototype = { + constructor: Promise, - ```javascript - var promises = { - myPromise: RSVP.Promise.resolve(1), - yourPromise: RSVP.Promise.resolve(2), - theirPromise: RSVP.Promise.resolve(3), - notAPromise: 4 - }; + _guidKey: guidKey, - RSVP.hashSettled(promises).then(function(hash){ - // hash here is an object that looks like: - // { - // myPromise: { state: 'fulfilled', value: 1 }, - // yourPromise: { state: 'fulfilled', value: 2 }, - // theirPromise: { state: 'fulfilled', value: 3 }, - // notAPromise: { state: 'fulfilled', value: 4 } - // } - }); - ``` + _onError: function (reason) { + var promise = this; + config.after(function () { + if (promise._onError) { + config['trigger']('error', reason, promise._label); + } + }); + }, + + /** + 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 why the promise cannot be fulfilled. + + ```js + findUser().then(function(user){ + // user is available + }, function(reason){ + // user is unavailable, and you are given the reason why + }); + ``` + + Chaining + -------- + + The return value of `then` is itself a promise. This second, 'downstream' + promise is resolved with the return value of the first promise's fulfillment + or rejection handler, or rejected if the handler throws an exception. + + ```js + findUser().then(function (user) { + return user.name; + }, function (reason) { + return 'default name'; + }).then(function (userName) { + // If `findUser` fulfilled, `userName` will be the user's name, otherwise it + // will be `'default name'` + }); + + findUser().then(function (user) { + throw new Error('Found user, but still unhappy'); + }, function (reason) { + throw new Error('`findUser` rejected and we\'re unhappy'); + }).then(function (value) { + // never reached + }, function (reason) { + // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. + // If `findUser` rejected, `reason` will be '`findUser` rejected and we\'re unhappy'. + }); + ``` + If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. + + ```js + findUser().then(function (user) { + throw new PedagogicalException('Upstream error'); + }).then(function (value) { + // never reached + }).then(function (value) { + // never reached + }, function (reason) { + // The `PedgagocialException` is propagated all the way down to here + }); + ``` + + Assimilation + ------------ + + Sometimes the value you want to propagate to a downstream promise can only be + retrieved asynchronously. This can be achieved by returning a promise in the + fulfillment or rejection handler. The downstream promise will then be pending + until the returned promise is settled. This is called *assimilation*. + + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // The user's comments are now available + }); + ``` + + If the assimliated promise rejects, then the downstream promise will also reject. + + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // If `findCommentsByAuthor` fulfills, we'll have the value here + }, function (reason) { + // If `findCommentsByAuthor` rejects, we'll have the reason here + }); + ``` + + Simple Example + -------------- + + Synchronous Example + + ```javascript + let result; + + try { + result = findResult(); + // success + } catch(reason) { + // failure + } + ``` + + Errback Example + + ```js + findResult(function(result, err){ + if (err) { + // failure + } else { + // success + } + }); + ``` + + Promise Example; + + ```javascript + findResult().then(function(result){ + // success + }, function(reason){ + // failure + }); + ``` + + Advanced Example + -------------- + + Synchronous Example + + ```javascript + let author, books; + + try { + author = findAuthor(); + books = findBooksByAuthor(author); + // success + } catch(reason) { + // failure + } + ``` + + Errback Example + + ```js + + function foundBooks(books) { + + } + + function failure(reason) { + + } + + findAuthor(function(author, err){ + if (err) { + failure(err); + // failure + } else { + try { + findBoooksByAuthor(author, function(books, err) { + if (err) { + failure(err); + } else { + try { + foundBooks(books); + } catch(reason) { + failure(reason); + } + } + }); + } catch(error) { + failure(err); + } + // success + } + }); + ``` + + Promise Example; + + ```javascript + findAuthor(). + then(findBooksByAuthor). + then(function(books){ + // found books + }).catch(function(reason){ + // something went wrong + }); + ``` + + @method then + @param {Function} onFulfillment + @param {Function} onRejection + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + */ + then: then, - If any of the `promises` given to `RSVP.hash` are rejected, the state will - be set to 'rejected' and the reason for rejection provided. + /** + `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same + as the catch block of a try/catch statement. + + ```js + function findAuthor(){ + throw new Error('couldn\'t find that author'); + } + + // synchronous + try { + findAuthor(); + } catch(reason) { + // something went wrong + } + + // async with promises + findAuthor().catch(function(reason){ + // something went wrong + }); + ``` + + @method catch + @param {Function} onRejection + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + */ + catch: function (onRejection, label) { + return this.then(undefined, onRejection, label); + }, - Example: + /** + `finally` will be invoked regardless of the promise's fate just as native + try/catch/finally behaves + + Synchronous example: + + ```js + findAuthor() { + if (Math.random() > 0.5) { + throw new Error(); + } + return new Author(); + } + + try { + return findAuthor(); // succeed or fail + } catch(error) { + return findOtherAuther(); + } finally { + // always runs + // doesn't affect the return value + } + ``` + + Asynchronous example: + + ```js + findAuthor().catch(function(reason){ + return findOtherAuther(); + }).finally(function(){ + // author was either found, or not + }); + ``` + + @method finally + @param {Function} callback + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + */ + finally: function (callback, label) { + var promise = this; + var constructor = promise.constructor; - ```javascript - var promises = { - myPromise: RSVP.Promise.resolve(1), - rejectedPromise: RSVP.Promise.reject(new Error('rejection')), - anotherRejectedPromise: RSVP.Promise.reject(new Error('more rejection')), + return promise.then(function (value) { + return constructor.resolve(callback()).then(function () { + return value; + }); + }, function (reason) { + return constructor.resolve(callback()).then(function () { + throw reason; + }); + }, label); + } }; - RSVP.hashSettled(promises).then(function(hash){ - // hash here is an object that looks like: - // { - // myPromise: { state: 'fulfilled', value: 1 }, - // rejectedPromise: { state: 'rejected', reason: Error }, - // anotherRejectedPromise: { state: 'rejected', reason: Error }, - // } - // Note that for rejectedPromise, reason.message == 'rejection', - // and for anotherRejectedPromise, reason.message == 'more rejection'. - }); - ``` + function Result() { + this.value = undefined; + } - An important note: `RSVP.hashSettled` is intended for plain JavaScript objects that - are just a set of keys and values. `RSVP.hashSettled` will NOT preserve prototype - chains. + var ERROR = new Result(); + var GET_THEN_ERROR$1 = new Result(); - Example: + function getThen$1(obj) { + try { + return obj.then; + } catch (error) { + ERROR.value = error; + return ERROR; + } + } - ```javascript - function MyConstructor(){ - this.example = RSVP.Promise.resolve('Example'); + function tryApply(f, s, a) { + try { + f.apply(s, a); + } catch (error) { + ERROR.value = error; + return ERROR; + } } - MyConstructor.prototype = { - protoProperty: RSVP.Promise.resolve('Proto Property') - }; + function makeObject(_, argumentNames) { + var obj = {}; + var length = _.length; + var args = new Array(length); - var myObject = new MyConstructor(); + for (var x = 0; x < length; x++) { + args[x] = _[x]; + } - RSVP.hashSettled(myObject).then(function(hash){ - // protoProperty will not be present, instead you will just have an - // object that looks like: - // { - // example: { state: 'fulfilled', value: 'Example' } - // } - // - // hash.hasOwnProperty('protoProperty'); // false - // 'undefined' === typeof hash.protoProperty - }); - ``` + for (var i = 0; i < argumentNames.length; i++) { + var _name = argumentNames[i]; + obj[_name] = args[i + 1]; + } - @method hashSettled - @for RSVP - @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 -*/ -function hashSettled(object, label) { - return new HashSettled(Promise, object, label).promise; -} + return obj; + } -/** - `RSVP.rethrow` will rethrow an error on the next turn of the JavaScript event - loop in order to aid debugging. + function arrayResult(_) { + var length = _.length; + var args = new Array(length - 1); - Promises A+ specifies that any exceptions that occur with a promise must be - caught by the promises implementation and bubbled to the last handler. For - this reason, it is recommended that you always specify a second rejection - handler function to `then`. However, `RSVP.rethrow` will throw the exception - outside of the promise, so it bubbles up to your console if in the browser, - or domain/cause uncaught exception in Node. `rethrow` will also throw the - error again so the error can be handled by the promise per the spec. + for (var i = 1; i < length; i++) { + args[i - 1] = _[i]; + } - ```javascript - function throws(){ - throw new Error('Whoops!'); + return args; } - var promise = new RSVP.Promise(function(resolve, reject){ - throws(); - }); - - promise.catch(RSVP.rethrow).then(function(){ - // Code here doesn't run because the promise became rejected due to an - // error! - }, function (err){ - // handle the error here - }); - ``` + function wrapThenable(then, promise) { + return { + then: function (onFulFillment, onRejection) { + return then.call(promise, onFulFillment, onRejection); + } + }; + } - The 'Whoops' error will be thrown on the next turn of the event loop - and you can watch for it in your console. You can also handle it using a - rejection handler given to `.then` or `.catch` on the returned promise. + /** + `RSVP.denodeify` takes a 'node-style' function and returns a function that + will return an `RSVP.Promise`. You can use `denodeify` in Node.js or the + browser when you'd prefer to use promises over using callbacks. For example, + `denodeify` transforms the following: + + ```javascript + let fs = require('fs'); + + fs.readFile('myfile.txt', function(err, data){ + if (err) return handleError(err); + handleData(data); + }); + ``` + + into: + + ```javascript + let fs = require('fs'); + let readFile = RSVP.denodeify(fs.readFile); + + readFile('myfile.txt').then(handleData, handleError); + ``` + + If the node function has multiple success parameters, then `denodeify` + just returns the first one: + + ```javascript + let request = RSVP.denodeify(require('request')); + + request('http://example.com').then(function(res) { + // ... + }); + ``` + + However, if you need all success parameters, setting `denodeify`'s + second parameter to `true` causes it to return all success parameters + as an array: + + ```javascript + let request = RSVP.denodeify(require('request'), true); + + request('http://example.com').then(function(result) { + // result[0] -> res + // result[1] -> body + }); + ``` + + Or if you pass it an array with names it returns the parameters as a hash: + + ```javascript + let request = RSVP.denodeify(require('request'), ['res', 'body']); + + request('http://example.com').then(function(result) { + // result.res + // result.body + }); + ``` + + Sometimes you need to retain the `this`: + + ```javascript + let app = require('express')(); + let render = RSVP.denodeify(app.render.bind(app)); + ``` + + The denodified function inherits from the original function. It works in all + environments, except IE 10 and below. Consequently all properties of the original + function are available to you. However, any properties you change on the + denodeified function won't be changed on the original function. Example: + + ```javascript + let request = RSVP.denodeify(require('request')), + cookieJar = request.jar(); // <- Inheritance is used here + + request('http://example.com', {jar: cookieJar}).then(function(res) { + // cookieJar.cookies holds now the cookies returned by example.com + }); + ``` + + Using `denodeify` makes it easier to compose asynchronous operations instead + of using callbacks. For example, instead of: + + ```javascript + let fs = require('fs'); + + fs.readFile('myfile.txt', function(err, data){ + if (err) { ... } // Handle error + fs.writeFile('myfile2.txt', data, function(err){ + if (err) { ... } // Handle error + console.log('done') + }); + }); + ``` + + you can chain the operations together using `then` from the returned promise: + + ```javascript + let fs = require('fs'); + let readFile = RSVP.denodeify(fs.readFile); + let writeFile = RSVP.denodeify(fs.writeFile); + + readFile('myfile.txt').then(function(data){ + return writeFile('myfile2.txt', data); + }).then(function(){ + console.log('done') + }).catch(function(error){ + // Handle error + }); + ``` + + @method denodeify + @static + @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} [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. + @return {Function} a function that wraps `nodeFunc` to return an + `RSVP.Promise` + @static + */ + function denodeify(nodeFunc, options) { + var fn = function () { + var self = this; + var l = arguments.length; + var args = new Array(l + 1); + var promiseInput = false; + + for (var i = 0; i < l; ++i) { + var arg = arguments[i]; + + if (!promiseInput) { + // TODO: clean this up + promiseInput = needsPromiseInput(arg); + if (promiseInput === GET_THEN_ERROR$1) { + var p = new Promise(noop); + reject(p, GET_THEN_ERROR$1.value); + return p; + } else if (promiseInput && promiseInput !== true) { + arg = wrapThenable(promiseInput, arg); + } + } + args[i] = arg; + } - @method rethrow - @static - @for RSVP - @param {Error} reason reason the promise became rejected. - @throws Error - @static -*/ -function rethrow(reason) { - setTimeout(function() { - throw reason; - }); - throw reason; -} + var promise = new Promise(noop); -/** - `RSVP.defer` returns an object similar to jQuery's `$.Deferred`. - `RSVP.defer` should be used when porting over code reliant on `$.Deferred`'s - interface. New code should use the `RSVP.Promise` constructor instead. + args[l] = function (err, val) { + if (err) reject(promise, err);else if (options === undefined) resolve(promise, val);else if (options === true) resolve(promise, arrayResult(arguments));else if (isArray(options)) resolve(promise, makeObject(arguments, options));else resolve(promise, val); + }; - The object returned from `RSVP.defer` is a plain object with three properties: + if (promiseInput) { + return handlePromiseInput(promise, args, nodeFunc, self); + } else { + return handleValueInput(promise, args, nodeFunc, self); + } + }; - * promise - an `RSVP.Promise`. - * reject - a function that causes the `promise` property on this object to - become rejected - * resolve - a function that causes the `promise` property on this object to - become fulfilled. + babelHelpers.defaults(fn, nodeFunc); - Example: + return fn; + } - ```javascript - var deferred = RSVP.defer(); + function handleValueInput(promise, args, nodeFunc, self) { + var result = tryApply(nodeFunc, self, args); + if (result === ERROR) { + reject(promise, result.value); + } + return promise; + } - deferred.resolve("Success!"); + function handlePromiseInput(promise, args, nodeFunc, self) { + return Promise.all(args).then(function (args) { + var result = tryApply(nodeFunc, self, args); + if (result === ERROR) { + reject(promise, result.value); + } + return promise; + }); + } - deferred.promise.then(function(value){ - // value here is "Success!" - }); - ``` + function needsPromiseInput(arg) { + if (arg && typeof arg === 'object') { + if (arg.constructor === Promise) { + return true; + } else { + return getThen$1(arg); + } + } else { + return false; + } + } - @method defer - @static - @for RSVP - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Object} - */ + /** + This is a convenient alias for `RSVP.Promise.all`. + + @method all + @static + @for RSVP + @param {Array} array Array of promises. + @param {String} label An optional label. This is useful + for tooling. + */ + function all$1(array, label) { + return Promise.all(array, label); + } -function defer(label) { - var deferred = {}; + function AllSettled(Constructor, entries, label) { + this._superConstructor(Constructor, entries, false, /* don't abort on reject */label); + } - deferred['promise'] = new Promise(function(resolve, reject) { - deferred['resolve'] = resolve; - deferred['reject'] = reject; - }, label); + AllSettled.prototype = o_create(Enumerator.prototype); + AllSettled.prototype._superConstructor = Enumerator; + AllSettled.prototype._makeResult = makeSettledResult; + AllSettled.prototype._validationError = function () { + return new Error('allSettled must be called with an array'); + }; - return deferred; -} + /** + `RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing + a fail-fast method, it waits until all the promises have returned and + shows you all the results. This is useful if you want to handle multiple + promises' failure states together as a set. + + Returns a promise that is fulfilled when all the given promises have been + settled. The return promise is fulfilled with an array of the states of + the promises passed into the `promises` array argument. + + Each state object will either indicate fulfillment or rejection, and + provide the corresponding value or reason. The states will take one of + the following formats: + + ```javascript + { state: 'fulfilled', value: value } + or + { state: 'rejected', reason: reason } + ``` + + Example: + + ```javascript + let promise1 = RSVP.Promise.resolve(1); + let promise2 = RSVP.Promise.reject(new Error('2')); + let promise3 = RSVP.Promise.reject(new Error('3')); + let promises = [ promise1, promise2, promise3 ]; + + RSVP.allSettled(promises).then(function(array){ + // array == [ + // { state: 'fulfilled', value: 1 }, + // { state: 'rejected', reason: Error }, + // { state: 'rejected', reason: Error } + // ] + // Note that for the second item, reason.message will be '2', and for the + // third item, reason.message will be '3'. + }, function(error) { + // Not run. (This block would only be called if allSettled had failed, + // for instance if passed an incorrect argument type.) + }); + ``` + + @method allSettled + @static + @for RSVP + @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. + */ -/** - `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 - each item in given to `promises`. `RSVP.map` returns a promise that will - become fulfilled with the result of running `mapFn` on the values the promises - become fulfilled with. + function allSettled(entries, label) { + return new AllSettled(Promise, entries, label).promise; + } - For example: + /** + This is a convenient alias for `RSVP.Promise.race`. + + @method race + @static + @for RSVP + @param {Array} array Array of promises. + @param {String} label An optional label. This is useful + for tooling. + */ + function race$1(array, label) { + return Promise.race(array, label); + } - ```javascript + function PromiseHash(Constructor, object, label) { + this._superConstructor(Constructor, object, true, label); + } - var promise1 = RSVP.resolve(1); - var promise2 = RSVP.resolve(2); - var promise3 = RSVP.resolve(3); - var promises = [ promise1, promise2, promise3 ]; + PromiseHash.prototype = o_create(Enumerator.prototype); + PromiseHash.prototype._superConstructor = Enumerator; + PromiseHash.prototype._init = function () { + this._result = {}; + }; - var mapFn = function(item){ - return item + 1; + PromiseHash.prototype._validateInput = function (input) { + return input && typeof input === 'object'; }; - RSVP.map(promises, mapFn).then(function(result){ - // result is [ 2, 3, 4 ] - }); - ``` + PromiseHash.prototype._validationError = function () { + return new Error('Promise.hash must be called with an object'); + }; - If any of the `promises` given to `RSVP.map` are rejected, the first promise - that is rejected will be given as an argument to the returned promise's - rejection handler. For example: + PromiseHash.prototype._enumerate = function () { + var enumerator = this; + var promise = enumerator.promise; + var input = enumerator._input; + var results = []; + + for (var key in input) { + if (promise._state === PENDING && Object.prototype.hasOwnProperty.call(input, key)) { + results.push({ + position: key, + entry: input[key] + }); + } + } - ```javascript - var promise1 = RSVP.resolve(1); - var promise2 = RSVP.reject(new Error('2')); - var promise3 = RSVP.reject(new Error('3')); - var promises = [ promise1, promise2, promise3 ]; + var length = results.length; + enumerator._remaining = length; + var result = undefined; - var mapFn = function(item){ - return item + 1; + for (var i = 0; promise._state === PENDING && i < length; i++) { + result = results[i]; + enumerator._eachEntry(result.entry, result.position); + } }; - RSVP.map(promises, mapFn).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(reason) { - // reason.message === '2' - }); - ``` + /** + `RSVP.hash` is similar to `RSVP.all`, but takes an object instead of an array + for its `promises` argument. + + Returns a promise that is fulfilled when all the given promises have been + fulfilled, or rejected if any of them become rejected. The returned promise + is fulfilled with a hash that has the same key names as the `promises` object + argument. If any of the values in the object are not promises, they will + simply be copied over to the fulfilled object. + + Example: + + ```javascript + let promises = { + myPromise: RSVP.resolve(1), + yourPromise: RSVP.resolve(2), + theirPromise: RSVP.resolve(3), + notAPromise: 4 + }; + + RSVP.hash(promises).then(function(hash){ + // hash here is an object that looks like: + // { + // myPromise: 1, + // yourPromise: 2, + // theirPromise: 3, + // notAPromise: 4 + // } + }); + ```` + + If any of the `promises` given to `RSVP.hash` are rejected, the first promise + that is rejected will be given as the reason to the rejection handler. + + Example: + + ```javascript + let promises = { + myPromise: RSVP.resolve(1), + rejectedPromise: RSVP.reject(new Error('rejectedPromise')), + anotherRejectedPromise: RSVP.reject(new Error('anotherRejectedPromise')), + }; + + RSVP.hash(promises).then(function(hash){ + // Code here never runs because there are rejected promises! + }, function(reason) { + // reason.message === 'rejectedPromise' + }); + ``` + + An important note: `RSVP.hash` is intended for plain JavaScript objects that + are just a set of keys and values. `RSVP.hash` will NOT preserve prototype + chains. + + Example: + + ```javascript + function MyConstructor(){ + this.example = RSVP.resolve('Example'); + } + + MyConstructor.prototype = { + protoProperty: RSVP.resolve('Proto Property') + }; + + let myObject = new MyConstructor(); + + RSVP.hash(myObject).then(function(hash){ + // protoProperty will not be present, instead you will just have an + // object that looks like: + // { + // example: 'Example' + // } + // + // hash.hasOwnProperty('protoProperty'); // false + // 'undefined' === typeof hash.protoProperty + }); + ``` + + @method hash + @static + @for RSVP + @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. + */ + function hash(object, label) { + return new PromiseHash(Promise, object, label).promise; + } - `RSVP.map` will also wait if a promise is returned from `mapFn`. For example, - say you want to get all comments from a set of blog posts, but you need - the blog posts first because they contain a url to those comments. + function HashSettled(Constructor, object, label) { + this._superConstructor(Constructor, object, false, label); + } - ```javscript + HashSettled.prototype = o_create(PromiseHash.prototype); + HashSettled.prototype._superConstructor = Enumerator; + HashSettled.prototype._makeResult = makeSettledResult; - var mapFn = function(blogPost){ - // getComments does some ajax and returns an RSVP.Promise that is fulfilled - // with some comments data - return getComments(blogPost.comments_url); + HashSettled.prototype._validationError = function () { + return new Error('hashSettled must be called with an object'); }; - // getBlogPosts does some ajax and returns an RSVP.Promise that is fulfilled - // with some blog post data - RSVP.map(getBlogPosts(), mapFn).then(function(comments){ - // comments is the result of asking the server for the comments - // of all blog posts returned from getBlogPosts() - }); - ``` - - @method map - @static - @for RSVP - @param {Array} promises - @param {Function} mapFn function to be called on each fulfilled promise. - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} promise that is fulfilled with the result of calling - `mapFn` on each fulfilled promise or value when they become fulfilled. - The promise will be rejected if any of the given `promises` become rejected. - @static -*/ -function map(promises, mapFn, label) { - return Promise.all(promises, label).then(function(values) { - if (!isFunction(mapFn)) { - throw new TypeError("You must pass a function as map's second argument."); + /** + `RSVP.hashSettled` is similar to `RSVP.allSettled`, but takes an object + instead of an array for its `promises` argument. + + Unlike `RSVP.all` or `RSVP.hash`, which implement a fail-fast method, + but like `RSVP.allSettled`, `hashSettled` waits until all the + constituent promises have returned and then shows you all the results + with their states and values/reasons. This is useful if you want to + handle multiple promises' failure states together as a set. + + Returns a promise that is fulfilled when all the given promises have been + settled, or rejected if the passed parameters are invalid. + + The returned promise is fulfilled with a hash that has the same key names as + the `promises` object argument. If any of the values in the object are not + promises, they will be copied over to the fulfilled object and marked with state + 'fulfilled'. + + Example: + + ```javascript + let promises = { + myPromise: RSVP.Promise.resolve(1), + yourPromise: RSVP.Promise.resolve(2), + theirPromise: RSVP.Promise.resolve(3), + notAPromise: 4 + }; + + RSVP.hashSettled(promises).then(function(hash){ + // hash here is an object that looks like: + // { + // myPromise: { state: 'fulfilled', value: 1 }, + // yourPromise: { state: 'fulfilled', value: 2 }, + // theirPromise: { state: 'fulfilled', value: 3 }, + // notAPromise: { state: 'fulfilled', value: 4 } + // } + }); + ``` + + If any of the `promises` given to `RSVP.hash` are rejected, the state will + be set to 'rejected' and the reason for rejection provided. + + Example: + + ```javascript + let promises = { + myPromise: RSVP.Promise.resolve(1), + rejectedPromise: RSVP.Promise.reject(new Error('rejection')), + anotherRejectedPromise: RSVP.Promise.reject(new Error('more rejection')), + }; + + RSVP.hashSettled(promises).then(function(hash){ + // hash here is an object that looks like: + // { + // myPromise: { state: 'fulfilled', value: 1 }, + // rejectedPromise: { state: 'rejected', reason: Error }, + // anotherRejectedPromise: { state: 'rejected', reason: Error }, + // } + // Note that for rejectedPromise, reason.message == 'rejection', + // and for anotherRejectedPromise, reason.message == 'more rejection'. + }); + ``` + + An important note: `RSVP.hashSettled` is intended for plain JavaScript objects that + are just a set of keys and values. `RSVP.hashSettled` will NOT preserve prototype + chains. + + Example: + + ```javascript + function MyConstructor(){ + this.example = RSVP.Promise.resolve('Example'); } + + MyConstructor.prototype = { + protoProperty: RSVP.Promise.resolve('Proto Property') + }; + + let myObject = new MyConstructor(); + + RSVP.hashSettled(myObject).then(function(hash){ + // protoProperty will not be present, instead you will just have an + // object that looks like: + // { + // example: { state: 'fulfilled', value: 'Example' } + // } + // + // hash.hasOwnProperty('protoProperty'); // false + // 'undefined' === typeof hash.protoProperty + }); + ``` + + @method hashSettled + @for RSVP + @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 + */ + function hashSettled(object, label) { + return new HashSettled(Promise, object, label).promise; + } - var length = values.length; - var results = new Array(length); - - for (var i = 0; i < length; i++) { - results[i] = mapFn(values[i]); + /** + `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 + caught by the promises implementation and bubbled to the last handler. For + this reason, it is recommended that you always specify a second rejection + handler function to `then`. However, `RSVP.rethrow` will throw the exception + outside of the promise, so it bubbles up to your console if in the browser, + or domain/cause uncaught exception in Node. `rethrow` will also throw the + error again so the error can be handled by the promise per the spec. + + ```javascript + function throws(){ + throw new Error('Whoops!'); } + + let promise = new RSVP.Promise(function(resolve, reject){ + throws(); + }); + + promise.catch(RSVP.rethrow).then(function(){ + // Code here doesn't run because the promise became rejected due to an + // error! + }, function (err){ + // handle the error here + }); + ``` + + The 'Whoops' error will be thrown on the next turn of the event loop + and you can watch for it in your console. You can also handle it using a + rejection handler given to `.then` or `.catch` on the returned promise. + + @method rethrow + @static + @for RSVP + @param {Error} reason reason the promise became rejected. + @throws Error + @static + */ + function rethrow(reason) { + setTimeout(function () { + throw reason; + }); + throw reason; + } - return Promise.all(results, label); - }); -} - -/** - This is a convenient alias for `RSVP.Promise.resolve`. + /** + `RSVP.defer` returns an object similar to jQuery's `$.Deferred`. + `RSVP.defer` should be used when porting over code reliant on `$.Deferred`'s + interface. New code should use the `RSVP.Promise` constructor instead. + + The object returned from `RSVP.defer` is a plain object with three properties: + + * promise - an `RSVP.Promise`. + * reject - a function that causes the `promise` property on this object to + become rejected + * resolve - a function that causes the `promise` property on this object to + become fulfilled. + + Example: + + ```javascript + let deferred = RSVP.defer(); + + deferred.resolve("Success!"); + + deferred.promise.then(function(value){ + // value here is "Success!" + }); + ``` + + @method defer + @static + @for RSVP + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Object} + */ - @method resolve - @static - @for RSVP - @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` -*/ -function resolve$2(value, label) { - return Promise.resolve(value, label); -} + function defer(label) { + var deferred = { resolve: undefined, reject: undefined }; -/** - This is a convenient alias for `RSVP.Promise.reject`. + deferred.promise = new Promise(function (resolve, reject) { + deferred.resolve = resolve; + deferred.reject = reject; + }, label); - @method reject - @static - @for RSVP - @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$2(reason, label) { - return Promise.reject(reason, label); -} + return deferred; + } -/** - `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 - each item in given to `promises`. `RSVP.filter` returns a promise that will - become fulfilled with the result of running `filterFn` on the values the - promises become fulfilled with. + /** + `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 + each item in given to `promises`. `RSVP.map` returns a promise that will + become fulfilled with the result of running `mapFn` on the values the promises + become fulfilled with. + + For example: + + ```javascript + + let promise1 = RSVP.resolve(1); + let promise2 = RSVP.resolve(2); + let promise3 = RSVP.resolve(3); + let promises = [ promise1, promise2, promise3 ]; + + let mapFn = function(item){ + return item + 1; + }; + + RSVP.map(promises, mapFn).then(function(result){ + // result is [ 2, 3, 4 ] + }); + ``` + + If any of the `promises` given to `RSVP.map` are rejected, the first promise + that is rejected will be given as an argument to the returned promise's + rejection handler. For example: + + ```javascript + let promise1 = RSVP.resolve(1); + let promise2 = RSVP.reject(new Error('2')); + let promise3 = RSVP.reject(new Error('3')); + let promises = [ promise1, promise2, promise3 ]; + + let mapFn = function(item){ + return item + 1; + }; + + RSVP.map(promises, mapFn).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(reason) { + // reason.message === '2' + }); + ``` + + `RSVP.map` will also wait if a promise is returned from `mapFn`. For example, + say you want to get all comments from a set of blog posts, but you need + the blog posts first because they contain a url to those comments. + + ```javscript + + let mapFn = function(blogPost){ + // getComments does some ajax and returns an RSVP.Promise that is fulfilled + // with some comments data + return getComments(blogPost.comments_url); + }; + + // getBlogPosts does some ajax and returns an RSVP.Promise that is fulfilled + // with some blog post data + RSVP.map(getBlogPosts(), mapFn).then(function(comments){ + // comments is the result of asking the server for the comments + // of all blog posts returned from getBlogPosts() + }); + ``` + + @method map + @static + @for RSVP + @param {Array} promises + @param {Function} mapFn function to be called on each fulfilled promise. + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} promise that is fulfilled with the result of calling + `mapFn` on each fulfilled promise or value when they become fulfilled. + The promise will be rejected if any of the given `promises` become rejected. + @static + */ + function map(promises, mapFn, label) { + return Promise.all(promises, label).then(function (values) { + if (!isFunction(mapFn)) { + throw new TypeError("You must pass a function as map's second argument."); + } - For example: + var length = values.length; + var results = new Array(length); - ```javascript + for (var i = 0; i < length; i++) { + results[i] = mapFn(values[i]); + } - var promise1 = RSVP.resolve(1); - var promise2 = RSVP.resolve(2); - var promise3 = RSVP.resolve(3); + return Promise.all(results, label); + }); + } - var promises = [promise1, promise2, promise3]; + /** + This is a convenient alias for `RSVP.Promise.resolve`. + + @method resolve + @static + @for RSVP + @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` + */ + function resolve$2(value, label) { + return Promise.resolve(value, label); + } - var filterFn = function(item){ - return item > 1; - }; + /** + This is a convenient alias for `RSVP.Promise.reject`. + + @method reject + @static + @for RSVP + @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$2(reason, label) { + return Promise.reject(reason, label); + } - RSVP.filter(promises, filterFn).then(function(result){ - // result is [ 2, 3 ] - }); - ``` + /** + `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 + each item in given to `promises`. `RSVP.filter` returns a promise that will + become fulfilled with the result of running `filterFn` on the values the + promises become fulfilled with. + + For example: + + ```javascript + + let promise1 = RSVP.resolve(1); + let promise2 = RSVP.resolve(2); + let promise3 = RSVP.resolve(3); + + let promises = [promise1, promise2, promise3]; + + let filterFn = function(item){ + return item > 1; + }; + + RSVP.filter(promises, filterFn).then(function(result){ + // result is [ 2, 3 ] + }); + ``` + + If any of the `promises` given to `RSVP.filter` are rejected, the first promise + that is rejected will be given as an argument to the returned promise's + rejection handler. For example: + + ```javascript + let promise1 = RSVP.resolve(1); + let promise2 = RSVP.reject(new Error('2')); + let promise3 = RSVP.reject(new Error('3')); + let promises = [ promise1, promise2, promise3 ]; + + let filterFn = function(item){ + return item > 1; + }; + + RSVP.filter(promises, filterFn).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(reason) { + // reason.message === '2' + }); + ``` + + `RSVP.filter` will also wait for any promises returned from `filterFn`. + For instance, you may want to fetch a list of users then return a subset + of those users based on some asynchronous operation: + + ```javascript + + let alice = { name: 'alice' }; + let bob = { name: 'bob' }; + let users = [ alice, bob ]; + + let promises = users.map(function(user){ + return RSVP.resolve(user); + }); + + let filterFn = function(user){ + // Here, Alice has permissions to create a blog post, but Bob does not. + return getPrivilegesForUser(user).then(function(privs){ + return privs.can_create_blog_post === true; + }); + }; + RSVP.filter(promises, filterFn).then(function(users){ + // true, because the server told us only Alice can create a blog post. + users.length === 1; + // false, because Alice is the only user present in `users` + users[0] === bob; + }); + ``` + + @method filter + @static + @for RSVP + @param {Array} promises + @param {Function} filterFn - function to be called on each resolved value to + filter the final results. + @param {String} label optional string describing the promise. Useful for + tooling. + @return {Promise} + */ - If any of the `promises` given to `RSVP.filter` are rejected, the first promise - that is rejected will be given as an argument to the returned promise's - rejection handler. For example: + function resolveAll(promises, label) { + return Promise.all(promises, label); + } - ```javascript - var promise1 = RSVP.resolve(1); - var promise2 = RSVP.reject(new Error('2')); - var promise3 = RSVP.reject(new Error('3')); - var promises = [ promise1, promise2, promise3 ]; + function resolveSingle(promise, label) { + return Promise.resolve(promise, label).then(function (promises) { + return resolveAll(promises, label); + }); + } - var filterFn = function(item){ - return item > 1; - }; + function filter(promises, filterFn, label) { + var promise = isArray(promises) ? resolveAll(promises, label) : resolveSingle(promises, label); + return promise.then(function (values) { + if (!isFunction(filterFn)) { + throw new TypeError("You must pass a function as filter's second argument."); + } - RSVP.filter(promises, filterFn).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(reason) { - // reason.message === '2' - }); - ``` + var length = values.length; + var filtered = new Array(length); - `RSVP.filter` will also wait for any promises returned from `filterFn`. - For instance, you may want to fetch a list of users then return a subset - of those users based on some asynchronous operation: + for (var i = 0; i < length; i++) { + filtered[i] = filterFn(values[i]); + } - ```javascript + return resolveAll(filtered, label).then(function (filtered) { + var results = new Array(length); + var newLength = 0; - var alice = { name: 'alice' }; - var bob = { name: 'bob' }; - var users = [ alice, bob ]; + for (var i = 0; i < length; i++) { + if (filtered[i]) { + results[newLength] = values[i]; + newLength++; + } + } - var promises = users.map(function(user){ - return RSVP.resolve(user); - }); + results.length = newLength; - var filterFn = function(user){ - // Here, Alice has permissions to create a blog post, but Bob does not. - return getPrivilegesForUser(user).then(function(privs){ - return privs.can_create_blog_post === true; + return results; + }); }); - }; - RSVP.filter(promises, filterFn).then(function(users){ - // true, because the server told us only Alice can create a blog post. - users.length === 1; - // false, because Alice is the only user present in `users` - users[0] === bob; - }); - ``` + } - @method filter - @static - @for RSVP - @param {Array} promises - @param {Function} filterFn - function to be called on each resolved value to - filter the final results. - @param {String} label optional string describing the promise. Useful for - tooling. - @return {Promise} -*/ -function filter(promises, filterFn, label) { - return Promise.all(promises, label).then(function(values) { - if (!isFunction(filterFn)) { - throw new TypeError("You must pass a function as filter's second argument."); + var len = 0; + var vertxNext = undefined; + function asap(callback, arg) { + queue$1[len] = callback; + queue$1[len + 1] = arg; + len += 2; + if (len === 2) { + // If len is 1, that means that we need to schedule an async flush. + // If additional callbacks are queued before the queue is flushed, they + // will be processed by this flush that we are scheduling. + scheduleFlush$1(); + } + } + + var browserWindow = typeof window !== 'undefined' ? window : undefined; + var browserGlobal = browserWindow || {}; + var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; + var isNode = typeof self === '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 () { + return nextTick(flush); + }; + } - var length = values.length; - var filtered = new Array(length); - - for (var i = 0; i < length; i++) { - filtered[i] = filterFn(values[i]); + // vertx + function useVertxTimer() { + if (typeof vertxNext !== 'undefined') { + return function () { + vertxNext(flush); + }; } - - return Promise.all(filtered, label).then(function(filtered) { - var results = new Array(length); - var newLength = 0; - - for (var i = 0; i < length; i++) { - if (filtered[i]) { - results[newLength] = values[i]; - newLength++; - } - } - - results.length = newLength; - - return results; - }); - }); -} - -var len = 0; -var vertxNext; -function asap(callback, arg) { - queue$1[len] = callback; - queue$1[len + 1] = arg; - len += 2; - if (len === 2) { - // If len is 1, that means that we need to schedule an async flush. - // If additional callbacks are queued before the queue is flushed, they - // will be processed by this flush that we are scheduling. - scheduleFlush$1(); + return useSetTimeout(); } -} -var browserWindow = (typeof window !== 'undefined') ? window : undefined; -var browserGlobal = browserWindow || {}; -var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; -var isNode = typeof self === '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() { - nextTick(flush); - }; -} + function useMutationObserver() { + var iterations = 0; + var observer = new BrowserMutationObserver(flush); + var node = document.createTextNode(''); + observer.observe(node, { characterData: true }); -// vertx -function useVertxTimer() { - return function() { - vertxNext(flush); - }; -} + return function () { + return node.data = iterations = ++iterations % 2; + }; + } -function useMutationObserver() { - var iterations = 0; - var observer = new BrowserMutationObserver(flush); - var node = document.createTextNode(''); - observer.observe(node, { characterData: true }); + // web worker + function useMessageChannel() { + var channel = new MessageChannel(); + channel.port1.onmessage = flush; + return function () { + return channel.port2.postMessage(0); + }; + } - return function() { - node.data = (iterations = ++iterations % 2); - }; -} + function useSetTimeout() { + return function () { + return setTimeout(flush, 1); + }; + } -// web worker -function useMessageChannel() { - var channel = new MessageChannel(); - channel.port1.onmessage = flush; - return function () { - channel.port2.postMessage(0); - }; -} + var queue$1 = new Array(1000); -function useSetTimeout() { - return function() { - setTimeout(flush, 1); - }; -} + function flush() { + for (var i = 0; i < len; i += 2) { + var callback = queue$1[i]; + var arg = queue$1[i + 1]; -var queue$1 = new Array(1000); -function flush() { - for (var i = 0; i < len; i+=2) { - var callback = queue$1[i]; - var arg = queue$1[i+1]; + callback(arg); - callback(arg); + queue$1[i] = undefined; + queue$1[i + 1] = undefined; + } - queue$1[i] = undefined; - queue$1[i+1] = undefined; + len = 0; } - len = 0; -} - -function attemptVertex() { - try { - var r = require; - var vertx = r('vertx'); - vertxNext = vertx.runOnLoop || vertx.runOnContext; - return useVertxTimer(); - } catch(e) { - return useSetTimeout(); + function attemptVertex() { + try { + var r = require; + var vertx = r('vertx'); + vertxNext = vertx.runOnLoop || vertx.runOnContext; + return useVertxTimer(); + } catch (e) { + return useSetTimeout(); + } } -} - -var scheduleFlush$1; -// Decide what async method to use to triggering processing of queued callbacks: -if (isNode) { - scheduleFlush$1 = useNextTick(); -} else if (BrowserMutationObserver) { - scheduleFlush$1 = useMutationObserver(); -} else if (isWorker) { - scheduleFlush$1 = useMessageChannel(); -} else if (browserWindow === undefined && typeof require === 'function') { - scheduleFlush$1 = attemptVertex(); -} else { - scheduleFlush$1 = useSetTimeout(); -} -// defaults -config.async = asap; -config.after = function(cb) { - setTimeout(cb, 0); -}; -var cast = resolve$2; -function async(callback, arg) { - config.async(callback, arg); -} + var scheduleFlush$1 = undefined; + // Decide what async method to use to triggering processing of queued callbacks: + if (isNode) { + scheduleFlush$1 = useNextTick(); + } else if (BrowserMutationObserver) { + scheduleFlush$1 = useMutationObserver(); + } else if (isWorker) { + scheduleFlush$1 = useMessageChannel(); + } else if (browserWindow === undefined && typeof require === 'function') { + scheduleFlush$1 = attemptVertex(); + } else { + scheduleFlush$1 = useSetTimeout(); + } -function on() { - config['on'].apply(config, arguments); -} + var platform = undefined; -function off() { - config['off'].apply(config, arguments); -} + /* global self */ + if (typeof self === 'object') { + platform = self; -// Set up instrumentation through `window.__PROMISE_INTRUMENTATION__` -if (typeof window !== 'undefined' && typeof window['__PROMISE_INSTRUMENTATION__'] === 'object') { - var callbacks = window['__PROMISE_INSTRUMENTATION__']; - configure('instrument', true); - for (var eventName in callbacks) { - if (callbacks.hasOwnProperty(eventName)) { - on(eventName, callbacks[eventName]); + /* global global */ + } else if (typeof global === 'object') { + platform = global; + } else { + throw new Error('no global: `self` or `global` found'); } - } -} -exports.cast = cast; -exports.Promise = Promise; -exports.EventTarget = EventTarget; -exports.all = all$1; -exports.allSettled = allSettled; -exports.race = race$1; -exports.hash = hash; -exports.hashSettled = hashSettled; -exports.rethrow = rethrow; -exports.defer = defer; -exports.denodeify = denodeify; -exports.configure = configure; -exports.on = on; -exports.off = off; -exports.resolve = resolve$2; -exports.reject = reject$2; -exports.async = async; -exports.map = map; -exports.filter = filter; + // defaults + config.async = asap; + config.after = function (cb) { + return setTimeout(cb, 0); + }; + var cast = resolve$2; -Object.defineProperty(exports, '__esModule', { value: true }); + var async = function (callback, arg) { + return config.async(callback, arg); + }; + function on() { + config['on'].apply(config, arguments); + } + + function off() { + config['off'].apply(config, arguments); + } + + // Set up instrumentation through `window.__PROMISE_INTRUMENTATION__` + if (typeof window !== 'undefined' && typeof window['__PROMISE_INSTRUMENTATION__'] === 'object') { + var callbacks = window['__PROMISE_INSTRUMENTATION__']; + configure('instrument', true); + for (var eventName in callbacks) { + if (callbacks.hasOwnProperty(eventName)) { + on(eventName, callbacks[eventName]); + } + } + } + + // the default export here is for backwards compat: + // https://github.com/tildeio/rsvp.js/issues/434 + var rsvp = (_rsvp = { + cast: cast, + Promise: Promise, + EventTarget: EventTarget, + all: all$1, + allSettled: allSettled, + race: race$1, + hash: hash, + hashSettled: hashSettled, + rethrow: rethrow, + defer: defer, + denodeify: denodeify, + configure: configure, + on: on, + off: off, + resolve: resolve$2, + reject: reject$2, + map: map + }, _rsvp['async'] = async, _rsvp.filter = // babel seems to error if async isn't a computed prop here... + filter, _rsvp); + + exports.cast = cast; + exports.Promise = Promise; + exports.EventTarget = EventTarget; + exports.all = all$1; + exports.allSettled = allSettled; + exports.race = race$1; + exports.hash = hash; + exports.hashSettled = hashSettled; + exports.rethrow = rethrow; + exports.defer = defer; + exports.denodeify = denodeify; + exports.configure = configure; + exports.on = on; + exports.off = off; + exports.resolve = resolve$2; + exports.reject = reject$2; + exports.map = map; + exports.async = async; + exports.filter = filter; + exports.default = rsvp; }); requireModule("ember"); diff --git a/ember.js b/ember.js index 14a3d55ab..9b110362f 100644 --- a/ember.js +++ b/ember.js @@ -1,16 +1,16 @@ ;(function() { /*! * @overview Ember - JavaScript Application Framework - * @copyright Copyright 2011-2016 Tilde Inc. and contributors + * @copyright Copyright 2011-2017 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.10.2-with-backtracking + * @version 2.12.0-canary-with-backtracking */ var enifed, requireModule, Ember; -var mainContext = this; +var mainContext = this; // Used in ember-environment/lib/global.js (function() { var isNode = typeof window === 'undefined' && @@ -112,8 +112,6 @@ var mainContext = this; } })(); -var babelHelpers; - function classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); @@ -186,59950 +184,51441 @@ babelHelpers = { defaults: defaults }; -enifed('backburner', ['exports'], function (exports) { 'use strict'; - -var NUMBER = /\d+/; +enifed('@glimmer/node', ['exports', '@glimmer/runtime'], function (exports, _glimmerRuntime) { + 'use strict'; -function each(collection, callback) { - for (var i = 0; i < collection.length; i++) { - callback(collection[i]); - } -} + var NodeDOMTreeConstruction = (function (_DOMTreeConstruction) { + babelHelpers.inherits(NodeDOMTreeConstruction, _DOMTreeConstruction); -function isString(suspect) { - return typeof suspect === 'string'; -} + function NodeDOMTreeConstruction(doc) { + _DOMTreeConstruction.call(this, doc); + } -function isFunction(suspect) { - return typeof suspect === 'function'; -} + // override to prevent usage of `this.document` until after the constructor -function isNumber(suspect) { - return typeof suspect === 'number'; -} + NodeDOMTreeConstruction.prototype.setupUselessElement = function setupUselessElement() {}; -function isCoercableNumber(number) { - return isNumber(number) || NUMBER.test(number); -} + NodeDOMTreeConstruction.prototype.insertHTMLBefore = function insertHTMLBefore(parent, html, reference) { + var prev = reference ? reference.previousSibling : parent.lastChild; + var raw = this.document.createRawHTMLSection(html); + parent.insertBefore(raw, reference); + var first = prev ? prev.nextSibling : parent.firstChild; + var last = reference ? reference.previousSibling : parent.lastChild; + return new _glimmerRuntime.ConcreteBounds(parent, first, last); + }; -function binarySearch(time, timers) { - var start = 0; - var end = timers.length - 2; - var middle, l; + // override to avoid SVG detection/work when in node (this is not needed in SSR) - while (start < end) { - // since timers is an array of pairs 'l' will always - // be an integer - l = (end - start) / 2; + NodeDOMTreeConstruction.prototype.createElement = function createElement(tag) { + return this.document.createElement(tag); + }; - // compensate for the index in case even number - // of pairs inside timers - middle = start + l - (l % 2); + // override to avoid namespace shenanigans when in node (this is not needed in SSR) - if (time >= timers[middle]) { - start = middle + 2; - } else { - end = middle; - } - } + NodeDOMTreeConstruction.prototype.setAttribute = function setAttribute(element, name, value) { + element.setAttribute(name, value); + }; - return (time >= timers[start]) ? start + 2 : start; -} + return NodeDOMTreeConstruction; + })(_glimmerRuntime.DOMTreeConstruction); -function Queue(name, options, globalOptions) { - this.name = name; - this.globalOptions = globalOptions || {}; - this.options = options; - this._queue = []; - this.targetQueues = {}; - this._queueBeingFlushed = undefined; -} + exports.NodeDOMTreeConstruction = NodeDOMTreeConstruction; +}); +enifed("@glimmer/reference", ["exports", "@glimmer/util"], function (exports, _glimmerUtil) { + "use strict"; -Queue.prototype = { - push: function(target, method, args, stack) { - var queue = this._queue; - queue.push(target, method, args, stack); + var CONSTANT = 0; + var INITIAL = 1; + var VOLATILE = NaN; - return { - queue: this, - target: target, - method: method - }; - }, + var RevisionTag = (function () { + function RevisionTag() {} - pushUniqueWithoutGuid: function(target, method, args, stack) { - var queue = this._queue; + RevisionTag.prototype.validate = function validate(snapshot) { + return this.value() === snapshot; + }; - for (var i = 0, l = queue.length; i < l; i += 4) { - var currentTarget = queue[i]; - var currentMethod = queue[i+1]; + return RevisionTag; + })(); - if (currentTarget === target && currentMethod === method) { - queue[i+2] = args; // replace args - queue[i+3] = stack; // replace stack - return; - } - } + var $REVISION = INITIAL; - queue.push(target, method, args, stack); - }, + var DirtyableTag = (function (_RevisionTag) { + babelHelpers.inherits(DirtyableTag, _RevisionTag); - targetQueue: function(targetQueue, target, method, args, stack) { - var queue = this._queue; + function DirtyableTag() { + var revision = arguments.length <= 0 || arguments[0] === undefined ? $REVISION : arguments[0]; - for (var i = 0, l = targetQueue.length; i < l; i += 2) { - var currentMethod = targetQueue[i]; - var currentIndex = targetQueue[i + 1]; + _RevisionTag.call(this); + this.revision = revision; + } - if (currentMethod === method) { - queue[currentIndex + 2] = args; // replace args - queue[currentIndex + 3] = stack; // replace stack - return; - } - } + DirtyableTag.prototype.value = function value() { + return this.revision; + }; - targetQueue.push( - method, - queue.push(target, method, args, stack) - 4 - ); - }, + DirtyableTag.prototype.dirty = function dirty() { + this.revision = ++$REVISION; + }; - pushUniqueWithGuid: function(guid, target, method, args, stack) { - var hasLocalQueue = this.targetQueues[guid]; + return DirtyableTag; + })(RevisionTag); - if (hasLocalQueue) { - this.targetQueue(hasLocalQueue, target, method, args, stack); - } else { - this.targetQueues[guid] = [ - method, - this._queue.push(target, method, args, stack) - 4 - ]; + function combineTagged(tagged) { + var optimized = []; + for (var i = 0, l = tagged.length; i < l; i++) { + var tag = tagged[i].tag; + if (tag === VOLATILE_TAG) return VOLATILE_TAG; + if (tag === CONSTANT_TAG) continue; + optimized.push(tag); + } + return _combine(optimized); + } + function combineSlice(slice) { + var optimized = []; + var node = slice.head(); + while (node !== null) { + var tag = node.tag; + if (tag === VOLATILE_TAG) return VOLATILE_TAG; + if (tag !== CONSTANT_TAG) optimized.push(tag); + node = slice.nextNode(node); + } + return _combine(optimized); + } + function combine(tags) { + var optimized = []; + for (var i = 0, l = tags.length; i < l; i++) { + var tag = tags[i]; + if (tag === VOLATILE_TAG) return VOLATILE_TAG; + if (tag === CONSTANT_TAG) continue; + optimized.push(tag); + } + return _combine(optimized); + } + function _combine(tags) { + switch (tags.length) { + case 0: + return CONSTANT_TAG; + case 1: + return tags[0]; + case 2: + return new TagsPair(tags[0], tags[1]); + default: + return new TagsCombinator(tags); + } + ; } - return { - queue: this, - target: target, - method: method - }; - }, + var CachedTag = (function (_RevisionTag2) { + babelHelpers.inherits(CachedTag, _RevisionTag2); - pushUnique: function(target, method, args, stack) { - var KEY = this.globalOptions.GUID_KEY; + function CachedTag() { + _RevisionTag2.apply(this, arguments); + this.lastChecked = null; + this.lastValue = null; + } - if (target && KEY) { - var guid = target[KEY]; - if (guid) { - return this.pushUniqueWithGuid(guid, target, method, args, stack); - } - } + CachedTag.prototype.value = function value() { + var lastChecked = this.lastChecked; + var lastValue = this.lastValue; - this.pushUniqueWithoutGuid(target, method, args, stack); + if (lastChecked !== $REVISION) { + this.lastChecked = $REVISION; + this.lastValue = lastValue = this.compute(); + } + return this.lastValue; + }; - return { - queue: this, - target: target, - method: method - }; - }, + CachedTag.prototype.invalidate = function invalidate() { + this.lastChecked = null; + }; - invoke: function(target, method, args /*, onError, errorRecordedForStack */) { - if (args && args.length > 0) { - method.apply(target, args); - } else { - method.call(target); - } - }, + return CachedTag; + })(RevisionTag); - invokeWithOnError: function(target, method, args, onError, errorRecordedForStack) { - try { - if (args && args.length > 0) { - method.apply(target, args); - } else { - method.call(target); - } - } catch(error) { - onError(error, errorRecordedForStack); - } - }, + var TagsPair = (function (_CachedTag) { + babelHelpers.inherits(TagsPair, _CachedTag); - flush: function(sync) { - var queue = this._queue; - var length = queue.length; + function TagsPair(first, second) { + _CachedTag.call(this); + this.first = first; + this.second = second; + } - if (length === 0) { - return; - } + TagsPair.prototype.compute = function compute() { + return Math.max(this.first.value(), this.second.value()); + }; - var globalOptions = this.globalOptions; - var options = this.options; - var before = options && options.before; - var after = options && options.after; - var onError = globalOptions.onError || (globalOptions.onErrorTarget && - globalOptions.onErrorTarget[globalOptions.onErrorMethod]); - var target, method, args, errorRecordedForStack; - var invoke = onError ? this.invokeWithOnError : this.invoke; + return TagsPair; + })(CachedTag); - this.targetQueues = Object.create(null); - var queueItems = this._queueBeingFlushed = this._queue.slice(); - this._queue = []; + var TagsCombinator = (function (_CachedTag2) { + babelHelpers.inherits(TagsCombinator, _CachedTag2); - if (before) { - before(); - } + function TagsCombinator(tags) { + _CachedTag2.call(this); + this.tags = tags; + } - for (var i = 0; i < length; i += 4) { - target = queueItems[i]; - method = queueItems[i+1]; - args = queueItems[i+2]; - errorRecordedForStack = queueItems[i+3]; // Debugging assistance + TagsCombinator.prototype.compute = function compute() { + var tags = this.tags; - if (isString(method)) { - method = target[method]; - } + var max = -1; + for (var i = 0; i < tags.length; i++) { + var value = tags[i].value(); + max = Math.max(value, max); + } + return max; + }; - // method could have been nullified / canceled during flush - if (method) { - // - // ** Attention intrepid developer ** - // - // To find out the stack of this task when it was scheduled onto - // the run loop, add the following to your app.js: - // - // Ember.run.backburner.DEBUG = true; // NOTE: This slows your app, don't leave it on in production. - // - // Once that is in place, when you are at a breakpoint and navigate - // here in the stack explorer, you can look at `errorRecordedForStack.stack`, - // which will be the captured stack when this job was scheduled. - // - // One possible long-term solution is the following Chrome issue: - // https://bugs.chromium.org/p/chromium/issues/detail?id=332624 - // - invoke(target, method, args, onError, errorRecordedForStack); - } - } + return TagsCombinator; + })(CachedTag); - if (after) { - after(); - } + var UpdatableTag = (function (_CachedTag3) { + babelHelpers.inherits(UpdatableTag, _CachedTag3); - this._queueBeingFlushed = undefined; + function UpdatableTag(tag) { + _CachedTag3.call(this); + this.tag = tag; + this.lastUpdated = INITIAL; + } - if (sync !== false && - this._queue.length > 0) { - // check if new items have been added - this.flush(true); - } - }, + ////////// - cancel: function(actionToCancel) { - var queue = this._queue, currentTarget, currentMethod, i, l; - var target = actionToCancel.target; - var method = actionToCancel.method; - var GUID_KEY = this.globalOptions.GUID_KEY; + UpdatableTag.prototype.compute = function compute() { + return Math.max(this.lastUpdated, this.tag.value()); + }; - if (GUID_KEY && this.targetQueues && target) { - var targetQueue = this.targetQueues[target[GUID_KEY]]; + UpdatableTag.prototype.update = function update(tag) { + if (tag !== this.tag) { + this.tag = tag; + this.lastUpdated = $REVISION; + this.invalidate(); + } + }; - if (targetQueue) { - for (i = 0, l = targetQueue.length; i < l; i++) { - if (targetQueue[i] === method) { - targetQueue.splice(i, 1); - } + return UpdatableTag; + })(CachedTag); + + var CONSTANT_TAG = new ((function (_RevisionTag3) { + babelHelpers.inherits(ConstantTag, _RevisionTag3); + + function ConstantTag() { + _RevisionTag3.apply(this, arguments); } - } - } - for (i = 0, l = queue.length; i < l; i += 4) { - currentTarget = queue[i]; - currentMethod = queue[i+1]; + ConstantTag.prototype.value = function value() { + return CONSTANT; + }; - if (currentTarget === target && - currentMethod === method) { - queue.splice(i, 4); - return true; - } - } + return ConstantTag; + })(RevisionTag))(); + var VOLATILE_TAG = new ((function (_RevisionTag4) { + babelHelpers.inherits(VolatileTag, _RevisionTag4); - // if not found in current queue - // could be in the queue that is being flushed - queue = this._queueBeingFlushed; + function VolatileTag() { + _RevisionTag4.apply(this, arguments); + } - if (!queue) { - return; - } + VolatileTag.prototype.value = function value() { + return VOLATILE; + }; - for (i = 0, l = queue.length; i < l; i += 4) { - currentTarget = queue[i]; - currentMethod = queue[i+1]; + return VolatileTag; + })(RevisionTag))(); + var CURRENT_TAG = new ((function (_DirtyableTag) { + babelHelpers.inherits(CurrentTag, _DirtyableTag); - if (currentTarget === target && - currentMethod === method) { - // don't mess with array during flush - // just nullify the method - queue[i+1] = null; - return true; - } - } - } -}; + function CurrentTag() { + _DirtyableTag.apply(this, arguments); + } -function DeferredActionQueues(queueNames, options) { - var queues = this.queues = {}; - this.queueNames = queueNames = queueNames || []; + CurrentTag.prototype.value = function value() { + return $REVISION; + }; - this.options = options; + return CurrentTag; + })(DirtyableTag))(); - each(queueNames, function(queueName) { - queues[queueName] = new Queue(queueName, options[queueName], options); - }); -} + var CachedReference = (function () { + function CachedReference() { + this.lastRevision = null; + this.lastValue = null; + } -function noSuchQueue(name) { - throw new Error('You attempted to schedule an action in a queue (' + name + ') that doesn\'t exist'); -} + CachedReference.prototype.value = function value() { + var tag = this.tag; + var lastRevision = this.lastRevision; + var lastValue = this.lastValue; -function noSuchMethod(name) { - throw new Error('You attempted to schedule an action in a queue (' + name + ') for a method that doesn\'t exist'); -} + if (!lastRevision || !tag.validate(lastRevision)) { + lastValue = this.lastValue = this.compute(); + this.lastRevision = tag.value(); + } + return lastValue; + }; -DeferredActionQueues.prototype = { - schedule: function(name, target, method, args, onceFlag, stack) { - var queues = this.queues; - var queue = queues[name]; + CachedReference.prototype.invalidate = function invalidate() { + this.lastRevision = null; + }; - if (!queue) { - noSuchQueue(name); - } + return CachedReference; + })(); - if (!method) { - noSuchMethod(name); - } + var MapperReference = (function (_CachedReference) { + babelHelpers.inherits(MapperReference, _CachedReference); - if (onceFlag) { - return queue.pushUnique(target, method, args, stack); - } else { - return queue.push(target, method, args, stack); - } - }, + function MapperReference(reference, mapper) { + _CachedReference.call(this); + this.tag = reference.tag; + this.reference = reference; + this.mapper = mapper; + } - flush: function() { - var queues = this.queues; - var queueNames = this.queueNames; - var queueName, queue; - var queueNameIndex = 0; - var numberOfQueues = queueNames.length; + MapperReference.prototype.compute = function compute() { + var reference = this.reference; + var mapper = this.mapper; - while (queueNameIndex < numberOfQueues) { - queueName = queueNames[queueNameIndex]; - queue = queues[queueName]; + return mapper(reference.value()); + }; - var numberOfQueueItems = queue._queue.length; + return MapperReference; + })(CachedReference); - if (numberOfQueueItems === 0) { - queueNameIndex++; - } else { - queue.flush(false /* async */); - queueNameIndex = 0; - } + function map(reference, mapper) { + return new MapperReference(reference, mapper); } - } -}; - -function Backburner(queueNames, options) { - this.queueNames = queueNames; - this.options = options || {}; - if (!this.options.defaultQueue) { - this.options.defaultQueue = queueNames[0]; - } - this.instanceStack = []; - this._debouncees = []; - this._throttlers = []; - this._eventCallbacks = { - end: [], - begin: [] - }; - - var _this = this; - this._boundClearItems = function() { - clearItems(); - }; - - this._timerTimeoutId = undefined; - this._timers = []; + ////////// - this._platform = this.options._platform || { - setTimeout: function (fn, ms) { - return setTimeout(fn, ms); - }, - clearTimeout: function (id) { - clearTimeout(id); - } - }; + var ReferenceCache = (function () { + function ReferenceCache(reference) { + this.lastValue = null; + this.lastRevision = null; + this.initialized = false; + this.tag = reference.tag; + this.reference = reference; + } - this._boundRunExpiredTimers = function () { - _this._runExpiredTimers(); - }; -} + ReferenceCache.prototype.peek = function peek() { + if (!this.initialized) { + return this.initialize(); + } + return this.lastValue; + }; -Backburner.prototype = { - begin: function() { - var options = this.options; - var onBegin = options && options.onBegin; - var previousInstance = this.currentInstance; + ReferenceCache.prototype.revalidate = function revalidate() { + if (!this.initialized) { + return this.initialize(); + } + var reference = this.reference; + var lastRevision = this.lastRevision; - if (previousInstance) { - this.instanceStack.push(previousInstance); - } + var tag = reference.tag; + if (tag.validate(lastRevision)) return NOT_MODIFIED; + this.lastRevision = tag.value(); + var lastValue = this.lastValue; - this.currentInstance = new DeferredActionQueues(this.queueNames, options); - this._trigger('begin', this.currentInstance, previousInstance); - if (onBegin) { - onBegin(this.currentInstance, previousInstance); - } - }, + var value = reference.value(); + if (value === lastValue) return NOT_MODIFIED; + this.lastValue = value; + return value; + }; - end: function() { - var options = this.options; - var onEnd = options && options.onEnd; - var currentInstance = this.currentInstance; - var nextInstance = null; + ReferenceCache.prototype.initialize = function initialize() { + var reference = this.reference; - // Prevent double-finally bug in Safari 6.0.2 and iOS 6 - // This bug appears to be resolved in Safari 6.0.5 and iOS 7 - var finallyAlreadyCalled = false; - try { - currentInstance.flush(); - } finally { - if (!finallyAlreadyCalled) { - finallyAlreadyCalled = true; + var value = this.lastValue = reference.value(); + this.lastRevision = reference.tag.value(); + this.initialized = true; + return value; + }; - this.currentInstance = null; + return ReferenceCache; + })(); - if (this.instanceStack.length) { - nextInstance = this.instanceStack.pop(); - this.currentInstance = nextInstance; - } - this._trigger('end', currentInstance, nextInstance); - if (onEnd) { - onEnd(currentInstance, nextInstance); - } - } + var NOT_MODIFIED = "adb3b78e-3d22-4e4b-877a-6317c2c5c145"; + function isModified(value) { + return value !== NOT_MODIFIED; } - }, - /** - 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. + var ConstReference = (function () { + function ConstReference(inner) { + this.inner = inner; + this.tag = CONSTANT_TAG; + } - @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); - } - } - }, + ConstReference.prototype.value = function value() { + return this.inner; + }; - 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'); - } - }, + return ConstReference; + })(); - 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'); + function isConst(reference) { + return reference.tag === CONSTANT_TAG; } - }, - - run: function(/* target, method, args */) { - var length = arguments.length; - var method, target, args; - if (length === 1) { - method = arguments[0]; - target = null; - } else { - target = arguments[0]; - method = arguments[1]; - } + var ListItem = (function (_ListNode) { + babelHelpers.inherits(ListItem, _ListNode); - if (isString(method)) { - method = target[method]; - } + function ListItem(iterable, result) { + _ListNode.call(this, iterable.valueReferenceFor(result)); + this.retained = false; + this.seen = false; + this.key = result.key; + this.iterable = iterable; + this.memo = iterable.memoReferenceFor(result); + } - if (length > 2) { - args = new Array(length - 2); - for (var i = 0, l = length - 2; i < l; i++) { - args[i] = arguments[i + 2]; - } - } else { - args = []; - } + ListItem.prototype.update = function update(item) { + this.retained = true; + this.iterable.updateValueReference(this.value, item); + this.iterable.updateMemoReference(this.memo, item); + }; - var onError = getOnError(this.options); + ListItem.prototype.shouldRemove = function shouldRemove() { + return !this.retained; + }; - this.begin(); + ListItem.prototype.reset = function reset() { + this.retained = false; + this.seen = false; + }; - // guard against Safari 6's double-finally bug - var didFinally = false; + return ListItem; + })(_glimmerUtil.ListNode); - if (onError) { - try { - return method.apply(target, args); - } catch(error) { - onError(error); - } finally { - if (!didFinally) { - didFinally = true; - this.end(); - } - } - } else { - try { - return method.apply(target, args); - } finally { - if (!didFinally) { - didFinally = true; - this.end(); + var IterationArtifacts = (function () { + function IterationArtifacts(iterable) { + this.map = _glimmerUtil.dict(); + this.list = new _glimmerUtil.LinkedList(); + this.tag = iterable.tag; + this.iterable = iterable; } - } - } - }, - /* - Join the passed method with an existing queue and execute immediately, - if there isn't one use `Backburner#run`. + IterationArtifacts.prototype.isEmpty = function isEmpty() { + var iterator = this.iterator = this.iterable.iterate(); + return iterator.isEmpty(); + }; - The join method is like the run method except that it will schedule into - an existing queue if one already exists. In either case, the join method will - immediately execute the passed in function and return its result. + IterationArtifacts.prototype.iterate = function iterate() { + var iterator = this.iterator || this.iterable.iterate(); + this.iterator = null; + return iterator; + }; - @method join - @param {Object} target - @param {Function} method The method to be executed - @param {any} args The method arguments - @return method result - */ - join: function(/* target, method, args */) { - if (!this.currentInstance) { - return this.run.apply(this, arguments); - } + IterationArtifacts.prototype.has = function has(key) { + return !!this.map[key]; + }; - var length = arguments.length; - var method, target; + IterationArtifacts.prototype.get = function get(key) { + return this.map[key]; + }; - if (length === 1) { - method = arguments[0]; - target = null; - } else { - target = arguments[0]; - method = arguments[1]; - } + IterationArtifacts.prototype.wasSeen = function wasSeen(key) { + var node = this.map[key]; + return node && node.seen; + }; - if (isString(method)) { - method = target[method]; - } + IterationArtifacts.prototype.append = function append(item) { + var map = this.map; + var list = this.list; + var iterable = this.iterable; - if (length === 1) { - return method(); - } else if (length === 2) { - return method.call(target); - } else { - var args = new Array(length - 2); - for (var i = 0, l = length - 2; i < l; i++) { - args[i] = arguments[i + 2]; - } - return method.apply(target, args); - } - }, + var node = map[item.key] = new ListItem(iterable, item); + list.append(node); + return node; + }; + IterationArtifacts.prototype.insertBefore = function insertBefore(item, reference) { + var map = this.map; + var list = this.list; + var iterable = this.iterable; - /* - Defer the passed function to run inside the specified queue. + var node = map[item.key] = new ListItem(iterable, item); + node.retained = true; + list.insertBefore(node, reference); + return node; + }; - @method defer - @param {String} queueName - @param {Object} target - @param {Function|String} method The method or method name to be executed - @param {any} args The method arguments - @return method result - */ - defer: function(queueName /* , target, method, args */) { - var length = arguments.length; - var method, target, args; + IterationArtifacts.prototype.move = function move(item, reference) { + var list = this.list; - if (length === 2) { - method = arguments[1]; - target = null; - } else { - target = arguments[1]; - method = arguments[2]; - } + item.retained = true; + list.remove(item); + list.insertBefore(item, reference); + }; - if (isString(method)) { - method = target[method]; - } + IterationArtifacts.prototype.remove = function remove(item) { + var list = this.list; - var stack = this.DEBUG ? new Error() : undefined; + list.remove(item); + delete this.map[item.key]; + }; - if (length > 3) { - args = new Array(length - 3); - for (var i = 3; i < length; i++) { - args[i-3] = arguments[i]; - } - } else { - args = undefined; - } + IterationArtifacts.prototype.nextNode = function nextNode(item) { + return this.list.nextNode(item); + }; - if (!this.currentInstance) { createAutorun(this); } - return this.currentInstance.schedule(queueName, target, method, args, false, stack); - }, + IterationArtifacts.prototype.head = function head() { + return this.list.head(); + }; - deferOnce: function(queueName /* , target, method, args */) { - var length = arguments.length; - var method, target, args; + return IterationArtifacts; + })(); - if (length === 2) { - method = arguments[1]; - target = null; - } else { - target = arguments[1]; - method = arguments[2]; - } + var ReferenceIterator = (function () { + // if anyone needs to construct this object with something other than + // an iterable, let @wycats know. - if (isString(method)) { - method = target[method]; - } + function ReferenceIterator(iterable) { + this.iterator = null; + var artifacts = new IterationArtifacts(iterable); + this.artifacts = artifacts; + } - var stack = this.DEBUG ? new Error() : undefined; + ReferenceIterator.prototype.next = function next() { + var artifacts = this.artifacts; - if (length > 3) { - args = new Array(length - 3); - for (var i = 3; i < length; i++) { - args[i-3] = arguments[i]; - } - } else { - args = undefined; - } + var iterator = this.iterator = this.iterator || artifacts.iterate(); + var item = iterator.next(); + if (!item) return null; + return artifacts.append(item); + }; - if (!this.currentInstance) { - createAutorun(this); - } - return this.currentInstance.schedule(queueName, target, method, args, true, stack); - }, + return ReferenceIterator; + })(); - setTimeout: function() { - var l = arguments.length; - var args = new Array(l); + var Phase; + (function (Phase) { + Phase[Phase["Append"] = 0] = "Append"; + Phase[Phase["Prune"] = 1] = "Prune"; + Phase[Phase["Done"] = 2] = "Done"; + })(Phase || (Phase = {})); - for (var x = 0; x < l; x++) { - args[x] = arguments[x]; - } + var IteratorSynchronizer = (function () { + function IteratorSynchronizer(_ref) { + var target = _ref.target; + var artifacts = _ref.artifacts; - var length = args.length, - method, wait, target, - methodOrTarget, methodOrWait, methodOrArgs; + this.target = target; + this.artifacts = artifacts; + this.iterator = artifacts.iterate(); + this.current = artifacts.head(); + } - if (length === 0) { - return; - } else if (length === 1) { - method = args.shift(); - wait = 0; - } else if (length === 2) { - methodOrTarget = args[0]; - methodOrWait = args[1]; + IteratorSynchronizer.prototype.sync = function sync() { + var phase = Phase.Append; + while (true) { + switch (phase) { + case Phase.Append: + phase = this.nextAppend(); + break; + case Phase.Prune: + phase = this.nextPrune(); + break; + case Phase.Done: + this.nextDone(); + return; + } + } + }; - if (isFunction(methodOrWait) || isFunction(methodOrTarget[methodOrWait])) { - target = args.shift(); - method = args.shift(); - wait = 0; - } else if (isCoercableNumber(methodOrWait)) { - method = args.shift(); - wait = args.shift(); - } else { - method = args.shift(); - wait = 0; - } - } else { - var last = args[args.length - 1]; + IteratorSynchronizer.prototype.advanceToKey = function advanceToKey(key) { + var current = this.current; + var artifacts = this.artifacts; - if (isCoercableNumber(last)) { - wait = args.pop(); - } else { - wait = 0; - } + var seek = current; + while (seek && seek.key !== key) { + seek.seen = true; + seek = artifacts.nextNode(seek); + } + this.current = seek && artifacts.nextNode(seek); + }; - methodOrTarget = args[0]; - methodOrArgs = args[1]; + IteratorSynchronizer.prototype.nextAppend = function nextAppend() { + var iterator = this.iterator; + var current = this.current; + var artifacts = this.artifacts; - if (isFunction(methodOrArgs) || (isString(methodOrArgs) && - methodOrTarget !== null && - methodOrArgs in methodOrTarget)) { - target = args.shift(); - method = args.shift(); - } else { - method = args.shift(); - } - } - - var executeAt = Date.now() + parseInt(wait !== wait ? 0 : wait, 10); - - if (isString(method)) { - method = target[method]; - } - - var onError = getOnError(this.options); + var item = iterator.next(); + if (item === null) { + return this.startPrune(); + } + var key = item.key; - function fn() { - if (onError) { - try { - method.apply(target, args); - } catch (e) { - onError(e); - } - } else { - method.apply(target, args); - } - } + if (current && current.key === key) { + this.nextRetain(item); + } else if (artifacts.has(key)) { + this.nextMove(item); + } else { + this.nextInsert(item); + } + return Phase.Append; + }; - return this._setTimeout(fn, executeAt); - }, + IteratorSynchronizer.prototype.nextRetain = function nextRetain(item) { + var artifacts = this.artifacts; + var current = this.current; - _setTimeout: function (fn, executeAt) { - if (this._timers.length === 0) { - this._timers.push(executeAt, fn); - this._installTimerTimeout(); - return fn; - } + current = _glimmerUtil.expect(current, 'BUG: current is empty'); + current.update(item); + this.current = artifacts.nextNode(current); + this.target.retain(item.key, current.value, current.memo); + }; - // find position to insert - var i = binarySearch(executeAt, this._timers); + IteratorSynchronizer.prototype.nextMove = function nextMove(item) { + var current = this.current; + var artifacts = this.artifacts; + var target = this.target; + var key = item.key; - this._timers.splice(i, 0, executeAt, fn); + var found = artifacts.get(item.key); + found.update(item); + if (artifacts.wasSeen(item.key)) { + artifacts.move(found, current); + target.move(found.key, found.value, found.memo, current ? current.key : null); + } else { + this.advanceToKey(key); + } + }; - // we should be the new earliest timer if i == 0 - if (i === 0) { - this._reinstallTimerTimeout(); - } + IteratorSynchronizer.prototype.nextInsert = function nextInsert(item) { + var artifacts = this.artifacts; + var target = this.target; + var current = this.current; - return fn; - }, + var node = artifacts.insertBefore(item, current); + target.insert(node.key, node.value, node.memo, current ? current.key : null); + }; - throttle: function(target, method /* , args, wait, [immediate] */) { - var backburner = this; - var args = new Array(arguments.length); - for (var i = 0; i < arguments.length; i++) { - args[i] = arguments[i]; - } - var immediate = args.pop(); - var wait, throttler, index, timer; + IteratorSynchronizer.prototype.startPrune = function startPrune() { + this.current = this.artifacts.head(); + return Phase.Prune; + }; - if (isNumber(immediate) || isString(immediate)) { - wait = immediate; - immediate = true; - } else { - wait = args.pop(); - } + IteratorSynchronizer.prototype.nextPrune = function nextPrune() { + var artifacts = this.artifacts; + var target = this.target; + var current = this.current; - wait = parseInt(wait, 10); + if (current === null) { + return Phase.Done; + } + var node = current; + this.current = artifacts.nextNode(node); + if (node.shouldRemove()) { + artifacts.remove(node); + target.delete(node.key); + } else { + node.reset(); + } + return Phase.Prune; + }; - index = findThrottler(target, method, this._throttlers); - if (index > -1) { return this._throttlers[index]; } // throttled + IteratorSynchronizer.prototype.nextDone = function nextDone() { + this.target.done(); + }; - timer = this._platform.setTimeout(function() { - if (!immediate) { - backburner.run.apply(backburner, args); - } - var index = findThrottler(target, method, backburner._throttlers); - if (index > -1) { - backburner._throttlers.splice(index, 1); - } - }, wait); + return IteratorSynchronizer; + })(); - if (immediate) { - this.run.apply(this, args); + function referenceFromParts(root, parts) { + var reference = root; + for (var i = 0; i < parts.length; i++) { + reference = reference.get(parts[i]); + } + return reference; } - throttler = [target, method, timer]; + exports.ConstReference = ConstReference; + exports.isConst = isConst; + exports.ListItem = ListItem; + exports.referenceFromParts = referenceFromParts; + exports.IterationArtifacts = IterationArtifacts; + exports.ReferenceIterator = ReferenceIterator; + exports.IteratorSynchronizer = IteratorSynchronizer; + exports.CONSTANT = CONSTANT; + exports.INITIAL = INITIAL; + exports.VOLATILE = VOLATILE; + exports.RevisionTag = RevisionTag; + exports.DirtyableTag = DirtyableTag; + exports.combineTagged = combineTagged; + exports.combineSlice = combineSlice; + exports.combine = combine; + exports.CachedTag = CachedTag; + exports.UpdatableTag = UpdatableTag; + exports.CONSTANT_TAG = CONSTANT_TAG; + exports.VOLATILE_TAG = VOLATILE_TAG; + exports.CURRENT_TAG = CURRENT_TAG; + exports.CachedReference = CachedReference; + exports.map = map; + exports.ReferenceCache = ReferenceCache; + exports.isModified = isModified; +}); +enifed('@glimmer/runtime',['exports','@glimmer/util','@glimmer/reference','@glimmer/wire-format'],function(exports,_glimmerUtil,_glimmerReference,_glimmerWireFormat){'use strict';var PrimitiveReference=(function(_ConstReference){babelHelpers.inherits(PrimitiveReference,_ConstReference);function PrimitiveReference(value){_ConstReference.call(this,value);}PrimitiveReference.create = function create(value){if(value === undefined){return UNDEFINED_REFERENCE;}else if(value === null){return NULL_REFERENCE;}else if(value === true){return TRUE_REFERENCE;}else if(value === false){return FALSE_REFERENCE;}else if(typeof value === 'number'){return new ValueReference(value);}else {return new StringReference(value);}};PrimitiveReference.prototype.get = function get(_key){return UNDEFINED_REFERENCE;};return PrimitiveReference;})(_glimmerReference.ConstReference);var StringReference=(function(_PrimitiveReference){babelHelpers.inherits(StringReference,_PrimitiveReference);function StringReference(){_PrimitiveReference.apply(this,arguments);this.lengthReference = null;}StringReference.prototype.get = function get(key){if(key === 'length'){var lengthReference=this.lengthReference;if(lengthReference === null){lengthReference = this.lengthReference = new ValueReference(this.inner.length);}return lengthReference;}else {return _PrimitiveReference.prototype.get.call(this,key);}};return StringReference;})(PrimitiveReference);var ValueReference=(function(_PrimitiveReference2){babelHelpers.inherits(ValueReference,_PrimitiveReference2);function ValueReference(value){_PrimitiveReference2.call(this,value);}return ValueReference;})(PrimitiveReference);var UNDEFINED_REFERENCE=new ValueReference(undefined);var NULL_REFERENCE=new ValueReference(null);var TRUE_REFERENCE=new ValueReference(true);var FALSE_REFERENCE=new ValueReference(false);var ConditionalReference=(function(){function ConditionalReference(inner){this.inner = inner;this.tag = inner.tag;}ConditionalReference.prototype.value = function value(){return this.toBool(this.inner.value());};ConditionalReference.prototype.toBool = function toBool(value){return !!value;};return ConditionalReference;})();var Constants=(function(){function Constants(){ // `0` means NULL +this.references = [];this.strings = [];this.expressions = [];this.arrays = [];this.slices = [];this.blocks = [];this.functions = [];this.others = [];this.NULL_REFERENCE = this.reference(NULL_REFERENCE);this.UNDEFINED_REFERENCE = this.reference(UNDEFINED_REFERENCE);}Constants.prototype.getReference = function getReference(value){return this.references[value - 1];};Constants.prototype.reference = function reference(value){var index=this.references.length;this.references.push(value);return index + 1;};Constants.prototype.getString = function getString(value){return this.strings[value - 1];};Constants.prototype.string = function string(value){var index=this.strings.length;this.strings.push(value);return index + 1;};Constants.prototype.getExpression = function getExpression(value){return this.expressions[value - 1];};Constants.prototype.expression = function expression(value){var index=this.expressions.length;this.expressions.push(value);return index + 1;};Constants.prototype.getArray = function getArray(value){return this.arrays[value - 1];};Constants.prototype.array = function array(values){var index=this.arrays.length;this.arrays.push(values);return index + 1;};Constants.prototype.getSlice = function getSlice(value){return this.slices[value - 1];};Constants.prototype.slice = function slice(_slice2){ // TODO: Put the entire program in one big array +var index=this.slices.length;this.slices.push(_slice2);return index + 1;};Constants.prototype.getBlock = function getBlock(value){return this.blocks[value - 1];};Constants.prototype.block = function block(_block2){var index=this.blocks.length;this.blocks.push(_block2);return index + 1;};Constants.prototype.getFunction = function getFunction(value){return this.functions[value - 1];};Constants.prototype.function = function _function(f){var index=this.functions.length;this.functions.push(f);return index + 1;};Constants.prototype.getOther = function getOther(value){return this.others[value - 1];};Constants.prototype.other = function other(_other){var index=this.others.length;this.others.push(_other);return index + 1;};return Constants;})();var AppendOpcodes=(function(){function AppendOpcodes(){this.evaluateOpcode = _glimmerUtil.fillNulls(51 /* EvaluatePartial */ + 1);}AppendOpcodes.prototype.add = function add(name,evaluate){this.evaluateOpcode[name] = evaluate;};AppendOpcodes.prototype.construct = function construct(name,_debug,op1,op2,op3){return [name | 0,(op1 || 0) | 0,(op2 || 0) | 0,(op3 || 0) | 0];};AppendOpcodes.prototype.evaluate = function evaluate(vm,opcode){_glimmerUtil.LOGGER.debug('[VM] OPCODE: ' + opcode.type);var func=this.evaluateOpcode[opcode.type];func(vm,opcode);};return AppendOpcodes;})();var APPEND_OPCODES=new AppendOpcodes();var AbstractOpcode=(function(){function AbstractOpcode(){_glimmerUtil.initializeGuid(this);}AbstractOpcode.prototype.toJSON = function toJSON(){return {guid:this._guid,type:this.type};};return AbstractOpcode;})();var UpdatingOpcode=(function(_AbstractOpcode){babelHelpers.inherits(UpdatingOpcode,_AbstractOpcode);function UpdatingOpcode(){_AbstractOpcode.apply(this,arguments);this.next = null;this.prev = null;}return UpdatingOpcode;})(AbstractOpcode);APPEND_OPCODES.add(20, /* OpenBlock */function(vm,_ref){var _getBlock=_ref.op1;var _args=_ref.op2;var inner=vm.constants.getOther(_getBlock);var rawArgs=vm.constants.getExpression(_args);var args=null;var block=inner.evaluate(vm);if(block){args = rawArgs.evaluate(vm);} // FIXME: can we avoid doing this when we don't have a block? +vm.pushCallerScope();if(block){vm.invokeBlock(block,args || null);}});APPEND_OPCODES.add(21, /* CloseBlock */function(vm){return vm.popScope();});APPEND_OPCODES.add(0, /* PushChildScope */function(vm){return vm.pushChildScope();});APPEND_OPCODES.add(1, /* PopScope */function(vm){return vm.popScope();});APPEND_OPCODES.add(2, /* PushDynamicScope */function(vm){return vm.pushDynamicScope();});APPEND_OPCODES.add(3, /* PopDynamicScope */function(vm){return vm.popDynamicScope();});APPEND_OPCODES.add(4, /* Put */function(vm,_ref2){var reference=_ref2.op1;vm.frame.setOperand(vm.constants.getReference(reference));});APPEND_OPCODES.add(5, /* EvaluatePut */function(vm,_ref3){var expression=_ref3.op1;var expr=vm.constants.getExpression(expression);vm.evaluateOperand(expr);});APPEND_OPCODES.add(6, /* PutArgs */function(vm,_ref4){var args=_ref4.op1;vm.evaluateArgs(vm.constants.getExpression(args));});APPEND_OPCODES.add(7, /* BindPositionalArgs */function(vm,_ref5){var _symbols=_ref5.op1;var symbols=vm.constants.getArray(_symbols);vm.bindPositionalArgs(symbols);});APPEND_OPCODES.add(8, /* BindNamedArgs */function(vm,_ref6){var _names=_ref6.op1;var _symbols=_ref6.op2;var names=vm.constants.getArray(_names);var symbols=vm.constants.getArray(_symbols);vm.bindNamedArgs(names,symbols);});APPEND_OPCODES.add(9, /* BindBlocks */function(vm,_ref7){var _names=_ref7.op1;var _symbols=_ref7.op2;var names=vm.constants.getArray(_names);var symbols=vm.constants.getArray(_symbols);vm.bindBlocks(names,symbols);});APPEND_OPCODES.add(10, /* BindPartialArgs */function(vm,_ref8){var symbol=_ref8.op1;vm.bindPartialArgs(symbol);});APPEND_OPCODES.add(11, /* BindCallerScope */function(vm){return vm.bindCallerScope();});APPEND_OPCODES.add(12, /* BindDynamicScope */function(vm,_ref9){var _names=_ref9.op1;var names=vm.constants.getArray(_names);vm.bindDynamicScope(names);});APPEND_OPCODES.add(13, /* Enter */function(vm,_ref10){var slice=_ref10.op1;return vm.enter(slice);});APPEND_OPCODES.add(14, /* Exit */function(vm){return vm.exit();});APPEND_OPCODES.add(15, /* Evaluate */function(vm,_ref11){var _block=_ref11.op1;var block=vm.constants.getBlock(_block);var args=vm.frame.getArgs();vm.invokeBlock(block,args);});APPEND_OPCODES.add(16, /* Jump */function(vm,_ref12){var target=_ref12.op1;return vm.goto(target);});APPEND_OPCODES.add(17, /* JumpIf */function(vm,_ref13){var target=_ref13.op1;var reference=vm.frame.getCondition();if(_glimmerReference.isConst(reference)){if(reference.value()){vm.goto(target);}}else {var cache=new _glimmerReference.ReferenceCache(reference);if(cache.peek()){vm.goto(target);}vm.updateWith(new Assert(cache));}});APPEND_OPCODES.add(18, /* JumpUnless */function(vm,_ref14){var target=_ref14.op1;var reference=vm.frame.getCondition();if(_glimmerReference.isConst(reference)){if(!reference.value()){vm.goto(target);}}else {var cache=new _glimmerReference.ReferenceCache(reference);if(!cache.peek()){vm.goto(target);}vm.updateWith(new Assert(cache));}});var ConstTest=function(ref,_env){return new _glimmerReference.ConstReference(!!ref.value());};var SimpleTest=function(ref,_env){return ref;};var EnvironmentTest=function(ref,env){return env.toConditionalReference(ref);};APPEND_OPCODES.add(19, /* Test */function(vm,_ref15){var _func=_ref15.op1;var operand=vm.frame.getOperand();var func=vm.constants.getFunction(_func);vm.frame.setCondition(func(operand,vm.env));});var Assert=(function(_UpdatingOpcode){babelHelpers.inherits(Assert,_UpdatingOpcode);function Assert(cache){_UpdatingOpcode.call(this);this.type = "assert";this.tag = cache.tag;this.cache = cache;}Assert.prototype.evaluate = function evaluate(vm){var cache=this.cache;if(_glimmerReference.isModified(cache.revalidate())){vm.throw();}};Assert.prototype.toJSON = function toJSON(){var type=this.type;var _guid=this._guid;var cache=this.cache;var expected=undefined;try{expected = JSON.stringify(cache.peek());}catch(e) {expected = String(cache.peek());}return {guid:_guid,type:type,args:[],details:{expected:expected}};};return Assert;})(UpdatingOpcode);var JumpIfNotModifiedOpcode=(function(_UpdatingOpcode2){babelHelpers.inherits(JumpIfNotModifiedOpcode,_UpdatingOpcode2);function JumpIfNotModifiedOpcode(tag,target){_UpdatingOpcode2.call(this);this.target = target;this.type = "jump-if-not-modified";this.tag = tag;this.lastRevision = tag.value();}JumpIfNotModifiedOpcode.prototype.evaluate = function evaluate(vm){var tag=this.tag;var target=this.target;var lastRevision=this.lastRevision;if(!vm.alwaysRevalidate && tag.validate(lastRevision)){vm.goto(target);}};JumpIfNotModifiedOpcode.prototype.didModify = function didModify(){this.lastRevision = this.tag.value();};JumpIfNotModifiedOpcode.prototype.toJSON = function toJSON(){return {guid:this._guid,type:this.type,args:[JSON.stringify(this.target.inspect())]};};return JumpIfNotModifiedOpcode;})(UpdatingOpcode);var DidModifyOpcode=(function(_UpdatingOpcode3){babelHelpers.inherits(DidModifyOpcode,_UpdatingOpcode3);function DidModifyOpcode(target){_UpdatingOpcode3.call(this);this.target = target;this.type = "did-modify";this.tag = _glimmerReference.CONSTANT_TAG;}DidModifyOpcode.prototype.evaluate = function evaluate(){this.target.didModify();};return DidModifyOpcode;})(UpdatingOpcode);var LabelOpcode=(function(){function LabelOpcode(label){this.tag = _glimmerReference.CONSTANT_TAG;this.type = "label";this.label = null;this.prev = null;this.next = null;_glimmerUtil.initializeGuid(this);if(label)this.label = label;}LabelOpcode.prototype.evaluate = function evaluate(){};LabelOpcode.prototype.inspect = function inspect(){return this.label + ' [' + this._guid + ']';};LabelOpcode.prototype.toJSON = function toJSON(){return {guid:this._guid,type:this.type,args:[JSON.stringify(this.inspect())]};};return LabelOpcode;})();var EMPTY_ARRAY=_glimmerUtil.HAS_NATIVE_WEAKMAP?Object.freeze([]):[];var EMPTY_DICT=_glimmerUtil.HAS_NATIVE_WEAKMAP?Object.freeze(_glimmerUtil.dict()):_glimmerUtil.dict();var CompiledPositionalArgs=(function(){function CompiledPositionalArgs(values){this.values = values;this.length = values.length;}CompiledPositionalArgs.create = function create(values){if(values.length){return new this(values);}else {return COMPILED_EMPTY_POSITIONAL_ARGS;}};CompiledPositionalArgs.empty = function empty(){return COMPILED_EMPTY_POSITIONAL_ARGS;};CompiledPositionalArgs.prototype.evaluate = function evaluate(vm){var values=this.values;var length=this.length;var references=new Array(length);for(var i=0;i < length;i++) {references[i] = values[i].evaluate(vm);}return EvaluatedPositionalArgs.create(references);};CompiledPositionalArgs.prototype.toJSON = function toJSON(){return '[' + this.values.map(function(value){return value.toJSON();}).join(", ") + ']';};return CompiledPositionalArgs;})();var COMPILED_EMPTY_POSITIONAL_ARGS=new ((function(_CompiledPositionalArgs){babelHelpers.inherits(_class,_CompiledPositionalArgs);function _class(){_CompiledPositionalArgs.call(this,EMPTY_ARRAY);}_class.prototype.evaluate = function evaluate(_vm){return EVALUATED_EMPTY_POSITIONAL_ARGS;};_class.prototype.toJSON = function toJSON(){return '';};return _class;})(CompiledPositionalArgs))();var EvaluatedPositionalArgs=(function(){function EvaluatedPositionalArgs(values){this.values = values;this.tag = _glimmerReference.combineTagged(values);this.length = values.length;}EvaluatedPositionalArgs.create = function create(values){return new this(values);};EvaluatedPositionalArgs.empty = function empty(){return EVALUATED_EMPTY_POSITIONAL_ARGS;};EvaluatedPositionalArgs.prototype.at = function at(index){var values=this.values;var length=this.length;return index < length?values[index]:UNDEFINED_REFERENCE;};EvaluatedPositionalArgs.prototype.value = function value(){var values=this.values;var length=this.length;var ret=new Array(length);for(var i=0;i < length;i++) {ret[i] = values[i].value();}return ret;};return EvaluatedPositionalArgs;})();var EVALUATED_EMPTY_POSITIONAL_ARGS=new ((function(_EvaluatedPositionalArgs){babelHelpers.inherits(_class2,_EvaluatedPositionalArgs);function _class2(){_EvaluatedPositionalArgs.call(this,EMPTY_ARRAY);}_class2.prototype.at = function at(){return UNDEFINED_REFERENCE;};_class2.prototype.value = function value(){return this.values;};return _class2;})(EvaluatedPositionalArgs))();var CompiledNamedArgs=(function(){function CompiledNamedArgs(keys,values){this.keys = keys;this.values = values;this.length = keys.length;_glimmerUtil.assert(keys.length === values.length,'Keys and values do not have the same length');}CompiledNamedArgs.empty = function empty(){return COMPILED_EMPTY_NAMED_ARGS;};CompiledNamedArgs.create = function create(map){var keys=Object.keys(map);var length=keys.length;if(length > 0){var values=[];for(var i=0;i < length;i++) {values[i] = map[keys[i]];}return new this(keys,values);}else {return COMPILED_EMPTY_NAMED_ARGS;}};CompiledNamedArgs.prototype.evaluate = function evaluate(vm){var keys=this.keys;var values=this.values;var length=this.length;var evaluated=new Array(length);for(var i=0;i < length;i++) {evaluated[i] = values[i].evaluate(vm);}return new EvaluatedNamedArgs(keys,evaluated);};CompiledNamedArgs.prototype.toJSON = function toJSON(){var keys=this.keys;var values=this.values;var inner=keys.map(function(key,i){return key + ': ' + values[i].toJSON();}).join(", ");return '{' + inner + '}';};return CompiledNamedArgs;})();var COMPILED_EMPTY_NAMED_ARGS=new ((function(_CompiledNamedArgs){babelHelpers.inherits(_class3,_CompiledNamedArgs);function _class3(){_CompiledNamedArgs.call(this,EMPTY_ARRAY,EMPTY_ARRAY);}_class3.prototype.evaluate = function evaluate(_vm){return EVALUATED_EMPTY_NAMED_ARGS;};_class3.prototype.toJSON = function toJSON(){return '';};return _class3;})(CompiledNamedArgs))();var EvaluatedNamedArgs=(function(){function EvaluatedNamedArgs(keys,values){var _map=arguments.length <= 2 || arguments[2] === undefined?null:arguments[2];this.keys = keys;this.values = values;this._map = _map;this.tag = _glimmerReference.combineTagged(values);this.length = keys.length;_glimmerUtil.assert(keys.length === values.length,'Keys and values do not have the same length');}EvaluatedNamedArgs.create = function create(map){var keys=Object.keys(map);var length=keys.length;if(length > 0){var values=new Array(length);for(var i=0;i < length;i++) {values[i] = map[keys[i]];}return new this(keys,values,map);}else {return EVALUATED_EMPTY_NAMED_ARGS;}};EvaluatedNamedArgs.empty = function empty(){return EVALUATED_EMPTY_NAMED_ARGS;};EvaluatedNamedArgs.prototype.get = function get(key){var keys=this.keys;var values=this.values;var index=keys.indexOf(key);return index === -1?UNDEFINED_REFERENCE:values[index];};EvaluatedNamedArgs.prototype.has = function has(key){return this.keys.indexOf(key) !== -1;};EvaluatedNamedArgs.prototype.value = function value(){var keys=this.keys;var values=this.values;var out=_glimmerUtil.dict();for(var i=0;i < keys.length;i++) {var key=keys[i];var ref=values[i];out[key] = ref.value();}return out;};babelHelpers.createClass(EvaluatedNamedArgs,[{key:'map',get:function(){var map=this._map;if(map){return map;}map = this._map = _glimmerUtil.dict();var keys=this.keys;var values=this.values;var length=this.length;for(var i=0;i < length;i++) {map[keys[i]] = values[i];}return map;}}]);return EvaluatedNamedArgs;})();var EVALUATED_EMPTY_NAMED_ARGS=new ((function(_EvaluatedNamedArgs){babelHelpers.inherits(_class4,_EvaluatedNamedArgs);function _class4(){_EvaluatedNamedArgs.call(this,EMPTY_ARRAY,EMPTY_ARRAY,EMPTY_DICT);}_class4.prototype.get = function get(){return UNDEFINED_REFERENCE;};_class4.prototype.has = function has(_key){return false;};_class4.prototype.value = function value(){return EMPTY_DICT;};return _class4;})(EvaluatedNamedArgs))();var EMPTY_BLOCKS={default:null,inverse:null};var CompiledArgs=(function(){function CompiledArgs(positional,named,blocks){this.positional = positional;this.named = named;this.blocks = blocks;this.type = "compiled-args";}CompiledArgs.create = function create(positional,named,blocks){if(positional === COMPILED_EMPTY_POSITIONAL_ARGS && named === COMPILED_EMPTY_NAMED_ARGS && blocks === EMPTY_BLOCKS){return this.empty();}else {return new this(positional,named,blocks);}};CompiledArgs.empty = function empty(){return COMPILED_EMPTY_ARGS;};CompiledArgs.prototype.evaluate = function evaluate(vm){var positional=this.positional;var named=this.named;var blocks=this.blocks;return EvaluatedArgs.create(positional.evaluate(vm),named.evaluate(vm),blocks);};return CompiledArgs;})();var COMPILED_EMPTY_ARGS=new ((function(_CompiledArgs){babelHelpers.inherits(_class5,_CompiledArgs);function _class5(){_CompiledArgs.call(this,COMPILED_EMPTY_POSITIONAL_ARGS,COMPILED_EMPTY_NAMED_ARGS,EMPTY_BLOCKS);}_class5.prototype.evaluate = function evaluate(_vm){return EMPTY_EVALUATED_ARGS;};return _class5;})(CompiledArgs))();var EvaluatedArgs=(function(){function EvaluatedArgs(positional,named,blocks){this.positional = positional;this.named = named;this.blocks = blocks;this.tag = _glimmerReference.combineTagged([positional,named]);}EvaluatedArgs.empty = function empty(){return EMPTY_EVALUATED_ARGS;};EvaluatedArgs.create = function create(positional,named,blocks){return new this(positional,named,blocks);};EvaluatedArgs.positional = function positional(values){var blocks=arguments.length <= 1 || arguments[1] === undefined?EMPTY_BLOCKS:arguments[1];return new this(EvaluatedPositionalArgs.create(values),EVALUATED_EMPTY_NAMED_ARGS,blocks);};EvaluatedArgs.named = function named(map){var blocks=arguments.length <= 1 || arguments[1] === undefined?EMPTY_BLOCKS:arguments[1];return new this(EVALUATED_EMPTY_POSITIONAL_ARGS,EvaluatedNamedArgs.create(map),blocks);};return EvaluatedArgs;})();var EMPTY_EVALUATED_ARGS=new EvaluatedArgs(EVALUATED_EMPTY_POSITIONAL_ARGS,EVALUATED_EMPTY_NAMED_ARGS,EMPTY_BLOCKS);APPEND_OPCODES.add(22, /* PutDynamicComponent */function(vm){var reference=vm.frame.getOperand();var cache=_glimmerReference.isConst(reference)?undefined:new _glimmerReference.ReferenceCache(reference);var definition=cache?cache.peek():reference.value();vm.frame.setImmediate(definition);if(cache){vm.updateWith(new Assert(cache));}});APPEND_OPCODES.add(23, /* PutComponent */function(vm,_ref16){var _component=_ref16.op1;var definition=vm.constants.getOther(_component);vm.frame.setImmediate(definition);});APPEND_OPCODES.add(24, /* OpenComponent */function(vm,_ref17){var _args=_ref17.op1;var _shadow=_ref17.op2;var rawArgs=vm.constants.getExpression(_args);var shadow=vm.constants.getBlock(_shadow);var definition=vm.frame.getImmediate();var dynamicScope=vm.pushDynamicScope();var callerScope=vm.scope();var manager=definition.manager;var args=manager.prepareArgs(definition,rawArgs.evaluate(vm),dynamicScope);var hasDefaultBlock=!!args.blocks.default; // TODO Cleanup? +var component=manager.create(vm.env,definition,args,dynamicScope,vm.getSelf(),hasDefaultBlock);var destructor=manager.getDestructor(component);if(destructor)vm.newDestroyable(destructor);var layout=manager.layoutFor(definition,component,vm.env);var selfRef=manager.getSelf(component);vm.beginCacheGroup();vm.stack().pushSimpleBlock();vm.pushRootScope(selfRef,layout.symbols);vm.invokeLayout(args,layout,callerScope,component,manager,shadow);vm.updateWith(new UpdateComponentOpcode(definition.name,component,manager,args,dynamicScope));}); // export class DidCreateElementOpcode extends Opcode { +// public type = "did-create-element"; +// evaluate(vm: VM) { +// let manager = vm.frame.getManager(); +// let component = vm.frame.getComponent(); +// let action = 'DidCreateElementOpcode#evaluate'; +// manager.didCreateElement(component, vm.stack().expectConstructing(action), vm.stack().expectOperations(action)); +// } +// toJSON(): OpcodeJSON { +// return { +// guid: this._guid, +// type: this.type, +// args: ["$ARGS"] +// }; +// } +// } +APPEND_OPCODES.add(25, /* DidCreateElement */function(vm){var manager=vm.frame.getManager();var component=vm.frame.getComponent();var action='DidCreateElementOpcode#evaluate';manager.didCreateElement(component,vm.stack().expectConstructing(action),vm.stack().expectOperations(action));}); // export class ShadowAttributesOpcode extends Opcode { +// public type = "shadow-attributes"; +// evaluate(vm: VM) { +// let shadow = vm.frame.getShadow(); +// vm.pushCallerScope(); +// if (!shadow) return; +// vm.invokeBlock(shadow, EvaluatedArgs.empty()); +// } +// toJSON(): OpcodeJSON { +// return { +// guid: this._guid, +// type: this.type, +// args: ["$ARGS"] +// }; +// } +// } +// Slow path for non-specialized component invocations. Uses an internal +// named lookup on the args. +APPEND_OPCODES.add(26, /* ShadowAttributes */function(vm){var shadow=vm.frame.getShadow();vm.pushCallerScope();if(!shadow)return;vm.invokeBlock(shadow,EvaluatedArgs.empty());}); // export class DidRenderLayoutOpcode extends Opcode { +// public type = "did-render-layout"; +// evaluate(vm: VM) { +// let manager = vm.frame.getManager(); +// let component = vm.frame.getComponent(); +// let bounds = vm.stack().popBlock(); +// manager.didRenderLayout(component, bounds); +// vm.env.didCreate(component, manager); +// vm.updateWith(new DidUpdateLayoutOpcode(manager, component, bounds)); +// } +// } +APPEND_OPCODES.add(27, /* DidRenderLayout */function(vm){var manager=vm.frame.getManager();var component=vm.frame.getComponent();var bounds=vm.stack().popBlock();manager.didRenderLayout(component,bounds);vm.env.didCreate(component,manager);vm.updateWith(new DidUpdateLayoutOpcode(manager,component,bounds));}); // export class CloseComponentOpcode extends Opcode { +// public type = "close-component"; +// evaluate(vm: VM) { +// vm.popScope(); +// vm.popDynamicScope(); +// vm.commitCacheGroup(); +// } +// } +APPEND_OPCODES.add(28, /* CloseComponent */function(vm){vm.popScope();vm.popDynamicScope();vm.commitCacheGroup();});var UpdateComponentOpcode=(function(_UpdatingOpcode4){babelHelpers.inherits(UpdateComponentOpcode,_UpdatingOpcode4);function UpdateComponentOpcode(name,component,manager,args,dynamicScope){_UpdatingOpcode4.call(this);this.name = name;this.component = component;this.manager = manager;this.args = args;this.dynamicScope = dynamicScope;this.type = "update-component";var componentTag=manager.getTag(component);if(componentTag){this.tag = _glimmerReference.combine([args.tag,componentTag]);}else {this.tag = args.tag;}}UpdateComponentOpcode.prototype.evaluate = function evaluate(_vm){var component=this.component;var manager=this.manager;var args=this.args;var dynamicScope=this.dynamicScope;manager.update(component,args,dynamicScope);};UpdateComponentOpcode.prototype.toJSON = function toJSON(){return {guid:this._guid,type:this.type,args:[JSON.stringify(this.name)]};};return UpdateComponentOpcode;})(UpdatingOpcode);var DidUpdateLayoutOpcode=(function(_UpdatingOpcode5){babelHelpers.inherits(DidUpdateLayoutOpcode,_UpdatingOpcode5);function DidUpdateLayoutOpcode(manager,component,bounds){_UpdatingOpcode5.call(this);this.manager = manager;this.component = component;this.bounds = bounds;this.type = "did-update-layout";this.tag = _glimmerReference.CONSTANT_TAG;}DidUpdateLayoutOpcode.prototype.evaluate = function evaluate(vm){var manager=this.manager;var component=this.component;var bounds=this.bounds;manager.didUpdateLayout(component,bounds);vm.env.didUpdate(component,manager);};return DidUpdateLayoutOpcode;})(UpdatingOpcode);var Cursor=function Cursor(element,nextSibling){this.element = element;this.nextSibling = nextSibling;};var ConcreteBounds=(function(){function ConcreteBounds(parentNode,first,last){this.parentNode = parentNode;this.first = first;this.last = last;}ConcreteBounds.prototype.parentElement = function parentElement(){return this.parentNode;};ConcreteBounds.prototype.firstNode = function firstNode(){return this.first;};ConcreteBounds.prototype.lastNode = function lastNode(){return this.last;};return ConcreteBounds;})();var SingleNodeBounds=(function(){function SingleNodeBounds(parentNode,node){this.parentNode = parentNode;this.node = node;}SingleNodeBounds.prototype.parentElement = function parentElement(){return this.parentNode;};SingleNodeBounds.prototype.firstNode = function firstNode(){return this.node;};SingleNodeBounds.prototype.lastNode = function lastNode(){return this.node;};return SingleNodeBounds;})();function single(parent,node){return new SingleNodeBounds(parent,node);}function moveBounds(bounds,reference){var parent=bounds.parentElement();var first=bounds.firstNode();var last=bounds.lastNode();var node=first;while(node) {var next=node.nextSibling;parent.insertBefore(node,reference);if(node === last)return next;node = next;}return null;}function clear(bounds){var parent=bounds.parentElement();var first=bounds.firstNode();var last=bounds.lastNode();var node=first;while(node) {var next=node.nextSibling;parent.removeChild(node);if(node === last)return next;node = next;}return null;}function isSafeString(value){return !!value && typeof value['toHTML'] === 'function';}function isNode(value){return value !== null && typeof value === 'object' && typeof value['nodeType'] === 'number';}function isString(value){return typeof value === 'string';}var Upsert=function Upsert(bounds){this.bounds = bounds;};function cautiousInsert(dom,cursor,value){if(isString(value)){return TextUpsert.insert(dom,cursor,value);}if(isSafeString(value)){return SafeStringUpsert.insert(dom,cursor,value);}if(isNode(value)){return NodeUpsert.insert(dom,cursor,value);}throw _glimmerUtil.unreachable();}function trustingInsert(dom,cursor,value){if(isString(value)){return HTMLUpsert.insert(dom,cursor,value);}if(isNode(value)){return NodeUpsert.insert(dom,cursor,value);}throw _glimmerUtil.unreachable();}var TextUpsert=(function(_Upsert){babelHelpers.inherits(TextUpsert,_Upsert);TextUpsert.insert = function insert(dom,cursor,value){var textNode=dom.createTextNode(value);dom.insertBefore(cursor.element,textNode,cursor.nextSibling);var bounds=new SingleNodeBounds(cursor.element,textNode);return new TextUpsert(bounds,textNode);};function TextUpsert(bounds,textNode){_Upsert.call(this,bounds);this.textNode = textNode;}TextUpsert.prototype.update = function update(_dom,value){if(isString(value)){var textNode=this.textNode;textNode.nodeValue = value;return true;}else {return false;}};return TextUpsert;})(Upsert);var HTMLUpsert=(function(_Upsert2){babelHelpers.inherits(HTMLUpsert,_Upsert2);function HTMLUpsert(){_Upsert2.apply(this,arguments);}HTMLUpsert.insert = function insert(dom,cursor,value){var bounds=dom.insertHTMLBefore(cursor.element,value,cursor.nextSibling);return new HTMLUpsert(bounds);};HTMLUpsert.prototype.update = function update(dom,value){if(isString(value)){var bounds=this.bounds;var parentElement=bounds.parentElement();var nextSibling=clear(bounds);this.bounds = dom.insertHTMLBefore(parentElement,nextSibling,value);return true;}else {return false;}};return HTMLUpsert;})(Upsert);var SafeStringUpsert=(function(_Upsert3){babelHelpers.inherits(SafeStringUpsert,_Upsert3);function SafeStringUpsert(bounds,lastStringValue){_Upsert3.call(this,bounds);this.lastStringValue = lastStringValue;}SafeStringUpsert.insert = function insert(dom,cursor,value){var stringValue=value.toHTML();var bounds=dom.insertHTMLBefore(cursor.element,stringValue,cursor.nextSibling);return new SafeStringUpsert(bounds,stringValue);};SafeStringUpsert.prototype.update = function update(dom,value){if(isSafeString(value)){var stringValue=value.toHTML();if(stringValue !== this.lastStringValue){var bounds=this.bounds;var parentElement=bounds.parentElement();var nextSibling=clear(bounds);this.bounds = dom.insertHTMLBefore(parentElement,nextSibling,stringValue);this.lastStringValue = stringValue;}return true;}else {return false;}};return SafeStringUpsert;})(Upsert);var NodeUpsert=(function(_Upsert4){babelHelpers.inherits(NodeUpsert,_Upsert4);function NodeUpsert(){_Upsert4.apply(this,arguments);}NodeUpsert.insert = function insert(dom,cursor,node){dom.insertBefore(cursor.element,node,cursor.nextSibling);return new NodeUpsert(single(cursor.element,node));};NodeUpsert.prototype.update = function update(dom,value){if(isNode(value)){var bounds=this.bounds;var parentElement=bounds.parentElement();var nextSibling=clear(bounds);this.bounds = dom.insertNodeBefore(parentElement,value,nextSibling);return true;}else {return false;}};return NodeUpsert;})(Upsert);var COMPONENT_DEFINITION_BRAND='COMPONENT DEFINITION [id=e59c754e-61eb-4392-8c4a-2c0ac72bfcd4]';function isComponentDefinition(obj){return typeof obj === 'object' && obj && obj[COMPONENT_DEFINITION_BRAND];}var ComponentDefinition=function ComponentDefinition(name,manager,ComponentClass){this[COMPONENT_DEFINITION_BRAND] = true;this.name = name;this.manager = manager;this.ComponentClass = ComponentClass;};var CompiledExpression=(function(){function CompiledExpression(){}CompiledExpression.prototype.toJSON = function toJSON(){return 'UNIMPL: ' + this.type.toUpperCase();};return CompiledExpression;})();APPEND_OPCODES.add(29, /* Text */function(vm,_ref18){var text=_ref18.op1;vm.stack().appendText(vm.constants.getString(text));});APPEND_OPCODES.add(30, /* Comment */function(vm,_ref19){var text=_ref19.op1;vm.stack().appendComment(vm.constants.getString(text));});APPEND_OPCODES.add(32, /* OpenElement */function(vm,_ref20){var tag=_ref20.op1;vm.stack().openElement(vm.constants.getString(tag));});APPEND_OPCODES.add(33, /* PushRemoteElement */function(vm){var reference=vm.frame.getOperand();var cache=_glimmerReference.isConst(reference)?undefined:new _glimmerReference.ReferenceCache(reference);var element=cache?cache.peek():reference.value();vm.stack().pushRemoteElement(element);if(cache){vm.updateWith(new Assert(cache));}});APPEND_OPCODES.add(34, /* PopRemoteElement */function(vm){return vm.stack().popRemoteElement();});APPEND_OPCODES.add(35, /* OpenComponentElement */function(vm,_ref21){var _tag=_ref21.op1;var tag=vm.constants.getString(_tag);vm.stack().openElement(tag,new ComponentElementOperations(vm.env));});APPEND_OPCODES.add(36, /* OpenDynamicElement */function(vm){var tagName=vm.frame.getOperand().value();vm.stack().openElement(tagName);});var ClassList=(function(){function ClassList(){this.list = null;this.isConst = true;}ClassList.prototype.append = function append(reference){var list=this.list;var isConst$$=this.isConst;if(list === null)list = this.list = [];list.push(reference);this.isConst = isConst$$ && _glimmerReference.isConst(reference);};ClassList.prototype.toReference = function toReference(){var list=this.list;var isConst$$=this.isConst;if(!list)return NULL_REFERENCE;if(isConst$$)return PrimitiveReference.create(toClassName(list));return new ClassListReference(list);};return ClassList;})();var ClassListReference=(function(_CachedReference){babelHelpers.inherits(ClassListReference,_CachedReference);function ClassListReference(list){_CachedReference.call(this);this.list = [];this.tag = _glimmerReference.combineTagged(list);this.list = list;}ClassListReference.prototype.compute = function compute(){return toClassName(this.list);};return ClassListReference;})(_glimmerReference.CachedReference);function toClassName(list){var ret=[];for(var i=0;i < list.length;i++) {var value=list[i].value();if(value !== false && value !== null && value !== undefined)ret.push(value);}return ret.length === 0?null:ret.join(' ');}var SimpleElementOperations=(function(){function SimpleElementOperations(env){this.env = env;this.opcodes = null;this.classList = null;}SimpleElementOperations.prototype.addStaticAttribute = function addStaticAttribute(element,name,value){if(name === 'class'){this.addClass(PrimitiveReference.create(value));}else {this.env.getAppendOperations().setAttribute(element,name,value);}};SimpleElementOperations.prototype.addStaticAttributeNS = function addStaticAttributeNS(element,namespace,name,value){this.env.getAppendOperations().setAttribute(element,name,value,namespace);};SimpleElementOperations.prototype.addDynamicAttribute = function addDynamicAttribute(element,name,reference,isTrusting){if(name === 'class'){this.addClass(reference);}else {var attributeManager=this.env.attributeFor(element,name,isTrusting);var attribute=new DynamicAttribute(element,attributeManager,name,reference);this.addAttribute(attribute);}};SimpleElementOperations.prototype.addDynamicAttributeNS = function addDynamicAttributeNS(element,namespace,name,reference,isTrusting){var attributeManager=this.env.attributeFor(element,name,isTrusting,namespace);var nsAttribute=new DynamicAttribute(element,attributeManager,name,reference,namespace);this.addAttribute(nsAttribute);};SimpleElementOperations.prototype.flush = function flush(element,vm){var env=vm.env;var opcodes=this.opcodes;var classList=this.classList;for(var i=0;opcodes && i < opcodes.length;i++) {vm.updateWith(opcodes[i]);}if(classList){var attributeManager=env.attributeFor(element,'class',false);var attribute=new DynamicAttribute(element,attributeManager,'class',classList.toReference());var opcode=attribute.flush(env);if(opcode){vm.updateWith(opcode);}}this.opcodes = null;this.classList = null;};SimpleElementOperations.prototype.addClass = function addClass(reference){var classList=this.classList;if(!classList){classList = this.classList = new ClassList();}classList.append(reference);};SimpleElementOperations.prototype.addAttribute = function addAttribute(attribute){var opcode=attribute.flush(this.env);if(opcode){var opcodes=this.opcodes;if(!opcodes){opcodes = this.opcodes = [];}opcodes.push(opcode);}};return SimpleElementOperations;})();var ComponentElementOperations=(function(){function ComponentElementOperations(env){this.env = env;this.attributeNames = null;this.attributes = null;this.classList = null;}ComponentElementOperations.prototype.addStaticAttribute = function addStaticAttribute(element,name,value){if(name === 'class'){this.addClass(PrimitiveReference.create(value));}else if(this.shouldAddAttribute(name)){this.addAttribute(name,new StaticAttribute(element,name,value));}};ComponentElementOperations.prototype.addStaticAttributeNS = function addStaticAttributeNS(element,namespace,name,value){if(this.shouldAddAttribute(name)){this.addAttribute(name,new StaticAttribute(element,name,value,namespace));}};ComponentElementOperations.prototype.addDynamicAttribute = function addDynamicAttribute(element,name,reference,isTrusting){if(name === 'class'){this.addClass(reference);}else if(this.shouldAddAttribute(name)){var attributeManager=this.env.attributeFor(element,name,isTrusting);var attribute=new DynamicAttribute(element,attributeManager,name,reference);this.addAttribute(name,attribute);}};ComponentElementOperations.prototype.addDynamicAttributeNS = function addDynamicAttributeNS(element,namespace,name,reference,isTrusting){if(this.shouldAddAttribute(name)){var attributeManager=this.env.attributeFor(element,name,isTrusting,namespace);var nsAttribute=new DynamicAttribute(element,attributeManager,name,reference,namespace);this.addAttribute(name,nsAttribute);}};ComponentElementOperations.prototype.flush = function flush(element,vm){var env=this.env;var attributes=this.attributes;var classList=this.classList;for(var i=0;attributes && i < attributes.length;i++) {var opcode=attributes[i].flush(env);if(opcode){vm.updateWith(opcode);}}if(classList){var attributeManager=env.attributeFor(element,'class',false);var attribute=new DynamicAttribute(element,attributeManager,'class',classList.toReference());var opcode=attribute.flush(env);if(opcode){vm.updateWith(opcode);}}};ComponentElementOperations.prototype.shouldAddAttribute = function shouldAddAttribute(name){return !this.attributeNames || this.attributeNames.indexOf(name) === -1;};ComponentElementOperations.prototype.addClass = function addClass(reference){var classList=this.classList;if(!classList){classList = this.classList = new ClassList();}classList.append(reference);};ComponentElementOperations.prototype.addAttribute = function addAttribute(name,attribute){var attributeNames=this.attributeNames;var attributes=this.attributes;if(!attributeNames){attributeNames = this.attributeNames = [];attributes = this.attributes = [];}attributeNames.push(name);_glimmerUtil.unwrap(attributes).push(attribute);};return ComponentElementOperations;})();APPEND_OPCODES.add(37, /* FlushElement */function(vm){var stack=vm.stack();var action='FlushElementOpcode#evaluate';stack.expectOperations(action).flush(stack.expectConstructing(action),vm);stack.flushElement();});APPEND_OPCODES.add(38, /* CloseElement */function(vm){return vm.stack().closeElement();});APPEND_OPCODES.add(39, /* PopElement */function(vm){return vm.stack().popElement();});APPEND_OPCODES.add(40, /* StaticAttr */function(vm,_ref22){var _name=_ref22.op1;var _value=_ref22.op2;var _namespace=_ref22.op3;var name=vm.constants.getString(_name);var value=vm.constants.getString(_value);if(_namespace){var namespace=vm.constants.getString(_namespace);vm.stack().setStaticAttributeNS(namespace,name,value);}else {vm.stack().setStaticAttribute(name,value);}});APPEND_OPCODES.add(41, /* Modifier */function(vm,_ref23){var _name=_ref23.op1;var _manager=_ref23.op2;var _args=_ref23.op3;var manager=vm.constants.getOther(_manager);var rawArgs=vm.constants.getExpression(_args);var stack=vm.stack();var element=stack.constructing;var updateOperations=stack.updateOperations;var args=rawArgs.evaluate(vm);var dynamicScope=vm.dynamicScope();var modifier=manager.create(element,args,dynamicScope,updateOperations);vm.env.scheduleInstallModifier(modifier,manager);var destructor=manager.getDestructor(modifier);if(destructor){vm.newDestroyable(destructor);}vm.updateWith(new UpdateModifierOpcode(manager,modifier,args));});var UpdateModifierOpcode=(function(_UpdatingOpcode6){babelHelpers.inherits(UpdateModifierOpcode,_UpdatingOpcode6);function UpdateModifierOpcode(manager,modifier,args){_UpdatingOpcode6.call(this);this.manager = manager;this.modifier = modifier;this.args = args;this.type = "update-modifier";this.tag = args.tag;this.lastUpdated = args.tag.value();}UpdateModifierOpcode.prototype.evaluate = function evaluate(vm){var manager=this.manager;var modifier=this.modifier;var tag=this.tag;var lastUpdated=this.lastUpdated;if(!tag.validate(lastUpdated)){vm.env.scheduleUpdateModifier(modifier,manager);this.lastUpdated = tag.value();}};UpdateModifierOpcode.prototype.toJSON = function toJSON(){return {guid:this._guid,type:this.type,args:[JSON.stringify(this.args)]};};return UpdateModifierOpcode;})(UpdatingOpcode);var StaticAttribute=(function(){function StaticAttribute(element,name,value,namespace){this.element = element;this.name = name;this.value = value;this.namespace = namespace;}StaticAttribute.prototype.flush = function flush(env){env.getAppendOperations().setAttribute(this.element,this.name,this.value,this.namespace);return null;};return StaticAttribute;})();var DynamicAttribute=(function(){function DynamicAttribute(element,attributeManager,name,reference,namespace){this.element = element;this.attributeManager = attributeManager;this.name = name;this.reference = reference;this.namespace = namespace;this.cache = null;this.tag = reference.tag;}DynamicAttribute.prototype.patch = function patch(env){var element=this.element;var cache=this.cache;var value=_glimmerUtil.expect(cache,'must patch after flush').revalidate();if(_glimmerReference.isModified(value)){this.attributeManager.updateAttribute(env,element,value,this.namespace);}};DynamicAttribute.prototype.flush = function flush(env){var reference=this.reference;var element=this.element;if(_glimmerReference.isConst(reference)){var value=reference.value();this.attributeManager.setAttribute(env,element,value,this.namespace);return null;}else {var cache=this.cache = new _glimmerReference.ReferenceCache(reference);var value=cache.peek();this.attributeManager.setAttribute(env,element,value,this.namespace);return new PatchElementOpcode(this);}};DynamicAttribute.prototype.toJSON = function toJSON(){var element=this.element;var namespace=this.namespace;var name=this.name;var cache=this.cache;var formattedElement=formatElement(element);var lastValue=_glimmerUtil.expect(cache,'must serialize after flush').peek();if(namespace){return {element:formattedElement,type:'attribute',namespace:namespace,name:name,lastValue:lastValue};}return {element:formattedElement,type:'attribute',namespace:namespace === undefined?null:namespace,name:name,lastValue:lastValue};};return DynamicAttribute;})();function formatElement(element){return JSON.stringify('<' + element.tagName.toLowerCase() + ' />');}APPEND_OPCODES.add(42, /* DynamicAttrNS */function(vm,_ref24){var _name=_ref24.op1;var _namespace=_ref24.op2;var trusting=_ref24.op3;var name=vm.constants.getString(_name);var namespace=vm.constants.getString(_namespace);var reference=vm.frame.getOperand();vm.stack().setDynamicAttributeNS(namespace,name,reference,!!trusting);});APPEND_OPCODES.add(43, /* DynamicAttr */function(vm,_ref25){var _name=_ref25.op1;var trusting=_ref25.op2;var name=vm.constants.getString(_name);var reference=vm.frame.getOperand();vm.stack().setDynamicAttribute(name,reference,!!trusting);});var PatchElementOpcode=(function(_UpdatingOpcode7){babelHelpers.inherits(PatchElementOpcode,_UpdatingOpcode7);function PatchElementOpcode(operation){_UpdatingOpcode7.call(this);this.type = "patch-element";this.tag = operation.tag;this.operation = operation;}PatchElementOpcode.prototype.evaluate = function evaluate(vm){this.operation.patch(vm.env);};PatchElementOpcode.prototype.toJSON = function toJSON(){var _guid=this._guid;var type=this.type;var operation=this.operation;return {guid:_guid,type:type,details:operation.toJSON()};};return PatchElementOpcode;})(UpdatingOpcode);var First=(function(){function First(node){this.node = node;}First.prototype.firstNode = function firstNode(){return this.node;};return First;})();var Last=(function(){function Last(node){this.node = node;}Last.prototype.lastNode = function lastNode(){return this.node;};return Last;})();var Fragment=(function(){function Fragment(bounds){this.bounds = bounds;}Fragment.prototype.parentElement = function parentElement(){return this.bounds.parentElement();};Fragment.prototype.firstNode = function firstNode(){return this.bounds.firstNode();};Fragment.prototype.lastNode = function lastNode(){return this.bounds.lastNode();};Fragment.prototype.update = function update(bounds){this.bounds = bounds;};return Fragment;})();var ElementStack=(function(){function ElementStack(env,parentNode,nextSibling){this.constructing = null;this.operations = null;this.elementStack = new _glimmerUtil.Stack();this.nextSiblingStack = new _glimmerUtil.Stack();this.blockStack = new _glimmerUtil.Stack();this.env = env;this.dom = env.getAppendOperations();this.updateOperations = env.getDOM();this.element = parentNode;this.nextSibling = nextSibling;this.defaultOperations = new SimpleElementOperations(env);this.elementStack.push(this.element);this.nextSiblingStack.push(this.nextSibling);}ElementStack.forInitialRender = function forInitialRender(env,parentNode,nextSibling){return new ElementStack(env,parentNode,nextSibling);};ElementStack.resume = function resume(env,tracker,nextSibling){var parentNode=tracker.parentElement();var stack=new ElementStack(env,parentNode,nextSibling);stack.pushBlockTracker(tracker);return stack;};ElementStack.prototype.expectConstructing = function expectConstructing(method){return _glimmerUtil.expect(this.constructing,method + ' should only be called while constructing an element');};ElementStack.prototype.expectOperations = function expectOperations(method){return _glimmerUtil.expect(this.operations,method + ' should only be called while constructing an element');};ElementStack.prototype.block = function block(){return _glimmerUtil.expect(this.blockStack.current,"Expected a current block tracker");};ElementStack.prototype.popElement = function popElement(){var elementStack=this.elementStack;var nextSiblingStack=this.nextSiblingStack;var topElement=elementStack.pop();nextSiblingStack.pop();_glimmerUtil.LOGGER.debug('-> element stack ' + this.elementStack.toArray().map(function(e){return e.tagName;}).join(', '));this.element = _glimmerUtil.expect(elementStack.current,"can't pop past the last element");this.nextSibling = nextSiblingStack.current;return topElement;};ElementStack.prototype.pushSimpleBlock = function pushSimpleBlock(){var tracker=new SimpleBlockTracker(this.element);this.pushBlockTracker(tracker);return tracker;};ElementStack.prototype.pushUpdatableBlock = function pushUpdatableBlock(){var tracker=new UpdatableBlockTracker(this.element);this.pushBlockTracker(tracker);return tracker;};ElementStack.prototype.pushBlockTracker = function pushBlockTracker(tracker){var isRemote=arguments.length <= 1 || arguments[1] === undefined?false:arguments[1];var current=this.blockStack.current;if(current !== null){current.newDestroyable(tracker);if(!isRemote){current.newBounds(tracker);}}this.blockStack.push(tracker);return tracker;};ElementStack.prototype.pushBlockList = function pushBlockList(list){var tracker=new BlockListTracker(this.element,list);var current=this.blockStack.current;if(current !== null){current.newDestroyable(tracker);current.newBounds(tracker);}this.blockStack.push(tracker);return tracker;};ElementStack.prototype.popBlock = function popBlock(){this.block().finalize(this);return _glimmerUtil.expect(this.blockStack.pop(),"Expected popBlock to return a block");};ElementStack.prototype.openElement = function openElement(tag){var operations=arguments.length <= 1 || arguments[1] === undefined?this.defaultOperations:arguments[1];var element=this.dom.createElement(tag,this.element);this.constructing = element;this.operations = operations;return element;};ElementStack.prototype.flushElement = function flushElement(){var parent=this.element;var element=_glimmerUtil.expect(this.constructing,'flushElement should only be called when constructing an element');this.dom.insertBefore(parent,element,this.nextSibling);this.constructing = null;this.operations = null;this.pushElement(element);this.block().openElement(element);};ElementStack.prototype.pushRemoteElement = function pushRemoteElement(element){this.pushElement(element);var tracker=new RemoteBlockTracker(element);this.pushBlockTracker(tracker,true);};ElementStack.prototype.popRemoteElement = function popRemoteElement(){this.popBlock();this.popElement();};ElementStack.prototype.pushElement = function pushElement(element){this.element = element;this.elementStack.push(element);_glimmerUtil.LOGGER.debug('-> element stack ' + this.elementStack.toArray().map(function(e){return e.tagName;}).join(', '));this.nextSibling = null;this.nextSiblingStack.push(null);};ElementStack.prototype.newDestroyable = function newDestroyable(d){this.block().newDestroyable(d);};ElementStack.prototype.newBounds = function newBounds(bounds){this.block().newBounds(bounds);};ElementStack.prototype.appendText = function appendText(string){var dom=this.dom;var text=dom.createTextNode(string);dom.insertBefore(this.element,text,this.nextSibling);this.block().newNode(text);return text;};ElementStack.prototype.appendComment = function appendComment(string){var dom=this.dom;var comment=dom.createComment(string);dom.insertBefore(this.element,comment,this.nextSibling);this.block().newNode(comment);return comment;};ElementStack.prototype.setStaticAttribute = function setStaticAttribute(name,value){this.expectOperations('setStaticAttribute').addStaticAttribute(this.expectConstructing('setStaticAttribute'),name,value);};ElementStack.prototype.setStaticAttributeNS = function setStaticAttributeNS(namespace,name,value){this.expectOperations('setStaticAttributeNS').addStaticAttributeNS(this.expectConstructing('setStaticAttributeNS'),namespace,name,value);};ElementStack.prototype.setDynamicAttribute = function setDynamicAttribute(name,reference,isTrusting){this.expectOperations('setDynamicAttribute').addDynamicAttribute(this.expectConstructing('setDynamicAttribute'),name,reference,isTrusting);};ElementStack.prototype.setDynamicAttributeNS = function setDynamicAttributeNS(namespace,name,reference,isTrusting){this.expectOperations('setDynamicAttributeNS').addDynamicAttributeNS(this.expectConstructing('setDynamicAttributeNS'),namespace,name,reference,isTrusting);};ElementStack.prototype.closeElement = function closeElement(){this.block().closeElement();this.popElement();};return ElementStack;})();var SimpleBlockTracker=(function(){function SimpleBlockTracker(parent){this.parent = parent;this.first = null;this.last = null;this.destroyables = null;this.nesting = 0;}SimpleBlockTracker.prototype.destroy = function destroy(){var destroyables=this.destroyables;if(destroyables && destroyables.length){for(var i=0;i < destroyables.length;i++) {destroyables[i].destroy();}}};SimpleBlockTracker.prototype.parentElement = function parentElement(){return this.parent;};SimpleBlockTracker.prototype.firstNode = function firstNode(){return this.first && this.first.firstNode();};SimpleBlockTracker.prototype.lastNode = function lastNode(){return this.last && this.last.lastNode();};SimpleBlockTracker.prototype.openElement = function openElement(element){this.newNode(element);this.nesting++;};SimpleBlockTracker.prototype.closeElement = function closeElement(){this.nesting--;};SimpleBlockTracker.prototype.newNode = function newNode(node){if(this.nesting !== 0)return;if(!this.first){this.first = new First(node);}this.last = new Last(node);};SimpleBlockTracker.prototype.newBounds = function newBounds(bounds){if(this.nesting !== 0)return;if(!this.first){this.first = bounds;}this.last = bounds;};SimpleBlockTracker.prototype.newDestroyable = function newDestroyable(d){this.destroyables = this.destroyables || [];this.destroyables.push(d);};SimpleBlockTracker.prototype.finalize = function finalize(stack){if(!this.first){stack.appendComment('');}};return SimpleBlockTracker;})();var RemoteBlockTracker=(function(_SimpleBlockTracker){babelHelpers.inherits(RemoteBlockTracker,_SimpleBlockTracker);function RemoteBlockTracker(){_SimpleBlockTracker.apply(this,arguments);}RemoteBlockTracker.prototype.destroy = function destroy(){_SimpleBlockTracker.prototype.destroy.call(this);clear(this);};return RemoteBlockTracker;})(SimpleBlockTracker);var UpdatableBlockTracker=(function(_SimpleBlockTracker2){babelHelpers.inherits(UpdatableBlockTracker,_SimpleBlockTracker2);function UpdatableBlockTracker(){_SimpleBlockTracker2.apply(this,arguments);}UpdatableBlockTracker.prototype.reset = function reset(env){var destroyables=this.destroyables;if(destroyables && destroyables.length){for(var i=0;i < destroyables.length;i++) {env.didDestroy(destroyables[i]);}}var nextSibling=clear(this);this.destroyables = null;this.first = null;this.last = null;return nextSibling;};return UpdatableBlockTracker;})(SimpleBlockTracker);var BlockListTracker=(function(){function BlockListTracker(parent,boundList){this.parent = parent;this.boundList = boundList;this.parent = parent;this.boundList = boundList;}BlockListTracker.prototype.destroy = function destroy(){this.boundList.forEachNode(function(node){return node.destroy();});};BlockListTracker.prototype.parentElement = function parentElement(){return this.parent;};BlockListTracker.prototype.firstNode = function firstNode(){var head=this.boundList.head();return head && head.firstNode();};BlockListTracker.prototype.lastNode = function lastNode(){var tail=this.boundList.tail();return tail && tail.lastNode();};BlockListTracker.prototype.openElement = function openElement(_element){_glimmerUtil.assert(false,'Cannot openElement directly inside a block list');};BlockListTracker.prototype.closeElement = function closeElement(){_glimmerUtil.assert(false,'Cannot closeElement directly inside a block list');};BlockListTracker.prototype.newNode = function newNode(_node){_glimmerUtil.assert(false,'Cannot create a new node directly inside a block list');};BlockListTracker.prototype.newBounds = function newBounds(_bounds){};BlockListTracker.prototype.newDestroyable = function newDestroyable(_d){};BlockListTracker.prototype.finalize = function finalize(_stack){};return BlockListTracker;})();var CompiledValue=(function(_CompiledExpression){babelHelpers.inherits(CompiledValue,_CompiledExpression);function CompiledValue(value){_CompiledExpression.call(this);this.type = "value";this.reference = PrimitiveReference.create(value);}CompiledValue.prototype.evaluate = function evaluate(_vm){return this.reference;};CompiledValue.prototype.toJSON = function toJSON(){return JSON.stringify(this.reference.value());};return CompiledValue;})(CompiledExpression);var CompiledHasBlock=(function(_CompiledExpression2){babelHelpers.inherits(CompiledHasBlock,_CompiledExpression2);function CompiledHasBlock(inner){_CompiledExpression2.call(this);this.inner = inner;this.type = "has-block";}CompiledHasBlock.prototype.evaluate = function evaluate(vm){var block=this.inner.evaluate(vm);return PrimitiveReference.create(!!block);};CompiledHasBlock.prototype.toJSON = function toJSON(){return 'has-block(' + this.inner.toJSON() + ')';};return CompiledHasBlock;})(CompiledExpression);var CompiledHasBlockParams=(function(_CompiledExpression3){babelHelpers.inherits(CompiledHasBlockParams,_CompiledExpression3);function CompiledHasBlockParams(inner){_CompiledExpression3.call(this);this.inner = inner;this.type = "has-block-params";}CompiledHasBlockParams.prototype.evaluate = function evaluate(vm){var block=this.inner.evaluate(vm);var hasLocals=block && block.symbolTable.getSymbols().locals;return PrimitiveReference.create(!!hasLocals);};CompiledHasBlockParams.prototype.toJSON = function toJSON(){return 'has-block-params(' + this.inner.toJSON() + ')';};return CompiledHasBlockParams;})(CompiledExpression);var CompiledGetBlockBySymbol=(function(){function CompiledGetBlockBySymbol(symbol,debug){this.symbol = symbol;this.debug = debug;}CompiledGetBlockBySymbol.prototype.evaluate = function evaluate(vm){return vm.scope().getBlock(this.symbol);};CompiledGetBlockBySymbol.prototype.toJSON = function toJSON(){return 'get-block($' + this.symbol + '(' + this.debug + '))';};return CompiledGetBlockBySymbol;})();var CompiledInPartialGetBlock=(function(){function CompiledInPartialGetBlock(symbol,name){this.symbol = symbol;this.name = name;}CompiledInPartialGetBlock.prototype.evaluate = function evaluate(vm){var symbol=this.symbol;var name=this.name;var args=vm.scope().getPartialArgs(symbol);return args.blocks[name];};CompiledInPartialGetBlock.prototype.toJSON = function toJSON(){return 'get-block($' + this.symbol + '($ARGS).' + this.name + '))';};return CompiledInPartialGetBlock;})();var CompiledLookup=(function(_CompiledExpression4){babelHelpers.inherits(CompiledLookup,_CompiledExpression4);function CompiledLookup(base,path){_CompiledExpression4.call(this);this.base = base;this.path = path;this.type = "lookup";}CompiledLookup.create = function create(base,path){if(path.length === 0){return base;}else {return new this(base,path);}};CompiledLookup.prototype.evaluate = function evaluate(vm){var base=this.base;var path=this.path;return _glimmerReference.referenceFromParts(base.evaluate(vm),path);};CompiledLookup.prototype.toJSON = function toJSON(){return this.base.toJSON() + '.' + this.path.join('.');};return CompiledLookup;})(CompiledExpression);var CompiledSelf=(function(_CompiledExpression5){babelHelpers.inherits(CompiledSelf,_CompiledExpression5);function CompiledSelf(){_CompiledExpression5.apply(this,arguments);}CompiledSelf.prototype.evaluate = function evaluate(vm){return vm.getSelf();};CompiledSelf.prototype.toJSON = function toJSON(){return 'self';};return CompiledSelf;})(CompiledExpression);var CompiledSymbol=(function(_CompiledExpression6){babelHelpers.inherits(CompiledSymbol,_CompiledExpression6);function CompiledSymbol(symbol,debug){_CompiledExpression6.call(this);this.symbol = symbol;this.debug = debug;}CompiledSymbol.prototype.evaluate = function evaluate(vm){return vm.referenceForSymbol(this.symbol);};CompiledSymbol.prototype.toJSON = function toJSON(){return '$' + this.symbol + '(' + this.debug + ')';};return CompiledSymbol;})(CompiledExpression);var CompiledInPartialName=(function(_CompiledExpression7){babelHelpers.inherits(CompiledInPartialName,_CompiledExpression7);function CompiledInPartialName(symbol,name){_CompiledExpression7.call(this);this.symbol = symbol;this.name = name;}CompiledInPartialName.prototype.evaluate = function evaluate(vm){var symbol=this.symbol;var name=this.name;var args=vm.scope().getPartialArgs(symbol);return args.named.get(name);};CompiledInPartialName.prototype.toJSON = function toJSON(){return '$' + this.symbol + '($ARGS).' + this.name;};return CompiledInPartialName;})(CompiledExpression);var CompiledHelper=(function(_CompiledExpression8){babelHelpers.inherits(CompiledHelper,_CompiledExpression8);function CompiledHelper(name,helper,args,symbolTable){_CompiledExpression8.call(this);this.name = name;this.helper = helper;this.args = args;this.symbolTable = symbolTable;this.type = "helper";}CompiledHelper.prototype.evaluate = function evaluate(vm){var helper=this.helper;return helper(vm,this.args.evaluate(vm),this.symbolTable);};CompiledHelper.prototype.toJSON = function toJSON(){return '`' + this.name.join('.') + '($ARGS)`';};return CompiledHelper;})(CompiledExpression);var CompiledConcat=(function(){function CompiledConcat(parts){this.parts = parts;this.type = "concat";}CompiledConcat.prototype.evaluate = function evaluate(vm){var parts=new Array(this.parts.length);for(var i=0;i < this.parts.length;i++) {parts[i] = this.parts[i].evaluate(vm);}return new ConcatReference(parts);};CompiledConcat.prototype.toJSON = function toJSON(){return 'concat(' + this.parts.map(function(expr){return expr.toJSON();}).join(", ") + ')';};return CompiledConcat;})();var ConcatReference=(function(_CachedReference2){babelHelpers.inherits(ConcatReference,_CachedReference2);function ConcatReference(parts){_CachedReference2.call(this);this.parts = parts;this.tag = _glimmerReference.combineTagged(parts);}ConcatReference.prototype.compute = function compute(){var parts=new Array();for(var i=0;i < this.parts.length;i++) {var value=this.parts[i].value();if(value !== null && value !== undefined){parts[i] = castToString(value);}}if(parts.length > 0){return parts.join('');}return null;};return ConcatReference;})(_glimmerReference.CachedReference);function castToString(value){if(typeof value['toString'] !== 'function'){return '';}return String(value);}var CompiledFunctionExpression=(function(_CompiledExpression9){babelHelpers.inherits(CompiledFunctionExpression,_CompiledExpression9);function CompiledFunctionExpression(func,symbolTable){_CompiledExpression9.call(this);this.func = func;this.symbolTable = symbolTable;this.type = "function";this.func = func;}CompiledFunctionExpression.prototype.evaluate = function evaluate(vm){var func=this.func;var symbolTable=this.symbolTable;return func(vm,symbolTable);};CompiledFunctionExpression.prototype.toJSON = function toJSON(){var func=this.func;if(func.name){return '`' + func.name + '(...)`';}else {return "`func(...)`";}};return CompiledFunctionExpression;})(CompiledExpression);function debugCallback(context,get){console.info('Use `context`, and `get()` to debug this template.'); /* tslint:disable */debugger; /* tslint:enable */return {context:context,get:get};}function getter(vm,builder){return function(path){var parts=path.split('.');if(parts[0] === 'this'){parts[0] = null;}return compileRef(parts,builder).evaluate(vm);};}var callback=debugCallback; // For testing purposes +function setDebuggerCallback(cb){callback = cb;}function resetDebuggerCallback(){callback = debugCallback;}var Compilers=(function(){function Compilers(){this.names = _glimmerUtil.dict();this.funcs = [];}Compilers.prototype.add = function add(name,func){this.funcs.push(func);this.names[name] = this.funcs.length - 1;};Compilers.prototype.compile = function compile(sexp,builder){var name=sexp[0];var index=this.names[name];var func=this.funcs[index];_glimmerUtil.assert(!!func,'expected an implementation for ' + sexp[0]);return func(sexp,builder);};return Compilers;})();var STATEMENTS=new Compilers();STATEMENTS.add('text',function(sexp,builder){builder.text(sexp[1]);});STATEMENTS.add('comment',function(sexp,builder){builder.comment(sexp[1]);});STATEMENTS.add('close-element',function(_sexp,builder){_glimmerUtil.LOGGER.trace('close-element statement');builder.closeElement();});STATEMENTS.add('flush-element',function(_sexp,builder){builder.flushElement();});STATEMENTS.add('modifier',function(sexp,builder){var path=sexp[1];var params=sexp[2];var hash=sexp[3];var args=compileArgs(params,hash,builder);if(builder.env.hasModifier(path,builder.symbolTable)){builder.modifier(path[0],args);}else {throw new Error('Compile Error ' + path.join('.') + ' is not a modifier: Helpers may not be used in the element form.');}});STATEMENTS.add('static-attr',function(sexp,builder){var name=sexp[1];var value=sexp[2];var namespace=sexp[3];builder.staticAttr(name,namespace,value);});STATEMENTS.add('any-dynamic-attr',function(sexp,builder){var name=sexp[1];var value=sexp[2];var namespace=sexp[3];var trusting=sexp[4];builder.putValue(value);if(namespace){builder.dynamicAttrNS(name,namespace,trusting);}else {builder.dynamicAttr(name,trusting);}});STATEMENTS.add('open-element',function(sexp,builder){_glimmerUtil.LOGGER.trace('open-element statement');builder.openPrimitiveElement(sexp[1]);});STATEMENTS.add('optimized-append',function(sexp,builder){var value=sexp[1];var trustingMorph=sexp[2];var _builder$env$macros=builder.env.macros();var inlines=_builder$env$macros.inlines;var returned=inlines.compile(sexp,builder) || value;if(returned === true)return;builder.putValue(returned[1]);if(trustingMorph){builder.trustingAppend();}else {builder.cautiousAppend();}});STATEMENTS.add('unoptimized-append',function(sexp,builder){var value=sexp[1];var trustingMorph=sexp[2];var _builder$env$macros2=builder.env.macros();var inlines=_builder$env$macros2.inlines;var returned=inlines.compile(sexp,builder) || value;if(returned === true)return;if(trustingMorph){builder.guardedTrustingAppend(returned[1]);}else {builder.guardedCautiousAppend(returned[1]);}});STATEMENTS.add('nested-block',function(sexp,builder){var _builder$env$macros3=builder.env.macros();var blocks=_builder$env$macros3.blocks;blocks.compile(sexp,builder);});STATEMENTS.add('scanned-block',function(sexp,builder){var path=sexp[1];var params=sexp[2];var hash=sexp[3];var template=sexp[4];var inverse=sexp[5];var templateBlock=template && template.scan();var inverseBlock=inverse && inverse.scan();var _builder$env$macros4=builder.env.macros();var blocks=_builder$env$macros4.blocks;blocks.compile(['nested-block',path,params,hash,templateBlock,inverseBlock],builder);});STATEMENTS.add('scanned-component',function(sexp,builder){var tag=sexp[1];var attrs=sexp[2];var rawArgs=sexp[3];var rawBlock=sexp[4];var block=rawBlock && rawBlock.scan();var args=compileBlockArgs(null,rawArgs,{default:block,inverse:null},builder);var definition=builder.env.getComponentDefinition([tag],builder.symbolTable);builder.putComponentDefinition(definition);builder.openComponent(args,attrs.scan());builder.closeComponent();});STATEMENTS.add('static-partial',function(sexp,builder){var name=sexp[1];if(!builder.env.hasPartial(name,builder.symbolTable)){throw new Error('Compile Error: Could not find a partial named "' + name + '"');}var definition=builder.env.lookupPartial(name,builder.symbolTable);builder.putPartialDefinition(definition);builder.evaluatePartial();});STATEMENTS.add('dynamic-partial',function(sexp,builder){var name=sexp[1];builder.startLabels();builder.putValue(name);builder.test('simple');builder.enter('BEGIN','END');builder.label('BEGIN');builder.jumpUnless('END');builder.putDynamicPartialDefinition();builder.evaluatePartial();builder.label('END');builder.exit();builder.stopLabels();});STATEMENTS.add('yield',function(sexp,builder){var to=sexp[1];var params=sexp[2];var args=compileArgs(params,null,builder);builder.yield(args,to);});STATEMENTS.add('debugger',function(sexp,builder){builder.putValue(['function',function(vm){var context=vm.getSelf().value();var get=function(path){return getter(vm,builder)(path).value();};callback(context,get);}]);return sexp;});var EXPRESSIONS=new Compilers();function expr(expression,builder){if(Array.isArray(expression)){return EXPRESSIONS.compile(expression,builder);}else {return new CompiledValue(expression);}}EXPRESSIONS.add('unknown',function(sexp,builder){var path=sexp[1];if(builder.env.hasHelper(path,builder.symbolTable)){return new CompiledHelper(path,builder.env.lookupHelper(path,builder.symbolTable),CompiledArgs.empty(),builder.symbolTable);}else {return compileRef(path,builder);}});EXPRESSIONS.add('concat',function(sexp,builder){var params=sexp[1].map(function(p){return expr(p,builder);});return new CompiledConcat(params);});EXPRESSIONS.add('function',function(sexp,builder){return new CompiledFunctionExpression(sexp[1],builder.symbolTable);});EXPRESSIONS.add('helper',function(sexp,builder){var env=builder.env;var symbolTable=builder.symbolTable;var path=sexp[1];var params=sexp[2];var hash=sexp[3];if(env.hasHelper(path,symbolTable)){var args=compileArgs(params,hash,builder);return new CompiledHelper(path,env.lookupHelper(path,symbolTable),args,symbolTable);}else {throw new Error('Compile Error: ' + path.join('.') + ' is not a helper');}});EXPRESSIONS.add('get',function(sexp,builder){return compileRef(sexp[1],builder);});EXPRESSIONS.add('undefined',function(_sexp,_builder){return new CompiledValue(undefined);});EXPRESSIONS.add('arg',function(sexp,builder){var parts=sexp[1];var head=parts[0];var named=undefined,partial=undefined;if(named = builder.symbolTable.getSymbol('named',head)){var path=parts.slice(1);var inner=new CompiledSymbol(named,head);return CompiledLookup.create(inner,path);}else if(partial = builder.symbolTable.getPartialArgs()){var path=parts.slice(1);var inner=new CompiledInPartialName(partial,head);return CompiledLookup.create(inner,path);}else {throw new Error('[BUG] @' + parts.join('.') + ' is not a valid lookup path.');}});EXPRESSIONS.add('has-block',function(sexp,builder){var blockName=sexp[1];var yields=undefined,partial=undefined;if(yields = builder.symbolTable.getSymbol('yields',blockName)){var inner=new CompiledGetBlockBySymbol(yields,blockName);return new CompiledHasBlock(inner);}else if(partial = builder.symbolTable.getPartialArgs()){var inner=new CompiledInPartialGetBlock(partial,blockName);return new CompiledHasBlock(inner);}else {throw new Error('[BUG] ${blockName} is not a valid block name.');}});EXPRESSIONS.add('has-block-params',function(sexp,builder){var blockName=sexp[1];var yields=undefined,partial=undefined;if(yields = builder.symbolTable.getSymbol('yields',blockName)){var inner=new CompiledGetBlockBySymbol(yields,blockName);return new CompiledHasBlockParams(inner);}else if(partial = builder.symbolTable.getPartialArgs()){var inner=new CompiledInPartialGetBlock(partial,blockName);return new CompiledHasBlockParams(inner);}else {throw new Error('[BUG] ${blockName} is not a valid block name.');}});function compileArgs(params,hash,builder){var compiledParams=compileParams(params,builder);var compiledHash=compileHash(hash,builder);return CompiledArgs.create(compiledParams,compiledHash,EMPTY_BLOCKS);}function compileBlockArgs(params,hash,blocks,builder){var compiledParams=compileParams(params,builder);var compiledHash=compileHash(hash,builder);return CompiledArgs.create(compiledParams,compiledHash,blocks);}function compileBaselineArgs(args,builder){var params=args[0];var hash=args[1];var _default=args[2];var inverse=args[3];return CompiledArgs.create(compileParams(params,builder),compileHash(hash,builder),{default:_default,inverse:inverse});}function compileParams(params,builder){if(!params || params.length === 0)return COMPILED_EMPTY_POSITIONAL_ARGS;var compiled=params.map(function(p){return expr(p,builder);});return CompiledPositionalArgs.create(compiled);}function compileHash(hash,builder){if(!hash)return COMPILED_EMPTY_NAMED_ARGS;var keys=hash[0];var values=hash[1];if(keys.length === 0)return COMPILED_EMPTY_NAMED_ARGS;var compiled=values.map(function(p){return expr(p,builder);});return new CompiledNamedArgs(keys,compiled);}function compileRef(parts,builder){var head=parts[0];var local=undefined;if(head === null){var inner=new CompiledSelf();var path=parts.slice(1);return CompiledLookup.create(inner,path);}else if(local = builder.symbolTable.getSymbol('local',head)){var path=parts.slice(1);var inner=new CompiledSymbol(local,head);return CompiledLookup.create(inner,path);}else {var inner=new CompiledSelf();return CompiledLookup.create(inner,parts);}}var Blocks=(function(){function Blocks(){this.names = _glimmerUtil.dict();this.funcs = [];}Blocks.prototype.add = function add(name,func){this.funcs.push(func);this.names[name] = this.funcs.length - 1;};Blocks.prototype.addMissing = function addMissing(func){this.missing = func;};Blocks.prototype.compile = function compile(sexp,builder){ // assert(sexp[1].length === 1, 'paths in blocks are not supported'); +var name=sexp[1][0];var index=this.names[name];if(index === undefined){_glimmerUtil.assert(!!this.missing,name + ' not found, and no catch-all block handler was registered');var func=this.missing;var handled=func(sexp,builder);_glimmerUtil.assert(!!handled,name + ' not found, and the catch-all block handler didn\'t handle it');}else {var func=this.funcs[index];func(sexp,builder);}};return Blocks;})();var BLOCKS=new Blocks();var Inlines=(function(){function Inlines(){this.names = _glimmerUtil.dict();this.funcs = [];}Inlines.prototype.add = function add(name,func){this.funcs.push(func);this.names[name] = this.funcs.length - 1;};Inlines.prototype.addMissing = function addMissing(func){this.missing = func;};Inlines.prototype.compile = function compile(sexp,builder){var value=sexp[1]; // TODO: Fix this so that expression macros can return +// things like components, so that {{component foo}} +// is the same as {{(component foo)}} +if(!Array.isArray(value))return ['expr',value];var path=undefined;var params=undefined;var hash=undefined;if(value[0] === 'helper'){path = value[1];params = value[2];hash = value[3];}else if(value[0] === 'unknown'){path = value[1];params = hash = null;}else {return ['expr',value];}if(path.length > 1 && !params && !hash){return ['expr',value];}var name=path[0];var index=this.names[name];if(index === undefined && this.missing){var func=this.missing;var returned=func(path,params,hash,builder);return returned === false?['expr',value]:returned;}else if(index !== undefined){var func=this.funcs[index];var returned=func(path,params,hash,builder);return returned === false?['expr',value]:returned;}else {return ['expr',value];}};return Inlines;})();var INLINES=new Inlines();populateBuiltins(BLOCKS,INLINES);function populateBuiltins(){var blocks=arguments.length <= 0 || arguments[0] === undefined?new Blocks():arguments[0];var inlines=arguments.length <= 1 || arguments[1] === undefined?new Inlines():arguments[1];blocks.add('if',function(sexp,builder){ // PutArgs +// Test(Environment) +// Enter(BEGIN, END) +// BEGIN: Noop +// JumpUnless(ELSE) +// Evaluate(default) +// Jump(END) +// ELSE: Noop +// Evalulate(inverse) +// END: Noop +// Exit +var params=sexp[2];var hash=sexp[3];var _default=sexp[4];var inverse=sexp[5];var args=compileArgs(params,hash,builder);builder.putArgs(args);builder.test('environment');builder.labelled(null,function(b){if(_default && inverse){b.jumpUnless('ELSE');b.evaluate(_default);b.jump('END');b.label('ELSE');b.evaluate(inverse);}else if(_default){b.jumpUnless('END');b.evaluate(_default);}else {throw _glimmerUtil.unreachable();}});});blocks.add('unless',function(sexp,builder){ // PutArgs +// Test(Environment) +// Enter(BEGIN, END) +// BEGIN: Noop +// JumpUnless(ELSE) +// Evaluate(default) +// Jump(END) +// ELSE: Noop +// Evalulate(inverse) +// END: Noop +// Exit +var params=sexp[2];var hash=sexp[3];var _default=sexp[4];var inverse=sexp[5];var args=compileArgs(params,hash,builder);builder.putArgs(args);builder.test('environment');builder.labelled(null,function(b){if(_default && inverse){b.jumpIf('ELSE');b.evaluate(_default);b.jump('END');b.label('ELSE');b.evaluate(inverse);}else if(_default){b.jumpIf('END');b.evaluate(_default);}else {throw _glimmerUtil.unreachable();}});});blocks.add('with',function(sexp,builder){ // PutArgs +// Test(Environment) +// Enter(BEGIN, END) +// BEGIN: Noop +// JumpUnless(ELSE) +// Evaluate(default) +// Jump(END) +// ELSE: Noop +// Evalulate(inverse) +// END: Noop +// Exit +var params=sexp[2];var hash=sexp[3];var _default=sexp[4];var inverse=sexp[5];var args=compileArgs(params,hash,builder);builder.putArgs(args);builder.test('environment');builder.labelled(null,function(b){if(_default && inverse){b.jumpUnless('ELSE');b.evaluate(_default);b.jump('END');b.label('ELSE');b.evaluate(inverse);}else if(_default){b.jumpUnless('END');b.evaluate(_default);}else {throw _glimmerUtil.unreachable();}});});blocks.add('each',function(sexp,builder){ // Enter(BEGIN, END) +// BEGIN: Noop +// PutArgs +// PutIterable +// JumpUnless(ELSE) +// EnterList(BEGIN2, END2) +// ITER: Noop +// NextIter(BREAK) +// EnterWithKey(BEGIN2, END2) +// BEGIN2: Noop +// PushChildScope +// Evaluate(default) +// PopScope +// END2: Noop +// Exit +// Jump(ITER) +// BREAK: Noop +// ExitList +// Jump(END) +// ELSE: Noop +// Evalulate(inverse) +// END: Noop +// Exit +var params=sexp[2];var hash=sexp[3];var _default=sexp[4];var inverse=sexp[5];var args=compileArgs(params,hash,builder);builder.labelled(args,function(b){b.putIterator();if(inverse){b.jumpUnless('ELSE');}else {b.jumpUnless('END');}b.iter(function(b){b.evaluate(_glimmerUtil.unwrap(_default));});if(inverse){b.jump('END');b.label('ELSE');b.evaluate(inverse);}});});return {blocks:blocks,inlines:inlines};}var badProtocols=['javascript:','vbscript:'];var badTags=['A','BODY','LINK','IMG','IFRAME','BASE','FORM'];var badTagsForDataURI=['EMBED'];var badAttributes=['href','src','background','action'];var badAttributesForDataURI=['src'];function has(array,item){return array.indexOf(item) !== -1;}function checkURI(tagName,attribute){return (tagName === null || has(badTags,tagName)) && has(badAttributes,attribute);}function checkDataURI(tagName,attribute){if(tagName === null)return false;return has(badTagsForDataURI,tagName) && has(badAttributesForDataURI,attribute);}function requiresSanitization(tagName,attribute){return checkURI(tagName,attribute) || checkDataURI(tagName,attribute);}function sanitizeAttributeValue(env,element,attribute,value){var tagName=null;if(value === null || value === undefined){return value;}if(isSafeString(value)){return value.toHTML();}if(!element){tagName = null;}else {tagName = element.tagName.toUpperCase();}var str=normalizeTextValue(value);if(checkURI(tagName,attribute)){var protocol=env.protocolForURL(str);if(has(badProtocols,protocol)){return 'unsafe:' + str;}}if(checkDataURI(tagName,attribute)){return 'unsafe:' + str;}return str;} /* + * @method normalizeProperty + * @param element {HTMLElement} + * @param slotName {String} + * @returns {Object} { name, type } + */function normalizeProperty(element,slotName){var type=undefined,normalized=undefined;if(slotName in element){normalized = slotName;type = 'prop';}else {var lower=slotName.toLowerCase();if(lower in element){type = 'prop';normalized = lower;}else {type = 'attr';normalized = slotName;}}if(type === 'prop' && (normalized.toLowerCase() === 'style' || preferAttr(element.tagName,normalized))){type = 'attr';}return {normalized:normalized,type:type};} // properties that MUST be set as attributes, due to: +// * browser bug +// * strange spec outlier +var ATTR_OVERRIDES={ // phantomjs < 2.0 lets you set it as a prop but won't reflect it +// back to the attribute. button.getAttribute('type') === null +BUTTON:{type:true,form:true},INPUT:{ // Some version of IE (like IE9) actually throw an exception +// if you set input.type = 'something-unknown' +type:true,form:true, // Chrome 46.0.2464.0: 'autocorrect' in document.createElement('input') === false +// Safari 8.0.7: 'autocorrect' in document.createElement('input') === false +// Mobile Safari (iOS 8.4 simulator): 'autocorrect' in document.createElement('input') === true +autocorrect:true, // Chrome 54.0.2840.98: 'list' in document.createElement('input') === true +// Safari 9.1.3: 'list' in document.createElement('input') === false +list:true}, // element.form is actually a legitimate readOnly property, that is to be +// mutated, but must be mutated by setAttribute... +SELECT:{form:true},OPTION:{form:true},TEXTAREA:{form:true},LABEL:{form:true},FIELDSET:{form:true},LEGEND:{form:true},OBJECT:{form:true}};function preferAttr(tagName,propName){var tag=ATTR_OVERRIDES[tagName.toUpperCase()];return tag && tag[propName.toLowerCase()] || false;}var innerHTMLWrapper={colgroup:{depth:2,before:'',after:'
    '},table:{depth:1,before:'',after:'
    '},tbody:{depth:2,before:'',after:'
    '},tfoot:{depth:2,before:'',after:'
    '},thead:{depth:2,before:'',after:'
    '},tr:{depth:3,before:'',after:'
    '}}; // Patch: innerHTML Fix +// Browsers: IE9 +// Reason: IE9 don't allow us to set innerHTML on col, colgroup, frameset, +// html, style, table, tbody, tfoot, thead, title, tr. +// Fix: Wrap the innerHTML we are about to set in its parents, apply the +// wrapped innerHTML on a div, then move the unwrapped nodes into the +// target position. +function domChanges(document,DOMChangesClass){if(!document)return DOMChangesClass;if(!shouldApplyFix(document)){return DOMChangesClass;}var div=document.createElement('div');return (function(_DOMChangesClass){babelHelpers.inherits(DOMChangesWithInnerHTMLFix,_DOMChangesClass);function DOMChangesWithInnerHTMLFix(){_DOMChangesClass.apply(this,arguments);}DOMChangesWithInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent,nextSibling,html){if(html === null || html === ''){return _DOMChangesClass.prototype.insertHTMLBefore.call(this,parent,nextSibling,html);}var parentTag=parent.tagName.toLowerCase();var wrapper=innerHTMLWrapper[parentTag];if(wrapper === undefined){return _DOMChangesClass.prototype.insertHTMLBefore.call(this,parent,nextSibling,html);}return fixInnerHTML(parent,wrapper,div,html,nextSibling);};return DOMChangesWithInnerHTMLFix;})(DOMChangesClass);}function treeConstruction(document,DOMTreeConstructionClass){if(!document)return DOMTreeConstructionClass;if(!shouldApplyFix(document)){return DOMTreeConstructionClass;}var div=document.createElement('div');return (function(_DOMTreeConstructionClass){babelHelpers.inherits(DOMTreeConstructionWithInnerHTMLFix,_DOMTreeConstructionClass);function DOMTreeConstructionWithInnerHTMLFix(){_DOMTreeConstructionClass.apply(this,arguments);}DOMTreeConstructionWithInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent,html,reference){if(html === null || html === ''){return _DOMTreeConstructionClass.prototype.insertHTMLBefore.call(this,parent,html,reference);}var parentTag=parent.tagName.toLowerCase();var wrapper=innerHTMLWrapper[parentTag];if(wrapper === undefined){return _DOMTreeConstructionClass.prototype.insertHTMLBefore.call(this,parent,html,reference);}return fixInnerHTML(parent,wrapper,div,html,reference);};return DOMTreeConstructionWithInnerHTMLFix;})(DOMTreeConstructionClass);}function fixInnerHTML(parent,wrapper,div,html,reference){var wrappedHtml=wrapper.before + html + wrapper.after;div.innerHTML = wrappedHtml;var parentNode=div;for(var i=0;i < wrapper.depth;i++) {parentNode = parentNode.childNodes[0];}var _moveNodesBefore=moveNodesBefore(parentNode,parent,reference);var first=_moveNodesBefore[0];var last=_moveNodesBefore[1];return new ConcreteBounds(parent,first,last);}function shouldApplyFix(document){var table=document.createElement('table');try{table.innerHTML = '';}catch(e) {}finally {if(table.childNodes.length !== 0){ // It worked as expected, no fix required +return false;}}return true;}var SVG_NAMESPACE$1='http://www.w3.org/2000/svg'; // Patch: insertAdjacentHTML on SVG Fix +// Browsers: Safari, IE, Edge, Firefox ~33-34 +// Reason: insertAdjacentHTML does not exist on SVG elements in Safari. It is +// present but throws an exception on IE and Edge. Old versions of +// Firefox create nodes in the incorrect namespace. +// Fix: Since IE and Edge silently fail to create SVG nodes using +// innerHTML, and because Firefox may create nodes in the incorrect +// namespace using innerHTML on SVG elements, an HTML-string wrapping +// approach is used. A pre/post SVG tag is added to the string, then +// that whole string is added to a div. The created nodes are plucked +// out and applied to the target location on DOM. +function domChanges$1(document,DOMChangesClass,svgNamespace){if(!document)return DOMChangesClass;if(!shouldApplyFix$1(document,svgNamespace)){return DOMChangesClass;}var div=document.createElement('div');return (function(_DOMChangesClass2){babelHelpers.inherits(DOMChangesWithSVGInnerHTMLFix,_DOMChangesClass2);function DOMChangesWithSVGInnerHTMLFix(){_DOMChangesClass2.apply(this,arguments);}DOMChangesWithSVGInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent,nextSibling,html){if(html === null || html === ''){return _DOMChangesClass2.prototype.insertHTMLBefore.call(this,parent,nextSibling,html);}if(parent.namespaceURI !== svgNamespace){return _DOMChangesClass2.prototype.insertHTMLBefore.call(this,parent,nextSibling,html);}return fixSVG(parent,div,html,nextSibling);};return DOMChangesWithSVGInnerHTMLFix;})(DOMChangesClass);}function treeConstruction$1(document,TreeConstructionClass,svgNamespace){if(!document)return TreeConstructionClass;if(!shouldApplyFix$1(document,svgNamespace)){return TreeConstructionClass;}var div=document.createElement('div');return (function(_TreeConstructionClass){babelHelpers.inherits(TreeConstructionWithSVGInnerHTMLFix,_TreeConstructionClass);function TreeConstructionWithSVGInnerHTMLFix(){_TreeConstructionClass.apply(this,arguments);}TreeConstructionWithSVGInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent,html,reference){if(html === null || html === ''){return _TreeConstructionClass.prototype.insertHTMLBefore.call(this,parent,html,reference);}if(parent.namespaceURI !== svgNamespace){return _TreeConstructionClass.prototype.insertHTMLBefore.call(this,parent,html,reference);}return fixSVG(parent,div,html,reference);};return TreeConstructionWithSVGInnerHTMLFix;})(TreeConstructionClass);}function fixSVG(parent,div,html,reference){ // IE, Edge: also do not correctly support using `innerHTML` on SVG +// namespaced elements. So here a wrapper is used. +var wrappedHtml='' + html + '';div.innerHTML = wrappedHtml;var _moveNodesBefore2=moveNodesBefore(div.firstChild,parent,reference);var first=_moveNodesBefore2[0];var last=_moveNodesBefore2[1];return new ConcreteBounds(parent,first,last);}function shouldApplyFix$1(document,svgNamespace){var svg=document.createElementNS(svgNamespace,'svg');try{svg['insertAdjacentHTML']('beforeEnd','');}catch(e) {}finally { // FF: Old versions will create a node in the wrong namespace +if(svg.childNodes.length === 1 && _glimmerUtil.unwrap(svg.firstChild).namespaceURI === SVG_NAMESPACE$1){ // The test worked as expected, no fix required +return false;}return true;}} // Patch: Adjacent text node merging fix +// Browsers: IE, Edge, Firefox w/o inspector open +// Reason: These browsers will merge adjacent text nodes. For exmaple given +//
    Hello
    with div.insertAdjacentHTML(' world') browsers +// with proper behavior will populate div.childNodes with two items. +// These browsers will populate it with one merged node instead. +// Fix: Add these nodes to a wrapper element, then iterate the childNodes +// of that wrapper and move the nodes to their target location. Note +// that potential SVG bugs will have been handled before this fix. +// Note that this fix must only apply to the previous text node, as +// the base implementation of `insertHTMLBefore` already handles +// following text nodes correctly. +function domChanges$2(document,DOMChangesClass){if(!document)return DOMChangesClass;if(!shouldApplyFix$2(document)){return DOMChangesClass;}return (function(_DOMChangesClass3){babelHelpers.inherits(DOMChangesWithTextNodeMergingFix,_DOMChangesClass3);function DOMChangesWithTextNodeMergingFix(document){_DOMChangesClass3.call(this,document);this.uselessComment = document.createComment('');}DOMChangesWithTextNodeMergingFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent,nextSibling,html){if(html === null){return _DOMChangesClass3.prototype.insertHTMLBefore.call(this,parent,nextSibling,html);}var didSetUselessComment=false;var nextPrevious=nextSibling?nextSibling.previousSibling:parent.lastChild;if(nextPrevious && nextPrevious instanceof Text){didSetUselessComment = true;parent.insertBefore(this.uselessComment,nextSibling);}var bounds=_DOMChangesClass3.prototype.insertHTMLBefore.call(this,parent,nextSibling,html);if(didSetUselessComment){parent.removeChild(this.uselessComment);}return bounds;};return DOMChangesWithTextNodeMergingFix;})(DOMChangesClass);}function treeConstruction$2(document,TreeConstructionClass){if(!document)return TreeConstructionClass;if(!shouldApplyFix$2(document)){return TreeConstructionClass;}return (function(_TreeConstructionClass2){babelHelpers.inherits(TreeConstructionWithTextNodeMergingFix,_TreeConstructionClass2);function TreeConstructionWithTextNodeMergingFix(document){_TreeConstructionClass2.call(this,document);this.uselessComment = this.createComment('');}TreeConstructionWithTextNodeMergingFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent,html,reference){if(html === null){return _TreeConstructionClass2.prototype.insertHTMLBefore.call(this,parent,html,reference);}var didSetUselessComment=false;var nextPrevious=reference?reference.previousSibling:parent.lastChild;if(nextPrevious && nextPrevious instanceof Text){didSetUselessComment = true;parent.insertBefore(this.uselessComment,reference);}var bounds=_TreeConstructionClass2.prototype.insertHTMLBefore.call(this,parent,html,reference);if(didSetUselessComment){parent.removeChild(this.uselessComment);}return bounds;};return TreeConstructionWithTextNodeMergingFix;})(TreeConstructionClass);}function shouldApplyFix$2(document){var mergingTextDiv=document.createElement('div');mergingTextDiv.innerHTML = 'first';mergingTextDiv.insertAdjacentHTML('beforeEnd','second');if(mergingTextDiv.childNodes.length === 2){ // It worked as expected, no fix required +return false;}return true;}var SVG_NAMESPACE='http://www.w3.org/2000/svg'; // http://www.w3.org/TR/html/syntax.html#html-integration-point +var SVG_INTEGRATION_POINTS={foreignObject:1,desc:1,title:1}; // http://www.w3.org/TR/html/syntax.html#adjust-svg-attributes +// TODO: Adjust SVG attributes +// http://www.w3.org/TR/html/syntax.html#parsing-main-inforeign +// TODO: Adjust SVG elements +// http://www.w3.org/TR/html/syntax.html#parsing-main-inforeign +var BLACKLIST_TABLE=Object.create(null);["b","big","blockquote","body","br","center","code","dd","div","dl","dt","em","embed","h1","h2","h3","h4","h5","h6","head","hr","i","img","li","listing","main","meta","nobr","ol","p","pre","ruby","s","small","span","strong","strike","sub","sup","table","tt","u","ul","var"].forEach(function(tag){return BLACKLIST_TABLE[tag] = 1;});var WHITESPACE=/[\t-\r \xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/;var doc=typeof document === 'undefined'?null:document;function isWhitespace(string){return WHITESPACE.test(string);}function moveNodesBefore(source,target,nextSibling){var first=source.firstChild;var last=null;var current=first;while(current) {last = current;current = current.nextSibling;target.insertBefore(last,nextSibling);}return [first,last];}var DOM;(function(DOM){var TreeConstruction=(function(){function TreeConstruction(document){this.document = document;this.setupUselessElement();}TreeConstruction.prototype.setupUselessElement = function setupUselessElement(){this.uselessElement = this.document.createElement('div');};TreeConstruction.prototype.createElement = function createElement(tag,context){var isElementInSVGNamespace=undefined,isHTMLIntegrationPoint=undefined;if(context){isElementInSVGNamespace = context.namespaceURI === SVG_NAMESPACE || tag === 'svg';isHTMLIntegrationPoint = SVG_INTEGRATION_POINTS[context.tagName];}else {isElementInSVGNamespace = tag === 'svg';isHTMLIntegrationPoint = false;}if(isElementInSVGNamespace && !isHTMLIntegrationPoint){ // FIXME: This does not properly handle with color, face, or +// size attributes, which is also disallowed by the spec. We should fix +// this. +if(BLACKLIST_TABLE[tag]){throw new Error('Cannot create a ' + tag + ' inside an SVG context');}return this.document.createElementNS(SVG_NAMESPACE,tag);}else {return this.document.createElement(tag);}};TreeConstruction.prototype.createElementNS = function createElementNS(namespace,tag){return this.document.createElementNS(namespace,tag);};TreeConstruction.prototype.setAttribute = function setAttribute(element,name,value,namespace){if(namespace){element.setAttributeNS(namespace,name,value);}else {element.setAttribute(name,value);}};TreeConstruction.prototype.createTextNode = function createTextNode(text){return this.document.createTextNode(text);};TreeConstruction.prototype.createComment = function createComment(data){return this.document.createComment(data);};TreeConstruction.prototype.insertBefore = function insertBefore(parent,node,reference){parent.insertBefore(node,reference);};TreeConstruction.prototype.insertHTMLBefore = function insertHTMLBefore(parent,html,reference){return _insertHTMLBefore(this.uselessElement,parent,reference,html);};return TreeConstruction;})();DOM.TreeConstruction = TreeConstruction;var appliedTreeContruction=TreeConstruction;appliedTreeContruction = treeConstruction$2(doc,appliedTreeContruction);appliedTreeContruction = treeConstruction(doc,appliedTreeContruction);appliedTreeContruction = treeConstruction$1(doc,appliedTreeContruction,SVG_NAMESPACE);DOM.DOMTreeConstruction = appliedTreeContruction;})(DOM || (DOM = {}));var DOMChanges=(function(){function DOMChanges(document){this.document = document;this.namespace = null;this.uselessElement = this.document.createElement('div');}DOMChanges.prototype.setAttribute = function setAttribute(element,name,value){element.setAttribute(name,value);};DOMChanges.prototype.setAttributeNS = function setAttributeNS(element,namespace,name,value){element.setAttributeNS(namespace,name,value);};DOMChanges.prototype.removeAttribute = function removeAttribute(element,name){element.removeAttribute(name);};DOMChanges.prototype.removeAttributeNS = function removeAttributeNS(element,namespace,name){element.removeAttributeNS(namespace,name);};DOMChanges.prototype.createTextNode = function createTextNode(text){return this.document.createTextNode(text);};DOMChanges.prototype.createComment = function createComment(data){return this.document.createComment(data);};DOMChanges.prototype.createElement = function createElement(tag,context){var isElementInSVGNamespace=undefined,isHTMLIntegrationPoint=undefined;if(context){isElementInSVGNamespace = context.namespaceURI === SVG_NAMESPACE || tag === 'svg';isHTMLIntegrationPoint = SVG_INTEGRATION_POINTS[context.tagName];}else {isElementInSVGNamespace = tag === 'svg';isHTMLIntegrationPoint = false;}if(isElementInSVGNamespace && !isHTMLIntegrationPoint){ // FIXME: This does not properly handle with color, face, or +// size attributes, which is also disallowed by the spec. We should fix +// this. +if(BLACKLIST_TABLE[tag]){throw new Error('Cannot create a ' + tag + ' inside an SVG context');}return this.document.createElementNS(SVG_NAMESPACE,tag);}else {return this.document.createElement(tag);}};DOMChanges.prototype.insertHTMLBefore = function insertHTMLBefore(_parent,nextSibling,html){return _insertHTMLBefore(this.uselessElement,_parent,nextSibling,html);};DOMChanges.prototype.insertNodeBefore = function insertNodeBefore(parent,node,reference){if(isDocumentFragment(node)){var firstChild=node.firstChild;var lastChild=node.lastChild;this.insertBefore(parent,node,reference);return new ConcreteBounds(parent,firstChild,lastChild);}else {this.insertBefore(parent,node,reference);return new SingleNodeBounds(parent,node);}};DOMChanges.prototype.insertTextBefore = function insertTextBefore(parent,nextSibling,text){var textNode=this.createTextNode(text);this.insertBefore(parent,textNode,nextSibling);return textNode;};DOMChanges.prototype.insertBefore = function insertBefore(element,node,reference){element.insertBefore(node,reference);};DOMChanges.prototype.insertAfter = function insertAfter(element,node,reference){this.insertBefore(element,node,reference.nextSibling);};return DOMChanges;})();function _insertHTMLBefore(_useless,_parent,_nextSibling,html){ // TypeScript vendored an old version of the DOM spec where `insertAdjacentHTML` +// only exists on `HTMLElement` but not on `Element`. We actually work with the +// newer version of the DOM API here (and monkey-patch this method in `./compat` +// when we detect older browsers). This is a hack to work around this limitation. +var parent=_parent;var useless=_useless;var nextSibling=_nextSibling;var prev=nextSibling?nextSibling.previousSibling:parent.lastChild;var last=undefined;if(html === null || html === ''){return new ConcreteBounds(parent,null,null);}if(nextSibling === null){parent.insertAdjacentHTML('beforeEnd',html);last = parent.lastChild;}else if(nextSibling instanceof HTMLElement){nextSibling.insertAdjacentHTML('beforeBegin',html);last = nextSibling.previousSibling;}else { // Non-element nodes do not support insertAdjacentHTML, so add an +// element and call it on that element. Then remove the element. +// +// This also protects Edge, IE and Firefox w/o the inspector open +// from merging adjacent text nodes. See ./compat/text-node-merging-fix.ts +parent.insertBefore(useless,nextSibling);useless.insertAdjacentHTML('beforeBegin',html);last = useless.previousSibling;parent.removeChild(useless);}var first=prev?prev.nextSibling:parent.firstChild;return new ConcreteBounds(parent,first,last);}function isDocumentFragment(node){return node.nodeType === Node.DOCUMENT_FRAGMENT_NODE;}var helper=DOMChanges;helper = domChanges$2(doc,helper);helper = domChanges(doc,helper);helper = domChanges$1(doc,helper,SVG_NAMESPACE);var helper$1=helper;var DOMTreeConstruction=DOM.DOMTreeConstruction;function defaultManagers(element,attr,_isTrusting,_namespace){var tagName=element.tagName;var isSVG=element.namespaceURI === SVG_NAMESPACE;if(isSVG){return defaultAttributeManagers(tagName,attr);}var _normalizeProperty=normalizeProperty(element,attr);var type=_normalizeProperty.type;var normalized=_normalizeProperty.normalized;if(type === 'attr'){return defaultAttributeManagers(tagName,normalized);}else {return defaultPropertyManagers(tagName,normalized);}}function defaultPropertyManagers(tagName,attr){if(requiresSanitization(tagName,attr)){return new SafePropertyManager(attr);}if(isUserInputValue(tagName,attr)){return INPUT_VALUE_PROPERTY_MANAGER;}if(isOptionSelected(tagName,attr)){return OPTION_SELECTED_MANAGER;}return new PropertyManager(attr);}function defaultAttributeManagers(tagName,attr){if(requiresSanitization(tagName,attr)){return new SafeAttributeManager(attr);}return new AttributeManager(attr);}function readDOMAttr(element,attr){var isSVG=element.namespaceURI === SVG_NAMESPACE;var _normalizeProperty2=normalizeProperty(element,attr);var type=_normalizeProperty2.type;var normalized=_normalizeProperty2.normalized;if(isSVG){return element.getAttribute(normalized);}if(type === 'attr'){return element.getAttribute(normalized);}{return element[normalized];}};var AttributeManager=(function(){function AttributeManager(attr){this.attr = attr;}AttributeManager.prototype.setAttribute = function setAttribute(env,element,value,namespace){var dom=env.getAppendOperations();var normalizedValue=normalizeAttributeValue(value);if(!isAttrRemovalValue(normalizedValue)){dom.setAttribute(element,this.attr,normalizedValue,namespace);}};AttributeManager.prototype.updateAttribute = function updateAttribute(env,element,value,namespace){if(value === null || value === undefined || value === false){if(namespace){env.getDOM().removeAttributeNS(element,namespace,this.attr);}else {env.getDOM().removeAttribute(element,this.attr);}}else {this.setAttribute(env,element,value);}};return AttributeManager;})();;var PropertyManager=(function(_AttributeManager){babelHelpers.inherits(PropertyManager,_AttributeManager);function PropertyManager(){_AttributeManager.apply(this,arguments);}PropertyManager.prototype.setAttribute = function setAttribute(_env,element,value,_namespace){if(!isAttrRemovalValue(value)){element[this.attr] = value;}};PropertyManager.prototype.removeAttribute = function removeAttribute(env,element,namespace){ // TODO this sucks but to preserve properties first and to meet current +// semantics we must do this. +var attr=this.attr;if(namespace){env.getDOM().removeAttributeNS(element,namespace,attr);}else {env.getDOM().removeAttribute(element,attr);}};PropertyManager.prototype.updateAttribute = function updateAttribute(env,element,value,namespace){ // ensure the property is always updated +element[this.attr] = value;if(isAttrRemovalValue(value)){this.removeAttribute(env,element,namespace);}};return PropertyManager;})(AttributeManager);;function normalizeAttributeValue(value){if(value === false || value === undefined || value === null){return null;}if(value === true){return '';} // onclick function etc in SSR +if(typeof value === 'function'){return null;}return String(value);}function isAttrRemovalValue(value){return value === null || value === undefined;}var SafePropertyManager=(function(_PropertyManager){babelHelpers.inherits(SafePropertyManager,_PropertyManager);function SafePropertyManager(){_PropertyManager.apply(this,arguments);}SafePropertyManager.prototype.setAttribute = function setAttribute(env,element,value){_PropertyManager.prototype.setAttribute.call(this,env,element,sanitizeAttributeValue(env,element,this.attr,value));};SafePropertyManager.prototype.updateAttribute = function updateAttribute(env,element,value){_PropertyManager.prototype.updateAttribute.call(this,env,element,sanitizeAttributeValue(env,element,this.attr,value));};return SafePropertyManager;})(PropertyManager);function isUserInputValue(tagName,attribute){return (tagName === 'INPUT' || tagName === 'TEXTAREA') && attribute === 'value';}var InputValuePropertyManager=(function(_AttributeManager2){babelHelpers.inherits(InputValuePropertyManager,_AttributeManager2);function InputValuePropertyManager(){_AttributeManager2.apply(this,arguments);}InputValuePropertyManager.prototype.setAttribute = function setAttribute(_env,element,value){var input=element;input.value = normalizeTextValue(value);};InputValuePropertyManager.prototype.updateAttribute = function updateAttribute(_env,element,value){var input=element;var currentValue=input.value;var normalizedValue=normalizeTextValue(value);if(currentValue !== normalizedValue){input.value = normalizedValue;}};return InputValuePropertyManager;})(AttributeManager);var INPUT_VALUE_PROPERTY_MANAGER=new InputValuePropertyManager('value');function isOptionSelected(tagName,attribute){return tagName === 'OPTION' && attribute === 'selected';}var OptionSelectedManager=(function(_PropertyManager2){babelHelpers.inherits(OptionSelectedManager,_PropertyManager2);function OptionSelectedManager(){_PropertyManager2.apply(this,arguments);}OptionSelectedManager.prototype.setAttribute = function setAttribute(_env,element,value){if(value !== null && value !== undefined && value !== false){var option=element;option.selected = true;}};OptionSelectedManager.prototype.updateAttribute = function updateAttribute(_env,element,value){var option=element;if(value){option.selected = true;}else {option.selected = false;}};return OptionSelectedManager;})(PropertyManager);var OPTION_SELECTED_MANAGER=new OptionSelectedManager('selected');var SafeAttributeManager=(function(_AttributeManager3){babelHelpers.inherits(SafeAttributeManager,_AttributeManager3);function SafeAttributeManager(){_AttributeManager3.apply(this,arguments);}SafeAttributeManager.prototype.setAttribute = function setAttribute(env,element,value){_AttributeManager3.prototype.setAttribute.call(this,env,element,sanitizeAttributeValue(env,element,this.attr,value));};SafeAttributeManager.prototype.updateAttribute = function updateAttribute(env,element,value,_namespace){_AttributeManager3.prototype.updateAttribute.call(this,env,element,sanitizeAttributeValue(env,element,this.attr,value));};return SafeAttributeManager;})(AttributeManager);var Scope=(function(){function Scope(references){var callerScope=arguments.length <= 1 || arguments[1] === undefined?null:arguments[1];this.callerScope = null;this.slots = references;this.callerScope = callerScope;}Scope.root = function root(self){var size=arguments.length <= 1 || arguments[1] === undefined?0:arguments[1];var refs=new Array(size + 1);for(var i=0;i <= size;i++) {refs[i] = UNDEFINED_REFERENCE;}return new Scope(refs).init({self:self});};Scope.prototype.init = function init(_ref26){var self=_ref26.self;this.slots[0] = self;return this;};Scope.prototype.getSelf = function getSelf(){return this.slots[0];};Scope.prototype.getSymbol = function getSymbol(symbol){return this.slots[symbol];};Scope.prototype.getBlock = function getBlock(symbol){return this.slots[symbol];};Scope.prototype.getPartialArgs = function getPartialArgs(symbol){return this.slots[symbol];};Scope.prototype.bindSymbol = function bindSymbol(symbol,value){this.slots[symbol] = value;};Scope.prototype.bindBlock = function bindBlock(symbol,value){this.slots[symbol] = value;};Scope.prototype.bindPartialArgs = function bindPartialArgs(symbol,value){this.slots[symbol] = value;};Scope.prototype.bindCallerScope = function bindCallerScope(scope){this.callerScope = scope;};Scope.prototype.getCallerScope = function getCallerScope(){return this.callerScope;};Scope.prototype.child = function child(){return new Scope(this.slots.slice(),this.callerScope);};return Scope;})();var Transaction=(function(){function Transaction(){this.scheduledInstallManagers = [];this.scheduledInstallModifiers = [];this.scheduledUpdateModifierManagers = [];this.scheduledUpdateModifiers = [];this.createdComponents = [];this.createdManagers = [];this.updatedComponents = [];this.updatedManagers = [];this.destructors = [];}Transaction.prototype.didCreate = function didCreate(component,manager){this.createdComponents.push(component);this.createdManagers.push(manager);};Transaction.prototype.didUpdate = function didUpdate(component,manager){this.updatedComponents.push(component);this.updatedManagers.push(manager);};Transaction.prototype.scheduleInstallModifier = function scheduleInstallModifier(modifier,manager){this.scheduledInstallManagers.push(manager);this.scheduledInstallModifiers.push(modifier);};Transaction.prototype.scheduleUpdateModifier = function scheduleUpdateModifier(modifier,manager){this.scheduledUpdateModifierManagers.push(manager);this.scheduledUpdateModifiers.push(modifier);};Transaction.prototype.didDestroy = function didDestroy(d){this.destructors.push(d);};Transaction.prototype.commit = function commit(){var createdComponents=this.createdComponents;var createdManagers=this.createdManagers;for(var i=0;i < createdComponents.length;i++) {var component=createdComponents[i];var manager=createdManagers[i];manager.didCreate(component);}var updatedComponents=this.updatedComponents;var updatedManagers=this.updatedManagers;for(var i=0;i < updatedComponents.length;i++) {var component=updatedComponents[i];var manager=updatedManagers[i];manager.didUpdate(component);}var destructors=this.destructors;for(var i=0;i < destructors.length;i++) {destructors[i].destroy();}var scheduledInstallManagers=this.scheduledInstallManagers;var scheduledInstallModifiers=this.scheduledInstallModifiers;for(var i=0;i < scheduledInstallManagers.length;i++) {var manager=scheduledInstallManagers[i];var modifier=scheduledInstallModifiers[i];manager.install(modifier);}var scheduledUpdateModifierManagers=this.scheduledUpdateModifierManagers;var scheduledUpdateModifiers=this.scheduledUpdateModifiers;for(var i=0;i < scheduledUpdateModifierManagers.length;i++) {var manager=scheduledUpdateModifierManagers[i];var modifier=scheduledUpdateModifiers[i];manager.update(modifier);}};return Transaction;})();var Opcode=(function(){function Opcode(array){this.array = array;this.offset = 0;}babelHelpers.createClass(Opcode,[{key:'type',get:function(){return this.array[this.offset];}},{key:'op1',get:function(){return this.array[this.offset + 1];}},{key:'op2',get:function(){return this.array[this.offset + 2];}},{key:'op3',get:function(){return this.array[this.offset + 3];}}]);return Opcode;})();var Program=(function(){function Program(){this.opcodes = new _glimmerUtil.A(0x100000);this._offset = 0;this._opcode = new Opcode(this.opcodes);}Program.prototype.opcode = function opcode(offset){this._opcode.offset = offset;return this._opcode;};Program.prototype.set = function set(pos,opcode){var type=opcode[0];var op1=opcode[1];var op2=opcode[2];var op3=opcode[3];this.opcodes[pos] = type;this.opcodes[pos + 1] = op1;this.opcodes[pos + 2] = op2;this.opcodes[pos + 3] = op3;};Program.prototype.push = function push(opcode){var offset=this._offset;var type=opcode[0];var op1=opcode[1];var op2=opcode[2];var op3=opcode[3];this.opcodes[this._offset++] = type;this.opcodes[this._offset++] = op1;this.opcodes[this._offset++] = op2;this.opcodes[this._offset++] = op3;return offset;};babelHelpers.createClass(Program,[{key:'next',get:function(){return this._offset;}},{key:'current',get:function(){return this._offset - 4;}}]);return Program;})();var Environment=(function(){function Environment(_ref27){var appendOperations=_ref27.appendOperations;var updateOperations=_ref27.updateOperations;this._macros = null;this._transaction = null;this.constants = new Constants();this.program = new Program();this.appendOperations = appendOperations;this.updateOperations = updateOperations;}Environment.prototype.toConditionalReference = function toConditionalReference(reference){return new ConditionalReference(reference);};Environment.prototype.getAppendOperations = function getAppendOperations(){return this.appendOperations;};Environment.prototype.getDOM = function getDOM(){return this.updateOperations;};Environment.prototype.getIdentity = function getIdentity(object){return _glimmerUtil.ensureGuid(object) + '';};Environment.prototype.begin = function begin(){_glimmerUtil.assert(!this._transaction,'Cannot start a nested transaction');this._transaction = new Transaction();};Environment.prototype.didCreate = function didCreate(component,manager){this.transaction.didCreate(component,manager);};Environment.prototype.didUpdate = function didUpdate(component,manager){this.transaction.didUpdate(component,manager);};Environment.prototype.scheduleInstallModifier = function scheduleInstallModifier(modifier,manager){this.transaction.scheduleInstallModifier(modifier,manager);};Environment.prototype.scheduleUpdateModifier = function scheduleUpdateModifier(modifier,manager){this.transaction.scheduleUpdateModifier(modifier,manager);};Environment.prototype.didDestroy = function didDestroy(d){this.transaction.didDestroy(d);};Environment.prototype.commit = function commit(){this.transaction.commit();this._transaction = null;};Environment.prototype.attributeFor = function attributeFor(element,attr,isTrusting,namespace){return defaultManagers(element,attr,isTrusting,namespace === undefined?null:namespace);};Environment.prototype.macros = function macros(){var macros=this._macros;if(!macros){this._macros = macros = populateBuiltins();}return macros;};babelHelpers.createClass(Environment,[{key:'transaction',get:function(){return _glimmerUtil.expect(this._transaction,'must be in a transaction');}}]);return Environment;})();var RenderResult=(function(){function RenderResult(env,updating,bounds){this.env = env;this.updating = updating;this.bounds = bounds;}RenderResult.prototype.rerender = function rerender(){var _ref28=arguments.length <= 0 || arguments[0] === undefined?{alwaysRevalidate:false}:arguments[0];var _ref28$alwaysRevalidate=_ref28.alwaysRevalidate;var alwaysRevalidate=_ref28$alwaysRevalidate === undefined?false:_ref28$alwaysRevalidate;var env=this.env;var updating=this.updating;var vm=new UpdatingVM(env,{alwaysRevalidate:alwaysRevalidate});vm.execute(updating,this);};RenderResult.prototype.parentElement = function parentElement(){return this.bounds.parentElement();};RenderResult.prototype.firstNode = function firstNode(){return this.bounds.firstNode();};RenderResult.prototype.lastNode = function lastNode(){return this.bounds.lastNode();};RenderResult.prototype.opcodes = function opcodes(){return this.updating;};RenderResult.prototype.handleException = function handleException(){throw "this should never happen";};RenderResult.prototype.destroy = function destroy(){this.bounds.destroy();clear(this.bounds);};return RenderResult;})();var CapturedFrame=function CapturedFrame(operand,args,condition){this.operand = operand;this.args = args;this.condition = condition;};var Frame=(function(){function Frame(ops){var component=arguments.length <= 1 || arguments[1] === undefined?null:arguments[1];var manager=arguments.length <= 2 || arguments[2] === undefined?null:arguments[2];var shadow=arguments.length <= 3 || arguments[3] === undefined?null:arguments[3];this.ops = ops;this.component = component;this.manager = manager;this.shadow = shadow;this.operand = null;this.immediate = null;this.args = null;this.callerScope = null;this.blocks = null;this.condition = null;this.iterator = null;this.key = null;this.ip = ops[0];}Frame.prototype.capture = function capture(){return new CapturedFrame(this.operand,this.args,this.condition);};Frame.prototype.restore = function restore(frame){this.operand = frame['operand'];this.args = frame['args'];this.condition = frame['condition'];};return Frame;})();var FrameStack=(function(){function FrameStack(){this.frames = [];this.frame = null;}FrameStack.prototype.push = function push(ops){var component=arguments.length <= 1 || arguments[1] === undefined?null:arguments[1];var manager=arguments.length <= 2 || arguments[2] === undefined?null:arguments[2];var shadow=arguments.length <= 3 || arguments[3] === undefined?null:arguments[3];var frame=this.frame === null?this.frame = 0:++this.frame;if(this.frames.length <= frame){this.frames.push(null);}this.frames[frame] = new Frame(ops,component,manager,shadow);};FrameStack.prototype.pop = function pop(){var frames=this.frames;var frame=this.frame;frames[_glimmerUtil.expect(frame,'only pop after pushing')] = null;this.frame = frame === 0?null:frame - 1;};FrameStack.prototype.capture = function capture(){return this.currentFrame.capture();};FrameStack.prototype.restore = function restore(frame){this.currentFrame.restore(frame);};FrameStack.prototype.getOps = function getOps(){return this.currentFrame.ops;};FrameStack.prototype.getCurrent = function getCurrent(){return this.currentFrame.ip;};FrameStack.prototype.setCurrent = function setCurrent(ip){return this.currentFrame.ip = ip;};FrameStack.prototype.getOperand = function getOperand(){return _glimmerUtil.unwrap(this.currentFrame.operand);};FrameStack.prototype.setOperand = function setOperand(operand){return this.currentFrame.operand = operand;};FrameStack.prototype.getImmediate = function getImmediate(){return this.currentFrame.immediate;};FrameStack.prototype.setImmediate = function setImmediate(value){return this.currentFrame.immediate = value;}; // FIXME: These options are required in practice by the existing code, but +// figure out why. +FrameStack.prototype.getArgs = function getArgs(){return this.currentFrame.args;};FrameStack.prototype.setArgs = function setArgs(args){return this.currentFrame.args = args;};FrameStack.prototype.getCondition = function getCondition(){return _glimmerUtil.unwrap(this.currentFrame.condition);};FrameStack.prototype.setCondition = function setCondition(condition){return this.currentFrame.condition = condition;};FrameStack.prototype.getIterator = function getIterator(){return _glimmerUtil.unwrap(this.currentFrame.iterator);};FrameStack.prototype.setIterator = function setIterator(iterator){return this.currentFrame.iterator = iterator;};FrameStack.prototype.getKey = function getKey(){return this.currentFrame.key;};FrameStack.prototype.setKey = function setKey(key){return this.currentFrame.key = key;};FrameStack.prototype.getBlocks = function getBlocks(){return _glimmerUtil.unwrap(this.currentFrame.blocks);};FrameStack.prototype.setBlocks = function setBlocks(blocks){return this.currentFrame.blocks = blocks;};FrameStack.prototype.getCallerScope = function getCallerScope(){return _glimmerUtil.unwrap(this.currentFrame.callerScope);};FrameStack.prototype.setCallerScope = function setCallerScope(callerScope){return this.currentFrame.callerScope = callerScope;};FrameStack.prototype.getComponent = function getComponent(){return _glimmerUtil.unwrap(this.currentFrame.component);};FrameStack.prototype.getManager = function getManager(){return _glimmerUtil.unwrap(this.currentFrame.manager);};FrameStack.prototype.getShadow = function getShadow(){return this.currentFrame.shadow;};FrameStack.prototype.goto = function goto(ip){this.setCurrent(ip);};FrameStack.prototype.hasOpcodes = function hasOpcodes(){return this.frame !== null;};FrameStack.prototype.nextStatement = function nextStatement(env){var ip=this.frames[_glimmerUtil.unwrap(this.frame)].ip;var ops=this.getOps();if(ip <= ops[1]){var program=env.program;this.setCurrent(ip + 4);return program.opcode(ip);}else {this.pop();return null;}};babelHelpers.createClass(FrameStack,[{key:'currentFrame',get:function(){return this.frames[_glimmerUtil.unwrap(this.frame)];}}]);return FrameStack;})();var VM=(function(){function VM(env,scope,dynamicScope,elementStack){this.env = env;this.elementStack = elementStack;this.dynamicScopeStack = new _glimmerUtil.Stack();this.scopeStack = new _glimmerUtil.Stack();this.updatingOpcodeStack = new _glimmerUtil.Stack();this.cacheGroups = new _glimmerUtil.Stack();this.listBlockStack = new _glimmerUtil.Stack();this.frame = new FrameStack();this.env = env;this.constants = env.constants;this.elementStack = elementStack;this.scopeStack.push(scope);this.dynamicScopeStack.push(dynamicScope);}VM.initial = function initial(env,self,dynamicScope,elementStack,size){var scope=Scope.root(self,size);return new VM(env,scope,dynamicScope,elementStack);};VM.prototype.capture = function capture(){return {env:this.env,scope:this.scope(),dynamicScope:this.dynamicScope(),frame:this.frame.capture()};};VM.prototype.goto = function goto(ip){ // assert(this.frame.getOps().contains(op), `Illegal jump to ${op.label}`); +this.frame.goto(ip);};VM.prototype.beginCacheGroup = function beginCacheGroup(){this.cacheGroups.push(this.updating().tail());};VM.prototype.commitCacheGroup = function commitCacheGroup(){ // JumpIfNotModified(END) +// (head) +// (....) +// (tail) +// DidModify +// END: Noop +var END=new LabelOpcode("END");var opcodes=this.updating();var marker=this.cacheGroups.pop();var head=marker?opcodes.nextNode(marker):opcodes.head();var tail=opcodes.tail();var tag=_glimmerReference.combineSlice(new _glimmerUtil.ListSlice(head,tail));var guard=new JumpIfNotModifiedOpcode(tag,END);opcodes.insertBefore(guard,head);opcodes.append(new DidModifyOpcode(guard));opcodes.append(END);};VM.prototype.enter = function enter(sliceId){var updating=new _glimmerUtil.LinkedList();var tracker=this.stack().pushUpdatableBlock();var state=this.capture();var slice=this.constants.getSlice(sliceId);var tryOpcode=new TryOpcode(slice,state,tracker,updating);this.didEnter(tryOpcode,updating);};VM.prototype.enterWithKey = function enterWithKey(key,ops){var updating=new _glimmerUtil.LinkedList();var tracker=this.stack().pushUpdatableBlock();var state=this.capture();var tryOpcode=new TryOpcode(ops,state,tracker,updating);this.listBlock().map[key] = tryOpcode;this.didEnter(tryOpcode,updating);};VM.prototype.enterList = function enterList(ops){var updating=new _glimmerUtil.LinkedList();var tracker=this.stack().pushBlockList(updating);var state=this.capture();var artifacts=this.frame.getIterator().artifacts;var opcode=new ListBlockOpcode(ops,state,tracker,updating,artifacts);this.listBlockStack.push(opcode);this.didEnter(opcode,updating);};VM.prototype.didEnter = function didEnter(opcode,updating){this.updateWith(opcode);this.updatingOpcodeStack.push(updating);};VM.prototype.exit = function exit(){this.stack().popBlock();this.updatingOpcodeStack.pop();var parent=this.updating().tail();parent.didInitializeChildren();};VM.prototype.exitList = function exitList(){this.exit();this.listBlockStack.pop();};VM.prototype.updateWith = function updateWith(opcode){this.updating().append(opcode);};VM.prototype.listBlock = function listBlock(){return _glimmerUtil.expect(this.listBlockStack.current,'expected a list block');};VM.prototype.updating = function updating(){return _glimmerUtil.expect(this.updatingOpcodeStack.current,'expected updating opcode on the updating opcode stack');};VM.prototype.stack = function stack(){return this.elementStack;};VM.prototype.scope = function scope(){return _glimmerUtil.expect(this.scopeStack.current,'expected scope on the scope stack');};VM.prototype.dynamicScope = function dynamicScope(){return _glimmerUtil.expect(this.dynamicScopeStack.current,'expected dynamic scope on the dynamic scope stack');};VM.prototype.pushFrame = function pushFrame(block,args,callerScope){this.frame.push(block.slice);if(args)this.frame.setArgs(args);if(args && args.blocks)this.frame.setBlocks(args.blocks);if(callerScope)this.frame.setCallerScope(callerScope);};VM.prototype.pushComponentFrame = function pushComponentFrame(layout,args,callerScope,component,manager,shadow){this.frame.push(layout.slice,component,manager,shadow);if(args)this.frame.setArgs(args);if(args && args.blocks)this.frame.setBlocks(args.blocks);if(callerScope)this.frame.setCallerScope(callerScope);};VM.prototype.pushEvalFrame = function pushEvalFrame(slice){this.frame.push(slice);};VM.prototype.pushChildScope = function pushChildScope(){this.scopeStack.push(this.scope().child());};VM.prototype.pushCallerScope = function pushCallerScope(){this.scopeStack.push(_glimmerUtil.expect(this.scope().getCallerScope(),'pushCallerScope is called when a caller scope is present'));};VM.prototype.pushDynamicScope = function pushDynamicScope(){var child=this.dynamicScope().child();this.dynamicScopeStack.push(child);return child;};VM.prototype.pushRootScope = function pushRootScope(self,size){var scope=Scope.root(self,size);this.scopeStack.push(scope);return scope;};VM.prototype.popScope = function popScope(){this.scopeStack.pop();};VM.prototype.popDynamicScope = function popDynamicScope(){this.dynamicScopeStack.pop();};VM.prototype.newDestroyable = function newDestroyable(d){this.stack().newDestroyable(d);}; /// SCOPE HELPERS +VM.prototype.getSelf = function getSelf(){return this.scope().getSelf();};VM.prototype.referenceForSymbol = function referenceForSymbol(symbol){return this.scope().getSymbol(symbol);};VM.prototype.getArgs = function getArgs(){return this.frame.getArgs();}; /// EXECUTION +VM.prototype.resume = function resume(opcodes,frame){return this.execute(opcodes,function(vm){return vm.frame.restore(frame);});};VM.prototype.execute = function execute(opcodes,initialize){_glimmerUtil.LOGGER.debug("[VM] Begin program execution");var elementStack=this.elementStack;var frame=this.frame;var updatingOpcodeStack=this.updatingOpcodeStack;var env=this.env;elementStack.pushSimpleBlock();updatingOpcodeStack.push(new _glimmerUtil.LinkedList());frame.push(opcodes);if(initialize)initialize(this);var opcode=undefined;while(frame.hasOpcodes()) {if(opcode = frame.nextStatement(this.env)){_glimmerUtil.LOGGER.trace(opcode);APPEND_OPCODES.evaluate(this,opcode);}}_glimmerUtil.LOGGER.debug("[VM] Completed program execution");return new RenderResult(env,_glimmerUtil.expect(updatingOpcodeStack.pop(),'there should be a final updating opcode stack'),elementStack.popBlock());};VM.prototype.evaluateOpcode = function evaluateOpcode(opcode){APPEND_OPCODES.evaluate(this,opcode);}; // Make sure you have opcodes that push and pop a scope around this opcode +// if you need to change the scope. +VM.prototype.invokeBlock = function invokeBlock(block,args){var compiled=block.compile(this.env);this.pushFrame(compiled,args);};VM.prototype.invokePartial = function invokePartial(block){var compiled=block.compile(this.env);this.pushFrame(compiled);};VM.prototype.invokeLayout = function invokeLayout(args,layout,callerScope,component,manager,shadow){this.pushComponentFrame(layout,args,callerScope,component,manager,shadow);};VM.prototype.evaluateOperand = function evaluateOperand(expr){this.frame.setOperand(expr.evaluate(this));};VM.prototype.evaluateArgs = function evaluateArgs(args){var evaledArgs=this.frame.setArgs(args.evaluate(this));this.frame.setOperand(evaledArgs.positional.at(0));};VM.prototype.bindPositionalArgs = function bindPositionalArgs(symbols){var args=_glimmerUtil.expect(this.frame.getArgs(),'bindPositionalArgs assumes a previous setArgs');var positional=args.positional;var scope=this.scope();for(var i=0;i < symbols.length;i++) {scope.bindSymbol(symbols[i],positional.at(i));}};VM.prototype.bindNamedArgs = function bindNamedArgs(names,symbols){var args=_glimmerUtil.expect(this.frame.getArgs(),'bindNamedArgs assumes a previous setArgs');var scope=this.scope();var named=args.named;for(var i=0;i < names.length;i++) {var _name2=this.constants.getString(names[i]);scope.bindSymbol(symbols[i],named.get(_name2));}};VM.prototype.bindBlocks = function bindBlocks(names,symbols){var blocks=this.frame.getBlocks();var scope=this.scope();for(var i=0;i < names.length;i++) {var _name3=this.constants.getString(names[i]);scope.bindBlock(symbols[i],blocks && blocks[_name3] || null);}};VM.prototype.bindPartialArgs = function bindPartialArgs(symbol){var args=_glimmerUtil.expect(this.frame.getArgs(),'bindPartialArgs assumes a previous setArgs');var scope=this.scope();_glimmerUtil.assert(args,"Cannot bind named args");scope.bindPartialArgs(symbol,args);};VM.prototype.bindCallerScope = function bindCallerScope(){var callerScope=this.frame.getCallerScope();var scope=this.scope();_glimmerUtil.assert(callerScope,"Cannot bind caller scope");scope.bindCallerScope(callerScope);};VM.prototype.bindDynamicScope = function bindDynamicScope(names){var args=_glimmerUtil.expect(this.frame.getArgs(),'bindDynamicScope assumes a previous setArgs');var scope=this.dynamicScope();_glimmerUtil.assert(args,"Cannot bind dynamic scope");for(var i=0;i < names.length;i++) {var _name4=this.constants.getString(names[i]);scope.set(_name4,args.named.get(_name4));}};return VM;})();var UpdatingVM=(function(){function UpdatingVM(env,_ref29){var _ref29$alwaysRevalidate=_ref29.alwaysRevalidate;var alwaysRevalidate=_ref29$alwaysRevalidate === undefined?false:_ref29$alwaysRevalidate;this.frameStack = new _glimmerUtil.Stack();this.env = env;this.constants = env.constants;this.dom = env.getDOM();this.alwaysRevalidate = alwaysRevalidate;}UpdatingVM.prototype.execute = function execute(opcodes,handler){var frameStack=this.frameStack;this.try(opcodes,handler);while(true) {if(frameStack.isEmpty())break;var opcode=this.frame.nextStatement();if(opcode === null){this.frameStack.pop();continue;}_glimmerUtil.LOGGER.debug('[VM] OP ' + opcode.type);_glimmerUtil.LOGGER.trace(opcode);opcode.evaluate(this);}};UpdatingVM.prototype.goto = function goto(op){this.frame.goto(op);};UpdatingVM.prototype.try = function _try(ops,handler){this.frameStack.push(new UpdatingVMFrame(this,ops,handler));};UpdatingVM.prototype.throw = function _throw(){this.frame.handleException();this.frameStack.pop();};UpdatingVM.prototype.evaluateOpcode = function evaluateOpcode(opcode){opcode.evaluate(this);};babelHelpers.createClass(UpdatingVM,[{key:'frame',get:function(){return _glimmerUtil.expect(this.frameStack.current,'bug: expected a frame');}}]);return UpdatingVM;})();var BlockOpcode=(function(_UpdatingOpcode8){babelHelpers.inherits(BlockOpcode,_UpdatingOpcode8);function BlockOpcode(ops,state,bounds,children){_UpdatingOpcode8.call(this);this.ops = ops;this.type = "block";this.next = null;this.prev = null;var env=state.env;var scope=state.scope;var dynamicScope=state.dynamicScope;var frame=state.frame;this.children = children;this.env = env;this.scope = scope;this.dynamicScope = dynamicScope;this.frame = frame;this.bounds = bounds;}BlockOpcode.prototype.parentElement = function parentElement(){return this.bounds.parentElement();};BlockOpcode.prototype.firstNode = function firstNode(){return this.bounds.firstNode();};BlockOpcode.prototype.lastNode = function lastNode(){return this.bounds.lastNode();};BlockOpcode.prototype.evaluate = function evaluate(vm){vm.try(this.children,null);};BlockOpcode.prototype.destroy = function destroy(){this.bounds.destroy();};BlockOpcode.prototype.didDestroy = function didDestroy(){this.env.didDestroy(this.bounds);};BlockOpcode.prototype.toJSON = function toJSON(){var details=_glimmerUtil.dict();details["guid"] = '' + this._guid;return {guid:this._guid,type:this.type,details:details,children:this.children.toArray().map(function(op){return op.toJSON();})};};return BlockOpcode;})(UpdatingOpcode);var TryOpcode=(function(_BlockOpcode){babelHelpers.inherits(TryOpcode,_BlockOpcode);function TryOpcode(ops,state,bounds,children){_BlockOpcode.call(this,ops,state,bounds,children);this.type = "try";this.tag = this._tag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG);}TryOpcode.prototype.didInitializeChildren = function didInitializeChildren(){this._tag.update(_glimmerReference.combineSlice(this.children));};TryOpcode.prototype.evaluate = function evaluate(vm){vm.try(this.children,this);};TryOpcode.prototype.handleException = function handleException(){var env=this.env;var scope=this.scope;var ops=this.ops;var dynamicScope=this.dynamicScope;var frame=this.frame;var elementStack=ElementStack.resume(this.env,this.bounds,this.bounds.reset(env));var vm=new VM(env,scope,dynamicScope,elementStack);var result=vm.resume(ops,frame);this.children = result.opcodes();this.didInitializeChildren();};TryOpcode.prototype.toJSON = function toJSON(){var json=_BlockOpcode.prototype.toJSON.call(this);var details=json["details"];if(!details){details = json["details"] = {};}return _BlockOpcode.prototype.toJSON.call(this);};return TryOpcode;})(BlockOpcode);var ListRevalidationDelegate=(function(){function ListRevalidationDelegate(opcode,marker){this.opcode = opcode;this.marker = marker;this.didInsert = false;this.didDelete = false;this.map = opcode.map;this.updating = opcode['children'];}ListRevalidationDelegate.prototype.insert = function insert(key,item,memo,before){var map=this.map;var opcode=this.opcode;var updating=this.updating;var nextSibling=null;var reference=null;if(before){reference = map[before];nextSibling = reference['bounds'].firstNode();}else {nextSibling = this.marker;}var vm=opcode.vmForInsertion(nextSibling);var tryOpcode=null;vm.execute(opcode.ops,function(vm){vm.frame.setArgs(EvaluatedArgs.positional([item,memo]));vm.frame.setOperand(item);vm.frame.setCondition(new _glimmerReference.ConstReference(true));vm.frame.setKey(key);var state=vm.capture();var tracker=vm.stack().pushUpdatableBlock();tryOpcode = new TryOpcode(opcode.ops,state,tracker,vm.updating());});tryOpcode.didInitializeChildren();updating.insertBefore(tryOpcode,reference);map[key] = tryOpcode;this.didInsert = true;};ListRevalidationDelegate.prototype.retain = function retain(_key,_item,_memo){};ListRevalidationDelegate.prototype.move = function move(key,_item,_memo,before){var map=this.map;var updating=this.updating;var entry=map[key];var reference=map[before] || null;if(before){moveBounds(entry,reference.firstNode());}else {moveBounds(entry,this.marker);}updating.remove(entry);updating.insertBefore(entry,reference);};ListRevalidationDelegate.prototype.delete = function _delete(key){var map=this.map;var opcode=map[key];opcode.didDestroy();clear(opcode);this.updating.remove(opcode);delete map[key];this.didDelete = true;};ListRevalidationDelegate.prototype.done = function done(){this.opcode.didInitializeChildren(this.didInsert || this.didDelete);};return ListRevalidationDelegate;})();var ListBlockOpcode=(function(_BlockOpcode2){babelHelpers.inherits(ListBlockOpcode,_BlockOpcode2);function ListBlockOpcode(ops,state,bounds,children,artifacts){_BlockOpcode2.call(this,ops,state,bounds,children);this.type = "list-block";this.map = _glimmerUtil.dict();this.lastIterated = _glimmerReference.INITIAL;this.artifacts = artifacts;var _tag=this._tag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG);this.tag = _glimmerReference.combine([artifacts.tag,_tag]);}ListBlockOpcode.prototype.didInitializeChildren = function didInitializeChildren(){var listDidChange=arguments.length <= 0 || arguments[0] === undefined?true:arguments[0];this.lastIterated = this.artifacts.tag.value();if(listDidChange){this._tag.update(_glimmerReference.combineSlice(this.children));}};ListBlockOpcode.prototype.evaluate = function evaluate(vm){var artifacts=this.artifacts;var lastIterated=this.lastIterated;if(!artifacts.tag.validate(lastIterated)){var bounds=this.bounds;var dom=vm.dom;var marker=dom.createComment('');dom.insertAfter(bounds.parentElement(),marker,_glimmerUtil.expect(bounds.lastNode(),"can't insert after an empty bounds"));var target=new ListRevalidationDelegate(this,marker);var synchronizer=new _glimmerReference.IteratorSynchronizer({target:target,artifacts:artifacts});synchronizer.sync();this.parentElement().removeChild(marker);} // Run now-updated updating opcodes +_BlockOpcode2.prototype.evaluate.call(this,vm);};ListBlockOpcode.prototype.vmForInsertion = function vmForInsertion(nextSibling){var env=this.env;var scope=this.scope;var dynamicScope=this.dynamicScope;var elementStack=ElementStack.forInitialRender(this.env,this.bounds.parentElement(),nextSibling);return new VM(env,scope,dynamicScope,elementStack);};ListBlockOpcode.prototype.toJSON = function toJSON(){var json=_BlockOpcode2.prototype.toJSON.call(this);var map=this.map;var inner=Object.keys(map).map(function(key){return JSON.stringify(key) + ': ' + map[key]._guid;}).join(", ");var details=json["details"];if(!details){details = json["details"] = {};}details["map"] = '{' + inner + '}';return json;};return ListBlockOpcode;})(BlockOpcode);var UpdatingVMFrame=(function(){function UpdatingVMFrame(vm,ops,exceptionHandler){this.vm = vm;this.ops = ops;this.exceptionHandler = exceptionHandler;this.vm = vm;this.ops = ops;this.current = ops.head();}UpdatingVMFrame.prototype.goto = function goto(op){this.current = op;};UpdatingVMFrame.prototype.nextStatement = function nextStatement(){var current=this.current;var ops=this.ops;if(current)this.current = ops.nextNode(current);return current;};UpdatingVMFrame.prototype.handleException = function handleException(){if(this.exceptionHandler){this.exceptionHandler.handleException();}};return UpdatingVMFrame;})();var CompiledBlock=function CompiledBlock(slice){this.start = slice[0];this.end = slice[1];this.slice = slice;};var CompiledProgram=(function(_CompiledBlock){babelHelpers.inherits(CompiledProgram,_CompiledBlock);function CompiledProgram(slice,symbols){_CompiledBlock.call(this,slice);this.symbols = symbols;}return CompiledProgram;})(CompiledBlock);function entryPoint(meta){return new ProgramSymbolTable(meta);}function layout(meta,wireNamed,wireYields,hasPartials){var _symbols3=symbols(wireNamed,wireYields,hasPartials);var named=_symbols3.named;var yields=_symbols3.yields;var partialSymbol=_symbols3.partialSymbol;var size=_symbols3.size;return new ProgramSymbolTable(meta,named,yields,partialSymbol,size);}function block(parent,locals){var localsMap=null;var program=parent['program'];if(locals.length !== 0){(function(){var map=localsMap = _glimmerUtil.dict();locals.forEach(function(l){return map[l] = program.size++;});})();}return new BlockSymbolTable(parent,program,localsMap);}function symbols(named,yields,hasPartials){var yieldsMap=null;var namedMap=null;var size=1;if(yields.length !== 0){(function(){var map=yieldsMap = _glimmerUtil.dict();yields.forEach(function(y){return map[y] = size++;});})();}if(named.length !== 0){(function(){var map=namedMap = _glimmerUtil.dict();named.forEach(function(y){return map[y] = size++;});})();}var partialSymbol=hasPartials?size++:null;return {named:namedMap,yields:yieldsMap,partialSymbol:partialSymbol,size:size};}var ProgramSymbolTable=(function(){function ProgramSymbolTable(meta){var named=arguments.length <= 1 || arguments[1] === undefined?null:arguments[1];var yields=arguments.length <= 2 || arguments[2] === undefined?null:arguments[2];var partialArgs=arguments.length <= 3 || arguments[3] === undefined?null:arguments[3];var size=arguments.length <= 4 || arguments[4] === undefined?1:arguments[4];this.meta = meta;this.named = named;this.yields = yields;this.partialArgs = partialArgs;this.size = size;this.program = this;}ProgramSymbolTable.prototype.getMeta = function getMeta(){return this.meta;};ProgramSymbolTable.prototype.getSymbols = function getSymbols(){return {named:this.named,yields:this.yields,locals:null,partialArgs:this.partialArgs};};ProgramSymbolTable.prototype.getSymbol = function getSymbol(kind,name){if(kind === 'local')return null;return this[kind] && this[kind][name];};ProgramSymbolTable.prototype.getPartialArgs = function getPartialArgs(){return this.partialArgs || 0;};return ProgramSymbolTable;})();var BlockSymbolTable=(function(){function BlockSymbolTable(parent,program,locals){this.parent = parent;this.program = program;this.locals = locals;}BlockSymbolTable.prototype.getMeta = function getMeta(){return this.program.getMeta();};BlockSymbolTable.prototype.getSymbols = function getSymbols(){return {named:null,yields:null,locals:this.locals,partialArgs:null};};BlockSymbolTable.prototype.getSymbol = function getSymbol(kind,name){if(kind === 'local'){return this.getLocal(name);}else {return this.program.getSymbol(kind,name);}};BlockSymbolTable.prototype.getLocal = function getLocal(name){var locals=this.locals;var parent=this.parent;var symbol=locals && locals[name];if(!symbol && parent){symbol = parent.getSymbol('local',name);}return symbol;};BlockSymbolTable.prototype.getPartialArgs = function getPartialArgs(){return this.program.getPartialArgs();};return BlockSymbolTable;})();var Specialize=(function(){function Specialize(){this.names = _glimmerUtil.dict();this.funcs = [];}Specialize.prototype.add = function add(name,func){this.funcs.push(func);this.names[name] = this.funcs.length - 1;};Specialize.prototype.specialize = function specialize(sexp,table){var name=sexp[0];var index=this.names[name];if(index === undefined)return sexp;var func=this.funcs[index];_glimmerUtil.assert(!!func,'expected a specialization for ' + sexp[0]);return func(sexp,table);};return Specialize;})();var SPECIALIZE=new Specialize();var E=_glimmerWireFormat.Expressions;SPECIALIZE.add('append',function(sexp,_symbolTable){var path=sexp[1];if(Array.isArray(path) && (E.isUnknown(path) || E.isGet(path))){if(path[1].length !== 1){return ['unoptimized-append',sexp[1],sexp[2]];}}return ['optimized-append',sexp[1],sexp[2]];});SPECIALIZE.add('dynamic-attr',function(sexp,_symbolTable){return ['any-dynamic-attr',sexp[1],sexp[2],sexp[3],false];});SPECIALIZE.add('trusting-attr',function(sexp,_symbolTable){return ['any-dynamic-attr',sexp[1],sexp[2],sexp[3],true];});SPECIALIZE.add('partial',function(sexp,_table){var expression=sexp[1];if(typeof expression === 'string'){return ['static-partial',expression];}else {return ['dynamic-partial',expression];}});function compileStatement(statement,builder){var refined=SPECIALIZE.specialize(statement,builder.symbolTable);STATEMENTS.compile(refined,builder);}var Template=function Template(statements,symbolTable){this.statements = statements;this.symbolTable = symbolTable;};var Layout=(function(_Template){babelHelpers.inherits(Layout,_Template);function Layout(){_Template.apply(this,arguments);}return Layout;})(Template);var EntryPoint=(function(_Template2){babelHelpers.inherits(EntryPoint,_Template2);function EntryPoint(){_Template2.apply(this,arguments);}EntryPoint.prototype.compile = function compile(env){var table=this.symbolTable;var b=builder(env,table);for(var i=0;i < this.statements.length;i++) {var statement=this.statements[i];var refined=SPECIALIZE.specialize(statement,table);STATEMENTS.compile(refined,b);}return new CompiledProgram(b.toSlice(),this.symbolTable.size);};return EntryPoint;})(Template);var InlineBlock=(function(_Template3){babelHelpers.inherits(InlineBlock,_Template3);function InlineBlock(){_Template3.apply(this,arguments);}InlineBlock.prototype.splat = function splat(builder){var table=builder.symbolTable;var locals=table.getSymbols().locals;if(locals){builder.pushChildScope();builder.bindPositionalArgsForLocals(locals);}for(var i=0;i < this.statements.length;i++) {var statement=this.statements[i];var refined=SPECIALIZE.specialize(statement,table);STATEMENTS.compile(refined,builder);}if(locals){builder.popScope();}};InlineBlock.prototype.compile = function compile(env){var table=this.symbolTable;var b=builder(env,table);this.splat(b);return new CompiledBlock(b.toSlice());};return InlineBlock;})(Template);var PartialBlock=(function(_Template4){babelHelpers.inherits(PartialBlock,_Template4);function PartialBlock(){_Template4.apply(this,arguments);}PartialBlock.prototype.compile = function compile(env){var table=this.symbolTable;var b=builder(env,table);for(var i=0;i < this.statements.length;i++) {var statement=this.statements[i];var refined=SPECIALIZE.specialize(statement,table);STATEMENTS.compile(refined,b);}return new CompiledProgram(b.toSlice(),table.size);};return PartialBlock;})(Template);var Scanner=(function(){function Scanner(block,meta,env){this.block = block;this.meta = meta;this.env = env;}Scanner.prototype.scanEntryPoint = function scanEntryPoint(){var block=this.block;var meta=this.meta;var symbolTable=entryPoint(meta);var child=scanBlock(block,symbolTable,this.env);return new EntryPoint(child.statements,symbolTable);};Scanner.prototype.scanLayout = function scanLayout(){var block=this.block;var meta=this.meta;var named=block.named;var yields=block.yields;var hasPartials=block.hasPartials;var symbolTable=layout(meta,named,yields,hasPartials);var child=scanBlock(block,symbolTable,this.env);return new Layout(child.statements,symbolTable);};Scanner.prototype.scanPartial = function scanPartial(symbolTable){var block=this.block;var child=scanBlock(block,symbolTable,this.env);return new PartialBlock(child.statements,symbolTable);};return Scanner;})();function scanBlock(_ref30,symbolTable,env){var statements=_ref30.statements;return new RawInlineBlock(env,symbolTable,statements).scan();}var BaselineSyntax;(function(BaselineSyntax){BaselineSyntax.isScannedComponent = _glimmerWireFormat.is('scanned-component');BaselineSyntax.isPrimitiveElement = _glimmerWireFormat.is('open-primitive-element');BaselineSyntax.isOptimizedAppend = _glimmerWireFormat.is('optimized-append');BaselineSyntax.isUnoptimizedAppend = _glimmerWireFormat.is('unoptimized-append');BaselineSyntax.isAnyAttr = _glimmerWireFormat.is('any-dynamic-attr');BaselineSyntax.isStaticPartial = _glimmerWireFormat.is('static-partial');BaselineSyntax.isDynamicPartial = _glimmerWireFormat.is('dynamic-partial');BaselineSyntax.isFunctionExpression = _glimmerWireFormat.is('function');BaselineSyntax.isNestedBlock = _glimmerWireFormat.is('nested-block');BaselineSyntax.isScannedBlock = _glimmerWireFormat.is('scanned-block');BaselineSyntax.isDebugger = _glimmerWireFormat.is('debugger');var NestedBlock;(function(NestedBlock){function defaultBlock(sexp){return sexp[4];}NestedBlock.defaultBlock = defaultBlock;function inverseBlock(sexp){return sexp[5];}NestedBlock.inverseBlock = inverseBlock;function params(sexp){return sexp[2];}NestedBlock.params = params;function hash(sexp){return sexp[3];}NestedBlock.hash = hash;})(NestedBlock = BaselineSyntax.NestedBlock || (BaselineSyntax.NestedBlock = {}));})(BaselineSyntax || (exports.BaselineSyntax = BaselineSyntax = {}));var RawInlineBlock=(function(){function RawInlineBlock(env,table,statements){this.env = env;this.table = table;this.statements = statements;}RawInlineBlock.prototype.scan = function scan(){var buffer=[];for(var i=0;i < this.statements.length;i++) {var statement=this.statements[i];if(_glimmerWireFormat.Statements.isBlock(statement)){buffer.push(this.specializeBlock(statement));}else if(_glimmerWireFormat.Statements.isComponent(statement)){buffer.push.apply(buffer,this.specializeComponent(statement));}else {buffer.push(statement);}}return new InlineBlock(buffer,this.table);};RawInlineBlock.prototype.specializeBlock = function specializeBlock(block$$){var path=block$$[1];var params=block$$[2];var hash=block$$[3];var template=block$$[4];var inverse=block$$[5];return ['scanned-block',path,params,hash,this.child(template),this.child(inverse)];};RawInlineBlock.prototype.specializeComponent = function specializeComponent(sexp){var tag=sexp[1];var component=sexp[2];if(this.env.hasComponentDefinition([tag],this.table)){var child=this.child(component);var attrs=new RawInlineBlock(this.env,this.table,component.attrs);return [['scanned-component',tag,attrs,component.args,child]];}else {var buf=[];buf.push(['open-element',tag,[]]);buf.push.apply(buf,component.attrs);buf.push(['flush-element']);buf.push.apply(buf,component.statements);buf.push(['close-element']);return buf;}};RawInlineBlock.prototype.child = function child(block$$){if(!block$$)return null;var table=block(this.table,block$$.locals);return new RawInlineBlock(this.env,table,block$$.statements);};return RawInlineBlock;})();function compileLayout(compilable,env){var builder=new ComponentLayoutBuilder(env);compilable.compile(builder);return builder.compile();}var ComponentLayoutBuilder=(function(){function ComponentLayoutBuilder(env){this.env = env;}ComponentLayoutBuilder.prototype.wrapLayout = function wrapLayout(layout){this.inner = new WrappedBuilder(this.env,layout);};ComponentLayoutBuilder.prototype.fromLayout = function fromLayout(layout){this.inner = new UnwrappedBuilder(this.env,layout);};ComponentLayoutBuilder.prototype.compile = function compile(){return this.inner.compile();};babelHelpers.createClass(ComponentLayoutBuilder,[{key:'tag',get:function(){return this.inner.tag;}},{key:'attrs',get:function(){return this.inner.attrs;}}]);return ComponentLayoutBuilder;})();var WrappedBuilder=(function(){function WrappedBuilder(env,layout){this.env = env;this.layout = layout;this.tag = new ComponentTagBuilder();this.attrs = new ComponentAttrsBuilder();}WrappedBuilder.prototype.compile = function compile(){ //========DYNAMIC +// PutValue(TagExpr) +// Test +// JumpUnless(BODY) +// OpenDynamicPrimitiveElement +// DidCreateElement +// ...attr statements... +// FlushElement +// BODY: Noop +// ...body statements... +// PutValue(TagExpr) +// Test +// JumpUnless(END) +// CloseElement +// END: Noop +// DidRenderLayout +// Exit +// +//========STATIC +// OpenPrimitiveElementOpcode +// DidCreateElement +// ...attr statements... +// FlushElement +// ...body statements... +// CloseElement +// DidRenderLayout +// Exit +var env=this.env;var layout=this.layout;var symbolTable=layout.symbolTable;var b=builder(env,layout.symbolTable);b.startLabels();var dynamicTag=this.tag.getDynamic();var staticTag=undefined;if(dynamicTag){b.putValue(dynamicTag);b.test('simple');b.jumpUnless('BODY');b.openDynamicPrimitiveElement();b.didCreateElement();this.attrs['buffer'].forEach(function(statement){return compileStatement(statement,b);});b.flushElement();b.label('BODY');}else if(staticTag = this.tag.getStatic()){b.openPrimitiveElement(staticTag);b.didCreateElement();this.attrs['buffer'].forEach(function(statement){return compileStatement(statement,b);});b.flushElement();}b.preludeForLayout(layout);layout.statements.forEach(function(statement){return compileStatement(statement,b);});if(dynamicTag){b.putValue(dynamicTag);b.test('simple');b.jumpUnless('END');b.closeElement();b.label('END');}else if(staticTag){b.closeElement();}b.didRenderLayout();b.stopLabels();return new CompiledProgram(b.toSlice(),symbolTable.size);};return WrappedBuilder;})();function isOpenElement(value){var type=value[0];return type === 'open-element' || type === 'open-primitive-element';}var UnwrappedBuilder=(function(){function UnwrappedBuilder(env,layout){this.env = env;this.layout = layout;this.attrs = new ComponentAttrsBuilder();}UnwrappedBuilder.prototype.compile = function compile(){var env=this.env;var layout=this.layout;var b=builder(env,layout.symbolTable);b.startLabels();b.preludeForLayout(layout);var attrs=this.attrs['buffer'];var attrsInserted=false;for(var i=0;i < layout.statements.length;i++) {var statement=layout.statements[i];if(!attrsInserted && isOpenElement(statement)){b.openComponentElement(statement[1]);b.didCreateElement();b.shadowAttributes();attrs.forEach(function(statement){return compileStatement(statement,b);});attrsInserted = true;}else {compileStatement(statement,b);}}b.didRenderLayout();b.stopLabels();return new CompiledProgram(b.toSlice(),layout.symbolTable.size);};babelHelpers.createClass(UnwrappedBuilder,[{key:'tag',get:function(){throw new Error('BUG: Cannot call `tag` on an UnwrappedBuilder');}}]);return UnwrappedBuilder;})();var ComponentTagBuilder=(function(){function ComponentTagBuilder(){this.isDynamic = null;this.isStatic = null;this.staticTagName = null;this.dynamicTagName = null;}ComponentTagBuilder.prototype.getDynamic = function getDynamic(){if(this.isDynamic){return this.dynamicTagName;}};ComponentTagBuilder.prototype.getStatic = function getStatic(){if(this.isStatic){return this.staticTagName;}};ComponentTagBuilder.prototype.static = function _static(tagName){this.isStatic = true;this.staticTagName = tagName;};ComponentTagBuilder.prototype.dynamic = function dynamic(tagName){this.isDynamic = true;this.dynamicTagName = ['function',tagName];};return ComponentTagBuilder;})();var ComponentAttrsBuilder=(function(){function ComponentAttrsBuilder(){this.buffer = [];}ComponentAttrsBuilder.prototype.static = function _static(name,value){this.buffer.push(['static-attr',name,value,null]);};ComponentAttrsBuilder.prototype.dynamic = function dynamic(name,value){this.buffer.push(['dynamic-attr',name,['function',value],null]);};return ComponentAttrsBuilder;})();var ComponentBuilder=(function(){function ComponentBuilder(builder){this.builder = builder;this.env = builder.env;}ComponentBuilder.prototype.static = function _static(definition,args,_symbolTable,shadow){this.builder.unit(function(b){b.putComponentDefinition(definition);b.openComponent(compileBaselineArgs(args,b),shadow);b.closeComponent();});};ComponentBuilder.prototype.dynamic = function dynamic(definitionArgs,definition,args,_symbolTable,shadow){this.builder.unit(function(b){b.putArgs(compileArgs(definitionArgs[0],definitionArgs[1],b));b.putValue(['function',definition]);b.test('simple');b.enter('BEGIN','END');b.label('BEGIN');b.jumpUnless('END');b.putDynamicComponentDefinition();b.openComponent(compileBaselineArgs(args,b),shadow);b.closeComponent();b.label('END');b.exit();});};return ComponentBuilder;})();function builder(env,symbolTable){return new OpcodeBuilder(symbolTable,env);}function appendOpcode(name,op1,op2,op3){return APPEND_OPCODES.construct(name,null,op1,op2,op3);}var Labels=(function(){function Labels(){this.labels = _glimmerUtil.dict();this.jumps = [];this.ranges = [];}Labels.prototype.label = function label(name,index){this.labels[name] = index;};Labels.prototype.jump = function jump(at,Target,target){this.jumps.push({at:at,target:target,Target:Target});};Labels.prototype.range = function range(at,Range,start,end){this.ranges.push({at:at,start:start,end:end,Range:Range});};Labels.prototype.patch = function patch(constants,opcodes){for(var i=0;i < this.jumps.length;i++) {var _jumps$i=this.jumps[i];var at=_jumps$i.at;var target=_jumps$i.target;var Target=_jumps$i.Target;opcodes.set(at,APPEND_OPCODES.construct(Target,null,this.labels[target]));}for(var i=0;i < this.ranges.length;i++) {var _ranges$i=this.ranges[i];var at=_ranges$i.at;var start=_ranges$i.start;var end=_ranges$i.end;var _Range=_ranges$i.Range;var slice=constants.slice([this.labels[start],this.labels[end] - 1]);opcodes.set(at,APPEND_OPCODES.construct(_Range,null,slice));}};return Labels;})();var BasicOpcodeBuilder=(function(){function BasicOpcodeBuilder(symbolTable,env,program){this.symbolTable = symbolTable;this.env = env;this.program = program;this.labelsStack = new _glimmerUtil.Stack();this.constants = env.constants;this.start = program.next;}BasicOpcodeBuilder.prototype.opcode = function opcode(name,op1,op2,op3){this.push(appendOpcode(name,op1,op2,op3));};BasicOpcodeBuilder.prototype.push = function push(op){ // console.log(`pushing ${op && op.type}`); +if(op === null){this.program.push([0,0,0,0]);}else {this.program.push(op);}};BasicOpcodeBuilder.prototype.toSlice = function toSlice(){return [this.start,this.program.current];}; // helpers +BasicOpcodeBuilder.prototype.startLabels = function startLabels(){this.labelsStack.push(new Labels());};BasicOpcodeBuilder.prototype.stopLabels = function stopLabels(){var label=_glimmerUtil.expect(this.labelsStack.pop(),'unbalanced push and pop labels');label.patch(this.constants,this.program);}; // partials +BasicOpcodeBuilder.prototype.putPartialDefinition = function putPartialDefinition(_definition){var definition=this.constants.other(_definition);this.opcode(50, /* PutPartial */definition);};BasicOpcodeBuilder.prototype.putDynamicPartialDefinition = function putDynamicPartialDefinition(){this.opcode(49, /* PutDynamicPartial */this.constants.other(this.symbolTable));};BasicOpcodeBuilder.prototype.evaluatePartial = function evaluatePartial(){this.opcode(51, /* EvaluatePartial */this.constants.other(this.symbolTable),this.constants.other(_glimmerUtil.dict()));}; // components +BasicOpcodeBuilder.prototype.putComponentDefinition = function putComponentDefinition(definition){this.opcode(23, /* PutComponent */this.other(definition));};BasicOpcodeBuilder.prototype.putDynamicComponentDefinition = function putDynamicComponentDefinition(){this.opcode(22 /* PutDynamicComponent */);};BasicOpcodeBuilder.prototype.openComponent = function openComponent(args,shadow){this.opcode(24, /* OpenComponent */this.args(args),shadow?this.block(shadow):0);};BasicOpcodeBuilder.prototype.didCreateElement = function didCreateElement(){this.opcode(25 /* DidCreateElement */);};BasicOpcodeBuilder.prototype.shadowAttributes = function shadowAttributes(){this.opcode(26 /* ShadowAttributes */);this.opcode(21 /* CloseBlock */);};BasicOpcodeBuilder.prototype.didRenderLayout = function didRenderLayout(){this.opcode(27 /* DidRenderLayout */);};BasicOpcodeBuilder.prototype.closeComponent = function closeComponent(){this.opcode(28 /* CloseComponent */);}; // content +BasicOpcodeBuilder.prototype.dynamicContent = function dynamicContent(Opcode){this.opcode(31, /* DynamicContent */this.other(Opcode));};BasicOpcodeBuilder.prototype.cautiousAppend = function cautiousAppend(){this.dynamicContent(new OptimizedCautiousAppendOpcode());};BasicOpcodeBuilder.prototype.trustingAppend = function trustingAppend(){this.dynamicContent(new OptimizedTrustingAppendOpcode());};BasicOpcodeBuilder.prototype.guardedCautiousAppend = function guardedCautiousAppend(expression){this.dynamicContent(new GuardedCautiousAppendOpcode(this.compileExpression(expression),this.symbolTable));};BasicOpcodeBuilder.prototype.guardedTrustingAppend = function guardedTrustingAppend(expression){this.dynamicContent(new GuardedTrustingAppendOpcode(this.compileExpression(expression),this.symbolTable));}; // dom +BasicOpcodeBuilder.prototype.text = function text(_text){this.opcode(29, /* Text */this.constants.string(_text));};BasicOpcodeBuilder.prototype.openPrimitiveElement = function openPrimitiveElement(tag){this.opcode(32, /* OpenElement */this.constants.string(tag));};BasicOpcodeBuilder.prototype.openComponentElement = function openComponentElement(tag){this.opcode(35, /* OpenComponentElement */this.constants.string(tag));};BasicOpcodeBuilder.prototype.openDynamicPrimitiveElement = function openDynamicPrimitiveElement(){this.opcode(36 /* OpenDynamicElement */);};BasicOpcodeBuilder.prototype.flushElement = function flushElement(){this.opcode(37 /* FlushElement */);};BasicOpcodeBuilder.prototype.closeElement = function closeElement(){this.opcode(38 /* CloseElement */);};BasicOpcodeBuilder.prototype.staticAttr = function staticAttr(_name,_namespace,_value){var name=this.constants.string(_name);var namespace=_namespace?this.constants.string(_namespace):0;var value=this.constants.string(_value);this.opcode(40, /* StaticAttr */name,value,namespace);};BasicOpcodeBuilder.prototype.dynamicAttrNS = function dynamicAttrNS(_name,_namespace,trusting){var name=this.constants.string(_name);var namespace=this.constants.string(_namespace);this.opcode(42, /* DynamicAttrNS */name,namespace,trusting | 0);};BasicOpcodeBuilder.prototype.dynamicAttr = function dynamicAttr(_name,trusting){var name=this.constants.string(_name);this.opcode(43, /* DynamicAttr */name,trusting | 0);};BasicOpcodeBuilder.prototype.comment = function comment(_comment){var comment=this.constants.string(_comment);this.opcode(30, /* Comment */comment);};BasicOpcodeBuilder.prototype.modifier = function modifier(_name,_args){var args=this.constants.expression(this.compile(_args));var _modifierManager=this.env.lookupModifier([_name],this.symbolTable);var modifierManager=this.constants.other(_modifierManager);var name=this.constants.string(_name);this.opcode(41, /* Modifier */name,modifierManager,args);}; // lists +BasicOpcodeBuilder.prototype.putIterator = function putIterator(){this.opcode(44 /* PutIterator */);};BasicOpcodeBuilder.prototype.enterList = function enterList(start,end){this.push(null);this.labels.range(this.pos,45, /* EnterList */start,end);};BasicOpcodeBuilder.prototype.exitList = function exitList(){this.opcode(46 /* ExitList */);};BasicOpcodeBuilder.prototype.enterWithKey = function enterWithKey(start,end){this.push(null);this.labels.range(this.pos,47, /* EnterWithKey */start,end);};BasicOpcodeBuilder.prototype.nextIter = function nextIter(end){this.push(null);this.labels.jump(this.pos,48, /* NextIter */end);}; // vm +BasicOpcodeBuilder.prototype.openBlock = function openBlock(_args,_inner){var args=this.constants.expression(this.compile(_args));var inner=this.constants.other(_inner);this.opcode(20, /* OpenBlock */inner,args);};BasicOpcodeBuilder.prototype.closeBlock = function closeBlock(){this.opcode(21 /* CloseBlock */);};BasicOpcodeBuilder.prototype.pushRemoteElement = function pushRemoteElement(){this.opcode(33 /* PushRemoteElement */);};BasicOpcodeBuilder.prototype.popRemoteElement = function popRemoteElement(){this.opcode(34 /* PopRemoteElement */);};BasicOpcodeBuilder.prototype.popElement = function popElement(){this.opcode(39 /* PopElement */);};BasicOpcodeBuilder.prototype.label = function label(name){this.labels.label(name,this.nextPos);};BasicOpcodeBuilder.prototype.pushChildScope = function pushChildScope(){this.opcode(0 /* PushChildScope */);};BasicOpcodeBuilder.prototype.popScope = function popScope(){this.opcode(1 /* PopScope */);};BasicOpcodeBuilder.prototype.pushDynamicScope = function pushDynamicScope(){this.opcode(2 /* PushDynamicScope */);};BasicOpcodeBuilder.prototype.popDynamicScope = function popDynamicScope(){this.opcode(3 /* PopDynamicScope */);};BasicOpcodeBuilder.prototype.putNull = function putNull(){this.opcode(4, /* Put */this.constants.NULL_REFERENCE);};BasicOpcodeBuilder.prototype.putValue = function putValue(_expression){var expr=this.constants.expression(this.compileExpression(_expression));this.opcode(5, /* EvaluatePut */expr);};BasicOpcodeBuilder.prototype.putArgs = function putArgs(_args){var args=this.constants.expression(this.compile(_args));this.opcode(6, /* PutArgs */args);};BasicOpcodeBuilder.prototype.bindDynamicScope = function bindDynamicScope(_names){this.opcode(12, /* BindDynamicScope */this.names(_names));};BasicOpcodeBuilder.prototype.bindPositionalArgs = function bindPositionalArgs(_names,_symbols){this.opcode(7, /* BindPositionalArgs */this.names(_names),this.symbols(_symbols));};BasicOpcodeBuilder.prototype.bindNamedArgs = function bindNamedArgs(_names,_symbols){this.opcode(8, /* BindNamedArgs */this.names(_names),this.symbols(_symbols));};BasicOpcodeBuilder.prototype.bindBlocks = function bindBlocks(_names,_symbols){this.opcode(9, /* BindBlocks */this.names(_names),this.symbols(_symbols));};BasicOpcodeBuilder.prototype.enter = function enter(_enter,exit){this.push(null);this.labels.range(this.pos,13, /* Enter */_enter,exit);};BasicOpcodeBuilder.prototype.exit = function exit(){this.opcode(14 /* Exit */);};BasicOpcodeBuilder.prototype.evaluate = function evaluate(_block){var block=this.constants.block(_block);this.opcode(15, /* Evaluate */block);};BasicOpcodeBuilder.prototype.test = function test(testFunc){var _func=undefined;if(testFunc === 'const'){_func = ConstTest;}else if(testFunc === 'simple'){_func = SimpleTest;}else if(testFunc === 'environment'){_func = EnvironmentTest;}else if(typeof testFunc === 'function'){_func = testFunc;}else {throw new Error('unreachable');}var func=this.constants.function(_func);this.opcode(19, /* Test */func);};BasicOpcodeBuilder.prototype.jump = function jump(target){this.push(null);this.labels.jump(this.pos,16, /* Jump */target);};BasicOpcodeBuilder.prototype.jumpIf = function jumpIf(target){this.push(null);this.labels.jump(this.pos,17, /* JumpIf */target);};BasicOpcodeBuilder.prototype.jumpUnless = function jumpUnless(target){this.push(null);this.labels.jump(this.pos,18, /* JumpUnless */target);};BasicOpcodeBuilder.prototype.names = function names(_names){var _this=this;var names=_names.map(function(n){return _this.constants.string(n);});return this.constants.array(names);};BasicOpcodeBuilder.prototype.symbols = function symbols(_symbols2){return this.constants.array(_symbols2);};BasicOpcodeBuilder.prototype.other = function other(value){return this.constants.other(value);};BasicOpcodeBuilder.prototype.args = function args(_args2){return this.constants.expression(this.compile(_args2));};BasicOpcodeBuilder.prototype.block = function block(_block3){return this.constants.block(_block3);};babelHelpers.createClass(BasicOpcodeBuilder,[{key:'pos',get:function(){return this.program.current;}},{key:'nextPos',get:function(){return this.program.next;}},{key:'labels',get:function(){return _glimmerUtil.expect(this.labelsStack.current,'bug: not in a label stack');}}]);return BasicOpcodeBuilder;})();function isCompilableExpression(expr){return expr && typeof expr['compile'] === 'function';}var OpcodeBuilder=(function(_BasicOpcodeBuilder){babelHelpers.inherits(OpcodeBuilder,_BasicOpcodeBuilder);function OpcodeBuilder(symbolTable,env){var program=arguments.length <= 2 || arguments[2] === undefined?env.program:arguments[2];return (function(){_BasicOpcodeBuilder.call(this,symbolTable,env,program);this.component = new ComponentBuilder(this);}).apply(this,arguments);}OpcodeBuilder.prototype.compile = function compile(expr){if(isCompilableExpression(expr)){return expr.compile(this);}else {return expr;}};OpcodeBuilder.prototype.compileExpression = function compileExpression(expression){if(expression instanceof CompiledExpression){return expression;}else {return expr(expression,this);}};OpcodeBuilder.prototype.bindPositionalArgsForLocals = function bindPositionalArgsForLocals(locals){var symbols=Object.keys(locals).map(function(name){return locals[name];});this.opcode(7, /* BindPositionalArgs */this.symbols(symbols));};OpcodeBuilder.prototype.preludeForLayout = function preludeForLayout(layout){var _this2=this;var symbols=layout.symbolTable.getSymbols();if(symbols.named){(function(){var named=symbols.named;var namedNames=Object.keys(named);var namedSymbols=namedNames.map(function(n){return named[n];});_this2.opcode(8, /* BindNamedArgs */_this2.names(namedNames),_this2.symbols(namedSymbols));})();}this.opcode(11 /* BindCallerScope */);if(symbols.yields){(function(){var yields=symbols.yields;var yieldNames=Object.keys(yields);var yieldSymbols=yieldNames.map(function(n){return yields[n];});_this2.opcode(9, /* BindBlocks */_this2.names(yieldNames),_this2.symbols(yieldSymbols));})();}if(symbols.partialArgs){this.opcode(10, /* BindPartialArgs */symbols.partialArgs);}};OpcodeBuilder.prototype.yield = function _yield(args,to){var yields=undefined,partial=undefined;var inner=undefined;if(yields = this.symbolTable.getSymbol('yields',to)){inner = new CompiledGetBlockBySymbol(yields,to);}else if(partial = this.symbolTable.getPartialArgs()){inner = new CompiledInPartialGetBlock(partial,to);}else {throw new Error('[BUG] ${to} is not a valid block name.');}this.openBlock(args,inner);this.closeBlock();}; // TODO +// come back to this +OpcodeBuilder.prototype.labelled = function labelled(args,callback){if(args)this.putArgs(args);this.startLabels();this.enter('BEGIN','END');this.label('BEGIN');callback(this,'BEGIN','END');this.label('END');this.exit();this.stopLabels();}; // TODO +// come back to this +OpcodeBuilder.prototype.iter = function iter(callback){this.startLabels();this.enterList('BEGIN','END');this.label('ITER');this.nextIter('BREAK');this.enterWithKey('BEGIN','END');this.label('BEGIN');callback(this,'BEGIN','END');this.label('END');this.exit();this.jump('ITER');this.label('BREAK');this.exitList();this.stopLabels();}; // TODO +// come back to this +OpcodeBuilder.prototype.unit = function unit(callback){this.startLabels();callback(this);this.stopLabels();};return OpcodeBuilder;})(BasicOpcodeBuilder);APPEND_OPCODES.add(31, /* DynamicContent */function(vm,_ref31){var append=_ref31.op1;var opcode=vm.constants.getOther(append);opcode.evaluate(vm);});function isEmpty(value){return value === null || value === undefined || typeof value['toString'] !== 'function';}function normalizeTextValue(value){if(isEmpty(value)){return '';}return String(value);}function normalizeTrustedValue(value){if(isEmpty(value)){return '';}if(isString(value)){return value;}if(isSafeString(value)){return value.toHTML();}if(isNode(value)){return value;}return String(value);}function normalizeValue(value){if(isEmpty(value)){return '';}if(isString(value)){return value;}if(isSafeString(value) || isNode(value)){return value;}return String(value);}var AppendDynamicOpcode=(function(){function AppendDynamicOpcode(){}AppendDynamicOpcode.prototype.evaluate = function evaluate(vm){var reference=vm.frame.getOperand();var normalized=this.normalize(reference);var value=undefined,cache=undefined;if(_glimmerReference.isConst(reference)){value = normalized.value();}else {cache = new _glimmerReference.ReferenceCache(normalized);value = cache.peek();}var stack=vm.stack();var upsert=this.insert(vm.env.getAppendOperations(),stack,value);var bounds=new Fragment(upsert.bounds);stack.newBounds(bounds);if(cache /* i.e. !isConst(reference) */){vm.updateWith(this.updateWith(vm,reference,cache,bounds,upsert));}};return AppendDynamicOpcode;})();var GuardedAppendOpcode=(function(_AppendDynamicOpcode){babelHelpers.inherits(GuardedAppendOpcode,_AppendDynamicOpcode);function GuardedAppendOpcode(expression,symbolTable){_AppendDynamicOpcode.call(this);this.expression = expression;this.symbolTable = symbolTable;this.deopted = null;}GuardedAppendOpcode.prototype.evaluate = function evaluate(vm){if(this.deopted){vm.pushEvalFrame(this.deopted);}else {vm.evaluateOperand(this.expression);var value=vm.frame.getOperand().value();if(isComponentDefinition(value)){vm.pushEvalFrame(this.deopt(vm.env));}else {_AppendDynamicOpcode.prototype.evaluate.call(this,vm);}}};GuardedAppendOpcode.prototype.deopt = function deopt(env){var _this3=this; // At compile time, we determined that this append callsite might refer +// to a local variable/property lookup that resolves to a component +// definition at runtime. +// +// We could have eagerly compiled this callsite into something like this: +// +// {{#if (is-component-definition foo)}} +// {{component foo}} +// {{else}} +// {{foo}} +// {{/if}} +// +// However, in practice, there might be a large amout of these callsites +// and most of them would resolve to a simple value lookup. Therefore, we +// tried to be optimistic and assumed that the callsite will resolve to +// appending a simple value. +// +// However, we have reached here because at runtime, the guard conditional +// have detected that this callsite is indeed referring to a component +// definition object. Since this is likely going to be true for other +// instances of the same callsite, it is now appropiate to deopt into the +// expanded version that handles both cases. The compilation would look +// like this: +// +// PutValue(expression) +// Test(is-component-definition) +// Enter(BEGIN, END) +// BEGIN: Noop +// JumpUnless(VALUE) +// PutDynamicComponentDefinitionOpcode +// OpenComponent +// CloseComponent +// Jump(END) +// VALUE: Noop +// OptimizedAppend +// END: Noop +// Exit +// +// Keep in mind that even if we *don't* reach here at initial render time, +// it is still possible (although quite rare) that the simple value we +// encounter during initial render could later change into a component +// definition object at update time. That is handled by the "lazy deopt" +// code on the update side (scroll down for the next big block of comment). +var dsl=new OpcodeBuilder(this.symbolTable,env);dsl.putValue(this.expression);dsl.test(IsComponentDefinitionReference.create);dsl.labelled(null,function(dsl,_BEGIN,END){dsl.jumpUnless('VALUE');dsl.putDynamicComponentDefinition();dsl.openComponent(CompiledArgs.empty());dsl.closeComponent();dsl.jump(END);dsl.label('VALUE');dsl.dynamicContent(new _this3.AppendOpcode());});var deopted=this.deopted = dsl.toSlice(); // From this point on, we have essentially replaced ourselves with a new set +// of opcodes. Since we will always be executing the new/deopted code, it's +// a good idea (as a pattern) to null out any unneeded fields here to avoid +// holding on to unneeded/stale objects: +// QUESTION: Shouldn't this whole object be GCed? If not, why not? +this.expression = null;return deopted;};return GuardedAppendOpcode;})(AppendDynamicOpcode);var IsComponentDefinitionReference=(function(_ConditionalReference){babelHelpers.inherits(IsComponentDefinitionReference,_ConditionalReference);function IsComponentDefinitionReference(){_ConditionalReference.apply(this,arguments);}IsComponentDefinitionReference.create = function create(inner){return new IsComponentDefinitionReference(inner);};IsComponentDefinitionReference.prototype.toBool = function toBool(value){return isComponentDefinition(value);};return IsComponentDefinitionReference;})(ConditionalReference);var UpdateOpcode=(function(_UpdatingOpcode9){babelHelpers.inherits(UpdateOpcode,_UpdatingOpcode9);function UpdateOpcode(cache,bounds,upsert){_UpdatingOpcode9.call(this);this.cache = cache;this.bounds = bounds;this.upsert = upsert;this.tag = cache.tag;}UpdateOpcode.prototype.evaluate = function evaluate(vm){var value=this.cache.revalidate();if(_glimmerReference.isModified(value)){var bounds=this.bounds;var upsert=this.upsert;var dom=vm.dom;if(!this.upsert.update(dom,value)){var cursor=new Cursor(bounds.parentElement(),clear(bounds));upsert = this.upsert = this.insert(vm.env.getAppendOperations(),cursor,value);}bounds.update(upsert.bounds);}};UpdateOpcode.prototype.toJSON = function toJSON(){var guid=this._guid;var type=this.type;var cache=this.cache;return {guid:guid,type:type,details:{lastValue:JSON.stringify(cache.peek())}};};return UpdateOpcode;})(UpdatingOpcode);var GuardedUpdateOpcode=(function(_UpdateOpcode){babelHelpers.inherits(GuardedUpdateOpcode,_UpdateOpcode);function GuardedUpdateOpcode(reference,cache,bounds,upsert,appendOpcode,state){_UpdateOpcode.call(this,cache,bounds,upsert);this.reference = reference;this.appendOpcode = appendOpcode;this.state = state;this.deopted = null;this.tag = this._tag = new _glimmerReference.UpdatableTag(this.tag);}GuardedUpdateOpcode.prototype.evaluate = function evaluate(vm){if(this.deopted){vm.evaluateOpcode(this.deopted);}else {if(isComponentDefinition(this.reference.value())){this.lazyDeopt(vm);}else {_UpdateOpcode.prototype.evaluate.call(this,vm);}}};GuardedUpdateOpcode.prototype.lazyDeopt = function lazyDeopt(vm){ // Durign initial render, we know that the reference does not contain a +// component definition, so we optimistically assumed that this append +// is just a normal append. However, at update time, we discovered that +// the reference has switched into containing a component definition, so +// we need to do a "lazy deopt", simulating what would have happened if +// we had decided to perform the deopt in the first place during initial +// render. +// +// More concretely, we would have expanded the curly into a if/else, and +// based on whether the value is a component definition or not, we would +// have entered either the dynamic component branch or the simple value +// branch. +// +// Since we rendered a simple value during initial render (and all the +// updates up until this point), we need to pretend that the result is +// produced by the "VALUE" branch of the deopted append opcode: +// +// Try(BEGIN, END) +// Assert(IsComponentDefinition, expected=false) +// OptimizedUpdate +// +// In this case, because the reference has switched from being a simple +// value into a component definition, what would have happened is that +// the assert would throw, causing the Try opcode to teardown the bounds +// and rerun the original append opcode. +// +// Since the Try opcode would have nuked the updating opcodes anyway, we +// wouldn't have to worry about simulating those. All we have to do is to +// execute the Try opcode and immediately throw. +var bounds=this.bounds;var appendOpcode=this.appendOpcode;var state=this.state;var env=vm.env;var slice=appendOpcode.deopt(env);var enter=_glimmerUtil.expect(env.program.opcode(slice[0] + 8),'hardcoded deopt location');var ops=vm.constants.getSlice(enter.op1);var tracker=new UpdatableBlockTracker(bounds.parentElement());tracker.newBounds(this.bounds);var children=new _glimmerUtil.LinkedList();state.frame['condition'] = IsComponentDefinitionReference.create(_glimmerUtil.expect(state.frame['operand'],'operand should be populated'));var deopted=this.deopted = new TryOpcode(ops,state,tracker,children);this._tag.update(deopted.tag);vm.evaluateOpcode(deopted);vm.throw(); // From this point on, we have essentially replaced ourselve with a new +// opcode. Since we will always be executing the new/deopted code, it's a +// good idea (as a pattern) to null out any unneeded fields here to avoid +// holding on to unneeded/stale objects: +// QUESTION: Shouldn't this whole object be GCed? If not, why not? +this._tag = null;this.reference = null;this.cache = null;this.bounds = null;this.upsert = null;this.appendOpcode = null;this.state = null;};GuardedUpdateOpcode.prototype.toJSON = function toJSON(){var guid=this._guid;var type=this.type;var deopted=this.deopted;if(deopted){return {guid:guid,type:type,deopted:true,children:[deopted.toJSON()]};}else {return _UpdateOpcode.prototype.toJSON.call(this);}};return GuardedUpdateOpcode;})(UpdateOpcode);var OptimizedCautiousAppendOpcode=(function(_AppendDynamicOpcode2){babelHelpers.inherits(OptimizedCautiousAppendOpcode,_AppendDynamicOpcode2);function OptimizedCautiousAppendOpcode(){_AppendDynamicOpcode2.apply(this,arguments);this.type = 'optimized-cautious-append';}OptimizedCautiousAppendOpcode.prototype.normalize = function normalize(reference){return _glimmerReference.map(reference,normalizeValue);};OptimizedCautiousAppendOpcode.prototype.insert = function insert(dom,cursor,value){return cautiousInsert(dom,cursor,value);};OptimizedCautiousAppendOpcode.prototype.updateWith = function updateWith(_vm,_reference,cache,bounds,upsert){return new OptimizedCautiousUpdateOpcode(cache,bounds,upsert);};return OptimizedCautiousAppendOpcode;})(AppendDynamicOpcode);var OptimizedCautiousUpdateOpcode=(function(_UpdateOpcode2){babelHelpers.inherits(OptimizedCautiousUpdateOpcode,_UpdateOpcode2);function OptimizedCautiousUpdateOpcode(){_UpdateOpcode2.apply(this,arguments);this.type = 'optimized-cautious-update';}OptimizedCautiousUpdateOpcode.prototype.insert = function insert(dom,cursor,value){return cautiousInsert(dom,cursor,value);};return OptimizedCautiousUpdateOpcode;})(UpdateOpcode);var GuardedCautiousAppendOpcode=(function(_GuardedAppendOpcode){babelHelpers.inherits(GuardedCautiousAppendOpcode,_GuardedAppendOpcode);function GuardedCautiousAppendOpcode(){_GuardedAppendOpcode.apply(this,arguments);this.type = 'guarded-cautious-append';this.AppendOpcode = OptimizedCautiousAppendOpcode;}GuardedCautiousAppendOpcode.prototype.normalize = function normalize(reference){return _glimmerReference.map(reference,normalizeValue);};GuardedCautiousAppendOpcode.prototype.insert = function insert(dom,cursor,value){return cautiousInsert(dom,cursor,value);};GuardedCautiousAppendOpcode.prototype.updateWith = function updateWith(vm,reference,cache,bounds,upsert){return new GuardedCautiousUpdateOpcode(reference,cache,bounds,upsert,this,vm.capture());};return GuardedCautiousAppendOpcode;})(GuardedAppendOpcode);var GuardedCautiousUpdateOpcode=(function(_GuardedUpdateOpcode){babelHelpers.inherits(GuardedCautiousUpdateOpcode,_GuardedUpdateOpcode);function GuardedCautiousUpdateOpcode(){_GuardedUpdateOpcode.apply(this,arguments);this.type = 'guarded-cautious-update';}GuardedCautiousUpdateOpcode.prototype.insert = function insert(dom,cursor,value){return cautiousInsert(dom,cursor,value);};return GuardedCautiousUpdateOpcode;})(GuardedUpdateOpcode);var OptimizedTrustingAppendOpcode=(function(_AppendDynamicOpcode3){babelHelpers.inherits(OptimizedTrustingAppendOpcode,_AppendDynamicOpcode3);function OptimizedTrustingAppendOpcode(){_AppendDynamicOpcode3.apply(this,arguments);this.type = 'optimized-trusting-append';}OptimizedTrustingAppendOpcode.prototype.normalize = function normalize(reference){return _glimmerReference.map(reference,normalizeTrustedValue);};OptimizedTrustingAppendOpcode.prototype.insert = function insert(dom,cursor,value){return trustingInsert(dom,cursor,value);};OptimizedTrustingAppendOpcode.prototype.updateWith = function updateWith(_vm,_reference,cache,bounds,upsert){return new OptimizedTrustingUpdateOpcode(cache,bounds,upsert);};return OptimizedTrustingAppendOpcode;})(AppendDynamicOpcode);var OptimizedTrustingUpdateOpcode=(function(_UpdateOpcode3){babelHelpers.inherits(OptimizedTrustingUpdateOpcode,_UpdateOpcode3);function OptimizedTrustingUpdateOpcode(){_UpdateOpcode3.apply(this,arguments);this.type = 'optimized-trusting-update';}OptimizedTrustingUpdateOpcode.prototype.insert = function insert(dom,cursor,value){return trustingInsert(dom,cursor,value);};return OptimizedTrustingUpdateOpcode;})(UpdateOpcode);var GuardedTrustingAppendOpcode=(function(_GuardedAppendOpcode2){babelHelpers.inherits(GuardedTrustingAppendOpcode,_GuardedAppendOpcode2);function GuardedTrustingAppendOpcode(){_GuardedAppendOpcode2.apply(this,arguments);this.type = 'guarded-trusting-append';this.AppendOpcode = OptimizedTrustingAppendOpcode;}GuardedTrustingAppendOpcode.prototype.normalize = function normalize(reference){return _glimmerReference.map(reference,normalizeTrustedValue);};GuardedTrustingAppendOpcode.prototype.insert = function insert(dom,cursor,value){return trustingInsert(dom,cursor,value);};GuardedTrustingAppendOpcode.prototype.updateWith = function updateWith(vm,reference,cache,bounds,upsert){return new GuardedTrustingUpdateOpcode(reference,cache,bounds,upsert,this,vm.capture());};return GuardedTrustingAppendOpcode;})(GuardedAppendOpcode);var GuardedTrustingUpdateOpcode=(function(_GuardedUpdateOpcode2){babelHelpers.inherits(GuardedTrustingUpdateOpcode,_GuardedUpdateOpcode2);function GuardedTrustingUpdateOpcode(){_GuardedUpdateOpcode2.apply(this,arguments);this.type = 'trusting-update';}GuardedTrustingUpdateOpcode.prototype.insert = function insert(dom,cursor,value){return trustingInsert(dom,cursor,value);};return GuardedTrustingUpdateOpcode;})(GuardedUpdateOpcode);APPEND_OPCODES.add(49, /* PutDynamicPartial */function(vm,_ref32){var _symbolTable=_ref32.op1;var env=vm.env;var symbolTable=vm.constants.getOther(_symbolTable);function lookupPartial(name){var normalized=String(name);if(!env.hasPartial(normalized,symbolTable)){throw new Error('Could not find a partial named "' + normalized + '"');}return env.lookupPartial(normalized,symbolTable);}var reference=_glimmerReference.map(vm.frame.getOperand(),lookupPartial);var cache=_glimmerReference.isConst(reference)?undefined:new _glimmerReference.ReferenceCache(reference);var definition=cache?cache.peek():reference.value();vm.frame.setImmediate(definition);if(cache){vm.updateWith(new Assert(cache));}});APPEND_OPCODES.add(50, /* PutPartial */function(vm,_ref33){var _definition=_ref33.op1;var definition=vm.constants.getOther(_definition);vm.frame.setImmediate(definition);});APPEND_OPCODES.add(51, /* EvaluatePartial */function(vm,_ref34){var _symbolTable=_ref34.op1;var _cache=_ref34.op2;var symbolTable=vm.constants.getOther(_symbolTable);var cache=vm.constants.getOther(_cache);var _vm$frame$getImmediate=vm.frame.getImmediate();var template=_vm$frame$getImmediate.template;var block=cache[template.id];if(!block){block = template.asPartial(symbolTable);}vm.invokePartial(block);});var IterablePresenceReference=(function(){function IterablePresenceReference(artifacts){this.tag = artifacts.tag;this.artifacts = artifacts;}IterablePresenceReference.prototype.value = function value(){return !this.artifacts.isEmpty();};return IterablePresenceReference;})();APPEND_OPCODES.add(44, /* PutIterator */function(vm){var listRef=vm.frame.getOperand();var args=_glimmerUtil.expect(vm.frame.getArgs(),'PutIteratorOpcode expects a populated args register');var iterable=vm.env.iterableFor(listRef,args);var iterator=new _glimmerReference.ReferenceIterator(iterable);vm.frame.setIterator(iterator);vm.frame.setCondition(new IterablePresenceReference(iterator.artifacts));});APPEND_OPCODES.add(45, /* EnterList */function(vm,_ref35){var _slice=_ref35.op1;vm.enterList(vm.constants.getSlice(_slice));});APPEND_OPCODES.add(46, /* ExitList */function(vm){return vm.exitList();});APPEND_OPCODES.add(47, /* EnterWithKey */function(vm,_ref36){var _slice=_ref36.op2;var key=_glimmerUtil.expect(vm.frame.getKey(),'EnterWithKeyOpcode expects a populated key register');var slice=vm.constants.getSlice(_slice);vm.enterWithKey(key,slice);});var TRUE_REF=new _glimmerReference.ConstReference(true);var FALSE_REF=new _glimmerReference.ConstReference(false);APPEND_OPCODES.add(48, /* NextIter */function(vm,_ref37){var end=_ref37.op1;var item=vm.frame.getIterator().next();if(item){vm.frame.setCondition(TRUE_REF);vm.frame.setKey(item.key);vm.frame.setOperand(item.value);vm.frame.setArgs(EvaluatedArgs.positional([item.value,item.memo]));}else {vm.frame.setCondition(FALSE_REF);vm.goto(end);}});var clientId=0;function templateFactory(_ref38){var templateId=_ref38.id;var meta=_ref38.meta;var block=_ref38.block;var parsedBlock=undefined;var id=templateId || 'client-' + clientId++;var create=function(env,envMeta){var newMeta=envMeta?_glimmerUtil.assign({},envMeta,meta):meta;if(!parsedBlock){parsedBlock = JSON.parse(block);}return template(parsedBlock,id,newMeta,env);};return {id:id,meta:meta,create:create};}function template(block,id,meta,env){var scanner=new Scanner(block,meta,env);var entryPoint=undefined;var asEntryPoint=function(){if(!entryPoint)entryPoint = scanner.scanEntryPoint();return entryPoint;};var layout=undefined;var asLayout=function(){if(!layout)layout = scanner.scanLayout();return layout;};var asPartial=function(symbols){return scanner.scanPartial(symbols);};var render=function(self,appendTo,dynamicScope){var elementStack=ElementStack.forInitialRender(env,appendTo,null);var compiled=asEntryPoint().compile(env);var vm=VM.initial(env,self,dynamicScope,elementStack,compiled.symbols);return vm.execute(compiled.slice);};return {id:id,meta:meta,_block:block,asEntryPoint:asEntryPoint,asLayout:asLayout,asPartial:asPartial,render:render};}var DynamicVarReference=(function(){function DynamicVarReference(scope,nameRef){this.scope = scope;this.nameRef = nameRef;var varTag=this.varTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG);this.tag = _glimmerReference.combine([nameRef.tag,varTag]);}DynamicVarReference.prototype.value = function value(){return this.getVar().value();};DynamicVarReference.prototype.get = function get(key){return this.getVar().get(key);};DynamicVarReference.prototype.getVar = function getVar(){var name=String(this.nameRef.value());var ref=this.scope.get(name);this.varTag.update(ref.tag);return ref;};return DynamicVarReference;})();function getDynamicVar(vm,args,_symbolTable){var scope=vm.dynamicScope();var nameRef=args.positional.at(0);return new DynamicVarReference(scope,nameRef);}var PartialDefinition=function PartialDefinition(name,template){this.name = name;this.template = template;};var NodeType;(function(NodeType){NodeType[NodeType["Element"] = 0] = "Element";NodeType[NodeType["Attribute"] = 1] = "Attribute";NodeType[NodeType["Text"] = 2] = "Text";NodeType[NodeType["CdataSection"] = 3] = "CdataSection";NodeType[NodeType["EntityReference"] = 4] = "EntityReference";NodeType[NodeType["Entity"] = 5] = "Entity";NodeType[NodeType["ProcessingInstruction"] = 6] = "ProcessingInstruction";NodeType[NodeType["Comment"] = 7] = "Comment";NodeType[NodeType["Document"] = 8] = "Document";NodeType[NodeType["DocumentType"] = 9] = "DocumentType";NodeType[NodeType["DocumentFragment"] = 10] = "DocumentFragment";NodeType[NodeType["Notation"] = 11] = "Notation";})(NodeType || (NodeType = {}));var Simple=Object.freeze({get NodeType(){return NodeType;}});exports.Simple = Simple;exports.templateFactory = templateFactory;exports.NULL_REFERENCE = NULL_REFERENCE;exports.UNDEFINED_REFERENCE = UNDEFINED_REFERENCE;exports.PrimitiveReference = PrimitiveReference;exports.ConditionalReference = ConditionalReference;exports.OpcodeBuilderDSL = OpcodeBuilder;exports.compileLayout = compileLayout;exports.CompiledBlock = CompiledBlock;exports.CompiledProgram = CompiledProgram;exports.IAttributeManager = AttributeManager;exports.AttributeManager = AttributeManager;exports.PropertyManager = PropertyManager;exports.INPUT_VALUE_PROPERTY_MANAGER = INPUT_VALUE_PROPERTY_MANAGER;exports.defaultManagers = defaultManagers;exports.defaultAttributeManagers = defaultAttributeManagers;exports.defaultPropertyManagers = defaultPropertyManagers;exports.readDOMAttr = readDOMAttr;exports.normalizeTextValue = normalizeTextValue;exports.CompiledExpression = CompiledExpression;exports.CompiledArgs = CompiledArgs;exports.CompiledNamedArgs = CompiledNamedArgs;exports.CompiledPositionalArgs = CompiledPositionalArgs;exports.EvaluatedArgs = EvaluatedArgs;exports.EvaluatedNamedArgs = EvaluatedNamedArgs;exports.EvaluatedPositionalArgs = EvaluatedPositionalArgs;exports.getDynamicVar = getDynamicVar;exports.BlockMacros = Blocks;exports.InlineMacros = Inlines;exports.compileArgs = compileArgs;exports.setDebuggerCallback = setDebuggerCallback;exports.resetDebuggerCallback = resetDebuggerCallback;exports.BaselineSyntax = BaselineSyntax;exports.Layout = Layout;exports.UpdatingVM = UpdatingVM;exports.RenderResult = RenderResult;exports.isSafeString = isSafeString;exports.Scope = Scope;exports.Environment = Environment;exports.PartialDefinition = PartialDefinition;exports.ComponentDefinition = ComponentDefinition;exports.isComponentDefinition = isComponentDefinition;exports.DOMChanges = helper$1;exports.IDOMChanges = DOMChanges;exports.DOMTreeConstruction = DOMTreeConstruction;exports.isWhitespace = isWhitespace;exports.insertHTMLBefore = _insertHTMLBefore;exports.ElementStack = ElementStack;exports.ConcreteBounds = ConcreteBounds;}); +enifed('@glimmer/util', ['exports'], function (exports) { + // There is a small whitelist of namespaced attributes specially + // enumerated in + // https://www.w3.org/TR/html/syntax.html#attributes-0 + // + // > When a foreign element has one of the namespaced attributes given by + // > the local name and namespace of the first and second cells of a row + // > from the following table, it must be written using the name given by + // > the third cell from the same row. + // + // In all other cases, colons are interpreted as a regular character + // with no special meaning: + // + // > No other namespaced attribute can be expressed in the HTML syntax. + 'use strict'; - this._throttlers.push(throttler); + var XLINK = 'http://www.w3.org/1999/xlink'; + var XML = 'http://www.w3.org/XML/1998/namespace'; + var XMLNS = 'http://www.w3.org/2000/xmlns/'; + var WHITELIST = { + 'xlink:actuate': XLINK, + 'xlink:arcrole': XLINK, + 'xlink:href': XLINK, + 'xlink:role': XLINK, + 'xlink:show': XLINK, + 'xlink:title': XLINK, + 'xlink:type': XLINK, + 'xml:base': XML, + 'xml:lang': XML, + 'xml:space': XML, + 'xmlns': XMLNS, + 'xmlns:xlink': XMLNS + }; + function getAttrNamespace(attrName) { + return WHITELIST[attrName] || null; + } - return throttler; - }, + // tslint:disable-line + function unwrap(val) { + if (val === null || val === undefined) throw new Error('Expected value to be present'); + return val; + } + function expect(val, message) { + if (val === null || val === undefined) throw new Error(message); + return val; + } + function unreachable() { + return new Error('unreachable'); + } - debounce: function(target, method /* , args, wait, [immediate] */) { - var backburner = this; - var args = new Array(arguments.length); - for (var i = 0; i < arguments.length; i++) { - args[i] = arguments[i]; + // import Logger from './logger'; + // let alreadyWarned = false; + // import Logger from './logger'; + function debugAssert(test, msg) { + // if (!alreadyWarned) { + // alreadyWarned = true; + // Logger.warn("Don't leave debug assertions on in public builds"); + // } + if (!test) { + throw new Error(msg || "assertion failure"); + } } - var immediate = args.pop(); - var wait, index, debouncee, timer; + var LogLevel; + (function (LogLevel) { + LogLevel[LogLevel["Trace"] = 0] = "Trace"; + LogLevel[LogLevel["Debug"] = 1] = "Debug"; + LogLevel[LogLevel["Warn"] = 2] = "Warn"; + LogLevel[LogLevel["Error"] = 3] = "Error"; + })(LogLevel || (exports.LogLevel = LogLevel = {})); - if (isNumber(immediate) || isString(immediate)) { - wait = immediate; - immediate = false; - } else { - wait = args.pop(); - } + var NullConsole = (function () { + function NullConsole() {} - wait = parseInt(wait, 10); - // Remove debouncee - index = findDebouncee(target, method, this._debouncees); + NullConsole.prototype.log = function log(_message) {}; - if (index > -1) { - debouncee = this._debouncees[index]; - this._debouncees.splice(index, 1); - this._platform.clearTimeout(debouncee[2]); - } + NullConsole.prototype.warn = function warn(_message) {}; - timer = this._platform.setTimeout(function() { - if (!immediate) { - backburner.run.apply(backburner, args); - } - var index = findDebouncee(target, method, backburner._debouncees); - if (index > -1) { - backburner._debouncees.splice(index, 1); - } - }, wait); + NullConsole.prototype.error = function error(_message) {}; - if (immediate && index === -1) { - backburner.run.apply(backburner, args); - } + NullConsole.prototype.trace = function trace() {}; - debouncee = [ - target, - method, - timer - ]; + return NullConsole; + })(); - backburner._debouncees.push(debouncee); + var ALWAYS = undefined; - return debouncee; - }, + var Logger = (function () { + function Logger(_ref) { + var console = _ref.console; + var level = _ref.level; - cancelTimers: function() { - each(this._throttlers, this._boundClearItems); - this._throttlers = []; + this.f = ALWAYS; + this.force = ALWAYS; + this.console = console; + this.level = level; + } - each(this._debouncees, this._boundClearItems); - this._debouncees = []; + Logger.prototype.skipped = function skipped(level) { + return level < this.level; + }; - this._clearTimerTimeout(); - this._timers = []; + Logger.prototype.trace = function trace(message) { + var _ref2 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - if (this._autorun) { - this._platform.clearTimeout(this._autorun); - this._autorun = null; - } - }, + var _ref2$stackTrace = _ref2.stackTrace; + var stackTrace = _ref2$stackTrace === undefined ? false : _ref2$stackTrace; - hasTimers: function() { - return !!this._timers.length || !!this._debouncees.length || !!this._throttlers.length || this._autorun; - }, + if (this.skipped(LogLevel.Trace)) return; + this.console.log(message); + if (stackTrace) this.console.trace(); + }; - cancel: function (timer) { - var timerType = typeof timer; + Logger.prototype.debug = function debug(message) { + var _ref3 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - if (timer && timerType === 'object' && timer.queue && timer.method) { // we're cancelling a deferOnce - return timer.queue.cancel(timer); - } else if (timerType === 'function') { // we're cancelling a setTimeout - for (var i = 0, l = this._timers.length; i < l; i += 2) { - if (this._timers[i + 1] === timer) { - this._timers.splice(i, 2); // remove the two elements - if (i === 0) { - this._reinstallTimerTimeout(); - } - return true; - } - } - } else if (Object.prototype.toString.call(timer) === '[object Array]'){ // we're cancelling a throttle or debounce - return this._cancelItem(findThrottler, this._throttlers, timer) || - this._cancelItem(findDebouncee, this._debouncees, timer); - } else { - return; // timer was null or not a timer - } - }, + var _ref3$stackTrace = _ref3.stackTrace; + var stackTrace = _ref3$stackTrace === undefined ? false : _ref3$stackTrace; - _cancelItem: function(findMethod, array, timer){ - var item, index; + if (this.skipped(LogLevel.Debug)) return; + this.console.log(message); + if (stackTrace) this.console.trace(); + }; - if (timer.length < 3) { return false; } + Logger.prototype.warn = function warn(message) { + var _ref4 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - index = findMethod(timer[0], timer[1], array); + var _ref4$stackTrace = _ref4.stackTrace; + var stackTrace = _ref4$stackTrace === undefined ? false : _ref4$stackTrace; - if (index > -1) { + if (this.skipped(LogLevel.Warn)) return; + this.console.warn(message); + if (stackTrace) this.console.trace(); + }; - item = array[index]; + Logger.prototype.error = function error(message) { + if (this.skipped(LogLevel.Error)) return; + this.console.error(message); + }; - if (item[2] === timer[2]) { - array.splice(index, 1); - this._platform.clearTimeout(timer[2]); - return true; - } - } + return Logger; + })(); - return false; - }, + var _console = typeof console === 'undefined' ? new NullConsole() : console; + ALWAYS = new Logger({ console: _console, level: LogLevel.Trace }); + var LOG_LEVEL = LogLevel.Warn; + var logger = new Logger({ console: _console, level: LOG_LEVEL }); - _runExpiredTimers: function () { - this._timerTimeoutId = undefined; - this.run(this, this._scheduleExpiredTimers); - }, + var objKeys = Object.keys; - _scheduleExpiredTimers: function () { - var n = Date.now(); - var timers = this._timers; - var i = 0; - var l = timers.length; - for (; i < l; i += 2) { - var executeAt = timers[i]; - var fn = timers[i+1]; - if (executeAt <= n) { - this.schedule(this.options.defaultQueue, null, fn); - } else { - break; - } + function assign(obj) { + for (var i = 1; i < arguments.length; i++) { + var assignment = arguments[i]; + if (assignment === null || typeof assignment !== 'object') continue; + var keys = objKeys(assignment); + for (var j = 0; j < keys.length; j++) { + var key = keys[j]; + obj[key] = assignment[key]; + } + } + return obj; + } + function fillNulls(count) { + var arr = new Array(count); + for (var i = 0; i < count; i++) { + arr[i] = null; + } + return arr; } - timers.splice(0, i); - this._installTimerTimeout(); - }, - - _reinstallTimerTimeout: function () { - this._clearTimerTimeout(); - this._installTimerTimeout(); - }, - _clearTimerTimeout: function () { - if (!this._timerTimeoutId) { - return; + var GUID = 0; + function initializeGuid(object) { + return object._guid = ++GUID; + } + function ensureGuid(object) { + return object._guid || initializeGuid(object); } - this._platform.clearTimeout(this._timerTimeoutId); - this._timerTimeoutId = undefined; - }, - _installTimerTimeout: function () { - if (!this._timers.length) { - return; + var proto = Object.create(null, { + // without this, we will always still end up with (new + // EmptyObject()).constructor === Object + constructor: { + value: undefined, + enumerable: false, + writable: true + } + }); + function EmptyObject() {} + EmptyObject.prototype = proto; + function dict() { + // let d = Object.create(null); + // d.x = 1; + // delete d.x; + // return d; + return new EmptyObject(); } - var minExpiresAt = this._timers[0]; - var n = Date.now(); - var wait = Math.max(0, minExpiresAt - n); - this._timerTimeoutId = this._platform.setTimeout(this._boundRunExpiredTimers, wait); - } -}; -Backburner.prototype.schedule = Backburner.prototype.defer; -Backburner.prototype.scheduleOnce = Backburner.prototype.deferOnce; -Backburner.prototype.later = Backburner.prototype.setTimeout; + var DictSet = (function () { + function DictSet() { + this.dict = dict(); + } -function getOnError(options) { - return options.onError || (options.onErrorTarget && options.onErrorTarget[options.onErrorMethod]); -} + DictSet.prototype.add = function add(obj) { + if (typeof obj === 'string') this.dict[obj] = obj;else this.dict[ensureGuid(obj)] = obj; + return this; + }; -function createAutorun(backburner) { - var setTimeout = backburner._platform.setTimeout; - backburner.begin(); - backburner._autorun = setTimeout(function() { - backburner._autorun = null; - backburner.end(); - }, 0); -} + DictSet.prototype.delete = function _delete(obj) { + if (typeof obj === 'string') delete this.dict[obj];else if (obj._guid) delete this.dict[obj._guid]; + }; -function findDebouncee(target, method, debouncees) { - return findItem(target, method, debouncees); -} + DictSet.prototype.forEach = function forEach(callback) { + var dict = this.dict; -function findThrottler(target, method, throttlers) { - return findItem(target, method, throttlers); -} + Object.keys(dict).forEach(function (key) { + return callback(dict[key]); + }); + }; -function findItem(target, method, collection) { - var item; - var index = -1; + DictSet.prototype.toArray = function toArray() { + return Object.keys(this.dict); + }; - for (var i = 0, l = collection.length; i < l; i++) { - item = collection[i]; - if (item[0] === target && item[1] === method) { - index = i; - break; - } - } - - return index; -} + return DictSet; + })(); -function clearItems(item) { - this._platform.clearTimeout(item[2]); -} + var Stack = (function () { + function Stack() { + this.stack = []; + this.current = null; + } -exports['default'] = Backburner; + Stack.prototype.toArray = function toArray() { + return this.stack; + }; -Object.defineProperty(exports, '__esModule', { value: true }); + Stack.prototype.push = function push(item) { + this.current = item; + this.stack.push(item); + }; -}); -enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'ember-metal'], function (exports, _emberUtils, _emberEnvironment, _emberMetal) { - 'use strict'; + Stack.prototype.pop = function pop() { + var item = this.stack.pop(); + var len = this.stack.length; + this.current = len === 0 ? null : this.stack[len - 1]; + return item === undefined ? null : item; + }; - exports.default = Container; - exports.buildFakeContainerWithDeprecations = buildFakeContainerWithDeprecations; + Stack.prototype.isEmpty = function isEmpty() { + return this.stack.length === 0; + }; - var CONTAINER_OVERRIDE = _emberUtils.symbol('CONTAINER_OVERRIDE'); + return Stack; + })(); - /** - 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 - objects. - - The public API for `Container` is still in flux and should not be considered - stable. - - @private - @class Container - */ + var ListNode = function ListNode(value) { + this.next = null; + this.prev = null; + this.value = value; + }; - function Container(registry, options) { - this.registry = registry; - this.owner = options && options.owner ? options.owner : null; - this.cache = _emberUtils.dictionary(options && options.cache ? options.cache : null); - this.factoryCache = _emberUtils.dictionary(options && options.factoryCache ? options.factoryCache : null); - this.validationCache = _emberUtils.dictionary(options && options.validationCache ? options.validationCache : null); - this._fakeContainerToInject = buildFakeContainerWithDeprecations(this); - this[CONTAINER_OVERRIDE] = undefined; - this.isDestroyed = false; - } + var LinkedList = (function () { + function LinkedList() { + this.clear(); + } - Container.prototype = { - /** - @private - @property owner - @type Object - */ - owner: null, + LinkedList.fromSlice = function fromSlice(slice) { + var list = new LinkedList(); + slice.forEachNode(function (n) { + return list.append(n.clone()); + }); + return list; + }; - /** - @private - @property registry - @type Registry - @since 1.11.0 - */ - registry: null, + LinkedList.prototype.head = function head() { + return this._head; + }; - /** - @private - @property cache - @type InheritingDict - */ - cache: null, + LinkedList.prototype.tail = function tail() { + return this._tail; + }; - /** - @private - @property factoryCache - @type InheritingDict - */ - factoryCache: null, + LinkedList.prototype.clear = function clear() { + this._head = this._tail = null; + }; - /** - @private - @property validationCache - @type InheritingDict - */ - validationCache: null, + LinkedList.prototype.isEmpty = function isEmpty() { + return this._head === null; + }; - /** - Given a fullName return a corresponding instance. - The default behaviour is for lookup to return a singleton instance. - The singleton is scoped to the container, allowing multiple containers - to all have their own locally scoped singletons. - ```javascript - let registry = new Registry(); - let container = registry.container(); - registry.register('api:twitter', Twitter); - let twitter = container.lookup('api:twitter'); - twitter instanceof Twitter; // => true - // by default the container will return singletons - let twitter2 = container.lookup('api:twitter'); - twitter2 instanceof Twitter; // => true - twitter === twitter2; //=> true - ``` - If singletons are not wanted, an optional flag can be provided at lookup. - ```javascript - let registry = new Registry(); - let container = registry.container(); - registry.register('api:twitter', Twitter); - let twitter = container.lookup('api:twitter', { singleton: false }); - let twitter2 = container.lookup('api:twitter', { singleton: false }); - twitter === twitter2; //=> false - ``` - @private - @method lookup - @param {String} fullName - @param {Object} [options] - @param {String} [options.source] The fullname of the request source (used for local lookup) - @return {any} - */ - lookup: function (fullName, options) { - _emberMetal.assert('fullName must be a proper full name', this.registry.validateFullName(fullName)); - return lookup(this, this.registry.normalize(fullName), options); - }, + LinkedList.prototype.toArray = function toArray() { + var out = []; + this.forEachNode(function (n) { + return out.push(n); + }); + return out; + }; - /** - Given a fullName, return the corresponding factory. - @private - @method lookupFactory - @param {String} fullName - @param {Object} [options] - @param {String} [options.source] The fullname of the request source (used for local lookup) - @return {any} - */ - lookupFactory: function (fullName, options) { - _emberMetal.assert('fullName must be a proper full name', this.registry.validateFullName(fullName)); - return factoryFor(this, this.registry.normalize(fullName), options); - }, + LinkedList.prototype.splice = function splice(start, end, reference) { + var before = undefined; + if (reference === null) { + before = this._tail; + this._tail = end; + } else { + before = reference.prev; + end.next = reference; + reference.prev = end; + } + if (before) { + before.next = start; + start.prev = before; + } + }; - /** - A depth first traversal, destroying the container, its descendant containers and all - their managed objects. - @private - @method destroy - */ - destroy: function () { - eachDestroyable(this, function (item) { - if (item.destroy) { - item.destroy(); - } - }); + LinkedList.prototype.nextNode = function nextNode(node) { + return node.next; + }; - this.isDestroyed = true; - }, + LinkedList.prototype.prevNode = function prevNode(node) { + return node.prev; + }; - /** - Clear either the entire cache or just the cache for a particular key. - @private - @method reset - @param {String} fullName optional key to reset; if missing, resets everything - */ - reset: function (fullName) { - if (arguments.length > 0) { - resetMember(this, this.registry.normalize(fullName)); - } else { - resetCache(this); - } - }, + LinkedList.prototype.forEachNode = function forEachNode(callback) { + var node = this._head; + while (node !== null) { + callback(node); + node = node.next; + } + }; - /** - Returns an object that can be used to provide an owner to a - manually created instance. - @private - @method ownerInjection - @returns { Object } - */ - ownerInjection: function () { - var _ref; + LinkedList.prototype.contains = function contains(needle) { + var node = this._head; + while (node !== null) { + if (node === needle) return true; + node = node.next; + } + return false; + }; - return _ref = {}, _ref[_emberUtils.OWNER] = this.owner, _ref; - } - }; + LinkedList.prototype.insertBefore = function insertBefore(node) { + var reference = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; - function isSingleton(container, fullName) { - return container.registry.getOption(fullName, 'singleton') !== false; - } + if (reference === null) return this.append(node); + if (reference.prev) reference.prev.next = node;else this._head = node; + node.prev = reference.prev; + node.next = reference; + reference.prev = node; + return node; + }; - function lookup(container, fullName) { - var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + LinkedList.prototype.append = function append(node) { + var tail = this._tail; + if (tail) { + tail.next = node; + node.prev = tail; + node.next = null; + } else { + this._head = node; + } + return this._tail = node; + }; - if (options.source) { - fullName = container.registry.expandLocalLookup(fullName, options); + LinkedList.prototype.pop = function pop() { + if (this._tail) return this.remove(this._tail); + return null; + }; - // if expandLocalLookup returns falsey, we do not support local lookup - if (!fullName) { - return; - } - } + LinkedList.prototype.prepend = function prepend(node) { + if (this._head) return this.insertBefore(node, this._head); + return this._head = this._tail = node; + }; - if (container.cache[fullName] !== undefined && options.singleton !== false) { - return container.cache[fullName]; - } + LinkedList.prototype.remove = function remove(node) { + if (node.prev) node.prev.next = node.next;else this._head = node.next; + if (node.next) node.next.prev = node.prev;else this._tail = node.prev; + return node; + }; - var value = instantiate(container, fullName); + return LinkedList; + })(); - if (value === undefined) { - return; - } + var ListSlice = (function () { + function ListSlice(head, tail) { + this._head = head; + this._tail = tail; + } - if (isSingleton(container, fullName) && options.singleton !== false) { - container.cache[fullName] = value; - } + ListSlice.toList = function toList(slice) { + var list = new LinkedList(); + slice.forEachNode(function (n) { + return list.append(n.clone()); + }); + return list; + }; - return value; - } + ListSlice.prototype.forEachNode = function forEachNode(callback) { + var node = this._head; + while (node !== null) { + callback(node); + node = this.nextNode(node); + } + }; - function markInjectionsAsDynamic(injections) { - injections._dynamic = true; - } + ListSlice.prototype.contains = function contains(needle) { + var node = this._head; + while (node !== null) { + if (node === needle) return true; + node = node.next; + } + return false; + }; - function areInjectionsDynamic(injections) { - return !!injections._dynamic; - } + ListSlice.prototype.head = function head() { + return this._head; + }; - function buildInjections() /* container, ...injections */{ - var hash = {}; + ListSlice.prototype.tail = function tail() { + return this._tail; + }; - if (arguments.length > 1) { - var container = arguments[0]; - var injections = []; - var injection = undefined; + ListSlice.prototype.toArray = function toArray() { + var out = []; + this.forEachNode(function (n) { + return out.push(n); + }); + return out; + }; - for (var i = 1; i < arguments.length; i++) { - if (arguments[i]) { - injections = injections.concat(arguments[i]); - } - } + ListSlice.prototype.nextNode = function nextNode(node) { + if (node === this._tail) return null; + return node.next; + }; - container.registry.validateInjections(injections); + ListSlice.prototype.prevNode = function prevNode(node) { + if (node === this._head) return null; + return node.prev; + }; - for (var i = 0; i < injections.length; i++) { - injection = injections[i]; - hash[injection.property] = lookup(container, injection.fullName); - if (!isSingleton(container, injection.fullName)) { - markInjectionsAsDynamic(hash); - } - } - } + ListSlice.prototype.isEmpty = function isEmpty() { + return false; + }; - return hash; - } + return ListSlice; + })(); - function factoryFor(container, fullName) { - var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + var EMPTY_SLICE = new ListSlice(null, null); - var registry = container.registry; + var HAS_TYPED_ARRAYS = typeof Uint32Array !== 'undefined'; + var A = undefined; + if (HAS_TYPED_ARRAYS) { + A = Uint32Array; + } else { + A = Array; + } + var A$1 = A; - if (options.source) { - fullName = registry.expandLocalLookup(fullName, options); + var HAS_NATIVE_WEAKMAP = (function () { + // detect if `WeakMap` is even present + var hasWeakMap = typeof WeakMap === 'function'; + if (!hasWeakMap) { + return false; + } + var instance = new WeakMap(); + // use `Object`'s `.toString` directly to prevent us from detecting + // polyfills as native weakmaps + return Object.prototype.toString.call(instance) === '[object WeakMap]'; + })(); - // if expandLocalLookup returns falsey, we do not support local lookup - if (!fullName) { - return; - } - } + exports.getAttrNamespace = getAttrNamespace; + exports.assert = debugAssert; + exports.LOGGER = logger; + exports.Logger = Logger; + exports.LogLevel = LogLevel; + exports.assign = assign; + exports.fillNulls = fillNulls; + exports.ensureGuid = ensureGuid; + exports.initializeGuid = initializeGuid; + exports.Stack = Stack; + exports.DictSet = DictSet; + exports.dict = dict; + exports.EMPTY_SLICE = EMPTY_SLICE; + exports.LinkedList = LinkedList; + exports.ListNode = ListNode; + exports.ListSlice = ListSlice; + exports.A = A$1; + exports.HAS_NATIVE_WEAKMAP = HAS_NATIVE_WEAKMAP; + exports.unwrap = unwrap; + exports.expect = expect; + exports.unreachable = unreachable; +}); +enifed('@glimmer/wire-format', ['exports'], function (exports) { + 'use strict'; - var cache = container.factoryCache; - if (cache[fullName]) { - return cache[fullName]; - } - var factory = registry.resolve(fullName); - if (factory === undefined) { - return; + function is(variant) { + return function (value) { + return value[0] === variant; + }; } + var Expressions; + (function (Expressions) { + Expressions.isUnknown = is('unknown'); + Expressions.isArg = is('arg'); + Expressions.isGet = is('get'); + Expressions.isConcat = is('concat'); + Expressions.isHelper = is('helper'); + Expressions.isHasBlock = is('has-block'); + Expressions.isHasBlockParams = is('has-block-params'); + Expressions.isUndefined = is('undefined'); + function isPrimitiveValue(value) { + if (value === null) { + return true; + } + return typeof value !== 'object'; + } + Expressions.isPrimitiveValue = isPrimitiveValue; + })(Expressions || (exports.Expressions = Expressions = {})); + var Statements; + (function (Statements) { + Statements.isText = is('text'); + Statements.isAppend = is('append'); + Statements.isComment = is('comment'); + Statements.isModifier = is('modifier'); + Statements.isBlock = is('block'); + Statements.isComponent = is('component'); + Statements.isOpenElement = is('open-element'); + Statements.isFlushElement = is('flush-element'); + Statements.isCloseElement = is('close-element'); + Statements.isStaticAttr = is('static-attr'); + Statements.isDynamicAttr = is('dynamic-attr'); + Statements.isYield = is('yield'); + Statements.isPartial = is('partial'); + Statements.isDynamicArg = is('dynamic-arg'); + Statements.isStaticArg = is('static-arg'); + Statements.isTrustingAttr = is('trusting-attr'); + Statements.isDebugger = is('debugger'); + function isAttribute(val) { + return val[0] === 'static-attr' || val[0] === 'dynamic-attr'; + } + Statements.isAttribute = isAttribute; + function isArgument(val) { + return val[0] === 'static-arg' || val[0] === 'dynamic-arg'; + } + Statements.isArgument = isArgument; + function isParameter(val) { + return isAttribute(val) || isArgument(val); + } + Statements.isParameter = isParameter; + function getParameterName(s) { + return s[1]; + } + Statements.getParameterName = getParameterName; + })(Statements || (exports.Statements = Statements = {})); - var type = fullName.split(':')[0]; - if (!factory || typeof factory.extend !== 'function' || !_emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS && type === 'model') { - if (factory && typeof factory._onLookup === 'function') { - factory._onLookup(fullName); - } + exports.is = is; + exports.Expressions = Expressions; + exports.Statements = Statements; +}); +enifed('backburner', ['exports'], function (exports) { 'use strict'; - // TODO: think about a 'safe' merge style extension - // for now just fallback to create time injection - cache[fullName] = factory; - return factory; - } else { - var injections = injectionsFor(container, fullName); - var factoryInjections = factoryInjectionsFor(container, fullName); - var cacheable = !areInjectionsDynamic(injections) && !areInjectionsDynamic(factoryInjections); +var NUMBER = /\d+/; - factoryInjections._toString = registry.makeToString(factory, fullName); +function each(collection, callback) { + for (var i = 0; i < collection.length; i++) { + callback(collection[i]); + } +} - var injectedFactory = factory.extend(injections); +function isString(suspect) { + return typeof suspect === 'string'; +} - // TODO - remove all `container` injections when Ember reaches v3.0.0 - injectDeprecatedContainer(injectedFactory.prototype, container); - injectedFactory.reopenClass(factoryInjections); +function isFunction(suspect) { + return typeof suspect === 'function'; +} - if (factory && typeof factory._onLookup === 'function') { - factory._onLookup(fullName); - } +function isNumber(suspect) { + return typeof suspect === 'number'; +} - if (cacheable) { - cache[fullName] = injectedFactory; - } +function isCoercableNumber(number) { + return isNumber(number) || NUMBER.test(number); +} - return injectedFactory; - } - } +function binarySearch(time, timers) { + var start = 0; + var end = timers.length - 2; + var middle, l; - function injectionsFor(container, fullName) { - var registry = container.registry; - var splitName = fullName.split(':'); - var type = splitName[0]; + while (start < end) { + // since timers is an array of pairs 'l' will always + // be an integer + l = (end - start) / 2; - var injections = buildInjections(container, registry.getTypeInjections(type), registry.getInjections(fullName)); - injections._debugContainerKey = fullName; - - _emberUtils.setOwner(injections, container.owner); + // compensate for the index in case even number + // of pairs inside timers + middle = start + l - (l % 2); - return injections; + if (time >= timers[middle]) { + start = middle + 2; + } else { + end = middle; + } } - function factoryInjectionsFor(container, fullName) { - var registry = container.registry; - var splitName = fullName.split(':'); - var type = splitName[0]; + return (time >= timers[start]) ? start + 2 : start; +} - var factoryInjections = buildInjections(container, registry.getFactoryTypeInjections(type), registry.getFactoryInjections(fullName)); - factoryInjections._debugContainerKey = fullName; +function Queue(name, options, globalOptions) { + this.name = name; + this.globalOptions = globalOptions || {}; + this.options = options; + this._queue = []; + this.targetQueues = {}; + this._queueBeingFlushed = undefined; +} - return factoryInjections; - } +Queue.prototype = { + push: function(target, method, args, stack) { + var queue = this._queue; + queue.push(target, method, args, stack); - function instantiate(container, fullName) { - var factory = factoryFor(container, fullName); - var lazyInjections = undefined, - validationCache = undefined; + return { + queue: this, + target: target, + method: method + }; + }, - if (container.registry.getOption(fullName, 'instantiate') === false) { - return factory; - } + pushUniqueWithoutGuid: function(target, method, args, stack) { + var queue = this._queue; - if (factory) { - if (typeof factory.create !== 'function') { - throw new Error('Failed to create an instance of \'' + fullName + '\'. Most likely an improperly defined class or' + ' an invalid module export.'); + for (var i = 0, l = queue.length; i < l; i += 4) { + var currentTarget = queue[i]; + var currentMethod = queue[i+1]; + + if (currentTarget === target && currentMethod === method) { + queue[i+2] = args; // replace args + queue[i+3] = stack; // replace stack + return; } + } - validationCache = container.validationCache; + queue.push(target, method, args, stack); + }, - _emberMetal.runInDebug(function () { - // Ensure that all lazy injections are valid at instantiation time - if (!validationCache[fullName] && typeof factory._lazyInjections === 'function') { - lazyInjections = factory._lazyInjections(); - lazyInjections = container.registry.normalizeInjectionsHash(lazyInjections); + targetQueue: function(targetQueue, target, method, args, stack) { + var queue = this._queue; - container.registry.validateInjections(lazyInjections); - } - }); + for (var i = 0, l = targetQueue.length; i < l; i += 2) { + var currentMethod = targetQueue[i]; + var currentIndex = targetQueue[i + 1]; - validationCache[fullName] = true; + if (currentMethod === method) { + queue[currentIndex + 2] = args; // replace args + queue[currentIndex + 3] = stack; // replace stack + return; + } + } - var obj = undefined; + targetQueue.push( + method, + queue.push(target, method, args, stack) - 4 + ); + }, - if (typeof factory.extend === 'function') { - // assume the factory was extendable and is already injected - obj = factory.create(); - } else { - // assume the factory was extendable - // to create time injections - // TODO: support new'ing for instantiation and merge injections for pure JS Functions - var injections = injectionsFor(container, fullName); + pushUniqueWithGuid: function(guid, target, method, args, stack) { + var hasLocalQueue = this.targetQueues[guid]; - // Ensure that a container is available to an object during instantiation. - // TODO - remove when Ember reaches v3.0.0 - // This "fake" container will be replaced after instantiation with a - // property that raises deprecations every time it is accessed. - injections.container = container._fakeContainerToInject; - obj = factory.create(injections); + if (hasLocalQueue) { + this.targetQueue(hasLocalQueue, target, method, args, stack); + } else { + this.targetQueues[guid] = [ + method, + this._queue.push(target, method, args, stack) - 4 + ]; + } - // TODO - remove when Ember reaches v3.0.0 - if (!Object.isFrozen(obj) && 'container' in obj) { - injectDeprecatedContainer(obj, container); - } - } + return { + queue: this, + target: target, + method: method + }; + }, - return obj; + pushUnique: function(target, method, args, stack) { + var KEY = this.globalOptions.GUID_KEY; + + if (target && KEY) { + var guid = target[KEY]; + if (guid) { + return this.pushUniqueWithGuid(guid, target, method, args, stack); + } } - } - // TODO - remove when Ember reaches v3.0.0 - function injectDeprecatedContainer(object, container) { - Object.defineProperty(object, 'container', { - configurable: true, - enumerable: false, - get: function () { - _emberMetal.deprecate('Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.', false, { id: 'ember-application.injected-container', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_injected-container-access' }); - return this[CONTAINER_OVERRIDE] || container; - }, + this.pushUniqueWithoutGuid(target, method, args, stack); - set: function (value) { - _emberMetal.deprecate('Providing the `container` property to ' + this + ' is deprecated. Please use `Ember.setOwner` or `owner.ownerInjection()` instead to provide an owner to the instance being created.', false, { id: 'ember-application.injected-container', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_injected-container-access' }); + return { + queue: this, + target: target, + method: method + }; + }, - this[CONTAINER_OVERRIDE] = value; + invoke: function(target, method, args /*, onError, errorRecordedForStack */) { + if (args && args.length > 0) { + method.apply(target, args); + } else { + method.call(target); + } + }, - return value; + invokeWithOnError: function(target, method, args, onError, errorRecordedForStack) { + try { + if (args && args.length > 0) { + method.apply(target, args); + } else { + method.call(target); } - }); - } - - function eachDestroyable(container, callback) { - var cache = container.cache; - var keys = Object.keys(cache); + } catch(error) { + onError(error, errorRecordedForStack); + } + }, - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var value = cache[key]; + flush: function(sync) { + var queue = this._queue; + var length = queue.length; - if (container.registry.getOption(key, 'instantiate') !== false) { - callback(value); - } + if (length === 0) { + return; } - } - function resetCache(container) { - eachDestroyable(container, function (value) { - if (value.destroy) { - value.destroy(); - } - }); + var globalOptions = this.globalOptions; + var options = this.options; + var before = options && options.before; + var after = options && options.after; + var onError = globalOptions.onError || (globalOptions.onErrorTarget && + globalOptions.onErrorTarget[globalOptions.onErrorMethod]); + var target, method, args, errorRecordedForStack; + var invoke = onError ? this.invokeWithOnError : this.invoke; - container.cache.dict = _emberUtils.dictionary(null); - } + this.targetQueues = Object.create(null); + var queueItems = this._queueBeingFlushed = this._queue.slice(); + this._queue = []; - function resetMember(container, fullName) { - var member = container.cache[fullName]; + if (before) { + before(); + } - delete container.factoryCache[fullName]; + for (var i = 0; i < length; i += 4) { + target = queueItems[i]; + method = queueItems[i+1]; + args = queueItems[i+2]; + errorRecordedForStack = queueItems[i+3]; // Debugging assistance - if (member) { - delete container.cache[fullName]; + if (isString(method)) { + method = target[method]; + } - if (member.destroy) { - member.destroy(); + // method could have been nullified / canceled during flush + if (method) { + // + // ** Attention intrepid developer ** + // + // To find out the stack of this task when it was scheduled onto + // the run loop, add the following to your app.js: + // + // Ember.run.backburner.DEBUG = true; // NOTE: This slows your app, don't leave it on in production. + // + // Once that is in place, when you are at a breakpoint and navigate + // here in the stack explorer, you can look at `errorRecordedForStack.stack`, + // which will be the captured stack when this job was scheduled. + // + // One possible long-term solution is the following Chrome issue: + // https://bugs.chromium.org/p/chromium/issues/detail?id=332624 + // + invoke(target, method, args, onError, errorRecordedForStack); } } - } - - function buildFakeContainerWithDeprecations(container) { - var fakeContainer = {}; - var propertyMappings = { - lookup: 'lookup', - lookupFactory: '_lookupFactory' - }; - for (var containerProperty in propertyMappings) { - fakeContainer[containerProperty] = buildFakeContainerFunction(container, containerProperty, propertyMappings[containerProperty]); + if (after) { + after(); } - return fakeContainer; - } + this._queueBeingFlushed = undefined; - function buildFakeContainerFunction(container, containerProperty, ownerProperty) { - return function () { - _emberMetal.deprecate('Using the injected `container` is deprecated. Please use the `getOwner` helper to access the owner of this object and then call `' + ownerProperty + '` instead.', false, { - id: 'ember-application.injected-container', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x#toc_injected-container-access' - }); - return container[containerProperty].apply(container, arguments); - }; - } -}); -enifed('container/index', ['exports', 'container/registry', 'container/container'], function (exports, _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 - */ + if (sync !== false && + this._queue.length > 0) { + // check if new items have been added + this.flush(true); + } + }, - 'use strict'; + cancel: function(actionToCancel) { + var queue = this._queue, currentTarget, currentMethod, i, l; + var target = actionToCancel.target; + var method = actionToCancel.method; + var GUID_KEY = this.globalOptions.GUID_KEY; - exports.Registry = _containerRegistry.default; - exports.privatize = _containerRegistry.privatize; - exports.Container = _containerContainer.default; - exports.buildFakeContainerWithDeprecations = _containerContainer.buildFakeContainerWithDeprecations; -}); -enifed('container/registry', ['exports', 'ember-utils', 'ember-metal', 'container/container'], function (exports, _emberUtils, _emberMetal, _containerContainer) { - 'use strict'; + if (GUID_KEY && this.targetQueues && target) { + var targetQueue = this.targetQueues[target[GUID_KEY]]; - exports.default = Registry; - exports.privatize = privatize; + if (targetQueue) { + for (i = 0, l = targetQueue.length; i < l; i++) { + if (targetQueue[i] === method) { + targetQueue.splice(i, 1); + } + } + } + } - var VALID_FULL_NAME_REGEXP = /^[^:]+:[^:]+$/; + for (i = 0, l = queue.length; i < l; i += 4) { + currentTarget = queue[i]; + currentMethod = queue[i+1]; - /** - A registry used to store factory and option information keyed - by type. - - A `Registry` stores the factory and option information needed by a - `Container` to instantiate and cache objects. - - The API for `Registry` is still in flux and should not be considered stable. - - @private - @class Registry - @since 1.11.0 - */ + if (currentTarget === target && + currentMethod === method) { + queue.splice(i, 4); + return true; + } + } - function Registry(options) { - this.fallback = options && options.fallback ? options.fallback : null; + // if not found in current queue + // could be in the queue that is being flushed + queue = this._queueBeingFlushed; - if (options && options.resolver) { - this.resolver = options.resolver; + if (!queue) { + return; + } - if (typeof this.resolver === 'function') { - deprecateResolverFunction(this); + for (i = 0, l = queue.length; i < l; i += 4) { + currentTarget = queue[i]; + currentMethod = queue[i+1]; + + if (currentTarget === target && + currentMethod === method) { + // don't mess with array during flush + // just nullify the method + queue[i+1] = null; + return true; } } + } +}; - this.registrations = _emberUtils.dictionary(options && options.registrations ? options.registrations : null); +function DeferredActionQueues(queueNames, options) { + var queues = this.queues = {}; + this.queueNames = queueNames = queueNames || []; - this._typeInjections = _emberUtils.dictionary(null); - this._injections = _emberUtils.dictionary(null); - this._factoryTypeInjections = _emberUtils.dictionary(null); - this._factoryInjections = _emberUtils.dictionary(null); + this.options = options; - this._localLookupCache = new _emberUtils.EmptyObject(); - this._normalizeCache = _emberUtils.dictionary(null); - this._resolveCache = _emberUtils.dictionary(null); - this._failCache = _emberUtils.dictionary(null); + each(queueNames, function(queueName) { + queues[queueName] = new Queue(queueName, options[queueName], options); + }); +} - this._options = _emberUtils.dictionary(null); - this._typeOptions = _emberUtils.dictionary(null); - } +function noSuchQueue(name) { + throw new Error('You attempted to schedule an action in a queue (' + name + ') that doesn\'t exist'); +} - Registry.prototype = { - /** - A backup registry for resolving registrations when no matches can be found. - @private - @property fallback - @type Registry - */ - fallback: null, +function noSuchMethod(name) { + throw new Error('You attempted to schedule an action in a queue (' + name + ') for a method that doesn\'t exist'); +} - /** - An object that has a `resolve` method that resolves a name. - @private - @property resolver - @type Resolver - */ - resolver: null, +DeferredActionQueues.prototype = { + schedule: function(name, target, method, args, onceFlag, stack) { + var queues = this.queues; + var queue = queues[name]; - /** - @private - @property registrations - @type InheritingDict - */ - registrations: null, + if (!queue) { + noSuchQueue(name); + } - /** - @private - @property _typeInjections - @type InheritingDict - */ - _typeInjections: null, + if (!method) { + noSuchMethod(name); + } - /** - @private - @property _injections - @type InheritingDict - */ - _injections: null, + if (onceFlag) { + return queue.pushUnique(target, method, args, stack); + } else { + return queue.push(target, method, args, stack); + } + }, - /** - @private - @property _factoryTypeInjections - @type InheritingDict - */ - _factoryTypeInjections: null, + flush: function() { + var queues = this.queues; + var queueNames = this.queueNames; + var queueName, queue; + var queueNameIndex = 0; + var numberOfQueues = queueNames.length; - /** - @private - @property _factoryInjections - @type InheritingDict - */ - _factoryInjections: null, + while (queueNameIndex < numberOfQueues) { + queueName = queueNames[queueNameIndex]; + queue = queues[queueName]; - /** - @private - @property _normalizeCache - @type InheritingDict - */ - _normalizeCache: null, + var numberOfQueueItems = queue._queue.length; - /** - @private - @property _resolveCache - @type InheritingDict - */ - _resolveCache: null, + if (numberOfQueueItems === 0) { + queueNameIndex++; + } else { + queue.flush(false /* async */); + queueNameIndex = 0; + } + } + } +}; - /** - @private - @property _options - @type InheritingDict - */ - _options: null, +function Backburner(queueNames, options) { + this.queueNames = queueNames; + this.options = options || {}; + if (!this.options.defaultQueue) { + this.options.defaultQueue = queueNames[0]; + } + this.instanceStack = []; + this._debouncees = []; + this._throttlers = []; + this._eventCallbacks = { + end: [], + begin: [] + }; - /** - @private - @property _typeOptions - @type InheritingDict - */ - _typeOptions: null, + var _this = this; + this._boundClearItems = function() { + clearItems(); + }; - /** - Creates a container based on this registry. - @private - @method container - @param {Object} options - @return {Container} created container - */ - container: function (options) { - return new _containerContainer.default(this, options); - }, + this._timerTimeoutId = undefined; + this._timers = []; - /** - Registers a factory for later injection. - Example: - ```javascript - let registry = new Registry(); - registry.register('model:user', Person, {singleton: false }); - registry.register('fruit:favorite', Orange); - registry.register('communication:main', Email, {singleton: false}); - ``` - @private - @method register - @param {String} fullName - @param {Function} factory - @param {Object} options - */ - register: function (fullName, factory) { - var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; - - _emberMetal.assert('fullName must be a proper full name', this.validateFullName(fullName)); - - if (factory === undefined) { - throw new TypeError('Attempting to register an unknown factory: \'' + fullName + '\''); - } - - var normalizedName = this.normalize(fullName); + this._platform = this.options._platform || { + setTimeout: function (fn, ms) { + return setTimeout(fn, ms); + }, + clearTimeout: function (id) { + clearTimeout(id); + } + }; - if (this._resolveCache[normalizedName]) { - throw new Error('Cannot re-register: \'' + fullName + '\', as it has already been resolved.'); - } + this._boundRunExpiredTimers = function () { + _this._runExpiredTimers(); + }; +} - delete this._failCache[normalizedName]; - this.registrations[normalizedName] = factory; - this._options[normalizedName] = options; - }, +Backburner.prototype = { + begin: function() { + var options = this.options; + var onBegin = options && options.onBegin; + var previousInstance = this.currentInstance; - /** - Unregister a fullName - ```javascript - let registry = new Registry(); - registry.register('model:user', User); - registry.resolve('model:user').create() instanceof User //=> true - registry.unregister('model:user') - registry.resolve('model:user') === undefined //=> true - ``` - @private - @method unregister - @param {String} fullName - */ - unregister: function (fullName) { - _emberMetal.assert('fullName must be a proper full name', this.validateFullName(fullName)); + if (previousInstance) { + this.instanceStack.push(previousInstance); + } - var normalizedName = this.normalize(fullName); + this.currentInstance = new DeferredActionQueues(this.queueNames, options); + this._trigger('begin', this.currentInstance, previousInstance); + if (onBegin) { + onBegin(this.currentInstance, previousInstance); + } + }, - this._localLookupCache = new _emberUtils.EmptyObject(); + end: function() { + var options = this.options; + var onEnd = options && options.onEnd; + var currentInstance = this.currentInstance; + var nextInstance = null; - delete this.registrations[normalizedName]; - delete this._resolveCache[normalizedName]; - delete this._failCache[normalizedName]; - delete this._options[normalizedName]; - }, + // Prevent double-finally bug in Safari 6.0.2 and iOS 6 + // This bug appears to be resolved in Safari 6.0.5 and iOS 7 + var finallyAlreadyCalled = false; + try { + currentInstance.flush(); + } finally { + if (!finallyAlreadyCalled) { + finallyAlreadyCalled = true; - /** - Given a fullName return the corresponding factory. - By default `resolve` will retrieve the factory from - the registry. - ```javascript - let registry = new Registry(); - registry.register('api:twitter', Twitter); - registry.resolve('api:twitter') // => Twitter - ``` - Optionally the registry can be provided with a custom resolver. - If provided, `resolve` will first provide the custom resolver - the opportunity to resolve the fullName, otherwise it will fallback - to the registry. - ```javascript - let registry = new Registry(); - registry.resolver = function(fullName) { - // lookup via the module system of choice - }; - // the twitter factory is added to the module system - registry.resolve('api:twitter') // => Twitter - ``` - @private - @method resolve - @param {String} fullName - @param {Object} [options] - @param {String} [options.source] the fullname of the request source (used for local lookups) - @return {Function} fullName's factory - */ - resolve: function (fullName, options) { - _emberMetal.assert('fullName must be a proper full name', this.validateFullName(fullName)); - var factory = resolve(this, this.normalize(fullName), options); - if (factory === undefined && this.fallback) { - var _fallback; + this.currentInstance = null; - factory = (_fallback = this.fallback).resolve.apply(_fallback, arguments); + if (this.instanceStack.length) { + nextInstance = this.instanceStack.pop(); + this.currentInstance = nextInstance; + } + this._trigger('end', currentInstance, nextInstance); + if (onEnd) { + onEnd(currentInstance, nextInstance); + } } - return factory; - }, + } + }, - /** - A hook that can be used to describe how the resolver will - attempt to find the factory. - For example, the default Ember `.describe` returns the full - class name (including namespace) where Ember's resolver expects - to find the `fullName`. - @private - @method describe - @param {String} fullName - @return {string} described fullName - */ - describe: function (fullName) { - if (this.resolver && this.resolver.lookupDescription) { - return this.resolver.lookupDescription(fullName); - } else if (this.fallback) { - return this.fallback.describe(fullName); - } else { - return fullName; - } - }, + /** + 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. - /** - A hook to enable custom fullName normalization behaviour - @private - @method normalizeFullName - @param {String} fullName - @return {string} normalized fullName - */ - normalizeFullName: function (fullName) { - if (this.resolver && this.resolver.normalize) { - return this.resolver.normalize(fullName); - } else if (this.fallback) { - return this.fallback.normalizeFullName(fullName); - } else { - return fullName; + @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); } - }, + } + }, - /** - Normalize a fullName based on the application's conventions - @private - @method normalize - @param {String} fullName - @return {string} normalized fullName - */ - normalize: function (fullName) { - return this._normalizeCache[fullName] || (this._normalizeCache[fullName] = this.normalizeFullName(fullName)); - }, + 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'); + } + }, - /** - @method makeToString - @private - @param {any} factory - @param {string} fullName - @return {function} toString function - */ - makeToString: function (factory, fullName) { - if (this.resolver && this.resolver.makeToString) { - return this.resolver.makeToString(factory, fullName); - } else if (this.fallback) { - return this.fallback.makeToString(factory, fullName); - } else { - return factory.toString(); + 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--; + } + } } - }, - - /** - Given a fullName check if the container is aware of its factory - or singleton instance. - @private - @method has - @param {String} fullName - @param {Object} [options] - @param {String} [options.source] the fullname of the request source (used for local lookups) - @return {Boolean} - */ - has: function (fullName, options) { - if (!this.isValidFullName(fullName)) { - return false; + 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'); + } + }, - var source = options && options.source && this.normalize(options.source); + run: function(/* target, method, args */) { + var length = arguments.length; + var method, target, args; - return has(this, this.normalize(fullName), source); - }, + if (length === 1) { + method = arguments[0]; + target = null; + } else { + target = arguments[0]; + method = arguments[1]; + } - /** - Allow registering options for all factories of a type. - ```javascript - let registry = new Registry(); - let container = registry.container(); - // if all of type `connection` must not be singletons - registry.optionsForType('connection', { singleton: false }); - registry.register('connection:twitter', TwitterConnection); - registry.register('connection:facebook', FacebookConnection); - let twitter = container.lookup('connection:twitter'); - let twitter2 = container.lookup('connection:twitter'); - twitter === twitter2; // => false - let facebook = container.lookup('connection:facebook'); - let facebook2 = container.lookup('connection:facebook'); - facebook === facebook2; // => false - ``` - @private - @method optionsForType - @param {String} type - @param {Object} options - */ - optionsForType: function (type, options) { - this._typeOptions[type] = options; - }, + if (isString(method)) { + method = target[method]; + } - getOptionsForType: function (type) { - var optionsForType = this._typeOptions[type]; - if (optionsForType === undefined && this.fallback) { - optionsForType = this.fallback.getOptionsForType(type); + if (length > 2) { + args = new Array(length - 2); + for (var i = 0, l = length - 2; i < l; i++) { + args[i] = arguments[i + 2]; } - return optionsForType; - }, + } else { + args = []; + } - /** - @private - @method options - @param {String} fullName - @param {Object} options - */ - options: function (fullName) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + var onError = getOnError(this.options); - var normalizedName = this.normalize(fullName); - this._options[normalizedName] = options; - }, + this.begin(); - getOptions: function (fullName) { - var normalizedName = this.normalize(fullName); - var options = this._options[normalizedName]; + // guard against Safari 6's double-finally bug + var didFinally = false; - if (options === undefined && this.fallback) { - options = this.fallback.getOptions(fullName); + if (onError) { + try { + return method.apply(target, args); + } catch(error) { + onError(error); + } finally { + if (!didFinally) { + didFinally = true; + this.end(); + } } - return options; - }, - - getOption: function (fullName, optionName) { - var options = this._options[fullName]; - - if (options && options[optionName] !== undefined) { - return options[optionName]; + } else { + try { + return method.apply(target, args); + } finally { + if (!didFinally) { + didFinally = true; + this.end(); + } } + } + }, - var type = fullName.split(':')[0]; - options = this._typeOptions[type]; - - if (options && options[optionName] !== undefined) { - return options[optionName]; - } else if (this.fallback) { - return this.fallback.getOption(fullName, optionName); - } - }, + /* + Join the passed method with an existing queue and execute immediately, + if there isn't one use `Backburner#run`. - /** - 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. - For example, provided each object of type `controller` needed a `router`. - one would do the following: - ```javascript - let registry = new Registry(); - let container = registry.container(); - registry.register('router:main', Router); - registry.register('controller:user', UserController); - registry.register('controller:post', PostController); - registry.typeInjection('controller', 'router', 'router:main'); - let user = container.lookup('controller:user'); - let post = container.lookup('controller:post'); - user.router instanceof Router; //=> true - post.router instanceof Router; //=> true - // both controllers share the same router - user.router === post.router; //=> true - ``` - @private - @method typeInjection - @param {String} type - @param {String} property - @param {String} fullName - */ - typeInjection: function (type, property, fullName) { - _emberMetal.assert('fullName must be a proper full name', this.validateFullName(fullName)); + The join method is like the run method except that it will schedule into + an existing queue if one already exists. In either case, the join method will + immediately execute the passed in function and return its result. - var fullNameType = fullName.split(':')[0]; - if (fullNameType === type) { - throw new Error('Cannot inject a \'' + fullName + '\' on other ' + type + '(s).'); - } + @method join + @param {Object} target + @param {Function} method The method to be executed + @param {any} args The method arguments + @return method result + */ + join: function(/* target, method, args */) { + if (!this.currentInstance) { + return this.run.apply(this, arguments); + } - var injections = this._typeInjections[type] || (this._typeInjections[type] = []); + var length = arguments.length; + var method, target; - injections.push({ - property: property, - fullName: fullName - }); - }, + if (length === 1) { + method = arguments[0]; + target = null; + } else { + target = arguments[0]; + method = arguments[1]; + } - /** - Defines injection rules. - These rules are used to inject dependencies onto objects when they - are instantiated. - Two forms of injections are possible: - * Injecting one fullName on another fullName - * Injecting one fullName on a type - Example: - ```javascript - let registry = new Registry(); - let container = registry.container(); - registry.register('source:main', Source); - registry.register('model:user', User); - registry.register('model:post', Post); - // injecting one fullName on another fullName - // eg. each user model gets a post model - registry.injection('model:user', 'post', 'model:post'); - // injecting one fullName on another type - registry.injection('model', 'source', 'source:main'); - let user = container.lookup('model:user'); - let post = container.lookup('model:post'); - user.source instanceof Source; //=> true - post.source instanceof Source; //=> true - user.post instanceof Post; //=> true - // and both models share the same source - user.source === post.source; //=> true - ``` - @private - @method injection - @param {String} factoryName - @param {String} property - @param {String} injectionName - */ - injection: function (fullName, property, injectionName) { - this.validateFullName(injectionName); - var normalizedInjectionName = this.normalize(injectionName); + if (isString(method)) { + method = target[method]; + } - if (fullName.indexOf(':') === -1) { - return this.typeInjection(fullName, property, normalizedInjectionName); + if (length === 1) { + return method(); + } else if (length === 2) { + return method.call(target); + } else { + var args = new Array(length - 2); + for (var i = 0, l = length - 2; i < l; i++) { + args[i] = arguments[i + 2]; } + return method.apply(target, args); + } + }, - _emberMetal.assert('fullName must be a proper full name', this.validateFullName(fullName)); - var normalizedName = this.normalize(fullName); - var injections = this._injections[normalizedName] || (this._injections[normalizedName] = []); + /* + Defer the passed function to run inside the specified queue. - injections.push({ - property: property, - fullName: normalizedInjectionName - }); - }, + @method defer + @param {String} queueName + @param {Object} target + @param {Function|String} method The method or method name to be executed + @param {any} args The method arguments + @return method result + */ + defer: function(queueName /* , target, method, args */) { + var length = arguments.length; + var method, target, args; - /** - Used only via `factoryInjection`. - Provides a specialized form of injection, specifically enabling - all factory of one type to be injected with a reference to another - object. - For example, provided each factory of type `model` needed a `store`. - one would do the following: - ```javascript - let registry = new Registry(); - registry.register('store:main', SomeStore); - registry.factoryTypeInjection('model', 'store', 'store:main'); - let store = registry.lookup('store:main'); - let UserFactory = registry.lookupFactory('model:user'); - UserFactory.store instanceof SomeStore; //=> true - ``` - @private - @method factoryTypeInjection - @param {String} type - @param {String} property - @param {String} fullName - */ - factoryTypeInjection: function (type, property, fullName) { - var injections = this._factoryTypeInjections[type] || (this._factoryTypeInjections[type] = []); - - injections.push({ - property: property, - fullName: this.normalize(fullName) - }); - }, + if (length === 2) { + method = arguments[1]; + target = null; + } else { + target = arguments[1]; + method = arguments[2]; + } - /** - Defines factory injection rules. - Similar to regular injection rules, but are run against factories, via - `Registry#lookupFactory`. - These rules are used to inject objects onto factories when they - are looked up. - Two forms of injections are possible: - * Injecting one fullName on another fullName - * Injecting one fullName on a type - Example: - ```javascript - let registry = new Registry(); - let container = registry.container(); - registry.register('store:main', Store); - registry.register('store:secondary', OtherStore); - registry.register('model:user', User); - registry.register('model:post', Post); - // injecting one fullName on another type - registry.factoryInjection('model', 'store', 'store:main'); - // injecting one fullName on another fullName - registry.factoryInjection('model:post', 'secondaryStore', 'store:secondary'); - let UserFactory = container.lookupFactory('model:user'); - let PostFactory = container.lookupFactory('model:post'); - let store = container.lookup('store:main'); - UserFactory.store instanceof Store; //=> true - UserFactory.secondaryStore instanceof OtherStore; //=> false - PostFactory.store instanceof Store; //=> true - PostFactory.secondaryStore instanceof OtherStore; //=> true - // and both models share the same source instance - UserFactory.store === PostFactory.store; //=> true - ``` - @private - @method factoryInjection - @param {String} factoryName - @param {String} property - @param {String} injectionName - */ - factoryInjection: function (fullName, property, injectionName) { - var normalizedName = this.normalize(fullName); - var normalizedInjectionName = this.normalize(injectionName); + if (isString(method)) { + method = target[method]; + } - this.validateFullName(injectionName); + var stack = this.DEBUG ? new Error() : undefined; - if (fullName.indexOf(':') === -1) { - return this.factoryTypeInjection(normalizedName, property, normalizedInjectionName); + if (length > 3) { + args = new Array(length - 3); + for (var i = 3; i < length; i++) { + args[i-3] = arguments[i]; } + } else { + args = undefined; + } - var injections = this._factoryInjections[normalizedName] || (this._factoryInjections[normalizedName] = []); + if (!this.currentInstance) { createAutorun(this); } + return this.currentInstance.schedule(queueName, target, method, args, false, stack); + }, - injections.push({ - property: property, - fullName: normalizedInjectionName - }); - }, + deferOnce: function(queueName /* , target, method, args */) { + var length = arguments.length; + var method, target, args; - /** - @private - @method knownForType - @param {String} type the type to iterate over - */ - knownForType: function (type) { - var fallbackKnown = undefined, - resolverKnown = undefined; + if (length === 2) { + method = arguments[1]; + target = null; + } else { + target = arguments[1]; + method = arguments[2]; + } - var localKnown = _emberUtils.dictionary(null); - var registeredNames = Object.keys(this.registrations); - for (var index = 0; index < registeredNames.length; index++) { - var fullName = registeredNames[index]; - var itemType = fullName.split(':')[0]; + if (isString(method)) { + method = target[method]; + } - if (itemType === type) { - localKnown[fullName] = true; - } - } + var stack = this.DEBUG ? new Error() : undefined; - if (this.fallback) { - fallbackKnown = this.fallback.knownForType(type); + if (length > 3) { + args = new Array(length - 3); + for (var i = 3; i < length; i++) { + args[i-3] = arguments[i]; } + } else { + args = undefined; + } - if (this.resolver && this.resolver.knownForType) { - resolverKnown = this.resolver.knownForType(type); - } + if (!this.currentInstance) { + createAutorun(this); + } + return this.currentInstance.schedule(queueName, target, method, args, true, stack); + }, - return _emberUtils.assign({}, fallbackKnown, localKnown, resolverKnown); - }, + setTimeout: function() { + var l = arguments.length; + var args = new Array(l); - validateFullName: function (fullName) { - if (!this.isValidFullName(fullName)) { - throw new TypeError('Invalid Fullname, expected: \'type:name\' got: ' + fullName); - } + for (var x = 0; x < l; x++) { + args[x] = arguments[x]; + } - return true; - }, + var length = args.length, + method, wait, target, + methodOrTarget, methodOrWait, methodOrArgs; - isValidFullName: function (fullName) { - return !!VALID_FULL_NAME_REGEXP.test(fullName); - }, + if (length === 0) { + return; + } else if (length === 1) { + method = args.shift(); + wait = 0; + } else if (length === 2) { + methodOrTarget = args[0]; + methodOrWait = args[1]; - validateInjections: function (injections) { - if (!injections) { - return; + if (isFunction(methodOrWait) || isFunction(methodOrTarget[methodOrWait])) { + target = args.shift(); + method = args.shift(); + wait = 0; + } else if (isCoercableNumber(methodOrWait)) { + method = args.shift(); + wait = args.shift(); + } else { + method = args.shift(); + wait = 0; } + } else { + var last = args[args.length - 1]; - var fullName = undefined; + if (isCoercableNumber(last)) { + wait = args.pop(); + } else { + wait = 0; + } - for (var i = 0; i < injections.length; i++) { - fullName = injections[i].fullName; + methodOrTarget = args[0]; + methodOrArgs = args[1]; - if (!this.has(fullName)) { - throw new Error('Attempting to inject an unknown injection: \'' + fullName + '\''); - } + if (isFunction(methodOrArgs) || (isString(methodOrArgs) && + methodOrTarget !== null && + methodOrArgs in methodOrTarget)) { + target = args.shift(); + method = args.shift(); + } else { + method = args.shift(); } - }, + } - normalizeInjectionsHash: function (hash) { - var injections = []; + var executeAt = Date.now() + parseInt(wait !== wait ? 0 : wait, 10); - for (var key in hash) { - if (hash.hasOwnProperty(key)) { - _emberMetal.assert('Expected a proper full name, given \'' + hash[key] + '\'', this.validateFullName(hash[key])); + if (isString(method)) { + method = target[method]; + } - injections.push({ - property: key, - fullName: hash[key] - }); + var onError = getOnError(this.options); + + function fn() { + if (onError) { + try { + method.apply(target, args); + } catch (e) { + onError(e); } + } else { + method.apply(target, args); } + } - return injections; - }, + return this._setTimeout(fn, executeAt); + }, - getInjections: function (fullName) { - var injections = this._injections[fullName] || []; - if (this.fallback) { - injections = injections.concat(this.fallback.getInjections(fullName)); - } - return injections; - }, + _setTimeout: function (fn, executeAt) { + if (this._timers.length === 0) { + this._timers.push(executeAt, fn); + this._installTimerTimeout(); + return fn; + } - getTypeInjections: function (type) { - var injections = this._typeInjections[type] || []; - if (this.fallback) { - injections = injections.concat(this.fallback.getTypeInjections(type)); - } - return injections; - }, + // find position to insert + var i = binarySearch(executeAt, this._timers); - getFactoryInjections: function (fullName) { - var injections = this._factoryInjections[fullName] || []; - if (this.fallback) { - injections = injections.concat(this.fallback.getFactoryInjections(fullName)); - } - return injections; - }, + this._timers.splice(i, 0, executeAt, fn); - getFactoryTypeInjections: function (type) { - var injections = this._factoryTypeInjections[type] || []; - if (this.fallback) { - injections = injections.concat(this.fallback.getFactoryTypeInjections(type)); - } - return injections; + // we should be the new earliest timer if i == 0 + if (i === 0) { + this._reinstallTimerTimeout(); } - }; - - function deprecateResolverFunction(registry) { - _emberMetal.deprecate('Passing a `resolver` function into a Registry is deprecated. Please pass in a Resolver object with a `resolve` method.', false, { id: 'ember-application.registry-resolver-as-function', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_registry-resolver-as-function' }); - registry.resolver = { - resolve: registry.resolver - }; - } - /** - Given a fullName and a source fullName returns the fully resolved - fullName. Used to allow for local lookup. - - ```javascript - let registry = new Registry(); - - // the twitter factory is added to the module system - registry.expandLocalLookup('component:post-title', { source: 'template:post' }) // => component:post/post-title - ``` - - @private - @method expandLocalLookup - @param {String} fullName - @param {Object} [options] - @param {String} [options.source] the fullname of the request source (used for local lookups) - @return {String} fullName - */ - Registry.prototype.expandLocalLookup = function Registry_expandLocalLookup(fullName, options) { - if (this.resolver && this.resolver.expandLocalLookup) { - _emberMetal.assert('fullName must be a proper full name', this.validateFullName(fullName)); - _emberMetal.assert('options.source must be provided to expandLocalLookup', options && options.source); - _emberMetal.assert('options.source must be a proper full name', this.validateFullName(options.source)); + return fn; + }, - var normalizedFullName = this.normalize(fullName); - var normalizedSource = this.normalize(options.source); + throttle: function(target, method /* , args, wait, [immediate] */) { + var backburner = this; + var args = new Array(arguments.length); + for (var i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + var immediate = args.pop(); + var wait, throttler, index, timer; - return expandLocalLookup(this, normalizedFullName, normalizedSource); - } else if (this.fallback) { - return this.fallback.expandLocalLookup(fullName, options); + if (isNumber(immediate) || isString(immediate)) { + wait = immediate; + immediate = true; } else { - return null; + wait = args.pop(); } - }; - function expandLocalLookup(registry, normalizedName, normalizedSource) { - var cache = registry._localLookupCache; - var normalizedNameCache = cache[normalizedName]; + wait = parseInt(wait, 10); - if (!normalizedNameCache) { - normalizedNameCache = cache[normalizedName] = new _emberUtils.EmptyObject(); - } + index = findThrottler(target, method, this._throttlers); + if (index > -1) { return this._throttlers[index]; } // throttled - var cached = normalizedNameCache[normalizedSource]; + timer = this._platform.setTimeout(function() { + if (!immediate) { + backburner.run.apply(backburner, args); + } + var index = findThrottler(target, method, backburner._throttlers); + if (index > -1) { + backburner._throttlers.splice(index, 1); + } + }, wait); - if (cached !== undefined) { - return cached; + if (immediate) { + this.run.apply(this, args); } - var expanded = registry.resolver.expandLocalLookup(normalizedName, normalizedSource); + throttler = [target, method, timer]; - return normalizedNameCache[normalizedSource] = expanded; - } + this._throttlers.push(throttler); - function resolve(registry, normalizedName, options) { - if (options && options.source) { - // when `source` is provided expand normalizedName - // and source into the full normalizedName - normalizedName = registry.expandLocalLookup(normalizedName, options); + return throttler; + }, - // if expandLocalLookup returns falsey, we do not support local lookup - if (!normalizedName) { - return; - } + debounce: function(target, method /* , args, wait, [immediate] */) { + var backburner = this; + var args = new Array(arguments.length); + for (var i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; } - var cached = registry._resolveCache[normalizedName]; - if (cached !== undefined) { - return cached; + var immediate = args.pop(); + var wait, index, debouncee, timer; + + if (isNumber(immediate) || isString(immediate)) { + wait = immediate; + immediate = false; + } else { + wait = args.pop(); } - if (registry._failCache[normalizedName]) { - return; + + wait = parseInt(wait, 10); + // Remove debouncee + index = findDebouncee(target, method, this._debouncees); + + if (index > -1) { + debouncee = this._debouncees[index]; + this._debouncees.splice(index, 1); + this._platform.clearTimeout(debouncee[2]); } - var resolved = undefined; + timer = this._platform.setTimeout(function() { + if (!immediate) { + backburner.run.apply(backburner, args); + } + var index = findDebouncee(target, method, backburner._debouncees); + if (index > -1) { + backburner._debouncees.splice(index, 1); + } + }, wait); - if (registry.resolver) { - resolved = registry.resolver.resolve(normalizedName); + if (immediate && index === -1) { + backburner.run.apply(backburner, args); } - if (resolved === undefined) { - resolved = registry.registrations[normalizedName]; + debouncee = [ + target, + method, + timer + ]; + + backburner._debouncees.push(debouncee); + + return debouncee; + }, + + cancelTimers: function() { + each(this._throttlers, this._boundClearItems); + this._throttlers = []; + + each(this._debouncees, this._boundClearItems); + this._debouncees = []; + + this._clearTimerTimeout(); + this._timers = []; + + if (this._autorun) { + this._platform.clearTimeout(this._autorun); + this._autorun = null; } + }, - if (resolved === undefined) { - registry._failCache[normalizedName] = true; + hasTimers: function() { + return !!this._timers.length || !!this._debouncees.length || !!this._throttlers.length || this._autorun; + }, + + cancel: function (timer) { + var timerType = typeof timer; + + if (timer && timerType === 'object' && timer.queue && timer.method) { // we're cancelling a deferOnce + return timer.queue.cancel(timer); + } else if (timerType === 'function') { // we're cancelling a setTimeout + for (var i = 0, l = this._timers.length; i < l; i += 2) { + if (this._timers[i + 1] === timer) { + this._timers.splice(i, 2); // remove the two elements + if (i === 0) { + this._reinstallTimerTimeout(); + } + return true; + } + } + } else if (Object.prototype.toString.call(timer) === '[object Array]'){ // we're cancelling a throttle or debounce + return this._cancelItem(findThrottler, this._throttlers, timer) || + this._cancelItem(findDebouncee, this._debouncees, timer); } else { - registry._resolveCache[normalizedName] = resolved; + return; // timer was null or not a timer } + }, - return resolved; - } + _cancelItem: function(findMethod, array, timer){ + var item, index; - function has(registry, fullName, source) { - return registry.resolve(fullName, { source: source }) !== undefined; - } + if (timer.length < 3) { return false; } - var privateNames = _emberUtils.dictionary(null); - var privateSuffix = '' + Math.random() + Date.now(); + index = findMethod(timer[0], timer[1], array); - function privatize(_ref) { - var fullName = _ref[0]; + if (index > -1) { - var name = privateNames[fullName]; - if (name) { - return name; + item = array[index]; + + if (item[2] === timer[2]) { + array.splice(index, 1); + this._platform.clearTimeout(timer[2]); + return true; + } } - var _fullName$split = fullName.split(':'); + return false; + }, - var type = _fullName$split[0]; - var rawName = _fullName$split[1]; + _runExpiredTimers: function () { + this._timerTimeoutId = undefined; + this.run(this, this._scheduleExpiredTimers); + }, - return privateNames[fullName] = _emberUtils.intern(type + ':' + rawName + '-' + privateSuffix); - } -}); -enifed('dag-map', ['exports'], function (exports) { 'use strict'; + _scheduleExpiredTimers: function () { + var n = Date.now(); + var timers = this._timers; + var i = 0; + var l = timers.length; + for (; i < l; i += 2) { + var executeAt = timers[i]; + var fn = timers[i+1]; + if (executeAt <= n) { + this.schedule(this.options.defaultQueue, null, fn); + } else { + break; + } + } + timers.splice(0, i); + this._installTimerTimeout(); + }, -/** - * A topologically ordered map of key/value pairs with a simple API for adding constraints. - * - * Edges can forward reference keys that have not been added yet (the forward reference will - * map the key to undefined). - */ -var DAG = (function () { - function DAG() { - this._vertices = new Vertices(); - } - /** - * Adds a key/value pair with dependencies on other key/value pairs. - * - * @public - * @param key The key of the vertex to be added. - * @param value The value of that vertex. - * @param before A key or array of keys of the vertices that must - * be visited before this vertex. - * @param after An string or array of strings with the keys of the - * vertices that must be after this vertex is visited. - */ - DAG.prototype.add = function (key, value, before, after) { - if (!key) - throw new Error('argument `key` is required'); - var vertices = this._vertices; - var v = vertices.add(key); - v.val = value; - if (before) { - if (typeof before === "string") { - vertices.addEdge(v, vertices.add(before)); - } - else { - for (var i = 0; i < before.length; i++) { - vertices.addEdge(v, vertices.add(before[i])); - } - } - } - if (after) { - if (typeof after === "string") { - vertices.addEdge(vertices.add(after), v); - } - else { - for (var i = 0; i < after.length; i++) { - vertices.addEdge(vertices.add(after[i]), v); - } - } - } - }; - /** - * @deprecated please use add. - */ - DAG.prototype.addEdges = function (key, value, before, after) { - this.add(key, value, before, after); - }; - /** - * Visits key/value pairs in topological order. - * - * @public - * @param callback The function to be invoked with each key/value. - */ - DAG.prototype.each = function (callback) { - this._vertices.walk(callback); - }; - /** - * @deprecated please use each. - */ - DAG.prototype.topsort = function (callback) { - this.each(callback); - }; - return DAG; -}()); -/** @private */ -var Vertices = (function () { - function Vertices() { - this.length = 0; - this.stack = new IntStack(); - this.path = new IntStack(); - this.result = new IntStack(); + _reinstallTimerTimeout: function () { + this._clearTimerTimeout(); + this._installTimerTimeout(); + }, + + _clearTimerTimeout: function () { + if (!this._timerTimeoutId) { + return; } - Vertices.prototype.add = function (key) { - if (!key) - throw new Error("missing key"); - var l = this.length | 0; - var vertex; - for (var i = 0; i < l; i++) { - vertex = this[i]; - if (vertex.key === key) - return vertex; - } - this.length = l + 1; - return this[l] = { - idx: l, - key: key, - val: undefined, - out: false, - flag: false, - length: 0 - }; - }; - Vertices.prototype.addEdge = function (v, w) { - this.check(v, w.key); - var l = w.length | 0; - for (var i = 0; i < l; i++) { - if (w[i] === v.idx) - return; - } - w.length = l + 1; - w[l] = v.idx; - v.out = true; - }; - Vertices.prototype.walk = function (cb) { - this.reset(); - for (var i = 0; i < this.length; i++) { - var vertex = this[i]; - if (vertex.out) - continue; - this.visit(vertex, ""); - } - this.each(this.result, cb); - }; - Vertices.prototype.check = function (v, w) { - if (v.key === w) { - throw new Error("cycle detected: " + w + " <- " + w); - } - // quick check - if (v.length === 0) - return; - // shallow check - for (var i = 0; i < v.length; i++) { - var key = this[v[i]].key; - if (key === w) { - throw new Error("cycle detected: " + w + " <- " + v.key + " <- " + w); - } - } - // deep check - this.reset(); - this.visit(v, w); - if (this.path.length > 0) { - var msg_1 = "cycle detected: " + w; - this.each(this.path, function (key) { - msg_1 += " <- " + key; - }); - throw new Error(msg_1); - } - }; - Vertices.prototype.reset = function () { - this.stack.length = 0; - this.path.length = 0; - this.result.length = 0; - for (var i = 0, l = this.length; i < l; i++) { - this[i].flag = false; - } - }; - Vertices.prototype.visit = function (start, search) { - var _a = this, stack = _a.stack, path = _a.path, result = _a.result; - stack.push(start.idx); - while (stack.length) { - var index = stack.pop() | 0; - if (index >= 0) { - // enter - var vertex = this[index]; - if (vertex.flag) - continue; - vertex.flag = true; - path.push(index); - if (search === vertex.key) - break; - // push exit - stack.push(~index); - this.pushIncoming(vertex); - } - else { - // exit - path.pop(); - result.push(~index); - } - } - }; - Vertices.prototype.pushIncoming = function (incomming) { - var stack = this.stack; - for (var i = incomming.length - 1; i >= 0; i--) { - var index = incomming[i]; - if (!this[index].flag) { - stack.push(index); - } - } - }; - Vertices.prototype.each = function (indices, cb) { - for (var i = 0, l = indices.length; i < l; i++) { - var vertex = this[indices[i]]; - cb(vertex.key, vertex.val); - } - }; - return Vertices; -}()); -/** @private */ -var IntStack = (function () { - function IntStack() { - this.length = 0; + this._platform.clearTimeout(this._timerTimeoutId); + this._timerTimeoutId = undefined; + }, + + _installTimerTimeout: function () { + if (!this._timers.length) { + return; } - IntStack.prototype.push = function (n) { - this[this.length++] = n | 0; - }; - IntStack.prototype.pop = function () { - return this[--this.length] | 0; - }; - return IntStack; -}()); + var minExpiresAt = this._timers[0]; + var n = Date.now(); + var wait = Math.max(0, minExpiresAt - n); + this._timerTimeoutId = this._platform.setTimeout(this._boundRunExpiredTimers, wait); + } +}; -exports['default'] = DAG; +Backburner.prototype.schedule = Backburner.prototype.defer; +Backburner.prototype.scheduleOnce = Backburner.prototype.deferOnce; +Backburner.prototype.later = Backburner.prototype.setTimeout; -Object.defineProperty(exports, '__esModule', { value: true }); +function getOnError(options) { + return options.onError || (options.onErrorTarget && options.onErrorTarget[options.onErrorMethod]); +} -}); -enifed('ember-application/index', ['exports', 'ember-application/initializers/dom-templates', 'ember-application/system/application', 'ember-application/system/application-instance', 'ember-application/system/resolver', 'ember-application/system/engine', 'ember-application/system/engine-instance', 'ember-application/system/engine-parent'], function (exports, _emberApplicationInitializersDomTemplates, _emberApplicationSystemApplication, _emberApplicationSystemApplicationInstance, _emberApplicationSystemResolver, _emberApplicationSystemEngine, _emberApplicationSystemEngineInstance, _emberApplicationSystemEngineParent) { - /** - @module ember - @submodule ember-application - */ +function createAutorun(backburner) { + var setTimeout = backburner._platform.setTimeout; + backburner.begin(); + backburner._autorun = setTimeout(function() { + backburner._autorun = null; + backburner.end(); + }, 0); +} - 'use strict'; +function findDebouncee(target, method, debouncees) { + return findItem(target, method, debouncees); +} - exports.Application = _emberApplicationSystemApplication.default; - exports.ApplicationInstance = _emberApplicationSystemApplicationInstance.default; - exports.Resolver = _emberApplicationSystemResolver.default; - exports.Engine = _emberApplicationSystemEngine.default; - exports.EngineInstance = _emberApplicationSystemEngineInstance.default; - exports.getEngineParent = _emberApplicationSystemEngineParent.getEngineParent; - exports.setEngineParent = _emberApplicationSystemEngineParent.setEngineParent; +function findThrottler(target, method, throttlers) { + return findItem(target, method, throttlers); +} - // add domTemplates initializer (only does something if `ember-template-compiler` - // is loaded already) -}); -enifed('ember-application/initializers/dom-templates', ['exports', 'require', 'ember-glimmer', 'ember-environment', 'ember-application/system/application'], function (exports, _require, _emberGlimmer, _emberEnvironment, _emberApplicationSystemApplication) { - 'use strict'; +function findItem(target, method, collection) { + var item; + var index = -1; - var bootstrap = function () {}; + for (var i = 0, l = collection.length; i < l; i++) { + item = collection[i]; + if (item[0] === target && item[1] === method) { + index = i; + break; + } + } - _emberApplicationSystemApplication.default.initializer({ - name: 'domTemplates', - initialize: function () { - var bootstrapModuleId = 'ember-template-compiler/system/bootstrap'; - var context = undefined; - if (_emberEnvironment.environment.hasDOM && _require.has(bootstrapModuleId)) { - bootstrap = _require.default(bootstrapModuleId).default; - context = document; - } + return index; +} - bootstrap({ context: context, hasTemplate: _emberGlimmer.hasTemplate, setTemplate: _emberGlimmer.setTemplate }); - } - }); -}); -enifed('ember-application/system/application-instance', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-environment', 'ember-views', 'ember-application/system/engine-instance'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberEnvironment, _emberViews, _emberApplicationSystemEngineInstance) { - /** - @module ember - @submodule ember-application - */ +function clearItems(item) { + this._platform.clearTimeout(item[2]); +} + +exports['default'] = Backburner; +Object.defineProperty(exports, '__esModule', { value: true }); + +}); +enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'ember-metal'], function (exports, _emberUtils, _emberEnvironment, _emberMetal) { + /* globals Proxy */ 'use strict'; - var BootOptions = undefined; + var _Container$prototype; + + exports.default = Container; + exports.buildFakeContainerWithDeprecations = buildFakeContainerWithDeprecations; + var CONTAINER_OVERRIDE = _emberUtils.symbol('CONTAINER_OVERRIDE'); + var FACTORY_FOR = _emberUtils.symbol('FACTORY_FOR'); + exports.FACTORY_FOR = FACTORY_FOR; + var LOOKUP_FACTORY = _emberUtils.symbol('LOOKUP_FACTORY'); + + exports.LOOKUP_FACTORY = LOOKUP_FACTORY; /** - The `ApplicationInstance` encapsulates all of the stateful aspects of a - running `Application`. - - At a high-level, we break application boot into two distinct phases: - - * Definition time, where all of the classes, templates, and other - dependencies are loaded (typically in the browser). - * Run time, where we begin executing the application once everything - has loaded. + A container used to instantiate and cache objects. - Definition time can be expensive and only needs to happen once since it is - an idempotent operation. For example, between test runs and FastBoot - requests, the application stays the same. It is only the state that we want - to reset. + Every `Container` must be associated with a `Registry`, which is referenced + to determine the factory and options that should be used to instantiate + objects. - That state is what the `ApplicationInstance` manages: it is responsible for - creating the container that contains all application state, and disposing of - it once the particular test run or FastBoot request has finished. + The public API for `Container` is still in flux and should not be considered + stable. - @public - @class Ember.ApplicationInstance - @extends Ember.EngineInstance - */ + @private + @class Container + */ - var ApplicationInstance = _emberApplicationSystemEngineInstance.default.extend({ + function Container(registry, options) { + this.registry = registry; + this.owner = options && options.owner ? options.owner : null; + this.cache = _emberUtils.dictionary(options && options.cache ? options.cache : null); + this.factoryCache = _emberUtils.dictionary(options && options.factoryCache ? options.factoryCache : null); + this.validationCache = _emberUtils.dictionary(options && options.validationCache ? options.validationCache : null); + this._fakeContainerToInject = buildFakeContainerWithDeprecations(this); + this[CONTAINER_OVERRIDE] = undefined; + this.isDestroyed = false; + } + + Container.prototype = (_Container$prototype = { /** - The `Application` for which this is an instance. - @property {Ember.Application} application - @private - */ - application: null, + @private + @property owner + @type Object + */ + owner: null, /** - The DOM events for which the event dispatcher should listen. - By default, the application's `Ember.EventDispatcher` listens - for a set of standard DOM events, such as `mousedown` and - `keyup`, and delegates them to your application's `Ember.View` - instances. - @private - @property {Object} customEvents - */ - customEvents: null, + @private + @property registry + @type Registry + @since 1.11.0 + */ + registry: null, /** - The root DOM element of the Application as an element or a - [jQuery-compatible selector - string](http://api.jquery.com/category/selectors/). - @private - @property {String|DOMElement} rootElement - */ - rootElement: null, + @private + @property cache + @type InheritingDict + */ + cache: null, - init: function () { - this._super.apply(this, arguments); + /** + @private + @property factoryCache + @type InheritingDict + */ + factoryCache: null, - // Register this instance in the per-instance registry. - // - // Why do we need to register the instance in the first place? - // Because we need a good way for the root route (a.k.a ApplicationRoute) - // to notify us when it has created the root-most view. That view is then - // appended to the rootElement, in the case of apps, to the fixture harness - // in tests, or rendered to a string in the case of FastBoot. - this.register('-application-instance:main', this, { instantiate: false }); + /** + @private + @property validationCache + @type InheritingDict + */ + validationCache: null, + + /** + Given a fullName return a corresponding instance. + The default behaviour is for lookup to return a singleton instance. + The singleton is scoped to the container, allowing multiple containers + to all have their own locally scoped singletons. + ```javascript + let registry = new Registry(); + let container = registry.container(); + registry.register('api:twitter', Twitter); + let twitter = container.lookup('api:twitter'); + twitter instanceof Twitter; // => true + // by default the container will return singletons + let twitter2 = container.lookup('api:twitter'); + twitter2 instanceof Twitter; // => true + twitter === twitter2; //=> true + ``` + If singletons are not wanted, an optional flag can be provided at lookup. + ```javascript + let registry = new Registry(); + let container = registry.container(); + registry.register('api:twitter', Twitter); + let twitter = container.lookup('api:twitter', { singleton: false }); + let twitter2 = container.lookup('api:twitter', { singleton: false }); + twitter === twitter2; //=> false + ``` + @private + @method lookup + @param {String} fullName + @param {Object} [options] + @param {String} [options.source] The fullname of the request source (used for local lookup) + @return {any} + */ + lookup: function (fullName, options) { + _emberMetal.assert('fullName must be a proper full name', this.registry.validateFullName(fullName)); + return lookup(this, this.registry.normalize(fullName), options); }, /** - Overrides the base `EngineInstance._bootSync` method with concerns relevant - to booting application (instead of engine) instances. - This method should only contain synchronous boot concerns. Asynchronous - boot concerns should eventually be moved to the `boot` method, which - returns a promise. - Until all boot code has been made asynchronous, we need to continue to - expose this method for use *internally* in places where we need to boot an - instance synchronously. - @private - */ - _bootSync: function (options) { - if (this._booted) { - return this; - } + Given a fullName, return the corresponding factory. + @private + @method lookupFactory + @param {String} fullName + @param {Object} [options] + @param {String} [options.source] The fullname of the request source (used for local lookup) + @return {any} + */ + lookupFactory: function (fullName, options) { + _emberMetal.assert('fullName must be a proper full name', this.registry.validateFullName(fullName)); - options = new BootOptions(options); + _emberMetal.deprecate('Using "_lookupFactory" is deprecated. Please use container.factoryFor instead.', !true, { id: 'container-lookupFactory', until: '2.13.0', url: 'TODO' }); - this.setupRegistry(options); + return deprecatedFactoryFor(this, this.registry.normalize(fullName), options); + } - if (options.rootElement) { - this.rootElement = options.rootElement; + }, _Container$prototype[LOOKUP_FACTORY] = function (fullName, options) { + _emberMetal.assert('fullName must be a proper full name', this.registry.validateFullName(fullName)); + return deprecatedFactoryFor(this, this.registry.normalize(fullName), options); + }, _Container$prototype[FACTORY_FOR] = function (fullName) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + if (_emberMetal.isFeatureEnabled('ember-no-double-extend')) { + if (true) { + return this.factoryFor(fullName, options); } else { - this.rootElement = this.application.rootElement; + /* This throws in case of a poorly designed build */ + throw new Error('If ember-no-double-extend is enabled, ember-factory-for must also be enabled'); } + } + var factory = this[LOOKUP_FACTORY](fullName, options); + if (factory === undefined) { + return; + } + var manager = new DeprecatedFactoryManager(this, factory, fullName); - if (options.location) { - var router = _emberMetal.get(this, 'router'); - _emberMetal.set(router, 'location', options.location); + _emberMetal.runInDebug(function () { + manager = wrapManagerInDeprecationProxy(manager); + }); + + return manager; + }, _Container$prototype.destroy = function () { + eachDestroyable(this, function (item) { + if (item.destroy) { + item.destroy(); } + }); - this.application.runInstanceInitializers(this); + this.isDestroyed = true; + }, _Container$prototype.reset = function (fullName) { + if (arguments.length > 0) { + resetMember(this, this.registry.normalize(fullName)); + } else { + resetCache(this); + } + }, _Container$prototype.ownerInjection = function () { + var _ref; - if (options.isInteractive) { - this.setupEventDispatcher(); - } + return _ref = {}, _ref[_emberUtils.OWNER] = this.owner, _ref; + }, _Container$prototype); - this._booted = true; + /* + * Wrap a factory manager in a proxy which will not permit properties to be + * set on the manager. + */ + function wrapManagerInDeprecationProxy(manager) { + if (_emberUtils.HAS_NATIVE_PROXY) { + var _ret = (function () { + var validator = { + get: function (obj, prop) { + if (prop !== 'class' && prop !== 'create') { + throw new Error('You attempted to access "' + prop + '" on a factory manager created by container#factoryFor. "' + prop + '" is not a member of a factory manager."'); + } - return this; - }, + return obj[prop]; + }, + set: function (obj, prop, value) { + throw new Error('You attempted to set "' + prop + '" on a factory manager created by container#factoryFor. A factory manager is a read-only construct.'); + } + }; - setupRegistry: function (options) { - this.constructor.setupRegistry(this.__registry__, options); - }, + // Note: + // We have to proxy access to the manager here so that private property + // access doesn't cause the above errors to occur. + var m = manager; + var proxiedManager = { + class: m.class, + create: function (props) { + return m.create(props); + } + }; - router: _emberMetal.computed(function () { - return this.lookup('router:main'); - }).readOnly(), + return { + v: new Proxy(proxiedManager, validator) + }; + })(); - /** - This hook is called by the root-most Route (a.k.a. the ApplicationRoute) - when it has finished creating the root View. By default, we simply take the - view and append it to the `rootElement` specified on the Application. - In cases like FastBoot and testing, we can override this hook and implement - custom behavior, such as serializing to a string and sending over an HTTP - socket rather than appending to DOM. - @param view {Ember.View} the root-most view - @private - */ - didCreateRootView: function (view) { - view.appendTo(this.rootElement); - }, + if (typeof _ret === 'object') return _ret.v; + } - /** - Tells the router to start routing. The router will ask the location for the - current URL of the page to determine the initial URL to start routing to. - To start the app at a specific URL, call `handleURL` instead. - @private - */ - startRouting: function () { - var router = _emberMetal.get(this, 'router'); - router.startRouting(); - this._didSetupRouter = true; - }, + return manager; + } + if (true) { /** - @private - Sets up the router, initializing the child router and configuring the - location before routing begins. - Because setup should only occur once, multiple calls to `setupRouter` - beyond the first call have no effect. - */ - setupRouter: function () { - if (this._didSetupRouter) { - return; + Given a fullName, return the corresponding factory. The consumer of the factory + is responsible for the destruction of any factory instances, as there is no + way for the container to ensure instances are destroyed when it itself is + destroyed. + @public + @method factoryFor + @param {String} fullName + @param {Object} [options] + @param {String} [options.source] The fullname of the request source (used for local lookup) + @return {any} + */ + Container.prototype.factoryFor = function _factoryFor(fullName) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + var normalizedName = this.registry.normalize(fullName); + _emberMetal.assert('fullName must be a proper full name', this.registry.validateFullName(normalizedName)); + + if (options.source) { + normalizedName = this.registry.expandLocalLookup(fullName, options); + // if expandLocalLookup returns falsey, we do not support local lookup + if (!normalizedName) { + return; + } } - this._didSetupRouter = true; - var router = _emberMetal.get(this, 'router'); - router.setupRouter(); - }, + var factory = this.registry.resolve(normalizedName); - /** - Directs the router to route to a particular URL. This is useful in tests, - for example, to tell the app to start at a particular URL. - @param url {String} the URL the router should route to - @private - */ - handleURL: function (url) { - var router = _emberMetal.get(this, 'router'); + if (factory === undefined) { + return; + } - this.setupRouter(); - return router.handleURL(url); - }, + var manager = new FactoryManager(this, factory, fullName, normalizedName); - /** - @private - */ - setupEventDispatcher: function () { - var dispatcher = this.lookup('event_dispatcher:main'); - var applicationCustomEvents = _emberMetal.get(this.application, 'customEvents'); - var instanceCustomEvents = _emberMetal.get(this, 'customEvents'); + _emberMetal.runInDebug(function () { + manager = wrapManagerInDeprecationProxy(manager); + }); - var customEvents = _emberUtils.assign({}, applicationCustomEvents, instanceCustomEvents); - dispatcher.setup(customEvents, this.rootElement); + return manager; + }; + } - return dispatcher; - }, + function isSingleton(container, fullName) { + return container.registry.getOption(fullName, 'singleton') !== false; + } - /** - Returns the current URL of the app instance. This is useful when your - app does not update the browsers URL bar (i.e. it uses the `'none'` - location adapter). - @public - @return {String} the current URL - */ - getURL: function () { - var router = _emberMetal.get(this, 'router'); - return _emberMetal.get(router, 'url'); - }, + function shouldInstantiate(container, fullName) { + return container.registry.getOption(fullName, 'instantiate') !== false; + } - // `instance.visit(url)` should eventually replace `instance.handleURL()`; - // the test helpers can probably be switched to use this implementation too + function lookup(container, fullName) { + var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; - /** - Navigate the instance to a particular URL. This is useful in tests, for - example, or to tell the app to start at a particular URL. This method - returns a promise that resolves with the app instance when the transition - is complete, or rejects if the transion was aborted due to an error. - @public - @param url {String} the destination URL - @return {Promise} - */ - visit: function (url) { - var _this = this; + if (options.source) { + fullName = container.registry.expandLocalLookup(fullName, options); - this.setupRouter(); + // if expandLocalLookup returns falsey, we do not support local lookup + if (!fullName) { + return; + } + } - var bootOptions = this.__container__.lookup('-environment:main'); + if (container.cache[fullName] !== undefined && options.singleton !== false) { + return container.cache[fullName]; + } - var router = _emberMetal.get(this, 'router'); + if (true) { + return instantiateFactory(container, fullName, options); + } else { + var factory = deprecatedFactoryFor(container, fullName); + var value = instantiate(factory, {}, container, fullName); - var handleTransitionResolve = function () { - if (!bootOptions.options.shouldRender) { - // No rendering is needed, and routing has completed, simply return. - return _this; - } else { - return new _emberRuntime.RSVP.Promise(function (resolve) { - // Resolve once rendering is completed. `router.handleURL` returns the transition (as a thennable) - // which resolves once the transition is completed, but the transition completion only queues up - // a scheduled revalidation (into the `render` queue) in the Renderer. - // - // This uses `run.schedule('afterRender', ....)` to resolve after that rendering has completed. - _emberMetal.run.schedule('afterRender', null, resolve, _this); - }); - } - }; + if (value === undefined) { + return; + } - var handleTransitionReject = function (error) { - if (error.error) { - throw error.error; - } else if (error.name === 'TransitionAborted' && router.router.activeTransition) { - return router.router.activeTransition.then(handleTransitionResolve, handleTransitionReject); - } else if (error.name === 'TransitionAborted') { - throw new Error(error.message); - } else { - throw error; - } - }; + if (isSingleton(container, fullName) && options.singleton !== false) { + container.cache[fullName] = value; + } - var location = _emberMetal.get(router, 'location'); + return value; + } + } - // Keeps the location adapter's internal URL in-sync - location.setURL(url); + function isSingletonClass(container, fullName, _ref2) { + var instantiate = _ref2.instantiate; + var singleton = _ref2.singleton; - // getURL returns the set url with the rootURL stripped off - return router.handleURL(location.getURL()).then(handleTransitionResolve, handleTransitionReject); - } - }); + return singleton !== false && isSingleton(container, fullName) && !instantiate && !shouldInstantiate(container, fullName); + } - ApplicationInstance.reopenClass({ - /** - @private - @method setupRegistry - @param {Registry} registry - @param {BootOptions} options - */ - setupRegistry: function (registry) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + function isSingletonInstance(container, fullName, _ref3) { + var instantiate = _ref3.instantiate; + var singleton = _ref3.singleton; - if (!options.toEnvironment) { - options = new BootOptions(options); - } + return singleton !== false && isSingleton(container, fullName) && instantiate !== false && shouldInstantiate(container, fullName); + } - registry.register('-environment:main', options.toEnvironment(), { instantiate: false }); - registry.register('service:-document', options.document, { instantiate: false }); + function isFactoryClass(container, fullname, _ref4) { + var instantiate = _ref4.instantiate; + var singleton = _ref4.singleton; - this._super(registry, options); - } - }); + return (singleton === false || !isSingleton(container, fullname)) && instantiate === false && !shouldInstantiate(container, fullname); + } - /** - A list of boot-time configuration options for customizing the behavior of - an `Ember.ApplicationInstance`. - - This is an interface class that exists purely to document the available - options; you do not need to construct it manually. Simply pass a regular - JavaScript object containing the desired options into methods that require - one of these options object: - - ```javascript - MyApp.visit("/", { location: "none", rootElement: "#container" }); - ``` - - Not all combinations of the supported options are valid. See the documentation - on `Ember.Application#visit` for the supported configurations. - - Internal, experimental or otherwise unstable flags are marked as private. - - @class BootOptions - @namespace Ember.ApplicationInstance - @public - */ - BootOptions = function BootOptions() { - var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + function isFactoryInstance(container, fullName, _ref5) { + var instantiate = _ref5.instantiate; + var singleton = _ref5.singleton; - /** - Provide a specific instance of jQuery. This is useful in conjunction with - the `document` option, as it allows you to use a copy of `jQuery` that is - appropriately bound to the foreign `document` (e.g. a jsdom). - This is highly experimental and support very incomplete at the moment. - @property jQuery - @type Object - @default auto-detected - @private - */ - this.jQuery = _emberViews.jQuery; // This default is overridable below + return (singleton !== false || isSingleton(container, fullName)) && instantiate !== false && shouldInstantiate(container, fullName); + } - /** - Interactive mode: whether we need to set up event delegation and invoke - lifecycle callbacks on Components. - @property isInteractive - @type boolean - @default auto-detected - @private - */ - this.isInteractive = _emberEnvironment.environment.hasDOM; // This default is overridable below + function instantiateFactory(container, fullName, options) { + var factoryManager = container[FACTORY_FOR](fullName); - /** - Run in a full browser environment. - When this flag is set to `false`, it will disable most browser-specific - and interactive features. Specifically: - * It does not use `jQuery` to append the root view; the `rootElement` - (either specified as a subsequent option or on the application itself) - must already be an `Element` in the given `document` (as opposed to a - string selector). - * It does not set up an `EventDispatcher`. - * It does not run any `Component` lifecycle hooks (such as `didInsertElement`). - * It sets the `location` option to `"none"`. (If you would like to use - the location adapter specified in the app's router instead, you can also - specify `{ location: null }` to specifically opt-out.) - @property isBrowser - @type boolean - @default auto-detected - @public - */ - if (options.isBrowser !== undefined) { - this.isBrowser = !!options.isBrowser; - } else { - this.isBrowser = _emberEnvironment.environment.hasDOM; + if (factoryManager === undefined) { + return; } - if (!this.isBrowser) { - this.jQuery = null; - this.isInteractive = false; - this.location = 'none'; + // SomeClass { singleton: true, instantiate: true } | { singleton: true } | { instantiate: true } | {} + // By default majority of objects fall into this case + if (isSingletonInstance(container, fullName, options)) { + return container.cache[fullName] = factoryManager.create(); } - /** - Disable rendering completely. - When this flag is set to `true`, it will disable the entire rendering - pipeline. Essentially, this puts the app into "routing-only" mode. No - templates will be rendered, and no Components will be created. - @property shouldRender - @type boolean - @default true - @public - */ - if (options.shouldRender !== undefined) { - this.shouldRender = !!options.shouldRender; - } else { - this.shouldRender = true; + // SomeClass { singleton: false, instantiate: true } + if (isFactoryInstance(container, fullName, options)) { + return factoryManager.create(); } - if (!this.shouldRender) { - this.jQuery = null; - this.isInteractive = false; + // SomeClass { singleton: true, instantiate: false } | { instantiate: false } | { singleton: false, instantiation: false } + if (isSingletonClass(container, fullName, options) || isFactoryClass(container, fullName, options)) { + return factoryManager.class; } - /** - If present, render into the given `Document` object instead of the - global `window.document` object. - In practice, this is only useful in non-browser environment or in - non-interactive mode, because Ember's `jQuery` dependency is - implicitly bound to the current document, causing event delegation - to not work properly when the app is rendered into a foreign - document object (such as an iframe's `contentDocument`). - In non-browser mode, this could be a "`Document`-like" object as - Ember only interact with a small subset of the DOM API in non- - interactive mode. While the exact requirements have not yet been - formalized, the `SimpleDOM` library's implementation is known to - work. - @property document - @type Document - @default the global `document` object - @public - */ - if (options.document) { - this.document = options.document; - } else { - this.document = typeof document !== 'undefined' ? document : null; - } + throw new Error('Could not create factory'); + } - /** - If present, overrides the application's `rootElement` property on - the instance. This is useful for testing environment, where you - might want to append the root view to a fixture area. - In non-browser mode, because Ember does not have access to jQuery, - this options must be specified as a DOM `Element` object instead of - a selector string. - See the documentation on `Ember.Applications`'s `rootElement` for - details. - @property rootElement - @type String|Element - @default null - @public - */ - if (options.rootElement) { - this.rootElement = options.rootElement; + function markInjectionsAsDynamic(injections) { + injections._dynamic = true; + } + + function areInjectionsDynamic(injections) { + return !!injections._dynamic; + } + + function buildInjections() /* container, ...injections */{ + var _arguments = arguments; + + var hash = {}; + + if (arguments.length > 1) { + (function () { + var container = _arguments[0]; + var injections = []; + var injection = undefined; + + for (var i = 1; i < _arguments.length; i++) { + if (_arguments[i]) { + injections = injections.concat(_arguments[i]); + } + } + + _emberMetal.runInDebug(function () { + container.registry.validateInjections(injections); + }); + + for (var i = 0; i < injections.length; i++) { + injection = injections[i]; + hash[injection.property] = lookup(container, injection.fullName); + if (!isSingleton(container, injection.fullName)) { + markInjectionsAsDynamic(hash); + } + } + })(); } - // Set these options last to give the user a chance to override the - // defaults from the "combo" options like `isBrowser` (although in - // practice, the resulting combination is probably invalid) + return hash; + } - /** - If present, overrides the router's `location` property with this - value. This is useful for environments where trying to modify the - URL would be inappropriate. - @property location - @type string - @default null - @public - */ - if (options.location !== undefined) { - this.location = options.location; + function deprecatedFactoryFor(container, fullName) { + var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + + var registry = container.registry; + + if (options.source) { + fullName = registry.expandLocalLookup(fullName, options); + // if expandLocalLookup returns falsey, we do not support local lookup + if (!fullName) { + return; + } } - if (options.jQuery !== undefined) { - this.jQuery = options.jQuery; + var cache = container.factoryCache; + if (cache[fullName]) { + return cache[fullName]; + } + var factory = registry.resolve(fullName); + if (factory === undefined) { + return; } - if (options.isInteractive !== undefined) { - this.isInteractive = !!options.isInteractive; + var type = fullName.split(':')[0]; + if (!factory || typeof factory.extend !== 'function' || !_emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS && type === 'model') { + if (factory && typeof factory._onLookup === 'function') { + factory._onLookup(fullName); + } + + // TODO: think about a 'safe' merge style extension + // for now just fallback to create time injection + cache[fullName] = factory; + return factory; + } else { + var injections = injectionsFor(container, fullName); + var factoryInjections = factoryInjectionsFor(container, fullName); + var cacheable = !areInjectionsDynamic(injections) && !areInjectionsDynamic(factoryInjections); + + factoryInjections[_emberUtils.NAME_KEY] = registry.makeToString(factory, fullName); + + var injectedFactory = factory.extend(injections); + + // TODO - remove all `container` injections when Ember reaches v3.0.0 + injectDeprecatedContainer(injectedFactory.prototype, container); + injectedFactory.reopenClass(factoryInjections); + + if (factory && typeof factory._onLookup === 'function') { + factory._onLookup(fullName); + } + + if (cacheable) { + cache[fullName] = injectedFactory; + } + + return injectedFactory; } - }; + } - BootOptions.prototype.toEnvironment = function () { - var env = _emberUtils.assign({}, _emberEnvironment.environment); - // For compatibility with existing code - env.hasDOM = this.isBrowser; - env.isInteractive = this.isInteractive; - env.options = this; - return env; - }; + function injectionsFor(container, fullName) { + var registry = container.registry; + var splitName = fullName.split(':'); + var type = splitName[0]; - Object.defineProperty(ApplicationInstance.prototype, 'container', { - configurable: true, - enumerable: false, - get: function () { - var instance = this; - return { - lookup: function () { - _emberMetal.deprecate('Using `ApplicationInstance.container.lookup` is deprecated. Please use `ApplicationInstance.lookup` instead.', false, { - id: 'ember-application.app-instance-container', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-applicationinstance-container' - }); - return instance.lookup.apply(instance, arguments); + var injections = buildInjections(container, registry.getTypeInjections(type), registry.getInjections(fullName)); + injections._debugContainerKey = fullName; + + _emberUtils.setOwner(injections, container.owner); + + return injections; + } + + function instantiate(factory, props, container, fullName) { + var lazyInjections = undefined, + validationCache = undefined; + + props = props || {}; + + if (container.registry.getOption(fullName, 'instantiate') === false) { + return factory; + } + + if (factory) { + if (typeof factory.create !== 'function') { + throw new Error('Failed to create an instance of \'' + fullName + '\'. Most likely an improperly defined class or' + ' an invalid module export.'); + } + + validationCache = container.validationCache; + + _emberMetal.runInDebug(function () { + // Ensure that all lazy injections are valid at instantiation time + if (!validationCache[fullName] && typeof factory._lazyInjections === 'function') { + lazyInjections = factory._lazyInjections(); + lazyInjections = container.registry.normalizeInjectionsHash(lazyInjections); + + container.registry.validateInjections(lazyInjections); } - }; + }); + + validationCache[fullName] = true; + + var obj = undefined; + + if (typeof factory.extend === 'function') { + // assume the factory was extendable and is already injected + obj = factory.create(props); + } else { + // assume the factory was extendable + // to create time injections + // TODO: support new'ing for instantiation and merge injections for pure JS Functions + var injections = injectionsFor(container, fullName); + + // Ensure that a container is available to an object during instantiation. + // TODO - remove when Ember reaches v3.0.0 + // This "fake" container will be replaced after instantiation with a + // property that raises deprecations every time it is accessed. + injections.container = container._fakeContainerToInject; + obj = factory.create(_emberUtils.assign({}, injections, props)); + + // TODO - remove when Ember reaches v3.0.0 + if (!Object.isFrozen(obj) && 'container' in obj) { + injectDeprecatedContainer(obj, container); + } + } + + return obj; } - }); + } - Object.defineProperty(ApplicationInstance.prototype, 'registry', { - configurable: true, - enumerable: false, - get: function () { - return _emberRuntime.buildFakeRegistryWithDeprecations(this, 'ApplicationInstance'); + function factoryInjectionsFor(container, fullName) { + var registry = container.registry; + var splitName = fullName.split(':'); + var type = splitName[0]; + + var factoryInjections = buildInjections(container, registry.getFactoryTypeInjections(type), registry.getFactoryInjections(fullName)); + factoryInjections._debugContainerKey = fullName; + + return factoryInjections; + } + + // TODO - remove when Ember reaches v3.0.0 + function injectDeprecatedContainer(object, container) { + Object.defineProperty(object, 'container', { + configurable: true, + enumerable: false, + get: function () { + _emberMetal.deprecate('Using the injected `container` is deprecated. Please use the `getOwner` helper instead to access the owner of this object.', false, { id: 'ember-application.injected-container', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_injected-container-access' }); + return this[CONTAINER_OVERRIDE] || container; + }, + + set: function (value) { + _emberMetal.deprecate('Providing the `container` property to ' + this + ' is deprecated. Please use `Ember.setOwner` or `owner.ownerInjection()` instead to provide an owner to the instance being created.', false, { id: 'ember-application.injected-container', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_injected-container-access' }); + + this[CONTAINER_OVERRIDE] = value; + + return value; + } + }); + } + + function eachDestroyable(container, callback) { + var cache = container.cache; + var keys = Object.keys(cache); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = cache[key]; + + if (container.registry.getOption(key, 'instantiate') !== false) { + callback(value); + } } - }); + } - exports.default = ApplicationInstance; -}); -enifed('ember-application/system/application', ['exports', 'ember-utils', 'ember-environment', 'ember-metal', 'ember-runtime', 'ember-views', 'ember-routing', 'ember-application/system/application-instance', 'container', 'ember-application/system/engine', 'ember-glimmer'], function (exports, _emberUtils, _emberEnvironment, _emberMetal, _emberRuntime, _emberViews, _emberRouting, _emberApplicationSystemApplicationInstance, _container, _emberApplicationSystemEngine, _emberGlimmer) { - /** - @module ember - @submodule ember-application - */ - 'use strict'; + function resetCache(container) { + eachDestroyable(container, function (value) { + if (value.destroy) { + value.destroy(); + } + }); - exports._resetLegacyAddonWarnings = _resetLegacyAddonWarnings; + container.cache.dict = _emberUtils.dictionary(null); + } - var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); + function resetMember(container, fullName) { + var member = container.cache[fullName]; - var librariesRegistered = false; + delete container.factoryCache[fullName]; + + if (member) { + delete container.cache[fullName]; + + if (member.destroy) { + member.destroy(); + } + } + } - var warnedAboutLegacyViewAddon = false; - var warnedAboutLegacyControllerAddon = false; + function buildFakeContainerWithDeprecations(container) { + var fakeContainer = {}; + var propertyMappings = { + lookup: 'lookup', + lookupFactory: '_lookupFactory' + }; - // For testing + for (var containerProperty in propertyMappings) { + fakeContainer[containerProperty] = buildFakeContainerFunction(container, containerProperty, propertyMappings[containerProperty]); + } - function _resetLegacyAddonWarnings() { - warnedAboutLegacyViewAddon = false; - warnedAboutLegacyControllerAddon = false; + return fakeContainer; } - /** - An instance of `Ember.Application` is the starting point for every Ember - application. It helps to instantiate, initialize and coordinate the many - objects that make up your app. - - Each Ember app has one and only one `Ember.Application` object. In fact, the - very first thing you should do in your application is create the instance: - - ```javascript - window.App = Ember.Application.create(); - ``` - - Typically, the application object is the only global variable. All other - classes in your app should be properties on the `Ember.Application` instance, - which highlights its first role: a global namespace. - - For example, if you define a view class, it might look like this: - - ```javascript - App.MyView = Ember.View.extend(); - ``` - - By default, calling `Ember.Application.create()` will automatically initialize - your application by calling the `Ember.Application.initialize()` method. If - you need to delay initialization, you can call your app's `deferReadiness()` - method. When you are ready for your app to be initialized, call its - `advanceReadiness()` method. - - You can define a `ready` method on the `Ember.Application` instance, which - will be run by Ember when the application is initialized. - - Because `Ember.Application` inherits from `Ember.Namespace`, any classes - you create will have useful string representations when calling `toString()`. - See the `Ember.Namespace` documentation for more information. - - While you can think of your `Ember.Application` as a container that holds the - other classes in your application, there are several other responsibilities - going on under-the-hood that you may want to understand. - - ### Event Delegation - - Ember uses a technique called _event delegation_. This allows the framework - to set up a global, shared event listener instead of requiring each view to - do it manually. For example, instead of each view registering its own - `mousedown` listener on its associated element, Ember sets up a `mousedown` - listener on the `body`. - - If a `mousedown` event occurs, Ember will look at the target of the event and - start walking up the DOM node tree, finding corresponding views and invoking - their `mouseDown` method as it goes. - - `Ember.Application` has a number of default events that it listens for, as - well as a mapping from lowercase events to camel-cased view method names. For - example, the `keypress` event causes the `keyPress` method on the view to be - called, the `dblclick` event causes `doubleClick` to be called, and so on. - - If there is a bubbling browser event that Ember does not listen for by - default, you can specify custom events and their corresponding view method - names by setting the application's `customEvents` property: - - ```javascript - let App = Ember.Application.create({ - customEvents: { - // add support for the paste event - paste: 'paste' - } - }); - ``` - - To prevent Ember from setting up a listener for a default event, - specify the event name with a `null` value in the `customEvents` - property: - - ```javascript - let App = Ember.Application.create({ - customEvents: { - // prevent listeners for mouseenter/mouseleave events - mouseenter: null, - mouseleave: null + function buildFakeContainerFunction(container, containerProperty, ownerProperty) { + return function () { + _emberMetal.deprecate('Using the injected `container` is deprecated. Please use the `getOwner` helper to access the owner of this object and then call `' + ownerProperty + '` instead.', false, { + id: 'ember-application.injected-container', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x#toc_injected-container-access' + }); + return container[containerProperty].apply(container, arguments); + }; + } + + var DeprecatedFactoryManager = (function () { + function DeprecatedFactoryManager(container, factory, fullName) { + babelHelpers.classCallCheck(this, DeprecatedFactoryManager); + + this.container = container; + this.class = factory; + this.fullName = fullName; + } + + DeprecatedFactoryManager.prototype.create = function create() { + var props = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + + return instantiate(this.class, props, this.container, this.fullName); + }; + + return DeprecatedFactoryManager; + })(); + + var FactoryManager = (function () { + function FactoryManager(container, factory, fullName, normalizedName) { + babelHelpers.classCallCheck(this, FactoryManager); + + this.container = container; + this.class = factory; + this.fullName = fullName; + this.normalizedName = normalizedName; + } + + FactoryManager.prototype.create = function create() { + var _this = this; + + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + + var injections = injectionsFor(this.container, this.normalizedName); + var props = _emberUtils.assign({}, injections, options); + + props[_emberUtils.NAME_KEY] = this.container.registry.makeToString(this.class, this.fullName); + + _emberMetal.runInDebug(function () { + var lazyInjections = undefined; + var validationCache = _this.container.validationCache; + // Ensure that all lazy injections are valid at instantiation time + if (!validationCache[_this.fullName] && _this.class && typeof _this.class._lazyInjections === 'function') { + lazyInjections = _this.class._lazyInjections(); + lazyInjections = _this.container.registry.normalizeInjectionsHash(lazyInjections); + + _this.container.registry.validateInjections(lazyInjections); + } + + validationCache[_this.fullName] = true; + }); + + if (!this.class.create) { + throw new Error('Failed to create an instance of \'' + this.normalizedName + '\'. Most likely an improperly defined class or' + ' an invalid module export.'); } - }); - ``` - - By default, the application sets up these event listeners on the document - body. However, in cases where you are embedding an Ember application inside - an existing page, you may want it to set up the listeners on an element - inside the body. - - For example, if only events inside a DOM element with the ID of `ember-app` - should be delegated, set your application's `rootElement` property: - - ```javascript - let App = Ember.Application.create({ - rootElement: '#ember-app' - }); - ``` - - 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 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: - - ```javascript - Ember.Application.initializer({ - name: 'api-adapter', - - initialize: function(application) { - application.register('api-adapter:main', ApiAdapter); + + if (this.class.prototype) { + injectDeprecatedContainer(this.class.prototype, this.container); } - }); - ``` - - Initializers provide an opportunity to access the internal registry, which - organizes the different components of an Ember application. Additionally - they provide a chance to access the instantiated application. Beyond - being used for libraries, initializers are also a great way to organize - dependency injection or setup in your own application. - - ### Routing - - In addition to creating your application's router, `Ember.Application` is - also responsible for telling the router when to start routing. Transitions - between routes can be logged with the `LOG_TRANSITIONS` flag, and more - detailed intra-transition logging can be logged with - the `LOG_TRANSITIONS_INTERNAL` flag: - - ```javascript - let App = Ember.Application.create({ - LOG_TRANSITIONS: true, // basic logging of successful transitions - LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps - }); - ``` + + return this.class.create(props); + }; + + return FactoryManager; + })(); +}); + +/* + * This internal version of factoryFor swaps between the public API for + * factoryFor (class is the registered class) and a transition implementation + * (class is the double-extended class). It is *not* the public API version + * of factoryFor, which always returns the registered class. + */ + +/** + A depth first traversal, destroying the container, its descendant containers and all + their managed objects. + @private + @method destroy + */ + +/** + Clear either the entire cache or just the cache for a particular key. + @private + @method reset + @param {String} fullName optional key to reset; if missing, resets everything + */ + +/** + Returns an object that can be used to provide an owner to a + manually created instance. + @private + @method ownerInjection + @returns { Object } +*/ +enifed('container/index', ['exports', 'container/registry', 'container/container'], function (exports, _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 + */ + + 'use strict'; + + exports.Registry = _containerRegistry.default; + exports.privatize = _containerRegistry.privatize; + exports.Container = _containerContainer.default; + exports.buildFakeContainerWithDeprecations = _containerContainer.buildFakeContainerWithDeprecations; + exports.FACTORY_FOR = _containerContainer.FACTORY_FOR; + exports.LOOKUP_FACTORY = _containerContainer.LOOKUP_FACTORY; +}); +enifed('container/registry', ['exports', 'ember-utils', 'ember-metal', 'container/container'], function (exports, _emberUtils, _emberMetal, _containerContainer) { + 'use strict'; + + exports.default = Registry; + exports.privatize = privatize; + + var VALID_FULL_NAME_REGEXP = /^[^:]+:[^:]+$/; + + /** + A registry used to store factory and option information keyed + by type. - By default, the router will begin trying to translate the current URL into - application state once the browser emits the `DOMContentReady` event. If you - need to defer routing, you can call the application's `deferReadiness()` - method. Once routing can begin, call the `advanceReadiness()` method. + A `Registry` stores the factory and option information needed by a + `Container` to instantiate and cache objects. - If there is any setup required before routing begins, you can implement a - `ready()` method on your app that will be invoked immediately before routing - begins. + The API for `Registry` is still in flux and should not be considered stable. - @class Application - @namespace Ember - @extends Ember.Engine - @uses RegistryProxyMixin - @public + @private + @class Registry + @since 1.11.0 */ - var Application = _emberApplicationSystemEngine.default.extend({ - _suppressDeferredDeprecation: true, + function Registry(options) { + this.fallback = options && options.fallback ? options.fallback : null; - /** - The root DOM element of the Application. This can be specified as an - element or a - [jQuery-compatible selector string](http://api.jquery.com/category/selectors/). - This is the element that will be passed to the Application's, - `eventDispatcher`, which sets up the listeners for event delegation. Every - view in your application should be a child of the element you specify here. - @property rootElement - @type DOMElement - @default 'body' - @public - */ - rootElement: 'body', + if (options && options.resolver) { + this.resolver = options.resolver; - /** - The `Ember.EventDispatcher` responsible for delegating events to this - application's views. - The event dispatcher is created by the application at initialization time - and sets up event listeners on the DOM element described by the - application's `rootElement` property. - See the documentation for `Ember.EventDispatcher` for more information. - @property eventDispatcher - @type Ember.EventDispatcher - @default null - @public - */ - eventDispatcher: null, + if (typeof this.resolver === 'function') { + deprecateResolverFunction(this); + } + } - /** - The DOM events for which the event dispatcher should listen. - By default, the application's `Ember.EventDispatcher` listens - for a set of standard DOM events, such as `mousedown` and - `keyup`, and delegates them to your application's `Ember.View` - instances. - If you would like additional bubbling events to be delegated to your - views, set your `Ember.Application`'s `customEvents` property - to a hash containing the DOM event name as the key and the - corresponding view method name as the value. Setting an event to - a value of `null` will prevent a default event listener from being - added for that event. - To add new events to be listened to: - ```javascript - let App = Ember.Application.create({ - customEvents: { - // add support for the paste event - paste: 'paste' - } - }); - ``` - To prevent default events from being listened to: - ```javascript - let App = Ember.Application.create({ - customEvents: { - // remove support for mouseenter / mouseleave events - mouseenter: null, - mouseleave: null - } - }); - ``` - @property customEvents - @type Object - @default null - @public - */ - customEvents: null, + this.registrations = _emberUtils.dictionary(options && options.registrations ? options.registrations : null); + + this._typeInjections = _emberUtils.dictionary(null); + this._injections = _emberUtils.dictionary(null); + this._factoryTypeInjections = _emberUtils.dictionary(null); + this._factoryInjections = _emberUtils.dictionary(null); + + this._localLookupCache = new _emberUtils.EmptyObject(); + this._normalizeCache = _emberUtils.dictionary(null); + this._resolveCache = _emberUtils.dictionary(null); + this._failCache = _emberUtils.dictionary(null); + + this._options = _emberUtils.dictionary(null); + this._typeOptions = _emberUtils.dictionary(null); + } + Registry.prototype = { /** - Whether the application should automatically start routing and render - templates to the `rootElement` on DOM ready. While default by true, - other environments such as FastBoot or a testing harness can set this - property to `false` and control the precise timing and behavior of the boot - process. - @property autoboot - @type Boolean - @default true + A backup registry for resolving registrations when no matches can be found. @private - */ - autoboot: true, + @property fallback + @type Registry + */ + fallback: null, /** - Whether the application should be configured for the legacy "globals mode". - Under this mode, the Application object serves as a global namespace for all - classes. - ```javascript - let App = Ember.Application.create({ - ... - }); - App.Router.reopen({ - location: 'none' - }); - App.Router.map({ - ... - }); - App.MyComponent = Ember.Component.extend({ - ... - }); - ``` - This flag also exposes other internal APIs that assumes the existence of - a special "default instance", like `App.__container__.lookup(...)`. - This option is currently not configurable, its value is derived from - the `autoboot` flag – disabling `autoboot` also implies opting-out of - globals mode support, although they are ultimately orthogonal concerns. - Some of the global modes features are already deprecated in 1.x. The - existence of this flag is to untangle the globals mode code paths from - the autoboot code paths, so that these legacy features can be reviewed - for deprecation/removal separately. - Forcing the (autoboot=true, _globalsMode=false) here and running the tests - would reveal all the places where we are still relying on these legacy - behavior internally (mostly just tests). - @property _globalsMode - @type Boolean - @default true + An object that has a `resolve` method that resolves a name. @private - */ - _globalsMode: true, - - init: function (options) { - this._super.apply(this, arguments); - - if (!this.$) { - this.$ = _emberViews.jQuery; - } - - registerLibraries(); - logLibraryVersions(); + @property resolver + @type Resolver + */ + resolver: null, - // Start off the number of deferrals at 1. This will be decremented by - // the Application's own `boot` method. - this._readinessDeferrals = 1; - this._booted = false; + /** + @private + @property registrations + @type InheritingDict + */ + registrations: null, - this.autoboot = this._globalsMode = !!this.autoboot; + /** + @private + @property _typeInjections + @type InheritingDict + */ + _typeInjections: null, - if (this._globalsMode) { - this._prepareForGlobalsMode(); - } + /** + @private + @property _injections + @type InheritingDict + */ + _injections: null, - if (this.autoboot) { - this.waitForDOMReady(); - } - }, + /** + @private + @property _factoryTypeInjections + @type InheritingDict + */ + _factoryTypeInjections: null, /** - Create an ApplicationInstance for this application. - @private - @method buildInstance - @return {Ember.ApplicationInstance} the application instance - */ - buildInstance: function () { - var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + @private + @property _factoryInjections + @type InheritingDict + */ + _factoryInjections: null, - options.base = this; - options.application = this; - return _emberApplicationSystemApplicationInstance.default.create(options); - }, + /** + @private + @property _normalizeCache + @type InheritingDict + */ + _normalizeCache: null, /** - Enable the legacy globals mode by allowing this application to act - as a global namespace. See the docs on the `_globalsMode` property - for details. - Most of these features are already deprecated in 1.x, so we can - stop using them internally and try to remove them. - @private - @method _prepareForGlobalsMode - */ - _prepareForGlobalsMode: function () { - // 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`. - this.Router = (this.Router || _emberRouting.Router).extend(); + @private + @property _resolveCache + @type InheritingDict + */ + _resolveCache: null, - this._buildDeprecatedInstance(); - }, + /** + @private + @property _options + @type InheritingDict + */ + _options: null, - /* - Build the deprecated instance for legacy globals mode support. - Called when creating and resetting the application. - This is orthogonal to autoboot: the deprecated instance needs to - be created at Application construction (not boot) time to expose - App.__container__. If autoboot sees that this instance exists, - it will continue booting it to avoid doing unncessary work (as - opposed to building a new instance at boot time), but they are - otherwise unrelated. - @private - @method _buildDeprecatedInstance - */ - _buildDeprecatedInstance: function () { - // Build a default instance - var instance = this.buildInstance(); + /** + @private + @property _typeOptions + @type InheritingDict + */ + _typeOptions: null, - // Legacy support for App.__container__ and other global methods - // on App that rely on a single, default instance. - this.__deprecatedInstance__ = instance; - this.__container__ = instance.__container__; + /** + Creates a container based on this registry. + @private + @method container + @param {Object} options + @return {Container} created container + */ + container: function (options) { + return new _containerContainer.default(this, options); }, /** - Automatically kick-off the boot process for the application once the - DOM has become ready. - The initialization itself is scheduled on the actions queue which - ensures that code-loading finishes before booting. - If you are asynchronously loading code, you should call `deferReadiness()` - to defer booting, and then call `advanceReadiness()` once all of your code - has finished loading. - @private - @method waitForDOMReady - */ - waitForDOMReady: function () { - if (!this.$ || this.$.isReady) { - _emberMetal.run.schedule('actions', this, 'domReady'); - } else { - this.$().ready(_emberMetal.run.bind(this, 'domReady')); - } - }, + Registers a factory for later injection. + Example: + ```javascript + let registry = new Registry(); + registry.register('model:user', Person, {singleton: false }); + registry.register('fruit:favorite', Orange); + registry.register('communication:main', Email, {singleton: false}); + ``` + @private + @method register + @param {String} fullName + @param {Function} factory + @param {Object} options + */ + register: function (fullName, factory) { + var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; - /** - This is the autoboot flow: - 1. Boot the app by calling `this.boot()` - 2. Create an instance (or use the `__deprecatedInstance__` in globals mode) - 3. Boot the instance by calling `instance.boot()` - 4. Invoke the `App.ready()` callback - 5. Kick-off routing on the instance - Ideally, this is all we would need to do: - ```javascript - _autoBoot() { - this.boot().then(() => { - let instance = (this._globalsMode) ? this.__deprecatedInstance__ : this.buildInstance(); - return instance.boot(); - }).then((instance) => { - App.ready(); - instance.startRouting(); - }); - } - ``` - Unfortunately, we cannot actually write this because we need to participate - in the "synchronous" boot process. While the code above would work fine on - the initial boot (i.e. DOM ready), when `App.reset()` is called, we need to - boot a new instance synchronously (see the documentation on `_bootSync()` - for details). - Because of this restriction, the actual logic of this method is located - inside `didBecomeReady()`. - @private - @method domReady - */ - domReady: function () { - if (this.isDestroyed) { - return; + _emberMetal.assert('fullName must be a proper full name', this.validateFullName(fullName)); + + if (factory === undefined) { + throw new TypeError('Attempting to register an unknown factory: \'' + fullName + '\''); } - this._bootSync(); + var normalizedName = this.normalize(fullName); - // Continues to `didBecomeReady` + if (this._resolveCache[normalizedName]) { + throw new Error('Cannot re-register: \'' + fullName + '\', as it has already been resolved.'); + } + + delete this._failCache[normalizedName]; + this.registrations[normalizedName] = factory; + this._options[normalizedName] = options; }, /** - Use this to defer readiness until some condition is true. - Example: - ```javascript - let App = Ember.Application.create(); - App.deferReadiness(); - // Ember.$ is a reference to the jQuery object/function - Ember.$.getJSON('/auth-token', function(token) { - App.token = token; - App.advanceReadiness(); - }); - ``` - This allows you to perform asynchronous setup logic and defer - booting your application until the setup has finished. - However, if the setup requires a loading UI, it might be better - to use the router for this purpose. - @method deferReadiness - @public - */ - deferReadiness: function () { - _emberMetal.assert('You must call deferReadiness on an instance of Ember.Application', this instanceof Application); - _emberMetal.assert('You cannot defer readiness since the `ready()` hook has already been called.', this._readinessDeferrals > 0); - this._readinessDeferrals++; + Unregister a fullName + ```javascript + let registry = new Registry(); + registry.register('model:user', User); + registry.resolve('model:user').create() instanceof User //=> true + registry.unregister('model:user') + registry.resolve('model:user') === undefined //=> true + ``` + @private + @method unregister + @param {String} fullName + */ + unregister: function (fullName) { + _emberMetal.assert('fullName must be a proper full name', this.validateFullName(fullName)); + + var normalizedName = this.normalize(fullName); + + this._localLookupCache = new _emberUtils.EmptyObject(); + + delete this.registrations[normalizedName]; + delete this._resolveCache[normalizedName]; + delete this._failCache[normalizedName]; + delete this._options[normalizedName]; }, /** - Call `advanceReadiness` after any asynchronous setup logic has completed. - Each call to `deferReadiness` must be matched by a call to `advanceReadiness` - or the application will never become ready and routing will not begin. - @method advanceReadiness - @see {Ember.Application#deferReadiness} - @public - */ - advanceReadiness: function () { - _emberMetal.assert('You must call advanceReadiness on an instance of Ember.Application', this instanceof Application); - this._readinessDeferrals--; + Given a fullName return the corresponding factory. + By default `resolve` will retrieve the factory from + the registry. + ```javascript + let registry = new Registry(); + registry.register('api:twitter', Twitter); + registry.resolve('api:twitter') // => Twitter + ``` + Optionally the registry can be provided with a custom resolver. + If provided, `resolve` will first provide the custom resolver + the opportunity to resolve the fullName, otherwise it will fallback + to the registry. + ```javascript + let registry = new Registry(); + registry.resolver = function(fullName) { + // lookup via the module system of choice + }; + // the twitter factory is added to the module system + registry.resolve('api:twitter') // => Twitter + ``` + @private + @method resolve + @param {String} fullName + @param {Object} [options] + @param {String} [options.source] the fullname of the request source (used for local lookups) + @return {Function} fullName's factory + */ + resolve: function (fullName, options) { + _emberMetal.assert('fullName must be a proper full name', this.validateFullName(fullName)); + var factory = resolve(this, this.normalize(fullName), options); + if (factory === undefined && this.fallback) { + var _fallback; - if (this._readinessDeferrals === 0) { - _emberMetal.run.once(this, this.didBecomeReady); + factory = (_fallback = this.fallback).resolve.apply(_fallback, arguments); } + return factory; }, /** - Initialize the application and return a promise that resolves with the `Ember.Application` - object when the boot process is complete. - Run any application 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. - By default, this method is called automatically on "DOM ready"; however, if autoboot - is disabled, this is automatically called when the first application instance is - created via `visit`. - @private - @method boot - @return {Promise} - */ - boot: function () { - if (this._bootPromise) { - return this._bootPromise; + A hook that can be used to describe how the resolver will + attempt to find the factory. + For example, the default Ember `.describe` returns the full + class name (including namespace) where Ember's resolver expects + to find the `fullName`. + @private + @method describe + @param {String} fullName + @return {string} described fullName + */ + describe: function (fullName) { + if (this.resolver && this.resolver.lookupDescription) { + return this.resolver.lookupDescription(fullName); + } else if (this.fallback) { + return this.fallback.describe(fullName); + } else { + return fullName; } + }, - try { - this._bootSync(); - } catch (_) { - // Ignore th error: in the asynchronous boot path, the error is already reflected - // in the promise rejection + /** + A hook to enable custom fullName normalization behaviour + @private + @method normalizeFullName + @param {String} fullName + @return {string} normalized fullName + */ + normalizeFullName: function (fullName) { + if (this.resolver && this.resolver.normalize) { + return this.resolver.normalize(fullName); + } else if (this.fallback) { + return this.fallback.normalizeFullName(fullName); + } else { + return fullName; } + }, - return this._bootPromise; + /** + Normalize a fullName based on the application's conventions + @private + @method normalize + @param {String} fullName + @return {string} normalized fullName + */ + normalize: function (fullName) { + return this._normalizeCache[fullName] || (this._normalizeCache[fullName] = this.normalizeFullName(fullName)); }, /** - Unfortunately, a lot of existing code assumes the booting process is - "synchronous". Specifically, a lot of tests assumes the last call to - `app.advanceReadiness()` or `app.reset()` will result in the app being - fully-booted when the current runloop completes. - We would like new code (like the `visit` API) to stop making this assumption, - so we created the asynchronous version above that returns a promise. But until - we have migrated all the code, we would have to expose this method for use - *internally* in places where we need to boot an app "synchronously". - @private - */ - _bootSync: function () { - if (this._booted) { - return; + @method makeToString + @private + @param {any} factory + @param {string} fullName + @return {function} toString function + */ + makeToString: function (factory, fullName) { + if (this.resolver && this.resolver.makeToString) { + return this.resolver.makeToString(factory, fullName); + } else if (this.fallback) { + return this.fallback.makeToString(factory, fullName); + } else { + return factory.toString(); } + }, - // Even though this returns synchronously, we still need to make sure the - // boot promise exists for book-keeping purposes: if anything went wrong in - // the boot process, we need to store the error as a rejection on the boot - // promise so that a future caller of `boot()` can tell what failed. - var defer = this._bootResolver = new _emberRuntime.RSVP.defer(); - this._bootPromise = defer.promise; + /** + Given a fullName check if the container is aware of its factory + or singleton instance. + @private + @method has + @param {String} fullName + @param {Object} [options] + @param {String} [options.source] the fullname of the request source (used for local lookups) + @return {Boolean} + */ + has: function (fullName, options) { + if (!this.isValidFullName(fullName)) { + return false; + } - try { - this.runInitializers(); - _emberRuntime.runLoadHooks('application', this); - this.advanceReadiness(); - // Continues to `didBecomeReady` - } catch (error) { - // For the asynchronous boot path - defer.reject(error); + var source = options && options.source && this.normalize(options.source); - // For the synchronous boot path - throw error; - } + return has(this, this.normalize(fullName), source); }, /** - Reset the application. This is typically used only in tests. It cleans up - the application in the following order: - 1. Deactivate existing routes - 2. Destroy all objects in the container - 3. Create a new application container - 4. Re-route to the existing url - Typical Example: - ```javascript - let App; - run(function() { - App = Ember.Application.create(); - }); - module('acceptance test', { - setup: function() { - App.reset(); - } - }); - test('first test', function() { - // App is freshly reset - }); - test('second test', function() { - // App is again freshly reset - }); - ``` - Advanced Example: - Occasionally you may want to prevent the app from initializing during - setup. This could enable extra configuration, or enable asserting prior - to the app becoming ready. - ```javascript - let App; - run(function() { - App = Ember.Application.create(); - }); - module('acceptance test', { - setup: function() { - run(function() { - App.reset(); - App.deferReadiness(); - }); - } - }); - test('first test', function() { - ok(true, 'something before app is initialized'); - run(function() { - App.advanceReadiness(); - }); - ok(true, 'something after app is initialized'); - }); - ``` - @method reset - @public - */ - reset: function () { - _emberMetal.assert('Calling reset() on instances of `Ember.Application` is not\n supported when globals mode is disabled; call `visit()` to\n create new `Ember.ApplicationInstance`s and dispose them\n via their `destroy()` method instead.', this._globalsMode && this.autoboot); - - var instance = this.__deprecatedInstance__; - - this._readinessDeferrals = 1; - this._bootPromise = null; - this._bootResolver = null; - this._booted = false; + Allow registering options for all factories of a type. + ```javascript + let registry = new Registry(); + let container = registry.container(); + // if all of type `connection` must not be singletons + registry.optionsForType('connection', { singleton: false }); + registry.register('connection:twitter', TwitterConnection); + registry.register('connection:facebook', FacebookConnection); + let twitter = container.lookup('connection:twitter'); + let twitter2 = container.lookup('connection:twitter'); + twitter === twitter2; // => false + let facebook = container.lookup('connection:facebook'); + let facebook2 = container.lookup('connection:facebook'); + facebook === facebook2; // => false + ``` + @private + @method optionsForType + @param {String} type + @param {Object} options + */ + optionsForType: function (type, options) { + this._typeOptions[type] = options; + }, - function handleReset() { - _emberMetal.run(instance, 'destroy'); - this._buildDeprecatedInstance(); - _emberMetal.run.schedule('actions', this, '_bootSync'); + getOptionsForType: function (type) { + var optionsForType = this._typeOptions[type]; + if (optionsForType === undefined && this.fallback) { + optionsForType = this.fallback.getOptionsForType(type); } - - _emberMetal.run.join(this, handleReset); + return optionsForType; }, /** - @private - @method didBecomeReady - */ - didBecomeReady: function () { - try { - // TODO: Is this still needed for _globalsMode = false? - if (!_emberMetal.isTesting()) { - // Eagerly name all classes that are already loaded - _emberRuntime.Namespace.processAll(); - _emberRuntime.setNamespaceSearchDisabled(true); - } - - // See documentation on `_autoboot()` for details - if (this.autoboot) { - var instance = undefined; + @private + @method options + @param {String} fullName + @param {Object} options + */ + options: function (fullName) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - if (this._globalsMode) { - // If we already have the __deprecatedInstance__ lying around, boot it to - // avoid unnecessary work - instance = this.__deprecatedInstance__; - } else { - // Otherwise, build an instance and boot it. This is currently unreachable, - // because we forced _globalsMode to === autoboot; but having this branch - // allows us to locally toggle that flag for weeding out legacy globals mode - // dependencies independently - instance = this.buildInstance(); - } + var normalizedName = this.normalize(fullName); + this._options[normalizedName] = options; + }, - instance._bootSync(); + getOptions: function (fullName) { + var normalizedName = this.normalize(fullName); + var options = this._options[normalizedName]; - // TODO: App.ready() is not called when autoboot is disabled, is this correct? - this.ready(); + if (options === undefined && this.fallback) { + options = this.fallback.getOptions(fullName); + } + return options; + }, - instance.startRouting(); - } + getOption: function (fullName, optionName) { + var options = this._options[fullName]; - // For the asynchronous boot path - this._bootResolver.resolve(this); + if (options && options[optionName] !== undefined) { + return options[optionName]; + } - // For the synchronous boot path - this._booted = true; - } catch (error) { - // For the asynchronous boot path - this._bootResolver.reject(error); + var type = fullName.split(':')[0]; + options = this._typeOptions[type]; - // For the synchronous boot path - throw error; + if (options && options[optionName] !== undefined) { + return options[optionName]; + } else if (this.fallback) { + return this.fallback.getOption(fullName, optionName); } }, /** - Called when the Application has become ready, immediately before routing - begins. The call will be delayed until the DOM has become ready. - @event ready - @public - */ - ready: function () { - return this; - }, - - // This method must be moved to the application instance object - willDestroy: function () { - this._super.apply(this, arguments); - _emberRuntime.setNamespaceSearchDisabled(false); - this._booted = false; - this._bootPromise = null; - this._bootResolver = null; + 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. + For example, provided each object of type `controller` needed a `router`. + one would do the following: + ```javascript + let registry = new Registry(); + let container = registry.container(); + registry.register('router:main', Router); + registry.register('controller:user', UserController); + registry.register('controller:post', PostController); + registry.typeInjection('controller', 'router', 'router:main'); + let user = container.lookup('controller:user'); + let post = container.lookup('controller:post'); + user.router instanceof Router; //=> true + post.router instanceof Router; //=> true + // both controllers share the same router + user.router === post.router; //=> true + ``` + @private + @method typeInjection + @param {String} type + @param {String} property + @param {String} fullName + */ + typeInjection: function (type, property, fullName) { + _emberMetal.assert('fullName must be a proper full name', this.validateFullName(fullName)); - if (_emberRuntime._loaded.application === this) { - _emberRuntime._loaded.application = undefined; + var fullNameType = fullName.split(':')[0]; + if (fullNameType === type) { + throw new Error('Cannot inject a \'' + fullName + '\' on other ' + type + '(s).'); } - if (this._globalsMode && this.__deprecatedInstance__) { - this.__deprecatedInstance__.destroy(); - } + var injections = this._typeInjections[type] || (this._typeInjections[type] = []); + + injections.push({ + property: property, + fullName: fullName + }); }, /** - Boot a new instance of `Ember.ApplicationInstance` for the current - application and navigate it to the given `url`. Returns a `Promise` that - resolves with the instance when the initial routing and rendering is - complete, or rejects with any error that occured during the boot process. - When `autoboot` is disabled, calling `visit` would first cause the - application to boot, which runs the application initializers. - This method also takes a hash of boot-time configuration options for - customizing the instance's behavior. See the documentation on - `Ember.ApplicationInstance.BootOptions` for details. - `Ember.ApplicationInstance.BootOptions` is an interface class that exists - purely to document the available options; you do not need to construct it - manually. Simply pass a regular JavaScript object containing of the - desired options: - ```javascript - MyApp.visit("/", { location: "none", rootElement: "#container" }); - ``` - ### Supported Scenarios - While the `BootOptions` class exposes a large number of knobs, not all - combinations of them are valid; certain incompatible combinations might - result in unexpected behavior. - For example, booting the instance in the full browser environment - while specifying a foriegn `document` object (e.g. `{ isBrowser: true, - document: iframe.contentDocument }`) does not work correctly today, - largely due to Ember's jQuery dependency. - Currently, there are three officially supported scenarios/configurations. - Usages outside of these scenarios are not guaranteed to work, but please - feel free to file bug reports documenting your experience and any issues - you encountered to help expand support. - #### Browser Applications (Manual Boot) - The setup is largely similar to how Ember works out-of-the-box. Normally, - Ember will boot a default instance for your Application on "DOM ready". - However, you can customize this behavior by disabling `autoboot`. - For example, this allows you to render a miniture demo of your application - into a specific area on your marketing website: - ```javascript - import MyApp from 'my-app'; - $(function() { - let App = MyApp.create({ autoboot: false }); - let options = { - // Override the router's location adapter to prevent it from updating - // the URL in the address bar - location: 'none', - // Override the default `rootElement` on the app to render into a - // specific `div` on the page - rootElement: '#demo' - }; - // Start the app at the special demo URL - App.visit('/demo', options); - }); - ```` - Or perhaps you might want to boot two instances of your app on the same - page for a split-screen multiplayer experience: - ```javascript - import MyApp from 'my-app'; - $(function() { - let App = MyApp.create({ autoboot: false }); - let sessionId = MyApp.generateSessionID(); - let player1 = App.visit(`/matches/join?name=Player+1&session=${sessionId}`, { rootElement: '#left', location: 'none' }); - let player2 = App.visit(`/matches/join?name=Player+2&session=${sessionId}`, { rootElement: '#right', location: 'none' }); - Promise.all([player1, player2]).then(() => { - // Both apps have completed the initial render - $('#loading').fadeOut(); - }); - }); - ``` - Do note that each app instance maintains their own registry/container, so - they will run in complete isolation by default. - #### Server-Side Rendering (also known as FastBoot) - This setup allows you to run your Ember app in a server environment using - Node.js and render its content into static HTML for SEO purposes. - ```javascript - const HTMLSerializer = new SimpleDOM.HTMLSerializer(SimpleDOM.voidMap); - function renderURL(url) { - let dom = new SimpleDOM.Document(); - let rootElement = dom.body; - let options = { isBrowser: false, document: dom, rootElement: rootElement }; - return MyApp.visit(options).then(instance => { - try { - return HTMLSerializer.serialize(rootElement.firstChild); - } finally { - instance.destroy(); - } - }); - } - ``` - In this scenario, because Ember does not have access to a global `document` - object in the Node.js environment, you must provide one explicitly. In practice, - in the non-browser environment, the stand-in `document` object only need to - implement a limited subset of the full DOM API. The `SimpleDOM` library is known - to work. - Since there is no access to jQuery in the non-browser environment, you must also - specify a DOM `Element` object in the same `document` for the `rootElement` option - (as opposed to a selector string like `"body"`). - See the documentation on the `isBrowser`, `document` and `rootElement` properties - on `Ember.ApplicationInstance.BootOptions` for details. - #### Server-Side Resource Discovery - This setup allows you to run the routing layer of your Ember app in a server - environment using Node.js and completely disable rendering. This allows you - to simulate and discover the resources (i.e. AJAX requests) needed to fufill - a given request and eagerly "push" these resources to the client. - ```app/initializers/network-service.js - import BrowserNetworkService from 'app/services/network/browser'; - import NodeNetworkService from 'app/services/network/node'; - // Inject a (hypothetical) service for abstracting all AJAX calls and use - // the appropiate implementaion on the client/server. This also allows the - // server to log all the AJAX calls made during a particular request and use - // that for resource-discovery purpose. - export function initialize(application) { - if (window) { // browser - application.register('service:network', BrowserNetworkService); - } else { // node - application.register('service:network', NodeNetworkService); - } - application.inject('route', 'network', 'service:network'); - }; - export default { - name: 'network-service', - initialize: initialize - }; - ``` - ```app/routes/post.js - import Ember from 'ember'; - // An example of how the (hypothetical) service is used in routes. - export default Ember.Route.extend({ - model(params) { - return this.network.fetch(`/api/posts/${params.post_id}.json`); - }, - afterModel(post) { - if (post.isExternalContent) { - return this.network.fetch(`/api/external/?url=${post.externalURL}`); - } else { - return post; - } - } - }); - ``` - ```javascript - // Finally, put all the pieces together - function discoverResourcesFor(url) { - return MyApp.visit(url, { isBrowser: false, shouldRender: false }).then(instance => { - let networkService = instance.lookup('service:network'); - return networkService.requests; // => { "/api/posts/123.json": "..." } - }); + Defines injection rules. + These rules are used to inject dependencies onto objects when they + are instantiated. + Two forms of injections are possible: + * Injecting one fullName on another fullName + * Injecting one fullName on a type + Example: + ```javascript + let registry = new Registry(); + let container = registry.container(); + registry.register('source:main', Source); + registry.register('model:user', User); + registry.register('model:post', Post); + // injecting one fullName on another fullName + // eg. each user model gets a post model + registry.injection('model:user', 'post', 'model:post'); + // injecting one fullName on another type + registry.injection('model', 'source', 'source:main'); + let user = container.lookup('model:user'); + let post = container.lookup('model:post'); + user.source instanceof Source; //=> true + post.source instanceof Source; //=> true + user.post instanceof Post; //=> true + // and both models share the same source + user.source === post.source; //=> true + ``` + @private + @method injection + @param {String} factoryName + @param {String} property + @param {String} injectionName + */ + injection: function (fullName, property, injectionName) { + this.validateFullName(injectionName); + var normalizedInjectionName = this.normalize(injectionName); + + if (fullName.indexOf(':') === -1) { + return this.typeInjection(fullName, property, normalizedInjectionName); } - ``` - @public - @method visit - @param url {String} The initial URL to navigate to - @param options {Ember.ApplicationInstance.BootOptions} - @return {Promise} - */ - visit: function (url, options) { - var _this = this; - return this.boot().then(function () { - var instance = _this.buildInstance(); + _emberMetal.assert('fullName must be a proper full name', this.validateFullName(fullName)); + var normalizedName = this.normalize(fullName); - return instance.boot(options).then(function () { - return instance.visit(url); - }).catch(function (error) { - _emberMetal.run(instance, 'destroy'); - throw error; - }); - }); - } - }); + var injections = this._injections[normalizedName] || (this._injections[normalizedName] = []); - Object.defineProperty(Application.prototype, 'registry', { - configurable: true, - enumerable: false, - get: function () { - return _emberRuntime.buildFakeRegistryWithDeprecations(this, 'Application'); - } - }); + injections.push({ + property: property, + fullName: normalizedInjectionName + }); + }, - Application.reopenClass({ /** - This creates a registry with the default Ember naming conventions. - It also configures the registry: - * registered views are created every time they are looked up (they are - not singletons) - * registered templates are not factories; the registered value is - returned directly. - * the router receives the application as its `namespace` property - * all controllers receive the router as their `target` and `controllers` - properties - * 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 - @method buildRegistry - @static - @param {Ember.Application} namespace the application for which to - build the registry - @return {Ember.Registry} the built registry + Used only via `factoryInjection`. + Provides a specialized form of injection, specifically enabling + all factory of one type to be injected with a reference to another + object. + For example, provided each factory of type `model` needed a `store`. + one would do the following: + ```javascript + let registry = new Registry(); + registry.register('store:main', SomeStore); + registry.factoryTypeInjection('model', 'store', 'store:main'); + let store = registry.lookup('store:main'); + let UserFactory = registry.lookupFactory('model:user'); + UserFactory.store instanceof SomeStore; //=> true + ``` @private - */ - buildRegistry: function (application) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - - var registry = this._super.apply(this, arguments); - - commonSetupRegistry(registry); - - _emberGlimmer.setupApplicationRegistry(registry); - - return registry; - } - }); - - function commonSetupRegistry(registry) { - registry.register('-view-registry:main', { create: function () { - return _emberUtils.dictionary(null); - } }); - - registry.register('route:basic', _emberRouting.Route); - registry.register('event_dispatcher:main', _emberViews.EventDispatcher); - - registry.injection('router:main', 'namespace', 'application:main'); + @method factoryTypeInjection + @param {String} type + @param {String} property + @param {String} fullName + */ + factoryTypeInjection: function (type, property, fullName) { + var injections = this._factoryTypeInjections[type] || (this._factoryTypeInjections[type] = []); - registry.register('location:auto', _emberRouting.AutoLocation); - registry.register('location:hash', _emberRouting.HashLocation); - registry.register('location:history', _emberRouting.HistoryLocation); - registry.register('location:none', _emberRouting.NoneLocation); + injections.push({ + property: property, + fullName: this.normalize(fullName) + }); + }, - registry.register(_container.privatize(_templateObject), _emberRouting.BucketCache); - } + /** + Defines factory injection rules. + Similar to regular injection rules, but are run against factories, via + `Registry#lookupFactory`. + These rules are used to inject objects onto factories when they + are looked up. + Two forms of injections are possible: + * Injecting one fullName on another fullName + * Injecting one fullName on a type + Example: + ```javascript + let registry = new Registry(); + let container = registry.container(); + registry.register('store:main', Store); + registry.register('store:secondary', OtherStore); + registry.register('model:user', User); + registry.register('model:post', Post); + // injecting one fullName on another type + registry.factoryInjection('model', 'store', 'store:main'); + // injecting one fullName on another fullName + registry.factoryInjection('model:post', 'secondaryStore', 'store:secondary'); + let UserFactory = container.lookupFactory('model:user'); + let PostFactory = container.lookupFactory('model:post'); + let store = container.lookup('store:main'); + UserFactory.store instanceof Store; //=> true + UserFactory.secondaryStore instanceof OtherStore; //=> false + PostFactory.store instanceof Store; //=> true + PostFactory.secondaryStore instanceof OtherStore; //=> true + // and both models share the same source instance + UserFactory.store === PostFactory.store; //=> true + ``` + @private + @method factoryInjection + @param {String} factoryName + @param {String} property + @param {String} injectionName + */ + factoryInjection: function (fullName, property, injectionName) { + var normalizedName = this.normalize(fullName); + var normalizedInjectionName = this.normalize(injectionName); - function registerLibraries() { - if (!librariesRegistered) { - librariesRegistered = true; + this.validateFullName(injectionName); - if (_emberEnvironment.environment.hasDOM && typeof _emberViews.jQuery === 'function') { - _emberMetal.libraries.registerCoreLibrary('jQuery', _emberViews.jQuery().jquery); + if (fullName.indexOf(':') === -1) { + return this.factoryTypeInjection(normalizedName, property, normalizedInjectionName); } - } - } - function logLibraryVersions() { - if (_emberEnvironment.ENV.LOG_VERSION) { - // we only need to see this once per Application#init - _emberEnvironment.ENV.LOG_VERSION = false; - var libs = _emberMetal.libraries._registry; + var injections = this._factoryInjections[normalizedName] || (this._factoryInjections[normalizedName] = []); - var nameLengths = libs.map(function (item) { - return _emberMetal.get(item, 'name.length'); + injections.push({ + property: property, + fullName: normalizedInjectionName }); + }, - var maxNameLength = Math.max.apply(this, nameLengths); - - _emberMetal.debug('-------------------------------'); - for (var i = 0; i < libs.length; i++) { - var lib = libs[i]; - var spaces = new Array(maxNameLength - lib.name.length + 1).join(' '); - _emberMetal.debug([lib.name, spaces, ' : ', lib.version].join('')); - } - _emberMetal.debug('-------------------------------'); - } - } - - exports.default = Application; -}); -enifed('ember-application/system/engine-instance', ['exports', 'ember-utils', 'ember-runtime', 'ember-metal', 'container', 'ember-application/system/engine-parent'], function (exports, _emberUtils, _emberRuntime, _emberMetal, _container, _emberApplicationSystemEngineParent) { - /** - @module ember - @submodule ember-application - */ - - 'use strict'; - - var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); - - /** - The `EngineInstance` encapsulates all of the stateful aspects of a - running `Engine`. - - @public - @class Ember.EngineInstance - @extends Ember.Object - @uses RegistryProxyMixin - @uses ContainerProxyMixin - */ - - var EngineInstance = _emberRuntime.Object.extend(_emberRuntime.RegistryProxyMixin, _emberRuntime.ContainerProxyMixin, { /** - The base `Engine` for which this is an instance. - @property {Ember.Engine} engine - @private + @private + @method knownForType + @param {String} type the type to iterate over */ - base: null, - - init: function () { - this._super.apply(this, arguments); - - _emberUtils.guidFor(this); + knownForType: function (type) { + var fallbackKnown = undefined, + resolverKnown = undefined; - var base = this.base; + var localKnown = _emberUtils.dictionary(null); + var registeredNames = Object.keys(this.registrations); + for (var index = 0; index < registeredNames.length; index++) { + var fullName = registeredNames[index]; + var itemType = fullName.split(':')[0]; - if (!base) { - base = this.application; - this.base = base; + if (itemType === type) { + localKnown[fullName] = true; + } } - // Create a per-instance registry that will use the application's registry - // as a fallback for resolving registrations. - var registry = this.__registry__ = new _container.Registry({ - fallback: base.__registry__ - }); + if (this.fallback) { + fallbackKnown = this.fallback.knownForType(type); + } - // Create a per-instance container from the instance's registry - this.__container__ = registry.container({ owner: this }); + if (this.resolver && this.resolver.knownForType) { + resolverKnown = this.resolver.knownForType(type); + } - this._booted = false; + return _emberUtils.assign({}, fallbackKnown, localKnown, resolverKnown); }, - /** - Initialize the `Ember.EngineInstance` and return a promise that resolves - with the instance itself when the boot process is complete. - The primary task here is to run any registered instance initializers. - See the documentation on `BootOptions` for the options it takes. - @private - @method boot - @param options {Object} - @return {Promise} - */ - boot: function (options) { - var _this = this; - - if (this._bootPromise) { - return this._bootPromise; + validateFullName: function (fullName) { + if (!this.isValidFullName(fullName)) { + throw new TypeError('Invalid Fullname, expected: \'type:name\' got: ' + fullName); } - this._bootPromise = new _emberRuntime.RSVP.Promise(function (resolve) { - return resolve(_this._bootSync(options)); - }); + return true; + }, - return this._bootPromise; + isValidFullName: function (fullName) { + return !!VALID_FULL_NAME_REGEXP.test(fullName); }, - /** - Unfortunately, a lot of existing code assumes booting an instance is - synchronous – specifically, a lot of tests assume the last call to - `app.advanceReadiness()` or `app.reset()` will result in a new instance - being fully-booted when the current runloop completes. - We would like new code (like the `visit` API) to stop making this - assumption, so we created the asynchronous version above that returns a - promise. But until we have migrated all the code, we would have to expose - this method for use *internally* in places where we need to boot an instance - synchronously. - @private - */ - _bootSync: function (options) { - if (this._booted) { - return this; + validateInjections: function (injections) { + if (!injections) { + return; } - _emberMetal.assert('An engine instance\'s parent must be set via `setEngineParent(engine, parent)` prior to calling `engine.boot()`.', _emberApplicationSystemEngineParent.getEngineParent(this)); + var fullName = undefined; - this.cloneParentDependencies(); + for (var i = 0; i < injections.length; i++) { + fullName = injections[i].fullName; - this.setupRegistry(options); + _emberMetal.assert('Attempting to inject an unknown injection: \'' + fullName + '\'', this.has(fullName)); + } + }, - this.base.runInstanceInitializers(this); + normalizeInjectionsHash: function (hash) { + var injections = []; - this._booted = true; + for (var key in hash) { + if (hash.hasOwnProperty(key)) { + _emberMetal.assert('Expected a proper full name, given \'' + hash[key] + '\'', this.validateFullName(hash[key])); - return this; - }, + injections.push({ + property: key, + fullName: hash[key] + }); + } + } - setupRegistry: function () { - var options = arguments.length <= 0 || arguments[0] === undefined ? this.__container__.lookup('-environment:main') : arguments[0]; + return injections; + }, - this.constructor.setupRegistry(this.__registry__, options); + getInjections: function (fullName) { + var injections = this._injections[fullName] || []; + if (this.fallback) { + injections = injections.concat(this.fallback.getInjections(fullName)); + } + return injections; }, - /** - Unregister a factory. - Overrides `RegistryProxy#unregister` in order to clear any cached instances - of the unregistered factory. - @public - @method unregister - @param {String} fullName - */ - unregister: function (fullName) { - this.__container__.reset(fullName); - this._super.apply(this, arguments); + getTypeInjections: function (type) { + var injections = this._typeInjections[type] || []; + if (this.fallback) { + injections = injections.concat(this.fallback.getTypeInjections(type)); + } + return injections; }, - /** - @private - */ - willDestroy: function () { - this._super.apply(this, arguments); - _emberMetal.run(this.__container__, 'destroy'); + getFactoryInjections: function (fullName) { + var injections = this._factoryInjections[fullName] || []; + if (this.fallback) { + injections = injections.concat(this.fallback.getFactoryInjections(fullName)); + } + return injections; }, - /** - 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]; - - var Engine = this.lookup('engine:' + name); - - if (!Engine) { - throw new _emberMetal.Error('You attempted to mount the engine \'' + name + '\', but it is not registered with its parent.'); + getFactoryTypeInjections: function (type) { + var injections = this._factoryTypeInjections[type] || []; + if (this.fallback) { + injections = injections.concat(this.fallback.getFactoryTypeInjections(type)); } + return injections; + } + }; - var engineInstance = Engine.buildInstance(options); + function deprecateResolverFunction(registry) { + _emberMetal.deprecate('Passing a `resolver` function into a Registry is deprecated. Please pass in a Resolver object with a `resolve` method.', false, { id: 'ember-application.registry-resolver-as-function', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_registry-resolver-as-function' }); + registry.resolver = { + resolve: registry.resolver + }; + } - _emberApplicationSystemEngineParent.setEngineParent(engineInstance, this); + /** + Given a fullName and a source fullName returns the fully resolved + fullName. Used to allow for local lookup. + + ```javascript + let registry = new Registry(); + + // the twitter factory is added to the module system + registry.expandLocalLookup('component:post-title', { source: 'template:post' }) // => component:post/post-title + ``` + + @private + @method expandLocalLookup + @param {String} fullName + @param {Object} [options] + @param {String} [options.source] the fullname of the request source (used for local lookups) + @return {String} fullName + */ + Registry.prototype.expandLocalLookup = function Registry_expandLocalLookup(fullName, options) { + if (this.resolver && this.resolver.expandLocalLookup) { + _emberMetal.assert('fullName must be a proper full name', this.validateFullName(fullName)); + _emberMetal.assert('options.source must be provided to expandLocalLookup', options && options.source); + _emberMetal.assert('options.source must be a proper full name', this.validateFullName(options.source)); - return engineInstance; - }, + var normalizedFullName = this.normalize(fullName); + var normalizedSource = this.normalize(options.source); - /** - Clone dependencies shared between an engine instance and its parent. - @private - @method cloneParentDependencies - */ - cloneParentDependencies: function () { - var _this2 = this; + return expandLocalLookup(this, normalizedFullName, normalizedSource); + } else if (this.fallback) { + return this.fallback.expandLocalLookup(fullName, options); + } else { + return null; + } + }; - var parent = _emberApplicationSystemEngineParent.getEngineParent(this); + function expandLocalLookup(registry, normalizedName, normalizedSource) { + var cache = registry._localLookupCache; + var normalizedNameCache = cache[normalizedName]; - var registrations = ['route:basic', 'event_dispatcher:main', 'service:-routing', 'service:-glimmer-environment']; + if (!normalizedNameCache) { + normalizedNameCache = cache[normalizedName] = new _emberUtils.EmptyObject(); + } - registrations.forEach(function (key) { - return _this2.register(key, parent.resolveRegistration(key)); - }); + var cached = normalizedNameCache[normalizedSource]; - var env = parent.lookup('-environment:main'); - this.register('-environment:main', env, { instantiate: false }); + if (cached !== undefined) { + return cached; + } - var singletons = ['router:main', _container.privatize(_templateObject), '-view-registry:main', 'renderer:-' + (env.isInteractive ? 'dom' : 'inert')]; + var expanded = registry.resolver.expandLocalLookup(normalizedName, normalizedSource); - singletons.forEach(function (key) { - return _this2.register(key, parent.lookup(key), { instantiate: false }); - }); + return normalizedNameCache[normalizedSource] = expanded; + } - this.inject('view', '_environment', '-environment:main'); - this.inject('route', '_environment', '-environment:main'); - } - }); + function resolve(registry, normalizedName, options) { + if (options && options.source) { + // when `source` is provided expand normalizedName + // and source into the full normalizedName + normalizedName = registry.expandLocalLookup(normalizedName, options); - EngineInstance.reopenClass({ - /** - @private - @method setupRegistry - @param {Registry} registry - @param {BootOptions} options - */ - setupRegistry: function (registry, options) { - // when no options/environment is present, do nothing - if (!options) { + // if expandLocalLookup returns falsey, we do not support local lookup + if (!normalizedName) { return; } + } - registry.injection('view', '_environment', '-environment:main'); - registry.injection('route', '_environment', '-environment:main'); + var cached = registry._resolveCache[normalizedName]; + if (cached !== undefined) { + return cached; + } + if (registry._failCache[normalizedName]) { + return; + } - if (options.isInteractive) { - registry.injection('view', 'renderer', 'renderer:-dom'); - registry.injection('component', 'renderer', 'renderer:-dom'); - } else { - registry.injection('view', 'renderer', 'renderer:-inert'); - registry.injection('component', 'renderer', 'renderer:-inert'); - } + var resolved = undefined; + + if (registry.resolver) { + resolved = registry.resolver.resolve(normalizedName); } - }); - exports.default = EngineInstance; -}); -enifed('ember-application/system/engine-parent', ['exports', 'ember-utils'], function (exports, _emberUtils) { - 'use strict'; + if (resolved === undefined) { + resolved = registry.registrations[normalizedName]; + } - exports.getEngineParent = getEngineParent; - exports.setEngineParent = setEngineParent; - var ENGINE_PARENT = _emberUtils.symbol('ENGINE_PARENT'); + if (resolved === undefined) { + registry._failCache[normalizedName] = true; + } else { + registry._resolveCache[normalizedName] = resolved; + } - exports.ENGINE_PARENT = ENGINE_PARENT; - /** - `getEngineParent` retrieves an engine instance's parent instance. - - @method getEngineParent - @param {EngineInstance} engine An engine instance. - @return {EngineInstance} The parent engine instance. - @for Ember - @public - */ + return resolved; + } - function getEngineParent(engine) { - return engine[ENGINE_PARENT]; + function has(registry, fullName, source) { + return registry.resolve(fullName, { source: source }) !== undefined; } - /** - `setEngineParent` sets an engine instance's parent instance. - - @method setEngineParent - @param {EngineInstance} engine An engine instance. - @param {EngineInstance} parent The parent engine instance. - @private - */ + var privateNames = _emberUtils.dictionary(null); + var privateSuffix = '' + Math.random() + Date.now(); - function setEngineParent(engine, parent) { - engine[ENGINE_PARENT] = parent; + function privatize(_ref) { + var fullName = _ref[0]; + + var name = privateNames[fullName]; + if (name) { + return name; + } + + var _fullName$split = fullName.split(':'); + + var type = _fullName$split[0]; + var rawName = _fullName$split[1]; + + return privateNames[fullName] = _emberUtils.intern(type + ':' + rawName + '-' + privateSuffix); } }); -enifed('ember-application/system/engine', ['exports', 'ember-utils', 'ember-runtime', 'container', 'dag-map', 'ember-metal', 'ember-application/system/resolver', 'ember-application/system/engine-instance', 'ember-routing', 'ember-extension-support', 'ember-views', 'ember-glimmer'], function (exports, _emberUtils, _emberRuntime, _container, _dagMap, _emberMetal, _emberApplicationSystemResolver, _emberApplicationSystemEngineInstance, _emberRouting, _emberExtensionSupport, _emberViews, _emberGlimmer) { +enifed('dag-map', ['exports'], function (exports) { 'use strict'; + +/** + * A map of key/value pairs with dependencies contraints that can be traversed + * in topological order and is checked for cycles. + * + * @class DAG + * @constructor + */ +var DAG = (function () { + function DAG() { + this._vertices = new Vertices(); + } + /** + * Adds a key/value pair with dependencies on other key/value pairs. + * + * @public + * @method addEdges + * @param {string[]} key The key of the vertex to be added. + * @param {any} value The value of that vertex. + * @param {string[]|string|undefined} before A key or array of keys of the vertices that must + * be visited before this vertex. + * @param {string[]|string|undefined} after An string or array of strings with the keys of the + * vertices that must be after this vertex is visited. + */ + DAG.prototype.add = function (key, value, before, after) { + var vertices = this._vertices; + var v = vertices.add(key); + v.val = value; + if (before) { + if (typeof before === "string") { + vertices.addEdge(v, vertices.add(before)); + } + else { + for (var i = 0; i < before.length; i++) { + vertices.addEdge(v, vertices.add(before[i])); + } + } + } + if (after) { + if (typeof after === "string") { + vertices.addEdge(vertices.add(after), v); + } + else { + for (var i = 0; i < after.length; i++) { + vertices.addEdge(vertices.add(after[i]), v); + } + } + } + }; + /** + * Visits key/value pairs in topological order. + * + * @public + * @method topsort + * @param {Function} fn The function to be invoked with each key/value. + */ + DAG.prototype.topsort = function (callback) { + this._vertices.topsort(callback); + }; + return DAG; +}()); +var Vertices = (function () { + function Vertices() { + this.stack = new IntStack(); + this.result = new IntStack(); + this.vertices = []; + } + Vertices.prototype.add = function (key) { + if (!key) + throw new Error("missing key"); + var vertices = this.vertices; + var i = 0; + var vertex; + for (; i < vertices.length; i++) { + vertex = vertices[i]; + if (vertex.key === key) + return vertex; + } + return vertices[i] = { + id: i, + key: key, + val: null, + inc: null, + out: false, + mark: false + }; + }; + Vertices.prototype.addEdge = function (v, w) { + this.check(v, w.key); + var inc = w.inc; + if (!inc) { + w.inc = [v.id]; + } + else { + var i = 0; + for (; i < inc.length; i++) { + if (inc[i] === v.id) + return; + } + inc[i] = v.id; + } + v.out = true; + }; + Vertices.prototype.topsort = function (cb) { + this.reset(); + var vertices = this.vertices; + for (var i = 0; i < vertices.length; i++) { + var vertex = vertices[i]; + if (vertex.out) + continue; + this.visit(vertex, undefined); + } + this.each(cb); + }; + Vertices.prototype.check = function (v, w) { + if (v.key === w) { + throw new Error("cycle detected: " + w + " <- " + w); + } + var inc = v.inc; + // quick check + if (!inc || inc.length === 0) + return; + var vertices = this.vertices; + // shallow check + for (var i = 0; i < inc.length; i++) { + var key = vertices[inc[i]].key; + if (key === w) { + throw new Error("cycle detected: " + w + " <- " + v.key + " <- " + w); + } + } + // deep check + this.reset(); + this.visit(v, w); + if (this.result.len > 0) { + var msg_1 = "cycle detected: " + w; + this.each(function (key) { + msg_1 += " <- " + key; + }); + throw new Error(msg_1); + } + }; + Vertices.prototype.each = function (cb) { + var _a = this, result = _a.result, vertices = _a.vertices; + for (var i = 0; i < result.len; i++) { + var vertex = vertices[result.stack[i]]; + cb(vertex.key, vertex.val); + } + }; + // reuse between cycle check and topsort + Vertices.prototype.reset = function () { + this.stack.len = 0; + this.result.len = 0; + var vertices = this.vertices; + for (var i = 0; i < vertices.length; i++) { + vertices[i].mark = false; + } + }; + Vertices.prototype.visit = function (start, search) { + var _a = this, stack = _a.stack, result = _a.result, vertices = _a.vertices; + stack.push(start.id); + while (stack.len) { + var index = stack.pop(); + if (index < 0) { + index = ~index; + if (search) { + result.pop(); + } + else { + result.push(index); + } + } + else { + var vertex = vertices[index]; + if (vertex.mark) { + continue; + } + if (search) { + result.push(index); + if (search === vertex.key) { + return; + } + } + vertex.mark = true; + stack.push(~index); + var incoming = vertex.inc; + if (incoming) { + var i = incoming.length; + while (i--) { + index = incoming[i]; + if (!vertices[index].mark) { + stack.push(index); + } + } + } + } + } + }; + return Vertices; +}()); +var IntStack = (function () { + function IntStack() { + this.stack = [0, 0, 0, 0, 0, 0]; + this.len = 0; + } + IntStack.prototype.push = function (n) { + this.stack[this.len++] = n; + }; + IntStack.prototype.pop = function () { + return this.stack[--this.len]; + }; + return IntStack; +}()); + +exports['default'] = DAG; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}); +enifed('ember-application/index', ['exports', 'ember-application/initializers/dom-templates', 'ember-application/system/application', 'ember-application/system/application-instance', 'ember-application/system/resolver', 'ember-application/system/engine', 'ember-application/system/engine-instance', 'ember-application/system/engine-parent'], function (exports, _emberApplicationInitializersDomTemplates, _emberApplicationSystemApplication, _emberApplicationSystemApplicationInstance, _emberApplicationSystemResolver, _emberApplicationSystemEngine, _emberApplicationSystemEngineInstance, _emberApplicationSystemEngineParent) { /** @module ember @submodule ember-application */ + 'use strict'; - var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); + exports.Application = _emberApplicationSystemApplication.default; + exports.ApplicationInstance = _emberApplicationSystemApplicationInstance.default; + exports.Resolver = _emberApplicationSystemResolver.default; + exports.Engine = _emberApplicationSystemEngine.default; + exports.EngineInstance = _emberApplicationSystemEngineInstance.default; + exports.getEngineParent = _emberApplicationSystemEngineParent.getEngineParent; + exports.setEngineParent = _emberApplicationSystemEngineParent.setEngineParent; - function props(obj) { - var properties = []; + // add domTemplates initializer (only does something if `ember-template-compiler` + // is loaded already) +}); +enifed('ember-application/initializers/dom-templates', ['exports', 'require', 'ember-glimmer', 'ember-environment', 'ember-application/system/application'], function (exports, _require, _emberGlimmer, _emberEnvironment, _emberApplicationSystemApplication) { + 'use strict'; - for (var key in obj) { - properties.push(key); + var bootstrap = function () {}; + + _emberApplicationSystemApplication.default.initializer({ + name: 'domTemplates', + initialize: function () { + var bootstrapModuleId = 'ember-template-compiler/system/bootstrap'; + var context = undefined; + if (_emberEnvironment.environment.hasDOM && _require.has(bootstrapModuleId)) { + bootstrap = _require.default(bootstrapModuleId).default; + context = document; + } + + bootstrap({ context: context, hasTemplate: _emberGlimmer.hasTemplate, setTemplate: _emberGlimmer.setTemplate }); } + }); +}); +enifed('ember-application/system/application-instance', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-environment', 'ember-views', 'ember-application/system/engine-instance'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberEnvironment, _emberViews, _emberApplicationSystemEngineInstance) { + /** + @module ember + @submodule ember-application + */ - return properties; - } + 'use strict'; + + var BootOptions = undefined; /** - The `Engine` class contains core functionality for both applications and - engines. + The `ApplicationInstance` encapsulates all of the stateful aspects of a + running `Application`. - Each engine manages a registry that's used for dependency injection and - exposed through `RegistryProxy`. + At a high-level, we break application boot into two distinct phases: - Engines also manage initializers and instance initializers. + * Definition time, where all of the classes, templates, and other + dependencies are loaded (typically in the browser). + * Run time, where we begin executing the application once everything + has loaded. - Engines can spawn `EngineInstance` instances via `buildInstance()`. + Definition time can be expensive and only needs to happen once since it is + an idempotent operation. For example, between test runs and FastBoot + requests, the application stays the same. It is only the state that we want + to reset. + + That state is what the `ApplicationInstance` manages: it is responsible for + creating the container that contains all application state, and disposing of + it once the particular test run or FastBoot request has finished. - @class Engine - @namespace Ember - @extends Ember.Namespace - @uses RegistryProxy @public + @class Ember.ApplicationInstance + @extends Ember.EngineInstance */ - var Engine = _emberRuntime.Namespace.extend(_emberRuntime.RegistryProxyMixin, { - init: function () { - this._super.apply(this, arguments); - - this.buildRegistry(); - }, + var ApplicationInstance = _emberApplicationSystemEngineInstance.default.extend({ /** - A private flag indicating whether an engine's initializers have run yet. - @private - @property _initializersRan + The `Application` for which this is an instance. + @property {Ember.Application} application + @private */ - _initializersRan: false, + application: null, /** - Ensure that initializers are run once, and only once, per engine. + The DOM events for which the event dispatcher should listen. + By default, the application's `Ember.EventDispatcher` listens + for a set of standard DOM events, such as `mousedown` and + `keyup`, and delegates them to your application's `Ember.View` + instances. @private - @method ensureInitializers + @property {Object} customEvents */ - ensureInitializers: function () { - if (!this._initializersRan) { - this.runInitializers(); - this._initializersRan = true; - } - }, + customEvents: null, /** - Create an EngineInstance for this engine. + The root DOM element of the Application as an element or a + [jQuery-compatible selector + string](http://api.jquery.com/category/selectors/). @private - @method buildInstance - @return {Ember.EngineInstance} the engine instance + @property {String|DOMElement} rootElement */ - buildInstance: function () { - var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + rootElement: null, - this.ensureInitializers(); - options.base = this; - return _emberApplicationSystemEngineInstance.default.create(options); + init: function () { + this._super.apply(this, arguments); + + // Register this instance in the per-instance registry. + // + // Why do we need to register the instance in the first place? + // Because we need a good way for the root route (a.k.a ApplicationRoute) + // to notify us when it has created the root-most view. That view is then + // appended to the rootElement, in the case of apps, to the fixture harness + // in tests, or rendered to a string in the case of FastBoot. + this.register('-application-instance:main', this, { instantiate: false }); }, /** - Build and configure the registry for the current engine. + Overrides the base `EngineInstance._bootSync` method with concerns relevant + to booting application (instead of engine) instances. + This method should only contain synchronous boot concerns. Asynchronous + boot concerns should eventually be moved to the `boot` method, which + returns a promise. + Until all boot code has been made asynchronous, we need to continue to + expose this method for use *internally* in places where we need to boot an + instance synchronously. @private - @method buildRegistry - @return {Ember.Registry} the configured registry */ - buildRegistry: function () { - var registry = this.__registry__ = this.constructor.buildRegistry(this); - - return registry; - }, + _bootSync: function (options) { + if (this._booted) { + return this; + } - /** - @private - @method initializer - */ - initializer: function (options) { - this.constructor.initializer(options); - }, + options = new BootOptions(options); - /** - @private - @method instanceInitializer - */ - instanceInitializer: function (options) { - this.constructor.instanceInitializer(options); - }, + this.setupRegistry(options); - /** - @private - @method runInitializers - */ - runInitializers: function () { - var _this = this; + if (options.rootElement) { + this.rootElement = options.rootElement; + } else { + this.rootElement = this.application.rootElement; + } - this._runInitializer('initializers', function (name, initializer) { - _emberMetal.assert('No application initializer named \'' + name + '\'', !!initializer); - if (initializer.initialize.length === 2) { - _emberMetal.deprecate('The `initialize` method for Application initializer \'' + name + '\' should take only one argument - `App`, an instance of an `Application`.', false, { - id: 'ember-application.app-initializer-initialize-arguments', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_initializer-arity' - }); + if (options.location) { + var router = _emberMetal.get(this, 'router'); + _emberMetal.set(router, 'location', options.location); + } - initializer.initialize(_this.__registry__, _this); - } else { - initializer.initialize(_this); - } - }); - }, + this.application.runInstanceInitializers(this); - /** - @private - @since 1.12.0 - @method runInstanceInitializers - */ - runInstanceInitializers: function (instance) { - this._runInitializer('instanceInitializers', function (name, initializer) { - _emberMetal.assert('No instance initializer named \'' + name + '\'', !!initializer); - initializer.initialize(instance); - }); - }, + if (options.isInteractive) { + this.setupEventDispatcher(); + } - _runInitializer: function (bucketName, cb) { - var initializersByName = _emberMetal.get(this.constructor, bucketName); - var initializers = props(initializersByName); - var graph = new _dagMap.default(); - var initializer = undefined; + this._booted = true; - for (var i = 0; i < initializers.length; i++) { - initializer = initializersByName[initializers[i]]; - graph.add(initializer.name, initializer, initializer.before, initializer.after); - } + return this; + }, - graph.topsort(cb); - } - }); + setupRegistry: function (options) { + this.constructor.setupRegistry(this.__registry__, options); + }, - Engine.reopenClass({ - initializers: new _emberUtils.EmptyObject(), - instanceInitializers: new _emberUtils.EmptyObject(), + router: _emberMetal.computed(function () { + return this.lookup('router:main'); + }).readOnly(), /** - The goal of initializers should be to register dependencies and injections. - This phase runs once. Because these initializers may load code, they are - allowed to defer application readiness and advance it. If you need to access - the container or store you should use an InstanceInitializer that will be run - after all initializers and therefore after all code is loaded and the app is - ready. - Initializer receives an object which has the following attributes: - `name`, `before`, `after`, `initialize`. The only required attribute is - `initialize`, all others are optional. - * `name` allows you to specify under which name the initializer is registered. - This must be a unique name, as trying to register two initializers with the - same name will result in an error. - ```javascript - Ember.Application.initializer({ - name: 'namedInitializer', - initialize: function(application) { - Ember.debug('Running namedInitializer!'); - } - }); - ``` - * `before` and `after` are used to ensure that this initializer is ran prior - or after the one identified by the value. This value can be a single string - or an array of strings, referencing the `name` of other initializers. - An example of ordering initializers, we create an initializer named `first`: - ```javascript - Ember.Application.initializer({ - name: 'first', - initialize: function(application) { - Ember.debug('First initializer!'); - } - }); - // DEBUG: First initializer! - ``` - We add another initializer named `second`, specifying that it should run - after the initializer named `first`: - ```javascript - Ember.Application.initializer({ - name: 'second', - after: 'first', - initialize: function(application) { - Ember.debug('Second initializer!'); - } - }); - // DEBUG: First initializer! - // DEBUG: Second initializer! - ``` - Afterwards we add a further initializer named `pre`, this time specifying - that it should run before the initializer named `first`: - ```javascript - Ember.Application.initializer({ - name: 'pre', - before: 'first', - initialize: function(application) { - Ember.debug('Pre initializer!'); - } - }); - // DEBUG: Pre initializer! - // DEBUG: First initializer! - // DEBUG: Second initializer! - ``` - Finally we add an initializer named `post`, specifying it should run after - both the `first` and the `second` initializers: - ```javascript - Ember.Application.initializer({ - name: 'post', - after: ['first', 'second'], - initialize: function(application) { - Ember.debug('Post initializer!'); - } - }); - // DEBUG: Pre initializer! - // DEBUG: First initializer! - // DEBUG: Second initializer! - // DEBUG: Post initializer! - ``` - * `initialize` is a callback function that receives one argument, - `application`, on which you can operate. - Example of using `application` to register an adapter: - ```javascript - Ember.Application.initializer({ - name: 'api-adapter', - initialize: function(application) { - application.register('api-adapter:main', ApiAdapter); - } - }); - ``` - @method initializer - @param initializer {Object} - @public + This hook is called by the root-most Route (a.k.a. the ApplicationRoute) + when it has finished creating the root View. By default, we simply take the + view and append it to the `rootElement` specified on the Application. + In cases like FastBoot and testing, we can override this hook and implement + custom behavior, such as serializing to a string and sending over an HTTP + socket rather than appending to DOM. + @param view {Ember.View} the root-most view + @private */ - - initializer: buildInitializerMethod('initializers', 'initializer'), + didCreateRootView: function (view) { + view.appendTo(this.rootElement); + }, /** - Instance initializers run after all initializers have run. Because - instance initializers run after the app is fully set up. We have access - to the store, container, and other items. However, these initializers run - after code has loaded and are not allowed to defer readiness. - Instance initializer receives an object which has the following attributes: - `name`, `before`, `after`, `initialize`. The only required attribute is - `initialize`, all others are optional. - * `name` allows you to specify under which name the instanceInitializer is - registered. This must be a unique name, as trying to register two - instanceInitializer with the same name will result in an error. - ```javascript - Ember.Application.instanceInitializer({ - name: 'namedinstanceInitializer', - initialize: function(application) { - Ember.debug('Running namedInitializer!'); - } - }); - ``` - * `before` and `after` are used to ensure that this initializer is ran prior - or after the one identified by the value. This value can be a single string - or an array of strings, referencing the `name` of other initializers. - * See Ember.Application.initializer for discussion on the usage of before - and after. - Example instanceInitializer to preload data into the store. - ```javascript - Ember.Application.initializer({ - name: 'preload-data', - initialize: function(application) { - var userConfig, userConfigEncoded, store; - // We have a HTML escaped JSON representation of the user's basic - // configuration generated server side and stored in the DOM of the main - // index.html file. This allows the app to have access to a set of data - // without making any additional remote calls. Good for basic data that is - // needed for immediate rendering of the page. Keep in mind, this data, - // like all local models and data can be manipulated by the user, so it - // should not be relied upon for security or authorization. - // - // Grab the encoded data from the meta tag - userConfigEncoded = Ember.$('head meta[name=app-user-config]').attr('content'); - // Unescape the text, then parse the resulting JSON into a real object - userConfig = JSON.parse(unescape(userConfigEncoded)); - // Lookup the store - store = application.lookup('service:store'); - // Push the encoded JSON into the store - store.pushPayload(userConfig); - } - }); - ``` - @method instanceInitializer - @param instanceInitializer - @public + Tells the router to start routing. The router will ask the location for the + current URL of the page to determine the initial URL to start routing to. + To start the app at a specific URL, call `handleURL` instead. + @private */ - instanceInitializer: buildInitializerMethod('instanceInitializers', 'instance initializer'), + startRouting: function () { + var router = _emberMetal.get(this, 'router'); + router.startRouting(); + this._didSetupRouter = true; + }, /** - This creates a registry with the default Ember naming conventions. - It also configures the registry: - * registered views are created every time they are looked up (they are - not singletons) - * registered templates are not factories; the registered value is - returned directly. - * the router receives the application as its `namespace` property - * all controllers receive the router as their `target` and `controllers` - properties - * 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 - @method buildRegistry - @static - @param {Ember.Application} namespace the application for which to - build the registry - @return {Ember.Registry} the built registry @private + Sets up the router, initializing the child router and configuring the + location before routing begins. + Because setup should only occur once, multiple calls to `setupRouter` + beyond the first call have no effect. */ - buildRegistry: function (namespace) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - - var registry = new _container.Registry({ - resolver: resolverFor(namespace) - }); - - registry.set = _emberMetal.set; - - registry.register('application:main', namespace, { instantiate: false }); - - commonSetupRegistry(registry); - _emberGlimmer.setupEngineRegistry(registry); + setupRouter: function () { + if (this._didSetupRouter) { + return; + } + this._didSetupRouter = true; - return registry; + var router = _emberMetal.get(this, 'router'); + router.setupRouter(); }, /** - Set this to provide an alternate class to `Ember.DefaultResolver` - @deprecated Use 'Resolver' instead - @property resolver - @public + Directs the router to route to a particular URL. This is useful in tests, + for example, to tell the app to start at a particular URL. + @param url {String} the URL the router should route to + @private */ - resolver: null, + handleURL: function (url) { + var router = _emberMetal.get(this, 'router'); + + this.setupRouter(); + return router.handleURL(url); + }, /** - Set this to provide an alternate class to `Ember.DefaultResolver` - @property resolver - @public + @private */ - Resolver: null - }); - - /** - This function defines the default lookup rules for container lookups: - - * templates are looked up on `Ember.TEMPLATES` - * other names are looked up on the application after classifying the name. - For example, `controller:post` looks up `App.PostController` by default. - * if the default lookup fails, look for registered classes on the container - - This allows the application to register default injections in the container - that could be overridden by the normal naming convention. - - @private - @method resolverFor - @param {Ember.Namespace} namespace the namespace to look for classes - @return {*} the resolved value for a given lookup - */ - function resolverFor(namespace) { - var ResolverClass = namespace.get('Resolver') || _emberApplicationSystemResolver.default; - - return ResolverClass.create({ - namespace: namespace - }); - } - - function buildInitializerMethod(bucketName, humanName) { - return function (initializer) { - // If this is the first initializer being added to a subclass, we are going to reopen the class - // to make sure we have a new `initializers` object, which extends from the parent class' using - // prototypal inheritance. Without this, attempting to add initializers to the subclass would - // pollute the parent class as well as other subclasses. - if (this.superclass[bucketName] !== undefined && this.superclass[bucketName] === this[bucketName]) { - var attrs = {}; - attrs[bucketName] = Object.create(this[bucketName]); - this.reopenClass(attrs); - } + setupEventDispatcher: function () { + var dispatcher = this.lookup('event_dispatcher:main'); + var applicationCustomEvents = _emberMetal.get(this.application, 'customEvents'); + var instanceCustomEvents = _emberMetal.get(this, 'customEvents'); - _emberMetal.assert('The ' + humanName + ' \'' + initializer.name + '\' has already been registered', !this[bucketName][initializer.name]); - _emberMetal.assert('An ' + humanName + ' cannot be registered without an initialize function', _emberUtils.canInvoke(initializer, 'initialize')); - _emberMetal.assert('An ' + humanName + ' cannot be registered without a name property', initializer.name !== undefined); + var customEvents = _emberUtils.assign({}, applicationCustomEvents, instanceCustomEvents); + dispatcher.setup(customEvents, this.rootElement); - this[bucketName][initializer.name] = initializer; - }; - } + return dispatcher; + }, - function commonSetupRegistry(registry) { - registry.optionsForType('component', { singleton: false }); - registry.optionsForType('view', { singleton: false }); + /** + Returns the current URL of the app instance. This is useful when your + app does not update the browsers URL bar (i.e. it uses the `'none'` + location adapter). + @public + @return {String} the current URL + */ + getURL: function () { + var router = _emberMetal.get(this, 'router'); + return _emberMetal.get(router, 'url'); + }, - registry.register('controller:basic', _emberRuntime.Controller, { instantiate: false }); + // `instance.visit(url)` should eventually replace `instance.handleURL()`; + // the test helpers can probably be switched to use this implementation too - registry.injection('view', '_viewRegistry', '-view-registry:main'); - registry.injection('renderer', '_viewRegistry', '-view-registry:main'); - registry.injection('event_dispatcher:main', '_viewRegistry', '-view-registry:main'); + /** + Navigate the instance to a particular URL. This is useful in tests, for + example, or to tell the app to start at a particular URL. This method + returns a promise that resolves with the app instance when the transition + is complete, or rejects if the transion was aborted due to an error. + @public + @param url {String} the destination URL + @return {Promise} + */ + visit: function (url) { + var _this = this; - registry.injection('route', '_topLevelViewTemplate', 'template:-outlet'); + this.setupRouter(); - registry.injection('view:-outlet', 'namespace', 'application:main'); + var bootOptions = this.__container__.lookup('-environment:main'); - registry.injection('controller', 'target', 'router:main'); - registry.injection('controller', 'namespace', 'application:main'); + var router = _emberMetal.get(this, 'router'); - registry.injection('router', '_bucketCache', _container.privatize(_templateObject)); - registry.injection('route', '_bucketCache', _container.privatize(_templateObject)); + var handleTransitionResolve = function () { + if (!bootOptions.options.shouldRender) { + // No rendering is needed, and routing has completed, simply return. + return _this; + } else { + return new _emberRuntime.RSVP.Promise(function (resolve) { + // Resolve once rendering is completed. `router.handleURL` returns the transition (as a thennable) + // which resolves once the transition is completed, but the transition completion only queues up + // a scheduled revalidation (into the `render` queue) in the Renderer. + // + // This uses `run.schedule('afterRender', ....)` to resolve after that rendering has completed. + _emberMetal.run.schedule('afterRender', null, resolve, _this); + }); + } + }; - registry.injection('route', 'router', 'router:main'); + var handleTransitionReject = function (error) { + if (error.error) { + throw error.error; + } else if (error.name === 'TransitionAborted' && router.router.activeTransition) { + return router.router.activeTransition.then(handleTransitionResolve, handleTransitionReject); + } else if (error.name === 'TransitionAborted') { + throw new Error(error.message); + } else { + throw error; + } + }; - // Register the routing service... - registry.register('service:-routing', _emberRouting.RoutingService); - // Then inject the app router into it - registry.injection('service:-routing', 'router', 'router:main'); + var location = _emberMetal.get(router, 'location'); - // DEBUGGING - registry.register('resolver-for-debugging:main', registry.resolver, { instantiate: false }); - registry.injection('container-debug-adapter:main', 'resolver', 'resolver-for-debugging:main'); - registry.injection('data-adapter:main', 'containerDebugAdapter', 'container-debug-adapter:main'); - // Custom resolver authors may want to register their own ContainerDebugAdapter with this key + // Keeps the location adapter's internal URL in-sync + location.setURL(url); - registry.register('container-debug-adapter:main', _emberExtensionSupport.ContainerDebugAdapter); + // getURL returns the set url with the rootURL stripped off + return router.handleURL(location.getURL()).then(handleTransitionResolve, handleTransitionReject); + } + }); - registry.register('component-lookup:main', _emberViews.ComponentLookup); - } + ApplicationInstance.reopenClass({ + /** + @private + @method setupRegistry + @param {Registry} registry + @param {BootOptions} options + */ + setupRegistry: function (registry) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - exports.default = Engine; -}); -enifed('ember-application/system/resolver', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-application/utils/validate-type', 'ember-glimmer'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberApplicationUtilsValidateType, _emberGlimmer) { - /** - @module ember - @submodule ember-application - */ + if (!options.toEnvironment) { + options = new BootOptions(options); + } - 'use strict'; + registry.register('-environment:main', options.toEnvironment(), { instantiate: false }); + registry.register('service:-document', options.document, { instantiate: false }); - var Resolver = _emberRuntime.Object.extend({ - /* - This will be set to the Application instance when it is - created. - @property namespace - */ - namespace: null, - normalize: null, // required - resolve: null, // required - parseName: null, // required - lookupDescription: null, // required - makeToString: null, // required - resolveOther: null, // required - _logLookup: null // required + this._super(registry, options); + } }); - exports.Resolver = Resolver; /** - The DefaultResolver defines the default lookup rules to resolve - container lookups before consulting the container for registered - items: - - * templates are looked up on `Ember.TEMPLATES` - * other names are looked up on the application after converting - the name. For example, `controller:post` looks up - `App.PostController` by default. - * there are some nuances (see examples below) - - ### How Resolving Works - - The container calls this object's `resolve` method with the - `fullName` argument. - - It first parses the fullName into an object using `parseName`. - - Then it checks for the presence of a type-specific instance - method of the form `resolve[Type]` and calls it if it exists. - For example if it was resolving 'template:post', it would call - the `resolveTemplate` method. - - Its last resort is to call the `resolveOther` method. + A list of boot-time configuration options for customizing the behavior of + an `Ember.ApplicationInstance`. - The methods of this object are designed to be easy to override - in a subclass. For example, you could enhance how a template - is resolved like so: + This is an interface class that exists purely to document the available + options; you do not need to construct it manually. Simply pass a regular + JavaScript object containing the desired options into methods that require + one of these options object: ```javascript - App = Ember.Application.create({ - Resolver: Ember.DefaultResolver.extend({ - resolveTemplate: function(parsedName) { - let resolvedTemplate = this._super(parsedName); - if (resolvedTemplate) { return resolvedTemplate; } - return Ember.TEMPLATES['not_found']; - } - }) - }); + MyApp.visit("/", { location: "none", rootElement: "#container" }); ``` - Some examples of how names are resolved: + Not all combinations of the supported options are valid. See the documentation + on `Ember.Application#visit` for the supported configurations. - ``` - 'template:post' //=> Ember.TEMPLATES['post'] - 'template:posts/byline' //=> Ember.TEMPLATES['posts/byline'] - 'template:posts.byline' //=> Ember.TEMPLATES['posts/byline'] - 'template:blogPost' //=> Ember.TEMPLATES['blogPost'] - // OR - // Ember.TEMPLATES['blog_post'] - 'controller:post' //=> App.PostController - 'controller:posts.index' //=> App.PostsIndexController - 'controller:blog/post' //=> Blog.PostController - 'controller:basic' //=> Ember.Controller - 'route:post' //=> App.PostRoute - 'route:posts.index' //=> App.PostsIndexRoute - 'route:blog/post' //=> Blog.PostRoute - 'route:basic' //=> Ember.Route - 'view:post' //=> App.PostView - 'view:posts.index' //=> App.PostsIndexView - 'view:blog/post' //=> Blog.PostView - 'view:basic' //=> Ember.View - 'foo:post' //=> App.PostFoo - 'model:post' //=> App.Post - ``` + Internal, experimental or otherwise unstable flags are marked as private. - @class DefaultResolver - @namespace Ember - @extends Ember.Object + @class BootOptions + @namespace Ember.ApplicationInstance @public */ - - exports.default = _emberRuntime.Object.extend({ - /** - This will be set to the Application instance when it is - created. - @property namespace - @public - */ - namespace: null, - - init: function () { - this._parseNameCache = _emberUtils.dictionary(null); - }, - normalize: function (fullName) { - var _fullName$split = fullName.split(':', 2); - - var type = _fullName$split[0]; - var name = _fullName$split[1]; - - _emberMetal.assert('Tried to normalize a container name without a colon (:) in it. ' + 'You probably tried to lookup a name that did not contain a type, ' + 'a colon, and a name. A proper lookup name would be `view:post`.', fullName.split(':').length === 2); - - if (type !== 'template') { - var result = name; - - if (result.indexOf('.') > -1) { - 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(); - }); - } - - if (name.indexOf('-') > -1) { - result = result.replace(/-(.)/g, function (m) { - return m.charAt(1).toUpperCase(); - }); - } - - return type + ':' + result; - } else { - return fullName; - } - }, - - /** - This method is called via the container's resolver method. - It parses the provided `fullName` and then looks up and - returns the appropriate template or class. - @method resolve - @param {String} fullName the lookup string - @return {Object} the resolved factory - @public - */ - resolve: function (fullName) { - var parsedName = this.parseName(fullName); - var resolveMethodName = parsedName.resolveMethodName; - var resolved; - - if (this[resolveMethodName]) { - resolved = this[resolveMethodName](parsedName); - } - - resolved = resolved || this.resolveOther(parsedName); - - if (parsedName.root && parsedName.root.LOG_RESOLVER) { - this._logLookup(resolved, parsedName); - } - - if (resolved) { - _emberApplicationUtilsValidateType.default(resolved, parsedName); - } - - return resolved; - }, + BootOptions = function BootOptions() { + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; /** - Convert the string name of the form 'type:name' to - a Javascript object with the parsed aspects of the name - broken out. - @param {String} fullName the lookup string - @method parseName - @protected + Provide a specific instance of jQuery. This is useful in conjunction with + the `document` option, as it allows you to use a copy of `jQuery` that is + appropriately bound to the foreign `document` (e.g. a jsdom). + This is highly experimental and support very incomplete at the moment. + @property jQuery + @type Object + @default auto-detected + @private */ - - parseName: function (fullName) { - return this._parseNameCache[fullName] || (this._parseNameCache[fullName] = this._parseName(fullName)); - }, - - _parseName: function (fullName) { - var _fullName$split2 = fullName.split(':'); - - var type = _fullName$split2[0]; - var fullNameWithoutType = _fullName$split2[1]; - - var name = fullNameWithoutType; - var namespace = _emberMetal.get(this, 'namespace'); - var root = namespace; - var lastSlashIndex = name.lastIndexOf('/'); - var dirname = lastSlashIndex !== -1 ? name.slice(0, lastSlashIndex) : null; - - if (type !== 'template' && lastSlashIndex !== -1) { - var parts = name.split('/'); - name = parts[parts.length - 1]; - var namespaceName = _emberRuntime.String.capitalize(parts.slice(0, -1).join('.')); - root = _emberRuntime.Namespace.byName(namespaceName); - - _emberMetal.assert('You are looking for a ' + name + ' ' + type + ' in the ' + namespaceName + ' namespace, but the namespace could not be found', root); - } - - var resolveMethodName = fullNameWithoutType === 'main' ? 'Main' : _emberRuntime.String.classify(type); - - if (!(name && type)) { - throw new TypeError('Invalid fullName: `' + fullName + '`, must be of the form `type:name` '); - } - - return { - fullName: fullName, - type: type, - fullNameWithoutType: fullNameWithoutType, - dirname: dirname, - name: name, - root: root, - resolveMethodName: 'resolve' + resolveMethodName - }; - }, + this.jQuery = _emberViews.jQuery; // This default is overridable below /** - 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. - @param {String} fullName the lookup string - @method lookupDescription - @protected + Interactive mode: whether we need to set up event delegation and invoke + lifecycle callbacks on Components. + @property isInteractive + @type boolean + @default auto-detected + @private */ - lookupDescription: function (fullName) { - var parsedName = this.parseName(fullName); - var description = undefined; - - if (parsedName.type === 'template') { - return 'template at ' + parsedName.fullNameWithoutType.replace(/\./g, '/'); - } - - description = parsedName.root + '.' + _emberRuntime.String.classify(parsedName.name).replace(/\./g, ''); - - if (parsedName.type !== 'model') { - description += _emberRuntime.String.classify(parsedName.type); - } - - return description; - }, - - makeToString: function (factory, fullName) { - return factory.toString(); - }, + this.isInteractive = _emberEnvironment.environment.hasDOM; // This default is overridable below /** - Given a parseName object (output from `parseName`), apply - the conventions expected by `Ember.Router` - @param {Object} parsedName a parseName object with the parsed - fullName lookup string - @method useRouterNaming - @protected - */ - useRouterNaming: function (parsedName) { - parsedName.name = parsedName.name.replace(/\./g, '_'); - if (parsedName.name === 'basic') { - parsedName.name = ''; - } - }, - /** - Look up the template in Ember.TEMPLATES - @param {Object} parsedName a parseName object with the parsed - fullName lookup string - @method resolveTemplate - @protected + Run in a full browser environment. + When this flag is set to `false`, it will disable most browser-specific + and interactive features. Specifically: + * It does not use `jQuery` to append the root view; the `rootElement` + (either specified as a subsequent option or on the application itself) + must already be an `Element` in the given `document` (as opposed to a + string selector). + * It does not set up an `EventDispatcher`. + * It does not run any `Component` lifecycle hooks (such as `didInsertElement`). + * It sets the `location` option to `"none"`. (If you would like to use + the location adapter specified in the app's router instead, you can also + specify `{ location: null }` to specifically opt-out.) + @property isBrowser + @type boolean + @default auto-detected + @public */ - resolveTemplate: function (parsedName) { - var templateName = parsedName.fullNameWithoutType.replace(/\./g, '/'); + if (options.isBrowser !== undefined) { + this.isBrowser = !!options.isBrowser; + } else { + this.isBrowser = _emberEnvironment.environment.hasDOM; + } - return _emberGlimmer.getTemplate(templateName) || _emberGlimmer.getTemplate(_emberRuntime.String.decamelize(templateName)); - }, + if (!this.isBrowser) { + this.jQuery = null; + this.isInteractive = false; + this.location = 'none'; + } /** - Lookup the view using `resolveOther` - @param {Object} parsedName a parseName object with the parsed - fullName lookup string - @method resolveView - @protected + Disable rendering completely. + When this flag is set to `true`, it will disable the entire rendering + pipeline. Essentially, this puts the app into "routing-only" mode. No + templates will be rendered, and no Components will be created. + @property shouldRender + @type boolean + @default true + @public */ - resolveView: function (parsedName) { - this.useRouterNaming(parsedName); - return this.resolveOther(parsedName); - }, + if (options.shouldRender !== undefined) { + this.shouldRender = !!options.shouldRender; + } else { + this.shouldRender = true; + } - /** - Lookup the controller using `resolveOther` - @param {Object} parsedName a parseName object with the parsed - fullName lookup string - @method resolveController - @protected - */ - resolveController: function (parsedName) { - this.useRouterNaming(parsedName); - return this.resolveOther(parsedName); - }, - /** - Lookup the route using `resolveOther` - @param {Object} parsedName a parseName object with the parsed - fullName lookup string - @method resolveRoute - @protected - */ - resolveRoute: function (parsedName) { - this.useRouterNaming(parsedName); - return this.resolveOther(parsedName); - }, + if (!this.shouldRender) { + this.jQuery = null; + this.isInteractive = false; + } /** - Lookup the model on the Application namespace - @param {Object} parsedName a parseName object with the parsed - fullName lookup string - @method resolveModel - @protected + If present, render into the given `Document` object instead of the + global `window.document` object. + In practice, this is only useful in non-browser environment or in + non-interactive mode, because Ember's `jQuery` dependency is + implicitly bound to the current document, causing event delegation + to not work properly when the app is rendered into a foreign + document object (such as an iframe's `contentDocument`). + In non-browser mode, this could be a "`Document`-like" object as + Ember only interact with a small subset of the DOM API in non- + interactive mode. While the exact requirements have not yet been + formalized, the `SimpleDOM` library's implementation is known to + work. + @property document + @type Document + @default the global `document` object + @public */ - resolveModel: function (parsedName) { - var className = _emberRuntime.String.classify(parsedName.name); - var factory = _emberMetal.get(parsedName.root, className); + if (options.document) { + this.document = options.document; + } else { + this.document = typeof document !== 'undefined' ? document : null; + } - return factory; - }, - /** - Look up the specified object (from parsedName) on the appropriate - namespace (usually on the Application) - @param {Object} parsedName a parseName object with the parsed - fullName lookup string - @method resolveHelper - @protected - */ - resolveHelper: function (parsedName) { - return this.resolveOther(parsedName); - }, /** - Look up the specified object (from parsedName) on the appropriate - namespace (usually on the Application) - @param {Object} parsedName a parseName object with the parsed - fullName lookup string - @method resolveOther - @protected - */ - resolveOther: function (parsedName) { - var className = _emberRuntime.String.classify(parsedName.name) + _emberRuntime.String.classify(parsedName.type); - var factory = _emberMetal.get(parsedName.root, className); - return factory; - }, + If present, overrides the application's `rootElement` property on + the instance. This is useful for testing environment, where you + might want to append the root view to a fixture area. + In non-browser mode, because Ember does not have access to jQuery, + this options must be specified as a DOM `Element` object instead of + a selector string. + See the documentation on `Ember.Applications`'s `rootElement` for + details. + @property rootElement + @type String|Element + @default null + @public + */ + if (options.rootElement) { + this.rootElement = options.rootElement; + } - resolveMain: function (parsedName) { - var className = _emberRuntime.String.classify(parsedName.type); - return _emberMetal.get(parsedName.root, className); - }, + // Set these options last to give the user a chance to override the + // defaults from the "combo" options like `isBrowser` (although in + // practice, the resulting combination is probably invalid) /** - @method _logLookup - @param {Boolean} found - @param {Object} parsedName - @private + If present, overrides the router's `location` property with this + value. This is useful for environments where trying to modify the + URL would be inappropriate. + @property location + @type string + @default null + @public */ - _logLookup: function (found, parsedName) { - var symbol = undefined, - padding = undefined; - - if (found) { - symbol = '[✓]'; - } else { - symbol = '[ ]'; - } - - if (parsedName.fullName.length > 60) { - padding = '.'; - } else { - padding = new Array(60 - parsedName.fullName.length).join('.'); - } - - _emberMetal.info(symbol, parsedName.fullName, padding, this.lookupDescription(parsedName.fullName)); - }, + if (options.location !== undefined) { + this.location = options.location; + } - /** - Used to iterate all items of a given type. - @method knownForType - @param {String} type the type to search for - @private - */ - knownForType: function (type) { - var namespace = _emberMetal.get(this, 'namespace'); - var suffix = _emberRuntime.String.classify(type); - var typeRegexp = new RegExp(suffix + '$'); + if (options.jQuery !== undefined) { + this.jQuery = options.jQuery; + } - var known = _emberUtils.dictionary(null); - var knownKeys = Object.keys(namespace); - for (var index = 0; index < knownKeys.length; index++) { - var _name = knownKeys[index]; + if (options.isInteractive !== undefined) { + this.isInteractive = !!options.isInteractive; + } + }; - if (typeRegexp.test(_name)) { - var containerName = this.translateToContainerFullname(type, _name); + BootOptions.prototype.toEnvironment = function () { + var env = _emberUtils.assign({}, _emberEnvironment.environment); + // For compatibility with existing code + env.hasDOM = this.isBrowser; + env.isInteractive = this.isInteractive; + env.options = this; + return env; + }; - known[containerName] = true; + Object.defineProperty(ApplicationInstance.prototype, 'container', { + configurable: true, + enumerable: false, + get: function () { + var instance = this; + return { + lookup: function () { + _emberMetal.deprecate('Using `ApplicationInstance.container.lookup` is deprecated. Please use `ApplicationInstance.lookup` instead.', false, { + id: 'ember-application.app-instance-container', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-applicationinstance-container' + }); + return instance.lookup.apply(instance, arguments); } - } - - return known; - }, - - /** - Converts provided name from the backing namespace into a container lookup name. - Examples: - App.FooBarHelper -> helper:foo-bar - App.THelper -> helper:t - @method translateToContainerFullname - @param {String} type - @param {String} name - @private - */ - - translateToContainerFullname: function (type, name) { - var suffix = _emberRuntime.String.classify(type); - var namePrefix = name.slice(0, suffix.length * -1); - var dasherizedName = _emberRuntime.String.dasherize(namePrefix); + }; + } + }); - return type + ':' + dasherizedName; + Object.defineProperty(ApplicationInstance.prototype, 'registry', { + configurable: true, + enumerable: false, + get: function () { + return _emberRuntime.buildFakeRegistryWithDeprecations(this, 'ApplicationInstance'); } }); + + exports.default = ApplicationInstance; }); -enifed('ember-application/utils/validate-type', ['exports', 'ember-metal'], function (exports, _emberMetal) { +enifed('ember-application/system/application', ['exports', 'ember-utils', 'ember-environment', 'ember-metal', 'ember-runtime', 'ember-views', 'ember-routing', 'ember-application/system/application-instance', 'container', 'ember-application/system/engine', 'ember-glimmer'], function (exports, _emberUtils, _emberEnvironment, _emberMetal, _emberRuntime, _emberViews, _emberRouting, _emberApplicationSystemApplicationInstance, _container, _emberApplicationSystemEngine, _emberGlimmer) { /** @module ember @submodule ember-application */ - 'use strict'; - exports.default = validateType; - - var VALIDATED_TYPES = { - route: ['assert', 'isRouteFactory', 'Ember.Route'], - component: ['deprecate', 'isComponentFactory', 'Ember.Component'], - view: ['deprecate', 'isViewFactory', 'Ember.View'], - service: ['deprecate', 'isServiceFactory', 'Ember.Service'] - }; - - function validateType(resolvedType, parsedName) { - var validationAttributes = VALIDATED_TYPES[parsedName.type]; - - if (!validationAttributes) { - return; - } - - var action = validationAttributes[0]; - var factoryFlag = validationAttributes[1]; - var expectedType = validationAttributes[2]; - - if (action === 'deprecate') { - _emberMetal.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 { - _emberMetal.assert('Expected ' + parsedName.fullName + ' to resolve to an ' + expectedType + ' but ' + ('instead it was ' + resolvedType + '.'), !!resolvedType[factoryFlag]); - } - } -}); -enifed('ember-console/index', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { - 'use strict'; + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); - function K() {} - - function consoleMethod(name) { - var consoleObj = undefined; - if (_emberEnvironment.context.imports.console) { - consoleObj = _emberEnvironment.context.imports.console; - } else if (typeof console !== 'undefined') { - consoleObj = console; - } - - var method = typeof consoleObj === 'object' ? consoleObj[name] : null; - - if (typeof method !== 'function') { - return; - } - - if (typeof method.bind === 'function') { - return method.bind(consoleObj); - } - - return function () { - method.apply(consoleObj, arguments); - }; - } - - function assertPolyfill(test, message) { - if (!test) { - try { - // attempt to preserve the stack - throw new Error('assertion failed: ' + message); - } catch (error) { - setTimeout(function () { - throw error; - }, 0); - } - } - } + var librariesRegistered = false; /** - Inside Ember-Metal, simply uses the methods from `imports.console`. - Override this to provide more robust logging functionality. + An instance of `Ember.Application` is the starting point for every Ember + application. It helps to instantiate, initialize and coordinate the many + objects that make up your app. - @class Logger + Each Ember app has one and only one `Ember.Application` object. In fact, the + very first thing you should do in your application is create the instance: + + ```javascript + window.App = Ember.Application.create(); + ``` + + Typically, the application object is the only global variable. All other + classes in your app should be properties on the `Ember.Application` instance, + which highlights its first role: a global namespace. + + For example, if you define a view class, it might look like this: + + ```javascript + App.MyView = Ember.View.extend(); + ``` + + By default, calling `Ember.Application.create()` will automatically initialize + your application by calling the `Ember.Application.initialize()` method. If + you need to delay initialization, you can call your app's `deferReadiness()` + method. When you are ready for your app to be initialized, call its + `advanceReadiness()` method. + + You can define a `ready` method on the `Ember.Application` instance, which + will be run by Ember when the application is initialized. + + Because `Ember.Application` inherits from `Ember.Namespace`, any classes + you create will have useful string representations when calling `toString()`. + See the `Ember.Namespace` documentation for more information. + + While you can think of your `Ember.Application` as a container that holds the + other classes in your application, there are several other responsibilities + going on under-the-hood that you may want to understand. + + ### Event Delegation + + Ember uses a technique called _event delegation_. This allows the framework + to set up a global, shared event listener instead of requiring each view to + do it manually. For example, instead of each view registering its own + `mousedown` listener on its associated element, Ember sets up a `mousedown` + listener on the `body`. + + If a `mousedown` event occurs, Ember will look at the target of the event and + start walking up the DOM node tree, finding corresponding views and invoking + their `mouseDown` method as it goes. + + `Ember.Application` has a number of default events that it listens for, as + well as a mapping from lowercase events to camel-cased view method names. For + example, the `keypress` event causes the `keyPress` method on the view to be + called, the `dblclick` event causes `doubleClick` to be called, and so on. + + If there is a bubbling browser event that Ember does not listen for by + default, you can specify custom events and their corresponding view method + names by setting the application's `customEvents` property: + + ```javascript + let App = Ember.Application.create({ + customEvents: { + // add support for the paste event + paste: 'paste' + } + }); + ``` + + To prevent Ember from setting up a listener for a default event, + specify the event name with a `null` value in the `customEvents` + property: + + ```javascript + let App = Ember.Application.create({ + customEvents: { + // prevent listeners for mouseenter/mouseleave events + mouseenter: null, + mouseleave: null + } + }); + ``` + + By default, the application sets up these event listeners on the document + body. However, in cases where you are embedding an Ember application inside + an existing page, you may want it to set up the listeners on an element + inside the body. + + For example, if only events inside a DOM element with the ID of `ember-app` + should be delegated, set your application's `rootElement` property: + + ```javascript + let App = Ember.Application.create({ + rootElement: '#ember-app' + }); + ``` + + 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 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: + + ```javascript + Ember.Application.initializer({ + name: 'api-adapter', + + initialize: function(application) { + application.register('api-adapter:main', ApiAdapter); + } + }); + ``` + + Initializers provide an opportunity to access the internal registry, which + organizes the different components of an Ember application. Additionally + they provide a chance to access the instantiated application. Beyond + being used for libraries, initializers are also a great way to organize + dependency injection or setup in your own application. + + ### Routing + + In addition to creating your application's router, `Ember.Application` is + also responsible for telling the router when to start routing. Transitions + between routes can be logged with the `LOG_TRANSITIONS` flag, and more + detailed intra-transition logging can be logged with + the `LOG_TRANSITIONS_INTERNAL` flag: + + ```javascript + let App = Ember.Application.create({ + LOG_TRANSITIONS: true, // basic logging of successful transitions + LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps + }); + ``` + + By default, the router will begin trying to translate the current URL into + application state once the browser emits the `DOMContentReady` event. If you + need to defer routing, you can call the application's `deferReadiness()` + method. Once routing can begin, call the `advanceReadiness()` method. + + If there is any setup required before routing begins, you can implement a + `ready()` method on your app that will be invoked immediately before routing + begins. + + @class Application @namespace Ember + @extends Ember.Engine + @uses RegistryProxyMixin @public */ - exports.default = { + + var Application = _emberApplicationSystemEngine.default.extend({ /** - Logs the arguments to the console. - You can pass as many arguments as you want and they will be joined together with a space. - ```javascript - var foo = 1; - Ember.Logger.log('log value of foo:', foo); - // "log value of foo: 1" will be printed to the console - ``` - @method log - @for Ember.Logger - @param {*} arguments - @public + The root DOM element of the Application. This can be specified as an + element or a + [jQuery-compatible selector string](http://api.jquery.com/category/selectors/). + This is the element that will be passed to the Application's, + `eventDispatcher`, which sets up the listeners for event delegation. Every + view in your application should be a child of the element you specify here. + @property rootElement + @type DOMElement + @default 'body' + @public */ - log: consoleMethod('log') || K, + rootElement: 'body', /** - Prints the arguments to the console with a warning icon. - You can pass as many arguments as you want and they will be joined together with a space. - ```javascript - Ember.Logger.warn('Something happened!'); - // "Something happened!" will be printed to the console with a warning icon. - ``` - @method warn - @for Ember.Logger - @param {*} arguments - @public + The `Ember.EventDispatcher` responsible for delegating events to this + application's views. + The event dispatcher is created by the application at initialization time + and sets up event listeners on the DOM element described by the + application's `rootElement` property. + See the documentation for `Ember.EventDispatcher` for more information. + @property eventDispatcher + @type Ember.EventDispatcher + @default null + @public */ - warn: consoleMethod('warn') || K, + eventDispatcher: null, /** - Prints the arguments to the console with an error icon, red text and a stack trace. - You can pass as many arguments as you want and they will be joined together with a space. + The DOM events for which the event dispatcher should listen. + By default, the application's `Ember.EventDispatcher` listens + for a set of standard DOM events, such as `mousedown` and + `keyup`, and delegates them to your application's `Ember.View` + instances. + If you would like additional bubbling events to be delegated to your + views, set your `Ember.Application`'s `customEvents` property + to a hash containing the DOM event name as the key and the + corresponding view method name as the value. Setting an event to + a value of `null` will prevent a default event listener from being + added for that event. + To add new events to be listened to: ```javascript - Ember.Logger.error('Danger! Danger!'); - // "Danger! Danger!" will be printed to the console in red text. + let App = Ember.Application.create({ + customEvents: { + // add support for the paste event + paste: 'paste' + } + }); ``` - @method error - @for Ember.Logger - @param {*} arguments - @public - */ - error: consoleMethod('error') || K, - - /** - Logs the arguments to the console. - You can pass as many arguments as you want and they will be joined together with a space. + To prevent default events from being listened to: ```javascript - var foo = 1; - Ember.Logger.info('log value of foo:', foo); - // "log value of foo: 1" will be printed to the console + let App = Ember.Application.create({ + customEvents: { + // remove support for mouseenter / mouseleave events + mouseenter: null, + mouseleave: null + } + }); ``` - @method info - @for Ember.Logger - @param {*} arguments - @public + @property customEvents + @type Object + @default null + @public */ - info: consoleMethod('info') || K, + customEvents: null, /** - Logs the arguments to the console in blue text. - You can pass as many arguments as you want and they will be joined together with a space. - ```javascript - var foo = 1; - Ember.Logger.debug('log value of foo:', foo); - // "log value of foo: 1" will be printed to the console - ``` - @method debug - @for Ember.Logger - @param {*} arguments - @public + Whether the application should automatically start routing and render + templates to the `rootElement` on DOM ready. While default by true, + other environments such as FastBoot or a testing harness can set this + property to `false` and control the precise timing and behavior of the boot + process. + @property autoboot + @type Boolean + @default true + @private */ - debug: consoleMethod('debug') || consoleMethod('info') || K, + autoboot: true, /** - If the value passed into `Ember.Logger.assert` is not truthy it will throw an error with a stack trace. + Whether the application should be configured for the legacy "globals mode". + Under this mode, the Application object serves as a global namespace for all + classes. ```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. + let App = Ember.Application.create({ + ... + }); + App.Router.reopen({ + location: 'none' + }); + App.Router.map({ + ... + }); + App.MyComponent = Ember.Component.extend({ + ... + }); ``` - @method assert - @for Ember.Logger - @param {Boolean} bool Value to test - @param {String} message Assertion message on failed - @public + This flag also exposes other internal APIs that assumes the existence of + a special "default instance", like `App.__container__.lookup(...)`. + This option is currently not configurable, its value is derived from + the `autoboot` flag – disabling `autoboot` also implies opting-out of + globals mode support, although they are ultimately orthogonal concerns. + Some of the global modes features are already deprecated in 1.x. The + existence of this flag is to untangle the globals mode code paths from + the autoboot code paths, so that these legacy features can be reviewed + for deprecation/removal separately. + Forcing the (autoboot=true, _globalsMode=false) here and running the tests + would reveal all the places where we are still relying on these legacy + behavior internally (mostly just tests). + @property _globalsMode + @type Boolean + @default true + @private */ - assert: consoleMethod('assert') || assertPolyfill - }; -}); -enifed('ember-debug/deprecate', ['exports', 'ember-metal', 'ember-console', 'ember-environment', 'ember-debug/handlers'], function (exports, _emberMetal, _emberConsole, _emberEnvironment, _emberDebugHandlers) { - /*global __fail__*/ - - 'use strict'; - - exports.registerHandler = registerHandler; - exports.default = deprecate; - - function registerHandler(handler) { - _emberDebugHandlers.registerHandler('deprecate', handler); - } - - function formatMessage(_message, options) { - var message = _message; - - if (options && options.id) { - message = message + (' [deprecation id: ' + options.id + ']'); - } + _globalsMode: true, - if (options && options.url) { - message += ' See ' + options.url + ' for more details.'; - } + init: function (options) { + this._super.apply(this, arguments); - return message; - } + if (!this.$) { + this.$ = _emberViews.jQuery; + } - registerHandler(function logDeprecationToConsole(message, options) { - var updatedMessage = formatMessage(message, options); + registerLibraries(); + _emberMetal.runInDebug(function () { + return logLibraryVersions(); + }); - _emberConsole.default.warn('DEPRECATION: ' + updatedMessage); - }); + // Start off the number of deferrals at 1. This will be decremented by + // the Application's own `boot` method. + this._readinessDeferrals = 1; + this._booted = false; - var captureErrorForStack = undefined; + this.autoboot = this._globalsMode = !!this.autoboot; - if (new Error().stack) { - captureErrorForStack = function () { - return new Error(); - }; - } else { - captureErrorForStack = function () { - try { - __fail__.fail(); - } catch (e) { - return e; + if (this._globalsMode) { + this._prepareForGlobalsMode(); } - }; - } - - registerHandler(function logDeprecationStackTrace(message, options, next) { - if (_emberEnvironment.ENV.LOG_STACKTRACE_ON_DEPRECATION) { - var stackStr = ''; - var error = captureErrorForStack(); - var stack = undefined; - - if (error.stack) { - if (error['arguments']) { - // Chrome - stack = error.stack.replace(/^\s+at\s+/gm, '').replace(/^([^\(]+?)([\n$])/gm, '{anonymous}($1)$2').replace(/^Object.\s*\(([^\)]+)\)/gm, '{anonymous}($1)').split('\n'); - stack.shift(); - } else { - // Firefox - stack = error.stack.replace(/(?:\n@:0)?\s+$/m, '').replace(/^\(/gm, '{anonymous}(').split('\n'); - } - stackStr = '\n ' + stack.slice(2).join('\n '); + if (this.autoboot) { + this.waitForDOMReady(); } + }, - var updatedMessage = formatMessage(message, options); + /** + Create an ApplicationInstance for this application. + @private + @method buildInstance + @return {Ember.ApplicationInstance} the application instance + */ + buildInstance: function () { + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - _emberConsole.default.warn('DEPRECATION: ' + updatedMessage + stackStr); - } else { - next.apply(undefined, arguments); - } - }); + options.base = this; + options.application = this; + return _emberApplicationSystemApplicationInstance.default.create(options); + }, - registerHandler(function raiseOnDeprecation(message, options, next) { - if (_emberEnvironment.ENV.RAISE_ON_DEPRECATION) { - var updatedMessage = formatMessage(message); + /** + Enable the legacy globals mode by allowing this application to act + as a global namespace. See the docs on the `_globalsMode` property + for details. + Most of these features are already deprecated in 1.x, so we can + stop using them internally and try to remove them. + @private + @method _prepareForGlobalsMode + */ + _prepareForGlobalsMode: function () { + // 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`. + this.Router = (this.Router || _emberRouting.Router).extend(); - throw new _emberMetal.Error(updatedMessage); - } else { - next.apply(undefined, arguments); - } - }); + this._buildDeprecatedInstance(); + }, - var missingOptionsDeprecation = 'When calling `Ember.deprecate` you ' + 'must provide an `options` hash as the third parameter. ' + '`options` should include `id` and `until` properties.'; - exports.missingOptionsDeprecation = missingOptionsDeprecation; - var missingOptionsIdDeprecation = 'When calling `Ember.deprecate` you must provide `id` in options.'; - exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation; - var missingOptionsUntilDeprecation = 'When calling `Ember.deprecate` you must provide `until` in options.'; + /* + Build the deprecated instance for legacy globals mode support. + Called when creating and resetting the application. + This is orthogonal to autoboot: the deprecated instance needs to + be created at Application construction (not boot) time to expose + App.__container__. If autoboot sees that this instance exists, + it will continue booting it to avoid doing unncessary work (as + opposed to building a new instance at boot time), but they are + otherwise unrelated. + @private + @method _buildDeprecatedInstance + */ + _buildDeprecatedInstance: function () { + // Build a default instance + var instance = this.buildInstance(); - exports.missingOptionsUntilDeprecation = missingOptionsUntilDeprecation; - /** - @module ember - @submodule ember-debug - */ + // Legacy support for App.__container__ and other global methods + // on App that rely on a single, default instance. + this.__deprecatedInstance__ = instance; + this.__container__ = instance.__container__; + }, - /** - Display a deprecation warning with the provided message and a stack trace - (Chrome and Firefox only). - - * In a production build, this method is defined as an empty function (NOP). - Uses of this method in Ember itself are stripped from the ember.prod.js build. - - @method deprecate - @param {String} message A description of the deprecation. - @param {Boolean} test A boolean. If falsy, the deprecation will be displayed. - @param {Object} options - @param {String} options.id A unique id for this deprecation. The id can be - used by Ember debugging tools to change the behavior (raise, log or silence) - for that specific deprecation. The id should be namespaced by dots, e.g. - "view.helper.select". - @param {string} options.until The version of Ember when this deprecation - warning will be removed. - @param {String} [options.url] An optional url to the transition guide on the - emberjs.com website. - @for Ember - @public - @since 1.0.0 - */ + /** + Automatically kick-off the boot process for the application once the + DOM has become ready. + The initialization itself is scheduled on the actions queue which + ensures that code-loading finishes before booting. + If you are asynchronously loading code, you should call `deferReadiness()` + to defer booting, and then call `advanceReadiness()` once all of your code + has finished loading. + @private + @method waitForDOMReady + */ + waitForDOMReady: function () { + if (!this.$ || this.$.isReady) { + _emberMetal.run.schedule('actions', this, 'domReady'); + } else { + this.$().ready(_emberMetal.run.bind(this, 'domReady')); + } + }, - function deprecate(message, test, options) { - if (!options || !options.id && !options.until) { - deprecate(missingOptionsDeprecation, false, { - id: 'ember-debug.deprecate-options-missing', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' - }); - } + /** + This is the autoboot flow: + 1. Boot the app by calling `this.boot()` + 2. Create an instance (or use the `__deprecatedInstance__` in globals mode) + 3. Boot the instance by calling `instance.boot()` + 4. Invoke the `App.ready()` callback + 5. Kick-off routing on the instance + Ideally, this is all we would need to do: + ```javascript + _autoBoot() { + this.boot().then(() => { + let instance = (this._globalsMode) ? this.__deprecatedInstance__ : this.buildInstance(); + return instance.boot(); + }).then((instance) => { + App.ready(); + instance.startRouting(); + }); + } + ``` + Unfortunately, we cannot actually write this because we need to participate + in the "synchronous" boot process. While the code above would work fine on + the initial boot (i.e. DOM ready), when `App.reset()` is called, we need to + boot a new instance synchronously (see the documentation on `_bootSync()` + for details). + Because of this restriction, the actual logic of this method is located + inside `didBecomeReady()`. + @private + @method domReady + */ + domReady: function () { + if (this.isDestroyed) { + return; + } - if (options && !options.id) { - deprecate(missingOptionsIdDeprecation, false, { - id: 'ember-debug.deprecate-id-missing', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' - }); - } + this._bootSync(); - if (options && !options.until) { - deprecate(missingOptionsUntilDeprecation, options && options.until, { - id: 'ember-debug.deprecate-until-missing', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' - }); - } + // Continues to `didBecomeReady` + }, - _emberDebugHandlers.invoke.apply(undefined, ['deprecate'].concat(babelHelpers.slice.call(arguments))); - } -}); -enifed("ember-debug/handlers", ["exports"], function (exports) { - "use strict"; + /** + Use this to defer readiness until some condition is true. + Example: + ```javascript + let App = Ember.Application.create(); + App.deferReadiness(); + // Ember.$ is a reference to the jQuery object/function + Ember.$.getJSON('/auth-token', function(token) { + App.token = token; + App.advanceReadiness(); + }); + ``` + This allows you to perform asynchronous setup logic and defer + booting your application until the setup has finished. + However, if the setup requires a loading UI, it might be better + to use the router for this purpose. + @method deferReadiness + @public + */ + deferReadiness: function () { + _emberMetal.assert('You must call deferReadiness on an instance of Ember.Application', this instanceof Application); + _emberMetal.assert('You cannot defer readiness since the `ready()` hook has already been called.', this._readinessDeferrals > 0); + this._readinessDeferrals++; + }, - exports.registerHandler = registerHandler; - exports.invoke = invoke; - var HANDLERS = {}; + /** + Call `advanceReadiness` after any asynchronous setup logic has completed. + Each call to `deferReadiness` must be matched by a call to `advanceReadiness` + or the application will never become ready and routing will not begin. + @method advanceReadiness + @see {Ember.Application#deferReadiness} + @public + */ + advanceReadiness: function () { + _emberMetal.assert('You must call advanceReadiness on an instance of Ember.Application', this instanceof Application); + this._readinessDeferrals--; - exports.HANDLERS = HANDLERS; + if (this._readinessDeferrals === 0) { + _emberMetal.run.once(this, this.didBecomeReady); + } + }, - function registerHandler(type, callback) { - var nextHandler = HANDLERS[type] || function () {}; + /** + Initialize the application and return a promise that resolves with the `Ember.Application` + object when the boot process is complete. + Run any application 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. + By default, this method is called automatically on "DOM ready"; however, if autoboot + is disabled, this is automatically called when the first application instance is + created via `visit`. + @private + @method boot + @return {Promise} + */ + boot: function () { + if (this._bootPromise) { + return this._bootPromise; + } - HANDLERS[type] = function (message, options) { - callback(message, options, nextHandler); - }; - } + try { + this._bootSync(); + } catch (_) { + // Ignore th error: in the asynchronous boot path, the error is already reflected + // in the promise rejection + } - function invoke(type, message, test, options) { - if (test) { - return; - } + return this._bootPromise; + }, - var handlerForType = HANDLERS[type]; + /** + Unfortunately, a lot of existing code assumes the booting process is + "synchronous". Specifically, a lot of tests assumes the last call to + `app.advanceReadiness()` or `app.reset()` will result in the app being + fully-booted when the current runloop completes. + We would like new code (like the `visit` API) to stop making this assumption, + so we created the asynchronous version above that returns a promise. But until + we have migrated all the code, we would have to expose this method for use + *internally* in places where we need to boot an app "synchronously". + @private + */ + _bootSync: function () { + if (this._booted) { + return; + } - if (!handlerForType) { - return; - } + // Even though this returns synchronously, we still need to make sure the + // boot promise exists for book-keeping purposes: if anything went wrong in + // the boot process, we need to store the error as a rejection on the boot + // promise so that a future caller of `boot()` can tell what failed. + var defer = this._bootResolver = new _emberRuntime.RSVP.defer(); + this._bootPromise = defer.promise; - if (handlerForType) { - handlerForType(message, options); - } - } -}); -enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'ember-console', 'ember-debug/deprecate', 'ember-debug/warn'], function (exports, _emberMetal, _emberEnvironment, _emberConsole, _emberDebugDeprecate, _emberDebugWarn) { - 'use strict'; + try { + this.runInitializers(); + _emberRuntime.runLoadHooks('application', this); + this.advanceReadiness(); + // Continues to `didBecomeReady` + } catch (error) { + // For the asynchronous boot path + defer.reject(error); - exports._warnIfUsingStrippedFeatureFlags = _warnIfUsingStrippedFeatureFlags; + // For the synchronous boot path + throw error; + } + }, - /** - @module ember - @submodule ember-debug - */ + /** + Reset the application. This is typically used only in tests. It cleans up + the application in the following order: + 1. Deactivate existing routes + 2. Destroy all objects in the container + 3. Create a new application container + 4. Re-route to the existing url + Typical Example: + ```javascript + let App; + run(function() { + App = Ember.Application.create(); + }); + module('acceptance test', { + setup: function() { + App.reset(); + } + }); + test('first test', function() { + // App is freshly reset + }); + test('second test', function() { + // App is again freshly reset + }); + ``` + Advanced Example: + Occasionally you may want to prevent the app from initializing during + setup. This could enable extra configuration, or enable asserting prior + to the app becoming ready. + ```javascript + let App; + run(function() { + App = Ember.Application.create(); + }); + module('acceptance test', { + setup: function() { + run(function() { + App.reset(); + App.deferReadiness(); + }); + } + }); + test('first test', function() { + ok(true, 'something before app is initialized'); + run(function() { + App.advanceReadiness(); + }); + ok(true, 'something after app is initialized'); + }); + ``` + @method reset + @public + */ + reset: function () { + _emberMetal.assert('Calling reset() on instances of `Ember.Application` is not\n supported when globals mode is disabled; call `visit()` to\n create new `Ember.ApplicationInstance`s and dispose them\n via their `destroy()` method instead.', this._globalsMode && this.autoboot); - /** - @class Ember - @public - */ + var instance = this.__deprecatedInstance__; - /** - Define an assertion that will throw an exception if the condition is not met. - - * In a production build, this method is defined as an empty function (NOP). - Uses of this method in Ember itself are stripped from the ember.prod.js build. - - ```javascript - // Test for truthiness - Ember.assert('Must pass a valid object', obj); - - // Fail unconditionally - Ember.assert('This code path should never be run'); - ``` - - @method assert - @param {String} desc A description of the assertion. This will become - the text of the Error thrown if the assertion fails. - @param {Boolean} test Must be truthy for the assertion to pass. If - falsy, an exception will be thrown. - @public - @since 1.0.0 - */ - _emberMetal.setDebugFunction('assert', function assert(desc, test) { - if (!test) { - throw new _emberMetal.Error('Assertion Failed: ' + desc); - } - }); + this._readinessDeferrals = 1; + this._bootPromise = null; + this._bootResolver = null; + this._booted = false; - /** - Display a debug notice. - - * In a production build, this method is defined as an empty function (NOP). - Uses of this method in Ember itself are stripped from the ember.prod.js build. - - ```javascript - Ember.debug('I\'m a debug notice!'); - ``` - - @method debug - @param {String} message A debug message to display. - @public - */ - _emberMetal.setDebugFunction('debug', function debug(message) { - _emberConsole.default.debug('DEBUG: ' + message); - }); + function handleReset() { + _emberMetal.run(instance, 'destroy'); + this._buildDeprecatedInstance(); + _emberMetal.run.schedule('actions', this, '_bootSync'); + } - /** - Display an info notice. - - * In a production build, this method is defined as an empty function (NOP). - Uses of this method in Ember itself are stripped from the ember.prod.js build. - - @method info - @private - */ - _emberMetal.setDebugFunction('info', function info() { - _emberConsole.default.info.apply(undefined, arguments); - }); + _emberMetal.run.join(this, handleReset); + }, - /** - Alias an old, deprecated method with its new counterpart. - - Display a deprecation warning with the provided message and a stack trace - (Chrome and Firefox only) when the assigned method is called. - - * In a production build, this method is defined as an empty function (NOP). - - ```javascript - Ember.oldMethod = Ember.deprecateFunc('Please use the new, updated method', Ember.newMethod); - ``` - - @method deprecateFunc - @param {String} message A description of the deprecation. - @param {Object} [options] The options object for Ember.deprecate. - @param {Function} func The new function called to replace its deprecated counterpart. - @return {Function} A new function that wraps the original function with a deprecation warning - @private - */ - _emberMetal.setDebugFunction('deprecateFunc', function deprecateFunc() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } + /** + @private + @method didBecomeReady + */ + didBecomeReady: function () { + try { + // TODO: Is this still needed for _globalsMode = false? + if (!_emberMetal.isTesting()) { + // Eagerly name all classes that are already loaded + _emberRuntime.Namespace.processAll(); + _emberRuntime.setNamespaceSearchDisabled(true); + } - if (args.length === 3) { - var _ret = (function () { - var message = args[0]; - var options = args[1]; - var func = args[2]; + // See documentation on `_autoboot()` for details + if (this.autoboot) { + var instance = undefined; - return { - v: function () { - _emberMetal.deprecate(message, false, options); - return func.apply(this, arguments); + if (this._globalsMode) { + // If we already have the __deprecatedInstance__ lying around, boot it to + // avoid unnecessary work + instance = this.__deprecatedInstance__; + } else { + // Otherwise, build an instance and boot it. This is currently unreachable, + // because we forced _globalsMode to === autoboot; but having this branch + // allows us to locally toggle that flag for weeding out legacy globals mode + // dependencies independently + instance = this.buildInstance(); } - }; - })(); - - if (typeof _ret === 'object') return _ret.v; - } else { - var _ret2 = (function () { - var message = args[0]; - var func = args[1]; - return { - v: function () { - _emberMetal.deprecate(message); - return func.apply(this, arguments); - } - }; - })(); + instance._bootSync(); - if (typeof _ret2 === 'object') return _ret2.v; - } - }); + // TODO: App.ready() is not called when autoboot is disabled, is this correct? + this.ready(); - /** - Run a function meant for debugging. - - * In a production build, this method is defined as an empty function (NOP). - Uses of this method in Ember itself are stripped from the ember.prod.js build. - - ```javascript - Ember.runInDebug(() => { - Ember.Component.reopen({ - didInsertElement() { - console.log("I'm happy"); + instance.startRouting(); } - }); - }); - ``` - - @method runInDebug - @param {Function} func The function to be executed. - @since 1.5.0 - @public - */ - _emberMetal.setDebugFunction('runInDebug', function runInDebug(func) { - func(); - }); - - _emberMetal.setDebugFunction('debugSeal', function debugSeal(obj) { - Object.seal(obj); - }); - _emberMetal.setDebugFunction('debugFreeze', function debugFreeze(obj) { - Object.freeze(obj); - }); + // For the asynchronous boot path + this._bootResolver.resolve(this); - _emberMetal.setDebugFunction('deprecate', _emberDebugDeprecate.default); + // For the synchronous boot path + this._booted = true; + } catch (error) { + // For the asynchronous boot path + this._bootResolver.reject(error); - _emberMetal.setDebugFunction('warn', _emberDebugWarn.default); + // For the synchronous boot path + throw error; + } + }, - /** - Will call `Ember.warn()` if ENABLE_OPTIONAL_FEATURES or - any specific FEATURES flag is truthy. - - This method is called automatically in debug canary builds. - - @private - @method _warnIfUsingStrippedFeatureFlags - @return {void} - */ + /** + Called when the Application has become ready, immediately before routing + begins. The call will be delayed until the DOM has become ready. + @event ready + @public + */ + ready: function () { + return this; + }, - function _warnIfUsingStrippedFeatureFlags(FEATURES, knownFeatures, featuresWereStripped) { - if (featuresWereStripped) { - _emberMetal.warn('Ember.ENV.ENABLE_OPTIONAL_FEATURES is only available in canary builds.', !_emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES, { id: 'ember-debug.feature-flag-with-features-stripped' }); + // This method must be moved to the application instance object + willDestroy: function () { + this._super.apply(this, arguments); + _emberRuntime.setNamespaceSearchDisabled(false); + this._booted = false; + this._bootPromise = null; + this._bootResolver = null; - var keys = Object.keys(FEATURES || {}); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (key === 'isEnabled' || !(key in knownFeatures)) { - continue; - } + if (_emberRuntime._loaded.application === this) { + _emberRuntime._loaded.application = undefined; + } - _emberMetal.warn('FEATURE["' + key + '"] is set as enabled, but FEATURE flags are only available in canary builds.', !FEATURES[key], { id: 'ember-debug.feature-flag-with-features-stripped' }); + if (this._globalsMode && this.__deprecatedInstance__) { + this.__deprecatedInstance__.destroy(); } - } - } + }, - if (!_emberMetal.isTesting()) { - (function () { - // Complain if they're using FEATURE flags in builds other than canary - _emberMetal.FEATURES['features-stripped-test'] = true; - var featuresWereStripped = true; - - if (false) { - featuresWereStripped = false; + /** + Boot a new instance of `Ember.ApplicationInstance` for the current + application and navigate it to the given `url`. Returns a `Promise` that + resolves with the instance when the initial routing and rendering is + complete, or rejects with any error that occured during the boot process. + When `autoboot` is disabled, calling `visit` would first cause the + application to boot, which runs the application initializers. + This method also takes a hash of boot-time configuration options for + customizing the instance's behavior. See the documentation on + `Ember.ApplicationInstance.BootOptions` for details. + `Ember.ApplicationInstance.BootOptions` is an interface class that exists + purely to document the available options; you do not need to construct it + manually. Simply pass a regular JavaScript object containing of the + desired options: + ```javascript + MyApp.visit("/", { location: "none", rootElement: "#container" }); + ``` + ### Supported Scenarios + While the `BootOptions` class exposes a large number of knobs, not all + combinations of them are valid; certain incompatible combinations might + result in unexpected behavior. + For example, booting the instance in the full browser environment + while specifying a foriegn `document` object (e.g. `{ isBrowser: true, + document: iframe.contentDocument }`) does not work correctly today, + largely due to Ember's jQuery dependency. + Currently, there are three officially supported scenarios/configurations. + Usages outside of these scenarios are not guaranteed to work, but please + feel free to file bug reports documenting your experience and any issues + you encountered to help expand support. + #### Browser Applications (Manual Boot) + The setup is largely similar to how Ember works out-of-the-box. Normally, + Ember will boot a default instance for your Application on "DOM ready". + However, you can customize this behavior by disabling `autoboot`. + For example, this allows you to render a miniture demo of your application + into a specific area on your marketing website: + ```javascript + import MyApp from 'my-app'; + $(function() { + let App = MyApp.create({ autoboot: false }); + let options = { + // Override the router's location adapter to prevent it from updating + // the URL in the address bar + location: 'none', + // Override the default `rootElement` on the app to render into a + // specific `div` on the page + rootElement: '#demo' + }; + // Start the app at the special demo URL + App.visit('/demo', options); + }); + ```` + Or perhaps you might want to boot two instances of your app on the same + page for a split-screen multiplayer experience: + ```javascript + import MyApp from 'my-app'; + $(function() { + let App = MyApp.create({ autoboot: false }); + let sessionId = MyApp.generateSessionID(); + let player1 = App.visit(`/matches/join?name=Player+1&session=${sessionId}`, { rootElement: '#left', location: 'none' }); + let player2 = App.visit(`/matches/join?name=Player+2&session=${sessionId}`, { rootElement: '#right', location: 'none' }); + Promise.all([player1, player2]).then(() => { + // Both apps have completed the initial render + $('#loading').fadeOut(); + }); + }); + ``` + Do note that each app instance maintains their own registry/container, so + they will run in complete isolation by default. + #### Server-Side Rendering (also known as FastBoot) + This setup allows you to run your Ember app in a server environment using + Node.js and render its content into static HTML for SEO purposes. + ```javascript + const HTMLSerializer = new SimpleDOM.HTMLSerializer(SimpleDOM.voidMap); + function renderURL(url) { + let dom = new SimpleDOM.Document(); + let rootElement = dom.body; + let options = { isBrowser: false, document: dom, rootElement: rootElement }; + return MyApp.visit(options).then(instance => { + try { + return HTMLSerializer.serialize(rootElement.firstChild); + } finally { + instance.destroy(); + } + }); } + ``` + In this scenario, because Ember does not have access to a global `document` + object in the Node.js environment, you must provide one explicitly. In practice, + in the non-browser environment, the stand-in `document` object only need to + implement a limited subset of the full DOM API. The `SimpleDOM` library is known + to work. + Since there is no access to jQuery in the non-browser environment, you must also + specify a DOM `Element` object in the same `document` for the `rootElement` option + (as opposed to a selector string like `"body"`). + See the documentation on the `isBrowser`, `document` and `rootElement` properties + on `Ember.ApplicationInstance.BootOptions` for details. + #### Server-Side Resource Discovery + This setup allows you to run the routing layer of your Ember app in a server + environment using Node.js and completely disable rendering. This allows you + to simulate and discover the resources (i.e. AJAX requests) needed to fufill + a given request and eagerly "push" these resources to the client. + ```app/initializers/network-service.js + import BrowserNetworkService from 'app/services/network/browser'; + import NodeNetworkService from 'app/services/network/node'; + // Inject a (hypothetical) service for abstracting all AJAX calls and use + // the appropiate implementaion on the client/server. This also allows the + // server to log all the AJAX calls made during a particular request and use + // that for resource-discovery purpose. + export function initialize(application) { + if (window) { // browser + application.register('service:network', BrowserNetworkService); + } else { // node + application.register('service:network', NodeNetworkService); + } + application.inject('route', 'network', 'service:network'); + }; + export default { + name: 'network-service', + initialize: initialize + }; + ``` + ```app/routes/post.js + import Ember from 'ember'; + // An example of how the (hypothetical) service is used in routes. + export default Ember.Route.extend({ + model(params) { + return this.network.fetch(`/api/posts/${params.post_id}.json`); + }, + afterModel(post) { + if (post.isExternalContent) { + return this.network.fetch(`/api/external/?url=${post.externalURL}`); + } else { + return post; + } + } + }); + ``` + ```javascript + // Finally, put all the pieces together + function discoverResourcesFor(url) { + return MyApp.visit(url, { isBrowser: false, shouldRender: false }).then(instance => { + let networkService = instance.lookup('service:network'); + return networkService.requests; // => { "/api/posts/123.json": "..." } + }); + } + ``` + @public + @method visit + @param url {String} The initial URL to navigate to + @param options {Ember.ApplicationInstance.BootOptions} + @return {Promise} + */ + visit: function (url, options) { + var _this = this; - delete _emberMetal.FEATURES['features-stripped-test']; - _warnIfUsingStrippedFeatureFlags(_emberEnvironment.ENV.FEATURES, _emberMetal.DEFAULT_FEATURES, featuresWereStripped); - - // Inform the developer about the Ember Inspector if not installed. - var isFirefox = _emberEnvironment.environment.isFirefox; - var isChrome = _emberEnvironment.environment.isChrome; - - if (typeof window !== 'undefined' && (isFirefox || isChrome) && window.addEventListener) { - window.addEventListener('load', function () { - if (document.documentElement && document.documentElement.dataset && !document.documentElement.dataset.emberExtension) { - var downloadURL; + return this.boot().then(function () { + var instance = _this.buildInstance(); - if (isChrome) { - downloadURL = 'https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi'; - } else if (isFirefox) { - downloadURL = 'https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/'; - } + return instance.boot(options).then(function () { + return instance.visit(url); + }).catch(function (error) { + _emberMetal.run(instance, 'destroy'); + throw error; + }); + }); + } + }); - _emberMetal.debug('For more advanced debugging, install the Ember Inspector from ' + downloadURL); - } - }, false); - } - })(); - } - /** - @public - @class Ember.Debug - */ - _emberMetal.default.Debug = {}; + Object.defineProperty(Application.prototype, 'registry', { + configurable: true, + enumerable: false, + get: function () { + return _emberRuntime.buildFakeRegistryWithDeprecations(this, 'Application'); + } + }); - /** - Allows for runtime registration of handler functions that override the default deprecation behavior. - Deprecations are invoked by calls to [Ember.deprecate](http://emberjs.com/api/classes/Ember.html#method_deprecate). - The following example demonstrates its usage by registering a handler that throws an error if the - message contains the word "should", otherwise defers to the default handler. - - ```javascript - Ember.Debug.registerDeprecationHandler((message, options, next) => { - if (message.indexOf('should') !== -1) { - throw new Error(`Deprecation message with should: ${message}`); - } else { - // defer to whatever handler was registered before this one - next(message, options); - } - }); - ``` - - The handler function takes the following arguments: - -
      -
    • message - The message received from the deprecation call.
    • -
    • options - An object passed in with the deprecation call containing additional information including:
    • -
        -
      • id - An id of the deprecation in the form of package-name.specific-deprecation.
      • -
      • until - The Ember version number the feature and deprecation will be removed in.
      • -
      -
    • next - A function that calls into the previously registered handler.
    • -
    - - @public - @static - @method registerDeprecationHandler - @param handler {Function} A function to handle deprecation calls. - @since 2.1.0 - */ - _emberMetal.default.Debug.registerDeprecationHandler = _emberDebugDeprecate.registerHandler; - /** - Allows for runtime registration of handler functions that override the default warning behavior. - Warnings are invoked by calls made to [Ember.warn](http://emberjs.com/api/classes/Ember.html#method_warn). - The following example demonstrates its usage by registering a handler that does nothing overriding Ember's - default warning behavior. - - ```javascript - // next is not called, so no warnings get the default behavior - Ember.Debug.registerWarnHandler(() => {}); - ``` - - The handler function takes the following arguments: - -
      -
    • message - The message received from the warn call.
    • -
    • options - An object passed in with the warn call containing additional information including:
    • -
        -
      • id - An id of the warning in the form of package-name.specific-warning.
      • -
      -
    • next - A function that calls into the previously registered handler.
    • -
    - - @public - @static - @method registerWarnHandler - @param handler {Function} A function to handle warnings. - @since 2.1.0 - */ - _emberMetal.default.Debug.registerWarnHandler = _emberDebugWarn.registerHandler; + Application.reopenClass({ + /** + This creates a registry with the default Ember naming conventions. + It also configures the registry: + * registered views are created every time they are looked up (they are + not singletons) + * registered templates are not factories; the registered value is + returned directly. + * the router receives the application as its `namespace` property + * all controllers receive the router as their `target` and `controllers` + properties + * 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 + @method buildRegistry + @static + @param {Ember.Application} namespace the application for which to + build the registry + @return {Ember.Registry} the built registry + @private + */ + buildRegistry: function (application) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - /* - We are transitioning away from `ember.js` to `ember.debug.js` to make - it much clearer that it is only for local development purposes. - - This flag value is changed by the tooling (by a simple string replacement) - so that if `ember.js` (which must be output for backwards compat reasons) is - used a nice helpful warning message will be printed out. - */ - var runningNonEmberDebugJS = true; - exports.runningNonEmberDebugJS = runningNonEmberDebugJS; - if (runningNonEmberDebugJS) { - _emberMetal.warn('Please use `ember.debug.js` instead of `ember.js` for development and debugging.'); - } -}); -// reexports -enifed('ember-debug/warn', ['exports', 'ember-console', 'ember-metal', 'ember-debug/handlers'], function (exports, _emberConsole, _emberMetal, _emberDebugHandlers) { - 'use strict'; + var registry = this._super.apply(this, arguments); - exports.registerHandler = registerHandler; - exports.default = warn; + commonSetupRegistry(registry); - function registerHandler(handler) { - _emberDebugHandlers.registerHandler('warn', handler); - } + _emberGlimmer.setupApplicationRegistry(registry); - registerHandler(function logWarning(message, options) { - _emberConsole.default.warn('WARNING: ' + message); - if ('trace' in _emberConsole.default) { - _emberConsole.default.trace(); + return registry; } }); - var missingOptionsDeprecation = 'When calling `Ember.warn` you ' + 'must provide an `options` hash as the third parameter. ' + '`options` should include an `id` property.'; - exports.missingOptionsDeprecation = missingOptionsDeprecation; - var missingOptionsIdDeprecation = 'When calling `Ember.warn` you must provide `id` in options.'; + function commonSetupRegistry(registry) { + registry.register('-view-registry:main', { create: function () { + return _emberUtils.dictionary(null); + } }); - exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation; - /** - @module ember - @submodule ember-debug - */ + registry.register('route:basic', _emberRouting.Route); + registry.register('event_dispatcher:main', _emberViews.EventDispatcher); - /** - Display a warning with the provided message. - - * In a production build, this method is defined as an empty function (NOP). - Uses of this method in Ember itself are stripped from the ember.prod.js build. - - @method warn - @param {String} message A warning to display. - @param {Boolean} test An optional boolean. If falsy, the warning - will be displayed. - @param {Object} options An object that can be used to pass a unique - `id` for this warning. The `id` can be used by Ember debugging tools - to change the behavior (raise, log, or silence) for that specific warning. - The `id` should be namespaced by dots, e.g. "ember-debug.feature-flag-with-features-stripped" - @for Ember - @public - @since 1.0.0 - */ + registry.injection('router:main', 'namespace', 'application:main'); - function warn(message, test, options) { - if (!options) { - _emberMetal.deprecate(missingOptionsDeprecation, false, { - id: 'ember-debug.warn-options-missing', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' - }); - } + registry.register('location:auto', _emberRouting.AutoLocation); + registry.register('location:hash', _emberRouting.HashLocation); + registry.register('location:history', _emberRouting.HistoryLocation); + registry.register('location:none', _emberRouting.NoneLocation); - if (options && !options.id) { - _emberMetal.deprecate(missingOptionsIdDeprecation, false, { - id: 'ember-debug.warn-id-missing', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' - }); - } + registry.register(_container.privatize(_templateObject), _emberRouting.BucketCache); - _emberDebugHandlers.invoke.apply(undefined, ['warn'].concat(babelHelpers.slice.call(arguments))); + if (_emberMetal.isFeatureEnabled('ember-routing-router-service')) { + registry.register('service:router', _emberRouting.RouterService); + registry.injection('service:router', 'router', 'router:main'); + } } -}); -enifed('ember-environment/global', ['exports'], function (exports) { - /* globals global, window, self, mainContext */ - // from lodash to catch fake globals - 'use strict'; + function registerLibraries() { + if (!librariesRegistered) { + librariesRegistered = true; - function checkGlobal(value) { - return value && value.Object === Object ? value : undefined; + if (_emberEnvironment.environment.hasDOM && typeof _emberViews.jQuery === 'function') { + _emberMetal.libraries.registerCoreLibrary('jQuery', _emberViews.jQuery().jquery); + } + } } - // element ids can ruin global miss checks - function checkElementIdShadowing(value) { - return value && value.nodeType === undefined ? value : undefined; - } + function logLibraryVersions() { + var _this2 = this; - // export real global - exports.default = checkGlobal(checkElementIdShadowing(typeof global === 'object' && global)) || checkGlobal(typeof self === 'object' && self) || checkGlobal(typeof window === 'object' && window) || mainContext || // set before strict mode in Ember loader/wrapper - new Function('return this')(); - // eval outside of strict mode -}); -enifed('ember-environment/index', ['exports', 'ember-environment/global', 'ember-environment/utils'], function (exports, _emberEnvironmentGlobal, _emberEnvironmentUtils) { - /* globals module */ - 'use strict'; + _emberMetal.runInDebug(function () { + if (_emberEnvironment.ENV.LOG_VERSION) { + // we only need to see this once per Application#init + _emberEnvironment.ENV.LOG_VERSION = false; + var libs = _emberMetal.libraries._registry; - /** - 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 - backwards compatibility with earlier versions of Ember). The `EmberENV` - hash must be created before loading Ember. - - @class EmberENV - @type Object - @public - */ - var ENV = typeof _emberEnvironmentGlobal.default.EmberENV === 'object' && _emberEnvironmentGlobal.default.EmberENV || typeof _emberEnvironmentGlobal.default.ENV === 'object' && _emberEnvironmentGlobal.default.ENV || {}; + var nameLengths = libs.map(function (item) { + return _emberMetal.get(item, 'name.length'); + }); - exports.ENV = ENV; - // ENABLE_ALL_FEATURES was documented, but you can't actually enable non optional features. - if (ENV.ENABLE_ALL_FEATURES) { - ENV.ENABLE_OPTIONAL_FEATURES = true; + var maxNameLength = Math.max.apply(_this2, nameLengths); + + _emberMetal.debug('-------------------------------'); + for (var i = 0; i < libs.length; i++) { + var lib = libs[i]; + var spaces = new Array(maxNameLength - lib.name.length + 1).join(' '); + _emberMetal.debug([lib.name, spaces, ' : ', lib.version].join('')); + } + _emberMetal.debug('-------------------------------'); + } + }); } + exports.default = Application; +}); +enifed('ember-application/system/engine-instance', ['exports', 'ember-utils', 'ember-runtime', 'ember-metal', 'container', 'ember-application/system/engine-parent'], function (exports, _emberUtils, _emberRuntime, _emberMetal, _container, _emberApplicationSystemEngineParent) { /** - Determines whether Ember should add to `Array`, `Function`, and `String` - native object prototypes, a few extra methods in order to provide a more - friendly API. - - We generally recommend leaving this option set to true however, if you need - to turn it off, you can add the configuration property - `EXTEND_PROTOTYPES` to `EmberENV` and set it to `false`. - - Note, when disabled (the default configuration for Ember Addons), you will - instead have to access all methods and functions from the Ember - namespace. - - @property EXTEND_PROTOTYPES - @type Boolean - @default true - @for EmberENV - @public + @module ember + @submodule ember-application */ - ENV.EXTEND_PROTOTYPES = _emberEnvironmentUtils.normalizeExtendPrototypes(ENV.EXTEND_PROTOTYPES); - /** - The `LOG_STACKTRACE_ON_DEPRECATION` property, when true, tells Ember to log - a full stack trace during deprecation warnings. - - @property LOG_STACKTRACE_ON_DEPRECATION - @type Boolean - @default true - @for EmberENV - @public - */ - ENV.LOG_STACKTRACE_ON_DEPRECATION = _emberEnvironmentUtils.defaultTrue(ENV.LOG_STACKTRACE_ON_DEPRECATION); + 'use strict'; - /** - The `LOG_VERSION` property, when true, tells Ember to log versions of all - dependent libraries in use. - - @property LOG_VERSION - @type Boolean - @default true - @for EmberENV - @public - */ - ENV.LOG_VERSION = _emberEnvironmentUtils.defaultTrue(ENV.LOG_VERSION); + var _EmberObject$extend; - // default false - ENV.MODEL_FACTORY_INJECTIONS = _emberEnvironmentUtils.defaultFalse(ENV.MODEL_FACTORY_INJECTIONS); + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); /** - Debug parameter you can turn on. This will log all bindings that fire to - the console. This should be disabled in production code. Note that you - can also enable this from the console or temporarily. + The `EngineInstance` encapsulates all of the stateful aspects of a + running `Engine`. - @property LOG_BINDINGS - @for EmberENV - @type Boolean - @default false @public + @class Ember.EngineInstance + @extends Ember.Object + @uses RegistryProxyMixin + @uses ContainerProxyMixin */ - ENV.LOG_BINDINGS = _emberEnvironmentUtils.defaultFalse(ENV.LOG_BINDINGS); - ENV.RAISE_ON_DEPRECATION = _emberEnvironmentUtils.defaultFalse(ENV.RAISE_ON_DEPRECATION); + var EngineInstance = _emberRuntime.Object.extend(_emberRuntime.RegistryProxyMixin, _emberRuntime.ContainerProxyMixin, (_EmberObject$extend = { + /** + The base `Engine` for which this is an instance. + @property {Ember.Engine} engine + @private + */ + base: null, - // check if window exists and actually is the global - var hasDOM = typeof window !== 'undefined' && window === _emberEnvironmentGlobal.default && window.document && window.document.createElement && !ENV.disableBrowserEnvironment; // is this a public thing? + init: function () { + this._super.apply(this, arguments); - // legacy imports/exports/lookup stuff (should we keep this??) - var originalContext = _emberEnvironmentGlobal.default.Ember || {}; + _emberUtils.guidFor(this); - var context = { - // import jQuery - imports: originalContext.imports || _emberEnvironmentGlobal.default, - // export Ember - exports: originalContext.exports || _emberEnvironmentGlobal.default, - // search for Namespaces - lookup: originalContext.lookup || _emberEnvironmentGlobal.default - }; + var base = this.base; - exports.context = context; - // TODO: cleanup single source of truth issues with this stuff - var environment = hasDOM ? { - hasDOM: true, - isChrome: !!window.chrome && !window.opera, - isFirefox: typeof InstallTrigger !== 'undefined', - isPhantom: !!window.callPhantom, - location: window.location, - history: window.history, - userAgent: window.navigator.userAgent, - window: window - } : { - hasDOM: false, - isChrome: false, - isFirefox: false, - isPhantom: false, - location: null, - history: null, - userAgent: 'Lynx (textmode)', - window: null - }; - exports.environment = environment; -}); -enifed("ember-environment/utils", ["exports"], function (exports) { - "use strict"; + if (!base) { + base = this.application; + this.base = base; + } - exports.defaultTrue = defaultTrue; - exports.defaultFalse = defaultFalse; - exports.normalizeExtendPrototypes = normalizeExtendPrototypes; + // Create a per-instance registry that will use the application's registry + // as a fallback for resolving registrations. + var registry = this.__registry__ = new _container.Registry({ + fallback: base.__registry__ + }); - function defaultTrue(v) { - return v === false ? false : true; - } + // Create a per-instance container from the instance's registry + this.__container__ = registry.container({ owner: this }); - function defaultFalse(v) { - return v === true ? true : false; - } + this._booted = false; + }, - function normalizeExtendPrototypes(obj) { - if (obj === false) { - return { String: false, Array: false, Function: false }; - } else if (!obj || obj === true) { - return { String: true, Array: true, Function: true }; - } else { - return { - String: defaultTrue(obj.String), - Array: defaultTrue(obj.Array), - Function: defaultTrue(obj.Function) - }; - } - } -}); -enifed('ember-extension-support/container_debug_adapter', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { - 'use strict'; + /** + Initialize the `Ember.EngineInstance` and return a promise that resolves + with the instance itself when the boot process is complete. + The primary task here is to run any registered instance initializers. + See the documentation on `BootOptions` for the options it takes. + @private + @method boot + @param options {Object} + @return {Promise} + */ + boot: function (options) { + var _this = this; - /** - @module ember - @submodule ember-extension-support - */ + if (this._bootPromise) { + return this._bootPromise; + } - /** - The `ContainerDebugAdapter` helps the container and resolver interface - with tools that debug Ember such as the - [Ember Extension](https://github.com/tildeio/ember-extension) - for Chrome and Firefox. - - This class can be extended by a custom resolver implementer - to override some of the methods with library-specific code. - - The methods likely to be overridden are: - - * `canCatalogEntriesByType` - * `catalogEntriesByType` - - The adapter will need to be registered - in the application's container as `container-debug-adapter:main`. - - Example: - - ```javascript - Application.initializer({ - name: "containerDebugAdapter", - - initialize(application) { - application.register('container-debug-adapter:main', require('app/container-debug-adapter')); + this._bootPromise = new _emberRuntime.RSVP.Promise(function (resolve) { + return resolve(_this._bootSync(options)); + }); + + return this._bootPromise; + }, + + /** + Unfortunately, a lot of existing code assumes booting an instance is + synchronous – specifically, a lot of tests assume the last call to + `app.advanceReadiness()` or `app.reset()` will result in a new instance + being fully-booted when the current runloop completes. + We would like new code (like the `visit` API) to stop making this + assumption, so we created the asynchronous version above that returns a + promise. But until we have migrated all the code, we would have to expose + this method for use *internally* in places where we need to boot an instance + synchronously. + @private + */ + _bootSync: function (options) { + if (this._booted) { + return this; } - }); - ``` - - @class ContainerDebugAdapter - @namespace Ember - @extends Ember.Object - @since 1.5.0 - @public - */ - exports.default = _emberRuntime.Object.extend({ + + _emberMetal.assert('An engine instance\'s parent must be set via `setEngineParent(engine, parent)` prior to calling `engine.boot()`.', _emberApplicationSystemEngineParent.getEngineParent(this)); + + this.cloneParentDependencies(); + + this.setupRegistry(options); + + this.base.runInstanceInitializers(this); + + this._booted = true; + + return this; + }, + + setupRegistry: function () { + var options = arguments.length <= 0 || arguments[0] === undefined ? this.__container__.lookup('-environment:main') : arguments[0]; + + this.constructor.setupRegistry(this.__registry__, options); + }, + /** - The resolver instance of the application - being debugged. This property will be injected - on creation. - @property resolver - @default null + Unregister a factory. + Overrides `RegistryProxy#unregister` in order to clear any cached instances + of the unregistered factory. @public + @method unregister + @param {String} fullName + */ + unregister: function (fullName) { + this.__container__.reset(fullName); + this._super.apply(this, arguments); + }, + + /** + @private */ - resolver: null, + willDestroy: function () { + this._super.apply(this, arguments); + _emberMetal.run(this.__container__, 'destroy'); + }, /** - Returns true if it is possible to catalog a list of available - classes in the resolver for a given type. - @method canCatalogEntriesByType - @param {String} type The type. e.g. "model", "controller", "route". - @return {boolean} whether a list is available for this type. - @public + 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} */ - canCatalogEntriesByType: function (type) { - if (type === 'model' || type === 'template') { - return false; + buildChildEngineInstance: function (name) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + var Engine = this.lookup('engine:' + name); + + if (!Engine) { + throw new _emberMetal.Error('You attempted to mount the engine \'' + name + '\', but it is not registered with its parent.'); } - return true; + var engineInstance = Engine.buildInstance(options); + + _emberApplicationSystemEngineParent.setEngineParent(engineInstance, this); + + return engineInstance; }, /** - Returns the available classes a given type. - @method catalogEntriesByType - @param {String} type The type. e.g. "model", "controller", "route". - @return {Array} An array of strings. - @public + Clone dependencies shared between an engine instance and its parent. + @private + @method cloneParentDependencies */ - catalogEntriesByType: function (type) { - var namespaces = _emberRuntime.A(_emberRuntime.Namespace.NAMESPACES); - var types = _emberRuntime.A(); - var typeSuffixRegex = new RegExp(_emberRuntime.String.classify(type) + '$'); + cloneParentDependencies: function () { + var _this2 = this; - namespaces.forEach(function (namespace) { - if (namespace !== _emberMetal.default) { - for (var key in namespace) { - if (!namespace.hasOwnProperty(key)) { - continue; - } - if (typeSuffixRegex.test(key)) { - var klass = namespace[key]; - if (_emberRuntime.typeOf(klass) === 'class') { - types.push(_emberRuntime.String.dasherize(key.replace(typeSuffixRegex, ''))); - } - } - } - } + var parent = _emberApplicationSystemEngineParent.getEngineParent(this); + + var registrations = ['route:basic', 'event_dispatcher:main', 'service:-routing', 'service:-glimmer-environment']; + + registrations.forEach(function (key) { + return _this2.register(key, parent.resolveRegistration(key)); }); - return types; + + var env = parent.lookup('-environment:main'); + this.register('-environment:main', env, { instantiate: false }); + + var singletons = ['router:main', _container.privatize(_templateObject), '-view-registry:main', 'renderer:-' + (env.isInteractive ? 'dom' : 'inert')]; + + singletons.forEach(function (key) { + return _this2.register(key, parent.lookup(key), { instantiate: false }); + }); + + this.inject('view', '_environment', '-environment:main'); + this.inject('route', '_environment', '-environment:main'); + } + + }, _EmberObject$extend[_container.FACTORY_FOR] = function (fullName, options) { + return this.__container__[_container.FACTORY_FOR](fullName, options); + }, _EmberObject$extend[_container.LOOKUP_FACTORY] = function (fullName, options) { + return this.__container__[_container.LOOKUP_FACTORY](fullName, options); + }, _EmberObject$extend)); + + EngineInstance.reopenClass({ + /** + @private + @method setupRegistry + @param {Registry} registry + @param {BootOptions} options + */ + setupRegistry: function (registry, options) { + // when no options/environment is present, do nothing + if (!options) { + return; + } + + registry.injection('view', '_environment', '-environment:main'); + registry.injection('route', '_environment', '-environment:main'); + + if (options.isInteractive) { + registry.injection('view', 'renderer', 'renderer:-dom'); + registry.injection('component', 'renderer', 'renderer:-dom'); + } else { + registry.injection('view', 'renderer', 'renderer:-inert'); + registry.injection('component', 'renderer', 'renderer:-inert'); + } } }); + + exports.default = EngineInstance; }); -// Ember as namespace -enifed('ember-extension-support/data_adapter', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-application'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberApplication) { +enifed('ember-application/system/engine-parent', ['exports', 'ember-utils'], function (exports, _emberUtils) { 'use strict'; + exports.getEngineParent = getEngineParent; + exports.setEngineParent = setEngineParent; + var ENGINE_PARENT = _emberUtils.symbol('ENGINE_PARENT'); + + exports.ENGINE_PARENT = ENGINE_PARENT; /** - @module ember - @submodule ember-extension-support + `getEngineParent` retrieves an engine instance's parent instance. + + @method getEngineParent + @param {EngineInstance} engine An engine instance. + @return {EngineInstance} The parent engine instance. + @for Ember + @public */ + function getEngineParent(engine) { + return engine[ENGINE_PARENT]; + } + /** - The `DataAdapter` helps a data persistence library - interface with tools that debug Ember such - as the [Ember Extension](https://github.com/tildeio/ember-extension) - for Chrome and Firefox. - - This class will be extended by a persistence library - which will override some of the methods with - library-specific code. - - The methods likely to be overridden are: - - * `getFilters` - * `detect` - * `columnsForType` - * `getRecords` - * `getRecordColumnValues` - * `getRecordKeywords` - * `getRecordFilterValues` - * `getRecordColor` - * `observeRecord` + `setEngineParent` sets an engine instance's parent instance. - The adapter will need to be registered - in the application's container as `dataAdapter:main`. + @method setEngineParent + @param {EngineInstance} engine An engine instance. + @param {EngineInstance} parent The parent engine instance. + @private + */ + + function setEngineParent(engine, parent) { + engine[ENGINE_PARENT] = parent; + } +}); +enifed('ember-application/system/engine', ['exports', 'ember-utils', 'ember-runtime', 'container', 'dag-map', 'ember-metal', 'ember-application/system/resolver', 'ember-application/system/engine-instance', 'ember-routing', 'ember-extension-support', 'ember-views', 'ember-glimmer'], function (exports, _emberUtils, _emberRuntime, _container, _dagMap, _emberMetal, _emberApplicationSystemResolver, _emberApplicationSystemEngineInstance, _emberRouting, _emberExtensionSupport, _emberViews, _emberGlimmer) { + /** + @module ember + @submodule ember-application + */ + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); + + function props(obj) { + var properties = []; + + for (var key in obj) { + properties.push(key); + } + + return properties; + } + + /** + The `Engine` class contains core functionality for both applications and + engines. - Example: + Each engine manages a registry that's used for dependency injection and + exposed through `RegistryProxy`. - ```javascript - Application.initializer({ - name: "data-adapter", + Engines also manage initializers and instance initializers. - initialize: function(application) { - application.register('data-adapter:main', DS.DataAdapter); - } - }); - ``` + Engines can spawn `EngineInstance` instances via `buildInstance()`. - @class DataAdapter + @class Engine @namespace Ember - @extends EmberObject + @extends Ember.Namespace + @uses RegistryProxy @public */ - exports.default = _emberRuntime.Object.extend({ + var Engine = _emberRuntime.Namespace.extend(_emberRuntime.RegistryProxyMixin, { init: function () { this._super.apply(this, arguments); - this.releaseMethods = _emberRuntime.A(); + + this.buildRegistry(); }, /** - The container-debug-adapter which is used - to list all models. - @property containerDebugAdapter - @default undefined - @since 1.5.0 - @public - **/ - containerDebugAdapter: undefined, + A private flag indicating whether an engine's initializers have run yet. + @private + @property _initializersRan + */ + _initializersRan: false, /** - The number of attributes to send - as columns. (Enough to make the record - identifiable). + Ensure that initializers are run once, and only once, per engine. @private - @property attributeLimit - @default 3 - @since 1.3.0 + @method ensureInitializers */ - attributeLimit: 3, + ensureInitializers: function () { + if (!this._initializersRan) { + this.runInitializers(); + this._initializersRan = true; + } + }, /** - Ember Data > v1.0.0-beta.18 - requires string model names to be passed - around instead of the actual factories. - This is a stamp for the Ember Inspector - to differentiate between the versions - to be able to support older versions too. - @public - @property acceptsModelName - */ - acceptsModelName: true, + Create an EngineInstance for this engine. + @private + @method buildInstance + @return {Ember.EngineInstance} the engine instance + */ + buildInstance: function () { + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + + this.ensureInitializers(); + options.base = this; + return _emberApplicationSystemEngineInstance.default.create(options); + }, /** - Stores all methods that clear observers. - These methods will be called on destruction. + Build and configure the registry for the current engine. @private - @property releaseMethods - @since 1.3.0 + @method buildRegistry + @return {Ember.Registry} the configured registry */ - releaseMethods: _emberRuntime.A(), + buildRegistry: function () { + var registry = this.__registry__ = this.constructor.buildRegistry(this); + + return registry; + }, /** - Specifies how records can be filtered. - Records returned will need to have a `filterValues` - property with a key for every name in the returned array. - @public - @method getFilters - @return {Array} List of objects defining filters. - The object should have a `name` and `desc` property. + @private + @method initializer */ - getFilters: function () { - return _emberRuntime.A(); + initializer: function (options) { + this.constructor.initializer(options); }, /** - Fetch the model types and observe them for changes. - @public - @method watchModelTypes - @param {Function} typesAdded Callback to call to add types. - Takes an array of objects containing wrapped types (returned from `wrapModelType`). - @param {Function} typesUpdated Callback to call when a type has changed. - Takes an array of objects containing wrapped types. - @return {Function} Method to call to remove all observers + @private + @method instanceInitializer */ - watchModelTypes: function (typesAdded, typesUpdated) { + instanceInitializer: function (options) { + this.constructor.instanceInitializer(options); + }, + + /** + @private + @method runInitializers + */ + runInitializers: function () { var _this = this; - var modelTypes = this.getModelTypes(); - var releaseMethods = _emberRuntime.A(); - var typesToSend = undefined; + this._runInitializer('initializers', function (name, initializer) { + _emberMetal.assert('No application initializer named \'' + name + '\'', !!initializer); + if (initializer.initialize.length === 2) { + _emberMetal.deprecate('The `initialize` method for Application initializer \'' + name + '\' should take only one argument - `App`, an instance of an `Application`.', false, { + id: 'ember-application.app-initializer-initialize-arguments', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_initializer-arity' + }); - typesToSend = modelTypes.map(function (type) { - var klass = type.klass; - var wrapped = _this.wrapModelType(klass, type.name); - releaseMethods.push(_this.observeModelType(type.name, typesUpdated)); - return wrapped; + initializer.initialize(_this.__registry__, _this); + } else { + initializer.initialize(_this); + } }); - - typesAdded(typesToSend); - - var release = function () { - releaseMethods.forEach(function (fn) { - return fn(); - }); - _this.releaseMethods.removeObject(release); - }; - this.releaseMethods.pushObject(release); - return release; - }, - - _nameToClass: function (type) { - if (typeof type === 'string') { - type = _emberUtils.getOwner(this)._lookupFactory('model:' + type); - } - return type; }, /** - Fetch the records of a given type and observe them for changes. - @public - @method watchRecords - @param {String} modelName The model name. - @param {Function} recordsAdded Callback to call to add records. - Takes an array of objects containing wrapped records. - The object should have the following properties: - columnValues: {Object} The key and value of a table cell. - object: {Object} The actual record object. - @param {Function} recordsUpdated Callback to call when a record has changed. - Takes an array of objects containing wrapped records. - @param {Function} recordsRemoved Callback to call when a record has removed. - Takes the following parameters: - index: The array index where the records were removed. - count: The number of records removed. - @return {Function} Method to call to remove all observers. + @private + @since 1.12.0 + @method runInstanceInitializers */ - watchRecords: function (modelName, recordsAdded, recordsUpdated, recordsRemoved) { - var _this2 = this; + runInstanceInitializers: function (instance) { + this._runInitializer('instanceInitializers', function (name, initializer) { + _emberMetal.assert('No instance initializer named \'' + name + '\'', !!initializer); + initializer.initialize(instance); + }); + }, - var releaseMethods = _emberRuntime.A(); - var klass = this._nameToClass(modelName); - var records = this.getRecords(klass, modelName); - var release = undefined; + _runInitializer: function (bucketName, cb) { + var initializersByName = _emberMetal.get(this.constructor, bucketName); + var initializers = props(initializersByName); + var graph = new _dagMap.default(); + var initializer = undefined; - function recordUpdated(updatedRecord) { - recordsUpdated([updatedRecord]); + for (var i = 0; i < initializers.length; i++) { + initializer = initializersByName[initializers[i]]; + graph.add(initializer.name, initializer, initializer.before, initializer.after); } - var recordsToSend = records.map(function (record) { - releaseMethods.push(_this2.observeRecord(record, recordUpdated)); - return _this2.wrapRecord(record); - }); + graph.topsort(cb); + } + }); - var contentDidChange = function (array, idx, removedCount, addedCount) { - for (var i = idx; i < idx + addedCount; i++) { - var record = _emberRuntime.objectAt(array, i); - var wrapped = _this2.wrapRecord(record); - releaseMethods.push(_this2.observeRecord(record, recordUpdated)); - recordsAdded([wrapped]); - } + Engine.reopenClass({ + initializers: new _emberUtils.EmptyObject(), + instanceInitializers: new _emberUtils.EmptyObject(), - if (removedCount) { - recordsRemoved(idx, removedCount); + /** + The goal of initializers should be to register dependencies and injections. + This phase runs once. Because these initializers may load code, they are + allowed to defer application readiness and advance it. If you need to access + the container or store you should use an InstanceInitializer that will be run + after all initializers and therefore after all code is loaded and the app is + ready. + Initializer receives an object which has the following attributes: + `name`, `before`, `after`, `initialize`. The only required attribute is + `initialize`, all others are optional. + * `name` allows you to specify under which name the initializer is registered. + This must be a unique name, as trying to register two initializers with the + same name will result in an error. + ```javascript + Ember.Application.initializer({ + name: 'namedInitializer', + initialize: function(application) { + Ember.debug('Running namedInitializer!'); } - }; - - var observer = { didChange: contentDidChange, willChange: function () { - return this; - } }; - _emberRuntime.addArrayObserver(records, this, observer); - - release = function () { - releaseMethods.forEach(function (fn) { - return fn(); - }); - _emberRuntime.removeArrayObserver(records, _this2, observer); - _this2.releaseMethods.removeObject(release); - }; + }); + ``` + * `before` and `after` are used to ensure that this initializer is ran prior + or after the one identified by the value. This value can be a single string + or an array of strings, referencing the `name` of other initializers. + An example of ordering initializers, we create an initializer named `first`: + ```javascript + Ember.Application.initializer({ + name: 'first', + initialize: function(application) { + Ember.debug('First initializer!'); + } + }); + // DEBUG: First initializer! + ``` + We add another initializer named `second`, specifying that it should run + after the initializer named `first`: + ```javascript + Ember.Application.initializer({ + name: 'second', + after: 'first', + initialize: function(application) { + Ember.debug('Second initializer!'); + } + }); + // DEBUG: First initializer! + // DEBUG: Second initializer! + ``` + Afterwards we add a further initializer named `pre`, this time specifying + that it should run before the initializer named `first`: + ```javascript + Ember.Application.initializer({ + name: 'pre', + before: 'first', + initialize: function(application) { + Ember.debug('Pre initializer!'); + } + }); + // DEBUG: Pre initializer! + // DEBUG: First initializer! + // DEBUG: Second initializer! + ``` + Finally we add an initializer named `post`, specifying it should run after + both the `first` and the `second` initializers: + ```javascript + Ember.Application.initializer({ + name: 'post', + after: ['first', 'second'], + initialize: function(application) { + Ember.debug('Post initializer!'); + } + }); + // DEBUG: Pre initializer! + // DEBUG: First initializer! + // DEBUG: Second initializer! + // DEBUG: Post initializer! + ``` + * `initialize` is a callback function that receives one argument, + `application`, on which you can operate. + Example of using `application` to register an adapter: + ```javascript + Ember.Application.initializer({ + name: 'api-adapter', + initialize: function(application) { + application.register('api-adapter:main', ApiAdapter); + } + }); + ``` + @method initializer + @param initializer {Object} + @public + */ - recordsAdded(recordsToSend); + initializer: buildInitializerMethod('initializers', 'initializer'), - this.releaseMethods.pushObject(release); - return release; - }, + /** + Instance initializers run after all initializers have run. Because + instance initializers run after the app is fully set up. We have access + to the store, container, and other items. However, these initializers run + after code has loaded and are not allowed to defer readiness. + Instance initializer receives an object which has the following attributes: + `name`, `before`, `after`, `initialize`. The only required attribute is + `initialize`, all others are optional. + * `name` allows you to specify under which name the instanceInitializer is + registered. This must be a unique name, as trying to register two + instanceInitializer with the same name will result in an error. + ```javascript + Ember.Application.instanceInitializer({ + name: 'namedinstanceInitializer', + initialize: function(application) { + Ember.debug('Running namedInitializer!'); + } + }); + ``` + * `before` and `after` are used to ensure that this initializer is ran prior + or after the one identified by the value. This value can be a single string + or an array of strings, referencing the `name` of other initializers. + * See Ember.Application.initializer for discussion on the usage of before + and after. + Example instanceInitializer to preload data into the store. + ```javascript + Ember.Application.initializer({ + name: 'preload-data', + initialize: function(application) { + var userConfig, userConfigEncoded, store; + // We have a HTML escaped JSON representation of the user's basic + // configuration generated server side and stored in the DOM of the main + // index.html file. This allows the app to have access to a set of data + // without making any additional remote calls. Good for basic data that is + // needed for immediate rendering of the page. Keep in mind, this data, + // like all local models and data can be manipulated by the user, so it + // should not be relied upon for security or authorization. + // + // Grab the encoded data from the meta tag + userConfigEncoded = Ember.$('head meta[name=app-user-config]').attr('content'); + // Unescape the text, then parse the resulting JSON into a real object + userConfig = JSON.parse(unescape(userConfigEncoded)); + // Lookup the store + store = application.lookup('service:store'); + // Push the encoded JSON into the store + store.pushPayload(userConfig); + } + }); + ``` + @method instanceInitializer + @param instanceInitializer + @public + */ + instanceInitializer: buildInitializerMethod('instanceInitializers', 'instance initializer'), /** - Clear all observers before destruction + This creates a registry with the default Ember naming conventions. + It also configures the registry: + * registered views are created every time they are looked up (they are + not singletons) + * registered templates are not factories; the registered value is + returned directly. + * the router receives the application as its `namespace` property + * all controllers receive the router as their `target` and `controllers` + properties + * 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 + @method buildRegistry + @static + @param {Ember.Application} namespace the application for which to + build the registry + @return {Ember.Registry} the built registry @private - @method willDestroy */ - willDestroy: function () { - this._super.apply(this, arguments); - this.releaseMethods.forEach(function (fn) { - return fn(); + buildRegistry: function (namespace) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + var registry = new _container.Registry({ + resolver: resolverFor(namespace) }); - }, - /** - Detect whether a class is a model. - Test that against the model class - of your persistence library. - @private - @method detect - @param {Class} klass The class to test. - @return boolean Whether the class is a model class or not. - */ - detect: function (klass) { - return false; + registry.set = _emberMetal.set; + + registry.register('application:main', namespace, { instantiate: false }); + + commonSetupRegistry(registry); + _emberGlimmer.setupEngineRegistry(registry); + + return registry; }, /** - Get the columns for a given model type. - @private - @method columnsForType - @param {Class} type The model type. - @return {Array} An array of columns of the following format: - name: {String} The name of the column. - desc: {String} Humanized description (what would show in a table column name). + Set this to provide an alternate class to `Ember.DefaultResolver` + @deprecated Use 'Resolver' instead + @property resolver + @public */ - columnsForType: function (type) { - return _emberRuntime.A(); - }, + resolver: null, /** - Adds observers to a model type class. - @private - @method observeModelType - @param {String} modelName The model type name. - @param {Function} typesUpdated Called when a type is modified. - @return {Function} The function to call to remove observers. + Set this to provide an alternate class to `Ember.DefaultResolver` + @property resolver + @public */ + Resolver: null + }); - observeModelType: function (modelName, typesUpdated) { - var _this3 = this; + /** + This function defines the default lookup rules for container lookups: + + * templates are looked up on `Ember.TEMPLATES` + * other names are looked up on the application after classifying the name. + For example, `controller:post` looks up `App.PostController` by default. + * if the default lookup fails, look for registered classes on the container + + This allows the application to register default injections in the container + that could be overridden by the normal naming convention. + + @private + @method resolverFor + @param {Ember.Namespace} namespace the namespace to look for classes + @return {*} the resolved value for a given lookup + */ + function resolverFor(namespace) { + var ResolverClass = namespace.get('Resolver') || _emberApplicationSystemResolver.default; - var klass = this._nameToClass(modelName); - var records = this.getRecords(klass, modelName); + return ResolverClass.create({ + namespace: namespace + }); + } - function onChange() { - typesUpdated([this.wrapModelType(klass, modelName)]); + function buildInitializerMethod(bucketName, humanName) { + return function (initializer) { + // If this is the first initializer being added to a subclass, we are going to reopen the class + // to make sure we have a new `initializers` object, which extends from the parent class' using + // prototypal inheritance. Without this, attempting to add initializers to the subclass would + // pollute the parent class as well as other subclasses. + if (this.superclass[bucketName] !== undefined && this.superclass[bucketName] === this[bucketName]) { + var attrs = {}; + attrs[bucketName] = Object.create(this[bucketName]); + this.reopenClass(attrs); } - var observer = { - didChange: function () { - _emberMetal.run.scheduleOnce('actions', this, onChange); - }, - willChange: function () { - return this; - } - }; + _emberMetal.assert('The ' + humanName + ' \'' + initializer.name + '\' has already been registered', !this[bucketName][initializer.name]); + _emberMetal.assert('An ' + humanName + ' cannot be registered without an initialize function', _emberUtils.canInvoke(initializer, 'initialize')); + _emberMetal.assert('An ' + humanName + ' cannot be registered without a name property', initializer.name !== undefined); - _emberRuntime.addArrayObserver(records, this, observer); + this[bucketName][initializer.name] = initializer; + }; + } - var release = function () { - return _emberRuntime.removeArrayObserver(records, _this3, observer); - }; + function commonSetupRegistry(registry) { + registry.optionsForType('component', { singleton: false }); + registry.optionsForType('view', { singleton: false }); - return release; - }, + registry.register('controller:basic', _emberRuntime.Controller, { instantiate: false }); - /** - Wraps a given model type and observes changes to it. - @private - @method wrapModelType - @param {Class} klass A model class. - @param {String} modelName Name of the class. - @return {Object} Contains the wrapped type and the function to remove observers - Format: - type: {Object} The wrapped type. - The wrapped type has the following format: - name: {String} The name of the type. - count: {Integer} The number of records available. - columns: {Columns} An array of columns to describe the record. - object: {Class} The actual Model type class. - release: {Function} The function to remove observers. - */ - wrapModelType: function (klass, name) { - var records = this.getRecords(klass, name); - var typeToSend = undefined; + registry.injection('view', '_viewRegistry', '-view-registry:main'); + registry.injection('renderer', '_viewRegistry', '-view-registry:main'); + registry.injection('event_dispatcher:main', '_viewRegistry', '-view-registry:main'); - typeToSend = { - name: name, - count: _emberMetal.get(records, 'length'), - columns: this.columnsForType(klass), - object: klass - }; + registry.injection('route', '_topLevelViewTemplate', 'template:-outlet'); - return typeToSend; - }, + registry.injection('view:-outlet', 'namespace', 'application:main'); - /** - Fetches all models defined in the application. - @private - @method getModelTypes - @return {Array} Array of model types. - */ - getModelTypes: function () { - var _this4 = this; + registry.injection('controller', 'target', 'router:main'); + registry.injection('controller', 'namespace', 'application:main'); - var containerDebugAdapter = this.get('containerDebugAdapter'); - var types = undefined; + registry.injection('router', '_bucketCache', _container.privatize(_templateObject)); + registry.injection('route', '_bucketCache', _container.privatize(_templateObject)); - if (containerDebugAdapter.canCatalogEntriesByType('model')) { - types = containerDebugAdapter.catalogEntriesByType('model'); - } else { - types = this._getObjectsOnNamespaces(); - } + registry.injection('route', 'router', 'router:main'); - // New adapters return strings instead of classes. - types = _emberRuntime.A(types).map(function (name) { - return { - klass: _this4._nameToClass(name), - name: name - }; - }); - types = _emberRuntime.A(types).filter(function (type) { - return _this4.detect(type.klass); - }); + // Register the routing service... + registry.register('service:-routing', _emberRouting.RoutingService); + // Then inject the app router into it + registry.injection('service:-routing', 'router', 'router:main'); - return _emberRuntime.A(types); - }, + // DEBUGGING + registry.register('resolver-for-debugging:main', registry.resolver, { instantiate: false }); + registry.injection('container-debug-adapter:main', 'resolver', 'resolver-for-debugging:main'); + registry.injection('data-adapter:main', 'containerDebugAdapter', 'container-debug-adapter:main'); + // Custom resolver authors may want to register their own ContainerDebugAdapter with this key - /** - Loops over all namespaces and all objects - attached to them. - @private - @method _getObjectsOnNamespaces - @return {Array} Array of model type strings. - */ - _getObjectsOnNamespaces: function () { - var _this5 = this; + registry.register('container-debug-adapter:main', _emberExtensionSupport.ContainerDebugAdapter); - var namespaces = _emberRuntime.A(_emberRuntime.Namespace.NAMESPACES); - var types = _emberRuntime.A(); + registry.register('component-lookup:main', _emberViews.ComponentLookup); + } - namespaces.forEach(function (namespace) { - for (var key in namespace) { - if (!namespace.hasOwnProperty(key)) { - continue; - } - // Even though we will filter again in `getModelTypes`, - // we should not call `lookupFactory` on non-models - // (especially when `EmberENV.MODEL_FACTORY_INJECTIONS` is `true`) - if (!_this5.detect(namespace[key])) { - continue; - } - var _name = _emberRuntime.String.dasherize(key); - if (!(namespace instanceof _emberApplication.Application) && namespace.toString()) { - _name = namespace + '/' + _name; - } - types.push(_name); - } - }); - return types; - }, + exports.default = Engine; +}); +enifed('ember-application/system/resolver', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-application/utils/validate-type', 'ember-glimmer'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberApplicationUtilsValidateType, _emberGlimmer) { + /** + @module ember + @submodule ember-application + */ - /** - Fetches all loaded records for a given type. - @private - @method getRecords - @return {Array} An array of records. - This array will be observed for changes, - so it should update when new records are added/removed. - */ - getRecords: function (type) { - return _emberRuntime.A(); - }, + 'use strict'; - /** - Wraps a record and observers changes to it. - @private - @method wrapRecord - @param {Object} record The record instance. - @return {Object} The wrapped record. Format: - columnValues: {Array} - searchKeywords: {Array} + var Resolver = _emberRuntime.Object.extend({ + /* + This will be set to the Application instance when it is + created. + @property namespace */ - wrapRecord: function (record) { - var recordToSend = { object: record }; - - recordToSend.columnValues = this.getRecordColumnValues(record); - recordToSend.searchKeywords = this.getRecordKeywords(record); - recordToSend.filterValues = this.getRecordFilterValues(record); - recordToSend.color = this.getRecordColor(record); - - return recordToSend; - }, - - /** - Gets the values for each column. - @private - @method getRecordColumnValues - @return {Object} Keys should match column names defined - by the model type. - */ - getRecordColumnValues: function (record) { - return {}; - }, - - /** - Returns keywords to match when searching records. - @private - @method getRecordKeywords - @return {Array} Relevant keywords for search. - */ - getRecordKeywords: function (record) { - return _emberRuntime.A(); - }, - - /** - Returns the values of filters defined by `getFilters`. - @private - @method getRecordFilterValues - @param {Object} record The record instance. - @return {Object} The filter values. - */ - getRecordFilterValues: function (record) { - return {}; - }, - - /** - Each record can have a color that represents its state. - @private - @method getRecordColor - @param {Object} record The record instance - @return {String} The records color. - Possible options: black, red, blue, green. - */ - getRecordColor: function (record) { - return null; - }, - - /** - Observes all relevant properties and re-sends the wrapped record - when a change occurs. - @private - @method observerRecord - @param {Object} record The record instance. - @param {Function} recordUpdated The callback to call when a record is updated. - @return {Function} The function to call to remove all observers. - */ - observeRecord: function (record, recordUpdated) { - return function () {}; - } + namespace: null, + normalize: null, // required + resolve: null, // required + parseName: null, // required + lookupDescription: null, // required + makeToString: null, // required + resolveOther: null, // required + _logLookup: null // required }); -}); -enifed('ember-extension-support/index', ['exports', 'ember-extension-support/data_adapter', 'ember-extension-support/container_debug_adapter'], function (exports, _emberExtensionSupportData_adapter, _emberExtensionSupportContainer_debug_adapter) { - /** - @module ember - @submodule ember-extension-support - */ - - 'use strict'; - - exports.DataAdapter = _emberExtensionSupportData_adapter.default; - exports.ContainerDebugAdapter = _emberExtensionSupportContainer_debug_adapter.default; -}); -enifed('ember-glimmer/component', ['exports', 'ember-utils', 'ember-views', 'ember-runtime', 'ember-metal', 'ember-glimmer/utils/references', 'glimmer-reference', 'glimmer-runtime'], function (exports, _emberUtils, _emberViews, _emberRuntime, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference, _glimmerRuntime) { - 'use strict'; - - var _CoreView$extend; - - var DIRTY_TAG = _emberUtils.symbol('DIRTY_TAG'); - exports.DIRTY_TAG = DIRTY_TAG; - var ARGS = _emberUtils.symbol('ARGS'); - exports.ARGS = ARGS; - var ROOT_REF = _emberUtils.symbol('ROOT_REF'); - exports.ROOT_REF = ROOT_REF; - var IS_DISPATCHING_ATTRS = _emberUtils.symbol('IS_DISPATCHING_ATTRS'); - exports.IS_DISPATCHING_ATTRS = IS_DISPATCHING_ATTRS; - var HAS_BLOCK = _emberUtils.symbol('HAS_BLOCK'); - exports.HAS_BLOCK = HAS_BLOCK; - var BOUNDS = _emberUtils.symbol('BOUNDS'); - - exports.BOUNDS = BOUNDS; - /** - @module ember - @submodule ember-glimmer - */ + exports.Resolver = Resolver; /** - An `Ember.Component` is a view that is completely - isolated. Properties accessed in its templates go - to the view object and actions are targeted at - the view object. There is no access to the - surrounding context or outer controller; all - contextual information must be passed in. - - The easiest way to create an `Ember.Component` is via - a template. If you name a template - `components/my-foo`, you will be able to use - `{{my-foo}}` in other templates, which will make - an instance of the isolated component. + The DefaultResolver defines the default lookup rules to resolve + container lookups before consulting the container for registered + items: - ```handlebars - {{app-profile person=currentUser}} - ``` + * templates are looked up on `Ember.TEMPLATES` + * other names are looked up on the application after converting + the name. For example, `controller:post` looks up + `App.PostController` by default. + * there are some nuances (see examples below) - ```handlebars - -

    {{person.title}}

    - -

    {{person.signature}}

    - ``` + ### How Resolving Works - You can use `yield` inside a template to - include the **contents** of any block attached to - the component. The block will be executed in the - context of the surrounding context or outer controller: + The container calls this object's `resolve` method with the + `fullName` argument. - ```handlebars - {{#app-profile person=currentUser}} -

    Admin mode

    - {{! Executed in the controller's context. }} - {{/app-profile}} - ``` + It first parses the fullName into an object using `parseName`. - ```handlebars - -

    {{person.title}}

    - {{! Executed in the component's context. }} - {{yield}} {{! block contents }} - ``` + Then it checks for the presence of a type-specific instance + method of the form `resolve[Type]` and calls it if it exists. + For example if it was resolving 'template:post', it would call + the `resolveTemplate` method. - If you want to customize the component, in order to - handle events or actions, you implement a subclass - of `Ember.Component` named after the name of the - component. Note that `Component` needs to be appended to the name of - your subclass like `AppProfileComponent`. + Its last resort is to call the `resolveOther` method. - For example, you could implement the action - `hello` for the `app-profile` component: + The methods of this object are designed to be easy to override + in a subclass. For example, you could enhance how a template + is resolved like so: ```javascript - App.AppProfileComponent = Ember.Component.extend({ - actions: { - hello: function(name) { - console.log("Hello", name); + App = Ember.Application.create({ + Resolver: Ember.DefaultResolver.extend({ + resolveTemplate: function(parsedName) { + let resolvedTemplate = this._super(parsedName); + if (resolvedTemplate) { return resolvedTemplate; } + return Ember.TEMPLATES['not_found']; } - } + }) }); ``` - And then use it in the component's template: + Some examples of how names are resolved: - ```handlebars - -

    {{person.title}}

    - {{yield}} - ``` - Components must have a `-` in their name to avoid - conflicts with built-in controls that wrap HTML - elements. This is consistent with the same - requirement in web components. + 'template:post' //=> Ember.TEMPLATES['post'] + 'template:posts/byline' //=> Ember.TEMPLATES['posts/byline'] + 'template:posts.byline' //=> Ember.TEMPLATES['posts/byline'] + 'template:blogPost' //=> Ember.TEMPLATES['blogPost'] + // OR + // Ember.TEMPLATES['blog_post'] + 'controller:post' //=> App.PostController + 'controller:posts.index' //=> App.PostsIndexController + 'controller:blog/post' //=> Blog.PostController + 'controller:basic' //=> Ember.Controller + 'route:post' //=> App.PostRoute + 'route:posts.index' //=> App.PostsIndexRoute + 'route:blog/post' //=> Blog.PostRoute + 'route:basic' //=> Ember.Route + 'view:post' //=> App.PostView + 'view:posts.index' //=> App.PostsIndexView + 'view:blog/post' //=> Blog.PostView + 'view:basic' //=> Ember.View + 'foo:post' //=> App.PostFoo + 'model:post' //=> App.Post + ``` - @class Component + @class DefaultResolver @namespace Ember - @extends Ember.CoreView - @uses Ember.TargetActionSupport - @uses Ember.ClassNamesSupport - @uses Ember.ActionSupport - @uses Ember.ViewMixin + @extends Ember.Object @public */ - var Component = _emberViews.CoreView.extend(_emberViews.ChildViewsSupport, _emberViews.ViewStateSupport, _emberViews.ClassNamesSupport, _emberRuntime.TargetActionSupport, _emberViews.ActionSupport, _emberViews.ViewMixin, (_CoreView$extend = { - isComponent: true, + + exports.default = _emberRuntime.Object.extend({ + /** + This will be set to the Application instance when it is + created. + @property namespace + @public + */ + namespace: null, init: function () { - var _this = this; + this._parseNameCache = _emberUtils.dictionary(null); + }, + normalize: function (fullName) { + var _fullName$split = fullName.split(':', 2); - this._super.apply(this, arguments); - this[IS_DISPATCHING_ATTRS] = false; - this[DIRTY_TAG] = new _glimmerReference.DirtyableTag(); - this[ROOT_REF] = new _emberGlimmerUtilsReferences.RootReference(this); - this[BOUNDS] = null; + var type = _fullName$split[0]; + var name = _fullName$split[1]; - // If a `defaultLayout` was specified move it to the `layout` prop. - // `layout` is no longer a CP, so this just ensures that the `defaultLayout` - // logic is supported with a deprecation - if (this.defaultLayout && !this.layout) { - _emberMetal.deprecate('Specifying `defaultLayout` to ' + this + ' is deprecated. Please use `layout` instead.', false, { - id: 'ember-views.component.defaultLayout', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-component-defaultlayout' - }); + _emberMetal.assert('Tried to normalize a container name without a colon (:) in it. ' + 'You probably tried to lookup a name that did not contain a type, ' + 'a colon, and a name. A proper lookup name would be `view:post`.', fullName.split(':').length === 2); - this.layout = this.defaultLayout; - } + if (type !== 'template') { + var result = name; - // If in a tagless component, assert that no event handlers are defined - _emberMetal.assert('You can not define a function that handles DOM events in the `' + this + '` tagless component since it doesn\'t have any DOM element.', this.tagName !== '' || !this.renderer._destinedForDOM || !(function () { - var eventDispatcher = _emberUtils.getOwner(_this).lookup('event_dispatcher:main'); - var events = eventDispatcher && eventDispatcher._finalEvents || {}; + if (result.indexOf('.') > -1) { + result = result.replace(/\.(.)/g, function (m) { + return m.charAt(1).toUpperCase(); + }); + } - for (var key in events) { - var methodName = events[key]; + if (name.indexOf('_') > -1) { + result = result.replace(/_(.)/g, function (m) { + return m.charAt(1).toUpperCase(); + }); + } - if (typeof _this[methodName] === 'function') { - return true; // indicate that the assertion should be triggered - } + if (name.indexOf('-') > -1) { + result = result.replace(/-(.)/g, function (m) { + return m.charAt(1).toUpperCase(); + }); } - })()); - }, - rerender: function () { - this[DIRTY_TAG].dirty(); - this._super(); + return type + ':' + result; + } else { + return fullName; + } }, - __defineNonEnumerable: function (property) { - this[property.name] = property.descriptor.value; - } + /** + This method is called via the container's resolver method. + It parses the provided `fullName` and then looks up and + returns the appropriate template or class. + @method resolve + @param {String} fullName the lookup string + @return {Object} the resolved factory + @public + */ + resolve: function (fullName) { + var _this = this; - }, _CoreView$extend[_emberMetal.PROPERTY_DID_CHANGE] = function (key) { - if (this[IS_DISPATCHING_ATTRS]) { - return; - } + var parsedName = this.parseName(fullName); + var resolveMethodName = parsedName.resolveMethodName; + var resolved = undefined; - var args = undefined, - reference = undefined; + if (this[resolveMethodName]) { + resolved = this[resolveMethodName](parsedName); + } - if ((args = this[ARGS]) && (reference = args[key])) { - if (reference[_emberGlimmerUtilsReferences.UPDATE]) { - reference[_emberGlimmerUtilsReferences.UPDATE](_emberMetal.get(this, key)); + resolved = resolved || this.resolveOther(parsedName); + + _emberMetal.runInDebug(function () { + if (parsedName.root && parsedName.root.LOG_RESOLVER) { + _this._logLookup(resolved, parsedName); + } + }); + + if (resolved) { + _emberApplicationUtilsValidateType.default(resolved, parsedName); } - } - }, _CoreView$extend.getAttr = function (key) { - // TODO Intimate API should be deprecated - return this.get(key); - }, _CoreView$extend.readDOMAttr = function (name) { - var element = _emberViews.getViewElement(this); - return _glimmerRuntime.readDOMAttr(element, name); - }, _CoreView$extend)); - /** - The WAI-ARIA role of the control represented by this view. For example, a - button may have a role of type 'button', or a pane may have a role of - type 'alertdialog'. This property is used by assistive software to help - visually challenged users navigate rich web applications. - The full list of valid WAI-ARIA roles is available at: - [http://www.w3.org/TR/wai-aria/roles#roles_categorization](http://www.w3.org/TR/wai-aria/roles#roles_categorization) - @property ariaRole - @type String - @default null - @public - */ + return resolved; + }, - /** - Enables components to take a list of parameters as arguments. - For example, a component that takes two parameters with the names - `name` and `age`: - ```javascript - let MyComponent = Ember.Component.extend; - MyComponent.reopenClass({ - positionalParams: ['name', 'age'] - }); - ``` - It can then be invoked like this: - ```hbs - {{my-component "John" 38}} - ``` - The parameters can be referred to just like named parameters: - ```hbs - Name: {{attrs.name}}, Age: {{attrs.age}}. - ``` - Using a string instead of an array allows for an arbitrary number of - parameters: - ```javascript - let MyComponent = Ember.Component.extend; - MyComponent.reopenClass({ - positionalParams: 'names' - }); - ``` - It can then be invoked like this: - ```hbs - {{my-component "John" "Michael" "Scott"}} - ``` - The parameters can then be referred to by enumerating over the list: - ```hbs - {{#each attrs.names as |name|}}{{name}}{{/each}} - ``` - @static - @public - @property positionalParams - @since 1.13.0 - */ + /** + Convert the string name of the form 'type:name' to + a Javascript object with the parsed aspects of the name + broken out. + @param {String} fullName the lookup string + @method parseName + @protected + */ - /** - Called when the attributes passed into the component have been updated. - Called both during the initial render of a container and during a rerender. - Can be used in place of an observer; code placed here will be executed - every time any attribute updates. - @method didReceiveAttrs - @public - @since 1.13.0 - */ + parseName: function (fullName) { + return this._parseNameCache[fullName] || (this._parseNameCache[fullName] = this._parseName(fullName)); + }, - /** - Called when the attributes passed into the component have been updated. - Called both during the initial render of a container and during a rerender. - Can be used in place of an observer; code placed here will be executed - every time any attribute updates. - @event didReceiveAttrs - @public - @since 1.13.0 - */ + _parseName: function (fullName) { + var _fullName$split2 = fullName.split(':'); - /** - Called after a component has been rendered, both on initial render and - in subsequent rerenders. - @method didRender - @public - @since 1.13.0 - */ + var type = _fullName$split2[0]; + var fullNameWithoutType = _fullName$split2[1]; - /** - Called after a component has been rendered, both on initial render and - in subsequent rerenders. - @event didRender - @public - @since 1.13.0 - */ + var name = fullNameWithoutType; + var namespace = _emberMetal.get(this, 'namespace'); + var root = namespace; + var lastSlashIndex = name.lastIndexOf('/'); + var dirname = lastSlashIndex !== -1 ? name.slice(0, lastSlashIndex) : null; - /** - Called before a component has been rendered, both on initial render and - in subsequent rerenders. - @method willRender - @public - @since 1.13.0 - */ + if (type !== 'template' && lastSlashIndex !== -1) { + var parts = name.split('/'); + name = parts[parts.length - 1]; + var namespaceName = _emberRuntime.String.capitalize(parts.slice(0, -1).join('.')); + root = _emberRuntime.Namespace.byName(namespaceName); - /** - Called before a component has been rendered, both on initial render and - in subsequent rerenders. - @event willRender - @public - @since 1.13.0 - */ + _emberMetal.assert('You are looking for a ' + name + ' ' + type + ' in the ' + namespaceName + ' namespace, but the namespace could not be found', root); + } - /** - Called when the attributes passed into the component have been changed. - Called only during a rerender, not during an initial render. - @method didUpdateAttrs - @public - @since 1.13.0 - */ + var resolveMethodName = fullNameWithoutType === 'main' ? 'Main' : _emberRuntime.String.classify(type); - /** - Called when the attributes passed into the component have been changed. - Called only during a rerender, not during an initial render. - @event didUpdateAttrs - @public - @since 1.13.0 - */ + if (!(name && type)) { + throw new TypeError('Invalid fullName: `' + fullName + '`, must be of the form `type:name` '); + } - /** - Called when the component is about to update and rerender itself. - Called only during a rerender, not during an initial render. - @method willUpdate - @public - @since 1.13.0 - */ + return { + fullName: fullName, + type: type, + fullNameWithoutType: fullNameWithoutType, + dirname: dirname, + name: name, + root: root, + resolveMethodName: 'resolve' + resolveMethodName + }; + }, - /** - Called when the component is about to update and rerender itself. - Called only during a rerender, not during an initial render. - @event willUpdate - @public - @since 1.13.0 - */ + /** + 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. + @param {String} fullName the lookup string + @method lookupDescription + @protected + */ + lookupDescription: function (fullName) { + var parsedName = this.parseName(fullName); + var description = undefined; - /** - Called when the component has updated and rerendered itself. - Called only during a rerender, not during an initial render. - @method didUpdate - @public - @since 1.13.0 - */ + if (parsedName.type === 'template') { + return 'template at ' + parsedName.fullNameWithoutType.replace(/\./g, '/'); + } - /** - Called when the component has updated and rerendered itself. - Called only during a rerender, not during an initial render. - @event didUpdate - @public - @since 1.13.0 - */ + description = parsedName.root + '.' + _emberRuntime.String.classify(parsedName.name).replace(/\./g, ''); - /** - If `false`, the view will appear hidden in DOM. - @property isVisible - @type Boolean - @default null - @public - */ - Component[_emberMetal.NAME_KEY] = 'Ember.Component'; + if (parsedName.type !== 'model') { + description += _emberRuntime.String.classify(parsedName.type); + } - Component.reopenClass({ - isComponentFactory: true, - positionalParams: [] - }); + return description; + }, - exports.default = Component; -}); + makeToString: function (factory, fullName) { + return factory.toString(); + }, -/** - Normally, Ember's component model is "write-only". The component takes a - bunch of attributes that it got passed in, and uses them to render its - template. - One nice thing about this model is that if you try to set a value to the - same thing as last time, Ember (through HTMLBars) will avoid doing any - work on the DOM. - This is not just a performance optimization. If an attribute has not - changed, it is important not to clobber the element's "hidden state". - For example, if you set an input's `value` to the same value as before, - it will clobber selection state and cursor position. In other words, - setting an attribute is not **always** idempotent. - This method provides a way to read an element's attribute and also - update the last value Ember knows about at the same time. This makes - setting an attribute idempotent. - In particular, what this means is that if you get an `` element's - `value` attribute and then re-render the template with the same value, - it will avoid clobbering the cursor and selection position. - Since most attribute sets are idempotent in the browser, you typically - can get away with reading attributes using jQuery, but the most reliable - way to do so is through this method. - @method readDOMAttr - @param {String} name the name of the attribute - @return String - @public - */ -enifed('ember-glimmer/components/checkbox', ['exports', 'ember-metal', 'ember-glimmer/component', 'ember-glimmer/templates/empty'], function (exports, _emberMetal, _emberGlimmerComponent, _emberGlimmerTemplatesEmpty) { - 'use strict'; + /** + Given a parseName object (output from `parseName`), apply + the conventions expected by `Ember.Router` + @param {Object} parsedName a parseName object with the parsed + fullName lookup string + @method useRouterNaming + @protected + */ + useRouterNaming: function (parsedName) { + parsedName.name = parsedName.name.replace(/\./g, '_'); + if (parsedName.name === 'basic') { + parsedName.name = ''; + } + }, + /** + Look up the template in Ember.TEMPLATES + @param {Object} parsedName a parseName object with the parsed + fullName lookup string + @method resolveTemplate + @protected + */ + resolveTemplate: function (parsedName) { + var templateName = parsedName.fullNameWithoutType.replace(/\./g, '/'); + + return _emberGlimmer.getTemplate(templateName) || _emberGlimmer.getTemplate(_emberRuntime.String.decamelize(templateName)); + }, + + /** + Lookup the view using `resolveOther` + @param {Object} parsedName a parseName object with the parsed + fullName lookup string + @method resolveView + @protected + */ + resolveView: function (parsedName) { + this.useRouterNaming(parsedName); + return this.resolveOther(parsedName); + }, + + /** + Lookup the controller using `resolveOther` + @param {Object} parsedName a parseName object with the parsed + fullName lookup string + @method resolveController + @protected + */ + resolveController: function (parsedName) { + this.useRouterNaming(parsedName); + return this.resolveOther(parsedName); + }, + /** + Lookup the route using `resolveOther` + @param {Object} parsedName a parseName object with the parsed + fullName lookup string + @method resolveRoute + @protected + */ + resolveRoute: function (parsedName) { + this.useRouterNaming(parsedName); + return this.resolveOther(parsedName); + }, + + /** + Lookup the model on the Application namespace + @param {Object} parsedName a parseName object with the parsed + fullName lookup string + @method resolveModel + @protected + */ + resolveModel: function (parsedName) { + var className = _emberRuntime.String.classify(parsedName.name); + var factory = _emberMetal.get(parsedName.root, className); + + return factory; + }, + /** + Look up the specified object (from parsedName) on the appropriate + namespace (usually on the Application) + @param {Object} parsedName a parseName object with the parsed + fullName lookup string + @method resolveHelper + @protected + */ + resolveHelper: function (parsedName) { + return this.resolveOther(parsedName); + }, + /** + Look up the specified object (from parsedName) on the appropriate + namespace (usually on the Application) + @param {Object} parsedName a parseName object with the parsed + fullName lookup string + @method resolveOther + @protected + */ + resolveOther: function (parsedName) { + var className = _emberRuntime.String.classify(parsedName.name) + _emberRuntime.String.classify(parsedName.type); + var factory = _emberMetal.get(parsedName.root, className); + return factory; + }, + + resolveMain: function (parsedName) { + var className = _emberRuntime.String.classify(parsedName.type); + return _emberMetal.get(parsedName.root, className); + }, + + /** + @method _logLookup + @param {Boolean} found + @param {Object} parsedName + @private + */ + _logLookup: function (found, parsedName) { + var symbol = undefined, + padding = undefined; + + if (found) { + symbol = '[✓]'; + } else { + symbol = '[ ]'; + } + + if (parsedName.fullName.length > 60) { + padding = '.'; + } else { + padding = new Array(60 - parsedName.fullName.length).join('.'); + } + + _emberMetal.info(symbol, parsedName.fullName, padding, this.lookupDescription(parsedName.fullName)); + }, + + /** + Used to iterate all items of a given type. + @method knownForType + @param {String} type the type to search for + @private + */ + knownForType: function (type) { + var namespace = _emberMetal.get(this, 'namespace'); + var suffix = _emberRuntime.String.classify(type); + var typeRegexp = new RegExp(suffix + '$'); + + var known = _emberUtils.dictionary(null); + var knownKeys = Object.keys(namespace); + for (var index = 0; index < knownKeys.length; index++) { + var _name = knownKeys[index]; + + if (typeRegexp.test(_name)) { + var containerName = this.translateToContainerFullname(type, _name); + + known[containerName] = true; + } + } + + return known; + }, + + /** + Converts provided name from the backing namespace into a container lookup name. + Examples: + App.FooBarHelper -> helper:foo-bar + App.THelper -> helper:t + @method translateToContainerFullname + @param {String} type + @param {String} name + @private + */ + + translateToContainerFullname: function (type, name) { + var suffix = _emberRuntime.String.classify(type); + var namePrefix = name.slice(0, suffix.length * -1); + var dasherizedName = _emberRuntime.String.dasherize(namePrefix); + return type + ':' + dasherizedName; + } + }); +}); +enifed('ember-application/utils/validate-type', ['exports', 'ember-metal'], function (exports, _emberMetal) { /** @module ember - @submodule ember-views + @submodule ember-application */ + 'use strict'; + + exports.default = validateType; + + var VALIDATED_TYPES = { + route: ['assert', 'isRouteFactory', 'Ember.Route'], + component: ['deprecate', 'isComponentFactory', 'Ember.Component'], + view: ['deprecate', 'isViewFactory', 'Ember.View'], + service: ['deprecate', 'isServiceFactory', 'Ember.Service'] + }; + + function validateType(resolvedType, parsedName) { + var validationAttributes = VALIDATED_TYPES[parsedName.type]; + + if (!validationAttributes) { + return; + } + + var action = validationAttributes[0]; + var factoryFlag = validationAttributes[1]; + var expectedType = validationAttributes[2]; + + if (action === 'deprecate') { + _emberMetal.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 { + _emberMetal.assert('Expected ' + parsedName.fullName + ' to resolve to an ' + expectedType + ' but ' + ('instead it was ' + resolvedType + '.'), !!resolvedType[factoryFlag]); + } + } +}); +enifed('ember-console/index', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { + 'use strict'; + + function K() {} + + function consoleMethod(name) { + var consoleObj = undefined; + if (_emberEnvironment.context.imports.console) { + consoleObj = _emberEnvironment.context.imports.console; + } else if (typeof console !== 'undefined') { + consoleObj = console; + } + + var method = typeof consoleObj === 'object' ? consoleObj[name] : null; + + if (typeof method !== 'function') { + return; + } + + if (typeof method.bind === 'function') { + return method.bind(consoleObj); + } + + return function () { + method.apply(consoleObj, arguments); + }; + } + + function assertPolyfill(test, message) { + if (!test) { + try { + // attempt to preserve the stack + throw new Error('assertion failed: ' + message); + } catch (error) { + setTimeout(function () { + throw error; + }, 0); + } + } + } + /** - The internal class used to create text inputs when the `{{input}}` - helper is used with `type` of `checkbox`. - - See [Ember.Templates.helpers.input](/api/classes/Ember.Templates.helpers.html#method_input) for usage details. - - ## Direct manipulation of `checked` - - The `checked` attribute of an `Ember.Checkbox` object should always be set - through the Ember object or by interacting with its rendered element - representation via the mouse, keyboard, or touch. Updating the value of the - checkbox via jQuery will result in the checked value of the object and its - element losing synchronization. - - ## Layout and LayoutName properties - - Because HTML `input` elements are self closing `layout` and `layoutName` - properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s - layout section for more information. + Inside Ember-Metal, simply uses the methods from `imports.console`. + Override this to provide more robust logging functionality. - @class Checkbox + @class Logger @namespace Ember - @extends Ember.Component @public */ - exports.default = _emberGlimmerComponent.default.extend({ - layout: _emberGlimmerTemplatesEmpty.default, - classNames: ['ember-checkbox'], + 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. + ```javascript + var foo = 1; + Ember.Logger.log('log value of foo:', foo); + // "log value of foo: 1" will be printed to the console + ``` + @method log + @for Ember.Logger + @param {*} arguments + @public + */ + log: consoleMethod('log') || K, - tagName: 'input', + /** + Prints the arguments to the console with a warning icon. + You can pass as many arguments as you want and they will be joined together with a space. + ```javascript + Ember.Logger.warn('Something happened!'); + // "Something happened!" will be printed to the console with a warning icon. + ``` + @method warn + @for Ember.Logger + @param {*} arguments + @public + */ + warn: consoleMethod('warn') || K, - attributeBindings: ['type', 'checked', 'indeterminate', 'disabled', 'tabindex', 'name', 'autofocus', 'required', 'form'], + /** + Prints the arguments to the console with an error icon, red text and a stack trace. + You can pass as many arguments as you want and they will be joined together with a space. + ```javascript + Ember.Logger.error('Danger! Danger!'); + // "Danger! Danger!" will be printed to the console in red text. + ``` + @method error + @for Ember.Logger + @param {*} arguments + @public + */ + error: consoleMethod('error') || K, - type: 'checkbox', - checked: false, - disabled: false, - indeterminate: false, + /** + Logs the arguments to the console. + You can pass as many arguments as you want and they will be joined together with a space. + ```javascript + var foo = 1; + Ember.Logger.info('log value of foo:', foo); + // "log value of foo: 1" will be printed to the console + ``` + @method info + @for Ember.Logger + @param {*} arguments + @public + */ + info: consoleMethod('info') || K, - didInsertElement: function () { - this._super.apply(this, arguments); - _emberMetal.get(this, 'element').indeterminate = !!_emberMetal.get(this, 'indeterminate'); - }, + /** + Logs the arguments to the console in blue text. + You can pass as many arguments as you want and they will be joined together with a space. + ```javascript + var foo = 1; + Ember.Logger.debug('log value of foo:', foo); + // "log value of foo: 1" will be printed to the console + ``` + @method debug + @for Ember.Logger + @param {*} arguments + @public + */ + debug: consoleMethod('debug') || consoleMethod('info') || K, - change: function () { - _emberMetal.set(this, 'checked', this.$().prop('checked')); + /** + 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 + }; +}); +enifed('ember-debug/deprecate', ['exports', 'ember-metal', 'ember-console', 'ember-environment', 'ember-debug/handlers'], function (exports, _emberMetal, _emberConsole, _emberEnvironment, _emberDebugHandlers) { + /*global __fail__*/ + + 'use strict'; + + exports.registerHandler = registerHandler; + exports.default = deprecate; + + function registerHandler(handler) { + _emberDebugHandlers.registerHandler('deprecate', handler); + } + + function formatMessage(_message, options) { + var message = _message; + + if (options && options.id) { + message = message + (' [deprecation id: ' + options.id + ']'); + } + + if (options && options.url) { + message += ' See ' + options.url + ' for more details.'; + } + + return message; + } + + registerHandler(function logDeprecationToConsole(message, options) { + var updatedMessage = formatMessage(message, options); + + _emberConsole.default.warn('DEPRECATION: ' + updatedMessage); + }); + + var captureErrorForStack = undefined; + + if (new Error().stack) { + captureErrorForStack = function () { + return new Error(); + }; + } else { + captureErrorForStack = function () { + try { + __fail__.fail(); + } catch (e) { + return e; + } + }; + } + + registerHandler(function logDeprecationStackTrace(message, options, next) { + if (_emberEnvironment.ENV.LOG_STACKTRACE_ON_DEPRECATION) { + var stackStr = ''; + var error = captureErrorForStack(); + var stack = undefined; + + if (error.stack) { + if (error['arguments']) { + // Chrome + stack = error.stack.replace(/^\s+at\s+/gm, '').replace(/^([^\(]+?)([\n$])/gm, '{anonymous}($1)$2').replace(/^Object.\s*\(([^\)]+)\)/gm, '{anonymous}($1)').split('\n'); + stack.shift(); + } else { + // Firefox + stack = error.stack.replace(/(?:\n@:0)?\s+$/m, '').replace(/^\(/gm, '{anonymous}(').split('\n'); + } + + stackStr = '\n ' + stack.slice(2).join('\n '); + } + + var updatedMessage = formatMessage(message, options); + + _emberConsole.default.warn('DEPRECATION: ' + updatedMessage + stackStr); + } else { + next.apply(undefined, arguments); } }); -}); -enifed('ember-glimmer/components/link-to', ['exports', 'ember-console', 'ember-metal', 'ember-runtime', 'ember-views', 'ember-glimmer/templates/link-to', 'ember-glimmer/component'], function (exports, _emberConsole, _emberMetal, _emberRuntime, _emberViews, _emberGlimmerTemplatesLinkTo, _emberGlimmerComponent) { + + registerHandler(function raiseOnDeprecation(message, options, next) { + if (_emberEnvironment.ENV.RAISE_ON_DEPRECATION) { + var updatedMessage = formatMessage(message); + + throw new _emberMetal.Error(updatedMessage); + } else { + next.apply(undefined, arguments); + } + }); + + var missingOptionsDeprecation = 'When calling `Ember.deprecate` you ' + 'must provide an `options` hash as the third parameter. ' + '`options` should include `id` and `until` properties.'; + exports.missingOptionsDeprecation = missingOptionsDeprecation; + var missingOptionsIdDeprecation = 'When calling `Ember.deprecate` you must provide `id` in options.'; + exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation; + var missingOptionsUntilDeprecation = 'When calling `Ember.deprecate` you must provide `until` in options.'; + + exports.missingOptionsUntilDeprecation = missingOptionsUntilDeprecation; /** @module ember - @submodule ember-glimmer + @submodule ember-debug */ /** - The `{{link-to}}` component 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 - element: + Display a deprecation warning with the provided message and a stack trace + (Chrome and Firefox only). - ```handlebars - {{#link-to 'photoGallery'}} - Great Hamster Photos - {{/link-to}} - ``` + * In a production build, this method is defined as an empty function (NOP). + Uses of this method in Ember itself are stripped from the ember.prod.js build. - You can also use an inline form of `{{link-to}}` component by - passing the link text as the first argument - to the component: + @method deprecate + @param {String} message A description of the deprecation. + @param {Boolean} test A boolean. If falsy, the deprecation will be displayed. + @param {Object} options + @param {String} options.id A unique id for this deprecation. The id can be + used by Ember debugging tools to change the behavior (raise, log or silence) + for that specific deprecation. The id should be namespaced by dots, e.g. + "view.helper.select". + @param {string} options.until The version of Ember when this deprecation + warning will be removed. + @param {String} [options.url] An optional url to the transition guide on the + emberjs.com website. + @for Ember + @public + @since 1.0.0 + */ + + function deprecate(message, test, options) { + if (!options || !options.id && !options.until) { + deprecate(missingOptionsDeprecation, false, { + id: 'ember-debug.deprecate-options-missing', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' + }); + } + + if (options && !options.id) { + deprecate(missingOptionsIdDeprecation, false, { + id: 'ember-debug.deprecate-id-missing', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' + }); + } + + if (options && !options.until) { + deprecate(missingOptionsUntilDeprecation, options && options.until, { + id: 'ember-debug.deprecate-until-missing', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' + }); + } + + _emberDebugHandlers.invoke.apply(undefined, ['deprecate'].concat(babelHelpers.slice.call(arguments))); + } +}); +enifed("ember-debug/handlers", ["exports"], function (exports) { + "use strict"; + + exports.registerHandler = registerHandler; + exports.invoke = invoke; + var HANDLERS = {}; + + exports.HANDLERS = HANDLERS; + + function registerHandler(type, callback) { + var nextHandler = HANDLERS[type] || function () {}; + + HANDLERS[type] = function (message, options) { + callback(message, options, nextHandler); + }; + } + + function invoke(type, message, test, options) { + if (test) { + return; + } + + var handlerForType = HANDLERS[type]; + + if (!handlerForType) { + return; + } + + if (handlerForType) { + handlerForType(message, options); + } + } +}); +enifed('ember-debug/index', ['exports', 'ember-metal', 'ember-environment', 'ember-console', 'ember-debug/deprecate', 'ember-debug/warn'], function (exports, _emberMetal, _emberEnvironment, _emberConsole, _emberDebugDeprecate, _emberDebugWarn) { + 'use strict'; + + exports._warnIfUsingStrippedFeatureFlags = _warnIfUsingStrippedFeatureFlags; + + /** + @module ember + @submodule ember-debug + */ + + /** + @class Ember + @public + */ + + /** + Define an assertion that will throw an exception if the condition is not met. - ```handlebars - {{link-to 'Great Hamster Photos' 'photoGallery'}} - ``` + * In a production build, this method is defined as an empty function (NOP). + Uses of this method in Ember itself are stripped from the ember.prod.js build. - Both will result in: + ```javascript + // Test for truthiness + Ember.assert('Must pass a valid object', obj); - ```html - - Great Hamster Photos - + // Fail unconditionally + Ember.assert('This code path should never be run'); ``` - ### Supplying a tagName - By default `{{link-to}}` renders an `` element. This can - be overridden for a single use of `{{link-to}}` by supplying - a `tagName` option: + @method assert + @param {String} desc A description of the assertion. This will become + the text of the Error thrown if the assertion fails. + @param {Boolean} test Must be truthy for the assertion to pass. If + falsy, an exception will be thrown. + @public + @since 1.0.0 + */ + _emberMetal.setDebugFunction('assert', function assert(desc, test) { + if (!test) { + throw new _emberMetal.Error('Assertion Failed: ' + desc); + } + }); + + /** + Display a debug notice. - ```handlebars - {{#link-to 'photoGallery' tagName="li"}} - Great Hamster Photos - {{/link-to}} - ``` + * In a production build, this method is defined as an empty function (NOP). + Uses of this method in Ember itself are stripped from the ember.prod.js build. - ```html -
  • - Great Hamster Photos -
  • + ```javascript + Ember.debug('I\'m a debug notice!'); ``` - To override this option for your entire application, see - "Overriding Application-wide Defaults". + @method debug + @param {String} message A debug message to display. + @public + */ + _emberMetal.setDebugFunction('debug', function debug(message) { + _emberConsole.default.debug('DEBUG: ' + message); + }); + + /** + Display an info notice. - ### Disabling the `link-to` component - By default `{{link-to}}` is enabled. - any passed value to the `disabled` component property will disable - the `link-to` component. + * In a production build, this method is defined as an empty function (NOP). + Uses of this method in Ember itself are stripped from the ember.prod.js build. - static use: the `disabled` option: + @method info + @private + */ + _emberMetal.setDebugFunction('info', function info() { + _emberConsole.default.info.apply(undefined, arguments); + }); + + /** + Alias an old, deprecated method with its new counterpart. - ```handlebars - {{#link-to 'photoGallery' disabled=true}} - Great Hamster Photos - {{/link-to}} - ``` + Display a deprecation warning with the provided message and a stack trace + (Chrome and Firefox only) when the assigned method is called. - dynamic use: the `disabledWhen` option: + * In a production build, this method is defined as an empty function (NOP). - ```handlebars - {{#link-to 'photoGallery' disabledWhen=controller.someProperty}} - Great Hamster Photos - {{/link-to}} + ```javascript + Ember.oldMethod = Ember.deprecateFunc('Please use the new, updated method', Ember.newMethod); ``` - any passed value to `disabled` will disable it except `undefined`. - to ensure that only `true` disable the `link-to` component you can - override the global behaviour of `Ember.LinkComponent`. + @method deprecateFunc + @param {String} message A description of the deprecation. + @param {Object} [options] The options object for Ember.deprecate. + @param {Function} func The new function called to replace its deprecated counterpart. + @return {Function} A new function that wraps the original function with a deprecation warning + @private + */ + _emberMetal.setDebugFunction('deprecateFunc', function deprecateFunc() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + if (args.length === 3) { + var _ret = (function () { + var message = args[0]; + var options = args[1]; + var func = args[2]; + + return { + v: function () { + _emberMetal.deprecate(message, false, options); + return func.apply(this, arguments); + } + }; + })(); + + if (typeof _ret === 'object') return _ret.v; + } else { + var _ret2 = (function () { + var message = args[0]; + var func = args[1]; + + return { + v: function () { + _emberMetal.deprecate(message); + return func.apply(this, arguments); + } + }; + })(); + + if (typeof _ret2 === 'object') return _ret2.v; + } + }); + + /** + Run a function meant for debugging. + + * In a production build, this method is defined as an empty function (NOP). + Uses of this method in Ember itself are stripped from the ember.prod.js build. ```javascript - Ember.LinkComponent.reopen({ - disabled: Ember.computed(function(key, value) { - if (value !== undefined) { - this.set('_isDisabled', value === true); + Ember.runInDebug(() => { + Ember.Component.reopen({ + didInsertElement() { + console.log("I'm happy"); } - return value === true ? get(this, 'disabledClass') : false; - }) + }); }); ``` - see "Overriding Application-wide Defaults" for more. - - ### Handling `href` - `{{link-to}}` will use your application's Router to - fill the element's `href` property with a url that - matches the path to the supplied `routeName` for your - router's configured `Location` scheme, which defaults - to Ember.HashLocation. - - ### Handling current route - `{{link-to}}` will apply a CSS class name of 'active' - when the application's current route matches - the supplied routeName. For example, if the application's - current route is 'photoGallery.recent' the following - use of `{{link-to}}`: - - ```handlebars - {{#link-to 'photoGallery.recent'}} - Great Hamster Photos - {{/link-to}} - ``` - - will result in - - ```html -
    - Great Hamster Photos - - ``` - - The CSS class name used for active classes can be customized - for a single use of `{{link-to}}` by passing an `activeClass` - option: - - ```handlebars - {{#link-to 'photoGallery.recent' activeClass="current-url"}} - Great Hamster Photos - {{/link-to}} - ``` - - ```html - - Great Hamster Photos - - ``` - - To override this option for your entire application, see - "Overriding Application-wide Defaults". - - ### Keeping a link active for other routes - - If you need a link to be 'active' even when it doesn't match - the current route, you can use the `current-when` argument. - - ```handlebars - {{#link-to 'photoGallery' current-when='photos'}} - Photo Gallery - {{/link-to}} - ``` - - This may be helpful for keeping links active for: - - * non-nested routes that are logically related - * some secondary menu approaches - * 'top navigation' with 'sub navigation' scenarios - - A link will be active if `current-when` is `true` or the current - route is the route this link would transition to. - - To match multiple routes 'space-separate' the routes: + @method runInDebug + @param {Function} func The function to be executed. + @since 1.5.0 + @public + */ + _emberMetal.setDebugFunction('runInDebug', function runInDebug(func) { + func(); + }); + + _emberMetal.setDebugFunction('debugSeal', function debugSeal(obj) { + Object.seal(obj); + }); + + _emberMetal.setDebugFunction('debugFreeze', function debugFreeze(obj) { + Object.freeze(obj); + }); + + _emberMetal.setDebugFunction('deprecate', _emberDebugDeprecate.default); + + _emberMetal.setDebugFunction('warn', _emberDebugWarn.default); + + /** + Will call `Ember.warn()` if ENABLE_OPTIONAL_FEATURES or + any specific FEATURES flag is truthy. - ```handlebars - {{#link-to 'gallery' current-when='photos drawings paintings'}} - Art Gallery - {{/link-to}} - ``` + This method is called automatically in debug canary builds. - ### Supplying a model - An optional model argument can be used for routes whose - paths contain dynamic segments. This argument will become - the model context of the linked route: + @private + @method _warnIfUsingStrippedFeatureFlags + @return {void} + */ + + function _warnIfUsingStrippedFeatureFlags(FEATURES, knownFeatures, featuresWereStripped) { + if (featuresWereStripped) { + _emberMetal.warn('Ember.ENV.ENABLE_OPTIONAL_FEATURES is only available in canary builds.', !_emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES, { id: 'ember-debug.feature-flag-with-features-stripped' }); + + var keys = Object.keys(FEATURES || {}); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (key === 'isEnabled' || !(key in knownFeatures)) { + continue; + } + + _emberMetal.warn('FEATURE["' + key + '"] is set as enabled, but FEATURE flags are only available in canary builds.', !FEATURES[key], { id: 'ember-debug.feature-flag-with-features-stripped' }); + } + } + } + + if (!_emberMetal.isTesting()) { + (function () { + // Complain if they're using FEATURE flags in builds other than canary + _emberMetal.FEATURES['features-stripped-test'] = true; + var featuresWereStripped = true; + + if (_emberMetal.isFeatureEnabled('features-stripped-test')) { + featuresWereStripped = false; + } + + delete _emberMetal.FEATURES['features-stripped-test']; + _warnIfUsingStrippedFeatureFlags(_emberEnvironment.ENV.FEATURES, _emberMetal.DEFAULT_FEATURES, featuresWereStripped); + + // Inform the developer about the Ember Inspector if not installed. + var isFirefox = _emberEnvironment.environment.isFirefox; + var isChrome = _emberEnvironment.environment.isChrome; + + if (typeof window !== 'undefined' && (isFirefox || isChrome) && window.addEventListener) { + window.addEventListener('load', function () { + if (document.documentElement && document.documentElement.dataset && !document.documentElement.dataset.emberExtension) { + var downloadURL = undefined; + + if (isChrome) { + downloadURL = 'https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi'; + } else if (isFirefox) { + downloadURL = 'https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/'; + } + + _emberMetal.debug('For more advanced debugging, install the Ember Inspector from ' + downloadURL); + } + }, false); + } + })(); + } + /** + @public + @class Ember.Debug + */ + _emberMetal.default.Debug = {}; + + /** + Allows for runtime registration of handler functions that override the default deprecation behavior. + Deprecations are invoked by calls to [Ember.deprecate](http://emberjs.com/api/classes/Ember.html#method_deprecate). + The following example demonstrates its usage by registering a handler that throws an error if the + message contains the word "should", otherwise defers to the default handler. ```javascript - Router.map(function() { - this.route("photoGallery", {path: "hamster-photos/:photo_id"}); + Ember.Debug.registerDeprecationHandler((message, options, next) => { + if (message.indexOf('should') !== -1) { + throw new Error(`Deprecation message with should: ${message}`); + } else { + // defer to whatever handler was registered before this one + next(message, options); + } }); ``` - ```handlebars - {{#link-to 'photoGallery' aPhoto}} - {{aPhoto.title}} - {{/link-to}} - ``` + The handler function takes the following arguments: - ```html - - Tomster - - ``` +
      +
    • message - The message received from the deprecation call.
    • +
    • options - An object passed in with the deprecation call containing additional information including:
    • +
        +
      • id - An id of the deprecation in the form of package-name.specific-deprecation.
      • +
      • until - The Ember version number the feature and deprecation will be removed in.
      • +
      +
    • next - A function that calls into the previously registered handler.
    • +
    - ### Supplying multiple models - For deep-linking to route paths that contain multiple - dynamic segments, multiple model arguments can be used. - As the router transitions through the route path, each - supplied model argument will become the context for the - route with the dynamic segments: + @public + @static + @method registerDeprecationHandler + @param handler {Function} A function to handle deprecation calls. + @since 2.1.0 + */ + _emberMetal.default.Debug.registerDeprecationHandler = _emberDebugDeprecate.registerHandler; + /** + Allows for runtime registration of handler functions that override the default warning behavior. + Warnings are invoked by calls made to [Ember.warn](http://emberjs.com/api/classes/Ember.html#method_warn). + The following example demonstrates its usage by registering a handler that does nothing overriding Ember's + default warning behavior. ```javascript - Router.map(function() { - this.route("photoGallery", { path: "hamster-photos/:photo_id" }, function() { - this.route("comment", {path: "comments/:comment_id"}); - }); - }); + // next is not called, so no warnings get the default behavior + Ember.Debug.registerWarnHandler(() => {}); ``` - This argument will become the model context of the linked route: - ```handlebars - {{#link-to 'photoGallery.comment' aPhoto comment}} - {{comment.body}} - {{/link-to}} - ``` + The handler function takes the following arguments: - ```html - - A+++ would snuggle again. - - ``` +
      +
    • message - The message received from the warn call.
    • +
    • options - An object passed in with the warn call containing additional information including:
    • +
        +
      • id - An id of the warning in the form of package-name.specific-warning.
      • +
      +
    • next - A function that calls into the previously registered handler.
    • +
    - ### Supplying an explicit dynamic segment value - If you don't have a model object available to pass to `{{link-to}}`, - an optional string or integer argument can be passed for routes whose - paths contain dynamic segments. This argument will become the value - of the dynamic segment: - - ```javascript - Router.map(function() { - this.route("photoGallery", { path: "hamster-photos/:photo_id" }); - }); - ``` - - ```handlebars - {{#link-to 'photoGallery' aPhotoId}} - {{aPhoto.title}} - {{/link-to}} - ``` - - ```html - - Tomster - - ``` - - When transitioning into the linked route, the `model` hook will - be triggered with parameters including this passed identifier. - - ### Allowing Default Action - - By default the `{{link-to}}` component prevents the default browser action - by calling `preventDefault()` as this sort of action bubbling is normally - handled internally and we do not want to take the browser to a new URL (for - example). - - If you need to override this behavior specify `preventDefault=false` in - your template: + @public + @static + @method registerWarnHandler + @param handler {Function} A function to handle warnings. + @since 2.1.0 + */ + _emberMetal.default.Debug.registerWarnHandler = _emberDebugWarn.registerHandler; + + /* + We are transitioning away from `ember.js` to `ember.debug.js` to make + it much clearer that it is only for local development purposes. - ```handlebars - {{#link-to 'photoGallery' aPhotoId preventDefault=false}} - {{aPhotoId.title}} - {{/link-to}} - ``` + This flag value is changed by the tooling (by a simple string replacement) + so that if `ember.js` (which must be output for backwards compat reasons) is + used a nice helpful warning message will be printed out. + */ + var runningNonEmberDebugJS = true; + exports.runningNonEmberDebugJS = runningNonEmberDebugJS; + if (runningNonEmberDebugJS) { + _emberMetal.warn('Please use `ember.debug.js` instead of `ember.js` for development and debugging.'); + } +}); +// reexports +enifed('ember-debug/warn', ['exports', 'ember-console', 'ember-metal', 'ember-debug/handlers'], function (exports, _emberConsole, _emberMetal, _emberDebugHandlers) { + 'use strict'; + + exports.registerHandler = registerHandler; + exports.default = warn; + + function registerHandler(handler) { + _emberDebugHandlers.registerHandler('warn', handler); + } + + registerHandler(function logWarning(message, options) { + _emberConsole.default.warn('WARNING: ' + message); + if ('trace' in _emberConsole.default) { + _emberConsole.default.trace(); + } + }); + + var missingOptionsDeprecation = 'When calling `Ember.warn` you ' + 'must provide an `options` hash as the third parameter. ' + '`options` should include an `id` property.'; + exports.missingOptionsDeprecation = missingOptionsDeprecation; + var missingOptionsIdDeprecation = 'When calling `Ember.warn` you must provide `id` in options.'; + + exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation; + /** + @module ember + @submodule ember-debug + */ + + /** + Display a warning with the provided message. - ### Overriding attributes - You can override any given property of the `Ember.LinkComponent` - that is generated by the `{{link-to}}` component by passing - key/value pairs, like so: + * In a production build, this method is defined as an empty function (NOP). + Uses of this method in Ember itself are stripped from the ember.prod.js build. - ```handlebars - {{#link-to aPhoto tagName='li' title='Following this link will change your life' classNames='pic sweet'}} - Uh-mazing! - {{/link-to}} - ``` + @method warn + @param {String} message A warning to display. + @param {Boolean} test An optional boolean. If falsy, the warning + will be displayed. + @param {Object} options An object that can be used to pass a unique + `id` for this warning. The `id` can be used by Ember debugging tools + to change the behavior (raise, log, or silence) for that specific warning. + The `id` should be namespaced by dots, e.g. "ember-debug.feature-flag-with-features-stripped" + @for Ember + @public + @since 1.0.0 + */ + + function warn(message, test, options) { + if (!options) { + _emberMetal.deprecate(missingOptionsDeprecation, false, { + id: 'ember-debug.warn-options-missing', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' + }); + } + + if (options && !options.id) { + _emberMetal.deprecate(missingOptionsIdDeprecation, false, { + id: 'ember-debug.warn-id-missing', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options' + }); + } + + _emberDebugHandlers.invoke.apply(undefined, ['warn'].concat(babelHelpers.slice.call(arguments))); + } +}); +enifed('ember-environment/global', ['exports'], function (exports) { + /* globals global, window, self, mainContext */ + + // from lodash to catch fake globals + 'use strict'; + + function checkGlobal(value) { + return value && value.Object === Object ? value : undefined; + } + + // element ids can ruin global miss checks + function checkElementIdShadowing(value) { + return value && value.nodeType === undefined ? value : undefined; + } + + // export real global + exports.default = checkGlobal(checkElementIdShadowing(typeof global === 'object' && global)) || checkGlobal(typeof self === 'object' && self) || checkGlobal(typeof window === 'object' && window) || mainContext || // set before strict mode in Ember loader/wrapper + new Function('return this')(); + // eval outside of strict mode +}); +enifed('ember-environment/index', ['exports', 'ember-environment/global', 'ember-environment/utils'], function (exports, _emberEnvironmentGlobal, _emberEnvironmentUtils) { + /* globals module */ + 'use strict'; + + /** + 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 + backwards compatibility with earlier versions of Ember). The `EmberENV` + hash must be created before loading Ember. - See [Ember.LinkComponent](/api/classes/Ember.LinkComponent.html) for a - complete list of overrideable properties. Be sure to also - check out inherited properties of `LinkComponent`. + @class EmberENV + @type Object + @public + */ + var ENV = typeof _emberEnvironmentGlobal.default.EmberENV === 'object' && _emberEnvironmentGlobal.default.EmberENV || typeof _emberEnvironmentGlobal.default.ENV === 'object' && _emberEnvironmentGlobal.default.ENV || {}; + + exports.ENV = ENV; + // ENABLE_ALL_FEATURES was documented, but you can't actually enable non optional features. + if (ENV.ENABLE_ALL_FEATURES) { + ENV.ENABLE_OPTIONAL_FEATURES = true; + } + + /** + Determines whether Ember should add to `Array`, `Function`, and `String` + native object prototypes, a few extra methods in order to provide a more + friendly API. - ### Overriding Application-wide Defaults - ``{{link-to}}`` creates an instance of `Ember.LinkComponent` - for rendering. To override options for your entire - application, reopen `Ember.LinkComponent` and supply the - desired values: + We generally recommend leaving this option set to true however, if you need + to turn it off, you can add the configuration property + `EXTEND_PROTOTYPES` to `EmberENV` and set it to `false`. - ``` javascript - Ember.LinkComponent.reopen({ - activeClass: "is-active", - tagName: 'li' - }) - ``` + Note, when disabled (the default configuration for Ember Addons), you will + instead have to access all methods and functions from the Ember + namespace. - It is also possible to override the default event in - this manner: + @property EXTEND_PROTOTYPES + @type Boolean + @default true + @for EmberENV + @public + */ + ENV.EXTEND_PROTOTYPES = _emberEnvironmentUtils.normalizeExtendPrototypes(ENV.EXTEND_PROTOTYPES); + + /** + The `LOG_STACKTRACE_ON_DEPRECATION` property, when true, tells Ember to log + a full stack trace during deprecation warnings. - ``` javascript - Ember.LinkComponent.reopen({ - eventName: 'customEventName' - }); - ``` + @property LOG_STACKTRACE_ON_DEPRECATION + @type Boolean + @default true + @for EmberENV + @public + */ + ENV.LOG_STACKTRACE_ON_DEPRECATION = _emberEnvironmentUtils.defaultTrue(ENV.LOG_STACKTRACE_ON_DEPRECATION); + + /** + The `LOG_VERSION` property, when true, tells Ember to log versions of all + dependent libraries in use. - @method link-to - @for Ember.Templates.helpers - @param {String} routeName - @param {Object} [context]* - @param [options] {Object} Handlebars key/value pairs of options, you can override any property of Ember.LinkComponent - @return {String} HTML string - @see {Ember.LinkComponent} + @property LOG_VERSION + @type Boolean + @default true + @for EmberENV @public */ + ENV.LOG_VERSION = _emberEnvironmentUtils.defaultTrue(ENV.LOG_VERSION); - 'use strict'; + // default false + ENV.MODEL_FACTORY_INJECTIONS = _emberEnvironmentUtils.defaultFalse(ENV.MODEL_FACTORY_INJECTIONS); /** - `Ember.LinkComponent` renders an element whose `click` event triggers a - transition of the application's instance of `Ember.Router` to - a supplied route by name. - - `Ember.LinkComponent` components are invoked with {{#link-to}}. Properties - of this class can be overridden with `reopen` to customize application-wide - behavior. + Debug parameter you can turn on. This will log all bindings that fire to + the console. This should be disabled in production code. Note that you + can also enable this from the console or temporarily. - @class LinkComponent - @namespace Ember - @extends Ember.Component - @see {Ember.Templates.helpers.link-to} - @private - **/ - var LinkComponent = _emberGlimmerComponent.default.extend({ - layout: _emberGlimmerTemplatesLinkTo.default, - - tagName: 'a', + @property LOG_BINDINGS + @for EmberENV + @type Boolean + @default false + @public + */ + ENV.LOG_BINDINGS = _emberEnvironmentUtils.defaultFalse(ENV.LOG_BINDINGS); - /** - @deprecated Use current-when instead. - @property currentWhen - @private - */ - currentWhen: _emberRuntime.deprecatingAlias('current-when', { id: 'ember-routing-view.deprecated-current-when', until: '3.0.0' }), + ENV.RAISE_ON_DEPRECATION = _emberEnvironmentUtils.defaultFalse(ENV.RAISE_ON_DEPRECATION); - /** - Used to determine when this `LinkComponent` is active. - @property currentWhen - @public - */ - 'current-when': null, + // check if window exists and actually is the global + var hasDOM = typeof window !== 'undefined' && window === _emberEnvironmentGlobal.default && window.document && window.document.createElement && !ENV.disableBrowserEnvironment; // is this a public thing? - /** - Sets the `title` attribute of the `LinkComponent`'s HTML element. - @property title - @default null - @public - **/ - title: null, + // legacy imports/exports/lookup stuff (should we keep this??) + var originalContext = _emberEnvironmentGlobal.default.Ember || {}; - /** - Sets the `rel` attribute of the `LinkComponent`'s HTML element. - @property rel - @default null - @public - **/ - rel: null, + var context = { + // import jQuery + imports: originalContext.imports || _emberEnvironmentGlobal.default, + // export Ember + exports: originalContext.exports || _emberEnvironmentGlobal.default, + // search for Namespaces + lookup: originalContext.lookup || _emberEnvironmentGlobal.default + }; - /** - Sets the `tabindex` attribute of the `LinkComponent`'s HTML element. - @property tabindex - @default null - @public - **/ - tabindex: null, + exports.context = context; + // TODO: cleanup single source of truth issues with this stuff + var environment = hasDOM ? { + hasDOM: true, + isChrome: !!window.chrome && !window.opera, + isFirefox: typeof InstallTrigger !== 'undefined', + isPhantom: !!window.callPhantom, + location: window.location, + history: window.history, + userAgent: window.navigator.userAgent, + window: window + } : { + hasDOM: false, + isChrome: false, + isFirefox: false, + isPhantom: false, + location: null, + history: null, + userAgent: 'Lynx (textmode)', + window: null + }; + exports.environment = environment; +}); +enifed("ember-environment/utils", ["exports"], function (exports) { + "use strict"; - /** - Sets the `target` attribute of the `LinkComponent`'s HTML element. - @since 1.8.0 - @property target - @default null - @public - **/ - target: null, + exports.defaultTrue = defaultTrue; + exports.defaultFalse = defaultFalse; + exports.normalizeExtendPrototypes = normalizeExtendPrototypes; - /** - The CSS class to apply to `LinkComponent`'s element when its `active` - property is `true`. - @property activeClass - @type String - @default active - @public - **/ - activeClass: 'active', + function defaultTrue(v) { + return v === false ? false : true; + } - /** - The CSS class to apply to `LinkComponent`'s element when its `loading` - property is `true`. - @property loadingClass - @type String - @default loading - @private - **/ - loadingClass: 'loading', + function defaultFalse(v) { + return v === true ? true : false; + } - /** - The CSS class to apply to a `LinkComponent`'s element when its `disabled` - property is `true`. - @property disabledClass - @type String - @default disabled - @private - **/ - disabledClass: 'disabled', - _isDisabled: false, + function normalizeExtendPrototypes(obj) { + if (obj === false) { + return { String: false, Array: false, Function: false }; + } else if (!obj || obj === true) { + return { String: true, Array: true, Function: true }; + } else { + return { + String: defaultTrue(obj.String), + Array: defaultTrue(obj.Array), + Function: defaultTrue(obj.Function) + }; + } + } +}); +enifed('ember-extension-support/container_debug_adapter', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { + 'use strict'; - /** - Determines whether the `LinkComponent` will trigger routing via - the `replaceWith` routing strategy. - @property replace - @type Boolean - @default false - @public - **/ - replace: false, + /** + @module ember + @submodule ember-extension-support + */ + /** + The `ContainerDebugAdapter` helps the container and resolver interface + with tools that debug Ember such as the + [Ember Extension](https://github.com/tildeio/ember-extension) + for Chrome and Firefox. + + This class can be extended by a custom resolver implementer + to override some of the methods with library-specific code. + + The methods likely to be overridden are: + + * `canCatalogEntriesByType` + * `catalogEntriesByType` + + The adapter will need to be registered + in the application's container as `container-debug-adapter:main`. + + Example: + + ```javascript + Application.initializer({ + name: "containerDebugAdapter", + + initialize(application) { + application.register('container-debug-adapter:main', require('app/container-debug-adapter')); + } + }); + ``` + + @class ContainerDebugAdapter + @namespace Ember + @extends Ember.Object + @since 1.5.0 + @public + */ + exports.default = _emberRuntime.Object.extend({ /** - By default the `{{link-to}}` component 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'] + The resolver instance of the application + being debugged. This property will be injected + on creation. + @property resolver + @default null @public */ - attributeBindings: ['href', 'title', 'rel', 'tabindex', 'target'], + resolver: null, /** - By default the `{{link-to}}` component will bind to the `active`, `loading`, - and `disabled` classes. It is discouraged to override these directly. - @property classNameBindings - @type Array - @default ['active', 'loading', 'disabled', 'ember-transitioning-in', 'ember-transitioning-out'] + Returns true if it is possible to catalog a list of available + classes in the resolver for a given type. + @method canCatalogEntriesByType + @param {String} type The type. e.g. "model", "controller", "route". + @return {boolean} whether a list is available for this type. @public */ - classNameBindings: ['active', 'loading', 'disabled', 'transitioningIn', 'transitioningOut'], + canCatalogEntriesByType: function (type) { + if (type === 'model' || type === 'template') { + return false; + } - /** - By default the `{{link-to}}` component responds to the `click` event. You - can override this globally by setting this property to your custom - event name. - This is particularly useful on mobile when one wants to avoid the 300ms - click delay using some sort of custom `tap` event. - @property eventName - @type String - @default click - @private - */ - eventName: 'click', + return true; + }, - // this is doc'ed here so it shows up in the events - // section of the API documentation, which is where - // people will likely go looking for it. /** - Triggers the `LinkComponent`'s routing behavior. If - `eventName` is changed to a value other than `click` - the routing behavior will trigger on that custom event - instead. - @event click - @private + Returns the available classes a given type. + @method catalogEntriesByType + @param {String} type The type. e.g. "model", "controller", "route". + @return {Array} An array of strings. + @public */ + catalogEntriesByType: function (type) { + var namespaces = _emberRuntime.A(_emberRuntime.Namespace.NAMESPACES); + var types = _emberRuntime.A(); + var typeSuffixRegex = new RegExp(_emberRuntime.String.classify(type) + '$'); - /** - An overridable method called when `LinkComponent` objects are instantiated. - Example: - ```javascript - App.MyLinkComponent = Ember.LinkComponent.extend({ - init: function() { - this._super(...arguments); - Ember.Logger.log('Event is ' + this.get('eventName')); + namespaces.forEach(function (namespace) { + if (namespace !== _emberMetal.default) { + for (var key in namespace) { + if (!namespace.hasOwnProperty(key)) { + continue; + } + if (typeSuffixRegex.test(key)) { + var klass = namespace[key]; + if (_emberRuntime.typeOf(klass) === 'class') { + types.push(_emberRuntime.String.dasherize(key.replace(typeSuffixRegex, ''))); + } + } + } } }); - ``` - NOTE: If you do override `init` for a framework class like `Ember.View`, - be sure to call `this._super(...arguments)` in your - `init` declaration! If you don't, Ember may not have an opportunity to - do important setup work, and you'll see strange behavior in your - application. - @method init - @private - */ + return types; + } + }); +}); +// Ember as namespace +enifed('ember-extension-support/data_adapter', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'container', 'ember-application'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _container, _emberApplication) { + 'use strict'; + + /** + @module ember + @submodule ember-extension-support + */ + + /** + The `DataAdapter` helps a data persistence library + interface with tools that debug Ember such + as the [Ember Extension](https://github.com/tildeio/ember-extension) + for Chrome and Firefox. + + This class will be extended by a persistence library + which will override some of the methods with + library-specific code. + + The methods likely to be overridden are: + + * `getFilters` + * `detect` + * `columnsForType` + * `getRecords` + * `getRecordColumnValues` + * `getRecordKeywords` + * `getRecordFilterValues` + * `getRecordColor` + * `observeRecord` + + The adapter will need to be registered + in the application's container as `dataAdapter:main`. + + Example: + + ```javascript + Application.initializer({ + name: "data-adapter", + + initialize: function(application) { + application.register('data-adapter:main', DS.DataAdapter); + } + }); + ``` + + @class DataAdapter + @namespace Ember + @extends EmberObject + @public + */ + exports.default = _emberRuntime.Object.extend({ init: function () { this._super.apply(this, arguments); - - // Map desired event name to invoke function - var eventName = _emberMetal.get(this, 'eventName'); - this.on(eventName, this, this._invoke); + this.releaseMethods = _emberRuntime.A(); }, - _routing: _emberRuntime.inject.service('-routing'), + /** + The container-debug-adapter which is used + to list all models. + @property containerDebugAdapter + @default undefined + @since 1.5.0 + @public + **/ + containerDebugAdapter: undefined, /** - Accessed as a classname binding to apply the `LinkComponent`'s `disabledClass` - CSS `class` to the element when the link is disabled. - When `true` interactions with the element will not trigger route changes. - @property disabled - @private + The number of attributes to send + as columns. (Enough to make the record + identifiable). + @private + @property attributeLimit + @default 3 + @since 1.3.0 */ - disabled: _emberMetal.computed({ - get: function (key, value) { - return false; - }, - set: function (key, value) { - if (value !== undefined) { - this.set('_isDisabled', value); - } + attributeLimit: 3, - return value ? _emberMetal.get(this, 'disabledClass') : false; - } - }), + /** + Ember Data > v1.0.0-beta.18 + requires string model names to be passed + around instead of the actual factories. + This is a stamp for the Ember Inspector + to differentiate between the versions + to be able to support older versions too. + @public + @property acceptsModelName + */ + acceptsModelName: true, - _computeActive: function (routerState) { - if (_emberMetal.get(this, 'loading')) { - return false; - } + /** + Stores all methods that clear observers. + These methods will be called on destruction. + @private + @property releaseMethods + @since 1.3.0 + */ + releaseMethods: _emberRuntime.A(), - var routing = _emberMetal.get(this, '_routing'); - var models = _emberMetal.get(this, 'models'); - var resolvedQueryParams = _emberMetal.get(this, 'resolvedQueryParams'); + /** + Specifies how records can be filtered. + Records returned will need to have a `filterValues` + property with a key for every name in the returned array. + @public + @method getFilters + @return {Array} List of objects defining filters. + The object should have a `name` and `desc` property. + */ + getFilters: function () { + return _emberRuntime.A(); + }, - var currentWhen = _emberMetal.get(this, 'current-when'); - var isCurrentWhenSpecified = !!currentWhen; - currentWhen = currentWhen || _emberMetal.get(this, 'qualifiedRouteName'); - currentWhen = currentWhen.split(' '); + /** + Fetch the model types and observe them for changes. + @public + @method watchModelTypes + @param {Function} typesAdded Callback to call to add types. + Takes an array of objects containing wrapped types (returned from `wrapModelType`). + @param {Function} typesUpdated Callback to call when a type has changed. + Takes an array of objects containing wrapped types. + @return {Function} Method to call to remove all observers + */ + watchModelTypes: function (typesAdded, typesUpdated) { + var _this = this; - for (var i = 0; i < currentWhen.length; i++) { - if (routing.isActiveForRoute(models, resolvedQueryParams, currentWhen[i], routerState, isCurrentWhenSpecified)) { - return _emberMetal.get(this, 'activeClass'); - } - } + var modelTypes = this.getModelTypes(); + var releaseMethods = _emberRuntime.A(); + var typesToSend = undefined; - return false; + typesToSend = modelTypes.map(function (type) { + var klass = type.klass; + var wrapped = _this.wrapModelType(klass, type.name); + releaseMethods.push(_this.observeModelType(type.name, typesUpdated)); + return wrapped; + }); + + typesAdded(typesToSend); + + var release = function () { + releaseMethods.forEach(function (fn) { + return fn(); + }); + _this.releaseMethods.removeObject(release); + }; + this.releaseMethods.pushObject(release); + return release; + }, + + _nameToClass: function (type) { + if (typeof type === 'string') { + var owner = _emberUtils.getOwner(this); + type = owner[_container.FACTORY_FOR]('model:' + type).class; + } + return type; }, /** - Accessed as a classname binding to apply the `LinkComponent`'s `activeClass` - CSS `class` to the element when the link is active. - A `LinkComponent` is considered active when its `currentWhen` property is `true` - or the application's current route is the route the `LinkComponent` would trigger - transitions into. - The `currentWhen` property can match against multiple routes by separating - route names using the ` ` (space) character. - @property active - @private + Fetch the records of a given type and observe them for changes. + @public + @method watchRecords + @param {String} modelName The model name. + @param {Function} recordsAdded Callback to call to add records. + Takes an array of objects containing wrapped records. + The object should have the following properties: + columnValues: {Object} The key and value of a table cell. + object: {Object} The actual record object. + @param {Function} recordsUpdated Callback to call when a record has changed. + Takes an array of objects containing wrapped records. + @param {Function} recordsRemoved Callback to call when a record has removed. + Takes the following parameters: + index: The array index where the records were removed. + count: The number of records removed. + @return {Function} Method to call to remove all observers. */ - active: _emberMetal.computed('attrs.params', '_routing.currentState', function computeLinkToComponentActive() { - var currentState = _emberMetal.get(this, '_routing.currentState'); - if (!currentState) { - return false; - } + watchRecords: function (modelName, recordsAdded, recordsUpdated, recordsRemoved) { + var _this2 = this; - return this._computeActive(currentState); - }), + var releaseMethods = _emberRuntime.A(); + var klass = this._nameToClass(modelName); + var records = this.getRecords(klass, modelName); + var release = undefined; - willBeActive: _emberMetal.computed('_routing.targetState', function computeLinkToComponentWillBeActive() { - var routing = _emberMetal.get(this, '_routing'); - var targetState = _emberMetal.get(routing, 'targetState'); - if (_emberMetal.get(routing, 'currentState') === targetState) { - return; + function recordUpdated(updatedRecord) { + recordsUpdated([updatedRecord]); } - return !!this._computeActive(targetState); - }), + var recordsToSend = records.map(function (record) { + releaseMethods.push(_this2.observeRecord(record, recordUpdated)); + return _this2.wrapRecord(record); + }); - transitioningIn: _emberMetal.computed('active', 'willBeActive', function computeLinkToComponentTransitioningIn() { - var willBeActive = _emberMetal.get(this, 'willBeActive'); - if (typeof willBeActive === 'undefined') { - return false; - } + var contentDidChange = function (array, idx, removedCount, addedCount) { + for (var i = idx; i < idx + addedCount; i++) { + var record = _emberRuntime.objectAt(array, i); + var wrapped = _this2.wrapRecord(record); + releaseMethods.push(_this2.observeRecord(record, recordUpdated)); + recordsAdded([wrapped]); + } - return !_emberMetal.get(this, 'active') && willBeActive && 'ember-transitioning-in'; - }), + if (removedCount) { + recordsRemoved(idx, removedCount); + } + }; - transitioningOut: _emberMetal.computed('active', 'willBeActive', function computeLinkToComponentTransitioningOut() { - var willBeActive = _emberMetal.get(this, 'willBeActive'); - if (typeof willBeActive === 'undefined') { - return false; - } + var observer = { didChange: contentDidChange, willChange: function () { + return this; + } }; + _emberRuntime.addArrayObserver(records, this, observer); - return _emberMetal.get(this, 'active') && !willBeActive && 'ember-transitioning-out'; - }), + release = function () { + releaseMethods.forEach(function (fn) { + return fn(); + }); + _emberRuntime.removeArrayObserver(records, _this2, observer); + _this2.releaseMethods.removeObject(release); + }; + + recordsAdded(recordsToSend); + + this.releaseMethods.pushObject(release); + return release; + }, /** - Event handler that invokes the link, activating the associated route. - @method _invoke - @param {Event} event + Clear all observers before destruction @private + @method willDestroy */ - _invoke: function (event) { - if (!_emberViews.isSimpleClick(event)) { - return true; - } + willDestroy: function () { + this._super.apply(this, arguments); + this.releaseMethods.forEach(function (fn) { + return fn(); + }); + }, - var preventDefault = _emberMetal.get(this, 'preventDefault'); - var targetAttribute = _emberMetal.get(this, 'target'); + /** + Detect whether a class is a model. + Test that against the model class + of your persistence library. + @private + @method detect + @param {Class} klass The class to test. + @return boolean Whether the class is a model class or not. + */ + detect: function (klass) { + return false; + }, - if (preventDefault !== false) { - if (!targetAttribute || targetAttribute === '_self') { - event.preventDefault(); - } - } + /** + Get the columns for a given model type. + @private + @method columnsForType + @param {Class} type The model type. + @return {Array} An array of columns of the following format: + name: {String} The name of the column. + desc: {String} Humanized description (what would show in a table column name). + */ + columnsForType: function (type) { + return _emberRuntime.A(); + }, - if (_emberMetal.get(this, 'bubbles') === false) { - event.stopPropagation(); - } + /** + Adds observers to a model type class. + @private + @method observeModelType + @param {String} modelName The model type name. + @param {Function} typesUpdated Called when a type is modified. + @return {Function} The function to call to remove observers. + */ - if (_emberMetal.get(this, '_isDisabled')) { - return false; - } + observeModelType: function (modelName, typesUpdated) { + var _this3 = this; - if (_emberMetal.get(this, 'loading')) { - _emberConsole.default.warn('This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid.'); - return false; - } + var klass = this._nameToClass(modelName); + var records = this.getRecords(klass, modelName); - if (targetAttribute && targetAttribute !== '_self') { - return false; + function onChange() { + typesUpdated([this.wrapModelType(klass, modelName)]); } - var qualifiedRouteName = _emberMetal.get(this, 'qualifiedRouteName'); - var models = _emberMetal.get(this, 'models'); - var queryParams = _emberMetal.get(this, 'queryParams.values'); - var shouldReplace = _emberMetal.get(this, 'replace'); + var observer = { + didChange: function () { + _emberMetal.run.scheduleOnce('actions', this, onChange); + }, + willChange: function () { + return this; + } + }; - var payload = { - queryParams: queryParams, - routeName: qualifiedRouteName + _emberRuntime.addArrayObserver(records, this, observer); + + var release = function () { + return _emberRuntime.removeArrayObserver(records, _this3, observer); }; - _emberMetal.flaggedInstrument('interaction.link-to', payload, this._generateTransition(payload, qualifiedRouteName, models, queryParams, shouldReplace)); + return release; }, - _generateTransition: function (payload, qualifiedRouteName, models, queryParams, shouldReplace) { - var routing = _emberMetal.get(this, '_routing'); - return function () { - payload.transition = routing.transitionTo(qualifiedRouteName, models, queryParams, shouldReplace); + /** + Wraps a given model type and observes changes to it. + @private + @method wrapModelType + @param {Class} klass A model class. + @param {String} modelName Name of the class. + @return {Object} Contains the wrapped type and the function to remove observers + Format: + type: {Object} The wrapped type. + The wrapped type has the following format: + name: {String} The name of the type. + count: {Integer} The number of records available. + columns: {Columns} An array of columns to describe the record. + object: {Class} The actual Model type class. + release: {Function} The function to remove observers. + */ + wrapModelType: function (klass, name) { + var records = this.getRecords(klass, name); + var typeToSend = undefined; + + typeToSend = { + name: name, + count: _emberMetal.get(records, 'length'), + columns: this.columnsForType(klass), + object: klass }; - }, - queryParams: null, + return typeToSend; + }, - qualifiedRouteName: _emberMetal.computed('targetRouteName', '_routing.currentState', function computeLinkToComponentQualifiedRouteName() { - var params = _emberMetal.get(this, 'params').slice(); - var lastParam = params[params.length - 1]; - if (lastParam && lastParam.isQueryParams) { - params.pop(); - } - var onlyQueryParamsSupplied = this[_emberGlimmerComponent.HAS_BLOCK] ? params.length === 0 : params.length === 1; - if (onlyQueryParamsSupplied) { - return _emberMetal.get(this, '_routing.currentRouteName'); - } - return _emberMetal.get(this, 'targetRouteName'); - }), + /** + Fetches all models defined in the application. + @private + @method getModelTypes + @return {Array} Array of model types. + */ + getModelTypes: function () { + var _this4 = this; - resolvedQueryParams: _emberMetal.computed('queryParams', function computeLinkToComponentResolvedQueryParams() { - var resolvedQueryParams = {}; - var queryParams = _emberMetal.get(this, 'queryParams'); + var containerDebugAdapter = this.get('containerDebugAdapter'); + var types = undefined; - if (!queryParams) { - return resolvedQueryParams; + if (containerDebugAdapter.canCatalogEntriesByType('model')) { + types = containerDebugAdapter.catalogEntriesByType('model'); + } else { + types = this._getObjectsOnNamespaces(); } - var values = queryParams.values; - for (var key in values) { - if (!values.hasOwnProperty(key)) { - continue; - } - resolvedQueryParams[key] = values[key]; - } + // New adapters return strings instead of classes. + types = _emberRuntime.A(types).map(function (name) { + return { + klass: _this4._nameToClass(name), + name: name + }; + }); + types = _emberRuntime.A(types).filter(function (type) { + return _this4.detect(type.klass); + }); - return resolvedQueryParams; - }), + return _emberRuntime.A(types); + }, /** - Sets the element's `href` attribute to the url for - the `LinkComponent`'s targeted route. - If the `LinkComponent`'s `tagName` is changed to a value other - than `a`, this property will be ignored. - @property href - @private + Loops over all namespaces and all objects + attached to them. + @private + @method _getObjectsOnNamespaces + @return {Array} Array of model type strings. */ - href: _emberMetal.computed('models', 'qualifiedRouteName', function computeLinkToComponentHref() { - if (_emberMetal.get(this, 'tagName') !== 'a') { - return; - } - - var qualifiedRouteName = _emberMetal.get(this, 'qualifiedRouteName'); - var models = _emberMetal.get(this, 'models'); - - if (_emberMetal.get(this, 'loading')) { - return _emberMetal.get(this, 'loadingHref'); - } + _getObjectsOnNamespaces: function () { + var _this5 = this; - var routing = _emberMetal.get(this, '_routing'); - var queryParams = _emberMetal.get(this, 'queryParams.values'); + var namespaces = _emberRuntime.A(_emberRuntime.Namespace.NAMESPACES); + var types = _emberRuntime.A(); - _emberMetal.runInDebug(function () { - /* - * Unfortunately, to get decent error messages, we need to do this. - * In some future state we should be able to use a "feature flag" - * which allows us to strip this without needing to call it twice. - * - * if (isDebugBuild()) { - * // Do the useful debug thing, probably including try/catch. - * } else { - * // Do the performant thing. - * } - */ - try { - routing.generateURL(qualifiedRouteName, models, queryParams); - } catch (e) { - _emberMetal.assert('You attempted to define a `{{link-to "' + qualifiedRouteName + '"}}` but did not pass the parameters required for generating its dynamic segments. ' + e.message); + namespaces.forEach(function (namespace) { + for (var key in namespace) { + if (!namespace.hasOwnProperty(key)) { + continue; + } + // Even though we will filter again in `getModelTypes`, + // we should not call `lookupFactory` on non-models + // (especially when `EmberENV.MODEL_FACTORY_INJECTIONS` is `true`) + if (!_this5.detect(namespace[key])) { + continue; + } + var _name = _emberRuntime.String.dasherize(key); + if (!(namespace instanceof _emberApplication.Application) && namespace.toString()) { + _name = namespace + '/' + _name; + } + types.push(_name); } }); - - return routing.generateURL(qualifiedRouteName, models, queryParams); - }), - - loading: _emberMetal.computed('_modelsAreLoaded', 'qualifiedRouteName', function computeLinkToComponentLoading() { - var qualifiedRouteName = _emberMetal.get(this, 'qualifiedRouteName'); - var modelsAreLoaded = _emberMetal.get(this, '_modelsAreLoaded'); - - if (!modelsAreLoaded || qualifiedRouteName == null) { - return _emberMetal.get(this, 'loadingClass'); - } - }), - - _modelsAreLoaded: _emberMetal.computed('models', function computeLinkToComponentModelsAreLoaded() { - var models = _emberMetal.get(this, 'models'); - for (var i = 0; i < models.length; i++) { - if (models[i] == null) { - return false; - } - } - - return true; - }), - - _getModels: function (params) { - var modelCount = params.length - 1; - var models = new Array(modelCount); - - for (var i = 0; i < modelCount; i++) { - var value = params[i + 1]; - - while (_emberRuntime.ControllerMixin.detect(value)) { - _emberMetal.deprecate('Providing `{{link-to}}` with a param that is wrapped in a controller is deprecated. ' + (this.parentView ? 'Please update `' + this.parentView + '` to use `{{link-to "post" someController.model}}` instead.' : ''), false, { id: 'ember-routing-views.controller-wrapped-param', until: '3.0.0' }); - value = value.get('model'); - } - - models[i] = value; - } - - return models; + return types; }, /** - The default href value to use while a link-to is loading. - Only applies when tagName is 'a' - @property loadingHref - @type String - @default # - @private + Fetches all loaded records for a given type. + @private + @method getRecords + @return {Array} An array of records. + This array will be observed for changes, + so it should update when new records are added/removed. */ - loadingHref: '#', - - didReceiveAttrs: function () { - var queryParams = undefined; - - var params = _emberMetal.get(this, 'params'); - - if (params) { - // Do not mutate params in place - params = params.slice(); - } + getRecords: function (type) { + return _emberRuntime.A(); + }, - _emberMetal.assert('You must provide one or more parameters to the link-to component.', (function () { - if (!params) { - return false; - } + /** + Wraps a record and observers changes to it. + @private + @method wrapRecord + @param {Object} record The record instance. + @return {Object} The wrapped record. Format: + columnValues: {Array} + searchKeywords: {Array} + */ + wrapRecord: function (record) { + var recordToSend = { object: record }; - return params.length; - })()); + recordToSend.columnValues = this.getRecordColumnValues(record); + recordToSend.searchKeywords = this.getRecordKeywords(record); + recordToSend.filterValues = this.getRecordFilterValues(record); + recordToSend.color = this.getRecordColor(record); - var disabledWhen = _emberMetal.get(this, 'disabledWhen'); - if (disabledWhen !== undefined) { - this.set('disabled', disabledWhen); - } + return recordToSend; + }, - // Process the positional arguments, in order. - // 1. Inline link title comes first, if present. - if (!this[_emberGlimmerComponent.HAS_BLOCK]) { - this.set('linkTitle', params.shift()); - } + /** + Gets the values for each column. + @private + @method getRecordColumnValues + @return {Object} Keys should match column names defined + by the model type. + */ + getRecordColumnValues: function (record) { + return {}; + }, - // 2. `targetRouteName` is now always at index 0. - this.set('targetRouteName', params[0]); + /** + Returns keywords to match when searching records. + @private + @method getRecordKeywords + @return {Array} Relevant keywords for search. + */ + getRecordKeywords: function (record) { + return _emberRuntime.A(); + }, - // 3. The last argument (if still remaining) is the `queryParams` object. - var lastParam = params[params.length - 1]; + /** + Returns the values of filters defined by `getFilters`. + @private + @method getRecordFilterValues + @param {Object} record The record instance. + @return {Object} The filter values. + */ + getRecordFilterValues: function (record) { + return {}; + }, - if (lastParam && lastParam.isQueryParams) { - queryParams = params.pop(); - } else { - queryParams = { values: {} }; - } - this.set('queryParams', queryParams); + /** + Each record can have a color that represents its state. + @private + @method getRecordColor + @param {Object} record The record instance + @return {String} The records color. + Possible options: black, red, blue, green. + */ + getRecordColor: function (record) { + return null; + }, - // 4. Any remaining indices (excepting `targetRouteName` at 0) are `models`. - if (params.length > 1) { - this.set('models', this._getModels(params)); - } else { - this.set('models', []); - } + /** + Observes all relevant properties and re-sends the wrapped record + when a change occurs. + @private + @method observerRecord + @param {Object} record The record instance. + @param {Function} recordUpdated The callback to call when a record is updated. + @return {Function} The function to call to remove all observers. + */ + observeRecord: function (record, recordUpdated) { + return function () {}; } }); +}); +enifed('ember-extension-support/index', ['exports', 'ember-extension-support/data_adapter', 'ember-extension-support/container_debug_adapter'], function (exports, _emberExtensionSupportData_adapter, _emberExtensionSupportContainer_debug_adapter) { + /** + @module ember + @submodule ember-extension-support + */ - LinkComponent.toString = function () { - return 'LinkComponent'; - }; - - LinkComponent.reopenClass({ - positionalParams: 'params' - }); + 'use strict'; - exports.default = LinkComponent; + exports.DataAdapter = _emberExtensionSupportData_adapter.default; + exports.ContainerDebugAdapter = _emberExtensionSupportContainer_debug_adapter.default; }); -enifed('ember-glimmer/components/text_area', ['exports', 'ember-glimmer/component', 'ember-views', 'ember-glimmer/templates/empty'], function (exports, _emberGlimmerComponent, _emberViews, _emberGlimmerTemplatesEmpty) { +enifed('ember-glimmer/component', ['exports', 'ember-utils', 'ember-views', 'ember-runtime', 'ember-metal', 'ember-glimmer/utils/references', '@glimmer/reference', '@glimmer/runtime'], function (exports, _emberUtils, _emberViews, _emberRuntime, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference, _glimmerRuntime) { + 'use strict'; + + var _CoreView$extend; + + var DIRTY_TAG = _emberUtils.symbol('DIRTY_TAG'); + exports.DIRTY_TAG = DIRTY_TAG; + var ARGS = _emberUtils.symbol('ARGS'); + exports.ARGS = ARGS; + var ROOT_REF = _emberUtils.symbol('ROOT_REF'); + exports.ROOT_REF = ROOT_REF; + var IS_DISPATCHING_ATTRS = _emberUtils.symbol('IS_DISPATCHING_ATTRS'); + exports.IS_DISPATCHING_ATTRS = IS_DISPATCHING_ATTRS; + var HAS_BLOCK = _emberUtils.symbol('HAS_BLOCK'); + exports.HAS_BLOCK = HAS_BLOCK; + var BOUNDS = _emberUtils.symbol('BOUNDS'); + + exports.BOUNDS = BOUNDS; /** @module ember @submodule ember-glimmer */ - 'use strict'; /** - `{{textarea}}` inserts a new instance of ` + ``` - Bound: - In the following example, the `writtenWords` property on `App.ApplicationController` - will be updated live as the user types 'Lots of text that IS bound' into - the text area of their browser's window. + ## HTML `class` Attribute - ```javascript - App.ApplicationController = Ember.Controller.extend({ - writtenWords: "Lots of text that IS bound" + The HTML `class` attribute of a component's tag can be set by providing a + `classNames` property that is set to an array of strings: + + ```app/components/my-widget.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + classNames: ['my-class', 'my-other-class'] }); ``` - ```handlebars - {{textarea value=writtenWords}} + Will result in component instances with an HTML representation of: + + ```html +
    ``` - Would result in the following HTML: + `class` attribute values can also be set by providing a `classNameBindings` + property set to an array of properties names for the component. The return value + of these properties will be added as part of the value for the components's `class` + attribute. These properties can be computed properties: + + ```app/components/my-widget.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + classNameBindings: ['propertyA', 'propertyB'], + propertyA: 'from-a', + propertyB: Ember.computed(function() { + if (someLogic) { return 'from-b'; } + }) + }); + ``` + + Will result in component instances with an HTML representation of: ```html - +
    ``` - If you wanted a one way binding between the text area and a div tag - somewhere else on your screen, you could use `Ember.computed.oneWay`: + If the value of a class name binding returns a boolean the property name + itself will be used as the class name if the property is true. + The class name will not be added if the value is `false` or `undefined`. - ```javascript - App.ApplicationController = Ember.Controller.extend({ - writtenWords: "Lots of text that IS bound", - outputWrittenWords: Ember.computed.oneWay("writtenWords") + ```app/components/my-widget.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + classNameBindings: ['hovered'], + hovered: true }); ``` - ```handlebars - {{textarea value=writtenWords}} -
    - {{outputWrittenWords}} -
    + Will result in component instances with an HTML representation of: + + ```html +
    ``` - Would result in the following HTML: + When using boolean class name bindings you can supply a string value other + than the property name for use as the `class` HTML attribute by appending the + preferred value after a ":" character when defining the binding: + + ```app/components/my-widget.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + classNameBindings: ['awesome:so-very-cool'], + awesome: true + }); + ``` + + Will result in component instances with an HTML representation of: ```html - - <-- the following div will be updated in real time as you type --> -
    - Lots of text that IS bound -
    +
    ``` - Finally, this example really shows the power and ease of Ember when two - properties are bound to eachother via `Ember.computed.alias`. Type into - either text area box and they'll both stay in sync. Note that - `Ember.computed.alias` costs more in terms of performance, so only use it when - your really binding in both directions: + Boolean value class name bindings whose property names are in a + camelCase-style format will be converted to a dasherized format: - ```javascript - App.ApplicationController = Ember.Controller.extend({ - writtenWords: "Lots of text that IS bound", - twoWayWrittenWords: Ember.computed.alias("writtenWords") + ```app/components/my-widget.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + classNameBindings: ['isUrgent'], + isUrgent: true }); ``` - ```handlebars - {{textarea value=writtenWords}} - {{textarea value=twoWayWrittenWords}} + Will result in component instances with an HTML representation of: + + ```html +
    + ``` + + Class name bindings can also refer to object values that are found by + traversing a path relative to the component itself: + + ```app/components/my-widget.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + classNameBindings: ['messages.empty'], + messages: Ember.Object.create({ + empty: true + }) + }); ``` + Will result in component instances with an HTML representation of: + ```html - - <-- both updated in real time --> - +
    ``` - ### Actions + If you want to add a class name for a property which evaluates to true and + and a different class name if it evaluates to false, you can pass a binding + like this: - The helper can send multiple actions based on user events. - The action property defines the action which is send when - the user presses the return key. + ```app/components/my-widget.js + import Ember from 'ember'; - ```handlebars - {{input action="submit"}} + export default Ember.Component.extend({ + classNameBindings: ['isEnabled:enabled:disabled'], + isEnabled: true + }); ``` - The helper allows some user events to send actions. + Will result in component instances with an HTML representation of: - * `enter` - * `insert-newline` - * `escape-press` - * `focus-in` - * `focus-out` - * `key-press` + ```html +
    + ``` - For example, if you desire an action to be sent when the input is blurred, - you only need to setup the action name to the event name property. + When isEnabled is `false`, the resulting HTML representation looks like + this: - ```handlebars - {{textarea focus-in="alertMessage"}} + ```html +
    ``` - See more about [Text Support Actions](/api/classes/Ember.TextArea.html) + This syntax offers the convenience to add a class if a property is `false`: - ### Extension + ```app/components/my-widget.js + import Ember from 'ember'; - Internally, `{{textarea}}` creates an instance of `Ember.TextArea`, passing - arguments from the helper to `Ember.TextArea`'s `create` method. You can - extend the capabilities of text areas in your application by reopening this - class. For example, if you are building a Bootstrap project where `data-*` - attributes are used, you can globally add support for a `data-*` attribute - on all `{{textarea}}`s' in your app by reopening `Ember.TextArea` or - `Ember.TextSupport` and adding it to the `attributeBindings` concatenated - property: + // Applies no class when isEnabled is true and class 'disabled' when isEnabled is false + export default Ember.Component.extend({ + classNameBindings: ['isEnabled::disabled'], + isEnabled: true + }); + ``` - ```javascript - Ember.TextArea.reopen({ - attributeBindings: ['data-error'] + Will result in component instances with an HTML representation of: + + ```html +
    + ``` + + When the `isEnabled` property on the component is set to `false`, it will result + in component instances with an HTML representation of: + + ```html +
    + ``` + + Updates to the value of a class name binding will result in automatic + update of the HTML `class` attribute in the component's rendered HTML + representation. If the value becomes `false` or `undefined` the class name + will be removed. + Both `classNames` and `classNameBindings` are concatenated properties. See + [Ember.Object](/api/classes/Ember.Object.html) documentation for more + information about concatenated properties. + + + ## HTML Attributes + + The HTML attribute section of a component's tag can be set by providing an + `attributeBindings` property set to an array of property names on the component. + The return value of these properties will be used as the value of the component's + HTML associated attribute: + + ```app/components/my-anchor.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + tagName: 'a', + attributeBindings: ['href'], + href: 'http://google.com' }); ``` - Keep in mind when writing `Ember.TextArea` subclasses that `Ember.TextArea` - itself extends `Ember.Component`. Expect isolated component semantics, not - legacy 1.x view semantics (like `controller` being present). + Will result in component instances with an HTML representation of: - See more about [Ember components](/api/classes/Ember.Component.html) + ```html + + ``` - @method textarea - @for Ember.Templates.helpers - @param {Hash} options - @public - */ - - /** - The internal class used to create textarea element when the `{{textarea}}` - helper is used. + One property can be mapped on to another by placing a ":" between + the source property and the destination property: - See [Ember.Templates.helpers.textarea](/api/classes/Ember.Templates.helpers.html#method_textarea) for usage details. + ```app/components/my-anchor.js + import Ember from 'ember'; - ## Layout and LayoutName properties + export default Ember.Component.extend({ + tagName: 'a', + attributeBindings: ['url:href'], + url: 'http://google.com' + }); + ``` - Because HTML `textarea` elements do not contain inner HTML the `layout` and - `layoutName` properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s - layout section for more information. + Will result in component instances with an HTML representation of: - @class TextArea - @namespace Ember - @extends Ember.Component - @uses Ember.TextSupport - @public - */ - exports.default = _emberGlimmerComponent.default.extend(_emberViews.TextSupport, { - classNames: ['ember-text-area'], - - layout: _emberGlimmerTemplatesEmpty.default, - - tagName: 'textarea', - attributeBindings: ['rows', 'cols', 'name', 'selectionEnd', 'selectionStart', 'wrap', 'lang', 'dir', 'value'], - rows: null, - cols: null - }); -}); -enifed('ember-glimmer/components/text_field', ['exports', 'ember-utils', 'ember-metal', 'ember-environment', 'ember-glimmer/component', 'ember-glimmer/templates/empty', 'ember-views'], function (exports, _emberUtils, _emberMetal, _emberEnvironment, _emberGlimmerComponent, _emberGlimmerTemplatesEmpty, _emberViews) { - /** - @module ember - @submodule ember-views - */ - 'use strict'; - - var inputTypeTestElement = undefined; - var inputTypes = new _emberUtils.EmptyObject(); - function canSetTypeOfInput(type) { - if (type in inputTypes) { - return inputTypes[type]; - } - - // if running in outside of a browser always return the - // original type - if (!_emberEnvironment.environment.hasDOM) { - inputTypes[type] = type; - - return type; - } - - if (!inputTypeTestElement) { - inputTypeTestElement = document.createElement('input'); - } - - try { - inputTypeTestElement.type = type; - } catch (e) {} - - return inputTypes[type] = inputTypeTestElement.type === type; - } - - /** + ```html + + ``` - The internal class used to create text inputs when the `{{input}}` - helper is used with `type` of `text`. + Namespaced attributes (e.g. `xlink:href`) are supported, but have to be + mapped, since `:` is not a valid character for properties in Javascript: - See [Ember.Templates.helpers.input](/api/classes/Ember.Templates.helpers.html#method_input) for usage details. + ```app/components/my-use.js + import Ember from 'ember'; - ## Layout and LayoutName properties + export default Ember.Component.extend({ + tagName: 'use', + attributeBindings: ['xlinkHref:xlink:href'], + xlinkHref: '#triangle' + }); + ``` - Because HTML `input` elements are self closing `layout` and `layoutName` - properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s - layout section for more information. + Will result in component instances with an HTML representation of: - @class TextField + ```html + + ``` + + If the return value of an `attributeBindings` monitored property is a boolean + the attribute will be present or absent depending on the value: + + ```app/components/my-text-input.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + tagName: 'input', + attributeBindings: ['disabled'], + disabled: false + }); + ``` + + Will result in a component instance with an HTML representation of: + + ```html + + ``` + + `attributeBindings` can refer to computed properties: + + ```app/components/my-text-input.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + tagName: 'input', + attributeBindings: ['disabled'], + disabled: Ember.computed(function() { + if (someLogic) { + return true; + } else { + return false; + } + }) + }); + ``` + + To prevent setting an attribute altogether, use `null` or `undefined` as the + return value of the `attributeBindings` monitored property: + + ```app/components/my-text-input.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + tagName: 'form', + attributeBindings: ['novalidate'], + novalidate: null + }); + ``` + + Updates to the property of an attribute binding will result in automatic + update of the HTML attribute in the component's rendered HTML representation. + `attributeBindings` is a concatenated property. See [Ember.Object](/api/classes/Ember.Object.html) + documentation for more information about concatenated properties. + + + ## Layouts + + See [Ember.Templates.helpers.yield](/api/classes/Ember.Templates.helpers.html#method_yield) + for more information. + + + ## Responding to Browser Events + + Components can respond to user-initiated events in one of three ways: method + implementation, through an event manager, and through `{{action}}` helper use + in their template or layout. + + + ### Method Implementation + + Components can respond to user-initiated events by implementing a method that + matches the event name. A `jQuery.Event` object will be passed as the + argument to this method. + + ```app/components/my-widget.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + click(event) { + // will be called when an instance's + // rendered element is clicked + } + }); + ``` + + + ### `{{action}}` Helper + + See [Ember.Templates.helpers.action](/api/classes/Ember.Templates.helpers.html#method_action). + + + ### Event Names + + All of the event handling approaches described above respond to the same set + of events. The names of the built-in events are listed below. (The hash of + built-in events exists in `Ember.EventDispatcher`.) Additional, custom events + can be registered by using `Ember.Application.customEvents`. + + Touch events: + + * `touchStart` + * `touchMove` + * `touchEnd` + * `touchCancel` + + Keyboard events: + + * `keyDown` + * `keyUp` + * `keyPress` + + Mouse events: + + * `mouseDown` + * `mouseUp` + * `contextMenu` + * `click` + * `doubleClick` + * `mouseMove` + * `focusIn` + * `focusOut` + * `mouseEnter` + * `mouseLeave` + + Form events: + + * `submit` + * `change` + * `focusIn` + * `focusOut` + * `input` + + HTML5 drag and drop events: + + * `dragStart` + * `drag` + * `dragEnter` + * `dragLeave` + * `dragOver` + * `dragEnd` + * `drop` + + @class Component @namespace Ember - @extends Ember.Component - @uses Ember.TextSupport + @extends Ember.CoreView + @uses Ember.TargetActionSupport + @uses Ember.ClassNamesSupport + @uses Ember.ActionSupport + @uses Ember.ViewMixin + @uses Ember.ViewStateSupport @public */ - exports.default = _emberGlimmerComponent.default.extend(_emberViews.TextSupport, { - layout: _emberGlimmerTemplatesEmpty.default, - classNames: ['ember-text-field'], - tagName: 'input', - attributeBindings: ['accept', 'autocomplete', 'autosave', 'dir', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget', 'height', 'inputmode', 'lang', 'list', 'max', 'min', 'multiple', 'name', 'pattern', 'size', 'step', 'type', 'value', 'width'], - - /** - The `value` attribute of the input element. As the user inputs text, this - property is updated live. - @property value - @type String - @default "" - @public - */ - value: '', + var Component = _emberViews.CoreView.extend(_emberViews.ChildViewsSupport, _emberViews.ViewStateSupport, _emberViews.ClassNamesSupport, _emberRuntime.TargetActionSupport, _emberViews.ActionSupport, _emberViews.ViewMixin, (_CoreView$extend = { + isComponent: true, - /** - The `type` attribute of the input element. - @property type - @type String - @default "text" - @public - */ - type: _emberMetal.computed({ - get: function () { - return 'text'; - }, + init: function () { + var _this = this; - set: function (key, value) { - var type = 'text'; + this._super.apply(this, arguments); + this[IS_DISPATCHING_ATTRS] = false; + this[DIRTY_TAG] = new _glimmerReference.DirtyableTag(); + this[ROOT_REF] = new _emberGlimmerUtilsReferences.RootReference(this); + this[BOUNDS] = null; - if (canSetTypeOfInput(value)) { - type = value; - } + // If a `defaultLayout` was specified move it to the `layout` prop. + // `layout` is no longer a CP, so this just ensures that the `defaultLayout` + // logic is supported with a deprecation + if (this.defaultLayout && !this.layout) { + _emberMetal.deprecate('Specifying `defaultLayout` to ' + this + ' is deprecated. Please use `layout` instead.', false, { + id: 'ember-views.component.defaultLayout', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-component-defaultlayout' + }); - return type; + this.layout = this.defaultLayout; } - }), - - /** - The `size` of the text field in characters. - @property size - @type String - @default null - @public - */ - size: null, - - /** - The `pattern` attribute of input element. - @property pattern - @type String - @default null - @public - */ - pattern: null, - /** - The `min` attribute of input element used with `type="number"` or `type="range"`. - @property min - @type String - @default null - @since 1.4.0 - @public - */ - min: null, + // If in a tagless component, assert that no event handlers are defined + _emberMetal.assert('You can not define a function that handles DOM events in the `' + this + '` tagless component since it doesn\'t have any DOM element.', this.tagName !== '' || !this.renderer._destinedForDOM || !(function () { + var eventDispatcher = _emberUtils.getOwner(_this).lookup('event_dispatcher:main'); + var events = eventDispatcher && eventDispatcher._finalEvents || {}; - /** - The `max` attribute of input element used with `type="number"` or `type="range"`. - @property max - @type String - @default null - @since 1.4.0 - @public - */ - max: null - }); -}); -enifed('ember-glimmer/dom', ['exports', 'glimmer-runtime', 'glimmer-node'], function (exports, _glimmerRuntime, _glimmerNode) { - 'use strict'; + for (var key in events) { + var methodName = events[key]; - exports.DOMChanges = _glimmerRuntime.DOMChanges; - exports.DOMTreeConstruction = _glimmerRuntime.DOMTreeConstruction; - exports.NodeDOMTreeConstruction = _glimmerNode.NodeDOMTreeConstruction; -}); -enifed('ember-glimmer/environment', ['exports', 'ember-utils', 'ember-metal', 'ember-views', 'glimmer-runtime', 'ember-glimmer/syntax/curly-component', 'ember-glimmer/syntax', 'ember-glimmer/syntax/dynamic-component', 'ember-glimmer/utils/iterable', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/if-unless', 'ember-glimmer/utils/bindings', 'ember-glimmer/helpers/action', 'ember-glimmer/helpers/component', 'ember-glimmer/helpers/concat', 'ember-glimmer/helpers/debugger', 'ember-glimmer/helpers/get', 'ember-glimmer/helpers/hash', 'ember-glimmer/helpers/loc', 'ember-glimmer/helpers/log', 'ember-glimmer/helpers/mut', 'ember-glimmer/helpers/readonly', 'ember-glimmer/helpers/unbound', 'ember-glimmer/helpers/-class', 'ember-glimmer/helpers/-input-type', 'ember-glimmer/helpers/query-param', 'ember-glimmer/helpers/each-in', 'ember-glimmer/helpers/-normalize-class', 'ember-glimmer/helpers/-html-safe', 'ember-glimmer/protocol-for-url', 'ember-glimmer/modifiers/action'], function (exports, _emberUtils, _emberMetal, _emberViews, _glimmerRuntime, _emberGlimmerSyntaxCurlyComponent, _emberGlimmerSyntax, _emberGlimmerSyntaxDynamicComponent, _emberGlimmerUtilsIterable, _emberGlimmerUtilsReferences, _emberGlimmerHelpersIfUnless, _emberGlimmerUtilsBindings, _emberGlimmerHelpersAction, _emberGlimmerHelpersComponent, _emberGlimmerHelpersConcat, _emberGlimmerHelpersDebugger, _emberGlimmerHelpersGet, _emberGlimmerHelpersHash, _emberGlimmerHelpersLoc, _emberGlimmerHelpersLog, _emberGlimmerHelpersMut, _emberGlimmerHelpersReadonly, _emberGlimmerHelpersUnbound, _emberGlimmerHelpersClass, _emberGlimmerHelpersInputType, _emberGlimmerHelpersQueryParam, _emberGlimmerHelpersEachIn, _emberGlimmerHelpersNormalizeClass, _emberGlimmerHelpersHtmlSafe, _emberGlimmerProtocolForUrl, _emberGlimmerModifiersAction) { - 'use strict'; + if (typeof _this[methodName] === 'function') { + return true; // indicate that the assertion should be triggered + } + } + })()); - var builtInComponents = { - textarea: '-text-area' - }; + _emberMetal.assert('You cannot use a computed property for the component\'s `tagName` (' + this + ').', !(this.tagName && this.tagName.isDescriptor)); + }, - var Environment = (function (_GlimmerEnvironment) { - babelHelpers.inherits(Environment, _GlimmerEnvironment); + rerender: function () { + this[DIRTY_TAG].dirty(); + this._super(); + }, - Environment.create = function create(options) { - return new Environment(options); - }; + __defineNonEnumerable: function (property) { + this[property.name] = property.descriptor.value; + } - function Environment(_ref) { - var _this = this; + }, _CoreView$extend[_emberMetal.PROPERTY_DID_CHANGE] = function (key) { + if (this[IS_DISPATCHING_ATTRS]) { + return; + } - var owner = _ref[_emberUtils.OWNER]; - babelHelpers.classCallCheck(this, Environment); + var args = undefined, + reference = undefined; - _GlimmerEnvironment.apply(this, arguments); - this.owner = owner; - this.isInteractive = owner.lookup('-environment:main').isInteractive; + if ((args = this[ARGS]) && (reference = args[key])) { + if (reference[_emberGlimmerUtilsReferences.UPDATE]) { + reference[_emberGlimmerUtilsReferences.UPDATE](_emberMetal.get(this, key)); + } + } + }, _CoreView$extend.getAttr = function (key) { + // TODO Intimate API should be deprecated + return this.get(key); + }, _CoreView$extend.readDOMAttr = function (name) { + var element = _emberViews.getViewElement(this); + return _glimmerRuntime.readDOMAttr(element, name); + }, _CoreView$extend)); - // can be removed once https://github.com/tildeio/glimmer/pull/305 lands - this.destroyedComponents = undefined; + /** + The WAI-ARIA role of the control represented by this view. For example, a + button may have a role of type 'button', or a pane may have a role of + type 'alertdialog'. This property is used by assistive software to help + visually challenged users navigate rich web applications. + The full list of valid WAI-ARIA roles is available at: + [http://www.w3.org/TR/wai-aria/roles#roles_categorization](http://www.w3.org/TR/wai-aria/roles#roles_categorization) + @property ariaRole + @type String + @default null + @public + */ - _emberGlimmerProtocolForUrl.default(this); + /** + Enables components to take a list of parameters as arguments. + For example, a component that takes two parameters with the names + `name` and `age`: + ```javascript + let MyComponent = Ember.Component.extend; + MyComponent.reopenClass({ + positionalParams: ['name', 'age'] + }); + ``` + It can then be invoked like this: + ```hbs + {{my-component "John" 38}} + ``` + The parameters can be referred to just like named parameters: + ```hbs + Name: {{name}}, Age: {{age}}. + ``` + Using a string instead of an array allows for an arbitrary number of + parameters: + ```javascript + let MyComponent = Ember.Component.extend; + MyComponent.reopenClass({ + positionalParams: 'names' + }); + ``` + It can then be invoked like this: + ```hbs + {{my-component "John" "Michael" "Scott"}} + ``` + The parameters can then be referred to by enumerating over the list: + ```hbs + {{#each names as |name|}}{{name}}{{/each}} + ``` + @static + @public + @property positionalParams + @since 1.13.0 + */ - this._definitionCache = new _emberMetal.Cache(2000, function (_ref2) { - var name = _ref2.name; - var source = _ref2.source; - var owner = _ref2.owner; + /** + Called when the attributes passed into the component have been updated. + Called both during the initial render of a container and during a rerender. + Can be used in place of an observer; code placed here will be executed + every time any attribute updates. + @method didReceiveAttrs + @public + @since 1.13.0 + */ - var _lookupComponent = _emberViews.lookupComponent(owner, name, { source: source }); + /** + Called when the attributes passed into the component have been updated. + Called both during the initial render of a container and during a rerender. + Can be used in place of an observer; code placed here will be executed + every time any attribute updates. + @event didReceiveAttrs + @public + @since 1.13.0 + */ - var ComponentClass = _lookupComponent.component; - var layout = _lookupComponent.layout; + /** + Called after a component has been rendered, both on initial render and + in subsequent rerenders. + @method didRender + @public + @since 1.13.0 + */ - if (ComponentClass || layout) { - return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentDefinition(name, ComponentClass, layout); - } - }, function (_ref3) { - var name = _ref3.name; - var source = _ref3.source; - var owner = _ref3.owner; + /** + Called after a component has been rendered, both on initial render and + in subsequent rerenders. + @event didRender + @public + @since 1.13.0 + */ - var expandedName = source && owner._resolveLocalLookupName(name, source) || name; - var ownerGuid = _emberUtils.guidFor(owner); + /** + Called before a component has been rendered, both on initial render and + in subsequent rerenders. + @method willRender + @public + @since 1.13.0 + */ - return ownerGuid + '|' + expandedName; - }); + /** + Called before a component has been rendered, both on initial render and + in subsequent rerenders. + @event willRender + @public + @since 1.13.0 + */ - this._templateCache = new _emberMetal.Cache(1000, function (_ref4) { - var Template = _ref4.Template; - var owner = _ref4.owner; + /** + Called when the attributes passed into the component have been changed. + Called only during a rerender, not during an initial render. + @method didUpdateAttrs + @public + @since 1.13.0 + */ - if (Template.create) { - var _Template$create; + /** + Called when the attributes passed into the component have been changed. + Called only during a rerender, not during an initial render. + @event didUpdateAttrs + @public + @since 1.13.0 + */ - // we received a factory - return Template.create((_Template$create = { env: _this }, _Template$create[_emberUtils.OWNER] = owner, _Template$create)); - } else { - // we were provided an instance already - return Template; - } - }, function (_ref5) { - var Template = _ref5.Template; - var owner = _ref5.owner; - return _emberUtils.guidFor(owner) + '|' + Template.id; - }); + /** + Called when the component is about to update and rerender itself. + Called only during a rerender, not during an initial render. + @method willUpdate + @public + @since 1.13.0 + */ - this._compilerCache = new _emberMetal.Cache(10, function (Compiler) { - return new _emberMetal.Cache(2000, function (template) { - var compilable = new Compiler(template); - return _glimmerRuntime.compileLayout(compilable, _this); - }, function (template) { - var owner = template.meta.owner; - return _emberUtils.guidFor(owner) + '|' + template.id; - }); - }, function (Compiler) { - return Compiler.id; - }); + /** + Called when the component is about to update and rerender itself. + Called only during a rerender, not during an initial render. + @event willUpdate + @public + @since 1.13.0 + */ - this.builtInModifiers = { - action: new _emberGlimmerModifiersAction.default() - }; + /** + Called when the component has updated and rerendered itself. + Called only during a rerender, not during an initial render. + @method didUpdate + @public + @since 1.13.0 + */ - this.builtInHelpers = { - if: _emberGlimmerHelpersIfUnless.inlineIf, - action: _emberGlimmerHelpersAction.default, - component: _emberGlimmerHelpersComponent.default, - concat: _emberGlimmerHelpersConcat.default, - debugger: _emberGlimmerHelpersDebugger.default, - get: _emberGlimmerHelpersGet.default, - hash: _emberGlimmerHelpersHash.default, - loc: _emberGlimmerHelpersLoc.default, - log: _emberGlimmerHelpersLog.default, - mut: _emberGlimmerHelpersMut.default, - 'query-params': _emberGlimmerHelpersQueryParam.default, - readonly: _emberGlimmerHelpersReadonly.default, - unbound: _emberGlimmerHelpersUnbound.default, - unless: _emberGlimmerHelpersIfUnless.inlineUnless, - '-class': _emberGlimmerHelpersClass.default, - '-each-in': _emberGlimmerHelpersEachIn.default, - '-input-type': _emberGlimmerHelpersInputType.default, - '-normalize-class': _emberGlimmerHelpersNormalizeClass.default, - '-html-safe': _emberGlimmerHelpersHtmlSafe.default, - '-get-dynamic-var': _glimmerRuntime.getDynamicVar - }; - } + /** + Called when the component has updated and rerendered itself. + Called only during a rerender, not during an initial render. + @event didUpdate + @public + @since 1.13.0 + */ - // Hello future traveler, welcome to the world of syntax refinement. - // The method below is called by Glimmer's runtime compiler to allow - // us to take generic statement syntax and refine it to more meaniful - // syntax for Ember's use case. This on the fly switch-a-roo sounds fine - // and dandy, however Ember has precedence on statement refinement that you - // need to be aware of. The presendence for language constructs is as follows: - // - // ------------------------ - // Native & Built-in Syntax - // ------------------------ - // User-land components - // ------------------------ - // User-land helpers - // ------------------------ - // - // The one caveat here is that Ember also allows for dashed references that are - // not a component or helper: - // - // export default Component.extend({ - // 'foo-bar': 'LAME' - // }); - // - // {{foo-bar}} - // - // The heuristic for the above situation is a dashed "key" in inline form - // that does not resolve to a defintion. In this case refine statement simply - // isn't going to return any syntax and the Glimmer engine knows how to handle - // this case. + /** + A component may contain a layout. A layout is a regular template but + supersedes the `template` property during rendering. It is the + responsibility of the layout template to retrieve the `template` + property from the component (or alternatively, call `Handlebars.helpers.yield`, + `{{yield}}`) to render it in the correct location. + This is useful for a component 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 + @public + */ - Environment.prototype.refineStatement = function refineStatement(statement, symbolTable) { - var _this2 = this; + /** + The name of the layout to lookup if no layout is provided. + By default `Ember.Component` will lookup a template with this name in + `Ember.TEMPLATES` (a shared global object). + @property layoutName + @type String + @default null + @private + */ - // 1. resolve any native syntax – if, unless, with, each, and partial - var nativeSyntax = _GlimmerEnvironment.prototype.refineStatement.call(this, statement, symbolTable); + /** + Returns a jQuery object for this component's element. If you pass in a selector + string, this method will return a jQuery object, using the current element + as its buffer. + For example, calling `component.$('li')` will return a jQuery object containing + all of the `li` elements inside the DOM element of this component. + @method $ + @param {String} [selector] a jQuery-compatible selector string + @return {jQuery} the jQuery object for the DOM node + @public + */ - if (nativeSyntax) { - return nativeSyntax; + /** + The HTML `id` of the component's element in the DOM. You can provide this + value yourself but it must be unique (just as in HTML): + ```handlebars + {{my-component elementId="a-really-cool-id"}} + ``` + If not manually set a default value will be provided by the framework. + Once rendered an element's `elementId` is considered immutable and you + should never change it. If you need to compute a dynamic value for the + `elementId`, you should do this when the component or element is being + instantiated: + ```javascript + export default Ember.Component.extend({ + init() { + this._super(...arguments); + var index = this.get('index'); + this.set('elementId', `component-id${index}`); } + }); + ``` + @property elementId + @type String + @public + */ - var appendType = statement.appendType; - var isSimple = statement.isSimple; - var isInline = statement.isInline; - var isBlock = statement.isBlock; - var isModifier = statement.isModifier; - var key = statement.key; - var path = statement.path; - var args = statement.args; + /** + If `false`, the view will appear hidden in DOM. + @property isVisible + @type Boolean + @default null + @public + */ + Component[_emberUtils.NAME_KEY] = 'Ember.Component'; - _emberMetal.assert('You attempted to overwrite the built-in helper "' + key + '" which is not allowed. Please rename the helper.', !(this.builtInHelpers[key] && this.owner.hasRegistration('helper:' + key))); + Component.reopenClass({ + isComponentFactory: true, + positionalParams: [] + }); - if (isSimple && (isInline || isBlock) && appendType !== 'get') { - // 2. built-in syntax - - var RefinedSyntax = _emberGlimmerSyntax.findSyntaxBuilder(key); - if (RefinedSyntax) { - return RefinedSyntax.create(this, args, symbolTable); - } - - var internalKey = builtInComponents[key]; - var definition = null; - - if (internalKey) { - definition = this.getComponentDefinition([internalKey], symbolTable); - } else if (key.indexOf('-') >= 0) { - definition = this.getComponentDefinition(path, symbolTable); - } - - if (definition) { - _emberGlimmerUtilsBindings.wrapComponentClassAttribute(args); - - return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentSyntax(args, definition, symbolTable); - } - - _emberMetal.assert('A component or helper named "' + key + '" could not be found', !isBlock || this.hasHelper(path, symbolTable)); - } - - if (isInline && !isSimple && appendType !== 'helper') { - return statement.original.deopt(); - } - - if (!isSimple && path) { - return _emberGlimmerSyntaxDynamicComponent.DynamicComponentSyntax.fromPath(this, path, args, symbolTable); - } - - _emberMetal.assert('Helpers may not be used in the block form, for example {{#' + key + '}}{{/' + key + '}}. Please use a component, or alternatively use the helper in combination with a built-in Ember helper, for example {{#if (' + key + ')}}{{/if}}.', !isBlock || !this.hasHelper(path, symbolTable)); - - _emberMetal.assert('Helpers may not be used in the element form.', (function () { - if (nativeSyntax) { - return true; - } - if (!key) { - return true; - } - - if (isModifier && !_this2.hasModifier(path, symbolTable) && _this2.hasHelper(path, symbolTable)) { - return false; - } - - return true; - })()); - }; - - Environment.prototype.hasComponentDefinition = function hasComponentDefinition() { - return false; - }; - - Environment.prototype.getComponentDefinition = function getComponentDefinition(path, symbolTable) { - var name = path[0]; - var blockMeta = symbolTable.getMeta(); - var owner = blockMeta.owner; - var source = blockMeta.moduleName && 'template:' + blockMeta.moduleName; - - return this._definitionCache.get({ name: name, source: source, owner: owner }); - }; - - // normally templates should be exported at the proper module name - // and cached in the container, but this cache supports templates - // that have been set directly on the component's layout property - - Environment.prototype.getTemplate = function getTemplate(Template, owner) { - return this._templateCache.get({ Template: Template, owner: owner }); - }; - - // a Compiler can wrap the template so it needs its own cache - - Environment.prototype.getCompiledBlock = function getCompiledBlock(Compiler, template) { - var compilerCache = this._compilerCache.get(Compiler); - return compilerCache.get(template); - }; - - Environment.prototype.hasPartial = function hasPartial(name, symbolTable) { - var _symbolTable$getMeta = symbolTable.getMeta(); - - var owner = _symbolTable$getMeta.owner; - - return _emberViews.hasPartial(name, owner); - }; - - Environment.prototype.lookupPartial = function lookupPartial(name, symbolTable) { - var _symbolTable$getMeta2 = symbolTable.getMeta(); - - var owner = _symbolTable$getMeta2.owner; - - var partial = { - template: _emberViews.lookupPartial(name, owner) - }; - - if (partial.template) { - return partial; - } else { - throw new Error(name + ' is not a partial'); - } - }; - - Environment.prototype.hasHelper = function hasHelper(nameParts, symbolTable) { - _emberMetal.assert('The first argument passed into `hasHelper` should be an array', Array.isArray(nameParts)); - - // helpers are not allowed to include a dot in their invocation - if (nameParts.length > 1) { - return false; - } - - var name = nameParts[0]; - - if (this.builtInHelpers[name]) { - return true; - } - - var blockMeta = symbolTable.getMeta(); - var owner = blockMeta.owner; - var options = { source: 'template:' + blockMeta.moduleName }; - - return owner.hasRegistration('helper:' + name, options) || owner.hasRegistration('helper:' + name); - }; - - Environment.prototype.lookupHelper = function lookupHelper(nameParts, symbolTable) { - _emberMetal.assert('The first argument passed into `lookupHelper` should be an array', Array.isArray(nameParts)); - - var name = nameParts[0]; - var helper = this.builtInHelpers[name]; - - if (helper) { - return helper; - } - - var blockMeta = symbolTable.getMeta(); - var owner = blockMeta.owner; - var options = blockMeta.moduleName && { source: 'template:' + blockMeta.moduleName } || {}; - - helper = owner.lookup('helper:' + name, options) || owner.lookup('helper:' + name); - - // TODO: try to unify this into a consistent protocol to avoid wasteful closure allocations - if (helper.isHelperInstance) { - return function (vm, args) { - return _emberGlimmerUtilsReferences.SimpleHelperReference.create(helper.compute, args); - }; - } else if (helper.isHelperFactory) { - return function (vm, args) { - return _emberGlimmerUtilsReferences.ClassBasedHelperReference.create(helper, vm, args); - }; - } else { - throw new Error(nameParts + ' is not a helper'); - } - }; - - Environment.prototype.hasModifier = function hasModifier(nameParts) { - _emberMetal.assert('The first argument passed into `hasModifier` should be an array', Array.isArray(nameParts)); - - // modifiers are not allowed to include a dot in their invocation - if (nameParts.length > 1) { - return false; - } - - return !!this.builtInModifiers[nameParts[0]]; - }; - - Environment.prototype.lookupModifier = function lookupModifier(nameParts) { - _emberMetal.assert('The first argument passed into `lookupModifier` should be an array', Array.isArray(nameParts)); - - var modifier = this.builtInModifiers[nameParts[0]]; - - if (modifier) { - return modifier; - } else { - throw new Error(nameParts + ' is not a modifier'); - } - }; - - Environment.prototype.toConditionalReference = function toConditionalReference(reference) { - return _emberGlimmerUtilsReferences.ConditionalReference.create(reference); - }; - - Environment.prototype.iterableFor = function iterableFor(ref, args) { - var keyPath = args.named.get('key').value(); - return _emberGlimmerUtilsIterable.default(ref, keyPath); - }; - - Environment.prototype.scheduleInstallModifier = function scheduleInstallModifier() { - if (this.isInteractive) { - var _GlimmerEnvironment$prototype$scheduleInstallModifier; - - (_GlimmerEnvironment$prototype$scheduleInstallModifier = _GlimmerEnvironment.prototype.scheduleInstallModifier).call.apply(_GlimmerEnvironment$prototype$scheduleInstallModifier, [this].concat(babelHelpers.slice.call(arguments))); - } - }; - - Environment.prototype.scheduleUpdateModifier = function scheduleUpdateModifier() { - if (this.isInteractive) { - var _GlimmerEnvironment$prototype$scheduleUpdateModifier; - - (_GlimmerEnvironment$prototype$scheduleUpdateModifier = _GlimmerEnvironment.prototype.scheduleUpdateModifier).call.apply(_GlimmerEnvironment$prototype$scheduleUpdateModifier, [this].concat(babelHelpers.slice.call(arguments))); - } - }; - - Environment.prototype.didDestroy = function didDestroy(destroyable) { - destroyable.destroy(); - }; - - Environment.prototype.begin = function begin() { - this.inTransaction = true; - - _GlimmerEnvironment.prototype.begin.call(this); - - this.destroyedComponents = []; - }; - - Environment.prototype.commit = function commit() { - // components queued for destruction must be destroyed before firing - // `didCreate` to prevent errors when removing and adding a component - // with the same name (would throw an error when added to view registry) - for (var i = 0; i < this.destroyedComponents.length; i++) { - this.destroyedComponents[i].destroy(); - } - - _GlimmerEnvironment.prototype.commit.call(this); - - this.inTransaction = false; - }; - - return Environment; - })(_glimmerRuntime.Environment); - - exports.default = Environment; - - _emberMetal.runInDebug(function () { - var StyleAttributeManager = (function (_AttributeManager) { - babelHelpers.inherits(StyleAttributeManager, _AttributeManager); - - function StyleAttributeManager() { - babelHelpers.classCallCheck(this, StyleAttributeManager); - - _AttributeManager.apply(this, arguments); - } + exports.default = Component; +}); - StyleAttributeManager.prototype.setAttribute = function setAttribute(dom, element, value) { - var _AttributeManager$prototype$setAttribute; +/** + Normally, Ember's component model is "write-only". The component takes a + bunch of attributes that it got passed in, and uses them to render its + template. + One nice thing about this model is that if you try to set a value to the + same thing as last time, Ember (through HTMLBars) will avoid doing any + work on the DOM. + This is not just a performance optimization. If an attribute has not + changed, it is important not to clobber the element's "hidden state". + For example, if you set an input's `value` to the same value as before, + it will clobber selection state and cursor position. In other words, + setting an attribute is not **always** idempotent. + This method provides a way to read an element's attribute and also + update the last value Ember knows about at the same time. This makes + setting an attribute idempotent. + In particular, what this means is that if you get an `` element's + `value` attribute and then re-render the template with the same value, + it will avoid clobbering the cursor and selection position. + Since most attribute sets are idempotent in the browser, you typically + can get away with reading attributes using jQuery, but the most reliable + way to do so is through this method. + @method readDOMAttr + @param {String} name the name of the attribute + @return String + @public + */ +enifed('ember-glimmer/components/checkbox', ['exports', 'ember-metal', 'ember-glimmer/component', 'ember-glimmer/templates/empty'], function (exports, _emberMetal, _emberGlimmerComponent, _emberGlimmerTemplatesEmpty) { + 'use strict'; - _emberMetal.warn(_emberViews.STYLE_WARNING, (function () { - if (value === null || value === undefined || _glimmerRuntime.isSafeString(value)) { - return true; - } - return false; - })(), { id: 'ember-htmlbars.style-xss-warning' }); - (_AttributeManager$prototype$setAttribute = _AttributeManager.prototype.setAttribute).call.apply(_AttributeManager$prototype$setAttribute, [this].concat(babelHelpers.slice.call(arguments))); - }; + /** + @module ember + @submodule ember-views + */ - StyleAttributeManager.prototype.updateAttribute = function updateAttribute(dom, element, value) { - var _AttributeManager$prototype$updateAttribute; + /** + The internal class used to create text inputs when the `{{input}}` + helper is used with `type` of `checkbox`. + + See [Ember.Templates.helpers.input](/api/classes/Ember.Templates.helpers.html#method_input) for usage details. + + ## Direct manipulation of `checked` + + The `checked` attribute of an `Ember.Checkbox` object should always be set + through the Ember object or by interacting with its rendered element + representation via the mouse, keyboard, or touch. Updating the value of the + checkbox via jQuery will result in the checked value of the object and its + element losing synchronization. + + ## Layout and LayoutName properties + + Because HTML `input` elements are self closing `layout` and `layoutName` + properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s + layout section for more information. + + @class Checkbox + @namespace Ember + @extends Ember.Component + @public + */ + exports.default = _emberGlimmerComponent.default.extend({ + layout: _emberGlimmerTemplatesEmpty.default, + classNames: ['ember-checkbox'], - _emberMetal.warn(_emberViews.STYLE_WARNING, (function () { - if (value === null || value === undefined || _glimmerRuntime.isSafeString(value)) { - return true; - } - return false; - })(), { id: 'ember-htmlbars.style-xss-warning' }); - (_AttributeManager$prototype$updateAttribute = _AttributeManager.prototype.updateAttribute).call.apply(_AttributeManager$prototype$updateAttribute, [this].concat(babelHelpers.slice.call(arguments))); - }; + tagName: 'input', - return StyleAttributeManager; - })(_glimmerRuntime.AttributeManager); + attributeBindings: ['type', 'checked', 'indeterminate', 'disabled', 'tabindex', 'name', 'autofocus', 'required', 'form'], - var STYLE_ATTRIBUTE_MANANGER = new StyleAttributeManager('style'); + type: 'checkbox', + checked: false, + disabled: false, + indeterminate: false, - Environment.prototype.attributeFor = function (element, attribute, isTrusting, namespace) { - if (attribute === 'style' && !isTrusting) { - return STYLE_ATTRIBUTE_MANANGER; - } + didInsertElement: function () { + this._super.apply(this, arguments); + _emberMetal.get(this, 'element').indeterminate = !!_emberMetal.get(this, 'indeterminate'); + }, - return _glimmerRuntime.Environment.prototype.attributeFor.call(this, element, attribute, isTrusting); - }; + change: function () { + _emberMetal.set(this, 'checked', this.$().prop('checked')); + } }); }); -enifed('ember-glimmer/helper', ['exports', 'ember-utils', 'ember-runtime', 'glimmer-reference'], function (exports, _emberUtils, _emberRuntime, _glimmerReference) { +enifed('ember-glimmer/components/link-to', ['exports', 'ember-console', 'ember-metal', 'ember-runtime', 'ember-views', 'ember-glimmer/templates/link-to', 'ember-glimmer/component'], function (exports, _emberConsole, _emberMetal, _emberRuntime, _emberViews, _emberGlimmerTemplatesLinkTo, _emberGlimmerComponent) { /** @module ember @submodule ember-glimmer */ - 'use strict'; - - exports.helper = helper; - var RECOMPUTE_TAG = _emberUtils.symbol('RECOMPUTE_TAG'); - - exports.RECOMPUTE_TAG = RECOMPUTE_TAG; /** - Ember Helpers are functions that can compute values, and are used in templates. - For example, this code calls a helper named `format-currency`: + The `{{link-to}}` component 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 + element: ```handlebars -
    {{format-currency cents currency="$"}}
    + {{#link-to 'photoGallery'}} + Great Hamster Photos + {{/link-to}} ``` - Additionally a helper can be called as a nested helper (sometimes called a - subexpression). In this example, the computed value of a helper is passed - to a component named `show-money`: + You can also use an inline form of `{{link-to}}` component by + passing the link text as the first argument + to the component: ```handlebars - {{show-money amount=(format-currency cents currency="$")}} + {{link-to 'Great Hamster Photos' 'photoGallery'}} ``` - Helpers defined using a class must provide a `compute` function. For example: + Both will result in: - ```js - export default Ember.Helper.extend({ - compute(params, hash) { - let cents = params[0]; - let currency = hash.currency; - return `${currency}${cents * 0.01}`; - } - }); + ```html + + Great Hamster Photos + ``` - Each time the input to a helper changes, the `compute` function will be - called again. + ### Supplying a tagName + By default `{{link-to}}` renders an `` element. This can + be overridden for a single use of `{{link-to}}` by supplying + a `tagName` option: - As instances, these helpers also have access to the container an will accept - injected dependencies. + ```handlebars + {{#link-to 'photoGallery' tagName="li"}} + Great Hamster Photos + {{/link-to}} + ``` - Additionally, class helpers can call `recompute` to force a new computation. + ```html +
  • + Great Hamster Photos +
  • + ``` - @class Ember.Helper - @public - @since 1.13.0 - */ - var Helper = _emberRuntime.FrameworkObject.extend({ - isHelperInstance: true, - - init: function () { - this._super.apply(this, arguments); - this[RECOMPUTE_TAG] = new _glimmerReference.DirtyableTag(); - }, - - /** - 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 - session service changes: - ```js - // app/helpers/current-user-email.js - export default Ember.Helper.extend({ - session: Ember.inject.service(), - onNewUser: Ember.observer('session.currentUser', function() { - this.recompute(); - }), - compute() { - return this.get('session.currentUser.email'); - } - }); - ``` - @method recompute - @public - @since 1.13.0 - */ - recompute: function () { - this[RECOMPUTE_TAG].dirty(); - } - - /** - Override this function when writing a class-based helper. - @method compute - @param {Array} params The positional arguments to the helper - @param {Object} hash The named arguments to the helper - @public - @since 1.13.0 - */ - }); - - Helper.reopenClass({ - isHelperFactory: true - }); - - /** - In many cases, the ceremony of a full `Ember.Helper` class is not required. - The `helper` method create pure-function helpers without instances. For - example: + To override this option for your entire application, see + "Overriding Application-wide Defaults". - ```js - // app/helpers/format-currency.js - export default Ember.Helper.helper(function(params, hash) { - let cents = params[0]; - let currency = hash.currency; - return `${currency}${cents * 0.01}`; + ### Disabling the `link-to` component + By default `{{link-to}}` is enabled. + any passed value to the `disabled` component property will disable + the `link-to` component. + + static use: the `disabled` option: + + ```handlebars + {{#link-to 'photoGallery' disabled=true}} + Great Hamster Photos + {{/link-to}} + ``` + + dynamic use: the `disabledWhen` option: + + ```handlebars + {{#link-to 'photoGallery' disabledWhen=controller.someProperty}} + Great Hamster Photos + {{/link-to}} + ``` + + any passed value to `disabled` will disable it except `undefined`. + to ensure that only `true` disable the `link-to` component you can + override the global behaviour of `Ember.LinkComponent`. + + ```javascript + Ember.LinkComponent.reopen({ + disabled: Ember.computed(function(key, value) { + if (value !== undefined) { + this.set('_isDisabled', value === true); + } + return value === true ? get(this, 'disabledClass') : false; + }) }); ``` - @static - @param {Function} helper The helper function - @method helper - @public - @since 1.13.0 - */ - - function helper(helperFn) { - return { - isHelperInstance: true, - compute: helperFn - }; - } - - exports.default = Helper; -}); -enifed('ember-glimmer/helpers/-class', ['exports', 'ember-glimmer/utils/references', 'ember-runtime'], function (exports, _emberGlimmerUtilsReferences, _emberRuntime) { - 'use strict'; - - function classHelper(_ref) { - var positional = _ref.positional; - - var path = positional.at(0); - var args = positional.length; - var value = path.value(); - - if (value === true) { - if (args > 1) { - return _emberRuntime.String.dasherize(positional.at(1).value()); - } - return null; - } - - if (value === false) { - if (args > 2) { - return _emberRuntime.String.dasherize(positional.at(2).value()); - } - return null; - } - - return value; - } - - exports.default = function (vm, args) { - return new _emberGlimmerUtilsReferences.InternalHelperReference(classHelper, args); - }; -}); -enifed('ember-glimmer/helpers/-html-safe', ['exports', 'ember-glimmer/utils/references', 'ember-glimmer/utils/string'], function (exports, _emberGlimmerUtilsReferences, _emberGlimmerUtilsString) { - 'use strict'; - - function htmlSafe(_ref) { - var positional = _ref.positional; - - var path = positional.at(0); - return new _emberGlimmerUtilsString.SafeString(path.value()); - } - - exports.default = function (vm, args) { - return new _emberGlimmerUtilsReferences.InternalHelperReference(htmlSafe, args); - }; -}); -enifed('ember-glimmer/helpers/-input-type', ['exports', 'ember-glimmer/utils/references'], function (exports, _emberGlimmerUtilsReferences) { - 'use strict'; - - function inputTypeHelper(_ref) { - var positional = _ref.positional; - var named = _ref.named; - - var type = positional.at(0).value(); - if (type === 'checkbox') { - return '-checkbox'; - } - return '-text-field'; - } - - exports.default = function (vm, args) { - return new _emberGlimmerUtilsReferences.InternalHelperReference(inputTypeHelper, args); - }; -}); -enifed('ember-glimmer/helpers/-normalize-class', ['exports', 'ember-glimmer/utils/references', 'ember-runtime'], function (exports, _emberGlimmerUtilsReferences, _emberRuntime) { - 'use strict'; - - function normalizeClass(_ref) { - var positional = _ref.positional; - var named = _ref.named; - - var classNameParts = positional.at(0).value().split('.'); - var className = classNameParts[classNameParts.length - 1]; - var value = positional.at(1).value(); - - if (value === true) { - return _emberRuntime.String.dasherize(className); - } else if (!value && value !== 0) { - return ''; - } else { - return String(value); - } - } - - exports.default = function (vm, args) { - return new _emberGlimmerUtilsReferences.InternalHelperReference(normalizeClass, args); - }; -}); -enifed('ember-glimmer/helpers/action', ['exports', 'ember-utils', 'ember-metal', 'ember-glimmer/utils/references', 'glimmer-runtime', 'glimmer-reference'], function (exports, _emberUtils, _emberMetal, _emberGlimmerUtilsReferences, _glimmerRuntime, _glimmerReference) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; - - var INVOKE = _emberUtils.symbol('INVOKE'); - exports.INVOKE = INVOKE; - var ACTION = _emberUtils.symbol('ACTION'); - - exports.ACTION = ACTION; - /** - The `{{action}}` helper provides a way to pass triggers for behavior (usually - just a function) between components, and into components from controllers. + see "Overriding Application-wide Defaults" for more. - ### Passing functions with the action helper + ### Handling `href` + `{{link-to}}` will use your application's Router to + fill the element's `href` property with a url that + matches the path to the supplied `routeName` for your + router's configured `Location` scheme, which defaults + to Ember.HashLocation. - There are three contexts an action helper can be used in. The first two - contexts to discuss are attribute context, and Handlebars value context. + ### Handling current route + `{{link-to}}` will apply a CSS class name of 'active' + when the application's current route matches + the supplied routeName. For example, if the application's + current route is 'photoGallery.recent' the following + use of `{{link-to}}`: ```handlebars - {{! An example of attribute context }} -
    - {{! Examples of Handlebars value context }} - {{input on-input=(action "save")}} - {{yield (action "refreshData") andAnotherParam}} + {{#link-to 'photoGallery.recent'}} + Great Hamster Photos + {{/link-to}} ``` - In these contexts, - the helper is called a "closure action" helper. Its behavior is simple: - If passed a function name, read that function off the `actions` property - of the current context. Once that function is read (or if a function was - passed), create a closure over that function and any arguments. - The resulting value of an action helper used this way is simply a function. + will result in - For example, in the attribute context: + ```html +
    + Great Hamster Photos + + ``` + + The CSS class name used for active classes can be customized + for a single use of `{{link-to}}` by passing an `activeClass` + option: ```handlebars - {{! An example of attribute context }} -
    + {{#link-to 'photoGallery.recent' activeClass="current-url"}} + Great Hamster Photos + {{/link-to}} ``` - The resulting template render logic would be: - - ```js - var div = document.createElement('div'); - var actionFunction = (function(context){ - return function() { - return context.actions.save.apply(context, arguments); - }; - })(context); - div.onclick = actionFunction; + ```html + + Great Hamster Photos + ``` - Thus when the div is clicked, the action on that context is called. - Because the `actionFunction` is just a function, closure actions can be - passed between components and still execute in the correct context. + To override this option for your entire application, see + "Overriding Application-wide Defaults". - Here is an example action handler on a component: + ### Keeping a link active for other routes - ```js - export default Ember.Component.extend({ - actions: { - save() { - this.get('model').save(); - } - } - }); + If you need a link to be 'active' even when it doesn't match + the current route, you can use the `current-when` argument. + + ```handlebars + {{#link-to 'photoGallery' current-when='photos'}} + Photo Gallery + {{/link-to}} ``` - Actions are always looked up on the `actions` property of the current context. - This avoids collisions in the naming of common actions, such as `destroy`. - Two options can be passed to the `action` helper when it is used in this way. + This may be helpful for keeping links active for: - * `target=someProperty` will look to `someProperty` instead of the current - context for the `actions` hash. This can be useful when targetting a - service for actions. - * `value="target.value"` will read the path `target.value` off the first - argument to the action when it is called and rewrite the first argument - to be that value. This is useful when attaching actions to event listeners. + * non-nested routes that are logically related + * some secondary menu approaches + * 'top navigation' with 'sub navigation' scenarios - ### Invoking an action + A link will be active if `current-when` is `true` or the current + route is the route this link would transition to. - Closure actions curry both their scope and any arguments. When invoked, any - additional arguments are added to the already curried list. - Actions should be invoked using the [sendAction](/api/classes/Ember.Component.html#method_sendAction) - method. The first argument to `sendAction` is the action to be called, and - additional arguments are passed to the action function. This has interesting - properties combined with currying of arguments. For example: + To match multiple routes 'space-separate' the routes: - ```js - export default Ember.Component.extend({ - actions: { - // Usage {{input on-input=(action (action 'setName' model) value="target.value")}} - setName(model, name) { - model.set('name', name); - } - } - }); + ```handlebars + {{#link-to 'gallery' current-when='photos drawings paintings'}} + Art Gallery + {{/link-to}} ``` - The first argument (`model`) was curried over, and the run-time argument (`event`) - becomes a second argument. Action calls can be nested this way because each simply - returns a function. Any function can be passed to the `{{action}}` helper, including - other actions. - - Actions invoked with `sendAction` have the same currying behavior as demonstrated - with `on-input` above. For example: + ### Supplying a model + An optional model argument can be used for routes whose + paths contain dynamic segments. This argument will become + the model context of the linked route: - ```js - export default Ember.Component.extend({ - actions: { - setName(model, name) { - model.set('name', name); - } - } + ```javascript + Router.map(function() { + this.route("photoGallery", {path: "hamster-photos/:photo_id"}); }); ``` ```handlebars - {{my-input submit=(action 'setName' model)}} + {{#link-to 'photoGallery' aPhoto}} + {{aPhoto.title}} + {{/link-to}} ``` - ```js - // app/components/my-component.js - export default Ember.Component.extend({ - click() { - // Note that model is not passed, it was curried in the template - this.sendAction('submit', 'bob'); - } - }); + ```html + + Tomster + ``` - ### Attaching actions to DOM elements + ### Supplying multiple models + For deep-linking to route paths that contain multiple + dynamic segments, multiple model arguments can be used. + As the router transitions through the route path, each + supplied model argument will become the context for the + route with the dynamic segments: - The third context of the `{{action}}` helper can be called "element space". - For example: + ```javascript + Router.map(function() { + this.route("photoGallery", { path: "hamster-photos/:photo_id" }, function() { + this.route("comment", {path: "comments/:comment_id"}); + }); + }); + ``` + This argument will become the model context of the linked route: ```handlebars - {{! An example of element space }} -
    + {{#link-to 'photoGallery.comment' aPhoto comment}} + {{comment.body}} + {{/link-to}} ``` - Used this way, the `{{action}}` helper provides a useful shortcut for - registering an HTML element in a template for a single DOM event and - forwarding that interaction to the template's context (controller or component). - If the context of a template is a controller, actions used this way will - bubble to routes when the controller does not implement the specified action. - Once an action hits a route, it will bubble through the route hierarchy. - - ### Event Propagation - - `{{action}}` helpers called in element space can control event bubbling. Note - that the closure style actions cannot. - - Events triggered through the action helper will automatically have - `.preventDefault()` called on them. You do not need to do so in your event - handlers. If you need to allow event propagation (to handle file inputs for - example) you can supply the `preventDefault=false` option to the `{{action}}` helper: - - ```handlebars -
    - - -
    + ```html + + A+++ would snuggle again. + ``` - To disable bubbling, pass `bubbles=false` to the helper: + ### Supplying an explicit dynamic segment value + If you don't have a model object available to pass to `{{link-to}}`, + an optional string or integer argument can be passed for routes whose + paths contain dynamic segments. This argument will become the value + of the dynamic segment: - ```handlebars - + ```javascript + Router.map(function() { + this.route("photoGallery", { path: "hamster-photos/:photo_id" }); + }); ``` - To disable bubbling with closure style actions you must create your own - wrapper helper that makes use of `event.stopPropagation()`: - ```handlebars -
    Hello
    + {{#link-to 'photoGallery' aPhotoId}} + {{aPhoto.title}} + {{/link-to}} ``` - ```js - // app/helpers/disable-bubbling.js - import Ember from 'ember'; - export function disableBubbling([action]) { - return function(event) { - event.stopPropagation(); - return action(event); - }; - } - export default Ember.Helper.helper(disableBubbling); + ```html + + Tomster + ``` - If you need the default handler to trigger you should either register your - own event handler, or use event methods on your view class. See - ["Responding to Browser Events"](/api/classes/Ember.View.html#toc_responding-to-browser-events) - in the documentation for Ember.View for more information. - - ### Specifying DOM event type - - `{{action}}` helpers called in element space can specify an event type. - By default the `{{action}}` helper registers for DOM `click` events. You can - supply an `on` option to the helper to specify a different DOM event name: - - ```handlebars -
    - click me -
    - ``` + When transitioning into the linked route, the `model` hook will + be triggered with parameters including this passed identifier. - See ["Event Names"](/api/classes/Ember.View.html#toc_event-names) for a list of - acceptable DOM event names. + ### Allowing Default Action - ### Specifying whitelisted modifier keys + By default the `{{link-to}}` component prevents the default browser action + by calling `preventDefault()` as this sort of action bubbling is normally + handled internally and we do not want to take the browser to a new URL (for + example). - `{{action}}` helpers called in element space can specify modifier keys. - By default the `{{action}}` helper will ignore click events with pressed modifier - keys. You can supply an `allowedKeys` option to specify which keys should not be ignored. + If you need to override this behavior specify `preventDefault=false` in + your template: ```handlebars -
    - click me -
    + {{#link-to 'photoGallery' aPhotoId preventDefault=false}} + {{aPhotoId.title}} + {{/link-to}} ``` - This way the action will fire when clicking with the alt key pressed down. - Alternatively, supply "any" to the `allowedKeys` option to accept any combination of modifier keys. + ### Overriding attributes + You can override any given property of the `Ember.LinkComponent` + that is generated by the `{{link-to}}` component by passing + key/value pairs, like so: ```handlebars -
    - click me with any key pressed -
    + {{#link-to aPhoto tagName='li' title='Following this link will change your life' classNames='pic sweet'}} + Uh-mazing! + {{/link-to}} ``` - ### Specifying a Target + See [Ember.LinkComponent](/api/classes/Ember.LinkComponent.html) for a + complete list of overrideable properties. Be sure to also + check out inherited properties of `LinkComponent`. - A `target` option can be provided to the helper to change - which object will receive the method call. This option must be a path - to an object, accessible in the current context: + ### Overriding Application-wide Defaults + ``{{link-to}}`` creates an instance of `Ember.LinkComponent` + for rendering. To override options for your entire + application, reopen `Ember.LinkComponent` and supply the + desired values: - ```handlebars - {{! app/templates/application.hbs }} -
    - click me -
    + ``` javascript + Ember.LinkComponent.reopen({ + activeClass: "is-active", + tagName: 'li' + }) ``` - ```javascript - // app/controllers/application.js - export default Ember.Controller.extend({ - someService: Ember.inject.service() + It is also possible to override the default event in + this manner: + + ``` javascript + Ember.LinkComponent.reopen({ + eventName: 'customEventName' }); ``` - @method action + @method link-to @for Ember.Templates.helpers + @param {String} routeName + @param {Object} [context]* + @param [options] {Object} Handlebars key/value pairs of options, you can override any property of Ember.LinkComponent + @return {String} HTML string + @see {Ember.LinkComponent} @public */ - exports.default = function (vm, args) { - var named = args.named; - var positional = args.positional; - - // The first two argument slots are reserved. - // pos[0] is the context (or `this`) - // pos[1] is the action name or function - // Anything else is an action argument. - var context = positional.at(0); - var action = positional.at(1); + 'use strict'; - // TODO: Is there a better way of doing this? - var debugKey = action._propertyKey; + /** + `Ember.LinkComponent` renders an element whose `click` event triggers a + transition of the application's instance of `Ember.Router` to + a supplied route by name. + + `Ember.LinkComponent` components are invoked with {{#link-to}}. Properties + of this class can be overridden with `reopen` to customize application-wide + behavior. + + @class LinkComponent + @namespace Ember + @extends Ember.Component + @see {Ember.Templates.helpers.link-to} + @public + **/ + var LinkComponent = _emberGlimmerComponent.default.extend({ + layout: _emberGlimmerTemplatesLinkTo.default, - var restArgs = undefined; + tagName: 'a', - if (positional.length === 2) { - restArgs = _glimmerRuntime.EvaluatedPositionalArgs.empty(); - } else { - restArgs = _glimmerRuntime.EvaluatedPositionalArgs.create(positional.values.slice(2)); - } + /** + @deprecated Use current-when instead. + @property currentWhen + @private + */ + currentWhen: _emberRuntime.deprecatingAlias('current-when', { id: 'ember-routing-view.deprecated-current-when', until: '3.0.0' }), - var target = named.has('target') ? named.get('target') : context; - var processArgs = makeArgsProcessor(named.has('value') && named.get('value'), restArgs); + /** + Used to determine when this `LinkComponent` is active. + @property currentWhen + @public + */ + 'current-when': null, - var fn = undefined; + /** + Sets the `title` attribute of the `LinkComponent`'s HTML element. + @property title + @default null + @public + **/ + title: null, - if (typeof action[INVOKE] === 'function') { - fn = makeClosureAction(action, action, action[INVOKE], processArgs, debugKey); - } else if (_glimmerReference.isConst(target) && _glimmerReference.isConst(action)) { - fn = makeClosureAction(context.value(), target.value(), action.value(), processArgs, debugKey); - } else { - fn = makeDynamicClosureAction(context.value(), target, action, processArgs, debugKey); - } + /** + Sets the `rel` attribute of the `LinkComponent`'s HTML element. + @property rel + @default null + @public + **/ + rel: null, - fn[ACTION] = true; + /** + Sets the `tabindex` attribute of the `LinkComponent`'s HTML element. + @property tabindex + @default null + @public + **/ + tabindex: null, - return new _emberGlimmerUtilsReferences.UnboundReference(fn); - }; + /** + Sets the `target` attribute of the `LinkComponent`'s HTML element. + @since 1.8.0 + @property target + @default null + @public + **/ + target: null, - function NOOP(args) { - return args; - } + /** + The CSS class to apply to `LinkComponent`'s element when its `active` + property is `true`. + @property activeClass + @type String + @default active + @public + **/ + activeClass: 'active', - function makeArgsProcessor(valuePathRef, actionArgsRef) { - var mergeArgs = null; + /** + The CSS class to apply to `LinkComponent`'s element when its `loading` + property is `true`. + @property loadingClass + @type String + @default loading + @private + **/ + loadingClass: 'loading', - if (actionArgsRef.length > 0) { - mergeArgs = function (args) { - return actionArgsRef.value().concat(args); - }; - } - - var readValue = null; - - if (valuePathRef) { - readValue = function (args) { - var valuePath = valuePathRef.value(); + /** + The CSS class to apply to a `LinkComponent`'s element when its `disabled` + property is `true`. + @property disabledClass + @type String + @default disabled + @private + **/ + disabledClass: 'disabled', + _isDisabled: false, - if (valuePath && args.length > 0) { - args[0] = _emberMetal.get(args[0], valuePath); - } + /** + Determines whether the `LinkComponent` will trigger routing via + the `replaceWith` routing strategy. + @property replace + @type Boolean + @default false + @public + **/ + replace: false, - return args; - }; - } + /** + By default the `{{link-to}}` component 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'] + @public + */ + attributeBindings: ['href', 'title', 'rel', 'tabindex', 'target'], - if (mergeArgs && readValue) { - return function (args) { - return readValue(mergeArgs(args)); - }; - } else { - return mergeArgs || readValue || NOOP; - } - } + /** + By default the `{{link-to}}` component will bind to the `active`, `loading`, + and `disabled` classes. It is discouraged to override these directly. + @property classNameBindings + @type Array + @default ['active', 'loading', 'disabled', 'ember-transitioning-in', 'ember-transitioning-out'] + @public + */ + classNameBindings: ['active', 'loading', 'disabled', 'transitioningIn', 'transitioningOut'], - function makeDynamicClosureAction(context, targetRef, actionRef, processArgs, debugKey) { - // We don't allow undefined/null values, so this creates a throw-away action to trigger the assertions - _emberMetal.runInDebug(function () { - makeClosureAction(context, targetRef.value(), actionRef.value(), processArgs, debugKey); - }); + /** + By default the `{{link-to}}` component responds to the `click` event. You + can override this globally by setting this property to your custom + event name. + This is particularly useful on mobile when one wants to avoid the 300ms + click delay using some sort of custom `tap` event. + @property eventName + @type String + @default click + @private + */ + eventName: 'click', - return function () { - return makeClosureAction(context, targetRef.value(), actionRef.value(), processArgs, debugKey).apply(undefined, arguments); - }; - } + // this is doc'ed here so it shows up in the events + // section of the API documentation, which is where + // people will likely go looking for it. + /** + Triggers the `LinkComponent`'s routing behavior. If + `eventName` is changed to a value other than `click` + the routing behavior will trigger on that custom event + instead. + @event click + @private + */ - function makeClosureAction(context, target, action, processArgs, debugKey) { - var self = undefined, - fn = undefined; + /** + An overridable method called when `LinkComponent` objects are instantiated. + Example: + ```javascript + App.MyLinkComponent = Ember.LinkComponent.extend({ + init: function() { + this._super(...arguments); + Ember.Logger.log('Event is ' + this.get('eventName')); + } + }); + ``` + NOTE: If you do override `init` for a framework class like `Ember.View`, + be sure to call `this._super(...arguments)` in your + `init` declaration! If you don't, Ember may not have an opportunity to + do important setup work, and you'll see strange behavior in your + application. + @method init + @private + */ + init: function () { + this._super.apply(this, arguments); - _emberMetal.assert('Action passed is null or undefined in (action) from ' + target + '.', !_emberMetal.isNone(action)); + // Map desired event name to invoke function + var eventName = _emberMetal.get(this, 'eventName'); + this.on(eventName, this, this._invoke); + }, - if (typeof action[INVOKE] === 'function') { - self = action; - fn = action[INVOKE]; - } else { - var typeofAction = typeof action; + _routing: _emberRuntime.inject.service('-routing'), - if (typeofAction === 'string') { - self = target; - fn = target.actions && target.actions[action]; + /** + Accessed as a classname binding to apply the `LinkComponent`'s `disabledClass` + CSS `class` to the element when the link is disabled. + When `true` interactions with the element will not trigger route changes. + @property disabled + @private + */ + disabled: _emberMetal.computed({ + get: function (key, value) { + return false; + }, + set: function (key, value) { + if (value !== undefined) { + this.set('_isDisabled', value); + } - _emberMetal.assert('An action named \'' + action + '\' was not found in ' + target, fn); - } else if (typeofAction === 'function') { - self = context; - fn = action; - } else { - _emberMetal.assert('An action could not be made for `' + (debugKey || action) + '` in ' + target + '. Please confirm that you are using either a quoted action name (i.e. `(action \'' + (debugKey || 'myAction') + '\')`) or a function available in ' + target + '.', false); + return value ? _emberMetal.get(this, 'disabledClass') : false; } - } + }), - return function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; + _computeActive: function (routerState) { + if (_emberMetal.get(this, 'loading')) { + return false; } - var payload = { target: self, args: args, label: 'glimmer-closure-action' }; - return _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { - return _emberMetal.run.join.apply(_emberMetal.run, [self, fn].concat(processArgs(args))); - }); - }; - } -}); -enifed('ember-glimmer/helpers/component', ['exports', 'ember-utils', 'ember-glimmer/utils/references', 'ember-glimmer/syntax/curly-component', 'glimmer-runtime', 'ember-metal'], function (exports, _emberUtils, _emberGlimmerUtilsReferences, _emberGlimmerSyntaxCurlyComponent, _glimmerRuntime, _emberMetal) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; + var routing = _emberMetal.get(this, '_routing'); + var models = _emberMetal.get(this, 'models'); + var resolvedQueryParams = _emberMetal.get(this, 'resolvedQueryParams'); - /** - 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. - `{{component}}`'s primary use is for cases where you want to dynamically - change which type of component is rendered as the state of your application - changes. The provided block will be applied as the template for the component. - Given an empty `` the following template: - - ```handlebars - {{! application.hbs }} - {{component infographicComponentName}} - ``` - - And the following application code: - - ```javascript - export default Ember.Controller.extend({ - infographicComponentName: computed('isMarketOpen', { - get() { - if (this.get('isMarketOpen')) { - return 'live-updating-chart'; - } else { - return 'market-close-summary'; - } + var currentWhen = _emberMetal.get(this, 'current-when'); + var isCurrentWhenSpecified = !!currentWhen; + currentWhen = currentWhen || _emberMetal.get(this, 'qualifiedRouteName'); + currentWhen = currentWhen.split(' '); + + for (var i = 0; i < currentWhen.length; i++) { + if (routing.isActiveForRoute(models, resolvedQueryParams, currentWhen[i], routerState, isCurrentWhenSpecified)) { + return _emberMetal.get(this, 'activeClass'); } - }) - }); - ``` - - The `live-updating-chart` component will be appended when `isMarketOpen` is - `true`, and the `market-close-summary` component will be appended when - `isMarketOpen` is `false`. If the value changes while the app is running, - the component will be automatically swapped out accordingly. - Note: You should not use this helper when you are consistently rendering the same - component. In that case, use standard component syntax, for example: - - ```handlebars - {{! application.hbs }} - {{live-updating-chart}} - ``` - - ## Nested Usage - - The `component` helper can be used to package a component path with initial attrs. - The included attrs can then be merged during the final invocation. - For example, given a `person-form` component with the following template: - - ```handlebars - {{yield (hash - nameInput=(component "my-input-component" value=model.name placeholder="First Name"))}} - ``` - - The following snippet: - - ``` - {{#person-form as |form|}} - {{component form.nameInput placeholder="Username"}} - {{/person-form}} - ``` - - would output an input whose value is already bound to `model.name` and `placeholder` - is "Username". - - @method component - @since 1.11.0 - @for Ember.Templates.helpers - @public - */ + } - var ClosureComponentReference = (function (_CachedReference) { - babelHelpers.inherits(ClosureComponentReference, _CachedReference); + return false; + }, - ClosureComponentReference.create = function create(args, symbolTable, env) { - return new ClosureComponentReference(args, symbolTable, env); - }; + /** + Accessed as a classname binding to apply the `LinkComponent`'s `activeClass` + CSS `class` to the element when the link is active. + A `LinkComponent` is considered active when its `currentWhen` property is `true` + or the application's current route is the route the `LinkComponent` would trigger + transitions into. + The `currentWhen` property can match against multiple routes by separating + route names using the ` ` (space) character. + @property active + @private + */ + active: _emberMetal.computed('attrs.params', '_routing.currentState', function computeLinkToComponentActive() { + var currentState = _emberMetal.get(this, '_routing.currentState'); + if (!currentState) { + return false; + } - function ClosureComponentReference(args, symbolTable, env) { - babelHelpers.classCallCheck(this, ClosureComponentReference); + return this._computeActive(currentState); + }), - _CachedReference.call(this); - this.defRef = args.positional.at(0); - this.env = env; - this.tag = args.positional.at(0).tag; - this.symbolTable = symbolTable; - this.args = args; - this.lastDefinition = undefined; - this.lastName = undefined; - } + willBeActive: _emberMetal.computed('_routing.targetState', function computeLinkToComponentWillBeActive() { + var routing = _emberMetal.get(this, '_routing'); + var targetState = _emberMetal.get(routing, 'targetState'); + if (_emberMetal.get(routing, 'currentState') === targetState) { + return; + } - ClosureComponentReference.prototype.compute = function compute() { - // TODO: Figure out how to extract this because it's nearly identical to - // DynamicComponentReference::compute(). The only differences besides - // currying are in the assertion messages. - var args = this.args; - var defRef = this.defRef; - var env = this.env; - var symbolTable = this.symbolTable; - var lastDefinition = this.lastDefinition; - var lastName = this.lastName; + return !!this._computeActive(targetState); + }), - var nameOrDef = defRef.value(); - var definition = null; + transitioningIn: _emberMetal.computed('active', 'willBeActive', function computeLinkToComponentTransitioningIn() { + var willBeActive = _emberMetal.get(this, 'willBeActive'); + if (typeof willBeActive === 'undefined') { + return false; + } - if (nameOrDef && nameOrDef === lastName) { - return lastDefinition; + return !_emberMetal.get(this, 'active') && willBeActive && 'ember-transitioning-in'; + }), + + transitioningOut: _emberMetal.computed('active', 'willBeActive', function computeLinkToComponentTransitioningOut() { + var willBeActive = _emberMetal.get(this, 'willBeActive'); + if (typeof willBeActive === 'undefined') { + return false; } - this.lastName = nameOrDef; + return _emberMetal.get(this, 'active') && !willBeActive && 'ember-transitioning-out'; + }), - if (typeof nameOrDef === 'string') { - definition = env.getComponentDefinition([nameOrDef], symbolTable); - _emberMetal.assert('The component helper cannot be used without a valid component name. You used "' + nameOrDef + '" via (component "' + nameOrDef + '")', definition); - } else if (_glimmerRuntime.isComponentDefinition(nameOrDef)) { - definition = nameOrDef; - } else { - _emberMetal.assert('You cannot create a component from ' + nameOrDef + ' using the {{component}} helper', nameOrDef); - return null; + /** + Event handler that invokes the link, activating the associated route. + @method _invoke + @param {Event} event + @private + */ + _invoke: function (event) { + if (!_emberViews.isSimpleClick(event)) { + return true; } - var newDef = createCurriedDefinition(definition, args); + var preventDefault = _emberMetal.get(this, 'preventDefault'); + var targetAttribute = _emberMetal.get(this, 'target'); - this.lastDefinition = newDef; + if (preventDefault !== false) { + if (!targetAttribute || targetAttribute === '_self') { + event.preventDefault(); + } + } - return newDef; - }; + if (_emberMetal.get(this, 'bubbles') === false) { + event.stopPropagation(); + } - return ClosureComponentReference; - })(_emberGlimmerUtilsReferences.CachedReference); + if (_emberMetal.get(this, '_isDisabled')) { + return false; + } - exports.ClosureComponentReference = ClosureComponentReference; + if (_emberMetal.get(this, 'loading')) { + _emberConsole.default.warn('This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid.'); + return false; + } - function createCurriedDefinition(definition, args) { - var curriedArgs = curryArgs(definition, args); + if (targetAttribute && targetAttribute !== '_self') { + return false; + } - return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentDefinition(definition.name, definition.ComponentClass, definition.template, curriedArgs); - } + var qualifiedRouteName = _emberMetal.get(this, 'qualifiedRouteName'); + var models = _emberMetal.get(this, 'models'); + var queryParams = _emberMetal.get(this, 'queryParams.values'); + var shouldReplace = _emberMetal.get(this, 'replace'); - function curryArgs(definition, newArgs) { - var args = definition.args; - var ComponentClass = definition.ComponentClass; - var positionalParams = ComponentClass.positionalParams; + var payload = { + queryParams: queryParams, + routeName: qualifiedRouteName + }; - // The args being passed in are from the (component ...) invocation, - // so the first positional argument is actually the name or component - // definition. It needs to be dropped in order for any actual positional - // args to coincide with the ComponentClass's positionParams. + _emberMetal.flaggedInstrument('interaction.link-to', payload, this._generateTransition(payload, qualifiedRouteName, models, queryParams, shouldReplace)); + }, - // For "normal" curly components this slicing is done at the syntax layer, - // but we don't have that luxury here. + _generateTransition: function (payload, qualifiedRouteName, models, queryParams, shouldReplace) { + var routing = _emberMetal.get(this, '_routing'); + return function () { + payload.transition = routing.transitionTo(qualifiedRouteName, models, queryParams, shouldReplace); + }; + }, - var _newArgs$positional$values = newArgs.positional.values; + queryParams: null, - var slicedPositionalArgs = _newArgs$positional$values.slice(1); + qualifiedRouteName: _emberMetal.computed('targetRouteName', '_routing.currentState', function computeLinkToComponentQualifiedRouteName() { + var params = _emberMetal.get(this, 'params').slice(); + var lastParam = params[params.length - 1]; + if (lastParam && lastParam.isQueryParams) { + params.pop(); + } + var onlyQueryParamsSupplied = this[_emberGlimmerComponent.HAS_BLOCK] ? params.length === 0 : params.length === 1; + if (onlyQueryParamsSupplied) { + return _emberMetal.get(this, '_routing.currentRouteName'); + } + return _emberMetal.get(this, 'targetRouteName'); + }), - if (positionalParams && slicedPositionalArgs.length) { - _emberGlimmerSyntaxCurlyComponent.validatePositionalParameters(newArgs.named, slicedPositionalArgs, positionalParams); - } + resolvedQueryParams: _emberMetal.computed('queryParams', function computeLinkToComponentResolvedQueryParams() { + var resolvedQueryParams = {}; + var queryParams = _emberMetal.get(this, 'queryParams'); - var isRest = typeof positionalParams === 'string'; + if (!queryParams) { + return resolvedQueryParams; + } - // For non-rest position params, we need to perform the position -> name mapping - // at each layer to avoid a collision later when the args are used to construct - // the component instance (inside of processArgs(), inside of create()). - var positionalToNamedParams = {}; + var values = queryParams.values; + for (var key in values) { + if (!values.hasOwnProperty(key)) { + continue; + } + resolvedQueryParams[key] = values[key]; + } - if (!isRest && positionalParams && positionalParams.length > 0) { - var limit = Math.min(positionalParams.length, slicedPositionalArgs.length); + return resolvedQueryParams; + }), - for (var i = 0; i < limit; i++) { - var _name = positionalParams[i]; - positionalToNamedParams[_name] = slicedPositionalArgs[i]; + /** + Sets the element's `href` attribute to the url for + the `LinkComponent`'s targeted route. + If the `LinkComponent`'s `tagName` is changed to a value other + than `a`, this property will be ignored. + @property href + @private + */ + href: _emberMetal.computed('models', 'qualifiedRouteName', function computeLinkToComponentHref() { + if (_emberMetal.get(this, 'tagName') !== 'a') { + return; } - slicedPositionalArgs.length = 0; // Throw them away since you're merged in. - } + var qualifiedRouteName = _emberMetal.get(this, 'qualifiedRouteName'); + var models = _emberMetal.get(this, 'models'); - // args (aka 'oldArgs') may be undefined or simply be empty args, so - // we need to fall back to an empty array or object. - var oldNamed = args && args.named && args.named.map || {}; - var oldPositional = args && args.positional && args.positional.values || []; + if (_emberMetal.get(this, 'loading')) { + return _emberMetal.get(this, 'loadingHref'); + } - // Merge positional arrays - var mergedPositional = new Array(Math.max(oldPositional.length, slicedPositionalArgs.length)); - mergedPositional.splice.apply(mergedPositional, [0, oldPositional.length].concat(oldPositional)); - mergedPositional.splice.apply(mergedPositional, [0, slicedPositionalArgs.length].concat(slicedPositionalArgs)); + var routing = _emberMetal.get(this, '_routing'); + var queryParams = _emberMetal.get(this, 'queryParams.values'); - // Merge named maps - var mergedNamed = _emberUtils.assign({}, oldNamed, positionalToNamedParams, newArgs.named.map); + _emberMetal.runInDebug(function () { + /* + * Unfortunately, to get decent error messages, we need to do this. + * In some future state we should be able to use a "feature flag" + * which allows us to strip this without needing to call it twice. + * + * if (isDebugBuild()) { + * // Do the useful debug thing, probably including try/catch. + * } else { + * // Do the performant thing. + * } + */ + try { + routing.generateURL(qualifiedRouteName, models, queryParams); + } catch (e) { + _emberMetal.assert('You attempted to define a `{{link-to "' + qualifiedRouteName + '"}}` but did not pass the parameters required for generating its dynamic segments. ' + e.message); + } + }); - var mergedArgs = _glimmerRuntime.EvaluatedArgs.create(_glimmerRuntime.EvaluatedPositionalArgs.create(mergedPositional), _glimmerRuntime.EvaluatedNamedArgs.create(mergedNamed), _glimmerRuntime.Blocks.empty()); + return routing.generateURL(qualifiedRouteName, models, queryParams); + }), - return mergedArgs; - } + loading: _emberMetal.computed('_modelsAreLoaded', 'qualifiedRouteName', function computeLinkToComponentLoading() { + var qualifiedRouteName = _emberMetal.get(this, 'qualifiedRouteName'); + var modelsAreLoaded = _emberMetal.get(this, '_modelsAreLoaded'); - exports.default = function (vm, args, symbolTable) { - return ClosureComponentReference.create(args, symbolTable, vm.env); - }; -}); -enifed('ember-glimmer/helpers/concat', ['exports', 'ember-glimmer/utils/references', 'glimmer-runtime'], function (exports, _emberGlimmerUtilsReferences, _glimmerRuntime) { - 'use strict'; + if (!modelsAreLoaded || qualifiedRouteName == null) { + return _emberMetal.get(this, 'loadingClass'); + } + }), - /** - @module ember - @submodule ember-glimmer - */ + _modelsAreLoaded: _emberMetal.computed('models', function computeLinkToComponentModelsAreLoaded() { + var models = _emberMetal.get(this, 'models'); + for (var i = 0; i < models.length; i++) { + if (models[i] == null) { + return false; + } + } - /** - Concatenates the given arguments into a string. - - Example: - - ```handlebars - {{some-component name=(concat firstName " " lastName)}} - - {{! would pass name=" " to the component}} - ``` - - @public - @method concat - @for Ember.Templates.helpers - @since 1.13.0 - */ - function concat(_ref) { - var positional = _ref.positional; + return true; + }), - return positional.value().map(_glimmerRuntime.normalizeTextValue).join(''); - } + _getModels: function (params) { + var modelCount = params.length - 1; + var models = new Array(modelCount); - exports.default = function (vm, args) { - return new _emberGlimmerUtilsReferences.InternalHelperReference(concat, args); - }; -}); -enifed('ember-glimmer/helpers/debugger', ['exports', 'ember-metal/debug', 'glimmer-runtime'], function (exports, _emberMetalDebug, _glimmerRuntime) { - /*jshint debug:true*/ + for (var i = 0; i < modelCount; i++) { + var value = params[i + 1]; - /** - @module ember - @submodule ember-htmlbars - */ + while (_emberRuntime.ControllerMixin.detect(value)) { + _emberMetal.deprecate('Providing `{{link-to}}` with a param that is wrapped in a controller is deprecated. ' + (this.parentView ? 'Please update `' + this.parentView + '` to use `{{link-to "post" someController.model}}` instead.' : ''), false, { id: 'ember-routing-views.controller-wrapped-param', until: '3.0.0' }); + value = value.get('model'); + } - 'use strict'; + models[i] = value; + } - exports.default = debuggerHelper; - exports.setDebuggerCallback = setDebuggerCallback; - exports.resetDebuggerCallback = resetDebuggerCallback; + return models; + }, - /** - Execute the `debugger` statement in the current template's context. - - ```handlebars - {{debugger}} - ``` - - When using the debugger helper you will have access to a `get` function. This - function retrieves values available in the context of the template. - For example, if you're wondering why a value `{{foo}}` isn't rendering as - expected within a template, you could place a `{{debugger}}` statement and, - when the `debugger;` breakpoint is hit, you can attempt to retrieve this value: - - ``` - > get('foo') - ``` - - `get` is also aware of block variables. So in this situation - - ```handlebars - {{#each items as |item|}} - {{debugger}} - {{/each}} - ``` - - You'll be able to get values from the current item: - - ``` - > get('item.name') - ``` - - You can also access the context of the view to make sure it is the object that - you expect: - - ``` - > context - ``` - - @method debugger - @for Ember.Templates.helpers - @public - */ - function defaultCallback(context, get) { - /* jshint debug: true */ + /** + The default href value to use while a link-to is loading. + Only applies when tagName is 'a' + @property loadingHref + @type String + @default # + @private + */ + loadingHref: '#', - _emberMetalDebug.info('Use `context`, and `get()` to debug this template.'); + didReceiveAttrs: function () { + var queryParams = undefined; - debugger; - } + var params = _emberMetal.get(this, 'params'); - var callback = defaultCallback; + if (params) { + // Do not mutate params in place + params = params.slice(); + } - function debuggerHelper(vm, args, symbolTable) { - var context = vm.getSelf().value(); + _emberMetal.assert('You must provide one or more parameters to the link-to component.', (function () { + if (!params) { + return false; + } - // Note: this is totally an overkill since we are only compiling - // expressions, but this is the only kind of SymbolLookup we can - // construct. The symbol table itself should really be sufficient - // here – we should refactor the Glimmer code to make that possible. - var symbolLookup = new _glimmerRuntime.CompileIntoList(vm.env, symbolTable); + return params.length; + })()); - function get(path) { - // Problem: technically, we are getting a `PublicVM` here, but to - // evaluate an expression it requires the full VM. We happen to know - // that they are the same thing, so this would work for now. However - // this might break in the future. - return _glimmerRuntime.GetSyntax.build(path).compile(symbolLookup).evaluate(vm).value(); - } + var disabledWhen = _emberMetal.get(this, 'disabledWhen'); + if (disabledWhen !== undefined) { + this.set('disabled', disabledWhen); + } - callback(context, get); + // Process the positional arguments, in order. + // 1. Inline link title comes first, if present. + if (!this[_emberGlimmerComponent.HAS_BLOCK]) { + this.set('linkTitle', params.shift()); + } - return _glimmerRuntime.UNDEFINED_REFERENCE; - } + // 2. `targetRouteName` is now always at index 0. + this.set('targetRouteName', params[0]); - // These are exported for testing + // 3. The last argument (if still remaining) is the `queryParams` object. + var lastParam = params[params.length - 1]; - function setDebuggerCallback(newCallback) { - callback = newCallback; - } + if (lastParam && lastParam.isQueryParams) { + queryParams = params.pop(); + } else { + queryParams = { values: {} }; + } + this.set('queryParams', queryParams); - function resetDebuggerCallback() { - callback = defaultCallback; - } + // 4. Any remaining indices (excepting `targetRouteName` at 0) are `models`. + if (params.length > 1) { + this.set('models', this._getModels(params)); + } else { + this.set('models', []); + } + } + }); + + LinkComponent.toString = function () { + return 'LinkComponent'; + }; + + LinkComponent.reopenClass({ + positionalParams: 'params' + }); + + exports.default = LinkComponent; }); -enifed('ember-glimmer/helpers/each-in', ['exports', 'ember-utils'], function (exports, _emberUtils) { +enifed('ember-glimmer/components/text_area', ['exports', 'ember-glimmer/component', 'ember-views', 'ember-glimmer/templates/empty'], function (exports, _emberGlimmerComponent, _emberViews, _emberGlimmerTemplatesEmpty) { /** @module ember @submodule ember-glimmer */ 'use strict'; - exports.isEachIn = isEachIn; - /** - The `{{#each}}` helper loops over elements in a collection. It is an extension - of the base Handlebars `{{#each}}` helper. - The default behavior of `{{#each}}` is to yield its inner block once for every - item in an array passing the item as the first block parameter. + `{{textarea}}` inserts a new instance of ` ``` - ### Specifying Keys + Bound: - The `key` option is used to tell Ember how to determine if the array being - iterated over with `{{#each}}` has changed between renders. By helping Ember - detect that some elements in the array are the same, DOM elements can be - re-used, significantly improving rendering speed. + In the following example, the `writtenWords` property on `App.ApplicationController` + will be updated live as the user types 'Lots of text that IS bound' into + the text area of their browser's window. - For example, here's the `{{#each}}` helper with its `key` set to `id`: + ```javascript + App.ApplicationController = Ember.Controller.extend({ + writtenWords: "Lots of text that IS bound" + }); + ``` ```handlebars - {{#each model key="id" as |item|}} - {{/each}} + {{textarea value=writtenWords}} ``` - When this `{{#each}}` re-renders, Ember will match up the previously rendered - items (and reorder the generated DOM elements) based on each item's `id` - property. - By default the item's own reference is used. + Would result in the following HTML: - ### {{else}} condition + ```html + + ``` - `{{#each}}` can have a matching `{{else}}`. The contents of this block will render - if the collection is empty. + If you wanted a one way binding between the text area and a div tag + somewhere else on your screen, you could use `Ember.computed.oneWay`: + + ```javascript + App.ApplicationController = Ember.Controller.extend({ + writtenWords: "Lots of text that IS bound", + outputWrittenWords: Ember.computed.oneWay("writtenWords") + }); + ``` ```handlebars - {{#each developers as |person|}} - {{person.name}} - {{else}} -

    Sorry, nobody is available for this task.

    - {{/each}} + {{textarea value=writtenWords}} +
    + {{outputWrittenWords}} +
    ``` - @method each - @for Ember.Templates.helpers - @public - */ - - /** - The `{{each-in}}` helper loops over properties on an object. + Would result in the following HTML: - For example, given a `user` object that looks like: + ```html + + <-- the following div will be updated in real time as you type --> +
    + Lots of text that IS bound +
    + ``` + + Finally, this example really shows the power and ease of Ember when two + properties are bound to eachother via `Ember.computed.alias`. Type into + either text area box and they'll both stay in sync. Note that + `Ember.computed.alias` costs more in terms of performance, so only use it when + your really binding in both directions: ```javascript - { - "name": "Shelly Sails", - "age": 42 - } + App.ApplicationController = Ember.Controller.extend({ + writtenWords: "Lots of text that IS bound", + twoWayWrittenWords: Ember.computed.alias("writtenWords") + }); ``` - This template would display all properties on the `user` - object in a list: - ```handlebars -
      - {{#each-in user as |key value|}} -
    • {{key}}: {{value}}
    • - {{/each-in}} -
    + {{textarea value=writtenWords}} + {{textarea value=twoWayWrittenWords}} ``` - Outputting their name and age. + ```html + + <-- both updated in real time --> + + ``` - @method each-in - @for Ember.Templates.helpers - @public - @since 2.1.0 - */ - var EACH_IN_REFERENCE = _emberUtils.symbol('EACH_IN'); - - function isEachIn(ref) { - return ref && ref[EACH_IN_REFERENCE]; - } - - exports.default = function (vm, args) { - var ref = Object.create(args.positional.at(0)); - ref[EACH_IN_REFERENCE] = true; - return ref; - }; -}); -enifed('ember-glimmer/helpers/get', ['exports', 'ember-metal', 'ember-glimmer/utils/references', 'glimmer-reference'], function (exports, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference) { - 'use strict'; - - /** - @module ember - @submodule ember-glimmer - */ - - /** - Dynamically look up a property on an object. The second argument to `{{get}}` - should have a string value, although it can be bound. + ### Actions - For example, these two usages are equivilent: + The helper can send multiple actions based on user events. + The action property defines the action which is send when + the user presses the return key. ```handlebars - {{person.height}} - {{get person "height"}} + {{input action="submit"}} ``` - If there were several facts about a person, the `{{get}}` helper can dynamically - pick one: + The helper allows some user events to send actions. - ```handlebars - {{get person factName}} - ``` + * `enter` + * `insert-newline` + * `escape-press` + * `focus-in` + * `focus-out` + * `key-press` - For a more complex example, this template would allow the user to switch - between showing the user's height and weight with a click: + For example, if you desire an action to be sent when the input is blurred, + you only need to setup the action name to the event name property. ```handlebars - {{get person factName}} - - + {{textarea focus-in="alertMessage"}} ``` - The `{{get}}` helper can also respect mutable values itself. For example: + See more about [Text Support Actions](/api/classes/Ember.TextArea.html) - ```handlebars - {{input value=(mut (get person factName)) type="text"}} - - + ### Extension + + Internally, `{{textarea}}` creates an instance of `Ember.TextArea`, passing + arguments from the helper to `Ember.TextArea`'s `create` method. You can + extend the capabilities of text areas in your application by reopening this + class. For example, if you are building a Bootstrap project where `data-*` + attributes are used, you can globally add support for a `data-*` attribute + on all `{{textarea}}`s' in your app by reopening `Ember.TextArea` or + `Ember.TextSupport` and adding it to the `attributeBindings` concatenated + property: + + ```javascript + Ember.TextArea.reopen({ + attributeBindings: ['data-error'] + }); ``` - Would allow the user to swap what fact is being displayed, and also edit - that fact via a two-way mutable binding. + Keep in mind when writing `Ember.TextArea` subclasses that `Ember.TextArea` + itself extends `Ember.Component`. Expect isolated component semantics, not + legacy 1.x view semantics (like `controller` being present). - @public - @method get + See more about [Ember components](/api/classes/Ember.Component.html) + + @method textarea @for Ember.Templates.helpers - @since 2.1.0 - */ - - exports.default = function (vm, args) { - return GetHelperReference.create(args.positional.at(0), args.positional.at(1)); - }; - - var GetHelperReference = (function (_CachedReference) { - babelHelpers.inherits(GetHelperReference, _CachedReference); + @param {Hash} options + @public + */ - GetHelperReference.create = function create(sourceReference, pathReference) { - if (_glimmerReference.isConst(pathReference)) { - var parts = pathReference.value().split('.'); - return _glimmerReference.referenceFromParts(sourceReference, parts); - } else { - return new GetHelperReference(sourceReference, pathReference); - } - }; + /** + The internal class used to create textarea element when the `{{textarea}}` + helper is used. + + See [Ember.Templates.helpers.textarea](/api/classes/Ember.Templates.helpers.html#method_textarea) for usage details. + + ## Layout and LayoutName properties + + Because HTML `textarea` elements do not contain inner HTML the `layout` and + `layoutName` properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s + layout section for more information. + + @class TextArea + @namespace Ember + @extends Ember.Component + @uses Ember.TextSupport + @public + */ + exports.default = _emberGlimmerComponent.default.extend(_emberViews.TextSupport, { + classNames: ['ember-text-area'], - function GetHelperReference(sourceReference, pathReference) { - babelHelpers.classCallCheck(this, GetHelperReference); + layout: _emberGlimmerTemplatesEmpty.default, - _CachedReference.call(this); - this.sourceReference = sourceReference; - this.pathReference = pathReference; + tagName: 'textarea', + attributeBindings: ['rows', 'cols', 'name', 'selectionEnd', 'selectionStart', 'wrap', 'lang', 'dir', 'value'], + rows: null, + cols: null + }); +}); +enifed('ember-glimmer/components/text_field', ['exports', 'ember-utils', 'ember-metal', 'ember-environment', 'ember-glimmer/component', 'ember-glimmer/templates/empty', 'ember-views'], function (exports, _emberUtils, _emberMetal, _emberEnvironment, _emberGlimmerComponent, _emberGlimmerTemplatesEmpty, _emberViews) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; - this.lastPath = null; - this.innerReference = null; + var inputTypeTestElement = undefined; + var inputTypes = new _emberUtils.EmptyObject(); + function canSetTypeOfInput(type) { + if (type in inputTypes) { + return inputTypes[type]; + } - var innerTag = this.innerTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); + // if running in outside of a browser always return the + // original type + if (!_emberEnvironment.environment.hasDOM) { + inputTypes[type] = type; - this.tag = _glimmerReference.combine([sourceReference.tag, pathReference.tag, innerTag]); + return type; } - GetHelperReference.prototype.compute = function compute() { - var lastPath = this.lastPath; - var innerReference = this.innerReference; - var innerTag = this.innerTag; + if (!inputTypeTestElement) { + inputTypeTestElement = document.createElement('input'); + } - var path = this.lastPath = this.pathReference.value(); + try { + inputTypeTestElement.type = type; + } catch (e) { + // ignored + } - if (path !== lastPath) { - if (path) { - var pathType = typeof path; + return inputTypes[type] = inputTypeTestElement.type === type; + } - if (pathType === 'string') { - innerReference = this.innerReference = _glimmerReference.referenceFromParts(this.sourceReference, path.split('.')); - } else if (pathType === 'number') { - innerReference = this.innerReference = this.sourceReference.get(path); - } + /** + + The internal class used to create text inputs when the `{{input}}` + helper is used with `type` of `text`. + + See [Ember.Templates.helpers.input](/api/classes/Ember.Templates.helpers.html#method_input) for usage details. + + ## Layout and LayoutName properties + + Because HTML `input` elements are self closing `layout` and `layoutName` + properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s + layout section for more information. + + @class TextField + @namespace Ember + @extends Ember.Component + @uses Ember.TextSupport + @public + */ + exports.default = _emberGlimmerComponent.default.extend(_emberViews.TextSupport, { + layout: _emberGlimmerTemplatesEmpty.default, + classNames: ['ember-text-field'], + tagName: 'input', + attributeBindings: ['accept', 'autocomplete', 'autosave', 'dir', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget', 'height', 'inputmode', 'lang', 'list', 'max', 'min', 'multiple', 'name', 'pattern', 'size', 'step', 'type', 'value', 'width'], - innerTag.update(innerReference.tag); - } else { - innerReference = this.innerReference = null; - innerTag.update(_glimmerReference.CONSTANT_TAG); - } - } + /** + The `value` attribute of the input element. As the user inputs text, this + property is updated live. + @property value + @type String + @default "" + @public + */ + value: '', - return innerReference ? innerReference.value() : null; - }; + /** + The `type` attribute of the input element. + @property type + @type String + @default "text" + @public + */ + type: _emberMetal.computed({ + get: function () { + return 'text'; + }, - GetHelperReference.prototype[_emberGlimmerUtilsReferences.UPDATE] = function (value) { - _emberMetal.set(this.sourceReference.value(), this.pathReference.value(), value); - }; + set: function (key, value) { + var type = 'text'; - return GetHelperReference; - })(_emberGlimmerUtilsReferences.CachedReference); -}); -enifed("ember-glimmer/helpers/hash", ["exports"], function (exports) { - /** - @module ember - @submodule ember-glimmer - */ + if (canSetTypeOfInput(value)) { + type = value; + } - /** - Use the `{{hash}}` helper to create a hash to pass as an option to your - components. This is specially useful for contextual components where you can - just yield a hash: - - ```handlebars - {{yield (hash - name='Sarah' - title=office - )}} - ``` - - Would result in an object such as: - - ```js - { name: 'Sarah', title: this.get('office') } - ``` - - Where the `title` is bound to updates of the `office` property. - - @method hash - @for Ember.Templates.helpers - @param {Object} options - @return {Object} Hash + return type; + } + }), + + /** + The `size` of the text field in characters. + @property size + @type String + @default null @public */ + size: null, - "use strict"; + /** + The `pattern` attribute of input element. + @property pattern + @type String + @default null + @public + */ + pattern: null, - exports.default = function (vm, args) { - return args.named; - }; + /** + The `min` attribute of input element used with `type="number"` or `type="range"`. + @property min + @type String + @default null + @since 1.4.0 + @public + */ + min: null, + + /** + The `max` attribute of input element used with `type="number"` or `type="range"`. + @property max + @type String + @default null + @since 1.4.0 + @public + */ + max: null + }); }); -enifed('ember-glimmer/helpers/if-unless', ['exports', 'ember-metal', 'ember-glimmer/utils/references', 'glimmer-reference'], function (exports, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference) { - /** - @module ember - @submodule ember-glimmer - */ +enifed('ember-glimmer/dom', ['exports', '@glimmer/runtime', '@glimmer/node'], function (exports, _glimmerRuntime, _glimmerNode) { + 'use strict'; + exports.DOMChanges = _glimmerRuntime.DOMChanges; + exports.DOMTreeConstruction = _glimmerRuntime.DOMTreeConstruction; + exports.NodeDOMTreeConstruction = _glimmerNode.NodeDOMTreeConstruction; +}); +enifed('ember-glimmer/environment', ['exports', 'ember-utils', 'ember-metal', 'ember-views', '@glimmer/runtime', 'ember-glimmer/syntax/curly-component', 'ember-glimmer/syntax', 'ember-glimmer/utils/iterable', 'ember-glimmer/utils/references', 'ember-glimmer/utils/debug-stack', 'ember-glimmer/helpers/if-unless', 'ember-glimmer/helpers/action', 'ember-glimmer/helpers/component', 'ember-glimmer/helpers/concat', 'ember-glimmer/helpers/get', 'ember-glimmer/helpers/hash', 'ember-glimmer/helpers/loc', 'ember-glimmer/helpers/log', 'ember-glimmer/helpers/mut', 'ember-glimmer/helpers/readonly', 'ember-glimmer/helpers/unbound', 'ember-glimmer/helpers/-class', 'ember-glimmer/helpers/-input-type', 'ember-glimmer/helpers/query-param', 'ember-glimmer/helpers/each-in', 'ember-glimmer/helpers/-normalize-class', 'ember-glimmer/helpers/-html-safe', 'ember-glimmer/protocol-for-url', 'container', 'ember-glimmer/modifiers/action'], function (exports, _emberUtils, _emberMetal, _emberViews, _glimmerRuntime, _emberGlimmerSyntaxCurlyComponent, _emberGlimmerSyntax, _emberGlimmerUtilsIterable, _emberGlimmerUtilsReferences, _emberGlimmerUtilsDebugStack, _emberGlimmerHelpersIfUnless, _emberGlimmerHelpersAction, _emberGlimmerHelpersComponent, _emberGlimmerHelpersConcat, _emberGlimmerHelpersGet, _emberGlimmerHelpersHash, _emberGlimmerHelpersLoc, _emberGlimmerHelpersLog, _emberGlimmerHelpersMut, _emberGlimmerHelpersReadonly, _emberGlimmerHelpersUnbound, _emberGlimmerHelpersClass, _emberGlimmerHelpersInputType, _emberGlimmerHelpersQueryParam, _emberGlimmerHelpersEachIn, _emberGlimmerHelpersNormalizeClass, _emberGlimmerHelpersHtmlSafe, _emberGlimmerProtocolForUrl, _container, _emberGlimmerModifiersAction) { 'use strict'; - exports.inlineIf = inlineIf; - exports.inlineUnless = inlineUnless; + var Environment = (function (_GlimmerEnvironment) { + babelHelpers.inherits(Environment, _GlimmerEnvironment); - /** - 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`, `NaN` or an empty array, the block will not be rendered. - - ```handlebars - {{! will not render if foo is falsey}} - {{#if foo}} - Welcome to the {{foo.bar}} - {{/if}} - ``` - - You can also specify a template to show if the property is falsey by using - the `else` helper. - - ```handlebars - {{! is it raining outside?}} - {{#if isRaining}} - Yes, grab an umbrella! - {{else}} - No, it's lovely outside! - {{/if}} - ``` - - You are also able to combine `else` and `if` helpers to create more complex - conditional logic. - - ```handlebars - {{#if isMorning}} - Good morning - {{else if isAfternoon}} - Good afternoon - {{else}} - Good night - {{/if}} - ``` - - You can use `if` inline to conditionally render a single property or string. - This helper acts like a ternary operator. If the first property is truthy, - the second argument will be displayed, if not, the third argument will be - displayed - - ```handlebars - {{if useLongGreeting "Hello" "Hi"}} Dave - ``` - - Finally, you can use the `if` helper inside another helper as a subexpression. - - ```handlebars - {{some-component height=(if isBig "100" "10")}} - ``` - - @method if - @for Ember.Templates.helpers - @public - */ + Environment.create = function create(options) { + return new Environment(options); + }; - var ConditionalHelperReference = (function (_CachedReference) { - babelHelpers.inherits(ConditionalHelperReference, _CachedReference); + function Environment(_ref) { + var _this = this; - ConditionalHelperReference.create = function create(_condRef, _truthyRef, _falsyRef) { - var condRef = _emberGlimmerUtilsReferences.ConditionalReference.create(_condRef); - var truthyRef = _truthyRef || _emberGlimmerUtilsReferences.UNDEFINED_REFERENCE; - var falsyRef = _falsyRef || _emberGlimmerUtilsReferences.UNDEFINED_REFERENCE; + var owner = _ref[_emberUtils.OWNER]; + babelHelpers.classCallCheck(this, Environment); - if (_glimmerReference.isConst(condRef)) { - return condRef.value() ? truthyRef : falsyRef; - } else { - return new ConditionalHelperReference(condRef, truthyRef, falsyRef); - } - }; + _GlimmerEnvironment.apply(this, arguments); + this.owner = owner; + this.isInteractive = owner.lookup('-environment:main').isInteractive; - function ConditionalHelperReference(cond, truthy, falsy) { - babelHelpers.classCallCheck(this, ConditionalHelperReference); + // can be removed once https://github.com/tildeio/glimmer/pull/305 lands + this.destroyedComponents = undefined; - _CachedReference.call(this); + _emberGlimmerProtocolForUrl.default(this); - this.branchTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - this.tag = _glimmerReference.combine([cond.tag, this.branchTag]); + this._definitionCache = new _emberMetal.Cache(2000, function (_ref2) { + var name = _ref2.name; + var source = _ref2.source; + var owner = _ref2.owner; - this.cond = cond; - this.truthy = truthy; - this.falsy = falsy; - } + var _lookupComponent = _emberViews.lookupComponent(owner, name, { source: source }); - /** - The inline `if` helper conditionally renders a single property or string. - This helper acts like a ternary operator. If the first property is truthy, - the second argument will be displayed, otherwise, the third argument will be - displayed - - ```handlebars - {{if useLongGreeting "Hello" "Hi"}} Alex - ``` - - You can use the `if` helper inside another helper as a subexpression. - - ```handlebars - {{some-component height=(if isBig "100" "10")}} - ``` - - @method if - @for Ember.Templates.helpers - @public - */ + var componentFactory = _lookupComponent.component; + var layout = _lookupComponent.layout; - ConditionalHelperReference.prototype.compute = function compute() { - var cond = this.cond; - var truthy = this.truthy; - var falsy = this.falsy; + if (componentFactory || layout) { + return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentDefinition(name, componentFactory, layout); + } + }, function (_ref3) { + var name = _ref3.name; + var source = _ref3.source; + var owner = _ref3.owner; - var branch = cond.value() ? truthy : falsy; + var expandedName = source && owner._resolveLocalLookupName(name, source) || name; + var ownerGuid = _emberUtils.guidFor(owner); - this.branchTag.update(branch.tag); + return ownerGuid + '|' + expandedName; + }); - return branch.value(); - }; + this._templateCache = new _emberMetal.Cache(1000, function (_ref4) { + var Template = _ref4.Template; + var owner = _ref4.owner; - return ConditionalHelperReference; - })(_emberGlimmerUtilsReferences.CachedReference); + if (Template.create) { + var _Template$create; - function inlineIf(vm, _ref) { - var positional = _ref.positional; + // we received a factory + return Template.create((_Template$create = { env: _this }, _Template$create[_emberUtils.OWNER] = owner, _Template$create)); + } else { + // we were provided an instance already + return Template; + } + }, function (_ref5) { + var Template = _ref5.Template; + var owner = _ref5.owner; + return _emberUtils.guidFor(owner) + '|' + Template.id; + }); - switch (positional.length) { - case 2: - return ConditionalHelperReference.create(positional.at(0), positional.at(1), null); - case 3: - return ConditionalHelperReference.create(positional.at(0), positional.at(1), positional.at(2)); - default: - _emberMetal.assert('The inline form of the `if` helper expects two or three arguments, e.g. ' + '`{{if trialExpired "Expired" expiryDate}}`.'); - } - } + this._compilerCache = new _emberMetal.Cache(10, function (Compiler) { + return new _emberMetal.Cache(2000, function (template) { + var compilable = new Compiler(template); + return _glimmerRuntime.compileLayout(compilable, _this); + }, function (template) { + var owner = template.meta.owner; + return _emberUtils.guidFor(owner) + '|' + template.id; + }); + }, function (Compiler) { + return Compiler.id; + }); - /** - The inline `unless` helper conditionally renders a single property or string. - This helper acts like a ternary operator. If the first property is falsy, - the second argument will be displayed, otherwise, the third argument will be - displayed - - ```handlebars - {{unless useLongGreeting "Hi" "Hello"}} Ben - ``` - - You can use the `unless` helper inside another helper as a subexpression. - - ```handlebars - {{some-component height=(unless isBig "10" "100")}} - ``` - - @method unless - @for Ember.Templates.helpers - @public - */ + this.builtInModifiers = { + action: new _emberGlimmerModifiersAction.default() + }; - function inlineUnless(vm, _ref2) { - var positional = _ref2.positional; + this.builtInHelpers = { + if: _emberGlimmerHelpersIfUnless.inlineIf, + action: _emberGlimmerHelpersAction.default, + component: _emberGlimmerHelpersComponent.default, + concat: _emberGlimmerHelpersConcat.default, + get: _emberGlimmerHelpersGet.default, + hash: _emberGlimmerHelpersHash.default, + loc: _emberGlimmerHelpersLoc.default, + log: _emberGlimmerHelpersLog.default, + mut: _emberGlimmerHelpersMut.default, + 'query-params': _emberGlimmerHelpersQueryParam.default, + readonly: _emberGlimmerHelpersReadonly.default, + unbound: _emberGlimmerHelpersUnbound.default, + unless: _emberGlimmerHelpersIfUnless.inlineUnless, + '-class': _emberGlimmerHelpersClass.default, + '-each-in': _emberGlimmerHelpersEachIn.default, + '-input-type': _emberGlimmerHelpersInputType.default, + '-normalize-class': _emberGlimmerHelpersNormalizeClass.default, + '-html-safe': _emberGlimmerHelpersHtmlSafe.default, + '-get-dynamic-var': _glimmerRuntime.getDynamicVar + }; - switch (positional.length) { - case 2: - return ConditionalHelperReference.create(positional.at(0), null, positional.at(1)); - case 3: - return ConditionalHelperReference.create(positional.at(0), positional.at(2), positional.at(1)); - default: - _emberMetal.assert('The inline form of the `unless` helper expects two or three arguments, e.g. ' + '`{{unless isFirstLogin "Welcome back!"}}`.'); + _emberMetal.runInDebug(function () { + return _this.debugStack = new _emberGlimmerUtilsDebugStack.default(); + }); } - } -}); -enifed('ember-glimmer/helpers/loc', ['exports', 'ember-glimmer/utils/references', 'ember-runtime'], function (exports, _emberGlimmerUtilsReferences, _emberRuntime) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; - /** - Calls [Ember.String.loc](/api/classes/Ember.String.html#method_loc) with the - provided string. This is a convenient way to localize text within a template. - For example: - - ```javascript - Ember.STRINGS = { - '_welcome_': 'Bonjour' + Environment.prototype.macros = function macros() { + var macros = _GlimmerEnvironment.prototype.macros.call(this); + _emberGlimmerSyntax.populateMacros(macros.blocks, macros.inlines); + return macros; }; - ``` - - ```handlebars -
    - {{loc '_welcome_'}} -
    - ``` - - ```html -
    - Bonjour -
    - ``` - - See [Ember.String.loc](/api/classes/Ember.String.html#method_loc) for how to - set up localized string references. - - @method loc - @for Ember.Templates.helpers - @param {String} str The string to format. - @see {Ember.String#loc} - @public - */ - function locHelper(_ref) { - var positional = _ref.positional; - return _emberRuntime.String.loc.apply(null, positional.value()); - } + Environment.prototype.hasComponentDefinition = function hasComponentDefinition() { + return false; + }; - exports.default = function (vm, args) { - return new _emberGlimmerUtilsReferences.InternalHelperReference(locHelper, args); - }; -}); -enifed('ember-glimmer/helpers/log', ['exports', 'ember-glimmer/utils/references', 'ember-console'], function (exports, _emberGlimmerUtilsReferences, _emberConsole) { - 'use strict'; + Environment.prototype.getComponentDefinition = function getComponentDefinition(path, symbolTable) { + var name = path[0]; + var blockMeta = symbolTable.getMeta(); + var owner = blockMeta.owner; + var source = blockMeta.moduleName && 'template:' + blockMeta.moduleName; - /** - `log` allows you to output the value of variables in the current rendering - context. `log` also accepts primitive types such as strings or numbers. - - ```handlebars - {{log "myVariable:" myVariable }} - ``` - - @method log - @for Ember.Templates.helpers - @param {Array} params - @public - */ - function log(_ref) { - var positional = _ref.positional; + return this._definitionCache.get({ name: name, source: source, owner: owner }); + }; - _emberConsole.default.log.apply(null, positional.value()); - } + // normally templates should be exported at the proper module name + // and cached in the container, but this cache supports templates + // that have been set directly on the component's layout property - exports.default = function (vm, args) { - return new _emberGlimmerUtilsReferences.InternalHelperReference(log, args); - }; -}); + Environment.prototype.getTemplate = function getTemplate(Template, owner) { + return this._templateCache.get({ Template: Template, owner: owner }); + }; -/** -@module ember -@submodule ember-glimmer -*/ -enifed('ember-glimmer/helpers/mut', ['exports', 'ember-utils', 'ember-metal', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/action'], function (exports, _emberUtils, _emberMetal, _emberGlimmerUtilsReferences, _emberGlimmerHelpersAction) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; + // a Compiler can wrap the template so it needs its own cache - exports.isMut = isMut; - exports.unMut = unMut; + Environment.prototype.getCompiledBlock = function getCompiledBlock(Compiler, template) { + var compilerCache = this._compilerCache.get(Compiler); + return compilerCache.get(template); + }; - /** - 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 component__. - - To specify that a parameter is mutable, when invoking the child `Component`: - - ```handlebars - {{my-child childClickCount=(mut totalClicks)}} - ``` - - The child `Component` can then modify the parent's value just by modifying its own - property: - - ```javascript - // my-child.js - export default Component.extend({ - click() { - this.incrementProperty('childClickCount'); - } - }); - ``` - - Additionally, the `mut` helper can be combined with the `action` helper to - mutate a value. For example: - - ```handlebars - {{my-child childClickCount=totalClicks click-count-change=(action (mut totalClicks))}} - ``` - - The child `Component` would invoke the action with the new click value: - - ```javascript - // my-child.js - export default Component.extend({ - click() { - this.get('clickCountChange')(this.get('childClickCount') + 1); + Environment.prototype.hasPartial = function hasPartial(name, symbolTable) { + var _symbolTable$getMeta = symbolTable.getMeta(); + + var owner = _symbolTable$getMeta.owner; + + return _emberViews.hasPartial(name, owner); + }; + + Environment.prototype.lookupPartial = function lookupPartial(name, symbolTable) { + var _symbolTable$getMeta2 = symbolTable.getMeta(); + + var owner = _symbolTable$getMeta2.owner; + + var partial = { + template: _emberViews.lookupPartial(name, owner) + }; + + if (partial.template) { + return partial; + } else { + throw new Error(name + ' is not a partial'); } - }); - ``` - - The `mut` helper changes the `totalClicks` value to what was provided as the action argument. - - The `mut` helper, when used with `action`, will return a function that - sets the value passed to `mut` to its first argument. This works like any other - closure action and interacts with the other features `action` provides. - As an example, we can create a button that increments a value passing the value - directly to the `action`: + }; + + Environment.prototype.hasHelper = function hasHelper(nameParts, symbolTable) { + _emberMetal.assert('The first argument passed into `hasHelper` should be an array', Array.isArray(nameParts)); + + // helpers are not allowed to include a dot in their invocation + if (nameParts.length > 1) { + return false; + } + + var name = nameParts[0]; + + if (this.builtInHelpers[name]) { + return true; + } + + var blockMeta = symbolTable.getMeta(); + var owner = blockMeta.owner; + var options = { source: 'template:' + blockMeta.moduleName }; + + return owner.hasRegistration('helper:' + name, options) || owner.hasRegistration('helper:' + name); + }; + + Environment.prototype.lookupHelper = function lookupHelper(nameParts, symbolTable) { + _emberMetal.assert('The first argument passed into `lookupHelper` should be an array', Array.isArray(nameParts)); + + var name = nameParts[0]; + var helper = this.builtInHelpers[name]; + + if (helper) { + return helper; + } + + var blockMeta = symbolTable.getMeta(); + var owner = blockMeta.owner; + var options = blockMeta.moduleName && { source: 'template:' + blockMeta.moduleName } || {}; + + if (true) { + var _ret = (function () { + var helperFactory = owner[_container.FACTORY_FOR]('helper:' + name, options) || owner[_container.FACTORY_FOR]('helper:' + name); + + // TODO: try to unify this into a consistent protocol to avoid wasteful closure allocations + if (helperFactory.class.isHelperInstance) { + return { + v: function (vm, args) { + return _emberGlimmerUtilsReferences.SimpleHelperReference.create(helperFactory.class.compute, args); + } + }; + } else if (helperFactory.class.isHelperFactory) { + if (!_emberMetal.isFeatureEnabled('ember-no-double-extend')) { + helperFactory = helperFactory.create(); + } + return { + v: function (vm, args) { + return _emberGlimmerUtilsReferences.ClassBasedHelperReference.create(helperFactory, vm, args); + } + }; + } else { + throw new Error(nameParts + ' is not a helper'); + } + })(); + + if (typeof _ret === 'object') return _ret.v; + } else { + var _ret2 = (function () { + var helperFactory = owner.lookup('helper:' + name, options) || owner.lookup('helper:' + name); + + // TODO: try to unify this into a consistent protocol to avoid wasteful closure allocations + if (helperFactory.isHelperInstance) { + return { + v: function (vm, args) { + return _emberGlimmerUtilsReferences.SimpleHelperReference.create(helperFactory.compute, args); + } + }; + } else if (helperFactory.isHelperFactory) { + return { + v: function (vm, args) { + return _emberGlimmerUtilsReferences.ClassBasedHelperReference.create(helperFactory, vm, args); + } + }; + } else { + throw new Error(nameParts + ' is not a helper'); + } + })(); + + if (typeof _ret2 === 'object') return _ret2.v; + } + }; + + Environment.prototype.hasModifier = function hasModifier(nameParts) { + _emberMetal.assert('The first argument passed into `hasModifier` should be an array', Array.isArray(nameParts)); + + // modifiers are not allowed to include a dot in their invocation + if (nameParts.length > 1) { + return false; + } + + return !!this.builtInModifiers[nameParts[0]]; + }; + + Environment.prototype.lookupModifier = function lookupModifier(nameParts) { + _emberMetal.assert('The first argument passed into `lookupModifier` should be an array', Array.isArray(nameParts)); + + var modifier = this.builtInModifiers[nameParts[0]]; + + if (modifier) { + return modifier; + } else { + throw new Error(nameParts + ' is not a modifier'); + } + }; + + Environment.prototype.toConditionalReference = function toConditionalReference(reference) { + return _emberGlimmerUtilsReferences.ConditionalReference.create(reference); + }; + + Environment.prototype.iterableFor = function iterableFor(ref, args) { + var keyPath = args.named.get('key').value(); + return _emberGlimmerUtilsIterable.default(ref, keyPath); + }; + + Environment.prototype.scheduleInstallModifier = function scheduleInstallModifier() { + if (this.isInteractive) { + var _GlimmerEnvironment$prototype$scheduleInstallModifier; + + (_GlimmerEnvironment$prototype$scheduleInstallModifier = _GlimmerEnvironment.prototype.scheduleInstallModifier).call.apply(_GlimmerEnvironment$prototype$scheduleInstallModifier, [this].concat(babelHelpers.slice.call(arguments))); + } + }; + + Environment.prototype.scheduleUpdateModifier = function scheduleUpdateModifier() { + if (this.isInteractive) { + var _GlimmerEnvironment$prototype$scheduleUpdateModifier; + + (_GlimmerEnvironment$prototype$scheduleUpdateModifier = _GlimmerEnvironment.prototype.scheduleUpdateModifier).call.apply(_GlimmerEnvironment$prototype$scheduleUpdateModifier, [this].concat(babelHelpers.slice.call(arguments))); + } + }; + + Environment.prototype.didDestroy = function didDestroy(destroyable) { + destroyable.destroy(); + }; + + Environment.prototype.begin = function begin() { + this.inTransaction = true; + + _GlimmerEnvironment.prototype.begin.call(this); + + this.destroyedComponents = []; + }; + + Environment.prototype.commit = function commit() { + // components queued for destruction must be destroyed before firing + // `didCreate` to prevent errors when removing and adding a component + // with the same name (would throw an error when added to view registry) + for (var i = 0; i < this.destroyedComponents.length; i++) { + this.destroyedComponents[i].destroy(); + } + + _GlimmerEnvironment.prototype.commit.call(this); + + this.inTransaction = false; + }; + + return Environment; + })(_glimmerRuntime.Environment); + + exports.default = Environment; + + _emberMetal.runInDebug(function () { + var StyleAttributeManager = (function (_AttributeManager) { + babelHelpers.inherits(StyleAttributeManager, _AttributeManager); + + function StyleAttributeManager() { + babelHelpers.classCallCheck(this, StyleAttributeManager); + + _AttributeManager.apply(this, arguments); + } + + StyleAttributeManager.prototype.setAttribute = function setAttribute(dom, element, value) { + var _AttributeManager$prototype$setAttribute; + + _emberMetal.warn(_emberViews.STYLE_WARNING, (function () { + if (value === null || value === undefined || _glimmerRuntime.isSafeString(value)) { + return true; + } + return false; + })(), { id: 'ember-htmlbars.style-xss-warning' }); + (_AttributeManager$prototype$setAttribute = _AttributeManager.prototype.setAttribute).call.apply(_AttributeManager$prototype$setAttribute, [this].concat(babelHelpers.slice.call(arguments))); + }; + + StyleAttributeManager.prototype.updateAttribute = function updateAttribute(dom, element, value) { + var _AttributeManager$prototype$updateAttribute; + + _emberMetal.warn(_emberViews.STYLE_WARNING, (function () { + if (value === null || value === undefined || _glimmerRuntime.isSafeString(value)) { + return true; + } + return false; + })(), { id: 'ember-htmlbars.style-xss-warning' }); + (_AttributeManager$prototype$updateAttribute = _AttributeManager.prototype.updateAttribute).call.apply(_AttributeManager$prototype$updateAttribute, [this].concat(babelHelpers.slice.call(arguments))); + }; + + return StyleAttributeManager; + })(_glimmerRuntime.AttributeManager); + + var STYLE_ATTRIBUTE_MANANGER = new StyleAttributeManager('style'); + + Environment.prototype.attributeFor = function (element, attribute, isTrusting, namespace) { + if (attribute === 'style' && !isTrusting) { + return STYLE_ATTRIBUTE_MANANGER; + } + + return _glimmerRuntime.Environment.prototype.attributeFor.call(this, element, attribute, isTrusting); + }; + }); +}); +enifed('ember-glimmer/helper', ['exports', 'ember-utils', 'ember-runtime', '@glimmer/reference'], function (exports, _emberUtils, _emberRuntime, _glimmerReference) { + /** + @module ember + @submodule ember-glimmer + */ + + 'use strict'; + + exports.helper = helper; + var RECOMPUTE_TAG = _emberUtils.symbol('RECOMPUTE_TAG'); + + exports.RECOMPUTE_TAG = RECOMPUTE_TAG; + /** + Ember Helpers are functions that can compute values, and are used in templates. + For example, this code calls a helper named `format-currency`: ```handlebars - {{! inc helper is not provided by Ember }} - +
    {{format-currency cents currency="$"}}
    ``` - You can also use the `value` option: + Additionally a helper can be called as a nested helper (sometimes called a + subexpression). In this example, the computed value of a helper is passed + to a component named `show-money`: ```handlebars - + {{show-money amount=(format-currency cents currency="$")}} ``` - @method mut - @param {Object} [attr] the "two-way" attribute that can be modified. - @for Ember.Templates.helpers + Helpers defined using a class must provide a `compute` function. For example: + + ```js + export default Ember.Helper.extend({ + compute(params, hash) { + let cents = params[0]; + let currency = hash.currency; + return `${currency}${cents * 0.01}`; + } + }); + ``` + + Each time the input to a helper changes, the `compute` function will be + called again. + + As instances, these helpers also have access to the container an will accept + injected dependencies. + + Additionally, class helpers can call `recompute` to force a new computation. + + @class Ember.Helper @public + @since 1.13.0 */ - var MUT_REFERENCE = _emberUtils.symbol('MUT'); - var SOURCE = _emberUtils.symbol('SOURCE'); + var Helper = _emberRuntime.FrameworkObject.extend({ + isHelperInstance: true, - function isMut(ref) { - return ref && ref[MUT_REFERENCE]; + init: function () { + this._super.apply(this, arguments); + this[RECOMPUTE_TAG] = new _glimmerReference.DirtyableTag(); + }, + + /** + 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 + session service changes: + ```js + // app/helpers/current-user-email.js + export default Ember.Helper.extend({ + session: Ember.inject.service(), + onNewUser: Ember.observer('session.currentUser', function() { + this.recompute(); + }), + compute() { + return this.get('session.currentUser.email'); + } + }); + ``` + @method recompute + @public + @since 1.13.0 + */ + recompute: function () { + this[RECOMPUTE_TAG].dirty(); + } + + /** + Override this function when writing a class-based helper. + @method compute + @param {Array} params The positional arguments to the helper + @param {Object} hash The named arguments to the helper + @public + @since 1.13.0 + */ + }); + + Helper.reopenClass({ + isHelperFactory: true + }); + + /** + In many cases, the ceremony of a full `Ember.Helper` class is not required. + The `helper` method create pure-function helpers without instances. For + example: + + ```js + // app/helpers/format-currency.js + export default Ember.Helper.helper(function(params, hash) { + let cents = params[0]; + let currency = hash.currency; + return `${currency}${cents * 0.01}`; + }); + ``` + + @static + @param {Function} helper The helper function + @method helper + @public + @since 1.13.0 + */ + + function helper(helperFn) { + return { + isHelperInstance: true, + compute: helperFn + }; } - function unMut(ref) { - return ref[SOURCE] || ref; + exports.default = Helper; +}); +enifed('ember-glimmer/helpers/-class', ['exports', 'ember-glimmer/utils/references', 'ember-runtime'], function (exports, _emberGlimmerUtilsReferences, _emberRuntime) { + 'use strict'; + + function classHelper(_ref) { + var positional = _ref.positional; + + var path = positional.at(0); + var args = positional.length; + var value = path.value(); + + if (value === true) { + if (args > 1) { + return _emberRuntime.String.dasherize(positional.at(1).value()); + } + return null; + } + + if (value === false) { + if (args > 2) { + return _emberRuntime.String.dasherize(positional.at(2).value()); + } + return null; + } + + return value; } exports.default = function (vm, args) { - var rawRef = args.positional.at(0); + return new _emberGlimmerUtilsReferences.InternalHelperReference(classHelper, args); + }; +}); +enifed('ember-glimmer/helpers/-html-safe', ['exports', 'ember-glimmer/utils/references', 'ember-glimmer/utils/string'], function (exports, _emberGlimmerUtilsReferences, _emberGlimmerUtilsString) { + 'use strict'; - if (isMut(rawRef)) { - return rawRef; - } + function htmlSafe(_ref) { + var positional = _ref.positional; - // TODO: Improve this error message. This covers at least two distinct - // cases: - // - // 1. (mut "not a path") – passing a literal, result from a helper - // invocation, etc - // - // 2. (mut receivedValue) – passing a value received from the caller - // that was originally derived from a literal, result from a helper - // invocation, etc - // - // This message is alright for the first case, but could be quite - // confusing for the second case. - _emberMetal.assert('You can only pass a path to mut', rawRef[_emberGlimmerUtilsReferences.UPDATE]); + var path = positional.at(0); + return new _emberGlimmerUtilsString.SafeString(path.value()); + } - var wrappedRef = Object.create(rawRef); + exports.default = function (vm, args) { + return new _emberGlimmerUtilsReferences.InternalHelperReference(htmlSafe, args); + }; +}); +enifed('ember-glimmer/helpers/-input-type', ['exports', 'ember-glimmer/utils/references'], function (exports, _emberGlimmerUtilsReferences) { + 'use strict'; - wrappedRef[SOURCE] = rawRef; - wrappedRef[_emberGlimmerHelpersAction.INVOKE] = rawRef[_emberGlimmerUtilsReferences.UPDATE]; - wrappedRef[MUT_REFERENCE] = true; + function inputTypeHelper(_ref) { + var positional = _ref.positional; + var named = _ref.named; - return wrappedRef; + var type = positional.at(0).value(); + if (type === 'checkbox') { + return '-checkbox'; + } + return '-text-field'; + } + + exports.default = function (vm, args) { + return new _emberGlimmerUtilsReferences.InternalHelperReference(inputTypeHelper, args); }; }); -enifed('ember-glimmer/helpers/query-param', ['exports', 'ember-utils', 'ember-glimmer/utils/references', 'ember-metal', 'ember-routing'], function (exports, _emberUtils, _emberGlimmerUtilsReferences, _emberMetal, _emberRouting) { - /** - @module ember - @submodule ember-glimmer - */ +enifed('ember-glimmer/helpers/-normalize-class', ['exports', 'ember-glimmer/utils/references', 'ember-runtime'], function (exports, _emberGlimmerUtilsReferences, _emberRuntime) { 'use strict'; - /** - This is a helper to be used in conjunction with the link-to helper. - It will supply url query parameters to the target route. - - Example - - ```handlebars - {{#link-to 'posts' (query-params direction="asc")}}Sort{{/link-to}} - ``` - - @method query-params - @for Ember.Templates.helpers - @param {Object} hash takes a hash of query parameters - @return {Object} A `QueryParams` object for `{{link-to}}` - @public - */ - function queryParams(_ref) { + function normalizeClass(_ref) { var positional = _ref.positional; var named = _ref.named; - _emberMetal.assert('The `query-params` helper only accepts hash parameters, e.g. (query-params queryParamPropertyName=\'foo\') as opposed to just (query-params \'foo\')', positional.value().length === 0); + var classNameParts = positional.at(0).value().split('.'); + var className = classNameParts[classNameParts.length - 1]; + var value = positional.at(1).value(); - return _emberRouting.QueryParams.create({ - values: _emberUtils.assign({}, named.value()) - }); + if (value === true) { + return _emberRuntime.String.dasherize(className); + } else if (!value && value !== 0) { + return ''; + } else { + return String(value); + } } exports.default = function (vm, args) { - return new _emberGlimmerUtilsReferences.InternalHelperReference(queryParams, args); + return new _emberGlimmerUtilsReferences.InternalHelperReference(normalizeClass, args); }; }); -enifed('ember-glimmer/helpers/readonly', ['exports', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/mut'], function (exports, _emberGlimmerUtilsReferences, _emberGlimmerHelpersMut) { +enifed('ember-glimmer/helpers/action', ['exports', 'ember-utils', 'ember-metal', 'ember-glimmer/utils/references', '@glimmer/runtime', '@glimmer/reference'], function (exports, _emberUtils, _emberMetal, _emberGlimmerUtilsReferences, _glimmerRuntime, _glimmerReference) { /** @module ember @submodule ember-glimmer */ 'use strict'; + var INVOKE = _emberUtils.symbol('INVOKE'); + exports.INVOKE = INVOKE; + var ACTION = _emberUtils.symbol('ACTION'); + + exports.ACTION = ACTION; /** - The `readonly` helper let's you specify that a binding is one-way only, - instead of two-way. - When you pass a `readonly` binding from an outer context (e.g. parent component), - to to an inner context (e.g. child component), you are saying that changing that - property in the inner context does not change the value in the outer context. + The `{{action}}` helper provides a way to pass triggers for behavior (usually + just a function) between components, and into components from controllers. - To specify that a binding is read-only, when invoking the child `Component`: + ### Passing functions with the action helper - ```app/components/my-parent.js - export default Component.extend({ - totalClicks: 3 - }); - ``` + There are three contexts an action helper can be used in. The first two + contexts to discuss are attribute context, and Handlebars value context. - ```app/templates/components/my-parent.hbs - {{log totalClicks}} // -> 3 - {{my-child childClickCount=(readonly totalClicks)}} + ```handlebars + {{! An example of attribute context }} +
    + {{! Examples of Handlebars value context }} + {{input on-input=(action "save")}} + {{yield (action "refreshData") andAnotherParam}} ``` - Now, when you update `childClickCount`: - - ```app/components/my-child.js - export default Component.extend({ - click() { - this.incrementProperty('childClickCount'); - } - }); - ``` + In these contexts, + the helper is called a "closure action" helper. Its behavior is simple: + If passed a function name, read that function off the `actions` property + of the current context. Once that function is read (or if a function was + passed), create a closure over that function and any arguments. + The resulting value of an action helper used this way is simply a function. - The value updates in the child component, but not the parent component: + For example, in the attribute context: - ```app/templates/components/my-child.hbs - {{log childClickCount}} //-> 4 + ```handlebars + {{! An example of attribute context }} +
    ``` - ```app/templates/components/my-parent.hbs - {{log totalClicks}} //-> 3 - {{my-child childClickCount=(readonly totalClicks)}} + The resulting template render logic would be: + + ```js + var div = document.createElement('div'); + var actionFunction = (function(context){ + return function() { + return context.actions.save.apply(context, arguments); + }; + })(context); + div.onclick = actionFunction; ``` - ### Objects and Arrays - - When passing a property that is a complex object (e.g. object, array) instead of a primitive object (e.g. number, string), - only the reference to the object is protected using the readonly helper. - This means that you can change properties of the object both on the parent component, as well as the child component. - The `readonly` binding behaves similar to the `const` keyword in JavaScript. + Thus when the div is clicked, the action on that context is called. + Because the `actionFunction` is just a function, closure actions can be + passed between components and still execute in the correct context. - Let's look at an example: + Here is an example action handler on a component: - First let's set up the parent component: + ```js + import Ember from 'ember'; - ```app/components/my-parent.js export default Ember.Component.extend({ - clicks: null, - - init() { - this._super(...arguments); - this.set('clicks', { total: 3 }); + actions: { + save() { + this.get('model').save(); + } } }); ``` - ```app/templates/components/my-parent.hbs - {{log clicks.total}} //-> 3 - {{my-child childClicks=(readonly clicks)}} - ``` + Actions are always looked up on the `actions` property of the current context. + This avoids collisions in the naming of common actions, such as `destroy`. + Two options can be passed to the `action` helper when it is used in this way. - Now, if you update the `total` property of `childClicks`: + * `target=someProperty` will look to `someProperty` instead of the current + context for the `actions` hash. This can be useful when targetting a + service for actions. + * `value="target.value"` will read the path `target.value` off the first + argument to the action when it is called and rewrite the first argument + to be that value. This is useful when attaching actions to event listeners. - ```app/components/my-child.js + ### Invoking an action + + Closure actions curry both their scope and any arguments. When invoked, any + additional arguments are added to the already curried list. + Actions should be invoked using the [sendAction](/api/classes/Ember.Component.html#method_sendAction) + method. The first argument to `sendAction` is the action to be called, and + additional arguments are passed to the action function. This has interesting + properties combined with currying of arguments. For example: + + ```js export default Ember.Component.extend({ - click() { - this.get('clicks').incrementProperty('total'); + actions: { + // Usage {{input on-input=(action (action 'setName' model) value="target.value")}} + setName(model, name) { + model.set('name', name); + } } }); ``` - You will see the following happen: - - ```app/templates/components/my-parent.hbs - {{log clicks.total}} //-> 4 - {{my-child childClicks=(readonly clicks)}} - ``` + The first argument (`model`) was curried over, and the run-time argument (`event`) + becomes a second argument. Action calls can be nested this way because each simply + returns a function. Any function can be passed to the `{{action}}` helper, including + other actions. - ```app/templates/components/my-child.hbs - {{log childClicks.total}} //-> 4 - ``` + Actions invoked with `sendAction` have the same currying behavior as demonstrated + with `on-input` above. For example: - @method readonly - @param {Object} [attr] the read-only attribute. - @for Ember.Templates.helpers - @private - */ - - exports.default = function (vm, args) { - var ref = _emberGlimmerHelpersMut.unMut(args.positional.at(0)); - - var wrapped = Object.create(ref); - - wrapped[_emberGlimmerUtilsReferences.UPDATE] = undefined; - - return wrapped; - }; -}); -enifed('ember-glimmer/helpers/unbound', ['exports', 'ember-metal', 'ember-glimmer/utils/references'], function (exports, _emberMetal, _emberGlimmerUtilsReferences) { - /** - @module ember - @submodule ember-glimmer - */ - - 'use strict'; - - /** - 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: + ```app/components/my-input.js + import Ember from 'ember'; - ```handlebars - {{unbound name}} + export default Ember.Component.extend({ + actions: { + setName(model, name) { + model.set('name', 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)}} + {{my-input submit=(action 'setName' model)}} ``` - The `unbound` helper only accepts a single argument, and it return an - unbound value. - - @method unbound - @for Ember.Templates.helpers - @public - */ - - exports.default = function (vm, args) { - _emberMetal.assert('unbound helper cannot be called with multiple params or hash params', args.positional.values.length === 1 && args.named.keys.length === 0); - - return _emberGlimmerUtilsReferences.UnboundReference.create(args.positional.at(0).value()); - }; -}); -enifed('ember-glimmer/index', ['exports', 'ember-glimmer/helpers/action', 'ember-glimmer/templates/root', 'ember-glimmer/syntax', 'ember-glimmer/template', 'ember-glimmer/components/checkbox', 'ember-glimmer/components/text_field', 'ember-glimmer/components/text_area', 'ember-glimmer/components/link-to', 'ember-glimmer/component', 'ember-glimmer/helper', 'ember-glimmer/environment', 'ember-glimmer/make-bound-helper', 'ember-glimmer/utils/string', 'ember-glimmer/renderer', 'ember-glimmer/template_registry', 'ember-glimmer/setup-registry', 'ember-glimmer/dom'], function (exports, _emberGlimmerHelpersAction, _emberGlimmerTemplatesRoot, _emberGlimmerSyntax, _emberGlimmerTemplate, _emberGlimmerComponentsCheckbox, _emberGlimmerComponentsText_field, _emberGlimmerComponentsText_area, _emberGlimmerComponentsLinkTo, _emberGlimmerComponent, _emberGlimmerHelper, _emberGlimmerEnvironment, _emberGlimmerMakeBoundHelper, _emberGlimmerUtilsString, _emberGlimmerRenderer, _emberGlimmerTemplate_registry, _emberGlimmerSetupRegistry, _emberGlimmerDom) { - /** - [Glimmer](https://github.com/tildeio/glimmer) is a [Handlebars](http://handlebarsjs.com/) - compatible templating engine used by Ember.js. - 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' - }); - ``` + ```app/components/my-component.js + import Ember from 'ember'; - ```handlebars - {{! app/components/person.hbs }} - {{name}} -
    {{name}}
    - + export default Ember.Component.extend({ + click() { + // Note that model is not passed, it was curried in the template + this.sendAction('submit', 'bob'); + } + }); ``` - Any time the "name" property on the component changes, the DOM will be - updated. + ### Attaching actions to DOM elements - Properties can be chained as well: + The third context of the `{{action}}` helper can be called "element space". + For example: ```handlebars - {{aUserModel.name}} -
    {{listOfUsers.firstObject.name}}
    + {{! An example of element space }} +
    ``` - ### Using Ember helpers + Used this way, the `{{action}}` helper provides a useful shortcut for + registering an HTML element in a template for a single DOM event and + forwarding that interaction to the template's context (controller or component). + If the context of a template is a controller, actions used this way will + bubble to routes when the controller does not implement the specified action. + Once an action hits a route, it will bubble through the route hierarchy. - When content is passed in mustaches `{{}}`, Ember will first try to find a helper - or component with that name. For example, the `if` helper: + ### Event Propagation - ```handlebars - {{if name "I have a name" "I have no name"}} - - ``` + `{{action}}` helpers called in element space can control event bubbling. Note + that the closure style actions cannot. - 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: + Events triggered through the action helper will automatically have + `.preventDefault()` called on them. You do not need to do so in your event + handlers. If you need to allow event propagation (to handle file inputs for + example) you can supply the `preventDefault=false` option to the `{{action}}` helper: ```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: + To disable bubbling, pass `bubbles=false` to the helper: ```handlebars - + ``` - 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-glimmer - @main ember-glimmer - @public - */ - - /** - 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 - `{{with}}` block. - - If the aliased property is "falsey", for example: `false`, `undefined` `null`, `""`, `0`, NaN or - an empty array, the block will not be rendered. + To disable bubbling with closure style actions you must create your own + wrapper helper that makes use of `event.stopPropagation()`: ```handlebars - {{! Will only render if user.posts contains items}} - {{#with user.posts as |blogPosts|}} -
    - There are {{blogPosts.length}} blog posts written by {{user.name}}. -
    - {{#each blogPosts as |post|}} -
  • {{post.title}}
  • - {{/each}} - {{/with}} +
    Hello
    ``` - Without the `as` operator, it would be impossible to reference `user.name` in the example above. - - NOTE: The alias should not reuse a name from the bound property path. - - For example: `{{#with foo.bar as |foo|}}` is not supported because it attempts to alias using - the first part of the property path, `foo`. Instead, use `{{#with foo.bar as |baz|}}`. - - @method with - @for Ember.Templates.helpers - @param {Object} options - @return {String} HTML string - @public - */ - - /** - Execute the `debugger` statement in the current template's context. + ```app/helpers/disable-bubbling.js + import Ember from 'ember'; - ```handlebars - {{debugger}} + export function disableBubbling([action]) { + return function(event) { + event.stopPropagation(); + return action(event); + }; + } + export default Ember.Helper.helper(disableBubbling); ``` - When using the debugger helper you will have access to a `get` function. This - function retrieves values available in the context of the template. - For example, if you're wondering why a value `{{foo}}` isn't rendering as - expected within a template, you could place a `{{debugger}}` statement and, - when the `debugger;` breakpoint is hit, you can attempt to retrieve this value: + If you need the default handler to trigger you should either register your + own event handler, or use event methods on your view class. See + ["Responding to Browser Events"](/api/classes/Ember.View.html#toc_responding-to-browser-events) + in the documentation for Ember.View for more information. - ``` - > get('foo') - ``` + ### Specifying DOM event type - `get` is also aware of keywords. So in this situation + `{{action}}` helpers called in element space can specify an event type. + By default the `{{action}}` helper registers for DOM `click` events. You can + supply an `on` option to the helper to specify a different DOM event name: ```handlebars - {{#each items as |item|}} - {{debugger}} - {{/each}} +
    + click me +
    ``` - You'll be able to get values from the current item: + See ["Event Names"](/api/classes/Ember.View.html#toc_event-names) for a list of + acceptable DOM event names. - ``` - > get('item.name') - ``` + ### Specifying whitelisted modifier keys - You can also access the context of the view to make sure it is the object that - you expect: + `{{action}}` helpers called in element space can specify modifier keys. + By default the `{{action}}` helper will ignore click events with pressed modifier + keys. You can supply an `allowedKeys` option to specify which keys should not be ignored. - ``` - > context + ```handlebars +
    + click me +
    ``` - @method debugger - @for Ember.Templates.helpers - @public - */ - - /** - The `partial` helper renders another template without - changing the template context: + This way the action will fire when clicking with the alt key pressed down. + Alternatively, supply "any" to the `allowedKeys` option to accept any combination of modifier keys. ```handlebars - {{foo}} - {{partial "nav"}} +
    + click me with any key pressed +
    ``` - The above example template will render a template named - "-nav", which has the same context as the parent template - it's rendered into, so if the "-nav" template also referenced - `{{foo}}`, it would print the same thing as the `{{foo}}` - in the above example. + ### Specifying a Target - If a "-nav" template isn't found, the `partial` helper will - fall back to a template named "nav". + A `target` option can be provided to the helper to change + which object will receive the method call. This option must be a path + to an object, accessible in the current context: - ### Bound template names + ```app/templates/application.hbs +
    + click me +
    + ``` - The parameter supplied to `partial` can also be a path - to a property containing a template name, e.g.: + ```app/controllers/application.js + import Ember from 'ember'; - ```handlebars - {{partial someTemplateName}} + export default Ember.Controller.extend({ + someService: Ember.inject.service() + }); ``` - The above example will look up the value of `someTemplateName` - on the template context (e.g. a controller) and use that - value as the name of the template to render. If the resolved - value is falsy, nothing will be rendered. If `someTemplateName` - changes, the partial will be re-rendered using the new template - name. - - @method partial + @method action @for Ember.Templates.helpers - @param {String} partialName The name of the template to render minus the leading underscore. @public */ - 'use strict'; + exports.default = function (vm, args) { + var named = args.named; + var positional = args.positional; - exports.INVOKE = _emberGlimmerHelpersAction.INVOKE; - exports.RootTemplate = _emberGlimmerTemplatesRoot.default; - exports.registerSyntax = _emberGlimmerSyntax.registerSyntax; - exports.template = _emberGlimmerTemplate.default; - exports.Checkbox = _emberGlimmerComponentsCheckbox.default; - exports.TextField = _emberGlimmerComponentsText_field.default; - exports.TextArea = _emberGlimmerComponentsText_area.default; - exports.LinkComponent = _emberGlimmerComponentsLinkTo.default; - exports.Component = _emberGlimmerComponent.default; - exports.Helper = _emberGlimmerHelper.default; - exports.helper = _emberGlimmerHelper.helper; - exports.Environment = _emberGlimmerEnvironment.default; - exports.makeBoundHelper = _emberGlimmerMakeBoundHelper.default; - exports.SafeString = _emberGlimmerUtilsString.SafeString; - exports.escapeExpression = _emberGlimmerUtilsString.escapeExpression; - exports.htmlSafe = _emberGlimmerUtilsString.htmlSafe; - exports.isHTMLSafe = _emberGlimmerUtilsString.isHTMLSafe; - exports._getSafeString = _emberGlimmerUtilsString.getSafeString; - exports.Renderer = _emberGlimmerRenderer.Renderer; - exports.InertRenderer = _emberGlimmerRenderer.InertRenderer; - exports.InteractiveRenderer = _emberGlimmerRenderer.InteractiveRenderer; - exports.getTemplate = _emberGlimmerTemplate_registry.getTemplate; - exports.setTemplate = _emberGlimmerTemplate_registry.setTemplate; - exports.hasTemplate = _emberGlimmerTemplate_registry.hasTemplate; - exports.getTemplates = _emberGlimmerTemplate_registry.getTemplates; - exports.setTemplates = _emberGlimmerTemplate_registry.setTemplates; - exports.setupEngineRegistry = _emberGlimmerSetupRegistry.setupEngineRegistry; - exports.setupApplicationRegistry = _emberGlimmerSetupRegistry.setupApplicationRegistry; - exports.DOMChanges = _emberGlimmerDom.DOMChanges; - exports.NodeDOMTreeConstruction = _emberGlimmerDom.NodeDOMTreeConstruction; - exports.DOMTreeConstruction = _emberGlimmerDom.DOMTreeConstruction; -}); -enifed('ember-glimmer/make-bound-helper', ['exports', 'ember-metal', 'ember-glimmer/helper'], function (exports, _emberMetal, _emberGlimmerHelper) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; + // The first two argument slots are reserved. + // pos[0] is the context (or `this`) + // pos[1] is the action name or function + // Anything else is an action argument. + var context = positional.at(0); + var action = positional.at(1); - exports.default = makeBoundHelper; + // TODO: Is there a better way of doing this? + var debugKey = action._propertyKey; - /** - 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 - value and any changes to the bound property cause the helper function to be re-run with the updated - values. - - * `params` - An array of resolved ordered parameters. - * `hash` - An object containing the hash parameters. - - For example: - - * With an unquoted ordered parameter: - - ```javascript - {{x-capitalize foo}} - ``` - - Assuming `foo` was set to `"bar"`, the bound helper would receive `["bar"]` as its first argument, and - an empty hash as its second. - - * With a quoted ordered parameter: - - ```javascript - {{x-capitalize "foo"}} - ``` - - The bound helper would receive `["foo"]` as its first argument, and an empty hash as its second. - - * With an unquoted hash parameter: - - ```javascript - {{x-repeat "foo" count=repeatCount}} - ``` - - Assuming that `repeatCount` resolved to 2, the bound helper would receive `["foo"]` as its first argument, - and { count: 2 } as its second. - - @private - @method makeBoundHelper - @for Ember.HTMLBars - @param {Function} fn - @since 1.10.0 - */ + var restArgs = undefined; - function makeBoundHelper(fn) { - _emberMetal.deprecate('Using `Ember.HTMLBars.makeBoundHelper` is deprecated. Please refactor to use `Ember.Helper` or `Ember.Helper.helper`.', false, { id: 'ember-htmlbars.make-bound-helper', until: '3.0.0' }); - return _emberGlimmerHelper.helper(fn); - } -}); -enifed('ember-glimmer/modifiers/action', ['exports', 'ember-utils', 'ember-metal', 'ember-views', 'ember-glimmer/helpers/action'], function (exports, _emberUtils, _emberMetal, _emberViews, _emberGlimmerHelpersAction) { - 'use strict'; + if (positional.length === 2) { + restArgs = _glimmerRuntime.EvaluatedPositionalArgs.empty(); + } else { + restArgs = _glimmerRuntime.EvaluatedPositionalArgs.create(positional.values.slice(2)); + } - var MODIFIERS = ['alt', 'shift', 'meta', 'ctrl']; - var POINTER_EVENT_TYPE_REGEX = /^click|mouse|touch/; + var target = named.has('target') ? named.get('target') : context; + var processArgs = makeArgsProcessor(named.has('value') && named.get('value'), restArgs); - function isAllowedEvent(event, allowedKeys) { - if (allowedKeys === null || typeof allowedKeys === 'undefined') { - if (POINTER_EVENT_TYPE_REGEX.test(event.type)) { - return _emberViews.isSimpleClick(event); - } else { - allowedKeys = ''; - } - } + var fn = undefined; - if (allowedKeys.indexOf('any') >= 0) { - return true; + if (typeof action[INVOKE] === 'function') { + fn = makeClosureAction(action, action, action[INVOKE], processArgs, debugKey); + } else if (_glimmerReference.isConst(target) && _glimmerReference.isConst(action)) { + fn = makeClosureAction(context.value(), target.value(), action.value(), processArgs, debugKey); + } else { + fn = makeDynamicClosureAction(context.value(), target, action, processArgs, debugKey); } - for (var i = 0; i < MODIFIERS.length; i++) { - if (event[MODIFIERS[i] + 'Key'] && allowedKeys.indexOf(MODIFIERS[i]) === -1) { - return false; - } - } + fn[ACTION] = true; - return true; + return new _emberGlimmerUtilsReferences.UnboundReference(fn); + }; + + function NOOP(args) { + return args; } - var ActionHelper = { - // registeredActions is re-exported for compatibility with older plugins - // that were using this undocumented API. - registeredActions: _emberViews.ActionManager.registeredActions, + function makeArgsProcessor(valuePathRef, actionArgsRef) { + var mergeArgs = null; - registerAction: function (actionState) { - var actionId = actionState.actionId; + if (actionArgsRef.length > 0) { + mergeArgs = function (args) { + return actionArgsRef.value().concat(args); + }; + } - var actions = _emberViews.ActionManager.registeredActions[actionId]; - - if (!actions) { - actions = _emberViews.ActionManager.registeredActions[actionId] = []; - } - - actions.push(actionState); - - return actionId; - }, - - unregisterAction: function (actionState) { - var actionId = actionState.actionId; - - var actions = _emberViews.ActionManager.registeredActions[actionId]; - - if (!actions) { - return; - } + var readValue = null; - var index = actions.indexOf(actionState); + if (valuePathRef) { + readValue = function (args) { + var valuePath = valuePathRef.value(); - if (index !== -1) { - actions.splice(index, 1); - } + if (valuePath && args.length > 0) { + args[0] = _emberMetal.get(args[0], valuePath); + } - if (actions.length === 0) { - delete _emberViews.ActionManager.registeredActions[actionId]; - } + return args; + }; } - }; - - exports.ActionHelper = ActionHelper; - - var ActionState = (function () { - function ActionState(element, actionId, actionName, actionArgs, namedArgs, positionalArgs, implicitTarget, dom) { - babelHelpers.classCallCheck(this, ActionState); - this.element = element; - this.actionId = actionId; - this.actionName = actionName; - this.actionArgs = actionArgs; - this.namedArgs = namedArgs; - this.positional = positionalArgs; - this.implicitTarget = implicitTarget; - this.dom = dom; - this.eventName = this.getEventName(); + if (mergeArgs && readValue) { + return function (args) { + return readValue(mergeArgs(args)); + }; + } else { + return mergeArgs || readValue || NOOP; } + } - // implements ModifierManager + function makeDynamicClosureAction(context, targetRef, actionRef, processArgs, debugKey) { + // We don't allow undefined/null values, so this creates a throw-away action to trigger the assertions + _emberMetal.runInDebug(function () { + makeClosureAction(context, targetRef.value(), actionRef.value(), processArgs, debugKey); + }); - ActionState.prototype.getEventName = function getEventName() { - return this.namedArgs.get('on').value() || 'click'; + return function () { + return makeClosureAction(context, targetRef.value(), actionRef.value(), processArgs, debugKey).apply(undefined, arguments); }; + } - ActionState.prototype.getActionArgs = function getActionArgs() { - var result = new Array(this.actionArgs.length); - - for (var i = 0; i < this.actionArgs.length; i++) { - result[i] = this.actionArgs[i].value(); - } + function makeClosureAction(context, target, action, processArgs, debugKey) { + var self = undefined, + fn = undefined; - return result; - }; + _emberMetal.assert('Action passed is null or undefined in (action) from ' + target + '.', !_emberMetal.isNone(action)); - ActionState.prototype.getTarget = function getTarget() { - var implicitTarget = this.implicitTarget; - var namedArgs = this.namedArgs; + if (typeof action[INVOKE] === 'function') { + self = action; + fn = action[INVOKE]; + } else { + var typeofAction = typeof action; - var target = undefined; + if (typeofAction === 'string') { + self = target; + fn = target.actions && target.actions[action]; - if (namedArgs.has('target')) { - target = namedArgs.get('target').value(); + _emberMetal.assert('An action named \'' + action + '\' was not found in ' + target, fn); + } else if (typeofAction === 'function') { + self = context; + fn = action; } else { - target = implicitTarget.value(); - } - - return target; - }; - - ActionState.prototype.handler = function handler(event) { - var _this = this; - - var actionName = this.actionName; - var namedArgs = this.namedArgs; - - var bubbles = namedArgs.get('bubbles'); - var preventDefault = namedArgs.get('preventDefault'); - var allowedKeys = namedArgs.get('allowedKeys'); - var target = this.getTarget(); - - if (!isAllowedEvent(event, allowedKeys.value())) { - return true; + _emberMetal.assert('An action could not be made for `' + (debugKey || action) + '` in ' + target + '. Please confirm that you are using either a quoted action name (i.e. `(action \'' + (debugKey || 'myAction') + '\')`) or a function available in ' + target + '.', false); } + } - if (preventDefault.value() !== false) { - event.preventDefault(); + return function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } - if (bubbles.value() === false) { - event.stopPropagation(); - } + var payload = { target: self, args: args, label: '@glimmer/closure-action' }; + return _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { + return _emberMetal.run.join.apply(_emberMetal.run, [self, fn].concat(processArgs(args))); + }); + }; + } +}); +enifed('ember-glimmer/helpers/component', ['exports', 'ember-utils', 'ember-glimmer/utils/references', 'ember-glimmer/syntax/curly-component', '@glimmer/runtime', 'ember-metal'], function (exports, _emberUtils, _emberGlimmerUtilsReferences, _emberGlimmerSyntaxCurlyComponent, _glimmerRuntime, _emberMetal) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; - _emberMetal.run(function () { - var args = _this.getActionArgs(); - var payload = { - args: args, - target: target - }; - if (typeof actionName[_emberGlimmerHelpersAction.INVOKE] === 'function') { - _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { - actionName[_emberGlimmerHelpersAction.INVOKE].apply(actionName, args); - }); - return; - } - if (typeof actionName === 'function') { - _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { - actionName.apply(target, args); - }); - return; + /** + 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. + `{{component}}`'s primary use is for cases where you want to dynamically + change which type of component is rendered as the state of your application + changes. This helper has three modes: inline, block, and nested. + + ### Inline Form + + Given the following template: + + ```app/application.hbs + {{component infographicComponentName}} + ``` + + And the following application code: + + ```app/controllers/application.js + export default Ember.Controller.extend({ + infographicComponentName: computed('isMarketOpen', { + get() { + if (this.get('isMarketOpen')) { + return 'live-updating-chart'; + } else { + return 'market-close-summary'; + } } - payload.name = actionName; - if (target.send) { - _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { - target.send.apply(target, [actionName].concat(args)); - }); - } else { - _emberMetal.assert('The action \'' + actionName + '\' did not exist on ' + target, typeof target[actionName] === 'function'); - _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { - target[actionName].apply(target, args); - }); + }) + }); + ``` + + The `live-updating-chart` component will be appended when `isMarketOpen` is + `true`, and the `market-close-summary` component will be appended when + `isMarketOpen` is `false`. If the value changes while the app is running, + the component will be automatically swapped out accordingly. + Note: You should not use this helper when you are consistently rendering the same + component. In that case, use standard component syntax, for example: + + ```app/templates/application.hbs + {{live-updating-chart}} + ``` + + ### Block Form + + Using the block form of this helper is similar to using the block form + of a component. Given the following application template: + + ```app/templates/application.hbs + {{#component infographicComponentName}} + Last update: {{lastUpdateTimestamp}} + {{/component}} + ``` + + The following controller code: + + ```app/controllers/application.js + export default Ember.Controller.extend({ + lastUpdateTimestamp: computed(function() { + return new Date(); + }), + + infographicComponentName: computed('isMarketOpen', { + get() { + if (this.get('isMarketOpen')) { + return 'live-updating-chart'; + } else { + return 'market-close-summary'; + } } - }); - }; + }) + }); + ``` + + And the following component template: + + ```app/templates/components/live-updating-chart.hbs + {{! chart }} + {{yield}} + ``` + + The `Last Update: {{lastUpdateTimestamp}}` will be rendered in place of the `{{yield}}`. + + ### Nested Usage + + The `component` helper can be used to package a component path with initial attrs. + The included attrs can then be merged during the final invocation. + For example, given a `person-form` component with the following template: + + ```app/templates/components/person-form.hbs + {{yield (hash + nameInput=(component "my-input-component" value=model.name placeholder="First Name") + )}} + ``` + + When yielding the component via the `hash` helper, the component is invocked directly. + See the following snippet: + + ``` + {{#person-form as |form|}} + {{form.nameInput placeholder="Username"}} + {{/person-form}} + ``` + + Which outputs an input whose value is already bound to `model.name` and `placeholder` + is "Username". + + When yielding the component without the hash helper use the `component` helper. + For example, below is a `full-name` component template: + + ```handlebars + {{yield (component "my-input-component" value=model.name placeholder="Name")}} + ``` + + ``` + {{#full-name as |field|}} + {{component field placeholder="Full name"}} + {{/full-name}} + ``` + + @method component + @since 1.11.0 + @for Ember.Templates.helpers + @public + */ - ActionState.prototype.destroy = function destroy() { - ActionHelper.unregisterAction(this); - }; + var ClosureComponentReference = (function (_CachedReference) { + babelHelpers.inherits(ClosureComponentReference, _CachedReference); - return ActionState; - })(); + ClosureComponentReference.create = function create(args, symbolTable, env) { + return new ClosureComponentReference(args, symbolTable, env); + }; - exports.ActionState = ActionState; + function ClosureComponentReference(args, symbolTable, env) { + babelHelpers.classCallCheck(this, ClosureComponentReference); - var ActionModifierManager = (function () { - function ActionModifierManager() { - babelHelpers.classCallCheck(this, ActionModifierManager); + _CachedReference.call(this); + this.defRef = args.positional.at(0); + this.env = env; + this.tag = args.positional.at(0).tag; + this.symbolTable = symbolTable; + this.args = args; + this.lastDefinition = undefined; + this.lastName = undefined; } - ActionModifierManager.prototype.create = function create(element, args, dynamicScope, dom) { - var named = args.named; - var positional = args.positional; - - var implicitTarget = undefined; - var actionName = undefined; - var actionNameRef = undefined; - if (positional.length > 1) { - implicitTarget = positional.at(0); - actionNameRef = positional.at(1); + ClosureComponentReference.prototype.compute = function compute() { + // TODO: Figure out how to extract this because it's nearly identical to + // DynamicComponentReference::compute(). The only differences besides + // currying are in the assertion messages. + var args = this.args; + var defRef = this.defRef; + var env = this.env; + var symbolTable = this.symbolTable; + var lastDefinition = this.lastDefinition; + var lastName = this.lastName; - if (actionNameRef[_emberGlimmerHelpersAction.INVOKE]) { - actionName = actionNameRef; - } else { - var actionLabel = actionNameRef._propertyKey; - actionName = actionNameRef.value(); + var nameOrDef = defRef.value(); + var definition = null; - _emberMetal.assert('You specified a quoteless path, `' + actionLabel + '`, to the ' + '{{action}} helper which did not resolve to an action name (a ' + 'string). Perhaps you meant to use a quoted actionName? (e.g. ' + '{{action "' + actionLabel + '"}}).', typeof actionName === 'string' || typeof actionName === 'function'); - } + if (nameOrDef && nameOrDef === lastName) { + return lastDefinition; } - var actionArgs = []; - // The first two arguments are (1) `this` and (2) the action name. - // Everything else is a param. - for (var i = 2; i < positional.length; i++) { - actionArgs.push(positional.at(i)); - } + this.lastName = nameOrDef; - var actionId = _emberUtils.uuid(); - return new ActionState(element, actionId, actionName, actionArgs, named, positional, implicitTarget, dom); - }; + if (typeof nameOrDef === 'string') { + _emberMetal.assert('You cannot use the input helper as a contextual helper. Please extend Ember.TextField or Ember.Checkbox to use it as a contextual component.', nameOrDef !== 'input'); + _emberMetal.assert('You cannot use the textarea helper as a contextual helper. Please extend Ember.TextArea to use it as a contextual component.', nameOrDef !== 'textarea'); + definition = env.getComponentDefinition([nameOrDef], symbolTable); + _emberMetal.assert('The component helper cannot be used without a valid component name. You used "' + nameOrDef + '" via (component "' + nameOrDef + '")', definition); + } else if (_glimmerRuntime.isComponentDefinition(nameOrDef)) { + definition = nameOrDef; + } else { + _emberMetal.assert('You cannot create a component from ' + nameOrDef + ' using the {{component}} helper', nameOrDef); + return null; + } - ActionModifierManager.prototype.install = function install(actionState) { - var dom = actionState.dom; - var element = actionState.element; - var actionId = actionState.actionId; + var newDef = createCurriedDefinition(definition, args); - ActionHelper.registerAction(actionState); + this.lastDefinition = newDef; - dom.setAttribute(element, 'data-ember-action', ''); - dom.setAttribute(element, 'data-ember-action-' + actionId, actionId); + return newDef; }; - ActionModifierManager.prototype.update = function update(actionState) { - var positional = actionState.positional; - - var actionNameRef = positional.at(1); - - if (!actionNameRef[_emberGlimmerHelpersAction.INVOKE]) { - actionState.actionName = actionNameRef.value(); - } - actionState.eventName = actionState.getEventName(); - - // Not sure if this is needed? If we mutate the actionState is that good enough? - ActionHelper.unregisterAction(actionState); - ActionHelper.registerAction(actionState); - }; + return ClosureComponentReference; + })(_emberGlimmerUtilsReferences.CachedReference); - ActionModifierManager.prototype.getDestructor = function getDestructor(modifier) { - return modifier; - }; + exports.ClosureComponentReference = ClosureComponentReference; - return ActionModifierManager; - })(); + function createCurriedDefinition(definition, args) { + var curriedArgs = curryArgs(definition, args); - exports.default = ActionModifierManager; -}); -enifed('ember-glimmer/protocol-for-url', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { - /* globals module, URL */ + return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentDefinition(definition.name, definition.ComponentClass, definition.template, curriedArgs); + } - 'use strict'; + var EMPTY_BLOCKS = { + default: null, + inverse: null + }; - exports.default = installProtocolForURL; + _emberMetal.runInDebug(function () { + EMPTY_BLOCKS = Object.freeze(EMPTY_BLOCKS); + }); - var nodeURL = undefined; - var parsingNode = undefined; + function curryArgs(definition, newArgs) { + var args = definition.args; + var ComponentClass = definition.ComponentClass; - function installProtocolForURL(environment) { - var protocol = undefined; + var positionalParams = ComponentClass.class.positionalParams; - if (_emberEnvironment.environment.hasDOM) { - protocol = browserProtocolForURL.call(environment, 'foobar:baz'); - } + // The args being passed in are from the (component ...) invocation, + // so the first positional argument is actually the name or component + // definition. It needs to be dropped in order for any actual positional + // args to coincide with the ComponentClass's positionParams. - // Test to see if our DOM implementation parses - // and normalizes URLs. - if (protocol === 'foobar:') { - // Swap in the method that doesn't do this test now that - // we know it works. - environment.protocolForURL = browserProtocolForURL; - } else if (typeof URL === 'object') { - // URL globally provided, likely from FastBoot's sandbox - nodeURL = URL; - environment.protocolForURL = nodeProtocolForURL; - } else if (typeof module === 'object' && typeof module.require === 'function') { - // Otherwise, we need to fall back to our own URL parsing. - // Global `require` is shadowed by Ember's loader so we have to use the fully - // qualified `module.require`. - nodeURL = module.require('url'); - environment.protocolForURL = nodeProtocolForURL; - } else { - throw new Error('Could not find valid URL parsing mechanism for URL Sanitization'); - } - } + // For "normal" curly components this slicing is done at the syntax layer, + // but we don't have that luxury here. - function browserProtocolForURL(url) { - if (!parsingNode) { - parsingNode = document.createElement('a'); - } + var _newArgs$positional$values = newArgs.positional.values; - parsingNode.href = url; - return parsingNode.protocol; - } + var slicedPositionalArgs = _newArgs$positional$values.slice(1); - function nodeProtocolForURL(url) { - var protocol = null; - if (typeof url === 'string') { - protocol = nodeURL.parse(url).protocol; + if (positionalParams && slicedPositionalArgs.length) { + _emberGlimmerSyntaxCurlyComponent.validatePositionalParameters(newArgs.named, slicedPositionalArgs, positionalParams); } - return protocol === null ? ':' : protocol; - } -}); -enifed('ember-glimmer/renderer', ['exports', 'ember-glimmer/utils/references', 'ember-metal', 'glimmer-reference', 'ember-views', 'ember-glimmer/component', 'ember-glimmer/syntax/curly-component', 'ember-glimmer/syntax/outlet'], function (exports, _emberGlimmerUtilsReferences, _emberMetal, _glimmerReference, _emberViews, _emberGlimmerComponent, _emberGlimmerSyntaxCurlyComponent, _emberGlimmerSyntaxOutlet) { - 'use strict'; - var runInTransaction = undefined; + var isRest = typeof positionalParams === 'string'; - if (true || true) { - runInTransaction = _emberMetal.runInTransaction; - } else { - runInTransaction = function (context, methodName) { - context[methodName](); - return false; - }; - } + // For non-rest position params, we need to perform the position -> name mapping + // at each layer to avoid a collision later when the args are used to construct + // the component instance (inside of processArgs(), inside of create()). + var positionalToNamedParams = {}; - var backburner = _emberMetal.run.backburner; + if (!isRest && positionalParams && positionalParams.length > 0) { + var limit = Math.min(positionalParams.length, slicedPositionalArgs.length); - var DynamicScope = (function () { - function DynamicScope(view, outletState, rootOutletState, targetObject) { - babelHelpers.classCallCheck(this, DynamicScope); + for (var i = 0; i < limit; i++) { + var _name = positionalParams[i]; + positionalToNamedParams[_name] = slicedPositionalArgs[i]; + } - this.view = view; - this.outletState = outletState; - this.rootOutletState = rootOutletState; + slicedPositionalArgs.length = 0; // Throw them away since you're merged in. } - DynamicScope.prototype.child = function child() { - return new DynamicScope(this.view, this.outletState, this.rootOutletState); - }; + // args (aka 'oldArgs') may be undefined or simply be empty args, so + // we need to fall back to an empty array or object. + var oldNamed = args && args.named && args.named.map || {}; + var oldPositional = args && args.positional && args.positional.values || []; - DynamicScope.prototype.get = function get(key) { - _emberMetal.assert('Using `-get-dynamic-scope` is only supported for `outletState` (you used `' + key + '`).', key === 'outletState'); - return this.outletState; - }; + // Merge positional arrays + var mergedPositional = new Array(Math.max(oldPositional.length, slicedPositionalArgs.length)); + mergedPositional.splice.apply(mergedPositional, [0, oldPositional.length].concat(oldPositional)); + mergedPositional.splice.apply(mergedPositional, [0, slicedPositionalArgs.length].concat(slicedPositionalArgs)); - DynamicScope.prototype.set = function set(key, value) { - _emberMetal.assert('Using `-with-dynamic-scope` is only supported for `outletState` (you used `' + key + '`).', key === 'outletState'); - this.outletState = value; - return value; - }; + // Merge named maps + var mergedNamed = _emberUtils.assign({}, oldNamed, positionalToNamedParams, newArgs.named.map); - return DynamicScope; - })(); + var mergedArgs = _glimmerRuntime.EvaluatedArgs.create(_glimmerRuntime.EvaluatedPositionalArgs.create(mergedPositional), _glimmerRuntime.EvaluatedNamedArgs.create(mergedNamed), EMPTY_BLOCKS); - var RootState = (function () { - function RootState(root, env, template, self, parentElement, dynamicScope) { - var _this = this; + return mergedArgs; + } - babelHelpers.classCallCheck(this, RootState); + exports.default = function (vm, args, symbolTable) { + return ClosureComponentReference.create(args, symbolTable, vm.env); + }; +}); +enifed('ember-glimmer/helpers/concat', ['exports', 'ember-glimmer/utils/references', '@glimmer/runtime'], function (exports, _emberGlimmerUtilsReferences, _glimmerRuntime) { + 'use strict'; - _emberMetal.assert('You cannot render `' + self.value() + '` without a template.', template); + /** + @module ember + @submodule ember-glimmer + */ - this.id = _emberViews.getViewId(root); - this.env = env; - this.root = root; - this.result = undefined; - this.shouldReflush = false; - this.destroyed = false; - this._removing = false; + /** + Concatenates the given arguments into a string. + + Example: + + ```handlebars + {{some-component name=(concat firstName " " lastName)}} + + {{! would pass name=" " to the component}} + ``` + + @public + @method concat + @for Ember.Templates.helpers + @since 1.13.0 + */ + function concat(_ref) { + var positional = _ref.positional; - var options = this.options = { - alwaysRevalidate: false - }; + return positional.value().map(_glimmerRuntime.normalizeTextValue).join(''); + } - this.render = function () { - var result = _this.result = template.render(self, parentElement, dynamicScope); + exports.default = function (vm, args) { + return new _emberGlimmerUtilsReferences.InternalHelperReference(concat, args); + }; +}); +enifed('ember-glimmer/helpers/each-in', ['exports', 'ember-utils'], function (exports, _emberUtils) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; - // override .render function after initial render - _this.render = function () { - result.rerender(options); - }; - }; - } + exports.isEachIn = isEachIn; - RootState.prototype.isFor = function isFor(possibleRoot) { - return this.root === possibleRoot; - }; + /** + The `{{#each}}` helper loops over elements in a collection. It is an extension + of the base Handlebars `{{#each}}` helper. + The default behavior of `{{#each}}` is to yield its inner block once for every + item in an array passing the item as the first block parameter. + + ```javascript + var developers = [{ name: 'Yehuda' },{ name: 'Tom' }, { name: 'Paul' }]; + ``` + + ```handlebars + {{#each developers key="name" as |person|}} + {{person.name}} + {{! `this` is whatever it was outside the #each }} + {{/each}} + ``` + + The same rules apply to arrays of primitives. + + ```javascript + var developerNames = ['Yehuda', 'Tom', 'Paul'] + ``` + + ```handlebars + {{#each developerNames key="@index" as |name|}} + {{name}} + {{/each}} + ``` + + During iteration, the index of each item in the array is provided as a second block parameter. + + ```handlebars +
      + {{#each people as |person index|}} +
    • Hello, {{person.name}}! You're number {{index}} in line
    • + {{/each}} +
    + ``` + + ### Specifying Keys + + The `key` option is used to tell Ember how to determine if the array being + iterated over with `{{#each}}` has changed between renders. By helping Ember + detect that some elements in the array are the same, DOM elements can be + re-used, significantly improving rendering speed. + + For example, here's the `{{#each}}` helper with its `key` set to `id`: + + ```handlebars + {{#each model key="id" as |item|}} + {{/each}} + ``` + + When this `{{#each}}` re-renders, Ember will match up the previously rendered + items (and reorder the generated DOM elements) based on each item's `id` + property. + By default the item's own reference is used. + + ### {{else}} condition + + `{{#each}}` can have a matching `{{else}}`. The contents of this block will render + if the collection is empty. + + ```handlebars + {{#each developers as |person|}} + {{person.name}} + {{else}} +

    Sorry, nobody is available for this task.

    + {{/each}} + ``` + + @method each + @for Ember.Templates.helpers + @public + */ - RootState.prototype.destroy = function destroy() { - var result = this.result; - var env = this.env; + /** + The `{{each-in}}` helper loops over properties on an object. + + For example, given a `user` object that looks like: + + ```javascript + { + "name": "Shelly Sails", + "age": 42 + } + ``` + + This template would display all properties on the `user` + object in a list: + + ```handlebars +
      + {{#each-in user as |key value|}} +
    • {{key}}: {{value}}
    • + {{/each-in}} +
    + ``` + + Outputting their name and age. + + @method each-in + @for Ember.Templates.helpers + @public + @since 2.1.0 + */ + var EACH_IN_REFERENCE = _emberUtils.symbol('EACH_IN'); - this.destroyed = true; + function isEachIn(ref) { + return ref && ref[EACH_IN_REFERENCE]; + } - this.env = null; - this.root = null; - this.result = null; - this.render = null; + exports.default = function (vm, args) { + var ref = Object.create(args.positional.at(0)); + ref[EACH_IN_REFERENCE] = true; + return ref; + }; +}); +enifed('ember-glimmer/helpers/get', ['exports', 'ember-metal', 'ember-glimmer/utils/references', '@glimmer/reference'], function (exports, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference) { + 'use strict'; - if (result) { - /* - Handles these scenarios: - * When roots are removed during standard rendering process, a transaction exists already - `.begin()` / `.commit()` are not needed. - * When roots are being destroyed manually (`component.append(); component.destroy() case), no - transaction exists already. - * When roots are being destroyed during `Renderer#destroy`, no transaction exists - */ - var needsTransaction = !env.inTransaction; + /** + @module ember + @submodule ember-glimmer + */ - if (needsTransaction) { - env.begin(); - } + /** + 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}} + + + ``` + + The `{{get}}` helper can also respect mutable values itself. For example: + + ```handlebars + {{input value=(mut (get person factName)) type="text"}} + + + ``` + + 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 + @since 2.1.0 + */ - result.destroy(); + exports.default = function (vm, args) { + return GetHelperReference.create(args.positional.at(0), args.positional.at(1)); + }; - if (needsTransaction) { - env.commit(); - } + var GetHelperReference = (function (_CachedReference) { + babelHelpers.inherits(GetHelperReference, _CachedReference); + + GetHelperReference.create = function create(sourceReference, pathReference) { + if (_glimmerReference.isConst(pathReference)) { + var parts = pathReference.value().split('.'); + return _glimmerReference.referenceFromParts(sourceReference, parts); + } else { + return new GetHelperReference(sourceReference, pathReference); } }; - return RootState; - })(); - - var renderers = []; + function GetHelperReference(sourceReference, pathReference) { + babelHelpers.classCallCheck(this, GetHelperReference); - _emberMetal.setHasViews(function () { - return renderers.length > 0; - }); + _CachedReference.call(this); + this.sourceReference = sourceReference; + this.pathReference = pathReference; - function register(renderer) { - _emberMetal.assert('Cannot register the same renderer twice', renderers.indexOf(renderer) === -1); - renderers.push(renderer); - } + this.lastPath = null; + this.innerReference = null; - function deregister(renderer) { - var index = renderers.indexOf(renderer); - _emberMetal.assert('Cannot deregister unknown unregistered renderer', index !== -1); - renderers.splice(index, 1); - } + var innerTag = this.innerTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - function loopBegin() { - for (var i = 0; i < renderers.length; i++) { - renderers[i]._scheduleRevalidate(); + this.tag = _glimmerReference.combine([sourceReference.tag, pathReference.tag, innerTag]); } - } - function K() {} + GetHelperReference.prototype.compute = function compute() { + var lastPath = this.lastPath; + var innerReference = this.innerReference; + var innerTag = this.innerTag; - var loops = 0; - function loopEnd(current, next) { - for (var i = 0; i < renderers.length; i++) { - if (!renderers[i]._isValid()) { - if (loops > 10) { - loops = 0; - // TODO: do something better - renderers[i].destroy(); - throw new Error('infinite rendering invalidation detected'); + var path = this.lastPath = this.pathReference.value(); + + if (path !== lastPath) { + if (path) { + var pathType = typeof path; + + if (pathType === 'string') { + innerReference = this.innerReference = _glimmerReference.referenceFromParts(this.sourceReference, path.split('.')); + } else if (pathType === 'number') { + innerReference = this.innerReference = this.sourceReference.get(path); + } + + innerTag.update(innerReference.tag); + } else { + innerReference = this.innerReference = null; + innerTag.update(_glimmerReference.CONSTANT_TAG); } - loops++; - return backburner.join(null, K); } - } - loops = 0; - } - backburner.on('begin', loopBegin); - backburner.on('end', loopEnd); + return innerReference ? innerReference.value() : null; + }; - var Renderer = (function () { - function Renderer(env, rootTemplate) { - var _viewRegistry = arguments.length <= 2 || arguments[2] === undefined ? _emberViews.fallbackViewRegistry : arguments[2]; + GetHelperReference.prototype[_emberGlimmerUtilsReferences.UPDATE] = function (value) { + _emberMetal.set(this.sourceReference.value(), this.pathReference.value(), value); + }; - var destinedForDOM = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3]; - babelHelpers.classCallCheck(this, Renderer); + return GetHelperReference; + })(_emberGlimmerUtilsReferences.CachedReference); +}); +enifed("ember-glimmer/helpers/hash", ["exports"], function (exports) { + /** + @module ember + @submodule ember-glimmer + */ - this._env = env; - this._rootTemplate = rootTemplate; - this._viewRegistry = _viewRegistry; - this._destinedForDOM = destinedForDOM; - this._destroyed = false; - this._roots = []; - this._lastRevision = null; - this._isRenderingRoots = false; - this._removedRoots = []; - } + /** + Use the `{{hash}}` helper to create a hash to pass as an option to your + components. This is specially useful for contextual components where you can + just yield a hash: + + ```handlebars + {{yield (hash + name='Sarah' + title=office + )}} + ``` + + Would result in an object such as: + + ```js + { name: 'Sarah', title: this.get('office') } + ``` + + Where the `title` is bound to updates of the `office` property. + + @method hash + @for Ember.Templates.helpers + @param {Object} options + @return {Object} Hash + @since 2.3.0 + @public + */ - // renderer HOOKS + "use strict"; - Renderer.prototype.appendOutletView = function appendOutletView(view, target) { - var definition = new _emberGlimmerSyntaxOutlet.TopLevelOutletComponentDefinition(view); - var outletStateReference = view.toReference(); - var targetObject = view.outletState.render.controller; + exports.default = function (vm, args) { + return args.named; + }; +}); +enifed('ember-glimmer/helpers/if-unless', ['exports', 'ember-metal', 'ember-glimmer/utils/references', '@glimmer/reference'], function (exports, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference) { + /** + @module ember + @submodule ember-glimmer + */ - this._appendDefinition(view, definition, target, outletStateReference, targetObject); - }; + 'use strict'; - Renderer.prototype.appendTo = function appendTo(view, target) { - var rootDef = new _emberGlimmerSyntaxCurlyComponent.RootComponentDefinition(view); + exports.inlineIf = inlineIf; + exports.inlineUnless = inlineUnless; - this._appendDefinition(view, rootDef, target); - }; + /** + 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`, `NaN` or an empty array, the block will not be rendered. + + ```handlebars + {{! will not render if foo is falsey}} + {{#if foo}} + Welcome to the {{foo.bar}} + {{/if}} + ``` + + You can also specify a template to show if the property is falsey by using + the `else` helper. + + ```handlebars + {{! is it raining outside?}} + {{#if isRaining}} + Yes, grab an umbrella! + {{else}} + No, it's lovely outside! + {{/if}} + ``` + + You are also able to combine `else` and `if` helpers to create more complex + conditional logic. + + ```handlebars + {{#if isMorning}} + Good morning + {{else if isAfternoon}} + Good afternoon + {{else}} + Good night + {{/if}} + ``` + + You can use `if` inline to conditionally render a single property or string. + This helper acts like a ternary operator. If the first property is truthy, + the second argument will be displayed, if not, the third argument will be + displayed + + ```handlebars + {{if useLongGreeting "Hello" "Hi"}} Dave + ``` + + Finally, you can use the `if` helper inside another helper as a subexpression. + + ```handlebars + {{some-component height=(if isBig "100" "10")}} + ``` + + @method if + @for Ember.Templates.helpers + @public + */ - Renderer.prototype._appendDefinition = function _appendDefinition(root, definition, target) { - var outletStateReference = arguments.length <= 3 || arguments[3] === undefined ? _glimmerReference.UNDEFINED_REFERENCE : arguments[3]; - var targetObject = arguments.length <= 4 || arguments[4] === undefined ? null : arguments[4]; + var ConditionalHelperReference = (function (_CachedReference) { + babelHelpers.inherits(ConditionalHelperReference, _CachedReference); - var self = new _emberGlimmerUtilsReferences.RootReference(definition); - var dynamicScope = new DynamicScope(null, outletStateReference, outletStateReference, true, targetObject); - var rootState = new RootState(root, this._env, this._rootTemplate, self, target, dynamicScope); + ConditionalHelperReference.create = function create(_condRef, _truthyRef, _falsyRef) { + var condRef = _emberGlimmerUtilsReferences.ConditionalReference.create(_condRef); + var truthyRef = _truthyRef || _emberGlimmerUtilsReferences.UNDEFINED_REFERENCE; + var falsyRef = _falsyRef || _emberGlimmerUtilsReferences.UNDEFINED_REFERENCE; - this._renderRoot(rootState); + if (_glimmerReference.isConst(condRef)) { + return condRef.value() ? truthyRef : falsyRef; + } else { + return new ConditionalHelperReference(condRef, truthyRef, falsyRef); + } }; - Renderer.prototype.rerender = function rerender(view) { - this._scheduleRevalidate(); - }; + function ConditionalHelperReference(cond, truthy, falsy) { + babelHelpers.classCallCheck(this, ConditionalHelperReference); - Renderer.prototype.register = function register(view) { - var id = _emberViews.getViewId(view); - _emberMetal.assert('Attempted to register a view with an id already in use: ' + id, !this._viewRegistry[id]); - this._viewRegistry[id] = view; - }; + _CachedReference.call(this); - Renderer.prototype.unregister = function unregister(view) { - delete this._viewRegistry[_emberViews.getViewId(view)]; - }; + this.branchTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); + this.tag = _glimmerReference.combine([cond.tag, this.branchTag]); - Renderer.prototype.remove = function remove(view) { - view._transitionTo('destroying'); + this.cond = cond; + this.truthy = truthy; + this.falsy = falsy; + } - this.cleanupRootFor(view); + /** + The inline `if` helper conditionally renders a single property or string. + This helper acts like a ternary operator. If the first property is truthy, + the second argument will be displayed, otherwise, the third argument will be + displayed + + ```handlebars + {{if useLongGreeting "Hello" "Hi"}} Alex + ``` + + You can use the `if` helper inside another helper as a subexpression. + + ```handlebars + {{some-component height=(if isBig "100" "10")}} + ``` + + @method if + @for Ember.Templates.helpers + @public + */ - _emberViews.setViewElement(view, null); + ConditionalHelperReference.prototype.compute = function compute() { + var cond = this.cond; + var truthy = this.truthy; + var falsy = this.falsy; - if (this._destinedForDOM) { - view.trigger('didDestroyElement'); - } + var branch = cond.value() ? truthy : falsy; - if (!view.isDestroying) { - view.destroy(); - } + this.branchTag.update(branch.tag); + + return branch.value(); }; - Renderer.prototype.cleanupRootFor = function cleanupRootFor(view) { - // no need to cleanup roots if we have already been destroyed - if (this._destroyed) { - return; - } + return ConditionalHelperReference; + })(_emberGlimmerUtilsReferences.CachedReference); - var roots = this._roots; + function inlineIf(vm, _ref) { + var positional = _ref.positional; - // traverse in reverse so we can remove items - // without mucking up the index - var i = this._roots.length; - while (i--) { - var root = roots[i]; - if (root.isFor(view)) { - root.destroy(); - } - } - }; - - Renderer.prototype.destroy = function destroy() { - if (this._destroyed) { - return; - } - this._destroyed = true; - this._clearAllRoots(); - }; - - Renderer.prototype.getElement = function getElement(view) { - // overriden in the subclasses - }; - - Renderer.prototype.getBounds = function getBounds(view) { - var bounds = view[_emberGlimmerComponent.BOUNDS]; - - var parentElement = bounds.parentElement(); - var firstNode = bounds.firstNode(); - var lastNode = bounds.lastNode(); - - return { parentElement: parentElement, firstNode: firstNode, lastNode: lastNode }; - }; - - Renderer.prototype.createElement = function createElement(tagName) { - return this._env.getAppendOperations().createElement(tagName); - }; - - Renderer.prototype._renderRoot = function _renderRoot(root) { - var roots = this._roots; - - roots.push(root); - - if (roots.length === 1) { - register(this); - } - - this._renderRootsTransaction(); - }; - - Renderer.prototype._renderRoots = function _renderRoots() { - var roots = this._roots; - var env = this._env; - var removedRoots = this._removedRoots; - - var globalShouldReflush = undefined, - initialRootsLength = undefined; - - do { - env.begin(); - - // ensure that for the first iteration of the loop - // each root is processed - initialRootsLength = roots.length; - globalShouldReflush = false; - - for (var i = 0; i < roots.length; i++) { - var root = roots[i]; - - if (root.destroyed) { - // add to the list of roots to be removed - // they will be removed from `this._roots` later - removedRoots.push(root); - - // skip over roots that have been marked as destroyed - continue; - } - - var shouldReflush = root.shouldReflush; - - // when processing non-initial reflush loops, - // do not process more roots than needed - if (i >= initialRootsLength && !shouldReflush) { - continue; - } - - root.options.alwaysRevalidate = shouldReflush; - // track shouldReflush based on this roots render result - shouldReflush = root.shouldReflush = runInTransaction(root, 'render'); - - // globalShouldReflush should be `true` if *any* of - // the roots need to reflush - globalShouldReflush = globalShouldReflush || shouldReflush; - } - - this._lastRevision = _glimmerReference.CURRENT_TAG.value(); - - env.commit(); - } while (globalShouldReflush || roots.length > initialRootsLength); - - // remove any roots that were destroyed during this transaction - while (removedRoots.length) { - var root = removedRoots.pop(); - - var rootIndex = roots.indexOf(root); - roots.splice(rootIndex, 1); - } - - if (this._roots.length === 0) { - deregister(this); - } - }; - - Renderer.prototype._renderRootsTransaction = function _renderRootsTransaction() { - if (this._isRenderingRoots) { - // currently rendering roots, a new root was added and will - // be processed by the existing _renderRoots invocation - return; - } - - // used to prevent calling _renderRoots again (see above) - // while we are actively rendering roots - this._isRenderingRoots = true; - - var completedWithoutError = false; - try { - this._renderRoots(); - completedWithoutError = true; - } finally { - if (!completedWithoutError) { - this._lastRevision = _glimmerReference.CURRENT_TAG.value(); - } - this._isRenderingRoots = false; - } - }; - - Renderer.prototype._clearAllRoots = function _clearAllRoots() { - var roots = this._roots; - for (var i = 0; i < roots.length; i++) { - var root = roots[i]; - root.destroy(); - } - - this._removedRoots.length = 0; - this._roots = null; - - // if roots were present before destroying - // deregister this renderer instance - if (roots.length) { - deregister(this); - } - }; - - Renderer.prototype._scheduleRevalidate = function _scheduleRevalidate() { - backburner.scheduleOnce('render', this, this._revalidate); - }; - - Renderer.prototype._isValid = function _isValid() { - return this._destroyed || this._roots.length === 0 || _glimmerReference.CURRENT_TAG.validate(this._lastRevision); - }; - - Renderer.prototype._revalidate = function _revalidate() { - if (this._isValid()) { - return; - } - this._renderRootsTransaction(); - }; - - return Renderer; - })(); - - var InertRenderer = (function (_Renderer) { - babelHelpers.inherits(InertRenderer, _Renderer); - - function InertRenderer() { - babelHelpers.classCallCheck(this, InertRenderer); - - _Renderer.apply(this, arguments); + switch (positional.length) { + case 2: + return ConditionalHelperReference.create(positional.at(0), positional.at(1), null); + case 3: + return ConditionalHelperReference.create(positional.at(0), positional.at(1), positional.at(2)); + default: + _emberMetal.assert('The inline form of the `if` helper expects two or three arguments, e.g. ' + '`{{if trialExpired "Expired" expiryDate}}`.'); } + } - InertRenderer.create = function create(_ref) { - var env = _ref.env; - var rootTemplate = _ref.rootTemplate; - var _viewRegistry = _ref._viewRegistry; - - return new this(env, rootTemplate, _viewRegistry, false); - }; - - InertRenderer.prototype.getElement = function getElement(view) { - throw new Error('Accessing `this.element` is not allowed in non-interactive environments (such as FastBoot).'); - }; - - return InertRenderer; - })(Renderer); - - exports.InertRenderer = InertRenderer; - - var InteractiveRenderer = (function (_Renderer2) { - babelHelpers.inherits(InteractiveRenderer, _Renderer2); + /** + The inline `unless` helper conditionally renders a single property or string. + This helper acts like a ternary operator. If the first property is falsy, + the second argument will be displayed, otherwise, the third argument will be + displayed + + ```handlebars + {{unless useLongGreeting "Hi" "Hello"}} Ben + ``` + + You can use the `unless` helper inside another helper as a subexpression. + + ```handlebars + {{some-component height=(unless isBig "10" "100")}} + ``` + + @method unless + @for Ember.Templates.helpers + @public + */ - function InteractiveRenderer() { - babelHelpers.classCallCheck(this, InteractiveRenderer); + function inlineUnless(vm, _ref2) { + var positional = _ref2.positional; - _Renderer2.apply(this, arguments); + switch (positional.length) { + case 2: + return ConditionalHelperReference.create(positional.at(0), null, positional.at(1)); + case 3: + return ConditionalHelperReference.create(positional.at(0), positional.at(2), positional.at(1)); + default: + _emberMetal.assert('The inline form of the `unless` helper expects two or three arguments, e.g. ' + '`{{unless isFirstLogin "Welcome back!"}}`.'); } + } +}); +enifed('ember-glimmer/helpers/loc', ['exports', 'ember-glimmer/utils/references', 'ember-runtime'], function (exports, _emberGlimmerUtilsReferences, _emberRuntime) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; - InteractiveRenderer.create = function create(_ref2) { - var env = _ref2.env; - var rootTemplate = _ref2.rootTemplate; - var _viewRegistry = _ref2._viewRegistry; - - return new this(env, rootTemplate, _viewRegistry, true); - }; - - InteractiveRenderer.prototype.getElement = function getElement(view) { - return _emberViews.getViewElement(view); + /** + Calls [Ember.String.loc](/api/classes/Ember.String.html#method_loc) with the + provided string. This is a convenient way to localize text within a template. + For example: + + ```javascript + Ember.STRINGS = { + '_welcome_': 'Bonjour' }; + ``` + + ```handlebars +
    + {{loc '_welcome_'}} +
    + ``` + + ```html +
    + Bonjour +
    + ``` + + See [Ember.String.loc](/api/classes/Ember.String.html#method_loc) for how to + set up localized string references. + + @method loc + @for Ember.Templates.helpers + @param {String} str The string to format. + @see {Ember.String#loc} + @public + */ + function locHelper(_ref) { + var positional = _ref.positional; - return InteractiveRenderer; - })(Renderer); + return _emberRuntime.String.loc.apply(null, positional.value()); + } - exports.InteractiveRenderer = InteractiveRenderer; + exports.default = function (vm, args) { + return new _emberGlimmerUtilsReferences.InternalHelperReference(locHelper, args); + }; }); -enifed('ember-glimmer/setup-registry', ['exports', 'ember-environment', 'container', 'ember-glimmer/renderer', 'ember-glimmer/dom', 'ember-glimmer/views/outlet', 'ember-glimmer/components/text_field', 'ember-glimmer/components/text_area', 'ember-glimmer/components/checkbox', 'ember-glimmer/components/link-to', 'ember-glimmer/component', 'ember-glimmer/templates/component', 'ember-glimmer/templates/root', 'ember-glimmer/templates/outlet', 'ember-glimmer/environment'], function (exports, _emberEnvironment, _container, _emberGlimmerRenderer, _emberGlimmerDom, _emberGlimmerViewsOutlet, _emberGlimmerComponentsText_field, _emberGlimmerComponentsText_area, _emberGlimmerComponentsCheckbox, _emberGlimmerComponentsLinkTo, _emberGlimmerComponent, _emberGlimmerTemplatesComponent, _emberGlimmerTemplatesRoot, _emberGlimmerTemplatesOutlet, _emberGlimmerEnvironment) { +enifed('ember-glimmer/helpers/log', ['exports', 'ember-glimmer/utils/references', 'ember-console'], function (exports, _emberGlimmerUtilsReferences, _emberConsole) { 'use strict'; - exports.setupApplicationRegistry = setupApplicationRegistry; - exports.setupEngineRegistry = setupEngineRegistry; - - var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['template:-root'], ['template:-root']), - _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['template:components/-default'], ['template:components/-default']), - _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['component:-default'], ['component:-default']); + /** + `log` allows you to output the value of variables in the current rendering + context. `log` also accepts primitive types such as strings or numbers. + + ```handlebars + {{log "myVariable:" myVariable }} + ``` + + @method log + @for Ember.Templates.helpers + @param {Array} params + @public + */ + function log(_ref) { + var positional = _ref.positional; - function setupApplicationRegistry(registry) { - registry.injection('service:-glimmer-environment', 'appendOperations', 'service:-dom-tree-construction'); - registry.injection('renderer', 'env', 'service:-glimmer-environment'); + _emberConsole.default.log.apply(null, positional.value()); + } - registry.register(_container.privatize(_templateObject), _emberGlimmerTemplatesRoot.default); - registry.injection('renderer', 'rootTemplate', _container.privatize(_templateObject)); + exports.default = function (vm, args) { + return new _emberGlimmerUtilsReferences.InternalHelperReference(log, args); + }; +}); - registry.register('renderer:-dom', _emberGlimmerRenderer.InteractiveRenderer); - registry.register('renderer:-inert', _emberGlimmerRenderer.InertRenderer); +/** +@module ember +@submodule ember-glimmer +*/ +enifed('ember-glimmer/helpers/mut', ['exports', 'ember-utils', 'ember-metal', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/action'], function (exports, _emberUtils, _emberMetal, _emberGlimmerUtilsReferences, _emberGlimmerHelpersAction) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; - if (_emberEnvironment.environment.hasDOM) { - registry.injection('service:-glimmer-environment', 'updateOperations', 'service:-dom-changes'); - } + exports.isMut = isMut; + exports.unMut = unMut; - registry.register('service:-dom-changes', { - create: function (_ref) { - var document = _ref.document; - return new _emberGlimmerDom.DOMChanges(document); + /** + 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 component__. + + To specify that a parameter is mutable, when invoking the child `Component`: + + ```handlebars + {{my-child childClickCount=(mut totalClicks)}} + ``` + + The child `Component` can then modify the parent's value just by modifying its own + property: + + ```javascript + // my-child.js + export default Component.extend({ + click() { + this.incrementProperty('childClickCount'); } }); - - registry.register('service:-dom-tree-construction', { - create: function (_ref2) { - var document = _ref2.document; - - var Implementation = _emberEnvironment.environment.hasDOM ? _emberGlimmerDom.DOMTreeConstruction : _emberGlimmerDom.NodeDOMTreeConstruction; - return new Implementation(document); + ``` + + Note that for curly components (`{{my-component}}`) the bindings are already mutable, + making the `mut` unnecessary. + + Additionally, the `mut` helper can be combined with the `action` helper to + mutate a value. For example: + + ```handlebars + {{my-child childClickCount=totalClicks click-count-change=(action (mut totalClicks))}} + ``` + + The child `Component` would invoke the action with the new click value: + + ```javascript + // my-child.js + export default Component.extend({ + click() { + this.get('click-count-change')(this.get('childClickCount') + 1); } }); - } - - function setupEngineRegistry(registry) { - registry.register('view:-outlet', _emberGlimmerViewsOutlet.default); - registry.register('template:-outlet', _emberGlimmerTemplatesOutlet.default); - registry.injection('view:-outlet', 'template', 'template:-outlet'); - - registry.injection('service:-dom-changes', 'document', 'service:-document'); - registry.injection('service:-dom-tree-construction', 'document', 'service:-document'); - - registry.register(_container.privatize(_templateObject2), _emberGlimmerTemplatesComponent.default); - - registry.register('service:-glimmer-environment', _emberGlimmerEnvironment.default); - registry.injection('template', 'env', 'service:-glimmer-environment'); - - registry.optionsForType('helper', { instantiate: false }); - - registry.register('component:-text-field', _emberGlimmerComponentsText_field.default); - registry.register('component:-text-area', _emberGlimmerComponentsText_area.default); - registry.register('component:-checkbox', _emberGlimmerComponentsCheckbox.default); - registry.register('component:link-to', _emberGlimmerComponentsLinkTo.default); - registry.register(_container.privatize(_templateObject3), _emberGlimmerComponent.default); - } -}); -enifed('ember-glimmer/syntax', ['exports', 'ember-glimmer/syntax/render', 'ember-glimmer/syntax/outlet', 'ember-glimmer/syntax/mount', 'ember-glimmer/syntax/dynamic-component', 'ember-glimmer/syntax/input', 'glimmer-runtime'], function (exports, _emberGlimmerSyntaxRender, _emberGlimmerSyntaxOutlet, _emberGlimmerSyntaxMount, _emberGlimmerSyntaxDynamicComponent, _emberGlimmerSyntaxInput, _glimmerRuntime) { - 'use strict'; - - exports.registerSyntax = registerSyntax; - exports.findSyntaxBuilder = findSyntaxBuilder; - - var syntaxKeys = []; - var syntaxes = []; + ``` + + The `mut` helper changes the `totalClicks` value to what was provided as the action argument. + + The `mut` helper, when used with `action`, will return a function that + sets the value passed to `mut` to its first argument. This works like any other + closure action and interacts with the other features `action` provides. + As an example, we can create a button that increments a value passing the value + directly to the `action`: + + ```handlebars + {{! inc helper is not provided by Ember }} + + ``` + + You can also use the `value` option: + + ```handlebars + + ``` + + @method mut + @param {Object} [attr] the "two-way" attribute that can be modified. + @for Ember.Templates.helpers + @public + */ + var MUT_REFERENCE = _emberUtils.symbol('MUT'); + var SOURCE = _emberUtils.symbol('SOURCE'); - function registerSyntax(key, syntax) { - syntaxKeys.push(key); - syntaxes.push(syntax); + function isMut(ref) { + return ref && ref[MUT_REFERENCE]; } - function findSyntaxBuilder(key) { - var index = syntaxKeys.indexOf(key); - - if (index > -1) { - return syntaxes[index]; - } + function unMut(ref) { + return ref[SOURCE] || ref; } - registerSyntax('render', _emberGlimmerSyntaxRender.RenderSyntax); - registerSyntax('outlet', _emberGlimmerSyntaxOutlet.OutletSyntax); - registerSyntax('mount', _emberGlimmerSyntaxMount.MountSyntax); - registerSyntax('component', _emberGlimmerSyntaxDynamicComponent.DynamicComponentSyntax); - registerSyntax('input', _emberGlimmerSyntaxInput.InputSyntax); + exports.default = function (vm, args) { + var rawRef = args.positional.at(0); - registerSyntax('-with-dynamic-vars', (function () { - function _class() { - babelHelpers.classCallCheck(this, _class); + if (isMut(rawRef)) { + return rawRef; } - _class.create = function create(environment, args, symbolTable) { - return new _glimmerRuntime.WithDynamicVarsSyntax(args); - }; - - return _class; - })()); + // TODO: Improve this error message. This covers at least two distinct + // cases: + // + // 1. (mut "not a path") – passing a literal, result from a helper + // invocation, etc + // + // 2. (mut receivedValue) – passing a value received from the caller + // that was originally derived from a literal, result from a helper + // invocation, etc + // + // This message is alright for the first case, but could be quite + // confusing for the second case. + _emberMetal.assert('You can only pass a path to mut', rawRef[_emberGlimmerUtilsReferences.UPDATE]); - registerSyntax('-in-element', (function () { - function _class2() { - babelHelpers.classCallCheck(this, _class2); - } + var wrappedRef = Object.create(rawRef); - _class2.create = function create(environment, args, symbolTable) { - return new _glimmerRuntime.InElementSyntax(args); - }; + wrappedRef[SOURCE] = rawRef; + wrappedRef[_emberGlimmerHelpersAction.INVOKE] = rawRef[_emberGlimmerUtilsReferences.UPDATE]; + wrappedRef[MUT_REFERENCE] = true; - return _class2; - })()); + return wrappedRef; + }; }); -enifed('ember-glimmer/syntax/curly-component', ['exports', 'ember-utils', 'glimmer-runtime', 'ember-glimmer/utils/bindings', 'ember-glimmer/component', 'ember-metal', 'ember-views', 'ember-glimmer/utils/process-args', 'container'], function (exports, _emberUtils, _glimmerRuntime, _emberGlimmerUtilsBindings, _emberGlimmerComponent, _emberMetal, _emberViews, _emberGlimmerUtilsProcessArgs, _container) { +enifed('ember-glimmer/helpers/query-param', ['exports', 'ember-utils', 'ember-glimmer/utils/references', 'ember-metal', 'ember-routing'], function (exports, _emberUtils, _emberGlimmerUtilsReferences, _emberMetal, _emberRouting) { + /** + @module ember + @submodule ember-glimmer + */ 'use strict'; - exports.validatePositionalParameters = validatePositionalParameters; + /** + This is a helper to be used in conjunction with the link-to helper. + It will supply url query parameters to the target route. + + Example + + ```handlebars + {{#link-to 'posts' (query-params direction="asc")}}Sort{{/link-to}} + ``` + + @method query-params + @for Ember.Templates.helpers + @param {Object} hash takes a hash of query parameters + @return {Object} A `QueryParams` object for `{{link-to}}` + @public + */ + function queryParams(_ref) { + var positional = _ref.positional; + var named = _ref.named; - var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['template:components/-default'], ['template:components/-default']); + _emberMetal.assert('The `query-params` helper only accepts hash parameters, e.g. (query-params queryParamPropertyName=\'foo\') as opposed to just (query-params \'foo\')', positional.value().length === 0); - var DEFAULT_LAYOUT = _container.privatize(_templateObject); + return _emberRouting.QueryParams.create({ + values: _emberUtils.assign({}, named.value()) + }); + } - function processComponentInitializationAssertions(component, props) { - _emberMetal.assert('classNameBindings must not have spaces in them: ' + component.toString(), (function () { - var classNameBindings = component.classNameBindings; - - for (var i = 0; i < classNameBindings.length; i++) { - var binding = classNameBindings[i]; - if (binding.split(' ').length > 1) { - return false; - } - } - return true; - })()); - - _emberMetal.assert('You cannot use `classNameBindings` on a tag-less component: ' + component.toString(), (function () { - var classNameBindings = component.classNameBindings; - var tagName = component.tagName; - - return tagName !== '' || !classNameBindings || classNameBindings.length === 0; - })()); - - _emberMetal.assert('You cannot use `elementId` on a tag-less component: ' + component.toString(), (function () { - var elementId = component.elementId; - var tagName = component.tagName; - - return tagName !== '' || props.id === elementId || !elementId && elementId !== ''; - })()); - - _emberMetal.assert('You cannot use `attributeBindings` on a tag-less component: ' + component.toString(), (function () { - var attributeBindings = component.attributeBindings; - var tagName = component.tagName; - - return tagName !== '' || !attributeBindings || attributeBindings.length === 0; - })()); - } + exports.default = function (vm, args) { + return new _emberGlimmerUtilsReferences.InternalHelperReference(queryParams, args); + }; +}); +enifed('ember-glimmer/helpers/readonly', ['exports', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/mut'], function (exports, _emberGlimmerUtilsReferences, _emberGlimmerHelpersMut) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; - function validatePositionalParameters(named, positional, positionalParamsDefinition) { - _emberMetal.runInDebug(function () { - if (!named || !positional || !positional.length) { - return; + /** + The `readonly` helper let's you specify that a binding is one-way only, + instead of two-way. + When you pass a `readonly` binding from an outer context (e.g. parent component), + to to an inner context (e.g. child component), you are saying that changing that + property in the inner context does not change the value in the outer context. + + To specify that a binding is read-only, when invoking the child `Component`: + + ```app/components/my-parent.js + export default Component.extend({ + totalClicks: 3 + }); + ``` + + ```app/templates/components/my-parent.hbs + {{log totalClicks}} // -> 3 + {{my-child childClickCount=(readonly totalClicks)}} + ``` + + Now, when you update `childClickCount`: + + ```app/components/my-child.js + export default Component.extend({ + click() { + this.incrementProperty('childClickCount'); } - - var paramType = typeof positionalParamsDefinition; - - if (paramType === 'string') { - _emberMetal.assert('You cannot specify positional parameters and the hash argument `' + positionalParamsDefinition + '`.', !named.has(positionalParamsDefinition)); - } else { - if (positional.length < positionalParamsDefinition.length) { - positionalParamsDefinition = positionalParamsDefinition.slice(0, positional.length); - } - - for (var i = 0; i < positionalParamsDefinition.length; i++) { - var _name = positionalParamsDefinition[i]; - - _emberMetal.assert('You cannot specify both a positional param (at position ' + i + ') and the hash argument `' + _name + '`.', !named.has(_name)); - } + }); + ``` + + The value updates in the child component, but not the parent component: + + ```app/templates/components/my-child.hbs + {{log childClickCount}} //-> 4 + ``` + + ```app/templates/components/my-parent.hbs + {{log totalClicks}} //-> 3 + {{my-child childClickCount=(readonly totalClicks)}} + ``` + + ### Objects and Arrays + + When passing a property that is a complex object (e.g. object, array) instead of a primitive object (e.g. number, string), + only the reference to the object is protected using the readonly helper. + This means that you can change properties of the object both on the parent component, as well as the child component. + The `readonly` binding behaves similar to the `const` keyword in JavaScript. + + Let's look at an example: + + First let's set up the parent component: + + ```app/components/my-parent.js + export default Ember.Component.extend({ + clicks: null, + + init() { + this._super(...arguments); + this.set('clicks', { total: 3 }); } }); - } - - function aliasIdToElementId(args, props) { - if (args.named.has('id')) { - _emberMetal.assert('You cannot invoke a component with both \'id\' and \'elementId\' at the same time.', !args.named.has('elementId')); - props.elementId = props.id; - } - } - - // We must traverse the attributeBindings in reverse keeping track of - // what has already been applied. This is essentially refining the concated - // properties applying right to left. - function applyAttributeBindings(element, attributeBindings, component, operations) { - var seen = []; - var i = attributeBindings.length - 1; - - while (i !== -1) { - var binding = attributeBindings[i]; - var parsed = _emberGlimmerUtilsBindings.AttributeBinding.parse(binding); - var attribute = parsed[1]; - - if (seen.indexOf(attribute) === -1) { - seen.push(attribute); - _emberGlimmerUtilsBindings.AttributeBinding.install(element, component, parsed, operations); + ``` + + ```app/templates/components/my-parent.hbs + {{log clicks.total}} //-> 3 + {{my-child childClicks=(readonly clicks)}} + ``` + + Now, if you update the `total` property of `childClicks`: + + ```app/components/my-child.js + export default Ember.Component.extend({ + click() { + this.get('clicks').incrementProperty('total'); } + }); + ``` + + You will see the following happen: + + ```app/templates/components/my-parent.hbs + {{log clicks.total}} //-> 4 + {{my-child childClicks=(readonly clicks)}} + ``` + + ```app/templates/components/my-child.hbs + {{log childClicks.total}} //-> 4 + ``` + + @method readonly + @param {Object} [attr] the read-only attribute. + @for Ember.Templates.helpers + @private + */ - i--; - } - - if (seen.indexOf('id') === -1) { - operations.addStaticAttribute(element, 'id', component.elementId); - } - - if (seen.indexOf('style') === -1) { - _emberGlimmerUtilsBindings.IsVisibleBinding.install(element, component, operations); - } - } - - var CurlyComponentSyntax = (function (_StatementSyntax) { -babelHelpers.inherits(CurlyComponentSyntax, _StatementSyntax); - - function CurlyComponentSyntax(args, definition, symbolTable) { -babelHelpers.classCallCheck(this, CurlyComponentSyntax); - - _StatementSyntax.call(this); - this.args = args; - this.definition = definition; - this.symbolTable = symbolTable; - this.shadow = null; - } - - CurlyComponentSyntax.prototype.compile = function compile(builder) { - builder.component.static(this.definition, this.args, this.symbolTable, this.shadow); - }; - - return CurlyComponentSyntax; - })(_glimmerRuntime.StatementSyntax); - - exports.CurlyComponentSyntax = CurlyComponentSyntax; + exports.default = function (vm, args) { + var ref = _emberGlimmerHelpersMut.unMut(args.positional.at(0)); - function NOOP() {} + var wrapped = Object.create(ref); - var ComponentStateBucket = (function () { - function ComponentStateBucket(environment, component, args, finalizer) { -babelHelpers.classCallCheck(this, ComponentStateBucket); + wrapped[_emberGlimmerUtilsReferences.UPDATE] = undefined; - this.environment = environment; - this.component = component; - this.classRef = null; - this.args = args; - this.argsRevision = args.tag.value(); - this.finalizer = finalizer; - } + return wrapped; + }; +}); +enifed('ember-glimmer/helpers/unbound', ['exports', 'ember-metal', 'ember-glimmer/utils/references'], function (exports, _emberMetal, _emberGlimmerUtilsReferences) { + /** + @module ember + @submodule ember-glimmer + */ - ComponentStateBucket.prototype.destroy = function destroy() { - var component = this.component; - var environment = this.environment; + 'use strict'; - if (environment.isInteractive) { - component.trigger('willDestroyElement'); - component.trigger('willClearRender'); - } + /** + 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 + */ - environment.destroyedComponents.push(component); - }; + exports.default = function (vm, args) { + _emberMetal.assert('unbound helper cannot be called with multiple params or hash params', args.positional.values.length === 1 && args.named.keys.length === 0); - ComponentStateBucket.prototype.finalize = function finalize() { - var finalizer = this.finalizer; + return _emberGlimmerUtilsReferences.UnboundReference.create(args.positional.at(0).value()); + }; +}); +enifed('ember-glimmer/index', ['exports', 'ember-glimmer/helpers/action', 'ember-glimmer/templates/root', 'ember-glimmer/template', 'ember-glimmer/components/checkbox', 'ember-glimmer/components/text_field', 'ember-glimmer/components/text_area', 'ember-glimmer/components/link-to', 'ember-glimmer/component', 'ember-glimmer/helper', 'ember-glimmer/environment', 'ember-glimmer/make-bound-helper', 'ember-glimmer/utils/string', 'ember-glimmer/renderer', 'ember-glimmer/template_registry', 'ember-glimmer/setup-registry', 'ember-glimmer/dom'], function (exports, _emberGlimmerHelpersAction, _emberGlimmerTemplatesRoot, _emberGlimmerTemplate, _emberGlimmerComponentsCheckbox, _emberGlimmerComponentsText_field, _emberGlimmerComponentsText_area, _emberGlimmerComponentsLinkTo, _emberGlimmerComponent, _emberGlimmerHelper, _emberGlimmerEnvironment, _emberGlimmerMakeBoundHelper, _emberGlimmerUtilsString, _emberGlimmerRenderer, _emberGlimmerTemplate_registry, _emberGlimmerSetupRegistry, _emberGlimmerDom) { + /** + [Glimmer](https://github.com/tildeio/glimmer) is a [Handlebars](http://handlebarsjs.com/) + compatible templating engine used by Ember.js. + 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}} +
    {{name}}
    + + ``` + + Any time the "name" property on the component changes, the DOM will be + updated. + + Properties can be chained as well: + + ```handlebars + {{aUserModel.name}} +
    {{listOfUsers.firstObject.name}}
    + ``` + + ### 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"}} + + ``` + + 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 + + ``` + + 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-glimmer + @main ember-glimmer + @public + */ - finalizer(); - this.finalizer = NOOP; - }; + /** + 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 + `{{with}}` block. + + If the aliased property is "falsey", for example: `false`, `undefined` `null`, `""`, `0`, NaN or + an empty array, the block will not be rendered. + + ```handlebars + {{! Will only render if user.posts contains items}} + {{#with user.posts as |blogPosts|}} +
    + There are {{blogPosts.length}} blog posts written by {{user.name}}. +
    + {{#each blogPosts as |post|}} +
  • {{post.title}}
  • + {{/each}} + {{/with}} + ``` + + Without the `as` operator, it would be impossible to reference `user.name` in the example above. + + NOTE: The alias should not reuse a name from the bound property path. + + For example: `{{#with foo.bar as |foo|}}` is not supported because it attempts to alias using + the first part of the property path, `foo`. Instead, use `{{#with foo.bar as |baz|}}`. + + @method with + @for Ember.Templates.helpers + @param {Object} options + @return {String} HTML string + @public + */ - return ComponentStateBucket; - })(); + /** + Execute the `debugger` statement in the current template's context. + + ```handlebars + {{debugger}} + ``` + + When using the debugger helper you will have access to a `get` function. This + function retrieves values available in the context of the template. + For example, if you're wondering why a value `{{foo}}` isn't rendering as + expected within a template, you could place a `{{debugger}}` statement and, + when the `debugger;` breakpoint is hit, you can attempt to retrieve this value: + + ``` + > get('foo') + ``` + + `get` is also aware of keywords. So in this situation + + ```handlebars + {{#each items as |item|}} + {{debugger}} + {{/each}} + ``` + + You'll be able to get values from the current item: + + ``` + > get('item.name') + ``` + + You can also access the context of the view to make sure it is the object that + you expect: + + ``` + > context + ``` + + @method debugger + @for Ember.Templates.helpers + @public + */ - function initialRenderInstrumentDetails(component) { - return component.instrumentDetails({ initialRender: true }); - } + /** + The `partial` helper renders another template without + changing the template context: + + ```handlebars + {{foo}} + {{partial "nav"}} + ``` + + The above example template will render a template named + "-nav", which has the same context as the parent template + it's rendered into, so if the "-nav" template also referenced + `{{foo}}`, it would print the same thing as the `{{foo}}` + in the above example. + + If a "-nav" template isn't found, the `partial` helper will + fall back to a template named "nav". + + ### Bound template names + + The parameter supplied to `partial` can also be a path + to a property containing a template name, e.g.: + + ```handlebars + {{partial someTemplateName}} + ``` + + The above example will look up the value of `someTemplateName` + on the template context (e.g. a controller) and use that + value as the name of the template to render. If the resolved + value is falsy, nothing will be rendered. If `someTemplateName` + changes, the partial will be re-rendered using the new template + name. + + @method partial + @for Ember.Templates.helpers + @param {String} partialName The name of the template to render minus the leading underscore. + @public + */ - function rerenderInstrumentDetails(component) { - return component.instrumentDetails({ initialRender: false }); - } + 'use strict'; - var CurlyComponentManager = (function () { - function CurlyComponentManager() { -babelHelpers.classCallCheck(this, CurlyComponentManager); - } + exports.INVOKE = _emberGlimmerHelpersAction.INVOKE; + exports.RootTemplate = _emberGlimmerTemplatesRoot.default; + exports.template = _emberGlimmerTemplate.default; + exports.Checkbox = _emberGlimmerComponentsCheckbox.default; + exports.TextField = _emberGlimmerComponentsText_field.default; + exports.TextArea = _emberGlimmerComponentsText_area.default; + exports.LinkComponent = _emberGlimmerComponentsLinkTo.default; + exports.Component = _emberGlimmerComponent.default; + exports.Helper = _emberGlimmerHelper.default; + exports.helper = _emberGlimmerHelper.helper; + exports.Environment = _emberGlimmerEnvironment.default; + exports.makeBoundHelper = _emberGlimmerMakeBoundHelper.default; + exports.SafeString = _emberGlimmerUtilsString.SafeString; + exports.escapeExpression = _emberGlimmerUtilsString.escapeExpression; + exports.htmlSafe = _emberGlimmerUtilsString.htmlSafe; + exports.isHTMLSafe = _emberGlimmerUtilsString.isHTMLSafe; + exports._getSafeString = _emberGlimmerUtilsString.getSafeString; + exports.Renderer = _emberGlimmerRenderer.Renderer; + exports.InertRenderer = _emberGlimmerRenderer.InertRenderer; + exports.InteractiveRenderer = _emberGlimmerRenderer.InteractiveRenderer; + exports.getTemplate = _emberGlimmerTemplate_registry.getTemplate; + exports.setTemplate = _emberGlimmerTemplate_registry.setTemplate; + exports.hasTemplate = _emberGlimmerTemplate_registry.hasTemplate; + exports.getTemplates = _emberGlimmerTemplate_registry.getTemplates; + exports.setTemplates = _emberGlimmerTemplate_registry.setTemplates; + exports.setupEngineRegistry = _emberGlimmerSetupRegistry.setupEngineRegistry; + exports.setupApplicationRegistry = _emberGlimmerSetupRegistry.setupApplicationRegistry; + exports.DOMChanges = _emberGlimmerDom.DOMChanges; + exports.NodeDOMTreeConstruction = _emberGlimmerDom.NodeDOMTreeConstruction; + exports.DOMTreeConstruction = _emberGlimmerDom.DOMTreeConstruction; +}); +enifed('ember-glimmer/make-bound-helper', ['exports', 'ember-metal', 'ember-glimmer/helper'], function (exports, _emberMetal, _emberGlimmerHelper) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; - CurlyComponentManager.prototype.prepareArgs = function prepareArgs(definition, args) { - validatePositionalParameters(args.named, args.positional.values, definition.ComponentClass.positionalParams); - - return _emberGlimmerUtilsProcessArgs.gatherArgs(args, definition); - }; - - CurlyComponentManager.prototype.create = function create(environment, definition, args, dynamicScope, callerSelfRef, hasBlock) { - var parentView = dynamicScope.view; - - var klass = definition.ComponentClass; - var processedArgs = _emberGlimmerUtilsProcessArgs.ComponentArgs.create(args); - - var _processedArgs$value = processedArgs.value(); - - var props = _processedArgs$value.props; - - aliasIdToElementId(args, props); - - props.parentView = parentView; - props[_emberGlimmerComponent.HAS_BLOCK] = hasBlock; - - props._targetObject = callerSelfRef.value(); - - var component = klass.create(props); - - var finalizer = _emberMetal._instrumentStart('render.component', initialRenderInstrumentDetails, component); - - dynamicScope.view = component; - - if (parentView !== null) { - parentView.appendChild(component); - } - - // We usually do this in the `didCreateElement`, but that hook doesn't fire for tagless components - if (component.tagName === '') { - if (environment.isInteractive) { - component.trigger('willRender'); - } - - component._transitionTo('hasElement'); - - if (environment.isInteractive) { - component.trigger('willInsertElement'); - } - } - - var bucket = new ComponentStateBucket(environment, component, processedArgs, finalizer); - - if (args.named.has('class')) { - bucket.classRef = args.named.get('class'); - } - - processComponentInitializationAssertions(component, props); - - if (environment.isInteractive && component.tagName !== '') { - component.trigger('willRender'); - } - - return bucket; - }; - - CurlyComponentManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { - var template = definition.template; - if (!template) { - var component = bucket.component; - - template = this.templateFor(component, env); - } - return env.getCompiledBlock(CurlyComponentLayoutCompiler, template); - }; - - CurlyComponentManager.prototype.templateFor = function templateFor(component, env) { - var Template = _emberMetal.get(component, 'layout'); - var owner = component[_emberUtils.OWNER]; - if (Template) { - return env.getTemplate(Template, owner); - } - var layoutName = _emberMetal.get(component, 'layoutName'); - if (layoutName) { - var template = owner.lookup('template:' + layoutName); - if (template) { - return template; - } - } - return owner.lookup(DEFAULT_LAYOUT); - }; - - CurlyComponentManager.prototype.getSelf = function getSelf(_ref) { - var component = _ref.component; - - return component[_emberGlimmerComponent.ROOT_REF]; - }; - - CurlyComponentManager.prototype.didCreateElement = function didCreateElement(_ref2, element, operations) { - var component = _ref2.component; - var classRef = _ref2.classRef; - var environment = _ref2.environment; - - _emberViews.setViewElement(component, element); - - var attributeBindings = component.attributeBindings; - var classNames = component.classNames; - var classNameBindings = component.classNameBindings; - - if (attributeBindings && attributeBindings.length) { - applyAttributeBindings(element, attributeBindings, component, operations); - } else { - operations.addStaticAttribute(element, 'id', component.elementId); - _emberGlimmerUtilsBindings.IsVisibleBinding.install(element, component, operations); - } - - if (classRef) { - operations.addDynamicAttribute(element, 'class', classRef); - } - - if (classNames && classNames.length) { - classNames.forEach(function (name) { - operations.addStaticAttribute(element, 'class', name); - }); - } - - if (classNameBindings && classNameBindings.length) { - classNameBindings.forEach(function (binding) { - _emberGlimmerUtilsBindings.ClassNameBinding.install(element, component, binding, operations); - }); - } - - component._transitionTo('hasElement'); - - if (environment.isInteractive) { - component.trigger('willInsertElement'); - } - }; - - CurlyComponentManager.prototype.didRenderLayout = function didRenderLayout(bucket, bounds) { - bucket.component[_emberGlimmerComponent.BOUNDS] = bounds; - bucket.finalize(); - }; - - CurlyComponentManager.prototype.getTag = function getTag(_ref3) { - var component = _ref3.component; - - return component[_emberGlimmerComponent.DIRTY_TAG]; - }; - - CurlyComponentManager.prototype.didCreate = function didCreate(_ref4) { - var component = _ref4.component; - var environment = _ref4.environment; - - if (environment.isInteractive) { - component._transitionTo('inDOM'); - component.trigger('didInsertElement'); - component.trigger('didRender'); - } - }; - - CurlyComponentManager.prototype.update = function update(bucket, _, dynamicScope) { - var component = bucket.component; - var args = bucket.args; - var argsRevision = bucket.argsRevision; - var environment = bucket.environment; - - bucket.finalizer = _emberMetal._instrumentStart('render.component', rerenderInstrumentDetails, component); - - if (!args.tag.validate(argsRevision)) { - var _args$value = args.value(); - - var attrs = _args$value.attrs; - var props = _args$value.props; - - bucket.argsRevision = args.tag.value(); - - var oldAttrs = component.attrs; - var newAttrs = attrs; - - component[_emberGlimmerComponent.IS_DISPATCHING_ATTRS] = true; - component.setProperties(props); - component[_emberGlimmerComponent.IS_DISPATCHING_ATTRS] = false; - - component.trigger('didUpdateAttrs', { oldAttrs: oldAttrs, newAttrs: newAttrs }); - component.trigger('didReceiveAttrs', { oldAttrs: oldAttrs, newAttrs: newAttrs }); - } - - if (environment.isInteractive) { - component.trigger('willUpdate'); - component.trigger('willRender'); - } - }; - - CurlyComponentManager.prototype.didUpdateLayout = function didUpdateLayout(bucket) { - bucket.finalize(); - }; - - CurlyComponentManager.prototype.didUpdate = function didUpdate(_ref5) { - var component = _ref5.component; - var environment = _ref5.environment; - - if (environment.isInteractive) { - component.trigger('didUpdate'); - component.trigger('didRender'); - } - }; - - CurlyComponentManager.prototype.getDestructor = function getDestructor(stateBucket) { - return stateBucket; - }; - - return CurlyComponentManager; - })(); - - var MANAGER = new CurlyComponentManager(); - - var TopComponentManager = (function (_CurlyComponentManager) { -babelHelpers.inherits(TopComponentManager, _CurlyComponentManager); - - function TopComponentManager() { -babelHelpers.classCallCheck(this, TopComponentManager); - - _CurlyComponentManager.apply(this, arguments); - } - - TopComponentManager.prototype.create = function create(environment, definition, args, dynamicScope, currentScope, hasBlock) { - var component = definition.ComponentClass; - - var finalizer = _emberMetal._instrumentStart('render.component', initialRenderInstrumentDetails, component); - - dynamicScope.view = component; - - // We usually do this in the `didCreateElement`, but that hook doesn't fire for tagless components - if (component.tagName === '') { - if (environment.isInteractive) { - component.trigger('willRender'); - } - - component._transitionTo('hasElement'); - - if (environment.isInteractive) { - component.trigger('willInsertElement'); - } - } - - processComponentInitializationAssertions(component, {}); - - return new ComponentStateBucket(environment, component, args, finalizer); - }; - - return TopComponentManager; - })(CurlyComponentManager); - - var ROOT_MANAGER = new TopComponentManager(); - - function tagName(vm) { - var tagName = vm.dynamicScope().view.tagName; - - return _glimmerRuntime.PrimitiveReference.create(tagName === '' ? null : tagName || 'div'); - } - - function ariaRole(vm) { - return vm.getSelf().get('ariaRole'); - } - - var CurlyComponentDefinition = (function (_ComponentDefinition) { -babelHelpers.inherits(CurlyComponentDefinition, _ComponentDefinition); - - function CurlyComponentDefinition(name, ComponentClass, template, args) { -babelHelpers.classCallCheck(this, CurlyComponentDefinition); - - _ComponentDefinition.call(this, name, MANAGER, ComponentClass); - this.template = template; - this.args = args; - } - - return CurlyComponentDefinition; - })(_glimmerRuntime.ComponentDefinition); - - exports.CurlyComponentDefinition = CurlyComponentDefinition; - - var RootComponentDefinition = (function (_ComponentDefinition2) { -babelHelpers.inherits(RootComponentDefinition, _ComponentDefinition2); - - function RootComponentDefinition(instance) { -babelHelpers.classCallCheck(this, RootComponentDefinition); - - _ComponentDefinition2.call(this, '-root', ROOT_MANAGER, instance); - this.template = undefined; - this.args = undefined; - } - - return RootComponentDefinition; - })(_glimmerRuntime.ComponentDefinition); - - exports.RootComponentDefinition = RootComponentDefinition; - - var CurlyComponentLayoutCompiler = (function () { - function CurlyComponentLayoutCompiler(template) { -babelHelpers.classCallCheck(this, CurlyComponentLayoutCompiler); - - this.template = template; - } - - CurlyComponentLayoutCompiler.prototype.compile = function compile(builder) { - builder.wrapLayout(this.template.asLayout()); - builder.tag.dynamic(tagName); - builder.attrs.dynamic('role', ariaRole); - builder.attrs.static('class', 'ember-view'); - }; - - return CurlyComponentLayoutCompiler; - })(); - - CurlyComponentLayoutCompiler.id = 'curly'; -}); -enifed('ember-glimmer/syntax/dynamic-component', ['exports', 'glimmer-runtime', 'glimmer-reference', 'ember-metal'], function (exports, _glimmerRuntime, _glimmerReference, _emberMetal) { - 'use strict'; - - function dynamicComponentFor(vm, symbolTable) { - var env = vm.env; - var args = vm.getArgs(); - var nameRef = args.positional.at(0); - - return new DynamicComponentReference({ nameRef: nameRef, env: env, symbolTable: symbolTable }); - } - - var DynamicComponentSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(DynamicComponentSyntax, _StatementSyntax); - - // for {{component componentName}} - - DynamicComponentSyntax.create = function create(environment, args, symbolTable) { - var definitionArgs = _glimmerRuntime.ArgsSyntax.fromPositionalArgs(args.positional.slice(0, 1)); - var invocationArgs = _glimmerRuntime.ArgsSyntax.build(args.positional.slice(1), args.named, args.blocks); - - return new this(definitionArgs, invocationArgs, symbolTable); - }; - - // Transforms {{foo.bar with=args}} or {{#foo.bar with=args}}{{/foo.bar}} - // into {{component foo.bar with=args}} or - // {{#component foo.bar with=args}}{{/component}} - // with all of it's arguments - - DynamicComponentSyntax.fromPath = function fromPath(environment, path, args, symbolTable) { - var positional = _glimmerRuntime.ArgsSyntax.fromPositionalArgs(_glimmerRuntime.PositionalArgsSyntax.build([_glimmerRuntime.GetSyntax.build(path.join('.'))])); - - return new this(positional, args, symbolTable); - }; - - function DynamicComponentSyntax(definitionArgs, args, symbolTable) { - babelHelpers.classCallCheck(this, DynamicComponentSyntax); - - _StatementSyntax.call(this); - this.definition = dynamicComponentFor; - this.definitionArgs = definitionArgs; - this.args = args; - this.symbolTable = symbolTable; - this.shadow = null; - } - - DynamicComponentSyntax.prototype.compile = function compile(builder) { - builder.component.dynamic(this.definitionArgs, this.definition, this.args, this.symbolTable, this.shadow); - }; - - return DynamicComponentSyntax; - })(_glimmerRuntime.StatementSyntax); - - exports.DynamicComponentSyntax = DynamicComponentSyntax; - - var DynamicComponentReference = (function () { - function DynamicComponentReference(_ref) { - var nameRef = _ref.nameRef; - var env = _ref.env; - var symbolTable = _ref.symbolTable; - var args = _ref.args; - babelHelpers.classCallCheck(this, DynamicComponentReference); - - this.tag = nameRef.tag; - this.nameRef = nameRef; - this.env = env; - this.symbolTable = symbolTable; - this.args = args; - } - - DynamicComponentReference.prototype.value = function value() { - var env = this.env; - var nameRef = this.nameRef; - var symbolTable = this.symbolTable; - - var nameOrDef = nameRef.value(); - - if (typeof nameOrDef === 'string') { - var definition = env.getComponentDefinition([nameOrDef], symbolTable); - - _emberMetal.assert('Could not find component named "' + nameOrDef + '" (no component or template with that name was found)', definition); - - return definition; - } else if (_glimmerRuntime.isComponentDefinition(nameOrDef)) { - return nameOrDef; - } else { - return null; - } - }; - - DynamicComponentReference.prototype.get = function get() { - return _glimmerReference.UNDEFINED_REFERENCE; - }; - - return DynamicComponentReference; - })(); -}); -enifed('ember-glimmer/syntax/input', ['exports', 'ember-metal', 'ember-glimmer/syntax/curly-component', 'ember-glimmer/syntax/dynamic-component', 'ember-glimmer/utils/bindings'], function (exports, _emberMetal, _emberGlimmerSyntaxCurlyComponent, _emberGlimmerSyntaxDynamicComponent, _emberGlimmerUtilsBindings) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; - - function buildTextFieldSyntax(args, getDefinition, symbolTable) { - var definition = getDefinition('-text-field'); - _emberGlimmerUtilsBindings.wrapComponentClassAttribute(args); - return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentSyntax(args, definition, symbolTable); - } + exports.default = makeBoundHelper; /** - The `{{input}}` helper lets you create an HTML `` component. - It causes an `Ember.TextField` component to be rendered. For more info, - see the [Ember.TextField](/api/classes/Ember.TextField.html) docs and - the [templates guide](http://emberjs.com/guides/templates/input-helpers/). - - ```handlebars - {{input value="987"}} - ``` - - renders as: - - ```HTML - - ``` - - ### Text field - - If no `type` option is specified, a default of type 'text' is used. - Many of the standard HTML attributes may be passed to this helper. - - - - - - - - - - - -
    `readonly``required``autofocus`
    `value``placeholder``disabled`
    `size``tabindex``maxlength`
    `name``min``max`
    `pattern``accept``autocomplete`
    `autosave``formaction``formenctype`
    `formmethod``formnovalidate``formtarget`
    `height``inputmode``multiple`
    `step``width``form`
    `selectionDirection``spellcheck` 
    - When set to a quoted string, these values will be directly applied to the HTML - element. When left unquoted, these values will be bound to a property on the - template's current rendering context (most typically a controller instance). - A very common use of this helper is to bind the `value` of an input to an Object's attribute: - - ```handlebars - Search: - {{input value=searchWord}} - ``` - - In this example, the inital value in the `` will be set to the value of `searchWord`. - If the user changes the text, the value of `searchWord` will also be updated. - - ### Actions - - The helper can send multiple actions based on user events. - The action property defines the action which is sent when - the user presses the return key. - - ```handlebars - {{input action="submit"}} - ``` - - The helper allows some user events to send actions. - - * `enter` - * `insert-newline` - * `escape-press` - * `focus-in` - * `focus-out` - * `key-press` - * `key-up` - - For example, if you desire an action to be sent when the input is blurred, - you only need to setup the action name to the event name property. - - ```handlebars - {{input focus-out="alertMessage"}} - ``` - See more about [Text Support Actions](/api/classes/Ember.TextField.html) + 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 + value and any changes to the bound property cause the helper function to be re-run with the updated + values. - ### Extending `Ember.TextField` + * `params` - An array of resolved ordered parameters. + * `hash` - An object containing the hash parameters. - Internally, `{{input type="text"}}` creates an instance of `Ember.TextField`, passing - arguments from the helper to `Ember.TextField`'s `create` method. You can extend the - capabilities of text inputs in your applications by reopening this class. For example, - if you are building a Bootstrap project where `data-*` attributes are used, you - can add one to the `TextField`'s `attributeBindings` property: + For example: - ```javascript - Ember.TextField.reopen({ - attributeBindings: ['data-error'] - }); - ``` + * With an unquoted ordered parameter: - Keep in mind when writing `Ember.TextField` subclasses that `Ember.TextField` - itself extends `Ember.Component`. Expect isolated component semantics, not - legacy 1.x view semantics (like `controller` being present). - See more about [Ember components](/api/classes/Ember.Component.html) + ```javascript + {{x-capitalize foo}} + ``` - ### Checkbox + Assuming `foo` was set to `"bar"`, the bound helper would receive `["bar"]` as its first argument, and + an empty hash as its second. - Checkboxes are special forms of the `{{input}}` helper. To create a ``: + * With a quoted ordered parameter: - ```handlebars - Emberize Everything: - {{input type="checkbox" name="isEmberized" checked=isEmberized}} - ``` + ```javascript + {{x-capitalize "foo"}} + ``` - This will bind checked state of this checkbox to the value of `isEmberized` -- if either one changes, - it will be reflected in the other. + The bound helper would receive `["foo"]` as its first argument, and an empty hash as its second. - The following HTML attributes can be set via the helper: + * With an unquoted hash parameter: - * `checked` - * `disabled` - * `tabindex` - * `indeterminate` - * `name` - * `autofocus` - * `form` + ```javascript + {{x-repeat "foo" count=repeatCount}} + ``` - ### Extending `Ember.Checkbox` + Assuming that `repeatCount` resolved to 2, the bound helper would receive `["foo"]` as its first argument, + and { count: 2 } as its second. - Internally, `{{input type="checkbox"}}` creates an instance of `Ember.Checkbox`, passing - arguments from the helper to `Ember.Checkbox`'s `create` method. You can extend the - capablilties of checkbox inputs in your applications by reopening this class. For example, - if you wanted to add a css class to all checkboxes in your application: - - ```javascript - Ember.Checkbox.reopen({ - classNames: ['my-app-checkbox'] - }); - ``` - - @method input - @for Ember.Templates.helpers - @param {Hash} options - @public - */ - var InputSyntax = { - create: function (environment, args, symbolTable) { - var getDefinition = function (path) { - return environment.getComponentDefinition([path], symbolTable); - }; - - if (args.named.has('type')) { - var typeArg = args.named.at('type'); - if (typeArg.type === 'value') { - if (typeArg.value === 'checkbox') { - _emberMetal.assert('{{input type=\'checkbox\'}} does not support setting `value=someBooleanValue`; ' + 'you must use `checked=someBooleanValue` instead.', !args.named.has('value')); - - _emberGlimmerUtilsBindings.wrapComponentClassAttribute(args); - var definition = getDefinition('-checkbox'); - return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentSyntax(args, definition, symbolTable); - } else { - return buildTextFieldSyntax(args, getDefinition, symbolTable); - } - } - } else { - return buildTextFieldSyntax(args, getDefinition, symbolTable); - } - - return _emberGlimmerSyntaxDynamicComponent.DynamicComponentSyntax.create(environment, args, symbolTable); - } - }; - exports.InputSyntax = InputSyntax; -}); -enifed('ember-glimmer/syntax/mount', ['exports', 'glimmer-runtime', 'glimmer-reference', 'ember-metal', 'ember-glimmer/utils/references', 'ember-routing', 'ember-glimmer/syntax/outlet'], function (exports, _glimmerRuntime, _glimmerReference, _emberMetal, _emberGlimmerUtilsReferences, _emberRouting, _emberGlimmerSyntaxOutlet) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; - - /** - The `{{mount}}` helper lets you embed a routeless engine in a template. - Mounting an engine will cause an instance to be booted and its `application` - template to be rendered. - - For example, the following template mounts the `ember-chat` engine: - - ```handlebars - {{! application.hbs }} - {{mount "ember-chat"}} - ``` - - Currently, the engine name is the only argument that can be passed to - `{{mount}}`. - - @method mount - @for Ember.Templates.helpers - @category ember-application-engines - @public - */ - - var MountSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(MountSyntax, _StatementSyntax); - - MountSyntax.create = function create(env, args, symbolTable) { - _emberMetal.assert('You can only pass a single argument to the {{mount}} helper, e.g. {{mount "chat-engine"}}.', args.positional.length === 1 && args.named.length === 0); - - _emberMetal.assert('The first argument of {{mount}} must be quoted, e.g. {{mount "chat-engine"}}.', args.positional.at(0).type === 'value' && typeof args.positional.at(0).inner() === 'string'); - - var name = args.positional.at(0).inner(); - - _emberMetal.assert('You used `{{mount \'' + name + '\'}}`, but the engine \'' + name + '\' can not be found.', env.owner.hasRegistration('engine:' + name)); - - var definition = new MountDefinition(name, env); - - return new MountSyntax(definition, symbolTable); - }; - - function MountSyntax(definition, symbolTable) { - babelHelpers.classCallCheck(this, MountSyntax); - - _StatementSyntax.call(this); - this.definition = definition; - this.symbolTable = symbolTable; - } - - MountSyntax.prototype.compile = function compile(builder) { - builder.component.static(this.definition, _glimmerRuntime.ArgsSyntax.empty(), null, this.symbolTable, null); - }; - - return MountSyntax; - })(_glimmerRuntime.StatementSyntax); - - exports.MountSyntax = MountSyntax; - - var MountManager = (function () { - function MountManager() { - babelHelpers.classCallCheck(this, MountManager); - } - - MountManager.prototype.prepareArgs = function prepareArgs(definition, args) { - return args; - }; - - MountManager.prototype.create = function create(environment, _ref, args, dynamicScope) { - var name = _ref.name; - var env = _ref.env; - - dynamicScope.outletState = _glimmerReference.UNDEFINED_REFERENCE; - - var engine = env.owner.buildChildEngineInstance(name); - - engine.boot(); - - return { engine: engine }; - }; - - MountManager.prototype.layoutFor = function layoutFor(definition, _ref2, env) { - var engine = _ref2.engine; - - var template = engine.lookup('template:application'); - return env.getCompiledBlock(_emberGlimmerSyntaxOutlet.OutletLayoutCompiler, template); - }; - - MountManager.prototype.getSelf = function getSelf(_ref3) { - var engine = _ref3.engine; - - var factory = engine._lookupFactory('controller:application') || _emberRouting.generateControllerFactory(engine, 'application'); - return new _emberGlimmerUtilsReferences.RootReference(factory.create()); - }; - - MountManager.prototype.getTag = function getTag() { - return null; - }; - - MountManager.prototype.getDestructor = function getDestructor(_ref4) { - var engine = _ref4.engine; - - return engine; - }; - - MountManager.prototype.didCreateElement = function didCreateElement() {}; - - MountManager.prototype.didRenderLayout = function didRenderLayout() {}; - - MountManager.prototype.didCreate = function didCreate(state) {}; - - MountManager.prototype.update = function update(state, args, dynamicScope) {}; - - MountManager.prototype.didUpdateLayout = function didUpdateLayout() {}; - - MountManager.prototype.didUpdate = function didUpdate(state) {}; - - return MountManager; - })(); - - var MOUNT_MANAGER = new MountManager(); - - var MountDefinition = (function (_ComponentDefinition) { - babelHelpers.inherits(MountDefinition, _ComponentDefinition); - - function MountDefinition(name, env) { - babelHelpers.classCallCheck(this, MountDefinition); - - _ComponentDefinition.call(this, name, MOUNT_MANAGER, null); - this.env = env; - } - - return MountDefinition; - })(_glimmerRuntime.ComponentDefinition); -}); -enifed('ember-glimmer/syntax/outlet', ['exports', 'ember-utils', 'glimmer-runtime', 'ember-metal', 'ember-glimmer/utils/references', 'glimmer-reference'], function (exports, _emberUtils, _glimmerRuntime, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; - - function outletComponentFor(vm) { - var _vm$dynamicScope = vm.dynamicScope(); - - var outletState = _vm$dynamicScope.outletState; - - var args = vm.getArgs(); - var outletNameRef = undefined; - if (args.positional.length === 0) { - outletNameRef = new _glimmerReference.ConstReference('main'); - } else { - outletNameRef = args.positional.at(0); - } - - return new OutletComponentReference(outletNameRef, outletState); - } - - /** - The `{{outlet}}` helper lets you specify where a child route will render in - your template. An important use of the `{{outlet}}` helper is in your - application's `application.hbs` file: - - ```handlebars - {{! app/templates/application.hbs }} - - {{my-header}} -
    - - {{outlet}} -
    - - {{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' }); - } - }); - ``` - - 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. - - @method outlet - @param {String} [name] - @for Ember.Templates.helpers - @public - */ - - var OutletSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(OutletSyntax, _StatementSyntax); - - OutletSyntax.create = function create(environment, args, symbolTable) { - var definitionArgs = _glimmerRuntime.ArgsSyntax.fromPositionalArgs(args.positional.slice(0, 1)); - return new this(environment, definitionArgs, symbolTable); - }; - - function OutletSyntax(environment, args, symbolTable) { - babelHelpers.classCallCheck(this, OutletSyntax); - - _StatementSyntax.call(this); - this.definitionArgs = args; - this.definition = outletComponentFor; - this.args = _glimmerRuntime.ArgsSyntax.empty(); - this.symbolTable = symbolTable; - this.shadow = null; - } - - OutletSyntax.prototype.compile = function compile(builder) { - builder.component.dynamic(this.definitionArgs, this.definition, this.args, this.symbolTable, this.shadow); - }; - - return OutletSyntax; - })(_glimmerRuntime.StatementSyntax); - - exports.OutletSyntax = OutletSyntax; - - var OutletComponentReference = (function () { - function OutletComponentReference(outletNameRef, parentOutletStateRef) { - babelHelpers.classCallCheck(this, OutletComponentReference); - - this.outletNameRef = outletNameRef; - this.parentOutletStateRef = parentOutletStateRef; - this.definition = null; - this.lastState = null; - var outletStateTag = this.outletStateTag = new _glimmerReference.UpdatableTag(parentOutletStateRef.tag); - this.tag = _glimmerReference.combine([outletStateTag.tag, outletNameRef.tag]); - } - - OutletComponentReference.prototype.value = function value() { - var outletNameRef = this.outletNameRef; - var parentOutletStateRef = this.parentOutletStateRef; - var definition = this.definition; - var lastState = this.lastState; - - var outletName = outletNameRef.value(); - var outletStateRef = parentOutletStateRef.get('outlets').get(outletName); - var newState = this.lastState = outletStateRef.value(); - - this.outletStateTag.update(outletStateRef.tag); - - definition = revalidate(definition, lastState, newState); - - var hasTemplate = newState && newState.render.template; - - if (definition) { - return definition; - } else if (hasTemplate) { - return this.definition = new OutletComponentDefinition(outletName, newState.render.template); - } else { - return this.definition = null; - } - }; - - return OutletComponentReference; - })(); - - function revalidate(definition, lastState, newState) { - if (!lastState && !newState) { - return definition; - } - - if (!lastState && newState || lastState && !newState) { - return null; - } - - if (newState.render.template === lastState.render.template && newState.render.controller === lastState.render.controller) { - return definition; - } - - return null; - } - - function instrumentationPayload(_ref) { - var _ref$render = _ref.render; - var name = _ref$render.name; - var outlet = _ref$render.outlet; - - return { object: name + ':' + outlet }; - } - - function NOOP() {} - - var StateBucket = (function () { - function StateBucket(outletState) { - babelHelpers.classCallCheck(this, StateBucket); - - this.outletState = outletState; - this.instrument(); - } - - StateBucket.prototype.instrument = function instrument() { - this.finalizer = _emberMetal._instrumentStart('render.outlet', instrumentationPayload, this.outletState); - }; - - StateBucket.prototype.finalize = function finalize() { - var finalizer = this.finalizer; - - finalizer(); - this.finalizer = NOOP; - }; - - return StateBucket; - })(); - - var OutletComponentManager = (function () { - function OutletComponentManager() { - babelHelpers.classCallCheck(this, OutletComponentManager); - } - - OutletComponentManager.prototype.prepareArgs = function prepareArgs(definition, args) { - return args; - }; - - OutletComponentManager.prototype.create = function create(environment, definition, args, dynamicScope) { - var outletStateReference = dynamicScope.outletState = dynamicScope.outletState.get('outlets').get(definition.outletName); - var outletState = outletStateReference.value(); - return new StateBucket(outletState); - }; - - OutletComponentManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { - return env.getCompiledBlock(OutletLayoutCompiler, definition.template); - }; - - OutletComponentManager.prototype.getSelf = function getSelf(_ref2) { - var outletState = _ref2.outletState; - - return new _emberGlimmerUtilsReferences.RootReference(outletState.render.controller); - }; - - OutletComponentManager.prototype.getTag = function getTag() { - return null; - }; - - OutletComponentManager.prototype.getDestructor = function getDestructor() { - return null; - }; - - OutletComponentManager.prototype.didRenderLayout = function didRenderLayout(bucket) { - bucket.finalize(); - }; - - OutletComponentManager.prototype.didCreateElement = function didCreateElement() {}; - - OutletComponentManager.prototype.didCreate = function didCreate(state) {}; - - OutletComponentManager.prototype.update = function update(bucket) {}; - - OutletComponentManager.prototype.didUpdateLayout = function didUpdateLayout(bucket) {}; - - OutletComponentManager.prototype.didUpdate = function didUpdate(state) {}; - - return OutletComponentManager; - })(); - - var MANAGER = new OutletComponentManager(); - - var TopLevelOutletComponentManager = (function (_OutletComponentManager) { - babelHelpers.inherits(TopLevelOutletComponentManager, _OutletComponentManager); - - function TopLevelOutletComponentManager() { - babelHelpers.classCallCheck(this, TopLevelOutletComponentManager); - - _OutletComponentManager.apply(this, arguments); - } - - TopLevelOutletComponentManager.prototype.create = function create(environment, definition, args, dynamicScope) { - return new StateBucket(dynamicScope.outletState.value()); - }; - - TopLevelOutletComponentManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { - return env.getCompiledBlock(TopLevelOutletLayoutCompiler, definition.template); - }; - - return TopLevelOutletComponentManager; - })(OutletComponentManager); - - var TOP_LEVEL_MANAGER = new TopLevelOutletComponentManager(); - - var TopLevelOutletComponentDefinition = (function (_ComponentDefinition) { - babelHelpers.inherits(TopLevelOutletComponentDefinition, _ComponentDefinition); - - function TopLevelOutletComponentDefinition(instance) { - babelHelpers.classCallCheck(this, TopLevelOutletComponentDefinition); - - _ComponentDefinition.call(this, 'outlet', TOP_LEVEL_MANAGER, instance); - this.template = instance.template; - _emberUtils.generateGuid(this); - } - - return TopLevelOutletComponentDefinition; - })(_glimmerRuntime.ComponentDefinition); - - exports.TopLevelOutletComponentDefinition = TopLevelOutletComponentDefinition; - - var TopLevelOutletLayoutCompiler = (function () { - function TopLevelOutletLayoutCompiler(template) { - babelHelpers.classCallCheck(this, TopLevelOutletLayoutCompiler); - - this.template = template; - } - - TopLevelOutletLayoutCompiler.prototype.compile = function compile(builder) { - builder.wrapLayout(this.template.asLayout()); - builder.tag.static('div'); - builder.attrs.static('id', _emberUtils.guidFor(this)); - builder.attrs.static('class', 'ember-view'); - }; - - return TopLevelOutletLayoutCompiler; - })(); - - TopLevelOutletLayoutCompiler.id = 'top-level-outlet'; - - var OutletComponentDefinition = (function (_ComponentDefinition2) { - babelHelpers.inherits(OutletComponentDefinition, _ComponentDefinition2); - - function OutletComponentDefinition(outletName, template) { - babelHelpers.classCallCheck(this, OutletComponentDefinition); - - _ComponentDefinition2.call(this, 'outlet', MANAGER, null); - this.outletName = outletName; - this.template = template; - _emberUtils.generateGuid(this); - } - - return OutletComponentDefinition; - })(_glimmerRuntime.ComponentDefinition); - - var OutletLayoutCompiler = (function () { - function OutletLayoutCompiler(template) { - babelHelpers.classCallCheck(this, OutletLayoutCompiler); - - this.template = template; - } - - OutletLayoutCompiler.prototype.compile = function compile(builder) { - builder.wrapLayout(this.template.asLayout()); - }; - - return OutletLayoutCompiler; - })(); - - exports.OutletLayoutCompiler = OutletLayoutCompiler; - - OutletLayoutCompiler.id = 'outlet'; -}); -enifed('ember-glimmer/syntax/render', ['exports', 'glimmer-runtime', 'glimmer-reference', 'ember-metal', 'ember-glimmer/utils/references', 'ember-routing', 'ember-glimmer/syntax/outlet'], function (exports, _glimmerRuntime, _glimmerReference, _emberMetal, _emberGlimmerUtilsReferences, _emberRouting, _emberGlimmerSyntaxOutlet) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; - - function makeComponentDefinition(vm) { - var env = vm.env; - var args = vm.getArgs(); - var nameRef = args.positional.at(0); - - _emberMetal.assert('The first argument of {{render}} must be quoted, e.g. {{render "sidebar"}}.', _glimmerReference.isConst(nameRef)); - _emberMetal.assert('The second argument of {{render}} must be a path, e.g. {{render "post" post}}.', args.positional.length === 1 || !_glimmerReference.isConst(args.positional.at(1))); - - var templateName = nameRef.value(); - - _emberMetal.assert('You used `{{render \'' + templateName + '\'}}`, but \'' + templateName + '\' can not be found as a template.', env.owner.hasRegistration('template:' + templateName)); - - var template = env.owner.lookup('template:' + templateName); - - var controllerName = undefined; - - if (args.named.has('controller')) { - var controllerNameRef = args.named.get('controller'); - - _emberMetal.assert('The controller argument for {{render}} must be quoted, e.g. {{render "sidebar" controller="foo"}}.', _glimmerReference.isConst(controllerNameRef)); - - controllerName = controllerNameRef.value(); - - _emberMetal.assert('The controller name you supplied \'' + controllerName + '\' did not resolve to a controller.', env.owner.hasRegistration('controller:' + controllerName)); - } else { - controllerName = templateName; - } - - if (args.positional.length === 1) { - return new _glimmerReference.ConstReference(new RenderDefinition(controllerName, template, env, SINGLETON_RENDER_MANAGER)); - } else { - return new _glimmerReference.ConstReference(new RenderDefinition(controllerName, template, env, NON_SINGLETON_RENDER_MANAGER)); - } - } - - /** - Calling ``{{render}}`` from within a template will insert another - template that matches the provided name. The inserted template will - access its properties on its own controller (rather than the controller - of the parent template). - - If a view class with the same name exists, the view class also will be used. - Note: A given controller may only be used *once* in your app in this manner. - A singleton instance of the controller will be created for you. - - Example: - - ```javascript - App.NavigationController = Ember.Controller.extend({ - who: "world" - }); - ``` - - ```handlebars - - Hello, {{who}}. - ``` - - ```handlebars - -

    My great app

    - {{render "navigation"}} - ``` - - ```html -

    My great app

    -
    - Hello, world. -
    - ``` - - Optionally you may provide a second argument: a property path - that will be bound to the `model` property of the controller. - If a `model` property path is specified, then a new instance of the - controller will be created and `{{render}}` can be used multiple times - with the same name. - - For example if you had this `author` template. - - ```handlebars -
    - Written by {{firstName}} {{lastName}}. - Total Posts: {{postCount}} -
    - ``` - - You could render it inside the `post` template using the `render` helper. - - ```handlebars -
    -

    {{title}}

    -
    {{body}}
    - {{render "author" author}} -
    - ``` - - @method render - @for Ember.Templates.helpers - @param {String} name - @param {Object?} context - @param {Hash} options - @return {String} HTML string - @public - */ - - var RenderSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(RenderSyntax, _StatementSyntax); - - RenderSyntax.create = function create(environment, args, symbolTable) { - return new this(environment, args, symbolTable); - }; - - function RenderSyntax(environment, args, symbolTable) { - babelHelpers.classCallCheck(this, RenderSyntax); - - _StatementSyntax.call(this); - this.definitionArgs = args; - this.definition = makeComponentDefinition; - this.args = _glimmerRuntime.ArgsSyntax.fromPositionalArgs(args.positional.slice(1, 2)); - this.symbolTable = symbolTable; - this.shadow = null; - } - - RenderSyntax.prototype.compile = function compile(builder) { - builder.component.dynamic(this.definitionArgs, this.definition, this.args, this.symbolTable, this.shadow); - }; - - return RenderSyntax; - })(_glimmerRuntime.StatementSyntax); - - exports.RenderSyntax = RenderSyntax; - - var AbstractRenderManager = (function () { - function AbstractRenderManager() { - babelHelpers.classCallCheck(this, AbstractRenderManager); - } - - AbstractRenderManager.prototype.prepareArgs = function prepareArgs(definition, args) { - return args; - }; - - /* abstract create(environment, definition, args, dynamicScope); */ - - AbstractRenderManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { - return env.getCompiledBlock(_emberGlimmerSyntaxOutlet.OutletLayoutCompiler, definition.template); - }; - - AbstractRenderManager.prototype.getSelf = function getSelf(_ref) { - var controller = _ref.controller; - - return new _emberGlimmerUtilsReferences.RootReference(controller); - }; - - AbstractRenderManager.prototype.getTag = function getTag() { - return null; - }; - - AbstractRenderManager.prototype.getDestructor = function getDestructor() { - return null; - }; - - AbstractRenderManager.prototype.didCreateElement = function didCreateElement() {}; - - AbstractRenderManager.prototype.didRenderLayout = function didRenderLayout() {}; - - AbstractRenderManager.prototype.didCreate = function didCreate() {}; - - AbstractRenderManager.prototype.update = function update() {}; - - AbstractRenderManager.prototype.didUpdateLayout = function didUpdateLayout() {}; - - AbstractRenderManager.prototype.didUpdate = function didUpdate() {}; - - return AbstractRenderManager; - })(); - - var SingletonRenderManager = (function (_AbstractRenderManager) { - babelHelpers.inherits(SingletonRenderManager, _AbstractRenderManager); - - function SingletonRenderManager() { - babelHelpers.classCallCheck(this, SingletonRenderManager); - - _AbstractRenderManager.apply(this, arguments); - } - - SingletonRenderManager.prototype.create = function create(environment, definition, args, dynamicScope) { - var name = definition.name; - var env = definition.env; - - var controller = env.owner.lookup('controller:' + name) || _emberRouting.generateController(env.owner, name); - - if (dynamicScope.rootOutletState) { - dynamicScope.outletState = dynamicScope.rootOutletState.getOrphan(name); - } - - return { controller: controller }; - }; - - return SingletonRenderManager; - })(AbstractRenderManager); - - var SINGLETON_RENDER_MANAGER = new SingletonRenderManager(); - - var NonSingletonRenderManager = (function (_AbstractRenderManager2) { - babelHelpers.inherits(NonSingletonRenderManager, _AbstractRenderManager2); - - function NonSingletonRenderManager() { - babelHelpers.classCallCheck(this, NonSingletonRenderManager); - - _AbstractRenderManager2.apply(this, arguments); - } - - NonSingletonRenderManager.prototype.create = function create(environment, definition, args, dynamicScope) { - var name = definition.name; - var env = definition.env; - - var modelRef = args.positional.at(0); - - var factory = env.owner._lookupFactory('controller:' + name) || _emberRouting.generateControllerFactory(env.owner, name); - var controller = factory.create({ model: modelRef.value() }); - - if (dynamicScope.rootOutletState) { - dynamicScope.outletState = dynamicScope.rootOutletState.getOrphan(name); - } - - return { controller: controller }; - }; - - NonSingletonRenderManager.prototype.update = function update(_ref2, args, dynamicScope) { - var controller = _ref2.controller; - - controller.set('model', args.positional.at(0).value()); - }; - - NonSingletonRenderManager.prototype.getDestructor = function getDestructor(_ref3) { - var controller = _ref3.controller; - - return controller; - }; - - return NonSingletonRenderManager; - })(AbstractRenderManager); - - var NON_SINGLETON_RENDER_MANAGER = new NonSingletonRenderManager(); - - var RenderDefinition = (function (_ComponentDefinition) { - babelHelpers.inherits(RenderDefinition, _ComponentDefinition); - - function RenderDefinition(name, template, env, manager) { - babelHelpers.classCallCheck(this, RenderDefinition); - - _ComponentDefinition.call(this, 'render', manager, null); - - this.name = name; - this.template = template; - this.env = env; - } - - return RenderDefinition; - })(_glimmerRuntime.ComponentDefinition); -}); -enifed('ember-glimmer/template', ['exports', 'ember-utils', 'glimmer-runtime'], function (exports, _emberUtils, _glimmerRuntime) { - 'use strict'; - - exports.default = template; - - function template(json) { - var factory = _glimmerRuntime.templateFactory(json); - - return { - id: factory.id, - meta: factory.meta, - create: function (props) { - return factory.create(props.env, { owner: props[_emberUtils.OWNER] }); - } - }; - } -}); -enifed("ember-glimmer/template_registry", ["exports"], function (exports) { - // STATE within a module is frowned apon, this exists - // to support Ember.TEMPLATES but shield ember internals from this legacy - // global API. - "use strict"; - - exports.setTemplates = setTemplates; - exports.getTemplates = getTemplates; - exports.getTemplate = getTemplate; - exports.hasTemplate = hasTemplate; - exports.setTemplate = setTemplate; - var TEMPLATES = {}; - - function setTemplates(templates) { - TEMPLATES = templates; - } - - function getTemplates() { - return TEMPLATES; - } - - function getTemplate(name) { - if (TEMPLATES.hasOwnProperty(name)) { - return TEMPLATES[name]; - } - } - - function hasTemplate(name) { - return TEMPLATES.hasOwnProperty(name); - } - - function setTemplate(name, template) { - return TEMPLATES[name] = template; - } -}); -enifed("ember-glimmer/templates/component", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { - "use strict"; - - exports.default = _emberGlimmerTemplate.default({ "id": "ZoGfVsSJ", "block": "{\"statements\":[[\"yield\",\"default\"]],\"locals\":[],\"named\":[],\"yields\":[\"default\"],\"blocks\":[],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/component.hbs" } }); -}); -enifed("ember-glimmer/templates/empty", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { - "use strict"; - - exports.default = _emberGlimmerTemplate.default({ "id": "qEHL4OLi", "block": "{\"statements\":[],\"locals\":[],\"named\":[],\"yields\":[],\"blocks\":[],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/empty.hbs" } }); -}); -enifed("ember-glimmer/templates/link-to", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { - "use strict"; - - exports.default = _emberGlimmerTemplate.default({ "id": "Ca7iQMR7", "block": "{\"statements\":[[\"block\",[\"if\"],[[\"get\",[\"linkTitle\"]]],null,1,0]],\"locals\":[],\"named\":[],\"yields\":[\"default\"],\"blocks\":[{\"statements\":[[\"yield\",\"default\"]],\"locals\":[]},{\"statements\":[[\"append\",[\"unknown\",[\"linkTitle\"]],false]],\"locals\":[]}],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/link-to.hbs" } }); -}); -enifed("ember-glimmer/templates/outlet", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { - "use strict"; - - exports.default = _emberGlimmerTemplate.default({ "id": "sYQo9vi/", "block": "{\"statements\":[[\"append\",[\"unknown\",[\"outlet\"]],false]],\"locals\":[],\"named\":[],\"yields\":[],\"blocks\":[],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/outlet.hbs" } }); -}); -enifed("ember-glimmer/templates/root", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { - "use strict"; - - exports.default = _emberGlimmerTemplate.default({ "id": "Eaf3RPY3", "block": "{\"statements\":[[\"append\",[\"helper\",[\"component\"],[[\"get\",[null]]],null],false]],\"locals\":[],\"named\":[],\"yields\":[],\"blocks\":[],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/root.hbs" } }); -}); -enifed('ember-glimmer/utils/bindings', ['exports', 'glimmer-reference', 'glimmer-runtime', 'ember-metal', 'ember-runtime', 'ember-glimmer/component', 'ember-glimmer/utils/string'], function (exports, _glimmerReference, _glimmerRuntime, _emberMetal, _emberRuntime, _emberGlimmerComponent, _emberGlimmerUtilsString) { - 'use strict'; - - exports.wrapComponentClassAttribute = wrapComponentClassAttribute; - - function referenceForKey(component, key) { - return component[_emberGlimmerComponent.ROOT_REF].get(key); - } - - function referenceForParts(component, parts) { - var isAttrs = parts[0] === 'attrs'; - - // TODO deprecate this - if (isAttrs) { - parts.shift(); - - if (parts.length === 1) { - return referenceForKey(component, parts[0]); - } - } - - return _glimmerReference.referenceFromParts(component[_emberGlimmerComponent.ROOT_REF], parts); - } - - // TODO we should probably do this transform at build time - - function wrapComponentClassAttribute(args) { - var named = args.named; - - var index = named.keys.indexOf('class'); - - if (index !== -1) { - var _named$values$index = named.values[index]; - var ref = _named$values$index.ref; - var type = _named$values$index.type; - - if (type === 'get') { - var propName = ref.parts[ref.parts.length - 1]; - named.values[index] = _glimmerRuntime.HelperSyntax.fromSpec(['helper', ['-class'], [['get', ref.parts], propName], null]); - } - } - - return args; - } - - var AttributeBinding = { - parse: function (microsyntax) { - var colonIndex = microsyntax.indexOf(':'); - - if (colonIndex === -1) { - _emberMetal.assert('You cannot use class as an attributeBinding, use classNameBindings instead.', microsyntax !== 'class'); - return [microsyntax, microsyntax, true]; - } else { - var prop = microsyntax.substring(0, colonIndex); - var attribute = microsyntax.substring(colonIndex + 1); - - _emberMetal.assert('You cannot use class as an attributeBinding, use classNameBindings instead.', attribute !== 'class'); - - return [prop, attribute, false]; - } - }, - - install: function (element, component, parsed, operations) { - var prop = parsed[0]; - var attribute = parsed[1]; - var isSimple = parsed[2]; - - if (attribute === 'id') { - var elementId = _emberMetal.get(component, prop); - if (elementId === undefined || elementId === null) { - elementId = component.elementId; - } - operations.addStaticAttribute(element, 'id', elementId); - return; - } - - var isPath = prop.indexOf('.') > -1; - var reference = isPath ? referenceForParts(component, prop.split('.')) : referenceForKey(component, prop); - - _emberMetal.assert('Illegal attributeBinding: \'' + prop + '\' is not a valid attribute name.', !(isSimple && isPath)); - - if (attribute === 'style') { - reference = new StyleBindingReference(reference, referenceForKey(component, 'isVisible')); - } - - operations.addDynamicAttribute(element, attribute, reference); - } - }; - - exports.AttributeBinding = AttributeBinding; - var DISPLAY_NONE = 'display: none;'; - var SAFE_DISPLAY_NONE = _emberGlimmerUtilsString.htmlSafe(DISPLAY_NONE); - - var StyleBindingReference = (function (_CachedReference) { - babelHelpers.inherits(StyleBindingReference, _CachedReference); - - function StyleBindingReference(inner, isVisible) { - babelHelpers.classCallCheck(this, StyleBindingReference); - - _CachedReference.call(this); - - this.tag = _glimmerReference.combine([inner.tag, isVisible.tag]); - this.inner = inner; - this.isVisible = isVisible; - } - - StyleBindingReference.prototype.compute = function compute() { - var value = this.inner.value(); - var isVisible = this.isVisible.value(); - - if (isVisible !== false) { - return value; - } else if (!value && value !== 0) { - return SAFE_DISPLAY_NONE; - } else { - var style = value + ' ' + DISPLAY_NONE; - return _emberGlimmerUtilsString.isHTMLSafe(value) ? _emberGlimmerUtilsString.htmlSafe(style) : style; - } - }; - - return StyleBindingReference; - })(_glimmerReference.CachedReference); - - var IsVisibleBinding = { - install: function (element, component, operations) { - operations.addDynamicAttribute(element, 'style', _glimmerReference.map(referenceForKey(component, 'isVisible'), this.mapStyleValue)); - }, - - mapStyleValue: function (isVisible) { - return isVisible === false ? SAFE_DISPLAY_NONE : null; - } - }; - - exports.IsVisibleBinding = IsVisibleBinding; - var ClassNameBinding = { - install: function (element, component, microsyntax, operations) { - var _microsyntax$split = microsyntax.split(':'); - - var prop = _microsyntax$split[0]; - var truthy = _microsyntax$split[1]; - var falsy = _microsyntax$split[2]; - - var isStatic = prop === ''; - - if (isStatic) { - operations.addStaticAttribute(element, 'class', truthy); - } else { - var isPath = prop.indexOf('.') > -1; - var parts = isPath && prop.split('.'); - var value = isPath ? referenceForParts(component, parts) : referenceForKey(component, prop); - var ref = undefined; - - if (truthy === undefined) { - ref = new SimpleClassNameBindingReference(value, isPath ? parts[parts.length - 1] : prop); - } else { - ref = new ColonClassNameBindingReference(value, truthy, falsy); - } - - operations.addDynamicAttribute(element, 'class', ref); - } - } - }; - - exports.ClassNameBinding = ClassNameBinding; - - var SimpleClassNameBindingReference = (function (_CachedReference2) { - babelHelpers.inherits(SimpleClassNameBindingReference, _CachedReference2); - - function SimpleClassNameBindingReference(inner, path) { - babelHelpers.classCallCheck(this, SimpleClassNameBindingReference); - - _CachedReference2.call(this); - - this.tag = inner.tag; - this.inner = inner; - this.path = path; - this.dasherizedPath = null; - } - - SimpleClassNameBindingReference.prototype.compute = function compute() { - var value = this.inner.value(); - - if (value === true) { - var path = this.path; - var dasherizedPath = this.dasherizedPath; - - return dasherizedPath || (this.dasherizedPath = _emberRuntime.String.dasherize(path)); - } else if (value || value === 0) { - return value; - } else { - return null; - } - }; - - return SimpleClassNameBindingReference; - })(_glimmerReference.CachedReference); - - var ColonClassNameBindingReference = (function (_CachedReference3) { - babelHelpers.inherits(ColonClassNameBindingReference, _CachedReference3); - - function ColonClassNameBindingReference(inner, truthy, falsy) { - babelHelpers.classCallCheck(this, ColonClassNameBindingReference); - - _CachedReference3.call(this); - - this.tag = inner.tag; - this.inner = inner; - this.truthy = truthy || null; - this.falsy = falsy || null; - } - - ColonClassNameBindingReference.prototype.compute = function compute() { - var inner = this.inner; - var truthy = this.truthy; - var falsy = this.falsy; - - return inner.value() ? truthy : falsy; - }; - - return ColonClassNameBindingReference; - })(_glimmerReference.CachedReference); -}); -enifed('ember-glimmer/utils/iterable', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/each-in', 'glimmer-reference'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberGlimmerUtilsReferences, _emberGlimmerHelpersEachIn, _glimmerReference) { - 'use strict'; - - exports.default = iterableFor; - - var ITERATOR_KEY_GUID = 'be277757-bbbe-4620-9fcb-213ef433cca2'; - - function iterableFor(ref, keyPath) { - if (_emberGlimmerHelpersEachIn.isEachIn(ref)) { - return new EachInIterable(ref, keyForEachIn(keyPath)); - } else { - return new ArrayIterable(ref, keyForArray(keyPath)); - } - } - - function keyForEachIn(keyPath) { - switch (keyPath) { - case '@index': - case undefined: - case null: - return index; - case '@identity': - return identity; - default: - return function (item) { - return _emberMetal.get(item, keyPath); - }; - } - } - - function keyForArray(keyPath) { - switch (keyPath) { - case '@index': - return index; - case '@identity': - case undefined: - case null: - return identity; - default: - return function (item) { - return _emberMetal.get(item, keyPath); - }; - } - } - - function index(item, index) { - return String(index); - } - - function identity(item) { - switch (typeof item) { - case 'string': - case 'number': - return String(item); - default: - return _emberUtils.guidFor(item); - } - } - - function ensureUniqueKey(seen, key) { - var seenCount = seen[key]; - - if (seenCount) { - seen[key]++; - return '' + key + ITERATOR_KEY_GUID + seenCount; - } else { - seen[key] = 1; - } - - return key; - } - - var ArrayIterator = (function () { - function ArrayIterator(array, keyFor) { - babelHelpers.classCallCheck(this, ArrayIterator); - - this.array = array; - this.length = array.length; - this.keyFor = keyFor; - this.position = 0; - this.seen = new _emberUtils.EmptyObject(); - } - - ArrayIterator.prototype.isEmpty = function isEmpty() { - return false; - }; - - ArrayIterator.prototype.next = function next() { - var array = this.array; - var length = this.length; - var keyFor = this.keyFor; - var position = this.position; - var seen = this.seen; - - if (position >= length) { - return null; - } - - var value = array[position]; - var memo = position; - var key = ensureUniqueKey(seen, keyFor(value, memo)); - - this.position++; - - return { key: key, value: value, memo: memo }; - }; - - return ArrayIterator; - })(); - - var EmberArrayIterator = (function () { - function EmberArrayIterator(array, keyFor) { - babelHelpers.classCallCheck(this, EmberArrayIterator); - - this.array = array; - this.length = _emberMetal.get(array, 'length'); - this.keyFor = keyFor; - this.position = 0; - this.seen = new _emberUtils.EmptyObject(); - } - - EmberArrayIterator.prototype.isEmpty = function isEmpty() { - return this.length === 0; - }; - - EmberArrayIterator.prototype.next = function next() { - var array = this.array; - var length = this.length; - var keyFor = this.keyFor; - var position = this.position; - var seen = this.seen; - - if (position >= length) { - return null; - } - - var value = _emberRuntime.objectAt(array, position); - var memo = position; - var key = ensureUniqueKey(seen, keyFor(value, memo)); - - this.position++; - - return { key: key, value: value, memo: memo }; - }; - - return EmberArrayIterator; - })(); - - var ObjectKeysIterator = (function () { - function ObjectKeysIterator(keys, values, keyFor) { - babelHelpers.classCallCheck(this, ObjectKeysIterator); - - this.keys = keys; - this.values = values; - this.keyFor = keyFor; - this.position = 0; - this.seen = new _emberUtils.EmptyObject(); - } - - ObjectKeysIterator.prototype.isEmpty = function isEmpty() { - return this.keys.length === 0; - }; - - ObjectKeysIterator.prototype.next = function next() { - var keys = this.keys; - var values = this.values; - var keyFor = this.keyFor; - var position = this.position; - var seen = this.seen; - - if (position >= keys.length) { - return null; - } - - var value = values[position]; - var memo = keys[position]; - var key = ensureUniqueKey(seen, keyFor(value, memo)); - - this.position++; - - return { key: key, value: value, memo: memo }; - }; - - return ObjectKeysIterator; - })(); - - var EmptyIterator = (function () { - function EmptyIterator() { - babelHelpers.classCallCheck(this, EmptyIterator); - } - - EmptyIterator.prototype.isEmpty = function isEmpty() { - return true; - }; - - EmptyIterator.prototype.next = function next() { - throw new Error('Cannot call next() on an empty iterator'); - }; - - return EmptyIterator; - })(); - - var EMPTY_ITERATOR = new EmptyIterator(); - - var EachInIterable = (function () { - function EachInIterable(ref, keyFor) { - babelHelpers.classCallCheck(this, EachInIterable); - - this.ref = ref; - this.keyFor = keyFor; - - var valueTag = this.valueTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - - this.tag = _glimmerReference.combine([ref.tag, valueTag]); - } - - EachInIterable.prototype.iterate = function iterate() { - var ref = this.ref; - var keyFor = this.keyFor; - var valueTag = this.valueTag; - - var iterable = ref.value(); - - valueTag.update(_emberMetal.tagFor(iterable)); - - if (_emberMetal.isProxy(iterable)) { - iterable = _emberMetal.get(iterable, 'content'); - } - - var typeofIterable = typeof iterable; - - if (iterable && (typeofIterable === 'object' || typeofIterable === 'function')) { - var keys = Object.keys(iterable); - var values = keys.map(function (key) { - return iterable[key]; - }); - return keys.length > 0 ? new ObjectKeysIterator(keys, values, keyFor) : EMPTY_ITERATOR; - } else { - return EMPTY_ITERATOR; - } - }; - - // {{each-in}} yields |key value| instead of |value key|, so the memo and - // value are flipped - - EachInIterable.prototype.valueReferenceFor = function valueReferenceFor(item) { - return new _emberGlimmerUtilsReferences.UpdatablePrimitiveReference(item.memo); - }; - - EachInIterable.prototype.updateValueReference = function updateValueReference(reference, item) { - reference.update(item.memo); - }; - - EachInIterable.prototype.memoReferenceFor = function memoReferenceFor(item) { - return new _emberGlimmerUtilsReferences.UpdatableReference(item.value); - }; - - EachInIterable.prototype.updateMemoReference = function updateMemoReference(reference, item) { - reference.update(item.value); - }; - - return EachInIterable; - })(); - - var ArrayIterable = (function () { - function ArrayIterable(ref, keyFor) { - babelHelpers.classCallCheck(this, ArrayIterable); - - this.ref = ref; - this.keyFor = keyFor; - - var valueTag = this.valueTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - - this.tag = _glimmerReference.combine([ref.tag, valueTag]); - } - - ArrayIterable.prototype.iterate = function iterate() { - var ref = this.ref; - var keyFor = this.keyFor; - var valueTag = this.valueTag; - - var iterable = ref.value(); - - valueTag.update(_emberMetal.tagForProperty(iterable, '[]')); - - if (!iterable || typeof iterable !== 'object') { - return EMPTY_ITERATOR; - } - - if (Array.isArray(iterable)) { - return iterable.length > 0 ? new ArrayIterator(iterable, keyFor) : EMPTY_ITERATOR; - } else if (_emberRuntime.isEmberArray(iterable)) { - return _emberMetal.get(iterable, 'length') > 0 ? new EmberArrayIterator(iterable, keyFor) : EMPTY_ITERATOR; - } else if (typeof iterable.forEach === 'function') { - var _ret = (function () { - var array = []; - iterable.forEach(function (item) { - array.push(item); - }); - return { - v: array.length > 0 ? new ArrayIterator(array, keyFor) : EMPTY_ITERATOR - }; - })(); - - if (typeof _ret === 'object') return _ret.v; - } else { - return EMPTY_ITERATOR; - } - }; - - ArrayIterable.prototype.valueReferenceFor = function valueReferenceFor(item) { - return new _emberGlimmerUtilsReferences.UpdatableReference(item.value); - }; - - ArrayIterable.prototype.updateValueReference = function updateValueReference(reference, item) { - reference.update(item.value); - }; - - ArrayIterable.prototype.memoReferenceFor = function memoReferenceFor(item) { - return new _emberGlimmerUtilsReferences.UpdatablePrimitiveReference(item.memo); - }; - - ArrayIterable.prototype.updateMemoReference = function updateMemoReference(reference, item) { - reference.update(item.memo); - }; - - return ArrayIterable; - })(); -}); -enifed('ember-glimmer/utils/process-args', ['exports', 'ember-utils', 'glimmer-reference', 'ember-glimmer/component', 'ember-glimmer/utils/references', 'ember-views', 'ember-glimmer/helpers/action', 'glimmer-runtime'], function (exports, _emberUtils, _glimmerReference, _emberGlimmerComponent, _emberGlimmerUtilsReferences, _emberViews, _emberGlimmerHelpersAction, _glimmerRuntime) { - 'use strict'; - - exports.gatherArgs = gatherArgs; - - // Maps all variants of positional and dynamically scoped arguments - // into the named arguments. Input `args` and return value are both - // `EvaluatedArgs`. - - function gatherArgs(args, definition) { - var namedMap = gatherNamedMap(args, definition); - var positionalValues = gatherPositionalValues(args, definition); - return mergeArgs(namedMap, positionalValues, args.blocks, definition.ComponentClass); - } - - function gatherNamedMap(args, definition) { - var namedMap = args.named.map; - if (definition.args) { - return _emberUtils.assign({}, definition.args.named.map, namedMap); - } else { - return namedMap; - } - } - - function gatherPositionalValues(args, definition) { - var positionalValues = args.positional.values; - if (definition.args) { - var oldPositional = definition.args.positional.values; - var newPositional = []; - newPositional.push.apply(newPositional, oldPositional); - newPositional.splice.apply(newPositional, [0, positionalValues.length].concat(positionalValues)); - return newPositional; - } else { - return positionalValues; - } - } - - function mergeArgs(namedMap, positionalValues, blocks, componentClass) { - var positionalParamsDefinition = componentClass.positionalParams; - - if (positionalParamsDefinition && positionalParamsDefinition.length > 0 && positionalValues.length > 0) { - if (typeof positionalParamsDefinition === 'string') { - namedMap = mergeRestArg(namedMap, positionalValues, positionalParamsDefinition); - } else { - namedMap = mergePositionalParams(namedMap, positionalValues, positionalParamsDefinition); - } - } - return _glimmerRuntime.EvaluatedArgs.named(namedMap, blocks); - } - - var EMPTY_ARGS = { - tag: _glimmerReference.CONSTANT_TAG, - value: function () { - var _props; - - return { attrs: {}, props: (_props = { attrs: {} }, _props[_emberGlimmerComponent.ARGS] = {}, _props) }; - } - }; - - // ComponentArgs takes EvaluatedNamedArgs and converts them into the - // inputs needed by CurlyComponents (attrs and props, with mutable - // cells, etc). - - var ComponentArgs = (function () { - ComponentArgs.create = function create(args) { - if (args.named.keys.length === 0) { - return EMPTY_ARGS; - } else { - return new ComponentArgs(args.named); - } - }; - - function ComponentArgs(namedArgs) { - babelHelpers.classCallCheck(this, ComponentArgs); - - this.tag = namedArgs.tag; - this.namedArgs = namedArgs; - } - - ComponentArgs.prototype.value = function value() { - var namedArgs = this.namedArgs; - - var keys = namedArgs.keys; - var attrs = namedArgs.value(); - var props = new _emberUtils.EmptyObject(); - var args = new _emberUtils.EmptyObject(); - - props[_emberGlimmerComponent.ARGS] = args; - - for (var i = 0, l = keys.length; i < l; i++) { - var _name = keys[i]; - var ref = namedArgs.get(_name); - var value = attrs[_name]; - - if (typeof value === 'function' && value[_emberGlimmerHelpersAction.ACTION]) { - attrs[_name] = value; - } else if (ref[_emberGlimmerUtilsReferences.UPDATE]) { - attrs[_name] = new MutableCell(ref, value); - } - - args[_name] = ref; - props[_name] = value; - } - - props.attrs = attrs; - - return { attrs: attrs, props: props }; - }; - - return ComponentArgs; - })(); - - exports.ComponentArgs = ComponentArgs; - - function mergeRestArg(namedMap, positionalValues, restArgName) { - var mergedNamed = _emberUtils.assign({}, namedMap); - mergedNamed[restArgName] = _glimmerRuntime.EvaluatedPositionalArgs.create(positionalValues); - return mergedNamed; - } - - function mergePositionalParams(namedMap, values, positionalParamNames) { - var mergedNamed = _emberUtils.assign({}, namedMap); - var length = Math.min(values.length, positionalParamNames.length); - for (var i = 0; i < length; i++) { - var _name2 = positionalParamNames[i]; - mergedNamed[_name2] = values[i]; - } - return mergedNamed; - } - - var REF = _emberUtils.symbol('REF'); - - var MutableCell = (function () { - function MutableCell(ref, value) { - babelHelpers.classCallCheck(this, MutableCell); - - this[_emberViews.MUTABLE_CELL] = true; - this[REF] = ref; - this.value = value; - } - - MutableCell.prototype.update = function update(val) { - this[REF][_emberGlimmerUtilsReferences.UPDATE](val); - }; - - return MutableCell; - })(); -}); -enifed('ember-glimmer/utils/references', ['exports', 'ember-utils', 'ember-metal', 'glimmer-reference', 'glimmer-runtime', 'ember-glimmer/utils/to-bool', 'ember-glimmer/helper'], function (exports, _emberUtils, _emberMetal, _glimmerReference, _glimmerRuntime, _emberGlimmerUtilsToBool, _emberGlimmerHelper) { - 'use strict'; - - var UPDATE = _emberUtils.symbol('UPDATE'); - - exports.UPDATE = UPDATE; - exports.NULL_REFERENCE = _glimmerRuntime.NULL_REFERENCE; - exports.UNDEFINED_REFERENCE = _glimmerRuntime.UNDEFINED_REFERENCE; - - // @abstract - // @implements PathReference - - var EmberPathReference = (function () { - function EmberPathReference() { - babelHelpers.classCallCheck(this, EmberPathReference); - } - - // @abstract - - // @abstract get tag() - // @abstract value() - - EmberPathReference.prototype.get = function get(key) { - return PropertyReference.create(this, key); - }; - - return EmberPathReference; - })(); - - var CachedReference = (function (_EmberPathReference) { - babelHelpers.inherits(CachedReference, _EmberPathReference); - - function CachedReference() { - babelHelpers.classCallCheck(this, CachedReference); - - _EmberPathReference.call(this); - this._lastRevision = null; - this._lastValue = null; - } - - // @implements PathReference - - CachedReference.prototype.value = function value() { - var tag = this.tag; - var _lastRevision = this._lastRevision; - var _lastValue = this._lastValue; - - if (!_lastRevision || !tag.validate(_lastRevision)) { - _lastValue = this._lastValue = this.compute(); - this._lastRevision = tag.value(); - } - - return _lastValue; - }; - - // @abstract compute() - return CachedReference; - })(EmberPathReference); - - exports.CachedReference = CachedReference; - - var RootReference = (function (_ConstReference) { - babelHelpers.inherits(RootReference, _ConstReference); - - function RootReference(value) { - babelHelpers.classCallCheck(this, RootReference); - - _ConstReference.call(this, value); - this.children = new _emberUtils.EmptyObject(); - } - - RootReference.prototype.get = function get(propertyKey) { - var ref = this.children[propertyKey]; - - if (!ref) { - ref = this.children[propertyKey] = new RootPropertyReference(this.inner, propertyKey); - } - - return ref; - }; - - return RootReference; - })(_glimmerReference.ConstReference); - - exports.RootReference = RootReference; - - var TwoWayFlushDetectionTag = undefined; - - if (true || true) { - TwoWayFlushDetectionTag = (function () { - function _class(tag, key, ref) { - babelHelpers.classCallCheck(this, _class); - - this.tag = tag; - this.parent = null; - this.key = key; - this.ref = ref; - } - - _class.prototype.value = function value() { - return this.tag.value(); - }; - - _class.prototype.validate = function validate(ticket) { - var parent = this.parent; - var key = this.key; - - var isValid = this.tag.validate(ticket); - - if (isValid && parent) { - _emberMetal.didRender(parent, key, this.ref); - } - - return isValid; - }; - - _class.prototype.didCompute = function didCompute(parent) { - this.parent = parent; - _emberMetal.didRender(parent, this.key, this.ref); - }; - - return _class; - })(); - } - - var PropertyReference = (function (_CachedReference) { - babelHelpers.inherits(PropertyReference, _CachedReference); - - function PropertyReference() { - babelHelpers.classCallCheck(this, PropertyReference); - - _CachedReference.apply(this, arguments); - } - - PropertyReference.create = function create(parentReference, propertyKey) { - if (_glimmerReference.isConst(parentReference)) { - return new RootPropertyReference(parentReference.value(), propertyKey); - } else { - return new NestedPropertyReference(parentReference, propertyKey); - } - }; - - PropertyReference.prototype.get = function get(key) { - return new NestedPropertyReference(this, key); - }; - - return PropertyReference; - })(CachedReference); - - exports.PropertyReference = PropertyReference; - - var RootPropertyReference = (function (_PropertyReference) { - babelHelpers.inherits(RootPropertyReference, _PropertyReference); - - function RootPropertyReference(parentValue, propertyKey) { - babelHelpers.classCallCheck(this, RootPropertyReference); - - _PropertyReference.call(this); - - this._parentValue = parentValue; - this._propertyKey = propertyKey; - - if (true || true) { - this.tag = new TwoWayFlushDetectionTag(_emberMetal.tagForProperty(parentValue, propertyKey), propertyKey, this); - } else { - this.tag = _emberMetal.tagForProperty(parentValue, propertyKey); - } - - if (true) { - _emberMetal.watchKey(parentValue, propertyKey); - } - } - - RootPropertyReference.prototype.compute = function compute() { - var _parentValue = this._parentValue; - var _propertyKey = this._propertyKey; - - if (true || true) { - this.tag.didCompute(_parentValue); - } - - return _emberMetal.get(_parentValue, _propertyKey); - }; - - RootPropertyReference.prototype[UPDATE] = function (value) { - _emberMetal.set(this._parentValue, this._propertyKey, value); - }; - - return RootPropertyReference; - })(PropertyReference); - - exports.RootPropertyReference = RootPropertyReference; - - var NestedPropertyReference = (function (_PropertyReference2) { - babelHelpers.inherits(NestedPropertyReference, _PropertyReference2); - - function NestedPropertyReference(parentReference, propertyKey) { - babelHelpers.classCallCheck(this, NestedPropertyReference); - - _PropertyReference2.call(this); - - var parentReferenceTag = parentReference.tag; - var parentObjectTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - - this._parentReference = parentReference; - this._parentObjectTag = parentObjectTag; - this._propertyKey = propertyKey; - - if (true || true) { - var tag = _glimmerReference.combine([parentReferenceTag, parentObjectTag]); - this.tag = new TwoWayFlushDetectionTag(tag, propertyKey, this); - } else { - this.tag = _glimmerReference.combine([parentReferenceTag, parentObjectTag]); - } - } - - NestedPropertyReference.prototype.compute = function compute() { - var _parentReference = this._parentReference; - var _parentObjectTag = this._parentObjectTag; - var _propertyKey = this._propertyKey; - - var parentValue = _parentReference.value(); - - _parentObjectTag.update(_emberMetal.tagForProperty(parentValue, _propertyKey)); - - if (typeof parentValue === 'string' && _propertyKey === 'length') { - return parentValue.length; - } - - if (typeof parentValue === 'object' && parentValue) { - if (true) { - _emberMetal.watchKey(parentValue, _propertyKey); - } - - if (true || true) { - this.tag.didCompute(parentValue); - } - - return _emberMetal.get(parentValue, _propertyKey); - } else { - return undefined; - } - }; - - NestedPropertyReference.prototype[UPDATE] = function (value) { - var parent = this._parentReference.value(); - _emberMetal.set(parent, this._propertyKey, value); - }; - - return NestedPropertyReference; - })(PropertyReference); - - exports.NestedPropertyReference = NestedPropertyReference; - - var UpdatableReference = (function (_EmberPathReference2) { - babelHelpers.inherits(UpdatableReference, _EmberPathReference2); - - function UpdatableReference(value) { - babelHelpers.classCallCheck(this, UpdatableReference); - - _EmberPathReference2.call(this); - - this.tag = new _glimmerReference.DirtyableTag(); - this._value = value; - } - - UpdatableReference.prototype.value = function value() { - return this._value; - }; - - UpdatableReference.prototype.update = function update(value) { - var _value = this._value; - - if (value !== _value) { - this.tag.dirty(); - this._value = value; - } - }; - - return UpdatableReference; - })(EmberPathReference); - - exports.UpdatableReference = UpdatableReference; - - var UpdatablePrimitiveReference = (function (_UpdatableReference) { - babelHelpers.inherits(UpdatablePrimitiveReference, _UpdatableReference); - - function UpdatablePrimitiveReference() { - babelHelpers.classCallCheck(this, UpdatablePrimitiveReference); - - _UpdatableReference.apply(this, arguments); - } - - UpdatablePrimitiveReference.prototype.get = function get() { - return _glimmerRuntime.UNDEFINED_REFERENCE; - }; - - return UpdatablePrimitiveReference; - })(UpdatableReference); - - exports.UpdatablePrimitiveReference = UpdatablePrimitiveReference; - - var ConditionalReference = (function (_GlimmerConditionalReference) { - babelHelpers.inherits(ConditionalReference, _GlimmerConditionalReference); - - ConditionalReference.create = function create(reference) { - if (_glimmerReference.isConst(reference)) { - var value = reference.value(); - - if (_emberMetal.isProxy(value)) { - return new RootPropertyReference(value, 'isTruthy'); - } else { - return _glimmerRuntime.PrimitiveReference.create(_emberGlimmerUtilsToBool.default(value)); - } - } - - return new ConditionalReference(reference); - }; - - function ConditionalReference(reference) { - babelHelpers.classCallCheck(this, ConditionalReference); - - _GlimmerConditionalReference.call(this, reference); - - this.objectTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - this.tag = _glimmerReference.combine([reference.tag, this.objectTag]); - } - - ConditionalReference.prototype.toBool = function toBool(predicate) { - if (_emberMetal.isProxy(predicate)) { - this.objectTag.update(_emberMetal.tagForProperty(predicate, 'isTruthy')); - return _emberMetal.get(predicate, 'isTruthy'); - } else { - this.objectTag.update(_emberMetal.tagFor(predicate)); - return _emberGlimmerUtilsToBool.default(predicate); - } - }; - - return ConditionalReference; - })(_glimmerRuntime.ConditionalReference); - - exports.ConditionalReference = ConditionalReference; - - var SimpleHelperReference = (function (_CachedReference2) { - babelHelpers.inherits(SimpleHelperReference, _CachedReference2); - - SimpleHelperReference.create = function create(helper, args) { - if (_glimmerReference.isConst(args)) { - var _ret = (function () { - var positional = args.positional; - var named = args.named; - - var positionalValue = positional.value(); - var namedValue = named.value(); - - _emberMetal.runInDebug(function () { - Object.freeze(positionalValue); - Object.freeze(namedValue); - }); - - var result = helper(positionalValue, namedValue); - - if (result === null) { - return { - v: _glimmerRuntime.NULL_REFERENCE - }; - } else if (result === undefined) { - return { - v: _glimmerRuntime.UNDEFINED_REFERENCE - }; - } else if (typeof result === 'object') { - return { - v: new RootReference(result) - }; - } else { - return { - v: _glimmerRuntime.PrimitiveReference.create(result) - }; - } - })(); - - if (typeof _ret === 'object') return _ret.v; - } else { - return new SimpleHelperReference(helper, args); - } - }; - - function SimpleHelperReference(helper, args) { - babelHelpers.classCallCheck(this, SimpleHelperReference); - - _CachedReference2.call(this); - - this.tag = args.tag; - this.helper = helper; - this.args = args; - } - - SimpleHelperReference.prototype.compute = function compute() { - var helper = this.helper; - var _args = this.args; - var positional = _args.positional; - var named = _args.named; - - var positionalValue = positional.value(); - var namedValue = named.value(); - - _emberMetal.runInDebug(function () { - Object.freeze(positionalValue); - Object.freeze(namedValue); - }); - - return helper(positionalValue, namedValue); - }; - - return SimpleHelperReference; - })(CachedReference); - - exports.SimpleHelperReference = SimpleHelperReference; - - var ClassBasedHelperReference = (function (_CachedReference3) { - babelHelpers.inherits(ClassBasedHelperReference, _CachedReference3); - - ClassBasedHelperReference.create = function create(helperClass, vm, args) { - var instance = helperClass.create(); - vm.newDestroyable(instance); - return new ClassBasedHelperReference(instance, args); - }; - - function ClassBasedHelperReference(instance, args) { - babelHelpers.classCallCheck(this, ClassBasedHelperReference); - - _CachedReference3.call(this); - - this.tag = _glimmerReference.combine([instance[_emberGlimmerHelper.RECOMPUTE_TAG], args.tag]); - this.instance = instance; - this.args = args; - } - - ClassBasedHelperReference.prototype.compute = function compute() { - var instance = this.instance; - var _args2 = this.args; - var positional = _args2.positional; - var named = _args2.named; - - var positionalValue = positional.value(); - var namedValue = named.value(); - - _emberMetal.runInDebug(function () { - Object.freeze(positionalValue); - Object.freeze(namedValue); - }); - - return instance.compute(positionalValue, namedValue); - }; - - return ClassBasedHelperReference; - })(CachedReference); - - exports.ClassBasedHelperReference = ClassBasedHelperReference; - - var InternalHelperReference = (function (_CachedReference4) { - babelHelpers.inherits(InternalHelperReference, _CachedReference4); - - function InternalHelperReference(helper, args) { - babelHelpers.classCallCheck(this, InternalHelperReference); - - _CachedReference4.call(this); - - this.tag = args.tag; - this.helper = helper; - this.args = args; - } - - // @implements PathReference - - InternalHelperReference.prototype.compute = function compute() { - var helper = this.helper; - var args = this.args; - - return helper(args); - }; - - return InternalHelperReference; - })(CachedReference); - - exports.InternalHelperReference = InternalHelperReference; - - var UnboundReference = (function (_ConstReference2) { - babelHelpers.inherits(UnboundReference, _ConstReference2); - - function UnboundReference() { - babelHelpers.classCallCheck(this, UnboundReference); - - _ConstReference2.apply(this, arguments); - } - - UnboundReference.create = function create(value) { - if (value === null) { - return _glimmerRuntime.NULL_REFERENCE; - } else if (value === undefined) { - return _glimmerRuntime.UNDEFINED_REFERENCE; - } else if (typeof value === 'object') { - return new UnboundReference(value); - } else { - return _glimmerRuntime.PrimitiveReference.create(value); - } - }; - - UnboundReference.prototype.get = function get(key) { - return new UnboundReference(_emberMetal.get(this.inner, key)); - }; - - return UnboundReference; - })(_glimmerReference.ConstReference); - - exports.UnboundReference = UnboundReference; -}); -enifed('ember-glimmer/utils/string', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-glimmer - */ - - 'use strict'; - - exports.getSafeString = getSafeString; - exports.escapeExpression = escapeExpression; - exports.htmlSafe = htmlSafe; - exports.isHTMLSafe = isHTMLSafe; - - var SafeString = (function () { - function SafeString(string) { - babelHelpers.classCallCheck(this, SafeString); - - this.string = string; - } - - SafeString.prototype.toString = function toString() { - return '' + this.string; - }; - - SafeString.prototype.toHTML = function toHTML() { - return this.toString(); - }; - - return SafeString; - })(); - - exports.SafeString = SafeString; - - function getSafeString() { - _emberMetal.deprecate('Ember.Handlebars.SafeString is deprecated in favor of Ember.String.htmlSafe', !true, { - id: 'ember-htmlbars.ember-handlebars-safestring', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x#toc_use-ember-string-htmlsafe-over-ember-handlebars-safestring' - }); - - return SafeString; - } - - var escape = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - // jscs:disable - "'": ''', - // jscs:enable - '`': '`', - '=': '=' - }; - - var possible = /[&<>"'`=]/; - var badChars = /[&<>"'`=]/g; - - function escapeChar(chr) { - return escape[chr]; - } - - function escapeExpression(string) { - if (typeof string !== 'string') { - // don't escape SafeStrings, since they're already safe - if (string && string.toHTML) { - return string.toHTML(); - } else if (string == null) { - return ''; - } else if (!string) { - return string + ''; - } - - // Force a string conversion as this will be done by the append regardless and - // the regex test will do this transparently behind the scenes, causing issues if - // an object's to string has escaped characters in it. - string = '' + string; - } - - if (!possible.test(string)) { - return string; - } - return string.replace(badChars, escapeChar); - } - - /** - 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. - - ```javascript - Ember.String.htmlSafe('
    someString
    ') - ``` - - @method htmlSafe - @for Ember.String - @static - @return {Handlebars.SafeString} A string that will not be HTML escaped by Handlebars. - @public - */ - - function htmlSafe(str) { - if (str === null || str === undefined) { - str = ''; - } else if (typeof str !== 'string') { - str = '' + str; - } - return new SafeString(str); - } - - /** - Detects if a string was decorated using `Ember.String.htmlSafe`. - - ```javascript - var plainString = 'plain string', - safeString = Ember.String.htmlSafe('
    someValue
    '); - - Ember.String.isHTMLSafe(plainString); // false - Ember.String.isHTMLSafe(safeString); // true - ``` - - @method isHTMLSafe - @for Ember.String - @static - @return {Boolean} `true` if the string was decorated with `htmlSafe`, `false` otherwise. - @public - */ - - function isHTMLSafe(str) { - return str && typeof str.toHTML === 'function'; - } -}); -enifed('ember-glimmer/utils/to-bool', ['exports', 'ember-runtime', 'ember-metal'], function (exports, _emberRuntime, _emberMetal) { - 'use strict'; - - exports.default = toBool; - - function toBool(predicate) { - if (!predicate) { - return false; - } - - if (predicate === true) { - return true; - } - - if (_emberRuntime.isArray(predicate)) { - return _emberMetal.get(predicate, 'length') !== 0; - } - - return true; - } -}); -enifed('ember-glimmer/views/outlet', ['exports', 'ember-utils', 'glimmer-reference', 'ember-environment', 'ember-metal'], function (exports, _emberUtils, _glimmerReference, _emberEnvironment, _emberMetal) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; - - var OutletStateReference = (function () { - function OutletStateReference(outletView) { - babelHelpers.classCallCheck(this, OutletStateReference); - - this.outletView = outletView; - this.tag = outletView._tag; - } - - // So this is a relic of the past that SHOULD go away - // in 3.0. Preferably it is deprecated in the release that - // follows the Glimmer release. - - OutletStateReference.prototype.get = function get(key) { - return new ChildOutletStateReference(this, key); - }; - - OutletStateReference.prototype.value = function value() { - return this.outletView.outletState; - }; - - OutletStateReference.prototype.getOrphan = function getOrphan(name) { - return new OrphanedOutletStateReference(this, name); - }; - - OutletStateReference.prototype.update = function update(state) { - this.outletView.setOutletState(state); - }; - - return OutletStateReference; - })(); - - var OrphanedOutletStateReference = (function (_OutletStateReference) { - babelHelpers.inherits(OrphanedOutletStateReference, _OutletStateReference); - - function OrphanedOutletStateReference(root, name) { - babelHelpers.classCallCheck(this, OrphanedOutletStateReference); - - _OutletStateReference.call(this, root.outletView); - this.root = root; - this.name = name; - } - - OrphanedOutletStateReference.prototype.value = function value() { - var rootState = this.root.value(); - - var orphans = rootState.outlets.main.outlets.__ember_orphans__; - - if (!orphans) { - return null; - } - - var matched = orphans.outlets[this.name]; - - if (!matched) { - return null; - } - - var state = new _emberUtils.EmptyObject(); - state[matched.render.outlet] = matched; - matched.wasUsed = true; - return { outlets: state }; - }; - - return OrphanedOutletStateReference; - })(OutletStateReference); - - var ChildOutletStateReference = (function () { - function ChildOutletStateReference(parent, key) { - babelHelpers.classCallCheck(this, ChildOutletStateReference); - - this.parent = parent; - this.key = key; - this.tag = parent.tag; - } - - ChildOutletStateReference.prototype.get = function get(key) { - return new ChildOutletStateReference(this, key); - }; - - ChildOutletStateReference.prototype.value = function value() { - return this.parent.value()[this.key]; - }; - - return ChildOutletStateReference; - })(); - - var OutletView = (function () { - OutletView.extend = function extend(injections) { - return (function (_OutletView) { - babelHelpers.inherits(_class, _OutletView); - - function _class() { - babelHelpers.classCallCheck(this, _class); - - _OutletView.apply(this, arguments); - } - - _class.create = function create(options) { - if (options) { - return _OutletView.create.call(this, _emberUtils.assign({}, injections, options)); - } else { - return _OutletView.create.call(this, injections); - } - }; - - return _class; - })(OutletView); - }; - - OutletView.reopenClass = function reopenClass(injections) { - _emberUtils.assign(this, injections); - }; - - OutletView.create = function create(options) { - var _environment = options._environment; - var renderer = options.renderer; - var template = options.template; - - var owner = options[_emberUtils.OWNER]; - return new OutletView(_environment, renderer, owner, template); - }; - - function OutletView(_environment, renderer, owner, template) { - babelHelpers.classCallCheck(this, OutletView); - - this._environment = _environment; - this.renderer = renderer; - this.owner = owner; - this.template = template; - this.outletState = null; - this._tag = new _glimmerReference.DirtyableTag(); - } - - OutletView.prototype.appendTo = function appendTo(selector) { - var env = this._environment || _emberEnvironment.environment; - var target = undefined; - - if (env.hasDOM) { - target = typeof selector === 'string' ? document.querySelector(selector) : selector; - } else { - target = selector; - } - - _emberMetal.run.schedule('render', this.renderer, 'appendOutletView', this, target); - }; - - OutletView.prototype.rerender = function rerender() {}; - - OutletView.prototype.setOutletState = function setOutletState(state) { - this.outletState = { - outlets: { - main: state - }, - render: { - owner: undefined, - into: undefined, - outlet: 'main', - name: '-top-level', - controller: undefined, - ViewClass: undefined, - template: undefined - } - }; - this._tag.dirty(); - }; - - OutletView.prototype.toReference = function toReference() { - return new OutletStateReference(this); - }; - - OutletView.prototype.destroy = function destroy() {}; - - return OutletView; - })(); - - exports.default = OutletView; -}); -enifed('ember-metal/alias', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/error', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/meta', 'ember-metal/dependent_keys'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalError, _emberMetalProperties, _emberMetalComputed, _emberMetalMeta, _emberMetalDependent_keys) { - 'use strict'; - - exports.default = alias; - exports.AliasedProperty = AliasedProperty; - - var CONSUMED = {}; - - function alias(altKey) { - return new AliasedProperty(altKey); - } - - function AliasedProperty(altKey) { - this.isDescriptor = true; - this.altKey = altKey; - this._dependentKeys = [altKey]; - } - - AliasedProperty.prototype = Object.create(_emberMetalProperties.Descriptor.prototype); - - AliasedProperty.prototype.setup = function (obj, keyName) { - _emberMetalDebug.assert('Setting alias \'' + keyName + '\' on self', this.altKey !== keyName); - var meta = _emberMetalMeta.meta(obj); - if (meta.peekWatching(keyName)) { - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); - } - }; - - AliasedProperty.prototype.teardown = function (obj, keyName) { - var meta = _emberMetalMeta.meta(obj); - if (meta.peekWatching(keyName)) { - _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); - } - }; - - AliasedProperty.prototype.willWatch = function (obj, keyName) { - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); - }; - - AliasedProperty.prototype.didUnwatch = function (obj, keyName) { - _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); - }; - - AliasedProperty.prototype.get = function AliasedProperty_get(obj, keyName) { - var ret = _emberMetalProperty_get.get(obj, this.altKey); - var meta = _emberMetalMeta.meta(obj); - var cache = meta.writableCache(); - if (cache[keyName] !== CONSUMED) { - cache[keyName] = CONSUMED; - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); - } - return ret; - }; - - AliasedProperty.prototype.set = function AliasedProperty_set(obj, keyName, value) { - return _emberMetalProperty_set.set(obj, this.altKey, value); - }; - - AliasedProperty.prototype.readOnly = function () { - this.set = AliasedProperty_readOnlySet; - return this; - }; - - function AliasedProperty_readOnlySet(obj, keyName, value) { - throw new _emberMetalError.default('Cannot set read-only property \'' + keyName + '\' on object: ' + _emberUtils.inspect(obj)); - } - - AliasedProperty.prototype.oneWay = function () { - this.set = AliasedProperty_oneWaySet; - return this; - }; - - function AliasedProperty_oneWaySet(obj, keyName, value) { - _emberMetalProperties.defineProperty(obj, keyName, null); - return _emberMetalProperty_set.set(obj, keyName, value); - } - - // Backwards compatibility with Ember Data. - AliasedProperty.prototype._meta = undefined; - AliasedProperty.prototype.meta = _emberMetalComputed.ComputedProperty.prototype.meta; -}); -enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember-environment', 'ember-metal/run_loop', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/events', 'ember-metal/observer', 'ember-metal/path_cache'], function (exports, _emberUtils, _emberConsole, _emberEnvironment, _emberMetalRun_loop, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalEvents, _emberMetalObserver, _emberMetalPath_cache) { - 'use strict'; - - exports.bind = bind; - - /** - @module ember - @submodule ember-metal - */ - - // .......................................................... - // BINDING - // - - function Binding(toPath, fromPath) { - // Configuration - this._from = fromPath; - this._to = toPath; - this._oneWay = undefined; - - // State - this._direction = undefined; - this._readyToSync = undefined; - this._fromObj = undefined; - this._fromPath = undefined; - this._toObj = undefined; - } - - /** - @class Binding - @namespace Ember - @deprecated See http://emberjs.com/deprecations/v2.x#toc_ember-binding - @public - */ - - Binding.prototype = { - /** - This copies the Binding so it can be connected to another object. - @method copy - @return {Ember.Binding} `this` - @public - */ - copy: function () { - var copy = new Binding(this._to, this._from); - if (this._oneWay) { - copy._oneWay = true; - } - return copy; - }, - - // .......................................................... - // CONFIG - // - - /** - This will set `from` property path to the specified value. It will not - attempt to resolve this property path to an actual object until you - connect the binding. - The binding will search for the property path starting at the root object - you pass when you `connect()` the binding. It follows the same rules as - `get()` - see that method for more information. - @method from - @param {String} path The property path to connect to. - @return {Ember.Binding} `this` - @public - */ - from: function (path) { - this._from = path; - return this; - }, - - /** - This will set the `to` property path to the specified value. It will not - attempt to resolve this property path to an actual object until you - connect the binding. - The binding will search for the property path starting at the root object - you pass when you `connect()` the binding. It follows the same rules as - `get()` - see that method for more information. - @method to - @param {String|Tuple} path A property path or tuple. - @return {Ember.Binding} `this` - @public - */ - to: function (path) { - this._to = path; - return this; - }, - - /** - Configures the binding as one way. A one-way binding will relay changes - on the `from` side to the `to` side, but not the other way around. This - means that if you change the `to` side directly, the `from` side may have - a different value. - @method oneWay - @return {Ember.Binding} `this` - @public - */ - oneWay: function () { - this._oneWay = true; - return this; - }, - - /** - @method toString - @return {String} string representation of binding - @public - */ - toString: function () { - var oneWay = this._oneWay ? '[oneWay]' : ''; - return 'Ember.Binding<' + _emberUtils.guidFor(this) + '>(' + this._from + ' -> ' + this._to + ')' + oneWay; - }, - - // .......................................................... - // CONNECT AND SYNC - // - - /** - Attempts to connect this binding instance so that it can receive and relay - changes. This method will raise an exception if you have not set the - from/to properties yet. - @method connect - @param {Object} obj The root object for this binding. - @return {Ember.Binding} `this` - @public - */ - connect: function (obj) { - _emberMetalDebug.assert('Must pass a valid object to Ember.Binding.connect()', !!obj); - - var fromObj = undefined, - fromPath = undefined, - possibleGlobal = undefined; - - // If the binding's "from" path could be interpreted as a global, verify - // whether the path refers to a global or not by consulting `Ember.lookup`. - if (_emberMetalPath_cache.isGlobalPath(this._from)) { - var _name = _emberMetalPath_cache.getFirstKey(this._from); - possibleGlobal = _emberEnvironment.context.lookup[_name]; - - if (possibleGlobal) { - fromObj = possibleGlobal; - fromPath = _emberMetalPath_cache.getTailPath(this._from); - } - } - - if (fromObj === undefined) { - fromObj = obj; - fromPath = this._from; - } - - _emberMetalProperty_set.trySet(obj, this._to, _emberMetalProperty_get.get(fromObj, fromPath)); - - // Add an observer on the object to be notified when the binding should be updated. - _emberMetalObserver.addObserver(fromObj, fromPath, this, 'fromDidChange'); - - // If the binding is a two-way binding, also set up an observer on the target. - if (!this._oneWay) { - _emberMetalObserver.addObserver(obj, this._to, this, 'toDidChange'); - } - - _emberMetalEvents.addListener(obj, 'willDestroy', this, 'disconnect'); - - fireDeprecations(obj, this._to, this._from, possibleGlobal, this._oneWay, !possibleGlobal && !this._oneWay); - - this._readyToSync = true; - this._fromObj = fromObj; - this._fromPath = fromPath; - this._toObj = obj; - - return this; - }, - - /** - Disconnects the binding instance. Changes will no longer be relayed. You - will not usually need to call this method. - @method disconnect - @return {Ember.Binding} `this` - @public - */ - disconnect: function () { - _emberMetalDebug.assert('Must pass a valid object to Ember.Binding.disconnect()', !!this._toObj); - - // Remove an observer on the object so we're no longer notified of - // changes that should update bindings. - _emberMetalObserver.removeObserver(this._fromObj, this._fromPath, this, 'fromDidChange'); - - // If the binding is two-way, remove the observer from the target as well. - if (!this._oneWay) { - _emberMetalObserver.removeObserver(this._toObj, this._to, this, 'toDidChange'); - } - - this._readyToSync = false; // Disable scheduled syncs... - return this; - }, - - // .......................................................... - // PRIVATE - // - - /* Called when the from side changes. */ - fromDidChange: function (target) { - this._scheduleSync('fwd'); - }, - - /* Called when the to side changes. */ - toDidChange: function (target) { - this._scheduleSync('back'); - }, - - _scheduleSync: function (dir) { - var existingDir = this._direction; - - // If we haven't scheduled the binding yet, schedule it. - if (existingDir === undefined) { - _emberMetalRun_loop.default.schedule('sync', this, '_sync'); - this._direction = dir; - } - - // If both a 'back' and 'fwd' sync have been scheduled on the same object, - // default to a 'fwd' sync so that it remains deterministic. - if (existingDir === 'back' && dir === 'fwd') { - this._direction = 'fwd'; - } - }, - - _sync: function () { - var log = _emberEnvironment.ENV.LOG_BINDINGS; - - var toObj = this._toObj; - - // Don't synchronize destroyed objects or disconnected bindings. - if (toObj.isDestroyed || !this._readyToSync) { - return; - } - - // Get the direction of the binding for the object we are - // synchronizing from. - var direction = this._direction; - - var fromObj = this._fromObj; - var fromPath = this._fromPath; - - this._direction = undefined; - - // If we're synchronizing from the remote object... - if (direction === 'fwd') { - var fromValue = _emberMetalProperty_get.get(fromObj, fromPath); - if (log) { - _emberConsole.default.log(' ', this.toString(), '->', fromValue, fromObj); - } - if (this._oneWay) { - _emberMetalProperty_set.trySet(toObj, this._to, fromValue); - } else { - _emberMetalObserver._suspendObserver(toObj, this._to, this, 'toDidChange', function () { - _emberMetalProperty_set.trySet(toObj, this._to, fromValue); - }); - } - // If we're synchronizing *to* the remote object. - } else if (direction === 'back') { - var toValue = _emberMetalProperty_get.get(toObj, this._to); - if (log) { - _emberConsole.default.log(' ', this.toString(), '<-', toValue, toObj); - } - _emberMetalObserver._suspendObserver(fromObj, fromPath, this, 'fromDidChange', function () { - _emberMetalProperty_set.trySet(fromObj, fromPath, toValue); - }); - } - } - - }; - - function fireDeprecations(obj, toPath, fromPath, deprecateGlobal, deprecateOneWay, deprecateAlias) { - var deprecateGlobalMessage = '`Ember.Binding` is deprecated. Since you' + ' are binding to a global consider using a service instead.'; - var deprecateOneWayMessage = '`Ember.Binding` is deprecated. Since you' + ' are using a `oneWay` binding consider using a `readOnly` computed' + ' property instead.'; - var deprecateAliasMessage = '`Ember.Binding` is deprecated. Consider' + ' using an `alias` computed property instead.'; - - var objectInfo = 'The `' + toPath + '` property of `' + obj + '` is an `Ember.Binding` connected to `' + fromPath + '`, but '; - _emberMetalDebug.deprecate(objectInfo + deprecateGlobalMessage, !deprecateGlobal, { - id: 'ember-metal.binding', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x#toc_ember-binding' - }); - _emberMetalDebug.deprecate(objectInfo + deprecateOneWayMessage, !deprecateOneWay, { - id: 'ember-metal.binding', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x#toc_ember-binding' - }); - _emberMetalDebug.deprecate(objectInfo + deprecateAliasMessage, !deprecateAlias, { - id: 'ember-metal.binding', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x#toc_ember-binding' - }); - } - - function mixinProperties(to, from) { - for (var key in from) { - if (from.hasOwnProperty(key)) { - to[key] = from[key]; - } - } - } - - mixinProperties(Binding, { - - /* - See `Ember.Binding.from`. - @method from - @static - */ - from: function (from) { - var C = this; - return new C(undefined, from); - }, - - /* - See `Ember.Binding.to`. - @method to - @static - */ - to: function (to) { - var C = this; - return new C(to, undefined); - } - }); - /** - An `Ember.Binding` connects the properties of two objects so that whenever - the value of one property changes, the other property will be changed also. - - ## Automatic Creation of Bindings with `/^*Binding/`-named Properties. - - You do not usually create Binding objects directly but instead describe - bindings in your class or object definition using automatic binding - detection. - - Properties ending in a `Binding` suffix will be converted to `Ember.Binding` - instances. The value of this property should be a string representing a path - to another object or a custom binding instance created using Binding helpers - (see "One Way Bindings"): - - ``` - valueBinding: "MyApp.someController.title" - ``` - - This will create a binding from `MyApp.someController.title` to the `value` - property of your object instance automatically. Now the two values will be - kept in sync. - - ## One Way Bindings - - One especially useful binding customization you can use is the `oneWay()` - helper. This helper tells Ember that you are only interested in - receiving changes on the object you are binding from. For example, if you - are binding to a preference and you want to be notified if the preference - has changed, but your object will not be changing the preference itself, you - could do: - - ``` - bigTitlesBinding: Ember.Binding.oneWay("MyApp.preferencesController.bigTitles") - ``` - - This way if the value of `MyApp.preferencesController.bigTitles` changes the - `bigTitles` property of your object will change also. However, if you - change the value of your `bigTitles` property, it will not update the - `preferencesController`. - - One way bindings are almost twice as fast to setup and twice as fast to - execute because the binding only has to worry about changes to one side. - - You should consider using one way bindings anytime you have an object that - may be created frequently and you do not intend to change a property; only - to monitor it for changes (such as in the example above). - - ## Adding Bindings Manually - - All of the examples above show you how to configure a custom binding, but the - result of these customizations will be a binding template, not a fully active - Binding instance. The binding will actually become active only when you - instantiate the object the binding belongs to. It is useful, however, to - understand what actually happens when the binding is activated. - - For a binding to function it must have at least a `from` property and a `to` - property. The `from` property path points to the object/key that you want to - bind from while the `to` path points to the object/key you want to bind to. - - When you define a custom binding, you are usually describing the property - you want to bind from (such as `MyApp.someController.value` in the examples - above). When your object is created, it will automatically assign the value - you want to bind `to` based on the name of your binding key. In the - examples above, during init, Ember objects will effectively call - something like this on your binding: - - ```javascript - binding = Ember.Binding.from("valueBinding").to("value"); - ``` - - This creates a new binding instance based on the template you provide, and - sets the to path to the `value` property of the new object. Now that the - binding is fully configured with a `from` and a `to`, it simply needs to be - connected to become active. This is done through the `connect()` method: - - ```javascript - binding.connect(this); - ``` - - Note that when you connect a binding you pass the object you want it to be - connected to. This object will be used as the root for both the from and - to side of the binding when inspecting relative paths. This allows the - binding to be automatically inherited by subclassed objects as well. - - This also allows you to bind between objects using the paths you declare in - `from` and `to`: - - ```javascript - // Example 1 - binding = Ember.Binding.from("App.someObject.value").to("value"); - binding.connect(this); - - // Example 2 - binding = Ember.Binding.from("parentView.value").to("App.someObject.value"); - binding.connect(this); - ``` - - Now that the binding is connected, it will observe both the from and to side - and relay changes. - - If you ever needed to do so (you almost never will, but it is useful to - understand this anyway), you could manually create an active binding by - using the `Ember.bind()` helper method. (This is the same method used by - to setup your bindings on objects): - - ```javascript - Ember.bind(MyApp.anotherObject, "value", "MyApp.someController.value"); - ``` - - Both of these code fragments have the same effect as doing the most friendly - form of binding creation like so: - - ```javascript - MyApp.anotherObject = Ember.Object.create({ - valueBinding: "MyApp.someController.value", - - // OTHER CODE FOR THIS OBJECT... - }); - ``` - - Ember's built in binding creation method makes it easy to automatically - create bindings for you. You should always use the highest-level APIs - available, even if you understand how it works underneath. - - @class Binding - @namespace Ember - @since Ember 0.9 - @public - */ - // Ember.Binding = Binding; ES6TODO: where to put this? - - /** - Global helper method to create a new binding. Just pass the root object - along with a `to` and `from` path to create and connect the binding. - - @method bind - @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 bind(obj, to, from) { - return new Binding(to, from).connect(obj); - } - - exports.Binding = Binding; -}); -enifed('ember-metal/cache', ['exports', 'ember-utils', 'ember-metal/meta'], function (exports, _emberUtils, _emberMetalMeta) { - 'use strict'; - - var Cache = (function () { - function Cache(limit, func, key, store) { - babelHelpers.classCallCheck(this, Cache); - - this.size = 0; - this.misses = 0; - this.hits = 0; - this.limit = limit; - this.func = func; - this.key = key; - this.store = store || new DefaultStore(); - } - - Cache.prototype.get = function get(obj) { - var key = this.key === undefined ? obj : this.key(obj); - var value = this.store.get(key); - if (value === undefined) { - this.misses++; - value = this._set(key, this.func(obj)); - } else if (value === _emberMetalMeta.UNDEFINED) { - this.hits++; - value = undefined; - } else { - this.hits++; - // nothing to translate - } - - return value; - }; - - Cache.prototype.set = function set(obj, value) { - var key = this.key === undefined ? obj : this.key(obj); - return this._set(key, value); - }; - - Cache.prototype._set = function _set(key, value) { - if (this.limit > this.size) { - this.size++; - if (value === undefined) { - this.store.set(key, _emberMetalMeta.UNDEFINED); - } else { - this.store.set(key, value); - } - } - - return value; - }; - - Cache.prototype.purge = function purge() { - this.store.clear(); - this.size = 0; - this.hits = 0; - this.misses = 0; - }; - - return Cache; - })(); - - exports.default = Cache; - - var DefaultStore = (function () { - function DefaultStore() { - babelHelpers.classCallCheck(this, DefaultStore); - - this.data = new _emberUtils.EmptyObject(); - } - - DefaultStore.prototype.get = function get(key) { - return this.data[key]; - }; - - DefaultStore.prototype.set = function set(key, value) { - this.data[key] = value; - }; - - DefaultStore.prototype.clear = function clear() { - this.data = new _emberUtils.EmptyObject(); - }; - - return DefaultStore; - })(); -}); -enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_get', 'ember-metal/meta', 'ember-metal/watch_key', 'ember-metal/watch_path'], function (exports, _emberUtils, _emberMetalProperty_get, _emberMetalMeta, _emberMetalWatch_key, _emberMetalWatch_path) { - 'use strict'; - - exports.finishChains = finishChains; - - var FIRST_KEY = /^([^\.]+)/; - - function firstKey(path) { - return path.match(FIRST_KEY)[0]; - } - - function isObject(obj) { - return typeof obj === 'object' && obj; - } - - function isVolatile(obj) { - return !(isObject(obj) && obj.isDescriptor && obj._volatile === false); - } - - function ChainWatchers() { - // chain nodes that reference a key in this obj by key - // we only create ChainWatchers when we are going to add them - // so create this upfront - this.chains = new _emberUtils.EmptyObject(); - } - - 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; i < nodes.length; 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; i < nodes.length; 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 object and path that - // will be/are invalidated by this key change, depending on - // 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; i < nodes.length; 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; i < affected.length; i += 2) { - var obj = affected[i]; - var path = affected[i + 1]; - callback(obj, path); - } - } - }; - - function makeChainWatcher() { - return new ChainWatchers(); - } - - function addChainWatcher(obj, keyName, node) { - var m = _emberMetalMeta.meta(obj); - m.writableChainWatchers(makeChainWatcher).add(keyName, node); - _emberMetalWatch_key.watchKey(obj, keyName, m); - } - - function removeChainWatcher(obj, keyName, node, _meta) { - if (!isObject(obj)) { - return; - } - - var meta = _meta || _emberMetalMeta.peekMeta(obj); - - if (!meta || !meta.readableChainWatchers()) { - return; - } - - // make meta writable - meta = _emberMetalMeta.meta(obj); - - meta.readableChainWatchers().remove(keyName, node); - - _emberMetalWatch_key.unwatchKey(obj, keyName, meta); - } - - // 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 - // pass null for parent and key and object for value. - function ChainNode(parent, key, value) { - this._parent = parent; - this._key = key; - - // _watching is true when calling get(this._parent, this._key) will - // return the value of this node. - // - // It is false for the root of a chain (because we have no parent) - // and for global paths (because the parent node is the object with - // the observer on it) - this._watching = value === undefined; - - this._chains = undefined; - this._object = undefined; - this.count = 0; - - this._value = value; - this._paths = {}; - if (this._watching) { - var obj = parent.value(); - - if (!isObject(obj)) { - return; - } - - this._object = obj; - - addChainWatcher(this._object, this._key, this); - } - } - - function lazyGet(obj, key) { - if (!isObject(obj)) { - return; - } - - var meta = _emberMetalMeta.peekMeta(obj); - - // check if object meant only to be a prototype - if (meta && meta.proto === obj) { - return; - } - - // Use `get` if the return value is an EachProxy or an uncacheable value. - if (isVolatile(obj[key])) { - return _emberMetalProperty_get.get(obj, key); - // Otherwise attempt to get the cached value of the computed property - } else { - var cache = meta.readableCache(); - if (cache && key in cache) { - return cache[key]; - } - } - } - - ChainNode.prototype = { - value: function () { - if (this._value === undefined && this._watching) { - var obj = this._parent.value(); - this._value = lazyGet(obj, this._key); - } - return this._value; - }, - - destroy: function () { - if (this._watching) { - var obj = this._object; - if (obj) { - removeChainWatcher(obj, this._key, this); - } - this._watching = false; // so future calls do nothing - } - }, - - // copies a top level object only - copy: function (obj) { - var ret = new ChainNode(null, null, obj); - var paths = this._paths; - var path = undefined; - - for (path in paths) { - // this check will also catch non-number vals. - if (paths[path] <= 0) { - continue; - } - ret.add(path); - } - return ret; - }, - - // called on the root node of a chain to setup watchers on the specified - // path. - add: function (path) { - var paths = this._paths; - paths[path] = (paths[path] || 0) + 1; - - var key = firstKey(path); - var tail = path.slice(key.length + 1); - - this.chain(key, tail); - }, - - // called on the root node of a chain to teardown watcher on the specified - // path - remove: function (path) { - var paths = this._paths; - if (paths[path] > 0) { - paths[path]--; - } - - var key = firstKey(path); - var tail = path.slice(key.length + 1); - - this.unchain(key, tail); - }, - - chain: function (key, path) { - var chains = this._chains; - var node = undefined; - if (chains === undefined) { - chains = this._chains = new _emberUtils.EmptyObject(); - } else { - node = chains[key]; - } - - if (node === undefined) { - node = chains[key] = new ChainNode(this, key, undefined); - } - - node.count++; // count chains... - - // chain rest of path if there is one - if (path) { - key = firstKey(path); - path = path.slice(key.length + 1); - node.chain(key, path); - } - }, - - unchain: function (key, path) { - var chains = this._chains; - var node = chains[key]; - - // unchain rest of path first... - if (path && path.length > 1) { - var nextKey = firstKey(path); - var nextPath = path.slice(nextKey.length + 1); - node.unchain(nextKey, nextPath); - } - - // delete node if needed. - node.count--; - if (node.count <= 0) { - chains[node._key] = undefined; - node.destroy(); - } - }, - - notify: function (revalidate, affected) { - if (revalidate && this._watching) { - var parentValue = this._parent.value(); - - if (parentValue !== this._object) { - if (this._object) { - removeChainWatcher(this._object, this._key, this); - } - - if (isObject(parentValue)) { - this._object = parentValue; - addChainWatcher(parentValue, this._key, this); - } else { - this._object = undefined; - } - } - this._value = undefined; - } - - // then notify chains... - var chains = this._chains; - var node = undefined; - if (chains) { - for (var key in chains) { - node = chains[key]; - if (node !== undefined) { - node.notify(revalidate, affected); - } - } - } - - if (affected && this._parent) { - this._parent.populateAffected(this._key, 1, affected); - } - }, - - populateAffected: function (path, depth, affected) { - if (this._key) { - path = this._key + '.' + path; - } - - if (this._parent) { - this._parent.populateAffected(path, depth + 1, affected); - } else { - if (depth > 1) { - affected.push(this.value(), path); - } - } - } - }; - - function finishChains(obj) { - // We only create meta if we really have to - var m = _emberMetalMeta.peekMeta(obj); - if (m) { - m = _emberMetalMeta.meta(obj); - - // finish any current chains node watchers that reference obj - var chainWatchers = m.readableChainWatchers(); - if (chainWatchers) { - chainWatchers.revalidateAll(); - } - // ensure that if we have inherited any chains they have been - // copied onto our own meta. - if (m.readableChains()) { - m.writableChains(_emberMetalWatch_path.makeChainNode); - } - } - } - - exports.removeChainWatcher = removeChainWatcher; - exports.ChainNode = ChainNode; -}); -enifed('ember-metal/computed', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/property_set', 'ember-metal/meta', 'ember-metal/expand_properties', 'ember-metal/error', 'ember-metal/properties', 'ember-metal/property_events', 'ember-metal/dependent_keys'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalProperty_set, _emberMetalMeta, _emberMetalExpand_properties, _emberMetalError, _emberMetalProperties, _emberMetalProperty_events, _emberMetalDependent_keys) { - 'use strict'; - - exports.default = computed; - - /** - @module ember - @submodule ember-metal - */ - - var DEEP_EACH_REGEX = /\.@each\.[^.]+\./; - - /** - A computed property transforms an object literal with object's accessor function(s) into a property. - - By default the function backing the computed property will only be called - once and the result will be cached. You can specify various properties - that your computed property depends on. This will force the cached - result to be recomputed if the dependencies are modified. - - In the following example we declare a computed property - `fullName` - by calling - `.Ember.computed()` with property dependencies (`firstName` and `lastName`) as leading arguments and getter accessor function. The `fullName` getter function - will be called once (regardless of how many times it is accessed) as long - as its dependencies have not changed. Once `firstName` or `lastName` are updated - any future calls (or anything bound) to `fullName` will incorporate the new - values. - - ```javascript - let Person = Ember.Object.extend({ - // these will be supplied by `create` - firstName: null, - lastName: null, - - fullName: Ember.computed('firstName', 'lastName', function() { - let firstName = this.get('firstName'), - lastName = this.get('lastName'); - - return firstName + ' ' + lastName; - }) - }); - - let tom = Person.create({ - firstName: 'Tom', - lastName: 'Dale' - }); - - tom.get('fullName') // 'Tom Dale' - ``` - - You can also define what Ember should do when setting a computed property by providing additional function (`set`) in hash argument. - If you try to set a computed property, it will try to invoke setter accessor function with the key and - value you want to set it to as arguments. - - ```javascript - let Person = Ember.Object.extend({ - // these will be supplied by `create` - firstName: null, - lastName: null, - - fullName: Ember.computed('firstName', 'lastName', { - get(key) { - let firstName = this.get('firstName'), - lastName = this.get('lastName'); - - return firstName + ' ' + lastName; - }, - set(key, value) { - let [firstName, lastName] = value.split(' '); - - this.set('firstName', firstName); - this.set('lastName', lastName); - - return value; - } - }) - }); - - let person = Person.create(); - - person.set('fullName', 'Peter Wagenet'); - person.get('firstName'); // 'Peter' - person.get('lastName'); // 'Wagenet' - ``` - - You can overwrite computed property with normal property (no longer computed), that won't change if dependencies change, if you set computed property and it won't have setter accessor function defined. - - You can also mark computed property as `.readOnly()` and block all attempts to set it. - - ```javascript - let Person = Ember.Object.extend({ - // these will be supplied by `create` - firstName: null, - lastName: null, - - fullName: Ember.computed('firstName', 'lastName', { - get(key) { - let firstName = this.get('firstName'); - let lastName = this.get('lastName'); - - return firstName + ' ' + lastName; - } - }).readOnly() - }); - - let person = Person.create(); - person.set('fullName', 'Peter Wagenet'); // Uncaught Error: Cannot set read-only property "fullName" on object: <(...):emberXXX> - ``` - - Additional resources: - - [New CP syntax RFC](https://github.com/emberjs/rfcs/blob/master/text/0011-improved-cp-syntax.md) - - [New computed syntax explained in "Ember 1.12 released" ](http://emberjs.com/blog/2015/05/13/ember-1-12-released.html#toc_new-computed-syntax) - - @class ComputedProperty - @namespace Ember - @public - */ - function ComputedProperty(config, opts) { - this.isDescriptor = true; - if (typeof config === 'function') { - this._getter = config; - } else { - _emberMetalDebug.assert('Ember.computed expects a function or an object as last argument.', typeof config === 'object' && !Array.isArray(config)); - _emberMetalDebug.assert('Config object passed to an Ember.computed can only contain `get` or `set` keys.', (function () { - var keys = Object.keys(config); - for (var i = 0; i < keys.length; i++) { - if (keys[i] !== 'get' && keys[i] !== 'set') { - return false; - } - } - return true; - })()); - this._getter = config.get; - this._setter = config.set; - } - _emberMetalDebug.assert('Computed properties must receive a getter or a setter, you passed none.', !!this._getter || !!this._setter); - this._dependentKeys = undefined; - this._suspended = undefined; - this._meta = undefined; - this._volatile = false; - this._dependentKeys = opts && opts.dependentKeys; - this._readOnly = false; - } - - ComputedProperty.prototype = new _emberMetalProperties.Descriptor(); - ComputedProperty.prototype.constructor = ComputedProperty; - - var ComputedPropertyPrototype = ComputedProperty.prototype; - - /** - Call on a computed property to set it into non-cached mode. When in this - mode the computed property will not automatically cache the return value. - - It also does not automatically fire any change events. You must manually notify - any changes if you want to observe this property. - - Dependency keys have no effect on volatile properties as they are for cache - invalidation and notification when cached value is invalidated. - - ```javascript - let outsideService = Ember.Object.extend({ - value: Ember.computed(function() { - return OutsideService.getValue(); - }).volatile() - }).create(); - ``` - - @method volatile - @return {Ember.ComputedProperty} this - @chainable - @public - */ - ComputedPropertyPrototype.volatile = function () { - this._volatile = true; - return this; - }; - - /** - Call on a computed property to set it into read-only mode. When in this - mode the computed property will throw an error when set. - - ```javascript - let Person = Ember.Object.extend({ - guid: Ember.computed(function() { - return 'guid-guid-guid'; - }).readOnly() - }); - - let person = Person.create(); - - person.set('guid', 'new-guid'); // will throw an exception - ``` - - @method readOnly - @return {Ember.ComputedProperty} this - @chainable - @public - */ - ComputedPropertyPrototype.readOnly = function () { - this._readOnly = true; - _emberMetalDebug.assert('Computed properties that define a setter using the new syntax cannot be read-only', !(this._readOnly && this._setter && this._setter !== this._getter)); - return this; - }; - - /** - Sets the dependent keys on this computed property. Pass any number of - arguments containing key paths that this computed property depends on. - - ```javascript - let President = Ember.Object.extend({ - fullName: Ember.computed(function() { - return this.get('firstName') + ' ' + this.get('lastName'); - - // Tell Ember that this computed property depends on firstName - // and lastName - }).property('firstName', 'lastName') - }); - - let president = President.create({ - firstName: 'Barack', - lastName: 'Obama' - }); - - president.get('fullName'); // 'Barack Obama' - ``` - - @method property - @param {String} path* zero or more property paths - @return {Ember.ComputedProperty} this - @chainable - @public - */ - ComputedPropertyPrototype.property = function () { - var args = []; - - function addArg(property) { - _emberMetalDebug.warn('Dependent keys containing @each only work one level deep. ' + ('You used the key "' + property + '" which is invalid. ') + 'Please create an intermediary computed property.', DEEP_EACH_REGEX.test(property) === false, { id: 'ember-metal.computed-deep-each' }); - args.push(property); - } - - for (var i = 0; i < arguments.length; i++) { - _emberMetalExpand_properties.default(arguments[i], addArg); - } - - this._dependentKeys = args; - return this; - }; - - /** - In some cases, you may want to annotate computed properties with additional - metadata about how they function or what values they operate on. For example, - computed property functions may close over variables that are then no longer - available for introspection. - - You can pass a hash of these values to a computed property like this: - - ``` - person: Ember.computed(function() { - let personId = this.get('personId'); - return App.Person.create({ id: personId }); - }).meta({ type: App.Person }) - ``` - - The hash that you pass to the `meta()` function will be saved on the - computed property descriptor under the `_meta` key. Ember runtime - exposes a public API for retrieving these values from classes, - via the `metaForProperty()` function. - - @method meta - @param {Object} meta - @chainable - @public - */ - ComputedPropertyPrototype.meta = function (meta) { - if (arguments.length === 0) { - return this._meta || {}; - } else { - this._meta = meta; - return this; - } - }; - - // invalidate cache when CP key changes - ComputedPropertyPrototype.didChange = function (obj, keyName) { - // _suspended is set via a CP.set to ensure we don't clear - // the cached value set by the setter - if (this._volatile || this._suspended === obj) { - return; - } - - // don't create objects just to invalidate - var meta = _emberMetalMeta.peekMeta(obj); - if (!meta || meta.source !== obj) { - return; - } - - var cache = meta.readableCache(); - if (cache && cache[keyName] !== undefined) { - cache[keyName] = undefined; - _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); - } - }; - - ComputedPropertyPrototype.get = function (obj, keyName) { - if (this._volatile) { - return this._getter.call(obj, keyName); - } - - var meta = _emberMetalMeta.meta(obj); - var cache = meta.writableCache(); - - var result = cache[keyName]; - if (result === _emberMetalMeta.UNDEFINED) { - return undefined; - } else if (result !== undefined) { - return result; - } - - var ret = this._getter.call(obj, keyName); - if (ret === undefined) { - cache[keyName] = _emberMetalMeta.UNDEFINED; - } else { - cache[keyName] = ret; - } - - var chainWatchers = meta.readableChainWatchers(); - if (chainWatchers) { - chainWatchers.revalidate(keyName); - } - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); - - return ret; - }; - - ComputedPropertyPrototype.set = function computedPropertySetEntry(obj, keyName, value) { - if (this._readOnly) { - this._throwReadOnlyError(obj, keyName); - } - - if (!this._setter) { - return this.clobberSet(obj, keyName, value); - } - - if (this._volatile) { - return this.volatileSet(obj, keyName, value); - } - - return this.setWithSuspend(obj, keyName, value); - }; - - ComputedPropertyPrototype._throwReadOnlyError = function computedPropertyThrowReadOnlyError(obj, keyName) { - throw new _emberMetalError.default('Cannot set read-only property "' + keyName + '" on object: ' + _emberUtils.inspect(obj)); - }; - - ComputedPropertyPrototype.clobberSet = function computedPropertyClobberSet(obj, keyName, value) { - var cachedValue = cacheFor(obj, keyName); - _emberMetalProperties.defineProperty(obj, keyName, null, cachedValue); - _emberMetalProperty_set.set(obj, keyName, value); - return value; - }; - - ComputedPropertyPrototype.volatileSet = function computedPropertyVolatileSet(obj, keyName, value) { - return this._setter.call(obj, keyName, value); - }; - - ComputedPropertyPrototype.setWithSuspend = function computedPropertySetWithSuspend(obj, keyName, value) { - var oldSuspended = this._suspended; - this._suspended = obj; - try { - return this._set(obj, keyName, value); - } finally { - this._suspended = oldSuspended; - } - }; - - ComputedPropertyPrototype._set = function computedPropertySet(obj, keyName, value) { - // cache requires own meta - var meta = _emberMetalMeta.meta(obj); - // either there is a writable cache or we need one to update - var cache = meta.writableCache(); - var hadCachedValue = false; - var cachedValue = undefined; - if (cache[keyName] !== undefined) { - if (cache[keyName] !== _emberMetalMeta.UNDEFINED) { - cachedValue = cache[keyName]; - } - hadCachedValue = true; - } - - var ret = this._setter.call(obj, keyName, value, cachedValue); - - // allows setter to return the same value that is cached already - if (hadCachedValue && cachedValue === ret) { - return ret; - } - - _emberMetalProperty_events.propertyWillChange(obj, keyName); - - if (hadCachedValue) { - cache[keyName] = undefined; - } - - if (!hadCachedValue) { - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); - } - - if (ret === undefined) { - cache[keyName] = _emberMetalMeta.UNDEFINED; - } else { - cache[keyName] = ret; - } - - _emberMetalProperty_events.propertyDidChange(obj, keyName); - - return ret; - }; - - /* called before property is overridden */ - ComputedPropertyPrototype.teardown = function (obj, keyName) { - if (this._volatile) { - return; - } - var meta = _emberMetalMeta.meta(obj); - var cache = meta.readableCache(); - if (cache && cache[keyName] !== undefined) { - _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); - cache[keyName] = undefined; - } - }; - - /** - This helper returns a new property descriptor that wraps the passed - computed property function. You can use this helper to define properties - with mixins or via `Ember.defineProperty()`. - - If you pass a function as an argument, it will be used as a getter. A computed - property defined in this way might look like this: - - ```js - let Person = Ember.Object.extend({ - init() { - this._super(...arguments); - - this.firstName = 'Betty'; - this.lastName = 'Jones'; - }, - - fullName: Ember.computed('firstName', 'lastName', function() { - return `${this.get('firstName')} ${this.get('lastName')}`; - }) - }); - - let client = Person.create(); - - client.get('fullName'); // 'Betty Jones' - - client.set('lastName', 'Fuller'); - client.get('fullName'); // 'Betty Fuller' - ``` - - You can pass a hash with two functions, `get` and `set`, as an - argument to provide both a getter and setter: - - ```js - let Person = Ember.Object.extend({ - init() { - this._super(...arguments); - - this.firstName = 'Betty'; - this.lastName = 'Jones'; - }, - - fullName: Ember.computed('firstName', 'lastName', { - get(key) { - return `${this.get('firstName')} ${this.get('lastName')}`; - }, - set(key, value) { - let [firstName, lastName] = value.split(/\s+/); - this.setProperties({ firstName, lastName }); - return value; - } - }); - }) - - let client = Person.create(); - client.get('firstName'); // 'Betty' - - client.set('fullName', 'Carroll Fuller'); - client.get('firstName'); // 'Carroll' - ``` - - The `set` function should accept two parameters, `key` and `value`. The value - returned from `set` will be the new value of the property. - - _Note: This is the preferred way to define computed properties when writing third-party - libraries that depend on or use Ember, since there is no guarantee that the user - will have [prototype Extensions](http://emberjs.com/guides/configuring-ember/disabling-prototype-extensions/) enabled._ - - The alternative syntax, with prototype extensions, might look like: - - ```js - fullName: function() { - return this.get('firstName') + ' ' + this.get('lastName'); - }.property('firstName', 'lastName') - ``` - - @class computed - @namespace Ember - @constructor - @static - @param {String} [dependentKeys*] Optional dependent keys that trigger this computed property. - @param {Function} func The computed property function. - @return {Ember.ComputedProperty} property descriptor instance - @public - */ - - function computed(func) { - var args = undefined; - - if (arguments.length > 1) { - args = [].slice.call(arguments); - func = args.pop(); - } - - var cp = new ComputedProperty(func); - - if (args) { - cp.property.apply(cp, args); - } - - return cp; - } - - /** - Returns the cached value for a property, if one exists. - This can be useful for peeking at the value of a computed - property that is generated lazily, without accidentally causing - it to be created. - - @method cacheFor - @for Ember - @param {Object} obj the object whose property you want to check - @param {String} key the name of the property whose cached value you want - to return - @return {Object} the cached value - @public - */ - function cacheFor(obj, key) { - var meta = _emberMetalMeta.peekMeta(obj); - var cache = meta && meta.source === obj && meta.readableCache(); - var ret = cache && cache[key]; - - if (ret === _emberMetalMeta.UNDEFINED) { - return undefined; - } - return ret; - } - - cacheFor.set = function (cache, key, value) { - if (value === undefined) { - cache[key] = _emberMetalMeta.UNDEFINED; - } else { - cache[key] = value; - } - }; - - cacheFor.get = function (cache, key) { - var ret = cache[key]; - if (ret === _emberMetalMeta.UNDEFINED) { - return undefined; - } - return ret; - }; - - cacheFor.remove = function (cache, key) { - cache[key] = undefined; - }; - - exports.ComputedProperty = ComputedProperty; - exports.computed = computed; - exports.cacheFor = cacheFor; -}); -enifed('ember-metal/core', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { - 'use strict'; - - /** - @module ember - @submodule ember-metal - */ - - /** - This namespace contains all Ember methods and functions. Future versions of - Ember may overwrite this namespace and therefore, you should avoid adding any - new properties. - - At the heart of Ember is Ember-Runtime, a set of core functions that provide - cross-platform compatibility and object property observing. Ember-Runtime is - small and performance-focused so you can use it alongside other - cross-platform libraries such as jQuery. For more details, see - [Ember-Runtime](http://emberjs.com/api/modules/ember-runtime.html). - - @class Ember - @static - @public - */ - var Ember = typeof _emberEnvironment.context.imports.Ember === 'object' && _emberEnvironment.context.imports.Ember || {}; - - // Make sure these are set whether Ember was already defined or not - Ember.isNamespace = true; - Ember.toString = function () { - return 'Ember'; - }; - - // .......................................................... - // BOOTSTRAP - // - - exports.default = Ember; -}); -enifed("ember-metal/debug", ["exports"], function (exports) { - "use strict"; - - exports.getDebugFunction = getDebugFunction; - exports.setDebugFunction = setDebugFunction; - exports.assert = assert; - exports.info = info; - exports.warn = warn; - exports.debug = debug; - exports.deprecate = deprecate; - exports.deprecateFunc = deprecateFunc; - exports.runInDebug = runInDebug; - exports.debugSeal = debugSeal; - exports.debugFreeze = debugFreeze; - var debugFunctions = { - assert: function () {}, - info: function () {}, - warn: function () {}, - debug: function () {}, - deprecate: function () {}, - deprecateFunc: function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return args[args.length - 1]; - }, - runInDebug: function () {}, - debugSeal: function () {}, - debugFreeze: function () {} - }; - - exports.debugFunctions = debugFunctions; - - function getDebugFunction(name) { - return debugFunctions[name]; - } - - function setDebugFunction(name, fn) { - debugFunctions[name] = fn; - } - - function assert() { - return debugFunctions.assert.apply(undefined, arguments); - } - - function info() { - return debugFunctions.info.apply(undefined, arguments); - } - - function warn() { - return debugFunctions.warn.apply(undefined, arguments); - } - - function debug() { - return debugFunctions.debug.apply(undefined, arguments); - } - - function deprecate() { - return debugFunctions.deprecate.apply(undefined, arguments); - } - - function deprecateFunc() { - return debugFunctions.deprecateFunc.apply(undefined, arguments); - } - - function runInDebug() { - return debugFunctions.runInDebug.apply(undefined, arguments); - } - - function debugSeal() { - return debugFunctions.debugSeal.apply(undefined, arguments); - } - - function debugFreeze() { - return debugFunctions.debugFreeze.apply(undefined, arguments); - } -}); -enifed('ember-metal/dependent_keys', ['exports', 'ember-metal/watching'], function (exports, _emberMetalWatching) { - 'no use strict'; - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - - exports.addDependentKeys = addDependentKeys; - exports.removeDependentKeys = removeDependentKeys; - - /** - @module ember - @submodule ember-metal - */ - - // .......................................................... - // DEPENDENT KEYS - // - - function addDependentKeys(desc, obj, keyName, meta) { - // the descriptor has a list of dependent keys, so - // add all of its dependent keys. - var idx = undefined, - depKey = undefined; - var depKeys = desc._dependentKeys; - if (!depKeys) { - return; - } - - for (idx = 0; idx < depKeys.length; idx++) { - depKey = depKeys[idx]; - // Increment the number of times depKey depends on keyName. - meta.writeDeps(depKey, keyName, (meta.peekDeps(depKey, keyName) || 0) + 1); - // Watch the depKey - _emberMetalWatching.watch(obj, depKey, meta); - } - } - - function removeDependentKeys(desc, obj, keyName, meta) { - // the descriptor has a list of dependent keys, so - // remove all of its dependent keys. - var depKeys = desc._dependentKeys; - if (!depKeys) { - return; - } - - for (var idx = 0; idx < depKeys.length; idx++) { - var depKey = depKeys[idx]; - // Decrement the number of times depKey depends on keyName. - meta.writeDeps(depKey, keyName, (meta.peekDeps(depKey, keyName) || 0) - 1); - // Unwatch the depKey - _emberMetalWatching.unwatch(obj, depKey, meta); - } - } -}); -enifed('ember-metal/deprecate_property', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set'], function (exports, _emberMetalDebug, _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. - - @method deprecateProperty - @param {Object} object The object to add the deprecated property to. - @param {String} deprecatedKey The property to add (and print deprecation warnings upon accessing). - @param {String} newKey The property that will be aliased. - @private - @since 1.7.0 - */ - - function deprecateProperty(object, deprecatedKey, newKey, options) { - function _deprecate() { - _emberMetalDebug.deprecate('Usage of `' + deprecatedKey + '` is deprecated, use `' + newKey + '` instead.', false, options); - } - - Object.defineProperty(object, deprecatedKey, { - configurable: true, - enumerable: false, - set: function (value) { - _deprecate(); - _emberMetalProperty_set.set(this, newKey, value); - }, - get: function () { - _deprecate(); - return _emberMetalProperty_get.get(this, newKey); - } - }); - } -}); -enifed('ember-metal/descriptor', ['exports', 'ember-metal/properties'], function (exports, _emberMetalProperties) { - 'use strict'; - - exports.default = descriptor; - - function descriptor(desc) { - return new Descriptor(desc); - } - - /** - A wrapper for a native ES5 descriptor. In an ideal world, we wouldn't need - this at all, however, the way we currently flatten/merge our mixins require - a special value to denote a descriptor. - - @class Descriptor - @private - */ - - var Descriptor = (function (_EmberDescriptor) { - babelHelpers.inherits(Descriptor, _EmberDescriptor); - - function Descriptor(desc) { - babelHelpers.classCallCheck(this, Descriptor); - - _EmberDescriptor.call(this); - this.desc = desc; - } - - Descriptor.prototype.setup = function setup(obj, key) { - Object.defineProperty(obj, key, this.desc); - }; - - Descriptor.prototype.teardown = function teardown(obj, key) {}; - - return Descriptor; - })(_emberMetalProperties.Descriptor); -}); -enifed("ember-metal/error", ["exports"], function (exports) { - - /** - A subclass of the JavaScript Error object for use in Ember. - - @class Error - @namespace Ember - @extends Error - @constructor - @public - */ - "use strict"; - - exports.default = EmberError; - - function EmberError(message) { - if (!(this instanceof EmberError)) { - return new EmberError(message); - } - - var error = Error.call(this, message); - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, EmberError); - } else { - this.stack = error.stack; - } - - this.description = error.description; - this.fileName = error.fileName; - this.lineNumber = error.lineNumber; - this.message = error.message; - this.name = error.name; - this.number = error.number; - this.code = error.code; - } - - EmberError.prototype = Object.create(Error.prototype); -}); -enifed('ember-metal/error_handler', ['exports', 'ember-console', 'ember-metal/testing'], function (exports, _emberConsole, _emberMetalTesting) { - 'use strict'; - - exports.getOnerror = getOnerror; - exports.setOnerror = setOnerror; - exports.dispatchError = dispatchError; - exports.setDispatchOverride = setDispatchOverride; - - // To maintain stacktrace consistency across browsers - var getStack = function (error) { - var stack = error.stack; - var message = error.message; - - if (stack && stack.indexOf(message) === -1) { - stack = message + '\n' + stack; - } - - return stack; - }; - - var onerror = undefined; - // Ember.onerror getter - - function getOnerror() { - return onerror; - } - - // Ember.onerror setter - - function setOnerror(handler) { - onerror = handler; - } - - var dispatchOverride = undefined; - // dispatch error - - function dispatchError(error) { - if (dispatchOverride) { - dispatchOverride(error); - } else { - defaultDispatch(error); - } - } - - // allows testing adapter to override dispatch - - function setDispatchOverride(handler) { - dispatchOverride = handler; - } - - function defaultDispatch(error) { - if (_emberMetalTesting.isTesting()) { - throw error; - } - if (onerror) { - onerror(error); - } else { - _emberConsole.default.error(getStack(error)); - } - } -}); -enifed('ember-metal/events', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/meta', 'ember-metal/meta_listeners'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalMeta, _emberMetalMeta_listeners) { - 'no use strict'; - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - - /** - @module ember - @submodule ember-metal - */ - exports.accumulateListeners = accumulateListeners; - exports.addListener = addListener; - exports.removeListener = removeListener; - exports.suspendListener = suspendListener; - exports.suspendListeners = suspendListeners; - exports.watchedEvents = watchedEvents; - exports.sendEvent = sendEvent; - exports.hasListeners = hasListeners; - exports.listenersFor = listenersFor; - exports.on = on; - - /* - The event system uses a series of nested hashes to store listeners on an - object. When a listener is registered, or when an event arrives, these - hashes are consulted to determine which target and action pair to invoke. - - The hashes are stored in the object's meta hash, and look like this: - - // Object's meta hash - { - listeners: { // variable name: `listenerSet` - "foo:changed": [ // variable name: `actions` - target, method, flags - ] - } - } - - */ - - function indexOf(array, target, method) { - var index = -1; - // hashes are added to the end of the event array - // so it makes sense to start searching at the end - // of the array and search in reverse - for (var i = array.length - 3; i >= 0; i -= 3) { - if (target === array[i] && method === array[i + 1]) { - index = i; - break; - } - } - return index; - } - - function accumulateListeners(obj, eventName, otherActions) { - var meta = _emberMetalMeta.peekMeta(obj); - if (!meta) { - return; - } - var actions = meta.matchingListeners(eventName); - var newActions = []; - - for (var i = actions.length - 3; i >= 0; i -= 3) { - var target = actions[i]; - var method = actions[i + 1]; - var flags = actions[i + 2]; - var actionIndex = indexOf(otherActions, target, method); - - if (actionIndex === -1) { - otherActions.push(target, method, flags); - newActions.push(target, method, flags); - } - } - - return newActions; - } - - /** - Add an event listener - - @method addListener - @for Ember - @param obj - @param {String} eventName - @param {Object|Function} target A target object or a function - @param {Function|String} method A function or the name of a function to be called on `target` - @param {Boolean} once A flag whether a function should only be called once - @public - */ - - function addListener(obj, eventName, target, method, once) { - _emberMetalDebug.assert('You must pass at least an object and event name to Ember.addListener', !!obj && !!eventName); - - _emberMetalDebug.deprecate('didInitAttrs called in ' + (obj && obj.toString && obj.toString()) + '.', eventName !== 'didInitAttrs', { - id: 'ember-views.did-init-attrs', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x#toc_ember-component-didinitattrs' - }); - - if (!method && 'function' === typeof target) { - method = target; - target = null; - } - - var flags = 0; - if (once) { - flags |= _emberMetalMeta_listeners.ONCE; - } - - _emberMetalMeta.meta(obj).addToListeners(eventName, target, method, flags); - - if ('function' === typeof obj.didAddListener) { - obj.didAddListener(eventName, target, method); - } - } - - /** - Remove an event listener - - Arguments should match those passed to `Ember.addListener`. - - @method removeListener - @for Ember - @param obj - @param {String} eventName - @param {Object|Function} target A target object or a function - @param {Function|String} method A function or the name of a function to be called on `target` - @public - */ - - function removeListener(obj, eventName, target, method) { - _emberMetalDebug.assert('You must pass at least an object and event name to Ember.removeListener', !!obj && !!eventName); - - if (!method && 'function' === typeof target) { - method = target; - target = null; - } - - _emberMetalMeta.meta(obj).removeFromListeners(eventName, target, method, function () { - if ('function' === typeof obj.didRemoveListener) { - obj.didRemoveListener.apply(obj, arguments); - } - }); - } - - /** - Suspend listener during callback. - - This should only be used by the target of the event listener - when it is taking an action that would cause the event, e.g. - an object might suspend its property change listener while it is - setting that property. - - @method suspendListener - @for Ember - - @private - @param obj - @param {String} eventName - @param {Object|Function} target A target object or a function - @param {Function|String} method A function or the name of a function to be called on `target` - @param {Function} callback - */ - - function suspendListener(obj, eventName, target, method, callback) { - return suspendListeners(obj, [eventName], target, method, callback); - } - - /** - Suspends multiple listeners during a callback. - - @method suspendListeners - @for Ember - - @private - @param obj - @param {Array} eventNames Array of event names - @param {Object|Function} target A target object or a function - @param {Function|String} method A function or the name of a function to be called on `target` - @param {Function} callback - */ - - function suspendListeners(obj, eventNames, target, method, callback) { - if (!method && 'function' === typeof target) { - method = target; - target = null; - } - return _emberMetalMeta.meta(obj).suspendListeners(eventNames, target, method, callback); - } - - /** - Return a list of currently watched events - - @private - @method watchedEvents - @for Ember - @param obj - */ - - function watchedEvents(obj) { - return _emberMetalMeta.meta(obj).watchedEvents(); - } - - /** - Send an event. The execution of suspended listeners - is skipped, and once listeners are removed. A listener without - a target is executed on the passed object. If an array of actions - is not passed, the actions stored on the passed object are invoked. - - @method sendEvent - @for Ember - @param obj - @param {String} eventName - @param {Array} params Optional parameters for each listener. - @param {Array} actions Optional array of actions (listeners). - @return true - @public - */ - - function sendEvent(obj, eventName, params, actions) { - if (!actions) { - var meta = _emberMetalMeta.peekMeta(obj); - actions = meta && meta.matchingListeners(eventName); - } - - if (!actions || actions.length === 0) { - return; - } - - for (var i = actions.length - 3; i >= 0; i -= 3) { - // looping in reverse for once listeners - var target = actions[i]; - var method = actions[i + 1]; - var flags = actions[i + 2]; - - if (!method) { - continue; - } - if (flags & _emberMetalMeta_listeners.SUSPENDED) { - continue; - } - if (flags & _emberMetalMeta_listeners.ONCE) { - removeListener(obj, eventName, target, method); - } - if (!target) { - target = obj; - } - if ('string' === typeof method) { - if (params) { - _emberUtils.applyStr(target, method, params); - } else { - target[method](); - } - } else { - if (params) { - method.apply(target, params); - } else { - method.call(target); - } - } - } - return true; - } - - /** - @private - @method hasListeners - @for Ember - @param obj - @param {String} eventName - */ - - function hasListeners(obj, eventName) { - var meta = _emberMetalMeta.peekMeta(obj); - if (!meta) { - return false; - } - return meta.matchingListeners(eventName).length > 0; - } - - /** - @private - @method listenersFor - @for Ember - @param obj - @param {String} eventName - */ - - function listenersFor(obj, eventName) { - var ret = []; - var meta = _emberMetalMeta.peekMeta(obj); - var actions = meta && meta.matchingListeners(eventName); - - if (!actions) { - return ret; - } - - for (var i = 0; i < actions.length; i += 3) { - var target = actions[i]; - var method = actions[i + 1]; - ret.push([target, method]); - } - - return ret; - } - - /** - Define a property as a function that should be executed when - a specified event or events are triggered. - - - ``` javascript - let Job = Ember.Object.extend({ - logCompleted: Ember.on('completed', function() { - console.log('Job completed!'); - }) - }); - - let job = Job.create(); - - Ember.sendEvent(job, 'completed'); // Logs 'Job completed!' - ``` - - @method on - @for Ember - @param {String} eventNames* - @param {Function} func - @return func - @public - */ - - function on() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - var func = args.pop(); - var events = args; - func.__ember_listens__ = events; - return func; - } -}); -enifed('ember-metal/expand_properties', ['exports', 'ember-metal/debug'], function (exports, _emberMetalDebug) { - 'use strict'; - - exports.default = expandProperties; - - /** - @module ember - @submodule ember-metal - */ - - var SPLIT_REGEX = /\{|\}/; - var END_WITH_EACH_REGEX = /\.@each$/; - - /** - Expands `pattern`, invoking `callback` for each expansion. - - The only pattern supported is brace-expansion, anything else will be passed - once to `callback` directly. - - Example - - ```js - function echo(arg){ console.log(arg); } - - 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}.[]', 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 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. - */ - - function expandProperties(pattern, callback) { - _emberMetalDebug.assert('A computed property key must be a string', typeof pattern === 'string'); - _emberMetalDebug.assert('Brace expanded properties cannot contain spaces, e.g. "user.{firstName, lastName}" should be "user.{firstName,lastName}"', pattern.indexOf(' ') === -1); - _emberMetalDebug.assert('Brace expanded properties have to be balanced and cannot be nested, pattern: ' + pattern, (function (str) { - var inBrace = 0; - var char = undefined; - for (var i = 0; i < str.length; i++) { - char = str.charAt(i); - - if (char === '{') { - inBrace++; - } else if (char === '}') { - inBrace--; - } - - if (inBrace > 1 || inBrace < 0) { - return false; - } - } - - return true; - })(pattern)); - - var parts = pattern.split(SPLIT_REGEX); - var properties = [parts]; - - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; - if (part.indexOf(',') >= 0) { - properties = duplicateAndReplace(properties, part.split(','), i); - } - } - - for (var i = 0; i < properties.length; i++) { - callback(properties[i].join('').replace(END_WITH_EACH_REGEX, '.[]')); - } - } - - function duplicateAndReplace(properties, currentParts, index) { - var all = []; - - properties.forEach(function (property) { - currentParts.forEach(function (part) { - var current = property.slice(0); - current[index] = part; - all.push(current); - }); - }); - - return all; - } -}); -enifed('ember-metal/features', ['exports', 'ember-utils', 'ember-environment', 'ember/features'], function (exports, _emberUtils, _emberEnvironment, _emberFeatures) { - 'use strict'; - - exports.default = isEnabled; - - /** - The hash of enabled Canary features. Add to this, any canary features - before creating your application. - - Alternatively (and recommended), you can also define `EmberENV.FEATURES` - if you need to enable features flagged at runtime. - - @class FEATURES - @namespace Ember - @static - @since 1.1.0 - @public - */ - var FEATURES = _emberUtils.assign(_emberFeatures.default, _emberEnvironment.ENV.FEATURES); - - exports.FEATURES = FEATURES; - /** - Determine whether the specified `feature` is enabled. Used by Ember's - build tools to exclude experimental features from beta/stable builds. - - You can define the following configuration options: - - * `EmberENV.ENABLE_OPTIONAL_FEATURES` - enable any features that have not been explicitly - enabled/disabled. - - @method isEnabled - @param {String} feature The feature to check - @return {Boolean} - @for Ember.FEATURES - @since 1.1.0 - @public - */ - - function isEnabled(feature) { - var featureValue = FEATURES[feature]; - - if (featureValue === true || featureValue === false || featureValue === undefined) { - return featureValue; - } else if (_emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES) { - return true; - } else { - return false; - } - } - - exports.DEFAULT_FEATURES = _emberFeatures.default; -}); -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: - - ```javascript - Ember.getProperties(record, 'firstName', 'lastName', 'zipCode'); - // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } - ``` - - is equivalent to: - - ```javascript - Ember.getProperties(record, ['firstName', 'lastName', 'zipCode']); - // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } - ``` - - @method getProperties - @for Ember - @param {Object} obj - @param {String...|Array} list of keys to get - @return {Object} - @public - */ - - function getProperties(obj) { - var ret = {}; - var propertyNames = arguments; - var i = 1; - - if (arguments.length === 2 && Array.isArray(arguments[1])) { - i = 0; - propertyNames = arguments[1]; - } - for (; i < propertyNames.length; i++) { - ret[propertyNames[i]] = _emberMetalProperty_get.get(obj, propertyNames[i]); - } - return ret; - } -}); -enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/merge', 'ember-metal/debug', 'ember-metal/instrumentation', 'ember-metal/testing', 'ember-metal/error_handler', 'ember-metal/meta', 'ember-metal/error', 'ember-metal/cache', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/weak_map', 'ember-metal/events', 'ember-metal/is_none', 'ember-metal/is_empty', 'ember-metal/is_blank', 'ember-metal/is_present', 'ember-metal/run_loop', 'ember-metal/observer_set', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/watch_key', 'ember-metal/chains', 'ember-metal/watch_path', 'ember-metal/watching', 'ember-metal/libraries', 'ember-metal/map', 'ember-metal/get_properties', 'ember-metal/set_properties', 'ember-metal/expand_properties', 'ember-metal/observer', 'ember-metal/mixin', 'ember-metal/binding', 'ember-metal/path_cache', 'ember-metal/injected_property', 'ember-metal/tags', 'ember-metal/replace', 'ember-metal/transaction', 'ember-metal/is_proxy', 'ember-metal/descriptor'], function (exports, _require, _emberMetalCore, _emberMetalComputed, _emberMetalAlias, _emberMetalMerge, _emberMetalDebug, _emberMetalInstrumentation, _emberMetalTesting, _emberMetalError_handler, _emberMetalMeta, _emberMetalError, _emberMetalCache, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalWeak_map, _emberMetalEvents, _emberMetalIs_none, _emberMetalIs_empty, _emberMetalIs_blank, _emberMetalIs_present, _emberMetalRun_loop, _emberMetalObserver_set, _emberMetalProperty_events, _emberMetalProperties, _emberMetalWatch_key, _emberMetalChains, _emberMetalWatch_path, _emberMetalWatching, _emberMetalLibraries, _emberMetalMap, _emberMetalGet_properties, _emberMetalSet_properties, _emberMetalExpand_properties, _emberMetalObserver, _emberMetalMixin, _emberMetalBinding, _emberMetalPath_cache, _emberMetalInjected_property, _emberMetalTags, _emberMetalReplace, _emberMetalTransaction, _emberMetalIs_proxy, _emberMetalDescriptor) { - /** - @module ember - @submodule ember-metal - */ - - 'use strict'; - - exports.default = _emberMetalCore.default; - // reexports - exports.computed = _emberMetalComputed.default; - exports.cacheFor = _emberMetalComputed.cacheFor; - exports.ComputedProperty = _emberMetalComputed.ComputedProperty; - exports.alias = _emberMetalAlias.default; - exports.merge = _emberMetalMerge.default; - exports.assert = _emberMetalDebug.assert; - exports.info = _emberMetalDebug.info; - exports.warn = _emberMetalDebug.warn; - exports.debug = _emberMetalDebug.debug; - exports.deprecate = _emberMetalDebug.deprecate; - exports.deprecateFunc = _emberMetalDebug.deprecateFunc; - exports.runInDebug = _emberMetalDebug.runInDebug; - exports.setDebugFunction = _emberMetalDebug.setDebugFunction; - exports.getDebugFunction = _emberMetalDebug.getDebugFunction; - exports.debugSeal = _emberMetalDebug.debugSeal; - exports.debugFreeze = _emberMetalDebug.debugFreeze; - exports.instrument = _emberMetalInstrumentation.instrument; - exports.flaggedInstrument = _emberMetalInstrumentation.flaggedInstrument; - exports._instrumentStart = _emberMetalInstrumentation._instrumentStart; - exports.instrumentationReset = _emberMetalInstrumentation.reset; - exports.instrumentationSubscribe = _emberMetalInstrumentation.subscribe; - exports.instrumentationUnsubscribe = _emberMetalInstrumentation.unsubscribe; - exports.isTesting = _emberMetalTesting.isTesting; - exports.setTesting = _emberMetalTesting.setTesting; - exports.getOnerror = _emberMetalError_handler.getOnerror; - exports.setOnerror = _emberMetalError_handler.setOnerror; - exports.dispatchError = _emberMetalError_handler.dispatchError; - exports.setDispatchOverride = _emberMetalError_handler.setDispatchOverride; - exports.META_DESC = _emberMetalMeta.META_DESC; - exports.meta = _emberMetalMeta.meta; - exports.peekMeta = _emberMetalMeta.peekMeta; - exports.Error = _emberMetalError.default; - exports.Cache = _emberMetalCache.default; - exports.isFeatureEnabled = _emberMetalFeatures.default; - exports.FEATURES = _emberMetalFeatures.FEATURES; - exports.DEFAULT_FEATURES = _emberMetalFeatures.DEFAULT_FEATURES; - exports._getPath = _emberMetalProperty_get._getPath; - exports.get = _emberMetalProperty_get.get; - exports.getWithDefault = _emberMetalProperty_get.getWithDefault; - exports.set = _emberMetalProperty_set.set; - exports.trySet = _emberMetalProperty_set.trySet; - exports.WeakMap = _emberMetalWeak_map.default; - exports.accumulateListeners = _emberMetalEvents.accumulateListeners; - exports.addListener = _emberMetalEvents.addListener; - exports.hasListeners = _emberMetalEvents.hasListeners; - exports.listenersFor = _emberMetalEvents.listenersFor; - exports.on = _emberMetalEvents.on; - exports.removeListener = _emberMetalEvents.removeListener; - exports.sendEvent = _emberMetalEvents.sendEvent; - exports.suspendListener = _emberMetalEvents.suspendListener; - exports.suspendListeners = _emberMetalEvents.suspendListeners; - exports.watchedEvents = _emberMetalEvents.watchedEvents; - exports.isNone = _emberMetalIs_none.default; - exports.isEmpty = _emberMetalIs_empty.default; - exports.isBlank = _emberMetalIs_blank.default; - exports.isPresent = _emberMetalIs_present.default; - exports.run = _emberMetalRun_loop.default; - exports.ObserverSet = _emberMetalObserver_set.default; - exports.beginPropertyChanges = _emberMetalProperty_events.beginPropertyChanges; - exports.changeProperties = _emberMetalProperty_events.changeProperties; - exports.endPropertyChanges = _emberMetalProperty_events.endPropertyChanges; - exports.overrideChains = _emberMetalProperty_events.overrideChains; - exports.propertyDidChange = _emberMetalProperty_events.propertyDidChange; - exports.propertyWillChange = _emberMetalProperty_events.propertyWillChange; - exports.PROPERTY_DID_CHANGE = _emberMetalProperty_events.PROPERTY_DID_CHANGE; - exports.defineProperty = _emberMetalProperties.defineProperty; - exports.Descriptor = _emberMetalProperties.Descriptor; - exports.watchKey = _emberMetalWatch_key.watchKey; - exports.unwatchKey = _emberMetalWatch_key.unwatchKey; - exports.ChainNode = _emberMetalChains.ChainNode; - exports.finishChains = _emberMetalChains.finishChains; - exports.removeChainWatcher = _emberMetalChains.removeChainWatcher; - exports.watchPath = _emberMetalWatch_path.watchPath; - exports.unwatchPath = _emberMetalWatch_path.unwatchPath; - exports.destroy = _emberMetalWatching.destroy; - exports.isWatching = _emberMetalWatching.isWatching; - exports.unwatch = _emberMetalWatching.unwatch; - exports.watch = _emberMetalWatching.watch; - exports.watcherCount = _emberMetalWatching.watcherCount; - exports.libraries = _emberMetalLibraries.default; - exports.Map = _emberMetalMap.Map; - exports.MapWithDefault = _emberMetalMap.MapWithDefault; - exports.OrderedSet = _emberMetalMap.OrderedSet; - exports.getProperties = _emberMetalGet_properties.default; - exports.setProperties = _emberMetalSet_properties.default; - exports.expandProperties = _emberMetalExpand_properties.default; - exports._suspendObserver = _emberMetalObserver._suspendObserver; - exports._suspendObservers = _emberMetalObserver._suspendObservers; - exports.addObserver = _emberMetalObserver.addObserver; - exports.observersFor = _emberMetalObserver.observersFor; - exports.removeObserver = _emberMetalObserver.removeObserver; - exports._addBeforeObserver = _emberMetalObserver._addBeforeObserver; - exports._removeBeforeObserver = _emberMetalObserver._removeBeforeObserver; - exports.NAME_KEY = _emberMetalMixin.NAME_KEY; - exports.Mixin = _emberMetalMixin.Mixin; - exports.aliasMethod = _emberMetalMixin.aliasMethod; - exports._immediateObserver = _emberMetalMixin._immediateObserver; - exports._beforeObserver = _emberMetalMixin._beforeObserver; - exports.mixin = _emberMetalMixin.mixin; - exports.observer = _emberMetalMixin.observer; - exports.required = _emberMetalMixin.required; - exports.REQUIRED = _emberMetalMixin.REQUIRED; - exports.hasUnprocessedMixins = _emberMetalMixin.hasUnprocessedMixins; - exports.clearUnprocessedMixins = _emberMetalMixin.clearUnprocessedMixins; - exports.detectBinding = _emberMetalMixin.detectBinding; - exports.Binding = _emberMetalBinding.Binding; - exports.bind = _emberMetalBinding.bind; - exports.isGlobalPath = _emberMetalPath_cache.isGlobalPath; - exports.InjectedProperty = _emberMetalInjected_property.default; - exports.setHasViews = _emberMetalTags.setHasViews; - exports.tagForProperty = _emberMetalTags.tagForProperty; - exports.tagFor = _emberMetalTags.tagFor; - exports.markObjectAsDirty = _emberMetalTags.markObjectAsDirty; - exports.replace = _emberMetalReplace.default; - exports.runInTransaction = _emberMetalTransaction.default; - exports.didRender = _emberMetalTransaction.didRender; - exports.assertNotRendered = _emberMetalTransaction.assertNotRendered; - exports.isProxy = _emberMetalIs_proxy.isProxy; - exports.descriptor = _emberMetalDescriptor.default; - - // TODO: this needs to be deleted once we refactor the build tooling - // do this for side-effects of updating Ember.assert, warn, etc when - // ember-debug is present - // This needs to be called before any deprecateFunc - - if (_require.has('ember-debug')) { - _require.default('ember-debug'); - } -}); -enifed('ember-metal/injected_property', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/properties'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalComputed, _emberMetalAlias, _emberMetalProperties) { - 'use strict'; - - exports.default = InjectedProperty; - - /** - Read-only property that returns the result of a container lookup. - - @class InjectedProperty - @namespace Ember - @constructor - @param {String} type The container type the property will lookup - @param {String} name (optional) The name the property will lookup, defaults - to the property's name - @private - */ - - function InjectedProperty(type, name) { - this.type = type; - this.name = name; - - this._super$Constructor(injectedPropertyGet); - AliasedPropertyPrototype.oneWay.call(this); - } - - function injectedPropertyGet(keyName) { - var desc = this[keyName]; - var owner = _emberUtils.getOwner(this) || this.container; // fallback to `container` for backwards compat - - _emberMetalDebug.assert('InjectedProperties should be defined with the Ember.inject computed property macros.', desc && desc.isDescriptor && desc.type); - _emberMetalDebug.assert('Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container.', owner); - - return owner.lookup(desc.type + ':' + (desc.name || keyName)); - } - - InjectedProperty.prototype = Object.create(_emberMetalProperties.Descriptor.prototype); - - var InjectedPropertyPrototype = InjectedProperty.prototype; - var ComputedPropertyPrototype = _emberMetalComputed.ComputedProperty.prototype; - var AliasedPropertyPrototype = _emberMetalAlias.AliasedProperty.prototype; - - InjectedPropertyPrototype._super$Constructor = _emberMetalComputed.ComputedProperty; - - InjectedPropertyPrototype.get = ComputedPropertyPrototype.get; - InjectedPropertyPrototype.readOnly = ComputedPropertyPrototype.readOnly; - InjectedPropertyPrototype.teardown = ComputedPropertyPrototype.teardown; -}); -enifed('ember-metal/instrumentation', ['exports', 'ember-environment', 'ember-metal/features'], function (exports, _emberEnvironment, _emberMetalFeatures) { - 'use strict'; - - exports.instrument = instrument; - exports._instrumentStart = _instrumentStart; - exports.subscribe = subscribe; - exports.unsubscribe = unsubscribe; - exports.reset = reset; - - /** - The purpose of the Ember Instrumentation module is - to provide efficient, general-purpose instrumentation - for Ember. - - Subscribe to a listener by using `Ember.subscribe`: - - ```javascript - Ember.subscribe("render", { - before(name, timestamp, payload) { - - }, - - after(name, timestamp, payload) { - - } - }); - ``` - - If you return a value from the `before` callback, that same - value will be passed as a fourth parameter to the `after` - callback. - - Instrument a block of code by using `Ember.instrument`: - - ```javascript - Ember.instrument("render.handlebars", payload, function() { - // rendering logic - }, binding); - ``` - - Event names passed to `Ember.instrument` are namespaced - by periods, from more general to more specific. Subscribers - can listen for events by whatever level of granularity they - are interested in. - - In the above example, the event is `render.handlebars`, - and the subscriber listened for all events beginning with - `render`. It would receive callbacks for events named - `render`, `render.handlebars`, `render.container`, or - even `render.handlebars.layout`. - - @class Instrumentation - @namespace Ember - @static - @private - */ - var subscribers = []; - exports.subscribers = subscribers; - var cache = {}; - - function populateListeners(name) { - var listeners = []; - var subscriber = undefined; - - for (var i = 0; i < subscribers.length; i++) { - subscriber = subscribers[i]; - if (subscriber.regex.test(name)) { - listeners.push(subscriber.object); - } - } - - cache[name] = listeners; - return listeners; - } - - var time = (function () { - var perf = 'undefined' !== typeof window ? window.performance || {} : {}; - var fn = perf.now || perf.mozNow || perf.webkitNow || perf.msNow || perf.oNow; - // fn.bind will be available in all the browsers that support the advanced window.performance... ;-) - return fn ? fn.bind(perf) : function () { - return +new Date(); - }; - })(); - - /** - Notifies event's subscribers, calls `before` and `after` hooks. - - @method instrument - @namespace Ember.Instrumentation - - @param {String} [name] Namespaced event name. - @param {Object} _payload - @param {Function} callback Function that you're instrumenting. - @param {Object} binding Context that instrument function is called with. - @private - */ - - function instrument(name, _payload, callback, binding) { - if (arguments.length <= 3 && typeof _payload === 'function') { - binding = callback; - callback = _payload; - _payload = undefined; - } - if (subscribers.length === 0) { - return callback.call(binding); - } - var payload = _payload || {}; - var finalizer = _instrumentStart(name, function () { - return payload; - }); - - if (finalizer) { - return withFinalizer(callback, finalizer, payload, binding); - } else { - return callback.call(binding); - } - } - - var flaggedInstrument = undefined; - 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 { - result = callback.call(binding); - } catch (e) { - payload.exception = e; - result = payload; - } finally { - finalizer(); - return result; - } - } - - function NOOP() {} - - // private for now - - function _instrumentStart(name, _payload, _payloadParam) { - if (subscribers.length === 0) { - return NOOP; - } - - var listeners = cache[name]; - - if (!listeners) { - listeners = populateListeners(name); - } - - if (listeners.length === 0) { - return NOOP; - } - - var payload = _payload(_payloadParam); - - var STRUCTURED_PROFILE = _emberEnvironment.ENV.STRUCTURED_PROFILE; - var timeName = undefined; - if (STRUCTURED_PROFILE) { - timeName = name + ': ' + payload.object; - console.time(timeName); - } - - var beforeValues = new Array(listeners.length); - var i = undefined, - listener = undefined; - var timestamp = time(); - for (i = 0; i < listeners.length; i++) { - listener = listeners[i]; - beforeValues[i] = listener.before(name, timestamp, payload); - } - - return function _instrumentEnd() { - var i = undefined, - listener = undefined; - var timestamp = time(); - for (i = 0; i < listeners.length; i++) { - listener = listeners[i]; - if (typeof listener.after === 'function') { - listener.after(name, timestamp, payload, beforeValues[i]); - } - } - - if (STRUCTURED_PROFILE) { - console.timeEnd(timeName); - } - }; - } - - /** - Subscribes to a particular event or instrumented block of code. - - @method subscribe - @namespace Ember.Instrumentation - - @param {String} [pattern] Namespaced event name. - @param {Object} [object] Before and After hooks. - - @return {Subscriber} - @private - */ - - function subscribe(pattern, object) { - var paths = pattern.split('.'); - var path = undefined; - var regex = []; - - for (var i = 0; i < paths.length; i++) { - path = paths[i]; - if (path === '*') { - regex.push('[^\\.]*'); - } else { - regex.push(path); - } - } - - regex = regex.join('\\.'); - regex = regex + '(\\..*)?'; - - var subscriber = { - pattern: pattern, - regex: new RegExp('^' + regex + '$'), - object: object - }; - - subscribers.push(subscriber); - cache = {}; - - return subscriber; - } - - /** - Unsubscribes from a particular event or instrumented block of code. - - @method unsubscribe - @namespace Ember.Instrumentation - - @param {Object} [subscriber] - @private - */ - - function unsubscribe(subscriber) { - var index = undefined; - - for (var i = 0; i < subscribers.length; i++) { - if (subscribers[i] === subscriber) { - index = i; - } - } - - subscribers.splice(index, 1); - cache = {}; - } - - /** - Resets `Ember.Instrumentation` by flushing list of subscribers. - - @method reset - @namespace Ember.Instrumentation - @private - */ - - function reset() { - 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. - - ```javascript - Ember.isBlank(); // true - Ember.isBlank(null); // true - Ember.isBlank(undefined); // true - Ember.isBlank(''); // true - Ember.isBlank([]); // true - Ember.isBlank('\n\t'); // true - Ember.isBlank(' '); // true - Ember.isBlank({}); // false - Ember.isBlank('\n\t Hello'); // false - Ember.isBlank('Hello world'); // false - Ember.isBlank([1,2,3]); // false - ``` - - @method isBlank - @for Ember - @param {Object} obj Value to test - @return {Boolean} - @since 1.5.0 - @public - */ - - 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'; - - exports.default = isEmpty; - - /** - Verifies that a value is `null` or an empty string, empty array, - or empty function. - - Constrains the rules on `Ember.isNone` by returning true for empty - string and empty arrays. - - ```javascript - Ember.isEmpty(); // true - Ember.isEmpty(null); // true - Ember.isEmpty(undefined); // true - Ember.isEmpty(''); // true - Ember.isEmpty([]); // true - Ember.isEmpty({}); // false - Ember.isEmpty('Adam Hawkins'); // false - Ember.isEmpty([0,1,2]); // false - Ember.isEmpty('\n\t'); // false - Ember.isEmpty(' '); // false - ``` - - @method isEmpty - @for Ember - @param {Object} obj Value to test - @return {Boolean} - @public - */ - - function isEmpty(obj) { - var none = _emberMetalIs_none.default(obj); - if (none) { - return none; - } - - if (typeof obj.size === 'number') { - return !obj.size; - } - - var objectType = typeof obj; - - if (objectType === 'object') { - var size = _emberMetalProperty_get.get(obj, 'size'); - if (typeof size === 'number') { - return !size; - } - } - - if (typeof obj.length === 'number' && objectType !== 'function') { - return !obj.length; - } - - if (objectType === 'object') { - var _length = _emberMetalProperty_get.get(obj, 'length'); - if (typeof _length === 'number') { - return !_length; - } - } - - return false; - } -}); -enifed("ember-metal/is_none", ["exports"], function (exports) { - /** - Returns true if the passed value is null or undefined. This avoids errors - from JSLint complaining about use of ==, which can be technically - confusing. - - ```javascript - Ember.isNone(); // true - Ember.isNone(null); // true - Ember.isNone(undefined); // true - Ember.isNone(''); // false - Ember.isNone([]); // false - Ember.isNone(function() {}); // false - ``` - - @method isNone - @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`. - - ```javascript - Ember.isPresent(); // false - Ember.isPresent(null); // false - Ember.isPresent(undefined); // false - Ember.isPresent(''); // false - Ember.isPresent(' '); // false - Ember.isPresent('\n\t'); // false - Ember.isPresent([]); // false - Ember.isPresent({ length: 0 }) // false - Ember.isPresent(false); // true - Ember.isPresent(true); // true - Ember.isPresent('string'); // true - Ember.isPresent(0); // true - Ember.isPresent(function() {}) // true - Ember.isPresent({}); // true - Ember.isPresent(false); // true - Ember.isPresent('\n\t Hello'); // true - Ember.isPresent([1,2,3]); // true - ``` - - @method isPresent - @for Ember - @param {Object} obj Value to test - @return {Boolean} - @since 1.8.0 - @public - */ - - function isPresent(obj) { - return !_emberMetalIs_blank.default(obj); - } -}); -enifed('ember-metal/is_proxy', ['exports', 'ember-metal/meta'], function (exports, _emberMetalMeta) { - 'use strict'; - - exports.isProxy = isProxy; - - function isProxy(value) { - if (typeof value === 'object' && value) { - var meta = _emberMetalMeta.peekMeta(value); - return meta && meta.isProxy(); - } - - return false; - } -}); -enifed('ember-metal/libraries', ['exports', 'ember-metal/debug', 'ember-metal/features'], function (exports, _emberMetalDebug, _emberMetalFeatures) { - 'use strict'; - - exports.Libraries = Libraries; - - /** - Helper class that allows you to register your library with Ember. - - Singleton created at `Ember.libraries`. - - @class Libraries - @constructor - @private - */ - - function Libraries() { - this._registry = []; - this._coreLibIndex = 0; - } - - Libraries.prototype = { - constructor: Libraries, - - _getLibraryByName: function (name) { - var libs = this._registry; - var count = libs.length; - - for (var i = 0; i < count; i++) { - if (libs[i].name === name) { - return libs[i]; - } - } - }, - - register: function (name, version, isCoreLibrary) { - var index = this._registry.length; - - if (!this._getLibraryByName(name)) { - if (isCoreLibrary) { - index = this._coreLibIndex++; - } - this._registry.splice(index, 0, { name: name, version: version }); - } else { - _emberMetalDebug.warn('Library "' + name + '" is already registered with Ember.', false, { id: 'ember-metal.libraries-register' }); - } - }, - - registerCoreLibrary: function (name, version) { - this.register(name, version, true); - }, - - deRegister: function (name) { - var lib = this._getLibraryByName(name); - var index = undefined; - - if (lib) { - index = this._registry.indexOf(lib); - 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-utils'], function (exports, _emberUtils) { - /** - @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) { - throw new TypeError('Constructor ' + name + ' requires \'new\''); - } - - function copyNull(obj) { - var output = new _emberUtils.EmptyObject(); - - for (var prop in obj) { - // hasOwnPropery is not needed because obj is new EmptyObject(); - output[prop] = obj[prop]; - } - - return output; - } - - function copyMap(original, newObject) { - var keys = original._keys.copy(); - var values = copyNull(original._values); - - newObject._keys = keys; - newObject._values = values; - newObject.size = original.size; - - return newObject; - } - - /** - This class is used internally by Ember and Ember Data. - Please do not use it at this time. We plan to clean it up - and add many tests soon. - - @class OrderedSet - @namespace Ember - @constructor - @private - */ - function OrderedSet() { - if (this instanceof OrderedSet) { - this.clear(); - this._silenceRemoveDeprecation = false; - } else { - missingNew('OrderedSet'); - } - } - - /** - @method create - @static - @return {Ember.OrderedSet} - @private - */ - OrderedSet.create = function () { - var Constructor = this; - - return new Constructor(); - }; - - OrderedSet.prototype = { - constructor: OrderedSet, - /** - @method clear - @private - */ - clear: function () { - this.presenceSet = new _emberUtils.EmptyObject(); - this.list = []; - this.size = 0; - }, - - /** - @method add - @param obj - @param guid (optional, and for internal use) - @return {Ember.OrderedSet} - @private - */ - add: function (obj, _guid) { - var guid = _guid || _emberUtils.guidFor(obj); - var presenceSet = this.presenceSet; - var list = this.list; - - if (presenceSet[guid] !== true) { - presenceSet[guid] = true; - this.size = list.push(obj); - } - - return this; - }, - - /** - @since 1.8.0 - @method delete - @param obj - @param _guid (optional and for internal use only) - @return {Boolean} - @private - */ - delete: function (obj, _guid) { - var guid = _guid || _emberUtils.guidFor(obj); - var presenceSet = this.presenceSet; - var list = this.list; - - if (presenceSet[guid] === true) { - delete presenceSet[guid]; - var index = list.indexOf(obj); - if (index > -1) { - list.splice(index, 1); - } - this.size = list.length; - return true; - } else { - return false; - } - }, - - /** - @method isEmpty - @return {Boolean} - @private - */ - isEmpty: function () { - return this.size === 0; - }, - - /** - @method has - @param obj - @return {Boolean} - @private - */ - has: function (obj) { - if (this.size === 0) { - return false; - } - - var guid = _emberUtils.guidFor(obj); - var presenceSet = this.presenceSet; - - return presenceSet[guid] === true; - }, - - /** - @method forEach - @param {Function} fn - @param self - @private - */ - forEach: function (fn /*, ...thisArg*/) { - if (typeof fn !== 'function') { - missingFunction(fn); - } - - if (this.size === 0) { - return; - } - - var list = this.list; - - if (arguments.length === 2) { - for (var i = 0; i < list.length; i++) { - fn.call(arguments[1], list[i]); - } - } else { - for (var i = 0; i < list.length; i++) { - fn(list[i]); - } - } - }, - - /** - @method toArray - @return {Array} - @private - */ - toArray: function () { - return this.list.slice(); - }, - - /** - @method copy - @return {Ember.OrderedSet} - @private - */ - copy: function () { - var Constructor = this.constructor; - var set = new Constructor(); - - set._silenceRemoveDeprecation = this._silenceRemoveDeprecation; - set.presenceSet = copyNull(this.presenceSet); - set.list = this.toArray(); - set.size = this.size; - - return set; - } - }; - - /** - A Map stores values indexed by keys. Unlike JavaScript's - default Objects, the keys of a Map can be any JavaScript - object. - - Internally, a Map has two data structures: - - 1. `keys`: an OrderedSet of all of the existing keys - 2. `values`: a JavaScript Object indexed by the `Ember.guidFor(key)` - - When a key/value pair is added for the first time, we - add the key to the `keys` OrderedSet, and create or - replace an entry in `values`. When an entry is deleted, - we delete its entry in `keys` and `values`. - - @class Map - @namespace Ember - @private - @constructor - */ - function Map() { - if (this instanceof Map) { - this._keys = OrderedSet.create(); - this._keys._silenceRemoveDeprecation = true; - this._values = new _emberUtils.EmptyObject(); - this.size = 0; - } else { - missingNew('Map'); - } - } - - /** - @method create - @static - @private - */ - Map.create = function () { - var Constructor = this; - return new Constructor(); - }; - - Map.prototype = { - constructor: Map, - - /** - This property will change as the number of objects in the map changes. - @since 1.8.0 - @property size - @type number - @default 0 - @private - */ - size: 0, - - /** - Retrieve the value associated with a given key. - @method get - @param {*} key - @return {*} the value associated with the key, or `undefined` - @private - */ - get: function (key) { - if (this.size === 0) { - return; - } - - var values = this._values; - var guid = _emberUtils.guidFor(key); - - return values[guid]; - }, - - /** - Adds a value to the map. If a value for the given key has already been - provided, the new value will replace the old value. - @method set - @param {*} key - @param {*} value - @return {Ember.Map} - @private - */ - set: function (key, value) { - var keys = this._keys; - var values = this._values; - var guid = _emberUtils.guidFor(key); - - // ensure we don't store -0 - var k = key === -0 ? 0 : key; - - keys.add(k, guid); - - values[guid] = value; - - this.size = keys.size; - - return this; - }, - - /** - Removes a value from the map for an associated key. - @since 1.8.0 - @method delete - @param {*} key - @return {Boolean} true if an item was removed, false otherwise - @private - */ - delete: function (key) { - if (this.size === 0) { - return false; - } - // don't use ES6 "delete" because it will be annoying - // to use in browsers that are not ES6 friendly; - var keys = this._keys; - var values = this._values; - var guid = _emberUtils.guidFor(key); - - if (keys.delete(key, guid)) { - delete values[guid]; - this.size = keys.size; - return true; - } else { - return false; - } - }, - - /** - Check whether a key is present. - @method has - @param {*} key - @return {Boolean} true if the item was present, false otherwise - @private - */ - has: function (key) { - return this._keys.has(key); - }, - - /** - Iterate over all the keys and values. Calls the function once - for each key, passing in value, key, and the map being iterated over, - in that order. - The keys are guaranteed to be iterated over in insertion order. - @method forEach - @param {Function} callback - @param {*} self if passed, the `this` value inside the - callback. By default, `this` is the map. - @private - */ - forEach: function (callback /*, ...thisArg*/) { - if (typeof callback !== 'function') { - missingFunction(callback); - } - - if (this.size === 0) { - return; - } - - var map = this; - var cb = undefined, - thisArg = undefined; - - if (arguments.length === 2) { - thisArg = arguments[1]; - cb = function (key) { - return callback.call(thisArg, map.get(key), key, map); - }; - } else { - cb = function (key) { - return callback(map.get(key), key, map); - }; - } - - this._keys.forEach(cb); - }, - - /** - @method clear - @private - */ - clear: function () { - this._keys.clear(); - this._values = new _emberUtils.EmptyObject(); - this.size = 0; - }, - - /** - @method copy - @return {Ember.Map} - @private - */ - copy: function () { - return copyMap(this, new Map()); - } - }; - - /** - @class MapWithDefault - @namespace Ember - @extends Ember.Map - @private - @constructor - @param [options] - @param {*} [options.defaultValue] - */ - function MapWithDefault(options) { - this._super$constructor(); - this.defaultValue = options.defaultValue; - } - - /** - @method create - @static - @param [options] - @param {*} [options.defaultValue] - @return {Ember.MapWithDefault|Ember.Map} If options are passed, returns - `Ember.MapWithDefault` otherwise returns `Ember.Map` - @private - */ - MapWithDefault.create = function (options) { - if (options) { - return new MapWithDefault(options); - } else { - return new Map(); - } - }; - - MapWithDefault.prototype = Object.create(Map.prototype); - MapWithDefault.prototype.constructor = MapWithDefault; - MapWithDefault.prototype._super$constructor = Map; - MapWithDefault.prototype._super$get = Map.prototype.get; - - /** - Retrieve the value associated with a given key. - - @method get - @param {*} key - @return {*} the value associated with the key, or the default value - @private - */ - MapWithDefault.prototype.get = function (key) { - var hasValue = this.has(key); - - if (hasValue) { - return this._super$get(key); - } else { - var defaultValue = this.defaultValue(key); - this.set(key, defaultValue); - return defaultValue; - } - }; - - /** - @method copy - @return {Ember.MapWithDefault} - @private - */ - MapWithDefault.prototype.copy = function () { - var Constructor = this.constructor; - return copyMap(this, new Constructor({ - defaultValue: this.defaultValue - })); - }; - - exports.default = Map; - exports.OrderedSet = OrderedSet; - exports.Map = Map; - exports.MapWithDefault = MapWithDefault; -}); -enifed('ember-metal/merge', ['exports'], function (exports) { - /** - Merge the contents of two objects together into the first object. - - ```javascript - Ember.merge({ first: 'Tom' }, { last: 'Dale' }); // { first: 'Tom', last: 'Dale' } - var a = { first: 'Yehuda' }; - var b = { last: 'Katz' }; - Ember.merge(a, b); // a == { first: 'Yehuda', last: 'Katz' }, b == { last: 'Katz' } - ``` - - @method merge - @for Ember - @param {Object} original The object to merge into - @param {Object} updates The object to copy properties from - @return {Object} - @public - */ - 'use strict'; - - exports.default = merge; - - function merge(original, updates) { - if (!updates || typeof updates !== 'object') { - return original; - } - - var props = Object.keys(updates); - var prop = undefined; - - for (var i = 0; i < props.length; i++) { - prop = props[i]; - original[prop] = updates[prop]; - } - - return original; - } -}); -enifed('ember-metal/meta', ['exports', 'ember-utils', 'ember-metal/features', 'ember-metal/meta_listeners', 'ember-metal/debug', 'ember-metal/chains'], function (exports, _emberUtils, _emberMetalFeatures, _emberMetalMeta_listeners, _emberMetalDebug, _emberMetalChains) { - 'no use strict'; - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - - exports.Meta = Meta; - exports.deleteMeta = deleteMeta; - exports.meta = meta; - - var counters = { - peekCalls: 0, - peekParentCalls: 0, - peekPrototypeWalks: 0, - setCalls: 0, - deleteCalls: 0, - metaCalls: 0, - metaInstantiated: 0 - }; - - /** - @module ember-metal - */ - - /* - This declares several meta-programmed members on the Meta class. Such - meta! - - In general, the `readable` variants will give you an object (if it - already exists) that you can read but should not modify. The - `writable` variants will give you a mutable object, and they will - create it if it didn't already exist. - - The following methods will get generated metaprogrammatically, and - I'm including them here for greppability: - - writableCache, readableCache, writeWatching, - peekWatching, clearWatching, writeMixins, - peekMixins, clearMixins, writeBindings, - peekBindings, clearBindings, writeValues, - peekValues, clearValues, writeDeps, forEachInDeps - writableChainWatchers, readableChainWatchers, writableChains, - readableChains, writableTag, readableTag, writableTags, - readableTags - */ - var members = { - cache: ownMap, - weak: ownMap, - watching: inheritedMap, - mixins: inheritedMap, - bindings: inheritedMap, - values: inheritedMap, - chainWatchers: ownCustomObject, - chains: inheritedCustomObject, - tag: ownCustomObject, - tags: ownMap - }; - - // FLAGS - var SOURCE_DESTROYING = 1 << 1; - var SOURCE_DESTROYED = 1 << 2; - var META_DESTROYED = 1 << 3; - var IS_PROXY = 1 << 4; - - if (true || true) { - members.lastRendered = ownMap; - members.lastRenderedFrom = ownMap; // FIXME: not used in production, remove me from prod builds - } - - var memberNames = Object.keys(members); - var META_FIELD = '__ember_meta__'; - - function Meta(obj, parentMeta) { - _emberMetalDebug.runInDebug(function () { - return counters.metaInstantiated++; - }); - - this._cache = undefined; - this._weak = undefined; - this._watching = undefined; - this._mixins = undefined; - this._bindings = undefined; - this._values = undefined; - this._deps = undefined; - this._chainWatchers = undefined; - this._chains = undefined; - this._tag = undefined; - this._tags = undefined; - - // initial value for all flags right now is false - // see FLAGS const for detailed list of flags used - this._flags = 0; - - // used only internally - this.source = obj; - - // when meta(obj).proto === obj, the object is intended to be only a - // prototype and doesn't need to actually be observable itself - this.proto = undefined; - - // The next meta in our inheritance chain. We (will) track this - // explicitly instead of using prototypical inheritance because we - // have detailed knowledge of how each property should really be - // inherited, and we can optimize it much better than JS runtimes. - this.parent = parentMeta; - - if (true || true) { - this._lastRendered = undefined; - this._lastRenderedFrom = undefined; // FIXME: not used in production, remove me from prod builds - } - - this._initializeListeners(); - } - - Meta.prototype.isInitialized = function (obj) { - return this.proto !== obj; - }; - - var NODE_STACK = []; - - Meta.prototype.destroy = function () { - if (this.isMetaDestroyed()) { - return; - } - - // remove chainWatchers to remove circular references that would prevent GC - var node = undefined, - nodes = undefined, - key = undefined, - nodeObject = undefined; - node = this.readableChains(); - if (node) { - NODE_STACK.push(node); - // process tree - while (NODE_STACK.length > 0) { - node = NODE_STACK.pop(); - // push children - nodes = node._chains; - if (nodes) { - for (key in nodes) { - if (nodes[key] !== undefined) { - NODE_STACK.push(nodes[key]); - } - } - } - - // remove chainWatcher in node object - if (node._watching) { - nodeObject = node._object; - if (nodeObject) { - var foreignMeta = peekMeta(nodeObject); - // avoid cleaning up chain watchers when both current and - // foreign objects are being destroyed - // if both are being destroyed manual cleanup is not needed - // as they will be GC'ed and no non-destroyed references will - // be remaining - if (foreignMeta && !foreignMeta.isSourceDestroying()) { - _emberMetalChains.removeChainWatcher(nodeObject, node._key, node, foreignMeta); - } - } - } - } - } - - this.setMetaDestroyed(); - }; - - for (var _name in _emberMetalMeta_listeners.protoMethods) { - Meta.prototype[_name] = _emberMetalMeta_listeners.protoMethods[_name]; - } - memberNames.forEach(function (name) { - return members[name](name, Meta); - }); - - Meta.prototype.isSourceDestroying = function isSourceDestroying() { - return (this._flags & SOURCE_DESTROYING) !== 0; - }; - - Meta.prototype.setSourceDestroying = function setSourceDestroying() { - this._flags |= SOURCE_DESTROYING; - }; - - Meta.prototype.isSourceDestroyed = function isSourceDestroyed() { - return (this._flags & SOURCE_DESTROYED) !== 0; - }; - - Meta.prototype.setSourceDestroyed = function setSourceDestroyed() { - this._flags |= SOURCE_DESTROYED; - }; - - Meta.prototype.isMetaDestroyed = function isMetaDestroyed() { - return (this._flags & META_DESTROYED) !== 0; - }; - - Meta.prototype.setMetaDestroyed = function setMetaDestroyed() { - this._flags |= META_DESTROYED; - }; - - Meta.prototype.isProxy = function isProxy() { - return (this._flags & IS_PROXY) !== 0; - }; - - Meta.prototype.setProxy = function setProxy() { - this._flags |= IS_PROXY; - }; - - // Implements a member that is a lazily created, non-inheritable - // POJO. - function ownMap(name, Meta) { - var key = memberProperty(name); - var capitalized = capitalize(name); - Meta.prototype['writable' + capitalized] = function () { - return this._getOrCreateOwnMap(key); - }; - Meta.prototype['readable' + capitalized] = function () { - return this[key]; - }; - } - - Meta.prototype._getOrCreateOwnMap = function (key) { - var ret = this[key]; - if (!ret) { - ret = this[key] = new _emberUtils.EmptyObject(); - } - return ret; - }; - - // Implements a member that is a lazily created POJO with inheritable - // values. - function inheritedMap(name, Meta) { - var key = memberProperty(name); - var capitalized = capitalize(name); - - Meta.prototype['write' + capitalized] = function (subkey, value) { - _emberMetalDebug.assert('Cannot call write' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); - - var map = this._getOrCreateOwnMap(key); - map[subkey] = value; - }; - - Meta.prototype['peek' + capitalized] = function (subkey) { - return this._findInherited(key, subkey); - }; - - Meta.prototype['forEach' + capitalized] = function (fn) { - var pointer = this; - var seen = new _emberUtils.EmptyObject(); - while (pointer !== undefined) { - var map = pointer[key]; - if (map) { - for (var _key in map) { - if (!seen[_key]) { - seen[_key] = true; - fn(_key, map[_key]); - } - } - } - pointer = pointer.parent; - } - }; - - Meta.prototype['clear' + capitalized] = function () { - _emberMetalDebug.assert('Cannot call clear' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); - - this[key] = undefined; - }; - - Meta.prototype['deleteFrom' + capitalized] = function (subkey) { - delete this._getOrCreateOwnMap(key)[subkey]; - }; - - Meta.prototype['hasIn' + capitalized] = function (subkey) { - return this._findInherited(key, subkey) !== undefined; - }; - } - - Meta.prototype._getInherited = function (key) { - var pointer = this; - while (pointer !== undefined) { - if (pointer[key]) { - return pointer[key]; - } - pointer = pointer.parent; - } - }; - - Meta.prototype._findInherited = function (key, subkey) { - var pointer = this; - while (pointer !== undefined) { - var map = pointer[key]; - if (map) { - var value = map[subkey]; - if (value !== undefined) { - return value; - } - } - pointer = pointer.parent; - } - }; - - var UNDEFINED = _emberUtils.symbol('undefined'); - - exports.UNDEFINED = UNDEFINED; - // Implements a member that provides a lazily created map of maps, - // with inheritance at both levels. - Meta.prototype.writeDeps = function writeDeps(subkey, itemkey, value) { - _emberMetalDebug.assert('Cannot call writeDeps after the object is destroyed.', !this.isMetaDestroyed()); - - var outerMap = this._getOrCreateOwnMap('_deps'); - var innerMap = outerMap[subkey]; - if (!innerMap) { - innerMap = outerMap[subkey] = new _emberUtils.EmptyObject(); - } - innerMap[itemkey] = value; - }; - - Meta.prototype.peekDeps = function peekDeps(subkey, itemkey) { - var pointer = this; - while (pointer !== undefined) { - var map = pointer._deps; - if (map) { - var value = map[subkey]; - if (value) { - if (value[itemkey] !== undefined) { - return value[itemkey]; - } - } - } - pointer = pointer.parent; - } - }; - - Meta.prototype.hasDeps = function hasDeps(subkey) { - var pointer = this; - while (pointer !== undefined) { - if (pointer._deps && pointer._deps[subkey]) { - return true; - } - pointer = pointer.parent; - } - return false; - }; - - Meta.prototype.forEachInDeps = function forEachInDeps(subkey, fn) { - return this._forEachIn('_deps', subkey, fn); - }; - - Meta.prototype._forEachIn = function (key, subkey, fn) { - var pointer = this; - var seen = new _emberUtils.EmptyObject(); - var calls = []; - while (pointer !== undefined) { - var map = pointer[key]; - if (map) { - var innerMap = map[subkey]; - if (innerMap) { - for (var innerKey in innerMap) { - if (!seen[innerKey]) { - seen[innerKey] = true; - calls.push([innerKey, innerMap[innerKey]]); - } - } - } - } - pointer = pointer.parent; - } - for (var i = 0; i < calls.length; i++) { - var _calls$i = calls[i]; - var innerKey = _calls$i[0]; - var value = _calls$i[1]; - - fn(innerKey, value); - } - }; - - // Implements a member that provides a non-heritable, lazily-created - // object using the method you provide. - function ownCustomObject(name, Meta) { - var key = memberProperty(name); - var capitalized = capitalize(name); - Meta.prototype['writable' + capitalized] = function (create) { - _emberMetalDebug.assert('Cannot call writable' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); - - var ret = this[key]; - if (!ret) { - ret = this[key] = create(this.source); - } - return ret; - }; - Meta.prototype['readable' + capitalized] = function () { - return this[key]; - }; - } - - // Implements a member that provides an inheritable, lazily-created - // object using the method you provide. We will derived children from - // their parents by calling your object's `copy()` method. - function inheritedCustomObject(name, Meta) { - var key = memberProperty(name); - var capitalized = capitalize(name); - Meta.prototype['writable' + capitalized] = function (create) { - _emberMetalDebug.assert('Cannot call writable' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); - - var ret = this[key]; - if (!ret) { - if (this.parent) { - ret = this[key] = this.parent['writable' + capitalized](create).copy(this.source); - } else { - ret = this[key] = create(this.source); - } - } - return ret; - }; - Meta.prototype['readable' + capitalized] = function () { - return this._getInherited(key); - }; - } - - function memberProperty(name) { - return '_' + name; - } - - // there's a more general-purpose capitalize in ember-runtime, but we - // don't want to make ember-metal depend on ember-runtime. - function capitalize(name) { - return name.replace(/^\w/, function (m) { - return m.toUpperCase(); - }); - } - - var META_DESC = { - writable: true, - configurable: true, - enumerable: false, - value: null - }; - - exports.META_DESC = META_DESC; - var EMBER_META_PROPERTY = { - name: META_FIELD, - descriptor: META_DESC - }; - - if (true) { - 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 = _emberUtils.lookupDescriptor(obj, key); - var isMandatorySetter = descriptor && descriptor.set && descriptor.set.isMandatorySetter; - - if (isMandatorySetter) { - this.writeValues(key, value); - } else { - obj[key] = value; - } - }; - } - - var HAS_NATIVE_WEAKMAP = (function () { - // detect if `WeakMap` is even present - var hasWeakMap = typeof WeakMap === 'function'; - if (!hasWeakMap) { - return false; - } - - var instance = new WeakMap(); - // use `Object`'s `.toString` directly to prevent us from detecting - // polyfills as native weakmaps - return Object.prototype.toString.call(instance) === '[object WeakMap]'; - })(); - - var setMeta = undefined, - peekMeta = undefined; - - // choose the one appropriate for given platform - if (HAS_NATIVE_WEAKMAP) { - (function () { - var getPrototypeOf = Object.getPrototypeOf; - var metaStore = new WeakMap(); - - exports.setMeta = setMeta = function WeakMap_setMeta(obj, meta) { - _emberMetalDebug.runInDebug(function () { - return counters.setCalls++; - }); - metaStore.set(obj, meta); - }; - - exports.peekMeta = peekMeta = function WeakMap_peekMeta(obj) { - _emberMetalDebug.runInDebug(function () { - return counters.peekCalls++; - }); - - return metaStore.get(obj); - }; - - exports.peekMeta = peekMeta = function WeakMap_peekParentMeta(obj) { - var pointer = obj; - var meta = undefined; - while (pointer) { - meta = metaStore.get(pointer); - // jshint loopfunc:true - _emberMetalDebug.runInDebug(function () { - return counters.peekCalls++; - }); - // stop if we find a `null` value, since - // that means the meta was deleted - // any other truthy value is a "real" meta - if (meta === null || meta) { - return meta; - } - - pointer = getPrototypeOf(pointer); - _emberMetalDebug.runInDebug(function () { - return counters.peakPrototypeWalks++; - }); - } - }; - })(); - } else { - exports.setMeta = setMeta = function Fallback_setMeta(obj, meta) { - // if `null` already, just set it to the new value - // otherwise define property first - if (obj[META_FIELD] !== null) { - if (obj.__defineNonEnumerable) { - obj.__defineNonEnumerable(EMBER_META_PROPERTY); - } else { - Object.defineProperty(obj, META_FIELD, META_DESC); - } - } - - obj[META_FIELD] = meta; - }; - - exports.peekMeta = peekMeta = function Fallback_peekMeta(obj) { - return obj[META_FIELD]; - }; - } - - function deleteMeta(obj) { - _emberMetalDebug.runInDebug(function () { - return counters.deleteCalls++; - }); - - var meta = peekMeta(obj); - if (meta) { - meta.destroy(); - } - } - - /** - Retrieves the meta hash for an object. If `writable` is true ensures the - hash is writable for this object as well. - - The meta object contains information about computed property descriptors as - well as any watched properties and other information. You generally will - not access this information directly but instead work with higher level - methods that manipulate this hash indirectly. - - @method meta - @for Ember - @private - - @param {Object} obj The object to retrieve meta for - @param {Boolean} [writable=true] Pass `false` if you do not intend to modify - the meta hash, allowing the method to avoid making an unnecessary copy. - @return {Object} the meta hash for an object - */ - - function meta(obj) { - _emberMetalDebug.runInDebug(function () { - return counters.metaCalls++; - }); - - var maybeMeta = peekMeta(obj); - var parent = undefined; - - // remove this code, in-favor of explicit parent - if (maybeMeta) { - if (maybeMeta.source === obj) { - return maybeMeta; - } - parent = maybeMeta; - } - - var newMeta = new Meta(obj, parent); - setMeta(obj, newMeta); - return newMeta; - } - - exports.peekMeta = peekMeta; - exports.setMeta = setMeta; - exports.counters = counters; -}); -enifed('ember-metal/meta_listeners', ['exports'], function (exports) { - /* - When we render a rich template hierarchy, the set of events that - *might* happen tends to be much larger than the set of events that - actually happen. This implies that we should make listener creation & - destruction cheap, even at the cost of making event dispatch more - expensive. - - Thus we store a new listener with a single push and no new - allocations, without even bothering to do deduplication -- we can - save that for dispatch time, if an event actually happens. - */ - - /* listener flags */ - 'use strict'; - - var ONCE = 1; - exports.ONCE = ONCE; - var SUSPENDED = 2; - - exports.SUSPENDED = SUSPENDED; - var protoMethods = { - - addToListeners: function (eventName, target, method, flags) { - if (!this._listeners) { - this._listeners = []; - } - this._listeners.push(eventName, target, method, flags); - }, - - _finalizeListeners: function () { - if (this._listenersFinalized) { - return; - } - if (!this._listeners) { - this._listeners = []; - } - var pointer = this.parent; - while (pointer) { - var listeners = pointer._listeners; - if (listeners) { - this._listeners = this._listeners.concat(listeners); - } - if (pointer._listenersFinalized) { - break; - } - pointer = pointer.parent; - } - this._listenersFinalized = true; - }, - - removeFromListeners: function (eventName, target, method, didRemove) { - var pointer = this; - while (pointer) { - var listeners = pointer._listeners; - if (listeners) { - for (var index = listeners.length - 4; index >= 0; index -= 4) { - if (listeners[index] === eventName && (!method || listeners[index + 1] === target && listeners[index + 2] === method)) { - if (pointer === this) { - // we are modifying our own list, so we edit directly - if (typeof didRemove === 'function') { - didRemove(eventName, target, listeners[index + 2]); - } - listeners.splice(index, 4); - } else { - // we are trying to remove an inherited listener, so we do - // just-in-time copying to detach our own listeners from - // our inheritance chain. - this._finalizeListeners(); - return this.removeFromListeners(eventName, target, method); - } - } - } - } - if (pointer._listenersFinalized) { - break; - } - pointer = pointer.parent; - } - }, - - matchingListeners: function (eventName) { - var pointer = this; - var result = []; - while (pointer) { - var listeners = pointer._listeners; - if (listeners) { - for (var index = 0; index < listeners.length - 3; index += 4) { - if (listeners[index] === eventName) { - pushUniqueListener(result, listeners, index); - } - } - } - if (pointer._listenersFinalized) { - break; - } - pointer = pointer.parent; - } - var sus = this._suspendedListeners; - if (sus) { - for (var susIndex = 0; susIndex < sus.length - 2; susIndex += 3) { - if (eventName === sus[susIndex]) { - for (var resultIndex = 0; resultIndex < result.length - 2; resultIndex += 3) { - if (result[resultIndex] === sus[susIndex + 1] && result[resultIndex + 1] === sus[susIndex + 2]) { - result[resultIndex + 2] |= SUSPENDED; - } - } - } - } - } - return result; - }, - - suspendListeners: function (eventNames, target, method, callback) { - var sus = this._suspendedListeners; - if (!sus) { - sus = this._suspendedListeners = []; - } - for (var i = 0; i < eventNames.length; i++) { - sus.push(eventNames[i], target, method); - } - try { - return callback.call(target); - } finally { - if (sus.length === eventNames.length) { - this._suspendedListeners = undefined; - } else { - for (var i = sus.length - 3; i >= 0; i -= 3) { - if (sus[i + 1] === target && sus[i + 2] === method && eventNames.indexOf(sus[i]) !== -1) { - sus.splice(i, 3); - } - } - } - } - }, - - watchedEvents: function () { - var pointer = this; - var names = {}; - while (pointer) { - var listeners = pointer._listeners; - if (listeners) { - for (var index = 0; index < listeners.length - 3; index += 4) { - names[listeners[index]] = true; - } - } - if (pointer._listenersFinalized) { - break; - } - pointer = pointer.parent; - } - return Object.keys(names); - }, - - _initializeListeners: function () { - this._listeners = undefined; - this._listenersFinalized = undefined; - this._suspendedListeners = undefined; - } - }; - - exports.protoMethods = protoMethods; - function pushUniqueListener(destination, source, index) { - var target = source[index + 1]; - var method = source[index + 2]; - for (var destinationIndex = 0; destinationIndex < destination.length - 2; destinationIndex += 3) { - if (destination[destinationIndex] === target && destination[destinationIndex + 1] === method) { - return; - } - } - destination.push(target, method, source[index + 3]); - } -}); -enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'ember-metal/debug', 'ember-metal/meta', 'ember-metal/expand_properties', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/binding', 'ember-metal/observer', 'ember-metal/events'], function (exports, _emberUtils, _emberMetalError, _emberMetalDebug, _emberMetalMeta, _emberMetalExpand_properties, _emberMetalProperties, _emberMetalComputed, _emberMetalBinding, _emberMetalObserver, _emberMetalEvents) { - 'no use strict'; - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - - /** - @module ember - @submodule ember-metal - */ - exports.detectBinding = detectBinding; - exports.mixin = mixin; - exports.default = Mixin; - exports.hasUnprocessedMixins = hasUnprocessedMixins; - exports.clearUnprocessedMixins = clearUnprocessedMixins; - exports.required = required; - exports.aliasMethod = aliasMethod; - exports.observer = observer; - exports._immediateObserver = _immediateObserver; - exports._beforeObserver = _beforeObserver; - - function ROOT() {} - ROOT.__hasSuper = false; - - var a_slice = [].slice; - - function isMethod(obj) { - return 'function' === typeof obj && obj.isMethod !== false && obj !== Boolean && obj !== Object && obj !== Number && obj !== Array && obj !== Date && obj !== String; - } - - var CONTINUE = {}; - - function mixinProperties(mixinsMeta, mixin) { - var guid = undefined; - - if (mixin instanceof Mixin) { - guid = _emberUtils.guidFor(mixin); - if (mixinsMeta.peekMixins(guid)) { - return CONTINUE; - } - mixinsMeta.writeMixins(guid, mixin); - return mixin.properties; - } else { - return mixin; // apply anonymous mixin properties - } - } - - function concatenatedMixinProperties(concatProp, props, values, base) { - var concats = undefined; - - // reset before adding each new mixin to pickup concats from previous - concats = values[concatProp] || base[concatProp]; - if (props[concatProp]) { - concats = concats ? concats.concat(props[concatProp]) : props[concatProp]; - } - - return concats; - } - - function giveDescriptorSuper(meta, key, property, values, descs, base) { - var superProperty = undefined; - - // Computed properties override methods, and do not call super to them - if (values[key] === undefined) { - // Find the original descriptor in a parent mixin - superProperty = descs[key]; - } - - // If we didn't find the original descriptor in a parent mixin, find - // it on the original object. - if (!superProperty) { - var possibleDesc = base[key]; - var superDesc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - superProperty = superDesc; - } - - if (superProperty === undefined || !(superProperty instanceof _emberMetalComputed.ComputedProperty)) { - return property; - } - - // Since multiple mixins may inherit from the same parent, we need - // to clone the computed property so that other mixins do not receive - // the wrapped version. - property = Object.create(property); - property._getter = _emberUtils.wrap(property._getter, superProperty._getter); - if (superProperty._setter) { - if (property._setter) { - property._setter = _emberUtils.wrap(property._setter, superProperty._setter); - } else { - property._setter = superProperty._setter; - } - } - - return property; - } - - function giveMethodSuper(obj, key, method, values, descs) { - var superMethod = undefined; - - // Methods overwrite computed properties, and do not call super to them. - if (descs[key] === undefined) { - // Find the original method in a parent mixin - superMethod = values[key]; - } - - // If we didn't find the original value in a parent mixin, find it in - // the original object - superMethod = superMethod || obj[key]; - - // Only wrap the new method if the original method was a function - if (superMethod === undefined || 'function' !== typeof superMethod) { - return method; - } - - return _emberUtils.wrap(method, superMethod); - } - - function applyConcatenatedProperties(obj, key, value, values) { - var baseValue = values[key] || obj[key]; - - if (baseValue) { - if ('function' === typeof baseValue.concat) { - if (value === null || value === undefined) { - return baseValue; - } else { - return baseValue.concat(value); - } - } else { - return _emberUtils.makeArray(baseValue).concat(value); - } - } else { - return _emberUtils.makeArray(value); - } - } - - function applyMergedProperties(obj, key, value, values) { - var baseValue = values[key] || obj[key]; - - _emberMetalDebug.runInDebug(function () { - if (Array.isArray(value)) { - // use conditional to avoid stringifying every time - _emberMetalDebug.assert('You passed in `' + JSON.stringify(value) + '` as the value for `' + key + '` but `' + key + '` cannot be an Array', false); - } - }); - - if (!baseValue) { - return value; - } - - var newBase = _emberUtils.assign({}, baseValue); - var hasFunction = false; - - for (var prop in value) { - if (!value.hasOwnProperty(prop)) { - continue; - } - - var propValue = value[prop]; - if (isMethod(propValue)) { - // TODO: support for Computed Properties, etc? - hasFunction = true; - newBase[prop] = giveMethodSuper(obj, prop, propValue, baseValue, {}); - } else { - newBase[prop] = propValue; - } - } - - if (hasFunction) { - newBase._super = ROOT; - } - - return newBase; - } - - function addNormalizedProperty(base, key, value, meta, descs, values, concats, mergings) { - if (value instanceof _emberMetalProperties.Descriptor) { - if (value === REQUIRED && descs[key]) { - return CONTINUE; - } - - // Wrap descriptor function to implement - // _super() if needed - if (value._getter) { - value = giveDescriptorSuper(meta, key, value, values, descs, base); - } - - descs[key] = value; - values[key] = undefined; - } else { - if (concats && concats.indexOf(key) >= 0 || key === 'concatenatedProperties' || key === 'mergedProperties') { - value = applyConcatenatedProperties(base, key, value, values); - } else if (mergings && mergings.indexOf(key) >= 0) { - value = applyMergedProperties(base, key, value, values); - } else if (isMethod(value)) { - value = giveMethodSuper(base, key, value, values, descs); - } - - descs[key] = undefined; - values[key] = value; - } - } - - function mergeMixins(mixins, m, descs, values, base, keys) { - var currentMixin = undefined, - props = undefined, - key = undefined, - concats = undefined, - mergings = undefined; - - function removeKeys(keyName) { - delete descs[keyName]; - delete values[keyName]; - } - - for (var i = 0; i < mixins.length; i++) { - currentMixin = mixins[i]; - _emberMetalDebug.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(currentMixin), typeof currentMixin === 'object' && currentMixin !== null && Object.prototype.toString.call(currentMixin) !== '[object Array]'); - - props = mixinProperties(m, currentMixin); - if (props === CONTINUE) { - continue; - } - - if (props) { - if (base.willMergeMixin) { - base.willMergeMixin(props); - } - concats = concatenatedMixinProperties('concatenatedProperties', props, values, base); - mergings = concatenatedMixinProperties('mergedProperties', props, values, base); - - for (key in props) { - if (!props.hasOwnProperty(key)) { - continue; - } - keys.push(key); - addNormalizedProperty(base, key, props[key], m, descs, values, concats, mergings); - } - - // manually copy toString() because some JS engines do not enumerate it - if (props.hasOwnProperty('toString')) { - base.toString = props.toString; - } - } else if (currentMixin.mixins) { - mergeMixins(currentMixin.mixins, m, descs, values, base, keys); - if (currentMixin._without) { - currentMixin._without.forEach(removeKeys); - } - } - } - } - - function detectBinding(key) { - var length = key.length; - - return length > 7 && key.charCodeAt(length - 7) === 66 && key.indexOf('inding', length - 6) !== -1; - } - - // warm both paths of above function - detectBinding('notbound'); - detectBinding('fooBinding'); - - function connectBindings(obj, m) { - // TODO Mixin.apply(instance) should disconnect binding if exists - m.forEachBindings(function (key, binding) { - if (binding) { - var to = key.slice(0, -7); // strip Binding off end - if (binding instanceof _emberMetalBinding.Binding) { - binding = binding.copy(); // copy prototypes' instance - binding.to(to); - } else { - // binding is string path - binding = new _emberMetalBinding.Binding(to, binding); - } - binding.connect(obj); - obj[key] = binding; - } - }); - // mark as applied - m.clearBindings(); - } - - function finishPartial(obj, m) { - connectBindings(obj, m || _emberMetalMeta.meta(obj)); - return obj; - } - - function followAlias(obj, desc, m, descs, values) { - var altKey = desc.methodName; - var value = undefined; - var possibleDesc = undefined; - if (descs[altKey] || values[altKey]) { - value = values[altKey]; - desc = descs[altKey]; - } else if ((possibleDesc = obj[altKey]) && possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor) { - desc = possibleDesc; - value = undefined; - } else { - desc = undefined; - value = obj[altKey]; - } - - return { desc: desc, value: value }; - } - - function updateObserversAndListeners(obj, key, observerOrListener, pathsKey, updateMethod) { - var paths = observerOrListener[pathsKey]; - - if (paths) { - for (var i = 0; i < paths.length; i++) { - updateMethod(obj, paths[i], null, key); - } - } - } - - function replaceObserversAndListeners(obj, key, observerOrListener) { - var prev = obj[key]; - - if ('function' === typeof prev) { - updateObserversAndListeners(obj, key, prev, '__ember_observesBefore__', _emberMetalObserver._removeBeforeObserver); - updateObserversAndListeners(obj, key, prev, '__ember_observes__', _emberMetalObserver.removeObserver); - updateObserversAndListeners(obj, key, prev, '__ember_listens__', _emberMetalEvents.removeListener); - } - - if ('function' === typeof observerOrListener) { - updateObserversAndListeners(obj, key, observerOrListener, '__ember_observesBefore__', _emberMetalObserver._addBeforeObserver); - updateObserversAndListeners(obj, key, observerOrListener, '__ember_observes__', _emberMetalObserver.addObserver); - updateObserversAndListeners(obj, key, observerOrListener, '__ember_listens__', _emberMetalEvents.addListener); - } - } - - function applyMixin(obj, mixins, partial) { - var descs = {}; - var values = {}; - var m = _emberMetalMeta.meta(obj); - var keys = []; - var key = undefined, - value = undefined, - desc = undefined; - - obj._super = ROOT; - - // Go through all mixins and hashes passed in, and: - // - // * Handle concatenated properties - // * Handle merged properties - // * Set up _super wrapping if necessary - // * Set up computed property descriptors - // * Copying `toString` in broken browsers - mergeMixins(mixins, m, descs, values, obj, keys); - - for (var i = 0; i < keys.length; i++) { - key = keys[i]; - if (key === 'constructor' || !values.hasOwnProperty(key)) { - continue; - } - - desc = descs[key]; - value = values[key]; - - if (desc === REQUIRED) { - continue; - } - - while (desc && desc instanceof Alias) { - var followed = followAlias(obj, desc, m, descs, values); - desc = followed.desc; - value = followed.value; - } - - if (desc === undefined && value === undefined) { - continue; - } - - replaceObserversAndListeners(obj, key, value); - - if (detectBinding(key)) { - m.writeBindings(key, value); - } - - _emberMetalProperties.defineProperty(obj, key, desc, value, m); - } - - if (!partial) { - // don't apply to prototype - finishPartial(obj, m); - } - - return obj; - } - - /** - @method mixin - @for Ember - @param obj - @param mixins* - @return obj - @private - */ - - function mixin(obj) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - applyMixin(obj, args, false); - return obj; - } - - var NAME_KEY = _emberUtils.GUID_KEY + '_name'; - - exports.NAME_KEY = NAME_KEY; - /** - The `Ember.Mixin` class allows you to create mixins, whose properties can be - added to other classes. For instance, - - ```javascript - const EditableMixin = Ember.Mixin.create({ - edit() { - console.log('starting to edit'); - this.set('isEditing', true); - }, - isEditing: false - }); - - // Mix mixins into classes by passing them as the first arguments to - // `.extend.` - const Comment = Ember.Object.extend(EditableMixin, { - post: null - }); - - let comment = Comment.create(post: somePost); - comment.edit(); // outputs 'starting to edit' - ``` - - Note that Mixins are created with `Ember.Mixin.create`, not - `Ember.Mixin.extend`. - - Note that mixins extend a constructor's prototype so arrays and object literals - defined as properties will be shared amongst objects that implement the mixin. - If you want to define a property in a mixin that is not shared, you can define - it either as a computed property or have it be created on initialization of the object. - - ```javascript - // filters array will be shared amongst any object implementing mixin - const FilterableMixin = Ember.Mixin.create({ - filters: Ember.A() - }); - - // filters will be a separate array for every object implementing the mixin - const FilterableMixin = Ember.Mixin.create({ - filters: Ember.computed(function() { - return Ember.A(); - }) - }); - - // filters will be created as a separate array during the object's initialization - const Filterable = Ember.Mixin.create({ - init() { - this._super(...arguments); - this.set("filters", Ember.A()); - } - }); - ``` - - @class Mixin - @namespace Ember - @public - */ - - function Mixin(args, properties) { - this.properties = properties; - - var length = args && args.length; - - if (length > 0) { - var m = new Array(length); - - for (var i = 0; i < length; i++) { - var x = args[i]; - if (x instanceof Mixin) { - m[i] = x; - } else { - m[i] = new Mixin(undefined, x); - } - } - - this.mixins = m; - } else { - this.mixins = undefined; - } - this.ownerConstructor = undefined; - this._without = undefined; - this[_emberUtils.GUID_KEY] = null; - this[NAME_KEY] = null; - _emberMetalDebug.debugSeal(this); - } - - Mixin._apply = applyMixin; - - Mixin.applyPartial = function (obj) { - var args = a_slice.call(arguments, 1); - return applyMixin(obj, args, true); - }; - - Mixin.finishPartial = finishPartial; - - var unprocessedFlag = false; - - function hasUnprocessedMixins() { - return unprocessedFlag; - } - - function clearUnprocessedMixins() { - unprocessedFlag = false; - } - - /** - @method create - @static - @param arguments* - @public - */ - Mixin.create = function () { - // ES6TODO: this relies on a global state? - unprocessedFlag = true; - var M = this; - - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - return new M(args, undefined); - }; - - var MixinPrototype = Mixin.prototype; - - /** - @method reopen - @param arguments* - @private - */ - MixinPrototype.reopen = function () { - var currentMixin = undefined; - - if (this.properties) { - currentMixin = new Mixin(undefined, this.properties); - this.properties = undefined; - this.mixins = [currentMixin]; - } else if (!this.mixins) { - this.mixins = []; - } - - var mixins = this.mixins; - var idx = undefined; - - for (idx = 0; idx < arguments.length; idx++) { - currentMixin = arguments[idx]; - _emberMetalDebug.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(currentMixin), typeof currentMixin === 'object' && currentMixin !== null && Object.prototype.toString.call(currentMixin) !== '[object Array]'); - - if (currentMixin instanceof Mixin) { - mixins.push(currentMixin); - } else { - mixins.push(new Mixin(undefined, currentMixin)); - } - } - - return this; - }; - - /** - @method apply - @param obj - @return applied object - @private - */ - MixinPrototype.apply = function (obj) { - return applyMixin(obj, [this], false); - }; - - MixinPrototype.applyPartial = function (obj) { - return applyMixin(obj, [this], true); - }; - - MixinPrototype.toString = Object.toString; - - function _detect(curMixin, targetMixin, seen) { - var guid = _emberUtils.guidFor(curMixin); - - if (seen[guid]) { - return false; - } - seen[guid] = true; - - if (curMixin === targetMixin) { - return true; - } - var mixins = curMixin.mixins; - var loc = mixins ? mixins.length : 0; - while (--loc >= 0) { - if (_detect(mixins[loc], targetMixin, seen)) { - return true; - } - } - return false; - } - - /** - @method detect - @param obj - @return {Boolean} - @private - */ - MixinPrototype.detect = function (obj) { - if (typeof obj !== 'object' || obj === null) { - return false; - } - if (obj instanceof Mixin) { - return _detect(obj, this, {}); - } - var m = _emberMetalMeta.peekMeta(obj); - if (!m) { - return false; - } - return !!m.peekMixins(_emberUtils.guidFor(this)); - }; - - MixinPrototype.without = function () { - var ret = new Mixin([this]); - - for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - - ret._without = args; - return ret; - }; - - function _keys(ret, mixin, seen) { - if (seen[_emberUtils.guidFor(mixin)]) { - return; - } - seen[_emberUtils.guidFor(mixin)] = true; - - if (mixin.properties) { - var props = Object.keys(mixin.properties); - for (var i = 0; i < props.length; i++) { - var key = props[i]; - ret[key] = true; - } - } else if (mixin.mixins) { - mixin.mixins.forEach(function (x) { - return _keys(ret, x, seen); - }); - } - } - - MixinPrototype.keys = function () { - var keys = {}; - var seen = {}; - - _keys(keys, this, seen); - var ret = Object.keys(keys); - return ret; - }; - - _emberMetalDebug.debugSeal(MixinPrototype); - - // returns the mixins currently applied to the specified object - // TODO: Make Ember.mixin - Mixin.mixins = function (obj) { - var m = _emberMetalMeta.peekMeta(obj); - var ret = []; - if (!m) { - return ret; - } - - m.forEachMixins(function (key, currentMixin) { - // skip primitive mixins since these are always anonymous - if (!currentMixin.properties) { - ret.push(currentMixin); - } - }); - - return ret; - }; - - var REQUIRED = new _emberMetalProperties.Descriptor(); - REQUIRED.toString = function () { - return '(Required Property)'; - }; - - /** - Denotes a required property for a mixin - - @method required - @for Ember - @private - */ - - function required() { - _emberMetalDebug.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; - this.methodName = methodName; - } - - Alias.prototype = new _emberMetalProperties.Descriptor(); - - /** - Makes a method available via an additional name. - - ```javascript - App.Person = Ember.Object.extend({ - name: function() { - return 'Tomhuda Katzdale'; - }, - moniker: Ember.aliasMethod('name') - }); - - let goodGuy = App.Person.create(); - - goodGuy.name(); // 'Tomhuda Katzdale' - goodGuy.moniker(); // 'Tomhuda Katzdale' - ``` - - @method aliasMethod - @for Ember - @param {String} methodName name of the method to alias - @public - */ - - function aliasMethod(methodName) { - return new Alias(methodName); - } - - // .......................................................... - // OBSERVER HELPER - // - - /** - Specify a method that observes property changes. - - ```javascript - Ember.Object.extend({ - valueObserver: Ember.observer('value', function() { - // Executes whenever the "value" property changes - }) - }); - ``` - - Also available as `Function.prototype.observes` if prototype extensions are - enabled. - - @method observer - @for Ember - @param {String} propertyNames* - @param {Function} func - @return func - @public - */ - - function observer() { - for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { - args[_key4] = arguments[_key4]; - } - - var func = args.slice(-1)[0]; - var paths = undefined; - - var addWatchedProperty = function (path) { - paths.push(path); - }; - var _paths = args.slice(0, -1); - - if (typeof func !== 'function') { - // revert to old, soft-deprecated argument ordering - _emberMetalDebug.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 _emberMetalError.default('Ember.observer called without a function'); - } - - func.__ember_observes__ = paths; - return func; - } - - /** - Specify a method that observes property changes. - - ```javascript - Ember.Object.extend({ - valueObserver: Ember.immediateObserver('value', function() { - // Executes whenever the "value" property changes - }) - }); - ``` - - In the future, `Ember.observer` may become asynchronous. In this event, - `Ember.immediateObserver` will maintain the synchronous behavior. - - Also available as `Function.prototype.observesImmediately` if prototype extensions are - enabled. - - @method _immediateObserver - @for Ember - @param {String} propertyNames* - @param {Function} func - @deprecated Use `Ember.observer` instead. - @return func - @private - */ - - function _immediateObserver() { - _emberMetalDebug.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; i < arguments.length; i++) { - var arg = arguments[i]; - _emberMetalDebug.assert('Immediate observers must observe internal properties only, not properties on other objects.', typeof arg !== 'string' || arg.indexOf('.') === -1); - } - - return observer.apply(this, arguments); - } - - /** - When observers fire, they are called with the arguments `obj`, `keyName`. - - Note, `@each.property` observer is called per each add or replace of an element - and it's not called with a specific enumeration item. - - A `_beforeObserver` fires before a property changes. - - @method beforeObserver - @for Ember - @param {String} propertyNames* - @param {Function} func - @return func - @deprecated - @private - */ - - function _beforeObserver() { - for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { - args[_key5] = arguments[_key5]; - } - - var func = args.slice(-1)[0]; - var paths = undefined; - - var addWatchedProperty = function (path) { - paths.push(path); - }; - - var _paths = args.slice(0, -1); - - if (typeof func !== 'function') { - // revert to old, soft-deprecated argument ordering - - 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 _emberMetalError.default('_beforeObserver called without a function'); - } - - func.__ember_observesBefore__ = paths; - return func; - } - - exports.Mixin = Mixin; - exports.required = required; - exports.REQUIRED = REQUIRED; -}); -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; - exports._suspendObservers = _suspendObservers; - exports._removeBeforeObserver = _removeBeforeObserver; - - /** - @module ember-metal - */ - - var AFTER_OBSERVERS = ':change'; - var BEFORE_OBSERVERS = ':before'; - - function changeEvent(keyName) { - return keyName + AFTER_OBSERVERS; - } - - function beforeEvent(keyName) { - return keyName + BEFORE_OBSERVERS; - } - - /** - @method addObserver - @for Ember - @param obj - @param {String} _path - @param {Object|Function} target - @param {Function|String} [method] - @public - */ - - function addObserver(obj, _path, target, method) { - _emberMetalEvents.addListener(obj, changeEvent(_path), target, method); - _emberMetalWatching.watch(obj, _path); - - return this; - } - - function observersFor(obj, path) { - return _emberMetalEvents.listenersFor(obj, changeEvent(path)); - } - - /** - @method removeObserver - @for Ember - @param obj - @param {String} path - @param {Object|Function} target - @param {Function|String} [method] - @public - */ - - function removeObserver(obj, path, target, method) { - _emberMetalWatching.unwatch(obj, path); - _emberMetalEvents.removeListener(obj, changeEvent(path), target, method); - - return this; - } - - /** - @method _addBeforeObserver - @for Ember - @param obj - @param {String} path - @param {Object|Function} target - @param {Function|String} [method] - @deprecated - @private - */ - - function _addBeforeObserver(obj, path, target, method) { - _emberMetalEvents.addListener(obj, beforeEvent(path), target, method); - _emberMetalWatching.watch(obj, path); - - return this; - } - - // Suspend observer during callback. - // - // This should only be used by the target of the observer - // while it is setting the observed path. - - function _suspendObserver(obj, path, target, method, callback) { - return _emberMetalEvents.suspendListener(obj, changeEvent(path), target, method, callback); - } - - function _suspendObservers(obj, paths, target, method, callback) { - var events = paths.map(changeEvent); - return _emberMetalEvents.suspendListeners(obj, events, target, method, callback); - } - - /** - @method removeBeforeObserver - @for Ember - @param obj - @param {String} path - @param {Object|Function} target - @param {Function|String} [method] - @deprecated - @private - */ - - function _removeBeforeObserver(obj, path, target, method) { - _emberMetalWatching.unwatch(obj, path); - _emberMetalEvents.removeListener(obj, beforeEvent(path), target, method); - - return this; - } -}); -enifed('ember-metal/observer_set', ['exports', 'ember-utils', 'ember-metal/events'], function (exports, _emberUtils, _emberMetalEvents) { - 'use strict'; - - exports.default = ObserverSet; - - /* - this.observerSet = { - [senderGuid]: { // variable name: `keySet` - [keyName]: listIndex - } - }, - this.observers = [ - { - sender: obj, - keyName: keyName, - eventName: eventName, - listeners: [ - [target, method, flags] - ] - }, - ... - ] - */ - - function ObserverSet() { - this.clear(); - } - - ObserverSet.prototype.add = function (sender, keyName, eventName) { - var observerSet = this.observerSet; - var observers = this.observers; - var senderGuid = _emberUtils.guidFor(sender); - var keySet = observerSet[senderGuid]; - var index = undefined; - - if (!keySet) { - observerSet[senderGuid] = keySet = {}; - } - index = keySet[keyName]; - if (index === undefined) { - index = observers.push({ - sender: sender, - keyName: keyName, - eventName: eventName, - listeners: [] - }) - 1; - keySet[keyName] = index; - } - return observers[index].listeners; - }; - - ObserverSet.prototype.flush = function () { - var observers = this.observers; - var i = undefined, - observer = undefined, - sender = undefined; - this.clear(); - for (i = 0; i < observers.length; ++i) { - observer = observers[i]; - sender = observer.sender; - if (sender.isDestroying || sender.isDestroyed) { - continue; - } - _emberMetalEvents.sendEvent(sender, observer.eventName, [sender, observer.keyName], observer.listeners); - } - }; - - ObserverSet.prototype.clear = function () { - 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; - exports.getTailPath = getTailPath; - - var IS_GLOBAL = /^[A-Z$]/; - var IS_GLOBAL_PATH = /^[A-Z$].*[\.]/; - var HAS_THIS = 'this.'; - - var isGlobalCache = new _emberMetalCache.default(1000, function (key) { - return IS_GLOBAL.test(key); - }); - var isGlobalPathCache = new _emberMetalCache.default(1000, function (key) { - return IS_GLOBAL_PATH.test(key); - }); - var hasThisCache = new _emberMetalCache.default(1000, function (key) { - return key.lastIndexOf(HAS_THIS, 0) === 0; - }); - var firstDotIndexCache = new _emberMetalCache.default(1000, function (key) { - return key.indexOf('.'); - }); - - var firstKeyCache = new _emberMetalCache.default(1000, function (path) { - var index = firstDotIndexCache.get(path); - if (index === -1) { - return path; - } else { - return path.slice(0, index); - } - }); - - var tailPathCache = new _emberMetalCache.default(1000, function (path) { - var index = firstDotIndexCache.get(path); - if (index !== -1) { - return path.slice(index + 1); - } - }); - - var caches = { - isGlobalCache: isGlobalCache, - isGlobalPathCache: isGlobalPathCache, - hasThisCache: hasThisCache, - firstDotIndexCache: firstDotIndexCache, - firstKeyCache: firstKeyCache, - tailPathCache: tailPathCache - }; - - exports.caches = caches; - - function isGlobal(path) { - return isGlobalCache.get(path); - } - - function isGlobalPath(path) { - return isGlobalPathCache.get(path); - } - - function hasThis(path) { - return hasThisCache.get(path); - } - - function isPath(path) { - return firstDotIndexCache.get(path) !== -1; - } - - function getFirstKey(path) { - return firstKeyCache.get(path); - } - - function getTailPath(path) { - return tailPathCache.get(path); - } -}); -enifed('ember-metal/properties', ['exports', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/meta', 'ember-metal/property_events'], function (exports, _emberMetalDebug, _emberMetalFeatures, _emberMetalMeta, _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.INHERITING_GETTER_FUNCTION = INHERITING_GETTER_FUNCTION; - exports.defineProperty = defineProperty; - - // .......................................................... - // DESCRIPTOR - // - - /** - Objects of this type can implement an interface to respond to requests to - get and set. The default implementation handles simple properties. - - @class Descriptor - @private - */ - - function Descriptor() { - this.isDescriptor = true; - } - - var REDEFINE_SUPPORTED = (function () { - // https://github.com/spalger/kibana/commit/b7e35e6737df585585332857a4c397dc206e7ff9 - var a = Object.create(Object.prototype, { - prop: { - configurable: true, - value: 1 - } - }); - - Object.defineProperty(a, 'prop', { - configurable: true, - value: 2 - }); - - return a.prop === 2; - })(); - // .......................................................... - // DEFINING PROPERTIES API - // - - function MANDATORY_SETTER_FUNCTION(name) { - function SETTER_FUNCTION(value) { - var m = _emberMetalMeta.peekMeta(this); - if (!m.isInitialized(this)) { - m.writeValues(name, value); - } else { - _emberMetalDebug.assert('You must use Ember.set() to set the `' + name + '` property (of ' + this + ') to `' + value + '`.', false); - } - } - - SETTER_FUNCTION.isMandatorySetter = true; - return SETTER_FUNCTION; - } - - function DEFAULT_GETTER_FUNCTION(name) { - return function GETTER_FUNCTION() { - var meta = _emberMetalMeta.peekMeta(this); - return meta && meta.peekValues(name); - }; - } - - function INHERITING_GETTER_FUNCTION(name) { - function IGETTER_FUNCTION() { - var meta = _emberMetalMeta.peekMeta(this); - var val = meta && meta.readInheritedValue('values', name); - - if (val === _emberMetalMeta.UNDEFINED) { - var proto = Object.getPrototypeOf(this); - return proto && proto[name]; - } else { - return val; - } - } - - IGETTER_FUNCTION.isInheritingGetter = true; - return IGETTER_FUNCTION; - } - - /** - NOTE: This is a low-level method used by other parts of the API. You almost - never want to call this method directly. Instead you should use - `Ember.mixin()` to define new properties. - - Defines a property on an object. This method works much like the ES5 - `Object.defineProperty()` method except that it can also accept computed - properties and other special descriptors. - - Normally this method takes only three parameters. However if you pass an - instance of `Descriptor` as the third param then you can pass an - optional value as the fourth parameter. This is often more efficient than - creating new descriptor hashes for each property. - - ## Examples - - ```javascript - // ES5 compatible mode - Ember.defineProperty(contact, 'firstName', { - writable: true, - configurable: false, - enumerable: true, - value: 'Charles' - }); - - // define a simple property - Ember.defineProperty(contact, 'lastName', undefined, 'Jolley'); - - // define a computed property - Ember.defineProperty(contact, 'fullName', Ember.computed('firstName', 'lastName', function() { - return this.firstName+' '+this.lastName; - })); - ``` - - @private - @method defineProperty - @for Ember - @param {Object} obj the object to define this property on. This may be a prototype. - @param {String} keyName the name of the property - @param {Descriptor} [desc] an instance of `Descriptor` (typically a - computed property) or an ES5 descriptor. - You must provide this or `data` but not both. - @param {*} [data] something other than a descriptor, that will - become the explicit value of this property. - */ - - function defineProperty(obj, keyName, desc, data, meta) { - var possibleDesc = undefined, - existingDesc = undefined, - watching = undefined, - value = undefined; - - if (!meta) { - meta = _emberMetalMeta.meta(obj); - } - var watchEntry = meta.peekWatching(keyName); - possibleDesc = obj[keyName]; - existingDesc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - watching = watchEntry !== undefined && watchEntry > 0; - - if (existingDesc) { - existingDesc.teardown(obj, keyName); - } - - if (desc instanceof Descriptor) { - value = desc; - if (true) { - 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; - - if (true) { - 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); - } - } - - // if key is being watched, override chains that - // were initialized with the prototype - if (watching) { - _emberMetalProperty_events.overrideChains(obj, keyName, meta); - } - - // The `value` passed to the `didDefineProperty` hook is - // either the descriptor or data, whichever was passed. - if (obj.didDefineProperty) { - obj.didDefineProperty(obj, keyName, value); - } - - return this; - } - - function handleBrokenPhantomDefineProperty(obj, keyName, desc) { - // https://github.com/ariya/phantomjs/issues/11856 - Object.defineProperty(obj, keyName, { configurable: true, writable: true, value: 'iCry' }); - Object.defineProperty(obj, keyName, desc); - } -}); -enifed('ember-metal/property_events', ['exports', 'ember-utils', 'ember-metal/meta', 'ember-metal/events', 'ember-metal/tags', 'ember-metal/observer_set', 'ember-metal/features', 'ember-metal/transaction'], function (exports, _emberUtils, _emberMetalMeta, _emberMetalEvents, _emberMetalTags, _emberMetalObserver_set, _emberMetalFeatures, _emberMetalTransaction) { - 'use strict'; - - var PROPERTY_DID_CHANGE = _emberUtils.symbol('PROPERTY_DID_CHANGE'); - - exports.PROPERTY_DID_CHANGE = PROPERTY_DID_CHANGE; - var beforeObserverSet = new _emberMetalObserver_set.default(); - var observerSet = new _emberMetalObserver_set.default(); - var deferred = 0; - - // .......................................................... - // PROPERTY CHANGES - // - - /** - This function is called just before an object property is about to change. - It will notify any before observers and prepare caches among other things. - - Normally you will not need to call this method directly but if for some - reason you can't directly watch a property you can invoke this method - manually along with `Ember.propertyDidChange()` which you should call just - after the property value changes. - - @method propertyWillChange - @for Ember - @param {Object} obj The object with the property that will change - @param {String} keyName The property key (or path) that will change. - @return {void} - @private - */ - function propertyWillChange(obj, keyName, _meta) { - var meta = _meta || _emberMetalMeta.peekMeta(obj); - - if (meta && !meta.isInitialized(obj)) { - return; - } - - var watching = meta && meta.peekWatching(keyName) > 0; - var possibleDesc = obj[keyName]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - if (desc && desc.willChange) { - desc.willChange(obj, keyName); - } - - if (watching) { - dependentKeysWillChange(obj, keyName, meta); - chainsWillChange(obj, keyName, meta); - notifyBeforeObservers(obj, keyName, meta); - } - } - - /** - This function is called just after an object property has changed. - It will notify any observers and clear caches among other things. - - Normally you will not need to call this method directly but if for some - reason you can't directly watch a property you can invoke this method - manually along with `Ember.propertyWillChange()` which you should call just - before the property value changes. - - @method propertyDidChange - @for Ember - @param {Object} obj The object with the property that will change - @param {String} keyName The property key (or path) that will change. - @param {Meta} meta The objects meta. - @return {void} - @private - */ - function propertyDidChange(obj, keyName, _meta) { - var meta = _meta || _emberMetalMeta.peekMeta(obj); - - if (meta && !meta.isInitialized(obj)) { - return; - } - - var watching = meta && meta.peekWatching(keyName) > 0; - var possibleDesc = obj[keyName]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - // shouldn't this mean that we're watching this key? - if (desc && desc.didChange) { - desc.didChange(obj, keyName); - } - - if (watching) { - if (meta.hasDeps(keyName)) { - dependentKeysDidChange(obj, keyName, meta); - } - - chainsDidChange(obj, keyName, meta, false); - notifyObservers(obj, keyName, meta); - } - - if (obj[PROPERTY_DID_CHANGE]) { - obj[PROPERTY_DID_CHANGE](keyName); - } - - if (meta && meta.isSourceDestroying()) { - return; - } - - _emberMetalTags.markObjectAsDirty(meta, keyName); - - if (true || true) { - _emberMetalTransaction.assertNotRendered(obj, keyName, meta); - } - } - - var WILL_SEEN = undefined, - DID_SEEN = undefined; - // called whenever a property is about to change to clear the cache of any dependent keys (and notify those properties of changes, etc...) - function dependentKeysWillChange(obj, depKey, meta) { - if (meta && meta.isSourceDestroying()) { - return; - } - - if (meta && meta.hasDeps(depKey)) { - var seen = WILL_SEEN; - var _top = !seen; - - if (_top) { - seen = WILL_SEEN = {}; - } - - iterDeps(propertyWillChange, obj, depKey, seen, meta); - - if (_top) { - WILL_SEEN = null; - } - } - } - - // called whenever a property has just changed to update dependent keys - function dependentKeysDidChange(obj, depKey, meta) { - if (meta && meta.isSourceDestroying()) { - return; - } - - if (meta && meta.hasDeps(depKey)) { - var seen = DID_SEEN; - var _top2 = !seen; - - if (_top2) { - seen = DID_SEEN = {}; - } - - iterDeps(propertyDidChange, obj, depKey, seen, meta); - - if (_top2) { - DID_SEEN = null; - } - } - } - - function iterDeps(method, obj, depKey, seen, meta) { - var possibleDesc = undefined, - desc = undefined; - var guid = _emberUtils.guidFor(obj); - var current = seen[guid]; - - if (!current) { - current = seen[guid] = {}; - } - - if (current[depKey]) { - return; - } - - current[depKey] = true; - - meta.forEachInDeps(depKey, function (key, value) { - if (!value) { - return; - } - - possibleDesc = obj[key]; - desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - if (desc && desc._suspended === obj) { - return; - } - - method(obj, key, meta); - }); - } - - function chainsWillChange(obj, keyName, meta) { - var chainWatchers = meta.readableChainWatchers(); - if (chainWatchers) { - chainWatchers.notify(keyName, false, propertyWillChange); - } - } - - function chainsDidChange(obj, keyName, meta) { - var chainWatchers = meta.readableChainWatchers(); - if (chainWatchers) { - chainWatchers.notify(keyName, true, propertyDidChange); - } - } - - function overrideChains(obj, keyName, meta) { - var chainWatchers = meta.readableChainWatchers(); - if (chainWatchers) { - chainWatchers.revalidate(keyName); - } - } - - /** - @method beginPropertyChanges - @chainable - @private - */ - function beginPropertyChanges() { - deferred++; - } - - /** - @method endPropertyChanges - @private - */ - function endPropertyChanges() { - deferred--; - if (deferred <= 0) { - beforeObserverSet.clear(); - observerSet.flush(); - } - } - - /** - Make a series of property changes together in an - exception-safe way. - - ```javascript - Ember.changeProperties(function() { - obj1.set('foo', mayBlowUpWhenSet); - obj2.set('bar', baz); - }); - ``` - - @method changeProperties - @param {Function} callback - @param [binding] - @private - */ - function changeProperties(callback, binding) { - beginPropertyChanges(); - try { - callback.call(binding); - } finally { - endPropertyChanges.call(binding); - } - } - - function notifyBeforeObservers(obj, keyName, meta) { - if (meta && meta.isSourceDestroying()) { - return; - } - - var eventName = keyName + ':before'; - var listeners = undefined, - added = undefined; - if (deferred) { - listeners = beforeObserverSet.add(obj, keyName, eventName); - added = _emberMetalEvents.accumulateListeners(obj, eventName, listeners); - _emberMetalEvents.sendEvent(obj, eventName, [obj, keyName], added); - } else { - _emberMetalEvents.sendEvent(obj, eventName, [obj, keyName]); - } - } - - function notifyObservers(obj, keyName, meta) { - if (meta && meta.isSourceDestroying()) { - return; - } - - var eventName = keyName + ':change'; - var listeners = undefined; - if (deferred) { - listeners = observerSet.add(obj, keyName, eventName); - _emberMetalEvents.accumulateListeners(obj, eventName, listeners); - } else { - _emberMetalEvents.sendEvent(obj, eventName, [obj, keyName]); - } - } - - exports.propertyWillChange = propertyWillChange; - exports.propertyDidChange = propertyDidChange; - exports.overrideChains = overrideChains; - exports.beginPropertyChanges = beginPropertyChanges; - exports.endPropertyChanges = endPropertyChanges; - exports.changeProperties = changeProperties; -}); -enifed('ember-metal/property_get', ['exports', 'ember-metal/debug', 'ember-metal/path_cache'], function (exports, _emberMetalDebug, _emberMetalPath_cache) { - /** - @module ember-metal - */ - - 'use strict'; - - exports.get = get; - exports._getPath = _getPath; - exports.getWithDefault = getWithDefault; - - var ALLOWABLE_TYPES = { - object: true, - function: true, - string: true - }; - - // .......................................................... - // 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 - // object. - - /** - Gets the value of a property on an object. If the property is computed, - the function will be invoked. If the property is not defined but the - object implements the `unknownProperty` method then that will be invoked. - - ```javascript - Ember.get(obj, "name"); - ``` - - If you plan to run on IE8 and older browsers then you should use this - method anytime you want to retrieve a property on an object that you don't - know for sure is private. (Properties beginning with an underscore '_' - are considered private.) - - On all newer browsers, you only need to use this method to retrieve - properties if the property might not be defined on the object and you want - to respect the `unknownProperty` handler. Otherwise you can ignore this - method. - - Note that if the object itself is `undefined`, this method will throw - an error. - - @method get - @for Ember - @param {Object} obj The object to retrieve from. - @param {String} keyName The property key to retrieve - @return {Object} the property value or `null`. - @public - */ - - function get(obj, keyName) { - _emberMetalDebug.assert('Get must be called with two arguments; an object and a property key', arguments.length === 2); - _emberMetalDebug.assert('Cannot call get with \'' + keyName + '\' on an undefined object.', obj !== undefined && obj !== null); - _emberMetalDebug.assert('The key provided to get must be a string, you passed ' + keyName, typeof keyName === 'string'); - _emberMetalDebug.assert('\'this\' in paths is not supported', !_emberMetalPath_cache.hasThis(keyName)); - _emberMetalDebug.assert('Cannot call `Ember.get` with an empty string', keyName !== ''); - - var value = obj[keyName]; - var desc = value !== null && typeof value === 'object' && value.isDescriptor ? value : undefined; - var ret = undefined; - - if (desc === undefined && _emberMetalPath_cache.isPath(keyName)) { - return _getPath(obj, keyName); - } - - if (desc) { - return desc.get(obj, keyName); - } else { - ret = value; - - if (ret === undefined && 'object' === typeof obj && !(keyName in obj) && 'function' === typeof obj.unknownProperty) { - return obj.unknownProperty(keyName); - } - - return ret; - } - } - - function _getPath(root, path) { - var obj = root; - var parts = path.split('.'); - - for (var i = 0; i < parts.length; i++) { - if (!isGettable(obj)) { - return undefined; - } - - obj = get(obj, parts[i]); - - if (obj && obj.isDestroyed) { - return undefined; - } - } - - return obj; - } - - function isGettable(obj) { - if (obj == null) { - return false; - } - - return ALLOWABLE_TYPES[typeof obj]; - } - - /** - Retrieves the value of a property from an Object, or a default value in the - case that the property returns `undefined`. - - ```javascript - Ember.getWithDefault(person, 'lastName', 'Doe'); - ``` - - @method getWithDefault - @for Ember - @param {Object} obj The object to retrieve from. - @param {String} keyName The name of the property to retrieve - @param {Object} defaultValue The value to return if the property value is undefined - @return {Object} The property value or the defaultValue. - @public - */ - - function getWithDefault(root, key, defaultValue) { - var value = get(root, key); - - if (value === undefined) { - return defaultValue; - } - return value; - } - - exports.default = get; -}); -enifed('ember-metal/property_set', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_events', 'ember-metal/error', 'ember-metal/path_cache', 'ember-metal/meta'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_events, _emberMetalError, _emberMetalPath_cache, _emberMetalMeta) { - 'use strict'; - - exports.set = set; - exports.trySet = trySet; - - /** - 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. - - ```javascript - Ember.set(obj, "name", value); - ``` - - @method set - @for Ember - @param {Object} obj The object to modify. - @param {String} keyName The property key to set - @param {Object} value The value to set - @return {Object} the passed value. - @public - */ - - function set(obj, keyName, value, tolerant) { - _emberMetalDebug.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); - _emberMetalDebug.assert('Cannot call set with \'' + keyName + '\' on an undefined object.', obj && typeof obj === 'object' || typeof obj === 'function'); - _emberMetalDebug.assert('The key provided to set must be a string, you passed ' + keyName, typeof keyName === 'string'); - _emberMetalDebug.assert('\'this\' in paths is not supported', !_emberMetalPath_cache.hasThis(keyName)); - _emberMetalDebug.assert('calling set on destroyed object: ' + _emberUtils.toString(obj) + '.' + keyName + ' = ' + _emberUtils.toString(value), !obj.isDestroyed); - - if (_emberMetalPath_cache.isPath(keyName)) { - return setPath(obj, keyName, value, tolerant); - } - - var meta = _emberMetalMeta.peekMeta(obj); - var possibleDesc = obj[keyName]; - - var desc = undefined, - currentValue = undefined; - if (possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor) { - desc = possibleDesc; - } else { - currentValue = possibleDesc; - } - - if (desc) { - /* computed property */ - desc.set(obj, keyName, value); - } else if (obj.setUnknownProperty && currentValue === undefined && !(keyName in obj)) { - /* unknown property */ - _emberMetalDebug.assert('setUnknownProperty must be a function', typeof obj.setUnknownProperty === 'function'); - obj.setUnknownProperty(keyName, value); - } else if (currentValue === value) { - /* no change */ - return value; - } else { - _emberMetalProperty_events.propertyWillChange(obj, keyName); - - if (true) { - setWithMandatorySetter(meta, obj, keyName, value); - } else { - obj[keyName] = value; - } - - _emberMetalProperty_events.propertyDidChange(obj, keyName); - } - - return value; - } - - if (true) { - 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) { - // get the last part of the path - var keyName = path.slice(path.lastIndexOf('.') + 1); - - // get the first part of the part - path = path === keyName ? keyName : path.slice(0, path.length - (keyName.length + 1)); - - // unless the path is this, look up the first part to - // get the root - if (path !== 'this') { - root = _emberMetalProperty_get._getPath(root, path); - } - - if (!keyName || keyName.length === 0) { - throw new _emberMetalError.default('Property set failed: You passed an empty path'); - } - - if (!root) { - if (tolerant) { - return; - } else { - throw new _emberMetalError.default('Property set failed: object in path "' + path + '" could not be found or was destroyed.'); - } - } - - return set(root, keyName, value); - } - - /** - Error-tolerant form of `Ember.set`. Will not blow up if any part of the - chain is `undefined`, `null`, or destroyed. - - This is primarily used when syncing bindings, which may try to update after - an object has been destroyed. - - @method trySet - @for Ember - @param {Object} root The object to modify. - @param {String} path The property path to set - @param {Object} value The value to set - @public - */ - - function trySet(root, path, value) { - return set(root, path, value, true); - } -}); -enifed("ember-metal/replace", ["exports"], function (exports) { - "use strict"; - - exports.default = replace; - var splice = Array.prototype.splice; - - 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; - var ends = amt; - var count = undefined, - chunk = undefined; - - while (args.length) { - count = ends > size ? size : ends; - if (count <= 0) { - count = 0; - } - - chunk = args.splice(0, size); - chunk = [start, count].concat(chunk); - - start += size; - ends -= count; - - ret = ret.concat(splice.apply(array, chunk)); - } - return ret; - } -}); -enifed('ember-metal/run_loop', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/testing', 'ember-metal/error_handler', 'ember-metal/property_events', 'backburner'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalTesting, _emberMetalError_handler, _emberMetalProperty_events, _backburner) { - 'use strict'; - - exports.default = run; - - function onBegin(current) { - run.currentRunLoop = current; - } - - function onEnd(current, next) { - run.currentRunLoop = next; - } - - var onErrorTarget = { - get onerror() { - return _emberMetalError_handler.getOnerror(); - }, - set onerror(handler) { - return _emberMetalError_handler.setOnerror(handler); - } - }; - - var backburner = new _backburner.default(['sync', 'actions', 'destroy'], { - GUID_KEY: _emberUtils.GUID_KEY, - sync: { - before: _emberMetalProperty_events.beginPropertyChanges, - after: _emberMetalProperty_events.endPropertyChanges - }, - defaultQueue: 'actions', - onBegin: onBegin, - onEnd: onEnd, - onErrorTarget: onErrorTarget, - onErrorMethod: 'onerror' - }); - - // .......................................................... - // run - this is ideally the only public API the dev sees - // - - /** - Runs the passed target and method inside of a RunLoop, ensuring any - deferred actions including bindings and views updates are flushed at the - end. - - Normally you should not need to invoke this method yourself. However if - you are implementing raw event handlers when interfacing with other - libraries or plugins, you should probably wrap all of your code inside this - call. - - ```javascript - run(function() { - // code to be executed within a RunLoop - }); - ``` - - @class run - @namespace Ember - @static - @constructor - @param {Object} [target] target of method to call - @param {Function|String} method Method to invoke. - May be a function or a string. If you pass a string - then it will be looked up on the passed target. - @param {Object} [args*] Any additional arguments you wish to pass to the method. - @return {Object} return value from invoking the passed function. - @public - */ - - function run() { - return backburner.run.apply(backburner, arguments); - } - - /** - If no run-loop is present, it creates a new one. If a run loop is - present it will queue itself to run on the existing run-loops action - queue. - - Please note: This is not for normal usage, and should be used sparingly. - - If invoked when not within a run loop: - - ```javascript - run.join(function() { - // creates a new run-loop - }); - ``` - - Alternatively, if called within an existing run loop: - - ```javascript - run(function() { - // creates a new run-loop - run.join(function() { - // joins with the existing run-loop, and queues for invocation on - // the existing run-loops action queue. - }); - }); - ``` - - @method join - @namespace Ember - @param {Object} [target] target of method to call - @param {Function|String} method Method to invoke. - May be a function or a string. If you pass a string - then it will be looked up on the passed target. - @param {Object} [args*] Any additional arguments you wish to pass to the method. - @return {Object} Return value from invoking the passed function. Please note, - when called within an existing loop, no return value is possible. - @public - */ - run.join = function () { - return backburner.join.apply(backburner, arguments); - }; - - /** - Allows you to specify which context to call the specified function in while - adding the execution of that function to the Ember run loop. This ability - makes this method a great way to asynchronously integrate third-party libraries - into your Ember application. - - `run.bind` takes two main arguments, the desired context and the function to - invoke in that context. Any additional arguments will be supplied as arguments - to the function that is passed in. - - Let's use the creation of a TinyMCE component as an example. Currently, - TinyMCE provides a setup configuration option we can use to do some processing - after the TinyMCE instance is initialized but before it is actually rendered. - We can use that setup option to do some additional setup for our component. - The component itself could look something like the following: - - ```javascript - App.RichTextEditorComponent = Ember.Component.extend({ - initializeTinyMCE: Ember.on('didInsertElement', function() { - tinymce.init({ - selector: '#' + this.$().prop('id'), - setup: Ember.run.bind(this, this.setupEditor) - }); - }), - - setupEditor: function(editor) { - this.set('editor', editor); - - editor.on('change', function() { - console.log('content changed!'); - }); - } - }); - ``` - - In this example, we use Ember.run.bind to bind the setupEditor method to the - context of the App.RichTextEditorComponent and to have the invocation of that - method be safely handled and executed by the Ember run loop. - - @method bind - @namespace Ember - @param {Object} [target] target of method to call - @param {Function|String} method Method to invoke. - May be a function or a string. If you pass a string - then it will be looked up on the passed target. - @param {Object} [args*] Any additional arguments you wish to pass to the method. - @return {Function} returns a new function that will always have a particular context - @since 1.4.0 - @public - */ - run.bind = function () { - for (var _len = arguments.length, curried = Array(_len), _key = 0; _key < _len; _key++) { - curried[_key] = arguments[_key]; - } - - return function () { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - return run.join.apply(run, curried.concat(args)); - }; - }; - - run.backburner = backburner; - run.currentRunLoop = null; - run.queues = backburner.queueNames; - - /** - Begins a new RunLoop. Any deferred actions invoked after the begin will - be buffered until you invoke a matching call to `run.end()`. This is - a lower-level way to use a RunLoop instead of using `run()`. - - ```javascript - run.begin(); - // code to be executed within a RunLoop - run.end(); - ``` - - @method begin - @return {void} - @public - */ - run.begin = function () { - backburner.begin(); - }; - - /** - Ends a RunLoop. This must be called sometime after you call - `run.begin()` to flush any deferred actions. This is a lower-level way - to use a RunLoop instead of using `run()`. - - ```javascript - run.begin(); - // code to be executed within a RunLoop - run.end(); - ``` - - @method end - @return {void} - @public - */ - run.end = function () { - backburner.end(); - }; - - /** - Array of named queues. This array determines the order in which queues - are flushed at the end of the RunLoop. You can define your own queues by - simply adding the queue name to this array. Normally you should not need - to inspect or modify this property. - - @property queues - @type Array - @default ['sync', 'actions', 'destroy'] - @private - */ - - /** - Adds the passed target/method and any optional arguments to the named - queue to be executed at the end of the RunLoop. If you have not already - started a RunLoop when calling this method one will be started for you - automatically. - - At the end of a RunLoop, any methods scheduled in this way will be invoked. - Methods will be invoked in an order matching the named queues defined in - the `run.queues` property. - - ```javascript - run.schedule('sync', this, function() { - // this will be executed in the first RunLoop queue, when bindings are synced - console.log('scheduled on sync queue'); - }); - - run.schedule('actions', this, function() { - // this will be executed in the 'actions' queue, after bindings have synced. - console.log('scheduled on actions queue'); - }); - - // Note the functions will be run in order based on the run queues order. - // Output would be: - // scheduled on sync queue - // scheduled on actions queue - ``` - - @method schedule - @param {String} queue The name of the queue to schedule against. - Default queues are 'sync' and 'actions' - @param {Object} [target] target object to use as the context when invoking a method. - @param {String|Function} method The method to invoke. If you pass a string it - will be resolved on the target object at the time the scheduled item is - invoked allowing you to change the target function. - @param {Object} [arguments*] Optional arguments to be passed to the queued method. - @return {*} Timer information for use in cancelling, see `run.cancel`. - @public - */ - run.schedule = function () /* queue, target, method */{ - _emberMetalDebug.assert('You have turned on testing mode, which disabled the run-loop\'s autorun. ' + 'You will need to wrap any code with asynchronous side-effects in a run', run.currentRunLoop || !_emberMetalTesting.isTesting()); - - return backburner.schedule.apply(backburner, arguments); - }; - - // Used by global test teardown - run.hasScheduledTimers = function () { - return backburner.hasTimers(); - }; - - // Used by global test teardown - run.cancelTimers = function () { - backburner.cancelTimers(); - }; - - /** - Immediately flushes any events scheduled in the 'sync' queue. Bindings - use this queue so this method is a useful way to immediately force all - bindings in the application to sync. - - You should call this method anytime you need any changed state to propagate - throughout the app immediately without repainting the UI (which happens - in the later 'render' queue added by the `ember-views` package). - - ```javascript - run.sync(); - ``` - - @method sync - @return {void} - @private - */ - run.sync = function () { - if (backburner.currentInstance) { - backburner.currentInstance.queues.sync.flush(); - } - }; - - /** - Invokes the passed target/method and optional arguments after a specified - period of time. The last parameter of this method must always be a number - of milliseconds. - - You should use this method whenever you need to run some action after a - period of time instead of using `setTimeout()`. This method will ensure that - items that expire during the same script execution cycle all execute - together, which is often more efficient than using a real setTimeout. - - ```javascript - run.later(myContext, function() { - // code here will execute within a RunLoop in about 500ms with this == myContext - }, 500); - ``` - - @method later - @param {Object} [target] target of method to invoke - @param {Function|String} method The method to invoke. - If you pass a string it will be resolved on the - target at the time the method is invoked. - @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 () /*target, method*/{ - return backburner.later.apply(backburner, arguments); - }; - - /** - Schedule a function to run one time during the current RunLoop. This is equivalent - to calling `scheduleOnce` with the "actions" queue. - - @method once - @param {Object} [target] The target of the method to invoke. - @param {Function|String} method The method to invoke. - If you pass a string it will be resolved on the - 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.once = function () { - _emberMetalDebug.assert('You have turned on testing mode, which disabled the run-loop\'s autorun. ' + 'You will need to wrap any code with asynchronous side-effects in a run', run.currentRunLoop || !_emberMetalTesting.isTesting()); - - for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - - args.unshift('actions'); - return backburner.scheduleOnce.apply(backburner, args); - }; - - /** - Schedules a function to run one time in a given queue of the current RunLoop. - Calling this method with the same queue/target/method combination will have - no effect (past the initial call). - - Note that although you can pass optional arguments these will not be - considered when looking for duplicates. New arguments will replace previous - calls. - - ```javascript - function sayHi() { - console.log('hi'); - } - - run(function() { - run.scheduleOnce('afterRender', myContext, sayHi); - run.scheduleOnce('afterRender', myContext, sayHi); - // sayHi will only be executed once, in the afterRender queue of the RunLoop - }); - ``` - - Also note that passing an anonymous function to `run.scheduleOnce` will - not prevent additional calls with an identical anonymous function from - scheduling the items multiple times, e.g.: - - ```javascript - function scheduleIt() { - run.scheduleOnce('actions', myContext, function() { - console.log('Closure'); - }); - } - - scheduleIt(); - scheduleIt(); - - // "Closure" will print twice, even though we're using `run.scheduleOnce`, - // because the function we pass to it is anonymous and won't match the - // previously scheduled operation. - ``` - - Available queues, and their order, can be found at `run.queues` - - @method scheduleOnce - @param {String} [queue] The name of the queue to schedule against. Default queues are 'sync' and 'actions'. - @param {Object} [target] The target of the method to invoke. - @param {Function|String} method The method to invoke. - If you pass a string it will be resolved on the - 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 () /*queue, target, method*/{ - _emberMetalDebug.assert('You have turned on testing mode, which disabled the run-loop\'s autorun. ' + 'You will need to wrap any code with asynchronous side-effects in a run', run.currentRunLoop || !_emberMetalTesting.isTesting()); - return backburner.scheduleOnce.apply(backburner, arguments); - }; - - /** - Schedules an item to run from within a separate run loop, after - control has been returned to the system. This is equivalent to calling - `run.later` with a wait time of 1ms. - - ```javascript - run.next(myContext, function() { - // code to be executed in the next run loop, - // which will be scheduled after the current one - }); - ``` - - Multiple operations scheduled with `run.next` will coalesce - into the same later run loop, along with any other operations - scheduled by `run.later` that expire right around the same - time that `run.next` operations will fire. - - Note that there are often alternatives to using `run.next`. - For instance, if you'd like to schedule an operation to happen - after all DOM element operations have completed within the current - run loop, you can make use of the `afterRender` run loop queue (added - by the `ember-views` package, along with the preceding `render` queue - where all the DOM element operations happen). - - Example: - - ```javascript - export default Ember.Component.extend({ - didInsertElement() { - this._super(...arguments); - run.scheduleOnce('afterRender', this, 'processChildElements'); - }, - - processChildElements() { - // ... do something with component's child component - // elements after they've finished rendering, which - // can't be done within this component's - // `didInsertElement` hook because that gets run - // before the child elements have been added to the DOM. - } - }); - ``` - - One benefit of the above approach compared to using `run.next` is - that you will be able to perform DOM/CSS operations before unprocessed - elements are rendered to the screen, which may prevent flickering or - other artifacts caused by delaying processing until after rendering. - - The other major benefit to the above approach is that `run.next` - introduces an element of non-determinism, which can make things much - harder to test, due to its reliance on `setTimeout`; it's much harder - to guarantee the order of scheduled operations when they are scheduled - outside of the current run loop, i.e. with `run.next`. - - @method next - @param {Object} [target] target of method to invoke - @param {Function|String} method The method to invoke. - If you pass a string it will be resolved on the - 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.next = function () { - for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { - args[_key4] = arguments[_key4]; - } - - args.push(1); - return backburner.later.apply(backburner, args); - }; - - /** - Cancels a scheduled item. Must be a value returned by `run.later()`, - `run.once()`, `run.scheduleOnce()`, `run.next()`, `run.debounce()`, or - `run.throttle()`. - - ```javascript - let runNext = run.next(myContext, function() { - // will not be executed - }); - - run.cancel(runNext); - - let runLater = run.later(myContext, function() { - // will not be executed - }, 500); - - run.cancel(runLater); - - let runScheduleOnce = run.scheduleOnce('afterRender', myContext, function() { - // will not be executed - }); - - run.cancel(runScheduleOnce); - - let runOnce = run.once(myContext, function() { - // will not be executed - }); - - run.cancel(runOnce); - - let throttle = run.throttle(myContext, function() { - // will not be executed - }, 1, false); - - run.cancel(throttle); - - let debounce = run.debounce(myContext, function() { - // will not be executed - }, 1); - - run.cancel(debounce); - - let debounceImmediate = run.debounce(myContext, function() { - // will be executed since we passed in true (immediate) - }, 100, true); - - // the 100ms delay until this method can be called again will be cancelled - run.cancel(debounceImmediate); - ``` - - @method cancel - @param {Object} timer Timer object to cancel - @return {Boolean} true if cancelled or false/undefined if it wasn't found - @public - */ - run.cancel = function (timer) { - return backburner.cancel(timer); - }; - - /** - Delay calling the target method until the debounce period has elapsed - with no additional debounce calls. If `debounce` is called again before - the specified time has elapsed, the timer is reset and the entire period - must pass again before the target method is called. - - This method should be used when an event may be called multiple times - but the action should only be called once when the event is done firing. - A common example is for scroll events where you only want updates to - happen once scrolling has ceased. - - ```javascript - function whoRan() { - console.log(this.name + ' ran.'); - } - - let myContext = { name: 'debounce' }; - - run.debounce(myContext, whoRan, 150); - - // less than 150ms passes - run.debounce(myContext, whoRan, 150); - - // 150ms passes - // whoRan is invoked with context myContext - // console logs 'debounce ran.' one time. - ``` - - Immediate allows you to run the function immediately, but debounce - other calls for this function until the wait time has elapsed. If - `debounce` is called again before the specified time has elapsed, - the timer is reset and the entire period must pass again before - the method can be called again. - - ```javascript - function whoRan() { - console.log(this.name + ' ran.'); - } - - let myContext = { name: 'debounce' }; - - run.debounce(myContext, whoRan, 150, true); - - // console logs 'debounce ran.' one time immediately. - // 100ms passes - run.debounce(myContext, whoRan, 150, true); - - // 150ms passes and nothing else is logged to the console and - // the debouncee is no longer being watched - run.debounce(myContext, whoRan, 150, true); - - // console logs 'debounce ran.' one time immediately. - // 150ms passes and nothing else is logged to the console and - // the debouncee is no longer being watched - - ``` - - @method debounce - @param {Object} [target] target of method to invoke - @param {Function|String} method The method to invoke. - May be a function or a string. If you pass a string - then it will be looked up on the passed target. - @param {Object} [args*] Optional arguments to pass to the timeout. - @param {Number} wait Number of milliseconds to wait. - @param {Boolean} immediate Trigger the function on the leading instead - of the trailing edge of the wait interval. Defaults to false. - @return {Array} Timer information for use in cancelling, see `run.cancel`. - @public - */ - run.debounce = function () { - return backburner.debounce.apply(backburner, arguments); - }; - - /** - Ensure that the target method is never called more frequently than - the specified spacing period. The target method is called immediately. - - ```javascript - function whoRan() { - console.log(this.name + ' ran.'); - } - - let myContext = { name: 'throttle' }; - - run.throttle(myContext, whoRan, 150); - // whoRan is invoked with context myContext - // console logs 'throttle ran.' - - // 50ms passes - run.throttle(myContext, whoRan, 150); - - // 50ms passes - run.throttle(myContext, whoRan, 150); - - // 150ms passes - run.throttle(myContext, whoRan, 150); - // whoRan is invoked with context myContext - // console logs 'throttle ran.' - ``` - - @method throttle - @param {Object} [target] target of method to invoke - @param {Function|String} method The method to invoke. - May be a function or a string. If you pass a string - then it will be looked up on the passed target. - @param {Object} [args*] Optional arguments to pass to the timeout. - @param {Number} spacing Number of milliseconds to space out requests. - @param {Boolean} immediate Trigger the function on the leading instead - of the trailing edge of the wait interval. Defaults to true. - @return {Array} Timer information for use in cancelling, see `run.cancel`. - @public - */ - run.throttle = function () { - return backburner.throttle.apply(backburner, arguments); - }; - - /** - Add a new named queue after the specified queue. - - The queue to add will only be added once. - - @method _addQueue - @param {String} name the name of the queue to add. - @param {String} after the name of the queue to add after. - @private - */ - run._addQueue = function (name, after) { - if (run.queues.indexOf(name) === -1) { - run.queues.splice(run.queues.indexOf(after) + 1, 0, name); - } - }; -}); -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 - observers will be buffered. - - ```javascript - let anObject = Ember.Object.create(); - - anObject.setProperties({ - firstName: 'Stanley', - lastName: 'Stuart', - age: 21 - }); - ``` - - @method setProperties - @param obj - @param {Object} properties - @return properties - @public - */ - - function setProperties(obj, properties) { - if (!properties || typeof properties !== 'object') { - return properties; - } - _emberMetalProperty_events.changeProperties(function () { - var props = Object.keys(properties); - var propertyName = undefined; - - for (var i = 0; i < props.length; i++) { - propertyName = props[i]; - - _emberMetalProperty_set.set(obj, propertyName, properties[propertyName]); - } - }); - return properties; - } -}); -enifed('ember-metal/tags', ['exports', 'glimmer-reference', 'ember-metal/meta', 'require', 'ember-metal/is_proxy'], function (exports, _glimmerReference, _emberMetalMeta, _require, _emberMetalIs_proxy) { - 'use strict'; - - exports.setHasViews = setHasViews; - exports.tagForProperty = tagForProperty; - exports.tagFor = tagFor; - exports.markObjectAsDirty = markObjectAsDirty; - - var hasViews = function () { - return false; - }; - - function setHasViews(fn) { - hasViews = fn; - } - - function makeTag() { - return new _glimmerReference.DirtyableTag(); - } - - function tagForProperty(object, propertyKey, _meta) { - if (_emberMetalIs_proxy.isProxy(object)) { - return tagFor(object, _meta); - } - - if (typeof object === 'object' && object) { - var meta = _meta || _emberMetalMeta.meta(object); - var tags = meta.writableTags(); - var tag = tags[propertyKey]; - if (tag) { - return tag; - } - - return tags[propertyKey] = makeTag(); - } else { - return _glimmerReference.CONSTANT_TAG; - } - } - - function tagFor(object, _meta) { - if (typeof object === 'object' && object) { - var meta = _meta || _emberMetalMeta.meta(object); - return meta.writableTag(makeTag); - } else { - return _glimmerReference.CONSTANT_TAG; - } - } - - function markObjectAsDirty(meta, propertyKey) { - var objectTag = meta && meta.readableTag(); - - if (objectTag) { - objectTag.dirty(); - } - - var tags = meta && meta.readableTags(); - var propertyTag = tags && tags[propertyKey]; - - if (propertyTag) { - propertyTag.dirty(); - } - - if (objectTag || propertyTag) { - ensureRunloop(); - } - } - - var run = undefined; - - function K() {} - - function ensureRunloop() { - if (!run) { - run = _require.default('ember-metal/run_loop').default; - } - - if (hasViews() && !run.backburner.currentInstance) { - run.schedule('actions', K); - } - } -}); -enifed("ember-metal/testing", ["exports"], function (exports) { - "use strict"; - - exports.isTesting = isTesting; - exports.setTesting = setTesting; - var testing = false; - - function isTesting() { - return testing; - } - - function setTesting(value) { - testing = !!value; - } -}); -enifed('ember-metal/transaction', ['exports', 'ember-metal/meta', 'ember-metal/debug', 'ember-metal/features'], function (exports, _emberMetalMeta, _emberMetalDebug, _emberMetalFeatures) { - 'use strict'; - - var runInTransaction = undefined, - didRender = undefined, - assertNotRendered = undefined; - - var raise = _emberMetalDebug.assert; - if (true) { - raise = function (message, test) { - _emberMetalDebug.deprecate(message, test, { id: 'ember-views.render-double-modify', until: '3.0.0' }); - }; - } - - var implication = undefined; - if (true) { - implication = 'will be removed in Ember 3.0.'; - } else if (true) { - implication = 'is no longer supported. See https://github.com/emberjs/ember.js/issues/13948 for more details.'; - } - - if (true || true) { - (function () { - var counter = 0; - var inTransaction = false; - var shouldReflush = undefined; - - exports.default = runInTransaction = function (context, methodName) { - shouldReflush = false; - inTransaction = true; - context[methodName](); - inTransaction = false; - counter++; - return shouldReflush; - }; - - exports.didRender = didRender = function (object, key, reference) { - if (!inTransaction) { - return; - } - var meta = _emberMetalMeta.meta(object); - var lastRendered = meta.writableLastRendered(); - lastRendered[key] = counter; - - _emberMetalDebug.runInDebug(function () { - var lastRenderedFrom = meta.writableLastRenderedFrom(); - lastRenderedFrom[key] = reference; - }); - }; - - exports.assertNotRendered = assertNotRendered = function (object, key, _meta) { - var meta = _meta || _emberMetalMeta.meta(object); - var lastRendered = meta.readableLastRendered(); - - if (lastRendered && lastRendered[key] === counter) { - raise((function () { - var ref = meta.readableLastRenderedFrom(); - var parts = []; - var lastRef = ref[key]; - - var label = undefined; - - if (lastRef) { - while (lastRef && lastRef._propertyKey) { - parts.unshift(lastRef._propertyKey); - lastRef = lastRef._parentReference; - } - - label = parts.join(); - } else { - label = 'the same value'; - } - - return 'You modified ' + parts.join('.') + ' twice on ' + object + ' in a single render. This was unreliable and slow in Ember 1.x and ' + implication; - })(), false); - - shouldReflush = true; - } - }; - })(); - } else { - exports.default = runInTransaction = function () { - throw new Error('Cannot call runInTransaction without Glimmer'); - }; - - exports.didRender = didRender = function () { - throw new Error('Cannot call didRender without Glimmer'); - }; - - exports.assertNotRendered = assertNotRendered = function () { - throw new Error('Cannot call assertNotRendered without Glimmer'); - }; - } - - exports.default = runInTransaction; - exports.didRender = didRender; - exports.assertNotRendered = assertNotRendered; -}); -enifed('ember-metal/watch_key', ['exports', 'ember-utils', 'ember-metal/features', 'ember-metal/meta', 'ember-metal/properties'], function (exports, _emberUtils, _emberMetalFeatures, _emberMetalMeta, _emberMetalProperties) { - 'use strict'; - - exports.watchKey = watchKey; - exports.unwatchKey = unwatchKey; - - var handleMandatorySetter = undefined; - - function watchKey(obj, keyName, meta) { - if (typeof obj !== 'object' || obj === null) { - return; - } - var m = meta || _emberMetalMeta.meta(obj); - - // activate watching first time - if (!m.peekWatching(keyName)) { - m.writeWatching(keyName, 1); - - var possibleDesc = obj[keyName]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - if (desc && desc.willWatch) { - desc.willWatch(obj, keyName); - } - - if ('function' === typeof obj.willWatchProperty) { - obj.willWatchProperty(keyName); - } - - if (true) { - // NOTE: this is dropped for prod + minified builds - handleMandatorySetter(m, obj, keyName); - } - } else { - m.writeWatching(keyName, (m.peekWatching(keyName) || 0) + 1); - } - } - - if (true) { - (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 = _emberUtils.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) { - if (typeof obj !== 'object' || obj === null) { - return; - } - var meta = _meta || _emberMetalMeta.meta(obj); - - // do nothing of this object has already been destroyed - if (meta.isSourceDestroyed()) { - return; - } - - var count = meta.peekWatching(keyName); - if (count === 1) { - meta.writeWatching(keyName, 0); - - var possibleDesc = obj[keyName]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - if (desc && desc.didUnwatch) { - desc.didUnwatch(obj, keyName); - } - - if ('function' === typeof obj.didUnwatchProperty) { - obj.didUnwatchProperty(keyName); - } - - if (true) { - // 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 = _emberUtils.lookupDescriptor(obj, keyName); - - if (maybeMandatoryDescriptor.set && maybeMandatoryDescriptor.set.isMandatorySetter) { - if (maybeMandatoryDescriptor.get && maybeMandatoryDescriptor.get.isInheritingGetter) { - var possibleValue = meta.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: meta.peekValues(keyName) - }); - meta.deleteFromValues(keyName); - } - } - } - } else if (count > 1) { - meta.writeWatching(keyName, count - 1); - } - } -}); -enifed('ember-metal/watch_path', ['exports', 'ember-metal/meta', 'ember-metal/chains'], function (exports, _emberMetalMeta, _emberMetalChains) { - 'use strict'; - - exports.makeChainNode = makeChainNode; - 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 - // the current object. - function chainsFor(obj, meta) { - return (meta || _emberMetalMeta.meta(obj)).writableChains(makeChainNode); - } - - function makeChainNode(obj) { - return new _emberMetalChains.ChainNode(null, null, obj); - } - - function watchPath(obj, keyPath, meta) { - if (typeof obj !== 'object' || obj === null) { - return; - } - var m = meta || _emberMetalMeta.meta(obj); - var counter = m.peekWatching(keyPath) || 0; - if (!counter) { - // activate watching first time - m.writeWatching(keyPath, 1); - chainsFor(obj, m).add(keyPath); - } else { - m.writeWatching(keyPath, counter + 1); - } - } - - function unwatchPath(obj, keyPath, meta) { - if (typeof obj !== 'object' || obj === null) { - return; - } - var m = meta || _emberMetalMeta.meta(obj); - var counter = m.peekWatching(keyPath) || 0; - - if (counter === 1) { - m.writeWatching(keyPath, 0); - chainsFor(obj, m).remove(keyPath); - } else if (counter > 1) { - m.writeWatching(keyPath, counter - 1); - } - } -}); -enifed('ember-metal/watching', ['exports', 'ember-metal/watch_key', 'ember-metal/watch_path', 'ember-metal/path_cache', 'ember-metal/meta'], function (exports, _emberMetalWatch_key, _emberMetalWatch_path, _emberMetalPath_cache, _emberMetalMeta) { - /** - @module ember-metal - */ - - 'use strict'; - - exports.isWatching = isWatching; - exports.watcherCount = watcherCount; - exports.unwatch = unwatch; - exports.destroy = destroy; - - /** - Starts watching a property on an object. Whenever the property changes, - invokes `Ember.propertyWillChange` and `Ember.propertyDidChange`. This is the - primitive used by observers and dependent keys; usually you will never call - this method directly but instead use higher level methods like - `Ember.addObserver()` - - @private - @method watch - @for Ember - @param obj - @param {String} _keyPath - */ - function watch(obj, _keyPath, m) { - if (!_emberMetalPath_cache.isPath(_keyPath)) { - _emberMetalWatch_key.watchKey(obj, _keyPath, m); - } else { - _emberMetalWatch_path.watchPath(obj, _keyPath, m); - } - } - - exports.watch = watch; - - function isWatching(obj, key) { - if (typeof obj !== 'object' || obj === null) { - return false; - } - var meta = _emberMetalMeta.peekMeta(obj); - return (meta && meta.peekWatching(key)) > 0; - } - - function watcherCount(obj, key) { - var meta = _emberMetalMeta.peekMeta(obj); - return meta && meta.peekWatching(key) || 0; - } - - function unwatch(obj, _keyPath, m) { - if (!_emberMetalPath_cache.isPath(_keyPath)) { - _emberMetalWatch_key.unwatchKey(obj, _keyPath, m); - } else { - _emberMetalWatch_path.unwatchPath(obj, _keyPath, m); - } - } - - /** - Tears down the meta on an object so that it can be garbage collected. - Multiple calls will have no effect. - - @method destroy - @for Ember - @param {Object} obj the object to destroy - @return {void} - @private - */ - - function destroy(obj) { - _emberMetalMeta.deleteMeta(obj); - } -}); -enifed('ember-metal/weak_map', ['exports', 'ember-utils', 'ember-metal/meta'], function (exports, _emberUtils, _emberMetalMeta) { - 'use strict'; - - exports.default = WeakMap; - - var id = 0; - - // Returns whether Type(value) is Object according to the terminology in the spec - function isObject(value) { - return typeof value === 'object' && value !== null || typeof value === 'function'; - } - - /* - * @class Ember.WeakMap - * @public - * @category ember-metal-weakmap - * - * A partial polyfill for [WeakMap](http://www.ecma-international.org/ecma-262/6.0/#sec-weakmap-objects). - * - * There is a small but important caveat. This implementation assumes that the - * weak map will live longer (in the sense of garbage collection) than all of its - * keys, otherwise it is possible to leak the values stored in the weak map. In - * practice, most use cases satisfy this limitation which is why it is included - * in ember-metal. - */ - - function WeakMap(iterable) { - if (!(this instanceof WeakMap)) { - throw new TypeError('Constructor WeakMap requires \'new\''); - } - - this._id = _emberUtils.GUID_KEY + id++; - - if (iterable === null || iterable === undefined) { - return; - } else if (Array.isArray(iterable)) { - for (var i = 0; i < iterable.length; i++) { - var _iterable$i = iterable[i]; - var key = _iterable$i[0]; - var value = _iterable$i[1]; - - this.set(key, value); - } - } else { - throw new TypeError('The weak map constructor polyfill only supports an array argument'); - } - } - - /* - * @method get - * @param key {Object | Function} - * @return {Any} stored value - */ - WeakMap.prototype.get = function (obj) { - if (!isObject(obj)) { - return undefined; - } - - var meta = _emberMetalMeta.peekMeta(obj); - if (meta) { - var map = meta.readableWeak(); - if (map) { - if (map[this._id] === _emberMetalMeta.UNDEFINED) { - return undefined; - } - - return map[this._id]; - } - } - }; - - /* - * @method set - * @param key {Object | Function} - * @param value {Any} - * @return {WeakMap} the weak map - */ - WeakMap.prototype.set = function (obj, value) { - if (!isObject(obj)) { - throw new TypeError('Invalid value used as weak map key'); - } - - if (value === undefined) { - value = _emberMetalMeta.UNDEFINED; - } - - _emberMetalMeta.meta(obj).writableWeak()[this._id] = value; - - return this; - }; - - /* - * @method has - * @param key {Object | Function} - * @return {boolean} if the key exists - */ - WeakMap.prototype.has = function (obj) { - if (!isObject(obj)) { - return false; - } - - var meta = _emberMetalMeta.peekMeta(obj); - if (meta) { - var map = meta.readableWeak(); - if (map) { - return map[this._id] !== undefined; - } - } - - return false; - }; - - /* - * @method delete - * @param key {Object | Function} - * @return {boolean} if the key was deleted - */ - WeakMap.prototype.delete = function (obj) { - if (this.has(obj)) { - delete _emberMetalMeta.meta(obj).writableWeak()[this._id]; - return true; - } else { - return false; - } - }; - - /* - * @method toString - * @return {String} - */ - WeakMap.prototype.toString = function () { - return '[object WeakMap]'; - }; -}); -enifed('ember-routing/ext/controller', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/utils'], function (exports, _emberMetal, _emberRuntime, _emberRoutingUtils) { - 'use strict'; - - /** - @module ember - @submodule ember-routing - */ - - _emberRuntime.ControllerMixin.reopen({ - concatenatedProperties: ['queryParams'], - - /** - Defines which query parameters the controller accepts. - If you give the names `['category','page']` it will bind - the values of these query parameters to the variables - `this.category` and `this.page` - @property queryParams - @public - */ - queryParams: null, - - /** - This property is updated to various different callback functions depending on - the current "state" of the backing route. It is used by - `Ember.Controller.prototype._qpChanged`. - The methods backing each state can be found in the `Ember.Route.prototype._qp` computed - property return value (the `.states` property). The current values are listed here for - the sanity of future travelers: - * `inactive` - This state is used when this controller instance is not part of the active - route heirarchy. Set in `Ember.Route.prototype._reset` (a `router.js` microlib hook) and - `Ember.Route.prototype.actions.finalizeQueryParamChange`. - * `active` - This state is used when this controller instance is part of the active - route heirarchy. Set in `Ember.Route.prototype.actions.finalizeQueryParamChange`. - * `allowOverrides` - This state is used in `Ember.Route.prototype.setup` (`route.js` microlib hook). - @method _qpDelegate - @private - */ - _qpDelegate: null, // set by route - - /** - During `Ember.Route#setup` observers are created to invoke this method - when any of the query params declared in `Ember.Controller#queryParams` property - are changed. - When invoked this method uses the currently active query param update delegate - (see `Ember.Controller.prototype._qpDelegate` for details) and invokes it with - the QP key/value being changed. - @method _qpChanged - @private - */ - _qpChanged: function (controller, _prop) { - var prop = _prop.substr(0, _prop.length - 3); - - var delegate = controller._qpDelegate; - var value = _emberMetal.get(controller, prop); - delegate(prop, value); - }, - - /** - Transition the application into another route. The route may - be either a single route or route path: - ```javascript - aController.transitionToRoute('blogPosts'); - aController.transitionToRoute('blogPosts.recentEntries'); - ``` - Optionally supply a model for the route in question. The model - will be serialized into the URL using the `serialize` hook of - the route: - ```javascript - aController.transitionToRoute('blogPost', aPost); - ``` - If a literal is passed (such as a number or a string), it will - be treated as an identifier instead. In this case, the `model` - hook of the route will be triggered: - ```javascript - aController.transitionToRoute('blogPost', 1); - ``` - Multiple models will be applied last to first recursively up the - route tree. - ```javascript - App.Router.map(function() { - this.route('blogPost', { path: ':blogPostId' }, function() { - this.route('blogComment', { path: ':blogCommentId', resetNamespace: true }); - }); - }); - aController.transitionToRoute('blogComment', aPost, aComment); - aController.transitionToRoute('blogComment', 1, 13); - ``` - It is also possible to pass a URL (a string that starts with a - `/`). This is intended for testing and debugging purposes and - should rarely be used in production code. - ```javascript - aController.transitionToRoute('/'); - aController.transitionToRoute('/blog/post/1/comment/13'); - aController.transitionToRoute('/blog/posts?sort=title'); - ``` - An options hash with a `queryParams` property may be provided as - the final argument to add query parameters to the destination URL. - ```javascript - aController.transitionToRoute('blogPost', 1, { - queryParams: { showComments: 'true' } - }); - // if you just want to transition the query parameters without changing the route - aController.transitionToRoute({ queryParams: { sort: 'date' } }); - ``` - See also [replaceRoute](/api/classes/Ember.ControllerMixin.html#method_replaceRoute). - @param {String} name the name of the route or a URL - @param {...Object} models the model(s) or identifier(s) to be used - while transitioning to the route. - @param {Object} [options] optional hash with a queryParams property - containing a mapping of query parameters - @for Ember.ControllerMixin - @method transitionToRoute - @public - */ - transitionToRoute: function () { - // target may be either another controller or a router - var target = _emberMetal.get(this, 'target'); - var method = target.transitionToRoute || target.transitionTo; - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return method.apply(target, _emberRoutingUtils.prefixRouteNameArg(this, args)); - }, - - /** - Transition into another route while replacing the current URL, if possible. - This will replace the current history entry instead of adding a new one. - Beside that, it is identical to `transitionToRoute` in all other respects. - ```javascript - aController.replaceRoute('blogPosts'); - aController.replaceRoute('blogPosts.recentEntries'); - ``` - Optionally supply a model for the route in question. The model - will be serialized into the URL using the `serialize` hook of - the route: - ```javascript - aController.replaceRoute('blogPost', aPost); - ``` - If a literal is passed (such as a number or a string), it will - be treated as an identifier instead. In this case, the `model` - hook of the route will be triggered: - ```javascript - aController.replaceRoute('blogPost', 1); - ``` - Multiple models will be applied last to first recursively up the - route tree. - ```javascript - App.Router.map(function() { - this.route('blogPost', { path: ':blogPostId' }, function() { - this.route('blogComment', { path: ':blogCommentId', resetNamespace: true }); - }); - }); - aController.replaceRoute('blogComment', aPost, aComment); - aController.replaceRoute('blogComment', 1, 13); - ``` - It is also possible to pass a URL (a string that starts with a - `/`). This is intended for testing and debugging purposes and - should rarely be used in production code. - ```javascript - aController.replaceRoute('/'); - aController.replaceRoute('/blog/post/1/comment/13'); - ``` - @param {String} name the name of the route or a URL - @param {...Object} models the model(s) or identifier(s) to be used - while transitioning to the route. - @for Ember.ControllerMixin - @method replaceRoute - @public - */ - replaceRoute: function () { - // target may be either another controller or a router - var target = _emberMetal.get(this, 'target'); - var method = target.replaceRoute || target.replaceWith; - - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - return method.apply(target, _emberRoutingUtils.prefixRouteNameArg(target, args)); - } - }); - - exports.default = _emberRuntime.ControllerMixin; -}); -enifed('ember-routing/ext/run_loop', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; - - /** - @module ember - @submodule ember-views - */ - - // Add a new named queue after the 'actions' queue (where RSVP promises - // resolve), which is used in router transitions to prevent unnecessary - // loading state entry if all context promises resolve on the - // 'actions' queue first. - _emberMetal.run._addQueue('routerTransitions', 'actions'); -}); -enifed('ember-routing/index', ['exports', '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/system/query_params', 'ember-routing/services/routing', 'ember-routing/system/cache'], function (exports, _emberRoutingExtRun_loop, _emberRoutingExtController, _emberRoutingLocationApi, _emberRoutingLocationNone_location, _emberRoutingLocationHash_location, _emberRoutingLocationHistory_location, _emberRoutingLocationAuto_location, _emberRoutingSystemGenerate_controller, _emberRoutingSystemController_for, _emberRoutingSystemDsl, _emberRoutingSystemRouter, _emberRoutingSystemRoute, _emberRoutingSystemQuery_params, _emberRoutingServicesRouting, _emberRoutingSystemCache) { - /** - @module ember - @submodule ember-routing - */ - - // ES6TODO: Cleanup modules with side-effects below - 'use strict'; - - exports.Location = _emberRoutingLocationApi.default; - exports.NoneLocation = _emberRoutingLocationNone_location.default; - exports.HashLocation = _emberRoutingLocationHash_location.default; - exports.HistoryLocation = _emberRoutingLocationHistory_location.default; - exports.AutoLocation = _emberRoutingLocationAuto_location.default; - exports.generateController = _emberRoutingSystemGenerate_controller.default; - exports.generateControllerFactory = _emberRoutingSystemGenerate_controller.generateControllerFactory; - exports.controllerFor = _emberRoutingSystemController_for.default; - exports.RouterDSL = _emberRoutingSystemDsl.default; - exports.Router = _emberRoutingSystemRouter.default; - exports.Route = _emberRoutingSystemRoute.default; - exports.QueryParams = _emberRoutingSystemQuery_params.default; - exports.RoutingService = _emberRoutingServicesRouting.default; - exports.BucketCache = _emberRoutingSystemCache.default; -}); -enifed('ember-routing/location/api', ['exports', 'ember-metal', 'ember-environment', 'ember-routing/location/util'], function (exports, _emberMetal, _emberEnvironment, _emberRoutingLocationUtil) { - 'use strict'; - - /** - @module ember - @submodule ember-routing - */ - - /** - Ember.Location returns an instance of the correct implementation of - the `location` API. - - ## Implementations - - You can pass an implementation name (`hash`, `history`, `none`) to force a - particular implementation to be used in your application. - - ### HashLocation - - Using `HashLocation` results in URLs with a `#` (hash sign) separating the - server side URL portion of the URL from the portion that is used by Ember. - This relies upon the `hashchange` event existing in the browser. - - Example: - - ```javascript - App.Router.map(function() { - this.route('posts', function() { - this.route('new'); - }); - }); - - App.Router.reopen({ - location: 'hash' - }); - ``` - - This will result in a posts.new url of `/#/posts/new`. - - ### HistoryLocation - - Using `HistoryLocation` results in URLs that are indistinguishable from a - standard URL. This relies upon the browser's `history` API. - - Example: - - ```javascript - App.Router.map(function() { - this.route('posts', function() { - this.route('new'); - }); - }); - - App.Router.reopen({ - location: 'history' - }); - ``` - - This will result in a posts.new url of `/posts/new`. - - Keep in mind that your server must serve the Ember app at all the routes you - define. - - ### AutoLocation - - Using `AutoLocation`, the router will use the best Location class supported by - the browser it is running in. - - Browsers that support the `history` API will use `HistoryLocation`, those that - do not, but still support the `hashchange` event will use `HashLocation`, and - in the rare case neither is supported will use `NoneLocation`. - - Example: - - ```javascript - App.Router.map(function() { - this.route('posts', function() { - this.route('new'); - }); - }); - - App.Router.reopen({ - location: 'auto' - }); - ``` - - This will result in a posts.new url of `/posts/new` for modern browsers that - support the `history` api or `/#/posts/new` for older ones, like Internet - Explorer 9 and below. - - When a user visits a link to your application, they will be automatically - upgraded or downgraded to the appropriate `Location` class, with the URL - transformed accordingly, if needed. - - Keep in mind that since some of your users will use `HistoryLocation`, your - server must serve the Ember app at all the routes you define. - - ### NoneLocation - - Using `NoneLocation` causes Ember to not store the applications URL state - in the actual URL. This is generally used for testing purposes, and is one - of the changes made when calling `App.setupForTesting()`. - - ## Location API - - Each location implementation must provide the following methods: - - * implementation: returns the string name used to reference the implementation. - * getURL: returns the current URL. - * setURL(path): sets the current URL. - * replaceURL(path): replace the current URL (optional). - * onUpdateURL(callback): triggers the callback when the URL changes. - * formatURL(url): formats `url` to be placed into `href` attribute. - * detect() (optional): instructs the location to do any feature detection - necessary. If the location needs to redirect to a different URL, it - can cancel routing by setting the `cancelRouterSetup` property on itself - to `false`. - - Calling setURL or replaceURL will not trigger onUpdateURL callbacks. - - ## Custom implementation - - Ember scans `app/locations/*` for extending the Location API. - - Example: - - ```javascript - import Ember from 'ember'; - - export default Ember.HistoryLocation.extend({ - implementation: 'history-url-logging', - - pushState: function (path) { - console.log(path); - this._super.apply(this, arguments); - } - }); - ``` - - @class Location - @namespace Ember - @static - @private - */ - exports.default = { - /** - This is deprecated in favor of using the container to lookup the location - implementation as desired. - For example: - ```javascript - // Given a location registered as follows: - container.register('location:history-test', HistoryTestLocation); - // You could create a new instance via: - container.lookup('location:history-test'); - ``` - @method create - @param {Object} options - @return {Object} an instance of an implementation of the `location` API - @deprecated Use the container to lookup the location implementation that you - need. - @private - */ - create: function (options) { - var implementation = options && options.implementation; - _emberMetal.assert('Ember.Location.create: you must specify a \'implementation\' option', !!implementation); - - var implementationClass = this.implementations[implementation]; - _emberMetal.assert('Ember.Location.create: ' + implementation + ' is not a valid implementation', !!implementationClass); - - return implementationClass.create.apply(implementationClass, arguments); - }, - - implementations: {}, - _location: _emberEnvironment.environment.location, - - /** - Returns the current `location.hash` by parsing location.href since browsers - inconsistently URL-decode `location.hash`. - https://bugzilla.mozilla.org/show_bug.cgi?id=483304 - @private - @method getHash - @since 1.4.0 - */ - _getHash: function () { - return _emberRoutingLocationUtil.getHash(this.location); - } - }; -}); -enifed('ember-routing/location/auto_location', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-environment', 'ember-routing/location/util'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberEnvironment, _emberRoutingLocationUtil) { - 'use strict'; - - exports.getHistoryPath = getHistoryPath; - exports.getHashPath = getHashPath; - - /** - @module ember - @submodule ember-routing - */ - - /** - Ember.AutoLocation will select the best location option based off browser - support with the priority order: history, hash, none. - - Clean pushState paths accessed by hashchange-only browsers will be redirected - to the hash-equivalent and vice versa so future transitions are consistent. - - Keep in mind that since some of your users will use `HistoryLocation`, your - server must serve the Ember app at all the routes you define. - - @class AutoLocation - @namespace Ember - @static - @private - */ - exports.default = _emberRuntime.Object.extend({ - /** - @private - The browser's `location` object. This is typically equivalent to - `window.location`, but may be overridden for testing. - @property location - @default environment.location - */ - location: _emberEnvironment.environment.location, - - /** - @private - The browser's `history` object. This is typically equivalent to - `window.history`, but may be overridden for testing. - @since 1.5.1 - @property history - @default environment.history - */ - history: _emberEnvironment.environment.history, - - /** - @private - The user agent's global variable. In browsers, this will be `window`. - @since 1.11 - @property global - @default window - */ - global: _emberEnvironment.environment.window, - - /** - @private - The browser's `userAgent`. This is typically equivalent to - `navigator.userAgent`, but may be overridden for testing. - @since 1.5.1 - @property userAgent - @default environment.history - */ - userAgent: _emberEnvironment.environment.userAgent, - - /** - @private - This property is used by the router to know whether to cancel the routing - setup process, which is needed while we redirect the browser. - @since 1.5.1 - @property cancelRouterSetup - @default false - */ - cancelRouterSetup: false, - - /** - @private - Will be pre-pended to path upon state change. - @since 1.5.1 - @property rootURL - @default '/' - */ - rootURL: '/', - - /** - Called by the router to instruct the location to do any feature detection - necessary. In the case of AutoLocation, we detect whether to use history - or hash concrete implementations. - @private - */ - detect: function () { - var rootURL = this.rootURL; - - _emberMetal.assert('rootURL must end with a trailing forward slash e.g. "/app/"', rootURL.charAt(rootURL.length - 1) === '/'); - - var implementation = detectImplementation({ - location: this.location, - history: this.history, - userAgent: this.userAgent, - rootURL: rootURL, - documentMode: this.documentMode, - global: this.global - }); - - if (implementation === false) { - _emberMetal.set(this, 'cancelRouterSetup', true); - implementation = 'none'; - } - - var concrete = _emberUtils.getOwner(this).lookup('location:' + implementation); - _emberMetal.set(concrete, 'rootURL', rootURL); - - _emberMetal.assert('Could not find location \'' + implementation + '\'.', !!concrete); - - _emberMetal.set(this, 'concreteImplementation', concrete); - }, - - initState: delegateToConcreteImplementation('initState'), - getURL: delegateToConcreteImplementation('getURL'), - setURL: delegateToConcreteImplementation('setURL'), - replaceURL: delegateToConcreteImplementation('replaceURL'), - onUpdateURL: delegateToConcreteImplementation('onUpdateURL'), - formatURL: delegateToConcreteImplementation('formatURL'), - - willDestroy: function () { - var concreteImplementation = _emberMetal.get(this, 'concreteImplementation'); - - if (concreteImplementation) { - concreteImplementation.destroy(); - } - } - }); - - function delegateToConcreteImplementation(methodName) { - return function () { - var concreteImplementation = _emberMetal.get(this, 'concreteImplementation'); - _emberMetal.assert('AutoLocation\'s detect() method should be called before calling any other hooks.', !!concreteImplementation); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _emberUtils.tryInvoke(concreteImplementation, methodName, args); - }; - } - - /* - Given the browser's `location`, `history` and `userAgent`, and a configured - root URL, this function detects whether the browser supports the [History - API](https://developer.mozilla.org/en-US/docs/Web/API/History) and returns a - string representing the Location object to use based on its determination. - - For example, if the page loads in an evergreen browser, this function would - return the string "history", meaning the history API and thus HistoryLocation - should be used. If the page is loaded in IE8, it will return the string - "hash," indicating that the History API should be simulated by manipulating the - hash portion of the location. - - */ - - function detectImplementation(options) { - var location = options.location; - var userAgent = options.userAgent; - var history = options.history; - var documentMode = options.documentMode; - var global = options.global; - var rootURL = options.rootURL; - - var implementation = 'none'; - var cancelRouterSetup = false; - var currentPath = _emberRoutingLocationUtil.getFullPath(location); - - if (_emberRoutingLocationUtil.supportsHistory(userAgent, history)) { - var historyPath = getHistoryPath(rootURL, location); - - // If the browser supports history and we have a history path, we can use - // the history location with no redirects. - if (currentPath === historyPath) { - return 'history'; - } else { - if (currentPath.substr(0, 2) === '/#') { - history.replaceState({ path: historyPath }, null, historyPath); - implementation = 'history'; - } else { - cancelRouterSetup = true; - _emberRoutingLocationUtil.replacePath(location, historyPath); - } - } - } else if (_emberRoutingLocationUtil.supportsHashChange(documentMode, global)) { - var hashPath = getHashPath(rootURL, location); - - // Be sure we're using a hashed path, otherwise let's switch over it to so - // we start off clean and consistent. We'll count an index path with no - // hash as "good enough" as well. - if (currentPath === hashPath || currentPath === '/' && hashPath === '/#/') { - implementation = 'hash'; - } else { - // Our URL isn't in the expected hash-supported format, so we want to - // cancel the router setup and replace the URL to start off clean - cancelRouterSetup = true; - _emberRoutingLocationUtil.replacePath(location, hashPath); - } - } - - if (cancelRouterSetup) { - return false; - } - - return implementation; - } - - /** - @private - - Returns the current path as it should appear for HistoryLocation supported - browsers. This may very well differ from the real current path (e.g. if it - starts off as a hashed URL) - */ - - function getHistoryPath(rootURL, location) { - var path = _emberRoutingLocationUtil.getPath(location); - var hash = _emberRoutingLocationUtil.getHash(location); - var query = _emberRoutingLocationUtil.getQuery(location); - var rootURLIndex = path.indexOf(rootURL); - var routeHash = undefined, - hashParts = undefined; - - _emberMetal.assert('Path ' + path + ' does not start with the provided rootURL ' + rootURL, rootURLIndex === 0); - - // By convention, Ember.js routes using HashLocation are required to start - // with `#/`. Anything else should NOT be considered a route and should - // be passed straight through, without transformation. - if (hash.substr(0, 2) === '#/') { - // There could be extra hash segments after the route - hashParts = hash.substr(1).split('#'); - // The first one is always the route url - routeHash = hashParts.shift(); - - // If the path already has a trailing slash, remove the one - // from the hashed route so we don't double up. - if (path.slice(-1) === '/') { - routeHash = routeHash.substr(1); - } - - // This is the "expected" final order - path = path + routeHash + query; - - if (hashParts.length) { - path += '#' + hashParts.join('#'); - } - } else { - path = path + query + hash; - } - - return path; - } - - /** - @private - - Returns the current path as it should appear for HashLocation supported - browsers. This may very well differ from the real current path. - - @method _getHashPath - */ - - function getHashPath(rootURL, location) { - var path = rootURL; - var historyPath = getHistoryPath(rootURL, location); - var routePath = historyPath.substr(rootURL.length); - - if (routePath !== '') { - if (routePath.charAt(0) !== '/') { - routePath = '/' + routePath; - } - - path += '#' + routePath; - } - - return path; - } -}); -enifed('ember-routing/location/hash_location', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/location/api'], function (exports, _emberMetal, _emberRuntime, _emberRoutingLocationApi) { - 'use strict'; - - /** - @module ember - @submodule ember-routing - */ - - /** - `Ember.HashLocation` implements the location API using the browser's - hash. At present, it relies on a `hashchange` event existing in the - browser. - - @class HashLocation - @namespace Ember - @extends Ember.Object - @private - */ - exports.default = _emberRuntime.Object.extend({ - implementation: 'hash', - - init: function () { - _emberMetal.set(this, 'location', _emberMetal.get(this, '_location') || window.location); - - this._hashchangeHandler = undefined; - }, - - /** - @private - Returns normalized location.hash - @since 1.5.1 - @method getHash - */ - getHash: _emberRoutingLocationApi.default._getHash, - - /** - Returns the normalized URL, constructed from `location.hash`. - e.g. `#/foo` => `/foo` as well as `#/foo#bar` => `/foo#bar`. - By convention, hashed paths must begin with a forward slash, otherwise they - are not treated as a path so we can distinguish intent. - @private - @method getURL - */ - getURL: function () { - var originalPath = this.getHash().substr(1); - var outPath = originalPath; - - if (outPath.charAt(0) !== '/') { - outPath = '/'; - - // Only add the # if the path isn't empty. - // We do NOT want `/#` since the ampersand - // is only included (conventionally) when - // the location.hash has a value - if (originalPath) { - outPath += '#' + originalPath; - } - } - - return outPath; - }, - - /** - Set the `location.hash` and remembers what was set. This prevents - `onUpdateURL` callbacks from triggering when the hash was set by - `HashLocation`. - @private - @method setURL - @param path {String} - */ - setURL: function (path) { - _emberMetal.get(this, 'location').hash = path; - _emberMetal.set(this, 'lastSetURL', path); - }, - - /** - Uses location.replace to update the url without a page reload - or history modification. - @private - @method replaceURL - @param path {String} - */ - replaceURL: function (path) { - _emberMetal.get(this, 'location').replace('#' + path); - _emberMetal.set(this, 'lastSetURL', path); - }, - - /** - Register a callback to be invoked when the hash changes. These - callbacks will execute when the user presses the back or forward - button, but not after `setURL` is invoked. - @private - @method onUpdateURL - @param callback {Function} - */ - onUpdateURL: function (callback) { - var _this = this; - - this._removeEventListener(); - - this._hashchangeHandler = function () { - _emberMetal.run(function () { - var path = _this.getURL(); - if (_emberMetal.get(_this, 'lastSetURL') === path) { - return; - } - - _emberMetal.set(_this, 'lastSetURL', null); - - callback(path); - }); - }; - - window.addEventListener('hashchange', this._hashchangeHandler); - }, - - /** - Given a URL, formats it to be placed into the page as part - of an element's `href` attribute. - This is used, for example, when using the {{action}} helper - to generate a URL based on an event. - @private - @method formatURL - @param url {String} - */ - formatURL: function (url) { - return '#' + url; - }, - - /** - Cleans up the HashLocation event listener. - @private - @method willDestroy - */ - willDestroy: function () { - this._removeEventListener(); - }, - - _removeEventListener: function () { - if (this._hashchangeHandler) { - window.removeEventListener('hashchange', this._hashchangeHandler); - } - } - }); -}); -enifed('ember-routing/location/history_location', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/location/api'], function (exports, _emberMetal, _emberRuntime, _emberRoutingLocationApi) { - 'use strict'; - - /** - @module ember - @submodule ember-routing - */ - - var popstateFired = false; - - /** - Ember.HistoryLocation implements the location API using the browser's - history.pushState API. - - @class HistoryLocation - @namespace Ember - @extends Ember.Object - @private - */ - exports.default = _emberRuntime.Object.extend({ - implementation: 'history', - - init: function () { - this._super.apply(this, arguments); - - var base = document.querySelector('base'); - var baseURL = base ? base.getAttribute('href') : ''; - - _emberMetal.set(this, 'baseURL', baseURL); - _emberMetal.set(this, 'location', _emberMetal.get(this, 'location') || window.location); - - this._popstateHandler = undefined; - }, - - /** - Used to set state on first call to setURL - @private - @method initState - */ - initState: function () { - var history = _emberMetal.get(this, 'history') || window.history; - _emberMetal.set(this, 'history', history); - - if (history && 'state' in history) { - this.supportsHistory = true; - } - - this.replaceState(this.formatURL(this.getURL())); - }, - - /** - Will be pre-pended to path upon state change - @property rootURL - @default '/' - @private - */ - rootURL: '/', - - /** - Returns the current `location.pathname` without `rootURL` or `baseURL` - @private - @method getURL - @return url {String} - */ - getURL: function () { - var location = _emberMetal.get(this, 'location'); - var path = location.pathname; - - var rootURL = _emberMetal.get(this, 'rootURL'); - var baseURL = _emberMetal.get(this, 'baseURL'); - - // remove trailing slashes if they exists - rootURL = rootURL.replace(/\/$/, ''); - baseURL = baseURL.replace(/\/$/, ''); - - // remove baseURL and rootURL from start of path - var url = path.replace(new RegExp('^' + baseURL + '(?=/|$)'), '').replace(new RegExp('^' + rootURL + '(?=/|$)'), ''); - - var search = location.search || ''; - url += search; - url += this.getHash(); - - return url; - }, - - /** - Uses `history.pushState` to update the url without a page reload. - @private - @method setURL - @param path {String} - */ - setURL: function (path) { - var state = this.getState(); - path = this.formatURL(path); - - if (!state || state.path !== path) { - this.pushState(path); - } - }, - - /** - Uses `history.replaceState` to update the url without a page reload - or history modification. - @private - @method replaceURL - @param path {String} - */ - replaceURL: function (path) { - var state = this.getState(); - path = this.formatURL(path); - - if (!state || state.path !== path) { - this.replaceState(path); - } - }, - - /** - Get the current `history.state`. Checks for if a polyfill is - required and if so fetches this._historyState. The state returned - from getState may be null if an iframe has changed a window's - history. - @private - @method getState - @return state {Object} - */ - getState: function () { - if (this.supportsHistory) { - return _emberMetal.get(this, 'history').state; - } - - return this._historyState; - }, - - /** - Pushes a new state. - @private - @method pushState - @param path {String} - */ - pushState: function (path) { - var state = { path: path }; - - _emberMetal.get(this, 'history').pushState(state, null, path); - - this._historyState = state; - - // used for webkit workaround - this._previousURL = this.getURL(); - }, - - /** - Replaces the current state. - @private - @method replaceState - @param path {String} - */ - replaceState: function (path) { - var state = { path: path }; - _emberMetal.get(this, 'history').replaceState(state, null, path); - - this._historyState = state; - - // used for webkit workaround - this._previousURL = this.getURL(); - }, - - /** - Register a callback to be invoked whenever the browser - history changes, including using forward and back buttons. - @private - @method onUpdateURL - @param callback {Function} - */ - onUpdateURL: function (callback) { - var _this = this; - - this._removeEventListener(); - - this._popstateHandler = function () { - // Ignore initial page load popstate event in Chrome - if (!popstateFired) { - popstateFired = true; - if (_this.getURL() === _this._previousURL) { - return; - } - } - callback(_this.getURL()); - }; - - window.addEventListener('popstate', this._popstateHandler); - }, - - /** - Used when using `{{action}}` helper. The url is always appended to the rootURL. - @private - @method formatURL - @param url {String} - @return formatted url {String} - */ - formatURL: function (url) { - var rootURL = _emberMetal.get(this, 'rootURL'); - var baseURL = _emberMetal.get(this, 'baseURL'); - - if (url !== '') { - // remove trailing slashes if they exists - rootURL = rootURL.replace(/\/$/, ''); - baseURL = baseURL.replace(/\/$/, ''); - } else if (baseURL.match(/^\//) && rootURL.match(/^\//)) { - // if baseURL and rootURL both start with a slash - // ... remove trailing slash from baseURL if it exists - baseURL = baseURL.replace(/\/$/, ''); - } - - return baseURL + rootURL + url; - }, - - /** - Cleans up the HistoryLocation event listener. - @private - @method willDestroy - */ - willDestroy: function () { - this._removeEventListener(); - }, - - /** - @private - Returns normalized location.hash - @method getHash - */ - getHash: _emberRoutingLocationApi.default._getHash, - - _removeEventListener: function () { - if (this._popstateHandler) { - window.removeEventListener('popstate', this._popstateHandler); - } - } - }); -}); -enifed('ember-routing/location/none_location', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { - 'use strict'; - - /** - @module ember - @submodule ember-routing - */ - - /** - Ember.NoneLocation does not interact with the browser. It is useful for - testing, or when you need to manage state with your Router, but temporarily - don't want it to muck with the URL (for example when you embed your - application in a larger page). - - @class NoneLocation - @namespace Ember - @extends Ember.Object - @private - */ - exports.default = _emberRuntime.Object.extend({ - implementation: 'none', - path: '', - - detect: function () { - var rootURL = this.rootURL; - - _emberMetal.assert('rootURL must end with a trailing forward slash e.g. "/app/"', rootURL.charAt(rootURL.length - 1) === '/'); - }, - - /** - Will be pre-pended to path. - @private - @property rootURL - @default '/' - */ - rootURL: '/', - - /** - Returns the current path without `rootURL`. - @private - @method getURL - @return {String} path - */ - getURL: function () { - var path = _emberMetal.get(this, 'path'); - var rootURL = _emberMetal.get(this, 'rootURL'); - - // remove trailing slashes if they exists - rootURL = rootURL.replace(/\/$/, ''); - - // remove rootURL from url - return path.replace(new RegExp('^' + rootURL + '(?=/|$)'), ''); - }, - - /** - Set the path and remembers what was set. Using this method - to change the path will not invoke the `updateURL` callback. - @private - @method setURL - @param path {String} - */ - setURL: function (path) { - _emberMetal.set(this, 'path', path); - }, - - /** - Register a callback to be invoked when the path changes. These - callbacks will execute when the user presses the back or forward - button, but not after `setURL` is invoked. - @private - @method onUpdateURL - @param callback {Function} - */ - onUpdateURL: function (callback) { - this.updateCallback = callback; - }, - - /** - Sets the path and calls the `updateURL` callback. - @private - @method handleURL - @param callback {Function} - */ - handleURL: function (url) { - _emberMetal.set(this, 'path', url); - this.updateCallback(url); - }, - - /** - Given a URL, formats it to be placed into the page as part - of an element's `href` attribute. - This is used, for example, when using the {{action}} helper - to generate a URL based on an event. - @private - @method formatURL - @param url {String} - @return {String} url - */ - formatURL: function (url) { - var rootURL = _emberMetal.get(this, 'rootURL'); - - if (url !== '') { - // remove trailing slashes if they exists - rootURL = rootURL.replace(/\/$/, ''); - } - - return rootURL + 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; - - function getPath(location) { - var pathname = location.pathname; - // Various versions of IE/Opera don't always return a leading slash - if (pathname.charAt(0) !== '/') { - pathname = '/' + pathname; - } - - return pathname; - } - - /** - @private - - Returns the current `location.search`. - */ - - function getQuery(location) { - return location.search; - } - - /** - @private - - Returns the current `location.hash` by parsing location.href since browsers - inconsistently URL-decode `location.hash`. - - Should be passed the browser's `location` object as the first argument. - - https://bugzilla.mozilla.org/show_bug.cgi?id=483304 - */ - - function getHash(location) { - var href = location.href; - var hashIndex = href.indexOf('#'); - - if (hashIndex === -1) { - return ''; - } else { - return href.substr(hashIndex); - } - } - - function getFullPath(location) { - return getPath(location) + getQuery(location) + getHash(location); - } - - function getOrigin(location) { - var origin = location.origin; - - // Older browsers, especially IE, don't have origin - if (!origin) { - origin = location.protocol + '//' + location.hostname; - - if (location.port) { - origin += ':' + location.port; - } - } - - return origin; - } - - /* - `documentMode` only exist in Internet Explorer, and it's tested because IE8 running in - IE7 compatibility mode claims to support `onhashchange` but actually does not. - - `global` is an object that may have an `onhashchange` property. - - @private - @function supportsHashChange - */ - - function supportsHashChange(documentMode, global) { - return 'onhashchange' in global && (documentMode === undefined || documentMode > 7); - } - - /* - `userAgent` is a user agent string. We use user agent testing here, because - the stock Android browser is known to have buggy versions of the History API, - in some Android versions. - - @private - @function supportsHistory - */ - - function supportsHistory(userAgent, history) { - // Boosted from Modernizr: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js - // The stock browser on Android 2.2 & 2.3, and 4.0.x returns positive on history support - // Unfortunately support is really buggy and there is no clean way to detect - // these bugs, so we fall back to a user agent sniff :( - - // We only want Android 2 and 4.0, stock browser, and not Chrome which identifies - // itself as 'Mobile Safari' as well, nor Windows Phone. - if ((userAgent.indexOf('Android 2.') !== -1 || userAgent.indexOf('Android 4.0') !== -1) && userAgent.indexOf('Mobile Safari') !== -1 && userAgent.indexOf('Chrome') === -1 && userAgent.indexOf('Windows Phone') === -1) { - return false; - } - - return !!(history && 'pushState' in history); - } - - /** - Replaces the current location, making sure we explicitly include the origin - to prevent redirecting to a different origin. - - @private - */ - - function replacePath(location, path) { - location.replace(getOrigin(location) + path); - } -}); -enifed('ember-routing/services/routing', ['exports', 'ember-utils', 'ember-runtime', 'ember-metal', 'ember-routing/utils'], function (exports, _emberUtils, _emberRuntime, _emberMetal, _emberRoutingUtils) { - /** - @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 - the set of API needed for components to control routing without interacting - with router internals. - - @private - @class RoutingService - */ - exports.default = _emberRuntime.Service.extend({ - router: null, - - targetState: _emberRuntime.readOnly('router.targetState'), - currentState: _emberRuntime.readOnly('router.currentState'), - currentRouteName: _emberRuntime.readOnly('router.currentRouteName'), - currentPath: _emberRuntime.readOnly('router.currentPath'), - - availableRoutes: function () { - return Object.keys(_emberMetal.get(this, 'router').router.recognizer.names); - }, - - hasRoute: function (routeName) { - return _emberMetal.get(this, 'router').hasRoute(routeName); - }, - - transitionTo: function (routeName, models, queryParams, shouldReplace) { - var router = _emberMetal.get(this, 'router'); - - var transition = router._doTransition(routeName, models, queryParams); - - if (shouldReplace) { - transition.method('replace'); - } - - return transition; - }, - - normalizeQueryParams: function (routeName, models, queryParams) { - var router = _emberMetal.get(this, 'router'); - router._prepareQueryParams(routeName, models, queryParams); - }, - - generateURL: function (routeName, models, queryParams) { - var router = _emberMetal.get(this, 'router'); - if (!router.router) { - return; - } - - var visibleQueryParams = {}; - _emberUtils.assign(visibleQueryParams, queryParams); - - this.normalizeQueryParams(routeName, models, visibleQueryParams); - - var args = _emberRoutingUtils.routeArgs(routeName, models, visibleQueryParams); - return router.generate.apply(router, args); - }, - - isActiveForRoute: function (contexts, queryParams, routeName, routerState, isCurrentWhenSpecified) { - var router = _emberMetal.get(this, 'router'); - - var handlers = router.router.recognizer.handlersFor(routeName); - var leafName = handlers[handlers.length - 1].handler; - var maximumContexts = numberOfContextsAcceptedByHandler(routeName, handlers); - - // NOTE: any ugliness in the calculation of activeness is largely - // due to the fact that we support automatic normalizing of - // `resource` -> `resource.index`, even though there might be - // dynamic segments / query params defined on `resource.index` - // which complicates (and makes somewhat ambiguous) the calculation - // of activeness for links that link to `resource` instead of - // directly to `resource.index`. - - // if we don't have enough contexts revert back to full route name - // this is because the leaf route will use one of the contexts - if (contexts.length > maximumContexts) { - routeName = leafName; - } - - return routerState.isActiveIntent(routeName, contexts, queryParams, !isCurrentWhenSpecified); - } - }); - - function numberOfContextsAcceptedByHandler(handler, handlerInfos) { - var req = 0; - for (var i = 0; i < handlerInfos.length; i++) { - req = req + handlerInfos[i].names.length; - if (handlerInfos[i].handler === handler) { - break; - } - } - - return req; - } -}); -enifed('ember-routing/system/cache', ['exports', 'ember-utils', 'ember-runtime'], function (exports, _emberUtils, _emberRuntime) { - 'use strict'; - - /** - A two-tiered cache with support for fallback values when doing lookups. - Uses "buckets" and then "keys" to cache values. - - @private - @class BucketCache - */ - exports.default = _emberRuntime.Object.extend({ - init: function () { - this.cache = new _emberUtils.EmptyObject(); - }, - - has: function (bucketKey) { - return !!this.cache[bucketKey]; - }, - - stash: function (bucketKey, key, value) { - var bucket = this.cache[bucketKey]; - - if (!bucket) { - bucket = this.cache[bucketKey] = new _emberUtils.EmptyObject(); - } - - bucket[key] = value; - }, - - lookup: function (bucketKey, prop, defaultValue) { - var cache = this.cache; - if (!this.has(bucketKey)) { - return defaultValue; - } - - var bucket = cache[bucketKey]; - if (prop in bucket && bucket[prop] !== undefined) { - return bucket[prop]; - } else { - return defaultValue; - } - } - }); -}); -enifed("ember-routing/system/controller_for", ["exports"], function (exports) { - /** - @module ember - @submodule ember-routing - */ - - /** - Finds a controller instance. - - @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-utils', 'ember-metal'], function (exports, _emberUtils, _emberMetal) { - 'use strict'; - - /** - @module ember - @submodule ember-routing - */ - - function DSL(name, options) { - this.parent = name; - this.enableLoadingSubstates = options && options.enableLoadingSubstates; - this.matches = []; - this.explicitIndex = undefined; - this.options = options; - } - - exports.default = DSL; - - DSL.prototype = { - route: function (name, options, callback) { - var dummyErrorRoute = '/_unused_dummy_error_path_route_' + name + '/:error'; - if (arguments.length === 2 && typeof options === 'function') { - callback = options; - options = {}; - } - - if (arguments.length === 1) { - options = {}; - } - - _emberMetal.assert('\'' + name + '\' cannot be used as a route name.', (function () { - if (options.overrideNameAssertion === true) { - return true; - } - - return ['array', 'basic', 'object', 'application'].indexOf(name) === -1; - })()); - - if (this.enableLoadingSubstates) { - createRoute(this, name + '_loading', { resetNamespace: options.resetNamespace }); - createRoute(this, name + '_error', { resetNamespace: options.resetNamespace, path: dummyErrorRoute }); - } - - if (callback) { - var fullName = getFullName(this, name, options.resetNamespace); - var dsl = new DSL(fullName, this.options); - - createRoute(dsl, 'loading'); - createRoute(dsl, 'error', { path: dummyErrorRoute }); - - callback.call(dsl); - - createRoute(this, name, options, dsl.generate()); - } else { - createRoute(this, name, options); - } - }, - - push: function (url, name, callback, serialize) { - var parts = name.split('.'); - - if (this.options.engineInfo) { - var localFullName = name.slice(this.options.engineInfo.fullName.length + 1); - var routeInfo = _emberUtils.assign({ localFullName: localFullName }, this.options.engineInfo); - - if (serialize) { - routeInfo.serializeMethod = serialize; - } - - this.options.addRouteForEngine(name, routeInfo); - } else if (serialize) { - throw new Error('Defining a route serializer on route \'' + name + '\' outside an Engine is not allowed.'); - } - - if (url === '' || url === '/' || parts[parts.length - 1] === 'index') { - this.explicitIndex = true; - } - - this.matches.push([url, name, callback]); - }, - - resource: function (name, options, callback) { - if (arguments.length === 2 && typeof options === 'function') { - callback = options; - options = {}; - } - - if (arguments.length === 1) { - options = {}; - } - - options.resetNamespace = true; - _emberMetal.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; - - if (!this.explicitIndex) { - this.route('index', { path: '/' }); - } - - return function (match) { - for (var i = 0; i < dslMatches.length; i++) { - var dslMatch = dslMatches[i]; - match(dslMatch[0]).to(dslMatch[1], dslMatch[2]); - } - }; - } - }; - - function canNest(dsl) { - return dsl.parent && dsl.parent !== 'application'; - } - - function getFullName(dsl, name, resetNamespace) { - if (canNest(dsl) && resetNamespace !== true) { - return dsl.parent + '.' + name; - } else { - return name; - } - } - - function createRoute(dsl, name, options, callback) { - options = options || {}; - - var fullName = getFullName(dsl, name, options.resetNamespace); - - if (typeof options.path !== 'string') { - options.path = '/' + name; - } - - dsl.push(options.path, fullName, callback, options.serialize); - } - - DSL.map = function (callback) { - var dsl = new DSL(); - callback.call(dsl); - return dsl; - }; - - var uuid = 0; - - DSL.prototype.mount = function (_name, _options) { - var options = _options || {}; - var engineRouteMap = this.options.resolveRouteMap(_name); - var name = _name; - - if (options.as) { - name = options.as; - } - - var fullName = getFullName(this, name, options.resetNamespace); - - var engineInfo = { - name: _name, - instanceId: uuid++, - mountPoint: fullName, - fullName: fullName - }; - - var path = options.path; - - if (typeof path !== 'string') { - path = '/' + name; - } - - var callback = undefined; - var dummyErrorRoute = '/_unused_dummy_error_path_route_' + name + '/:error'; - if (engineRouteMap) { - var shouldResetEngineInfo = false; - var oldEngineInfo = this.options.engineInfo; - if (oldEngineInfo) { - shouldResetEngineInfo = true; - this.options.engineInfo = engineInfo; - } - - var optionsForChild = _emberUtils.assign({ engineInfo: engineInfo }, this.options); - var childDSL = new DSL(fullName, optionsForChild); - - createRoute(childDSL, 'loading'); - createRoute(childDSL, 'error', { path: dummyErrorRoute }); - - engineRouteMap.call(childDSL); - - callback = childDSL.generate(); - - if (shouldResetEngineInfo) { - this.options.engineInfo = oldEngineInfo; - } - } - - var localFullName = 'application'; - var routeInfo = _emberUtils.assign({ localFullName: localFullName }, engineInfo); - - if (this.enableLoadingSubstates) { - // These values are important to register the loading routes under their - // proper names for the Router and within the Engine's registry. - var substateName = name + '_loading'; - var _localFullName = 'application_loading'; - var _routeInfo = _emberUtils.assign({ localFullName: _localFullName }, engineInfo); - createRoute(this, substateName, { resetNamespace: options.resetNamespace }); - this.options.addRouteForEngine(substateName, _routeInfo); - - substateName = name + '_error'; - _localFullName = 'application_error'; - _routeInfo = _emberUtils.assign({ localFullName: _localFullName }, engineInfo); - createRoute(this, substateName, { resetNamespace: options.resetNamespace, path: dummyErrorRoute }); - this.options.addRouteForEngine(substateName, _routeInfo); - } - - this.options.addRouteForEngine(fullName, routeInfo); - - this.push(path, fullName, callback); - }; -}); -enifed('ember-routing/system/generate_controller', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; - - exports.generateControllerFactory = generateControllerFactory; - exports.default = generateController; - - /** - @module ember - @submodule ember-routing - */ - - /** - Generates a controller factory - - @for Ember - @method generateControllerFactory - @private - */ - - function generateControllerFactory(owner, controllerName) { - var Factory = owner._lookupFactory('controller:basic').extend({ - isGenerated: true, - toString: function () { - return '(generated ' + controllerName + ' controller)'; - } - }); - - var fullName = 'controller:' + controllerName; - - owner.register(fullName, Factory); - - return Factory; - } - - /** - Generates and instantiates a controller extending from `controller:basic` - if present, or `Ember.Controller` if not. - - @for Ember - @method generateController - @private - @since 1.3.0 - */ - - function generateController(owner, controllerName) { - generateControllerFactory(owner, controllerName); - - var fullName = 'controller:' + controllerName; - var instance = owner.lookup(fullName); - - if (_emberMetal.get(instance, 'namespace.LOG_ACTIVE_GENERATION')) { - _emberMetal.info('generated -> ' + fullName, { fullName: fullName }); - } - - return instance; - } -}); -enifed('ember-routing/system/query_params', ['exports', 'ember-runtime'], function (exports, _emberRuntime) { - 'use strict'; - - exports.default = _emberRuntime.Object.extend({ - isQueryParams: true, - values: null - }); -}); -enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-routing/system/generate_controller', 'ember-routing/utils'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberRoutingSystemGenerate_controller, _emberRoutingUtils) { - 'use strict'; - - exports.defaultSerialize = defaultSerialize; - exports.hasDefaultSerialize = hasDefaultSerialize; - var slice = Array.prototype.slice; - - function K() { - return this; - } - - function defaultSerialize(model, params) { - if (params.length < 1) { - return; - } - if (!model) { - return; - } - - var name = params[0]; - var object = {}; - - if (params.length === 1) { - if (name in model) { - object[name] = _emberMetal.get(model, name); - } else if (/_id$/.test(name)) { - object[name] = _emberMetal.get(model, 'id'); - } - } else { - object = _emberMetal.getProperties(model, params); - } - - return object; - } - - var DEFAULT_SERIALIZE = _emberUtils.symbol('DEFAULT_SERIALIZE'); - - defaultSerialize[DEFAULT_SERIALIZE] = true; - - function hasDefaultSerialize(route) { - return !!route.serialize[DEFAULT_SERIALIZE]; - } - - /** - @module ember - @submodule ember-routing - */ - - /** - The `Ember.Route` class is used to define individual routes. Refer to - the [routing guide](http://emberjs.com/guides/routing/) for documentation. - - @class Route - @namespace Ember - @extends Ember.Object - @uses Ember.ActionHandler - @uses Ember.Evented - @since 1.0.0 - @public - */ - var Route = _emberRuntime.Object.extend(_emberRuntime.ActionHandler, _emberRuntime.Evented, { - /** - Configuration hash for this route's queryParams. The possible - configuration options and their defaults are as follows - (assuming a query param whose controller property is `page`): - ```javascript - queryParams: { - page: { - // By default, controller query param properties don't - // cause a full transition when they are changed, but - // rather only cause the URL to update. Setting - // `refreshModel` to true will cause an "in-place" - // transition to occur, whereby the model hooks for - // this route (and any child routes) will re-fire, allowing - // you to reload models (e.g., from the server) using the - // updated query param values. - refreshModel: false, - // By default, changes to controller query param properties - // cause the URL to update via `pushState`, which means an - // item will be added to the browser's history, allowing - // you to use the back button to restore the app to the - // previous state before the query param property was changed. - // Setting `replace` to true will use `replaceState` (or its - // hash location equivalent), which causes no browser history - // item to be added. This options name and default value are - // the same as the `link-to` helper's `replace` option. - replace: false, - // By default, the query param URL key is the same name as - // the controller property name. Use `as` to specify a - // different URL key. - as: 'page' - } - } - ``` - @property queryParams - @for Ember.Route - @type Object - @since 1.6.0 - @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 - @since 1.0.0 - @public - */ - - /** - Sets the name for this route, including a fully resolved name for routes - inside engines. - @private - @method _setRouteName - @param {String} name - */ - _setRouteName: function (name) { - this.routeName = name; - this.fullRouteName = getEngineRouteName(_emberUtils.getOwner(this), name); - }, - - /** - Populates the QP meta information in the BucketCache. - @private - @method _populateQPMeta - */ - _populateQPMeta: function () { - this._bucketCache.stash('route-meta', this.fullRouteName, this.get('_qp')); - }, - - /** - @private - @property _qp - */ - _qp: _emberMetal.computed(function () { - var _this = this; - - var controllerProto = undefined, - combinedQueryParameterConfiguration = undefined; - - var controllerName = this.controllerName || this.routeName; - var definedControllerClass = _emberUtils.getOwner(this)._lookupFactory('controller:' + controllerName); - var queryParameterConfiguraton = _emberMetal.get(this, 'queryParams'); - var hasRouterDefinedQueryParams = !!Object.keys(queryParameterConfiguraton).length; - - if (definedControllerClass) { - // the developer has authored a controller class in their application for this route - // access the prototype, find its query params and normalize their object shape - // them merge in the query params for the route. As a mergedProperty, Route#queryParams is always - // at least `{}` - controllerProto = definedControllerClass.proto(); - - var controllerDefinedQueryParameterConfiguration = _emberMetal.get(controllerProto, 'queryParams'); - var normalizedControllerQueryParameterConfiguration = _emberRoutingUtils.normalizeControllerQueryParams(controllerDefinedQueryParameterConfiguration); - combinedQueryParameterConfiguration = mergeEachQueryParams(normalizedControllerQueryParameterConfiguration, queryParameterConfiguraton); - } 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(_emberUtils.getOwner(this), controllerName); - controllerProto = generatedControllerClass.proto(); - combinedQueryParameterConfiguration = queryParameterConfiguraton; - } - - var qps = []; - var map = {}; - var propertyNames = []; - - for (var propName in combinedQueryParameterConfiguration) { - if (!combinedQueryParameterConfiguration.hasOwnProperty(propName)) { - continue; - } - - // to support the dubious feature of using unknownProperty - // on queryParams configuration - if (propName === 'unknownProperty' || propName === '_super') { - // possible todo: issue deprecation warning? - continue; - } - - var desc = combinedQueryParameterConfiguration[propName]; - var scope = desc.scope || 'model'; - var parts = undefined; - - if (scope === 'controller') { - parts = []; - } - - var urlKey = desc.as || this.serializeQueryParamKey(propName); - var defaultValue = _emberMetal.get(controllerProto, propName); - - if (Array.isArray(defaultValue)) { - defaultValue = _emberRuntime.A(defaultValue.slice()); - } - - var type = desc.type || _emberRuntime.typeOf(defaultValue); - - var defaultValueSerialized = this.serializeQueryParam(defaultValue, urlKey, type); - var scopedPropertyName = controllerName + ':' + propName; - var qp = { - undecoratedDefaultValue: _emberMetal.get(controllerProto, propName), - defaultValue: defaultValue, - serializedDefaultValue: defaultValueSerialized, - serializedValue: defaultValueSerialized, - - type: type, - urlKey: urlKey, - prop: propName, - scopedPropertyName: scopedPropertyName, - controllerName: controllerName, - route: this, - parts: parts, // provided later when stashNames is called if 'model' scope - values: null, // provided later when setup is called. no idea why. - scope: scope - }; - - map[propName] = map[urlKey] = map[scopedPropertyName] = qp; - qps.push(qp); - propertyNames.push(propName); - } - - return { - qps: qps, - map: map, - propertyNames: propertyNames, - states: { - /* - Called when a query parameter changes in the URL, this route cares - about that query parameter, but the route is not currently - in the active route hierarchy. - */ - inactive: function (prop, value) { - var qp = map[prop]; - _this._qpChanged(prop, value, qp); - }, - /* - Called when a query parameter changes in the URL, this route cares - about that query parameter, and the route is currently - in the active route hierarchy. - */ - active: function (prop, value) { - var qp = map[prop]; - _this._qpChanged(prop, value, qp); - return _this._activeQPChanged(map[prop], value); - }, - /* - Called when a value of a query parameter this route handles changes in a controller - and the route is currently in the active route hierarchy. - */ - allowOverrides: function (prop, value) { - var qp = map[prop]; - _this._qpChanged(prop, value, qp); - return _this._updatingQPChanged(map[prop]); - } - } - }; - }), - - /** - @private - @property _names - */ - _names: null, - - /** - @private - @method _stashNames - */ - _stashNames: function (_handlerInfo, dynamicParent) { - var handlerInfo = _handlerInfo; - if (this._names) { - return; - } - var names = this._names = handlerInfo._names; - - if (!names.length) { - handlerInfo = dynamicParent; - names = handlerInfo && handlerInfo._names || []; - } - - var qps = _emberMetal.get(this, '_qp.qps'); - - var namePaths = new Array(names.length); - for (var a = 0; a < names.length; ++a) { - namePaths[a] = handlerInfo.name + '.' + names[a]; - } - - for (var i = 0; i < qps.length; ++i) { - var qp = qps[i]; - if (qp.scope === 'model') { - qp.parts = namePaths; - } - } - }, - - /** - @private - @property _activeQPChanged - */ - _activeQPChanged: function (qp, value) { - var router = this.router; - router._activeQPChanged(qp.scopedPropertyName, value); - }, - - /** - @private - @method _updatingQPChanged - */ - _updatingQPChanged: function (qp) { - var router = this.router; - router._updatingQPChanged(qp.urlKey); - }, - - mergedProperties: ['queryParams'], - - /** - Returns a hash containing the parameters of an ancestor route. - Example - ```javascript - App.Router.map(function() { - this.route('member', { path: ':name' }, function() { - this.route('interest', { path: ':interest' }); - }); - }); - App.MemberRoute = Ember.Route.extend({ - queryParams: { - memberQp: { refreshModel: true } - } - }); - App.MemberInterestRoute = Ember.Route.extend({ - queryParams: { - interestQp: { refreshModel: true } - }, - model() { - return this.paramsFor('member'); - } - }); - ``` - If we visit `/turing/maths?memberQp=member&interestQp=interest` the model for - the `member.interest` route is hash with: - * `name`: `turing` - * `memberQp`: `member` - @method paramsFor - @param {String} name - @return {Object} hash containing the parameters of the route `name` - @since 1.4.0 - @public - */ - paramsFor: function (name) { - var _this2 = this; - - var route = _emberUtils.getOwner(this).lookup('route:' + name); - - if (!route) { - return {}; - } - - var transition = this.router.router.activeTransition; - var state = transition ? transition.state : this.router.router.state; - - var fullName = route.fullRouteName; - var params = _emberUtils.assign({}, state.params[fullName]); - var queryParams = getQueryParamsFor(route, state); - - return Object.keys(queryParams).reduce(function (params, key) { - _emberMetal.assert('The route \'' + _this2.routeName + '\' has both a dynamic segment and query param with name \'' + key + '\'. Please rename one to avoid collisions.', !params[key]); - params[key] = queryParams[key]; - return params; - }, params); - }, - - /** - Serializes the query parameter key - @method serializeQueryParamKey - @param {String} controllerPropertyName - @private - */ - serializeQueryParamKey: function (controllerPropertyName) { - return controllerPropertyName; - }, - - /** - Serializes value of the query parameter based on defaultValueType - @method serializeQueryParam - @param {Object} value - @param {String} urlKey - @param {String} defaultValueType - @private - */ - serializeQueryParam: function (value, urlKey, defaultValueType) { - // urlKey isn't used here, but anyone overriding - // can use it to provide serialization specific - // to a certain query param. - return this.router._serializeQueryParam(value, defaultValueType); - }, - - /** - Deserializes value of the query parameter based on defaultValueType - @method deserializeQueryParam - @param {Object} value - @param {String} urlKey - @param {String} defaultValueType - @private - */ - deserializeQueryParam: function (value, urlKey, defaultValueType) { - // urlKey isn't used here, but anyone overriding - // can use it to provide deserialization specific - // to a certain query param. - return this.router._deserializeQueryParam(value, defaultValueType); - }, - - /** - @private - @property _optionsForQueryParam - */ - _optionsForQueryParam: function (qp) { - return _emberMetal.get(this, 'queryParams.' + qp.urlKey) || _emberMetal.get(this, 'queryParams.' + qp.prop) || {}; - }, - - /** - A hook you can use to reset controller values either when the model - changes or the route is exiting. - ```javascript - App.ArticlesRoute = Ember.Route.extend({ - // ... - resetController: function(controller, isExiting, transition) { - if (isExiting) { - controller.set('page', 1); - } - } - }); - ``` - @method resetController - @param {Controller} controller instance - @param {Boolean} isExiting - @param {Object} transition - @since 1.7.0 - @public - */ - resetController: K, - - /** - @private - @method exit - */ - exit: function () { - this.deactivate(); - this.trigger('deactivate'); - this.teardownViews(); - }, - - /** - @private - @method _reset - @since 1.7.0 - */ - _reset: function (isExiting, transition) { - var controller = this.controller; - controller._qpDelegate = _emberMetal.get(this, '_qp.states.inactive'); - - this.resetController(controller, isExiting, transition); - }, - - /** - @private - @method enter - */ - enter: function () { - this.connections = []; - this.activate(); - this.trigger('activate'); - }, - - /** - The name of the template to use by default when rendering this routes - template. - ```javascript - let PostsList = Ember.Route.extend({ - templateName: 'posts/list' - }); - App.PostsIndexRoute = PostsList.extend(); - App.PostsArchivedRoute = PostsList.extend(); - ``` - @property templateName - @type String - @default null - @since 1.4.0 - @public - */ - templateName: null, - - /** - The name of the controller to associate with this route. - By default, Ember will lookup a route's controller that matches the name - of the route (i.e. `App.PostController` for `App.PostRoute`). However, - if you would like to define a specific controller to use, you can do so - using this property. - This is useful in many ways, as the controller specified will be: - * passed to the `setupController` method. - * used as the controller for the template being rendered by the route. - * returned from a call to `controllerFor` for the route. - @property controllerName - @type String - @default null - @since 1.4.0 - @public - */ - controllerName: null, - - /** - The `willTransition` action is fired at the beginning of any - attempted transition with a `Transition` object as the sole - argument. This action can be used for aborting, redirecting, - or decorating the transition from the currently active routes. - A good example is preventing navigation when a form is - half-filled out: - ```javascript - App.ContactFormRoute = Ember.Route.extend({ - actions: { - willTransition: function(transition) { - if (this.controller.get('userHasEnteredData')) { - this.controller.displayNavigationConfirm(); - transition.abort(); - } - } - } - }); - ``` - You can also redirect elsewhere by calling - `this.transitionTo('elsewhere')` from within `willTransition`. - Note that `willTransition` will not be fired for the - redirecting `transitionTo`, since `willTransition` doesn't - fire when there is already a transition underway. If you want - subsequent `willTransition` actions to fire for the redirecting - transition, you must first explicitly call - `transition.abort()`. - To allow the `willTransition` event to continue bubbling to the parent - route, use `return true;`. When the `willTransition` method has a - return value of `true` then the parent route's `willTransition` method - will be fired, enabling "bubbling" behavior for the event. - @event willTransition - @param {Transition} transition - @since 1.0.0 - @public - */ - - /** - The `didTransition` action is fired after a transition has - successfully been completed. This occurs after the normal model - hooks (`beforeModel`, `model`, `afterModel`, `setupController`) - have resolved. The `didTransition` action has no arguments, - however, it can be useful for tracking page views or resetting - state on the controller. - ```javascript - App.LoginRoute = Ember.Route.extend({ - actions: { - didTransition: function() { - this.controller.get('errors.base').clear(); - return true; // Bubble the didTransition event - } - } - }); - ``` - @event didTransition - @since 1.2.0 - @public - */ - - /** - The `loading` action is fired on the route when a route's `model` - hook returns a promise that is not already resolved. The current - `Transition` object is the first parameter and the route that - triggered the loading event is the second parameter. - ```javascript - App.ApplicationRoute = Ember.Route.extend({ - actions: { - loading: function(transition, route) { - let controller = this.controllerFor('foo'); - controller.set('currentlyLoading', true); - transition.finally(function() { - controller.set('currentlyLoading', false); - }); - } - } - }); - ``` - @event loading - @param {Transition} transition - @param {Ember.Route} route The route that triggered the loading event - @since 1.2.0 - @public - */ - - /** - When attempting to transition into a route, any of the hooks - may return a promise that rejects, at which point an `error` - action will be fired on the partially-entered routes, allowing - for per-route error handling logic, or shared error handling - logic defined on a parent route. - Here is an example of an error handler that will be invoked - for rejected promises from the various hooks on the route, - as well as any unhandled errors from child routes: - ```javascript - App.AdminRoute = Ember.Route.extend({ - beforeModel: function() { - return Ember.RSVP.reject('bad things!'); - }, - actions: { - error: function(error, transition) { - // Assuming we got here due to the error in `beforeModel`, - // we can expect that error === "bad things!", - // but a promise model rejecting would also - // call this hook, as would any errors encountered - // in `afterModel`. - // The `error` hook is also provided the failed - // `transition`, which can be stored and later - // `.retry()`d if desired. - this.transitionTo('login'); - } - } - }); - ``` - `error` actions that bubble up all the way to `ApplicationRoute` - will fire a default error handler that logs the error. You can - specify your own global default error handler by overriding the - `error` handler on `ApplicationRoute`: - ```javascript - App.ApplicationRoute = Ember.Route.extend({ - actions: { - error: function(error, transition) { - this.controllerFor('banner').displayError(error.message); - } - } - }); - ``` - @event error - @param {Error} error - @param {Transition} transition - @since 1.0.0 - @public - */ - - /** - This event is triggered when the router enters the route. It is - not executed when the model for the route changes. - ```javascript - App.ApplicationRoute = Ember.Route.extend({ - collectAnalytics: function(){ - collectAnalytics(); - }.on('activate') - }); - ``` - @event activate - @since 1.9.0 - @public - */ - - /** - This event is triggered when the router completely exits this - route. It is not executed when the model for the route changes. - ```javascript - App.IndexRoute = Ember.Route.extend({ - trackPageLeaveAnalytics: function(){ - trackPageLeaveAnalytics(); - }.on('deactivate') - }); - ``` - @event deactivate - @since 1.9.0 - @public - */ - - /** - The controller associated with this route. - Example - ```javascript - App.FormRoute = Ember.Route.extend({ - actions: { - willTransition: function(transition) { - if (this.controller.get('userHasEnteredData') && - !confirm('Are you sure you want to abandon progress?')) { - transition.abort(); - } else { - // Bubble the `willTransition` action so that - // parent routes can decide whether or not to abort. - return true; - } - } - } - }); - ``` - @property controller - @type Ember.Controller - @since 1.6.0 - @public - */ - - actions: { - - /** - This action is called when one or more query params have changed. Bubbles. - @method queryParamsDidChange - @param changed {Object} Keys are names of query params that have changed. - @param totalPresent {Object} Keys are names of query params that are currently set. - @param removed {Object} Keys are names of query params that have been removed. - @returns {boolean} - @private - */ - queryParamsDidChange: function (changed, totalPresent, removed) { - var qpMap = _emberMetal.get(this, '_qp').map; - - var totalChanged = Object.keys(changed).concat(Object.keys(removed)); - for (var i = 0; i < totalChanged.length; ++i) { - var qp = qpMap[totalChanged[i]]; - if (qp && _emberMetal.get(this._optionsForQueryParam(qp), 'refreshModel') && this.router.currentState) { - this.refresh(); - } - } - - return true; - }, - - finalizeQueryParamChange: function (params, finalParams, transition) { - if (this.fullRouteName !== 'application') { - return true; - } - - // Transition object is absent for intermediate transitions. - if (!transition) { - return; - } - - var handlerInfos = transition.state.handlerInfos; - var router = this.router; - var qpMeta = router._queryParamsFor(handlerInfos); - var changes = router._qpUpdates; - var replaceUrl = undefined; - - _emberRoutingUtils.stashParamNames(router, handlerInfos); - - for (var i = 0; i < qpMeta.qps.length; ++i) { - var qp = qpMeta.qps[i]; - var route = qp.route; - var controller = route.controller; - var presentKey = qp.urlKey in params && qp.urlKey; - - // Do a reverse lookup to see if the changed query - // param URL key corresponds to a QP property on - // this controller. - var value = undefined, - svalue = undefined; - if (changes && qp.urlKey in changes) { - // Value updated in/before setupController - value = _emberMetal.get(controller, qp.prop); - svalue = route.serializeQueryParam(value, qp.urlKey, qp.type); - } else { - if (presentKey) { - svalue = params[presentKey]; - value = route.deserializeQueryParam(svalue, qp.urlKey, qp.type); - } else { - // No QP provided; use default value. - svalue = qp.serializedDefaultValue; - value = copyDefaultValue(qp.defaultValue); - } - } - - controller._qpDelegate = _emberMetal.get(route, '_qp.states.inactive'); - - var thisQueryParamChanged = svalue !== qp.serializedValue; - if (thisQueryParamChanged) { - if (transition.queryParamsOnly && replaceUrl !== false) { - var options = route._optionsForQueryParam(qp); - var replaceConfigValue = _emberMetal.get(options, 'replace'); - if (replaceConfigValue) { - replaceUrl = true; - } else if (replaceConfigValue === false) { - // Explicit pushState wins over any other replaceStates. - replaceUrl = false; - } - } - - _emberMetal.set(controller, qp.prop, value); - } - - // Stash current serialized value of controller. - qp.serializedValue = svalue; - - var thisQueryParamHasDefaultValue = qp.serializedDefaultValue === svalue; - if (!thisQueryParamHasDefaultValue) { - finalParams.push({ - value: svalue, - visible: true, - key: presentKey || qp.urlKey - }); - } - } - - if (replaceUrl) { - transition.method('replace'); - } - - qpMeta.qps.forEach(function (qp) { - var routeQpMeta = _emberMetal.get(qp.route, '_qp'); - var finalizedController = qp.route.controller; - finalizedController._qpDelegate = _emberMetal.get(routeQpMeta, 'states.active'); - }); - - router._qpUpdates = 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 - @since 1.0.0 - @public - */ - deactivate: K, - - /** - This hook is executed when the router enters the route. It is not executed - when the model for the route changes. - @method activate - @since 1.0.0 - @public - */ - activate: K, - - /** - Transition the application into another route. The route may - be either a single route or route path: - ```javascript - this.transitionTo('blogPosts'); - this.transitionTo('blogPosts.recentEntries'); - ``` - Optionally supply a model for the route in question. The model - will be serialized into the URL using the `serialize` hook of - the route: - ```javascript - this.transitionTo('blogPost', aPost); - ``` - If a literal is passed (such as a number or a string), it will - be treated as an identifier instead. In this case, the `model` - hook of the route will be triggered: - ```javascript - this.transitionTo('blogPost', 1); - ``` - Multiple models will be applied last to first recursively up the - route tree. - ```javascript - App.Router.map(function() { - this.route('blogPost', { path:':blogPostId' }, function() { - this.route('blogComment', { path: ':blogCommentId', resetNamespace: true }); - }); - }); - this.transitionTo('blogComment', aPost, aComment); - this.transitionTo('blogComment', 1, 13); - ``` - It is also possible to pass a URL (a string that starts with a - `/`). This is intended for testing and debugging purposes and - should rarely be used in production code. - ```javascript - this.transitionTo('/'); - this.transitionTo('/blog/post/1/comment/13'); - this.transitionTo('/blog/posts?sort=title'); - ``` - An options hash with a `queryParams` property may be provided as - the final argument to add query parameters to the destination URL. - ```javascript - this.transitionTo('blogPost', 1, { - queryParams: { showComments: 'true' } - }); - // if you just want to transition the query parameters without changing the route - this.transitionTo({ queryParams: { sort: 'date' } }); - ``` - See also [replaceWith](#method_replaceWith). - Simple Transition Example - ```javascript - App.Router.map(function() { - this.route('index'); - this.route('secret'); - this.route('fourOhFour', { path: '*:' }); - }); - App.IndexRoute = Ember.Route.extend({ - actions: { - moveToSecret: function(context) { - if (authorized()) { - this.transitionTo('secret', context); - } else { - this.transitionTo('fourOhFour'); - } - } - } - }); - ``` - Transition to a nested route - ```javascript - App.Router.map(function() { - this.route('articles', { path: '/articles' }, function() { - this.route('new'); - }); - }); - App.IndexRoute = Ember.Route.extend({ - actions: { - transitionToNewArticle: function() { - this.transitionTo('articles.new'); - } - } - }); - ``` - Multiple Models Example - ```javascript - App.Router.map(function() { - this.route('index'); - this.route('breakfast', { path: ':breakfastId' }, function() { - this.route('cereal', { path: ':cerealId', resetNamespace: true }); - }); - }); - App.IndexRoute = Ember.Route.extend({ - actions: { - moveToChocolateCereal: function() { - let cereal = { cerealId: 'ChocolateYumminess' }; - let breakfast = { breakfastId: 'CerealAndMilk' }; - this.transitionTo('cereal', breakfast, cereal); - } - } - }); - ``` - Nested Route with Query String Example - ```javascript - App.Router.map(function() { - this.route('fruits', function() { - this.route('apples'); - }); - }); - App.IndexRoute = Ember.Route.extend({ - actions: { - transitionToApples: function() { - this.transitionTo('fruits.apples', { queryParams: { color: 'red' } }); - } - } - }); - ``` - @method transitionTo - @param {String} name the name of the route or a URL - @param {...Object} models the model(s) or identifier(s) to be used while - transitioning to the route. - @param {Object} [options] optional hash with a queryParams property - containing a mapping of query parameters - @return {Transition} the transition object associated with this - attempted transition - @since 1.0.0 - @public - */ - transitionTo: function (name, context) { - var router = this.router; - return router.transitionTo.apply(router, _emberRoutingUtils.prefixRouteNameArg(this, arguments)); - }, - - /** - Perform a synchronous transition into another route without attempting - to resolve promises, update the URL, or abort any currently active - asynchronous transitions (i.e. regular transitions caused by - `transitionTo` or URL changes). - This method is handy for performing intermediate transitions on the - way to a final destination route, and is called internally by the - default implementations of the `error` and `loading` handlers. - @method intermediateTransitionTo - @param {String} name the name of the route - @param {...Object} models the model(s) to be used while transitioning - to the route. - @since 1.2.0 - @public - */ - intermediateTransitionTo: function () { - var router = this.router; - router.intermediateTransitionTo.apply(router, _emberRoutingUtils.prefixRouteNameArg(this, arguments)); - }, - - /** - Refresh the model on this route and any child routes, firing the - `beforeModel`, `model`, and `afterModel` hooks in a similar fashion - to how routes are entered when transitioning in from other route. - The current route params (e.g. `article_id`) will be passed in - to the respective model hooks, and if a different model is returned, - `setupController` and associated route hooks will re-fire as well. - An example usage of this method is re-querying the server for the - latest information using the same parameters as when the route - was first entered. - Note that this will cause `model` hooks to fire even on routes - that were provided a model object when the route was initially - entered. - @method refresh - @return {Transition} the transition object associated with this - attempted transition - @since 1.4.0 - @public - */ - refresh: function () { - return this.router.router.refresh(this); - }, - - /** - Transition into another route while replacing the current URL, if possible. - This will replace the current history entry instead of adding a new one. - Beside that, it is identical to `transitionTo` in all other respects. See - 'transitionTo' for additional information regarding multiple models. - Example - ```javascript - App.Router.map(function() { - this.route('index'); - this.route('secret'); - }); - App.SecretRoute = Ember.Route.extend({ - afterModel: function() { - if (!authorized()){ - this.replaceWith('index'); - } - } - }); - ``` - @method replaceWith - @param {String} name the name of the route or a URL - @param {...Object} models the model(s) or identifier(s) to be used while - transitioning to the route. - @return {Transition} the transition object associated with this - attempted transition - @since 1.0.0 - @public - */ - replaceWith: function () { - var router = this.router; - return router.replaceWith.apply(router, _emberRoutingUtils.prefixRouteNameArg(this, arguments)); - }, - - /** - Sends an action to the router, which will delegate it to the currently - active route hierarchy per the bubbling rules explained under `actions`. - Example - ```javascript - App.Router.map(function() { - this.route('index'); - }); - App.ApplicationRoute = Ember.Route.extend({ - actions: { - track: function(arg) { - console.log(arg, 'was clicked'); - } - } - }); - App.IndexRoute = Ember.Route.extend({ - actions: { - trackIfDebug: function(arg) { - if (debug) { - this.send('track', arg); - } - } - } - }); - ``` - @method send - @param {String} name the name of the action to trigger - @param {...*} args - @since 1.0.0 - @public - */ - send: function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - if (this.router && this.router.router || !_emberMetal.isTesting()) { - var _router; - - (_router = this.router).send.apply(_router, args); - } else { - var _name2 = args[0]; - args = slice.call(args, 1); - var action = this.actions[_name2]; - if (action) { - return this.actions[_name2].apply(this, args); - } - } - }, - - /** - This hook is the entry point for router.js - @private - @method setup - */ - setup: function (context, transition) { - var _this3 = this; - - var controller = undefined; - - var controllerName = this.controllerName || this.routeName; - var definedController = this.controllerFor(controllerName, true); - - if (!definedController) { - controller = this.generateController(controllerName); - } else { - controller = definedController; - } - - // Assign the route's controller so that it can more easily be - // referenced in action handlers. Side effects. Side effects everywhere. - if (!this.controller) { - var propNames = _emberMetal.get(this, '_qp.propertyNames'); - addQueryParamsObservers(controller, propNames); - this.controller = controller; - } - - var queryParams = _emberMetal.get(this, '_qp'); - - var states = queryParams.states; - - controller._qpDelegate = states.allowOverrides; - - if (transition) { - (function () { - // Update the model dep values used to calculate cache keys. - _emberRoutingUtils.stashParamNames(_this3.router, transition.state.handlerInfos); - - var params = transition.params; - var allParams = queryParams.propertyNames; - var cache = _this3._bucketCache; - - allParams.forEach(function (prop) { - var aQp = queryParams.map[prop]; - - aQp.values = params; - var cacheKey = _emberRoutingUtils.calculateCacheKey(aQp.controllerName, aQp.parts, aQp.values); - - if (cache) { - var value = cache.lookup(cacheKey, prop, aQp.undecoratedDefaultValue); - _emberMetal.set(controller, prop, value); - } - }); - })(); - } - - if (transition) { - var qpValues = getQueryParamsFor(this, transition.state); - controller.setProperties(qpValues); - } - - this.setupController(controller, context, transition); - - if (this._environment.options.shouldRender) { - 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 - value in the cache so if this route becomes active, the cache value has been updated. - */ - _qpChanged: function (prop, value, qp) { - if (!qp) { - return; - } - - var cacheKey = _emberRoutingUtils.calculateCacheKey(qp.controllerName, qp.parts, qp.values); - - // Update model-dep cache - var cache = this._bucketCache; - if (cache) { - cache.stash(cacheKey, prop, value); - } - }, - /** - This hook is the first of the route entry validation hooks - called when an attempt is made to transition into a route - or one of its children. It is called before `model` and - `afterModel`, and is appropriate for cases when: - 1) A decision can be made to redirect elsewhere without - needing to resolve the model first. - 2) Any async operations need to occur first before the - model is attempted to be resolved. - This hook is provided the current `transition` attempt - as a parameter, which can be used to `.abort()` the transition, - save it for a later `.retry()`, or retrieve values set - on it from a previous hook. You can also just call - `this.transitionTo` to another route to implicitly - abort the `transition`. - You can return a promise from this hook to pause the - transition until the promise resolves (or rejects). This could - be useful, for instance, for retrieving async code from - the server that is required to enter a route. - ```javascript - App.PostRoute = Ember.Route.extend({ - beforeModel: function(transition) { - if (!App.Post) { - return Ember.$.getScript('/models/post.js'); - } - } - }); - ``` - If `App.Post` doesn't exist in the above example, - `beforeModel` will use jQuery's `getScript`, which - returns a promise that resolves after the server has - successfully retrieved and executed the code from the - server. Note that if an error were to occur, it would - be passed to the `error` hook on `Ember.Route`, but - it's also possible to handle errors specific to - `beforeModel` right from within the hook (to distinguish - from the shared error handling behavior of the `error` - hook): - ```javascript - App.PostRoute = Ember.Route.extend({ - beforeModel: function(transition) { - if (!App.Post) { - let self = this; - return Ember.$.getScript('post.js').then(null, function(e) { - self.transitionTo('help'); - // Note that the above transitionTo will implicitly - // halt the transition. If you were to return - // nothing from this promise reject handler, - // according to promise semantics, that would - // convert the reject into a resolve and the - // transition would continue. To propagate the - // error so that it'd be handled by the `error` - // hook, you would have to - return Ember.RSVP.reject(e); - }); - } - } - }); - ``` - @method beforeModel - @param {Transition} transition - @return {Promise} if the value returned from this hook is - a promise, the transition will pause until the transition - resolves. Otherwise, non-promise return values are not - utilized in any way. - @since 1.0.0 - @public - */ - beforeModel: K, - - /** - This hook is called after this route's model has resolved. - It follows identical async/promise semantics to `beforeModel` - but is provided the route's resolved model in addition to - the `transition`, and is therefore suited to performing - logic that can only take place after the model has already - resolved. - ```javascript - App.PostsRoute = Ember.Route.extend({ - afterModel: function(posts, transition) { - if (posts.get('length') === 1) { - this.transitionTo('post.show', posts.get('firstObject')); - } - } - }); - ``` - Refer to documentation for `beforeModel` for a description - of transition-pausing semantics when a promise is returned - from this hook. - @method afterModel - @param {Object} resolvedModel the value returned from `model`, - or its resolved value if it was a promise - @param {Transition} transition - @return {Promise} if the value returned from this hook is - a promise, the transition will pause until the transition - resolves. Otherwise, non-promise return values are not - utilized in any way. - @since 1.0.0 - @public - */ - afterModel: K, - - /** - A hook you can implement to optionally redirect to another route. - If you call `this.transitionTo` from inside of this hook, this route - will not be entered in favor of the other hook. - `redirect` and `afterModel` behave very similarly and are - called almost at the same time, but they have an important - distinction in the case that, from one of these hooks, a - redirect into a child route of this route occurs: redirects - from `afterModel` essentially invalidate the current attempt - to enter this route, and will result in this route's `beforeModel`, - `model`, and `afterModel` hooks being fired again within - the new, redirecting transition. Redirects that occur within - the `redirect` hook, on the other hand, will _not_ cause - these hooks to be fired again the second time around; in - other words, by the time the `redirect` hook has been called, - both the resolved model and attempted entry into this route - are considered to be fully validated. - @method redirect - @param {Object} model the model for this route - @param {Transition} transition the transition object associated with the current transition - @since 1.0.0 - @public - */ - redirect: K, - - /** - Called when the context is changed by router.js. - @private - @method contextDidChange - */ - contextDidChange: function () { - this.currentModel = this.context; - }, - - /** - A hook you can implement to convert the URL into the model for - this route. - ```javascript - App.Router.map(function() { - this.route('post', { path: '/posts/:post_id' }); - }); - ``` - The model for the `post` route is `store.findRecord('post', params.post_id)`. - By default, if your route has a dynamic segment ending in `_id`: - * The model class is determined from the segment (`post_id`'s - class is `App.Post`) - * The find method is called on the model class with the value of - the dynamic segment. - Note that for routes with dynamic segments, this hook is not always - executed. If the route is entered through a transition (e.g. when - using the `link-to` Handlebars helper or the `transitionTo` method - of routes), and a model context is already provided this hook - is not called. - A model context does not include a primitive string or number, - which does cause the model hook to be called. - Routes without dynamic segments will always execute the model hook. - ```javascript - // no dynamic segment, model hook always called - this.transitionTo('posts'); - // model passed in, so model hook not called - thePost = store.findRecord('post', 1); - this.transitionTo('post', thePost); - // integer passed in, model hook is called - this.transitionTo('post', 1); - // model id passed in, model hook is called - // useful for forcing the hook to execute - thePost = store.findRecord('post', 1); - this.transitionTo('post', thePost.id); - ``` - This hook follows the asynchronous/promise semantics - described in the documentation for `beforeModel`. In particular, - if a promise returned from `model` fails, the error will be - handled by the `error` hook on `Ember.Route`. - Example - ```javascript - App.PostRoute = Ember.Route.extend({ - model: function(params) { - return this.store.findRecord('post', params.post_id); - } - }); - ``` - @method model - @param {Object} params the parameters extracted from the URL - @param {Transition} transition - @return {Object|Promise} the model for this route. If - a promise is returned, the transition will pause until - the promise resolves, and the resolved value of the promise - will be used as the model for this route. - @since 1.0.0 - @public - */ - model: function (params, transition) { - var match = undefined, - name = undefined, - sawParams = undefined, - value = undefined; - var queryParams = _emberMetal.get(this, '_qp.map'); - - for (var prop in params) { - if (prop === 'queryParams' || queryParams && prop in queryParams) { - continue; - } - - if (match = prop.match(/^(.*)_id$/)) { - name = match[1]; - value = params[prop]; - } - sawParams = true; - } - - if (!name && sawParams) { - return _emberRuntime.copy(params); - } else if (!name) { - if (transition.resolveIndex < 1) { - return; - } - - var parentModel = transition.state.handlerInfos[transition.resolveIndex - 1].context; - - return parentModel; - } - - return this.findModel(name, value); - }, - - /** - @private - @method deserialize - @param {Object} params the parameters extracted from the URL - @param {Transition} transition - @return {Object|Promise} the model for this route. - Router.js hook. - */ - deserialize: function (params, transition) { - return this.model(this.paramsFor(this.routeName), transition); - }, - - /** - @method findModel - @param {String} type the model type - @param {Object} value the value passed to find - @private - */ - findModel: function () { - var store = _emberMetal.get(this, 'store'); - return store.find.apply(store, arguments); - }, - - /** - Store property provides a hook for data persistence libraries to inject themselves. - By default, this store property provides the exact same functionality previously - in the model hook. - Currently, the required interface is: - `store.find(modelName, findArguments)` - @method store - @param {Object} store - @private - */ - store: _emberMetal.computed(function () { - var owner = _emberUtils.getOwner(this); - var routeName = this.routeName; - var namespace = _emberMetal.get(this, 'router.namespace'); - - return { - find: function (name, value) { - var modelClass = owner._lookupFactory('model:' + name); - - _emberMetal.assert('You used the dynamic segment ' + name + '_id in your route ' + routeName + ', but ' + namespace + '.' + _emberRuntime.String.classify(name) + ' did not exist and you did not override your route\'s `model` hook.', !!modelClass); - - if (!modelClass) { - return; - } - - _emberMetal.assert(_emberRuntime.String.classify(name) + ' has no method `find`.', typeof modelClass.find === 'function'); - - return modelClass.find(value); - } - }; - }), - - /** - A hook you can implement to convert the route's model into parameters - for the URL. - ```javascript - App.Router.map(function() { - this.route('post', { path: '/posts/:post_id' }); - }); - App.PostRoute = Ember.Route.extend({ - model: function(params) { - // the server returns `{ id: 12 }` - return Ember.$.getJSON('/posts/' + params.post_id); - }, - serialize: function(model) { - // this will make the URL `/posts/12` - return { post_id: model.id }; - } - }); - ``` - The default `serialize` method will insert the model's `id` into the - route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'. - If the route has multiple dynamic segments or does not contain '_id', `serialize` - will return `Ember.getProperties(model, params)` - This method is called when `transitionTo` is called with a context - in order to populate the URL. - @method serialize - @param {Object} model the routes model - @param {Array} params an Array of parameter names for the current - route (in the example, `['post_id']`. - @return {Object} the serialized parameters - @since 1.0.0 - @public - */ - serialize: defaultSerialize, - - /** - A hook you can use to setup the controller for the current route. - This method is called with the controller for the current route and the - model supplied by the `model` hook. - By default, the `setupController` hook sets the `model` property of - the controller to the `model`. - If you implement the `setupController` hook in your Route, it will - prevent this default behavior. If you want to preserve that behavior - when implementing your `setupController` function, make sure to call - `_super`: - ```javascript - App.PhotosRoute = Ember.Route.extend({ - model: function() { - return this.store.findAll('photo'); - }, - setupController: function(controller, model) { - // Call _super for default behavior - this._super(controller, model); - // Implement your custom setup after - this.controllerFor('application').set('showingPhotos', true); - } - }); - ``` - The provided controller will be one resolved based on the name - of this route. - If no explicit controller is defined, Ember will automatically create one. - As an example, consider the router: - ```javascript - App.Router.map(function() { - this.route('post', { path: '/posts/:post_id' }); - }); - ``` - For the `post` route, a controller named `App.PostController` would - be used if it is defined. If it is not defined, a basic `Ember.Controller` - instance would be used. - Example - ```javascript - App.PostRoute = Ember.Route.extend({ - setupController: function(controller, model) { - controller.set('model', model); - } - }); - ``` - @method setupController - @param {Controller} controller instance - @param {Object} model - @since 1.0.0 - @public - */ - setupController: function (controller, context, transition) { - if (controller && context !== undefined) { - _emberMetal.set(controller, 'model', context); - } - }, - - /** - Returns the controller for a particular route or name. - The controller instance must already have been created, either through entering the - associated route or using `generateController`. - ```javascript - App.PostRoute = Ember.Route.extend({ - setupController: function(controller, post) { - this._super(controller, post); - this.controllerFor('posts').set('currentPost', post); - } - }); - ``` - @method controllerFor - @param {String} name the name of the route or controller - @return {Ember.Controller} - @since 1.0.0 - @public - */ - controllerFor: function (name, _skipAssert) { - var owner = _emberUtils.getOwner(this); - var route = owner.lookup('route:' + name); - var controller = undefined; - - if (route && route.controllerName) { - name = route.controllerName; - } - - controller = owner.lookup('controller:' + name); - - // NOTE: We're specifically checking that skipAssert is true, because according - // to the old API the second parameter was model. We do not want people who - // passed a model to skip the assertion. - _emberMetal.assert('The controller named \'' + name + '\' could not be found. Make sure that this route exists and has already been entered at least once. If you are accessing a controller not associated with a route, make sure the controller class is explicitly defined.', controller || _skipAssert === true); - - return controller; - }, - - /** - Generates a controller for a route. - Example - ```javascript - App.PostRoute = Ember.Route.extend({ - setupController: function(controller, post) { - this._super(controller, post); - this.generateController('posts'); - } - }); - ``` - @method generateController - @param {String} name the name of the controller - @private - */ - generateController: function (name) { - var owner = _emberUtils.getOwner(this); - - return _emberRoutingSystemGenerate_controller.default(owner, name); - }, - - /** - Returns the resolved model of a parent (or any ancestor) route - in a route hierarchy. During a transition, all routes - must resolve a model object, and if a route - needs access to a parent route's model in order to - resolve a model (or just reuse the model from a parent), - it can call `this.modelFor(theNameOfParentRoute)` to - retrieve it. If the ancestor route's model was a promise, - its resolved result is returned. - Example - ```javascript - App.Router.map(function() { - this.route('post', { path: '/post/:post_id' }, function() { - this.route('comments', { resetNamespace: true }); - }); - }); - App.CommentsRoute = Ember.Route.extend({ - afterModel: function() { - this.set('post', this.modelFor('post')); - } - }); - ``` - @method modelFor - @param {String} name the name of the route - @return {Object} the model object - @since 1.0.0 - @public - */ - modelFor: function (_name) { - var name = undefined; - var owner = _emberUtils.getOwner(this); - - // Only change the route name when there is an active transition. - // Otherwise, use the passed in route name. - if (owner.routable && this.router && this.router.router.activeTransition) { - name = getEngineRouteName(owner, _name); - } else { - name = _name; - } - - var route = _emberUtils.getOwner(this).lookup('route:' + name); - var transition = this.router ? this.router.router.activeTransition : null; - - // If we are mid-transition, we want to try and look up - // resolved parent contexts on the current transitionEvent. - if (transition) { - var modelLookupName = route && route.routeName || name; - if (transition.resolvedModels.hasOwnProperty(modelLookupName)) { - return transition.resolvedModels[modelLookupName]; - } - } - - return route && route.currentModel; - }, - - /** - A hook you can use to render the template for the current route. - This method is called with the controller for the current route and the - model supplied by the `model` hook. By default, it renders the route's - template, configured with the controller for the route. - This method can be overridden to set up and render additional or - alternative templates. - ```javascript - App.PostsRoute = Ember.Route.extend({ - renderTemplate: function(controller, model) { - let favController = this.controllerFor('favoritePost'); - // Render the `favoritePost` template into - // the outlet `posts`, and display the `favoritePost` - // controller. - this.render('favoritePost', { - outlet: 'posts', - controller: favController - }); - } - }); - ``` - @method renderTemplate - @param {Object} controller the route's controller - @param {Object} model the route's model - @since 1.0.0 - @public - */ - renderTemplate: function (controller, model) { - this.render(); - }, - - /** - `render` is used to render a template into a region of another template - (indicated by an `{{outlet}}`). `render` is used both during the entry - phase of routing (via the `renderTemplate` hook) and later in response to - user interaction. - For example, given the following minimal router and templates: - ```javascript - Router.map(function() { - this.route('photos'); - }); - ``` - ```handlebars - -
    - {{outlet "anOutletName"}} -
    - ``` - ```handlebars - -

    Photos

    - ``` - You can render `photos.hbs` into the `"anOutletName"` outlet of - `application.hbs` by calling `render`: - ```javascript - // posts route - Ember.Route.extend({ - renderTemplate: function() { - this.render('photos', { - into: 'application', - outlet: 'anOutletName' - }) - } - }); - ``` - `render` additionally allows you to supply which `controller` and - `model` objects should be loaded and associated with the rendered template. - ```javascript - // posts route - Ember.Route.extend({ - renderTemplate: function(controller, model){ - this.render('posts', { // the template to render, referenced by name - into: 'application', // the template to render into, referenced by name - outlet: 'anOutletName', // the outlet inside `options.template` to render into. - controller: 'someControllerName', // the controller to use for this template, referenced by name - model: model // the model to set on `options.controller`. - }) - } - }); - ``` - The string values provided for the template name, and controller - will eventually pass through to the resolver for lookup. See - Ember.Resolver for how these are mapped to JavaScript objects in your - application. The template to render into needs to be related to either the - current route or one of its ancestors. - Not all options need to be passed to `render`. Default values will be used - based on the name of the route specified in the router or the Route's - `controllerName` and `templateName` properties. - For example: - ```javascript - // router - Router.map(function() { - this.route('index'); - this.route('post', { path: '/posts/:post_id' }); - }); - ``` - ```javascript - // post route - PostRoute = App.Route.extend({ - renderTemplate: function() { - this.render(); // all defaults apply - } - }); - ``` - The name of the `PostRoute`, defined by the router, is `post`. - The following equivalent default options will be applied when - the Route calls `render`: - ```javascript - // - this.render('post', { // the template name associated with 'post' Route - into: 'application', // the parent route to 'post' Route - outlet: 'main', // {{outlet}} and {{outlet 'main'}} are synonymous, - controller: 'post', // the controller associated with the 'post' Route - }) - ``` - By default the controller's `model` will be the route's model, so it does not - need to be passed unless you wish to change which model is being used. - @method render - @param {String} name the name of the template to render - @param {Object} [options] the options - @param {String} [options.into] the template to render into, - referenced by name. Defaults to the parent template - @param {String} [options.outlet] the outlet inside `options.template` to render into. - Defaults to 'main' - @param {String|Object} [options.controller] the controller to use for this template, - referenced by name or as a controller instance. Defaults to the Route's paired controller - @param {Object} [options.model] the model object to set on `options.controller`. - Defaults to the return value of the Route's model hook - @since 1.0.0 - @public - */ - render: function (_name, options) { - _emberMetal.assert('The name in the given arguments is undefined', arguments.length > 0 ? !_emberMetal.isNone(arguments[0]) : true); - - var namePassed = typeof _name === 'string' && !!_name; - var isDefaultRender = arguments.length === 0 || _emberMetal.isEmpty(arguments[0]); - var name = undefined; - - if (typeof _name === 'object' && !options) { - name = this.templateName || this.routeName; - options = _name; - } else { - name = _name; - } - - var renderOptions = buildRenderOptions(this, namePassed, isDefaultRender, name, options); - this.connections.push(renderOptions); - _emberMetal.run.once(this.router, '_setOutlets'); - }, - - /** - Disconnects a view that has been rendered into an outlet. - You may pass any or all of the following options to `disconnectOutlet`: - * `outlet`: the name of the outlet to clear (default: 'main') - * `parentView`: the name of the view containing the outlet to clear - (default: the view rendered by the parent route) - Example: - ```javascript - App.ApplicationRoute = App.Route.extend({ - actions: { - showModal: function(evt) { - this.render(evt.modalName, { - outlet: 'modal', - into: 'application' - }); - }, - hideModal: function(evt) { - this.disconnectOutlet({ - outlet: 'modal', - parentView: 'application' - }); - } - } - }); - ``` - Alternatively, you can pass the `outlet` name directly as a string. - Example: - ```javascript - hideModal: function(evt) { - this.disconnectOutlet('modal'); - } - ``` - @method disconnectOutlet - @param {Object|String} options the options hash or outlet name - @since 1.0.0 - @public - */ - disconnectOutlet: function (options) { - var outletName = undefined; - var parentView = undefined; - 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 _emberMetal.Error('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++) { - // This non-local state munging is sadly necessary to maintain - // backward compatibility with our existing semantics, which allow - // any route to disconnectOutlet things originally rendered by any - // other route. This should all get cut in 2.0. - this.router.router.currentHandlerInfos[i].handler._disconnectOutlet(outletName, parentView); - } - }, - - _disconnectOutlet: function (outletName, parentView) { - var parent = parentRoute(this); - if (parent && parentView === parent.routeName) { - parentView = undefined; - } - for (var i = 0; i < this.connections.length; i++) { - var connection = this.connections[i]; - if (connection.outlet === outletName && connection.into === parentView) { - // This neuters the disconnected outlet such that it doesn't - // render anything, but it leaves an entry in the outlet - // 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, - controller: undefined, - template: undefined, - ViewClass: undefined - }; - _emberMetal.run.once(this.router, '_setOutlets'); - } - } - }, - - willDestroy: function () { - this.teardownViews(); - }, - - /** - @private - @method teardownViews - */ - teardownViews: function () { - if (this.connections && this.connections.length > 0) { - this.connections = []; - _emberMetal.run.once(this.router, '_setOutlets'); - } - } - }); - - _emberRuntime.deprecateUnderscoreActions(Route); - - Route.reopenClass({ - isRouteFactory: true - }); - - function parentRoute(route) { - var handlerInfo = handlerInfoFor(route, route.router.router.state.handlerInfos, -1); - return handlerInfo && handlerInfo.handler; - } - - function handlerInfoFor(route, handlerInfos, _offset) { - if (!handlerInfos) { - return; - } - - var offset = _offset || 0; - var current = undefined; - for (var i = 0; i < handlerInfos.length; i++) { - current = handlerInfos[i].handler; - if (current === route) { - return handlerInfos[i + offset]; - } - } - } - - function buildRenderOptions(route, namePassed, isDefaultRender, _name, options) { - var into = options && options.into && options.into.replace(/\//g, '.'); - var outlet = options && options.outlet || 'main'; - - var name = undefined, - templateName = undefined; - if (_name) { - name = _name.replace(/\//g, '.'); - templateName = name; - } else { - name = route.routeName; - templateName = route.templateName || name; - } - - var owner = _emberUtils.getOwner(route); - var controller = options && options.controller; - if (!controller) { - if (namePassed) { - controller = owner.lookup('controller:' + name) || route.controllerName || route.routeName; - } else { - controller = route.controllerName || owner.lookup('controller:' + name); - } - } - - if (typeof controller === 'string') { - var controllerName = controller; - controller = owner.lookup('controller:' + controllerName); - if (!controller) { - throw new _emberMetal.Error('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 _emberMetal.Error('You passed undefined as the outlet name.'); - } - - if (options && options.model) { - controller.set('model', options.model); - } - - var template = owner.lookup('template:' + templateName); - - var parent = undefined; - if (into && (parent = parentRoute(route)) && into === parentRoute(route).routeName) { - into = undefined; - } - - var renderOptions = { - owner: owner, - into: into, - outlet: outlet, - name: name, - controller: controller, - template: template || route._topLevelViewTemplate, - ViewClass: undefined - }; - - _emberMetal.assert('Could not find "' + name + '" template, view, or component.', isDefaultRender || template); - - var LOG_VIEW_LOOKUPS = _emberMetal.get(route.router, 'namespace.LOG_VIEW_LOOKUPS'); - if (LOG_VIEW_LOOKUPS && !template) { - _emberMetal.info('Could not find "' + name + '" template. Nothing will be rendered', { fullName: 'template:' + name }); - } - - return renderOptions; - } - - function getFullQueryParams(router, state) { - if (state.fullQueryParams) { - return state.fullQueryParams; - } - - state.fullQueryParams = {}; - _emberUtils.assign(state.fullQueryParams, state.queryParams); - - router._deserializeQueryParams(state.handlerInfos, state.fullQueryParams); - return state.fullQueryParams; - } - - function getQueryParamsFor(route, state) { - state.queryParamsFor = state.queryParamsFor || {}; - var name = route.fullRouteName; - - if (state.queryParamsFor[name]) { - return state.queryParamsFor[name]; - } - - var fullQueryParams = getFullQueryParams(route.router, state); - - var params = state.queryParamsFor[name] = {}; - - // Copy over all the query params for this route/controller into params hash. - var qpMeta = _emberMetal.get(route, '_qp'); - var qps = qpMeta.qps; - for (var i = 0; i < qps.length; ++i) { - // Put deserialized qp on params hash. - var qp = qps[i]; - - var qpValueWasPassedIn = (qp.prop in fullQueryParams); - params[qp.prop] = qpValueWasPassedIn ? fullQueryParams[qp.prop] : copyDefaultValue(qp.defaultValue); - } - - return params; - } - - function copyDefaultValue(value) { - if (Array.isArray(value)) { - return _emberRuntime.A(value.slice()); - } - return value; - } - - /* - Merges all query parameters from a controller with those from - a route, returning a new object and avoiding any mutations to - the existing objects. - */ - function mergeEachQueryParams(controllerQP, routeQP) { - var keysAlreadyMergedOrSkippable = undefined; - var qps = {}; - - 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)) { - continue; - } - - var newControllerParameterConfiguration = {}; - _emberUtils.assign(newControllerParameterConfiguration, controllerQP[cqpName]); - _emberUtils.assign(newControllerParameterConfiguration, routeQP[cqpName]); - - qps[cqpName] = newControllerParameterConfiguration; - - // allows us to skip this QP when we check route QPs. - keysAlreadyMergedOrSkippable[cqpName] = true; - } - - // loop over all route qps, skipping those that were merged in the first pass - // because they also appear in controller qps - for (var rqpName in routeQP) { - if (!routeQP.hasOwnProperty(rqpName) || keysAlreadyMergedOrSkippable[rqpName]) { - continue; - } - - var newRouteParameterConfiguration = {}; - _emberUtils.assign(newRouteParameterConfiguration, routeQP[rqpName], controllerQP[rqpName]); - qps[rqpName] = newRouteParameterConfiguration; - } - - return qps; - } - - function addQueryParamsObservers(controller, propNames) { - propNames.forEach(function (prop) { - controller.addObserver(prop + '.[]', controller, controller._qpChanged); - }); - } - - function getEngineRouteName(engine, routeName) { - if (engine.routable) { - var prefix = engine.mountPoint; - - if (routeName === 'application') { - return prefix; - } else { - return prefix + '.' + routeName; - } - } - - return routeName; - } - - exports.default = Route; -}); -enifed('ember-routing/system/router', ['exports', 'ember-utils', 'ember-console', 'ember-metal', 'ember-runtime', 'ember-routing/system/route', 'ember-routing/system/dsl', 'ember-routing/location/api', 'ember-routing/utils', 'ember-routing/system/router_state', 'router'], function (exports, _emberUtils, _emberConsole, _emberMetal, _emberRuntime, _emberRoutingSystemRoute, _emberRoutingSystemDsl, _emberRoutingLocationApi, _emberRoutingUtils, _emberRoutingSystemRouter_state, _router4) { - 'use strict'; - - exports.triggerEvent = triggerEvent; - - function K() { - return this; - } - - var slice = Array.prototype.slice; - - /** - The `Ember.Router` class manages the application state and URLs. Refer to - the [routing guide](http://emberjs.com/guides/routing/) for documentation. - - @class Router - @namespace Ember - @extends Ember.Object - @uses Ember.Evented - @public - */ - var EmberRouter = _emberRuntime.Object.extend(_emberRuntime.Evented, { - /** - The `location` property determines the type of URL's that your - application will use. - The following location types are currently available: - * `history` - use the browser's history API to make the URLs look just like any standard URL - * `hash` - use `#` to separate the server part of the URL from the Ember part: `/blog/#/posts/new` - * `none` - do not store the Ember URL in the actual browser URL (mainly used for testing) - * `auto` - use the best option based on browser capabilites: `history` if possible, then `hash` if possible, otherwise `none` - Note: If using ember-cli, this value is defaulted to `auto` by the `locationType` setting of `/config/environment.js` - @property location - @default 'hash' - @see {Ember.Location} - @public - */ - location: 'hash', - - /** - Represents the URL of the root of the application, often '/'. This prefix is - assumed on all routes defined on this router. - @property rootURL - @default '/' - @public - */ - rootURL: '/', - - _initRouterJs: function () { - var router = this.router = new _router4.default(); - router.triggerEvent = triggerEvent; - - router._triggerWillChangeContext = K; - router._triggerWillLeave = K; - - var dslCallbacks = this.constructor.dslCallbacks || [K]; - var dsl = this._buildDSL(); - - dsl.route('application', { path: '/', resetNamespace: true, overrideNameAssertion: true }, function () { - for (var i = 0; i < dslCallbacks.length; i++) { - dslCallbacks[i].call(this); - } - }); - - if (_emberMetal.get(this, 'namespace.LOG_TRANSITIONS_INTERNAL')) { - router.log = _emberConsole.default.debug; - } - - router.map(dsl.generate()); - }, - - _buildDSL: function () { - var moduleBasedResolver = this._hasModuleBasedResolver(); - var options = { - enableLoadingSubstates: !!moduleBasedResolver - }; - - var owner = _emberUtils.getOwner(this); - var router = this; - - options.resolveRouteMap = function (name) { - return owner._lookupFactory('route-map:' + name); - }; - - options.addRouteForEngine = function (name, engineInfo) { - if (!router._engineInfoByRoute[name]) { - router._engineInfoByRoute[name] = engineInfo; - } - }; - - return new _emberRoutingSystemDsl.default(null, options); - }, - - init: function () { - this._super.apply(this, arguments); - - this._qpCache = new _emberUtils.EmptyObject(); - this._resetQueuedQueryParameterChanges(); - this._handledErrors = _emberUtils.dictionary(null); - this._engineInstances = new _emberUtils.EmptyObject(); - this._engineInfoByRoute = new _emberUtils.EmptyObject(); - }, - - /* - Resets all pending query paramter changes. - Called after transitioning to a new route - based on query parameter changes. - */ - _resetQueuedQueryParameterChanges: function () { - this._queuedQPChanges = {}; - }, - - /** - Represents the current URL. - @method url - @return {String} The current URL. - @private - */ - url: _emberMetal.computed(function () { - return _emberMetal.get(this, 'location').getURL(); - }), - - _hasModuleBasedResolver: function () { - var owner = _emberUtils.getOwner(this); - - if (!owner) { - return false; - } - - var resolver = owner.application && owner.application.__registry__ && owner.application.__registry__.resolver; - - if (!resolver) { - return false; - } - - return !!resolver.moduleBasedResolver; - }, - - /** - Initializes the current router instance and sets up the change handling - event listeners used by the instances `location` implementation. - A property named `initialURL` will be used to determine the initial URL. - If no value is found `/` will be used. - @method startRouting - @private - */ - startRouting: function () { - var initialURL = _emberMetal.get(this, 'initialURL'); - - if (this.setupRouter()) { - if (typeof initialURL === 'undefined') { - initialURL = _emberMetal.get(this, 'location').getURL(); - } - var initialTransition = this.handleURL(initialURL); - if (initialTransition && initialTransition.error) { - throw initialTransition.error; - } - } - }, - - setupRouter: function () { - var _this = this; - - this._initRouterJs(); - this._setupLocation(); - - var router = this.router; - var location = _emberMetal.get(this, 'location'); - - // Allow the Location class to cancel the router setup while it refreshes - // the page - if (_emberMetal.get(location, 'cancelRouterSetup')) { - return false; - } - - this._setupRouter(router, location); - - location.onUpdateURL(function (url) { - _this.handleURL(url); - }); - - return true; - }, - - /** - Handles updating the paths and notifying any listeners of the URL - change. - Triggers the router level `didTransition` hook. - For example, to notify google analytics when the route changes, - you could use this hook. (Note: requires also including GA scripts, etc.) - ```javascript - let Router = Ember.Router.extend({ - location: config.locationType, - didTransition: function() { - this._super(...arguments); - return ga('send', 'pageview', { - 'page': this.get('url'), - 'title': this.get('url') - }); - } - }); - ``` - @method didTransition - @public - @since 1.2.0 - */ - didTransition: function (infos) { - updatePaths(this); - - this._cancelSlowTransitionTimer(); - - this.notifyPropertyChange('url'); - this.set('currentState', this.targetState); - - // Put this in the runloop so url will be accurate. Seems - // less surprising than didTransition being out of sync. - _emberMetal.run.once(this, this.trigger, 'didTransition'); - - if (_emberMetal.get(this, 'namespace').LOG_TRANSITIONS) { - _emberConsole.default.log('Transitioned into \'' + EmberRouter._routePath(infos) + '\''); - } - }, - - _setOutlets: function () { - // This is triggered async during Ember.Route#willDestroy. - // If the router is also being destroyed we do not want to - // to create another this._toplevelView (and leak the renderer) - if (this.isDestroying || this.isDestroyed) { - return; - } + @private + @method makeBoundHelper + @for Ember.HTMLBars + @param {Function} fn + @since 1.10.0 + */ - var handlerInfos = this.router.currentHandlerInfos; - var route = undefined; - var defaultParentState = undefined; - var liveRoutes = null; + function makeBoundHelper(fn) { + _emberMetal.deprecate('Using `Ember.HTMLBars.makeBoundHelper` is deprecated. Please refactor to use `Ember.Helper` or `Ember.Helper.helper`.', false, { id: 'ember-htmlbars.make-bound-helper', until: '3.0.0' }); + return _emberGlimmerHelper.helper(fn); + } +}); +enifed('ember-glimmer/modifiers/action', ['exports', 'ember-utils', 'ember-metal', 'ember-views', 'ember-glimmer/helpers/action'], function (exports, _emberUtils, _emberMetal, _emberViews, _emberGlimmerHelpersAction) { + 'use strict'; - if (!handlerInfos) { - return; - } + var MODIFIERS = ['alt', 'shift', 'meta', 'ctrl']; + var POINTER_EVENT_TYPE_REGEX = /^click|mouse|touch/; - for (var i = 0; i < handlerInfos.length; i++) { - route = handlerInfos[i].handler; - var connections = route.connections; - var ownState = undefined; - for (var j = 0; j < connections.length; j++) { - var appended = appendLiveRoute(liveRoutes, defaultParentState, connections[j]); - liveRoutes = appended.liveRoutes; - if (appended.ownState.render.name === route.routeName || appended.ownState.render.outlet === 'main') { - ownState = appended.ownState; - } - } - if (connections.length === 0) { - ownState = representEmptyRoute(liveRoutes, defaultParentState, route); - } - defaultParentState = ownState; + function isAllowedEvent(event, allowedKeys) { + if (allowedKeys === null || typeof allowedKeys === 'undefined') { + if (POINTER_EVENT_TYPE_REGEX.test(event.type)) { + return _emberViews.isSimpleClick(event); + } else { + allowedKeys = ''; } + } - // when a transitionTo happens after the validation phase - // during the initial transition _setOutlets is called - // when no routes are active. However, it will get called - // again with the correct values during the next turn of - // the runloop - if (!liveRoutes) { - return; - } + if (allowedKeys.indexOf('any') >= 0) { + return true; + } - if (!this._toplevelView) { - var owner = _emberUtils.getOwner(this); - var OutletView = owner._lookupFactory('view:-outlet'); - this._toplevelView = OutletView.create(); - this._toplevelView.setOutletState(liveRoutes); - var instance = owner.lookup('-application-instance:main'); - instance.didCreateRootView(this._toplevelView); - } else { - this._toplevelView.setOutletState(liveRoutes); + for (var i = 0; i < MODIFIERS.length; i++) { + if (event[MODIFIERS[i] + 'Key'] && allowedKeys.indexOf(MODIFIERS[i]) === -1) { + return false; } - }, + } - /** - Handles notifying any listeners of an impending URL - change. - Triggers the router level `willTransition` hook. - @method willTransition - @public - @since 1.11.0 - */ - willTransition: function (oldInfos, newInfos, transition) { - _emberMetal.run.once(this, this.trigger, 'willTransition', transition); + return true; + } - if (_emberMetal.get(this, 'namespace').LOG_TRANSITIONS) { - _emberConsole.default.log('Preparing to transition from \'' + EmberRouter._routePath(oldInfos) + '\' to \'' + EmberRouter._routePath(newInfos) + '\''); - } - }, + var ActionHelper = { + // registeredActions is re-exported for compatibility with older plugins + // that were using this undocumented API. + registeredActions: _emberViews.ActionManager.registeredActions, - handleURL: function (url) { - // Until we have an ember-idiomatic way of accessing #hashes, we need to - // remove it because router.js doesn't know how to handle it. - url = url.split(/#(.+)?/)[0]; - return this._doURLTransition('handleURL', url); - }, + registerAction: function (actionState) { + var actionId = actionState.actionId; - _doURLTransition: function (routerJsMethod, url) { - var transition = this.router[routerJsMethod](url || '/'); - didBeginTransition(transition, this); - return transition; + _emberViews.ActionManager.registeredActions[actionId] = actionState; + + return actionId; }, - /** - Transition the application into another route. The route may - be either a single route or route path: - See [Route.transitionTo](http://emberjs.com/api/classes/Ember.Route.html#method_transitionTo) for more info. - @method transitionTo - @param {String} name the name of the route or a URL - @param {...Object} models the model(s) or identifier(s) to be used while - transitioning to the route. - @param {Object} [options] optional hash with a queryParams property - containing a mapping of query parameters - @return {Transition} the transition object associated with this - attempted transition - @public - */ - transitionTo: function () { - var queryParams = undefined; + unregisterAction: function (actionState) { + var actionId = actionState.actionId; - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } + delete _emberViews.ActionManager.registeredActions[actionId]; + } + }; - if (resemblesURL(args[0])) { - return this._doURLTransition('transitionTo', args[0]); - } + exports.ActionHelper = ActionHelper; - var possibleQueryParams = args[args.length - 1]; - if (possibleQueryParams && possibleQueryParams.hasOwnProperty('queryParams')) { - queryParams = args.pop().queryParams; - } else { - queryParams = {}; - } + var ActionState = (function () { + function ActionState(element, actionId, actionName, actionArgs, namedArgs, positionalArgs, implicitTarget, dom) { + babelHelpers.classCallCheck(this, ActionState); - var targetRouteName = args.shift(); - return this._doTransition(targetRouteName, args, queryParams); - }, + this.element = element; + this.actionId = actionId; + this.actionName = actionName; + this.actionArgs = actionArgs; + this.namedArgs = namedArgs; + this.positional = positionalArgs; + this.implicitTarget = implicitTarget; + this.dom = dom; + this.eventName = this.getEventName(); + } - intermediateTransitionTo: function () { - var _router; + // implements ModifierManager - (_router = this.router).intermediateTransitionTo.apply(_router, arguments); + ActionState.prototype.getEventName = function getEventName() { + return this.namedArgs.get('on').value() || 'click'; + }; - updatePaths(this); + ActionState.prototype.getActionArgs = function getActionArgs() { + var result = new Array(this.actionArgs.length); - var infos = this.router.currentHandlerInfos; - if (_emberMetal.get(this, 'namespace').LOG_TRANSITIONS) { - _emberConsole.default.log('Intermediate-transitioned into \'' + EmberRouter._routePath(infos) + '\''); + for (var i = 0; i < this.actionArgs.length; i++) { + result[i] = this.actionArgs[i].value(); } - }, - replaceWith: function () { - return this.transitionTo.apply(this, arguments).method('replace'); - }, + return result; + }; - generate: function () { - var _router2; + ActionState.prototype.getTarget = function getTarget() { + var implicitTarget = this.implicitTarget; + var namedArgs = this.namedArgs; - var url = (_router2 = this.router).generate.apply(_router2, arguments); - return this.location.formatURL(url); - }, + var target = undefined; - /** - Determines if the supplied route is currently active. - @method isActive - @param routeName - @return {Boolean} - @private - */ - isActive: function (routeName) { - var router = this.router; - return router.isActive.apply(router, arguments); - }, + if (namedArgs.has('target')) { + target = namedArgs.get('target').value(); + } else { + target = implicitTarget.value(); + } - /** - An alternative form of `isActive` that doesn't require - manual concatenation of the arguments into a single - array. - @method isActiveIntent - @param routeName - @param models - @param queryParams - @return {Boolean} - @private - @since 1.7.0 - */ - isActiveIntent: function (routeName, models, queryParams) { - return this.currentState.isActiveIntent(routeName, models, queryParams); - }, + return target; + }; - send: function (name, context) { - var _router3; + ActionState.prototype.handler = function handler(event) { + var _this = this; - (_router3 = this.router).trigger.apply(_router3, arguments); - }, + var actionName = this.actionName; + var namedArgs = this.namedArgs; - /** - Does this router instance have the given route. - @method hasRoute - @return {Boolean} - @private - */ - hasRoute: function (route) { - return this.router.hasRoute(route); - }, + var bubbles = namedArgs.get('bubbles'); + var preventDefault = namedArgs.get('preventDefault'); + var allowedKeys = namedArgs.get('allowedKeys'); + var target = this.getTarget(); - /** - Resets the state of the router by clearing the current route - handlers and deactivating them. - @private - @method reset - */ - reset: function () { - if (this.router) { - this.router.reset(); + if (!isAllowedEvent(event, allowedKeys.value())) { + return true; } - }, - willDestroy: function () { - if (this._toplevelView) { - this._toplevelView.destroy(); - this._toplevelView = null; + if (preventDefault.value() !== false) { + event.preventDefault(); } - this._super.apply(this, arguments); - - this.reset(); + if (bubbles.value() === false) { + event.stopPropagation(); + } - var instances = this._engineInstances; - for (var _name in instances) { - for (var id in instances[_name]) { - _emberMetal.run(instances[_name][id], 'destroy'); + _emberMetal.run(function () { + var args = _this.getActionArgs(); + var payload = { + args: args, + target: target + }; + if (typeof actionName[_emberGlimmerHelpersAction.INVOKE] === 'function') { + _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { + actionName[_emberGlimmerHelpersAction.INVOKE].apply(actionName, args); + }); + return; } - } - }, + if (typeof actionName === 'function') { + _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { + actionName.apply(target, args); + }); + return; + } + payload.name = actionName; + if (target.send) { + _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { + target.send.apply(target, [actionName].concat(args)); + }); + } else { + _emberMetal.assert('The action \'' + actionName + '\' did not exist on ' + target, typeof target[actionName] === 'function'); + _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { + target[actionName].apply(target, args); + }); + } + }); + }; - /* - Called when an active route's query parameter has changed. - These changes are batched into a runloop run and trigger - a single transition. - */ - _activeQPChanged: function (queryParameterName, newValue) { - this._queuedQPChanges[queryParameterName] = newValue; - _emberMetal.run.once(this, this._fireQueryParamTransition); - }, + ActionState.prototype.destroy = function destroy() { + ActionHelper.unregisterAction(this); + }; - _updatingQPChanged: function (queryParameterName) { - if (!this._qpUpdates) { - this._qpUpdates = {}; - } - this._qpUpdates[queryParameterName] = true; - }, + return ActionState; + })(); - /* - Triggers a transition to a route based on query parameter changes. - This is called once per runloop, to batch changes. - e.g. - if these methods are called in succession: - this._activeQPChanged('foo', '10'); - // results in _queuedQPChanges = { foo: '10' } - this._activeQPChanged('bar', false); - // results in _queuedQPChanges = { foo: '10', bar: false } - _queuedQPChanges will represent both of these changes - and the transition using `transitionTo` will be triggered - once. - */ - _fireQueryParamTransition: function () { - this.transitionTo({ queryParams: this._queuedQPChanges }); - this._resetQueuedQueryParameterChanges(); - }, + exports.ActionState = ActionState; - _setupLocation: function () { - var location = _emberMetal.get(this, 'location'); - var rootURL = _emberMetal.get(this, 'rootURL'); - var owner = _emberUtils.getOwner(this); + var ActionModifierManager = (function () { + function ActionModifierManager() { + babelHelpers.classCallCheck(this, ActionModifierManager); + } - if ('string' === typeof location && owner) { - var resolvedLocation = owner.lookup('location:' + location); + ActionModifierManager.prototype.create = function create(element, args, dynamicScope, dom) { + var named = args.named; + var positional = args.positional; - if ('undefined' !== typeof resolvedLocation) { - location = _emberMetal.set(this, 'location', resolvedLocation); + var implicitTarget = undefined; + var actionName = undefined; + var actionNameRef = undefined; + if (positional.length > 1) { + implicitTarget = positional.at(0); + actionNameRef = positional.at(1); + + if (actionNameRef[_emberGlimmerHelpersAction.INVOKE]) { + actionName = actionNameRef; } else { - // Allow for deprecated registration of custom location API's - var options = { - implementation: location - }; + var actionLabel = actionNameRef._propertyKey; + actionName = actionNameRef.value(); - location = _emberMetal.set(this, 'location', _emberRoutingLocationApi.default.create(options)); + _emberMetal.assert('You specified a quoteless path, `' + actionLabel + '`, to the ' + '{{action}} helper which did not resolve to an action name (a ' + 'string). Perhaps you meant to use a quoted actionName? (e.g. ' + '{{action "' + actionLabel + '"}}).', typeof actionName === 'string' || typeof actionName === 'function'); } } - if (location !== null && typeof location === 'object') { - if (rootURL) { - _emberMetal.set(location, 'rootURL', rootURL); - } + var actionArgs = []; + // The first two arguments are (1) `this` and (2) the action name. + // Everything else is a param. + for (var i = 2; i < positional.length; i++) { + actionArgs.push(positional.at(i)); + } - // Allow the location to do any feature detection, such as AutoLocation - // detecting history support. This gives it a chance to set its - // `cancelRouterSetup` property which aborts routing. - if (typeof location.detect === 'function') { - location.detect(); - } + var actionId = _emberUtils.uuid(); + return new ActionState(element, actionId, actionName, actionArgs, named, positional, implicitTarget, dom); + }; - // ensure that initState is called AFTER the rootURL is set on - // the location instance - if (typeof location.initState === 'function') { - location.initState(); - } + ActionModifierManager.prototype.install = function install(actionState) { + var dom = actionState.dom; + var element = actionState.element; + var actionId = actionState.actionId; + + ActionHelper.registerAction(actionState); + + dom.setAttribute(element, 'data-ember-action', ''); + dom.setAttribute(element, 'data-ember-action-' + actionId, actionId); + }; + + ActionModifierManager.prototype.update = function update(actionState) { + var positional = actionState.positional; + + var actionNameRef = positional.at(1); + + if (!actionNameRef[_emberGlimmerHelpersAction.INVOKE]) { + actionState.actionName = actionNameRef.value(); } - }, + actionState.eventName = actionState.getEventName(); - _getHandlerFunction: function () { - var _this2 = this; + // Not sure if this is needed? If we mutate the actionState is that good enough? + ActionHelper.unregisterAction(actionState); + ActionHelper.registerAction(actionState); + }; - var seen = new _emberUtils.EmptyObject(); - var owner = _emberUtils.getOwner(this); + ActionModifierManager.prototype.getDestructor = function getDestructor(modifier) { + return modifier; + }; - return function (name) { - var routeName = name; - var routeOwner = owner; - var engineInfo = _this2._engineInfoByRoute[routeName]; + return ActionModifierManager; + })(); - if (engineInfo) { - var engineInstance = _this2._getEngineInstance(engineInfo); + exports.default = ActionModifierManager; +}); +enifed('ember-glimmer/protocol-for-url', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { + /* globals module, URL */ - routeOwner = engineInstance; - routeName = engineInfo.localFullName; - } + 'use strict'; - var fullRouteName = 'route:' + routeName; + exports.default = installProtocolForURL; - var handler = routeOwner.lookup(fullRouteName); + var nodeURL = undefined; + var parsingNode = undefined; - if (seen[name]) { - return handler; - } + function installProtocolForURL(environment) { + var protocol = undefined; - seen[name] = true; + if (_emberEnvironment.environment.hasDOM) { + protocol = browserProtocolForURL.call(environment, 'foobar:baz'); + } - if (!handler) { - var DefaultRoute = routeOwner._lookupFactory('route:basic'); + // Test to see if our DOM implementation parses + // and normalizes URLs. + if (protocol === 'foobar:') { + // Swap in the method that doesn't do this test now that + // we know it works. + environment.protocolForURL = browserProtocolForURL; + } else if (typeof URL === 'object') { + // URL globally provided, likely from FastBoot's sandbox + nodeURL = URL; + environment.protocolForURL = nodeProtocolForURL; + } else if (typeof module === 'object' && typeof module.require === 'function') { + // Otherwise, we need to fall back to our own URL parsing. + // Global `require` is shadowed by Ember's loader so we have to use the fully + // qualified `module.require`. + nodeURL = module.require('url'); + environment.protocolForURL = nodeProtocolForURL; + } else { + throw new Error('Could not find valid URL parsing mechanism for URL Sanitization'); + } + } - routeOwner.register(fullRouteName, DefaultRoute.extend()); - handler = routeOwner.lookup(fullRouteName); + function browserProtocolForURL(url) { + if (!parsingNode) { + parsingNode = document.createElement('a'); + } - if (_emberMetal.get(_this2, 'namespace.LOG_ACTIVE_GENERATION')) { - _emberMetal.info('generated -> ' + fullRouteName, { fullName: fullRouteName }); - } - } + parsingNode.href = url; + return parsingNode.protocol; + } - handler._setRouteName(routeName); - handler._populateQPMeta(); + function nodeProtocolForURL(url) { + var protocol = null; + if (typeof url === 'string') { + protocol = nodeURL.parse(url).protocol; + } + return protocol === null ? ':' : protocol; + } +}); +enifed('ember-glimmer/renderer', ['exports', 'ember-glimmer/utils/references', 'ember-metal', '@glimmer/reference', 'ember-views', 'ember-glimmer/component', 'ember-glimmer/syntax/curly-component', 'ember-glimmer/syntax/outlet'], function (exports, _emberGlimmerUtilsReferences, _emberMetal, _glimmerReference, _emberViews, _emberGlimmerComponent, _emberGlimmerSyntaxCurlyComponent, _emberGlimmerSyntaxOutlet) { + 'use strict'; - if (engineInfo && !_emberRoutingSystemRoute.hasDefaultSerialize(handler)) { - throw new Error('Defining a custom serialize method on an Engine route is not supported.'); - } + var backburner = _emberMetal.run.backburner; - return handler; - }; - }, + var DynamicScope = (function () { + function DynamicScope(view, outletState, rootOutletState, targetObject) { + babelHelpers.classCallCheck(this, DynamicScope); - _getSerializerFunction: function () { - var _this3 = this; + this.view = view; + this.outletState = outletState; + this.rootOutletState = rootOutletState; + } - return function (name) { - var engineInfo = _this3._engineInfoByRoute[name]; + DynamicScope.prototype.child = function child() { + return new DynamicScope(this.view, this.outletState, this.rootOutletState); + }; + + DynamicScope.prototype.get = function get(key) { + _emberMetal.assert('Using `-get-dynamic-scope` is only supported for `outletState` (you used `' + key + '`).', key === 'outletState'); + return this.outletState; + }; + + DynamicScope.prototype.set = function set(key, value) { + _emberMetal.assert('Using `-with-dynamic-scope` is only supported for `outletState` (you used `' + key + '`).', key === 'outletState'); + this.outletState = value; + return value; + }; - // If this is not an Engine route, we fall back to the handler for serialization - if (!engineInfo) { - return; - } + return DynamicScope; + })(); - return engineInfo.serializeMethod || _emberRoutingSystemRoute.defaultSerialize; - }; - }, + var RootState = (function () { + function RootState(root, env, template, self, parentElement, dynamicScope) { + var _this = this; - _setupRouter: function (router, location) { - var lastURL = undefined; - var emberRouter = this; + babelHelpers.classCallCheck(this, RootState); - router.getHandler = this._getHandlerFunction(); - router.getSerializer = this._getSerializerFunction(); + _emberMetal.assert('You cannot render `' + self.value() + '` without a template.', template); - var doUpdateURL = function () { - location.setURL(lastURL); - }; + this.id = _emberViews.getViewId(root); + this.env = env; + this.root = root; + this.result = undefined; + this.shouldReflush = false; + this.destroyed = false; + this._removing = false; - router.updateURL = function (path) { - lastURL = path; - _emberMetal.run.once(doUpdateURL); + var options = this.options = { + alwaysRevalidate: false }; - if (location.replaceURL) { - (function () { - var doReplaceURL = function () { - location.replaceURL(lastURL); - }; - - router.replaceURL = function (path) { - lastURL = path; - _emberMetal.run.once(doReplaceURL); - }; - })(); - } + this.render = function () { + var result = _this.result = template.render(self, parentElement, dynamicScope); - router.didTransition = function (infos) { - emberRouter.didTransition(infos); + // override .render function after initial render + _this.render = function () { + result.rerender(options); + }; }; + } - router.willTransition = function (oldInfos, newInfos, transition) { - emberRouter.willTransition(oldInfos, newInfos, transition); - }; - }, + RootState.prototype.isFor = function isFor(possibleRoot) { + return this.root === possibleRoot; + }; - /** - Serializes the given query params according to their QP meta information. - @private - @method _serializeQueryParams - @param {Arrray} handlerInfos - @param {Object} queryParams - @return {Void} - */ - _serializeQueryParams: function (handlerInfos, queryParams) { - var _this4 = this; + RootState.prototype.destroy = function destroy() { + var result = this.result; + var env = this.env; - forEachQueryParam(this, handlerInfos, queryParams, function (key, value, qp) { - if (qp) { - delete queryParams[key]; - queryParams[qp.urlKey] = qp.route.serializeQueryParam(value, qp.urlKey, qp.type); - } else if (value === undefined) { - return; // We don't serialize undefined values - } else { - queryParams[key] = _this4._serializeQueryParam(value, _emberRuntime.typeOf(value)); - } - }); - }, + this.destroyed = true; - /** - Serializes the value of a query parameter based on a type - @private - @method _serializeQueryParam - @param {Object} value - @param {String} type - */ - _serializeQueryParam: function (value, type) { - if (type === 'array') { - return JSON.stringify(value); - } + this.env = null; + this.root = null; + this.result = null; + this.render = null; - return '' + value; - }, + if (result) { + /* + Handles these scenarios: + * When roots are removed during standard rendering process, a transaction exists already + `.begin()` / `.commit()` are not needed. + * When roots are being destroyed manually (`component.append(); component.destroy() case), no + transaction exists already. + * When roots are being destroyed during `Renderer#destroy`, no transaction exists + */ + var needsTransaction = !env.inTransaction; - /** - Deserializes the given query params according to their QP meta information. - @private - @method _deserializeQueryParams - @param {Array} handlerInfos - @param {Object} queryParams - @return {Void} - */ - _deserializeQueryParams: function (handlerInfos, queryParams) { - forEachQueryParam(this, handlerInfos, queryParams, function (key, value, qp) { - // If we don't have QP meta info for a given key, then we do nothing - // because all values will be treated as strings - if (qp) { - delete queryParams[key]; - queryParams[qp.prop] = qp.route.deserializeQueryParam(value, qp.urlKey, qp.type); + if (needsTransaction) { + env.begin(); } - }); - }, - - /** - Deserializes the value of a query parameter based on a default type - @private - @method _deserializeQueryParam - @param {Object} value - @param {String} defaultType - */ - _deserializeQueryParam: function (value, defaultType) { - if (defaultType === 'boolean') { - return value === 'true' ? true : false; - } else if (defaultType === 'number') { - return Number(value).valueOf(); - } else if (defaultType === 'array') { - return _emberRuntime.A(JSON.parse(value)); - } - return value; - }, + result.destroy(); - /** - Removes (prunes) any query params with default values from the given QP - object. Default values are determined from the QP meta information per key. - @private - @method _pruneDefaultQueryParamValues - @param {Array} handlerInfos - @param {Object} queryParams - @return {Void} - */ - _pruneDefaultQueryParamValues: function (handlerInfos, queryParams) { - var qps = this._queryParamsFor(handlerInfos); - for (var key in queryParams) { - var qp = qps.map[key]; - if (qp && qp.serializedDefaultValue === queryParams[key]) { - delete queryParams[key]; + if (needsTransaction) { + env.commit(); } } - }, - - _doTransition: function (_targetRouteName, models, _queryParams) { - var targetRouteName = _targetRouteName || _emberRoutingUtils.getActiveTargetName(this.router); - _emberMetal.assert('The route ' + targetRouteName + ' was not found', targetRouteName && this.router.hasRoute(targetRouteName)); + }; - var queryParams = {}; + return RootState; + })(); - this._processActiveTransitionQueryParams(targetRouteName, models, queryParams, _queryParams); + var renderers = []; - _emberUtils.assign(queryParams, _queryParams); - this._prepareQueryParams(targetRouteName, models, queryParams); + _emberMetal.setHasViews(function () { + return renderers.length > 0; + }); - var transitionArgs = _emberRoutingUtils.routeArgs(targetRouteName, models, queryParams); - var transition = this.router.transitionTo.apply(this.router, transitionArgs); + function register(renderer) { + _emberMetal.assert('Cannot register the same renderer twice', renderers.indexOf(renderer) === -1); + renderers.push(renderer); + } - didBeginTransition(transition, this); + function deregister(renderer) { + var index = renderers.indexOf(renderer); + _emberMetal.assert('Cannot deregister unknown unregistered renderer', index !== -1); + renderers.splice(index, 1); + } - return transition; - }, + function loopBegin() { + for (var i = 0; i < renderers.length; i++) { + renderers[i]._scheduleRevalidate(); + } + } - _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; - } + function K() {} - var unchangedQPs = {}; - var qpUpdates = this._qpUpdates || {}; - for (var key in this.router.activeTransition.queryParams) { - if (!qpUpdates[key]) { - unchangedQPs[key] = this.router.activeTransition.queryParams[key]; + var loops = 0; + function loopEnd(current, next) { + for (var i = 0; i < renderers.length; i++) { + if (!renderers[i]._isValid()) { + if (loops > 10) { + loops = 0; + // TODO: do something better + renderers[i].destroy(); + throw new Error('infinite rendering invalidation detected'); } + loops++; + return backburner.join(null, K); } + } + loops = 0; + } - // 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); - _emberUtils.assign(queryParams, unchangedQPs); - }, - - /** - Prepares the query params for a URL or Transition. Restores any undefined QP - keys/values, serializes all values, and then prunes any default values. - @private - @method _prepareQueryParams - @param {String} targetRouteName - @param {Array} models - @param {Object} queryParams - @return {Void} - */ - _prepareQueryParams: function (targetRouteName, models, queryParams) { - var state = calculatePostTransitionState(this, targetRouteName, models); - this._hydrateUnsuppliedQueryParams(state, queryParams); - this._serializeQueryParams(state.handlerInfos, queryParams); - this._pruneDefaultQueryParamValues(state.handlerInfos, queryParams); - }, + backburner.on('begin', loopBegin); + backburner.on('end', loopEnd); - /** - Returns the meta information for the query params of a given route. This - will be overriden to allow support for lazy routes. - @private - @method _getQPMeta - @param {HandlerInfo} handlerInfo - @return {Object} - */ - _getQPMeta: function (handlerInfo) { - var route = handlerInfo.handler; - return route && _emberMetal.get(route, '_qp'); - }, + var Renderer = (function () { + function Renderer(env, rootTemplate) { + var _viewRegistry = arguments.length <= 2 || arguments[2] === undefined ? _emberViews.fallbackViewRegistry : arguments[2]; - /** - Returns a merged query params meta object for a given set of handlerInfos. - Useful for knowing what query params are available for a given route hierarchy. - @private - @method _queryParamsFor - @param {Array} handlerInfos - @return {Object} - */ - _queryParamsFor: function (handlerInfos) { - var leafRouteName = handlerInfos[handlerInfos.length - 1].name; - if (this._qpCache[leafRouteName]) { - return this._qpCache[leafRouteName]; - } + var destinedForDOM = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3]; + babelHelpers.classCallCheck(this, Renderer); - var shouldCache = true; - var qpsByUrlKey = {}; - var map = {}; - var qps = []; + this._env = env; + this._rootTemplate = rootTemplate; + this._viewRegistry = _viewRegistry; + this._destinedForDOM = destinedForDOM; + this._destroyed = false; + this._roots = []; + this._lastRevision = null; + this._isRenderingRoots = false; + this._removedRoots = []; + } - for (var i = 0; i < handlerInfos.length; ++i) { - var qpMeta = this._getQPMeta(handlerInfos[i]); + // renderer HOOKS - if (!qpMeta) { - shouldCache = false; - continue; - } + Renderer.prototype.appendOutletView = function appendOutletView(view, target) { + var definition = new _emberGlimmerSyntaxOutlet.TopLevelOutletComponentDefinition(view); + var outletStateReference = view.toReference(); + var targetObject = view.outletState.render.controller; - // Loop over each QP to make sure we don't have any collisions by urlKey - for (var _i = 0; _i < qpMeta.qps.length; _i++) { - var qp = qpMeta.qps[_i]; - var urlKey = qp.urlKey; + this._appendDefinition(view, definition, target, outletStateReference, targetObject); + }; - if (qpsByUrlKey[urlKey]) { - var otherQP = qpsByUrlKey[urlKey]; - _emberMetal.assert('You\'re not allowed to have more than one controller property map to the same query param key, but both `' + otherQP.scopedPropertyName + '` and `' + qp.scopedPropertyName + '` map to `' + 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. `' + otherQP.prop + ': { as: \'other-' + otherQP.prop + '\' }`', false); - } + Renderer.prototype.appendTo = function appendTo(view, target) { + var rootDef = new _emberGlimmerSyntaxCurlyComponent.RootComponentDefinition(view); - qpsByUrlKey[urlKey] = qp; - qps.push(qp); - } + this._appendDefinition(view, rootDef, target); + }; - _emberUtils.assign(map, qpMeta.map); - } + Renderer.prototype._appendDefinition = function _appendDefinition(root, definition, target) { + var outletStateReference = arguments.length <= 3 || arguments[3] === undefined ? _glimmerReference.UNDEFINED_REFERENCE : arguments[3]; + var targetObject = arguments.length <= 4 || arguments[4] === undefined ? null : arguments[4]; - var finalQPMeta = { - qps: qps, - map: map - }; + var self = new _emberGlimmerUtilsReferences.RootReference(definition); + var dynamicScope = new DynamicScope(null, outletStateReference, outletStateReference, true, targetObject); + var rootState = new RootState(root, this._env, this._rootTemplate, self, target, dynamicScope); - if (shouldCache) { - this._qpCache[leafRouteName] = finalQPMeta; - } + this._renderRoot(rootState); + }; - return finalQPMeta; - }, + Renderer.prototype.rerender = function rerender(view) { + this._scheduleRevalidate(); + }; - /** - Maps all query param keys to their fully scoped property name of the form - `controllerName:propName`. - @private - @method _fullyScopeQueryParams - @param {String} leafRouteName - @param {Array} contexts - @param {Object} queryParams - @return {Void} - */ - _fullyScopeQueryParams: function (leafRouteName, contexts, queryParams) { - var state = calculatePostTransitionState(this, leafRouteName, contexts); - var handlerInfos = state.handlerInfos; + Renderer.prototype.register = function register(view) { + var id = _emberViews.getViewId(view); + _emberMetal.assert('Attempted to register a view with an id already in use: ' + id, !this._viewRegistry[id]); + this._viewRegistry[id] = view; + }; - for (var i = 0, len = handlerInfos.length; i < len; ++i) { - var qpMeta = this._getQPMeta(handlerInfos[i]); + Renderer.prototype.unregister = function unregister(view) { + delete this._viewRegistry[_emberViews.getViewId(view)]; + }; - if (!qpMeta) { - continue; - } + Renderer.prototype.remove = function remove(view) { + view._transitionTo('destroying'); - for (var j = 0, qpLen = qpMeta.qps.length; j < qpLen; ++j) { - var qp = qpMeta.qps[j]; + this.cleanupRootFor(view); - var presentProp = qp.prop in queryParams && qp.prop || qp.scopedPropertyName in queryParams && qp.scopedPropertyName || qp.urlKey in queryParams && qp.urlKey; + _emberViews.setViewElement(view, null); - if (presentProp) { - if (presentProp !== qp.scopedPropertyName) { - queryParams[qp.scopedPropertyName] = queryParams[presentProp]; - delete queryParams[presentProp]; - } - } - } + if (this._destinedForDOM) { + view.trigger('didDestroyElement'); } - }, - - /** - Hydrates (adds/restores) any query params that have pre-existing values into - the given queryParams hash. This is what allows query params to be "sticky" - and restore their last known values for their scope. - @private - @method _hydrateUnsuppliedQueryParams - @param {TransitionState} state - @param {Object} queryParams - @return {Void} - */ - _hydrateUnsuppliedQueryParams: function (state, queryParams) { - var handlerInfos = state.handlerInfos; - var appCache = this._bucketCache; - - for (var i = 0; i < handlerInfos.length; ++i) { - var qpMeta = this._getQPMeta(handlerInfos[i]); - - if (!qpMeta) { - continue; - } - - 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]; - } - } else { - var cacheKey = _emberRoutingUtils.calculateCacheKey(qp.controllerName, qp.parts, state.params); - queryParams[qp.scopedPropertyName] = appCache.lookup(cacheKey, qp.prop, qp.defaultValue); - } - } + if (!view.isDestroying) { + view.destroy(); } - }, - - _scheduleLoadingEvent: function (transition, originRoute) { - this._cancelSlowTransitionTimer(); - this._slowTransitionTimer = _emberMetal.run.scheduleOnce('routerTransitions', this, '_handleSlowTransition', transition, originRoute); - }, - - currentState: null, - targetState: null, + }; - _handleSlowTransition: function (transition, originRoute) { - if (!this.router.activeTransition) { - // Don't fire an event if we've since moved on from - // the transition that put us in a loading state. + Renderer.prototype.cleanupRootFor = function cleanupRootFor(view) { + // no need to cleanup roots if we have already been destroyed + if (this._destroyed) { return; } - this.set('targetState', _emberRoutingSystemRouter_state.default.create({ - emberRouter: this, - routerJs: this.router, - routerJsState: this.router.activeTransition.state - })); - - transition.trigger(true, 'loading', transition, originRoute); - }, + var roots = this._roots; - _cancelSlowTransitionTimer: function () { - if (this._slowTransitionTimer) { - _emberMetal.run.cancel(this._slowTransitionTimer); + // traverse in reverse so we can remove items + // without mucking up the index + var i = this._roots.length; + while (i--) { + var root = roots[i]; + if (root.isFor(view)) { + root.destroy(); + } } - this._slowTransitionTimer = null; - }, - - // These three helper functions are used to ensure errors aren't - // re-raised if they're handled in a route's error action. - _markErrorAsHandled: function (errorGuid) { - this._handledErrors[errorGuid] = true; - }, - - _isErrorHandled: function (errorGuid) { - return this._handledErrors[errorGuid]; - }, - - _clearHandledError: function (errorGuid) { - delete this._handledErrors[errorGuid]; - }, - - _getEngineInstance: function (_ref) { - var name = _ref.name; - var instanceId = _ref.instanceId; - var mountPoint = _ref.mountPoint; - - var engineInstances = this._engineInstances; + }; - if (!engineInstances[name]) { - engineInstances[name] = new _emberUtils.EmptyObject(); + Renderer.prototype.destroy = function destroy() { + if (this._destroyed) { + return; } + this._destroyed = true; + this._clearAllRoots(); + }; - var engineInstance = engineInstances[name][instanceId]; - - if (!engineInstance) { - var owner = _emberUtils.getOwner(this); - - _emberMetal.assert('You attempted to mount the engine \'' + name + '\' in your router map, but the engine can not be found.', owner.hasRegistration('engine:' + name)); - - engineInstance = owner.buildChildEngineInstance(name, { - routable: true, - mountPoint: mountPoint - }); + Renderer.prototype.getElement = function getElement(view) { + // overriden in the subclasses + }; - engineInstance.boot(); + Renderer.prototype.getBounds = function getBounds(view) { + var bounds = view[_emberGlimmerComponent.BOUNDS]; - engineInstances[name][instanceId] = engineInstance; - } + var parentElement = bounds.parentElement(); + var firstNode = bounds.firstNode(); + var lastNode = bounds.lastNode(); - return engineInstance; - } - }); + return { parentElement: parentElement, firstNode: firstNode, lastNode: lastNode }; + }; - /* - Helper function for iterating over routes in a set of handlerInfos that are - at or above the given origin route. Example: if `originRoute` === 'foo.bar' - and the handlerInfos given were for 'foo.bar.baz', then the given callback - will be invoked with the routes for 'foo.bar', 'foo', and 'application' - individually. - - If the callback returns anything other than `true`, then iteration will stop. - - @private - @param {Route} originRoute - @param {Array} handlerInfos - @param {Function} callback - @return {Void} - */ - function forEachRouteAbove(originRoute, handlerInfos, callback) { - var originRouteFound = false; + Renderer.prototype.createElement = function createElement(tagName) { + return this._env.getAppendOperations().createElement(tagName); + }; - for (var i = handlerInfos.length - 1; i >= 0; --i) { - var handlerInfo = handlerInfos[i]; - var route = handlerInfo.handler; + Renderer.prototype._renderRoot = function _renderRoot(root) { + var roots = this._roots; - if (originRoute === route) { - originRouteFound = true; - } + roots.push(root); - if (!originRouteFound) { - continue; + if (roots.length === 1) { + register(this); } - if (callback(route) !== true) { - return; - } - } - } + this._renderRootsTransaction(); + }; - // These get invoked when an action bubbles above ApplicationRoute - // and are not meant to be overridable. - var defaultActionHandlers = { + Renderer.prototype._renderRoots = function _renderRoots() { + var roots = this._roots; + var env = this._env; + var removedRoots = this._removedRoots; - willResolveModel: function (transition, originRoute) { - originRoute.router._scheduleLoadingEvent(transition, originRoute); - }, + var globalShouldReflush = undefined, + initialRootsLength = undefined; - // Attempt to find an appropriate error route or substate to enter. - error: function (error, transition, originRoute) { - var handlerInfos = transition.state.handlerInfos; - var router = originRoute.router; + do { + env.begin(); - forEachRouteAbove(originRoute, handlerInfos, function (route) { - // Check for the existence of an 'error' route. - // We don't check for an 'error' route on the originRoute, since that would - // technically be below where we're at in the route hierarchy. - if (originRoute !== route) { - var errorRouteName = findRouteStateName(route, 'error'); - if (errorRouteName) { - router.intermediateTransitionTo(errorRouteName, error); - return false; - } - } + // ensure that for the first iteration of the loop + // each root is processed + initialRootsLength = roots.length; + globalShouldReflush = false; - // Check for an 'error' substate route - var errorSubstateName = findRouteSubstateName(route, 'error'); - if (errorSubstateName) { - router.intermediateTransitionTo(errorSubstateName, error); - return false; - } + for (var i = 0; i < roots.length; i++) { + var root = roots[i]; - return true; - }); + if (root.destroyed) { + // add to the list of roots to be removed + // they will be removed from `this._roots` later + removedRoots.push(root); - logError(error, 'Error while processing route: ' + transition.targetName); - }, + // skip over roots that have been marked as destroyed + continue; + } - // Attempt to find an appropriate loading route or substate to enter. - loading: function (transition, originRoute) { - var handlerInfos = transition.state.handlerInfos; - var router = originRoute.router; + var shouldReflush = root.shouldReflush; - forEachRouteAbove(originRoute, handlerInfos, function (route) { - // Check for the existence of a 'loading' route. - // We don't check for a 'loading' route on the originRoute, since that would - // technically be below where we're at in the route hierarchy. - if (originRoute !== route) { - var loadingRouteName = findRouteStateName(route, 'loading'); - if (loadingRouteName) { - router.intermediateTransitionTo(loadingRouteName); - return false; + // when processing non-initial reflush loops, + // do not process more roots than needed + if (i >= initialRootsLength && !shouldReflush) { + continue; } - } - // Check for loading substate - var loadingSubstateName = findRouteSubstateName(route, 'loading'); - if (loadingSubstateName) { - router.intermediateTransitionTo(loadingSubstateName); - return false; + root.options.alwaysRevalidate = shouldReflush; + // track shouldReflush based on this roots render result + shouldReflush = root.shouldReflush = _emberMetal.runInTransaction(root, 'render'); + + // globalShouldReflush should be `true` if *any* of + // the roots need to reflush + globalShouldReflush = globalShouldReflush || shouldReflush; } - // Don't bubble above pivot route. - return transition.pivotHandler !== route; - }); - } - }; + this._lastRevision = _glimmerReference.CURRENT_TAG.value(); - function logError(_error, initialMessage) { - var errorArgs = []; - var error = undefined; - if (_error && typeof _error === 'object' && typeof _error.errorThrown === 'object') { - error = _error.errorThrown; - } else { - error = _error; - } + env.commit(); + } while (globalShouldReflush || roots.length > initialRootsLength); - if (initialMessage) { - errorArgs.push(initialMessage); - } + // remove any roots that were destroyed during this transaction + while (removedRoots.length) { + var root = removedRoots.pop(); - if (error) { - if (error.message) { - errorArgs.push(error.message); + var rootIndex = roots.indexOf(root); + roots.splice(rootIndex, 1); } - if (error.stack) { - errorArgs.push(error.stack); + + if (this._roots.length === 0) { + deregister(this); } + }; - if (typeof error === 'string') { - errorArgs.push(error); + Renderer.prototype._renderRootsTransaction = function _renderRootsTransaction() { + if (this._isRenderingRoots) { + // currently rendering roots, a new root was added and will + // be processed by the existing _renderRoots invocation + return; } - } - _emberConsole.default.error.apply(this, errorArgs); - } + // used to prevent calling _renderRoots again (see above) + // while we are actively rendering roots + this._isRenderingRoots = true; - /** - Finds the name of the substate route if it exists for the given route. A - substate route is of the form `route_state`, such as `foo_loading`. - - @private - @param {Route} route - @param {String} state - @return {String} - */ - function findRouteSubstateName(route, state) { - var router = route.router; - var owner = _emberUtils.getOwner(route); + var completedWithoutError = false; + try { + this._renderRoots(); + completedWithoutError = true; + } finally { + if (!completedWithoutError) { + this._lastRevision = _glimmerReference.CURRENT_TAG.value(); + } + this._isRenderingRoots = false; + } + }; - var routeName = route.routeName; - var substateName = routeName + '_' + state; + Renderer.prototype._clearAllRoots = function _clearAllRoots() { + var roots = this._roots; + for (var i = 0; i < roots.length; i++) { + var root = roots[i]; + root.destroy(); + } - var routeNameFull = route.fullRouteName; - var substateNameFull = routeNameFull + '_' + state; + this._removedRoots.length = 0; + this._roots = null; - return routeHasBeenDefined(owner, router, substateName, substateNameFull) ? substateNameFull : ''; - } + // if roots were present before destroying + // deregister this renderer instance + if (roots.length) { + deregister(this); + } + }; - /** - Finds the name of the state route if it exists for the given route. A state - route is of the form `route.state`, such as `foo.loading`. Properly Handles - `application` named routes. - - @private - @param {Route} route - @param {String} state - @return {String} - */ - function findRouteStateName(route, state) { - var router = route.router; - var owner = _emberUtils.getOwner(route); + Renderer.prototype._scheduleRevalidate = function _scheduleRevalidate() { + backburner.scheduleOnce('render', this, this._revalidate); + }; - var routeName = route.routeName; - var stateName = routeName === 'application' ? state : routeName + '.' + state; + Renderer.prototype._isValid = function _isValid() { + return this._destroyed || this._roots.length === 0 || _glimmerReference.CURRENT_TAG.validate(this._lastRevision); + }; - var routeNameFull = route.fullRouteName; - var stateNameFull = routeNameFull === 'application' ? state : routeNameFull + '.' + state; + Renderer.prototype._revalidate = function _revalidate() { + if (this._isValid()) { + return; + } + this._renderRootsTransaction(); + }; - return routeHasBeenDefined(owner, router, stateName, stateNameFull) ? stateNameFull : ''; - } + return Renderer; + })(); - /** - Determines whether or not a route has been defined by checking that the route - is in the Router's map and the owner has a registration for that route. - - @private - @param {Owner} owner - @param {Ember.Router} router - @param {String} localName - @param {String} fullName - @return {Boolean} - */ - function routeHasBeenDefined(owner, router, localName, fullName) { - var routerHasRoute = router.hasRoute(fullName); - var ownerHasRoute = owner.hasRegistration('template:' + localName) || owner.hasRegistration('route:' + localName); - return routerHasRoute && ownerHasRoute; - } + var InertRenderer = (function (_Renderer) { + babelHelpers.inherits(InertRenderer, _Renderer); - function triggerEvent(handlerInfos, ignoreFailure, args) { - var name = args.shift(); + function InertRenderer() { + babelHelpers.classCallCheck(this, InertRenderer); - if (!handlerInfos) { - if (ignoreFailure) { - return; - } - throw new _emberMetal.Error('Can\'t trigger action \'' + name + '\' because your app hasn\'t finished transitioning into its first route. To trigger an action on destination routes during a transition, you can call `.send()` on the `Transition` object passed to the `model/beforeModel/afterModel` hooks.'); + _Renderer.apply(this, arguments); } - var eventWasHandled = false; - var handlerInfo = undefined, - handler = undefined; - - for (var i = handlerInfos.length - 1; i >= 0; i--) { - handlerInfo = handlerInfos[i]; - handler = handlerInfo.handler; + InertRenderer.create = function create(_ref) { + var env = _ref.env; + var rootTemplate = _ref.rootTemplate; + var _viewRegistry = _ref._viewRegistry; - if (handler && handler.actions && handler.actions[name]) { - if (handler.actions[name].apply(handler, args) === true) { - eventWasHandled = true; - } else { - // Should only hit here if a non-bubbling error action is triggered on a route. - if (name === 'error') { - var errorId = _emberUtils.guidFor(args[0]); - handler.router._markErrorAsHandled(errorId); - } - return; - } - } - } + return new this(env, rootTemplate, _viewRegistry, false); + }; - if (defaultActionHandlers[name]) { - defaultActionHandlers[name].apply(null, args); - return; - } + InertRenderer.prototype.getElement = function getElement(view) { + throw new Error('Accessing `this.element` is not allowed in non-interactive environments (such as FastBoot).'); + }; - if (!eventWasHandled && !ignoreFailure) { - throw new _emberMetal.Error('Nothing handled the action \'' + name + '\'. If you did handle the action, this error can be caused by returning true from an action handler in a controller, causing the action to bubble.'); - } - } + return InertRenderer; + })(Renderer); - function calculatePostTransitionState(emberRouter, leafRouteName, contexts) { - var routerjs = emberRouter.router; - var state = routerjs.applyIntent(leafRouteName, contexts); - var handlerInfos = state.handlerInfos; - var params = state.params; + exports.InertRenderer = InertRenderer; - for (var i = 0; i < handlerInfos.length; ++i) { - var handlerInfo = handlerInfos[i]; + var InteractiveRenderer = (function (_Renderer2) { + babelHelpers.inherits(InteractiveRenderer, _Renderer2); - // If the handlerInfo is not resolved, we serialize the context into params - if (!handlerInfo.isResolved) { - params[handlerInfo.name] = handlerInfo.serialize(handlerInfo.context); - } else { - params[handlerInfo.name] = handlerInfo.params; - } - } - return state; - } + function InteractiveRenderer() { + babelHelpers.classCallCheck(this, InteractiveRenderer); - function updatePaths(router) { - var infos = router.router.currentHandlerInfos; - if (infos.length === 0) { - return; + _Renderer2.apply(this, arguments); } - var path = EmberRouter._routePath(infos); - var currentRouteName = infos[infos.length - 1].name; + InteractiveRenderer.create = function create(_ref2) { + var env = _ref2.env; + var rootTemplate = _ref2.rootTemplate; + var _viewRegistry = _ref2._viewRegistry; - _emberMetal.set(router, 'currentPath', path); - _emberMetal.set(router, 'currentRouteName', currentRouteName); + return new this(env, rootTemplate, _viewRegistry, true); + }; - var appController = _emberUtils.getOwner(router).lookup('controller:application'); + InteractiveRenderer.prototype.getElement = function getElement(view) { + return _emberViews.getViewElement(view); + }; - if (!appController) { - // appController might not exist when top-level loading/error - // substates have been entered since ApplicationRoute hasn't - // actually been entered at that point. - return; - } + return InteractiveRenderer; + })(Renderer); - if (!('currentPath' in appController)) { - _emberMetal.defineProperty(appController, 'currentPath'); - } + exports.InteractiveRenderer = InteractiveRenderer; +}); +enifed('ember-glimmer/setup-registry', ['exports', 'ember-environment', 'container', 'ember-glimmer/renderer', 'ember-glimmer/dom', 'ember-glimmer/views/outlet', 'ember-glimmer/components/text_field', 'ember-glimmer/components/text_area', 'ember-glimmer/components/checkbox', 'ember-glimmer/components/link-to', 'ember-glimmer/component', 'ember-glimmer/templates/component', 'ember-glimmer/templates/root', 'ember-glimmer/templates/outlet', 'ember-glimmer/environment'], function (exports, _emberEnvironment, _container, _emberGlimmerRenderer, _emberGlimmerDom, _emberGlimmerViewsOutlet, _emberGlimmerComponentsText_field, _emberGlimmerComponentsText_area, _emberGlimmerComponentsCheckbox, _emberGlimmerComponentsLinkTo, _emberGlimmerComponent, _emberGlimmerTemplatesComponent, _emberGlimmerTemplatesRoot, _emberGlimmerTemplatesOutlet, _emberGlimmerEnvironment) { + 'use strict'; - _emberMetal.set(appController, 'currentPath', path); + exports.setupApplicationRegistry = setupApplicationRegistry; + exports.setupEngineRegistry = setupEngineRegistry; - if (!('currentRouteName' in appController)) { - _emberMetal.defineProperty(appController, 'currentRouteName'); - } + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['template:-root'], ['template:-root']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['template:components/-default'], ['template:components/-default']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['component:-default'], ['component:-default']); - _emberMetal.set(appController, 'currentRouteName', currentRouteName); - } + function setupApplicationRegistry(registry) { + registry.injection('service:-glimmer-environment', 'appendOperations', 'service:-dom-tree-construction'); + registry.injection('renderer', 'env', 'service:-glimmer-environment'); - EmberRouter.reopenClass({ - router: null, + registry.register(_container.privatize(_templateObject), _emberGlimmerTemplatesRoot.default); + registry.injection('renderer', 'rootTemplate', _container.privatize(_templateObject)); - /** - The `Router.map` function allows you to define mappings from URLs to routes - in your application. These mappings are defined within the - supplied callback function using `this.route`. - The first parameter is the name of the route which is used by default as the - path name as well. - The second parameter is the optional options hash. Available options are: - * `path`: allows you to provide your own path as well as mark dynamic - segments. - * `resetNamespace`: false by default; when nesting routes, ember will - combine the route names to form the fully-qualified route name, which is - used with `{{link-to}}` or manually transitioning to routes. Setting - `resetNamespace: true` will cause the route not to inherit from its - parent route's names. This is handy for preventing extremely long route names. - Keep in mind that the actual URL path behavior is still retained. - The third parameter is a function, which can be used to nest routes. - Nested routes, by default, will have the parent route tree's route name and - path prepended to it's own. - ```javascript - App.Router.map(function(){ - this.route('post', { path: '/post/:post_id' }, function() { - this.route('edit'); - this.route('comments', { resetNamespace: true }, function() { - this.route('new'); - }); - }); - }); - ``` - For more detailed documentation and examples please see - [the guides](http://emberjs.com/guides/routing/defining-your-routes/). - @method map - @param callback - @public - */ - map: function (callback) { - if (!this.dslCallbacks) { - this.dslCallbacks = []; - this.reopenClass({ dslCallbacks: this.dslCallbacks }); - } + registry.register('renderer:-dom', _emberGlimmerRenderer.InteractiveRenderer); + registry.register('renderer:-inert', _emberGlimmerRenderer.InertRenderer); - this.dslCallbacks.push(callback); + if (_emberEnvironment.environment.hasDOM) { + registry.injection('service:-glimmer-environment', 'updateOperations', 'service:-dom-changes'); + } - return this; - }, + registry.register('service:-dom-changes', { + create: function (_ref) { + var document = _ref.document; - _routePath: function (handlerInfos) { - var path = []; + return new _emberGlimmerDom.DOMChanges(document); + } + }); - // We have to handle coalescing resource names that - // are prefixed with their parent's names, e.g. - // ['foo', 'foo.bar.baz'] => 'foo.bar.baz', not 'foo.foo.bar.baz' + registry.register('service:-dom-tree-construction', { + create: function (_ref2) { + var document = _ref2.document; - function intersectionMatches(a1, a2) { - for (var i = 0; i < a1.length; ++i) { - if (a1[i] !== a2[i]) { - return false; - } - } - return true; + var Implementation = _emberEnvironment.environment.hasDOM ? _emberGlimmerDom.DOMTreeConstruction : _emberGlimmerDom.NodeDOMTreeConstruction; + return new Implementation(document); } + }); + } - var name = undefined, - nameParts = undefined, - oldNameParts = undefined; - for (var i = 1; i < handlerInfos.length; i++) { - name = handlerInfos[i].name; - nameParts = name.split('.'); - oldNameParts = slice.call(path); + function setupEngineRegistry(registry) { + registry.register('view:-outlet', _emberGlimmerViewsOutlet.default); + registry.register('template:-outlet', _emberGlimmerTemplatesOutlet.default); + registry.injection('view:-outlet', 'template', 'template:-outlet'); - while (oldNameParts.length) { - if (intersectionMatches(oldNameParts, nameParts)) { - break; - } - oldNameParts.shift(); - } + registry.injection('service:-dom-changes', 'document', 'service:-document'); + registry.injection('service:-dom-tree-construction', 'document', 'service:-document'); - path.push.apply(path, nameParts.slice(oldNameParts.length)); - } + registry.register(_container.privatize(_templateObject2), _emberGlimmerTemplatesComponent.default); - return path.join('.'); - } - }); + registry.register('service:-glimmer-environment', _emberGlimmerEnvironment.default); + registry.injection('template', 'env', 'service:-glimmer-environment'); - function didBeginTransition(transition, router) { - var routerState = _emberRoutingSystemRouter_state.default.create({ - emberRouter: router, - routerJs: router.router, - routerJsState: transition.state - }); + registry.optionsForType('helper', { instantiate: false }); + + registry.register('component:-text-field', _emberGlimmerComponentsText_field.default); + registry.register('component:-text-area', _emberGlimmerComponentsText_area.default); + registry.register('component:-checkbox', _emberGlimmerComponentsCheckbox.default); + registry.register('component:link-to', _emberGlimmerComponentsLinkTo.default); + registry.register(_container.privatize(_templateObject3), _emberGlimmerComponent.default); + } +}); +enifed('ember-glimmer/syntax', ['exports', 'ember-glimmer/syntax/render', 'ember-glimmer/syntax/outlet', 'ember-glimmer/syntax/mount', 'ember-glimmer/syntax/dynamic-component', 'ember-glimmer/utils/bindings', 'ember-glimmer/syntax/-with-dynamic-vars', 'ember-glimmer/syntax/-in-element', 'ember-glimmer/syntax/input', 'ember-glimmer/syntax/-text-area', 'ember-metal'], function (exports, _emberGlimmerSyntaxRender, _emberGlimmerSyntaxOutlet, _emberGlimmerSyntaxMount, _emberGlimmerSyntaxDynamicComponent, _emberGlimmerUtilsBindings, _emberGlimmerSyntaxWithDynamicVars, _emberGlimmerSyntaxInElement, _emberGlimmerSyntaxInput, _emberGlimmerSyntaxTextArea, _emberMetal) { + 'use strict'; - if (!router.currentState) { - router.set('currentState', routerState); - } - router.set('targetState', routerState); + exports.registerMacros = registerMacros; + exports.populateMacros = populateMacros; - transition.promise = transition.catch(function (error) { - var errorId = _emberUtils.guidFor(error); + function refineInlineSyntax(path, params, hash, builder) { + var name = path[0]; - if (router._isErrorHandled(errorId)) { - router._clearHandledError(errorId); - } else { - throw error; - } - }); - } + _emberMetal.assert('You attempted to overwrite the built-in helper "' + name + '" which is not allowed. Please rename the helper.', !(builder.env.builtInHelpers[name] && builder.env.owner.hasRegistration('helper:' + name))); - function resemblesURL(str) { - return typeof str === 'string' && (str === '' || str.charAt(0) === '/'); - } + if (path.length > 1) { + return _emberGlimmerSyntaxDynamicComponent.closureComponentMacro(path, params, hash, null, null, builder); + } - function forEachQueryParam(router, handlerInfos, queryParams, callback) { - var qpCache = router._queryParamsFor(handlerInfos); + var symbolTable = builder.symbolTable; - for (var key in queryParams) { - if (!queryParams.hasOwnProperty(key)) { - continue; - } - var value = queryParams[key]; - var qp = qpCache.map[key]; + var definition = undefined; + if (name.indexOf('-') > -1) { + definition = builder.env.getComponentDefinition(path, symbolTable); + } - callback(key, value, qp); + if (definition) { + _emberGlimmerUtilsBindings.wrapComponentClassAttribute(hash); + builder.component.static(definition, [params, hash, null, null], symbolTable); + return true; } + + return false; } - function findLiveRoute(liveRoutes, name) { - if (!liveRoutes) { - return; + function refineBlockSyntax(sexp, builder) { + var path = sexp[1]; + var params = sexp[2]; + var hash = sexp[3]; + var _default = sexp[4]; + var inverse = sexp[5]; + var name = path[0]; + + if (path.length > 1) { + return _emberGlimmerSyntaxDynamicComponent.closureComponentMacro(path, params, hash, _default, inverse, builder); } - var stack = [liveRoutes]; - while (stack.length > 0) { - var test = stack.shift(); - if (test.render.name === name) { - return test; - } - var outlets = test.outlets; - for (var outletName in outlets) { - stack.push(outlets[outletName]); - } + + if (name.indexOf('-') === -1) { + return false; } - } - function appendLiveRoute(liveRoutes, defaultParentState, renderOptions) { - var target = undefined; - var myState = { - render: renderOptions, - outlets: new _emberUtils.EmptyObject(), - wasUsed: false - }; - if (renderOptions.into) { - target = findLiveRoute(liveRoutes, renderOptions.into); - } else { - target = defaultParentState; + var symbolTable = builder.symbolTable; + + var definition = undefined; + if (name.indexOf('-') > -1) { + definition = builder.env.getComponentDefinition(path, symbolTable); } - if (target) { - _emberMetal.set(target.outlets, renderOptions.outlet, myState); - } else { - if (renderOptions.into) { - // Megahax time. Post-3.0-breaking-changes, we will just assert - // right here that the user tried to target a nonexistent - // thing. But for now we still need to support the `render` - // helper, and people are allowed to target templates rendered - // by the render helper. So instead we defer doing anyting with - // these orphan renders until afterRender. - appendOrphan(liveRoutes, renderOptions.into, myState); - } else { - liveRoutes = myState; - } + + if (definition) { + _emberGlimmerUtilsBindings.wrapComponentClassAttribute(hash); + builder.component.static(definition, [params, hash, _default, inverse], symbolTable); + return true; } - return { - liveRoutes: liveRoutes, - ownState: myState - }; + + _emberMetal.assert('A component or helper named "' + name + '" could not be found', builder.env.hasHelper(path, symbolTable)); + + _emberMetal.assert('Helpers may not be used in the block form, for example {{#' + name + '}}{{/' + name + '}}. Please use a component, or alternatively use the helper in combination with a built-in Ember helper, for example {{#if (' + name + ')}}{{/if}}.', !builder.env.hasHelper(path, symbolTable)); + + return false; } - function appendOrphan(liveRoutes, into, myState) { - if (!liveRoutes.outlets.__ember_orphans__) { - liveRoutes.outlets.__ember_orphans__ = { - render: { - name: '__ember_orphans__' - }, - outlets: new _emberUtils.EmptyObject() - }; - } - liveRoutes.outlets.__ember_orphans__.outlets[into] = myState; - _emberMetal.run.schedule('afterRender', function () { - // `wasUsed` gets set by the render helper. - _emberMetal.assert('You attempted to render into \'' + into + '\' but it was not found', liveRoutes.outlets.__ember_orphans__.outlets[into].wasUsed); - }); + var experimentalMacros = []; + + // This is a private API to allow for expiremental macros + // to be created in user space. Registering a macro should + // should be done in an initializer. + + function registerMacros(macro) { + experimentalMacros.push(macro); } - function representEmptyRoute(liveRoutes, defaultParentState, route) { - // the route didn't render anything - var alreadyAppended = findLiveRoute(liveRoutes, route.routeName); - if (alreadyAppended) { - // But some other route has already rendered our default - // template, so that becomes the default target for any - // children we may have. - return alreadyAppended; - } else { - // Create an entry to represent our default template name, - // just so other routes can target it and inherit its place - // in the outlet hierarchy. - defaultParentState.outlets.main = { - render: { - name: route.routeName, - outlet: 'main' - }, - outlets: {} - }; - return defaultParentState; + function populateMacros(blocks, inlines) { + inlines.add('outlet', _emberGlimmerSyntaxOutlet.outletMacro); + inlines.add('component', _emberGlimmerSyntaxDynamicComponent.inlineComponentMacro); + inlines.add('render', _emberGlimmerSyntaxRender.renderMacro); + inlines.add('mount', _emberGlimmerSyntaxMount.mountMacro); + inlines.add('input', _emberGlimmerSyntaxInput.inputMacro); + inlines.add('textarea', _emberGlimmerSyntaxTextArea.textAreaMacro); + inlines.addMissing(refineInlineSyntax); + blocks.add('component', _emberGlimmerSyntaxDynamicComponent.blockComponentMacro); + blocks.add('-with-dynamic-vars', _emberGlimmerSyntaxWithDynamicVars._withDynamicVarsMacro); + blocks.add('-in-element', _emberGlimmerSyntaxInElement._inElementMacro); + blocks.addMissing(refineBlockSyntax); + + for (var i = 0; i < experimentalMacros.length; i++) { + var macro = experimentalMacros[i]; + macro(blocks, inlines); } - } - exports.default = EmberRouter; -}); + experimentalMacros = []; -/** -@module ember -@submodule ember-routing -*/ -enifed('ember-routing/system/router_state', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime'], function (exports, _emberUtils, _emberMetal, _emberRuntime) { + return { blocks: blocks, inlines: inlines }; + } +}); +enifed('ember-glimmer/syntax/-in-element', ['exports', '@glimmer/runtime', '@glimmer/util'], function (exports, _glimmerRuntime, _glimmerUtil) { 'use strict'; - exports.default = _emberRuntime.Object.extend({ - emberRouter: null, - routerJs: null, - routerJsState: null, - - isActiveIntent: function (routeName, models, queryParams, queryParamsMustMatch) { - var state = this.routerJsState; - if (!this.routerJs.isActiveIntent(routeName, models, null, state)) { - return false; - } + exports._inElementMacro = _inElementMacro; + var _BaselineSyntax$NestedBlock = _glimmerRuntime.BaselineSyntax.NestedBlock; + var defaultBlock = _BaselineSyntax$NestedBlock.defaultBlock; + var params = _BaselineSyntax$NestedBlock.params; + var hash = _BaselineSyntax$NestedBlock.hash; - var emptyQueryParams = _emberMetal.isEmpty(Object.keys(queryParams)); + function _inElementMacro(sexp, builder) { + var block = defaultBlock(sexp); + var args = _glimmerRuntime.compileArgs(params(sexp), hash(sexp), builder); - if (queryParamsMustMatch && !emptyQueryParams) { - var visibleQueryParams = {}; - _emberUtils.assign(visibleQueryParams, queryParams); + builder.putArgs(args); + builder.test('simple'); - this.emberRouter._prepareQueryParams(routeName, models, visibleQueryParams); - return shallowEqual(visibleQueryParams, state.queryParams); - } + builder.labelled(null, function (b) { + b.jumpUnless('END'); + b.pushRemoteElement(); + b.evaluate(_glimmerUtil.unwrap(block)); + b.popRemoteElement(); + }); + } +}); +enifed('ember-glimmer/syntax/-text-area', ['exports', 'ember-glimmer/utils/bindings'], function (exports, _emberGlimmerUtilsBindings) { + 'use strict'; - return true; - } - }); + exports.textAreaMacro = textAreaMacro; - function shallowEqual(a, b) { - var k = undefined; - for (k in a) { - if (a.hasOwnProperty(k) && a[k] !== b[k]) { - return false; - } - } - for (k in b) { - if (b.hasOwnProperty(k) && a[k] !== b[k]) { - return false; - } - } + function textAreaMacro(path, params, hash, builder) { + var definition = builder.env.getComponentDefinition(['-text-area'], builder.symbolTable); + _emberGlimmerUtilsBindings.wrapComponentClassAttribute(hash); + builder.component.static(definition, [params, hash, null, null], builder.symbolTable); return true; } }); -enifed('ember-routing/utils', ['exports', 'ember-utils', 'ember-metal'], function (exports, _emberUtils, _emberMetal) { +enifed('ember-glimmer/syntax/-with-dynamic-vars', ['exports', '@glimmer/runtime', '@glimmer/util'], function (exports, _glimmerRuntime, _glimmerUtil) { 'use strict'; - exports.routeArgs = routeArgs; - exports.getActiveTargetName = getActiveTargetName; - exports.stashParamNames = stashParamNames; - exports.calculateCacheKey = calculateCacheKey; - exports.normalizeControllerQueryParams = normalizeControllerQueryParams; - exports.prefixRouteNameArg = prefixRouteNameArg; + exports._withDynamicVarsMacro = _withDynamicVarsMacro; + var _BaselineSyntax$NestedBlock = _glimmerRuntime.BaselineSyntax.NestedBlock; + var defaultBlock = _BaselineSyntax$NestedBlock.defaultBlock; + var params = _BaselineSyntax$NestedBlock.params; + var hash = _BaselineSyntax$NestedBlock.hash; - var ALL_PERIODS_REGEX = /\./g; + function _withDynamicVarsMacro(sexp, builder) { + var block = defaultBlock(sexp); + var args = _glimmerRuntime.compileArgs(params(sexp), hash(sexp), builder); - function routeArgs(targetRouteName, models, queryParams) { - var args = []; - if (typeof targetRouteName === 'string') { - args.push('' + targetRouteName); - } - args.push.apply(args, models); - args.push({ queryParams: queryParams }); - return args; + builder.unit(function (b) { + b.putArgs(args); + b.pushDynamicScope(); + b.bindDynamicScope(args.named.keys); + b.evaluate(_glimmerUtil.unwrap(block)); + b.popDynamicScope(); + }); } +}); +enifed('ember-glimmer/syntax/abstract-manager', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - function getActiveTargetName(router) { - var handlerInfos = router.activeTransition ? router.activeTransition.state.handlerInfos : router.state.handlerInfos; - return handlerInfos[handlerInfos.length - 1].name; - } + var AbstractManager = function AbstractManager() { + babelHelpers.classCallCheck(this, AbstractManager); + }; - function stashParamNames(router, handlerInfos) { - if (handlerInfos._namesStashed) { - return; - } + _emberMetal.runInDebug(function () { + AbstractManager.prototype._pushToDebugStack = function (name, environment) { + this.debugStack = environment.debugStack; + this.debugStack.push(name); + }; - // This helper exists because router.js/route-recognizer.js awkwardly - // keeps separate a handlerInfo's list of parameter names depending - // on whether a URL transition or named transition is happening. - // Hopefully we can remove this in the future. - var targetRouteName = handlerInfos[handlerInfos.length - 1].name; - var recogHandlers = router.router.recognizer.handlersFor(targetRouteName); - var dynamicParent = null; + AbstractManager.prototype._pushEngineToDebugStack = function (name, environment) { + this.debugStack = environment.debugStack; + this.debugStack.pushEngine(name); + }; + }); - for (var i = 0; i < handlerInfos.length; ++i) { - var handlerInfo = handlerInfos[i]; - var names = recogHandlers[i].names; + exports.default = AbstractManager; +}); +enifed('ember-glimmer/syntax/curly-component', ['exports', 'ember-utils', '@glimmer/runtime', 'ember-glimmer/utils/bindings', 'ember-glimmer/component', 'ember-metal', 'ember-views', 'ember-glimmer/utils/process-args', 'container', 'ember-glimmer/syntax/abstract-manager'], function (exports, _emberUtils, _glimmerRuntime, _emberGlimmerUtilsBindings, _emberGlimmerComponent, _emberMetal, _emberViews, _emberGlimmerUtilsProcessArgs, _container, _emberGlimmerSyntaxAbstractManager) { + 'use strict'; - if (names.length) { - dynamicParent = handlerInfo; - } + exports.validatePositionalParameters = validatePositionalParameters; - handlerInfo._names = names; + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['template:components/-default'], ['template:components/-default']); - var route = handlerInfo.handler; - route._stashNames(handlerInfo, dynamicParent); - } + var DEFAULT_LAYOUT = _container.privatize(_templateObject); - handlerInfos._namesStashed = true; - } + function processComponentInitializationAssertions(component, props) { + _emberMetal.assert('classNameBindings must not have spaces in them: ' + component.toString(), (function () { + var classNameBindings = component.classNameBindings; - function _calculateCacheValuePrefix(prefix, part) { - // calculates the dot seperated sections from prefix that are also - // at the start of part - which gives us the route name + for (var i = 0; i < classNameBindings.length; i++) { + var binding = classNameBindings[i]; + if (binding.split(' ').length > 1) { + return false; + } + } + return true; + })()); - // given : prefix = site.article.comments, part = site.article.id - // - returns: site.article (use get(values[site.article], 'id') to get the dynamic part - used below) + _emberMetal.assert('You cannot use `classNameBindings` on a tag-less component: ' + component.toString(), (function () { + var classNameBindings = component.classNameBindings; + var tagName = component.tagName; - // given : prefix = site.article, part = site.article.id - // - returns: site.article. (use get(values[site.article], 'id') to get the dynamic part - used below) + return tagName !== '' || !classNameBindings || classNameBindings.length === 0; + })()); - var prefixParts = prefix.split('.'); - var currPrefix = ''; + _emberMetal.assert('You cannot use `elementId` on a tag-less component: ' + component.toString(), (function () { + var elementId = component.elementId; + var tagName = component.tagName; - for (var i = 0; i < prefixParts.length; i++) { - var currPart = prefixParts.slice(0, i + 1).join('.'); - if (part.indexOf(currPart) !== 0) { - break; - } - currPrefix = currPart; - } + return tagName !== '' || props.id === elementId || !elementId && elementId !== ''; + })()); - return currPrefix; - } + _emberMetal.assert('You cannot use `attributeBindings` on a tag-less component: ' + component.toString(), (function () { + var attributeBindings = component.attributeBindings; + var tagName = component.tagName; - /* - Stolen from Controller - */ + return tagName !== '' || !attributeBindings || attributeBindings.length === 0; + })()); + } - function calculateCacheKey(prefix, _parts, values) { - var parts = _parts || []; - var suffixes = ''; - for (var i = 0; i < parts.length; ++i) { - var part = parts[i]; - var cacheValuePrefix = _calculateCacheValuePrefix(prefix, part); - var value = undefined; - if (values) { - if (cacheValuePrefix && cacheValuePrefix in values) { - var partRemovedPrefix = part.indexOf(cacheValuePrefix) === 0 ? part.substr(cacheValuePrefix.length + 1) : part; - value = _emberMetal.get(values[cacheValuePrefix], partRemovedPrefix); - } else { - value = _emberMetal.get(values, part); - } + function validatePositionalParameters(named, positional, positionalParamsDefinition) { + _emberMetal.runInDebug(function () { + if (!named || !positional || !positional.length) { + return; } - suffixes += '::' + part + ':' + value; - } - return prefix + suffixes.replace(ALL_PERIODS_REGEX, '-'); - } - /* - Controller-defined query parameters can come in three shapes: - - Array - queryParams: ['foo', 'bar'] - Array of simple objects where value is an alias - queryParams: [ - { - 'foo': 'rename_foo_to_this' - }, - { - 'bar': 'call_bar_this_instead' - } - ] - Array of fully defined objects - queryParams: [ - { - 'foo': { - as: 'rename_foo_to_this' - }, - } - { - 'bar': { - as: 'call_bar_this_instead', - scope: 'controller' - } + var paramType = typeof positionalParamsDefinition; + + if (paramType === 'string') { + _emberMetal.assert('You cannot specify positional parameters and the hash argument `' + positionalParamsDefinition + '`.', !named.has(positionalParamsDefinition)); + } else { + if (positional.length < positionalParamsDefinition.length) { + positionalParamsDefinition = positionalParamsDefinition.slice(0, positional.length); } - ] - - This helper normalizes all three possible styles into the - 'Array of fully defined objects' style. - */ - function normalizeControllerQueryParams(queryParams) { - if (queryParams._qpMap) { - return queryParams._qpMap; - } + for (var i = 0; i < positionalParamsDefinition.length; i++) { + var _name = positionalParamsDefinition[i]; - var qpMap = queryParams._qpMap = {}; + _emberMetal.assert('You cannot specify both a positional param (at position ' + i + ') and the hash argument `' + _name + '`.', !named.has(_name)); + } + } + }); + } - for (var i = 0; i < queryParams.length; ++i) { - accumulateQueryParamDescriptors(queryParams[i], qpMap); + function aliasIdToElementId(args, props) { + if (args.named.has('id')) { + _emberMetal.assert('You cannot invoke a component with both \'id\' and \'elementId\' at the same time.', !args.named.has('elementId')); + props.elementId = props.id; } - - return qpMap; } - function accumulateQueryParamDescriptors(_desc, accum) { - var desc = _desc; - var tmp = undefined; - if (typeof desc === 'string') { - tmp = {}; - tmp[desc] = { as: null }; - desc = tmp; - } + // We must traverse the attributeBindings in reverse keeping track of + // what has already been applied. This is essentially refining the concated + // properties applying right to left. + function applyAttributeBindings(element, attributeBindings, component, operations) { + var seen = []; + var i = attributeBindings.length - 1; - for (var key in desc) { - if (!desc.hasOwnProperty(key)) { - return; - } + while (i !== -1) { + var binding = attributeBindings[i]; + var parsed = _emberGlimmerUtilsBindings.AttributeBinding.parse(binding); + var attribute = parsed[1]; - var singleDesc = desc[key]; - if (typeof singleDesc === 'string') { - singleDesc = { as: singleDesc }; + if (seen.indexOf(attribute) === -1) { + seen.push(attribute); + _emberGlimmerUtilsBindings.AttributeBinding.install(element, component, parsed, operations); } - tmp = accum[key] || { as: null, scope: 'model' }; - _emberUtils.assign(tmp, singleDesc); + i--; + } - accum[key] = tmp; + if (seen.indexOf('id') === -1) { + operations.addStaticAttribute(element, 'id', component.elementId); } - } - /* - Check if a routeName resembles a url instead - - @private - */ - function resemblesURL(str) { - return typeof str === 'string' && (str === '' || str.charAt(0) === '/'); + if (seen.indexOf('style') === -1) { + _emberGlimmerUtilsBindings.IsVisibleBinding.install(element, component, operations); + } } - /* - Returns an arguments array where the route name arg is prefixed based on the mount point - - @private - */ + function NOOP() {} - function prefixRouteNameArg(route, args) { - var routeName = args[0]; - var owner = _emberUtils.getOwner(route); - var prefix = owner.mountPoint; + var ComponentStateBucket = (function () { + function ComponentStateBucket(environment, component, args, finalizer) { +babelHelpers.classCallCheck(this, ComponentStateBucket); - // only alter the routeName if it's actually referencing a route. - if (owner.routable && typeof routeName === 'string') { - if (resemblesURL(routeName)) { - throw new _emberMetal.Error('Programmatic transitions by URL cannot be used within an Engine. Please use the route name instead.'); - } else { - routeName = prefix + '.' + routeName; - args[0] = routeName; - } + this.environment = environment; + this.component = component; + this.classRef = null; + this.args = args; + this.argsRevision = args.tag.value(); + this.finalizer = finalizer; } - return args; - } -}); -enifed('ember-runtime/compare', ['exports', 'ember-runtime/utils', 'ember-runtime/mixins/comparable'], function (exports, _emberRuntimeUtils, _emberRuntimeMixinsComparable) { - 'use strict'; + ComponentStateBucket.prototype.destroy = function destroy() { + var component = this.component; + var environment = this.environment; - exports.default = compare; + if (environment.isInteractive) { + component.trigger('willDestroyElement'); + component.trigger('willClearRender'); + } - var TYPE_ORDER = { - 'undefined': 0, - 'null': 1, - 'boolean': 2, - 'number': 3, - 'string': 4, - 'array': 5, - 'object': 6, - 'instance': 7, - 'function': 8, - 'class': 9, - 'date': 10 - }; + environment.destroyedComponents.push(component); + }; - // - // the spaceship operator - // - // `. ___ - // __,' __`. _..----....____ - // __...--.'``;. ,. ;``--..__ .' ,-._ _.-' - // _..-''-------' `' `' `' O ``-''._ (,;') _,' - // ,'________________ \`-._`-',' - // `._ ```````````------...___ '-.._'-: - // ```--.._ ,. ````--...__\-. - // `.--. `-` "INFINITY IS LESS ____ | |` - // `. `. THAN BEYOND" ,'`````. ; ;` - // `._`. __________ `. \'__/` - // `-:._____/______/___/____`. \ ` - // | `._ `. \ - // `._________`-. `. `.___ - // SSt `------'` - function spaceship(a, b) { - var diff = a - b; - return (diff > 0) - (diff < 0); - } + ComponentStateBucket.prototype.finalize = function finalize() { + var finalizer = this.finalizer; - /** - Compares two javascript values and returns: - - - -1 if the first is smaller than the second, - - 0 if both are equal, - - 1 if the first is greater than the second. - - ```javascript - Ember.compare('hello', 'hello'); // 0 - Ember.compare('abc', 'dfg'); // -1 - Ember.compare(2, 1); // 1 - ``` - - If the types of the two objects are different precedence occurs in the - following order, with types earlier in the list considered `<` types - later in the list: - - - undefined - - null - - boolean - - number - - string - - array - - object - - instance - - function - - class - - date - - ```javascript - Ember.compare('hello', 50); // 1 - Ember.compare(50, 'hello'); // -1 - ``` - - @method compare - @for Ember - @param {Object} v First value to compare - @param {Object} w Second value to compare - @return {Number} -1 if v < w, 0 if v = w and 1 if v > w. - @public - */ + finalizer(); + this.finalizer = NOOP; + }; - function compare(v, w) { - if (v === w) { - return 0; - } + return ComponentStateBucket; + })(); - var type1 = _emberRuntimeUtils.typeOf(v); - var type2 = _emberRuntimeUtils.typeOf(w); + function initialRenderInstrumentDetails(component) { + return component.instrumentDetails({ initialRender: true }); + } - if (_emberRuntimeMixinsComparable.default) { - if (type1 === 'instance' && _emberRuntimeMixinsComparable.default.detect(v) && v.constructor.compare) { - return v.constructor.compare(v, w); - } + function rerenderInstrumentDetails(component) { + return component.instrumentDetails({ initialRender: false }); + } - if (type2 === 'instance' && _emberRuntimeMixinsComparable.default.detect(w) && w.constructor.compare) { - return w.constructor.compare(w, v) * -1; - } - } + var CurlyComponentManager = (function (_AbstractManager) { +babelHelpers.inherits(CurlyComponentManager, _AbstractManager); - var res = spaceship(TYPE_ORDER[type1], TYPE_ORDER[type2]); + function CurlyComponentManager() { +babelHelpers.classCallCheck(this, CurlyComponentManager); - if (res !== 0) { - return res; + _AbstractManager.apply(this, arguments); } - // types are equal - so we have to check values now - switch (type1) { - case 'boolean': - case 'number': - return spaceship(v, w); - - case 'string': - return spaceship(v.localeCompare(w), 0); + CurlyComponentManager.prototype.prepareArgs = function prepareArgs(definition, args) { + if (definition.ComponentClass) { + validatePositionalParameters(args.named, args.positional.values, definition.ComponentClass.class.positionalParams); + } - case 'array': - var vLen = v.length; - var wLen = w.length; - var len = Math.min(vLen, wLen); - - for (var i = 0; i < len; i++) { - var r = compare(v[i], w[i]); - if (r !== 0) { - return r; - } - } + return _emberGlimmerUtilsProcessArgs.gatherArgs(args, definition); + }; - // all elements are equal now - // shorter array should be ordered first - return spaceship(vLen, wLen); + CurlyComponentManager.prototype.create = function create(environment, definition, args, dynamicScope, callerSelfRef, hasBlock) { + var _this = this; - case 'instance': - if (_emberRuntimeMixinsComparable.default && _emberRuntimeMixinsComparable.default.detect(v)) { - return v.compare(v, w); - } - return 0; + _emberMetal.runInDebug(function () { + return _this._pushToDebugStack('component:' + definition.name, environment); + }); - case 'date': - return spaceship(v.getTime(), w.getTime()); + var parentView = dynamicScope.view; - default: - return 0; - } - } -}); -enifed('ember-runtime/computed/computed_macros', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; + var factory = definition.ComponentClass; - exports.empty = empty; - exports.notEmpty = notEmpty; - exports.none = none; - exports.not = not; - exports.bool = bool; - exports.match = match; - exports.equal = equal; - exports.gt = gt; - exports.gte = gte; - exports.lt = lt; - exports.lte = lte; - exports.oneWay = oneWay; - exports.readOnly = readOnly; - exports.deprecatingAlias = deprecatingAlias; + var processedArgs = _emberGlimmerUtilsProcessArgs.ComponentArgs.create(args); - /** - @module ember - @submodule ember-metal - */ + var _processedArgs$value = processedArgs.value(); - function expandPropertiesToArray(predicateName, properties) { - var expandedProperties = []; + var props = _processedArgs$value.props; - function extractProperty(entry) { - expandedProperties.push(entry); - } + aliasIdToElementId(args, props); - for (var i = 0; i < properties.length; i++) { - var property = properties[i]; - _emberMetal.assert('Dependent keys passed to Ember.computed.' + predicateName + '() can\'t have spaces.', property.indexOf(' ') < 0); + props.parentView = parentView; + props[_emberGlimmerComponent.HAS_BLOCK] = hasBlock; - _emberMetal.expandProperties(property, extractProperty); - } + props._targetObject = callerSelfRef.value(); - return expandedProperties; - } + var component = factory.create(props); - function generateComputedWithPredicate(name, predicate) { - return function () { - for (var _len = arguments.length, properties = Array(_len), _key = 0; _key < _len; _key++) { - properties[_key] = arguments[_key]; - } + var finalizer = _emberMetal._instrumentStart('render.component', initialRenderInstrumentDetails, component); - var expandedProperties = expandPropertiesToArray(name, properties); + dynamicScope.view = component; - var computedFunc = _emberMetal.computed(function () { - var lastIdx = expandedProperties.length - 1; + if (parentView !== null) { + parentView.appendChild(component); + } - for (var i = 0; i < lastIdx; i++) { - var value = _emberMetal.get(this, expandedProperties[i]); - if (!predicate(value)) { - return value; - } + // We usually do this in the `didCreateElement`, but that hook doesn't fire for tagless components + if (component.tagName === '') { + if (environment.isInteractive) { + component.trigger('willRender'); } - return _emberMetal.get(this, expandedProperties[lastIdx]); - }); - - return computedFunc.property.apply(computedFunc, expandedProperties); - }; - } + component._transitionTo('hasElement'); - /** - A computed property that returns true if the value of the dependent - property is null, an empty string, empty array, or empty function. - - Example - - ```javascript - let ToDoList = Ember.Object.extend({ - isDone: Ember.computed.empty('todos') - }); - - let todoList = ToDoList.create({ - todos: ['Unit Test', 'Documentation', 'Release'] - }); - - todoList.get('isDone'); // false - todoList.get('todos').clear(); - todoList.get('isDone'); // true - ``` - - @since 1.6.0 - @method empty - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which negate - the original value for property - @public - */ + if (environment.isInteractive) { + component.trigger('willInsertElement'); + } + } - function empty(dependentKey) { - return _emberMetal.computed(dependentKey + '.length', function () { - return _emberMetal.isEmpty(_emberMetal.get(this, dependentKey)); - }); - } + var bucket = new ComponentStateBucket(environment, component, processedArgs, finalizer); - /** - A computed property that returns true if the value of the dependent - property is NOT null, an empty string, empty array, or empty function. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - hasStuff: Ember.computed.notEmpty('backpack') - }); - - let hamster = Hamster.create({ backpack: ['Food', 'Sleeping Bag', 'Tent'] }); - - hamster.get('hasStuff'); // true - hamster.get('backpack').clear(); // [] - hamster.get('hasStuff'); // false - ``` - - @method notEmpty - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which returns true if - original value for property is not empty. - @public - */ + if (args.named.has('class')) { + bucket.classRef = args.named.get('class'); + } - function notEmpty(dependentKey) { - return _emberMetal.computed(dependentKey + '.length', function () { - return !_emberMetal.isEmpty(_emberMetal.get(this, dependentKey)); - }); - } + processComponentInitializationAssertions(component, props); - /** - A computed property that returns true if the value of the dependent - property is null or undefined. This avoids errors from JSLint complaining - about use of ==, which can be technically confusing. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - isHungry: Ember.computed.none('food') - }); - - let hamster = Hamster.create(); - - hamster.get('isHungry'); // true - hamster.set('food', 'Banana'); - hamster.get('isHungry'); // false - hamster.set('food', null); - hamster.get('isHungry'); // true - ``` - - @method none - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which - returns true if original value for property is null or undefined. - @public - */ + if (environment.isInteractive && component.tagName !== '') { + component.trigger('willRender'); + } - function none(dependentKey) { - return _emberMetal.computed(dependentKey, function () { - return _emberMetal.isNone(_emberMetal.get(this, dependentKey)); - }); - } + return bucket; + }; - /** - A computed property that returns the inverse boolean value - of the original value for the dependent property. - - Example - - ```javascript - let User = Ember.Object.extend({ - isAnonymous: Ember.computed.not('loggedIn') - }); - - let user = User.create({loggedIn: false}); - - user.get('isAnonymous'); // true - user.set('loggedIn', true); - user.get('isAnonymous'); // false - ``` - - @method not - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which returns - inverse of the original value for property - @public - */ + CurlyComponentManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { + var template = definition.template; + if (!template) { + var component = bucket.component; - function not(dependentKey) { - return _emberMetal.computed(dependentKey, function () { - return !_emberMetal.get(this, dependentKey); - }); - } + template = this.templateFor(component, env); + } + return env.getCompiledBlock(CurlyComponentLayoutCompiler, template); + }; - /** - A computed property that converts the provided dependent property - into a boolean value. - - ```javascript - let Hamster = Ember.Object.extend({ - hasBananas: Ember.computed.bool('numBananas') - }); - - let hamster = Hamster.create(); - - hamster.get('hasBananas'); // false - hamster.set('numBananas', 0); - hamster.get('hasBananas'); // false - hamster.set('numBananas', 1); - hamster.get('hasBananas'); // true - hamster.set('numBananas', null); - hamster.get('hasBananas'); // false - ``` - - @method bool - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which converts - to boolean the original value for property - @public - */ + CurlyComponentManager.prototype.templateFor = function templateFor(component, env) { + var Template = _emberMetal.get(component, 'layout'); + var owner = component[_emberUtils.OWNER]; + if (Template) { + return env.getTemplate(Template, owner); + } + var layoutName = _emberMetal.get(component, 'layoutName'); + if (layoutName) { + var template = owner.lookup('template:' + layoutName); + if (template) { + return template; + } + } + return owner.lookup(DEFAULT_LAYOUT); + }; - function bool(dependentKey) { - return _emberMetal.computed(dependentKey, function () { - return !!_emberMetal.get(this, dependentKey); - }); - } + CurlyComponentManager.prototype.getSelf = function getSelf(_ref) { + var component = _ref.component; - /** - A computed property which matches the original value for the - dependent property against a given RegExp, returning `true` - if the value matches the RegExp and `false` if it does not. - - Example - - ```javascript - let User = Ember.Object.extend({ - hasValidEmail: Ember.computed.match('email', /^.+@.+\..+$/) - }); - - let user = User.create({loggedIn: false}); - - user.get('hasValidEmail'); // false - user.set('email', ''); - user.get('hasValidEmail'); // false - user.set('email', 'ember_hamster@example.com'); - user.get('hasValidEmail'); // true - ``` - - @method match - @for Ember.computed - @param {String} dependentKey - @param {RegExp} regexp - @return {Ember.ComputedProperty} computed property which match - the original value for property against a given RegExp - @public - */ + return component[_emberGlimmerComponent.ROOT_REF]; + }; - function match(dependentKey, regexp) { - return _emberMetal.computed(dependentKey, function () { - var value = _emberMetal.get(this, dependentKey); + CurlyComponentManager.prototype.didCreateElement = function didCreateElement(_ref2, element, operations) { + var component = _ref2.component; + var classRef = _ref2.classRef; + var environment = _ref2.environment; - return typeof value === 'string' ? regexp.test(value) : false; - }); - } + _emberViews.setViewElement(component, element); - /** - A computed property that returns true if the provided dependent property - is equal to the given value. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - napTime: Ember.computed.equal('state', 'sleepy') - }); - - let hamster = Hamster.create(); - - hamster.get('napTime'); // false - hamster.set('state', 'sleepy'); - hamster.get('napTime'); // true - hamster.set('state', 'hungry'); - hamster.get('napTime'); // false - ``` - - @method equal - @for Ember.computed - @param {String} dependentKey - @param {String|Number|Object} value - @return {Ember.ComputedProperty} computed property which returns true if - the original value for property is equal to the given value. - @public - */ + var attributeBindings = component.attributeBindings; + var classNames = component.classNames; + var classNameBindings = component.classNameBindings; - function equal(dependentKey, value) { - return _emberMetal.computed(dependentKey, function () { - return _emberMetal.get(this, dependentKey) === value; - }); - } + if (attributeBindings && attributeBindings.length) { + applyAttributeBindings(element, attributeBindings, component, operations); + } else { + operations.addStaticAttribute(element, 'id', component.elementId); + _emberGlimmerUtilsBindings.IsVisibleBinding.install(element, component, operations); + } - /** - A computed property that returns true if the provided dependent property - is greater than the provided value. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - hasTooManyBananas: Ember.computed.gt('numBananas', 10) - }); - - let hamster = Hamster.create(); - - hamster.get('hasTooManyBananas'); // false - hamster.set('numBananas', 3); - hamster.get('hasTooManyBananas'); // false - hamster.set('numBananas', 11); - hamster.get('hasTooManyBananas'); // true - ``` - - @method gt - @for Ember.computed - @param {String} dependentKey - @param {Number} value - @return {Ember.ComputedProperty} computed property which returns true if - the original value for property is greater than given value. - @public - */ + if (classRef) { + operations.addDynamicAttribute(element, 'class', classRef); + } - function gt(dependentKey, value) { - return _emberMetal.computed(dependentKey, function () { - return _emberMetal.get(this, dependentKey) > value; - }); - } + if (classNames && classNames.length) { + classNames.forEach(function (name) { + operations.addStaticAttribute(element, 'class', name); + }); + } - /** - A computed property that returns true if the provided dependent property - is greater than or equal to the provided value. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - hasTooManyBananas: Ember.computed.gte('numBananas', 10) - }); - - let hamster = Hamster.create(); - - hamster.get('hasTooManyBananas'); // false - hamster.set('numBananas', 3); - hamster.get('hasTooManyBananas'); // false - hamster.set('numBananas', 10); - hamster.get('hasTooManyBananas'); // true - ``` - - @method gte - @for Ember.computed - @param {String} dependentKey - @param {Number} value - @return {Ember.ComputedProperty} computed property which returns true if - the original value for property is greater or equal then given value. - @public - */ + if (classNameBindings && classNameBindings.length) { + classNameBindings.forEach(function (binding) { + _emberGlimmerUtilsBindings.ClassNameBinding.install(element, component, binding, operations); + }); + } - function gte(dependentKey, value) { - return _emberMetal.computed(dependentKey, function () { - return _emberMetal.get(this, dependentKey) >= value; - }); - } + component._transitionTo('hasElement'); - /** - A computed property that returns true if the provided dependent property - is less than the provided value. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - needsMoreBananas: Ember.computed.lt('numBananas', 3) - }); - - let hamster = Hamster.create(); - - hamster.get('needsMoreBananas'); // true - hamster.set('numBananas', 3); - hamster.get('needsMoreBananas'); // false - hamster.set('numBananas', 2); - hamster.get('needsMoreBananas'); // true - ``` - - @method lt - @for Ember.computed - @param {String} dependentKey - @param {Number} value - @return {Ember.ComputedProperty} computed property which returns true if - the original value for property is less then given value. - @public - */ + if (environment.isInteractive) { + component.trigger('willInsertElement'); + } + }; - function lt(dependentKey, value) { - return _emberMetal.computed(dependentKey, function () { - return _emberMetal.get(this, dependentKey) < value; - }); - } + CurlyComponentManager.prototype.didRenderLayout = function didRenderLayout(bucket, bounds) { + var _this2 = this; - /** - A computed property that returns true if the provided dependent property - is less than or equal to the provided value. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - needsMoreBananas: Ember.computed.lte('numBananas', 3) - }); - - let hamster = Hamster.create(); - - hamster.get('needsMoreBananas'); // true - hamster.set('numBananas', 5); - hamster.get('needsMoreBananas'); // false - hamster.set('numBananas', 3); - hamster.get('needsMoreBananas'); // true - ``` - - @method lte - @for Ember.computed - @param {String} dependentKey - @param {Number} value - @return {Ember.ComputedProperty} computed property which returns true if - the original value for property is less or equal than given value. - @public - */ + bucket.component[_emberGlimmerComponent.BOUNDS] = bounds; + bucket.finalize(); - function lte(dependentKey, value) { - return _emberMetal.computed(dependentKey, function () { - return _emberMetal.get(this, dependentKey) <= value; - }); - } + _emberMetal.runInDebug(function () { + return _this2.debugStack.pop(); + }); + }; - /** - A computed property that performs a logical `and` on the - original values for the provided dependent properties. - - You may pass in more than two properties and even use - property brace expansion. The computed property will - return the first falsy value or last truthy value - just like JavaScript's `&&` operator. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - readyForCamp: Ember.computed.and('hasTent', 'hasBackpack'), - readyForHike: Ember.computed.and('hasWalkingStick', 'hasBackpack') - }); - - let tomster = Hamster.create(); - - tomster.get('readyForCamp'); // false - tomster.set('hasTent', true); - tomster.get('readyForCamp'); // false - tomster.set('hasBackpack', true); - tomster.get('readyForCamp'); // true - tomster.set('hasBackpack', 'Yes'); - tomster.get('readyForCamp'); // 'Yes' - tomster.set('hasWalkingStick', null); - tomster.get('readyForHike'); // null - ``` - - @method and - @for Ember.computed - @param {String} dependentKey* - @return {Ember.ComputedProperty} computed property which performs - a logical `and` on the values of all the original values for properties. - @public - */ - var and = generateComputedWithPredicate('and', function (value) { - return value; - }); + CurlyComponentManager.prototype.getTag = function getTag(_ref3) { + var component = _ref3.component; - exports.and = and; - /** - A computed property which performs a logical `or` on the - original values for the provided dependent properties. - - You may pass in more than two properties and even use - property brace expansion. The computed property will - return the first truthy value or last falsy value just - like JavaScript's `||` operator. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - readyForRain: Ember.computed.or('hasJacket', 'hasUmbrella'), - readyForBeach: Ember.computed.or('{hasSunscreen,hasUmbrella}') - }); - - let tomster = Hamster.create(); - - tomster.get('readyForRain'); // undefined - tomster.set('hasUmbrella', true); - tomster.get('readyForRain'); // true - tomster.set('hasJacket', 'Yes'); - tomster.get('readyForRain'); // 'Yes' - tomster.set('hasSunscreen', 'Check'); - tomster.get('readyForBeach'); // 'Check' - ``` - - @method or - @for Ember.computed - @param {String} dependentKey* - @return {Ember.ComputedProperty} computed property which performs - a logical `or` on the values of all the original values for properties. - @public - */ - var or = generateComputedWithPredicate('or', function (value) { - return !value; - }); + return component[_emberGlimmerComponent.DIRTY_TAG]; + }; - exports.or = or; - /** - Creates a new property that is an alias for another property - on an object. Calls to `get` or `set` this property behave as - though they were called on the original property. - - ```javascript - let Person = Ember.Object.extend({ - name: 'Alex Matchneer', - nomen: Ember.computed.alias('name') - }); - - let alex = Person.create(); - - alex.get('nomen'); // 'Alex Matchneer' - alex.get('name'); // 'Alex Matchneer' - - alex.set('nomen', '@machty'); - alex.get('name'); // '@machty' - ``` - - @method alias - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which creates an - alias to the original value for property. - @public - */ + CurlyComponentManager.prototype.didCreate = function didCreate(_ref4) { + var component = _ref4.component; + var environment = _ref4.environment; - /** - Where `computed.alias` aliases `get` and `set`, and allows for bidirectional - data flow, `computed.oneWay` only provides an aliased `get`. The `set` will - not mutate the upstream property, rather causes the current property to - become the value set. This causes the downstream property to permanently - diverge from the upstream property. - - Example - - ```javascript - let User = Ember.Object.extend({ - firstName: null, - lastName: null, - nickName: Ember.computed.oneWay('firstName') - }); - - let teddy = User.create({ - firstName: 'Teddy', - lastName: 'Zeenny' - }); - - teddy.get('nickName'); // 'Teddy' - teddy.set('nickName', 'TeddyBear'); // 'TeddyBear' - teddy.get('firstName'); // 'Teddy' - ``` - - @method oneWay - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which creates a - one way computed property to the original value for property. - @public - */ + if (environment.isInteractive) { + component._transitionTo('inDOM'); + component.trigger('didInsertElement'); + component.trigger('didRender'); + } + }; - function oneWay(dependentKey) { - return _emberMetal.alias(dependentKey).oneWay(); - } + CurlyComponentManager.prototype.update = function update(bucket, _, dynamicScope) { + var _this3 = this; - /** - This is a more semantically meaningful alias of `computed.oneWay`, - whose name is somewhat ambiguous as to which direction the data flows. - - @method reads - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which creates a - one way computed property to the original value for property. - @public - */ + var component = bucket.component; + var args = bucket.args; + var argsRevision = bucket.argsRevision; + var environment = bucket.environment; - /** - Where `computed.oneWay` provides oneWay bindings, `computed.readOnly` provides - a readOnly one way binding. Very often when using `computed.oneWay` one does - not also want changes to propagate back up, as they will replace the value. - - This prevents the reverse flow, and also throws an exception when it occurs. - - Example - - ```javascript - let User = Ember.Object.extend({ - firstName: null, - lastName: null, - nickName: Ember.computed.readOnly('firstName') - }); - - let teddy = User.create({ - firstName: 'Teddy', - lastName: 'Zeenny' - }); - - teddy.get('nickName'); // 'Teddy' - teddy.set('nickName', 'TeddyBear'); // throws Exception - // throw new Ember.Error('Cannot Set: nickName on: ' );` - teddy.get('firstName'); // 'Teddy' - ``` - - @method readOnly - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which creates a - one way computed property to the original value for property. - @since 1.5.0 - @public - */ + _emberMetal.runInDebug(function () { + return _this3._pushToDebugStack(component._debugContainerKey, environment); + }); - function readOnly(dependentKey) { - return _emberMetal.alias(dependentKey).readOnly(); - } + bucket.finalizer = _emberMetal._instrumentStart('render.component', rerenderInstrumentDetails, component); - /** - Creates a new property that is an alias for another property - on an object. Calls to `get` or `set` this property behave as - though they were called on the original property, but also - print a deprecation warning. - - ```javascript - let Hamster = Ember.Object.extend({ - bananaCount: Ember.computed.deprecatingAlias('cavendishCount', { - id: 'hamster.deprecate-banana', - until: '3.0.0' - }) - }); - - let hamster = Hamster.create(); - - hamster.set('bananaCount', 5); // Prints a deprecation warning. - hamster.get('cavendishCount'); // 5 - ``` - - @method deprecatingAlias - @for Ember.computed - @param {String} dependentKey - @param {Object} options Options for `Ember.deprecate`. - @return {Ember.ComputedProperty} computed property which creates an - alias with a deprecation to the original value for property. - @since 1.7.0 - @public - */ + if (!args.tag.validate(argsRevision)) { + var _args$value = args.value(); - function deprecatingAlias(dependentKey, options) { - return _emberMetal.computed(dependentKey, { - get: function (key) { - _emberMetal.deprecate('Usage of `' + key + '` is deprecated, use `' + dependentKey + '` instead.', false, options); - return _emberMetal.get(this, dependentKey); - }, - set: function (key, value) { - _emberMetal.deprecate('Usage of `' + key + '` is deprecated, use `' + dependentKey + '` instead.', false, options); - _emberMetal.set(this, dependentKey, value); - return value; - } - }); - } -}); -enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/compare', 'ember-runtime/utils', 'ember-runtime/system/native_array'], function (exports, _emberUtils, _emberMetal, _emberRuntimeCompare, _emberRuntimeUtils, _emberRuntimeSystemNative_array) { - /** - @module ember - @submodule ember-runtime - */ + var attrs = _args$value.attrs; + var props = _args$value.props; - 'use strict'; + bucket.argsRevision = args.tag.value(); - exports.sum = sum; - exports.max = max; - exports.min = min; - exports.map = map; - exports.mapBy = mapBy; - exports.filter = filter; - exports.filterBy = filterBy; - exports.uniq = uniq; - exports.uniqBy = uniqBy; - exports.intersect = intersect; - exports.setDiff = setDiff; - exports.collect = collect; - exports.sort = sort; + var oldAttrs = component.attrs; + var newAttrs = attrs; - function reduceMacro(dependentKey, callback, initialValue) { - return _emberMetal.computed(dependentKey + '.[]', function () { - var _this = this; + component[_emberGlimmerComponent.IS_DISPATCHING_ATTRS] = true; + component.setProperties(props); + component[_emberGlimmerComponent.IS_DISPATCHING_ATTRS] = false; - var arr = _emberMetal.get(this, dependentKey); + _emberViews.dispatchLifeCycleHook(component, 'didUpdateAttrs', oldAttrs, newAttrs); + _emberViews.dispatchLifeCycleHook(component, 'didReceiveAttrs', oldAttrs, newAttrs); + } - if (arr === null || typeof arr !== 'object') { - return initialValue; + if (environment.isInteractive) { + component.trigger('willUpdate'); + component.trigger('willRender'); } + }; - return arr.reduce(function (previousValue, currentValue, index, array) { - return callback.call(_this, previousValue, currentValue, index, array); - }, initialValue); - }).readOnly(); - } + CurlyComponentManager.prototype.didUpdateLayout = function didUpdateLayout(bucket) { + var _this4 = this; - function arrayMacro(dependentKey, callback) { - // This is a bit ugly - var propertyName = undefined; - if (/@each/.test(dependentKey)) { - propertyName = dependentKey.replace(/\.@each.*$/, ''); - } else { - propertyName = dependentKey; - dependentKey += '.[]'; - } + bucket.finalize(); - return _emberMetal.computed(dependentKey, function () { - var value = _emberMetal.get(this, propertyName); - if (_emberRuntimeUtils.isArray(value)) { - return _emberRuntimeSystemNative_array.A(callback.call(this, value)); - } else { - return _emberRuntimeSystemNative_array.A(); + _emberMetal.runInDebug(function () { + return _this4.debugStack.pop(); + }); + }; + + CurlyComponentManager.prototype.didUpdate = function didUpdate(_ref5) { + var component = _ref5.component; + var environment = _ref5.environment; + + if (environment.isInteractive) { + component.trigger('didUpdate'); + component.trigger('didRender'); } - }).readOnly(); - } + }; - function multiArrayMacro(dependentKeys, callback) { - var args = dependentKeys.map(function (key) { - return key + '.[]'; - }); + CurlyComponentManager.prototype.getDestructor = function getDestructor(stateBucket) { + return stateBucket; + }; - args.push(function () { - return _emberRuntimeSystemNative_array.A(callback.call(this, dependentKeys)); - }); + return CurlyComponentManager; + })(_emberGlimmerSyntaxAbstractManager.default); - return _emberMetal.computed.apply(this, args).readOnly(); - } + var MANAGER = new CurlyComponentManager(); - /** - A computed property that returns the sum of the values - in the dependent array. - - @method sum - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computes the sum of all values in the dependentKey's array - @since 1.4.0 - @public - */ + var TopComponentManager = (function (_CurlyComponentManager) { +babelHelpers.inherits(TopComponentManager, _CurlyComponentManager); - function sum(dependentKey) { - return reduceMacro(dependentKey, function (sum, item) { - return sum + item; - }, 0); - } + function TopComponentManager() { +babelHelpers.classCallCheck(this, TopComponentManager); - /** - A computed property that calculates the maximum value in the - dependent array. This will return `-Infinity` when the dependent - array is empty. - - ```javascript - let Person = Ember.Object.extend({ - childAges: Ember.computed.mapBy('children', 'age'), - maxChildAge: Ember.computed.max('childAges') - }); - - let lordByron = Person.create({ children: [] }); - - lordByron.get('maxChildAge'); // -Infinity - lordByron.get('children').pushObject({ - name: 'Augusta Ada Byron', age: 7 - }); - lordByron.get('maxChildAge'); // 7 - lordByron.get('children').pushObjects([{ - name: 'Allegra Byron', - age: 5 - }, { - name: 'Elizabeth Medora Leigh', - age: 8 - }]); - lordByron.get('maxChildAge'); // 8 - ``` - - If the types of the arguments are not numbers, - they will be converted to numbers and the type - of the return value will always be `Number`. - For example, the max of a list of Date objects will be - the highest timestamp as a `Number`. - This behavior is consistent with `Math.max`. - - @method max - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computes the largest value in the dependentKey's array - @public - */ + _CurlyComponentManager.apply(this, arguments); + } - function max(dependentKey) { - return reduceMacro(dependentKey, function (max, item) { - return Math.max(max, item); - }, -Infinity); - } + TopComponentManager.prototype.create = function create(environment, definition, args, dynamicScope, currentScope, hasBlock) { + var _this5 = this; - /** - A computed property that calculates the minimum value in the - dependent array. This will return `Infinity` when the dependent - array is empty. - - ```javascript - let Person = Ember.Object.extend({ - childAges: Ember.computed.mapBy('children', 'age'), - minChildAge: Ember.computed.min('childAges') - }); - - let lordByron = Person.create({ children: [] }); - - lordByron.get('minChildAge'); // Infinity - lordByron.get('children').pushObject({ - name: 'Augusta Ada Byron', age: 7 - }); - lordByron.get('minChildAge'); // 7 - lordByron.get('children').pushObjects([{ - name: 'Allegra Byron', - age: 5 - }, { - name: 'Elizabeth Medora Leigh', - age: 8 - }]); - lordByron.get('minChildAge'); // 5 - ``` - - If the types of the arguments are not numbers, - they will be converted to numbers and the type - of the return value will always be `Number`. - For example, the min of a list of Date objects will be - the lowest timestamp as a `Number`. - This behavior is consistent with `Math.min`. - - @method min - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computes the smallest value in the dependentKey's array - @public - */ + var component = definition.ComponentClass.create(); - function min(dependentKey) { - return reduceMacro(dependentKey, function (min, item) { - return Math.min(min, item); - }, Infinity); - } + _emberMetal.runInDebug(function () { + return _this5._pushToDebugStack(component._debugContainerKey, environment); + }); - /** - Returns an array mapped via the callback - - The callback method you provide should have the following signature. - `item` is the current item in the iteration. - `index` is the integer index of the current item in the iteration. - - ```javascript - function(item, index); - ``` - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - excitingChores: Ember.computed.map('chores', function(chore, index) { - return chore.toUpperCase() + '!'; - }) - }); - - let hamster = Hamster.create({ - chores: ['clean', 'write more unit tests'] - }); - - hamster.get('excitingChores'); // ['CLEAN!', 'WRITE MORE UNIT TESTS!'] - ``` - - @method map - @for Ember.computed - @param {String} dependentKey - @param {Function} callback - @return {Ember.ComputedProperty} an array mapped via the callback - @public - */ + var finalizer = _emberMetal._instrumentStart('render.component', initialRenderInstrumentDetails, component); - function map(dependentKey, callback) { - return arrayMacro(dependentKey, function (value) { - return value.map(callback, this); - }); - } + dynamicScope.view = component; - /** - Returns an array mapped to the specified key. - - ```javascript - let Person = Ember.Object.extend({ - childAges: Ember.computed.mapBy('children', 'age') - }); - - let lordByron = Person.create({ children: [] }); - - lordByron.get('childAges'); // [] - lordByron.get('children').pushObject({ name: 'Augusta Ada Byron', age: 7 }); - lordByron.get('childAges'); // [7] - lordByron.get('children').pushObjects([{ - name: 'Allegra Byron', - age: 5 - }, { - name: 'Elizabeth Medora Leigh', - age: 8 - }]); - lordByron.get('childAges'); // [7, 5, 8] - ``` - - @method mapBy - @for Ember.computed - @param {String} dependentKey - @param {String} propertyKey - @return {Ember.ComputedProperty} an array mapped to the specified key - @public - */ + // We usually do this in the `didCreateElement`, but that hook doesn't fire for tagless components + if (component.tagName === '') { + if (environment.isInteractive) { + component.trigger('willRender'); + } - function mapBy(dependentKey, propertyKey) { - _emberMetal.assert('Ember.computed.mapBy expects a property string for its second argument, ' + 'perhaps you meant to use "map"', typeof propertyKey === 'string'); + component._transitionTo('hasElement'); - return map(dependentKey + '.@each.' + propertyKey, function (item) { - return _emberMetal.get(item, propertyKey); - }); - } + if (environment.isInteractive) { + component.trigger('willInsertElement'); + } + } - /** - Filters the array by the callback. - - The callback method you provide should have the following signature. - `item` is the current item in the iteration. - `index` is the integer index of the current item in the iteration. - `array` is the dependant array itself. - - ```javascript - function(item, index, array); - ``` - - ```javascript - let Hamster = Ember.Object.extend({ - remainingChores: Ember.computed.filter('chores', function(chore, index, array) { - return !chore.done; - }) - }); - - let hamster = Hamster.create({ - chores: [ - { name: 'cook', done: true }, - { name: 'clean', done: true }, - { name: 'write more unit tests', done: false } - ] - }); - - hamster.get('remainingChores'); // [{name: 'write more unit tests', done: false}] - ``` - - @method filter - @for Ember.computed - @param {String} dependentKey - @param {Function} callback - @return {Ember.ComputedProperty} the filtered array - @public - */ + processComponentInitializationAssertions(component, {}); - function filter(dependentKey, callback) { - return arrayMacro(dependentKey, function (value) { - return value.filter(callback, this); - }); - } + return new ComponentStateBucket(environment, component, args, finalizer); + }; - /** - Filters the array by the property and value - - ```javascript - let Hamster = Ember.Object.extend({ - remainingChores: Ember.computed.filterBy('chores', 'done', false) - }); - - let hamster = Hamster.create({ - chores: [ - { name: 'cook', done: true }, - { name: 'clean', done: true }, - { name: 'write more unit tests', done: false } - ] - }); - - hamster.get('remainingChores'); // [{ name: 'write more unit tests', done: false }] - ``` - - @method filterBy - @for Ember.computed - @param {String} dependentKey - @param {String} propertyKey - @param {*} value - @return {Ember.ComputedProperty} the filtered array - @public - */ + return TopComponentManager; + })(CurlyComponentManager); - function filterBy(dependentKey, propertyKey, value) { - var callback = undefined; + var ROOT_MANAGER = new TopComponentManager(); - if (arguments.length === 2) { - callback = function (item) { - return _emberMetal.get(item, propertyKey); - }; - } else { - callback = function (item) { - return _emberMetal.get(item, propertyKey) === value; - }; - } + function tagName(vm) { + var tagName = vm.dynamicScope().view.tagName; - return filter(dependentKey + '.@each.' + propertyKey, callback); + return _glimmerRuntime.PrimitiveReference.create(tagName === '' ? null : tagName || 'div'); } - /** - A computed property which returns a new array with all the unique - elements from one or more dependent arrays. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - uniqueFruits: Ember.computed.uniq('fruits') - }); - - let hamster = Hamster.create({ - fruits: [ - 'banana', - 'grape', - 'kale', - 'banana' - ] - }); - - hamster.get('uniqueFruits'); // ['banana', 'grape', 'kale'] - ``` - - @method uniq - @for Ember.computed - @param {String} propertyKey* - @return {Ember.ComputedProperty} computes a new array with all the - unique elements from the dependent array - @public - */ + function ariaRole(vm) { + return vm.getSelf().get('ariaRole'); + } - function uniq() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; + var CurlyComponentDefinition = (function (_ComponentDefinition) { +babelHelpers.inherits(CurlyComponentDefinition, _ComponentDefinition); + + function CurlyComponentDefinition(name, ComponentClass, template, args) { +babelHelpers.classCallCheck(this, CurlyComponentDefinition); + + _ComponentDefinition.call(this, name, MANAGER, ComponentClass); + this.template = template; + this.args = args; } - return multiArrayMacro(args, function (dependentKeys) { - var _this2 = this; + return CurlyComponentDefinition; + })(_glimmerRuntime.ComponentDefinition); - var uniq = _emberRuntimeSystemNative_array.A(); + exports.CurlyComponentDefinition = CurlyComponentDefinition; - dependentKeys.forEach(function (dependentKey) { - var value = _emberMetal.get(_this2, dependentKey); - if (_emberRuntimeUtils.isArray(value)) { - value.forEach(function (item) { - if (uniq.indexOf(item) === -1) { - uniq.push(item); - } - }); + var RootComponentDefinition = (function (_ComponentDefinition2) { +babelHelpers.inherits(RootComponentDefinition, _ComponentDefinition2); + + function RootComponentDefinition(instance) { +babelHelpers.classCallCheck(this, RootComponentDefinition); + + _ComponentDefinition2.call(this, '-root', ROOT_MANAGER, { + class: instance.constructor, + create: function () { + return instance; } }); + this.template = undefined; + this.args = undefined; + } - return uniq; - }); + return RootComponentDefinition; + })(_glimmerRuntime.ComponentDefinition); + + exports.RootComponentDefinition = RootComponentDefinition; + + var CurlyComponentLayoutCompiler = (function () { + function CurlyComponentLayoutCompiler(template) { +babelHelpers.classCallCheck(this, CurlyComponentLayoutCompiler); + + this.template = template; + } + + CurlyComponentLayoutCompiler.prototype.compile = function compile(builder) { + builder.wrapLayout(this.template.asLayout()); + builder.tag.dynamic(tagName); + builder.attrs.dynamic('role', ariaRole); + builder.attrs.static('class', 'ember-view'); + }; + + return CurlyComponentLayoutCompiler; + })(); + + CurlyComponentLayoutCompiler.id = 'curly'; +}); +enifed('ember-glimmer/syntax/dynamic-component', ['exports', '@glimmer/runtime', '@glimmer/reference', 'ember-metal'], function (exports, _glimmerRuntime, _glimmerReference, _emberMetal) { + 'use strict'; + + exports.closureComponentMacro = closureComponentMacro; + exports.dynamicComponentMacro = dynamicComponentMacro; + exports.blockComponentMacro = blockComponentMacro; + exports.inlineComponentMacro = inlineComponentMacro; + + function dynamicComponentFor(vm, symbolTable) { + var env = vm.env; + var args = vm.getArgs(); + var nameRef = args.positional.at(0); + + return new DynamicComponentReference({ nameRef: nameRef, env: env, symbolTable: symbolTable }); } - /** - A computed property which returns a new array with all the unique - elements from an array, with uniqueness determined by specific key. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - uniqueFruits: Ember.computed.uniqBy('fruits', 'id') - }); - let hamster = Hamster.create({ - fruits: [ - { id: 1, 'banana' }, - { id: 2, 'grape' }, - { id: 3, 'peach' }, - { id: 1, 'banana' } - ] - }); - hamster.get('uniqueFruits'); // [ { id: 1, 'banana' }, { id: 2, 'grape' }, { id: 3, 'peach' }] - ``` - - @method uniqBy - @for Ember.computed - @param {String} dependentKey - @param {String} propertyKey - @return {Ember.ComputedProperty} computes a new array with all the - unique elements from the dependent array - @public - */ + function closureComponentMacro(path, params, hash, _default, inverse, builder) { + var definitionArgs = [[['get', path]], hash, _default, inverse]; + var args = [params, hash, _default, inverse]; + builder.component.dynamic(definitionArgs, dynamicComponentFor, args, builder.symbolTable); + return true; + } - function uniqBy(dependentKey, propertyKey) { - return _emberMetal.computed(dependentKey + '.[]', function () { - var uniq = _emberRuntimeSystemNative_array.A(); - var seen = new _emberUtils.EmptyObject(); - var list = _emberMetal.get(this, dependentKey); - if (_emberRuntimeUtils.isArray(list)) { - list.forEach(function (item) { - var guid = _emberUtils.guidFor(_emberMetal.get(item, propertyKey)); - if (!(guid in seen)) { - seen[guid] = true; - uniq.push(item); - } - }); - } - return uniq; - }).readOnly(); + function dynamicComponentMacro(params, hash, _default, inverse, builder) { + var definitionArgs = [params.slice(0, 1), null, null, null]; + var args = [params.slice(1), hash, null, null]; + builder.component.dynamic(definitionArgs, dynamicComponentFor, args, builder.symbolTable); + return true; } - /** - Alias for [Ember.computed.uniq](/api/#method_computed_uniq). - - @method union - @for Ember.computed - @param {String} propertyKey* - @return {Ember.ComputedProperty} computes a new array with all the - unique elements from the dependent array - @public - */ - var union = uniq; + function blockComponentMacro(sexp, builder) { + var params = sexp[2]; + var hash = sexp[3]; + var _default = sexp[4]; + var inverse = sexp[5]; - exports.union = union; - /** - A computed property which returns a new array with all the duplicated - elements from two or more dependent arrays. - - Example - - ```javascript - let obj = Ember.Object.extend({ - friendsInCommon: Ember.computed.intersect('adaFriends', 'charlesFriends') - }).create({ - adaFriends: ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'], - charlesFriends: ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock'] - }); - - obj.get('friendsInCommon'); // ['William King', 'Mary Somerville'] - ``` - - @method intersect - @for Ember.computed - @param {String} propertyKey* - @return {Ember.ComputedProperty} computes a new array with all the - duplicated elements from the dependent arrays - @public - */ + var definitionArgs = [params.slice(0, 1), null, null, null]; + var args = [params.slice(1), hash, _default, inverse]; + builder.component.dynamic(definitionArgs, dynamicComponentFor, args, builder.symbolTable); + return true; + } - function intersect() { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; + function inlineComponentMacro(path, params, hash, builder) { + var definitionArgs = [params.slice(0, 1), null, null, null]; + var args = [params.slice(1), hash, null, null]; + builder.component.dynamic(definitionArgs, dynamicComponentFor, args, builder.symbolTable); + return true; + } + + var DynamicComponentReference = (function () { + function DynamicComponentReference(_ref) { + var nameRef = _ref.nameRef; + var env = _ref.env; + var symbolTable = _ref.symbolTable; + var args = _ref.args; + babelHelpers.classCallCheck(this, DynamicComponentReference); + + this.tag = nameRef.tag; + this.nameRef = nameRef; + this.env = env; + this.symbolTable = symbolTable; + this.args = args; } - return multiArrayMacro(args, function (dependentKeys) { - var _this3 = this; + DynamicComponentReference.prototype.value = function value() { + var env = this.env; + var nameRef = this.nameRef; + var symbolTable = this.symbolTable; - var arrays = dependentKeys.map(function (dependentKey) { - var array = _emberMetal.get(_this3, dependentKey); + var nameOrDef = nameRef.value(); - return _emberRuntimeUtils.isArray(array) ? array : []; - }); + if (typeof nameOrDef === 'string') { + var definition = env.getComponentDefinition([nameOrDef], symbolTable); - var results = arrays.pop().filter(function (candidate) { - for (var i = 0; i < arrays.length; i++) { - var found = false; - var array = arrays[i]; - for (var j = 0; j < array.length; j++) { - if (array[j] === candidate) { - found = true; - break; - } - } + _emberMetal.assert('Could not find component named "' + nameOrDef + '" (no component or template with that name was found)', definition); - if (found === false) { - return false; - } - } + return definition; + } else if (_glimmerRuntime.isComponentDefinition(nameOrDef)) { + return nameOrDef; + } else { + return null; + } + }; - return true; - }); + DynamicComponentReference.prototype.get = function get() { + return _glimmerReference.UNDEFINED_REFERENCE; + }; - return _emberRuntimeSystemNative_array.A(results); - }); + return DynamicComponentReference; + })(); +}); +enifed('ember-glimmer/syntax/input', ['exports', 'ember-metal', 'ember-glimmer/utils/bindings', 'ember-glimmer/syntax/dynamic-component'], function (exports, _emberMetal, _emberGlimmerUtilsBindings, _emberGlimmerSyntaxDynamicComponent) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; + + exports.inputMacro = inputMacro; + + function buildTextFieldSyntax(params, hash, builder) { + var definition = builder.env.getComponentDefinition(['-text-field'], builder.symbolTable); + builder.component.static(definition, [params, hash, null, null], builder.symbolTable); + return true; } /** - A computed property which returns a new array with all the - properties from the first dependent array that are not in the second - dependent array. + The `{{input}}` helper lets you create an HTML `` component. + It causes an `Ember.TextField` component to be rendered. For more info, + see the [Ember.TextField](/api/classes/Ember.TextField.html) docs and + the [templates guide](http://emberjs.com/guides/templates/input-helpers/). + + ```handlebars + {{input value="987"}} + ``` + + renders as: + + ```HTML + + ``` + + ### Text field + + If no `type` option is specified, a default of type 'text' is used. + Many of the standard HTML attributes may be passed to this helper. + + + + + + + + + + + +
    `readonly``required``autofocus`
    `value``placeholder``disabled`
    `size``tabindex``maxlength`
    `name``min``max`
    `pattern``accept``autocomplete`
    `autosave``formaction``formenctype`
    `formmethod``formnovalidate``formtarget`
    `height``inputmode``multiple`
    `step``width``form`
    `selectionDirection``spellcheck` 
    + When set to a quoted string, these values will be directly applied to the HTML + element. When left unquoted, these values will be bound to a property on the + template's current rendering context (most typically a controller instance). + A very common use of this helper is to bind the `value` of an input to an Object's attribute: + + ```handlebars + Search: + {{input value=searchWord}} + ``` + + In this example, the inital value in the `` will be set to the value of `searchWord`. + If the user changes the text, the value of `searchWord` will also be updated. + + ### Actions + + The helper can send multiple actions based on user events. + The action property defines the action which is sent when + the user presses the return key. + + ```handlebars + {{input action="submit"}} + ``` + + The helper allows some user events to send actions. + + * `enter` + * `insert-newline` + * `escape-press` + * `focus-in` + * `focus-out` + * `key-press` + * `key-up` + + For example, if you desire an action to be sent when the input is blurred, + you only need to setup the action name to the event name property. + + ```handlebars + {{input focus-out="alertMessage"}} + ``` + See more about [Text Support Actions](/api/classes/Ember.TextField.html) - Example + ### Extending `Ember.TextField` + + Internally, `{{input type="text"}}` creates an instance of `Ember.TextField`, passing + arguments from the helper to `Ember.TextField`'s `create` method. You can extend the + capabilities of text inputs in your applications by reopening this class. For example, + if you are building a Bootstrap project where `data-*` attributes are used, you + can add one to the `TextField`'s `attributeBindings` property: ```javascript - let Hamster = Ember.Object.extend({ - likes: ['banana', 'grape', 'kale'], - wants: Ember.computed.setDiff('likes', 'fruits') + Ember.TextField.reopen({ + attributeBindings: ['data-error'] }); + ``` - let hamster = Hamster.create({ - fruits: [ - 'grape', - 'kale', - ] - }); + Keep in mind when writing `Ember.TextField` subclasses that `Ember.TextField` + itself extends `Ember.Component`. Expect isolated component semantics, not + legacy 1.x view semantics (like `controller` being present). + See more about [Ember components](/api/classes/Ember.Component.html) - hamster.get('wants'); // ['banana'] + ### Checkbox + + Checkboxes are special forms of the `{{input}}` helper. To create a ``: + + ```handlebars + Emberize Everything: + {{input type="checkbox" name="isEmberized" checked=isEmberized}} ``` - @method setDiff - @for Ember.computed - @param {String} setAProperty - @param {String} setBProperty - @return {Ember.ComputedProperty} computes a new array with all the - items from the first dependent array that are not in the second - dependent array - @public - */ - - function setDiff(setAProperty, setBProperty) { - if (arguments.length !== 2) { - throw new _emberMetal.Error('setDiff requires exactly two dependent arrays.'); - } - - return _emberMetal.computed(setAProperty + '.[]', setBProperty + '.[]', function () { - var setA = this.get(setAProperty); - var setB = this.get(setBProperty); - - if (!_emberRuntimeUtils.isArray(setA)) { - return _emberRuntimeSystemNative_array.A(); - } - if (!_emberRuntimeUtils.isArray(setB)) { - return _emberRuntimeSystemNative_array.A(setA); - } - - return setA.filter(function (x) { - return setB.indexOf(x) === -1; - }); - }).readOnly(); - } - - /** - A computed property that returns the array of values - for the provided dependent properties. + This will bind checked state of this checkbox to the value of `isEmberized` -- if either one changes, + it will be reflected in the other. - Example + The following HTML attributes can be set via the helper: - ```javascript - let Hamster = Ember.Object.extend({ - clothes: Ember.computed.collect('hat', 'shirt') - }); + * `checked` + * `disabled` + * `tabindex` + * `indeterminate` + * `name` + * `autofocus` + * `form` - let hamster = Hamster.create(); + ### Extending `Ember.Checkbox` - hamster.get('clothes'); // [null, null] - hamster.set('hat', 'Camp Hat'); - hamster.set('shirt', 'Camp Shirt'); - hamster.get('clothes'); // ['Camp Hat', 'Camp Shirt'] + Internally, `{{input type="checkbox"}}` creates an instance of `Ember.Checkbox`, passing + arguments from the helper to `Ember.Checkbox`'s `create` method. You can extend the + capablilties of checkbox inputs in your applications by reopening this class. For example, + if you wanted to add a css class to all checkboxes in your application: + + ```javascript + Ember.Checkbox.reopen({ + classNames: ['my-app-checkbox'] + }); ``` - @method collect - @for Ember.computed - @param {String} dependentKey* - @return {Ember.ComputedProperty} computed property which maps - values of all passed in properties to an array. + @method input + @for Ember.Templates.helpers + @param {Hash} options @public */ - function collect() { - for (var _len3 = arguments.length, dependentKeys = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - dependentKeys[_key3] = arguments[_key3]; + function inputMacro(path, params, hash, builder) { + var keys = undefined; + var values = undefined; + var typeIndex = -1; + var valueIndex = -1; + + if (hash) { + keys = hash[0]; + values = hash[1]; + typeIndex = keys.indexOf('type'); + valueIndex = keys.indexOf('value'); } - return multiArrayMacro(dependentKeys, function () { - var properties = _emberMetal.getProperties(this, dependentKeys); - var res = _emberRuntimeSystemNative_array.A(); - for (var key in properties) { - if (properties.hasOwnProperty(key)) { - if (_emberMetal.isNone(properties[key])) { - res.push(null); - } else { - res.push(properties[key]); - } + if (!params) { + params = []; + } + + if (typeIndex > -1) { + var typeArg = values[typeIndex]; + if (!Array.isArray(typeArg)) { + if (typeArg === 'checkbox') { + _emberMetal.assert('{{input type=\'checkbox\'}} does not support setting `value=someBooleanValue`; ' + 'you must use `checked=someBooleanValue` instead.', valueIndex === -1); + + _emberGlimmerUtilsBindings.wrapComponentClassAttribute(hash); + + var definition = builder.env.getComponentDefinition(['-checkbox'], builder.symbolTable); + builder.component.static(definition, [params, hash, null, null], builder.symbolTable); + return true; + } else { + return buildTextFieldSyntax(params, hash, builder); } } - return res; - }); + } else { + return buildTextFieldSyntax(params, hash, builder); + } + + return _emberGlimmerSyntaxDynamicComponent.dynamicComponentMacro(params, hash, null, null, builder); } +}); +enifed('ember-glimmer/syntax/mount', ['exports', '@glimmer/runtime', '@glimmer/reference', 'ember-metal', 'ember-glimmer/utils/references', 'ember-routing', 'ember-glimmer/syntax/outlet', 'container', 'ember-glimmer/syntax/abstract-manager'], function (exports, _glimmerRuntime, _glimmerReference, _emberMetal, _emberGlimmerUtilsReferences, _emberRouting, _emberGlimmerSyntaxOutlet, _container, _emberGlimmerSyntaxAbstractManager) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; + + exports.mountMacro = mountMacro; /** - A computed property which returns a new array with all the - properties from the first dependent array sorted based on a property - or sort function. + The `{{mount}}` helper lets you embed a routeless engine in a template. + Mounting an engine will cause an instance to be booted and its `application` + template to be rendered. - The callback method you provide should have the following signature: + For example, the following template mounts the `ember-chat` engine: - ```javascript - function(itemA, itemB); + ```handlebars + {{! application.hbs }} + {{mount "ember-chat"}} ``` - - `itemA` the first item to compare. - - `itemB` the second item to compare. - - This function should return negative number (e.g. `-1`) when `itemA` should come before - `itemB`. It should return positive number (e.g. `1`) when `itemA` should come after - `itemB`. If the `itemA` and `itemB` are equal this function should return `0`. - - Therefore, if this function is comparing some numeric values, simple `itemA - itemB` or - `itemA.get( 'foo' ) - itemB.get( 'foo' )` can be used instead of series of `if`. - - Example - - ```javascript - let ToDoList = Ember.Object.extend({ - // using standard ascending sort - todosSorting: ['name'], - sortedTodos: Ember.computed.sort('todos', 'todosSorting'), - - // using descending sort - todosSortingDesc: ['name:desc'], - sortedTodosDesc: Ember.computed.sort('todos', 'todosSortingDesc'), - - // using a custom sort function - priorityTodos: Ember.computed.sort('todos', function(a, b){ - if (a.priority > b.priority) { - return 1; - } else if (a.priority < b.priority) { - return -1; - } - - return 0; - }) - }); - - let todoList = ToDoList.create({todos: [ - { name: 'Unit Test', priority: 2 }, - { name: 'Documentation', priority: 3 }, - { name: 'Release', priority: 1 } - ]}); - - todoList.get('sortedTodos'); // [{ name:'Documentation', priority:3 }, { name:'Release', priority:1 }, { name:'Unit Test', priority:2 }] - todoList.get('sortedTodosDesc'); // [{ name:'Unit Test', priority:2 }, { name:'Release', priority:1 }, { name:'Documentation', priority:3 }] - todoList.get('priorityTodos'); // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }] - ``` + Currently, the engine name is the only argument that can be passed to + `{{mount}}`. - @method sort - @for Ember.computed - @param {String} itemsKey - @param {String or Function} sortDefinition a dependent key to an - array of sort properties (add `:desc` to the arrays sort properties to sort descending) or a function to use when sorting - @return {Ember.ComputedProperty} computes a new sorted array based - on the sort property array or callback function + @method mount + @for Ember.Templates.helpers + @category ember-application-engines @public */ - function sort(itemsKey, sortDefinition) { - _emberMetal.assert('Ember.computed.sort requires two arguments: an array key to sort and ' + 'either a sort properties key or sort function', arguments.length === 2); + function mountMacro(path, params, hash, builder) { + _emberMetal.assert('You can only pass a single argument to the {{mount}} helper, e.g. {{mount "chat-engine"}}.', params.length === 1 && hash === null); - if (typeof sortDefinition === 'function') { - return customSort(itemsKey, sortDefinition); - } else { - return propertySort(itemsKey, sortDefinition); - } + var name = params[0]; + + _emberMetal.assert('The first argument of {{mount}} must be quoted, e.g. {{mount "chat-engine"}}.', typeof name === 'string'); + + _emberMetal.assert('You used `{{mount \'' + name + '\'}}`, but the engine \'' + name + '\' can not be found.', builder.env.owner.hasRegistration('engine:' + name)); + + builder.component.static(new MountDefinition(name, builder.env), [params, hash, null, null], builder.symbolTable); + return true; } - function customSort(itemsKey, comparator) { - return arrayMacro(itemsKey, function (value) { - var _this4 = this; + var MountManager = (function (_AbstractManager) { + babelHelpers.inherits(MountManager, _AbstractManager); - return value.slice().sort(function (x, y) { - return comparator.call(_this4, x, y); + function MountManager() { + babelHelpers.classCallCheck(this, MountManager); + + _AbstractManager.apply(this, arguments); + } + + MountManager.prototype.prepareArgs = function prepareArgs(definition, args) { + return args; + }; + + MountManager.prototype.create = function create(environment, _ref, args, dynamicScope) { + var name = _ref.name; + var env = _ref.env; + + var _this = this; + + _emberMetal.runInDebug(function () { + return _this._pushEngineToDebugStack('engine:' + name, env); }); - }); - } - // This one needs to dynamically set up and tear down observers on the itemsKey - // depending on the sortProperties - function propertySort(itemsKey, sortPropertiesKey) { - var cp = new _emberMetal.ComputedProperty(function (key) { - var _this5 = this; + dynamicScope.outletState = _glimmerReference.UNDEFINED_REFERENCE; - var itemsKeyIsAtThis = itemsKey === '@this'; - var sortProperties = _emberMetal.get(this, sortPropertiesKey); + var engine = env.owner.buildChildEngineInstance(name); - _emberMetal.assert('The sort definition for \'' + key + '\' on ' + this + ' must be a function or an array of strings', _emberRuntimeUtils.isArray(sortProperties) && sortProperties.every(function (s) { - return typeof s === 'string'; - })); + engine.boot(); - var normalizedSortProperties = normalizeSortProperties(sortProperties); + return { engine: engine }; + }; - // Add/remove property observers as required. - var activeObserversMap = cp._activeObserverMap || (cp._activeObserverMap = new _emberMetal.WeakMap()); - var activeObservers = activeObserversMap.get(this); + MountManager.prototype.layoutFor = function layoutFor(definition, _ref2, env) { + var engine = _ref2.engine; - if (activeObservers) { - activeObservers.forEach(function (args) { - return _emberMetal.removeObserver.apply(null, args); - }); - } + var template = engine.lookup('template:application'); + return env.getCompiledBlock(_emberGlimmerSyntaxOutlet.OutletLayoutCompiler, template); + }; - function sortPropertyDidChange() { - this.notifyPropertyChange(key); - } + MountManager.prototype.getSelf = function getSelf(_ref3) { + var engine = _ref3.engine; - activeObservers = normalizedSortProperties.map(function (_ref) { - var prop = _ref[0]; + var applicationFactory = engine[_container.FACTORY_FOR]('controller:application'); + var factory = applicationFactory || _emberRouting.generateControllerFactory(engine, 'application'); + return new _emberGlimmerUtilsReferences.RootReference(factory.create()); + }; - var path = itemsKeyIsAtThis ? '@each.' + prop : itemsKey + '.@each.' + prop; - var args = [_this5, path, sortPropertyDidChange]; - _emberMetal.addObserver.apply(null, args); - return args; - }); + MountManager.prototype.getTag = function getTag() { + return null; + }; - activeObserversMap.set(this, activeObservers); + MountManager.prototype.getDestructor = function getDestructor(_ref4) { + var engine = _ref4.engine; - // Sort and return the array. - var items = itemsKeyIsAtThis ? this : _emberMetal.get(this, itemsKey); + return engine; + }; - if (_emberRuntimeUtils.isArray(items)) { - return sortByNormalizedSortProperties(items, normalizedSortProperties); - } else { - return _emberRuntimeSystemNative_array.A(); - } - }); + MountManager.prototype.didCreateElement = function didCreateElement() {}; - cp._activeObserverMap = undefined; + MountManager.prototype.didRenderLayout = function didRenderLayout() { + var _this2 = this; - return cp.property(sortPropertiesKey + '.[]').readOnly(); - } + _emberMetal.runInDebug(function () { + return _this2.debugStack.pop(); + }); + }; - function normalizeSortProperties(sortProperties) { - return sortProperties.map(function (p) { - var _p$split = p.split(':'); + MountManager.prototype.didCreate = function didCreate(state) {}; - var prop = _p$split[0]; - var direction = _p$split[1]; + MountManager.prototype.update = function update(state, args, dynamicScope) {}; - direction = direction || 'asc'; + MountManager.prototype.didUpdateLayout = function didUpdateLayout() {}; - return [prop, direction]; - }); - } + MountManager.prototype.didUpdate = function didUpdate(state) {}; - function sortByNormalizedSortProperties(items, normalizedSortProperties) { - return _emberRuntimeSystemNative_array.A(items.slice().sort(function (itemA, itemB) { - for (var i = 0; i < normalizedSortProperties.length; i++) { - var _normalizedSortProperties$i = normalizedSortProperties[i]; - var prop = _normalizedSortProperties$i[0]; - var direction = _normalizedSortProperties$i[1]; + return MountManager; + })(_emberGlimmerSyntaxAbstractManager.default); - var result = _emberRuntimeCompare.default(_emberMetal.get(itemA, prop), _emberMetal.get(itemB, prop)); - if (result !== 0) { - return direction === 'desc' ? -1 * result : result; - } - } + var MOUNT_MANAGER = new MountManager(); - return 0; - })); - } -}); -enifed('ember-runtime/controllers/controller', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/mixins/controller', 'ember-runtime/inject', 'ember-runtime/mixins/action_handler'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeMixinsController, _emberRuntimeInject, _emberRuntimeMixinsAction_handler) { - 'use strict'; + var MountDefinition = (function (_ComponentDefinition) { + babelHelpers.inherits(MountDefinition, _ComponentDefinition); + + function MountDefinition(name, env) { + babelHelpers.classCallCheck(this, MountDefinition); + + _ComponentDefinition.call(this, name, MOUNT_MANAGER, null); + this.env = env; + } + return MountDefinition; + })(_glimmerRuntime.ComponentDefinition); +}); +enifed('ember-glimmer/syntax/outlet', ['exports', 'ember-utils', '@glimmer/runtime', 'ember-metal', 'ember-glimmer/utils/references', 'ember-glimmer/syntax/abstract-manager', '@glimmer/reference'], function (exports, _emberUtils, _glimmerRuntime, _emberMetal, _emberGlimmerUtilsReferences, _emberGlimmerSyntaxAbstractManager, _glimmerReference) { /** @module ember - @submodule ember-runtime + @submodule ember-glimmer */ + 'use strict'; - /** - @class Controller - @namespace Ember - @extends Ember.Object - @uses Ember.ControllerMixin - @public - */ - var Controller = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsController.default); + exports.outletMacro = outletMacro; - _emberRuntimeMixinsAction_handler.deprecateUnderscoreActions(Controller); + function outletComponentFor(vm) { + var _vm$dynamicScope = vm.dynamicScope(); - function controllerInjectionHelper(factory) { - _emberMetal.assert('Defining an injected controller property on a ' + 'non-controller is not allowed.', _emberRuntimeMixinsController.default.detect(factory.PrototypeMixin)); + var outletState = _vm$dynamicScope.outletState; + + var args = vm.getArgs(); + var outletNameRef = undefined; + if (args.positional.length === 0) { + outletNameRef = new _glimmerReference.ConstReference('main'); + } else { + outletNameRef = args.positional.at(0); + } + + return new OutletComponentReference(outletNameRef, outletState); } /** - Creates a property that lazily looks up another controller in the container. - Can only be used when defining another controller. + 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: - Example: + ```handlebars + {{! app/templates/application.hbs }} + + {{my-header}} +
    + + {{outlet}} +
    + + {{my-footer}} + ``` - ```javascript - App.PostController = Ember.Controller.extend({ - posts: Ember.inject.controller() - }); + 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"}} ``` - This example will create a `posts` property on the `post` controller that - looks up the `posts` controller in the container, making it easy to - reference other controllers. This is functionally equivalent to: + Your routes can then render into a specific one of these `outlet`s by specifying the `outlet` + attribute in your `renderTemplate` function: ```javascript - App.PostController = Ember.Controller.extend({ - needs: 'posts', - posts: Ember.computed.alias('controllers.posts') + // app/routes/menu.js + export default Ember.Route.extend({ + renderTemplate() { + this.render({ outlet: 'menu' }); + } }); ``` - @method controller - @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 + 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. + + @method outlet + @param {String} [name] + @for Ember.Templates.helpers @public */ - _emberRuntimeInject.createInjectionHelper('controller', controllerInjectionHelper); - - exports.default = Controller; -}); -enifed('ember-runtime/copy', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/mixins/copyable'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeMixinsCopyable) { - 'use strict'; - - exports.default = copy; - - function _copy(obj, deep, seen, copies) { - var ret = undefined, - loc = undefined, - key = undefined; - // primitive data types are immutable, just return them. - if (typeof obj !== 'object' || obj === null) { - return obj; + function outletMacro(path, params, hash, builder) { + if (!params) { + params = []; } + var definitionArgs = [params.slice(0, 1), null, null, null]; + builder.component.dynamic(definitionArgs, outletComponentFor, _glimmerRuntime.CompiledArgs.empty(), builder.symbolTable, null); + return true; + } - // avoid cyclical loops - if (deep && (loc = seen.indexOf(obj)) >= 0) { - return copies[loc]; - } + var OutletComponentReference = (function () { + function OutletComponentReference(outletNameRef, parentOutletStateRef) { + babelHelpers.classCallCheck(this, OutletComponentReference); - _emberMetal.assert('Cannot clone an Ember.Object that does not implement Ember.Copyable', !(obj instanceof _emberRuntimeSystemObject.default) || _emberRuntimeMixinsCopyable.default && _emberRuntimeMixinsCopyable.default.detect(obj)); + this.outletNameRef = outletNameRef; + this.parentOutletStateRef = parentOutletStateRef; + this.definition = null; + this.lastState = null; + var outletStateTag = this.outletStateTag = new _glimmerReference.UpdatableTag(parentOutletStateRef.tag); + this.tag = _glimmerReference.combine([outletStateTag.tag, outletNameRef.tag]); + } - // IMPORTANT: this specific test will detect a native array only. Any other - // object will need to implement Copyable. - if (Array.isArray(obj)) { - ret = obj.slice(); + OutletComponentReference.prototype.value = function value() { + var outletNameRef = this.outletNameRef; + var parentOutletStateRef = this.parentOutletStateRef; + var definition = this.definition; + var lastState = this.lastState; - if (deep) { - loc = ret.length; + var outletName = outletNameRef.value(); + var outletStateRef = parentOutletStateRef.get('outlets').get(outletName); + var newState = this.lastState = outletStateRef.value(); - while (--loc >= 0) { - ret[loc] = _copy(ret[loc], deep, seen, copies); - } - } - } else if (_emberRuntimeMixinsCopyable.default && _emberRuntimeMixinsCopyable.default.detect(obj)) { - ret = obj.copy(deep, seen, copies); - } else if (obj instanceof Date) { - ret = new Date(obj.getTime()); - } else { - ret = {}; + this.outletStateTag.update(outletStateRef.tag); - for (key in obj) { - // support Null prototype - if (!Object.prototype.hasOwnProperty.call(obj, key)) { - continue; - } + definition = revalidate(definition, lastState, newState); - // Prevents browsers that don't respect non-enumerability from - // copying internal Ember properties - if (key.substring(0, 2) === '__') { - continue; - } + var hasTemplate = newState && newState.render.template; - ret[key] = deep ? _copy(obj[key], deep, seen, copies) : obj[key]; + if (definition) { + return definition; + } else if (hasTemplate) { + return this.definition = new OutletComponentDefinition(outletName, newState.render.template); + } else { + return this.definition = null; } - } - - if (deep) { - seen.push(obj); - copies.push(ret); - } + }; - return ret; - } + return OutletComponentReference; + })(); - /** - Creates a shallow copy of the passed object. A deep copy of the object is - returned if the optional `deep` argument is `true`. - - If the passed object implements the `Ember.Copyable` interface, then this - function will delegate to the object's `copy()` method and return the - result. See `Ember.Copyable` for further details. - - For primitive values (which are immutable in JavaScript), the passed object - is simply returned. - - @method copy - @for Ember - @param {Object} obj The object to clone - @param {Boolean} [deep=false] If true, a deep copy of the object is made. - @return {Object} The copied object - @public - */ + function revalidate(definition, lastState, newState) { + if (!lastState && !newState) { + return definition; + } - function copy(obj, deep) { - // fast paths - if ('object' !== typeof obj || obj === null) { - return obj; // can't copy primitives + if (!lastState && newState || lastState && !newState) { + return null; } - if (_emberRuntimeMixinsCopyable.default && _emberRuntimeMixinsCopyable.default.detect(obj)) { - return obj.copy(deep); + if (newState.render.template === lastState.render.template && newState.render.controller === lastState.render.controller) { + return definition; } - return _copy(obj, deep, deep ? [] : null, deep ? [] : null); + return null; } -}); -enifed('ember-runtime/ext/function', ['exports', 'ember-environment', 'ember-metal'], function (exports, _emberEnvironment, _emberMetal) { - /** - @module ember - @submodule ember-runtime - */ - 'use strict'; + function instrumentationPayload(_ref) { + var _ref$render = _ref.render; + var name = _ref$render.name; + var outlet = _ref$render.outlet; - var a_slice = Array.prototype.slice; - var FunctionPrototype = Function.prototype; + return { object: name + ':' + outlet }; + } - if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.Function) { - /** - The `property` extension of Javascript's Function prototype is available - when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is - `true`, which is the default. - Computed properties allow you to treat a function like a property: - ```javascript - MyApp.President = Ember.Object.extend({ - firstName: '', - lastName: '', - fullName: function() { - return this.get('firstName') + ' ' + this.get('lastName'); - }.property() // Call this flag to mark the function as a property - }); - let president = MyApp.President.create({ - firstName: 'Barack', - lastName: 'Obama' - }); - president.get('fullName'); // 'Barack Obama' - ``` - Treating a function like a property is useful because they can work with - bindings, just like any other property. - Many computed properties have dependencies on other properties. For - example, in the above example, the `fullName` property depends on - `firstName` and `lastName` to determine its value. You can tell Ember - about these dependencies like this: - ```javascript - MyApp.President = Ember.Object.extend({ - firstName: '', - lastName: '', - fullName: function() { - return this.get('firstName') + ' ' + this.get('lastName'); - // Tell Ember.js that this computed property depends on firstName - // and lastName - }.property('firstName', 'lastName') - }); - ``` - 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/classes/Ember.computed.html). - @method property - @for Function - @public - */ - FunctionPrototype.property = function () { - var ret = _emberMetal.computed(this); - // ComputedProperty.prototype.property expands properties; no need for us to - // do so here. - return ret.property.apply(ret, arguments); + function NOOP() {} + + var StateBucket = (function () { + function StateBucket(outletState) { + babelHelpers.classCallCheck(this, StateBucket); + + this.outletState = outletState; + this.instrument(); + } + + StateBucket.prototype.instrument = function instrument() { + this.finalizer = _emberMetal._instrumentStart('render.outlet', instrumentationPayload, this.outletState); }; - /** - The `observes` extension of Javascript's Function prototype is available - when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is - true, which is the default. - You can observe property changes simply by adding the `observes` - call to the end of your method declarations in classes that you write. - For example: - ```javascript - Ember.Object.extend({ - valueObserver: function() { - // Executes whenever the "value" property changes - }.observes('value') - }); - ``` - In the future this method may become asynchronous. - See `Ember.observer`. - @method observes - @for Function - @public - */ - FunctionPrototype.observes = function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } + StateBucket.prototype.finalize = function finalize() { + var finalizer = this.finalizer; - args.push(this); - return _emberMetal.observer.apply(this, args); + finalizer(); + this.finalizer = NOOP; }; - FunctionPrototype._observesImmediately = function () { - _emberMetal.assert('Immediate observers must observe internal properties only, ' + 'not properties on other objects.', function checkIsInternalProperty() { - for (var i = 0; i < arguments.length; i++) { - if (arguments[i].indexOf('.') !== -1) { - return false; - } - } - return true; - }); + return StateBucket; + })(); - // observes handles property expansion - return this.observes.apply(this, arguments); + var OutletComponentManager = (function (_AbstractManager) { + babelHelpers.inherits(OutletComponentManager, _AbstractManager); + + function OutletComponentManager() { + babelHelpers.classCallCheck(this, OutletComponentManager); + + _AbstractManager.apply(this, arguments); + } + + OutletComponentManager.prototype.prepareArgs = function prepareArgs(definition, args) { + return args; }; - /** - The `observesImmediately` extension of Javascript's Function prototype is - available when `EmberENV.EXTEND_PROTOTYPES` or - `EmberENV.EXTEND_PROTOTYPES.Function` is true, which is the default. - You can observe property changes simply by adding the `observesImmediately` - call to the end of your method declarations in classes that you write. - For example: - ```javascript - Ember.Object.extend({ - valueObserver: function() { - // Executes immediately after the "value" property changes - }.observesImmediately('value') - }); - ``` - In the future, `observes` may become asynchronous. In this event, - `observesImmediately` will maintain the synchronous behavior. - See `Ember.immediateObserver`. - @method observesImmediately - @for Function - @deprecated - @private - */ - FunctionPrototype.observesImmediately = _emberMetal.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 `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is - true, which is the default. - You can listen for events simply by adding the `on` call to the end of - your method declarations in classes or mixins that you write. For example: - ```javascript - Ember.Mixin.create({ - doSomethingWithElement: function() { - // Executes whenever the "didInsertElement" event fires - }.on('didInsertElement') + OutletComponentManager.prototype.create = function create(environment, definition, args, dynamicScope) { + var _this = this; + + _emberMetal.runInDebug(function () { + return _this._pushToDebugStack('template:' + definition.template.meta.moduleName, environment); }); - ``` - See `Ember.on`. - @method on - @for Function - @public - */ - FunctionPrototype.on = function () { - var events = a_slice.call(arguments); - this.__ember_listens__ = events; - return this; + var outletStateReference = dynamicScope.outletState = dynamicScope.outletState.get('outlets').get(definition.outletName); + var outletState = outletStateReference.value(); + return new StateBucket(outletState); }; - } -}); -enifed('ember-runtime/ext/rsvp', ['exports', 'rsvp', 'ember-metal'], function (exports, _rsvp, _emberMetal) { - 'use strict'; - - exports.onerrorDefault = onerrorDefault; - var backburner = _emberMetal.run.backburner; - _emberMetal.run._addQueue('rsvpAfter', 'destroy'); + OutletComponentManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { + return env.getCompiledBlock(OutletLayoutCompiler, definition.template); + }; - _rsvp.configure('async', function (callback, promise) { - backburner.schedule('actions', null, callback, promise); - }); + OutletComponentManager.prototype.getSelf = function getSelf(_ref2) { + var outletState = _ref2.outletState; - _rsvp.configure('after', function (cb) { - backburner.schedule('rsvpAfter', null, cb); - }); + return new _emberGlimmerUtilsReferences.RootReference(outletState.render.controller); + }; - _rsvp.on('error', onerrorDefault); + OutletComponentManager.prototype.getTag = function getTag() { + return null; + }; - function onerrorDefault(reason) { - var error = errorFor(reason); - if (error) { - _emberMetal.dispatchError(error); - } - } + OutletComponentManager.prototype.getDestructor = function getDestructor() { + return null; + }; - function errorFor(reason) { - if (!reason) return; + OutletComponentManager.prototype.didRenderLayout = function didRenderLayout(bucket) { + var _this2 = this; - if (reason.errorThrown) { - return unwrapErrorThrown(reason); - } + bucket.finalize(); - if (reason.name === 'UnrecognizedURLError') { - _emberMetal.assert('The URL \'' + reason.message + '\' did not match any routes in your application', false); - return; - } + _emberMetal.runInDebug(function () { + return _this2.debugStack.pop(); + }); + }; - if (reason.name === 'TransitionAborted') { - return; - } + OutletComponentManager.prototype.didCreateElement = function didCreateElement() {}; - return reason; - } + OutletComponentManager.prototype.didCreate = function didCreate(state) {}; - function unwrapErrorThrown(reason) { - var error = reason.errorThrown; - if (typeof error === 'string') { - error = new Error(error); - } - Object.defineProperty(error, '__reason_with_error_thrown__', { - value: reason, - enumerable: false - }); - return error; - } + OutletComponentManager.prototype.update = function update(bucket) {}; - exports.default = _rsvp; -}); -enifed('ember-runtime/ext/string', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { - /** - @module ember - @submodule ember-runtime - */ + OutletComponentManager.prototype.didUpdateLayout = function didUpdateLayout(bucket) {}; - 'use strict'; + OutletComponentManager.prototype.didUpdate = function didUpdate(state) {}; - var StringPrototype = String.prototype; + return OutletComponentManager; + })(_emberGlimmerSyntaxAbstractManager.default); - if (_emberEnvironment.ENV.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]; - } + var MANAGER = new OutletComponentManager(); - return _emberRuntimeSystemString.fmt(this, args); - }; + var TopLevelOutletComponentManager = (function (_OutletComponentManager) { + babelHelpers.inherits(TopLevelOutletComponentManager, _OutletComponentManager); - /** - See [Ember.String.w](/api/classes/Ember.String.html#method_w). - @method w - @for String - @private - */ - StringPrototype.w = function () { - return _emberRuntimeSystemString.w(this); - }; + function TopLevelOutletComponentManager() { + babelHelpers.classCallCheck(this, TopLevelOutletComponentManager); - /** - See [Ember.String.loc](/api/classes/Ember.String.html#method_loc). - @method loc - @for String - @private - */ - StringPrototype.loc = function () { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } + _OutletComponentManager.apply(this, arguments); + } - return _emberRuntimeSystemString.loc(this, args); - }; + TopLevelOutletComponentManager.prototype.create = function create(environment, definition, args, dynamicScope) { + var _this3 = this; - /** - See [Ember.String.camelize](/api/classes/Ember.String.html#method_camelize). - @method camelize - @for String - @private - */ - StringPrototype.camelize = function () { - return _emberRuntimeSystemString.camelize(this); - }; + _emberMetal.runInDebug(function () { + return _this3._pushToDebugStack('template:' + definition.template.meta.moduleName, environment); + }); - /** - See [Ember.String.decamelize](/api/classes/Ember.String.html#method_decamelize). - @method decamelize - @for String - @private - */ - StringPrototype.decamelize = function () { - return _emberRuntimeSystemString.decamelize(this); + return new StateBucket(dynamicScope.outletState.value()); }; - /** - See [Ember.String.dasherize](/api/classes/Ember.String.html#method_dasherize). - @method dasherize - @for String - @private - */ - StringPrototype.dasherize = function () { - return _emberRuntimeSystemString.dasherize(this); + TopLevelOutletComponentManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { + return env.getCompiledBlock(TopLevelOutletLayoutCompiler, definition.template); }; - /** - See [Ember.String.underscore](/api/classes/Ember.String.html#method_underscore). - @method underscore - @for String - @private - */ - StringPrototype.underscore = function () { - return _emberRuntimeSystemString.underscore(this); - }; + return TopLevelOutletComponentManager; + })(OutletComponentManager); - /** - See [Ember.String.classify](/api/classes/Ember.String.html#method_classify). - @method classify - @for String - @private - */ - StringPrototype.classify = function () { - return _emberRuntimeSystemString.classify(this); - }; + var TOP_LEVEL_MANAGER = new TopLevelOutletComponentManager(); - /** - See [Ember.String.capitalize](/api/classes/Ember.String.html#method_capitalize). - @method capitalize - @for String - @private - */ - StringPrototype.capitalize = function () { - return _emberRuntimeSystemString.capitalize(this); - }; - } -}); -enifed('ember-runtime/index', ['exports', 'ember-runtime/ext/string', 'ember-runtime/ext/function', 'ember-runtime/system/object', 'ember-runtime/system/string', 'ember-runtime/mixins/registry_proxy', 'ember-runtime/mixins/container_proxy', 'ember-runtime/copy', 'ember-runtime/inject', 'ember-runtime/compare', 'ember-runtime/is-equal', 'ember-runtime/mixins/array', 'ember-runtime/mixins/comparable', 'ember-runtime/system/namespace', 'ember-runtime/system/array_proxy', 'ember-runtime/system/object_proxy', 'ember-runtime/system/core_object', 'ember-runtime/system/native_array', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/copyable', 'ember-runtime/mixins/enumerable', 'ember-runtime/mixins/freezable', 'ember-runtime/mixins/-proxy', 'ember-runtime/system/lazy_load', 'ember-runtime/mixins/observable', '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/computed_macros', 'ember-runtime/computed/reduce_computed_macros', 'ember-runtime/controllers/controller', 'ember-runtime/mixins/controller', 'ember-runtime/system/service', 'ember-runtime/ext/rsvp', 'ember-runtime/utils', 'ember-runtime/string_registry'], function (exports, _emberRuntimeExtString, _emberRuntimeExtFunction, _emberRuntimeSystemObject, _emberRuntimeSystemString, _emberRuntimeMixinsRegistry_proxy, _emberRuntimeMixinsContainer_proxy, _emberRuntimeCopy, _emberRuntimeInject, _emberRuntimeCompare, _emberRuntimeIsEqual, _emberRuntimeMixinsArray, _emberRuntimeMixinsComparable, _emberRuntimeSystemNamespace, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemObject_proxy, _emberRuntimeSystemCore_object, _emberRuntimeSystemNative_array, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsFreezable, _emberRuntimeMixinsProxy, _emberRuntimeSystemLazy_load, _emberRuntimeMixinsObservable, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsTarget_action_support, _emberRuntimeMixinsEvented, _emberRuntimeMixinsPromise_proxy, _emberRuntimeComputedComputed_macros, _emberRuntimeComputedReduce_computed_macros, _emberRuntimeControllersController, _emberRuntimeMixinsController, _emberRuntimeSystemService, _emberRuntimeExtRsvp, _emberRuntimeUtils, _emberRuntimeString_registry) { - /** - @module ember - @submodule ember-runtime - */ + var TopLevelOutletComponentDefinition = (function (_ComponentDefinition) { + babelHelpers.inherits(TopLevelOutletComponentDefinition, _ComponentDefinition); - 'use strict'; + function TopLevelOutletComponentDefinition(instance) { + babelHelpers.classCallCheck(this, TopLevelOutletComponentDefinition); - exports.Object = _emberRuntimeSystemObject.default; - exports.FrameworkObject = _emberRuntimeSystemObject.FrameworkObject; - exports.String = _emberRuntimeSystemString.default; - exports.RegistryProxyMixin = _emberRuntimeMixinsRegistry_proxy.default; - exports.buildFakeRegistryWithDeprecations = _emberRuntimeMixinsRegistry_proxy.buildFakeRegistryWithDeprecations; - exports.ContainerProxyMixin = _emberRuntimeMixinsContainer_proxy.default; - exports.copy = _emberRuntimeCopy.default; - exports.inject = _emberRuntimeInject.default; - exports.compare = _emberRuntimeCompare.default; - exports.isEqual = _emberRuntimeIsEqual.default; - exports.Array = _emberRuntimeMixinsArray.default; - exports.objectAt = _emberRuntimeMixinsArray.objectAt; - exports.isEmberArray = _emberRuntimeMixinsArray.isEmberArray; - exports.addArrayObserver = _emberRuntimeMixinsArray.addArrayObserver; - exports.removeArrayObserver = _emberRuntimeMixinsArray.removeArrayObserver; - exports.Comparable = _emberRuntimeMixinsComparable.default; - exports.Namespace = _emberRuntimeSystemNamespace.default; - exports.isNamespaceSearchDisabled = _emberRuntimeSystemNamespace.isSearchDisabled; - exports.setNamespaceSearchDisabled = _emberRuntimeSystemNamespace.setSearchDisabled; - exports.ArrayProxy = _emberRuntimeSystemArray_proxy.default; - exports.ObjectProxy = _emberRuntimeSystemObject_proxy.default; - exports.CoreObject = _emberRuntimeSystemCore_object.default; - exports.NativeArray = _emberRuntimeSystemNative_array.default; - exports.A = _emberRuntimeSystemNative_array.A; - exports.ActionHandler = _emberRuntimeMixinsAction_handler.default; - exports.deprecateUnderscoreActions = _emberRuntimeMixinsAction_handler.deprecateUnderscoreActions; - exports.Copyable = _emberRuntimeMixinsCopyable.default; - exports.Enumerable = _emberRuntimeMixinsEnumerable.default; - exports.Freezable = _emberRuntimeMixinsFreezable.Freezable; - exports.FROZEN_ERROR = _emberRuntimeMixinsFreezable.FROZEN_ERROR; - exports._ProxyMixin = _emberRuntimeMixinsProxy.default; - exports.onLoad = _emberRuntimeSystemLazy_load.onLoad; - exports.runLoadHooks = _emberRuntimeSystemLazy_load.runLoadHooks; - exports._loaded = _emberRuntimeSystemLazy_load._loaded; - exports.Observable = _emberRuntimeMixinsObservable.default; - exports.MutableEnumerable = _emberRuntimeMixinsMutable_enumerable.default; - exports.MutableArray = _emberRuntimeMixinsMutable_array.default; - exports.removeAt = _emberRuntimeMixinsMutable_array.removeAt; - exports.TargetActionSupport = _emberRuntimeMixinsTarget_action_support.default; - exports.Evented = _emberRuntimeMixinsEvented.default; - exports.PromiseProxyMixin = _emberRuntimeMixinsPromise_proxy.default; - exports.empty = _emberRuntimeComputedComputed_macros.empty; - exports.notEmpty = _emberRuntimeComputedComputed_macros.notEmpty; - exports.none = _emberRuntimeComputedComputed_macros.none; - exports.not = _emberRuntimeComputedComputed_macros.not; - exports.bool = _emberRuntimeComputedComputed_macros.bool; - exports.match = _emberRuntimeComputedComputed_macros.match; - exports.equal = _emberRuntimeComputedComputed_macros.equal; - exports.gt = _emberRuntimeComputedComputed_macros.gt; - exports.gte = _emberRuntimeComputedComputed_macros.gte; - exports.lt = _emberRuntimeComputedComputed_macros.lt; - exports.lte = _emberRuntimeComputedComputed_macros.lte; - exports.oneWay = _emberRuntimeComputedComputed_macros.oneWay; - exports.readOnly = _emberRuntimeComputedComputed_macros.readOnly; - exports.deprecatingAlias = _emberRuntimeComputedComputed_macros.deprecatingAlias; - exports.and = _emberRuntimeComputedComputed_macros.and; - exports.or = _emberRuntimeComputedComputed_macros.or; - exports.sum = _emberRuntimeComputedReduce_computed_macros.sum; - exports.min = _emberRuntimeComputedReduce_computed_macros.min; - exports.max = _emberRuntimeComputedReduce_computed_macros.max; - exports.map = _emberRuntimeComputedReduce_computed_macros.map; - exports.sort = _emberRuntimeComputedReduce_computed_macros.sort; - exports.setDiff = _emberRuntimeComputedReduce_computed_macros.setDiff; - exports.mapBy = _emberRuntimeComputedReduce_computed_macros.mapBy; - exports.filter = _emberRuntimeComputedReduce_computed_macros.filter; - exports.filterBy = _emberRuntimeComputedReduce_computed_macros.filterBy; - exports.uniq = _emberRuntimeComputedReduce_computed_macros.uniq; - exports.uniqBy = _emberRuntimeComputedReduce_computed_macros.uniqBy; - exports.union = _emberRuntimeComputedReduce_computed_macros.union; - exports.intersect = _emberRuntimeComputedReduce_computed_macros.intersect; - exports.collect = _emberRuntimeComputedReduce_computed_macros.collect; - exports.Controller = _emberRuntimeControllersController.default; - exports.ControllerMixin = _emberRuntimeMixinsController.default; - exports.Service = _emberRuntimeSystemService.default; - exports.RSVP = _emberRuntimeExtRsvp.default; - exports.onerrorDefault = _emberRuntimeExtRsvp.onerrorDefault; - // just for side effect of extending Ember.RSVP - exports.isArray = _emberRuntimeUtils.isArray; - exports.typeOf = _emberRuntimeUtils.typeOf; - exports.getStrings = _emberRuntimeString_registry.getStrings; - exports.setStrings = _emberRuntimeString_registry.setStrings; -}); -// just for side effect of extending String.prototype -// just for side effect of extending Function.prototype -enifed('ember-runtime/inject', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; + _ComponentDefinition.call(this, 'outlet', TOP_LEVEL_MANAGER, instance); + this.template = instance.template; + _emberUtils.generateGuid(this); + } - exports.default = inject; - exports.createInjectionHelper = createInjectionHelper; - exports.validatePropertyInjections = validatePropertyInjections; + return TopLevelOutletComponentDefinition; + })(_glimmerRuntime.ComponentDefinition); - /** - Namespace for injection helper methods. - - @class inject - @namespace Ember - @static - @public - */ + exports.TopLevelOutletComponentDefinition = TopLevelOutletComponentDefinition; - function inject() { - _emberMetal.assert('Injected properties must be created through helpers, see \'' + Object.keys(inject).join('"', '"') + '\''); - } + var TopLevelOutletLayoutCompiler = (function () { + function TopLevelOutletLayoutCompiler(template) { + babelHelpers.classCallCheck(this, TopLevelOutletLayoutCompiler); - // Dictionary of injection validations by type, added to by `createInjectionHelper` - var typeValidators = {}; + this.template = template; + } - /** - This method allows other Ember modules to register injection helpers for a - given container type. Helpers are exported to the `inject` namespace as the - container type itself. - - @private - @method createInjectionHelper - @since 1.10.0 - @for Ember - @param {String} type The container type the helper will inject - @param {Function} validator A validation callback that is executed at mixin-time - */ + TopLevelOutletLayoutCompiler.prototype.compile = function compile(builder) { + builder.wrapLayout(this.template.asLayout()); + builder.tag.static('div'); + builder.attrs.static('id', _emberUtils.guidFor(this)); + builder.attrs.static('class', 'ember-view'); + }; - function createInjectionHelper(type, validator) { - typeValidators[type] = validator; + return TopLevelOutletLayoutCompiler; + })(); - inject[type] = function (name) { - return new _emberMetal.InjectedProperty(type, name); + TopLevelOutletLayoutCompiler.id = 'top-level-outlet'; + + var OutletComponentDefinition = (function (_ComponentDefinition2) { + babelHelpers.inherits(OutletComponentDefinition, _ComponentDefinition2); + + function OutletComponentDefinition(outletName, template) { + babelHelpers.classCallCheck(this, OutletComponentDefinition); + + _ComponentDefinition2.call(this, 'outlet', MANAGER, null); + this.outletName = outletName; + this.template = template; + _emberUtils.generateGuid(this); + } + + return OutletComponentDefinition; + })(_glimmerRuntime.ComponentDefinition); + + var OutletLayoutCompiler = (function () { + function OutletLayoutCompiler(template) { + babelHelpers.classCallCheck(this, OutletLayoutCompiler); + + this.template = template; + } + + OutletLayoutCompiler.prototype.compile = function compile(builder) { + builder.wrapLayout(this.template.asLayout()); }; - } + return OutletLayoutCompiler; + })(); + + exports.OutletLayoutCompiler = OutletLayoutCompiler; + + OutletLayoutCompiler.id = 'outlet'; +}); +enifed('ember-glimmer/syntax/render', ['exports', '@glimmer/runtime', '@glimmer/reference', 'ember-metal', 'ember-glimmer/utils/references', 'ember-routing', 'ember-glimmer/syntax/outlet', 'container', 'ember-glimmer/syntax/abstract-manager'], function (exports, _glimmerRuntime, _glimmerReference, _emberMetal, _emberGlimmerUtilsReferences, _emberRouting, _emberGlimmerSyntaxOutlet, _container, _emberGlimmerSyntaxAbstractManager) { /** - Validation function that runs per-type validation functions once for each - injected type encountered. - - @private - @method validatePropertyInjections - @since 1.10.0 - @for Ember - @param {Object} factory The factory object + @module ember + @submodule ember-glimmer */ + 'use strict'; - function validatePropertyInjections(factory) { - var proto = factory.proto(); - var types = []; + exports.renderMacro = renderMacro; - for (var key in proto) { - var desc = proto[key]; - if (desc instanceof _emberMetal.InjectedProperty && types.indexOf(desc.type) === -1) { - types.push(desc.type); - } - } + function makeComponentDefinition(vm) { + var env = vm.env; + var args = vm.getArgs(); + var nameRef = args.positional.at(0); - if (types.length) { - for (var i = 0; i < types.length; i++) { - var validator = typeValidators[types[i]]; + _emberMetal.assert('The first argument of {{render}} must be quoted, e.g. {{render "sidebar"}}.', _glimmerReference.isConst(nameRef)); + _emberMetal.assert('The second argument of {{render}} must be a path, e.g. {{render "post" post}}.', args.positional.length === 1 || !_glimmerReference.isConst(args.positional.at(1))); - if (typeof validator === 'function') { - validator(factory); - } - } + var templateName = nameRef.value(); + + _emberMetal.assert('You used `{{render \'' + templateName + '\'}}`, but \'' + templateName + '\' can not be found as a template.', env.owner.hasRegistration('template:' + templateName)); + + var template = env.owner.lookup('template:' + templateName); + + var controllerName = undefined; + + if (args.named.has('controller')) { + var controllerNameRef = args.named.get('controller'); + + _emberMetal.assert('The controller argument for {{render}} must be quoted, e.g. {{render "sidebar" controller="foo"}}.', _glimmerReference.isConst(controllerNameRef)); + + controllerName = controllerNameRef.value(); + + _emberMetal.assert('The controller name you supplied \'' + controllerName + '\' did not resolve to a controller.', env.owner.hasRegistration('controller:' + controllerName)); + } else { + controllerName = templateName; } - return true; + if (args.positional.length === 1) { + return new _glimmerReference.ConstReference(new RenderDefinition(controllerName, template, env, SINGLETON_RENDER_MANAGER)); + } else { + return new _glimmerReference.ConstReference(new RenderDefinition(controllerName, template, env, NON_SINGLETON_RENDER_MANAGER)); + } } -}); -enifed('ember-runtime/is-equal', ['exports'], function (exports) { + /** - Compares two objects, returning true if they are equal. + Calling ``{{render}}`` from within a template will insert another + template that matches the provided name. The inserted template will + access its properties on its own controller (rather than the controller + of the parent template). - ```javascript - Ember.isEqual('hello', 'hello'); // true - Ember.isEqual(1, 2); // false - ``` + If a view class with the same name exists, the view class also will be used. + Note: A given controller may only be used *once* in your app in this manner. + A singleton instance of the controller will be created for you. - `isEqual` is a more specific comparison than a triple equal comparison. - It will call the `isEqual` instance method on the objects being - compared, allowing finer control over when objects should be considered - equal to each other. + Example: ```javascript - let Person = Ember.Object.extend({ - isEqual(other) { return this.ssn == other.ssn; } + App.NavigationController = Ember.Controller.extend({ + who: "world" }); + ``` - let personA = Person.create({name: 'Muhammad Ali', ssn: '123-45-6789'}); - let personB = Person.create({name: 'Cassius Clay', ssn: '123-45-6789'}); + ```handlebars + + Hello, {{who}}. + ``` - Ember.isEqual(personA, personB); // true + ```handlebars + +

    My great app

    + {{render "navigation"}} ``` - Due to the expense of array comparisons, collections will never be equal to - each other even if each of their items are equal to each other. + ```html +

    My great app

    +
    + Hello, world. +
    + ``` - ```javascript - Ember.isEqual([4, 2], [4, 2]); // false + Optionally you may provide a second argument: a property path + that will be bound to the `model` property of the controller. + If a `model` property path is specified, then a new instance of the + controller will be created and `{{render}}` can be used multiple times + with the same name. + + For example if you had this `author` template. + + ```handlebars +
    + Written by {{firstName}} {{lastName}}. + Total Posts: {{postCount}} +
    ``` - @method isEqual - @for Ember - @param {Object} a first object to compare - @param {Object} b second object to compare - @return {Boolean} + You could render it inside the `post` template using the `render` helper. + + ```handlebars +
    +

    {{title}}

    +
    {{body}}
    + {{render "author" author}} +
    + ``` + + @method render + @for Ember.Templates.helpers + @param {String} name + @param {Object?} context + @param {Hash} options + @return {String} HTML string @public */ - 'use strict'; - - exports.default = isEqual; - - function isEqual(a, b) { - if (a && typeof a.isEqual === 'function') { - return a.isEqual(b); - } - if (a instanceof Date && b instanceof Date) { - return a.getTime() === b.getTime(); + function renderMacro(path, params, hash, builder) { + if (!params) { + params = []; } - - return a === b; - } -}); -enifed('ember-runtime/mixins/-proxy', ['exports', 'glimmer-reference', 'ember-metal', 'ember-runtime/computed/computed_macros'], function (exports, _glimmerReference, _emberMetal, _emberRuntimeComputedComputed_macros) { - /** - @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 - _emberMetal.propertyWillChange(this, key); - } - - function contentPropertyDidChange(content, contentKey) { - var key = contentKey.slice(8); // remove "content." - if (key in this) { - return; - } // if shadowed in proxy - _emberMetal.propertyDidChange(this, key); + var definitionArgs = [params.slice(0), hash, null, null]; + var args = [params.slice(1), hash, null, null]; + builder.component.dynamic(definitionArgs, makeComponentDefinition, args, builder.symbolTable); + return true; } - var ProxyTag = (function (_CachedTag) { - babelHelpers.inherits(ProxyTag, _CachedTag); - - function ProxyTag(proxy) { - babelHelpers.classCallCheck(this, ProxyTag); - - _CachedTag.call(this); + var AbstractRenderManager = (function (_AbstractManager) { + babelHelpers.inherits(AbstractRenderManager, _AbstractManager); - var content = _emberMetal.get(proxy, 'content'); + function AbstractRenderManager() { + babelHelpers.classCallCheck(this, AbstractRenderManager); - this.proxy = proxy; - this.proxyWrapperTag = new _glimmerReference.DirtyableTag(); - this.proxyContentTag = new _glimmerReference.UpdatableTag(_emberMetal.tagFor(content)); + _AbstractManager.apply(this, arguments); } - /** - `Ember.ProxyMixin` forwards all properties not defined by the proxy itself - to a proxied `content` object. See Ember.ObjectProxy for more details. - - @class ProxyMixin - @namespace Ember - @private - */ - - ProxyTag.prototype.compute = function compute() { - return Math.max(this.proxyWrapperTag.value(), this.proxyContentTag.value()); + AbstractRenderManager.prototype.prepareArgs = function prepareArgs(definition, args) { + return args; }; - ProxyTag.prototype.dirty = function dirty() { - this.proxyWrapperTag.dirty(); - }; + /* abstract create(environment, definition, args, dynamicScope); */ - ProxyTag.prototype.contentDidChange = function contentDidChange() { - var content = _emberMetal.get(this.proxy, 'content'); - this.proxyContentTag.update(_emberMetal.tagFor(content)); + AbstractRenderManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { + return env.getCompiledBlock(_emberGlimmerSyntaxOutlet.OutletLayoutCompiler, definition.template); }; - return ProxyTag; - })(_glimmerReference.CachedTag); - - exports.default = _emberMetal.Mixin.create({ - /** - The object whose properties will be forwarded. - @property content - @type Ember.Object - @default null - @private - */ - content: null, + AbstractRenderManager.prototype.getSelf = function getSelf(_ref) { + var controller = _ref.controller; - init: function () { - this._super.apply(this, arguments); - _emberMetal.meta(this).setProxy(); - }, + return new _emberGlimmerUtilsReferences.RootReference(controller); + }; - _initializeTag: _emberMetal.on('init', function () { - _emberMetal.meta(this)._tag = new ProxyTag(this); - }), + AbstractRenderManager.prototype.getTag = function getTag() { + return null; + }; - _contentDidChange: _emberMetal.observer('content', function () { - _emberMetal.assert('Can\'t set Proxy\'s content to itself', _emberMetal.get(this, 'content') !== this); - _emberMetal.tagFor(this).contentDidChange(); - }), + AbstractRenderManager.prototype.getDestructor = function getDestructor() { + return null; + }; - isTruthy: _emberRuntimeComputedComputed_macros.bool('content'), + AbstractRenderManager.prototype.didCreateElement = function didCreateElement() {}; - _debugContainerKey: null, + AbstractRenderManager.prototype.didRenderLayout = function didRenderLayout() {}; - willWatchProperty: function (key) { - var contentKey = 'content.' + key; - _emberMetal._addBeforeObserver(this, contentKey, null, contentPropertyWillChange); - _emberMetal.addObserver(this, contentKey, null, contentPropertyDidChange); - }, + AbstractRenderManager.prototype.didCreate = function didCreate() {}; - didUnwatchProperty: function (key) { - var contentKey = 'content.' + key; - _emberMetal._removeBeforeObserver(this, contentKey, null, contentPropertyWillChange); - _emberMetal.removeObserver(this, contentKey, null, contentPropertyDidChange); - }, + AbstractRenderManager.prototype.update = function update() {}; - unknownProperty: function (key) { - var content = _emberMetal.get(this, 'content'); - if (content) { - _emberMetal.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 _emberMetal.get(content, key); - } - }, + AbstractRenderManager.prototype.didUpdateLayout = function didUpdateLayout() {}; - setUnknownProperty: function (key, value) { - var m = _emberMetal.meta(this); - if (m.proto === this) { - // if marked as prototype then just defineProperty - // rather than delegate - _emberMetal.defineProperty(this, key, null, value); - return value; - } + AbstractRenderManager.prototype.didUpdate = function didUpdate() {}; - var content = _emberMetal.get(this, 'content'); - _emberMetal.assert('Cannot delegate set(\'' + key + '\', ' + value + ') to the \'content\' property of object proxy ' + this + ': its \'content\' is undefined.', content); + return AbstractRenderManager; + })(_emberGlimmerSyntaxAbstractManager.default); - _emberMetal.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 _emberMetal.set(content, key, value); - } + _emberMetal.runInDebug(function () { + AbstractRenderManager.prototype.didRenderLayout = function () { + this.debugStack.pop(); + }; }); -}); -enifed('ember-runtime/mixins/action_handler', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-runtime - */ - - 'use strict'; - exports.deprecateUnderscoreActions = deprecateUnderscoreActions; + var SingletonRenderManager = (function (_AbstractRenderManager) { + babelHelpers.inherits(SingletonRenderManager, _AbstractRenderManager); - /** - `Ember.ActionHandler` is available on some familiar classes including - `Ember.Route`, `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.) - - @class ActionHandler - @namespace Ember - @private - */ - var ActionHandler = _emberMetal.Mixin.create({ - mergedProperties: ['actions'], + function SingletonRenderManager() { + babelHelpers.classCallCheck(this, SingletonRenderManager); - /** - 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 - from within a template and the application's current route is this route. - Actions can also be invoked from other parts of your application - via `ActionHandler#send`. - The `actions` hash will inherit action handlers from - the `actions` hash defined on extended parent classes - or mixins rather than just replace the entire hash, e.g.: - ```js - App.CanDisplayBanner = Ember.Mixin.create({ - actions: { - displayBanner(msg) { - // ... - } - } - }); - App.WelcomeRoute = Ember.Route.extend(App.CanDisplayBanner, { - actions: { - playMusic() { - // ... - } - } - }); - // `WelcomeRoute`, when active, will be able to respond - // to both actions, since the actions hash is merged rather - // then replaced when extending mixins / parent classes. - this.send('displayBanner'); - this.send('playMusic'); - ``` - Within a Controller, Route or Component's action handler, - the value of the `this` context is the Controller, Route or - Component object: - ```js - App.SongRoute = Ember.Route.extend({ - actions: { - myAction() { - this.controllerFor("song"); - this.transitionTo("other.route"); - ... - } - } - }); - ``` - It is also possible to call `this._super(...arguments)` from within an - action handler if it overrides a handler defined on a parent - class or mixin: - Take for example the following routes: - ```js - App.DebugRoute = Ember.Mixin.create({ - actions: { - debugRouteInformation() { - console.debug("trololo"); - } - } - }); - App.AnnoyingDebugRoute = Ember.Route.extend(App.DebugRoute, { - actions: { - debugRouteInformation() { - // also call the debugRouteInformation of mixed in App.DebugRoute - this._super(...arguments); - // show additional annoyance - window.alert(...); - } - } - }); - ``` - ## Bubbling - By default, an action will stop bubbling once a handler defined - on the `actions` hash handles it. To continue bubbling the action, - you must return `true` from the handler: - ```js - App.Router.map(function() { - this.route("album", function() { - this.route("song"); - }); - }); - App.AlbumRoute = Ember.Route.extend({ - actions: { - startPlaying: function() { - } - } - }); - App.AlbumSongRoute = Ember.Route.extend({ - actions: { - startPlaying() { - // ... - if (actionShouldAlsoBeTriggeredOnParentRoute) { - return true; - } - } - } - }); - ``` - @property actions - @type Object - @default null - @public - */ + _AbstractRenderManager.apply(this, arguments); + } - /** - 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 - not be found in the `ActionHandler`'s `actions` hash or if the - action target function returns `true`. - Example - ```js - App.WelcomeRoute = Ember.Route.extend({ - actions: { - playTheme() { - this.send('playMusic', 'theme.mp3'); - }, - playMusic(track) { - // ... - } - } + SingletonRenderManager.prototype.create = function create(environment, definition, args, dynamicScope) { + var _this = this; + + var name = definition.name; + var env = definition.env; + + var controller = env.owner.lookup('controller:' + name) || _emberRouting.generateController(env.owner, name); + + _emberMetal.runInDebug(function () { + return _this._pushToDebugStack('controller:' + name + ' (with the render helper)', environment); }); - ``` - @method send - @param {String} actionName The action to trigger - @param {*} context a context to send with the action - @public - */ - send: function (actionName) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; + + if (dynamicScope.rootOutletState) { + dynamicScope.outletState = dynamicScope.rootOutletState.getOrphan(name); } - var target = undefined; + return { controller: controller }; + }; - if (this.actions && this.actions[actionName]) { - var shouldBubble = this.actions[actionName].apply(this, args) === true; - if (!shouldBubble) { - return; - } - } + return SingletonRenderManager; + })(AbstractRenderManager); + + var SINGLETON_RENDER_MANAGER = new SingletonRenderManager(); - if (target = _emberMetal.get(this, 'target')) { - var _target; + var NonSingletonRenderManager = (function (_AbstractRenderManager2) { + babelHelpers.inherits(NonSingletonRenderManager, _AbstractRenderManager2); - _emberMetal.assert('The `target` for ' + this + ' (' + target + ') does not have a `send` method', typeof target.send === 'function'); - (_target = target).send.apply(_target, arguments); - } - }, + function NonSingletonRenderManager() { + babelHelpers.classCallCheck(this, NonSingletonRenderManager); - willMergeMixin: function (props) { - _emberMetal.assert('Specifying `_actions` and `actions` in the same mixin is not supported.', !props.actions || !props._actions); + _AbstractRenderManager2.apply(this, arguments); + } - if (props._actions) { - _emberMetal.deprecate('Specifying actions in `_actions` is deprecated, please use `actions` instead.', false, { id: 'ember-runtime.action-handler-_actions', until: '3.0.0' }); + NonSingletonRenderManager.prototype.create = function create(environment, definition, args, dynamicScope) { + var _this2 = this; - props.actions = props._actions; - delete props._actions; + var name = definition.name; + var env = definition.env; + + var modelRef = args.positional.at(0); + var controllerFactory = env.owner[_container.FACTORY_FOR]('controller:' + name); + + var factory = controllerFactory || _emberRouting.generateControllerFactory(env.owner, name); + var controller = factory.create({ model: modelRef.value() }); + + _emberMetal.runInDebug(function () { + return _this2._pushToDebugStack('controller:' + name + ' (with the render helper)', environment); + }); + + if (dynamicScope.rootOutletState) { + dynamicScope.outletState = dynamicScope.rootOutletState.getOrphan(name); } + + return { controller: controller }; + }; + + NonSingletonRenderManager.prototype.update = function update(_ref2, args, dynamicScope) { + var controller = _ref2.controller; + + controller.set('model', args.positional.at(0).value()); + }; + + NonSingletonRenderManager.prototype.getDestructor = function getDestructor(_ref3) { + var controller = _ref3.controller; + + return controller; + }; + + return NonSingletonRenderManager; + })(AbstractRenderManager); + + var NON_SINGLETON_RENDER_MANAGER = new NonSingletonRenderManager(); + + var RenderDefinition = (function (_ComponentDefinition) { + babelHelpers.inherits(RenderDefinition, _ComponentDefinition); + + function RenderDefinition(name, template, env, manager) { + babelHelpers.classCallCheck(this, RenderDefinition); + + _ComponentDefinition.call(this, 'render', manager, null); + + this.name = name; + this.template = template; + this.env = env; } - }); - exports.default = ActionHandler; + return RenderDefinition; + })(_glimmerRuntime.ComponentDefinition); +}); +enifed('ember-glimmer/template', ['exports', 'ember-utils', '@glimmer/runtime'], function (exports, _emberUtils, _glimmerRuntime) { + 'use strict'; - function deprecateUnderscoreActions(factory) { - Object.defineProperty(factory.prototype, '_actions', { - configurable: true, - enumerable: false, - set: function (value) { - _emberMetal.assert('You cannot set `_actions` on ' + this + ', please use `actions` instead.'); - }, - get: function () { - _emberMetal.deprecate('Usage of `_actions` is deprecated, use `actions` instead.', false, { id: 'ember-runtime.action-handler-_actions', until: '3.0.0' }); - return _emberMetal.get(this, 'actions'); + exports.default = template; + + function template(json) { + var factory = _glimmerRuntime.templateFactory(json); + + return { + id: factory.id, + meta: factory.meta, + create: function (props) { + return factory.create(props.env, { owner: props[_emberUtils.OWNER] }); } - }); + }; } }); -enifed('ember-runtime/mixins/array', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/mixins/enumerable', 'ember-runtime/system/each_proxy'], function (exports, _emberUtils, _emberMetal, _emberRuntimeMixinsEnumerable, _emberRuntimeSystemEach_proxy) { - /** - @module ember - @submodule ember-runtime - */ +enifed("ember-glimmer/template_registry", ["exports"], function (exports) { + // STATE within a module is frowned apon, this exists + // to support Ember.TEMPLATES but shield ember internals from this legacy + // global API. + "use strict"; - // .......................................................... - // HELPERS - // + exports.setTemplates = setTemplates; + exports.getTemplates = getTemplates; + exports.getTemplate = getTemplate; + exports.hasTemplate = hasTemplate; + exports.setTemplate = setTemplate; + var TEMPLATES = {}; + + function setTemplates(templates) { + TEMPLATES = templates; + } + + function getTemplates() { + return TEMPLATES; + } + + function getTemplate(name) { + if (TEMPLATES.hasOwnProperty(name)) { + return TEMPLATES[name]; + } + } + + function hasTemplate(name) { + return TEMPLATES.hasOwnProperty(name); + } + + function setTemplate(name, template) { + return TEMPLATES[name] = template; + } +}); +enifed("ember-glimmer/templates/component", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { + "use strict"; + + exports.default = _emberGlimmerTemplate.default({ "id": "2aYM5QYc", "block": "{\"statements\":[[\"yield\",\"default\"]],\"locals\":[],\"named\":[],\"yields\":[\"default\"],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/component.hbs" } }); +}); +enifed("ember-glimmer/templates/empty", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { + "use strict"; + + exports.default = _emberGlimmerTemplate.default({ "id": "5QJJjniM", "block": "{\"statements\":[],\"locals\":[],\"named\":[],\"yields\":[],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/empty.hbs" } }); +}); +enifed("ember-glimmer/templates/link-to", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { + "use strict"; + + exports.default = _emberGlimmerTemplate.default({ "id": "Y2DX6qHQ", "block": "{\"statements\":[[\"block\",[\"if\"],[[\"get\",[\"linkTitle\"]]],null,{\"statements\":[[\"append\",[\"unknown\",[\"linkTitle\"]],false]],\"locals\":[]},{\"statements\":[[\"yield\",\"default\"]],\"locals\":[]}]],\"locals\":[],\"named\":[],\"yields\":[\"default\"],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/link-to.hbs" } }); +}); +enifed("ember-glimmer/templates/outlet", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { + "use strict"; + + exports.default = _emberGlimmerTemplate.default({ "id": "xyZMyWzn", "block": "{\"statements\":[[\"append\",[\"unknown\",[\"outlet\"]],false]],\"locals\":[],\"named\":[],\"yields\":[],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/outlet.hbs" } }); +}); +enifed("ember-glimmer/templates/root", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { + "use strict"; + + exports.default = _emberGlimmerTemplate.default({ "id": "/KBRNPqv", "block": "{\"statements\":[[\"append\",[\"helper\",[\"component\"],[[\"get\",[null]]],null],false]],\"locals\":[],\"named\":[],\"yields\":[],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/root.hbs" } }); +}); +enifed('ember-glimmer/utils/bindings', ['exports', '@glimmer/reference', 'ember-metal', 'ember-runtime', 'ember-glimmer/component', 'ember-glimmer/utils/string'], function (exports, _glimmerReference, _emberMetal, _emberRuntime, _emberGlimmerComponent, _emberGlimmerUtilsString) { 'use strict'; - var _Mixin$create; + exports.wrapComponentClassAttribute = wrapComponentClassAttribute; - exports.addArrayObserver = addArrayObserver; - exports.removeArrayObserver = removeArrayObserver; - exports.objectAt = objectAt; - exports.arrayContentWillChange = arrayContentWillChange; - exports.arrayContentDidChange = arrayContentDidChange; - exports.isEmberArray = isEmberArray; + function referenceForKey(component, key) { + return component[_emberGlimmerComponent.ROOT_REF].get(key); + } - function arrayObserversHelper(obj, target, opts, operation, notify) { - var willChange = opts && opts.willChange || 'arrayWillChange'; - var didChange = opts && opts.didChange || 'arrayDidChange'; - var hasObservers = _emberMetal.get(obj, 'hasArrayObservers'); + function referenceForParts(component, parts) { + var isAttrs = parts[0] === 'attrs'; - if (hasObservers === notify) { - _emberMetal.propertyWillChange(obj, 'hasArrayObservers'); + // TODO deprecate this + if (isAttrs) { + parts.shift(); + + if (parts.length === 1) { + return referenceForKey(component, parts[0]); + } } - operation(obj, '@array:before', target, willChange); - operation(obj, '@array:change', target, didChange); + return _glimmerReference.referenceFromParts(component[_emberGlimmerComponent.ROOT_REF], parts); + } - if (hasObservers === notify) { - _emberMetal.propertyDidChange(obj, 'hasArrayObservers'); + // TODO we should probably do this transform at build time + + function wrapComponentClassAttribute(hash) { + if (!hash) { + return hash; } - return obj; - } + var keys = hash[0]; + var values = hash[1]; - function addArrayObserver(array, target, opts) { - return arrayObserversHelper(array, target, opts, _emberMetal.addListener, false); - } + var index = keys.indexOf('class'); - function removeArrayObserver(array, target, opts) { - return arrayObserversHelper(array, target, opts, _emberMetal.removeListener, true); - } + if (index !== -1) { + var _values$index = values[index]; + var type = _values$index[0]; - function objectAt(content, idx) { - if (content.objectAt) { - return content.objectAt(idx); + if (type === 'get') { + var getExp = values[index]; + var path = getExp[1]; + var propName = path[path.length - 1]; + hash[1][index] = ['helper', ['-class'], [getExp, propName]]; + } } - return content[idx]; + return hash; } - function arrayContentWillChange(array, startIdx, removeAmt, addAmt) { - var removing = undefined, - lim = undefined; + var AttributeBinding = { + parse: function (microsyntax) { + var colonIndex = microsyntax.indexOf(':'); - // if no args are passed assume everything changes - if (startIdx === undefined) { - startIdx = 0; - removeAmt = addAmt = -1; - } else { - if (removeAmt === undefined) { - removeAmt = -1; + if (colonIndex === -1) { + _emberMetal.assert('You cannot use class as an attributeBinding, use classNameBindings instead.', microsyntax !== 'class'); + return [microsyntax, microsyntax, true]; + } else { + var prop = microsyntax.substring(0, colonIndex); + var attribute = microsyntax.substring(colonIndex + 1); + + _emberMetal.assert('You cannot use class as an attributeBinding, use classNameBindings instead.', attribute !== 'class'); + + return [prop, attribute, false]; } + }, - if (addAmt === undefined) { - addAmt = -1; + install: function (element, component, parsed, operations) { + var prop = parsed[0]; + var attribute = parsed[1]; + var isSimple = parsed[2]; + + if (attribute === 'id') { + var elementId = _emberMetal.get(component, prop); + if (elementId === undefined || elementId === null) { + elementId = component.elementId; + } + operations.addStaticAttribute(element, 'id', elementId); + return; } - } - if (array.__each) { - array.__each.arrayWillChange(array, startIdx, removeAmt, addAmt); + var isPath = prop.indexOf('.') > -1; + var reference = isPath ? referenceForParts(component, prop.split('.')) : referenceForKey(component, prop); + + _emberMetal.assert('Illegal attributeBinding: \'' + prop + '\' is not a valid attribute name.', !(isSimple && isPath)); + + if (attribute === 'style') { + reference = new StyleBindingReference(reference, referenceForKey(component, 'isVisible')); + } + + operations.addDynamicAttribute(element, attribute, reference); } + }; - _emberMetal.sendEvent(array, '@array:before', [array, startIdx, removeAmt, addAmt]); + exports.AttributeBinding = AttributeBinding; + var DISPLAY_NONE = 'display: none;'; + var SAFE_DISPLAY_NONE = _emberGlimmerUtilsString.htmlSafe(DISPLAY_NONE); - if (startIdx >= 0 && removeAmt >= 0 && _emberMetal.get(array, 'hasEnumerableObservers')) { - removing = []; - lim = startIdx + removeAmt; + var StyleBindingReference = (function (_CachedReference) { + babelHelpers.inherits(StyleBindingReference, _CachedReference); - for (var idx = startIdx; idx < lim; idx++) { - removing.push(objectAt(array, idx)); + function StyleBindingReference(inner, isVisible) { + babelHelpers.classCallCheck(this, StyleBindingReference); + + _CachedReference.call(this); + + this.tag = _glimmerReference.combine([inner.tag, isVisible.tag]); + this.inner = inner; + this.isVisible = isVisible; + } + + StyleBindingReference.prototype.compute = function compute() { + var value = this.inner.value(); + var isVisible = this.isVisible.value(); + + if (isVisible !== false) { + return value; + } else if (!value && value !== 0) { + return SAFE_DISPLAY_NONE; + } else { + var style = value + ' ' + DISPLAY_NONE; + return _emberGlimmerUtilsString.isHTMLSafe(value) ? _emberGlimmerUtilsString.htmlSafe(style) : style; } - } else { - removing = removeAmt; + }; + + return StyleBindingReference; + })(_glimmerReference.CachedReference); + + var IsVisibleBinding = { + install: function (element, component, operations) { + operations.addDynamicAttribute(element, 'style', _glimmerReference.map(referenceForKey(component, 'isVisible'), this.mapStyleValue)); + }, + + mapStyleValue: function (isVisible) { + return isVisible === false ? SAFE_DISPLAY_NONE : null; } + }; - array.enumerableContentWillChange(removing, addAmt); + exports.IsVisibleBinding = IsVisibleBinding; + var ClassNameBinding = { + install: function (element, component, microsyntax, operations) { + var _microsyntax$split = microsyntax.split(':'); - return array; - } + var prop = _microsyntax$split[0]; + var truthy = _microsyntax$split[1]; + var falsy = _microsyntax$split[2]; - function arrayContentDidChange(array, startIdx, removeAmt, addAmt) { - // if no args are passed assume everything changes - if (startIdx === undefined) { - startIdx = 0; - removeAmt = addAmt = -1; - } else { - if (removeAmt === undefined) { - removeAmt = -1; - } + var isStatic = prop === ''; - if (addAmt === undefined) { - addAmt = -1; + if (isStatic) { + operations.addStaticAttribute(element, 'class', truthy); + } else { + var isPath = prop.indexOf('.') > -1; + var parts = isPath && prop.split('.'); + var value = isPath ? referenceForParts(component, parts) : referenceForKey(component, prop); + var ref = undefined; + + if (truthy === undefined) { + ref = new SimpleClassNameBindingReference(value, isPath ? parts[parts.length - 1] : prop); + } else { + ref = new ColonClassNameBindingReference(value, truthy, falsy); + } + + operations.addDynamicAttribute(element, 'class', ref); } } + }; - var adding = undefined; - if (startIdx >= 0 && addAmt >= 0 && _emberMetal.get(array, 'hasEnumerableObservers')) { - adding = []; - var lim = startIdx + addAmt; + exports.ClassNameBinding = ClassNameBinding; - for (var idx = startIdx; idx < lim; idx++) { - adding.push(objectAt(array, idx)); - } - } else { - adding = addAmt; + var SimpleClassNameBindingReference = (function (_CachedReference2) { + babelHelpers.inherits(SimpleClassNameBindingReference, _CachedReference2); + + function SimpleClassNameBindingReference(inner, path) { + babelHelpers.classCallCheck(this, SimpleClassNameBindingReference); + + _CachedReference2.call(this); + + this.tag = inner.tag; + this.inner = inner; + this.path = path; + this.dasherizedPath = null; } - array.enumerableContentDidChange(removeAmt, adding); + SimpleClassNameBindingReference.prototype.compute = function compute() { + var value = this.inner.value(); - if (array.__each) { - array.__each.arrayDidChange(array, startIdx, removeAmt, addAmt); + if (value === true) { + var path = this.path; + var dasherizedPath = this.dasherizedPath; + + return dasherizedPath || (this.dasherizedPath = _emberRuntime.String.dasherize(path)); + } else if (value || value === 0) { + return value; + } else { + return null; + } + }; + + return SimpleClassNameBindingReference; + })(_glimmerReference.CachedReference); + + var ColonClassNameBindingReference = (function (_CachedReference3) { + babelHelpers.inherits(ColonClassNameBindingReference, _CachedReference3); + + function ColonClassNameBindingReference(inner, truthy, falsy) { + babelHelpers.classCallCheck(this, ColonClassNameBindingReference); + + _CachedReference3.call(this); + + this.tag = inner.tag; + this.inner = inner; + this.truthy = truthy || null; + this.falsy = falsy || null; } - _emberMetal.sendEvent(array, '@array:change', [array, startIdx, removeAmt, addAmt]); + ColonClassNameBindingReference.prototype.compute = function compute() { + var inner = this.inner; + var truthy = this.truthy; + var falsy = this.falsy; - var meta = _emberMetal.peekMeta(array); - var cache = meta && meta.readableCache(); + return inner.value() ? truthy : falsy; + }; - if (cache) { - if (cache.firstObject !== undefined && objectAt(array, 0) !== _emberMetal.cacheFor.get(cache, 'firstObject')) { - _emberMetal.propertyWillChange(array, 'firstObject'); - _emberMetal.propertyDidChange(array, 'firstObject'); + return ColonClassNameBindingReference; + })(_glimmerReference.CachedReference); +}); +enifed('ember-glimmer/utils/debug-stack', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; + + var DebugStack = undefined; + + _emberMetal.runInDebug(function () { + var Element = function Element(name) { + babelHelpers.classCallCheck(this, Element); + + this.name = name; + }; + + var TemplateElement = (function (_Element) { + babelHelpers.inherits(TemplateElement, _Element); + + function TemplateElement() { + babelHelpers.classCallCheck(this, TemplateElement); + + _Element.apply(this, arguments); } - if (cache.lastObject !== undefined && objectAt(array, _emberMetal.get(array, 'length') - 1) !== _emberMetal.cacheFor.get(cache, 'lastObject')) { - _emberMetal.propertyWillChange(array, 'lastObject'); - _emberMetal.propertyDidChange(array, 'lastObject'); + + return TemplateElement; + })(Element); + + var EngineElement = (function (_Element2) { + babelHelpers.inherits(EngineElement, _Element2); + + function EngineElement() { + babelHelpers.classCallCheck(this, EngineElement); + + _Element2.apply(this, arguments); } - } - return array; - } - var EMBER_ARRAY = _emberUtils.symbol('EMBER_ARRAY'); + return EngineElement; + })(Element); - function isEmberArray(obj) { - return obj && !!obj[EMBER_ARRAY]; - } + DebugStack = (function () { + function DebugStack() { + babelHelpers.classCallCheck(this, DebugStack); - // .......................................................... - // ARRAY - // - /** - This mixin implements Observer-friendly Array-like behavior. It is not a - concrete implementation, but it can be used up by other classes that want - to appear like arrays. - - For example, ArrayProxy is a concrete classes that can - be instantiated to implement array-like behavior. Both of these classes use - the Array Mixin by way of the MutableArray mixin, which allows observable - changes to be made to the underlying array. - - Unlike `Ember.Enumerable,` this mixin defines methods specifically for - collections that provide index-ordered access to their contents. When you - are designing code that needs to accept any kind of Array-like object, you - should use these methods instead of Array primitives because these will - properly notify observers of changes to the array. - - Although these methods are efficient, they do add a layer of indirection to - your application so it is a good idea to use them only when you need the - flexibility of using both true JavaScript arrays and "virtual" arrays such - as controllers and collections. - - You can use the methods defined in this module to access and modify array - contents in a KVO-friendly way. You can also be notified whenever the - membership of an array changes by using `.observes('myArray.[]')`. - - To support `Ember.Array` in your own class, you must override two - primitives to use it: `length()` and `objectAt()`. - - Note that the Ember.Array mixin also incorporates the `Ember.Enumerable` - mixin. All `Ember.Array`-like objects are also enumerable. - - @class Array - @namespace Ember - @uses Ember.Enumerable - @since Ember 0.9.0 - @public - */ - var ArrayMixin = _emberMetal.Mixin.create(_emberRuntimeMixinsEnumerable.default, (_Mixin$create = {}, _Mixin$create[EMBER_ARRAY] = true, _Mixin$create.length = null, _Mixin$create.objectAt = function (idx) { - if (idx < 0 || idx >= _emberMetal.get(this, 'length')) { - return undefined; - } + this._stack = []; + } + + DebugStack.prototype.push = function push(name) { + this._stack.push(new TemplateElement(name)); + }; - return _emberMetal.get(this, idx); - }, _Mixin$create.objectsAt = function (indexes) { - var _this = this; + DebugStack.prototype.pushEngine = function pushEngine(name) { + this._stack.push(new EngineElement(name)); + }; - return indexes.map(function (idx) { - return objectAt(_this, idx); - }); - }, _Mixin$create.nextObject = function (idx) { - return objectAt(this, idx); - }, _Mixin$create['[]'] = _emberMetal.computed({ - get: function (key) { - return this; - }, - set: function (key, value) { - this.replace(0, _emberMetal.get(this, 'length'), value); - return this; - } - }), _Mixin$create.firstObject = _emberMetal.computed(function () { - return objectAt(this, 0); - }).readOnly(), _Mixin$create.lastObject = _emberMetal.computed(function () { - return objectAt(this, _emberMetal.get(this, 'length') - 1); - }).readOnly(), _Mixin$create.contains = function (obj) { - if (true) { - _emberMetal.deprecate('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.', false, { id: 'ember-runtime.enumerable-contains', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_enumerable-contains' }); - } + DebugStack.prototype.pop = function pop() { + var element = this._stack.pop(); - return this.indexOf(obj) >= 0; - }, _Mixin$create.slice = function (beginIndex, endIndex) { - var ret = _emberMetal.default.A(); - var length = _emberMetal.get(this, 'length'); + if (element) { + return element.name; + } + }; - if (_emberMetal.isNone(beginIndex)) { - beginIndex = 0; - } + DebugStack.prototype.peek = function peek() { + var template = this._currentTemplate(); + var engine = this._currentEngine(); - if (_emberMetal.isNone(endIndex) || endIndex > length) { - endIndex = length; - } + if (engine) { + return '"' + template + '" (in "' + engine + '")'; + } else if (template) { + return '"' + template + '"'; + } + }; - if (beginIndex < 0) { - beginIndex = length + beginIndex; + DebugStack.prototype._currentTemplate = function _currentTemplate() { + return this._getCurrentByType(TemplateElement); + }; + + DebugStack.prototype._currentEngine = function _currentEngine() { + return this._getCurrentByType(EngineElement); + }; + + DebugStack.prototype._getCurrentByType = function _getCurrentByType(type) { + for (var i = this._stack.length; i >= 0; i--) { + var element = this._stack[i]; + if (element instanceof type) { + return element.name; + } + } + }; + + return DebugStack; + })(); + }); + + exports.default = DebugStack; +}); +enifed('ember-glimmer/utils/iterable', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/each-in', '@glimmer/reference'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberGlimmerUtilsReferences, _emberGlimmerHelpersEachIn, _glimmerReference) { + 'use strict'; + + exports.default = iterableFor; + + var ITERATOR_KEY_GUID = 'be277757-bbbe-4620-9fcb-213ef433cca2'; + + function iterableFor(ref, keyPath) { + if (_emberGlimmerHelpersEachIn.isEachIn(ref)) { + return new EachInIterable(ref, keyForEachIn(keyPath)); + } else { + return new ArrayIterable(ref, keyForArray(keyPath)); } + } - if (endIndex < 0) { - endIndex = length + endIndex; + function keyForEachIn(keyPath) { + switch (keyPath) { + case '@index': + case undefined: + case null: + return index; + case '@identity': + return identity; + default: + return function (item) { + return _emberMetal.get(item, keyPath); + }; } + } - while (beginIndex < endIndex) { - ret[ret.length] = objectAt(this, beginIndex++); + function keyForArray(keyPath) { + switch (keyPath) { + case '@index': + return index; + case '@identity': + case undefined: + case null: + return identity; + default: + return function (item) { + return _emberMetal.get(item, keyPath); + }; } + } - return ret; - }, _Mixin$create.indexOf = function (object, startAt) { - var len = _emberMetal.get(this, 'length'); + function index(item, index) { + return String(index); + } - if (startAt === undefined) { - startAt = 0; + function identity(item) { + switch (typeof item) { + case 'string': + case 'number': + return String(item); + default: + return _emberUtils.guidFor(item); } + } - if (startAt < 0) { - startAt += len; - } + function ensureUniqueKey(seen, key) { + var seenCount = seen[key]; - for (var idx = startAt; idx < len; idx++) { - if (objectAt(this, idx) === object) { - return idx; - } + if (seenCount) { + seen[key]++; + return '' + key + ITERATOR_KEY_GUID + seenCount; + } else { + seen[key] = 1; } - return -1; - }, _Mixin$create.lastIndexOf = function (object, startAt) { - var len = _emberMetal.get(this, 'length'); + return key; + } - if (startAt === undefined || startAt >= len) { - startAt = len - 1; - } + var ArrayIterator = (function () { + function ArrayIterator(array, keyFor) { + babelHelpers.classCallCheck(this, ArrayIterator); - if (startAt < 0) { - startAt += len; + this.array = array; + this.length = array.length; + this.keyFor = keyFor; + this.position = 0; + this.seen = new _emberUtils.EmptyObject(); } - for (var idx = startAt; idx >= 0; idx--) { - if (objectAt(this, idx) === object) { - return idx; + ArrayIterator.prototype.isEmpty = function isEmpty() { + return false; + }; + + ArrayIterator.prototype.next = function next() { + var array = this.array; + var length = this.length; + var keyFor = this.keyFor; + var position = this.position; + var seen = this.seen; + + if (position >= length) { + return null; } - } - return -1; - }, _Mixin$create.addArrayObserver = function (target, opts) { - return addArrayObserver(this, target, opts); - }, _Mixin$create.removeArrayObserver = function (target, opts) { - return removeArrayObserver(this, target, opts); - }, _Mixin$create.hasArrayObservers = _emberMetal.computed(function () { - return _emberMetal.hasListeners(this, '@array:change') || _emberMetal.hasListeners(this, '@array:before'); - }), _Mixin$create.arrayContentWillChange = function (startIdx, removeAmt, addAmt) { - return arrayContentWillChange(this, startIdx, removeAmt, addAmt); - }, _Mixin$create.arrayContentDidChange = function (startIdx, removeAmt, addAmt) { - return arrayContentDidChange(this, startIdx, removeAmt, addAmt); - }, _Mixin$create['@each'] = _emberMetal.computed(function () { - // TODO use Symbol or add to meta - if (!this.__each) { - this.__each = new _emberRuntimeSystemEach_proxy.default(this); - } + var value = array[position]; + var memo = position; + var key = ensureUniqueKey(seen, keyFor(value, memo)); - return this.__each; - }).volatile().readOnly(), _Mixin$create)); + this.position++; - if (true) { - 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 = _emberMetal.get(this, 'length'); + return { key: key, value: value, memo: memo }; + }; - if (startAt === undefined) { - startAt = 0; - } + return ArrayIterator; + })(); - if (startAt < 0) { - startAt += len; - } + var EmberArrayIterator = (function () { + function EmberArrayIterator(array, keyFor) { + babelHelpers.classCallCheck(this, EmberArrayIterator); - for (var idx = startAt; idx < len; idx++) { - var currentObj = objectAt(this, idx); + this.array = array; + this.length = _emberMetal.get(array, 'length'); + this.keyFor = keyFor; + this.position = 0; + this.seen = new _emberUtils.EmptyObject(); + } - // SameValueZero comparison (NaN !== NaN) - if (obj === currentObj || obj !== obj && currentObj !== currentObj) { - return true; - } - } + EmberArrayIterator.prototype.isEmpty = function isEmpty() { + return this.length === 0; + }; - return false; + EmberArrayIterator.prototype.next = function next() { + var array = this.array; + var length = this.length; + var keyFor = this.keyFor; + var position = this.position; + var seen = this.seen; + + if (position >= length) { + return null; } - }); - } - exports.default = ArrayMixin; -}); -// ES6TODO: Ember.A + var value = _emberRuntime.objectAt(array, position); + var memo = position; + var key = ensureUniqueKey(seen, keyFor(value, memo)); -/** - __Required.__ You must implement this method to apply this mixin. - Your array must support the `length` property. Your replace methods should - set this property whenever it changes. - @property {Number} length - @public -*/ + this.position++; -/** - Returns the object at the given `index`. If the given `index` is negative - or is greater or equal than the array length, returns `undefined`. - This is one of the primitives you must implement to support `Ember.Array`. - If your object supports retrieving the value of an array item using `get()` - (i.e. `myArray.get(0)`), then you do not need to implement this method - yourself. - ```javascript - let arr = ['a', 'b', 'c', 'd']; - arr.objectAt(0); // 'a' - arr.objectAt(3); // 'd' - arr.objectAt(-1); // undefined - arr.objectAt(4); // undefined - arr.objectAt(5); // undefined - ``` - @method objectAt - @param {Number} idx The index of the item to return. - @return {*} item at index or undefined - @public -*/ + return { key: key, value: value, memo: memo }; + }; -/** - This returns the objects at the specified indexes, using `objectAt`. - ```javascript - let arr = ['a', 'b', 'c', 'd']; - arr.objectsAt([0, 1, 2]); // ['a', 'b', 'c'] - arr.objectsAt([2, 3, 4]); // ['c', 'd', undefined] - ``` - @method objectsAt - @param {Array} indexes An array of indexes of items to return. - @return {Array} - @public - */ + return EmberArrayIterator; + })(); -// overrides Ember.Enumerable version + var ObjectKeysIterator = (function () { + function ObjectKeysIterator(keys, values, keyFor) { + babelHelpers.classCallCheck(this, ObjectKeysIterator); -/** - This is the handler for the special array content property. If you get - this property, it will return this. If you set this property to a new - array, it will replace the current content. - This property overrides the default property defined in `Ember.Enumerable`. - @property [] - @return this - @public -*/ + this.keys = keys; + this.values = values; + this.keyFor = keyFor; + this.position = 0; + this.seen = new _emberUtils.EmptyObject(); + } -// optimized version from Enumerable + ObjectKeysIterator.prototype.isEmpty = function isEmpty() { + return this.keys.length === 0; + }; -// Add any extra methods to Ember.Array that are native to the built-in Array. -/** - Returns a new array that is a slice of the receiver. This implementation - uses the observable array methods to retrieve the objects for the new - slice. - ```javascript - let arr = ['red', 'green', 'blue']; - arr.slice(0); // ['red', 'green', 'blue'] - arr.slice(0, 2); // ['red', 'green'] - arr.slice(1, 100); // ['green', 'blue'] - ``` - @method slice - @param {Number} beginIndex (Optional) index to begin slicing from. - @param {Number} endIndex (Optional) index to end the slice at (but not included). - @return {Array} New array with specified slice - @public -*/ + ObjectKeysIterator.prototype.next = function next() { + var keys = this.keys; + var values = this.values; + var keyFor = this.keyFor; + var position = this.position; + var seen = this.seen; -/** - Returns the index of the given object's first occurrence. - If no `startAt` argument is given, the starting location to - search is 0. If it's negative, will count backward from - the end of the array. Returns -1 if no match is found. - ```javascript - let arr = ['a', 'b', 'c', 'd', 'a']; - arr.indexOf('a'); // 0 - arr.indexOf('z'); // -1 - arr.indexOf('a', 2); // 4 - arr.indexOf('a', -1); // 4 - arr.indexOf('b', 3); // -1 - arr.indexOf('a', 100); // -1 - ``` - @method indexOf - @param {Object} object the item to search for - @param {Number} startAt optional starting location to search, default 0 - @return {Number} index or -1 if not found - @public -*/ + if (position >= keys.length) { + return null; + } -/** - Returns the index of the given object's last occurrence. - If no `startAt` argument is given, the search starts from - the last position. If it's negative, will count backward - from the end of the array. Returns -1 if no match is found. - ```javascript - let arr = ['a', 'b', 'c', 'd', 'a']; - arr.lastIndexOf('a'); // 4 - arr.lastIndexOf('z'); // -1 - arr.lastIndexOf('a', 2); // 0 - arr.lastIndexOf('a', -1); // 4 - arr.lastIndexOf('b', 3); // 1 - arr.lastIndexOf('a', 100); // 4 - ``` - @method lastIndexOf - @param {Object} object the item to search for - @param {Number} startAt optional starting location to search, default 0 - @return {Number} index or -1 if not found - @public -*/ + var value = values[position]; + var memo = keys[position]; + var key = ensureUniqueKey(seen, keyFor(value, memo)); -// .......................................................... -// ARRAY OBSERVERS -// + this.position++; -/** - Adds an array observer to the receiving array. The array observer object - normally must implement two methods: - * `arrayWillChange(observedObj, start, removeCount, addCount)` - This method will be - called just before the array is modified. - * `arrayDidChange(observedObj, start, removeCount, addCount)` - This method will be - called just after the array is modified. - Both callbacks will be passed the observed object, starting index of the - change as well as a count of the items to be removed and added. You can use - these callbacks to optionally inspect the array during the change, clear - caches, or do any other bookkeeping necessary. - In addition to passing a target, you can also include an options hash - which you can use to override the method names that will be invoked on the - target. - @method addArrayObserver - @param {Object} target The observer object. - @param {Object} opts Optional hash of configuration options including - `willChange` and `didChange` option. - @return {Ember.Array} receiver - @public -*/ + return { key: key, value: value, memo: memo }; + }; -/** - Removes an array observer from the object if the observer is current - registered. Calling this method multiple times with the same object will - have no effect. - @method removeArrayObserver - @param {Object} target The object observing the array. - @param {Object} opts Optional hash of configuration options including - `willChange` and `didChange` option. - @return {Ember.Array} receiver - @public -*/ + return ObjectKeysIterator; + })(); -/** - Becomes true whenever the array currently has observers watching changes - on the array. - @property {Boolean} hasArrayObservers - @public -*/ + var EmptyIterator = (function () { + function EmptyIterator() { + babelHelpers.classCallCheck(this, EmptyIterator); + } -/** - If you are implementing an object that supports `Ember.Array`, call this - method just before the array content changes to notify any observers and - invalidate any related properties. Pass the starting index of the change - as well as a delta of the amounts to change. - @method arrayContentWillChange - @param {Number} startIdx The starting index in the array that will change. - @param {Number} removeAmt The number of items that will be removed. If you - pass `null` assumes 0 - @param {Number} addAmt The number of items that will be added. If you - pass `null` assumes 0. - @return {Ember.Array} receiver - @public -*/ + EmptyIterator.prototype.isEmpty = function isEmpty() { + return true; + }; -/** - If you are implementing an object that supports `Ember.Array`, call this - method just after the array content changes to notify any observers and - invalidate any related properties. Pass the starting index of the change - as well as a delta of the amounts to change. - @method arrayContentDidChange - @param {Number} startIdx The starting index in the array that did change. - @param {Number} removeAmt The number of items that were removed. If you - pass `null` assumes 0 - @param {Number} addAmt The number of items that were added. If you - pass `null` assumes 0. - @return {Ember.Array} receiver - @public -*/ + EmptyIterator.prototype.next = function next() { + throw new Error('Cannot call next() on an empty iterator'); + }; -/** - Returns a special object that can be used to observe individual properties - on the array. Just get an equivalent property on this object and it will - return an enumerable that maps automatically to the named key on the - member objects. - `@each` should only be used in a non-terminal context. Example: - ```javascript - myMethod: computed('posts.@each.author', function(){ - ... - }); - ``` - If you merely want to watch for the array being changed, like an object being - replaced, added or removed, use `[]` instead of `@each`. - ```javascript - myMethod: computed('posts.[]', function(){ - ... - }); - ``` - @property @each - @public -*/ -enifed('ember-runtime/mixins/comparable', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; + return EmptyIterator; + })(); - /** - @module ember - @submodule ember-runtime - */ + var EMPTY_ITERATOR = new EmptyIterator(); - /** - Implements some standard methods for comparing objects. Add this mixin to - any class you create that can compare its instances. - - You should implement the `compare()` method. - - @class Comparable - @namespace Ember - @since Ember 0.9 - @private - */ - exports.default = _emberMetal.Mixin.create({ + var EachInIterable = (function () { + function EachInIterable(ref, keyFor) { + babelHelpers.classCallCheck(this, EachInIterable); - /** - __Required.__ You must implement this method to apply this mixin. - Override to return the result of the comparison of the two parameters. The - compare method should return: - - `-1` if `a < b` - - `0` if `a == b` - - `1` if `a > b` - Default implementation raises an exception. - @method compare - @param a {Object} the first object to compare - @param b {Object} the second object to compare - @return {Number} the result of the comparison - @private - */ - compare: null - }); -}); -enifed('ember-runtime/mixins/container_proxy', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-runtime - */ - 'use strict'; + this.ref = ref; + this.keyFor = keyFor; - /** - ContainerProxyMixin is used to provide public access to specific - container functionality. - - @class ContainerProxyMixin - @private - */ - exports.default = _emberMetal.Mixin.create({ - /** - The container stores state. - @private - @property {Ember.Container} __container__ - */ - __container__: null, + var valueTag = this.valueTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - /** - Returns an object that can be used to provide an owner to a - manually created instance. - Example: - ``` - let owner = Ember.getOwner(this); - User.create( - owner.ownerInjection(), - { username: 'rwjblue' } - ) - ``` - @public - @method ownerInjection - @return {Object} - */ - ownerInjection: function () { - return this.__container__.ownerInjection(); - }, + this.tag = _glimmerReference.combine([ref.tag, valueTag]); + } - /** - Given a fullName return a corresponding instance. - The default behaviour is for lookup to return a singleton instance. - The singleton is scoped to the container, allowing multiple containers - to all have their own locally scoped singletons. - ```javascript - let registry = new Registry(); - let container = registry.container(); - registry.register('api:twitter', Twitter); - let twitter = container.lookup('api:twitter'); - twitter instanceof Twitter; // => true - // by default the container will return singletons - let twitter2 = container.lookup('api:twitter'); - twitter2 instanceof Twitter; // => true - twitter === twitter2; //=> true - ``` - If singletons are not wanted an optional flag can be provided at lookup. - ```javascript - let registry = new Registry(); - let container = registry.container(); - registry.register('api:twitter', Twitter); - let twitter = container.lookup('api:twitter', { singleton: false }); - let twitter2 = container.lookup('api:twitter', { singleton: false }); - twitter === twitter2; //=> false - ``` - @public - @method lookup - @param {String} fullName - @param {Object} options - @return {any} - */ - lookup: function (fullName, options) { - return this.__container__.lookup(fullName, options); - }, + EachInIterable.prototype.iterate = function iterate() { + var ref = this.ref; + var keyFor = this.keyFor; + var valueTag = this.valueTag; - /** - Given a fullName return the corresponding factory. - @private - @method _lookupFactory - @param {String} fullName - @return {any} - */ - _lookupFactory: function (fullName, options) { - return this.__container__.lookupFactory(fullName, options); - }, + var iterable = ref.value(); - /** - Given a name and a source path, resolve the fullName - @private - @method _resolveLocalLookupName - @param {String} fullName - @param {String} source - @return {String} - */ - _resolveLocalLookupName: function (name, source) { - return this.__container__.registry.expandLocalLookup('component:' + name, { - source: source - }); - }, + valueTag.update(_emberMetal.tagFor(iterable)); - /** - @private - */ - willDestroy: function () { - this._super.apply(this, arguments); + if (_emberMetal.isProxy(iterable)) { + iterable = _emberMetal.get(iterable, 'content'); + } + + var typeofIterable = typeof iterable; - if (this.__container__) { - _emberMetal.run(this.__container__, 'destroy'); + if (iterable && (typeofIterable === 'object' || typeofIterable === 'function')) { + var keys = Object.keys(iterable); + var values = keys.map(function (key) { + return iterable[key]; + }); + return keys.length > 0 ? new ObjectKeysIterator(keys, values, keyFor) : EMPTY_ITERATOR; + } else { + return EMPTY_ITERATOR; } - } - }); -}); -enifed('ember-runtime/mixins/controller', ['exports', 'ember-metal', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/controller_content_model_alias_deprecation'], function (exports, _emberMetal, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsController_content_model_alias_deprecation) { - 'use strict'; + }; - /** - @class ControllerMixin - @namespace Ember - @uses Ember.ActionHandler - @private - */ - exports.default = _emberMetal.Mixin.create(_emberRuntimeMixinsAction_handler.default, _emberRuntimeMixinsController_content_model_alias_deprecation.default, { - /* ducktype as a controller */ - isController: true, + // {{each-in}} yields |key value| instead of |value key|, so the memo and + // value are flipped - /** - The object to which actions from the view should be sent. - For example, when a Handlebars template uses the `{{action}}` helper, - it will attempt to send the action to the view's controller's `target`. - By default, the value of the target property is set to the router, and - is injected when a controller is instantiated. This injection is applied - as part of the application's initialization process. In most cases the - `target` property will automatically be set to the logical consumer of - actions for the controller. - @property target - @default null - @public - */ - target: null, + EachInIterable.prototype.valueReferenceFor = function valueReferenceFor(item) { + return new _emberGlimmerUtilsReferences.UpdatablePrimitiveReference(item.memo); + }; - store: null, + EachInIterable.prototype.updateValueReference = function updateValueReference(reference, item) { + reference.update(item.memo); + }; - /** - The controller's current model. When retrieving or modifying a controller's - model, this property should be used instead of the `content` property. - @property model - @public - */ - model: null, + EachInIterable.prototype.memoReferenceFor = function memoReferenceFor(item) { + return new _emberGlimmerUtilsReferences.UpdatableReference(item.value); + }; - /** - @private - */ - content: _emberMetal.alias('model') + EachInIterable.prototype.updateMemoReference = function updateMemoReference(reference, item) { + reference.update(item.value); + }; - }); -}); -enifed('ember-runtime/mixins/controller_content_model_alias_deprecation', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; + return EachInIterable; + })(); - /* - The ControllerContentModelAliasDeprecation mixin is used to provide a useful - deprecation warning when specifying `content` directly on a `Ember.Controller` - (without also specifying `model`). - - Ember versions prior to 1.7 used `model` as an alias of `content`, but due to - much confusion this alias was reversed (so `content` is now an alias of `model). - - This change reduces many caveats with model/content, and also sets a - simple ground rule: Never set a controllers content, rather always set - its model and ember will do the right thing. - - Used internally by Ember in `Ember.Controller`. - */ - exports.default = _emberMetal.Mixin.create({ - /** - @private - Moves `content` to `model` at extend time if a `model` 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) { - // Calling super is only OK here since we KNOW that - // there is another Mixin loaded first. - this._super.apply(this, arguments); + var ArrayIterable = (function () { + function ArrayIterable(ref, keyFor) { + babelHelpers.classCallCheck(this, ArrayIterable); - var modelSpecified = !!props.model; + this.ref = ref; + this.keyFor = keyFor; - if (props.content && !modelSpecified) { - props.model = props.content; - delete props['content']; + var valueTag = this.valueTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - _emberMetal.deprecate('Do not specify `content` on a Controller, use `model` instead.', false, { id: 'ember-runtime.will-merge-mixin', until: '3.0.0' }); - } + this.tag = _glimmerReference.combine([ref.tag, valueTag]); } - }); -}); -enifed('ember-runtime/mixins/copyable', ['exports', 'ember-metal', 'ember-runtime/mixins/freezable'], function (exports, _emberMetal, _emberRuntimeMixinsFreezable) { - /** - @module ember - @submodule ember-runtime - */ - 'use strict'; + ArrayIterable.prototype.iterate = function iterate() { + var ref = this.ref; + var keyFor = this.keyFor; + var valueTag = this.valueTag; - /** - 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. - - You should generally implement the `copy()` method to return a copy of the - receiver. - - Note that `frozenCopy()` will only work if you also implement - `Ember.Freezable`. - - @class Copyable - @namespace Ember - @since Ember 0.9 - @private - */ - exports.default = _emberMetal.Mixin.create({ - /** - __Required.__ You must implement this method to apply this mixin. - Override to return a copy of the receiver. Default implementation raises - an exception. - @method copy - @param {Boolean} deep if `true`, a deep copy of the object should be made - @return {Object} copy of receiver - @private - */ - copy: null, + var iterable = ref.value(); - /** - If the object implements `Ember.Freezable`, then this will return a new - copy if the object is not frozen and the receiver if the object is frozen. - Raises an exception if you try to call this method on a object that does - not support freezing. - You should use this method whenever you want a copy of a freezable object - since a freezable object can simply return itself without actually - consuming more memory. - @method frozenCopy - @return {Object} copy of receiver or receiver - @deprecated Use `Object.freeze` instead. - @private - */ - frozenCopy: function () { - _emberMetal.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 _emberMetal.get(this, 'isFrozen') ? this : this.copy().freeze(); + valueTag.update(_emberMetal.tagForProperty(iterable, '[]')); + + if (!iterable || typeof iterable !== 'object') { + return EMPTY_ITERATOR; + } + + if (Array.isArray(iterable)) { + return iterable.length > 0 ? new ArrayIterator(iterable, keyFor) : EMPTY_ITERATOR; + } else if (_emberRuntime.isEmberArray(iterable)) { + return _emberMetal.get(iterable, 'length') > 0 ? new EmberArrayIterator(iterable, keyFor) : EMPTY_ITERATOR; + } else if (typeof iterable.forEach === 'function') { + var _ret = (function () { + var array = []; + iterable.forEach(function (item) { + array.push(item); + }); + return { + v: array.length > 0 ? new ArrayIterator(array, keyFor) : EMPTY_ITERATOR + }; + })(); + + if (typeof _ret === 'object') return _ret.v; } else { - throw new _emberMetal.Error(this + ' does not support freezing'); + return EMPTY_ITERATOR; } - } - }); -}); -enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/compare', 'require'], function (exports, _emberUtils, _emberMetal, _emberRuntimeCompare, _require) { - /** - @module ember - @submodule ember-runtime - */ + }; - // .......................................................... - // HELPERS - // + ArrayIterable.prototype.valueReferenceFor = function valueReferenceFor(item) { + return new _emberGlimmerUtilsReferences.UpdatableReference(item.value); + }; + + ArrayIterable.prototype.updateValueReference = function updateValueReference(reference, item) { + reference.update(item.value); + }; + + ArrayIterable.prototype.memoReferenceFor = function memoReferenceFor(item) { + return new _emberGlimmerUtilsReferences.UpdatablePrimitiveReference(item.memo); + }; + + ArrayIterable.prototype.updateMemoReference = function updateMemoReference(reference, item) { + reference.update(item.memo); + }; + return ArrayIterable; + })(); +}); +enifed('ember-glimmer/utils/process-args', ['exports', 'ember-utils', '@glimmer/reference', 'ember-glimmer/component', 'ember-glimmer/utils/references', 'ember-views', 'ember-glimmer/helpers/action', '@glimmer/runtime'], function (exports, _emberUtils, _glimmerReference, _emberGlimmerComponent, _emberGlimmerUtilsReferences, _emberViews, _emberGlimmerHelpersAction, _glimmerRuntime) { 'use strict'; - var _emberA = undefined; + exports.gatherArgs = gatherArgs; - function emberA() { - return (_emberA || (_emberA = _require.default('ember-runtime/system/native_array').A))(); + // Maps all variants of positional and dynamically scoped arguments + // into the named arguments. Input `args` and return value are both + // `EvaluatedArgs`. + + function gatherArgs(args, definition) { + var namedMap = gatherNamedMap(args, definition); + var positionalValues = gatherPositionalValues(args, definition); + return mergeArgs(namedMap, positionalValues, args.blocks, definition.ComponentClass.class); } - var contexts = []; + function gatherNamedMap(args, definition) { + var namedMap = args.named.map; + if (definition.args) { + return _emberUtils.assign({}, definition.args.named.map, namedMap); + } else { + return namedMap; + } + } - function popCtx() { - return contexts.length === 0 ? {} : contexts.pop(); + function gatherPositionalValues(args, definition) { + var positionalValues = args.positional.values; + if (definition.args) { + var oldPositional = definition.args.positional.values; + var newPositional = []; + newPositional.push.apply(newPositional, oldPositional); + newPositional.splice.apply(newPositional, [0, positionalValues.length].concat(positionalValues)); + return newPositional; + } else { + return positionalValues; + } } - function pushCtx(ctx) { - contexts.push(ctx); - return null; + function mergeArgs(namedMap, positionalValues, blocks, componentClass) { + var positionalParamsDefinition = componentClass.positionalParams; + + if (positionalParamsDefinition && positionalParamsDefinition.length > 0 && positionalValues.length > 0) { + if (typeof positionalParamsDefinition === 'string') { + namedMap = mergeRestArg(namedMap, positionalValues, positionalParamsDefinition); + } else { + namedMap = mergePositionalParams(namedMap, positionalValues, positionalParamsDefinition); + } + } + return _glimmerRuntime.EvaluatedArgs.named(namedMap, blocks); } - function iter(key, value) { - var valueProvided = arguments.length === 2; + var EMPTY_ARGS = { + tag: _glimmerReference.CONSTANT_TAG, + value: function () { + var _props; - function i(item) { - var cur = _emberMetal.get(item, key); - return valueProvided ? value === cur : !!cur; + return { attrs: {}, props: (_props = { attrs: {} }, _props[_emberGlimmerComponent.ARGS] = {}, _props) }; } + }; - return i; - } + // ComponentArgs takes EvaluatedNamedArgs and converts them into the + // inputs needed by CurlyComponents (attrs and props, with mutable + // cells, etc). - /** - This mixin defines the common interface implemented by enumerable objects - in Ember. Most of these methods follow the standard Array iteration - API defined up to JavaScript 1.8 (excluding language-specific features that - cannot be emulated in older versions of JavaScript). - - This mixin is applied automatically to the Array class on page load, so you - can use any of these methods on simple arrays. If Array already implements - one of these methods, the mixin will not override them. - - ## Writing Your Own Enumerable - - To make your own custom class enumerable, you need two items: - - 1. You must have a length property. This property should change whenever - the number of items in your enumerable object changes. If you use this - with an `Ember.Object` subclass, you should be sure to change the length - property using `set().` - - 2. You must implement `nextObject().` See documentation. - - Once you have these two methods implemented, apply the `Ember.Enumerable` mixin - to your class and you will be able to enumerate the contents of your object - like any other collection. - - ## Using Ember Enumeration with Other Libraries - - Many other libraries provide some kind of iterator or enumeration like - facility. This is often where the most common API conflicts occur. - Ember's API is designed to be as friendly as possible with other - libraries by implementing only methods that mostly correspond to the - JavaScript 1.8 API. - - @class Enumerable - @namespace Ember - @since Ember 0.9 - @private - */ - var Enumerable = _emberMetal.Mixin.create({ + var ComponentArgs = (function () { + ComponentArgs.create = function create(args) { + if (args.named.keys.length === 0) { + return EMPTY_ARGS; + } else { + return new ComponentArgs(args.named); + } + }; - /** - __Required.__ You must implement this method to apply this mixin. - Implement this method to make your class enumerable. - This method will be called repeatedly during enumeration. The index value - will always begin with 0 and increment monotonically. You don't have to - rely on the index value to determine what object to return, but you should - always check the value and start from the beginning when you see the - requested index is 0. - The `previousObject` is the object that was returned from the last call - to `nextObject` for the current iteration. This is a useful way to - manage iteration if you are tracing a linked list, for example. - Finally the context parameter will always contain a hash you can use as - a "scratchpad" to maintain any other state you need in order to iterate - properly. The context object is reused and is not reset between - iterations so make sure you setup the context with a fresh state whenever - the index parameter is 0. - Generally iterators will continue to call `nextObject` until the index - reaches the current length-1. If you run out of data before this - time for some reason, you should simply return undefined. - The default implementation of this method simply looks up the index. - This works great on any Array-like objects. - @method nextObject - @param {Number} index the current index of the iteration - @param {Object} previousObject the value returned by the last call to - `nextObject`. - @param {Object} context a context object you can use to maintain state. - @return {Object} the next object in the iteration or undefined - @private - */ - nextObject: null, + function ComponentArgs(namedArgs) { + babelHelpers.classCallCheck(this, ComponentArgs); - /** - Helper method returns the first object from a collection. This is usually - used by bindings and other parts of the framework to extract a single - object if the enumerable contains only one item. - If you override this method, you should implement it so that it will - always return the same value each time it is called. If your enumerable - contains only one object, this method should always return that object. - If your enumerable is empty, this method should return `undefined`. - ```javascript - let arr = ['a', 'b', 'c']; - arr.get('firstObject'); // 'a' - let arr = []; - arr.get('firstObject'); // undefined - ``` - @property firstObject - @return {Object} the object or undefined - @readOnly - @public - */ - firstObject: _emberMetal.computed('[]', function () { - if (_emberMetal.get(this, 'length') === 0) { - return undefined; + this.tag = namedArgs.tag; + this.namedArgs = namedArgs; + } + + ComponentArgs.prototype.value = function value() { + var namedArgs = this.namedArgs; + + var keys = namedArgs.keys; + var attrs = namedArgs.value(); + var props = new _emberUtils.EmptyObject(); + var args = new _emberUtils.EmptyObject(); + + props[_emberGlimmerComponent.ARGS] = args; + + for (var i = 0, l = keys.length; i < l; i++) { + var _name = keys[i]; + var ref = namedArgs.get(_name); + var value = attrs[_name]; + + if (typeof value === 'function' && value[_emberGlimmerHelpersAction.ACTION]) { + attrs[_name] = value; + } else if (ref[_emberGlimmerUtilsReferences.UPDATE]) { + attrs[_name] = new MutableCell(ref, value); + } + + args[_name] = ref; + props[_name] = value; } - // handle generic enumerables - var context = popCtx(); - var ret = this.nextObject(0, null, context); + props.attrs = attrs; - pushCtx(context); + return { attrs: attrs, props: props }; + }; - return ret; - }).readOnly(), + return ComponentArgs; + })(); - /** - Helper method returns the last object from a collection. If your enumerable - contains only one object, this method should always return that object. - If your enumerable is empty, this method should return `undefined`. - ```javascript - let arr = ['a', 'b', 'c']; - arr.get('lastObject'); // 'c' - let arr = []; - arr.get('lastObject'); // undefined - ``` - @property lastObject - @return {Object} the last object or undefined - @readOnly - @public - */ - lastObject: _emberMetal.computed('[]', function () { - var len = _emberMetal.get(this, 'length'); + exports.ComponentArgs = ComponentArgs; - if (len === 0) { - return undefined; - } + function mergeRestArg(namedMap, positionalValues, restArgName) { + var mergedNamed = _emberUtils.assign({}, namedMap); + mergedNamed[restArgName] = _glimmerRuntime.EvaluatedPositionalArgs.create(positionalValues); + return mergedNamed; + } - var context = popCtx(); - var idx = 0; - var last = null; - var cur = undefined; + function mergePositionalParams(namedMap, values, positionalParamNames) { + var mergedNamed = _emberUtils.assign({}, namedMap); + var length = Math.min(values.length, positionalParamNames.length); + for (var i = 0; i < length; i++) { + var _name2 = positionalParamNames[i]; + mergedNamed[_name2] = values[i]; + } + return mergedNamed; + } - do { - last = cur; - cur = this.nextObject(idx++, last, context); - } while (cur !== undefined); + var REF = _emberUtils.symbol('REF'); - pushCtx(context); + var MutableCell = (function () { + function MutableCell(ref, value) { + babelHelpers.classCallCheck(this, MutableCell); - return last; - }).readOnly(), + this[_emberViews.MUTABLE_CELL] = true; + this[REF] = ref; + this.value = value; + } - /** - Returns `true` if the passed object can be found in the receiver. The - default version will iterate through the enumerable until the object - is found. You may want to override this with a more efficient version. - ```javascript - let arr = ['a', 'b', 'c']; - arr.contains('a'); // true - arr.contains('z'); // false - ``` - @method contains - @deprecated Use `Enumerable#includes` instead. See http://emberjs.com/deprecations/v2.x#toc_enumerable-contains - @param {Object} obj The object to search for. - @return {Boolean} `true` if object is found in enumerable. - @public - */ - contains: function (obj) { - if (true) { - _emberMetal.deprecate('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.', false, { id: 'ember-runtime.enumerable-contains', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_enumerable-contains' }); - } + MutableCell.prototype.update = function update(val) { + this[REF][_emberGlimmerUtilsReferences.UPDATE](val); + }; - var found = this.find(function (item) { - return item === obj; - }); + return MutableCell; + })(); +}); +enifed('ember-glimmer/utils/references', ['exports', 'ember-utils', 'ember-metal', '@glimmer/reference', '@glimmer/runtime', 'ember-glimmer/utils/to-bool', 'ember-glimmer/helper'], function (exports, _emberUtils, _emberMetal, _glimmerReference, _glimmerRuntime, _emberGlimmerUtilsToBool, _emberGlimmerHelper) { + 'use strict'; - return found !== undefined; - }, + var UPDATE = _emberUtils.symbol('UPDATE'); - /** - Iterates through the enumerable, calling the passed function on each - item. This method corresponds to the `forEach()` method defined in - JavaScript 1.6. - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(item, index, enumerable); - ``` - - `item` is the current item in the iteration. - - `index` is the current index in the iteration. - - `enumerable` is the enumerable object itself. - Note that in addition to a callback, you can also pass an optional target - object that will be set as `this` on the context. This is a good way - 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 - @public - */ - forEach: function (callback, target) { - if (typeof callback !== 'function') { - throw new TypeError(); - } + exports.UPDATE = UPDATE; + exports.NULL_REFERENCE = _glimmerRuntime.NULL_REFERENCE; + exports.UNDEFINED_REFERENCE = _glimmerRuntime.UNDEFINED_REFERENCE; - var context = popCtx(); - var len = _emberMetal.get(this, 'length'); - var last = null; + // @abstract + // @implements PathReference - if (target === undefined) { - target = null; - } + var EmberPathReference = (function () { + function EmberPathReference() { + babelHelpers.classCallCheck(this, EmberPathReference); + } - for (var idx = 0; idx < len; idx++) { - var next = this.nextObject(idx, last, context); - callback.call(target, next, idx, this); - last = next; - } + // @abstract - last = null; - context = pushCtx(context); + // @abstract get tag() + // @abstract value() - return this; - }, + EmberPathReference.prototype.get = function get(key) { + return PropertyReference.create(this, key); + }; - /** - Alias for `mapBy` - @method getEach - @param {String} key name of the property - @return {Array} The mapped array. - @public - */ - getEach: _emberMetal.aliasMethod('mapBy'), + return EmberPathReference; + })(); - /** - Sets the value on the named property for each member. This is more - ergonomic than using other methods defined on this helper. If the object - implements Ember.Observable, the value will be changed to `set(),` otherwise - it will be set directly. `null` objects are skipped. - @method setEach - @param {String} key The key to set - @param {Object} value The object to set - @return {Object} receiver - @public - */ - setEach: function (key, value) { - return this.forEach(function (item) { - return _emberMetal.set(item, key, value); - }); - }, + var CachedReference = (function (_EmberPathReference) { + babelHelpers.inherits(CachedReference, _EmberPathReference); - /** - Maps all of the items in the enumeration to another value, returning - a new array. This method corresponds to `map()` defined in JavaScript 1.6. - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(item, index, enumerable); - ``` - - `item` is the current item in the iteration. - - `index` is the current index in the iteration. - - `enumerable` is the enumerable object itself. - It should return the mapped value. - Note that in addition to a callback, you can also pass an optional target - object that will be set as `this` on the context. This is a good way - to give your iterator function access to the current object. - @method map - @param {Function} callback The callback to execute - @param {Object} [target] The target object to use - @return {Array} The mapped array. - @public - */ - map: function (callback, target) { - var ret = emberA(); + function CachedReference() { + babelHelpers.classCallCheck(this, CachedReference); - this.forEach(function (x, idx, i) { - return ret[idx] = callback.call(target, x, idx, i); - }); + _EmberPathReference.call(this); + this._lastRevision = null; + this._lastValue = null; + } - return ret; - }, + // @implements PathReference - /** - Similar to map, this specialized function returns the value of the named - property on all items in the enumeration. - @method mapBy - @param {String} key name of the property - @return {Array} The mapped array. - @public - */ - mapBy: function (key) { - return this.map(function (next) { - return _emberMetal.get(next, key); - }); - }, + CachedReference.prototype.value = function value() { + var tag = this.tag; + var _lastRevision = this._lastRevision; + var _lastValue = this._lastValue; - /** - Returns an array with all of the items in the enumeration that the passed - function returns true for. This method corresponds to `filter()` defined in - JavaScript 1.6. - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(item, index, enumerable); - ``` - - `item` is the current item in the iteration. - - `index` is the current index in the iteration. - - `enumerable` is the enumerable object itself. - It should return `true` to include the item in the results, `false` - otherwise. - Note that in addition to a callback, you can also pass an optional target - object that will be set as `this` on the context. This is a good way - to give your iterator function access to the current object. - @method filter - @param {Function} callback The callback to execute - @param {Object} [target] The target object to use - @return {Array} A filtered array. - @public - */ - filter: function (callback, target) { - var ret = emberA(); + if (!_lastRevision || !tag.validate(_lastRevision)) { + _lastValue = this._lastValue = this.compute(); + this._lastRevision = tag.value(); + } - this.forEach(function (x, idx, i) { - if (callback.call(target, x, idx, i)) { - ret.push(x); - } - }); + return _lastValue; + }; - return ret; - }, + // @abstract compute() + return CachedReference; + })(EmberPathReference); - /** - Returns an array with all of the items in the enumeration where the passed - function returns false. This method is the inverse of filter(). - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(item, index, enumerable); - ``` - - *item* is the current item in the iteration. - - *index* is the current index in the iteration - - *enumerable* is the enumerable object itself. - It should return a falsey value to include the item in the results. - Note that in addition to a callback, you can also pass an optional target - object that will be set as "this" on the context. This is a good way - to give your iterator function access to the current object. - @method reject - @param {Function} callback The callback to execute - @param {Object} [target] The target object to use - @return {Array} A rejected array. - @public - */ - reject: function (callback, target) { - return this.filter(function () { - return !callback.apply(target, arguments); - }); - }, + exports.CachedReference = CachedReference; - /** - Returns an array with just the items with the matched property. You - can pass an optional second argument with the target value. Otherwise - this will match any property that evaluates to `true`. - @method filterBy - @param {String} key the property to test - @param {*} [value] optional value to test against. - @return {Array} filtered array - @public - */ - filterBy: function (key, value) { - return this.filter(iter.apply(this, arguments)); - }, + var RootReference = (function (_ConstReference) { + babelHelpers.inherits(RootReference, _ConstReference); - /** - Returns an array with the items that do not have truthy values for - key. You can pass an optional second argument with the target value. Otherwise - this will match any property that evaluates to false. - @method rejectBy - @param {String} key the property to test - @param {String} [value] optional value to test against. - @return {Array} rejected array - @public - */ - rejectBy: function (key, value) { - var exactValue = function (item) { - return _emberMetal.get(item, key) === value; - }; - var hasValue = function (item) { - return !!_emberMetal.get(item, key); - }; - var use = arguments.length === 2 ? exactValue : hasValue; + function RootReference(value) { + babelHelpers.classCallCheck(this, RootReference); - return this.reject(use); - }, + _ConstReference.call(this, value); + this.children = new _emberUtils.EmptyObject(); + } - /** - Returns the first item in the array for which the callback returns true. - This method works similar to the `filter()` method defined in JavaScript 1.6 - except that it will stop working on the array once a match is found. - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(item, index, enumerable); - ``` - - `item` is the current item in the iteration. - - `index` is the current index in the iteration. - - `enumerable` is the enumerable object itself. - It should return the `true` to include the item in the results, `false` - otherwise. - Note that in addition to a callback, you can also pass an optional target - object that will be set as `this` on the context. This is a good way - to give your iterator function access to the current object. - @method find - @param {Function} callback The callback to execute - @param {Object} [target] The target object to use - @return {Object} Found item or `undefined`. - @public - */ - find: function (callback, target) { - var len = _emberMetal.get(this, 'length'); + RootReference.prototype.get = function get(propertyKey) { + var ref = this.children[propertyKey]; - if (target === undefined) { - target = null; + if (!ref) { + ref = this.children[propertyKey] = new RootPropertyReference(this.inner, propertyKey); } - var context = popCtx(); - var found = false; - var last = null; - var next = undefined, - ret = undefined; + return ref; + }; - for (var idx = 0; idx < len && !found; idx++) { - next = this.nextObject(idx, last, context); + return RootReference; + })(_glimmerReference.ConstReference); - if (found = callback.call(target, next, idx, this)) { - ret = next; - } + exports.RootReference = RootReference; - last = next; + var TwoWayFlushDetectionTag = undefined; + + if (true || true) { + TwoWayFlushDetectionTag = (function () { + function _class(tag, key, ref) { + babelHelpers.classCallCheck(this, _class); + + this.tag = tag; + this.parent = null; + this.key = key; + this.ref = ref; } - next = last = null; - context = pushCtx(context); + _class.prototype.value = function value() { + return this.tag.value(); + }; - return ret; - }, + _class.prototype.validate = function validate(ticket) { + var parent = this.parent; + var key = this.key; - /** - Returns the first item with a property matching the passed value. You - can pass an optional second argument with the target value. Otherwise - this will match any property that evaluates to `true`. - This method works much like the more generic `find()` method. - @method findBy - @param {String} key the property to test - @param {String} [value] optional value to test against. - @return {Object} found item or `undefined` - @public - */ - findBy: function (key, value) { - return this.find(iter.apply(this, arguments)); - }, + var isValid = this.tag.validate(ticket); - /** - Returns `true` if the passed function returns true for every item in the - enumeration. This corresponds with the `every()` method in JavaScript 1.6. - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(item, index, enumerable); - ``` - - `item` is the current item in the iteration. - - `index` is the current index in the iteration. - - `enumerable` is the enumerable object itself. - It should return the `true` or `false`. - Note that in addition to a callback, you can also pass an optional target - object that will be set as `this` on the context. This is a good way - to give your iterator function access to the current object. - Example Usage: - ```javascript - if (people.every(isEngineer)) { - Paychecks.addBigBonus(); - } - ``` - @method every - @param {Function} callback The callback to execute - @param {Object} [target] The target object to use - @return {Boolean} - @public - */ - every: function (callback, target) { - return !this.find(function (x, idx, i) { - return !callback.call(target, x, idx, i); - }); - }, + if (isValid && parent) { + _emberMetal.didRender(parent, key, this.ref); + } - /** - Returns `true` if the passed property resolves to the value of the second - argument for all items in the enumerable. This method is often simpler/faster - than using a callback. - @method isEvery - @param {String} key the property to test - @param {String} [value] optional value to test against. Defaults to `true` - @return {Boolean} - @since 1.3.0 - @public - */ - isEvery: function (key, value) { - return this.every(iter.apply(this, arguments)); - }, + return isValid; + }; - /** - Returns `true` if the passed function returns true for any item in the - enumeration. This corresponds with the `some()` method in JavaScript 1.6. - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(item, index, enumerable); - ``` - - `item` is the current item in the iteration. - - `index` is the current index in the iteration. - - `enumerable` is the enumerable object itself. - It should return the `true` to include the item in the results, `false` - otherwise. - Note that in addition to a callback, you can also pass an optional target - object that will be set as `this` on the context. This is a good way - to give your iterator function access to the current object. - Usage Example: - ```javascript - if (people.any(isManager)) { - Paychecks.addBiggerBonus(); - } - ``` - @method any - @param {Function} callback The callback to execute - @param {Object} [target] The target object to use - @return {Boolean} `true` if the passed function returns `true` for any item - @public - */ - any: function (callback, target) { - var len = _emberMetal.get(this, 'length'); - var context = popCtx(); - var found = false; - var last = null; - var next = undefined; + _class.prototype.didCompute = function didCompute(parent) { + this.parent = parent; + _emberMetal.didRender(parent, this.key, this.ref); + }; - if (target === undefined) { - target = null; - } + return _class; + })(); + } - for (var idx = 0; idx < len && !found; idx++) { - next = this.nextObject(idx, last, context); - found = callback.call(target, next, idx, this); - last = next; - } + var PropertyReference = (function (_CachedReference) { + babelHelpers.inherits(PropertyReference, _CachedReference); - next = last = null; - context = pushCtx(context); - return found; - }, + function PropertyReference() { + babelHelpers.classCallCheck(this, PropertyReference); - /** - Returns `true` if the passed property resolves to the value of the second - argument for any item in the enumerable. This method is often simpler/faster - than using a callback. - @method isAny - @param {String} key the property to test - @param {String} [value] optional value to test against. Defaults to `true` - @return {Boolean} - @since 1.3.0 - @public - */ - isAny: function (key, value) { - return this.any(iter.apply(this, arguments)); - }, + _CachedReference.apply(this, arguments); + } - /** - This will combine the values of the enumerator into a single value. It - is a useful way to collect a summary value from an enumeration. This - corresponds to the `reduce()` method defined in JavaScript 1.8. - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(previousValue, item, index, enumerable); - ``` - - `previousValue` is the value returned by the last call to the iterator. - - `item` is the current item in the iteration. - - `index` is the current index in the iteration. - - `enumerable` is the enumerable object itself. - Return the new cumulative value. - In addition to the callback you can also pass an `initialValue`. An error - will be raised if you do not pass an initial value and the enumerator is - empty. - Note that unlike the other methods, this method does not allow you to - pass a target object to set as this for the callback. It's part of the - spec. Sorry. - @method reduce - @param {Function} callback The callback to execute - @param {Object} initialValue Initial value for the reduce - @param {String} reducerProperty internal use only. - @return {Object} The reduced value. - @public - */ - reduce: function (callback, initialValue, reducerProperty) { - if (typeof callback !== 'function') { - throw new TypeError(); + PropertyReference.create = function create(parentReference, propertyKey) { + if (_glimmerReference.isConst(parentReference)) { + return new RootPropertyReference(parentReference.value(), propertyKey); + } else { + return new NestedPropertyReference(parentReference, propertyKey); } + }; - var ret = initialValue; + PropertyReference.prototype.get = function get(key) { + return new NestedPropertyReference(this, key); + }; - this.forEach(function (item, i) { - ret = callback(ret, item, i, this, reducerProperty); - }, this); + return PropertyReference; + })(CachedReference); - return ret; - }, + exports.PropertyReference = PropertyReference; - /** - Invokes the named method on every object in the receiver that - implements it. This method corresponds to the implementation in - Prototype 1.6. - @method invoke - @param {String} methodName the name of the method - @param {Object...} args optional arguments to pass as well. - @return {Array} return values from calling invoke. - @public - */ - invoke: function (methodName) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; + var RootPropertyReference = (function (_PropertyReference) { + babelHelpers.inherits(RootPropertyReference, _PropertyReference); + + function RootPropertyReference(parentValue, propertyKey) { + babelHelpers.classCallCheck(this, RootPropertyReference); + + _PropertyReference.call(this); + + this._parentValue = parentValue; + this._propertyKey = propertyKey; + + if (true || true) { + this.tag = new TwoWayFlushDetectionTag(_emberMetal.tagForProperty(parentValue, propertyKey), propertyKey, this); + } else { + this.tag = _emberMetal.tagForProperty(parentValue, propertyKey); } - var ret = emberA(); + if (true) { + _emberMetal.watchKey(parentValue, propertyKey); + } + } - this.forEach(function (x, idx) { - var method = x && x[methodName]; + RootPropertyReference.prototype.compute = function compute() { + var _parentValue = this._parentValue; + var _propertyKey = this._propertyKey; - if ('function' === typeof method) { - ret[idx] = args ? method.apply(x, args) : x[methodName](); - } - }, this); + if (true || true) { + this.tag.didCompute(_parentValue); + } - return ret; - }, + return _emberMetal.get(_parentValue, _propertyKey); + }; - /** - Simply converts the enumerable into a genuine array. The order is not - guaranteed. Corresponds to the method implemented by Prototype. - @method toArray - @return {Array} the enumerable as an array. - @public - */ - toArray: function () { - var ret = emberA(); + RootPropertyReference.prototype[UPDATE] = function (value) { + _emberMetal.set(this._parentValue, this._propertyKey, value); + }; - this.forEach(function (o, idx) { - return ret[idx] = o; - }); + return RootPropertyReference; + })(PropertyReference); - return ret; - }, + exports.RootPropertyReference = RootPropertyReference; - /** - Returns a copy of the array with all `null` and `undefined` elements removed. - ```javascript - let arr = ['a', null, 'c', undefined]; - arr.compact(); // ['a', 'c'] - ``` - @method compact - @return {Array} the array without null and undefined elements. - @public - */ - compact: function () { - return this.filter(function (value) { - return value != null; - }); - }, + var NestedPropertyReference = (function (_PropertyReference2) { + babelHelpers.inherits(NestedPropertyReference, _PropertyReference2); - /** - Returns a new enumerable that excludes the passed value. The default - implementation returns an array regardless of the receiver type. - If the receiver does not contain the value it returns the original enumerable. - ```javascript - let arr = ['a', 'b', 'a', 'c']; - arr.without('a'); // ['b', 'c'] - ``` - @method without - @param {Object} value - @return {Ember.Enumerable} - @public - */ - without: function (value) { - if (!this.contains(value)) { - return this; // nothing to do + function NestedPropertyReference(parentReference, propertyKey) { + babelHelpers.classCallCheck(this, NestedPropertyReference); + + _PropertyReference2.call(this); + + var parentReferenceTag = parentReference.tag; + var parentObjectTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); + + this._parentReference = parentReference; + this._parentObjectTag = parentObjectTag; + this._propertyKey = propertyKey; + + if (true || true) { + var tag = _glimmerReference.combine([parentReferenceTag, parentObjectTag]); + this.tag = new TwoWayFlushDetectionTag(tag, propertyKey, this); + } else { + this.tag = _glimmerReference.combine([parentReferenceTag, parentObjectTag]); } + } - var ret = emberA(); + NestedPropertyReference.prototype.compute = function compute() { + var _parentReference = this._parentReference; + var _parentObjectTag = this._parentObjectTag; + var _propertyKey = this._propertyKey; - this.forEach(function (k) { - if (k !== value) { - ret[ret.length] = k; - } - }); + var parentValue = _parentReference.value(); - return ret; - }, + _parentObjectTag.update(_emberMetal.tagForProperty(parentValue, _propertyKey)); - /** - Returns a new enumerable that contains only unique values. The default - implementation returns an array regardless of the receiver type. - ```javascript - let arr = ['a', 'a', 'b', 'b']; - arr.uniq(); // ['a', 'b'] - ``` - This only works on primitive data types, e.g. Strings, Numbers, etc. - @method uniq - @return {Ember.Enumerable} - @public - */ - uniq: function () { - var ret = emberA(); + if (typeof parentValue === 'string' && _propertyKey === 'length') { + return parentValue.length; + } - this.forEach(function (k) { - if (ret.indexOf(k) < 0) { - ret.push(k); + if (typeof parentValue === 'object' && parentValue) { + if (true) { + _emberMetal.watchKey(parentValue, _propertyKey); } - }); - return ret; - }, + if (true || true) { + this.tag.didCompute(parentValue); + } - /** - This property will trigger anytime the enumerable's content changes. - You can observe this property to be notified of changes to the enumerable's - content. - For plain enumerables, this property is read only. `Array` overrides - this method. - @property [] - @type Array - @return this - @private - */ - '[]': _emberMetal.computed({ - get: function (key) { - return this; + return _emberMetal.get(parentValue, _propertyKey); + } else { + return undefined; } - }), + }; - // .......................................................... - // ENUMERABLE OBSERVERS - // + NestedPropertyReference.prototype[UPDATE] = function (value) { + var parent = this._parentReference.value(); + _emberMetal.set(parent, this._propertyKey, value); + }; - /** - Registers an enumerable observer. Must implement `Ember.EnumerableObserver` - mixin. - @method addEnumerableObserver - @param {Object} target - @param {Object} [opts] - @return this - @private - */ - addEnumerableObserver: function (target, opts) { - var willChange = opts && opts.willChange || 'enumerableWillChange'; - var didChange = opts && opts.didChange || 'enumerableDidChange'; - var hasObservers = _emberMetal.get(this, 'hasEnumerableObservers'); + return NestedPropertyReference; + })(PropertyReference); - if (!hasObservers) { - _emberMetal.propertyWillChange(this, 'hasEnumerableObservers'); - } + exports.NestedPropertyReference = NestedPropertyReference; - _emberMetal.addListener(this, '@enumerable:before', target, willChange); - _emberMetal.addListener(this, '@enumerable:change', target, didChange); + var UpdatableReference = (function (_EmberPathReference2) { + babelHelpers.inherits(UpdatableReference, _EmberPathReference2); - if (!hasObservers) { - _emberMetal.propertyDidChange(this, 'hasEnumerableObservers'); - } + function UpdatableReference(value) { + babelHelpers.classCallCheck(this, UpdatableReference); - return this; - }, + _EmberPathReference2.call(this); - /** - Removes a registered enumerable observer. - @method removeEnumerableObserver - @param {Object} target - @param {Object} [opts] - @return this - @private - */ - removeEnumerableObserver: function (target, opts) { - var willChange = opts && opts.willChange || 'enumerableWillChange'; - var didChange = opts && opts.didChange || 'enumerableDidChange'; - var hasObservers = _emberMetal.get(this, 'hasEnumerableObservers'); + this.tag = new _glimmerReference.DirtyableTag(); + this._value = value; + } - if (hasObservers) { - _emberMetal.propertyWillChange(this, 'hasEnumerableObservers'); - } + UpdatableReference.prototype.value = function value() { + return this._value; + }; - _emberMetal.removeListener(this, '@enumerable:before', target, willChange); - _emberMetal.removeListener(this, '@enumerable:change', target, didChange); + UpdatableReference.prototype.update = function update(value) { + var _value = this._value; - if (hasObservers) { - _emberMetal.propertyDidChange(this, 'hasEnumerableObservers'); + if (value !== _value) { + this.tag.dirty(); + this._value = value; } + }; - return this; - }, + return UpdatableReference; + })(EmberPathReference); - /** - Becomes true whenever the array currently has observers watching changes - on the array. - @property hasEnumerableObservers - @type Boolean - @private - */ - hasEnumerableObservers: _emberMetal.computed(function () { - return _emberMetal.hasListeners(this, '@enumerable:change') || _emberMetal.hasListeners(this, '@enumerable:before'); - }), + exports.UpdatableReference = UpdatableReference; - /** - Invoke this method just before the contents of your enumerable will - change. You can either omit the parameters completely or pass the objects - to be removed or added if available or just a count. - @method enumerableContentWillChange - @param {Ember.Enumerable|Number} removing An enumerable of the objects to - be removed or the number of items to be removed. - @param {Ember.Enumerable|Number} adding An enumerable of the objects to be - added or the number of items to be added. - @chainable - @private - */ - enumerableContentWillChange: function (removing, adding) { - var removeCnt = undefined, - addCnt = undefined, - hasDelta = undefined; + var UpdatablePrimitiveReference = (function (_UpdatableReference) { + babelHelpers.inherits(UpdatablePrimitiveReference, _UpdatableReference); - if ('number' === typeof removing) { - removeCnt = removing; - } else if (removing) { - removeCnt = _emberMetal.get(removing, 'length'); - } else { - removeCnt = removing = -1; + function UpdatablePrimitiveReference() { + babelHelpers.classCallCheck(this, UpdatablePrimitiveReference); + + _UpdatableReference.apply(this, arguments); + } + + UpdatablePrimitiveReference.prototype.get = function get() { + return _glimmerRuntime.UNDEFINED_REFERENCE; + }; + + return UpdatablePrimitiveReference; + })(UpdatableReference); + + exports.UpdatablePrimitiveReference = UpdatablePrimitiveReference; + + var ConditionalReference = (function (_GlimmerConditionalReference) { + babelHelpers.inherits(ConditionalReference, _GlimmerConditionalReference); + + ConditionalReference.create = function create(reference) { + if (_glimmerReference.isConst(reference)) { + var value = reference.value(); + + if (_emberMetal.isProxy(value)) { + return new RootPropertyReference(value, 'isTruthy'); + } else { + return _glimmerRuntime.PrimitiveReference.create(_emberGlimmerUtilsToBool.default(value)); + } } - if ('number' === typeof adding) { - addCnt = adding; - } else if (adding) { - addCnt = _emberMetal.get(adding, 'length'); + return new ConditionalReference(reference); + }; + + function ConditionalReference(reference) { + babelHelpers.classCallCheck(this, ConditionalReference); + + _GlimmerConditionalReference.call(this, reference); + + this.objectTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); + this.tag = _glimmerReference.combine([reference.tag, this.objectTag]); + } + + ConditionalReference.prototype.toBool = function toBool(predicate) { + if (_emberMetal.isProxy(predicate)) { + this.objectTag.update(_emberMetal.tagForProperty(predicate, 'isTruthy')); + return _emberMetal.get(predicate, 'isTruthy'); } else { - addCnt = adding = -1; + this.objectTag.update(_emberMetal.tagFor(predicate)); + return _emberGlimmerUtilsToBool.default(predicate); } + }; - hasDelta = addCnt < 0 || removeCnt < 0 || addCnt - removeCnt !== 0; + return ConditionalReference; + })(_glimmerRuntime.ConditionalReference); - if (removing === -1) { - removing = null; - } + exports.ConditionalReference = ConditionalReference; - if (adding === -1) { - adding = null; - } + var SimpleHelperReference = (function (_CachedReference2) { + babelHelpers.inherits(SimpleHelperReference, _CachedReference2); - _emberMetal.propertyWillChange(this, '[]'); + SimpleHelperReference.create = function create(helper, args) { + if (_glimmerReference.isConst(args)) { + var _ret = (function () { + var positional = args.positional; + var named = args.named; - if (hasDelta) { - _emberMetal.propertyWillChange(this, 'length'); + var positionalValue = positional.value(); + var namedValue = named.value(); + + _emberMetal.runInDebug(function () { + if (_emberUtils.HAS_NATIVE_WEAKMAP) { + Object.freeze(positionalValue); + Object.freeze(namedValue); + } + }); + + var result = helper(positionalValue, namedValue); + + if (result === null) { + return { + v: _glimmerRuntime.NULL_REFERENCE + }; + } else if (result === undefined) { + return { + v: _glimmerRuntime.UNDEFINED_REFERENCE + }; + } else if (typeof result === 'object') { + return { + v: new RootReference(result) + }; + } else { + return { + v: _glimmerRuntime.PrimitiveReference.create(result) + }; + } + })(); + + if (typeof _ret === 'object') return _ret.v; + } else { + return new SimpleHelperReference(helper, args); } + }; - _emberMetal.sendEvent(this, '@enumerable:before', [this, removing, adding]); + function SimpleHelperReference(helper, args) { + babelHelpers.classCallCheck(this, SimpleHelperReference); - return this; - }, + _CachedReference2.call(this); - /** - Invoke this method when the contents of your enumerable has changed. - This will notify any observers watching for content changes. If you are - implementing an ordered enumerable (such as an array), also pass the - start and end values where the content changed so that it can be used to - notify range observers. - @method enumerableContentDidChange - @param {Ember.Enumerable|Number} removing An enumerable of the objects to - be removed or the number of items to be removed. - @param {Ember.Enumerable|Number} adding An enumerable of the objects to - be added or the number of items to be added. - @chainable - @private - */ - enumerableContentDidChange: function (removing, adding) { - var removeCnt = undefined, - addCnt = undefined, - hasDelta = undefined; + this.tag = args.tag; + this.helper = helper; + this.args = args; + } + + SimpleHelperReference.prototype.compute = function compute() { + var helper = this.helper; + var _args = this.args; + var positional = _args.positional; + var named = _args.named; + + var positionalValue = positional.value(); + var namedValue = named.value(); - if ('number' === typeof removing) { - removeCnt = removing; - } else if (removing) { - removeCnt = _emberMetal.get(removing, 'length'); - } else { - removeCnt = removing = -1; - } + _emberMetal.runInDebug(function () { + if (_emberUtils.HAS_NATIVE_WEAKMAP) { + Object.freeze(positionalValue); + Object.freeze(namedValue); + } + }); - if ('number' === typeof adding) { - addCnt = adding; - } else if (adding) { - addCnt = _emberMetal.get(adding, 'length'); - } else { - addCnt = adding = -1; - } + return helper(positionalValue, namedValue); + }; - hasDelta = addCnt < 0 || removeCnt < 0 || addCnt - removeCnt !== 0; + return SimpleHelperReference; + })(CachedReference); - if (removing === -1) { - removing = null; - } + exports.SimpleHelperReference = SimpleHelperReference; - if (adding === -1) { - adding = null; - } + var ClassBasedHelperReference = (function (_CachedReference3) { + babelHelpers.inherits(ClassBasedHelperReference, _CachedReference3); - _emberMetal.sendEvent(this, '@enumerable:change', [this, removing, adding]); + ClassBasedHelperReference.create = function create(helperClass, vm, args) { + var instance = helperClass.create(); + vm.newDestroyable(instance); + return new ClassBasedHelperReference(instance, args); + }; - if (hasDelta) { - _emberMetal.propertyDidChange(this, 'length'); - } + function ClassBasedHelperReference(instance, args) { + babelHelpers.classCallCheck(this, ClassBasedHelperReference); - _emberMetal.propertyDidChange(this, '[]'); + _CachedReference3.call(this); - return this; - }, + this.tag = _glimmerReference.combine([instance[_emberGlimmerHelper.RECOMPUTE_TAG], args.tag]); + this.instance = instance; + this.args = args; + } - /** - Converts the enumerable into an array and sorts by the keys - specified in the argument. - 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 - @public - */ - sortBy: function () { - var sortKeys = arguments; + ClassBasedHelperReference.prototype.compute = function compute() { + var instance = this.instance; + var _args2 = this.args; + var positional = _args2.positional; + var named = _args2.named; - return this.toArray().sort(function (a, b) { - for (var i = 0; i < sortKeys.length; i++) { - var key = sortKeys[i]; - var propA = _emberMetal.get(a, key); - var propB = _emberMetal.get(b, key); - // return 1 or -1 else continue to the next sortKey - var compareValue = _emberRuntimeCompare.default(propA, propB); + var positionalValue = positional.value(); + var namedValue = named.value(); - if (compareValue) { - return compareValue; - } + _emberMetal.runInDebug(function () { + if (_emberUtils.HAS_NATIVE_WEAKMAP) { + Object.freeze(positionalValue); + Object.freeze(namedValue); } - return 0; }); - } - }); - 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 - let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }]; - arr.uniqBy('value'); // [{ value: 'a' }, { value: 'b' }] - ``` - @method uniqBy - @return {Ember.Enumerable} - @public - */ + return instance.compute(positionalValue, namedValue); + }; - uniqBy: function (key) { - var ret = emberA(); - var seen = new _emberUtils.EmptyObject(); + return ClassBasedHelperReference; + })(CachedReference); - this.forEach(function (item) { - var guid = _emberUtils.guidFor(_emberMetal.get(item, key)); - if (!(guid in seen)) { - seen[guid] = true; - ret.push(item); - } - }); + exports.ClassBasedHelperReference = ClassBasedHelperReference; - return ret; - } - }); - } + var InternalHelperReference = (function (_CachedReference4) { + babelHelpers.inherits(InternalHelperReference, _CachedReference4); - if (true) { - 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) { - _emberMetal.assert('Enumerable#includes cannot accept a second argument "startAt" as enumerable items are unordered.', arguments.length === 1); + function InternalHelperReference(helper, args) { + babelHelpers.classCallCheck(this, InternalHelperReference); - var len = _emberMetal.get(this, 'length'); - var idx = undefined, - next = undefined; - var last = null; - var found = false; + _CachedReference4.call(this); - var context = popCtx(); + this.tag = args.tag; + this.helper = helper; + this.args = args; + } - for (idx = 0; idx < len && !found; idx++) { - next = this.nextObject(idx, last, context); + // @implements PathReference - found = obj === next || obj !== obj && next !== next; + InternalHelperReference.prototype.compute = function compute() { + var helper = this.helper; + var args = this.args; - last = next; - } + return helper(args); + }; - next = last = null; - context = pushCtx(context); + return InternalHelperReference; + })(CachedReference); - return found; - }, + exports.InternalHelperReference = InternalHelperReference; - without: function (value) { - if (!this.includes(value)) { - return this; // nothing to do - } + var UnboundReference = (function (_ConstReference2) { + babelHelpers.inherits(UnboundReference, _ConstReference2); - var ret = emberA(); + function UnboundReference() { + babelHelpers.classCallCheck(this, UnboundReference); - this.forEach(function (k) { - // SameValueZero comparison (NaN !== NaN) - if (!(k === value || k !== k && value !== value)) { - ret[ret.length] = k; - } - }); + _ConstReference2.apply(this, arguments); + } - return ret; + UnboundReference.create = function create(value) { + if (value === null) { + return _glimmerRuntime.NULL_REFERENCE; + } else if (value === undefined) { + return _glimmerRuntime.UNDEFINED_REFERENCE; + } else if (typeof value === 'object') { + return new UnboundReference(value); + } else { + return _glimmerRuntime.PrimitiveReference.create(value); } - }); - } + }; - exports.default = Enumerable; -}); -enifed('ember-runtime/mixins/evented', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; + UnboundReference.prototype.get = function get(key) { + return new UnboundReference(_emberMetal.get(this.inner, key)); + }; + + return UnboundReference; + })(_glimmerReference.ConstReference); + exports.UnboundReference = UnboundReference; +}); +enifed('ember-glimmer/utils/string', ['exports', 'ember-metal'], function (exports, _emberMetal) { /** @module ember - @submodule ember-runtime + @submodule ember-glimmer */ - /** - This mixin allows for Ember objects to subscribe to and emit events. - - ```javascript - App.Person = Ember.Object.extend(Ember.Evented, { - greet: function() { - // ... - this.trigger('greet'); - } - }); - - var person = App.Person.create(); - - person.on('greet', function() { - console.log('Our person has greeted'); - }); - - person.greet(); - - // outputs: 'Our person has greeted' - ``` - - You can also chain multiple event subscriptions: - - ```javascript - person.on('greet', function() { - console.log('Our person has greeted'); - }).one('greet', function() { - console.log('Offer one-time special'); - }).off('event', this, forgetThis); - ``` - - @class Evented - @namespace Ember - @public - */ - exports.default = _emberMetal.Mixin.create({ + 'use strict'; - /** - Subscribes to a named event with given function. - ```javascript - person.on('didLoad', function() { - // fired once the person has loaded - }); - ``` - An optional target can be passed in as the 2nd argument that will - be set as the "this" for the callback. This is a good way to give your - function access to the object triggering the event. When the target - parameter is used the callback becomes the third argument. - @method on - @param {String} name The name of the event - @param {Object} [target] The "this" binding for the callback - @param {Function} method The callback to execute - @return this - @public - */ - on: function (name, target, method) { - _emberMetal.addListener(this, name, target, method); - return this; - }, + exports.getSafeString = getSafeString; + exports.escapeExpression = escapeExpression; + exports.htmlSafe = htmlSafe; + exports.isHTMLSafe = isHTMLSafe; - /** - Subscribes a function to a named event and then cancels the subscription - after the first time the event is triggered. It is good to use ``one`` when - you only care about the first time an event has taken place. - This function takes an optional 2nd argument that will become the "this" - value for the callback. If this argument is passed then the 3rd argument - becomes the function. - @method one - @param {String} name The name of the event - @param {Object} [target] The "this" binding for the callback - @param {Function} method The callback to execute - @return this - @public - */ - one: function (name, target, method) { - if (!method) { - method = target; - target = null; - } + var SafeString = (function () { + function SafeString(string) { + babelHelpers.classCallCheck(this, SafeString); - _emberMetal.addListener(this, name, target, method, true); - return this; - }, + this.string = string; + } - /** - Triggers a named event for the object. Any additional arguments - will be passed as parameters to the functions that are subscribed to the - event. - ```javascript - person.on('didEat', function(food) { - console.log('person ate some ' + food); - }); - person.trigger('didEat', 'broccoli'); - // outputs: person ate some broccoli - ``` - @method trigger - @param {String} name The name of the event - @param {Object...} args Optional arguments to pass on - @public - */ - trigger: function (name) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } + SafeString.prototype.toString = function toString() { + return '' + this.string; + }; - _emberMetal.sendEvent(this, name, args); - }, + SafeString.prototype.toHTML = function toHTML() { + return this.toString(); + }; - /** - Cancels subscription for given name, target, and method. - @method off - @param {String} name The name of the event - @param {Object} target The target of the subscription - @param {Function} method The function of the subscription - @return this - @public - */ - off: function (name, target, method) { - _emberMetal.removeListener(this, name, target, method); - return this; - }, + return SafeString; + })(); - /** - Checks to see if object has any subscriptions for named event. - @method has - @param {String} name The name of the event - @return {Boolean} does the object have a subscription for event - @public - */ - has: function (name) { - return _emberMetal.hasListeners(this, name); + exports.SafeString = SafeString; + + function getSafeString() { + _emberMetal.deprecate('Ember.Handlebars.SafeString is deprecated in favor of Ember.String.htmlSafe', false, { + id: 'ember-htmlbars.ember-handlebars-safestring', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x#toc_use-ember-string-htmlsafe-over-ember-handlebars-safestring' + }); + + return SafeString; + } + + var escape = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + // jscs:disable + "'": ''', + // jscs:enable + '`': '`', + '=': '=' + }; + + var possible = /[&<>"'`=]/; + var badChars = /[&<>"'`=]/g; + + function escapeChar(chr) { + return escape[chr]; + } + + function escapeExpression(string) { + if (typeof string !== 'string') { + // don't escape SafeStrings, since they're already safe + if (string && string.toHTML) { + return string.toHTML(); + } else if (string == null) { + return ''; + } else if (!string) { + return string + ''; + } + + // Force a string conversion as this will be done by the append regardless and + // the regex test will do this transparently behind the scenes, causing issues if + // an object's to string has escaped characters in it. + string = '' + string; } - }); -}); -enifed('ember-runtime/mixins/freezable', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-runtime - */ - 'use strict'; + if (!possible.test(string)) { + return string; + } + return string.replace(badChars, escapeChar); + } /** - 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. - - ## Enforcement - - To fully support freezing in your subclass, you must include this mixin and - override any method that might alter any property on the object to instead - raise an exception. You can check the state of an object by checking the - `isFrozen` property. - - Although future versions of JavaScript may support language-level freezing - object objects, that is not the case today. Even if an object is freezable, - it is still technically possible to modify the object, even though it could - break other parts of your application that do not expect a frozen object to - change. It is, therefore, very important that you always respect the - `isFrozen` property on all freezable objects. - - ## Example Usage - - The example below shows a simple object that implement the `Ember.Freezable` - protocol. + 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. ```javascript - Contact = Ember.Object.extend(Ember.Freezable, { - firstName: null, - lastName: null, - - // swaps the names - swapNames: function() { - if (this.get('isFrozen')) throw Ember.FROZEN_ERROR; - var tmp = this.get('firstName'); - this.set('firstName', this.get('lastName')); - this.set('lastName', tmp); - return this; - } - - }); - - c = Contact.create({ firstName: "John", lastName: "Doe" }); - c.swapNames(); // returns c - c.freeze(); - c.swapNames(); // EXCEPTION + Ember.String.htmlSafe('
    someString
    ') ``` - ## Copying - - Usually the `Ember.Freezable` protocol is implemented in cooperation with the - `Ember.Copyable` protocol, which defines a `frozenCopy()` method that will - return a frozen object, if the object implements this method as well. - - @class Freezable - @namespace Ember - @since Ember 0.9 - @deprecated Use `Object.freeze` instead. - @private + @method htmlSafe + @for Ember.String + @static + @return {Handlebars.SafeString} A string that will not be HTML escaped by Handlebars. + @public */ - var Freezable = _emberMetal.Mixin.create({ - - init: function () { - _emberMetal.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 - whether your object is frozen or not. - @property isFrozen - @type Boolean - @private - */ - isFrozen: false, - - /** - Freezes the object. Once this method has been called the object should - no longer allow any properties to be edited. - @method freeze - @return {Object} receiver - @private - */ - freeze: function () { - if (_emberMetal.get(this, 'isFrozen')) { - return this; - } - _emberMetal.set(this, 'isFrozen', true); - return this; + function htmlSafe(str) { + if (str === null || str === undefined) { + str = ''; + } else if (typeof str !== 'string') { + str = '' + str; } + return new SafeString(str); + } - }); - - exports.Freezable = Freezable; - var FROZEN_ERROR = 'Frozen object cannot be modified.'; - exports.FROZEN_ERROR = FROZEN_ERROR; -}); -enifed('ember-runtime/mixins/mutable_array', ['exports', 'ember-metal', 'ember-runtime/mixins/array', 'ember-runtime/mixins/mutable_enumerable', 'ember-runtime/mixins/enumerable'], function (exports, _emberMetal, _emberRuntimeMixinsArray, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeMixinsEnumerable) { /** - @module ember - @submodule ember-runtime + Detects if a string was decorated using `Ember.String.htmlSafe`. + + ```javascript + var plainString = 'plain string', + safeString = Ember.String.htmlSafe('
    someValue
    '); + + Ember.String.isHTMLSafe(plainString); // false + Ember.String.isHTMLSafe(safeString); // true + ``` + + @method isHTMLSafe + @for Ember.String + @static + @return {Boolean} `true` if the string was decorated with `htmlSafe`, `false` otherwise. + @public */ + function isHTMLSafe(str) { + return str && typeof str.toHTML === 'function'; + } +}); +enifed('ember-glimmer/utils/to-bool', ['exports', 'ember-runtime', 'ember-metal'], function (exports, _emberRuntime, _emberMetal) { 'use strict'; - exports.removeAt = removeAt; - var OUT_OF_RANGE_EXCEPTION = 'Index out of range'; - var EMPTY = []; - - // .......................................................... - // HELPERS - // + exports.default = toBool; - function removeAt(array, start, len) { - if ('number' === typeof start) { - if (start < 0 || start >= _emberMetal.get(array, 'length')) { - throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); - } + function toBool(predicate) { + if (!predicate) { + return false; + } - // fast case - if (len === undefined) { - len = 1; - } + if (predicate === true) { + return true; + } - array.replace(start, len, EMPTY); + if (_emberRuntime.isArray(predicate)) { + return _emberMetal.get(predicate, 'length') !== 0; } - return array; + return true; } - +}); +enifed('ember-glimmer/views/outlet', ['exports', 'ember-utils', '@glimmer/reference', 'ember-environment', 'ember-metal'], function (exports, _emberUtils, _glimmerReference, _emberEnvironment, _emberMetal) { /** - 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. - - It is important to use the methods in this class to modify arrays so that - changes are observable. This allows the binding system in Ember to function - correctly. - - - Note that an Array can change even if it does not implement this mixin. - For example, one might implement a SparseArray that cannot be directly - modified, but if its underlying enumerable changes, it will change also. - - @class MutableArray - @namespace Ember - @uses Ember.Array - @uses Ember.MutableEnumerable - @public + @module ember + @submodule ember-glimmer */ - exports.default = _emberMetal.Mixin.create(_emberRuntimeMixinsArray.default, _emberRuntimeMixinsMutable_enumerable.default, { + 'use strict'; - /** - __Required.__ You must implement this method to apply this mixin. - This is one of the primitives you must implement to support `Ember.Array`. - You should replace amt objects started at idx with the objects in the - passed array. You should also call `this.enumerableContentDidChange()` - @method replace - @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* - @public - */ - replace: null, + var OutletStateReference = (function () { + function OutletStateReference(outletView) { + babelHelpers.classCallCheck(this, OutletStateReference); - /** - Remove all elements from the array. This is useful if you - want to reuse an existing array without having to recreate it. - ```javascript - let colors = ['red', 'green', 'blue']; - color.length(); // 3 - colors.clear(); // [] - colors.length(); // 0 - ``` - @method clear - @return {Ember.Array} An empty Array. - @public - */ - clear: function () { - var len = _emberMetal.get(this, 'length'); - if (len === 0) { - return this; - } + this.outletView = outletView; + this.tag = outletView._tag; + } - this.replace(0, len, EMPTY); - return this; - }, + // So this is a relic of the past that SHOULD go away + // in 3.0. Preferably it is deprecated in the release that + // follows the Glimmer release. - /** - This will use the primitive `replace()` method to insert an object at the - specified index. - ```javascript - let colors = ['red', 'green', 'blue']; - colors.insertAt(2, 'yellow'); // ['red', 'green', 'yellow', 'blue'] - colors.insertAt(5, 'orange'); // Error: Index out of range - ``` - @method insertAt - @param {Number} idx index of insert the object at. - @param {Object} object object to insert - @return {Ember.Array} receiver - @public - */ - insertAt: function (idx, object) { - if (idx > _emberMetal.get(this, 'length')) { - throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); - } + OutletStateReference.prototype.get = function get(key) { + return new ChildOutletStateReference(this, key); + }; - this.replace(idx, 0, [object]); - return this; - }, + OutletStateReference.prototype.value = function value() { + return this.outletView.outletState; + }; - /** - Remove an object at the specified index using the `replace()` primitive - method. You can pass either a single index, or a start and a length. - If you pass a start and length that is beyond the - length this method will throw an `OUT_OF_RANGE_EXCEPTION`. - ```javascript - let colors = ['red', 'green', 'blue', 'yellow', 'orange']; - colors.removeAt(0); // ['green', 'blue', 'yellow', 'orange'] - colors.removeAt(2, 2); // ['green', 'blue'] - colors.removeAt(4, 2); // Error: Index out of range - ``` - @method removeAt - @param {Number} start index, start of range - @param {Number} len length of passing range - @return {Ember.Array} receiver - @public - */ - removeAt: function (start, len) { - return removeAt(this, start, len); - }, + OutletStateReference.prototype.getOrphan = function getOrphan(name) { + return new OrphanedOutletStateReference(this, name); + }; - /** - Push the object onto the end of the array. Works just like `push()` but it - is KVO-compliant. - ```javascript - let colors = ['red', 'green']; - colors.pushObject('black'); // ['red', 'green', 'black'] - colors.pushObject(['yellow']); // ['red', 'green', ['yellow']] - ``` - @method pushObject - @param {*} obj object to push - @return object same object passed as a param - @public - */ - pushObject: function (obj) { - this.insertAt(_emberMetal.get(this, 'length'), obj); - return obj; - }, + OutletStateReference.prototype.update = function update(state) { + this.outletView.setOutletState(state); + }; - /** - Add the objects in the passed numerable to the end of the array. Defers - notifying observers of the change until all objects are added. - ```javascript - let colors = ['red']; - colors.pushObjects(['yellow', 'orange']); // ['red', 'yellow', 'orange'] - ``` - @method pushObjects - @param {Ember.Enumerable} objects the objects to add - @return {Ember.Array} receiver - @public - */ - pushObjects: function (objects) { - if (!(_emberRuntimeMixinsEnumerable.default.detect(objects) || Array.isArray(objects))) { - throw new TypeError('Must pass Ember.Enumerable to Ember.MutableArray#pushObjects'); - } - this.replace(_emberMetal.get(this, 'length'), 0, objects); - return this; - }, + return OutletStateReference; + })(); - /** - Pop object from array or nil if none are left. Works just like `pop()` but - it is KVO-compliant. - ```javascript - let colors = ['red', 'green', 'blue']; - colors.popObject(); // 'blue' - console.log(colors); // ['red', 'green'] - ``` - @method popObject - @return object - @public - */ - popObject: function () { - var len = _emberMetal.get(this, 'length'); - if (len === 0) { + var OrphanedOutletStateReference = (function (_OutletStateReference) { + babelHelpers.inherits(OrphanedOutletStateReference, _OutletStateReference); + + function OrphanedOutletStateReference(root, name) { + babelHelpers.classCallCheck(this, OrphanedOutletStateReference); + + _OutletStateReference.call(this, root.outletView); + this.root = root; + this.name = name; + } + + OrphanedOutletStateReference.prototype.value = function value() { + var rootState = this.root.value(); + + var orphans = rootState.outlets.main.outlets.__ember_orphans__; + + if (!orphans) { return null; } - var ret = _emberRuntimeMixinsArray.objectAt(this, len - 1); - this.removeAt(len - 1, 1); - return ret; - }, + var matched = orphans.outlets[this.name]; - /** - Shift an object from start of array or nil if none are left. Works just - like `shift()` but it is KVO-compliant. - ```javascript - let colors = ['red', 'green', 'blue']; - colors.shiftObject(); // 'red' - console.log(colors); // ['green', 'blue'] - ``` - @method shiftObject - @return object - @public - */ - shiftObject: function () { - if (_emberMetal.get(this, 'length') === 0) { + if (!matched) { return null; } - var ret = _emberRuntimeMixinsArray.objectAt(this, 0); - this.removeAt(0); - return ret; - }, + var state = new _emberUtils.EmptyObject(); + state[matched.render.outlet] = matched; + matched.wasUsed = true; + return { outlets: state }; + }; - /** - Unshift an object to start of array. Works just like `unshift()` but it is - KVO-compliant. - ```javascript - let colors = ['red']; - colors.unshiftObject('yellow'); // ['yellow', 'red'] - colors.unshiftObject(['black']); // [['black'], 'yellow', 'red'] - ``` - @method unshiftObject - @param {*} obj object to unshift - @return object same object passed as a param - @public - */ - unshiftObject: function (obj) { - this.insertAt(0, obj); - return obj; - }, + return OrphanedOutletStateReference; + })(OutletStateReference); - /** - Adds the named objects to the beginning of the array. Defers notifying - observers until all objects have been added. - ```javascript - let colors = ['red']; - colors.unshiftObjects(['black', 'white']); // ['black', 'white', 'red'] - colors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function - ``` - @method unshiftObjects - @param {Ember.Enumerable} objects the objects to add - @return {Ember.Array} receiver - @public - */ - unshiftObjects: function (objects) { - this.replace(0, 0, objects); - return this; - }, + var ChildOutletStateReference = (function () { + function ChildOutletStateReference(parent, key) { + babelHelpers.classCallCheck(this, ChildOutletStateReference); - /** - Reverse objects in the array. Works just like `reverse()` but it is - KVO-compliant. - @method reverseObjects - @return {Ember.Array} receiver - @public - */ - reverseObjects: function () { - var len = _emberMetal.get(this, 'length'); - if (len === 0) { - return this; - } + this.parent = parent; + this.key = key; + this.tag = parent.tag; + } - var objects = this.toArray().reverse(); - this.replace(0, len, objects); - return this; - }, + ChildOutletStateReference.prototype.get = function get(key) { + return new ChildOutletStateReference(this, key); + }; - /** - Replace all the receiver's content with content of the argument. - If argument is an empty array receiver will be cleared. - ```javascript - let colors = ['red', 'green', 'blue']; - colors.setObjects(['black', 'white']); // ['black', 'white'] - colors.setObjects([]); // [] - ``` - @method setObjects - @param {Ember.Array} objects array whose content will be used for replacing - the content of the receiver - @return {Ember.Array} receiver with the new content - @public - */ - setObjects: function (objects) { - if (objects.length === 0) { - return this.clear(); - } + ChildOutletStateReference.prototype.value = function value() { + return this.parent.value()[this.key]; + }; - var len = _emberMetal.get(this, 'length'); - this.replace(0, len, objects); - return this; - }, + return ChildOutletStateReference; + })(); - // .......................................................... - // IMPLEMENT Ember.MutableEnumerable - // + var OutletView = (function () { + OutletView.extend = function extend(injections) { + return (function (_OutletView) { + babelHelpers.inherits(_class, _OutletView); - /** - Remove all occurrences of an object in the array. - ```javascript - let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago']; - cities.removeObject('Chicago'); // ['Berlin', 'Lima'] - cities.removeObject('Lima'); // ['Berlin'] - cities.removeObject('Tokyo') // ['Berlin'] - ``` - @method removeObject - @param {*} obj object to remove - @return {Ember.Array} receiver - @public - */ - removeObject: function (obj) { - var loc = _emberMetal.get(this, 'length') || 0; - while (--loc >= 0) { - var curObject = _emberRuntimeMixinsArray.objectAt(this, loc); + function _class() { + babelHelpers.classCallCheck(this, _class); - if (curObject === obj) { - this.removeAt(loc); + _OutletView.apply(this, arguments); } - } - return this; - }, - /** - Push the object onto the end of the array if it is not already - present in the array. - ```javascript - let cities = ['Chicago', 'Berlin']; - cities.addObject('Lima'); // ['Chicago', 'Berlin', 'Lima'] - cities.addObject('Berlin'); // ['Chicago', 'Berlin', 'Lima'] - ``` - @method addObject - @param {*} obj object to add, if not already present - @return {Ember.Array} receiver - @public - */ - addObject: function (obj) { - var included = undefined; + _class.create = function create(options) { + if (options) { + return _OutletView.create.call(this, _emberUtils.assign({}, injections, options)); + } else { + return _OutletView.create.call(this, injections); + } + }; - if (true) { - included = this.includes(obj); + return _class; + })(OutletView); + }; + + OutletView.reopenClass = function reopenClass(injections) { + _emberUtils.assign(this, injections); + }; + + OutletView.create = function create(options) { + var _environment = options._environment; + var renderer = options.renderer; + var template = options.template; + + var owner = options[_emberUtils.OWNER]; + return new OutletView(_environment, renderer, owner, template); + }; + + function OutletView(_environment, renderer, owner, template) { + babelHelpers.classCallCheck(this, OutletView); + + this._environment = _environment; + this.renderer = renderer; + this.owner = owner; + this.template = template; + this.outletState = null; + this._tag = new _glimmerReference.DirtyableTag(); + } + + OutletView.prototype.appendTo = function appendTo(selector) { + var env = this._environment || _emberEnvironment.environment; + var target = undefined; + + if (env.hasDOM) { + target = typeof selector === 'string' ? document.querySelector(selector) : selector; } else { - included = this.contains(obj); + target = selector; } - if (!included) { - this.pushObject(obj); - } + _emberMetal.run.schedule('render', this.renderer, 'appendOutletView', this, target); + }; - return this; - } - }); + OutletView.prototype.rerender = function rerender() {}; + + OutletView.prototype.setOutletState = function setOutletState(state) { + this.outletState = { + outlets: { + main: state + }, + render: { + owner: undefined, + into: undefined, + outlet: 'main', + name: '-top-level', + controller: undefined, + ViewClass: undefined, + template: undefined + } + }; + this._tag.dirty(); + }; + + OutletView.prototype.toReference = function toReference() { + return new OutletStateReference(this); + }; + + OutletView.prototype.destroy = function destroy() {}; + + return OutletView; + })(); + + exports.default = OutletView; }); -enifed('ember-runtime/mixins/mutable_enumerable', ['exports', 'ember-runtime/mixins/enumerable', 'ember-metal'], function (exports, _emberRuntimeMixinsEnumerable, _emberMetal) { +enifed('ember-metal/alias', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/error', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/meta', 'ember-metal/dependent_keys'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalError, _emberMetalProperties, _emberMetalComputed, _emberMetalMeta, _emberMetalDependent_keys) { 'use strict'; - /** - @module ember - @submodule ember-runtime - */ + exports.default = alias; - /** - This mixin defines the API for modifying generic enumerables. These methods - can be applied to an object regardless of whether it is ordered or - unordered. - - Note that an Enumerable can change even if it does not implement this mixin. - For example, a MappedEnumerable cannot be directly modified but if its - underlying enumerable changes, it will change also. - - ## Adding Objects - - To add an object to an enumerable, use the `addObject()` method. This - method will only add the object to the enumerable if the object is not - already present and is of a type supported by the enumerable. - - ```javascript - set.addObject(contact); - ``` - - ## Removing Objects - - To remove an object from an enumerable, use the `removeObject()` method. This - will only remove the object if it is present in the enumerable, otherwise - this method has no effect. - - ```javascript - set.removeObject(contact); - ``` - - ## Implementing In Your Own Code - - If you are implementing an object and want to support this API, just include - this mixin in your class and implement the required methods. In your unit - tests, be sure to apply the Ember.MutableEnumerableTests to your object. - - @class MutableEnumerable - @namespace Ember - @uses Ember.Enumerable - @public - */ - exports.default = _emberMetal.Mixin.create(_emberRuntimeMixinsEnumerable.default, { + var CONSUMED = {}; - /** - __Required.__ You must implement this method to apply this mixin. - Attempts to add the passed object to the receiver if the object is not - already present in the collection. If the object is present, this method - has no effect. - If the passed object is of a type not supported by the receiver, - then this method should raise an exception. - @method addObject - @param {Object} object The object to add to the enumerable. - @return {Object} the passed object - @public - */ - addObject: null, + function alias(altKey) { + return new AliasedProperty(altKey); + } + + var AliasedProperty = (function (_Descriptor) { + babelHelpers.inherits(AliasedProperty, _Descriptor); + + function AliasedProperty(altKey) { + babelHelpers.classCallCheck(this, AliasedProperty); + + _Descriptor.call(this); + this.isDescriptor = true; + this.altKey = altKey; + this._dependentKeys = [altKey]; + } + + AliasedProperty.prototype.setup = function setup(obj, keyName) { + _emberMetalDebug.assert('Setting alias \'' + keyName + '\' on self', this.altKey !== keyName); + var meta = _emberMetalMeta.meta(obj); + if (meta.peekWatching(keyName)) { + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); + } + }; - /** - Adds each object in the passed enumerable to the receiver. - @method addObjects - @param {Ember.Enumerable} objects the objects to add. - @return {Object} receiver - @public - */ - addObjects: function (objects) { - var _this = this; + AliasedProperty.prototype.teardown = function teardown(obj, keyName) { + var meta = _emberMetalMeta.meta(obj); + if (meta.peekWatching(keyName)) { + _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); + } + }; - _emberMetal.beginPropertyChanges(this); - objects.forEach(function (obj) { - return _this.addObject(obj); - }); - _emberMetal.endPropertyChanges(this); - return this; - }, + AliasedProperty.prototype.willWatch = function willWatch(obj, keyName) { + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); + }; - /** - __Required.__ You must implement this method to apply this mixin. - Attempts to remove the passed object from the receiver collection if the - object is present in the collection. If the object is not present, - this method has no effect. - If the passed object is of a type not supported by the receiver, - then this method should raise an exception. - @method removeObject - @param {Object} object The object to remove from the enumerable. - @return {Object} the passed object - @public - */ - removeObject: null, + AliasedProperty.prototype.didUnwatch = function didUnwatch(obj, keyName) { + _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); + }; - /** - Removes each object in the passed enumerable from the receiver. - @method removeObjects - @param {Ember.Enumerable} objects the objects to remove - @return {Object} receiver - @public - */ - removeObjects: function (objects) { - _emberMetal.beginPropertyChanges(this); - for (var i = objects.length - 1; i >= 0; i--) { - this.removeObject(objects[i]); + AliasedProperty.prototype.get = function get(obj, keyName) { + var ret = _emberMetalProperty_get.get(obj, this.altKey); + var meta = _emberMetalMeta.meta(obj); + var cache = meta.writableCache(); + if (cache[keyName] !== CONSUMED) { + cache[keyName] = CONSUMED; + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); } - _emberMetal.endPropertyChanges(this); + return ret; + }; + + AliasedProperty.prototype.set = function set(obj, keyName, value) { + return _emberMetalProperty_set.set(obj, this.altKey, value); + }; + + AliasedProperty.prototype.readOnly = function readOnly() { + this.set = AliasedProperty_readOnlySet; return this; - } - }); + }; + + AliasedProperty.prototype.oneWay = function oneWay() { + this.set = AliasedProperty_oneWaySet; + return this; + }; + + return AliasedProperty; + })(_emberMetalProperties.Descriptor); + + exports.AliasedProperty = AliasedProperty; + + function AliasedProperty_readOnlySet(obj, keyName, value) { + throw new _emberMetalError.default('Cannot set read-only property \'' + keyName + '\' on object: ' + _emberUtils.inspect(obj)); + } + + function AliasedProperty_oneWaySet(obj, keyName, value) { + _emberMetalProperties.defineProperty(obj, keyName, null); + return _emberMetalProperty_set.set(obj, keyName, value); + } + + // Backwards compatibility with Ember Data. + AliasedProperty.prototype._meta = undefined; + AliasedProperty.prototype.meta = _emberMetalComputed.ComputedProperty.prototype.meta; }); -enifed('ember-runtime/mixins/observable', ['exports', 'ember-metal'], function (exports, _emberMetal) { +enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember-environment', 'ember-metal/run_loop', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/events', 'ember-metal/observer', 'ember-metal/path_cache'], function (exports, _emberUtils, _emberConsole, _emberEnvironment, _emberMetalRun_loop, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalEvents, _emberMetalObserver, _emberMetalPath_cache) { + 'use strict'; + + exports.bind = bind; + /** @module ember - @submodule ember-runtime + @submodule ember-metal */ - 'use strict'; + // .......................................................... + // BINDING + // - /** - ## Overview - - This mixin provides properties and property observing functionality, core - features of the Ember object model. - - Properties and observers allow one object to observe changes to a - property on another object. This is one of the fundamental ways that - models, controllers and views communicate with each other in an Ember - application. - - Any object that has this mixin applied can be used in observer - operations. That includes `Ember.Object` and most objects you will - interact with as you write your Ember application. - - Note that you will not generally apply this mixin to classes yourself, - but you will use the features provided by this module frequently, so it - is important to understand how to use it. - - ## Using `get()` and `set()` - - Because of Ember's support for bindings and observers, you will always - access properties using the get method, and set properties using the - set method. This allows the observing objects to be notified and - computed properties to be handled properly. - - More documentation about `get` and `set` are below. - - ## Observing Property Changes - - You typically observe property changes simply by using the `Ember.observer` - function in classes that you write. - - For example: - - ```javascript - Ember.Object.extend({ - valueObserver: Ember.observer('value', function(sender, key, value, rev) { - // Executes whenever the "value" property changes - // See the addObserver method for more information about the callback arguments - }) - }); - ``` - - Although this is the most common way to add an observer, this capability - is actually built into the `Ember.Object` class on top of two methods - defined in this mixin: `addObserver` and `removeObserver`. You can use - these two methods to add and remove observers yourself if you need to - do so at runtime. - - To add an observer for a property, call: - - ```javascript - object.addObserver('propertyKey', targetObject, targetAction) - ``` - - This will call the `targetAction` method on the `targetObject` whenever - the value of the `propertyKey` changes. - - Note that if `propertyKey` is a computed property, the observer will be - called when any of the property dependencies are changed, even if the - resulting value of the computed property is unchanged. This is necessary - because computed properties are not computed until `get` is called. - - @class Observable - @namespace Ember - @public - */ - exports.default = _emberMetal.Mixin.create({ + var Binding = (function () { + function Binding(toPath, fromPath) { + babelHelpers.classCallCheck(this, Binding); + + // Configuration + this._from = fromPath; + this._to = toPath; + this._oneWay = undefined; + + // State + this._direction = undefined; + this._readyToSync = undefined; + this._fromObj = undefined; + this._fromPath = undefined; + this._toObj = undefined; + } /** - Retrieves the value of a property from the object. - This method is usually similar to using `object[keyName]` or `object.keyName`, - however it supports both computed properties and the unknownProperty - handler. - Because `get` unifies the syntax for accessing all these kinds - of properties, it can make many refactorings easier, such as replacing a - simple property with a computed property, or vice versa. - ### Computed Properties - Computed properties are methods defined with the `property` modifier - declared at the end, such as: - ```javascript - fullName: Ember.computed('firstName', 'lastName', function() { - return this.get('firstName') + ' ' + this.get('lastName'); - }) - ``` - When you call `get` on a computed property, the function will be - called and the return value will be returned instead of the function - itself. - ### Unknown Properties - Likewise, if you try to call `get` on a property whose value is - `undefined`, the `unknownProperty()` method will be called on the object. - If this method returns any value other than `undefined`, it will be returned - instead. This allows you to implement "virtual" properties that are - not defined upfront. - @method get - @param {String} keyName The property to retrieve - @return {Object} The property value or undefined. + @class Binding + @namespace Ember + @deprecated See http://emberjs.com/deprecations/v2.x#toc_ember-binding @public */ - get: function (keyName) { - return _emberMetal.get(this, keyName); - }, /** - To get the values of multiple properties at once, call `getProperties` - with a list of strings or an array: - ```javascript - record.getProperties('firstName', 'lastName', 'zipCode'); - // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } - ``` - is equivalent to: - ```javascript - record.getProperties(['firstName', 'lastName', 'zipCode']); - // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } - ``` - @method getProperties - @param {String...|Array} list of keys to get - @return {Object} + This copies the Binding so it can be connected to another object. + @method copy + @return {Ember.Binding} `this` @public */ - getProperties: function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - return _emberMetal.getProperties.apply(null, [this].concat(args)); - }, + Binding.prototype.copy = function copy() { + var copy = new Binding(this._to, this._from); + if (this._oneWay) { + copy._oneWay = true; + } + return copy; + }; - /** - Sets the provided key or path to the value. - ```javascript - record.set("key", value); - ``` - This method is generally very similar to calling `object["key"] = value` or - `object.key = value`, except that it provides support for computed - properties, the `setUnknownProperty()` method and property observers. - ### Computed Properties - If you try to set a value on a key that has a computed property handler - defined (see the `get()` method for an example), then `set()` will call - that method, passing both the value and key instead of simply changing - the value itself. This is useful for those times when you need to - implement a property that is composed of one or more member - properties. - ### Unknown Properties - If you try to set a value on a key that is undefined in the target - object, then the `setUnknownProperty()` handler will be called instead. This - gives you an opportunity to implement complex "virtual" properties that - are not predefined on the object. If `setUnknownProperty()` returns - undefined, then `set()` will simply set the value on the object. - ### Property Observers - In addition to changing the property, `set()` will also register a property - change with the object. Unless you have placed this call inside of a - `beginPropertyChanges()` and `endPropertyChanges(),` any "local" observers - (i.e. observer methods declared on the same object), will be called - immediately. Any "remote" observers (i.e. observer methods declared on - another object) will be placed in a queue and called at a later time in a - coalesced manner. - @method set - @param {String} keyName The property to set - @param {Object} value The value to set or `null`. - @return {Object} The passed value - @public - */ - set: function (keyName, value) { - return _emberMetal.set(this, keyName, value); - }, + // .......................................................... + // CONFIG + // /** - Sets a list of properties at once. These properties are set inside - a single `beginPropertyChanges` and `endPropertyChanges` batch, so - observers will be buffered. - ```javascript - record.setProperties({ firstName: 'Charles', lastName: 'Jolley' }); - ``` - @method setProperties - @param {Object} hash the hash of keys and values to set - @return {Object} The passed in hash + This will set `from` property path to the specified value. It will not + attempt to resolve this property path to an actual object until you + connect the binding. + The binding will search for the property path starting at the root object + you pass when you `connect()` the binding. It follows the same rules as + `get()` - see that method for more information. + @method from + @param {String} path The property path to connect to. + @return {Ember.Binding} `this` @public */ - setProperties: function (hash) { - return _emberMetal.setProperties(this, hash); - }, - - /** - Begins a grouping of property changes. - You can use this method to group property changes so that notifications - will not be sent until the changes are finished. If you plan to make a - large number of changes to an object at one time, you should call this - method at the beginning of the changes to begin deferring change - notifications. When you are done making changes, call - `endPropertyChanges()` to deliver the deferred change notifications and end - deferring. - @method beginPropertyChanges - @return {Ember.Observable} - @private - */ - beginPropertyChanges: function () { - _emberMetal.beginPropertyChanges(); - return this; - }, - /** - Ends a grouping of property changes. - You can use this method to group property changes so that notifications - will not be sent until the changes are finished. If you plan to make a - large number of changes to an object at one time, you should call - `beginPropertyChanges()` at the beginning of the changes to defer change - notifications. When you are done making changes, call this method to - deliver the deferred change notifications and end deferring. - @method endPropertyChanges - @return {Ember.Observable} - @private - */ - endPropertyChanges: function () { - _emberMetal.endPropertyChanges(); + Binding.prototype.from = function from(path) { + this._from = path; return this; - }, + }; /** - Notify the observer system that a property is about to change. - Sometimes you need to change a value directly or indirectly without - actually calling `get()` or `set()` on it. In this case, you can use this - method and `propertyDidChange()` instead. Calling these two methods - together will notify all observers that the property has potentially - changed value. - Note that you must always call `propertyWillChange` and `propertyDidChange` - as a pair. If you do not, it may get the property change groups out of - order and cause notifications to be delivered more often than you would - like. - @method propertyWillChange - @param {String} keyName The property key that is about to change. - @return {Ember.Observable} - @private + This will set the `to` property path to the specified value. It will not + attempt to resolve this property path to an actual object until you + connect the binding. + The binding will search for the property path starting at the root object + you pass when you `connect()` the binding. It follows the same rules as + `get()` - see that method for more information. + @method to + @param {String|Tuple} path A property path or tuple. + @return {Ember.Binding} `this` + @public */ - propertyWillChange: function (keyName) { - _emberMetal.propertyWillChange(this, keyName); - return this; - }, - /** - Notify the observer system that a property has just changed. - Sometimes you need to change a value directly or indirectly without - actually calling `get()` or `set()` on it. In this case, you can use this - method and `propertyWillChange()` instead. Calling these two methods - together will notify all observers that the property has potentially - changed value. - Note that you must always call `propertyWillChange` and `propertyDidChange` - as a pair. If you do not, it may get the property change groups out of - order and cause notifications to be delivered more often than you would - like. - @method propertyDidChange - @param {String} keyName The property key that has just changed. - @return {Ember.Observable} - @private - */ - propertyDidChange: function (keyName) { - _emberMetal.propertyDidChange(this, keyName); + Binding.prototype.to = function to(path) { + this._to = path; return this; - }, + }; /** - Convenience method to call `propertyWillChange` and `propertyDidChange` in - succession. - @method notifyPropertyChange - @param {String} keyName The property key to be notified about. - @return {Ember.Observable} + Configures the binding as one way. A one-way binding will relay changes + on the `from` side to the `to` side, but not the other way around. This + means that if you change the `to` side directly, the `from` side may have + a different value. + @method oneWay + @return {Ember.Binding} `this` @public */ - notifyPropertyChange: function (keyName) { - this.propertyWillChange(keyName); - this.propertyDidChange(keyName); + + Binding.prototype.oneWay = function oneWay() { + this._oneWay = true; return this; - }, + }; /** - Adds an observer on a property. - This is the core method used to register an observer for a property. - Once you call this method, any time the key's value is set, your observer - will be notified. Note that the observers are triggered any time the - value is set, regardless of whether it has actually changed. Your - observer should be prepared to handle that. - You can also pass an optional context parameter to this method. The - context will be passed to your observer method whenever it is triggered. - Note that if you add the same target/method pair on a key multiple times - with different context parameters, your observer will only be called once - with the last context you passed. - ### Observer Methods - Observer methods you pass should generally have the following signature if - you do not pass a `context` parameter: - ```javascript - fooDidChange: function(sender, key, value, rev) { }; - ``` - The sender is the object that changed. The key is the property that - changes. The value property is currently reserved and unused. The rev - is the last property revision of the object when it changed, which you can - use to detect if the key value has really changed or not. - If you pass a `context` parameter, the context will be passed before the - revision like so: - ```javascript - fooDidChange: function(sender, key, value, context, rev) { }; - ``` - Usually you will not need the value, context or revision parameters at - the end. In this case, it is common to write observer methods that take - only a sender and key value as parameters or, if you aren't interested in - any of these values, to write an observer that has no parameters at all. - @method addObserver - @param {String} key The key to observer - @param {Object} target The target object to invoke - @param {String|Function} method The method to invoke. + @method toString + @return {String} string representation of binding @public */ - addObserver: function (key, target, method) { - _emberMetal.addObserver(this, key, target, method); - }, - /** - Remove an observer you have previously registered on this object. Pass - the same key, target, and method you passed to `addObserver()` and your - target will no longer receive notifications. - @method removeObserver - @param {String} key The key to observer - @param {Object} target The target object to invoke - @param {String|Function} method The method to invoke. - @public - */ - removeObserver: function (key, target, method) { - _emberMetal.removeObserver(this, key, target, method); - }, + Binding.prototype.toString = function toString() { + var oneWay = this._oneWay ? '[oneWay]' : ''; + return 'Ember.Binding<' + _emberUtils.guidFor(this) + '>(' + this._from + ' -> ' + this._to + ')' + oneWay; + }; - /** - Returns `true` if the object currently has observers registered for a - particular key. You can use this method to potentially defer performing - an expensive action until someone begins observing a particular property - on the object. - @method hasObserverFor - @param {String} key Key to check - @return {Boolean} - @private - */ - hasObserverFor: function (key) { - return _emberMetal.hasListeners(this, key + ':change'); - }, + // .......................................................... + // CONNECT AND SYNC + // /** - Retrieves the value of a property, or a default value in the case that the - property returns `undefined`. - ```javascript - person.getWithDefault('lastName', 'Doe'); - ``` - @method getWithDefault - @param {String} keyName The name of the property to retrieve - @param {Object} defaultValue The value to return if the property value is undefined - @return {Object} The property value or the defaultValue. + Attempts to connect this binding instance so that it can receive and relay + changes. This method will raise an exception if you have not set the + from/to properties yet. + @method connect + @param {Object} obj The root object for this binding. + @return {Ember.Binding} `this` @public */ - getWithDefault: function (keyName, defaultValue) { - return _emberMetal.getWithDefault(this, keyName, defaultValue); - }, - /** - Set the value of a property to the current value plus some amount. - ```javascript - person.incrementProperty('age'); - team.incrementProperty('score', 2); - ``` - @method incrementProperty - @param {String} keyName The name of the property to increment - @param {Number} increment The amount to increment by. Defaults to 1 - @return {Number} The new property value - @public - */ - incrementProperty: function (keyName, increment) { - if (_emberMetal.isNone(increment)) { - increment = 1; + Binding.prototype.connect = function connect(obj) { + _emberMetalDebug.assert('Must pass a valid object to Ember.Binding.connect()', !!obj); + + var fromObj = undefined, + fromPath = undefined, + possibleGlobal = undefined; + + // If the binding's "from" path could be interpreted as a global, verify + // whether the path refers to a global or not by consulting `Ember.lookup`. + if (_emberMetalPath_cache.isGlobalPath(this._from)) { + var _name = _emberMetalPath_cache.getFirstKey(this._from); + possibleGlobal = _emberEnvironment.context.lookup[_name]; + + if (possibleGlobal) { + fromObj = possibleGlobal; + fromPath = _emberMetalPath_cache.getTailPath(this._from); + } } - _emberMetal.assert('Must pass a numeric value to incrementProperty', !isNaN(parseFloat(increment)) && isFinite(increment)); - return _emberMetal.set(this, keyName, (parseFloat(_emberMetal.get(this, keyName)) || 0) + increment); - }, + + if (fromObj === undefined) { + fromObj = obj; + fromPath = this._from; + } + + _emberMetalProperty_set.trySet(obj, this._to, _emberMetalProperty_get.get(fromObj, fromPath)); + + // Add an observer on the object to be notified when the binding should be updated. + _emberMetalObserver.addObserver(fromObj, fromPath, this, 'fromDidChange'); + + // If the binding is a two-way binding, also set up an observer on the target. + if (!this._oneWay) { + _emberMetalObserver.addObserver(obj, this._to, this, 'toDidChange'); + } + + _emberMetalEvents.addListener(obj, 'willDestroy', this, 'disconnect'); + + fireDeprecations(obj, this._to, this._from, possibleGlobal, this._oneWay, !possibleGlobal && !this._oneWay); + + this._readyToSync = true; + this._fromObj = fromObj; + this._fromPath = fromPath; + this._toObj = obj; + + return this; + }; /** - Set the value of a property to the current value minus some amount. - ```javascript - player.decrementProperty('lives'); - orc.decrementProperty('health', 5); - ``` - @method decrementProperty - @param {String} keyName The name of the property to decrement - @param {Number} decrement The amount to decrement by. Defaults to 1 - @return {Number} The new property value + Disconnects the binding instance. Changes will no longer be relayed. You + will not usually need to call this method. + @method disconnect + @return {Ember.Binding} `this` @public */ - decrementProperty: function (keyName, decrement) { - if (_emberMetal.isNone(decrement)) { - decrement = 1; + + Binding.prototype.disconnect = function disconnect() { + _emberMetalDebug.assert('Must pass a valid object to Ember.Binding.disconnect()', !!this._toObj); + + // Remove an observer on the object so we're no longer notified of + // changes that should update bindings. + _emberMetalObserver.removeObserver(this._fromObj, this._fromPath, this, 'fromDidChange'); + + // If the binding is two-way, remove the observer from the target as well. + if (!this._oneWay) { + _emberMetalObserver.removeObserver(this._toObj, this._to, this, 'toDidChange'); } - _emberMetal.assert('Must pass a numeric value to decrementProperty', !isNaN(parseFloat(decrement)) && isFinite(decrement)); - return _emberMetal.set(this, keyName, (_emberMetal.get(this, keyName) || 0) - decrement); - }, - /** - Set the value of a boolean property to the opposite of its - current value. - ```javascript - starship.toggleProperty('warpDriveEngaged'); - ``` - @method toggleProperty - @param {String} keyName The name of the property to toggle - @return {Boolean} The new property value - @public - */ - toggleProperty: function (keyName) { - return _emberMetal.set(this, keyName, !_emberMetal.get(this, keyName)); - }, + this._readyToSync = false; // Disable scheduled syncs... + return this; + }; - /** - Returns the cached value of a computed property, if it exists. - This allows you to inspect the value of a computed property - without accidentally invoking it if it is intended to be - generated lazily. - @method cacheFor - @param {String} keyName - @return {Object} The cached value of the computed property, if any - @public - */ - cacheFor: function (keyName) { - return _emberMetal.cacheFor(this, keyName); - }, + // .......................................................... + // PRIVATE + // - // intended for debugging purposes - observersForKey: function (keyName) { - return _emberMetal.observersFor(this, keyName); - } - }); -}); -enifed('ember-runtime/mixins/promise_proxy', ['exports', 'ember-metal', 'ember-runtime/computed/computed_macros'], function (exports, _emberMetal, _emberRuntimeComputedComputed_macros) { - 'use strict'; + /* Called when the from side changes. */ - /** - @module ember - @submodule ember-runtime - */ + Binding.prototype.fromDidChange = function fromDidChange(target) { + this._scheduleSync('fwd'); + }; - function tap(proxy, promise) { - _emberMetal.setProperties(proxy, { - isFulfilled: false, - isRejected: false - }); + /* Called when the to side changes. */ - return promise.then(function (value) { - if (!proxy.isDestroyed && !proxy.isDestroying) { - _emberMetal.setProperties(proxy, { - content: value, - isFulfilled: true - }); + Binding.prototype.toDidChange = function toDidChange(target) { + this._scheduleSync('back'); + }; + + Binding.prototype._scheduleSync = function _scheduleSync(dir) { + var existingDir = this._direction; + + // If we haven't scheduled the binding yet, schedule it. + if (existingDir === undefined) { + _emberMetalRun_loop.default.schedule('sync', this, '_sync'); + this._direction = dir; } - return value; - }, function (reason) { - if (!proxy.isDestroyed && !proxy.isDestroying) { - _emberMetal.setProperties(proxy, { - reason: reason, - isRejected: true - }); + + // If both a 'back' and 'fwd' sync have been scheduled on the same object, + // default to a 'fwd' sync so that it remains deterministic. + if (existingDir === 'back' && dir === 'fwd') { + this._direction = 'fwd'; } - throw reason; - }, 'Ember: PromiseProxy'); + }; + + Binding.prototype._sync = function _sync() { + var _this = this; + + var log = _emberEnvironment.ENV.LOG_BINDINGS; + + var toObj = this._toObj; + + // Don't synchronize destroyed objects or disconnected bindings. + if (toObj.isDestroyed || !this._readyToSync) { + return; + } + + // Get the direction of the binding for the object we are + // synchronizing from. + var direction = this._direction; + + var fromObj = this._fromObj; + var fromPath = this._fromPath; + + this._direction = undefined; + + // If we're synchronizing from the remote object... + if (direction === 'fwd') { + (function () { + var fromValue = _emberMetalProperty_get.get(fromObj, fromPath); + if (log) { + _emberConsole.default.log(' ', _this.toString(), '->', fromValue, fromObj); + } + if (_this._oneWay) { + _emberMetalProperty_set.trySet(toObj, _this._to, fromValue); + } else { + _emberMetalObserver._suspendObserver(toObj, _this._to, _this, 'toDidChange', function () { + _emberMetalProperty_set.trySet(toObj, this._to, fromValue); + }); + } + // If we're synchronizing *to* the remote object. + })(); + } else if (direction === 'back') { + (function () { + var toValue = _emberMetalProperty_get.get(toObj, _this._to); + if (log) { + _emberConsole.default.log(' ', _this.toString(), '<-', toValue, toObj); + } + _emberMetalObserver._suspendObserver(fromObj, fromPath, _this, 'fromDidChange', function () { + _emberMetalProperty_set.trySet(fromObj, fromPath, toValue); + }); + })(); + } + }; + + return Binding; + })(); + + function fireDeprecations(obj, toPath, fromPath, deprecateGlobal, deprecateOneWay, deprecateAlias) { + var deprecateGlobalMessage = '`Ember.Binding` is deprecated. Since you' + ' are binding to a global consider using a service instead.'; + var deprecateOneWayMessage = '`Ember.Binding` is deprecated. Since you' + ' are using a `oneWay` binding consider using a `readOnly` computed' + ' property instead.'; + var deprecateAliasMessage = '`Ember.Binding` is deprecated. Consider' + ' using an `alias` computed property instead.'; + + var objectInfo = 'The `' + toPath + '` property of `' + obj + '` is an `Ember.Binding` connected to `' + fromPath + '`, but '; + _emberMetalDebug.deprecate(objectInfo + deprecateGlobalMessage, !deprecateGlobal, { + id: 'ember-metal.binding', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x#toc_ember-binding' + }); + _emberMetalDebug.deprecate(objectInfo + deprecateOneWayMessage, !deprecateOneWay, { + id: 'ember-metal.binding', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x#toc_ember-binding' + }); + _emberMetalDebug.deprecate(objectInfo + deprecateAliasMessage, !deprecateAlias, { + id: 'ember-metal.binding', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x#toc_ember-binding' + }); + } + + function mixinProperties(to, from) { + for (var key in from) { + if (from.hasOwnProperty(key)) { + to[key] = from[key]; + } + } } + mixinProperties(Binding, { + + /* + See `Ember.Binding.from`. + @method from + @static + */ + from: function (from) { + var C = this; + return new C(undefined, from); + }, + + /* + See `Ember.Binding.to`. + @method to + @static + */ + to: function (to) { + var C = this; + return new C(to, undefined); + } + }); /** - A low level mixin making ObjectProxy promise-aware. + An `Ember.Binding` connects the properties of two objects so that whenever + the value of one property changes, the other property will be changed also. + + ## Automatic Creation of Bindings with `/^*Binding/`-named Properties. + + You do not usually create Binding objects directly but instead describe + bindings in your class or object definition using automatic binding + detection. + + Properties ending in a `Binding` suffix will be converted to `Ember.Binding` + instances. The value of this property should be a string representing a path + to another object or a custom binding instance created using Binding helpers + (see "One Way Bindings"): + + ``` + valueBinding: "MyApp.someController.title" + ``` + + This will create a binding from `MyApp.someController.title` to the `value` + property of your object instance automatically. Now the two values will be + kept in sync. + + ## One Way Bindings + + One especially useful binding customization you can use is the `oneWay()` + helper. This helper tells Ember that you are only interested in + receiving changes on the object you are binding from. For example, if you + are binding to a preference and you want to be notified if the preference + has changed, but your object will not be changing the preference itself, you + could do: + + ``` + bigTitlesBinding: Ember.Binding.oneWay("MyApp.preferencesController.bigTitles") + ``` + + This way if the value of `MyApp.preferencesController.bigTitles` changes the + `bigTitles` property of your object will change also. However, if you + change the value of your `bigTitles` property, it will not update the + `preferencesController`. + + One way bindings are almost twice as fast to setup and twice as fast to + execute because the binding only has to worry about changes to one side. + + You should consider using one way bindings anytime you have an object that + may be created frequently and you do not intend to change a property; only + to monitor it for changes (such as in the example above). + + ## Adding Bindings Manually + + All of the examples above show you how to configure a custom binding, but the + result of these customizations will be a binding template, not a fully active + Binding instance. The binding will actually become active only when you + instantiate the object the binding belongs to. It is useful, however, to + understand what actually happens when the binding is activated. + + For a binding to function it must have at least a `from` property and a `to` + property. The `from` property path points to the object/key that you want to + bind from while the `to` path points to the object/key you want to bind to. + + When you define a custom binding, you are usually describing the property + you want to bind from (such as `MyApp.someController.value` in the examples + above). When your object is created, it will automatically assign the value + you want to bind `to` based on the name of your binding key. In the + examples above, during init, Ember objects will effectively call + something like this on your binding: ```javascript - let ObjectPromiseProxy = Ember.ObjectProxy.extend(Ember.PromiseProxyMixin); + binding = Ember.Binding.from("valueBinding").to("value"); + ``` - let proxy = ObjectPromiseProxy.create({ - promise: Ember.RSVP.cast($.getJSON('/some/remote/data.json')) - }); + This creates a new binding instance based on the template you provide, and + sets the to path to the `value` property of the new object. Now that the + binding is fully configured with a `from` and a `to`, it simply needs to be + connected to become active. This is done through the `connect()` method: - proxy.then(function(json){ - // the json - }, function(reason) { - // the reason why you have no json - }); + ```javascript + binding.connect(this); ``` - the proxy has bindable attributes which - track the promises life cycle + Note that when you connect a binding you pass the object you want it to be + connected to. This object will be used as the root for both the from and + to side of the binding when inspecting relative paths. This allows the + binding to be automatically inherited by subclassed objects as well. + + This also allows you to bind between objects using the paths you declare in + `from` and `to`: ```javascript - proxy.get('isPending') //=> true - proxy.get('isSettled') //=> false - proxy.get('isRejected') //=> false - proxy.get('isFulfilled') //=> false + // Example 1 + binding = Ember.Binding.from("App.someObject.value").to("value"); + binding.connect(this); + + // Example 2 + binding = Ember.Binding.from("parentView.value").to("App.someObject.value"); + binding.connect(this); ``` - When the $.getJSON completes, and the promise is fulfilled - with json, the life cycle attributes will update accordingly. - Note that $.getJSON doesn't return an ECMA specified promise, - it is useful to wrap this with an `RSVP.cast` so that it behaves - as a spec compliant promise. + Now that the binding is connected, it will observe both the from and to side + and relay changes. + + If you ever needed to do so (you almost never will, but it is useful to + understand this anyway), you could manually create an active binding by + using the `Ember.bind()` helper method. (This is the same method used by + to setup your bindings on objects): ```javascript - proxy.get('isPending') //=> false - proxy.get('isSettled') //=> true - proxy.get('isRejected') //=> false - proxy.get('isFulfilled') //=> true + Ember.bind(MyApp.anotherObject, "value", "MyApp.someController.value"); ``` - As the proxy is an ObjectProxy, and the json now its content, - all the json properties will be available directly from the proxy. + Both of these code fragments have the same effect as doing the most friendly + form of binding creation like so: ```javascript - // Assuming the following json: - { - firstName: 'Stefan', - lastName: 'Penner' - } + MyApp.anotherObject = Ember.Object.create({ + valueBinding: "MyApp.someController.value", - // both properties will accessible on the proxy - proxy.get('firstName') //=> 'Stefan' - proxy.get('lastName') //=> 'Penner' + // OTHER CODE FOR THIS OBJECT... + }); ``` - @class Ember.PromiseProxyMixin + Ember's built in binding creation method makes it easy to automatically + create bindings for you. You should always use the highest-level APIs + available, even if you understand how it works underneath. + + @class Binding + @namespace Ember + @since Ember 0.9 @public */ - exports.default = _emberMetal.Mixin.create({ - /** - If the proxied promise is rejected this will contain the reason - provided. - @property reason - @default null - @public - */ - reason: null, + // Ember.Binding = Binding; ES6TODO: where to put this? - /** - Once the proxied promise has settled this will become `false`. - @property isPending - @default true - @public - */ - isPending: _emberRuntimeComputedComputed_macros.not('isSettled').readOnly(), + /** + Global helper method to create a new binding. Just pass the root object + along with a `to` and `from` path to create and connect the binding. + + @method bind + @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 bind(obj, to, from) { + return new Binding(to, from).connect(obj); + } + + exports.Binding = Binding; +}); +enifed('ember-metal/cache', ['exports', 'ember-utils', 'ember-metal/meta'], function (exports, _emberUtils, _emberMetalMeta) { + 'use strict'; + + var Cache = (function () { + function Cache(limit, func, key, store) { + babelHelpers.classCallCheck(this, Cache); + + this.size = 0; + this.misses = 0; + this.hits = 0; + this.limit = limit; + this.func = func; + this.key = key; + this.store = store || new DefaultStore(); + } + + Cache.prototype.get = function get(obj) { + var key = this.key === undefined ? obj : this.key(obj); + var value = this.store.get(key); + if (value === undefined) { + this.misses++; + value = this._set(key, this.func(obj)); + } else if (value === _emberMetalMeta.UNDEFINED) { + this.hits++; + value = undefined; + } else { + this.hits++; + // nothing to translate + } + + return value; + }; + + Cache.prototype.set = function set(obj, value) { + var key = this.key === undefined ? obj : this.key(obj); + return this._set(key, value); + }; + + Cache.prototype._set = function _set(key, value) { + if (this.limit > this.size) { + this.size++; + if (value === undefined) { + this.store.set(key, _emberMetalMeta.UNDEFINED); + } else { + this.store.set(key, value); + } + } + + return value; + }; + + Cache.prototype.purge = function purge() { + this.store.clear(); + this.size = 0; + this.hits = 0; + this.misses = 0; + }; + + return Cache; + })(); + + exports.default = Cache; + + var DefaultStore = (function () { + function DefaultStore() { + babelHelpers.classCallCheck(this, DefaultStore); + + this.data = new _emberUtils.EmptyObject(); + } + + DefaultStore.prototype.get = function get(key) { + return this.data[key]; + }; + + DefaultStore.prototype.set = function set(key, value) { + this.data[key] = value; + }; + + DefaultStore.prototype.clear = function clear() { + this.data = new _emberUtils.EmptyObject(); + }; + + return DefaultStore; + })(); +}); +enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_get', 'ember-metal/meta', 'ember-metal/watch_key', 'ember-metal/computed', 'ember-metal/watch_path'], function (exports, _emberUtils, _emberMetalProperty_get, _emberMetalMeta, _emberMetalWatch_key, _emberMetalComputed, _emberMetalWatch_path) { + 'use strict'; + + exports.finishChains = finishChains; + + var FIRST_KEY = /^([^\.]+)/; + + function firstKey(path) { + return path.match(FIRST_KEY)[0]; + } + + function isObject(obj) { + return typeof obj === 'object' && obj; + } + + function isVolatile(obj) { + return !(isObject(obj) && obj.isDescriptor && obj._volatile === false); + } + + var ChainWatchers = (function () { + function ChainWatchers() { + babelHelpers.classCallCheck(this, ChainWatchers); + + // chain nodes that reference a key in this obj by key + // we only create ChainWatchers when we are going to add them + // so create this upfront + this.chains = new _emberUtils.EmptyObject(); + } + + ChainWatchers.prototype.add = function add(key, node) { + var nodes = this.chains[key]; + if (nodes === undefined) { + this.chains[key] = [node]; + } else { + nodes.push(node); + } + }; + + ChainWatchers.prototype.remove = function remove(key, node) { + var nodes = this.chains[key]; + if (nodes) { + for (var i = 0; i < nodes.length; i++) { + if (nodes[i] === node) { + nodes.splice(i, 1); + break; + } + } + } + }; - /** - Once the proxied promise has settled this will become `true`. - @property isSettled - @default false - @public - */ - isSettled: _emberRuntimeComputedComputed_macros.or('isRejected', 'isFulfilled').readOnly(), + ChainWatchers.prototype.has = function has(key, node) { + var nodes = this.chains[key]; + if (nodes) { + for (var i = 0; i < nodes.length; i++) { + if (nodes[i] === node) { + return true; + } + } + } + return false; + }; - /** - Will become `true` if the proxied promise is rejected. - @property isRejected - @default false - @public - */ - isRejected: false, + ChainWatchers.prototype.revalidateAll = function revalidateAll() { + for (var key in this.chains) { + this.notify(key, true, undefined); + } + }; - /** - Will become `true` if the proxied promise is fulfilled. - @property isFulfilled - @default false - @public - */ - isFulfilled: false, + ChainWatchers.prototype.revalidate = function revalidate(key) { + this.notify(key, true, undefined); + }; - /** - The promise whose fulfillment value is being proxied by this object. - This property must be specified upon creation, and should not be - changed once created. - Example: - ```javascript - Ember.ObjectProxy.extend(Ember.PromiseProxyMixin).create({ - promise: - }); - ``` - @property promise - @public - */ - promise: _emberMetal.computed({ - get: function () { - throw new _emberMetal.Error('PromiseProxy\'s promise must be set'); - }, - set: function (key, promise) { - return tap(this, promise); + // 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 object and path that + // will be/are invalidated by this key change, depending on + // whether the revalidate flag is passed + + ChainWatchers.prototype.notify = function notify(key, revalidate, callback) { + var nodes = this.chains[key]; + if (nodes === undefined || nodes.length === 0) { + return; } - }), - /** - An alias to the proxied promise's `then`. - See RSVP.Promise.then. - @method then - @param {Function} callback - @return {RSVP.Promise} - @public - */ - then: promiseAlias('then'), + var affected = undefined; - /** - An alias to the proxied promise's `catch`. - See RSVP.Promise.catch. - @method catch - @param {Function} callback - @return {RSVP.Promise} - @since 1.3.0 - @public - */ - 'catch': promiseAlias('catch'), + if (callback) { + affected = []; + } - /** - An alias to the proxied promise's `finally`. - See RSVP.Promise.finally. - @method finally - @param {Function} callback - @return {RSVP.Promise} - @since 1.3.0 - @public - */ - 'finally': promiseAlias('finally') + for (var i = 0; i < nodes.length; i++) { + nodes[i].notify(revalidate, affected); + } - }); + if (callback === undefined) { + return; + } - function promiseAlias(name) { - return function () { - var promise = _emberMetal.get(this, 'promise'); - return promise[name].apply(promise, arguments); + // we gather callbacks so we don't notify them during revalidation + for (var i = 0; i < affected.length; i += 2) { + var obj = affected[i]; + var path = affected[i + 1]; + callback(obj, path); + } }; + + return ChainWatchers; + })(); + + function makeChainWatcher() { + return new ChainWatchers(); } -}); -enifed('ember-runtime/mixins/registry_proxy', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-runtime - */ - 'use strict'; + function addChainWatcher(obj, keyName, node) { + var m = _emberMetalMeta.meta(obj); + m.writableChainWatchers(makeChainWatcher).add(keyName, node); + _emberMetalWatch_key.watchKey(obj, keyName, m); + } - exports.buildFakeRegistryWithDeprecations = buildFakeRegistryWithDeprecations; + function removeChainWatcher(obj, keyName, node, _meta) { + if (!isObject(obj)) { + return; + } - /** - RegistryProxyMixin is used to provide public access to specific - registry functionality. - - @class RegistryProxyMixin - @private - */ - exports.default = _emberMetal.Mixin.create({ - __registry__: null, + var meta = _meta || _emberMetalMeta.peekMeta(obj); - /** - Given a fullName return the corresponding factory. - @public - @method resolveRegistration - @param {String} fullName - @return {Function} fullName's factory - */ - resolveRegistration: registryAlias('resolve'), + if (!meta || !meta.readableChainWatchers()) { + return; + } - /** - Registers a factory that can be used for dependency injection (with - `inject`) or for service lookup. Each factory is registered with - a full name including two parts: `type:name`. - A simple example: - ```javascript - let App = Ember.Application.create(); - App.Orange = Ember.Object.extend(); - App.register('fruit:favorite', App.Orange); - ``` - Ember will resolve factories from the `App` namespace automatically. - For example `App.CarsController` will be discovered and returned if - an application requests `controller:cars`. - An example of registering a controller with a non-standard name: - ```javascript - let App = Ember.Application.create(); - let Session = Ember.Controller.extend(); - App.register('controller:session', Session); - // The Session controller can now be treated like a normal controller, - // despite its non-standard name. - App.ApplicationController = Ember.Controller.extend({ - needs: ['session'] - }); - ``` - Registered factories are **instantiated** by having `create` - called on them. Additionally they are **singletons**, each time - they are looked up they return the same instance. - Some examples modifying that default behavior: - ```javascript - let App = Ember.Application.create(); - App.Person = Ember.Object.extend(); - App.Orange = Ember.Object.extend(); - App.Email = Ember.Object.extend(); - App.session = Ember.Object.create(); - App.register('model:user', App.Person, { singleton: false }); - App.register('fruit:favorite', App.Orange); - App.register('communication:main', App.Email, { singleton: false }); - App.register('session', App.session, { instantiate: false }); - ``` - @method register - @param fullName {String} type:name (e.g., 'model:user') - @param factory {Function} (e.g., App.Person) - @param options {Object} (optional) disable instantiation or singleton usage - @public - */ - register: registryAlias('register'), + // make meta writable + meta = _emberMetalMeta.meta(obj); - /** - Unregister a factory. - ```javascript - let App = Ember.Application.create(); - let User = Ember.Object.extend(); - App.register('model:user', User); - App.resolveRegistration('model:user').create() instanceof User //=> true - App.unregister('model:user') - App.resolveRegistration('model:user') === undefined //=> true - ``` - @public - @method unregister - @param {String} fullName - */ - unregister: registryAlias('unregister'), + meta.readableChainWatchers().remove(keyName, node); - /** - Check if a factory is registered. - @public - @method hasRegistration - @param {String} fullName - @return {Boolean} - */ - hasRegistration: registryAlias('has'), + _emberMetalWatch_key.unwatchKey(obj, keyName, meta); + } - /** - Register an option for a particular factory. - @public - @method registerOption - @param {String} fullName - @param {String} optionName - @param {Object} options - */ - registerOption: registryAlias('option'), + // 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 + // pass null for parent and key and object for value. - /** - Return a specific registered option for a particular factory. - @public - @method registeredOption - @param {String} fullName - @param {String} optionName - @return {Object} options - */ - registeredOption: registryAlias('getOption'), + var ChainNode = (function () { + function ChainNode(parent, key, value) { + babelHelpers.classCallCheck(this, ChainNode); - /** - Register options for a particular factory. - @public - @method registerOptions - @param {String} fullName - @param {Object} options - */ - registerOptions: registryAlias('options'), + this._parent = parent; + this._key = key; - /** - Return registered options for a particular factory. - @public - @method registeredOptions - @param {String} fullName - @return {Object} options - */ - registeredOptions: registryAlias('getOptions'), + // _watching is true when calling get(this._parent, this._key) will + // return the value of this node. + // + // It is false for the root of a chain (because we have no parent) + // and for global paths (because the parent node is the object with + // the observer on it) + this._watching = value === undefined; - /** - Allow registering options for all factories of a type. - ```javascript - let App = Ember.Application.create(); - let appInstance = App.buildInstance(); - // if all of type `connection` must not be singletons - appInstance.optionsForType('connection', { singleton: false }); - appInstance.register('connection:twitter', TwitterConnection); - appInstance.register('connection:facebook', FacebookConnection); - let twitter = appInstance.lookup('connection:twitter'); - let twitter2 = appInstance.lookup('connection:twitter'); - twitter === twitter2; // => false - let facebook = appInstance.lookup('connection:facebook'); - let facebook2 = appInstance.lookup('connection:facebook'); - facebook === facebook2; // => false - ``` - @public - @method registerOptionsForType - @param {String} type - @param {Object} options - */ - registerOptionsForType: registryAlias('optionsForType'), + this._chains = undefined; + this._object = undefined; + this.count = 0; - /** - Return the registered options for all factories of a type. - @public - @method registeredOptionsForType - @param {String} type - @return {Object} options - */ - registeredOptionsForType: registryAlias('getOptionsForType'), + this._value = value; + this._paths = {}; + if (this._watching) { + var obj = parent.value(); - /** - Define a dependency injection onto a specific factory or all factories - of a type. - When Ember instantiates a controller, view, or other framework component - it can attach a dependency to that component. This is often used to - provide services to a set of framework components. - An example of providing a session object to all controllers: - ```javascript - let App = Ember.Application.create(); - let Session = Ember.Object.extend({ isAuthenticated: false }); - // A factory must be registered before it can be injected - App.register('session:main', Session); - // Inject 'session:main' onto all factories of the type 'controller' - // with the name 'session' - App.inject('controller', 'session', 'session:main'); - App.IndexController = Ember.Controller.extend({ - isLoggedIn: Ember.computed.alias('session.isAuthenticated') - }); - ``` - Injections can also be performed on specific factories. - ```javascript - App.inject(, , ) - App.inject('route', 'source', 'source:main') - App.inject('route:application', 'email', 'model:email') - ``` - It is important to note that injections can only be performed on - classes that are instantiated by Ember itself. Instantiating a class - directly (via `create` or `new`) bypasses the dependency injection - system. - **Note:** Ember-Data instantiates its models in a unique manner, and consequently - injections onto models (or all models) will not work as expected. Injections - on models can be enabled by setting `EmberENV.MODEL_FACTORY_INJECTIONS` - to `true`. - @public - @method inject - @param factoryNameOrType {String} - @param property {String} - @param injectionName {String} - **/ - inject: registryAlias('injection') - }); + if (!isObject(obj)) { + return; + } - function registryAlias(name) { - return function () { - var _registry__; + this._object = obj; - return (_registry__ = this.__registry__)[name].apply(_registry__, arguments); + addChainWatcher(this._object, this._key, this); + } + } + + ChainNode.prototype.value = function value() { + if (this._value === undefined && this._watching) { + var obj = this._parent.value(); + this._value = lazyGet(obj, this._key); + } + return this._value; }; - } - function buildFakeRegistryWithDeprecations(instance, typeForMessage) { - var fakeRegistry = {}; - var registryProps = { - resolve: 'resolveRegistration', - register: 'register', - unregister: 'unregister', - has: 'hasRegistration', - option: 'registerOption', - options: 'registerOptions', - getOptions: 'registeredOptions', - optionsForType: 'registerOptionsForType', - getOptionsForType: 'registeredOptionsForType', - injection: 'inject' + ChainNode.prototype.destroy = function destroy() { + if (this._watching) { + var obj = this._object; + if (obj) { + removeChainWatcher(obj, this._key, this); + } + this._watching = false; // so future calls do nothing + } }; - for (var deprecatedProperty in registryProps) { - fakeRegistry[deprecatedProperty] = buildFakeRegistryFunction(instance, typeForMessage, deprecatedProperty, registryProps[deprecatedProperty]); - } + // copies a top level object only - return fakeRegistry; - } + ChainNode.prototype.copy = function copy(obj) { + var ret = new ChainNode(null, null, obj); + var paths = this._paths; + var path = undefined; - function buildFakeRegistryFunction(instance, typeForMessage, deprecatedProperty, nonDeprecatedProperty) { - return function () { - _emberMetal.deprecate('Using `' + typeForMessage + '.registry.' + deprecatedProperty + '` is deprecated. Please use `' + typeForMessage + '.' + nonDeprecatedProperty + '` instead.', false, { - id: 'ember-application.app-instance-registry', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-application-registry-ember-applicationinstance-registry' - }); - return instance[nonDeprecatedProperty].apply(instance, arguments); + for (path in paths) { + // this check will also catch non-number vals. + if (paths[path] <= 0) { + continue; + } + ret.add(path); + } + return ret; }; - } -}); -enifed('ember-runtime/mixins/target_action_support', ['exports', 'ember-environment', 'ember-metal'], function (exports, _emberEnvironment, _emberMetal) { - /** - @module ember - @submodule ember-runtime - */ - 'use strict'; + // called on the root node of a chain to setup watchers on the specified + // path. - /** - `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 - usually the best choice. This mixin is most often useful when you are - doing more complex event handling in Components. - - @class TargetActionSupport - @namespace Ember - @extends Ember.Mixin - @private - */ - exports.default = _emberMetal.Mixin.create({ - target: null, - action: null, - actionContext: null, + ChainNode.prototype.add = function add(path) { + var paths = this._paths; + paths[path] = (paths[path] || 0) + 1; - actionContextObject: _emberMetal.computed('actionContext', function () { - var actionContext = _emberMetal.get(this, 'actionContext'); + var key = firstKey(path); + var tail = path.slice(key.length + 1); - if (typeof actionContext === 'string') { - var value = _emberMetal.get(this, actionContext); - if (value === undefined) { - value = _emberMetal.get(_emberEnvironment.context.lookup, actionContext); - } - return value; - } else { - return actionContext; - } - }), + this.chain(key, tail); + }; - /** - Send an `action` with an `actionContext` to a `target`. The action, actionContext - and target will be retrieved from properties of the object. For example: - ```javascript - App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, { - target: Ember.computed.alias('controller'), - action: 'save', - actionContext: Ember.computed.alias('context'), - click() { - this.triggerAction(); // Sends the `save` action, along with the current context - // to the current controller - } - }); - ``` - The `target`, `action`, and `actionContext` can be provided as properties of - an optional object argument to `triggerAction` as well. - ```javascript - App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, { - click() { - this.triggerAction({ - action: 'save', - target: this.get('controller'), - actionContext: this.get('context') - }); // Sends the `save` action, along with the current context - // to the current controller - } - }); - ``` - The `actionContext` defaults to the object you are mixing `TargetActionSupport` into. - But `target` and `action` must be specified either as properties or with the argument - to `triggerAction`, or a combination: - ```javascript - App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, { - target: Ember.computed.alias('controller'), - click() { - this.triggerAction({ - action: 'save' - }); // Sends the `save` action, along with a reference to `this`, - // to the current controller + // called on the root node of a chain to teardown watcher on the specified + // path + + ChainNode.prototype.remove = function remove(path) { + var paths = this._paths; + if (paths[path] > 0) { + paths[path]--; } - }); - ``` - @method triggerAction - @param opts {Object} (optional, with the optional keys action, target and/or actionContext) - @return {Boolean} true if the action was sent successfully and did not return false - @private - */ - triggerAction: function () { - var opts = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - var action = opts.action || _emberMetal.get(this, 'action'); - var target = opts.target; + var key = firstKey(path); + var tail = path.slice(key.length + 1); + + this.unchain(key, tail); + }; + + ChainNode.prototype.chain = function chain(key, path) { + var chains = this._chains; + var node = undefined; + if (chains === undefined) { + chains = this._chains = new _emberUtils.EmptyObject(); + } else { + node = chains[key]; + } - if (!target) { - target = getTarget(this); + if (node === undefined) { + node = chains[key] = new ChainNode(this, key, undefined); } - var actionContext = opts.actionContext; + node.count++; // count chains... - function args(options, actionName) { - var ret = []; - if (actionName) { - ret.push(actionName); - } + // chain rest of path if there is one + if (path) { + key = firstKey(path); + path = path.slice(key.length + 1); + node.chain(key, path); + } + }; - return ret.concat(options); + ChainNode.prototype.unchain = function unchain(key, path) { + var chains = this._chains; + var node = chains[key]; + + // unchain rest of path first... + if (path && path.length > 1) { + var nextKey = firstKey(path); + var nextPath = path.slice(nextKey.length + 1); + node.unchain(nextKey, nextPath); } - if (typeof actionContext === 'undefined') { - actionContext = _emberMetal.get(this, 'actionContextObject') || this; + // delete node if needed. + node.count--; + if (node.count <= 0) { + chains[node._key] = undefined; + node.destroy(); } + }; - if (target && action) { - var ret = undefined; + ChainNode.prototype.notify = function notify(revalidate, affected) { + if (revalidate && this._watching) { + var parentValue = this._parent.value(); - if (target.send) { - ret = target.send.apply(target, args(actionContext, action)); - } else { - _emberMetal.assert('The action \'' + action + '\' did not exist on ' + target, typeof target[action] === 'function'); - ret = target[action].apply(target, args(actionContext)); + if (parentValue !== this._object) { + if (this._object) { + removeChainWatcher(this._object, this._key, this); + } + + if (isObject(parentValue)) { + this._object = parentValue; + addChainWatcher(parentValue, this._key, this); + } else { + this._object = undefined; + } } + this._value = undefined; + } - if (ret !== false) { - ret = true; + // then notify chains... + var chains = this._chains; + var node = undefined; + if (chains) { + for (var key in chains) { + node = chains[key]; + if (node !== undefined) { + node.notify(revalidate, affected); + } } + } - return ret; + if (affected && this._parent) { + this._parent.populateAffected(this._key, 1, affected); + } + }; + + ChainNode.prototype.populateAffected = function populateAffected(path, depth, affected) { + if (this._key) { + path = this._key + '.' + path; + } + + if (this._parent) { + this._parent.populateAffected(path, depth + 1, affected); } else { - return false; + if (depth > 1) { + affected.push(this.value(), path); + } } - } - }); + }; - function getTarget(instance) { - // TODO: Deprecate specifying `targetObject` - var target = _emberMetal.get(instance, 'targetObject'); + return ChainNode; + })(); - // if a `targetObject` CP was provided, use it - if (target) { - return target; + function lazyGet(obj, key) { + if (!isObject(obj)) { + return; } - // if _targetObject use it - if (instance._targetObject) { - return instance._targetObject; + var meta = _emberMetalMeta.peekMeta(obj); + + // check if object meant only to be a prototype + if (meta && meta.proto === obj) { + return; } - target = _emberMetal.get(instance, 'target'); - if (target) { - if (typeof target === 'string') { - var value = _emberMetal.get(instance, target); - if (value === undefined) { - value = _emberMetal.get(_emberEnvironment.context.lookup, target); + // Use `get` if the return value is an EachProxy or an uncacheable value. + if (isVolatile(obj[key])) { + return _emberMetalProperty_get.get(obj, key); + // Otherwise attempt to get the cached value of the computed property + } else { + var cache = meta.readableCache(); + if (cache) { + return _emberMetalComputed.cacheFor.get(cache, key); } - - return value; - } else { - return target; } - } - - return null; } -}); -enifed("ember-runtime/string_registry", ["exports"], function (exports) { - // STATE within a module is frowned apon, this exists - // to support Ember.STRINGS but shield ember internals from this legacy global - // API. - "use strict"; - - exports.setStrings = setStrings; - exports.getStrings = getStrings; - exports.get = get; - var STRINGS = {}; - function setStrings(strings) { - STRINGS = strings; - } + function finishChains(obj) { + // We only create meta if we really have to + var m = _emberMetalMeta.peekMeta(obj); + if (m) { + m = _emberMetalMeta.meta(obj); - function getStrings() { - return STRINGS; + // finish any current chains node watchers that reference obj + var chainWatchers = m.readableChainWatchers(); + if (chainWatchers) { + chainWatchers.revalidateAll(); + } + // ensure that if we have inherited any chains they have been + // copied onto our own meta. + if (m.readableChains()) { + m.writableChains(_emberMetalWatch_path.makeChainNode); + } + } } - function get(name) { - return STRINGS[name]; - } + exports.removeChainWatcher = removeChainWatcher; + exports.ChainNode = ChainNode; }); -enifed('ember-runtime/system/application', ['exports', 'ember-runtime/system/namespace'], function (exports, _emberRuntimeSystemNamespace) { +enifed('ember-metal/computed', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/property_set', 'ember-metal/meta', 'ember-metal/expand_properties', 'ember-metal/error', 'ember-metal/properties', 'ember-metal/property_events', 'ember-metal/dependent_keys'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalProperty_set, _emberMetalMeta, _emberMetalExpand_properties, _emberMetalError, _emberMetalProperties, _emberMetalProperty_events, _emberMetalDependent_keys) { 'use strict'; - exports.default = _emberRuntimeSystemNamespace.default.extend(); -}); -enifed('ember-runtime/system/array_proxy', ['exports', 'ember-metal', 'ember-runtime/utils', 'ember-runtime/system/object', 'ember-runtime/mixins/mutable_array', 'ember-runtime/mixins/enumerable', 'ember-runtime/mixins/array'], function (exports, _emberMetal, _emberRuntimeUtils, _emberRuntimeSystemObject, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsArray) { - 'use strict'; + exports.default = computed; /** @module ember - @submodule ember-runtime + @submodule ember-metal */ - var OUT_OF_RANGE_EXCEPTION = 'Index out of range'; - var EMPTY = []; - - function K() { - return this; - } + var DEEP_EACH_REGEX = /\.@each\.[^.]+\./; /** - An ArrayProxy wraps any other object that implements `Ember.Array` and/or - `Ember.MutableArray,` forwarding all requests. This makes it very useful for - a number of binding use cases or other cases where being able to swap - out the underlying array is useful. + A computed property transforms an object literal with object's accessor function(s) into a property. - A simple example of usage: + By default the function backing the computed property will only be called + once and the result will be cached. You can specify various properties + that your computed property depends on. This will force the cached + result to be recomputed if the dependencies are modified. + + In the following example we declare a computed property - `fullName` - by calling + `.Ember.computed()` with property dependencies (`firstName` and `lastName`) as leading arguments and getter accessor function. The `fullName` getter function + will be called once (regardless of how many times it is accessed) as long + as its dependencies have not changed. Once `firstName` or `lastName` are updated + any future calls (or anything bound) to `fullName` will incorporate the new + values. ```javascript - let pets = ['dog', 'cat', 'fish']; - let ap = Ember.ArrayProxy.create({ content: Ember.A(pets) }); + let Person = Ember.Object.extend({ + // these will be supplied by `create` + firstName: null, + lastName: null, - ap.get('firstObject'); // 'dog' - ap.set('content', ['amoeba', 'paramecium']); - ap.get('firstObject'); // 'amoeba' + fullName: Ember.computed('firstName', 'lastName', function() { + let firstName = this.get('firstName'), + lastName = this.get('lastName'); + + return firstName + ' ' + lastName; + }) + }); + + let tom = Person.create({ + firstName: 'Tom', + lastName: 'Dale' + }); + + tom.get('fullName') // 'Tom Dale' ``` - This class can also be useful as a layer to transform the contents of - an array, as they are accessed. This can be done by overriding - `objectAtContent`: + You can also define what Ember should do when setting a computed property by providing additional function (`set`) in hash argument. + If you try to set a computed property, it will try to invoke setter accessor function with the key and + value you want to set it to as arguments. ```javascript - let pets = ['dog', 'cat', 'fish']; - let ap = Ember.ArrayProxy.create({ - content: Ember.A(pets), - objectAtContent: function(idx) { - return this.get('content').objectAt(idx).toUpperCase(); + let Person = Ember.Object.extend({ + // these will be supplied by `create` + firstName: null, + lastName: null, + + fullName: Ember.computed('firstName', 'lastName', { + get(key) { + let firstName = this.get('firstName'), + lastName = this.get('lastName'); + + return firstName + ' ' + lastName; + }, + set(key, value) { + let [firstName, lastName] = value.split(' '); + + this.set('firstName', firstName); + this.set('lastName', lastName); + + return value; } + }) }); - ap.get('firstObject'); // . 'DOG' + let person = Person.create(); + + person.set('fullName', 'Peter Wagenet'); + person.get('firstName'); // 'Peter' + person.get('lastName'); // 'Wagenet' ``` - @class ArrayProxy + You can overwrite computed property with normal property (no longer computed), that won't change if dependencies change, if you set computed property and it won't have setter accessor function defined. + + You can also mark computed property as `.readOnly()` and block all attempts to set it. + + ```javascript + let Person = Ember.Object.extend({ + // these will be supplied by `create` + firstName: null, + lastName: null, + + fullName: Ember.computed('firstName', 'lastName', { + get(key) { + let firstName = this.get('firstName'); + let lastName = this.get('lastName'); + + return firstName + ' ' + lastName; + } + }).readOnly() + }); + + let person = Person.create(); + person.set('fullName', 'Peter Wagenet'); // Uncaught Error: Cannot set read-only property "fullName" on object: <(...):emberXXX> + ``` + + Additional resources: + - [New CP syntax RFC](https://github.com/emberjs/rfcs/blob/master/text/0011-improved-cp-syntax.md) + - [New computed syntax explained in "Ember 1.12 released" ](http://emberjs.com/blog/2015/05/13/ember-1-12-released.html#toc_new-computed-syntax) + + @class ComputedProperty @namespace Ember - @extends Ember.Object - @uses Ember.MutableArray @public */ - exports.default = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsMutable_array.default, { + function ComputedProperty(config, opts) { + this.isDescriptor = true; + if (typeof config === 'function') { + this._getter = config; + } else { + _emberMetalDebug.assert('Ember.computed expects a function or an object as last argument.', typeof config === 'object' && !Array.isArray(config)); + _emberMetalDebug.assert('Config object passed to an Ember.computed can only contain `get` or `set` keys.', (function () { + var keys = Object.keys(config); + for (var i = 0; i < keys.length; i++) { + if (keys[i] !== 'get' && keys[i] !== 'set') { + return false; + } + } + return true; + })()); + this._getter = config.get; + this._setter = config.set; + } + _emberMetalDebug.assert('Computed properties must receive a getter or a setter, you passed none.', !!this._getter || !!this._setter); + this._dependentKeys = undefined; + this._suspended = undefined; + this._meta = undefined; + this._volatile = false; + this._dependentKeys = opts && opts.dependentKeys; + this._readOnly = false; + } - /** - The content array. Must be an object that implements `Ember.Array` and/or - `Ember.MutableArray.` - @property content - @type Ember.Array - @private - */ - content: null, + ComputedProperty.prototype = new _emberMetalProperties.Descriptor(); + ComputedProperty.prototype.constructor = ComputedProperty; - /** - The array that the proxy pretends to be. In the default `ArrayProxy` - implementation, this and `content` are the same. Subclasses of `ArrayProxy` - can override this property to provide things like sorting and filtering. - @property arrangedContent - @private - */ - arrangedContent: _emberMetal.alias('content'), + var ComputedPropertyPrototype = ComputedProperty.prototype; - /** - Should actually retrieve the object at the specified index from the - content. You can override this method in subclasses to transform the - content item to something new. - This method will only be called if content is non-`null`. - @method objectAtContent - @param {Number} idx The index to retrieve. - @return {Object} the value or undefined if none found - @public - */ - objectAtContent: function (idx) { - return _emberRuntimeMixinsArray.objectAt(_emberMetal.get(this, 'arrangedContent'), idx); - }, + /** + Call on a computed property to set it into non-cached mode. When in this + mode the computed property will not automatically cache the return value. + + It also does not automatically fire any change events. You must manually notify + any changes if you want to observe this property. + + Dependency keys have no effect on volatile properties as they are for cache + invalidation and notification when cached value is invalidated. + + ```javascript + let outsideService = Ember.Object.extend({ + value: Ember.computed(function() { + return OutsideService.getValue(); + }).volatile() + }).create(); + ``` + + @method volatile + @return {Ember.ComputedProperty} this + @chainable + @public + */ + ComputedPropertyPrototype.volatile = function () { + this._volatile = true; + return this; + }; - /** - Should actually replace the specified objects on the content array. - You can override this method in subclasses to transform the content item - into something new. - This method will only be called if content is non-`null`. - @method replaceContent - @param {Number} idx The starting index - @param {Number} amt The number of items to remove from the content. - @param {Array} objects Optional array of objects to insert or null if no - objects. - @return {void} - @private - */ - replaceContent: function (idx, amt, objects) { - _emberMetal.get(this, 'content').replace(idx, amt, objects); - }, + /** + Call on a computed property to set it into read-only mode. When in this + mode the computed property will throw an error when set. + + ```javascript + let Person = Ember.Object.extend({ + guid: Ember.computed(function() { + return 'guid-guid-guid'; + }).readOnly() + }); + + let person = Person.create(); + + person.set('guid', 'new-guid'); // will throw an exception + ``` + + @method readOnly + @return {Ember.ComputedProperty} this + @chainable + @public + */ + ComputedPropertyPrototype.readOnly = function () { + this._readOnly = true; + _emberMetalDebug.assert('Computed properties that define a setter using the new syntax cannot be read-only', !(this._readOnly && this._setter && this._setter !== this._getter)); + return this; + }; - /** - Invoked when the content property is about to change. Notifies observers that the - entire array content will change. - @private - @method _contentWillChange - */ - _contentWillChange: _emberMetal._beforeObserver('content', function () { - this._teardownContent(); - }), + /** + Sets the dependent keys on this computed property. Pass any number of + arguments containing key paths that this computed property depends on. + + ```javascript + let President = Ember.Object.extend({ + fullName: Ember.computed(function() { + return this.get('firstName') + ' ' + this.get('lastName'); + + // Tell Ember that this computed property depends on firstName + // and lastName + }).property('firstName', 'lastName') + }); + + let president = President.create({ + firstName: 'Barack', + lastName: 'Obama' + }); + + president.get('fullName'); // 'Barack Obama' + ``` + + @method property + @param {String} path* zero or more property paths + @return {Ember.ComputedProperty} this + @chainable + @public + */ + ComputedPropertyPrototype.property = function () { + var args = []; - _teardownContent: function () { - var content = _emberMetal.get(this, 'content'); + function addArg(property) { + _emberMetalDebug.warn('Dependent keys containing @each only work one level deep. ' + ('You used the key "' + property + '" which is invalid. ') + 'Please create an intermediary computed property.', DEEP_EACH_REGEX.test(property) === false, { id: 'ember-metal.computed-deep-each' }); + args.push(property); + } - if (content) { - _emberRuntimeMixinsArray.removeArrayObserver(content, this, { - willChange: 'contentArrayWillChange', - didChange: 'contentArrayDidChange' - }); - } - }, + for (var i = 0; i < arguments.length; i++) { + _emberMetalExpand_properties.default(arguments[i], addArg); + } - /** - Override to implement content array `willChange` observer. - @method contentArrayWillChange - @param {Ember.Array} contentArray the content array - @param {Number} start starting index of the change - @param {Number} removeCount count of items removed - @param {Number} addCount count of items added - @private - */ - contentArrayWillChange: K, - /** - Override to implement content array `didChange` observer. - @method contentArrayDidChange - @param {Ember.Array} contentArray the content array - @param {Number} start starting index of the change - @param {Number} removeCount count of items removed - @param {Number} addCount count of items added - @private - */ - contentArrayDidChange: K, + this._dependentKeys = args; + return this; + }; + + /** + In some cases, you may want to annotate computed properties with additional + metadata about how they function or what values they operate on. For example, + computed property functions may close over variables that are then no longer + available for introspection. + + You can pass a hash of these values to a computed property like this: + + ``` + person: Ember.computed(function() { + let personId = this.get('personId'); + return App.Person.create({ id: personId }); + }).meta({ type: App.Person }) + ``` + + The hash that you pass to the `meta()` function will be saved on the + computed property descriptor under the `_meta` key. Ember runtime + exposes a public API for retrieving these values from classes, + via the `metaForProperty()` function. + + @method meta + @param {Object} meta + @chainable + @public + */ + ComputedPropertyPrototype.meta = function (meta) { + if (arguments.length === 0) { + return this._meta || {}; + } else { + this._meta = meta; + return this; + } + }; - /** - Invoked when the content property changes. Notifies observers that the - entire array content has changed. - @private - @method _contentDidChange - */ - _contentDidChange: _emberMetal.observer('content', function () { - var content = _emberMetal.get(this, 'content'); + // invalidate cache when CP key changes + ComputedPropertyPrototype.didChange = function (obj, keyName) { + // _suspended is set via a CP.set to ensure we don't clear + // the cached value set by the setter + if (this._volatile || this._suspended === obj) { + return; + } - _emberMetal.assert('Can\'t set ArrayProxy\'s content to itself', content !== this); + // don't create objects just to invalidate + var meta = _emberMetalMeta.peekMeta(obj); + if (!meta || meta.source !== obj) { + return; + } - this._setupContent(); - }), + var cache = meta.readableCache(); + if (cache && cache[keyName] !== undefined) { + cache[keyName] = undefined; + _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); + } + }; - _setupContent: function () { - var content = _emberMetal.get(this, 'content'); + ComputedPropertyPrototype.get = function (obj, keyName) { + if (this._volatile) { + return this._getter.call(obj, keyName); + } - if (content) { - _emberMetal.assert('ArrayProxy expects an Array or Ember.ArrayProxy, but you passed ' + typeof content, _emberRuntimeUtils.isArray(content) || content.isDestroyed); + var meta = _emberMetalMeta.meta(obj); + var cache = meta.writableCache(); - _emberRuntimeMixinsArray.addArrayObserver(content, this, { - willChange: 'contentArrayWillChange', - didChange: 'contentArrayDidChange' - }); - } - }, + var result = cache[keyName]; + if (result === _emberMetalMeta.UNDEFINED) { + return undefined; + } else if (result !== undefined) { + return result; + } - _arrangedContentWillChange: _emberMetal._beforeObserver('arrangedContent', function () { - var arrangedContent = _emberMetal.get(this, 'arrangedContent'); - var len = arrangedContent ? _emberMetal.get(arrangedContent, 'length') : 0; + var ret = this._getter.call(obj, keyName); + if (ret === undefined) { + cache[keyName] = _emberMetalMeta.UNDEFINED; + } else { + cache[keyName] = ret; + } - this.arrangedContentArrayWillChange(this, 0, len, undefined); - this.arrangedContentWillChange(this); + var chainWatchers = meta.readableChainWatchers(); + if (chainWatchers) { + chainWatchers.revalidate(keyName); + } + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); - this._teardownArrangedContent(arrangedContent); - }), + return ret; + }; - _arrangedContentDidChange: _emberMetal.observer('arrangedContent', function () { - var arrangedContent = _emberMetal.get(this, 'arrangedContent'); - var len = arrangedContent ? _emberMetal.get(arrangedContent, 'length') : 0; + ComputedPropertyPrototype.set = function computedPropertySetEntry(obj, keyName, value) { + if (this._readOnly) { + this._throwReadOnlyError(obj, keyName); + } - _emberMetal.assert('Can\'t set ArrayProxy\'s content to itself', arrangedContent !== this); + if (!this._setter) { + return this.clobberSet(obj, keyName, value); + } - this._setupArrangedContent(); + if (this._volatile) { + return this.volatileSet(obj, keyName, value); + } - this.arrangedContentDidChange(this); - this.arrangedContentArrayDidChange(this, 0, undefined, len); - }), + return this.setWithSuspend(obj, keyName, value); + }; - _setupArrangedContent: function () { - var arrangedContent = _emberMetal.get(this, 'arrangedContent'); + ComputedPropertyPrototype._throwReadOnlyError = function computedPropertyThrowReadOnlyError(obj, keyName) { + throw new _emberMetalError.default('Cannot set read-only property "' + keyName + '" on object: ' + _emberUtils.inspect(obj)); + }; - if (arrangedContent) { - _emberMetal.assert('ArrayProxy expects an Array or Ember.ArrayProxy, but you passed ' + typeof arrangedContent, _emberRuntimeUtils.isArray(arrangedContent) || arrangedContent.isDestroyed); + ComputedPropertyPrototype.clobberSet = function computedPropertyClobberSet(obj, keyName, value) { + var cachedValue = cacheFor(obj, keyName); + _emberMetalProperties.defineProperty(obj, keyName, null, cachedValue); + _emberMetalProperty_set.set(obj, keyName, value); + return value; + }; - _emberRuntimeMixinsArray.addArrayObserver(arrangedContent, this, { - willChange: 'arrangedContentArrayWillChange', - didChange: 'arrangedContentArrayDidChange' - }); - } - }, + ComputedPropertyPrototype.volatileSet = function computedPropertyVolatileSet(obj, keyName, value) { + return this._setter.call(obj, keyName, value); + }; - _teardownArrangedContent: function () { - var arrangedContent = _emberMetal.get(this, 'arrangedContent'); + ComputedPropertyPrototype.setWithSuspend = function computedPropertySetWithSuspend(obj, keyName, value) { + var oldSuspended = this._suspended; + this._suspended = obj; + try { + return this._set(obj, keyName, value); + } finally { + this._suspended = oldSuspended; + } + }; - if (arrangedContent) { - _emberRuntimeMixinsArray.removeArrayObserver(arrangedContent, this, { - willChange: 'arrangedContentArrayWillChange', - didChange: 'arrangedContentArrayDidChange' - }); + ComputedPropertyPrototype._set = function computedPropertySet(obj, keyName, value) { + // cache requires own meta + var meta = _emberMetalMeta.meta(obj); + // either there is a writable cache or we need one to update + var cache = meta.writableCache(); + var hadCachedValue = false; + var cachedValue = undefined; + if (cache[keyName] !== undefined) { + if (cache[keyName] !== _emberMetalMeta.UNDEFINED) { + cachedValue = cache[keyName]; } - }, - - arrangedContentWillChange: K, - arrangedContentDidChange: K, + hadCachedValue = true; + } - objectAt: function (idx) { - return _emberMetal.get(this, 'content') && this.objectAtContent(idx); - }, + var ret = this._setter.call(obj, keyName, value, cachedValue); - length: _emberMetal.computed(function () { - var arrangedContent = _emberMetal.get(this, 'arrangedContent'); - return arrangedContent ? _emberMetal.get(arrangedContent, 'length') : 0; - // No dependencies since Enumerable notifies length of change - }), + // allows setter to return the same value that is cached already + if (hadCachedValue && cachedValue === ret) { + return ret; + } - _replace: function (idx, amt, objects) { - var content = _emberMetal.get(this, 'content'); - _emberMetal.assert('The content property of ' + this.constructor + ' should be set before modifying it', content); - if (content) { - this.replaceContent(idx, amt, objects); - } + _emberMetalProperty_events.propertyWillChange(obj, keyName); - return this; - }, + if (hadCachedValue) { + cache[keyName] = undefined; + } - replace: function () { - if (_emberMetal.get(this, 'arrangedContent') === _emberMetal.get(this, 'content')) { - this._replace.apply(this, arguments); - } else { - throw new _emberMetal.Error('Using replace on an arranged ArrayProxy is not allowed.'); - } - }, + if (!hadCachedValue) { + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); + } - _insertAt: function (idx, object) { - if (idx > _emberMetal.get(this, 'content.length')) { - throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); - } + if (ret === undefined) { + cache[keyName] = _emberMetalMeta.UNDEFINED; + } else { + cache[keyName] = ret; + } - this._replace(idx, 0, [object]); - return this; - }, + _emberMetalProperty_events.propertyDidChange(obj, keyName); - insertAt: function (idx, object) { - if (_emberMetal.get(this, 'arrangedContent') === _emberMetal.get(this, 'content')) { - return this._insertAt(idx, object); - } else { - throw new _emberMetal.Error('Using insertAt on an arranged ArrayProxy is not allowed.'); - } - }, + return ret; + }; - removeAt: function (start, len) { - if ('number' === typeof start) { - var content = _emberMetal.get(this, 'content'); - var arrangedContent = _emberMetal.get(this, 'arrangedContent'); - var indices = []; + /* called before property is overridden */ + ComputedPropertyPrototype.teardown = function (obj, keyName) { + if (this._volatile) { + return; + } + var meta = _emberMetalMeta.meta(obj); + var cache = meta.readableCache(); + if (cache && cache[keyName] !== undefined) { + _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); + cache[keyName] = undefined; + } + }; - if (start < 0 || start >= _emberMetal.get(this, 'length')) { - throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); + /** + This helper returns a new property descriptor that wraps the passed + computed property function. You can use this helper to define properties + with mixins or via `Ember.defineProperty()`. + + If you pass a function as an argument, it will be used as a getter. A computed + property defined in this way might look like this: + + ```js + let Person = Ember.Object.extend({ + init() { + this._super(...arguments); + + this.firstName = 'Betty'; + this.lastName = 'Jones'; + }, + + fullName: Ember.computed('firstName', 'lastName', function() { + return `${this.get('firstName')} ${this.get('lastName')}`; + }) + }); + + let client = Person.create(); + + client.get('fullName'); // 'Betty Jones' + + client.set('lastName', 'Fuller'); + client.get('fullName'); // 'Betty Fuller' + ``` + + You can pass a hash with two functions, `get` and `set`, as an + argument to provide both a getter and setter: + + ```js + let Person = Ember.Object.extend({ + init() { + this._super(...arguments); + + this.firstName = 'Betty'; + this.lastName = 'Jones'; + }, + + fullName: Ember.computed('firstName', 'lastName', { + get(key) { + return `${this.get('firstName')} ${this.get('lastName')}`; + }, + set(key, value) { + let [firstName, lastName] = value.split(/\s+/); + this.setProperties({ firstName, lastName }); + return value; } + }) + }); + + let client = Person.create(); + client.get('firstName'); // 'Betty' + + client.set('fullName', 'Carroll Fuller'); + client.get('firstName'); // 'Carroll' + ``` + + The `set` function should accept two parameters, `key` and `value`. The value + returned from `set` will be the new value of the property. + + _Note: This is the preferred way to define computed properties when writing third-party + libraries that depend on or use Ember, since there is no guarantee that the user + will have [prototype Extensions](http://emberjs.com/guides/configuring-ember/disabling-prototype-extensions/) enabled._ + + The alternative syntax, with prototype extensions, might look like: + + ```js + fullName: function() { + return this.get('firstName') + ' ' + this.get('lastName'); + }.property('firstName', 'lastName') + ``` + + @class computed + @namespace Ember + @constructor + @static + @param {String} [dependentKeys*] Optional dependent keys that trigger this computed property. + @param {Function} func The computed property function. + @return {Ember.ComputedProperty} property descriptor instance + @public + */ - if (len === undefined) { - len = 1; - } + function computed(func) { + var args = undefined; - // Get a list of indices in original content to remove - for (var i = start; i < start + len; i++) { - // Use arrangedContent here so we avoid confusion with objects transformed by objectAtContent - indices.push(content.indexOf(_emberRuntimeMixinsArray.objectAt(arrangedContent, i))); - } + if (arguments.length > 1) { + args = [].slice.call(arguments); + func = args.pop(); + } - // Replace in reverse order since indices will change - indices.sort(function (a, b) { - return b - a; - }); + var cp = new ComputedProperty(func); - _emberMetal.beginPropertyChanges(); - for (var i = 0; i < indices.length; i++) { - this._replace(indices[i], 1, EMPTY); - } - _emberMetal.endPropertyChanges(); - } + if (args) { + cp.property.apply(cp, args); + } - return this; - }, + return cp; + } - pushObject: function (obj) { - this._insertAt(_emberMetal.get(this, 'content.length'), obj); - return obj; - }, + /** + Returns the cached value for a property, if one exists. + This can be useful for peeking at the value of a computed + property that is generated lazily, without accidentally causing + it to be created. + + @method cacheFor + @for Ember + @param {Object} obj the object whose property you want to check + @param {String} key the name of the property whose cached value you want + to return + @return {Object} the cached value + @public + */ + function cacheFor(obj, key) { + var meta = _emberMetalMeta.peekMeta(obj); + var cache = meta && meta.source === obj && meta.readableCache(); + var ret = cache && cache[key]; - pushObjects: function (objects) { - if (!(_emberRuntimeMixinsEnumerable.default.detect(objects) || _emberRuntimeUtils.isArray(objects))) { - throw new TypeError('Must pass Ember.Enumerable to Ember.MutableArray#pushObjects'); - } - this._replace(_emberMetal.get(this, 'length'), 0, objects); - return this; - }, + if (ret === _emberMetalMeta.UNDEFINED) { + return undefined; + } + return ret; + } - setObjects: function (objects) { - if (objects.length === 0) { - return this.clear(); - } + cacheFor.set = function (cache, key, value) { + if (value === undefined) { + cache[key] = _emberMetalMeta.UNDEFINED; + } else { + cache[key] = value; + } + }; - var len = _emberMetal.get(this, 'length'); - this._replace(0, len, objects); - return this; - }, + cacheFor.get = function (cache, key) { + var ret = cache[key]; + if (ret === _emberMetalMeta.UNDEFINED) { + return undefined; + } + return ret; + }; - unshiftObject: function (obj) { - this._insertAt(0, obj); - return obj; - }, + cacheFor.remove = function (cache, key) { + cache[key] = undefined; + }; - unshiftObjects: function (objects) { - this._replace(0, 0, objects); - return this; - }, + exports.ComputedProperty = ComputedProperty; + exports.computed = computed; + exports.cacheFor = cacheFor; +}); +enifed('ember-metal/core', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { + 'use strict'; - slice: function () { - var arr = this.toArray(); - return arr.slice.apply(arr, arguments); - }, + /** + @module ember + @submodule ember-metal + */ - arrangedContentArrayWillChange: function (item, idx, removedCnt, addedCnt) { - this.arrayContentWillChange(idx, removedCnt, addedCnt); - }, + /** + This namespace contains all Ember methods and functions. Future versions of + Ember may overwrite this namespace and therefore, you should avoid adding any + new properties. + + At the heart of Ember is Ember-Runtime, a set of core functions that provide + cross-platform compatibility and object property observing. Ember-Runtime is + small and performance-focused so you can use it alongside other + cross-platform libraries such as jQuery. For more details, see + [Ember-Runtime](http://emberjs.com/api/modules/ember-runtime.html). + + @class Ember + @static + @public + */ + var Ember = typeof _emberEnvironment.context.imports.Ember === 'object' && _emberEnvironment.context.imports.Ember || {}; - arrangedContentArrayDidChange: function (item, idx, removedCnt, addedCnt) { - this.arrayContentDidChange(idx, removedCnt, addedCnt); - }, + // Make sure these are set whether Ember was already defined or not + Ember.isNamespace = true; + Ember.toString = function () { + return 'Ember'; + }; - init: function () { - this._super.apply(this, arguments); - this._setupContent(); - this._setupArrangedContent(); - }, + // .......................................................... + // BOOTSTRAP + // - willDestroy: function () { - this._teardownArrangedContent(); - this._teardownContent(); - } - }); + exports.default = Ember; }); -enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/mixins/action_handler', 'ember-runtime/inject'], function (exports, _emberUtils, _emberMetal, _emberRuntimeMixinsAction_handler, _emberRuntimeInject) { - 'no use strict'; - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed +enifed("ember-metal/debug", ["exports"], function (exports) { + "use strict"; - /** - @module ember - @submodule ember-runtime - */ + exports.getDebugFunction = getDebugFunction; + exports.setDebugFunction = setDebugFunction; + exports.assert = assert; + exports.info = info; + exports.warn = warn; + exports.debug = debug; + exports.deprecate = deprecate; + exports.deprecateFunc = deprecateFunc; + exports.runInDebug = runInDebug; + exports.debugSeal = debugSeal; + exports.debugFreeze = debugFreeze; + var debugFunctions = { + assert: function () {}, + info: function () {}, + warn: function () {}, + debug: function () {}, + deprecate: function () {}, + deprecateFunc: function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - // using ember-metal/lib/main here to ensure that ember-debug is setup - // if present + return args[args.length - 1]; + }, + runInDebug: function () {}, + debugSeal: function () {}, + debugFreeze: function () {} + }; - var _Mixin$create; + exports.debugFunctions = debugFunctions; - var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['.'], ['.']); + function getDebugFunction(name) { + return debugFunctions[name]; + } - var schedule = _emberMetal.run.schedule; - var applyMixin = _emberMetal.Mixin._apply; - var finishPartial = _emberMetal.Mixin.finishPartial; - var reopen = _emberMetal.Mixin.prototype.reopen; - var hasCachedComputedProperties = false; + function setDebugFunction(name, fn) { + debugFunctions[name] = fn; + } - var POST_INIT = _emberUtils.symbol('POST_INIT'); + function assert() { + return debugFunctions.assert.apply(undefined, arguments); + } - exports.POST_INIT = POST_INIT; - function makeCtor() { - // Note: avoid accessing any properties on the object since it makes the - // method a lot faster. This is glue code so we want it to be as fast as - // possible. + function info() { + return debugFunctions.info.apply(undefined, arguments); + } - var wasApplied = false; - var initProperties; + function warn() { + return debugFunctions.warn.apply(undefined, arguments); + } - var Class = function () { - if (!wasApplied) { - Class.proto(); // prepare prototype... - } + function debug() { + return debugFunctions.debug.apply(undefined, arguments); + } - if (arguments.length > 0) { - initProperties = [arguments[0]]; - } + function deprecate() { + return debugFunctions.deprecate.apply(undefined, arguments); + } - this.__defineNonEnumerable(_emberUtils.GUID_KEY_PROPERTY); - var m = _emberMetal.meta(this); - var proto = m.proto; - m.proto = this; - if (initProperties) { - // capture locally so we can clear the closed over variable - var props = initProperties; - initProperties = null; + function deprecateFunc() { + return debugFunctions.deprecateFunc.apply(undefined, arguments); + } - var concatenatedProperties = this.concatenatedProperties; - var mergedProperties = this.mergedProperties; + function runInDebug() { + return debugFunctions.runInDebug.apply(undefined, arguments); + } - for (var i = 0; i < props.length; i++) { - var properties = props[i]; + function debugSeal() { + return debugFunctions.debugSeal.apply(undefined, arguments); + } - _emberMetal.assert('Ember.Object.create no longer supports mixing in other ' + 'definitions, use .extend & .create separately instead.', !(properties instanceof _emberMetal.Mixin)); + function debugFreeze() { + return debugFunctions.debugFreeze.apply(undefined, arguments); + } +}); +enifed('ember-metal/dependent_keys', ['exports', 'ember-metal/watching'], function (exports, _emberMetalWatching) { + 'no use strict'; + // Remove "use strict"; from transpiled module until + // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - if (typeof properties !== 'object' && properties !== undefined) { - throw new _emberMetal.Error('Ember.Object.create only accepts objects.'); - } + exports.addDependentKeys = addDependentKeys; + exports.removeDependentKeys = removeDependentKeys; - if (!properties) { - continue; - } + /** + @module ember + @submodule ember-metal + */ - var keyNames = Object.keys(properties); + // .......................................................... + // DEPENDENT KEYS + // - for (var j = 0; j < keyNames.length; j++) { - var keyName = keyNames[j]; - var value = properties[keyName]; + function addDependentKeys(desc, obj, keyName, meta) { + // the descriptor has a list of dependent keys, so + // add all of its dependent keys. + var idx = undefined, + depKey = undefined; + var depKeys = desc._dependentKeys; + if (!depKeys) { + return; + } - if (_emberMetal.detectBinding(keyName)) { - m.writeBindings(keyName, value); - } + for (idx = 0; idx < depKeys.length; idx++) { + depKey = depKeys[idx]; + // Increment the number of times depKey depends on keyName. + meta.writeDeps(depKey, keyName, (meta.peekDeps(depKey, keyName) || 0) + 1); + // Watch the depKey + _emberMetalWatching.watch(obj, depKey, meta); + } + } - var possibleDesc = this[keyName]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; + function removeDependentKeys(desc, obj, keyName, meta) { + // the descriptor has a list of dependent keys, so + // remove all of its dependent keys. + var depKeys = desc._dependentKeys; + if (!depKeys) { + return; + } - _emberMetal.assert('Ember.Object.create no longer supports defining computed ' + 'properties. Define computed properties using extend() or reopen() ' + 'before calling create().', !(value instanceof _emberMetal.ComputedProperty)); - _emberMetal.assert('Ember.Object.create no longer supports defining methods that call _super.', !(typeof value === 'function' && value.toString().indexOf('._super') !== -1)); - _emberMetal.assert('`actions` must be provided at extend time, not at create time, ' + 'when Ember.ActionHandler is used (i.e. views, controllers & routes).', !(keyName === 'actions' && _emberRuntimeMixinsAction_handler.default.detect(this))); + for (var idx = 0; idx < depKeys.length; idx++) { + var depKey = depKeys[idx]; + // Decrement the number of times depKey depends on keyName. + meta.writeDeps(depKey, keyName, (meta.peekDeps(depKey, keyName) || 0) - 1); + // Unwatch the depKey + _emberMetalWatching.unwatch(obj, depKey, meta); + } + } +}); +enifed('ember-metal/deprecate_property', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set) { + /** + @module ember + @submodule ember-metal + */ - if (concatenatedProperties && concatenatedProperties.length > 0 && concatenatedProperties.indexOf(keyName) >= 0) { - var baseValue = this[keyName]; + 'use strict'; - if (baseValue) { - if ('function' === typeof baseValue.concat) { - value = baseValue.concat(value); - } else { - value = _emberUtils.makeArray(baseValue).concat(value); - } - } else { - value = _emberUtils.makeArray(value); - } - } + exports.deprecateProperty = deprecateProperty; - if (mergedProperties && mergedProperties.length && mergedProperties.indexOf(keyName) >= 0) { - var originalValue = this[keyName]; + /** + Used internally to allow changing properties in a backwards compatible way, and print a helpful + deprecation warning. + + @method deprecateProperty + @param {Object} object The object to add the deprecated property to. + @param {String} deprecatedKey The property to add (and print deprecation warnings upon accessing). + @param {String} newKey The property that will be aliased. + @private + @since 1.7.0 + */ - value = _emberUtils.assign({}, originalValue, value); - } + function deprecateProperty(object, deprecatedKey, newKey, options) { + function _deprecate() { + _emberMetalDebug.deprecate('Usage of `' + deprecatedKey + '` is deprecated, use `' + newKey + '` instead.', false, options); + } - if (desc) { - desc.set(this, keyName, value); - } else { - if (typeof this.setUnknownProperty === 'function' && !(keyName in this)) { - this.setUnknownProperty(keyName, value); - } else { - if (true) { - _emberMetal.defineProperty(this, keyName, null, value); // setup mandatory setter - } else { - this[keyName] = value; - } - } - } - } - } + Object.defineProperty(object, deprecatedKey, { + configurable: true, + enumerable: false, + set: function (value) { + _deprecate(); + _emberMetalProperty_set.set(this, newKey, value); + }, + get: function () { + _deprecate(); + return _emberMetalProperty_get.get(this, newKey); } + }); + } +}); +enifed('ember-metal/descriptor', ['exports', 'ember-metal/properties'], function (exports, _emberMetalProperties) { + 'use strict'; - finishPartial(this, m); + exports.default = descriptor; - this.init.apply(this, arguments); + function descriptor(desc) { + return new Descriptor(desc); + } - this[POST_INIT](); + /** + A wrapper for a native ES5 descriptor. In an ideal world, we wouldn't need + this at all, however, the way we currently flatten/merge our mixins require + a special value to denote a descriptor. + + @class Descriptor + @private + */ - m.proto = proto; - _emberMetal.finishChains(this); - _emberMetal.sendEvent(this, 'init'); - }; + var Descriptor = (function (_EmberDescriptor) { + babelHelpers.inherits(Descriptor, _EmberDescriptor); - Class.toString = _emberMetal.Mixin.prototype.toString; - Class.willReopen = function () { - if (wasApplied) { - Class.PrototypeMixin = _emberMetal.Mixin.create(Class.PrototypeMixin); - } + function Descriptor(desc) { + babelHelpers.classCallCheck(this, Descriptor); - wasApplied = false; - }; + _EmberDescriptor.call(this); + this.desc = desc; + } - Class._initProperties = function (args) { - initProperties = args; + Descriptor.prototype.setup = function setup(obj, key) { + Object.defineProperty(obj, key, this.desc); }; - Class.proto = function () { - var superclass = Class.superclass; - if (superclass) { - superclass.proto(); - } - - if (!wasApplied) { - wasApplied = true; - Class.PrototypeMixin.applyPartial(Class.prototype); - } - - return this.prototype; - }; + Descriptor.prototype.teardown = function teardown(obj, key) {}; - return Class; - } + return Descriptor; + })(_emberMetalProperties.Descriptor); +}); +enifed("ember-metal/error", ["exports"], function (exports) { /** - @class CoreObject + A subclass of the JavaScript Error object for use in Ember. + + @class Error @namespace Ember + @extends Error + @constructor @public */ - var CoreObject = makeCtor(); - CoreObject.toString = function () { - return 'Ember.CoreObject'; - }; - CoreObject.PrototypeMixin = _emberMetal.Mixin.create((_Mixin$create = { - reopen: function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } + "use strict"; - applyMixin(this, args, true); - return this; - }, + var EmberError = (function (_Error) { + babelHelpers.inherits(EmberError, _Error); - /** - An overridable method called when objects are instantiated. By default, - does nothing unless it is overridden during class definition. - Example: - ```javascript - const Person = Ember.Object.extend({ - init() { - alert(`Name is ${this.get('name')}`); - } - }); - let steve = Person.create({ - name: "Steve" - }); - // alerts 'Name is Steve'. - ``` - NOTE: If you do override `init` for a framework class like `Ember.View`, - be sure to call `this._super(...arguments)` in your - `init` declaration! If you don't, Ember may not have an opportunity to - do important setup work, and you'll see strange behavior in your - application. - @method init - @public - */ - init: function () {} + function EmberError(message) { + babelHelpers.classCallCheck(this, EmberError); - }, _Mixin$create[POST_INIT] = function () {}, _Mixin$create.__defineNonEnumerable = function (property) { - Object.defineProperty(this, property.name, property.descriptor); - //this[property.name] = property.descriptor.value; - }, _Mixin$create.concatenatedProperties = null, _Mixin$create.mergedProperties = null, _Mixin$create.isDestroyed = _emberMetal.descriptor({ - get: function () { - return _emberMetal.meta(this).isSourceDestroyed(); - }, + _Error.call(this); - set: function (value) { - // prevent setting while applying mixins - if (typeof value === 'object' && value !== null && value.isDescriptor) { - return; + if (!(this instanceof EmberError)) { + return new EmberError(message); } - _emberMetal.assert(('You cannot set `' + this + '.isDestroyed` directly, please use ').destroy()(_templateObject), false); - } - }), _Mixin$create.isDestroying = _emberMetal.descriptor({ - get: function () { - return _emberMetal.meta(this).isSourceDestroying(); - }, + var error = Error.call(this, message); - set: function (value) { - // prevent setting while applying mixins - if (typeof value === 'object' && value !== null && value.isDescriptor) { - return; + if (Error.captureStackTrace) { + Error.captureStackTrace(this, EmberError); + } else { + this.stack = error.stack; } - _emberMetal.assert(('You cannot set `' + this + '.isDestroying` directly, please use ').destroy()(_templateObject), false); - } - }), _Mixin$create.destroy = function () { - var m = _emberMetal.meta(this); - if (m.isSourceDestroying()) { - return; - } - - m.setSourceDestroying(); - - schedule('actions', this, this.willDestroy); - schedule('destroy', this, this._scheduledDestroy, m); - - return this; - }, _Mixin$create.willDestroy = function () {}, _Mixin$create._scheduledDestroy = function (m) { - if (m.isSourceDestroyed()) { - return; - } - _emberMetal.destroy(this); - m.setSourceDestroyed(); - }, _Mixin$create.bind = function (to, from) { - if (!(from instanceof _emberMetal.Binding)) { - from = _emberMetal.Binding.from(from); + this.description = error.description; + this.fileName = error.fileName; + this.lineNumber = error.lineNumber; + this.message = error.message; + this.name = error.name; + this.number = error.number; + this.code = error.code; } - from.to(to).connect(this); - return from; - }, _Mixin$create.toString = function () { - var hasToStringExtension = typeof this.toStringExtension === 'function'; - var extension = hasToStringExtension ? ':' + this.toStringExtension() : ''; - var ret = '<' + this.constructor.toString() + ':' + _emberUtils.guidFor(this) + extension + '>'; - - return ret; - }, _Mixin$create)); - - CoreObject.PrototypeMixin.ownerConstructor = CoreObject; - CoreObject.__super__ = null; + return EmberError; + })(Error); - var ClassMixinProps = { + exports.default = EmberError; +}); +enifed('ember-metal/error_handler', ['exports', 'ember-console', 'ember-metal/testing'], function (exports, _emberConsole, _emberMetalTesting) { + 'use strict'; - ClassMixin: _emberMetal.REQUIRED, + exports.getOnerror = getOnerror; + exports.setOnerror = setOnerror; + exports.dispatchError = dispatchError; + exports.setDispatchOverride = setDispatchOverride; - PrototypeMixin: _emberMetal.REQUIRED, + // To maintain stacktrace consistency across browsers + var getStack = function (error) { + var stack = error.stack; + var message = error.message; - isClass: true, + if (stack && !stack.includes(message)) { + stack = message + '\n' + stack; + } - isMethod: false, - /** - Creates a new subclass. - ```javascript - const Person = Ember.Object.extend({ - say(thing) { - alert(thing); - } - }); - ``` - This defines a new subclass of Ember.Object: `Person`. It contains one method: `say()`. - You can also create a subclass from any existing class by calling its `extend()` method. - For example, you might want to create a subclass of Ember's built-in `Ember.Component` class: - ```javascript - const PersonComponent = Ember.Component.extend({ - tagName: 'li', - classNameBindings: ['isAdministrator'] - }); - ``` - When defining a subclass, you can override methods but still access the - implementation of your parent class by calling the special `_super()` method: - ```javascript - const Person = Ember.Object.extend({ - say(thing) { - var name = this.get('name'); - alert(`${name} says: ${thing}`); - } - }); - const Soldier = Person.extend({ - say(thing) { - this._super(`${thing}, sir!`); - }, - march(numberOfHours) { - alert(`${this.get('name')} marches for ${numberOfHours} hours.`); - } - }); - let yehuda = Soldier.create({ - name: "Yehuda Katz" - }); - yehuda.say("Yes"); // alerts "Yehuda Katz says: Yes, sir!" - ``` - The `create()` on line #17 creates an *instance* of the `Soldier` class. - The `extend()` on line #8 creates a *subclass* of `Person`. Any instance - of the `Person` class will *not* have the `march()` method. - You can also pass `Mixin` classes to add additional properties to the subclass. - ```javascript - const Person = Ember.Object.extend({ - say(thing) { - alert(`${this.get('name')} says: ${thing}`); - } - }); - const SingingMixin = Mixin.create({ - sing(thing){ - alert(`${this.get('name')} sings: la la la ${thing}`); - } - }); - const BroadwayStar = Person.extend(SingingMixin, { - dance() { - alert(`${this.get('name')} dances: tap tap tap tap `); - } - }); - ``` - The `BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`. - @method extend - @static - @param {Mixin} [mixins]* One or more Mixin classes - @param {Object} [arguments]* Object containing values to use within the new class - @public - */ - extend: function () { - var Class = makeCtor(); - var proto; - Class.ClassMixin = _emberMetal.Mixin.create(this.ClassMixin); - Class.PrototypeMixin = _emberMetal.Mixin.create(this.PrototypeMixin); + return stack; + }; - Class.ClassMixin.ownerConstructor = Class; - Class.PrototypeMixin.ownerConstructor = Class; + var onerror = undefined; + // Ember.onerror getter - reopen.apply(Class.PrototypeMixin, arguments); + function getOnerror() { + return onerror; + } - Class.superclass = this; - Class.__super__ = this.prototype; + // Ember.onerror setter - proto = Class.prototype = Object.create(this.prototype); - proto.constructor = Class; - _emberUtils.generateGuid(proto); - _emberMetal.meta(proto).proto = proto; // this will disable observers on prototype + function setOnerror(handler) { + onerror = handler; + } - Class.ClassMixin.apply(Class); - return Class; - }, + var dispatchOverride = undefined; + // dispatch error - /** - Creates an instance of a class. Accepts either no arguments, or an object - containing values to initialize the newly instantiated object with. - ```javascript - const Person = Ember.Object.extend({ - helloWorld() { - alert(`Hi, my name is ${this.get('name')}`); - } - }); - let tom = Person.create({ - name: 'Tom Dale' - }); - tom.helloWorld(); // alerts "Hi, my name is Tom Dale". - ``` - `create` will call the `init` function if defined during - `Ember.AnyObject.extend` - If no arguments are passed to `create`, it will not set values to the new - instance during initialization: - ```javascript - let noName = Person.create(); - noName.helloWorld(); // alerts undefined - ``` - NOTE: For performance reasons, you cannot declare methods or computed - properties during `create`. You should instead declare methods and computed - properties when using `extend`. - @method create - @static - @param [arguments]* - @public - */ - create: function () { - var C = this; + function dispatchError(error) { + if (dispatchOverride) { + dispatchOverride(error); + } else { + defaultDispatch(error); + } + } - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } + // allows testing adapter to override dispatch - if (args.length > 0) { - this._initProperties(args); - } - return new C(); - }, + function setDispatchOverride(handler) { + dispatchOverride = handler; + } - /** - Augments a constructor's prototype with additional - properties and functions: - ```javascript - const MyObject = Ember.Object.extend({ - name: 'an object' - }); - o = MyObject.create(); - o.get('name'); // 'an object' - MyObject.reopen({ - say(msg){ - console.log(msg); - } - }) - o2 = MyObject.create(); - o2.say("hello"); // logs "hello" - o.say("goodbye"); // logs "goodbye" - ``` - To add functions and properties to the constructor itself, - see `reopenClass` - @method reopen - @public - */ - reopen: function () { - this.willReopen(); - reopen.apply(this.PrototypeMixin, arguments); - return this; - }, + function defaultDispatch(error) { + if (_emberMetalTesting.isTesting()) { + throw error; + } + if (onerror) { + onerror(error); + } else { + _emberConsole.default.error(getStack(error)); + } + } +}); +enifed('ember-metal/events', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/meta', 'ember-metal/meta_listeners'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalMeta, _emberMetalMeta_listeners) { + 'no use strict'; + // Remove "use strict"; from transpiled module until + // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - /** - Augments a constructor's own properties and functions: - ```javascript - const MyObject = Ember.Object.extend({ - name: 'an object' - }); - MyObject.reopenClass({ - canBuild: false - }); - MyObject.canBuild; // false - o = MyObject.create(); - ``` - In other words, this creates static properties and functions for the class. - These are only available on the class and not on any instance of that class. - ```javascript - const Person = Ember.Object.extend({ - name: "", - sayHello() { - alert("Hello. My name is " + this.get('name')); - } - }); - Person.reopenClass({ - species: "Homo sapiens", - createPerson(newPersonsName){ - return Person.create({ - name:newPersonsName - }); - } - }); - let tom = Person.create({ - name: "Tom Dale" - }); - let yehuda = Person.createPerson("Yehuda Katz"); - tom.sayHello(); // "Hello. My name is Tom Dale" - yehuda.sayHello(); // "Hello. My name is Yehuda Katz" - alert(Person.species); // "Homo sapiens" - ``` - Note that `species` and `createPerson` are *not* valid on the `tom` and `yehuda` - variables. They are only valid on `Person`. - To add functions and properties to instances of - a constructor by extending the constructor's prototype - see `reopen` - @method reopenClass - @public - */ - reopenClass: function () { - reopen.apply(this.ClassMixin, arguments); - applyMixin(this, arguments, false); - return this; - }, + /** + @module ember + @submodule ember-metal + */ + exports.accumulateListeners = accumulateListeners; + exports.addListener = addListener; + exports.removeListener = removeListener; + exports.suspendListener = suspendListener; + exports.suspendListeners = suspendListeners; + exports.watchedEvents = watchedEvents; + exports.sendEvent = sendEvent; + exports.hasListeners = hasListeners; + exports.listenersFor = listenersFor; + exports.on = on; - detect: function (obj) { - if ('function' !== typeof obj) { - return false; - } - while (obj) { - if (obj === this) { - return true; + /* + The event system uses a series of nested hashes to store listeners on an + object. When a listener is registered, or when an event arrives, these + hashes are consulted to determine which target and action pair to invoke. + + The hashes are stored in the object's meta hash, and look like this: + + // Object's meta hash + { + listeners: { // variable name: `listenerSet` + "foo:changed": [ // variable name: `actions` + target, method, flags + ] + } } - obj = obj.superclass; - } - return false; - }, - - detectInstance: function (obj) { - return obj instanceof this; - }, - - /** - In some cases, you may want to annotate computed properties with additional - metadata about how they function or what values they operate on. For - example, computed property functions may close over variables that are then - no longer available for introspection. - You can pass a hash of these values to a computed property like this: - ```javascript - person: Ember.computed(function() { - var personId = this.get('personId'); - return Person.create({ id: personId }); - }).meta({ type: Person }) - ``` - Once you've done this, you can retrieve the values saved to the computed - property from your class like this: - ```javascript - MyClass.metaForProperty('person'); - ``` - This will return the original hash that was passed to `meta()`. - @static - @method metaForProperty - @param key {String} property name - @private - */ - metaForProperty: function (key) { - var proto = this.proto(); - var possibleDesc = proto[key]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - _emberMetal.assert('metaForProperty() could not find a computed property ' + 'with key \'' + key + '\'.', !!desc && desc instanceof _emberMetal.ComputedProperty); - return desc._meta || {}; - }, - - _computedProperties: _emberMetal.computed(function () { - hasCachedComputedProperties = true; - var proto = this.proto(); - var property; - var properties = []; - - for (var name in proto) { - property = proto[name]; + + */ - if (property && property.isDescriptor) { - properties.push({ - name: name, - meta: property._meta - }); - } + function indexOf(array, target, method) { + var index = -1; + // hashes are added to the end of the event array + // so it makes sense to start searching at the end + // of the array and search in reverse + for (var i = array.length - 3; i >= 0; i -= 3) { + if (target === array[i] && method === array[i + 1]) { + index = i; + break; } - return properties; - }).readOnly(), + } + return index; + } - /** - Iterate over each computed property for the class, passing its name - and any associated metadata (see `metaForProperty`) to the callback. - @static - @method eachComputedProperty - @param {Function} callback - @param {Object} binding - @private - */ - eachComputedProperty: function (callback, binding) { - var property; - var empty = {}; + function accumulateListeners(obj, eventName, otherActions) { + var meta = _emberMetalMeta.peekMeta(obj); + if (!meta) { + return; + } + var actions = meta.matchingListeners(eventName); + var newActions = []; - var properties = _emberMetal.get(this, '_computedProperties'); + for (var i = actions.length - 3; i >= 0; i -= 3) { + var target = actions[i]; + var method = actions[i + 1]; + var flags = actions[i + 2]; + var actionIndex = indexOf(otherActions, target, method); - for (var i = 0; i < properties.length; i++) { - property = properties[i]; - callback.call(binding || this, property.name, property.meta || empty); + if (actionIndex === -1) { + otherActions.push(target, method, flags); + newActions.push(target, method, flags); } } - }; - function injectedPropertyAssertion() { - _emberMetal.assert('Injected properties are invalid', _emberRuntimeInject.validatePropertyInjections(this)); + return newActions; } - _emberMetal.runInDebug(function () { - /** - Provides lookup-time type validation for injected properties. - @private - @method _onLookup - */ - ClassMixinProps._onLookup = injectedPropertyAssertion; - }); - /** - Returns a hash of property names and container names that injected - properties will lookup on the container lazily. + Add an event listener - @method _lazyInjections - @return {Object} Hash of all lazy injected property keys to container names - @private + @method addListener + @for Ember + @param obj + @param {String} eventName + @param {Object|Function} target A target object or a function + @param {Function|String} method A function or the name of a function to be called on `target` + @param {Boolean} once A flag whether a function should only be called once + @public */ - ClassMixinProps._lazyInjections = function () { - var injections = {}; - var proto = this.proto(); - var key, desc; - for (key in proto) { - desc = proto[key]; - if (desc instanceof _emberMetal.InjectedProperty) { - injections[key] = desc.type + ':' + (desc.name || key); - } - } - - return injections; - }; - - var ClassMixin = _emberMetal.Mixin.create(ClassMixinProps); - - ClassMixin.ownerConstructor = CoreObject; - - CoreObject.ClassMixin = ClassMixin; - - ClassMixin.apply(CoreObject); + function addListener(obj, eventName, target, method, once) { + _emberMetalDebug.assert('You must pass at least an object and event name to Ember.addListener', !!obj && !!eventName); - CoreObject.reopen({ - didDefineProperty: function (proto, key, value) { - if (hasCachedComputedProperties === false) { - return; - } - if (value instanceof _emberMetal.ComputedProperty) { - var cache = _emberMetal.meta(this.constructor).readableCache(); + _emberMetalDebug.deprecate('didInitAttrs called in ' + (obj && obj.toString && obj.toString()) + '.', eventName !== 'didInitAttrs', { + id: 'ember-views.did-init-attrs', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x#toc_ember-component-didinitattrs' + }); - if (cache && cache._computedProperties !== undefined) { - cache._computedProperties = undefined; - } - } + if (!method && 'function' === typeof target) { + method = target; + target = null; } - }); - - exports.default = CoreObject; -}); -// Private, and only for didInitAttrs willRecieveAttrs - -/** - 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 - the subclass overrides a property with the same name that is defined - in the superclass. However, there are some cases where it is preferable - to build up a property's value by combining the superclass' property - value with the subclass' value. An example of this in use within Ember - is the `classNames` property of `Ember.View`. - Here is some sample code showing the difference between a concatenated - property and a normal one: - ```javascript - const Bar = Ember.Object.extend({ - // Configure which properties to concatenate - concatenatedProperties: ['concatenatedProperty'], - someNonConcatenatedProperty: ['bar'], - concatenatedProperty: ['bar'] - }); - const FooBar = Bar.extend({ - someNonConcatenatedProperty: ['foo'], - concatenatedProperty: ['foo'] - }); - let fooBar = FooBar.create(); - fooBar.get('someNonConcatenatedProperty'); // ['foo'] - fooBar.get('concatenatedProperty'); // ['bar', 'foo'] - ``` - This behavior extends to object creation as well. Continuing the - above example: - ```javascript - let fooBar = FooBar.create({ - someNonConcatenatedProperty: ['baz'], - concatenatedProperty: ['baz'] - }) - fooBar.get('someNonConcatenatedProperty'); // ['baz'] - fooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz'] - ``` - Adding a single property that is not an array will just add it in the array: - ```javascript - let fooBar = FooBar.create({ - concatenatedProperty: 'baz' - }) - view.get('concatenatedProperty'); // ['bar', 'foo', 'baz'] - ``` - Using the `concatenatedProperties` property, we can tell Ember to mix the - content of the properties. - In `Ember.Component` the `classNames`, `classNameBindings` and - `attributeBindings` properties are concatenated. - This feature is available for you to use throughout the Ember object model, - although typical app developers are likely to use it infrequently. Since - it changes expectations about behavior of properties, you should properly - document its usage in each individual concatenated property (to not - mislead your users to think they can override the property in a subclass). - @property concatenatedProperties - @type Array - @default null - @public -*/ -/** - Defines the properties that will be merged from the superclass - (instead of overridden). - By default, when you extend an Ember class a property defined in - the subclass overrides a property with the same name that is defined - in the superclass. However, there are some cases where it is preferable - to build up a property's value by merging the superclass property value - with the subclass property's value. An example of this in use within Ember - is the `queryParams` property of routes. - Here is some sample code showing the difference between a merged - property and a normal one: - ```javascript - const Bar = Ember.Object.extend({ - // Configure which properties are to be merged - mergedProperties: ['mergedProperty'], - someNonMergedProperty: { - nonMerged: 'superclass value of nonMerged' - }, - mergedProperty: { - page: {replace: false}, - limit: {replace: true} - } - }); - const FooBar = Bar.extend({ - someNonMergedProperty: { - completelyNonMerged: 'subclass value of nonMerged' - }, - mergedProperty: { - limit: {replace: false} + var flags = 0; + if (once) { + flags |= _emberMetalMeta_listeners.ONCE; } - }); - let fooBar = FooBar.create(); - fooBar.get('someNonMergedProperty'); - // => { completelyNonMerged: 'subclass value of nonMerged' } - // - // Note the entire object, including the nonMerged property of - // the superclass object, has been replaced - fooBar.get('mergedProperty'); - // => { - // page: {replace: false}, - // limit: {replace: false} - // } - // - // Note the page remains from the superclass, and the - // `limit` property's value of `false` has been merged from - // the subclass. - ``` - This behavior is not available during object `create` calls. It is only - available at `extend` time. - In `Ember.Route` the `queryParams` property is merged. - This feature is available for you to use throughout the Ember object model, - although typical app developers are likely to use it infrequently. Since - it changes expectations about behavior of properties, you should properly - document its usage in each individual merged property (to not - mislead your users to think they can override the property in a subclass). - @property mergedProperties - @type Array - @default null - @public -*/ - -/** - Destroyed object property flag. - if this property is `true` the observers and bindings were already - removed by the effect of calling the `destroy()` method. - @property isDestroyed - @default false - @public -*/ -/** - Destruction scheduled flag. The `destroy()` method has been called. - The object stays intact until the end of the run loop at which point - the `isDestroyed` flag is set. - @property isDestroying - @default false - @public -*/ + _emberMetalMeta.meta(obj).addToListeners(eventName, target, method, flags); -/** - Destroys an object by setting the `isDestroyed` flag and removing its - metadata, which effectively destroys observers and bindings. - If you try to set a property on a destroyed object, an exception will be - raised. - Note that destruction is scheduled for the end of the run loop and does not - happen immediately. It will set an isDestroying flag immediately. - @method destroy - @return {Ember.Object} receiver - @public -*/ + if ('function' === typeof obj.didAddListener) { + obj.didAddListener(eventName, target, method); + } + } -/** - Override to implement teardown. - @method willDestroy - @public -*/ + /** + Remove an event listener + + Arguments should match those passed to `Ember.addListener`. + + @method removeListener + @for Ember + @param obj + @param {String} eventName + @param {Object|Function} target A target object or a function + @param {Function|String} method A function or the name of a function to be called on `target` + @public + */ -/** - Invoked by the run loop to actually destroy the object. This is - scheduled for execution by the `destroy` method. - @private - @method _scheduledDestroy -*/ + function removeListener(obj, eventName, target, method) { + _emberMetalDebug.assert('You must pass at least an object and event name to Ember.removeListener', !!obj && !!eventName); -/** - Returns a string representation which attempts to provide more information - than Javascript's `toString` typically does, in a generic way for all Ember - objects. - ```javascript - const Person = Ember.Object.extend() - person = Person.create() - person.toString() //=> "" - ``` - If the object's class is not defined on an Ember namespace, it will - indicate it is a subclass of the registered superclass: - ```javascript - const Student = Person.extend() - let student = Student.create() - student.toString() //=> "<(subclass of Person):ember1025>" - ``` - If the method `toStringExtension` is defined, its return value will be - included in the output. - ```javascript - const Teacher = Person.extend({ - toStringExtension() { - return this.get('fullName'); + if (!method && 'function' === typeof target) { + method = target; + target = null; } - }); - teacher = Teacher.create() - teacher.toString(); //=> "" - ``` - @method toString - @return {String} string representation - @public -*/ -enifed('ember-runtime/system/each_proxy', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/mixins/array'], function (exports, _emberUtils, _emberMetal, _emberRuntimeMixinsArray) { - 'use strict'; - exports.default = EachProxy; + _emberMetalMeta.meta(obj).removeFromListeners(eventName, target, method, function () { + if ('function' === typeof obj.didRemoveListener) { + obj.didRemoveListener.apply(obj, arguments); + } + }); + } /** - 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 + Suspend listener during callback. + + This should only be used by the target of the event listener + when it is taking an action that would cause the event, e.g. + an object might suspend its property change listener while it is + setting that property. + + @method suspendListener + @for Ember + @private + @param obj + @param {String} eventName + @param {Object|Function} target A target object or a function + @param {Function|String} method A function or the name of a function to be called on `target` + @param {Function} callback */ - function EachProxy(content) { - this._content = content; - this._keys = undefined; - this.__ember_meta__ = null; + function suspendListener(obj, eventName, target, method, callback) { + return suspendListeners(obj, [eventName], target, method, callback); } - EachProxy.prototype = { - __defineNonEnumerable: function (property) { - this[property.name] = property.descriptor.value; - }, + /** + Suspends multiple listeners during a callback. + + @method suspendListeners + @for Ember + + @private + @param obj + @param {Array} eventNames Array of event names + @param {Object|Function} target A target object or a function + @param {Function|String} method A function or the name of a function to be called on `target` + @param {Function} callback + */ - // .......................................................... - // ARRAY CHANGES - // Invokes whenever the content array itself changes. + function suspendListeners(obj, eventNames, target, method, callback) { + if (!method && 'function' === typeof target) { + method = target; + target = null; + } + return _emberMetalMeta.meta(obj).suspendListeners(eventNames, target, method, callback); + } - arrayWillChange: function (content, idx, removedCnt, addedCnt) { - var keys = this._keys; - var lim = removedCnt > 0 ? idx + removedCnt : -1; - for (var key in keys) { - if (lim > 0) { - removeObserverForContentKey(content, key, this, idx, lim); - } - _emberMetal.propertyWillChange(this, key); - } - }, + /** + Return a list of currently watched events + + @private + @method watchedEvents + @for Ember + @param obj + */ - arrayDidChange: function (content, idx, removedCnt, addedCnt) { - var keys = this._keys; - var lim = addedCnt > 0 ? idx + addedCnt : -1; - for (var key in keys) { - if (lim > 0) { - addObserverForContentKey(content, key, this, idx, lim); - } - _emberMetal.propertyDidChange(this, key); - } - }, + function watchedEvents(obj) { + return _emberMetalMeta.meta(obj).watchedEvents(); + } - // .......................................................... - // LISTEN FOR NEW OBSERVERS AND OTHER EVENT LISTENERS - // Start monitoring keys based on who is listening... + /** + Send an event. The execution of suspended listeners + is skipped, and once listeners are removed. A listener without + a target is executed on the passed object. If an array of actions + is not passed, the actions stored on the passed object are invoked. + + @method sendEvent + @for Ember + @param obj + @param {String} eventName + @param {Array} params Optional parameters for each listener. + @param {Array} actions Optional array of actions (listeners). + @return true + @public + */ - willWatchProperty: function (property) { - this.beginObservingContentKey(property); - }, + function sendEvent(obj, eventName, params, actions) { + if (!actions) { + var meta = _emberMetalMeta.peekMeta(obj); + actions = meta && meta.matchingListeners(eventName); + } - didUnwatchProperty: function (property) { - this.stopObservingContentKey(property); - }, + if (!actions || actions.length === 0) { + return; + } - // .......................................................... - // CONTENT KEY OBSERVING - // Actual watch keys on the source content. + for (var i = actions.length - 3; i >= 0; i -= 3) { + // looping in reverse for once listeners + var target = actions[i]; + var method = actions[i + 1]; + var flags = actions[i + 2]; - beginObservingContentKey: function (keyName) { - var keys = this._keys; - if (!keys) { - keys = this._keys = new _emberUtils.EmptyObject(); + if (!method) { + continue; } - - if (!keys[keyName]) { - keys[keyName] = 1; - var content = this._content; - var len = _emberMetal.get(content, 'length'); - - addObserverForContentKey(content, keyName, this, 0, len); - } else { - keys[keyName]++; + if (flags & _emberMetalMeta_listeners.SUSPENDED) { + continue; } - }, - - stopObservingContentKey: function (keyName) { - var keys = this._keys; - if (keys && keys[keyName] > 0 && --keys[keyName] <= 0) { - var content = this._content; - var len = _emberMetal.get(content, 'length'); - - removeObserverForContentKey(content, keyName, this, 0, len); + if (flags & _emberMetalMeta_listeners.ONCE) { + removeListener(obj, eventName, target, method); } - }, - - contentKeyWillChange: function (obj, keyName) { - _emberMetal.propertyWillChange(this, keyName); - }, - - contentKeyDidChange: function (obj, keyName) { - _emberMetal.propertyDidChange(this, keyName); - } - }; - - function addObserverForContentKey(content, keyName, proxy, idx, loc) { - while (--loc >= idx) { - var item = _emberRuntimeMixinsArray.objectAt(content, loc); - if (item) { - _emberMetal.assert('When using @each to observe the array ' + content + ', the array must return an object', typeof item === 'object'); - _emberMetal._addBeforeObserver(item, keyName, proxy, 'contentKeyWillChange'); - _emberMetal.addObserver(item, keyName, proxy, 'contentKeyDidChange'); + if (!target) { + target = obj; } - } - } - - function removeObserverForContentKey(content, keyName, proxy, idx, loc) { - while (--loc >= idx) { - var item = _emberRuntimeMixinsArray.objectAt(content, loc); - if (item) { - _emberMetal._removeBeforeObserver(item, keyName, proxy, 'contentKeyWillChange'); - _emberMetal.removeObserver(item, keyName, proxy, 'contentKeyDidChange'); + if ('string' === typeof method) { + if (params) { + _emberUtils.applyStr(target, method, params); + } else { + target[method](); + } + } else { + if (params) { + method.apply(target, params); + } else { + method.call(target); + } } } + return true; } -}); -enifed('ember-runtime/system/lazy_load', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { - /*globals CustomEvent */ - - 'use strict'; - - exports.onLoad = onLoad; - exports.runLoadHooks = runLoadHooks; /** - @module ember - @submodule ember-runtime + @private + @method hasListeners + @for Ember + @param obj + @param {String} eventName */ - var loadHooks = _emberEnvironment.ENV.EMBER_LOAD_HOOKS || {}; - var loaded = {}; - var _loaded = loaded; + function hasListeners(obj, eventName) { + var meta = _emberMetalMeta.peekMeta(obj); + if (!meta) { + return false; + } + return meta.matchingListeners(eventName).length > 0; + } - 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 - resolved from a string into the object: - - ``` javascript - Ember.onLoad('Ember.Application' function(hbars) { - hbars.registerHelper(...); - }); - ``` - - @method onLoad - @for Ember - @param name {String} name of hook - @param callback {Function} callback to be called @private + @method listenersFor + @for Ember + @param obj + @param {String} eventName */ - function onLoad(name, callback) { - var object = loaded[name]; + function listenersFor(obj, eventName) { + var ret = []; + var meta = _emberMetalMeta.peekMeta(obj); + var actions = meta && meta.matchingListeners(eventName); - loadHooks[name] = loadHooks[name] || []; - loadHooks[name].push(callback); + if (!actions) { + return ret; + } - if (object) { - callback(object); + for (var i = 0; i < actions.length; i += 3) { + var target = actions[i]; + var method = actions[i + 1]; + ret.push([target, method]); } + + return ret; } /** - Called when an Ember.js package (e.g Ember.Application) has finished - loading. Triggers any callbacks registered for this event. + Define a property as a function that should be executed when + a specified event or events are triggered. - @method runLoadHooks + + ``` javascript + let Job = Ember.Object.extend({ + logCompleted: Ember.on('completed', function() { + console.log('Job completed!'); + }) + }); + + let job = Job.create(); + + Ember.sendEvent(job, 'completed'); // Logs 'Job completed!' + ``` + + @method on @for Ember - @param name {String} name of hook - @param object {Object} object to pass to callbacks - @private + @param {String} eventNames* + @param {Function} func + @return func + @public */ - function runLoadHooks(name, object) { - loaded[name] = object; - var window = _emberEnvironment.environment.window; - - if (window && typeof CustomEvent === 'function') { - var _event = new CustomEvent(name, { detail: object, name: name }); - window.dispatchEvent(_event); + function on() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } - if (loadHooks[name]) { - loadHooks[name].forEach(function (callback) { - return callback(object); - }); - } + var func = args.pop(); + var events = args; + func.__ember_listens__ = events; + return func; } }); -enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal', 'ember-environment', 'ember-runtime/system/object'], function (exports, _emberUtils, _emberMetal, _emberEnvironment, _emberRuntimeSystemObject) { - /** - @module ember - @submodule ember-runtime - */ +enifed('ember-metal/expand_properties', ['exports', 'ember-metal/debug'], function (exports, _emberMetalDebug) { 'use strict'; - exports.isSearchDisabled = isSearchDisabled; - exports.setSearchDisabled = setSearchDisabled; - - var searchDisabled = false; + exports.default = expandProperties; - function isSearchDisabled() { - return searchDisabled; - } + /** + @module ember + @submodule ember-metal + */ - function setSearchDisabled(flag) { - searchDisabled = !!flag; - } + var SPLIT_REGEX = /\{|\}/; + var END_WITH_EACH_REGEX = /\.@each$/; /** - 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. + Expands `pattern`, invoking `callback` for each expansion. - # Example Usage + The only pattern supported is brace-expansion, anything else will be passed + once to `callback` directly. - ```javascript - MyFramework = Ember.Namespace.create({ - VERSION: '1.0.0' - }); + Example + + ```js + function echo(arg){ console.log(arg); } + + 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}.[]', 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' ``` - @class Namespace - @namespace Ember - @extends Ember.Object - @public + @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. */ - var Namespace = _emberRuntimeSystemObject.default.extend({ - isNamespace: true, - init: function () { - Namespace.NAMESPACES.push(this); - Namespace.PROCESSED = false; - }, + function expandProperties(pattern, callback) { + _emberMetalDebug.assert('A computed property key must be a string', typeof pattern === 'string'); + _emberMetalDebug.assert('Brace expanded properties cannot contain spaces, e.g. "user.{firstName, lastName}" should be "user.{firstName,lastName}"', pattern.indexOf(' ') === -1); + _emberMetalDebug.assert('Brace expanded properties have to be balanced and cannot be nested, pattern: ' + pattern, (function (str) { + var inBrace = 0; + var char = undefined; + for (var i = 0; i < str.length; i++) { + char = str.charAt(i); - toString: function () { - var name = _emberMetal.get(this, 'name') || _emberMetal.get(this, 'modulePrefix'); - if (name) { - return name; - } + if (char === '{') { + inBrace++; + } else if (char === '}') { + inBrace--; + } - findNamespaces(); - return this[_emberMetal.NAME_KEY]; - }, + if (inBrace > 1 || inBrace < 0) { + return false; + } + } - nameClasses: function () { - processNamespace([this.toString()], this, {}); - }, + return true; + })(pattern)); - destroy: function () { - var namespaces = Namespace.NAMESPACES; - var toString = this.toString(); + var parts = pattern.split(SPLIT_REGEX); + var properties = [parts]; - if (toString) { - _emberEnvironment.context.lookup[toString] = undefined; - delete Namespace.NAMESPACES_BY_ID[toString]; + for (var i = 0; i < parts.length; i++) { + var part = parts[i]; + if (part.indexOf(',') >= 0) { + properties = duplicateAndReplace(properties, part.split(','), i); } - namespaces.splice(namespaces.indexOf(this), 1); - this._super.apply(this, arguments); } - }); - - Namespace.reopenClass({ - NAMESPACES: [_emberMetal.default], - NAMESPACES_BY_ID: { - Ember: _emberMetal.default - }, - PROCESSED: false, - processAll: processAllNamespaces, - byName: function (name) { - if (!searchDisabled) { - processAllNamespaces(); - } - return NAMESPACES_BY_ID[name]; + for (var i = 0; i < properties.length; i++) { + callback(properties[i].join('').replace(END_WITH_EACH_REGEX, '.[]')); } - }); - - var NAMESPACES_BY_ID = Namespace.NAMESPACES_BY_ID; + } - var hasOwnProp = ({}).hasOwnProperty; + function duplicateAndReplace(properties, currentParts, index) { + var all = []; - function processNamespace(paths, root, seen) { - var idx = paths.length; + properties.forEach(function (property) { + currentParts.forEach(function (part) { + var current = property.slice(0); + current[index] = part; + all.push(current); + }); + }); - NAMESPACES_BY_ID[paths.join('.')] = root; + return all; + } +}); +enifed('ember-metal/features', ['exports', 'ember-utils', 'ember-environment', 'ember/features'], function (exports, _emberUtils, _emberEnvironment, _emberFeatures) { + 'use strict'; - // Loop over all of the keys in the namespace, looking for classes - for (var key in root) { - if (!hasOwnProp.call(root, key)) { - continue; - } - var obj = root[key]; + exports.default = isEnabled; - // If we are processing the `Ember` namespace, for example, the - // `paths` will start with `["Ember"]`. Every iteration through - // the loop will update the **second** element of this list with - // the key, so processing `Ember.View` will make the Array - // `['Ember', 'View']`. - paths[idx] = key; + /** + The hash of enabled Canary features. Add to this, any canary features + before creating your application. + + Alternatively (and recommended), you can also define `EmberENV.FEATURES` + if you need to enable features flagged at runtime. + + @class FEATURES + @namespace Ember + @static + @since 1.1.0 + @public + */ + var FEATURES = _emberUtils.assign(_emberFeatures.default, _emberEnvironment.ENV.FEATURES); - // If we have found an unprocessed class - if (obj && obj.toString === classToString && !obj[_emberMetal.NAME_KEY]) { - // Replace the class' `toString` with the dot-separated path - // and set its `NAME_KEY` - obj[_emberMetal.NAME_KEY] = paths.join('.'); + exports.FEATURES = FEATURES; + /** + Determine whether the specified `feature` is enabled. Used by Ember's + build tools to exclude experimental features from beta/stable builds. + + You can define the following configuration options: + + * `EmberENV.ENABLE_OPTIONAL_FEATURES` - enable any features that have not been explicitly + enabled/disabled. + + @method isEnabled + @param {String} feature The feature to check + @return {Boolean} + @for Ember.FEATURES + @since 1.1.0 + @public + */ - // Support nested namespaces - } else if (obj && obj.isNamespace) { - // Skip aliased namespaces - if (seen[_emberUtils.guidFor(obj)]) { - continue; - } - seen[_emberUtils.guidFor(obj)] = true; + function isEnabled(feature) { + var featureValue = FEATURES[feature]; - // Process the child namespace - processNamespace(paths, obj, seen); - } + if (featureValue === true || featureValue === false || featureValue === undefined) { + return featureValue; + } else if (_emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES) { + return true; + } else { + return false; } - - paths.length = idx; // cut out last item } - function isUppercase(code) { - return code >= 65 && // A - code <= 90; // Z - } + exports.DEFAULT_FEATURES = _emberFeatures.default; +}); +enifed('ember-metal/get_properties', ['exports', 'ember-metal/property_get'], function (exports, _emberMetalProperty_get) { + 'use strict'; - function tryIsNamespace(lookup, prop) { - try { - var obj = lookup[prop]; - return obj && obj.isNamespace && obj; - } catch (e) { - // continue - } - } + exports.default = getProperties; - function findNamespaces() { - if (Namespace.PROCESSED) { - return; - } - var lookup = _emberEnvironment.context.lookup; - var keys = Object.keys(lookup); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - // Only process entities that start with uppercase A-Z - if (!isUppercase(key.charCodeAt(0))) { - continue; - } - var obj = tryIsNamespace(lookup, key); - if (obj) { - obj[_emberMetal.NAME_KEY] = key; - } - } - } + /** + To get multiple properties at once, call `Ember.getProperties` + with an object followed by a list of strings or an array: + + ```javascript + Ember.getProperties(record, 'firstName', 'lastName', 'zipCode'); + // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } + ``` + + is equivalent to: + + ```javascript + Ember.getProperties(record, ['firstName', 'lastName', 'zipCode']); + // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } + ``` + + @method getProperties + @for Ember + @param {Object} obj + @param {String...|Array} list of keys to get + @return {Object} + @public + */ - function superClassString(mixin) { - var superclass = mixin.superclass; - if (superclass) { - if (superclass[_emberMetal.NAME_KEY]) { - return superclass[_emberMetal.NAME_KEY]; - } - return superClassString(superclass); - } - } + function getProperties(obj) { + var ret = {}; + var propertyNames = arguments; + var i = 1; - function classToString() { - if (!searchDisabled && !this[_emberMetal.NAME_KEY]) { - processAllNamespaces(); + if (arguments.length === 2 && Array.isArray(arguments[1])) { + i = 0; + propertyNames = arguments[1]; } - - var ret = undefined; - - if (this[_emberMetal.NAME_KEY]) { - ret = this[_emberMetal.NAME_KEY]; - } else if (this._toString) { - ret = this._toString; - } else { - var str = superClassString(this); - if (str) { - ret = '(subclass of ' + str + ')'; - } else { - ret = '(unknown mixin)'; - } - this.toString = makeToString(ret); + for (; i < propertyNames.length; i++) { + ret[propertyNames[i]] = _emberMetalProperty_get.get(obj, propertyNames[i]); } - return ret; } +}); +enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/merge', 'ember-metal/debug', 'ember-metal/instrumentation', 'ember-metal/testing', 'ember-metal/error_handler', 'ember-metal/meta', 'ember-metal/error', 'ember-metal/cache', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/weak_map', 'ember-metal/events', 'ember-metal/is_none', 'ember-metal/is_empty', 'ember-metal/is_blank', 'ember-metal/is_present', 'ember-metal/run_loop', 'ember-metal/observer_set', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/watch_key', 'ember-metal/chains', 'ember-metal/watch_path', 'ember-metal/watching', 'ember-metal/libraries', 'ember-metal/map', 'ember-metal/get_properties', 'ember-metal/set_properties', 'ember-metal/expand_properties', 'ember-metal/observer', 'ember-metal/mixin', 'ember-metal/binding', 'ember-metal/path_cache', 'ember-metal/injected_property', 'ember-metal/tags', 'ember-metal/replace', 'ember-metal/transaction', 'ember-metal/is_proxy', 'ember-metal/descriptor'], function (exports, _require, _emberMetalCore, _emberMetalComputed, _emberMetalAlias, _emberMetalMerge, _emberMetalDebug, _emberMetalInstrumentation, _emberMetalTesting, _emberMetalError_handler, _emberMetalMeta, _emberMetalError, _emberMetalCache, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalWeak_map, _emberMetalEvents, _emberMetalIs_none, _emberMetalIs_empty, _emberMetalIs_blank, _emberMetalIs_present, _emberMetalRun_loop, _emberMetalObserver_set, _emberMetalProperty_events, _emberMetalProperties, _emberMetalWatch_key, _emberMetalChains, _emberMetalWatch_path, _emberMetalWatching, _emberMetalLibraries, _emberMetalMap, _emberMetalGet_properties, _emberMetalSet_properties, _emberMetalExpand_properties, _emberMetalObserver, _emberMetalMixin, _emberMetalBinding, _emberMetalPath_cache, _emberMetalInjected_property, _emberMetalTags, _emberMetalReplace, _emberMetalTransaction, _emberMetalIs_proxy, _emberMetalDescriptor) { + /** + @module ember + @submodule ember-metal + */ - function processAllNamespaces() { - var unprocessedNamespaces = !Namespace.PROCESSED; - var unprocessedMixins = _emberMetal.hasUnprocessedMixins(); - - if (unprocessedNamespaces) { - findNamespaces(); - Namespace.PROCESSED = true; - } - - if (unprocessedNamespaces || unprocessedMixins) { - var namespaces = Namespace.NAMESPACES; - var namespace = undefined; + 'use strict'; - for (var i = 0; i < namespaces.length; i++) { - namespace = namespaces[i]; - processNamespace([namespace.toString()], namespace, {}); - } + exports.default = _emberMetalCore.default; + // reexports + exports.computed = _emberMetalComputed.default; + exports.cacheFor = _emberMetalComputed.cacheFor; + exports.ComputedProperty = _emberMetalComputed.ComputedProperty; + exports.alias = _emberMetalAlias.default; + exports.merge = _emberMetalMerge.default; + exports.assert = _emberMetalDebug.assert; + exports.info = _emberMetalDebug.info; + exports.warn = _emberMetalDebug.warn; + exports.debug = _emberMetalDebug.debug; + exports.deprecate = _emberMetalDebug.deprecate; + exports.deprecateFunc = _emberMetalDebug.deprecateFunc; + exports.runInDebug = _emberMetalDebug.runInDebug; + exports.setDebugFunction = _emberMetalDebug.setDebugFunction; + exports.getDebugFunction = _emberMetalDebug.getDebugFunction; + exports.debugSeal = _emberMetalDebug.debugSeal; + exports.debugFreeze = _emberMetalDebug.debugFreeze; + exports.instrument = _emberMetalInstrumentation.instrument; + exports.flaggedInstrument = _emberMetalInstrumentation.flaggedInstrument; + exports._instrumentStart = _emberMetalInstrumentation._instrumentStart; + exports.instrumentationReset = _emberMetalInstrumentation.reset; + exports.instrumentationSubscribe = _emberMetalInstrumentation.subscribe; + exports.instrumentationUnsubscribe = _emberMetalInstrumentation.unsubscribe; + exports.isTesting = _emberMetalTesting.isTesting; + exports.setTesting = _emberMetalTesting.setTesting; + exports.getOnerror = _emberMetalError_handler.getOnerror; + exports.setOnerror = _emberMetalError_handler.setOnerror; + exports.dispatchError = _emberMetalError_handler.dispatchError; + exports.setDispatchOverride = _emberMetalError_handler.setDispatchOverride; + exports.META_DESC = _emberMetalMeta.META_DESC; + exports.meta = _emberMetalMeta.meta; + exports.peekMeta = _emberMetalMeta.peekMeta; + exports.Error = _emberMetalError.default; + exports.Cache = _emberMetalCache.default; + exports.isFeatureEnabled = _emberMetalFeatures.default; + exports.FEATURES = _emberMetalFeatures.FEATURES; + exports.DEFAULT_FEATURES = _emberMetalFeatures.DEFAULT_FEATURES; + exports._getPath = _emberMetalProperty_get._getPath; + exports.get = _emberMetalProperty_get.get; + exports.getWithDefault = _emberMetalProperty_get.getWithDefault; + exports.set = _emberMetalProperty_set.set; + exports.trySet = _emberMetalProperty_set.trySet; + exports.WeakMap = _emberMetalWeak_map.default; + exports.accumulateListeners = _emberMetalEvents.accumulateListeners; + exports.addListener = _emberMetalEvents.addListener; + exports.hasListeners = _emberMetalEvents.hasListeners; + exports.listenersFor = _emberMetalEvents.listenersFor; + exports.on = _emberMetalEvents.on; + exports.removeListener = _emberMetalEvents.removeListener; + exports.sendEvent = _emberMetalEvents.sendEvent; + exports.suspendListener = _emberMetalEvents.suspendListener; + exports.suspendListeners = _emberMetalEvents.suspendListeners; + exports.watchedEvents = _emberMetalEvents.watchedEvents; + exports.isNone = _emberMetalIs_none.default; + exports.isEmpty = _emberMetalIs_empty.default; + exports.isBlank = _emberMetalIs_blank.default; + exports.isPresent = _emberMetalIs_present.default; + exports.run = _emberMetalRun_loop.default; + exports.ObserverSet = _emberMetalObserver_set.default; + exports.beginPropertyChanges = _emberMetalProperty_events.beginPropertyChanges; + exports.changeProperties = _emberMetalProperty_events.changeProperties; + exports.endPropertyChanges = _emberMetalProperty_events.endPropertyChanges; + exports.overrideChains = _emberMetalProperty_events.overrideChains; + exports.propertyDidChange = _emberMetalProperty_events.propertyDidChange; + exports.propertyWillChange = _emberMetalProperty_events.propertyWillChange; + exports.PROPERTY_DID_CHANGE = _emberMetalProperty_events.PROPERTY_DID_CHANGE; + exports.defineProperty = _emberMetalProperties.defineProperty; + exports.Descriptor = _emberMetalProperties.Descriptor; + exports.watchKey = _emberMetalWatch_key.watchKey; + exports.unwatchKey = _emberMetalWatch_key.unwatchKey; + exports.ChainNode = _emberMetalChains.ChainNode; + exports.finishChains = _emberMetalChains.finishChains; + exports.removeChainWatcher = _emberMetalChains.removeChainWatcher; + exports.watchPath = _emberMetalWatch_path.watchPath; + exports.unwatchPath = _emberMetalWatch_path.unwatchPath; + exports.destroy = _emberMetalWatching.destroy; + exports.isWatching = _emberMetalWatching.isWatching; + exports.unwatch = _emberMetalWatching.unwatch; + exports.watch = _emberMetalWatching.watch; + exports.watcherCount = _emberMetalWatching.watcherCount; + exports.libraries = _emberMetalLibraries.default; + exports.Map = _emberMetalMap.Map; + exports.MapWithDefault = _emberMetalMap.MapWithDefault; + exports.OrderedSet = _emberMetalMap.OrderedSet; + exports.getProperties = _emberMetalGet_properties.default; + exports.setProperties = _emberMetalSet_properties.default; + exports.expandProperties = _emberMetalExpand_properties.default; + exports._suspendObserver = _emberMetalObserver._suspendObserver; + exports._suspendObservers = _emberMetalObserver._suspendObservers; + exports.addObserver = _emberMetalObserver.addObserver; + exports.observersFor = _emberMetalObserver.observersFor; + exports.removeObserver = _emberMetalObserver.removeObserver; + exports._addBeforeObserver = _emberMetalObserver._addBeforeObserver; + exports._removeBeforeObserver = _emberMetalObserver._removeBeforeObserver; + exports.Mixin = _emberMetalMixin.Mixin; + exports.aliasMethod = _emberMetalMixin.aliasMethod; + exports._immediateObserver = _emberMetalMixin._immediateObserver; + exports._beforeObserver = _emberMetalMixin._beforeObserver; + exports.mixin = _emberMetalMixin.mixin; + exports.observer = _emberMetalMixin.observer; + exports.required = _emberMetalMixin.required; + exports.REQUIRED = _emberMetalMixin.REQUIRED; + exports.hasUnprocessedMixins = _emberMetalMixin.hasUnprocessedMixins; + exports.clearUnprocessedMixins = _emberMetalMixin.clearUnprocessedMixins; + exports.detectBinding = _emberMetalMixin.detectBinding; + exports.Binding = _emberMetalBinding.Binding; + exports.bind = _emberMetalBinding.bind; + exports.isGlobalPath = _emberMetalPath_cache.isGlobalPath; + exports.InjectedProperty = _emberMetalInjected_property.default; + exports.setHasViews = _emberMetalTags.setHasViews; + exports.tagForProperty = _emberMetalTags.tagForProperty; + exports.tagFor = _emberMetalTags.tagFor; + exports.markObjectAsDirty = _emberMetalTags.markObjectAsDirty; + exports.replace = _emberMetalReplace.default; + exports.runInTransaction = _emberMetalTransaction.default; + exports.didRender = _emberMetalTransaction.didRender; + exports.assertNotRendered = _emberMetalTransaction.assertNotRendered; + exports.isProxy = _emberMetalIs_proxy.isProxy; + exports.descriptor = _emberMetalDescriptor.default; - _emberMetal.clearUnprocessedMixins(); - } - } + // TODO: this needs to be deleted once we refactor the build tooling + // do this for side-effects of updating Ember.assert, warn, etc when + // ember-debug is present + // This needs to be called before any deprecateFunc - function makeToString(ret) { - return function () { - return ret; - }; + if (_require.has('ember-debug')) { + _require.default('ember-debug'); } - - _emberMetal.Mixin.prototype.toString = classToString; // ES6TODO: altering imported objects. SBB. - - exports.default = Namespace; }); -// Preloaded into namespaces -enifed('ember-runtime/system/native_array', ['exports', 'ember-metal', 'ember-environment', '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, _emberMetal, _emberEnvironment, _emberRuntimeMixinsArray, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsObservable, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsFreezable, _emberRuntimeCopy) { - /** - @module ember - @submodule ember-runtime - */ +enifed('ember-metal/injected_property', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/properties'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalComputed, _emberMetalAlias, _emberMetalProperties) { '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. + exports.default = InjectedProperty; /** - The NativeArray mixin contains the properties needed to make the native - Array support Ember.MutableArray and all of its dependent APIs. Unless you - have `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Array` set to - false, this will be applied automatically. Otherwise you can apply the mixin - at anytime by calling `Ember.NativeArray.apply(Array.prototype)`. + Read-only property that returns the result of a container lookup. - @class NativeArray + @class InjectedProperty @namespace Ember - @uses Ember.MutableArray - @uses Ember.Observable - @uses Ember.Copyable - @public + @constructor + @param {String} type The container type the property will lookup + @param {String} name (optional) The name the property will lookup, defaults + to the property's name + @private */ - var NativeArray = _emberMetal.Mixin.create(_emberRuntimeMixinsMutable_array.default, _emberRuntimeMixinsObservable.default, _emberRuntimeMixinsCopyable.default, { - - // because length is a built-in property we need to know to just get the - // original property. - get: function (key) { - if ('number' === typeof key) { - return this[key]; - } else { - return this._super(key); - } - }, - - objectAt: function (idx) { - return this[idx]; - }, - - // primitive for array support. - replace: function (idx, amt, objects) { - if (this.isFrozen) { - throw _emberRuntimeMixinsFreezable.FROZEN_ERROR; - } - - // if we replaced exactly the same number of items, then pass only the - // replaced range. Otherwise, pass the full remaining array length - // since everything has shifted - var len = objects ? _emberMetal.get(objects, 'length') : 0; - _emberRuntimeMixinsArray.arrayContentWillChange(this, idx, amt, len); - - if (len === 0) { - this.splice(idx, amt); - } else { - _emberMetal.replace(this, idx, amt, objects); - } - _emberRuntimeMixinsArray.arrayContentDidChange(this, idx, amt, len); - return this; - }, - - // If you ask for an unknown property, then try to collect the value - // from member items. - unknownProperty: function (key, value) { - var ret = undefined; // = this.reducedProperty(key, value); - if (value !== undefined && ret === undefined) { - ret = this[key] = value; - } - return ret; - }, + function InjectedProperty(type, name) { + this.type = type; + this.name = name; - indexOf: Array.prototype.indexOf, - lastIndexOf: Array.prototype.lastIndexOf, + this._super$Constructor(injectedPropertyGet); + AliasedPropertyPrototype.oneWay.call(this); + } - copy: function (deep) { - if (deep) { - return this.map(function (item) { - return _emberRuntimeCopy.default(item, true); - }); - } + function injectedPropertyGet(keyName) { + var desc = this[keyName]; + var owner = _emberUtils.getOwner(this) || this.container; // fallback to `container` for backwards compat - return this.slice(); - } - }); + _emberMetalDebug.assert('InjectedProperties should be defined with the Ember.inject computed property macros.', desc && desc.isDescriptor && desc.type); + _emberMetalDebug.assert('Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container.', owner); - // Remove any methods implemented natively so we don't override them - var ignore = ['length']; - NativeArray.keys().forEach(function (methodName) { - if (Array.prototype[methodName]) { - ignore.push(methodName); - } - }); + return owner.lookup(desc.type + ':' + (desc.name || keyName)); + } - exports.NativeArray // TODO: only use default export - = NativeArray = NativeArray.without.apply(NativeArray, ignore); + InjectedProperty.prototype = Object.create(_emberMetalProperties.Descriptor.prototype); - /** - Creates an `Ember.NativeArray` from an Array like object. - Does not modify the original object. Ember.A is not needed if - `EmberENV.EXTEND_PROTOTYPES` is `true` (the default value). However, - it is recommended that you use Ember.A when creating addons for - ember or when you can not guarantee that `EmberENV.EXTEND_PROTOTYPES` - will be `true`. - - Example - - ```js - export default Ember.Component.extend({ - tagName: 'ul', - classNames: ['pagination'], - - init() { - this._super(...arguments); - - if (!this.get('content')) { - this.set('content', Ember.A()); - } - } - }); - ``` - - @method A - @for Ember - @return {Ember.NativeArray} - @public - */ - var A = undefined; + var InjectedPropertyPrototype = InjectedProperty.prototype; + var ComputedPropertyPrototype = _emberMetalComputed.ComputedProperty.prototype; + var AliasedPropertyPrototype = _emberMetalAlias.AliasedProperty.prototype; - if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.Array) { - NativeArray.apply(Array.prototype); - exports.A = A = function (arr) { - return arr || []; - }; - } else { - exports.A = A = function (arr) { - if (!arr) { - arr = []; - } - return _emberRuntimeMixinsArray.default.detect(arr) ? arr : NativeArray.apply(arr); - }; - } + InjectedPropertyPrototype._super$Constructor = _emberMetalComputed.ComputedProperty; - _emberMetal.default.A = A; - exports.A = A; - exports.NativeArray = NativeArray; - exports.default = NativeArray; + InjectedPropertyPrototype.get = ComputedPropertyPrototype.get; + InjectedPropertyPrototype.readOnly = ComputedPropertyPrototype.readOnly; + InjectedPropertyPrototype.teardown = ComputedPropertyPrototype.teardown; }); -// Ember.A circular -enifed('ember-runtime/system/object', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/system/core_object', 'ember-runtime/mixins/observable'], function (exports, _emberUtils, _emberMetal, _emberRuntimeSystemCore_object, _emberRuntimeMixinsObservable) { - /** - @module ember - @submodule ember-runtime - */ +enifed('ember-metal/instrumentation', ['exports', 'ember-environment', 'ember-metal/features'], function (exports, _emberEnvironment, _emberMetalFeatures) { + /* eslint no-console:off */ + /* global console */ '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. - - @class Object - @namespace Ember - @extends Ember.CoreObject - @uses Ember.Observable - @public - */ - var EmberObject = _emberRuntimeSystemCore_object.default.extend(_emberRuntimeMixinsObservable.default); - EmberObject.toString = function () { - return 'Ember.Object'; - }; - - var FrameworkObject = EmberObject; - - exports.FrameworkObject = FrameworkObject; - _emberMetal.runInDebug(function () { - var _EmberObject$extend; - - var INIT_WAS_CALLED = _emberUtils.symbol('INIT_WAS_CALLED'); - var ASSERT_INIT_WAS_CALLED = _emberUtils.symbol('ASSERT_INIT_WAS_CALLED'); - - exports.FrameworkObject = FrameworkObject = EmberObject.extend((_EmberObject$extend = { - init: function () { - this._super.apply(this, arguments); - this[INIT_WAS_CALLED] = true; - } - - }, _EmberObject$extend[ASSERT_INIT_WAS_CALLED] = _emberMetal.on('init', function () { - _emberMetal.assert('You must call `this._super(...arguments);` when overriding `init` on a framework object. Please update ' + this + ' to call `this._super(...arguments);` from `init`.', this[INIT_WAS_CALLED]); - }), _EmberObject$extend)); - }); - - exports.default = EmberObject; -}); -enifed('ember-runtime/system/object_proxy', ['exports', 'ember-runtime/system/object', 'ember-runtime/mixins/-proxy'], function (exports, _emberRuntimeSystemObject, _emberRuntimeMixinsProxy) { - 'use strict'; + exports.instrument = instrument; + exports._instrumentStart = _instrumentStart; + exports.subscribe = subscribe; + exports.unsubscribe = unsubscribe; + exports.reset = reset; /** - `Ember.ObjectProxy` forwards all properties not defined by the proxy itself - to a proxied `content` object. - - ```javascript - object = Ember.Object.create({ - name: 'Foo' - }); + The purpose of the Ember Instrumentation module is + to provide efficient, general-purpose instrumentation + for Ember. - proxy = Ember.ObjectProxy.create({ - content: object - }); + Subscribe to a listener by using `Ember.subscribe`: - // Access and change existing properties - proxy.get('name') // 'Foo' - proxy.set('name', 'Bar'); - object.get('name') // 'Bar' + ```javascript + Ember.subscribe("render", { + before(name, timestamp, payload) { - // Create new 'description' property on `object` - proxy.set('description', 'Foo is a whizboo baz'); - object.get('description') // 'Foo is a whizboo baz' - ``` + }, - While `content` is unset, setting a property to be delegated will throw an - Error. + after(name, timestamp, payload) { - ```javascript - proxy = Ember.ObjectProxy.create({ - content: null, - flag: null + } }); - proxy.set('flag', true); - proxy.get('flag'); // true - proxy.get('foo'); // undefined - proxy.set('foo', 'data'); // throws Error ``` - Delegated properties can be bound to and will change when content is updated. + If you return a value from the `before` callback, that same + value will be passed as a fourth parameter to the `after` + callback. - Computed properties on the proxy itself can depend on delegated properties. + Instrument a block of code by using `Ember.instrument`: ```javascript - ProxyWithComputedProperty = Ember.ObjectProxy.extend({ - fullName: Ember.computed('firstName', 'lastName', function() { - var firstName = this.get('firstName'), - lastName = this.get('lastName'); - if (firstName && lastName) { - return firstName + ' ' + lastName; - } - return firstName || lastName; - }) - }); - - proxy = ProxyWithComputedProperty.create(); + Ember.instrument("render.handlebars", payload, function() { + // rendering logic + }, binding); + ``` - proxy.get('fullName'); // undefined - proxy.set('content', { - firstName: 'Tom', lastName: 'Dale' - }); // triggers property change for fullName on proxy + Event names passed to `Ember.instrument` are namespaced + by periods, from more general to more specific. Subscribers + can listen for events by whatever level of granularity they + are interested in. - proxy.get('fullName'); // 'Tom Dale' - ``` + In the above example, the event is `render.handlebars`, + and the subscriber listened for all events beginning with + `render`. It would receive callbacks for events named + `render`, `render.handlebars`, `render.container`, or + even `render.handlebars.layout`. - @class ObjectProxy + @class Instrumentation @namespace Ember - @extends Ember.Object - @extends Ember._ProxyMixin - @public + @static + @private */ + var subscribers = []; + exports.subscribers = subscribers; + var cache = {}; - 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'; + function populateListeners(name) { + var listeners = []; + var subscriber = undefined; - /** - 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. - - Example: - - ```javascript - App.ApplicationRoute = Ember.Route.extend({ - authManager: Ember.inject.service('auth'), - - model: function() { - return this.get('authManager').findCurrentUser(); + for (var i = 0; i < subscribers.length; i++) { + subscriber = subscribers[i]; + if (subscriber.regex.test(name)) { + listeners.push(subscriber.object); } - }); - ``` + } + + cache[name] = listeners; + return listeners; + } + + var time = (function () { + var perf = 'undefined' !== typeof window ? window.performance || {} : {}; + var fn = perf.now || perf.mozNow || perf.webkitNow || perf.msNow || perf.oNow; + // fn.bind will be available in all the browsers that support the advanced window.performance... ;-) + return fn ? fn.bind(perf) : function () { + return +new Date(); + }; + })(); + + /** + Notifies event's subscribers, calls `before` and `after` hooks. - This example will create an `authManager` property on the application route - that looks up the `auth` service in the container, making it easily - accessible in the `model` hook. + @method instrument + @namespace Ember.Instrumentation - @method service - @since 1.10.0 - @for Ember.inject - @param {String} name (optional) name of the service to inject, defaults to - the property's name - @return {Ember.InjectedProperty} injection descriptor instance - @public + @param {String} [name] Namespaced event name. + @param {Object} _payload + @param {Function} callback Function that you're instrumenting. + @param {Object} binding Context that instrument function is called with. + @private */ - _emberRuntimeInject.createInjectionHelper('service'); - /** - @class Service - @namespace Ember - @extends Ember.Object - @since 1.10.0 - @public - */ - var Service = _emberRuntimeSystemObject.default.extend(); + function instrument(name, _payload, callback, binding) { + if (arguments.length <= 3 && typeof _payload === 'function') { + binding = callback; + callback = _payload; + _payload = undefined; + } + if (subscribers.length === 0) { + return callback.call(binding); + } + var payload = _payload || {}; + var finalizer = _instrumentStart(name, function () { + return payload; + }); - Service.reopenClass({ - isServiceFactory: true - }); + if (finalizer) { + return withFinalizer(callback, finalizer, payload, binding); + } else { + return callback.call(binding); + } + } - exports.default = Service; -}); -enifed('ember-runtime/system/string', ['exports', 'ember-metal', 'ember-utils', 'ember-runtime/utils', 'ember-runtime/string_registry'], function (exports, _emberMetal, _emberUtils, _emberRuntimeUtils, _emberRuntimeString_registry) { - /** - @module ember - @submodule ember-runtime - */ - 'use strict'; + var flaggedInstrument = undefined; + if (_emberMetalFeatures.default('ember-improved-instrumentation')) { + exports.flaggedInstrument = flaggedInstrument = instrument; + } else { + exports.flaggedInstrument = flaggedInstrument = function (name, payload, callback) { + return callback(); + }; + } + exports.flaggedInstrument = flaggedInstrument; - var STRING_DASHERIZE_REGEXP = /[ _]/g; + function withFinalizer(callback, finalizer, payload, binding) { + var result = undefined; + try { + result = callback.call(binding); + } catch (e) { + payload.exception = e; + result = payload; + } finally { + finalizer(); + } + return result; + } - var STRING_DASHERIZE_CACHE = new _emberMetal.Cache(1000, function (key) { - return decamelize(key).replace(STRING_DASHERIZE_REGEXP, '-'); - }); + function NOOP() {} - var STRING_CAMELIZE_REGEXP_1 = /(\-|\_|\.|\s)+(.)?/g; - var STRING_CAMELIZE_REGEXP_2 = /(^|\/)([A-Z])/g; + // private for now - var CAMELIZE_CACHE = new _emberMetal.Cache(1000, function (key) { - return key.replace(STRING_CAMELIZE_REGEXP_1, function (match, separator, chr) { - return chr ? chr.toUpperCase() : ''; - }).replace(STRING_CAMELIZE_REGEXP_2, function (match, separator, chr) { - return match.toLowerCase(); - }); - }); + function _instrumentStart(name, _payload, _payloadParam) { + if (subscribers.length === 0) { + return NOOP; + } - var STRING_CLASSIFY_REGEXP_1 = /^(\-|_)+(.)?/; - var STRING_CLASSIFY_REGEXP_2 = /(.)(\-|\_|\.|\s)+(.)?/g; - var STRING_CLASSIFY_REGEXP_3 = /(^|\/|\.)([a-z])/g; + var listeners = cache[name]; - var CLASSIFY_CACHE = new _emberMetal.Cache(1000, function (str) { - var replace1 = function (match, separator, chr) { - return chr ? '_' + chr.toUpperCase() : ''; - }; - var replace2 = function (match, initialChar, separator, chr) { - return initialChar + (chr ? chr.toUpperCase() : ''); - }; - var parts = str.split('/'); - for (var i = 0; i < parts.length; i++) { - parts[i] = parts[i].replace(STRING_CLASSIFY_REGEXP_1, replace1).replace(STRING_CLASSIFY_REGEXP_2, replace2); + if (!listeners) { + listeners = populateListeners(name); } - return parts.join('/').replace(STRING_CLASSIFY_REGEXP_3, function (match, separator, chr) { - return match.toUpperCase(); - }); - }); - var STRING_UNDERSCORE_REGEXP_1 = /([a-z\d])([A-Z]+)/g; - var STRING_UNDERSCORE_REGEXP_2 = /\-|\s+/g; + if (listeners.length === 0) { + return NOOP; + } - var UNDERSCORE_CACHE = new _emberMetal.Cache(1000, function (str) { - return str.replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2').replace(STRING_UNDERSCORE_REGEXP_2, '_').toLowerCase(); - }); + var payload = _payload(_payloadParam); - var STRING_CAPITALIZE_REGEXP = /(^|\/)([a-z])/g; + var STRUCTURED_PROFILE = _emberEnvironment.ENV.STRUCTURED_PROFILE; + var timeName = undefined; + if (STRUCTURED_PROFILE) { + timeName = name + ': ' + payload.object; + console.time(timeName); + } - var CAPITALIZE_CACHE = new _emberMetal.Cache(1000, function (str) { - return str.replace(STRING_CAPITALIZE_REGEXP, function (match, separator, chr) { - return match.toUpperCase(); - }); - }); + var beforeValues = new Array(listeners.length); + var i = undefined, + listener = undefined; + var timestamp = time(); + for (i = 0; i < listeners.length; i++) { + listener = listeners[i]; + beforeValues[i] = listener.before(name, timestamp, payload); + } - var STRING_DECAMELIZE_REGEXP = /([a-z\d])([A-Z])/g; + return function _instrumentEnd() { + var i = undefined, + listener = undefined; + var timestamp = time(); + for (i = 0; i < listeners.length; i++) { + listener = listeners[i]; + if (typeof listener.after === 'function') { + listener.after(name, timestamp, payload, beforeValues[i]); + } + } - var DECAMELIZE_CACHE = new _emberMetal.Cache(1000, function (str) { - return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase(); - }); + if (STRUCTURED_PROFILE) { + console.timeEnd(timeName); + } + }; + } - function _fmt(str, formats) { - var cachedFormats = formats; + /** + Subscribes to a particular event or instrumented block of code. + + @method subscribe + @namespace Ember.Instrumentation + + @param {String} [pattern] Namespaced event name. + @param {Object} [object] Before and After hooks. + + @return {Subscriber} + @private + */ - if (!_emberRuntimeUtils.isArray(cachedFormats) || arguments.length > 2) { - cachedFormats = new Array(arguments.length - 1); + function subscribe(pattern, object) { + var paths = pattern.split('.'); + var path = undefined; + var regex = []; - for (var i = 1; i < arguments.length; i++) { - cachedFormats[i - 1] = arguments[i]; + for (var i = 0; i < paths.length; i++) { + path = paths[i]; + if (path === '*') { + regex.push('[^\\.]*'); + } else { + regex.push(path); } } - // first, replace any ORDERED replacements. - var idx = 0; // the current index for non-numerical replacements - return str.replace(/%@([0-9]+)?/g, function (s, argIndex) { - argIndex = argIndex ? parseInt(argIndex, 10) - 1 : idx++; - s = cachedFormats[argIndex]; - return s === null ? '(null)' : s === undefined ? '' : _emberUtils.inspect(s); - }); - } + regex = regex.join('\\.'); + regex = regex + '(\\..*)?'; - function fmt(str, formats) { - _emberMetal.deprecate('Ember.String.fmt is deprecated, use ES6 template strings instead.', false, { id: 'ember-string-utils.fmt', until: '3.0.0', url: 'http://babeljs.io/docs/learn-es2015/#template-strings' }); - return _fmt.apply(undefined, arguments); - } + var subscriber = { + pattern: pattern, + regex: new RegExp('^' + regex + '$'), + object: object + }; - function loc(str, formats) { - if (!_emberRuntimeUtils.isArray(formats) || arguments.length > 2) { - formats = Array.prototype.slice.call(arguments, 1); - } + subscribers.push(subscriber); + cache = {}; - str = _emberRuntimeString_registry.get(str) || str; - return _fmt(str, formats); + return subscriber; } - function w(str) { - return str.split(/\s+/); - } + /** + Unsubscribes from a particular event or instrumented block of code. + + @method unsubscribe + @namespace Ember.Instrumentation + + @param {Object} [subscriber] + @private + */ - function decamelize(str) { - return DECAMELIZE_CACHE.get(str); - } + function unsubscribe(subscriber) { + var index = undefined; - function dasherize(str) { - return STRING_DASHERIZE_CACHE.get(str); - } + for (var i = 0; i < subscribers.length; i++) { + if (subscribers[i] === subscriber) { + index = i; + } + } - function camelize(str) { - return CAMELIZE_CACHE.get(str); + subscribers.splice(index, 1); + cache = {}; } - function classify(str) { - return CLASSIFY_CACHE.get(str); - } + /** + Resets `Ember.Instrumentation` by flushing list of subscribers. + + @method reset + @namespace Ember.Instrumentation + @private + */ - function underscore(str) { - return UNDERSCORE_CACHE.get(str); + function reset() { + subscribers.length = 0; + cache = {}; } +}); +enifed('ember-metal/is_blank', ['exports', 'ember-metal/is_empty'], function (exports, _emberMetalIs_empty) { + 'use strict'; - function capitalize(str) { - return CAPITALIZE_CACHE.get(str); - } + exports.default = isBlank; /** - Defines string helper methods including string formatting and localization. - Unless `EmberENV.EXTEND_PROTOTYPES.String` is `false` these methods will also be - added to the `String.prototype` as well. + A value is blank if it is empty or a whitespace string. - @class String - @namespace Ember - @static + ```javascript + Ember.isBlank(); // true + Ember.isBlank(null); // true + Ember.isBlank(undefined); // true + Ember.isBlank(''); // true + Ember.isBlank([]); // true + Ember.isBlank('\n\t'); // true + Ember.isBlank(' '); // true + Ember.isBlank({}); // false + Ember.isBlank('\n\t Hello'); // false + Ember.isBlank('Hello world'); // false + Ember.isBlank([1,2,3]); // false + ``` + + @method isBlank + @for Ember + @param {Object} obj Value to test + @return {Boolean} + @since 1.5.0 @public */ - exports.default = { - /** - Apply formatting options to the string. This will look for occurrences - of "%@" in your string and substitute them with the arguments you pass into - this method. If you want to control the specific order of replacement, - you can add a number after the key as well to indicate which argument - you want to insert. - Ordered insertions are most useful when building loc strings where values - you need to insert may appear in different orders. - ```javascript - "Hello %@ %@".fmt('John', 'Doe'); // "Hello John Doe" - "Hello %@2, %@1".fmt('John', 'Doe'); // "Hello Doe, John" - ``` - @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: http://babeljs.io/docs/learn-es2015/#template-strings - */ - fmt: fmt, - - /** - Formats the passed string, but first looks up the string in the localized - strings hash. This is a convenient way to localize text. See - `Ember.String.fmt()` for more information on formatting. - Note that it is traditional but not required to prefix localized string - keys with an underscore or other character so you can easily identify - localized strings. - ```javascript - Ember.STRINGS = { - '_Hello World': 'Bonjour le monde', - '_Hello %@ %@': 'Bonjour %@ %@' - }; - Ember.String.loc("_Hello World"); // 'Bonjour le monde'; - Ember.String.loc("_Hello %@ %@", ["John", "Smith"]); // "Bonjour John Smith"; - ``` - @method loc - @param {String} str The string to format - @param {Array} formats Optional array of parameters to interpolate into string. - @return {String} formatted string - @public - */ - loc: loc, - - /** - Splits a string into separate units separated by spaces, eliminating any - empty strings in the process. This is a convenience method for split that - is mostly useful when applied to the `String.prototype`. - ```javascript - Ember.String.w("alpha beta gamma").forEach(function(key) { - console.log(key); - }); - // > alpha - // > beta - // > gamma - ``` - @method w - @param {String} str The string to split - @return {Array} array containing the split strings - @public - */ - w: w, - - /** - Converts a camelized string into all lower case separated by underscores. - ```javascript - 'innerHTML'.decamelize(); // 'inner_html' - 'action_name'.decamelize(); // 'action_name' - 'css-class-name'.decamelize(); // 'css-class-name' - 'my favorite items'.decamelize(); // 'my favorite items' - ``` - @method decamelize - @param {String} str The string to decamelize. - @return {String} the decamelized string. - @public - */ - decamelize: decamelize, - - /** - Replaces underscores, spaces, or camelCase with dashes. - ```javascript - 'innerHTML'.dasherize(); // 'inner-html' - 'action_name'.dasherize(); // 'action-name' - 'css-class-name'.dasherize(); // 'css-class-name' - 'my favorite items'.dasherize(); // 'my-favorite-items' - 'privateDocs/ownerInvoice'.dasherize(); // 'private-docs/owner-invoice' - ``` - @method dasherize - @param {String} str The string to dasherize. - @return {String} the dasherized string. - @public - */ - dasherize: dasherize, - - /** - Returns the lowerCamelCase form of a string. - ```javascript - 'innerHTML'.camelize(); // 'innerHTML' - 'action_name'.camelize(); // 'actionName' - 'css-class-name'.camelize(); // 'cssClassName' - 'my favorite items'.camelize(); // 'myFavoriteItems' - 'My Favorite Items'.camelize(); // 'myFavoriteItems' - 'private-docs/owner-invoice'.camelize(); // 'privateDocs/ownerInvoice' - ``` - @method camelize - @param {String} str The string to camelize. - @return {String} the camelized string. - @public - */ - camelize: camelize, - - /** - Returns the UpperCamelCase form of a string. - ```javascript - 'innerHTML'.classify(); // 'InnerHTML' - 'action_name'.classify(); // 'ActionName' - 'css-class-name'.classify(); // 'CssClassName' - 'my favorite items'.classify(); // 'MyFavoriteItems' - 'private-docs/owner-invoice'.classify(); // 'PrivateDocs/OwnerInvoice' - ``` - @method classify - @param {String} str the string to classify - @return {String} the classified string - @public - */ - classify: classify, - - /** - More general than decamelize. Returns the lower\_case\_and\_underscored - form of a string. - ```javascript - 'innerHTML'.underscore(); // 'inner_html' - 'action_name'.underscore(); // 'action_name' - 'css-class-name'.underscore(); // 'css_class_name' - 'my favorite items'.underscore(); // 'my_favorite_items' - 'privateDocs/ownerInvoice'.underscore(); // 'private_docs/owner_invoice' - ``` - @method underscore - @param {String} str The string to underscore. - @return {String} the underscored string. - @public - */ - underscore: underscore, - /** - Returns the Capitalized form of a string - ```javascript - 'innerHTML'.capitalize() // 'InnerHTML' - 'action_name'.capitalize() // 'Action_name' - 'css-class-name'.capitalize() // 'Css-class-name' - 'my favorite items'.capitalize() // 'My favorite items' - 'privateDocs/ownerInvoice'.capitalize(); // 'PrivateDocs/ownerInvoice' - ``` - @method capitalize - @param {String} str The string to capitalize. - @return {String} The capitalized string. - @public - */ - capitalize: capitalize - }; - exports.fmt = fmt; - exports.loc = loc; - exports.w = w; - exports.decamelize = decamelize; - exports.dasherize = dasherize; - exports.camelize = camelize; - exports.classify = classify; - exports.underscore = underscore; - exports.capitalize = capitalize; + function isBlank(obj) { + return _emberMetalIs_empty.default(obj) || typeof obj === 'string' && obj.match(/\S/) === null; + } }); -enifed('ember-runtime/utils', ['exports', 'ember-runtime/mixins/array', 'ember-runtime/system/object'], function (exports, _emberRuntimeMixinsArray, _emberRuntimeSystemObject) { +enifed('ember-metal/is_empty', ['exports', 'ember-metal/property_get', 'ember-metal/is_none'], function (exports, _emberMetalProperty_get, _emberMetalIs_none) { 'use strict'; - exports.isArray = isArray; - exports.typeOf = typeOf; - - // ........................................ - // TYPING & ARRAY MESSAGING - // - var TYPE_MAP = { - '[object Boolean]': 'boolean', - '[object Number]': 'number', - '[object String]': 'string', - '[object Function]': 'function', - '[object Array]': 'array', - '[object Date]': 'date', - '[object RegExp]': 'regexp', - '[object Object]': 'object', - '[object FileList]': 'filelist' - }; - - var toString = Object.prototype.toString; + exports.default = isEmpty; /** - Returns true if the passed object is an array or Array-like. - - Objects are considered Array-like if any of the following are true: - - - the object is a native Array - - the object has an objectAt property - - the object is an Object, and has a length property + Verifies that a value is `null` or an empty string, empty array, + or empty function. - Unlike `Ember.typeOf` this method returns true even if the passed object is - not formally an array but appears to be array-like (i.e. implements `Ember.Array`) + Constrains the rules on `Ember.isNone` by returning true for empty + string and empty arrays. ```javascript - Ember.isArray(); // false - Ember.isArray([]); // true - Ember.isArray(Ember.ArrayProxy.create({ content: [] })); // true + Ember.isEmpty(); // true + Ember.isEmpty(null); // true + Ember.isEmpty(undefined); // true + Ember.isEmpty(''); // true + Ember.isEmpty([]); // true + Ember.isEmpty({}); // false + Ember.isEmpty('Adam Hawkins'); // false + Ember.isEmpty([0,1,2]); // false + Ember.isEmpty('\n\t'); // false + Ember.isEmpty(' '); // false ``` - @method isArray + @method isEmpty @for Ember - @param {Object} obj The object to test - @return {Boolean} true if the passed object is an array or Array-like + @param {Object} obj Value to test + @return {Boolean} @public */ - function isArray(obj) { - if (!obj || obj.setInterval) { - return false; + function isEmpty(obj) { + var none = _emberMetalIs_none.default(obj); + if (none) { + return none; } - if (Array.isArray(obj)) { - return true; + + if (typeof obj.size === 'number') { + return !obj.size; } - if (_emberRuntimeMixinsArray.default.detect(obj)) { - return true; + + var objectType = typeof obj; + + if (objectType === 'object') { + var size = _emberMetalProperty_get.get(obj, 'size'); + if (typeof size === 'number') { + return !size; + } } - var type = typeOf(obj); - if ('array' === type) { - return true; + if (typeof obj.length === 'number' && objectType !== 'function') { + return !obj.length; } - if (obj.length !== undefined && 'object' === type) { - return true; + + if (objectType === 'object') { + var _length = _emberMetalProperty_get.get(obj, 'length'); + if (typeof _length === 'number') { + return !_length; + } } + return false; } - +}); +enifed("ember-metal/is_none", ["exports"], function (exports) { /** - Returns a consistent type for the passed object. - - Use this instead of the built-in `typeof` to get the type of an item. - It will return the same result across all browsers and includes a bit - more detail. Here is what will be returned: + Returns true if the passed value is null or undefined. This avoids errors + from JSLint complaining about use of ==, which can be technically + confusing. - | Return Value | Meaning | - |---------------|------------------------------------------------------| - | 'string' | String primitive or String object. | - | 'number' | Number primitive or Number object. | - | 'boolean' | Boolean primitive or Boolean object. | - | 'null' | Null value | - | 'undefined' | Undefined value | - | 'function' | A function | - | 'array' | An instance of Array | - | 'regexp' | An instance of RegExp | - | 'date' | An instance of Date | - | 'filelist' | An instance of FileList | - | 'class' | An Ember class (created using Ember.Object.extend()) | - | 'instance' | An Ember object instance | - | 'error' | An instance of the Error object | - | 'object' | A JavaScript object not inheriting from Ember.Object | + ```javascript + Ember.isNone(); // true + Ember.isNone(null); // true + Ember.isNone(undefined); // true + Ember.isNone(''); // false + Ember.isNone([]); // false + Ember.isNone(function() {}); // false + ``` - Examples: + @method isNone + @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`. ```javascript - Ember.typeOf(); // 'undefined' - Ember.typeOf(null); // 'null' - Ember.typeOf(undefined); // 'undefined' - Ember.typeOf('michael'); // 'string' - Ember.typeOf(new String('michael')); // 'string' - Ember.typeOf(101); // 'number' - Ember.typeOf(new Number(101)); // 'number' - Ember.typeOf(true); // 'boolean' - Ember.typeOf(new Boolean(true)); // 'boolean' - Ember.typeOf(Ember.makeArray); // 'function' - Ember.typeOf([1, 2, 90]); // 'array' - Ember.typeOf(/abc/); // 'regexp' - Ember.typeOf(new Date()); // 'date' - Ember.typeOf(event.target.files); // 'filelist' - Ember.typeOf(Ember.Object.extend()); // 'class' - Ember.typeOf(Ember.Object.create()); // 'instance' - Ember.typeOf(new Error('teamocil')); // 'error' - - // 'normal' JavaScript object - Ember.typeOf({ a: 'b' }); // 'object' + Ember.isPresent(); // false + Ember.isPresent(null); // false + Ember.isPresent(undefined); // false + Ember.isPresent(''); // false + Ember.isPresent(' '); // false + Ember.isPresent('\n\t'); // false + Ember.isPresent([]); // false + Ember.isPresent({ length: 0 }) // false + Ember.isPresent(false); // true + Ember.isPresent(true); // true + Ember.isPresent('string'); // true + Ember.isPresent(0); // true + Ember.isPresent(function() {}) // true + Ember.isPresent({}); // true + Ember.isPresent(false); // true + Ember.isPresent('\n\t Hello'); // true + Ember.isPresent([1,2,3]); // true ``` - @method typeOf + @method isPresent @for Ember - @param {Object} item the item to check - @return {String} the type + @param {Object} obj Value to test + @return {Boolean} + @since 1.8.0 @public */ - function typeOf(item) { - if (item === null) { - return 'null'; - } - if (item === undefined) { - return 'undefined'; - } - var ret = TYPE_MAP[toString.call(item)] || 'object'; + function isPresent(obj) { + return !_emberMetalIs_blank.default(obj); + } +}); +enifed('ember-metal/is_proxy', ['exports', 'ember-metal/meta'], function (exports, _emberMetalMeta) { + 'use strict'; - if (ret === 'function') { - if (_emberRuntimeSystemObject.default.detect(item)) { - ret = 'class'; - } - } else if (ret === 'object') { - if (item instanceof Error) { - ret = 'error'; - } else if (item instanceof _emberRuntimeSystemObject.default) { - ret = 'instance'; - } else if (item instanceof Date) { - ret = 'date'; - } + exports.isProxy = isProxy; + + function isProxy(value) { + if (typeof value === 'object' && value) { + var meta = _emberMetalMeta.peekMeta(value); + return meta && meta.isProxy(); } - return ret; + return false; } }); -enifed('ember-testing/adapters/adapter', ['exports', 'ember-runtime'], function (exports, _emberRuntime) { +enifed('ember-metal/libraries', ['exports', 'ember-metal/debug', 'ember-metal/features'], function (exports, _emberMetalDebug, _emberMetalFeatures) { 'use strict'; - function K() { - return this; - } - - /** - @module ember - @submodule ember-testing - */ - /** - The primary purpose of this class is to create hooks that can be implemented - by an adapter for various test frameworks. + Helper class that allows you to register your library with Ember. - @class Adapter - @namespace Ember.Test - @public + Singleton created at `Ember.libraries`. + + @class Libraries + @constructor + @private */ - exports.default = _emberRuntime.Object.extend({ - /** - This callback will be called whenever an async operation is about to start. - Override this to call your framework's methods that handle async - operations. - @public - @method asyncStart - */ - asyncStart: K, - /** - This callback will be called whenever an async operation has completed. - @public - @method asyncEnd - */ - asyncEnd: K, + var Libraries = (function () { + function Libraries() { + babelHelpers.classCallCheck(this, Libraries); - /** - Override this method with your testing framework's false assertion. - This function is called whenever an exception occurs causing the testing - promise to fail. - QUnit example: - ```javascript - exception: function(error) { - ok(false, error); - }; - ``` - @public - @method exception - @param {String} error The exception to be raised. - */ - exception: function (error) { - throw error; + this._registry = []; + this._coreLibIndex = 0; } - }); -}); -enifed('ember-testing/adapters/qunit', ['exports', 'ember-utils', 'ember-testing/adapters/adapter'], function (exports, _emberUtils, _emberTestingAdaptersAdapter) { - 'use strict'; - /** - This class implements the methods defined by Ember.Test.Adapter for the - QUnit testing framework. - - @class QUnitAdapter - @namespace Ember.Test - @extends Ember.Test.Adapter - @public - */ - exports.default = _emberTestingAdaptersAdapter.default.extend({ - asyncStart: function () { - QUnit.stop(); - }, - asyncEnd: function () { - QUnit.start(); + Libraries.prototype.isRegistered = function isRegistered(name) { + return !!this._getLibraryByName(name); + }; + + return Libraries; + })(); + + exports.Libraries = Libraries; + + Libraries.prototype = { + constructor: Libraries, + + _getLibraryByName: function (name) { + var libs = this._registry; + var count = libs.length; + + for (var i = 0; i < count; i++) { + if (libs[i].name === name) { + return libs[i]; + } + } }, - exception: function (error) { - ok(false, _emberUtils.inspect(error)); - } - }); -}); -enifed('ember-testing/events', ['exports', 'ember-views', 'ember-metal'], function (exports, _emberViews, _emberMetal) { - 'use strict'; - exports.focus = focus; - exports.fireEvent = fireEvent; + register: function (name, version, isCoreLibrary) { + var index = this._registry.length; - var DEFAULT_EVENT_OPTIONS = { canBubble: true, cancelable: true }; - var KEYBOARD_EVENT_TYPES = ['keydown', 'keypress', 'keyup']; - var MOUSE_EVENT_TYPES = ['click', 'mousedown', 'mouseup', 'dblclick', 'mouseenter', 'mouseleave', 'mousemove', 'mouseout', 'mouseover']; + if (!this._getLibraryByName(name)) { + if (isCoreLibrary) { + index = this._coreLibIndex++; + } + this._registry.splice(index, 0, { name: name, version: version }); + } else { + _emberMetalDebug.warn('Library "' + name + '" is already registered with Ember.', false, { id: 'ember-metal.libraries-register' }); + } + }, - function focus(el) { - if (!el) { - return; - } - var $el = _emberViews.jQuery(el); - if ($el.is(':input, [contenteditable=true]')) { - var type = $el.prop('type'); - if (type !== 'checkbox' && type !== 'radio' && type !== 'hidden') { - _emberMetal.run(null, function () { - // Firefox does not trigger the `focusin` event if the window - // does not have focus. If the document doesn't have focus just - // use trigger('focusin') instead. + registerCoreLibrary: function (name, version) { + this.register(name, version, true); + }, - if (!document.hasFocus || document.hasFocus()) { - el.focus(); - } else { - $el.trigger('focusin'); - } - }); + deRegister: function (name) { + var lib = this._getLibraryByName(name); + var index = undefined; + + if (lib) { + index = this._registry.indexOf(lib); + this._registry.splice(index, 1); } } + }; + + if (_emberMetalFeatures.default('ember-libraries-isregistered')) { + Libraries.prototype.isRegistered = function (name) { + return !!this._getLibraryByName(name); + }; } - function fireEvent(element, type) { - var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + exports.default = new Libraries(); +}); +enifed('ember-metal/map', ['exports', 'ember-utils'], function (exports, _emberUtils) { + /** + @module ember + @submodule ember-metal + */ - if (!element) { - return; - } - var event = undefined; - if (KEYBOARD_EVENT_TYPES.indexOf(type) > -1) { - event = buildKeyboardEvent(type, options); - } else if (MOUSE_EVENT_TYPES.indexOf(type) > -1) { - var rect = element.getBoundingClientRect(); - var x = rect.left + 1; - var y = rect.top + 1; - var simulatedCoordinates = { - screenX: x + 5, - screenY: y + 95, - clientX: x, - clientY: y - }; - event = buildMouseEvent(type, _emberViews.jQuery.extend(simulatedCoordinates, options)); - } else { - event = buildBasicEvent(type, options); - } - element.dispatchEvent(event); - } + /* + 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 buildBasicEvent(type) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + function missingFunction(fn) { + throw new TypeError(Object.prototype.toString.call(fn) + ' is not a function'); + } - var event = document.createEvent('Events'); - event.initEvent(type, true, true); - _emberViews.jQuery.extend(event, options); - return event; + function missingNew(name) { + throw new TypeError('Constructor ' + name + ' requires \'new\''); } - function buildMouseEvent(type) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + function copyNull(obj) { + var output = new _emberUtils.EmptyObject(); - var event = undefined; - try { - event = document.createEvent('MouseEvents'); - var eventOpts = _emberViews.jQuery.extend({}, DEFAULT_EVENT_OPTIONS, options); - event.initMouseEvent(type, eventOpts.canBubble, eventOpts.cancelable, window, eventOpts.detail, eventOpts.screenX, eventOpts.screenY, eventOpts.clientX, eventOpts.clientY, eventOpts.ctrlKey, eventOpts.altKey, eventOpts.shiftKey, eventOpts.metaKey, eventOpts.button, eventOpts.relatedTarget); - } catch (e) { - event = buildBasicEvent(type, options); + for (var prop in obj) { + // hasOwnPropery is not needed because obj is new EmptyObject(); + output[prop] = obj[prop]; } - return event; + + return output; } - function buildKeyboardEvent(type) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + function copyMap(original, newObject) { + var keys = original._keys.copy(); + var values = copyNull(original._values); - var event = undefined; - try { - event = document.createEvent('KeyEvents'); - var eventOpts = _emberViews.jQuery.extend({}, DEFAULT_EVENT_OPTIONS, options); - event.initKeyEvent(type, eventOpts.canBubble, eventOpts.cancelable, window, eventOpts.ctrlKey, eventOpts.altKey, eventOpts.shiftKey, eventOpts.metaKey, eventOpts.keyCode, eventOpts.charCode); - } catch (e) { - event = buildBasicEvent(type, options); + newObject._keys = keys; + newObject._values = values; + newObject.size = original.size; + + return newObject; + } + + /** + This class is used internally by Ember and Ember Data. + Please do not use it at this time. We plan to clean it up + and add many tests soon. + + @class OrderedSet + @namespace Ember + @constructor + @private + */ + function OrderedSet() { + if (this instanceof OrderedSet) { + this.clear(); + this._silenceRemoveDeprecation = false; + } else { + missingNew('OrderedSet'); } - return event; } -}); -enifed('ember-testing/ext/application', ['exports', 'ember-application', 'ember-testing/setup_for_testing', 'ember-testing/test/helpers', 'ember-testing/test/promise', 'ember-testing/test/run', 'ember-testing/test/on_inject_helpers', 'ember-testing/test/adapter'], function (exports, _emberApplication, _emberTestingSetup_for_testing, _emberTestingTestHelpers, _emberTestingTestPromise, _emberTestingTestRun, _emberTestingTestOn_inject_helpers, _emberTestingTestAdapter) { - 'use strict'; - _emberApplication.Application.reopen({ - /** - This property contains the testing helpers for the current application. These - are created once you call `injectTestHelpers` on your `Ember.Application` - instance. The included helpers are also available on the `window` object by - default, but can be used from this object on the individual application also. - @property testHelpers - @type {Object} - @default {} - @public - */ - testHelpers: {}, + /** + @method create + @static + @return {Ember.OrderedSet} + @private + */ + OrderedSet.create = function () { + var Constructor = this; - /** - This property will contain the original methods that were registered - on the `helperContainer` before `injectTestHelpers` is called. - When `removeTestHelpers` is called, these methods are restored to the - `helperContainer`. - @property originalMethods - @type {Object} - @default {} - @private - @since 1.3.0 - */ - originalMethods: {}, + return new Constructor(); + }; + OrderedSet.prototype = { + constructor: OrderedSet, /** - This property indicates whether or not this application is currently in - testing mode. This is set when `setupForTesting` is called on the current - application. - @property testing - @type {Boolean} - @default false - @since 1.3.0 - @public + @method clear + @private */ - testing: false, + clear: function () { + this.presenceSet = new _emberUtils.EmptyObject(); + this.list = []; + this.size = 0; + }, /** - This hook defers the readiness of the application, so that you can start - the app when your tests are ready to run. It also sets the router's - location to 'none', so that the window's location will not be modified - (preventing both accidental leaking of state between tests and interference - with your testing framework). - Example: - ``` - App.setupForTesting(); - ``` - @method setupForTesting - @public + @method add + @param obj + @param guid (optional, and for internal use) + @return {Ember.OrderedSet} + @private */ - setupForTesting: function () { - _emberTestingSetup_for_testing.default(); + add: function (obj, _guid) { + var guid = _guid || _emberUtils.guidFor(obj); + var presenceSet = this.presenceSet; + var list = this.list; - this.testing = true; + if (presenceSet[guid] !== true) { + presenceSet[guid] = true; + this.size = list.push(obj); + } - this.Router.reopen({ - location: 'none' - }); + return this; }, /** - This will be used as the container to inject the test helpers into. By - default the helpers are injected into `window`. - @property helperContainer - @type {Object} The object to be used for test helpers. - @default window - @since 1.2.0 + @since 1.8.0 + @method delete + @param obj + @param _guid (optional and for internal use only) + @return {Boolean} @private */ - helperContainer: null, - - /** - This injects the test helpers into the `helperContainer` object. If an object is provided - it will be used as the helperContainer. If `helperContainer` is not set it will default - to `window`. If a function of the same name has already been defined it will be cached - (so that it can be reset if the helper is removed with `unregisterHelper` or - `removeTestHelpers`). - Any callbacks registered with `onInjectHelpers` will be called once the - helpers have been injected. - Example: - ``` - App.injectTestHelpers(); - ``` - @method injectTestHelpers - @public - */ - injectTestHelpers: function (helperContainer) { - if (helperContainer) { - this.helperContainer = helperContainer; - } else { - this.helperContainer = window; - } + delete: function (obj, _guid) { + var guid = _guid || _emberUtils.guidFor(obj); + var presenceSet = this.presenceSet; + var list = this.list; - this.reopen({ - willDestroy: function () { - this._super.apply(this, arguments); - this.removeTestHelpers(); + if (presenceSet[guid] === true) { + delete presenceSet[guid]; + var index = list.indexOf(obj); + if (index > -1) { + list.splice(index, 1); } - }); - - this.testHelpers = {}; - for (var _name in _emberTestingTestHelpers.helpers) { - this.originalMethods[_name] = this.helperContainer[_name]; - this.testHelpers[_name] = this.helperContainer[_name] = helper(this, _name); - protoWrap(_emberTestingTestPromise.default.prototype, _name, helper(this, _name), _emberTestingTestHelpers.helpers[_name].meta.wait); + this.size = list.length; + return true; + } else { + return false; } - - _emberTestingTestOn_inject_helpers.invokeInjectHelpersCallbacks(this); }, /** - This removes all helpers that have been registered, and resets and functions - that were overridden by the helpers. - Example: - ```javascript - App.removeTestHelpers(); - ``` - @public - @method removeTestHelpers + @method isEmpty + @return {Boolean} + @private */ - removeTestHelpers: function () { - if (!this.helperContainer) { - return; - } - - for (var _name2 in _emberTestingTestHelpers.helpers) { - this.helperContainer[_name2] = this.originalMethods[_name2]; - delete _emberTestingTestPromise.default.prototype[_name2]; - delete this.testHelpers[_name2]; - delete this.originalMethods[_name2]; - } - } - }); - - // This method is no longer needed - // But still here for backwards compatibility - // of helper chaining - function protoWrap(proto, name, callback, isAsync) { - proto[name] = function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - if (isAsync) { - return callback.apply(this, args); - } else { - return this.then(function () { - return callback.apply(this, args); - }); - } - }; - } - - function helper(app, name) { - var fn = _emberTestingTestHelpers.helpers[name].method; - var meta = _emberTestingTestHelpers.helpers[name].meta; - if (!meta.wait) { - return function () { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - return fn.apply(app, [app].concat(args)); - }; - } + isEmpty: function () { + return this.size === 0; + }, - return function () { - for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; + /** + @method has + @param obj + @return {Boolean} + @private + */ + has: function (obj) { + if (this.size === 0) { + return false; } - var lastPromise = _emberTestingTestRun.default(function () { - return _emberTestingTestPromise.resolve(_emberTestingTestPromise.getLastPromise()); - }); + var guid = _emberUtils.guidFor(obj); + var presenceSet = this.presenceSet; - // wait for last helper's promise to resolve and then - // execute. To be safe, we need to tell the adapter we're going - // asynchronous here, because fn may not be invoked before we - // return. - _emberTestingTestAdapter.asyncStart(); - return lastPromise.then(function () { - return fn.apply(app, [app].concat(args)); - }).finally(_emberTestingTestAdapter.asyncEnd); - }; - } -}); -enifed('ember-testing/ext/rsvp', ['exports', 'ember-runtime', 'ember-metal', 'ember-testing/test/adapter'], function (exports, _emberRuntime, _emberMetal, _emberTestingTestAdapter) { - 'use strict'; + return presenceSet[guid] === true; + }, - _emberRuntime.RSVP.configure('async', function (callback, promise) { - // if schedule will cause autorun, we need to inform adapter - if (_emberMetal.isTesting() && !_emberMetal.run.backburner.currentInstance) { - _emberTestingTestAdapter.asyncStart(); - _emberMetal.run.backburner.schedule('actions', function () { - _emberTestingTestAdapter.asyncEnd(); - callback(promise); - }); - } else { - _emberMetal.run.backburner.schedule('actions', function () { - return callback(promise); - }); - } - }); + /** + @method forEach + @param {Function} fn + @param self + @private + */ + forEach: function (fn /*, ...thisArg*/) { + if (typeof fn !== 'function') { + missingFunction(fn); + } - exports.default = _emberRuntime.RSVP; -}); -enifed('ember-testing/helpers', ['exports', 'ember-metal', 'ember-testing/test/helpers', 'ember-testing/helpers/and_then', 'ember-testing/helpers/click', 'ember-testing/helpers/current_path', 'ember-testing/helpers/current_route_name', 'ember-testing/helpers/current_url', 'ember-testing/helpers/fill_in', 'ember-testing/helpers/find', 'ember-testing/helpers/find_with_assert', 'ember-testing/helpers/key_event', 'ember-testing/helpers/pause_test', 'ember-testing/helpers/trigger_event', 'ember-testing/helpers/visit', 'ember-testing/helpers/wait'], function (exports, _emberMetal, _emberTestingTestHelpers, _emberTestingHelpersAnd_then, _emberTestingHelpersClick, _emberTestingHelpersCurrent_path, _emberTestingHelpersCurrent_route_name, _emberTestingHelpersCurrent_url, _emberTestingHelpersFill_in, _emberTestingHelpersFind, _emberTestingHelpersFind_with_assert, _emberTestingHelpersKey_event, _emberTestingHelpersPause_test, _emberTestingHelpersTrigger_event, _emberTestingHelpersVisit, _emberTestingHelpersWait) { - 'use strict'; + if (this.size === 0) { + return; + } - _emberTestingTestHelpers.registerAsyncHelper('visit', _emberTestingHelpersVisit.default); - _emberTestingTestHelpers.registerAsyncHelper('click', _emberTestingHelpersClick.default); - _emberTestingTestHelpers.registerAsyncHelper('keyEvent', _emberTestingHelpersKey_event.default); - _emberTestingTestHelpers.registerAsyncHelper('fillIn', _emberTestingHelpersFill_in.default); - _emberTestingTestHelpers.registerAsyncHelper('wait', _emberTestingHelpersWait.default); - _emberTestingTestHelpers.registerAsyncHelper('andThen', _emberTestingHelpersAnd_then.default); - _emberTestingTestHelpers.registerAsyncHelper('pauseTest', _emberTestingHelpersPause_test.pauseTest); - _emberTestingTestHelpers.registerAsyncHelper('triggerEvent', _emberTestingHelpersTrigger_event.default); + var list = this.list; - _emberTestingTestHelpers.registerHelper('find', _emberTestingHelpersFind.default); - _emberTestingTestHelpers.registerHelper('findWithAssert', _emberTestingHelpersFind_with_assert.default); - _emberTestingTestHelpers.registerHelper('currentRouteName', _emberTestingHelpersCurrent_route_name.default); - _emberTestingTestHelpers.registerHelper('currentPath', _emberTestingHelpersCurrent_path.default); - _emberTestingTestHelpers.registerHelper('currentURL', _emberTestingHelpersCurrent_url.default); + if (arguments.length === 2) { + for (var i = 0; i < list.length; i++) { + fn.call(arguments[1], list[i]); + } + } else { + for (var i = 0; i < list.length; i++) { + fn(list[i]); + } + } + }, - if (false) { - _emberTestingTestHelpers.registerHelper('resumeTest', _emberTestingHelpersPause_test.resumeTest); - } -}); -enifed("ember-testing/helpers/and_then", ["exports"], function (exports) { - /** - @module ember - @submodule ember-testing - */ - "use strict"; + /** + @method toArray + @return {Array} + @private + */ + toArray: function () { + return this.list.slice(); + }, - exports.default = andThen; + /** + @method copy + @return {Ember.OrderedSet} + @private + */ + copy: function () { + var Constructor = this.constructor; + var set = new Constructor(); - function andThen(app, callback) { - return app.testHelpers.wait(callback(app)); - } -}); -enifed('ember-testing/helpers/click', ['exports', 'ember-testing/events'], function (exports, _emberTestingEvents) { - /** - @module ember - @submodule ember-testing - */ - 'use strict'; + set._silenceRemoveDeprecation = this._silenceRemoveDeprecation; + set.presenceSet = copyNull(this.presenceSet); + set.list = this.toArray(); + set.size = this.size; - exports.default = click; + return set; + } + }; /** - Clicks an element and triggers any actions triggered by the element's `click` - event. + A Map stores values indexed by keys. Unlike JavaScript's + default Objects, the keys of a Map can be any JavaScript + object. - Example: + Internally, a Map has two data structures: - ```javascript - click('.some-jQuery-selector').then(function() { - // assert something - }); - ``` + 1. `keys`: an OrderedSet of all of the existing keys + 2. `values`: a JavaScript Object indexed by the `Ember.guidFor(key)` - @method click - @param {String} selector jQuery selector for finding element on the DOM - @param {Object} context A DOM Element, Document, or jQuery to use as context - @return {RSVP.Promise} - @public + When a key/value pair is added for the first time, we + add the key to the `keys` OrderedSet, and create or + replace an entry in `values`. When an entry is deleted, + we delete its entry in `keys` and `values`. + + @class Map + @namespace Ember + @private + @constructor */ + function Map() { + if (this instanceof Map) { + this._keys = OrderedSet.create(); + this._keys._silenceRemoveDeprecation = true; + this._values = new _emberUtils.EmptyObject(); + this.size = 0; + } else { + missingNew('Map'); + } + } - function click(app, selector, context) { - var $el = app.testHelpers.findWithAssert(selector, context); - var el = $el[0]; + /** + @method create + @static + @private + */ + Map.create = function () { + var Constructor = this; + return new Constructor(); + }; - _emberTestingEvents.fireEvent(el, 'mousedown'); + Map.prototype = { + constructor: Map, - _emberTestingEvents.focus(el); + /** + This property will change as the number of objects in the map changes. + @since 1.8.0 + @property size + @type number + @default 0 + @private + */ + size: 0, - _emberTestingEvents.fireEvent(el, 'mouseup'); - _emberTestingEvents.fireEvent(el, 'click'); + /** + Retrieve the value associated with a given key. + @method get + @param {*} key + @return {*} the value associated with the key, or `undefined` + @private + */ + get: function (key) { + if (this.size === 0) { + return; + } - return app.testHelpers.wait(); - } -}); -enifed('ember-testing/helpers/current_path', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-testing - */ - 'use strict'; + var values = this._values; + var guid = _emberUtils.guidFor(key); - exports.default = currentPath; + return values[guid]; + }, - /** - Returns the current path. - - Example: - - ```javascript - function validateURL() { - equal(currentPath(), 'some.path.index', "correct path was transitioned into."); - } - - click('#some-link-id').then(validateURL); - ``` - - @method currentPath - @return {Object} The currently active path. - @since 1.5.0 - @public - */ + /** + Adds a value to the map. If a value for the given key has already been + provided, the new value will replace the old value. + @method set + @param {*} key + @param {*} value + @return {Ember.Map} + @private + */ + set: function (key, value) { + var keys = this._keys; + var values = this._values; + var guid = _emberUtils.guidFor(key); - function currentPath(app) { - var routingService = app.__container__.lookup('service:-routing'); - return _emberMetal.get(routingService, 'currentPath'); - } -}); -enifed('ember-testing/helpers/current_route_name', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-testing - */ - 'use strict'; + // ensure we don't store -0 + var k = key === -0 ? 0 : key; - exports.default = currentRouteName; + keys.add(k, guid); - /** - Returns the currently active route name. - Example: - ```javascript - function validateRouteName() { - equal(currentRouteName(), 'some.path', "correct route was transitioned into."); - } - visit('/some/path').then(validateRouteName) - ``` - @method currentRouteName - @return {Object} The name of the currently active route. - @since 1.5.0 - @public - */ + values[guid] = value; - function currentRouteName(app) { - var routingService = app.__container__.lookup('service:-routing'); - return _emberMetal.get(routingService, 'currentRouteName'); - } -}); -enifed('ember-testing/helpers/current_url', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-testing - */ - 'use strict'; + this.size = keys.size; - exports.default = currentURL; + return this; + }, - /** - Returns the current URL. - - Example: - - ```javascript - function validateURL() { - equal(currentURL(), '/some/path', "correct URL was transitioned into."); - } - - click('#some-link-id').then(validateURL); - ``` - - @method currentURL - @return {Object} The currently active URL. - @since 1.5.0 - @public - */ + /** + Removes a value from the map for an associated key. + @since 1.8.0 + @method delete + @param {*} key + @return {Boolean} true if an item was removed, false otherwise + @private + */ + delete: function (key) { + if (this.size === 0) { + return false; + } + // don't use ES6 "delete" because it will be annoying + // to use in browsers that are not ES6 friendly; + var keys = this._keys; + var values = this._values; + var guid = _emberUtils.guidFor(key); - function currentURL(app) { - var router = app.__container__.lookup('router:main'); - return _emberMetal.get(router, 'location').getURL(); - } -}); -enifed('ember-testing/helpers/fill_in', ['exports', 'ember-testing/events'], function (exports, _emberTestingEvents) { - /** - @module ember - @submodule ember-testing - */ - 'use strict'; + if (keys.delete(key, guid)) { + delete values[guid]; + this.size = keys.size; + return true; + } else { + return false; + } + }, - exports.default = fillIn; + /** + Check whether a key is present. + @method has + @param {*} key + @return {Boolean} true if the item was present, false otherwise + @private + */ + has: function (key) { + return this._keys.has(key); + }, - /** - Fills in an input element with some text. - - Example: - - ```javascript - fillIn('#email', 'you@example.com').then(function() { - // assert something - }); - ``` - - @method fillIn - @param {String} selector jQuery selector finding an input element on the DOM - to fill text with - @param {String} text text to place inside the input element - @return {RSVP.Promise} - @public - */ + /** + Iterate over all the keys and values. Calls the function once + for each key, passing in value, key, and the map being iterated over, + in that order. + The keys are guaranteed to be iterated over in insertion order. + @method forEach + @param {Function} callback + @param {*} self if passed, the `this` value inside the + callback. By default, `this` is the map. + @private + */ + forEach: function (callback /*, ...thisArg*/) { + if (typeof callback !== 'function') { + missingFunction(callback); + } - function fillIn(app, selector, contextOrText, text) { - var $el = undefined, - el = undefined, - context = undefined; - if (typeof text === 'undefined') { - text = contextOrText; - } else { - context = contextOrText; - } - $el = app.testHelpers.findWithAssert(selector, context); - el = $el[0]; - _emberTestingEvents.focus(el); + if (this.size === 0) { + return; + } - $el.eq(0).val(text); - _emberTestingEvents.fireEvent(el, 'input'); - _emberTestingEvents.fireEvent(el, 'change'); + var map = this; + var cb = undefined, + thisArg = undefined; - return app.testHelpers.wait(); + if (arguments.length === 2) { + thisArg = arguments[1]; + cb = function (key) { + return callback.call(thisArg, map.get(key), key, map); + }; + } else { + cb = function (key) { + return callback(map.get(key), key, map); + }; + } + + this._keys.forEach(cb); + }, + + /** + @method clear + @private + */ + clear: function () { + this._keys.clear(); + this._values = new _emberUtils.EmptyObject(); + this.size = 0; + }, + + /** + @method copy + @return {Ember.Map} + @private + */ + copy: function () { + return copyMap(this, new Map()); + } + }; + + /** + @class MapWithDefault + @namespace Ember + @extends Ember.Map + @private + @constructor + @param [options] + @param {*} [options.defaultValue] + */ + function MapWithDefault(options) { + this._super$constructor(); + this.defaultValue = options.defaultValue; } -}); -enifed('ember-testing/helpers/find', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** - @module ember - @submodule ember-testing + @method create + @static + @param [options] + @param {*} [options.defaultValue] + @return {Ember.MapWithDefault|Ember.Map} If options are passed, returns + `Ember.MapWithDefault` otherwise returns `Ember.Map` + @private */ - 'use strict'; + MapWithDefault.create = function (options) { + if (options) { + return new MapWithDefault(options); + } else { + return new Map(); + } + }; - exports.default = find; + MapWithDefault.prototype = Object.create(Map.prototype); + MapWithDefault.prototype.constructor = MapWithDefault; + MapWithDefault.prototype._super$constructor = Map; + MapWithDefault.prototype._super$get = Map.prototype.get; /** - Finds an element in the context of the app's container element. A simple alias - for `app.$(selector)`. - - Example: - - ```javascript - var $el = find('.my-selector'); - ``` - - With the `context` param: - - ```javascript - var $el = find('.my-selector', '.parent-element-class'); - ``` + Retrieve the value associated with a given key. - @method find - @param {String} selector jQuery string selector for element lookup - @param {String} [context] (optional) jQuery selector that will limit the selector - argument to find only within the context's children - @return {Object} jQuery object representing the results of the query - @public + @method get + @param {*} key + @return {*} the value associated with the key, or the default value + @private */ + MapWithDefault.prototype.get = function (key) { + var hasValue = this.has(key); + + if (hasValue) { + return this._super$get(key); + } else { + var defaultValue = this.defaultValue(key); + this.set(key, defaultValue); + return defaultValue; + } + }; - function find(app, selector, context) { - var $el = undefined; - context = context || _emberMetal.get(app, 'rootElement'); - $el = app.$(selector, context); - return $el; - } -}); -enifed('ember-testing/helpers/find_with_assert', ['exports'], function (exports) { /** - @module ember - @submodule ember-testing + @method copy + @return {Ember.MapWithDefault} + @private */ + MapWithDefault.prototype.copy = function () { + var Constructor = this.constructor; + return copyMap(this, new Constructor({ + defaultValue: this.defaultValue + })); + }; + + exports.default = Map; + exports.OrderedSet = OrderedSet; + exports.Map = Map; + exports.MapWithDefault = MapWithDefault; +}); +enifed('ember-metal/merge', ['exports'], function (exports) { /** - Like `find`, but throws an error if the element selector returns no results. - - Example: - - ```javascript - var $el = findWithAssert('.doesnt-exist'); // throws error - ``` - - With the `context` param: + Merge the contents of two objects together into the first object. ```javascript - var $el = findWithAssert('.selector-id', '.parent-element-class'); // assert will pass + Ember.merge({ first: 'Tom' }, { last: 'Dale' }); // { first: 'Tom', last: 'Dale' } + var a = { first: 'Yehuda' }; + var b = { last: 'Katz' }; + Ember.merge(a, b); // a == { first: 'Yehuda', last: 'Katz' }, b == { last: 'Katz' } ``` - @method findWithAssert - @param {String} selector jQuery selector string for finding an element within - the DOM - @param {String} [context] (optional) jQuery selector that will limit the - selector argument to find only within the context's children - @return {Object} jQuery object representing the results of the query - @throws {Error} throws error if jQuery object returned has a length of 0 + @method merge + @for Ember + @param {Object} original The object to merge into + @param {Object} updates The object to copy properties from + @return {Object} @public */ 'use strict'; - exports.default = findWithAssert; + exports.default = merge; - function findWithAssert(app, selector, context) { - var $el = app.testHelpers.find(selector, context); - if ($el.length === 0) { - throw new Error('Element ' + selector + ' not found.'); + function merge(original, updates) { + if (!updates || typeof updates !== 'object') { + return original; } - return $el; - } -}); -enifed('ember-testing/helpers/key_event', ['exports'], function (exports) { - /** - @module ember - @submodule ember-testing - */ - /** - Simulates a key event, e.g. `keypress`, `keydown`, `keyup` with the desired keyCode - Example: - ```javascript - keyEvent('.some-jQuery-selector', 'keypress', 13).then(function() { - // assert something - }); - ``` - @method keyEvent - @param {String} selector jQuery selector for finding element on the DOM - @param {String} type the type of key event, e.g. `keypress`, `keydown`, `keyup` - @param {Number} keyCode the keyCode of the simulated key event - @return {RSVP.Promise} - @since 1.5.0 - @public - */ - 'use strict'; - - exports.default = keyEvent; - function keyEvent(app, selector, contextOrType, typeOrKeyCode, keyCode) { - var context = undefined, - type = undefined; + var props = Object.keys(updates); + var prop = undefined; - if (typeof keyCode === 'undefined') { - context = null; - keyCode = typeOrKeyCode; - type = contextOrType; - } else { - context = contextOrType; - type = typeOrKeyCode; + for (var i = 0; i < props.length; i++) { + prop = props[i]; + original[prop] = updates[prop]; } - return app.testHelpers.triggerEvent(selector, context, type, { keyCode: keyCode, which: keyCode }); + return original; } }); -enifed('ember-testing/helpers/pause_test', ['exports', 'ember-runtime', 'ember-console', 'ember-metal'], function (exports, _emberRuntime, _emberConsole, _emberMetal) { - /** - @module ember - @submodule ember-testing - */ - 'use strict'; +enifed('ember-metal/meta', ['exports', 'ember-utils', 'ember-metal/features', 'ember-metal/meta_listeners', 'ember-metal/debug', 'ember-metal/chains', 'require'], function (exports, _emberUtils, _emberMetalFeatures, _emberMetalMeta_listeners, _emberMetalDebug, _emberMetalChains, _require) { + 'no use strict'; + // Remove "use strict"; from transpiled module until + // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - exports.resumeTest = resumeTest; - exports.pauseTest = pauseTest; + exports.deleteMeta = deleteMeta; + exports.meta = meta; - var resume = undefined; + var counters = { + peekCalls: 0, + peekParentCalls: 0, + peekPrototypeWalks: 0, + setCalls: 0, + deleteCalls: 0, + metaCalls: 0, + metaInstantiated: 0 + }; /** - Resumes a test paused by `pauseTest`. - - @method resumeTest - @return {void} - @public + @module ember-metal */ - function resumeTest() { - _emberMetal.assert('Testing has not been paused. There is nothing to resume.', resume); - resume(); - resume = undefined; - } - - /** - Pauses the current test - this is useful for debugging while testing or for test-driving. - It allows you to inspect the state of your application at any point. - Example (The test will pause before clicking the button): + /* + This declares several meta-programmed members on the Meta class. Such + meta! - ```javascript - visit('/') - return pauseTest(); - click('.btn'); - ``` - @since 1.9.0 - @method pauseTest - @return {Object} A promise that will never resolve - @public + In general, the `readable` variants will give you an object (if it + already exists) that you can read but should not modify. The + `writable` variants will give you a mutable object, and they will + create it if it didn't already exist. + + The following methods will get generated metaprogrammatically, and + I'm including them here for greppability: + + writableCache, readableCache, writeWatching, + peekWatching, clearWatching, writeMixins, + peekMixins, clearMixins, writeBindings, + peekBindings, clearBindings, writeValues, + peekValues, clearValues, writeDeps, forEachInDeps + writableChainWatchers, readableChainWatchers, writableChains, + readableChains, writableTag, readableTag, writableTags, + readableTags */ + var members = { + cache: ownMap, + weak: ownMap, + watching: inheritedMap, + mixins: inheritedMap, + bindings: inheritedMap, + values: inheritedMap, + chainWatchers: ownCustomObject, + chains: inheritedCustomObject, + tag: ownCustomObject, + tags: ownMap + }; - function pauseTest() { - if (false) { - _emberConsole.default.info('Testing paused. Use `resumeTest()` to continue.'); - } + // FLAGS + var SOURCE_DESTROYING = 1 << 1; + var SOURCE_DESTROYED = 1 << 2; + var META_DESTROYED = 1 << 3; + var IS_PROXY = 1 << 4; - return new _emberRuntime.RSVP.Promise(function (resolve) { - if (false) { - resume = resolve; - } - }, 'TestAdapter paused promise'); + if (true || true) { + members.lastRendered = ownMap; + if (_require.has('ember-debug')) { + //https://github.com/emberjs/ember.js/issues/14732 + members.lastRenderedReferenceMap = ownMap; + members.lastRenderedTemplateMap = ownMap; + } } -}); -enifed('ember-testing/helpers/trigger_event', ['exports', 'ember-testing/events'], function (exports, _emberTestingEvents) { - /** - @module ember - @submodule ember-testing - */ - 'use strict'; - exports.default = triggerEvent; + var memberNames = Object.keys(members); + var META_FIELD = '__ember_meta__'; - /** - Triggers the given DOM event on the element identified by the provided selector. - Example: - ```javascript - triggerEvent('#some-elem-id', 'blur'); - ``` - This is actually used internally by the `keyEvent` helper like so: - ```javascript - triggerEvent('#some-elem-id', 'keypress', { keyCode: 13 }); - ``` - @method triggerEvent - @param {String} selector jQuery selector for finding element on the DOM - @param {String} [context] jQuery selector that will limit the selector - argument to find only within the context's children - @param {String} type The event type to be triggered. - @param {Object} [options] The options to be passed to jQuery.Event. - @return {RSVP.Promise} - @since 1.5.0 - @public - */ + var Meta = (function () { + function Meta(obj, parentMeta) { + var _this = this; - function triggerEvent(app, selector, contextOrType, typeOrOptions, possibleOptions) { - var arity = arguments.length; - var context = undefined, - type = undefined, - options = undefined; + babelHelpers.classCallCheck(this, Meta); - if (arity === 3) { - // context and options are optional, so this is - // app, selector, type - context = null; - type = contextOrType; - options = {}; - } else if (arity === 4) { - // context and options are optional, so this is - if (typeof typeOrOptions === 'object') { - // either - // app, selector, type, options - context = null; - type = contextOrType; - options = typeOrOptions; - } else { - // or - // app, selector, context, type - context = contextOrType; - type = typeOrOptions; - options = {}; + _emberMetalDebug.runInDebug(function () { + return counters.metaInstantiated++; + }); + + this._cache = undefined; + this._weak = undefined; + this._watching = undefined; + this._mixins = undefined; + this._bindings = undefined; + this._values = undefined; + this._deps = undefined; + this._chainWatchers = undefined; + this._chains = undefined; + this._tag = undefined; + this._tags = undefined; + + // initial value for all flags right now is false + // see FLAGS const for detailed list of flags used + this._flags = 0; + + // used only internally + this.source = obj; + + // when meta(obj).proto === obj, the object is intended to be only a + // prototype and doesn't need to actually be observable itself + this.proto = undefined; + + // The next meta in our inheritance chain. We (will) track this + // explicitly instead of using prototypical inheritance because we + // have detailed knowledge of how each property should really be + // inherited, and we can optimize it much better than JS runtimes. + this.parent = parentMeta; + + if (true || true) { + this._lastRendered = undefined; + _emberMetalDebug.runInDebug(function () { + _this._lastRenderedReferenceMap = undefined; + _this._lastRenderedTemplateMap = undefined; + }); } - } else { - context = contextOrType; - type = typeOrOptions; - options = possibleOptions; + + this._initializeListeners(); } - var $el = app.testHelpers.findWithAssert(selector, context); - var el = $el[0]; + Meta.prototype.isInitialized = function isInitialized(obj) { + return this.proto !== obj; + }; - _emberTestingEvents.fireEvent(el, type, options); + Meta.prototype.destroy = function destroy() { + if (this.isMetaDestroyed()) { + return; + } - return app.testHelpers.wait(); - } -}); -enifed('ember-testing/helpers/visit', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-testing - */ - 'use strict'; + // remove chainWatchers to remove circular references that would prevent GC + var nodes = undefined, + key = undefined, + nodeObject = undefined; + var node = this.readableChains(); + if (node) { + NODE_STACK.push(node); + // process tree + while (NODE_STACK.length > 0) { + node = NODE_STACK.pop(); + // push children + nodes = node._chains; + if (nodes) { + for (key in nodes) { + if (nodes[key] !== undefined) { + NODE_STACK.push(nodes[key]); + } + } + } - exports.default = visit; + // remove chainWatcher in node object + if (node._watching) { + nodeObject = node._object; + if (nodeObject) { + var foreignMeta = peekMeta(nodeObject); + // avoid cleaning up chain watchers when both current and + // foreign objects are being destroyed + // if both are being destroyed manual cleanup is not needed + // as they will be GC'ed and no non-destroyed references will + // be remaining + if (foreignMeta && !foreignMeta.isSourceDestroying()) { + _emberMetalChains.removeChainWatcher(nodeObject, node._key, node, foreignMeta); + } + } + } + } + } - /** - Loads a route, sets up any controllers, and renders any templates associated - with the route as though a real user had triggered the route change while - using your app. - - Example: - - ```javascript - visit('posts/index').then(function() { - // assert something - }); - ``` - - @method visit - @param {String} url the name of the route - @return {RSVP.Promise} - @public - */ + this.setMetaDestroyed(); + }; - function visit(app, url) { - var router = app.__container__.lookup('router:main'); - var shouldHandleURL = false; + Meta.prototype.isSourceDestroying = function isSourceDestroying() { + return (this._flags & SOURCE_DESTROYING) !== 0; + }; - app.boot().then(function () { - router.location.setURL(url); + Meta.prototype.setSourceDestroying = function setSourceDestroying() { + this._flags |= SOURCE_DESTROYING; + }; - if (shouldHandleURL) { - _emberMetal.run(app.__deprecatedInstance__, 'handleURL', url); - } - }); + Meta.prototype.isSourceDestroyed = function isSourceDestroyed() { + return (this._flags & SOURCE_DESTROYED) !== 0; + }; - if (app._readinessDeferrals > 0) { - router['initialURL'] = url; - _emberMetal.run(app, 'advanceReadiness'); - delete router['initialURL']; - } else { - shouldHandleURL = true; - } + Meta.prototype.setSourceDestroyed = function setSourceDestroyed() { + this._flags |= SOURCE_DESTROYED; + }; - return app.testHelpers.wait(); - } -}); -enifed('ember-testing/helpers/wait', ['exports', 'ember-testing/test/waiters', 'ember-runtime', 'ember-metal', 'ember-testing/test/pending_requests'], function (exports, _emberTestingTestWaiters, _emberRuntime, _emberMetal, _emberTestingTestPending_requests) { - /** - @module ember - @submodule ember-testing - */ - 'use strict'; + Meta.prototype.isMetaDestroyed = function isMetaDestroyed() { + return (this._flags & META_DESTROYED) !== 0; + }; - exports.default = wait; + Meta.prototype.setMetaDestroyed = function setMetaDestroyed() { + this._flags |= META_DESTROYED; + }; - /** - Causes the run loop to process any pending events. This is used to ensure that - any async operations from other helpers (or your assertions) have been processed. - - This is most often used as the return value for the helper functions (see 'click', - 'fillIn','visit',etc). However, there is a method to register a test helper which - utilizes this method without the need to actually call `wait()` in your helpers. - - The `wait` helper is built into `registerAsyncHelper` by default. You will not need - to `return app.testHelpers.wait();` - the wait behavior is provided for you. - - Example: - - ```javascript - Ember.Test.registerAsyncHelper('loginUser', function(app, username, password) { - visit('secured/path/here') - .fillIn('#username', username) - .fillIn('#password', password) - .click('.submit'); - }); - - @method wait - @param {Object} value The value to be returned. - @return {RSVP.Promise} - @public - @since 1.0.0 - */ + Meta.prototype.isProxy = function isProxy() { + return (this._flags & IS_PROXY) !== 0; + }; - function wait(app, value) { - return new _emberRuntime.RSVP.Promise(function (resolve) { - var router = app.__container__.lookup('router:main'); + Meta.prototype.setProxy = function setProxy() { + this._flags |= IS_PROXY; + }; - // Every 10ms, poll for the async thing to have finished - var watcher = setInterval(function () { - // 1. If the router is loading, keep polling - var routerIsLoading = router.router && !!router.router.activeTransition; - if (routerIsLoading) { - return; - } + Meta.prototype._getOrCreateOwnMap = function _getOrCreateOwnMap(key) { + return this[key] || (this[key] = new _emberUtils.EmptyObject()); + }; - // 2. If there are pending Ajax requests, keep polling - if (_emberTestingTestPending_requests.pendingRequests()) { - return; + Meta.prototype._getInherited = function _getInherited(key) { + var pointer = this; + while (pointer !== undefined) { + if (pointer[key]) { + return pointer[key]; } + pointer = pointer.parent; + } + }; - // 3. If there are scheduled timers or we are inside of a run loop, keep polling - if (_emberMetal.run.hasScheduledTimers() || _emberMetal.run.currentRunLoop) { - return; + Meta.prototype._findInherited = function _findInherited(key, subkey) { + var pointer = this; + while (pointer !== undefined) { + var map = pointer[key]; + if (map) { + var value = map[subkey]; + if (value !== undefined) { + return value; + } } + pointer = pointer.parent; + } + }; - if (_emberTestingTestWaiters.checkWaiters()) { - return; + // Implements a member that provides a lazily created map of maps, + // with inheritance at both levels. + + Meta.prototype.writeDeps = function writeDeps(subkey, itemkey, value) { + _emberMetalDebug.assert('Cannot call writeDeps after the object is destroyed.', !this.isMetaDestroyed()); + + var outerMap = this._getOrCreateOwnMap('_deps'); + var innerMap = outerMap[subkey]; + if (!innerMap) { + innerMap = outerMap[subkey] = new _emberUtils.EmptyObject(); + } + innerMap[itemkey] = value; + }; + + Meta.prototype.peekDeps = function peekDeps(subkey, itemkey) { + var pointer = this; + while (pointer !== undefined) { + var map = pointer._deps; + if (map) { + var value = map[subkey]; + if (value) { + if (value[itemkey] !== undefined) { + return value[itemkey]; + } + } } + pointer = pointer.parent; + } + }; - // Stop polling - clearInterval(watcher); + Meta.prototype.hasDeps = function hasDeps(subkey) { + var pointer = this; + while (pointer !== undefined) { + if (pointer._deps && pointer._deps[subkey]) { + return true; + } + pointer = pointer.parent; + } + return false; + }; - // Synchronously resolve the promise - _emberMetal.run(null, resolve, value); - }, 10); - }); - } -}); -enifed('ember-testing/index', ['exports', 'ember-testing/support', 'ember-testing/ext/application', 'ember-testing/ext/rsvp', 'ember-testing/helpers', 'ember-testing/initializers', 'ember-testing/test', 'ember-testing/adapters/adapter', 'ember-testing/setup_for_testing', 'ember-testing/adapters/qunit'], function (exports, _emberTestingSupport, _emberTestingExtApplication, _emberTestingExtRsvp, _emberTestingHelpers, _emberTestingInitializers, _emberTestingTest, _emberTestingAdaptersAdapter, _emberTestingSetup_for_testing, _emberTestingAdaptersQunit) { - 'use strict'; + Meta.prototype.forEachInDeps = function forEachInDeps(subkey, fn) { + return this._forEachIn('_deps', subkey, fn); + }; - exports.Test = _emberTestingTest.default; - exports.Adapter = _emberTestingAdaptersAdapter.default; - exports.setupForTesting = _emberTestingSetup_for_testing.default; - exports.QUnitAdapter = _emberTestingAdaptersQunit.default; -}); -// to handle various edge cases -// setup RSVP + run loop integration -// adds helpers to helpers object in Test -// to setup initializer + Meta.prototype._forEachIn = function _forEachIn(key, subkey, fn) { + var pointer = this; + var seen = new _emberUtils.EmptyObject(); + var calls = []; + while (pointer !== undefined) { + var map = pointer[key]; + if (map) { + var innerMap = map[subkey]; + if (innerMap) { + for (var innerKey in innerMap) { + if (!seen[innerKey]) { + seen[innerKey] = true; + calls.push([innerKey, innerMap[innerKey]]); + } + } + } + } + pointer = pointer.parent; + } + for (var i = 0; i < calls.length; i++) { + var _calls$i = calls[i]; + var innerKey = _calls$i[0]; + var value = _calls$i[1]; -/** - @module ember - @submodule ember-testing -*/ -enifed('ember-testing/initializers', ['exports', 'ember-runtime'], function (exports, _emberRuntime) { - 'use strict'; + fn(innerKey, value); + } + }; - var name = 'deferReadiness in `testing` mode'; + Meta.prototype.readInheritedValue = function readInheritedValue(key, subkey) { + var internalKey = '_' + key; - _emberRuntime.onLoad('Ember.Application', function (Application) { - if (!Application.initializers[name]) { - Application.initializer({ - name: name, + var pointer = this; - initialize: function (application) { - if (application.testing) { - application.deferReadiness(); + while (pointer !== undefined) { + var map = pointer[internalKey]; + if (map) { + var value = map[subkey]; + if (value !== undefined || subkey in map) { + return map[subkey]; } } - }); - } - }); -}); -enifed('ember-testing/setup_for_testing', ['exports', 'ember-metal', 'ember-views', 'ember-testing/test/adapter', 'ember-testing/test/pending_requests', 'ember-testing/adapters/qunit'], function (exports, _emberMetal, _emberViews, _emberTestingTestAdapter, _emberTestingTestPending_requests, _emberTestingAdaptersQunit) { - 'use strict'; + pointer = pointer.parent; + } - exports.default = setupForTesting; + return UNDEFINED; + }; - /** - Sets Ember up for testing. This is useful to perform - basic setup steps in order to unit test. - - Use `App.setupForTesting` to perform integration tests (full - application testing). - - @method setupForTesting - @namespace Ember - @since 1.5.0 - @private - */ + Meta.prototype.writeValue = function writeValue(obj, key, value) { + var descriptor = _emberUtils.lookupDescriptor(obj, key); + var isMandatorySetter = descriptor && descriptor.set && descriptor.set.isMandatorySetter; + + if (isMandatorySetter) { + this.writeValues(key, value); + } else { + obj[key] = value; + } + }; - function setupForTesting() { - _emberMetal.setTesting(true); + return Meta; + })(); - var adapter = _emberTestingTestAdapter.getAdapter(); - // if adapter is not manually set default to QUnit - if (!adapter) { - _emberTestingTestAdapter.setAdapter(new _emberTestingAdaptersQunit.default()); - } + exports.Meta = Meta; - _emberViews.jQuery(document).off('ajaxSend', _emberTestingTestPending_requests.incrementPendingRequests); - _emberViews.jQuery(document).off('ajaxComplete', _emberTestingTestPending_requests.decrementPendingRequests); + var NODE_STACK = []; - _emberTestingTestPending_requests.clearPendingRequests(); + for (var _name in _emberMetalMeta_listeners.protoMethods) { + Meta.prototype[_name] = _emberMetalMeta_listeners.protoMethods[_name]; + } + memberNames.forEach(function (name) { + return members[name](name, Meta); + }); - _emberViews.jQuery(document).on('ajaxSend', _emberTestingTestPending_requests.incrementPendingRequests); - _emberViews.jQuery(document).on('ajaxComplete', _emberTestingTestPending_requests.decrementPendingRequests); + // Implements a member that is a lazily created, non-inheritable + // POJO. + function ownMap(name, Meta) { + var key = memberProperty(name); + var capitalized = capitalize(name); + Meta.prototype['writable' + capitalized] = function () { + return this._getOrCreateOwnMap(key); + }; + Meta.prototype['readable' + capitalized] = function () { + return this[key]; + }; } -}); -enifed('ember-testing/support', ['exports', 'ember-metal', 'ember-views', 'ember-environment'], function (exports, _emberMetal, _emberViews, _emberEnvironment) { - 'use strict'; - /** - @module ember - @submodule ember-testing - */ + // Implements a member that is a lazily created POJO with inheritable + // values. + function inheritedMap(name, Meta) { + var key = memberProperty(name); + var capitalized = capitalize(name); - var $ = _emberViews.jQuery; + Meta.prototype['write' + capitalized] = function (subkey, value) { + _emberMetalDebug.assert('Cannot call write' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); - /** - This method creates a checkbox and triggers the click event to fire the - passed in handler. It is used to correct for a bug in older versions - of jQuery (e.g 1.8.3). - - @private - @method testCheckboxClick - */ - function testCheckboxClick(handler) { - var input = document.createElement('input'); - $(input).attr('type', 'checkbox').css({ position: 'absolute', left: '-1000px', top: '-1000px' }).appendTo('body').on('click', handler).trigger('click').remove(); - } + var map = this._getOrCreateOwnMap(key); + map[subkey] = value; + }; - if (_emberEnvironment.environment.hasDOM && typeof $ === 'function') { - $(function () { - /* - Determine whether a checkbox checked using jQuery's "click" method will have - the correct value for its checked property. - If we determine that the current jQuery version exhibits this behavior, - patch it to work correctly as in the commit for the actual fix: - https://github.com/jquery/jquery/commit/1fb2f92. - */ - testCheckboxClick(function () { - if (!this.checked && !$.event.special.click) { - $.event.special.click = { - // For checkbox, fire native event so checked state will be right - trigger: function () { - if ($.nodeName(this, 'input') && this.type === 'checkbox' && this.click) { - this.click(); - return false; - } + Meta.prototype['peek' + capitalized] = function (subkey) { + return this._findInherited(key, subkey); + }; + + Meta.prototype['forEach' + capitalized] = function (fn) { + var pointer = this; + var seen = new _emberUtils.EmptyObject(); + while (pointer !== undefined) { + var map = pointer[key]; + if (map) { + for (var _key in map) { + if (!seen[_key]) { + seen[_key] = true; + fn(_key, map[_key]); } - }; + } } - }); + pointer = pointer.parent; + } + }; - // Try again to verify that the patch took effect or blow up. - testCheckboxClick(function () { - _emberMetal.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-testing/test/helpers', 'ember-testing/test/on_inject_helpers', 'ember-testing/test/promise', 'ember-testing/test/waiters', 'ember-testing/test/adapter', 'ember-metal'], function (exports, _emberTestingTestHelpers, _emberTestingTestOn_inject_helpers, _emberTestingTestPromise, _emberTestingTestWaiters, _emberTestingTestAdapter, _emberMetal) { - /** - @module ember - @submodule ember-testing - */ - 'use strict'; + Meta.prototype['clear' + capitalized] = function () { + _emberMetalDebug.assert('Cannot call clear' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); - /** - This is a container for an assortment of testing related functionality: - - * Choose your default test adapter (for your framework of choice). - * Register/Unregister additional test helpers. - * Setup callbacks to be fired when the test helpers are injected into - your application. - - @class Test - @namespace Ember - @public - */ - var Test = { - /** - Hash containing all known test helpers. - @property _helpers - @private - @since 1.7.0 - */ - _helpers: _emberTestingTestHelpers.helpers, + this[key] = undefined; + }; - registerHelper: _emberTestingTestHelpers.registerHelper, - registerAsyncHelper: _emberTestingTestHelpers.registerAsyncHelper, - unregisterHelper: _emberTestingTestHelpers.unregisterHelper, - onInjectHelpers: _emberTestingTestOn_inject_helpers.onInjectHelpers, - Promise: _emberTestingTestPromise.default, - promise: _emberTestingTestPromise.promise, - resolve: _emberTestingTestPromise.resolve, - registerWaiter: _emberTestingTestWaiters.registerWaiter, - unregisterWaiter: _emberTestingTestWaiters.unregisterWaiter - }; + Meta.prototype['deleteFrom' + capitalized] = function (subkey) { + delete this._getOrCreateOwnMap(key)[subkey]; + }; - if (true) { - Test.checkWaiters = _emberTestingTestWaiters.checkWaiters; + Meta.prototype['hasIn' + capitalized] = function (subkey) { + return this._findInherited(key, subkey) !== undefined; + }; } - /** - Used to allow ember-testing to communicate with a specific testing - framework. - - You can manually set it before calling `App.setupForTesting()`. - - Example: - - ```javascript - Ember.Test.adapter = MyCustomAdapter.create() - ``` - - If you do not set it, ember-testing will default to `Ember.Test.QUnitAdapter`. - - @public - @for Ember.Test - @property adapter - @type {Class} The adapter to be used. - @default Ember.Test.QUnitAdapter - */ - Object.defineProperty(Test, 'adapter', { - get: _emberTestingTestAdapter.getAdapter, - set: _emberTestingTestAdapter.setAdapter - }); - - Object.defineProperty(Test, 'waiters', { - get: _emberTestingTestWaiters.generateDeprecatedWaitersArray - }); + var UNDEFINED = _emberUtils.symbol('undefined'); - exports.default = Test; -}); -enifed('ember-testing/test/adapter', ['exports', 'ember-console', 'ember-metal'], function (exports, _emberConsole, _emberMetal) { - 'use strict'; + exports.UNDEFINED = UNDEFINED; + // Implements a member that provides a non-heritable, lazily-created + // object using the method you provide. + function ownCustomObject(name, Meta) { + var key = memberProperty(name); + var capitalized = capitalize(name); + Meta.prototype['writable' + capitalized] = function (create) { + _emberMetalDebug.assert('Cannot call writable' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); - exports.getAdapter = getAdapter; - exports.setAdapter = setAdapter; - exports.asyncStart = asyncStart; - exports.asyncEnd = asyncEnd; + var ret = this[key]; + if (!ret) { + ret = this[key] = create(this.source); + } + return ret; + }; + Meta.prototype['readable' + capitalized] = function () { + return this[key]; + }; + } - var adapter = undefined; + // Implements a member that provides an inheritable, lazily-created + // object using the method you provide. We will derived children from + // their parents by calling your object's `copy()` method. + function inheritedCustomObject(name, Meta) { + var key = memberProperty(name); + var capitalized = capitalize(name); + Meta.prototype['writable' + capitalized] = function (create) { + _emberMetalDebug.assert('Cannot call writable' + capitalized + ' after the object is destroyed.', !this.isMetaDestroyed()); - function getAdapter() { - return adapter; + var ret = this[key]; + if (!ret) { + if (this.parent) { + ret = this[key] = this.parent['writable' + capitalized](create).copy(this.source); + } else { + ret = this[key] = create(this.source); + } + } + return ret; + }; + Meta.prototype['readable' + capitalized] = function () { + return this._getInherited(key); + }; } - function setAdapter(value) { - adapter = value; - if (value) { - _emberMetal.setDispatchOverride(adapterDispatch); - } else { - _emberMetal.setDispatchOverride(null); - } + function memberProperty(name) { + return '_' + name; } - function asyncStart() { - if (adapter) { - adapter.asyncStart(); - } + // there's a more general-purpose capitalize in ember-runtime, but we + // don't want to make ember-metal depend on ember-runtime. + function capitalize(name) { + return name.replace(/^\w/, function (m) { + return m.toUpperCase(); + }); } - function asyncEnd() { - if (adapter) { - adapter.asyncEnd(); - } - } + var META_DESC = { + writable: true, + configurable: true, + enumerable: false, + value: null + }; - function adapterDispatch(error) { - adapter.exception(error); - _emberConsole.default.error(error.stack); - } -}); -enifed('ember-testing/test/helpers', ['exports', 'ember-testing/test/promise'], function (exports, _emberTestingTestPromise) { - 'use strict'; + exports.META_DESC = META_DESC; + var EMBER_META_PROPERTY = { + name: META_FIELD, + descriptor: META_DESC + }; - exports.registerHelper = registerHelper; - exports.registerAsyncHelper = registerAsyncHelper; - exports.unregisterHelper = unregisterHelper; - var helpers = {}; + if (true) { + Meta.prototype.readInheritedValue = function (key, subkey) { + var internalKey = '_' + key; - exports.helpers = helpers; - /** - `registerHelper` is used to register a test helper that will be injected - when `App.injectTestHelpers` is called. - - The helper method will always be called with the current Application as - the first parameter. - - For example: - - ```javascript - Ember.Test.registerHelper('boot', function(app) { - Ember.run(app, app.advanceReadiness); - }); - ``` - - This helper can later be called without arguments because it will be - called with `app` as the first parameter. - - ```javascript - App = Ember.Application.create(); - App.injectTestHelpers(); - boot(); - ``` - - @public - @for Ember.Test - @method registerHelper - @param {String} name The name of the helper method to add. - @param {Function} helperMethod - @param options {Object} - */ + var pointer = this; - function registerHelper(name, helperMethod) { - helpers[name] = { - method: helperMethod, - meta: { wait: false } + 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; }; - } - /** - `registerAsyncHelper` is used to register an async test helper that will be injected - when `App.injectTestHelpers` is called. - - The helper method will always be called with the current Application as - the first parameter. - - For example: - - ```javascript - Ember.Test.registerAsyncHelper('boot', function(app) { - Ember.run(app, app.advanceReadiness); - }); - ``` - - The advantage of an async helper is that it will not run - until the last async helper has completed. All async helpers - after it will wait for it complete before running. - - - For example: - - ```javascript - Ember.Test.registerAsyncHelper('deletePost', function(app, postId) { - click('.delete-' + postId); - }); - - // ... in your test - visit('/post/2'); - deletePost(2); - visit('/post/3'); - deletePost(3); - ``` - - @public - @for Ember.Test - @method registerAsyncHelper - @param {String} name The name of the helper method to add. - @param {Function} helperMethod - @since 1.2.0 - */ + Meta.prototype.writeValue = function (obj, key, value) { + var descriptor = _emberUtils.lookupDescriptor(obj, key); + var isMandatorySetter = descriptor && descriptor.set && descriptor.set.isMandatorySetter; - function registerAsyncHelper(name, helperMethod) { - helpers[name] = { - method: helperMethod, - meta: { wait: true } + if (isMandatorySetter) { + this.writeValues(key, value); + } else { + obj[key] = value; + } }; } - /** - Remove a previously added helper method. - - Example: - - ```javascript - Ember.Test.unregisterHelper('wait'); - ``` - - @public - @method unregisterHelper - @param {String} name The helper to remove. - */ + var setMeta = undefined, + peekMeta = undefined; - function unregisterHelper(name) { - delete helpers[name]; - delete _emberTestingTestPromise.default.prototype[name]; - } -}); -enifed("ember-testing/test/on_inject_helpers", ["exports"], function (exports) { - "use strict"; + // choose the one appropriate for given platform + if (_emberUtils.HAS_NATIVE_WEAKMAP) { + (function () { + var getPrototypeOf = Object.getPrototypeOf; + var metaStore = new WeakMap(); - exports.onInjectHelpers = onInjectHelpers; - exports.invokeInjectHelpersCallbacks = invokeInjectHelpersCallbacks; - var callbacks = []; + exports.setMeta = setMeta = function WeakMap_setMeta(obj, meta) { + _emberMetalDebug.runInDebug(function () { + return counters.setCalls++; + }); + metaStore.set(obj, meta); + }; - exports.callbacks = callbacks; - /** - Used to register callbacks to be fired whenever `App.injectTestHelpers` - is called. - - The callback will receive the current application as an argument. - - Example: - - ```javascript - Ember.Test.onInjectHelpers(function() { - Ember.$(document).ajaxSend(function() { - Test.pendingRequests++; - }); - - Ember.$(document).ajaxComplete(function() { - Test.pendingRequests--; - }); - }); - ``` - - @public - @for Ember.Test - @method onInjectHelpers - @param {Function} callback The function to be called. - */ + exports.peekMeta = peekMeta = function WeakMap_peekMeta(obj) { + _emberMetalDebug.runInDebug(function () { + return counters.peekCalls++; + }); - function onInjectHelpers(callback) { - callbacks.push(callback); - } + return metaStore.get(obj); + }; - function invokeInjectHelpersCallbacks(app) { - for (var i = 0; i < callbacks.length; i++) { - callbacks[i](app); - } + exports.peekMeta = peekMeta = function WeakMap_peekParentMeta(obj) { + var pointer = obj; + var meta = undefined; + while (pointer) { + meta = metaStore.get(pointer); + // jshint loopfunc:true + _emberMetalDebug.runInDebug(function () { + return counters.peekCalls++; + }); + // stop if we find a `null` value, since + // that means the meta was deleted + // any other truthy value is a "real" meta + if (meta === null || meta) { + return meta; + } + + pointer = getPrototypeOf(pointer); + _emberMetalDebug.runInDebug(function () { + return counters.peakPrototypeWalks++; + }); + } + }; + })(); + } else { + exports.setMeta = setMeta = function Fallback_setMeta(obj, meta) { + // if `null` already, just set it to the new value + // otherwise define property first + if (obj[META_FIELD] !== null) { + if (obj.__defineNonEnumerable) { + obj.__defineNonEnumerable(EMBER_META_PROPERTY); + } else { + Object.defineProperty(obj, META_FIELD, META_DESC); + } + } + + obj[META_FIELD] = meta; + }; + + exports.peekMeta = peekMeta = function Fallback_peekMeta(obj) { + return obj[META_FIELD]; + }; } -}); -enifed("ember-testing/test/pending_requests", ["exports"], function (exports) { - "use strict"; - exports.pendingRequests = pendingRequests; - exports.clearPendingRequests = clearPendingRequests; - exports.incrementPendingRequests = incrementPendingRequests; - exports.decrementPendingRequests = decrementPendingRequests; - var requests = []; + function deleteMeta(obj) { + _emberMetalDebug.runInDebug(function () { + return counters.deleteCalls++; + }); - function pendingRequests() { - return requests.length; + var meta = peekMeta(obj); + if (meta) { + meta.destroy(); + } } - function clearPendingRequests() { - requests.length = 0; - } + /** + Retrieves the meta hash for an object. If `writable` is true ensures the + hash is writable for this object as well. + + The meta object contains information about computed property descriptors as + well as any watched properties and other information. You generally will + not access this information directly but instead work with higher level + methods that manipulate this hash indirectly. + + @method meta + @for Ember + @private + + @param {Object} obj The object to retrieve meta for + @param {Boolean} [writable=true] Pass `false` if you do not intend to modify + the meta hash, allowing the method to avoid making an unnecessary copy. + @return {Object} the meta hash for an object + */ - function incrementPendingRequests(_, xhr) { - requests.push(xhr); - } + function meta(obj) { + _emberMetalDebug.runInDebug(function () { + return counters.metaCalls++; + }); - function decrementPendingRequests(_, xhr) { - for (var i = 0; i < requests.length; i++) { - if (xhr === requests[i]) { - requests.splice(i, 1); - break; + var maybeMeta = peekMeta(obj); + var parent = undefined; + + // remove this code, in-favor of explicit parent + if (maybeMeta) { + if (maybeMeta.source === obj) { + return maybeMeta; } + parent = maybeMeta; } + + var newMeta = new Meta(obj, parent); + setMeta(obj, newMeta); + return newMeta; } -}); -enifed('ember-testing/test/promise', ['exports', 'ember-runtime', 'ember-testing/test/run'], function (exports, _emberRuntime, _emberTestingTestRun) { - 'use strict'; - exports.promise = promise; - exports.resolve = resolve; - exports.getLastPromise = getLastPromise; + exports.peekMeta = peekMeta; + exports.setMeta = setMeta; + exports.counters = counters; +}); +enifed('ember-metal/meta_listeners', ['exports'], function (exports) { + /* + When we render a rich template hierarchy, the set of events that + *might* happen tends to be much larger than the set of events that + actually happen. This implies that we should make listener creation & + destruction cheap, even at the cost of making event dispatch more + expensive. + + Thus we store a new listener with a single push and no new + allocations, without even bothering to do deduplication -- we can + save that for dispatch time, if an event actually happens. + */ - var lastPromise = undefined; + /* listener flags */ + 'use strict'; - var TestPromise = (function (_RSVP$Promise) { - babelHelpers.inherits(TestPromise, _RSVP$Promise); + var ONCE = 1; + exports.ONCE = ONCE; + var SUSPENDED = 2; - function TestPromise() { - babelHelpers.classCallCheck(this, TestPromise); + exports.SUSPENDED = SUSPENDED; + var protoMethods = { - _RSVP$Promise.apply(this, arguments); - lastPromise = this; - } + addToListeners: function (eventName, target, method, flags) { + if (!this._listeners) { + this._listeners = []; + } + this._listeners.push(eventName, target, method, flags); + }, - /** - This returns a thenable tailored for testing. It catches failed - `onSuccess` callbacks and invokes the `Ember.Test.adapter.exception` - callback in the last chained then. - - This method should be returned by async helpers such as `wait`. - - @public - @for Ember.Test - @method promise - @param {Function} resolver The function used to resolve the promise. - @param {String} label An optional string for identifying the promise. - */ + _finalizeListeners: function () { + if (this._listenersFinalized) { + return; + } + if (!this._listeners) { + this._listeners = []; + } + var pointer = this.parent; + while (pointer) { + var listeners = pointer._listeners; + if (listeners) { + this._listeners = this._listeners.concat(listeners); + } + if (pointer._listenersFinalized) { + break; + } + pointer = pointer.parent; + } + this._listenersFinalized = true; + }, - TestPromise.prototype.then = function then(onFulfillment) { - var _RSVP$Promise$prototype$then; + removeFromListeners: function (eventName, target, method, didRemove) { + var pointer = this; + while (pointer) { + var listeners = pointer._listeners; + if (listeners) { + for (var index = listeners.length - 4; index >= 0; index -= 4) { + if (listeners[index] === eventName && (!method || listeners[index + 1] === target && listeners[index + 2] === method)) { + if (pointer === this) { + // we are modifying our own list, so we edit directly + if (typeof didRemove === 'function') { + didRemove(eventName, target, listeners[index + 2]); + } + listeners.splice(index, 4); + } else { + // we are trying to remove an inherited listener, so we do + // just-in-time copying to detach our own listeners from + // our inheritance chain. + this._finalizeListeners(); + return this.removeFromListeners(eventName, target, method); + } + } + } + } + if (pointer._listenersFinalized) { + break; + } + pointer = pointer.parent; + } + }, - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; + matchingListeners: function (eventName) { + var pointer = this; + var result = []; + while (pointer) { + var listeners = pointer._listeners; + if (listeners) { + for (var index = 0; index < listeners.length - 3; index += 4) { + if (listeners[index] === eventName) { + pushUniqueListener(result, listeners, index); + } + } + } + if (pointer._listenersFinalized) { + break; + } + pointer = pointer.parent; } + var sus = this._suspendedListeners; + if (sus) { + for (var susIndex = 0; susIndex < sus.length - 2; susIndex += 3) { + if (eventName === sus[susIndex]) { + for (var resultIndex = 0; resultIndex < result.length - 2; resultIndex += 3) { + if (result[resultIndex] === sus[susIndex + 1] && result[resultIndex + 1] === sus[susIndex + 2]) { + result[resultIndex + 2] |= SUSPENDED; + } + } + } + } + } + return result; + }, - return (_RSVP$Promise$prototype$then = _RSVP$Promise.prototype.then).call.apply(_RSVP$Promise$prototype$then, [this, function (result) { - return isolate(onFulfillment, result); - }].concat(args)); - }; + suspendListeners: function (eventNames, target, method, callback) { + var sus = this._suspendedListeners; + if (!sus) { + sus = this._suspendedListeners = []; + } + for (var i = 0; i < eventNames.length; i++) { + sus.push(eventNames[i], target, method); + } + try { + return callback.call(target); + } finally { + if (sus.length === eventNames.length) { + this._suspendedListeners = undefined; + } else { + for (var i = sus.length - 3; i >= 0; i -= 3) { + if (sus[i + 1] === target && sus[i + 2] === method && eventNames.indexOf(sus[i]) !== -1) { + sus.splice(i, 3); + } + } + } + } + }, - return TestPromise; - })(_emberRuntime.RSVP.Promise); + watchedEvents: function () { + var pointer = this; + var names = {}; + while (pointer) { + var listeners = pointer._listeners; + if (listeners) { + for (var index = 0; index < listeners.length - 3; index += 4) { + names[listeners[index]] = true; + } + } + if (pointer._listenersFinalized) { + break; + } + pointer = pointer.parent; + } + return Object.keys(names); + }, - exports.default = TestPromise; + _initializeListeners: function () { + this._listeners = undefined; + this._listenersFinalized = undefined; + this._suspendedListeners = undefined; + } + }; - function promise(resolver, label) { - var fullLabel = 'Ember.Test.promise: ' + (label || ''); - return new TestPromise(resolver, fullLabel); + exports.protoMethods = protoMethods; + function pushUniqueListener(destination, source, index) { + var target = source[index + 1]; + var method = source[index + 2]; + for (var destinationIndex = 0; destinationIndex < destination.length - 2; destinationIndex += 3) { + if (destination[destinationIndex] === target && destination[destinationIndex + 1] === method) { + return; + } + } + destination.push(target, method, source[index + 3]); } +}); +enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'ember-metal/debug', 'ember-metal/meta', 'ember-metal/expand_properties', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/binding', 'ember-metal/observer', 'ember-metal/events'], function (exports, _emberUtils, _emberMetalError, _emberMetalDebug, _emberMetalMeta, _emberMetalExpand_properties, _emberMetalProperties, _emberMetalComputed, _emberMetalBinding, _emberMetalObserver, _emberMetalEvents) { + 'no use strict'; + // Remove "use strict"; from transpiled module until + // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed /** - Replacement for `Ember.RSVP.resolve` - The only difference is this uses - an instance of `Ember.Test.Promise` - - @public - @for Ember.Test - @method resolve - @param {Mixed} The value to resolve - @since 1.2.0 + @module ember + @submodule ember-metal */ + exports.detectBinding = detectBinding; + exports.mixin = mixin; + exports.hasUnprocessedMixins = hasUnprocessedMixins; + exports.clearUnprocessedMixins = clearUnprocessedMixins; + exports.required = required; + exports.aliasMethod = aliasMethod; + exports.observer = observer; + exports._immediateObserver = _immediateObserver; + exports._beforeObserver = _beforeObserver; - function resolve(result, label) { - return TestPromise.resolve(result, label); - } + function ROOT() {} + ROOT.__hasSuper = false; - function getLastPromise() { - return lastPromise; - } + var a_slice = Array.prototype.slice; + var a_concat = Array.prototype.concat; + var isArray = Array.isArray; - // This method isolates nested async methods - // so that they don't conflict with other last promises. - // - // 1. Set `Ember.Test.lastPromise` to null - // 2. Invoke method - // 3. Return the last promise created during method - function isolate(onFulfillment, result) { - // Reset lastPromise for nested helpers - lastPromise = null; + function isMethod(obj) { + return 'function' === typeof obj && obj.isMethod !== false && obj !== Boolean && obj !== Object && obj !== Number && obj !== Array && obj !== Date && obj !== String; + } - var value = onFulfillment(result); + var CONTINUE = {}; - var promise = lastPromise; - lastPromise = null; + function mixinProperties(mixinsMeta, mixin) { + var guid = undefined; - // If the method returned a promise - // return that promise. If not, - // return the last async helper's promise - if (value && value instanceof TestPromise || !promise) { - return value; + if (mixin instanceof Mixin) { + guid = _emberUtils.guidFor(mixin); + if (mixinsMeta.peekMixins(guid)) { + return CONTINUE; + } + mixinsMeta.writeMixins(guid, mixin); + return mixin.properties; } else { - return _emberTestingTestRun.default(function () { - return resolve(promise).then(function () { - return value; - }); - }); + return mixin; // apply anonymous mixin properties } } -}); -enifed('ember-testing/test/run', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; - exports.default = run; - - function run(fn) { - if (!_emberMetal.run.currentRunLoop) { - return _emberMetal.run(fn); - } else { - return fn(); + function concatenatedMixinProperties(concatProp, props, values, base) { + // reset before adding each new mixin to pickup concats from previous + var concats = values[concatProp] || base[concatProp]; + if (props[concatProp]) { + concats = concats ? a_concat.call(concats, props[concatProp]) : props[concatProp]; } + return concats; } -}); -enifed('ember-testing/test/waiters', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; - exports.registerWaiter = registerWaiter; - exports.unregisterWaiter = unregisterWaiter; - exports.checkWaiters = checkWaiters; - exports.generateDeprecatedWaitersArray = generateDeprecatedWaitersArray; + function giveDescriptorSuper(meta, key, property, values, descs, base) { + var superProperty = undefined; - var contexts = []; - var callbacks = []; + // Computed properties override methods, and do not call super to them + if (values[key] === undefined) { + // Find the original descriptor in a parent mixin + superProperty = descs[key]; + } - /** - This allows ember-testing to play nicely with other asynchronous - events, such as an application that is waiting for a CSS3 - transition or an IndexDB transaction. The waiter runs periodically - after each async helper (i.e. `click`, `andThen`, `visit`, etc) has executed, - until the returning result is truthy. After the waiters finish, the next async helper - is executed and the process repeats. - - For example: - - ```javascript - Ember.Test.registerWaiter(function() { - return myPendingTransactions() == 0; - }); - ``` - The `context` argument allows you to optionally specify the `this` - with which your callback will be invoked. - - For example: - - ```javascript - Ember.Test.registerWaiter(MyDB, MyDB.hasPendingTransactions); - ``` - - @public - @for Ember.Test - @method registerWaiter - @param {Object} context (optional) - @param {Function} callback - @since 1.2.0 - */ + // If we didn't find the original descriptor in a parent mixin, find + // it on the original object. + if (!superProperty) { + var possibleDesc = base[key]; + var superDesc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - function registerWaiter(context, callback) { - if (arguments.length === 1) { - callback = context; - context = null; + superProperty = superDesc; } - if (indexOf(context, callback) > -1) { - return; + + if (superProperty === undefined || !(superProperty instanceof _emberMetalComputed.ComputedProperty)) { + return property; } - contexts.push(context); - callbacks.push(callback); + + // Since multiple mixins may inherit from the same parent, we need + // to clone the computed property so that other mixins do not receive + // the wrapped version. + property = Object.create(property); + property._getter = _emberUtils.wrap(property._getter, superProperty._getter); + if (superProperty._setter) { + if (property._setter) { + property._setter = _emberUtils.wrap(property._setter, superProperty._setter); + } else { + property._setter = superProperty._setter; + } + } + + return property; } - /** - `unregisterWaiter` is used to unregister a callback that was - registered with `registerWaiter`. - - @public - @for Ember.Test - @method unregisterWaiter - @param {Object} context (optional) - @param {Function} callback - @since 1.2.0 - */ + function giveMethodSuper(obj, key, method, values, descs) { + var superMethod = undefined; - function unregisterWaiter(context, callback) { - if (!callbacks.length) { - return; + // Methods overwrite computed properties, and do not call super to them. + if (descs[key] === undefined) { + // Find the original method in a parent mixin + superMethod = values[key]; } - if (arguments.length === 1) { - callback = context; - context = null; + + // If we didn't find the original value in a parent mixin, find it in + // the original object + superMethod = superMethod || obj[key]; + + // Only wrap the new method if the original method was a function + if (superMethod === undefined || 'function' !== typeof superMethod) { + return method; } - var i = indexOf(context, callback); - if (i === -1) { - return; + + return _emberUtils.wrap(method, superMethod); + } + + function applyConcatenatedProperties(obj, key, value, values) { + var baseValue = values[key] || obj[key]; + var ret = undefined; + + if (baseValue === null || baseValue === undefined) { + ret = _emberUtils.makeArray(value); + } else { + if (isArray(baseValue)) { + if (value === null || value === undefined) { + ret = baseValue; + } else { + ret = a_concat.call(baseValue, value); + } + } else { + ret = a_concat.call(_emberUtils.makeArray(baseValue), value); + } } - contexts.splice(i, 1); - callbacks.splice(i, 1); + + _emberMetalDebug.runInDebug(function () { + // it is possible to use concatenatedProperties with strings (which cannot be frozen) + // only freeze objects... + if (typeof ret === 'object' && ret !== null) { + // prevent mutating `concatenatedProperties` array after it is applied + Object.freeze(ret); + } + }); + + return ret; } - /** - Iterates through each registered test waiter, and invokes - its callback. If any waiter returns false, this method will return - true indicating that the waiters have not settled yet. - - This is generally used internally from the acceptance/integration test - infrastructure. - - @public - @for Ember.Test - @static - @method checkWaiters - */ + function applyMergedProperties(obj, key, value, values) { + var baseValue = values[key] || obj[key]; - function checkWaiters() { - if (!callbacks.length) { - return false; + _emberMetalDebug.runInDebug(function () { + if (isArray(value)) { + // use conditional to avoid stringifying every time + _emberMetalDebug.assert('You passed in `' + JSON.stringify(value) + '` as the value for `' + key + '` but `' + key + '` cannot be an Array', false); + } + }); + + if (!baseValue) { + return value; } - for (var i = 0; i < callbacks.length; i++) { - var context = contexts[i]; - var callback = callbacks[i]; - if (!callback.call(context)) { - return true; + + var newBase = _emberUtils.assign({}, baseValue); + var hasFunction = false; + + for (var prop in value) { + if (!value.hasOwnProperty(prop)) { + continue; } - } - return false; - } - function indexOf(context, callback) { - for (var i = 0; i < callbacks.length; i++) { - if (callbacks[i] === callback && contexts[i] === context) { - return i; + var propValue = value[prop]; + if (isMethod(propValue)) { + // TODO: support for Computed Properties, etc? + hasFunction = true; + newBase[prop] = giveMethodSuper(obj, prop, propValue, baseValue, {}); + } else { + newBase[prop] = propValue; } } - return -1; + + if (hasFunction) { + newBase._super = ROOT; + } + + return newBase; } - function generateDeprecatedWaitersArray() { - _emberMetal.deprecate('Usage of `Ember.Test.waiters` is deprecated. Please refactor to `Ember.Test.checkWaiters`.', !true, { until: '2.8.0', id: 'ember-testing.test-waiters' }); + function addNormalizedProperty(base, key, value, meta, descs, values, concats, mergings) { + if (value instanceof _emberMetalProperties.Descriptor) { + if (value === REQUIRED && descs[key]) { + return CONTINUE; + } - var array = new Array(callbacks.length); - for (var i = 0; i < callbacks.length; i++) { - var context = contexts[i]; - var callback = callbacks[i]; + // Wrap descriptor function to implement + // _super() if needed + if (value._getter) { + value = giveDescriptorSuper(meta, key, value, values, descs, base); + } - array[i] = [context, callback]; - } + descs[key] = value; + values[key] = undefined; + } else { + if (concats && concats.indexOf(key) >= 0 || key === 'concatenatedProperties' || key === 'mergedProperties') { + value = applyConcatenatedProperties(base, key, value, values); + } else if (mergings && mergings.indexOf(key) >= 0) { + value = applyMergedProperties(base, key, value, values); + } else if (isMethod(value)) { + value = giveMethodSuper(base, key, value, values, descs); + } - return array; + descs[key] = undefined; + values[key] = value; + } } -}); -enifed("ember-utils/apply-str", ["exports"], function (exports) { - /** - @param {Object} t target - @param {String} m method - @param {Array} a args - @private - */ - "use strict"; - exports.default = applyStr; + function mergeMixins(mixins, m, descs, values, base, keys) { + var currentMixin = undefined, + props = undefined, + key = undefined, + concats = undefined, + mergings = undefined; - function applyStr(t, m, a) { - var l = a && a.length; - if (!a || !l) { - return t[m](); - } - switch (l) { - case 1: - return t[m](a[0]); - case 2: - return t[m](a[0], a[1]); - case 3: - return t[m](a[0], a[1], a[2]); - case 4: - return t[m](a[0], a[1], a[2], a[3]); - case 5: - return t[m](a[0], a[1], a[2], a[3], a[4]); - default: - return t[m].apply(t, a); + function removeKeys(keyName) { + delete descs[keyName]; + delete values[keyName]; } - } -}); -enifed("ember-utils/assign", ["exports"], function (exports) { - /** - Copy properties from a source object to a target object. - - ```javascript - var a = { first: 'Yehuda' }; - var b = { last: 'Katz' }; - var c = { company: 'Tilde Inc.' }; - Ember.assign(a, b, c); // a === { first: 'Yehuda', last: 'Katz', company: 'Tilde Inc.' }, b === { last: 'Katz' }, c === { company: 'Tilde Inc.' } - ``` - - @method assign - @for Ember - @param {Object} original The object to assign into - @param {Object} ...args The objects to copy properties from - @return {Object} - @public - */ - "use strict"; - exports.default = assign; + for (var i = 0; i < mixins.length; i++) { + currentMixin = mixins[i]; + _emberMetalDebug.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(currentMixin), typeof currentMixin === 'object' && currentMixin !== null && Object.prototype.toString.call(currentMixin) !== '[object Array]'); - function assign(original) { - for (var i = 1; i < arguments.length; i++) { - var arg = arguments[i]; - if (!arg) { + props = mixinProperties(m, currentMixin); + if (props === CONTINUE) { continue; } - var updates = Object.keys(arg); + if (props) { + if (base.willMergeMixin) { + base.willMergeMixin(props); + } + concats = concatenatedMixinProperties('concatenatedProperties', props, values, base); + mergings = concatenatedMixinProperties('mergedProperties', props, values, base); - for (var _i = 0; _i < updates.length; _i++) { - var prop = updates[_i]; - original[prop] = arg[prop]; + for (key in props) { + if (!props.hasOwnProperty(key)) { + continue; + } + keys.push(key); + addNormalizedProperty(base, key, props[key], m, descs, values, concats, mergings); + } + + // manually copy toString() because some JS engines do not enumerate it + if (props.hasOwnProperty('toString')) { + base.toString = props.toString; + } + } else if (currentMixin.mixins) { + mergeMixins(currentMixin.mixins, m, descs, values, base, keys); + if (currentMixin._without) { + currentMixin._without.forEach(removeKeys); + } } } + } - return original; + function detectBinding(key) { + var length = key.length; + + return length > 7 && key.charCodeAt(length - 7) === 66 && key.indexOf('inding', length - 6) !== -1; } -}); -enifed('ember-utils/dictionary', ['exports', 'ember-utils/empty-object'], function (exports, _emberUtilsEmptyObject) { - 'use strict'; - exports.default = makeDictionary; + // warm both paths of above function + detectBinding('notbound'); + detectBinding('fooBinding'); - // 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. + function connectBindings(obj, m) { + // TODO Mixin.apply(instance) should disconnect binding if exists + m.forEachBindings(function (key, binding) { + if (binding) { + var to = key.slice(0, -7); // strip Binding off end + if (binding instanceof _emberMetalBinding.Binding) { + binding = binding.copy(); // copy prototypes' instance + binding.to(to); + } else { + // binding is string path + binding = new _emberMetalBinding.Binding(to, binding); + } + binding.connect(obj); + obj[key] = binding; + } + }); + // mark as applied + m.clearBindings(); + } - function makeDictionary(parent) { - var dict = undefined; - if (parent === null) { - dict = new _emberUtilsEmptyObject.default(); + function finishPartial(obj, m) { + connectBindings(obj, m || _emberMetalMeta.meta(obj)); + return obj; + } + + function followAlias(obj, desc, m, descs, values) { + var altKey = desc.methodName; + var value = undefined; + var possibleDesc = undefined; + if (descs[altKey] || values[altKey]) { + value = values[altKey]; + desc = descs[altKey]; + } else if ((possibleDesc = obj[altKey]) && possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor) { + desc = possibleDesc; + value = undefined; } else { - dict = Object.create(parent); + desc = undefined; + value = obj[altKey]; } - dict['_dict'] = null; - delete dict['_dict']; - return dict; + + return { desc: desc, value: value }; } -}); -enifed("ember-utils/empty-object", ["exports"], function (exports) { - // This exists because `Object.create(null)` is absurdly slow compared - // to `new EmptyObject()`. In either case, you want a null prototype - // when you're treating the object instances as arbitrary dictionaries - // and don't want your keys colliding with build-in methods on the - // default object prototype. - "use strict"; + function updateObserversAndListeners(obj, key, observerOrListener, pathsKey, updateMethod) { + var paths = observerOrListener[pathsKey]; - var proto = Object.create(null, { - // without this, we will always still end up with (new - // EmptyObject()).constructor === Object - constructor: { - value: undefined, - enumerable: false, - writable: true + if (paths) { + for (var i = 0; i < paths.length; i++) { + updateMethod(obj, paths[i], null, key); + } } - }); + } - function EmptyObject() {} - EmptyObject.prototype = proto; - exports.default = EmptyObject; -}); -enifed('ember-utils/guid', ['exports', 'ember-utils/intern'], function (exports, _emberUtilsIntern) { - 'use strict'; + function replaceObserversAndListeners(obj, key, observerOrListener) { + var prev = obj[key]; - exports.uuid = uuid; - exports.generateGuid = generateGuid; - exports.guidFor = guidFor; + if ('function' === typeof prev) { + updateObserversAndListeners(obj, key, prev, '__ember_observesBefore__', _emberMetalObserver._removeBeforeObserver); + updateObserversAndListeners(obj, key, prev, '__ember_observes__', _emberMetalObserver.removeObserver); + updateObserversAndListeners(obj, key, prev, '__ember_listens__', _emberMetalEvents.removeListener); + } - /** - Previously we used `Ember.$.uuid`, however `$.uuid` has been removed from - jQuery master. We'll just bootstrap our own uuid now. - - @private - @return {Number} the uuid - */ - var _uuid = 0; + if ('function' === typeof observerOrListener) { + updateObserversAndListeners(obj, key, observerOrListener, '__ember_observesBefore__', _emberMetalObserver._addBeforeObserver); + updateObserversAndListeners(obj, key, observerOrListener, '__ember_observes__', _emberMetalObserver.addObserver); + updateObserversAndListeners(obj, key, observerOrListener, '__ember_listens__', _emberMetalEvents.addListener); + } + } - /** - Generates a universally unique identifier. This method - is used internally by Ember for assisting with - the generation of GUID's and other unique identifiers. - - @public - @return {Number} [description] - */ + function applyMixin(obj, mixins, partial) { + var descs = {}; + var values = {}; + var m = _emberMetalMeta.meta(obj); + var keys = []; + var key = undefined, + value = undefined, + desc = undefined; - function uuid() { - return ++_uuid; - } + obj._super = ROOT; - /** - Prefix used for guids through out Ember. - @private - @property GUID_PREFIX - @for Ember - @type String - @final - */ - var GUID_PREFIX = 'ember'; + // Go through all mixins and hashes passed in, and: + // + // * Handle concatenated properties + // * Handle merged properties + // * Set up _super wrapping if necessary + // * Set up computed property descriptors + // * Copying `toString` in broken browsers + mergeMixins(mixins, m, descs, values, obj, keys); - // Used for guid generation... - var numberCache = []; - var stringCache = {}; + for (var i = 0; i < keys.length; i++) { + key = keys[i]; + if (key === 'constructor' || !values.hasOwnProperty(key)) { + continue; + } - /** - A unique key used to assign guids and other private metadata to objects. - If you inspect an object in your browser debugger you will often see these. - They can be safely ignored. - - On browsers that support it, these properties are added with enumeration - disabled so they won't show up when you iterate over your properties. - - @private - @property GUID_KEY - @for Ember - @type String - @final - */ - var GUID_KEY = _emberUtilsIntern.default('__ember' + +new Date()); + desc = descs[key]; + value = values[key]; - exports.GUID_KEY = GUID_KEY; - var GUID_DESC = { - writable: true, - configurable: true, - enumerable: false, - value: null - }; + if (desc === REQUIRED) { + continue; + } - exports.GUID_DESC = GUID_DESC; - var nullDescriptor = { - configurable: true, - writable: true, - enumerable: false, - value: null - }; + while (desc && desc instanceof Alias) { + var followed = followAlias(obj, desc, m, descs, values); + desc = followed.desc; + value = followed.value; + } - var GUID_KEY_PROPERTY = { - name: GUID_KEY, - descriptor: nullDescriptor - }; + if (desc === undefined && value === undefined) { + continue; + } + + replaceObserversAndListeners(obj, key, value); + + if (detectBinding(key)) { + m.writeBindings(key, value); + } + + _emberMetalProperties.defineProperty(obj, key, desc, value, m); + } + + if (!partial) { + // don't apply to prototype + finishPartial(obj, m); + } + + return obj; + } - exports.GUID_KEY_PROPERTY = GUID_KEY_PROPERTY; /** - Generates a new guid, optionally saving the guid to the object that you - pass in. You will rarely need to use this method. Instead you should - call `Ember.guidFor(obj)`, which return an existing guid if available. - - @private - @method generateGuid + @method mixin @for Ember - @param {Object} [obj] Object the guid will be used for. If passed in, the guid will - be saved on the object and reused whenever you pass the same object - again. - - If no object is passed, just generate a new guid. - @param {String} [prefix] Prefix to place in front of the guid. Useful when you want to - separate the guid into separate namespaces. - @return {String} the guid + @param obj + @param mixins* + @return obj + @private */ - function generateGuid(obj, prefix) { - if (!prefix) { - prefix = GUID_PREFIX; + function mixin(obj) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; } - var ret = prefix + uuid(); - if (obj) { - if (obj[GUID_KEY] === null) { - obj[GUID_KEY] = ret; - } else { - GUID_DESC.value = ret; - if (obj.__defineNonEnumerable) { - obj.__defineNonEnumerable(GUID_KEY_PROPERTY); - } else { - Object.defineProperty(obj, GUID_KEY, GUID_DESC); - } - } - } - return ret; + applyMixin(obj, args, false); + return obj; } /** - Returns a unique id for the object. If the object does not yet have a guid, - one will be assigned to it. You can call this on any object, - `Ember.Object`-based or not, but be aware that it will add a `_guid` - property. + The `Ember.Mixin` class allows you to create mixins, whose properties can be + added to other classes. For instance, - You can also use this method on DOM Element objects. + ```javascript + const EditableMixin = Ember.Mixin.create({ + edit() { + console.log('starting to edit'); + this.set('isEditing', true); + }, + isEditing: false + }); + + // Mix mixins into classes by passing them as the first arguments to + // `.extend.` + const Comment = Ember.Object.extend(EditableMixin, { + post: null + }); + + let comment = Comment.create(post: somePost); + comment.edit(); // outputs 'starting to edit' + ``` + + Note that Mixins are created with `Ember.Mixin.create`, not + `Ember.Mixin.extend`. + + Note that mixins extend a constructor's prototype so arrays and object literals + defined as properties will be shared amongst objects that implement the mixin. + If you want to define a property in a mixin that is not shared, you can define + it either as a computed property or have it be created on initialization of the object. + ```javascript + // filters array will be shared amongst any object implementing mixin + const FilterableMixin = Ember.Mixin.create({ + filters: Ember.A() + }); + + // filters will be a separate array for every object implementing the mixin + const FilterableMixin = Ember.Mixin.create({ + filters: Ember.computed(function() { + return Ember.A(); + }) + }); + + // filters will be created as a separate array during the object's initialization + const Filterable = Ember.Mixin.create({ + init() { + this._super(...arguments); + this.set("filters", Ember.A()); + } + }); + ``` + + @class Mixin + @namespace Ember @public - @method guidFor - @for Ember - @param {Object} obj any object, string, number, Element, or primitive - @return {String} the unique guid for this instance. */ - function guidFor(obj) { - var type = typeof obj; - var isObject = type === 'object' && obj !== null; - var isFunction = type === 'function'; + var Mixin = (function () { + function Mixin(args, properties) { + babelHelpers.classCallCheck(this, Mixin); - if ((isObject || isFunction) && obj[GUID_KEY]) { - return obj[GUID_KEY]; - } + this.properties = properties; - // special cases where we don't want to add a key to object - if (obj === undefined) { - return '(undefined)'; - } + var length = args && args.length; - if (obj === null) { - return '(null)'; + if (length > 0) { + var m = new Array(length); + + for (var i = 0; i < length; i++) { + var x = args[i]; + if (x instanceof Mixin) { + m[i] = x; + } else { + m[i] = new Mixin(undefined, x); + } + } + + this.mixins = m; + } else { + this.mixins = undefined; + } + this.ownerConstructor = undefined; + this._without = undefined; + this[_emberUtils.GUID_KEY] = null; + this[_emberUtils.NAME_KEY] = null; + _emberMetalDebug.debugSeal(this); } - var ret = undefined; + Mixin.applyPartial = function applyPartial(obj) { + var args = a_slice.call(arguments, 1); + return applyMixin(obj, args, true); + }; - // Don't allow prototype changes to String etc. to change the guidFor - switch (type) { - case 'number': - ret = numberCache[obj]; + /** + @method create + @static + @param arguments* + @public + */ + + Mixin.create = function create() { + // ES6TODO: this relies on a global state? + unprocessedFlag = true; + var M = this; + + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return new M(args, undefined); + }; - if (!ret) { - ret = numberCache[obj] = 'nu' + obj; - } + // returns the mixins currently applied to the specified object + // TODO: Make Ember.mixin + Mixin.mixins = function mixins(obj) { + var m = _emberMetalMeta.peekMeta(obj); + var ret = []; + if (!m) { return ret; + } - case 'string': - ret = stringCache[obj]; - - if (!ret) { - ret = stringCache[obj] = 'st' + uuid(); + m.forEachMixins(function (key, currentMixin) { + // skip primitive mixins since these are always anonymous + if (!currentMixin.properties) { + ret.push(currentMixin); } + }); - return ret; + return ret; + }; - case 'boolean': - return obj ? '(true)' : '(false)'; + return Mixin; + })(); - default: - if (obj === Object) { - return '(Object)'; - } + exports.default = Mixin; - if (obj === Array) { - return '(Array)'; - } + Mixin._apply = applyMixin; - ret = GUID_PREFIX + uuid(); + Mixin.finishPartial = finishPartial; - if (obj[GUID_KEY] === null) { - obj[GUID_KEY] = ret; - } else { - GUID_DESC.value = ret; + var unprocessedFlag = false; - if (obj.__defineNonEnumerable) { - obj.__defineNonEnumerable(GUID_KEY_PROPERTY); - } else { - Object.defineProperty(obj, GUID_KEY, GUID_DESC); - } - } - return ret; - } + function hasUnprocessedMixins() { + return unprocessedFlag; } -}); -enifed('ember-utils/index', ['exports', 'ember-utils/symbol', 'ember-utils/owner', 'ember-utils/assign', 'ember-utils/empty-object', 'ember-utils/dictionary', 'ember-utils/guid', 'ember-utils/intern', 'ember-utils/super', 'ember-utils/inspect', 'ember-utils/lookup-descriptor', 'ember-utils/invoke', 'ember-utils/make-array', 'ember-utils/apply-str', 'ember-utils/to-string'], function (exports, _emberUtilsSymbol, _emberUtilsOwner, _emberUtilsAssign, _emberUtilsEmptyObject, _emberUtilsDictionary, _emberUtilsGuid, _emberUtilsIntern, _emberUtilsSuper, _emberUtilsInspect, _emberUtilsLookupDescriptor, _emberUtilsInvoke, _emberUtilsMakeArray, _emberUtilsApplyStr, _emberUtilsToString) { - /* - This package will be eagerly parsed and should have no dependencies on external - packages. - - It is intended to be used to share utility methods that will be needed - by every Ember application (and is **not** a dumping ground of useful utilities). - - Utility methods that are needed in < 80% of cases should be placed - elsewhere (so they can be lazily evaluated / parsed). + + function clearUnprocessedMixins() { + unprocessedFlag = false; + } + + var MixinPrototype = Mixin.prototype; + + /** + @method reopen + @param arguments* + @private */ - 'use strict'; + MixinPrototype.reopen = function () { + var currentMixin = undefined; - exports.symbol = _emberUtilsSymbol.default; - exports.getOwner = _emberUtilsOwner.getOwner; - exports.setOwner = _emberUtilsOwner.setOwner; - exports.OWNER = _emberUtilsOwner.OWNER; - exports.assign = _emberUtilsAssign.default; - exports.EmptyObject = _emberUtilsEmptyObject.default; - exports.dictionary = _emberUtilsDictionary.default; - exports.uuid = _emberUtilsGuid.uuid; - exports.GUID_KEY = _emberUtilsGuid.GUID_KEY; - exports.GUID_DESC = _emberUtilsGuid.GUID_DESC; - exports.GUID_KEY_PROPERTY = _emberUtilsGuid.GUID_KEY_PROPERTY; - exports.generateGuid = _emberUtilsGuid.generateGuid; - exports.guidFor = _emberUtilsGuid.guidFor; - exports.intern = _emberUtilsIntern.default; - exports.checkHasSuper = _emberUtilsSuper.checkHasSuper; - exports.ROOT = _emberUtilsSuper.ROOT; - exports.wrap = _emberUtilsSuper.wrap; - exports.inspect = _emberUtilsInspect.default; - exports.lookupDescriptor = _emberUtilsLookupDescriptor.default; - exports.canInvoke = _emberUtilsInvoke.canInvoke; - exports.tryInvoke = _emberUtilsInvoke.tryInvoke; - exports.makeArray = _emberUtilsMakeArray.default; - exports.applyStr = _emberUtilsApplyStr.default; - exports.toString = _emberUtilsToString.default; -}); -enifed('ember-utils/inspect', ['exports'], function (exports) { - 'use strict'; + if (this.properties) { + currentMixin = new Mixin(undefined, this.properties); + this.properties = undefined; + this.mixins = [currentMixin]; + } else if (!this.mixins) { + this.mixins = []; + } - exports.default = inspect; - var objectToString = Object.prototype.toString; + var mixins = this.mixins; + var idx = undefined; + + for (idx = 0; idx < arguments.length; idx++) { + currentMixin = arguments[idx]; + _emberMetalDebug.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(currentMixin), typeof currentMixin === 'object' && currentMixin !== null && Object.prototype.toString.call(currentMixin) !== '[object Array]'); + + if (currentMixin instanceof Mixin) { + mixins.push(currentMixin); + } else { + mixins.push(new Mixin(undefined, currentMixin)); + } + } + + return this; + }; /** - Convenience method to inspect an object. This method will attempt to - convert the object into a useful string description. - - It is a pretty simple implementation. If you want something more robust, - use something like JSDump: https://github.com/NV/jsDump - - @method inspect - @for Ember - @param {Object} obj The object you want to inspect. - @return {String} A description of the object - @since 1.4.0 + @method apply + @param obj + @return applied object @private */ + MixinPrototype.apply = function (obj) { + return applyMixin(obj, [this], false); + }; - function inspect(obj) { - if (obj === null) { - return 'null'; + MixinPrototype.applyPartial = function (obj) { + return applyMixin(obj, [this], true); + }; + + MixinPrototype.toString = Object.toString; + + function _detect(curMixin, targetMixin, seen) { + var guid = _emberUtils.guidFor(curMixin); + + if (seen[guid]) { + return false; } - if (obj === undefined) { - return 'undefined'; + seen[guid] = true; + + if (curMixin === targetMixin) { + return true; } - if (Array.isArray(obj)) { - return '[' + obj + ']'; + var mixins = curMixin.mixins; + var loc = mixins ? mixins.length : 0; + while (--loc >= 0) { + if (_detect(mixins[loc], targetMixin, seen)) { + return true; + } } - // for non objects - var type = typeof obj; - if (type !== 'object' && type !== 'symbol') { - return '' + obj; + return false; + } + + /** + @method detect + @param obj + @return {Boolean} + @private + */ + MixinPrototype.detect = function (obj) { + if (typeof obj !== 'object' || obj === null) { + return false; } - // overridden toString - if (typeof obj.toString === 'function' && obj.toString !== objectToString) { - return obj.toString(); + if (obj instanceof Mixin) { + return _detect(obj, this, {}); + } + var m = _emberMetalMeta.peekMeta(obj); + if (!m) { + return false; } + return !!m.peekMixins(_emberUtils.guidFor(this)); + }; - // Object.prototype.toString === {}.toString - var v = undefined; - var ret = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - v = obj[key]; - if (v === 'toString') { - continue; - } // ignore useless items - if (typeof v === 'function') { - v = 'function() { ... }'; - } + MixinPrototype.without = function () { + var ret = new Mixin([this]); - if (v && typeof v.toString !== 'function') { - ret.push(key + ': ' + objectToString.call(v)); - } else { - ret.push(key + ': ' + v); - } + for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + + ret._without = args; + return ret; + }; + + function _keys(ret, mixin, seen) { + if (seen[_emberUtils.guidFor(mixin)]) { + return; + } + seen[_emberUtils.guidFor(mixin)] = true; + + if (mixin.properties) { + var props = Object.keys(mixin.properties); + for (var i = 0; i < props.length; i++) { + var key = props[i]; + ret[key] = true; } + } else if (mixin.mixins) { + mixin.mixins.forEach(function (x) { + return _keys(ret, x, seen); + }); } - return '{' + ret.join(', ') + '}'; } -}); -enifed("ember-utils/intern", ["exports"], function (exports) { + + MixinPrototype.keys = function () { + var keys = {}; + var seen = {}; + + _keys(keys, this, seen); + var ret = Object.keys(keys); + return ret; + }; + + _emberMetalDebug.debugSeal(MixinPrototype); + + var REQUIRED = new _emberMetalProperties.Descriptor(); + REQUIRED.toString = function () { + return '(Required Property)'; + }; + /** - Strongly hint runtimes to intern the provided string. - - When do I need to use this function? - - For the most part, never. Pre-mature optimization is bad, and often the - runtime does exactly what you need it to, and more often the trade-off isn't - worth it. - - Why? - - Runtimes store strings in at least 2 different representations: - Ropes and Symbols (interned strings). The Rope provides a memory efficient - data-structure for strings created from concatenation or some other string - manipulation like splitting. - - Unfortunately checking equality of different ropes can be quite costly as - runtimes must resort to clever string comparison algorithms. These - algorithms typically cost in proportion to the length of the string. - Luckily, this is where the Symbols (interned strings) shine. As Symbols are - unique by their string content, equality checks can be done by pointer - comparison. - - How do I know if my string is a rope or symbol? - - Typically (warning general sweeping statement, but truthy in runtimes at - present) static strings created as part of the JS source are interned. - Strings often used for comparisons can be interned at runtime if some - criteria are met. One of these criteria can be the size of the entire rope. - For example, in chrome 38 a rope longer then 12 characters will not - intern, nor will segments of that rope. - - Some numbers: http://jsperf.com/eval-vs-keys/8 - - Known Trick™ + Denotes a required property for a mixin + @method required + @for Ember @private - @return {String} interned version of the provided string */ - "use strict"; - exports.default = intern; + function required() { + _emberMetalDebug.deprecate('Ember.required is deprecated as its behavior is inconsistent and unreliable.', false, { id: 'ember-metal.required', until: '3.0.0' }); + return REQUIRED; + } - function intern(str) { - var obj = {}; - obj[str] = 1; - for (var key in obj) { - if (key === str) { - return key; - } - } - return str; + function Alias(methodName) { + this.isDescriptor = true; + this.methodName = methodName; } -}); -enifed('ember-utils/invoke', ['exports', 'ember-utils/apply-str'], function (exports, _emberUtilsApplyStr) { - 'use strict'; - exports.canInvoke = canInvoke; - exports.tryInvoke = tryInvoke; + Alias.prototype = new _emberMetalProperties.Descriptor(); /** - Checks to see if the `methodName` exists on the `obj`. + Makes a method available via an additional name. ```javascript - let foo = { bar: function() { return 'bar'; }, baz: null }; + App.Person = Ember.Object.extend({ + name: function() { + return 'Tomhuda Katzdale'; + }, + moniker: Ember.aliasMethod('name') + }); - Ember.canInvoke(foo, 'bar'); // true - Ember.canInvoke(foo, 'baz'); // false - Ember.canInvoke(foo, 'bat'); // false + let goodGuy = App.Person.create(); + + goodGuy.name(); // 'Tomhuda Katzdale' + goodGuy.moniker(); // 'Tomhuda Katzdale' ``` - @method canInvoke + @method aliasMethod @for Ember - @param {Object} obj The object to check for the method - @param {String} methodName The method name to check for - @return {Boolean} - @private + @param {String} methodName name of the method to alias + @public */ - function canInvoke(obj, methodName) { - return !!(obj && typeof obj[methodName] === 'function'); + function aliasMethod(methodName) { + return new Alias(methodName); } + // .......................................................... + // OBSERVER HELPER + // + /** - Checks to see if the `methodName` exists on the `obj`, - and if it does, invokes it with the arguments passed. + Specify a method that observes property changes. ```javascript - let d = new Date('03/15/2013'); - - Ember.tryInvoke(d, 'getTime'); // 1363320000000 - Ember.tryInvoke(d, 'setFullYear', [2014]); // 1394856000000 - Ember.tryInvoke(d, 'noSuchMethod', [2014]); // undefined + Ember.Object.extend({ + valueObserver: Ember.observer('value', function() { + // Executes whenever the "value" property changes + }) + }); ``` - @method tryInvoke + Also available as `Function.prototype.observes` if prototype extensions are + enabled. + + @method observer @for Ember - @param {Object} obj The object to check for the method - @param {String} methodName The method name to check for - @param {Array} [args] The arguments to pass to the method - @return {*} the return value of the invoked method or undefined if it cannot be invoked + @param {String} propertyNames* + @param {Function} func + @return func @public */ - function tryInvoke(obj, methodName, args) { - if (canInvoke(obj, methodName)) { - return args ? _emberUtilsApplyStr.default(obj, methodName, args) : _emberUtilsApplyStr.default(obj, methodName); + function observer() { + for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; } - } -}); -enifed("ember-utils/lookup-descriptor", ["exports"], function (exports) { - "use strict"; - exports.default = lookupDescriptor; + var func = args.slice(-1)[0]; + var paths = undefined; - function lookupDescriptor(obj, keyName) { - var current = obj; - while (current) { - var descriptor = Object.getOwnPropertyDescriptor(current, keyName); + var addWatchedProperty = function (path) { + paths.push(path); + }; + var _paths = args.slice(0, -1); - if (descriptor) { - return descriptor; - } + if (typeof func !== 'function') { + // revert to old, soft-deprecated argument ordering + _emberMetalDebug.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' }); - current = Object.getPrototypeOf(current); + func = args[0]; + _paths = args.slice(1); } - return null; - } -}); -enifed("ember-utils/make-array", ["exports"], function (exports) { - /** - Forces the passed object to be part of an array. If the object is already - an array, it will return the object. Otherwise, it will add the object to - an array. If obj is `null` or `undefined`, it will return an empty array. - - ```javascript - Ember.makeArray(); // [] - Ember.makeArray(null); // [] - Ember.makeArray(undefined); // [] - Ember.makeArray('lindsay'); // ['lindsay'] - Ember.makeArray([1, 2, 42]); // [1, 2, 42] - - let controller = Ember.ArrayProxy.create({ content: [] }); - - Ember.makeArray(controller) === controller; // true - ``` - - @method makeArray - @for Ember - @param {Object} obj the object - @return {Array} - @private - */ - "use strict"; - - exports.default = makeArray; + paths = []; - function makeArray(obj) { - if (obj === null || obj === undefined) { - return []; + for (var i = 0; i < _paths.length; ++i) { + _emberMetalExpand_properties.default(_paths[i], addWatchedProperty); } - return Array.isArray(obj) ? obj : [obj]; - } -}); -enifed('ember-utils/owner', ['exports', 'ember-utils/symbol'], function (exports, _emberUtilsSymbol) { - /** - @module ember - @submodule ember-runtime - */ - 'use strict'; + if (typeof func !== 'function') { + throw new _emberMetalError.default('Ember.observer called without a function'); + } - exports.getOwner = getOwner; - exports.setOwner = setOwner; - var OWNER = _emberUtilsSymbol.default('OWNER'); + func.__ember_observes__ = paths; + return func; + } - exports.OWNER = OWNER; /** - Framework objects in an Ember application (components, services, routes, etc.) - are created via a factory and dependency injection system. Each of these - objects is the responsibility of an "owner", which handled its - instantiation and manages its lifetime. - - `getOwner` fetches the owner object responsible for an instance. This can - be used to lookup or resolve other class instances, or register new factories - into the owner. - - For example, this component dynamically looks up a service based on the - `audioType` passed as an attribute: - - ``` - // app/components/play-audio.js - import Ember from 'ember'; + Specify a method that observes property changes. - // Usage: - // - // {{play-audio audioType=model.audioType audioFile=model.file}} - // - export default Ember.Component.extend({ - audioService: Ember.computed('audioType', function() { - let owner = Ember.getOwner(this); - return owner.lookup(`service:${this.get('audioType')}`); - }), - click() { - let player = this.get('audioService'); - player.play(this.get('audioFile')); - } + ```javascript + Ember.Object.extend({ + valueObserver: Ember.immediateObserver('value', function() { + // Executes whenever the "value" property changes + }) }); ``` - @method getOwner + In the future, `Ember.observer` may become asynchronous. In this event, + `Ember.immediateObserver` will maintain the synchronous behavior. + + Also available as `Function.prototype.observesImmediately` if prototype extensions are + enabled. + + @method _immediateObserver @for Ember - @param {Object} object An object with an owner. - @return {Object} An owner object. - @since 2.3.0 - @public + @param {String} propertyNames* + @param {Function} func + @deprecated Use `Ember.observer` instead. + @return func + @private */ - function getOwner(object) { - return object[OWNER]; + function _immediateObserver() { + _emberMetalDebug.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; i < arguments.length; i++) { + var arg = arguments[i]; + _emberMetalDebug.assert('Immediate observers must observe internal properties only, not properties on other objects.', typeof arg !== 'string' || arg.indexOf('.') === -1); + } + + return observer.apply(this, arguments); } /** - `setOwner` forces a new owner on a given object instance. This is primarily - useful in some testing cases. + When observers fire, they are called with the arguments `obj`, `keyName`. - @method setOwner + Note, `@each.property` observer is called per each add or replace of an element + and it's not called with a specific enumeration item. + + A `_beforeObserver` fires before a property changes. + + @method beforeObserver @for Ember - @param {Object} object An object with an owner. - @return {Object} An owner object. - @since 2.3.0 - @public + @param {String} propertyNames* + @param {Function} func + @return func + @deprecated + @private */ - function setOwner(object, owner) { - object[OWNER] = owner; - } -}); -enifed('ember-utils/super', ['exports'], function (exports) { - 'use strict'; - - exports.wrap = wrap; - var HAS_SUPER_PATTERN = /\.(_super|call\(this|apply\(this)/; - var fnToString = Function.prototype.toString; - - var checkHasSuper = (function () { - var sourceAvailable = fnToString.call(function () { - return this; - }).indexOf('return this') > -1; - - if (sourceAvailable) { - return function checkHasSuper(func) { - return HAS_SUPER_PATTERN.test(fnToString.call(func)); - }; + function _beforeObserver() { + for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { + args[_key5] = arguments[_key5]; } - return function checkHasSuper() { - return true; + var func = args.slice(-1)[0]; + var paths = undefined; + + var addWatchedProperty = function (path) { + paths.push(path); }; - })(); - exports.checkHasSuper = checkHasSuper; - function ROOT() {} - ROOT.__hasSuper = false; + var _paths = args.slice(0, -1); - function hasSuper(func) { - if (func.__hasSuper === undefined) { - func.__hasSuper = checkHasSuper(func); + if (typeof func !== 'function') { + // revert to old, soft-deprecated argument ordering + + func = args[0]; + _paths = args.slice(1); } - return func.__hasSuper; - } - /** - 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 - @method wrap - @for Ember - @param {Function} func The function to call - @param {Function} superFunc The super function. - @return {Function} wrapped function. - */ + paths = []; - function wrap(func, superFunc) { - if (!hasSuper(func)) { - return func; - } - // ensure an unwrapped super that calls _super is wrapped with a terminal _super - if (!superFunc.wrappedFunction && hasSuper(superFunc)) { - return _wrap(func, _wrap(superFunc, ROOT)); + for (var i = 0; i < _paths.length; ++i) { + _emberMetalExpand_properties.default(_paths[i], addWatchedProperty); } - return _wrap(func, superFunc); - } - function _wrap(func, superFunc) { - function superWrapper() { - var orig = this._super; - this._super = superFunc; - var ret = func.apply(this, arguments); - this._super = orig; - return ret; + if (typeof func !== 'function') { + throw new _emberMetalError.default('_beforeObserver called without a function'); } - superWrapper.wrappedFunction = func; - superWrapper.__ember_observes__ = func.__ember_observes__; - superWrapper.__ember_observesBefore__ = func.__ember_observesBefore__; - superWrapper.__ember_listens__ = func.__ember_listens__; - - return superWrapper; + func.__ember_observesBefore__ = paths; + return func; } -}); -enifed('ember-utils/symbol', ['exports', 'ember-utils/guid', 'ember-utils/intern'], function (exports, _emberUtilsGuid, _emberUtilsIntern) { - 'use strict'; - - exports.default = symbol; - function symbol(debugName) { - // TODO: Investigate using platform symbols, but we do not - // want to require non-enumerability for this API, which - // would introduce a large cost. - var id = _emberUtilsGuid.GUID_KEY + Math.floor(Math.random() * new Date()); - return _emberUtilsIntern.default('__' + debugName + '__ [id=' + id + ']'); - } + exports.Mixin = Mixin; + exports.REQUIRED = REQUIRED; }); -enifed("ember-utils/to-string", ["exports"], function (exports) { - "use strict"; +enifed('ember-metal/observer', ['exports', 'ember-metal/watching', 'ember-metal/events'], function (exports, _emberMetalWatching, _emberMetalEvents) { + 'use strict'; - exports.default = toString; - var objectToString = Object.prototype.toString; + exports.addObserver = addObserver; + exports.observersFor = observersFor; + exports.removeObserver = removeObserver; + exports._addBeforeObserver = _addBeforeObserver; + exports._suspendObserver = _suspendObserver; + exports._suspendObservers = _suspendObservers; + exports._removeBeforeObserver = _removeBeforeObserver; - /* - A `toString` util function that supports objects without a `toString` - method, e.g. an object created with `Object.create(null)`. + /** + @module ember-metal */ - function toString(obj) { - if (obj && obj.toString) { - return obj.toString(); - } else { - return objectToString.call(obj); - } + var AFTER_OBSERVERS = ':change'; + var BEFORE_OBSERVERS = ':before'; + + function changeEvent(keyName) { + return keyName + AFTER_OBSERVERS; } -}); -enifed('ember-views/compat/attrs', ['exports', 'ember-utils'], function (exports, _emberUtils) { - 'use strict'; - var MUTABLE_CELL = _emberUtils.symbol('MUTABLE_CELL'); - exports.MUTABLE_CELL = MUTABLE_CELL; -}); -enifed('ember-views/compat/fallback-view-registry', ['exports', 'ember-utils'], function (exports, _emberUtils) { - 'use strict'; + function beforeEvent(keyName) { + return keyName + BEFORE_OBSERVERS; + } - exports.default = _emberUtils.dictionary(null); -}); -enifed('ember-views/component_lookup', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { - 'use strict'; + /** + @method addObserver + @for Ember + @param obj + @param {String} _path + @param {Object|Function} target + @param {Function|String} [method] + @public + */ - exports.default = _emberRuntime.Object.extend({ - componentFor: function (name, owner, options) { - _emberMetal.assert('You cannot use \'' + name + '\' as a component name. Component names must contain a hyphen.', ~name.indexOf('-')); + function addObserver(obj, _path, target, method) { + _emberMetalEvents.addListener(obj, changeEvent(_path), target, method); + _emberMetalWatching.watch(obj, _path); - var fullName = 'component:' + name; - return owner._lookupFactory(fullName, options); - }, + return this; + } - layoutFor: function (name, owner, options) { - _emberMetal.assert('You cannot use \'' + name + '\' as a component name. Component names must contain a hyphen.', ~name.indexOf('-')); + function observersFor(obj, path) { + return _emberMetalEvents.listenersFor(obj, changeEvent(path)); + } - var templateFullName = 'template:components/' + name; - return owner.lookup(templateFullName, options); - } - }); -}); -enifed('ember-views/index', ['exports', 'ember-views/system/ext', 'ember-views/system/jquery', 'ember-views/system/utils', 'ember-views/system/event_dispatcher', 'ember-views/component_lookup', 'ember-views/mixins/text_support', 'ember-views/views/core_view', 'ember-views/mixins/class_names_support', 'ember-views/mixins/child_views_support', 'ember-views/mixins/view_state_support', 'ember-views/mixins/view_support', 'ember-views/mixins/action_support', 'ember-views/compat/attrs', 'ember-views/system/lookup_partial', 'ember-views/utils/lookup-component', 'ember-views/system/action_manager', 'ember-views/compat/fallback-view-registry'], function (exports, _emberViewsSystemExt, _emberViewsSystemJquery, _emberViewsSystemUtils, _emberViewsSystemEvent_dispatcher, _emberViewsComponent_lookup, _emberViewsMixinsText_support, _emberViewsViewsCore_view, _emberViewsMixinsClass_names_support, _emberViewsMixinsChild_views_support, _emberViewsMixinsView_state_support, _emberViewsMixinsView_support, _emberViewsMixinsAction_support, _emberViewsCompatAttrs, _emberViewsSystemLookup_partial, _emberViewsUtilsLookupComponent, _emberViewsSystemAction_manager, _emberViewsCompatFallbackViewRegistry) { /** - @module ember - @submodule ember-views + @method removeObserver + @for Ember + @param obj + @param {String} path + @param {Object|Function} target + @param {Function|String} [method] + @public */ - 'use strict'; + function removeObserver(obj, path, target, method) { + _emberMetalWatching.unwatch(obj, path); + _emberMetalEvents.removeListener(obj, changeEvent(path), target, method); + + return this; + } - exports.jQuery = _emberViewsSystemJquery.default; - exports.isSimpleClick = _emberViewsSystemUtils.isSimpleClick; - exports.getViewBounds = _emberViewsSystemUtils.getViewBounds; - exports.getViewClientRects = _emberViewsSystemUtils.getViewClientRects; - exports.getViewBoundingClientRect = _emberViewsSystemUtils.getViewBoundingClientRect; - exports.getRootViews = _emberViewsSystemUtils.getRootViews; - exports.getChildViews = _emberViewsSystemUtils.getChildViews; - exports.getViewId = _emberViewsSystemUtils.getViewId; - exports.getViewElement = _emberViewsSystemUtils.getViewElement; - exports.setViewElement = _emberViewsSystemUtils.setViewElement; - exports.STYLE_WARNING = _emberViewsSystemUtils.STYLE_WARNING; - exports.EventDispatcher = _emberViewsSystemEvent_dispatcher.default; - exports.ComponentLookup = _emberViewsComponent_lookup.default; - exports.TextSupport = _emberViewsMixinsText_support.default; - exports.CoreView = _emberViewsViewsCore_view.default; - exports.ClassNamesSupport = _emberViewsMixinsClass_names_support.default; - exports.ChildViewsSupport = _emberViewsMixinsChild_views_support.default; - exports.ViewStateSupport = _emberViewsMixinsView_state_support.default; - exports.ViewMixin = _emberViewsMixinsView_support.default; - exports.ActionSupport = _emberViewsMixinsAction_support.default; - exports.MUTABLE_CELL = _emberViewsCompatAttrs.MUTABLE_CELL; - exports.lookupPartial = _emberViewsSystemLookup_partial.default; - exports.hasPartial = _emberViewsSystemLookup_partial.hasPartial; - exports.lookupComponent = _emberViewsUtilsLookupComponent.default; - exports.ActionManager = _emberViewsSystemAction_manager.default; - exports.fallbackViewRegistry = _emberViewsCompatFallbackViewRegistry.default; -}); -// for the side effect of extending Ember.run.queues -enifed('ember-views/mixins/action_support', ['exports', 'ember-utils', 'ember-metal', 'ember-views/compat/attrs'], function (exports, _emberUtils, _emberMetal, _emberViewsCompatAttrs) { /** - @module ember - @submodule ember-views + @method _addBeforeObserver + @for Ember + @param obj + @param {String} path + @param {Object|Function} target + @param {Function|String} [method] + @deprecated + @private */ - 'use strict'; - function validateAction(component, actionName) { - if (actionName && actionName[_emberViewsCompatAttrs.MUTABLE_CELL]) { - actionName = actionName.value; - } + function _addBeforeObserver(obj, path, target, method) { + _emberMetalEvents.addListener(obj, beforeEvent(path), target, method); + _emberMetalWatching.watch(obj, path); - _emberMetal.assert('The default action was triggered on the component ' + component.toString() + ', but the action name (' + actionName + ') was not a string.', _emberMetal.isNone(actionName) || typeof actionName === 'string' || typeof actionName === 'function'); - return actionName; + return this; + } + + // Suspend observer during callback. + // + // This should only be used by the target of the observer + // while it is setting the observed path. + + function _suspendObserver(obj, path, target, method, callback) { + return _emberMetalEvents.suspendListener(obj, changeEvent(path), target, method, callback); + } + + function _suspendObservers(obj, paths, target, method, callback) { + var events = paths.map(changeEvent); + return _emberMetalEvents.suspendListeners(obj, events, target, method, callback); } /** - @class ActionSupport - @namespace Ember - @private + @method removeBeforeObserver + @for Ember + @param obj + @param {String} path + @param {Object|Function} target + @param {Function|String} [method] + @deprecated + @private */ - exports.default = _emberMetal.Mixin.create({ - /** - 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 - export default Ember.Component.extend({ - click() { - if (this.get('isPlaying')) { - this.sendAction('play'); - } else { - this.sendAction('stop'); - } - } - }); - ``` - The actions "play" and "stop" must be passed to this `play-button` component: - ```handlebars - {{! app/templates/application.hbs }} - {{play-button play=(action "musicStarted") stop=(action "musicStopped")}} - ``` - When the component receives a browser `click` event it translate this - interaction into application-specific semantics ("play" or "stop") and - calls the specified action. - ```javascript - // app/controller/application.js - export default Ember.Controller.extend({ - actions: { - musicStarted() { - // called when the play button is clicked - // and the music started playing - }, - musicStopped() { - // called when the play button is clicked - // and the music stopped playing - } - } - }); - ``` - If no action is passed to `sendAction` a default name of "action" - is assumed. - ```javascript - // app/components/next-button.js - export default Ember.Component.extend({ - click() { - this.sendAction(); - } - }); - ``` - ```handlebars - {{! app/templates/application.hbs }} - {{next-button action=(action "playNextSongInAlbum")}} - ``` - ```javascript - // app/controllers/application.js - App.ApplicationController = Ember.Controller.extend({ - actions: { - playNextSongInAlbum() { - ... - } - } - }); - ``` - @method sendAction - @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 = undefined; - // Send the default action - if (action === undefined) { - action = 'action'; - } - actionName = _emberMetal.get(this, 'attrs.' + action) || _emberMetal.get(this, action); - actionName = validateAction(this, actionName); + function _removeBeforeObserver(obj, path, target, method) { + _emberMetalWatching.unwatch(obj, path); + _emberMetalEvents.removeListener(obj, beforeEvent(path), target, method); - // If no action name for that action could be found, just abort. - if (actionName === undefined) { - return; - } + return this; + } +}); +enifed('ember-metal/observer_set', ['exports', 'ember-utils', 'ember-metal/events'], function (exports, _emberUtils, _emberMetalEvents) { + 'use strict'; - if (typeof actionName === 'function') { - actionName.apply(undefined, contexts); - } else { - this.triggerAction({ - action: actionName, - actionContext: contexts - }); + /* + this.observerSet = { + [senderGuid]: { // variable name: `keySet` + [keyName]: listIndex } }, + this.observers = [ + { + sender: obj, + keyName: keyName, + eventName: eventName, + listeners: [ + [target, method, flags] + ] + }, + ... + ] + */ - send: function (actionName) { - for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } + var ObserverSet = (function () { + function ObserverSet() { + babelHelpers.classCallCheck(this, ObserverSet); - var target = undefined; - var action = this.actions && this.actions[actionName]; + this.clear(); + } - if (action) { - var shouldBubble = action.apply(this, args) === true; - if (!shouldBubble) { - return; + ObserverSet.prototype.add = function add(sender, keyName, eventName) { + var observerSet = this.observerSet; + var observers = this.observers; + var senderGuid = _emberUtils.guidFor(sender); + var keySet = observerSet[senderGuid]; + var index = undefined; + + if (!keySet) { + observerSet[senderGuid] = keySet = {}; + } + index = keySet[keyName]; + if (index === undefined) { + index = observers.push({ + sender: sender, + keyName: keyName, + eventName: eventName, + listeners: [] + }) - 1; + keySet[keyName] = index; + } + return observers[index].listeners; + }; + + ObserverSet.prototype.flush = function flush() { + var observers = this.observers; + var i = undefined, + observer = undefined, + sender = undefined; + this.clear(); + for (i = 0; i < observers.length; ++i) { + observer = observers[i]; + sender = observer.sender; + if (sender.isDestroying || sender.isDestroyed) { + continue; } + _emberMetalEvents.sendEvent(sender, observer.eventName, [sender, observer.keyName], observer.listeners); } + }; - target = _emberMetal.get(this, 'target'); + ObserverSet.prototype.clear = function clear() { + this.observerSet = {}; + this.observers = []; + }; - if (target) { - var _target; + return ObserverSet; + })(); - _emberMetal.assert('The `target` for ' + this + ' (' + target + ') does not have a `send` method', typeof target.send === 'function'); - (_target = target).send.apply(_target, arguments); - } else { - _emberMetal.assert(_emberUtils.inspect(this) + ' had no action handler for: ' + actionName, action); - } - } - }); + exports.default = ObserverSet; }); -enifed('ember-views/mixins/child_views_support', ['exports', 'ember-utils', 'ember-metal', 'ember-views/system/utils'], function (exports, _emberUtils, _emberMetal, _emberViewsSystemUtils) { - /** - @module ember - @submodule ember-views - */ +enifed('ember-metal/path_cache', ['exports', 'ember-metal/cache'], function (exports, _emberMetalCache) { 'use strict'; - exports.default = _emberMetal.Mixin.create({ - init: function () { - this._super.apply(this, arguments); - _emberViewsSystemUtils.initChildViews(this); - }, + exports.isGlobal = isGlobal; + exports.isGlobalPath = isGlobalPath; + exports.hasThis = hasThis; + exports.isPath = isPath; + exports.getFirstKey = getFirstKey; + exports.getTailPath = getTailPath; - /** - Array of child views. You should never edit this array directly. - @property childViews - @type Array - @default [] - @private - */ - childViews: _emberMetal.descriptor({ - configurable: false, - enumerable: false, - get: function () { - return _emberViewsSystemUtils.getChildViews(this); - } - }), + var IS_GLOBAL = /^[A-Z$]/; + var IS_GLOBAL_PATH = /^[A-Z$].*[\.]/; + var HAS_THIS = 'this.'; + + var isGlobalCache = new _emberMetalCache.default(1000, function (key) { + return IS_GLOBAL.test(key); + }); + var isGlobalPathCache = new _emberMetalCache.default(1000, function (key) { + return IS_GLOBAL_PATH.test(key); + }); + var hasThisCache = new _emberMetalCache.default(1000, function (key) { + return key.lastIndexOf(HAS_THIS, 0) === 0; + }); + var firstDotIndexCache = new _emberMetalCache.default(1000, function (key) { + return key.indexOf('.'); + }); + + var firstKeyCache = new _emberMetalCache.default(1000, function (path) { + var index = firstDotIndexCache.get(path); + if (index === -1) { + return path; + } else { + return path.slice(0, index); + } + }); + + var tailPathCache = new _emberMetalCache.default(1000, function (path) { + var index = firstDotIndexCache.get(path); + if (index !== -1) { + return path.slice(index + 1); + } + }); + + var caches = { + isGlobalCache: isGlobalCache, + isGlobalPathCache: isGlobalPathCache, + hasThisCache: hasThisCache, + firstDotIndexCache: firstDotIndexCache, + firstKeyCache: firstKeyCache, + tailPathCache: tailPathCache + }; + + exports.caches = caches; + + function isGlobal(path) { + return isGlobalCache.get(path); + } - appendChild: function (view) { - this.linkChild(view); - _emberViewsSystemUtils.addChildView(this, view); - }, + function isGlobalPath(path) { + return isGlobalPathCache.get(path); + } - linkChild: function (instance) { - if (!_emberUtils.getOwner(instance)) { - _emberUtils.setOwner(instance, _emberUtils.getOwner(this)); - } - } - }); + function hasThis(path) { + return hasThisCache.get(path); + } + + function isPath(path) { + return firstDotIndexCache.get(path) !== -1; + } + + function getFirstKey(path) { + return firstKeyCache.get(path); + } + + function getTailPath(path) { + return tailPathCache.get(path); + } }); -enifed('ember-views/mixins/class_names_support', ['exports', 'ember-metal'], function (exports, _emberMetal) { +enifed('ember-metal/properties', ['exports', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/meta', 'ember-metal/property_events'], function (exports, _emberMetalDebug, _emberMetalFeatures, _emberMetalMeta, _emberMetalProperty_events) { /** - @module ember - @submodule ember-views + @module ember-metal */ 'use strict'; - var EMPTY_ARRAY = Object.freeze([]); + exports.Descriptor = Descriptor; + exports.MANDATORY_SETTER_FUNCTION = MANDATORY_SETTER_FUNCTION; + exports.DEFAULT_GETTER_FUNCTION = DEFAULT_GETTER_FUNCTION; + exports.INHERITING_GETTER_FUNCTION = INHERITING_GETTER_FUNCTION; + exports.defineProperty = defineProperty; + + // .......................................................... + // DESCRIPTOR + // /** - @class ClassNamesSupport - @namespace Ember + Objects of this type can implement an interface to respond to requests to + get and set. The default implementation handles simple properties. + + @class Descriptor @private */ - exports.default = _emberMetal.Mixin.create({ - concatenatedProperties: ['classNames', 'classNameBindings'], - init: function () { - this._super.apply(this, arguments); + function Descriptor() { + this.isDescriptor = true; + } - _emberMetal.assert('Only arrays are allowed for \'classNameBindings\'', Array.isArray(this.classNameBindings)); - this.classNameBindings = this.classNameBindings.slice(); + var REDEFINE_SUPPORTED = (function () { + // https://github.com/spalger/kibana/commit/b7e35e6737df585585332857a4c397dc206e7ff9 + var a = Object.create(Object.prototype, { + prop: { + configurable: true, + value: 1 + } + }); - _emberMetal.assert('Only arrays of static class strings are allowed for \'classNames\'. For dynamic classes, use \'classNameBindings\'.', Array.isArray(this.classNames)); - this.classNames = this.classNames.slice(); - }, + Object.defineProperty(a, 'prop', { + configurable: true, + value: 2 + }); - /** - Standard CSS class names to apply to the view's outer element. This - property automatically inherits any class names defined by the view's - superclasses as well. - @property classNames - @type Array - @default ['ember-view'] - @public - */ - classNames: EMPTY_ARRAY, + return a.prop === 2; + })(); + // .......................................................... + // DEFINING PROPERTIES API + // - /** - A list of properties of the view to apply as class names. If the property - is a string value, the value of that string will be applied as a class - name. - ```javascript - // Applies the 'high' class to the view element - Ember.Component.extend({ - classNameBindings: ['priority'], - priority: 'high' - }); - ``` - If the value of the property is a Boolean, the name of that property is - added as a dasherized class name. - ```javascript - // Applies the 'is-urgent' class to the view element - Ember.Component.extend({ - classNameBindings: ['isUrgent'], - isUrgent: true - }); - ``` - If you would prefer to use a custom value instead of the dasherized - property name, you can pass a binding like this: - ```javascript - // Applies the 'urgent' class to the view element - Ember.Component.extend({ - classNameBindings: ['isUrgent:urgent'], - isUrgent: true - }); - ``` - This list of properties is inherited from the component's superclasses as well. - @property classNameBindings - @type Array - @default [] - @public - */ - classNameBindings: EMPTY_ARRAY - }); -}); -enifed('ember-views/mixins/text_support', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { - /** - @module ember - @submodule ember-views - */ + function MANDATORY_SETTER_FUNCTION(name) { + function SETTER_FUNCTION(value) { + var m = _emberMetalMeta.peekMeta(this); + if (!m.isInitialized(this)) { + m.writeValues(name, value); + } else { + _emberMetalDebug.assert('You must use Ember.set() to set the `' + name + '` property (of ' + this + ') to `' + value + '`.', false); + } + } - 'use strict'; + SETTER_FUNCTION.isMandatorySetter = true; + return SETTER_FUNCTION; + } - var KEY_EVENTS = { - 13: 'insertNewline', - 27: 'cancel' - }; + function DEFAULT_GETTER_FUNCTION(name) { + return function GETTER_FUNCTION() { + var meta = _emberMetalMeta.peekMeta(this); + return meta && meta.peekValues(name); + }; + } + + function INHERITING_GETTER_FUNCTION(name) { + function IGETTER_FUNCTION() { + var meta = _emberMetalMeta.peekMeta(this); + var val = meta && meta.readInheritedValue('values', name); + + if (val === _emberMetalMeta.UNDEFINED) { + var proto = Object.getPrototypeOf(this); + return proto && proto[name]; + } else { + return val; + } + } + + IGETTER_FUNCTION.isInheritingGetter = true; + return IGETTER_FUNCTION; + } /** - `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 - value of the field passed in as the only argument unless the value of - the field is empty. In that case, the instance of the field itself is passed - in as the only argument. + NOTE: This is a low-level method used by other parts of the API. You almost + never want to call this method directly. Instead you should use + `Ember.mixin()` to define new properties. - Let's use the pressing of the escape key as an example. If you wanted to - invoke a controller action when a user presses the escape key while on your - field, you would use the `escape-press` attribute on your field like so: + Defines a property on an object. This method works much like the ES5 + `Object.defineProperty()` method except that it can also accept computed + properties and other special descriptors. - ```handlebars - {{! application.hbs}} + Normally this method takes only three parameters. However if you pass an + instance of `Descriptor` as the third param then you can pass an + optional value as the fourth parameter. This is often more efficient than + creating new descriptor hashes for each property. - {{input escape-press='alertUser'}} - ``` + ## Examples ```javascript - App = Ember.Application.create(); - - App.ApplicationController = Ember.Controller.extend({ - actions: { - alertUser: function ( currentValue ) { - alert( 'escape pressed, current value: ' + currentValue ); - } - } - }); - ``` - - The following chart is a visual representation of what takes place when the - escape key is pressed in this scenario: - - ``` - The Template - +---------------------------+ - | | - | escape-press='alertUser' | - | | TextSupport Mixin - +----+----------------------+ +-------------------------------+ - | | cancel method | - | escape button pressed | | - +-------------------------------> | checks for the `escape-press` | - | attribute and pulls out the | - +-------------------------------+ | `alertUser` value | - | action name 'alertUser' +-------------------------------+ - | sent to controller - v - Controller - +------------------------------------------ + - | | - | actions: { | - | alertUser: function( currentValue ){ | - | alert( 'the esc key was pressed!' ) | - | } | - | } | - | | - +-------------------------------------------+ - ``` - - Here are the events that we currently support along with the name of the - attribute you would need to use on your field. To reiterate, you would use the - attribute name like so: + // ES5 compatible mode + Ember.defineProperty(contact, 'firstName', { + writable: true, + configurable: false, + enumerable: true, + value: 'Charles' + }); - ```handlebars - {{input attribute-name='controllerAction'}} - ``` + // define a simple property + Ember.defineProperty(contact, 'lastName', undefined, 'Jolley'); - ``` - +--------------------+----------------+ - | | | - | event | attribute name | - +--------------------+----------------+ - | new line inserted | insert-newline | - | | | - | enter key pressed | insert-newline | - | | | - | cancel key pressed | escape-press | - | | | - | focusin | focus-in | - | | | - | focusout | focus-out | - | | | - | keypress | key-press | - | | | - | keyup | key-up | - | | | - | keydown | key-down | - +--------------------+----------------+ + // define a computed property + Ember.defineProperty(contact, 'fullName', Ember.computed('firstName', 'lastName', function() { + return this.firstName+' '+this.lastName; + })); ``` - @class TextSupport - @namespace Ember - @uses Ember.TargetActionSupport - @extends Ember.Mixin @private + @method defineProperty + @for Ember + @param {Object} obj the object to define this property on. This may be a prototype. + @param {String} keyName the name of the property + @param {Descriptor} [desc] an instance of `Descriptor` (typically a + computed property) or an ES5 descriptor. + You must provide this or `data` but not both. + @param {*} [data] something other than a descriptor, that will + become the explicit value of this property. */ - exports.default = _emberMetal.Mixin.create(_emberRuntime.TargetActionSupport, { - value: '', - - attributeBindings: ['autocapitalize', 'autocorrect', 'autofocus', 'disabled', 'form', 'maxlength', 'placeholder', 'readonly', 'required', 'selectionDirection', 'spellcheck', 'tabindex', 'title'], - placeholder: null, - disabled: false, - maxlength: null, - - init: function () { - this._super.apply(this, arguments); - this.on('paste', this, this._elementValueDidChange); - this.on('cut', this, this._elementValueDidChange); - this.on('input', this, this._elementValueDidChange); - }, - /** - The action to be sent when the user presses the return key. - This is similar to the `{{action}}` helper, but is fired when - the user presses the return key when editing a text field, and sends - the value of the field as the context. - @property action - @type String - @default null - @private - */ - action: null, + function defineProperty(obj, keyName, desc, data, meta) { + var possibleDesc = undefined, + existingDesc = undefined, + watching = undefined, + value = undefined; - /** - The event that should send the action. - Options are: - * `enter`: the user pressed enter - * `keyPress`: the user pressed a key - @property onEvent - @type String - @default enter - @private - */ - onEvent: 'enter', + if (!meta) { + meta = _emberMetalMeta.meta(obj); + } + var watchEntry = meta.peekWatching(keyName); + possibleDesc = obj[keyName]; + existingDesc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - /** - Whether the `keyUp` event that triggers an `action` to be sent continues - propagating to other views. - By default, when the user presses the return key on their keyboard and - the text field has an `action` set, the action will be sent to the view's - controller and the key event will stop propagating. - If you would like parent views to receive the `keyUp` event even after an - action has been dispatched, set `bubbles` to true. - @property bubbles - @type Boolean - @default false - @private - */ - bubbles: false, + watching = watchEntry !== undefined && watchEntry > 0; - interpretKeyEvents: function (event) { - var map = KEY_EVENTS; - var method = map[event.keyCode]; + if (existingDesc) { + existingDesc.teardown(obj, keyName); + } - this._elementValueDidChange(); - if (method) { - return this[method](event); + if (desc instanceof Descriptor) { + value = desc; + if (true) { + if (watching) { + Object.defineProperty(obj, keyName, { + configurable: true, + enumerable: true, + writable: true, + value: value + }); + } else { + obj[keyName] = value; + } + } else { + obj[keyName] = value; } - }, - - _elementValueDidChange: function () { - _emberMetal.set(this, 'value', this.element.value); - }, - - change: function (event) { - this._elementValueDidChange(event); - }, - - /** - Allows you to specify a controller action to invoke when either the `enter` - key is pressed or, in the case of the field being a textarea, when a newline - is inserted. To use this method, give your field an `insert-newline` - attribute. The value of that attribute should be the name of the action - in your controller that you wish to invoke. - For an example on how to use the `insert-newline` attribute, please - reference the example near the top of this file. - @method insertNewline - @param {Event} event - @private - */ - insertNewline: function (event) { - sendAction('enter', this, event); - sendAction('insert-newline', this, event); - }, - - /** - Allows you to specify a controller action to invoke when the escape button - is pressed. To use this method, give your field an `escape-press` - attribute. The value of that attribute should be the name of the action - in your controller that you wish to invoke. - For an example on how to use the `escape-press` attribute, please reference - the example near the top of this file. - @method cancel - @param {Event} event - @private - */ - cancel: function (event) { - sendAction('escape-press', this, event); - }, - - /** - Allows you to specify a controller action to invoke when a field receives - focus. To use this method, give your field a `focus-in` attribute. The value - of that attribute should be the name of the action in your controller - that you wish to invoke. - For an example on how to use the `focus-in` attribute, please reference the - example near the top of this file. - @method focusIn - @param {Event} event - @private - */ - focusIn: function (event) { - sendAction('focus-in', this, event); - }, - - /** - Allows you to specify a controller action to invoke when a field loses - focus. To use this method, give your field a `focus-out` attribute. The value - of that attribute should be the name of the action in your controller - that you wish to invoke. - For an example on how to use the `focus-out` attribute, please reference the - example near the top of this file. - @method focusOut - @param {Event} event - @private - */ - focusOut: function (event) { - this._elementValueDidChange(event); - sendAction('focus-out', this, event); - }, - - /** - Allows you to specify a controller action to invoke when a key is pressed. - To use this method, give your field a `key-press` attribute. The value of - that attribute should be the name of the action in your controller you - that wish to invoke. - For an example on how to use the `key-press` attribute, please reference the - example near the top of this file. - @method keyPress - @param {Event} event - @private - */ - keyPress: function (event) { - sendAction('key-press', this, event); - }, + if (desc.setup) { + desc.setup(obj, keyName); + } + } else { + if (desc == null) { + value = data; - /** - Allows you to specify a controller action to invoke when a key-up event is - fired. To use this method, give your field a `key-up` attribute. The value - of that attribute should be the name of the action in your controller - that you wish to invoke. - For an example on how to use the `key-up` attribute, please reference the - example near the top of this file. - @method keyUp - @param {Event} event - @private - */ - keyUp: function (event) { - this.interpretKeyEvents(event); + if (true) { + if (watching) { + meta.writeValues(keyName, data); - this.sendAction('key-up', _emberMetal.get(this, 'value'), event); - }, + var defaultDescriptor = { + configurable: true, + enumerable: true, + set: MANDATORY_SETTER_FUNCTION(keyName), + get: DEFAULT_GETTER_FUNCTION(keyName) + }; - /** - Allows you to specify a controller action to invoke when a key-down event is - fired. To use this method, give your field a `key-down` attribute. The value - of that attribute should be the name of the action in your controller that - you wish to invoke. - For an example on how to use the `key-down` attribute, please reference the - example near the top of this file. - @method keyDown - @param {Event} event - @private - */ - keyDown: function (event) { - this.sendAction('key-down', _emberMetal.get(this, 'value'), event); + 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); + } } - }); - // In principle, this shouldn't be necessary, but the legacy - // sendAction semantics for TextField are different from - // the component semantics so this method normalizes them. - function sendAction(eventName, view, event) { - var action = _emberMetal.get(view, 'attrs.' + eventName) || _emberMetal.get(view, eventName); - var on = _emberMetal.get(view, 'onEvent'); - var value = _emberMetal.get(view, 'value'); + // if key is being watched, override chains that + // were initialized with the prototype + if (watching) { + _emberMetalProperty_events.overrideChains(obj, keyName, meta); + } - // back-compat support for keyPress as an event name even though - // it's also a method name that consumes the event (and therefore - // incompatible with sendAction semantics). - if (on === eventName || on === 'keyPress' && eventName === 'key-press') { - view.sendAction('action', value); + // The `value` passed to the `didDefineProperty` hook is + // either the descriptor or data, whichever was passed. + if (obj.didDefineProperty) { + obj.didDefineProperty(obj, keyName, value); } - view.sendAction(eventName, value); + return this; + } - if (action || on === eventName) { - if (!_emberMetal.get(view, 'bubbles')) { - event.stopPropagation(); - } - } + function handleBrokenPhantomDefineProperty(obj, keyName, desc) { + // https://github.com/ariya/phantomjs/issues/11856 + Object.defineProperty(obj, keyName, { configurable: true, writable: true, value: 'iCry' }); + Object.defineProperty(obj, keyName, desc); } }); -enifed('ember-views/mixins/view_state_support', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-views - */ +enifed('ember-metal/property_events', ['exports', 'ember-utils', 'ember-metal/meta', 'ember-metal/events', 'ember-metal/tags', 'ember-metal/observer_set', 'ember-metal/features', 'ember-metal/transaction'], function (exports, _emberUtils, _emberMetalMeta, _emberMetalEvents, _emberMetalTags, _emberMetalObserver_set, _emberMetalFeatures, _emberMetalTransaction) { 'use strict'; - exports.default = _emberMetal.Mixin.create({ - _transitionTo: function (state) { - var priorState = this._currentState; - var currentState = this._currentState = this._states[state]; - this._state = state; - - if (priorState && priorState.exit) { - priorState.exit(this); - } - if (currentState.enter) { - currentState.enter(this); - } - } - }); -}); -enifed('ember-views/mixins/view_support', ['exports', 'ember-utils', 'ember-metal', 'ember-environment', 'ember-views/system/utils', 'ember-runtime/system/core_object', 'ember-views/system/jquery'], function (exports, _emberUtils, _emberMetal, _emberEnvironment, _emberViewsSystemUtils, _emberRuntimeSystemCore_object, _emberViewsSystemJquery) { - 'use strict'; + var PROPERTY_DID_CHANGE = _emberUtils.symbol('PROPERTY_DID_CHANGE'); - var _Mixin$create; + exports.PROPERTY_DID_CHANGE = PROPERTY_DID_CHANGE; + var beforeObserverSet = new _emberMetalObserver_set.default(); + var observerSet = new _emberMetalObserver_set.default(); + var deferred = 0; - function K() { - return this; - } + // .......................................................... + // PROPERTY CHANGES + // /** - @class ViewMixin - @namespace Ember - @private + This function is called just before an object property is about to change. + It will notify any before observers and prepare caches among other things. + + Normally you will not need to call this method directly but if for some + reason you can't directly watch a property you can invoke this method + manually along with `Ember.propertyDidChange()` which you should call just + after the property value changes. + + @method propertyWillChange + @for Ember + @param {Object} obj The object with the property that will change + @param {String} keyName The property key (or path) that will change. + @return {void} + @private */ - exports.default = _emberMetal.Mixin.create((_Mixin$create = { - concatenatedProperties: ['attributeBindings'] - }, _Mixin$create[_emberRuntimeSystemCore_object.POST_INIT] = function () { - this.trigger('didInitAttrs', { attrs: this.attrs }); - this.trigger('didReceiveAttrs', { newAttrs: this.attrs }); - }, _Mixin$create.nearestOfType = function (klass) { - var view = this.parentView; - var isOfType = klass instanceof _emberMetal.Mixin ? function (view) { - return klass.detect(view); - } : function (view) { - return klass.detect(view.constructor); - }; - - while (view) { - if (isOfType(view)) { - return view; - } - view = view.parentView; - } - }, _Mixin$create.nearestWithProperty = function (property) { - var view = this.parentView; + function propertyWillChange(obj, keyName, _meta) { + var meta = _meta || _emberMetalMeta.peekMeta(obj); - while (view) { - if (property in view) { - return view; - } - view = view.parentView; - } - }, _Mixin$create.rerender = function () { - return this._currentState.rerender(this); - }, _Mixin$create.element = _emberMetal.descriptor({ - configurable: false, - enumerable: false, - get: function () { - return this.renderer.getElement(this); - } - }), _Mixin$create.$ = function (sel) { - _emberMetal.assert('You cannot access this.$() on a component with `tagName: \'\'` specified.', this.tagName !== ''); - if (this.element) { - return sel ? _emberViewsSystemJquery.default(sel, this.element) : _emberViewsSystemJquery.default(this.element); + if (meta && !meta.isInitialized(obj)) { + return; } - }, _Mixin$create.appendTo = function (selector) { - var env = this._environment || _emberEnvironment.environment; - var target = undefined; - - if (env.hasDOM) { - target = typeof selector === 'string' ? document.querySelector(selector) : selector; - _emberMetal.assert('You tried to append to (' + selector + ') but that isn\'t in the DOM', target); - _emberMetal.assert('You cannot append to an existing Ember.View.', !_emberViewsSystemUtils.matches(target, '.ember-view')); - _emberMetal.assert('You cannot append to an existing Ember.View.', (function () { - var node = target.parentNode; - while (node) { - if (node.nodeType !== 9 && _emberViewsSystemUtils.matches(node, '.ember-view')) { - return false; - } - - node = node.parentNode; - } - - return true; - })()); - } else { - target = selector; + var watching = meta && meta.peekWatching(keyName) > 0; + var possibleDesc = obj[keyName]; + var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - _emberMetal.assert('You tried to append to a selector string (' + selector + ') in an environment without jQuery', typeof target !== 'string'); - _emberMetal.assert('You tried to append to a non-Element (' + selector + ') in an environment without jQuery', typeof selector.appendChild === 'function'); + if (desc && desc.willChange) { + desc.willChange(obj, keyName); } - this.renderer.appendTo(this, target); - - return this; - }, _Mixin$create.renderToElement = function (tagName) { - tagName = tagName || 'body'; - - var element = this.renderer.createElement(tagName); - - this.renderer.appendTo(this, element); - return element; - }, _Mixin$create.replaceIn = function (selector) { - var target = _emberViewsSystemJquery.default(selector); + if (watching) { + dependentKeysWillChange(obj, keyName, meta); + chainsWillChange(obj, keyName, meta); + notifyBeforeObservers(obj, keyName, meta); + } + } - _emberMetal.assert('You tried to replace in (' + selector + ') but that isn\'t in the DOM', target.length > 0); - _emberMetal.assert('You cannot replace an existing Ember.View.', !target.is('.ember-view') && !target.parents().is('.ember-view')); + /** + This function is called just after an object property has changed. + It will notify any observers and clear caches among other things. + + Normally you will not need to call this method directly but if for some + reason you can't directly watch a property you can invoke this method + manually along with `Ember.propertyWillChange()` which you should call just + before the property value changes. + + @method propertyDidChange + @for Ember + @param {Object} obj The object with the property that will change + @param {String} keyName The property key (or path) that will change. + @param {Meta} meta The objects meta. + @return {void} + @private + */ + function propertyDidChange(obj, keyName, _meta) { + var meta = _meta || _emberMetalMeta.peekMeta(obj); - this.renderer.replaceIn(this, target[0]); + if (meta && !meta.isInitialized(obj)) { + return; + } - return this; - }, _Mixin$create.append = function () { - return this.appendTo(document.body); - }, _Mixin$create.elementId = null, _Mixin$create.findElementInParentElement = function (parentElem) { - var id = '#' + this.elementId; - return _emberViewsSystemJquery.default(id)[0] || _emberViewsSystemJquery.default(id, parentElem)[0]; - }, _Mixin$create.willInsertElement = K, _Mixin$create.didInsertElement = K, _Mixin$create.willClearRender = K, _Mixin$create.destroy = function () { - this._super.apply(this, arguments); - this._currentState.destroy(this); - }, _Mixin$create.willDestroyElement = K, _Mixin$create.parentViewDidChange = K, _Mixin$create.tagName = null, _Mixin$create.init = function () { - this._super.apply(this, arguments); + var watching = meta && meta.peekWatching(keyName) > 0; + var possibleDesc = obj[keyName]; + var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - if (!this.elementId && this.tagName !== '') { - this.elementId = _emberUtils.guidFor(this); + // shouldn't this mean that we're watching this key? + if (desc && desc.didChange) { + desc.didChange(obj, keyName); } - _emberMetal.deprecate('[DEPRECATED] didInitAttrs called in ' + this.toString() + '.', typeof this.didInitAttrs !== 'function', { - id: 'ember-views.did-init-attrs', - until: '3.0.0', - url: 'http://emberjs.com/deprecations/v2.x#toc_ember-component-didinitattrs' - }); + if (watching) { + if (meta.hasDeps(keyName)) { + dependentKeysDidChange(obj, keyName, meta); + } - _emberMetal.assert('Using a custom `.render` function is no longer supported.', !this.render); - }, _Mixin$create.__defineNonEnumerable = function (property) { - this[property.name] = property.descriptor.value; - }, _Mixin$create.handleEvent = function (eventName, evt) { - return this._currentState.handleEvent(this, eventName, evt); - }, _Mixin$create)); -}); + chainsDidChange(obj, keyName, meta, false); + notifyObservers(obj, keyName, meta); + } -// .......................................................... -// TEMPLATE SUPPORT -// + if (obj[PROPERTY_DID_CHANGE]) { + obj[PROPERTY_DID_CHANGE](keyName); + } -/** - Return the nearest ancestor that is an instance of the provided - class or mixin. - @method nearestOfType - @param {Class,Mixin} klass Subclass of Ember.View (or Ember.View itself), - or an instance of Ember.Mixin. - @return Ember.View - @deprecated use `yield` and contextual components for composition instead. - @private -*/ + if (meta && meta.isSourceDestroying()) { + return; + } -/** - Return the nearest ancestor that has a given property. - @method nearestWithProperty - @param {String} property A property name - @return Ember.View - @deprecated use `yield` and contextual components for composition instead. - @private -*/ + _emberMetalTags.markObjectAsDirty(meta, keyName); -/** - Renders the view again. This will work regardless of whether the - view is already in the DOM or not. If the view is in the DOM, the - rendering process will be deferred to give bindings a chance - to synchronize. - If children were added during the rendering process using `appendChild`, - `rerender` will remove them, because they will be added again - if needed by the next `render`. - In general, if the display of your view changes, you should modify - the DOM element directly instead of manually calling `rerender`, which can - be slow. - @method rerender - @public -*/ + if (true || true) { + _emberMetalTransaction.assertNotRendered(obj, keyName, meta); + } + } -// .......................................................... -// ELEMENT SUPPORT -// + var WILL_SEEN = undefined, + DID_SEEN = undefined; + // called whenever a property is about to change to clear the cache of any dependent keys (and notify those properties of changes, etc...) + function dependentKeysWillChange(obj, depKey, meta) { + if (meta && meta.isSourceDestroying()) { + return; + } -/** - Returns the current DOM element for the view. - @property element - @type DOMElement - @public -*/ + if (meta && meta.hasDeps(depKey)) { + var seen = WILL_SEEN; + var _top = !seen; -/** - Returns a jQuery object for this view's element. If you pass in a selector - string, this method will return a jQuery object, using the current element - as its buffer. - For example, calling `view.$('li')` will return a jQuery object containing - all of the `li` elements inside the DOM element of this view. - @method $ - @param {String} [selector] a jQuery-compatible selector string - @return {jQuery} the jQuery object for the DOM node - @public -*/ + if (_top) { + seen = WILL_SEEN = {}; + } -/** - Appends the view's element to the specified parent element. - Note that this method just schedules the view to be appended; the DOM - element will not be appended to the given element until all bindings have - finished synchronizing. - This is not typically a function that you will need to call directly when - building your application. If you do need to use `appendTo`, be sure that - the target element you are providing is associated with an `Ember.Application` - and does not have an ancestor element that is associated with an Ember view. - @method appendTo - @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object - @return {Ember.View} receiver - @private -*/ + iterDeps(propertyWillChange, obj, depKey, seen, meta); -/** - 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 - let element = view.renderToElement(); - element.tagName; // => "BODY" - ``` - You can override the kind of element rendered into and returned by - specifying an optional tag name as the first argument. - ```js - let element = view.renderToElement('table'); - element.tagName; // => "TABLE" - ``` - This method is useful if you want to render the view into an element that - is not in the document's body. Instead, a new `body` element, detached from - the DOM is returned. FastBoot uses this to serialize the rendered view into - a string for transmission over the network. - ```js - app.visit('/').then(function(instance) { - let element; - Ember.run(function() { - element = renderToElement(instance); - }); - res.send(serialize(element)); - }); - ``` - @method renderToElement - @param {String} tagName The tag of the element to create and render into. Defaults to "body". - @return {HTMLBodyElement} element - @private -*/ + if (_top) { + WILL_SEEN = null; + } + } + } -/** - Replaces the content of the specified parent element with this view's - element. If the view does not have an HTML representation yet, - the element will be generated automatically. - Note that this method just schedules the view to be appended; the DOM - element will not be appended to the given element until all bindings have - finished synchronizing - @method replaceIn - @param {String|DOMElement|jQuery} target A selector, element, HTML string, or jQuery object - @return {Ember.View} received - @private -*/ + // called whenever a property has just changed to update dependent keys + function dependentKeysDidChange(obj, depKey, meta) { + if (meta && meta.isSourceDestroying()) { + return; + } -/** - Appends the view's element to the document body. If the view does - not have an HTML representation yet - the element will be generated automatically. - If your application uses the `rootElement` property, you must append - the view within that element. Rendering views outside of the `rootElement` - is not supported. - Note that this method just schedules the view to be appended; the DOM - element will not be appended to the document body until all bindings have - finished synchronizing. - @method append - @return {Ember.View} receiver - @private -*/ + if (meta && meta.hasDeps(depKey)) { + var seen = DID_SEEN; + var _top2 = !seen; -/** - The HTML `id` of the view's element in the DOM. You can provide this - value yourself but it must be unique (just as in HTML): - ```handlebars - {{my-component elementId="a-really-cool-id"}} - ``` - If not manually set a default value will be provided by the framework. - Once rendered an element's `elementId` is considered immutable and you - should never change it. If you need to compute a dynamic value for the - `elementId`, you should do this when the component or element is being - instantiated: - ```javascript - export default Ember.Component.extend({ - init() { - this._super(...arguments); - let index = this.get('index'); - this.set('elementId', 'component-id' + index); + if (_top2) { + seen = DID_SEEN = {}; } - }); - ``` - @property elementId - @type String - @public -*/ -/** - Attempts to discover the element in the parent element. The default - implementation looks for an element with an ID of `elementId` (or the - view's guid if `elementId` is null). You can override this method to - provide your own form of lookup. For example, if you want to discover your - element using a CSS class name instead of an ID. - @method findElementInParentElement - @param {DOMElement} parentElement The parent's DOM element - @return {DOMElement} The discovered element - @private -*/ + iterDeps(propertyDidChange, obj, depKey, seen, meta); -/** - Called when a view is going to insert an element into the DOM. - @event willInsertElement - @public -*/ + if (_top2) { + DID_SEEN = null; + } + } + } -/** - Called when the element of the view has been inserted into the DOM. - Override this function to do any set up that requires an element - in the document body. - When a view has children, didInsertElement will be called on the - child view(s) first and on itself afterwards. - @event didInsertElement - @public -*/ + function iterDeps(method, obj, depKey, seen, meta) { + var possibleDesc = undefined, + desc = undefined; + var guid = _emberUtils.guidFor(obj); + var current = seen[guid]; -/** - Called when the view is about to rerender, but before anything has - been torn down. This is a good opportunity to tear down any manual - observers you have installed based on the DOM state - @event willClearRender - @public -*/ + if (!current) { + current = seen[guid] = {}; + } -/** - You must call `destroy` on a view to destroy the view (and all of its - child views). This will remove the view from any parent node, then make - sure that the DOM element managed by the view can be released by the - memory manager. - @method destroy - @private -*/ + if (current[depKey]) { + return; + } -/** - Called when the element of the view is going to be destroyed. Override - this function to do any teardown that requires an element, like removing - event listeners. - Please note: any property changes made during this event will have no - effect on object observers. - @event willDestroyElement - @public -*/ + current[depKey] = true; -/** - Called when the parentView property has changed. - @event parentViewDidChange - @private -*/ + meta.forEachInDeps(depKey, function (key, value) { + if (!value) { + return; + } -// .......................................................... -// STANDARD RENDER PROPERTIES -// + possibleDesc = obj[key]; + desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; -/** - Tag name for the view's outer element. The tag name is only used when an - element is first created. If you change the `tagName` for an element, you - must destroy and recreate the view element. - By default, the render buffer will use a `
    ` tag for views. - @property tagName - @type String - @default null - @public -*/ + if (desc && desc._suspended === obj) { + return; + } -// We leave this null by default so we can tell the difference between -// the default case and a user-specified tag. + method(obj, key, meta); + }); + } -// ....................................................... -// CORE DISPLAY METHODS -// + function chainsWillChange(obj, keyName, meta) { + var chainWatchers = meta.readableChainWatchers(); + if (chainWatchers) { + chainWatchers.notify(keyName, false, propertyWillChange); + } + } -/** - Setup a view, but do not finish waking it up. - * configure `childViews` - * register the view with the global views hash, which is used for event - dispatch - @method init - @private -*/ + function chainsDidChange(obj, keyName, meta) { + var chainWatchers = meta.readableChainWatchers(); + if (chainWatchers) { + chainWatchers.notify(keyName, true, propertyDidChange); + } + } -// ....................................................... -// EVENT HANDLING -// + function overrideChains(obj, keyName, meta) { + var chainWatchers = meta.readableChainWatchers(); + if (chainWatchers) { + chainWatchers.revalidate(keyName); + } + } -/** - Handle events from `Ember.EventDispatcher` - @method handleEvent - @param eventName {String} - @param evt {Event} - @private -*/ -enifed("ember-views/system/action_manager", ["exports"], function (exports) { /** - @module ember - @submodule ember-views + @method beginPropertyChanges + @chainable + @private */ + function beginPropertyChanges() { + deferred++; + } - "use strict"; - - exports.default = ActionManager; - - function ActionManager() {} + /** + @method endPropertyChanges + @private + */ + function endPropertyChanges() { + deferred--; + if (deferred <= 0) { + beforeObserverSet.clear(); + observerSet.flush(); + } + } /** - Global action id hash. + Make a series of property changes together in an + exception-safe way. + + ```javascript + Ember.changeProperties(function() { + obj1.set('foo', mayBlowUpWhenSet); + obj2.set('bar', baz); + }); + ``` + @method changeProperties + @param {Function} callback + @param [binding] @private - @property registeredActions - @type Object */ - ActionManager.registeredActions = {}; + function changeProperties(callback, binding) { + beginPropertyChanges(); + try { + callback.call(binding); + } finally { + endPropertyChanges.call(binding); + } + } + + function notifyBeforeObservers(obj, keyName, meta) { + if (meta && meta.isSourceDestroying()) { + return; + } + + var eventName = keyName + ':before'; + var listeners = undefined, + added = undefined; + if (deferred) { + listeners = beforeObserverSet.add(obj, keyName, eventName); + added = _emberMetalEvents.accumulateListeners(obj, eventName, listeners); + _emberMetalEvents.sendEvent(obj, eventName, [obj, keyName], added); + } else { + _emberMetalEvents.sendEvent(obj, eventName, [obj, keyName]); + } + } + + function notifyObservers(obj, keyName, meta) { + if (meta && meta.isSourceDestroying()) { + return; + } + + var eventName = keyName + ':change'; + var listeners = undefined; + if (deferred) { + listeners = observerSet.add(obj, keyName, eventName); + _emberMetalEvents.accumulateListeners(obj, eventName, listeners); + } else { + _emberMetalEvents.sendEvent(obj, eventName, [obj, keyName]); + } + } + + exports.propertyWillChange = propertyWillChange; + exports.propertyDidChange = propertyDidChange; + exports.overrideChains = overrideChains; + exports.beginPropertyChanges = beginPropertyChanges; + exports.endPropertyChanges = endPropertyChanges; + exports.changeProperties = changeProperties; }); -enifed('ember-views/system/event_dispatcher', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-views/system/jquery', 'ember-views/system/action_manager', 'ember-environment', 'ember-views/compat/fallback-view-registry'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberViewsSystemJquery, _emberViewsSystemAction_manager, _emberEnvironment, _emberViewsCompatFallbackViewRegistry) { +enifed('ember-metal/property_get', ['exports', 'ember-metal/debug', 'ember-metal/path_cache'], function (exports, _emberMetalDebug, _emberMetalPath_cache) { /** - @module ember - @submodule ember-views + @module ember-metal */ 'use strict'; - var ROOT_ELEMENT_CLASS = 'ember-application'; - var ROOT_ELEMENT_SELECTOR = '.' + ROOT_ELEMENT_CLASS; + exports.get = get; + exports._getPath = _getPath; + exports.getWithDefault = getWithDefault; + + var ALLOWABLE_TYPES = { + object: true, + function: true, + string: true + }; + + // .......................................................... + // 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 + // object. /** - `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 - called. + Gets the value of a property on an object. If the property is computed, + the function will be invoked. If the property is not defined but the + object implements the `unknownProperty` method then that will be invoked. - @class EventDispatcher - @namespace Ember - @private - @extends Ember.Object + ```javascript + Ember.get(obj, "name"); + ``` + + If you plan to run on IE8 and older browsers then you should use this + method anytime you want to retrieve a property on an object that you don't + know for sure is private. (Properties beginning with an underscore '_' + are considered private.) + + On all newer browsers, you only need to use this method to retrieve + properties if the property might not be defined on the object and you want + to respect the `unknownProperty` handler. Otherwise you can ignore this + method. + + Note that if the object itself is `undefined`, this method will throw + an error. + + @method get + @for Ember + @param {Object} obj The object to retrieve from. + @param {String} keyName The property key to retrieve + @return {Object} the property value or `null`. + @public */ - exports.default = _emberRuntime.Object.extend({ - - /** - The set of events names (and associated handler function names) to be setup - and dispatched by the `EventDispatcher`. Modifications to this list can be done - at setup time, generally via the `Ember.Application.customEvents` hash. - To add new events to be listened to: - ```javascript - let App = Ember.Application.create({ - customEvents: { - paste: 'paste' - } - }); - ``` - To prevent default events from being listened to: - ```javascript - let App = Ember.Application.create({ - customEvents: { - mouseenter: null, - mouseleave: null - } - }); - ``` - @property events - @type Object - @private - */ - events: { - touchstart: 'touchStart', - touchmove: 'touchMove', - touchend: 'touchEnd', - touchcancel: 'touchCancel', - keydown: 'keyDown', - keyup: 'keyUp', - keypress: 'keyPress', - mousedown: 'mouseDown', - mouseup: 'mouseUp', - contextmenu: 'contextMenu', - click: 'click', - dblclick: 'doubleClick', - mousemove: 'mouseMove', - focusin: 'focusIn', - focusout: 'focusOut', - mouseenter: 'mouseEnter', - mouseleave: 'mouseLeave', - submit: 'submit', - input: 'input', - change: 'change', - dragstart: 'dragStart', - drag: 'drag', - dragenter: 'dragEnter', - dragleave: 'dragLeave', - dragover: 'dragOver', - drop: 'drop', - dragend: 'dragEnd' - }, - /** - The root DOM element to which event listeners should be attached. Event - listeners will be attached to the document unless this is overridden. - Can be specified as a DOMElement or a selector string. - The default body is a string since this may be evaluated before document.body - exists in the DOM. - @private - @property rootElement - @type DOMElement - @default 'body' - */ - rootElement: 'body', + function get(obj, keyName) { + _emberMetalDebug.assert('Get must be called with two arguments; an object and a property key', arguments.length === 2); + _emberMetalDebug.assert('Cannot call get with \'' + keyName + '\' on an undefined object.', obj !== undefined && obj !== null); + _emberMetalDebug.assert('The key provided to get must be a string, you passed ' + keyName, typeof keyName === 'string'); + _emberMetalDebug.assert('\'this\' in paths is not supported', !_emberMetalPath_cache.hasThis(keyName)); + _emberMetalDebug.assert('Cannot call `Ember.get` with an empty string', keyName !== ''); - /** - It enables events to be dispatched to the view's `eventManager.` When present, - this object takes precedence over handling of events on the view itself. - Note that most Ember applications do not use this feature. If your app also - does not use it, consider setting this property to false to gain some performance - improvement by allowing the EventDispatcher to skip the search for the - `eventManager` on the view tree. - ```javascript - let EventDispatcher = Em.EventDispatcher.extend({ - events: { - click : 'click', - focusin : 'focusIn', - focusout : 'focusOut', - change : 'change' - }, - canDispatchToEventManager: false - }); - container.register('event_dispatcher:main', EventDispatcher); - ``` - @property canDispatchToEventManager - @type boolean - @default 'true' - @since 1.7.0 - @private - */ - canDispatchToEventManager: true, + var value = obj[keyName]; + var desc = value !== null && typeof value === 'object' && value.isDescriptor ? value : undefined; + var ret = undefined; - init: function () { - this._super(); - _emberMetal.assert('EventDispatcher should never be instantiated in fastboot mode. Please report this as an Ember bug.', _emberEnvironment.environment.hasDOM); - }, + if (desc === undefined && _emberMetalPath_cache.isPath(keyName)) { + return _getPath(obj, keyName); + } - /** - Sets up event listeners for standard browser events. - This will be called after the browser sends a `DOMContentReady` event. By - default, it will set up all of the listeners on the document body. If you - would like to register the listeners on a different element, set the event - dispatcher's `root` property. - @private - @method setup - @param addedEvents {Object} - */ - setup: function (addedEvents, rootElement) { - var event = undefined; - var events = this._finalEvents = _emberUtils.assign({}, _emberMetal.get(this, 'events'), addedEvents); + if (desc) { + return desc.get(obj, keyName); + } else { + ret = value; - if (!_emberMetal.isNone(rootElement)) { - _emberMetal.set(this, 'rootElement', rootElement); + if (ret === undefined && 'object' === typeof obj && !(keyName in obj) && 'function' === typeof obj.unknownProperty) { + return obj.unknownProperty(keyName); } - rootElement = _emberViewsSystemJquery.default(_emberMetal.get(this, 'rootElement')); - - _emberMetal.assert('You cannot use the same root element (' + (rootElement.selector || rootElement[0].tagName) + ') multiple times in an Ember.Application', !rootElement.is(ROOT_ELEMENT_SELECTOR)); - _emberMetal.assert('You cannot make a new Ember.Application using a root element that is a descendent of an existing Ember.Application', !rootElement.closest(ROOT_ELEMENT_SELECTOR).length); - _emberMetal.assert('You cannot make a new Ember.Application using a root element that is an ancestor of an existing Ember.Application', !rootElement.find(ROOT_ELEMENT_SELECTOR).length); + return ret; + } + } - rootElement.addClass(ROOT_ELEMENT_CLASS); + function _getPath(root, path) { + var obj = root; + var parts = path.split('.'); - if (!rootElement.is(ROOT_ELEMENT_SELECTOR)) { - throw new TypeError('Unable to add \'' + ROOT_ELEMENT_CLASS + '\' class to root element (' + (rootElement.selector || rootElement[0].tagName) + '). Make sure you set rootElement to the body or an element in the body.'); + for (var i = 0; i < parts.length; i++) { + if (!isGettable(obj)) { + return undefined; } - for (event in events) { - if (events.hasOwnProperty(event)) { - this.setupHandler(rootElement, event, events[event]); - } + obj = get(obj, parts[i]); + + if (obj && obj.isDestroyed) { + return undefined; } - }, + } - /** - Registers an event listener on the rootElement. If the given event is - triggered, the provided event handler will be triggered on the target view. - If the target view does not implement the event handler, or if the handler - returns `false`, the parent view will be called. The event will continue to - bubble to each successive parent view until it reaches the top. - @private - @method setupHandler - @param {Element} rootElement - @param {String} event the browser-originated event to listen to - @param {String} eventName the name of the method to call on the view - */ - setupHandler: function (rootElement, event, eventName) { - var self = this; + return obj; + } - var owner = _emberUtils.getOwner(this); - var viewRegistry = owner && owner.lookup('-view-registry:main') || _emberViewsCompatFallbackViewRegistry.default; + function isGettable(obj) { + if (obj == null) { + return false; + } - if (eventName === null) { - return; - } + return ALLOWABLE_TYPES[typeof obj]; + } - rootElement.on(event + '.ember', '.ember-view', function (evt, triggeringManager) { - var view = viewRegistry[this.id]; - var result = true; + /** + Retrieves the value of a property from an Object, or a default value in the + case that the property returns `undefined`. + + ```javascript + Ember.getWithDefault(person, 'lastName', 'Doe'); + ``` + + @method getWithDefault + @for Ember + @param {Object} obj The object to retrieve from. + @param {String} keyName The name of the property to retrieve + @param {Object} defaultValue The value to return if the property value is undefined + @return {Object} The property value or the defaultValue. + @public + */ - var manager = self.canDispatchToEventManager ? self._findNearestEventManager(view, eventName) : null; + function getWithDefault(root, key, defaultValue) { + var value = get(root, key); - if (manager && manager !== triggeringManager) { - result = self._dispatchEvent(manager, evt, eventName, view); - } else if (view) { - result = self._bubbleEvent(view, evt, eventName); - } + if (value === undefined) { + return defaultValue; + } + return value; + } - return result; - }); + exports.default = get; +}); +enifed('ember-metal/property_set', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_events', 'ember-metal/error', 'ember-metal/path_cache', 'ember-metal/meta'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_events, _emberMetalError, _emberMetalPath_cache, _emberMetalMeta) { + 'use strict'; - rootElement.on(event + '.ember', '[data-ember-action]', function (evt) { - var actionId = _emberViewsSystemJquery.default(evt.currentTarget).attr('data-ember-action'); - var actions = _emberViewsSystemAction_manager.default.registeredActions[actionId]; + exports.set = set; + exports.trySet = trySet; - // In Glimmer2 this attribute is set to an empty string and an additional - // attribute it set for each action on a given element. In this case, the - // attributes need to be read so that a proper set of action handlers can - // be coalesced. - if (actionId === '') { - var attributes = evt.currentTarget.attributes; - var attributeCount = attributes.length; + /** + 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. + + ```javascript + Ember.set(obj, "name", value); + ``` + + @method set + @for Ember + @param {Object} obj The object to modify. + @param {String} keyName The property key to set + @param {Object} value The value to set + @return {Object} the passed value. + @public + */ - actions = []; + function set(obj, keyName, value, tolerant) { + _emberMetalDebug.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); + _emberMetalDebug.assert('Cannot call set with \'' + keyName + '\' on an undefined object.', obj && typeof obj === 'object' || typeof obj === 'function'); + _emberMetalDebug.assert('The key provided to set must be a string, you passed ' + keyName, typeof keyName === 'string'); + _emberMetalDebug.assert('\'this\' in paths is not supported', !_emberMetalPath_cache.hasThis(keyName)); + _emberMetalDebug.assert('calling set on destroyed object: ' + _emberUtils.toString(obj) + '.' + keyName + ' = ' + _emberUtils.toString(value), !obj.isDestroyed); - for (var i = 0; i < attributeCount; i++) { - var attr = attributes.item(i); - var attrName = attr.name; + if (_emberMetalPath_cache.isPath(keyName)) { + return setPath(obj, keyName, value, tolerant); + } - if (attrName.indexOf('data-ember-action-') === 0) { - actions = actions.concat(_emberViewsSystemAction_manager.default.registeredActions[attr.value]); - } - } - } + var meta = _emberMetalMeta.peekMeta(obj); + var possibleDesc = obj[keyName]; - // We have to check for actions here since in some cases, jQuery will trigger - // an event on `removeChild` (i.e. focusout) after we've already torn down the - // action handlers for the view. - if (!actions) { - return; - } + var desc = undefined, + currentValue = undefined; + if (possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor) { + desc = possibleDesc; + } else { + currentValue = possibleDesc; + } - for (var index = 0; index < actions.length; index++) { - var action = actions[index]; + if (desc) { + /* computed property */ + desc.set(obj, keyName, value); + } else if (obj.setUnknownProperty && currentValue === undefined && !(keyName in obj)) { + /* unknown property */ + _emberMetalDebug.assert('setUnknownProperty must be a function', typeof obj.setUnknownProperty === 'function'); + obj.setUnknownProperty(keyName, value); + } else if (currentValue === value) { + /* no change */ + return value; + } else { + _emberMetalProperty_events.propertyWillChange(obj, keyName); - if (action && action.eventName === eventName) { - return action.handler(evt); - } - } - }); - }, + if (true) { + setWithMandatorySetter(meta, obj, keyName, value); + } else { + obj[keyName] = value; + } - _findNearestEventManager: function (view, eventName) { - var manager = null; + _emberMetalProperty_events.propertyDidChange(obj, keyName); + } - while (view) { - manager = _emberMetal.get(view, 'eventManager'); - if (manager && manager[eventName]) { - break; - } + return value; + } - view = _emberMetal.get(view, 'parentView'); + if (true) { + 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; } + }; - return manager; - }, - - _dispatchEvent: function (object, evt, eventName, view) { - var result = true; + var makeEnumerable = function (obj, key) { + var desc = Object.getOwnPropertyDescriptor(obj, key); - var handler = object[eventName]; - if (typeof handler === 'function') { - result = _emberMetal.run(object, handler, evt, view); - // Do not preventDefault in eventManagers. - evt.stopPropagation(); - } else { - result = this._bubbleEvent(view, evt, eventName); + if (desc && desc.set && desc.set.isMandatorySetter) { + desc.enumerable = true; + Object.defineProperty(obj, key, desc); } + }; + } - return result; - }, + function setPath(root, path, value, tolerant) { + // get the last part of the path + var keyName = path.slice(path.lastIndexOf('.') + 1); - _bubbleEvent: function (view, evt, eventName) { - return view.handleEvent(eventName, evt); - }, + // get the first part of the part + path = path === keyName ? keyName : path.slice(0, path.length - (keyName.length + 1)); - destroy: function () { - var rootElement = _emberMetal.get(this, 'rootElement'); - _emberViewsSystemJquery.default(rootElement).off('.ember', '**').removeClass(ROOT_ELEMENT_CLASS); - return this._super.apply(this, arguments); - }, + // unless the path is this, look up the first part to + // get the root + if (path !== 'this') { + root = _emberMetalProperty_get._getPath(root, path); + } - toString: function () { - return '(EventDispatcher)'; + if (!keyName || keyName.length === 0) { + throw new _emberMetalError.default('Property set failed: You passed an empty path'); } - }); -}); -enifed('ember-views/system/ext', ['exports', 'ember-metal'], function (exports, _emberMetal) { + + if (!root) { + if (tolerant) { + return; + } else { + throw new _emberMetalError.default('Property set failed: object in path "' + path + '" could not be found or was destroyed.'); + } + } + + return set(root, keyName, value); + } + /** - @module ember - @submodule ember-views + Error-tolerant form of `Ember.set`. Will not blow up if any part of the + chain is `undefined`, `null`, or destroyed. + + This is primarily used when syncing bindings, which may try to update after + an object has been destroyed. + + @method trySet + @for Ember + @param {Object} root The object to modify. + @param {String} path The property path to set + @param {Object} value The value to set + @public */ - 'use strict'; - - // Add a new named queue for rendering views that happens - // after bindings have synced, and a queue for scheduling actions - // that should occur after view rendering. - _emberMetal.run._addQueue('render', 'actions'); - _emberMetal.run._addQueue('afterRender', 'render'); + function trySet(root, path, value) { + return set(root, path, value, true); + } }); -enifed('ember-views/system/jquery', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { - 'use strict'; +enifed("ember-metal/replace", ["exports"], function (exports) { + "use strict"; - var jQuery = undefined; + exports.default = replace; + var splice = Array.prototype.splice; - if (_emberEnvironment.environment.hasDOM) { - jQuery = _emberEnvironment.context.imports.jQuery; + 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; + var ends = amt; + var count = undefined, + chunk = undefined; - if (jQuery) { - if (jQuery.event.addProp) { - jQuery.event.addProp('dataTransfer'); - } else { - // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dndevents - ['dragstart', 'drag', 'dragenter', 'dragleave', 'dragover', 'drop', 'dragend'].forEach(function (eventName) { - jQuery.event.fixHooks[eventName] = { - props: ['dataTransfer'] - }; - }); + while (args.length) { + count = ends > size ? size : ends; + if (count <= 0) { + count = 0; } + + chunk = args.splice(0, size); + chunk = [start, count].concat(chunk); + + start += size; + ends -= count; + + ret = ret.concat(splice.apply(array, chunk)); } + return ret; } - - exports.default = jQuery; }); -enifed('ember-views/system/lookup_partial', ['exports', 'ember-metal'], function (exports, _emberMetal) { +enifed('ember-metal/run_loop', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/testing', 'ember-metal/error_handler', 'ember-metal/property_events', 'backburner'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalTesting, _emberMetalError_handler, _emberMetalProperty_events, _backburner) { 'use strict'; - exports.default = lookupPartial; - exports.hasPartial = hasPartial; - - function parseUnderscoredName(templateName) { - var nameParts = templateName.split('/'); - var lastPart = nameParts[nameParts.length - 1]; + exports.default = run; - nameParts[nameParts.length - 1] = '_' + lastPart; + function onBegin(current) { + run.currentRunLoop = current; + } - return nameParts.join('/'); + function onEnd(current, next) { + run.currentRunLoop = next; } - function lookupPartial(templateName, owner) { - if (templateName == null) { - return; + var onErrorTarget = { + get onerror() { + return _emberMetalError_handler.getOnerror(); + }, + set onerror(handler) { + return _emberMetalError_handler.setOnerror(handler); } + }; - var template = templateFor(owner, parseUnderscoredName(templateName), templateName); - - _emberMetal.assert('Unable to find partial with name "' + templateName + '"', !!template); + var backburner = new _backburner.default(['sync', 'actions', 'destroy'], { + GUID_KEY: _emberUtils.GUID_KEY, + sync: { + before: _emberMetalProperty_events.beginPropertyChanges, + after: _emberMetalProperty_events.endPropertyChanges + }, + defaultQueue: 'actions', + onBegin: onBegin, + onEnd: onEnd, + onErrorTarget: onErrorTarget, + onErrorMethod: 'onerror' + }); - return template; - } + // .......................................................... + // run - this is ideally the only public API the dev sees + // - function hasPartial(name, owner) { - if (!owner) { - throw new _emberMetal.Error('Container was not found when looking up a views template. ' + 'This is most likely due to manually instantiating an Ember.View. ' + 'See: http://git.io/EKPpnA'); - } + /** + Runs the passed target and method inside of a RunLoop, ensuring any + deferred actions including bindings and views updates are flushed at the + end. + + Normally you should not need to invoke this method yourself. However if + you are implementing raw event handlers when interfacing with other + libraries or plugins, you should probably wrap all of your code inside this + call. + + ```javascript + run(function() { + // code to be executed within a RunLoop + }); + ``` + + @class run + @namespace Ember + @static + @constructor + @param {Object} [target] target of method to call + @param {Function|String} method Method to invoke. + May be a function or a string. If you pass a string + then it will be looked up on the passed target. + @param {Object} [args*] Any additional arguments you wish to pass to the method. + @return {Object} return value from invoking the passed function. + @public + */ - return owner.hasRegistration('template:' + parseUnderscoredName(name)) || owner.hasRegistration('template:' + name); + function run() { + return backburner.run.apply(backburner, arguments); } - function templateFor(owner, underscored, name) { - if (!name) { - return; - } - _emberMetal.assert('templateNames are not allowed to contain periods: ' + name, name.indexOf('.') === -1); + /** + If no run-loop is present, it creates a new one. If a run loop is + present it will queue itself to run on the existing run-loops action + queue. + + Please note: This is not for normal usage, and should be used sparingly. + + If invoked when not within a run loop: + + ```javascript + run.join(function() { + // creates a new run-loop + }); + ``` + + Alternatively, if called within an existing run loop: + + ```javascript + run(function() { + // creates a new run-loop + run.join(function() { + // joins with the existing run-loop, and queues for invocation on + // the existing run-loops action queue. + }); + }); + ``` + + @method join + @namespace Ember + @param {Object} [target] target of method to call + @param {Function|String} method Method to invoke. + May be a function or a string. If you pass a string + then it will be looked up on the passed target. + @param {Object} [args*] Any additional arguments you wish to pass to the method. + @return {Object} Return value from invoking the passed function. Please note, + when called within an existing loop, no return value is possible. + @public + */ + run.join = function () { + return backburner.join.apply(backburner, arguments); + }; - if (!owner) { - throw new _emberMetal.Error('Container was not found when looking up a views template. ' + 'This is most likely due to manually instantiating an Ember.View. ' + 'See: http://git.io/EKPpnA'); + /** + Allows you to specify which context to call the specified function in while + adding the execution of that function to the Ember run loop. This ability + makes this method a great way to asynchronously integrate third-party libraries + into your Ember application. + + `run.bind` takes two main arguments, the desired context and the function to + invoke in that context. Any additional arguments will be supplied as arguments + to the function that is passed in. + + Let's use the creation of a TinyMCE component as an example. Currently, + TinyMCE provides a setup configuration option we can use to do some processing + after the TinyMCE instance is initialized but before it is actually rendered. + We can use that setup option to do some additional setup for our component. + The component itself could look something like the following: + + ```javascript + App.RichTextEditorComponent = Ember.Component.extend({ + initializeTinyMCE: Ember.on('didInsertElement', function() { + tinymce.init({ + selector: '#' + this.$().prop('id'), + setup: Ember.run.bind(this, this.setupEditor) + }); + }), + + setupEditor: function(editor) { + this.set('editor', editor); + + editor.on('change', function() { + console.log('content changed!'); + }); + } + }); + ``` + + In this example, we use Ember.run.bind to bind the setupEditor method to the + context of the App.RichTextEditorComponent and to have the invocation of that + method be safely handled and executed by the Ember run loop. + + @method bind + @namespace Ember + @param {Object} [target] target of method to call + @param {Function|String} method Method to invoke. + May be a function or a string. If you pass a string + then it will be looked up on the passed target. + @param {Object} [args*] Any additional arguments you wish to pass to the method. + @return {Function} returns a new function that will always have a particular context + @since 1.4.0 + @public + */ + run.bind = function () { + for (var _len = arguments.length, curried = Array(_len), _key = 0; _key < _len; _key++) { + curried[_key] = arguments[_key]; } - return owner.lookup('template:' + underscored) || owner.lookup('template:' + name); - } -}); -enifed('ember-views/system/utils', ['exports', 'ember-utils'], function (exports, _emberUtils) { - /* globals Element */ - 'use strict'; + return function () { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - exports.isSimpleClick = isSimpleClick; - exports.getRootViews = getRootViews; - exports.getViewId = getViewId; - exports.getViewElement = getViewElement; - exports.initViewElement = initViewElement; - exports.setViewElement = setViewElement; - exports.getChildViews = getChildViews; - exports.initChildViews = initChildViews; - exports.addChildView = addChildView; - exports.collectChildViews = collectChildViews; - exports.getViewBounds = getViewBounds; - exports.getViewRange = getViewRange; - exports.getViewClientRects = getViewClientRects; - exports.getViewBoundingClientRect = getViewBoundingClientRect; - exports.matches = matches; + return run.join.apply(run, curried.concat(args)); + }; + }; + + run.backburner = backburner; + run.currentRunLoop = null; + run.queues = backburner.queueNames; /** - @module ember - @submodule ember-views + Begins a new RunLoop. Any deferred actions invoked after the begin will + be buffered until you invoke a matching call to `run.end()`. This is + a lower-level way to use a RunLoop instead of using `run()`. + + ```javascript + run.begin(); + // code to be executed within a RunLoop + run.end(); + ``` + + @method begin + @return {void} + @public */ + run.begin = function () { + backburner.begin(); + }; - 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; - } - - var STYLE_WARNING = '' + '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.'; + /** + Ends a RunLoop. This must be called sometime after you call + `run.begin()` to flush any deferred actions. This is a lower-level way + to use a RunLoop instead of using `run()`. + + ```javascript + run.begin(); + // code to be executed within a RunLoop + run.end(); + ``` + + @method end + @return {void} + @public + */ + run.end = function () { + backburner.end(); + }; - exports.STYLE_WARNING = STYLE_WARNING; /** + Array of named queues. This array determines the order in which queues + are flushed at the end of the RunLoop. You can define your own queues by + simply adding the queue name to this array. Normally you should not need + to inspect or modify this property. + + @property queues + @type Array + @default ['sync', 'actions', 'destroy'] @private - @method getRootViews - @param {Object} owner */ - function getRootViews(owner) { - var registry = owner.lookup('-view-registry:main'); - - var rootViews = []; + /** + Adds the passed target/method and any optional arguments to the named + queue to be executed at the end of the RunLoop. If you have not already + started a RunLoop when calling this method one will be started for you + automatically. + + At the end of a RunLoop, any methods scheduled in this way will be invoked. + Methods will be invoked in an order matching the named queues defined in + the `run.queues` property. + + ```javascript + run.schedule('sync', this, function() { + // this will be executed in the first RunLoop queue, when bindings are synced + console.log('scheduled on sync queue'); + }); + + run.schedule('actions', this, function() { + // this will be executed in the 'actions' queue, after bindings have synced. + console.log('scheduled on actions queue'); + }); + + // Note the functions will be run in order based on the run queues order. + // Output would be: + // scheduled on sync queue + // scheduled on actions queue + ``` + + @method schedule + @param {String} queue The name of the queue to schedule against. + Default queues are 'sync' and 'actions' + @param {Object} [target] target object to use as the context when invoking a method. + @param {String|Function} method The method to invoke. If you pass a string it + will be resolved on the target object at the time the scheduled item is + invoked allowing you to change the target function. + @param {Object} [arguments*] Optional arguments to be passed to the queued method. + @return {*} Timer information for use in cancelling, see `run.cancel`. + @public + */ + run.schedule = function () /* queue, target, method */{ + _emberMetalDebug.assert('You have turned on testing mode, which disabled the run-loop\'s autorun. ' + 'You will need to wrap any code with asynchronous side-effects in a run', run.currentRunLoop || !_emberMetalTesting.isTesting()); - Object.keys(registry).forEach(function (id) { - var view = registry[id]; + return backburner.schedule.apply(backburner, arguments); + }; - if (view.parentView === null) { - rootViews.push(view); - } - }); + // Used by global test teardown + run.hasScheduledTimers = function () { + return backburner.hasTimers(); + }; - return rootViews; - } + // Used by global test teardown + run.cancelTimers = function () { + backburner.cancelTimers(); + }; /** + Immediately flushes any events scheduled in the 'sync' queue. Bindings + use this queue so this method is a useful way to immediately force all + bindings in the application to sync. + + You should call this method anytime you need any changed state to propagate + throughout the app immediately without repainting the UI (which happens + in the later 'render' queue added by the `ember-views` package). + + ```javascript + run.sync(); + ``` + + @method sync + @return {void} @private - @method getViewId - @param {Ember.View} view - */ - - function getViewId(view) { - if (view.tagName === '') { - return _emberUtils.guidFor(view); - } else { - return view.elementId || _emberUtils.guidFor(view); + */ + run.sync = function () { + if (backburner.currentInstance) { + backburner.currentInstance.queues.sync.flush(); } - } + }; - var VIEW_ELEMENT = _emberUtils.symbol('VIEW_ELEMENT'); + /** + Invokes the passed target/method and optional arguments after a specified + period of time. The last parameter of this method must always be a number + of milliseconds. + + You should use this method whenever you need to run some action after a + period of time instead of using `setTimeout()`. This method will ensure that + items that expire during the same script execution cycle all execute + together, which is often more efficient than using a real setTimeout. + + ```javascript + run.later(myContext, function() { + // code here will execute within a RunLoop in about 500ms with this == myContext + }, 500); + ``` + + @method later + @param {Object} [target] target of method to invoke + @param {Function|String} method The method to invoke. + If you pass a string it will be resolved on the + target at the time the method is invoked. + @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 () /*target, method*/{ + return backburner.later.apply(backburner, arguments); + }; /** - @private - @method getViewElement - @param {Ember.View} view - */ - - function getViewElement(view) { - return view[VIEW_ELEMENT]; - } - - function initViewElement(view) { - view[VIEW_ELEMENT] = null; - } + Schedule a function to run one time during the current RunLoop. This is equivalent + to calling `scheduleOnce` with the "actions" queue. + + @method once + @param {Object} [target] The target of the method to invoke. + @param {Function|String} method The method to invoke. + If you pass a string it will be resolved on the + 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.once = function () { + _emberMetalDebug.assert('You have turned on testing mode, which disabled the run-loop\'s autorun. ' + 'You will need to wrap any code with asynchronous side-effects in a run', run.currentRunLoop || !_emberMetalTesting.isTesting()); - function setViewElement(view, element) { - return view[VIEW_ELEMENT] = element; - } + for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } - var CHILD_VIEW_IDS = _emberUtils.symbol('CHILD_VIEW_IDS'); + args.unshift('actions'); + return backburner.scheduleOnce.apply(backburner, args); + }; /** - @private - @method getChildViews - @param {Ember.View} view + Schedules a function to run one time in a given queue of the current RunLoop. + Calling this method with the same queue/target/method combination will have + no effect (past the initial call). + + Note that although you can pass optional arguments these will not be + considered when looking for duplicates. New arguments will replace previous + calls. + + ```javascript + function sayHi() { + console.log('hi'); + } + + run(function() { + run.scheduleOnce('afterRender', myContext, sayHi); + run.scheduleOnce('afterRender', myContext, sayHi); + // sayHi will only be executed once, in the afterRender queue of the RunLoop + }); + ``` + + Also note that passing an anonymous function to `run.scheduleOnce` will + not prevent additional calls with an identical anonymous function from + scheduling the items multiple times, e.g.: + + ```javascript + function scheduleIt() { + run.scheduleOnce('actions', myContext, function() { + console.log('Closure'); + }); + } + + scheduleIt(); + scheduleIt(); + + // "Closure" will print twice, even though we're using `run.scheduleOnce`, + // because the function we pass to it is anonymous and won't match the + // previously scheduled operation. + ``` + + Available queues, and their order, can be found at `run.queues` + + @method scheduleOnce + @param {String} [queue] The name of the queue to schedule against. Default queues are 'sync' and 'actions'. + @param {Object} [target] The target of the method to invoke. + @param {Function|String} method The method to invoke. + If you pass a string it will be resolved on the + 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 () /*queue, target, method*/{ + _emberMetalDebug.assert('You have turned on testing mode, which disabled the run-loop\'s autorun. ' + 'You will need to wrap any code with asynchronous side-effects in a run', run.currentRunLoop || !_emberMetalTesting.isTesting()); + return backburner.scheduleOnce.apply(backburner, arguments); + }; - function getChildViews(view) { - var owner = _emberUtils.getOwner(view); - var registry = owner.lookup('-view-registry:main'); - return collectChildViews(view, registry); - } - - function initChildViews(view) { - view[CHILD_VIEW_IDS] = []; - } - - function addChildView(parent, child) { - parent[CHILD_VIEW_IDS].push(getViewId(child)); - } - - function collectChildViews(view, registry) { - var ids = []; - var views = []; - - view[CHILD_VIEW_IDS].forEach(function (id) { - var view = registry[id]; - - if (view && !view.isDestroying && !view.isDestroyed && ids.indexOf(id) === -1) { - ids.push(id); - views.push(view); + /** + Schedules an item to run from within a separate run loop, after + control has been returned to the system. This is equivalent to calling + `run.later` with a wait time of 1ms. + + ```javascript + run.next(myContext, function() { + // code to be executed in the next run loop, + // which will be scheduled after the current one + }); + ``` + + Multiple operations scheduled with `run.next` will coalesce + into the same later run loop, along with any other operations + scheduled by `run.later` that expire right around the same + time that `run.next` operations will fire. + + Note that there are often alternatives to using `run.next`. + For instance, if you'd like to schedule an operation to happen + after all DOM element operations have completed within the current + run loop, you can make use of the `afterRender` run loop queue (added + by the `ember-views` package, along with the preceding `render` queue + where all the DOM element operations happen). + + Example: + + ```javascript + export default Ember.Component.extend({ + didInsertElement() { + this._super(...arguments); + run.scheduleOnce('afterRender', this, 'processChildElements'); + }, + + processChildElements() { + // ... do something with component's child component + // elements after they've finished rendering, which + // can't be done within this component's + // `didInsertElement` hook because that gets run + // before the child elements have been added to the DOM. } }); + ``` + + One benefit of the above approach compared to using `run.next` is + that you will be able to perform DOM/CSS operations before unprocessed + elements are rendered to the screen, which may prevent flickering or + other artifacts caused by delaying processing until after rendering. + + The other major benefit to the above approach is that `run.next` + introduces an element of non-determinism, which can make things much + harder to test, due to its reliance on `setTimeout`; it's much harder + to guarantee the order of scheduled operations when they are scheduled + outside of the current run loop, i.e. with `run.next`. + + @method next + @param {Object} [target] target of method to invoke + @param {Function|String} method The method to invoke. + If you pass a string it will be resolved on the + 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.next = function () { + for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; + } - view[CHILD_VIEW_IDS] = ids; - - return views; - } + args.push(1); + return backburner.later.apply(backburner, args); + }; /** - @private - @method getViewBounds - @param {Ember.View} view + Cancels a scheduled item. Must be a value returned by `run.later()`, + `run.once()`, `run.scheduleOnce()`, `run.next()`, `run.debounce()`, or + `run.throttle()`. + + ```javascript + let runNext = run.next(myContext, function() { + // will not be executed + }); + + run.cancel(runNext); + + let runLater = run.later(myContext, function() { + // will not be executed + }, 500); + + run.cancel(runLater); + + let runScheduleOnce = run.scheduleOnce('afterRender', myContext, function() { + // will not be executed + }); + + run.cancel(runScheduleOnce); + + let runOnce = run.once(myContext, function() { + // will not be executed + }); + + run.cancel(runOnce); + + let throttle = run.throttle(myContext, function() { + // will not be executed + }, 1, false); + + run.cancel(throttle); + + let debounce = run.debounce(myContext, function() { + // will not be executed + }, 1); + + run.cancel(debounce); + + let debounceImmediate = run.debounce(myContext, function() { + // will be executed since we passed in true (immediate) + }, 100, true); + + // the 100ms delay until this method can be called again will be cancelled + run.cancel(debounceImmediate); + ``` + + @method cancel + @param {Object} timer Timer object to cancel + @return {Boolean} true if cancelled or false/undefined if it wasn't found + @public */ - - function getViewBounds(view) { - return view.renderer.getBounds(view); - } + run.cancel = function (timer) { + return backburner.cancel(timer); + }; /** - @private - @method getViewRange - @param {Ember.View} view + Delay calling the target method until the debounce period has elapsed + with no additional debounce calls. If `debounce` is called again before + the specified time has elapsed, the timer is reset and the entire period + must pass again before the target method is called. + + This method should be used when an event may be called multiple times + but the action should only be called once when the event is done firing. + A common example is for scroll events where you only want updates to + happen once scrolling has ceased. + + ```javascript + function whoRan() { + console.log(this.name + ' ran.'); + } + + let myContext = { name: 'debounce' }; + + run.debounce(myContext, whoRan, 150); + + // less than 150ms passes + run.debounce(myContext, whoRan, 150); + + // 150ms passes + // whoRan is invoked with context myContext + // console logs 'debounce ran.' one time. + ``` + + Immediate allows you to run the function immediately, but debounce + other calls for this function until the wait time has elapsed. If + `debounce` is called again before the specified time has elapsed, + the timer is reset and the entire period must pass again before + the method can be called again. + + ```javascript + function whoRan() { + console.log(this.name + ' ran.'); + } + + let myContext = { name: 'debounce' }; + + run.debounce(myContext, whoRan, 150, true); + + // console logs 'debounce ran.' one time immediately. + // 100ms passes + run.debounce(myContext, whoRan, 150, true); + + // 150ms passes and nothing else is logged to the console and + // the debouncee is no longer being watched + run.debounce(myContext, whoRan, 150, true); + + // console logs 'debounce ran.' one time immediately. + // 150ms passes and nothing else is logged to the console and + // the debouncee is no longer being watched + + ``` + + @method debounce + @param {Object} [target] target of method to invoke + @param {Function|String} method The method to invoke. + May be a function or a string. If you pass a string + then it will be looked up on the passed target. + @param {Object} [args*] Optional arguments to pass to the timeout. + @param {Number} wait Number of milliseconds to wait. + @param {Boolean} immediate Trigger the function on the leading instead + of the trailing edge of the wait interval. Defaults to false. + @return {Array} Timer information for use in cancelling, see `run.cancel`. + @public */ - - function getViewRange(view) { - var bounds = getViewBounds(view); - - var range = document.createRange(); - range.setStartBefore(bounds.firstNode); - range.setEndAfter(bounds.lastNode); - - return range; - } + run.debounce = function () { + return backburner.debounce.apply(backburner, arguments); + }; /** - `getViewClientRects` provides information about the position of the border - box edges of a view relative to the viewport. + Ensure that the target method is never called more frequently than + the specified spacing period. The target method is called immediately. - It is only intended to be used by development tools like the Ember Inspector - and may not work on older browsers. + ```javascript + function whoRan() { + console.log(this.name + ' ran.'); + } - @private - @method getViewClientRects - @param {Ember.View} view + let myContext = { name: 'throttle' }; + + run.throttle(myContext, whoRan, 150); + // whoRan is invoked with context myContext + // console logs 'throttle ran.' + + // 50ms passes + run.throttle(myContext, whoRan, 150); + + // 50ms passes + run.throttle(myContext, whoRan, 150); + + // 150ms passes + run.throttle(myContext, whoRan, 150); + // whoRan is invoked with context myContext + // console logs 'throttle ran.' + ``` + + @method throttle + @param {Object} [target] target of method to invoke + @param {Function|String} method The method to invoke. + May be a function or a string. If you pass a string + then it will be looked up on the passed target. + @param {Object} [args*] Optional arguments to pass to the timeout. + @param {Number} spacing Number of milliseconds to space out requests. + @param {Boolean} immediate Trigger the function on the leading instead + of the trailing edge of the wait interval. Defaults to true. + @return {Array} Timer information for use in cancelling, see `run.cancel`. + @public */ - - function getViewClientRects(view) { - var range = getViewRange(view); - return range.getClientRects(); - } + run.throttle = function () { + return backburner.throttle.apply(backburner, arguments); + }; /** - `getViewBoundingClientRect` provides information about the position of the - bounding border box edges of a view relative to the viewport. + Add a new named queue after the specified queue. - It is only intended to be used by development tools like the Ember Inpsector - and may not work on older browsers. + The queue to add will only be added once. + @method _addQueue + @param {String} name the name of the queue to add. + @param {String} after the name of the queue to add after. @private - @method getViewBoundingClientRect - @param {Ember.View} view */ + run._addQueue = function (name, after) { + if (run.queues.indexOf(name) === -1) { + run.queues.splice(run.queues.indexOf(after) + 1, 0, name); + } + }; +}); +enifed('ember-metal/set_properties', ['exports', 'ember-metal/property_events', 'ember-metal/property_set'], function (exports, _emberMetalProperty_events, _emberMetalProperty_set) { + 'use strict'; - function getViewBoundingClientRect(view) { - var range = getViewRange(view); - return range.getBoundingClientRect(); - } + exports.default = setProperties; /** - Determines if the element matches the specified selector. + Set a list of properties on an object. These properties are set inside + a single `beginPropertyChanges` and `endPropertyChanges` batch, so + observers will be buffered. - @private - @method matches - @param {DOMElement} el - @param {String} selector + ```javascript + let anObject = Ember.Object.create(); + + anObject.setProperties({ + firstName: 'Stanley', + lastName: 'Stuart', + age: 21 + }); + ``` + + @method setProperties + @param obj + @param {Object} properties + @return properties + @public */ - var elMatches = typeof Element !== 'undefined' && (Element.prototype.matches || Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector); - exports.elMatches = elMatches; + function setProperties(obj, properties) { + if (!properties || typeof properties !== 'object') { + return properties; + } + _emberMetalProperty_events.changeProperties(function () { + var props = Object.keys(properties); + var propertyName = undefined; - function matches(el, selector) { - return elMatches.call(el, selector); + for (var i = 0; i < props.length; i++) { + propertyName = props[i]; + + _emberMetalProperty_set.set(obj, propertyName, properties[propertyName]); + } + }); + return properties; } }); -enifed('ember-views/utils/lookup-component', ['exports', 'container'], function (exports, _container) { +enifed('ember-metal/tags', ['exports', '@glimmer/reference', 'ember-metal/meta', 'require', 'ember-metal/is_proxy'], function (exports, _glimmerReference, _emberMetalMeta, _require, _emberMetalIs_proxy) { 'use strict'; - exports.default = lookupComponent; + exports.setHasViews = setHasViews; + exports.tagForProperty = tagForProperty; + exports.tagFor = tagFor; + exports.markObjectAsDirty = markObjectAsDirty; - var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['component:-default'], ['component:-default']); + var hasViews = function () { + return false; + }; - function lookupComponentPair(componentLookup, owner, name, options) { - var component = componentLookup.componentFor(name, owner, options); - var layout = componentLookup.layoutFor(name, owner, options); + function setHasViews(fn) { + hasViews = fn; + } - var result = { layout: layout, component: component }; + function makeTag() { + return new _glimmerReference.DirtyableTag(); + } + + function tagForProperty(object, propertyKey, _meta) { + if (_emberMetalIs_proxy.isProxy(object)) { + return tagFor(object, _meta); + } + + if (typeof object === 'object' && object) { + var meta = _meta || _emberMetalMeta.meta(object); + var tags = meta.writableTags(); + var tag = tags[propertyKey]; + if (tag) { + return tag; + } + + return tags[propertyKey] = makeTag(); + } else { + return _glimmerReference.CONSTANT_TAG; + } + } + + function tagFor(object, _meta) { + if (typeof object === 'object' && object) { + var meta = _meta || _emberMetalMeta.meta(object); + return meta.writableTag(makeTag); + } else { + return _glimmerReference.CONSTANT_TAG; + } + } + + function markObjectAsDirty(meta, propertyKey) { + var objectTag = meta && meta.readableTag(); + + if (objectTag) { + objectTag.dirty(); + } + + var tags = meta && meta.readableTags(); + var propertyTag = tags && tags[propertyKey]; - if (layout && !component) { - result.component = owner._lookupFactory(_container.privatize(_templateObject)); + if (propertyTag) { + propertyTag.dirty(); } - return result; + if (objectTag || propertyTag) { + ensureRunloop(); + } } - function lookupComponent(owner, name, options) { - var componentLookup = owner.lookup('component-lookup:main'); + var run = undefined; - var source = options && options.source; + function K() {} - if (source) { - var localResult = lookupComponentPair(componentLookup, owner, name, options); + function ensureRunloop() { + if (!run) { + run = _require.default('ember-metal/run_loop').default; + } - if (localResult.component || localResult.layout) { - return localResult; - } + if (hasViews() && !run.backburner.currentInstance) { + run.schedule('actions', K); } + } +}); +enifed("ember-metal/testing", ["exports"], function (exports) { + "use strict"; - return lookupComponentPair(componentLookup, owner, name); + exports.isTesting = isTesting; + exports.setTesting = setTesting; + var testing = false; + + function isTesting() { + return testing; + } + + function setTesting(value) { + testing = !!value; } }); -enifed('ember-views/views/core_view', ['exports', 'ember-runtime', 'ember-views/system/utils', 'ember-views/views/states'], function (exports, _emberRuntime, _emberViewsSystemUtils, _emberViewsViewsStates) { +enifed('ember-metal/transaction', ['exports', 'ember-metal/meta', 'ember-metal/debug', 'ember-metal/features'], function (exports, _emberMetalMeta, _emberMetalDebug, _emberMetalFeatures) { 'use strict'; - /** - `Ember.CoreView` is an abstract class that exists to give view-like behavior - to both Ember's main view class `Ember.Component` and other classes that don't need - the full functionality of `Ember.Component`. - - Unless you have specific needs for `CoreView`, you will use `Ember.Component` - in your applications. - - @class CoreView - @namespace Ember - @extends Ember.Object - @deprecated Use `Ember.Component` instead. - @uses Ember.Evented - @uses Ember.ActionHandler - @private - */ - var CoreView = _emberRuntime.FrameworkObject.extend(_emberRuntime.Evented, _emberRuntime.ActionHandler, { - isView: true, + var runInTransaction = undefined, + didRender = undefined, + assertNotRendered = undefined; - _states: _emberViewsViewsStates.cloneStates(_emberViewsViewsStates.states), + // detect-backtracking-rerender by default is debug build only + // detect-glimmer-allow-backtracking-rerender can be enabled in custom builds + if (true || true) { + (function () { + var counter = 0; + var inTransaction = false; + var shouldReflush = undefined; + var debugStack = undefined; - init: function () { - this._super.apply(this, arguments); - this._state = 'preRender'; - this._currentState = this._states.preRender; + exports.default = runInTransaction = function (context, methodName) { + shouldReflush = false; + inTransaction = true; + _emberMetalDebug.runInDebug(function () { + debugStack = context.env.debugStack; + }); + context[methodName](); + inTransaction = false; + counter++; + return shouldReflush; + }; - _emberViewsSystemUtils.initViewElement(this); + exports.didRender = didRender = function (object, key, reference) { + if (!inTransaction) { + return; + } + var meta = _emberMetalMeta.meta(object); + var lastRendered = meta.writableLastRendered(); + lastRendered[key] = counter; - if (!this.renderer) { - throw new Error('Cannot instantiate a component without a renderer. Please ensure that you are creating ' + this + ' with a proper container/registry.'); - } - }, + _emberMetalDebug.runInDebug(function () { + var referenceMap = meta.writableLastRenderedReferenceMap(); + referenceMap[key] = reference; - /** - If the view is currently inserted into the DOM of a parent view, this - property will point to the parent of the view. - @property parentView - @type Ember.View - @default null - @private - */ - parentView: null, + var templateMap = meta.writableLastRenderedTemplateMap(); + if (templateMap[key] === undefined) { + templateMap[key] = debugStack.peek(); + } + }); + }; - instrumentDetails: function (hash) { - hash.object = this.toString(); - hash.containerKey = this._debugContainerKey; - hash.view = this; - return hash; - }, + exports.assertNotRendered = assertNotRendered = function (object, key, _meta) { + var meta = _meta || _emberMetalMeta.meta(object); + var lastRendered = meta.readableLastRendered(); - /** - Override the default event firing from `Ember.Evented` to - also call methods with the given name. - @method trigger - @param name {String} - @private - */ - trigger: function () { - this._super.apply(this, arguments); - var name = arguments[0]; - var method = this[name]; - if (method) { - var args = new Array(arguments.length - 1); - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - return method.apply(this, args); - } - }, + if (lastRendered && lastRendered[key] === counter) { + _emberMetalDebug.runInDebug(function () { + var templateMap = meta.readableLastRenderedTemplateMap(); + var lastRenderedIn = templateMap[key]; + var currentlyIn = debugStack.peek(); - has: function (name) { - return _emberRuntime.typeOf(this[name]) === 'function' || this._super(name); - } - }); + var referenceMap = meta.readableLastRenderedReferenceMap(); + var lastRef = referenceMap[key]; + var parts = []; + var label = undefined; - _emberRuntime.deprecateUnderscoreActions(CoreView); + if (lastRef) { + while (lastRef && lastRef._propertyKey) { + parts.unshift(lastRef._propertyKey); + lastRef = lastRef._parentReference; + } - CoreView.reopenClass({ - isViewFactory: true - }); + label = parts.join('.'); + } else { + label = 'the same value'; + } - exports.default = CoreView; + var message = 'You modified "' + label + '" twice on ' + object + ' in a single render. It was rendered in ' + lastRenderedIn + ' and modified in ' + currentlyIn + '. This was unreliable and slow in Ember 1.x and'; + + if (true) { + _emberMetalDebug.deprecate(message + ' will be removed in Ember 3.0.', false, { id: 'ember-views.render-double-modify', until: '3.0.0' }); + } else { + _emberMetalDebug.assert(message + ' is no longer supported. See https://github.com/emberjs/ember.js/issues/13948 for more details.', false); + } + }); + + shouldReflush = true; + } + }; + })(); + } else { + // in production do nothing to detect reflushes + exports.default = runInTransaction = function (context, methodName) { + context[methodName](); + return false; + }; + } + + exports.default = runInTransaction; + exports.didRender = didRender; + exports.assertNotRendered = assertNotRendered; }); -enifed('ember-views/views/states', ['exports', 'ember-utils', '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, _emberUtils, _emberViewsViewsStatesDefault, _emberViewsViewsStatesPre_render, _emberViewsViewsStatesHas_element, _emberViewsViewsStatesIn_dom, _emberViewsViewsStatesDestroying) { +enifed('ember-metal/watch_key', ['exports', 'ember-utils', 'ember-metal/features', 'ember-metal/meta', 'ember-metal/properties'], function (exports, _emberUtils, _emberMetalFeatures, _emberMetalMeta, _emberMetalProperties) { 'use strict'; - exports.cloneStates = cloneStates; + exports.watchKey = watchKey; + exports.unwatchKey = unwatchKey; - function cloneStates(from) { - var into = {}; + var handleMandatorySetter = undefined; - into._default = {}; - into.preRender = Object.create(into._default); - into.destroying = Object.create(into._default); - into.hasElement = Object.create(into._default); - into.inDOM = Object.create(into.hasElement); + function watchKey(obj, keyName, meta) { + if (typeof obj !== 'object' || obj === null) { + return; + } + var m = meta || _emberMetalMeta.meta(obj); - for (var stateName in from) { - if (!from.hasOwnProperty(stateName)) { - continue; + // activate watching first time + if (!m.peekWatching(keyName)) { + m.writeWatching(keyName, 1); + + var possibleDesc = obj[keyName]; + var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; + if (desc && desc.willWatch) { + desc.willWatch(obj, keyName); } - _emberUtils.assign(into[stateName], from[stateName]); - } - return into; + if ('function' === typeof obj.willWatchProperty) { + obj.willWatchProperty(keyName); + } + + if (true) { + // NOTE: this is dropped for prod + minified builds + handleMandatorySetter(m, obj, keyName); + } + } else { + m.writeWatching(keyName, (m.peekWatching(keyName) || 0) + 1); + } } - /* - Describe how the specified actions should behave in the various - states that a view can exist in. Possible states: - - * preRender: when a view is first instantiated, and after its - element was destroyed, it is in the preRender state - * hasElement: the DOM representation of the view is created, - and is ready to be inserted - * inDOM: once a view has been inserted into the DOM it is in - the inDOM state. A view spends the vast majority of its - existence in this state. - * destroyed: once a view has been destroyed (using the destroy - method), it is in this state. No further actions can be invoked - on a destroyed view. - */ - var states = { - _default: _emberViewsViewsStatesDefault.default, - preRender: _emberViewsViewsStatesPre_render.default, - inDOM: _emberViewsViewsStatesIn_dom.default, - hasElement: _emberViewsViewsStatesHas_element.default, - destroying: _emberViewsViewsStatesDestroying.default - }; - exports.states = states; -}); -enifed('ember-views/views/states/default', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; + if (true) { + (function () { + var hasOwnProperty = function (obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); + }; - /** - @module ember - @submodule ember-views - */ - exports.default = { - // appendChild is only legal while rendering the buffer. - appendChild: function () { - throw new _emberMetal.Error('You can\'t use appendChild outside of the rendering process'); - }, + var propertyIsEnumerable = function (obj, key) { + return Object.prototype.propertyIsEnumerable.call(obj, key); + }; - // Handle events from `Ember.EventDispatcher` - handleEvent: function () { - return true; // continue event propagation - }, + // 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 = _emberUtils.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; - rerender: function () {}, + if (isDescriptor) { + return; + } - destroy: function () {} - }; -}); -enifed('ember-views/views/states/destroying', ['exports', 'ember-utils', 'ember-metal', 'ember-views/views/states/default'], function (exports, _emberUtils, _emberMetal, _emberViewsViewsStatesDefault) { - 'use strict'; + // 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 + }; - /** - @module ember - @submodule ember-views - */ + if (hasOwnProperty(obj, keyName)) { + m.writeValues(keyName, obj[keyName]); + desc.get = _emberMetalProperties.DEFAULT_GETTER_FUNCTION(keyName); + } else { + desc.get = _emberMetalProperties.INHERITING_GETTER_FUNCTION(keyName); + } - var destroying = Object.create(_emberViewsViewsStatesDefault.default); + Object.defineProperty(obj, keyName, desc); + } + }; + })(); + } - _emberUtils.assign(destroying, { - appendChild: function () { - throw new _emberMetal.Error('You can\'t call appendChild on a view being destroyed'); - }, - rerender: function () { - throw new _emberMetal.Error('You can\'t call rerender on a view being destroyed'); + function unwatchKey(obj, keyName, _meta) { + if (typeof obj !== 'object' || obj === null) { + return; } - }); + var meta = _meta || _emberMetalMeta.meta(obj); - exports.default = destroying; -}); -enifed('ember-views/views/states/has_element', ['exports', 'ember-utils', 'ember-views/views/states/default', 'ember-metal'], function (exports, _emberUtils, _emberViewsViewsStatesDefault, _emberMetal) { - 'use strict'; + // do nothing of this object has already been destroyed + if (meta.isSourceDestroyed()) { + return; + } - var hasElement = Object.create(_emberViewsViewsStatesDefault.default); + var count = meta.peekWatching(keyName); + if (count === 1) { + meta.writeWatching(keyName, 0); - _emberUtils.assign(hasElement, { + var possibleDesc = obj[keyName]; + var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - rerender: function (view) { - view.renderer.rerender(view); - }, + if (desc && desc.didUnwatch) { + desc.didUnwatch(obj, keyName); + } - destroy: function (view) { - view.renderer.remove(view); - }, + if ('function' === typeof obj.didUnwatchProperty) { + obj.didUnwatchProperty(keyName); + } - // Handle events from `Ember.EventDispatcher` - handleEvent: function (view, eventName, event) { - if (view.has(eventName)) { - // Handler should be able to re-dispatch events, so we don't - // preventDefault or stopPropagation. - return _emberMetal.flaggedInstrument('interaction.' + eventName, { event: event, view: view }, function () { - return _emberMetal.run.join(view, view.trigger, eventName, event); - }); - } else { - return true; // continue event propagation + if (true) { + // 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 = _emberUtils.lookupDescriptor(obj, keyName); + + if (maybeMandatoryDescriptor.set && maybeMandatoryDescriptor.set.isMandatorySetter) { + if (maybeMandatoryDescriptor.get && maybeMandatoryDescriptor.get.isInheritingGetter) { + var possibleValue = meta.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: meta.peekValues(keyName) + }); + meta.deleteFromValues(keyName); + } + } } + } else if (count > 1) { + meta.writeWatching(keyName, count - 1); } - }); - - exports.default = hasElement; + } }); -enifed('ember-views/views/states/in_dom', ['exports', 'ember-utils', 'ember-metal', 'ember-views/views/states/has_element'], function (exports, _emberUtils, _emberMetal, _emberViewsViewsStatesHas_element) { +enifed('ember-metal/watch_path', ['exports', 'ember-metal/meta', 'ember-metal/chains'], function (exports, _emberMetalMeta, _emberMetalChains) { 'use strict'; - /** - @module ember - @submodule ember-views - */ + exports.makeChainNode = makeChainNode; + exports.watchPath = watchPath; + exports.unwatchPath = unwatchPath; - var inDOM = Object.create(_emberViewsViewsStatesHas_element.default); + // get the chains for the current object. If the current object has + // chains inherited from the proto they will be cloned and reconfigured for + // the current object. + function chainsFor(obj, meta) { + return (meta || _emberMetalMeta.meta(obj)).writableChains(makeChainNode); + } - _emberUtils.assign(inDOM, { - enter: function (view) { - // Register the view for event handling. This hash is used by - // Ember.EventDispatcher to dispatch incoming events. - view.renderer.register(view); + function makeChainNode(obj) { + return new _emberMetalChains.ChainNode(null, null, obj); + } - _emberMetal.runInDebug(function () { - _emberMetal._addBeforeObserver(view, 'elementId', function () { - throw new _emberMetal.Error('Changing a view\'s elementId after creation is not allowed'); - }); - }); - }, + function watchPath(obj, keyPath, meta) { + if (typeof obj !== 'object' || obj === null) { + return; + } + var m = meta || _emberMetalMeta.meta(obj); + var counter = m.peekWatching(keyPath) || 0; + if (!counter) { + // activate watching first time + m.writeWatching(keyPath, 1); + chainsFor(obj, m).add(keyPath); + } else { + m.writeWatching(keyPath, counter + 1); + } + } - exit: function (view) { - view.renderer.unregister(view); + function unwatchPath(obj, keyPath, meta) { + if (typeof obj !== 'object' || obj === null) { + return; } - }); + var m = meta || _emberMetalMeta.meta(obj); + var counter = m.peekWatching(keyPath) || 0; - exports.default = inDOM; + if (counter === 1) { + m.writeWatching(keyPath, 0); + chainsFor(obj, m).remove(keyPath); + } else if (counter > 1) { + m.writeWatching(keyPath, counter - 1); + } + } }); -enifed('ember-views/views/states/pre_render', ['exports', 'ember-views/views/states/default'], function (exports, _emberViewsViewsStatesDefault) { - 'use strict'; - +enifed('ember-metal/watching', ['exports', 'ember-metal/watch_key', 'ember-metal/watch_path', 'ember-metal/path_cache', 'ember-metal/meta'], function (exports, _emberMetalWatch_key, _emberMetalWatch_path, _emberMetalPath_cache, _emberMetalMeta) { /** - @module ember - @submodule ember-views + @module ember-metal */ - exports.default = Object.create(_emberViewsViewsStatesDefault.default); -}); -enifed("ember-views/views/view", ["exports"], function (exports) { - "use strict"; -}); -/** -@module ember -@submodule ember-views -*/ + 'use strict'; -/** - `Ember.View` is the class in Ember responsible for encapsulating templates of - HTML content, combining templates with data to render as sections of a page's - DOM, and registering and responding to user-initiated events. + exports.isWatching = isWatching; + exports.watcherCount = watcherCount; + exports.unwatch = unwatch; + exports.destroy = destroy; + + /** + Starts watching a property on an object. Whenever the property changes, + invokes `Ember.propertyWillChange` and `Ember.propertyDidChange`. This is the + primitive used by observers and dependent keys; usually you will never call + this method directly but instead use higher level methods like + `Ember.addObserver()` + + @private + @method watch + @for Ember + @param obj + @param {String} _keyPath + */ + function watch(obj, _keyPath, m) { + if (!_emberMetalPath_cache.isPath(_keyPath)) { + _emberMetalWatch_key.watchKey(obj, _keyPath, m); + } else { + _emberMetalWatch_path.watchPath(obj, _keyPath, m); + } + } - ## HTML Tag + exports.watch = watch; - The default HTML tag name used for a view's DOM representation is `div`. This - can be customized by setting the `tagName` property. The following view - class: + function isWatching(obj, key) { + if (typeof obj !== 'object' || obj === null) { + return false; + } + var meta = _emberMetalMeta.peekMeta(obj); + return (meta && meta.peekWatching(key)) > 0; + } - ```javascript - ParagraphView = Ember.View.extend({ - tagName: 'em' - }); - ``` + function watcherCount(obj, key) { + var meta = _emberMetalMeta.peekMeta(obj); + return meta && meta.peekWatching(key) || 0; + } - Would result in instances with the following HTML: + function unwatch(obj, _keyPath, m) { + if (!_emberMetalPath_cache.isPath(_keyPath)) { + _emberMetalWatch_key.unwatchKey(obj, _keyPath, m); + } else { + _emberMetalWatch_path.unwatchPath(obj, _keyPath, m); + } + } - ```html - - ``` + /** + Tears down the meta on an object so that it can be garbage collected. + Multiple calls will have no effect. + + @method destroy + @for Ember + @param {Object} obj the object to destroy + @return {void} + @private + */ - ## HTML `class` Attribute + function destroy(obj) { + _emberMetalMeta.deleteMeta(obj); + } +}); +enifed('ember-metal/weak_map', ['exports', 'ember-utils', 'ember-metal/meta'], function (exports, _emberUtils, _emberMetalMeta) { + 'use strict'; - The HTML `class` attribute of a view's tag can be set by providing a - `classNames` property that is set to an array of strings: + exports.default = WeakMap; - ```javascript - MyView = Ember.View.extend({ - classNames: ['my-class', 'my-other-class'] - }); - ``` + var id = 0; - Will result in view instances with an HTML representation of: + // Returns whether Type(value) is Object according to the terminology in the spec + function isObject(value) { + return typeof value === 'object' && value !== null || typeof value === 'function'; + } - ```html -
    - ``` + /* + * @class Ember.WeakMap + * @public + * @category ember-metal-weakmap + * + * A partial polyfill for [WeakMap](http://www.ecma-international.org/ecma-262/6.0/#sec-weakmap-objects). + * + * There is a small but important caveat. This implementation assumes that the + * weak map will live longer (in the sense of garbage collection) than all of its + * keys, otherwise it is possible to leak the values stored in the weak map. In + * practice, most use cases satisfy this limitation which is why it is included + * in ember-metal. + */ - `class` attribute values can also be set by providing a `classNameBindings` - property set to an array of properties names for the view. The return value - of these properties will be added as part of the value for the view's `class` - attribute. These properties can be computed properties: + function WeakMap(iterable) { + if (!(this instanceof WeakMap)) { + throw new TypeError('Constructor WeakMap requires \'new\''); + } - ```javascript - MyView = Ember.View.extend({ - classNameBindings: ['propertyA', 'propertyB'], - propertyA: 'from-a', - propertyB: Ember.computed(function() { - if (someLogic) { return 'from-b'; } - }) - }); - ``` + this._id = _emberUtils.GUID_KEY + id++; - Will result in view instances with an HTML representation of: + if (iterable === null || iterable === undefined) { + return; + } else if (Array.isArray(iterable)) { + for (var i = 0; i < iterable.length; i++) { + var _iterable$i = iterable[i]; + var key = _iterable$i[0]; + var value = _iterable$i[1]; - ```html -
    - ``` + this.set(key, value); + } + } else { + throw new TypeError('The weak map constructor polyfill only supports an array argument'); + } + } - If the value of a class name binding returns a boolean the property name - itself will be used as the class name if the property is true. The class name - will not be added if the value is `false` or `undefined`. + /* + * @method get + * @param key {Object | Function} + * @return {Any} stored value + */ + WeakMap.prototype.get = function (obj) { + if (!isObject(obj)) { + return undefined; + } - ```javascript - MyView = Ember.View.extend({ - classNameBindings: ['hovered'], - hovered: true - }); - ``` + var meta = _emberMetalMeta.peekMeta(obj); + if (meta) { + var map = meta.readableWeak(); + if (map) { + if (map[this._id] === _emberMetalMeta.UNDEFINED) { + return undefined; + } - Will result in view instances with an HTML representation of: + return map[this._id]; + } + } + }; - ```html -
    - ``` + /* + * @method set + * @param key {Object | Function} + * @param value {Any} + * @return {WeakMap} the weak map + */ + WeakMap.prototype.set = function (obj, value) { + if (!isObject(obj)) { + throw new TypeError('Invalid value used as weak map key'); + } - When using boolean class name bindings you can supply a string value other - than the property name for use as the `class` HTML attribute by appending the - preferred value after a ":" character when defining the binding: + if (value === undefined) { + value = _emberMetalMeta.UNDEFINED; + } - ```javascript - MyView = Ember.View.extend({ - classNameBindings: ['awesome:so-very-cool'], - awesome: true - }); - ``` + _emberMetalMeta.meta(obj).writableWeak()[this._id] = value; - Will result in view instances with an HTML representation of: + return this; + }; - ```html -
    - ``` + /* + * @method has + * @param key {Object | Function} + * @return {boolean} if the key exists + */ + WeakMap.prototype.has = function (obj) { + if (!isObject(obj)) { + return false; + } - Boolean value class name bindings whose property names are in a - camelCase-style format will be converted to a dasherized format: + var meta = _emberMetalMeta.peekMeta(obj); + if (meta) { + var map = meta.readableWeak(); + if (map) { + return map[this._id] !== undefined; + } + } - ```javascript - MyView = Ember.View.extend({ - classNameBindings: ['isUrgent'], - isUrgent: true - }); - ``` + return false; + }; - Will result in view instances with an HTML representation of: + /* + * @method delete + * @param key {Object | Function} + * @return {boolean} if the key was deleted + */ + WeakMap.prototype.delete = function (obj) { + if (this.has(obj)) { + delete _emberMetalMeta.meta(obj).writableWeak()[this._id]; + return true; + } else { + return false; + } + }; - ```html -
    - ``` + /* + * @method toString + * @return {String} + */ + WeakMap.prototype.toString = function () { + return '[object WeakMap]'; + }; +}); +enifed('ember-routing/ext/controller', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/utils'], function (exports, _emberMetal, _emberRuntime, _emberRoutingUtils) { + 'use strict'; - Class name bindings can also refer to object values that are found by - traversing a path relative to the view itself: + /** + @module ember + @submodule ember-routing + */ - ```javascript - MyView = Ember.View.extend({ - classNameBindings: ['messages.empty'] - messages: Ember.Object.create({ - empty: true - }) - }); - ``` + _emberRuntime.ControllerMixin.reopen({ + concatenatedProperties: ['queryParams'], - Will result in view instances with an HTML representation of: + /** + Defines which query parameters the controller accepts. + If you give the names `['category','page']` it will bind + the values of these query parameters to the variables + `this.category` and `this.page` + @property queryParams + @public + */ + queryParams: null, - ```html -
    - ``` + /** + This property is updated to various different callback functions depending on + the current "state" of the backing route. It is used by + `Ember.Controller.prototype._qpChanged`. + The methods backing each state can be found in the `Ember.Route.prototype._qp` computed + property return value (the `.states` property). The current values are listed here for + the sanity of future travelers: + * `inactive` - This state is used when this controller instance is not part of the active + route heirarchy. Set in `Ember.Route.prototype._reset` (a `router.js` microlib hook) and + `Ember.Route.prototype.actions.finalizeQueryParamChange`. + * `active` - This state is used when this controller instance is part of the active + route heirarchy. Set in `Ember.Route.prototype.actions.finalizeQueryParamChange`. + * `allowOverrides` - This state is used in `Ember.Route.prototype.setup` (`route.js` microlib hook). + @method _qpDelegate + @private + */ + _qpDelegate: null, // set by route - If you want to add a class name for a property which evaluates to true and - and a different class name if it evaluates to false, you can pass a binding - like this: + /** + During `Ember.Route#setup` observers are created to invoke this method + when any of the query params declared in `Ember.Controller#queryParams` property + are changed. + When invoked this method uses the currently active query param update delegate + (see `Ember.Controller.prototype._qpDelegate` for details) and invokes it with + the QP key/value being changed. + @method _qpChanged + @private + */ + _qpChanged: function (controller, _prop) { + var prop = _prop.substr(0, _prop.length - 3); - ```javascript - // Applies 'enabled' class when isEnabled is true and 'disabled' when isEnabled is false - Ember.View.extend({ - classNameBindings: ['isEnabled:enabled:disabled'] - isEnabled: true - }); - ``` + var delegate = controller._qpDelegate; + var value = _emberMetal.get(controller, prop); + delegate(prop, value); + }, - Will result in view instances with an HTML representation of: + /** + Transition the application into another route. The route may + be either a single route or route path: + ```javascript + aController.transitionToRoute('blogPosts'); + aController.transitionToRoute('blogPosts.recentEntries'); + ``` + Optionally supply a model for the route in question. The model + will be serialized into the URL using the `serialize` hook of + the route: + ```javascript + aController.transitionToRoute('blogPost', aPost); + ``` + If a literal is passed (such as a number or a string), it will + be treated as an identifier instead. In this case, the `model` + hook of the route will be triggered: + ```javascript + aController.transitionToRoute('blogPost', 1); + ``` + Multiple models will be applied last to first recursively up the + route tree. + ```javascript + App.Router.map(function() { + this.route('blogPost', { path: ':blogPostId' }, function() { + this.route('blogComment', { path: ':blogCommentId', resetNamespace: true }); + }); + }); + aController.transitionToRoute('blogComment', aPost, aComment); + aController.transitionToRoute('blogComment', 1, 13); + ``` + It is also possible to pass a URL (a string that starts with a + `/`). This is intended for testing and debugging purposes and + should rarely be used in production code. + ```javascript + aController.transitionToRoute('/'); + aController.transitionToRoute('/blog/post/1/comment/13'); + aController.transitionToRoute('/blog/posts?sort=title'); + ``` + An options hash with a `queryParams` property may be provided as + the final argument to add query parameters to the destination URL. + ```javascript + aController.transitionToRoute('blogPost', 1, { + queryParams: { showComments: 'true' } + }); + // if you just want to transition the query parameters without changing the route + aController.transitionToRoute({ queryParams: { sort: 'date' } }); + ``` + See also [replaceRoute](/api/classes/Ember.ControllerMixin.html#method_replaceRoute). + @param {String} name the name of the route or a URL + @param {...Object} models the model(s) or identifier(s) to be used + while transitioning to the route. + @param {Object} [options] optional hash with a queryParams property + containing a mapping of query parameters + @for Ember.ControllerMixin + @method transitionToRoute + @public + */ + transitionToRoute: function () { + // target may be either another controller or a router + var target = _emberMetal.get(this, 'target'); + var method = target.transitionToRoute || target.transitionTo; - ```html -
    - ``` + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - When isEnabled is `false`, the resulting HTML representation looks like - this: + return method.apply(target, _emberRoutingUtils.prefixRouteNameArg(this, args)); + }, - ```html -
    - ``` + /** + Transition into another route while replacing the current URL, if possible. + This will replace the current history entry instead of adding a new one. + Beside that, it is identical to `transitionToRoute` in all other respects. + ```javascript + aController.replaceRoute('blogPosts'); + aController.replaceRoute('blogPosts.recentEntries'); + ``` + Optionally supply a model for the route in question. The model + will be serialized into the URL using the `serialize` hook of + the route: + ```javascript + aController.replaceRoute('blogPost', aPost); + ``` + If a literal is passed (such as a number or a string), it will + be treated as an identifier instead. In this case, the `model` + hook of the route will be triggered: + ```javascript + aController.replaceRoute('blogPost', 1); + ``` + Multiple models will be applied last to first recursively up the + route tree. + ```javascript + App.Router.map(function() { + this.route('blogPost', { path: ':blogPostId' }, function() { + this.route('blogComment', { path: ':blogCommentId', resetNamespace: true }); + }); + }); + aController.replaceRoute('blogComment', aPost, aComment); + aController.replaceRoute('blogComment', 1, 13); + ``` + It is also possible to pass a URL (a string that starts with a + `/`). This is intended for testing and debugging purposes and + should rarely be used in production code. + ```javascript + aController.replaceRoute('/'); + aController.replaceRoute('/blog/post/1/comment/13'); + ``` + @param {String} name the name of the route or a URL + @param {...Object} models the model(s) or identifier(s) to be used + while transitioning to the route. + @for Ember.ControllerMixin + @method replaceRoute + @public + */ + replaceRoute: function () { + // target may be either another controller or a router + var target = _emberMetal.get(this, 'target'); + var method = target.replaceRoute || target.replaceWith; - This syntax offers the convenience to add a class if a property is `false`: + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - ```javascript - // Applies no class when isEnabled is true and class 'disabled' when isEnabled is false - Ember.View.extend({ - classNameBindings: ['isEnabled::disabled'] - isEnabled: true + return method.apply(target, _emberRoutingUtils.prefixRouteNameArg(target, args)); + } }); - ``` - - Will result in view instances with an HTML representation of: - ```html -
    - ``` + exports.default = _emberRuntime.ControllerMixin; +}); +enifed('ember-routing/ext/run_loop', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - When the `isEnabled` property on the view is set to `false`, it will result - in view instances with an HTML representation of: + /** + @module ember + @submodule ember-views + */ - ```html -
    - ``` + // Add a new named queue after the 'actions' queue (where RSVP promises + // resolve), which is used in router transitions to prevent unnecessary + // loading state entry if all context promises resolve on the + // 'actions' queue first. + _emberMetal.run._addQueue('routerTransitions', 'actions'); +}); +enifed('ember-routing/index', ['exports', '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/system/query_params', 'ember-routing/services/routing', 'ember-routing/services/router', 'ember-routing/system/cache'], function (exports, _emberRoutingExtRun_loop, _emberRoutingExtController, _emberRoutingLocationApi, _emberRoutingLocationNone_location, _emberRoutingLocationHash_location, _emberRoutingLocationHistory_location, _emberRoutingLocationAuto_location, _emberRoutingSystemGenerate_controller, _emberRoutingSystemController_for, _emberRoutingSystemDsl, _emberRoutingSystemRouter, _emberRoutingSystemRoute, _emberRoutingSystemQuery_params, _emberRoutingServicesRouting, _emberRoutingServicesRouter, _emberRoutingSystemCache) { + /** + @module ember + @submodule ember-routing + */ - Updates to the value of a class name binding will result in automatic - update of the HTML `class` attribute in the view's rendered HTML - representation. If the value becomes `false` or `undefined` the class name - will be removed. + // ES6TODO: Cleanup modules with side-effects below + 'use strict'; - Both `classNames` and `classNameBindings` are concatenated properties. See - [Ember.Object](/api/classes/Ember.Object.html) documentation for more - information about concatenated properties. + exports.Location = _emberRoutingLocationApi.default; + exports.NoneLocation = _emberRoutingLocationNone_location.default; + exports.HashLocation = _emberRoutingLocationHash_location.default; + exports.HistoryLocation = _emberRoutingLocationHistory_location.default; + exports.AutoLocation = _emberRoutingLocationAuto_location.default; + exports.generateController = _emberRoutingSystemGenerate_controller.default; + exports.generateControllerFactory = _emberRoutingSystemGenerate_controller.generateControllerFactory; + exports.controllerFor = _emberRoutingSystemController_for.default; + exports.RouterDSL = _emberRoutingSystemDsl.default; + exports.Router = _emberRoutingSystemRouter.default; + exports.Route = _emberRoutingSystemRoute.default; + exports.QueryParams = _emberRoutingSystemQuery_params.default; + exports.RoutingService = _emberRoutingServicesRouting.default; + exports.RouterService = _emberRoutingServicesRouter.default; + exports.BucketCache = _emberRoutingSystemCache.default; +}); +enifed('ember-routing/location/api', ['exports', 'ember-metal', 'ember-environment', 'ember-routing/location/util'], function (exports, _emberMetal, _emberEnvironment, _emberRoutingLocationUtil) { + 'use strict'; - ## HTML Attributes + /** + @module ember + @submodule ember-routing + */ - The HTML attribute section of a view's tag can be set by providing an - `attributeBindings` property set to an array of property names on the view. - The return value of these properties will be used as the value of the view's - HTML associated attribute: + /** + Ember.Location returns an instance of the correct implementation of + the `location` API. + + ## Implementations + + You can pass an implementation name (`hash`, `history`, `none`) to force a + particular implementation to be used in your application. + + ### HashLocation + + Using `HashLocation` results in URLs with a `#` (hash sign) separating the + server side URL portion of the URL from the portion that is used by Ember. + This relies upon the `hashchange` event existing in the browser. + + Example: + + ```javascript + App.Router.map(function() { + this.route('posts', function() { + this.route('new'); + }); + }); + + App.Router.reopen({ + location: 'hash' + }); + ``` + + This will result in a posts.new url of `/#/posts/new`. + + ### HistoryLocation + + Using `HistoryLocation` results in URLs that are indistinguishable from a + standard URL. This relies upon the browser's `history` API. + + Example: + + ```javascript + App.Router.map(function() { + this.route('posts', function() { + this.route('new'); + }); + }); + + App.Router.reopen({ + location: 'history' + }); + ``` + + This will result in a posts.new url of `/posts/new`. + + Keep in mind that your server must serve the Ember app at all the routes you + define. + + ### AutoLocation + + Using `AutoLocation`, the router will use the best Location class supported by + the browser it is running in. + + Browsers that support the `history` API will use `HistoryLocation`, those that + do not, but still support the `hashchange` event will use `HashLocation`, and + in the rare case neither is supported will use `NoneLocation`. + + Example: + + ```javascript + App.Router.map(function() { + this.route('posts', function() { + this.route('new'); + }); + }); + + App.Router.reopen({ + location: 'auto' + }); + ``` + + This will result in a posts.new url of `/posts/new` for modern browsers that + support the `history` api or `/#/posts/new` for older ones, like Internet + Explorer 9 and below. + + When a user visits a link to your application, they will be automatically + upgraded or downgraded to the appropriate `Location` class, with the URL + transformed accordingly, if needed. + + Keep in mind that since some of your users will use `HistoryLocation`, your + server must serve the Ember app at all the routes you define. + + ### NoneLocation + + Using `NoneLocation` causes Ember to not store the applications URL state + in the actual URL. This is generally used for testing purposes, and is one + of the changes made when calling `App.setupForTesting()`. + + ## Location API + + Each location implementation must provide the following methods: + + * implementation: returns the string name used to reference the implementation. + * getURL: returns the current URL. + * setURL(path): sets the current URL. + * replaceURL(path): replace the current URL (optional). + * onUpdateURL(callback): triggers the callback when the URL changes. + * formatURL(url): formats `url` to be placed into `href` attribute. + * detect() (optional): instructs the location to do any feature detection + necessary. If the location needs to redirect to a different URL, it + can cancel routing by setting the `cancelRouterSetup` property on itself + to `false`. + + Calling setURL or replaceURL will not trigger onUpdateURL callbacks. + + ## Custom implementation + + Ember scans `app/locations/*` for extending the Location API. + + Example: + + ```javascript + import Ember from 'ember'; + + export default Ember.HistoryLocation.extend({ + implementation: 'history-url-logging', + + pushState: function (path) { + console.log(path); + this._super.apply(this, arguments); + } + }); + ``` + + @class Location + @namespace Ember + @static + @private + */ + exports.default = { + /** + This is deprecated in favor of using the container to lookup the location + implementation as desired. + For example: + ```javascript + // Given a location registered as follows: + container.register('location:history-test', HistoryTestLocation); + // You could create a new instance via: + container.lookup('location:history-test'); + ``` + @method create + @param {Object} options + @return {Object} an instance of an implementation of the `location` API + @deprecated Use the container to lookup the location implementation that you + need. + @private + */ + create: function (options) { + var implementation = options && options.implementation; + _emberMetal.assert('Ember.Location.create: you must specify a \'implementation\' option', !!implementation); - ```javascript - AnchorView = Ember.View.extend({ - tagName: 'a', - attributeBindings: ['href'], - href: 'http://google.com' - }); - ``` + var implementationClass = this.implementations[implementation]; + _emberMetal.assert('Ember.Location.create: ' + implementation + ' is not a valid implementation', !!implementationClass); - Will result in view instances with an HTML representation of: + return implementationClass.create.apply(implementationClass, arguments); + }, - ```html - - ``` + implementations: {}, + _location: _emberEnvironment.environment.location, - One property can be mapped on to another by placing a ":" between - the source property and the destination property: + /** + Returns the current `location.hash` by parsing location.href since browsers + inconsistently URL-decode `location.hash`. + https://bugzilla.mozilla.org/show_bug.cgi?id=483304 + @private + @method getHash + @since 1.4.0 + */ + _getHash: function () { + return _emberRoutingLocationUtil.getHash(this.location); + } + }; +}); +enifed('ember-routing/location/auto_location', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-environment', 'ember-routing/location/util'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberEnvironment, _emberRoutingLocationUtil) { + 'use strict'; - ```javascript - AnchorView = Ember.View.extend({ - tagName: 'a', - attributeBindings: ['url:href'], - url: 'http://google.com' - }); - ``` + exports.getHistoryPath = getHistoryPath; + exports.getHashPath = getHashPath; - Will result in view instances with an HTML representation of: + /** + @module ember + @submodule ember-routing + */ - ```html - - ``` + /** + Ember.AutoLocation will select the best location option based off browser + support with the priority order: history, hash, none. + + Clean pushState paths accessed by hashchange-only browsers will be redirected + to the hash-equivalent and vice versa so future transitions are consistent. + + Keep in mind that since some of your users will use `HistoryLocation`, your + server must serve the Ember app at all the routes you define. + + @class AutoLocation + @namespace Ember + @static + @private + */ + exports.default = _emberRuntime.Object.extend({ + /** + @private + The browser's `location` object. This is typically equivalent to + `window.location`, but may be overridden for testing. + @property location + @default environment.location + */ + location: _emberEnvironment.environment.location, - Namespaced attributes (e.g. `xlink:href`) are supported, but have to be - mapped, since `:` is not a valid character for properties in Javascript: + /** + @private + The browser's `history` object. This is typically equivalent to + `window.history`, but may be overridden for testing. + @since 1.5.1 + @property history + @default environment.history + */ + history: _emberEnvironment.environment.history, - ```javascript - UseView = Ember.View.extend({ - tagName: 'use', - attributeBindings: ['xlinkHref:xlink:href'], - xlinkHref: '#triangle' - }); - ``` - Will result in view instances with an HTML representation of: + /** + @private + The user agent's global variable. In browsers, this will be `window`. + @since 1.11 + @property global + @default window + */ + global: _emberEnvironment.environment.window, - ```html - - ``` + /** + @private + The browser's `userAgent`. This is typically equivalent to + `navigator.userAgent`, but may be overridden for testing. + @since 1.5.1 + @property userAgent + @default environment.history + */ + userAgent: _emberEnvironment.environment.userAgent, - If the return value of an `attributeBindings` monitored property is a boolean - the attribute will be present or absent depending on the value: + /** + @private + This property is used by the router to know whether to cancel the routing + setup process, which is needed while we redirect the browser. + @since 1.5.1 + @property cancelRouterSetup + @default false + */ + cancelRouterSetup: false, - ```javascript - MyTextInput = Ember.View.extend({ - tagName: 'input', - attributeBindings: ['disabled'], - disabled: false - }); - ``` + /** + @private + Will be pre-pended to path upon state change. + @since 1.5.1 + @property rootURL + @default '/' + */ + rootURL: '/', - Will result in a view instance with an HTML representation of: + /** + Called by the router to instruct the location to do any feature detection + necessary. In the case of AutoLocation, we detect whether to use history + or hash concrete implementations. + @private + */ + detect: function () { + var rootURL = this.rootURL; - ```html - - ``` + _emberMetal.assert('rootURL must end with a trailing forward slash e.g. "/app/"', rootURL.charAt(rootURL.length - 1) === '/'); - `attributeBindings` can refer to computed properties: + var implementation = detectImplementation({ + location: this.location, + history: this.history, + userAgent: this.userAgent, + rootURL: rootURL, + documentMode: this.documentMode, + global: this.global + }); - ```javascript - MyTextInput = Ember.View.extend({ - tagName: 'input', - attributeBindings: ['disabled'], - disabled: Ember.computed(function() { - if (someLogic) { - return true; - } else { - return false; + if (implementation === false) { + _emberMetal.set(this, 'cancelRouterSetup', true); + implementation = 'none'; } - }) - }); - ``` - - To prevent setting an attribute altogether, use `null` or `undefined` as the - return value of the `attributeBindings` monitored property: - - ```javascript - MyTextInput = Ember.View.extend({ - tagName: 'form', - attributeBindings: ['novalidate'], - novalidate: null - }); - ``` - - Updates to the property of an attribute binding will result in automatic - update of the HTML attribute in the view's rendered HTML representation. - - `attributeBindings` is a concatenated property. See [Ember.Object](/api/classes/Ember.Object.html) - documentation for more information about concatenated properties. - ## Layouts + var concrete = _emberUtils.getOwner(this).lookup('location:' + implementation); + _emberMetal.set(concrete, 'rootURL', rootURL); - Views can have a secondary template that wraps their main template. Like - primary templates, layouts can be any function that accepts an optional - context parameter and returns a string of HTML that will be inserted inside - view's tag. Views whose HTML element is self closing (e.g. ``) - cannot have a layout and this property will be ignored. + _emberMetal.assert('Could not find location \'' + implementation + '\'.', !!concrete); - Most typically in Ember a layout will be a compiled template. + _emberMetal.set(this, 'concreteImplementation', concrete); + }, - A view's layout can be set directly with the `layout` property or reference - an existing template by name with the `layoutName` property. + initState: delegateToConcreteImplementation('initState'), + getURL: delegateToConcreteImplementation('getURL'), + setURL: delegateToConcreteImplementation('setURL'), + replaceURL: delegateToConcreteImplementation('replaceURL'), + onUpdateURL: delegateToConcreteImplementation('onUpdateURL'), + formatURL: delegateToConcreteImplementation('formatURL'), - A template used as a layout must contain a single use of the - `{{yield}}` helper. The HTML contents of a view's rendered `template` will be - inserted at this location: + willDestroy: function () { + var concreteImplementation = _emberMetal.get(this, 'concreteImplementation'); - ```javascript - AViewWithLayout = Ember.View.extend({ - layout: Ember.HTMLBars.compile("
    {{yield}}
    "), - template: Ember.HTMLBars.compile("I got wrapped") + if (concreteImplementation) { + concreteImplementation.destroy(); + } + } }); - ``` - - Will result in view instances with an HTML representation of: - ```html -
    -
    - I got wrapped -
    -
    - ``` - - See [Ember.Templates.helpers.yield](/api/classes/Ember.Templates.helpers.html#method_yield) - for more information. - - ## Responding to Browser Events - - Views can respond to user-initiated events in one of three ways: method - implementation, through an event manager, and through `{{action}}` helper use - in their template or layout. - - ### Method Implementation + function delegateToConcreteImplementation(methodName) { + return function () { + var concreteImplementation = _emberMetal.get(this, 'concreteImplementation'); + _emberMetal.assert('AutoLocation\'s detect() method should be called before calling any other hooks.', !!concreteImplementation); - Views can respond to user-initiated events by implementing a method that - matches the event name. A `jQuery.Event` object will be passed as the - argument to this method. + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - ```javascript - AView = Ember.View.extend({ - click: function(event) { - // will be called when an instance's - // rendered element is clicked - } - }); - ``` + return _emberUtils.tryInvoke(concreteImplementation, methodName, args); + }; + } - ### Event Managers + /* + Given the browser's `location`, `history` and `userAgent`, and a configured + root URL, this function detects whether the browser supports the [History + API](https://developer.mozilla.org/en-US/docs/Web/API/History) and returns a + string representing the Location object to use based on its determination. + + For example, if the page loads in an evergreen browser, this function would + return the string "history", meaning the history API and thus HistoryLocation + should be used. If the page is loaded in IE8, it will return the string + "hash," indicating that the History API should be simulated by manipulating the + hash portion of the location. + + */ - Views can define an object as their `eventManager` property. This object can - then implement methods that match the desired event names. Matching events - that occur on the view's rendered HTML or the rendered HTML of any of its DOM - descendants will trigger this method. A `jQuery.Event` object will be passed - as the first argument to the method and an `Ember.View` object as the - second. The `Ember.View` will be the view whose rendered HTML was interacted - with. This may be the view with the `eventManager` property or one of its - descendant views. + function detectImplementation(options) { + var location = options.location; + var userAgent = options.userAgent; + var history = options.history; + var documentMode = options.documentMode; + var global = options.global; + var rootURL = options.rootURL; - ```javascript - AView = Ember.View.extend({ - eventManager: Ember.Object.create({ - doubleClick: function(event, view) { - // will be called when an instance's - // rendered element or any rendering - // of this view's descendant - // elements is clicked - } - }) - }); - ``` + var implementation = 'none'; + var cancelRouterSetup = false; + var currentPath = _emberRoutingLocationUtil.getFullPath(location); - An event defined for an event manager takes precedence over events of the - same name handled through methods on the view. + if (_emberRoutingLocationUtil.supportsHistory(userAgent, history)) { + var historyPath = getHistoryPath(rootURL, location); - ```javascript - AView = Ember.View.extend({ - mouseEnter: function(event) { - // will never trigger. - }, - eventManager: Ember.Object.create({ - mouseEnter: function(event, view) { - // takes precedence over AView#mouseEnter + // If the browser supports history and we have a history path, we can use + // the history location with no redirects. + if (currentPath === historyPath) { + return 'history'; + } else { + if (currentPath.substr(0, 2) === '/#') { + history.replaceState({ path: historyPath }, null, historyPath); + implementation = 'history'; + } else { + cancelRouterSetup = true; + _emberRoutingLocationUtil.replacePath(location, historyPath); + } } - }) - }); - ``` - - Similarly a view's event manager will take precedence for events of any views - rendered as a descendant. A method name that matches an event name will not - be called if the view instance was rendered inside the HTML representation of - a view that has an `eventManager` property defined that handles events of the - name. Events not handled by the event manager will still trigger method calls - on the descendant. + } else if (_emberRoutingLocationUtil.supportsHashChange(documentMode, global)) { + var hashPath = getHashPath(rootURL, location); - ```javascript - var App = Ember.Application.create(); - App.OuterView = Ember.View.extend({ - template: Ember.HTMLBars.compile("outer {{#view 'inner'}}inner{{/view}} outer"), - eventManager: Ember.Object.create({ - mouseEnter: function(event, view) { - // view might be instance of either - // OuterView or InnerView depending on - // where on the page the user interaction occurred + // Be sure we're using a hashed path, otherwise let's switch over it to so + // we start off clean and consistent. We'll count an index path with no + // hash as "good enough" as well. + if (currentPath === hashPath || currentPath === '/' && hashPath === '/#/') { + implementation = 'hash'; + } else { + // Our URL isn't in the expected hash-supported format, so we want to + // cancel the router setup and replace the URL to start off clean + cancelRouterSetup = true; + _emberRoutingLocationUtil.replacePath(location, hashPath); } - }) - }); - - App.InnerView = Ember.View.extend({ - click: function(event) { - // will be called if rendered inside - // an OuterView because OuterView's - // eventManager doesn't handle click events - }, - mouseEnter: function(event) { - // will never be called if rendered inside - // an OuterView. } - }); - ``` - - ### `{{action}}` Helper - - See [Ember.Templates.helpers.action](/api/classes/Ember.Templates.helpers.html#method_action). - - ### Event Names - - All of the event handling approaches described above respond to the same set - of events. The names of the built-in events are listed below. (The hash of - built-in events exists in `Ember.EventDispatcher`.) Additional, custom events - can be registered by using `Ember.Application.customEvents`. - - Touch events: - - * `touchStart` - * `touchMove` - * `touchEnd` - * `touchCancel` - - Keyboard events - - * `keyDown` - * `keyUp` - * `keyPress` - - Mouse events - - * `mouseDown` - * `mouseUp` - * `contextMenu` - * `click` - * `doubleClick` - * `mouseMove` - * `focusIn` - * `focusOut` - * `mouseEnter` - * `mouseLeave` - - Form events: - - * `submit` - * `change` - * `focusIn` - * `focusOut` - * `input` - - HTML5 drag and drop events: - - * `dragStart` - * `drag` - * `dragEnter` - * `dragLeave` - * `dragOver` - * `dragEnd` - * `drop` - - @class View - @namespace Ember - @extends Ember.CoreView - @deprecated See http://emberjs.com/deprecations/v1.x/#toc_ember-view - @uses Ember.ViewSupport - @uses Ember.ChildViewsSupport - @uses Ember.ClassNamesSupport - @uses Ember.AttributeBindingsSupport - @private -*/ -enifed("ember/features", ["exports"], function (exports) { - "use strict"; - - exports.default = { "features-stripped-test": false, "ember-libraries-isregistered": false, "ember-runtime-computed-uniq-by": true, "ember-improved-instrumentation": false, "ember-runtime-enumerable-includes": true, "ember-string-ishtmlsafe": true, "ember-testing-check-waiters": true, "ember-metal-weakmap": false, "ember-glimmer-allow-backtracking-rerender": true, "ember-testing-resume-test": false, "ember-glimmer-detect-backtracking-rerender": true, "mandatory-setter": true }; -}); -enifed('ember/index', ['exports', 'require', 'ember-environment', 'ember-utils', 'container', 'ember-metal', 'backburner', 'ember-console', 'ember-runtime', 'ember-glimmer', 'ember/version', 'ember-views', 'ember-routing', 'ember-application', 'ember-extension-support'], function (exports, _require, _emberEnvironment, _emberUtils, _container, _emberMetal, _backburner, _emberConsole, _emberRuntime, _emberGlimmer, _emberVersion, _emberViews, _emberRouting, _emberApplication, _emberExtensionSupport) { - 'use strict'; - - // ember-utils exports - _emberMetal.default.getOwner = _emberUtils.getOwner; - _emberMetal.default.setOwner = _emberUtils.setOwner; - _emberMetal.default.generateGuid = _emberUtils.generateGuid; - _emberMetal.default.GUID_KEY = _emberUtils.GUID_KEY; - _emberMetal.default.guidFor = _emberUtils.guidFor; - _emberMetal.default.inspect = _emberUtils.inspect; - _emberMetal.default.makeArray = _emberUtils.makeArray; - _emberMetal.default.canInvoke = _emberUtils.canInvoke; - _emberMetal.default.tryInvoke = _emberUtils.tryInvoke; - _emberMetal.default.wrap = _emberUtils.wrap; - _emberMetal.default.applyStr = _emberUtils.applyStr; - _emberMetal.default.uuid = _emberUtils.uuid; - _emberMetal.default.assign = Object.assign || _emberUtils.assign; - - // container exports - _emberMetal.default.Container = _container.Container; - _emberMetal.default.Registry = _container.Registry; - - // need to import this directly, to ensure the babel feature - // flag plugin works properly - - var computed = _emberMetal.computed; - computed.alias = _emberMetal.alias; - _emberMetal.default.computed = computed; - _emberMetal.default.ComputedProperty = _emberMetal.ComputedProperty; - _emberMetal.default.cacheFor = _emberMetal.cacheFor; - - _emberMetal.default.assert = _emberMetal.assert; - _emberMetal.default.warn = _emberMetal.warn; - _emberMetal.default.debug = _emberMetal.debug; - _emberMetal.default.deprecate = _emberMetal.deprecate; - _emberMetal.default.deprecateFunc = _emberMetal.deprecateFunc; - _emberMetal.default.runInDebug = _emberMetal.runInDebug; - _emberMetal.default.merge = _emberMetal.merge; - - _emberMetal.default.instrument = _emberMetal.instrument; - _emberMetal.default.subscribe = _emberMetal.instrumentationSubscribe; - _emberMetal.default.Instrumentation = { - instrument: _emberMetal.instrument, - subscribe: _emberMetal.instrumentationSubscribe, - unsubscribe: _emberMetal.instrumentationUnsubscribe, - reset: _emberMetal.instrumentationReset - }; - _emberMetal.default.Error = _emberMetal.Error; - _emberMetal.default.META_DESC = _emberMetal.META_DESC; - _emberMetal.default.meta = _emberMetal.meta; - _emberMetal.default.get = _emberMetal.get; - _emberMetal.default.getWithDefault = _emberMetal.getWithDefault; - _emberMetal.default._getPath = _emberMetal._getPath; - _emberMetal.default.set = _emberMetal.set; - _emberMetal.default.trySet = _emberMetal.trySet; - _emberMetal.default.FEATURES = _emberMetal.FEATURES; - _emberMetal.default.FEATURES.isEnabled = _emberMetal.isFeatureEnabled; - _emberMetal.default._Cache = _emberMetal.Cache; - _emberMetal.default.on = _emberMetal.on; - _emberMetal.default.addListener = _emberMetal.addListener; - _emberMetal.default.removeListener = _emberMetal.removeListener; - _emberMetal.default._suspendListener = _emberMetal.suspendListener; - _emberMetal.default._suspendListeners = _emberMetal.suspendListeners; - _emberMetal.default.sendEvent = _emberMetal.sendEvent; - _emberMetal.default.hasListeners = _emberMetal.hasListeners; - _emberMetal.default.watchedEvents = _emberMetal.watchedEvents; - _emberMetal.default.listenersFor = _emberMetal.listenersFor; - _emberMetal.default.accumulateListeners = _emberMetal.accumulateListeners; - _emberMetal.default.isNone = _emberMetal.isNone; - _emberMetal.default.isEmpty = _emberMetal.isEmpty; - _emberMetal.default.isBlank = _emberMetal.isBlank; - _emberMetal.default.isPresent = _emberMetal.isPresent; - _emberMetal.default.run = _emberMetal.run; - _emberMetal.default._ObserverSet = _emberMetal.ObserverSet; - _emberMetal.default.propertyWillChange = _emberMetal.propertyWillChange; - _emberMetal.default.propertyDidChange = _emberMetal.propertyDidChange; - _emberMetal.default.overrideChains = _emberMetal.overrideChains; - _emberMetal.default.beginPropertyChanges = _emberMetal.beginPropertyChanges; - _emberMetal.default.endPropertyChanges = _emberMetal.endPropertyChanges; - _emberMetal.default.changeProperties = _emberMetal.changeProperties; - _emberMetal.default.platform = { - defineProperty: true, - hasPropertyAccessors: true - }; - _emberMetal.default.defineProperty = _emberMetal.defineProperty; - _emberMetal.default.watchKey = _emberMetal.watchKey; - _emberMetal.default.unwatchKey = _emberMetal.unwatchKey; - _emberMetal.default.removeChainWatcher = _emberMetal.removeChainWatcher; - _emberMetal.default._ChainNode = _emberMetal.ChainNode; - _emberMetal.default.finishChains = _emberMetal.finishChains; - _emberMetal.default.watchPath = _emberMetal.watchPath; - _emberMetal.default.unwatchPath = _emberMetal.unwatchPath; - _emberMetal.default.watch = _emberMetal.watch; - _emberMetal.default.isWatching = _emberMetal.isWatching; - _emberMetal.default.unwatch = _emberMetal.unwatch; - _emberMetal.default.destroy = _emberMetal.destroy; - _emberMetal.default.libraries = _emberMetal.libraries; - _emberMetal.default.OrderedSet = _emberMetal.OrderedSet; - _emberMetal.default.Map = _emberMetal.Map; - _emberMetal.default.MapWithDefault = _emberMetal.MapWithDefault; - _emberMetal.default.getProperties = _emberMetal.getProperties; - _emberMetal.default.setProperties = _emberMetal.setProperties; - _emberMetal.default.expandProperties = _emberMetal.expandProperties; - _emberMetal.default.NAME_KEY = _emberMetal.NAME_KEY; - _emberMetal.default.addObserver = _emberMetal.addObserver; - _emberMetal.default.observersFor = _emberMetal.observersFor; - _emberMetal.default.removeObserver = _emberMetal.removeObserver; - _emberMetal.default._suspendObserver = _emberMetal._suspendObserver; - _emberMetal.default._suspendObservers = _emberMetal._suspendObservers; - _emberMetal.default.required = _emberMetal.required; - _emberMetal.default.aliasMethod = _emberMetal.aliasMethod; - _emberMetal.default.observer = _emberMetal.observer; - _emberMetal.default.immediateObserver = _emberMetal._immediateObserver; - _emberMetal.default.mixin = _emberMetal.mixin; - _emberMetal.default.Mixin = _emberMetal.Mixin; - _emberMetal.default.bind = _emberMetal.bind; - _emberMetal.default.Binding = _emberMetal.Binding; - _emberMetal.default.isGlobalPath = _emberMetal.isGlobalPath; + if (cancelRouterSetup) { + return false; + } - if (false) { - _emberMetal.default.WeakMap = _emberMetal.WeakMap; + return implementation; } - Object.defineProperty(_emberMetal.default, 'ENV', { - get: function () { - return _emberEnvironment.ENV; - }, - enumerable: false - }); - /** - The context that Ember searches for namespace instances on. + @private - @private - */ - Object.defineProperty(_emberMetal.default, 'lookup', { - get: function () { - return _emberEnvironment.context.lookup; - }, - set: function (value) { - _emberEnvironment.context.lookup = value; - }, - enumerable: false - }); + Returns the current path as it should appear for HistoryLocation supported + browsers. This may very well differ from the real current path (e.g. if it + starts off as a hashed URL) + */ - _emberMetal.default.EXTEND_PROTOTYPES = _emberEnvironment.ENV.EXTEND_PROTOTYPES; + function getHistoryPath(rootURL, location) { + var path = _emberRoutingLocationUtil.getPath(location); + var hash = _emberRoutingLocationUtil.getHash(location); + var query = _emberRoutingLocationUtil.getQuery(location); + var rootURLIndex = path.indexOf(rootURL); + var routeHash = undefined, + hashParts = undefined; - // BACKWARDS COMPAT ACCESSORS FOR ENV FLAGS - Object.defineProperty(_emberMetal.default, 'LOG_STACKTRACE_ON_DEPRECATION', { - get: function () { - return _emberEnvironment.ENV.LOG_STACKTRACE_ON_DEPRECATION; - }, - set: function (value) { - _emberEnvironment.ENV.LOG_STACKTRACE_ON_DEPRECATION = !!value; - }, - enumerable: false - }); + _emberMetal.assert('Path ' + path + ' does not start with the provided rootURL ' + rootURL, rootURLIndex === 0); - Object.defineProperty(_emberMetal.default, 'LOG_VERSION', { - get: function () { - return _emberEnvironment.ENV.LOG_VERSION; - }, - set: function (value) { - _emberEnvironment.ENV.LOG_VERSION = !!value; - }, - enumerable: false - }); + // By convention, Ember.js routes using HashLocation are required to start + // with `#/`. Anything else should NOT be considered a route and should + // be passed straight through, without transformation. + if (hash.substr(0, 2) === '#/') { + // There could be extra hash segments after the route + hashParts = hash.substr(1).split('#'); + // The first one is always the route url + routeHash = hashParts.shift(); - Object.defineProperty(_emberMetal.default, 'MODEL_FACTORY_INJECTIONS', { - get: function () { - return _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS; - }, - set: function (value) { - _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS = !!value; - }, - enumerable: false - }); + // If the path already has a trailing slash, remove the one + // from the hashed route so we don't double up. + if (path.charAt(path.length - 1) === '/') { + routeHash = routeHash.substr(1); + } + + // This is the "expected" final order + path += routeHash + query; + + if (hashParts.length) { + path += '#' + hashParts.join('#'); + } + } else { + path += query + hash; + } - Object.defineProperty(_emberMetal.default, 'LOG_BINDINGS', { - get: function () { - return _emberEnvironment.ENV.LOG_BINDINGS; - }, - set: function (value) { - _emberEnvironment.ENV.LOG_BINDINGS = !!value; - }, - enumerable: false - }); + return path; + } /** - A function may be assigned to `Ember.onerror` to be called when Ember - internals encounter an error. This is useful for specialized error handling - and reporting code. - - ```javascript - Ember.onerror = function(error) { - Em.$.ajax('/report-error', 'POST', { - stack: error.stack, - otherInformation: 'whatever app state you want to provide' - }); - }; - ``` + @private - Internally, `Ember.onerror` is used as Backburner's error handler. + Returns the current path as it should appear for HashLocation supported + browsers. This may very well differ from the real current path. - @event onerror - @for Ember - @param {Exception} error the error object - @public + @method _getHashPath */ - Object.defineProperty(_emberMetal.default, 'onerror', { - get: _emberMetal.getOnerror, - set: _emberMetal.setOnerror, - enumerable: false - }); + + function getHashPath(rootURL, location) { + var path = rootURL; + var historyPath = getHistoryPath(rootURL, location); + var routePath = historyPath.substr(rootURL.length); + + if (routePath !== '') { + if (routePath[0] !== '/') { + routePath = '/' + routePath; + } + + path += '#' + routePath; + } + + return path; + } +}); +enifed('ember-routing/location/hash_location', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/location/api'], function (exports, _emberMetal, _emberRuntime, _emberRoutingLocationApi) { + 'use strict'; /** - An empty function useful for some operations. Always returns `this`. + @module ember + @submodule ember-routing + */ + + /** + `Ember.HashLocation` implements the location API using the browser's + hash. At present, it relies on a `hashchange` event existing in the + browser. - @method K - @return {Object} - @public + @class HashLocation + @namespace Ember + @extends Ember.Object + @private */ - _emberMetal.default.K = function K() { - return this; - }; + exports.default = _emberRuntime.Object.extend({ + implementation: 'hash', - Object.defineProperty(_emberMetal.default, 'testing', { - get: _emberMetal.isTesting, - set: _emberMetal.setTesting, - enumerable: false - }); + init: function () { + _emberMetal.set(this, 'location', _emberMetal.get(this, '_location') || window.location); - if (!_require.has('ember-debug')) { - _emberMetal.default.Debug = { - registerDeprecationHandler: function () {}, - registerWarnHandler: function () {} - }; - } + this._hashchangeHandler = undefined; + }, - /** - @class Backburner - @for Ember - @private - */ - _emberMetal.default.Backburner = function () { - _emberMetal.deprecate('Usage of Ember.Backburner is deprecated.', false, { - id: 'ember-metal.ember-backburner', - until: '2.8.0', - url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-backburner' - }); + /** + @private + Returns normalized location.hash + @since 1.5.1 + @method getHash + */ + getHash: _emberRoutingLocationApi.default._getHash, - function BackburnerAlias(args) { - return _backburner.default.apply(this, args); - } + /** + Returns the normalized URL, constructed from `location.hash`. + e.g. `#/foo` => `/foo` as well as `#/foo#bar` => `/foo#bar`. + By convention, hashed paths must begin with a forward slash, otherwise they + are not treated as a path so we can distinguish intent. + @private + @method getURL + */ + getURL: function () { + var originalPath = this.getHash().substr(1); + var outPath = originalPath; - BackburnerAlias.prototype = _backburner.default.prototype; + if (outPath[0] !== '/') { + outPath = '/'; - return new BackburnerAlias(arguments); - }; + // Only add the # if the path isn't empty. + // We do NOT want `/#` since the ampersand + // is only included (conventionally) when + // the location.hash has a value + if (originalPath) { + outPath += '#' + originalPath; + } + } - _emberMetal.default._Backburner = _backburner.default; + return outPath; + }, - _emberMetal.default.Logger = _emberConsole.default; + /** + Set the `location.hash` and remembers what was set. This prevents + `onUpdateURL` callbacks from triggering when the hash was set by + `HashLocation`. + @private + @method setURL + @param path {String} + */ + setURL: function (path) { + _emberMetal.get(this, 'location').hash = path; + _emberMetal.set(this, 'lastSetURL', path); + }, - // ****ember-runtime**** + /** + Uses location.replace to update the url without a page reload + or history modification. + @private + @method replaceURL + @param path {String} + */ + replaceURL: function (path) { + _emberMetal.get(this, 'location').replace('#' + path); + _emberMetal.set(this, 'lastSetURL', path); + }, - _emberMetal.default.String = _emberRuntime.String; - _emberMetal.default.Object = _emberRuntime.Object; - _emberMetal.default._RegistryProxyMixin = _emberRuntime.RegistryProxyMixin; - _emberMetal.default._ContainerProxyMixin = _emberRuntime.ContainerProxyMixin; - _emberMetal.default.compare = _emberRuntime.compare; - _emberMetal.default.copy = _emberRuntime.copy; - _emberMetal.default.isEqual = _emberRuntime.isEqual; - _emberMetal.default.inject = _emberRuntime.inject; - _emberMetal.default.Array = _emberRuntime.Array; - _emberMetal.default.Comparable = _emberRuntime.Comparable; - _emberMetal.default.Enumerable = _emberRuntime.Enumerable; - _emberMetal.default.ArrayProxy = _emberRuntime.ArrayProxy; - _emberMetal.default.ObjectProxy = _emberRuntime.ObjectProxy; - _emberMetal.default.ActionHandler = _emberRuntime.ActionHandler; - _emberMetal.default.CoreObject = _emberRuntime.CoreObject; - _emberMetal.default.NativeArray = _emberRuntime.NativeArray; - _emberMetal.default.Copyable = _emberRuntime.Copyable; - _emberMetal.default.Freezable = _emberRuntime.Freezable; - _emberMetal.default.FROZEN_ERROR = _emberRuntime.FROZEN_ERROR; - _emberMetal.default.MutableEnumerable = _emberRuntime.MutableEnumerable; - _emberMetal.default.MutableArray = _emberRuntime.MutableArray; - _emberMetal.default.TargetActionSupport = _emberRuntime.TargetActionSupport; - _emberMetal.default.Evented = _emberRuntime.Evented; - _emberMetal.default.PromiseProxyMixin = _emberRuntime.PromiseProxyMixin; - _emberMetal.default.Observable = _emberRuntime.Observable; - _emberMetal.default.typeOf = _emberRuntime.typeOf; - _emberMetal.default.isArray = _emberRuntime.isArray; - _emberMetal.default.Object = _emberRuntime.Object; - _emberMetal.default.onLoad = _emberRuntime.onLoad; - _emberMetal.default.runLoadHooks = _emberRuntime.runLoadHooks; - _emberMetal.default.Controller = _emberRuntime.Controller; - _emberMetal.default.ControllerMixin = _emberRuntime.ControllerMixin; - _emberMetal.default.Service = _emberRuntime.Service; - _emberMetal.default._ProxyMixin = _emberRuntime._ProxyMixin; - _emberMetal.default.RSVP = _emberRuntime.RSVP; - _emberMetal.default.Namespace = _emberRuntime.Namespace; + /** + Register a callback to be invoked when the hash changes. These + callbacks will execute when the user presses the back or forward + button, but not after `setURL` is invoked. + @private + @method onUpdateURL + @param callback {Function} + */ + onUpdateURL: function (callback) { + var _this = this; - // ES6TODO: this seems a less than ideal way/place to add properties to Ember.computed - computed.empty = _emberRuntime.empty; - computed.notEmpty = _emberRuntime.notEmpty; - computed.none = _emberRuntime.none; - computed.not = _emberRuntime.not; - computed.bool = _emberRuntime.bool; - computed.match = _emberRuntime.match; - computed.equal = _emberRuntime.equal; - computed.gt = _emberRuntime.gt; - computed.gte = _emberRuntime.gte; - computed.lt = _emberRuntime.lt; - computed.lte = _emberRuntime.lte; - computed.oneWay = _emberRuntime.oneWay; - computed.reads = _emberRuntime.oneWay; - computed.readOnly = _emberRuntime.readOnly; - computed.deprecatingAlias = _emberRuntime.deprecatingAlias; - computed.and = _emberRuntime.and; - computed.or = _emberRuntime.or; - computed.any = _emberRuntime.any; + this._removeEventListener(); - computed.sum = _emberRuntime.sum; - computed.min = _emberRuntime.min; - computed.max = _emberRuntime.max; - computed.map = _emberRuntime.map; - computed.sort = _emberRuntime.sort; - computed.setDiff = _emberRuntime.setDiff; - computed.mapBy = _emberRuntime.mapBy; - computed.filter = _emberRuntime.filter; - computed.filterBy = _emberRuntime.filterBy; - computed.uniq = _emberRuntime.uniq; + this._hashchangeHandler = function () { + _emberMetal.run(function () { + var path = _this.getURL(); + if (_emberMetal.get(_this, 'lastSetURL') === path) { + return; + } - if (true) { - computed.uniqBy = _emberRuntime.uniqBy; - } - computed.union = _emberRuntime.union; - computed.intersect = _emberRuntime.intersect; - computed.collect = _emberRuntime.collect; + _emberMetal.set(_this, 'lastSetURL', null); - /** - Defines the hash of localized strings for the current language. Used by - the `Ember.String.loc()` helper. To localize, add string values to this - hash. - - @property STRINGS - @for Ember - @type Object - @private - */ - Object.defineProperty(_emberMetal.default, 'STRINGS', { - configurable: false, - get: _emberRuntime.getStrings, - set: _emberRuntime.setStrings + callback(path); + }); + }; + + window.addEventListener('hashchange', this._hashchangeHandler); + }, + + /** + Given a URL, formats it to be placed into the page as part + of an element's `href` attribute. + This is used, for example, when using the {{action}} helper + to generate a URL based on an event. + @private + @method formatURL + @param url {String} + */ + formatURL: function (url) { + return '#' + url; + }, + + /** + Cleans up the HashLocation event listener. + @private + @method willDestroy + */ + willDestroy: function () { + this._removeEventListener(); + }, + + _removeEventListener: function () { + if (this._hashchangeHandler) { + window.removeEventListener('hashchange', this._hashchangeHandler); + } + } }); +}); +enifed('ember-routing/location/history_location', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/location/api'], function (exports, _emberMetal, _emberRuntime, _emberRoutingLocationApi) { + 'use strict'; /** - Whether searching on the global for new Namespace instances is enabled. - - This is only exported here as to not break any addons. Given the new - visit API, you will have issues if you treat this as a indicator of - booted. - - Internally this is only exposing a flag in Namespace. - - @property BOOTED - @for Ember - @type Boolean - @private - */ - Object.defineProperty(_emberMetal.default, 'BOOTED', { - configurable: false, - enumerable: false, - get: _emberRuntime.isNamespaceSearchDisabled, - set: _emberRuntime.setNamespaceSearchDisabled - }); + @module ember + @submodule ember-routing + */ - _emberMetal.default.Component = _emberGlimmer.Component; - _emberGlimmer.Helper.helper = _emberGlimmer.helper; - _emberMetal.default.Helper = _emberGlimmer.Helper; - _emberMetal.default.Checkbox = _emberGlimmer.Checkbox; - _emberMetal.default.TextField = _emberGlimmer.TextField; - _emberMetal.default.TextArea = _emberGlimmer.TextArea; - _emberMetal.default.LinkComponent = _emberGlimmer.LinkComponent; + var popstateFired = false; - if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { - String.prototype.htmlSafe = function () { - return _emberGlimmer.htmlSafe(this); + var _uuid = undefined; + + if (_emberMetal.isFeatureEnabled('ember-unique-location-history-state')) { + _uuid = function _uuid() { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { + var r, v; + r = Math.random() * 16 | 0; + v = c === 'x' ? r : r & 3 | 8; + return v.toString(16); + }); }; } - var EmberHandlebars = _emberMetal.default.Handlebars = _emberMetal.default.Handlebars || {}; - var EmberHTMLBars = _emberMetal.default.HTMLBars = _emberMetal.default.HTMLBars || {}; - var EmberHandleBarsUtils = EmberHandlebars.Utils = EmberHandlebars.Utils || {}; + /** + Ember.HistoryLocation implements the location API using the browser's + history.pushState API. + + @class HistoryLocation + @namespace Ember + @extends Ember.Object + @private + */ + exports.default = _emberRuntime.Object.extend({ + implementation: 'history', - Object.defineProperty(EmberHandlebars, 'SafeString', { - get: _emberGlimmer._getSafeString - }); + init: function () { + this._super.apply(this, arguments); - EmberHTMLBars.template = EmberHandlebars.template = _emberGlimmer.template; - EmberHandleBarsUtils.escapeExpression = _emberGlimmer.escapeExpression; - _emberRuntime.String.htmlSafe = _emberGlimmer.htmlSafe; + var base = document.querySelector('base'); + var baseURL = ''; + if (base) { + baseURL = base.getAttribute('href'); + } - if (true) { - _emberRuntime.String.isHTMLSafe = _emberGlimmer.isHTMLSafe; - } - EmberHTMLBars.makeBoundHelper = _emberGlimmer.makeBoundHelper; + _emberMetal.set(this, 'baseURL', baseURL); + _emberMetal.set(this, 'location', _emberMetal.get(this, 'location') || window.location); - /** - 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. - - @property TEMPLATES - @for Ember - @type Object - @private - */ - Object.defineProperty(_emberMetal.default, 'TEMPLATES', { - get: _emberGlimmer.getTemplates, - set: _emberGlimmer.setTemplates, - configurable: false, - enumerable: false - }); + this._popstateHandler = undefined; + }, - exports.VERSION = _emberVersion.default; + /** + Used to set state on first call to setURL + @private + @method initState + */ + initState: function () { + var history = _emberMetal.get(this, 'history') || window.history; + _emberMetal.set(this, 'history', history); - /** - The semantic version - @property VERSION - @type String - @public - */ - _emberMetal.default.VERSION = _emberVersion.default; + if (history && 'state' in history) { + this.supportsHistory = true; + } - _emberMetal.libraries.registerCoreLibrary('Ember', _emberVersion.default); + this.replaceState(this.formatURL(this.getURL())); + }, - _emberMetal.default.create = _emberMetal.deprecateFunc('Ember.create is deprecated in favor of Object.create', { id: 'ember-metal.ember-create', until: '3.0.0' }, Object.create); - _emberMetal.default.keys = _emberMetal.deprecateFunc('Ember.keys is deprecated in favor of Object.keys', { id: 'ember-metal.ember.keys', until: '3.0.0' }, Object.keys); + /** + Will be pre-pended to path upon state change + @property rootURL + @default '/' + @private + */ + rootURL: '/', - // require the main entry points for each of these packages - // this is so that the global exports occur properly + /** + Returns the current `location.pathname` without `rootURL` or `baseURL` + @private + @method getURL + @return url {String} + */ + getURL: function () { + var location = _emberMetal.get(this, 'location'); + var path = location.pathname; - /** - Alias for jQuery - - @method $ - @for Ember - @public - */ - _emberMetal.default.$ = _emberViews.jQuery; + var rootURL = _emberMetal.get(this, 'rootURL'); + var baseURL = _emberMetal.get(this, 'baseURL'); - _emberMetal.default.ViewTargetActionSupport = _emberViews.ViewTargetActionSupport; + // remove trailing slashes if they exists + rootURL = rootURL.replace(/\/$/, ''); + baseURL = baseURL.replace(/\/$/, ''); - _emberMetal.default.ViewUtils = { - isSimpleClick: _emberViews.isSimpleClick, - getViewElement: _emberViews.getViewElement, - getViewBounds: _emberViews.getViewBounds, - getViewClientRects: _emberViews.getViewClientRects, - getViewBoundingClientRect: _emberViews.getViewBoundingClientRect, - getRootViews: _emberViews.getRootViews, - getChildViews: _emberViews.getChildViews - }; + // remove baseURL and rootURL from start of path + var url = path.replace(new RegExp('^' + baseURL + '(?=/|$)'), '').replace(new RegExp('^' + rootURL + '(?=/|$)'), ''); - _emberMetal.default.TextSupport = _emberViews.TextSupport; - _emberMetal.default.ComponentLookup = _emberViews.ComponentLookup; - _emberMetal.default.EventDispatcher = _emberViews.EventDispatcher; + var search = location.search || ''; + url += search + this.getHash(); - _emberMetal.default.Location = _emberRouting.Location; - _emberMetal.default.AutoLocation = _emberRouting.AutoLocation; - _emberMetal.default.HashLocation = _emberRouting.HashLocation; - _emberMetal.default.HistoryLocation = _emberRouting.HistoryLocation; - _emberMetal.default.NoneLocation = _emberRouting.NoneLocation; - _emberMetal.default.controllerFor = _emberRouting.controllerFor; - _emberMetal.default.generateControllerFactory = _emberRouting.generateControllerFactory; - _emberMetal.default.generateController = _emberRouting.generateController; - _emberMetal.default.RouterDSL = _emberRouting.RouterDSL; - _emberMetal.default.Router = _emberRouting.Router; - _emberMetal.default.Route = _emberRouting.Route; + return url; + }, - _emberMetal.default.Application = _emberApplication.Application; - _emberMetal.default.ApplicationInstance = _emberApplication.ApplicationInstance; - _emberMetal.default.Engine = _emberApplication.Engine; - _emberMetal.default.EngineInstance = _emberApplication.EngineInstance; - _emberMetal.default.DefaultResolver = _emberMetal.default.Resolver = _emberApplication.Resolver; + /** + Uses `history.pushState` to update the url without a page reload. + @private + @method setURL + @param path {String} + */ + setURL: function (path) { + var state = this.getState(); + path = this.formatURL(path); + + if (!state || state.path !== path) { + this.pushState(path); + } + }, + + /** + Uses `history.replaceState` to update the url without a page reload + or history modification. + @private + @method replaceURL + @param path {String} + */ + replaceURL: function (path) { + var state = this.getState(); + path = this.formatURL(path); + + if (!state || state.path !== path) { + this.replaceState(path); + } + }, + + /** + Get the current `history.state`. Checks for if a polyfill is + required and if so fetches this._historyState. The state returned + from getState may be null if an iframe has changed a window's + history. + The object returned will contain a `path` for the given state as well + as a unique state `id`. The state index will allow the app to distinguish + between two states with similar paths but should be unique from one another. + @private + @method getState + @return state {Object} + */ + getState: function () { + if (this.supportsHistory) { + return _emberMetal.get(this, 'history').state; + } - _emberRuntime.runLoadHooks('Ember.Application', _emberApplication.Application); + return this._historyState; + }, - _emberMetal.default.DataAdapter = _emberExtensionSupport.DataAdapter; - _emberMetal.default.ContainerDebugAdapter = _emberExtensionSupport.ContainerDebugAdapter; + /** + Pushes a new state. + @private + @method pushState + @param path {String} + */ + pushState: function (path) { + var state = { path: path }; + if (_emberMetal.isFeatureEnabled('ember-unique-location-history-state')) { + state.uuid = _uuid(); + } - if (_require.has('ember-template-compiler')) { - _require.default('ember-template-compiler'); - } + _emberMetal.get(this, 'history').pushState(state, null, path); - // do this to ensure that Ember.Test is defined properly on the global - // if it is present. - if (_require.has('ember-testing')) { - var testing = _require.default('ember-testing'); + this._historyState = state; - _emberMetal.default.Test = testing.Test; - _emberMetal.default.Test.Adapter = testing.Adapter; - _emberMetal.default.Test.QUnitAdapter = testing.QUnitAdapter; - _emberMetal.default.setupForTesting = testing.setupForTesting; - } + // used for webkit workaround + this._previousURL = this.getURL(); + }, - _emberRuntime.runLoadHooks('Ember'); + /** + Replaces the current state. + @private + @method replaceState + @param path {String} + */ + replaceState: function (path) { + var state = { path: path }; + if (_emberMetal.isFeatureEnabled('ember-unique-location-history-state')) { + state.uuid = _uuid(); + } - /** - @module ember - */ - exports.default = _emberMetal.default; + _emberMetal.get(this, 'history').replaceState(state, null, path); - /* globals module */ - if (typeof module === 'object' && module.exports) { - module.exports = _emberMetal.default; - } else { - _emberEnvironment.context.exports.Ember = _emberEnvironment.context.exports.Em = _emberMetal.default; - } -}); + this._historyState = state; -// ****ember-environment**** + // used for webkit workaround + this._previousURL = this.getURL(); + }, -// ****ember-metal**** + /** + Register a callback to be invoked whenever the browser + history changes, including using forward and back buttons. + @private + @method onUpdateURL + @param callback {Function} + */ + onUpdateURL: function (callback) { + var _this = this; -// computed macros + this._removeEventListener(); -// reduced computed macros -enifed("ember/version", ["exports"], function (exports) { - "use strict"; + this._popstateHandler = function () { + // Ignore initial page load popstate event in Chrome + if (!popstateFired) { + popstateFired = true; + if (_this.getURL() === _this._previousURL) { + return; + } + } + callback(_this.getURL()); + }; - exports.default = "2.10.2-with-backtracking"; -}); -enifed('internal-test-helpers/apply-mixins', ['exports', 'ember-utils'], function (exports, _emberUtils) { - 'use strict'; + window.addEventListener('popstate', this._popstateHandler); + }, - exports.default = applyMixins; + /** + Used when using `{{action}}` helper. The url is always appended to the rootURL. + @private + @method formatURL + @param url {String} + @return formatted url {String} + */ + formatURL: function (url) { + var rootURL = _emberMetal.get(this, 'rootURL'); + var baseURL = _emberMetal.get(this, 'baseURL'); - function isGenerator(mixin) { - return Array.isArray(mixin.cases) && typeof mixin.generate === 'function'; - } + if (url !== '') { + // remove trailing slashes if they exists + rootURL = rootURL.replace(/\/$/, ''); + baseURL = baseURL.replace(/\/$/, ''); + } else if (baseURL[0] === '/' && rootURL[0] === '/') { + // if baseURL and rootURL both start with a slash + // ... remove trailing slash from baseURL if it exists + baseURL = baseURL.replace(/\/$/, ''); + } - function applyMixins(TestClass) { - for (var _len = arguments.length, mixins = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - mixins[_key - 1] = arguments[_key]; - } + return baseURL + rootURL + url; + }, - mixins.forEach(function (mixinOrGenerator) { - var mixin = undefined; + /** + Cleans up the HistoryLocation event listener. + @private + @method willDestroy + */ + willDestroy: function () { + this._removeEventListener(); + }, - if (isGenerator(mixinOrGenerator)) { - (function () { - var generator = mixinOrGenerator; - mixin = {}; + /** + @private + Returns normalized location.hash + @method getHash + */ + getHash: _emberRoutingLocationApi.default._getHash, - generator.cases.forEach(function (value, idx) { - _emberUtils.assign(mixin, generator.generate(value, idx)); - }); - })(); - } else { - mixin = mixinOrGenerator; + _removeEventListener: function () { + if (this._popstateHandler) { + window.removeEventListener('popstate', this._popstateHandler); } - - _emberUtils.assign(TestClass.prototype, mixin); - }); - - return TestClass; - } + } + }); }); -enifed('internal-test-helpers/build-owner', ['exports', 'container', 'ember-routing', 'ember-application', 'ember-runtime'], function (exports, _container, _emberRouting, _emberApplication, _emberRuntime) { +enifed('ember-routing/location/none_location', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { 'use strict'; - exports.default = buildOwner; + /** + @module ember + @submodule ember-routing + */ - function buildOwner() { - var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + /** + Ember.NoneLocation does not interact with the browser. It is useful for + testing, or when you need to manage state with your Router, but temporarily + don't want it to muck with the URL (for example when you embed your + application in a larger page). + + @class NoneLocation + @namespace Ember + @extends Ember.Object + @private + */ + exports.default = _emberRuntime.Object.extend({ + implementation: 'none', + path: '', - var ownerOptions = options.ownerOptions || {}; - var resolver = options.resolver; - var bootOptions = options.bootOptions || {}; + detect: function () { + var rootURL = this.rootURL; - var Owner = _emberRuntime.Object.extend(_emberRuntime.RegistryProxyMixin, _emberRuntime.ContainerProxyMixin); + _emberMetal.assert('rootURL must end with a trailing forward slash e.g. "/app/"', rootURL.charAt(rootURL.length - 1) === '/'); + }, - var namespace = _emberRuntime.Object.create({ - Resolver: { create: function () { - return resolver; - } } - }); + /** + Will be pre-pended to path. + @private + @property rootURL + @default '/' + */ + rootURL: '/', - var fallbackRegistry = _emberApplication.Application.buildRegistry(namespace); - fallbackRegistry.register('router:main', _emberRouting.Router); + /** + Returns the current path without `rootURL`. + @private + @method getURL + @return {String} path + */ + getURL: function () { + var path = _emberMetal.get(this, 'path'); + var rootURL = _emberMetal.get(this, 'rootURL'); - var registry = new _container.Registry({ - fallback: fallbackRegistry - }); + // remove trailing slashes if they exists + rootURL = rootURL.replace(/\/$/, ''); - _emberApplication.ApplicationInstance.setupRegistry(registry, bootOptions); + // remove rootURL from url + return path.replace(new RegExp('^' + rootURL + '(?=/|$)'), ''); + }, - var owner = Owner.create({ - __registry__: registry, - __container__: null - }, ownerOptions); + /** + Set the path and remembers what was set. Using this method + to change the path will not invoke the `updateURL` callback. + @private + @method setURL + @param path {String} + */ + setURL: function (path) { + _emberMetal.set(this, 'path', path); + }, - var container = registry.container({ owner: owner }); - owner.__container__ = container; + /** + Register a callback to be invoked when the path changes. These + callbacks will execute when the user presses the back or forward + button, but not after `setURL` is invoked. + @private + @method onUpdateURL + @param callback {Function} + */ + onUpdateURL: function (callback) { + this.updateCallback = callback; + }, - return owner; - } -}); -enifed('internal-test-helpers/confirm-export', ['exports', 'require'], function (exports, _require) { - 'use strict'; + /** + Sets the path and calls the `updateURL` callback. + @private + @method handleURL + @param callback {Function} + */ + handleURL: function (url) { + _emberMetal.set(this, 'path', url); + this.updateCallback(url); + }, - exports.default = confirmExport; + /** + Given a URL, formats it to be placed into the page as part + of an element's `href` attribute. + This is used, for example, when using the {{action}} helper + to generate a URL based on an event. + @private + @method formatURL + @param url {String} + @return {String} url + */ + formatURL: function (url) { + var rootURL = _emberMetal.get(this, 'rootURL'); - function getDescriptor(obj, path) { - var parts = path.split('.'); - var value = obj; - for (var i = 0; i < parts.length - 1; i++) { - var part = parts[i]; - value = value[part]; - if (!value) { - return undefined; + if (url !== '') { + // remove trailing slashes if they exists + rootURL = rootURL.replace(/\/$/, ''); } - } - var last = parts[parts.length - 1]; - return Object.getOwnPropertyDescriptor(value, last); - } - function confirmExport(Ember, assert, path, moduleId, exportName) { - var desc = getDescriptor(Ember, path); - assert.ok(desc, 'the property exists on the global'); - - var mod = _require.default(moduleId); - if (typeof exportName === 'string') { - assert.equal(desc.value, mod[exportName], 'Ember.' + path + ' is exported correctly'); - assert.notEqual(mod[exportName], undefined, 'Ember.' + path + ' is not `undefined`'); - } else { - assert.equal(desc.get, mod[exportName.get], 'Ember.' + path + ' getter is exported correctly'); - assert.notEqual(desc.get, undefined, 'Ember.' + path + ' getter is not undefined'); - - if (exportName.set) { - assert.equal(desc.set, mod[exportName.set], 'Ember.' + path + ' setter is exported correctly'); - assert.notEqual(desc.set, undefined, 'Ember.' + path + ' setter is not undefined'); - } + return rootURL + url; } - } + }); }); -enifed('internal-test-helpers/equal-inner-html', ['exports'], function (exports) { - // detect side-effects of cloning svg elements in IE9-11 +enifed('ember-routing/location/util', ['exports'], function (exports) { + /** + @private + + Returns the current `location.pathname`, normalized for IE inconsistencies. + */ 'use strict'; - exports.default = equalInnerHTML; - var ieSVGInnerHTML = (function () { - if (!document.createElementNS) { - return false; - } - var div = document.createElement('div'); - var node = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); - div.appendChild(node); - var clone = div.cloneNode(true); - return clone.innerHTML === ''; - })(); + exports.getPath = getPath; + exports.getQuery = getQuery; + exports.getHash = getHash; + exports.getFullPath = getFullPath; + exports.getOrigin = getOrigin; + exports.supportsHashChange = supportsHashChange; + exports.supportsHistory = supportsHistory; + exports.replacePath = replacePath; - function normalizeInnerHTML(actualHTML) { - if (ieSVGInnerHTML) { - // Replace `` with ``, etc. - // drop namespace attribute - actualHTML = actualHTML.replace(/ xmlns="[^"]+"/, ''); - // replace self-closing elements - actualHTML = actualHTML.replace(/<([^ >]+) [^\/>]*\/>/gi, function (tag, tagName) { - return tag.slice(0, tag.length - 3) + '>'; - }); + function getPath(location) { + var pathname = location.pathname; + // Various versions of IE/Opera don't always return a leading slash + if (pathname[0] !== '/') { + pathname = '/' + pathname; } - return actualHTML; - } - - function equalInnerHTML(fragment, html) { - var actualHTML = normalizeInnerHTML(fragment.innerHTML); - QUnit.push(actualHTML === html, actualHTML, html); + return pathname; } -}); -enifed('internal-test-helpers/equal-tokens', ['exports', 'simple-html-tokenizer'], function (exports, _simpleHtmlTokenizer) { - 'use strict'; - - exports.default = equalTokens; - function generateTokens(containerOrHTML) { - if (typeof containerOrHTML === 'string') { - return { - tokens: _simpleHtmlTokenizer.tokenize(containerOrHTML), - html: containerOrHTML - }; - } else { - return { - tokens: _simpleHtmlTokenizer.tokenize(containerOrHTML.innerHTML), - html: containerOrHTML.innerHTML - }; - } - } + /** + @private + + Returns the current `location.search`. + */ - function normalizeTokens(tokens) { - tokens.forEach(function (token) { - if (token.type === 'StartTag') { - token.attributes = token.attributes.sort(function (a, b) { - if (a[0] > b[0]) { - return 1; - } - if (a[0] < b[0]) { - return -1; - } - return 0; - }); - } - }); + function getQuery(location) { + return location.search; } - function equalTokens(actualContainer, expectedHTML) { - var message = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; - - var actual = generateTokens(actualContainer); - var expected = generateTokens(expectedHTML); - - normalizeTokens(actual.tokens); - normalizeTokens(expected.tokens); + /** + @private + + Returns the current `location.hash` by parsing location.href since browsers + inconsistently URL-decode `location.hash`. + + Should be passed the browser's `location` object as the first argument. + + https://bugzilla.mozilla.org/show_bug.cgi?id=483304 + */ - var equiv = QUnit.equiv(actual.tokens, expected.tokens); + function getHash(location) { + var href = location.href; + var hashIndex = href.indexOf('#'); - if (equiv && expected.html !== actual.html) { - deepEqual(actual.tokens, expected.tokens, message); + if (hashIndex === -1) { + return ''; } else { - QUnit.push(QUnit.equiv(actual.tokens, expected.tokens), actual.html, expected.html, message); + return href.substr(hashIndex); } } -}); -enifed('internal-test-helpers/factory', ['exports'], function (exports) { - 'use strict'; - exports.default = factory; - function setProperties(object, properties) { - for (var key in properties) { - if (properties.hasOwnProperty(key)) { - object[key] = properties[key]; - } - } + function getFullPath(location) { + return getPath(location) + getQuery(location) + getHash(location); } - var guids = 0; + function getOrigin(location) { + var origin = location.origin; - function factory() { - /*jshint validthis: true */ + // Older browsers, especially IE, don't have origin + if (!origin) { + origin = location.protocol + '//' + location.hostname; - function Klass(options) { - setProperties(this, options); - this._guid = guids++; - this.isDestroyed = false; + if (location.port) { + origin += ':' + location.port; + } } - Klass.prototype.constructor = Klass; - Klass.prototype.destroy = function () { - this.isDestroyed = true; - }; + return origin; + } - Klass.prototype.toString = function () { - return ''; - }; + /* + `documentMode` only exist in Internet Explorer, and it's tested because IE8 running in + IE7 compatibility mode claims to support `onhashchange` but actually does not. + + `global` is an object that may have an `onhashchange` property. + + @private + @function supportsHashChange + */ - Klass.create = create; - Klass.extend = extend; - Klass.reopen = extend; - Klass.reopenClass = reopenClass; + function supportsHashChange(documentMode, global) { + return 'onhashchange' in global && (documentMode === undefined || documentMode > 7); + } - return Klass; + /* + `userAgent` is a user agent string. We use user agent testing here, because + the stock Android browser is known to have buggy versions of the History API, + in some Android versions. + + @private + @function supportsHistory + */ - function create(options) { - return new this.prototype.constructor(options); - } + function supportsHistory(userAgent, history) { + // Boosted from Modernizr: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js + // The stock browser on Android 2.2 & 2.3, and 4.0.x returns positive on history support + // Unfortunately support is really buggy and there is no clean way to detect + // these bugs, so we fall back to a user agent sniff :( - function reopenClass(options) { - setProperties(this, options); + // We only want Android 2 and 4.0, stock browser, and not Chrome which identifies + // itself as 'Mobile Safari' as well, nor Windows Phone. + if ((userAgent.indexOf('Android 2.') !== -1 || userAgent.indexOf('Android 4.0') !== -1) && userAgent.indexOf('Mobile Safari') !== -1 && userAgent.indexOf('Chrome') === -1 && userAgent.indexOf('Windows Phone') === -1) { + return false; } - function extend(options) { - function Child(options) { - Klass.call(this, options); - } + return !!(history && 'pushState' in history); + } + + /** + Replaces the current location, making sure we explicitly include the origin + to prevent redirecting to a different origin. + + @private + */ + + function replacePath(location, path) { + location.replace(getOrigin(location) + path); + } +}); +enifed('ember-routing/services/router', ['exports', 'ember-runtime', 'ember-metal', 'ember-routing/system/dsl'], function (exports, _emberRuntime, _emberMetal, _emberRoutingSystemDsl) { + /** + @module ember + @submodule ember-routing + */ - var Parent = this; + 'use strict'; - Child.prototype = new Parent(); - Child.prototype.constructor = Child; + /** + The Router service is the public API that provides component/view layer + access to the router. + + @public + @class RouterService + @category ember-routing-router-service + */ + var RouterService = _emberRuntime.Service.extend({ + currentRouteName: _emberRuntime.readOnly('router.currentRouteName'), + currentURL: _emberRuntime.readOnly('router.currentURL'), + location: _emberRuntime.readOnly('router.location'), + rootURL: _emberRuntime.readOnly('router.rootURL'), - setProperties(Child, Klass); - setProperties(Child.prototype, options); + /** + Transition the application into another route. The route may + be either a single route or route path: + See [Route.transitionTo](http://emberjs.com/api/classes/Ember.Route.html#method_transitionTo) for more info. + @method transitionTo + @category ember-routing-router-service + @param {String} name the name of the route or a URL + @param {...Object} models the model(s) or identifier(s) to be used while + transitioning to the route. + @param {Object} [options] optional hash with a queryParams property + containing a mapping of query parameters + @return {Transition} the transition object associated with this + attempted transition + @public + */ + transitionTo: function () { + var _router; - Child.create = create; - Child.extend = extend; - Child.reopen = extend; + return (_router = this.router).transitionTo.apply(_router, arguments); + }, - Child.reopenClass = reopenClass; + /** + Transition into another route while replacing the current URL, if possible. + The route may be either a single route or route path: + See [Route.replaceWith](http://emberjs.com/api/classes/Ember.Route.html#method_replaceWith) for more info. + @method replaceWith + @category ember-routing-router-service + @param {String} name the name of the route or a URL + @param {...Object} models the model(s) or identifier(s) to be used while + transitioning to the route. + @param {Object} [options] optional hash with a queryParams property + containing a mapping of query parameters + @return {Transition} the transition object associated with this + attempted transition + @public + */ + replaceWith: function () { + var _router2; - return Child; + return (_router2 = this.router).replaceWith.apply(_router2, arguments); } - } -}); -enifed('internal-test-helpers/index', ['exports', 'internal-test-helpers/factory', 'internal-test-helpers/build-owner', 'internal-test-helpers/confirm-export', 'internal-test-helpers/equal-inner-html', 'internal-test-helpers/equal-tokens', 'internal-test-helpers/module-for', 'internal-test-helpers/strip', 'internal-test-helpers/apply-mixins', 'internal-test-helpers/matchers', 'internal-test-helpers/run', 'internal-test-helpers/test-groups', 'internal-test-helpers/test-cases/abstract', 'internal-test-helpers/test-cases/abstract-application', 'internal-test-helpers/test-cases/application', 'internal-test-helpers/test-cases/query-param', 'internal-test-helpers/test-cases/abstract-rendering', 'internal-test-helpers/test-cases/rendering'], function (exports, _internalTestHelpersFactory, _internalTestHelpersBuildOwner, _internalTestHelpersConfirmExport, _internalTestHelpersEqualInnerHtml, _internalTestHelpersEqualTokens, _internalTestHelpersModuleFor, _internalTestHelpersStrip, _internalTestHelpersApplyMixins, _internalTestHelpersMatchers, _internalTestHelpersRun, _internalTestHelpersTestGroups, _internalTestHelpersTestCasesAbstract, _internalTestHelpersTestCasesAbstractApplication, _internalTestHelpersTestCasesApplication, _internalTestHelpersTestCasesQueryParam, _internalTestHelpersTestCasesAbstractRendering, _internalTestHelpersTestCasesRendering) { - 'use strict'; + }); - exports.factory = _internalTestHelpersFactory.default; - exports.buildOwner = _internalTestHelpersBuildOwner.default; - exports.confirmExport = _internalTestHelpersConfirmExport.default; - exports.equalInnerHTML = _internalTestHelpersEqualInnerHtml.default; - exports.equalTokens = _internalTestHelpersEqualTokens.default; - exports.moduleFor = _internalTestHelpersModuleFor.default; - exports.strip = _internalTestHelpersStrip.default; - exports.applyMixins = _internalTestHelpersApplyMixins.default; - exports.equalsElement = _internalTestHelpersMatchers.equalsElement; - exports.classes = _internalTestHelpersMatchers.classes; - exports.styles = _internalTestHelpersMatchers.styles; - exports.regex = _internalTestHelpersMatchers.regex; - exports.runAppend = _internalTestHelpersRun.runAppend; - exports.runDestroy = _internalTestHelpersRun.runDestroy; - exports.testBoth = _internalTestHelpersTestGroups.testBoth; - exports.testWithDefault = _internalTestHelpersTestGroups.testWithDefault; - exports.AbstractTestCase = _internalTestHelpersTestCasesAbstract.default; - exports.AbstractApplicationTestCase = _internalTestHelpersTestCasesAbstractApplication.default; - exports.ApplicationTestCase = _internalTestHelpersTestCasesApplication.default; - exports.QueryParamTestCase = _internalTestHelpersTestCasesQueryParam.default; - exports.AbstractRenderingTestCase = _internalTestHelpersTestCasesAbstractRendering.default; - exports.RenderingTestCase = _internalTestHelpersTestCasesRendering.default; + exports.default = RouterService; }); -enifed('internal-test-helpers/matchers', ['exports'], function (exports) { - 'use strict'; +enifed('ember-routing/services/routing', ['exports', 'ember-utils', 'ember-runtime', 'ember-metal', 'ember-routing/utils'], function (exports, _emberUtils, _emberRuntime, _emberMetal, _emberRoutingUtils) { + /** + @module ember + @submodule ember-routing + */ - exports.regex = regex; - exports.classes = classes; - exports.styles = styles; - exports.equalsElement = equalsElement; - var HTMLElement = window.HTMLElement; - var MATCHER_BRAND = '3d4ef194-13be-4ccf-8dc7-862eea02c93e'; + 'use strict'; - function isMatcher(obj) { - return typeof obj === 'object' && obj !== null && MATCHER_BRAND in obj; - } + /** + 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 + the set of API needed for components to control routing without interacting + with router internals. + + @private + @class RoutingService + */ + exports.default = _emberRuntime.Service.extend({ + router: null, - function equalsAttr(expected) { - var _ref; + targetState: _emberRuntime.readOnly('router.targetState'), + currentState: _emberRuntime.readOnly('router.currentState'), + currentRouteName: _emberRuntime.readOnly('router.currentRouteName'), + currentPath: _emberRuntime.readOnly('router.currentPath'), - return _ref = {}, _ref[MATCHER_BRAND] = true, _ref.match = function (actual) { - return expected === actual; - }, _ref.expected = function () { - return expected; - }, _ref.message = function () { - return 'should equal ' + this.expected(); - }, _ref; - } + availableRoutes: function () { + return Object.keys(_emberMetal.get(this, 'router').router.recognizer.names); + }, - function regex(r) { - var _ref2; + hasRoute: function (routeName) { + return _emberMetal.get(this, 'router').hasRoute(routeName); + }, - return _ref2 = {}, _ref2[MATCHER_BRAND] = true, _ref2.match = function (v) { - return r.test(v); - }, _ref2.expected = function () { - return r.toString(); - }, _ref2.message = function () { - return 'should match ' + this.expected(); - }, _ref2; - } + transitionTo: function (routeName, models, queryParams, shouldReplace) { + var router = _emberMetal.get(this, 'router'); - function classes(expected) { - var _ref3; + var transition = router._doTransition(routeName, models, queryParams); - return _ref3 = {}, _ref3[MATCHER_BRAND] = true, _ref3.match = function (actual) { - actual = actual.trim(); - return actual && expected.split(/\s+/).sort().join(' ') === actual.trim().split(/\s+/).sort().join(' '); - }, _ref3.expected = function () { - return expected; - }, _ref3.message = function () { - return 'should match ' + this.expected(); - }, _ref3; - } + if (shouldReplace) { + transition.method('replace'); + } - function styles(expected) { - var _ref4; + return transition; + }, - return _ref4 = {}, _ref4[MATCHER_BRAND] = true, _ref4.match = function (actual) { - // coerce `null` or `undefined` to an empty string - // needed for matching empty styles on IE9 - IE11 - actual = actual || ''; - actual = actual.trim(); + normalizeQueryParams: function (routeName, models, queryParams) { + var router = _emberMetal.get(this, 'router'); + router._prepareQueryParams(routeName, models, queryParams); + }, - return expected.split(';').map(function (s) { - return s.trim(); - }).filter(function (s) { - return s; - }).sort().join('; ') === actual.split(';').map(function (s) { - return s.trim(); - }).filter(function (s) { - return s; - }).sort().join('; '); - }, _ref4.expected = function () { - return expected; - }, _ref4.message = function () { - return 'should match ' + this.expected(); - }, _ref4; - } + generateURL: function (routeName, models, queryParams) { + var router = _emberMetal.get(this, 'router'); + if (!router.router) { + return; + } - function equalsElement(element, tagName, attributes, content) { - QUnit.push(element.tagName === tagName.toUpperCase(), element.tagName.toLowerCase(), tagName, 'expect tagName to be ' + tagName); + var visibleQueryParams = {}; + _emberUtils.assign(visibleQueryParams, queryParams); - var expectedAttrs = {}; - var expectedCount = 0; + this.normalizeQueryParams(routeName, models, visibleQueryParams); - for (var _name in attributes) { - var expected = attributes[_name]; - if (expected !== null) { - expectedCount++; - } + var args = _emberRoutingUtils.routeArgs(routeName, models, visibleQueryParams); + return router.generate.apply(router, args); + }, - var matcher = isMatcher(expected) ? expected : equalsAttr(expected); + isActiveForRoute: function (contexts, queryParams, routeName, routerState, isCurrentWhenSpecified) { + var router = _emberMetal.get(this, 'router'); - expectedAttrs[_name] = matcher; + var handlers = router.router.recognizer.handlersFor(routeName); + var leafName = handlers[handlers.length - 1].handler; + var maximumContexts = numberOfContextsAcceptedByHandler(routeName, handlers); - QUnit.push(expectedAttrs[_name].match(element.getAttribute(_name)), element.getAttribute(_name), matcher.expected(), 'Element\'s ' + _name + ' attribute ' + matcher.message()); - } + // NOTE: any ugliness in the calculation of activeness is largely + // due to the fact that we support automatic normalizing of + // `resource` -> `resource.index`, even though there might be + // dynamic segments / query params defined on `resource.index` + // which complicates (and makes somewhat ambiguous) the calculation + // of activeness for links that link to `resource` instead of + // directly to `resource.index`. - var actualAttributes = {}; + // if we don't have enough contexts revert back to full route name + // this is because the leaf route will use one of the contexts + if (contexts.length > maximumContexts) { + routeName = leafName; + } - for (var i = 0, l = element.attributes.length; i < l; i++) { - actualAttributes[element.attributes[i].name] = element.attributes[i].value; + return routerState.isActiveIntent(routeName, contexts, queryParams, !isCurrentWhenSpecified); } + }); - if (!(element instanceof HTMLElement)) { - QUnit.push(element instanceof HTMLElement, null, null, 'Element must be an HTML Element, not an SVG Element'); - } else { - QUnit.push(element.attributes.length === expectedCount || !attributes, element.attributes.length, expectedCount, 'Expected ' + expectedCount + ' attributes; got ' + element.outerHTML); - - if (content !== null) { - QUnit.push(element.innerHTML === content, element.innerHTML, content, 'The element had \'' + content + '\' as its content'); + function numberOfContextsAcceptedByHandler(handler, handlerInfos) { + var req = 0; + for (var i = 0; i < handlerInfos.length; i++) { + req += handlerInfos[i].names.length; + if (handlerInfos[i].handler === handler) { + break; } } + + return req; } }); -enifed('internal-test-helpers/module-for', ['exports', 'internal-test-helpers/apply-mixins'], function (exports, _internalTestHelpersApplyMixins) { +enifed('ember-routing/system/cache', ['exports', 'ember-utils', 'ember-runtime'], function (exports, _emberUtils, _emberRuntime) { 'use strict'; - exports.default = moduleFor; + /** + A two-tiered cache with support for fallback values when doing lookups. + Uses "buckets" and then "keys" to cache values. + + @private + @class BucketCache + */ + exports.default = _emberRuntime.Object.extend({ + init: function () { + this.cache = new _emberUtils.EmptyObject(); + }, - function moduleFor(description, TestClass) { - var context = undefined; + has: function (bucketKey) { + return !!this.cache[bucketKey]; + }, - QUnit.module(description, { - setup: function () { - context = new TestClass(); - }, + stash: function (bucketKey, key, value) { + var bucket = this.cache[bucketKey]; - teardown: function () { - context.teardown(); + if (!bucket) { + bucket = this.cache[bucketKey] = new _emberUtils.EmptyObject(); } - }); - for (var _len = arguments.length, mixins = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - mixins[_key - 2] = arguments[_key]; - } - - _internalTestHelpersApplyMixins.default(TestClass, mixins); - - var proto = TestClass.prototype; + bucket[key] = value; + }, - while (proto !== Object.prototype) { - Object.keys(proto).forEach(generateTest); - proto = Object.getPrototypeOf(proto); - } + lookup: function (bucketKey, prop, defaultValue) { + var cache = this.cache; + if (!this.has(bucketKey)) { + return defaultValue; + } - function generateTest(name) { - if (name.indexOf('@test ') === 0) { - QUnit.test(name.slice(5), function (assert) { - return context[name](assert); - }); - } else if (name.indexOf('@skip ') === 0) { - QUnit.skip(name.slice(5), function (assert) { - return context[name](assert); - }); + var bucket = cache[bucketKey]; + if (prop in bucket && bucket[prop] !== undefined) { + return bucket[prop]; + } else { + return defaultValue; } } - } + }); }); -enifed('internal-test-helpers/run', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; +enifed("ember-routing/system/controller_for", ["exports"], function (exports) { + /** + @module ember + @submodule ember-routing + */ - exports.runAppend = runAppend; - exports.runDestroy = runDestroy; + /** + Finds a controller instance. + + @for Ember + @method controllerFor + @private + */ + "use strict"; - function runAppend(view) { - _emberMetal.run(view, 'appendTo', '#qunit-fixture'); - } + exports.default = controllerFor; - function runDestroy(toDestroy) { - if (toDestroy) { - _emberMetal.run(toDestroy, 'destroy'); - } + function controllerFor(container, controllerName, lookupOptions) { + return container.lookup("controller:" + controllerName, lookupOptions); } }); -enifed('internal-test-helpers/strip', ['exports'], function (exports) { +enifed('ember-routing/system/dsl', ['exports', 'ember-utils', 'ember-metal'], function (exports, _emberUtils, _emberMetal) { 'use strict'; - exports.default = strip; + /** + @module ember + @submodule ember-routing + */ - function strip(_ref) { - for (var _len = arguments.length, values = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - values[_key - 1] = arguments[_key]; - } + var uuid = 0; - var strings = _ref; + var DSL = (function () { + function DSL(name, options) { + babelHelpers.classCallCheck(this, DSL); - var str = strings.map(function (string, index) { - var interpolated = values[index]; - return string + (interpolated !== undefined ? interpolated : ''); - }).join(''); - return str.split('\n').map(function (s) { - return s.trim(); - }).join(''); - } -}); -enifed('internal-test-helpers/test-cases/abstract-application', ['exports', 'ember-metal', 'ember-views', 'ember-application', 'ember-routing', 'ember-template-compiler', 'internal-test-helpers/test-cases/abstract', 'internal-test-helpers/run'], function (exports, _emberMetal, _emberViews, _emberApplication, _emberRouting, _emberTemplateCompiler, _internalTestHelpersTestCasesAbstract, _internalTestHelpersRun) { - 'use strict'; + this.parent = name; + this.enableLoadingSubstates = options && options.enableLoadingSubstates; + this.matches = []; + this.explicitIndex = undefined; + this.options = options; + } - var AbstractApplicationTestCase = (function (_AbstractTestCase) { - babelHelpers.inherits(AbstractApplicationTestCase, _AbstractTestCase); + DSL.prototype.route = function route(name, options, callback) { + if (options === undefined) options = {}; - function AbstractApplicationTestCase() { - babelHelpers.classCallCheck(this, AbstractApplicationTestCase); + var dummyErrorRoute = '/_unused_dummy_error_path_route_' + name + '/:error'; + if (arguments.length === 2 && typeof options === 'function') { + callback = options; + options = {}; + } - _AbstractTestCase.call(this); + _emberMetal.assert('\'' + name + '\' cannot be used as a route name.', (function () { + if (options.overrideNameAssertion === true) { + return true; + } - this.element = _emberViews.jQuery('#qunit-fixture')[0]; + return ['array', 'basic', 'object', 'application'].indexOf(name) === -1; + })()); - this.application = _emberMetal.run(_emberApplication.Application, 'create', this.applicationOptions); + if (this.enableLoadingSubstates) { + createRoute(this, name + '_loading', { resetNamespace: options.resetNamespace }); + createRoute(this, name + '_error', { resetNamespace: options.resetNamespace, path: dummyErrorRoute }); + } - this.router = this.application.Router = _emberRouting.Router.extend(this.routerOptions); + if (callback) { + var fullName = getFullName(this, name, options.resetNamespace); + var dsl = new DSL(fullName, this.options); - this.applicationInstance = null; - } + createRoute(dsl, 'loading'); + createRoute(dsl, 'error', { path: dummyErrorRoute }); - AbstractApplicationTestCase.prototype.teardown = function teardown() { - if (this.applicationInstance) { - _internalTestHelpersRun.runDestroy(this.applicationInstance); - } + callback.call(dsl); - _internalTestHelpersRun.runDestroy(this.application); + createRoute(this, name, options, dsl.generate()); + } else { + createRoute(this, name, options); + } }; - AbstractApplicationTestCase.prototype.visit = function visit(url, options) { - var _this = this; + DSL.prototype.push = function push(url, name, callback, serialize) { + var parts = name.split('.'); - var applicationInstance = this.applicationInstance; + if (this.options.engineInfo) { + var localFullName = name.slice(this.options.engineInfo.fullName.length + 1); + var routeInfo = _emberUtils.assign({ localFullName: localFullName }, this.options.engineInfo); - if (applicationInstance) { - return _emberMetal.run(applicationInstance, 'visit', url, options); - } else { - return _emberMetal.run(this.application, 'visit', url, options).then(function (instance) { - _this.applicationInstance = instance; - }); + if (serialize) { + routeInfo.serializeMethod = serialize; + } + + this.options.addRouteForEngine(name, routeInfo); + } else if (serialize) { + throw new Error('Defining a route serializer on route \'' + name + '\' outside an Engine is not allowed.'); } - }; - AbstractApplicationTestCase.prototype.transitionTo = function transitionTo() { - return _emberMetal.run.apply(undefined, [this.appRouter, 'transitionTo'].concat(babelHelpers.slice.call(arguments))); - }; + if (url === '' || url === '/' || parts[parts.length - 1] === 'index') { + this.explicitIndex = true; + } - AbstractApplicationTestCase.prototype.compile = function compile(string, options) { - return _emberTemplateCompiler.compile.apply(undefined, arguments); + this.matches.push([url, name, callback]); }; - AbstractApplicationTestCase.prototype.registerRoute = function registerRoute(name, route) { - this.application.register('route:' + name, route); - }; + DSL.prototype.resource = function resource(name, options, callback) { + if (options === undefined) options = {}; - AbstractApplicationTestCase.prototype.registerTemplate = function registerTemplate(name, template) { - this.application.register('template:' + name, this.compile(template, { - moduleName: name - })); + if (arguments.length === 2 && typeof options === 'function') { + callback = options; + options = {}; + } + + options.resetNamespace = true; + _emberMetal.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); }; - AbstractApplicationTestCase.prototype.registerComponent = function registerComponent(name, _ref) { - var _ref$ComponentClass = _ref.ComponentClass; - var ComponentClass = _ref$ComponentClass === undefined ? null : _ref$ComponentClass; - var _ref$template = _ref.template; - var template = _ref$template === undefined ? null : _ref$template; + DSL.prototype.generate = function generate() { + var dslMatches = this.matches; - if (ComponentClass) { - this.application.register('component:' + name, ComponentClass); + if (!this.explicitIndex) { + this.route('index', { path: '/' }); } - if (typeof template === 'string') { - this.application.register('template:components/' + name, this.compile(template, { - moduleName: 'components/' + name - })); - } + return function (match) { + for (var i = 0; i < dslMatches.length; i++) { + var dslMatch = dslMatches[i]; + match(dslMatch[0]).to(dslMatch[1], dslMatch[2]); + } + }; }; - AbstractApplicationTestCase.prototype.registerController = function registerController(name, controller) { - this.application.register('controller:' + name, controller); - }; + DSL.prototype.mount = function mount(_name) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - AbstractApplicationTestCase.prototype.registerEngine = function registerEngine(name, engine) { - this.application.register('engine:' + name, engine); - }; + var engineRouteMap = this.options.resolveRouteMap(_name); + var name = _name; - babelHelpers.createClass(AbstractApplicationTestCase, [{ - key: 'applicationOptions', - get: function () { - return { - rootElement: '#qunit-fixture', - autoboot: false - }; + if (options.as) { + name = options.as; } - }, { - key: 'routerOptions', - get: function () { - return { - location: 'none' - }; + + var fullName = getFullName(this, name, options.resetNamespace); + + var engineInfo = { + name: _name, + instanceId: uuid++, + mountPoint: fullName, + fullName: fullName + }; + + var path = options.path; + + if (typeof path !== 'string') { + path = '/' + name; } - }, { - key: 'appRouter', - get: function () { - return this.applicationInstance.lookup('router:main'); + + var callback = undefined; + var dummyErrorRoute = '/_unused_dummy_error_path_route_' + name + '/:error'; + if (engineRouteMap) { + var shouldResetEngineInfo = false; + var oldEngineInfo = this.options.engineInfo; + if (oldEngineInfo) { + shouldResetEngineInfo = true; + this.options.engineInfo = engineInfo; + } + + var optionsForChild = _emberUtils.assign({ engineInfo: engineInfo }, this.options); + var childDSL = new DSL(fullName, optionsForChild); + + createRoute(childDSL, 'loading'); + createRoute(childDSL, 'error', { path: dummyErrorRoute }); + + engineRouteMap.class.call(childDSL); + + callback = childDSL.generate(); + + if (shouldResetEngineInfo) { + this.options.engineInfo = oldEngineInfo; + } } - }]); - return AbstractApplicationTestCase; - })(_internalTestHelpersTestCasesAbstract.default); - exports.default = AbstractApplicationTestCase; + var localFullName = 'application'; + var routeInfo = _emberUtils.assign({ localFullName: localFullName }, engineInfo); + + if (this.enableLoadingSubstates) { + // These values are important to register the loading routes under their + // proper names for the Router and within the Engine's registry. + var substateName = name + '_loading'; + var _localFullName = 'application_loading'; + var _routeInfo = _emberUtils.assign({ localFullName: _localFullName }, engineInfo); + createRoute(this, substateName, { resetNamespace: options.resetNamespace }); + this.options.addRouteForEngine(substateName, _routeInfo); + + substateName = name + '_error'; + _localFullName = 'application_error'; + _routeInfo = _emberUtils.assign({ localFullName: _localFullName }, engineInfo); + createRoute(this, substateName, { resetNamespace: options.resetNamespace, path: dummyErrorRoute }); + this.options.addRouteForEngine(substateName, _routeInfo); + } + + this.options.addRouteForEngine(fullName, routeInfo); + + this.push(path, fullName, callback); + }; + + return DSL; + })(); + + exports.default = DSL; + + function canNest(dsl) { + return dsl.parent && dsl.parent !== 'application'; + } + + function getFullName(dsl, name, resetNamespace) { + if (canNest(dsl) && resetNamespace !== true) { + return dsl.parent + '.' + name; + } else { + return name; + } + } + + function createRoute(dsl, name, options, callback) { + if (options === undefined) options = {}; + + var fullName = getFullName(dsl, name, options.resetNamespace); + + if (typeof options.path !== 'string') { + options.path = '/' + name; + } + + dsl.push(options.path, fullName, callback, options.serialize); + } + + DSL.map = function (callback) { + var dsl = new DSL(); + callback.call(dsl); + return dsl; + }; }); -enifed('internal-test-helpers/test-cases/abstract-rendering', ['exports', 'ember-utils', 'ember-template-compiler', 'ember-views', 'ember-glimmer', 'internal-test-helpers/test-cases/abstract', 'internal-test-helpers/build-owner', 'internal-test-helpers/run'], function (exports, _emberUtils, _emberTemplateCompiler, _emberViews, _emberGlimmer, _internalTestHelpersTestCasesAbstract, _internalTestHelpersBuildOwner, _internalTestHelpersRun) { +enifed('ember-routing/system/generate_controller', ['exports', 'ember-metal', 'container'], function (exports, _emberMetal, _container) { 'use strict'; - var TextNode = window.Text; + exports.generateControllerFactory = generateControllerFactory; + exports.default = generateController; - var AbstractRenderingTestCase = (function (_AbstractTestCase) { - babelHelpers.inherits(AbstractRenderingTestCase, _AbstractTestCase); + /** + @module ember + @submodule ember-routing + */ - function AbstractRenderingTestCase() { - babelHelpers.classCallCheck(this, AbstractRenderingTestCase); + /** + Generates a controller factory + + @for Ember + @method generateControllerFactory + @private + */ - _AbstractTestCase.call(this); - var owner = this.owner = _internalTestHelpersBuildOwner.default({ - ownerOptions: this.getOwnerOptions(), - bootOptions: this.getBootOptions(), - resolver: this.getResolver() - }); + function generateControllerFactory(owner, controllerName, context) { + var Factory = owner[_container.FACTORY_FOR]('controller:basic').class; - this.renderer = this.owner.lookup('renderer:-dom'); - this.element = _emberViews.jQuery('#qunit-fixture')[0]; - this.component = null; + Factory = Factory.extend({ + toString: function () { + return '(generated ' + controllerName + ' controller)'; + } + }); - owner.register('event_dispatcher:main', _emberViews.EventDispatcher); - owner.inject('event_dispatcher:main', '_viewRegistry', '-view-registry:main'); - owner.lookup('event_dispatcher:main').setup(this.getCustomDispatcherEvents(), this.element); - } + var fullName = 'controller:' + controllerName; - AbstractRenderingTestCase.prototype.compile = function compile() { - return _emberTemplateCompiler.compile.apply(undefined, arguments); - }; + owner.register(fullName, Factory); - AbstractRenderingTestCase.prototype.getCustomDispatcherEvents = function getCustomDispatcherEvents() { - return {}; - }; + return Factory; + } - AbstractRenderingTestCase.prototype.getOwnerOptions = function getOwnerOptions() {}; + /** + Generates and instantiates a controller extending from `controller:basic` + if present, or `Ember.Controller` if not. + + @for Ember + @method generateController + @private + @since 1.3.0 + */ - AbstractRenderingTestCase.prototype.getBootOptions = function getBootOptions() {}; + function generateController(owner, controllerName) { + generateControllerFactory(owner, controllerName); - AbstractRenderingTestCase.prototype.getResolver = function getResolver() {}; + var fullName = 'controller:' + controllerName; + var instance = owner.lookup(fullName); - AbstractRenderingTestCase.prototype.teardown = function teardown() { - if (this.component) { - _internalTestHelpersRun.runDestroy(this.component); - } - if (this.owner) { - _internalTestHelpersRun.runDestroy(this.owner); + _emberMetal.runInDebug(function () { + if (_emberMetal.get(instance, 'namespace.LOG_ACTIVE_GENERATION')) { + _emberMetal.info('generated -> ' + fullName, { fullName: fullName }); } - }; + }); - AbstractRenderingTestCase.prototype.render = function render(templateStr) { - var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - var owner = this.owner; + return instance; + } +}); +enifed('ember-routing/system/query_params', ['exports', 'ember-runtime'], function (exports, _emberRuntime) { + 'use strict'; - owner.register('template:-top-level', this.compile(templateStr, { - moduleName: '-top-level' - })); + exports.default = _emberRuntime.Object.extend({ + isQueryParams: true, + values: null + }); +}); +enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-routing/system/generate_controller', 'ember-routing/utils', 'container'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberRoutingSystemGenerate_controller, _emberRoutingUtils, _container) { + 'use strict'; - var attrs = _emberUtils.assign({}, context, { - tagName: '', - layoutName: '-top-level' - }); + exports.defaultSerialize = defaultSerialize; + exports.hasDefaultSerialize = hasDefaultSerialize; + var slice = Array.prototype.slice; - owner.register('component:-top-level', _emberGlimmer.Component.extend(attrs)); + function K() { + return this; + } - this.component = owner.lookup('component:-top-level'); + function defaultSerialize(model, params) { + if (params.length < 1 || !model) { + return; + } - _internalTestHelpersRun.runAppend(this.component); - }; + var name = params[0]; + var object = {}; - AbstractRenderingTestCase.prototype.rerender = function rerender() { - this.component.rerender(); - }; + if (params.length === 1) { + if (name in model) { + object[name] = _emberMetal.get(model, name); + } else if (/_id$/.test(name)) { + object[name] = _emberMetal.get(model, 'id'); + } + } else { + object = _emberMetal.getProperties(model, params); + } - AbstractRenderingTestCase.prototype.registerHelper = function registerHelper(name, funcOrClassBody) { - var type = typeof funcOrClassBody; + return object; + } - if (type === 'function') { - this.owner.register('helper:' + name, _emberGlimmer.helper(funcOrClassBody)); - } else if (type === 'object' && type !== null) { - this.owner.register('helper:' + name, _emberGlimmer.Helper.extend(funcOrClassBody)); - } else { - throw new Error('Cannot register ' + funcOrClassBody + ' as a helper'); - } - }; + var DEFAULT_SERIALIZE = _emberUtils.symbol('DEFAULT_SERIALIZE'); - AbstractRenderingTestCase.prototype.registerPartial = function registerPartial(name, template) { - var owner = this.env.owner || this.owner; - if (typeof template === 'string') { - var moduleName = 'template:' + name; - owner.register(moduleName, this.compile(template, { moduleName: moduleName })); - } - }; + defaultSerialize[DEFAULT_SERIALIZE] = true; - AbstractRenderingTestCase.prototype.registerComponent = function registerComponent(name, _ref) { - var _ref$ComponentClass = _ref.ComponentClass; - var ComponentClass = _ref$ComponentClass === undefined ? null : _ref$ComponentClass; - var _ref$template = _ref.template; - var template = _ref$template === undefined ? null : _ref$template; - var owner = this.owner; + function hasDefaultSerialize(route) { + return !!route.serialize[DEFAULT_SERIALIZE]; + } - if (ComponentClass) { - owner.register('component:' + name, ComponentClass); - } + /** + @module ember + @submodule ember-routing + */ - if (typeof template === 'string') { - owner.register('template:components/' + name, this.compile(template, { - moduleName: 'components/' + name - })); + /** + The `Ember.Route` class is used to define individual routes. Refer to + the [routing guide](http://emberjs.com/guides/routing/) for documentation. + + @class Route + @namespace Ember + @extends Ember.Object + @uses Ember.ActionHandler + @uses Ember.Evented + @since 1.0.0 + @public + */ + var Route = _emberRuntime.Object.extend(_emberRuntime.ActionHandler, _emberRuntime.Evented, { + /** + Configuration hash for this route's queryParams. The possible + configuration options and their defaults are as follows + (assuming a query param whose controller property is `page`): + ```javascript + queryParams: { + page: { + // By default, controller query param properties don't + // cause a full transition when they are changed, but + // rather only cause the URL to update. Setting + // `refreshModel` to true will cause an "in-place" + // transition to occur, whereby the model hooks for + // this route (and any child routes) will re-fire, allowing + // you to reload models (e.g., from the server) using the + // updated query param values. + refreshModel: false, + // By default, changes to controller query param properties + // cause the URL to update via `pushState`, which means an + // item will be added to the browser's history, allowing + // you to use the back button to restore the app to the + // previous state before the query param property was changed. + // Setting `replace` to true will use `replaceState` (or its + // hash location equivalent), which causes no browser history + // item to be added. This options name and default value are + // the same as the `link-to` helper's `replace` option. + replace: false, + // By default, the query param URL key is the same name as + // the controller property name. Use `as` to specify a + // different URL key. + as: 'page' + } } - }; + ``` + @property queryParams + @for Ember.Route + @type Object + @since 1.6.0 + @public + */ + queryParams: {}, - AbstractRenderingTestCase.prototype.registerTemplate = function registerTemplate(name, template) { - var owner = this.owner; + /** + The name of the route, dot-delimited. + For example, a route found at `app/routes/posts/post.js` will have + a `routeName` of `posts.post`. + @property routeName + @for Ember.Route + @type String + @since 1.0.0 + @public + */ - if (typeof template === 'string') { - owner.register('template:' + name, this.compile(template, { - moduleName: name - })); - } else { - throw new Error('Registered template "' + name + '" must be a string'); - } - }; + /** + Sets the name for this route, including a fully resolved name for routes + inside engines. + @private + @method _setRouteName + @param {String} name + */ + _setRouteName: function (name) { + this.routeName = name; + this.fullRouteName = getEngineRouteName(_emberUtils.getOwner(this), name); + }, - AbstractRenderingTestCase.prototype.registerService = function registerService(name, klass) { - this.owner.register('service:' + name, klass); - }; + /** + Populates the QP meta information in the BucketCache. + @private + @method _populateQPMeta + */ + _populateQPMeta: function () { + this._bucketCache.stash('route-meta', this.fullRouteName, this.get('_qp')); + }, - AbstractRenderingTestCase.prototype.assertTextNode = function assertTextNode(node, text) { - if (!(node instanceof TextNode)) { - throw new Error('Expecting a text node, but got ' + node); - } + /** + @private + @property _qp + */ + _qp: _emberMetal.computed(function () { + var _this = this; - this.assert.strictEqual(node.textContent, text, 'node.textContent'); - }; + var controllerProto = undefined, + combinedQueryParameterConfiguration = undefined; - babelHelpers.createClass(AbstractRenderingTestCase, [{ - key: 'context', - get: function () { - return this.component; - } - }]); - return AbstractRenderingTestCase; - })(_internalTestHelpersTestCasesAbstract.default); + var controllerName = this.controllerName || this.routeName; + var owner = _emberUtils.getOwner(this); + var definedControllerClass = owner[_container.LOOKUP_FACTORY]('controller:' + controllerName); + var queryParameterConfiguraton = _emberMetal.get(this, 'queryParams'); + var hasRouterDefinedQueryParams = !!Object.keys(queryParameterConfiguraton).length; - exports.default = AbstractRenderingTestCase; -}); -enifed('internal-test-helpers/test-cases/abstract', ['exports', 'ember-utils', 'ember-metal', 'ember-views', 'internal-test-helpers/equal-inner-html', 'internal-test-helpers/equal-tokens', 'internal-test-helpers/matchers'], function (exports, _emberUtils, _emberMetal, _emberViews, _internalTestHelpersEqualInnerHtml, _internalTestHelpersEqualTokens, _internalTestHelpersMatchers) { - 'use strict'; + if (definedControllerClass) { + // the developer has authored a controller class in their application for this route + // access the prototype, find its query params and normalize their object shape + // them merge in the query params for the route. As a mergedProperty, Route#queryParams is always + // at least `{}` + controllerProto = definedControllerClass.proto(); - var TextNode = window.Text; - var HTMLElement = window.HTMLElement; - var Comment = window.Comment; + var controllerDefinedQueryParameterConfiguration = _emberMetal.get(controllerProto, 'queryParams'); + var normalizedControllerQueryParameterConfiguration = _emberRoutingUtils.normalizeControllerQueryParams(controllerDefinedQueryParameterConfiguration); + combinedQueryParameterConfiguration = mergeEachQueryParams(normalizedControllerQueryParameterConfiguration, queryParameterConfiguraton); + } 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(_emberUtils.getOwner(this), controllerName); + controllerProto = generatedControllerClass.proto(); + combinedQueryParameterConfiguration = queryParameterConfiguraton; + } - function isMarker(node) { - if (node instanceof Comment && node.textContent === '') { - return true; - } + var qps = []; + var map = {}; + var propertyNames = []; - if (node instanceof TextNode && node.textContent === '') { - return true; - } + for (var propName in combinedQueryParameterConfiguration) { + if (!combinedQueryParameterConfiguration.hasOwnProperty(propName)) { + continue; + } - return false; - } + // to support the dubious feature of using unknownProperty + // on queryParams configuration + if (propName === 'unknownProperty' || propName === '_super') { + // possible todo: issue deprecation warning? + continue; + } - var AbstractTestCase = (function () { - function AbstractTestCase() { - babelHelpers.classCallCheck(this, AbstractTestCase); + var desc = combinedQueryParameterConfiguration[propName]; + var scope = desc.scope || 'model'; + var parts = undefined; - this.element = null; - this.snapshot = null; - this.assert = QUnit.config.current.assert; - } + if (scope === 'controller') { + parts = []; + } - AbstractTestCase.prototype.teardown = function teardown() {}; + var urlKey = desc.as || this.serializeQueryParamKey(propName); + var defaultValue = _emberMetal.get(controllerProto, propName); - AbstractTestCase.prototype.runTask = function runTask(callback) { - _emberMetal.run(callback); - }; + if (Array.isArray(defaultValue)) { + defaultValue = _emberRuntime.A(defaultValue.slice()); + } - AbstractTestCase.prototype.runTaskNext = function runTaskNext(callback) { - _emberMetal.run.next(callback); - }; + var type = desc.type || _emberRuntime.typeOf(defaultValue); - // The following methods require `this.element` to work + var defaultValueSerialized = this.serializeQueryParam(defaultValue, urlKey, type); + var scopedPropertyName = controllerName + ':' + propName; + var qp = { + undecoratedDefaultValue: _emberMetal.get(controllerProto, propName), + defaultValue: defaultValue, + serializedDefaultValue: defaultValueSerialized, + serializedValue: defaultValueSerialized, - AbstractTestCase.prototype.nthChild = function nthChild(n) { - var i = 0; - var node = this.element.firstChild; + type: type, + urlKey: urlKey, + prop: propName, + scopedPropertyName: scopedPropertyName, + controllerName: controllerName, + route: this, + parts: parts, // provided later when stashNames is called if 'model' scope + values: null, // provided later when setup is called. no idea why. + scope: scope + }; - while (node) { - if (!isMarker(node)) { - i++; + map[propName] = map[urlKey] = map[scopedPropertyName] = qp; + qps.push(qp); + propertyNames.push(propName); + } + + return { + qps: qps, + map: map, + propertyNames: propertyNames, + states: { + /* + Called when a query parameter changes in the URL, this route cares + about that query parameter, but the route is not currently + in the active route hierarchy. + */ + inactive: function (prop, value) { + var qp = map[prop]; + _this._qpChanged(prop, value, qp); + }, + /* + Called when a query parameter changes in the URL, this route cares + about that query parameter, and the route is currently + in the active route hierarchy. + */ + active: function (prop, value) { + var qp = map[prop]; + _this._qpChanged(prop, value, qp); + return _this._activeQPChanged(map[prop], value); + }, + /* + Called when a value of a query parameter this route handles changes in a controller + and the route is currently in the active route hierarchy. + */ + allowOverrides: function (prop, value) { + var qp = map[prop]; + _this._qpChanged(prop, value, qp); + return _this._updatingQPChanged(map[prop]); + } } + }; + }), - if (i > n) { - break; - } else { - node = node.nextSibling; + /** + @private + @property _names + */ + _names: null, + + /** + @private + @method _stashNames + */ + _stashNames: function (handlerInfo, dynamicParent) { + if (this._names) { + return; + } + var names = this._names = handlerInfo._names; + + if (!names.length) { + handlerInfo = dynamicParent; + names = handlerInfo && handlerInfo._names || []; + } + + var qps = _emberMetal.get(this, '_qp.qps'); + + var namePaths = new Array(names.length); + for (var a = 0; a < names.length; ++a) { + namePaths[a] = handlerInfo.name + '.' + names[a]; + } + + for (var i = 0; i < qps.length; ++i) { + var qp = qps[i]; + if (qp.scope === 'model') { + qp.parts = namePaths; } } + }, - return node; - }; + /** + @private + @property _activeQPChanged + */ + _activeQPChanged: function (qp, value) { + var router = this.router; + router._activeQPChanged(qp.scopedPropertyName, value); + }, - AbstractTestCase.prototype.$ = function $(sel) { - return sel ? _emberViews.jQuery(sel, this.element) : _emberViews.jQuery(this.element); - }; + /** + @private + @method _updatingQPChanged + */ + _updatingQPChanged: function (qp) { + var router = this.router; + router._updatingQPChanged(qp.urlKey); + }, + + mergedProperties: ['queryParams'], + + /** + Returns a hash containing the parameters of an ancestor route. + Example + ```app/router.js + // ... + Router.map(function() { + this.route('member', { path: ':name' }, function() { + this.route('interest', { path: ':interest' }); + }); + }); + ``` + ```app/routes/member.js + export default Ember.Route.extend({ + queryParams: { + memberQp: { refreshModel: true } + } + }); + ``` + ```app/routes/member/interest.js + export default Ember.Route.extend({ + queryParams: { + interestQp: { refreshModel: true } + }, + model() { + return this.paramsFor('member'); + } + }); + ``` + If we visit `/turing/maths?memberQp=member&interestQp=interest` the model for + the `member.interest` route is hash with: + * `name`: `turing` + * `memberQp`: `member` + @method paramsFor + @param {String} name + @return {Object} hash containing the parameters of the route `name` + @since 1.4.0 + @public + */ + paramsFor: function (name) { + var _this2 = this; - AbstractTestCase.prototype.textValue = function textValue() { - return this.$().text(); - }; + var route = _emberUtils.getOwner(this).lookup('route:' + name); - AbstractTestCase.prototype.takeSnapshot = function takeSnapshot() { - var snapshot = this.snapshot = []; + if (!route) { + return {}; + } - var node = this.element.firstChild; + var transition = this.router.router.activeTransition; + var state = transition ? transition.state : this.router.router.state; - while (node) { - if (!isMarker(node)) { - snapshot.push(node); - } + var fullName = route.fullRouteName; + var params = _emberUtils.assign({}, state.params[fullName]); + var queryParams = getQueryParamsFor(route, state); - node = node.nextSibling; - } + return Object.keys(queryParams).reduce(function (params, key) { + _emberMetal.assert('The route \'' + _this2.routeName + '\' has both a dynamic segment and query param with name \'' + key + '\'. Please rename one to avoid collisions.', !params[key]); + params[key] = queryParams[key]; + return params; + }, params); + }, - return snapshot; - }; + /** + Serializes the query parameter key + @method serializeQueryParamKey + @param {String} controllerPropertyName + @private + */ + serializeQueryParamKey: function (controllerPropertyName) { + return controllerPropertyName; + }, - AbstractTestCase.prototype.assertText = function assertText(text) { - this.assert.strictEqual(this.textValue(), text, '#qunit-fixture content should be: `' + text + '`'); - }; + /** + Serializes value of the query parameter based on defaultValueType + @method serializeQueryParam + @param {Object} value + @param {String} urlKey + @param {String} defaultValueType + @private + */ + serializeQueryParam: function (value, urlKey, defaultValueType) { + // urlKey isn't used here, but anyone overriding + // can use it to provide serialization specific + // to a certain query param. + return this.router._serializeQueryParam(value, defaultValueType); + }, - AbstractTestCase.prototype.assertInnerHTML = function assertInnerHTML(html) { - _internalTestHelpersEqualInnerHtml.default(this.element, html); - }; + /** + Deserializes value of the query parameter based on defaultValueType + @method deserializeQueryParam + @param {Object} value + @param {String} urlKey + @param {String} defaultValueType + @private + */ + deserializeQueryParam: function (value, urlKey, defaultValueType) { + // urlKey isn't used here, but anyone overriding + // can use it to provide deserialization specific + // to a certain query param. + return this.router._deserializeQueryParam(value, defaultValueType); + }, - AbstractTestCase.prototype.assertHTML = function assertHTML(html) { - _internalTestHelpersEqualTokens.default(this.element, html, '#qunit-fixture content should be: `' + html + '`'); - }; + /** + @private + @property _optionsForQueryParam + */ + _optionsForQueryParam: function (qp) { + return _emberMetal.get(this, 'queryParams.' + qp.urlKey) || _emberMetal.get(this, 'queryParams.' + qp.prop) || {}; + }, - AbstractTestCase.prototype.assertElement = function assertElement(node, _ref) { - var _ref$ElementType = _ref.ElementType; - var ElementType = _ref$ElementType === undefined ? HTMLElement : _ref$ElementType; - var tagName = _ref.tagName; - var _ref$attrs = _ref.attrs; - var attrs = _ref$attrs === undefined ? null : _ref$attrs; - var _ref$content = _ref.content; - var content = _ref$content === undefined ? null : _ref$content; + /** + A hook you can use to reset controller values either when the model + changes or the route is exiting. + ```app/routes/articles.js + import Ember from 'ember'; + export default Ember.Route.extend({ + resetController(controller, isExiting, transition) { + if (isExiting) { + controller.set('page', 1); + } + } + }); + ``` + @method resetController + @param {Controller} controller instance + @param {Boolean} isExiting + @param {Object} transition + @since 1.7.0 + @public + */ + resetController: K, - if (!(node instanceof ElementType)) { - throw new Error('Expecting a ' + ElementType.name + ', but got ' + node); - } + /** + @private + @method exit + */ + exit: function () { + this.deactivate(); + this.trigger('deactivate'); + this.teardownViews(); + }, - _internalTestHelpersMatchers.equalsElement(node, tagName, attrs, content); - }; + /** + @private + @method _reset + @since 1.7.0 + */ + _reset: function (isExiting, transition) { + var controller = this.controller; + controller._qpDelegate = _emberMetal.get(this, '_qp.states.inactive'); - AbstractTestCase.prototype.assertComponentElement = function assertComponentElement(node, _ref2) { - var _ref2$ElementType = _ref2.ElementType; - var ElementType = _ref2$ElementType === undefined ? HTMLElement : _ref2$ElementType; - var _ref2$tagName = _ref2.tagName; - var tagName = _ref2$tagName === undefined ? 'div' : _ref2$tagName; - var _ref2$attrs = _ref2.attrs; - var attrs = _ref2$attrs === undefined ? null : _ref2$attrs; - var _ref2$content = _ref2.content; - var content = _ref2$content === undefined ? null : _ref2$content; + this.resetController(controller, isExiting, transition); + }, - attrs = _emberUtils.assign({}, { id: _internalTestHelpersMatchers.regex(/^ember\d*$/), class: _internalTestHelpersMatchers.classes('ember-view') }, attrs || {}); - this.assertElement(node, { ElementType: ElementType, tagName: tagName, attrs: attrs, content: content }); - }; + /** + @private + @method enter + */ + enter: function () { + this.connections = []; + this.activate(); + this.trigger('activate'); + }, - AbstractTestCase.prototype.assertSameNode = function assertSameNode(actual, expected) { - this.assert.strictEqual(actual, expected, 'DOM node stability'); - }; + /** + The name of the template to use by default when rendering this routes + template. + ```app/routes/posts/list.js + import Ember from 'ember'; + export default Ember.Route.extend({ + templateName: 'posts/list' + }); + ``` + ```app/routes/posts/index.js + import PostsList from '../posts/list'; + export default PostsList.extend(); + ``` + ```app/routes/posts/archived.js + import PostsList from '../posts/list'; + export default PostsList.extend(); + ``` + @property templateName + @type String + @default null + @since 1.4.0 + @public + */ + templateName: null, - AbstractTestCase.prototype.assertInvariants = function assertInvariants(oldSnapshot, newSnapshot) { - oldSnapshot = oldSnapshot || this.snapshot; - newSnapshot = newSnapshot || this.takeSnapshot(); + /** + The name of the controller to associate with this route. + By default, Ember will lookup a route's controller that matches the name + of the route (i.e. `App.PostController` for `App.PostRoute`). However, + if you would like to define a specific controller to use, you can do so + using this property. + This is useful in many ways, as the controller specified will be: + * passed to the `setupController` method. + * used as the controller for the template being rendered by the route. + * returned from a call to `controllerFor` for the route. + @property controllerName + @type String + @default null + @since 1.4.0 + @public + */ + controllerName: null, - this.assert.strictEqual(newSnapshot.length, oldSnapshot.length, 'Same number of nodes'); + /** + The `willTransition` action is fired at the beginning of any + attempted transition with a `Transition` object as the sole + argument. This action can be used for aborting, redirecting, + or decorating the transition from the currently active routes. + A good example is preventing navigation when a form is + half-filled out: + ```app/routes/contact-form.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + willTransition(transition) { + if (this.controller.get('userHasEnteredData')) { + this.controller.displayNavigationConfirm(); + transition.abort(); + } + } + } + }); + ``` + You can also redirect elsewhere by calling + `this.transitionTo('elsewhere')` from within `willTransition`. + Note that `willTransition` will not be fired for the + redirecting `transitionTo`, since `willTransition` doesn't + fire when there is already a transition underway. If you want + subsequent `willTransition` actions to fire for the redirecting + transition, you must first explicitly call + `transition.abort()`. + To allow the `willTransition` event to continue bubbling to the parent + route, use `return true;`. When the `willTransition` method has a + return value of `true` then the parent route's `willTransition` method + will be fired, enabling "bubbling" behavior for the event. + @event willTransition + @param {Transition} transition + @since 1.0.0 + @public + */ - for (var i = 0; i < oldSnapshot.length; i++) { - this.assertSameNode(newSnapshot[i], oldSnapshot[i]); - } - }; + /** + The `didTransition` action is fired after a transition has + successfully been completed. This occurs after the normal model + hooks (`beforeModel`, `model`, `afterModel`, `setupController`) + have resolved. The `didTransition` action has no arguments, + however, it can be useful for tracking page views or resetting + state on the controller. + ```app/routes/login.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + didTransition() { + this.controller.get('errors.base').clear(); + return true; // Bubble the didTransition event + } + } + }); + ``` + @event didTransition + @since 1.2.0 + @public + */ - AbstractTestCase.prototype.assertPartialInvariants = function assertPartialInvariants(start, end) { - this.assertInvariants(this.snapshot, this.takeSnapshot().slice(start, end)); - }; + /** + The `loading` action is fired on the route when a route's `model` + hook returns a promise that is not already resolved. The current + `Transition` object is the first parameter and the route that + triggered the loading event is the second parameter. + ```app/routes/application.js + export default Ember.Route.extend({ + actions: { + loading(transition, route) { + let controller = this.controllerFor('foo'); + controller.set('currentlyLoading', true); + transition.finally(function() { + controller.set('currentlyLoading', false); + }); + } + } + }); + ``` + @event loading + @param {Transition} transition + @param {Ember.Route} route The route that triggered the loading event + @since 1.2.0 + @public + */ - AbstractTestCase.prototype.assertStableRerender = function assertStableRerender() { - var _this = this; + /** + When attempting to transition into a route, any of the hooks + may return a promise that rejects, at which point an `error` + action will be fired on the partially-entered routes, allowing + for per-route error handling logic, or shared error handling + logic defined on a parent route. + Here is an example of an error handler that will be invoked + for rejected promises from the various hooks on the route, + as well as any unhandled errors from child routes: + ```app/routes/admin.js + import Ember from 'ember'; + export default Ember.Route.extend({ + beforeModel() { + return Ember.RSVP.reject('bad things!'); + }, + actions: { + error(error, transition) { + // Assuming we got here due to the error in `beforeModel`, + // we can expect that error === "bad things!", + // but a promise model rejecting would also + // call this hook, as would any errors encountered + // in `afterModel`. + // The `error` hook is also provided the failed + // `transition`, which can be stored and later + // `.retry()`d if desired. + this.transitionTo('login'); + } + } + }); + ``` + `error` actions that bubble up all the way to `ApplicationRoute` + will fire a default error handler that logs the error. You can + specify your own global default error handler by overriding the + `error` handler on `ApplicationRoute`: + ```app/routes/application.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + error(error, transition) { + this.controllerFor('banner').displayError(error.message); + } + } + }); + ``` + @event error + @param {Error} error + @param {Transition} transition + @since 1.0.0 + @public + */ - this.takeSnapshot(); - this.runTask(function () { - return _this.rerender(); + /** + This event is triggered when the router enters the route. It is + not executed when the model for the route changes. + ```app/routes/application.js + import Ember from 'ember'; + export default Ember.Route.extend({ + collectAnalytics: Ember.on('activate', function(){ + collectAnalytics(); + }) }); - this.assertInvariants(); - }; + ``` + @event activate + @since 1.9.0 + @public + */ - babelHelpers.createClass(AbstractTestCase, [{ - key: 'firstChild', - get: function () { - return this.nthChild(0); - } - }, { - key: 'nodesCount', - get: function () { - var count = 0; - var node = this.element.firstChild; + /** + This event is triggered when the router completely exits this + route. It is not executed when the model for the route changes. + ```app/routes/index.js + import Ember from 'ember'; + export default Ember.Route.extend({ + trackPageLeaveAnalytics: Ember.on('deactivate', function(){ + trackPageLeaveAnalytics(); + }) + }); + ``` + @event deactivate + @since 1.9.0 + @public + */ - while (node) { - if (!isMarker(node)) { - count++; + /** + The controller associated with this route. + Example + ```app/routes/form.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + willTransition(transition) { + if (this.controller.get('userHasEnteredData') && + !confirm('Are you sure you want to abandon progress?')) { + transition.abort(); + } else { + // Bubble the `willTransition` action so that + // parent routes can decide whether or not to abort. + return true; + } } - - node = node.nextSibling; } + }); + ``` + @property controller + @type Ember.Controller + @since 1.6.0 + @public + */ - return count; - } - }]); - return AbstractTestCase; - })(); - - exports.default = AbstractTestCase; -}); -enifed('internal-test-helpers/test-cases/application', ['exports', 'internal-test-helpers/test-cases/abstract-application'], function (exports, _internalTestHelpersTestCasesAbstractApplication) { - 'use strict'; + actions: { - var ApplicationTestCase = (function (_AbstractApplicationTestCase) { - babelHelpers.inherits(ApplicationTestCase, _AbstractApplicationTestCase); + /** + This action is called when one or more query params have changed. Bubbles. + @method queryParamsDidChange + @param changed {Object} Keys are names of query params that have changed. + @param totalPresent {Object} Keys are names of query params that are currently set. + @param removed {Object} Keys are names of query params that have been removed. + @returns {boolean} + @private + */ + queryParamsDidChange: function (changed, totalPresent, removed) { + var qpMap = _emberMetal.get(this, '_qp').map; - function ApplicationTestCase() { - babelHelpers.classCallCheck(this, ApplicationTestCase); + var totalChanged = Object.keys(changed).concat(Object.keys(removed)); + for (var i = 0; i < totalChanged.length; ++i) { + var qp = qpMap[totalChanged[i]]; + if (qp && _emberMetal.get(this._optionsForQueryParam(qp), 'refreshModel') && this.router.currentState) { + this.refresh(); + break; + } + } - _AbstractApplicationTestCase.apply(this, arguments); - } + return true; + }, - return ApplicationTestCase; - })(_internalTestHelpersTestCasesAbstractApplication.default); + finalizeQueryParamChange: function (params, finalParams, transition) { + if (this.fullRouteName !== 'application') { + return true; + } - exports.default = ApplicationTestCase; -}); -enifed('internal-test-helpers/test-cases/query-param', ['exports', 'ember-runtime', 'ember-routing', 'ember-metal', 'internal-test-helpers/test-cases/application'], function (exports, _emberRuntime, _emberRouting, _emberMetal, _internalTestHelpersTestCasesApplication) { - 'use strict'; + // Transition object is absent for intermediate transitions. + if (!transition) { + return; + } - var QueryParamTestCase = (function (_ApplicationTestCase) { - babelHelpers.inherits(QueryParamTestCase, _ApplicationTestCase); + var handlerInfos = transition.state.handlerInfos; + var router = this.router; + var qpMeta = router._queryParamsFor(handlerInfos); + var changes = router._qpUpdates; + var replaceUrl = undefined; - function QueryParamTestCase() { - babelHelpers.classCallCheck(this, QueryParamTestCase); + _emberRoutingUtils.stashParamNames(router, handlerInfos); - _ApplicationTestCase.call(this); + for (var i = 0; i < qpMeta.qps.length; ++i) { + var qp = qpMeta.qps[i]; + var route = qp.route; + var controller = route.controller; + var presentKey = qp.urlKey in params && qp.urlKey; - var testCase = this; - testCase.expectedPushURL = null; - testCase.expectedReplaceURL = null; - this.application.register('location:test', _emberRouting.NoneLocation.extend({ - setURL: function (path) { - if (testCase.expectedReplaceURL) { - testCase.assert.ok(false, 'pushState occurred but a replaceState was expected'); + // Do a reverse lookup to see if the changed query + // param URL key corresponds to a QP property on + // this controller. + var value = undefined, + svalue = undefined; + if (changes && qp.urlKey in changes) { + // Value updated in/before setupController + value = _emberMetal.get(controller, qp.prop); + svalue = route.serializeQueryParam(value, qp.urlKey, qp.type); + } else { + if (presentKey) { + svalue = params[presentKey]; + value = route.deserializeQueryParam(svalue, qp.urlKey, qp.type); + } else { + // No QP provided; use default value. + svalue = qp.serializedDefaultValue; + value = copyDefaultValue(qp.defaultValue); + } } - if (testCase.expectedPushURL) { - testCase.assert.equal(path, testCase.expectedPushURL, 'an expected pushState occurred'); - testCase.expectedPushURL = null; + controller._qpDelegate = _emberMetal.get(route, '_qp.states.inactive'); + + var thisQueryParamChanged = svalue !== qp.serializedValue; + if (thisQueryParamChanged) { + if (transition.queryParamsOnly && replaceUrl !== false) { + var options = route._optionsForQueryParam(qp); + var replaceConfigValue = _emberMetal.get(options, 'replace'); + if (replaceConfigValue) { + replaceUrl = true; + } else if (replaceConfigValue === false) { + // Explicit pushState wins over any other replaceStates. + replaceUrl = false; + } + } + + _emberMetal.set(controller, qp.prop, value); } - this.set('path', path); - }, - - replaceURL: function (path) { - if (testCase.expectedPushURL) { - testCase.assert.ok(false, 'replaceState occurred but a pushState was expected'); - } + // Stash current serialized value of controller. + qp.serializedValue = svalue; - if (testCase.expectedReplaceURL) { - testCase.assert.equal(path, testCase.expectedReplaceURL, 'an expected replaceState occurred'); - testCase.expectedReplaceURL = null; + var thisQueryParamHasDefaultValue = qp.serializedDefaultValue === svalue; + if (!thisQueryParamHasDefaultValue) { + finalParams.push({ + value: svalue, + visible: true, + key: presentKey || qp.urlKey + }); } - - this.set('path', path); } - })); - } - - QueryParamTestCase.prototype.visitAndAssert = function visitAndAssert(path) { - var _this = this; - - return this.visit.apply(this, arguments).then(function () { - _this.assertCurrentPath(path); - }); - }; - - QueryParamTestCase.prototype.getController = function getController(name) { - return this.applicationInstance.lookup('controller:' + name); - }; - QueryParamTestCase.prototype.getRoute = function getRoute(name) { - return this.applicationInstance.lookup('route:' + name); - }; + if (replaceUrl) { + transition.method('replace'); + } - QueryParamTestCase.prototype.setAndFlush = function setAndFlush(obj, prop, value) { - return _emberMetal.run(obj, 'set', prop, value); - }; + qpMeta.qps.forEach(function (qp) { + var routeQpMeta = _emberMetal.get(qp.route, '_qp'); + var finalizedController = qp.route.controller; + finalizedController._qpDelegate = _emberMetal.get(routeQpMeta, 'states.active'); + }); - QueryParamTestCase.prototype.assertCurrentPath = function assertCurrentPath(path) { - var message = arguments.length <= 1 || arguments[1] === undefined ? 'current path equals \'' + path + '\'' : arguments[1]; - return (function () { - this.assert.equal(this.appRouter.get('location.path'), path, message); - }).apply(this, arguments); - }; + router._qpUpdates = null; + } + }, /** - Sets up a Controller for a given route with a single query param and default - value. Can optionally extend the controller with an object. - @public - @method setSingleQPController + This hook is executed when the router completely exits this route. It is + not executed when the model for the route changes. + @method deactivate + @since 1.0.0 + @public */ - - QueryParamTestCase.prototype.setSingleQPController = function setSingleQPController(routeName) { - var param = arguments.length <= 1 || arguments[1] === undefined ? 'foo' : arguments[1]; - var defaultValue = arguments.length <= 2 || arguments[2] === undefined ? 'bar' : arguments[2]; - - var _Controller$extend; - - var options = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3]; - - this.registerController(routeName, _emberRuntime.Controller.extend((_Controller$extend = { - queryParams: [param] - }, _Controller$extend[param] = defaultValue, _Controller$extend), options)); - }; + deactivate: K, /** - Sets up a Controller for a given route with a custom property/url key mapping. - @public - @method setMappedQPController + This hook is executed when the router enters the route. It is not executed + when the model for the route changes. + @method activate + @since 1.0.0 + @public */ + activate: K, - QueryParamTestCase.prototype.setMappedQPController = function setMappedQPController(routeName) { - var prop = arguments.length <= 1 || arguments[1] === undefined ? 'page' : arguments[1]; - var urlKey = arguments.length <= 2 || arguments[2] === undefined ? 'parentPage' : arguments[2]; - var defaultValue = arguments.length <= 3 || arguments[3] === undefined ? 1 : arguments[3]; + /** + Transition the application into another route. The route may + be either a single route or route path: + ```javascript + this.transitionTo('blogPosts'); + this.transitionTo('blogPosts.recentEntries'); + ``` + Optionally supply a model for the route in question. The model + will be serialized into the URL using the `serialize` hook of + the route: + ```javascript + this.transitionTo('blogPost', aPost); + ``` + If a literal is passed (such as a number or a string), it will + be treated as an identifier instead. In this case, the `model` + hook of the route will be triggered: + ```javascript + this.transitionTo('blogPost', 1); + ``` + Multiple models will be applied last to first recursively up the + route tree. + ```app/routes.js + // ... + Router.map(function() { + this.route('blogPost', { path:':blogPostId' }, function() { + this.route('blogComment', { path: ':blogCommentId' }); + }); + }); + export default Router; + ``` + ```javascript + this.transitionTo('blogComment', aPost, aComment); + this.transitionTo('blogComment', 1, 13); + ``` + It is also possible to pass a URL (a string that starts with a + `/`). This is intended for testing and debugging purposes and + should rarely be used in production code. + ```javascript + this.transitionTo('/'); + this.transitionTo('/blog/post/1/comment/13'); + this.transitionTo('/blog/posts?sort=title'); + ``` + An options hash with a `queryParams` property may be provided as + the final argument to add query parameters to the destination URL. + ```javascript + this.transitionTo('blogPost', 1, { + queryParams: { showComments: 'true' } + }); + // if you just want to transition the query parameters without changing the route + this.transitionTo({ queryParams: { sort: 'date' } }); + ``` + See also [replaceWith](#method_replaceWith). + Simple Transition Example + ```app/routes.js + // ... + Router.map(function() { + this.route('index'); + this.route('secret'); + this.route('fourOhFour', { path: '*:' }); + }); + export default Router; + ``` + ```app/routes/index.js + import Ember from 'ember': + export Ember.Route.extend({ + actions: { + moveToSecret(context) { + if (authorized()) { + this.transitionTo('secret', context); + } else { + this.transitionTo('fourOhFour'); + } + } + } + }); + ``` + Transition to a nested route + ```app/router.js + // ... + Router.map(function() { + this.route('articles', { path: '/articles' }, function() { + this.route('new'); + }); + }); + export default Router; + ``` + ```app/routes/index.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + transitionToNewArticle() { + this.transitionTo('articles.new'); + } + } + }); + ``` + Multiple Models Example + ```app/router.js + // ... + Router.map(function() { + this.route('index'); + this.route('breakfast', { path: ':breakfastId' }, function() { + this.route('cereal', { path: ':cerealId' }); + }); + }); + export default Router; + ``` + ```app/routes/index.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + moveToChocolateCereal() { + let cereal = { cerealId: 'ChocolateYumminess' }; + let breakfast = { breakfastId: 'CerealAndMilk' }; + this.transitionTo('breakfast.cereal', breakfast, cereal); + } + } + }); + ``` + Nested Route with Query String Example + ```app/routes.js + // ... + Router.map(function() { + this.route('fruits', function() { + this.route('apples'); + }); + }); + export default Router; + ``` + ```app/routes/index.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + transitionToApples() { + this.transitionTo('fruits.apples', { queryParams: { color: 'red' } }); + } + } + }); + ``` + @method transitionTo + @param {String} name the name of the route or a URL + @param {...Object} models the model(s) or identifier(s) to be used while + transitioning to the route. + @param {Object} [options] optional hash with a queryParams property + containing a mapping of query parameters + @return {Transition} the transition object associated with this + attempted transition + @since 1.0.0 + @public + */ + transitionTo: function (name, context) { + var router = this.router; + return router.transitionTo.apply(router, _emberRoutingUtils.prefixRouteNameArg(this, arguments)); + }, - var _queryParams, _Controller$extend2; + /** + Perform a synchronous transition into another route without attempting + to resolve promises, update the URL, or abort any currently active + asynchronous transitions (i.e. regular transitions caused by + `transitionTo` or URL changes). + This method is handy for performing intermediate transitions on the + way to a final destination route, and is called internally by the + default implementations of the `error` and `loading` handlers. + @method intermediateTransitionTo + @param {String} name the name of the route + @param {...Object} models the model(s) to be used while transitioning + to the route. + @since 1.2.0 + @public + */ + intermediateTransitionTo: function () { + var router = this.router; + router.intermediateTransitionTo.apply(router, _emberRoutingUtils.prefixRouteNameArg(this, arguments)); + }, - var options = arguments.length <= 4 || arguments[4] === undefined ? {} : arguments[4]; + /** + Refresh the model on this route and any child routes, firing the + `beforeModel`, `model`, and `afterModel` hooks in a similar fashion + to how routes are entered when transitioning in from other route. + The current route params (e.g. `article_id`) will be passed in + to the respective model hooks, and if a different model is returned, + `setupController` and associated route hooks will re-fire as well. + An example usage of this method is re-querying the server for the + latest information using the same parameters as when the route + was first entered. + Note that this will cause `model` hooks to fire even on routes + that were provided a model object when the route was initially + entered. + @method refresh + @return {Transition} the transition object associated with this + attempted transition + @since 1.4.0 + @public + */ + refresh: function () { + return this.router.router.refresh(this); + }, - this.registerController(routeName, _emberRuntime.Controller.extend((_Controller$extend2 = { - queryParams: (_queryParams = {}, _queryParams[prop] = urlKey, _queryParams) - }, _Controller$extend2[prop] = defaultValue, _Controller$extend2), options)); - }; + /** + Transition into another route while replacing the current URL, if possible. + This will replace the current history entry instead of adding a new one. + Beside that, it is identical to `transitionTo` in all other respects. See + 'transitionTo' for additional information regarding multiple models. + Example + ```app/router.js + // ... + Router.map(function() { + this.route('index'); + this.route('secret'); + }); + export default Router; + ``` + ```app/routes/secret.js + import Ember from 'ember'; + export default Ember.Route.extend({ + afterModel() { + if (!authorized()){ + this.replaceWith('index'); + } + } + }); + ``` + @method replaceWith + @param {String} name the name of the route or a URL + @param {...Object} models the model(s) or identifier(s) to be used while + transitioning to the route. + @return {Transition} the transition object associated with this + attempted transition + @since 1.0.0 + @public + */ + replaceWith: function () { + var router = this.router; + return router.replaceWith.apply(router, _emberRoutingUtils.prefixRouteNameArg(this, arguments)); + }, - babelHelpers.createClass(QueryParamTestCase, [{ - key: 'routerOptions', - get: function () { - return { - location: 'test' - }; + /** + Sends an action to the router, which will delegate it to the currently + active route hierarchy per the bubbling rules explained under `actions`. + Example + ```app/router.js + // ... + Router.map(function() { + this.route('index'); + }); + export default Router; + ``` + ```app/routes/application.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + track(arg) { + console.log(arg, 'was clicked'); + } + } + }); + ``` + ```app/routes/index.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + trackIfDebug(arg) { + if (debug) { + this.send('track', arg); + } + } + } + }); + ``` + @method send + @param {String} name the name of the action to trigger + @param {...*} args + @since 1.0.0 + @public + */ + send: function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } - }]); - return QueryParamTestCase; - })(_internalTestHelpersTestCasesApplication.default); - - exports.default = QueryParamTestCase; -}); -enifed('internal-test-helpers/test-cases/rendering', ['exports', 'ember-views', 'internal-test-helpers/test-cases/abstract-rendering'], function (exports, _emberViews, _internalTestHelpersTestCasesAbstractRendering) { - 'use strict'; - - var RenderingTestCase = (function (_AbstractRenderingTestCase) { - babelHelpers.inherits(RenderingTestCase, _AbstractRenderingTestCase); - - function RenderingTestCase() { - babelHelpers.classCallCheck(this, RenderingTestCase); - - _AbstractRenderingTestCase.call(this); - var owner = this.owner; - - this.env = owner.lookup('service:-glimmer-environment'); - owner.register('component-lookup:main', _emberViews.ComponentLookup); - owner.registerOptionsForType('helper', { instantiate: false }); - owner.registerOptionsForType('component', { singleton: false }); - } - - return RenderingTestCase; - })(_internalTestHelpersTestCasesAbstractRendering.default); - - exports.default = RenderingTestCase; -}); -enifed('internal-test-helpers/test-groups', ['exports', 'ember-environment', 'ember-metal'], function (exports, _emberEnvironment, _emberMetal) { - 'use strict'; - - exports.testBoth = testBoth; - exports.testWithDefault = testWithDefault; - - // used by unit tests to test both accessor mode and non-accessor mode - - function testBoth(testname, callback) { - function emberget(x, y) { - return _emberMetal.get(x, y); - } - function emberset(x, y, z) { - return _emberMetal.set(x, y, z); - } - function aget(x, y) { - return x[y]; - } - function aset(x, y, z) { - return x[y] = z; - } - QUnit.test(testname + ' using getFromEmberMetal()/Ember.set()', function () { - callback(emberget, emberset); - }); + if (this.router && this.router.router || !_emberMetal.isTesting()) { + var _router; - QUnit.test(testname + ' using accessors', function () { - if (_emberEnvironment.ENV.USES_ACCESSORS) { - callback(aget, aset); + (_router = this.router).send.apply(_router, args); } else { - ok('SKIPPING ACCESSORS'); + var _name2 = args[0]; + args = slice.call(args, 1); + var action = this.actions[_name2]; + if (action) { + return this.actions[_name2].apply(this, args); + } } - }); - } - - function testWithDefault(testname, callback) { - function emberget(x, y) { - return _emberMetal.get(x, y); - } - function embergetwithdefault(x, y, z) { - return _emberMetal.getWithDefault(x, y, z); - } - function getwithdefault(x, y, z) { - return x.getWithDefault(y, z); - } - function emberset(x, y, z) { - return _emberMetal.set(x, y, z); - } - function aget(x, y) { - return x[y]; - } - function aset(x, y, z) { - return x[y] = z; - } - - QUnit.test(testname + ' using obj.get()', function () { - callback(emberget, emberset); - }); + }, - QUnit.test(testname + ' using obj.getWithDefault()', function () { - callback(getwithdefault, emberset); - }); + /** + This hook is the entry point for router.js + @private + @method setup + */ + setup: function (context, transition) { + var _this3 = this; - QUnit.test(testname + ' using getFromEmberMetal()', function () { - callback(emberget, emberset); - }); + var controller = undefined; - QUnit.test(testname + ' using Ember.getWithDefault()', function () { - callback(embergetwithdefault, emberset); - }); + var controllerName = this.controllerName || this.routeName; + var definedController = this.controllerFor(controllerName, true); - QUnit.test(testname + ' using accessors', function () { - if (_emberEnvironment.ENV.USES_ACCESSORS) { - callback(aget, aset); + if (!definedController) { + controller = this.generateController(controllerName); } else { - ok('SKIPPING ACCESSORS'); + controller = definedController; } - }); - } -}); -enifed('glimmer-node/index', ['exports', 'glimmer-node/lib/node-dom-helper'], function (exports, _glimmerNodeLibNodeDomHelper) { - 'use strict'; - exports.NodeDOMTreeConstruction = _glimmerNodeLibNodeDomHelper.default; -}); + // Assign the route's controller so that it can more easily be + // referenced in action handlers. Side effects. Side effects everywhere. + if (!this.controller) { + var propNames = _emberMetal.get(this, '_qp.propertyNames'); + addQueryParamsObservers(controller, propNames); + this.controller = controller; + } -enifed('glimmer-node/lib/node-dom-helper', ['exports', 'glimmer-runtime'], function (exports, _glimmerRuntime) { - 'use strict'; + var queryParams = _emberMetal.get(this, '_qp'); - var NodeDOMTreeConstruction = (function (_DOMTreeConstruction) { - babelHelpers.inherits(NodeDOMTreeConstruction, _DOMTreeConstruction); + var states = queryParams.states; - function NodeDOMTreeConstruction(doc) { - _DOMTreeConstruction.call(this, doc); - } + controller._qpDelegate = states.allowOverrides; - // override to prevent usage of `this.document` until after the constructor + if (transition) { + (function () { + // Update the model dep values used to calculate cache keys. + _emberRoutingUtils.stashParamNames(_this3.router, transition.state.handlerInfos); - NodeDOMTreeConstruction.prototype.setupUselessElement = function setupUselessElement() {}; + var params = transition.params; + var allParams = queryParams.propertyNames; + var cache = _this3._bucketCache; - NodeDOMTreeConstruction.prototype.insertHTMLBefore = function insertHTMLBefore(parent, html, reference) { - var prev = reference ? reference.previousSibling : parent.lastChild; - var raw = this.document.createRawHTMLSection(html); - parent.insertBefore(raw, reference); - var first = prev ? prev.nextSibling : parent.firstChild; - var last = reference ? reference.previousSibling : parent.lastChild; - return new _glimmerRuntime.ConcreteBounds(parent, first, last); - }; + allParams.forEach(function (prop) { + var aQp = queryParams.map[prop]; - // override to avoid SVG detection/work when in node (this is not needed in SSR) + aQp.values = params; + var cacheKey = _emberRoutingUtils.calculateCacheKey(aQp.route.fullRouteName, aQp.parts, aQp.values); - NodeDOMTreeConstruction.prototype.createElement = function createElement(tag) { - return this.document.createElement(tag); - }; + if (cache) { + var value = cache.lookup(cacheKey, prop, aQp.undecoratedDefaultValue); + _emberMetal.set(controller, prop, value); + } + }); + })(); + } - // override to avoid namespace shenanigans when in node (this is not needed in SSR) + if (transition) { + var qpValues = getQueryParamsFor(this, transition.state); + controller.setProperties(qpValues); + } - NodeDOMTreeConstruction.prototype.setAttribute = function setAttribute(element, name, value) { - element.setAttribute(name, value); - }; + this.setupController(controller, context, transition); - return NodeDOMTreeConstruction; - })(_glimmerRuntime.DOMTreeConstruction); + if (this._environment.options.shouldRender) { + this.renderTemplate(controller, context); + } + }, - exports.default = NodeDOMTreeConstruction; -}); + /* + 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 + value in the cache so if this route becomes active, the cache value has been updated. + */ + _qpChanged: function (prop, value, qp) { + if (!qp) { + return; + } -enifed('glimmer-reference/index', ['exports', 'glimmer-reference/lib/reference', 'glimmer-reference/lib/const', 'glimmer-reference/lib/validators', 'glimmer-reference/lib/utils', 'glimmer-reference/lib/iterable'], function (exports, _glimmerReferenceLibReference, _glimmerReferenceLibConst, _glimmerReferenceLibValidators, _glimmerReferenceLibUtils, _glimmerReferenceLibIterable) { - 'use strict'; + var cacheKey = _emberRoutingUtils.calculateCacheKey(qp.route.fullRouteName, qp.parts, qp.values); - exports.BasicReference = _glimmerReferenceLibReference.Reference; - exports.BasicPathReference = _glimmerReferenceLibReference.PathReference; - exports.ConstReference = _glimmerReferenceLibConst.ConstReference; - exports.isConst = _glimmerReferenceLibConst.isConst; - babelHelpers.defaults(exports, babelHelpers.interopExportWildcard(_glimmerReferenceLibValidators, babelHelpers.defaults)); - exports.Reference = _glimmerReferenceLibValidators.VersionedReference; - exports.PathReference = _glimmerReferenceLibValidators.VersionedPathReference; - exports.referenceFromParts = _glimmerReferenceLibUtils.referenceFromParts; - exports.IterationItem = _glimmerReferenceLibIterable.IterationItem; - exports.Iterator = _glimmerReferenceLibIterable.Iterator; - exports.Iterable = _glimmerReferenceLibIterable.Iterable; - exports.OpaqueIterator = _glimmerReferenceLibIterable.OpaqueIterator; - exports.OpaqueIterable = _glimmerReferenceLibIterable.OpaqueIterable; - exports.AbstractIterator = _glimmerReferenceLibIterable.AbstractIterator; - exports.AbstractIterable = _glimmerReferenceLibIterable.AbstractIterable; - exports.IterationArtifacts = _glimmerReferenceLibIterable.IterationArtifacts; - exports.ReferenceIterator = _glimmerReferenceLibIterable.ReferenceIterator; - exports.IteratorSynchronizer = _glimmerReferenceLibIterable.IteratorSynchronizer; - exports.IteratorSynchronizerDelegate = _glimmerReferenceLibIterable.IteratorSynchronizerDelegate; -}); - -enifed('glimmer-reference/lib/const', ['exports', 'glimmer-reference/lib/validators'], function (exports, _glimmerReferenceLibValidators) { - 'use strict'; + // Update model-dep cache + var cache = this._bucketCache; + if (cache) { + cache.stash(cacheKey, prop, value); + } + }, - exports.isConst = isConst; + /** + This hook is the first of the route entry validation hooks + called when an attempt is made to transition into a route + or one of its children. It is called before `model` and + `afterModel`, and is appropriate for cases when: + 1) A decision can be made to redirect elsewhere without + needing to resolve the model first. + 2) Any async operations need to occur first before the + model is attempted to be resolved. + This hook is provided the current `transition` attempt + as a parameter, which can be used to `.abort()` the transition, + save it for a later `.retry()`, or retrieve values set + on it from a previous hook. You can also just call + `this.transitionTo` to another route to implicitly + abort the `transition`. + You can return a promise from this hook to pause the + transition until the promise resolves (or rejects). This could + be useful, for instance, for retrieving async code from + the server that is required to enter a route. + @method beforeModel + @param {Transition} transition + @return {Promise} if the value returned from this hook is + a promise, the transition will pause until the transition + resolves. Otherwise, non-promise return values are not + utilized in any way. + @since 1.0.0 + @public + */ + beforeModel: K, - var ConstReference = (function () { - function ConstReference(inner) { - this.inner = inner; - this.tag = _glimmerReferenceLibValidators.CONSTANT_TAG; + /** + This hook is called after this route's model has resolved. + It follows identical async/promise semantics to `beforeModel` + but is provided the route's resolved model in addition to + the `transition`, and is therefore suited to performing + logic that can only take place after the model has already + resolved. + ```app/routes/posts.js + import Ember from 'ember'; + export default Ember.Route.extend({ + afterModel(posts, transition) { + if (posts.get('length') === 1) { + this.transitionTo('post.show', posts.get('firstObject')); + } } + }); + ``` + Refer to documentation for `beforeModel` for a description + of transition-pausing semantics when a promise is returned + from this hook. + @method afterModel + @param {Object} resolvedModel the value returned from `model`, + or its resolved value if it was a promise + @param {Transition} transition + @return {Promise} if the value returned from this hook is + a promise, the transition will pause until the transition + resolves. Otherwise, non-promise return values are not + utilized in any way. + @since 1.0.0 + @public + */ + afterModel: K, - ConstReference.prototype.value = function value() { - return this.inner; - }; - - return ConstReference; - })(); + /** + A hook you can implement to optionally redirect to another route. + If you call `this.transitionTo` from inside of this hook, this route + will not be entered in favor of the other hook. + `redirect` and `afterModel` behave very similarly and are + called almost at the same time, but they have an important + distinction in the case that, from one of these hooks, a + redirect into a child route of this route occurs: redirects + from `afterModel` essentially invalidate the current attempt + to enter this route, and will result in this route's `beforeModel`, + `model`, and `afterModel` hooks being fired again within + the new, redirecting transition. Redirects that occur within + the `redirect` hook, on the other hand, will _not_ cause + these hooks to be fired again the second time around; in + other words, by the time the `redirect` hook has been called, + both the resolved model and attempted entry into this route + are considered to be fully validated. + @method redirect + @param {Object} model the model for this route + @param {Transition} transition the transition object associated with the current transition + @since 1.0.0 + @public + */ + redirect: K, - exports.ConstReference = ConstReference; + /** + Called when the context is changed by router.js. + @private + @method contextDidChange + */ + contextDidChange: function () { + this.currentModel = this.context; + }, - function isConst(reference) { - return reference.tag === _glimmerReferenceLibValidators.CONSTANT_TAG; - } -}); + /** + A hook you can implement to convert the URL into the model for + this route. + ```app/router.js + // ... + Router.map(function() { + this.route('post', { path: '/posts/:post_id' }); + }); + export default Router; + ``` + The model for the `post` route is `store.findRecord('post', params.post_id)`. + By default, if your route has a dynamic segment ending in `_id`: + * The model class is determined from the segment (`post_id`'s + class is `App.Post`) + * The find method is called on the model class with the value of + the dynamic segment. + Note that for routes with dynamic segments, this hook is not always + executed. If the route is entered through a transition (e.g. when + using the `link-to` Handlebars helper or the `transitionTo` method + of routes), and a model context is already provided this hook + is not called. + A model context does not include a primitive string or number, + which does cause the model hook to be called. + Routes without dynamic segments will always execute the model hook. + ```javascript + // no dynamic segment, model hook always called + this.transitionTo('posts'); + // model passed in, so model hook not called + thePost = store.findRecord('post', 1); + this.transitionTo('post', thePost); + // integer passed in, model hook is called + this.transitionTo('post', 1); + // model id passed in, model hook is called + // useful for forcing the hook to execute + thePost = store.findRecord('post', 1); + this.transitionTo('post', thePost.id); + ``` + This hook follows the asynchronous/promise semantics + described in the documentation for `beforeModel`. In particular, + if a promise returned from `model` fails, the error will be + handled by the `error` hook on `Ember.Route`. + Example + ```app/routes/post.js + import Ember from 'ember'; + export default Ember.Route.extend({ + model(params) { + return this.store.findRecord('post', params.post_id); + } + }); + ``` + @method model + @param {Object} params the parameters extracted from the URL + @param {Transition} transition + @return {Object|Promise} the model for this route. If + a promise is returned, the transition will pause until + the promise resolves, and the resolved value of the promise + will be used as the model for this route. + @since 1.0.0 + @public + */ + model: function (params, transition) { + var name = undefined, + sawParams = undefined, + value = undefined; + var queryParams = _emberMetal.get(this, '_qp.map'); -enifed("glimmer-reference/lib/iterable", ["exports", "glimmer-util"], function (exports, _glimmerUtil) { - "use strict"; + for (var prop in params) { + if (prop === 'queryParams' || queryParams && prop in queryParams) { + continue; + } - var ListItem = (function (_ListNode) { - babelHelpers.inherits(ListItem, _ListNode); + var match = prop.match(/^(.*)_id$/); + if (match) { + name = match[1]; + value = params[prop]; + } + sawParams = true; + } - function ListItem(iterable, result) { - _ListNode.call(this, iterable.valueReferenceFor(result)); - this.retained = false; - this.seen = false; - this.key = result.key; - this.iterable = iterable; - this.memo = iterable.memoReferenceFor(result); + if (!name && sawParams) { + return _emberRuntime.copy(params); + } else if (!name) { + if (transition.resolveIndex < 1) { + return; } - ListItem.prototype.update = function update(item) { - this.retained = true; - this.iterable.updateValueReference(this.value, item); - this.iterable.updateMemoReference(this.memo, item); - }; + return transition.state.handlerInfos[transition.resolveIndex - 1].context; + } - ListItem.prototype.shouldRemove = function shouldRemove() { - return !this.retained; - }; + return this.findModel(name, value); + }, - ListItem.prototype.reset = function reset() { - this.retained = false; - this.seen = false; - }; + /** + @private + @method deserialize + @param {Object} params the parameters extracted from the URL + @param {Transition} transition + @return {Object|Promise} the model for this route. + Router.js hook. + */ + deserialize: function (params, transition) { + return this.model(this.paramsFor(this.routeName), transition); + }, - return ListItem; - })(_glimmerUtil.ListNode); + /** + @method findModel + @param {String} type the model type + @param {Object} value the value passed to find + @private + */ + findModel: function () { + var store = _emberMetal.get(this, 'store'); + return store.find.apply(store, arguments); + }, - exports.ListItem = ListItem; + /** + Store property provides a hook for data persistence libraries to inject themselves. + By default, this store property provides the exact same functionality previously + in the model hook. + Currently, the required interface is: + `store.find(modelName, findArguments)` + @method store + @param {Object} store + @private + */ + store: _emberMetal.computed(function () { + var owner = _emberUtils.getOwner(this); + var routeName = this.routeName; + var namespace = _emberMetal.get(this, 'router.namespace'); - var IterationArtifacts = (function () { - function IterationArtifacts(iterable) { - this.map = _glimmerUtil.dict(); - this.list = new _glimmerUtil.LinkedList(); - this.tag = iterable.tag; - this.iterable = iterable; - } + return { + find: function (name, value) { + var modelClass = owner[_container.FACTORY_FOR]('model:' + name); - IterationArtifacts.prototype.isEmpty = function isEmpty() { - var iterator = this.iterator = this.iterable.iterate(); - return iterator.isEmpty(); - }; + _emberMetal.assert('You used the dynamic segment ' + name + '_id in your route ' + routeName + ', but ' + namespace + '.' + _emberRuntime.String.classify(name) + ' did not exist and you did not override your route\'s `model` hook.', !!modelClass); - IterationArtifacts.prototype.iterate = function iterate() { - var iterator = this.iterator || this.iterable.iterate(); - this.iterator = null; - return iterator; - }; + if (!modelClass) { + return; + } - IterationArtifacts.prototype.has = function has(key) { - return !!this.map[key]; - }; + modelClass = modelClass.class; - IterationArtifacts.prototype.get = function get(key) { - return this.map[key]; - }; + _emberMetal.assert(_emberRuntime.String.classify(name) + ' has no method `find`.', typeof modelClass.find === 'function'); - IterationArtifacts.prototype.wasSeen = function wasSeen(key) { - var node = this.map[key]; - return node && node.seen; - }; + return modelClass.find(value); + } + }; + }), - IterationArtifacts.prototype.append = function append(item) { - var map = this.map; - var list = this.list; - var iterable = this.iterable; + /** + A hook you can implement to convert the route's model into parameters + for the URL. + ```app/router.js + // ... + Router.map(function() { + this.route('post', { path: '/posts/:post_id' }); + }); + ``` + ```app/routes/post.js + import Ember from 'ember'; + export default Ember.Route.extend({ + model(params) { + // the server returns `{ id: 12 }` + return Ember.$.getJSON('/posts/' + params.post_id); + }, + serialize(model) { + // this will make the URL `/posts/12` + return { post_id: model.id }; + } + }); + ``` + The default `serialize` method will insert the model's `id` into the + route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'. + If the route has multiple dynamic segments or does not contain '_id', `serialize` + will return `Ember.getProperties(model, params)` + This method is called when `transitionTo` is called with a context + in order to populate the URL. + @method serialize + @param {Object} model the routes model + @param {Array} params an Array of parameter names for the current + route (in the example, `['post_id']`. + @return {Object} the serialized parameters + @since 1.0.0 + @public + */ + serialize: defaultSerialize, - var node = map[item.key] = new ListItem(iterable, item); - list.append(node); - return node; - }; + /** + A hook you can use to setup the controller for the current route. + This method is called with the controller for the current route and the + model supplied by the `model` hook. + By default, the `setupController` hook sets the `model` property of + the controller to the `model`. + If you implement the `setupController` hook in your Route, it will + prevent this default behavior. If you want to preserve that behavior + when implementing your `setupController` function, make sure to call + `_super`: + ```app/routes/photos.js + import Ember from 'ebmer'; + export default Ember.Route.extend({ + model() { + return this.store.findAll('photo'); + }, + setupController(controller, model) { + // Call _super for default behavior + this._super(controller, model); + // Implement your custom setup after + this.controllerFor('application').set('showingPhotos', true); + } + }); + ``` + The provided controller will be one resolved based on the name + of this route. + If no explicit controller is defined, Ember will automatically create one. + As an example, consider the router: + ```app/router.js + // ... + Router.map(function() { + this.route('post', { path: '/posts/:post_id' }); + }); + export default Router; + ``` + For the `post` route, a controller named `App.PostController` would + be used if it is defined. If it is not defined, a basic `Ember.Controller` + instance would be used. + Example + ```app/routes/post.js + import Ember from 'ember'; + export default Ember.Route.extend({ + setupController(controller, model) { + controller.set('model', model); + } + }); + ``` + @method setupController + @param {Controller} controller instance + @param {Object} model + @since 1.0.0 + @public + */ + setupController: function (controller, context, transition) { + if (controller && context !== undefined) { + _emberMetal.set(controller, 'model', context); + } + }, - IterationArtifacts.prototype.insertBefore = function insertBefore(item, reference) { - var map = this.map; - var list = this.list; - var iterable = this.iterable; + /** + Returns the resolved model of the current route, or a parent (or any ancestor) + route in a route hierarchy. + The controller instance must already have been created, either through entering the + associated route or using `generateController`. + ```app/routes/post.js + import Ember from 'ember'; + export default Ember.Route.extend({ + setupController(controller, post) { + this._super(controller, post); + this.controllerFor('posts').set('currentPost', post); + } + }); + ``` + @method controllerFor + @param {String} name the name of the route or controller + @return {Ember.Controller} + @since 1.0.0 + @public + */ + controllerFor: function (name, _skipAssert) { + var owner = _emberUtils.getOwner(this); + var route = owner.lookup('route:' + name); + var controller = undefined; - var node = map[item.key] = new ListItem(iterable, item); - node.retained = true; - list.insertBefore(node, reference); - return node; - }; + if (route && route.controllerName) { + name = route.controllerName; + } - IterationArtifacts.prototype.move = function move(item, reference) { - var list = this.list; + controller = owner.lookup('controller:' + name); - item.retained = true; - list.remove(item); - list.insertBefore(item, reference); - }; + // NOTE: We're specifically checking that skipAssert is true, because according + // to the old API the second parameter was model. We do not want people who + // passed a model to skip the assertion. + _emberMetal.assert('The controller named \'' + name + '\' could not be found. Make sure that this route exists and has already been entered at least once. If you are accessing a controller not associated with a route, make sure the controller class is explicitly defined.', controller || _skipAssert === true); - IterationArtifacts.prototype.remove = function remove(item) { - var list = this.list; + return controller; + }, - list.remove(item); - delete this.map[item.key]; - }; + /** + Generates a controller for a route. + Example + ```app/routes/post.js + import Ember from 'ember'; + export default Ember.Route.extend({ + setupController(controller, post) { + this._super(controller, post); + this.generateController('posts'); + } + }); + ``` + @method generateController + @param {String} name the name of the controller + @private + */ + generateController: function (name) { + var owner = _emberUtils.getOwner(this); - IterationArtifacts.prototype.nextNode = function nextNode(item) { - return this.list.nextNode(item); - }; + return _emberRoutingSystemGenerate_controller.default(owner, name); + }, - IterationArtifacts.prototype.head = function head() { - return this.list.head(); - }; + /** + Returns the resolved model of a parent (or any ancestor) route + in a route hierarchy. During a transition, all routes + must resolve a model object, and if a route + needs access to a parent route's model in order to + resolve a model (or just reuse the model from a parent), + it can call `this.modelFor(theNameOfParentRoute)` to + retrieve it. If the ancestor route's model was a promise, + its resolved result is returned. + Example + ```app/router.js + // ... + Router.map(function() { + this.route('post', { path: '/posts/:post_id' }, function() { + this.route('comments'); + }); + }); + export default Router; + ``` + ```app/routes/comments.js + import Ember from 'ember'; + export default Ember.Route.extend({ + model() { + let post = this.modelFor('post'); + return post.get('comments'); + } + }); + ``` + @method modelFor + @param {String} name the name of the route + @return {Object} the model object + @since 1.0.0 + @public + */ + modelFor: function (_name) { + var name = undefined; + var owner = _emberUtils.getOwner(this); - return IterationArtifacts; - })(); + // Only change the route name when there is an active transition. + // Otherwise, use the passed in route name. + if (owner.routable && this.router && this.router.router.activeTransition) { + name = getEngineRouteName(owner, _name); + } else { + name = _name; + } + + var route = _emberUtils.getOwner(this).lookup('route:' + name); + var transition = this.router ? this.router.router.activeTransition : null; - exports.IterationArtifacts = IterationArtifacts; + // If we are mid-transition, we want to try and look up + // resolved parent contexts on the current transitionEvent. + if (transition) { + var modelLookupName = route && route.routeName || name; + if (transition.resolvedModels.hasOwnProperty(modelLookupName)) { + return transition.resolvedModels[modelLookupName]; + } + } - var ReferenceIterator = (function () { - // if anyone needs to construct this object with something other than - // an iterable, let @wycats know. + return route && route.currentModel; + }, - function ReferenceIterator(iterable) { - this.iterator = null; - var artifacts = new IterationArtifacts(iterable); - this.artifacts = artifacts; + /** + A hook you can use to render the template for the current route. + This method is called with the controller for the current route and the + model supplied by the `model` hook. By default, it renders the route's + template, configured with the controller for the route. + This method can be overridden to set up and render additional or + alternative templates. + ```app/routes/posts.js + import Ember from 'ember'; + export default Ember.Route.extend({ + renderTemplate(controller, model) { + let favController = this.controllerFor('favoritePost'); + // Render the `favoritePost` template into + // the outlet `posts`, and display the `favoritePost` + // controller. + this.render('favoritePost', { + outlet: 'posts', + controller: favController + }); } + }); + ``` + @method renderTemplate + @param {Object} controller the route's controller + @param {Object} model the route's model + @since 1.0.0 + @public + */ + renderTemplate: function (controller, model) { + this.render(); + }, - ReferenceIterator.prototype.next = function next() { - var artifacts = this.artifacts; - - var iterator = this.iterator = this.iterator || artifacts.iterate(); - var item = iterator.next(); - if (!item) return null; - return artifacts.append(item); - }; + /** + `render` is used to render a template into a region of another template + (indicated by an `{{outlet}}`). `render` is used both during the entry + phase of routing (via the `renderTemplate` hook) and later in response to + user interaction. + For example, given the following minimal router and templates: + ```app/router.js + // ... + Router.map(function() { + this.route('photos'); + }); + export default Router; + ``` + ```handlebars + +
    + {{outlet "anOutletName"}} +
    + ``` + ```handlebars + +

    Photos

    + ``` + You can render `photos.hbs` into the `"anOutletName"` outlet of + `application.hbs` by calling `render`: + ```app/routes/post.js + import Ember from 'ember'; + export default Ember.Route.extend({ + renderTemplate() { + this.render('photos', { + into: 'application', + outlet: 'anOutletName' + }) + } + }); + ``` + `render` additionally allows you to supply which `controller` and + `model` objects should be loaded and associated with the rendered template. + ```app/routes/posts.js + import Ember from 'ember'; + export default Ember.Route.extend({ + renderTemplate(controller, model){ + this.render('posts', { // the template to render, referenced by name + into: 'application', // the template to render into, referenced by name + outlet: 'anOutletName', // the outlet inside `options.template` to render into. + controller: 'someControllerName', // the controller to use for this template, referenced by name + model: model // the model to set on `options.controller`. + }) + } + }); + ``` + The string values provided for the template name, and controller + will eventually pass through to the resolver for lookup. See + Ember.Resolver for how these are mapped to JavaScript objects in your + application. The template to render into needs to be related to either the + current route or one of its ancestors. + Not all options need to be passed to `render`. Default values will be used + based on the name of the route specified in the router or the Route's + `controllerName` and `templateName` properties. + For example: + ```app/router.js + // ... + Router.map(function() { + this.route('index'); + this.route('post', { path: '/posts/:post_id' }); + }); + export default Router; + ``` + ```app/routes/post.js + import Ember from 'ember'; + export default Ember.Route.extend({ + renderTemplate() { + this.render(); // all defaults apply + } + }); + ``` + The name of the route, defined by the router, is `post`. + The following equivalent default options will be applied when + the Route calls `render`: + ```javascript + this.render('post', { // the template name associated with 'post' Route + into: 'application', // the parent route to 'post' Route + outlet: 'main', // {{outlet}} and {{outlet 'main'}} are synonymous, + controller: 'post', // the controller associated with the 'post' Route + }) + ``` + By default the controller's `model` will be the route's model, so it does not + need to be passed unless you wish to change which model is being used. + @method render + @param {String} name the name of the template to render + @param {Object} [options] the options + @param {String} [options.into] the template to render into, + referenced by name. Defaults to the parent template + @param {String} [options.outlet] the outlet inside `options.template` to render into. + Defaults to 'main' + @param {String|Object} [options.controller] the controller to use for this template, + referenced by name or as a controller instance. Defaults to the Route's paired controller + @param {Object} [options.model] the model object to set on `options.controller`. + Defaults to the return value of the Route's model hook + @since 1.0.0 + @public + */ + render: function (_name, options) { + _emberMetal.assert('The name in the given arguments is undefined', arguments.length > 0 ? !_emberMetal.isNone(arguments[0]) : true); - return ReferenceIterator; - })(); + var namePassed = typeof _name === 'string' && !!_name; + var isDefaultRender = arguments.length === 0 || _emberMetal.isEmpty(arguments[0]); + var name = undefined; - exports.ReferenceIterator = ReferenceIterator; + if (typeof _name === 'object' && !options) { + name = this.templateName || this.routeName; + options = _name; + } else { + name = _name; + } - var Phase; - (function (Phase) { - Phase[Phase["Append"] = 0] = "Append"; - Phase[Phase["Prune"] = 1] = "Prune"; - Phase[Phase["Done"] = 2] = "Done"; - })(Phase || (Phase = {})); + var renderOptions = buildRenderOptions(this, namePassed, isDefaultRender, name, options); + this.connections.push(renderOptions); + _emberMetal.run.once(this.router, '_setOutlets'); + }, - var IteratorSynchronizer = (function () { - function IteratorSynchronizer(_ref) { - var target = _ref.target; - var artifacts = _ref.artifacts; + /** + Disconnects a view that has been rendered into an outlet. + You may pass any or all of the following options to `disconnectOutlet`: + * `outlet`: the name of the outlet to clear (default: 'main') + * `parentView`: the name of the view containing the outlet to clear + (default: the view rendered by the parent route) + Example: + ```app/routes/application.js + import Ember from 'ember'; + export default App.Route.extend({ + actions: { + showModal(evt) { + this.render(evt.modalName, { + outlet: 'modal', + into: 'application' + }); + }, + hideModal(evt) { + this.disconnectOutlet({ + outlet: 'modal', + parentView: 'application' + }); + } + } + }); + ``` + Alternatively, you can pass the `outlet` name directly as a string. + Example: + ```app/routes/application.js + import Ember from 'ember'; + export default App.Route.extend({ + actions: { + showModal(evt) { + // ... + }, + hideModal(evt) { + this.disconnectOutlet('modal'); + } + } + }); + @method disconnectOutlet + @param {Object|String} options the options hash or outlet name + @since 1.0.0 + @public + */ + disconnectOutlet: function (options) { + var outletName = undefined; + var parentView = undefined; + if (!options || typeof options === 'string') { + outletName = options; + } else { + outletName = options.outlet; + parentView = options.parentView; - this.target = target; - this.artifacts = artifacts; - this.iterator = artifacts.iterate(); - this.current = artifacts.head(); + if (options && Object.keys(options).indexOf('outlet') !== -1 && typeof options.outlet === 'undefined') { + throw new _emberMetal.Error('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++) { + // This non-local state munging is sadly necessary to maintain + // backward compatibility with our existing semantics, which allow + // any route to disconnectOutlet things originally rendered by any + // other route. This should all get cut in 2.0. + this.router.router.currentHandlerInfos[i].handler._disconnectOutlet(outletName, parentView); + } + }, - IteratorSynchronizer.prototype.sync = function sync() { - var phase = Phase.Append; - while (true) { - switch (phase) { - case Phase.Append: - phase = this.nextAppend(); - break; - case Phase.Prune: - phase = this.nextPrune(); - break; - case Phase.Done: - this.nextDone(); - return; - } - } - }; + _disconnectOutlet: function (outletName, parentView) { + var parent = parentRoute(this); + if (parent && parentView === parent.routeName) { + parentView = undefined; + } + for (var i = 0; i < this.connections.length; i++) { + var connection = this.connections[i]; + if (connection.outlet === outletName && connection.into === parentView) { + // This neuters the disconnected outlet such that it doesn't + // render anything, but it leaves an entry in the outlet + // 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, + controller: undefined, + template: undefined, + ViewClass: undefined + }; + _emberMetal.run.once(this.router, '_setOutlets'); + } + } + }, - IteratorSynchronizer.prototype.advanceToKey = function advanceToKey(key) { - var current = this.current; - var artifacts = this.artifacts; + willDestroy: function () { + this.teardownViews(); + }, - var seek = current; - while (seek && seek.key !== key) { - seek.seen = true; - seek = artifacts.nextNode(seek); - } - this.current = seek && artifacts.nextNode(seek); - }; + /** + @private + @method teardownViews + */ + teardownViews: function () { + if (this.connections && this.connections.length > 0) { + this.connections = []; + _emberMetal.run.once(this.router, '_setOutlets'); + } + } + }); - IteratorSynchronizer.prototype.nextAppend = function nextAppend() { - var iterator = this.iterator; - var current = this.current; - var artifacts = this.artifacts; + _emberRuntime.deprecateUnderscoreActions(Route); - var item = iterator.next(); - if (item === null) { - return this.startPrune(); - } - var key = item.key; + Route.reopenClass({ + isRouteFactory: true + }); - if (current && current.key === key) { - this.nextRetain(item); - } else if (artifacts.has(key)) { - this.nextMove(item); - } else { - this.nextInsert(item); - } - return Phase.Append; - }; + function parentRoute(route) { + var handlerInfo = handlerInfoFor(route, route.router.router.state.handlerInfos, -1); + return handlerInfo && handlerInfo.handler; + } - IteratorSynchronizer.prototype.nextRetain = function nextRetain(item) { - var artifacts = this.artifacts; - var current = this.current; + function handlerInfoFor(route, handlerInfos) { + var offset = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2]; - current.update(item); - this.current = artifacts.nextNode(current); - this.target.retain(item.key, current.value, current.memo); - }; + if (!handlerInfos) { + return; + } - IteratorSynchronizer.prototype.nextMove = function nextMove(item) { - var current = this.current; - var artifacts = this.artifacts; - var target = this.target; - var key = item.key; + var current = undefined; + for (var i = 0; i < handlerInfos.length; i++) { + current = handlerInfos[i].handler; + if (current === route) { + return handlerInfos[i + offset]; + } + } + } - var found = artifacts.get(item.key); - found.update(item); - if (artifacts.wasSeen(item.key)) { - artifacts.move(found, current); - target.move(found.key, found.value, found.memo, current ? current.key : null); - } else { - this.advanceToKey(key); - } - }; + function buildRenderOptions(route, namePassed, isDefaultRender, _name, options) { + var into = options && options.into && options.into.replace(/\//g, '.'); + var outlet = options && options.outlet || 'main'; - IteratorSynchronizer.prototype.nextInsert = function nextInsert(item) { - var artifacts = this.artifacts; - var target = this.target; - var current = this.current; + var name = undefined, + templateName = undefined; + if (_name) { + name = _name.replace(/\//g, '.'); + templateName = name; + } else { + name = route.routeName; + templateName = route.templateName || name; + } - var node = artifacts.insertBefore(item, current); - target.insert(node.key, node.value, node.memo, current ? current.key : null); - }; + var owner = _emberUtils.getOwner(route); + var controller = options && options.controller; + if (!controller) { + if (namePassed) { + controller = owner.lookup('controller:' + name) || route.controllerName || route.routeName; + } else { + controller = route.controllerName || owner.lookup('controller:' + name); + } + } - IteratorSynchronizer.prototype.startPrune = function startPrune() { - this.current = this.artifacts.head(); - return Phase.Prune; - }; + if (typeof controller === 'string') { + var controllerName = controller; + controller = owner.lookup('controller:' + controllerName); + if (!controller) { + throw new _emberMetal.Error('You passed `controller: \'' + controllerName + '\'` into the `render` method, but no such controller could be found.'); + } + } - IteratorSynchronizer.prototype.nextPrune = function nextPrune() { - var artifacts = this.artifacts; - var target = this.target; - var current = this.current; + if (options && Object.keys(options).indexOf('outlet') !== -1 && typeof options.outlet === 'undefined') { + throw new _emberMetal.Error('You passed undefined as the outlet name.'); + } - if (current === null) { - return Phase.Done; - } - var node = current; - this.current = artifacts.nextNode(node); - if (node.shouldRemove()) { - artifacts.remove(node); - target.delete(node.key); - } else { - node.reset(); - } - return Phase.Prune; - }; + if (options && options.model) { + controller.set('model', options.model); + } - IteratorSynchronizer.prototype.nextDone = function nextDone() { - this.target.done(); - }; + var template = owner.lookup('template:' + templateName); - return IteratorSynchronizer; - })(); + var parent = undefined; + if (into && (parent = parentRoute(route)) && into === parent.routeName) { + into = undefined; + } - exports.IteratorSynchronizer = IteratorSynchronizer; -}); + var renderOptions = { + owner: owner, + into: into, + outlet: outlet, + name: name, + controller: controller, + template: template || route._topLevelViewTemplate, + ViewClass: undefined + }; -enifed("glimmer-reference/lib/reference", ["exports"], function (exports) { - "use strict"; -}); + _emberMetal.assert('Could not find "' + name + '" template, view, or component.', isDefaultRender || template); -enifed("glimmer-reference/lib/utils", ["exports"], function (exports) { - "use strict"; + _emberMetal.runInDebug(function () { + var LOG_VIEW_LOOKUPS = _emberMetal.get(route.router, 'namespace.LOG_VIEW_LOOKUPS'); + if (LOG_VIEW_LOOKUPS && !template) { + _emberMetal.info('Could not find "' + name + '" template. Nothing will be rendered', { fullName: 'template:' + name }); + } + }); - exports.referenceFromParts = referenceFromParts; + return renderOptions; + } - function referenceFromParts(root, parts) { - var reference = root; - for (var i = 0; i < parts.length; i++) { - reference = reference.get(parts[i]); - } - return reference; + function getFullQueryParams(router, state) { + if (state.fullQueryParams) { + return state.fullQueryParams; } -}); -enifed("glimmer-reference/lib/validators", ["exports"], function (exports) { - "use strict"; + state.fullQueryParams = {}; + _emberUtils.assign(state.fullQueryParams, state.queryParams); - exports.combineTagged = combineTagged; - exports.combineSlice = combineSlice; - exports.combine = combine; - exports.map = map; - exports.isModified = isModified; - var CONSTANT = 0; - exports.CONSTANT = CONSTANT; - var INITIAL = 1; - exports.INITIAL = INITIAL; - var VOLATILE = NaN; - exports.VOLATILE = VOLATILE; + router._deserializeQueryParams(state.handlerInfos, state.fullQueryParams); + return state.fullQueryParams; + } - var RevisionTag = (function () { - function RevisionTag() {} + function getQueryParamsFor(route, state) { + state.queryParamsFor = state.queryParamsFor || {}; + var name = route.fullRouteName; - RevisionTag.prototype.validate = function validate(snapshot) { - return this.value() === snapshot; - }; + if (state.queryParamsFor[name]) { + return state.queryParamsFor[name]; + } - return RevisionTag; - })(); + var fullQueryParams = getFullQueryParams(route.router, state); - exports.RevisionTag = RevisionTag; + var params = state.queryParamsFor[name] = {}; - var $REVISION = INITIAL; + // Copy over all the query params for this route/controller into params hash. + var qpMeta = _emberMetal.get(route, '_qp'); + var qps = qpMeta.qps; + for (var i = 0; i < qps.length; ++i) { + // Put deserialized qp on params hash. + var qp = qps[i]; + + var qpValueWasPassedIn = (qp.prop in fullQueryParams); + params[qp.prop] = qpValueWasPassedIn ? fullQueryParams[qp.prop] : copyDefaultValue(qp.defaultValue); + } + + return params; + } + + function copyDefaultValue(value) { + if (Array.isArray(value)) { + return _emberRuntime.A(value.slice()); + } + return value; + } - var DirtyableTag = (function (_RevisionTag) { - babelHelpers.inherits(DirtyableTag, _RevisionTag); + /* + Merges all query parameters from a controller with those from + a route, returning a new object and avoiding any mutations to + the existing objects. + */ + function mergeEachQueryParams(controllerQP, routeQP) { + var keysAlreadyMergedOrSkippable = undefined; + var qps = {}; - function DirtyableTag() { - var revision = arguments.length <= 0 || arguments[0] === undefined ? $REVISION : arguments[0]; + keysAlreadyMergedOrSkippable = { + defaultValue: true, + type: true, + scope: true, + as: true + }; - _RevisionTag.call(this); - this.revision = revision; - } + // 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)) { + continue; + } - DirtyableTag.prototype.value = function value() { - return this.revision; - }; + var newControllerParameterConfiguration = {}; + _emberUtils.assign(newControllerParameterConfiguration, controllerQP[cqpName]); + _emberUtils.assign(newControllerParameterConfiguration, routeQP[cqpName]); - DirtyableTag.prototype.dirty = function dirty() { - this.revision = ++$REVISION; - }; + qps[cqpName] = newControllerParameterConfiguration; - return DirtyableTag; - })(RevisionTag); + // allows us to skip this QP when we check route QPs. + keysAlreadyMergedOrSkippable[cqpName] = true; + } - exports.DirtyableTag = DirtyableTag; + // loop over all route qps, skipping those that were merged in the first pass + // because they also appear in controller qps + for (var rqpName in routeQP) { + if (!routeQP.hasOwnProperty(rqpName) || keysAlreadyMergedOrSkippable[rqpName]) { + continue; + } - function combineTagged(tagged) { - var optimized = []; - for (var i = 0, l = tagged.length; i < l; i++) { - var tag = tagged[i].tag; - if (tag === VOLATILE_TAG) return VOLATILE_TAG; - if (tag === CONSTANT_TAG) continue; - optimized.push(tag); - } - return _combine(optimized); + var newRouteParameterConfiguration = {}; + _emberUtils.assign(newRouteParameterConfiguration, routeQP[rqpName], controllerQP[rqpName]); + qps[rqpName] = newRouteParameterConfiguration; } - function combineSlice(slice) { - var optimized = []; - var node = slice.head(); - while (node !== null) { - var tag = node.tag; - if (tag === VOLATILE_TAG) return VOLATILE_TAG; - if (tag !== CONSTANT_TAG) optimized.push(tag); - node = slice.nextNode(node); - } - return _combine(optimized); - } + return qps; + } - function combine(tags) { - var optimized = []; - for (var i = 0, l = tags.length; i < l; i++) { - var tag = tags[i]; - if (tag === VOLATILE_TAG) return VOLATILE_TAG; - if (tag === CONSTANT_TAG) continue; - optimized.push(tag); - } - return _combine(optimized); - } + function addQueryParamsObservers(controller, propNames) { + propNames.forEach(function (prop) { + controller.addObserver(prop + '.[]', controller, controller._qpChanged); + }); + } - function _combine(tags) { - switch (tags.length) { - case 0: - return CONSTANT_TAG; - case 1: - return tags[0]; - case 2: - return new TagsPair(tags[0], tags[1]); - default: - return new TagsCombinator(tags); - } - ; + function getEngineRouteName(engine, routeName) { + if (engine.routable) { + var prefix = engine.mountPoint; + + if (routeName === 'application') { + return prefix; + } else { + return prefix + '.' + routeName; + } } - var CachedTag = (function (_RevisionTag2) { - babelHelpers.inherits(CachedTag, _RevisionTag2); + return routeName; + } - function CachedTag() { - _RevisionTag2.apply(this, arguments); - this.lastChecked = null; - this.lastValue = null; - } + exports.default = Route; +}); +enifed('ember-routing/system/router', ['exports', 'ember-utils', 'ember-console', 'ember-metal', 'ember-runtime', 'ember-routing/system/route', 'ember-routing/system/dsl', 'ember-routing/location/api', 'ember-routing/utils', 'ember-routing/system/router_state', 'container', 'router'], function (exports, _emberUtils, _emberConsole, _emberMetal, _emberRuntime, _emberRoutingSystemRoute, _emberRoutingSystemDsl, _emberRoutingLocationApi, _emberRoutingUtils, _emberRoutingSystemRouter_state, _container, _router5) { + 'use strict'; - CachedTag.prototype.value = function value() { - var lastChecked = this.lastChecked; - var lastValue = this.lastValue; + exports.triggerEvent = triggerEvent; - if (lastChecked !== $REVISION) { - this.lastChecked = $REVISION; - this.lastValue = lastValue = this.compute(); - } - return this.lastValue; - }; + function K() { + return this; + } - CachedTag.prototype.invalidate = function invalidate() { - this.lastChecked = null; - }; + var slice = Array.prototype.slice; - return CachedTag; - })(RevisionTag); + /** + The `Ember.Router` class manages the application state and URLs. Refer to + the [routing guide](http://emberjs.com/guides/routing/) for documentation. + + @class Router + @namespace Ember + @extends Ember.Object + @uses Ember.Evented + @public + */ + var EmberRouter = _emberRuntime.Object.extend(_emberRuntime.Evented, { + /** + The `location` property determines the type of URL's that your + application will use. + The following location types are currently available: + * `history` - use the browser's history API to make the URLs look just like any standard URL + * `hash` - use `#` to separate the server part of the URL from the Ember part: `/blog/#/posts/new` + * `none` - do not store the Ember URL in the actual browser URL (mainly used for testing) + * `auto` - use the best option based on browser capabilites: `history` if possible, then `hash` if possible, otherwise `none` + Note: If using ember-cli, this value is defaulted to `auto` by the `locationType` setting of `/config/environment.js` + @property location + @default 'hash' + @see {Ember.Location} + @public + */ + location: 'hash', - exports.CachedTag = CachedTag; + /** + Represents the URL of the root of the application, often '/'. This prefix is + assumed on all routes defined on this router. + @property rootURL + @default '/' + @public + */ + rootURL: '/', - var TagsPair = (function (_CachedTag) { - babelHelpers.inherits(TagsPair, _CachedTag); + _initRouterJs: function () { + var _this = this; - function TagsPair(first, second) { - _CachedTag.call(this); - this.first = first; - this.second = second; - } + var router = this.router = new _router5.default(); + router.triggerEvent = triggerEvent; - TagsPair.prototype.compute = function compute() { - return Math.max(this.first.value(), this.second.value()); - }; + router._triggerWillChangeContext = K; + router._triggerWillLeave = K; - return TagsPair; - })(CachedTag); + var dslCallbacks = this.constructor.dslCallbacks || [K]; + var dsl = this._buildDSL(); - var TagsCombinator = (function (_CachedTag2) { - babelHelpers.inherits(TagsCombinator, _CachedTag2); + dsl.route('application', { path: '/', resetNamespace: true, overrideNameAssertion: true }, function () { + for (var i = 0; i < dslCallbacks.length; i++) { + dslCallbacks[i].call(this); + } + }); - function TagsCombinator(tags) { - _CachedTag2.call(this); - this.tags = tags; + _emberMetal.runInDebug(function () { + if (_emberMetal.get(_this, 'namespace.LOG_TRANSITIONS_INTERNAL')) { + router.log = _emberConsole.default.debug; } + }); - TagsCombinator.prototype.compute = function compute() { - var tags = this.tags; + router.map(dsl.generate()); + }, - var max = -1; - for (var i = 0; i < tags.length; i++) { - var value = tags[i].value(); - max = Math.max(value, max); - } - return max; - }; + _buildDSL: function () { + var moduleBasedResolver = this._hasModuleBasedResolver(); + var options = { + enableLoadingSubstates: !!moduleBasedResolver + }; - return TagsCombinator; - })(CachedTag); + var owner = _emberUtils.getOwner(this); + var router = this; - var UpdatableTag = (function (_CachedTag3) { - babelHelpers.inherits(UpdatableTag, _CachedTag3); + options.resolveRouteMap = function (name) { + return owner[_container.FACTORY_FOR]('route-map:' + name); + }; - function UpdatableTag(tag) { - _CachedTag3.call(this); - this.tag = tag; - this.lastUpdated = INITIAL; + options.addRouteForEngine = function (name, engineInfo) { + if (!router._engineInfoByRoute[name]) { + router._engineInfoByRoute[name] = engineInfo; } + }; - ////////// + return new _emberRoutingSystemDsl.default(null, options); + }, - UpdatableTag.prototype.compute = function compute() { - return Math.max(this.lastUpdated, this.tag.value()); - }; + init: function () { + this._super.apply(this, arguments); - UpdatableTag.prototype.update = function update(tag) { - if (tag !== this.tag) { - this.tag = tag; - this.lastUpdated = $REVISION; - this.invalidate(); - } - }; + this.currentURL = null; + this.currentRouteName = null; + this.currentPath = null; - return UpdatableTag; - })(CachedTag); + this._qpCache = new _emberUtils.EmptyObject(); + this._resetQueuedQueryParameterChanges(); + this._handledErrors = _emberUtils.dictionary(null); + this._engineInstances = new _emberUtils.EmptyObject(); + this._engineInfoByRoute = new _emberUtils.EmptyObject(); + }, - exports.UpdatableTag = UpdatableTag; - var CONSTANT_TAG = new ((function (_RevisionTag3) { - babelHelpers.inherits(ConstantTag, _RevisionTag3); + /* + Resets all pending query paramter changes. + Called after transitioning to a new route + based on query parameter changes. + */ + _resetQueuedQueryParameterChanges: function () { + this._queuedQPChanges = {}; + }, - function ConstantTag() { - _RevisionTag3.apply(this, arguments); - } + /** + Represents the current URL. + @method url + @return {String} The current URL. + @private + */ + url: _emberMetal.computed(function () { + return _emberMetal.get(this, 'location').getURL(); + }), - ConstantTag.prototype.value = function value() { - return CONSTANT; - }; + _hasModuleBasedResolver: function () { + var owner = _emberUtils.getOwner(this); - return ConstantTag; - })(RevisionTag))(); - exports.CONSTANT_TAG = CONSTANT_TAG; - var VOLATILE_TAG = new ((function (_RevisionTag4) { - babelHelpers.inherits(VolatileTag, _RevisionTag4); + if (!owner) { + return false; + } - function VolatileTag() { - _RevisionTag4.apply(this, arguments); - } + var resolver = owner.application && owner.application.__registry__ && owner.application.__registry__.resolver; - VolatileTag.prototype.value = function value() { - return VOLATILE; - }; + if (!resolver) { + return false; + } - return VolatileTag; - })(RevisionTag))(); - exports.VOLATILE_TAG = VOLATILE_TAG; - var CURRENT_TAG = new ((function (_DirtyableTag) { - babelHelpers.inherits(CurrentTag, _DirtyableTag); + return !!resolver.moduleBasedResolver; + }, - function CurrentTag() { - _DirtyableTag.apply(this, arguments); + /** + Initializes the current router instance and sets up the change handling + event listeners used by the instances `location` implementation. + A property named `initialURL` will be used to determine the initial URL. + If no value is found `/` will be used. + @method startRouting + @private + */ + startRouting: function () { + var initialURL = _emberMetal.get(this, 'initialURL'); + + if (this.setupRouter()) { + if (typeof initialURL === 'undefined') { + initialURL = _emberMetal.get(this, 'location').getURL(); + } + var initialTransition = this.handleURL(initialURL); + if (initialTransition && initialTransition.error) { + throw initialTransition.error; } + } + }, - CurrentTag.prototype.value = function value() { - return $REVISION; - }; + setupRouter: function () { + var _this2 = this; - return CurrentTag; - })(DirtyableTag))(); - exports.CURRENT_TAG = CURRENT_TAG; + this._initRouterJs(); + this._setupLocation(); - var CachedReference = (function () { - function CachedReference() { - this.lastRevision = null; - this.lastValue = null; - } + var router = this.router; + var location = _emberMetal.get(this, 'location'); - CachedReference.prototype.value = function value() { - var tag = this.tag; - var lastRevision = this.lastRevision; - var lastValue = this.lastValue; + // Allow the Location class to cancel the router setup while it refreshes + // the page + if (_emberMetal.get(location, 'cancelRouterSetup')) { + return false; + } - if (!lastRevision || !tag.validate(lastRevision)) { - lastValue = this.lastValue = this.compute(); - this.lastRevision = tag.value(); - } - return lastValue; - }; + this._setupRouter(router, location); - CachedReference.prototype.invalidate = function invalidate() { - this.lastRevision = null; - }; + location.onUpdateURL(function (url) { + _this2.handleURL(url); + }); - return CachedReference; - })(); + return true; + }, - exports.CachedReference = CachedReference; + /** + Handles updating the paths and notifying any listeners of the URL + change. + Triggers the router level `didTransition` hook. + For example, to notify google analytics when the route changes, + you could use this hook. (Note: requires also including GA scripts, etc.) + ```javascript + let Router = Ember.Router.extend({ + location: config.locationType, + didTransition: function() { + this._super(...arguments); + return ga('send', 'pageview', { + 'page': this.get('url'), + 'title': this.get('url') + }); + } + }); + ``` + @method didTransition + @public + @since 1.2.0 + */ + didTransition: function (infos) { + var _this3 = this; - var MapperReference = (function (_CachedReference) { - babelHelpers.inherits(MapperReference, _CachedReference); + updatePaths(this); - function MapperReference(reference, mapper) { - _CachedReference.call(this); - this.tag = reference.tag; - this.reference = reference; - this.mapper = mapper; - } + this._cancelSlowTransitionTimer(); - MapperReference.prototype.compute = function compute() { - var reference = this.reference; - var mapper = this.mapper; + this.notifyPropertyChange('url'); + this.set('currentState', this.targetState); - return mapper(reference.value()); - }; + // Put this in the runloop so url will be accurate. Seems + // less surprising than didTransition being out of sync. + _emberMetal.run.once(this, this.trigger, 'didTransition'); - return MapperReference; - })(CachedReference); + _emberMetal.runInDebug(function () { + if (_emberMetal.get(_this3, 'namespace').LOG_TRANSITIONS) { + _emberConsole.default.log('Transitioned into \'' + EmberRouter._routePath(infos) + '\''); + } + }); + }, - function map(reference, mapper) { - return new MapperReference(reference, mapper); - } + _setOutlets: function () { + // This is triggered async during Ember.Route#willDestroy. + // If the router is also being destroyed we do not want to + // to create another this._toplevelView (and leak the renderer) + if (this.isDestroying || this.isDestroyed) { + return; + } - ////////// + var handlerInfos = this.router.currentHandlerInfos; + var route = undefined; + var defaultParentState = undefined; + var liveRoutes = null; - var ReferenceCache = (function () { - function ReferenceCache(reference) { - this.lastValue = null; - this.lastRevision = null; - this.initialized = false; - this.tag = reference.tag; - this.reference = reference; + if (!handlerInfos) { + return; + } + + for (var i = 0; i < handlerInfos.length; i++) { + route = handlerInfos[i].handler; + var connections = route.connections; + var ownState = undefined; + for (var j = 0; j < connections.length; j++) { + var appended = appendLiveRoute(liveRoutes, defaultParentState, connections[j]); + liveRoutes = appended.liveRoutes; + if (appended.ownState.render.name === route.routeName || appended.ownState.render.outlet === 'main') { + ownState = appended.ownState; + } } + if (connections.length === 0) { + ownState = representEmptyRoute(liveRoutes, defaultParentState, route); + } + defaultParentState = ownState; + } - ReferenceCache.prototype.peek = function peek() { - if (!this.initialized) { - return this.initialize(); - } - return this.lastValue; - }; + // when a transitionTo happens after the validation phase + // during the initial transition _setOutlets is called + // when no routes are active. However, it will get called + // again with the correct values during the next turn of + // the runloop + if (!liveRoutes) { + return; + } - ReferenceCache.prototype.revalidate = function revalidate() { - if (!this.initialized) { - return this.initialize(); - } - var reference = this.reference; - var lastRevision = this.lastRevision; + if (!this._toplevelView) { + var owner = _emberUtils.getOwner(this); + var OutletView = owner[_container.FACTORY_FOR]('view:-outlet'); + this._toplevelView = OutletView.create(); + this._toplevelView.setOutletState(liveRoutes); + var instance = owner.lookup('-application-instance:main'); + instance.didCreateRootView(this._toplevelView); + } else { + this._toplevelView.setOutletState(liveRoutes); + } + }, - var tag = reference.tag; - if (tag.validate(lastRevision)) return NOT_MODIFIED; - this.lastRevision = tag.value(); - var lastValue = this.lastValue; + /** + Handles notifying any listeners of an impending URL + change. + Triggers the router level `willTransition` hook. + @method willTransition + @public + @since 1.11.0 + */ + willTransition: function (oldInfos, newInfos, transition) { + var _this4 = this; - var value = reference.value(); - if (value === lastValue) return NOT_MODIFIED; - this.lastValue = value; - return value; - }; + _emberMetal.run.once(this, this.trigger, 'willTransition', transition); - ReferenceCache.prototype.initialize = function initialize() { - var reference = this.reference; + _emberMetal.runInDebug(function () { + if (_emberMetal.get(_this4, 'namespace').LOG_TRANSITIONS) { + _emberConsole.default.log('Preparing to transition from \'' + EmberRouter._routePath(oldInfos) + '\' to \'' + EmberRouter._routePath(newInfos) + '\''); + } + }); + }, - var value = this.lastValue = reference.value(); - this.lastRevision = reference.tag.value(); - this.initialized = true; - return value; - }; + handleURL: function (url) { + // Until we have an ember-idiomatic way of accessing #hashes, we need to + // remove it because router.js doesn't know how to handle it. + url = url.split(/#(.+)?/)[0]; + return this._doURLTransition('handleURL', url); + }, - return ReferenceCache; - })(); + _doURLTransition: function (routerJsMethod, url) { + var transition = this.router[routerJsMethod](url || '/'); + didBeginTransition(transition, this); + return transition; + }, - exports.ReferenceCache = ReferenceCache; + /** + Transition the application into another route. The route may + be either a single route or route path: + See [Route.transitionTo](http://emberjs.com/api/classes/Ember.Route.html#method_transitionTo) for more info. + @method transitionTo + @param {String} name the name of the route or a URL + @param {...Object} models the model(s) or identifier(s) to be used while + transitioning to the route. + @param {Object} [options] optional hash with a queryParams property + containing a mapping of query parameters + @return {Transition} the transition object associated with this + attempted transition + @public + */ + transitionTo: function () { + var queryParams = undefined; - var NOT_MODIFIED = "adb3b78e-3d22-4e4b-877a-6317c2c5c145"; + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - function isModified(value) { - return value !== NOT_MODIFIED; - } -}); + if (resemblesURL(args[0])) { + return this._doURLTransition('transitionTo', args[0]); + } -enifed('glimmer-runtime/index', ['exports', 'glimmer-runtime/lib/dom/interfaces', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/template', 'glimmer-runtime/lib/symbol-table', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/syntax/core', 'glimmer-runtime/lib/compiled/opcodes/builder', 'glimmer-runtime/lib/compiler', 'glimmer-runtime/lib/opcode-builder', 'glimmer-runtime/lib/compiled/blocks', 'glimmer-runtime/lib/dom/attribute-managers', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/compiled/expressions/function', 'glimmer-runtime/lib/helpers/get-dynamic-var', 'glimmer-runtime/lib/syntax/builtins/with-dynamic-vars', 'glimmer-runtime/lib/syntax/builtins/in-element', 'glimmer-runtime/lib/vm', 'glimmer-runtime/lib/upsert', 'glimmer-runtime/lib/environment', 'glimmer-runtime/lib/partial', 'glimmer-runtime/lib/component/interfaces', 'glimmer-runtime/lib/modifier/interfaces', 'glimmer-runtime/lib/dom/helper', 'glimmer-runtime/lib/builder', 'glimmer-runtime/lib/bounds'], function (exports, _glimmerRuntimeLibDomInterfaces, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibTemplate, _glimmerRuntimeLibSymbolTable, _glimmerRuntimeLibReferences, _glimmerRuntimeLibSyntaxCore, _glimmerRuntimeLibCompiledOpcodesBuilder, _glimmerRuntimeLibCompiler, _glimmerRuntimeLibOpcodeBuilder, _glimmerRuntimeLibCompiledBlocks, _glimmerRuntimeLibDomAttributeManagers, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerRuntimeLibCompiledExpressions, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibCompiledExpressionsFunction, _glimmerRuntimeLibHelpersGetDynamicVar, _glimmerRuntimeLibSyntaxBuiltinsWithDynamicVars, _glimmerRuntimeLibSyntaxBuiltinsInElement, _glimmerRuntimeLibVm, _glimmerRuntimeLibUpsert, _glimmerRuntimeLibEnvironment, _glimmerRuntimeLibPartial, _glimmerRuntimeLibComponentInterfaces, _glimmerRuntimeLibModifierInterfaces, _glimmerRuntimeLibDomHelper, _glimmerRuntimeLibBuilder, _glimmerRuntimeLibBounds) { - 'use strict'; + var possibleQueryParams = args[args.length - 1]; + if (possibleQueryParams && possibleQueryParams.hasOwnProperty('queryParams')) { + queryParams = args.pop().queryParams; + } else { + queryParams = {}; + } - exports.ATTRIBUTE_SYNTAX = _glimmerRuntimeLibSyntax.ATTRIBUTE; - exports.StatementSyntax = _glimmerRuntimeLibSyntax.Statement; - exports.ExpressionSyntax = _glimmerRuntimeLibSyntax.Expression; - exports.AttributeSyntax = _glimmerRuntimeLibSyntax.Attribute; - exports.StatementCompilationBuffer = _glimmerRuntimeLibSyntax.StatementCompilationBuffer; - exports.SymbolLookup = _glimmerRuntimeLibSyntax.SymbolLookup; - exports.CompileInto = _glimmerRuntimeLibSyntax.CompileInto; - exports.isAttribute = _glimmerRuntimeLibSyntax.isAttribute; - exports.templateFactory = _glimmerRuntimeLibTemplate.default; - exports.TemplateFactory = _glimmerRuntimeLibTemplate.TemplateFactory; - exports.Template = _glimmerRuntimeLibTemplate.Template; - exports.SymbolTable = _glimmerRuntimeLibSymbolTable.default; - exports.NULL_REFERENCE = _glimmerRuntimeLibReferences.NULL_REFERENCE; - exports.UNDEFINED_REFERENCE = _glimmerRuntimeLibReferences.UNDEFINED_REFERENCE; - exports.PrimitiveReference = _glimmerRuntimeLibReferences.PrimitiveReference; - exports.ConditionalReference = _glimmerRuntimeLibReferences.ConditionalReference; - exports.Blocks = _glimmerRuntimeLibSyntaxCore.Blocks; - exports.OptimizedAppend = _glimmerRuntimeLibSyntaxCore.OptimizedAppend; - exports.UnoptimizedAppend = _glimmerRuntimeLibSyntaxCore.UnoptimizedAppend; - exports.Unknown = _glimmerRuntimeLibSyntaxCore.Unknown; - exports.StaticAttr = _glimmerRuntimeLibSyntaxCore.StaticAttr; - exports.DynamicAttr = _glimmerRuntimeLibSyntaxCore.DynamicAttr; - exports.ArgsSyntax = _glimmerRuntimeLibSyntaxCore.Args; - exports.NamedArgsSyntax = _glimmerRuntimeLibSyntaxCore.NamedArgs; - exports.PositionalArgsSyntax = _glimmerRuntimeLibSyntaxCore.PositionalArgs; - exports.RefSyntax = _glimmerRuntimeLibSyntaxCore.Ref; - exports.GetNamedParameterSyntax = _glimmerRuntimeLibSyntaxCore.GetArgument; - exports.GetSyntax = _glimmerRuntimeLibSyntaxCore.Get; - exports.ValueSyntax = _glimmerRuntimeLibSyntaxCore.Value; - exports.OpenElement = _glimmerRuntimeLibSyntaxCore.OpenElement; - exports.HelperSyntax = _glimmerRuntimeLibSyntaxCore.Helper; - exports.BlockSyntax = _glimmerRuntimeLibSyntaxCore.Block; - exports.OpenPrimitiveElementSyntax = _glimmerRuntimeLibSyntaxCore.OpenPrimitiveElement; - exports.CloseElementSyntax = _glimmerRuntimeLibSyntaxCore.CloseElement; - exports.OpcodeBuilderDSL = _glimmerRuntimeLibCompiledOpcodesBuilder.default; - exports.Compiler = _glimmerRuntimeLibCompiler.default; - exports.Compilable = _glimmerRuntimeLibCompiler.Compilable; - exports.CompileIntoList = _glimmerRuntimeLibCompiler.CompileIntoList; - exports.compileLayout = _glimmerRuntimeLibCompiler.compileLayout; - exports.ComponentBuilder = _glimmerRuntimeLibOpcodeBuilder.ComponentBuilder; - exports.StaticDefinition = _glimmerRuntimeLibOpcodeBuilder.StaticDefinition; - exports.DynamicDefinition = _glimmerRuntimeLibOpcodeBuilder.DynamicDefinition; - exports.Block = _glimmerRuntimeLibCompiledBlocks.Block; - exports.CompiledBlock = _glimmerRuntimeLibCompiledBlocks.CompiledBlock; - exports.Layout = _glimmerRuntimeLibCompiledBlocks.Layout; - exports.InlineBlock = _glimmerRuntimeLibCompiledBlocks.InlineBlock; - exports.EntryPoint = _glimmerRuntimeLibCompiledBlocks.EntryPoint; - exports.IAttributeManager = _glimmerRuntimeLibDomAttributeManagers.AttributeManager; - exports.AttributeManager = _glimmerRuntimeLibDomAttributeManagers.AttributeManager; - exports.PropertyManager = _glimmerRuntimeLibDomAttributeManagers.PropertyManager; - exports.INPUT_VALUE_PROPERTY_MANAGER = _glimmerRuntimeLibDomAttributeManagers.INPUT_VALUE_PROPERTY_MANAGER; - exports.defaultManagers = _glimmerRuntimeLibDomAttributeManagers.defaultManagers; - exports.defaultAttributeManagers = _glimmerRuntimeLibDomAttributeManagers.defaultAttributeManagers; - exports.defaultPropertyManagers = _glimmerRuntimeLibDomAttributeManagers.defaultPropertyManagers; - exports.readDOMAttr = _glimmerRuntimeLibDomAttributeManagers.readDOMAttr; - exports.normalizeTextValue = _glimmerRuntimeLibCompiledOpcodesContent.normalizeTextValue; - exports.CompiledExpression = _glimmerRuntimeLibCompiledExpressions.CompiledExpression; - exports.CompiledArgs = _glimmerRuntimeLibCompiledExpressionsArgs.CompiledArgs; - exports.CompiledNamedArgs = _glimmerRuntimeLibCompiledExpressionsArgs.CompiledNamedArgs; - exports.CompiledPositionalArgs = _glimmerRuntimeLibCompiledExpressionsArgs.CompiledPositionalArgs; - exports.EvaluatedArgs = _glimmerRuntimeLibCompiledExpressionsArgs.EvaluatedArgs; - exports.EvaluatedNamedArgs = _glimmerRuntimeLibCompiledExpressionsArgs.EvaluatedNamedArgs; - exports.EvaluatedPositionalArgs = _glimmerRuntimeLibCompiledExpressionsArgs.EvaluatedPositionalArgs; - exports.FunctionExpression = _glimmerRuntimeLibCompiledExpressionsFunction.FunctionExpression; - exports.getDynamicVar = _glimmerRuntimeLibHelpersGetDynamicVar.default; - exports.WithDynamicVarsSyntax = _glimmerRuntimeLibSyntaxBuiltinsWithDynamicVars.default; - exports.InElementSyntax = _glimmerRuntimeLibSyntaxBuiltinsInElement.default; - exports.VM = _glimmerRuntimeLibVm.PublicVM; - exports.UpdatingVM = _glimmerRuntimeLibVm.UpdatingVM; - exports.RenderResult = _glimmerRuntimeLibVm.RenderResult; - exports.SafeString = _glimmerRuntimeLibUpsert.SafeString; - exports.isSafeString = _glimmerRuntimeLibUpsert.isSafeString; - exports.Scope = _glimmerRuntimeLibEnvironment.Scope; - exports.Environment = _glimmerRuntimeLibEnvironment.default; - exports.Helper = _glimmerRuntimeLibEnvironment.Helper; - exports.ParsedStatement = _glimmerRuntimeLibEnvironment.ParsedStatement; - exports.DynamicScope = _glimmerRuntimeLibEnvironment.DynamicScope; - exports.PartialDefinition = _glimmerRuntimeLibPartial.PartialDefinition; - exports.Component = _glimmerRuntimeLibComponentInterfaces.Component; - exports.ComponentClass = _glimmerRuntimeLibComponentInterfaces.ComponentClass; - exports.ComponentManager = _glimmerRuntimeLibComponentInterfaces.ComponentManager; - exports.ComponentDefinition = _glimmerRuntimeLibComponentInterfaces.ComponentDefinition; - exports.ComponentLayoutBuilder = _glimmerRuntimeLibComponentInterfaces.ComponentLayoutBuilder; - exports.ComponentAttrsBuilder = _glimmerRuntimeLibComponentInterfaces.ComponentAttrsBuilder; - exports.isComponentDefinition = _glimmerRuntimeLibComponentInterfaces.isComponentDefinition; - exports.ModifierManager = _glimmerRuntimeLibModifierInterfaces.ModifierManager; - exports.DOMChanges = _glimmerRuntimeLibDomHelper.default; - exports.IDOMChanges = _glimmerRuntimeLibDomHelper.DOMChanges; - exports.DOMTreeConstruction = _glimmerRuntimeLibDomHelper.DOMTreeConstruction; - exports.isWhitespace = _glimmerRuntimeLibDomHelper.isWhitespace; - exports.insertHTMLBefore = _glimmerRuntimeLibDomHelper.insertHTMLBefore; - exports.Simple = _glimmerRuntimeLibDomInterfaces; - exports.ElementStack = _glimmerRuntimeLibBuilder.ElementStack; - exports.ElementOperations = _glimmerRuntimeLibBuilder.ElementOperations; - exports.Bounds = _glimmerRuntimeLibBounds.default; - exports.ConcreteBounds = _glimmerRuntimeLibBounds.ConcreteBounds; -}); - -enifed("glimmer-runtime/lib/bounds", ["exports"], function (exports) { - "use strict"; + var targetRouteName = args.shift(); + return this._doTransition(targetRouteName, args, queryParams); + }, - exports.bounds = bounds; - exports.single = single; - exports.move = move; - exports.clear = clear; + intermediateTransitionTo: function () { + var _router, + _this5 = this; - var Cursor = function Cursor(element, nextSibling) { - this.element = element; - this.nextSibling = nextSibling; - }; + (_router = this.router).intermediateTransitionTo.apply(_router, arguments); - exports.Cursor = Cursor; + updatePaths(this); - var RealDOMBounds = (function () { - function RealDOMBounds(bounds) { - this.bounds = bounds; + _emberMetal.runInDebug(function () { + var infos = _this5.router.currentHandlerInfos; + if (_emberMetal.get(_this5, 'namespace').LOG_TRANSITIONS) { + _emberConsole.default.log('Intermediate-transitioned into \'' + EmberRouter._routePath(infos) + '\''); } + }); + }, - RealDOMBounds.prototype.parentElement = function parentElement() { - return this.bounds.parentElement(); - }; + replaceWith: function () { + return this.transitionTo.apply(this, arguments).method('replace'); + }, - RealDOMBounds.prototype.firstNode = function firstNode() { - return this.bounds.firstNode(); - }; + generate: function () { + var _router2; - RealDOMBounds.prototype.lastNode = function lastNode() { - return this.bounds.lastNode(); - }; + var url = (_router2 = this.router).generate.apply(_router2, arguments); + return this.location.formatURL(url); + }, - return RealDOMBounds; - })(); + /** + Determines if the supplied route is currently active. + @method isActive + @param routeName + @return {Boolean} + @private + */ + isActive: function (routeName) { + var router = this.router; + return router.isActive.apply(router, arguments); + }, - exports.RealDOMBounds = RealDOMBounds; + /** + An alternative form of `isActive` that doesn't require + manual concatenation of the arguments into a single + array. + @method isActiveIntent + @param routeName + @param models + @param queryParams + @return {Boolean} + @private + @since 1.7.0 + */ + isActiveIntent: function (routeName, models, queryParams) { + return this.currentState.isActiveIntent(routeName, models, queryParams); + }, - var ConcreteBounds = (function () { - function ConcreteBounds(parentNode, first, last) { - this.parentNode = parentNode; - this.first = first; - this.last = last; - } + send: function (name, context) { + var _router3; - ConcreteBounds.prototype.parentElement = function parentElement() { - return this.parentNode; - }; + (_router3 = this.router).trigger.apply(_router3, arguments); + }, - ConcreteBounds.prototype.firstNode = function firstNode() { - return this.first; - }; + /** + Does this router instance have the given route. + @method hasRoute + @return {Boolean} + @private + */ + hasRoute: function (route) { + return this.router.hasRoute(route); + }, - ConcreteBounds.prototype.lastNode = function lastNode() { - return this.last; - }; + /** + Resets the state of the router by clearing the current route + handlers and deactivating them. + @private + @method reset + */ + reset: function () { + if (this.router) { + this.router.reset(); + } + }, - return ConcreteBounds; - })(); + willDestroy: function () { + if (this._toplevelView) { + this._toplevelView.destroy(); + this._toplevelView = null; + } - exports.ConcreteBounds = ConcreteBounds; + this._super.apply(this, arguments); - var SingleNodeBounds = (function () { - function SingleNodeBounds(parentNode, node) { - this.parentNode = parentNode; - this.node = node; - } + this.reset(); - SingleNodeBounds.prototype.parentElement = function parentElement() { - return this.parentNode; - }; + var instances = this._engineInstances; + for (var _name in instances) { + for (var id in instances[_name]) { + _emberMetal.run(instances[_name][id], 'destroy'); + } + } + }, - SingleNodeBounds.prototype.firstNode = function firstNode() { - return this.node; - }; + /* + Called when an active route's query parameter has changed. + These changes are batched into a runloop run and trigger + a single transition. + */ + _activeQPChanged: function (queryParameterName, newValue) { + this._queuedQPChanges[queryParameterName] = newValue; + _emberMetal.run.once(this, this._fireQueryParamTransition); + }, - SingleNodeBounds.prototype.lastNode = function lastNode() { - return this.node; - }; + _updatingQPChanged: function (queryParameterName) { + if (!this._qpUpdates) { + this._qpUpdates = {}; + } + this._qpUpdates[queryParameterName] = true; + }, - return SingleNodeBounds; - })(); + /* + Triggers a transition to a route based on query parameter changes. + This is called once per runloop, to batch changes. + e.g. + if these methods are called in succession: + this._activeQPChanged('foo', '10'); + // results in _queuedQPChanges = { foo: '10' } + this._activeQPChanged('bar', false); + // results in _queuedQPChanges = { foo: '10', bar: false } + _queuedQPChanges will represent both of these changes + and the transition using `transitionTo` will be triggered + once. + */ + _fireQueryParamTransition: function () { + this.transitionTo({ queryParams: this._queuedQPChanges }); + this._resetQueuedQueryParameterChanges(); + }, - exports.SingleNodeBounds = SingleNodeBounds; + _setupLocation: function () { + var location = _emberMetal.get(this, 'location'); + var rootURL = _emberMetal.get(this, 'rootURL'); + var owner = _emberUtils.getOwner(this); - function bounds(parent, first, last) { - return new ConcreteBounds(parent, first, last); - } + if ('string' === typeof location && owner) { + var resolvedLocation = owner.lookup('location:' + location); - function single(parent, node) { - return new SingleNodeBounds(parent, node); - } + if ('undefined' !== typeof resolvedLocation) { + location = _emberMetal.set(this, 'location', resolvedLocation); + } else { + // Allow for deprecated registration of custom location API's + var options = { + implementation: location + }; - function move(bounds, reference) { - var parent = bounds.parentElement(); - var first = bounds.firstNode(); - var last = bounds.lastNode(); - var node = first; - while (node) { - var next = node.nextSibling; - parent.insertBefore(node, reference); - if (node === last) return next; - node = next; + location = _emberMetal.set(this, 'location', _emberRoutingLocationApi.default.create(options)); } - return null; - } + } - function clear(bounds) { - var parent = bounds.parentElement(); - var first = bounds.firstNode(); - var last = bounds.lastNode(); - var node = first; - while (node) { - var next = node.nextSibling; - parent.removeChild(node); - if (node === last) return next; - node = next; + if (location !== null && typeof location === 'object') { + if (rootURL) { + _emberMetal.set(location, 'rootURL', rootURL); } - return null; - } -}); -enifed('glimmer-runtime/lib/builder', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-util', 'glimmer-runtime/lib/compiled/opcodes/dom'], function (exports, _glimmerRuntimeLibBounds, _glimmerUtil, _glimmerRuntimeLibCompiledOpcodesDom) { - 'use strict'; + // Allow the location to do any feature detection, such as AutoLocation + // detecting history support. This gives it a chance to set its + // `cancelRouterSetup` property which aborts routing. + if (typeof location.detect === 'function') { + location.detect(); + } - var First = (function () { - function First(node) { - this.node = node; + // ensure that initState is called AFTER the rootURL is set on + // the location instance + if (typeof location.initState === 'function') { + location.initState(); } + } + }, - First.prototype.firstNode = function firstNode() { - return this.node; - }; + _getHandlerFunction: function () { + var _this6 = this; - return First; - })(); + var seen = new _emberUtils.EmptyObject(); + var owner = _emberUtils.getOwner(this); + + return function (name) { + var routeName = name; + var routeOwner = owner; + var engineInfo = _this6._engineInfoByRoute[routeName]; + + if (engineInfo) { + var engineInstance = _this6._getEngineInstance(engineInfo); - var Last = (function () { - function Last(node) { - this.node = node; + routeOwner = engineInstance; + routeName = engineInfo.localFullName; } - Last.prototype.lastNode = function lastNode() { - return this.node; - }; + var fullRouteName = 'route:' + routeName; - return Last; - })(); + var handler = routeOwner.lookup(fullRouteName); - var Fragment = (function () { - function Fragment(bounds) { - this.bounds = bounds; + if (seen[name]) { + return handler; } - Fragment.prototype.parentElement = function parentElement() { - return this.bounds.parentElement(); - }; + seen[name] = true; - Fragment.prototype.firstNode = function firstNode() { - return this.bounds.firstNode(); - }; + if (!handler) { + var DefaultRoute = routeOwner[_container.FACTORY_FOR]('route:basic').class; + routeOwner.register(fullRouteName, DefaultRoute.extend()); + handler = routeOwner.lookup(fullRouteName); - Fragment.prototype.lastNode = function lastNode() { - return this.bounds.lastNode(); - }; + _emberMetal.runInDebug(function () { + if (_emberMetal.get(_this6, 'namespace.LOG_ACTIVE_GENERATION')) { + _emberMetal.info('generated -> ' + fullRouteName, { fullName: fullRouteName }); + } + }); + } - Fragment.prototype.update = function update(bounds) { - this.bounds = bounds; - }; + handler._setRouteName(routeName); + handler._populateQPMeta(); - return Fragment; - })(); + if (engineInfo && !_emberRoutingSystemRoute.hasDefaultSerialize(handler)) { + throw new Error('Defining a custom serialize method on an Engine route is not supported.'); + } - exports.Fragment = Fragment; - - var ElementStack = (function () { - function ElementStack(env, parentNode, nextSibling) { - this.constructing = null; - this.operations = null; - this.elementStack = new _glimmerUtil.Stack(); - this.nextSiblingStack = new _glimmerUtil.Stack(); - this.blockStack = new _glimmerUtil.Stack(); - this.env = env; - this.dom = env.getAppendOperations(); - this.updateOperations = env.getDOM(); - this.element = parentNode; - this.nextSibling = nextSibling; - this.defaultOperations = new _glimmerRuntimeLibCompiledOpcodesDom.SimpleElementOperations(env); - this.elementStack.push(this.element); - this.nextSiblingStack.push(this.nextSibling); - } - - ElementStack.forInitialRender = function forInitialRender(env, parentNode, nextSibling) { - return new ElementStack(env, parentNode, nextSibling); - }; + return handler; + }; + }, - ElementStack.resume = function resume(env, tracker, nextSibling) { - var parentNode = tracker.parentElement(); - var stack = new ElementStack(env, parentNode, nextSibling); - stack.pushBlockTracker(tracker); - return stack; - }; + _getSerializerFunction: function () { + var _this7 = this; - ElementStack.prototype.block = function block() { - return this.blockStack.current; - }; + return function (name) { + var engineInfo = _this7._engineInfoByRoute[name]; - ElementStack.prototype.popElement = function popElement() { - var elementStack = this.elementStack; - var nextSiblingStack = this.nextSiblingStack; + // If this is not an Engine route, we fall back to the handler for serialization + if (!engineInfo) { + return; + } - var topElement = elementStack.pop(); - nextSiblingStack.pop(); - this.element = elementStack.current; - this.nextSibling = nextSiblingStack.current; - return topElement; - }; + return engineInfo.serializeMethod || _emberRoutingSystemRoute.defaultSerialize; + }; + }, - ElementStack.prototype.pushSimpleBlock = function pushSimpleBlock() { - var tracker = new SimpleBlockTracker(this.element); - this.pushBlockTracker(tracker); - return tracker; - }; + _setupRouter: function (router, location) { + var lastURL = undefined; + var emberRouter = this; - ElementStack.prototype.pushUpdatableBlock = function pushUpdatableBlock() { - var tracker = new UpdatableBlockTracker(this.element); - this.pushBlockTracker(tracker); - return tracker; - }; + router.getHandler = this._getHandlerFunction(); + router.getSerializer = this._getSerializerFunction(); - ElementStack.prototype.pushBlockTracker = function pushBlockTracker(tracker) { - var isRemote = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; + var doUpdateURL = function () { + location.setURL(lastURL); + _emberMetal.set(emberRouter, 'currentURL', lastURL); + }; - var current = this.blockStack.current; - if (current !== null) { - current.newDestroyable(tracker); - if (!isRemote) { - current.newBounds(tracker); - } - } - this.blockStack.push(tracker); - return tracker; - }; + router.updateURL = function (path) { + lastURL = path; + _emberMetal.run.once(doUpdateURL); + }; - ElementStack.prototype.pushBlockList = function pushBlockList(list) { - var tracker = new BlockListTracker(this.element, list); - var current = this.blockStack.current; - if (current !== null) { - current.newDestroyable(tracker); - current.newBounds(tracker); - } - this.blockStack.push(tracker); - return tracker; - }; + if (location.replaceURL) { + (function () { + var doReplaceURL = function () { + location.replaceURL(lastURL); + _emberMetal.set(emberRouter, 'currentURL', lastURL); + }; - ElementStack.prototype.popBlock = function popBlock() { - this.blockStack.current.finalize(this); - return this.blockStack.pop(); - }; + router.replaceURL = function (path) { + lastURL = path; + _emberMetal.run.once(doReplaceURL); + }; + })(); + } - ElementStack.prototype.openElement = function openElement(tag) { - var operations = arguments.length <= 1 || arguments[1] === undefined ? this.defaultOperations : arguments[1]; + router.didTransition = function (infos) { + emberRouter.didTransition(infos); + }; - var element = this.dom.createElement(tag, this.element); - this.constructing = element; - this.operations = operations; - return element; - }; + router.willTransition = function (oldInfos, newInfos, transition) { + emberRouter.willTransition(oldInfos, newInfos, transition); + }; + }, - ElementStack.prototype.flushElement = function flushElement() { - var parent = this.element; - var element = this.constructing; - this.dom.insertBefore(parent, element, this.nextSibling); - this.constructing = null; - this.operations = null; - this.pushElement(element); - this.blockStack.current.openElement(element); - }; + /** + Serializes the given query params according to their QP meta information. + @private + @method _serializeQueryParams + @param {Arrray} handlerInfos + @param {Object} queryParams + @return {Void} + */ + _serializeQueryParams: function (handlerInfos, queryParams) { + var _this8 = this; - ElementStack.prototype.pushRemoteElement = function pushRemoteElement(element) { - this.pushElement(element); - var tracker = new RemoteBlockTracker(element); - this.pushBlockTracker(tracker, true); - }; + forEachQueryParam(this, handlerInfos, queryParams, function (key, value, qp) { + if (qp) { + delete queryParams[key]; + queryParams[qp.urlKey] = qp.route.serializeQueryParam(value, qp.urlKey, qp.type); + } else if (value === undefined) { + return; // We don't serialize undefined values + } else { + queryParams[key] = _this8._serializeQueryParam(value, _emberRuntime.typeOf(value)); + } + }); + }, - ElementStack.prototype.popRemoteElement = function popRemoteElement() { - this.popBlock(); - this.popElement(); - }; + /** + Serializes the value of a query parameter based on a type + @private + @method _serializeQueryParam + @param {Object} value + @param {String} type + */ + _serializeQueryParam: function (value, type) { + if (type === 'array') { + return JSON.stringify(value); + } - ElementStack.prototype.pushElement = function pushElement(element) { - this.element = element; - this.elementStack.push(element); - this.nextSibling = null; - this.nextSiblingStack.push(null); - }; + return '' + value; + }, - ElementStack.prototype.newDestroyable = function newDestroyable(d) { - this.blockStack.current.newDestroyable(d); - }; + /** + Deserializes the given query params according to their QP meta information. + @private + @method _deserializeQueryParams + @param {Array} handlerInfos + @param {Object} queryParams + @return {Void} + */ + _deserializeQueryParams: function (handlerInfos, queryParams) { + forEachQueryParam(this, handlerInfos, queryParams, function (key, value, qp) { + // If we don't have QP meta info for a given key, then we do nothing + // because all values will be treated as strings + if (qp) { + delete queryParams[key]; + queryParams[qp.prop] = qp.route.deserializeQueryParam(value, qp.urlKey, qp.type); + } + }); + }, - ElementStack.prototype.newBounds = function newBounds(bounds) { - this.blockStack.current.newBounds(bounds); - }; + /** + Deserializes the value of a query parameter based on a default type + @private + @method _deserializeQueryParam + @param {Object} value + @param {String} defaultType + */ + _deserializeQueryParam: function (value, defaultType) { + if (defaultType === 'boolean') { + return value === 'true' ? true : false; + } else if (defaultType === 'number') { + return Number(value).valueOf(); + } else if (defaultType === 'array') { + return _emberRuntime.A(JSON.parse(value)); + } - ElementStack.prototype.appendText = function appendText(string) { - var dom = this.dom; + return value; + }, - var text = dom.createTextNode(string); - dom.insertBefore(this.element, text, this.nextSibling); - this.blockStack.current.newNode(text); - return text; - }; + /** + Removes (prunes) any query params with default values from the given QP + object. Default values are determined from the QP meta information per key. + @private + @method _pruneDefaultQueryParamValues + @param {Array} handlerInfos + @param {Object} queryParams + @return {Void} + */ + _pruneDefaultQueryParamValues: function (handlerInfos, queryParams) { + var qps = this._queryParamsFor(handlerInfos); + for (var key in queryParams) { + var qp = qps.map[key]; + if (qp && qp.serializedDefaultValue === queryParams[key]) { + delete queryParams[key]; + } + } + }, - ElementStack.prototype.appendComment = function appendComment(string) { - var dom = this.dom; + _doTransition: function (_targetRouteName, models, _queryParams) { + var _router4; - var comment = dom.createComment(string); - dom.insertBefore(this.element, comment, this.nextSibling); - this.blockStack.current.newNode(comment); - return comment; - }; + var targetRouteName = _targetRouteName || _emberRoutingUtils.getActiveTargetName(this.router); + _emberMetal.assert('The route ' + targetRouteName + ' was not found', targetRouteName && this.router.hasRoute(targetRouteName)); - ElementStack.prototype.setStaticAttribute = function setStaticAttribute(name, value) { - this.operations.addStaticAttribute(this.constructing, name, value); - }; + var queryParams = {}; - ElementStack.prototype.setStaticAttributeNS = function setStaticAttributeNS(namespace, name, value) { - this.operations.addStaticAttributeNS(this.constructing, namespace, name, value); - }; + this._processActiveTransitionQueryParams(targetRouteName, models, queryParams, _queryParams); - ElementStack.prototype.setDynamicAttribute = function setDynamicAttribute(name, reference, isTrusting) { - this.operations.addDynamicAttribute(this.constructing, name, reference, isTrusting); - }; + _emberUtils.assign(queryParams, _queryParams); + this._prepareQueryParams(targetRouteName, models, queryParams); - ElementStack.prototype.setDynamicAttributeNS = function setDynamicAttributeNS(namespace, name, reference, isTrusting) { - this.operations.addDynamicAttributeNS(this.constructing, namespace, name, reference, isTrusting); - }; + var transitionArgs = _emberRoutingUtils.routeArgs(targetRouteName, models, queryParams); + var transition = (_router4 = this.router).transitionTo.apply(_router4, transitionArgs); - ElementStack.prototype.closeElement = function closeElement() { - this.blockStack.current.closeElement(); - this.popElement(); - }; + didBeginTransition(transition, this); - return ElementStack; - })(); + return transition; + }, - exports.ElementStack = ElementStack; + _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 SimpleBlockTracker = (function () { - function SimpleBlockTracker(parent) { - this.parent = parent; - this.first = null; - this.last = null; - this.destroyables = null; - this.nesting = 0; + var unchangedQPs = {}; + var qpUpdates = this._qpUpdates || {}; + for (var key in this.router.activeTransition.queryParams) { + if (!qpUpdates[key]) { + unchangedQPs[key] = this.router.activeTransition.queryParams[key]; } + } - SimpleBlockTracker.prototype.destroy = function destroy() { - var destroyables = this.destroyables; + // 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); + _emberUtils.assign(queryParams, unchangedQPs); + }, - if (destroyables && destroyables.length) { - for (var i = 0; i < destroyables.length; i++) { - destroyables[i].destroy(); - } - } - }; + /** + Prepares the query params for a URL or Transition. Restores any undefined QP + keys/values, serializes all values, and then prunes any default values. + @private + @method _prepareQueryParams + @param {String} targetRouteName + @param {Array} models + @param {Object} queryParams + @return {Void} + */ + _prepareQueryParams: function (targetRouteName, models, queryParams) { + var state = calculatePostTransitionState(this, targetRouteName, models); + this._hydrateUnsuppliedQueryParams(state, queryParams); + this._serializeQueryParams(state.handlerInfos, queryParams); + this._pruneDefaultQueryParamValues(state.handlerInfos, queryParams); + }, - SimpleBlockTracker.prototype.parentElement = function parentElement() { - return this.parent; - }; + /** + Returns the meta information for the query params of a given route. This + will be overriden to allow support for lazy routes. + @private + @method _getQPMeta + @param {HandlerInfo} handlerInfo + @return {Object} + */ + _getQPMeta: function (handlerInfo) { + var route = handlerInfo.handler; + return route && _emberMetal.get(route, '_qp'); + }, + + /** + Returns a merged query params meta object for a given set of handlerInfos. + Useful for knowing what query params are available for a given route hierarchy. + @private + @method _queryParamsFor + @param {Array} handlerInfos + @return {Object} + */ + _queryParamsFor: function (handlerInfos) { + var leafRouteName = handlerInfos[handlerInfos.length - 1].name; + if (this._qpCache[leafRouteName]) { + return this._qpCache[leafRouteName]; + } + + var shouldCache = true; + var qpsByUrlKey = {}; + var map = {}; + var qps = []; - SimpleBlockTracker.prototype.firstNode = function firstNode() { - return this.first && this.first.firstNode(); - }; + for (var i = 0; i < handlerInfos.length; ++i) { + var qpMeta = this._getQPMeta(handlerInfos[i]); - SimpleBlockTracker.prototype.lastNode = function lastNode() { - return this.last && this.last.lastNode(); - }; + if (!qpMeta) { + shouldCache = false; + continue; + } - SimpleBlockTracker.prototype.openElement = function openElement(element) { - this.newNode(element); - this.nesting++; - }; + // Loop over each QP to make sure we don't have any collisions by urlKey + for (var _i = 0; _i < qpMeta.qps.length; _i++) { + var qp = qpMeta.qps[_i]; + var urlKey = qp.urlKey; + var qpOther = qpsByUrlKey[urlKey]; - SimpleBlockTracker.prototype.closeElement = function closeElement() { - this.nesting--; - }; + if (qpOther && qpOther.controllerName !== qp.controllerName) { + var otherQP = qpsByUrlKey[urlKey]; + _emberMetal.assert('You\'re not allowed to have more than one controller property map to the same query param key, but both `' + otherQP.scopedPropertyName + '` and `' + qp.scopedPropertyName + '` map to `' + 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. `' + otherQP.prop + ': { as: \'other-' + otherQP.prop + '\' }`', false); + } - SimpleBlockTracker.prototype.newNode = function newNode(node) { - if (this.nesting !== 0) return; - if (!this.first) { - this.first = new First(node); - } - this.last = new Last(node); - }; + qpsByUrlKey[urlKey] = qp; + qps.push(qp); + } - SimpleBlockTracker.prototype.newBounds = function newBounds(bounds) { - if (this.nesting !== 0) return; - if (!this.first) { - this.first = bounds; - } - this.last = bounds; - }; + _emberUtils.assign(map, qpMeta.map); + } - SimpleBlockTracker.prototype.newDestroyable = function newDestroyable(d) { - this.destroyables = this.destroyables || []; - this.destroyables.push(d); - }; + var finalQPMeta = { + qps: qps, + map: map + }; - SimpleBlockTracker.prototype.finalize = function finalize(stack) { - if (!this.first) { - stack.appendComment(''); - } - }; + if (shouldCache) { + this._qpCache[leafRouteName] = finalQPMeta; + } - return SimpleBlockTracker; - })(); + return finalQPMeta; + }, - exports.SimpleBlockTracker = SimpleBlockTracker; + /** + Maps all query param keys to their fully scoped property name of the form + `controllerName:propName`. + @private + @method _fullyScopeQueryParams + @param {String} leafRouteName + @param {Array} contexts + @param {Object} queryParams + @return {Void} + */ + _fullyScopeQueryParams: function (leafRouteName, contexts, queryParams) { + var state = calculatePostTransitionState(this, leafRouteName, contexts); + var handlerInfos = state.handlerInfos; - var RemoteBlockTracker = (function (_SimpleBlockTracker) { - babelHelpers.inherits(RemoteBlockTracker, _SimpleBlockTracker); + for (var i = 0, len = handlerInfos.length; i < len; ++i) { + var qpMeta = this._getQPMeta(handlerInfos[i]); - function RemoteBlockTracker() { - _SimpleBlockTracker.apply(this, arguments); + if (!qpMeta) { + continue; } - RemoteBlockTracker.prototype.destroy = function destroy() { - _SimpleBlockTracker.prototype.destroy.call(this); - _glimmerRuntimeLibBounds.clear(this); - }; - - return RemoteBlockTracker; - })(SimpleBlockTracker); + for (var j = 0, qpLen = qpMeta.qps.length; j < qpLen; ++j) { + var qp = qpMeta.qps[j]; - var UpdatableBlockTracker = (function (_SimpleBlockTracker2) { - babelHelpers.inherits(UpdatableBlockTracker, _SimpleBlockTracker2); + var presentProp = qp.prop in queryParams && qp.prop || qp.scopedPropertyName in queryParams && qp.scopedPropertyName || qp.urlKey in queryParams && qp.urlKey; - function UpdatableBlockTracker() { - _SimpleBlockTracker2.apply(this, arguments); + if (presentProp) { + if (presentProp !== qp.scopedPropertyName) { + queryParams[qp.scopedPropertyName] = queryParams[presentProp]; + delete queryParams[presentProp]; + } + } } + } + }, + + /** + Hydrates (adds/restores) any query params that have pre-existing values into + the given queryParams hash. This is what allows query params to be "sticky" + and restore their last known values for their scope. + @private + @method _hydrateUnsuppliedQueryParams + @param {TransitionState} state + @param {Object} queryParams + @return {Void} + */ + _hydrateUnsuppliedQueryParams: function (state, queryParams) { + var handlerInfos = state.handlerInfos; + var appCache = this._bucketCache; - UpdatableBlockTracker.prototype.reset = function reset(env) { - var destroyables = this.destroyables; + for (var i = 0; i < handlerInfos.length; ++i) { + var qpMeta = this._getQPMeta(handlerInfos[i]); - if (destroyables && destroyables.length) { - for (var i = 0; i < destroyables.length; i++) { - env.didDestroy(destroyables[i]); - } - } - var nextSibling = _glimmerRuntimeLibBounds.clear(this); - this.destroyables = null; - this.first = null; - this.last = null; - return nextSibling; - }; + if (!qpMeta) { + continue; + } - return UpdatableBlockTracker; - })(SimpleBlockTracker); + for (var j = 0, qpLen = qpMeta.qps.length; j < qpLen; ++j) { + var qp = qpMeta.qps[j]; - exports.UpdatableBlockTracker = UpdatableBlockTracker; + var presentProp = qp.prop in queryParams && qp.prop || qp.scopedPropertyName in queryParams && qp.scopedPropertyName || qp.urlKey in queryParams && qp.urlKey; - var BlockListTracker = (function () { - function BlockListTracker(parent, boundList) { - this.parent = parent; - this.boundList = boundList; - this.parent = parent; - this.boundList = boundList; + if (presentProp) { + if (presentProp !== qp.scopedPropertyName) { + queryParams[qp.scopedPropertyName] = queryParams[presentProp]; + delete queryParams[presentProp]; + } + } else { + var cacheKey = _emberRoutingUtils.calculateCacheKey(qp.route.fullRouteName, qp.parts, state.params); + queryParams[qp.scopedPropertyName] = appCache.lookup(cacheKey, qp.prop, qp.defaultValue); + } } + } + }, - BlockListTracker.prototype.destroy = function destroy() { - this.boundList.forEachNode(function (node) { - return node.destroy(); - }); - }; + _scheduleLoadingEvent: function (transition, originRoute) { + this._cancelSlowTransitionTimer(); + this._slowTransitionTimer = _emberMetal.run.scheduleOnce('routerTransitions', this, '_handleSlowTransition', transition, originRoute); + }, - BlockListTracker.prototype.parentElement = function parentElement() { - return this.parent; - }; + currentState: null, + targetState: null, - BlockListTracker.prototype.firstNode = function firstNode() { - return this.boundList.head().firstNode(); - }; + _handleSlowTransition: function (transition, originRoute) { + if (!this.router.activeTransition) { + // Don't fire an event if we've since moved on from + // the transition that put us in a loading state. + return; + } - BlockListTracker.prototype.lastNode = function lastNode() { - return this.boundList.tail().lastNode(); - }; + this.set('targetState', _emberRoutingSystemRouter_state.default.create({ + emberRouter: this, + routerJs: this.router, + routerJsState: this.router.activeTransition.state + })); - BlockListTracker.prototype.openElement = function openElement(element) { - _glimmerUtil.assert(false, 'Cannot openElement directly inside a block list'); - }; + transition.trigger(true, 'loading', transition, originRoute); + }, - BlockListTracker.prototype.closeElement = function closeElement() { - _glimmerUtil.assert(false, 'Cannot closeElement directly inside a block list'); - }; + _cancelSlowTransitionTimer: function () { + if (this._slowTransitionTimer) { + _emberMetal.run.cancel(this._slowTransitionTimer); + } + this._slowTransitionTimer = null; + }, - BlockListTracker.prototype.newNode = function newNode(node) { - _glimmerUtil.assert(false, 'Cannot create a new node directly inside a block list'); - }; + // These three helper functions are used to ensure errors aren't + // re-raised if they're handled in a route's error action. + _markErrorAsHandled: function (errorGuid) { + this._handledErrors[errorGuid] = true; + }, - BlockListTracker.prototype.newBounds = function newBounds(bounds) {}; + _isErrorHandled: function (errorGuid) { + return this._handledErrors[errorGuid]; + }, - BlockListTracker.prototype.newDestroyable = function newDestroyable(d) {}; + _clearHandledError: function (errorGuid) { + delete this._handledErrors[errorGuid]; + }, - BlockListTracker.prototype.finalize = function finalize(stack) {}; + _getEngineInstance: function (_ref) { + var name = _ref.name; + var instanceId = _ref.instanceId; + var mountPoint = _ref.mountPoint; - return BlockListTracker; - })(); -}); + var engineInstances = this._engineInstances; -enifed('glimmer-runtime/lib/compat/inner-html-fix', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/dom/helper'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibDomHelper) { - 'use strict'; + if (!engineInstances[name]) { + engineInstances[name] = new _emberUtils.EmptyObject(); + } - exports.domChanges = domChanges; - exports.treeConstruction = treeConstruction; - - var innerHTMLWrapper = { - colgroup: { depth: 2, before: '', after: '
    ' }, - table: { depth: 1, before: '', after: '
    ' }, - tbody: { depth: 2, before: '', after: '
    ' }, - tfoot: { depth: 2, before: '', after: '
    ' }, - thead: { depth: 2, before: '', after: '
    ' }, - tr: { depth: 3, before: '', after: '
    ' } - }; - // Patch: innerHTML Fix - // Browsers: IE9 - // Reason: IE9 don't allow us to set innerHTML on col, colgroup, frameset, - // html, style, table, tbody, tfoot, thead, title, tr. - // Fix: Wrap the innerHTML we are about to set in its parents, apply the - // wrapped innerHTML on a div, then move the unwrapped nodes into the - // target position. - - function domChanges(document, DOMChangesClass) { - if (!document) return DOMChangesClass; - if (!shouldApplyFix(document)) { - return DOMChangesClass; - } - var div = document.createElement('div'); - return (function (_DOMChangesClass) { - babelHelpers.inherits(DOMChangesWithInnerHTMLFix, _DOMChangesClass); - - function DOMChangesWithInnerHTMLFix() { - _DOMChangesClass.apply(this, arguments); - } + var engineInstance = engineInstances[name][instanceId]; - DOMChangesWithInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent, nextSibling, html) { - if (html === null || html === '') { - return _DOMChangesClass.prototype.insertHTMLBefore.call(this, parent, nextSibling, html); - } - var parentTag = parent.tagName.toLowerCase(); - var wrapper = innerHTMLWrapper[parentTag]; - if (wrapper === undefined) { - return _DOMChangesClass.prototype.insertHTMLBefore.call(this, parent, nextSibling, html); - } - return fixInnerHTML(parent, wrapper, div, html, nextSibling); - }; + if (!engineInstance) { + var owner = _emberUtils.getOwner(this); - return DOMChangesWithInnerHTMLFix; - })(DOMChangesClass); - } + _emberMetal.assert('You attempted to mount the engine \'' + name + '\' in your router map, but the engine can not be found.', owner.hasRegistration('engine:' + name)); - function treeConstruction(document, DOMTreeConstructionClass) { - if (!document) return DOMTreeConstructionClass; - if (!shouldApplyFix(document)) { - return DOMTreeConstructionClass; - } - var div = document.createElement('div'); - return (function (_DOMTreeConstructionClass) { - babelHelpers.inherits(DOMTreeConstructionWithInnerHTMLFix, _DOMTreeConstructionClass); + engineInstance = owner.buildChildEngineInstance(name, { + routable: true, + mountPoint: mountPoint + }); - function DOMTreeConstructionWithInnerHTMLFix() { - _DOMTreeConstructionClass.apply(this, arguments); - } + engineInstance.boot(); - DOMTreeConstructionWithInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent, html, reference) { - if (html === null || html === '') { - return _DOMTreeConstructionClass.prototype.insertHTMLBefore.call(this, parent, html, reference); - } - var parentTag = parent.tagName.toLowerCase(); - var wrapper = innerHTMLWrapper[parentTag]; - if (wrapper === undefined) { - return _DOMTreeConstructionClass.prototype.insertHTMLBefore.call(this, parent, html, reference); - } - return fixInnerHTML(parent, wrapper, div, html, reference); - }; + engineInstances[name][instanceId] = engineInstance; + } - return DOMTreeConstructionWithInnerHTMLFix; - })(DOMTreeConstructionClass); + return engineInstance; } + }); - function fixInnerHTML(parent, wrapper, div, html, reference) { - var wrappedHtml = wrapper.before + html + wrapper.after; - div.innerHTML = wrappedHtml; - var parentNode = div; - for (var i = 0; i < wrapper.depth; i++) { - parentNode = parentNode.childNodes[0]; - } + /* + Helper function for iterating over routes in a set of handlerInfos that are + at or above the given origin route. Example: if `originRoute` === 'foo.bar' + and the handlerInfos given were for 'foo.bar.baz', then the given callback + will be invoked with the routes for 'foo.bar', 'foo', and 'application' + individually. + + If the callback returns anything other than `true`, then iteration will stop. + + @private + @param {Route} originRoute + @param {Array} handlerInfos + @param {Function} callback + @return {Void} + */ + function forEachRouteAbove(originRoute, handlerInfos, callback) { + var originRouteFound = false; - var _moveNodesBefore = _glimmerRuntimeLibDomHelper.moveNodesBefore(parentNode, parent, reference); + for (var i = handlerInfos.length - 1; i >= 0; --i) { + var handlerInfo = handlerInfos[i]; + var route = handlerInfo.handler; - var first = _moveNodesBefore[0]; - var last = _moveNodesBefore[1]; + if (originRoute === route) { + originRouteFound = true; + } - return new _glimmerRuntimeLibBounds.ConcreteBounds(parent, first, last); - } - function shouldApplyFix(document) { - var table = document.createElement('table'); - try { - table.innerHTML = ''; - } catch (e) {} finally { - if (table.childNodes.length !== 0) { - // It worked as expected, no fix required - return false; - } - } - return true; - } -}); + if (!originRouteFound) { + continue; + } -enifed('glimmer-runtime/lib/compat/svg-inner-html-fix', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/dom/helper'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibDomHelper) { - 'use strict'; + if (callback(route) !== true) { + return; + } + } + } - exports.domChanges = domChanges; - exports.treeConstruction = treeConstruction; - - var SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; - // Patch: insertAdjacentHTML on SVG Fix - // Browsers: Safari, IE, Edge, Firefox ~33-34 - // Reason: insertAdjacentHTML does not exist on SVG elements in Safari. It is - // present but throws an exception on IE and Edge. Old versions of - // Firefox create nodes in the incorrect namespace. - // Fix: Since IE and Edge silently fail to create SVG nodes using - // innerHTML, and because Firefox may create nodes in the incorrect - // namespace using innerHTML on SVG elements, an HTML-string wrapping - // approach is used. A pre/post SVG tag is added to the string, then - // that whole string is added to a div. The created nodes are plucked - // out and applied to the target location on DOM. - - function domChanges(document, DOMChangesClass, svgNamespace) { - if (!document) return DOMChangesClass; - if (!shouldApplyFix(document, svgNamespace)) { - return DOMChangesClass; - } - var div = document.createElement('div'); - return (function (_DOMChangesClass) { - babelHelpers.inherits(DOMChangesWithSVGInnerHTMLFix, _DOMChangesClass); - - function DOMChangesWithSVGInnerHTMLFix() { - _DOMChangesClass.apply(this, arguments); - } + // These get invoked when an action bubbles above ApplicationRoute + // and are not meant to be overridable. + var defaultActionHandlers = { - DOMChangesWithSVGInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent, nextSibling, html) { - if (html === null || html === '') { - return _DOMChangesClass.prototype.insertHTMLBefore.call(this, parent, nextSibling, html); - } - if (parent.namespaceURI !== svgNamespace) { - return _DOMChangesClass.prototype.insertHTMLBefore.call(this, parent, nextSibling, html); - } - return fixSVG(parent, div, html, nextSibling); - }; + willResolveModel: function (transition, originRoute) { + originRoute.router._scheduleLoadingEvent(transition, originRoute); + }, - return DOMChangesWithSVGInnerHTMLFix; - })(DOMChangesClass); - } + // Attempt to find an appropriate error route or substate to enter. + error: function (error, transition, originRoute) { + var handlerInfos = transition.state.handlerInfos; + var router = originRoute.router; - function treeConstruction(document, TreeConstructionClass, svgNamespace) { - if (!document) return TreeConstructionClass; - if (!shouldApplyFix(document, svgNamespace)) { - return TreeConstructionClass; + forEachRouteAbove(originRoute, handlerInfos, function (route) { + // Check for the existence of an 'error' route. + // We don't check for an 'error' route on the originRoute, since that would + // technically be below where we're at in the route hierarchy. + if (originRoute !== route) { + var errorRouteName = findRouteStateName(route, 'error'); + if (errorRouteName) { + router.intermediateTransitionTo(errorRouteName, error); + return false; + } } - var div = document.createElement('div'); - return (function (_TreeConstructionClass) { - babelHelpers.inherits(TreeConstructionWithSVGInnerHTMLFix, _TreeConstructionClass); - function TreeConstructionWithSVGInnerHTMLFix() { - _TreeConstructionClass.apply(this, arguments); - } - - TreeConstructionWithSVGInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent, html, reference) { - if (html === null || html === '') { - return _TreeConstructionClass.prototype.insertHTMLBefore.call(this, parent, html, reference); - } - if (parent.namespaceURI !== svgNamespace) { - return _TreeConstructionClass.prototype.insertHTMLBefore.call(this, parent, html, reference); - } - return fixSVG(parent, div, html, reference); - }; - - return TreeConstructionWithSVGInnerHTMLFix; - })(TreeConstructionClass); - } + // Check for an 'error' substate route + var errorSubstateName = findRouteSubstateName(route, 'error'); + if (errorSubstateName) { + router.intermediateTransitionTo(errorSubstateName, error); + return false; + } - function fixSVG(parent, div, html, reference) { - // IE, Edge: also do not correctly support using `innerHTML` on SVG - // namespaced elements. So here a wrapper is used. - var wrappedHtml = '' + html + ''; - div.innerHTML = wrappedHtml; + return true; + }); - var _moveNodesBefore = _glimmerRuntimeLibDomHelper.moveNodesBefore(div.firstChild, parent, reference); + logError(error, 'Error while processing route: ' + transition.targetName); + }, - var first = _moveNodesBefore[0]; - var last = _moveNodesBefore[1]; + // Attempt to find an appropriate loading route or substate to enter. + loading: function (transition, originRoute) { + var handlerInfos = transition.state.handlerInfos; + var router = originRoute.router; - return new _glimmerRuntimeLibBounds.ConcreteBounds(parent, first, last); - } - function shouldApplyFix(document, svgNamespace) { - var svg = document.createElementNS(svgNamespace, 'svg'); - try { - svg['insertAdjacentHTML']('beforeEnd', ''); - } catch (e) {} finally { - // FF: Old versions will create a node in the wrong namespace - if (svg.childNodes.length === 1 && svg.firstChild.namespaceURI === SVG_NAMESPACE) { - // The test worked as expected, no fix required - return false; - } - svg = null; - return true; + forEachRouteAbove(originRoute, handlerInfos, function (route) { + // Check for the existence of a 'loading' route. + // We don't check for a 'loading' route on the originRoute, since that would + // technically be below where we're at in the route hierarchy. + if (originRoute !== route) { + var loadingRouteName = findRouteStateName(route, 'loading'); + if (loadingRouteName) { + router.intermediateTransitionTo(loadingRouteName); + return false; + } } - } -}); - -enifed('glimmer-runtime/lib/compat/text-node-merging-fix', ['exports'], function (exports) { - // Patch: Adjacent text node merging fix - // Browsers: IE, Edge, Firefox w/o inspector open - // Reason: These browsers will merge adjacent text nodes. For exmaple given - //
    Hello
    with div.insertAdjacentHTML(' world') browsers - // with proper behavior will populate div.childNodes with two items. - // These browsers will populate it with one merged node instead. - // Fix: Add these nodes to a wrapper element, then iterate the childNodes - // of that wrapper and move the nodes to their target location. Note - // that potential SVG bugs will have been handled before this fix. - // Note that this fix must only apply to the previous text node, as - // the base implementation of `insertHTMLBefore` already handles - // following text nodes correctly. - 'use strict'; - exports.domChanges = domChanges; - exports.treeConstruction = treeConstruction; - - function domChanges(document, DOMChangesClass) { - if (!document) return DOMChangesClass; - if (!shouldApplyFix(document)) { - return DOMChangesClass; + // Check for loading substate + var loadingSubstateName = findRouteSubstateName(route, 'loading'); + if (loadingSubstateName) { + router.intermediateTransitionTo(loadingSubstateName); + return false; } - return (function (_DOMChangesClass) { - babelHelpers.inherits(DOMChangesWithTextNodeMergingFix, _DOMChangesClass); - - function DOMChangesWithTextNodeMergingFix(document) { - _DOMChangesClass.call(this, document); - this.uselessComment = document.createComment(''); - } - DOMChangesWithTextNodeMergingFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent, nextSibling, html) { - if (html === null) { - return _DOMChangesClass.prototype.insertHTMLBefore.call(this, parent, nextSibling, html); - } - var didSetUselessComment = false; - var nextPrevious = nextSibling ? nextSibling.previousSibling : parent.lastChild; - if (nextPrevious && nextPrevious instanceof Text) { - didSetUselessComment = true; - parent.insertBefore(this.uselessComment, nextSibling); - } - var bounds = _DOMChangesClass.prototype.insertHTMLBefore.call(this, parent, nextSibling, html); - if (didSetUselessComment) { - parent.removeChild(this.uselessComment); - } - return bounds; - }; - - return DOMChangesWithTextNodeMergingFix; - })(DOMChangesClass); + // Don't bubble above pivot route. + return transition.pivotHandler !== route; + }); } + }; - function treeConstruction(document, TreeConstructionClass) { - if (!document) return TreeConstructionClass; - if (!shouldApplyFix(document)) { - return TreeConstructionClass; - } - return (function (_TreeConstructionClass) { - babelHelpers.inherits(TreeConstructionWithTextNodeMergingFix, _TreeConstructionClass); + function logError(_error, initialMessage) { + var errorArgs = []; + var error = undefined; + if (_error && typeof _error === 'object' && typeof _error.errorThrown === 'object') { + error = _error.errorThrown; + } else { + error = _error; + } - function TreeConstructionWithTextNodeMergingFix(document) { - _TreeConstructionClass.call(this, document); - this.uselessComment = this.createComment(''); - } + if (initialMessage) { + errorArgs.push(initialMessage); + } - TreeConstructionWithTextNodeMergingFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent, html, reference) { - if (html === null) { - return _TreeConstructionClass.prototype.insertHTMLBefore.call(this, parent, html, reference); - } - var didSetUselessComment = false; - var nextPrevious = reference ? reference.previousSibling : parent.lastChild; - if (nextPrevious && nextPrevious instanceof Text) { - didSetUselessComment = true; - parent.insertBefore(this.uselessComment, reference); - } - var bounds = _TreeConstructionClass.prototype.insertHTMLBefore.call(this, parent, html, reference); - if (didSetUselessComment) { - parent.removeChild(this.uselessComment); - } - return bounds; - }; + if (error) { + if (error.message) { + errorArgs.push(error.message); + } + if (error.stack) { + errorArgs.push(error.stack); + } - return TreeConstructionWithTextNodeMergingFix; - })(TreeConstructionClass); + if (typeof error === 'string') { + errorArgs.push(error); + } } - function shouldApplyFix(document) { - var mergingTextDiv = document.createElement('div'); - mergingTextDiv.innerHTML = 'first'; - mergingTextDiv.insertAdjacentHTML('beforeEnd', 'second'); - if (mergingTextDiv.childNodes.length === 2) { - mergingTextDiv = null; - // It worked as expected, no fix required - return false; - } - mergingTextDiv = null; - return true; - } -}); + _emberConsole.default.error.apply(this, errorArgs); + } -enifed('glimmer-runtime/lib/compiled/blocks', ['exports', 'glimmer-runtime/lib/utils', 'glimmer-runtime/lib/compiler'], function (exports, _glimmerRuntimeLibUtils, _glimmerRuntimeLibCompiler) { - 'use strict'; + /** + Finds the name of the substate route if it exists for the given route. A + substate route is of the form `route_state`, such as `foo_loading`. + + @private + @param {Route} route + @param {String} state + @return {String} + */ + function findRouteSubstateName(route, state) { + var router = route.router; + var owner = _emberUtils.getOwner(route); - var CompiledBlock = function CompiledBlock(ops, symbols) { - this.ops = ops; - this.symbols = symbols; - }; + var routeName = route.routeName; + var substateName = routeName + '_' + state; - exports.CompiledBlock = CompiledBlock; + var routeNameFull = route.fullRouteName; + var substateNameFull = routeNameFull + '_' + state; - var Block = function Block(program, symbolTable) { - this.program = program; - this.symbolTable = symbolTable; - this.compiled = null; - }; + return routeHasBeenDefined(owner, router, substateName, substateNameFull) ? substateNameFull : ''; + } - exports.Block = Block; + /** + Finds the name of the state route if it exists for the given route. A state + route is of the form `route.state`, such as `foo.loading`. Properly Handles + `application` named routes. + + @private + @param {Route} route + @param {String} state + @return {String} + */ + function findRouteStateName(route, state) { + var router = route.router; + var owner = _emberUtils.getOwner(route); - var InlineBlock = (function (_Block) { - babelHelpers.inherits(InlineBlock, _Block); + var routeName = route.routeName; + var stateName = routeName === 'application' ? state : routeName + '.' + state; - function InlineBlock(program, symbolTable) { - var locals = arguments.length <= 2 || arguments[2] === undefined ? _glimmerRuntimeLibUtils.EMPTY_ARRAY : arguments[2]; + var routeNameFull = route.fullRouteName; + var stateNameFull = routeNameFull === 'application' ? state : routeNameFull + '.' + state; - _Block.call(this, program, symbolTable); - this.locals = locals; - } + return routeHasBeenDefined(owner, router, stateName, stateNameFull) ? stateNameFull : ''; + } - InlineBlock.prototype.hasPositionalParameters = function hasPositionalParameters() { - return !!this.locals.length; - }; + /** + Determines whether or not a route has been defined by checking that the route + is in the Router's map and the owner has a registration for that route. + + @private + @param {Owner} owner + @param {Ember.Router} router + @param {String} localName + @param {String} fullName + @return {Boolean} + */ + function routeHasBeenDefined(owner, router, localName, fullName) { + var routerHasRoute = router.hasRoute(fullName); + var ownerHasRoute = owner.hasRegistration('template:' + localName) || owner.hasRegistration('route:' + localName); + return routerHasRoute && ownerHasRoute; + } - InlineBlock.prototype.compile = function compile(env) { - var compiled = this.compiled; - if (compiled) return compiled; - var ops = new _glimmerRuntimeLibCompiler.InlineBlockCompiler(this, env).compile(); - return this.compiled = new CompiledBlock(ops, this.symbolTable.size); - }; + function triggerEvent(handlerInfos, ignoreFailure, args) { + var name = args.shift(); - return InlineBlock; - })(Block); + if (!handlerInfos) { + if (ignoreFailure) { + return; + } + throw new _emberMetal.Error('Can\'t trigger action \'' + name + '\' because your app hasn\'t finished transitioning into its first route. To trigger an action on destination routes during a transition, you can call `.send()` on the `Transition` object passed to the `model/beforeModel/afterModel` hooks.'); + } - exports.InlineBlock = InlineBlock; + var eventWasHandled = false; + var handlerInfo = undefined, + handler = undefined; - var PartialBlock = (function (_InlineBlock) { - babelHelpers.inherits(PartialBlock, _InlineBlock); + for (var i = handlerInfos.length - 1; i >= 0; i--) { + handlerInfo = handlerInfos[i]; + handler = handlerInfo.handler; - function PartialBlock() { - _InlineBlock.apply(this, arguments); + if (handler && handler.actions && handler.actions[name]) { + if (handler.actions[name].apply(handler, args) === true) { + eventWasHandled = true; + } else { + // Should only hit here if a non-bubbling error action is triggered on a route. + if (name === 'error') { + var errorId = _emberUtils.guidFor(args[0]); + handler.router._markErrorAsHandled(errorId); + } + return; } + } + } - return PartialBlock; - })(InlineBlock); - - exports.PartialBlock = PartialBlock; + if (defaultActionHandlers[name]) { + defaultActionHandlers[name].apply(null, args); + return; + } - var TopLevelTemplate = (function (_Block2) { - babelHelpers.inherits(TopLevelTemplate, _Block2); + if (!eventWasHandled && !ignoreFailure) { + throw new _emberMetal.Error('Nothing handled the action \'' + name + '\'. If you did handle the action, this error can be caused by returning true from an action handler in a controller, causing the action to bubble.'); + } + } - function TopLevelTemplate() { - _Block2.apply(this, arguments); - } + function calculatePostTransitionState(emberRouter, leafRouteName, contexts) { + var routerjs = emberRouter.router; + var state = routerjs.applyIntent(leafRouteName, contexts); + var handlerInfos = state.handlerInfos; + var params = state.params; - return TopLevelTemplate; - })(Block); + for (var i = 0; i < handlerInfos.length; ++i) { + var handlerInfo = handlerInfos[i]; - exports.TopLevelTemplate = TopLevelTemplate; + // If the handlerInfo is not resolved, we serialize the context into params + if (!handlerInfo.isResolved) { + params[handlerInfo.name] = handlerInfo.serialize(handlerInfo.context); + } else { + params[handlerInfo.name] = handlerInfo.params; + } + } + return state; + } - var EntryPoint = (function (_TopLevelTemplate) { - babelHelpers.inherits(EntryPoint, _TopLevelTemplate); + function updatePaths(router) { + var infos = router.router.currentHandlerInfos; + if (infos.length === 0) { + return; + } - function EntryPoint() { - _TopLevelTemplate.apply(this, arguments); - } + var path = EmberRouter._routePath(infos); + var currentRouteName = infos[infos.length - 1].name; + var currentURL = router.get('location').getURL(); - EntryPoint.prototype.compile = function compile(env) { - var compiled = this.compiled; - if (compiled) return compiled; - var ops = new _glimmerRuntimeLibCompiler.EntryPointCompiler(this, env).compile(); - return this.compiled = new CompiledBlock(ops, this.symbolTable.size); - }; + _emberMetal.set(router, 'currentPath', path); + _emberMetal.set(router, 'currentRouteName', currentRouteName); + _emberMetal.set(router, 'currentURL', currentURL); - return EntryPoint; - })(TopLevelTemplate); + var appController = _emberUtils.getOwner(router).lookup('controller:application'); - exports.EntryPoint = EntryPoint; + if (!appController) { + // appController might not exist when top-level loading/error + // substates have been entered since ApplicationRoute hasn't + // actually been entered at that point. + return; + } - var Layout = (function (_TopLevelTemplate2) { - babelHelpers.inherits(Layout, _TopLevelTemplate2); + if (!('currentPath' in appController)) { + _emberMetal.defineProperty(appController, 'currentPath'); + } - function Layout(program, symbolTable, named, yields, hasPartials) { - _TopLevelTemplate2.call(this, program, symbolTable); - this.named = named; - this.yields = yields; - this.hasPartials = hasPartials; - this.hasNamedParameters = !!this.named.length; - this.hasYields = !!this.yields.length; - ; - } + _emberMetal.set(appController, 'currentPath', path); - return Layout; - })(TopLevelTemplate); + if (!('currentRouteName' in appController)) { + _emberMetal.defineProperty(appController, 'currentRouteName'); + } - exports.Layout = Layout; -}); + _emberMetal.set(appController, 'currentRouteName', currentRouteName); + } -enifed("glimmer-runtime/lib/compiled/expressions", ["exports"], function (exports) { - "use strict"; + EmberRouter.reopenClass({ + router: null, - var CompiledExpression = (function () { - function CompiledExpression() {} + /** + The `Router.map` function allows you to define mappings from URLs to routes + in your application. These mappings are defined within the + supplied callback function using `this.route`. + The first parameter is the name of the route which is used by default as the + path name as well. + The second parameter is the optional options hash. Available options are: + * `path`: allows you to provide your own path as well as mark dynamic + segments. + * `resetNamespace`: false by default; when nesting routes, ember will + combine the route names to form the fully-qualified route name, which is + used with `{{link-to}}` or manually transitioning to routes. Setting + `resetNamespace: true` will cause the route not to inherit from its + parent route's names. This is handy for preventing extremely long route names. + Keep in mind that the actual URL path behavior is still retained. + The third parameter is a function, which can be used to nest routes. + Nested routes, by default, will have the parent route tree's route name and + path prepended to it's own. + ```javascript + App.Router.map(function(){ + this.route('post', { path: '/post/:post_id' }, function() { + this.route('edit'); + this.route('comments', { resetNamespace: true }, function() { + this.route('new'); + }); + }); + }); + ``` + For more detailed documentation and examples please see + [the guides](http://emberjs.com/guides/routing/defining-your-routes/). + @method map + @param callback + @public + */ + map: function (callback) { + if (!this.dslCallbacks) { + this.dslCallbacks = []; + this.reopenClass({ dslCallbacks: this.dslCallbacks }); + } - CompiledExpression.prototype.toJSON = function toJSON() { - return "UNIMPL: " + this.type.toUpperCase(); - }; + this.dslCallbacks.push(callback); - return CompiledExpression; - })(); + return this; + }, - exports.CompiledExpression = CompiledExpression; -}); + _routePath: function (handlerInfos) { + var path = []; -enifed('glimmer-runtime/lib/compiled/expressions/args', ['exports', 'glimmer-runtime/lib/compiled/expressions/positional-args', 'glimmer-runtime/lib/compiled/expressions/named-args', 'glimmer-runtime/lib/syntax/core', 'glimmer-reference'], function (exports, _glimmerRuntimeLibCompiledExpressionsPositionalArgs, _glimmerRuntimeLibCompiledExpressionsNamedArgs, _glimmerRuntimeLibSyntaxCore, _glimmerReference) { - 'use strict'; + // We have to handle coalescing resource names that + // are prefixed with their parent's names, e.g. + // ['foo', 'foo.bar.baz'] => 'foo.bar.baz', not 'foo.foo.bar.baz' - var CompiledArgs = (function () { - function CompiledArgs(positional, named, blocks) { - this.positional = positional; - this.named = named; - this.blocks = blocks; + function intersectionMatches(a1, a2) { + for (var i = 0; i < a1.length; ++i) { + if (a1[i] !== a2[i]) { + return false; + } } + return true; + } - CompiledArgs.create = function create(positional, named, blocks) { - if (positional === _glimmerRuntimeLibCompiledExpressionsPositionalArgs.COMPILED_EMPTY_POSITIONAL_ARGS && named === _glimmerRuntimeLibCompiledExpressionsNamedArgs.COMPILED_EMPTY_NAMED_ARGS && blocks === _glimmerRuntimeLibSyntaxCore.EMPTY_BLOCKS) { - return this.empty(); - } else { - return new this(positional, named, blocks); - } - }; - - CompiledArgs.empty = function empty() { - return COMPILED_EMPTY_ARGS; - }; - - CompiledArgs.prototype.evaluate = function evaluate(vm) { - var positional = this.positional; - var named = this.named; - var blocks = this.blocks; + var name = undefined, + nameParts = undefined, + oldNameParts = undefined; + for (var i = 1; i < handlerInfos.length; i++) { + name = handlerInfos[i].name; + nameParts = name.split('.'); + oldNameParts = slice.call(path); - return EvaluatedArgs.create(positional.evaluate(vm), named.evaluate(vm), blocks); - }; + while (oldNameParts.length) { + if (intersectionMatches(oldNameParts, nameParts)) { + break; + } + oldNameParts.shift(); + } - return CompiledArgs; - })(); + path.push.apply(path, nameParts.slice(oldNameParts.length)); + } - exports.CompiledArgs = CompiledArgs; + return path.join('.'); + } + }); - var COMPILED_EMPTY_ARGS = new ((function (_CompiledArgs) { - babelHelpers.inherits(_class, _CompiledArgs); + function didBeginTransition(transition, router) { + var routerState = _emberRoutingSystemRouter_state.default.create({ + emberRouter: router, + routerJs: router.router, + routerJsState: transition.state + }); - function _class() { - _CompiledArgs.call(this, _glimmerRuntimeLibCompiledExpressionsPositionalArgs.COMPILED_EMPTY_POSITIONAL_ARGS, _glimmerRuntimeLibCompiledExpressionsNamedArgs.COMPILED_EMPTY_NAMED_ARGS, _glimmerRuntimeLibSyntaxCore.EMPTY_BLOCKS); - } + if (!router.currentState) { + router.set('currentState', routerState); + } + router.set('targetState', routerState); - _class.prototype.evaluate = function evaluate(vm) { - return EMPTY_EVALUATED_ARGS; - }; + transition.promise = transition.catch(function (error) { + var errorId = _emberUtils.guidFor(error); - return _class; - })(CompiledArgs))(); + if (router._isErrorHandled(errorId)) { + router._clearHandledError(errorId); + } else { + throw error; + } + }); + } - var EvaluatedArgs = (function () { - function EvaluatedArgs(positional, named, blocks) { - this.positional = positional; - this.named = named; - this.blocks = blocks; - this.tag = _glimmerReference.combineTagged([positional, named]); - } + function resemblesURL(str) { + return typeof str === 'string' && (str === '' || str[0] === '/'); + } - EvaluatedArgs.empty = function empty() { - return EMPTY_EVALUATED_ARGS; - }; + function forEachQueryParam(router, handlerInfos, queryParams, callback) { + var qpCache = router._queryParamsFor(handlerInfos); - EvaluatedArgs.create = function create(positional, named, blocks) { - return new this(positional, named, blocks); - }; + for (var key in queryParams) { + if (!queryParams.hasOwnProperty(key)) { + continue; + } + var value = queryParams[key]; + var qp = qpCache.map[key]; - EvaluatedArgs.positional = function positional(values) { - var blocks = arguments.length <= 1 || arguments[1] === undefined ? _glimmerRuntimeLibSyntaxCore.EMPTY_BLOCKS : arguments[1]; + callback(key, value, qp); + } + } - return new this(_glimmerRuntimeLibCompiledExpressionsPositionalArgs.EvaluatedPositionalArgs.create(values), _glimmerRuntimeLibCompiledExpressionsNamedArgs.EVALUATED_EMPTY_NAMED_ARGS, blocks); - }; + function findLiveRoute(liveRoutes, name) { + if (!liveRoutes) { + return; + } + var stack = [liveRoutes]; + while (stack.length > 0) { + var test = stack.shift(); + if (test.render.name === name) { + return test; + } + var outlets = test.outlets; + for (var outletName in outlets) { + stack.push(outlets[outletName]); + } + } + } - EvaluatedArgs.named = function named(map) { - var blocks = arguments.length <= 1 || arguments[1] === undefined ? _glimmerRuntimeLibSyntaxCore.EMPTY_BLOCKS : arguments[1]; + function appendLiveRoute(liveRoutes, defaultParentState, renderOptions) { + var target = undefined; + var myState = { + render: renderOptions, + outlets: new _emberUtils.EmptyObject(), + wasUsed: false + }; + if (renderOptions.into) { + target = findLiveRoute(liveRoutes, renderOptions.into); + } else { + target = defaultParentState; + } + if (target) { + _emberMetal.set(target.outlets, renderOptions.outlet, myState); + } else { + if (renderOptions.into) { + _emberMetal.deprecate('Rendering into a {{render}} helper that resolves to an {{outlet}} is deprecated.', false, { + id: 'ember-routing.top-level-render-helper', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_rendering-into-a-render-helper-that-resolves-to-an-outlet' + }); - return new this(_glimmerRuntimeLibCompiledExpressionsPositionalArgs.EVALUATED_EMPTY_POSITIONAL_ARGS, _glimmerRuntimeLibCompiledExpressionsNamedArgs.EvaluatedNamedArgs.create(map), blocks); - }; + // Megahax time. Post-3.0-breaking-changes, we will just assert + // right here that the user tried to target a nonexistent + // thing. But for now we still need to support the `render` + // helper, and people are allowed to target templates rendered + // by the render helper. So instead we defer doing anyting with + // these orphan renders until afterRender. + appendOrphan(liveRoutes, renderOptions.into, myState); + } else { + liveRoutes = myState; + } + } + return { + liveRoutes: liveRoutes, + ownState: myState + }; + } - return EvaluatedArgs; - })(); + function appendOrphan(liveRoutes, into, myState) { + if (!liveRoutes.outlets.__ember_orphans__) { + liveRoutes.outlets.__ember_orphans__ = { + render: { + name: '__ember_orphans__' + }, + outlets: new _emberUtils.EmptyObject() + }; + } + liveRoutes.outlets.__ember_orphans__.outlets[into] = myState; + _emberMetal.run.schedule('afterRender', function () { + // `wasUsed` gets set by the render helper. + _emberMetal.assert('You attempted to render into \'' + into + '\' but it was not found', liveRoutes.outlets.__ember_orphans__.outlets[into].wasUsed); + }); + } - exports.EvaluatedArgs = EvaluatedArgs; + function representEmptyRoute(liveRoutes, defaultParentState, route) { + // the route didn't render anything + var alreadyAppended = findLiveRoute(liveRoutes, route.routeName); + if (alreadyAppended) { + // But some other route has already rendered our default + // template, so that becomes the default target for any + // children we may have. + return alreadyAppended; + } else { + // Create an entry to represent our default template name, + // just so other routes can target it and inherit its place + // in the outlet hierarchy. + defaultParentState.outlets.main = { + render: { + name: route.routeName, + outlet: 'main' + }, + outlets: {} + }; + return defaultParentState; + } + } - var EMPTY_EVALUATED_ARGS = new EvaluatedArgs(_glimmerRuntimeLibCompiledExpressionsPositionalArgs.EVALUATED_EMPTY_POSITIONAL_ARGS, _glimmerRuntimeLibCompiledExpressionsNamedArgs.EVALUATED_EMPTY_NAMED_ARGS, _glimmerRuntimeLibSyntaxCore.EMPTY_BLOCKS); - exports.CompiledPositionalArgs = _glimmerRuntimeLibCompiledExpressionsPositionalArgs.CompiledPositionalArgs; - exports.EvaluatedPositionalArgs = _glimmerRuntimeLibCompiledExpressionsPositionalArgs.EvaluatedPositionalArgs; - exports.CompiledNamedArgs = _glimmerRuntimeLibCompiledExpressionsNamedArgs.CompiledNamedArgs; - exports.EvaluatedNamedArgs = _glimmerRuntimeLibCompiledExpressionsNamedArgs.EvaluatedNamedArgs; + exports.default = EmberRouter; }); -enifed("glimmer-runtime/lib/compiled/expressions/concat", ["exports", "glimmer-reference"], function (exports, _glimmerReference) { - "use strict"; - - var CompiledConcat = (function () { - function CompiledConcat(parts) { - this.parts = parts; - this.type = "concat"; - } - - CompiledConcat.prototype.evaluate = function evaluate(vm) { - var parts = new Array(this.parts.length); - for (var i = 0; i < this.parts.length; i++) { - parts[i] = this.parts[i].evaluate(vm); - } - return new ConcatReference(parts); - }; - - CompiledConcat.prototype.toJSON = function toJSON() { - return "concat(" + this.parts.map(function (expr) { - return expr.toJSON(); - }).join(", ") + ")"; - }; +/** +@module ember +@submodule ember-routing +*/ +enifed('ember-routing/system/router_state', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime'], function (exports, _emberUtils, _emberMetal, _emberRuntime) { + 'use strict'; - return CompiledConcat; - })(); + exports.default = _emberRuntime.Object.extend({ + emberRouter: null, + routerJs: null, + routerJsState: null, - exports.default = CompiledConcat; + isActiveIntent: function (routeName, models, queryParams, queryParamsMustMatch) { + var state = this.routerJsState; + if (!this.routerJs.isActiveIntent(routeName, models, null, state)) { + return false; + } - var ConcatReference = (function (_CachedReference) { - babelHelpers.inherits(ConcatReference, _CachedReference); + var emptyQueryParams = _emberMetal.isEmpty(Object.keys(queryParams)); - function ConcatReference(parts) { - _CachedReference.call(this); - this.parts = parts; - this.tag = _glimmerReference.combineTagged(parts); - } + if (queryParamsMustMatch && !emptyQueryParams) { + var visibleQueryParams = {}; + _emberUtils.assign(visibleQueryParams, queryParams); - ConcatReference.prototype.compute = function compute() { - var parts = new Array(); - for (var i = 0; i < this.parts.length; i++) { - var value = this.parts[i].value(); - if (value !== null && value !== undefined) { - parts[i] = castToString(this.parts[i].value()); - } - } - if (parts.length > 0) { - return parts.join(''); - } - return null; - }; + this.emberRouter._prepareQueryParams(routeName, models, visibleQueryParams); + return shallowEqual(visibleQueryParams, state.queryParams); + } - return ConcatReference; - })(_glimmerReference.CachedReference); + return true; + } + }); - function castToString(value) { - if (typeof value['toString'] !== 'function') { - return ''; - } - return String(value); + function shallowEqual(a, b) { + var k = undefined; + for (k in a) { + if (a.hasOwnProperty(k) && a[k] !== b[k]) { + return false; + } } + for (k in b) { + if (b.hasOwnProperty(k) && a[k] !== b[k]) { + return false; + } + } + return true; + } }); +enifed('ember-routing/utils', ['exports', 'ember-utils', 'ember-metal'], function (exports, _emberUtils, _emberMetal) { + 'use strict'; -enifed('glimmer-runtime/lib/compiled/expressions/function', ['exports', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/compiled/expressions'], function (exports, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibCompiledExpressions) { - 'use strict'; + exports.routeArgs = routeArgs; + exports.getActiveTargetName = getActiveTargetName; + exports.stashParamNames = stashParamNames; + exports.calculateCacheKey = calculateCacheKey; + exports.normalizeControllerQueryParams = normalizeControllerQueryParams; + exports.prefixRouteNameArg = prefixRouteNameArg; - exports.default = make; + var ALL_PERIODS_REGEX = /\./g; - function make(func) { - return new FunctionExpressionSyntax(func); + function routeArgs(targetRouteName, models, queryParams) { + var args = []; + if (typeof targetRouteName === 'string') { + args.push('' + targetRouteName); } + args.push.apply(args, models); + args.push({ queryParams: queryParams }); + return args; + } - var FunctionExpressionSyntax = (function (_ExpressionSyntax) { - babelHelpers.inherits(FunctionExpressionSyntax, _ExpressionSyntax); - - function FunctionExpressionSyntax(func) { - _ExpressionSyntax.call(this); - this.type = "function-expression"; - this.func = func; - } - - FunctionExpressionSyntax.prototype.compile = function compile(lookup, env, symbolTable) { - return new CompiledFunctionExpression(this.func, symbolTable); - }; - - return FunctionExpressionSyntax; - })(_glimmerRuntimeLibSyntax.Expression); + function getActiveTargetName(router) { + var handlerInfos = router.activeTransition ? router.activeTransition.state.handlerInfos : router.state.handlerInfos; + return handlerInfos[handlerInfos.length - 1].name; + } - var CompiledFunctionExpression = (function (_CompiledExpression) { - babelHelpers.inherits(CompiledFunctionExpression, _CompiledExpression); + function stashParamNames(router, handlerInfos) { + if (handlerInfos._namesStashed) { + return; + } - function CompiledFunctionExpression(func, symbolTable) { - _CompiledExpression.call(this); - this.func = func; - this.symbolTable = symbolTable; - this.type = "function"; - this.func = func; - } + // This helper exists because router.js/route-recognizer.js awkwardly + // keeps separate a handlerInfo's list of parameter names depending + // on whether a URL transition or named transition is happening. + // Hopefully we can remove this in the future. + var targetRouteName = handlerInfos[handlerInfos.length - 1].name; + var recogHandlers = router.router.recognizer.handlersFor(targetRouteName); + var dynamicParent = null; - CompiledFunctionExpression.prototype.evaluate = function evaluate(vm) { - var func = this.func; - var symbolTable = this.symbolTable; + for (var i = 0; i < handlerInfos.length; ++i) { + var handlerInfo = handlerInfos[i]; + var names = recogHandlers[i].names; - return func(vm, symbolTable); - }; + if (names.length) { + dynamicParent = handlerInfo; + } - CompiledFunctionExpression.prototype.toJSON = function toJSON() { - var func = this.func; + handlerInfo._names = names; - if (func.name) { - return '`' + func.name + '(...)`'; - } else { - return "`func(...)`"; - } - }; + var route = handlerInfo.handler; + route._stashNames(handlerInfo, dynamicParent); + } - return CompiledFunctionExpression; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); -}); + handlerInfos._namesStashed = true; + } -enifed('glimmer-runtime/lib/compiled/expressions/has-block', ['exports', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-runtime/lib/references'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerRuntimeLibReferences) { - 'use strict'; + function _calculateCacheValuePrefix(prefix, part) { + // calculates the dot seperated sections from prefix that are also + // at the start of part - which gives us the route name - var CompiledHasBlock = (function (_CompiledExpression) { - babelHelpers.inherits(CompiledHasBlock, _CompiledExpression); + // given : prefix = site.article.comments, part = site.article.id + // - returns: site.article (use get(values[site.article], 'id') to get the dynamic part - used below) - function CompiledHasBlock(inner) { - _CompiledExpression.call(this); - this.inner = inner; - this.type = "has-block"; - } + // given : prefix = site.article, part = site.article.id + // - returns: site.article. (use get(values[site.article], 'id') to get the dynamic part - used below) - CompiledHasBlock.prototype.evaluate = function evaluate(vm) { - var block = this.inner.evaluate(vm); - return _glimmerRuntimeLibReferences.PrimitiveReference.create(!!block); - }; + var prefixParts = prefix.split('.'); + var currPrefix = ''; - CompiledHasBlock.prototype.toJSON = function toJSON() { - return 'has-block(' + this.inner.toJSON() + ')'; - }; + for (var i = 0; i < prefixParts.length; i++) { + var currPart = prefixParts.slice(0, i + 1).join('.'); + if (part.indexOf(currPart) !== 0) { + break; + } + currPrefix = currPart; + } - return CompiledHasBlock; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); + return currPrefix; + } - exports.default = CompiledHasBlock; + /* + Stolen from Controller + */ - var CompiledHasBlockParams = (function (_CompiledExpression2) { - babelHelpers.inherits(CompiledHasBlockParams, _CompiledExpression2); + function calculateCacheKey(prefix, parts, values) { + if (parts === undefined) parts = []; - function CompiledHasBlockParams(inner) { - _CompiledExpression2.call(this); - this.inner = inner; - this.type = "has-block-params"; + var suffixes = ''; + for (var i = 0; i < parts.length; ++i) { + var part = parts[i]; + var cacheValuePrefix = _calculateCacheValuePrefix(prefix, part); + var value = undefined; + if (values) { + if (cacheValuePrefix && cacheValuePrefix in values) { + var partRemovedPrefix = part.indexOf(cacheValuePrefix) === 0 ? part.substr(cacheValuePrefix.length + 1) : part; + value = _emberMetal.get(values[cacheValuePrefix], partRemovedPrefix); + } else { + value = _emberMetal.get(values, part); } + } + suffixes += '::' + part + ':' + value; + } + return prefix + suffixes.replace(ALL_PERIODS_REGEX, '-'); + } - CompiledHasBlockParams.prototype.evaluate = function evaluate(vm) { - var block = this.inner.evaluate(vm); - return _glimmerRuntimeLibReferences.PrimitiveReference.create(!!(block && block.locals.length > 0)); - }; - - CompiledHasBlockParams.prototype.toJSON = function toJSON() { - return 'has-block-params(' + this.inner.toJSON() + ')'; - }; + /* + Controller-defined query parameters can come in three shapes: + + Array + queryParams: ['foo', 'bar'] + Array of simple objects where value is an alias + queryParams: [ + { + 'foo': 'rename_foo_to_this' + }, + { + 'bar': 'call_bar_this_instead' + } + ] + Array of fully defined objects + queryParams: [ + { + 'foo': { + as: 'rename_foo_to_this' + }, + } + { + 'bar': { + as: 'call_bar_this_instead', + scope: 'controller' + } + } + ] + + This helper normalizes all three possible styles into the + 'Array of fully defined objects' style. + */ - return CompiledHasBlockParams; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); + function normalizeControllerQueryParams(queryParams) { + var qpMap = {}; - exports.CompiledHasBlockParams = CompiledHasBlockParams; + for (var i = 0; i < queryParams.length; ++i) { + accumulateQueryParamDescriptors(queryParams[i], qpMap); + } - var CompiledGetBlockBySymbol = (function () { - function CompiledGetBlockBySymbol(symbol, debug) { - this.symbol = symbol; - this.debug = debug; - } + return qpMap; + } - CompiledGetBlockBySymbol.prototype.evaluate = function evaluate(vm) { - return vm.scope().getBlock(this.symbol); - }; + function accumulateQueryParamDescriptors(_desc, accum) { + var desc = _desc; + var tmp = undefined; + if (typeof desc === 'string') { + tmp = {}; + tmp[desc] = { as: null }; + desc = tmp; + } - CompiledGetBlockBySymbol.prototype.toJSON = function toJSON() { - return 'get-block($' + this.symbol + '(' + this.debug + '))'; - }; + for (var key in desc) { + if (!desc.hasOwnProperty(key)) { + return; + } - return CompiledGetBlockBySymbol; - })(); + var singleDesc = desc[key]; + if (typeof singleDesc === 'string') { + singleDesc = { as: singleDesc }; + } - exports.CompiledGetBlockBySymbol = CompiledGetBlockBySymbol; + tmp = accum[key] || { as: null, scope: 'model' }; + _emberUtils.assign(tmp, singleDesc); - var CompiledInPartialGetBlock = (function () { - function CompiledInPartialGetBlock(symbol, name) { - this.symbol = symbol; - this.name = name; - } + accum[key] = tmp; + } + } - CompiledInPartialGetBlock.prototype.evaluate = function evaluate(vm) { - var symbol = this.symbol; - var name = this.name; + /* + Check if a routeName resembles a url instead + + @private + */ + function resemblesURL(str) { + return typeof str === 'string' && (str === '' || str.charAt(0) === '/'); + } - var args = vm.scope().getPartialArgs(symbol); - return args.blocks[name]; - }; + /* + Returns an arguments array where the route name arg is prefixed based on the mount point + + @private + */ - CompiledInPartialGetBlock.prototype.toJSON = function toJSON() { - return 'get-block($' + this.symbol + '($ARGS).' + this.name + '))'; - }; + function prefixRouteNameArg(route, args) { + var routeName = args[0]; + var owner = _emberUtils.getOwner(route); + var prefix = owner.mountPoint; - return CompiledInPartialGetBlock; - })(); + // only alter the routeName if it's actually referencing a route. + if (owner.routable && typeof routeName === 'string') { + if (resemblesURL(routeName)) { + throw new _emberMetal.Error('Programmatic transitions by URL cannot be used within an Engine. Please use the route name instead.'); + } else { + routeName = prefix + '.' + routeName; + args[0] = routeName; + } + } - exports.CompiledInPartialGetBlock = CompiledInPartialGetBlock; + return args; + } }); +enifed('ember-runtime/compare', ['exports', 'ember-runtime/utils', 'ember-runtime/mixins/comparable'], function (exports, _emberRuntimeUtils, _emberRuntimeMixinsComparable) { + 'use strict'; -enifed('glimmer-runtime/lib/compiled/expressions/helper', ['exports', 'glimmer-runtime/lib/compiled/expressions'], function (exports, _glimmerRuntimeLibCompiledExpressions) { - 'use strict'; + exports.default = compare; + + var TYPE_ORDER = { + 'undefined': 0, + 'null': 1, + 'boolean': 2, + 'number': 3, + 'string': 4, + 'array': 5, + 'object': 6, + 'instance': 7, + 'function': 8, + 'class': 9, + 'date': 10 + }; - var CompiledHelper = (function (_CompiledExpression) { - babelHelpers.inherits(CompiledHelper, _CompiledExpression); + // + // the spaceship operator + // + // `. ___ + // __,' __`. _..----....____ + // __...--.'``;. ,. ;``--..__ .' ,-._ _.-' + // _..-''-------' `' `' `' O ``-''._ (,;') _,' + // ,'________________ \`-._`-',' + // `._ ```````````------...___ '-.._'-: + // ```--.._ ,. ````--...__\-. + // `.--. `-` "INFINITY IS LESS ____ | |` + // `. `. THAN BEYOND" ,'`````. ; ;` + // `._`. __________ `. \'__/` + // `-:._____/______/___/____`. \ ` + // | `._ `. \ + // `._________`-. `. `.___ + // SSt `------'` + function spaceship(a, b) { + var diff = a - b; + return (diff > 0) - (diff < 0); + } - function CompiledHelper(name, helper, args, symbolTable) { - _CompiledExpression.call(this); - this.name = name; - this.helper = helper; - this.args = args; - this.symbolTable = symbolTable; - this.type = "helper"; - } + /** + Compares two javascript values and returns: + + - -1 if the first is smaller than the second, + - 0 if both are equal, + - 1 if the first is greater than the second. + + ```javascript + Ember.compare('hello', 'hello'); // 0 + Ember.compare('abc', 'dfg'); // -1 + Ember.compare(2, 1); // 1 + ``` + + If the types of the two objects are different precedence occurs in the + following order, with types earlier in the list considered `<` types + later in the list: + + - undefined + - null + - boolean + - number + - string + - array + - object + - instance + - function + - class + - date + + ```javascript + Ember.compare('hello', 50); // 1 + Ember.compare(50, 'hello'); // -1 + ``` + + @method compare + @for Ember + @param {Object} v First value to compare + @param {Object} w Second value to compare + @return {Number} -1 if v < w, 0 if v = w and 1 if v > w. + @public + */ - CompiledHelper.prototype.evaluate = function evaluate(vm) { - var helper = this.helper; + function compare(v, w) { + if (v === w) { + return 0; + } - return helper(vm, this.args.evaluate(vm), this.symbolTable); - }; + var type1 = _emberRuntimeUtils.typeOf(v); + var type2 = _emberRuntimeUtils.typeOf(w); - CompiledHelper.prototype.toJSON = function toJSON() { - return '`' + this.name.join('.') + '($ARGS)`'; - }; + if (_emberRuntimeMixinsComparable.default) { + if (type1 === 'instance' && _emberRuntimeMixinsComparable.default.detect(v) && v.constructor.compare) { + return v.constructor.compare(v, w); + } - return CompiledHelper; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); + if (type2 === 'instance' && _emberRuntimeMixinsComparable.default.detect(w) && w.constructor.compare) { + return w.constructor.compare(w, v) * -1; + } + } - exports.default = CompiledHelper; -}); + var res = spaceship(TYPE_ORDER[type1], TYPE_ORDER[type2]); -enifed('glimmer-runtime/lib/compiled/expressions/lookups', ['exports', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-reference'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerReference) { - 'use strict'; + if (res !== 0) { + return res; + } - var CompiledLookup = (function (_CompiledExpression) { - babelHelpers.inherits(CompiledLookup, _CompiledExpression); + // types are equal - so we have to check values now + switch (type1) { + case 'boolean': + case 'number': + return spaceship(v, w); - function CompiledLookup(base, path) { - _CompiledExpression.call(this); - this.base = base; - this.path = path; - this.type = "lookup"; - } + case 'string': + return spaceship(v.localeCompare(w), 0); - CompiledLookup.create = function create(base, path) { - if (path.length === 0) { - return base; - } else { - return new this(base, path); + case 'array': + { + var vLen = v.length; + var wLen = w.length; + var len = Math.min(vLen, wLen); + + for (var i = 0; i < len; i++) { + var r = compare(v[i], w[i]); + if (r !== 0) { + return r; } - }; - - CompiledLookup.prototype.evaluate = function evaluate(vm) { - var base = this.base; - var path = this.path; - - return _glimmerReference.referenceFromParts(base.evaluate(vm), path); - }; - - CompiledLookup.prototype.toJSON = function toJSON() { - return this.base.toJSON() + '.' + this.path.join('.'); - }; - - return CompiledLookup; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); - - exports.default = CompiledLookup; - - var CompiledSelf = (function (_CompiledExpression2) { - babelHelpers.inherits(CompiledSelf, _CompiledExpression2); - - function CompiledSelf() { - _CompiledExpression2.apply(this, arguments); - } - - CompiledSelf.prototype.evaluate = function evaluate(vm) { - return vm.getSelf(); - }; - - CompiledSelf.prototype.toJSON = function toJSON() { - return 'self'; - }; - - return CompiledSelf; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); - - exports.CompiledSelf = CompiledSelf; - - var CompiledSymbol = (function (_CompiledExpression3) { - babelHelpers.inherits(CompiledSymbol, _CompiledExpression3); + } - function CompiledSymbol(symbol, debug) { - _CompiledExpression3.call(this); - this.symbol = symbol; - this.debug = debug; + // all elements are equal now + // shorter array should be ordered first + return spaceship(vLen, wLen); } - - CompiledSymbol.prototype.evaluate = function evaluate(vm) { - return vm.referenceForSymbol(this.symbol); - }; - - CompiledSymbol.prototype.toJSON = function toJSON() { - return '$' + this.symbol + '(' + this.debug + ')'; - }; - - return CompiledSymbol; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); - - exports.CompiledSymbol = CompiledSymbol; - - var CompiledInPartialName = (function (_CompiledExpression4) { - babelHelpers.inherits(CompiledInPartialName, _CompiledExpression4); - - function CompiledInPartialName(symbol, name) { - _CompiledExpression4.call(this); - this.symbol = symbol; - this.name = name; + case 'instance': + if (_emberRuntimeMixinsComparable.default && _emberRuntimeMixinsComparable.default.detect(v)) { + return v.compare(v, w); } + return 0; - CompiledInPartialName.prototype.evaluate = function evaluate(vm) { - var symbol = this.symbol; - var name = this.name; - - var args = vm.scope().getPartialArgs(symbol); - return args.named.get(name); - }; - - CompiledInPartialName.prototype.toJSON = function toJSON() { - return '$' + this.symbol + '($ARGS).' + this.name; - }; - - return CompiledInPartialName; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); + case 'date': + return spaceship(v.getTime(), w.getTime()); - exports.CompiledInPartialName = CompiledInPartialName; + default: + return 0; + } + } }); +enifed('ember-runtime/computed/computed_macros', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; -enifed('glimmer-runtime/lib/compiled/expressions/named-args', ['exports', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/utils', 'glimmer-reference', 'glimmer-util'], function (exports, _glimmerRuntimeLibReferences, _glimmerRuntimeLibUtils, _glimmerReference, _glimmerUtil) { - 'use strict'; + exports.empty = empty; + exports.notEmpty = notEmpty; + exports.none = none; + exports.not = not; + exports.bool = bool; + exports.match = match; + exports.equal = equal; + exports.gt = gt; + exports.gte = gte; + exports.lt = lt; + exports.lte = lte; + exports.oneWay = oneWay; + exports.readOnly = readOnly; + exports.deprecatingAlias = deprecatingAlias; - var CompiledNamedArgs = (function () { - function CompiledNamedArgs(keys, values) { - this.keys = keys; - this.values = values; - this.length = keys.length; - _glimmerUtil.assert(keys.length === values.length, 'Keys and values do not have the same length'); - } + /** + @module ember + @submodule ember-metal + */ - CompiledNamedArgs.empty = function empty() { - return COMPILED_EMPTY_NAMED_ARGS; - }; + function expandPropertiesToArray(predicateName, properties) { + var expandedProperties = []; - CompiledNamedArgs.create = function create(map) { - var keys = Object.keys(map); - var length = keys.length; - if (length > 0) { - var values = []; - for (var i = 0; i < length; i++) { - values[i] = map[keys[i]]; - } - return new this(keys, values); - } else { - return COMPILED_EMPTY_NAMED_ARGS; - } - }; + function extractProperty(entry) { + expandedProperties.push(entry); + } - CompiledNamedArgs.prototype.evaluate = function evaluate(vm) { - var keys = this.keys; - var values = this.values; - var length = this.length; + for (var i = 0; i < properties.length; i++) { + var property = properties[i]; + _emberMetal.assert('Dependent keys passed to Ember.computed.' + predicateName + '() can\'t have spaces.', property.indexOf(' ') < 0); - var evaluated = new Array(length); - for (var i = 0; i < length; i++) { - evaluated[i] = values[i].evaluate(vm); - } - return new EvaluatedNamedArgs(keys, evaluated); - }; + _emberMetal.expandProperties(property, extractProperty); + } - CompiledNamedArgs.prototype.toJSON = function toJSON() { - var keys = this.keys; - var values = this.values; + return expandedProperties; + } - var inner = keys.map(function (key, i) { - return key + ': ' + values[i].toJSON(); - }).join(", "); - return '{' + inner + '}'; - }; + function generateComputedWithPredicate(name, predicate) { + return function () { + for (var _len = arguments.length, properties = Array(_len), _key = 0; _key < _len; _key++) { + properties[_key] = arguments[_key]; + } - return CompiledNamedArgs; - })(); + var expandedProperties = expandPropertiesToArray(name, properties); - exports.CompiledNamedArgs = CompiledNamedArgs; - var COMPILED_EMPTY_NAMED_ARGS = new ((function (_CompiledNamedArgs) { - babelHelpers.inherits(_class, _CompiledNamedArgs); + var computedFunc = _emberMetal.computed(function () { + var lastIdx = expandedProperties.length - 1; - function _class() { - _CompiledNamedArgs.call(this, _glimmerRuntimeLibUtils.EMPTY_ARRAY, _glimmerRuntimeLibUtils.EMPTY_ARRAY); + for (var i = 0; i < lastIdx; i++) { + var value = _emberMetal.get(this, expandedProperties[i]); + if (!predicate(value)) { + return value; + } } - _class.prototype.evaluate = function evaluate(vm) { - return EVALUATED_EMPTY_NAMED_ARGS; - }; - - _class.prototype.toJSON = function toJSON() { - return ''; - }; - - return _class; - })(CompiledNamedArgs))(); - exports.COMPILED_EMPTY_NAMED_ARGS = COMPILED_EMPTY_NAMED_ARGS; - - var EvaluatedNamedArgs = (function () { - function EvaluatedNamedArgs(keys, values) { - var _map = arguments.length <= 2 || arguments[2] === undefined ? undefined : arguments[2]; - - this.keys = keys; - this.values = values; - this._map = _map; - this.tag = _glimmerReference.combineTagged(values); - this.length = keys.length; - _glimmerUtil.assert(keys.length === values.length, 'Keys and values do not have the same length'); - } - - EvaluatedNamedArgs.create = function create(map) { - var keys = Object.keys(map); - var length = keys.length; - if (length > 0) { - var values = new Array(length); - for (var i = 0; i < length; i++) { - values[i] = map[keys[i]]; - } - return new this(keys, values, map); - } else { - return EVALUATED_EMPTY_NAMED_ARGS; - } - }; - - EvaluatedNamedArgs.empty = function empty() { - return EVALUATED_EMPTY_NAMED_ARGS; - }; + return _emberMetal.get(this, expandedProperties[lastIdx]); + }); - EvaluatedNamedArgs.prototype.get = function get(key) { - var keys = this.keys; - var values = this.values; + return computedFunc.property.apply(computedFunc, expandedProperties); + }; + } - var index = keys.indexOf(key); - return index === -1 ? _glimmerRuntimeLibReferences.UNDEFINED_REFERENCE : values[index]; - }; + /** + A computed property that returns true if the value of the dependent + property is null, an empty string, empty array, or empty function. + + Example + + ```javascript + let ToDoList = Ember.Object.extend({ + isDone: Ember.computed.empty('todos') + }); + + let todoList = ToDoList.create({ + todos: ['Unit Test', 'Documentation', 'Release'] + }); + + todoList.get('isDone'); // false + todoList.get('todos').clear(); + todoList.get('isDone'); // true + ``` + + @since 1.6.0 + @method empty + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which negate + the original value for property + @public + */ - EvaluatedNamedArgs.prototype.has = function has(key) { - return this.keys.indexOf(key) !== -1; - }; + function empty(dependentKey) { + return _emberMetal.computed(dependentKey + '.length', function () { + return _emberMetal.isEmpty(_emberMetal.get(this, dependentKey)); + }); + } - EvaluatedNamedArgs.prototype.value = function value() { - var keys = this.keys; - var values = this.values; + /** + A computed property that returns true if the value of the dependent + property is NOT null, an empty string, empty array, or empty function. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + hasStuff: Ember.computed.notEmpty('backpack') + }); + + let hamster = Hamster.create({ backpack: ['Food', 'Sleeping Bag', 'Tent'] }); + + hamster.get('hasStuff'); // true + hamster.get('backpack').clear(); // [] + hamster.get('hasStuff'); // false + ``` + + @method notEmpty + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which returns true if + original value for property is not empty. + @public + */ - var out = _glimmerUtil.dict(); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var ref = values[i]; - out[key] = ref.value(); - } - return out; - }; + function notEmpty(dependentKey) { + return _emberMetal.computed(dependentKey + '.length', function () { + return !_emberMetal.isEmpty(_emberMetal.get(this, dependentKey)); + }); + } - babelHelpers.createClass(EvaluatedNamedArgs, [{ - key: 'map', - get: function () { - var map = this._map; + /** + A computed property that returns true if the value of the dependent + property is null or undefined. This avoids errors from JSLint complaining + about use of ==, which can be technically confusing. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + isHungry: Ember.computed.none('food') + }); + + let hamster = Hamster.create(); + + hamster.get('isHungry'); // true + hamster.set('food', 'Banana'); + hamster.get('isHungry'); // false + hamster.set('food', null); + hamster.get('isHungry'); // true + ``` + + @method none + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which + returns true if original value for property is null or undefined. + @public + */ - if (map) { - return map; - } - map = this._map = _glimmerUtil.dict(); - var keys = this.keys; - var values = this.values; - var length = this.length; + function none(dependentKey) { + return _emberMetal.computed(dependentKey, function () { + return _emberMetal.isNone(_emberMetal.get(this, dependentKey)); + }); + } - for (var i = 0; i < length; i++) { - map[keys[i]] = values[i]; - } - return map; - } - }]); - return EvaluatedNamedArgs; - })(); + /** + A computed property that returns the inverse boolean value + of the original value for the dependent property. + + Example + + ```javascript + let User = Ember.Object.extend({ + isAnonymous: Ember.computed.not('loggedIn') + }); + + let user = User.create({loggedIn: false}); + + user.get('isAnonymous'); // true + user.set('loggedIn', true); + user.get('isAnonymous'); // false + ``` + + @method not + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which returns + inverse of the original value for property + @public + */ - exports.EvaluatedNamedArgs = EvaluatedNamedArgs; - var EVALUATED_EMPTY_NAMED_ARGS = new ((function (_EvaluatedNamedArgs) { - babelHelpers.inherits(_class2, _EvaluatedNamedArgs); + function not(dependentKey) { + return _emberMetal.computed(dependentKey, function () { + return !_emberMetal.get(this, dependentKey); + }); + } - function _class2() { - _EvaluatedNamedArgs.call(this, _glimmerRuntimeLibUtils.EMPTY_ARRAY, _glimmerRuntimeLibUtils.EMPTY_ARRAY, _glimmerRuntimeLibUtils.EMPTY_DICT); - } + /** + A computed property that converts the provided dependent property + into a boolean value. + + ```javascript + let Hamster = Ember.Object.extend({ + hasBananas: Ember.computed.bool('numBananas') + }); + + let hamster = Hamster.create(); + + hamster.get('hasBananas'); // false + hamster.set('numBananas', 0); + hamster.get('hasBananas'); // false + hamster.set('numBananas', 1); + hamster.get('hasBananas'); // true + hamster.set('numBananas', null); + hamster.get('hasBananas'); // false + ``` + + @method bool + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which converts + to boolean the original value for property + @public + */ - _class2.prototype.get = function get() { - return _glimmerRuntimeLibReferences.UNDEFINED_REFERENCE; - }; + function bool(dependentKey) { + return _emberMetal.computed(dependentKey, function () { + return !!_emberMetal.get(this, dependentKey); + }); + } - _class2.prototype.has = function has(key) { - return false; - }; + /** + A computed property which matches the original value for the + dependent property against a given RegExp, returning `true` + if the value matches the RegExp and `false` if it does not. + + Example + + ```javascript + let User = Ember.Object.extend({ + hasValidEmail: Ember.computed.match('email', /^.+@.+\..+$/) + }); + + let user = User.create({loggedIn: false}); + + user.get('hasValidEmail'); // false + user.set('email', ''); + user.get('hasValidEmail'); // false + user.set('email', 'ember_hamster@example.com'); + user.get('hasValidEmail'); // true + ``` + + @method match + @for Ember.computed + @param {String} dependentKey + @param {RegExp} regexp + @return {Ember.ComputedProperty} computed property which match + the original value for property against a given RegExp + @public + */ - _class2.prototype.value = function value() { - return _glimmerRuntimeLibUtils.EMPTY_DICT; - }; + function match(dependentKey, regexp) { + return _emberMetal.computed(dependentKey, function () { + var value = _emberMetal.get(this, dependentKey); - return _class2; - })(EvaluatedNamedArgs))(); - exports.EVALUATED_EMPTY_NAMED_ARGS = EVALUATED_EMPTY_NAMED_ARGS; -}); + return typeof value === 'string' ? regexp.test(value) : false; + }); + } -enifed('glimmer-runtime/lib/compiled/expressions/positional-args', ['exports', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/utils', 'glimmer-reference'], function (exports, _glimmerRuntimeLibReferences, _glimmerRuntimeLibUtils, _glimmerReference) { - 'use strict'; + /** + A computed property that returns true if the provided dependent property + is equal to the given value. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + satisfied: Ember.computed.equal('percentCarrotsEaten', 100) + }); + + let hamster = Hamster.create(); + + hamster.get('satisfied'); // false + hamster.set('percentCarrotsEaten', 100); + hamster.get('satisfied'); // true + hamster.set('percentCarrotsEaten', 50); + hamster.get('satisfied'); // false + ``` + + @method equal + @for Ember.computed + @param {String} dependentKey + @param {String|Number|Object} value + @return {Ember.ComputedProperty} computed property which returns true if + the original value for property is equal to the given value. + @public + */ - var CompiledPositionalArgs = (function () { - function CompiledPositionalArgs(values) { - this.values = values; - this.length = values.length; - } + function equal(dependentKey, value) { + return _emberMetal.computed(dependentKey, function () { + return _emberMetal.get(this, dependentKey) === value; + }); + } - CompiledPositionalArgs.create = function create(values) { - if (values.length) { - return new this(values); - } else { - return COMPILED_EMPTY_POSITIONAL_ARGS; - } - }; + /** + A computed property that returns true if the provided dependent property + is greater than the provided value. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + hasTooManyBananas: Ember.computed.gt('numBananas', 10) + }); + + let hamster = Hamster.create(); + + hamster.get('hasTooManyBananas'); // false + hamster.set('numBananas', 3); + hamster.get('hasTooManyBananas'); // false + hamster.set('numBananas', 11); + hamster.get('hasTooManyBananas'); // true + ``` + + @method gt + @for Ember.computed + @param {String} dependentKey + @param {Number} value + @return {Ember.ComputedProperty} computed property which returns true if + the original value for property is greater than given value. + @public + */ - CompiledPositionalArgs.empty = function empty() { - return COMPILED_EMPTY_POSITIONAL_ARGS; - }; + function gt(dependentKey, value) { + return _emberMetal.computed(dependentKey, function () { + return _emberMetal.get(this, dependentKey) > value; + }); + } - CompiledPositionalArgs.prototype.evaluate = function evaluate(vm) { - var values = this.values; - var length = this.length; + /** + A computed property that returns true if the provided dependent property + is greater than or equal to the provided value. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + hasTooManyBananas: Ember.computed.gte('numBananas', 10) + }); + + let hamster = Hamster.create(); + + hamster.get('hasTooManyBananas'); // false + hamster.set('numBananas', 3); + hamster.get('hasTooManyBananas'); // false + hamster.set('numBananas', 10); + hamster.get('hasTooManyBananas'); // true + ``` + + @method gte + @for Ember.computed + @param {String} dependentKey + @param {Number} value + @return {Ember.ComputedProperty} computed property which returns true if + the original value for property is greater or equal then given value. + @public + */ - var references = new Array(length); - for (var i = 0; i < length; i++) { - references[i] = values[i].evaluate(vm); - } - return EvaluatedPositionalArgs.create(references); - }; + function gte(dependentKey, value) { + return _emberMetal.computed(dependentKey, function () { + return _emberMetal.get(this, dependentKey) >= value; + }); + } - CompiledPositionalArgs.prototype.toJSON = function toJSON() { - return '[' + this.values.map(function (value) { - return value.toJSON(); - }).join(", ") + ']'; - }; + /** + A computed property that returns true if the provided dependent property + is less than the provided value. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + needsMoreBananas: Ember.computed.lt('numBananas', 3) + }); + + let hamster = Hamster.create(); + + hamster.get('needsMoreBananas'); // true + hamster.set('numBananas', 3); + hamster.get('needsMoreBananas'); // false + hamster.set('numBananas', 2); + hamster.get('needsMoreBananas'); // true + ``` + + @method lt + @for Ember.computed + @param {String} dependentKey + @param {Number} value + @return {Ember.ComputedProperty} computed property which returns true if + the original value for property is less then given value. + @public + */ - return CompiledPositionalArgs; - })(); + function lt(dependentKey, value) { + return _emberMetal.computed(dependentKey, function () { + return _emberMetal.get(this, dependentKey) < value; + }); + } - exports.CompiledPositionalArgs = CompiledPositionalArgs; - var COMPILED_EMPTY_POSITIONAL_ARGS = new ((function (_CompiledPositionalArgs) { - babelHelpers.inherits(_class, _CompiledPositionalArgs); + /** + A computed property that returns true if the provided dependent property + is less than or equal to the provided value. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + needsMoreBananas: Ember.computed.lte('numBananas', 3) + }); + + let hamster = Hamster.create(); + + hamster.get('needsMoreBananas'); // true + hamster.set('numBananas', 5); + hamster.get('needsMoreBananas'); // false + hamster.set('numBananas', 3); + hamster.get('needsMoreBananas'); // true + ``` + + @method lte + @for Ember.computed + @param {String} dependentKey + @param {Number} value + @return {Ember.ComputedProperty} computed property which returns true if + the original value for property is less or equal than given value. + @public + */ - function _class() { - _CompiledPositionalArgs.call(this, _glimmerRuntimeLibUtils.EMPTY_ARRAY); - } + function lte(dependentKey, value) { + return _emberMetal.computed(dependentKey, function () { + return _emberMetal.get(this, dependentKey) <= value; + }); + } - _class.prototype.evaluate = function evaluate(vm) { - return EVALUATED_EMPTY_POSITIONAL_ARGS; - }; + /** + A computed property that performs a logical `and` on the + original values for the provided dependent properties. + + You may pass in more than two properties and even use + property brace expansion. The computed property will + return the first falsy value or last truthy value + just like JavaScript's `&&` operator. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + readyForCamp: Ember.computed.and('hasTent', 'hasBackpack'), + readyForHike: Ember.computed.and('hasWalkingStick', 'hasBackpack') + }); + + let tomster = Hamster.create(); + + tomster.get('readyForCamp'); // false + tomster.set('hasTent', true); + tomster.get('readyForCamp'); // false + tomster.set('hasBackpack', true); + tomster.get('readyForCamp'); // true + tomster.set('hasBackpack', 'Yes'); + tomster.get('readyForCamp'); // 'Yes' + tomster.set('hasWalkingStick', null); + tomster.get('readyForHike'); // null + ``` + + @method and + @for Ember.computed + @param {String} dependentKey* + @return {Ember.ComputedProperty} computed property which performs + a logical `and` on the values of all the original values for properties. + @public + */ + var and = generateComputedWithPredicate('and', function (value) { + return value; + }); - _class.prototype.toJSON = function toJSON() { - return ''; - }; + exports.and = and; + /** + A computed property which performs a logical `or` on the + original values for the provided dependent properties. + + You may pass in more than two properties and even use + property brace expansion. The computed property will + return the first truthy value or last falsy value just + like JavaScript's `||` operator. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + readyForRain: Ember.computed.or('hasJacket', 'hasUmbrella'), + readyForBeach: Ember.computed.or('{hasSunscreen,hasUmbrella}') + }); + + let tomster = Hamster.create(); + + tomster.get('readyForRain'); // undefined + tomster.set('hasUmbrella', true); + tomster.get('readyForRain'); // true + tomster.set('hasJacket', 'Yes'); + tomster.get('readyForRain'); // 'Yes' + tomster.set('hasSunscreen', 'Check'); + tomster.get('readyForBeach'); // 'Check' + ``` + + @method or + @for Ember.computed + @param {String} dependentKey* + @return {Ember.ComputedProperty} computed property which performs + a logical `or` on the values of all the original values for properties. + @public + */ + var or = generateComputedWithPredicate('or', function (value) { + return !value; + }); - return _class; - })(CompiledPositionalArgs))(); - exports.COMPILED_EMPTY_POSITIONAL_ARGS = COMPILED_EMPTY_POSITIONAL_ARGS; + exports.or = or; + /** + Creates a new property that is an alias for another property + on an object. Calls to `get` or `set` this property behave as + though they were called on the original property. + + ```javascript + let Person = Ember.Object.extend({ + name: 'Alex Matchneer', + nomen: Ember.computed.alias('name') + }); + + let alex = Person.create(); + + alex.get('nomen'); // 'Alex Matchneer' + alex.get('name'); // 'Alex Matchneer' + + alex.set('nomen', '@machty'); + alex.get('name'); // '@machty' + ``` + + @method alias + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which creates an + alias to the original value for property. + @public + */ - var EvaluatedPositionalArgs = (function () { - function EvaluatedPositionalArgs(values) { - this.values = values; - this.tag = _glimmerReference.combineTagged(values); - this.length = values.length; - } + /** + Where `computed.alias` aliases `get` and `set`, and allows for bidirectional + data flow, `computed.oneWay` only provides an aliased `get`. The `set` will + not mutate the upstream property, rather causes the current property to + become the value set. This causes the downstream property to permanently + diverge from the upstream property. + + Example + + ```javascript + let User = Ember.Object.extend({ + firstName: null, + lastName: null, + nickName: Ember.computed.oneWay('firstName') + }); + + let teddy = User.create({ + firstName: 'Teddy', + lastName: 'Zeenny' + }); + + teddy.get('nickName'); // 'Teddy' + teddy.set('nickName', 'TeddyBear'); // 'TeddyBear' + teddy.get('firstName'); // 'Teddy' + ``` + + @method oneWay + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which creates a + one way computed property to the original value for property. + @public + */ - EvaluatedPositionalArgs.create = function create(values) { - return new this(values); - }; + function oneWay(dependentKey) { + return _emberMetal.alias(dependentKey).oneWay(); + } - EvaluatedPositionalArgs.empty = function empty() { - return EVALUATED_EMPTY_POSITIONAL_ARGS; - }; + /** + This is a more semantically meaningful alias of `computed.oneWay`, + whose name is somewhat ambiguous as to which direction the data flows. + + @method reads + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which creates a + one way computed property to the original value for property. + @public + */ - EvaluatedPositionalArgs.prototype.at = function at(index) { - var values = this.values; - var length = this.length; + /** + Where `computed.oneWay` provides oneWay bindings, `computed.readOnly` provides + a readOnly one way binding. Very often when using `computed.oneWay` one does + not also want changes to propagate back up, as they will replace the value. + + This prevents the reverse flow, and also throws an exception when it occurs. + + Example + + ```javascript + let User = Ember.Object.extend({ + firstName: null, + lastName: null, + nickName: Ember.computed.readOnly('firstName') + }); + + let teddy = User.create({ + firstName: 'Teddy', + lastName: 'Zeenny' + }); + + teddy.get('nickName'); // 'Teddy' + teddy.set('nickName', 'TeddyBear'); // throws Exception + // throw new Ember.Error('Cannot Set: nickName on: ' );` + teddy.get('firstName'); // 'Teddy' + ``` + + @method readOnly + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which creates a + one way computed property to the original value for property. + @since 1.5.0 + @public + */ - return index < length ? values[index] : _glimmerRuntimeLibReferences.UNDEFINED_REFERENCE; - }; + function readOnly(dependentKey) { + return _emberMetal.alias(dependentKey).readOnly(); + } - EvaluatedPositionalArgs.prototype.value = function value() { - var values = this.values; - var length = this.length; + /** + Creates a new property that is an alias for another property + on an object. Calls to `get` or `set` this property behave as + though they were called on the original property, but also + print a deprecation warning. + + ```javascript + let Hamster = Ember.Object.extend({ + bananaCount: Ember.computed.deprecatingAlias('cavendishCount', { + id: 'hamster.deprecate-banana', + until: '3.0.0' + }) + }); + + let hamster = Hamster.create(); + + hamster.set('bananaCount', 5); // Prints a deprecation warning. + hamster.get('cavendishCount'); // 5 + ``` + + @method deprecatingAlias + @for Ember.computed + @param {String} dependentKey + @param {Object} options Options for `Ember.deprecate`. + @return {Ember.ComputedProperty} computed property which creates an + alias with a deprecation to the original value for property. + @since 1.7.0 + @public + */ - var ret = new Array(length); - for (var i = 0; i < length; i++) { - ret[i] = values[i].value(); - } - return ret; - }; + function deprecatingAlias(dependentKey, options) { + return _emberMetal.computed(dependentKey, { + get: function (key) { + _emberMetal.deprecate('Usage of `' + key + '` is deprecated, use `' + dependentKey + '` instead.', false, options); + return _emberMetal.get(this, dependentKey); + }, + set: function (key, value) { + _emberMetal.deprecate('Usage of `' + key + '` is deprecated, use `' + dependentKey + '` instead.', false, options); + _emberMetal.set(this, dependentKey, value); + return value; + } + }); + } +}); +enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/compare', 'ember-runtime/utils', 'ember-runtime/system/native_array'], function (exports, _emberUtils, _emberMetal, _emberRuntimeCompare, _emberRuntimeUtils, _emberRuntimeSystemNative_array) { + /** + @module ember + @submodule ember-runtime + */ - return EvaluatedPositionalArgs; - })(); + 'use strict'; - exports.EvaluatedPositionalArgs = EvaluatedPositionalArgs; - var EVALUATED_EMPTY_POSITIONAL_ARGS = new ((function (_EvaluatedPositionalArgs) { - babelHelpers.inherits(_class2, _EvaluatedPositionalArgs); + exports.sum = sum; + exports.max = max; + exports.min = min; + exports.map = map; + exports.mapBy = mapBy; + exports.filter = filter; + exports.filterBy = filterBy; + exports.uniq = uniq; + exports.uniqBy = uniqBy; + exports.intersect = intersect; + exports.setDiff = setDiff; + exports.collect = collect; + exports.sort = sort; - function _class2() { - _EvaluatedPositionalArgs.call(this, _glimmerRuntimeLibUtils.EMPTY_ARRAY); - } + function reduceMacro(dependentKey, callback, initialValue) { + return _emberMetal.computed(dependentKey + '.[]', function () { + var _this = this; - _class2.prototype.at = function at() { - return _glimmerRuntimeLibReferences.UNDEFINED_REFERENCE; - }; + var arr = _emberMetal.get(this, dependentKey); - _class2.prototype.value = function value() { - return this.values; - }; + if (arr === null || typeof arr !== 'object') { + return initialValue; + } - return _class2; - })(EvaluatedPositionalArgs))(); - exports.EVALUATED_EMPTY_POSITIONAL_ARGS = EVALUATED_EMPTY_POSITIONAL_ARGS; -}); + return arr.reduce(function (previousValue, currentValue, index, array) { + return callback.call(_this, previousValue, currentValue, index, array); + }, initialValue); + }).readOnly(); + } -enifed('glimmer-runtime/lib/compiled/expressions/value', ['exports', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-runtime/lib/references'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerRuntimeLibReferences) { - 'use strict'; + function arrayMacro(dependentKey, callback) { + // This is a bit ugly + var propertyName = undefined; + if (/@each/.test(dependentKey)) { + propertyName = dependentKey.replace(/\.@each.*$/, ''); + } else { + propertyName = dependentKey; + dependentKey += '.[]'; + } - var CompiledValue = (function (_CompiledExpression) { - babelHelpers.inherits(CompiledValue, _CompiledExpression); + return _emberMetal.computed(dependentKey, function () { + var value = _emberMetal.get(this, propertyName); + if (_emberRuntimeUtils.isArray(value)) { + return _emberRuntimeSystemNative_array.A(callback.call(this, value)); + } else { + return _emberRuntimeSystemNative_array.A(); + } + }).readOnly(); + } - function CompiledValue(value) { - _CompiledExpression.call(this); - this.type = "value"; - this.reference = _glimmerRuntimeLibReferences.PrimitiveReference.create(value); - } + function multiArrayMacro(dependentKeys, callback) { + var args = dependentKeys.map(function (key) { + return key + '.[]'; + }); - CompiledValue.prototype.evaluate = function evaluate(vm) { - return this.reference; - }; + args.push(function () { + return _emberRuntimeSystemNative_array.A(callback.call(this, dependentKeys)); + }); - CompiledValue.prototype.toJSON = function toJSON() { - return JSON.stringify(this.reference.value()); - }; + return _emberMetal.computed.apply(this, args).readOnly(); + } - return CompiledValue; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); + /** + A computed property that returns the sum of the values + in the dependent array. + + @method sum + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computes the sum of all values in the dependentKey's array + @since 1.4.0 + @public + */ - exports.default = CompiledValue; -}); + function sum(dependentKey) { + return reduceMacro(dependentKey, function (sum, item) { + return sum + item; + }, 0); + } -enifed('glimmer-runtime/lib/compiled/opcodes/builder', ['exports', 'glimmer-runtime/lib/compiled/opcodes/component', 'glimmer-runtime/lib/compiled/opcodes/partial', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-runtime/lib/compiled/opcodes/dom', 'glimmer-runtime/lib/compiled/opcodes/lists', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-util', 'glimmer-runtime/lib/utils'], function (exports, _glimmerRuntimeLibCompiledOpcodesComponent, _glimmerRuntimeLibCompiledOpcodesPartial, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerRuntimeLibCompiledOpcodesDom, _glimmerRuntimeLibCompiledOpcodesLists, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerUtil, _glimmerRuntimeLibUtils) { - 'use strict'; + /** + A computed property that calculates the maximum value in the + dependent array. This will return `-Infinity` when the dependent + array is empty. + + ```javascript + let Person = Ember.Object.extend({ + childAges: Ember.computed.mapBy('children', 'age'), + maxChildAge: Ember.computed.max('childAges') + }); + + let lordByron = Person.create({ children: [] }); + + lordByron.get('maxChildAge'); // -Infinity + lordByron.get('children').pushObject({ + name: 'Augusta Ada Byron', age: 7 + }); + lordByron.get('maxChildAge'); // 7 + lordByron.get('children').pushObjects([{ + name: 'Allegra Byron', + age: 5 + }, { + name: 'Elizabeth Medora Leigh', + age: 8 + }]); + lordByron.get('maxChildAge'); // 8 + ``` + + If the types of the arguments are not numbers, + they will be converted to numbers and the type + of the return value will always be `Number`. + For example, the max of a list of Date objects will be + the highest timestamp as a `Number`. + This behavior is consistent with `Math.max`. + + @method max + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computes the largest value in the dependentKey's array + @public + */ - var StatementCompilationBufferProxy = (function () { - function StatementCompilationBufferProxy(inner) { - this.inner = inner; - } + function max(dependentKey) { + return reduceMacro(dependentKey, function (max, item) { + return Math.max(max, item); + }, -Infinity); + } - StatementCompilationBufferProxy.prototype.toOpSeq = function toOpSeq() { - return this.inner.toOpSeq(); - }; + /** + A computed property that calculates the minimum value in the + dependent array. This will return `Infinity` when the dependent + array is empty. + + ```javascript + let Person = Ember.Object.extend({ + childAges: Ember.computed.mapBy('children', 'age'), + minChildAge: Ember.computed.min('childAges') + }); + + let lordByron = Person.create({ children: [] }); + + lordByron.get('minChildAge'); // Infinity + lordByron.get('children').pushObject({ + name: 'Augusta Ada Byron', age: 7 + }); + lordByron.get('minChildAge'); // 7 + lordByron.get('children').pushObjects([{ + name: 'Allegra Byron', + age: 5 + }, { + name: 'Elizabeth Medora Leigh', + age: 8 + }]); + lordByron.get('minChildAge'); // 5 + ``` + + If the types of the arguments are not numbers, + they will be converted to numbers and the type + of the return value will always be `Number`. + For example, the min of a list of Date objects will be + the lowest timestamp as a `Number`. + This behavior is consistent with `Math.min`. + + @method min + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computes the smallest value in the dependentKey's array + @public + */ - StatementCompilationBufferProxy.prototype.append = function append(opcode) { - this.inner.append(opcode); - }; + function min(dependentKey) { + return reduceMacro(dependentKey, function (min, item) { + return Math.min(min, item); + }, Infinity); + } - StatementCompilationBufferProxy.prototype.getLocalSymbol = function getLocalSymbol(name) { - return this.inner.getLocalSymbol(name); - }; + /** + Returns an array mapped via the callback + + The callback method you provide should have the following signature. + `item` is the current item in the iteration. + `index` is the integer index of the current item in the iteration. + + ```javascript + function(item, index); + ``` + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + excitingChores: Ember.computed.map('chores', function(chore, index) { + return chore.toUpperCase() + '!'; + }) + }); + + let hamster = Hamster.create({ + chores: ['clean', 'write more unit tests'] + }); + + hamster.get('excitingChores'); // ['CLEAN!', 'WRITE MORE UNIT TESTS!'] + ``` + + @method map + @for Ember.computed + @param {String} dependentKey + @param {Function} callback + @return {Ember.ComputedProperty} an array mapped via the callback + @public + */ - StatementCompilationBufferProxy.prototype.hasLocalSymbol = function hasLocalSymbol(name) { - return this.inner.hasLocalSymbol(name); - }; + function map(dependentKey, callback) { + return arrayMacro(dependentKey, function (value) { + return value.map(callback, this); + }); + } - StatementCompilationBufferProxy.prototype.getNamedSymbol = function getNamedSymbol(name) { - return this.inner.getNamedSymbol(name); - }; + /** + Returns an array mapped to the specified key. + + ```javascript + let Person = Ember.Object.extend({ + childAges: Ember.computed.mapBy('children', 'age') + }); + + let lordByron = Person.create({ children: [] }); + + lordByron.get('childAges'); // [] + lordByron.get('children').pushObject({ name: 'Augusta Ada Byron', age: 7 }); + lordByron.get('childAges'); // [7] + lordByron.get('children').pushObjects([{ + name: 'Allegra Byron', + age: 5 + }, { + name: 'Elizabeth Medora Leigh', + age: 8 + }]); + lordByron.get('childAges'); // [7, 5, 8] + ``` + + @method mapBy + @for Ember.computed + @param {String} dependentKey + @param {String} propertyKey + @return {Ember.ComputedProperty} an array mapped to the specified key + @public + */ - StatementCompilationBufferProxy.prototype.hasNamedSymbol = function hasNamedSymbol(name) { - return this.inner.hasNamedSymbol(name); - }; + function mapBy(dependentKey, propertyKey) { + _emberMetal.assert('Ember.computed.mapBy expects a property string for its second argument, ' + 'perhaps you meant to use "map"', typeof propertyKey === 'string'); - StatementCompilationBufferProxy.prototype.getBlockSymbol = function getBlockSymbol(name) { - return this.inner.getBlockSymbol(name); - }; + return map(dependentKey + '.@each.' + propertyKey, function (item) { + return _emberMetal.get(item, propertyKey); + }); + } - StatementCompilationBufferProxy.prototype.hasBlockSymbol = function hasBlockSymbol(name) { - return this.inner.hasBlockSymbol(name); - }; + /** + Filters the array by the callback. + + The callback method you provide should have the following signature. + `item` is the current item in the iteration. + `index` is the integer index of the current item in the iteration. + `array` is the dependant array itself. + + ```javascript + function(item, index, array); + ``` + + ```javascript + let Hamster = Ember.Object.extend({ + remainingChores: Ember.computed.filter('chores', function(chore, index, array) { + return !chore.done; + }) + }); + + let hamster = Hamster.create({ + chores: [ + { name: 'cook', done: true }, + { name: 'clean', done: true }, + { name: 'write more unit tests', done: false } + ] + }); + + hamster.get('remainingChores'); // [{name: 'write more unit tests', done: false}] + ``` + + @method filter + @for Ember.computed + @param {String} dependentKey + @param {Function} callback + @return {Ember.ComputedProperty} the filtered array + @public + */ - StatementCompilationBufferProxy.prototype.getPartialArgsSymbol = function getPartialArgsSymbol() { - return this.inner.getPartialArgsSymbol(); - }; + function filter(dependentKey, callback) { + return arrayMacro(dependentKey, function (value) { + return value.filter(callback, this); + }); + } - StatementCompilationBufferProxy.prototype.hasPartialArgsSymbol = function hasPartialArgsSymbol() { - return this.inner.hasPartialArgsSymbol(); - }; + /** + Filters the array by the property and value + + ```javascript + let Hamster = Ember.Object.extend({ + remainingChores: Ember.computed.filterBy('chores', 'done', false) + }); + + let hamster = Hamster.create({ + chores: [ + { name: 'cook', done: true }, + { name: 'clean', done: true }, + { name: 'write more unit tests', done: false } + ] + }); + + hamster.get('remainingChores'); // [{ name: 'write more unit tests', done: false }] + ``` + + @method filterBy + @for Ember.computed + @param {String} dependentKey + @param {String} propertyKey + @param {*} value + @return {Ember.ComputedProperty} the filtered array + @public + */ - babelHelpers.createClass(StatementCompilationBufferProxy, [{ - key: 'component', - get: function () { - return this.inner.component; - } - }]); - return StatementCompilationBufferProxy; - })(); + function filterBy(dependentKey, propertyKey, value) { + var callback = undefined; - exports.StatementCompilationBufferProxy = StatementCompilationBufferProxy; + if (arguments.length === 2) { + callback = function (item) { + return _emberMetal.get(item, propertyKey); + }; + } else { + callback = function (item) { + return _emberMetal.get(item, propertyKey) === value; + }; + } - var BasicOpcodeBuilder = (function (_StatementCompilationBufferProxy) { - babelHelpers.inherits(BasicOpcodeBuilder, _StatementCompilationBufferProxy); + return filter(dependentKey + '.@each.' + propertyKey, callback); + } - function BasicOpcodeBuilder(inner, symbolTable, env) { - _StatementCompilationBufferProxy.call(this, inner); - this.symbolTable = symbolTable; - this.env = env; - this.labelsStack = new _glimmerUtil.Stack(); - } + /** + A computed property which returns a new array with all the unique + elements from one or more dependent arrays. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + uniqueFruits: Ember.computed.uniq('fruits') + }); + + let hamster = Hamster.create({ + fruits: [ + 'banana', + 'grape', + 'kale', + 'banana' + ] + }); + + hamster.get('uniqueFruits'); // ['banana', 'grape', 'kale'] + ``` + + @method uniq + @for Ember.computed + @param {String} propertyKey* + @return {Ember.ComputedProperty} computes a new array with all the + unique elements from the dependent array + @public + */ - // helpers + function uniq() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - BasicOpcodeBuilder.prototype.startLabels = function startLabels() { - this.labelsStack.push(_glimmerUtil.dict()); - }; + return multiArrayMacro(args, function (dependentKeys) { + var _this2 = this; - BasicOpcodeBuilder.prototype.stopLabels = function stopLabels() { - this.labelsStack.pop(); - }; + var uniq = _emberRuntimeSystemNative_array.A(); - BasicOpcodeBuilder.prototype.labelFor = function labelFor(name) { - var labels = this.labels; - var label = labels[name]; - if (!label) { - label = labels[name] = new _glimmerRuntimeLibCompiledOpcodesVm.LabelOpcode(name); + dependentKeys.forEach(function (dependentKey) { + var value = _emberMetal.get(_this2, dependentKey); + if (_emberRuntimeUtils.isArray(value)) { + value.forEach(function (item) { + if (uniq.indexOf(item) === -1) { + uniq.push(item); } - return label; - }; + }); + } + }); - // partials + return uniq; + }); + } - BasicOpcodeBuilder.prototype.putPartialDefinition = function putPartialDefinition(definition) { - this.append(new _glimmerRuntimeLibCompiledOpcodesPartial.PutPartialDefinitionOpcode(definition)); - }; + /** + A computed property which returns a new array with all the unique + elements from an array, with uniqueness determined by specific key. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + uniqueFruits: Ember.computed.uniqBy('fruits', 'id') + }); + let hamster = Hamster.create({ + fruits: [ + { id: 1, 'banana' }, + { id: 2, 'grape' }, + { id: 3, 'peach' }, + { id: 1, 'banana' } + ] + }); + hamster.get('uniqueFruits'); // [ { id: 1, 'banana' }, { id: 2, 'grape' }, { id: 3, 'peach' }] + ``` + + @method uniqBy + @for Ember.computed + @param {String} dependentKey + @param {String} propertyKey + @return {Ember.ComputedProperty} computes a new array with all the + unique elements from the dependent array + @public + */ - BasicOpcodeBuilder.prototype.putDynamicPartialDefinition = function putDynamicPartialDefinition() { - this.append(new _glimmerRuntimeLibCompiledOpcodesPartial.PutDynamicPartialDefinitionOpcode(this.symbolTable)); - }; + function uniqBy(dependentKey, propertyKey) { + return _emberMetal.computed(dependentKey + '.[]', function () { + var uniq = _emberRuntimeSystemNative_array.A(); + var seen = new _emberUtils.EmptyObject(); + var list = _emberMetal.get(this, dependentKey); + if (_emberRuntimeUtils.isArray(list)) { + list.forEach(function (item) { + var guid = _emberUtils.guidFor(_emberMetal.get(item, propertyKey)); + if (!(guid in seen)) { + seen[guid] = true; + uniq.push(item); + } + }); + } + return uniq; + }).readOnly(); + } - BasicOpcodeBuilder.prototype.evaluatePartial = function evaluatePartial() { - this.append(new _glimmerRuntimeLibCompiledOpcodesPartial.EvaluatePartialOpcode(this.symbolTable)); - }; + /** + Alias for [Ember.computed.uniq](/api/#method_computed_uniq). + + @method union + @for Ember.computed + @param {String} propertyKey* + @return {Ember.ComputedProperty} computes a new array with all the + unique elements from the dependent array + @public + */ + var union = uniq; - // components + exports.union = union; + /** + A computed property which returns a new array with all the duplicated + elements from two or more dependent arrays. + + Example + + ```javascript + let obj = Ember.Object.extend({ + friendsInCommon: Ember.computed.intersect('adaFriends', 'charlesFriends') + }).create({ + adaFriends: ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'], + charlesFriends: ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock'] + }); + + obj.get('friendsInCommon'); // ['William King', 'Mary Somerville'] + ``` + + @method intersect + @for Ember.computed + @param {String} propertyKey* + @return {Ember.ComputedProperty} computes a new array with all the + duplicated elements from the dependent arrays + @public + */ - BasicOpcodeBuilder.prototype.putComponentDefinition = function putComponentDefinition(definition) { - this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.PutComponentDefinitionOpcode(definition)); - }; + function intersect() { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - BasicOpcodeBuilder.prototype.putDynamicComponentDefinition = function putDynamicComponentDefinition() { - this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.PutDynamicComponentDefinitionOpcode()); - }; + return multiArrayMacro(args, function (dependentKeys) { + var _this3 = this; - BasicOpcodeBuilder.prototype.openComponent = function openComponent(args) { - var shadow = arguments.length <= 1 || arguments[1] === undefined ? _glimmerRuntimeLibUtils.EMPTY_ARRAY : arguments[1]; + var arrays = dependentKeys.map(function (dependentKey) { + var array = _emberMetal.get(_this3, dependentKey); - this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.OpenComponentOpcode(this.compile(args), shadow)); - }; + return _emberRuntimeUtils.isArray(array) ? array : []; + }); - BasicOpcodeBuilder.prototype.didCreateElement = function didCreateElement() { - this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.DidCreateElementOpcode()); - }; + var results = arrays.pop().filter(function (candidate) { + for (var i = 0; i < arrays.length; i++) { + var found = false; + var array = arrays[i]; + for (var j = 0; j < array.length; j++) { + if (array[j] === candidate) { + found = true; + break; + } + } - BasicOpcodeBuilder.prototype.shadowAttributes = function shadowAttributes() { - this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.ShadowAttributesOpcode()); - }; + if (found === false) { + return false; + } + } - BasicOpcodeBuilder.prototype.didRenderLayout = function didRenderLayout() { - this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.DidRenderLayoutOpcode()); - }; + return true; + }); - BasicOpcodeBuilder.prototype.closeComponent = function closeComponent() { - this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.CloseComponentOpcode()); - }; + return _emberRuntimeSystemNative_array.A(results); + }); + } - // content + /** + A computed property which returns a new array with all the + properties from the first dependent array that are not in the second + dependent array. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + likes: ['banana', 'grape', 'kale'], + wants: Ember.computed.setDiff('likes', 'fruits') + }); + + let hamster = Hamster.create({ + fruits: [ + 'grape', + 'kale', + ] + }); + + hamster.get('wants'); // ['banana'] + ``` + + @method setDiff + @for Ember.computed + @param {String} setAProperty + @param {String} setBProperty + @return {Ember.ComputedProperty} computes a new array with all the + items from the first dependent array that are not in the second + dependent array + @public + */ - BasicOpcodeBuilder.prototype.cautiousAppend = function cautiousAppend() { - this.append(new _glimmerRuntimeLibCompiledOpcodesContent.OptimizedCautiousAppendOpcode()); - }; + function setDiff(setAProperty, setBProperty) { + if (arguments.length !== 2) { + throw new _emberMetal.Error('setDiff requires exactly two dependent arrays.'); + } - BasicOpcodeBuilder.prototype.trustingAppend = function trustingAppend() { - this.append(new _glimmerRuntimeLibCompiledOpcodesContent.OptimizedTrustingAppendOpcode()); - }; + return _emberMetal.computed(setAProperty + '.[]', setBProperty + '.[]', function () { + var setA = this.get(setAProperty); + var setB = this.get(setBProperty); - // dom + if (!_emberRuntimeUtils.isArray(setA)) { + return _emberRuntimeSystemNative_array.A(); + } + if (!_emberRuntimeUtils.isArray(setB)) { + return _emberRuntimeSystemNative_array.A(setA); + } - BasicOpcodeBuilder.prototype.text = function text(_text) { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.TextOpcode(_text)); - }; + return setA.filter(function (x) { + return setB.indexOf(x) === -1; + }); + }).readOnly(); + } - BasicOpcodeBuilder.prototype.openPrimitiveElement = function openPrimitiveElement(tag) { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.OpenPrimitiveElementOpcode(tag)); - }; + /** + A computed property that returns the array of values + for the provided dependent properties. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + clothes: Ember.computed.collect('hat', 'shirt') + }); + + let hamster = Hamster.create(); + + hamster.get('clothes'); // [null, null] + hamster.set('hat', 'Camp Hat'); + hamster.set('shirt', 'Camp Shirt'); + hamster.get('clothes'); // ['Camp Hat', 'Camp Shirt'] + ``` + + @method collect + @for Ember.computed + @param {String} dependentKey* + @return {Ember.ComputedProperty} computed property which maps + values of all passed in properties to an array. + @public + */ - BasicOpcodeBuilder.prototype.openComponentElement = function openComponentElement(tag) { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.OpenComponentElementOpcode(tag)); - }; + function collect() { + for (var _len3 = arguments.length, dependentKeys = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + dependentKeys[_key3] = arguments[_key3]; + } - BasicOpcodeBuilder.prototype.openDynamicPrimitiveElement = function openDynamicPrimitiveElement() { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.OpenDynamicPrimitiveElementOpcode()); - }; + return multiArrayMacro(dependentKeys, function () { + var properties = _emberMetal.getProperties(this, dependentKeys); + var res = _emberRuntimeSystemNative_array.A(); + for (var key in properties) { + if (properties.hasOwnProperty(key)) { + if (_emberMetal.isNone(properties[key])) { + res.push(null); + } else { + res.push(properties[key]); + } + } + } + return res; + }); + } - BasicOpcodeBuilder.prototype.flushElement = function flushElement() { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.FlushElementOpcode()); - }; + /** + A computed property which returns a new array with all the + properties from the first dependent array sorted based on a property + or sort function. + + The callback method you provide should have the following signature: + + ```javascript + function(itemA, itemB); + ``` + + - `itemA` the first item to compare. + - `itemB` the second item to compare. + + This function should return negative number (e.g. `-1`) when `itemA` should come before + `itemB`. It should return positive number (e.g. `1`) when `itemA` should come after + `itemB`. If the `itemA` and `itemB` are equal this function should return `0`. + + Therefore, if this function is comparing some numeric values, simple `itemA - itemB` or + `itemA.get( 'foo' ) - itemB.get( 'foo' )` can be used instead of series of `if`. + + Example + + ```javascript + let ToDoList = Ember.Object.extend({ + // using standard ascending sort + todosSorting: ['name'], + sortedTodos: Ember.computed.sort('todos', 'todosSorting'), + + // using descending sort + todosSortingDesc: ['name:desc'], + sortedTodosDesc: Ember.computed.sort('todos', 'todosSortingDesc'), + + // using a custom sort function + priorityTodos: Ember.computed.sort('todos', function(a, b){ + if (a.priority > b.priority) { + return 1; + } else if (a.priority < b.priority) { + return -1; + } + + return 0; + }) + }); + + let todoList = ToDoList.create({todos: [ + { name: 'Unit Test', priority: 2 }, + { name: 'Documentation', priority: 3 }, + { name: 'Release', priority: 1 } + ]}); + + todoList.get('sortedTodos'); // [{ name:'Documentation', priority:3 }, { name:'Release', priority:1 }, { name:'Unit Test', priority:2 }] + todoList.get('sortedTodosDesc'); // [{ name:'Unit Test', priority:2 }, { name:'Release', priority:1 }, { name:'Documentation', priority:3 }] + todoList.get('priorityTodos'); // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }] + ``` + + @method sort + @for Ember.computed + @param {String} itemsKey + @param {String or Function} sortDefinition a dependent key to an + array of sort properties (add `:desc` to the arrays sort properties to sort descending) or a function to use when sorting + @return {Ember.ComputedProperty} computes a new sorted array based + on the sort property array or callback function + @public + */ - BasicOpcodeBuilder.prototype.closeElement = function closeElement() { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.CloseElementOpcode()); - }; + function sort(itemsKey, sortDefinition) { + _emberMetal.assert('Ember.computed.sort requires two arguments: an array key to sort and ' + 'either a sort properties key or sort function', arguments.length === 2); - BasicOpcodeBuilder.prototype.staticAttr = function staticAttr(name, namespace, value) { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.StaticAttrOpcode(name, namespace, value)); - }; + if (typeof sortDefinition === 'function') { + return customSort(itemsKey, sortDefinition); + } else { + return propertySort(itemsKey, sortDefinition); + } + } - BasicOpcodeBuilder.prototype.dynamicAttrNS = function dynamicAttrNS(name, namespace, isTrusting) { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.DynamicAttrNSOpcode(name, namespace, isTrusting)); - }; + function customSort(itemsKey, comparator) { + return arrayMacro(itemsKey, function (value) { + var _this4 = this; - BasicOpcodeBuilder.prototype.dynamicAttr = function dynamicAttr(name, isTrusting) { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.DynamicAttrOpcode(name, isTrusting)); - }; + return value.slice().sort(function (x, y) { + return comparator.call(_this4, x, y); + }); + }); + } - BasicOpcodeBuilder.prototype.comment = function comment(_comment) { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.CommentOpcode(_comment)); - }; + // This one needs to dynamically set up and tear down observers on the itemsKey + // depending on the sortProperties + function propertySort(itemsKey, sortPropertiesKey) { + var cp = new _emberMetal.ComputedProperty(function (key) { + var _this5 = this; - // lists + var itemsKeyIsAtThis = itemsKey === '@this'; + var sortProperties = _emberMetal.get(this, sortPropertiesKey); - BasicOpcodeBuilder.prototype.putIterator = function putIterator() { - this.append(new _glimmerRuntimeLibCompiledOpcodesLists.PutIteratorOpcode()); - }; + _emberMetal.assert('The sort definition for \'' + key + '\' on ' + this + ' must be a function or an array of strings', _emberRuntimeUtils.isArray(sortProperties) && sortProperties.every(function (s) { + return typeof s === 'string'; + })); - BasicOpcodeBuilder.prototype.enterList = function enterList(start, end) { - this.append(new _glimmerRuntimeLibCompiledOpcodesLists.EnterListOpcode(this.labelFor(start), this.labelFor(end))); - }; + var normalizedSortProperties = normalizeSortProperties(sortProperties); - BasicOpcodeBuilder.prototype.exitList = function exitList() { - this.append(new _glimmerRuntimeLibCompiledOpcodesLists.ExitListOpcode()); - }; + // Add/remove property observers as required. + var activeObserversMap = cp._activeObserverMap || (cp._activeObserverMap = new _emberMetal.WeakMap()); + var activeObservers = activeObserversMap.get(this); - BasicOpcodeBuilder.prototype.enterWithKey = function enterWithKey(start, end) { - this.append(new _glimmerRuntimeLibCompiledOpcodesLists.EnterWithKeyOpcode(this.labelFor(start), this.labelFor(end))); - }; + if (activeObservers) { + activeObservers.forEach(function (args) { + return _emberMetal.removeObserver.apply(undefined, args); + }); + } - BasicOpcodeBuilder.prototype.nextIter = function nextIter(end) { - this.append(new _glimmerRuntimeLibCompiledOpcodesLists.NextIterOpcode(this.labelFor(end))); - }; + function sortPropertyDidChange() { + this.notifyPropertyChange(key); + } - // vm + activeObservers = normalizedSortProperties.map(function (_ref) { + var prop = _ref[0]; - BasicOpcodeBuilder.prototype.pushRemoteElement = function pushRemoteElement() { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.PushRemoteElementOpcode()); - }; + var path = itemsKeyIsAtThis ? '@each.' + prop : itemsKey + '.@each.' + prop; + var args = [_this5, path, sortPropertyDidChange]; + _emberMetal.addObserver.apply(undefined, args); + return args; + }); - BasicOpcodeBuilder.prototype.popRemoteElement = function popRemoteElement() { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.PopRemoteElementOpcode()); - }; + activeObserversMap.set(this, activeObservers); - BasicOpcodeBuilder.prototype.popElement = function popElement() { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.PopElementOpcode()); - }; + // Sort and return the array. + var items = itemsKeyIsAtThis ? this : _emberMetal.get(this, itemsKey); - BasicOpcodeBuilder.prototype.label = function label(name) { - this.append(this.labelFor(name)); - }; + if (_emberRuntimeUtils.isArray(items)) { + return sortByNormalizedSortProperties(items, normalizedSortProperties); + } else { + return _emberRuntimeSystemNative_array.A(); + } + }); - BasicOpcodeBuilder.prototype.pushChildScope = function pushChildScope() { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PushChildScopeOpcode()); - }; + cp._activeObserverMap = undefined; - BasicOpcodeBuilder.prototype.popScope = function popScope() { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PopScopeOpcode()); - }; + return cp.property(sortPropertiesKey + '.[]').readOnly(); + } - BasicOpcodeBuilder.prototype.pushDynamicScope = function pushDynamicScope() { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PushDynamicScopeOpcode()); - }; + function normalizeSortProperties(sortProperties) { + return sortProperties.map(function (p) { + var _p$split = p.split(':'); - BasicOpcodeBuilder.prototype.popDynamicScope = function popDynamicScope() { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PopDynamicScopeOpcode()); - }; + var prop = _p$split[0]; + var direction = _p$split[1]; - BasicOpcodeBuilder.prototype.putNull = function putNull() { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PutNullOpcode()); - }; + direction = direction || 'asc'; - BasicOpcodeBuilder.prototype.putValue = function putValue(expression) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PutValueOpcode(this.compile(expression))); - }; + return [prop, direction]; + }); + } - BasicOpcodeBuilder.prototype.putArgs = function putArgs(args) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PutArgsOpcode(this.compile(args))); - }; + function sortByNormalizedSortProperties(items, normalizedSortProperties) { + return _emberRuntimeSystemNative_array.A(items.slice().sort(function (itemA, itemB) { + for (var i = 0; i < normalizedSortProperties.length; i++) { + var _normalizedSortProperties$i = normalizedSortProperties[i]; + var prop = _normalizedSortProperties$i[0]; + var direction = _normalizedSortProperties$i[1]; - BasicOpcodeBuilder.prototype.bindDynamicScope = function bindDynamicScope(names) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.BindDynamicScopeOpcode(names)); - }; + var result = _emberRuntimeCompare.default(_emberMetal.get(itemA, prop), _emberMetal.get(itemB, prop)); + if (result !== 0) { + return direction === 'desc' ? -1 * result : result; + } + } - BasicOpcodeBuilder.prototype.bindPositionalArgs = function bindPositionalArgs(names, symbols) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.BindPositionalArgsOpcode(names, symbols)); - }; + return 0; + })); + } +}); +enifed('ember-runtime/controllers/controller', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/mixins/controller', 'ember-runtime/inject', 'ember-runtime/mixins/action_handler'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeMixinsController, _emberRuntimeInject, _emberRuntimeMixinsAction_handler) { + 'use strict'; - BasicOpcodeBuilder.prototype.bindNamedArgs = function bindNamedArgs(names, symbols) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.BindNamedArgsOpcode(names, symbols)); - }; + /** + @module ember + @submodule ember-runtime + */ - BasicOpcodeBuilder.prototype.bindBlocks = function bindBlocks(names, symbols) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.BindBlocksOpcode(names, symbols)); - }; + /** + @class Controller + @namespace Ember + @extends Ember.Object + @uses Ember.ControllerMixin + @public + */ + var Controller = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsController.default); - BasicOpcodeBuilder.prototype.enter = function enter(_enter, exit) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.EnterOpcode(this.labelFor(_enter), this.labelFor(exit))); - }; + _emberRuntimeMixinsAction_handler.deprecateUnderscoreActions(Controller); - BasicOpcodeBuilder.prototype.exit = function exit() { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.ExitOpcode()); - }; + function controllerInjectionHelper(factory) { + _emberMetal.assert('Defining an injected controller property on a ' + 'non-controller is not allowed.', _emberRuntimeMixinsController.default.detect(factory.PrototypeMixin)); + } - BasicOpcodeBuilder.prototype.evaluate = function evaluate(name, block) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.EvaluateOpcode(name, block)); - }; + /** + Creates a property that lazily looks up another controller in the container. + Can only be used when defining another controller. + + Example: + + ```javascript + App.PostController = Ember.Controller.extend({ + posts: Ember.inject.controller() + }); + ``` + + This example will create a `posts` property on the `post` controller that + looks up the `posts` controller in the container, making it easy to + reference other controllers. This is functionally equivalent to: + + ```javascript + App.PostController = Ember.Controller.extend({ + needs: 'posts', + posts: Ember.computed.alias('controllers.posts') + }); + ``` + + @method controller + @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 + @public + */ + _emberRuntimeInject.createInjectionHelper('controller', controllerInjectionHelper); - BasicOpcodeBuilder.prototype.test = function test(testFunc) { - if (testFunc === 'const') { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.TestOpcode(_glimmerRuntimeLibCompiledOpcodesVm.ConstTest)); - } else if (testFunc === 'simple') { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.TestOpcode(_glimmerRuntimeLibCompiledOpcodesVm.SimpleTest)); - } else if (testFunc === 'environment') { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.TestOpcode(_glimmerRuntimeLibCompiledOpcodesVm.EnvironmentTest)); - } else if (typeof testFunc === 'function') { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.TestOpcode(testFunc)); - } else { - throw new Error('unreachable'); - } - }; + exports.default = Controller; +}); +enifed('ember-runtime/copy', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/mixins/copyable'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeMixinsCopyable) { + 'use strict'; - BasicOpcodeBuilder.prototype.jump = function jump(target) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.JumpOpcode(this.labelFor(target))); - }; + exports.default = copy; - BasicOpcodeBuilder.prototype.jumpIf = function jumpIf(target) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.JumpIfOpcode(this.labelFor(target))); - }; + function _copy(obj, deep, seen, copies) { + var ret = undefined, + loc = undefined, + key = undefined; - BasicOpcodeBuilder.prototype.jumpUnless = function jumpUnless(target) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.JumpUnlessOpcode(this.labelFor(target))); - }; + // primitive data types are immutable, just return them. + if (typeof obj !== 'object' || obj === null) { + return obj; + } - babelHelpers.createClass(BasicOpcodeBuilder, [{ - key: 'labels', - get: function () { - return this.labelsStack.current; - } - }]); - return BasicOpcodeBuilder; - })(StatementCompilationBufferProxy); + // avoid cyclical loops + if (deep && (loc = seen.indexOf(obj)) >= 0) { + return copies[loc]; + } - exports.BasicOpcodeBuilder = BasicOpcodeBuilder; + _emberMetal.assert('Cannot clone an Ember.Object that does not implement Ember.Copyable', !(obj instanceof _emberRuntimeSystemObject.default) || _emberRuntimeMixinsCopyable.default && _emberRuntimeMixinsCopyable.default.detect(obj)); - function isCompilableExpression(expr) { - return expr && typeof expr['compile'] === 'function'; - } + // IMPORTANT: this specific test will detect a native array only. Any other + // object will need to implement Copyable. + if (Array.isArray(obj)) { + ret = obj.slice(); - var OpcodeBuilder = (function (_BasicOpcodeBuilder) { - babelHelpers.inherits(OpcodeBuilder, _BasicOpcodeBuilder); + if (deep) { + loc = ret.length; - function OpcodeBuilder() { - _BasicOpcodeBuilder.apply(this, arguments); + while (--loc >= 0) { + ret[loc] = _copy(ret[loc], deep, seen, copies); } + } + } else if (_emberRuntimeMixinsCopyable.default && _emberRuntimeMixinsCopyable.default.detect(obj)) { + ret = obj.copy(deep, seen, copies); + } else if (obj instanceof Date) { + ret = new Date(obj.getTime()); + } else { + ret = {}; - OpcodeBuilder.prototype.compile = function compile(expr) { - if (isCompilableExpression(expr)) { - return expr.compile(this, this.env, this.symbolTable); - } else { - return expr; - } - }; + for (key in obj) { + // support Null prototype + if (!Object.prototype.hasOwnProperty.call(obj, key)) { + continue; + } - OpcodeBuilder.prototype.bindPositionalArgsForBlock = function bindPositionalArgsForBlock(block) { - this.append(_glimmerRuntimeLibCompiledOpcodesVm.BindPositionalArgsOpcode.create(block)); - }; + // Prevents browsers that don't respect non-enumerability from + // copying internal Ember properties + if (key.substring(0, 2) === '__') { + continue; + } - OpcodeBuilder.prototype.preludeForLayout = function preludeForLayout(layout) { - if (layout.hasNamedParameters) { - this.append(_glimmerRuntimeLibCompiledOpcodesVm.BindNamedArgsOpcode.create(layout)); - } - if (layout.hasYields || layout.hasPartials) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.BindCallerScopeOpcode()); - } - if (layout.hasYields) { - this.append(_glimmerRuntimeLibCompiledOpcodesVm.BindBlocksOpcode.create(layout)); - } - if (layout.hasPartials) { - this.append(_glimmerRuntimeLibCompiledOpcodesVm.BindPartialArgsOpcode.create(layout)); - } - }; + ret[key] = deep ? _copy(obj[key], deep, seen, copies) : obj[key]; + } + } - // TODO - // come back to this - - OpcodeBuilder.prototype.block = function block(args, callback) { - if (args) this.putArgs(args); - this.startLabels(); - this.enter('BEGIN', 'END'); - this.label('BEGIN'); - callback(this, 'BEGIN', 'END'); - this.label('END'); - this.exit(); - this.stopLabels(); - }; + if (deep) { + seen.push(obj); + copies.push(ret); + } - // TODO - // come back to this - - OpcodeBuilder.prototype.iter = function iter(callback) { - this.startLabels(); - this.enterList('BEGIN', 'END'); - this.label('ITER'); - this.nextIter('BREAK'); - this.enterWithKey('BEGIN', 'END'); - this.label('BEGIN'); - callback(this, 'BEGIN', 'END'); - this.label('END'); - this.exit(); - this.jump('ITER'); - this.label('BREAK'); - this.exitList(); - this.stopLabels(); - }; + return ret; + } - // TODO - // come back to this + /** + Creates a shallow copy of the passed object. A deep copy of the object is + returned if the optional `deep` argument is `true`. + + If the passed object implements the `Ember.Copyable` interface, then this + function will delegate to the object's `copy()` method and return the + result. See `Ember.Copyable` for further details. + + For primitive values (which are immutable in JavaScript), the passed object + is simply returned. + + @method copy + @for Ember + @param {Object} obj The object to clone + @param {Boolean} [deep=false] If true, a deep copy of the object is made. + @return {Object} The copied object + @public + */ - OpcodeBuilder.prototype.unit = function unit(callback) { - this.startLabels(); - callback(this); - this.stopLabels(); - }; + function copy(obj, deep) { + // fast paths + if ('object' !== typeof obj || obj === null) { + return obj; // can't copy primitives + } - return OpcodeBuilder; - })(BasicOpcodeBuilder); + if (_emberRuntimeMixinsCopyable.default && _emberRuntimeMixinsCopyable.default.detect(obj)) { + return obj.copy(deep); + } - exports.default = OpcodeBuilder; + return _copy(obj, deep, deep ? [] : null, deep ? [] : null); + } }); +enifed('ember-runtime/ext/function', ['exports', 'ember-environment', 'ember-metal'], function (exports, _emberEnvironment, _emberMetal) { + /** + @module ember + @submodule ember-runtime + */ -enifed('glimmer-runtime/lib/compiled/opcodes/component', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-reference'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerReference) { - 'use strict'; + 'use strict'; - var PutDynamicComponentDefinitionOpcode = (function (_Opcode) { - babelHelpers.inherits(PutDynamicComponentDefinitionOpcode, _Opcode); + var a_slice = Array.prototype.slice; + var FunctionPrototype = Function.prototype; - function PutDynamicComponentDefinitionOpcode() { - _Opcode.apply(this, arguments); - this.type = "put-dynamic-component-definition"; - } + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.Function) { + /** + The `property` extension of Javascript's Function prototype is available + when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is + `true`, which is the default. + Computed properties allow you to treat a function like a property: + ```javascript + MyApp.President = Ember.Object.extend({ + firstName: '', + lastName: '', + fullName: function() { + return this.get('firstName') + ' ' + this.get('lastName'); + }.property() // Call this flag to mark the function as a property + }); + let president = MyApp.President.create({ + firstName: 'Barack', + lastName: 'Obama' + }); + president.get('fullName'); // 'Barack Obama' + ``` + Treating a function like a property is useful because they can work with + bindings, just like any other property. + Many computed properties have dependencies on other properties. For + example, in the above example, the `fullName` property depends on + `firstName` and `lastName` to determine its value. You can tell Ember + about these dependencies like this: + ```javascript + MyApp.President = Ember.Object.extend({ + firstName: '', + lastName: '', + fullName: function() { + return this.get('firstName') + ' ' + this.get('lastName'); + // Tell Ember.js that this computed property depends on firstName + // and lastName + }.property('firstName', 'lastName') + }); + ``` + 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/classes/Ember.computed.html). + @method property + @for Function + @public + */ + FunctionPrototype.property = function () { + var ret = _emberMetal.computed(this); + // ComputedProperty.prototype.property expands properties; no need for us to + // do so here. + return ret.property.apply(ret, arguments); + }; - PutDynamicComponentDefinitionOpcode.prototype.evaluate = function evaluate(vm) { - var reference = vm.frame.getOperand(); - var cache = _glimmerReference.isConst(reference) ? undefined : new _glimmerReference.ReferenceCache(reference); - var definition = cache ? cache.peek() : reference.value(); - vm.frame.setImmediate(definition); - if (cache) { - vm.updateWith(new _glimmerRuntimeLibCompiledOpcodesVm.Assert(cache)); - } - }; + /** + The `observes` extension of Javascript's Function prototype is available + when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is + true, which is the default. + You can observe property changes simply by adding the `observes` + call to the end of your method declarations in classes that you write. + For example: + ```javascript + Ember.Object.extend({ + valueObserver: function() { + // Executes whenever the "value" property changes + }.observes('value') + }); + ``` + In the future this method may become asynchronous. + See `Ember.observer`. + @method observes + @for Function + @public + */ + FunctionPrototype.observes = function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - PutDynamicComponentDefinitionOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$OPERAND"] - }; - }; + args.push(this); + return _emberMetal.observer.apply(this, args); + }; + + FunctionPrototype._observesImmediately = function () { + _emberMetal.assert('Immediate observers must observe internal properties only, ' + 'not properties on other objects.', function checkIsInternalProperty() { + for (var i = 0; i < arguments.length; i++) { + if (arguments[i].indexOf('.') !== -1) { + return false; + } + } + return true; + }); - return PutDynamicComponentDefinitionOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + // observes handles property expansion + return this.observes.apply(this, arguments); + }; + /** + The `observesImmediately` extension of Javascript's Function prototype is + available when `EmberENV.EXTEND_PROTOTYPES` or + `EmberENV.EXTEND_PROTOTYPES.Function` is true, which is the default. + You can observe property changes simply by adding the `observesImmediately` + call to the end of your method declarations in classes that you write. + For example: + ```javascript + Ember.Object.extend({ + valueObserver: function() { + // Executes immediately after the "value" property changes + }.observesImmediately('value') + }); + ``` + In the future, `observes` may become asynchronous. In this event, + `observesImmediately` will maintain the synchronous behavior. + See `Ember.immediateObserver`. + @method observesImmediately + @for Function + @deprecated + @private + */ + FunctionPrototype.observesImmediately = _emberMetal.deprecateFunc('Function#observesImmediately is deprecated. Use Function#observes instead', { id: 'ember-runtime.ext-function', until: '3.0.0' }, FunctionPrototype._observesImmediately); - exports.PutDynamicComponentDefinitionOpcode = PutDynamicComponentDefinitionOpcode; + /** + The `on` extension of Javascript's Function prototype is available + when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is + true, which is the default. + You can listen for events simply by adding the `on` call to the end of + your method declarations in classes or mixins that you write. For example: + ```javascript + Ember.Mixin.create({ + doSomethingWithElement: function() { + // Executes whenever the "didInsertElement" event fires + }.on('didInsertElement') + }); + ``` + See `Ember.on`. + @method on + @for Function + @public + */ + FunctionPrototype.on = function () { + var events = a_slice.call(arguments); + this.__ember_listens__ = events; - var PutComponentDefinitionOpcode = (function (_Opcode2) { - babelHelpers.inherits(PutComponentDefinitionOpcode, _Opcode2); + return this; + }; + } +}); +enifed('ember-runtime/ext/rsvp', ['exports', 'rsvp', 'ember-metal'], function (exports, _rsvp, _emberMetal) { + 'use strict'; - function PutComponentDefinitionOpcode(definition) { - _Opcode2.call(this); - this.definition = definition; - this.type = "put-component-definition"; - } + exports.onerrorDefault = onerrorDefault; - PutComponentDefinitionOpcode.prototype.evaluate = function evaluate(vm) { - vm.frame.setImmediate(this.definition); - }; + var backburner = _emberMetal.run.backburner; + _emberMetal.run._addQueue('rsvpAfter', 'destroy'); - PutComponentDefinitionOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.definition.name)] - }; - }; + _rsvp.configure('async', function (callback, promise) { + backburner.schedule('actions', null, callback, promise); + }); - return PutComponentDefinitionOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); - - exports.PutComponentDefinitionOpcode = PutComponentDefinitionOpcode; - - var OpenComponentOpcode = (function (_Opcode3) { - babelHelpers.inherits(OpenComponentOpcode, _Opcode3); - - function OpenComponentOpcode(args, shadow) { - _Opcode3.call(this); - this.args = args; - this.shadow = shadow; - this.type = "open-component"; - } - - OpenComponentOpcode.prototype.evaluate = function evaluate(vm) { - var rawArgs = this.args; - var shadow = this.shadow; - - var definition = vm.frame.getImmediate(); - var dynamicScope = vm.pushDynamicScope(); - var callerScope = vm.scope(); - var manager = definition.manager; - var args = manager.prepareArgs(definition, rawArgs.evaluate(vm), dynamicScope); - var hasDefaultBlock = !!args.blocks.default; // TODO Cleanup? - var component = manager.create(vm.env, definition, args, dynamicScope, vm.getSelf(), hasDefaultBlock); - var destructor = manager.getDestructor(component); - if (destructor) vm.newDestroyable(destructor); - var layout = manager.layoutFor(definition, component, vm.env); - var selfRef = manager.getSelf(component); - vm.beginCacheGroup(); - vm.stack().pushSimpleBlock(); - vm.pushRootScope(selfRef, layout.symbols); - vm.invokeLayout(args, layout, callerScope, component, manager, shadow); - vm.updateWith(new UpdateComponentOpcode(definition.name, component, manager, args, dynamicScope)); - }; + _rsvp.configure('after', function (cb) { + backburner.schedule('rsvpAfter', null, cb); + }); - OpenComponentOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$OPERAND"] - }; - }; + _rsvp.on('error', onerrorDefault); - return OpenComponentOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); - - exports.OpenComponentOpcode = OpenComponentOpcode; - - var UpdateComponentOpcode = (function (_UpdatingOpcode) { - babelHelpers.inherits(UpdateComponentOpcode, _UpdatingOpcode); - - function UpdateComponentOpcode(name, component, manager, args, dynamicScope) { - _UpdatingOpcode.call(this); - this.name = name; - this.component = component; - this.manager = manager; - this.args = args; - this.dynamicScope = dynamicScope; - this.type = "update-component"; - var componentTag = manager.getTag(component); - if (componentTag) { - this.tag = _glimmerReference.combine([args.tag, componentTag]); - } else { - this.tag = args.tag; - } - } + function onerrorDefault(reason) { + var error = errorFor(reason); + if (error) { + _emberMetal.dispatchError(error); + } + } - UpdateComponentOpcode.prototype.evaluate = function evaluate(vm) { - var component = this.component; - var manager = this.manager; - var args = this.args; - var dynamicScope = this.dynamicScope; + function errorFor(reason) { + if (!reason) return; - manager.update(component, args, dynamicScope); - }; + if (reason.errorThrown) { + return unwrapErrorThrown(reason); + } - UpdateComponentOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.name)] - }; - }; + if (reason.name === 'UnrecognizedURLError') { + _emberMetal.assert('The URL \'' + reason.message + '\' did not match any routes in your application', false); + return; + } - return UpdateComponentOpcode; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + if (reason.name === 'TransitionAborted') { + return; + } - exports.UpdateComponentOpcode = UpdateComponentOpcode; + return reason; + } - var DidCreateElementOpcode = (function (_Opcode4) { - babelHelpers.inherits(DidCreateElementOpcode, _Opcode4); + function unwrapErrorThrown(reason) { + var error = reason.errorThrown; + if (typeof error === 'string') { + error = new Error(error); + } + Object.defineProperty(error, '__reason_with_error_thrown__', { + value: reason, + enumerable: false + }); + return error; + } - function DidCreateElementOpcode() { - _Opcode4.apply(this, arguments); - this.type = "did-create-element"; - } + exports.default = _rsvp; +}); +enifed('ember-runtime/ext/string', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { + /** + @module ember + @submodule ember-runtime + */ - // Slow path for non-specialized component invocations. Uses an internal - // named lookup on the args. + 'use strict'; - DidCreateElementOpcode.prototype.evaluate = function evaluate(vm) { - var manager = vm.frame.getManager(); - var component = vm.frame.getComponent(); - manager.didCreateElement(component, vm.stack().constructing, vm.stack().operations); - }; + var StringPrototype = String.prototype; - DidCreateElementOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$ARGS"] - }; - }; + if (_emberEnvironment.ENV.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]; + } - return DidCreateElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return _emberRuntimeSystemString.fmt(this, args); + }; - exports.DidCreateElementOpcode = DidCreateElementOpcode; + /** + See [Ember.String.w](/api/classes/Ember.String.html#method_w). + @method w + @for String + @private + */ + StringPrototype.w = function () { + return _emberRuntimeSystemString.w(this); + }; - var ShadowAttributesOpcode = (function (_Opcode5) { - babelHelpers.inherits(ShadowAttributesOpcode, _Opcode5); + /** + See [Ember.String.loc](/api/classes/Ember.String.html#method_loc). + @method loc + @for String + @private + */ + StringPrototype.loc = function () { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - function ShadowAttributesOpcode() { - _Opcode5.apply(this, arguments); - this.type = "shadow-attributes"; - } + return _emberRuntimeSystemString.loc(this, args); + }; - ShadowAttributesOpcode.prototype.evaluate = function evaluate(vm) { - var shadow = vm.frame.getShadow(); - if (!shadow) return; + /** + See [Ember.String.camelize](/api/classes/Ember.String.html#method_camelize). + @method camelize + @for String + @private + */ + StringPrototype.camelize = function () { + return _emberRuntimeSystemString.camelize(this); + }; - var _vm$frame$getArgs = vm.frame.getArgs(); + /** + See [Ember.String.decamelize](/api/classes/Ember.String.html#method_decamelize). + @method decamelize + @for String + @private + */ + StringPrototype.decamelize = function () { + return _emberRuntimeSystemString.decamelize(this); + }; - var named = _vm$frame$getArgs.named; + /** + See [Ember.String.dasherize](/api/classes/Ember.String.html#method_dasherize). + @method dasherize + @for String + @private + */ + StringPrototype.dasherize = function () { + return _emberRuntimeSystemString.dasherize(this); + }; - shadow.forEach(function (name) { - vm.stack().setDynamicAttribute(name, named.get(name), false); - }); - }; + /** + See [Ember.String.underscore](/api/classes/Ember.String.html#method_underscore). + @method underscore + @for String + @private + */ + StringPrototype.underscore = function () { + return _emberRuntimeSystemString.underscore(this); + }; - ShadowAttributesOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$ARGS"] - }; - }; + /** + See [Ember.String.classify](/api/classes/Ember.String.html#method_classify). + @method classify + @for String + @private + */ + StringPrototype.classify = function () { + return _emberRuntimeSystemString.classify(this); + }; - return ShadowAttributesOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + See [Ember.String.capitalize](/api/classes/Ember.String.html#method_capitalize). + @method capitalize + @for String + @private + */ + StringPrototype.capitalize = function () { + return _emberRuntimeSystemString.capitalize(this); + }; + } +}); +enifed('ember-runtime/index', ['exports', 'ember-runtime/ext/string', 'ember-runtime/ext/function', 'ember-runtime/system/object', 'ember-runtime/system/string', 'ember-runtime/mixins/registry_proxy', 'ember-runtime/mixins/container_proxy', 'ember-runtime/copy', 'ember-runtime/inject', 'ember-runtime/compare', 'ember-runtime/is-equal', 'ember-runtime/mixins/array', 'ember-runtime/mixins/comparable', 'ember-runtime/system/namespace', 'ember-runtime/system/array_proxy', 'ember-runtime/system/object_proxy', 'ember-runtime/system/core_object', 'ember-runtime/system/native_array', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/copyable', 'ember-runtime/mixins/enumerable', 'ember-runtime/mixins/freezable', 'ember-runtime/mixins/-proxy', 'ember-runtime/system/lazy_load', 'ember-runtime/mixins/observable', '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/computed_macros', 'ember-runtime/computed/reduce_computed_macros', 'ember-runtime/controllers/controller', 'ember-runtime/mixins/controller', 'ember-runtime/system/service', 'ember-runtime/ext/rsvp', 'ember-runtime/utils', 'ember-runtime/string_registry'], function (exports, _emberRuntimeExtString, _emberRuntimeExtFunction, _emberRuntimeSystemObject, _emberRuntimeSystemString, _emberRuntimeMixinsRegistry_proxy, _emberRuntimeMixinsContainer_proxy, _emberRuntimeCopy, _emberRuntimeInject, _emberRuntimeCompare, _emberRuntimeIsEqual, _emberRuntimeMixinsArray, _emberRuntimeMixinsComparable, _emberRuntimeSystemNamespace, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemObject_proxy, _emberRuntimeSystemCore_object, _emberRuntimeSystemNative_array, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsFreezable, _emberRuntimeMixinsProxy, _emberRuntimeSystemLazy_load, _emberRuntimeMixinsObservable, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsTarget_action_support, _emberRuntimeMixinsEvented, _emberRuntimeMixinsPromise_proxy, _emberRuntimeComputedComputed_macros, _emberRuntimeComputedReduce_computed_macros, _emberRuntimeControllersController, _emberRuntimeMixinsController, _emberRuntimeSystemService, _emberRuntimeExtRsvp, _emberRuntimeUtils, _emberRuntimeString_registry) { + /** + @module ember + @submodule ember-runtime + */ - exports.ShadowAttributesOpcode = ShadowAttributesOpcode; + 'use strict'; - var DidRenderLayoutOpcode = (function (_Opcode6) { - babelHelpers.inherits(DidRenderLayoutOpcode, _Opcode6); + exports.Object = _emberRuntimeSystemObject.default; + exports.FrameworkObject = _emberRuntimeSystemObject.FrameworkObject; + exports.String = _emberRuntimeSystemString.default; + exports.RegistryProxyMixin = _emberRuntimeMixinsRegistry_proxy.default; + exports.buildFakeRegistryWithDeprecations = _emberRuntimeMixinsRegistry_proxy.buildFakeRegistryWithDeprecations; + exports.ContainerProxyMixin = _emberRuntimeMixinsContainer_proxy.default; + exports.copy = _emberRuntimeCopy.default; + exports.inject = _emberRuntimeInject.default; + exports.compare = _emberRuntimeCompare.default; + exports.isEqual = _emberRuntimeIsEqual.default; + exports.Array = _emberRuntimeMixinsArray.default; + exports.objectAt = _emberRuntimeMixinsArray.objectAt; + exports.isEmberArray = _emberRuntimeMixinsArray.isEmberArray; + exports.addArrayObserver = _emberRuntimeMixinsArray.addArrayObserver; + exports.removeArrayObserver = _emberRuntimeMixinsArray.removeArrayObserver; + exports.Comparable = _emberRuntimeMixinsComparable.default; + exports.Namespace = _emberRuntimeSystemNamespace.default; + exports.isNamespaceSearchDisabled = _emberRuntimeSystemNamespace.isSearchDisabled; + exports.setNamespaceSearchDisabled = _emberRuntimeSystemNamespace.setSearchDisabled; + exports.ArrayProxy = _emberRuntimeSystemArray_proxy.default; + exports.ObjectProxy = _emberRuntimeSystemObject_proxy.default; + exports.CoreObject = _emberRuntimeSystemCore_object.default; + exports.NativeArray = _emberRuntimeSystemNative_array.default; + exports.A = _emberRuntimeSystemNative_array.A; + exports.ActionHandler = _emberRuntimeMixinsAction_handler.default; + exports.deprecateUnderscoreActions = _emberRuntimeMixinsAction_handler.deprecateUnderscoreActions; + exports.Copyable = _emberRuntimeMixinsCopyable.default; + exports.Enumerable = _emberRuntimeMixinsEnumerable.default; + exports.Freezable = _emberRuntimeMixinsFreezable.Freezable; + exports.FROZEN_ERROR = _emberRuntimeMixinsFreezable.FROZEN_ERROR; + exports._ProxyMixin = _emberRuntimeMixinsProxy.default; + exports.onLoad = _emberRuntimeSystemLazy_load.onLoad; + exports.runLoadHooks = _emberRuntimeSystemLazy_load.runLoadHooks; + exports._loaded = _emberRuntimeSystemLazy_load._loaded; + exports.Observable = _emberRuntimeMixinsObservable.default; + exports.MutableEnumerable = _emberRuntimeMixinsMutable_enumerable.default; + exports.MutableArray = _emberRuntimeMixinsMutable_array.default; + exports.removeAt = _emberRuntimeMixinsMutable_array.removeAt; + exports.TargetActionSupport = _emberRuntimeMixinsTarget_action_support.default; + exports.Evented = _emberRuntimeMixinsEvented.default; + exports.PromiseProxyMixin = _emberRuntimeMixinsPromise_proxy.default; + exports.empty = _emberRuntimeComputedComputed_macros.empty; + exports.notEmpty = _emberRuntimeComputedComputed_macros.notEmpty; + exports.none = _emberRuntimeComputedComputed_macros.none; + exports.not = _emberRuntimeComputedComputed_macros.not; + exports.bool = _emberRuntimeComputedComputed_macros.bool; + exports.match = _emberRuntimeComputedComputed_macros.match; + exports.equal = _emberRuntimeComputedComputed_macros.equal; + exports.gt = _emberRuntimeComputedComputed_macros.gt; + exports.gte = _emberRuntimeComputedComputed_macros.gte; + exports.lt = _emberRuntimeComputedComputed_macros.lt; + exports.lte = _emberRuntimeComputedComputed_macros.lte; + exports.oneWay = _emberRuntimeComputedComputed_macros.oneWay; + exports.readOnly = _emberRuntimeComputedComputed_macros.readOnly; + exports.deprecatingAlias = _emberRuntimeComputedComputed_macros.deprecatingAlias; + exports.and = _emberRuntimeComputedComputed_macros.and; + exports.or = _emberRuntimeComputedComputed_macros.or; + exports.sum = _emberRuntimeComputedReduce_computed_macros.sum; + exports.min = _emberRuntimeComputedReduce_computed_macros.min; + exports.max = _emberRuntimeComputedReduce_computed_macros.max; + exports.map = _emberRuntimeComputedReduce_computed_macros.map; + exports.sort = _emberRuntimeComputedReduce_computed_macros.sort; + exports.setDiff = _emberRuntimeComputedReduce_computed_macros.setDiff; + exports.mapBy = _emberRuntimeComputedReduce_computed_macros.mapBy; + exports.filter = _emberRuntimeComputedReduce_computed_macros.filter; + exports.filterBy = _emberRuntimeComputedReduce_computed_macros.filterBy; + exports.uniq = _emberRuntimeComputedReduce_computed_macros.uniq; + exports.uniqBy = _emberRuntimeComputedReduce_computed_macros.uniqBy; + exports.union = _emberRuntimeComputedReduce_computed_macros.union; + exports.intersect = _emberRuntimeComputedReduce_computed_macros.intersect; + exports.collect = _emberRuntimeComputedReduce_computed_macros.collect; + exports.Controller = _emberRuntimeControllersController.default; + exports.ControllerMixin = _emberRuntimeMixinsController.default; + exports.Service = _emberRuntimeSystemService.default; + exports.RSVP = _emberRuntimeExtRsvp.default; + exports.onerrorDefault = _emberRuntimeExtRsvp.onerrorDefault; + // just for side effect of extending Ember.RSVP + exports.isArray = _emberRuntimeUtils.isArray; + exports.typeOf = _emberRuntimeUtils.typeOf; + exports.getStrings = _emberRuntimeString_registry.getStrings; + exports.setStrings = _emberRuntimeString_registry.setStrings; +}); +// just for side effect of extending String.prototype +// just for side effect of extending Function.prototype +enifed('ember-runtime/inject', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - function DidRenderLayoutOpcode() { - _Opcode6.apply(this, arguments); - this.type = "did-render-layout"; - } + exports.default = inject; + exports.createInjectionHelper = createInjectionHelper; + exports.validatePropertyInjections = validatePropertyInjections; - DidRenderLayoutOpcode.prototype.evaluate = function evaluate(vm) { - var manager = vm.frame.getManager(); - var component = vm.frame.getComponent(); - var bounds = vm.stack().popBlock(); - manager.didRenderLayout(component, bounds); - vm.env.didCreate(component, manager); - vm.updateWith(new DidUpdateLayoutOpcode(manager, component, bounds)); - }; + /** + Namespace for injection helper methods. + + @class inject + @namespace Ember + @static + @public + */ - return DidRenderLayoutOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + function inject() { + _emberMetal.assert('Injected properties must be created through helpers, see \'' + Object.keys(inject).join('"', '"') + '\''); + } - exports.DidRenderLayoutOpcode = DidRenderLayoutOpcode; + // Dictionary of injection validations by type, added to by `createInjectionHelper` + var typeValidators = {}; - var DidUpdateLayoutOpcode = (function (_UpdatingOpcode2) { - babelHelpers.inherits(DidUpdateLayoutOpcode, _UpdatingOpcode2); + /** + This method allows other Ember modules to register injection helpers for a + given container type. Helpers are exported to the `inject` namespace as the + container type itself. + + @private + @method createInjectionHelper + @since 1.10.0 + @for Ember + @param {String} type The container type the helper will inject + @param {Function} validator A validation callback that is executed at mixin-time + */ - function DidUpdateLayoutOpcode(manager, component, bounds) { - _UpdatingOpcode2.call(this); - this.manager = manager; - this.component = component; - this.bounds = bounds; - this.type = "did-update-layout"; - this.tag = _glimmerReference.CONSTANT_TAG; - } + function createInjectionHelper(type, validator) { + typeValidators[type] = validator; - DidUpdateLayoutOpcode.prototype.evaluate = function evaluate(vm) { - var manager = this.manager; - var component = this.component; - var bounds = this.bounds; + inject[type] = function (name) { + return new _emberMetal.InjectedProperty(type, name); + }; + } - manager.didUpdateLayout(component, bounds); - vm.env.didUpdate(component, manager); - }; + /** + Validation function that runs per-type validation functions once for each + injected type encountered. + + @private + @method validatePropertyInjections + @since 1.10.0 + @for Ember + @param {Object} factory The factory object + */ - return DidUpdateLayoutOpcode; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + function validatePropertyInjections(factory) { + var proto = factory.proto(); + var types = []; - exports.DidUpdateLayoutOpcode = DidUpdateLayoutOpcode; + for (var key in proto) { + var desc = proto[key]; + if (desc instanceof _emberMetal.InjectedProperty && types.indexOf(desc.type) === -1) { + types.push(desc.type); + } + } - var CloseComponentOpcode = (function (_Opcode7) { - babelHelpers.inherits(CloseComponentOpcode, _Opcode7); + if (types.length) { + for (var i = 0; i < types.length; i++) { + var validator = typeValidators[types[i]]; - function CloseComponentOpcode() { - _Opcode7.apply(this, arguments); - this.type = "close-component"; + if (typeof validator === 'function') { + validator(factory); } + } + } - CloseComponentOpcode.prototype.evaluate = function evaluate(vm) { - vm.popScope(); - vm.popDynamicScope(); - vm.commitCacheGroup(); - }; - - return CloseComponentOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); - - exports.CloseComponentOpcode = CloseComponentOpcode; + return true; + } }); +enifed('ember-runtime/is-equal', ['exports'], function (exports) { + /** + Compares two objects, returning true if they are equal. + + ```javascript + Ember.isEqual('hello', 'hello'); // true + Ember.isEqual(1, 2); // false + ``` + + `isEqual` is a more specific comparison than a triple equal comparison. + It will call the `isEqual` instance method on the objects being + compared, allowing finer control over when objects should be considered + equal to each other. + + ```javascript + let Person = Ember.Object.extend({ + isEqual(other) { return this.ssn == other.ssn; } + }); + + let personA = Person.create({name: 'Muhammad Ali', ssn: '123-45-6789'}); + let personB = Person.create({name: 'Cassius Clay', ssn: '123-45-6789'}); + + Ember.isEqual(personA, personB); // true + ``` + + Due to the expense of array comparisons, collections will never be equal to + each other even if each of their items are equal to each other. + + ```javascript + Ember.isEqual([4, 2], [4, 2]); // false + ``` + + @method isEqual + @for Ember + @param {Object} a first object to compare + @param {Object} b second object to compare + @return {Boolean} + @public + */ + 'use strict'; -enifed('glimmer-runtime/lib/compiled/opcodes/content', ['exports', 'glimmer-runtime/lib/upsert', 'glimmer-runtime/lib/component/interfaces', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/vm/update', 'glimmer-reference', 'glimmer-util', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/builder', 'glimmer-runtime/lib/compiler', 'glimmer-runtime/lib/compiled/opcodes/builder', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/syntax/core'], function (exports, _glimmerRuntimeLibUpsert, _glimmerRuntimeLibComponentInterfaces, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibVmUpdate, _glimmerReference, _glimmerUtil, _glimmerRuntimeLibBounds, _glimmerRuntimeLibBuilder, _glimmerRuntimeLibCompiler, _glimmerRuntimeLibCompiledOpcodesBuilder, _glimmerRuntimeLibReferences, _glimmerRuntimeLibSyntaxCore) { - 'use strict'; - - exports.normalizeTextValue = normalizeTextValue; - - function isEmpty(value) { - return value === null || value === undefined || typeof value['toString'] !== 'function'; - } + exports.default = isEqual; - function normalizeTextValue(value) { - if (isEmpty(value)) { - return ''; - } - return String(value); + function isEqual(a, b) { + if (a && typeof a.isEqual === 'function') { + return a.isEqual(b); } - function normalizeTrustedValue(value) { - if (isEmpty(value)) { - return ''; - } - if (_glimmerRuntimeLibUpsert.isString(value)) { - return value; - } - if (_glimmerRuntimeLibUpsert.isSafeString(value)) { - return value.toHTML(); - } - if (_glimmerRuntimeLibUpsert.isNode(value)) { - return value; - } - return String(value); - } - function normalizeValue(value) { - if (isEmpty(value)) { - return ''; - } - if (_glimmerRuntimeLibUpsert.isString(value)) { - return value; - } - if (_glimmerRuntimeLibUpsert.isSafeString(value) || _glimmerRuntimeLibUpsert.isNode(value)) { - return value; - } - return String(value); + if (a instanceof Date && b instanceof Date) { + return a.getTime() === b.getTime(); } - var AppendOpcode = (function (_Opcode) { - babelHelpers.inherits(AppendOpcode, _Opcode); - - function AppendOpcode() { - _Opcode.apply(this, arguments); - } - - AppendOpcode.prototype.evaluate = function evaluate(vm) { - var reference = vm.frame.getOperand(); - var normalized = this.normalize(reference); - var value = undefined, - cache = undefined; - if (_glimmerReference.isConst(reference)) { - value = normalized.value(); - } else { - cache = new _glimmerReference.ReferenceCache(normalized); - value = cache.peek(); - } - var stack = vm.stack(); - var upsert = this.insert(vm.env.getAppendOperations(), stack, value); - var bounds = new _glimmerRuntimeLibBuilder.Fragment(upsert.bounds); - stack.newBounds(bounds); - if (cache /* i.e. !isConst(reference) */) { - vm.updateWith(this.updateWith(vm, reference, cache, bounds, upsert)); - } - }; - - AppendOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$OPERAND"] - }; - }; - - return AppendOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return a === b; + } +}); +enifed('ember-runtime/mixins/-proxy', ['exports', '@glimmer/reference', 'ember-metal', 'ember-runtime/computed/computed_macros'], function (exports, _glimmerReference, _emberMetal, _emberRuntimeComputedComputed_macros) { + /** + @module ember + @submodule ember-runtime + */ - exports.AppendOpcode = AppendOpcode; + 'use strict'; - var GuardedAppendOpcode = (function (_AppendOpcode) { - babelHelpers.inherits(GuardedAppendOpcode, _AppendOpcode); + function contentPropertyWillChange(content, contentKey) { + var key = contentKey.slice(8); // remove "content." + if (key in this) { + return; + } // if shadowed in proxy + _emberMetal.propertyWillChange(this, key); + } - function GuardedAppendOpcode(expression, symbolTable) { - _AppendOpcode.call(this); - this.expression = expression; - this.symbolTable = symbolTable; - this.deopted = null; - } + function contentPropertyDidChange(content, contentKey) { + var key = contentKey.slice(8); // remove "content." + if (key in this) { + return; + } // if shadowed in proxy + _emberMetal.propertyDidChange(this, key); + } - GuardedAppendOpcode.prototype.evaluate = function evaluate(vm) { - if (this.deopted) { - vm.pushEvalFrame(this.deopted); - } else { - vm.evaluateOperand(this.expression); - var value = vm.frame.getOperand().value(); - if (_glimmerRuntimeLibComponentInterfaces.isComponentDefinition(value)) { - vm.pushEvalFrame(this.deopt(vm.env)); - } else { - _AppendOpcode.prototype.evaluate.call(this, vm); - } - } - }; + var ProxyTag = (function (_CachedTag) { + babelHelpers.inherits(ProxyTag, _CachedTag); - GuardedAppendOpcode.prototype.deopt = function deopt(env) { - var _this = this; + function ProxyTag(proxy) { + babelHelpers.classCallCheck(this, ProxyTag); - // At compile time, we determined that this append callsite might refer - // to a local variable/property lookup that resolves to a component - // definition at runtime. - // - // We could have eagerly compiled this callsite into something like this: - // - // {{#if (is-component-definition foo)}} - // {{component foo}} - // {{else}} - // {{foo}} - // {{/if}} - // - // However, in practice, there might be a large amout of these callsites - // and most of them would resolve to a simple value lookup. Therefore, we - // tried to be optimistic and assumed that the callsite will resolve to - // appending a simple value. - // - // However, we have reached here because at runtime, the guard conditional - // have detected that this callsite is indeed referring to a component - // definition object. Since this is likely going to be true for other - // instances of the same callsite, it is now appropiate to deopt into the - // expanded version that handles both cases. The compilation would look - // like this: - // - // PutValue(expression) - // Test(is-component-definition) - // Enter(BEGIN, END) - // BEGIN: Noop - // JumpUnless(VALUE) - // PutDynamicComponentDefinitionOpcode - // OpenComponent - // CloseComponent - // Jump(END) - // VALUE: Noop - // OptimizedAppend - // END: Noop - // Exit - // - // Keep in mind that even if we *don't* reach here at initial render time, - // it is still possible (although quite rare) that the simple value we - // encounter during initial render could later change into a component - // definition object at update time. That is handled by the "lazy deopt" - // code on the update side (scroll down for the next big block of comment). - var buffer = new _glimmerRuntimeLibCompiler.CompileIntoList(env, null); - var dsl = new _glimmerRuntimeLibCompiledOpcodesBuilder.default(buffer, this.symbolTable, env); - dsl.putValue(this.expression); - dsl.test(IsComponentDefinitionReference.create); - dsl.block(null, function (dsl, BEGIN, END) { - dsl.jumpUnless('VALUE'); - dsl.putDynamicComponentDefinition(); - dsl.openComponent(_glimmerRuntimeLibSyntaxCore.Args.empty()); - dsl.closeComponent(); - dsl.jump(END); - dsl.label('VALUE'); - dsl.append(new _this.AppendOpcode()); - }); - var deopted = this.deopted = dsl.toOpSeq(); - // From this point on, we have essentially replaced ourselve with a new set - // of opcodes. Since we will always be executing the new/deopted code, it's - // a good idea (as a pattern) to null out any unneeded fields here to avoid - // holding on to unneeded/stale objects: - this.expression = null; - return deopted; - }; + _CachedTag.call(this); - GuardedAppendOpcode.prototype.toJSON = function toJSON() { - var guid = this._guid; - var type = this.type; - var deopted = this.deopted; - - if (deopted) { - return { - guid: guid, - type: type, - deopted: true, - children: deopted.toArray().map(function (op) { - return op.toJSON(); - }) - }; - } else { - return { - guid: guid, - type: type, - args: [this.expression.toJSON()] - }; - } - }; + var content = _emberMetal.get(proxy, 'content'); - return GuardedAppendOpcode; - })(AppendOpcode); + this.proxy = proxy; + this.proxyWrapperTag = new _glimmerReference.DirtyableTag(); + this.proxyContentTag = new _glimmerReference.UpdatableTag(_emberMetal.tagFor(content)); + } - exports.GuardedAppendOpcode = GuardedAppendOpcode; + /** + `Ember.ProxyMixin` forwards all properties not defined by the proxy itself + to a proxied `content` object. See Ember.ObjectProxy for more details. + + @class ProxyMixin + @namespace Ember + @private + */ - var IsComponentDefinitionReference = (function (_ConditionalReference) { - babelHelpers.inherits(IsComponentDefinitionReference, _ConditionalReference); + ProxyTag.prototype.compute = function compute() { + return Math.max(this.proxyWrapperTag.value(), this.proxyContentTag.value()); + }; - function IsComponentDefinitionReference() { - _ConditionalReference.apply(this, arguments); - } + ProxyTag.prototype.dirty = function dirty() { + this.proxyWrapperTag.dirty(); + }; - IsComponentDefinitionReference.create = function create(inner) { - return new IsComponentDefinitionReference(inner); - }; + ProxyTag.prototype.contentDidChange = function contentDidChange() { + var content = _emberMetal.get(this.proxy, 'content'); + this.proxyContentTag.update(_emberMetal.tagFor(content)); + }; - IsComponentDefinitionReference.prototype.toBool = function toBool(value) { - return _glimmerRuntimeLibComponentInterfaces.isComponentDefinition(value); - }; + return ProxyTag; + })(_glimmerReference.CachedTag); - return IsComponentDefinitionReference; - })(_glimmerRuntimeLibReferences.ConditionalReference); + exports.default = _emberMetal.Mixin.create({ + /** + The object whose properties will be forwarded. + @property content + @type Ember.Object + @default null + @private + */ + content: null, - var UpdateOpcode = (function (_UpdatingOpcode) { - babelHelpers.inherits(UpdateOpcode, _UpdatingOpcode); + init: function () { + this._super.apply(this, arguments); + _emberMetal.meta(this).setProxy(); + }, - function UpdateOpcode(cache, bounds, upsert) { - _UpdatingOpcode.call(this); - this.cache = cache; - this.bounds = bounds; - this.upsert = upsert; - this.tag = cache.tag; - } + _initializeTag: _emberMetal.on('init', function () { + _emberMetal.meta(this)._tag = new ProxyTag(this); + }), - UpdateOpcode.prototype.evaluate = function evaluate(vm) { - var value = this.cache.revalidate(); - if (_glimmerReference.isModified(value)) { - var bounds = this.bounds; - var upsert = this.upsert; - var dom = vm.dom; + _contentDidChange: _emberMetal.observer('content', function () { + _emberMetal.assert('Can\'t set Proxy\'s content to itself', _emberMetal.get(this, 'content') !== this); + _emberMetal.tagFor(this).contentDidChange(); + }), - if (!this.upsert.update(dom, value)) { - var cursor = new _glimmerRuntimeLibBounds.Cursor(bounds.parentElement(), _glimmerRuntimeLibBounds.clear(bounds)); - upsert = this.upsert = this.insert(vm.env.getAppendOperations(), cursor, value); - } - bounds.update(upsert.bounds); - } - }; + isTruthy: _emberRuntimeComputedComputed_macros.bool('content'), - UpdateOpcode.prototype.toJSON = function toJSON() { - var guid = this._guid; - var type = this.type; - var cache = this.cache; + _debugContainerKey: null, - return { - guid: guid, - type: type, - details: { lastValue: JSON.stringify(cache.peek()) } - }; - }; + willWatchProperty: function (key) { + var contentKey = 'content.' + key; + _emberMetal._addBeforeObserver(this, contentKey, null, contentPropertyWillChange); + _emberMetal.addObserver(this, contentKey, null, contentPropertyDidChange); + }, - return UpdateOpcode; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + didUnwatchProperty: function (key) { + var contentKey = 'content.' + key; + _emberMetal._removeBeforeObserver(this, contentKey, null, contentPropertyWillChange); + _emberMetal.removeObserver(this, contentKey, null, contentPropertyDidChange); + }, - var GuardedUpdateOpcode = (function (_UpdateOpcode) { - babelHelpers.inherits(GuardedUpdateOpcode, _UpdateOpcode); + unknownProperty: function (key) { + var content = _emberMetal.get(this, 'content'); + if (content) { + _emberMetal.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 _emberMetal.get(content, key); + } + }, - function GuardedUpdateOpcode(reference, cache, bounds, upsert, appendOpcode, state) { - _UpdateOpcode.call(this, cache, bounds, upsert); - this.reference = reference; - this.appendOpcode = appendOpcode; - this.state = state; - this.deopted = null; - this.tag = this._tag = new _glimmerReference.UpdatableTag(this.tag); - } + setUnknownProperty: function (key, value) { + var m = _emberMetal.meta(this); + if (m.proto === this) { + // if marked as prototype then just defineProperty + // rather than delegate + _emberMetal.defineProperty(this, key, null, value); + return value; + } - GuardedUpdateOpcode.prototype.evaluate = function evaluate(vm) { - if (this.deopted) { - vm.evaluateOpcode(this.deopted); - } else { - if (_glimmerRuntimeLibComponentInterfaces.isComponentDefinition(this.reference.value())) { - this.lazyDeopt(vm); - } else { - _UpdateOpcode.prototype.evaluate.call(this, vm); - } - } - }; + var content = _emberMetal.get(this, 'content'); + _emberMetal.assert('Cannot delegate set(\'' + key + '\', ' + value + ') to the \'content\' property of object proxy ' + this + ': its \'content\' is undefined.', content); - GuardedUpdateOpcode.prototype.lazyDeopt = function lazyDeopt(vm) { - // Durign initial render, we know that the reference does not contain a - // component definition, so we optimistically assumed that this append - // is just a normal append. However, at update time, we discovered that - // the reference has switched into containing a component definition, so - // we need to do a "lazy deopt", simulating what would have happened if - // we had decided to perform the deopt in the first place during initial - // render. - // - // More concretely, we would have expanded the curly into a if/else, and - // based on whether the value is a component definition or not, we would - // have entered either the dynamic component branch or the simple value - // branch. - // - // Since we rendered a simple value during initial render (and all the - // updates up until this point), we need to pretend that the result is - // produced by the "VALUE" branch of the deopted append opcode: - // - // Try(BEGIN, END) - // Assert(IsComponentDefinition, expected=false) - // OptimizedUpdate - // - // In this case, because the reference has switched from being a simple - // value into a component definition, what would have happened is that - // the assert would throw, causing the Try opcode to teardown the bounds - // and rerun the original append opcode. - // - // Since the Try opcode would have nuked the updating opcodes anyway, we - // wouldn't have to worry about simulating those. All we have to do is to - // execute the Try opcode and immediately throw. - var bounds = this.bounds; - var appendOpcode = this.appendOpcode; - var state = this.state; - - var appendOps = appendOpcode.deopt(vm.env); - var enter = appendOps.head().next.next; - var ops = enter.slice; - var tracker = new _glimmerRuntimeLibBuilder.UpdatableBlockTracker(bounds.parentElement()); - tracker.newBounds(this.bounds); - var children = new _glimmerUtil.LinkedList(); - state.frame['condition'] = IsComponentDefinitionReference.create(state.frame['operand']); - var deopted = this.deopted = new _glimmerRuntimeLibVmUpdate.TryOpcode(ops, state, tracker, children); - this._tag.update(deopted.tag); - vm.evaluateOpcode(deopted); - vm.throw(); - // From this point on, we have essentially replaced ourselve with a new - // opcode. Since we will always be executing the new/deopted code, it's a - // good idea (as a pattern) to null out any unneeded fields here to avoid - // holding on to unneeded/stale objects: - this._tag = null; - this.reference = null; - this.cache = null; - this.bounds = null; - this.upsert = null; - this.appendOpcode = null; - this.state = null; - }; + _emberMetal.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 _emberMetal.set(content, key, value); + } + }); +}); +enifed('ember-runtime/mixins/action_handler', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-runtime + */ - GuardedUpdateOpcode.prototype.toJSON = function toJSON() { - var guid = this._guid; - var type = this.type; - var deopted = this.deopted; - - if (deopted) { - return { - guid: guid, - type: type, - deopted: true, - children: [deopted.toJSON()] - }; - } else { - return _UpdateOpcode.prototype.toJSON.call(this); - } - }; + 'use strict'; - return GuardedUpdateOpcode; - })(UpdateOpcode); + exports.deprecateUnderscoreActions = deprecateUnderscoreActions; - var OptimizedCautiousAppendOpcode = (function (_AppendOpcode2) { - babelHelpers.inherits(OptimizedCautiousAppendOpcode, _AppendOpcode2); + /** + `Ember.ActionHandler` is available on some familiar classes including + `Ember.Route`, `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.) + + @class ActionHandler + @namespace Ember + @private + */ + var ActionHandler = _emberMetal.Mixin.create({ + mergedProperties: ['actions'], - function OptimizedCautiousAppendOpcode() { - _AppendOpcode2.apply(this, arguments); - this.type = 'optimized-cautious-append'; + /** + 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 + from within a template and the application's current route is this route. + Actions can also be invoked from other parts of your application + via `ActionHandler#send`. + The `actions` hash will inherit action handlers from + the `actions` hash defined on extended parent classes + or mixins rather than just replace the entire hash, e.g.: + ```js + App.CanDisplayBanner = Ember.Mixin.create({ + actions: { + displayBanner(msg) { + // ... + } } - - OptimizedCautiousAppendOpcode.prototype.normalize = function normalize(reference) { - return _glimmerReference.map(reference, normalizeValue); - }; - - OptimizedCautiousAppendOpcode.prototype.insert = function insert(dom, cursor, value) { - return _glimmerRuntimeLibUpsert.cautiousInsert(dom, cursor, value); - }; - - OptimizedCautiousAppendOpcode.prototype.updateWith = function updateWith(vm, reference, cache, bounds, upsert) { - return new OptimizedCautiousUpdateOpcode(cache, bounds, upsert); - }; - - return OptimizedCautiousAppendOpcode; - })(AppendOpcode); - - exports.OptimizedCautiousAppendOpcode = OptimizedCautiousAppendOpcode; - - var OptimizedCautiousUpdateOpcode = (function (_UpdateOpcode2) { - babelHelpers.inherits(OptimizedCautiousUpdateOpcode, _UpdateOpcode2); - - function OptimizedCautiousUpdateOpcode() { - _UpdateOpcode2.apply(this, arguments); - this.type = 'optimized-cautious-update'; + }); + App.WelcomeRoute = Ember.Route.extend(App.CanDisplayBanner, { + actions: { + playMusic() { + // ... + } } - - OptimizedCautiousUpdateOpcode.prototype.insert = function insert(dom, cursor, value) { - return _glimmerRuntimeLibUpsert.cautiousInsert(dom, cursor, value); - }; - - return OptimizedCautiousUpdateOpcode; - })(UpdateOpcode); - - var GuardedCautiousAppendOpcode = (function (_GuardedAppendOpcode) { - babelHelpers.inherits(GuardedCautiousAppendOpcode, _GuardedAppendOpcode); - - function GuardedCautiousAppendOpcode() { - _GuardedAppendOpcode.apply(this, arguments); - this.type = 'guarded-cautious-append'; - this.AppendOpcode = OptimizedCautiousAppendOpcode; + }); + // `WelcomeRoute`, when active, will be able to respond + // to both actions, since the actions hash is merged rather + // then replaced when extending mixins / parent classes. + this.send('displayBanner'); + this.send('playMusic'); + ``` + Within a Controller, Route or Component's action handler, + the value of the `this` context is the Controller, Route or + Component object: + ```js + App.SongRoute = Ember.Route.extend({ + actions: { + myAction() { + this.controllerFor("song"); + this.transitionTo("other.route"); + ... + } } - - GuardedCautiousAppendOpcode.prototype.normalize = function normalize(reference) { - return _glimmerReference.map(reference, normalizeValue); - }; - - GuardedCautiousAppendOpcode.prototype.insert = function insert(dom, cursor, value) { - return _glimmerRuntimeLibUpsert.cautiousInsert(dom, cursor, value); - }; - - GuardedCautiousAppendOpcode.prototype.updateWith = function updateWith(vm, reference, cache, bounds, upsert) { - return new GuardedCautiousUpdateOpcode(reference, cache, bounds, upsert, this, vm.capture()); - }; - - return GuardedCautiousAppendOpcode; - })(GuardedAppendOpcode); - - exports.GuardedCautiousAppendOpcode = GuardedCautiousAppendOpcode; - - var GuardedCautiousUpdateOpcode = (function (_GuardedUpdateOpcode) { - babelHelpers.inherits(GuardedCautiousUpdateOpcode, _GuardedUpdateOpcode); - - function GuardedCautiousUpdateOpcode() { - _GuardedUpdateOpcode.apply(this, arguments); - this.type = 'guarded-cautious-update'; + }); + ``` + It is also possible to call `this._super(...arguments)` from within an + action handler if it overrides a handler defined on a parent + class or mixin: + Take for example the following routes: + ```js + App.DebugRoute = Ember.Mixin.create({ + actions: { + debugRouteInformation() { + console.debug("trololo"); + } } - - GuardedCautiousUpdateOpcode.prototype.insert = function insert(dom, cursor, value) { - return _glimmerRuntimeLibUpsert.cautiousInsert(dom, cursor, value); - }; - - return GuardedCautiousUpdateOpcode; - })(GuardedUpdateOpcode); - - var OptimizedTrustingAppendOpcode = (function (_AppendOpcode3) { - babelHelpers.inherits(OptimizedTrustingAppendOpcode, _AppendOpcode3); - - function OptimizedTrustingAppendOpcode() { - _AppendOpcode3.apply(this, arguments); - this.type = 'optimized-trusting-append'; + }); + App.AnnoyingDebugRoute = Ember.Route.extend(App.DebugRoute, { + actions: { + debugRouteInformation() { + // also call the debugRouteInformation of mixed in App.DebugRoute + this._super(...arguments); + // show additional annoyance + window.alert(...); + } + } + }); + ``` + ## Bubbling + By default, an action will stop bubbling once a handler defined + on the `actions` hash handles it. To continue bubbling the action, + you must return `true` from the handler: + ```js + App.Router.map(function() { + this.route("album", function() { + this.route("song"); + }); + }); + App.AlbumRoute = Ember.Route.extend({ + actions: { + startPlaying: function() { + } } - - OptimizedTrustingAppendOpcode.prototype.normalize = function normalize(reference) { - return _glimmerReference.map(reference, normalizeTrustedValue); - }; - - OptimizedTrustingAppendOpcode.prototype.insert = function insert(dom, cursor, value) { - return _glimmerRuntimeLibUpsert.trustingInsert(dom, cursor, value); - }; - - OptimizedTrustingAppendOpcode.prototype.updateWith = function updateWith(vm, reference, cache, bounds, upsert) { - return new OptimizedTrustingUpdateOpcode(cache, bounds, upsert); - }; - - return OptimizedTrustingAppendOpcode; - })(AppendOpcode); - - exports.OptimizedTrustingAppendOpcode = OptimizedTrustingAppendOpcode; - - var OptimizedTrustingUpdateOpcode = (function (_UpdateOpcode3) { - babelHelpers.inherits(OptimizedTrustingUpdateOpcode, _UpdateOpcode3); - - function OptimizedTrustingUpdateOpcode() { - _UpdateOpcode3.apply(this, arguments); - this.type = 'optimized-trusting-update'; + }); + App.AlbumSongRoute = Ember.Route.extend({ + actions: { + startPlaying() { + // ... + if (actionShouldAlsoBeTriggeredOnParentRoute) { + return true; + } + } } + }); + ``` + @property actions + @type Object + @default null + @public + */ - OptimizedTrustingUpdateOpcode.prototype.insert = function insert(dom, cursor, value) { - return _glimmerRuntimeLibUpsert.trustingInsert(dom, cursor, value); - }; - - return OptimizedTrustingUpdateOpcode; - })(UpdateOpcode); - - var GuardedTrustingAppendOpcode = (function (_GuardedAppendOpcode2) { - babelHelpers.inherits(GuardedTrustingAppendOpcode, _GuardedAppendOpcode2); - - function GuardedTrustingAppendOpcode() { - _GuardedAppendOpcode2.apply(this, arguments); - this.type = 'guarded-trusting-append'; - this.AppendOpcode = OptimizedTrustingAppendOpcode; + /** + 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 + not be found in the `ActionHandler`'s `actions` hash or if the + action target function returns `true`. + Example + ```js + App.WelcomeRoute = Ember.Route.extend({ + actions: { + playTheme() { + this.send('playMusic', 'theme.mp3'); + }, + playMusic(track) { + // ... + } } + }); + ``` + @method send + @param {String} actionName The action to trigger + @param {*} context a context to send with the action + @public + */ + send: function (actionName) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } - GuardedTrustingAppendOpcode.prototype.normalize = function normalize(reference) { - return _glimmerReference.map(reference, normalizeTrustedValue); - }; - - GuardedTrustingAppendOpcode.prototype.insert = function insert(dom, cursor, value) { - return _glimmerRuntimeLibUpsert.trustingInsert(dom, cursor, value); - }; - - GuardedTrustingAppendOpcode.prototype.updateWith = function updateWith(vm, reference, cache, bounds, upsert) { - return new GuardedTrustingUpdateOpcode(reference, cache, bounds, upsert, this, vm.capture()); - }; + if (this.actions && this.actions[actionName]) { + var shouldBubble = this.actions[actionName].apply(this, args) === true; + if (!shouldBubble) { + return; + } + } - return GuardedTrustingAppendOpcode; - })(GuardedAppendOpcode); + var target = _emberMetal.get(this, 'target'); + if (target) { + _emberMetal.assert('The `target` for ' + this + ' (' + target + ') does not have a `send` method', typeof target.send === 'function'); + target.send.apply(target, arguments); + } + }, - exports.GuardedTrustingAppendOpcode = GuardedTrustingAppendOpcode; + willMergeMixin: function (props) { + _emberMetal.assert('Specifying `_actions` and `actions` in the same mixin is not supported.', !props.actions || !props._actions); - var GuardedTrustingUpdateOpcode = (function (_GuardedUpdateOpcode2) { - babelHelpers.inherits(GuardedTrustingUpdateOpcode, _GuardedUpdateOpcode2); + if (props._actions) { + _emberMetal.deprecate('Specifying actions in `_actions` is deprecated, please use `actions` instead.', false, { id: 'ember-runtime.action-handler-_actions', until: '3.0.0' }); - function GuardedTrustingUpdateOpcode() { - _GuardedUpdateOpcode2.apply(this, arguments); - this.type = 'trusting-update'; - } + props.actions = props._actions; + delete props._actions; + } + } + }); - GuardedTrustingUpdateOpcode.prototype.insert = function insert(dom, cursor, value) { - return _glimmerRuntimeLibUpsert.trustingInsert(dom, cursor, value); - }; + exports.default = ActionHandler; - return GuardedTrustingUpdateOpcode; - })(GuardedUpdateOpcode); + function deprecateUnderscoreActions(factory) { + Object.defineProperty(factory.prototype, '_actions', { + configurable: true, + enumerable: false, + set: function (value) { + _emberMetal.assert('You cannot set `_actions` on ' + this + ', please use `actions` instead.'); + }, + get: function () { + _emberMetal.deprecate('Usage of `_actions` is deprecated, use `actions` instead.', false, { id: 'ember-runtime.action-handler-_actions', until: '3.0.0' }); + return _emberMetal.get(this, 'actions'); + } + }); + } }); +enifed('ember-runtime/mixins/array', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/mixins/enumerable', 'ember-runtime/system/each_proxy'], function (exports, _emberUtils, _emberMetal, _emberRuntimeMixinsEnumerable, _emberRuntimeSystemEach_proxy) { + /** + @module ember + @submodule ember-runtime + */ -enifed('glimmer-runtime/lib/compiled/opcodes/dom', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/compiled/opcodes/vm'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibReferences, _glimmerRuntimeLibCompiledOpcodesVm) { - 'use strict'; + // .......................................................... + // HELPERS + // + 'use strict'; - var TextOpcode = (function (_Opcode) { - babelHelpers.inherits(TextOpcode, _Opcode); + var _Mixin$create; - function TextOpcode(text) { - _Opcode.call(this); - this.text = text; - this.type = "text"; - } + exports.addArrayObserver = addArrayObserver; + exports.removeArrayObserver = removeArrayObserver; + exports.objectAt = objectAt; + exports.arrayContentWillChange = arrayContentWillChange; + exports.arrayContentDidChange = arrayContentDidChange; + exports.isEmberArray = isEmberArray; - TextOpcode.prototype.evaluate = function evaluate(vm) { - vm.stack().appendText(this.text); - }; + function arrayObserversHelper(obj, target, opts, operation, notify) { + var willChange = opts && opts.willChange || 'arrayWillChange'; + var didChange = opts && opts.didChange || 'arrayDidChange'; + var hasObservers = _emberMetal.get(obj, 'hasArrayObservers'); - TextOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.text)] - }; - }; + if (hasObservers === notify) { + _emberMetal.propertyWillChange(obj, 'hasArrayObservers'); + } - return TextOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + operation(obj, '@array:before', target, willChange); + operation(obj, '@array:change', target, didChange); - exports.TextOpcode = TextOpcode; + if (hasObservers === notify) { + _emberMetal.propertyDidChange(obj, 'hasArrayObservers'); + } - var OpenPrimitiveElementOpcode = (function (_Opcode2) { - babelHelpers.inherits(OpenPrimitiveElementOpcode, _Opcode2); + return obj; + } - function OpenPrimitiveElementOpcode(tag) { - _Opcode2.call(this); - this.tag = tag; - this.type = "open-primitive-element"; - } + function addArrayObserver(array, target, opts) { + return arrayObserversHelper(array, target, opts, _emberMetal.addListener, false); + } - OpenPrimitiveElementOpcode.prototype.evaluate = function evaluate(vm) { - vm.stack().openElement(this.tag); - }; + function removeArrayObserver(array, target, opts) { + return arrayObserversHelper(array, target, opts, _emberMetal.removeListener, true); + } - OpenPrimitiveElementOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.tag)] - }; - }; + function objectAt(content, idx) { + if (content.objectAt) { + return content.objectAt(idx); + } - return OpenPrimitiveElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return content[idx]; + } - exports.OpenPrimitiveElementOpcode = OpenPrimitiveElementOpcode; + function arrayContentWillChange(array, startIdx, removeAmt, addAmt) { + var removing = undefined, + lim = undefined; - var PushRemoteElementOpcode = (function (_Opcode3) { - babelHelpers.inherits(PushRemoteElementOpcode, _Opcode3); + // if no args are passed assume everything changes + if (startIdx === undefined) { + startIdx = 0; + removeAmt = addAmt = -1; + } else { + if (removeAmt === undefined) { + removeAmt = -1; + } - function PushRemoteElementOpcode() { - _Opcode3.apply(this, arguments); - this.type = "push-remote-element"; - } + if (addAmt === undefined) { + addAmt = -1; + } + } - PushRemoteElementOpcode.prototype.evaluate = function evaluate(vm) { - var reference = vm.frame.getOperand(); - var cache = _glimmerReference.isConst(reference) ? undefined : new _glimmerReference.ReferenceCache(reference); - var element = cache ? cache.peek() : reference.value(); - vm.stack().pushRemoteElement(element); - if (cache) { - vm.updateWith(new _glimmerRuntimeLibCompiledOpcodesVm.Assert(cache)); - } - }; + if (array.__each) { + array.__each.arrayWillChange(array, startIdx, removeAmt, addAmt); + } - PushRemoteElementOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ['$OPERAND'] - }; - }; + _emberMetal.sendEvent(array, '@array:before', [array, startIdx, removeAmt, addAmt]); - return PushRemoteElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + if (startIdx >= 0 && removeAmt >= 0 && _emberMetal.get(array, 'hasEnumerableObservers')) { + removing = []; + lim = startIdx + removeAmt; - exports.PushRemoteElementOpcode = PushRemoteElementOpcode; + for (var idx = startIdx; idx < lim; idx++) { + removing.push(objectAt(array, idx)); + } + } else { + removing = removeAmt; + } - var PopRemoteElementOpcode = (function (_Opcode4) { - babelHelpers.inherits(PopRemoteElementOpcode, _Opcode4); + array.enumerableContentWillChange(removing, addAmt); - function PopRemoteElementOpcode() { - _Opcode4.apply(this, arguments); - this.type = "pop-remote-element"; - } + return array; + } - PopRemoteElementOpcode.prototype.evaluate = function evaluate(vm) { - vm.stack().popRemoteElement(); - }; + function arrayContentDidChange(array, startIdx, removeAmt, addAmt) { + // if no args are passed assume everything changes + if (startIdx === undefined) { + startIdx = 0; + removeAmt = addAmt = -1; + } else { + if (removeAmt === undefined) { + removeAmt = -1; + } - return PopRemoteElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + if (addAmt === undefined) { + addAmt = -1; + } + } - exports.PopRemoteElementOpcode = PopRemoteElementOpcode; + var adding = undefined; + if (startIdx >= 0 && addAmt >= 0 && _emberMetal.get(array, 'hasEnumerableObservers')) { + adding = []; + var lim = startIdx + addAmt; - var OpenComponentElementOpcode = (function (_Opcode5) { - babelHelpers.inherits(OpenComponentElementOpcode, _Opcode5); + for (var idx = startIdx; idx < lim; idx++) { + adding.push(objectAt(array, idx)); + } + } else { + adding = addAmt; + } - function OpenComponentElementOpcode(tag) { - _Opcode5.call(this); - this.tag = tag; - this.type = "open-component-element"; - } + array.enumerableContentDidChange(removeAmt, adding); - OpenComponentElementOpcode.prototype.evaluate = function evaluate(vm) { - vm.stack().openElement(this.tag, new ComponentElementOperations(vm.env)); - }; + if (array.__each) { + array.__each.arrayDidChange(array, startIdx, removeAmt, addAmt); + } - OpenComponentElementOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.tag)] - }; - }; + _emberMetal.sendEvent(array, '@array:change', [array, startIdx, removeAmt, addAmt]); - return OpenComponentElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + var meta = _emberMetal.peekMeta(array); + var cache = meta && meta.readableCache(); - exports.OpenComponentElementOpcode = OpenComponentElementOpcode; + if (cache) { + if (cache.firstObject !== undefined && objectAt(array, 0) !== _emberMetal.cacheFor.get(cache, 'firstObject')) { + _emberMetal.propertyWillChange(array, 'firstObject'); + _emberMetal.propertyDidChange(array, 'firstObject'); + } + if (cache.lastObject !== undefined && objectAt(array, _emberMetal.get(array, 'length') - 1) !== _emberMetal.cacheFor.get(cache, 'lastObject')) { + _emberMetal.propertyWillChange(array, 'lastObject'); + _emberMetal.propertyDidChange(array, 'lastObject'); + } + } + return array; + } - var OpenDynamicPrimitiveElementOpcode = (function (_Opcode6) { - babelHelpers.inherits(OpenDynamicPrimitiveElementOpcode, _Opcode6); + var EMBER_ARRAY = _emberUtils.symbol('EMBER_ARRAY'); - function OpenDynamicPrimitiveElementOpcode() { - _Opcode6.apply(this, arguments); - this.type = "open-dynamic-primitive-element"; - } + function isEmberArray(obj) { + return obj && !!obj[EMBER_ARRAY]; + } - OpenDynamicPrimitiveElementOpcode.prototype.evaluate = function evaluate(vm) { - var tagName = vm.frame.getOperand().value(); - vm.stack().openElement(tagName); - }; + // .......................................................... + // ARRAY + // + /** + This mixin implements Observer-friendly Array-like behavior. It is not a + concrete implementation, but it can be used up by other classes that want + to appear like arrays. + + For example, ArrayProxy is a concrete classes that can + be instantiated to implement array-like behavior. Both of these classes use + the Array Mixin by way of the MutableArray mixin, which allows observable + changes to be made to the underlying array. + + Unlike `Ember.Enumerable,` this mixin defines methods specifically for + collections that provide index-ordered access to their contents. When you + are designing code that needs to accept any kind of Array-like object, you + should use these methods instead of Array primitives because these will + properly notify observers of changes to the array. + + Although these methods are efficient, they do add a layer of indirection to + your application so it is a good idea to use them only when you need the + flexibility of using both true JavaScript arrays and "virtual" arrays such + as controllers and collections. + + You can use the methods defined in this module to access and modify array + contents in a KVO-friendly way. You can also be notified whenever the + membership of an array changes by using `.observes('myArray.[]')`. + + To support `Ember.Array` in your own class, you must override two + primitives to use it: `length()` and `objectAt()`. + + Note that the Ember.Array mixin also incorporates the `Ember.Enumerable` + mixin. All `Ember.Array`-like objects are also enumerable. + + @class Array + @namespace Ember + @uses Ember.Enumerable + @since Ember 0.9.0 + @public + */ + var ArrayMixin = _emberMetal.Mixin.create(_emberRuntimeMixinsEnumerable.default, (_Mixin$create = {}, _Mixin$create[EMBER_ARRAY] = true, _Mixin$create.length = null, _Mixin$create.objectAt = function (idx) { + if (idx < 0 || idx >= _emberMetal.get(this, 'length')) { + return undefined; + } - OpenDynamicPrimitiveElementOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$OPERAND"] - }; - }; + return _emberMetal.get(this, idx); + }, _Mixin$create.objectsAt = function (indexes) { + var _this = this; - return OpenDynamicPrimitiveElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return indexes.map(function (idx) { + return objectAt(_this, idx); + }); + }, _Mixin$create.nextObject = function (idx) { + return objectAt(this, idx); + }, _Mixin$create['[]'] = _emberMetal.computed({ + get: function (key) { + return this; + }, + set: function (key, value) { + this.replace(0, _emberMetal.get(this, 'length'), value); + return this; + } + }), _Mixin$create.firstObject = _emberMetal.computed(function () { + return objectAt(this, 0); + }).readOnly(), _Mixin$create.lastObject = _emberMetal.computed(function () { + return objectAt(this, _emberMetal.get(this, 'length') - 1); + }).readOnly(), _Mixin$create.contains = function (obj) { + _emberMetal.deprecate('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.', false, { id: 'ember-runtime.enumerable-contains', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_enumerable-contains' }); - exports.OpenDynamicPrimitiveElementOpcode = OpenDynamicPrimitiveElementOpcode; + return this.indexOf(obj) >= 0; + }, _Mixin$create.slice = function (beginIndex, endIndex) { + var ret = _emberMetal.default.A(); + var length = _emberMetal.get(this, 'length'); - var ClassList = (function () { - function ClassList() { - this.list = null; - this.isConst = true; - } + if (_emberMetal.isNone(beginIndex)) { + beginIndex = 0; + } - ClassList.prototype.append = function append(reference) { - var list = this.list; - var isConst = this.isConst; + if (_emberMetal.isNone(endIndex) || endIndex > length) { + endIndex = length; + } - if (list === null) list = this.list = []; - list.push(reference); - this.isConst = isConst && _glimmerReference.isConst(reference); - }; + if (beginIndex < 0) { + beginIndex = length + beginIndex; + } - ClassList.prototype.toReference = function toReference() { - var list = this.list; - var isConst = this.isConst; + if (endIndex < 0) { + endIndex = length + endIndex; + } - if (!list) return _glimmerRuntimeLibReferences.NULL_REFERENCE; - if (isConst) return _glimmerRuntimeLibReferences.PrimitiveReference.create(toClassName(list)); - return new ClassListReference(list); - }; + while (beginIndex < endIndex) { + ret[ret.length] = objectAt(this, beginIndex++); + } - return ClassList; - })(); + return ret; + }, _Mixin$create.indexOf = function (object, startAt) { + var len = _emberMetal.get(this, 'length'); - var ClassListReference = (function (_CachedReference) { - babelHelpers.inherits(ClassListReference, _CachedReference); + if (startAt === undefined) { + startAt = 0; + } - function ClassListReference(list) { - _CachedReference.call(this); - this.list = []; - this.tag = _glimmerReference.combineTagged(list); - this.list = list; - } + if (startAt < 0) { + startAt += len; + } - ClassListReference.prototype.compute = function compute() { - return toClassName(this.list); - }; + for (var idx = startAt; idx < len; idx++) { + if (objectAt(this, idx) === object) { + return idx; + } + } - return ClassListReference; - })(_glimmerReference.CachedReference); + return -1; + }, _Mixin$create.lastIndexOf = function (object, startAt) { + var len = _emberMetal.get(this, 'length'); - function toClassName(list) { - var ret = []; - for (var i = 0; i < list.length; i++) { - var value = list[i].value(); - if (value !== false && value !== null && value !== undefined) ret.push(value); - } - return ret.length === 0 ? null : ret.join(' '); + if (startAt === undefined || startAt >= len) { + startAt = len - 1; } - var SimpleElementOperations = (function () { - function SimpleElementOperations(env) { - this.env = env; - this.opcodes = null; - this.classList = null; - } + if (startAt < 0) { + startAt += len; + } - SimpleElementOperations.prototype.addStaticAttribute = function addStaticAttribute(element, name, value) { - if (name === 'class') { - this.addClass(_glimmerRuntimeLibReferences.PrimitiveReference.create(value)); - } else { - this.env.getAppendOperations().setAttribute(element, name, value); - } - }; + for (var idx = startAt; idx >= 0; idx--) { + if (objectAt(this, idx) === object) { + return idx; + } + } - SimpleElementOperations.prototype.addStaticAttributeNS = function addStaticAttributeNS(element, namespace, name, value) { - this.env.getAppendOperations().setAttribute(element, name, value, namespace); - }; + return -1; + }, _Mixin$create.addArrayObserver = function (target, opts) { + return addArrayObserver(this, target, opts); + }, _Mixin$create.removeArrayObserver = function (target, opts) { + return removeArrayObserver(this, target, opts); + }, _Mixin$create.hasArrayObservers = _emberMetal.computed(function () { + return _emberMetal.hasListeners(this, '@array:change') || _emberMetal.hasListeners(this, '@array:before'); + }), _Mixin$create.arrayContentWillChange = function (startIdx, removeAmt, addAmt) { + return arrayContentWillChange(this, startIdx, removeAmt, addAmt); + }, _Mixin$create.arrayContentDidChange = function (startIdx, removeAmt, addAmt) { + return arrayContentDidChange(this, startIdx, removeAmt, addAmt); + }, _Mixin$create.includes = function (obj, startAt) { + var len = _emberMetal.get(this, 'length'); - SimpleElementOperations.prototype.addDynamicAttribute = function addDynamicAttribute(element, name, reference, isTrusting) { - if (name === 'class') { - this.addClass(reference); - } else { - var attributeManager = this.env.attributeFor(element, name, isTrusting); - var attribute = new DynamicAttribute(element, attributeManager, name, reference); - this.addAttribute(attribute); - } - }; + if (startAt === undefined) { + startAt = 0; + } - SimpleElementOperations.prototype.addDynamicAttributeNS = function addDynamicAttributeNS(element, namespace, name, reference, isTrusting) { - var attributeManager = this.env.attributeFor(element, name, isTrusting, namespace); - var nsAttribute = new DynamicAttribute(element, attributeManager, name, reference, namespace); - this.addAttribute(nsAttribute); - }; + if (startAt < 0) { + startAt += len; + } - SimpleElementOperations.prototype.flush = function flush(element, vm) { - var env = vm.env; - var opcodes = this.opcodes; - var classList = this.classList; + for (var idx = startAt; idx < len; idx++) { + var currentObj = objectAt(this, idx); - for (var i = 0; opcodes && i < opcodes.length; i++) { - vm.updateWith(opcodes[i]); - } - if (classList) { - var attributeManager = env.attributeFor(element, 'class', false); - var attribute = new DynamicAttribute(element, attributeManager, 'class', classList.toReference()); - var opcode = attribute.flush(env); - if (opcode) { - vm.updateWith(opcode); - } - } - this.opcodes = null; - this.classList = null; - }; + // SameValueZero comparison (NaN !== NaN) + if (obj === currentObj || obj !== obj && currentObj !== currentObj) { + return true; + } + } - SimpleElementOperations.prototype.addClass = function addClass(reference) { - var classList = this.classList; + return false; + }, _Mixin$create['@each'] = _emberMetal.computed(function () { + // TODO use Symbol or add to meta + if (!this.__each) { + this.__each = new _emberRuntimeSystemEach_proxy.default(this); + } - if (!classList) { - classList = this.classList = new ClassList(); - } - classList.append(reference); - }; + return this.__each; + }).volatile().readOnly(), _Mixin$create)); - SimpleElementOperations.prototype.addAttribute = function addAttribute(attribute) { - var opcode = attribute.flush(this.env); - if (opcode) { - var opcodes = this.opcodes; + exports.default = ArrayMixin; +}); +// ES6TODO: Ember.A - if (!opcodes) { - opcodes = this.opcodes = []; - } - opcodes.push(opcode); - } - }; +/** + __Required.__ You must implement this method to apply this mixin. + Your array must support the `length` property. Your replace methods should + set this property whenever it changes. + @property {Number} length + @public +*/ - return SimpleElementOperations; - })(); +/** + Returns the object at the given `index`. If the given `index` is negative + or is greater or equal than the array length, returns `undefined`. + This is one of the primitives you must implement to support `Ember.Array`. + If your object supports retrieving the value of an array item using `get()` + (i.e. `myArray.get(0)`), then you do not need to implement this method + yourself. + ```javascript + let arr = ['a', 'b', 'c', 'd']; + arr.objectAt(0); // 'a' + arr.objectAt(3); // 'd' + arr.objectAt(-1); // undefined + arr.objectAt(4); // undefined + arr.objectAt(5); // undefined + ``` + @method objectAt + @param {Number} idx The index of the item to return. + @return {*} item at index or undefined + @public +*/ - exports.SimpleElementOperations = SimpleElementOperations; +/** + This returns the objects at the specified indexes, using `objectAt`. + ```javascript + let arr = ['a', 'b', 'c', 'd']; + arr.objectsAt([0, 1, 2]); // ['a', 'b', 'c'] + arr.objectsAt([2, 3, 4]); // ['c', 'd', undefined] + ``` + @method objectsAt + @param {Array} indexes An array of indexes of items to return. + @return {Array} + @public + */ - var ComponentElementOperations = (function () { - function ComponentElementOperations(env) { - this.env = env; - this.attributeNames = null; - this.attributes = null; - this.classList = null; - } +// overrides Ember.Enumerable version - ComponentElementOperations.prototype.addStaticAttribute = function addStaticAttribute(element, name, value) { - if (name === 'class') { - this.addClass(_glimmerRuntimeLibReferences.PrimitiveReference.create(value)); - } else if (this.shouldAddAttribute(name)) { - this.addAttribute(name, new StaticAttribute(element, name, value)); - } - }; +/** + This is the handler for the special array content property. If you get + this property, it will return this. If you set this property to a new + array, it will replace the current content. + This property overrides the default property defined in `Ember.Enumerable`. + @property [] + @return this + @public +*/ - ComponentElementOperations.prototype.addStaticAttributeNS = function addStaticAttributeNS(element, namespace, name, value) { - if (this.shouldAddAttribute(name)) { - this.addAttribute(name, new StaticAttribute(element, name, value, namespace)); - } - }; +// optimized version from Enumerable - ComponentElementOperations.prototype.addDynamicAttribute = function addDynamicAttribute(element, name, reference, isTrusting) { - if (name === 'class') { - this.addClass(reference); - } else if (this.shouldAddAttribute(name)) { - var attributeManager = this.env.attributeFor(element, name, isTrusting); - var attribute = new DynamicAttribute(element, attributeManager, name, reference); - this.addAttribute(name, attribute); - } - }; +// Add any extra methods to Ember.Array that are native to the built-in Array. +/** + Returns a new array that is a slice of the receiver. This implementation + uses the observable array methods to retrieve the objects for the new + slice. + ```javascript + let arr = ['red', 'green', 'blue']; + arr.slice(0); // ['red', 'green', 'blue'] + arr.slice(0, 2); // ['red', 'green'] + arr.slice(1, 100); // ['green', 'blue'] + ``` + @method slice + @param {Number} beginIndex (Optional) index to begin slicing from. + @param {Number} endIndex (Optional) index to end the slice at (but not included). + @return {Array} New array with specified slice + @public +*/ + +/** + Returns the index of the given object's first occurrence. + If no `startAt` argument is given, the starting location to + search is 0. If it's negative, will count backward from + the end of the array. Returns -1 if no match is found. + ```javascript + let arr = ['a', 'b', 'c', 'd', 'a']; + arr.indexOf('a'); // 0 + arr.indexOf('z'); // -1 + arr.indexOf('a', 2); // 4 + arr.indexOf('a', -1); // 4 + arr.indexOf('b', 3); // -1 + arr.indexOf('a', 100); // -1 + ``` + @method indexOf + @param {Object} object the item to search for + @param {Number} startAt optional starting location to search, default 0 + @return {Number} index or -1 if not found + @public +*/ - ComponentElementOperations.prototype.addDynamicAttributeNS = function addDynamicAttributeNS(element, namespace, name, reference, isTrusting) { - if (this.shouldAddAttribute(name)) { - var attributeManager = this.env.attributeFor(element, name, isTrusting, namespace); - var nsAttribute = new DynamicAttribute(element, attributeManager, name, reference, namespace); - this.addAttribute(name, nsAttribute); - } - }; +/** + Returns the index of the given object's last occurrence. + If no `startAt` argument is given, the search starts from + the last position. If it's negative, will count backward + from the end of the array. Returns -1 if no match is found. + ```javascript + let arr = ['a', 'b', 'c', 'd', 'a']; + arr.lastIndexOf('a'); // 4 + arr.lastIndexOf('z'); // -1 + arr.lastIndexOf('a', 2); // 0 + arr.lastIndexOf('a', -1); // 4 + arr.lastIndexOf('b', 3); // 1 + arr.lastIndexOf('a', 100); // 4 + ``` + @method lastIndexOf + @param {Object} object the item to search for + @param {Number} startAt optional starting location to search, default 0 + @return {Number} index or -1 if not found + @public +*/ - ComponentElementOperations.prototype.flush = function flush(element, vm) { - var env = this.env; - var attributes = this.attributes; - var classList = this.classList; +// .......................................................... +// ARRAY OBSERVERS +// - for (var i = 0; attributes && i < attributes.length; i++) { - var opcode = attributes[i].flush(env); - if (opcode) { - vm.updateWith(opcode); - } - } - if (classList) { - var attributeManager = env.attributeFor(element, 'class', false); - var attribute = new DynamicAttribute(element, attributeManager, 'class', classList.toReference()); - var opcode = attribute.flush(env); - if (opcode) { - vm.updateWith(opcode); - } - } - }; +/** + Adds an array observer to the receiving array. The array observer object + normally must implement two methods: + * `arrayWillChange(observedObj, start, removeCount, addCount)` - This method will be + called just before the array is modified. + * `arrayDidChange(observedObj, start, removeCount, addCount)` - This method will be + called just after the array is modified. + Both callbacks will be passed the observed object, starting index of the + change as well as a count of the items to be removed and added. You can use + these callbacks to optionally inspect the array during the change, clear + caches, or do any other bookkeeping necessary. + In addition to passing a target, you can also include an options hash + which you can use to override the method names that will be invoked on the + target. + @method addArrayObserver + @param {Object} target The observer object. + @param {Object} opts Optional hash of configuration options including + `willChange` and `didChange` option. + @return {Ember.Array} receiver + @public +*/ - ComponentElementOperations.prototype.shouldAddAttribute = function shouldAddAttribute(name) { - return !this.attributeNames || this.attributeNames.indexOf(name) === -1; - }; +/** + Removes an array observer from the object if the observer is current + registered. Calling this method multiple times with the same object will + have no effect. + @method removeArrayObserver + @param {Object} target The object observing the array. + @param {Object} opts Optional hash of configuration options including + `willChange` and `didChange` option. + @return {Ember.Array} receiver + @public +*/ - ComponentElementOperations.prototype.addClass = function addClass(reference) { - var classList = this.classList; +/** + Becomes true whenever the array currently has observers watching changes + on the array. + @property {Boolean} hasArrayObservers + @public +*/ - if (!classList) { - classList = this.classList = new ClassList(); - } - classList.append(reference); - }; +/** + If you are implementing an object that supports `Ember.Array`, call this + method just before the array content changes to notify any observers and + invalidate any related properties. Pass the starting index of the change + as well as a delta of the amounts to change. + @method arrayContentWillChange + @param {Number} startIdx The starting index in the array that will change. + @param {Number} removeAmt The number of items that will be removed. If you + pass `null` assumes 0 + @param {Number} addAmt The number of items that will be added. If you + pass `null` assumes 0. + @return {Ember.Array} receiver + @public +*/ - ComponentElementOperations.prototype.addAttribute = function addAttribute(name, attribute) { - var attributeNames = this.attributeNames; - var attributes = this.attributes; +/** + If you are implementing an object that supports `Ember.Array`, call this + method just after the array content changes to notify any observers and + invalidate any related properties. Pass the starting index of the change + as well as a delta of the amounts to change. + @method arrayContentDidChange + @param {Number} startIdx The starting index in the array that did change. + @param {Number} removeAmt The number of items that were removed. If you + pass `null` assumes 0 + @param {Number} addAmt The number of items that were added. If you + pass `null` assumes 0. + @return {Ember.Array} receiver + @public +*/ - if (!attributeNames) { - attributeNames = this.attributeNames = []; - attributes = this.attributes = []; - } - attributeNames.push(name); - attributes.push(attribute); - }; +/** + 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 +*/ - return ComponentElementOperations; - })(); +/** + Returns a special object that can be used to observe individual properties + on the array. Just get an equivalent property on this object and it will + return an enumerable that maps automatically to the named key on the + member objects. + `@each` should only be used in a non-terminal context. Example: + ```javascript + myMethod: computed('posts.@each.author', function(){ + ... + }); + ``` + If you merely want to watch for the array being changed, like an object being + replaced, added or removed, use `[]` instead of `@each`. + ```javascript + myMethod: computed('posts.[]', function(){ + ... + }); + ``` + @property @each + @public +*/ +enifed('ember-runtime/mixins/comparable', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - exports.ComponentElementOperations = ComponentElementOperations; + /** + @module ember + @submodule ember-runtime + */ - var FlushElementOpcode = (function (_Opcode7) { - babelHelpers.inherits(FlushElementOpcode, _Opcode7); + /** + Implements some standard methods for comparing objects. Add this mixin to + any class you create that can compare its instances. + + You should implement the `compare()` method. + + @class Comparable + @namespace Ember + @since Ember 0.9 + @private + */ + exports.default = _emberMetal.Mixin.create({ - function FlushElementOpcode() { - _Opcode7.apply(this, arguments); - this.type = "flush-element"; - } + /** + __Required.__ You must implement this method to apply this mixin. + Override to return the result of the comparison of the two parameters. The + compare method should return: + - `-1` if `a < b` + - `0` if `a == b` + - `1` if `a > b` + Default implementation raises an exception. + @method compare + @param a {Object} the first object to compare + @param b {Object} the second object to compare + @return {Number} the result of the comparison + @private + */ + compare: null + }); +}); +enifed('ember-runtime/mixins/container_proxy', ['exports', 'ember-metal', 'container'], function (exports, _emberMetal, _container) { + /** + @module ember + @submodule ember-runtime + */ + 'use strict'; - FlushElementOpcode.prototype.evaluate = function evaluate(vm) { - var stack = vm.stack(); - stack.operations.flush(stack.constructing, vm); - stack.flushElement(); - }; + var _containerProxyMixin; - return FlushElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + ContainerProxyMixin is used to provide public access to specific + container functionality. + + @class ContainerProxyMixin + @private + */ + var containerProxyMixin = (_containerProxyMixin = { + /** + The container stores state. + @private + @property {Ember.Container} __container__ + */ + __container__: null, - exports.FlushElementOpcode = FlushElementOpcode; + /** + Returns an object that can be used to provide an owner to a + manually created instance. + Example: + ``` + let owner = Ember.getOwner(this); + User.create( + owner.ownerInjection(), + { username: 'rwjblue' } + ) + ``` + @public + @method ownerInjection + @since 2.3.0 + @return {Object} + */ + ownerInjection: function () { + return this.__container__.ownerInjection(); + }, - var CloseElementOpcode = (function (_Opcode8) { - babelHelpers.inherits(CloseElementOpcode, _Opcode8); + /** + Given a fullName return a corresponding instance. + The default behaviour is for lookup to return a singleton instance. + The singleton is scoped to the container, allowing multiple containers + to all have their own locally scoped singletons. + ```javascript + let registry = new Registry(); + let container = registry.container(); + registry.register('api:twitter', Twitter); + let twitter = container.lookup('api:twitter'); + twitter instanceof Twitter; // => true + // by default the container will return singletons + let twitter2 = container.lookup('api:twitter'); + twitter2 instanceof Twitter; // => true + twitter === twitter2; //=> true + ``` + If singletons are not wanted an optional flag can be provided at lookup. + ```javascript + let registry = new Registry(); + let container = registry.container(); + registry.register('api:twitter', Twitter); + let twitter = container.lookup('api:twitter', { singleton: false }); + let twitter2 = container.lookup('api:twitter', { singleton: false }); + twitter === twitter2; //=> false + ``` + @public + @method lookup + @param {String} fullName + @param {Object} options + @return {any} + */ + lookup: function (fullName, options) { + return this.__container__.lookup(fullName, options); + }, - function CloseElementOpcode() { - _Opcode8.apply(this, arguments); - this.type = "close-element"; - } + /** + Given a fullName return the corresponding factory. + @private + @method _lookupFactory + @param {String} fullName + @return {any} + */ + _lookupFactory: function (fullName, options) { + return this.__container__.lookupFactory(fullName, options); + } - CloseElementOpcode.prototype.evaluate = function evaluate(vm) { - vm.stack().closeElement(); - }; + }, _containerProxyMixin[_container.FACTORY_FOR] = function () { + var _container__; - return CloseElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return (_container__ = this.__container__)[_container.FACTORY_FOR].apply(_container__, arguments); + }, _containerProxyMixin[_container.LOOKUP_FACTORY] = function () { + var _container__2; - exports.CloseElementOpcode = CloseElementOpcode; + return (_container__2 = this.__container__)[_container.LOOKUP_FACTORY].apply(_container__2, arguments); + }, _containerProxyMixin._resolveLocalLookupName = function (name, source) { + return this.__container__.registry.expandLocalLookup('component:' + name, { + source: source + }); + }, _containerProxyMixin.willDestroy = function () { + this._super.apply(this, arguments); - var PopElementOpcode = (function (_Opcode9) { - babelHelpers.inherits(PopElementOpcode, _Opcode9); + if (this.__container__) { + _emberMetal.run(this.__container__, 'destroy'); + } + }, _containerProxyMixin); - function PopElementOpcode() { - _Opcode9.apply(this, arguments); - this.type = "pop-element"; - } + if (true) { + containerProxyMixin.factoryFor = function ContainerProxyMixin_factoryFor(fullName) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - PopElementOpcode.prototype.evaluate = function evaluate(vm) { - vm.stack().popElement(); - }; + return this.__container__.factoryFor(fullName, options); + }; + } - return PopElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + exports.default = _emberMetal.Mixin.create(containerProxyMixin); +}); - exports.PopElementOpcode = PopElementOpcode; +/** + Given a name and a source path, resolve the fullName + @private + @method _resolveLocalLookupName + @param {String} fullName + @param {String} source + @return {String} + */ - var StaticAttrOpcode = (function (_Opcode10) { - babelHelpers.inherits(StaticAttrOpcode, _Opcode10); +/** + @private + */ +enifed('ember-runtime/mixins/controller', ['exports', 'ember-metal', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/controller_content_model_alias_deprecation'], function (exports, _emberMetal, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsController_content_model_alias_deprecation) { + 'use strict'; - function StaticAttrOpcode(namespace, name, value) { - _Opcode10.call(this); - this.namespace = namespace; - this.name = name; - this.value = value; - this.type = "static-attr"; - } + /** + @class ControllerMixin + @namespace Ember + @uses Ember.ActionHandler + @private + */ + exports.default = _emberMetal.Mixin.create(_emberRuntimeMixinsAction_handler.default, _emberRuntimeMixinsController_content_model_alias_deprecation.default, { + /* ducktype as a controller */ + isController: true, - StaticAttrOpcode.prototype.evaluate = function evaluate(vm) { - var name = this.name; - var value = this.value; - var namespace = this.namespace; + /** + The object to which actions from the view should be sent. + For example, when a Handlebars template uses the `{{action}}` helper, + it will attempt to send the action to the view's controller's `target`. + By default, the value of the target property is set to the router, and + is injected when a controller is instantiated. This injection is applied + as part of the application's initialization process. In most cases the + `target` property will automatically be set to the logical consumer of + actions for the controller. + @property target + @default null + @public + */ + target: null, - if (namespace) { - vm.stack().setStaticAttributeNS(namespace, name, value); - } else { - vm.stack().setStaticAttribute(name, value); - } - }; + store: null, - StaticAttrOpcode.prototype.toJSON = function toJSON() { - var guid = this._guid; - var type = this.type; - var namespace = this.namespace; - var name = this.name; - var value = this.value; + /** + The controller's current model. When retrieving or modifying a controller's + model, this property should be used instead of the `content` property. + @property model + @public + */ + model: null, - var details = _glimmerUtil.dict(); - if (namespace) { - details["namespace"] = JSON.stringify(namespace); - } - details["name"] = JSON.stringify(name); - details["value"] = JSON.stringify(value); - return { guid: guid, type: type, details: details }; - }; + /** + @private + */ + content: _emberMetal.alias('model') - return StaticAttrOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + }); +}); +enifed('ember-runtime/mixins/controller_content_model_alias_deprecation', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - exports.StaticAttrOpcode = StaticAttrOpcode; + /* + The ControllerContentModelAliasDeprecation mixin is used to provide a useful + deprecation warning when specifying `content` directly on a `Ember.Controller` + (without also specifying `model`). + + Ember versions prior to 1.7 used `model` as an alias of `content`, but due to + much confusion this alias was reversed (so `content` is now an alias of `model). + + This change reduces many caveats with model/content, and also sets a + simple ground rule: Never set a controllers content, rather always set + its model and ember will do the right thing. + + Used internally by Ember in `Ember.Controller`. + */ + exports.default = _emberMetal.Mixin.create({ + /** + @private + Moves `content` to `model` at extend time if a `model` 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) { + // Calling super is only OK here since we KNOW that + // there is another Mixin loaded first. + this._super.apply(this, arguments); - var ModifierOpcode = (function (_Opcode11) { - babelHelpers.inherits(ModifierOpcode, _Opcode11); + var modelSpecified = !!props.model; - function ModifierOpcode(name, manager, args) { - _Opcode11.call(this); - this.name = name; - this.manager = manager; - this.args = args; - this.type = "modifier"; - } + if (props.content && !modelSpecified) { + props.model = props.content; + delete props['content']; - ModifierOpcode.prototype.evaluate = function evaluate(vm) { - var manager = this.manager; + _emberMetal.deprecate('Do not specify `content` on a Controller, use `model` instead.', false, { id: 'ember-runtime.will-merge-mixin', until: '3.0.0' }); + } + } + }); +}); +enifed('ember-runtime/mixins/copyable', ['exports', 'ember-metal', 'ember-runtime/mixins/freezable'], function (exports, _emberMetal, _emberRuntimeMixinsFreezable) { + /** + @module ember + @submodule ember-runtime + */ - var stack = vm.stack(); - var element = stack.constructing; - var updateOperations = stack.updateOperations; + 'use strict'; - var args = this.args.evaluate(vm); - var dynamicScope = vm.dynamicScope(); - var modifier = manager.create(element, args, dynamicScope, updateOperations); - vm.env.scheduleInstallModifier(modifier, manager); - var destructor = manager.getDestructor(modifier); - if (destructor) { - vm.newDestroyable(destructor); - } - vm.updateWith(new UpdateModifierOpcode(manager, modifier, args)); - }; + /** + 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. + + You should generally implement the `copy()` method to return a copy of the + receiver. + + Note that `frozenCopy()` will only work if you also implement + `Ember.Freezable`. + + @class Copyable + @namespace Ember + @since Ember 0.9 + @private + */ + exports.default = _emberMetal.Mixin.create({ + /** + __Required.__ You must implement this method to apply this mixin. + Override to return a copy of the receiver. Default implementation raises + an exception. + @method copy + @param {Boolean} deep if `true`, a deep copy of the object should be made + @return {Object} copy of receiver + @private + */ + copy: null, - ModifierOpcode.prototype.toJSON = function toJSON() { - var guid = this._guid; - var type = this.type; - var name = this.name; - var args = this.args; - - var details = _glimmerUtil.dict(); - details["type"] = JSON.stringify(type); - details["name"] = JSON.stringify(name); - details["args"] = JSON.stringify(args); - return { guid: guid, type: type, details: details }; - }; + /** + If the object implements `Ember.Freezable`, then this will return a new + copy if the object is not frozen and the receiver if the object is frozen. + Raises an exception if you try to call this method on a object that does + not support freezing. + You should use this method whenever you want a copy of a freezable object + since a freezable object can simply return itself without actually + consuming more memory. + @method frozenCopy + @return {Object} copy of receiver or receiver + @deprecated Use `Object.freeze` instead. + @private + */ + frozenCopy: function () { + _emberMetal.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 _emberMetal.get(this, 'isFrozen') ? this : this.copy().freeze(); + } else { + throw new _emberMetal.Error(this + ' does not support freezing'); + } + } + }); +}); +enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/compare', 'require'], function (exports, _emberUtils, _emberMetal, _emberRuntimeCompare, _require) { + /** + @module ember + @submodule ember-runtime + */ - return ModifierOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + // .......................................................... + // HELPERS + // - exports.ModifierOpcode = ModifierOpcode; + 'use strict'; - var UpdateModifierOpcode = (function (_UpdatingOpcode) { - babelHelpers.inherits(UpdateModifierOpcode, _UpdatingOpcode); + var _emberA = undefined; - function UpdateModifierOpcode(manager, modifier, args) { - _UpdatingOpcode.call(this); - this.manager = manager; - this.modifier = modifier; - this.args = args; - this.type = "update-modifier"; - this.tag = args.tag; - this.lastUpdated = args.tag.value(); - } + function emberA() { + return (_emberA || (_emberA = _require.default('ember-runtime/system/native_array').A))(); + } - UpdateModifierOpcode.prototype.evaluate = function evaluate(vm) { - var manager = this.manager; - var modifier = this.modifier; - var tag = this.tag; - var lastUpdated = this.lastUpdated; + var contexts = []; - if (!tag.validate(lastUpdated)) { - vm.env.scheduleUpdateModifier(modifier, manager); - this.lastUpdated = tag.value(); - } - }; + function popCtx() { + return contexts.length === 0 ? {} : contexts.pop(); + } - UpdateModifierOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.args)] - }; - }; + function pushCtx(ctx) { + contexts.push(ctx); + return null; + } - return UpdateModifierOpcode; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + function iter(key, value) { + var valueProvided = arguments.length === 2; - exports.UpdateModifierOpcode = UpdateModifierOpcode; + function i(item) { + var cur = _emberMetal.get(item, key); + return valueProvided ? value === cur : !!cur; + } - var StaticAttribute = (function () { - function StaticAttribute(element, name, value, namespace) { - this.element = element; - this.name = name; - this.value = value; - this.namespace = namespace; - } + return i; + } - StaticAttribute.prototype.flush = function flush(env) { - env.getAppendOperations().setAttribute(this.element, this.name, this.value, this.namespace); - return null; - }; + /** + This mixin defines the common interface implemented by enumerable objects + in Ember. Most of these methods follow the standard Array iteration + API defined up to JavaScript 1.8 (excluding language-specific features that + cannot be emulated in older versions of JavaScript). + + This mixin is applied automatically to the Array class on page load, so you + can use any of these methods on simple arrays. If Array already implements + one of these methods, the mixin will not override them. + + ## Writing Your Own Enumerable + + To make your own custom class enumerable, you need two items: + + 1. You must have a length property. This property should change whenever + the number of items in your enumerable object changes. If you use this + with an `Ember.Object` subclass, you should be sure to change the length + property using `set().` + + 2. You must implement `nextObject().` See documentation. + + Once you have these two methods implemented, apply the `Ember.Enumerable` mixin + to your class and you will be able to enumerate the contents of your object + like any other collection. + + ## Using Ember Enumeration with Other Libraries + + Many other libraries provide some kind of iterator or enumeration like + facility. This is often where the most common API conflicts occur. + Ember's API is designed to be as friendly as possible with other + libraries by implementing only methods that mostly correspond to the + JavaScript 1.8 API. + + @class Enumerable + @namespace Ember + @since Ember 0.9 + @private + */ + var Enumerable = _emberMetal.Mixin.create({ - return StaticAttribute; - })(); + /** + __Required.__ You must implement this method to apply this mixin. + Implement this method to make your class enumerable. + This method will be called repeatedly during enumeration. The index value + will always begin with 0 and increment monotonically. You don't have to + rely on the index value to determine what object to return, but you should + always check the value and start from the beginning when you see the + requested index is 0. + The `previousObject` is the object that was returned from the last call + to `nextObject` for the current iteration. This is a useful way to + manage iteration if you are tracing a linked list, for example. + Finally the context parameter will always contain a hash you can use as + a "scratchpad" to maintain any other state you need in order to iterate + properly. The context object is reused and is not reset between + iterations so make sure you setup the context with a fresh state whenever + the index parameter is 0. + Generally iterators will continue to call `nextObject` until the index + reaches the current length-1. If you run out of data before this + time for some reason, you should simply return undefined. + The default implementation of this method simply looks up the index. + This works great on any Array-like objects. + @method nextObject + @param {Number} index the current index of the iteration + @param {Object} previousObject the value returned by the last call to + `nextObject`. + @param {Object} context a context object you can use to maintain state. + @return {Object} the next object in the iteration or undefined + @private + */ + nextObject: null, - exports.StaticAttribute = StaticAttribute; + /** + Helper method returns the first object from a collection. This is usually + used by bindings and other parts of the framework to extract a single + object if the enumerable contains only one item. + If you override this method, you should implement it so that it will + always return the same value each time it is called. If your enumerable + contains only one object, this method should always return that object. + If your enumerable is empty, this method should return `undefined`. + ```javascript + let arr = ['a', 'b', 'c']; + arr.get('firstObject'); // 'a' + let arr = []; + arr.get('firstObject'); // undefined + ``` + @property firstObject + @return {Object} the object or undefined + @readOnly + @public + */ + firstObject: _emberMetal.computed('[]', function () { + if (_emberMetal.get(this, 'length') === 0) { + return undefined; + } - var DynamicAttribute = (function () { - function DynamicAttribute(element, attributeManager, name, reference, namespace) { - this.element = element; - this.attributeManager = attributeManager; - this.name = name; - this.reference = reference; - this.namespace = namespace; - this.tag = reference.tag; - this.cache = null; - } + // handle generic enumerables + var context = popCtx(); + var ret = this.nextObject(0, null, context); - DynamicAttribute.prototype.patch = function patch(env) { - var element = this.element; - var cache = this.cache; + pushCtx(context); - var value = cache.revalidate(); - if (_glimmerReference.isModified(value)) { - this.attributeManager.updateAttribute(env, element, value, this.namespace); - } - }; + return ret; + }).readOnly(), - DynamicAttribute.prototype.flush = function flush(env) { - var reference = this.reference; - var element = this.element; + /** + Helper method returns the last object from a collection. If your enumerable + contains only one object, this method should always return that object. + If your enumerable is empty, this method should return `undefined`. + ```javascript + let arr = ['a', 'b', 'c']; + arr.get('lastObject'); // 'c' + let arr = []; + arr.get('lastObject'); // undefined + ``` + @property lastObject + @return {Object} the last object or undefined + @readOnly + @public + */ + lastObject: _emberMetal.computed('[]', function () { + var len = _emberMetal.get(this, 'length'); - if (_glimmerReference.isConst(reference)) { - var value = reference.value(); - this.attributeManager.setAttribute(env, element, value, this.namespace); - return null; - } else { - var cache = this.cache = new _glimmerReference.ReferenceCache(reference); - var value = cache.peek(); - this.attributeManager.setAttribute(env, element, value, this.namespace); - return new PatchElementOpcode(this); - } - }; + if (len === 0) { + return undefined; + } - DynamicAttribute.prototype.toJSON = function toJSON() { - var element = this.element; - var namespace = this.namespace; - var name = this.name; - var cache = this.cache; - - var formattedElement = formatElement(element); - var lastValue = cache.peek(); - if (namespace) { - return { - element: formattedElement, - type: 'attribute', - namespace: namespace, - name: name, - lastValue: lastValue - }; - } - return { - element: formattedElement, - type: 'attribute', - namespace: namespace, - name: name, - lastValue: lastValue - }; - }; + var context = popCtx(); + var idx = 0; + var last = null; + var cur = undefined; - return DynamicAttribute; - })(); + do { + last = cur; + cur = this.nextObject(idx++, last, context); + } while (cur !== undefined); - exports.DynamicAttribute = DynamicAttribute; + pushCtx(context); - function formatElement(element) { - return JSON.stringify('<' + element.tagName.toLowerCase() + ' />'); - } + return last; + }).readOnly(), - var DynamicAttrNSOpcode = (function (_Opcode12) { - babelHelpers.inherits(DynamicAttrNSOpcode, _Opcode12); + /** + Returns `true` if the passed object can be found in the receiver. The + default version will iterate through the enumerable until the object + is found. You may want to override this with a more efficient version. + ```javascript + let arr = ['a', 'b', 'c']; + arr.contains('a'); // true + arr.contains('z'); // false + ``` + @method contains + @deprecated Use `Enumerable#includes` instead. See http://emberjs.com/deprecations/v2.x#toc_enumerable-contains + @param {Object} obj The object to search for. + @return {Boolean} `true` if object is found in enumerable. + @public + */ + contains: function (obj) { + _emberMetal.deprecate('`Enumerable#contains` is deprecated, use `Enumerable#includes` instead.', false, { id: 'ember-runtime.enumerable-contains', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x#toc_enumerable-contains' }); - function DynamicAttrNSOpcode(name, namespace, isTrusting) { - _Opcode12.call(this); - this.name = name; - this.namespace = namespace; - this.isTrusting = isTrusting; - this.type = "dynamic-attr"; - } + var found = this.find(function (item) { + return item === obj; + }); - DynamicAttrNSOpcode.prototype.evaluate = function evaluate(vm) { - var name = this.name; - var namespace = this.namespace; - var isTrusting = this.isTrusting; + return found !== undefined; + }, - var reference = vm.frame.getOperand(); - vm.stack().setDynamicAttributeNS(namespace, name, reference, isTrusting); - }; + /** + Iterates through the enumerable, calling the passed function on each + item. This method corresponds to the `forEach()` method defined in + JavaScript 1.6. + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(item, index, enumerable); + ``` + - `item` is the current item in the iteration. + - `index` is the current index in the iteration. + - `enumerable` is the enumerable object itself. + Note that in addition to a callback, you can also pass an optional target + object that will be set as `this` on the context. This is a good way + 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 + @public + */ + forEach: function (callback, target) { + if (typeof callback !== 'function') { + throw new TypeError(); + } - DynamicAttrNSOpcode.prototype.toJSON = function toJSON() { - var guid = this._guid; - var type = this.type; - var name = this.name; - var namespace = this.namespace; - - var details = _glimmerUtil.dict(); - details["name"] = JSON.stringify(name); - details["value"] = "$OPERAND"; - if (namespace) { - details["namespace"] = JSON.stringify(namespace); - } - return { guid: guid, type: type, details: details }; - }; + var context = popCtx(); + var len = _emberMetal.get(this, 'length'); + var last = null; - return DynamicAttrNSOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + if (target === undefined) { + target = null; + } - exports.DynamicAttrNSOpcode = DynamicAttrNSOpcode; + for (var idx = 0; idx < len; idx++) { + var next = this.nextObject(idx, last, context); + callback.call(target, next, idx, this); + last = next; + } - var DynamicAttrOpcode = (function (_Opcode13) { - babelHelpers.inherits(DynamicAttrOpcode, _Opcode13); + last = null; + context = pushCtx(context); - function DynamicAttrOpcode(name, isTrusting) { - _Opcode13.call(this); - this.name = name; - this.isTrusting = isTrusting; - this.type = "dynamic-attr"; - } + return this; + }, - DynamicAttrOpcode.prototype.evaluate = function evaluate(vm) { - var name = this.name; - var isTrusting = this.isTrusting; + /** + Alias for `mapBy` + @method getEach + @param {String} key name of the property + @return {Array} The mapped array. + @public + */ + getEach: _emberMetal.aliasMethod('mapBy'), - var reference = vm.frame.getOperand(); - vm.stack().setDynamicAttribute(name, reference, isTrusting); - }; + /** + Sets the value on the named property for each member. This is more + ergonomic than using other methods defined on this helper. If the object + implements Ember.Observable, the value will be changed to `set(),` otherwise + it will be set directly. `null` objects are skipped. + @method setEach + @param {String} key The key to set + @param {Object} value The object to set + @return {Object} receiver + @public + */ + setEach: function (key, value) { + return this.forEach(function (item) { + return _emberMetal.set(item, key, value); + }); + }, - DynamicAttrOpcode.prototype.toJSON = function toJSON() { - var guid = this._guid; - var type = this.type; - var name = this.name; + /** + Maps all of the items in the enumeration to another value, returning + a new array. This method corresponds to `map()` defined in JavaScript 1.6. + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(item, index, enumerable); + ``` + - `item` is the current item in the iteration. + - `index` is the current index in the iteration. + - `enumerable` is the enumerable object itself. + It should return the mapped value. + Note that in addition to a callback, you can also pass an optional target + object that will be set as `this` on the context. This is a good way + to give your iterator function access to the current object. + @method map + @param {Function} callback The callback to execute + @param {Object} [target] The target object to use + @return {Array} The mapped array. + @public + */ + map: function (callback, target) { + var ret = emberA(); - var details = _glimmerUtil.dict(); - details["name"] = JSON.stringify(name); - details["value"] = "$OPERAND"; - return { guid: guid, type: type, details: details }; - }; + this.forEach(function (x, idx, i) { + return ret[idx] = callback.call(target, x, idx, i); + }); - return DynamicAttrOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return ret; + }, - exports.DynamicAttrOpcode = DynamicAttrOpcode; + /** + Similar to map, this specialized function returns the value of the named + property on all items in the enumeration. + @method mapBy + @param {String} key name of the property + @return {Array} The mapped array. + @public + */ + mapBy: function (key) { + return this.map(function (next) { + return _emberMetal.get(next, key); + }); + }, - var PatchElementOpcode = (function (_UpdatingOpcode2) { - babelHelpers.inherits(PatchElementOpcode, _UpdatingOpcode2); + /** + Returns an array with all of the items in the enumeration that the passed + function returns true for. This method corresponds to `filter()` defined in + JavaScript 1.6. + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(item, index, enumerable); + ``` + - `item` is the current item in the iteration. + - `index` is the current index in the iteration. + - `enumerable` is the enumerable object itself. + It should return `true` to include the item in the results, `false` + otherwise. + Note that in addition to a callback, you can also pass an optional target + object that will be set as `this` on the context. This is a good way + to give your iterator function access to the current object. + @method filter + @param {Function} callback The callback to execute + @param {Object} [target] The target object to use + @return {Array} A filtered array. + @public + */ + filter: function (callback, target) { + var ret = emberA(); - function PatchElementOpcode(operation) { - _UpdatingOpcode2.call(this); - this.type = "patch-element"; - this.tag = operation.tag; - this.operation = operation; + this.forEach(function (x, idx, i) { + if (callback.call(target, x, idx, i)) { + ret.push(x); } + }); - PatchElementOpcode.prototype.evaluate = function evaluate(vm) { - this.operation.patch(vm.env); - }; - - PatchElementOpcode.prototype.toJSON = function toJSON() { - var _guid = this._guid; - var type = this.type; - var operation = this.operation; - - return { - guid: _guid, - type: type, - details: operation.toJSON() - }; - }; - - return PatchElementOpcode; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + return ret; + }, - exports.PatchElementOpcode = PatchElementOpcode; + /** + Returns an array with all of the items in the enumeration where the passed + function returns false. This method is the inverse of filter(). + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(item, index, enumerable); + ``` + - *item* is the current item in the iteration. + - *index* is the current index in the iteration + - *enumerable* is the enumerable object itself. + It should return a falsey value to include the item in the results. + Note that in addition to a callback, you can also pass an optional target + object that will be set as "this" on the context. This is a good way + to give your iterator function access to the current object. + @method reject + @param {Function} callback The callback to execute + @param {Object} [target] The target object to use + @return {Array} A rejected array. + @public + */ + reject: function (callback, target) { + return this.filter(function () { + return !callback.apply(target, arguments); + }); + }, - var CommentOpcode = (function (_Opcode14) { - babelHelpers.inherits(CommentOpcode, _Opcode14); + /** + Returns an array with just the items with the matched property. You + can pass an optional second argument with the target value. Otherwise + this will match any property that evaluates to `true`. + @method filterBy + @param {String} key the property to test + @param {*} [value] optional value to test against. + @return {Array} filtered array + @public + */ + filterBy: function (key, value) { + return this.filter(iter.apply(this, arguments)); + }, - function CommentOpcode(comment) { - _Opcode14.call(this); - this.comment = comment; - this.type = "comment"; - } + /** + Returns an array with the items that do not have truthy values for + key. You can pass an optional second argument with the target value. Otherwise + this will match any property that evaluates to false. + @method rejectBy + @param {String} key the property to test + @param {String} [value] optional value to test against. + @return {Array} rejected array + @public + */ + rejectBy: function (key, value) { + var exactValue = function (item) { + return _emberMetal.get(item, key) === value; + }; + var hasValue = function (item) { + return !!_emberMetal.get(item, key); + }; + var use = arguments.length === 2 ? exactValue : hasValue; - CommentOpcode.prototype.evaluate = function evaluate(vm) { - vm.stack().appendComment(this.comment); - }; + return this.reject(use); + }, - CommentOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.comment)] - }; - }; + /** + Returns the first item in the array for which the callback returns true. + This method works similar to the `filter()` method defined in JavaScript 1.6 + except that it will stop working on the array once a match is found. + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(item, index, enumerable); + ``` + - `item` is the current item in the iteration. + - `index` is the current index in the iteration. + - `enumerable` is the enumerable object itself. + It should return the `true` to include the item in the results, `false` + otherwise. + Note that in addition to a callback, you can also pass an optional target + object that will be set as `this` on the context. This is a good way + to give your iterator function access to the current object. + @method find + @param {Function} callback The callback to execute + @param {Object} [target] The target object to use + @return {Object} Found item or `undefined`. + @public + */ + find: function (callback, target) { + var len = _emberMetal.get(this, 'length'); - return CommentOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + if (target === undefined) { + target = null; + } - exports.CommentOpcode = CommentOpcode; -}); + var context = popCtx(); + var found = false; + var last = null; + var next = undefined, + ret = undefined; -enifed('glimmer-runtime/lib/compiled/opcodes/lists', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-util', 'glimmer-reference'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerUtil, _glimmerReference) { - 'use strict'; + for (var idx = 0; idx < len && !found; idx++) { + next = this.nextObject(idx, last, context); - var IterablePresenceReference = (function () { - function IterablePresenceReference(artifacts) { - this.tag = artifacts.tag; - this.artifacts = artifacts; + found = callback.call(target, next, idx, this); + if (found) { + ret = next; } - IterablePresenceReference.prototype.value = function value() { - return !this.artifacts.isEmpty(); - }; - - return IterablePresenceReference; - })(); - - var PutIteratorOpcode = (function (_Opcode) { - babelHelpers.inherits(PutIteratorOpcode, _Opcode); + last = next; + } - function PutIteratorOpcode() { - _Opcode.apply(this, arguments); - this.type = "put-iterator"; - } + next = last = null; + context = pushCtx(context); - PutIteratorOpcode.prototype.evaluate = function evaluate(vm) { - var listRef = vm.frame.getOperand(); - var args = vm.frame.getArgs(); - var iterable = vm.env.iterableFor(listRef, args); - var iterator = new _glimmerReference.ReferenceIterator(iterable); - vm.frame.setIterator(iterator); - vm.frame.setCondition(new IterablePresenceReference(iterator.artifacts)); - }; + return ret; + }, - return PutIteratorOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + Returns the first item with a property matching the passed value. You + can pass an optional second argument with the target value. Otherwise + this will match any property that evaluates to `true`. + This method works much like the more generic `find()` method. + @method findBy + @param {String} key the property to test + @param {String} [value] optional value to test against. + @return {Object} found item or `undefined` + @public + */ + findBy: function (key, value) { + return this.find(iter.apply(this, arguments)); + }, - exports.PutIteratorOpcode = PutIteratorOpcode; + /** + Returns `true` if the passed function returns true for every item in the + enumeration. This corresponds with the `every()` method in JavaScript 1.6. + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(item, index, enumerable); + ``` + - `item` is the current item in the iteration. + - `index` is the current index in the iteration. + - `enumerable` is the enumerable object itself. + It should return the `true` or `false`. + Note that in addition to a callback, you can also pass an optional target + object that will be set as `this` on the context. This is a good way + to give your iterator function access to the current object. + Example Usage: + ```javascript + if (people.every(isEngineer)) { + Paychecks.addBigBonus(); + } + ``` + @method every + @param {Function} callback The callback to execute + @param {Object} [target] The target object to use + @return {Boolean} + @public + */ + every: function (callback, target) { + return !this.find(function (x, idx, i) { + return !callback.call(target, x, idx, i); + }); + }, - var EnterListOpcode = (function (_Opcode2) { - babelHelpers.inherits(EnterListOpcode, _Opcode2); + /** + Returns `true` if the passed property resolves to the value of the second + argument for all items in the enumerable. This method is often simpler/faster + than using a callback. + @method isEvery + @param {String} key the property to test + @param {String} [value] optional value to test against. Defaults to `true` + @return {Boolean} + @since 1.3.0 + @public + */ + isEvery: function (key, value) { + return this.every(iter.apply(this, arguments)); + }, - function EnterListOpcode(start, end) { - _Opcode2.call(this); - this.type = "enter-list"; - this.slice = new _glimmerUtil.ListSlice(start, end); - } + /** + Returns `true` if the passed function returns true for any item in the + enumeration. This corresponds with the `some()` method in JavaScript 1.6. + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(item, index, enumerable); + ``` + - `item` is the current item in the iteration. + - `index` is the current index in the iteration. + - `enumerable` is the enumerable object itself. + It should return the `true` to include the item in the results, `false` + otherwise. + Note that in addition to a callback, you can also pass an optional target + object that will be set as `this` on the context. This is a good way + to give your iterator function access to the current object. + Usage Example: + ```javascript + if (people.any(isManager)) { + Paychecks.addBiggerBonus(); + } + ``` + @method any + @param {Function} callback The callback to execute + @param {Object} [target] The target object to use + @return {Boolean} `true` if the passed function returns `true` for any item + @public + */ + any: function (callback, target) { + var len = _emberMetal.get(this, 'length'); + var context = popCtx(); + var found = false; + var last = null; + var next = undefined; - EnterListOpcode.prototype.evaluate = function evaluate(vm) { - vm.enterList(this.slice); - }; + if (target === undefined) { + target = null; + } - EnterListOpcode.prototype.toJSON = function toJSON() { - var slice = this.slice; - var type = this.type; - var _guid = this._guid; + for (var idx = 0; idx < len && !found; idx++) { + next = this.nextObject(idx, last, context); + found = callback.call(target, next, idx, this); + last = next; + } - var begin = slice.head(); - var end = slice.tail(); - return { - guid: _guid, - type: type, - args: [JSON.stringify(begin.inspect()), JSON.stringify(end.inspect())] - }; - }; + next = last = null; + context = pushCtx(context); + return found; + }, - return EnterListOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + Returns `true` if the passed property resolves to the value of the second + argument for any item in the enumerable. This method is often simpler/faster + than using a callback. + @method isAny + @param {String} key the property to test + @param {String} [value] optional value to test against. Defaults to `true` + @return {Boolean} + @since 1.3.0 + @public + */ + isAny: function (key, value) { + return this.any(iter.apply(this, arguments)); + }, - exports.EnterListOpcode = EnterListOpcode; + /** + This will combine the values of the enumerator into a single value. It + is a useful way to collect a summary value from an enumeration. This + corresponds to the `reduce()` method defined in JavaScript 1.8. + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(previousValue, item, index, enumerable); + ``` + - `previousValue` is the value returned by the last call to the iterator. + - `item` is the current item in the iteration. + - `index` is the current index in the iteration. + - `enumerable` is the enumerable object itself. + Return the new cumulative value. + In addition to the callback you can also pass an `initialValue`. An error + will be raised if you do not pass an initial value and the enumerator is + empty. + Note that unlike the other methods, this method does not allow you to + pass a target object to set as this for the callback. It's part of the + spec. Sorry. + @method reduce + @param {Function} callback The callback to execute + @param {Object} initialValue Initial value for the reduce + @param {String} reducerProperty internal use only. + @return {Object} The reduced value. + @public + */ + reduce: function (callback, initialValue, reducerProperty) { + if (typeof callback !== 'function') { + throw new TypeError(); + } - var ExitListOpcode = (function (_Opcode3) { - babelHelpers.inherits(ExitListOpcode, _Opcode3); + var ret = initialValue; - function ExitListOpcode() { - _Opcode3.apply(this, arguments); - this.type = "exit-list"; - } + this.forEach(function (item, i) { + ret = callback(ret, item, i, this, reducerProperty); + }, this); - ExitListOpcode.prototype.evaluate = function evaluate(vm) { - vm.exitList(); - }; + return ret; + }, - return ExitListOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + Invokes the named method on every object in the receiver that + implements it. This method corresponds to the implementation in + Prototype 1.6. + @method invoke + @param {String} methodName the name of the method + @param {Object...} args optional arguments to pass as well. + @return {Array} return values from calling invoke. + @public + */ + invoke: function (methodName) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } - exports.ExitListOpcode = ExitListOpcode; + var ret = emberA(); - var EnterWithKeyOpcode = (function (_Opcode4) { - babelHelpers.inherits(EnterWithKeyOpcode, _Opcode4); + this.forEach(function (x, idx) { + var method = x && x[methodName]; - function EnterWithKeyOpcode(start, end) { - _Opcode4.call(this); - this.type = "enter-with-key"; - this.slice = new _glimmerUtil.ListSlice(start, end); + if ('function' === typeof method) { + ret[idx] = args ? method.apply(x, args) : x[methodName](); } + }, this); - EnterWithKeyOpcode.prototype.evaluate = function evaluate(vm) { - vm.enterWithKey(vm.frame.getKey(), this.slice); - }; + return ret; + }, - EnterWithKeyOpcode.prototype.toJSON = function toJSON() { - var slice = this.slice; - var _guid = this._guid; - var type = this.type; + /** + Simply converts the enumerable into a genuine array. The order is not + guaranteed. Corresponds to the method implemented by Prototype. + @method toArray + @return {Array} the enumerable as an array. + @public + */ + toArray: function () { + var ret = emberA(); - var begin = slice.head(); - var end = slice.tail(); - return { - guid: _guid, - type: type, - args: [JSON.stringify(begin.inspect()), JSON.stringify(end.inspect())] - }; - }; + this.forEach(function (o, idx) { + return ret[idx] = o; + }); - return EnterWithKeyOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return ret; + }, - exports.EnterWithKeyOpcode = EnterWithKeyOpcode; + /** + Returns a copy of the array with all `null` and `undefined` elements removed. + ```javascript + let arr = ['a', null, 'c', undefined]; + arr.compact(); // ['a', 'c'] + ``` + @method compact + @return {Array} the array without null and undefined elements. + @public + */ + compact: function () { + return this.filter(function (value) { + return value != null; + }); + }, - var TRUE_REF = new _glimmerReference.ConstReference(true); - var FALSE_REF = new _glimmerReference.ConstReference(false); + /** + Returns a new enumerable that excludes the passed value. The default + implementation returns an array regardless of the receiver type. + If the receiver does not contain the value it returns the original enumerable. + ```javascript + let arr = ['a', 'b', 'a', 'c']; + arr.without('a'); // ['b', 'c'] + ``` + @method without + @param {Object} value + @return {Ember.Enumerable} + @public + */ + without: function (value) { + if (!this.includes(value)) { + return this; // nothing to do + } - var NextIterOpcode = (function (_Opcode5) { - babelHelpers.inherits(NextIterOpcode, _Opcode5); + var ret = emberA(); - function NextIterOpcode(end) { - _Opcode5.call(this); - this.type = "next-iter"; - this.end = end; + this.forEach(function (k) { + // SameValueZero comparison (NaN !== NaN) + if (!(k === value || k !== k && value !== value)) { + ret[ret.length] = k; } + }); - NextIterOpcode.prototype.evaluate = function evaluate(vm) { - var item = vm.frame.getIterator().next(); - if (item) { - vm.frame.setCondition(TRUE_REF); - vm.frame.setKey(item.key); - vm.frame.setOperand(item.value); - vm.frame.setArgs(_glimmerRuntimeLibCompiledExpressionsArgs.EvaluatedArgs.positional([item.value, item.memo])); - } else { - vm.frame.setCondition(FALSE_REF); - vm.goto(this.end); - } - }; - - return NextIterOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); - - exports.NextIterOpcode = NextIterOpcode; -}); - -enifed('glimmer-runtime/lib/compiled/opcodes/partial', ['exports', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/opcodes/vm'], function (exports, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledOpcodesVm) { - 'use strict'; + return ret; + }, - var PutDynamicPartialDefinitionOpcode = (function (_Opcode) { - babelHelpers.inherits(PutDynamicPartialDefinitionOpcode, _Opcode); + /** + Returns a new enumerable that contains only unique values. The default + implementation returns an array regardless of the receiver type. + ```javascript + let arr = ['a', 'a', 'b', 'b']; + arr.uniq(); // ['a', 'b'] + ``` + This only works on primitive data types, e.g. Strings, Numbers, etc. + @method uniq + @return {Ember.Enumerable} + @public + */ + uniq: function () { + var ret = emberA(); - function PutDynamicPartialDefinitionOpcode(symbolTable) { - _Opcode.call(this); - this.symbolTable = symbolTable; - this.type = "put-dynamic-partial-definition"; + this.forEach(function (k) { + if (ret.indexOf(k) < 0) { + ret.push(k); } + }); - PutDynamicPartialDefinitionOpcode.prototype.evaluate = function evaluate(vm) { - var env = vm.env; - var symbolTable = this.symbolTable; - - function lookupPartial(name) { - var normalized = String(name); - if (!env.hasPartial(normalized, symbolTable)) { - throw new Error('Could not find a partial named "' + normalized + '"'); - } - return env.lookupPartial(normalized, symbolTable); - } - var reference = _glimmerReference.map(vm.frame.getOperand(), lookupPartial); - var cache = _glimmerReference.isConst(reference) ? undefined : new _glimmerReference.ReferenceCache(reference); - var definition = cache ? cache.peek() : reference.value(); - vm.frame.setImmediate(definition); - if (cache) { - vm.updateWith(new _glimmerRuntimeLibCompiledOpcodesVm.Assert(cache)); - } - }; - - PutDynamicPartialDefinitionOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$OPERAND"] - }; - }; - - return PutDynamicPartialDefinitionOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); - - exports.PutDynamicPartialDefinitionOpcode = PutDynamicPartialDefinitionOpcode; - - var PutPartialDefinitionOpcode = (function (_Opcode2) { - babelHelpers.inherits(PutPartialDefinitionOpcode, _Opcode2); + return ret; + }, - function PutPartialDefinitionOpcode(definition) { - _Opcode2.call(this); - this.definition = definition; - this.type = "put-partial-definition"; - } + /** + This property will trigger anytime the enumerable's content changes. + You can observe this property to be notified of changes to the enumerable's + content. + For plain enumerables, this property is read only. `Array` overrides + this method. + @property [] + @type Array + @return this + @private + */ + '[]': _emberMetal.computed({ + get: function (key) { + return this; + } + }), - PutPartialDefinitionOpcode.prototype.evaluate = function evaluate(vm) { - vm.frame.setImmediate(this.definition); - }; + // .......................................................... + // ENUMERABLE OBSERVERS + // - PutPartialDefinitionOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.definition.name)] - }; - }; + /** + Registers an enumerable observer. Must implement `Ember.EnumerableObserver` + mixin. + @method addEnumerableObserver + @param {Object} target + @param {Object} [opts] + @return this + @private + */ + addEnumerableObserver: function (target, opts) { + var willChange = opts && opts.willChange || 'enumerableWillChange'; + var didChange = opts && opts.didChange || 'enumerableDidChange'; + var hasObservers = _emberMetal.get(this, 'hasEnumerableObservers'); - return PutPartialDefinitionOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + if (!hasObservers) { + _emberMetal.propertyWillChange(this, 'hasEnumerableObservers'); + } - exports.PutPartialDefinitionOpcode = PutPartialDefinitionOpcode; + _emberMetal.addListener(this, '@enumerable:before', target, willChange); + _emberMetal.addListener(this, '@enumerable:change', target, didChange); - var EvaluatePartialOpcode = (function (_Opcode3) { - babelHelpers.inherits(EvaluatePartialOpcode, _Opcode3); + if (!hasObservers) { + _emberMetal.propertyDidChange(this, 'hasEnumerableObservers'); + } - function EvaluatePartialOpcode(symbolTable) { - _Opcode3.call(this); - this.symbolTable = symbolTable; - this.type = "evaluate-partial"; - this.cache = _glimmerUtil.dict(); - } + return this; + }, - EvaluatePartialOpcode.prototype.evaluate = function evaluate(vm) { - var _vm$frame$getImmediate = vm.frame.getImmediate(); + /** + Removes a registered enumerable observer. + @method removeEnumerableObserver + @param {Object} target + @param {Object} [opts] + @return this + @private + */ + removeEnumerableObserver: function (target, opts) { + var willChange = opts && opts.willChange || 'enumerableWillChange'; + var didChange = opts && opts.didChange || 'enumerableDidChange'; + var hasObservers = _emberMetal.get(this, 'hasEnumerableObservers'); - var template = _vm$frame$getImmediate.template; + if (hasObservers) { + _emberMetal.propertyWillChange(this, 'hasEnumerableObservers'); + } - var block = this.cache[template.id]; - if (!block) { - block = template.asPartial(this.symbolTable); - } - vm.invokePartial(block); - }; + _emberMetal.removeListener(this, '@enumerable:before', target, willChange); + _emberMetal.removeListener(this, '@enumerable:change', target, didChange); - EvaluatePartialOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$OPERAND"] - }; - }; + if (hasObservers) { + _emberMetal.propertyDidChange(this, 'hasEnumerableObservers'); + } - return EvaluatePartialOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return this; + }, - exports.EvaluatePartialOpcode = EvaluatePartialOpcode; -}); + /** + Becomes true whenever the array currently has observers watching changes + on the array. + @property hasEnumerableObservers + @type Boolean + @private + */ + hasEnumerableObservers: _emberMetal.computed(function () { + return _emberMetal.hasListeners(this, '@enumerable:change') || _emberMetal.hasListeners(this, '@enumerable:before'); + }), -enifed('glimmer-runtime/lib/compiled/opcodes/vm', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/references', 'glimmer-reference', 'glimmer-util'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibReferences, _glimmerReference, _glimmerUtil) { - 'use strict'; + /** + Invoke this method just before the contents of your enumerable will + change. You can either omit the parameters completely or pass the objects + to be removed or added if available or just a count. + @method enumerableContentWillChange + @param {Ember.Enumerable|Number} removing An enumerable of the objects to + be removed or the number of items to be removed. + @param {Ember.Enumerable|Number} adding An enumerable of the objects to be + added or the number of items to be added. + @chainable + @private + */ + enumerableContentWillChange: function (removing, adding) { + var removeCnt = undefined, + addCnt = undefined, + hasDelta = undefined; - var PushChildScopeOpcode = (function (_Opcode) { - babelHelpers.inherits(PushChildScopeOpcode, _Opcode); + if ('number' === typeof removing) { + removeCnt = removing; + } else if (removing) { + removeCnt = _emberMetal.get(removing, 'length'); + } else { + removeCnt = removing = -1; + } - function PushChildScopeOpcode() { - _Opcode.apply(this, arguments); - this.type = "push-child-scope"; - } + if ('number' === typeof adding) { + addCnt = adding; + } else if (adding) { + addCnt = _emberMetal.get(adding, 'length'); + } else { + addCnt = adding = -1; + } - PushChildScopeOpcode.prototype.evaluate = function evaluate(vm) { - vm.pushChildScope(); - }; + hasDelta = addCnt < 0 || removeCnt < 0 || addCnt - removeCnt !== 0; - return PushChildScopeOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + if (removing === -1) { + removing = null; + } - exports.PushChildScopeOpcode = PushChildScopeOpcode; + if (adding === -1) { + adding = null; + } - var PopScopeOpcode = (function (_Opcode2) { - babelHelpers.inherits(PopScopeOpcode, _Opcode2); + _emberMetal.propertyWillChange(this, '[]'); - function PopScopeOpcode() { - _Opcode2.apply(this, arguments); - this.type = "pop-scope"; - } + if (hasDelta) { + _emberMetal.propertyWillChange(this, 'length'); + } - PopScopeOpcode.prototype.evaluate = function evaluate(vm) { - vm.popScope(); - }; + _emberMetal.sendEvent(this, '@enumerable:before', [this, removing, adding]); - return PopScopeOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return this; + }, - exports.PopScopeOpcode = PopScopeOpcode; + /** + Invoke this method when the contents of your enumerable has changed. + This will notify any observers watching for content changes. If you are + implementing an ordered enumerable (such as an array), also pass the + start and end values where the content changed so that it can be used to + notify range observers. + @method enumerableContentDidChange + @param {Ember.Enumerable|Number} removing An enumerable of the objects to + be removed or the number of items to be removed. + @param {Ember.Enumerable|Number} adding An enumerable of the objects to + be added or the number of items to be added. + @chainable + @private + */ + enumerableContentDidChange: function (removing, adding) { + var removeCnt = undefined, + addCnt = undefined, + hasDelta = undefined; - var PushDynamicScopeOpcode = (function (_Opcode3) { - babelHelpers.inherits(PushDynamicScopeOpcode, _Opcode3); + if ('number' === typeof removing) { + removeCnt = removing; + } else if (removing) { + removeCnt = _emberMetal.get(removing, 'length'); + } else { + removeCnt = removing = -1; + } - function PushDynamicScopeOpcode() { - _Opcode3.apply(this, arguments); - this.type = "push-dynamic-scope"; - } + if ('number' === typeof adding) { + addCnt = adding; + } else if (adding) { + addCnt = _emberMetal.get(adding, 'length'); + } else { + addCnt = adding = -1; + } - PushDynamicScopeOpcode.prototype.evaluate = function evaluate(vm) { - vm.pushDynamicScope(); - }; + hasDelta = addCnt < 0 || removeCnt < 0 || addCnt - removeCnt !== 0; - return PushDynamicScopeOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + if (removing === -1) { + removing = null; + } - exports.PushDynamicScopeOpcode = PushDynamicScopeOpcode; + if (adding === -1) { + adding = null; + } - var PopDynamicScopeOpcode = (function (_Opcode4) { - babelHelpers.inherits(PopDynamicScopeOpcode, _Opcode4); + _emberMetal.sendEvent(this, '@enumerable:change', [this, removing, adding]); - function PopDynamicScopeOpcode() { - _Opcode4.apply(this, arguments); - this.type = "pop-dynamic-scope"; - } + if (hasDelta) { + _emberMetal.propertyDidChange(this, 'length'); + } - PopDynamicScopeOpcode.prototype.evaluate = function evaluate(vm) { - vm.popDynamicScope(); - }; + _emberMetal.propertyDidChange(this, '[]'); - return PopDynamicScopeOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return this; + }, - exports.PopDynamicScopeOpcode = PopDynamicScopeOpcode; + /** + Converts the enumerable into an array and sorts by the keys + specified in the argument. + 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 + @public + */ + sortBy: function () { + var sortKeys = arguments; - var PutNullOpcode = (function (_Opcode5) { - babelHelpers.inherits(PutNullOpcode, _Opcode5); + return this.toArray().sort(function (a, b) { + for (var i = 0; i < sortKeys.length; i++) { + var key = sortKeys[i]; + var propA = _emberMetal.get(a, key); + var propB = _emberMetal.get(b, key); + // return 1 or -1 else continue to the next sortKey + var compareValue = _emberRuntimeCompare.default(propA, propB); - function PutNullOpcode() { - _Opcode5.apply(this, arguments); - this.type = "put-null"; + if (compareValue) { + return compareValue; + } } + return 0; + }); + }, - PutNullOpcode.prototype.evaluate = function evaluate(vm) { - vm.frame.setOperand(_glimmerRuntimeLibReferences.NULL_REFERENCE); - }; - - return PutNullOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); - - exports.PutNullOpcode = PutNullOpcode; + /** + 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 + let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }]; + arr.uniqBy('value'); // [{ value: 'a' }, { value: 'b' }] + ``` + @method uniqBy + @return {Ember.Enumerable} + @public + */ - var PutValueOpcode = (function (_Opcode6) { - babelHelpers.inherits(PutValueOpcode, _Opcode6); + uniqBy: function (key) { + var ret = emberA(); + var seen = new _emberUtils.EmptyObject(); - function PutValueOpcode(expression) { - _Opcode6.call(this); - this.expression = expression; - this.type = "put-value"; + this.forEach(function (item) { + var guid = _emberUtils.guidFor(_emberMetal.get(item, key)); + if (!(guid in seen)) { + seen[guid] = true; + ret.push(item); } + }); - PutValueOpcode.prototype.evaluate = function evaluate(vm) { - vm.evaluateOperand(this.expression); - }; - - PutValueOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [this.expression.toJSON()] - }; - }; - - return PutValueOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return ret; + }, - exports.PutValueOpcode = PutValueOpcode; + /** + 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) { + _emberMetal.assert('Enumerable#includes cannot accept a second argument "startAt" as enumerable items are unordered.', arguments.length === 1); - var PutArgsOpcode = (function (_Opcode7) { - babelHelpers.inherits(PutArgsOpcode, _Opcode7); + var len = _emberMetal.get(this, 'length'); + var idx = undefined, + next = undefined; + var last = null; + var found = false; - function PutArgsOpcode(args) { - _Opcode7.call(this); - this.args = args; - this.type = "put-args"; - } + var context = popCtx(); - PutArgsOpcode.prototype.evaluate = function evaluate(vm) { - vm.evaluateArgs(this.args); - }; + for (idx = 0; idx < len && !found; idx++) { + next = this.nextObject(idx, last, context); - PutArgsOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - details: { - "positional": this.args.positional.toJSON(), - "named": this.args.named.toJSON() - } - }; - }; + found = obj === next || obj !== obj && next !== next; - return PutArgsOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + last = next; + } - exports.PutArgsOpcode = PutArgsOpcode; + next = last = null; + context = pushCtx(context); - var BindPositionalArgsOpcode = (function (_Opcode8) { - babelHelpers.inherits(BindPositionalArgsOpcode, _Opcode8); + return found; + } + }); - function BindPositionalArgsOpcode(names, symbols) { - _Opcode8.call(this); - this.names = names; - this.symbols = symbols; - this.type = "bind-positional-args"; - } + exports.default = Enumerable; +}); +enifed('ember-runtime/mixins/evented', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - BindPositionalArgsOpcode.create = function create(block) { - var names = block.locals; - var symbols = names.map(function (name) { - return block.symbolTable.getLocal(name); - }); - return new this(names, symbols); - }; + /** + @module ember + @submodule ember-runtime + */ - BindPositionalArgsOpcode.prototype.evaluate = function evaluate(vm) { - vm.bindPositionalArgs(this.symbols); - }; + /** + This mixin allows for Ember objects to subscribe to and emit events. + + ```javascript + App.Person = Ember.Object.extend(Ember.Evented, { + greet: function() { + // ... + this.trigger('greet'); + } + }); + + var person = App.Person.create(); + + person.on('greet', function() { + console.log('Our person has greeted'); + }); + + person.greet(); + + // outputs: 'Our person has greeted' + ``` + + You can also chain multiple event subscriptions: + + ```javascript + person.on('greet', function() { + console.log('Our person has greeted'); + }).one('greet', function() { + console.log('Offer one-time special'); + }).off('event', this, forgetThis); + ``` + + @class Evented + @namespace Ember + @public + */ + exports.default = _emberMetal.Mixin.create({ - BindPositionalArgsOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ['[' + this.names.map(function (name) { - return JSON.stringify(name); - }).join(", ") + ']'] - }; - }; + /** + Subscribes to a named event with given function. + ```javascript + person.on('didLoad', function() { + // fired once the person has loaded + }); + ``` + An optional target can be passed in as the 2nd argument that will + be set as the "this" for the callback. This is a good way to give your + function access to the object triggering the event. When the target + parameter is used the callback becomes the third argument. + @method on + @param {String} name The name of the event + @param {Object} [target] The "this" binding for the callback + @param {Function} method The callback to execute + @return this + @public + */ + on: function (name, target, method) { + _emberMetal.addListener(this, name, target, method); + return this; + }, - return BindPositionalArgsOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + Subscribes a function to a named event and then cancels the subscription + after the first time the event is triggered. It is good to use ``one`` when + you only care about the first time an event has taken place. + This function takes an optional 2nd argument that will become the "this" + value for the callback. If this argument is passed then the 3rd argument + becomes the function. + @method one + @param {String} name The name of the event + @param {Object} [target] The "this" binding for the callback + @param {Function} method The callback to execute + @return this + @public + */ + one: function (name, target, method) { + if (!method) { + method = target; + target = null; + } - exports.BindPositionalArgsOpcode = BindPositionalArgsOpcode; + _emberMetal.addListener(this, name, target, method, true); + return this; + }, - var BindNamedArgsOpcode = (function (_Opcode9) { - babelHelpers.inherits(BindNamedArgsOpcode, _Opcode9); + /** + Triggers a named event for the object. Any additional arguments + will be passed as parameters to the functions that are subscribed to the + event. + ```javascript + person.on('didEat', function(food) { + console.log('person ate some ' + food); + }); + person.trigger('didEat', 'broccoli'); + // outputs: person ate some broccoli + ``` + @method trigger + @param {String} name The name of the event + @param {Object...} args Optional arguments to pass on + @public + */ + trigger: function (name) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } - function BindNamedArgsOpcode(names, symbols) { - _Opcode9.call(this); - this.names = names; - this.symbols = symbols; - this.type = "bind-named-args"; - } + _emberMetal.sendEvent(this, name, args); + }, - BindNamedArgsOpcode.create = function create(layout) { - var names = layout.named; - var symbols = names.map(function (name) { - return layout.symbolTable.getNamed(name); - }); - return new this(names, symbols); - }; + /** + Cancels subscription for given name, target, and method. + @method off + @param {String} name The name of the event + @param {Object} target The target of the subscription + @param {Function} method The function of the subscription + @return this + @public + */ + off: function (name, target, method) { + _emberMetal.removeListener(this, name, target, method); + return this; + }, - BindNamedArgsOpcode.prototype.evaluate = function evaluate(vm) { - vm.bindNamedArgs(this.names, this.symbols); - }; + /** + Checks to see if object has any subscriptions for named event. + @method has + @param {String} name The name of the event + @return {Boolean} does the object have a subscription for event + @public + */ + has: function (name) { + return _emberMetal.hasListeners(this, name); + } + }); +}); +enifed('ember-runtime/mixins/freezable', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-runtime + */ - BindNamedArgsOpcode.prototype.toJSON = function toJSON() { - var names = this.names; - var symbols = this.symbols; + 'use strict'; - var args = names.map(function (name, i) { - return '$' + symbols[i] + ': $ARGS[' + name + ']'; - }); - return { - guid: this._guid, - type: this.type, - args: args - }; - }; + /** + 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. + + ## Enforcement + + To fully support freezing in your subclass, you must include this mixin and + override any method that might alter any property on the object to instead + raise an exception. You can check the state of an object by checking the + `isFrozen` property. + + Although future versions of JavaScript may support language-level freezing + object objects, that is not the case today. Even if an object is freezable, + it is still technically possible to modify the object, even though it could + break other parts of your application that do not expect a frozen object to + change. It is, therefore, very important that you always respect the + `isFrozen` property on all freezable objects. + + ## Example Usage + + The example below shows a simple object that implement the `Ember.Freezable` + protocol. + + ```javascript + Contact = Ember.Object.extend(Ember.Freezable, { + firstName: null, + lastName: null, + + // swaps the names + swapNames: function() { + if (this.get('isFrozen')) throw Ember.FROZEN_ERROR; + var tmp = this.get('firstName'); + this.set('firstName', this.get('lastName')); + this.set('lastName', tmp); + return this; + } + + }); + + c = Contact.create({ firstName: "John", lastName: "Doe" }); + c.swapNames(); // returns c + c.freeze(); + c.swapNames(); // EXCEPTION + ``` + + ## Copying + + Usually the `Ember.Freezable` protocol is implemented in cooperation with the + `Ember.Copyable` protocol, which defines a `frozenCopy()` method that will + return a frozen object, if the object implements this method as well. + + @class Freezable + @namespace Ember + @since Ember 0.9 + @deprecated Use `Object.freeze` instead. + @private + */ + var Freezable = _emberMetal.Mixin.create({ - return BindNamedArgsOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + init: function () { + _emberMetal.deprecate('`Ember.Freezable` is deprecated, use `Object.freeze` instead.', false, { id: 'ember-runtime.freezable-init', until: '3.0.0' }); + this._super.apply(this, arguments); + }, - exports.BindNamedArgsOpcode = BindNamedArgsOpcode; + /** + Set to `true` when the object is frozen. Use this property to detect + whether your object is frozen or not. + @property isFrozen + @type Boolean + @private + */ + isFrozen: false, - var BindBlocksOpcode = (function (_Opcode10) { - babelHelpers.inherits(BindBlocksOpcode, _Opcode10); + /** + Freezes the object. Once this method has been called the object should + no longer allow any properties to be edited. + @method freeze + @return {Object} receiver + @private + */ + freeze: function () { + if (_emberMetal.get(this, 'isFrozen')) { + return this; + } - function BindBlocksOpcode(names, symbols) { - _Opcode10.call(this); - this.names = names; - this.symbols = symbols; - this.type = "bind-blocks"; - } + _emberMetal.set(this, 'isFrozen', true); + return this; + } - BindBlocksOpcode.create = function create(layout) { - var names = layout.yields; - var symbols = names.map(function (name) { - return layout.symbolTable.getYield(name); - }); - return new this(names, symbols); - }; + }); - BindBlocksOpcode.prototype.evaluate = function evaluate(vm) { - vm.bindBlocks(this.names, this.symbols); - }; + exports.Freezable = Freezable; + var FROZEN_ERROR = 'Frozen object cannot be modified.'; + exports.FROZEN_ERROR = FROZEN_ERROR; +}); +enifed('ember-runtime/mixins/mutable_array', ['exports', 'ember-metal', 'ember-runtime/mixins/array', 'ember-runtime/mixins/mutable_enumerable', 'ember-runtime/mixins/enumerable'], function (exports, _emberMetal, _emberRuntimeMixinsArray, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeMixinsEnumerable) { + /** + @module ember + @submodule ember-runtime + */ - BindBlocksOpcode.prototype.toJSON = function toJSON() { - var names = this.names; - var symbols = this.symbols; + 'use strict'; - var args = names.map(function (name, i) { - return '$' + symbols[i] + ': $BLOCKS[' + name + ']'; - }); - return { - guid: this._guid, - type: this.type, - args: args - }; - }; + exports.removeAt = removeAt; + var OUT_OF_RANGE_EXCEPTION = 'Index out of range'; + var EMPTY = []; - return BindBlocksOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + // .......................................................... + // HELPERS + // - exports.BindBlocksOpcode = BindBlocksOpcode; + function removeAt(array, start, len) { + if ('number' === typeof start) { + if (start < 0 || start >= _emberMetal.get(array, 'length')) { + throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); + } - var BindPartialArgsOpcode = (function (_Opcode11) { - babelHelpers.inherits(BindPartialArgsOpcode, _Opcode11); + // fast case + if (len === undefined) { + len = 1; + } - function BindPartialArgsOpcode(symbol) { - _Opcode11.call(this); - this.symbol = symbol; - this.type = "bind-partial-args"; - } + array.replace(start, len, EMPTY); + } - BindPartialArgsOpcode.create = function create(layout) { - return new this(layout.symbolTable.getPartialArgs()); - }; + return array; + } - BindPartialArgsOpcode.prototype.evaluate = function evaluate(vm) { - vm.bindPartialArgs(this.symbol); - }; + /** + 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. + + It is important to use the methods in this class to modify arrays so that + changes are observable. This allows the binding system in Ember to function + correctly. + + + Note that an Array can change even if it does not implement this mixin. + For example, one might implement a SparseArray that cannot be directly + modified, but if its underlying enumerable changes, it will change also. + + @class MutableArray + @namespace Ember + @uses Ember.Array + @uses Ember.MutableEnumerable + @public + */ + exports.default = _emberMetal.Mixin.create(_emberRuntimeMixinsArray.default, _emberRuntimeMixinsMutable_enumerable.default, { - return BindPartialArgsOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + __Required.__ You must implement this method to apply this mixin. + This is one of the primitives you must implement to support `Ember.Array`. + You should replace amt objects started at idx with the objects in the + passed array. You should also call `this.enumerableContentDidChange()` + @method replace + @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* + @public + */ + replace: null, - exports.BindPartialArgsOpcode = BindPartialArgsOpcode; + /** + Remove all elements from the array. This is useful if you + want to reuse an existing array without having to recreate it. + ```javascript + let colors = ['red', 'green', 'blue']; + colors.length; // 3 + colors.clear(); // [] + colors.length; // 0 + ``` + @method clear + @return {Ember.Array} An empty Array. + @public + */ + clear: function () { + var len = _emberMetal.get(this, 'length'); + if (len === 0) { + return this; + } - var BindCallerScopeOpcode = (function (_Opcode12) { - babelHelpers.inherits(BindCallerScopeOpcode, _Opcode12); + this.replace(0, len, EMPTY); + return this; + }, - function BindCallerScopeOpcode() { - _Opcode12.apply(this, arguments); - this.type = "bind-caller-scope"; - } + /** + This will use the primitive `replace()` method to insert an object at the + specified index. + ```javascript + let colors = ['red', 'green', 'blue']; + colors.insertAt(2, 'yellow'); // ['red', 'green', 'yellow', 'blue'] + colors.insertAt(5, 'orange'); // Error: Index out of range + ``` + @method insertAt + @param {Number} idx index of insert the object at. + @param {Object} object object to insert + @return {Ember.Array} receiver + @public + */ + insertAt: function (idx, object) { + if (idx > _emberMetal.get(this, 'length')) { + throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); + } - BindCallerScopeOpcode.prototype.evaluate = function evaluate(vm) { - vm.bindCallerScope(); - }; + this.replace(idx, 0, [object]); + return this; + }, - return BindCallerScopeOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + Remove an object at the specified index using the `replace()` primitive + method. You can pass either a single index, or a start and a length. + If you pass a start and length that is beyond the + length this method will throw an `OUT_OF_RANGE_EXCEPTION`. + ```javascript + let colors = ['red', 'green', 'blue', 'yellow', 'orange']; + colors.removeAt(0); // ['green', 'blue', 'yellow', 'orange'] + colors.removeAt(2, 2); // ['green', 'blue'] + colors.removeAt(4, 2); // Error: Index out of range + ``` + @method removeAt + @param {Number} start index, start of range + @param {Number} len length of passing range + @return {Ember.Array} receiver + @public + */ + removeAt: function (start, len) { + return removeAt(this, start, len); + }, - exports.BindCallerScopeOpcode = BindCallerScopeOpcode; + /** + Push the object onto the end of the array. Works just like `push()` but it + is KVO-compliant. + ```javascript + let colors = ['red', 'green']; + colors.pushObject('black'); // ['red', 'green', 'black'] + colors.pushObject(['yellow']); // ['red', 'green', ['yellow']] + ``` + @method pushObject + @param {*} obj object to push + @return object same object passed as a param + @public + */ + pushObject: function (obj) { + this.insertAt(_emberMetal.get(this, 'length'), obj); + return obj; + }, - var BindDynamicScopeOpcode = (function (_Opcode13) { - babelHelpers.inherits(BindDynamicScopeOpcode, _Opcode13); + /** + Add the objects in the passed numerable to the end of the array. Defers + notifying observers of the change until all objects are added. + ```javascript + let colors = ['red']; + colors.pushObjects(['yellow', 'orange']); // ['red', 'yellow', 'orange'] + ``` + @method pushObjects + @param {Ember.Enumerable} objects the objects to add + @return {Ember.Array} receiver + @public + */ + pushObjects: function (objects) { + if (!(_emberRuntimeMixinsEnumerable.default.detect(objects) || Array.isArray(objects))) { + throw new TypeError('Must pass Ember.Enumerable to Ember.MutableArray#pushObjects'); + } + this.replace(_emberMetal.get(this, 'length'), 0, objects); + return this; + }, - function BindDynamicScopeOpcode(names) { - _Opcode13.call(this); - this.names = names; - this.type = "bind-dynamic-scope"; - } + /** + Pop object from array or nil if none are left. Works just like `pop()` but + it is KVO-compliant. + ```javascript + let colors = ['red', 'green', 'blue']; + colors.popObject(); // 'blue' + console.log(colors); // ['red', 'green'] + ``` + @method popObject + @return object + @public + */ + popObject: function () { + var len = _emberMetal.get(this, 'length'); + if (len === 0) { + return null; + } - BindDynamicScopeOpcode.prototype.evaluate = function evaluate(vm) { - vm.bindDynamicScope(this.names); - }; + var ret = _emberRuntimeMixinsArray.objectAt(this, len - 1); + this.removeAt(len - 1, 1); + return ret; + }, - return BindDynamicScopeOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + Shift an object from start of array or nil if none are left. Works just + like `shift()` but it is KVO-compliant. + ```javascript + let colors = ['red', 'green', 'blue']; + colors.shiftObject(); // 'red' + console.log(colors); // ['green', 'blue'] + ``` + @method shiftObject + @return object + @public + */ + shiftObject: function () { + if (_emberMetal.get(this, 'length') === 0) { + return null; + } - exports.BindDynamicScopeOpcode = BindDynamicScopeOpcode; + var ret = _emberRuntimeMixinsArray.objectAt(this, 0); + this.removeAt(0); + return ret; + }, - var EnterOpcode = (function (_Opcode14) { - babelHelpers.inherits(EnterOpcode, _Opcode14); + /** + Unshift an object to start of array. Works just like `unshift()` but it is + KVO-compliant. + ```javascript + let colors = ['red']; + colors.unshiftObject('yellow'); // ['yellow', 'red'] + colors.unshiftObject(['black']); // [['black'], 'yellow', 'red'] + ``` + @method unshiftObject + @param {*} obj object to unshift + @return object same object passed as a param + @public + */ + unshiftObject: function (obj) { + this.insertAt(0, obj); + return obj; + }, - function EnterOpcode(begin, end) { - _Opcode14.call(this); - this.type = "enter"; - this.slice = new _glimmerUtil.ListSlice(begin, end); - } + /** + Adds the named objects to the beginning of the array. Defers notifying + observers until all objects have been added. + ```javascript + let colors = ['red']; + colors.unshiftObjects(['black', 'white']); // ['black', 'white', 'red'] + colors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function + ``` + @method unshiftObjects + @param {Ember.Enumerable} objects the objects to add + @return {Ember.Array} receiver + @public + */ + unshiftObjects: function (objects) { + this.replace(0, 0, objects); + return this; + }, - EnterOpcode.prototype.evaluate = function evaluate(vm) { - vm.enter(this.slice); - }; + /** + Reverse objects in the array. Works just like `reverse()` but it is + KVO-compliant. + @method reverseObjects + @return {Ember.Array} receiver + @public + */ + reverseObjects: function () { + var len = _emberMetal.get(this, 'length'); + if (len === 0) { + return this; + } - EnterOpcode.prototype.toJSON = function toJSON() { - var slice = this.slice; - var type = this.type; - var _guid = this._guid; + var objects = this.toArray().reverse(); + this.replace(0, len, objects); + return this; + }, - var begin = slice.head(); - var end = slice.tail(); - return { - guid: _guid, - type: type, - args: [JSON.stringify(begin.inspect()), JSON.stringify(end.inspect())] - }; - }; + /** + Replace all the receiver's content with content of the argument. + If argument is an empty array receiver will be cleared. + ```javascript + let colors = ['red', 'green', 'blue']; + colors.setObjects(['black', 'white']); // ['black', 'white'] + colors.setObjects([]); // [] + ``` + @method setObjects + @param {Ember.Array} objects array whose content will be used for replacing + the content of the receiver + @return {Ember.Array} receiver with the new content + @public + */ + setObjects: function (objects) { + if (objects.length === 0) { + return this.clear(); + } - return EnterOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + var len = _emberMetal.get(this, 'length'); + this.replace(0, len, objects); + return this; + }, - exports.EnterOpcode = EnterOpcode; + // .......................................................... + // IMPLEMENT Ember.MutableEnumerable + // - var ExitOpcode = (function (_Opcode15) { - babelHelpers.inherits(ExitOpcode, _Opcode15); + /** + Remove all occurrences of an object in the array. + ```javascript + let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago']; + cities.removeObject('Chicago'); // ['Berlin', 'Lima'] + cities.removeObject('Lima'); // ['Berlin'] + cities.removeObject('Tokyo') // ['Berlin'] + ``` + @method removeObject + @param {*} obj object to remove + @return {Ember.Array} receiver + @public + */ + removeObject: function (obj) { + var loc = _emberMetal.get(this, 'length') || 0; + while (--loc >= 0) { + var curObject = _emberRuntimeMixinsArray.objectAt(this, loc); - function ExitOpcode() { - _Opcode15.apply(this, arguments); - this.type = "exit"; + if (curObject === obj) { + this.removeAt(loc); } + } + return this; + }, - ExitOpcode.prototype.evaluate = function evaluate(vm) { - vm.exit(); - }; - - return ExitOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + Push the object onto the end of the array if it is not already + present in the array. + ```javascript + let cities = ['Chicago', 'Berlin']; + cities.addObject('Lima'); // ['Chicago', 'Berlin', 'Lima'] + cities.addObject('Berlin'); // ['Chicago', 'Berlin', 'Lima'] + ``` + @method addObject + @param {*} obj object to add, if not already present + @return {Ember.Array} receiver + @public + */ + addObject: function (obj) { + var included = this.includes(obj); - exports.ExitOpcode = ExitOpcode; + if (!included) { + this.pushObject(obj); + } - var LabelOpcode = (function (_Opcode16) { - babelHelpers.inherits(LabelOpcode, _Opcode16); + return this; + } + }); +}); +enifed('ember-runtime/mixins/mutable_enumerable', ['exports', 'ember-runtime/mixins/enumerable', 'ember-metal'], function (exports, _emberRuntimeMixinsEnumerable, _emberMetal) { + 'use strict'; - function LabelOpcode(label) { - _Opcode16.call(this); - this.tag = _glimmerReference.CONSTANT_TAG; - this.type = "label"; - this.label = null; - this.prev = null; - this.next = null; - if (label) this.label = label; - } + /** + @module ember + @submodule ember-runtime + */ - LabelOpcode.prototype.evaluate = function evaluate() {}; + /** + This mixin defines the API for modifying generic enumerables. These methods + can be applied to an object regardless of whether it is ordered or + unordered. + + Note that an Enumerable can change even if it does not implement this mixin. + For example, a MappedEnumerable cannot be directly modified but if its + underlying enumerable changes, it will change also. + + ## Adding Objects + + To add an object to an enumerable, use the `addObject()` method. This + method will only add the object to the enumerable if the object is not + already present and is of a type supported by the enumerable. + + ```javascript + set.addObject(contact); + ``` + + ## Removing Objects + + To remove an object from an enumerable, use the `removeObject()` method. This + will only remove the object if it is present in the enumerable, otherwise + this method has no effect. + + ```javascript + set.removeObject(contact); + ``` + + ## Implementing In Your Own Code + + If you are implementing an object and want to support this API, just include + this mixin in your class and implement the required methods. In your unit + tests, be sure to apply the Ember.MutableEnumerableTests to your object. + + @class MutableEnumerable + @namespace Ember + @uses Ember.Enumerable + @public + */ + exports.default = _emberMetal.Mixin.create(_emberRuntimeMixinsEnumerable.default, { - LabelOpcode.prototype.inspect = function inspect() { - return this.label + ' [' + this._guid + ']'; - }; + /** + __Required.__ You must implement this method to apply this mixin. + Attempts to add the passed object to the receiver if the object is not + already present in the collection. If the object is present, this method + has no effect. + If the passed object is of a type not supported by the receiver, + then this method should raise an exception. + @method addObject + @param {Object} object The object to add to the enumerable. + @return {Object} the passed object + @public + */ + addObject: null, - LabelOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.inspect())] - }; - }; + /** + Adds each object in the passed enumerable to the receiver. + @method addObjects + @param {Ember.Enumerable} objects the objects to add. + @return {Object} receiver + @public + */ + addObjects: function (objects) { + var _this = this; - return LabelOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + _emberMetal.beginPropertyChanges(this); + objects.forEach(function (obj) { + return _this.addObject(obj); + }); + _emberMetal.endPropertyChanges(this); + return this; + }, - exports.LabelOpcode = LabelOpcode; + /** + __Required.__ You must implement this method to apply this mixin. + Attempts to remove the passed object from the receiver collection if the + object is present in the collection. If the object is not present, + this method has no effect. + If the passed object is of a type not supported by the receiver, + then this method should raise an exception. + @method removeObject + @param {Object} object The object to remove from the enumerable. + @return {Object} the passed object + @public + */ + removeObject: null, - var EvaluateOpcode = (function (_Opcode17) { - babelHelpers.inherits(EvaluateOpcode, _Opcode17); + /** + Removes each object in the passed enumerable from the receiver. + @method removeObjects + @param {Ember.Enumerable} objects the objects to remove + @return {Object} receiver + @public + */ + removeObjects: function (objects) { + _emberMetal.beginPropertyChanges(this); + for (var i = objects.length - 1; i >= 0; i--) { + this.removeObject(objects[i]); + } + _emberMetal.endPropertyChanges(this); + return this; + } + }); +}); +enifed('ember-runtime/mixins/observable', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-runtime + */ - function EvaluateOpcode(debug, block) { - _Opcode17.call(this); - this.debug = debug; - this.block = block; - this.type = "evaluate"; - } + 'use strict'; - EvaluateOpcode.prototype.evaluate = function evaluate(vm) { - vm.invokeBlock(this.block, vm.frame.getArgs()); - }; + /** + ## Overview + + This mixin provides properties and property observing functionality, core + features of the Ember object model. + + Properties and observers allow one object to observe changes to a + property on another object. This is one of the fundamental ways that + models, controllers and views communicate with each other in an Ember + application. + + Any object that has this mixin applied can be used in observer + operations. That includes `Ember.Object` and most objects you will + interact with as you write your Ember application. + + Note that you will not generally apply this mixin to classes yourself, + but you will use the features provided by this module frequently, so it + is important to understand how to use it. + + ## Using `get()` and `set()` + + Because of Ember's support for bindings and observers, you will always + access properties using the get method, and set properties using the + set method. This allows the observing objects to be notified and + computed properties to be handled properly. + + More documentation about `get` and `set` are below. + + ## Observing Property Changes + + You typically observe property changes simply by using the `Ember.observer` + function in classes that you write. + + For example: + + ```javascript + Ember.Object.extend({ + valueObserver: Ember.observer('value', function(sender, key, value, rev) { + // Executes whenever the "value" property changes + // See the addObserver method for more information about the callback arguments + }) + }); + ``` + + Although this is the most common way to add an observer, this capability + is actually built into the `Ember.Object` class on top of two methods + defined in this mixin: `addObserver` and `removeObserver`. You can use + these two methods to add and remove observers yourself if you need to + do so at runtime. + + To add an observer for a property, call: + + ```javascript + object.addObserver('propertyKey', targetObject, targetAction) + ``` + + This will call the `targetAction` method on the `targetObject` whenever + the value of the `propertyKey` changes. + + Note that if `propertyKey` is a computed property, the observer will be + called when any of the property dependencies are changed, even if the + resulting value of the computed property is unchanged. This is necessary + because computed properties are not computed until `get` is called. + + @class Observable + @namespace Ember + @public + */ + exports.default = _emberMetal.Mixin.create({ - EvaluateOpcode.prototype.toJSON = function toJSON() { - var guid = this._guid; - var type = this.type; - var debug = this.debug; - var block = this.block; - - var compiled = block['compiled']; - var children = undefined; - if (compiled) { - children = compiled.ops.toArray().map(function (op) { - return op.toJSON(); - }); - } else { - children = [{ guid: null, type: '[ UNCOMPILED BLOCK ]' }]; - } - return { - guid: guid, - type: type, - args: [debug], - children: children - }; - }; + /** + Retrieves the value of a property from the object. + This method is usually similar to using `object[keyName]` or `object.keyName`, + however it supports both computed properties and the unknownProperty + handler. + Because `get` unifies the syntax for accessing all these kinds + of properties, it can make many refactorings easier, such as replacing a + simple property with a computed property, or vice versa. + ### Computed Properties + Computed properties are methods defined with the `property` modifier + declared at the end, such as: + ```javascript + fullName: Ember.computed('firstName', 'lastName', function() { + return this.get('firstName') + ' ' + this.get('lastName'); + }) + ``` + When you call `get` on a computed property, the function will be + called and the return value will be returned instead of the function + itself. + ### Unknown Properties + Likewise, if you try to call `get` on a property whose value is + `undefined`, the `unknownProperty()` method will be called on the object. + If this method returns any value other than `undefined`, it will be returned + instead. This allows you to implement "virtual" properties that are + not defined upfront. + @method get + @param {String} keyName The property to retrieve + @return {Object} The property value or undefined. + @public + */ + get: function (keyName) { + return _emberMetal.get(this, keyName); + }, - return EvaluateOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + To get the values of multiple properties at once, call `getProperties` + with a list of strings or an array: + ```javascript + record.getProperties('firstName', 'lastName', 'zipCode'); + // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } + ``` + is equivalent to: + ```javascript + record.getProperties(['firstName', 'lastName', 'zipCode']); + // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } + ``` + @method getProperties + @param {String...|Array} list of keys to get + @return {Object} + @public + */ + getProperties: function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - exports.EvaluateOpcode = EvaluateOpcode; - var ConstTest = function (ref, env) { - return new _glimmerReference.ConstReference(!!ref.value()); - }; - exports.ConstTest = ConstTest; - var SimpleTest = function (ref, env) { - return ref; - }; - exports.SimpleTest = SimpleTest; - var EnvironmentTest = function (ref, env) { - return env.toConditionalReference(ref); - }; - exports.EnvironmentTest = EnvironmentTest; + return _emberMetal.getProperties.apply(undefined, [this].concat(args)); + }, - var TestOpcode = (function (_Opcode18) { - babelHelpers.inherits(TestOpcode, _Opcode18); + /** + Sets the provided key or path to the value. + ```javascript + record.set("key", value); + ``` + This method is generally very similar to calling `object["key"] = value` or + `object.key = value`, except that it provides support for computed + properties, the `setUnknownProperty()` method and property observers. + ### Computed Properties + If you try to set a value on a key that has a computed property handler + defined (see the `get()` method for an example), then `set()` will call + that method, passing both the value and key instead of simply changing + the value itself. This is useful for those times when you need to + implement a property that is composed of one or more member + properties. + ### Unknown Properties + If you try to set a value on a key that is undefined in the target + object, then the `setUnknownProperty()` handler will be called instead. This + gives you an opportunity to implement complex "virtual" properties that + are not predefined on the object. If `setUnknownProperty()` returns + undefined, then `set()` will simply set the value on the object. + ### Property Observers + In addition to changing the property, `set()` will also register a property + change with the object. Unless you have placed this call inside of a + `beginPropertyChanges()` and `endPropertyChanges(),` any "local" observers + (i.e. observer methods declared on the same object), will be called + immediately. Any "remote" observers (i.e. observer methods declared on + another object) will be placed in a queue and called at a later time in a + coalesced manner. + @method set + @param {String} keyName The property to set + @param {Object} value The value to set or `null`. + @return {Object} The passed value + @public + */ + set: function (keyName, value) { + return _emberMetal.set(this, keyName, value); + }, - function TestOpcode(testFunc) { - _Opcode18.call(this); - this.testFunc = testFunc; - this.type = "test"; - } + /** + Sets a list of properties at once. These properties are set inside + a single `beginPropertyChanges` and `endPropertyChanges` batch, so + observers will be buffered. + ```javascript + record.setProperties({ firstName: 'Charles', lastName: 'Jolley' }); + ``` + @method setProperties + @param {Object} hash the hash of keys and values to set + @return {Object} The passed in hash + @public + */ + setProperties: function (hash) { + return _emberMetal.setProperties(this, hash); + }, - TestOpcode.prototype.evaluate = function evaluate(vm) { - vm.frame.setCondition(this.testFunc(vm.frame.getOperand(), vm.env)); - }; + /** + Begins a grouping of property changes. + You can use this method to group property changes so that notifications + will not be sent until the changes are finished. If you plan to make a + large number of changes to an object at one time, you should call this + method at the beginning of the changes to begin deferring change + notifications. When you are done making changes, call + `endPropertyChanges()` to deliver the deferred change notifications and end + deferring. + @method beginPropertyChanges + @return {Ember.Observable} + @private + */ + beginPropertyChanges: function () { + _emberMetal.beginPropertyChanges(); + return this; + }, - TestOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$OPERAND", this.testFunc.name] - }; - }; + /** + Ends a grouping of property changes. + You can use this method to group property changes so that notifications + will not be sent until the changes are finished. If you plan to make a + large number of changes to an object at one time, you should call + `beginPropertyChanges()` at the beginning of the changes to defer change + notifications. When you are done making changes, call this method to + deliver the deferred change notifications and end deferring. + @method endPropertyChanges + @return {Ember.Observable} + @private + */ + endPropertyChanges: function () { + _emberMetal.endPropertyChanges(); + return this; + }, - return TestOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + Notify the observer system that a property is about to change. + Sometimes you need to change a value directly or indirectly without + actually calling `get()` or `set()` on it. In this case, you can use this + method and `propertyDidChange()` instead. Calling these two methods + together will notify all observers that the property has potentially + changed value. + Note that you must always call `propertyWillChange` and `propertyDidChange` + as a pair. If you do not, it may get the property change groups out of + order and cause notifications to be delivered more often than you would + like. + @method propertyWillChange + @param {String} keyName The property key that is about to change. + @return {Ember.Observable} + @private + */ + propertyWillChange: function (keyName) { + _emberMetal.propertyWillChange(this, keyName); + return this; + }, - exports.TestOpcode = TestOpcode; + /** + Notify the observer system that a property has just changed. + Sometimes you need to change a value directly or indirectly without + actually calling `get()` or `set()` on it. In this case, you can use this + method and `propertyWillChange()` instead. Calling these two methods + together will notify all observers that the property has potentially + changed value. + Note that you must always call `propertyWillChange` and `propertyDidChange` + as a pair. If you do not, it may get the property change groups out of + order and cause notifications to be delivered more often than you would + like. + @method propertyDidChange + @param {String} keyName The property key that has just changed. + @return {Ember.Observable} + @private + */ + propertyDidChange: function (keyName) { + _emberMetal.propertyDidChange(this, keyName); + return this; + }, - var JumpOpcode = (function (_Opcode19) { - babelHelpers.inherits(JumpOpcode, _Opcode19); + /** + Convenience method to call `propertyWillChange` and `propertyDidChange` in + succession. + @method notifyPropertyChange + @param {String} keyName The property key to be notified about. + @return {Ember.Observable} + @public + */ + notifyPropertyChange: function (keyName) { + this.propertyWillChange(keyName); + this.propertyDidChange(keyName); + return this; + }, - function JumpOpcode(target) { - _Opcode19.call(this); - this.target = target; - this.type = "jump"; + /** + Adds an observer on a property. + This is the core method used to register an observer for a property. + Once you call this method, any time the key's value is set, your observer + will be notified. Note that the observers are triggered any time the + value is set, regardless of whether it has actually changed. Your + observer should be prepared to handle that. + ### Observer Methods + Observer methods have the following signature: + ```javascript + export default Ember.Component.extend({ + init() { + this._super(...arguments); + this.addObserver('foo', this, 'fooDidChange'); + }, + fooDidChange(sender, key, value, rev) { + // your code } + }); + ``` + The `sender` is the object that changed. The `key` is the property that + changes. The `value` property is currently reserved and unused. The `rev` + is the last property revision of the object when it changed, which you can + use to detect if the key value has really changed or not. + Usually you will not need the value or revision parameters at + the end. In this case, it is common to write observer methods that take + only a sender and key value as parameters or, if you aren't interested in + any of these values, to write an observer that has no parameters at all. + @method addObserver + @param {String} key The key to observer + @param {Object} target The target object to invoke + @param {String|Function} method The method to invoke. + @public + */ + addObserver: function (key, target, method) { + _emberMetal.addObserver(this, key, target, method); + }, - JumpOpcode.prototype.evaluate = function evaluate(vm) { - vm.goto(this.target); - }; - - JumpOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.target.inspect())] - }; - }; + /** + Remove an observer you have previously registered on this object. Pass + the same key, target, and method you passed to `addObserver()` and your + target will no longer receive notifications. + @method removeObserver + @param {String} key The key to observer + @param {Object} target The target object to invoke + @param {String|Function} method The method to invoke. + @public + */ + removeObserver: function (key, target, method) { + _emberMetal.removeObserver(this, key, target, method); + }, - return JumpOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + Returns `true` if the object currently has observers registered for a + particular key. You can use this method to potentially defer performing + an expensive action until someone begins observing a particular property + on the object. + @method hasObserverFor + @param {String} key Key to check + @return {Boolean} + @private + */ + hasObserverFor: function (key) { + return _emberMetal.hasListeners(this, key + ':change'); + }, - exports.JumpOpcode = JumpOpcode; + /** + Retrieves the value of a property, or a default value in the case that the + property returns `undefined`. + ```javascript + person.getWithDefault('lastName', 'Doe'); + ``` + @method getWithDefault + @param {String} keyName The name of the property to retrieve + @param {Object} defaultValue The value to return if the property value is undefined + @return {Object} The property value or the defaultValue. + @public + */ + getWithDefault: function (keyName, defaultValue) { + return _emberMetal.getWithDefault(this, keyName, defaultValue); + }, - var JumpIfOpcode = (function (_JumpOpcode) { - babelHelpers.inherits(JumpIfOpcode, _JumpOpcode); + /** + Set the value of a property to the current value plus some amount. + ```javascript + person.incrementProperty('age'); + team.incrementProperty('score', 2); + ``` + @method incrementProperty + @param {String} keyName The name of the property to increment + @param {Number} increment The amount to increment by. Defaults to 1 + @return {Number} The new property value + @public + */ + incrementProperty: function (keyName, increment) { + if (_emberMetal.isNone(increment)) { + increment = 1; + } + _emberMetal.assert('Must pass a numeric value to incrementProperty', !isNaN(parseFloat(increment)) && isFinite(increment)); + return _emberMetal.set(this, keyName, (parseFloat(_emberMetal.get(this, keyName)) || 0) + increment); + }, - function JumpIfOpcode() { - _JumpOpcode.apply(this, arguments); - this.type = "jump-if"; - } + /** + Set the value of a property to the current value minus some amount. + ```javascript + player.decrementProperty('lives'); + orc.decrementProperty('health', 5); + ``` + @method decrementProperty + @param {String} keyName The name of the property to decrement + @param {Number} decrement The amount to decrement by. Defaults to 1 + @return {Number} The new property value + @public + */ + decrementProperty: function (keyName, decrement) { + if (_emberMetal.isNone(decrement)) { + decrement = 1; + } + _emberMetal.assert('Must pass a numeric value to decrementProperty', !isNaN(parseFloat(decrement)) && isFinite(decrement)); + return _emberMetal.set(this, keyName, (_emberMetal.get(this, keyName) || 0) - decrement); + }, - JumpIfOpcode.prototype.evaluate = function evaluate(vm) { - var reference = vm.frame.getCondition(); - if (_glimmerReference.isConst(reference)) { - if (reference.value()) { - _JumpOpcode.prototype.evaluate.call(this, vm); - } - } else { - var cache = new _glimmerReference.ReferenceCache(reference); - if (cache.peek()) { - _JumpOpcode.prototype.evaluate.call(this, vm); - } - vm.updateWith(new Assert(cache)); - } - }; + /** + Set the value of a boolean property to the opposite of its + current value. + ```javascript + starship.toggleProperty('warpDriveEngaged'); + ``` + @method toggleProperty + @param {String} keyName The name of the property to toggle + @return {Boolean} The new property value + @public + */ + toggleProperty: function (keyName) { + return _emberMetal.set(this, keyName, !_emberMetal.get(this, keyName)); + }, - return JumpIfOpcode; - })(JumpOpcode); + /** + Returns the cached value of a computed property, if it exists. + This allows you to inspect the value of a computed property + without accidentally invoking it if it is intended to be + generated lazily. + @method cacheFor + @param {String} keyName + @return {Object} The cached value of the computed property, if any + @public + */ + cacheFor: function (keyName) { + return _emberMetal.cacheFor(this, keyName); + }, - exports.JumpIfOpcode = JumpIfOpcode; + // intended for debugging purposes + observersForKey: function (keyName) { + return _emberMetal.observersFor(this, keyName); + } + }); +}); +enifed('ember-runtime/mixins/promise_proxy', ['exports', 'ember-metal', 'ember-runtime/computed/computed_macros'], function (exports, _emberMetal, _emberRuntimeComputedComputed_macros) { + 'use strict'; - var JumpUnlessOpcode = (function (_JumpOpcode2) { - babelHelpers.inherits(JumpUnlessOpcode, _JumpOpcode2); + /** + @module ember + @submodule ember-runtime + */ - function JumpUnlessOpcode() { - _JumpOpcode2.apply(this, arguments); - this.type = "jump-unless"; - } + function tap(proxy, promise) { + _emberMetal.setProperties(proxy, { + isFulfilled: false, + isRejected: false + }); - JumpUnlessOpcode.prototype.evaluate = function evaluate(vm) { - var reference = vm.frame.getCondition(); - if (_glimmerReference.isConst(reference)) { - if (!reference.value()) { - _JumpOpcode2.prototype.evaluate.call(this, vm); - } - } else { - var cache = new _glimmerReference.ReferenceCache(reference); - if (!cache.peek()) { - _JumpOpcode2.prototype.evaluate.call(this, vm); - } - vm.updateWith(new Assert(cache)); - } - }; + return promise.then(function (value) { + if (!proxy.isDestroyed && !proxy.isDestroying) { + _emberMetal.setProperties(proxy, { + content: value, + isFulfilled: true + }); + } + return value; + }, function (reason) { + if (!proxy.isDestroyed && !proxy.isDestroying) { + _emberMetal.setProperties(proxy, { + reason: reason, + isRejected: true + }); + } + throw reason; + }, 'Ember: PromiseProxy'); + } - return JumpUnlessOpcode; - })(JumpOpcode); + /** + A low level mixin making ObjectProxy promise-aware. + + ```javascript + let ObjectPromiseProxy = Ember.ObjectProxy.extend(Ember.PromiseProxyMixin); + + let proxy = ObjectPromiseProxy.create({ + promise: Ember.RSVP.cast($.getJSON('/some/remote/data.json')) + }); + + proxy.then(function(json){ + // the json + }, function(reason) { + // the reason why you have no json + }); + ``` + + the proxy has bindable attributes which + track the promises life cycle + + ```javascript + proxy.get('isPending') //=> true + proxy.get('isSettled') //=> false + proxy.get('isRejected') //=> false + proxy.get('isFulfilled') //=> false + ``` + + When the $.getJSON completes, and the promise is fulfilled + with json, the life cycle attributes will update accordingly. + Note that $.getJSON doesn't return an ECMA specified promise, + it is useful to wrap this with an `RSVP.cast` so that it behaves + as a spec compliant promise. + + ```javascript + proxy.get('isPending') //=> false + proxy.get('isSettled') //=> true + proxy.get('isRejected') //=> false + proxy.get('isFulfilled') //=> true + ``` + + As the proxy is an ObjectProxy, and the json now its content, + all the json properties will be available directly from the proxy. + + ```javascript + // Assuming the following json: + { + firstName: 'Stefan', + lastName: 'Penner' + } + + // both properties will accessible on the proxy + proxy.get('firstName') //=> 'Stefan' + proxy.get('lastName') //=> 'Penner' + ``` + + @class Ember.PromiseProxyMixin + @public + */ + exports.default = _emberMetal.Mixin.create({ + /** + If the proxied promise is rejected this will contain the reason + provided. + @property reason + @default null + @public + */ + reason: null, - exports.JumpUnlessOpcode = JumpUnlessOpcode; + /** + Once the proxied promise has settled this will become `false`. + @property isPending + @default true + @public + */ + isPending: _emberRuntimeComputedComputed_macros.not('isSettled').readOnly(), - var Assert = (function (_UpdatingOpcode) { - babelHelpers.inherits(Assert, _UpdatingOpcode); + /** + Once the proxied promise has settled this will become `true`. + @property isSettled + @default false + @public + */ + isSettled: _emberRuntimeComputedComputed_macros.or('isRejected', 'isFulfilled').readOnly(), - function Assert(cache) { - _UpdatingOpcode.call(this); - this.type = "assert"; - this.tag = cache.tag; - this.cache = cache; - } + /** + Will become `true` if the proxied promise is rejected. + @property isRejected + @default false + @public + */ + isRejected: false, - Assert.prototype.evaluate = function evaluate(vm) { - var cache = this.cache; + /** + Will become `true` if the proxied promise is fulfilled. + @property isFulfilled + @default false + @public + */ + isFulfilled: false, - if (_glimmerReference.isModified(cache.revalidate())) { - vm.throw(); - } - }; + /** + The promise whose fulfillment value is being proxied by this object. + This property must be specified upon creation, and should not be + changed once created. + Example: + ```javascript + Ember.ObjectProxy.extend(Ember.PromiseProxyMixin).create({ + promise: + }); + ``` + @property promise + @public + */ + promise: _emberMetal.computed({ + get: function () { + throw new _emberMetal.Error('PromiseProxy\'s promise must be set'); + }, + set: function (key, promise) { + return tap(this, promise); + } + }), - Assert.prototype.toJSON = function toJSON() { - var type = this.type; - var _guid = this._guid; - var cache = this.cache; + /** + An alias to the proxied promise's `then`. + See RSVP.Promise.then. + @method then + @param {Function} callback + @return {RSVP.Promise} + @public + */ + then: promiseAlias('then'), - var expected = undefined; - try { - expected = JSON.stringify(cache.peek()); - } catch (e) { - expected = String(cache.peek()); - } - return { - guid: _guid, - type: type, - args: [], - details: { expected: expected } - }; - }; + /** + An alias to the proxied promise's `catch`. + See RSVP.Promise.catch. + @method catch + @param {Function} callback + @return {RSVP.Promise} + @since 1.3.0 + @public + */ + 'catch': promiseAlias('catch'), - return Assert; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + /** + An alias to the proxied promise's `finally`. + See RSVP.Promise.finally. + @method finally + @param {Function} callback + @return {RSVP.Promise} + @since 1.3.0 + @public + */ + 'finally': promiseAlias('finally') - exports.Assert = Assert; + }); - var JumpIfNotModifiedOpcode = (function (_UpdatingOpcode2) { - babelHelpers.inherits(JumpIfNotModifiedOpcode, _UpdatingOpcode2); + function promiseAlias(name) { + return function () { + var promise = _emberMetal.get(this, 'promise'); + return promise[name].apply(promise, arguments); + }; + } +}); +enifed('ember-runtime/mixins/registry_proxy', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-runtime + */ - function JumpIfNotModifiedOpcode(tag, target) { - _UpdatingOpcode2.call(this); - this.target = target; - this.type = "jump-if-not-modified"; - this.tag = tag; - this.lastRevision = tag.value(); - } + 'use strict'; - JumpIfNotModifiedOpcode.prototype.evaluate = function evaluate(vm) { - var tag = this.tag; - var target = this.target; - var lastRevision = this.lastRevision; + exports.buildFakeRegistryWithDeprecations = buildFakeRegistryWithDeprecations; - if (!vm.alwaysRevalidate && tag.validate(lastRevision)) { - vm.goto(target); - } - }; + /** + RegistryProxyMixin is used to provide public access to specific + registry functionality. + + @class RegistryProxyMixin + @private + */ + exports.default = _emberMetal.Mixin.create({ + __registry__: null, - JumpIfNotModifiedOpcode.prototype.didModify = function didModify() { - this.lastRevision = this.tag.value(); - }; + /** + Given a fullName return the corresponding factory. + @public + @method resolveRegistration + @param {String} fullName + @return {Function} fullName's factory + */ + resolveRegistration: registryAlias('resolve'), - JumpIfNotModifiedOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.target.inspect())] - }; - }; + /** + Registers a factory that can be used for dependency injection (with + `inject`) or for service lookup. Each factory is registered with + a full name including two parts: `type:name`. + A simple example: + ```javascript + let App = Ember.Application.create(); + App.Orange = Ember.Object.extend(); + App.register('fruit:favorite', App.Orange); + ``` + Ember will resolve factories from the `App` namespace automatically. + For example `App.CarsController` will be discovered and returned if + an application requests `controller:cars`. + An example of registering a controller with a non-standard name: + ```javascript + let App = Ember.Application.create(); + let Session = Ember.Controller.extend(); + App.register('controller:session', Session); + // The Session controller can now be treated like a normal controller, + // despite its non-standard name. + App.ApplicationController = Ember.Controller.extend({ + needs: ['session'] + }); + ``` + Registered factories are **instantiated** by having `create` + called on them. Additionally they are **singletons**, each time + they are looked up they return the same instance. + Some examples modifying that default behavior: + ```javascript + let App = Ember.Application.create(); + App.Person = Ember.Object.extend(); + App.Orange = Ember.Object.extend(); + App.Email = Ember.Object.extend(); + App.session = Ember.Object.create(); + App.register('model:user', App.Person, { singleton: false }); + App.register('fruit:favorite', App.Orange); + App.register('communication:main', App.Email, { singleton: false }); + App.register('session', App.session, { instantiate: false }); + ``` + @method register + @param fullName {String} type:name (e.g., 'model:user') + @param factory {Function} (e.g., App.Person) + @param options {Object} (optional) disable instantiation or singleton usage + @public + */ + register: registryAlias('register'), - return JumpIfNotModifiedOpcode; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + /** + Unregister a factory. + ```javascript + let App = Ember.Application.create(); + let User = Ember.Object.extend(); + App.register('model:user', User); + App.resolveRegistration('model:user').create() instanceof User //=> true + App.unregister('model:user') + App.resolveRegistration('model:user') === undefined //=> true + ``` + @public + @method unregister + @param {String} fullName + */ + unregister: registryAlias('unregister'), - exports.JumpIfNotModifiedOpcode = JumpIfNotModifiedOpcode; + /** + Check if a factory is registered. + @public + @method hasRegistration + @param {String} fullName + @return {Boolean} + */ + hasRegistration: registryAlias('has'), - var DidModifyOpcode = (function (_UpdatingOpcode3) { - babelHelpers.inherits(DidModifyOpcode, _UpdatingOpcode3); + /** + Register an option for a particular factory. + @public + @method registerOption + @param {String} fullName + @param {String} optionName + @param {Object} options + */ + registerOption: registryAlias('option'), - function DidModifyOpcode(target) { - _UpdatingOpcode3.call(this); - this.target = target; - this.type = "did-modify"; - this.tag = _glimmerReference.CONSTANT_TAG; - } + /** + Return a specific registered option for a particular factory. + @public + @method registeredOption + @param {String} fullName + @param {String} optionName + @return {Object} options + */ + registeredOption: registryAlias('getOption'), - DidModifyOpcode.prototype.evaluate = function evaluate() { - this.target.didModify(); - }; + /** + Register options for a particular factory. + @public + @method registerOptions + @param {String} fullName + @param {Object} options + */ + registerOptions: registryAlias('options'), - return DidModifyOpcode; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + /** + Return registered options for a particular factory. + @public + @method registeredOptions + @param {String} fullName + @return {Object} options + */ + registeredOptions: registryAlias('getOptions'), - exports.DidModifyOpcode = DidModifyOpcode; -}); + /** + Allow registering options for all factories of a type. + ```javascript + let App = Ember.Application.create(); + let appInstance = App.buildInstance(); + // if all of type `connection` must not be singletons + appInstance.registerOptionsForType('connection', { singleton: false }); + appInstance.register('connection:twitter', TwitterConnection); + appInstance.register('connection:facebook', FacebookConnection); + let twitter = appInstance.lookup('connection:twitter'); + let twitter2 = appInstance.lookup('connection:twitter'); + twitter === twitter2; // => false + let facebook = appInstance.lookup('connection:facebook'); + let facebook2 = appInstance.lookup('connection:facebook'); + facebook === facebook2; // => false + ``` + @public + @method registerOptionsForType + @param {String} type + @param {Object} options + */ + registerOptionsForType: registryAlias('optionsForType'), -enifed('glimmer-runtime/lib/compiler', ['exports', 'glimmer-util', 'glimmer-runtime/lib/utils', 'glimmer-runtime/lib/syntax/core', 'glimmer-runtime/lib/compiled/blocks', 'glimmer-runtime/lib/compiled/expressions/function', 'glimmer-runtime/lib/compiled/opcodes/builder'], function (exports, _glimmerUtil, _glimmerRuntimeLibUtils, _glimmerRuntimeLibSyntaxCore, _glimmerRuntimeLibCompiledBlocks, _glimmerRuntimeLibCompiledExpressionsFunction, _glimmerRuntimeLibCompiledOpcodesBuilder) { - 'use strict'; + /** + Return the registered options for all factories of a type. + @public + @method registeredOptionsForType + @param {String} type + @return {Object} options + */ + registeredOptionsForType: registryAlias('getOptionsForType'), - exports.compileLayout = compileLayout; + /** + Define a dependency injection onto a specific factory or all factories + of a type. + When Ember instantiates a controller, view, or other framework component + it can attach a dependency to that component. This is often used to + provide services to a set of framework components. + An example of providing a session object to all controllers: + ```javascript + let App = Ember.Application.create(); + let Session = Ember.Object.extend({ isAuthenticated: false }); + // A factory must be registered before it can be injected + App.register('session:main', Session); + // Inject 'session:main' onto all factories of the type 'controller' + // with the name 'session' + App.inject('controller', 'session', 'session:main'); + App.IndexController = Ember.Controller.extend({ + isLoggedIn: Ember.computed.alias('session.isAuthenticated') + }); + ``` + Injections can also be performed on specific factories. + ```javascript + App.inject(, , ) + App.inject('route', 'source', 'source:main') + App.inject('route:application', 'email', 'model:email') + ``` + It is important to note that injections can only be performed on + classes that are instantiated by Ember itself. Instantiating a class + directly (via `create` or `new`) bypasses the dependency injection + system. + **Note:** Ember-Data instantiates its models in a unique manner, and consequently + injections onto models (or all models) will not work as expected. Injections + on models can be enabled by setting `EmberENV.MODEL_FACTORY_INJECTIONS` + to `true`. + @public + @method inject + @param factoryNameOrType {String} + @param property {String} + @param injectionName {String} + **/ + inject: registryAlias('injection') + }); - var Compiler = (function () { - function Compiler(block, env) { - this.block = block; - this.env = env; - this.current = block.program.head(); - this.symbolTable = block.symbolTable; - } + function registryAlias(name) { + return function () { + var _registry__; - Compiler.prototype.compileStatement = function compileStatement(statement, ops) { - this.env.statement(statement, this.symbolTable).compile(ops, this.env, this.symbolTable); - }; + return (_registry__ = this.__registry__)[name].apply(_registry__, arguments); + }; + } - return Compiler; - })(); + function buildFakeRegistryWithDeprecations(instance, typeForMessage) { + var fakeRegistry = {}; + var registryProps = { + resolve: 'resolveRegistration', + register: 'register', + unregister: 'unregister', + has: 'hasRegistration', + option: 'registerOption', + options: 'registerOptions', + getOptions: 'registeredOptions', + optionsForType: 'registerOptionsForType', + getOptionsForType: 'registeredOptionsForType', + injection: 'inject' + }; - function compileStatement(env, statement, ops, layout) { - env.statement(statement, layout.symbolTable).compile(ops, env, layout.symbolTable); + for (var deprecatedProperty in registryProps) { + fakeRegistry[deprecatedProperty] = buildFakeRegistryFunction(instance, typeForMessage, deprecatedProperty, registryProps[deprecatedProperty]); } - exports.default = Compiler; - var EntryPointCompiler = (function (_Compiler) { - babelHelpers.inherits(EntryPointCompiler, _Compiler); - - function EntryPointCompiler(template, env) { - _Compiler.call(this, template, env); - var list = new CompileIntoList(env, template.symbolTable); - this.ops = new _glimmerRuntimeLibCompiledOpcodesBuilder.default(list, template.symbolTable, env); - } + return fakeRegistry; + } - EntryPointCompiler.prototype.compile = function compile() { - var block = this.block; - var ops = this.ops; - var program = block.program; + function buildFakeRegistryFunction(instance, typeForMessage, deprecatedProperty, nonDeprecatedProperty) { + return function () { + _emberMetal.deprecate('Using `' + typeForMessage + '.registry.' + deprecatedProperty + '` is deprecated. Please use `' + typeForMessage + '.' + nonDeprecatedProperty + '` instead.', false, { + id: 'ember-application.app-instance-registry', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-application-registry-ember-applicationinstance-registry' + }); + return instance[nonDeprecatedProperty].apply(instance, arguments); + }; + } +}); +enifed('ember-runtime/mixins/target_action_support', ['exports', 'ember-environment', 'ember-metal'], function (exports, _emberEnvironment, _emberMetal) { + /** + @module ember + @submodule ember-runtime + */ - var current = program.head(); - while (current) { - var next = program.nextNode(current); - this.compileStatement(current, ops); - current = next; - } - return ops.toOpSeq(); - }; + 'use strict'; - EntryPointCompiler.prototype.append = function append(op) { - this.ops.append(op); - }; + /** + `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 + usually the best choice. This mixin is most often useful when you are + doing more complex event handling in Components. + + @class TargetActionSupport + @namespace Ember + @extends Ember.Mixin + @private + */ + exports.default = _emberMetal.Mixin.create({ + target: null, + action: null, + actionContext: null, - EntryPointCompiler.prototype.getLocalSymbol = function getLocalSymbol(name) { - return this.symbolTable.getLocal(name); - }; + actionContextObject: _emberMetal.computed('actionContext', function () { + var actionContext = _emberMetal.get(this, 'actionContext'); - EntryPointCompiler.prototype.getNamedSymbol = function getNamedSymbol(name) { - return this.symbolTable.getNamed(name); - }; + if (typeof actionContext === 'string') { + var value = _emberMetal.get(this, actionContext); + if (value === undefined) { + value = _emberMetal.get(_emberEnvironment.context.lookup, actionContext); + } + return value; + } else { + return actionContext; + } + }), - EntryPointCompiler.prototype.getYieldSymbol = function getYieldSymbol(name) { - return this.symbolTable.getYield(name); - }; + /** + Send an `action` with an `actionContext` to a `target`. The action, actionContext + and target will be retrieved from properties of the object. For example: + ```javascript + App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, { + target: Ember.computed.alias('controller'), + action: 'save', + actionContext: Ember.computed.alias('context'), + click() { + this.triggerAction(); // Sends the `save` action, along with the current context + // to the current controller + } + }); + ``` + The `target`, `action`, and `actionContext` can be provided as properties of + an optional object argument to `triggerAction` as well. + ```javascript + App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, { + click() { + this.triggerAction({ + action: 'save', + target: this.get('controller'), + actionContext: this.get('context') + }); // Sends the `save` action, along with the current context + // to the current controller + } + }); + ``` + The `actionContext` defaults to the object you are mixing `TargetActionSupport` into. + But `target` and `action` must be specified either as properties or with the argument + to `triggerAction`, or a combination: + ```javascript + App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, { + target: Ember.computed.alias('controller'), + click() { + this.triggerAction({ + action: 'save' + }); // Sends the `save` action, along with a reference to `this`, + // to the current controller + } + }); + ``` + @method triggerAction + @param opts {Object} (optional, with the optional keys action, target and/or actionContext) + @return {Boolean} true if the action was sent successfully and did not return false + @private + */ + triggerAction: function () { + var opts = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - return EntryPointCompiler; - })(Compiler); + var action = opts.action || _emberMetal.get(this, 'action'); + var target = opts.target; - exports.EntryPointCompiler = EntryPointCompiler; + if (!target) { + target = getTarget(this); + } - var InlineBlockCompiler = (function (_Compiler2) { - babelHelpers.inherits(InlineBlockCompiler, _Compiler2); + var actionContext = opts.actionContext; - function InlineBlockCompiler(block, env) { - _Compiler2.call(this, block, env); - this.block = block; - var list = new CompileIntoList(env, block.symbolTable); - this.ops = new _glimmerRuntimeLibCompiledOpcodesBuilder.default(list, block.symbolTable, env); + function args(options, actionName) { + var ret = []; + if (actionName) { + ret.push(actionName); } - InlineBlockCompiler.prototype.compile = function compile() { - var block = this.block; - var ops = this.ops; - var program = block.program; + return ret.concat(options); + } - var hasPositionalParameters = block.hasPositionalParameters(); - if (hasPositionalParameters) { - ops.pushChildScope(); - ops.bindPositionalArgsForBlock(block); - } - var current = program.head(); - while (current) { - var next = program.nextNode(current); - this.compileStatement(current, ops); - current = next; - } - if (hasPositionalParameters) { - ops.popScope(); - } - return ops.toOpSeq(); - }; + if (typeof actionContext === 'undefined') { + actionContext = _emberMetal.get(this, 'actionContextObject') || this; + } - return InlineBlockCompiler; - })(Compiler); + if (target && action) { + var ret = undefined; - exports.InlineBlockCompiler = InlineBlockCompiler; + if (target.send) { + var _target; - function compileLayout(compilable, env) { - var builder = new ComponentLayoutBuilder(env); - compilable.compile(builder); - return builder.compile(); - } + ret = (_target = target).send.apply(_target, args(actionContext, action)); + } else { + var _target2; - var ComponentLayoutBuilder = (function () { - function ComponentLayoutBuilder(env) { - this.env = env; + _emberMetal.assert('The action \'' + action + '\' did not exist on ' + target, typeof target[action] === 'function'); + ret = (_target2 = target)[action].apply(_target2, args(actionContext)); } - ComponentLayoutBuilder.prototype.empty = function empty() { - this.inner = new EmptyBuilder(this.env); - }; - - ComponentLayoutBuilder.prototype.wrapLayout = function wrapLayout(layout) { - this.inner = new WrappedBuilder(this.env, layout); - }; - - ComponentLayoutBuilder.prototype.fromLayout = function fromLayout(layout) { - this.inner = new UnwrappedBuilder(this.env, layout); - }; - - ComponentLayoutBuilder.prototype.compile = function compile() { - return this.inner.compile(); - }; - - babelHelpers.createClass(ComponentLayoutBuilder, [{ - key: 'tag', - get: function () { - return this.inner.tag; - } - }, { - key: 'attrs', - get: function () { - return this.inner.attrs; - } - }]); - return ComponentLayoutBuilder; - })(); - - var EmptyBuilder = (function () { - function EmptyBuilder(env) { - this.env = env; + if (ret !== false) { + ret = true; } - EmptyBuilder.prototype.compile = function compile() { - var env = this.env; - - var list = new CompileIntoList(env, null); - return new _glimmerRuntimeLibCompiledBlocks.CompiledBlock(list, 0); - }; - - babelHelpers.createClass(EmptyBuilder, [{ - key: 'tag', - get: function () { - throw new Error('Nope'); - } - }, { - key: 'attrs', - get: function () { - throw new Error('Nope'); - } - }]); - return EmptyBuilder; - })(); - - var WrappedBuilder = (function () { - function WrappedBuilder(env, layout) { - this.env = env; - this.layout = layout; - this.tag = new ComponentTagBuilder(); - this.attrs = new ComponentAttrsBuilder(); - } - - WrappedBuilder.prototype.compile = function compile() { - //========DYNAMIC - // PutValue(TagExpr) - // Test - // JumpUnless(BODY) - // OpenDynamicPrimitiveElement - // DidCreateElement - // ...attr statements... - // FlushElement - // BODY: Noop - // ...body statements... - // PutValue(TagExpr) - // Test - // JumpUnless(END) - // CloseElement - // END: Noop - // DidRenderLayout - // Exit - // - //========STATIC - // OpenPrimitiveElementOpcode - // DidCreateElement - // ...attr statements... - // FlushElement - // ...body statements... - // CloseElement - // DidRenderLayout - // Exit - var env = this.env; - var layout = this.layout; - - var symbolTable = layout.symbolTable; - var buffer = new CompileIntoList(env, layout.symbolTable); - var dsl = new _glimmerRuntimeLibCompiledOpcodesBuilder.default(buffer, layout.symbolTable, env); - dsl.startLabels(); - if (this.tag.isDynamic) { - dsl.putValue(this.tag.dynamicTagName); - dsl.test('simple'); - dsl.jumpUnless('BODY'); - dsl.openDynamicPrimitiveElement(); - dsl.didCreateElement(); - this.attrs['buffer'].forEach(function (statement) { - return compileStatement(env, statement, dsl, layout); - }); - dsl.flushElement(); - dsl.label('BODY'); - } else if (this.tag.isStatic) { - var tag = this.tag.staticTagName; - dsl.openPrimitiveElement(tag); - dsl.didCreateElement(); - this.attrs['buffer'].forEach(function (statement) { - return compileStatement(env, statement, dsl, layout); - }); - dsl.flushElement(); - } - dsl.preludeForLayout(layout); - layout.program.forEachNode(function (statement) { - return compileStatement(env, statement, dsl, layout); - }); - if (this.tag.isDynamic) { - dsl.putValue(this.tag.dynamicTagName); - dsl.test('simple'); - dsl.jumpUnless('END'); - dsl.closeElement(); - dsl.label('END'); - } else if (this.tag.isStatic) { - dsl.closeElement(); - } - dsl.didRenderLayout(); - dsl.stopLabels(); - return new _glimmerRuntimeLibCompiledBlocks.CompiledBlock(dsl.toOpSeq(), symbolTable.size); - }; - - return WrappedBuilder; - })(); + return ret; + } else { + return false; + } + } + }); - var UnwrappedBuilder = (function () { - function UnwrappedBuilder(env, layout) { - this.env = env; - this.layout = layout; - this.attrs = new ComponentAttrsBuilder(); - } - - UnwrappedBuilder.prototype.compile = function compile() { - var env = this.env; - var layout = this.layout; - - var buffer = new CompileIntoList(env, layout.symbolTable); - var dsl = new _glimmerRuntimeLibCompiledOpcodesBuilder.default(buffer, layout.symbolTable, env); - dsl.startLabels(); - dsl.preludeForLayout(layout); - var attrs = this.attrs['buffer']; - var attrsInserted = false; - this.layout.program.forEachNode(function (statement) { - if (!attrsInserted && isOpenElement(statement)) { - dsl.openComponentElement(statement.tag); - dsl.didCreateElement(); - dsl.shadowAttributes(); - attrs.forEach(function (statement) { - return compileStatement(env, statement, dsl, layout); - }); - attrsInserted = true; - } else { - compileStatement(env, statement, dsl, layout); - } - }); - dsl.didRenderLayout(); - dsl.stopLabels(); - return new _glimmerRuntimeLibCompiledBlocks.CompiledBlock(dsl.toOpSeq(), layout.symbolTable.size); - }; + function getTarget(instance) { + // TODO: Deprecate specifying `targetObject` + var target = _emberMetal.get(instance, 'targetObject'); - babelHelpers.createClass(UnwrappedBuilder, [{ - key: 'tag', - get: function () { - throw new Error('BUG: Cannot call `tag` on an UnwrappedBuilder'); - } - }]); - return UnwrappedBuilder; - })(); + // if a `targetObject` CP was provided, use it + if (target) { + return target; + } - function isOpenElement(syntax) { - return syntax instanceof _glimmerRuntimeLibSyntaxCore.OpenElement || syntax instanceof _glimmerRuntimeLibSyntaxCore.OpenPrimitiveElement; + // if _targetObject use it + if (instance._targetObject) { + return instance._targetObject; } - var ComponentTagBuilder = (function () { - function ComponentTagBuilder() { - this.isDynamic = null; - this.isStatic = null; - this.staticTagName = null; - this.dynamicTagName = null; + target = _emberMetal.get(instance, 'target'); + if (target) { + if (typeof target === 'string') { + var value = _emberMetal.get(instance, target); + if (value === undefined) { + value = _emberMetal.get(_emberEnvironment.context.lookup, target); } - ComponentTagBuilder.prototype.static = function _static(tagName) { - this.isStatic = true; - this.staticTagName = tagName; - }; - - ComponentTagBuilder.prototype.dynamic = function dynamic(tagName) { - this.isDynamic = true; - this.dynamicTagName = _glimmerRuntimeLibCompiledExpressionsFunction.default(tagName); - }; - - return ComponentTagBuilder; - })(); - - var ComponentAttrsBuilder = (function () { - function ComponentAttrsBuilder() { - this.buffer = []; - } + return value; + } else { + return target; + } + } - ComponentAttrsBuilder.prototype.static = function _static(name, value) { - this.buffer.push(new _glimmerRuntimeLibSyntaxCore.StaticAttr(name, value, null)); - }; + return null; + } +}); +enifed("ember-runtime/string_registry", ["exports"], function (exports) { + // STATE within a module is frowned apon, this exists + // to support Ember.STRINGS but shield ember internals from this legacy global + // API. + "use strict"; - ComponentAttrsBuilder.prototype.dynamic = function dynamic(name, value) { - this.buffer.push(new _glimmerRuntimeLibSyntaxCore.DynamicAttr(name, _glimmerRuntimeLibCompiledExpressionsFunction.default(value), null, false)); - }; + exports.setStrings = setStrings; + exports.getStrings = getStrings; + exports.get = get; + var STRINGS = {}; - return ComponentAttrsBuilder; - })(); + function setStrings(strings) { + STRINGS = strings; + } - var ComponentBuilder = (function () { - function ComponentBuilder(dsl) { - this.dsl = dsl; - this.env = dsl.env; - } + function getStrings() { + return STRINGS; + } - ComponentBuilder.prototype.static = function _static(definition, args, symbolTable) { - var shadow = arguments.length <= 3 || arguments[3] === undefined ? _glimmerRuntimeLibUtils.EMPTY_ARRAY : arguments[3]; + function get(name) { + return STRINGS[name]; + } +}); +enifed('ember-runtime/system/application', ['exports', 'ember-runtime/system/namespace'], function (exports, _emberRuntimeSystemNamespace) { + 'use strict'; - this.dsl.unit(function (dsl) { - dsl.putComponentDefinition(definition); - dsl.openComponent(args, shadow); - dsl.closeComponent(); - }); - }; + exports.default = _emberRuntimeSystemNamespace.default.extend(); +}); +enifed('ember-runtime/system/array_proxy', ['exports', 'ember-metal', 'ember-runtime/utils', 'ember-runtime/system/object', 'ember-runtime/mixins/mutable_array', 'ember-runtime/mixins/enumerable', 'ember-runtime/mixins/array'], function (exports, _emberMetal, _emberRuntimeUtils, _emberRuntimeSystemObject, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsArray) { + 'use strict'; - ComponentBuilder.prototype.dynamic = function dynamic(definitionArgs, definition, args, symbolTable) { - var shadow = arguments.length <= 4 || arguments[4] === undefined ? _glimmerRuntimeLibUtils.EMPTY_ARRAY : arguments[4]; - - this.dsl.unit(function (dsl) { - dsl.putArgs(definitionArgs); - dsl.putValue(_glimmerRuntimeLibCompiledExpressionsFunction.default(definition)); - dsl.test('simple'); - dsl.enter('BEGIN', 'END'); - dsl.label('BEGIN'); - dsl.jumpUnless('END'); - dsl.putDynamicComponentDefinition(); - dsl.openComponent(args, shadow); - dsl.closeComponent(); - dsl.label('END'); - dsl.exit(); - }); - }; + /** + @module ember + @submodule ember-runtime + */ - return ComponentBuilder; - })(); + var OUT_OF_RANGE_EXCEPTION = 'Index out of range'; + var EMPTY = []; - var CompileIntoList = (function (_LinkedList) { - babelHelpers.inherits(CompileIntoList, _LinkedList); + function K() { + return this; + } - function CompileIntoList(env, symbolTable) { - _LinkedList.call(this); - this.env = env; - this.symbolTable = symbolTable; - var dsl = new _glimmerRuntimeLibCompiledOpcodesBuilder.default(this, symbolTable, env); - this.component = new ComponentBuilder(dsl); + /** + An ArrayProxy wraps any other object that implements `Ember.Array` and/or + `Ember.MutableArray,` forwarding all requests. This makes it very useful for + a number of binding use cases or other cases where being able to swap + out the underlying array is useful. + + A simple example of usage: + + ```javascript + let pets = ['dog', 'cat', 'fish']; + let ap = Ember.ArrayProxy.create({ content: Ember.A(pets) }); + + ap.get('firstObject'); // 'dog' + ap.set('content', ['amoeba', 'paramecium']); + ap.get('firstObject'); // 'amoeba' + ``` + + This class can also be useful as a layer to transform the contents of + an array, as they are accessed. This can be done by overriding + `objectAtContent`: + + ```javascript + let pets = ['dog', 'cat', 'fish']; + let ap = Ember.ArrayProxy.create({ + content: Ember.A(pets), + objectAtContent: function(idx) { + return this.get('content').objectAt(idx).toUpperCase(); } + }); + + ap.get('firstObject'); // . 'DOG' + ``` + + @class ArrayProxy + @namespace Ember + @extends Ember.Object + @uses Ember.MutableArray + @public + */ + exports.default = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsMutable_array.default, { - CompileIntoList.prototype.getLocalSymbol = function getLocalSymbol(name) { - return this.symbolTable.getLocal(name); - }; - - CompileIntoList.prototype.hasLocalSymbol = function hasLocalSymbol(name) { - return typeof this.symbolTable.getLocal(name) === 'number'; - }; - - CompileIntoList.prototype.getNamedSymbol = function getNamedSymbol(name) { - return this.symbolTable.getNamed(name); - }; - - CompileIntoList.prototype.hasNamedSymbol = function hasNamedSymbol(name) { - return typeof this.symbolTable.getNamed(name) === 'number'; - }; - - CompileIntoList.prototype.getBlockSymbol = function getBlockSymbol(name) { - return this.symbolTable.getYield(name); - }; - - CompileIntoList.prototype.hasBlockSymbol = function hasBlockSymbol(name) { - return typeof this.symbolTable.getYield(name) === 'number'; - }; - - CompileIntoList.prototype.getPartialArgsSymbol = function getPartialArgsSymbol() { - return this.symbolTable.getPartialArgs(); - }; - - CompileIntoList.prototype.hasPartialArgsSymbol = function hasPartialArgsSymbol() { - return typeof this.symbolTable.getPartialArgs() === 'number'; - }; + /** + The content array. Must be an object that implements `Ember.Array` and/or + `Ember.MutableArray.` + @property content + @type Ember.Array + @private + */ + content: null, - CompileIntoList.prototype.toOpSeq = function toOpSeq() { - return this; - }; + /** + The array that the proxy pretends to be. In the default `ArrayProxy` + implementation, this and `content` are the same. Subclasses of `ArrayProxy` + can override this property to provide things like sorting and filtering. + @property arrangedContent + @private + */ + arrangedContent: _emberMetal.alias('content'), - return CompileIntoList; - })(_glimmerUtil.LinkedList); + /** + Should actually retrieve the object at the specified index from the + content. You can override this method in subclasses to transform the + content item to something new. + This method will only be called if content is non-`null`. + @method objectAtContent + @param {Number} idx The index to retrieve. + @return {Object} the value or undefined if none found + @public + */ + objectAtContent: function (idx) { + return _emberRuntimeMixinsArray.objectAt(_emberMetal.get(this, 'arrangedContent'), idx); + }, - exports.CompileIntoList = CompileIntoList; -}); + /** + Should actually replace the specified objects on the content array. + You can override this method in subclasses to transform the content item + into something new. + This method will only be called if content is non-`null`. + @method replaceContent + @param {Number} idx The starting index + @param {Number} amt The number of items to remove from the content. + @param {Array} objects Optional array of objects to insert or null if no + objects. + @return {void} + @private + */ + replaceContent: function (idx, amt, objects) { + _emberMetal.get(this, 'content').replace(idx, amt, objects); + }, -enifed('glimmer-runtime/lib/component/interfaces', ['exports'], function (exports) { - 'use strict'; + /** + Invoked when the content property is about to change. Notifies observers that the + entire array content will change. + @private + @method _contentWillChange + */ + _contentWillChange: _emberMetal._beforeObserver('content', function () { + this._teardownContent(); + }), - exports.isComponentDefinition = isComponentDefinition; - var COMPONENT_DEFINITION_BRAND = 'COMPONENT DEFINITION [id=e59c754e-61eb-4392-8c4a-2c0ac72bfcd4]'; + _teardownContent: function () { + var content = _emberMetal.get(this, 'content'); - function isComponentDefinition(obj) { - return typeof obj === 'object' && obj && obj[COMPONENT_DEFINITION_BRAND]; - } + if (content) { + _emberRuntimeMixinsArray.removeArrayObserver(content, this, { + willChange: 'contentArrayWillChange', + didChange: 'contentArrayDidChange' + }); + } + }, - var ComponentDefinition = function ComponentDefinition(name, manager, ComponentClass) { - this['COMPONENT DEFINITION [id=e59c754e-61eb-4392-8c4a-2c0ac72bfcd4]'] = true; - this.name = name; - this.manager = manager; - this.ComponentClass = ComponentClass; - }; + /** + Override to implement content array `willChange` observer. + @method contentArrayWillChange + @param {Ember.Array} contentArray the content array + @param {Number} start starting index of the change + @param {Number} removeCount count of items removed + @param {Number} addCount count of items added + @private + */ + contentArrayWillChange: K, + /** + Override to implement content array `didChange` observer. + @method contentArrayDidChange + @param {Ember.Array} contentArray the content array + @param {Number} start starting index of the change + @param {Number} removeCount count of items removed + @param {Number} addCount count of items added + @private + */ + contentArrayDidChange: K, - exports.ComponentDefinition = ComponentDefinition; -}); + /** + Invoked when the content property changes. Notifies observers that the + entire array content has changed. + @private + @method _contentDidChange + */ + _contentDidChange: _emberMetal.observer('content', function () { + var content = _emberMetal.get(this, 'content'); -enifed('glimmer-runtime/lib/dom/attribute-managers', ['exports', 'glimmer-runtime/lib/dom/sanitized-values', 'glimmer-runtime/lib/dom/props', 'glimmer-runtime/lib/dom/helper', 'glimmer-runtime/lib/compiled/opcodes/content'], function (exports, _glimmerRuntimeLibDomSanitizedValues, _glimmerRuntimeLibDomProps, _glimmerRuntimeLibDomHelper, _glimmerRuntimeLibCompiledOpcodesContent) { - 'use strict'; + _emberMetal.assert('Can\'t set ArrayProxy\'s content to itself', content !== this); - exports.defaultManagers = defaultManagers; - exports.defaultPropertyManagers = defaultPropertyManagers; - exports.defaultAttributeManagers = defaultAttributeManagers; - exports.readDOMAttr = readDOMAttr; + this._setupContent(); + }), - function defaultManagers(element, attr, isTrusting, namespace) { - var tagName = element.tagName; - var isSVG = element.namespaceURI === _glimmerRuntimeLibDomHelper.SVG_NAMESPACE; - if (isSVG) { - return defaultAttributeManagers(tagName, attr); - } + _setupContent: function () { + var content = _emberMetal.get(this, 'content'); - var _normalizeProperty = _glimmerRuntimeLibDomProps.normalizeProperty(element, attr); + if (content) { + _emberMetal.assert('ArrayProxy expects an Array or Ember.ArrayProxy, but you passed ' + typeof content, _emberRuntimeUtils.isArray(content) || content.isDestroyed); - var type = _normalizeProperty.type; - var normalized = _normalizeProperty.normalized; + _emberRuntimeMixinsArray.addArrayObserver(content, this, { + willChange: 'contentArrayWillChange', + didChange: 'contentArrayDidChange' + }); + } + }, - if (type === 'attr') { - return defaultAttributeManagers(tagName, normalized); - } else { - return defaultPropertyManagers(tagName, normalized); - } - } + _arrangedContentWillChange: _emberMetal._beforeObserver('arrangedContent', function () { + var arrangedContent = _emberMetal.get(this, 'arrangedContent'); + var len = arrangedContent ? _emberMetal.get(arrangedContent, 'length') : 0; - function defaultPropertyManagers(tagName, attr) { - if (_glimmerRuntimeLibDomSanitizedValues.requiresSanitization(tagName, attr)) { - return new SafePropertyManager(attr); - } - if (isUserInputValue(tagName, attr)) { - return INPUT_VALUE_PROPERTY_MANAGER; - } - if (isOptionSelected(tagName, attr)) { - return OPTION_SELECTED_MANAGER; - } - return new PropertyManager(attr); - } + this.arrangedContentArrayWillChange(this, 0, len, undefined); + this.arrangedContentWillChange(this); - function defaultAttributeManagers(tagName, attr) { - if (_glimmerRuntimeLibDomSanitizedValues.requiresSanitization(tagName, attr)) { - return new SafeAttributeManager(attr); - } - return new AttributeManager(attr); - } + this._teardownArrangedContent(arrangedContent); + }), - function readDOMAttr(element, attr) { - var isSVG = element.namespaceURI === _glimmerRuntimeLibDomHelper.SVG_NAMESPACE; + _arrangedContentDidChange: _emberMetal.observer('arrangedContent', function () { + var arrangedContent = _emberMetal.get(this, 'arrangedContent'); + var len = arrangedContent ? _emberMetal.get(arrangedContent, 'length') : 0; - var _normalizeProperty2 = _glimmerRuntimeLibDomProps.normalizeProperty(element, attr); + _emberMetal.assert('Can\'t set ArrayProxy\'s content to itself', arrangedContent !== this); - var type = _normalizeProperty2.type; - var normalized = _normalizeProperty2.normalized; + this._setupArrangedContent(); - if (isSVG) { - return element.getAttribute(normalized); - } - if (type === 'attr') { - return element.getAttribute(normalized); - } - { - return element[normalized]; - } - } + this.arrangedContentDidChange(this); + this.arrangedContentArrayDidChange(this, 0, undefined, len); + }), - ; + _setupArrangedContent: function () { + var arrangedContent = _emberMetal.get(this, 'arrangedContent'); - var AttributeManager = (function () { - function AttributeManager(attr) { - this.attr = attr; - } + if (arrangedContent) { + _emberMetal.assert('ArrayProxy expects an Array or Ember.ArrayProxy, but you passed ' + typeof arrangedContent, _emberRuntimeUtils.isArray(arrangedContent) || arrangedContent.isDestroyed); - AttributeManager.prototype.setAttribute = function setAttribute(env, element, value, namespace) { - var dom = env.getAppendOperations(); - var normalizedValue = normalizeAttributeValue(value); - if (!isAttrRemovalValue(normalizedValue)) { - dom.setAttribute(element, this.attr, normalizedValue, namespace); - } - }; + _emberRuntimeMixinsArray.addArrayObserver(arrangedContent, this, { + willChange: 'arrangedContentArrayWillChange', + didChange: 'arrangedContentArrayDidChange' + }); + } + }, - AttributeManager.prototype.updateAttribute = function updateAttribute(env, element, value, namespace) { - if (value === null || value === undefined || value === false) { - if (namespace) { - env.getDOM().removeAttributeNS(element, namespace, this.attr); - } else { - env.getDOM().removeAttribute(element, this.attr); - } - } else { - this.setAttribute(env, element, value); - } - }; + _teardownArrangedContent: function () { + var arrangedContent = _emberMetal.get(this, 'arrangedContent'); - return AttributeManager; - })(); + if (arrangedContent) { + _emberRuntimeMixinsArray.removeArrayObserver(arrangedContent, this, { + willChange: 'arrangedContentArrayWillChange', + didChange: 'arrangedContentArrayDidChange' + }); + } + }, - exports.AttributeManager = AttributeManager; + arrangedContentWillChange: K, + arrangedContentDidChange: K, - ; + objectAt: function (idx) { + return _emberMetal.get(this, 'content') && this.objectAtContent(idx); + }, - var PropertyManager = (function (_AttributeManager) { - babelHelpers.inherits(PropertyManager, _AttributeManager); + length: _emberMetal.computed(function () { + var arrangedContent = _emberMetal.get(this, 'arrangedContent'); + return arrangedContent ? _emberMetal.get(arrangedContent, 'length') : 0; + // No dependencies since Enumerable notifies length of change + }), - function PropertyManager() { - _AttributeManager.apply(this, arguments); - } + _replace: function (idx, amt, objects) { + var content = _emberMetal.get(this, 'content'); + _emberMetal.assert('The content property of ' + this.constructor + ' should be set before modifying it', content); + if (content) { + this.replaceContent(idx, amt, objects); + } - PropertyManager.prototype.setAttribute = function setAttribute(env, element, value, namespace) { - if (!isAttrRemovalValue(value)) { - element[this.attr] = value; - } - }; + return this; + }, - PropertyManager.prototype.removeAttribute = function removeAttribute(env, element, namespace) { - // TODO this sucks but to preserve properties first and to meet current - // semantics we must do this. - var attr = this.attr; + replace: function () { + if (_emberMetal.get(this, 'arrangedContent') === _emberMetal.get(this, 'content')) { + this._replace.apply(this, arguments); + } else { + throw new _emberMetal.Error('Using replace on an arranged ArrayProxy is not allowed.'); + } + }, - if (namespace) { - env.getDOM().removeAttributeNS(element, namespace, attr); - } else { - env.getDOM().removeAttribute(element, attr); - } - }; + _insertAt: function (idx, object) { + if (idx > _emberMetal.get(this, 'content.length')) { + throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); + } - PropertyManager.prototype.updateAttribute = function updateAttribute(env, element, value, namespace) { - // ensure the property is always updated - element[this.attr] = value; - if (isAttrRemovalValue(value)) { - this.removeAttribute(env, element, namespace); - } - }; + this._replace(idx, 0, [object]); + return this; + }, - return PropertyManager; - })(AttributeManager); + insertAt: function (idx, object) { + if (_emberMetal.get(this, 'arrangedContent') === _emberMetal.get(this, 'content')) { + return this._insertAt(idx, object); + } else { + throw new _emberMetal.Error('Using insertAt on an arranged ArrayProxy is not allowed.'); + } + }, - exports.PropertyManager = PropertyManager; + removeAt: function (start, len) { + if ('number' === typeof start) { + var content = _emberMetal.get(this, 'content'); + var arrangedContent = _emberMetal.get(this, 'arrangedContent'); + var indices = []; - ; - function normalizeAttributeValue(value) { - if (value === false || value === undefined || value === null) { - return null; - } - if (value === true) { - return ''; - } - // onclick function etc in SSR - if (typeof value === 'function') { - return null; + if (start < 0 || start >= _emberMetal.get(this, 'length')) { + throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); } - return String(value); - } - function isAttrRemovalValue(value) { - return value === null || value === undefined; - } - var SafePropertyManager = (function (_PropertyManager) { - babelHelpers.inherits(SafePropertyManager, _PropertyManager); - - function SafePropertyManager() { - _PropertyManager.apply(this, arguments); + if (len === undefined) { + len = 1; } - SafePropertyManager.prototype.setAttribute = function setAttribute(env, element, value) { - _PropertyManager.prototype.setAttribute.call(this, env, element, _glimmerRuntimeLibDomSanitizedValues.sanitizeAttributeValue(env, element, this.attr, value)); - }; - - SafePropertyManager.prototype.updateAttribute = function updateAttribute(env, element, value) { - _PropertyManager.prototype.updateAttribute.call(this, env, element, _glimmerRuntimeLibDomSanitizedValues.sanitizeAttributeValue(env, element, this.attr, value)); - }; - - return SafePropertyManager; - })(PropertyManager); - - function isUserInputValue(tagName, attribute) { - return (tagName === 'INPUT' || tagName === 'TEXTAREA') && attribute === 'value'; - } - - var InputValuePropertyManager = (function (_AttributeManager2) { - babelHelpers.inherits(InputValuePropertyManager, _AttributeManager2); - - function InputValuePropertyManager() { - _AttributeManager2.apply(this, arguments); + // Get a list of indices in original content to remove + for (var i = start; i < start + len; i++) { + // Use arrangedContent here so we avoid confusion with objects transformed by objectAtContent + indices.push(content.indexOf(_emberRuntimeMixinsArray.objectAt(arrangedContent, i))); } - InputValuePropertyManager.prototype.setAttribute = function setAttribute(env, element, value) { - var input = element; - input.value = _glimmerRuntimeLibCompiledOpcodesContent.normalizeTextValue(value); - }; - - InputValuePropertyManager.prototype.updateAttribute = function updateAttribute(env, element, value) { - var input = element; - var currentValue = input.value; - var normalizedValue = _glimmerRuntimeLibCompiledOpcodesContent.normalizeTextValue(value); - if (currentValue !== normalizedValue) { - input.value = normalizedValue; - } - }; - - return InputValuePropertyManager; - })(AttributeManager); - - var INPUT_VALUE_PROPERTY_MANAGER = new InputValuePropertyManager('value'); - exports.INPUT_VALUE_PROPERTY_MANAGER = INPUT_VALUE_PROPERTY_MANAGER; - function isOptionSelected(tagName, attribute) { - return tagName === 'OPTION' && attribute === 'selected'; - } - - var OptionSelectedManager = (function (_PropertyManager2) { - babelHelpers.inherits(OptionSelectedManager, _PropertyManager2); + // Replace in reverse order since indices will change + indices.sort(function (a, b) { + return b - a; + }); - function OptionSelectedManager() { - _PropertyManager2.apply(this, arguments); + _emberMetal.beginPropertyChanges(); + for (var i = 0; i < indices.length; i++) { + this._replace(indices[i], 1, EMPTY); } + _emberMetal.endPropertyChanges(); + } - OptionSelectedManager.prototype.setAttribute = function setAttribute(env, element, value) { - if (value !== null && value !== undefined && value !== false) { - var option = element; - option.selected = true; - } - }; + return this; + }, - OptionSelectedManager.prototype.updateAttribute = function updateAttribute(env, element, value) { - var option = element; - if (value) { - option.selected = true; - } else { - option.selected = false; - } - }; + pushObject: function (obj) { + this._insertAt(_emberMetal.get(this, 'content.length'), obj); + return obj; + }, - return OptionSelectedManager; - })(PropertyManager); + pushObjects: function (objects) { + if (!(_emberRuntimeMixinsEnumerable.default.detect(objects) || _emberRuntimeUtils.isArray(objects))) { + throw new TypeError('Must pass Ember.Enumerable to Ember.MutableArray#pushObjects'); + } + this._replace(_emberMetal.get(this, 'length'), 0, objects); + return this; + }, - var OPTION_SELECTED_MANAGER = new OptionSelectedManager('selected'); - exports.OPTION_SELECTED_MANAGER = OPTION_SELECTED_MANAGER; + setObjects: function (objects) { + if (objects.length === 0) { + return this.clear(); + } - var SafeAttributeManager = (function (_AttributeManager3) { - babelHelpers.inherits(SafeAttributeManager, _AttributeManager3); + var len = _emberMetal.get(this, 'length'); + this._replace(0, len, objects); + return this; + }, - function SafeAttributeManager() { - _AttributeManager3.apply(this, arguments); - } + unshiftObject: function (obj) { + this._insertAt(0, obj); + return obj; + }, - SafeAttributeManager.prototype.setAttribute = function setAttribute(env, element, value) { - _AttributeManager3.prototype.setAttribute.call(this, env, element, _glimmerRuntimeLibDomSanitizedValues.sanitizeAttributeValue(env, element, this.attr, value)); - }; + unshiftObjects: function (objects) { + this._replace(0, 0, objects); + return this; + }, - SafeAttributeManager.prototype.updateAttribute = function updateAttribute(env, element, value, namespace) { - _AttributeManager3.prototype.updateAttribute.call(this, env, element, _glimmerRuntimeLibDomSanitizedValues.sanitizeAttributeValue(env, element, this.attr, value)); - }; + slice: function () { + var arr = this.toArray(); + return arr.slice.apply(arr, arguments); + }, - return SafeAttributeManager; - })(AttributeManager); -}); + arrangedContentArrayWillChange: function (item, idx, removedCnt, addedCnt) { + this.arrayContentWillChange(idx, removedCnt, addedCnt); + }, -enifed('glimmer-runtime/lib/dom/helper', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/compat/inner-html-fix', 'glimmer-runtime/lib/compat/svg-inner-html-fix', 'glimmer-runtime/lib/compat/text-node-merging-fix', 'glimmer-runtime/lib/dom/interfaces'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibCompatInnerHtmlFix, _glimmerRuntimeLibCompatSvgInnerHtmlFix, _glimmerRuntimeLibCompatTextNodeMergingFix, _glimmerRuntimeLibDomInterfaces) { - 'use strict'; + arrangedContentArrayDidChange: function (item, idx, removedCnt, addedCnt) { + this.arrayContentDidChange(idx, removedCnt, addedCnt); + }, - exports.isWhitespace = isWhitespace; - exports.moveNodesBefore = moveNodesBefore; - exports.insertHTMLBefore = _insertHTMLBefore; - var SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; - exports.SVG_NAMESPACE = SVG_NAMESPACE; - // http://www.w3.org/TR/html/syntax.html#html-integration-point - var SVG_INTEGRATION_POINTS = { foreignObject: 1, desc: 1, title: 1 }; - // http://www.w3.org/TR/html/syntax.html#adjust-svg-attributes - // TODO: Adjust SVG attributes - // http://www.w3.org/TR/html/syntax.html#parsing-main-inforeign - // TODO: Adjust SVG elements - // http://www.w3.org/TR/html/syntax.html#parsing-main-inforeign - var BLACKLIST_TABLE = Object.create(null); - exports.BLACKLIST_TABLE = BLACKLIST_TABLE; - ["b", "big", "blockquote", "body", "br", "center", "code", "dd", "div", "dl", "dt", "em", "embed", "h1", "h2", "h3", "h4", "h5", "h6", "head", "hr", "i", "img", "li", "listing", "main", "meta", "nobr", "ol", "p", "pre", "ruby", "s", "small", "span", "strong", "strike", "sub", "sup", "table", "tt", "u", "ul", "var"].forEach(function (tag) { - return BLACKLIST_TABLE[tag] = 1; - }); - var WHITESPACE = /[\t-\r \xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/; - var doc = typeof document === 'undefined' ? undefined : document; - - function isWhitespace(string) { - return WHITESPACE.test(string); - } - - function moveNodesBefore(source, target, nextSibling) { - var first = source.firstChild; - var last = null; - var current = first; - while (current) { - last = current; - current = current.nextSibling; - target.insertBefore(last, nextSibling); - } - return [first, last]; - } - - var DOM; - exports.DOM = DOM; - (function (DOM) { - var TreeConstruction = (function () { - function TreeConstruction(document) { - this.document = document; - this.uselessElement = null; - this.setupUselessElement(); - } + init: function () { + this._super.apply(this, arguments); + this._setupContent(); + this._setupArrangedContent(); + }, - TreeConstruction.prototype.setupUselessElement = function setupUselessElement() { - this.uselessElement = this.document.createElement('div'); - }; + willDestroy: function () { + this._teardownArrangedContent(); + this._teardownContent(); + } + }); +}); +enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/mixins/action_handler', 'ember-runtime/inject'], function (exports, _emberUtils, _emberMetal, _emberRuntimeMixinsAction_handler, _emberRuntimeInject) { + 'no use strict'; + // Remove "use strict"; from transpiled module until + // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - TreeConstruction.prototype.createElement = function createElement(tag, context) { - var isElementInSVGNamespace = undefined, - isHTMLIntegrationPoint = undefined; - if (context) { - isElementInSVGNamespace = context.namespaceURI === SVG_NAMESPACE || tag === 'svg'; - isHTMLIntegrationPoint = SVG_INTEGRATION_POINTS[context.tagName]; - } else { - isElementInSVGNamespace = tag === 'svg'; - isHTMLIntegrationPoint = false; - } - if (isElementInSVGNamespace && !isHTMLIntegrationPoint) { - // FIXME: This does not properly handle with color, face, or - // size attributes, which is also disallowed by the spec. We should fix - // this. - if (BLACKLIST_TABLE[tag]) { - throw new Error('Cannot create a ' + tag + ' inside an SVG context'); - } - return this.document.createElementNS(SVG_NAMESPACE, tag); - } else { - return this.document.createElement(tag); - } - }; + /** + @module ember + @submodule ember-runtime + */ - TreeConstruction.prototype.createElementNS = function createElementNS(namespace, tag) { - return this.document.createElementNS(namespace, tag); - }; + // using ember-metal/lib/main here to ensure that ember-debug is setup + // if present - TreeConstruction.prototype.setAttribute = function setAttribute(element, name, value, namespace) { - if (namespace) { - element.setAttributeNS(namespace, name, value); - } else { - element.setAttribute(name, value); - } - }; + var _Mixin$create, _ClassMixinProps; - TreeConstruction.prototype.createTextNode = function createTextNode(text) { - return this.document.createTextNode(text); - }; + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['.'], ['.']); - TreeConstruction.prototype.createComment = function createComment(data) { - return this.document.createComment(data); - }; + var schedule = _emberMetal.run.schedule; + var applyMixin = _emberMetal.Mixin._apply; + var finishPartial = _emberMetal.Mixin.finishPartial; + var reopen = _emberMetal.Mixin.prototype.reopen; + var hasCachedComputedProperties = false; - TreeConstruction.prototype.insertBefore = function insertBefore(parent, node, reference) { - parent.insertBefore(node, reference); - }; + var POST_INIT = _emberUtils.symbol('POST_INIT'); - TreeConstruction.prototype.insertHTMLBefore = function insertHTMLBefore(parent, html, reference) { - return _insertHTMLBefore(this.uselessElement, parent, reference, html); - }; + exports.POST_INIT = POST_INIT; + function makeCtor() { + // Note: avoid accessing any properties on the object since it makes the + // method a lot faster. This is glue code so we want it to be as fast as + // possible. - return TreeConstruction; - })(); + var wasApplied = false; + var initProperties = undefined; - DOM.TreeConstruction = TreeConstruction; - var appliedTreeContruction = TreeConstruction; - appliedTreeContruction = _glimmerRuntimeLibCompatTextNodeMergingFix.treeConstruction(doc, appliedTreeContruction); - appliedTreeContruction = _glimmerRuntimeLibCompatInnerHtmlFix.treeConstruction(doc, appliedTreeContruction); - appliedTreeContruction = _glimmerRuntimeLibCompatSvgInnerHtmlFix.treeConstruction(doc, appliedTreeContruction, SVG_NAMESPACE); - DOM.DOMTreeConstruction = appliedTreeContruction; - })(DOM || (exports.DOM = DOM = {})); + var Class = (function () { + function Class() { +babelHelpers.classCallCheck(this, Class); - var DOMChanges = (function () { - function DOMChanges(document) { - this.document = document; - this.uselessElement = null; - this.namespace = null; - this.uselessElement = this.document.createElement('div'); + if (!wasApplied) { + Class.proto(); // prepare prototype... } - DOMChanges.prototype.setAttribute = function setAttribute(element, name, value) { - element.setAttribute(name, value); - }; - - DOMChanges.prototype.setAttributeNS = function setAttributeNS(element, namespace, name, value) { - element.setAttributeNS(namespace, name, value); - }; - - DOMChanges.prototype.removeAttribute = function removeAttribute(element, name) { - element.removeAttribute(name); - }; + if (arguments.length > 0) { + initProperties = [arguments[0]]; + } - DOMChanges.prototype.removeAttributeNS = function removeAttributeNS(element, namespace, name) { - element.removeAttributeNS(namespace, name); - }; + this.__defineNonEnumerable(_emberUtils.GUID_KEY_PROPERTY); + var m = _emberMetal.meta(this); + var proto = m.proto; + m.proto = this; + if (initProperties) { + // capture locally so we can clear the closed over variable + var props = initProperties; + initProperties = null; - DOMChanges.prototype.createTextNode = function createTextNode(text) { - return this.document.createTextNode(text); - }; + var concatenatedProperties = this.concatenatedProperties; + var mergedProperties = this.mergedProperties; - DOMChanges.prototype.createComment = function createComment(data) { - return this.document.createComment(data); - }; + for (var i = 0; i < props.length; i++) { + var properties = props[i]; + _emberMetal.assert('Ember.Object.create no longer supports mixing in other ' + 'definitions, use .extend & .create separately instead.', !(properties instanceof _emberMetal.Mixin)); - DOMChanges.prototype.createElement = function createElement(tag, context) { - var isElementInSVGNamespace = undefined, - isHTMLIntegrationPoint = undefined; - if (context) { - isElementInSVGNamespace = context.namespaceURI === SVG_NAMESPACE || tag === 'svg'; - isHTMLIntegrationPoint = SVG_INTEGRATION_POINTS[context.tagName]; - } else { - isElementInSVGNamespace = tag === 'svg'; - isHTMLIntegrationPoint = false; - } - if (isElementInSVGNamespace && !isHTMLIntegrationPoint) { - // FIXME: This does not properly handle with color, face, or - // size attributes, which is also disallowed by the spec. We should fix - // this. - if (BLACKLIST_TABLE[tag]) { - throw new Error('Cannot create a ' + tag + ' inside an SVG context'); - } - return this.document.createElementNS(SVG_NAMESPACE, tag); - } else { - return this.document.createElement(tag); + if (typeof properties !== 'object' && properties !== undefined) { + throw new _emberMetal.Error('Ember.Object.create only accepts objects.'); } - }; - - DOMChanges.prototype.insertHTMLBefore = function insertHTMLBefore(_parent, nextSibling, html) { - return _insertHTMLBefore(this.uselessElement, _parent, nextSibling, html); - }; - - DOMChanges.prototype.insertNodeBefore = function insertNodeBefore(parent, node, reference) { - if (isDocumentFragment(node)) { - var firstChild = node.firstChild; - var lastChild = node.lastChild; - this.insertBefore(parent, node, reference); - return new _glimmerRuntimeLibBounds.ConcreteBounds(parent, firstChild, lastChild); - } else { - this.insertBefore(parent, node, reference); - return new _glimmerRuntimeLibBounds.SingleNodeBounds(parent, node); + if (!properties) { + continue; } - }; - DOMChanges.prototype.insertTextBefore = function insertTextBefore(parent, nextSibling, text) { - var textNode = this.createTextNode(text); - this.insertBefore(parent, textNode, nextSibling); - return textNode; - }; + var keyNames = Object.keys(properties); - DOMChanges.prototype.insertBefore = function insertBefore(element, node, reference) { - element.insertBefore(node, reference); - }; + for (var j = 0; j < keyNames.length; j++) { + var keyName = keyNames[j]; + var value = properties[keyName]; - DOMChanges.prototype.insertAfter = function insertAfter(element, node, reference) { - this.insertBefore(element, node, reference.nextSibling); - }; + if (_emberMetal.detectBinding(keyName)) { + m.writeBindings(keyName, value); + } - return DOMChanges; - })(); + var possibleDesc = this[keyName]; + var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - exports.DOMChanges = DOMChanges; - - function _insertHTMLBefore(_useless, _parent, _nextSibling, html) { - // TypeScript vendored an old version of the DOM spec where `insertAdjacentHTML` - // only exists on `HTMLElement` but not on `Element`. We actually work with the - // newer version of the DOM API here (and monkey-patch this method in `./compat` - // when we detect older browsers). This is a hack to work around this limitation. - var parent = _parent; - var useless = _useless; - var nextSibling = _nextSibling; - var prev = nextSibling ? nextSibling.previousSibling : parent.lastChild; - var last = undefined; - if (html === null || html === '') { - return new _glimmerRuntimeLibBounds.ConcreteBounds(parent, null, null); - } - if (nextSibling === null) { - parent.insertAdjacentHTML('beforeEnd', html); - last = parent.lastChild; - } else if (nextSibling instanceof HTMLElement) { - nextSibling.insertAdjacentHTML('beforeBegin', html); - last = nextSibling.previousSibling; - } else { - // Non-element nodes do not support insertAdjacentHTML, so add an - // element and call it on that element. Then remove the element. - // - // This also protects Edge, IE and Firefox w/o the inspector open - // from merging adjacent text nodes. See ./compat/text-node-merging-fix.ts - parent.insertBefore(useless, nextSibling); - useless.insertAdjacentHTML('beforeBegin', html); - last = useless.previousSibling; - parent.removeChild(useless); - } - var first = prev ? prev.nextSibling : parent.firstChild; - return new _glimmerRuntimeLibBounds.ConcreteBounds(parent, first, last); - } + _emberMetal.assert('Ember.Object.create no longer supports defining computed ' + 'properties. Define computed properties using extend() or reopen() ' + 'before calling create().', !(value instanceof _emberMetal.ComputedProperty)); + _emberMetal.assert('Ember.Object.create no longer supports defining methods that call _super.', !(typeof value === 'function' && value.toString().indexOf('._super') !== -1)); + _emberMetal.assert('`actions` must be provided at extend time, not at create time, ' + 'when Ember.ActionHandler is used (i.e. views, controllers & routes).', !(keyName === 'actions' && _emberRuntimeMixinsAction_handler.default.detect(this))); - function isDocumentFragment(node) { - return node.nodeType === Node.DOCUMENT_FRAGMENT_NODE; - } - var helper = DOMChanges; - helper = _glimmerRuntimeLibCompatTextNodeMergingFix.domChanges(doc, helper); - helper = _glimmerRuntimeLibCompatInnerHtmlFix.domChanges(doc, helper); - helper = _glimmerRuntimeLibCompatSvgInnerHtmlFix.domChanges(doc, helper, SVG_NAMESPACE); - exports.default = helper; - var DOMTreeConstruction = DOM.DOMTreeConstruction; - exports.DOMTreeConstruction = DOMTreeConstruction; - exports.DOMNamespace = _glimmerRuntimeLibDomInterfaces.Namespace; -}); + if (concatenatedProperties && concatenatedProperties.length > 0 && concatenatedProperties.indexOf(keyName) >= 0) { + var baseValue = this[keyName]; -enifed("glimmer-runtime/lib/dom/interfaces", ["exports"], function (exports) { - "use strict"; + if (baseValue) { + if ('function' === typeof baseValue.concat) { + value = baseValue.concat(value); + } else { + value = _emberUtils.makeArray(baseValue).concat(value); + } + } else { + value = _emberUtils.makeArray(value); + } + } - var NodeType; - exports.NodeType = NodeType; - (function (NodeType) { - NodeType[NodeType["Element"] = 0] = "Element"; - NodeType[NodeType["Attribute"] = 1] = "Attribute"; - NodeType[NodeType["Text"] = 2] = "Text"; - NodeType[NodeType["CdataSection"] = 3] = "CdataSection"; - NodeType[NodeType["EntityReference"] = 4] = "EntityReference"; - NodeType[NodeType["Entity"] = 5] = "Entity"; - NodeType[NodeType["ProcessingInstruction"] = 6] = "ProcessingInstruction"; - NodeType[NodeType["Comment"] = 7] = "Comment"; - NodeType[NodeType["Document"] = 8] = "Document"; - NodeType[NodeType["DocumentType"] = 9] = "DocumentType"; - NodeType[NodeType["DocumentFragment"] = 10] = "DocumentFragment"; - NodeType[NodeType["Notation"] = 11] = "Notation"; - })(NodeType || (exports.NodeType = NodeType = {})); -}); - -enifed('glimmer-runtime/lib/dom/props', ['exports'], function (exports) { - /* - * @method normalizeProperty - * @param element {HTMLElement} - * @param slotName {String} - * @returns {Object} { name, type } - */ - 'use strict'; + if (mergedProperties && mergedProperties.length && mergedProperties.indexOf(keyName) >= 0) { + var originalValue = this[keyName]; - exports.normalizeProperty = normalizeProperty; - exports.normalizePropertyValue = normalizePropertyValue; + value = _emberUtils.assign({}, originalValue, value); + } - function normalizeProperty(element, slotName) { - var type = undefined, - normalized = undefined; - if (slotName in element) { - normalized = slotName; - type = 'prop'; - } else { - var lower = slotName.toLowerCase(); - if (lower in element) { - type = 'prop'; - normalized = lower; - } else { - type = 'attr'; - normalized = slotName; + if (desc) { + desc.set(this, keyName, value); + } else { + if (typeof this.setUnknownProperty === 'function' && !(keyName in this)) { + this.setUnknownProperty(keyName, value); + } else { + if (true) { + _emberMetal.defineProperty(this, keyName, null, value); // setup mandatory setter + } else { + this[keyName] = value; + } + } + } } + } } - if (type === 'prop' && (normalized.toLowerCase() === 'style' || preferAttr(element.tagName, normalized))) { - type = 'attr'; - } - return { normalized: normalized, type: type }; - } - - function normalizePropertyValue(value) { - if (value === '') { - return true; - } - return value; - } - - // properties that MUST be set as attributes, due to: - // * browser bug - // * strange spec outlier - var ATTR_OVERRIDES = { - // phantomjs < 2.0 lets you set it as a prop but won't reflect it - // back to the attribute. button.getAttribute('type') === null - BUTTON: { type: true, form: true }, - INPUT: { - // Some version of IE (like IE9) actually throw an exception - // if you set input.type = 'something-unknown' - type: true, - form: true, - // Chrome 46.0.2464.0: 'autocorrect' in document.createElement('input') === false - // Safari 8.0.7: 'autocorrect' in document.createElement('input') === false - // Mobile Safari (iOS 8.4 simulator): 'autocorrect' in document.createElement('input') === true - autocorrect: true, - // Chrome 54.0.2840.98: 'list' in document.createElement('input') === true - // Safari 9.1.3: 'list' in document.createElement('input') === false - list: true - }, - // element.form is actually a legitimate readOnly property, that is to be - // mutated, but must be mutated by setAttribute... - SELECT: { form: true }, - OPTION: { form: true }, - TEXTAREA: { form: true }, - LABEL: { form: true }, - FIELDSET: { form: true }, - LEGEND: { form: true }, - OBJECT: { form: true } - }; - function preferAttr(tagName, propName) { - var tag = ATTR_OVERRIDES[tagName.toUpperCase()]; - return tag && tag[propName.toLowerCase()] || false; - } -}); -enifed('glimmer-runtime/lib/dom/sanitized-values', ['exports', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-runtime/lib/upsert'], function (exports, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerRuntimeLibUpsert) { - 'use strict'; + finishPartial(this, m); - exports.requiresSanitization = requiresSanitization; - exports.sanitizeAttributeValue = sanitizeAttributeValue; + this.init.apply(this, arguments); - var badProtocols = ['javascript:', 'vbscript:']; - var badTags = ['A', 'BODY', 'LINK', 'IMG', 'IFRAME', 'BASE', 'FORM']; - var badTagsForDataURI = ['EMBED']; - var badAttributes = ['href', 'src', 'background', 'action']; - var badAttributesForDataURI = ['src']; - function has(array, item) { - return array.indexOf(item) !== -1; - } - function checkURI(tagName, attribute) { - return (tagName === null || has(badTags, tagName)) && has(badAttributes, attribute); - } - function checkDataURI(tagName, attribute) { - return has(badTagsForDataURI, tagName) && has(badAttributesForDataURI, attribute); - } + this[POST_INIT](); - function requiresSanitization(tagName, attribute) { - return checkURI(tagName, attribute) || checkDataURI(tagName, attribute); - } + m.proto = proto; + _emberMetal.finishChains(this); + _emberMetal.sendEvent(this, 'init'); + } - function sanitizeAttributeValue(env, element, attribute, value) { - var tagName = undefined; - if (value === null || value === undefined) { - return value; - } - if (_glimmerRuntimeLibUpsert.isSafeString(value)) { - return value.toHTML(); + Class.willReopen = function willReopen() { + if (wasApplied) { + Class.PrototypeMixin = _emberMetal.Mixin.create(Class.PrototypeMixin); } - if (!element) { - tagName = null; - } else { - tagName = element.tagName.toUpperCase(); - } - var str = _glimmerRuntimeLibCompiledOpcodesContent.normalizeTextValue(value); - if (checkURI(tagName, attribute)) { - var protocol = env.protocolForURL(str); - if (has(badProtocols, protocol)) { - return 'unsafe:' + str; - } - } - if (checkDataURI(tagName, attribute)) { - return 'unsafe:' + str; - } - return str; - } -}); -enifed('glimmer-runtime/lib/environment', ['exports', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/dom/attribute-managers', 'glimmer-util', 'glimmer-runtime/lib/syntax/core', 'glimmer-runtime/lib/syntax/builtins/if', 'glimmer-runtime/lib/syntax/builtins/unless', 'glimmer-runtime/lib/syntax/builtins/with', 'glimmer-runtime/lib/syntax/builtins/each'], function (exports, _glimmerRuntimeLibReferences, _glimmerRuntimeLibDomAttributeManagers, _glimmerUtil, _glimmerRuntimeLibSyntaxCore, _glimmerRuntimeLibSyntaxBuiltinsIf, _glimmerRuntimeLibSyntaxBuiltinsUnless, _glimmerRuntimeLibSyntaxBuiltinsWith, _glimmerRuntimeLibSyntaxBuiltinsEach) { - 'use strict'; + wasApplied = false; + }; - var Scope = (function () { - function Scope(references) { - var callerScope = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + Class._initProperties = function _initProperties(args) { + initProperties = args; + }; - this.callerScope = null; - this.slots = references; - this.callerScope = callerScope; + Class.proto = function proto() { + var superclass = Class.superclass; + if (superclass) { + superclass.proto(); } - Scope.root = function root(self) { - var size = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + if (!wasApplied) { + wasApplied = true; + Class.PrototypeMixin.applyPartial(Class.prototype); + } - var refs = new Array(size + 1); - for (var i = 0; i <= size; i++) { - refs[i] = _glimmerRuntimeLibReferences.UNDEFINED_REFERENCE; - } - return new Scope(refs).init({ self: self }); - }; + return this.prototype; + }; - Scope.prototype.init = function init(_ref) { - var self = _ref.self; + return Class; + })(); - this.slots[0] = self; - return this; - }; + Class.toString = _emberMetal.Mixin.prototype.toString; - Scope.prototype.getSelf = function getSelf() { - return this.slots[0]; - }; + return Class; + } - Scope.prototype.getSymbol = function getSymbol(symbol) { - return this.slots[symbol]; - }; + /** + @class CoreObject + @namespace Ember + @public + */ + var CoreObject = makeCtor(); + CoreObject.toString = function () { + return 'Ember.CoreObject'; + }; + CoreObject.PrototypeMixin = _emberMetal.Mixin.create((_Mixin$create = { + reopen: function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - Scope.prototype.getBlock = function getBlock(symbol) { - return this.slots[symbol]; - }; + applyMixin(this, args, true); + return this; + }, - Scope.prototype.getPartialArgs = function getPartialArgs(symbol) { - return this.slots[symbol]; - }; + /** + An overridable method called when objects are instantiated. By default, + does nothing unless it is overridden during class definition. + Example: + ```javascript + const Person = Ember.Object.extend({ + init() { + alert(`Name is ${this.get('name')}`); + } + }); + let steve = Person.create({ + name: "Steve" + }); + // alerts 'Name is Steve'. + ``` + NOTE: If you do override `init` for a framework class like `Ember.View`, + be sure to call `this._super(...arguments)` in your + `init` declaration! If you don't, Ember may not have an opportunity to + do important setup work, and you'll see strange behavior in your + application. + @method init + @public + */ + init: function () {} - Scope.prototype.bindSymbol = function bindSymbol(symbol, value) { - this.slots[symbol] = value; - }; + }, _Mixin$create[POST_INIT] = function () {}, _Mixin$create.__defineNonEnumerable = function (property) { + Object.defineProperty(this, property.name, property.descriptor); + //this[property.name] = property.descriptor.value; + }, _Mixin$create.concatenatedProperties = null, _Mixin$create.mergedProperties = null, _Mixin$create.isDestroyed = _emberMetal.descriptor({ + get: function () { + return _emberMetal.meta(this).isSourceDestroyed(); + }, - Scope.prototype.bindBlock = function bindBlock(symbol, value) { - this.slots[symbol] = value; - }; + set: function (value) { + // prevent setting while applying mixins + if (typeof value === 'object' && value !== null && value.isDescriptor) { + return; + } - Scope.prototype.bindPartialArgs = function bindPartialArgs(symbol, value) { - this.slots[symbol] = value; - }; + _emberMetal.assert(('You cannot set `' + this + '.isDestroyed` directly, please use ').destroy()(_templateObject), false); + } + }), _Mixin$create.isDestroying = _emberMetal.descriptor({ + get: function () { + return _emberMetal.meta(this).isSourceDestroying(); + }, - Scope.prototype.bindCallerScope = function bindCallerScope(scope) { - this.callerScope = scope; - }; + set: function (value) { + // prevent setting while applying mixins + if (typeof value === 'object' && value !== null && value.isDescriptor) { + return; + } - Scope.prototype.getCallerScope = function getCallerScope() { - return this.callerScope; - }; + _emberMetal.assert(('You cannot set `' + this + '.isDestroying` directly, please use ').destroy()(_templateObject), false); + } + }), _Mixin$create.destroy = function () { + var m = _emberMetal.meta(this); + if (m.isSourceDestroying()) { + return; + } - Scope.prototype.child = function child() { - return new Scope(this.slots.slice(), this.callerScope); - }; + m.setSourceDestroying(); - return Scope; - })(); + schedule('actions', this, this.willDestroy); + schedule('destroy', this, this._scheduledDestroy, m); - exports.Scope = Scope; + return this; + }, _Mixin$create.willDestroy = function () {}, _Mixin$create._scheduledDestroy = function (m) { + if (m.isSourceDestroyed()) { + return; + } + _emberMetal.destroy(this); + m.setSourceDestroyed(); + }, _Mixin$create.bind = function (to, from) { + if (!(from instanceof _emberMetal.Binding)) { + from = _emberMetal.Binding.from(from); + } + from.to(to).connect(this); + return from; + }, _Mixin$create.toString = function () { + var hasToStringExtension = typeof this.toStringExtension === 'function'; + var extension = hasToStringExtension ? ':' + this.toStringExtension() : ''; + var ret = '<' + (this[_emberUtils.NAME_KEY] || this.constructor.toString()) + ':' + _emberUtils.guidFor(this) + extension + '>'; - var Environment = (function () { - function Environment(_ref2) { - var appendOperations = _ref2.appendOperations; - var updateOperations = _ref2.updateOperations; + return ret; + }, _Mixin$create)); - this.scheduledInstallManagers = null; - this.scheduledInstallModifiers = null; - this.scheduledUpdateModifierManagers = null; - this.scheduledUpdateModifiers = null; - this.createdComponents = null; - this.createdManagers = null; - this.updatedComponents = null; - this.updatedManagers = null; - this.destructors = null; - this.appendOperations = appendOperations; - this.updateOperations = updateOperations; - } + CoreObject.PrototypeMixin.ownerConstructor = CoreObject; - Environment.prototype.toConditionalReference = function toConditionalReference(reference) { - return new _glimmerRuntimeLibReferences.ConditionalReference(reference); - }; + CoreObject.__super__ = null; - Environment.prototype.getAppendOperations = function getAppendOperations() { - return this.appendOperations; - }; + var ClassMixinProps = (_ClassMixinProps = { - Environment.prototype.getDOM = function getDOM() { - return this.updateOperations; - }; + ClassMixin: _emberMetal.REQUIRED, - Environment.prototype.getIdentity = function getIdentity(object) { - return _glimmerUtil.ensureGuid(object) + ''; - }; + PrototypeMixin: _emberMetal.REQUIRED, - Environment.prototype.statement = function statement(_statement, symbolTable) { - return this.refineStatement(parseStatement(_statement), symbolTable) || _statement; - }; + isClass: true, - Environment.prototype.refineStatement = function refineStatement(statement, symbolTable) { - var isSimple = statement.isSimple; - var isBlock = statement.isBlock; - var key = statement.key; - var args = statement.args; - - if (isSimple && isBlock) { - switch (key) { - case 'each': - return new _glimmerRuntimeLibSyntaxBuiltinsEach.default(args); - case 'if': - return new _glimmerRuntimeLibSyntaxBuiltinsIf.default(args); - case 'with': - return new _glimmerRuntimeLibSyntaxBuiltinsWith.default(args); - case 'unless': - return new _glimmerRuntimeLibSyntaxBuiltinsUnless.default(args); - } - } - }; + isMethod: false + }, _ClassMixinProps[_emberUtils.NAME_KEY] = null, _ClassMixinProps[_emberUtils.GUID_KEY] = null, _ClassMixinProps.extend = function () { + var Class = makeCtor(); + var proto = undefined; + Class.ClassMixin = _emberMetal.Mixin.create(this.ClassMixin); + Class.PrototypeMixin = _emberMetal.Mixin.create(this.PrototypeMixin); - Environment.prototype.begin = function begin() { - this.createdComponents = []; - this.createdManagers = []; - this.updatedComponents = []; - this.updatedManagers = []; - this.destructors = []; - this.scheduledInstallManagers = []; - this.scheduledInstallModifiers = []; - this.scheduledUpdateModifierManagers = []; - this.scheduledUpdateModifiers = []; - }; + Class.ClassMixin.ownerConstructor = Class; + Class.PrototypeMixin.ownerConstructor = Class; - Environment.prototype.didCreate = function didCreate(component, manager) { - this.createdComponents.push(component); - this.createdManagers.push(manager); - }; + reopen.apply(Class.PrototypeMixin, arguments); - Environment.prototype.didUpdate = function didUpdate(component, manager) { - this.updatedComponents.push(component); - this.updatedManagers.push(manager); - }; + Class.superclass = this; + Class.__super__ = this.prototype; - Environment.prototype.scheduleInstallModifier = function scheduleInstallModifier(modifier, manager) { - this.scheduledInstallManagers.push(manager); - this.scheduledInstallModifiers.push(modifier); - }; + proto = Class.prototype = Object.create(this.prototype); + proto.constructor = Class; + _emberUtils.generateGuid(proto); + _emberMetal.meta(proto).proto = proto; // this will disable observers on prototype - Environment.prototype.scheduleUpdateModifier = function scheduleUpdateModifier(modifier, manager) { - this.scheduledUpdateModifierManagers.push(manager); - this.scheduledUpdateModifiers.push(modifier); - }; + Class.ClassMixin.apply(Class); + return Class; + }, _ClassMixinProps.create = function () { + var C = this; - Environment.prototype.didDestroy = function didDestroy(d) { - this.destructors.push(d); - }; + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - Environment.prototype.commit = function commit() { - for (var i = 0; i < this.createdComponents.length; i++) { - var component = this.createdComponents[i]; - var manager = this.createdManagers[i]; - manager.didCreate(component); - } - for (var i = 0; i < this.updatedComponents.length; i++) { - var component = this.updatedComponents[i]; - var manager = this.updatedManagers[i]; - manager.didUpdate(component); - } - for (var i = 0; i < this.destructors.length; i++) { - this.destructors[i].destroy(); - } - for (var i = 0; i < this.scheduledInstallManagers.length; i++) { - var manager = this.scheduledInstallManagers[i]; - var modifier = this.scheduledInstallModifiers[i]; - manager.install(modifier); - } - for (var i = 0; i < this.scheduledUpdateModifierManagers.length; i++) { - var manager = this.scheduledUpdateModifierManagers[i]; - var modifier = this.scheduledUpdateModifiers[i]; - manager.update(modifier); - } - this.createdComponents = null; - this.createdManagers = null; - this.updatedComponents = null; - this.updatedManagers = null; - this.destructors = null; - this.scheduledInstallManagers = null; - this.scheduledInstallModifiers = null; - this.scheduledUpdateModifierManagers = null; - this.scheduledUpdateModifiers = null; - }; + if (args.length > 0) { + this._initProperties(args); + } + return new C(); + }, _ClassMixinProps.reopen = function () { + this.willReopen(); + reopen.apply(this.PrototypeMixin, arguments); + return this; + }, _ClassMixinProps.reopenClass = function () { + reopen.apply(this.ClassMixin, arguments); + applyMixin(this, arguments, false); + return this; + }, _ClassMixinProps.detect = function (obj) { + if ('function' !== typeof obj) { + return false; + } + while (obj) { + if (obj === this) { + return true; + } + obj = obj.superclass; + } + return false; + }, _ClassMixinProps.detectInstance = function (obj) { + return obj instanceof this; + }, _ClassMixinProps.metaForProperty = function (key) { + var proto = this.proto(); + var possibleDesc = proto[key]; + var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - Environment.prototype.attributeFor = function attributeFor(element, attr, isTrusting, namespace) { - return _glimmerRuntimeLibDomAttributeManagers.defaultManagers(element, attr, isTrusting, namespace); - }; + _emberMetal.assert('metaForProperty() could not find a computed property with key \'' + key + '\'.', !!desc && desc instanceof _emberMetal.ComputedProperty); + return desc._meta || {}; + }, _ClassMixinProps._computedProperties = _emberMetal.computed(function () { + hasCachedComputedProperties = true; + var proto = this.proto(); + var property = undefined; + var properties = []; - return Environment; - })(); + for (var _name in proto) { + property = proto[_name]; - exports.Environment = Environment; - exports.default = Environment; - - function parseStatement(statement) { - var type = statement.type; - var block = type === 'block' ? statement : null; - var append = type === 'optimized-append' ? statement : null; - var modifier = type === 'modifier' ? statement : null; - var appendType = append && append.value.type; - var args = undefined; - var path = undefined; - if (block) { - args = block.args; - path = block.path; - } else if (append && (appendType === 'unknown' || appendType === 'get')) { - var appendValue = append.value; - args = _glimmerRuntimeLibSyntaxCore.Args.empty(); - path = appendValue.ref.parts; - } else if (append && append.value.type === 'helper') { - var helper = append.value; - args = helper.args; - path = helper.ref.parts; - } else if (modifier) { - path = modifier.path; - args = modifier.args; - } - var key = undefined, - isSimple = undefined; - if (path) { - isSimple = path.length === 1; - key = path[0]; - } - return { - isSimple: isSimple, - path: path, - key: key, - args: args, - appendType: appendType, - original: statement, - isInline: !!append, - isBlock: !!block, - isModifier: !!modifier - }; + if (property && property.isDescriptor) { + properties.push({ + name: _name, + meta: property._meta + }); + } } -}); - -enifed('glimmer-runtime/lib/helpers/get-dynamic-var', ['exports', 'glimmer-reference'], function (exports, _glimmerReference) { - 'use strict'; + return properties; + }).readOnly(), _ClassMixinProps.eachComputedProperty = function (callback, binding) { + var property = undefined; + var empty = {}; - var DynamicVarReference = (function () { - function DynamicVarReference(scope, nameRef) { - this.scope = scope; - this.nameRef = nameRef; - var varTag = this.varTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - this.tag = _glimmerReference.combine([nameRef.tag, varTag]); - } + var properties = _emberMetal.get(this, '_computedProperties'); - DynamicVarReference.prototype.value = function value() { - return this.getVar().value(); - }; + for (var i = 0; i < properties.length; i++) { + property = properties[i]; + callback.call(binding || this, property.name, property.meta || empty); + } + }, _ClassMixinProps); - DynamicVarReference.prototype.get = function get(key) { - return this.getVar().get(key); - }; + function injectedPropertyAssertion() { + _emberMetal.assert('Injected properties are invalid', _emberRuntimeInject.validatePropertyInjections(this)); + } - DynamicVarReference.prototype.getVar = function getVar() { - var name = String(this.nameRef.value()); - var ref = this.scope.get(name); - this.varTag.update(ref.tag); - return ref; - }; + _emberMetal.runInDebug(function () { + /** + Provides lookup-time type validation for injected properties. + @private + @method _onLookup + */ + ClassMixinProps._onLookup = injectedPropertyAssertion; + }); - return DynamicVarReference; - })(); + /** + Returns a hash of property names and container names that injected + properties will lookup on the container lazily. + + @method _lazyInjections + @return {Object} Hash of all lazy injected property keys to container names + @private + */ + ClassMixinProps._lazyInjections = function () { + var injections = {}; + var proto = this.proto(); + var key = undefined; + var desc = undefined; - function getDynamicVar(vm, args, symbolTable) { - var scope = vm.dynamicScope(); - var nameRef = args.positional.at(0); - return new DynamicVarReference(scope, nameRef); + for (key in proto) { + desc = proto[key]; + if (desc instanceof _emberMetal.InjectedProperty) { + injections[key] = desc.type + ':' + (desc.name || key); + } } - exports.default = getDynamicVar; -}); -enifed("glimmer-runtime/lib/modifier/interfaces", ["exports"], function (exports) { - "use strict"; -}); - -enifed("glimmer-runtime/lib/opcode-builder", ["exports"], function (exports) { - "use strict"; -}); + return injections; + }; -enifed('glimmer-runtime/lib/opcodes', ['exports', 'glimmer-util'], function (exports, _glimmerUtil) { - 'use strict'; + var ClassMixin = _emberMetal.Mixin.create(ClassMixinProps); - exports.inspect = inspect; + ClassMixin.ownerConstructor = CoreObject; - var AbstractOpcode = (function () { - function AbstractOpcode() { - _glimmerUtil.initializeGuid(this); - } + CoreObject.ClassMixin = ClassMixin; - AbstractOpcode.prototype.toJSON = function toJSON() { - return { guid: this._guid, type: this.type }; - }; + ClassMixin.apply(CoreObject); - return AbstractOpcode; - })(); + CoreObject.reopen({ + didDefineProperty: function (proto, key, value) { + if (hasCachedComputedProperties === false) { + return; + } + if (value instanceof _emberMetal.ComputedProperty) { + var cache = _emberMetal.meta(this.constructor).readableCache(); - exports.AbstractOpcode = AbstractOpcode; + if (cache && cache._computedProperties !== undefined) { + cache._computedProperties = undefined; + } + } + } + }); - var Opcode = (function (_AbstractOpcode) { - babelHelpers.inherits(Opcode, _AbstractOpcode); + exports.default = CoreObject; +}); +// Private, and only for didInitAttrs willRecieveAttrs - function Opcode() { - _AbstractOpcode.apply(this, arguments); - this.next = null; - this.prev = null; - } +/** + 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 + the subclass overrides a property with the same name that is defined + in the superclass. However, there are some cases where it is preferable + to build up a property's value by combining the superclass' property + value with the subclass' value. An example of this in use within Ember + is the `classNames` property of `Ember.View`. + Here is some sample code showing the difference between a concatenated + property and a normal one: + ```javascript + const Bar = Ember.Object.extend({ + // Configure which properties to concatenate + concatenatedProperties: ['concatenatedProperty'], + someNonConcatenatedProperty: ['bar'], + concatenatedProperty: ['bar'] + }); + const FooBar = Bar.extend({ + someNonConcatenatedProperty: ['foo'], + concatenatedProperty: ['foo'] + }); + let fooBar = FooBar.create(); + fooBar.get('someNonConcatenatedProperty'); // ['foo'] + fooBar.get('concatenatedProperty'); // ['bar', 'foo'] + ``` + This behavior extends to object creation as well. Continuing the + above example: + ```javascript + let fooBar = FooBar.create({ + someNonConcatenatedProperty: ['baz'], + concatenatedProperty: ['baz'] + }) + fooBar.get('someNonConcatenatedProperty'); // ['baz'] + fooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz'] + ``` + Adding a single property that is not an array will just add it in the array: + ```javascript + let fooBar = FooBar.create({ + concatenatedProperty: 'baz' + }) + view.get('concatenatedProperty'); // ['bar', 'foo', 'baz'] + ``` + Using the `concatenatedProperties` property, we can tell Ember to mix the + content of the properties. + In `Ember.Component` the `classNames`, `classNameBindings` and + `attributeBindings` properties are concatenated. + This feature is available for you to use throughout the Ember object model, + although typical app developers are likely to use it infrequently. Since + it changes expectations about behavior of properties, you should properly + document its usage in each individual concatenated property (to not + mislead your users to think they can override the property in a subclass). + @property concatenatedProperties + @type Array + @default null + @public +*/ - return Opcode; - })(AbstractOpcode); +/** + Defines the properties that will be merged from the superclass + (instead of overridden). + By default, when you extend an Ember class a property defined in + the subclass overrides a property with the same name that is defined + in the superclass. However, there are some cases where it is preferable + to build up a property's value by merging the superclass property value + with the subclass property's value. An example of this in use within Ember + is the `queryParams` property of routes. + Here is some sample code showing the difference between a merged + property and a normal one: + ```javascript + const Bar = Ember.Object.extend({ + // Configure which properties are to be merged + mergedProperties: ['mergedProperty'], + someNonMergedProperty: { + nonMerged: 'superclass value of nonMerged' + }, + mergedProperty: { + page: {replace: false}, + limit: {replace: true} + } + }); + const FooBar = Bar.extend({ + someNonMergedProperty: { + completelyNonMerged: 'subclass value of nonMerged' + }, + mergedProperty: { + limit: {replace: false} + } + }); + let fooBar = FooBar.create(); + fooBar.get('someNonMergedProperty'); + // => { completelyNonMerged: 'subclass value of nonMerged' } + // + // Note the entire object, including the nonMerged property of + // the superclass object, has been replaced + fooBar.get('mergedProperty'); + // => { + // page: {replace: false}, + // limit: {replace: false} + // } + // + // Note the page remains from the superclass, and the + // `limit` property's value of `false` has been merged from + // the subclass. + ``` + This behavior is not available during object `create` calls. It is only + available at `extend` time. + In `Ember.Route` the `queryParams` property is merged. + This feature is available for you to use throughout the Ember object model, + although typical app developers are likely to use it infrequently. Since + it changes expectations about behavior of properties, you should properly + document its usage in each individual merged property (to not + mislead your users to think they can override the property in a subclass). + @property mergedProperties + @type Array + @default null + @public +*/ - exports.Opcode = Opcode; +/** + Destroyed object property flag. + if this property is `true` the observers and bindings were already + removed by the effect of calling the `destroy()` method. + @property isDestroyed + @default false + @public +*/ - var UpdatingOpcode = (function (_AbstractOpcode2) { - babelHelpers.inherits(UpdatingOpcode, _AbstractOpcode2); +/** + Destruction scheduled flag. The `destroy()` method has been called. + The object stays intact until the end of the run loop at which point + the `isDestroyed` flag is set. + @property isDestroying + @default false + @public +*/ - function UpdatingOpcode() { - _AbstractOpcode2.apply(this, arguments); - this.next = null; - this.prev = null; - } +/** + Destroys an object by setting the `isDestroyed` flag and removing its + metadata, which effectively destroys observers and bindings. + If you try to set a property on a destroyed object, an exception will be + raised. + Note that destruction is scheduled for the end of the run loop and does not + happen immediately. It will set an isDestroying flag immediately. + @method destroy + @return {Ember.Object} receiver + @public +*/ - return UpdatingOpcode; - })(AbstractOpcode); +/** + Override to implement teardown. + @method willDestroy + @public +*/ - exports.UpdatingOpcode = UpdatingOpcode; +/** + Invoked by the run loop to actually destroy the object. This is + scheduled for execution by the `destroy` method. + @private + @method _scheduledDestroy +*/ - function inspect(opcodes) { - var buffer = []; - opcodes.toArray().forEach(function (opcode, i) { - _inspect(opcode.toJSON(), buffer, 0, i); - }); - return buffer.join(''); +/** + Returns a string representation which attempts to provide more information + than Javascript's `toString` typically does, in a generic way for all Ember + objects. + ```javascript + const Person = Ember.Object.extend() + person = Person.create() + person.toString() //=> "" + ``` + If the object's class is not defined on an Ember namespace, it will + indicate it is a subclass of the registered superclass: + ```javascript + const Student = Person.extend() + let student = Student.create() + student.toString() //=> "<(subclass of Person):ember1025>" + ``` + If the method `toStringExtension` is defined, its return value will be + included in the output. + ```javascript + const Teacher = Person.extend({ + toStringExtension() { + return this.get('fullName'); } + }); + teacher = Teacher.create() + teacher.toString(); //=> "" + ``` + @method toString + @return {String} string representation + @public +*/ - function _inspect(opcode, buffer, level, index) { - var indentation = []; - for (var i = 0; i < level; i++) { - indentation.push(' '); - } - buffer.push.apply(buffer, indentation); - buffer.push(index + 1 + '. ' + opcode.type.toUpperCase()); - if (opcode.args || opcode.details) { - buffer.push('('); - if (opcode.args) { - buffer.push(opcode.args.join(', ')); - } - if (opcode.details) { - var keys = Object.keys(opcode.details); - if (keys.length) { - if (opcode.args && opcode.args.length) { - buffer.push(', '); - } - buffer.push(keys.map(function (key) { - return key + '=' + opcode.details[key]; - }).join(', ')); - } - } - buffer.push(')'); - } - buffer.push('\n'); - if (opcode.children && opcode.children.length) { - for (var i = 0; i < opcode.children.length; i++) { - _inspect(opcode.children[i], buffer, level + 1, i); - } - } +/** + Creates a new subclass. + ```javascript + const Person = Ember.Object.extend({ + say(thing) { + alert(thing); + } + }); + ``` + This defines a new subclass of Ember.Object: `Person`. It contains one method: `say()`. + You can also create a subclass from any existing class by calling its `extend()` method. + For example, you might want to create a subclass of Ember's built-in `Ember.Component` class: + ```javascript + const PersonComponent = Ember.Component.extend({ + tagName: 'li', + classNameBindings: ['isAdministrator'] + }); + ``` + When defining a subclass, you can override methods but still access the + implementation of your parent class by calling the special `_super()` method: + ```javascript + const Person = Ember.Object.extend({ + say(thing) { + let name = this.get('name'); + alert(`${name} says: ${thing}`); } -}); - -enifed("glimmer-runtime/lib/partial", ["exports"], function (exports) { - "use strict"; - - var PartialDefinition = function PartialDefinition(name, template) { - this.name = name; - this.template = template; - }; - - exports.PartialDefinition = PartialDefinition; -}); - -enifed('glimmer-runtime/lib/references', ['exports', 'glimmer-reference'], function (exports, _glimmerReference) { - 'use strict'; - - var PrimitiveReference = (function (_ConstReference) { - babelHelpers.inherits(PrimitiveReference, _ConstReference); - - function PrimitiveReference(value) { - _ConstReference.call(this, value); - } + }); + const Soldier = Person.extend({ + say(thing) { + this._super(`${thing}, sir!`); + }, + march(numberOfHours) { + alert(`${this.get('name')} marches for ${numberOfHours} hours.`); + } + }); + let yehuda = Soldier.create({ + name: "Yehuda Katz" + }); + yehuda.say("Yes"); // alerts "Yehuda Katz says: Yes, sir!" + ``` + The `create()` on line #17 creates an *instance* of the `Soldier` class. + The `extend()` on line #8 creates a *subclass* of `Person`. Any instance + of the `Person` class will *not* have the `march()` method. + You can also pass `Mixin` classes to add additional properties to the subclass. + ```javascript + const Person = Ember.Object.extend({ + say(thing) { + alert(`${this.get('name')} says: ${thing}`); + } + }); + const SingingMixin = Mixin.create({ + sing(thing){ + alert(`${this.get('name')} sings: la la la ${thing}`); + } + }); + const BroadwayStar = Person.extend(SingingMixin, { + dance() { + alert(`${this.get('name')} dances: tap tap tap tap `); + } + }); + ``` + The `BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`. + @method extend + @static + @param {Mixin} [mixins]* One or more Mixin classes + @param {Object} [arguments]* Object containing values to use within the new class + @public +*/ - PrimitiveReference.create = function create(value) { - if (value === undefined) { - return UNDEFINED_REFERENCE; - } else if (value === null) { - return NULL_REFERENCE; - } else if (value === true) { - return TRUE_REFERENCE; - } else if (value === false) { - return FALSE_REFERENCE; - } else if (typeof value === 'number') { - return new ValueReference(value); - } else { - return new StringReference(value); - } - }; +/** + Creates an instance of a class. Accepts either no arguments, or an object + containing values to initialize the newly instantiated object with. + ```javascript + const Person = Ember.Object.extend({ + helloWorld() { + alert(`Hi, my name is ${this.get('name')}`); + } + }); + let tom = Person.create({ + name: 'Tom Dale' + }); + tom.helloWorld(); // alerts "Hi, my name is Tom Dale". + ``` + `create` will call the `init` function if defined during + `Ember.AnyObject.extend` + If no arguments are passed to `create`, it will not set values to the new + instance during initialization: + ```javascript + let noName = Person.create(); + noName.helloWorld(); // alerts undefined + ``` + NOTE: For performance reasons, you cannot declare methods or computed + properties during `create`. You should instead declare methods and computed + properties when using `extend`. + @method create + @static + @param [arguments]* + @public +*/ - PrimitiveReference.prototype.get = function get(key) { - return UNDEFINED_REFERENCE; - }; +/** + Augments a constructor's prototype with additional + properties and functions: + ```javascript + const MyObject = Ember.Object.extend({ + name: 'an object' + }); + o = MyObject.create(); + o.get('name'); // 'an object' + MyObject.reopen({ + say(msg){ + console.log(msg); + } + }) + o2 = MyObject.create(); + o2.say("hello"); // logs "hello" + o.say("goodbye"); // logs "goodbye" + ``` + To add functions and properties to the constructor itself, + see `reopenClass` + @method reopen + @public +*/ - return PrimitiveReference; - })(_glimmerReference.ConstReference); +/** + Augments a constructor's own properties and functions: + ```javascript + const MyObject = Ember.Object.extend({ + name: 'an object' + }); + MyObject.reopenClass({ + canBuild: false + }); + MyObject.canBuild; // false + o = MyObject.create(); + ``` + In other words, this creates static properties and functions for the class. + These are only available on the class and not on any instance of that class. + ```javascript + const Person = Ember.Object.extend({ + name: "", + sayHello() { + alert("Hello. My name is " + this.get('name')); + } + }); + Person.reopenClass({ + species: "Homo sapiens", + createPerson(newPersonsName){ + return Person.create({ + name:newPersonsName + }); + } + }); + let tom = Person.create({ + name: "Tom Dale" + }); + let yehuda = Person.createPerson("Yehuda Katz"); + tom.sayHello(); // "Hello. My name is Tom Dale" + yehuda.sayHello(); // "Hello. My name is Yehuda Katz" + alert(Person.species); // "Homo sapiens" + ``` + Note that `species` and `createPerson` are *not* valid on the `tom` and `yehuda` + variables. They are only valid on `Person`. + To add functions and properties to instances of + a constructor by extending the constructor's prototype + see `reopen` + @method reopenClass + @public +*/ - exports.PrimitiveReference = PrimitiveReference; +/** + In some cases, you may want to annotate computed properties with additional + metadata about how they function or what values they operate on. For + example, computed property functions may close over variables that are then + no longer available for introspection. + You can pass a hash of these values to a computed property like this: + ```javascript + person: Ember.computed(function() { + let personId = this.get('personId'); + return Person.create({ id: personId }); + }).meta({ type: Person }) + ``` + Once you've done this, you can retrieve the values saved to the computed + property from your class like this: + ```javascript + MyClass.metaForProperty('person'); + ``` + This will return the original hash that was passed to `meta()`. + @static + @method metaForProperty + @param key {String} property name + @private +*/ - var StringReference = (function (_PrimitiveReference) { - babelHelpers.inherits(StringReference, _PrimitiveReference); +/** + Iterate over each computed property for the class, passing its name + and any associated metadata (see `metaForProperty`) to the callback. + @static + @method eachComputedProperty + @param {Function} callback + @param {Object} binding + @private +*/ +enifed('ember-runtime/system/each_proxy', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/mixins/array'], function (exports, _emberUtils, _emberMetal, _emberRuntimeMixinsArray) { + 'use strict'; - function StringReference() { - _PrimitiveReference.apply(this, arguments); - this.lengthReference = null; - } + exports.default = EachProxy; - StringReference.prototype.get = function get(key) { - if (key === 'length') { - var lengthReference = this.lengthReference; + /** + 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 + */ - if (lengthReference === null) { - lengthReference = this.lengthReference = new ValueReference(this.inner.length); - } - return lengthReference; - } else { - return _PrimitiveReference.prototype.get.call(this, key); - } - }; + function EachProxy(content) { + this._content = content; + this._keys = undefined; + this.__ember_meta__ = null; + } - return StringReference; - })(PrimitiveReference); + EachProxy.prototype = { + __defineNonEnumerable: function (property) { + this[property.name] = property.descriptor.value; + }, - var ValueReference = (function (_PrimitiveReference2) { - babelHelpers.inherits(ValueReference, _PrimitiveReference2); + // .......................................................... + // ARRAY CHANGES + // Invokes whenever the content array itself changes. - function ValueReference(value) { - _PrimitiveReference2.call(this, value); + arrayWillChange: function (content, idx, removedCnt, addedCnt) { + var keys = this._keys; + var lim = removedCnt > 0 ? idx + removedCnt : -1; + for (var key in keys) { + if (lim > 0) { + removeObserverForContentKey(content, key, this, idx, lim); } + _emberMetal.propertyWillChange(this, key); + } + }, - return ValueReference; - })(PrimitiveReference); - - var UNDEFINED_REFERENCE = new ValueReference(undefined); - exports.UNDEFINED_REFERENCE = UNDEFINED_REFERENCE; - var NULL_REFERENCE = new ValueReference(null); - exports.NULL_REFERENCE = NULL_REFERENCE; - var TRUE_REFERENCE = new ValueReference(true); - var FALSE_REFERENCE = new ValueReference(false); - - var ConditionalReference = (function () { - function ConditionalReference(inner) { - this.inner = inner; - this.tag = inner.tag; + arrayDidChange: function (content, idx, removedCnt, addedCnt) { + var keys = this._keys; + var lim = addedCnt > 0 ? idx + addedCnt : -1; + for (var key in keys) { + if (lim > 0) { + addObserverForContentKey(content, key, this, idx, lim); } + _emberMetal.propertyDidChange(this, key); + } + }, - ConditionalReference.prototype.value = function value() { - return this.toBool(this.inner.value()); - }; - - ConditionalReference.prototype.toBool = function toBool(value) { - return !!value; - }; - - return ConditionalReference; - })(); - - exports.ConditionalReference = ConditionalReference; -}); - -enifed('glimmer-runtime/lib/scanner', ['exports', 'glimmer-runtime/lib/syntax/statements', 'glimmer-runtime/lib/compiled/blocks', 'glimmer-util', 'glimmer-runtime/lib/symbol-table'], function (exports, _glimmerRuntimeLibSyntaxStatements, _glimmerRuntimeLibCompiledBlocks, _glimmerUtil, _glimmerRuntimeLibSymbolTable) { - 'use strict'; + // .......................................................... + // LISTEN FOR NEW OBSERVERS AND OTHER EVENT LISTENERS + // Start monitoring keys based on who is listening... - var Scanner = (function () { - function Scanner(block, meta, env) { - this.block = block; - this.meta = meta; - this.env = env; - } + willWatchProperty: function (property) { + this.beginObservingContentKey(property); + }, - Scanner.prototype.scanEntryPoint = function scanEntryPoint() { - var block = this.block; - var meta = this.meta; + didUnwatchProperty: function (property) { + this.stopObservingContentKey(property); + }, - var symbolTable = _glimmerRuntimeLibSymbolTable.default.forEntryPoint(meta); - var program = buildStatements(block, block.blocks, symbolTable, this.env); - return new _glimmerRuntimeLibCompiledBlocks.EntryPoint(program, symbolTable); - }; + // .......................................................... + // CONTENT KEY OBSERVING + // Actual watch keys on the source content. - Scanner.prototype.scanLayout = function scanLayout() { - var block = this.block; - var meta = this.meta; - var blocks = block.blocks; - var named = block.named; - var yields = block.yields; - var hasPartials = block.hasPartials; - - var symbolTable = _glimmerRuntimeLibSymbolTable.default.forLayout(named, yields, hasPartials, meta); - var program = buildStatements(block, blocks, symbolTable, this.env); - return new _glimmerRuntimeLibCompiledBlocks.Layout(program, symbolTable, named, yields, hasPartials); - }; + beginObservingContentKey: function (keyName) { + var keys = this._keys; + if (!keys) { + keys = this._keys = new _emberUtils.EmptyObject(); + } - Scanner.prototype.scanPartial = function scanPartial(symbolTable) { - var block = this.block; - var blocks = block.blocks; - var locals = block.locals; + if (!keys[keyName]) { + keys[keyName] = 1; + var content = this._content; + var len = _emberMetal.get(content, 'length'); - var program = buildStatements(block, blocks, symbolTable, this.env); - return new _glimmerRuntimeLibCompiledBlocks.PartialBlock(program, symbolTable, locals); - }; + addObserverForContentKey(content, keyName, this, 0, len); + } else { + keys[keyName]++; + } + }, - return Scanner; - })(); + stopObservingContentKey: function (keyName) { + var keys = this._keys; + if (keys && keys[keyName] > 0 && --keys[keyName] <= 0) { + var content = this._content; + var len = _emberMetal.get(content, 'length'); - exports.default = Scanner; + removeObserverForContentKey(content, keyName, this, 0, len); + } + }, - function buildStatements(_ref, blocks, symbolTable, env) { - var statements = _ref.statements; + contentKeyWillChange: function (obj, keyName) { + _emberMetal.propertyWillChange(this, keyName); + }, - if (statements.length === 0) return EMPTY_PROGRAM; - return new BlockScanner(statements, blocks, symbolTable, env).scan(); + contentKeyDidChange: function (obj, keyName) { + _emberMetal.propertyDidChange(this, keyName); } - var EMPTY_PROGRAM = _glimmerUtil.EMPTY_SLICE; - - var BlockScanner = (function () { - function BlockScanner(statements, blocks, symbolTable, env) { - this.blocks = blocks; - this.symbolTable = symbolTable; - this.stack = new _glimmerUtil.Stack(); - this.stack.push(new ChildBlockScanner(symbolTable)); - this.reader = new SyntaxReader(statements, symbolTable, this); - this.env = env; - } - - BlockScanner.prototype.scan = function scan() { - var statement = undefined; - while (statement = this.reader.next()) { - this.addStatement(statement); - } - return this.stack.current.program; - }; - - BlockScanner.prototype.blockFor = function blockFor(symbolTable, id) { - var block = this.blocks[id]; - var childTable = _glimmerRuntimeLibSymbolTable.default.forBlock(this.symbolTable, block.locals); - var program = buildStatements(block, this.blocks, childTable, this.env); - return new _glimmerRuntimeLibCompiledBlocks.InlineBlock(program, childTable, block.locals); - }; - - BlockScanner.prototype.startBlock = function startBlock(locals) { - var childTable = _glimmerRuntimeLibSymbolTable.default.forBlock(this.symbolTable, locals); - this.stack.push(new ChildBlockScanner(childTable)); - }; - - BlockScanner.prototype.endBlock = function endBlock(locals) { - var _stack$pop = this.stack.pop(); - - var program = _stack$pop.program; - var symbolTable = _stack$pop.symbolTable; - - var block = new _glimmerRuntimeLibCompiledBlocks.InlineBlock(program, symbolTable, locals); - this.addChild(block); - return block; - }; - - BlockScanner.prototype.addChild = function addChild(block) { - this.stack.current.addChild(block); - }; - - BlockScanner.prototype.addStatement = function addStatement(statement) { - this.stack.current.addStatement(statement.scan(this)); - }; - - BlockScanner.prototype.next = function next() { - return this.reader.next(); - }; - - return BlockScanner; - })(); - - exports.BlockScanner = BlockScanner; - - var ChildBlockScanner = (function () { - function ChildBlockScanner(symbolTable) { - this.symbolTable = symbolTable; - this.children = []; - this.program = new _glimmerUtil.LinkedList(); - } - - ChildBlockScanner.prototype.addChild = function addChild(block) { - this.children.push(block); - }; - - ChildBlockScanner.prototype.addStatement = function addStatement(statement) { - this.program.append(statement); - }; - - return ChildBlockScanner; - })(); + }; - var SyntaxReader = (function () { - function SyntaxReader(statements, symbolTable, scanner) { - this.statements = statements; - this.symbolTable = symbolTable; - this.scanner = scanner; - this.current = 0; - this.last = null; - } - - SyntaxReader.prototype.next = function next() { - var last = this.last; - if (last) { - this.last = null; - return last; - } else if (this.current === this.statements.length) { - return null; - } - var sexp = this.statements[this.current++]; - return _glimmerRuntimeLibSyntaxStatements.default(sexp, this.symbolTable, this.scanner); - }; + function addObserverForContentKey(content, keyName, proxy, idx, loc) { + while (--loc >= idx) { + var item = _emberRuntimeMixinsArray.objectAt(content, loc); + if (item) { + _emberMetal.assert('When using @each to observe the array ' + content + ', the array must return an object', typeof item === 'object'); + _emberMetal._addBeforeObserver(item, keyName, proxy, 'contentKeyWillChange'); + _emberMetal.addObserver(item, keyName, proxy, 'contentKeyDidChange'); + } + } + } - return SyntaxReader; - })(); + function removeObserverForContentKey(content, keyName, proxy, idx, loc) { + while (--loc >= idx) { + var item = _emberRuntimeMixinsArray.objectAt(content, loc); + if (item) { + _emberMetal._removeBeforeObserver(item, keyName, proxy, 'contentKeyWillChange'); + _emberMetal.removeObserver(item, keyName, proxy, 'contentKeyDidChange'); + } + } + } }); +enifed('ember-runtime/system/lazy_load', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { + /*globals CustomEvent */ -enifed('glimmer-runtime/lib/symbol-table', ['exports', 'glimmer-util'], function (exports, _glimmerUtil) { - 'use strict'; - - var SymbolTable = (function () { - function SymbolTable(parent) { - var meta = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; - - this.parent = parent; - this.meta = meta; - this.locals = _glimmerUtil.dict(); - this.named = _glimmerUtil.dict(); - this.yields = _glimmerUtil.dict(); - this.partialArgs = null; - this.size = 1; - this.top = parent ? parent.top : this; - } - - SymbolTable.forEntryPoint = function forEntryPoint(meta) { - return new SymbolTable(null, meta).initEntryPoint(); - }; - - SymbolTable.forLayout = function forLayout(named, yields, hasPartials, meta) { - return new SymbolTable(null, meta).initLayout(named, yields, hasPartials); - }; - - SymbolTable.forBlock = function forBlock(parent, locals) { - return new SymbolTable(parent, null).initBlock(locals); - }; - - SymbolTable.prototype.initEntryPoint = function initEntryPoint() { - return this; - }; - - SymbolTable.prototype.initBlock = function initBlock(locals) { - this.initPositionals(locals); - return this; - }; - - SymbolTable.prototype.initLayout = function initLayout(named, yields, hasPartials) { - this.initNamed(named); - this.initYields(yields); - this.initPartials(hasPartials); - return this; - }; + 'use strict'; - SymbolTable.prototype.initPositionals = function initPositionals(positionals) { - var _this = this; + exports.onLoad = onLoad; + exports.runLoadHooks = runLoadHooks; - if (positionals) positionals.forEach(function (s) { - return _this.locals[s] = _this.top.size++; - }); - return this; - }; + /** + @module ember + @submodule ember-runtime + */ - SymbolTable.prototype.initNamed = function initNamed(named) { - var _this2 = this; + var loadHooks = _emberEnvironment.ENV.EMBER_LOAD_HOOKS || {}; + var loaded = {}; + var _loaded = loaded; - if (named) named.forEach(function (s) { - return _this2.named[s] = _this2.top.size++; - }); - return this; - }; + 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 + resolved from a string into the object: + + ``` javascript + Ember.onLoad('Ember.Application' function(hbars) { + hbars.registerHelper(...); + }); + ``` + + @method onLoad + @for Ember + @param name {String} name of hook + @param callback {Function} callback to be called + @private + */ - SymbolTable.prototype.initYields = function initYields(yields) { - var _this3 = this; + function onLoad(name, callback) { + var object = loaded[name]; - if (yields) yields.forEach(function (b) { - return _this3.yields[b] = _this3.top.size++; - }); - return this; - }; + loadHooks[name] = loadHooks[name] || []; + loadHooks[name].push(callback); - SymbolTable.prototype.initPartials = function initPartials(hasPartials) { - if (hasPartials) this.top.partialArgs = this.top.size++; - return this; - }; + if (object) { + callback(object); + } + } - SymbolTable.prototype.getMeta = function getMeta() { - var meta = this.meta; - var parent = this.parent; + /** + Called when an Ember.js package (e.g Ember.Application) has finished + loading. Triggers any callbacks registered for this event. + + @method runLoadHooks + @for Ember + @param name {String} name of hook + @param object {Object} object to pass to callbacks + @private + */ - if (!meta && parent) { - meta = parent.getMeta(); - } - return meta; - }; + function runLoadHooks(name, object) { + loaded[name] = object; + var window = _emberEnvironment.environment.window; - SymbolTable.prototype.getYield = function getYield(name) { - var yields = this.yields; - var parent = this.parent; + if (window && typeof CustomEvent === 'function') { + var _event = new CustomEvent(name, { detail: object, name: name }); + window.dispatchEvent(_event); + } - var symbol = yields[name]; - if (!symbol && parent) { - symbol = parent.getYield(name); - } - return symbol; - }; + if (loadHooks[name]) { + loadHooks[name].forEach(function (callback) { + return callback(object); + }); + } + } +}); +enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal', 'ember-environment', 'ember-runtime/system/object'], function (exports, _emberUtils, _emberMetal, _emberEnvironment, _emberRuntimeSystemObject) { + /** + @module ember + @submodule ember-runtime + */ + 'use strict'; - SymbolTable.prototype.getNamed = function getNamed(name) { - var named = this.named; - var parent = this.parent; + exports.isSearchDisabled = isSearchDisabled; + exports.setSearchDisabled = setSearchDisabled; - var symbol = named[name]; - if (!symbol && parent) { - symbol = parent.getNamed(name); - } - return symbol; - }; + var searchDisabled = false; - SymbolTable.prototype.getLocal = function getLocal(name) { - var locals = this.locals; - var parent = this.parent; + function isSearchDisabled() { + return searchDisabled; + } - var symbol = locals[name]; - if (!symbol && parent) { - symbol = parent.getLocal(name); - } - return symbol; - }; + function setSearchDisabled(flag) { + searchDisabled = !!flag; + } - SymbolTable.prototype.getPartialArgs = function getPartialArgs() { - return this.top.partialArgs; - }; + /** + 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. + + # Example Usage + + ```javascript + MyFramework = Ember.Namespace.create({ + VERSION: '1.0.0' + }); + ``` + + @class Namespace + @namespace Ember + @extends Ember.Object + @public + */ + var Namespace = _emberRuntimeSystemObject.default.extend({ + isNamespace: true, - SymbolTable.prototype.isTop = function isTop() { - return this.top === this; - }; + init: function () { + Namespace.NAMESPACES.push(this); + Namespace.PROCESSED = false; + }, - return SymbolTable; - })(); + toString: function () { + var name = _emberMetal.get(this, 'name') || _emberMetal.get(this, 'modulePrefix'); + if (name) { + return name; + } - exports.default = SymbolTable; -}); + findNamespaces(); + return this[_emberUtils.NAME_KEY]; + }, -enifed("glimmer-runtime/lib/syntax", ["exports"], function (exports) { - "use strict"; + nameClasses: function () { + processNamespace([this.toString()], this, {}); + }, - exports.isAttribute = isAttribute; + destroy: function () { + var namespaces = Namespace.NAMESPACES; + var toString = this.toString(); - var Statement = (function () { - function Statement() { - this.next = null; - this.prev = null; - } + if (toString) { + _emberEnvironment.context.lookup[toString] = undefined; + delete Namespace.NAMESPACES_BY_ID[toString]; + } + namespaces.splice(namespaces.indexOf(this), 1); + this._super.apply(this, arguments); + } + }); - Statement.fromSpec = function fromSpec(spec, symbolTable, scanner) { - throw new Error("You need to implement fromSpec on " + this); - }; + Namespace.reopenClass({ + NAMESPACES: [_emberMetal.default], + NAMESPACES_BY_ID: { + Ember: _emberMetal.default + }, + PROCESSED: false, + processAll: processAllNamespaces, + byName: function (name) { + if (!searchDisabled) { + processAllNamespaces(); + } - Statement.prototype.clone = function clone() { - // not type safe but the alternative is extreme boilerplate per - // syntax subclass. - return new this.constructor(this); - }; + return NAMESPACES_BY_ID[name]; + } + }); - Statement.prototype.scan = function scan(scanner) { - return this; - }; + var NAMESPACES_BY_ID = Namespace.NAMESPACES_BY_ID; - return Statement; - })(); + var hasOwnProp = ({}).hasOwnProperty; - exports.Statement = Statement; + function processNamespace(paths, root, seen) { + var idx = paths.length; - var Expression = (function () { - function Expression() {} + NAMESPACES_BY_ID[paths.join('.')] = root; - Expression.fromSpec = function fromSpec(spec, blocks) { - throw new Error("You need to implement fromSpec on " + this); - }; + // Loop over all of the keys in the namespace, looking for classes + for (var key in root) { + if (!hasOwnProp.call(root, key)) { + continue; + } + var obj = root[key]; - return Expression; - })(); + // If we are processing the `Ember` namespace, for example, the + // `paths` will start with `["Ember"]`. Every iteration through + // the loop will update the **second** element of this list with + // the key, so processing `Ember.View` will make the Array + // `['Ember', 'View']`. + paths[idx] = key; - exports.Expression = Expression; - var ATTRIBUTE = "e1185d30-7cac-4b12-b26a-35327d905d92"; - exports.ATTRIBUTE = ATTRIBUTE; - var ARGUMENT = "0f3802314-d747-bbc5-0168-97875185c3rt"; - exports.ARGUMENT = ARGUMENT; + // If we have found an unprocessed class + if (obj && obj.toString === classToString && !obj[_emberUtils.NAME_KEY]) { + // Replace the class' `toString` with the dot-separated path + // and set its `NAME_KEY` + obj[_emberUtils.NAME_KEY] = paths.join('.'); - var Attribute = (function (_Statement) { - babelHelpers.inherits(Attribute, _Statement); + // Support nested namespaces + } else if (obj && obj.isNamespace) { + // Skip aliased namespaces + if (seen[_emberUtils.guidFor(obj)]) { + continue; + } + seen[_emberUtils.guidFor(obj)] = true; - function Attribute() { - _Statement.apply(this, arguments); - this["e1185d30-7cac-4b12-b26a-35327d905d92"] = true; + // Process the child namespace + processNamespace(paths, obj, seen); } + } + + paths.length = idx; // cut out last item + } - return Attribute; - })(Statement); + function isUppercase(code) { + return code >= 65 && // A + code <= 90; // Z + } - exports.Attribute = Attribute; + function tryIsNamespace(lookup, prop) { + try { + var obj = lookup[prop]; + return obj && obj.isNamespace && obj; + } catch (e) { + // continue + } + } - var Argument = (function (_Statement2) { - babelHelpers.inherits(Argument, _Statement2); + function findNamespaces() { + if (Namespace.PROCESSED) { + return; + } + var lookup = _emberEnvironment.context.lookup; + var keys = Object.keys(lookup); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + // Only process entities that start with uppercase A-Z + if (!isUppercase(key.charCodeAt(0))) { + continue; + } + var obj = tryIsNamespace(lookup, key); + if (obj) { + obj[_emberUtils.NAME_KEY] = key; + } + } + } - function Argument() { - _Statement2.apply(this, arguments); - this["0f3802314-d747-bbc5-0168-97875185c3rt"] = true; - } + function superClassString(mixin) { + var superclass = mixin.superclass; + if (superclass) { + if (superclass[_emberUtils.NAME_KEY]) { + return superclass[_emberUtils.NAME_KEY]; + } + return superClassString(superclass); + } + } - return Argument; - })(Statement); + function calculateToString(target) { + var str = undefined; - exports.Argument = Argument; + if (!searchDisabled) { + processAllNamespaces(); + // can also be set by processAllNamespaces + str = target[_emberUtils.NAME_KEY]; + if (str) { + return str; + } else { + str = superClassString(target); + str = str ? '(subclass of ' + str + ')' : str; + } + } + if (str) { + return str; + } else { + return '(unknown mixin)'; + } + } - function isAttribute(value) { - return value && value[ATTRIBUTE] === true; + function classToString() { + var name = this[_emberUtils.NAME_KEY]; + if (name) { + return name; } -}); -enifed('glimmer-runtime/lib/syntax/builtins/each', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { - 'use strict'; + return this[_emberUtils.NAME_KEY] = calculateToString(this); + } - var EachSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(EachSyntax, _StatementSyntax); - - function EachSyntax(args) { - _StatementSyntax.call(this); - this.args = args; - this.type = "each-statement"; - } - - EachSyntax.prototype.compile = function compile(dsl, env) { - // Enter(BEGIN, END) - // BEGIN: Noop - // PutArgs - // PutIterable - // JumpUnless(ELSE) - // EnterList(BEGIN2, END2) - // ITER: Noop - // NextIter(BREAK) - // EnterWithKey(BEGIN2, END2) - // BEGIN2: Noop - // PushChildScope - // Evaluate(default) - // PopScope - // END2: Noop - // Exit - // Jump(ITER) - // BREAK: Noop - // ExitList - // Jump(END) - // ELSE: Noop - // Evalulate(inverse) - // END: Noop - // Exit - var args = this.args; - var blocks = this.args.blocks; - - dsl.block(args, function (dsl, BEGIN, END) { - dsl.putIterator(); - if (blocks.inverse) { - dsl.jumpUnless('ELSE'); - } else { - dsl.jumpUnless(END); - } - dsl.iter(function (dsl, BEGIN, END) { - dsl.evaluate('default', blocks.default); - }); - if (blocks.inverse) { - dsl.jump(END); - dsl.label('ELSE'); - dsl.evaluate('inverse', blocks.inverse); - } - }); - }; + function processAllNamespaces() { + var unprocessedNamespaces = !Namespace.PROCESSED; + var unprocessedMixins = _emberMetal.hasUnprocessedMixins(); - return EachSyntax; - })(_glimmerRuntimeLibSyntax.Statement); + if (unprocessedNamespaces) { + findNamespaces(); + Namespace.PROCESSED = true; + } - exports.default = EachSyntax; -}); + if (unprocessedNamespaces || unprocessedMixins) { + var namespaces = Namespace.NAMESPACES; + var namespace = undefined; -enifed('glimmer-runtime/lib/syntax/builtins/if', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { - 'use strict'; + for (var i = 0; i < namespaces.length; i++) { + namespace = namespaces[i]; + processNamespace([namespace.toString()], namespace, {}); + } - var IfSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(IfSyntax, _StatementSyntax); - - function IfSyntax(args) { - _StatementSyntax.call(this); - this.args = args; - this.type = "if-statement"; - } - - IfSyntax.prototype.compile = function compile(dsl) { - // PutArgs - // Test(Environment) - // Enter(BEGIN, END) - // BEGIN: Noop - // JumpUnless(ELSE) - // Evaluate(default) - // Jump(END) - // ELSE: Noop - // Evalulate(inverse) - // END: Noop - // Exit - var args = this.args; - var blocks = this.args.blocks; - - dsl.putArgs(args); - dsl.test('environment'); - dsl.block(null, function (dsl, BEGIN, END) { - if (blocks.inverse) { - dsl.jumpUnless('ELSE'); - dsl.evaluate('default', blocks.default); - dsl.jump(END); - dsl.label('ELSE'); - dsl.evaluate('inverse', blocks.inverse); - } else { - dsl.jumpUnless(END); - dsl.evaluate('default', blocks.default); - } - }); - }; + _emberMetal.clearUnprocessedMixins(); + } + } - return IfSyntax; - })(_glimmerRuntimeLibSyntax.Statement); + _emberMetal.Mixin.prototype.toString = classToString; // ES6TODO: altering imported objects. SBB. - exports.default = IfSyntax; + exports.default = Namespace; }); +// Preloaded into namespaces +enifed('ember-runtime/system/native_array', ['exports', 'ember-metal', 'ember-environment', '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, _emberMetal, _emberEnvironment, _emberRuntimeMixinsArray, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsObservable, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsFreezable, _emberRuntimeCopy) { + /** + @module ember + @submodule ember-runtime + */ + 'use strict'; -enifed('glimmer-runtime/lib/syntax/builtins/in-element', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { - 'use strict'; + var _NativeArray; - var InElementSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(InElementSyntax, _StatementSyntax); + // 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. - function InElementSyntax(args) { - _StatementSyntax.call(this); - this.args = args; - this.type = "in-element-statement"; - } + /** + The NativeArray mixin contains the properties needed to make the native + Array support Ember.MutableArray and all of its dependent APIs. Unless you + have `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Array` set to + false, this will be applied automatically. Otherwise you can apply the mixin + at anytime by calling `Ember.NativeArray.apply(Array.prototype)`. + + @class NativeArray + @namespace Ember + @uses Ember.MutableArray + @uses Ember.Observable + @uses Ember.Copyable + @public + */ + var NativeArray = _emberMetal.Mixin.create(_emberRuntimeMixinsMutable_array.default, _emberRuntimeMixinsObservable.default, _emberRuntimeMixinsCopyable.default, { - InElementSyntax.prototype.compile = function compile(dsl, env) { - var args = this.args; - var blocks = this.args.blocks; + // because length is a built-in property we need to know to just get the + // original property. + get: function (key) { + if ('number' === typeof key) { + return this[key]; + } else { + return this._super(key); + } + }, - dsl.putArgs(args); - dsl.test('simple'); - dsl.block(null, function (dsl, BEGIN, END) { - dsl.jumpUnless(END); - dsl.pushRemoteElement(); - dsl.evaluate('default', blocks.default); - dsl.popRemoteElement(); - }); - }; + objectAt: function (idx) { + return this[idx]; + }, - return InElementSyntax; - })(_glimmerRuntimeLibSyntax.Statement); + // primitive for array support. + replace: function (idx, amt, objects) { + if (this.isFrozen) { + throw _emberRuntimeMixinsFreezable.FROZEN_ERROR; + } - exports.default = InElementSyntax; -}); + // if we replaced exactly the same number of items, then pass only the + // replaced range. Otherwise, pass the full remaining array length + // since everything has shifted + var len = objects ? _emberMetal.get(objects, 'length') : 0; + _emberRuntimeMixinsArray.arrayContentWillChange(this, idx, amt, len); -enifed("glimmer-runtime/lib/syntax/builtins/partial", ["exports", "glimmer-runtime/lib/syntax"], function (exports, _glimmerRuntimeLibSyntax) { - "use strict"; + if (len === 0) { + this.splice(idx, amt); + } else { + _emberMetal.replace(this, idx, amt, objects); + } - var StaticPartialSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(StaticPartialSyntax, _StatementSyntax); + _emberRuntimeMixinsArray.arrayContentDidChange(this, idx, amt, len); + return this; + }, - function StaticPartialSyntax(name) { - _StatementSyntax.call(this); - this.name = name; - this.type = "static-partial"; - } + // If you ask for an unknown property, then try to collect the value + // from member items. + unknownProperty: function (key, value) { + var ret = undefined; // = this.reducedProperty(key, value); + if (value !== undefined && ret === undefined) { + ret = this[key] = value; + } + return ret; + }, - StaticPartialSyntax.prototype.compile = function compile(dsl, env, symbolTable) { - var name = String(this.name.inner()); - if (!env.hasPartial(name, symbolTable)) { - throw new Error("Compile Error: " + name + " is not a partial"); - } - var definition = env.lookupPartial(name, symbolTable); - dsl.putPartialDefinition(definition); - dsl.evaluatePartial(); - }; + indexOf: Array.prototype.indexOf, + lastIndexOf: Array.prototype.lastIndexOf, + + copy: function (deep) { + if (deep) { + return this.map(function (item) { + return _emberRuntimeCopy.default(item, true); + }); + } - return StaticPartialSyntax; - })(_glimmerRuntimeLibSyntax.Statement); + return this.slice(); + } + }); - exports.StaticPartialSyntax = StaticPartialSyntax; + // Remove any methods implemented natively so we don't override them + var ignore = ['length']; + NativeArray.keys().forEach(function (methodName) { + if (Array.prototype[methodName]) { + ignore.push(methodName); + } + }); - var DynamicPartialSyntax = (function (_StatementSyntax2) { - babelHelpers.inherits(DynamicPartialSyntax, _StatementSyntax2); + exports.NativeArray // TODO: only use default export + = NativeArray = (_NativeArray = NativeArray).without.apply(_NativeArray, ignore); - function DynamicPartialSyntax(name) { - _StatementSyntax2.call(this); - this.name = name; - this.type = "dynamic-partial"; + /** + Creates an `Ember.NativeArray` from an Array like object. + Does not modify the original object. Ember.A is not needed if + `EmberENV.EXTEND_PROTOTYPES` is `true` (the default value). However, + it is recommended that you use Ember.A when creating addons for + ember or when you can not guarantee that `EmberENV.EXTEND_PROTOTYPES` + will be `true`. + + Example + + ```js + export default Ember.Component.extend({ + tagName: 'ul', + classNames: ['pagination'], + + init() { + this._super(...arguments); + + if (!this.get('content')) { + this.set('content', Ember.A()); } + } + }); + ``` + + @method A + @for Ember + @return {Ember.NativeArray} + @public + */ + var A = undefined; - DynamicPartialSyntax.prototype.compile = function compile(dsl) { - var name = this.name; + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.Array) { + NativeArray.apply(Array.prototype); + exports.A = A = function (arr) { + return arr || []; + }; + } else { + exports.A = A = function (arr) { + if (!arr) { + arr = []; + } + return _emberRuntimeMixinsArray.default.detect(arr) ? arr : NativeArray.apply(arr); + }; + } - dsl.startLabels(); - dsl.putValue(name); - dsl.test('simple'); - dsl.enter('BEGIN', 'END'); - dsl.label('BEGIN'); - dsl.jumpUnless('END'); - dsl.putDynamicPartialDefinition(); - dsl.evaluatePartial(); - dsl.label('END'); - dsl.exit(); - dsl.stopLabels(); - }; + _emberMetal.default.A = A; + exports.A = A; + exports.NativeArray = NativeArray; + exports.default = NativeArray; +}); +// Ember.A circular +enifed('ember-runtime/system/object', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/system/core_object', 'ember-runtime/mixins/observable'], function (exports, _emberUtils, _emberMetal, _emberRuntimeSystemCore_object, _emberRuntimeMixinsObservable) { + /** + @module ember + @submodule ember-runtime + */ - return DynamicPartialSyntax; - })(_glimmerRuntimeLibSyntax.Statement); + 'use strict'; - exports.DynamicPartialSyntax = DynamicPartialSyntax; -}); + /** + `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. + + @class Object + @namespace Ember + @extends Ember.CoreObject + @uses Ember.Observable + @public + */ + var EmberObject = _emberRuntimeSystemCore_object.default.extend(_emberRuntimeMixinsObservable.default); + EmberObject.toString = function () { + return 'Ember.Object'; + }; -enifed('glimmer-runtime/lib/syntax/builtins/unless', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { - 'use strict'; + var FrameworkObject = EmberObject; - var UnlessSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(UnlessSyntax, _StatementSyntax); - - function UnlessSyntax(args) { - _StatementSyntax.call(this); - this.args = args; - this.type = "unless-statement"; - } - - UnlessSyntax.prototype.compile = function compile(dsl, env) { - // PutArgs - // Enter(BEGIN, END) - // BEGIN: Noop - // Test(Environment) - // JumpIf(ELSE) - // Evaluate(default) - // Jump(END) - // ELSE: Noop - // Evalulate(inverse) - // END: Noop - // Exit - var args = this.args; - var blocks = this.args.blocks; - - dsl.putArgs(args); - dsl.test('environment'); - dsl.block(null, function (dsl) { - if (blocks.inverse) { - dsl.jumpIf('ELSE'); - dsl.evaluate('default', blocks.default); - dsl.jump('END'); - dsl.label('ELSE'); - dsl.evaluate('inverse', blocks.inverse); - } else { - dsl.jumpIf('END'); - dsl.evaluate('default', blocks.default); - } - }); - }; + exports.FrameworkObject = FrameworkObject; + _emberMetal.runInDebug(function () { + var _EmberObject$extend; - return UnlessSyntax; - })(_glimmerRuntimeLibSyntax.Statement); + var INIT_WAS_CALLED = _emberUtils.symbol('INIT_WAS_CALLED'); + var ASSERT_INIT_WAS_CALLED = _emberUtils.symbol('ASSERT_INIT_WAS_CALLED'); - exports.default = UnlessSyntax; -}); + exports.FrameworkObject = FrameworkObject = EmberObject.extend((_EmberObject$extend = { + init: function () { + this._super.apply(this, arguments); + this[INIT_WAS_CALLED] = true; + } -enifed('glimmer-runtime/lib/syntax/builtins/with-dynamic-vars', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { - 'use strict'; + }, _EmberObject$extend[ASSERT_INIT_WAS_CALLED] = _emberMetal.on('init', function () { + _emberMetal.assert('You must call `this._super(...arguments);` when overriding `init` on a framework object. Please update ' + this + ' to call `this._super(...arguments);` from `init`.', this[INIT_WAS_CALLED]); + }), _EmberObject$extend)); + }); - var WithDynamicVarsSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(WithDynamicVarsSyntax, _StatementSyntax); + exports.default = EmberObject; +}); +enifed('ember-runtime/system/object_proxy', ['exports', 'ember-runtime/system/object', 'ember-runtime/mixins/-proxy'], function (exports, _emberRuntimeSystemObject, _emberRuntimeMixinsProxy) { + 'use strict'; - function WithDynamicVarsSyntax(args) { - _StatementSyntax.call(this); - this.args = args; - this.type = "with-dynamic-vars-statement"; + /** + `Ember.ObjectProxy` forwards all properties not defined by the proxy itself + to a proxied `content` object. + + ```javascript + object = Ember.Object.create({ + name: 'Foo' + }); + + proxy = Ember.ObjectProxy.create({ + content: object + }); + + // Access and change existing properties + proxy.get('name') // 'Foo' + proxy.set('name', 'Bar'); + object.get('name') // 'Bar' + + // Create new 'description' property on `object` + proxy.set('description', 'Foo is a whizboo baz'); + object.get('description') // 'Foo is a whizboo baz' + ``` + + While `content` is unset, setting a property to be delegated will throw an + Error. + + ```javascript + proxy = Ember.ObjectProxy.create({ + content: null, + flag: null + }); + proxy.set('flag', true); + proxy.get('flag'); // true + proxy.get('foo'); // undefined + proxy.set('foo', 'data'); // throws Error + ``` + + Delegated properties can be bound to and will change when content is updated. + + Computed properties on the proxy itself can depend on delegated properties. + + ```javascript + ProxyWithComputedProperty = Ember.ObjectProxy.extend({ + fullName: Ember.computed('firstName', 'lastName', function() { + var firstName = this.get('firstName'), + lastName = this.get('lastName'); + if (firstName && lastName) { + return firstName + ' ' + lastName; } + return firstName || lastName; + }) + }); + + proxy = ProxyWithComputedProperty.create(); + + proxy.get('fullName'); // undefined + proxy.set('content', { + firstName: 'Tom', lastName: 'Dale' + }); // triggers property change for fullName on proxy + + proxy.get('fullName'); // 'Tom Dale' + ``` + + @class ObjectProxy + @namespace Ember + @extends Ember.Object + @extends Ember._ProxyMixin + @public + */ - WithDynamicVarsSyntax.prototype.compile = function compile(dsl, env) { - var args = this.args; - var blocks = this.args.blocks; + 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'; - dsl.unit(function (dsl) { - dsl.putArgs(args); - dsl.pushDynamicScope(); - dsl.bindDynamicScope(args.named.keys); - dsl.evaluate('default', blocks.default); - dsl.popDynamicScope(); - }); - }; + /** + 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. + + Example: + + ```javascript + App.ApplicationRoute = Ember.Route.extend({ + authManager: Ember.inject.service('auth'), + + model: function() { + return this.get('authManager').findCurrentUser(); + } + }); + ``` + + This example will create an `authManager` property on the application route + that looks up the `auth` service in the container, making it easily + accessible in the `model` hook. + + @method service + @since 1.10.0 + @for Ember.inject + @param {String} name (optional) name of the service to inject, defaults to + the property's name + @return {Ember.InjectedProperty} injection descriptor instance + @public + */ + _emberRuntimeInject.createInjectionHelper('service'); + + /** + @class Service + @namespace Ember + @extends Ember.Object + @since 1.10.0 + @public + */ + var Service = _emberRuntimeSystemObject.default.extend(); - return WithDynamicVarsSyntax; - })(_glimmerRuntimeLibSyntax.Statement); + Service.reopenClass({ + isServiceFactory: true + }); - exports.default = WithDynamicVarsSyntax; + exports.default = Service; }); +enifed('ember-runtime/system/string', ['exports', 'ember-metal', 'ember-utils', 'ember-runtime/utils', 'ember-runtime/string_registry'], function (exports, _emberMetal, _emberUtils, _emberRuntimeUtils, _emberRuntimeString_registry) { + /** + @module ember + @submodule ember-runtime + */ + 'use strict'; -enifed('glimmer-runtime/lib/syntax/builtins/with', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { - 'use strict'; + var STRING_DASHERIZE_REGEXP = /[ _]/g; - var WithSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(WithSyntax, _StatementSyntax); - - function WithSyntax(args) { - _StatementSyntax.call(this); - this.args = args; - this.type = "with-statement"; - } - - WithSyntax.prototype.compile = function compile(dsl, env) { - // PutArgs - // Test(Environment) - // Enter(BEGIN, END) - // BEGIN: Noop - // JumpUnless(ELSE) - // Evaluate(default) - // Jump(END) - // ELSE: Noop - // Evaluate(inverse) - // END: Noop - // Exit - var args = this.args; - var blocks = this.args.blocks; - - dsl.putArgs(args); - dsl.test('environment'); - dsl.block(null, function (dsl, BEGIN, END) { - if (blocks.inverse) { - dsl.jumpUnless('ELSE'); - dsl.evaluate('default', blocks.default); - dsl.jump(END); - dsl.label('ELSE'); - dsl.evaluate('inverse', blocks.inverse); - } else { - dsl.jumpUnless(END); - dsl.evaluate('default', blocks.default); - } - }); - }; + var STRING_DASHERIZE_CACHE = new _emberMetal.Cache(1000, function (key) { + return decamelize(key).replace(STRING_DASHERIZE_REGEXP, '-'); + }); - return WithSyntax; - })(_glimmerRuntimeLibSyntax.Statement); + var STRING_CAMELIZE_REGEXP_1 = /(\-|\_|\.|\s)+(.)?/g; + var STRING_CAMELIZE_REGEXP_2 = /(^|\/)([A-Z])/g; - exports.default = WithSyntax; -}); + var CAMELIZE_CACHE = new _emberMetal.Cache(1000, function (key) { + return key.replace(STRING_CAMELIZE_REGEXP_1, function (match, separator, chr) { + return chr ? chr.toUpperCase() : ''; + }).replace(STRING_CAMELIZE_REGEXP_2, function (match, separator, chr) { + return match.toLowerCase(); + }); + }); -enifed('glimmer-runtime/lib/syntax/core', ['exports', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/syntax/builtins/partial', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-runtime/lib/compiled/opcodes/component', 'glimmer-runtime/lib/compiled/opcodes/dom', 'glimmer-runtime/lib/syntax/expressions', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/compiled/expressions/value', 'glimmer-runtime/lib/compiled/expressions/lookups', 'glimmer-runtime/lib/compiled/expressions/has-block', 'glimmer-runtime/lib/compiled/expressions/helper', 'glimmer-runtime/lib/compiled/expressions/concat', 'glimmer-runtime/lib/utils', 'glimmer-runtime/lib/compiled/opcodes/content'], function (exports, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibSyntaxBuiltinsPartial, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerRuntimeLibCompiledOpcodesComponent, _glimmerRuntimeLibCompiledOpcodesDom, _glimmerRuntimeLibSyntaxExpressions, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibCompiledExpressionsValue, _glimmerRuntimeLibCompiledExpressionsLookups, _glimmerRuntimeLibCompiledExpressionsHasBlock, _glimmerRuntimeLibCompiledExpressionsHelper, _glimmerRuntimeLibCompiledExpressionsConcat, _glimmerRuntimeLibUtils, _glimmerRuntimeLibCompiledOpcodesContent) { - 'use strict'; + var STRING_CLASSIFY_REGEXP_1 = /^(\-|_)+(.)?/; + var STRING_CLASSIFY_REGEXP_2 = /(.)(\-|\_|\.|\s)+(.)?/g; + var STRING_CLASSIFY_REGEXP_3 = /(^|\/|\.)([a-z])/g; - var Block = (function (_StatementSyntax) { - babelHelpers.inherits(Block, _StatementSyntax); + var CLASSIFY_CACHE = new _emberMetal.Cache(1000, function (str) { + var replace1 = function (match, separator, chr) { + return chr ? '_' + chr.toUpperCase() : ''; + }; + var replace2 = function (match, initialChar, separator, chr) { + return initialChar + (chr ? chr.toUpperCase() : ''); + }; + var parts = str.split('/'); + for (var i = 0; i < parts.length; i++) { + parts[i] = parts[i].replace(STRING_CLASSIFY_REGEXP_1, replace1).replace(STRING_CLASSIFY_REGEXP_2, replace2); + } + return parts.join('/').replace(STRING_CLASSIFY_REGEXP_3, function (match, separator, chr) { + return match.toUpperCase(); + }); + }); - function Block(path, args) { - _StatementSyntax.call(this); - this.path = path; - this.args = args; - this.type = "block"; - } + var STRING_UNDERSCORE_REGEXP_1 = /([a-z\d])([A-Z]+)/g; + var STRING_UNDERSCORE_REGEXP_2 = /\-|\s+/g; - Block.fromSpec = function fromSpec(sexp, symbolTable, scanner) { - var path = sexp[1]; - var params = sexp[2]; - var hash = sexp[3]; - var templateId = sexp[4]; - var inverseId = sexp[5]; + var UNDERSCORE_CACHE = new _emberMetal.Cache(1000, function (str) { + return str.replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2').replace(STRING_UNDERSCORE_REGEXP_2, '_').toLowerCase(); + }); - var template = scanner.blockFor(symbolTable, templateId); - var inverse = typeof inverseId === 'number' ? scanner.blockFor(symbolTable, inverseId) : null; - var blocks = Blocks.fromSpec(template, inverse); - return new Block(path, Args.fromSpec(params, hash, blocks)); - }; + var STRING_CAPITALIZE_REGEXP = /(^|\/)([a-z])/g; - Block.build = function build(path, args) { - return new this(path, args); - }; + var CAPITALIZE_CACHE = new _emberMetal.Cache(1000, function (str) { + return str.replace(STRING_CAPITALIZE_REGEXP, function (match, separator, chr) { + return match.toUpperCase(); + }); + }); - Block.prototype.scan = function scan(scanner) { - var _args$blocks = this.args.blocks; - var _default = _args$blocks.default; - var inverse = _args$blocks.inverse; + var STRING_DECAMELIZE_REGEXP = /([a-z\d])([A-Z])/g; - if (_default) scanner.addChild(_default); - if (inverse) scanner.addChild(inverse); - return this; - }; + var DECAMELIZE_CACHE = new _emberMetal.Cache(1000, function (str) { + return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase(); + }); - Block.prototype.compile = function compile(ops) { - throw new Error("SyntaxError"); - }; + function _fmt(str, formats) { + var cachedFormats = formats; - return Block; - })(_glimmerRuntimeLibSyntax.Statement); + if (!_emberRuntimeUtils.isArray(cachedFormats) || arguments.length > 2) { + cachedFormats = new Array(arguments.length - 1); - exports.Block = Block; + for (var i = 1; i < arguments.length; i++) { + cachedFormats[i - 1] = arguments[i]; + } + } - var Append = (function (_StatementSyntax2) { - babelHelpers.inherits(Append, _StatementSyntax2); + // first, replace any ORDERED replacements. + var idx = 0; // the current index for non-numerical replacements + return str.replace(/%@([0-9]+)?/g, function (s, argIndex) { + argIndex = argIndex ? parseInt(argIndex, 10) - 1 : idx++; + s = cachedFormats[argIndex]; + return s === null ? '(null)' : s === undefined ? '' : _emberUtils.inspect(s); + }); + } - function Append(_ref) { - var value = _ref.value; - var trustingMorph = _ref.trustingMorph; + function fmt(str, formats) { + _emberMetal.deprecate('Ember.String.fmt is deprecated, use ES6 template strings instead.', false, { id: 'ember-string-utils.fmt', until: '3.0.0', url: 'http://babeljs.io/docs/learn-es2015/#template-strings' }); + return _fmt.apply(undefined, arguments); + } - _StatementSyntax2.call(this); - this.value = value; - this.trustingMorph = trustingMorph; - } + function loc(str, formats) { + if (!_emberRuntimeUtils.isArray(formats) || arguments.length > 2) { + formats = Array.prototype.slice.call(arguments, 1); + } - Append.fromSpec = function fromSpec(sexp) { - var value = sexp[1]; - var trustingMorph = sexp[2]; + str = _emberRuntimeString_registry.get(str) || str; + return _fmt(str, formats); + } - return new OptimizedAppend({ value: _glimmerRuntimeLibSyntaxExpressions.default(value), trustingMorph: trustingMorph }); - }; + function w(str) { + return str.split(/\s+/); + } - return Append; - })(_glimmerRuntimeLibSyntax.Statement); + function decamelize(str) { + return DECAMELIZE_CACHE.get(str); + } - exports.Append = Append; + function dasherize(str) { + return STRING_DASHERIZE_CACHE.get(str); + } - var OptimizedAppend = (function (_Append) { - babelHelpers.inherits(OptimizedAppend, _Append); + function camelize(str) { + return CAMELIZE_CACHE.get(str); + } - function OptimizedAppend() { - _Append.apply(this, arguments); - this.type = "optimized-append"; - } + function classify(str) { + return CLASSIFY_CACHE.get(str); + } - OptimizedAppend.prototype.deopt = function deopt() { - return new UnoptimizedAppend(this); - }; + function underscore(str) { + return UNDERSCORE_CACHE.get(str); + } - OptimizedAppend.prototype.compile = function compile(compiler, env, symbolTable) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesVm.PutValueOpcode(this.value.compile(compiler, env, symbolTable))); - if (this.trustingMorph) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesContent.OptimizedTrustingAppendOpcode()); - } else { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesContent.OptimizedCautiousAppendOpcode()); - } - }; + function capitalize(str) { + return CAPITALIZE_CACHE.get(str); + } - return OptimizedAppend; - })(Append); + /** + Defines string helper methods including string formatting and localization. + Unless `EmberENV.EXTEND_PROTOTYPES.String` is `false` these methods will also be + added to the `String.prototype` as well. + + @class String + @namespace Ember + @static + @public + */ + exports.default = { + /** + Apply formatting options to the string. This will look for occurrences + of "%@" in your string and substitute them with the arguments you pass into + this method. If you want to control the specific order of replacement, + you can add a number after the key as well to indicate which argument + you want to insert. + Ordered insertions are most useful when building loc strings where values + you need to insert may appear in different orders. + ```javascript + "Hello %@ %@".fmt('John', 'Doe'); // "Hello John Doe" + "Hello %@2, %@1".fmt('John', 'Doe'); // "Hello Doe, John" + ``` + @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: http://babeljs.io/docs/learn-es2015/#template-strings + */ + fmt: fmt, - exports.OptimizedAppend = OptimizedAppend; + /** + Formats the passed string, but first looks up the string in the localized + strings hash. This is a convenient way to localize text. See + `Ember.String.fmt()` for more information on formatting. + Note that it is traditional but not required to prefix localized string + keys with an underscore or other character so you can easily identify + localized strings. + ```javascript + Ember.STRINGS = { + '_Hello World': 'Bonjour le monde', + '_Hello %@ %@': 'Bonjour %@ %@' + }; + Ember.String.loc("_Hello World"); // 'Bonjour le monde'; + Ember.String.loc("_Hello %@ %@", ["John", "Smith"]); // "Bonjour John Smith"; + ``` + @method loc + @param {String} str The string to format + @param {Array} formats Optional array of parameters to interpolate into string. + @return {String} formatted string + @public + */ + loc: loc, - var UnoptimizedAppend = (function (_Append2) { - babelHelpers.inherits(UnoptimizedAppend, _Append2); + /** + Splits a string into separate units separated by spaces, eliminating any + empty strings in the process. This is a convenience method for split that + is mostly useful when applied to the `String.prototype`. + ```javascript + Ember.String.w("alpha beta gamma").forEach(function(key) { + console.log(key); + }); + // > alpha + // > beta + // > gamma + ``` + @method w + @param {String} str The string to split + @return {Array} array containing the split strings + @public + */ + w: w, - function UnoptimizedAppend() { - _Append2.apply(this, arguments); - this.type = "unoptimized-append"; - } + /** + Converts a camelized string into all lower case separated by underscores. + ```javascript + 'innerHTML'.decamelize(); // 'inner_html' + 'action_name'.decamelize(); // 'action_name' + 'css-class-name'.decamelize(); // 'css-class-name' + 'my favorite items'.decamelize(); // 'my favorite items' + ``` + @method decamelize + @param {String} str The string to decamelize. + @return {String} the decamelized string. + @public + */ + decamelize: decamelize, - UnoptimizedAppend.prototype.compile = function compile(compiler, env, symbolTable) { - var expression = this.value.compile(compiler, env, symbolTable); - if (this.trustingMorph) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesContent.GuardedTrustingAppendOpcode(expression, symbolTable)); - } else { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesContent.GuardedCautiousAppendOpcode(expression, symbolTable)); - } - }; + /** + Replaces underscores, spaces, or camelCase with dashes. + ```javascript + 'innerHTML'.dasherize(); // 'inner-html' + 'action_name'.dasherize(); // 'action-name' + 'css-class-name'.dasherize(); // 'css-class-name' + 'my favorite items'.dasherize(); // 'my-favorite-items' + 'privateDocs/ownerInvoice'.dasherize(); // 'private-docs/owner-invoice' + ``` + @method dasherize + @param {String} str The string to dasherize. + @return {String} the dasherized string. + @public + */ + dasherize: dasherize, - return UnoptimizedAppend; - })(Append); + /** + Returns the lowerCamelCase form of a string. + ```javascript + 'innerHTML'.camelize(); // 'innerHTML' + 'action_name'.camelize(); // 'actionName' + 'css-class-name'.camelize(); // 'cssClassName' + 'my favorite items'.camelize(); // 'myFavoriteItems' + 'My Favorite Items'.camelize(); // 'myFavoriteItems' + 'private-docs/owner-invoice'.camelize(); // 'privateDocs/ownerInvoice' + ``` + @method camelize + @param {String} str The string to camelize. + @return {String} the camelized string. + @public + */ + camelize: camelize, - exports.UnoptimizedAppend = UnoptimizedAppend; + /** + Returns the UpperCamelCase form of a string. + ```javascript + 'innerHTML'.classify(); // 'InnerHTML' + 'action_name'.classify(); // 'ActionName' + 'css-class-name'.classify(); // 'CssClassName' + 'my favorite items'.classify(); // 'MyFavoriteItems' + 'private-docs/owner-invoice'.classify(); // 'PrivateDocs/OwnerInvoice' + ``` + @method classify + @param {String} str the string to classify + @return {String} the classified string + @public + */ + classify: classify, - var MODIFIER_SYNTAX = "c0420397-8ff1-4241-882b-4b7a107c9632"; + /** + More general than decamelize. Returns the lower\_case\_and\_underscored + form of a string. + ```javascript + 'innerHTML'.underscore(); // 'inner_html' + 'action_name'.underscore(); // 'action_name' + 'css-class-name'.underscore(); // 'css_class_name' + 'my favorite items'.underscore(); // 'my_favorite_items' + 'privateDocs/ownerInvoice'.underscore(); // 'private_docs/owner_invoice' + ``` + @method underscore + @param {String} str The string to underscore. + @return {String} the underscored string. + @public + */ + underscore: underscore, - var Modifier = (function (_StatementSyntax3) { - babelHelpers.inherits(Modifier, _StatementSyntax3); + /** + Returns the Capitalized form of a string + ```javascript + 'innerHTML'.capitalize() // 'InnerHTML' + 'action_name'.capitalize() // 'Action_name' + 'css-class-name'.capitalize() // 'Css-class-name' + 'my favorite items'.capitalize() // 'My favorite items' + 'privateDocs/ownerInvoice'.capitalize(); // 'PrivateDocs/ownerInvoice' + ``` + @method capitalize + @param {String} str The string to capitalize. + @return {String} The capitalized string. + @public + */ + capitalize: capitalize + }; + exports.fmt = fmt; + exports.loc = loc; + exports.w = w; + exports.decamelize = decamelize; + exports.dasherize = dasherize; + exports.camelize = camelize; + exports.classify = classify; + exports.underscore = underscore; + exports.capitalize = capitalize; +}); +enifed('ember-runtime/utils', ['exports', 'ember-runtime/mixins/array', 'ember-runtime/system/object'], function (exports, _emberRuntimeMixinsArray, _emberRuntimeSystemObject) { + 'use strict'; - function Modifier(options) { - _StatementSyntax3.call(this); - this["c0420397-8ff1-4241-882b-4b7a107c9632"] = true; - this.type = "modifier"; - this.path = options.path; - this.args = options.args; - } + exports.isArray = isArray; + exports.typeOf = typeOf; - Modifier.fromSpec = function fromSpec(node) { - var path = node[1]; - var params = node[2]; - var hash = node[3]; + // ........................................ + // TYPING & ARRAY MESSAGING + // + var TYPE_MAP = { + '[object Boolean]': 'boolean', + '[object Number]': 'number', + '[object String]': 'string', + '[object Function]': 'function', + '[object Array]': 'array', + '[object Date]': 'date', + '[object RegExp]': 'regexp', + '[object Object]': 'object', + '[object FileList]': 'filelist' + }; - return new Modifier({ - path: path, - args: Args.fromSpec(params, hash, EMPTY_BLOCKS) - }); - }; + var toString = Object.prototype.toString; - Modifier.build = function build(path, options) { - return new Modifier({ - path: path, - params: options.params, - hash: options.hash - }); - }; + /** + Returns true if the passed object is an array or Array-like. + + Objects are considered Array-like if any of the following are true: + + - the object is a native Array + - the object has an objectAt property + - the object is an Object, and has a length property + + Unlike `Ember.typeOf` this method returns true even if the passed object is + not formally an array but appears to be array-like (i.e. implements `Ember.Array`) + + ```javascript + Ember.isArray(); // false + Ember.isArray([]); // true + Ember.isArray(Ember.ArrayProxy.create({ content: [] })); // true + ``` + + @method isArray + @for Ember + @param {Object} obj The object to test + @return {Boolean} true if the passed object is an array or Array-like + @public + */ - Modifier.prototype.compile = function compile(compiler, env, symbolTable) { - var args = this.args.compile(compiler, env, symbolTable); - if (env.hasModifier(this.path, symbolTable)) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.ModifierOpcode(this.path[0], env.lookupModifier(this.path, symbolTable), args)); - } else { - throw new Error('Compile Error: ' + this.path.join('.') + ' is not a modifier'); - } - }; + function isArray(obj) { + if (!obj || obj.setInterval) { + return false; + } + if (Array.isArray(obj)) { + return true; + } + if (_emberRuntimeMixinsArray.default.detect(obj)) { + return true; + } - return Modifier; - })(_glimmerRuntimeLibSyntax.Statement); + var type = typeOf(obj); + if ('array' === type) { + return true; + } + if (obj.length !== undefined && 'object' === type) { + return true; + } + return false; + } - exports.Modifier = Modifier; + /** + Returns a consistent type for the passed object. + + Use this instead of the built-in `typeof` to get the type of an item. + It will return the same result across all browsers and includes a bit + more detail. Here is what will be returned: + + | Return Value | Meaning | + |---------------|------------------------------------------------------| + | 'string' | String primitive or String object. | + | 'number' | Number primitive or Number object. | + | 'boolean' | Boolean primitive or Boolean object. | + | 'null' | Null value | + | 'undefined' | Undefined value | + | 'function' | A function | + | 'array' | An instance of Array | + | 'regexp' | An instance of RegExp | + | 'date' | An instance of Date | + | 'filelist' | An instance of FileList | + | 'class' | An Ember class (created using Ember.Object.extend()) | + | 'instance' | An Ember object instance | + | 'error' | An instance of the Error object | + | 'object' | A JavaScript object not inheriting from Ember.Object | + + Examples: + + ```javascript + Ember.typeOf(); // 'undefined' + Ember.typeOf(null); // 'null' + Ember.typeOf(undefined); // 'undefined' + Ember.typeOf('michael'); // 'string' + Ember.typeOf(new String('michael')); // 'string' + Ember.typeOf(101); // 'number' + Ember.typeOf(new Number(101)); // 'number' + Ember.typeOf(true); // 'boolean' + Ember.typeOf(new Boolean(true)); // 'boolean' + Ember.typeOf(Ember.makeArray); // 'function' + Ember.typeOf([1, 2, 90]); // 'array' + Ember.typeOf(/abc/); // 'regexp' + Ember.typeOf(new Date()); // 'date' + Ember.typeOf(event.target.files); // 'filelist' + Ember.typeOf(Ember.Object.extend()); // 'class' + Ember.typeOf(Ember.Object.create()); // 'instance' + Ember.typeOf(new Error('teamocil')); // 'error' + + // 'normal' JavaScript object + Ember.typeOf({ a: 'b' }); // 'object' + ``` + + @method typeOf + @for Ember + @param {Object} item the item to check + @return {String} the type + @public + */ - var StaticArg = (function (_ArgumentSyntax) { - babelHelpers.inherits(StaticArg, _ArgumentSyntax); + function typeOf(item) { + if (item === null) { + return 'null'; + } + if (item === undefined) { + return 'undefined'; + } + var ret = TYPE_MAP[toString.call(item)] || 'object'; - function StaticArg(name, value) { - _ArgumentSyntax.call(this); - this.name = name; - this.value = value; - this.type = "static-arg"; - } + if (ret === 'function') { + if (_emberRuntimeSystemObject.default.detect(item)) { + ret = 'class'; + } + } else if (ret === 'object') { + if (item instanceof Error) { + ret = 'error'; + } else if (item instanceof _emberRuntimeSystemObject.default) { + ret = 'instance'; + } else if (item instanceof Date) { + ret = 'date'; + } + } - StaticArg.fromSpec = function fromSpec(node) { - var name = node[1]; - var value = node[2]; + return ret; + } +}); +enifed('ember-testing/adapters/adapter', ['exports', 'ember-runtime'], function (exports, _emberRuntime) { + 'use strict'; - return new StaticArg(name, value); - }; + function K() { + return this; + } - StaticArg.build = function build(name, value) { - var namespace = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; + /** + @module ember + @submodule ember-testing + */ - return new this(name, value); - }; + /** + The primary purpose of this class is to create hooks that can be implemented + by an adapter for various test frameworks. + + @class Adapter + @namespace Ember.Test + @public + */ + exports.default = _emberRuntime.Object.extend({ + /** + This callback will be called whenever an async operation is about to start. + Override this to call your framework's methods that handle async + operations. + @public + @method asyncStart + */ + asyncStart: K, - StaticArg.prototype.compile = function compile() { - throw new Error('Cannot compiler StaticArg "' + this.name + '" as it is a delegate for ValueSyntax.'); - }; + /** + This callback will be called whenever an async operation has completed. + @public + @method asyncEnd + */ + asyncEnd: K, - StaticArg.prototype.valueSyntax = function valueSyntax() { - return Value.build(this.value); + /** + Override this method with your testing framework's false assertion. + This function is called whenever an exception occurs causing the testing + promise to fail. + QUnit example: + ```javascript + exception: function(error) { + ok(false, error); }; + ``` + @public + @method exception + @param {String} error The exception to be raised. + */ + exception: function (error) { + throw error; + } + }); +}); +enifed('ember-testing/adapters/qunit', ['exports', 'ember-utils', 'ember-testing/adapters/adapter'], function (exports, _emberUtils, _emberTestingAdaptersAdapter) { + 'use strict'; - return StaticArg; - })(_glimmerRuntimeLibSyntax.Argument); + /** + This class implements the methods defined by Ember.Test.Adapter for the + QUnit testing framework. + + @class QUnitAdapter + @namespace Ember.Test + @extends Ember.Test.Adapter + @public + */ + exports.default = _emberTestingAdaptersAdapter.default.extend({ + asyncStart: function () { + QUnit.stop(); + }, + asyncEnd: function () { + QUnit.start(); + }, + exception: function (error) { + ok(false, _emberUtils.inspect(error)); + } + }); +}); +enifed('ember-testing/events', ['exports', 'ember-views', 'ember-metal'], function (exports, _emberViews, _emberMetal) { + 'use strict'; - exports.StaticArg = StaticArg; + exports.focus = focus; + exports.fireEvent = fireEvent; - var DynamicArg = (function (_ArgumentSyntax2) { - babelHelpers.inherits(DynamicArg, _ArgumentSyntax2); + var DEFAULT_EVENT_OPTIONS = { canBubble: true, cancelable: true }; + var KEYBOARD_EVENT_TYPES = ['keydown', 'keypress', 'keyup']; + var MOUSE_EVENT_TYPES = ['click', 'mousedown', 'mouseup', 'dblclick', 'mouseenter', 'mouseleave', 'mousemove', 'mouseout', 'mouseover']; - function DynamicArg(name, value) { - var namespace = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; + function focus(el) { + if (!el) { + return; + } + var $el = _emberViews.jQuery(el); + if ($el.is(':input, [contenteditable=true]')) { + var type = $el.prop('type'); + if (type !== 'checkbox' && type !== 'radio' && type !== 'hidden') { + _emberMetal.run(null, function () { + // Firefox does not trigger the `focusin` event if the window + // does not have focus. If the document doesn't have focus just + // use trigger('focusin') instead. - _ArgumentSyntax2.call(this); - this.name = name; - this.value = value; - this.namespace = namespace; - this.type = 'dynamic-arg'; - } + if (!document.hasFocus || document.hasFocus()) { + el.focus(); + } else { + $el.trigger('focusin'); + } + }); + } + } + } - DynamicArg.fromSpec = function fromSpec(sexp) { - var name = sexp[1]; - var value = sexp[2]; + function fireEvent(element, type) { + var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; - return new DynamicArg(name, _glimmerRuntimeLibSyntaxExpressions.default(value)); - }; + if (!element) { + return; + } + var event = undefined; + if (KEYBOARD_EVENT_TYPES.indexOf(type) > -1) { + event = buildKeyboardEvent(type, options); + } else if (MOUSE_EVENT_TYPES.indexOf(type) > -1) { + var rect = element.getBoundingClientRect(); + var x = rect.left + 1; + var y = rect.top + 1; + var simulatedCoordinates = { + screenX: x + 5, + screenY: y + 95, + clientX: x, + clientY: y + }; + event = buildMouseEvent(type, _emberViews.jQuery.extend(simulatedCoordinates, options)); + } else { + event = buildBasicEvent(type, options); + } + element.dispatchEvent(event); + } - DynamicArg.build = function build(name, value) { - return new this(name, value); - }; + function buildBasicEvent(type) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - DynamicArg.prototype.compile = function compile() { - throw new Error('Cannot compile DynamicArg for "' + this.name + '" as it is delegate for ExpressionSyntax.'); - }; + var event = document.createEvent('Events'); + event.initEvent(type, true, true); + _emberViews.jQuery.extend(event, options); + return event; + } - DynamicArg.prototype.valueSyntax = function valueSyntax() { - return this.value; - }; + function buildMouseEvent(type) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - return DynamicArg; - })(_glimmerRuntimeLibSyntax.Argument); + var event = undefined; + try { + event = document.createEvent('MouseEvents'); + var eventOpts = _emberViews.jQuery.extend({}, DEFAULT_EVENT_OPTIONS, options); + event.initMouseEvent(type, eventOpts.canBubble, eventOpts.cancelable, window, eventOpts.detail, eventOpts.screenX, eventOpts.screenY, eventOpts.clientX, eventOpts.clientY, eventOpts.ctrlKey, eventOpts.altKey, eventOpts.shiftKey, eventOpts.metaKey, eventOpts.button, eventOpts.relatedTarget); + } catch (e) { + event = buildBasicEvent(type, options); + } + return event; + } - exports.DynamicArg = DynamicArg; + function buildKeyboardEvent(type) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - var TrustingAttr = (function () { - function TrustingAttr() {} + var event = undefined; + try { + event = document.createEvent('KeyEvents'); + var eventOpts = _emberViews.jQuery.extend({}, DEFAULT_EVENT_OPTIONS, options); + event.initKeyEvent(type, eventOpts.canBubble, eventOpts.cancelable, window, eventOpts.ctrlKey, eventOpts.altKey, eventOpts.shiftKey, eventOpts.metaKey, eventOpts.keyCode, eventOpts.charCode); + } catch (e) { + event = buildBasicEvent(type, options); + } + return event; + } +}); +enifed('ember-testing/ext/application', ['exports', 'ember-application', 'ember-testing/setup_for_testing', 'ember-testing/test/helpers', 'ember-testing/test/promise', 'ember-testing/test/run', 'ember-testing/test/on_inject_helpers', 'ember-testing/test/adapter'], function (exports, _emberApplication, _emberTestingSetup_for_testing, _emberTestingTestHelpers, _emberTestingTestPromise, _emberTestingTestRun, _emberTestingTestOn_inject_helpers, _emberTestingTestAdapter) { + 'use strict'; - TrustingAttr.fromSpec = function fromSpec(sexp) { - var name = sexp[1]; - var value = sexp[2]; - var namespace = sexp[3]; + _emberApplication.Application.reopen({ + /** + This property contains the testing helpers for the current application. These + are created once you call `injectTestHelpers` on your `Ember.Application` + instance. The included helpers are also available on the `window` object by + default, but can be used from this object on the individual application also. + @property testHelpers + @type {Object} + @default {} + @public + */ + testHelpers: {}, - return new DynamicAttr(name, _glimmerRuntimeLibSyntaxExpressions.default(value), namespace, true); - }; + /** + This property will contain the original methods that were registered + on the `helperContainer` before `injectTestHelpers` is called. + When `removeTestHelpers` is called, these methods are restored to the + `helperContainer`. + @property originalMethods + @type {Object} + @default {} + @private + @since 1.3.0 + */ + originalMethods: {}, - TrustingAttr.build = function build(name, value, isTrusting) { - var namespace = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3]; + /** + This property indicates whether or not this application is currently in + testing mode. This is set when `setupForTesting` is called on the current + application. + @property testing + @type {Boolean} + @default false + @since 1.3.0 + @public + */ + testing: false, - return new DynamicAttr(name, value, namespace, isTrusting); - }; + /** + This hook defers the readiness of the application, so that you can start + the app when your tests are ready to run. It also sets the router's + location to 'none', so that the window's location will not be modified + (preventing both accidental leaking of state between tests and interference + with your testing framework). + Example: + ``` + App.setupForTesting(); + ``` + @method setupForTesting + @public + */ + setupForTesting: function () { + _emberTestingSetup_for_testing.default(); - TrustingAttr.prototype.compile = function compile() { - throw new Error('Attempting to compile a TrustingAttr which is just a delegate for DynamicAttr.'); - }; + this.testing = true; - return TrustingAttr; - })(); + this.Router.reopen({ + location: 'none' + }); + }, - exports.TrustingAttr = TrustingAttr; + /** + This will be used as the container to inject the test helpers into. By + default the helpers are injected into `window`. + @property helperContainer + @type {Object} The object to be used for test helpers. + @default window + @since 1.2.0 + @private + */ + helperContainer: null, - var StaticAttr = (function (_AttributeSyntax) { - babelHelpers.inherits(StaticAttr, _AttributeSyntax); + /** + This injects the test helpers into the `helperContainer` object. If an object is provided + it will be used as the helperContainer. If `helperContainer` is not set it will default + to `window`. If a function of the same name has already been defined it will be cached + (so that it can be reset if the helper is removed with `unregisterHelper` or + `removeTestHelpers`). + Any callbacks registered with `onInjectHelpers` will be called once the + helpers have been injected. + Example: + ``` + App.injectTestHelpers(); + ``` + @method injectTestHelpers + @public + */ + injectTestHelpers: function (helperContainer) { + if (helperContainer) { + this.helperContainer = helperContainer; + } else { + this.helperContainer = window; + } - function StaticAttr(name, value, namespace) { - _AttributeSyntax.call(this); - this.name = name; - this.value = value; - this.namespace = namespace; - this["e1185d30-7cac-4b12-b26a-35327d905d92"] = true; - this.type = "static-attr"; - this.isTrusting = false; + this.reopen({ + willDestroy: function () { + this._super.apply(this, arguments); + this.removeTestHelpers(); } + }); - StaticAttr.fromSpec = function fromSpec(node) { - var name = node[1]; - var value = node[2]; - var namespace = node[3]; - - return new StaticAttr(name, value, namespace); - }; - - StaticAttr.build = function build(name, value) { - var namespace = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; + this.testHelpers = {}; + for (var _name in _emberTestingTestHelpers.helpers) { + this.originalMethods[_name] = this.helperContainer[_name]; + this.testHelpers[_name] = this.helperContainer[_name] = helper(this, _name); + protoWrap(_emberTestingTestPromise.default.prototype, _name, helper(this, _name), _emberTestingTestHelpers.helpers[_name].meta.wait); + } - return new this(name, value, namespace); - }; + _emberTestingTestOn_inject_helpers.invokeInjectHelpersCallbacks(this); + }, - StaticAttr.prototype.compile = function compile(compiler) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.StaticAttrOpcode(this.namespace, this.name, this.value)); - }; + /** + This removes all helpers that have been registered, and resets and functions + that were overridden by the helpers. + Example: + ```javascript + App.removeTestHelpers(); + ``` + @public + @method removeTestHelpers + */ + removeTestHelpers: function () { + if (!this.helperContainer) { + return; + } - StaticAttr.prototype.valueSyntax = function valueSyntax() { - return Value.build(this.value); - }; + for (var _name2 in _emberTestingTestHelpers.helpers) { + this.helperContainer[_name2] = this.originalMethods[_name2]; + delete _emberTestingTestPromise.default.prototype[_name2]; + delete this.testHelpers[_name2]; + delete this.originalMethods[_name2]; + } + } + }); - return StaticAttr; - })(_glimmerRuntimeLibSyntax.Attribute); + // This method is no longer needed + // But still here for backwards compatibility + // of helper chaining + function protoWrap(proto, name, callback, isAsync) { + proto[name] = function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - exports.StaticAttr = StaticAttr; + if (isAsync) { + return callback.apply(this, args); + } else { + return this.then(function () { + return callback.apply(this, args); + }); + } + }; + } - var DynamicAttr = (function (_AttributeSyntax2) { - babelHelpers.inherits(DynamicAttr, _AttributeSyntax2); + function helper(app, name) { + var fn = _emberTestingTestHelpers.helpers[name].method; + var meta = _emberTestingTestHelpers.helpers[name].meta; + if (!meta.wait) { + return function () { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - function DynamicAttr(name, value, namespace, isTrusting) { - if (namespace === undefined) namespace = undefined; + return fn.apply(app, [app].concat(args)); + }; + } - _AttributeSyntax2.call(this); - this.name = name; - this.value = value; - this.namespace = namespace; - this.isTrusting = isTrusting; - this["e1185d30-7cac-4b12-b26a-35327d905d92"] = true; - this.type = "dynamic-attr"; - } + return function () { + for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } - DynamicAttr.fromSpec = function fromSpec(sexp) { - var name = sexp[1]; - var value = sexp[2]; - var namespace = sexp[3]; + var lastPromise = _emberTestingTestRun.default(function () { + return _emberTestingTestPromise.resolve(_emberTestingTestPromise.getLastPromise()); + }); - return new DynamicAttr(name, _glimmerRuntimeLibSyntaxExpressions.default(value), namespace); - }; + // wait for last helper's promise to resolve and then + // execute. To be safe, we need to tell the adapter we're going + // asynchronous here, because fn may not be invoked before we + // return. + _emberTestingTestAdapter.asyncStart(); + return lastPromise.then(function () { + return fn.apply(app, [app].concat(args)); + }).finally(_emberTestingTestAdapter.asyncEnd); + }; + } +}); +enifed('ember-testing/ext/rsvp', ['exports', 'ember-runtime', 'ember-metal', 'ember-testing/test/adapter'], function (exports, _emberRuntime, _emberMetal, _emberTestingTestAdapter) { + 'use strict'; - DynamicAttr.build = function build(name, value) { - var isTrusting = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2]; - var namespace = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3]; + _emberRuntime.RSVP.configure('async', function (callback, promise) { + // if schedule will cause autorun, we need to inform adapter + if (_emberMetal.isTesting() && !_emberMetal.run.backburner.currentInstance) { + _emberTestingTestAdapter.asyncStart(); + _emberMetal.run.backburner.schedule('actions', function () { + _emberTestingTestAdapter.asyncEnd(); + callback(promise); + }); + } else { + _emberMetal.run.backburner.schedule('actions', function () { + return callback(promise); + }); + } + }); - return new this(name, value, namespace, isTrusting); - }; + exports.default = _emberRuntime.RSVP; +}); +enifed('ember-testing/helpers', ['exports', 'ember-metal', 'ember-testing/test/helpers', 'ember-testing/helpers/and_then', 'ember-testing/helpers/click', 'ember-testing/helpers/current_path', 'ember-testing/helpers/current_route_name', 'ember-testing/helpers/current_url', 'ember-testing/helpers/fill_in', 'ember-testing/helpers/find', 'ember-testing/helpers/find_with_assert', 'ember-testing/helpers/key_event', 'ember-testing/helpers/pause_test', 'ember-testing/helpers/trigger_event', 'ember-testing/helpers/visit', 'ember-testing/helpers/wait'], function (exports, _emberMetal, _emberTestingTestHelpers, _emberTestingHelpersAnd_then, _emberTestingHelpersClick, _emberTestingHelpersCurrent_path, _emberTestingHelpersCurrent_route_name, _emberTestingHelpersCurrent_url, _emberTestingHelpersFill_in, _emberTestingHelpersFind, _emberTestingHelpersFind_with_assert, _emberTestingHelpersKey_event, _emberTestingHelpersPause_test, _emberTestingHelpersTrigger_event, _emberTestingHelpersVisit, _emberTestingHelpersWait) { + 'use strict'; - DynamicAttr.prototype.compile = function compile(compiler, env, symbolTable) { - var namespace = this.namespace; - var value = this.value; + _emberTestingTestHelpers.registerAsyncHelper('visit', _emberTestingHelpersVisit.default); + _emberTestingTestHelpers.registerAsyncHelper('click', _emberTestingHelpersClick.default); + _emberTestingTestHelpers.registerAsyncHelper('keyEvent', _emberTestingHelpersKey_event.default); + _emberTestingTestHelpers.registerAsyncHelper('fillIn', _emberTestingHelpersFill_in.default); + _emberTestingTestHelpers.registerAsyncHelper('wait', _emberTestingHelpersWait.default); + _emberTestingTestHelpers.registerAsyncHelper('andThen', _emberTestingHelpersAnd_then.default); + _emberTestingTestHelpers.registerAsyncHelper('pauseTest', _emberTestingHelpersPause_test.pauseTest); + _emberTestingTestHelpers.registerAsyncHelper('triggerEvent', _emberTestingHelpersTrigger_event.default); - compiler.append(new _glimmerRuntimeLibCompiledOpcodesVm.PutValueOpcode(value.compile(compiler, env, symbolTable))); - if (namespace) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.DynamicAttrNSOpcode(this.name, this.namespace, this.isTrusting)); - } else { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.DynamicAttrOpcode(this.name, this.isTrusting)); - } - }; + _emberTestingTestHelpers.registerHelper('find', _emberTestingHelpersFind.default); + _emberTestingTestHelpers.registerHelper('findWithAssert', _emberTestingHelpersFind_with_assert.default); + _emberTestingTestHelpers.registerHelper('currentRouteName', _emberTestingHelpersCurrent_route_name.default); + _emberTestingTestHelpers.registerHelper('currentPath', _emberTestingHelpersCurrent_path.default); + _emberTestingTestHelpers.registerHelper('currentURL', _emberTestingHelpersCurrent_url.default); - DynamicAttr.prototype.valueSyntax = function valueSyntax() { - return this.value; - }; + if (_emberMetal.isFeatureEnabled('ember-testing-resume-test')) { + _emberTestingTestHelpers.registerHelper('resumeTest', _emberTestingHelpersPause_test.resumeTest); + } +}); +enifed("ember-testing/helpers/and_then", ["exports"], function (exports) { + /** + @module ember + @submodule ember-testing + */ + "use strict"; - return DynamicAttr; - })(_glimmerRuntimeLibSyntax.Attribute); + exports.default = andThen; - exports.DynamicAttr = DynamicAttr; + function andThen(app, callback) { + return app.testHelpers.wait(callback(app)); + } +}); +enifed('ember-testing/helpers/click', ['exports', 'ember-testing/events'], function (exports, _emberTestingEvents) { + /** + @module ember + @submodule ember-testing + */ + 'use strict'; - var FlushElement = (function (_StatementSyntax4) { - babelHelpers.inherits(FlushElement, _StatementSyntax4); + exports.default = click; - function FlushElement() { - _StatementSyntax4.apply(this, arguments); - this.type = "flush-element"; - } + /** + Clicks an element and triggers any actions triggered by the element's `click` + event. + + Example: + + ```javascript + click('.some-jQuery-selector').then(function() { + // assert something + }); + ``` + + @method click + @param {String} selector jQuery selector for finding element on the DOM + @param {Object} context A DOM Element, Document, or jQuery to use as context + @return {RSVP.Promise} + @public + */ - FlushElement.fromSpec = function fromSpec() { - return new FlushElement(); - }; + function click(app, selector, context) { + var $el = app.testHelpers.findWithAssert(selector, context); + var el = $el[0]; - FlushElement.build = function build() { - return new this(); - }; + _emberTestingEvents.fireEvent(el, 'mousedown'); - FlushElement.prototype.compile = function compile(compiler) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.FlushElementOpcode()); - }; + _emberTestingEvents.focus(el); - return FlushElement; - })(_glimmerRuntimeLibSyntax.Statement); + _emberTestingEvents.fireEvent(el, 'mouseup'); + _emberTestingEvents.fireEvent(el, 'click'); - exports.FlushElement = FlushElement; + return app.testHelpers.wait(); + } +}); +enifed('ember-testing/helpers/current_path', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-testing + */ + 'use strict'; - var CloseElement = (function (_StatementSyntax5) { - babelHelpers.inherits(CloseElement, _StatementSyntax5); + exports.default = currentPath; - function CloseElement() { - _StatementSyntax5.apply(this, arguments); - this.type = "close-element"; - } + /** + Returns the current path. + + Example: + + ```javascript + function validateURL() { + equal(currentPath(), 'some.path.index', "correct path was transitioned into."); + } + + click('#some-link-id').then(validateURL); + ``` + + @method currentPath + @return {Object} The currently active path. + @since 1.5.0 + @public + */ - CloseElement.fromSpec = function fromSpec() { - return new CloseElement(); - }; + function currentPath(app) { + var routingService = app.__container__.lookup('service:-routing'); + return _emberMetal.get(routingService, 'currentPath'); + } +}); +enifed('ember-testing/helpers/current_route_name', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-testing + */ + 'use strict'; - CloseElement.build = function build() { - return new this(); - }; + exports.default = currentRouteName; - CloseElement.prototype.compile = function compile(compiler) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.CloseElementOpcode()); - }; + /** + Returns the currently active route name. + Example: + ```javascript + function validateRouteName() { + equal(currentRouteName(), 'some.path', "correct route was transitioned into."); + } + visit('/some/path').then(validateRouteName) + ``` + @method currentRouteName + @return {Object} The name of the currently active route. + @since 1.5.0 + @public + */ - return CloseElement; - })(_glimmerRuntimeLibSyntax.Statement); + function currentRouteName(app) { + var routingService = app.__container__.lookup('service:-routing'); + return _emberMetal.get(routingService, 'currentRouteName'); + } +}); +enifed('ember-testing/helpers/current_url', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-testing + */ + 'use strict'; - exports.CloseElement = CloseElement; + exports.default = currentURL; - var Text = (function (_StatementSyntax6) { - babelHelpers.inherits(Text, _StatementSyntax6); + /** + Returns the current URL. + + Example: + + ```javascript + function validateURL() { + equal(currentURL(), '/some/path', "correct URL was transitioned into."); + } + + click('#some-link-id').then(validateURL); + ``` + + @method currentURL + @return {Object} The currently active URL. + @since 1.5.0 + @public + */ - function Text(content) { - _StatementSyntax6.call(this); - this.content = content; - this.type = "text"; - } + function currentURL(app) { + var router = app.__container__.lookup('router:main'); + return _emberMetal.get(router, 'location').getURL(); + } +}); +enifed('ember-testing/helpers/fill_in', ['exports', 'ember-testing/events'], function (exports, _emberTestingEvents) { + /** + @module ember + @submodule ember-testing + */ + 'use strict'; - Text.fromSpec = function fromSpec(node) { - var content = node[1]; + exports.default = fillIn; - return new Text(content); - }; + /** + Fills in an input element with some text. + + Example: + + ```javascript + fillIn('#email', 'you@example.com').then(function() { + // assert something + }); + ``` + + @method fillIn + @param {String} selector jQuery selector finding an input element on the DOM + to fill text with + @param {String} text text to place inside the input element + @return {RSVP.Promise} + @public + */ - Text.build = function build(content) { - return new this(content); - }; + function fillIn(app, selector, contextOrText, text) { + var $el = undefined, + el = undefined, + context = undefined; + if (typeof text === 'undefined') { + text = contextOrText; + } else { + context = contextOrText; + } + $el = app.testHelpers.findWithAssert(selector, context); + el = $el[0]; + _emberTestingEvents.focus(el); - Text.prototype.compile = function compile(dsl) { - dsl.text(this.content); - }; + $el.eq(0).val(text); + _emberTestingEvents.fireEvent(el, 'input'); + _emberTestingEvents.fireEvent(el, 'change'); - return Text; - })(_glimmerRuntimeLibSyntax.Statement); + return app.testHelpers.wait(); + } +}); +enifed('ember-testing/helpers/find', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-testing + */ + 'use strict'; - exports.Text = Text; + exports.default = find; - var Comment = (function (_StatementSyntax7) { - babelHelpers.inherits(Comment, _StatementSyntax7); + /** + Finds an element in the context of the app's container element. A simple alias + for `app.$(selector)`. + + Example: + + ```javascript + var $el = find('.my-selector'); + ``` + + With the `context` param: + + ```javascript + var $el = find('.my-selector', '.parent-element-class'); + ``` + + @method find + @param {String} selector jQuery string selector for element lookup + @param {String} [context] (optional) jQuery selector that will limit the selector + argument to find only within the context's children + @return {Object} jQuery object representing the results of the query + @public + */ - function Comment(comment) { - _StatementSyntax7.call(this); - this.comment = comment; - this.type = "comment"; - } + function find(app, selector, context) { + var $el = undefined; + context = context || _emberMetal.get(app, 'rootElement'); + $el = app.$(selector, context); + return $el; + } +}); +enifed('ember-testing/helpers/find_with_assert', ['exports'], function (exports) { + /** + @module ember + @submodule ember-testing + */ + /** + Like `find`, but throws an error if the element selector returns no results. + + Example: + + ```javascript + var $el = findWithAssert('.doesnt-exist'); // throws error + ``` + + With the `context` param: + + ```javascript + var $el = findWithAssert('.selector-id', '.parent-element-class'); // assert will pass + ``` + + @method findWithAssert + @param {String} selector jQuery selector string for finding an element within + the DOM + @param {String} [context] (optional) jQuery selector that will limit the + selector argument to find only within the context's children + @return {Object} jQuery object representing the results of the query + @throws {Error} throws error if jQuery object returned has a length of 0 + @public + */ + 'use strict'; - Comment.fromSpec = function fromSpec(sexp) { - var value = sexp[1]; + exports.default = findWithAssert; - return new Comment(value); - }; + function findWithAssert(app, selector, context) { + var $el = app.testHelpers.find(selector, context); + if ($el.length === 0) { + throw new Error('Element ' + selector + ' not found.'); + } + return $el; + } +}); +enifed('ember-testing/helpers/key_event', ['exports'], function (exports) { + /** + @module ember + @submodule ember-testing + */ + /** + Simulates a key event, e.g. `keypress`, `keydown`, `keyup` with the desired keyCode + Example: + ```javascript + keyEvent('.some-jQuery-selector', 'keypress', 13).then(function() { + // assert something + }); + ``` + @method keyEvent + @param {String} selector jQuery selector for finding element on the DOM + @param {String} type the type of key event, e.g. `keypress`, `keydown`, `keyup` + @param {Number} keyCode the keyCode of the simulated key event + @return {RSVP.Promise} + @since 1.5.0 + @public + */ + 'use strict'; - Comment.build = function build(value) { - return new this(value); - }; + exports.default = keyEvent; - Comment.prototype.compile = function compile(dsl) { - dsl.comment(this.comment); - }; + function keyEvent(app, selector, contextOrType, typeOrKeyCode, keyCode) { + var context = undefined, + type = undefined; - return Comment; - })(_glimmerRuntimeLibSyntax.Statement); + if (typeof keyCode === 'undefined') { + context = null; + keyCode = typeOrKeyCode; + type = contextOrType; + } else { + context = contextOrType; + type = typeOrKeyCode; + } - exports.Comment = Comment; + return app.testHelpers.triggerEvent(selector, context, type, { keyCode: keyCode, which: keyCode }); + } +}); +enifed('ember-testing/helpers/pause_test', ['exports', 'ember-runtime', 'ember-console', 'ember-metal'], function (exports, _emberRuntime, _emberConsole, _emberMetal) { + /** + @module ember + @submodule ember-testing + */ + 'use strict'; - var OpenElement = (function (_StatementSyntax8) { - babelHelpers.inherits(OpenElement, _StatementSyntax8); + exports.resumeTest = resumeTest; + exports.pauseTest = pauseTest; - function OpenElement(tag, blockParams, symbolTable) { - _StatementSyntax8.call(this); - this.tag = tag; - this.blockParams = blockParams; - this.symbolTable = symbolTable; - this.type = "open-element"; - } + var resume = undefined; - OpenElement.fromSpec = function fromSpec(sexp, symbolTable) { - var tag = sexp[1]; - var blockParams = sexp[2]; + /** + Resumes a test paused by `pauseTest`. + + @method resumeTest + @return {void} + @public + */ - return new OpenElement(tag, blockParams, symbolTable); - }; + function resumeTest() { + _emberMetal.assert('Testing has not been paused. There is nothing to resume.', resume); + resume(); + resume = undefined; + } - OpenElement.build = function build(tag, blockParams, symbolTable) { - return new this(tag, blockParams, symbolTable); - }; + /** + Pauses the current test - this is useful for debugging while testing or for test-driving. + It allows you to inspect the state of your application at any point. + Example (The test will pause before clicking the button): + + ```javascript + visit('/') + return pauseTest(); + click('.btn'); + ``` + @since 1.9.0 + @method pauseTest + @return {Object} A promise that will never resolve + @public + */ - OpenElement.prototype.scan = function scan(scanner) { - var tag = this.tag; + function pauseTest() { + if (_emberMetal.isFeatureEnabled('ember-testing-resume-test')) { + _emberConsole.default.info('Testing paused. Use `resumeTest()` to continue.'); + } - if (scanner.env.hasComponentDefinition([tag], this.symbolTable)) { - var _parameters = this.parameters(scanner); + return new _emberRuntime.RSVP.Promise(function (resolve) { + if (_emberMetal.isFeatureEnabled('ember-testing-resume-test')) { + resume = resolve; + } + }, 'TestAdapter paused promise'); + } +}); +enifed('ember-testing/helpers/trigger_event', ['exports', 'ember-testing/events'], function (exports, _emberTestingEvents) { + /** + @module ember + @submodule ember-testing + */ + 'use strict'; - var args = _parameters.args; - var attrs = _parameters.attrs; + exports.default = triggerEvent; - scanner.startBlock(this.blockParams); - this.tagContents(scanner); - var template = scanner.endBlock(this.blockParams); - args.blocks = Blocks.fromSpec(template); - return new Component(tag, attrs, args); - } else { - return new OpenPrimitiveElement(tag); - } - }; + /** + Triggers the given DOM event on the element identified by the provided selector. + Example: + ```javascript + triggerEvent('#some-elem-id', 'blur'); + ``` + This is actually used internally by the `keyEvent` helper like so: + ```javascript + triggerEvent('#some-elem-id', 'keypress', { keyCode: 13 }); + ``` + @method triggerEvent + @param {String} selector jQuery selector for finding element on the DOM + @param {String} [context] jQuery selector that will limit the selector + argument to find only within the context's children + @param {String} type The event type to be triggered. + @param {Object} [options] The options to be passed to jQuery.Event. + @return {RSVP.Promise} + @since 1.5.0 + @public + */ - OpenElement.prototype.compile = function compile(list, env) { - list.append(new _glimmerRuntimeLibCompiledOpcodesDom.OpenPrimitiveElementOpcode(this.tag)); - }; + function triggerEvent(app, selector, contextOrType, typeOrOptions, possibleOptions) { + var arity = arguments.length; + var context = undefined, + type = undefined, + options = undefined; - OpenElement.prototype.toIdentity = function toIdentity() { - var tag = this.tag; + if (arity === 3) { + // context and options are optional, so this is + // app, selector, type + context = null; + type = contextOrType; + options = {}; + } else if (arity === 4) { + // context and options are optional, so this is + if (typeof typeOrOptions === 'object') { + // either + // app, selector, type, options + context = null; + type = contextOrType; + options = typeOrOptions; + } else { + // or + // app, selector, context, type + context = contextOrType; + type = typeOrOptions; + options = {}; + } + } else { + context = contextOrType; + type = typeOrOptions; + options = possibleOptions; + } - return new OpenPrimitiveElement(tag); - }; + var $el = app.testHelpers.findWithAssert(selector, context); + var el = $el[0]; - OpenElement.prototype.parameters = function parameters(scanner) { - var current = scanner.next(); - var attrs = []; - var argKeys = []; - var argValues = []; - while (!(current instanceof FlushElement)) { - if (current[MODIFIER_SYNTAX]) { - throw new Error('Compile Error: Element modifiers are not allowed in components'); - } - var param = current; - if (current[_glimmerRuntimeLibSyntax.ATTRIBUTE]) { - attrs.push(param.name); - // REMOVE ME: attributes should not be treated as args - argKeys.push(param.name); - argValues.push(param.valueSyntax()); - } else if (current[_glimmerRuntimeLibSyntax.ARGUMENT]) { - argKeys.push(param.name); - argValues.push(param.valueSyntax()); - } else { - throw new Error("Expected FlushElement, but got ${current}"); - } - current = scanner.next(); - } - return { args: Args.fromNamedArgs(NamedArgs.build(argKeys, argValues)), attrs: attrs }; - }; + _emberTestingEvents.fireEvent(el, type, options); - OpenElement.prototype.tagContents = function tagContents(scanner) { - var nesting = 1; - while (true) { - var current = scanner.next(); - if (current instanceof CloseElement && --nesting === 0) { - break; - } - scanner.addStatement(current); - if (current instanceof OpenElement || current instanceof OpenPrimitiveElement) { - nesting++; - } - } - }; + return app.testHelpers.wait(); + } +}); +enifed('ember-testing/helpers/visit', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-testing + */ + 'use strict'; - return OpenElement; - })(_glimmerRuntimeLibSyntax.Statement); + exports.default = visit; - exports.OpenElement = OpenElement; + /** + Loads a route, sets up any controllers, and renders any templates associated + with the route as though a real user had triggered the route change while + using your app. + + Example: + + ```javascript + visit('posts/index').then(function() { + // assert something + }); + ``` + + @method visit + @param {String} url the name of the route + @return {RSVP.Promise} + @public + */ - var Component = (function (_StatementSyntax9) { - babelHelpers.inherits(Component, _StatementSyntax9); + function visit(app, url) { + var router = app.__container__.lookup('router:main'); + var shouldHandleURL = false; - function Component(tag, attrs, args) { - _StatementSyntax9.call(this); - this.tag = tag; - this.attrs = attrs; - this.args = args; - this.type = 'component'; - } - - Component.prototype.compile = function compile(list, env, symbolTable) { - var definition = env.getComponentDefinition([this.tag], symbolTable); - var args = this.args.compile(list, env, symbolTable); - var shadow = this.attrs; - list.append(new _glimmerRuntimeLibCompiledOpcodesComponent.PutComponentDefinitionOpcode(definition)); - list.append(new _glimmerRuntimeLibCompiledOpcodesComponent.OpenComponentOpcode(args, shadow)); - list.append(new _glimmerRuntimeLibCompiledOpcodesComponent.CloseComponentOpcode()); - }; + app.boot().then(function () { + router.location.setURL(url); - return Component; - })(_glimmerRuntimeLibSyntax.Statement); + if (shouldHandleURL) { + _emberMetal.run(app.__deprecatedInstance__, 'handleURL', url); + } + }); - exports.Component = Component; + if (app._readinessDeferrals > 0) { + router['initialURL'] = url; + _emberMetal.run(app, 'advanceReadiness'); + delete router['initialURL']; + } else { + shouldHandleURL = true; + } - var OpenPrimitiveElement = (function (_StatementSyntax10) { - babelHelpers.inherits(OpenPrimitiveElement, _StatementSyntax10); + return app.testHelpers.wait(); + } +}); +enifed('ember-testing/helpers/wait', ['exports', 'ember-testing/test/waiters', 'ember-runtime', 'ember-metal', 'ember-testing/test/pending_requests'], function (exports, _emberTestingTestWaiters, _emberRuntime, _emberMetal, _emberTestingTestPending_requests) { + /** + @module ember + @submodule ember-testing + */ + 'use strict'; - function OpenPrimitiveElement(tag) { - _StatementSyntax10.call(this); - this.tag = tag; - this.type = "open-primitive-element"; - } + exports.default = wait; - OpenPrimitiveElement.build = function build(tag) { - return new this(tag); - }; + /** + Causes the run loop to process any pending events. This is used to ensure that + any async operations from other helpers (or your assertions) have been processed. + + This is most often used as the return value for the helper functions (see 'click', + 'fillIn','visit',etc). However, there is a method to register a test helper which + utilizes this method without the need to actually call `wait()` in your helpers. + + The `wait` helper is built into `registerAsyncHelper` by default. You will not need + to `return app.testHelpers.wait();` - the wait behavior is provided for you. + + Example: + + ```javascript + Ember.Test.registerAsyncHelper('loginUser', function(app, username, password) { + visit('secured/path/here') + .fillIn('#username', username) + .fillIn('#password', password) + .click('.submit'); + }); + + @method wait + @param {Object} value The value to be returned. + @return {RSVP.Promise} + @public + @since 1.0.0 + */ - OpenPrimitiveElement.prototype.compile = function compile(compiler) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.OpenPrimitiveElementOpcode(this.tag)); - }; + function wait(app, value) { + return new _emberRuntime.RSVP.Promise(function (resolve) { + var router = app.__container__.lookup('router:main'); - return OpenPrimitiveElement; - })(_glimmerRuntimeLibSyntax.Statement); + // Every 10ms, poll for the async thing to have finished + var watcher = setInterval(function () { + // 1. If the router is loading, keep polling + var routerIsLoading = router.router && !!router.router.activeTransition; + if (routerIsLoading) { + return; + } - exports.OpenPrimitiveElement = OpenPrimitiveElement; + // 2. If there are pending Ajax requests, keep polling + if (_emberTestingTestPending_requests.pendingRequests()) { + return; + } - var Yield = (function (_StatementSyntax11) { - babelHelpers.inherits(Yield, _StatementSyntax11); + // 3. If there are scheduled timers or we are inside of a run loop, keep polling + if (_emberMetal.run.hasScheduledTimers() || _emberMetal.run.currentRunLoop) { + return; + } - function Yield(to, args) { - _StatementSyntax11.call(this); - this.to = to; - this.args = args; - this.type = "yield"; + if (_emberTestingTestWaiters.checkWaiters()) { + return; } - Yield.fromSpec = function fromSpec(sexp) { - var to = sexp[1]; - var params = sexp[2]; + // Stop polling + clearInterval(watcher); - var args = Args.fromSpec(params, null, EMPTY_BLOCKS); - return new Yield(to, args); - }; + // Synchronously resolve the promise + _emberMetal.run(null, resolve, value); + }, 10); + }); + } +}); +enifed('ember-testing/index', ['exports', 'ember-testing/support', 'ember-testing/ext/application', 'ember-testing/ext/rsvp', 'ember-testing/helpers', 'ember-testing/initializers', 'ember-testing/test', 'ember-testing/adapters/adapter', 'ember-testing/setup_for_testing', 'ember-testing/adapters/qunit'], function (exports, _emberTestingSupport, _emberTestingExtApplication, _emberTestingExtRsvp, _emberTestingHelpers, _emberTestingInitializers, _emberTestingTest, _emberTestingAdaptersAdapter, _emberTestingSetup_for_testing, _emberTestingAdaptersQunit) { + 'use strict'; - Yield.build = function build(params, to) { - var args = Args.fromPositionalArgs(PositionalArgs.build(params)); - return new this(to, args); - }; + exports.Test = _emberTestingTest.default; + exports.Adapter = _emberTestingAdaptersAdapter.default; + exports.setupForTesting = _emberTestingSetup_for_testing.default; + exports.QUnitAdapter = _emberTestingAdaptersQunit.default; +}); +// to handle various edge cases +// setup RSVP + run loop integration +// adds helpers to helpers object in Test +// to setup initializer - Yield.prototype.compile = function compile(dsl, env, symbolTable) { - var to = this.to; - - var args = this.args.compile(dsl, env, symbolTable); - if (dsl.hasBlockSymbol(to)) { - var symbol = dsl.getBlockSymbol(to); - var inner = new _glimmerRuntimeLibCompiledExpressionsHasBlock.CompiledGetBlockBySymbol(symbol, to); - dsl.append(new OpenBlockOpcode(inner, args)); - dsl.append(new CloseBlockOpcode()); - } else if (dsl.hasPartialArgsSymbol()) { - var symbol = dsl.getPartialArgsSymbol(); - var inner = new _glimmerRuntimeLibCompiledExpressionsHasBlock.CompiledInPartialGetBlock(symbol, to); - dsl.append(new OpenBlockOpcode(inner, args)); - dsl.append(new CloseBlockOpcode()); - } else { - throw new Error('[BUG] ${to} is not a valid block name.'); - } - }; +/** + @module ember + @submodule ember-testing +*/ +enifed('ember-testing/initializers', ['exports', 'ember-runtime'], function (exports, _emberRuntime) { + 'use strict'; - return Yield; - })(_glimmerRuntimeLibSyntax.Statement); + var name = 'deferReadiness in `testing` mode'; - exports.Yield = Yield; + _emberRuntime.onLoad('Ember.Application', function (Application) { + if (!Application.initializers[name]) { + Application.initializer({ + name: name, - function isStaticPartialName(exp) { - return exp.type === 'value'; + initialize: function (application) { + if (application.testing) { + application.deferReadiness(); + } + } + }); } + }); +}); +enifed('ember-testing/setup_for_testing', ['exports', 'ember-metal', 'ember-views', 'ember-testing/test/adapter', 'ember-testing/test/pending_requests', 'ember-testing/adapters/adapter', 'ember-testing/adapters/qunit'], function (exports, _emberMetal, _emberViews, _emberTestingTestAdapter, _emberTestingTestPending_requests, _emberTestingAdaptersAdapter, _emberTestingAdaptersQunit) { + /* global self */ - var Partial = (function (_StatementSyntax12) { - babelHelpers.inherits(Partial, _StatementSyntax12); - - function Partial() { - _StatementSyntax12.apply(this, arguments); - } + 'use strict'; - Partial.fromSpec = function fromSpec(sexp) { - var exp = sexp[1]; + exports.default = setupForTesting; - var name = _glimmerRuntimeLibSyntaxExpressions.default(exp); - if (isStaticPartialName(name)) { - return new _glimmerRuntimeLibSyntaxBuiltinsPartial.StaticPartialSyntax(name); - } else { - return new _glimmerRuntimeLibSyntaxBuiltinsPartial.DynamicPartialSyntax(name); - } - }; + /** + Sets Ember up for testing. This is useful to perform + basic setup steps in order to unit test. + + Use `App.setupForTesting` to perform integration tests (full + application testing). + + @method setupForTesting + @namespace Ember + @since 1.5.0 + @private + */ - return Partial; - })(_glimmerRuntimeLibSyntax.Statement); + function setupForTesting() { + _emberMetal.setTesting(true); - exports.Partial = Partial; + var adapter = _emberTestingTestAdapter.getAdapter(); + // if adapter is not manually set default to QUnit + if (!adapter) { + _emberTestingTestAdapter.setAdapter(typeof self.QUnit === 'undefined' ? new _emberTestingAdaptersAdapter.default() : new _emberTestingAdaptersQunit.default()); + } - var OpenBlockOpcode = (function (_Opcode) { - babelHelpers.inherits(OpenBlockOpcode, _Opcode); + _emberViews.jQuery(document).off('ajaxSend', _emberTestingTestPending_requests.incrementPendingRequests); + _emberViews.jQuery(document).off('ajaxComplete', _emberTestingTestPending_requests.decrementPendingRequests); - function OpenBlockOpcode(inner, args) { - _Opcode.call(this); - this.inner = inner; - this.args = args; - this.type = "open-block"; - } + _emberTestingTestPending_requests.clearPendingRequests(); - OpenBlockOpcode.prototype.evaluate = function evaluate(vm) { - var block = this.inner.evaluate(vm); - var args = undefined; - if (block) { - args = this.args.evaluate(vm); - } - // FIXME: can we avoid doing this when we don't have a block? - vm.pushCallerScope(); - if (block) { - vm.invokeBlock(block, args); - } - }; + _emberViews.jQuery(document).on('ajaxSend', _emberTestingTestPending_requests.incrementPendingRequests); + _emberViews.jQuery(document).on('ajaxComplete', _emberTestingTestPending_requests.decrementPendingRequests); + } +}); +enifed('ember-testing/support', ['exports', 'ember-metal', 'ember-views', 'ember-environment'], function (exports, _emberMetal, _emberViews, _emberEnvironment) { + 'use strict'; - OpenBlockOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - details: { - "block": this.inner.toJSON(), - "positional": this.args.positional.toJSON(), - "named": this.args.named.toJSON() - } - }; - }; + /** + @module ember + @submodule ember-testing + */ - return OpenBlockOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + var $ = _emberViews.jQuery; - var CloseBlockOpcode = (function (_Opcode2) { - babelHelpers.inherits(CloseBlockOpcode, _Opcode2); + /** + This method creates a checkbox and triggers the click event to fire the + passed in handler. It is used to correct for a bug in older versions + of jQuery (e.g 1.8.3). + + @private + @method testCheckboxClick + */ + function testCheckboxClick(handler) { + var input = document.createElement('input'); + $(input).attr('type', 'checkbox').css({ position: 'absolute', left: '-1000px', top: '-1000px' }).appendTo('body').on('click', handler).trigger('click').remove(); + } - function CloseBlockOpcode() { - _Opcode2.apply(this, arguments); - this.type = "close-block"; + if (_emberEnvironment.environment.hasDOM && typeof $ === 'function') { + $(function () { + /* + Determine whether a checkbox checked using jQuery's "click" method will have + the correct value for its checked property. + If we determine that the current jQuery version exhibits this behavior, + patch it to work correctly as in the commit for the actual fix: + https://github.com/jquery/jquery/commit/1fb2f92. + */ + testCheckboxClick(function () { + if (!this.checked && !$.event.special.click) { + $.event.special.click = { + // For checkbox, fire native event so checked state will be right + trigger: function () { + if ($.nodeName(this, 'input') && this.type === 'checkbox' && this.click) { + this.click(); + return false; + } + } + }; } + }); - CloseBlockOpcode.prototype.evaluate = function evaluate(vm) { - vm.popScope(); - }; + // Try again to verify that the patch took effect or blow up. + testCheckboxClick(function () { + _emberMetal.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-testing/test/helpers', 'ember-testing/test/on_inject_helpers', 'ember-testing/test/promise', 'ember-testing/test/waiters', 'ember-testing/test/adapter'], function (exports, _emberTestingTestHelpers, _emberTestingTestOn_inject_helpers, _emberTestingTestPromise, _emberTestingTestWaiters, _emberTestingTestAdapter) { + /** + @module ember + @submodule ember-testing + */ + 'use strict'; - return CloseBlockOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + This is a container for an assortment of testing related functionality: + + * Choose your default test adapter (for your framework of choice). + * Register/Unregister additional test helpers. + * Setup callbacks to be fired when the test helpers are injected into + your application. + + @class Test + @namespace Ember + @public + */ + var Test = { + /** + Hash containing all known test helpers. + @property _helpers + @private + @since 1.7.0 + */ + _helpers: _emberTestingTestHelpers.helpers, - exports.CloseBlockOpcode = CloseBlockOpcode; + registerHelper: _emberTestingTestHelpers.registerHelper, + registerAsyncHelper: _emberTestingTestHelpers.registerAsyncHelper, + unregisterHelper: _emberTestingTestHelpers.unregisterHelper, + onInjectHelpers: _emberTestingTestOn_inject_helpers.onInjectHelpers, + Promise: _emberTestingTestPromise.default, + promise: _emberTestingTestPromise.promise, + resolve: _emberTestingTestPromise.resolve, + registerWaiter: _emberTestingTestWaiters.registerWaiter, + unregisterWaiter: _emberTestingTestWaiters.unregisterWaiter, + checkWaiters: _emberTestingTestWaiters.checkWaiters + }; - var Value = (function (_ExpressionSyntax) { - babelHelpers.inherits(Value, _ExpressionSyntax); + /** + Used to allow ember-testing to communicate with a specific testing + framework. + + You can manually set it before calling `App.setupForTesting()`. + + Example: + + ```javascript + Ember.Test.adapter = MyCustomAdapter.create() + ``` + + If you do not set it, ember-testing will default to `Ember.Test.QUnitAdapter`. + + @public + @for Ember.Test + @property adapter + @type {Class} The adapter to be used. + @default Ember.Test.QUnitAdapter + */ + Object.defineProperty(Test, 'adapter', { + get: _emberTestingTestAdapter.getAdapter, + set: _emberTestingTestAdapter.setAdapter + }); - function Value(value) { - _ExpressionSyntax.call(this); - this.value = value; - this.type = "value"; - } + Object.defineProperty(Test, 'waiters', { + get: _emberTestingTestWaiters.generateDeprecatedWaitersArray + }); - Value.fromSpec = function fromSpec(value) { - return new Value(value); - }; + exports.default = Test; +}); +enifed('ember-testing/test/adapter', ['exports', 'ember-console', 'ember-metal'], function (exports, _emberConsole, _emberMetal) { + 'use strict'; - Value.build = function build(value) { - return new this(value); - }; + exports.getAdapter = getAdapter; + exports.setAdapter = setAdapter; + exports.asyncStart = asyncStart; + exports.asyncEnd = asyncEnd; - Value.prototype.inner = function inner() { - return this.value; - }; + var adapter = undefined; - Value.prototype.compile = function compile(compiler) { - return new _glimmerRuntimeLibCompiledExpressionsValue.default(this.value); - }; + function getAdapter() { + return adapter; + } - return Value; - })(_glimmerRuntimeLibSyntax.Expression); + function setAdapter(value) { + adapter = value; + if (value) { + _emberMetal.setDispatchOverride(adapterDispatch); + } else { + _emberMetal.setDispatchOverride(null); + } + } - exports.Value = Value; + function asyncStart() { + if (adapter) { + adapter.asyncStart(); + } + } - var GetArgument = (function (_ExpressionSyntax2) { - babelHelpers.inherits(GetArgument, _ExpressionSyntax2); + function asyncEnd() { + if (adapter) { + adapter.asyncEnd(); + } + } - function GetArgument(parts) { - _ExpressionSyntax2.call(this); - this.parts = parts; - this.type = "get-argument"; - } + function adapterDispatch(error) { + adapter.exception(error); + _emberConsole.default.error(error.stack); + } +}); +enifed('ember-testing/test/helpers', ['exports', 'ember-testing/test/promise'], function (exports, _emberTestingTestPromise) { + 'use strict'; - // this is separated out from Get because Unknown also has a ref, but it - // may turn out to be a helper + exports.registerHelper = registerHelper; + exports.registerAsyncHelper = registerAsyncHelper; + exports.unregisterHelper = unregisterHelper; + var helpers = {}; - GetArgument.fromSpec = function fromSpec(sexp) { - var parts = sexp[1]; + exports.helpers = helpers; + /** + `registerHelper` is used to register a test helper that will be injected + when `App.injectTestHelpers` is called. + + The helper method will always be called with the current Application as + the first parameter. + + For example: + + ```javascript + Ember.Test.registerHelper('boot', function(app) { + Ember.run(app, app.advanceReadiness); + }); + ``` + + This helper can later be called without arguments because it will be + called with `app` as the first parameter. + + ```javascript + App = Ember.Application.create(); + App.injectTestHelpers(); + boot(); + ``` + + @public + @for Ember.Test + @method registerHelper + @param {String} name The name of the helper method to add. + @param {Function} helperMethod + @param options {Object} + */ - return new GetArgument(parts); - }; + function registerHelper(name, helperMethod) { + helpers[name] = { + method: helperMethod, + meta: { wait: false } + }; + } - GetArgument.build = function build(path) { - return new this(path.split('.')); - }; + /** + `registerAsyncHelper` is used to register an async test helper that will be injected + when `App.injectTestHelpers` is called. + + The helper method will always be called with the current Application as + the first parameter. + + For example: + + ```javascript + Ember.Test.registerAsyncHelper('boot', function(app) { + Ember.run(app, app.advanceReadiness); + }); + ``` + + The advantage of an async helper is that it will not run + until the last async helper has completed. All async helpers + after it will wait for it complete before running. + + + For example: + + ```javascript + Ember.Test.registerAsyncHelper('deletePost', function(app, postId) { + click('.delete-' + postId); + }); + + // ... in your test + visit('/post/2'); + deletePost(2); + visit('/post/3'); + deletePost(3); + ``` + + @public + @for Ember.Test + @method registerAsyncHelper + @param {String} name The name of the helper method to add. + @param {Function} helperMethod + @since 1.2.0 + */ - GetArgument.prototype.compile = function compile(lookup) { - var parts = this.parts; - - var head = parts[0]; - if (lookup.hasNamedSymbol(head)) { - var symbol = lookup.getNamedSymbol(head); - var path = parts.slice(1); - var inner = new _glimmerRuntimeLibCompiledExpressionsLookups.CompiledSymbol(symbol, head); - return _glimmerRuntimeLibCompiledExpressionsLookups.default.create(inner, path); - } else if (lookup.hasPartialArgsSymbol()) { - var symbol = lookup.getPartialArgsSymbol(); - var path = parts.slice(1); - var inner = new _glimmerRuntimeLibCompiledExpressionsLookups.CompiledInPartialName(symbol, head); - return _glimmerRuntimeLibCompiledExpressionsLookups.default.create(inner, path); - } else { - throw new Error('[BUG] @' + this.parts.join('.') + ' is not a valid lookup path.'); - } - }; + function registerAsyncHelper(name, helperMethod) { + helpers[name] = { + method: helperMethod, + meta: { wait: true } + }; + } - return GetArgument; - })(_glimmerRuntimeLibSyntax.Expression); + /** + Remove a previously added helper method. + + Example: + + ```javascript + Ember.Test.unregisterHelper('wait'); + ``` + + @public + @method unregisterHelper + @param {String} name The helper to remove. + */ - exports.GetArgument = GetArgument; + function unregisterHelper(name) { + delete helpers[name]; + delete _emberTestingTestPromise.default.prototype[name]; + } +}); +enifed("ember-testing/test/on_inject_helpers", ["exports"], function (exports) { + "use strict"; - var Ref = (function (_ExpressionSyntax3) { - babelHelpers.inherits(Ref, _ExpressionSyntax3); + exports.onInjectHelpers = onInjectHelpers; + exports.invokeInjectHelpersCallbacks = invokeInjectHelpersCallbacks; + var callbacks = []; - function Ref(parts) { - _ExpressionSyntax3.call(this); - this.parts = parts; - this.type = "ref"; - } + exports.callbacks = callbacks; + /** + Used to register callbacks to be fired whenever `App.injectTestHelpers` + is called. + + The callback will receive the current application as an argument. + + Example: + + ```javascript + Ember.Test.onInjectHelpers(function() { + Ember.$(document).ajaxSend(function() { + Test.pendingRequests++; + }); + + Ember.$(document).ajaxComplete(function() { + Test.pendingRequests--; + }); + }); + ``` + + @public + @for Ember.Test + @method onInjectHelpers + @param {Function} callback The function to be called. + */ - Ref.build = function build(path) { - var parts = path.split('.'); - if (parts[0] === 'this') { - parts[0] = null; - } - return new this(parts); - }; + function onInjectHelpers(callback) { + callbacks.push(callback); + } - Ref.prototype.compile = function compile(lookup) { - var parts = this.parts; - - var head = parts[0]; - if (head === null) { - var inner = new _glimmerRuntimeLibCompiledExpressionsLookups.CompiledSelf(); - var path = parts.slice(1); - return _glimmerRuntimeLibCompiledExpressionsLookups.default.create(inner, path); - } else if (lookup.hasLocalSymbol(head)) { - var symbol = lookup.getLocalSymbol(head); - var path = parts.slice(1); - var inner = new _glimmerRuntimeLibCompiledExpressionsLookups.CompiledSymbol(symbol, head); - return _glimmerRuntimeLibCompiledExpressionsLookups.default.create(inner, path); - } else { - var inner = new _glimmerRuntimeLibCompiledExpressionsLookups.CompiledSelf(); - return _glimmerRuntimeLibCompiledExpressionsLookups.default.create(inner, parts); - } - }; + function invokeInjectHelpersCallbacks(app) { + for (var i = 0; i < callbacks.length; i++) { + callbacks[i](app); + } + } +}); +enifed("ember-testing/test/pending_requests", ["exports"], function (exports) { + "use strict"; - return Ref; - })(_glimmerRuntimeLibSyntax.Expression); + exports.pendingRequests = pendingRequests; + exports.clearPendingRequests = clearPendingRequests; + exports.incrementPendingRequests = incrementPendingRequests; + exports.decrementPendingRequests = decrementPendingRequests; + var requests = []; - exports.Ref = Ref; + function pendingRequests() { + return requests.length; + } - var Get = (function (_ExpressionSyntax4) { - babelHelpers.inherits(Get, _ExpressionSyntax4); + function clearPendingRequests() { + requests.length = 0; + } - function Get(ref) { - _ExpressionSyntax4.call(this); - this.ref = ref; - this.type = "get"; - } + function incrementPendingRequests(_, xhr) { + requests.push(xhr); + } - Get.fromSpec = function fromSpec(sexp) { - var parts = sexp[1]; + function decrementPendingRequests(_, xhr) { + for (var i = 0; i < requests.length; i++) { + if (xhr === requests[i]) { + requests.splice(i, 1); + break; + } + } + } +}); +enifed('ember-testing/test/promise', ['exports', 'ember-runtime', 'ember-testing/test/run'], function (exports, _emberRuntime, _emberTestingTestRun) { + 'use strict'; - return new this(new Ref(parts)); - }; + exports.promise = promise; + exports.resolve = resolve; + exports.getLastPromise = getLastPromise; - Get.build = function build(path) { - return new this(Ref.build(path)); - }; + var lastPromise = undefined; - Get.prototype.compile = function compile(compiler) { - return this.ref.compile(compiler); - }; + var TestPromise = (function (_RSVP$Promise) { + babelHelpers.inherits(TestPromise, _RSVP$Promise); - return Get; - })(_glimmerRuntimeLibSyntax.Expression); + function TestPromise() { + babelHelpers.classCallCheck(this, TestPromise); - exports.Get = Get; + _RSVP$Promise.apply(this, arguments); + lastPromise = this; + } - var Unknown = (function (_ExpressionSyntax5) { - babelHelpers.inherits(Unknown, _ExpressionSyntax5); + /** + This returns a thenable tailored for testing. It catches failed + `onSuccess` callbacks and invokes the `Ember.Test.adapter.exception` + callback in the last chained then. + + This method should be returned by async helpers such as `wait`. + + @public + @for Ember.Test + @method promise + @param {Function} resolver The function used to resolve the promise. + @param {String} label An optional string for identifying the promise. + */ - function Unknown(ref) { - _ExpressionSyntax5.call(this); - this.ref = ref; - this.type = "unknown"; - } + TestPromise.prototype.then = function then(onFulfillment) { + var _RSVP$Promise$prototype$then; - Unknown.fromSpec = function fromSpec(sexp) { - var path = sexp[1]; + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } - return new this(new Ref(path)); - }; + return (_RSVP$Promise$prototype$then = _RSVP$Promise.prototype.then).call.apply(_RSVP$Promise$prototype$then, [this, function (result) { + return isolate(onFulfillment, result); + }].concat(args)); + }; - Unknown.build = function build(path) { - return new this(Ref.build(path)); - }; + return TestPromise; + })(_emberRuntime.RSVP.Promise); - Unknown.prototype.compile = function compile(compiler, env, symbolTable) { - var ref = this.ref; + exports.default = TestPromise; - if (env.hasHelper(ref.parts, symbolTable)) { - return new _glimmerRuntimeLibCompiledExpressionsHelper.default(ref.parts, env.lookupHelper(ref.parts, symbolTable), _glimmerRuntimeLibCompiledExpressionsArgs.CompiledArgs.empty(), symbolTable); - } else { - return this.ref.compile(compiler); - } - }; + function promise(resolver, label) { + var fullLabel = 'Ember.Test.promise: ' + (label || ''); + return new TestPromise(resolver, fullLabel); + } - return Unknown; - })(_glimmerRuntimeLibSyntax.Expression); + /** + Replacement for `Ember.RSVP.resolve` + The only difference is this uses + an instance of `Ember.Test.Promise` + + @public + @for Ember.Test + @method resolve + @param {Mixed} The value to resolve + @since 1.2.0 + */ - exports.Unknown = Unknown; + function resolve(result, label) { + return TestPromise.resolve(result, label); + } - var Helper = (function (_ExpressionSyntax6) { - babelHelpers.inherits(Helper, _ExpressionSyntax6); + function getLastPromise() { + return lastPromise; + } - function Helper(ref, args) { - _ExpressionSyntax6.call(this); - this.ref = ref; - this.args = args; - this.type = "helper"; - } + // This method isolates nested async methods + // so that they don't conflict with other last promises. + // + // 1. Set `Ember.Test.lastPromise` to null + // 2. Invoke method + // 3. Return the last promise created during method + function isolate(onFulfillment, result) { + // Reset lastPromise for nested helpers + lastPromise = null; - Helper.fromSpec = function fromSpec(sexp) { - var path = sexp[1]; - var params = sexp[2]; - var hash = sexp[3]; + var value = onFulfillment(result); - return new Helper(new Ref(path), Args.fromSpec(params, hash, EMPTY_BLOCKS)); - }; + var promise = lastPromise; + lastPromise = null; - Helper.build = function build(path, positional, named) { - return new this(Ref.build(path), Args.build(positional, named, EMPTY_BLOCKS)); - }; + // If the method returned a promise + // return that promise. If not, + // return the last async helper's promise + if (value && value instanceof TestPromise || !promise) { + return value; + } else { + return _emberTestingTestRun.default(function () { + return resolve(promise).then(function () { + return value; + }); + }); + } + } +}); +enifed('ember-testing/test/run', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - Helper.prototype.compile = function compile(compiler, env, symbolTable) { - if (env.hasHelper(this.ref.parts, symbolTable)) { - var args = this.args; - var ref = this.ref; + exports.default = run; - return new _glimmerRuntimeLibCompiledExpressionsHelper.default(ref.parts, env.lookupHelper(ref.parts, symbolTable), args.compile(compiler, env, symbolTable), symbolTable); - } else { - throw new Error('Compile Error: ' + this.ref.parts.join('.') + ' is not a helper'); - } - }; + function run(fn) { + if (!_emberMetal.run.currentRunLoop) { + return _emberMetal.run(fn); + } else { + return fn(); + } + } +}); +enifed('ember-testing/test/waiters', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - return Helper; - })(_glimmerRuntimeLibSyntax.Expression); + exports.registerWaiter = registerWaiter; + exports.unregisterWaiter = unregisterWaiter; + exports.checkWaiters = checkWaiters; + exports.generateDeprecatedWaitersArray = generateDeprecatedWaitersArray; - exports.Helper = Helper; + var contexts = []; + var callbacks = []; - var HasBlock = (function (_ExpressionSyntax7) { - babelHelpers.inherits(HasBlock, _ExpressionSyntax7); + /** + This allows ember-testing to play nicely with other asynchronous + events, such as an application that is waiting for a CSS3 + transition or an IndexDB transaction. The waiter runs periodically + after each async helper (i.e. `click`, `andThen`, `visit`, etc) has executed, + until the returning result is truthy. After the waiters finish, the next async helper + is executed and the process repeats. + + For example: + + ```javascript + Ember.Test.registerWaiter(function() { + return myPendingTransactions() == 0; + }); + ``` + The `context` argument allows you to optionally specify the `this` + with which your callback will be invoked. + + For example: + + ```javascript + Ember.Test.registerWaiter(MyDB, MyDB.hasPendingTransactions); + ``` + + @public + @for Ember.Test + @method registerWaiter + @param {Object} context (optional) + @param {Function} callback + @since 1.2.0 + */ - function HasBlock(blockName) { - _ExpressionSyntax7.call(this); - this.blockName = blockName; - this.type = "has-block"; - } + function registerWaiter(context, callback) { + if (arguments.length === 1) { + callback = context; + context = null; + } + if (indexOf(context, callback) > -1) { + return; + } + contexts.push(context); + callbacks.push(callback); + } - HasBlock.fromSpec = function fromSpec(sexp) { - var blockName = sexp[1]; + /** + `unregisterWaiter` is used to unregister a callback that was + registered with `registerWaiter`. + + @public + @for Ember.Test + @method unregisterWaiter + @param {Object} context (optional) + @param {Function} callback + @since 1.2.0 + */ - return new HasBlock(blockName); - }; + function unregisterWaiter(context, callback) { + if (!callbacks.length) { + return; + } + if (arguments.length === 1) { + callback = context; + context = null; + } + var i = indexOf(context, callback); + if (i === -1) { + return; + } + contexts.splice(i, 1); + callbacks.splice(i, 1); + } - HasBlock.build = function build(blockName) { - return new this(blockName); - }; + /** + Iterates through each registered test waiter, and invokes + its callback. If any waiter returns false, this method will return + true indicating that the waiters have not settled yet. + + This is generally used internally from the acceptance/integration test + infrastructure. + + @public + @for Ember.Test + @static + @method checkWaiters + */ - HasBlock.prototype.compile = function compile(compiler, env) { - var blockName = this.blockName; - - if (compiler.hasBlockSymbol(blockName)) { - var symbol = compiler.getBlockSymbol(blockName); - var inner = new _glimmerRuntimeLibCompiledExpressionsHasBlock.CompiledGetBlockBySymbol(symbol, blockName); - return new _glimmerRuntimeLibCompiledExpressionsHasBlock.default(inner); - } else if (compiler.hasPartialArgsSymbol()) { - var symbol = compiler.getPartialArgsSymbol(); - var inner = new _glimmerRuntimeLibCompiledExpressionsHasBlock.CompiledInPartialGetBlock(symbol, blockName); - return new _glimmerRuntimeLibCompiledExpressionsHasBlock.default(inner); - } else { - throw new Error('[BUG] ${blockName} is not a valid block name.'); - } - }; + function checkWaiters() { + if (!callbacks.length) { + return false; + } + for (var i = 0; i < callbacks.length; i++) { + var context = contexts[i]; + var callback = callbacks[i]; + if (!callback.call(context)) { + return true; + } + } + return false; + } - return HasBlock; - })(_glimmerRuntimeLibSyntax.Expression); + function indexOf(context, callback) { + for (var i = 0; i < callbacks.length; i++) { + if (callbacks[i] === callback && contexts[i] === context) { + return i; + } + } + return -1; + } - exports.HasBlock = HasBlock; + function generateDeprecatedWaitersArray() { + _emberMetal.deprecate('Usage of `Ember.Test.waiters` is deprecated. Please refactor to `Ember.Test.checkWaiters`.', false, { until: '2.8.0', id: 'ember-testing.test-waiters' }); - var HasBlockParams = (function (_ExpressionSyntax8) { - babelHelpers.inherits(HasBlockParams, _ExpressionSyntax8); + var array = new Array(callbacks.length); + for (var i = 0; i < callbacks.length; i++) { + var context = contexts[i]; + var callback = callbacks[i]; - function HasBlockParams(blockName) { - _ExpressionSyntax8.call(this); - this.blockName = blockName; - this.type = "has-block-params"; - } + array[i] = [context, callback]; + } - HasBlockParams.fromSpec = function fromSpec(sexp) { - var blockName = sexp[1]; + return array; + } +}); +enifed("ember-utils/apply-str", ["exports"], function (exports) { + /** + @param {Object} t target + @param {String} m method + @param {Array} a args + @private + */ + "use strict"; - return new HasBlockParams(blockName); - }; + exports.default = applyStr; - HasBlockParams.build = function build(blockName) { - return new this(blockName); - }; + function applyStr(t, m, a) { + var l = a && a.length; + if (!a || !l) { + return t[m](); + } + switch (l) { + case 1: + return t[m](a[0]); + case 2: + return t[m](a[0], a[1]); + case 3: + return t[m](a[0], a[1], a[2]); + case 4: + return t[m](a[0], a[1], a[2], a[3]); + case 5: + return t[m](a[0], a[1], a[2], a[3], a[4]); + default: + return t[m].apply(t, a); + } + } +}); +enifed("ember-utils/assign", ["exports"], function (exports) { + /** + Copy properties from a source object to a target object. + + ```javascript + var a = { first: 'Yehuda' }; + var b = { last: 'Katz' }; + var c = { company: 'Tilde Inc.' }; + Ember.assign(a, b, c); // a === { first: 'Yehuda', last: 'Katz', company: 'Tilde Inc.' }, b === { last: 'Katz' }, c === { company: 'Tilde Inc.' } + ``` + + @method assign + @for Ember + @param {Object} original The object to assign into + @param {Object} ...args The objects to copy properties from + @return {Object} + @public + */ + "use strict"; - HasBlockParams.prototype.compile = function compile(compiler, env) { - var blockName = this.blockName; - - if (compiler.hasBlockSymbol(blockName)) { - var symbol = compiler.getBlockSymbol(blockName); - var inner = new _glimmerRuntimeLibCompiledExpressionsHasBlock.CompiledGetBlockBySymbol(symbol, blockName); - return new _glimmerRuntimeLibCompiledExpressionsHasBlock.CompiledHasBlockParams(inner); - } else if (compiler.hasPartialArgsSymbol()) { - var symbol = compiler.getPartialArgsSymbol(); - var inner = new _glimmerRuntimeLibCompiledExpressionsHasBlock.CompiledInPartialGetBlock(symbol, blockName); - return new _glimmerRuntimeLibCompiledExpressionsHasBlock.CompiledHasBlockParams(inner); - } else { - throw new Error('[BUG] ${blockName} is not a valid block name.'); - } - }; + exports.default = assign; - return HasBlockParams; - })(_glimmerRuntimeLibSyntax.Expression); + function assign(original) { + for (var i = 1; i < arguments.length; i++) { + var arg = arguments[i]; + if (!arg) { + continue; + } - exports.HasBlockParams = HasBlockParams; + var updates = Object.keys(arg); - var Concat = (function () { - function Concat(parts) { - this.parts = parts; - this.type = "concat"; - } + for (var _i = 0; _i < updates.length; _i++) { + var prop = updates[_i]; + original[prop] = arg[prop]; + } + } - Concat.fromSpec = function fromSpec(sexp) { - var params = sexp[1]; + return original; + } +}); +enifed('ember-utils/dictionary', ['exports', 'ember-utils/empty-object'], function (exports, _emberUtilsEmptyObject) { + 'use strict'; - return new Concat(params.map(_glimmerRuntimeLibSyntaxExpressions.default)); - }; + exports.default = makeDictionary; - Concat.build = function build(parts) { - return new this(parts); - }; + // 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. - Concat.prototype.compile = function compile(compiler, env, symbolTable) { - return new _glimmerRuntimeLibCompiledExpressionsConcat.default(this.parts.map(function (p) { - return p.compile(compiler, env, symbolTable); - })); - }; + function makeDictionary(parent) { + var dict = undefined; + if (parent === null) { + dict = new _emberUtilsEmptyObject.default(); + } else { + dict = Object.create(parent); + } + dict['_dict'] = null; + delete dict['_dict']; + return dict; + } +}); +enifed("ember-utils/empty-object", ["exports"], function (exports) { + // This exists because `Object.create(null)` is absurdly slow compared + // to `new EmptyObject()`. In either case, you want a null prototype + // when you're treating the object instances as arbitrary dictionaries + // and don't want your keys colliding with build-in methods on the + // default object prototype. - return Concat; - })(); + "use strict"; - exports.Concat = Concat; + var proto = Object.create(null, { + // without this, we will always still end up with (new + // EmptyObject()).constructor === Object + constructor: { + value: undefined, + enumerable: false, + writable: true + } + }); - var Blocks = (function () { - function Blocks(_default) { - var inverse = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + function EmptyObject() {} + EmptyObject.prototype = proto; + exports.default = EmptyObject; +}); +enifed('ember-utils/guid', ['exports', 'ember-utils/intern'], function (exports, _emberUtilsIntern) { + 'use strict'; - this.type = "blocks"; - this.default = _default; - this.inverse = inverse; - } + exports.uuid = uuid; + exports.generateGuid = generateGuid; + exports.guidFor = guidFor; - Blocks.fromSpec = function fromSpec(_default) { - var inverse = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + /** + Previously we used `Ember.$.uuid`, however `$.uuid` has been removed from + jQuery master. We'll just bootstrap our own uuid now. + + @private + @return {Number} the uuid + */ + var _uuid = 0; - return new Blocks(_default, inverse); - }; + /** + Generates a universally unique identifier. This method + is used internally by Ember for assisting with + the generation of GUID's and other unique identifiers. + + @public + @return {Number} [description] + */ - Blocks.empty = function empty() { - return EMPTY_BLOCKS; - }; + function uuid() { + return ++_uuid; + } - return Blocks; - })(); + /** + Prefix used for guids through out Ember. + @private + @property GUID_PREFIX + @for Ember + @type String + @final + */ + var GUID_PREFIX = 'ember'; - exports.Blocks = Blocks; - var EMPTY_BLOCKS = new ((function (_Blocks) { - babelHelpers.inherits(_class, _Blocks); + // Used for guid generation... + var numberCache = []; + var stringCache = {}; - function _class() { - _Blocks.call(this, null, null); - } + /** + A unique key used to assign guids and other private metadata to objects. + If you inspect an object in your browser debugger you will often see these. + They can be safely ignored. + + On browsers that support it, these properties are added with enumeration + disabled so they won't show up when you iterate over your properties. + + @private + @property GUID_KEY + @for Ember + @type String + @final + */ + var GUID_KEY = _emberUtilsIntern.default('__ember' + +new Date()); - return _class; - })(Blocks))(); - exports.EMPTY_BLOCKS = EMPTY_BLOCKS; + exports.GUID_KEY = GUID_KEY; + var GUID_DESC = { + writable: true, + configurable: true, + enumerable: false, + value: null + }; - var Args = (function () { - function Args(positional, named, blocks) { - this.positional = positional; - this.named = named; - this.blocks = blocks; - this.type = "args"; - } + exports.GUID_DESC = GUID_DESC; + var nullDescriptor = { + configurable: true, + writable: true, + enumerable: false, + value: null + }; - Args.empty = function empty() { - return EMPTY_ARGS; - }; + var GUID_KEY_PROPERTY = { + name: GUID_KEY, + descriptor: nullDescriptor + }; - Args.fromSpec = function fromSpec(positional, named, blocks) { - return new Args(PositionalArgs.fromSpec(positional), NamedArgs.fromSpec(named), blocks); - }; + exports.GUID_KEY_PROPERTY = GUID_KEY_PROPERTY; + /** + Generates a new guid, optionally saving the guid to the object that you + pass in. You will rarely need to use this method. Instead you should + call `Ember.guidFor(obj)`, which return an existing guid if available. + + @private + @method generateGuid + @for Ember + @param {Object} [obj] Object the guid will be used for. If passed in, the guid will + be saved on the object and reused whenever you pass the same object + again. + + If no object is passed, just generate a new guid. + @param {String} [prefix] Prefix to place in front of the guid. Useful when you want to + separate the guid into separate namespaces. + @return {String} the guid + */ - Args.fromPositionalArgs = function fromPositionalArgs(positional) { - var blocks = arguments.length <= 1 || arguments[1] === undefined ? EMPTY_BLOCKS : arguments[1]; + function generateGuid(obj, prefix) { + if (!prefix) { + prefix = GUID_PREFIX; + } - return new Args(positional, EMPTY_NAMED_ARGS, blocks); - }; + var ret = prefix + uuid(); + if (obj) { + if (obj[GUID_KEY] === null) { + obj[GUID_KEY] = ret; + } else { + GUID_DESC.value = ret; + if (obj.__defineNonEnumerable) { + obj.__defineNonEnumerable(GUID_KEY_PROPERTY); + } else { + Object.defineProperty(obj, GUID_KEY, GUID_DESC); + } + } + } + return ret; + } - Args.fromNamedArgs = function fromNamedArgs(named) { - var blocks = arguments.length <= 1 || arguments[1] === undefined ? EMPTY_BLOCKS : arguments[1]; + /** + Returns a unique id for the object. If the object does not yet have a guid, + one will be assigned to it. You can call this on any object, + `Ember.Object`-based or not, but be aware that it will add a `_guid` + property. + + You can also use this method on DOM Element objects. + + @public + @method guidFor + @for Ember + @param {Object} obj any object, string, number, Element, or primitive + @return {String} the unique guid for this instance. + */ - return new Args(EMPTY_POSITIONAL_ARGS, named, blocks); - }; + function guidFor(obj) { + var type = typeof obj; + var isObject = type === 'object' && obj !== null; + var isFunction = type === 'function'; - Args.build = function build(positional, named, blocks) { - if (positional === EMPTY_POSITIONAL_ARGS && named === EMPTY_NAMED_ARGS && blocks === EMPTY_BLOCKS) { - return EMPTY_ARGS; - } else { - return new this(positional, named, blocks); - } - }; + if ((isObject || isFunction) && obj[GUID_KEY]) { + return obj[GUID_KEY]; + } - Args.prototype.compile = function compile(compiler, env, symbolTable) { - var positional = this.positional; - var named = this.named; - var blocks = this.blocks; + // special cases where we don't want to add a key to object + if (obj === undefined) { + return '(undefined)'; + } - return _glimmerRuntimeLibCompiledExpressionsArgs.CompiledArgs.create(positional.compile(compiler, env, symbolTable), named.compile(compiler, env, symbolTable), blocks); - }; + if (obj === null) { + return '(null)'; + } - return Args; - })(); + var ret = undefined; - exports.Args = Args; + // Don't allow prototype changes to String etc. to change the guidFor + switch (type) { + case 'number': + ret = numberCache[obj]; - var PositionalArgs = (function () { - function PositionalArgs(values) { - this.values = values; - this.type = "positional"; - this.length = values.length; + if (!ret) { + ret = numberCache[obj] = 'nu' + obj; } - PositionalArgs.empty = function empty() { - return EMPTY_POSITIONAL_ARGS; - }; + return ret; - PositionalArgs.fromSpec = function fromSpec(sexp) { - if (!sexp || sexp.length === 0) return EMPTY_POSITIONAL_ARGS; - return new PositionalArgs(sexp.map(_glimmerRuntimeLibSyntaxExpressions.default)); - }; + case 'string': + ret = stringCache[obj]; - PositionalArgs.build = function build(exprs) { - if (exprs.length === 0) { - return EMPTY_POSITIONAL_ARGS; - } else { - return new this(exprs); - } - }; + if (!ret) { + ret = stringCache[obj] = 'st' + uuid(); + } - PositionalArgs.prototype.slice = function slice(start, end) { - return PositionalArgs.build(this.values.slice(start, end)); - }; + return ret; - PositionalArgs.prototype.at = function at(index) { - return this.values[index]; - }; + case 'boolean': + return obj ? '(true)' : '(false)'; - PositionalArgs.prototype.compile = function compile(compiler, env, symbolTable) { - return _glimmerRuntimeLibCompiledExpressionsArgs.CompiledPositionalArgs.create(this.values.map(function (v) { - return v.compile(compiler, env, symbolTable); - })); - }; + default: + if (obj === Object) { + return '(Object)'; + } - return PositionalArgs; - })(); + if (obj === Array) { + return '(Array)'; + } - exports.PositionalArgs = PositionalArgs; + ret = GUID_PREFIX + uuid(); - var EMPTY_POSITIONAL_ARGS = new ((function (_PositionalArgs) { - babelHelpers.inherits(_class2, _PositionalArgs); + if (obj[GUID_KEY] === null) { + obj[GUID_KEY] = ret; + } else { + GUID_DESC.value = ret; - function _class2() { - _PositionalArgs.call(this, _glimmerRuntimeLibUtils.EMPTY_ARRAY); + if (obj.__defineNonEnumerable) { + obj.__defineNonEnumerable(GUID_KEY_PROPERTY); + } else { + Object.defineProperty(obj, GUID_KEY, GUID_DESC); + } } + return ret; + } + } +}); +enifed('ember-utils/index', ['exports', 'ember-utils/symbol', 'ember-utils/owner', 'ember-utils/assign', 'ember-utils/empty-object', 'ember-utils/dictionary', 'ember-utils/guid', 'ember-utils/intern', 'ember-utils/super', 'ember-utils/inspect', 'ember-utils/lookup-descriptor', 'ember-utils/invoke', 'ember-utils/make-array', 'ember-utils/apply-str', 'ember-utils/name', 'ember-utils/to-string', 'ember-utils/weak-map-utils', 'ember-utils/proxy-utils'], function (exports, _emberUtilsSymbol, _emberUtilsOwner, _emberUtilsAssign, _emberUtilsEmptyObject, _emberUtilsDictionary, _emberUtilsGuid, _emberUtilsIntern, _emberUtilsSuper, _emberUtilsInspect, _emberUtilsLookupDescriptor, _emberUtilsInvoke, _emberUtilsMakeArray, _emberUtilsApplyStr, _emberUtilsName, _emberUtilsToString, _emberUtilsWeakMapUtils, _emberUtilsProxyUtils) { + /* + This package will be eagerly parsed and should have no dependencies on external + packages. + + It is intended to be used to share utility methods that will be needed + by every Ember application (and is **not** a dumping ground of useful utilities). + + Utility methods that are needed in < 80% of cases should be placed + elsewhere (so they can be lazily evaluated / parsed). + */ + 'use strict'; - _class2.prototype.slice = function slice(start, end) { - return this; - }; + exports.symbol = _emberUtilsSymbol.default; + exports.getOwner = _emberUtilsOwner.getOwner; + exports.setOwner = _emberUtilsOwner.setOwner; + exports.OWNER = _emberUtilsOwner.OWNER; + exports.assign = _emberUtilsAssign.default; + exports.EmptyObject = _emberUtilsEmptyObject.default; + exports.dictionary = _emberUtilsDictionary.default; + exports.uuid = _emberUtilsGuid.uuid; + exports.GUID_KEY = _emberUtilsGuid.GUID_KEY; + exports.GUID_DESC = _emberUtilsGuid.GUID_DESC; + exports.GUID_KEY_PROPERTY = _emberUtilsGuid.GUID_KEY_PROPERTY; + exports.generateGuid = _emberUtilsGuid.generateGuid; + exports.guidFor = _emberUtilsGuid.guidFor; + exports.intern = _emberUtilsIntern.default; + exports.checkHasSuper = _emberUtilsSuper.checkHasSuper; + exports.ROOT = _emberUtilsSuper.ROOT; + exports.wrap = _emberUtilsSuper.wrap; + exports.inspect = _emberUtilsInspect.default; + exports.lookupDescriptor = _emberUtilsLookupDescriptor.default; + exports.canInvoke = _emberUtilsInvoke.canInvoke; + exports.tryInvoke = _emberUtilsInvoke.tryInvoke; + exports.makeArray = _emberUtilsMakeArray.default; + exports.applyStr = _emberUtilsApplyStr.default; + exports.NAME_KEY = _emberUtilsName.default; + exports.toString = _emberUtilsToString.default; + exports.HAS_NATIVE_WEAKMAP = _emberUtilsWeakMapUtils.HAS_NATIVE_WEAKMAP; + exports.HAS_NATIVE_PROXY = _emberUtilsProxyUtils.HAS_NATIVE_PROXY; +}); +enifed('ember-utils/inspect', ['exports'], function (exports) { + 'use strict'; - _class2.prototype.at = function at(index) { - return undefined; // ??! - }; + exports.default = inspect; + var objectToString = Object.prototype.toString; - _class2.prototype.compile = function compile(compiler, env) { - return _glimmerRuntimeLibCompiledExpressionsArgs.CompiledPositionalArgs.empty(); - }; + /** + Convenience method to inspect an object. This method will attempt to + convert the object into a useful string description. + + It is a pretty simple implementation. If you want something more robust, + use something like JSDump: https://github.com/NV/jsDump + + @method inspect + @for Ember + @param {Object} obj The object you want to inspect. + @return {String} A description of the object + @since 1.4.0 + @private + */ - return _class2; - })(PositionalArgs))(); + function inspect(obj) { + if (obj === null) { + return 'null'; + } + if (obj === undefined) { + return 'undefined'; + } + if (Array.isArray(obj)) { + return '[' + obj + ']'; + } + // for non objects + var type = typeof obj; + if (type !== 'object' && type !== 'symbol') { + return '' + obj; + } + // overridden toString + if (typeof obj.toString === 'function' && obj.toString !== objectToString) { + return obj.toString(); + } - var NamedArgs = (function () { - function NamedArgs(keys, values) { - this.keys = keys; - this.values = values; - this.type = "named"; - this.length = keys.length; + // Object.prototype.toString === {}.toString + var v = undefined; + var ret = []; + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + v = obj[key]; + if (v === 'toString') { + continue; + } // ignore useless items + if (typeof v === 'function') { + v = 'function() { ... }'; } - NamedArgs.empty = function empty() { - return EMPTY_NAMED_ARGS; - }; + if (v && typeof v.toString !== 'function') { + ret.push(key + ': ' + objectToString.call(v)); + } else { + ret.push(key + ': ' + v); + } + } + } + return '{' + ret.join(', ') + '}'; + } +}); +enifed("ember-utils/intern", ["exports"], function (exports) { + /** + Strongly hint runtimes to intern the provided string. + + When do I need to use this function? + + For the most part, never. Pre-mature optimization is bad, and often the + runtime does exactly what you need it to, and more often the trade-off isn't + worth it. + + Why? + + Runtimes store strings in at least 2 different representations: + Ropes and Symbols (interned strings). The Rope provides a memory efficient + data-structure for strings created from concatenation or some other string + manipulation like splitting. + + Unfortunately checking equality of different ropes can be quite costly as + runtimes must resort to clever string comparison algorithms. These + algorithms typically cost in proportion to the length of the string. + Luckily, this is where the Symbols (interned strings) shine. As Symbols are + unique by their string content, equality checks can be done by pointer + comparison. + + How do I know if my string is a rope or symbol? + + Typically (warning general sweeping statement, but truthy in runtimes at + present) static strings created as part of the JS source are interned. + Strings often used for comparisons can be interned at runtime if some + criteria are met. One of these criteria can be the size of the entire rope. + For example, in chrome 38 a rope longer then 12 characters will not + intern, nor will segments of that rope. + + Some numbers: http://jsperf.com/eval-vs-keys/8 + + Known Trick™ + + @private + @return {String} interned version of the provided string + */ + "use strict"; - NamedArgs.fromSpec = function fromSpec(sexp) { - if (sexp === null || sexp === undefined) { - return EMPTY_NAMED_ARGS; - } - var keys = sexp[0]; - var exprs = sexp[1]; + exports.default = intern; - if (keys.length === 0) { - return EMPTY_NAMED_ARGS; - } - return new this(keys, exprs.map(function (expr) { - return _glimmerRuntimeLibSyntaxExpressions.default(expr); - })); - }; + function intern(str) { + var obj = {}; + obj[str] = 1; + for (var key in obj) { + if (key === str) { + return key; + } + } + return str; + } +}); +enifed('ember-utils/invoke', ['exports', 'ember-utils/apply-str'], function (exports, _emberUtilsApplyStr) { + 'use strict'; - NamedArgs.build = function build(keys, values) { - if (keys.length === 0) { - return EMPTY_NAMED_ARGS; - } else { - return new this(keys, values); - } - }; + exports.canInvoke = canInvoke; + exports.tryInvoke = tryInvoke; - NamedArgs.prototype.at = function at(key) { - var keys = this.keys; - var values = this.values; + /** + Checks to see if the `methodName` exists on the `obj`. + + ```javascript + let foo = { bar: function() { return 'bar'; }, baz: null }; + + Ember.canInvoke(foo, 'bar'); // true + Ember.canInvoke(foo, 'baz'); // false + Ember.canInvoke(foo, 'bat'); // false + ``` + + @method canInvoke + @for Ember + @param {Object} obj The object to check for the method + @param {String} methodName The method name to check for + @return {Boolean} + @private + */ - var index = keys.indexOf(key); - return values[index]; - }; + function canInvoke(obj, methodName) { + return !!(obj && typeof obj[methodName] === 'function'); + } - NamedArgs.prototype.has = function has(key) { - return this.keys.indexOf(key) !== -1; - }; + /** + Checks to see if the `methodName` exists on the `obj`, + and if it does, invokes it with the arguments passed. + + ```javascript + let d = new Date('03/15/2013'); + + Ember.tryInvoke(d, 'getTime'); // 1363320000000 + Ember.tryInvoke(d, 'setFullYear', [2014]); // 1394856000000 + Ember.tryInvoke(d, 'noSuchMethod', [2014]); // undefined + ``` + + @method tryInvoke + @for Ember + @param {Object} obj The object to check for the method + @param {String} methodName The method name to check for + @param {Array} [args] The arguments to pass to the method + @return {*} the return value of the invoked method or undefined if it cannot be invoked + @public + */ - NamedArgs.prototype.compile = function compile(compiler, env, symbolTable) { - var keys = this.keys; - var values = this.values; + function tryInvoke(obj, methodName, args) { + if (canInvoke(obj, methodName)) { + return args ? _emberUtilsApplyStr.default(obj, methodName, args) : _emberUtilsApplyStr.default(obj, methodName); + } + } +}); +enifed("ember-utils/lookup-descriptor", ["exports"], function (exports) { + "use strict"; - var compiledValues = new Array(values.length); - for (var i = 0; i < compiledValues.length; i++) { - compiledValues[i] = values[i].compile(compiler, env, symbolTable); - } - return new _glimmerRuntimeLibCompiledExpressionsArgs.CompiledNamedArgs(keys, compiledValues); - }; + exports.default = lookupDescriptor; - return NamedArgs; - })(); + function lookupDescriptor(obj, keyName) { + var current = obj; + while (current) { + var descriptor = Object.getOwnPropertyDescriptor(current, keyName); - exports.NamedArgs = NamedArgs; + if (descriptor) { + return descriptor; + } - var EMPTY_NAMED_ARGS = new ((function (_NamedArgs) { - babelHelpers.inherits(_class3, _NamedArgs); + current = Object.getPrototypeOf(current); + } - function _class3() { - _NamedArgs.call(this, _glimmerRuntimeLibUtils.EMPTY_ARRAY, _glimmerRuntimeLibUtils.EMPTY_ARRAY); - } + return null; + } +}); +enifed("ember-utils/make-array", ["exports"], function (exports) { + "use strict"; - _class3.prototype.at = function at(key) { - return undefined; // ??! - }; + exports.default = makeArray; + var isArray = Array.isArray; - _class3.prototype.has = function has(key) { - return false; - }; + /** + Forces the passed object to be part of an array. If the object is already + an array, it will return the object. Otherwise, it will add the object to + an array. If obj is `null` or `undefined`, it will return an empty array. + + ```javascript + Ember.makeArray(); // [] + Ember.makeArray(null); // [] + Ember.makeArray(undefined); // [] + Ember.makeArray('lindsay'); // ['lindsay'] + Ember.makeArray([1, 2, 42]); // [1, 2, 42] + + let controller = Ember.ArrayProxy.create({ content: [] }); + + Ember.makeArray(controller) === controller; // true + ``` + + @method makeArray + @for Ember + @param {Object} obj the object + @return {Array} + @private + */ - _class3.prototype.compile = function compile(compiler, env) { - return _glimmerRuntimeLibCompiledExpressionsArgs.CompiledNamedArgs.empty(); - }; + function makeArray(obj) { + if (obj === null || obj === undefined) { + return []; + } + return isArray(obj) ? obj : [obj]; + } +}); +enifed('ember-utils/name', ['exports', 'ember-utils/symbol'], function (exports, _emberUtilsSymbol) { + 'use strict'; - return _class3; - })(NamedArgs))(); - var EMPTY_ARGS = new ((function (_Args) { - babelHelpers.inherits(_class4, _Args); + exports.default = _emberUtilsSymbol.default('NAME_KEY'); +}); +enifed('ember-utils/owner', ['exports', 'ember-utils/symbol'], function (exports, _emberUtilsSymbol) { + /** + @module ember + @submodule ember-runtime + */ - function _class4() { - _Args.call(this, EMPTY_POSITIONAL_ARGS, EMPTY_NAMED_ARGS, EMPTY_BLOCKS); - } + 'use strict'; - _class4.prototype.compile = function compile(compiler, env) { - return _glimmerRuntimeLibCompiledExpressionsArgs.CompiledArgs.empty(); - }; + exports.getOwner = getOwner; + exports.setOwner = setOwner; + var OWNER = _emberUtilsSymbol.default('OWNER'); - return _class4; - })(Args))(); -}); + exports.OWNER = OWNER; + /** + Framework objects in an Ember application (components, services, routes, etc.) + are created via a factory and dependency injection system. Each of these + objects is the responsibility of an "owner", which handled its + instantiation and manages its lifetime. + + `getOwner` fetches the owner object responsible for an instance. This can + be used to lookup or resolve other class instances, or register new factories + into the owner. + + For example, this component dynamically looks up a service based on the + `audioType` passed as an attribute: + + ``` + // app/components/play-audio.js + import Ember from 'ember'; + + // Usage: + // + // {{play-audio audioType=model.audioType audioFile=model.file}} + // + export default Ember.Component.extend({ + audioService: Ember.computed('audioType', function() { + let owner = Ember.getOwner(this); + return owner.lookup(`service:${this.get('audioType')}`); + }), + click() { + let player = this.get('audioService'); + player.play(this.get('audioFile')); + } + }); + ``` + + @method getOwner + @for Ember + @param {Object} object An object with an owner. + @return {Object} An owner object. + @since 2.3.0 + @public + */ -enifed('glimmer-runtime/lib/syntax/expressions', ['exports', 'glimmer-runtime/lib/syntax/core', 'glimmer-wire-format'], function (exports, _glimmerRuntimeLibSyntaxCore, _glimmerWireFormat) { - 'use strict'; + function getOwner(object) { + return object[OWNER]; + } - var isArg = _glimmerWireFormat.Expressions.isArg; - var isConcat = _glimmerWireFormat.Expressions.isConcat; - var isGet = _glimmerWireFormat.Expressions.isGet; - var isHasBlock = _glimmerWireFormat.Expressions.isHasBlock; - var isHasBlockParams = _glimmerWireFormat.Expressions.isHasBlockParams; - var isHelper = _glimmerWireFormat.Expressions.isHelper; - var isUnknown = _glimmerWireFormat.Expressions.isUnknown; - var isPrimitiveValue = _glimmerWireFormat.Expressions.isPrimitiveValue; - var isUndefined = _glimmerWireFormat.Expressions.isUndefined; - - exports.default = function (sexp) { - if (isPrimitiveValue(sexp)) return _glimmerRuntimeLibSyntaxCore.Value.fromSpec(sexp); - if (isUndefined(sexp)) return _glimmerRuntimeLibSyntaxCore.Value.build(undefined); - if (isArg(sexp)) return _glimmerRuntimeLibSyntaxCore.GetArgument.fromSpec(sexp); - if (isConcat(sexp)) return _glimmerRuntimeLibSyntaxCore.Concat.fromSpec(sexp); - if (isGet(sexp)) return _glimmerRuntimeLibSyntaxCore.Get.fromSpec(sexp); - if (isHelper(sexp)) return _glimmerRuntimeLibSyntaxCore.Helper.fromSpec(sexp); - if (isUnknown(sexp)) return _glimmerRuntimeLibSyntaxCore.Unknown.fromSpec(sexp); - if (isHasBlock(sexp)) return _glimmerRuntimeLibSyntaxCore.HasBlock.fromSpec(sexp); - if (isHasBlockParams(sexp)) return _glimmerRuntimeLibSyntaxCore.HasBlockParams.fromSpec(sexp); - throw new Error('Unexpected wire format: ' + JSON.stringify(sexp)); - }; + /** + `setOwner` forces a new owner on a given object instance. This is primarily + useful in some testing cases. + + @method setOwner + @for Ember + @param {Object} object An object instance. + @param {Object} object The new owner object of the object instance. + @since 2.3.0 + @public + */ - ; + function setOwner(object, owner) { + object[OWNER] = owner; + } }); +enifed('ember-utils/proxy-utils', ['exports'], function (exports) { + 'use strict'; -enifed('glimmer-runtime/lib/syntax/statements', ['exports', 'glimmer-runtime/lib/syntax/core', 'glimmer-wire-format'], function (exports, _glimmerRuntimeLibSyntaxCore, _glimmerWireFormat) { - 'use strict'; - - var isYield = _glimmerWireFormat.Statements.isYield; - var isBlock = _glimmerWireFormat.Statements.isBlock; - var isPartial = _glimmerWireFormat.Statements.isPartial; - var isAppend = _glimmerWireFormat.Statements.isAppend; - var isDynamicAttr = _glimmerWireFormat.Statements.isDynamicAttr; - var isText = _glimmerWireFormat.Statements.isText; - var isComment = _glimmerWireFormat.Statements.isComment; - var isOpenElement = _glimmerWireFormat.Statements.isOpenElement; - var isFlushElement = _glimmerWireFormat.Statements.isFlushElement; - var isCloseElement = _glimmerWireFormat.Statements.isCloseElement; - var isStaticAttr = _glimmerWireFormat.Statements.isStaticAttr; - var isModifier = _glimmerWireFormat.Statements.isModifier; - var isDynamicArg = _glimmerWireFormat.Statements.isDynamicArg; - var isStaticArg = _glimmerWireFormat.Statements.isStaticArg; - var isTrustingAttr = _glimmerWireFormat.Statements.isTrustingAttr; - - exports.default = function (sexp, symbolTable, scanner) { - if (isYield(sexp)) return _glimmerRuntimeLibSyntaxCore.Yield.fromSpec(sexp); - if (isPartial(sexp)) return _glimmerRuntimeLibSyntaxCore.Partial.fromSpec(sexp); - if (isBlock(sexp)) return _glimmerRuntimeLibSyntaxCore.Block.fromSpec(sexp, symbolTable, scanner); - if (isAppend(sexp)) return _glimmerRuntimeLibSyntaxCore.OptimizedAppend.fromSpec(sexp); - if (isDynamicAttr(sexp)) return _glimmerRuntimeLibSyntaxCore.DynamicAttr.fromSpec(sexp); - if (isDynamicArg(sexp)) return _glimmerRuntimeLibSyntaxCore.DynamicArg.fromSpec(sexp); - if (isTrustingAttr(sexp)) return _glimmerRuntimeLibSyntaxCore.TrustingAttr.fromSpec(sexp); - if (isText(sexp)) return _glimmerRuntimeLibSyntaxCore.Text.fromSpec(sexp); - if (isComment(sexp)) return _glimmerRuntimeLibSyntaxCore.Comment.fromSpec(sexp); - if (isOpenElement(sexp)) return _glimmerRuntimeLibSyntaxCore.OpenElement.fromSpec(sexp, symbolTable); - if (isFlushElement(sexp)) return _glimmerRuntimeLibSyntaxCore.FlushElement.fromSpec(); - if (isCloseElement(sexp)) return _glimmerRuntimeLibSyntaxCore.CloseElement.fromSpec(); - if (isStaticAttr(sexp)) return _glimmerRuntimeLibSyntaxCore.StaticAttr.fromSpec(sexp); - if (isStaticArg(sexp)) return _glimmerRuntimeLibSyntaxCore.StaticArg.fromSpec(sexp); - if (isModifier(sexp)) return _glimmerRuntimeLibSyntaxCore.Modifier.fromSpec(sexp); - }; - - ; + var HAS_NATIVE_PROXY = typeof Proxy === 'function'; + exports.HAS_NATIVE_PROXY = HAS_NATIVE_PROXY; }); +enifed('ember-utils/super', ['exports'], function (exports) { + 'use strict'; -enifed('glimmer-runtime/lib/template', ['exports', 'glimmer-util', 'glimmer-runtime/lib/builder', 'glimmer-runtime/lib/vm', 'glimmer-runtime/lib/scanner'], function (exports, _glimmerUtil, _glimmerRuntimeLibBuilder, _glimmerRuntimeLibVm, _glimmerRuntimeLibScanner) { - 'use strict'; - - exports.default = templateFactory; - - var clientId = 0; - - function templateFactory(_ref) { - var id = _ref.id; - var meta = _ref.meta; - var block = _ref.block; + exports.wrap = wrap; + var HAS_SUPER_PATTERN = /\.(_super|call\(this|apply\(this)/; + var fnToString = Function.prototype.toString; - var parsedBlock = undefined; - if (!id) { - id = 'client-' + clientId++; - } - var create = function (env, envMeta) { - var newMeta = envMeta ? _glimmerUtil.assign({}, envMeta, meta) : meta; - if (!parsedBlock) { - parsedBlock = JSON.parse(block); - } - return template(parsedBlock, id, newMeta, env); - }; - return { id: id, meta: meta, create: create }; - } + var checkHasSuper = (function () { + var sourceAvailable = fnToString.call(function () { + return this; + }).indexOf('return this') > -1; - function template(block, id, meta, env) { - var scanner = new _glimmerRuntimeLibScanner.default(block, meta, env); - var entryPoint = undefined; - var asEntryPoint = function () { - if (!entryPoint) entryPoint = scanner.scanEntryPoint(); - return entryPoint; - }; - var layout = undefined; - var asLayout = function () { - if (!layout) layout = scanner.scanLayout(); - return layout; - }; - var asPartial = function (symbols) { - return scanner.scanPartial(symbols); - }; - var render = function (self, appendTo, dynamicScope) { - var elementStack = _glimmerRuntimeLibBuilder.ElementStack.forInitialRender(env, appendTo, null); - var compiled = asEntryPoint().compile(env); - var vm = _glimmerRuntimeLibVm.VM.initial(env, self, dynamicScope, elementStack, compiled.symbols); - return vm.execute(compiled.ops); - }; - return { id: id, meta: meta, _block: block, asEntryPoint: asEntryPoint, asLayout: asLayout, asPartial: asPartial, render: render }; + if (sourceAvailable) { + return function checkHasSuper(func) { + return HAS_SUPER_PATTERN.test(fnToString.call(func)); + }; } -}); -enifed('glimmer-runtime/lib/upsert', ['exports', 'glimmer-runtime/lib/bounds'], function (exports, _glimmerRuntimeLibBounds) { - 'use strict'; + return function checkHasSuper() { + return true; + }; + })(); - exports.isSafeString = isSafeString; - exports.isNode = isNode; - exports.isString = isString; - exports.cautiousInsert = cautiousInsert; - exports.trustingInsert = trustingInsert; + exports.checkHasSuper = checkHasSuper; + function ROOT() {} + ROOT.__hasSuper = false; - function isSafeString(value) { - return value && typeof value['toHTML'] === 'function'; + function hasSuper(func) { + if (func.__hasSuper === undefined) { + func.__hasSuper = checkHasSuper(func); } + return func.__hasSuper; + } - function isNode(value) { - return value !== null && typeof value === 'object' && typeof value['nodeType'] === 'number'; - } + /** + 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 + @method wrap + @for Ember + @param {Function} func The function to call + @param {Function} superFunc The super function. + @return {Function} wrapped function. + */ - function isString(value) { - return typeof value === 'string'; + function wrap(func, superFunc) { + if (!hasSuper(func)) { + return func; } - - var Upsert = function Upsert(bounds) { - this.bounds = bounds; - }; - - exports.default = Upsert; - - function cautiousInsert(dom, cursor, value) { - if (isString(value)) { - return TextUpsert.insert(dom, cursor, value); - } - if (isSafeString(value)) { - return SafeStringUpsert.insert(dom, cursor, value); - } - if (isNode(value)) { - return NodeUpsert.insert(dom, cursor, value); - } + // ensure an unwrapped super that calls _super is wrapped with a terminal _super + if (!superFunc.wrappedFunction && hasSuper(superFunc)) { + return _wrap(func, _wrap(superFunc, ROOT)); } + return _wrap(func, superFunc); + } - function trustingInsert(dom, cursor, value) { - if (isString(value)) { - return HTMLUpsert.insert(dom, cursor, value); - } - if (isNode(value)) { - return NodeUpsert.insert(dom, cursor, value); - } + function _wrap(func, superFunc) { + function superWrapper() { + var orig = this._super; + this._super = superFunc; + var ret = func.apply(this, arguments); + this._super = orig; + return ret; } - var TextUpsert = (function (_Upsert) { - babelHelpers.inherits(TextUpsert, _Upsert); - - function TextUpsert(bounds, textNode) { - _Upsert.call(this, bounds); - this.textNode = textNode; - } + superWrapper.wrappedFunction = func; + superWrapper.__ember_observes__ = func.__ember_observes__; + superWrapper.__ember_observesBefore__ = func.__ember_observesBefore__; + superWrapper.__ember_listens__ = func.__ember_listens__; - TextUpsert.insert = function insert(dom, cursor, value) { - var textNode = dom.createTextNode(value); - dom.insertBefore(cursor.element, textNode, cursor.nextSibling); - var bounds = new _glimmerRuntimeLibBounds.SingleNodeBounds(cursor.element, textNode); - return new TextUpsert(bounds, textNode); - }; + return superWrapper; + } +}); +enifed('ember-utils/symbol', ['exports', 'ember-utils/guid', 'ember-utils/intern'], function (exports, _emberUtilsGuid, _emberUtilsIntern) { + 'use strict'; - TextUpsert.prototype.update = function update(dom, value) { - if (isString(value)) { - var textNode = this.textNode; + exports.default = symbol; - textNode.nodeValue = value; - return true; - } else { - return false; - } - }; + function symbol(debugName) { + // TODO: Investigate using platform symbols, but we do not + // want to require non-enumerability for this API, which + // would introduce a large cost. + var id = _emberUtilsGuid.GUID_KEY + Math.floor(Math.random() * new Date()); + return _emberUtilsIntern.default('__' + debugName + '__ [id=' + id + ']'); + } +}); +enifed('ember-utils/to-string', ['exports'], function (exports) { + 'use strict'; - return TextUpsert; - })(Upsert); + exports.default = toString; + var objectToString = Object.prototype.toString; - var HTMLUpsert = (function (_Upsert2) { - babelHelpers.inherits(HTMLUpsert, _Upsert2); + /* + A `toString` util function that supports objects without a `toString` + method, e.g. an object created with `Object.create(null)`. + */ - function HTMLUpsert() { - _Upsert2.apply(this, arguments); - } + function toString(obj) { + if (obj && typeof obj.toString === 'function') { + return obj.toString(); + } else { + return objectToString.call(obj); + } + } +}); +enifed('ember-utils/weak-map-utils', ['exports'], function (exports) { + 'use strict'; - HTMLUpsert.insert = function insert(dom, cursor, value) { - var bounds = dom.insertHTMLBefore(cursor.element, value, cursor.nextSibling); - return new HTMLUpsert(bounds); - }; + var HAS_NATIVE_WEAKMAP = (function () { + // detect if `WeakMap` is even present + var hasWeakMap = typeof WeakMap === 'function'; + if (!hasWeakMap) { + return false; + } - HTMLUpsert.prototype.update = function update(dom, value) { - if (isString(value)) { - var bounds = this.bounds; + var instance = new WeakMap(); + // use `Object`'s `.toString` directly to prevent us from detecting + // polyfills as native weakmaps + return Object.prototype.toString.call(instance) === '[object WeakMap]'; + })(); + exports.HAS_NATIVE_WEAKMAP = HAS_NATIVE_WEAKMAP; +}); +enifed('ember-views/compat/attrs', ['exports', 'ember-utils'], function (exports, _emberUtils) { + 'use strict'; - var parentElement = bounds.parentElement(); - var nextSibling = _glimmerRuntimeLibBounds.clear(bounds); - this.bounds = dom.insertHTMLBefore(parentElement, nextSibling, value); - return true; - } else { - return false; - } - }; + var MUTABLE_CELL = _emberUtils.symbol('MUTABLE_CELL'); + exports.MUTABLE_CELL = MUTABLE_CELL; +}); +enifed('ember-views/compat/fallback-view-registry', ['exports', 'ember-utils'], function (exports, _emberUtils) { + 'use strict'; - return HTMLUpsert; - })(Upsert); + exports.default = _emberUtils.dictionary(null); +}); +enifed('ember-views/component_lookup', ['exports', 'ember-metal', 'ember-runtime', 'container'], function (exports, _emberMetal, _emberRuntime, _container) { + 'use strict'; - var SafeStringUpsert = (function (_Upsert3) { - babelHelpers.inherits(SafeStringUpsert, _Upsert3); + exports.default = _emberRuntime.Object.extend({ + componentFor: function (name, owner, options) { + _emberMetal.assert('You cannot use \'' + name + '\' as a component name. Component names must contain a hyphen.', ~name.indexOf('-')); + var fullName = 'component:' + name; + return owner[_container.FACTORY_FOR](fullName, options); + }, - function SafeStringUpsert(bounds, lastStringValue) { - _Upsert3.call(this, bounds); - this.lastStringValue = lastStringValue; - } + layoutFor: function (name, owner, options) { + _emberMetal.assert('You cannot use \'' + name + '\' as a component name. Component names must contain a hyphen.', ~name.indexOf('-')); - SafeStringUpsert.insert = function insert(dom, cursor, value) { - var stringValue = value.toHTML(); - var bounds = dom.insertHTMLBefore(cursor.element, stringValue, cursor.nextSibling); - return new SafeStringUpsert(bounds, stringValue); - }; + var templateFullName = 'template:components/' + name; + return owner.lookup(templateFullName, options); + } + }); +}); +enifed('ember-views/index', ['exports', 'ember-views/system/ext', 'ember-views/system/jquery', 'ember-views/system/utils', 'ember-views/system/event_dispatcher', 'ember-views/component_lookup', 'ember-views/mixins/text_support', 'ember-views/views/core_view', 'ember-views/mixins/class_names_support', 'ember-views/mixins/child_views_support', 'ember-views/mixins/view_state_support', 'ember-views/mixins/view_support', 'ember-views/mixins/action_support', 'ember-views/compat/attrs', 'ember-views/system/lookup_partial', 'ember-views/utils/lookup-component', 'ember-views/system/action_manager', 'ember-views/compat/fallback-view-registry'], function (exports, _emberViewsSystemExt, _emberViewsSystemJquery, _emberViewsSystemUtils, _emberViewsSystemEvent_dispatcher, _emberViewsComponent_lookup, _emberViewsMixinsText_support, _emberViewsViewsCore_view, _emberViewsMixinsClass_names_support, _emberViewsMixinsChild_views_support, _emberViewsMixinsView_state_support, _emberViewsMixinsView_support, _emberViewsMixinsAction_support, _emberViewsCompatAttrs, _emberViewsSystemLookup_partial, _emberViewsUtilsLookupComponent, _emberViewsSystemAction_manager, _emberViewsCompatFallbackViewRegistry) { + /** + @module ember + @submodule ember-views + */ - SafeStringUpsert.prototype.update = function update(dom, value) { - if (isSafeString(value)) { - var stringValue = value.toHTML(); - if (stringValue !== this.lastStringValue) { - var bounds = this.bounds; + 'use strict'; - var parentElement = bounds.parentElement(); - var nextSibling = _glimmerRuntimeLibBounds.clear(bounds); - this.bounds = dom.insertHTMLBefore(parentElement, nextSibling, stringValue); - this.lastStringValue = stringValue; - } - return true; - } else { - return false; - } - }; + exports.jQuery = _emberViewsSystemJquery.default; + exports.isSimpleClick = _emberViewsSystemUtils.isSimpleClick; + exports.getViewBounds = _emberViewsSystemUtils.getViewBounds; + exports.getViewClientRects = _emberViewsSystemUtils.getViewClientRects; + exports.getViewBoundingClientRect = _emberViewsSystemUtils.getViewBoundingClientRect; + exports.getRootViews = _emberViewsSystemUtils.getRootViews; + exports.getChildViews = _emberViewsSystemUtils.getChildViews; + exports.getViewId = _emberViewsSystemUtils.getViewId; + exports.getViewElement = _emberViewsSystemUtils.getViewElement; + exports.setViewElement = _emberViewsSystemUtils.setViewElement; + exports.STYLE_WARNING = _emberViewsSystemUtils.STYLE_WARNING; + exports.EventDispatcher = _emberViewsSystemEvent_dispatcher.default; + exports.ComponentLookup = _emberViewsComponent_lookup.default; + exports.TextSupport = _emberViewsMixinsText_support.default; + exports.CoreView = _emberViewsViewsCore_view.default; + exports.ClassNamesSupport = _emberViewsMixinsClass_names_support.default; + exports.ChildViewsSupport = _emberViewsMixinsChild_views_support.default; + exports.ViewStateSupport = _emberViewsMixinsView_state_support.default; + exports.ViewMixin = _emberViewsMixinsView_support.default; + exports.dispatchLifeCycleHook = _emberViewsMixinsView_support.dispatchLifeCycleHook; + exports.ActionSupport = _emberViewsMixinsAction_support.default; + exports.MUTABLE_CELL = _emberViewsCompatAttrs.MUTABLE_CELL; + exports.lookupPartial = _emberViewsSystemLookup_partial.default; + exports.hasPartial = _emberViewsSystemLookup_partial.hasPartial; + exports.lookupComponent = _emberViewsUtilsLookupComponent.default; + exports.ActionManager = _emberViewsSystemAction_manager.default; + exports.fallbackViewRegistry = _emberViewsCompatFallbackViewRegistry.default; +}); +// for the side effect of extending Ember.run.queues +enifed('ember-views/mixins/action_support', ['exports', 'ember-utils', 'ember-metal', 'ember-views/compat/attrs'], function (exports, _emberUtils, _emberMetal, _emberViewsCompatAttrs) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; - return SafeStringUpsert; - })(Upsert); + function validateAction(component, actionName) { + if (actionName && actionName[_emberViewsCompatAttrs.MUTABLE_CELL]) { + actionName = actionName.value; + } - var NodeUpsert = (function (_Upsert4) { - babelHelpers.inherits(NodeUpsert, _Upsert4); + _emberMetal.assert('The default action was triggered on the component ' + component.toString() + ', but the action name (' + actionName + ') was not a string.', _emberMetal.isNone(actionName) || typeof actionName === 'string' || typeof actionName === 'function'); + return actionName; + } - function NodeUpsert() { - _Upsert4.apply(this, arguments); + /** + @class ActionSupport + @namespace Ember + @private + */ + exports.default = _emberMetal.Mixin.create({ + /** + 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 + export default Ember.Component.extend({ + click() { + if (this.get('isPlaying')) { + this.sendAction('play'); + } else { + this.sendAction('stop'); + } + } + }); + ``` + The actions "play" and "stop" must be passed to this `play-button` component: + ```handlebars + {{! app/templates/application.hbs }} + {{play-button play=(action "musicStarted") stop=(action "musicStopped")}} + ``` + When the component receives a browser `click` event it translate this + interaction into application-specific semantics ("play" or "stop") and + calls the specified action. + ```javascript + // app/controller/application.js + export default Ember.Controller.extend({ + actions: { + musicStarted() { + // called when the play button is clicked + // and the music started playing + }, + musicStopped() { + // called when the play button is clicked + // and the music stopped playing + } + } + }); + ``` + If no action is passed to `sendAction` a default name of "action" + is assumed. + ```javascript + // app/components/next-button.js + export default Ember.Component.extend({ + click() { + this.sendAction(); + } + }); + ``` + ```handlebars + {{! app/templates/application.hbs }} + {{next-button action=(action "playNextSongInAlbum")}} + ``` + ```javascript + // app/controllers/application.js + App.ApplicationController = Ember.Controller.extend({ + actions: { + playNextSongInAlbum() { + ... + } } + }); + ``` + @method sendAction + @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]; + } - NodeUpsert.insert = function insert(dom, cursor, node) { - dom.insertBefore(cursor.element, node, cursor.nextSibling); - return new NodeUpsert(_glimmerRuntimeLibBounds.single(cursor.element, node)); - }; + var actionName = undefined; - NodeUpsert.prototype.update = function update(dom, value) { - if (isNode(value)) { - var bounds = this.bounds; + // Send the default action + if (action === undefined) { + action = 'action'; + } + actionName = _emberMetal.get(this, 'attrs.' + action) || _emberMetal.get(this, action); + actionName = validateAction(this, actionName); - var parentElement = bounds.parentElement(); - var nextSibling = _glimmerRuntimeLibBounds.clear(bounds); - this.bounds = dom.insertNodeBefore(parentElement, value, nextSibling); - return true; - } else { - return false; - } - }; + // If no action name for that action could be found, just abort. + if (actionName === undefined) { + return; + } - return NodeUpsert; - })(Upsert); -}); + if (typeof actionName === 'function') { + actionName.apply(undefined, contexts); + } else { + this.triggerAction({ + action: actionName, + actionContext: contexts + }); + } + }, -enifed('glimmer-runtime/lib/utils', ['exports', 'glimmer-util'], function (exports, _glimmerUtil) { - 'use strict'; + send: function (actionName) { + for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } - var HAS_NATIVE_WEAKMAP = (function () { - // detect if `WeakMap` is even present - var hasWeakMap = typeof WeakMap === 'function'; - if (!hasWeakMap) { - return false; - } - var instance = new WeakMap(); - // use `Object`'s `.toString` directly to prevent us from detecting - // polyfills as native weakmaps - return Object.prototype.toString.call(instance) === '[object WeakMap]'; - })(); - var EMPTY_ARRAY = HAS_NATIVE_WEAKMAP ? Object.freeze([]) : []; - exports.EMPTY_ARRAY = EMPTY_ARRAY; - var EMPTY_DICT = HAS_NATIVE_WEAKMAP ? Object.freeze(_glimmerUtil.dict()) : _glimmerUtil.dict(); - exports.EMPTY_DICT = EMPTY_DICT; + var action = this.actions && this.actions[actionName]; - var ListRange = (function () { - function ListRange(list, start, end) { - this.list = list; - this.start = start; - this.end = end; + if (action) { + var shouldBubble = action.apply(this, args) === true; + if (!shouldBubble) { + return; } + } - ListRange.prototype.at = function at(index) { - if (index >= this.list.length) return null; - return this.list[index]; - }; - - ListRange.prototype.min = function min() { - return this.start; - }; - - ListRange.prototype.max = function max() { - return this.end; - }; - - return ListRange; - })(); - - exports.ListRange = ListRange; + var target = _emberMetal.get(this, 'target'); + if (target) { + _emberMetal.assert('The `target` for ' + this + ' (' + target + ') does not have a `send` method', typeof target.send === 'function'); + target.send.apply(target, arguments); + } else { + _emberMetal.assert(_emberUtils.inspect(this) + ' had no action handler for: ' + actionName, action); + } + } + }); }); - -enifed('glimmer-runtime/lib/vm', ['exports', 'glimmer-runtime/lib/vm/append', 'glimmer-runtime/lib/vm/update', 'glimmer-runtime/lib/vm/render-result'], function (exports, _glimmerRuntimeLibVmAppend, _glimmerRuntimeLibVmUpdate, _glimmerRuntimeLibVmRenderResult) { +enifed('ember-views/mixins/child_views_support', ['exports', 'ember-utils', 'ember-metal', 'ember-views/system/utils'], function (exports, _emberUtils, _emberMetal, _emberViewsSystemUtils) { + /** + @module ember + @submodule ember-views + */ 'use strict'; - exports.VM = _glimmerRuntimeLibVmAppend.default; - exports.PublicVM = _glimmerRuntimeLibVmAppend.PublicVM; - exports.UpdatingVM = _glimmerRuntimeLibVmUpdate.default; - exports.RenderResult = _glimmerRuntimeLibVmRenderResult.default; -}); - -enifed('glimmer-runtime/lib/vm/append', ['exports', 'glimmer-runtime/lib/environment', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-runtime/lib/vm/update', 'glimmer-runtime/lib/vm/render-result', 'glimmer-runtime/lib/vm/frame'], function (exports, _glimmerRuntimeLibEnvironment, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerRuntimeLibVmUpdate, _glimmerRuntimeLibVmRenderResult, _glimmerRuntimeLibVmFrame) { - 'use strict'; - - var VM = (function () { - function VM(env, scope, dynamicScope, elementStack) { - this.env = env; - this.elementStack = elementStack; - this.dynamicScopeStack = new _glimmerUtil.Stack(); - this.scopeStack = new _glimmerUtil.Stack(); - this.updatingOpcodeStack = new _glimmerUtil.Stack(); - this.cacheGroups = new _glimmerUtil.Stack(); - this.listBlockStack = new _glimmerUtil.Stack(); - this.frame = new _glimmerRuntimeLibVmFrame.FrameStack(); - this.env = env; - this.elementStack = elementStack; - this.scopeStack.push(scope); - this.dynamicScopeStack.push(dynamicScope); - } - - VM.initial = function initial(env, self, dynamicScope, elementStack, size) { - var scope = _glimmerRuntimeLibEnvironment.Scope.root(self, size); - return new VM(env, scope, dynamicScope, elementStack); - }; - - VM.prototype.capture = function capture() { - return { - env: this.env, - scope: this.scope(), - dynamicScope: this.dynamicScope(), - frame: this.frame.capture() - }; - }; + exports.default = _emberMetal.Mixin.create({ + init: function () { + this._super.apply(this, arguments); + _emberViewsSystemUtils.initChildViews(this); + }, - VM.prototype.goto = function goto(op) { - // assert(this.frame.getOps().contains(op), `Illegal jump to ${op.label}`); - this.frame.goto(op); - }; + /** + Array of child views. You should never edit this array directly. + @property childViews + @type Array + @default [] + @private + */ + childViews: _emberMetal.descriptor({ + configurable: false, + enumerable: false, + get: function () { + return _emberViewsSystemUtils.getChildViews(this); + } + }), - VM.prototype.beginCacheGroup = function beginCacheGroup() { - this.cacheGroups.push(this.updatingOpcodeStack.current.tail()); - }; + appendChild: function (view) { + this.linkChild(view); + _emberViewsSystemUtils.addChildView(this, view); + }, - VM.prototype.commitCacheGroup = function commitCacheGroup() { - // JumpIfNotModified(END) - // (head) - // (....) - // (tail) - // DidModify - // END: Noop - var END = new _glimmerRuntimeLibCompiledOpcodesVm.LabelOpcode("END"); - var opcodes = this.updatingOpcodeStack.current; - var marker = this.cacheGroups.pop(); - var head = marker ? opcodes.nextNode(marker) : opcodes.head(); - var tail = opcodes.tail(); - var tag = _glimmerReference.combineSlice(new _glimmerUtil.ListSlice(head, tail)); - var guard = new _glimmerRuntimeLibCompiledOpcodesVm.JumpIfNotModifiedOpcode(tag, END); - opcodes.insertBefore(guard, head); - opcodes.append(new _glimmerRuntimeLibCompiledOpcodesVm.DidModifyOpcode(guard)); - opcodes.append(END); - }; + linkChild: function (instance) { + if (!_emberUtils.getOwner(instance)) { + _emberUtils.setOwner(instance, _emberUtils.getOwner(this)); + } + } + }); +}); +enifed('ember-views/mixins/class_names_support', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-views + */ - VM.prototype.enter = function enter(ops) { - var updating = new _glimmerUtil.LinkedList(); - var tracker = this.stack().pushUpdatableBlock(); - var state = this.capture(); - var tryOpcode = new _glimmerRuntimeLibVmUpdate.TryOpcode(ops, state, tracker, updating); - this.didEnter(tryOpcode, updating); - }; + 'use strict'; - VM.prototype.enterWithKey = function enterWithKey(key, ops) { - var updating = new _glimmerUtil.LinkedList(); - var tracker = this.stack().pushUpdatableBlock(); - var state = this.capture(); - var tryOpcode = new _glimmerRuntimeLibVmUpdate.TryOpcode(ops, state, tracker, updating); - this.listBlockStack.current.map[key] = tryOpcode; - this.didEnter(tryOpcode, updating); - }; + var EMPTY_ARRAY = Object.freeze([]); - VM.prototype.enterList = function enterList(ops) { - var updating = new _glimmerUtil.LinkedList(); - var tracker = this.stack().pushBlockList(updating); - var state = this.capture(); - var artifacts = this.frame.getIterator().artifacts; - var opcode = new _glimmerRuntimeLibVmUpdate.ListBlockOpcode(ops, state, tracker, updating, artifacts); - this.listBlockStack.push(opcode); - this.didEnter(opcode, updating); - }; + /** + @class ClassNamesSupport + @namespace Ember + @private + */ + exports.default = _emberMetal.Mixin.create({ + concatenatedProperties: ['classNames', 'classNameBindings'], - VM.prototype.didEnter = function didEnter(opcode, updating) { - this.updateWith(opcode); - this.updatingOpcodeStack.push(updating); - }; + init: function () { + this._super.apply(this, arguments); - VM.prototype.exit = function exit() { - this.stack().popBlock(); - this.updatingOpcodeStack.pop(); - var parent = this.updatingOpcodeStack.current.tail(); - parent.didInitializeChildren(); - }; + _emberMetal.assert('Only arrays are allowed for \'classNameBindings\'', Array.isArray(this.classNameBindings)); + _emberMetal.assert('Only arrays of static class strings are allowed for \'classNames\'. For dynamic classes, use \'classNameBindings\'.', Array.isArray(this.classNames)); + }, - VM.prototype.exitList = function exitList() { - this.exit(); - this.listBlockStack.pop(); - }; + /** + Standard CSS class names to apply to the view's outer element. This + property automatically inherits any class names defined by the view's + superclasses as well. + @property classNames + @type Array + @default ['ember-view'] + @public + */ + classNames: EMPTY_ARRAY, - VM.prototype.updateWith = function updateWith(opcode) { - this.updatingOpcodeStack.current.append(opcode); - }; + /** + A list of properties of the view to apply as class names. If the property + is a string value, the value of that string will be applied as a class + name. + ```javascript + // Applies the 'high' class to the view element + Ember.Component.extend({ + classNameBindings: ['priority'], + priority: 'high' + }); + ``` + If the value of the property is a Boolean, the name of that property is + added as a dasherized class name. + ```javascript + // Applies the 'is-urgent' class to the view element + Ember.Component.extend({ + classNameBindings: ['isUrgent'], + isUrgent: true + }); + ``` + If you would prefer to use a custom value instead of the dasherized + property name, you can pass a binding like this: + ```javascript + // Applies the 'urgent' class to the view element + Ember.Component.extend({ + classNameBindings: ['isUrgent:urgent'], + isUrgent: true + }); + ``` + This list of properties is inherited from the component's superclasses as well. + @property classNameBindings + @type Array + @default [] + @public + */ + classNameBindings: EMPTY_ARRAY + }); +}); +enifed('ember-views/mixins/text_support', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { + /** + @module ember + @submodule ember-views + */ - VM.prototype.stack = function stack() { - return this.elementStack; - }; + 'use strict'; - VM.prototype.scope = function scope() { - return this.scopeStack.current; - }; + var KEY_EVENTS = { + 13: 'insertNewline', + 27: 'cancel' + }; - VM.prototype.dynamicScope = function dynamicScope() { - return this.dynamicScopeStack.current; - }; + /** + `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 + value of the field passed in as the only argument unless the value of + the field is empty. In that case, the instance of the field itself is passed + in as the only argument. + + Let's use the pressing of the escape key as an example. If you wanted to + invoke a controller action when a user presses the escape key while on your + field, you would use the `escape-press` attribute on your field like so: + + ```handlebars + {{! application.hbs}} + + {{input escape-press='alertUser'}} + ``` + + ```javascript + App = Ember.Application.create(); + + App.ApplicationController = Ember.Controller.extend({ + actions: { + alertUser: function ( currentValue ) { + alert( 'escape pressed, current value: ' + currentValue ); + } + } + }); + ``` + + The following chart is a visual representation of what takes place when the + escape key is pressed in this scenario: + + ``` + The Template + +---------------------------+ + | | + | escape-press='alertUser' | + | | TextSupport Mixin + +----+----------------------+ +-------------------------------+ + | | cancel method | + | escape button pressed | | + +-------------------------------> | checks for the `escape-press` | + | attribute and pulls out the | + +-------------------------------+ | `alertUser` value | + | action name 'alertUser' +-------------------------------+ + | sent to controller + v + Controller + +------------------------------------------ + + | | + | actions: { | + | alertUser: function( currentValue ){ | + | alert( 'the esc key was pressed!' ) | + | } | + | } | + | | + +-------------------------------------------+ + ``` + + Here are the events that we currently support along with the name of the + attribute you would need to use on your field. To reiterate, you would use the + attribute name like so: + + ```handlebars + {{input attribute-name='controllerAction'}} + ``` + + ``` + +--------------------+----------------+ + | | | + | event | attribute name | + +--------------------+----------------+ + | new line inserted | insert-newline | + | | | + | enter key pressed | insert-newline | + | | | + | cancel key pressed | escape-press | + | | | + | focusin | focus-in | + | | | + | focusout | focus-out | + | | | + | keypress | key-press | + | | | + | keyup | key-up | + | | | + | keydown | key-down | + +--------------------+----------------+ + ``` + + @class TextSupport + @namespace Ember + @uses Ember.TargetActionSupport + @extends Ember.Mixin + @private + */ + exports.default = _emberMetal.Mixin.create(_emberRuntime.TargetActionSupport, { + value: '', - VM.prototype.pushFrame = function pushFrame(block, args, callerScope) { - this.frame.push(block.ops); - if (args) this.frame.setArgs(args); - if (args && args.blocks) this.frame.setBlocks(args.blocks); - if (callerScope) this.frame.setCallerScope(callerScope); - }; + attributeBindings: ['autocapitalize', 'autocorrect', 'autofocus', 'disabled', 'form', 'maxlength', 'placeholder', 'readonly', 'required', 'selectionDirection', 'spellcheck', 'tabindex', 'title'], + placeholder: null, + disabled: false, + maxlength: null, - VM.prototype.pushComponentFrame = function pushComponentFrame(layout, args, callerScope, component, manager, shadow) { - this.frame.push(layout.ops, component, manager, shadow); - if (args) this.frame.setArgs(args); - if (args && args.blocks) this.frame.setBlocks(args.blocks); - if (callerScope) this.frame.setCallerScope(callerScope); - }; + init: function () { + this._super.apply(this, arguments); + this.on('paste', this, this._elementValueDidChange); + this.on('cut', this, this._elementValueDidChange); + this.on('input', this, this._elementValueDidChange); + }, - VM.prototype.pushEvalFrame = function pushEvalFrame(ops) { - this.frame.push(ops); - }; + /** + The action to be sent when the user presses the return key. + This is similar to the `{{action}}` helper, but is fired when + the user presses the return key when editing a text field, and sends + the value of the field as the context. + @property action + @type String + @default null + @private + */ + action: null, - VM.prototype.pushChildScope = function pushChildScope() { - this.scopeStack.push(this.scopeStack.current.child()); - }; + /** + The event that should send the action. + Options are: + * `enter`: the user pressed enter + * `keyPress`: the user pressed a key + @property onEvent + @type String + @default enter + @private + */ + onEvent: 'enter', - VM.prototype.pushCallerScope = function pushCallerScope() { - this.scopeStack.push(this.scope().getCallerScope()); - }; + /** + Whether the `keyUp` event that triggers an `action` to be sent continues + propagating to other views. + By default, when the user presses the return key on their keyboard and + the text field has an `action` set, the action will be sent to the view's + controller and the key event will stop propagating. + If you would like parent views to receive the `keyUp` event even after an + action has been dispatched, set `bubbles` to true. + @property bubbles + @type Boolean + @default false + @private + */ + bubbles: false, - VM.prototype.pushDynamicScope = function pushDynamicScope() { - var child = this.dynamicScopeStack.current.child(); - this.dynamicScopeStack.push(child); - return child; - }; + interpretKeyEvents: function (event) { + var map = KEY_EVENTS; + var method = map[event.keyCode]; - VM.prototype.pushRootScope = function pushRootScope(self, size) { - var scope = _glimmerRuntimeLibEnvironment.Scope.root(self, size); - this.scopeStack.push(scope); - return scope; - }; + this._elementValueDidChange(); + if (method) { + return this[method](event); + } + }, - VM.prototype.popScope = function popScope() { - this.scopeStack.pop(); - }; + _elementValueDidChange: function () { + _emberMetal.set(this, 'value', this.element.value); + }, - VM.prototype.popDynamicScope = function popDynamicScope() { - this.dynamicScopeStack.pop(); - }; + change: function (event) { + this._elementValueDidChange(event); + }, - VM.prototype.newDestroyable = function newDestroyable(d) { - this.stack().newDestroyable(d); - }; + /** + Allows you to specify a controller action to invoke when either the `enter` + key is pressed or, in the case of the field being a textarea, when a newline + is inserted. To use this method, give your field an `insert-newline` + attribute. The value of that attribute should be the name of the action + in your controller that you wish to invoke. + For an example on how to use the `insert-newline` attribute, please + reference the example near the top of this file. + @method insertNewline + @param {Event} event + @private + */ + insertNewline: function (event) { + sendAction('enter', this, event); + sendAction('insert-newline', this, event); + }, - /// SCOPE HELPERS + /** + Allows you to specify a controller action to invoke when the escape button + is pressed. To use this method, give your field an `escape-press` + attribute. The value of that attribute should be the name of the action + in your controller that you wish to invoke. + For an example on how to use the `escape-press` attribute, please reference + the example near the top of this file. + @method cancel + @param {Event} event + @private + */ + cancel: function (event) { + sendAction('escape-press', this, event); + }, - VM.prototype.getSelf = function getSelf() { - return this.scope().getSelf(); - }; + /** + Allows you to specify a controller action to invoke when a field receives + focus. To use this method, give your field a `focus-in` attribute. The value + of that attribute should be the name of the action in your controller + that you wish to invoke. + For an example on how to use the `focus-in` attribute, please reference the + example near the top of this file. + @method focusIn + @param {Event} event + @private + */ + focusIn: function (event) { + sendAction('focus-in', this, event); + }, - VM.prototype.referenceForSymbol = function referenceForSymbol(symbol) { - return this.scope().getSymbol(symbol); - }; + /** + Allows you to specify a controller action to invoke when a field loses + focus. To use this method, give your field a `focus-out` attribute. The value + of that attribute should be the name of the action in your controller + that you wish to invoke. + For an example on how to use the `focus-out` attribute, please reference the + example near the top of this file. + @method focusOut + @param {Event} event + @private + */ + focusOut: function (event) { + this._elementValueDidChange(event); + sendAction('focus-out', this, event); + }, - VM.prototype.getArgs = function getArgs() { - return this.frame.getArgs(); - }; + /** + Allows you to specify a controller action to invoke when a key is pressed. + To use this method, give your field a `key-press` attribute. The value of + that attribute should be the name of the action in your controller you + that wish to invoke. + For an example on how to use the `key-press` attribute, please reference the + example near the top of this file. + @method keyPress + @param {Event} event + @private + */ + keyPress: function (event) { + sendAction('key-press', this, event); + }, - /// EXECUTION + /** + Allows you to specify a controller action to invoke when a key-up event is + fired. To use this method, give your field a `key-up` attribute. The value + of that attribute should be the name of the action in your controller + that you wish to invoke. + For an example on how to use the `key-up` attribute, please reference the + example near the top of this file. + @method keyUp + @param {Event} event + @private + */ + keyUp: function (event) { + this.interpretKeyEvents(event); - VM.prototype.resume = function resume(opcodes, frame) { - return this.execute(opcodes, function (vm) { - return vm.frame.restore(frame); - }); - }; + this.sendAction('key-up', _emberMetal.get(this, 'value'), event); + }, - VM.prototype.execute = function execute(opcodes, initialize) { - _glimmerUtil.LOGGER.debug("[VM] Begin program execution"); - var elementStack = this.elementStack; - var frame = this.frame; - var updatingOpcodeStack = this.updatingOpcodeStack; - var env = this.env; - - elementStack.pushSimpleBlock(); - updatingOpcodeStack.push(new _glimmerUtil.LinkedList()); - frame.push(opcodes); - if (initialize) initialize(this); - var opcode = undefined; - while (frame.hasOpcodes()) { - if (opcode = frame.nextStatement()) { - _glimmerUtil.LOGGER.debug('[VM] OP ' + opcode.type); - _glimmerUtil.LOGGER.trace(opcode); - opcode.evaluate(this); - } - } - _glimmerUtil.LOGGER.debug("[VM] Completed program execution"); - return new _glimmerRuntimeLibVmRenderResult.default(env, updatingOpcodeStack.pop(), elementStack.popBlock()); - }; + /** + Allows you to specify a controller action to invoke when a key-down event is + fired. To use this method, give your field a `key-down` attribute. The value + of that attribute should be the name of the action in your controller that + you wish to invoke. + For an example on how to use the `key-down` attribute, please reference the + example near the top of this file. + @method keyDown + @param {Event} event + @private + */ + keyDown: function (event) { + this.sendAction('key-down', _emberMetal.get(this, 'value'), event); + } + }); - VM.prototype.evaluateOpcode = function evaluateOpcode(opcode) { - opcode.evaluate(this); - }; + // In principle, this shouldn't be necessary, but the legacy + // sendAction semantics for TextField are different from + // the component semantics so this method normalizes them. + function sendAction(eventName, view, event) { + var action = _emberMetal.get(view, 'attrs.' + eventName) || _emberMetal.get(view, eventName); + var on = _emberMetal.get(view, 'onEvent'); + var value = _emberMetal.get(view, 'value'); - // Make sure you have opcodes that push and pop a scope around this opcode - // if you need to change the scope. + // back-compat support for keyPress as an event name even though + // it's also a method name that consumes the event (and therefore + // incompatible with sendAction semantics). + if (on === eventName || on === 'keyPress' && eventName === 'key-press') { + view.sendAction('action', value); + } - VM.prototype.invokeBlock = function invokeBlock(block, args) { - var compiled = block.compile(this.env); - this.pushFrame(compiled, args); - }; + view.sendAction(eventName, value); - VM.prototype.invokePartial = function invokePartial(block) { - var compiled = block.compile(this.env); - this.pushFrame(compiled); - }; + if (action || on === eventName) { + if (!_emberMetal.get(view, 'bubbles')) { + event.stopPropagation(); + } + } + } +}); +enifed('ember-views/mixins/view_state_support', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; - VM.prototype.invokeLayout = function invokeLayout(args, layout, callerScope, component, manager, shadow) { - this.pushComponentFrame(layout, args, callerScope, component, manager, shadow); - }; + exports.default = _emberMetal.Mixin.create({ + _transitionTo: function (state) { + var priorState = this._currentState; + var currentState = this._currentState = this._states[state]; + this._state = state; - VM.prototype.evaluateOperand = function evaluateOperand(expr) { - this.frame.setOperand(expr.evaluate(this)); - }; + if (priorState && priorState.exit) { + priorState.exit(this); + } + if (currentState.enter) { + currentState.enter(this); + } + } + }); +}); +enifed('ember-views/mixins/view_support', ['exports', 'ember-utils', 'ember-metal', 'ember-environment', 'ember-views/system/utils', 'ember-runtime/system/core_object', 'ember-views/system/jquery'], function (exports, _emberUtils, _emberMetal, _emberEnvironment, _emberViewsSystemUtils, _emberRuntimeSystemCore_object, _emberViewsSystemJquery) { + 'use strict'; - VM.prototype.evaluateArgs = function evaluateArgs(args) { - var evaledArgs = this.frame.setArgs(args.evaluate(this)); - this.frame.setOperand(evaledArgs.positional.at(0)); - }; + var _Mixin$create; - VM.prototype.bindPositionalArgs = function bindPositionalArgs(symbols) { - var args = this.frame.getArgs(); - _glimmerUtil.assert(args, "Cannot bind positional args"); - var positional = args.positional; + function K() { + return this; + } - var scope = this.scope(); - for (var i = 0; i < symbols.length; i++) { - scope.bindSymbol(symbols[i], positional.at(i)); - } - }; + var dispatchLifeCycleHook = function (component, hook, oldAttrs, newAttrs) { + component.trigger(hook, { attrs: newAttrs, oldAttrs: oldAttrs, newAttrs: newAttrs }); + }; - VM.prototype.bindNamedArgs = function bindNamedArgs(names, symbols) { - var args = this.frame.getArgs(); - var scope = this.scope(); - _glimmerUtil.assert(args, "Cannot bind named args"); - var named = args.named; + exports.dispatchLifeCycleHook = dispatchLifeCycleHook; + _emberMetal.runInDebug(function () { + var Attrs = (function () { + function Attrs(oldAttrs, newAttrs, message) { + babelHelpers.classCallCheck(this, Attrs); + + this._oldAttrs = oldAttrs; + this._newAttrs = newAttrs; + this._message = message; + } + + babelHelpers.createClass(Attrs, [{ + key: 'attrs', + get: function () { + return this.newAttrs; + } + }, { + key: 'oldAttrs', + get: function () { + _emberMetal.deprecate(this._message, false, { + id: 'ember-views.lifecycle-hook-arguments', + until: '2.13.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_arguments-in-component-lifecycle-hooks' + }); - for (var i = 0; i < names.length; i++) { - scope.bindSymbol(symbols[i], named.get(names[i])); - } - }; + return this._oldAttrs; + } + }, { + key: 'newAttrs', + get: function () { + _emberMetal.deprecate(this._message, false, { + id: 'ember-views.lifecycle-hook-arguments', + until: '2.13.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_arguments-in-component-lifecycle-hooks' + }); - VM.prototype.bindBlocks = function bindBlocks(names, symbols) { - var blocks = this.frame.getBlocks(); - var scope = this.scope(); - for (var i = 0; i < names.length; i++) { - scope.bindBlock(symbols[i], blocks && blocks[names[i]] || null); - } - }; + return this._newAttrs; + } + }]); + return Attrs; + })(); - VM.prototype.bindPartialArgs = function bindPartialArgs(symbol) { - var args = this.frame.getArgs(); - var scope = this.scope(); - _glimmerUtil.assert(args, "Cannot bind named args"); - scope.bindPartialArgs(symbol, args); - }; + exports.dispatchLifeCycleHook = dispatchLifeCycleHook = function (component, hook, oldAttrs, newAttrs) { + if (typeof component[hook] === 'function' && component[hook].length !== 0) { + // Already warned in init + component.trigger(hook, { attrs: newAttrs, oldAttrs: oldAttrs, newAttrs: newAttrs }); + } else { + component.trigger(hook, new Attrs(oldAttrs, newAttrs, '[DEPRECATED] Ember will stop passing arguments to component lifecycle hooks. Please change `' + component.toString() + '#' + hook + '` to stop taking arguments.')); + } + }; + }); - VM.prototype.bindCallerScope = function bindCallerScope() { - var callerScope = this.frame.getCallerScope(); - var scope = this.scope(); - _glimmerUtil.assert(callerScope, "Cannot bind caller scope"); - scope.bindCallerScope(callerScope); - }; + /** + @class ViewMixin + @namespace Ember + @private + */ + exports.default = _emberMetal.Mixin.create((_Mixin$create = { + concatenatedProperties: ['attributeBindings'] + }, _Mixin$create[_emberRuntimeSystemCore_object.POST_INIT] = function () { + dispatchLifeCycleHook(this, 'didInitAttrs', undefined, this.attrs); + dispatchLifeCycleHook(this, 'didReceiveAttrs', undefined, this.attrs); + }, _Mixin$create.nearestOfType = function (klass) { + var view = this.parentView; + var isOfType = klass instanceof _emberMetal.Mixin ? function (view) { + return klass.detect(view); + } : function (view) { + return klass.detect(view.constructor); + }; - VM.prototype.bindDynamicScope = function bindDynamicScope(names) { - var args = this.frame.getArgs(); - var scope = this.dynamicScope(); - _glimmerUtil.assert(args, "Cannot bind dynamic scope"); - for (var i = 0; i < names.length; i++) { - scope.set(names[i], args.named.get(names[i])); - } - }; + while (view) { + if (isOfType(view)) { + return view; + } + view = view.parentView; + } + }, _Mixin$create.nearestWithProperty = function (property) { + var view = this.parentView; - return VM; - })(); + while (view) { + if (property in view) { + return view; + } + view = view.parentView; + } + }, _Mixin$create.rerender = function () { + return this._currentState.rerender(this); + }, _Mixin$create.element = _emberMetal.descriptor({ + configurable: false, + enumerable: false, + get: function () { + return this.renderer.getElement(this); + } + }), _Mixin$create.$ = function (sel) { + _emberMetal.assert('You cannot access this.$() on a component with `tagName: \'\'` specified.', this.tagName !== ''); + if (this.element) { + return sel ? _emberViewsSystemJquery.default(sel, this.element) : _emberViewsSystemJquery.default(this.element); + } + }, _Mixin$create.appendTo = function (selector) { + var env = this._environment || _emberEnvironment.environment; + var target = undefined; - exports.default = VM; -}); + if (env.hasDOM) { + target = typeof selector === 'string' ? document.querySelector(selector) : selector; -enifed('glimmer-runtime/lib/vm/frame', ['exports'], function (exports) { - 'use strict'; + _emberMetal.assert('You tried to append to (' + selector + ') but that isn\'t in the DOM', target); + _emberMetal.assert('You cannot append to an existing Ember.View.', !_emberViewsSystemUtils.matches(target, '.ember-view')); + _emberMetal.assert('You cannot append to an existing Ember.View.', (function () { + var node = target.parentNode; + while (node) { + if (node.nodeType !== 9 && _emberViewsSystemUtils.matches(node, '.ember-view')) { + return false; + } - var CapturedFrame = function CapturedFrame(operand, args, condition) { - this.operand = operand; - this.args = args; - this.condition = condition; - }; - - exports.CapturedFrame = CapturedFrame; - - var Frame = (function () { - function Frame(ops) { - var component = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; - var manager = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; - var shadow = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3]; - - this.component = component; - this.manager = manager; - this.shadow = shadow; - this.operand = null; - this.immediate = null; - this.args = null; - this.callerScope = null; - this.blocks = null; - this.condition = null; - this.iterator = null; - this.key = null; - this.ops = ops; - this.op = ops.head(); + node = node.parentNode; } - Frame.prototype.capture = function capture() { - return new CapturedFrame(this.operand, this.args, this.condition); - }; - - Frame.prototype.restore = function restore(frame) { - this.operand = frame['operand']; - this.args = frame['args']; - this.condition = frame['condition']; - }; - - return Frame; - })(); + return true; + })()); + } else { + target = selector; - var FrameStack = (function () { - function FrameStack() { - this.frames = []; - this.frame = undefined; - } + _emberMetal.assert('You tried to append to a selector string (' + selector + ') in an environment without jQuery', typeof target !== 'string'); + _emberMetal.assert('You tried to append to a non-Element (' + selector + ') in an environment without jQuery', typeof selector.appendChild === 'function'); + } - FrameStack.prototype.push = function push(ops) { - var component = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; - var manager = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; - var shadow = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3]; + this.renderer.appendTo(this, target); - var frame = this.frame === undefined ? this.frame = 0 : ++this.frame; - if (this.frames.length <= frame) { - this.frames.push(null); - } - this.frames[frame] = new Frame(ops, component, manager, shadow); - }; + return this; + }, _Mixin$create.renderToElement = function () { + var tagName = arguments.length <= 0 || arguments[0] === undefined ? 'body' : arguments[0]; - FrameStack.prototype.pop = function pop() { - var frames = this.frames; - var frame = this.frame; + _emberMetal.deprecate('Using the `renderToElement` is deprecated in favor of `appendTo`. Called in ' + this.toString(), false, { + id: 'ember-views.render-to-element', + until: '2.12.0', + url: 'http://emberjs.com/deprecations/v2.x#toc_code-rendertoelement-code' + }); - frames[frame] = null; - this.frame = frame === 0 ? undefined : frame - 1; - }; + var element = this.renderer.createElement(tagName); - FrameStack.prototype.capture = function capture() { - return this.frames[this.frame].capture(); - }; + this.renderer.appendTo(this, element); + return element; + }, _Mixin$create.replaceIn = function (selector) { + var target = _emberViewsSystemJquery.default(selector); - FrameStack.prototype.restore = function restore(frame) { - this.frames[this.frame].restore(frame); - }; + _emberMetal.assert('You tried to replace in (' + selector + ') but that isn\'t in the DOM', target.length > 0); + _emberMetal.assert('You cannot replace an existing Ember.View.', !target.is('.ember-view') && !target.parents().is('.ember-view')); - FrameStack.prototype.getOps = function getOps() { - return this.frames[this.frame].ops; - }; + this.renderer.replaceIn(this, target[0]); - FrameStack.prototype.getCurrent = function getCurrent() { - return this.frames[this.frame].op; - }; + return this; + }, _Mixin$create.append = function () { + return this.appendTo(document.body); + }, _Mixin$create.elementId = null, _Mixin$create.findElementInParentElement = function (parentElem) { + var id = '#' + this.elementId; + return _emberViewsSystemJquery.default(id)[0] || _emberViewsSystemJquery.default(id, parentElem)[0]; + }, _Mixin$create.willInsertElement = K, _Mixin$create.didInsertElement = K, _Mixin$create.willClearRender = K, _Mixin$create.destroy = function () { + this._super.apply(this, arguments); + this._currentState.destroy(this); + }, _Mixin$create.willDestroyElement = K, _Mixin$create.parentViewDidChange = K, _Mixin$create.tagName = null, _Mixin$create.init = function () { + this._super.apply(this, arguments); - FrameStack.prototype.setCurrent = function setCurrent(op) { - return this.frames[this.frame].op = op; - }; + if (!this.elementId && this.tagName !== '') { + this.elementId = _emberUtils.guidFor(this); + } - FrameStack.prototype.getOperand = function getOperand() { - return this.frames[this.frame].operand; - }; + // if we find an `eventManager` property, deopt the + // `EventDispatcher`'s `canDispatchToEventManager` property + // if `null` + if (this.eventManager) { + var owner = _emberUtils.getOwner(this); + var dispatcher = owner && owner.lookup('event_dispatcher:main'); - FrameStack.prototype.setOperand = function setOperand(operand) { - return this.frames[this.frame].operand = operand; - }; + if (dispatcher && dispatcher.canDispatchToEventManager === null) { + dispatcher.canDispatchToEventManager = true; + } + } - FrameStack.prototype.getImmediate = function getImmediate() { - return this.frames[this.frame].immediate; - }; + _emberMetal.deprecate('[DEPRECATED] didInitAttrs called in ' + this.toString() + '.', typeof this.didInitAttrs !== 'function', { + id: 'ember-views.did-init-attrs', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x#toc_ember-component-didinitattrs' + }); - FrameStack.prototype.setImmediate = function setImmediate(value) { - return this.frames[this.frame].immediate = value; - }; + _emberMetal.deprecate('[DEPRECATED] Ember will stop passing arguments to component lifecycle hooks. Please change `' + this.toString() + '#didInitAttrs` to stop taking arguments.', typeof this.didInitAttrs !== 'function' || this.didInitAttrs.length === 0, { + id: 'ember-views.lifecycle-hook-arguments', + until: '2.13.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_arguments-in-component-lifecycle-hooks' + }); - FrameStack.prototype.getArgs = function getArgs() { - return this.frames[this.frame].args; - }; + _emberMetal.deprecate('[DEPRECATED] Ember will stop passing arguments to component lifecycle hooks. Please change `' + this.toString() + '#didReceiveAttrs` to stop taking arguments.', typeof this.didReceiveAttrs !== 'function' || this.didReceiveAttrs.length === 0, { + id: 'ember-views.lifecycle-hook-arguments', + until: '2.13.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_arguments-in-component-lifecycle-hooks' + }); - FrameStack.prototype.setArgs = function setArgs(args) { - var frame = this.frames[this.frame]; - return frame.args = args; - }; + _emberMetal.deprecate('[DEPRECATED] Ember will stop passing arguments to component lifecycle hooks. Please change `' + this.toString() + '#didUpdateAttrs` to stop taking arguments.', typeof this.didUpdateAttrs !== 'function' || this.didUpdateAttrs.length === 0, { + id: 'ember-views.lifecycle-hook-arguments', + until: '2.13.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_arguments-in-component-lifecycle-hooks' + }); - FrameStack.prototype.getCondition = function getCondition() { - return this.frames[this.frame].condition; - }; + _emberMetal.assert('Using a custom `.render` function is no longer supported.', !this.render); + }, _Mixin$create.__defineNonEnumerable = function (property) { + this[property.name] = property.descriptor.value; + }, _Mixin$create.handleEvent = function (eventName, evt) { + return this._currentState.handleEvent(this, eventName, evt); + }, _Mixin$create)); +}); - FrameStack.prototype.setCondition = function setCondition(condition) { - return this.frames[this.frame].condition = condition; - }; +// .......................................................... +// TEMPLATE SUPPORT +// - FrameStack.prototype.getIterator = function getIterator() { - return this.frames[this.frame].iterator; - }; +/** + Return the nearest ancestor that is an instance of the provided + class or mixin. + @method nearestOfType + @param {Class,Mixin} klass Subclass of Ember.View (or Ember.View itself), + or an instance of Ember.Mixin. + @return Ember.View + @deprecated use `yield` and contextual components for composition instead. + @private +*/ - FrameStack.prototype.setIterator = function setIterator(iterator) { - return this.frames[this.frame].iterator = iterator; - }; +/** + Return the nearest ancestor that has a given property. + @method nearestWithProperty + @param {String} property A property name + @return Ember.View + @deprecated use `yield` and contextual components for composition instead. + @private +*/ - FrameStack.prototype.getKey = function getKey() { - return this.frames[this.frame].key; - }; +/** + Renders the view again. This will work regardless of whether the + view is already in the DOM or not. If the view is in the DOM, the + rendering process will be deferred to give bindings a chance + to synchronize. + If children were added during the rendering process using `appendChild`, + `rerender` will remove them, because they will be added again + if needed by the next `render`. + In general, if the display of your view changes, you should modify + the DOM element directly instead of manually calling `rerender`, which can + be slow. + @method rerender + @public +*/ - FrameStack.prototype.setKey = function setKey(key) { - return this.frames[this.frame].key = key; - }; +// .......................................................... +// ELEMENT SUPPORT +// - FrameStack.prototype.getBlocks = function getBlocks() { - return this.frames[this.frame].blocks; - }; +/** + Returns the current DOM element for the view. + @property element + @type DOMElement + @public +*/ - FrameStack.prototype.setBlocks = function setBlocks(blocks) { - return this.frames[this.frame].blocks = blocks; - }; +/** + Returns a jQuery object for this view's element. If you pass in a selector + string, this method will return a jQuery object, using the current element + as its buffer. + For example, calling `view.$('li')` will return a jQuery object containing + all of the `li` elements inside the DOM element of this view. + @method $ + @param {String} [selector] a jQuery-compatible selector string + @return {jQuery} the jQuery object for the DOM node + @public +*/ - FrameStack.prototype.getCallerScope = function getCallerScope() { - return this.frames[this.frame].callerScope; - }; +/** + Appends the view's element to the specified parent element. + Note that this method just schedules the view to be appended; the DOM + element will not be appended to the given element until all bindings have + finished synchronizing. + This is not typically a function that you will need to call directly when + building your application. If you do need to use `appendTo`, be sure that + the target element you are providing is associated with an `Ember.Application` + and does not have an ancestor element that is associated with an Ember view. + @method appendTo + @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object + @return {Ember.View} receiver + @private +*/ - FrameStack.prototype.setCallerScope = function setCallerScope(callerScope) { - return this.frames[this.frame].callerScope = callerScope; - }; +/** + 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 + let element = view.renderToElement(); + element.tagName; // => "BODY" + ``` + You can override the kind of element rendered into and returned by + specifying an optional tag name as the first argument. + ```js + let element = view.renderToElement('table'); + element.tagName; // => "TABLE" + ``` + This method is useful if you want to render the view into an element that + is not in the document's body. Instead, a new `body` element, detached from + the DOM is returned. FastBoot uses this to serialize the rendered view into + a string for transmission over the network. + ```js + app.visit('/').then(function(instance) { + let element; + Ember.run(function() { + element = renderToElement(instance); + }); + res.send(serialize(element)); + }); + ``` + @method renderToElement + @param {String} tagName The tag of the element to create and render into. Defaults to "body". + @return {HTMLBodyElement} element + @deprecated Use appendTo instead. + @private +*/ - FrameStack.prototype.getComponent = function getComponent() { - return this.frames[this.frame].component; - }; +/** + Replaces the content of the specified parent element with this view's + element. If the view does not have an HTML representation yet, + the element will be generated automatically. + Note that this method just schedules the view to be appended; the DOM + element will not be appended to the given element until all bindings have + finished synchronizing + @method replaceIn + @param {String|DOMElement|jQuery} target A selector, element, HTML string, or jQuery object + @return {Ember.View} received + @private +*/ - FrameStack.prototype.getManager = function getManager() { - return this.frames[this.frame].manager; - }; +/** + Appends the view's element to the document body. If the view does + not have an HTML representation yet + the element will be generated automatically. + If your application uses the `rootElement` property, you must append + the view within that element. Rendering views outside of the `rootElement` + is not supported. + Note that this method just schedules the view to be appended; the DOM + element will not be appended to the document body until all bindings have + finished synchronizing. + @method append + @return {Ember.View} receiver + @private +*/ - FrameStack.prototype.getShadow = function getShadow() { - return this.frames[this.frame].shadow; - }; +/** + The HTML `id` of the view's element in the DOM. You can provide this + value yourself but it must be unique (just as in HTML): + ```handlebars + {{my-component elementId="a-really-cool-id"}} + ``` + If not manually set a default value will be provided by the framework. + Once rendered an element's `elementId` is considered immutable and you + should never change it. If you need to compute a dynamic value for the + `elementId`, you should do this when the component or element is being + instantiated: + ```javascript + export default Ember.Component.extend({ + init() { + this._super(...arguments); + let index = this.get('index'); + this.set('elementId', 'component-id' + index); + } + }); + ``` + @property elementId + @type String + @public +*/ - FrameStack.prototype.goto = function goto(op) { - this.setCurrent(op); - }; +/** + Attempts to discover the element in the parent element. The default + implementation looks for an element with an ID of `elementId` (or the + view's guid if `elementId` is null). You can override this method to + provide your own form of lookup. For example, if you want to discover your + element using a CSS class name instead of an ID. + @method findElementInParentElement + @param {DOMElement} parentElement The parent's DOM element + @return {DOMElement} The discovered element + @private +*/ - FrameStack.prototype.hasOpcodes = function hasOpcodes() { - return this.frame !== undefined; - }; +/** + Called when a view is going to insert an element into the DOM. + @event willInsertElement + @public +*/ - FrameStack.prototype.nextStatement = function nextStatement() { - var op = this.frames[this.frame].op; - var ops = this.getOps(); - if (op) { - this.setCurrent(ops.nextNode(op)); - return op; - } else { - this.pop(); - return null; - } - }; +/** + Called when the element of the view has been inserted into the DOM. + Override this function to do any set up that requires an element + in the document body. + When a view has children, didInsertElement will be called on the + child view(s) first and on itself afterwards. + @event didInsertElement + @public +*/ - return FrameStack; - })(); +/** + Called when the view is about to rerender, but before anything has + been torn down. This is a good opportunity to tear down any manual + observers you have installed based on the DOM state + @event willClearRender + @public +*/ - exports.FrameStack = FrameStack; -}); +/** + You must call `destroy` on a view to destroy the view (and all of its + child views). This will remove the view from any parent node, then make + sure that the DOM element managed by the view can be released by the + memory manager. + @method destroy + @private +*/ -enifed('glimmer-runtime/lib/vm/render-result', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/vm/update'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibVmUpdate) { - 'use strict'; +/** + Called when the element of the view is going to be destroyed. Override + this function to do any teardown that requires an element, like removing + event listeners. + Please note: any property changes made during this event will have no + effect on object observers. + @event willDestroyElement + @public +*/ - var RenderResult = (function () { - function RenderResult(env, updating, bounds) { - this.env = env; - this.updating = updating; - this.bounds = bounds; - } +/** + Called when the parentView property has changed. + @event parentViewDidChange + @private +*/ - RenderResult.prototype.rerender = function rerender() { - var _ref = arguments.length <= 0 || arguments[0] === undefined ? { alwaysRevalidate: false } : arguments[0]; +// .......................................................... +// STANDARD RENDER PROPERTIES +// - var _ref$alwaysRevalidate = _ref.alwaysRevalidate; - var alwaysRevalidate = _ref$alwaysRevalidate === undefined ? false : _ref$alwaysRevalidate; - var env = this.env; - var updating = this.updating; +/** + Tag name for the view's outer element. The tag name is only used when an + element is first created. If you change the `tagName` for an element, you + must destroy and recreate the view element. + By default, the render buffer will use a `
    ` tag for views. + @property tagName + @type String + @default null + @public +*/ - var vm = new _glimmerRuntimeLibVmUpdate.default(env, { alwaysRevalidate: alwaysRevalidate }); - vm.execute(updating, this); - }; +// We leave this null by default so we can tell the difference between +// the default case and a user-specified tag. - RenderResult.prototype.parentElement = function parentElement() { - return this.bounds.parentElement(); - }; +// ....................................................... +// CORE DISPLAY METHODS +// - RenderResult.prototype.firstNode = function firstNode() { - return this.bounds.firstNode(); - }; +/** + Setup a view, but do not finish waking it up. + * configure `childViews` + * register the view with the global views hash, which is used for event + dispatch + @method init + @private +*/ - RenderResult.prototype.lastNode = function lastNode() { - return this.bounds.lastNode(); - }; +// ....................................................... +// EVENT HANDLING +// - RenderResult.prototype.opcodes = function opcodes() { - return this.updating; - }; +/** + Handle events from `Ember.EventDispatcher` + @method handleEvent + @param eventName {String} + @param evt {Event} + @private +*/ +enifed("ember-views/system/action_manager", ["exports"], function (exports) { + /** + @module ember + @submodule ember-views + */ - RenderResult.prototype.handleException = function handleException() { - throw "this should never happen"; - }; + "use strict"; - RenderResult.prototype.destroy = function destroy() { - this.bounds.destroy(); - _glimmerRuntimeLibBounds.clear(this.bounds); - }; + exports.default = ActionManager; - return RenderResult; - })(); + function ActionManager() {} - exports.default = RenderResult; + /** + Global action id hash. + + @private + @property registeredActions + @type Object + */ + ActionManager.registeredActions = {}; }); +enifed('ember-views/system/event_dispatcher', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-views/system/jquery', 'ember-views/system/action_manager', 'ember-environment', 'ember-views/compat/fallback-view-registry'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberViewsSystemJquery, _emberViewsSystemAction_manager, _emberEnvironment, _emberViewsCompatFallbackViewRegistry) { + /** + @module ember + @submodule ember-views + */ -enifed('glimmer-runtime/lib/vm/update', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/builder', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/vm/append'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibBuilder, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibVmAppend) { - 'use strict'; + 'use strict'; - var UpdatingVM = (function () { - function UpdatingVM(env, _ref) { - var _ref$alwaysRevalidate = _ref.alwaysRevalidate; - var alwaysRevalidate = _ref$alwaysRevalidate === undefined ? false : _ref$alwaysRevalidate; + var ROOT_ELEMENT_CLASS = 'ember-application'; + var ROOT_ELEMENT_SELECTOR = '.' + ROOT_ELEMENT_CLASS; - this.frameStack = new _glimmerUtil.Stack(); - this.env = env; - this.dom = env.getDOM(); - this.alwaysRevalidate = alwaysRevalidate; - } + /** + `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 + called. + + @class EventDispatcher + @namespace Ember + @private + @extends Ember.Object + */ + exports.default = _emberRuntime.Object.extend({ - UpdatingVM.prototype.execute = function execute(opcodes, handler) { - var frameStack = this.frameStack; + /** + The set of events names (and associated handler function names) to be setup + and dispatched by the `EventDispatcher`. Modifications to this list can be done + at setup time, generally via the `Ember.Application.customEvents` hash. + To add new events to be listened to: + ```javascript + let App = Ember.Application.create({ + customEvents: { + paste: 'paste' + } + }); + ``` + To prevent default events from being listened to: + ```javascript + let App = Ember.Application.create({ + customEvents: { + mouseenter: null, + mouseleave: null + } + }); + ``` + @property events + @type Object + @private + */ + events: { + touchstart: 'touchStart', + touchmove: 'touchMove', + touchend: 'touchEnd', + touchcancel: 'touchCancel', + keydown: 'keyDown', + keyup: 'keyUp', + keypress: 'keyPress', + mousedown: 'mouseDown', + mouseup: 'mouseUp', + contextmenu: 'contextMenu', + click: 'click', + dblclick: 'doubleClick', + mousemove: 'mouseMove', + focusin: 'focusIn', + focusout: 'focusOut', + mouseenter: 'mouseEnter', + mouseleave: 'mouseLeave', + submit: 'submit', + input: 'input', + change: 'change', + dragstart: 'dragStart', + drag: 'drag', + dragenter: 'dragEnter', + dragleave: 'dragLeave', + dragover: 'dragOver', + drop: 'drop', + dragend: 'dragEnd' + }, - this.try(opcodes, handler); - while (true) { - if (frameStack.isEmpty()) break; - var opcode = this.frameStack.current.nextStatement(); - if (opcode === null) { - this.frameStack.pop(); - continue; - } - _glimmerUtil.LOGGER.debug('[VM] OP ' + opcode.type); - _glimmerUtil.LOGGER.trace(opcode); - opcode.evaluate(this); - } - }; + /** + The root DOM element to which event listeners should be attached. Event + listeners will be attached to the document unless this is overridden. + Can be specified as a DOMElement or a selector string. + The default body is a string since this may be evaluated before document.body + exists in the DOM. + @private + @property rootElement + @type DOMElement + @default 'body' + */ + rootElement: 'body', - UpdatingVM.prototype.goto = function goto(op) { - this.frameStack.current.goto(op); - }; + /** + It enables events to be dispatched to the view's `eventManager.` When present, + this object takes precedence over handling of events on the view itself. + Note that most Ember applications do not use this feature. If your app also + does not use it, consider setting this property to false to gain some performance + improvement by allowing the EventDispatcher to skip the search for the + `eventManager` on the view tree. + ```javascript + let EventDispatcher = Em.EventDispatcher.extend({ + events: { + click : 'click', + focusin : 'focusIn', + focusout : 'focusOut', + change : 'change' + }, + canDispatchToEventManager: false + }); + container.register('event_dispatcher:main', EventDispatcher); + ``` + @property canDispatchToEventManager + @type boolean + @default false + @since 1.7.0 + @private + */ + canDispatchToEventManager: null, - UpdatingVM.prototype.try = function _try(ops, handler) { - this.frameStack.push(new UpdatingVMFrame(this, ops, handler)); - }; + init: function () { + this._super(); + _emberMetal.assert('EventDispatcher should never be instantiated in fastboot mode. Please report this as an Ember bug.', _emberEnvironment.environment.hasDOM); + }, - UpdatingVM.prototype.throw = function _throw() { - this.frameStack.current.handleException(); - this.frameStack.pop(); - }; + /** + Sets up event listeners for standard browser events. + This will be called after the browser sends a `DOMContentReady` event. By + default, it will set up all of the listeners on the document body. If you + would like to register the listeners on a different element, set the event + dispatcher's `root` property. + @private + @method setup + @param addedEvents {Object} + */ + setup: function (addedEvents, rootElement) { + var event = undefined; + var events = this._finalEvents = _emberUtils.assign({}, _emberMetal.get(this, 'events'), addedEvents); - UpdatingVM.prototype.evaluateOpcode = function evaluateOpcode(opcode) { - opcode.evaluate(this); - }; + if (_emberMetal.isNone(rootElement)) { + rootElement = _emberMetal.get(this, 'rootElement'); + } else { + _emberMetal.set(this, 'rootElement', rootElement); + } - return UpdatingVM; - })(); + rootElement = _emberViewsSystemJquery.default(rootElement); - exports.default = UpdatingVM; + _emberMetal.assert('You cannot use the same root element (' + (rootElement.selector || rootElement[0].tagName) + ') multiple times in an Ember.Application', !rootElement.is(ROOT_ELEMENT_SELECTOR)); + _emberMetal.assert('You cannot make a new Ember.Application using a root element that is a descendent of an existing Ember.Application', !rootElement.closest(ROOT_ELEMENT_SELECTOR).length); + _emberMetal.assert('You cannot make a new Ember.Application using a root element that is an ancestor of an existing Ember.Application', !rootElement.find(ROOT_ELEMENT_SELECTOR).length); - var BlockOpcode = (function (_UpdatingOpcode) { - babelHelpers.inherits(BlockOpcode, _UpdatingOpcode); + rootElement.addClass(ROOT_ELEMENT_CLASS); - function BlockOpcode(ops, state, bounds, children) { - _UpdatingOpcode.call(this); - this.type = "block"; - this.next = null; - this.prev = null; - var env = state.env; - var scope = state.scope; - var dynamicScope = state.dynamicScope; - var frame = state.frame; + if (!rootElement.is(ROOT_ELEMENT_SELECTOR)) { + throw new TypeError('Unable to add \'' + ROOT_ELEMENT_CLASS + '\' class to root element (' + (rootElement.selector || rootElement[0].tagName) + '). Make sure you set rootElement to the body or an element in the body.'); + } - this.ops = ops; - this.children = children; - this.env = env; - this.scope = scope; - this.dynamicScope = dynamicScope; - this.frame = frame; - this.bounds = bounds; + for (event in events) { + if (events.hasOwnProperty(event)) { + this.setupHandler(rootElement, event, events[event]); } + } + }, - BlockOpcode.prototype.parentElement = function parentElement() { - return this.bounds.parentElement(); - }; + /** + Registers an event listener on the rootElement. If the given event is + triggered, the provided event handler will be triggered on the target view. + If the target view does not implement the event handler, or if the handler + returns `false`, the parent view will be called. The event will continue to + bubble to each successive parent view until it reaches the top. + @private + @method setupHandler + @param {Element} rootElement + @param {String} event the browser-originated event to listen to + @param {String} eventName the name of the method to call on the view + */ + setupHandler: function (rootElement, event, eventName) { + var self = this; - BlockOpcode.prototype.firstNode = function firstNode() { - return this.bounds.firstNode(); - }; + var owner = _emberUtils.getOwner(this); + var viewRegistry = owner && owner.lookup('-view-registry:main') || _emberViewsCompatFallbackViewRegistry.default; - BlockOpcode.prototype.lastNode = function lastNode() { - return this.bounds.lastNode(); - }; + if (eventName === null) { + return; + } - BlockOpcode.prototype.evaluate = function evaluate(vm) { - vm.try(this.children, null); - }; + rootElement.on(event + '.ember', '.ember-view', function (evt, triggeringManager) { + var view = viewRegistry[this.id]; + var result = true; - BlockOpcode.prototype.destroy = function destroy() { - this.bounds.destroy(); - }; + var manager = self.canDispatchToEventManager ? self._findNearestEventManager(view, eventName) : null; - BlockOpcode.prototype.didDestroy = function didDestroy() { - this.env.didDestroy(this.bounds); - }; + if (manager && manager !== triggeringManager) { + result = self._dispatchEvent(manager, evt, eventName, view); + } else if (view) { + result = self._bubbleEvent(view, evt, eventName); + } - BlockOpcode.prototype.toJSON = function toJSON() { - var begin = this.ops.head(); - var end = this.ops.tail(); - var details = _glimmerUtil.dict(); - details["guid"] = '' + this._guid; - details["begin"] = begin.inspect(); - details["end"] = end.inspect(); - return { - guid: this._guid, - type: this.type, - details: details, - children: this.children.toArray().map(function (op) { - return op.toJSON(); - }) - }; - }; + return result; + }); - return BlockOpcode; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + rootElement.on(event + '.ember', '[data-ember-action]', function (evt) { + var attributes = evt.currentTarget.attributes; - exports.BlockOpcode = BlockOpcode; + for (var i = 0; i < attributes.length; i++) { + var attr = attributes.item(i); + var attrName = attr.name; - var TryOpcode = (function (_BlockOpcode) { - babelHelpers.inherits(TryOpcode, _BlockOpcode); + if (attrName.lastIndexOf('data-ember-action-', 0) !== -1) { + var action = _emberViewsSystemAction_manager.default.registeredActions[attr.value]; - function TryOpcode(ops, state, bounds, children) { - _BlockOpcode.call(this, ops, state, bounds, children); - this.type = "try"; - this.tag = this._tag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); + if (action.eventName === eventName) { + action.handler(evt); + } + } } + }); + }, - TryOpcode.prototype.didInitializeChildren = function didInitializeChildren() { - this._tag.update(_glimmerReference.combineSlice(this.children)); - }; + _findNearestEventManager: function (view, eventName) { + var manager = null; - TryOpcode.prototype.evaluate = function evaluate(vm) { - vm.try(this.children, this); - }; + while (view) { + manager = _emberMetal.get(view, 'eventManager'); + if (manager && manager[eventName]) { + break; + } - TryOpcode.prototype.handleException = function handleException() { - var env = this.env; - var scope = this.scope; - var ops = this.ops; - var dynamicScope = this.dynamicScope; - var frame = this.frame; - - var elementStack = _glimmerRuntimeLibBuilder.ElementStack.resume(this.env, this.bounds, this.bounds.reset(env)); - var vm = new _glimmerRuntimeLibVmAppend.default(env, scope, dynamicScope, elementStack); - var result = vm.resume(ops, frame); - this.children = result.opcodes(); - this.didInitializeChildren(); - }; + view = _emberMetal.get(view, 'parentView'); + } - TryOpcode.prototype.toJSON = function toJSON() { - var json = _BlockOpcode.prototype.toJSON.call(this); - var begin = this.ops.head(); - var end = this.ops.tail(); - json["details"]["begin"] = JSON.stringify(begin.inspect()); - json["details"]["end"] = JSON.stringify(end.inspect()); - return _BlockOpcode.prototype.toJSON.call(this); - }; + return manager; + }, - return TryOpcode; - })(BlockOpcode); + _dispatchEvent: function (object, evt, eventName, view) { + var result = true; - exports.TryOpcode = TryOpcode; + var handler = object[eventName]; + if (typeof handler === 'function') { + result = _emberMetal.run(object, handler, evt, view); + // Do not preventDefault in eventManagers. + evt.stopPropagation(); + } else { + result = this._bubbleEvent(view, evt, eventName); + } - var ListRevalidationDelegate = (function () { - function ListRevalidationDelegate(opcode, marker) { - this.opcode = opcode; - this.marker = marker; - this.didInsert = false; - this.didDelete = false; - this.map = opcode.map; - this.updating = opcode['children']; - } + return result; + }, - ListRevalidationDelegate.prototype.insert = function insert(key, item, memo, before) { - var map = this.map; - var opcode = this.opcode; - var updating = this.updating; + _bubbleEvent: function (view, evt, eventName) { + return view.handleEvent(eventName, evt); + }, - var nextSibling = null; - var reference = null; - if (before) { - reference = map[before]; - nextSibling = reference.bounds.firstNode(); - } else { - nextSibling = this.marker; - } - var vm = opcode.vmForInsertion(nextSibling); - var tryOpcode = undefined; - vm.execute(opcode.ops, function (vm) { - vm.frame.setArgs(_glimmerRuntimeLibCompiledExpressionsArgs.EvaluatedArgs.positional([item, memo])); - vm.frame.setOperand(item); - vm.frame.setCondition(new _glimmerReference.ConstReference(true)); - vm.frame.setKey(key); - var state = vm.capture(); - var tracker = vm.stack().pushUpdatableBlock(); - tryOpcode = new TryOpcode(opcode.ops, state, tracker, vm.updatingOpcodeStack.current); - }); - tryOpcode.didInitializeChildren(); - updating.insertBefore(tryOpcode, reference); - map[key] = tryOpcode; - this.didInsert = true; - }; + destroy: function () { + var rootElement = _emberMetal.get(this, 'rootElement'); + _emberViewsSystemJquery.default(rootElement).off('.ember', '**').removeClass(ROOT_ELEMENT_CLASS); + return this._super.apply(this, arguments); + }, - ListRevalidationDelegate.prototype.retain = function retain(key, item, memo) {}; + toString: function () { + return '(EventDispatcher)'; + } + }); +}); +enifed('ember-views/system/ext', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-views + */ - ListRevalidationDelegate.prototype.move = function move(key, item, memo, before) { - var map = this.map; - var updating = this.updating; + 'use strict'; - var entry = map[key]; - var reference = map[before] || null; - if (before) { - _glimmerRuntimeLibBounds.move(entry, reference.firstNode()); - } else { - _glimmerRuntimeLibBounds.move(entry, this.marker); - } - updating.remove(entry); - updating.insertBefore(entry, reference); - }; + // Add a new named queue for rendering views that happens + // after bindings have synced, and a queue for scheduling actions + // that should occur after view rendering. + _emberMetal.run._addQueue('render', 'actions'); + _emberMetal.run._addQueue('afterRender', 'render'); +}); +enifed('ember-views/system/jquery', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { + 'use strict'; - ListRevalidationDelegate.prototype.delete = function _delete(key) { - var map = this.map; + var jQuery = undefined; - var opcode = map[key]; - opcode.didDestroy(); - _glimmerRuntimeLibBounds.clear(opcode); - this.updating.remove(opcode); - delete map[key]; - this.didDelete = true; - }; + if (_emberEnvironment.environment.hasDOM) { + jQuery = _emberEnvironment.context.imports.jQuery; - ListRevalidationDelegate.prototype.done = function done() { - this.opcode.didInitializeChildren(this.didInsert || this.didDelete); - }; + if (jQuery) { + if (jQuery.event.addProp) { + jQuery.event.addProp('dataTransfer'); + } else { + // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dndevents + ['dragstart', 'drag', 'dragenter', 'dragleave', 'dragover', 'drop', 'dragend'].forEach(function (eventName) { + jQuery.event.fixHooks[eventName] = { + props: ['dataTransfer'] + }; + }); + } + } + } - return ListRevalidationDelegate; - })(); + exports.default = jQuery; +}); +enifed('ember-views/system/lookup_partial', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - var ListBlockOpcode = (function (_BlockOpcode2) { - babelHelpers.inherits(ListBlockOpcode, _BlockOpcode2); + exports.default = lookupPartial; + exports.hasPartial = hasPartial; - function ListBlockOpcode(ops, state, bounds, children, artifacts) { - _BlockOpcode2.call(this, ops, state, bounds, children); - this.type = "list-block"; - this.map = _glimmerUtil.dict(); - this.lastIterated = _glimmerReference.INITIAL; - this.artifacts = artifacts; - var _tag = this._tag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - this.tag = _glimmerReference.combine([artifacts.tag, _tag]); - } + function parseUnderscoredName(templateName) { + var nameParts = templateName.split('/'); + var lastPart = nameParts[nameParts.length - 1]; - ListBlockOpcode.prototype.didInitializeChildren = function didInitializeChildren() { - var listDidChange = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0]; + nameParts[nameParts.length - 1] = '_' + lastPart; - this.lastIterated = this.artifacts.tag.value(); - if (listDidChange) { - this._tag.update(_glimmerReference.combineSlice(this.children)); - } - }; + return nameParts.join('/'); + } - ListBlockOpcode.prototype.evaluate = function evaluate(vm) { - var artifacts = this.artifacts; - var lastIterated = this.lastIterated; - - if (!artifacts.tag.validate(lastIterated)) { - var bounds = this.bounds; - var dom = vm.dom; - - var marker = dom.createComment(''); - dom.insertAfter(bounds.parentElement(), marker, bounds.lastNode()); - var target = new ListRevalidationDelegate(this, marker); - var synchronizer = new _glimmerReference.IteratorSynchronizer({ target: target, artifacts: artifacts }); - synchronizer.sync(); - this.parentElement().removeChild(marker); - } - // Run now-updated updating opcodes - _BlockOpcode2.prototype.evaluate.call(this, vm); - }; + function lookupPartial(templateName, owner) { + if (templateName == null) { + return; + } - ListBlockOpcode.prototype.vmForInsertion = function vmForInsertion(nextSibling) { - var env = this.env; - var scope = this.scope; - var dynamicScope = this.dynamicScope; + var template = templateFor(owner, parseUnderscoredName(templateName), templateName); - var elementStack = _glimmerRuntimeLibBuilder.ElementStack.forInitialRender(this.env, this.bounds.parentElement(), nextSibling); - return new _glimmerRuntimeLibVmAppend.default(env, scope, dynamicScope, elementStack); - }; + _emberMetal.assert('Unable to find partial with name "' + templateName + '"', !!template); - ListBlockOpcode.prototype.toJSON = function toJSON() { - var json = _BlockOpcode2.prototype.toJSON.call(this); - var map = this.map; - var inner = Object.keys(map).map(function (key) { - return JSON.stringify(key) + ': ' + map[key]._guid; - }).join(", "); - json["details"]["map"] = '{' + inner + '}'; - return json; - }; + return template; + } - return ListBlockOpcode; - })(BlockOpcode); + function hasPartial(name, owner) { + if (!owner) { + throw new _emberMetal.Error('Container was not found when looking up a views template. ' + 'This is most likely due to manually instantiating an Ember.View. ' + 'See: http://git.io/EKPpnA'); + } - exports.ListBlockOpcode = ListBlockOpcode; + return owner.hasRegistration('template:' + parseUnderscoredName(name)) || owner.hasRegistration('template:' + name); + } - var UpdatingVMFrame = (function () { - function UpdatingVMFrame(vm, ops, handler) { - this.vm = vm; - this.ops = ops; - this.current = ops.head(); - this.exceptionHandler = handler; - } + function templateFor(owner, underscored, name) { + if (!name) { + return; + } + _emberMetal.assert('templateNames are not allowed to contain periods: ' + name, name.indexOf('.') === -1); - UpdatingVMFrame.prototype.goto = function goto(op) { - this.current = op; - }; + if (!owner) { + throw new _emberMetal.Error('Container was not found when looking up a views template. ' + 'This is most likely due to manually instantiating an Ember.View. ' + 'See: http://git.io/EKPpnA'); + } - UpdatingVMFrame.prototype.nextStatement = function nextStatement() { - var current = this.current; - var ops = this.ops; + return owner.lookup('template:' + underscored) || owner.lookup('template:' + name); + } +}); +enifed('ember-views/system/utils', ['exports', 'ember-utils'], function (exports, _emberUtils) { + /* globals Element */ + 'use strict'; - if (current) this.current = ops.nextNode(current); - return current; - }; + exports.isSimpleClick = isSimpleClick; + exports.getRootViews = getRootViews; + exports.getViewId = getViewId; + exports.getViewElement = getViewElement; + exports.initViewElement = initViewElement; + exports.setViewElement = setViewElement; + exports.getChildViews = getChildViews; + exports.initChildViews = initChildViews; + exports.addChildView = addChildView; + exports.collectChildViews = collectChildViews; + exports.getViewBounds = getViewBounds; + exports.getViewRange = getViewRange; + exports.getViewClientRects = getViewClientRects; + exports.getViewBoundingClientRect = getViewBoundingClientRect; + exports.matches = matches; - UpdatingVMFrame.prototype.handleException = function handleException() { - this.exceptionHandler.handleException(); - }; + /** + @module ember + @submodule ember-views + */ - return UpdatingVMFrame; - })(); -}); + function isSimpleClick(event) { + var modifier = event.shiftKey || event.metaKey || event.altKey || event.ctrlKey; + var secondaryClick = event.which > 1; // IE9 may return undefined -enifed('glimmer-util/index', ['exports', 'glimmer-util/lib/namespaces', 'glimmer-util/lib/platform-utils', 'glimmer-util/lib/assert', 'glimmer-util/lib/logger', 'glimmer-util/lib/object-utils', 'glimmer-util/lib/guid', 'glimmer-util/lib/collections', 'glimmer-util/lib/list-utils'], function (exports, _glimmerUtilLibNamespaces, _glimmerUtilLibPlatformUtils, _glimmerUtilLibAssert, _glimmerUtilLibLogger, _glimmerUtilLibObjectUtils, _glimmerUtilLibGuid, _glimmerUtilLibCollections, _glimmerUtilLibListUtils) { - 'use strict'; + return !modifier && !secondaryClick; + } - exports.getAttrNamespace = _glimmerUtilLibNamespaces.getAttrNamespace; - exports.Option = _glimmerUtilLibPlatformUtils.Option; - exports.Maybe = _glimmerUtilLibPlatformUtils.Maybe; - exports.Opaque = _glimmerUtilLibPlatformUtils.Opaque; - exports.assert = _glimmerUtilLibAssert.default; - exports.LOGGER = _glimmerUtilLibLogger.default; - exports.Logger = _glimmerUtilLibLogger.Logger; - exports.LogLevel = _glimmerUtilLibLogger.LogLevel; - exports.assign = _glimmerUtilLibObjectUtils.assign; - exports.ensureGuid = _glimmerUtilLibGuid.ensureGuid; - exports.initializeGuid = _glimmerUtilLibGuid.initializeGuid; - exports.HasGuid = _glimmerUtilLibGuid.HasGuid; - exports.Stack = _glimmerUtilLibCollections.Stack; - exports.Dict = _glimmerUtilLibCollections.Dict; - exports.Set = _glimmerUtilLibCollections.Set; - exports.DictSet = _glimmerUtilLibCollections.DictSet; - exports.dict = _glimmerUtilLibCollections.dict; - exports.EMPTY_SLICE = _glimmerUtilLibListUtils.EMPTY_SLICE; - exports.LinkedList = _glimmerUtilLibListUtils.LinkedList; - exports.LinkedListNode = _glimmerUtilLibListUtils.LinkedListNode; - exports.ListNode = _glimmerUtilLibListUtils.ListNode; - exports.CloneableListNode = _glimmerUtilLibListUtils.CloneableListNode; - exports.ListSlice = _glimmerUtilLibListUtils.ListSlice; - exports.Slice = _glimmerUtilLibListUtils.Slice; -}); - -enifed("glimmer-util/lib/assert", ["exports"], function (exports) { - // import Logger from './logger'; - // let alreadyWarned = false; - "use strict"; + var STYLE_WARNING = '' + '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.'; - exports.debugAssert = debugAssert; - exports.prodAssert = prodAssert; + exports.STYLE_WARNING = STYLE_WARNING; + /** + @private + @method getRootViews + @param {Object} owner + */ - function debugAssert(test, msg) { - // if (!alreadyWarned) { - // alreadyWarned = true; - // Logger.warn("Don't leave debug assertions on in public builds"); - // } - if (!test) { - throw new Error(msg || "assertion failure"); - } - } + function getRootViews(owner) { + var registry = owner.lookup('-view-registry:main'); - function prodAssert() {} + var rootViews = []; - exports.default = debugAssert; -}); + Object.keys(registry).forEach(function (id) { + var view = registry[id]; -enifed('glimmer-util/lib/collections', ['exports', 'glimmer-util/lib/guid'], function (exports, _glimmerUtilLibGuid) { - 'use strict'; + if (view.parentView === null) { + rootViews.push(view); + } + }); - exports.dict = dict; + return rootViews; + } - var proto = Object.create(null, { - // without this, we will always still end up with (new - // EmptyObject()).constructor === Object - constructor: { - value: undefined, - enumerable: false, - writable: true - } - }); - function EmptyObject() {} - EmptyObject.prototype = proto; + /** + @private + @method getViewId + @param {Ember.View} view + */ - function dict() { - // let d = Object.create(null); - // d.x = 1; - // delete d.x; - // return d; - return new EmptyObject(); + function getViewId(view) { + if (view.tagName === '') { + return _emberUtils.guidFor(view); + } else { + return view.elementId || _emberUtils.guidFor(view); } + } - var DictSet = (function () { - function DictSet() { - this.dict = dict(); - } + var VIEW_ELEMENT = _emberUtils.symbol('VIEW_ELEMENT'); - DictSet.prototype.add = function add(obj) { - if (typeof obj === 'string') this.dict[obj] = obj;else this.dict[_glimmerUtilLibGuid.ensureGuid(obj)] = obj; - return this; - }; + /** + @private + @method getViewElement + @param {Ember.View} view + */ - DictSet.prototype.delete = function _delete(obj) { - if (typeof obj === 'string') delete this.dict[obj];else if (obj._guid) delete this.dict[obj._guid]; - }; + function getViewElement(view) { + return view[VIEW_ELEMENT]; + } - DictSet.prototype.forEach = function forEach(callback) { - var dict = this.dict; + function initViewElement(view) { + view[VIEW_ELEMENT] = null; + } - Object.keys(dict).forEach(function (key) { - return callback(dict[key]); - }); - }; + function setViewElement(view, element) { + return view[VIEW_ELEMENT] = element; + } - DictSet.prototype.toArray = function toArray() { - return Object.keys(this.dict); - }; + var CHILD_VIEW_IDS = _emberUtils.symbol('CHILD_VIEW_IDS'); - return DictSet; - })(); + /** + @private + @method getChildViews + @param {Ember.View} view + */ - exports.DictSet = DictSet; + function getChildViews(view) { + var owner = _emberUtils.getOwner(view); + var registry = owner.lookup('-view-registry:main'); + return collectChildViews(view, registry); + } - var Stack = (function () { - function Stack() { - this.stack = []; - this.current = null; - } + function initChildViews(view) { + view[CHILD_VIEW_IDS] = []; + } - Stack.prototype.push = function push(item) { - this.current = item; - this.stack.push(item); - }; + function addChildView(parent, child) { + parent[CHILD_VIEW_IDS].push(getViewId(child)); + } - Stack.prototype.pop = function pop() { - var item = this.stack.pop(); - var len = this.stack.length; - this.current = len === 0 ? null : this.stack[len - 1]; - return item; - }; + function collectChildViews(view, registry) { + var ids = []; + var views = []; - Stack.prototype.isEmpty = function isEmpty() { - return this.stack.length === 0; - }; + view[CHILD_VIEW_IDS].forEach(function (id) { + var view = registry[id]; - return Stack; - })(); + if (view && !view.isDestroying && !view.isDestroyed && ids.indexOf(id) === -1) { + ids.push(id); + views.push(view); + } + }); - exports.Stack = Stack; -}); + view[CHILD_VIEW_IDS] = ids; -enifed("glimmer-util/lib/guid", ["exports"], function (exports) { - "use strict"; + return views; + } - exports.initializeGuid = initializeGuid; - exports.ensureGuid = ensureGuid; - var GUID = 0; + /** + @private + @method getViewBounds + @param {Ember.View} view + */ - function initializeGuid(object) { - return object._guid = ++GUID; - } + function getViewBounds(view) { + return view.renderer.getBounds(view); + } - function ensureGuid(object) { - return object._guid || initializeGuid(object); - } -}); + /** + @private + @method getViewRange + @param {Ember.View} view + */ -enifed("glimmer-util/lib/list-utils", ["exports"], function (exports) { - "use strict"; + function getViewRange(view) { + var bounds = getViewBounds(view); - var ListNode = function ListNode(value) { - this.next = null; - this.prev = null; - this.value = value; - }; + var range = document.createRange(); + range.setStartBefore(bounds.firstNode); + range.setEndAfter(bounds.lastNode); - exports.ListNode = ListNode; + return range; + } - var LinkedList = (function () { - function LinkedList() { - this.clear(); - } + /** + `getViewClientRects` provides information about the position of the border + box edges of a view relative to the viewport. + + It is only intended to be used by development tools like the Ember Inspector + and may not work on older browsers. + + @private + @method getViewClientRects + @param {Ember.View} view + */ - LinkedList.fromSlice = function fromSlice(slice) { - var list = new LinkedList(); - slice.forEachNode(function (n) { - return list.append(n.clone()); - }); - return list; - }; + function getViewClientRects(view) { + var range = getViewRange(view); + return range.getClientRects(); + } - LinkedList.prototype.head = function head() { - return this._head; - }; + /** + `getViewBoundingClientRect` provides information about the position of the + bounding border box edges of a view relative to the viewport. + + It is only intended to be used by development tools like the Ember Inpsector + and may not work on older browsers. + + @private + @method getViewBoundingClientRect + @param {Ember.View} view + */ - LinkedList.prototype.tail = function tail() { - return this._tail; - }; + function getViewBoundingClientRect(view) { + var range = getViewRange(view); + return range.getBoundingClientRect(); + } - LinkedList.prototype.clear = function clear() { - this._head = this._tail = null; - }; + /** + Determines if the element matches the specified selector. + + @private + @method matches + @param {DOMElement} el + @param {String} selector + */ + var elMatches = typeof Element !== 'undefined' && (Element.prototype.matches || Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector); - LinkedList.prototype.isEmpty = function isEmpty() { - return this._head === null; - }; + exports.elMatches = elMatches; - LinkedList.prototype.toArray = function toArray() { - var out = []; - this.forEachNode(function (n) { - return out.push(n); - }); - return out; - }; + function matches(el, selector) { + return elMatches.call(el, selector); + } +}); +enifed('ember-views/utils/lookup-component', ['exports', 'container'], function (exports, _container) { + 'use strict'; - LinkedList.prototype.splice = function splice(start, end, reference) { - var before = undefined; - if (reference === null) { - before = this._tail; - this._tail = end; - } else { - before = reference.prev; - end.next = reference; - reference.prev = end; - } - if (before) { - before.next = start; - start.prev = before; - } - }; + exports.default = lookupComponent; - LinkedList.prototype.spliceList = function spliceList(list, reference) { - if (list.isEmpty()) return; - this.splice(list.head(), list.tail(), reference); - }; + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['component:-default'], ['component:-default']); - LinkedList.prototype.nextNode = function nextNode(node) { - return node.next; - }; + function lookupComponentPair(componentLookup, owner, name, options) { + var component = componentLookup.componentFor(name, owner, options); + var layout = componentLookup.layoutFor(name, owner, options); - LinkedList.prototype.prevNode = function prevNode(node) { - return node.prev; - }; + var result = { layout: layout, component: component }; - LinkedList.prototype.forEachNode = function forEachNode(callback) { - var node = this._head; - while (node !== null) { - callback(node); - node = node.next; - } - }; + if (layout && !component) { + result.component = owner[_container.FACTORY_FOR](_container.privatize(_templateObject)); + } - LinkedList.prototype.contains = function contains(needle) { - var node = this._head; - while (node !== null) { - if (node === needle) return true; - node = node.next; - } - return false; - }; + return result; + } - LinkedList.prototype.insertBefore = function insertBefore(node) { - var reference = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + function lookupComponent(owner, name, options) { + var componentLookup = owner.lookup('component-lookup:main'); - if (reference === null) return this.append(node); - if (reference.prev) reference.prev.next = node;else this._head = node; - node.prev = reference.prev; - node.next = reference; - reference.prev = node; - return node; - }; + var source = options && options.source; - LinkedList.prototype.append = function append(node) { - var tail = this._tail; - if (tail) { - tail.next = node; - node.prev = tail; - node.next = null; - } else { - this._head = node; - } - return this._tail = node; - }; + if (source) { + var localResult = lookupComponentPair(componentLookup, owner, name, options); - LinkedList.prototype.pop = function pop() { - if (this._tail) return this.remove(this._tail); - return null; - }; + if (localResult.component || localResult.layout) { + return localResult; + } + } - LinkedList.prototype.prepend = function prepend(node) { - if (this._head) return this.insertBefore(node, this._head); - return this._head = this._tail = node; - }; + return lookupComponentPair(componentLookup, owner, name); + } +}); +enifed('ember-views/views/core_view', ['exports', 'ember-runtime', 'ember-views/system/utils', 'ember-views/views/states'], function (exports, _emberRuntime, _emberViewsSystemUtils, _emberViewsViewsStates) { + 'use strict'; - LinkedList.prototype.remove = function remove(node) { - if (node.prev) node.prev.next = node.next;else this._head = node.next; - if (node.next) node.next.prev = node.prev;else this._tail = node.prev; - return node; - }; + /** + `Ember.CoreView` is an abstract class that exists to give view-like behavior + to both Ember's main view class `Ember.Component` and other classes that don't need + the full functionality of `Ember.Component`. + + Unless you have specific needs for `CoreView`, you will use `Ember.Component` + in your applications. + + @class CoreView + @namespace Ember + @extends Ember.Object + @deprecated Use `Ember.Component` instead. + @uses Ember.Evented + @uses Ember.ActionHandler + @private + */ + var CoreView = _emberRuntime.FrameworkObject.extend(_emberRuntime.Evented, _emberRuntime.ActionHandler, { + isView: true, - return LinkedList; - })(); + _states: _emberViewsViewsStates.cloneStates(_emberViewsViewsStates.states), - exports.LinkedList = LinkedList; + init: function () { + this._super.apply(this, arguments); + this._state = 'preRender'; + this._currentState = this._states.preRender; - var LinkedListRemover = (function () { - function LinkedListRemover(node) { - this.node = node; - } + _emberViewsSystemUtils.initViewElement(this); - LinkedListRemover.prototype.destroy = function destroy() { - var _node = this.node; - var prev = _node.prev; - var next = _node.next; + if (!this.renderer) { + throw new Error('Cannot instantiate a component without a renderer. Please ensure that you are creating ' + this + ' with a proper container/registry.'); + } + }, - prev.next = next; - next.prev = prev; - }; + /** + If the view is currently inserted into the DOM of a parent view, this + property will point to the parent of the view. + @property parentView + @type Ember.View + @default null + @private + */ + parentView: null, - return LinkedListRemover; - })(); + instrumentDetails: function (hash) { + hash.object = this.toString(); + hash.containerKey = this._debugContainerKey; + hash.view = this; + return hash; + }, - var ListSlice = (function () { - function ListSlice(head, tail) { - this._head = head; - this._tail = tail; + /** + Override the default event firing from `Ember.Evented` to + also call methods with the given name. + @method trigger + @param name {String} + @private + */ + trigger: function () { + this._super.apply(this, arguments); + var name = arguments[0]; + var method = this[name]; + if (method) { + var args = new Array(arguments.length - 1); + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; } + return method.apply(this, args); + } + }, - ListSlice.toList = function toList(slice) { - var list = new LinkedList(); - slice.forEachNode(function (n) { - return list.append(n.clone()); - }); - return list; - }; - - ListSlice.prototype.forEachNode = function forEachNode(callback) { - var node = this._head; - while (node !== null) { - callback(node); - node = this.nextNode(node); - } - }; + has: function (name) { + return _emberRuntime.typeOf(this[name]) === 'function' || this._super(name); + } + }); - ListSlice.prototype.contains = function contains(needle) { - var node = this._head; - while (node !== null) { - if (node === needle) return true; - node = node.next; - } - return false; - }; + _emberRuntime.deprecateUnderscoreActions(CoreView); - ListSlice.prototype.head = function head() { - return this._head; - }; + CoreView.reopenClass({ + isViewFactory: true + }); - ListSlice.prototype.tail = function tail() { - return this._tail; - }; + exports.default = CoreView; +}); +enifed('ember-views/views/states', ['exports', 'ember-utils', '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, _emberUtils, _emberViewsViewsStatesDefault, _emberViewsViewsStatesPre_render, _emberViewsViewsStatesHas_element, _emberViewsViewsStatesIn_dom, _emberViewsViewsStatesDestroying) { + 'use strict'; - ListSlice.prototype.toArray = function toArray() { - var out = []; - this.forEachNode(function (n) { - return out.push(n); - }); - return out; - }; + exports.cloneStates = cloneStates; - ListSlice.prototype.nextNode = function nextNode(node) { - if (node === this._tail) return null; - return node.next; - }; + function cloneStates(from) { + var into = {}; - ListSlice.prototype.prevNode = function prevNode(node) { - if (node === this._head) return null; - return node.prev; - }; + into._default = {}; + into.preRender = Object.create(into._default); + into.destroying = Object.create(into._default); + into.hasElement = Object.create(into._default); + into.inDOM = Object.create(into.hasElement); - ListSlice.prototype.isEmpty = function isEmpty() { - return false; - }; + for (var stateName in from) { + if (!from.hasOwnProperty(stateName)) { + continue; + } + _emberUtils.assign(into[stateName], from[stateName]); + } - return ListSlice; - })(); + return into; + } - exports.ListSlice = ListSlice; - var EMPTY_SLICE = new ListSlice(null, null); - exports.EMPTY_SLICE = EMPTY_SLICE; + /* + Describe how the specified actions should behave in the various + states that a view can exist in. Possible states: + + * preRender: when a view is first instantiated, and after its + element was destroyed, it is in the preRender state + * hasElement: the DOM representation of the view is created, + and is ready to be inserted + * inDOM: once a view has been inserted into the DOM it is in + the inDOM state. A view spends the vast majority of its + existence in this state. + * destroyed: once a view has been destroyed (using the destroy + method), it is in this state. No further actions can be invoked + on a destroyed view. + */ + var states = { + _default: _emberViewsViewsStatesDefault.default, + preRender: _emberViewsViewsStatesPre_render.default, + inDOM: _emberViewsViewsStatesIn_dom.default, + hasElement: _emberViewsViewsStatesHas_element.default, + destroying: _emberViewsViewsStatesDestroying.default + }; + exports.states = states; }); +enifed('ember-views/views/states/default', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; -enifed("glimmer-util/lib/logger", ["exports"], function (exports) { - "use strict"; - - var LogLevel; - exports.LogLevel = LogLevel; - (function (LogLevel) { - LogLevel[LogLevel["Trace"] = 0] = "Trace"; - LogLevel[LogLevel["Debug"] = 1] = "Debug"; - LogLevel[LogLevel["Warn"] = 2] = "Warn"; - LogLevel[LogLevel["Error"] = 3] = "Error"; - })(LogLevel || (exports.LogLevel = LogLevel = {})); - - var NullConsole = (function () { - function NullConsole() {} + /** + @module ember + @submodule ember-views + */ + exports.default = { + // appendChild is only legal while rendering the buffer. + appendChild: function () { + throw new _emberMetal.Error('You can\'t use appendChild outside of the rendering process'); + }, - NullConsole.prototype.log = function log(message) {}; + // Handle events from `Ember.EventDispatcher` + handleEvent: function () { + return true; // continue event propagation + }, - NullConsole.prototype.warn = function warn(message) {}; + rerender: function () {}, - NullConsole.prototype.error = function error(message) {}; + destroy: function () {} + }; +}); +enifed('ember-views/views/states/destroying', ['exports', 'ember-utils', 'ember-metal', 'ember-views/views/states/default'], function (exports, _emberUtils, _emberMetal, _emberViewsViewsStatesDefault) { + 'use strict'; - NullConsole.prototype.trace = function trace() {}; + /** + @module ember + @submodule ember-views + */ - return NullConsole; - })(); + var destroying = Object.create(_emberViewsViewsStatesDefault.default); - var Logger = (function () { - function Logger(_ref) { - var console = _ref.console; - var level = _ref.level; + _emberUtils.assign(destroying, { + appendChild: function () { + throw new _emberMetal.Error('You can\'t call appendChild on a view being destroyed'); + }, + rerender: function () { + throw new _emberMetal.Error('You can\'t call rerender on a view being destroyed'); + } + }); - this.f = ALWAYS; - this.force = ALWAYS; - this.console = console; - this.level = level; - } + exports.default = destroying; +}); +enifed('ember-views/views/states/has_element', ['exports', 'ember-utils', 'ember-views/views/states/default', 'ember-metal'], function (exports, _emberUtils, _emberViewsViewsStatesDefault, _emberMetal) { + 'use strict'; - Logger.prototype.skipped = function skipped(level) { - return level < this.level; - }; + var hasElement = Object.create(_emberViewsViewsStatesDefault.default); - Logger.prototype.trace = function trace(message) { - var _ref2 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + _emberUtils.assign(hasElement, { - var _ref2$stackTrace = _ref2.stackTrace; - var stackTrace = _ref2$stackTrace === undefined ? false : _ref2$stackTrace; + rerender: function (view) { + view.renderer.rerender(view); + }, - if (this.skipped(LogLevel.Trace)) return; - this.console.log(message); - if (stackTrace) this.console.trace(); - }; + destroy: function (view) { + view.renderer.remove(view); + }, - Logger.prototype.debug = function debug(message) { - var _ref3 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + // Handle events from `Ember.EventDispatcher` + handleEvent: function (view, eventName, event) { + if (view.has(eventName)) { + // Handler should be able to re-dispatch events, so we don't + // preventDefault or stopPropagation. + return _emberMetal.flaggedInstrument('interaction.' + eventName, { event: event, view: view }, function () { + return _emberMetal.run.join(view, view.trigger, eventName, event); + }); + } else { + return true; // continue event propagation + } + } + }); - var _ref3$stackTrace = _ref3.stackTrace; - var stackTrace = _ref3$stackTrace === undefined ? false : _ref3$stackTrace; + exports.default = hasElement; +}); +enifed('ember-views/views/states/in_dom', ['exports', 'ember-utils', 'ember-metal', 'ember-views/views/states/has_element'], function (exports, _emberUtils, _emberMetal, _emberViewsViewsStatesHas_element) { + 'use strict'; - if (this.skipped(LogLevel.Debug)) return; - this.console.log(message); - if (stackTrace) this.console.trace(); - }; + /** + @module ember + @submodule ember-views + */ - Logger.prototype.warn = function warn(message) { - var _ref4 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + var inDOM = Object.create(_emberViewsViewsStatesHas_element.default); - var _ref4$stackTrace = _ref4.stackTrace; - var stackTrace = _ref4$stackTrace === undefined ? false : _ref4$stackTrace; + _emberUtils.assign(inDOM, { + enter: function (view) { + // Register the view for event handling. This hash is used by + // Ember.EventDispatcher to dispatch incoming events. + view.renderer.register(view); - if (this.skipped(LogLevel.Warn)) return; - this.console.warn(message); - if (stackTrace) this.console.trace(); - }; + _emberMetal.runInDebug(function () { + _emberMetal._addBeforeObserver(view, 'elementId', function () { + throw new _emberMetal.Error('Changing a view\'s elementId after creation is not allowed'); + }); + }); + }, - Logger.prototype.error = function error(message) { - if (this.skipped(LogLevel.Error)) return; - this.console.error(message); - }; + exit: function (view) { + view.renderer.unregister(view); + } + }); - return Logger; - })(); + exports.default = inDOM; +}); +enifed('ember-views/views/states/pre_render', ['exports', 'ember-views/views/states/default'], function (exports, _emberViewsViewsStatesDefault) { + 'use strict'; - exports.Logger = Logger; + /** + @module ember + @submodule ember-views + */ - var _console = typeof console === 'undefined' ? new NullConsole() : console; - var ALWAYS = new Logger({ console: _console, level: LogLevel.Trace }); - var LOG_LEVEL = LogLevel.Warn; - exports.default = new Logger({ console: _console, level: LOG_LEVEL }); + exports.default = Object.create(_emberViewsViewsStatesDefault.default); }); +enifed("ember-views/views/view", ["exports"], function (exports) { + "use strict"; +}); +/** +@module ember +@submodule ember-views +*/ -enifed('glimmer-util/lib/namespaces', ['exports'], function (exports) { - // There is a small whitelist of namespaced attributes specially - // enumerated in - // https://www.w3.org/TR/html/syntax.html#attributes-0 - // - // > When a foreign element has one of the namespaced attributes given by - // > the local name and namespace of the first and second cells of a row - // > from the following table, it must be written using the name given by - // > the third cell from the same row. - // - // In all other cases, colons are interpreted as a regular character - // with no special meaning: - // - // > No other namespaced attribute can be expressed in the HTML syntax. - 'use strict'; - - exports.getAttrNamespace = getAttrNamespace; - var XLINK = 'http://www.w3.org/1999/xlink'; - var XML = 'http://www.w3.org/XML/1998/namespace'; - var XMLNS = 'http://www.w3.org/2000/xmlns/'; - var WHITELIST = { - 'xlink:actuate': XLINK, - 'xlink:arcrole': XLINK, - 'xlink:href': XLINK, - 'xlink:role': XLINK, - 'xlink:show': XLINK, - 'xlink:title': XLINK, - 'xlink:type': XLINK, - 'xml:base': XML, - 'xml:lang': XML, - 'xml:space': XML, - 'xmlns': XMLNS, - 'xmlns:xlink': XMLNS - }; +/** + @class View + @namespace Ember + @extends Ember.CoreView + @deprecated See http://emberjs.com/deprecations/v1.x/#toc_ember-view + @uses Ember.ViewSupport + @uses Ember.ChildViewsSupport + @uses Ember.ClassNamesSupport + @uses Ember.AttributeBindingsSupport + @private +*/ +enifed("ember/features", ["exports"], function (exports) { + "use strict"; - function getAttrNamespace(attrName) { - return WHITELIST[attrName] || null; - } + exports.default = { "features-stripped-test": null, "ember-libraries-isregistered": null, "ember-improved-instrumentation": null, "ember-metal-weakmap": null, "ember-glimmer-allow-backtracking-rerender": true, "ember-testing-resume-test": null, "ember-factory-for": true, "ember-no-double-extend": null, "ember-routing-router-service": null, "ember-unique-location-history-state": null, "ember-glimmer-detect-backtracking-rerender": true, "mandatory-setter": true }; }); +enifed('ember/index', ['exports', 'require', 'ember-environment', 'ember-utils', 'container', 'ember-metal', 'backburner', 'ember-console', 'ember-runtime', 'ember-glimmer', 'ember/version', 'ember-views', 'ember-routing', 'ember-application', 'ember-extension-support'], function (exports, _require, _emberEnvironment, _emberUtils, _container, _emberMetal, _backburner, _emberConsole, _emberRuntime, _emberGlimmer, _emberVersion, _emberViews, _emberRouting, _emberApplication, _emberExtensionSupport) { + 'use strict'; -enifed('glimmer-util/lib/object-utils', ['exports'], function (exports) { - 'use strict'; + // ember-utils exports + _emberMetal.default.getOwner = _emberUtils.getOwner; + _emberMetal.default.setOwner = _emberUtils.setOwner; + _emberMetal.default.generateGuid = _emberUtils.generateGuid; + _emberMetal.default.GUID_KEY = _emberUtils.GUID_KEY; + _emberMetal.default.guidFor = _emberUtils.guidFor; + _emberMetal.default.inspect = _emberUtils.inspect; + _emberMetal.default.makeArray = _emberUtils.makeArray; + _emberMetal.default.canInvoke = _emberUtils.canInvoke; + _emberMetal.default.tryInvoke = _emberUtils.tryInvoke; + _emberMetal.default.wrap = _emberUtils.wrap; + _emberMetal.default.applyStr = _emberUtils.applyStr; + _emberMetal.default.uuid = _emberUtils.uuid; + _emberMetal.default.assign = Object.assign || _emberUtils.assign; - exports.assign = assign; - var objKeys = Object.keys; + // container exports + _emberMetal.default.Container = _container.Container; + _emberMetal.default.Registry = _container.Registry; - function assign(obj) { - for (var i = 1; i < arguments.length; i++) { - var assignment = arguments[i]; - if (assignment === null || typeof assignment !== 'object') continue; - var keys = objKeys(assignment); - for (var j = 0; j < keys.length; j++) { - var key = keys[j]; - obj[key] = assignment[key]; - } - } - return obj; - } -}); + // need to import this directly, to ensure the babel feature + // flag plugin works properly -enifed("glimmer-util/lib/platform-utils", ["exports"], function (exports) { - "use strict"; + var computed = _emberMetal.computed; + computed.alias = _emberMetal.alias; + _emberMetal.default.computed = computed; + _emberMetal.default.ComputedProperty = _emberMetal.ComputedProperty; + _emberMetal.default.cacheFor = _emberMetal.cacheFor; - exports.unwrap = unwrap; + _emberMetal.default.assert = _emberMetal.assert; + _emberMetal.default.warn = _emberMetal.warn; + _emberMetal.default.debug = _emberMetal.debug; + _emberMetal.default.deprecate = _emberMetal.deprecate; + _emberMetal.default.deprecateFunc = _emberMetal.deprecateFunc; + _emberMetal.default.runInDebug = _emberMetal.runInDebug; + _emberMetal.default.merge = _emberMetal.merge; - function unwrap(val) { - if (val === null || val === undefined) throw new Error("Expected value to be present"); - return val; - } -}); + _emberMetal.default.instrument = _emberMetal.instrument; + _emberMetal.default.subscribe = _emberMetal.instrumentationSubscribe; + _emberMetal.default.Instrumentation = { + instrument: _emberMetal.instrument, + subscribe: _emberMetal.instrumentationSubscribe, + unsubscribe: _emberMetal.instrumentationUnsubscribe, + reset: _emberMetal.instrumentationReset + }; -enifed("glimmer-util/lib/quoting", ["exports"], function (exports) { - "use strict"; + _emberMetal.default.Error = _emberMetal.Error; + _emberMetal.default.META_DESC = _emberMetal.META_DESC; + _emberMetal.default.meta = _emberMetal.meta; + _emberMetal.default.get = _emberMetal.get; + _emberMetal.default.getWithDefault = _emberMetal.getWithDefault; + _emberMetal.default._getPath = _emberMetal._getPath; + _emberMetal.default.set = _emberMetal.set; + _emberMetal.default.trySet = _emberMetal.trySet; + _emberMetal.default.FEATURES = _emberMetal.FEATURES; + _emberMetal.default.FEATURES.isEnabled = _emberMetal.isFeatureEnabled; + _emberMetal.default._Cache = _emberMetal.Cache; + _emberMetal.default.on = _emberMetal.on; + _emberMetal.default.addListener = _emberMetal.addListener; + _emberMetal.default.removeListener = _emberMetal.removeListener; + _emberMetal.default._suspendListener = _emberMetal.suspendListener; + _emberMetal.default._suspendListeners = _emberMetal.suspendListeners; + _emberMetal.default.sendEvent = _emberMetal.sendEvent; + _emberMetal.default.hasListeners = _emberMetal.hasListeners; + _emberMetal.default.watchedEvents = _emberMetal.watchedEvents; + _emberMetal.default.listenersFor = _emberMetal.listenersFor; + _emberMetal.default.accumulateListeners = _emberMetal.accumulateListeners; + _emberMetal.default.isNone = _emberMetal.isNone; + _emberMetal.default.isEmpty = _emberMetal.isEmpty; + _emberMetal.default.isBlank = _emberMetal.isBlank; + _emberMetal.default.isPresent = _emberMetal.isPresent; + _emberMetal.default.run = _emberMetal.run; + _emberMetal.default._ObserverSet = _emberMetal.ObserverSet; + _emberMetal.default.propertyWillChange = _emberMetal.propertyWillChange; + _emberMetal.default.propertyDidChange = _emberMetal.propertyDidChange; + _emberMetal.default.overrideChains = _emberMetal.overrideChains; + _emberMetal.default.beginPropertyChanges = _emberMetal.beginPropertyChanges; + _emberMetal.default.endPropertyChanges = _emberMetal.endPropertyChanges; + _emberMetal.default.changeProperties = _emberMetal.changeProperties; + _emberMetal.default.platform = { + defineProperty: true, + hasPropertyAccessors: true + }; + _emberMetal.default.defineProperty = _emberMetal.defineProperty; + _emberMetal.default.watchKey = _emberMetal.watchKey; + _emberMetal.default.unwatchKey = _emberMetal.unwatchKey; + _emberMetal.default.removeChainWatcher = _emberMetal.removeChainWatcher; + _emberMetal.default._ChainNode = _emberMetal.ChainNode; + _emberMetal.default.finishChains = _emberMetal.finishChains; + _emberMetal.default.watchPath = _emberMetal.watchPath; + _emberMetal.default.unwatchPath = _emberMetal.unwatchPath; + _emberMetal.default.watch = _emberMetal.watch; + _emberMetal.default.isWatching = _emberMetal.isWatching; + _emberMetal.default.unwatch = _emberMetal.unwatch; + _emberMetal.default.destroy = _emberMetal.destroy; + _emberMetal.default.libraries = _emberMetal.libraries; + _emberMetal.default.OrderedSet = _emberMetal.OrderedSet; + _emberMetal.default.Map = _emberMetal.Map; + _emberMetal.default.MapWithDefault = _emberMetal.MapWithDefault; + _emberMetal.default.getProperties = _emberMetal.getProperties; + _emberMetal.default.setProperties = _emberMetal.setProperties; + _emberMetal.default.expandProperties = _emberMetal.expandProperties; + _emberMetal.default.NAME_KEY = _emberUtils.NAME_KEY; + _emberMetal.default.addObserver = _emberMetal.addObserver; + _emberMetal.default.observersFor = _emberMetal.observersFor; + _emberMetal.default.removeObserver = _emberMetal.removeObserver; + _emberMetal.default._suspendObserver = _emberMetal._suspendObserver; + _emberMetal.default._suspendObservers = _emberMetal._suspendObservers; + _emberMetal.default.required = _emberMetal.required; + _emberMetal.default.aliasMethod = _emberMetal.aliasMethod; + _emberMetal.default.observer = _emberMetal.observer; + _emberMetal.default.immediateObserver = _emberMetal._immediateObserver; + _emberMetal.default.mixin = _emberMetal.mixin; + _emberMetal.default.Mixin = _emberMetal.Mixin; + _emberMetal.default.bind = _emberMetal.bind; + _emberMetal.default.Binding = _emberMetal.Binding; + _emberMetal.default.isGlobalPath = _emberMetal.isGlobalPath; - exports.hash = hash; - exports.repeat = repeat; - function escapeString(str) { - str = str.replace(/\\/g, "\\\\"); - str = str.replace(/"/g, '\\"'); - str = str.replace(/\n/g, "\\n"); - return str; - } - exports.escapeString = escapeString; + if (_emberMetal.isFeatureEnabled('ember-metal-weakmap')) { + _emberMetal.default.WeakMap = _emberMetal.WeakMap; + } - function string(str) { - return '"' + escapeString(str) + '"'; - } - exports.string = string; + Object.defineProperty(_emberMetal.default, 'ENV', { + get: function () { + return _emberEnvironment.ENV; + }, + enumerable: false + }); + + /** + The context that Ember searches for namespace instances on. + + @private + */ + Object.defineProperty(_emberMetal.default, 'lookup', { + get: function () { + return _emberEnvironment.context.lookup; + }, + set: function (value) { + _emberEnvironment.context.lookup = value; + }, + enumerable: false + }); - function array(a) { - return "[" + a + "]"; - } - exports.array = array; + _emberMetal.default.EXTEND_PROTOTYPES = _emberEnvironment.ENV.EXTEND_PROTOTYPES; - function hash(pairs) { - return "{" + pairs.join(", ") + "}"; - } + // BACKWARDS COMPAT ACCESSORS FOR ENV FLAGS + Object.defineProperty(_emberMetal.default, 'LOG_STACKTRACE_ON_DEPRECATION', { + get: function () { + return _emberEnvironment.ENV.LOG_STACKTRACE_ON_DEPRECATION; + }, + set: function (value) { + _emberEnvironment.ENV.LOG_STACKTRACE_ON_DEPRECATION = !!value; + }, + enumerable: false + }); - function repeat(chars, times) { - var str = ""; - while (times--) { - str += chars; - } - return str; - } -}); + Object.defineProperty(_emberMetal.default, 'LOG_VERSION', { + get: function () { + return _emberEnvironment.ENV.LOG_VERSION; + }, + set: function (value) { + _emberEnvironment.ENV.LOG_VERSION = !!value; + }, + enumerable: false + }); -enifed('glimmer-wire-format/index', ['exports'], function (exports) { - 'use strict'; + Object.defineProperty(_emberMetal.default, 'MODEL_FACTORY_INJECTIONS', { + get: function () { + return _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS; + }, + set: function (value) { + _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS = !!value; + }, + enumerable: false + }); - function is(variant) { - return function (value) { - return value[0] === variant; - }; - } - var Expressions; - exports.Expressions = Expressions; - (function (Expressions) { - Expressions.isUnknown = is('unknown'); - Expressions.isArg = is('arg'); - Expressions.isGet = is('get'); - Expressions.isConcat = is('concat'); - Expressions.isHelper = is('helper'); - Expressions.isHasBlock = is('has-block'); - Expressions.isHasBlockParams = is('has-block-params'); - Expressions.isUndefined = is('undefined'); - function isPrimitiveValue(value) { - if (value === null) { - return true; - } - return typeof value !== 'object'; - } - Expressions.isPrimitiveValue = isPrimitiveValue; - })(Expressions || (exports.Expressions = Expressions = {})); - var Statements; - exports.Statements = Statements; - (function (Statements) { - Statements.isText = is('text'); - Statements.isAppend = is('append'); - Statements.isComment = is('comment'); - Statements.isModifier = is('modifier'); - Statements.isBlock = is('block'); - Statements.isOpenElement = is('open-element'); - Statements.isFlushElement = is('flush-element'); - Statements.isCloseElement = is('close-element'); - Statements.isStaticAttr = is('static-attr'); - Statements.isDynamicAttr = is('dynamic-attr'); - Statements.isYield = is('yield'); - Statements.isPartial = is('partial'); - Statements.isDynamicArg = is('dynamic-arg'); - Statements.isStaticArg = is('static-arg'); - Statements.isTrustingAttr = is('trusting-attr'); - })(Statements || (exports.Statements = Statements = {})); -}); + Object.defineProperty(_emberMetal.default, 'LOG_BINDINGS', { + get: function () { + return _emberEnvironment.ENV.LOG_BINDINGS; + }, + set: function (value) { + _emberEnvironment.ENV.LOG_BINDINGS = !!value; + }, + enumerable: false + }); -enifed('glimmer/index', ['exports', 'glimmer-compiler'], function (exports, _glimmerCompiler) { - /* - * @overview Glimmer - * @copyright Copyright 2011-2015 Tilde Inc. and contributors - * @license Licensed under MIT license - * See https://raw.githubusercontent.com/tildeio/glimmer/master/LICENSE - * @version VERSION_STRING_PLACEHOLDER - */ - 'use strict'; + /** + A function may be assigned to `Ember.onerror` to be called when Ember + internals encounter an error. This is useful for specialized error handling + and reporting code. + + ```javascript + Ember.onerror = function(error) { + Em.$.ajax('/report-error', 'POST', { + stack: error.stack, + otherInformation: 'whatever app state you want to provide' + }); + }; + ``` + + Internally, `Ember.onerror` is used as Backburner's error handler. + + @event onerror + @for Ember + @param {Exception} error the error object + @public + */ + Object.defineProperty(_emberMetal.default, 'onerror', { + get: _emberMetal.getOnerror, + set: _emberMetal.setOnerror, + enumerable: false + }); - exports.precompile = _glimmerCompiler.precompile; -}); + /** + An empty function useful for some operations. Always returns `this`. + + @method K + @return {Object} + @public + */ + function deprecatedEmberK() { + return this; + } -enifed('route-recognizer', ['exports'], function (exports) { 'use strict'; + Object.defineProperty(_emberMetal.default, 'K', { + get: function () { + _emberMetal.deprecate('Ember.K is deprecated in favor of defining a function inline.', false, { + id: 'ember-metal.ember-k', + until: '3.0.0', + url: 'http://emberjs.com/deprecations/v2.x#toc_code-ember-k-code' + }); -function Target(path, matcher, delegate) { - this.path = path; - this.matcher = matcher; - this.delegate = delegate; -} + return deprecatedEmberK; + } + }); -Target.prototype = { - to: function(target, callback) { - var delegate = this.delegate; + Object.defineProperty(_emberMetal.default, 'testing', { + get: _emberMetal.isTesting, + set: _emberMetal.setTesting, + enumerable: false + }); - if (delegate && delegate.willAddRoute) { - target = delegate.willAddRoute(this.matcher.target, target); - } + if (!_require.has('ember-debug')) { + _emberMetal.default.Debug = { + registerDeprecationHandler: function () {}, + registerWarnHandler: function () {} + }; + } - this.matcher.add(this.path, target); + /** + @class Backburner + @for Ember + @private + */ + _emberMetal.default.Backburner = function () { + _emberMetal.deprecate('Usage of Ember.Backburner is deprecated.', false, { + id: 'ember-metal.ember-backburner', + until: '2.8.0', + url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-backburner' + }); - if (callback) { - if (callback.length === 0) { throw new Error("You must have an argument in the function passed to `to`"); } - this.matcher.addChild(this.path, target, callback, this.delegate); + function BackburnerAlias(args) { + return _backburner.default.apply(this, args); } - return this; - } -}; -function Matcher(target) { - this.routes = {}; - this.children = {}; - this.target = target; -} + BackburnerAlias.prototype = _backburner.default.prototype; -Matcher.prototype = { - add: function(path, handler) { - this.routes[path] = handler; - }, + return new BackburnerAlias(arguments); + }; - addChild: function(path, target, callback, delegate) { - var matcher = new Matcher(target); - this.children[path] = matcher; + _emberMetal.default._Backburner = _backburner.default; - var match = generateMatch(path, matcher, delegate); + _emberMetal.default.Logger = _emberConsole.default; - if (delegate && delegate.contextEntered) { - delegate.contextEntered(target, match); - } + // ****ember-runtime**** - callback(match); - } -}; + _emberMetal.default.String = _emberRuntime.String; + _emberMetal.default.Object = _emberRuntime.Object; + _emberMetal.default._RegistryProxyMixin = _emberRuntime.RegistryProxyMixin; + _emberMetal.default._ContainerProxyMixin = _emberRuntime.ContainerProxyMixin; + _emberMetal.default.compare = _emberRuntime.compare; + _emberMetal.default.copy = _emberRuntime.copy; + _emberMetal.default.isEqual = _emberRuntime.isEqual; + _emberMetal.default.inject = _emberRuntime.inject; + _emberMetal.default.Array = _emberRuntime.Array; + _emberMetal.default.Comparable = _emberRuntime.Comparable; + _emberMetal.default.Enumerable = _emberRuntime.Enumerable; + _emberMetal.default.ArrayProxy = _emberRuntime.ArrayProxy; + _emberMetal.default.ObjectProxy = _emberRuntime.ObjectProxy; + _emberMetal.default.ActionHandler = _emberRuntime.ActionHandler; + _emberMetal.default.CoreObject = _emberRuntime.CoreObject; + _emberMetal.default.NativeArray = _emberRuntime.NativeArray; + _emberMetal.default.Copyable = _emberRuntime.Copyable; + _emberMetal.default.Freezable = _emberRuntime.Freezable; + _emberMetal.default.FROZEN_ERROR = _emberRuntime.FROZEN_ERROR; + _emberMetal.default.MutableEnumerable = _emberRuntime.MutableEnumerable; + _emberMetal.default.MutableArray = _emberRuntime.MutableArray; + _emberMetal.default.TargetActionSupport = _emberRuntime.TargetActionSupport; + _emberMetal.default.Evented = _emberRuntime.Evented; + _emberMetal.default.PromiseProxyMixin = _emberRuntime.PromiseProxyMixin; + _emberMetal.default.Observable = _emberRuntime.Observable; + _emberMetal.default.typeOf = _emberRuntime.typeOf; + _emberMetal.default.isArray = _emberRuntime.isArray; + _emberMetal.default.Object = _emberRuntime.Object; + _emberMetal.default.onLoad = _emberRuntime.onLoad; + _emberMetal.default.runLoadHooks = _emberRuntime.runLoadHooks; + _emberMetal.default.Controller = _emberRuntime.Controller; + _emberMetal.default.ControllerMixin = _emberRuntime.ControllerMixin; + _emberMetal.default.Service = _emberRuntime.Service; + _emberMetal.default._ProxyMixin = _emberRuntime._ProxyMixin; + _emberMetal.default.RSVP = _emberRuntime.RSVP; + _emberMetal.default.Namespace = _emberRuntime.Namespace; -function generateMatch(startingPath, matcher, delegate) { - return function(path, nestedCallback) { - var fullPath = startingPath + path; + // ES6TODO: this seems a less than ideal way/place to add properties to Ember.computed + computed.empty = _emberRuntime.empty; + computed.notEmpty = _emberRuntime.notEmpty; + computed.none = _emberRuntime.none; + computed.not = _emberRuntime.not; + computed.bool = _emberRuntime.bool; + computed.match = _emberRuntime.match; + computed.equal = _emberRuntime.equal; + computed.gt = _emberRuntime.gt; + computed.gte = _emberRuntime.gte; + computed.lt = _emberRuntime.lt; + computed.lte = _emberRuntime.lte; + computed.oneWay = _emberRuntime.oneWay; + computed.reads = _emberRuntime.oneWay; + computed.readOnly = _emberRuntime.readOnly; + computed.deprecatingAlias = _emberRuntime.deprecatingAlias; + computed.and = _emberRuntime.and; + computed.or = _emberRuntime.or; + computed.any = _emberRuntime.any; - if (nestedCallback) { - nestedCallback(generateMatch(fullPath, matcher, delegate)); - } else { - return new Target(startingPath + path, matcher, delegate); - } - }; -} + computed.sum = _emberRuntime.sum; + computed.min = _emberRuntime.min; + computed.max = _emberRuntime.max; + computed.map = _emberRuntime.map; + computed.sort = _emberRuntime.sort; + computed.setDiff = _emberRuntime.setDiff; + computed.mapBy = _emberRuntime.mapBy; + computed.filter = _emberRuntime.filter; + computed.filterBy = _emberRuntime.filterBy; + computed.uniq = _emberRuntime.uniq; -function addRoute(routeArray, path, handler) { - var len = 0; - for (var i=0; i 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + mixins[_key - 1] = arguments[_key]; } - }, - put: function(charSpec) { - var state; + mixins.forEach(function (mixinOrGenerator) { + var mixin = undefined; - // If the character specification already exists in a child of the current - // state, just return that state. - if (state = this.get(charSpec)) { return state; } + if (isGenerator(mixinOrGenerator)) { + (function () { + var generator = mixinOrGenerator; + mixin = {}; - // Make a new state for the character spec - state = new State(charSpec); + generator.cases.forEach(function (value, idx) { + _emberUtils.assign(mixin, generator.generate(value, idx)); + }); + })(); + } else { + mixin = mixinOrGenerator; + } - // Insert the new state as a child of the current state - this.nextStates.push(state); + _emberUtils.assign(TestClass.prototype, mixin); + }); - // If this character specification repeats, insert the new state as a child - // of itself. Note that this will not trigger an infinite loop because each - // transition during recognition consumes a character. - if (charSpec.repeat) { - state.nextStates.push(state); - } + return TestClass; + } +}); +enifed('internal-test-helpers/build-owner', ['exports', 'container', 'ember-routing', 'ember-application', 'ember-metal', 'ember-runtime'], function (exports, _container, _emberRouting, _emberApplication, _emberMetal, _emberRuntime) { + 'use strict'; - // Return the new state - return state; - }, + exports.default = buildOwner; - // Find a list of child states matching the next character - match: function(ch) { - var nextStates = this.nextStates, - child, charSpec, chars; + function buildOwner() { + var _EmberObject$extend; - var returned = []; + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - for (var i=0; i'; + })(); -var RouteRecognizer = function() { - this.rootState = new State(); - this.names = {}; -}; + function normalizeInnerHTML(actualHTML) { + if (ieSVGInnerHTML) { + // Replace `` with ``, etc. + // drop namespace attribute + actualHTML = actualHTML.replace(/ xmlns="[^"]+"/, ''); + // replace self-closing elements + actualHTML = actualHTML.replace(/<([^ >]+) [^\/>]*\/>/gi, function (tag, tagName) { + return tag.slice(0, tag.length - 3) + '>'; + }); + } + return actualHTML; + } -RouteRecognizer.prototype = { - add: function(routes, options) { - var currentState = this.rootState, regex = "^", - types = { statics: 0, dynamics: 0, stars: 0 }, - handlers = new Array(routes.length), allSegments = [], name; + function equalInnerHTML(fragment, html) { + var actualHTML = normalizeInnerHTML(fragment.innerHTML); + QUnit.push(actualHTML === html, actualHTML, html); + } +}); +enifed('internal-test-helpers/equal-tokens', ['exports', 'simple-html-tokenizer'], function (exports, _simpleHtmlTokenizer) { + 'use strict'; - var isEmpty = true; + exports.default = equalTokens; - for (var i=0; i b[0]) { + return 1; + } + if (a[0] < b[0]) { + return -1; + } + return 0; + }); + } + }); + } - allSegments = allSegments.concat(segments); + function equalTokens(actualContainer, expectedHTML) { + var message = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; - for (var j=0; j'; + }; - if (!route) { throw new Error("There is no route named " + name); } + Klass.create = create; + Klass.extend = extend; + Klass.reopen = extend; + Klass.reopenClass = reopenClass; - var result = new Array(route.handlers.length); + return Klass; - for (var i=0; i 2 && key.slice(keyLength -2) === '[]') { - isArray = true; - key = key.slice(0, keyLength - 2); - if(!queryParams[key]) { - queryParams[key] = []; - } - } - value = pair[1] ? decodeQueryParamPart(pair[1]) : ''; - } - if (isArray) { - queryParams[key].push(value); - } else { - queryParams[key] = value; - } - } - return queryParams; - }, + return _ref2 = {}, _ref2[MATCHER_BRAND] = true, _ref2.match = function (v) { + return r.test(v); + }, _ref2.expected = function () { + return r.toString(); + }, _ref2.message = function () { + return 'should match ' + this.expected(); + }, _ref2; + } - recognize: function(path) { - var states = [ this.rootState ], - pathLen, i, queryStart, queryParams = {}, - hashStart, - isSlashDropped = false; + function classes(expected) { + var _ref3; - hashStart = path.indexOf('#'); - if (hashStart !== -1) { - path = path.substr(0, hashStart); - } + return _ref3 = {}, _ref3[MATCHER_BRAND] = true, _ref3.match = function (actual) { + actual = actual.trim(); + return actual && expected.split(/\s+/).sort().join(' ') === actual.trim().split(/\s+/).sort().join(' '); + }, _ref3.expected = function () { + return expected; + }, _ref3.message = function () { + return 'should match ' + this.expected(); + }, _ref3; + } - queryStart = path.indexOf('?'); - if (queryStart !== -1) { - var queryString = path.substr(queryStart + 1, path.length); - path = path.substr(0, queryStart); - queryParams = this.parseQueryString(queryString); - } + function styles(expected) { + var _ref4; - if (path.charAt(0) !== "/") { path = "/" + path; } - var originalPath = path; + return _ref4 = {}, _ref4[MATCHER_BRAND] = true, _ref4.match = function (actual) { + // coerce `null` or `undefined` to an empty string + // needed for matching empty styles on IE9 - IE11 + actual = actual || ''; + actual = actual.trim(); - if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS) { - path = normalizePath(path); - } else { - path = decodeURI(path); - originalPath = decodeURI(originalPath); - } + return expected.split(';').map(function (s) { + return s.trim(); + }).filter(function (s) { + return s; + }).sort().join('; ') === actual.split(';').map(function (s) { + return s.trim(); + }).filter(function (s) { + return s; + }).sort().join('; '); + }, _ref4.expected = function () { + return expected; + }, _ref4.message = function () { + return 'should match ' + this.expected(); + }, _ref4; + } - pathLen = path.length; - if (pathLen > 1 && path.charAt(pathLen - 1) === "/") { - path = path.substr(0, pathLen - 1); - originalPath = originalPath.substr(0, originalPath.length - 1); - isSlashDropped = true; - } + function equalsElement(element, tagName, attributes, content) { + QUnit.push(element.tagName === tagName.toUpperCase(), element.tagName.toLowerCase(), tagName, 'expect tagName to be ' + tagName); - for (i=0; i 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + mixins[_key - 2] = arguments[_key]; + } -var _isArray; -if (!Array.isArray) { - _isArray = function (x) { - return Object.prototype.toString.call(x) === "[object Array]"; - }; -} else { - _isArray = Array.isArray; -} + _internalTestHelpersApplyMixins.default(TestClass, mixins); -var isArray = _isArray; + var proto = TestClass.prototype; -/** - Determines if an object is Promise by checking if it is "thenable". -**/ -function isPromise(obj) { - return ((typeof obj === 'object' && obj !== null) || typeof obj === 'function') && typeof obj.then === 'function'; -} + while (proto !== Object.prototype) { + Object.keys(proto).forEach(generateTest); + proto = Object.getPrototypeOf(proto); + } -function merge(hash, other) { - for (var prop in other) { - if (other.hasOwnProperty(prop)) { hash[prop] = other[prop]; } + function generateTest(name) { + if (name.indexOf('@test ') === 0) { + QUnit.test(name.slice(5), function (assert) { + return context[name](assert); + }); + } else if (name.indexOf('@skip ') === 0) { + QUnit.skip(name.slice(5), function (assert) { + return context[name](assert); + }); + } + } } -} - -var oCreate = Object.create || function(proto) { - function F() {} - F.prototype = proto; - return new F(); -}; +}); +enifed('internal-test-helpers/run', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; -/** - @private + exports.runAppend = runAppend; + exports.runDestroy = runDestroy; - Extracts query params from the end of an array -**/ -function extractQueryParams(array) { - var len = (array && array.length), head, queryParams; + function runAppend(view) { + _emberMetal.run(view, 'appendTo', '#qunit-fixture'); + } - if(len && len > 0 && array[len - 1] && array[len - 1].hasOwnProperty('queryParams')) { - queryParams = array[len - 1].queryParams; - head = slice.call(array, 0, len - 1); - return [head, queryParams]; - } else { - return [array, null]; + function runDestroy(toDestroy) { + if (toDestroy) { + _emberMetal.run(toDestroy, 'destroy'); + } } -} +}); +enifed('internal-test-helpers/strip', ['exports'], function (exports) { + 'use strict'; -/** - @private + exports.default = strip; - Coerces query param properties and array elements into strings. -**/ -function coerceQueryParamsToString(queryParams) { - for (var key in queryParams) { - if (typeof queryParams[key] === 'number') { - queryParams[key] = '' + queryParams[key]; - } else if (isArray(queryParams[key])) { - for (var i = 0, l = queryParams[key].length; i < l; i++) { - queryParams[key][i] = '' + queryParams[key][i]; - } + function strip(_ref) { + for (var _len = arguments.length, values = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + values[_key - 1] = arguments[_key]; } - } -} -/** - @private - */ -function log(router, sequence, msg) { - if (!router.log) { return; } - if (arguments.length === 3) { - router.log("Transition #" + sequence + ": " + msg); - } else { - msg = sequence; - router.log(msg); + var strings = _ref; + + var str = strings.map(function (string, index) { + var interpolated = values[index]; + return string + (interpolated !== undefined ? interpolated : ''); + }).join(''); + return str.split('\n').map(function (s) { + return s.trim(); + }).join(''); } -} +}); +enifed('internal-test-helpers/test-cases/abstract-application', ['exports', 'ember-metal', 'ember-views', 'ember-application', 'ember-routing', 'ember-template-compiler', 'internal-test-helpers/test-cases/abstract', 'internal-test-helpers/run'], function (exports, _emberMetal, _emberViews, _emberApplication, _emberRouting, _emberTemplateCompiler, _internalTestHelpersTestCasesAbstract, _internalTestHelpersRun) { + 'use strict'; -function bind(context, fn) { - var boundArgs = arguments; - return function(value) { - var args = slice.call(boundArgs, 2); - args.push(value); - return fn.apply(context, args); - }; -} + var AbstractApplicationTestCase = (function (_AbstractTestCase) { + babelHelpers.inherits(AbstractApplicationTestCase, _AbstractTestCase); -function isParam(object) { - return (typeof object === "string" || object instanceof String || typeof object === "number" || object instanceof Number); -} + function AbstractApplicationTestCase() { + babelHelpers.classCallCheck(this, AbstractApplicationTestCase); + _AbstractTestCase.call(this); -function forEach(array, callback) { - for (var i=0, l=array.length; i < l && false !== callback(array[i]); i++) { } -} + this.element = _emberViews.jQuery('#qunit-fixture')[0]; -function trigger(router, handlerInfos, ignoreFailure, args) { - if (router.triggerEvent) { - router.triggerEvent(handlerInfos, ignoreFailure, args); - return; - } + this.application = _emberMetal.run(_emberApplication.Application, 'create', this.applicationOptions); - var name = args.shift(); + this.router = this.application.Router = _emberRouting.Router.extend(this.routerOptions); - if (!handlerInfos) { - if (ignoreFailure) { return; } - throw new Error("Could not trigger event '" + name + "'. There are no active handlers"); - } + this.applicationInstance = null; + } - var eventWasHandled = false; + AbstractApplicationTestCase.prototype.teardown = function teardown() { + if (this.applicationInstance) { + _internalTestHelpersRun.runDestroy(this.applicationInstance); + } - function delayedEvent(name, args, handler) { - handler.events[name].apply(handler, args); - } + _internalTestHelpersRun.runDestroy(this.application); + }; - for (var i=handlerInfos.length-1; i>=0; i--) { - var handlerInfo = handlerInfos[i], - handler = handlerInfo.handler; + AbstractApplicationTestCase.prototype.visit = function visit(url, options) { + var _this = this; - // If there is no handler, it means the handler hasn't resolved yet which - // means that we should trigger the event later when the handler is available - if (!handler) { - handlerInfo.handlerPromise.then(bind(null, delayedEvent, name, args)); - continue; - } + var applicationInstance = this.applicationInstance; - if (handler.events && handler.events[name]) { - if (handler.events[name].apply(handler, args) === true) { - eventWasHandled = true; + if (applicationInstance) { + return _emberMetal.run(applicationInstance, 'visit', url, options); } else { - return; + return _emberMetal.run(this.application, 'visit', url, options).then(function (instance) { + _this.applicationInstance = instance; + }); } - } - } + }; - // In the case that we got an UnrecognizedURLError as an event with no handler, - // let it bubble up - if (name === 'error' && args[0].name === 'UnrecognizedURLError') { - throw args[0]; - } else if (!eventWasHandled && !ignoreFailure) { - throw new Error("Nothing handled the event '" + name + "'."); - } -} + AbstractApplicationTestCase.prototype.transitionTo = function transitionTo() { + return _emberMetal.run.apply(undefined, [this.appRouter, 'transitionTo'].concat(babelHelpers.slice.call(arguments))); + }; -function getChangelist(oldObject, newObject) { - var key; - var results = { - all: {}, - changed: {}, - removed: {} - }; + AbstractApplicationTestCase.prototype.compile = function compile(string, options) { + return _emberTemplateCompiler.compile.apply(undefined, arguments); + }; - merge(results.all, newObject); + AbstractApplicationTestCase.prototype.registerRoute = function registerRoute(name, route) { + this.application.register('route:' + name, route); + }; - var didChange = false; - coerceQueryParamsToString(oldObject); - coerceQueryParamsToString(newObject); + AbstractApplicationTestCase.prototype.registerTemplate = function registerTemplate(name, template) { + this.application.register('template:' + name, this.compile(template, { + moduleName: name + })); + }; - // Calculate removals - for (key in oldObject) { - if (oldObject.hasOwnProperty(key)) { - if (!newObject.hasOwnProperty(key)) { - didChange = true; - results.removed[key] = oldObject[key]; + AbstractApplicationTestCase.prototype.registerComponent = function registerComponent(name, _ref) { + var _ref$ComponentClass = _ref.ComponentClass; + var ComponentClass = _ref$ComponentClass === undefined ? null : _ref$ComponentClass; + var _ref$template = _ref.template; + var template = _ref$template === undefined ? null : _ref$template; + + if (ComponentClass) { + this.application.register('component:' + name, ComponentClass); } - } - } - // Calculate changes - for (key in newObject) { - if (newObject.hasOwnProperty(key)) { - if (isArray(oldObject[key]) && isArray(newObject[key])) { - if (oldObject[key].length !== newObject[key].length) { - results.changed[key] = newObject[key]; - didChange = true; - } else { - for (var i = 0, l = oldObject[key].length; i < l; i++) { - if (oldObject[key][i] !== newObject[key][i]) { - results.changed[key] = newObject[key]; - didChange = true; - } - } - } + if (typeof template === 'string') { + this.application.register('template:components/' + name, this.compile(template, { + moduleName: 'components/' + name + })); } - else { - if (oldObject[key] !== newObject[key]) { - results.changed[key] = newObject[key]; - didChange = true; - } + }; + + AbstractApplicationTestCase.prototype.registerController = function registerController(name, controller) { + this.application.register('controller:' + name, controller); + }; + + AbstractApplicationTestCase.prototype.registerEngine = function registerEngine(name, engine) { + this.application.register('engine:' + name, engine); + }; + + babelHelpers.createClass(AbstractApplicationTestCase, [{ + key: 'applicationOptions', + get: function () { + return { + rootElement: '#qunit-fixture', + autoboot: false + }; } - } - } + }, { + key: 'routerOptions', + get: function () { + return { + location: 'none' + }; + } + }, { + key: 'appRouter', + get: function () { + return this.applicationInstance.lookup('router:main'); + } + }]); + return AbstractApplicationTestCase; + })(_internalTestHelpersTestCasesAbstract.default); - return didChange && results; -} + exports.default = AbstractApplicationTestCase; +}); +enifed('internal-test-helpers/test-cases/abstract-rendering', ['exports', 'ember-utils', 'ember-template-compiler', 'ember-views', 'ember-glimmer', 'internal-test-helpers/test-cases/abstract', 'internal-test-helpers/build-owner', 'internal-test-helpers/run'], function (exports, _emberUtils, _emberTemplateCompiler, _emberViews, _emberGlimmer, _internalTestHelpersTestCasesAbstract, _internalTestHelpersBuildOwner, _internalTestHelpersRun) { + 'use strict'; -function promiseLabel(label) { - return 'Router: ' + label; -} + var TextNode = window.Text; -function subclass(parentConstructor, proto) { - function C(props) { - parentConstructor.call(this, props || {}); - } - C.prototype = oCreate(parentConstructor.prototype); - merge(C.prototype, proto); - return C; -} + var AbstractRenderingTestCase = (function (_AbstractTestCase) { + babelHelpers.inherits(AbstractRenderingTestCase, _AbstractTestCase); -function resolveHook(obj, hookName) { - if (!obj) { return; } - var underscored = "_" + hookName; - return obj[underscored] && underscored || - obj[hookName] && hookName; -} + function AbstractRenderingTestCase() { + babelHelpers.classCallCheck(this, AbstractRenderingTestCase); -function callHook(obj, _hookName, arg1, arg2) { - var hookName = resolveHook(obj, _hookName); - return hookName && obj[hookName].call(obj, arg1, arg2); -} + _AbstractTestCase.call(this); + var owner = this.owner = _internalTestHelpersBuildOwner.default({ + ownerOptions: this.getOwnerOptions(), + bootOptions: this.getBootOptions(), + resolver: this.getResolver() + }); -function applyHook(obj, _hookName, args) { - var hookName = resolveHook(obj, _hookName); - if (hookName) { - if (args.length === 0) { - return obj[hookName].call(obj); - } else if (args.length === 1) { - return obj[hookName].call(obj, args[0]); - } else if (args.length === 2) { - return obj[hookName].call(obj, args[0], args[1]); - } else { - return obj[hookName].apply(obj, args); + this.renderer = this.owner.lookup('renderer:-dom'); + this.element = _emberViews.jQuery('#qunit-fixture')[0]; + this.component = null; + + owner.register('event_dispatcher:main', _emberViews.EventDispatcher); + owner.inject('event_dispatcher:main', '_viewRegistry', '-view-registry:main'); + owner.lookup('event_dispatcher:main').setup(this.getCustomDispatcherEvents(), this.element); } - } -} -function TransitionState() { - this.handlerInfos = []; - this.queryParams = {}; - this.params = {}; -} + AbstractRenderingTestCase.prototype.compile = function compile() { + return _emberTemplateCompiler.compile.apply(undefined, arguments); + }; -TransitionState.prototype = { - promiseLabel: function(label) { - var targetName = ''; - forEach(this.handlerInfos, function(handlerInfo) { - if (targetName !== '') { - targetName += '.'; - } - targetName += handlerInfo.name; - }); - return promiseLabel("'" + targetName + "': " + label); - }, + AbstractRenderingTestCase.prototype.getCustomDispatcherEvents = function getCustomDispatcherEvents() { + return {}; + }; - resolve: function(shouldContinue, payload) { - // First, calculate params for this state. This is useful - // information to provide to the various route hooks. - var params = this.params; - forEach(this.handlerInfos, function(handlerInfo) { - params[handlerInfo.name] = handlerInfo.params || {}; - }); + AbstractRenderingTestCase.prototype.getOwnerOptions = function getOwnerOptions() {}; - payload = payload || {}; - payload.resolveIndex = 0; + AbstractRenderingTestCase.prototype.getBootOptions = function getBootOptions() {}; - var currentState = this; - var wasAborted = false; + AbstractRenderingTestCase.prototype.getResolver = function getResolver() {}; - // The prelude RSVP.resolve() asyncs us into the promise land. - return rsvp.Promise.resolve(null, this.promiseLabel("Start transition")) - .then(resolveOneHandlerInfo, null, this.promiseLabel('Resolve handler'))['catch'](handleError, this.promiseLabel('Handle error')); + AbstractRenderingTestCase.prototype.teardown = function teardown() { + if (this.component) { + _internalTestHelpersRun.runDestroy(this.component); + } + if (this.owner) { + _internalTestHelpersRun.runDestroy(this.owner); + } + }; - function innerShouldContinue() { - return rsvp.Promise.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 rsvp.Promise.reject(reason); - }, currentState.promiseLabel("Handle abort")); - } + AbstractRenderingTestCase.prototype.render = function render(templateStr) { + var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + var owner = this.owner; - function handleError(error) { - // This is the only possible - // reject value of TransitionState#resolve - var handlerInfos = currentState.handlerInfos; - var errorHandlerIndex = payload.resolveIndex >= handlerInfos.length ? - handlerInfos.length - 1 : payload.resolveIndex; - return rsvp.Promise.reject({ - error: error, - handlerWithError: currentState.handlerInfos[errorHandlerIndex].handler, - wasAborted: wasAborted, - state: currentState + owner.register('template:-top-level', this.compile(templateStr, { + moduleName: '-top-level' + })); + + var attrs = _emberUtils.assign({}, context, { + tagName: '', + layoutName: '-top-level' }); - } - function proceed(resolvedHandlerInfo) { - var wasAlreadyResolved = currentState.handlerInfos[payload.resolveIndex].isResolved; + owner.register('component:-top-level', _emberGlimmer.Component.extend(attrs)); - // Swap the previously unresolved handlerInfo with - // the resolved handlerInfo - currentState.handlerInfos[payload.resolveIndex++] = resolvedHandlerInfo; + this.component = owner.lookup('component:-top-level'); - if (!wasAlreadyResolved) { - // Call the redirect hook. The reason we call it here - // vs. afterModel is so that redirects into child - // routes don't re-run the model hooks for this - // already-resolved route. - var handler = resolvedHandlerInfo.handler; - callHook(handler, 'redirect', resolvedHandlerInfo.context, payload); + _internalTestHelpersRun.runAppend(this.component); + }; + + AbstractRenderingTestCase.prototype.rerender = function rerender() { + this.component.rerender(); + }; + + AbstractRenderingTestCase.prototype.registerHelper = function registerHelper(name, funcOrClassBody) { + var type = typeof funcOrClassBody; + + if (type === 'function') { + this.owner.register('helper:' + name, _emberGlimmer.helper(funcOrClassBody)); + } else if (type === 'object' && type !== null) { + this.owner.register('helper:' + name, _emberGlimmer.Helper.extend(funcOrClassBody)); + } else { + throw new Error('Cannot register ' + funcOrClassBody + ' as a helper'); } + }; - // Proceed after ensuring that the redirect hook - // didn't abort this transition by transitioning elsewhere. - return innerShouldContinue().then(resolveOneHandlerInfo, null, currentState.promiseLabel('Resolve handler')); - } + AbstractRenderingTestCase.prototype.registerPartial = function registerPartial(name, template) { + var owner = this.env.owner || this.owner; + if (typeof template === 'string') { + var moduleName = 'template:' + name; + owner.register(moduleName, this.compile(template, { moduleName: moduleName })); + } + }; - function resolveOneHandlerInfo() { - if (payload.resolveIndex === currentState.handlerInfos.length) { - // This is is the only possible - // fulfill value of TransitionState#resolve - return { - error: null, - state: currentState - }; + AbstractRenderingTestCase.prototype.registerComponent = function registerComponent(name, _ref) { + var _ref$ComponentClass = _ref.ComponentClass; + var ComponentClass = _ref$ComponentClass === undefined ? null : _ref$ComponentClass; + var _ref$template = _ref.template; + var template = _ref$template === undefined ? null : _ref$template; + var owner = this.owner; + + if (ComponentClass) { + owner.register('component:' + name, ComponentClass); } - var handlerInfo = currentState.handlerInfos[payload.resolveIndex]; + if (typeof template === 'string') { + owner.register('template:components/' + name, this.compile(template, { + moduleName: 'components/' + name + })); + } + }; - return handlerInfo.resolve(innerShouldContinue, payload) - .then(proceed, null, currentState.promiseLabel('Proceed')); - } - } -}; + AbstractRenderingTestCase.prototype.registerTemplate = function registerTemplate(name, template) { + var owner = this.owner; -/** - A Transition is a thennable (a promise-like object) that represents - an attempt to transition to another route. It can be aborted, either - explicitly via `abort` or by attempting another transition while a - previous one is still underway. An aborted transition can also - be `retry()`d later. + if (typeof template === 'string') { + owner.register('template:' + name, this.compile(template, { + moduleName: name + })); + } else { + throw new Error('Registered template "' + name + '" must be a string'); + } + }; - @class Transition - @constructor - @param {Object} router - @param {Object} intent - @param {Object} state - @param {Object} error - @private - */ -function Transition(router, intent, state, error, previousTransition) { - var transition = this; - this.state = state || router.state; - this.intent = intent; - this.router = router; - this.data = this.intent && this.intent.data || {}; - this.resolvedModels = {}; - this.queryParams = {}; - this.promise = undefined; - this.error = undefined; - this.params = undefined; - this.handlerInfos = undefined; - this.targetName = undefined; - this.pivotHandler = undefined; - this.sequence = undefined; - this.isAborted = false; - this.isActive = true; + AbstractRenderingTestCase.prototype.registerService = function registerService(name, klass) { + this.owner.register('service:' + name, klass); + }; - if (error) { - this.promise = rsvp.Promise.reject(error); - this.error = error; - return; - } + AbstractRenderingTestCase.prototype.assertTextNode = function assertTextNode(node, text) { + if (!(node instanceof TextNode)) { + throw new Error('Expecting a text node, but got ' + node); + } - // if you're doing multiple redirects, need the new transition to know if it - // is actually part of the first transition or not. Any further redirects - // in the initial transition also need to know if they are part of the - // initial transition - this.isCausedByAbortingTransition = !!previousTransition; - this.isCausedByInitialTransition = ( - previousTransition && ( - previousTransition.isCausedByInitialTransition || - previousTransition.sequence === 0 - ) - ); + this.assert.strictEqual(node.textContent, text, 'node.textContent'); + }; + + babelHelpers.createClass(AbstractRenderingTestCase, [{ + key: 'context', + get: function () { + return this.component; + } + }]); + return AbstractRenderingTestCase; + })(_internalTestHelpersTestCasesAbstract.default); - if (state) { - this.params = state.params; - this.queryParams = state.queryParams; - this.handlerInfos = state.handlerInfos; + exports.default = AbstractRenderingTestCase; +}); +enifed('internal-test-helpers/test-cases/abstract', ['exports', 'ember-utils', 'ember-metal', 'ember-views', 'internal-test-helpers/equal-inner-html', 'internal-test-helpers/equal-tokens', 'internal-test-helpers/matchers'], function (exports, _emberUtils, _emberMetal, _emberViews, _internalTestHelpersEqualInnerHtml, _internalTestHelpersEqualTokens, _internalTestHelpersMatchers) { + 'use strict'; - var len = state.handlerInfos.length; - if (len) { - this.targetName = state.handlerInfos[len-1].name; - } + var TextNode = window.Text; + var HTMLElement = window.HTMLElement; + var Comment = window.Comment; - for (var i = 0; i < len; ++i) { - var handlerInfo = state.handlerInfos[i]; + function isMarker(node) { + if (node instanceof Comment && node.textContent === '') { + return true; + } - // TODO: this all seems hacky - if (!handlerInfo.isResolved) { break; } - this.pivotHandler = handlerInfo.handler; + if (node instanceof TextNode && node.textContent === '') { + return true; } - this.sequence = router.currentSequence++; - this.promise = state.resolve(checkForAbort, this)['catch']( - catchHandlerForTransition(transition), promiseLabel('Handle Abort')); - } else { - this.promise = rsvp.Promise.resolve(this.state); - this.params = {}; + return false; } - function checkForAbort() { - if (transition.isAborted) { - return rsvp.Promise.reject(undefined, promiseLabel("Transition aborted - reject")); - } - } -} + var AbstractTestCase = (function () { + function AbstractTestCase() { + babelHelpers.classCallCheck(this, AbstractTestCase); -function catchHandlerForTransition(transition) { - return function(result) { - if (result.wasAborted || transition.isAborted) { - return rsvp.Promise.reject(logAbort(transition)); - } else { - transition.trigger('error', result.error, transition, result.handlerWithError); - transition.abort(); - return rsvp.Promise.reject(result.error); + this.element = null; + this.snapshot = null; + this.assert = QUnit.config.current.assert; } - }; -} + AbstractTestCase.prototype.teardown = function teardown() {}; -Transition.prototype = { - targetName: null, - urlMethod: 'update', - intent: null, - pivotHandler: null, - resolveIndex: 0, - resolvedModels: null, - state: null, - queryParamsOnly: false, + AbstractTestCase.prototype.runTask = function runTask(callback) { + _emberMetal.run(callback); + }; - isTransition: true, + AbstractTestCase.prototype.runTaskNext = function runTaskNext(callback) { + _emberMetal.run.next(callback); + }; - isExiting: function(handler) { - var handlerInfos = this.handlerInfos; - for (var i = 0, len = handlerInfos.length; i < len; ++i) { - var handlerInfo = handlerInfos[i]; - if (handlerInfo.name === handler || handlerInfo.handler === handler) { - return false; - } - } - return true; - }, + // The following methods require `this.element` to work - /** - The Transition's internal promise. Calling `.then` on this property - is that same as calling `.then` on the Transition object itself, but - this property is exposed for when you want to pass around a - Transition's promise, but not the Transition object itself, since - Transition object can be externally `abort`ed, while the promise - cannot. + AbstractTestCase.prototype.nthChild = function nthChild(n) { + var i = 0; + var node = this.element.firstChild; - @property promise - @type {Object} - @public - */ - promise: null, + while (node) { + if (!isMarker(node)) { + i++; + } - /** - Custom state can be stored on a Transition's `data` object. - This can be useful for decorating a Transition within an earlier - hook and shared with a later hook. Properties set on `data` will - be copied to new transitions generated by calling `retry` on this - transition. + if (i > n) { + break; + } else { + node = node.nextSibling; + } + } - @property data - @type {Object} - @public - */ - data: null, + return node; + }; - /** - A standard promise hook that resolves if the transition - succeeds and rejects if it fails/redirects/aborts. + AbstractTestCase.prototype.$ = function $(sel) { + return sel ? _emberViews.jQuery(sel, this.element) : _emberViews.jQuery(this.element); + }; - Forwards to the internal `promise` property which you can - use in situations where you want to pass around a thennable, - but not the Transition itself. + AbstractTestCase.prototype.textValue = function textValue() { + return this.$().text(); + }; - @method then - @param {Function} onFulfilled - @param {Function} onRejected - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - @public - */ - then: function(onFulfilled, onRejected, label) { - return this.promise.then(onFulfilled, onRejected, label); - }, + AbstractTestCase.prototype.takeSnapshot = function takeSnapshot() { + var snapshot = this.snapshot = []; - /** + var node = this.element.firstChild; - Forwards to the internal `promise` property which you can - use in situations where you want to pass around a thennable, - but not the Transition itself. + while (node) { + if (!isMarker(node)) { + snapshot.push(node); + } - @method catch - @param {Function} onRejection - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - @public - */ - catch: function(onRejection, label) { - return this.promise.catch(onRejection, label); - }, + node = node.nextSibling; + } - /** + return snapshot; + }; - Forwards to the internal `promise` property which you can - use in situations where you want to pass around a thennable, - but not the Transition itself. + AbstractTestCase.prototype.assertText = function assertText(text) { + this.assert.strictEqual(this.textValue(), text, '#qunit-fixture content should be: `' + text + '`'); + }; - @method finally - @param {Function} callback - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - @public - */ - finally: function(callback, label) { - return this.promise.finally(callback, label); - }, + AbstractTestCase.prototype.assertInnerHTML = function assertInnerHTML(html) { + _internalTestHelpersEqualInnerHtml.default(this.element, html); + }; - /** - Aborts the Transition. Note you can also implicitly abort a transition - by initiating another transition while a previous one is underway. + AbstractTestCase.prototype.assertHTML = function assertHTML(html) { + _internalTestHelpersEqualTokens.default(this.element, html, '#qunit-fixture content should be: `' + html + '`'); + }; - @method abort - @return {Transition} this transition - @public - */ - abort: function() { - if (this.isAborted) { return this; } - 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; - }, + AbstractTestCase.prototype.assertElement = function assertElement(node, _ref) { + var _ref$ElementType = _ref.ElementType; + var ElementType = _ref$ElementType === undefined ? HTMLElement : _ref$ElementType; + var tagName = _ref.tagName; + var _ref$attrs = _ref.attrs; + var attrs = _ref$attrs === undefined ? null : _ref$attrs; + var _ref$content = _ref.content; + var content = _ref$content === undefined ? null : _ref$content; - /** + if (!(node instanceof ElementType)) { + throw new Error('Expecting a ' + ElementType.name + ', but got ' + node); + } - Retries a previously-aborted transition (making sure to abort the - transition if it's still active). Returns a new transition that - represents the new attempt to transition. + _internalTestHelpersMatchers.equalsElement(node, tagName, attrs, content); + }; - @method retry - @return {Transition} new transition - @public - */ - retry: function() { - // TODO: add tests for merged state retry()s - this.abort(); - return this.router.transitionByIntent(this.intent, false); - }, + AbstractTestCase.prototype.assertComponentElement = function assertComponentElement(node, _ref2) { + var _ref2$ElementType = _ref2.ElementType; + var ElementType = _ref2$ElementType === undefined ? HTMLElement : _ref2$ElementType; + var _ref2$tagName = _ref2.tagName; + var tagName = _ref2$tagName === undefined ? 'div' : _ref2$tagName; + var _ref2$attrs = _ref2.attrs; + var attrs = _ref2$attrs === undefined ? null : _ref2$attrs; + var _ref2$content = _ref2.content; + var content = _ref2$content === undefined ? null : _ref2$content; - /** + attrs = _emberUtils.assign({}, { id: _internalTestHelpersMatchers.regex(/^ember\d*$/), class: _internalTestHelpersMatchers.classes('ember-view') }, attrs || {}); + this.assertElement(node, { ElementType: ElementType, tagName: tagName, attrs: attrs, content: content }); + }; - Sets the URL-changing method to be employed at the end of a - successful transition. By default, a new Transition will just - use `updateURL`, but passing 'replace' to this method will - cause the URL to update using 'replaceWith' instead. Omitting - a parameter will disable the URL change, allowing for transitions - that don't update the URL at completion (this is also used for - handleURL, since the URL has already changed before the - transition took place). + AbstractTestCase.prototype.assertSameNode = function assertSameNode(actual, expected) { + this.assert.strictEqual(actual, expected, 'DOM node stability'); + }; - @method method - @param {String} method the type of URL-changing method to use - at the end of a transition. Accepted values are 'replace', - falsy values, or any other non-falsy value (which is - interpreted as an updateURL transition). + AbstractTestCase.prototype.assertInvariants = function assertInvariants(oldSnapshot, newSnapshot) { + oldSnapshot = oldSnapshot || this.snapshot; + newSnapshot = newSnapshot || this.takeSnapshot(); - @return {Transition} this transition - @public - */ - method: function(method) { - this.urlMethod = method; - return this; - }, + this.assert.strictEqual(newSnapshot.length, oldSnapshot.length, 'Same number of nodes'); - /** + for (var i = 0; i < oldSnapshot.length; i++) { + this.assertSameNode(newSnapshot[i], oldSnapshot[i]); + } + }; - Fires an event on the current list of resolved/resolving - handlers within this transition. Useful for firing events - on route hierarchies that haven't fully been entered yet. + AbstractTestCase.prototype.assertPartialInvariants = function assertPartialInvariants(start, end) { + this.assertInvariants(this.snapshot, this.takeSnapshot().slice(start, end)); + }; - Note: This method is also aliased as `send` + AbstractTestCase.prototype.assertStableRerender = function assertStableRerender() { + var _this = this; - @method trigger - @param {Boolean} [ignoreFailure=false] a boolean specifying whether unhandled events throw an error - @param {String} name the name of the event to fire - @public - */ - trigger: function (ignoreFailure) { - var args = slice.call(arguments); - if (typeof ignoreFailure === 'boolean') { - args.shift(); - } else { - // Throw errors on unhandled trigger events by default - ignoreFailure = false; - } - trigger(this.router, this.state.handlerInfos.slice(0, this.resolveIndex + 1), ignoreFailure, args); - }, + this.takeSnapshot(); + this.runTask(function () { + return _this.rerender(); + }); + this.assertInvariants(); + }; - /** - Transitions are aborted and their promises rejected - when redirects occur; this method returns a promise - that will follow any redirects that occur and fulfill - with the value fulfilled by any redirecting transitions - that occur. + babelHelpers.createClass(AbstractTestCase, [{ + key: 'firstChild', + get: function () { + return this.nthChild(0); + } + }, { + key: 'nodesCount', + get: function () { + var count = 0; + var node = this.element.firstChild; - @method followRedirects - @return {Promise} a promise that fulfills with the same - value that the final redirecting transition fulfills with - @public - */ - followRedirects: function() { - var router = this.router; - return this.promise['catch'](function(reason) { - if (router.activeTransition) { - return router.activeTransition.followRedirects(); + while (node) { + if (!isMarker(node)) { + count++; + } + + node = node.nextSibling; + } + + return count; } - return rsvp.Promise.reject(reason); - }); - }, + }]); + return AbstractTestCase; + })(); - toString: function() { - return "Transition (sequence " + this.sequence + ")"; - }, + exports.default = AbstractTestCase; +}); +enifed('internal-test-helpers/test-cases/application', ['exports', 'internal-test-helpers/test-cases/abstract-application'], function (exports, _internalTestHelpersTestCasesAbstractApplication) { + 'use strict'; - /** - @private - */ - log: function(message) { - log(this.router, this.sequence, message); - } -}; + var ApplicationTestCase = (function (_AbstractApplicationTestCase) { + babelHelpers.inherits(ApplicationTestCase, _AbstractApplicationTestCase); -// Alias 'trigger' as 'send' -Transition.prototype.send = Transition.prototype.trigger; + function ApplicationTestCase() { + babelHelpers.classCallCheck(this, ApplicationTestCase); -/** - @private + _AbstractApplicationTestCase.apply(this, arguments); + } - Logs and returns a TransitionAborted error. - */ -function logAbort(transition) { - log(transition.router, transition.sequence, "detected abort."); - return new TransitionAborted(); -} + return ApplicationTestCase; + })(_internalTestHelpersTestCasesAbstractApplication.default); -function TransitionAborted(message) { - this.message = (message || "TransitionAborted"); - this.name = "TransitionAborted"; -} + exports.default = ApplicationTestCase; +}); +enifed('internal-test-helpers/test-cases/query-param', ['exports', 'ember-runtime', 'ember-routing', 'ember-metal', 'internal-test-helpers/test-cases/application'], function (exports, _emberRuntime, _emberRouting, _emberMetal, _internalTestHelpersTestCasesApplication) { + 'use strict'; -function TransitionIntent(props) { - this.initialize(props); + var QueryParamTestCase = (function (_ApplicationTestCase) { + babelHelpers.inherits(QueryParamTestCase, _ApplicationTestCase); - // TODO: wat - this.data = this.data || {}; -} + function QueryParamTestCase() { + babelHelpers.classCallCheck(this, QueryParamTestCase); -TransitionIntent.prototype = { - initialize: null, - applyToState: null -}; + _ApplicationTestCase.call(this); -var DEFAULT_HANDLER = Object.freeze({}); + var testCase = this; + testCase.expectedPushURL = null; + testCase.expectedReplaceURL = null; + this.application.register('location:test', _emberRouting.NoneLocation.extend({ + setURL: function (path) { + if (testCase.expectedReplaceURL) { + testCase.assert.ok(false, 'pushState occurred but a replaceState was expected'); + } -function HandlerInfo(_props) { - var props = _props || {}; + if (testCase.expectedPushURL) { + testCase.assert.equal(path, testCase.expectedPushURL, 'an expected pushState occurred'); + testCase.expectedPushURL = null; + } - // Set a default handler to ensure consistent object shape - this._handler = DEFAULT_HANDLER; + this.set('path', path); + }, - if (props.handler) { - var name = props.name; + replaceURL: function (path) { + if (testCase.expectedPushURL) { + testCase.assert.ok(false, 'replaceState occurred but a pushState was expected'); + } - // Setup a handlerPromise so that we can wait for asynchronously loaded handlers - this.handlerPromise = rsvp.Promise.resolve(props.handler); + if (testCase.expectedReplaceURL) { + testCase.assert.equal(path, testCase.expectedReplaceURL, 'an expected replaceState occurred'); + testCase.expectedReplaceURL = null; + } - // Wait until the 'handler' property has been updated when chaining to a handler - // that is a promise - if (isPromise(props.handler)) { - this.handlerPromise = this.handlerPromise.then(bind(this, this.updateHandler)); - props.handler = undefined; - } else if (props.handler) { - // Store the name of the handler on the handler for easy checks later - props.handler._handlerName = name; + this.set('path', path); + } + })); } - } - merge(this, props); - this.initialize(props); -} + QueryParamTestCase.prototype.visitAndAssert = function visitAndAssert(path) { + var _this = this; -HandlerInfo.prototype = { - name: null, + return this.visit.apply(this, arguments).then(function () { + _this.assertCurrentPath(path); + }); + }; - getHandler: function() {}, + QueryParamTestCase.prototype.getController = function getController(name) { + return this.applicationInstance.lookup('controller:' + name); + }; - fetchHandler: function() { - var handler = this.getHandler(this.name); + QueryParamTestCase.prototype.getRoute = function getRoute(name) { + return this.applicationInstance.lookup('route:' + name); + }; - // Setup a handlerPromise so that we can wait for asynchronously loaded handlers - this.handlerPromise = rsvp.Promise.resolve(handler); + QueryParamTestCase.prototype.setAndFlush = function setAndFlush(obj, prop, value) { + return _emberMetal.run(obj, 'set', prop, value); + }; - // Wait until the 'handler' property has been updated when chaining to a handler - // that is a promise - if (isPromise(handler)) { - this.handlerPromise = this.handlerPromise.then(bind(this, this.updateHandler)); - } else if (handler) { - // Store the name of the handler on the handler for easy checks later - handler._handlerName = this.name; - return this.handler = handler; - } + QueryParamTestCase.prototype.assertCurrentPath = function assertCurrentPath(path) { + var message = arguments.length <= 1 || arguments[1] === undefined ? 'current path equals \'' + path + '\'' : arguments[1]; + return (function () { + this.assert.equal(this.appRouter.get('location.path'), path, message); + }).apply(this, arguments); + }; - return this.handler = undefined; - }, + /** + Sets up a Controller for a given route with a single query param and default + value. Can optionally extend the controller with an object. + @public + @method setSingleQPController + */ - _handlerPromise: undefined, + QueryParamTestCase.prototype.setSingleQPController = function setSingleQPController(routeName) { + var param = arguments.length <= 1 || arguments[1] === undefined ? 'foo' : arguments[1]; + var defaultValue = arguments.length <= 2 || arguments[2] === undefined ? 'bar' : arguments[2]; - params: null, - context: null, + var _Controller$extend; + + var options = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3]; + + this.registerController(routeName, _emberRuntime.Controller.extend((_Controller$extend = { + queryParams: [param] + }, _Controller$extend[param] = defaultValue, _Controller$extend), options)); + }; + + /** + Sets up a Controller for a given route with a custom property/url key mapping. + @public + @method setMappedQPController + */ - // Injected by the handler info factory. - factory: null, + QueryParamTestCase.prototype.setMappedQPController = function setMappedQPController(routeName) { + var prop = arguments.length <= 1 || arguments[1] === undefined ? 'page' : arguments[1]; + var urlKey = arguments.length <= 2 || arguments[2] === undefined ? 'parentPage' : arguments[2]; + var defaultValue = arguments.length <= 3 || arguments[3] === undefined ? 1 : arguments[3]; - initialize: function() {}, + var _queryParams, _Controller$extend2; - log: function(payload, message) { - if (payload.log) { - payload.log(this.name + ': ' + message); - } - }, + var options = arguments.length <= 4 || arguments[4] === undefined ? {} : arguments[4]; - promiseLabel: function(label) { - return promiseLabel("'" + this.name + "' " + label); - }, + this.registerController(routeName, _emberRuntime.Controller.extend((_Controller$extend2 = { + queryParams: (_queryParams = {}, _queryParams[prop] = urlKey, _queryParams) + }, _Controller$extend2[prop] = defaultValue, _Controller$extend2), options)); + }; - getUnresolved: function() { - return this; - }, + babelHelpers.createClass(QueryParamTestCase, [{ + key: 'routerOptions', + get: function () { + return { + location: 'test' + }; + } + }]); + return QueryParamTestCase; + })(_internalTestHelpersTestCasesApplication.default); - serialize: function() { - return this.params || {}; - }, + exports.default = QueryParamTestCase; +}); +enifed('internal-test-helpers/test-cases/rendering', ['exports', 'ember-views', 'internal-test-helpers/test-cases/abstract-rendering'], function (exports, _emberViews, _internalTestHelpersTestCasesAbstractRendering) { + 'use strict'; - updateHandler: function(handler) { - // Store the name of the handler on the handler for easy checks later - handler._handlerName = this.name; - return this.handler = handler; - }, + var RenderingTestCase = (function (_AbstractRenderingTestCase) { + babelHelpers.inherits(RenderingTestCase, _AbstractRenderingTestCase); - resolve: function(shouldContinue, payload) { - var checkForAbort = bind(this, this.checkForAbort, shouldContinue), - beforeModel = bind(this, this.runBeforeModelHook, payload), - model = bind(this, this.getModel, payload), - afterModel = bind(this, this.runAfterModelHook, payload), - becomeResolved = bind(this, this.becomeResolved, payload), - self = this; + function RenderingTestCase() { + babelHelpers.classCallCheck(this, RenderingTestCase); - return rsvp.Promise.resolve(this.handlerPromise, this.promiseLabel("Start handler")) - .then(function(handler) { - // We nest this chain in case the handlerPromise has an error so that - // we don't have to bubble it through every step - return rsvp.Promise.resolve(handler) - .then(checkForAbort, null, self.promiseLabel("Check for abort")) - .then(beforeModel, null, self.promiseLabel("Before model")) - .then(checkForAbort, null, self.promiseLabel("Check if aborted during 'beforeModel' hook")) - .then(model, null, self.promiseLabel("Model")) - .then(checkForAbort, null, self.promiseLabel("Check if aborted in 'model' hook")) - .then(afterModel, null, self.promiseLabel("After model")) - .then(checkForAbort, null, self.promiseLabel("Check if aborted in 'afterModel' hook")) - .then(becomeResolved, null, self.promiseLabel("Become resolved")); - }, function(error) { - throw error; - }); - }, + _AbstractRenderingTestCase.call(this); + var owner = this.owner; - runBeforeModelHook: function(payload) { - if (payload.trigger) { - payload.trigger(true, 'willResolveModel', payload, this.handler); + this.env = owner.lookup('service:-glimmer-environment'); + owner.register('component-lookup:main', _emberViews.ComponentLookup); + owner.registerOptionsForType('helper', { instantiate: false }); + owner.registerOptionsForType('component', { singleton: false }); } - return this.runSharedModelHook(payload, 'beforeModel', []); - }, - runAfterModelHook: function(payload, resolvedModel) { - // Stash the resolved model on the payload. - // This makes it possible for users to swap out - // the resolved model in afterModel. - var name = this.name; - this.stashResolvedModel(payload, resolvedModel); + return RenderingTestCase; + })(_internalTestHelpersTestCasesAbstractRendering.default); - 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")); - }, + exports.default = RenderingTestCase; +}); +enifed('internal-test-helpers/test-cases/router', ['exports', 'internal-test-helpers/test-cases/application'], function (exports, _internalTestHelpersTestCasesApplication) { + 'use strict'; - runSharedModelHook: function(payload, hookName, args) { - this.log(payload, "calling " + hookName + " hook"); + var RouterTestCase = (function (_ApplicationTestCase) { + babelHelpers.inherits(RouterTestCase, _ApplicationTestCase); - if (this.queryParams) { - args.push(this.queryParams); - } - args.push(payload); + function RouterTestCase() { + babelHelpers.classCallCheck(this, RouterTestCase); - var result = applyHook(this.handler, hookName, args); + _ApplicationTestCase.call(this); - if (result && result.isTransition) { - result = null; + this.router.map(function () { + this.route('parent', { path: '/' }, function () { + this.route('child'); + this.route('sister'); + this.route('brother'); + }); + this.route('dynamic', { path: '/dynamic/:post_id' }); + }); } - return rsvp.Promise.resolve(result, this.promiseLabel("Resolve value returned from one of the model hooks")); - }, - - // overridden by subclasses - getModel: null, + babelHelpers.createClass(RouterTestCase, [{ + key: 'routerService', + get: function () { + return this.applicationInstance.lookup('service:router'); + } + }]); + return RouterTestCase; + })(_internalTestHelpersTestCasesApplication.default); - checkForAbort: function(shouldContinue, promiseValue) { - return rsvp.Promise.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")); - }, + exports.default = RouterTestCase; +}); +enifed('internal-test-helpers/test-groups', ['exports', 'ember-environment', 'ember-metal'], function (exports, _emberEnvironment, _emberMetal) { + 'use strict'; - stashResolvedModel: function(payload, resolvedModel) { - payload.resolvedModels = payload.resolvedModels || {}; - payload.resolvedModels[this.name] = resolvedModel; - }, + exports.testBoth = testBoth; + exports.testWithDefault = testWithDefault; - becomeResolved: function(payload, resolvedContext) { - var params = this.serialize(resolvedContext); + // used by unit tests to test both accessor mode and non-accessor mode - if (payload) { - this.stashResolvedModel(payload, resolvedContext); - payload.params = payload.params || {}; - payload.params[this.name] = params; + function testBoth(testname, callback) { + function emberget(x, y) { + return _emberMetal.get(x, y); + } + function emberset(x, y, z) { + return _emberMetal.set(x, y, z); + } + function aget(x, y) { + return x[y]; + } + function aset(x, y, z) { + return x[y] = z; } - return this.factory('resolved', { - context: resolvedContext, - name: this.name, - handler: this.handler, - params: params + QUnit.test(testname + ' using getFromEmberMetal()/Ember.set()', function () { + callback(emberget, emberset); }); - }, - - shouldSupercede: function(other) { - // Prefer this newer handlerInfo over `other` if: - // 1) The other one doesn't exist - // 2) The names don't match - // 3) This handler has a context that doesn't match - // the other one (or the other one doesn't have one). - // 4) This handler has parameters that don't match the other. - if (!other) { return true; } - var contextsMatch = (other.context === this.context); - return other.name !== this.name || - (this.hasOwnProperty('context') && !contextsMatch) || - (this.hasOwnProperty('params') && !paramsMatch(this.params, other.params)); + QUnit.test(testname + ' using accessors', function () { + if (_emberEnvironment.ENV.USES_ACCESSORS) { + callback(aget, aset); + } else { + ok('SKIPPING ACCESSORS'); + } + }); } -}; -Object.defineProperty(HandlerInfo.prototype, 'handler', { - get: function() { - // _handler could be set to either a handler object or undefined, so we - // compare against a default reference to know when it's been set - if (this._handler !== DEFAULT_HANDLER) { - return this._handler; + function testWithDefault(testname, callback) { + function emberget(x, y) { + return _emberMetal.get(x, y); + } + function embergetwithdefault(x, y, z) { + return _emberMetal.getWithDefault(x, y, z); + } + function getwithdefault(x, y, z) { + return x.getWithDefault(y, z); + } + function emberset(x, y, z) { + return _emberMetal.set(x, y, z); + } + function aget(x, y) { + return x[y]; + } + function aset(x, y, z) { + return x[y] = z; } - return this.fetchHandler(); - }, - - set: function(handler) { - return this._handler = handler; - } -}); + QUnit.test(testname + ' using obj.get()', function () { + callback(emberget, emberset); + }); -Object.defineProperty(HandlerInfo.prototype, 'handlerPromise', { - get: function() { - if (this._handlerPromise) { - return this._handlerPromise; - } + QUnit.test(testname + ' using obj.getWithDefault()', function () { + callback(getwithdefault, emberset); + }); - this.fetchHandler(); + QUnit.test(testname + ' using getFromEmberMetal()', function () { + callback(emberget, emberset); + }); - return this._handlerPromise; - }, + QUnit.test(testname + ' using Ember.getWithDefault()', function () { + callback(embergetwithdefault, emberset); + }); - set: function(handlerPromise) { - return this._handlerPromise = handlerPromise; + QUnit.test(testname + ' using accessors', function () { + if (_emberEnvironment.ENV.USES_ACCESSORS) { + callback(aget, aset); + } else { + ok('SKIPPING ACCESSORS'); + } + }); } }); +enifed('route-recognizer', ['exports'], function (exports) { 'use strict'; -function paramsMatch(a, b) { - if ((!a) ^ (!b)) { - // Only one is null. - return false; - } - - if (!a) { - // Both must be null. - return true; - } +var createObject = Object.create; +function createMap() { + var map = createObject(null); + map["__"] = undefined; + delete map["__"]; + return map; +} - // Note: this assumes that both params have the same - // number of keys, but since we're comparing the - // same handlers, they should. - for (var k in a) { - if (a.hasOwnProperty(k) && a[k] !== b[k]) { - return false; +var Target = function Target(path, matcher, delegate) { + this.path = path; + this.matcher = matcher; + this.delegate = delegate; +}; +Target.prototype.to = function to (target, callback) { + var delegate = this.delegate; + if (delegate && delegate.willAddRoute) { + target = delegate.willAddRoute(this.matcher.target, target); } - } - return true; + this.matcher.add(this.path, target); + if (callback) { + if (callback.length === 0) { + throw new Error("You must have an argument in the function passed to `to`"); + } + this.matcher.addChild(this.path, target, callback, this.delegate); + } +}; +var Matcher = function Matcher(target) { + this.routes = createMap(); + this.children = createMap(); + this.target = target; +}; +Matcher.prototype.add = function add (path, target) { + this.routes[path] = target; +}; +Matcher.prototype.addChild = function addChild (path, target, callback, delegate) { + var matcher = new Matcher(target); + this.children[path] = matcher; + var match = generateMatch(path, matcher, delegate); + if (delegate && delegate.contextEntered) { + delegate.contextEntered(target, match); + } + callback(match); +}; +function generateMatch(startingPath, matcher, delegate) { + function match(path, callback) { + var fullPath = startingPath + path; + if (callback) { + callback(generateMatch(fullPath, matcher, delegate)); + } + else { + return new Target(fullPath, matcher, delegate); + } + } + ; + return match; } - -var ResolvedHandlerInfo = subclass(HandlerInfo, { - resolve: function(shouldContinue, payload) { - // A ResolvedHandlerInfo just resolved with itself. - if (payload && payload.resolvedModels) { - payload.resolvedModels[this.name] = this.context; +function addRoute(routeArray, path, handler) { + var len = 0; + for (var i = 0; i < routeArray.length; i++) { + len += routeArray[i].path.length; } - return rsvp.Promise.resolve(this, this.promiseLabel("Resolve")); - }, - - getUnresolved: function() { - return this.factory('param', { - name: this.name, - handler: this.handler, - params: this.params - }); - }, - - isResolved: true -}); - -var UnresolvedHandlerInfoByObject = subclass(HandlerInfo, { - getModel: function(payload) { - this.log(payload, this.name + ": resolving provided model"); - return rsvp.Promise.resolve(this.context); - }, - - initialize: function(props) { - this.names = props.names || []; - this.context = props.context; - }, + path = path.substr(len); + var route = { path: path, handler: handler }; + routeArray.push(route); +} +function eachRoute(baseRoute, matcher, callback, binding) { + var routes = matcher.routes; + var paths = Object.keys(routes); + for (var i = 0; i < paths.length; i++) { + var path = paths[i]; + var routeArray = baseRoute.slice(); + addRoute(routeArray, path, routes[path]); + var nested = matcher.children[path]; + if (nested) { + eachRoute(routeArray, nested, callback, binding); + } + else { + callback.call(binding, routeArray); + } + } +} +function map (callback, addRouteCallback) { + var matcher = new Matcher(); + callback(generateMatch("", matcher, this.delegate)); + eachRoute([], matcher, function (routes) { + if (addRouteCallback) { + addRouteCallback(this, routes); + } + else { + this.add(routes); + } + }, this); +} - /** - @private +// Normalizes percent-encoded values in `path` to upper-case and decodes percent-encoded +// values that are not reserved (i.e., unicode characters, emoji, etc). The reserved +// chars are "/" and "%". +// Safe to call multiple times on the same path. +// Normalizes percent-encoded values in `path` to upper-case and decodes percent-encoded +function normalizePath(path) { + return path.split("/") + .map(normalizeSegment) + .join("/"); +} +// We want to ensure the characters "%" and "/" remain in percent-encoded +// form when normalizing paths, so replace them with their encoded form after +// decoding the rest of the path +var SEGMENT_RESERVED_CHARS = /%|\//g; +function normalizeSegment(segment) { + if (segment.length < 3 || segment.indexOf("%") === -1) + { return segment; } + return decodeURIComponent(segment).replace(SEGMENT_RESERVED_CHARS, encodeURIComponent); +} +// We do not want to encode these characters when generating dynamic path segments +// See https://tools.ietf.org/html/rfc3986#section-3.3 +// sub-delims: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=" +// others allowed by RFC 3986: ":", "@" +// +// First encode the entire path segment, then decode any of the encoded special chars. +// +// The chars "!", "'", "(", ")", "*" do not get changed by `encodeURIComponent`, +// so the possible encoded chars are: +// ['%24', '%26', '%2B', '%2C', '%3B', '%3D', '%3A', '%40']. +var PATH_SEGMENT_ENCODINGS = /%(?:2(?:4|6|B|C)|3(?:B|D|A)|40)/g; +function encodePathSegment(str) { + return encodeURIComponent(str).replace(PATH_SEGMENT_ENCODINGS, decodeURIComponent); +} - Serializes a handler using its custom `serialize` method or - by a default that looks up the expected property name from - the dynamic segment. +var escapeRegex = /(\/|\.|\*|\+|\?|\||\(|\)|\[|\]|\{|\}|\\)/g; +var isArray = Array.isArray; +var hasOwnProperty = Object.prototype.hasOwnProperty; +function getParam(params, key) { + if (typeof params !== "object" || params === null) { + throw new Error("You must pass an object as the second argument to `generate`."); + } + if (!hasOwnProperty.call(params, key)) { + throw new Error("You must provide param `" + key + "` to `generate`."); + } + var value = params[key]; + var str = typeof value === "string" ? value : "" + value; + if (str.length === 0) { + throw new Error("You must provide a param `" + key + "`."); + } + return str; +} +var eachChar = []; +eachChar[0 /* Static */] = function (segment, currentState) { + var state = currentState; + var value = segment.value; + for (var i = 0; i < value.length; i++) { + var ch = value.charCodeAt(i); + state = state.put(ch, false, false); + } + return state; +}; +eachChar[1 /* Dynamic */] = function (_, currentState) { + return currentState.put(47 /* SLASH */, true, true); +}; +eachChar[2 /* Star */] = function (_, currentState) { + return currentState.put(-1 /* ANY */, false, true); +}; +eachChar[4 /* Epsilon */] = function (_, currentState) { + return currentState; +}; +var regex = []; +regex[0 /* Static */] = function (segment) { + return segment.value.replace(escapeRegex, "\\$1"); +}; +regex[1 /* Dynamic */] = function () { + return "([^/]+)"; +}; +regex[2 /* Star */] = function () { + return "(.+)"; +}; +regex[4 /* Epsilon */] = function () { + return ""; +}; +var generate = []; +generate[0 /* Static */] = function (segment) { + return segment.value; +}; +generate[1 /* Dynamic */] = function (segment, params) { + var value = getParam(params, segment.value); + if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS) { + return encodePathSegment(value); + } + else { + return value; + } +}; +generate[2 /* Star */] = function (segment, params) { + return getParam(params, segment.value); +}; +generate[4 /* Epsilon */] = function () { + return ""; +}; +// The `names` will be populated with the paramter name for each dynamic/star +// segment. `shouldDecodes` will be populated with a boolean for each dyanamic/star +// segment, indicating whether it should be decoded during recognition. +function parse(segments, route, names, types, shouldDecodes) { + // normalize route as not starting with a "/". Recognition will + // also normalize. + if (route.length > 0 && route.charCodeAt(0) === 47 /* SLASH */) { + route = route.substr(1); + } + var parts = route.split("/"); + for (var i = 0; i < parts.length; i++) { + var part = parts[i]; + var flags = 0; + var type = 0; + if (part === "") { + type = 4 /* Epsilon */; + } + else if (part.charCodeAt(0) === 58 /* COLON */) { + type = 1 /* Dynamic */; + } + else if (part.charCodeAt(0) === 42 /* STAR */) { + type = 2 /* Star */; + } + else { + type = 0 /* Static */; + } + flags = 2 << type; + if (flags & 12 /* Named */) { + part = part.slice(1); + names.push(part); + shouldDecodes.push((flags & 4 /* Decoded */) !== 0); + } + if (flags & 14 /* Counted */) { + types[type]++; + } + segments.push({ type: type, value: normalizeSegment(part) }); + } +} +function isEqualCharSpec(spec, char, negate) { + return spec.char === char && spec.negate === negate; +} +// A State has a character specification and (`charSpec`) and a list of possible +// subsequent states (`nextStates`). +// +// If a State is an accepting state, it will also have several additional +// properties: +// +// * `regex`: A regular expression that is used to extract parameters from paths +// that reached this accepting state. +// * `handlers`: Information on how to convert the list of captures into calls +// to registered handlers with the specified parameters +// * `types`: How many static, dynamic or star segments in this route. Used to +// decide which route to use if multiple registered routes match a path. +// +// Currently, State is implemented naively by looping over `nextStates` and +// comparing a character specification against a character. A more efficient +// implementation would use a hash of keys pointing at one or more next states. +var State = function State(states, id, char, negate, repeat) { + this.states = states; + this.id = id; + this.char = char; + this.negate = negate; + this.nextStates = repeat ? id : null; + this.pattern = ""; + this._regex = undefined; + this.handlers = undefined; + this.types = undefined; +}; +State.prototype.regex = function regex$1 () { + if (!this._regex) { + this._regex = new RegExp(this.pattern); + } + return this._regex; +}; +State.prototype.get = function get (char, negate) { + var this$1 = this; - @param {Object} model the model to be serialized for this handler - */ - serialize: function(_model) { - var model = _model || this.context, - names = this.names, - serializer = this.serializer || (this.handler && this.handler.serialize); + var nextStates = this.nextStates; + if (nextStates === null) + { return; } + if (isArray(nextStates)) { + for (var i = 0; i < nextStates.length; i++) { + var child = this$1.states[nextStates[i]]; + if (isEqualCharSpec(child, char, negate)) { + return child; + } + } + } + else { + var child$1 = this.states[nextStates]; + if (isEqualCharSpec(child$1, char, negate)) { + return child$1; + } + } +}; +State.prototype.put = function put (char, negate, repeat) { + var state; + // If the character specification already exists in a child of the current + // state, just return that state. + if (state = this.get(char, negate)) { + return state; + } + // Make a new state for the character spec + var states = this.states; + state = new State(states, states.length, char, negate, repeat); + states[states.length] = state; + // Insert the new state as a child of the current state + if (this.nextStates == null) { + this.nextStates = state.id; + } + else if (isArray(this.nextStates)) { + this.nextStates.push(state.id); + } + else { + this.nextStates = [this.nextStates, state.id]; + } + // Return the new state + return state; +}; +// Find a list of child states matching the next character +State.prototype.match = function match (ch) { + var this$1 = this; - var object = {}; - if (isParam(model)) { - object[names[0]] = model; - return object; + var nextStates = this.nextStates; + if (!nextStates) + { return []; } + var returned = []; + if (isArray(nextStates)) { + for (var i = 0; i < nextStates.length; i++) { + var child = this$1.states[nextStates[i]]; + if (isMatch(child, ch)) { + returned.push(child); + } + } + } + else { + var child$1 = this.states[nextStates]; + if (isMatch(child$1, ch)) { + returned.push(child$1); + } + } + return returned; +}; +function isMatch(spec, char) { + return spec.negate ? spec.char !== char && spec.char !== -1 /* ANY */ : spec.char === char || spec.char === -1 /* ANY */; +} +// This is a somewhat naive strategy, but should work in a lot of cases +// A better strategy would properly resolve /posts/:id/new and /posts/edit/:id. +// +// This strategy generally prefers more static and less dynamic matching. +// Specifically, it +// +// * prefers fewer stars to more, then +// * prefers using stars for less of the match to more, then +// * prefers fewer dynamic segments to more, then +// * prefers more static segments to more +function sortSolutions(states) { + return states.sort(function (a, b) { + var ref = a.types || [0, 0, 0]; + var astatics = ref[0]; + var adynamics = ref[1]; + var astars = ref[2]; + var ref$1 = b.types || [0, 0, 0]; + var bstatics = ref$1[0]; + var bdynamics = ref$1[1]; + var bstars = ref$1[2]; + if (astars !== bstars) { + return astars - bstars; + } + if (astars) { + if (astatics !== bstatics) { + return bstatics - astatics; + } + if (adynamics !== bdynamics) { + return bdynamics - adynamics; + } + } + if (adynamics !== bdynamics) { + return adynamics - bdynamics; + } + if (astatics !== bstatics) { + return bstatics - astatics; + } + return 0; + }); +} +function recognizeChar(states, ch) { + var nextStates = []; + for (var i = 0, l = states.length; i < l; i++) { + var state = states[i]; + nextStates = nextStates.concat(state.match(ch)); + } + return nextStates; +} +var RecognizeResults = function RecognizeResults(queryParams) { + this.length = 0; + this.queryParams = queryParams || {}; +}; +; +RecognizeResults.prototype.splice = Array.prototype.splice; +RecognizeResults.prototype.slice = Array.prototype.slice; +RecognizeResults.prototype.push = Array.prototype.push; +function findHandler(state, originalPath, queryParams) { + var handlers = state.handlers; + var regex = state.regex(); + if (!regex || !handlers) + { throw new Error("state not initialized"); } + var captures = originalPath.match(regex); + var currentCapture = 1; + var result = new RecognizeResults(queryParams); + result.length = handlers.length; + for (var i = 0; i < handlers.length; i++) { + var handler = handlers[i]; + var names = handler.names; + var shouldDecodes = handler.shouldDecodes; + var params = {}; + for (var j = 0; j < names.length; j++) { + var name = names[j]; + var capture = captures && captures[currentCapture++]; + if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS && shouldDecodes[j]) { + params[name] = capture && decodeURIComponent(capture); + } + else { + params[name] = capture; + } + } + result[i] = { handler: handler.handler, params: params, isDynamic: !!names.length }; + } + return result; +} +function decodeQueryParamPart(part) { + // http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1 + part = part.replace(/\+/gm, "%20"); + var result; + try { + result = decodeURIComponent(part); + } + catch (error) { + result = ""; + } + return result; +} +var RouteRecognizer = function RouteRecognizer() { + this.names = createMap(); + var states = []; + var state = new State(states, 0, -1 /* ANY */, true, false); + states[0] = state; + this.states = states; + this.rootState = state; +}; +RouteRecognizer.prototype.add = function add (routes, options) { + var currentState = this.rootState; + var pattern = "^"; + var types = [0, 0, 0]; + var handlers = new Array(routes.length); + var allSegments = []; + var isEmpty = true; + var j = 0; + for (var i = 0; i < routes.length; i++) { + var route = routes[i]; + var names = []; + var shouldDecodes = []; + parse(allSegments, route.path, names, types, shouldDecodes); + // preserve j so it points to the start of newly added segments + for (; j < allSegments.length; j++) { + var segment = allSegments[j]; + if (segment.type === 4 /* Epsilon */) { + continue; + } + isEmpty = false; + // Add a "/" for the new segment + currentState = currentState.put(47 /* SLASH */, false, false); + pattern += "/"; + // Add a representation of the segment to the NFA and regex + currentState = eachChar[segment.type](segment, currentState); + pattern += regex[segment.type](segment); + } + var handler = { handler: route.handler, names: names, shouldDecodes: shouldDecodes }; + handlers[i] = handler; + } + if (isEmpty) { + currentState = currentState.put(47 /* SLASH */, false, false); + pattern += "/"; + } + currentState.handlers = handlers; + currentState.pattern = pattern + "$"; + currentState.types = types; + var name; + if (typeof options === "object" && options !== null && options.as) { + name = options.as; } - - // Use custom serialize if it exists. - if (serializer) { - return serializer(model, names); + if (name) { + // if (this.names[name]) { + // throw new Error("You may not add a duplicate route named `" + name + "`."); + // } + this.names[name] = { + segments: allSegments, + handlers: handlers + }; } - - if (names.length !== 1) { return; } - - var name = names[0]; - - if (/_id$/.test(name)) { - object[name] = model.id; - } else { - object[name] = model; +}; +RouteRecognizer.prototype.handlersFor = function handlersFor (name) { + var route = this.names[name]; + if (!route) { + throw new Error("There is no route named " + name); } - return object; - } -}); - -// Generated by URL transitions and non-dynamic route segments in named Transitions. -var UnresolvedHandlerInfoByParam = subclass (HandlerInfo, { - initialize: function(props) { - this.params = props.params || {}; - }, - - getModel: function(payload) { - var fullParams = this.params; - if (payload && payload.queryParams) { - fullParams = {}; - merge(fullParams, this.params); - fullParams.queryParams = payload.queryParams; + var result = new Array(route.handlers.length); + for (var i = 0; i < route.handlers.length; i++) { + result[i] = route.handlers[i]; } - - var handler = this.handler; - var hookName = resolveHook(handler, 'deserialize') || - resolveHook(handler, 'model'); - - return this.runSharedModelHook(payload, hookName, [fullParams]); - } -}); - -handlerInfoFactory.klasses = { - resolved: ResolvedHandlerInfo, - param: UnresolvedHandlerInfoByParam, - object: UnresolvedHandlerInfoByObject + return result; }; - -function handlerInfoFactory(name, props) { - var Ctor = handlerInfoFactory.klasses[name], - handlerInfo = new Ctor(props || {}); - handlerInfo.factory = handlerInfoFactory; - return handlerInfo; -} - -var NamedTransitionIntent = subclass(TransitionIntent, { - name: null, - pivotHandler: null, - contexts: null, - queryParams: null, - - initialize: function(props) { - this.name = props.name; - this.pivotHandler = props.pivotHandler; - this.contexts = props.contexts || []; - this.queryParams = props.queryParams; - }, - - applyToState: function(oldState, recognizer, getHandler, isIntermediate, getSerializer) { - - var partitionedArgs = extractQueryParams([this.name].concat(this.contexts)), - pureArgs = partitionedArgs[0], - handlers = recognizer.handlersFor(pureArgs[0]); - - var targetRouteName = handlers[handlers.length-1].handler; - - return this.applyToHandlers(oldState, handlers, getHandler, targetRouteName, isIntermediate, null, getSerializer); - }, - - applyToHandlers: function(oldState, handlers, getHandler, targetRouteName, isIntermediate, checkingIfActive, getSerializer) { - - var i, len; - var newState = new TransitionState(); - var objects = this.contexts.slice(0); - - var invalidateIndex = handlers.length; - - // Pivot handlers are provided for refresh transitions - if (this.pivotHandler) { - for (i = 0, len = handlers.length; i < len; ++i) { - if (handlers[i].handler === this.pivotHandler._handlerName) { - invalidateIndex = i; - break; +RouteRecognizer.prototype.hasRoute = function hasRoute (name) { + return !!this.names[name]; +}; +RouteRecognizer.prototype.generate = function generate$1 (name, params) { + var route = this.names[name]; + var output = ""; + if (!route) { + throw new Error("There is no route named " + name); + } + var segments = route.segments; + for (var i = 0; i < segments.length; i++) { + var segment = segments[i]; + if (segment.type === 4 /* Epsilon */) { + continue; } - } + output += "/"; + output += generate[segment.type](segment, params); } - - for (i = handlers.length - 1; i >= 0; --i) { - var result = handlers[i]; - var name = result.handler; - - var oldHandlerInfo = oldState.handlerInfos[i]; - var newHandlerInfo = null; - - if (result.names.length > 0) { - if (i >= invalidateIndex) { - newHandlerInfo = this.createParamHandlerInfo(name, getHandler, result.names, objects, oldHandlerInfo); - } else { - var serializer = getSerializer(name); - newHandlerInfo = this.getHandlerInfoForDynamicSegment(name, getHandler, result.names, objects, oldHandlerInfo, targetRouteName, i, serializer); + if (output.charAt(0) !== "/") { + output = "/" + output; + } + if (params && params.queryParams) { + output += this.generateQueryString(params.queryParams); + } + return output; +}; +RouteRecognizer.prototype.generateQueryString = function generateQueryString (params) { + var pairs = []; + var keys = Object.keys(params); + keys.sort(); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = params[key]; + if (value == null) { + continue; } - } else { - // This route has no dynamic segment. - // Therefore treat as a param-based handlerInfo - // with empty params. This will cause the `model` - // hook to be called with empty params, which is desirable. - newHandlerInfo = this.createParamHandlerInfo(name, getHandler, result.names, objects, oldHandlerInfo); - } - - if (checkingIfActive) { - // If we're performing an isActive check, we want to - // serialize URL params with the provided context, but - // ignore mismatches between old and new context. - newHandlerInfo = newHandlerInfo.becomeResolved(null, newHandlerInfo.context); - var oldContext = oldHandlerInfo && oldHandlerInfo.context; - if (result.names.length > 0 && newHandlerInfo.context === oldContext) { - // If contexts match in isActive test, assume params also match. - // This allows for flexibility in not requiring that every last - // handler provide a `serialize` method - newHandlerInfo.params = oldHandlerInfo && oldHandlerInfo.params; + var pair = encodeURIComponent(key); + if (isArray(value)) { + for (var j = 0; j < value.length; j++) { + var arrayPair = key + "[]" + "=" + encodeURIComponent(value[j]); + pairs.push(arrayPair); + } } - newHandlerInfo.context = oldContext; - } + else { + pair += "=" + encodeURIComponent(value); + pairs.push(pair); + } + } + if (pairs.length === 0) { + return ""; + } + return "?" + pairs.join("&"); +}; +RouteRecognizer.prototype.parseQueryString = function parseQueryString (queryString) { + var pairs = queryString.split("&"); + var queryParams = {}; + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i].split("="), key = decodeQueryParamPart(pair[0]), keyLength = key.length, isArray = false, value = (void 0); + if (pair.length === 1) { + value = "true"; + } + else { + // Handle arrays + if (keyLength > 2 && key.slice(keyLength - 2) === "[]") { + isArray = true; + key = key.slice(0, keyLength - 2); + if (!queryParams[key]) { + queryParams[key] = []; + } + } + value = pair[1] ? decodeQueryParamPart(pair[1]) : ""; + } + if (isArray) { + queryParams[key].push(value); + } + else { + queryParams[key] = value; + } + } + return queryParams; +}; +RouteRecognizer.prototype.recognize = function recognize (path) { + var results; + var states = [this.rootState]; + var queryParams = {}; + var isSlashDropped = false; + var hashStart = path.indexOf("#"); + if (hashStart !== -1) { + path = path.substr(0, hashStart); + } + var queryStart = path.indexOf("?"); + if (queryStart !== -1) { + var queryString = path.substr(queryStart + 1, path.length); + path = path.substr(0, queryStart); + queryParams = this.parseQueryString(queryString); + } + if (path.charAt(0) !== "/") { + path = "/" + path; + } + var originalPath = path; + if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS) { + path = normalizePath(path); + } + else { + path = decodeURI(path); + originalPath = decodeURI(originalPath); + } + var pathLen = path.length; + if (pathLen > 1 && path.charAt(pathLen - 1) === "/") { + path = path.substr(0, pathLen - 1); + originalPath = originalPath.substr(0, originalPath.length - 1); + isSlashDropped = true; + } + for (var i = 0; i < path.length; i++) { + states = recognizeChar(states, path.charCodeAt(i)); + if (!states.length) { + break; + } + } + var solutions = []; + for (var i$1 = 0; i$1 < states.length; i$1++) { + if (states[i$1].handlers) { + solutions.push(states[i$1]); + } + } + states = sortSolutions(solutions); + 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.pattern && state.pattern.slice(-5) === "(.+)$") { + originalPath = originalPath + "/"; + } + results = findHandler(state, originalPath, queryParams); + } + return results; +}; +RouteRecognizer.VERSION = "0.3.0"; +// Set to false to opt-out of encoding and decoding path segments. +// See https://github.com/tildeio/route-recognizer/pull/55 +RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS = true; +RouteRecognizer.Normalizer = { + normalizeSegment: normalizeSegment, normalizePath: normalizePath, encodePathSegment: encodePathSegment +}; +RouteRecognizer.prototype.map = map; - var handlerToUse = oldHandlerInfo; - if (i >= invalidateIndex || newHandlerInfo.shouldSupercede(oldHandlerInfo)) { - invalidateIndex = Math.min(i, invalidateIndex); - handlerToUse = newHandlerInfo; - } +exports['default'] = RouteRecognizer; - if (isIntermediate && !checkingIfActive) { - handlerToUse = handlerToUse.becomeResolved(null, handlerToUse.context); - } +Object.defineProperty(exports, '__esModule', { value: true }); - newState.handlerInfos.unshift(handlerToUse); - } +}); +enifed('router', ['exports', 'route-recognizer', 'rsvp'], function (exports, RouteRecognizer, rsvp) { 'use strict'; - if (objects.length > 0) { - throw new Error("More context objects were passed than there are dynamic segments for the route: " + targetRouteName); - } +RouteRecognizer = 'default' in RouteRecognizer ? RouteRecognizer['default'] : RouteRecognizer; - if (!isIntermediate) { - this.invalidateChildren(newState.handlerInfos, invalidateIndex); - } +var slice = Array.prototype.slice; - merge(newState.queryParams, this.queryParams || {}); +var _isArray; +if (!Array.isArray) { + _isArray = function (x) { + return Object.prototype.toString.call(x) === "[object Array]"; + }; +} else { + _isArray = Array.isArray; +} - return newState; - }, +var isArray = _isArray; - invalidateChildren: function(handlerInfos, invalidateIndex) { - for (var i = invalidateIndex, l = handlerInfos.length; i < l; ++i) { - var handlerInfo = handlerInfos[i]; - handlerInfos[i] = handlerInfo.getUnresolved(); - } - }, +/** + Determines if an object is Promise by checking if it is "thenable". +**/ +function isPromise(obj) { + return ((typeof obj === 'object' && obj !== null) || typeof obj === 'function') && typeof obj.then === 'function'; +} - getHandlerInfoForDynamicSegment: function(name, getHandler, names, objects, oldHandlerInfo, targetRouteName, i, serializer) { - var objectToUse; - if (objects.length > 0) { +function merge(hash, other) { + for (var prop in other) { + if (other.hasOwnProperty(prop)) { hash[prop] = other[prop]; } + } +} - // Use the objects provided for this transition. - objectToUse = objects[objects.length - 1]; - if (isParam(objectToUse)) { - return this.createParamHandlerInfo(name, getHandler, names, objects, oldHandlerInfo); - } else { - objects.pop(); - } - } else if (oldHandlerInfo && oldHandlerInfo.name === name) { - // Reuse the matching oldHandlerInfo - return oldHandlerInfo; - } else { - if (this.preTransitionState) { - var preTransitionHandlerInfo = this.preTransitionState.handlerInfos[i]; - objectToUse = preTransitionHandlerInfo && preTransitionHandlerInfo.context; - } else { - // Ideally we should throw this error to provide maximal - // information to the user that not enough context objects - // were provided, but this proves too cumbersome in Ember - // in cases where inner template helpers are evaluated - // before parent helpers un-render, in which cases this - // error somewhat prematurely fires. - //throw new Error("Not enough context objects were provided to complete a transition to " + targetRouteName + ". Specifically, the " + name + " route needs an object that can be serialized into its dynamic URL segments [" + names.join(', ') + "]"); - return oldHandlerInfo; - } - } +var oCreate = Object.create || function(proto) { + function F() {} + F.prototype = proto; + return new F(); +}; - return handlerInfoFactory('object', { - name: name, - getHandler: getHandler, - serializer: serializer, - context: objectToUse, - names: names - }); - }, +/** + @private - createParamHandlerInfo: function(name, getHandler, names, objects, oldHandlerInfo) { - var params = {}; + Extracts query params from the end of an array +**/ +function extractQueryParams(array) { + var len = (array && array.length), head, queryParams; - // Soak up all the provided string/numbers - var numNames = names.length; - while (numNames--) { + if(len && len > 0 && array[len - 1] && array[len - 1].hasOwnProperty('queryParams')) { + queryParams = array[len - 1].queryParams; + head = slice.call(array, 0, len - 1); + return [head, queryParams]; + } else { + return [array, null]; + } +} - // Only use old params if the names match with the new handler - var oldParams = (oldHandlerInfo && name === oldHandlerInfo.name && oldHandlerInfo.params) || {}; +/** + @private - var peek = objects[objects.length - 1]; - var paramName = names[numNames]; - if (isParam(peek)) { - 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); - } + Coerces query param properties and array elements into strings. +**/ +function coerceQueryParamsToString(queryParams) { + for (var key in queryParams) { + if (typeof queryParams[key] === 'number') { + queryParams[key] = '' + queryParams[key]; + } else if (isArray(queryParams[key])) { + for (var i = 0, l = queryParams[key].length; i < l; i++) { + queryParams[key][i] = '' + queryParams[key][i]; } } - - return handlerInfoFactory('param', { - name: name, - getHandler: getHandler, - params: params - }); } -}); - +} /** - Promise reject reasons passed to promise rejection - handlers for failed transitions. + @private */ -function UnrecognizedURLError(message) { - this.message = (message || "UnrecognizedURLError"); - this.name = "UnrecognizedURLError"; - Error.call(this); +function log(router, sequence, msg) { + if (!router.log) { return; } + + if (arguments.length === 3) { + router.log("Transition #" + sequence + ": " + msg); + } else { + msg = sequence; + router.log(msg); + } } -UnrecognizedURLError.prototype = oCreate(Error.prototype); +function bind(context, fn) { + var boundArgs = arguments; + return function(value) { + var args = slice.call(boundArgs, 2); + args.push(value); + return fn.apply(context, args); + }; +} -var URLTransitionIntent = subclass(TransitionIntent, { - url: null, +function isParam(object) { + return (typeof object === "string" || object instanceof String || typeof object === "number" || object instanceof Number); +} - initialize: function(props) { - this.url = props.url; - }, - applyToState: function(oldState, recognizer, getHandler) { - var newState = new TransitionState(); +function forEach(array, callback) { + for (var i=0, l=array.length; i < l && false !== callback(array[i]); i++) { } +} - var results = recognizer.recognize(this.url), - i, len; +function trigger(router, handlerInfos, ignoreFailure, args) { + if (router.triggerEvent) { + router.triggerEvent(handlerInfos, ignoreFailure, args); + return; + } - if (!results) { - throw new UnrecognizedURLError(this.url); - } + var name = args.shift(); - var statesDiffer = false; - var url = this.url; + if (!handlerInfos) { + if (ignoreFailure) { return; } + throw new Error("Could not trigger event '" + name + "'. There are no active handlers"); + } - // Checks if a handler is accessible by URL. If it is not, an error is thrown. - // For the case where the handler is loaded asynchronously, the error will be - // thrown once it is loaded. - function checkHandlerAccessibility(handler) { - if (handler && handler.inaccessibleByURL) { - throw new UnrecognizedURLError(url); - } + var eventWasHandled = false; - return handler; - } + function delayedEvent(name, args, handler) { + handler.events[name].apply(handler, args); + } - for (i = 0, len = results.length; i < len; ++i) { - var result = results[i]; - var name = result.handler; - var newHandlerInfo = handlerInfoFactory('param', { - name: name, - getHandler: getHandler, - params: result.params - }); - var handler = newHandlerInfo.handler; + for (var i=handlerInfos.length-1; i>=0; i--) { + var handlerInfo = handlerInfos[i], + handler = handlerInfo.handler; - if (handler) { - checkHandlerAccessibility(handler); - } else { - // If the hanlder is being loaded asynchronously, check if we can - // access it after it has resolved - newHandlerInfo.handlerPromise = newHandlerInfo.handlerPromise.then(checkHandlerAccessibility); - } + // If there is no handler, it means the handler hasn't resolved yet which + // means that we should trigger the event later when the handler is available + if (!handler) { + handlerInfo.handlerPromise.then(bind(null, delayedEvent, name, args)); + continue; + } - var oldHandlerInfo = oldState.handlerInfos[i]; - if (statesDiffer || newHandlerInfo.shouldSupercede(oldHandlerInfo)) { - statesDiffer = true; - newState.handlerInfos[i] = newHandlerInfo; + if (handler.events && handler.events[name]) { + if (handler.events[name].apply(handler, args) === true) { + eventWasHandled = true; } else { - newState.handlerInfos[i] = oldHandlerInfo; + return; } } - - merge(newState.queryParams, results.queryParams); - - return newState; } -}); - -var pop = Array.prototype.pop; - -function Router(_options) { - var options = _options || {}; - this.getHandler = options.getHandler || this.getHandler; - this.getSerializer = options.getSerializer || this.getSerializer; - this.updateURL = options.updateURL || this.updateURL; - this.replaceURL = options.replaceURL || this.replaceURL; - this.didTransition = options.didTransition || this.didTransition; - this.willTransition = options.willTransition || this.willTransition; - this.delegate = options.delegate || this.delegate; - this.triggerEvent = options.triggerEvent || this.triggerEvent; - this.log = options.log || this.log; - this.dslCallBacks = []; // NOTE: set by Ember - this.state = undefined; - this.activeTransition = undefined; - this._changedQueryParams = undefined; - this.oldState = undefined; - this.currentHandlerInfos = undefined; - this.state = undefined; - this.currentSequence = 0; - this.recognizer = new RouteRecognizer(); - this.reset(); + // In the case that we got an UnrecognizedURLError as an event with no handler, + // let it bubble up + if (name === 'error' && args[0].name === 'UnrecognizedURLError') { + throw args[0]; + } else if (!eventWasHandled && !ignoreFailure) { + throw new Error("Nothing handled the event '" + name + "'."); + } } -function getTransitionByIntent(intent, isIntermediate) { - var wasTransitioning = !!this.activeTransition; - var oldState = wasTransitioning ? this.activeTransition.state : this.state; - var newTransition; +function getChangelist(oldObject, newObject) { + var key; + var results = { + all: {}, + changed: {}, + removed: {} + }; - var newState = intent.applyToState(oldState, this.recognizer, this.getHandler, isIntermediate, this.getSerializer); - var queryParamChangelist = getChangelist(oldState.queryParams, newState.queryParams); + merge(results.all, newObject); - if (handlerInfosEqual(newState.handlerInfos, oldState.handlerInfos)) { + var didChange = false; + coerceQueryParamsToString(oldObject); + coerceQueryParamsToString(newObject); - // This is a no-op transition. See if query params changed. - if (queryParamChangelist) { - newTransition = this.queryParamsTransition(queryParamChangelist, wasTransitioning, oldState, newState); - if (newTransition) { - return newTransition; + // Calculate removals + for (key in oldObject) { + if (oldObject.hasOwnProperty(key)) { + if (!newObject.hasOwnProperty(key)) { + didChange = true; + results.removed[key] = oldObject[key]; + } + } + } + + // Calculate changes + for (key in newObject) { + if (newObject.hasOwnProperty(key)) { + if (isArray(oldObject[key]) && isArray(newObject[key])) { + if (oldObject[key].length !== newObject[key].length) { + results.changed[key] = newObject[key]; + didChange = true; + } else { + for (var i = 0, l = oldObject[key].length; i < l; i++) { + if (oldObject[key][i] !== newObject[key][i]) { + results.changed[key] = newObject[key]; + didChange = true; + } + } + } + } + else { + if (oldObject[key] !== newObject[key]) { + results.changed[key] = newObject[key]; + didChange = true; + } } } - - // No-op. No need to create a new transition. - return this.activeTransition || new Transition(this); } - if (isIntermediate) { - setupContexts(this, newState); - return; - } - - // Create a new transition to the destination route. - newTransition = new Transition(this, intent, newState, undefined, this.activeTransition); - - // Abort and usurp any previously active transition. - if (this.activeTransition) { - this.activeTransition.abort(); - } - this.activeTransition = newTransition; + return didChange && results; +} - // 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, promiseLabel("Settle transition promise when transition is finalized")); +function promiseLabel(label) { + return 'Router: ' + label; +} - if (!wasTransitioning) { - notifyExistingHandlers(this, newState, newTransition); +function subclass(parentConstructor, proto) { + function C(props) { + parentConstructor.call(this, props || {}); } - - fireQueryParamDidChange(this, newState, queryParamChangelist); - - return newTransition; + C.prototype = oCreate(parentConstructor.prototype); + merge(C.prototype, proto); + return C; } -Router.prototype = { +function resolveHook(obj, hookName) { + if (!obj) { return; } + var underscored = "_" + hookName; + return obj[underscored] && underscored || + obj[hookName] && hookName; +} - /** - The main entry point into the router. The API is essentially - the same as the `map` method in `route-recognizer`. +function callHook(obj, _hookName, arg1, arg2) { + var hookName = resolveHook(obj, _hookName); + return hookName && obj[hookName].call(obj, arg1, arg2); +} - This method extracts the String handler at the last `.to()` - call and uses it as the name of the whole route. +function applyHook(obj, _hookName, args) { + var hookName = resolveHook(obj, _hookName); + if (hookName) { + if (args.length === 0) { + return obj[hookName].call(obj); + } else if (args.length === 1) { + return obj[hookName].call(obj, args[0]); + } else if (args.length === 2) { + return obj[hookName].call(obj, args[0], args[1]); + } else { + return obj[hookName].apply(obj, args); + } + } +} - @param {Function} callback - */ - map: function(callback) { - this.recognizer.delegate = this.delegate; +function TransitionState() { + this.handlerInfos = []; + this.queryParams = {}; + this.params = {}; +} - this.recognizer.map(callback, function(recognizer, routes) { - for (var i = routes.length - 1, proceed = true; i >= 0 && proceed; --i) { - var route = routes[i]; - recognizer.add(routes, { as: route.handler }); - proceed = route.path === '/' || route.path === '' || route.handler.slice(-6) === '.index'; +TransitionState.prototype = { + promiseLabel: function(label) { + var targetName = ''; + forEach(this.handlerInfos, function(handlerInfo) { + if (targetName !== '') { + targetName += '.'; } + targetName += handlerInfo.name; }); + return promiseLabel("'" + targetName + "': " + label); }, - hasRoute: function(route) { - return this.recognizer.hasRoute(route); - }, + resolve: function(shouldContinue, payload) { + // First, calculate params for this state. This is useful + // information to provide to the various route hooks. + var params = this.params; + forEach(this.handlerInfos, function(handlerInfo) { + params[handlerInfo.name] = handlerInfo.params || {}; + }); - getHandler: function() {}, + payload = payload || {}; + payload.resolveIndex = 0; - getSerializer: function() {}, + var currentState = this; + var wasAborted = false; - queryParamsTransition: function(changelist, wasTransitioning, oldState, newState) { - var router = this; + // The prelude RSVP.resolve() asyncs us into the promise land. + return rsvp.Promise.resolve(null, this.promiseLabel("Start transition")) + .then(resolveOneHandlerInfo, null, this.promiseLabel('Resolve handler'))['catch'](handleError, this.promiseLabel('Handle error')); - fireQueryParamDidChange(this, newState, changelist); + function innerShouldContinue() { + return rsvp.Promise.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 rsvp.Promise.reject(reason); + }, currentState.promiseLabel("Handle abort")); + } - if (!wasTransitioning && this.activeTransition) { - // One of the handlers in queryParamsDidChange - // caused a transition. Just return that transition. - return this.activeTransition; - } else { - // Running queryParamsDidChange didn't change anything. - // Just update query params and be on our way. + function handleError(error) { + // This is the only possible + // reject value of TransitionState#resolve + var handlerInfos = currentState.handlerInfos; + var errorHandlerIndex = payload.resolveIndex >= handlerInfos.length ? + handlerInfos.length - 1 : payload.resolveIndex; + return rsvp.Promise.reject({ + error: error, + handlerWithError: currentState.handlerInfos[errorHandlerIndex].handler, + wasAborted: wasAborted, + state: currentState + }); + } - // We have to return a noop transition that will - // perform a URL update at the end. This gives - // the user the ability to set the url update - // method (default is replaceState). - var newTransition = new Transition(this); - newTransition.queryParamsOnly = true; + function proceed(resolvedHandlerInfo) { + var wasAlreadyResolved = currentState.handlerInfos[payload.resolveIndex].isResolved; - oldState.queryParams = finalizeQueryParamChange(this, newState.handlerInfos, newState.queryParams, newTransition); + // Swap the previously unresolved handlerInfo with + // the resolved handlerInfo + currentState.handlerInfos[payload.resolveIndex++] = resolvedHandlerInfo; - newTransition.promise = newTransition.promise.then(function(result) { - updateURL(newTransition, oldState, true); - if (router.didTransition) { - router.didTransition(router.currentHandlerInfos); - } - return result; - }, null, promiseLabel("Transition complete")); - return newTransition; - } - }, + if (!wasAlreadyResolved) { + // Call the redirect hook. The reason we call it here + // vs. afterModel is so that redirects into child + // routes don't re-run the model hooks for this + // already-resolved route. + var handler = resolvedHandlerInfo.handler; + callHook(handler, 'redirect', resolvedHandlerInfo.context, payload); + } - // NOTE: this doesn't really belong here, but here - // it shall remain until our ES6 transpiler can - // handle cyclical deps. - transitionByIntent: function(intent/*, isIntermediate*/) { - try { - return getTransitionByIntent.apply(this, arguments); - } catch(e) { - return new Transition(this, intent, null, e); + // Proceed after ensuring that the redirect hook + // didn't abort this transition by transitioning elsewhere. + return innerShouldContinue().then(resolveOneHandlerInfo, null, currentState.promiseLabel('Resolve handler')); } - }, - /** - Clears the current and target route handlers and triggers exit - on each of them starting at the leaf and traversing up through - its ancestors. - */ - reset: function() { - if (this.state) { - forEach(this.state.handlerInfos.slice().reverse(), function(handlerInfo) { - var handler = handlerInfo.handler; - callHook(handler, 'exit'); - }); + function resolveOneHandlerInfo() { + if (payload.resolveIndex === currentState.handlerInfos.length) { + // This is is the only possible + // fulfill value of TransitionState#resolve + return { + error: null, + state: currentState + }; + } + + var handlerInfo = currentState.handlerInfos[payload.resolveIndex]; + + return handlerInfo.resolve(innerShouldContinue, payload) + .then(proceed, null, currentState.promiseLabel('Proceed')); } + } +}; - this.oldState = undefined; - this.state = new TransitionState(); - this.currentHandlerInfos = null; - }, +function TransitionAbortedError(message) { + if (!(this instanceof TransitionAbortedError)) { + return new TransitionAbortedError(message); + } - activeTransition: null, + var error = Error.call(this, message); - /** - var handler = handlerInfo.handler; - The entry point for handling a change to the URL (usually - via the back and forward button). + if (Error.captureStackTrace) { + Error.captureStackTrace(this, TransitionAbortedError); + } else { + this.stack = error.stack; + } - Returns an Array of handlers and the parameters associated - with those parameters. + this.description = error.description; + this.fileName = error.fileName; + this.lineNumber = error.lineNumber; + this.message = error.message || 'TransitionAborted'; + this.name = 'TransitionAborted'; + this.number = error.number; + this.code = error.code; +} - @param {String} url a URL to process +TransitionAbortedError.prototype = oCreate(Error.prototype); - @return {Array} an Array of `[handler, parameter]` tuples - */ - handleURL: function(url) { - // Perform a URL-based transition, but don't change - // the URL afterward, since it already happened. - var args = slice.call(arguments); - if (url.charAt(0) !== '/') { args[0] = '/' + url; } +/** + A Transition is a thennable (a promise-like object) that represents + an attempt to transition to another route. It can be aborted, either + explicitly via `abort` or by attempting another transition while a + previous one is still underway. An aborted transition can also + be `retry()`d later. - return doTransition(this, args).method(null); - }, + @class Transition + @constructor + @param {Object} router + @param {Object} intent + @param {Object} state + @param {Object} error + @private + */ +function Transition(router, intent, state, error, previousTransition) { + var transition = this; + this.state = state || router.state; + this.intent = intent; + this.router = router; + this.data = this.intent && this.intent.data || {}; + this.resolvedModels = {}; + this.queryParams = {}; + this.promise = undefined; + this.error = undefined; + this.params = undefined; + this.handlerInfos = undefined; + this.targetName = undefined; + this.pivotHandler = undefined; + this.sequence = undefined; + this.isAborted = false; + this.isActive = true; - /** - Hook point for updating the URL. + if (error) { + this.promise = rsvp.Promise.reject(error); + this.error = error; + return; + } - @param {String} url a URL to update to - */ - updateURL: function() { - throw new Error("updateURL is not implemented"); - }, + // if you're doing multiple redirects, need the new transition to know if it + // is actually part of the first transition or not. Any further redirects + // in the initial transition also need to know if they are part of the + // initial transition + this.isCausedByAbortingTransition = !!previousTransition; + this.isCausedByInitialTransition = ( + previousTransition && ( + previousTransition.isCausedByInitialTransition || + previousTransition.sequence === 0 + ) + ); - /** - Hook point for replacing the current URL, i.e. with replaceState + if (state) { + this.params = state.params; + this.queryParams = state.queryParams; + this.handlerInfos = state.handlerInfos; - By default this behaves the same as `updateURL` + var len = state.handlerInfos.length; + if (len) { + this.targetName = state.handlerInfos[len-1].name; + } - @param {String} url a URL to update to - */ - replaceURL: function(url) { - this.updateURL(url); - }, + for (var i = 0; i < len; ++i) { + var handlerInfo = state.handlerInfos[i]; - /** - Transition into the specified named route. + // TODO: this all seems hacky + if (!handlerInfo.isResolved) { break; } + this.pivotHandler = handlerInfo.handler; + } - If necessary, trigger the exit callback on any handlers - that are no longer represented by the target route. + this.sequence = router.currentSequence++; + this.promise = state.resolve(checkForAbort, this)['catch']( + catchHandlerForTransition(transition), promiseLabel('Handle Abort')); + } else { + this.promise = rsvp.Promise.resolve(this.state); + this.params = {}; + } - @param {String} name the name of the route - */ - transitionTo: function(/*name*/) { - return doTransition(this, arguments); - }, + function checkForAbort() { + if (transition.isAborted) { + return rsvp.Promise.reject(undefined, promiseLabel("Transition aborted - reject")); + } + } +} - intermediateTransitionTo: function(/*name*/) { - return doTransition(this, arguments, true); - }, +function catchHandlerForTransition(transition) { + return function(result) { + if (result.wasAborted || transition.isAborted) { + return rsvp.Promise.reject(logAbort(transition)); + } else { + transition.trigger('error', result.error, transition, result.handlerWithError); + transition.abort(); + return rsvp.Promise.reject(result.error); + } + }; +} - refresh: function(pivotHandler) { - var state = this.activeTransition ? this.activeTransition.state : this.state; - var handlerInfos = state.handlerInfos; - var params = {}; + +Transition.prototype = { + targetName: null, + urlMethod: 'update', + intent: null, + pivotHandler: null, + resolveIndex: 0, + resolvedModels: null, + state: null, + queryParamsOnly: false, + + isTransition: true, + + isExiting: function(handler) { + var handlerInfos = this.handlerInfos; for (var i = 0, len = handlerInfos.length; i < len; ++i) { var handlerInfo = handlerInfos[i]; - params[handlerInfo.name] = handlerInfo.params || {}; + if (handlerInfo.name === handler || handlerInfo.handler === handler) { + return false; + } } + return true; + }, - log(this, "Starting a refresh transition"); - var intent = new NamedTransitionIntent({ - name: handlerInfos[handlerInfos.length - 1].name, - pivotHandler: pivotHandler || handlerInfos[0].handler, - contexts: [], // TODO collect contexts...? - queryParams: this._changedQueryParams || state.queryParams || {} - }); + /** + The Transition's internal promise. Calling `.then` on this property + is that same as calling `.then` on the Transition object itself, but + this property is exposed for when you want to pass around a + Transition's promise, but not the Transition object itself, since + Transition object can be externally `abort`ed, while the promise + cannot. - return this.transitionByIntent(intent, false); - }, + @property promise + @type {Object} + @public + */ + promise: null, /** - Identical to `transitionTo` except that the current URL will be replaced - if possible. + Custom state can be stored on a Transition's `data` object. + This can be useful for decorating a Transition within an earlier + hook and shared with a later hook. Properties set on `data` will + be copied to new transitions generated by calling `retry` on this + transition. - This method is intended primarily for use with `replaceState`. + @property data + @type {Object} + @public + */ + data: null, - @param {String} name the name of the route - */ - replaceWith: function(/*name*/) { - return doTransition(this, arguments).method('replace'); + /** + A standard promise hook that resolves if the transition + succeeds and rejects if it fails/redirects/aborts. + + Forwards to the internal `promise` property which you can + use in situations where you want to pass around a thennable, + but not the Transition itself. + + @method then + @param {Function} onFulfilled + @param {Function} onRejected + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + @public + */ + then: function(onFulfilled, onRejected, label) { + return this.promise.then(onFulfilled, onRejected, label); }, /** - Take a named route and context objects and generate a - URL. - - @param {String} name the name of the route to generate - a URL for - @param {...Object} objects a list of objects to serialize - @return {String} a URL - */ - generate: function(handlerName) { + Forwards to the internal `promise` property which you can + use in situations where you want to pass around a thennable, + but not the Transition itself. - var partitionedArgs = extractQueryParams(slice.call(arguments, 1)), - suppliedParams = partitionedArgs[0], - queryParams = partitionedArgs[1]; + @method catch + @param {Function} onRejection + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + @public + */ + catch: function(onRejection, label) { + return this.promise.catch(onRejection, label); + }, - // Construct a TransitionIntent with the provided params - // and apply it to the present state of the router. - var intent = new NamedTransitionIntent({ name: handlerName, contexts: suppliedParams }); - var state = intent.applyToState(this.state, this.recognizer, this.getHandler, null, this.getSerializer); - var params = {}; + /** - for (var i = 0, len = state.handlerInfos.length; i < len; ++i) { - var handlerInfo = state.handlerInfos[i]; - var handlerParams = handlerInfo.serialize(); - merge(params, handlerParams); - } - params.queryParams = queryParams; + Forwards to the internal `promise` property which you can + use in situations where you want to pass around a thennable, + but not the Transition itself. - return this.recognizer.generate(handlerName, params); + @method finally + @param {Function} callback + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + @public + */ + finally: function(callback, label) { + return this.promise.finally(callback, label); }, - applyIntent: function(handlerName, contexts) { - var intent = new NamedTransitionIntent({ - name: handlerName, - contexts: contexts - }); + /** + Aborts the Transition. Note you can also implicitly abort a transition + by initiating another transition while a previous one is underway. - var state = this.activeTransition && this.activeTransition.state || this.state; - return intent.applyToState(state, this.recognizer, this.getHandler, null, this.getSerializer); + @method abort + @return {Transition} this transition + @public + */ + abort: function() { + if (this.isAborted) { return this; } + 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; }, - isActiveIntent: function(handlerName, contexts, queryParams, _state) { - var state = _state || this.state, - targetHandlerInfos = state.handlerInfos, - handlerInfo, len; + /** - if (!targetHandlerInfos.length) { return false; } + Retries a previously-aborted transition (making sure to abort the + transition if it's still active). Returns a new transition that + represents the new attempt to transition. - var targetHandler = targetHandlerInfos[targetHandlerInfos.length - 1].name; - var recogHandlers = this.recognizer.handlersFor(targetHandler); + @method retry + @return {Transition} new transition + @public + */ + retry: function() { + // TODO: add tests for merged state retry()s + this.abort(); + return this.router.transitionByIntent(this.intent, false); + }, - var index = 0; - for (len = recogHandlers.length; index < len; ++index) { - handlerInfo = targetHandlerInfos[index]; - if (handlerInfo.name === handlerName) { break; } - } + /** - if (index === recogHandlers.length) { - // The provided route name isn't even in the route hierarchy. - return false; - } + Sets the URL-changing method to be employed at the end of a + successful transition. By default, a new Transition will just + use `updateURL`, but passing 'replace' to this method will + cause the URL to update using 'replaceWith' instead. Omitting + a parameter will disable the URL change, allowing for transitions + that don't update the URL at completion (this is also used for + handleURL, since the URL has already changed before the + transition took place). - var testState = new TransitionState(); - testState.handlerInfos = targetHandlerInfos.slice(0, index + 1); - recogHandlers = recogHandlers.slice(0, index + 1); + @method method + @param {String} method the type of URL-changing method to use + at the end of a transition. Accepted values are 'replace', + falsy values, or any other non-falsy value (which is + interpreted as an updateURL transition). - var intent = new NamedTransitionIntent({ - name: targetHandler, - contexts: contexts - }); + @return {Transition} this transition + @public + */ + method: function(method) { + this.urlMethod = method; + return this; + }, - var newState = intent.applyToHandlers(testState, recogHandlers, this.getHandler, targetHandler, true, true, this.getSerializer); + /** - var handlersEqual = handlerInfosEqual(newState.handlerInfos, testState.handlerInfos); - if (!queryParams || !handlersEqual) { - return handlersEqual; - } + Fires an event on the current list of resolved/resolving + handlers within this transition. Useful for firing events + on route hierarchies that haven't fully been entered yet. - // Get a hash of QPs that will still be active on new route - var activeQPsOnNewHandler = {}; - merge(activeQPsOnNewHandler, queryParams); + Note: This method is also aliased as `send` - var activeQueryParams = state.queryParams; - for (var key in activeQueryParams) { - if (activeQueryParams.hasOwnProperty(key) && - activeQPsOnNewHandler.hasOwnProperty(key)) { - activeQPsOnNewHandler[key] = activeQueryParams[key]; - } + @method trigger + @param {Boolean} [ignoreFailure=false] a boolean specifying whether unhandled events throw an error + @param {String} name the name of the event to fire + @public + */ + trigger: function (ignoreFailure) { + var args = slice.call(arguments); + if (typeof ignoreFailure === 'boolean') { + args.shift(); + } else { + // Throw errors on unhandled trigger events by default + ignoreFailure = false; } - - return handlersEqual && !getChangelist(activeQPsOnNewHandler, queryParams); + trigger(this.router, this.state.handlerInfos.slice(0, this.resolveIndex + 1), ignoreFailure, args); }, - isActive: function(handlerName) { - var partitionedArgs = extractQueryParams(slice.call(arguments, 1)); - return this.isActiveIntent(handlerName, partitionedArgs[0], partitionedArgs[1]); + /** + Transitions are aborted and their promises rejected + when redirects occur; this method returns a promise + that will follow any redirects that occur and fulfill + with the value fulfilled by any redirecting transitions + that occur. + + @method followRedirects + @return {Promise} a promise that fulfills with the same + value that the final redirecting transition fulfills with + @public + */ + followRedirects: function() { + var router = this.router; + return this.promise['catch'](function(reason) { + if (router.activeTransition) { + return router.activeTransition.followRedirects(); + } + return rsvp.Promise.reject(reason); + }); }, - trigger: function(/*name*/) { - var args = slice.call(arguments); - trigger(this, this.currentHandlerInfos, false, args); + toString: function() { + return "Transition (sequence " + this.sequence + ")"; }, /** - Hook point for logging transition status updates. - - @param {String} message The message to log. - */ - log: null + @private + */ + log: function(message) { + log(this.router, this.sequence, message); + } }; -/** - @private - - Fires queryParamsDidChange event -*/ -function fireQueryParamDidChange(router, newState, queryParamChangelist) { - // If queryParams changed trigger event - if (queryParamChangelist) { - - // This is a little hacky but we need some way of storing - // changed query params given that no activeTransition - // is guaranteed to have occurred. - router._changedQueryParams = queryParamChangelist.all; - trigger(router, newState.handlerInfos, true, ['queryParamsDidChange', queryParamChangelist.changed, queryParamChangelist.all, queryParamChangelist.removed]); - router._changedQueryParams = null; - } -} +// Alias 'trigger' as 'send' +Transition.prototype.send = Transition.prototype.trigger; /** @private - Takes an Array of `HandlerInfo`s, figures out which ones are - exiting, entering, or changing contexts, and calls the - proper handler hooks. - - For example, consider the following tree of handlers. Each handler is - followed by the URL segment it handles. - - ``` - |~index ("/") - | |~posts ("/posts") - | | |-showPost ("/:id") - | | |-newPost ("/new") - | | |-editPost ("/edit") - | |~about ("/about/:id") - ``` + Logs and returns an instance of TransitionAbortedError. + */ +function logAbort(transition) { + log(transition.router, transition.sequence, "detected abort."); + return new TransitionAbortedError(); +} - Consider the following transitions: +function TransitionIntent(props) { + this.initialize(props); - 1. A URL transition to `/posts/1`. - 1. Triggers the `*model` callbacks on the - `index`, `posts`, and `showPost` handlers - 2. Triggers the `enter` callback on the same - 3. Triggers the `setup` callback on the same - 2. A direct transition to `newPost` - 1. Triggers the `exit` callback on `showPost` - 2. Triggers the `enter` callback on `newPost` - 3. Triggers the `setup` callback on `newPost` - 3. A direct transition to `about` with a specified - context object - 1. Triggers the `exit` callback on `newPost` - and `posts` - 2. Triggers the `serialize` callback on `about` - 3. Triggers the `enter` callback on `about` - 4. Triggers the `setup` callback on `about` + // TODO: wat + this.data = this.data || {}; +} - @param {Router} transition - @param {TransitionState} newState -*/ -function setupContexts(router, newState, transition) { - var partition = partitionHandlers(router.state, newState); - var i, l, handler; +TransitionIntent.prototype = { + initialize: null, + applyToState: null +}; - for (i=0, l=partition.exited.length; i= 0; --i) { - var handlerInfo = handlerInfos[i]; - merge(params, handlerInfo.params); - if (handlerInfo.handler.inaccessibleByURL) { - urlMethod = null; + if (this.queryParams) { + args.push(this.queryParams); } - } - - if (urlMethod) { - params.queryParams = transition._visibleQueryParams || state.queryParams; - var url = router.recognizer.generate(handlerName, params); - - // transitions during the initial transition must always use replaceURL. - // When the app boots, you are at a url, e.g. /foo. If some handler - // redirects to bar as part of the initial transition, you don't want to - // add a history entry for /foo. If you do, pressing back will immediately - // hit the redirect again and take you back to /bar, thus killing the back - // button - var initial = transition.isCausedByInitialTransition; + args.push(payload); - // say you are at / and you click a link to route /foo. In /foo's - // handler, the transition is aborted using replacewith('/bar'). - // Because the current url is still /, the history entry for / is - // removed from the history. Clicking back will take you to the page - // you were on before /, which is often not even the app, thus killing - // the back button. That's why updateURL is always correct for an - // aborting transition that's not the initial transition - var replaceAndNotAborting = ( - urlMethod === 'replace' && - !transition.isCausedByAbortingTransition - ); + var result = applyHook(this.handler, hookName, args); - if (initial || replaceAndNotAborting) { - router.replaceURL(url); - } else { - router.updateURL(url); + if (result && result.isTransition) { + result = null; } - } -} -/** - @private - - Updates the URL (if necessary) and calls `setupContexts` - to update the router's array of `currentHandlerInfos`. - */ -function finalizeTransition(transition, newState) { + return rsvp.Promise.resolve(result, this.promiseLabel("Resolve value returned from one of the model hooks")); + }, - try { - log(transition.router, transition.sequence, "Resolved all models on destination route; finalizing transition."); + // overridden by subclasses + getModel: null, - var router = transition.router, - handlerInfos = newState.handlerInfos; + checkForAbort: function(shouldContinue, promiseValue) { + return rsvp.Promise.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")); + }, - // Run all the necessary enter/setup/exit hooks - setupContexts(router, newState, transition); + stashResolvedModel: function(payload, resolvedModel) { + payload.resolvedModels = payload.resolvedModels || {}; + payload.resolvedModels[this.name] = resolvedModel; + }, - // Check if a redirect occurred in enter/setup - if (transition.isAborted) { - // TODO: cleaner way? distinguish b/w targetHandlerInfos? - router.state.handlerInfos = router.currentHandlerInfos; - return rsvp.Promise.reject(logAbort(transition)); + becomeResolved: function(payload, resolvedContext) { + var params = this.serialize(resolvedContext); + + if (payload) { + this.stashResolvedModel(payload, resolvedContext); + payload.params = payload.params || {}; + payload.params[this.name] = params; } - updateURL(transition, newState, transition.intent.url); + return this.factory('resolved', { + context: resolvedContext, + name: this.name, + handler: this.handler, + params: params + }); + }, - transition.isActive = false; - router.activeTransition = null; + shouldSupercede: function(other) { + // Prefer this newer handlerInfo over `other` if: + // 1) The other one doesn't exist + // 2) The names don't match + // 3) This handler has a context that doesn't match + // the other one (or the other one doesn't have one). + // 4) This handler has parameters that don't match the other. + if (!other) { return true; } - trigger(router, router.currentHandlerInfos, true, ['didTransition']); + var contextsMatch = (other.context === this.context); + return other.name !== this.name || + (this.hasOwnProperty('context') && !contextsMatch) || + (this.hasOwnProperty('params') && !paramsMatch(this.params, other.params)); + } +}; - if (router.didTransition) { - router.didTransition(router.currentHandlerInfos); +Object.defineProperty(HandlerInfo.prototype, 'handler', { + get: function() { + // _handler could be set to either a handler object or undefined, so we + // compare against a default reference to know when it's been set + if (this._handler !== DEFAULT_HANDLER) { + return this._handler; } - log(router, transition.sequence, "TRANSITION COMPLETE."); + return this.fetchHandler(); + }, - // Resolve with the final handler. - return handlerInfos[handlerInfos.length - 1].handler; - } catch(e) { - if (!(e instanceof TransitionAborted)) { - //var erroneousHandler = handlerInfos.pop(); - var infos = transition.state.handlerInfos; - transition.trigger(true, 'error', e, transition, infos[infos.length-1].handler); - transition.abort(); + set: function(handler) { + return this._handler = handler; + } +}); + +Object.defineProperty(HandlerInfo.prototype, 'handlerPromise', { + get: function() { + if (this._handlerPromise) { + return this._handlerPromise; } - throw e; - } -} + this.fetchHandler(); -/** - @private + return this._handlerPromise; + }, - Begins and returns a Transition based on the provided - arguments. Accepts arguments in the form of both URL - transitions and named transitions. + set: function(handlerPromise) { + return this._handlerPromise = handlerPromise; + } +}); - @param {Router} router - @param {Array[Object]} args arguments passed to transitionTo, - replaceWith, or handleURL -*/ -function doTransition(router, args, isIntermediate) { - // Normalize blank transitions to root URL transitions. - var name = args[0] || '/'; +function paramsMatch(a, b) { + if ((!a) ^ (!b)) { + // Only one is null. + return false; + } - var lastArg = args[args.length-1]; - var queryParams = {}; - if (lastArg && lastArg.hasOwnProperty('queryParams')) { - queryParams = pop.call(args).queryParams; + if (!a) { + // Both must be null. + return true; } - var intent; - if (args.length === 0) { + // Note: this assumes that both params have the same + // number of keys, but since we're comparing the + // same handlers, they should. + for (var k in a) { + if (a.hasOwnProperty(k) && a[k] !== b[k]) { + return false; + } + } + return true; +} - log(router, "Updating query params"); +var ResolvedHandlerInfo = subclass(HandlerInfo, { + resolve: function(shouldContinue, payload) { + // A ResolvedHandlerInfo just resolved with itself. + if (payload && payload.resolvedModels) { + payload.resolvedModels[this.name] = this.context; + } + return rsvp.Promise.resolve(this, this.promiseLabel("Resolve")); + }, - // A query param update is really just a transition - // into the route you're already on. - var handlerInfos = router.state.handlerInfos; - intent = new NamedTransitionIntent({ - name: handlerInfos[handlerInfos.length - 1].name, - contexts: [], - queryParams: queryParams + getUnresolved: function() { + return this.factory('param', { + name: this.name, + handler: this.handler, + params: this.params }); + }, - } else if (name.charAt(0) === '/') { + isResolved: true +}); - log(router, "Attempting URL transition to " + name); - intent = new URLTransitionIntent({ url: name }); +var UnresolvedHandlerInfoByObject = subclass(HandlerInfo, { + getModel: function(payload) { + this.log(payload, this.name + ": resolving provided model"); + return rsvp.Promise.resolve(this.context); + }, - } else { + initialize: function(props) { + this.names = props.names || []; + this.context = props.context; + }, - log(router, "Attempting transition to " + name); - intent = new NamedTransitionIntent({ - name: args[0], - contexts: slice.call(args, 1), - queryParams: queryParams - }); - } + /** + @private - return router.transitionByIntent(intent, isIntermediate); -} + Serializes a handler using its custom `serialize` method or + by a default that looks up the expected property name from + the dynamic segment. -function handlerInfosEqual(handlerInfos, otherHandlerInfos) { - if (handlerInfos.length !== otherHandlerInfos.length) { - return false; - } + @param {Object} model the model to be serialized for this handler + */ + serialize: function(_model) { + var model = _model || this.context, + names = this.names, + serializer = this.serializer || (this.handler && this.handler.serialize); - for (var i = 0, len = handlerInfos.length; i < len; ++i) { - if (handlerInfos[i] !== otherHandlerInfos[i]) { - return false; + var object = {}; + if (isParam(model)) { + object[names[0]] = model; + return object; } - } - return true; -} - -function finalizeQueryParamChange(router, resolvedHandlers, newQueryParams, transition) { - // We fire a finalizeQueryParamChange event which - // gives the new route hierarchy a chance to tell - // us which query params it's consuming and what - // their final values are. If a query param is - // no longer consumed in the final route hierarchy, - // its serialized segment will be removed - // from the URL. - for (var k in newQueryParams) { - if (newQueryParams.hasOwnProperty(k) && - newQueryParams[k] === null) { - delete newQueryParams[k]; + // Use custom serialize if it exists. + if (serializer) { + return serializer(model, names); } - } - var finalQueryParamsArray = []; - trigger(router, resolvedHandlers, true, ['finalizeQueryParamChange', newQueryParams, finalQueryParamsArray, transition]); + if (names.length !== 1) { return; } - if (transition) { - transition._visibleQueryParams = {}; - } + var name = names[0]; - var finalQueryParams = {}; - for (var i = 0, len = finalQueryParamsArray.length; i < len; ++i) { - var qp = finalQueryParamsArray[i]; - finalQueryParams[qp.key] = qp.value; - if (transition && qp.visible !== false) { - transition._visibleQueryParams[qp.key] = qp.value; + if (/_id$/.test(name)) { + object[name] = model.id; + } else { + object[name] = model; } + return object; } - return finalQueryParams; -} - -function notifyExistingHandlers(router, newState, newTransition) { - var oldHandlers = router.state.handlerInfos, - changing = [], - leavingIndex = null, - leaving, leavingChecker, i, oldHandlerLen, oldHandler, newHandler; +}); - oldHandlerLen = oldHandlers.length; - for (i = 0; i < oldHandlerLen; i++) { - oldHandler = oldHandlers[i]; - newHandler = newState.handlerInfos[i]; +// Generated by URL transitions and non-dynamic route segments in named Transitions. +var UnresolvedHandlerInfoByParam = subclass (HandlerInfo, { + initialize: function(props) { + this.params = props.params || {}; + }, - if (!newHandler || oldHandler.name !== newHandler.name) { - leavingIndex = i; - break; + getModel: function(payload) { + var fullParams = this.params; + if (payload && payload.queryParams) { + fullParams = {}; + merge(fullParams, this.params); + fullParams.queryParams = payload.queryParams; } - if (!newHandler.isResolved) { - changing.push(oldHandler); - } - } + var handler = this.handler; + var hookName = resolveHook(handler, 'deserialize') || + resolveHook(handler, 'model'); - if (leavingIndex !== null) { - leaving = oldHandlers.slice(leavingIndex, oldHandlerLen); - leavingChecker = function(name) { - for (var h = 0, len = leaving.length; h < len; h++) { - if (leaving[h].name === name) { - return true; - } - } - return false; - }; + return this.runSharedModelHook(payload, hookName, [fullParams]); } +}); - trigger(router, oldHandlers, true, ['willTransition', newTransition]); +handlerInfoFactory.klasses = { + resolved: ResolvedHandlerInfo, + param: UnresolvedHandlerInfoByParam, + object: UnresolvedHandlerInfoByObject +}; - if (router.willTransition) { - router.willTransition(oldHandlers, newState.handlerInfos, newTransition); - } +function handlerInfoFactory(name, props) { + var Ctor = handlerInfoFactory.klasses[name], + handlerInfo = new Ctor(props || {}); + handlerInfo.factory = handlerInfoFactory; + return handlerInfo; } -exports['default'] = Router; -exports.Transition = Transition; +var NamedTransitionIntent = subclass(TransitionIntent, { + name: null, + pivotHandler: null, + contexts: null, + queryParams: null, -Object.defineProperty(exports, '__esModule', { value: true }); + initialize: function(props) { + this.name = props.name; + this.pivotHandler = props.pivotHandler; + this.contexts = props.contexts || []; + this.queryParams = props.queryParams; + }, -}); -/*! - * @overview RSVP - a tiny implementation of Promises/A+. - * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors - * @license Licensed under MIT license - * See https://raw.githubusercontent.com/tildeio/rsvp.js/master/LICENSE - * @version 3.2.1 - */ + applyToState: function(oldState, recognizer, getHandler, isIntermediate, getSerializer) { -enifed('rsvp', ['exports'], function (exports) { 'use strict'; + var partitionedArgs = extractQueryParams([this.name].concat(this.contexts)), + pureArgs = partitionedArgs[0], + handlers = recognizer.handlersFor(pureArgs[0]); -function indexOf(callbacks, callback) { - for (var i=0, l=callbacks.length; i= 0; --i) { + var result = handlers[i]; + var name = result.handler; - ```javascript - var object = {}; + var oldHandlerInfo = oldState.handlerInfos[i]; + var newHandlerInfo = null; - RSVP.EventTarget.mixin(object); + if (result.names.length > 0) { + if (i >= invalidateIndex) { + newHandlerInfo = this.createParamHandlerInfo(name, getHandler, result.names, objects, oldHandlerInfo); + } else { + var serializer = getSerializer(name); + newHandlerInfo = this.getHandlerInfoForDynamicSegment(name, getHandler, result.names, objects, oldHandlerInfo, targetRouteName, i, serializer); + } + } else { + // This route has no dynamic segment. + // Therefore treat as a param-based handlerInfo + // with empty params. This will cause the `model` + // hook to be called with empty params, which is desirable. + newHandlerInfo = this.createParamHandlerInfo(name, getHandler, result.names, objects, oldHandlerInfo); + } - object.on('finished', function(event) { - // handle event - }); + if (checkingIfActive) { + // If we're performing an isActive check, we want to + // serialize URL params with the provided context, but + // ignore mismatches between old and new context. + newHandlerInfo = newHandlerInfo.becomeResolved(null, newHandlerInfo.context); + var oldContext = oldHandlerInfo && oldHandlerInfo.context; + if (result.names.length > 0 && newHandlerInfo.context === oldContext) { + // If contexts match in isActive test, assume params also match. + // This allows for flexibility in not requiring that every last + // handler provide a `serialize` method + newHandlerInfo.params = oldHandlerInfo && oldHandlerInfo.params; + } + newHandlerInfo.context = oldContext; + } - object.trigger('finished', { detail: value }); - ``` + var handlerToUse = oldHandlerInfo; + if (i >= invalidateIndex || newHandlerInfo.shouldSupercede(oldHandlerInfo)) { + invalidateIndex = Math.min(i, invalidateIndex); + handlerToUse = newHandlerInfo; + } - `EventTarget.mixin` also works with prototypes: + if (isIntermediate && !checkingIfActive) { + handlerToUse = handlerToUse.becomeResolved(null, handlerToUse.context); + } - ```javascript - var Person = function() {}; - RSVP.EventTarget.mixin(Person.prototype); + newState.handlerInfos.unshift(handlerToUse); + } - var yehuda = new Person(); - var tom = new Person(); + if (objects.length > 0) { + throw new Error("More context objects were passed than there are dynamic segments for the route: " + targetRouteName); + } - yehuda.on('poke', function(event) { - console.log('Yehuda says OW'); - }); + if (!isIntermediate) { + this.invalidateChildren(newState.handlerInfos, invalidateIndex); + } - tom.on('poke', function(event) { - console.log('Tom says OW'); - }); + merge(newState.queryParams, this.queryParams || {}); - yehuda.trigger('poke'); - tom.trigger('poke'); - ``` + return newState; + }, - @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']; - object._promiseCallbacks = undefined; - return object; + invalidateChildren: function(handlerInfos, invalidateIndex) { + for (var i = invalidateIndex, l = handlerInfos.length; i < l; ++i) { + var handlerInfo = handlerInfos[i]; + handlerInfos[i] = handlerInfo.getUnresolved(); + } }, - /** - Registers a callback to be executed when `eventName` is triggered + getHandlerInfoForDynamicSegment: function(name, getHandler, names, objects, oldHandlerInfo, targetRouteName, i, serializer) { + var objectToUse; + if (objects.length > 0) { - ```javascript - object.on('event', function(eventInfo){ - // handle the event + // Use the objects provided for this transition. + objectToUse = objects[objects.length - 1]; + if (isParam(objectToUse)) { + return this.createParamHandlerInfo(name, getHandler, names, objects, oldHandlerInfo); + } else { + objects.pop(); + } + } else if (oldHandlerInfo && oldHandlerInfo.name === name) { + // Reuse the matching oldHandlerInfo + return oldHandlerInfo; + } else { + if (this.preTransitionState) { + var preTransitionHandlerInfo = this.preTransitionState.handlerInfos[i]; + objectToUse = preTransitionHandlerInfo && preTransitionHandlerInfo.context; + } else { + // Ideally we should throw this error to provide maximal + // information to the user that not enough context objects + // were provided, but this proves too cumbersome in Ember + // in cases where inner template helpers are evaluated + // before parent helpers un-render, in which cases this + // error somewhat prematurely fires. + //throw new Error("Not enough context objects were provided to complete a transition to " + targetRouteName + ". Specifically, the " + name + " route needs an object that can be serialized into its dynamic URL segments [" + names.join(', ') + "]"); + return oldHandlerInfo; + } + } + + return handlerInfoFactory('object', { + name: name, + getHandler: getHandler, + serializer: serializer, + context: objectToUse, + names: names }); + }, - object.trigger('event'); - ``` + createParamHandlerInfo: function(name, getHandler, names, objects, oldHandlerInfo) { + var params = {}; - @method on - @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) { - if (typeof callback !== 'function') { - throw new TypeError('Callback must be a function'); + // Soak up all the provided string/numbers + var numNames = names.length; + while (numNames--) { + + // Only use old params if the names match with the new handler + var oldParams = (oldHandlerInfo && name === oldHandlerInfo.name && oldHandlerInfo.params) || {}; + + var peek = objects[objects.length - 1]; + var paramName = names[numNames]; + if (isParam(peek)) { + 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); + } + } } - var allCallbacks = callbacksFor(this), callbacks; + return handlerInfoFactory('param', { + name: name, + getHandler: getHandler, + params: params + }); + } +}); + +function UnrecognizedURLError(message) { + if (!(this instanceof UnrecognizedURLError)) { + return new UnrecognizedURLError(message); + } - callbacks = allCallbacks[eventName]; + var error = Error.call(this, message); - if (!callbacks) { - callbacks = allCallbacks[eventName] = []; - } + if (Error.captureStackTrace) { + Error.captureStackTrace(this, UnrecognizedURLError); + } else { + this.stack = error.stack; + } - if (indexOf(callbacks, callback) === -1) { - callbacks.push(callback); - } - }, + this.description = error.description; + this.fileName = error.fileName; + this.lineNumber = error.lineNumber; + this.message = error.message || 'UnrecognizedURL'; + this.name = 'UnrecognizedURLError'; + this.number = error.number; + this.code = error.code; +} - /** - You can use `off` to stop firing a particular callback for an event: +UnrecognizedURLError.prototype = oCreate(Error.prototype); - ```javascript - function doStuff() { // do stuff! } - object.on('stuff', doStuff); +var URLTransitionIntent = subclass(TransitionIntent, { + url: null, - object.trigger('stuff'); // doStuff will be called + initialize: function(props) { + this.url = props.url; + }, - // Unregister ONLY the doStuff callback - object.off('stuff', doStuff); - object.trigger('stuff'); // doStuff will NOT be called - ``` + applyToState: function(oldState, recognizer, getHandler) { + var newState = new TransitionState(); - If you don't pass a `callback` argument to `off`, ALL callbacks for the - event will not be executed when the event fires. For example: + var results = recognizer.recognize(this.url), + i, len; - ```javascript - var callback1 = function(){}; - var callback2 = function(){}; + if (!results) { + throw new UnrecognizedURLError(this.url); + } + + var statesDiffer = false; + var url = this.url; - object.on('stuff', callback1); - object.on('stuff', callback2); + // Checks if a handler is accessible by URL. If it is not, an error is thrown. + // For the case where the handler is loaded asynchronously, the error will be + // thrown once it is loaded. + function checkHandlerAccessibility(handler) { + if (handler && handler.inaccessibleByURL) { + throw new UnrecognizedURLError(url); + } - object.trigger('stuff'); // callback1 and callback2 will be executed. + return handler; + } - object.off('stuff'); - object.trigger('stuff'); // callback1 and callback2 will not be executed! - ``` + for (i = 0, len = results.length; i < len; ++i) { + var result = results[i]; + var name = result.handler; + var newHandlerInfo = handlerInfoFactory('param', { + name: name, + getHandler: getHandler, + params: result.params + }); + var handler = newHandlerInfo.handler; - @method off - @for RSVP.EventTarget - @private - @param {String} eventName event to stop listening to - @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) { - var allCallbacks = callbacksFor(this), callbacks, index; + if (handler) { + checkHandlerAccessibility(handler); + } else { + // If the hanlder is being loaded asynchronously, check if we can + // access it after it has resolved + newHandlerInfo.handlerPromise = newHandlerInfo.handlerPromise.then(checkHandlerAccessibility); + } - if (!callback) { - allCallbacks[eventName] = []; - return; + var oldHandlerInfo = oldState.handlerInfos[i]; + if (statesDiffer || newHandlerInfo.shouldSupercede(oldHandlerInfo)) { + statesDiffer = true; + newState.handlerInfos[i] = newHandlerInfo; + } else { + newState.handlerInfos[i] = oldHandlerInfo; + } } - callbacks = allCallbacks[eventName]; - - index = indexOf(callbacks, callback); - - if (index !== -1) { callbacks.splice(index, 1); } - }, + merge(newState.queryParams, results.queryParams); - /** - Use `trigger` to fire custom events. For example: + return newState; + } +}); - ```javascript - object.on('foo', function(){ - console.log('foo event happened!'); - }); - object.trigger('foo'); - // 'foo event happened!' logged to the console - ``` +var pop = Array.prototype.pop; - You can also pass a value as a second argument to `trigger` that will be - passed as an argument to all event listeners for the event: +function Router(_options) { + var options = _options || {}; + this.getHandler = options.getHandler || this.getHandler; + this.getSerializer = options.getSerializer || this.getSerializer; + this.updateURL = options.updateURL || this.updateURL; + this.replaceURL = options.replaceURL || this.replaceURL; + this.didTransition = options.didTransition || this.didTransition; + this.willTransition = options.willTransition || this.willTransition; + this.delegate = options.delegate || this.delegate; + this.triggerEvent = options.triggerEvent || this.triggerEvent; + this.log = options.log || this.log; + this.dslCallBacks = []; // NOTE: set by Ember + this.state = undefined; + this.activeTransition = undefined; + this._changedQueryParams = undefined; + this.oldState = undefined; + this.currentHandlerInfos = undefined; + this.state = undefined; + this.currentSequence = 0; - ```javascript - object.on('foo', function(value){ - console.log(value.name); - }); + this.recognizer = new RouteRecognizer(); + this.reset(); +} - object.trigger('foo', { name: 'bar' }); - // 'bar' logged to the console - ``` +function getTransitionByIntent(intent, isIntermediate) { + var wasTransitioning = !!this.activeTransition; + var oldState = wasTransitioning ? this.activeTransition.state : this.state; + var newTransition; - @method trigger - @for RSVP.EventTarget - @private - @param {String} eventName name of the event to be triggered - @param {*} options optional value to be passed to any event handlers for - the given `eventName` - */ - 'trigger': function(eventName, options, label) { - var allCallbacks = callbacksFor(this), callbacks, callback; + var newState = intent.applyToState(oldState, this.recognizer, this.getHandler, isIntermediate, this.getSerializer); + var queryParamChangelist = getChangelist(oldState.queryParams, newState.queryParams); - if (callbacks = allCallbacks[eventName]) { - // Don't cache the callbacks.length since it may grow - for (var i=0; i 1) { - throw new Error('Second argument not supported'); - } - if (typeof o !== 'object') { - throw new TypeError('Argument must be an object'); - } - F.prototype = o; - return new F(); -}); +Router.prototype = { -var queue = []; + /** + The main entry point into the router. The API is essentially + the same as the `map` method in `route-recognizer`. -function scheduleFlush() { - setTimeout(function() { - var entry; - for (var i = 0; i < queue.length; i++) { - entry = queue[i]; + This method extracts the String handler at the last `.to()` + call and uses it as the name of the whole route. - var payload = entry.payload; + @param {Function} callback + */ + map: function(callback) { + this.recognizer.delegate = this.delegate; - payload.guid = payload.key + payload.id; - payload.childGuid = payload.key + payload.childId; - if (payload.error) { - payload.stack = payload.error.stack; + this.recognizer.map(callback, function(recognizer, routes) { + for (var i = routes.length - 1, proceed = true; i >= 0 && proceed; --i) { + var route = routes[i]; + recognizer.add(routes, { as: route.handler }); + proceed = route.path === '/' || route.path === '' || route.handler.slice(-6) === '.index'; } + }); + }, - config['trigger'](entry.name, entry.payload); - } - queue.length = 0; - }, 50); -} + hasRoute: function(route) { + return this.recognizer.hasRoute(route); + }, -function instrument(eventName, promise, child) { - if (1 === queue.push({ - name: eventName, - payload: { - key: promise._guidKey, - id: promise._id, - eventName: eventName, - detail: promise._result, - childId: child && child._id, - label: promise._label, - timeStamp: now(), - error: config["instrument-with-stack"] ? new Error(promise._label) : null - }})) { - scheduleFlush(); - } - } + getHandler: function() {}, -/** - `RSVP.Promise.resolve` returns a promise that will become resolved with the - passed `value`. It is shorthand for the following: + getSerializer: function() {}, - ```javascript - var promise = new RSVP.Promise(function(resolve, reject){ - resolve(1); - }); + queryParamsTransition: function(changelist, wasTransitioning, oldState, newState) { + var router = this; - promise.then(function(value){ - // value === 1 - }); - ``` + fireQueryParamDidChange(this, newState, changelist); - Instead of writing the above, your code now simply becomes the following: + if (!wasTransitioning && this.activeTransition) { + // One of the handlers in queryParamsDidChange + // caused a transition. Just return that transition. + return this.activeTransition; + } else { + // Running queryParamsDidChange didn't change anything. + // Just update query params and be on our way. - ```javascript - var promise = RSVP.Promise.resolve(1); + // We have to return a noop transition that will + // perform a URL update at the end. This gives + // the user the ability to set the url update + // method (default is replaceState). + var newTransition = new Transition(this); + newTransition.queryParamsOnly = true; - promise.then(function(value){ - // value === 1 - }); - ``` + oldState.queryParams = finalizeQueryParamChange(this, newState.handlerInfos, newState.queryParams, newTransition); - @method resolve - @static - @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` -*/ -function resolve$1(object, label) { - /*jshint validthis:true */ - var Constructor = this; + newTransition.promise = newTransition.promise.then(function(result) { + updateURL(newTransition, oldState, true); + if (router.didTransition) { + router.didTransition(router.currentHandlerInfos); + } + return result; + }, null, promiseLabel("Transition complete")); + return newTransition; + } + }, - if (object && typeof object === 'object' && object.constructor === Constructor) { - return object; - } + // NOTE: this doesn't really belong here, but here + // it shall remain until our ES6 transpiler can + // handle cyclical deps. + transitionByIntent: function(intent/*, isIntermediate*/) { + try { + return getTransitionByIntent.apply(this, arguments); + } catch(e) { + return new Transition(this, intent, null, e); + } + }, - var promise = new Constructor(noop, label); - resolve(promise, object); - return promise; -} + /** + Clears the current and target route handlers and triggers exit + on each of them starting at the leaf and traversing up through + its ancestors. + */ + reset: function() { + if (this.state) { + forEach(this.state.handlerInfos.slice().reverse(), function(handlerInfo) { + var handler = handlerInfo.handler; + callHook(handler, 'exit'); + }); + } -function withOwnPromise() { - return new TypeError('A promises callback cannot return that same promise.'); -} + this.oldState = undefined; + this.state = new TransitionState(); + this.currentHandlerInfos = null; + }, -function noop() {} + activeTransition: null, -var PENDING = void 0; -var FULFILLED = 1; -var REJECTED = 2; + /** + var handler = handlerInfo.handler; + The entry point for handling a change to the URL (usually + via the back and forward button). -var GET_THEN_ERROR = new ErrorObject(); + Returns an Array of handlers and the parameters associated + with those parameters. -function getThen(promise) { - try { - return promise.then; - } catch(error) { - GET_THEN_ERROR.error = error; - return GET_THEN_ERROR; - } -} + @param {String} url a URL to process -function tryThen(then, value, fulfillmentHandler, rejectionHandler) { - try { - then.call(value, fulfillmentHandler, rejectionHandler); - } catch(e) { - return e; - } -} + @return {Array} an Array of `[handler, parameter]` tuples + */ + handleURL: function(url) { + // Perform a URL-based transition, but don't change + // the URL afterward, since it already happened. + var args = slice.call(arguments); + if (url.charAt(0) !== '/') { args[0] = '/' + url; } -function handleForeignThenable(promise, thenable, then) { - config.async(function(promise) { - var sealed = false; - var error = tryThen(then, thenable, function(value) { - if (sealed) { return; } - sealed = true; - if (thenable !== value) { - resolve(promise, value, undefined); - } else { - fulfill(promise, value); - } - }, function(reason) { - if (sealed) { return; } - sealed = true; + return doTransition(this, args).method(null); + }, - reject(promise, reason); - }, 'Settle: ' + (promise._label || ' unknown promise')); + /** + Hook point for updating the URL. - if (!sealed && error) { - sealed = true; - reject(promise, error); - } - }, promise); -} + @param {String} url a URL to update to + */ + updateURL: function() { + throw new Error("updateURL is not implemented"); + }, -function handleOwnThenable(promise, thenable) { - if (thenable._state === FULFILLED) { - fulfill(promise, thenable._result); - } else if (thenable._state === REJECTED) { - thenable._onError = null; - reject(promise, thenable._result); - } else { - subscribe(thenable, undefined, function(value) { - if (thenable !== value) { - resolve(promise, value, undefined); - } else { - fulfill(promise, value); - } - }, function(reason) { - reject(promise, reason); - }); - } -} + /** + Hook point for replacing the current URL, i.e. with replaceState -function handleMaybeThenable(promise, maybeThenable, then$$) { - if (maybeThenable.constructor === promise.constructor && - then$$ === then && - constructor.resolve === resolve$1) { - handleOwnThenable(promise, maybeThenable); - } else { - if (then$$ === GET_THEN_ERROR) { - reject(promise, GET_THEN_ERROR.error); - } else if (then$$ === undefined) { - fulfill(promise, maybeThenable); - } else if (isFunction(then$$)) { - handleForeignThenable(promise, maybeThenable, then$$); - } else { - fulfill(promise, maybeThenable); - } - } -} + By default this behaves the same as `updateURL` -function resolve(promise, value) { - if (promise === value) { - fulfill(promise, value); - } else if (objectOrFunction(value)) { - handleMaybeThenable(promise, value, getThen(value)); - } else { - fulfill(promise, value); - } -} + @param {String} url a URL to update to + */ + replaceURL: function(url) { + this.updateURL(url); + }, -function publishRejection(promise) { - if (promise._onError) { - promise._onError(promise._result); - } + /** + Transition into the specified named route. - publish(promise); -} + If necessary, trigger the exit callback on any handlers + that are no longer represented by the target route. -function fulfill(promise, value) { - if (promise._state !== PENDING) { return; } + @param {String} name the name of the route + */ + transitionTo: function(/*name*/) { + return doTransition(this, arguments); + }, - promise._result = value; - promise._state = FULFILLED; + intermediateTransitionTo: function(/*name*/) { + return doTransition(this, arguments, true); + }, - if (promise._subscribers.length === 0) { - if (config.instrument) { - instrument('fulfilled', promise); + refresh: function(pivotHandler) { + var state = this.activeTransition ? this.activeTransition.state : this.state; + var handlerInfos = state.handlerInfos; + var params = {}; + for (var i = 0, len = handlerInfos.length; i < len; ++i) { + var handlerInfo = handlerInfos[i]; + params[handlerInfo.name] = handlerInfo.params || {}; } - } else { - config.async(publish, promise); - } -} -function reject(promise, reason) { - if (promise._state !== PENDING) { return; } - promise._state = REJECTED; - promise._result = reason; - config.async(publishRejection, promise); -} + log(this, "Starting a refresh transition"); + var intent = new NamedTransitionIntent({ + name: handlerInfos[handlerInfos.length - 1].name, + pivotHandler: pivotHandler || handlerInfos[0].handler, + contexts: [], // TODO collect contexts...? + queryParams: this._changedQueryParams || state.queryParams || {} + }); -function subscribe(parent, child, onFulfillment, onRejection) { - var subscribers = parent._subscribers; - var length = subscribers.length; + return this.transitionByIntent(intent, false); + }, - parent._onError = null; + /** + Identical to `transitionTo` except that the current URL will be replaced + if possible. - subscribers[length] = child; - subscribers[length + FULFILLED] = onFulfillment; - subscribers[length + REJECTED] = onRejection; + This method is intended primarily for use with `replaceState`. - if (length === 0 && parent._state) { - config.async(publish, parent); - } -} + @param {String} name the name of the route + */ + replaceWith: function(/*name*/) { + return doTransition(this, arguments).method('replace'); + }, -function publish(promise) { - var subscribers = promise._subscribers; - var settled = promise._state; + /** + Take a named route and context objects and generate a + URL. - if (config.instrument) { - instrument(settled === FULFILLED ? 'fulfilled' : 'rejected', promise); - } + @param {String} name the name of the route to generate + a URL for + @param {...Object} objects a list of objects to serialize - if (subscribers.length === 0) { return; } + @return {String} a URL + */ + generate: function(handlerName) { - var child, callback, detail = promise._result; + var partitionedArgs = extractQueryParams(slice.call(arguments, 1)), + suppliedParams = partitionedArgs[0], + queryParams = partitionedArgs[1]; - for (var i = 0; i < subscribers.length; i += 3) { - child = subscribers[i]; - callback = subscribers[i + settled]; + // Construct a TransitionIntent with the provided params + // and apply it to the present state of the router. + var intent = new NamedTransitionIntent({ name: handlerName, contexts: suppliedParams }); + var state = intent.applyToState(this.state, this.recognizer, this.getHandler, null, this.getSerializer); + var params = {}; - if (child) { - invokeCallback(settled, child, callback, detail); - } else { - callback(detail); + for (var i = 0, len = state.handlerInfos.length; i < len; ++i) { + var handlerInfo = state.handlerInfos[i]; + var handlerParams = handlerInfo.serialize(); + merge(params, handlerParams); } - } + params.queryParams = queryParams; - promise._subscribers.length = 0; -} + return this.recognizer.generate(handlerName, params); + }, -function ErrorObject() { - this.error = null; -} + applyIntent: function(handlerName, contexts) { + var intent = new NamedTransitionIntent({ + name: handlerName, + contexts: contexts + }); -var TRY_CATCH_ERROR = new ErrorObject(); + var state = this.activeTransition && this.activeTransition.state || this.state; + return intent.applyToState(state, this.recognizer, this.getHandler, null, this.getSerializer); + }, -function tryCatch(callback, detail) { - try { - return callback(detail); - } catch(e) { - TRY_CATCH_ERROR.error = e; - return TRY_CATCH_ERROR; - } -} + isActiveIntent: function(handlerName, contexts, queryParams, _state) { + var state = _state || this.state, + targetHandlerInfos = state.handlerInfos, + handlerInfo, len; -function invokeCallback(settled, promise, callback, detail) { - var hasCallback = isFunction(callback), - value, error, succeeded, failed; + if (!targetHandlerInfos.length) { return false; } - if (hasCallback) { - value = tryCatch(callback, detail); + var targetHandler = targetHandlerInfos[targetHandlerInfos.length - 1].name; + var recogHandlers = this.recognizer.handlersFor(targetHandler); - if (value === TRY_CATCH_ERROR) { - failed = true; - error = value.error; - value = null; - } else { - succeeded = true; + var index = 0; + for (len = recogHandlers.length; index < len; ++index) { + handlerInfo = targetHandlerInfos[index]; + if (handlerInfo.name === handlerName) { break; } } - if (promise === value) { - reject(promise, withOwnPromise()); - return; + if (index === recogHandlers.length) { + // The provided route name isn't even in the route hierarchy. + return false; } - } else { - value = detail; - succeeded = true; - } - - 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); - } -} + var testState = new TransitionState(); + testState.handlerInfos = targetHandlerInfos.slice(0, index + 1); + recogHandlers = recogHandlers.slice(0, index + 1); -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); + var intent = new NamedTransitionIntent({ + name: targetHandler, + contexts: contexts }); - } catch(e) { - reject(promise, e); - } -} -function then(onFulfillment, onRejection, label) { - var parent = this; - var state = parent._state; + var newState = intent.applyToHandlers(testState, recogHandlers, this.getHandler, targetHandler, true, true, this.getSerializer); - if (state === FULFILLED && !onFulfillment || state === REJECTED && !onRejection) { - config.instrument && instrument('chained', parent, parent); - return parent; - } + var handlersEqual = handlerInfosEqual(newState.handlerInfos, testState.handlerInfos); + if (!queryParams || !handlersEqual) { + return handlersEqual; + } - parent._onError = null; + // Get a hash of QPs that will still be active on new route + var activeQPsOnNewHandler = {}; + merge(activeQPsOnNewHandler, queryParams); - var child = new parent.constructor(noop, label); - var result = parent._result; + var activeQueryParams = state.queryParams; + for (var key in activeQueryParams) { + if (activeQueryParams.hasOwnProperty(key) && + activeQPsOnNewHandler.hasOwnProperty(key)) { + activeQPsOnNewHandler[key] = activeQueryParams[key]; + } + } - config.instrument && instrument('chained', parent, child); + return handlersEqual && !getChangelist(activeQPsOnNewHandler, queryParams); + }, - if (state) { - var callback = arguments[state - 1]; - config.async(function(){ - invokeCallback(state, child, callback, result); - }); - } else { - subscribe(parent, child, onFulfillment, onRejection); - } + isActive: function(handlerName) { + var partitionedArgs = extractQueryParams(slice.call(arguments, 1)); + return this.isActiveIntent(handlerName, partitionedArgs[0], partitionedArgs[1]); + }, - return child; -} + trigger: function(/*name*/) { + var args = slice.call(arguments); + trigger(this, this.currentHandlerInfos, false, args); + }, -function makeSettledResult(state, position, value) { - if (state === FULFILLED) { - return { - state: 'fulfilled', - value: value - }; - } else { - return { - state: 'rejected', - reason: value - }; - } -} + /** + Hook point for logging transition status updates. -function Enumerator(Constructor, input, abortOnReject, label) { - this._instanceConstructor = Constructor; - this.promise = new Constructor(noop, label); - this._abortOnReject = abortOnReject; + @param {String} message The message to log. + */ + log: null +}; - if (this._validateInput(input)) { - this._input = input; - this.length = input.length; - this._remaining = input.length; +/** + @private - this._init(); + Fires queryParamsDidChange event +*/ +function fireQueryParamDidChange(router, newState, queryParamChangelist) { + // If queryParams changed trigger event + if (queryParamChangelist) { - if (this.length === 0) { - fulfill(this.promise, this._result); - } else { - this.length = this.length || 0; - this._enumerate(); - if (this._remaining === 0) { - fulfill(this.promise, this._result); - } - } - } else { - reject(this.promise, this._validationError()); + // This is a little hacky but we need some way of storing + // changed query params given that no activeTransition + // is guaranteed to have occurred. + router._changedQueryParams = queryParamChangelist.all; + trigger(router, newState.handlerInfos, true, ['queryParamsDidChange', queryParamChangelist.changed, queryParamChangelist.all, queryParamChangelist.removed]); + router._changedQueryParams = null; } } -Enumerator.prototype._validateInput = function(input) { - return isArray(input); -}; +/** + @private -Enumerator.prototype._validationError = function() { - return new Error('Array Methods must be provided an Array'); -}; + Takes an Array of `HandlerInfo`s, figures out which ones are + exiting, entering, or changing contexts, and calls the + proper handler hooks. -Enumerator.prototype._init = function() { - this._result = new Array(this.length); -}; + For example, consider the following tree of handlers. Each handler is + followed by the URL segment it handles. -Enumerator.prototype._enumerate = function() { - var length = this.length; - var promise = this.promise; - var input = this._input; + ``` + |~index ("/") + | |~posts ("/posts") + | | |-showPost ("/:id") + | | |-newPost ("/new") + | | |-editPost ("/edit") + | |~about ("/about/:id") + ``` - for (var i = 0; promise._state === PENDING && i < length; i++) { - this._eachEntry(input[i], i); - } -}; + Consider the following transitions: -Enumerator.prototype._settleMaybeThenable = function(entry, i) { - var c = this._instanceConstructor; - var resolve = c.resolve; + 1. A URL transition to `/posts/1`. + 1. Triggers the `*model` callbacks on the + `index`, `posts`, and `showPost` handlers + 2. Triggers the `enter` callback on the same + 3. Triggers the `setup` callback on the same + 2. A direct transition to `newPost` + 1. Triggers the `exit` callback on `showPost` + 2. Triggers the `enter` callback on `newPost` + 3. Triggers the `setup` callback on `newPost` + 3. A direct transition to `about` with a specified + context object + 1. Triggers the `exit` callback on `newPost` + and `posts` + 2. Triggers the `serialize` callback on `about` + 3. Triggers the `enter` callback on `about` + 4. Triggers the `setup` callback on `about` - if (resolve === resolve$1) { - var then$$ = getThen(entry); + @param {Router} transition + @param {TransitionState} newState +*/ +function setupContexts(router, newState, transition) { + var partition = partitionHandlers(router.state, newState); + var i, l, handler; - if (then$$ === then && - entry._state !== PENDING) { - entry._onError = null; - this._settledAt(entry._state, i, entry._result); - } else if (typeof then$$ !== 'function') { - this._remaining--; - this._result[i] = this._makeResult(FULFILLED, i, entry); - } else if (c === Promise) { - var promise = new c(noop); - handleMaybeThenable(promise, entry, then$$); - this._willSettleAt(promise, i); - } else { - this._willSettleAt(new c(function(resolve) { resolve(entry); }), i); - } - } else { - this._willSettleAt(resolve(entry), i); - } -}; + for (i=0, l=partition.exited.length; i= 0; --i) { + var handlerInfo = handlerInfos[i]; + merge(params, handlerInfo.params); + if (handlerInfo.handler.inaccessibleByURL) { + urlMethod = null; + } + } - @method reject - @static - @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$1(reason, label) { - /*jshint validthis:true */ - var Constructor = this; - var promise = new Constructor(noop, label); - reject(promise, reason); - return promise; -} + if (urlMethod) { + params.queryParams = transition._visibleQueryParams || state.queryParams; + var url = router.recognizer.generate(handlerName, params); -var guidKey = 'rsvp_' + now() + '-'; -var counter = 0; + // transitions during the initial transition must always use replaceURL. + // When the app boots, you are at a url, e.g. /foo. If some handler + // redirects to bar as part of the initial transition, you don't want to + // add a history entry for /foo. If you do, pressing back will immediately + // hit the redirect again and take you back to /bar, thus killing the back + // button + var initial = transition.isCausedByInitialTransition; -function needsResolver() { - throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); -} + // say you are at / and you click a link to route /foo. In /foo's + // handler, the transition is aborted using replacewith('/bar'). + // Because the current url is still /, the history entry for / is + // removed from the history. Clicking back will take you to the page + // you were on before /, which is often not even the app, thus killing + // the back button. That's why updateURL is always correct for an + // aborting transition that's not the initial transition + var replaceAndNotAborting = ( + urlMethod === 'replace' && + !transition.isCausedByAbortingTransition + ); -function needsNew() { - throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); + if (initial || replaceAndNotAborting) { + router.replaceURL(url); + } else { + router.updateURL(url); + } + } } /** - 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 - why the promise cannot be fulfilled. - - Terminology - ----------- - - - `promise` is an object or function with a `then` method whose behavior conforms to this specification. - - `thenable` is an object or function that defines a `then` method. - - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). - - `exception` is a value that is thrown using the throw statement. - - `reason` is a value that indicates why a promise was rejected. - - `settled` the final resting state of a promise, fulfilled or rejected. - - A promise can be in one of three states: pending, fulfilled, or rejected. + @private - Promises that are fulfilled have a fulfillment value and are in the fulfilled - state. Promises that are rejected have a rejection reason and are in the - rejected state. A fulfillment value is never a thenable. + Updates the URL (if necessary) and calls `setupContexts` + to update the router's array of `currentHandlerInfos`. + */ +function finalizeTransition(transition, newState) { - Promises can also be said to *resolve* a value. If this value is also a - promise, then the original promise's settled state will match the value's - settled state. So a promise that *resolves* a promise that rejects will - itself reject, and a promise that *resolves* a promise that fulfills will - itself fulfill. + try { + log(transition.router, transition.sequence, "Resolved all models on destination route; finalizing transition."); + var router = transition.router, + handlerInfos = newState.handlerInfos; - Basic Usage: - ------------ + // Run all the necessary enter/setup/exit hooks + setupContexts(router, newState, transition); - ```js - var promise = new Promise(function(resolve, reject) { - // on success - resolve(value); + // Check if a redirect occurred in enter/setup + if (transition.isAborted) { + // TODO: cleaner way? distinguish b/w targetHandlerInfos? + router.state.handlerInfos = router.currentHandlerInfos; + return rsvp.Promise.reject(logAbort(transition)); + } - // on failure - reject(reason); - }); + updateURL(transition, newState, transition.intent.url); - promise.then(function(value) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` + transition.isActive = false; + router.activeTransition = null; - Advanced Usage: - --------------- + trigger(router, router.currentHandlerInfos, true, ['didTransition']); - Promises shine when abstracting away asynchronous interactions such as - `XMLHttpRequest`s. + if (router.didTransition) { + router.didTransition(router.currentHandlerInfos); + } - ```js - function getJSON(url) { - return new Promise(function(resolve, reject){ - var xhr = new XMLHttpRequest(); + log(router, transition.sequence, "TRANSITION COMPLETE."); - xhr.open('GET', url); - xhr.onreadystatechange = handler; - xhr.responseType = 'json'; - xhr.setRequestHeader('Accept', 'application/json'); - xhr.send(); + // Resolve with the final handler. + return handlerInfos[handlerInfos.length - 1].handler; + } catch(e) { + if (!(e instanceof TransitionAbortedError)) { + //var erroneousHandler = handlerInfos.pop(); + var infos = transition.state.handlerInfos; + transition.trigger(true, 'error', e, transition, infos[infos.length-1].handler); + transition.abort(); + } - function handler() { - if (this.readyState === this.DONE) { - if (this.status === 200) { - resolve(this.response); - } else { - reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); - } - } - }; - }); + throw e; } +} - getJSON('/posts.json').then(function(json) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` - - Unlike callbacks, promises are great composable primitives. - - ```js - Promise.all([ - getJSON('/posts'), - getJSON('/comments') - ]).then(function(values){ - values[0] // => postsJSON - values[1] // => commentsJSON +/** + @private - return values; - }); - ``` + Begins and returns a Transition based on the provided + arguments. Accepts arguments in the form of both URL + transitions and named transitions. - @class RSVP.Promise - @param {function} resolver - @param {String} label optional string for labeling the promise. - Useful for tooling. - @constructor + @param {Router} router + @param {Array[Object]} args arguments passed to transitionTo, + replaceWith, or handleURL */ -function Promise(resolver, label) { - this._id = counter++; - this._label = label; - this._state = undefined; - this._result = undefined; - this._subscribers = []; - - config.instrument && instrument('created', this); +function doTransition(router, args, isIntermediate) { + // Normalize blank transitions to root URL transitions. + var name = args[0] || '/'; - if (noop !== resolver) { - typeof resolver !== 'function' && needsResolver(); - this instanceof Promise ? initializePromise(this, resolver) : needsNew(); + var lastArg = args[args.length-1]; + var queryParams = {}; + if (lastArg && lastArg.hasOwnProperty('queryParams')) { + queryParams = pop.call(args).queryParams; } -} - -Promise.cast = resolve$1; // deprecated -Promise.all = all; -Promise.race = race; -Promise.resolve = resolve$1; -Promise.reject = reject$1; -Promise.prototype = { - constructor: Promise, + var intent; + if (args.length === 0) { - _guidKey: guidKey, + log(router, "Updating query params"); - _onError: function (reason) { - var promise = this; - config.after(function() { - if (promise._onError) { - config['trigger']('error', reason, promise._label); - } + // A query param update is really just a transition + // into the route you're already on. + var handlerInfos = router.state.handlerInfos; + intent = new NamedTransitionIntent({ + name: handlerInfos[handlerInfos.length - 1].name, + contexts: [], + queryParams: queryParams }); - }, - -/** - 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 why the promise cannot be fulfilled. - - ```js - findUser().then(function(user){ - // user is available - }, function(reason){ - // user is unavailable, and you are given the reason why - }); - ``` - Chaining - -------- - - The return value of `then` is itself a promise. This second, 'downstream' - promise is resolved with the return value of the first promise's fulfillment - or rejection handler, or rejected if the handler throws an exception. - - ```js - findUser().then(function (user) { - return user.name; - }, function (reason) { - return 'default name'; - }).then(function (userName) { - // If `findUser` fulfilled, `userName` will be the user's name, otherwise it - // will be `'default name'` - }); + } else if (name.charAt(0) === '/') { - findUser().then(function (user) { - throw new Error('Found user, but still unhappy'); - }, function (reason) { - throw new Error('`findUser` rejected and we're unhappy'); - }).then(function (value) { - // never reached - }, function (reason) { - // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. - // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. - }); - ``` - If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. - - ```js - findUser().then(function (user) { - throw new PedagogicalException('Upstream error'); - }).then(function (value) { - // never reached - }).then(function (value) { - // never reached - }, function (reason) { - // The `PedgagocialException` is propagated all the way down to here - }); - ``` + log(router, "Attempting URL transition to " + name); + intent = new URLTransitionIntent({ url: name }); - Assimilation - ------------ + } else { - Sometimes the value you want to propagate to a downstream promise can only be - retrieved asynchronously. This can be achieved by returning a promise in the - fulfillment or rejection handler. The downstream promise will then be pending - until the returned promise is settled. This is called *assimilation*. + log(router, "Attempting transition to " + name); + intent = new NamedTransitionIntent({ + name: args[0], + contexts: slice.call(args, 1), + queryParams: queryParams + }); + } - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // The user's comments are now available - }); - ``` + return router.transitionByIntent(intent, isIntermediate); +} - If the assimliated promise rejects, then the downstream promise will also reject. +function handlerInfosEqual(handlerInfos, otherHandlerInfos) { + if (handlerInfos.length !== otherHandlerInfos.length) { + return false; + } - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // If `findCommentsByAuthor` fulfills, we'll have the value here - }, function (reason) { - // If `findCommentsByAuthor` rejects, we'll have the reason here - }); - ``` + for (var i = 0, len = handlerInfos.length; i < len; ++i) { + if (handlerInfos[i] !== otherHandlerInfos[i]) { + return false; + } + } + return true; +} - Simple Example - -------------- +function finalizeQueryParamChange(router, resolvedHandlers, newQueryParams, transition) { + // We fire a finalizeQueryParamChange event which + // gives the new route hierarchy a chance to tell + // us which query params it's consuming and what + // their final values are. If a query param is + // no longer consumed in the final route hierarchy, + // its serialized segment will be removed + // from the URL. - Synchronous Example + for (var k in newQueryParams) { + if (newQueryParams.hasOwnProperty(k) && + newQueryParams[k] === null) { + delete newQueryParams[k]; + } + } - ```javascript - var result; + var finalQueryParamsArray = []; + trigger(router, resolvedHandlers, true, ['finalizeQueryParamChange', newQueryParams, finalQueryParamsArray, transition]); - try { - result = findResult(); - // success - } catch(reason) { - // failure + if (transition) { + transition._visibleQueryParams = {}; } - ``` - Errback Example - - ```js - findResult(function(result, err){ - if (err) { - // failure - } else { - // success + var finalQueryParams = {}; + for (var i = 0, len = finalQueryParamsArray.length; i < len; ++i) { + var qp = finalQueryParamsArray[i]; + finalQueryParams[qp.key] = qp.value; + if (transition && qp.visible !== false) { + transition._visibleQueryParams[qp.key] = qp.value; } - }); - ``` - - Promise Example; + } + return finalQueryParams; +} - ```javascript - findResult().then(function(result){ - // success - }, function(reason){ - // failure - }); - ``` +function notifyExistingHandlers(router, newState, newTransition) { + var oldHandlers = router.state.handlerInfos, + changing = [], + leavingIndex = null, + leaving, leavingChecker, i, oldHandlerLen, oldHandler, newHandler; - Advanced Example - -------------- + oldHandlerLen = oldHandlers.length; + for (i = 0; i < oldHandlerLen; i++) { + oldHandler = oldHandlers[i]; + newHandler = newState.handlerInfos[i]; - Synchronous Example + if (!newHandler || oldHandler.name !== newHandler.name) { + leavingIndex = i; + break; + } - ```javascript - var author, books; + if (!newHandler.isResolved) { + changing.push(oldHandler); + } + } - try { - author = findAuthor(); - books = findBooksByAuthor(author); - // success - } catch(reason) { - // failure + if (leavingIndex !== null) { + leaving = oldHandlers.slice(leavingIndex, oldHandlerLen); + leavingChecker = function(name) { + for (var h = 0, len = leaving.length; h < len; h++) { + if (leaving[h].name === name) { + return true; + } + } + return false; + }; } - ``` - Errback Example + trigger(router, oldHandlers, true, ['willTransition', newTransition]); - ```js + if (router.willTransition) { + router.willTransition(oldHandlers, newState.handlerInfos, newTransition); + } +} - function foundBooks(books) { +exports['default'] = Router; +exports.Transition = Transition; - } +Object.defineProperty(exports, '__esModule', { value: true }); - function failure(reason) { +}); +enifed('rsvp', ['exports'], function (exports) { + 'use strict'; - } + var _rsvp; - findAuthor(function(author, err){ - if (err) { - failure(err); - // failure - } else { - try { - findBoooksByAuthor(author, function(books, err) { - if (err) { - failure(err); - } else { - try { - foundBooks(books); - } catch(reason) { - failure(reason); - } - } - }); - } catch(error) { - failure(err); + function indexOf(callbacks, callback) { + for (var i = 0, l = callbacks.length; i < l; i++) { + if (callbacks[i] === callback) { + return i; } - // success } - }); - ``` - Promise Example; - - ```javascript - findAuthor(). - then(findBooksByAuthor). - then(function(books){ - // found books - }).catch(function(reason){ - // something went wrong - }); - ``` + return -1; + } - @method then - @param {Function} onFulfillment - @param {Function} onRejection - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} -*/ - then: then, + function callbacksFor(object) { + var callbacks = object._promiseCallbacks; -/** - `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same - as the catch block of a try/catch statement. + if (!callbacks) { + callbacks = object._promiseCallbacks = {}; + } - ```js - function findAuthor(){ - throw new Error('couldn't find that author'); + return callbacks; } - // synchronous - try { - findAuthor(); - } catch(reason) { - // something went wrong - } + /** + @class RSVP.EventTarget + */ + var EventTarget = { - // async with promises - findAuthor().catch(function(reason){ - // something went wrong - }); - ``` + /** + `RSVP.EventTarget.mixin` extends an object with EventTarget methods. For + Example: + ```javascript + let object = {}; + RSVP.EventTarget.mixin(object); + object.on('finished', function(event) { + // handle event + }); + object.trigger('finished', { detail: value }); + ``` + `EventTarget.mixin` also works with prototypes: + ```javascript + let Person = function() {}; + RSVP.EventTarget.mixin(Person.prototype); + let yehuda = new Person(); + let tom = new Person(); + yehuda.on('poke', function(event) { + console.log('Yehuda says OW'); + }); + tom.on('poke', function(event) { + console.log('Tom says OW'); + }); + yehuda.trigger('poke'); + tom.trigger('poke'); + ``` + @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']; + object._promiseCallbacks = undefined; + return object; + }, - @method catch - @param {Function} onRejection - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} -*/ - 'catch': function(onRejection, label) { - return this.then(undefined, onRejection, label); - }, + /** + Registers a callback to be executed when `eventName` is triggered + ```javascript + object.on('event', function(eventInfo){ + // handle the event + }); + object.trigger('event'); + ``` + @method on + @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) { + if (typeof callback !== 'function') { + throw new TypeError('Callback must be a function'); + } -/** - `finally` will be invoked regardless of the promise's fate just as native - try/catch/finally behaves + var allCallbacks = callbacksFor(this), + callbacks = undefined; - Synchronous example: + callbacks = allCallbacks[eventName]; - ```js - findAuthor() { - if (Math.random() > 0.5) { - throw new Error(); - } - return new Author(); - } + if (!callbacks) { + callbacks = allCallbacks[eventName] = []; + } - try { - return findAuthor(); // succeed or fail - } catch(error) { - return findOtherAuther(); - } finally { - // always runs - // doesn't affect the return value - } - ``` + if (indexOf(callbacks, callback) === -1) { + callbacks.push(callback); + } + }, - Asynchronous example: + /** + You can use `off` to stop firing a particular callback for an event: + ```javascript + function doStuff() { // do stuff! } + object.on('stuff', doStuff); + object.trigger('stuff'); // doStuff will be called + // Unregister ONLY the doStuff callback + object.off('stuff', doStuff); + object.trigger('stuff'); // doStuff will NOT be called + ``` + If you don't pass a `callback` argument to `off`, ALL callbacks for the + event will not be executed when the event fires. For example: + ```javascript + let callback1 = function(){}; + let callback2 = function(){}; + object.on('stuff', callback1); + object.on('stuff', callback2); + object.trigger('stuff'); // callback1 and callback2 will be executed. + object.off('stuff'); + object.trigger('stuff'); // callback1 and callback2 will not be executed! + ``` + @method off + @for RSVP.EventTarget + @private + @param {String} eventName event to stop listening to + @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) { + var allCallbacks = callbacksFor(this), + callbacks = undefined, + index = undefined; - ```js - findAuthor().catch(function(reason){ - return findOtherAuther(); - }).finally(function(){ - // author was either found, or not - }); - ``` + if (!callback) { + allCallbacks[eventName] = []; + return; + } - @method finally - @param {Function} callback - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} -*/ - 'finally': function(callback, label) { - var promise = this; - var constructor = promise.constructor; + callbacks = allCallbacks[eventName]; - return promise.then(function(value) { - return constructor.resolve(callback()).then(function() { - return value; + index = indexOf(callbacks, callback); + + if (index !== -1) { + callbacks.splice(index, 1); + } + }, + + /** + Use `trigger` to fire custom events. For example: + ```javascript + object.on('foo', function(){ + console.log('foo event happened!'); }); - }, function(reason) { - return constructor.resolve(callback()).then(function() { - return constructor.reject(reason); + object.trigger('foo'); + // 'foo event happened!' logged to the console + ``` + You can also pass a value as a second argument to `trigger` that will be + passed as an argument to all event listeners for the event: + ```javascript + object.on('foo', function(value){ + console.log(value.name); }); - }, label); - } -}; + object.trigger('foo', { name: 'bar' }); + // 'bar' logged to the console + ``` + @method trigger + @for RSVP.EventTarget + @private + @param {String} eventName name of the event to be triggered + @param {*} options optional value to be passed to any event handlers for + the given `eventName` + */ + trigger: function (eventName, options, label) { + var allCallbacks = callbacksFor(this), + callbacks = undefined, + callback = undefined; -function Result() { - this.value = undefined; -} + if (callbacks = allCallbacks[eventName]) { + // Don't cache the callbacks.length since it may grow + for (var i = 0; i < callbacks.length; i++) { + callback = callbacks[i]; -var ERROR = new Result(); -var GET_THEN_ERROR$1 = new Result(); + callback(options, label); + } + } + } + }; -function getThen$1(obj) { - try { - return obj.then; - } catch(error) { - ERROR.value= error; - return ERROR; - } -} + var config = { + instrument: false + }; + EventTarget['mixin'](config); -function tryApply(f, s, a) { - try { - f.apply(s, a); - } catch(error) { - ERROR.value = error; - return ERROR; + 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); + return; + } + + if (arguments.length === 2) { + config[name] = value; + } else { + return config[name]; + } } -} -function makeObject(_, argumentNames) { - var obj = {}; - var name; - var i; - var length = _.length; - var args = new Array(length); + function objectOrFunction(x) { + return typeof x === 'function' || typeof x === 'object' && x !== null; + } - for (var x = 0; x < length; x++) { - args[x] = _[x]; + function isFunction(x) { + return typeof x === 'function'; } - for (i = 0; i < argumentNames.length; i++) { - name = argumentNames[i]; - obj[name] = args[i + 1]; + function isMaybeThenable(x) { + return typeof x === 'object' && x !== null; } - return obj; -} + var _isArray = undefined; + if (!Array.isArray) { + _isArray = function (x) { + return Object.prototype.toString.call(x) === '[object Array]'; + }; + } else { + _isArray = Array.isArray; + } -function arrayResult(_) { - var length = _.length; - var args = new Array(length - 1); + var isArray = _isArray; - for (var i = 1; i < length; i++) { - args[i - 1] = _[i]; - } + // Date.now is not available in browsers < IE9 + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now#Compatibility + var now = Date.now || function () { + return new Date().getTime(); + }; - return args; -} + function F() {} -function wrapThenable(then, promise) { - return { - then: function(onFulFillment, onRejection) { - return then.call(promise, onFulFillment, onRejection); + var o_create = Object.create || function (o) { + if (arguments.length > 1) { + throw new Error('Second argument not supported'); + } + if (typeof o !== 'object') { + throw new TypeError('Argument must be an object'); } + F.prototype = o; + return new F(); }; -} -/** - `RSVP.denodeify` takes a 'node-style' function and returns a function that - will return an `RSVP.Promise`. You can use `denodeify` in Node.js or the - browser when you'd prefer to use promises over using callbacks. For example, - `denodeify` transforms the following: + var queue = []; - ```javascript - var fs = require('fs'); + function scheduleFlush() { + setTimeout(function () { + for (var i = 0; i < queue.length; i++) { + var entry = queue[i]; - fs.readFile('myfile.txt', function(err, data){ - if (err) return handleError(err); - handleData(data); - }); - ``` + var payload = entry.payload; - into: + payload.guid = payload.key + payload.id; + payload.childGuid = payload.key + payload.childId; + if (payload.error) { + payload.stack = payload.error.stack; + } - ```javascript - var fs = require('fs'); - var readFile = RSVP.denodeify(fs.readFile); + config['trigger'](entry.name, entry.payload); + } + queue.length = 0; + }, 50); + } - readFile('myfile.txt').then(handleData, handleError); - ``` + function instrument(eventName, promise, child) { + if (1 === queue.push({ + name: eventName, + payload: { + key: promise._guidKey, + id: promise._id, + eventName: eventName, + detail: promise._result, + childId: child && child._id, + label: promise._label, + timeStamp: now(), + error: config["instrument-with-stack"] ? new Error(promise._label) : null + } })) { + scheduleFlush(); + } + } - If the node function has multiple success parameters, then `denodeify` - just returns the first one: + /** + `RSVP.Promise.resolve` returns a promise that will become resolved with the + passed `value`. It is shorthand for the following: + + ```javascript + let promise = new RSVP.Promise(function(resolve, reject){ + resolve(1); + }); + + promise.then(function(value){ + // value === 1 + }); + ``` + + Instead of writing the above, your code now simply becomes the following: + + ```javascript + let promise = RSVP.Promise.resolve(1); + + promise.then(function(value){ + // value === 1 + }); + ``` + + @method resolve + @static + @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` + */ + function resolve$1(object, label) { + /*jshint validthis:true */ + var Constructor = this; - ```javascript - var request = RSVP.denodeify(require('request')); + if (object && typeof object === 'object' && object.constructor === Constructor) { + return object; + } - request('http://example.com').then(function(res) { - // ... - }); - ``` + var promise = new Constructor(noop, label); + resolve(promise, object); + return promise; + } - However, if you need all success parameters, setting `denodeify`'s - second parameter to `true` causes it to return all success parameters - as an array: + function withOwnPromise() { + return new TypeError('A promises callback cannot return that same promise.'); + } - ```javascript - var request = RSVP.denodeify(require('request'), true); + function noop() {} - request('http://example.com').then(function(result) { - // result[0] -> res - // result[1] -> body - }); - ``` + var PENDING = void 0; + var FULFILLED = 1; + var REJECTED = 2; - Or if you pass it an array with names it returns the parameters as a hash: + var GET_THEN_ERROR = new ErrorObject(); - ```javascript - var request = RSVP.denodeify(require('request'), ['res', 'body']); + function getThen(promise) { + try { + return promise.then; + } catch (error) { + GET_THEN_ERROR.error = error; + return GET_THEN_ERROR; + } + } - request('http://example.com').then(function(result) { - // result.res - // result.body - }); - ``` + function tryThen(then, value, fulfillmentHandler, rejectionHandler) { + try { + then.call(value, fulfillmentHandler, rejectionHandler); + } catch (e) { + return e; + } + } - Sometimes you need to retain the `this`: + function handleForeignThenable(promise, thenable, then) { + config.async(function (promise) { + var sealed = false; + var error = tryThen(then, thenable, function (value) { + if (sealed) { + return; + } + sealed = true; + if (thenable !== value) { + resolve(promise, value, undefined); + } else { + fulfill(promise, value); + } + }, function (reason) { + if (sealed) { + return; + } + sealed = true; - ```javascript - var app = require('express')(); - var render = RSVP.denodeify(app.render.bind(app)); - ``` + reject(promise, reason); + }, 'Settle: ' + (promise._label || ' unknown promise')); - The denodified function inherits from the original function. It works in all - environments, except IE 10 and below. Consequently all properties of the original - function are available to you. However, any properties you change on the - denodeified function won't be changed on the original function. Example: + if (!sealed && error) { + sealed = true; + reject(promise, error); + } + }, promise); + } - ```javascript - var request = RSVP.denodeify(require('request')), - cookieJar = request.jar(); // <- Inheritance is used here + function handleOwnThenable(promise, thenable) { + if (thenable._state === FULFILLED) { + fulfill(promise, thenable._result); + } else if (thenable._state === REJECTED) { + thenable._onError = null; + reject(promise, thenable._result); + } else { + subscribe(thenable, undefined, function (value) { + if (thenable !== value) { + resolve(promise, value, undefined); + } else { + fulfill(promise, value); + } + }, function (reason) { + return reject(promise, reason); + }); + } + } - request('http://example.com', {jar: cookieJar}).then(function(res) { - // cookieJar.cookies holds now the cookies returned by example.com - }); - ``` + function handleMaybeThenable(promise, maybeThenable, then$$) { + if (maybeThenable.constructor === promise.constructor && then$$ === then && promise.constructor.resolve === resolve$1) { + handleOwnThenable(promise, maybeThenable); + } else { + if (then$$ === GET_THEN_ERROR) { + reject(promise, GET_THEN_ERROR.error); + } else if (then$$ === undefined) { + fulfill(promise, maybeThenable); + } else if (isFunction(then$$)) { + handleForeignThenable(promise, maybeThenable, then$$); + } else { + fulfill(promise, maybeThenable); + } + } + } - Using `denodeify` makes it easier to compose asynchronous operations instead - of using callbacks. For example, instead of: + function resolve(promise, value) { + if (promise === value) { + fulfill(promise, value); + } else if (objectOrFunction(value)) { + handleMaybeThenable(promise, value, getThen(value)); + } else { + fulfill(promise, value); + } + } - ```javascript - var fs = require('fs'); + function publishRejection(promise) { + if (promise._onError) { + promise._onError(promise._result); + } - fs.readFile('myfile.txt', function(err, data){ - if (err) { ... } // Handle error - fs.writeFile('myfile2.txt', data, function(err){ - if (err) { ... } // Handle error - console.log('done') - }); - }); - ``` + publish(promise); + } - you can chain the operations together using `then` from the returned promise: + function fulfill(promise, value) { + if (promise._state !== PENDING) { + return; + } - ```javascript - var fs = require('fs'); - var readFile = RSVP.denodeify(fs.readFile); - var writeFile = RSVP.denodeify(fs.writeFile); - - readFile('myfile.txt').then(function(data){ - return writeFile('myfile2.txt', data); - }).then(function(){ - console.log('done') - }).catch(function(error){ - // Handle error - }); - ``` + promise._result = value; + promise._state = FULFILLED; - @method denodeify - @static - @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} [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. - @return {Function} a function that wraps `nodeFunc` to return an - `RSVP.Promise` - @static -*/ -function denodeify(nodeFunc, options) { - var fn = function() { - var self = this; - var l = arguments.length; - var args = new Array(l + 1); - var arg; - var promiseInput = false; + if (promise._subscribers.length === 0) { + if (config.instrument) { + instrument('fulfilled', promise); + } + } else { + config.async(publish, promise); + } + } - for (var i = 0; i < l; ++i) { - arg = arguments[i]; + function reject(promise, reason) { + if (promise._state !== PENDING) { + return; + } + promise._state = REJECTED; + promise._result = reason; + config.async(publishRejection, promise); + } - if (!promiseInput) { - // TODO: clean this up - promiseInput = needsPromiseInput(arg); - if (promiseInput === GET_THEN_ERROR$1) { - var p = new Promise(noop); - reject(p, GET_THEN_ERROR$1.value); - return p; - } else if (promiseInput && promiseInput !== true) { - arg = wrapThenable(promiseInput, arg); - } - } - args[i] = arg; + function subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers; + var length = subscribers.length; + + parent._onError = null; + + subscribers[length] = child; + subscribers[length + FULFILLED] = onFulfillment; + subscribers[length + REJECTED] = onRejection; + + if (length === 0 && parent._state) { + config.async(publish, parent); } + } - var promise = new Promise(noop); + function publish(promise) { + var subscribers = promise._subscribers; + var settled = promise._state; - args[l] = function(err, val) { - if (err) - reject(promise, err); - else if (options === undefined) - resolve(promise, val); - else if (options === true) - resolve(promise, arrayResult(arguments)); - else if (isArray(options)) - resolve(promise, makeObject(arguments, options)); - else - resolve(promise, val); - }; + if (config.instrument) { + instrument(settled === FULFILLED ? 'fulfilled' : 'rejected', promise); + } - if (promiseInput) { - return handlePromiseInput(promise, args, nodeFunc, self); - } else { - return handleValueInput(promise, args, nodeFunc, self); + if (subscribers.length === 0) { + return; } - }; - fn.__proto__ = nodeFunc; + var child = undefined, + callback = undefined, + detail = promise._result; - return fn; -} + for (var i = 0; i < subscribers.length; i += 3) { + child = subscribers[i]; + callback = subscribers[i + settled]; + + if (child) { + invokeCallback(settled, child, callback, detail); + } else { + callback(detail); + } + } -function handleValueInput(promise, args, nodeFunc, self) { - var result = tryApply(nodeFunc, self, args); - if (result === ERROR) { - reject(promise, result.value); + promise._subscribers.length = 0; } - return promise; -} -function handlePromiseInput(promise, args, nodeFunc, self){ - return Promise.all(args).then(function(args){ - var result = tryApply(nodeFunc, self, args); - if (result === ERROR) { - reject(promise, result.value); - } - return promise; - }); -} + function ErrorObject() { + this.error = null; + } -function needsPromiseInput(arg) { - if (arg && typeof arg === 'object') { - if (arg.constructor === Promise) { - return true; - } else { - return getThen$1(arg); + var TRY_CATCH_ERROR = new ErrorObject(); + + function tryCatch(callback, detail) { + try { + return callback(detail); + } catch (e) { + TRY_CATCH_ERROR.error = e; + return TRY_CATCH_ERROR; } - } else { - return false; } -} - -/** - This is a convenient alias for `RSVP.Promise.all`. - @method all - @static - @for RSVP - @param {Array} array Array of promises. - @param {String} label An optional label. This is useful - for tooling. -*/ -function all$1(array, label) { - return Promise.all(array, label); -} + function invokeCallback(settled, promise, callback, detail) { + var hasCallback = isFunction(callback), + value = undefined, + error = undefined, + succeeded = undefined, + failed = undefined; -function AllSettled(Constructor, entries, label) { - this._superConstructor(Constructor, entries, false /* don't abort on reject */, label); -} + if (hasCallback) { + value = tryCatch(callback, detail); -AllSettled.prototype = o_create(Enumerator.prototype); -AllSettled.prototype._superConstructor = Enumerator; -AllSettled.prototype._makeResult = makeSettledResult; -AllSettled.prototype._validationError = function() { - return new Error('allSettled must be called with an array'); -}; + if (value === TRY_CATCH_ERROR) { + failed = true; + error = value.error; + value = null; + } else { + succeeded = true; + } -/** - `RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing - a fail-fast method, it waits until all the promises have returned and - shows you all the results. This is useful if you want to handle multiple - promises' failure states together as a set. + if (promise === value) { + reject(promise, withOwnPromise()); + return; + } + } else { + value = detail; + succeeded = true; + } - Returns a promise that is fulfilled when all the given promises have been - settled. The return promise is fulfilled with an array of the states of - the promises passed into the `promises` array argument. + 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); + } + } - Each state object will either indicate fulfillment or rejection, and - provide the corresponding value or reason. The states will take one of - the following formats: + function initializePromise(promise, resolver) { + var resolved = false; + try { + resolver(function (value) { + if (resolved) { + return; + } + resolved = true; + resolve(promise, value); + }, function (reason) { + if (resolved) { + return; + } + resolved = true; + reject(promise, reason); + }); + } catch (e) { + reject(promise, e); + } + } - ```javascript - { state: 'fulfilled', value: value } - or - { state: 'rejected', reason: reason } - ``` + function then(onFulfillment, onRejection, label) { + var _arguments = arguments; - Example: + var parent = this; + var state = parent._state; - ```javascript - var promise1 = RSVP.Promise.resolve(1); - var promise2 = RSVP.Promise.reject(new Error('2')); - var promise3 = RSVP.Promise.reject(new Error('3')); - var promises = [ promise1, promise2, promise3 ]; - - RSVP.allSettled(promises).then(function(array){ - // array == [ - // { state: 'fulfilled', value: 1 }, - // { state: 'rejected', reason: Error }, - // { state: 'rejected', reason: Error } - // ] - // Note that for the second item, reason.message will be '2', and for the - // third item, reason.message will be '3'. - }, function(error) { - // Not run. (This block would only be called if allSettled had failed, - // for instance if passed an incorrect argument type.) - }); - ``` + if (state === FULFILLED && !onFulfillment || state === REJECTED && !onRejection) { + config.instrument && instrument('chained', parent, parent); + return parent; + } - @method allSettled - @static - @for RSVP - @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. -*/ + parent._onError = null; -function allSettled(entries, label) { - return new AllSettled(Promise, entries, label).promise; -} + var child = new parent.constructor(noop, label); + var result = parent._result; -/** - This is a convenient alias for `RSVP.Promise.race`. + config.instrument && instrument('chained', parent, child); - @method race - @static - @for RSVP - @param {Array} array Array of promises. - @param {String} label An optional label. This is useful - for tooling. - */ -function race$1(array, label) { - return Promise.race(array, label); -} + if (state) { + (function () { + var callback = _arguments[state - 1]; + config.async(function () { + return invokeCallback(state, child, callback, result); + }); + })(); + } else { + subscribe(parent, child, onFulfillment, onRejection); + } -function PromiseHash(Constructor, object, label) { - this._superConstructor(Constructor, object, true, label); -} + return child; + } -PromiseHash.prototype = o_create(Enumerator.prototype); -PromiseHash.prototype._superConstructor = Enumerator; -PromiseHash.prototype._init = function() { - this._result = {}; -}; + function makeSettledResult(state, position, value) { + if (state === FULFILLED) { + return { + state: 'fulfilled', + value: value + }; + } else { + return { + state: 'rejected', + reason: value + }; + } + } -PromiseHash.prototype._validateInput = function(input) { - return input && typeof input === 'object'; -}; + function Enumerator(Constructor, input, abortOnReject, label) { + this._instanceConstructor = Constructor; + this.promise = new Constructor(noop, label); + this._abortOnReject = abortOnReject; -PromiseHash.prototype._validationError = function() { - return new Error('Promise.hash must be called with an object'); -}; + if (this._validateInput(input)) { + this._input = input; + this.length = input.length; + this._remaining = input.length; -PromiseHash.prototype._enumerate = function() { - var enumerator = this; - var promise = enumerator.promise; - var input = enumerator._input; - var results = []; + this._init(); - for (var key in input) { - if (promise._state === PENDING && Object.prototype.hasOwnProperty.call(input, key)) { - results.push({ - position: key, - entry: input[key] - }); + if (this.length === 0) { + fulfill(this.promise, this._result); + } else { + this.length = this.length || 0; + this._enumerate(); + if (this._remaining === 0) { + fulfill(this.promise, this._result); + } + } + } else { + reject(this.promise, this._validationError()); } } - var length = results.length; - enumerator._remaining = length; - var result; + Enumerator.prototype._validateInput = function (input) { + return isArray(input); + }; - for (var i = 0; promise._state === PENDING && i < length; i++) { - result = results[i]; - enumerator._eachEntry(result.entry, result.position); - } -}; + Enumerator.prototype._validationError = function () { + return new Error('Array Methods must be provided an Array'); + }; -/** - `RSVP.hash` is similar to `RSVP.all`, but takes an object instead of an array - for its `promises` argument. + Enumerator.prototype._init = function () { + this._result = new Array(this.length); + }; - Returns a promise that is fulfilled when all the given promises have been - fulfilled, or rejected if any of them become rejected. The returned promise - is fulfilled with a hash that has the same key names as the `promises` object - argument. If any of the values in the object are not promises, they will - simply be copied over to the fulfilled object. + Enumerator.prototype._enumerate = function () { + var length = this.length; + var promise = this.promise; + var input = this._input; - Example: + for (var i = 0; promise._state === PENDING && i < length; i++) { + this._eachEntry(input[i], i); + } + }; - ```javascript - var promises = { - myPromise: RSVP.resolve(1), - yourPromise: RSVP.resolve(2), - theirPromise: RSVP.resolve(3), - notAPromise: 4 + Enumerator.prototype._settleMaybeThenable = function (entry, i) { + var c = this._instanceConstructor; + var resolve = c.resolve; + + if (resolve === resolve$1) { + var then$$ = getThen(entry); + + if (then$$ === then && entry._state !== PENDING) { + entry._onError = null; + this._settledAt(entry._state, i, entry._result); + } else if (typeof then$$ !== 'function') { + this._remaining--; + this._result[i] = this._makeResult(FULFILLED, i, entry); + } else if (c === Promise) { + var promise = new c(noop); + handleMaybeThenable(promise, entry, then$$); + this._willSettleAt(promise, i); + } else { + this._willSettleAt(new c(function (resolve) { + return resolve(entry); + }), i); + } + } else { + this._willSettleAt(resolve(entry), i); + } }; - RSVP.hash(promises).then(function(hash){ - // hash here is an object that looks like: - // { - // myPromise: 1, - // yourPromise: 2, - // theirPromise: 3, - // notAPromise: 4 - // } - }); - ```` + Enumerator.prototype._eachEntry = function (entry, i) { + if (isMaybeThenable(entry)) { + this._settleMaybeThenable(entry, i); + } else { + this._remaining--; + this._result[i] = this._makeResult(FULFILLED, i, entry); + } + }; - If any of the `promises` given to `RSVP.hash` are rejected, the first promise - that is rejected will be given as the reason to the rejection handler. + Enumerator.prototype._settledAt = function (state, i, value) { + var promise = this.promise; - Example: + if (promise._state === PENDING) { + this._remaining--; - ```javascript - var promises = { - myPromise: RSVP.resolve(1), - rejectedPromise: RSVP.reject(new Error('rejectedPromise')), - anotherRejectedPromise: RSVP.reject(new Error('anotherRejectedPromise')), + if (this._abortOnReject && state === REJECTED) { + reject(promise, value); + } else { + this._result[i] = this._makeResult(state, i, value); + } + } + + if (this._remaining === 0) { + fulfill(promise, this._result); + } }; - RSVP.hash(promises).then(function(hash){ - // Code here never runs because there are rejected promises! - }, function(reason) { - // reason.message === 'rejectedPromise' - }); - ``` + Enumerator.prototype._makeResult = function (state, i, value) { + return value; + }; - An important note: `RSVP.hash` is intended for plain JavaScript objects that - are just a set of keys and values. `RSVP.hash` will NOT preserve prototype - chains. + Enumerator.prototype._willSettleAt = function (promise, i) { + var enumerator = this; - Example: + subscribe(promise, undefined, function (value) { + return enumerator._settledAt(FULFILLED, i, value); + }, function (reason) { + return enumerator._settledAt(REJECTED, i, reason); + }); + }; - ```javascript - function MyConstructor(){ - this.example = RSVP.resolve('Example'); + /** + `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 + rejected with the reason of the first passed promise to be rejected. It casts all + elements of the passed iterable to promises as it runs this algorithm. + + Example: + + ```javascript + let promise1 = RSVP.resolve(1); + let promise2 = RSVP.resolve(2); + let promise3 = RSVP.resolve(3); + let promises = [ promise1, promise2, promise3 ]; + + RSVP.Promise.all(promises).then(function(array){ + // The array here would be [ 1, 2, 3 ]; + }); + ``` + + If any of the `promises` given to `RSVP.all` are rejected, the first promise + that is rejected will be given as an argument to the returned promises's + rejection handler. For example: + + Example: + + ```javascript + let promise1 = RSVP.resolve(1); + let promise2 = RSVP.reject(new Error("2")); + let promise3 = RSVP.reject(new Error("3")); + let promises = [ promise1, promise2, promise3 ]; + + RSVP.Promise.all(promises).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(error) { + // error.message === "2" + }); + ``` + + @method all + @static + @param {Array} entries array of promises + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} promise that is fulfilled when all `promises` have been + fulfilled, or rejected if any of them become rejected. + @static + */ + function all(entries, label) { + return new Enumerator(this, entries, true, /* abort on reject */label).promise; } - MyConstructor.prototype = { - protoProperty: RSVP.resolve('Proto Property') - }; + /** + `RSVP.Promise.race` returns a new promise which is settled in the same way as the + first passed promise to settle. + + Example: + + ```javascript + let promise1 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 1'); + }, 200); + }); + + let promise2 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 2'); + }, 100); + }); + + RSVP.Promise.race([promise1, promise2]).then(function(result){ + // result === 'promise 2' because it was resolved before promise1 + // was resolved. + }); + ``` + + `RSVP.Promise.race` is deterministic in that only the state of the first + settled promise matters. For example, even if other promises given to the + `promises` array argument are resolved, but the first settled promise has + become rejected before the other promises became fulfilled, the returned + promise will become rejected: + + ```javascript + let promise1 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 1'); + }, 200); + }); + + let promise2 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + reject(new Error('promise 2')); + }, 100); + }); + + RSVP.Promise.race([promise1, promise2]).then(function(result){ + // Code here never runs + }, function(reason){ + // reason.message === 'promise 2' because promise 2 became rejected before + // promise 1 became fulfilled + }); + ``` + + An example real-world use case is implementing timeouts: + + ```javascript + RSVP.Promise.race([ajax('foo.json'), timeout(5000)]) + ``` + + @method race + @static + @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. + */ + function race(entries, label) { + /*jshint validthis:true */ + var Constructor = this; - var myObject = new MyConstructor(); + var promise = new Constructor(noop, label); - RSVP.hash(myObject).then(function(hash){ - // protoProperty will not be present, instead you will just have an - // object that looks like: - // { - // example: 'Example' - // } - // - // hash.hasOwnProperty('protoProperty'); // false - // 'undefined' === typeof hash.protoProperty - }); - ``` + if (!isArray(entries)) { + reject(promise, new TypeError('You must pass an array to race.')); + return promise; + } - @method hash - @static - @for RSVP - @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. -*/ -function hash(object, label) { - return new PromiseHash(Promise, object, label).promise; -} + for (var i = 0; promise._state === PENDING && i < entries.length; i++) { + subscribe(Constructor.resolve(entries[i]), undefined, function (value) { + return resolve(promise, value); + }, function (reason) { + return reject(promise, reason); + }); + } -function HashSettled(Constructor, object, label) { - this._superConstructor(Constructor, object, false, label); -} + return promise; + } + + /** + `RSVP.Promise.reject` returns a promise rejected with the passed `reason`. + It is shorthand for the following: + + ```javascript + let promise = new RSVP.Promise(function(resolve, reject){ + reject(new Error('WHOOPS')); + }); + + promise.then(function(value){ + // Code here doesn't run because the promise is rejected! + }, function(reason){ + // reason.message === 'WHOOPS' + }); + ``` + + Instead of writing the above, your code now simply becomes the following: + + ```javascript + let promise = RSVP.Promise.reject(new Error('WHOOPS')); + + promise.then(function(value){ + // Code here doesn't run because the promise is rejected! + }, function(reason){ + // reason.message === 'WHOOPS' + }); + ``` + + @method reject + @static + @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$1(reason, label) { + /*jshint validthis:true */ + var Constructor = this; + var promise = new Constructor(noop, label); + reject(promise, reason); + return promise; + } -HashSettled.prototype = o_create(PromiseHash.prototype); -HashSettled.prototype._superConstructor = Enumerator; -HashSettled.prototype._makeResult = makeSettledResult; + var guidKey = 'rsvp_' + now() + '-'; + var counter = 0; -HashSettled.prototype._validationError = function() { - return new Error('hashSettled must be called with an object'); -}; + function needsResolver() { + throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); + } -/** - `RSVP.hashSettled` is similar to `RSVP.allSettled`, but takes an object - instead of an array for its `promises` argument. + function needsNew() { + throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); + } + + /** + 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 + why the promise cannot be fulfilled. + + Terminology + ----------- + + - `promise` is an object or function with a `then` method whose behavior conforms to this specification. + - `thenable` is an object or function that defines a `then` method. + - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). + - `exception` is a value that is thrown using the throw statement. + - `reason` is a value that indicates why a promise was rejected. + - `settled` the final resting state of a promise, fulfilled or rejected. + + A promise can be in one of three states: pending, fulfilled, or rejected. + + Promises that are fulfilled have a fulfillment value and are in the fulfilled + state. Promises that are rejected have a rejection reason and are in the + rejected state. A fulfillment value is never a thenable. + + Promises can also be said to *resolve* a value. If this value is also a + promise, then the original promise's settled state will match the value's + settled state. So a promise that *resolves* a promise that rejects will + itself reject, and a promise that *resolves* a promise that fulfills will + itself fulfill. + + + Basic Usage: + ------------ + + ```js + let promise = new Promise(function(resolve, reject) { + // on success + resolve(value); + + // on failure + reject(reason); + }); + + promise.then(function(value) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Advanced Usage: + --------------- + + Promises shine when abstracting away asynchronous interactions such as + `XMLHttpRequest`s. + + ```js + function getJSON(url) { + return new Promise(function(resolve, reject){ + let xhr = new XMLHttpRequest(); + + xhr.open('GET', url); + xhr.onreadystatechange = handler; + xhr.responseType = 'json'; + xhr.setRequestHeader('Accept', 'application/json'); + xhr.send(); + + function handler() { + if (this.readyState === this.DONE) { + if (this.status === 200) { + resolve(this.response); + } else { + reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); + } + } + }; + }); + } + + getJSON('/posts.json').then(function(json) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Unlike callbacks, promises are great composable primitives. + + ```js + Promise.all([ + getJSON('/posts'), + getJSON('/comments') + ]).then(function(values){ + values[0] // => postsJSON + values[1] // => commentsJSON + + return values; + }); + ``` + + @class RSVP.Promise + @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 = []; - Unlike `RSVP.all` or `RSVP.hash`, which implement a fail-fast method, - but like `RSVP.allSettled`, `hashSettled` waits until all the - constituent promises have returned and then shows you all the results - with their states and values/reasons. This is useful if you want to - handle multiple promises' failure states together as a set. + config.instrument && instrument('created', this); - Returns a promise that is fulfilled when all the given promises have been - settled, or rejected if the passed parameters are invalid. + if (noop !== resolver) { + typeof resolver !== 'function' && needsResolver(); + this instanceof Promise ? initializePromise(this, resolver) : needsNew(); + } + } - The returned promise is fulfilled with a hash that has the same key names as - the `promises` object argument. If any of the values in the object are not - promises, they will be copied over to the fulfilled object and marked with state - 'fulfilled'. + Promise.cast = resolve$1; // deprecated + Promise.all = all; + Promise.race = race; + Promise.resolve = resolve$1; + Promise.reject = reject$1; - Example: + Promise.prototype = { + constructor: Promise, - ```javascript - var promises = { - myPromise: RSVP.Promise.resolve(1), - yourPromise: RSVP.Promise.resolve(2), - theirPromise: RSVP.Promise.resolve(3), - notAPromise: 4 - }; + _guidKey: guidKey, - RSVP.hashSettled(promises).then(function(hash){ - // hash here is an object that looks like: - // { - // myPromise: { state: 'fulfilled', value: 1 }, - // yourPromise: { state: 'fulfilled', value: 2 }, - // theirPromise: { state: 'fulfilled', value: 3 }, - // notAPromise: { state: 'fulfilled', value: 4 } - // } - }); - ``` + _onError: function (reason) { + var promise = this; + config.after(function () { + if (promise._onError) { + config['trigger']('error', reason, promise._label); + } + }); + }, + + /** + 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 why the promise cannot be fulfilled. + + ```js + findUser().then(function(user){ + // user is available + }, function(reason){ + // user is unavailable, and you are given the reason why + }); + ``` + + Chaining + -------- + + The return value of `then` is itself a promise. This second, 'downstream' + promise is resolved with the return value of the first promise's fulfillment + or rejection handler, or rejected if the handler throws an exception. + + ```js + findUser().then(function (user) { + return user.name; + }, function (reason) { + return 'default name'; + }).then(function (userName) { + // If `findUser` fulfilled, `userName` will be the user's name, otherwise it + // will be `'default name'` + }); + + findUser().then(function (user) { + throw new Error('Found user, but still unhappy'); + }, function (reason) { + throw new Error('`findUser` rejected and we\'re unhappy'); + }).then(function (value) { + // never reached + }, function (reason) { + // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. + // If `findUser` rejected, `reason` will be '`findUser` rejected and we\'re unhappy'. + }); + ``` + If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. + + ```js + findUser().then(function (user) { + throw new PedagogicalException('Upstream error'); + }).then(function (value) { + // never reached + }).then(function (value) { + // never reached + }, function (reason) { + // The `PedgagocialException` is propagated all the way down to here + }); + ``` + + Assimilation + ------------ + + Sometimes the value you want to propagate to a downstream promise can only be + retrieved asynchronously. This can be achieved by returning a promise in the + fulfillment or rejection handler. The downstream promise will then be pending + until the returned promise is settled. This is called *assimilation*. + + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // The user's comments are now available + }); + ``` + + If the assimliated promise rejects, then the downstream promise will also reject. + + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // If `findCommentsByAuthor` fulfills, we'll have the value here + }, function (reason) { + // If `findCommentsByAuthor` rejects, we'll have the reason here + }); + ``` + + Simple Example + -------------- + + Synchronous Example + + ```javascript + let result; + + try { + result = findResult(); + // success + } catch(reason) { + // failure + } + ``` + + Errback Example + + ```js + findResult(function(result, err){ + if (err) { + // failure + } else { + // success + } + }); + ``` + + Promise Example; + + ```javascript + findResult().then(function(result){ + // success + }, function(reason){ + // failure + }); + ``` + + Advanced Example + -------------- + + Synchronous Example + + ```javascript + let author, books; + + try { + author = findAuthor(); + books = findBooksByAuthor(author); + // success + } catch(reason) { + // failure + } + ``` + + Errback Example + + ```js + + function foundBooks(books) { + + } + + function failure(reason) { + + } + + findAuthor(function(author, err){ + if (err) { + failure(err); + // failure + } else { + try { + findBoooksByAuthor(author, function(books, err) { + if (err) { + failure(err); + } else { + try { + foundBooks(books); + } catch(reason) { + failure(reason); + } + } + }); + } catch(error) { + failure(err); + } + // success + } + }); + ``` + + Promise Example; + + ```javascript + findAuthor(). + then(findBooksByAuthor). + then(function(books){ + // found books + }).catch(function(reason){ + // something went wrong + }); + ``` + + @method then + @param {Function} onFulfillment + @param {Function} onRejection + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + */ + then: then, - If any of the `promises` given to `RSVP.hash` are rejected, the state will - be set to 'rejected' and the reason for rejection provided. + /** + `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same + as the catch block of a try/catch statement. + + ```js + function findAuthor(){ + throw new Error('couldn\'t find that author'); + } + + // synchronous + try { + findAuthor(); + } catch(reason) { + // something went wrong + } + + // async with promises + findAuthor().catch(function(reason){ + // something went wrong + }); + ``` + + @method catch + @param {Function} onRejection + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + */ + catch: function (onRejection, label) { + return this.then(undefined, onRejection, label); + }, - Example: + /** + `finally` will be invoked regardless of the promise's fate just as native + try/catch/finally behaves + + Synchronous example: + + ```js + findAuthor() { + if (Math.random() > 0.5) { + throw new Error(); + } + return new Author(); + } + + try { + return findAuthor(); // succeed or fail + } catch(error) { + return findOtherAuther(); + } finally { + // always runs + // doesn't affect the return value + } + ``` + + Asynchronous example: + + ```js + findAuthor().catch(function(reason){ + return findOtherAuther(); + }).finally(function(){ + // author was either found, or not + }); + ``` + + @method finally + @param {Function} callback + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + */ + finally: function (callback, label) { + var promise = this; + var constructor = promise.constructor; - ```javascript - var promises = { - myPromise: RSVP.Promise.resolve(1), - rejectedPromise: RSVP.Promise.reject(new Error('rejection')), - anotherRejectedPromise: RSVP.Promise.reject(new Error('more rejection')), + return promise.then(function (value) { + return constructor.resolve(callback()).then(function () { + return value; + }); + }, function (reason) { + return constructor.resolve(callback()).then(function () { + throw reason; + }); + }, label); + } }; - RSVP.hashSettled(promises).then(function(hash){ - // hash here is an object that looks like: - // { - // myPromise: { state: 'fulfilled', value: 1 }, - // rejectedPromise: { state: 'rejected', reason: Error }, - // anotherRejectedPromise: { state: 'rejected', reason: Error }, - // } - // Note that for rejectedPromise, reason.message == 'rejection', - // and for anotherRejectedPromise, reason.message == 'more rejection'. - }); - ``` + function Result() { + this.value = undefined; + } - An important note: `RSVP.hashSettled` is intended for plain JavaScript objects that - are just a set of keys and values. `RSVP.hashSettled` will NOT preserve prototype - chains. + var ERROR = new Result(); + var GET_THEN_ERROR$1 = new Result(); - Example: + function getThen$1(obj) { + try { + return obj.then; + } catch (error) { + ERROR.value = error; + return ERROR; + } + } - ```javascript - function MyConstructor(){ - this.example = RSVP.Promise.resolve('Example'); + function tryApply(f, s, a) { + try { + f.apply(s, a); + } catch (error) { + ERROR.value = error; + return ERROR; + } } - MyConstructor.prototype = { - protoProperty: RSVP.Promise.resolve('Proto Property') - }; + function makeObject(_, argumentNames) { + var obj = {}; + var length = _.length; + var args = new Array(length); - var myObject = new MyConstructor(); + for (var x = 0; x < length; x++) { + args[x] = _[x]; + } - RSVP.hashSettled(myObject).then(function(hash){ - // protoProperty will not be present, instead you will just have an - // object that looks like: - // { - // example: { state: 'fulfilled', value: 'Example' } - // } - // - // hash.hasOwnProperty('protoProperty'); // false - // 'undefined' === typeof hash.protoProperty - }); - ``` + for (var i = 0; i < argumentNames.length; i++) { + var _name = argumentNames[i]; + obj[_name] = args[i + 1]; + } - @method hashSettled - @for RSVP - @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 -*/ -function hashSettled(object, label) { - return new HashSettled(Promise, object, label).promise; -} + return obj; + } -/** - `RSVP.rethrow` will rethrow an error on the next turn of the JavaScript event - loop in order to aid debugging. + function arrayResult(_) { + var length = _.length; + var args = new Array(length - 1); - Promises A+ specifies that any exceptions that occur with a promise must be - caught by the promises implementation and bubbled to the last handler. For - this reason, it is recommended that you always specify a second rejection - handler function to `then`. However, `RSVP.rethrow` will throw the exception - outside of the promise, so it bubbles up to your console if in the browser, - or domain/cause uncaught exception in Node. `rethrow` will also throw the - error again so the error can be handled by the promise per the spec. + for (var i = 1; i < length; i++) { + args[i - 1] = _[i]; + } - ```javascript - function throws(){ - throw new Error('Whoops!'); + return args; } - var promise = new RSVP.Promise(function(resolve, reject){ - throws(); - }); - - promise.catch(RSVP.rethrow).then(function(){ - // Code here doesn't run because the promise became rejected due to an - // error! - }, function (err){ - // handle the error here - }); - ``` + function wrapThenable(then, promise) { + return { + then: function (onFulFillment, onRejection) { + return then.call(promise, onFulFillment, onRejection); + } + }; + } - The 'Whoops' error will be thrown on the next turn of the event loop - and you can watch for it in your console. You can also handle it using a - rejection handler given to `.then` or `.catch` on the returned promise. + /** + `RSVP.denodeify` takes a 'node-style' function and returns a function that + will return an `RSVP.Promise`. You can use `denodeify` in Node.js or the + browser when you'd prefer to use promises over using callbacks. For example, + `denodeify` transforms the following: + + ```javascript + let fs = require('fs'); + + fs.readFile('myfile.txt', function(err, data){ + if (err) return handleError(err); + handleData(data); + }); + ``` + + into: + + ```javascript + let fs = require('fs'); + let readFile = RSVP.denodeify(fs.readFile); + + readFile('myfile.txt').then(handleData, handleError); + ``` + + If the node function has multiple success parameters, then `denodeify` + just returns the first one: + + ```javascript + let request = RSVP.denodeify(require('request')); + + request('http://example.com').then(function(res) { + // ... + }); + ``` + + However, if you need all success parameters, setting `denodeify`'s + second parameter to `true` causes it to return all success parameters + as an array: + + ```javascript + let request = RSVP.denodeify(require('request'), true); + + request('http://example.com').then(function(result) { + // result[0] -> res + // result[1] -> body + }); + ``` + + Or if you pass it an array with names it returns the parameters as a hash: + + ```javascript + let request = RSVP.denodeify(require('request'), ['res', 'body']); + + request('http://example.com').then(function(result) { + // result.res + // result.body + }); + ``` + + Sometimes you need to retain the `this`: + + ```javascript + let app = require('express')(); + let render = RSVP.denodeify(app.render.bind(app)); + ``` + + The denodified function inherits from the original function. It works in all + environments, except IE 10 and below. Consequently all properties of the original + function are available to you. However, any properties you change on the + denodeified function won't be changed on the original function. Example: + + ```javascript + let request = RSVP.denodeify(require('request')), + cookieJar = request.jar(); // <- Inheritance is used here + + request('http://example.com', {jar: cookieJar}).then(function(res) { + // cookieJar.cookies holds now the cookies returned by example.com + }); + ``` + + Using `denodeify` makes it easier to compose asynchronous operations instead + of using callbacks. For example, instead of: + + ```javascript + let fs = require('fs'); + + fs.readFile('myfile.txt', function(err, data){ + if (err) { ... } // Handle error + fs.writeFile('myfile2.txt', data, function(err){ + if (err) { ... } // Handle error + console.log('done') + }); + }); + ``` + + you can chain the operations together using `then` from the returned promise: + + ```javascript + let fs = require('fs'); + let readFile = RSVP.denodeify(fs.readFile); + let writeFile = RSVP.denodeify(fs.writeFile); + + readFile('myfile.txt').then(function(data){ + return writeFile('myfile2.txt', data); + }).then(function(){ + console.log('done') + }).catch(function(error){ + // Handle error + }); + ``` + + @method denodeify + @static + @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} [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. + @return {Function} a function that wraps `nodeFunc` to return an + `RSVP.Promise` + @static + */ + function denodeify(nodeFunc, options) { + var fn = function () { + var self = this; + var l = arguments.length; + var args = new Array(l + 1); + var promiseInput = false; + + for (var i = 0; i < l; ++i) { + var arg = arguments[i]; + + if (!promiseInput) { + // TODO: clean this up + promiseInput = needsPromiseInput(arg); + if (promiseInput === GET_THEN_ERROR$1) { + var p = new Promise(noop); + reject(p, GET_THEN_ERROR$1.value); + return p; + } else if (promiseInput && promiseInput !== true) { + arg = wrapThenable(promiseInput, arg); + } + } + args[i] = arg; + } - @method rethrow - @static - @for RSVP - @param {Error} reason reason the promise became rejected. - @throws Error - @static -*/ -function rethrow(reason) { - setTimeout(function() { - throw reason; - }); - throw reason; -} + var promise = new Promise(noop); -/** - `RSVP.defer` returns an object similar to jQuery's `$.Deferred`. - `RSVP.defer` should be used when porting over code reliant on `$.Deferred`'s - interface. New code should use the `RSVP.Promise` constructor instead. + args[l] = function (err, val) { + if (err) reject(promise, err);else if (options === undefined) resolve(promise, val);else if (options === true) resolve(promise, arrayResult(arguments));else if (isArray(options)) resolve(promise, makeObject(arguments, options));else resolve(promise, val); + }; - The object returned from `RSVP.defer` is a plain object with three properties: + if (promiseInput) { + return handlePromiseInput(promise, args, nodeFunc, self); + } else { + return handleValueInput(promise, args, nodeFunc, self); + } + }; - * promise - an `RSVP.Promise`. - * reject - a function that causes the `promise` property on this object to - become rejected - * resolve - a function that causes the `promise` property on this object to - become fulfilled. + babelHelpers.defaults(fn, nodeFunc); - Example: + return fn; + } - ```javascript - var deferred = RSVP.defer(); + function handleValueInput(promise, args, nodeFunc, self) { + var result = tryApply(nodeFunc, self, args); + if (result === ERROR) { + reject(promise, result.value); + } + return promise; + } - deferred.resolve("Success!"); + function handlePromiseInput(promise, args, nodeFunc, self) { + return Promise.all(args).then(function (args) { + var result = tryApply(nodeFunc, self, args); + if (result === ERROR) { + reject(promise, result.value); + } + return promise; + }); + } - deferred.promise.then(function(value){ - // value here is "Success!" - }); - ``` + function needsPromiseInput(arg) { + if (arg && typeof arg === 'object') { + if (arg.constructor === Promise) { + return true; + } else { + return getThen$1(arg); + } + } else { + return false; + } + } - @method defer - @static - @for RSVP - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Object} - */ + /** + This is a convenient alias for `RSVP.Promise.all`. + + @method all + @static + @for RSVP + @param {Array} array Array of promises. + @param {String} label An optional label. This is useful + for tooling. + */ + function all$1(array, label) { + return Promise.all(array, label); + } -function defer(label) { - var deferred = {}; + function AllSettled(Constructor, entries, label) { + this._superConstructor(Constructor, entries, false, /* don't abort on reject */label); + } - deferred['promise'] = new Promise(function(resolve, reject) { - deferred['resolve'] = resolve; - deferred['reject'] = reject; - }, label); + AllSettled.prototype = o_create(Enumerator.prototype); + AllSettled.prototype._superConstructor = Enumerator; + AllSettled.prototype._makeResult = makeSettledResult; + AllSettled.prototype._validationError = function () { + return new Error('allSettled must be called with an array'); + }; - return deferred; -} + /** + `RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing + a fail-fast method, it waits until all the promises have returned and + shows you all the results. This is useful if you want to handle multiple + promises' failure states together as a set. + + Returns a promise that is fulfilled when all the given promises have been + settled. The return promise is fulfilled with an array of the states of + the promises passed into the `promises` array argument. + + Each state object will either indicate fulfillment or rejection, and + provide the corresponding value or reason. The states will take one of + the following formats: + + ```javascript + { state: 'fulfilled', value: value } + or + { state: 'rejected', reason: reason } + ``` + + Example: + + ```javascript + let promise1 = RSVP.Promise.resolve(1); + let promise2 = RSVP.Promise.reject(new Error('2')); + let promise3 = RSVP.Promise.reject(new Error('3')); + let promises = [ promise1, promise2, promise3 ]; + + RSVP.allSettled(promises).then(function(array){ + // array == [ + // { state: 'fulfilled', value: 1 }, + // { state: 'rejected', reason: Error }, + // { state: 'rejected', reason: Error } + // ] + // Note that for the second item, reason.message will be '2', and for the + // third item, reason.message will be '3'. + }, function(error) { + // Not run. (This block would only be called if allSettled had failed, + // for instance if passed an incorrect argument type.) + }); + ``` + + @method allSettled + @static + @for RSVP + @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. + */ -/** - `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 - each item in given to `promises`. `RSVP.map` returns a promise that will - become fulfilled with the result of running `mapFn` on the values the promises - become fulfilled with. + function allSettled(entries, label) { + return new AllSettled(Promise, entries, label).promise; + } - For example: + /** + This is a convenient alias for `RSVP.Promise.race`. + + @method race + @static + @for RSVP + @param {Array} array Array of promises. + @param {String} label An optional label. This is useful + for tooling. + */ + function race$1(array, label) { + return Promise.race(array, label); + } - ```javascript + function PromiseHash(Constructor, object, label) { + this._superConstructor(Constructor, object, true, label); + } - var promise1 = RSVP.resolve(1); - var promise2 = RSVP.resolve(2); - var promise3 = RSVP.resolve(3); - var promises = [ promise1, promise2, promise3 ]; + PromiseHash.prototype = o_create(Enumerator.prototype); + PromiseHash.prototype._superConstructor = Enumerator; + PromiseHash.prototype._init = function () { + this._result = {}; + }; - var mapFn = function(item){ - return item + 1; + PromiseHash.prototype._validateInput = function (input) { + return input && typeof input === 'object'; }; - RSVP.map(promises, mapFn).then(function(result){ - // result is [ 2, 3, 4 ] - }); - ``` + PromiseHash.prototype._validationError = function () { + return new Error('Promise.hash must be called with an object'); + }; - If any of the `promises` given to `RSVP.map` are rejected, the first promise - that is rejected will be given as an argument to the returned promise's - rejection handler. For example: + PromiseHash.prototype._enumerate = function () { + var enumerator = this; + var promise = enumerator.promise; + var input = enumerator._input; + var results = []; + + for (var key in input) { + if (promise._state === PENDING && Object.prototype.hasOwnProperty.call(input, key)) { + results.push({ + position: key, + entry: input[key] + }); + } + } - ```javascript - var promise1 = RSVP.resolve(1); - var promise2 = RSVP.reject(new Error('2')); - var promise3 = RSVP.reject(new Error('3')); - var promises = [ promise1, promise2, promise3 ]; + var length = results.length; + enumerator._remaining = length; + var result = undefined; - var mapFn = function(item){ - return item + 1; + for (var i = 0; promise._state === PENDING && i < length; i++) { + result = results[i]; + enumerator._eachEntry(result.entry, result.position); + } }; - RSVP.map(promises, mapFn).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(reason) { - // reason.message === '2' - }); - ``` + /** + `RSVP.hash` is similar to `RSVP.all`, but takes an object instead of an array + for its `promises` argument. + + Returns a promise that is fulfilled when all the given promises have been + fulfilled, or rejected if any of them become rejected. The returned promise + is fulfilled with a hash that has the same key names as the `promises` object + argument. If any of the values in the object are not promises, they will + simply be copied over to the fulfilled object. + + Example: + + ```javascript + let promises = { + myPromise: RSVP.resolve(1), + yourPromise: RSVP.resolve(2), + theirPromise: RSVP.resolve(3), + notAPromise: 4 + }; + + RSVP.hash(promises).then(function(hash){ + // hash here is an object that looks like: + // { + // myPromise: 1, + // yourPromise: 2, + // theirPromise: 3, + // notAPromise: 4 + // } + }); + ```` + + If any of the `promises` given to `RSVP.hash` are rejected, the first promise + that is rejected will be given as the reason to the rejection handler. + + Example: + + ```javascript + let promises = { + myPromise: RSVP.resolve(1), + rejectedPromise: RSVP.reject(new Error('rejectedPromise')), + anotherRejectedPromise: RSVP.reject(new Error('anotherRejectedPromise')), + }; + + RSVP.hash(promises).then(function(hash){ + // Code here never runs because there are rejected promises! + }, function(reason) { + // reason.message === 'rejectedPromise' + }); + ``` + + An important note: `RSVP.hash` is intended for plain JavaScript objects that + are just a set of keys and values. `RSVP.hash` will NOT preserve prototype + chains. + + Example: + + ```javascript + function MyConstructor(){ + this.example = RSVP.resolve('Example'); + } + + MyConstructor.prototype = { + protoProperty: RSVP.resolve('Proto Property') + }; + + let myObject = new MyConstructor(); + + RSVP.hash(myObject).then(function(hash){ + // protoProperty will not be present, instead you will just have an + // object that looks like: + // { + // example: 'Example' + // } + // + // hash.hasOwnProperty('protoProperty'); // false + // 'undefined' === typeof hash.protoProperty + }); + ``` + + @method hash + @static + @for RSVP + @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. + */ + function hash(object, label) { + return new PromiseHash(Promise, object, label).promise; + } - `RSVP.map` will also wait if a promise is returned from `mapFn`. For example, - say you want to get all comments from a set of blog posts, but you need - the blog posts first because they contain a url to those comments. + function HashSettled(Constructor, object, label) { + this._superConstructor(Constructor, object, false, label); + } - ```javscript + HashSettled.prototype = o_create(PromiseHash.prototype); + HashSettled.prototype._superConstructor = Enumerator; + HashSettled.prototype._makeResult = makeSettledResult; - var mapFn = function(blogPost){ - // getComments does some ajax and returns an RSVP.Promise that is fulfilled - // with some comments data - return getComments(blogPost.comments_url); + HashSettled.prototype._validationError = function () { + return new Error('hashSettled must be called with an object'); }; - // getBlogPosts does some ajax and returns an RSVP.Promise that is fulfilled - // with some blog post data - RSVP.map(getBlogPosts(), mapFn).then(function(comments){ - // comments is the result of asking the server for the comments - // of all blog posts returned from getBlogPosts() - }); - ``` - - @method map - @static - @for RSVP - @param {Array} promises - @param {Function} mapFn function to be called on each fulfilled promise. - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} promise that is fulfilled with the result of calling - `mapFn` on each fulfilled promise or value when they become fulfilled. - The promise will be rejected if any of the given `promises` become rejected. - @static -*/ -function map(promises, mapFn, label) { - return Promise.all(promises, label).then(function(values) { - if (!isFunction(mapFn)) { - throw new TypeError("You must pass a function as map's second argument."); + /** + `RSVP.hashSettled` is similar to `RSVP.allSettled`, but takes an object + instead of an array for its `promises` argument. + + Unlike `RSVP.all` or `RSVP.hash`, which implement a fail-fast method, + but like `RSVP.allSettled`, `hashSettled` waits until all the + constituent promises have returned and then shows you all the results + with their states and values/reasons. This is useful if you want to + handle multiple promises' failure states together as a set. + + Returns a promise that is fulfilled when all the given promises have been + settled, or rejected if the passed parameters are invalid. + + The returned promise is fulfilled with a hash that has the same key names as + the `promises` object argument. If any of the values in the object are not + promises, they will be copied over to the fulfilled object and marked with state + 'fulfilled'. + + Example: + + ```javascript + let promises = { + myPromise: RSVP.Promise.resolve(1), + yourPromise: RSVP.Promise.resolve(2), + theirPromise: RSVP.Promise.resolve(3), + notAPromise: 4 + }; + + RSVP.hashSettled(promises).then(function(hash){ + // hash here is an object that looks like: + // { + // myPromise: { state: 'fulfilled', value: 1 }, + // yourPromise: { state: 'fulfilled', value: 2 }, + // theirPromise: { state: 'fulfilled', value: 3 }, + // notAPromise: { state: 'fulfilled', value: 4 } + // } + }); + ``` + + If any of the `promises` given to `RSVP.hash` are rejected, the state will + be set to 'rejected' and the reason for rejection provided. + + Example: + + ```javascript + let promises = { + myPromise: RSVP.Promise.resolve(1), + rejectedPromise: RSVP.Promise.reject(new Error('rejection')), + anotherRejectedPromise: RSVP.Promise.reject(new Error('more rejection')), + }; + + RSVP.hashSettled(promises).then(function(hash){ + // hash here is an object that looks like: + // { + // myPromise: { state: 'fulfilled', value: 1 }, + // rejectedPromise: { state: 'rejected', reason: Error }, + // anotherRejectedPromise: { state: 'rejected', reason: Error }, + // } + // Note that for rejectedPromise, reason.message == 'rejection', + // and for anotherRejectedPromise, reason.message == 'more rejection'. + }); + ``` + + An important note: `RSVP.hashSettled` is intended for plain JavaScript objects that + are just a set of keys and values. `RSVP.hashSettled` will NOT preserve prototype + chains. + + Example: + + ```javascript + function MyConstructor(){ + this.example = RSVP.Promise.resolve('Example'); } + + MyConstructor.prototype = { + protoProperty: RSVP.Promise.resolve('Proto Property') + }; + + let myObject = new MyConstructor(); + + RSVP.hashSettled(myObject).then(function(hash){ + // protoProperty will not be present, instead you will just have an + // object that looks like: + // { + // example: { state: 'fulfilled', value: 'Example' } + // } + // + // hash.hasOwnProperty('protoProperty'); // false + // 'undefined' === typeof hash.protoProperty + }); + ``` + + @method hashSettled + @for RSVP + @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 + */ + function hashSettled(object, label) { + return new HashSettled(Promise, object, label).promise; + } - var length = values.length; - var results = new Array(length); - - for (var i = 0; i < length; i++) { - results[i] = mapFn(values[i]); + /** + `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 + caught by the promises implementation and bubbled to the last handler. For + this reason, it is recommended that you always specify a second rejection + handler function to `then`. However, `RSVP.rethrow` will throw the exception + outside of the promise, so it bubbles up to your console if in the browser, + or domain/cause uncaught exception in Node. `rethrow` will also throw the + error again so the error can be handled by the promise per the spec. + + ```javascript + function throws(){ + throw new Error('Whoops!'); } + + let promise = new RSVP.Promise(function(resolve, reject){ + throws(); + }); + + promise.catch(RSVP.rethrow).then(function(){ + // Code here doesn't run because the promise became rejected due to an + // error! + }, function (err){ + // handle the error here + }); + ``` + + The 'Whoops' error will be thrown on the next turn of the event loop + and you can watch for it in your console. You can also handle it using a + rejection handler given to `.then` or `.catch` on the returned promise. + + @method rethrow + @static + @for RSVP + @param {Error} reason reason the promise became rejected. + @throws Error + @static + */ + function rethrow(reason) { + setTimeout(function () { + throw reason; + }); + throw reason; + } - return Promise.all(results, label); - }); -} - -/** - This is a convenient alias for `RSVP.Promise.resolve`. + /** + `RSVP.defer` returns an object similar to jQuery's `$.Deferred`. + `RSVP.defer` should be used when porting over code reliant on `$.Deferred`'s + interface. New code should use the `RSVP.Promise` constructor instead. + + The object returned from `RSVP.defer` is a plain object with three properties: + + * promise - an `RSVP.Promise`. + * reject - a function that causes the `promise` property on this object to + become rejected + * resolve - a function that causes the `promise` property on this object to + become fulfilled. + + Example: + + ```javascript + let deferred = RSVP.defer(); + + deferred.resolve("Success!"); + + deferred.promise.then(function(value){ + // value here is "Success!" + }); + ``` + + @method defer + @static + @for RSVP + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Object} + */ - @method resolve - @static - @for RSVP - @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` -*/ -function resolve$2(value, label) { - return Promise.resolve(value, label); -} + function defer(label) { + var deferred = { resolve: undefined, reject: undefined }; -/** - This is a convenient alias for `RSVP.Promise.reject`. + deferred.promise = new Promise(function (resolve, reject) { + deferred.resolve = resolve; + deferred.reject = reject; + }, label); - @method reject - @static - @for RSVP - @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$2(reason, label) { - return Promise.reject(reason, label); -} + return deferred; + } -/** - `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 - each item in given to `promises`. `RSVP.filter` returns a promise that will - become fulfilled with the result of running `filterFn` on the values the - promises become fulfilled with. + /** + `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 + each item in given to `promises`. `RSVP.map` returns a promise that will + become fulfilled with the result of running `mapFn` on the values the promises + become fulfilled with. + + For example: + + ```javascript + + let promise1 = RSVP.resolve(1); + let promise2 = RSVP.resolve(2); + let promise3 = RSVP.resolve(3); + let promises = [ promise1, promise2, promise3 ]; + + let mapFn = function(item){ + return item + 1; + }; + + RSVP.map(promises, mapFn).then(function(result){ + // result is [ 2, 3, 4 ] + }); + ``` + + If any of the `promises` given to `RSVP.map` are rejected, the first promise + that is rejected will be given as an argument to the returned promise's + rejection handler. For example: + + ```javascript + let promise1 = RSVP.resolve(1); + let promise2 = RSVP.reject(new Error('2')); + let promise3 = RSVP.reject(new Error('3')); + let promises = [ promise1, promise2, promise3 ]; + + let mapFn = function(item){ + return item + 1; + }; + + RSVP.map(promises, mapFn).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(reason) { + // reason.message === '2' + }); + ``` + + `RSVP.map` will also wait if a promise is returned from `mapFn`. For example, + say you want to get all comments from a set of blog posts, but you need + the blog posts first because they contain a url to those comments. + + ```javscript + + let mapFn = function(blogPost){ + // getComments does some ajax and returns an RSVP.Promise that is fulfilled + // with some comments data + return getComments(blogPost.comments_url); + }; + + // getBlogPosts does some ajax and returns an RSVP.Promise that is fulfilled + // with some blog post data + RSVP.map(getBlogPosts(), mapFn).then(function(comments){ + // comments is the result of asking the server for the comments + // of all blog posts returned from getBlogPosts() + }); + ``` + + @method map + @static + @for RSVP + @param {Array} promises + @param {Function} mapFn function to be called on each fulfilled promise. + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} promise that is fulfilled with the result of calling + `mapFn` on each fulfilled promise or value when they become fulfilled. + The promise will be rejected if any of the given `promises` become rejected. + @static + */ + function map(promises, mapFn, label) { + return Promise.all(promises, label).then(function (values) { + if (!isFunction(mapFn)) { + throw new TypeError("You must pass a function as map's second argument."); + } - For example: + var length = values.length; + var results = new Array(length); - ```javascript + for (var i = 0; i < length; i++) { + results[i] = mapFn(values[i]); + } - var promise1 = RSVP.resolve(1); - var promise2 = RSVP.resolve(2); - var promise3 = RSVP.resolve(3); + return Promise.all(results, label); + }); + } - var promises = [promise1, promise2, promise3]; + /** + This is a convenient alias for `RSVP.Promise.resolve`. + + @method resolve + @static + @for RSVP + @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` + */ + function resolve$2(value, label) { + return Promise.resolve(value, label); + } - var filterFn = function(item){ - return item > 1; - }; + /** + This is a convenient alias for `RSVP.Promise.reject`. + + @method reject + @static + @for RSVP + @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$2(reason, label) { + return Promise.reject(reason, label); + } - RSVP.filter(promises, filterFn).then(function(result){ - // result is [ 2, 3 ] - }); - ``` + /** + `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 + each item in given to `promises`. `RSVP.filter` returns a promise that will + become fulfilled with the result of running `filterFn` on the values the + promises become fulfilled with. + + For example: + + ```javascript + + let promise1 = RSVP.resolve(1); + let promise2 = RSVP.resolve(2); + let promise3 = RSVP.resolve(3); + + let promises = [promise1, promise2, promise3]; + + let filterFn = function(item){ + return item > 1; + }; + + RSVP.filter(promises, filterFn).then(function(result){ + // result is [ 2, 3 ] + }); + ``` + + If any of the `promises` given to `RSVP.filter` are rejected, the first promise + that is rejected will be given as an argument to the returned promise's + rejection handler. For example: + + ```javascript + let promise1 = RSVP.resolve(1); + let promise2 = RSVP.reject(new Error('2')); + let promise3 = RSVP.reject(new Error('3')); + let promises = [ promise1, promise2, promise3 ]; + + let filterFn = function(item){ + return item > 1; + }; + + RSVP.filter(promises, filterFn).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(reason) { + // reason.message === '2' + }); + ``` + + `RSVP.filter` will also wait for any promises returned from `filterFn`. + For instance, you may want to fetch a list of users then return a subset + of those users based on some asynchronous operation: + + ```javascript + + let alice = { name: 'alice' }; + let bob = { name: 'bob' }; + let users = [ alice, bob ]; + + let promises = users.map(function(user){ + return RSVP.resolve(user); + }); + + let filterFn = function(user){ + // Here, Alice has permissions to create a blog post, but Bob does not. + return getPrivilegesForUser(user).then(function(privs){ + return privs.can_create_blog_post === true; + }); + }; + RSVP.filter(promises, filterFn).then(function(users){ + // true, because the server told us only Alice can create a blog post. + users.length === 1; + // false, because Alice is the only user present in `users` + users[0] === bob; + }); + ``` + + @method filter + @static + @for RSVP + @param {Array} promises + @param {Function} filterFn - function to be called on each resolved value to + filter the final results. + @param {String} label optional string describing the promise. Useful for + tooling. + @return {Promise} + */ - If any of the `promises` given to `RSVP.filter` are rejected, the first promise - that is rejected will be given as an argument to the returned promise's - rejection handler. For example: + function resolveAll(promises, label) { + return Promise.all(promises, label); + } - ```javascript - var promise1 = RSVP.resolve(1); - var promise2 = RSVP.reject(new Error('2')); - var promise3 = RSVP.reject(new Error('3')); - var promises = [ promise1, promise2, promise3 ]; + function resolveSingle(promise, label) { + return Promise.resolve(promise, label).then(function (promises) { + return resolveAll(promises, label); + }); + } - var filterFn = function(item){ - return item > 1; - }; + function filter(promises, filterFn, label) { + var promise = isArray(promises) ? resolveAll(promises, label) : resolveSingle(promises, label); + return promise.then(function (values) { + if (!isFunction(filterFn)) { + throw new TypeError("You must pass a function as filter's second argument."); + } - RSVP.filter(promises, filterFn).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(reason) { - // reason.message === '2' - }); - ``` + var length = values.length; + var filtered = new Array(length); - `RSVP.filter` will also wait for any promises returned from `filterFn`. - For instance, you may want to fetch a list of users then return a subset - of those users based on some asynchronous operation: + for (var i = 0; i < length; i++) { + filtered[i] = filterFn(values[i]); + } - ```javascript + return resolveAll(filtered, label).then(function (filtered) { + var results = new Array(length); + var newLength = 0; - var alice = { name: 'alice' }; - var bob = { name: 'bob' }; - var users = [ alice, bob ]; + for (var i = 0; i < length; i++) { + if (filtered[i]) { + results[newLength] = values[i]; + newLength++; + } + } - var promises = users.map(function(user){ - return RSVP.resolve(user); - }); + results.length = newLength; - var filterFn = function(user){ - // Here, Alice has permissions to create a blog post, but Bob does not. - return getPrivilegesForUser(user).then(function(privs){ - return privs.can_create_blog_post === true; + return results; + }); }); - }; - RSVP.filter(promises, filterFn).then(function(users){ - // true, because the server told us only Alice can create a blog post. - users.length === 1; - // false, because Alice is the only user present in `users` - users[0] === bob; - }); - ``` + } - @method filter - @static - @for RSVP - @param {Array} promises - @param {Function} filterFn - function to be called on each resolved value to - filter the final results. - @param {String} label optional string describing the promise. Useful for - tooling. - @return {Promise} -*/ -function filter(promises, filterFn, label) { - return Promise.all(promises, label).then(function(values) { - if (!isFunction(filterFn)) { - throw new TypeError("You must pass a function as filter's second argument."); + var len = 0; + var vertxNext = undefined; + function asap(callback, arg) { + queue$1[len] = callback; + queue$1[len + 1] = arg; + len += 2; + if (len === 2) { + // If len is 1, that means that we need to schedule an async flush. + // If additional callbacks are queued before the queue is flushed, they + // will be processed by this flush that we are scheduling. + scheduleFlush$1(); + } + } + + var browserWindow = typeof window !== 'undefined' ? window : undefined; + var browserGlobal = browserWindow || {}; + var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; + var isNode = typeof self === '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 () { + return nextTick(flush); + }; + } - var length = values.length; - var filtered = new Array(length); - - for (var i = 0; i < length; i++) { - filtered[i] = filterFn(values[i]); + // vertx + function useVertxTimer() { + if (typeof vertxNext !== 'undefined') { + return function () { + vertxNext(flush); + }; } - - return Promise.all(filtered, label).then(function(filtered) { - var results = new Array(length); - var newLength = 0; - - for (var i = 0; i < length; i++) { - if (filtered[i]) { - results[newLength] = values[i]; - newLength++; - } - } - - results.length = newLength; - - return results; - }); - }); -} - -var len = 0; -var vertxNext; -function asap(callback, arg) { - queue$1[len] = callback; - queue$1[len + 1] = arg; - len += 2; - if (len === 2) { - // If len is 1, that means that we need to schedule an async flush. - // If additional callbacks are queued before the queue is flushed, they - // will be processed by this flush that we are scheduling. - scheduleFlush$1(); + return useSetTimeout(); } -} -var browserWindow = (typeof window !== 'undefined') ? window : undefined; -var browserGlobal = browserWindow || {}; -var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; -var isNode = typeof self === '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() { - nextTick(flush); - }; -} + function useMutationObserver() { + var iterations = 0; + var observer = new BrowserMutationObserver(flush); + var node = document.createTextNode(''); + observer.observe(node, { characterData: true }); -// vertx -function useVertxTimer() { - return function() { - vertxNext(flush); - }; -} + return function () { + return node.data = iterations = ++iterations % 2; + }; + } -function useMutationObserver() { - var iterations = 0; - var observer = new BrowserMutationObserver(flush); - var node = document.createTextNode(''); - observer.observe(node, { characterData: true }); + // web worker + function useMessageChannel() { + var channel = new MessageChannel(); + channel.port1.onmessage = flush; + return function () { + return channel.port2.postMessage(0); + }; + } - return function() { - node.data = (iterations = ++iterations % 2); - }; -} + function useSetTimeout() { + return function () { + return setTimeout(flush, 1); + }; + } -// web worker -function useMessageChannel() { - var channel = new MessageChannel(); - channel.port1.onmessage = flush; - return function () { - channel.port2.postMessage(0); - }; -} + var queue$1 = new Array(1000); -function useSetTimeout() { - return function() { - setTimeout(flush, 1); - }; -} + function flush() { + for (var i = 0; i < len; i += 2) { + var callback = queue$1[i]; + var arg = queue$1[i + 1]; -var queue$1 = new Array(1000); -function flush() { - for (var i = 0; i < len; i+=2) { - var callback = queue$1[i]; - var arg = queue$1[i+1]; + callback(arg); - callback(arg); + queue$1[i] = undefined; + queue$1[i + 1] = undefined; + } - queue$1[i] = undefined; - queue$1[i+1] = undefined; + len = 0; } - len = 0; -} - -function attemptVertex() { - try { - var r = require; - var vertx = r('vertx'); - vertxNext = vertx.runOnLoop || vertx.runOnContext; - return useVertxTimer(); - } catch(e) { - return useSetTimeout(); + function attemptVertex() { + try { + var r = require; + var vertx = r('vertx'); + vertxNext = vertx.runOnLoop || vertx.runOnContext; + return useVertxTimer(); + } catch (e) { + return useSetTimeout(); + } } -} - -var scheduleFlush$1; -// Decide what async method to use to triggering processing of queued callbacks: -if (isNode) { - scheduleFlush$1 = useNextTick(); -} else if (BrowserMutationObserver) { - scheduleFlush$1 = useMutationObserver(); -} else if (isWorker) { - scheduleFlush$1 = useMessageChannel(); -} else if (browserWindow === undefined && typeof require === 'function') { - scheduleFlush$1 = attemptVertex(); -} else { - scheduleFlush$1 = useSetTimeout(); -} -// defaults -config.async = asap; -config.after = function(cb) { - setTimeout(cb, 0); -}; -var cast = resolve$2; -function async(callback, arg) { - config.async(callback, arg); -} + var scheduleFlush$1 = undefined; + // Decide what async method to use to triggering processing of queued callbacks: + if (isNode) { + scheduleFlush$1 = useNextTick(); + } else if (BrowserMutationObserver) { + scheduleFlush$1 = useMutationObserver(); + } else if (isWorker) { + scheduleFlush$1 = useMessageChannel(); + } else if (browserWindow === undefined && typeof require === 'function') { + scheduleFlush$1 = attemptVertex(); + } else { + scheduleFlush$1 = useSetTimeout(); + } -function on() { - config['on'].apply(config, arguments); -} + var platform = undefined; -function off() { - config['off'].apply(config, arguments); -} + /* global self */ + if (typeof self === 'object') { + platform = self; -// Set up instrumentation through `window.__PROMISE_INTRUMENTATION__` -if (typeof window !== 'undefined' && typeof window['__PROMISE_INSTRUMENTATION__'] === 'object') { - var callbacks = window['__PROMISE_INSTRUMENTATION__']; - configure('instrument', true); - for (var eventName in callbacks) { - if (callbacks.hasOwnProperty(eventName)) { - on(eventName, callbacks[eventName]); + /* global global */ + } else if (typeof global === 'object') { + platform = global; + } else { + throw new Error('no global: `self` or `global` found'); } - } -} -exports.cast = cast; -exports.Promise = Promise; -exports.EventTarget = EventTarget; -exports.all = all$1; -exports.allSettled = allSettled; -exports.race = race$1; -exports.hash = hash; -exports.hashSettled = hashSettled; -exports.rethrow = rethrow; -exports.defer = defer; -exports.denodeify = denodeify; -exports.configure = configure; -exports.on = on; -exports.off = off; -exports.resolve = resolve$2; -exports.reject = reject$2; -exports.async = async; -exports.map = map; -exports.filter = filter; + // defaults + config.async = asap; + config.after = function (cb) { + return setTimeout(cb, 0); + }; + var cast = resolve$2; -Object.defineProperty(exports, '__esModule', { value: true }); + var async = function (callback, arg) { + return config.async(callback, arg); + }; + function on() { + config['on'].apply(config, arguments); + } + + function off() { + config['off'].apply(config, arguments); + } + + // Set up instrumentation through `window.__PROMISE_INTRUMENTATION__` + if (typeof window !== 'undefined' && typeof window['__PROMISE_INSTRUMENTATION__'] === 'object') { + var callbacks = window['__PROMISE_INSTRUMENTATION__']; + configure('instrument', true); + for (var eventName in callbacks) { + if (callbacks.hasOwnProperty(eventName)) { + on(eventName, callbacks[eventName]); + } + } + } + + // the default export here is for backwards compat: + // https://github.com/tildeio/rsvp.js/issues/434 + var rsvp = (_rsvp = { + cast: cast, + Promise: Promise, + EventTarget: EventTarget, + all: all$1, + allSettled: allSettled, + race: race$1, + hash: hash, + hashSettled: hashSettled, + rethrow: rethrow, + defer: defer, + denodeify: denodeify, + configure: configure, + on: on, + off: off, + resolve: resolve$2, + reject: reject$2, + map: map + }, _rsvp['async'] = async, _rsvp.filter = // babel seems to error if async isn't a computed prop here... + filter, _rsvp); + + exports.cast = cast; + exports.Promise = Promise; + exports.EventTarget = EventTarget; + exports.all = all$1; + exports.allSettled = allSettled; + exports.race = race$1; + exports.hash = hash; + exports.hashSettled = hashSettled; + exports.rethrow = rethrow; + exports.defer = defer; + exports.denodeify = denodeify; + exports.configure = configure; + exports.on = on; + exports.off = off; + exports.resolve = resolve$2; + exports.reject = reject$2; + exports.map = map; + exports.async = async; + exports.filter = filter; + exports.default = rsvp; }); requireModule("ember"); diff --git a/ember.min.js b/ember.min.js index 0ccdddf69..5cefea8d8 100644 --- a/ember.min.js +++ b/ember.min.js @@ -10,16 +10,599 @@ for(var c=u.deps,p=u.callback,h=new Array(c.length),f=0;f")}function m(e){return"function"!=typeof e.toString?"":String(e)}function v(e,t){return console.info("Use `context`, and `get()` to debug this template."),{context:e,get:t}}function g(e,t){return function(n){var r=n.split(".") +return"this"===r[0]&&(r[0]=null),A(r,t).evaluate(e)}}function y(e){Wt=e}function b(){Wt=v}function _(e,t){return Array.isArray(e)?Qt.compile(e,t):new Pt(e)}function w(e,t,n){var r=C(e,n),i=O(t,n) +return Ze.create(r,i,Xe)}function E(e,t,n,r){var i=C(e,r),o=O(t,r) +return Ze.create(i,o,n)}function x(e,t){var n=e[0],r=e[1],i=e[2],o=e[3] +return Ze.create(C(n,t),O(r,t),{default:i,inverse:o})}function C(e,t){if(!e||0===e.length)return We +var n=e.map(function(e){return _(e,t)}) +return Ve.create(n)}function O(e,t){if(!e)return Ye +var n=e[0],r=e[1] +if(0===n.length)return Ye +var i=r.map(function(e){return _(e,t)}) +return new Qe(n,i)}function A(e,t){var n=e[0],r=void 0 +if(null===n){var i=new Ft,o=e.slice(1) +return Mt.create(i,o)}if(r=t.symbolTable.getSymbol("local",n)){var o=e.slice(1),i=new Ut(r,n) +return Mt.create(i,o)}var i=new Ft +return Mt.create(i,e)}function S(){var e=arguments.length<=0||void 0===arguments[0]?new Yt:arguments[0],n=arguments.length<=1||void 0===arguments[1]?new $t:arguments[1] +return e.add("if",function(e,n){var r=e[2],i=e[3],o=e[4],s=e[5],a=w(r,i,n) +n.putArgs(a),n.test("environment"),n.labelled(null,function(e){if(o&&s)e.jumpUnless("ELSE"),e.evaluate(o),e.jump("END"),e.label("ELSE"),e.evaluate(s) +else{if(!o)throw t.unreachable() +e.jumpUnless("END"),e.evaluate(o)}})}),e.add("unless",function(e,n){var r=e[2],i=e[3],o=e[4],s=e[5],a=w(r,i,n) +n.putArgs(a),n.test("environment"),n.labelled(null,function(e){if(o&&s)e.jumpIf("ELSE"),e.evaluate(o),e.jump("END"),e.label("ELSE"),e.evaluate(s) +else{if(!o)throw t.unreachable() +e.jumpIf("END"),e.evaluate(o)}})}),e.add("with",function(e,n){var r=e[2],i=e[3],o=e[4],s=e[5],a=w(r,i,n) +n.putArgs(a),n.test("environment"),n.labelled(null,function(e){if(o&&s)e.jumpUnless("ELSE"),e.evaluate(o),e.jump("END"),e.label("ELSE"),e.evaluate(s) +else{if(!o)throw t.unreachable() +e.jumpUnless("END"),e.evaluate(o)}})}),e.add("each",function(e,n){var r=e[2],i=e[3],o=e[4],s=e[5],a=w(r,i,n) +n.labelled(a,function(e){e.putIterator(),s?e.jumpUnless("ELSE"):e.jumpUnless("END"),e.iter(function(e){e.evaluate(t.unwrap(o))}),s&&(e.jump("END"),e.label("ELSE"),e.evaluate(s))})}),{blocks:e,inlines:n}}function k(e,t){return e.indexOf(t)!==-1}function R(e,t){return(null===e||k(en,e))&&k(nn,t)}function T(e,t){return null!==e&&(k(tn,e)&&k(rn,t))}function N(e,t){return R(e,t)||T(e,t)}function P(e,t,n,r){var i=null +if(null===r||void 0===r)return r +if(a(r))return r.toHTML() +i=t?t.tagName.toUpperCase():null +var o=ve(r) +if(R(i,n)){var s=e.protocolForURL(o) +if(k(Zt,s))return"unsafe:"+o}return T(i,n)?"unsafe:"+o:o}function D(e,t){var n=void 0,r=void 0 +if(t in e)r=t,n="prop" +else{var i=t.toLowerCase() +i in e?(n="prop",r=i):(n="attr",r=t)}return"prop"!==n||"style"!==r.toLowerCase()&&!I(e.tagName,r)||(n="attr"),{normalized:r,type:n}}function I(e,t){var n=on[e.toUpperCase()] +return n&&n[t.toLowerCase()]||!1}function L(e,t){if(!e)return t +if(!F(e))return t +var n=e.createElement("div") +return function(e){function t(){e.apply(this,arguments)}return babelHelpers.inherits(t,e),t.prototype.insertHTMLBefore=function(t,r,i){if(null===i||""===i)return e.prototype.insertHTMLBefore.call(this,t,r,i) +var o=t.tagName.toLowerCase(),s=sn[o] +return void 0===s?e.prototype.insertHTMLBefore.call(this,t,r,i):M(t,s,n,i,r)},t}(t)}function j(e,t){if(!e)return t +if(!F(e))return t +var n=e.createElement("div") +return function(e){function t(){e.apply(this,arguments)}return babelHelpers.inherits(t,e),t.prototype.insertHTMLBefore=function(t,r,i){if(null===r||""===r)return e.prototype.insertHTMLBefore.call(this,t,r,i) +var o=t.tagName.toLowerCase(),s=sn[o] +return void 0===s?e.prototype.insertHTMLBefore.call(this,t,r,i):M(t,s,n,r,i)},t}(t)}function M(e,t,n,r,i){var o=t.before+r+t.after +n.innerHTML=o +for(var s=n,a=0;a" +t.innerHTML=i +var o=G(t.firstChild,e,r),s=o[0],a=o[1] +return new st(e,s,a)}function B(e,n){var r=e.createElementNS(n,"svg") +try{r.insertAdjacentHTML("beforeEnd","")}catch(e){}finally{return 1!==r.childNodes.length||t.unwrap(r.firstChild).namespaceURI!==an}}function q(e,t){return e&&W(e)?function(e){function t(t){e.call(this,t),this.uselessComment=t.createComment("")}return babelHelpers.inherits(t,e),t.prototype.insertHTMLBefore=function(t,n,r){if(null===r)return e.prototype.insertHTMLBefore.call(this,t,n,r) +var i=!1,o=n?n.previousSibling:t.lastChild +o&&o instanceof Text&&(i=!0,t.insertBefore(this.uselessComment,n)) +var s=e.prototype.insertHTMLBefore.call(this,t,n,r) +return i&&t.removeChild(this.uselessComment),s},t}(t):t}function V(e,t){return e&&W(e)?function(e){function t(t){e.call(this,t),this.uselessComment=this.createComment("")}return babelHelpers.inherits(t,e),t.prototype.insertHTMLBefore=function(t,n,r){if(null===n)return e.prototype.insertHTMLBefore.call(this,t,n,r) +var i=!1,o=r?r.previousSibling:t.lastChild +o&&o instanceof Text&&(i=!0,t.insertBefore(this.uselessComment,r)) +var s=e.prototype.insertHTMLBefore.call(this,t,n,r) +return i&&t.removeChild(this.uselessComment),s},t}(t):t}function W(e){var t=e.createElement("div") +return t.innerHTML="first",t.insertAdjacentHTML("beforeEnd","second"),2!==t.childNodes.length}function K(e){return hn.test(e)}function G(e,t,n){for(var r=e.firstChild,i=null,o=r;o;)i=o,o=o.nextSibling,t.insertBefore(i,n) +return[r,i]}function Q(e,t,n,r){var i=t,o=e,s=n,a=s?s.previousSibling:i.lastChild,u=void 0 +if(null===r||""===r)return new st(i,null,null) +null===s?(i.insertAdjacentHTML("beforeEnd",r),u=i.lastChild):s instanceof HTMLElement?(s.insertAdjacentHTML("beforeBegin",r),u=s.previousSibling):(i.insertBefore(o,s),o.insertAdjacentHTML("beforeBegin",r),u=o.previousSibling,i.removeChild(o)) +var l=a?a.nextSibling:i.firstChild +return new st(i,l,u)}function Y(e){return e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function J(e,t,n,r){var i=e.tagName,o=e.namespaceURI===un +if(o)return X(i,t) +var s=D(e,t),a=s.type,u=s.normalized +return"attr"===a?X(i,u):$(i,u)}function $(e,t){return N(e,t)?new _n(t):ne(e,t)?En:re(e,t)?Cn:new bn(t)}function X(e,t){return N(e,t)?new On(t):new yn(t)}function Z(e,t){var n=e.namespaceURI===un,r=D(e,t),i=r.type,o=r.normalized +return n?e.getAttribute(o):"attr"===i?e.getAttribute(o):e[o]}function ee(e){return e===!1||void 0===e||null===e?null:e===!0?"":"function"==typeof e?null:String(e)}function te(e){return null===e||void 0===e}function ne(e,t){return("INPUT"===e||"TEXTAREA"===e)&&"value"===t}function re(e,t){return"OPTION"===e&&"selected"===t}function ie(e){return new Vn(e)}function oe(e,t,n,r){var i=ae(t,n,r),o=i.named,s=i.yields,a=i.partialSymbol,u=i.size +return new Vn(e,o,s,a,u)}function se(e,n){var r=null,i=e.program +return 0!==n.length&&function(){var e=r=t.dict() +n.forEach(function(t){return e[t]=i.size++})}(),new Wn(e,i,r)}function ae(e,n,r){var i=null,o=null,s=1 +0!==n.length&&function(){var e=i=t.dict() +n.forEach(function(t){return e[t]=s++})}(),0!==e.length&&function(){var n=o=t.dict() +e.forEach(function(e){return n[e]=s++})}() +var a=r?s++:null +return{named:o,yields:i,partialSymbol:a,size:s}}function ue(e,t){var n=Gn.specialize(e,t.symbolTable) +Gt.compile(n,t)}function le(e,t,n){var r=e.statements +return new nr(n,t,r).scan()}function ce(e,t){var n=new rr(t) +return e.compile(n),n.compile()}function pe(e){var t=e[0] +return"open-element"===t||"open-primitive-element"===t}function he(e,t){return new pr(t,e)}function fe(e,t,n,r){return Pe.construct(e,null,t,n,r)}function de(e){return e&&"function"==typeof e.compile}function me(e){return null===e||void 0===e||"function"!=typeof e.toString}function ve(e){return me(e)?"":String(e)}function ge(e){return me(e)?"":l(e)?e:a(e)?e.toHTML():u(e)?e:String(e)}function ye(e){return me(e)?"":l(e)?e:a(e)||u(e)?e:String(e)}function be(e){var n=e.id,r=e.meta,i=e.block,o=void 0,s=n||"client-"+Rr++,a=function(e,n){var a=n?t.assign({},n,r):r +return o||(o=JSON.parse(i)),_e(o,s,a,e)} +return{id:s,meta:r,create:a}}function _e(e,t,n,r){var i=new tr(e,n,r),o=void 0,s=function(){return o||(o=i.scanEntryPoint()),o},a=void 0,u=function(){return a||(a=i.scanLayout()),a},l=function(e){return i.scanPartial(e)},c=function(e,t,n){var i=St.forInitialRender(r,t,null),o=s().compile(r),a=Ln.initial(r,e,n,i,o.symbols) +return a.execute(o.slice)} +return{id:t,meta:n,_block:e,asEntryPoint:s,asLayout:u,asPartial:l,render:c}}function we(e,t,n){var r=e.dynamicScope(),i=t.positional.at(0) +return new Tr(r,i)}var Ee=function(e){function t(t){e.call(this,t)}return babelHelpers.inherits(t,e),t.create=function(e){return void 0===e?Oe:null===e?Ae:e===!0?Se:e===!1?ke:"number"==typeof e?new Ce(e):new xe(e)},t.prototype.get=function(e){return Oe},t}(n.ConstReference),xe=function(e){function t(){e.apply(this,arguments),this.lengthReference=null}return babelHelpers.inherits(t,e),t.prototype.get=function(t){if("length"===t){var n=this.lengthReference +return null===n&&(n=this.lengthReference=new Ce(this.inner.length)),n}return e.prototype.get.call(this,t)},t}(Ee),Ce=function(e){function t(t){e.call(this,t)}return babelHelpers.inherits(t,e),t}(Ee),Oe=new Ce(void 0),Ae=new Ce(null),Se=new Ce(!0),ke=new Ce(!1),Re=function(){function e(e){this.inner=e,this.tag=e.tag}return e.prototype.value=function(){return this.toBool(this.inner.value())},e.prototype.toBool=function(e){return!!e},e}(),Te=function(){function e(){this.references=[],this.strings=[],this.expressions=[],this.arrays=[],this.slices=[],this.blocks=[],this.functions=[],this.others=[],this.NULL_REFERENCE=this.reference(Ae),this.UNDEFINED_REFERENCE=this.reference(Oe)}return e.prototype.getReference=function(e){return this.references[e-1]},e.prototype.reference=function(e){var t=this.references.length +return this.references.push(e),t+1},e.prototype.getString=function(e){return this.strings[e-1]},e.prototype.string=function(e){var t=this.strings.length +return this.strings.push(e),t+1},e.prototype.getExpression=function(e){return this.expressions[e-1]},e.prototype.expression=function(e){var t=this.expressions.length +return this.expressions.push(e),t+1},e.prototype.getArray=function(e){return this.arrays[e-1]},e.prototype.array=function(e){var t=this.arrays.length +return this.arrays.push(e),t+1},e.prototype.getSlice=function(e){return this.slices[e-1]},e.prototype.slice=function(e){var t=this.slices.length +return this.slices.push(e),t+1},e.prototype.getBlock=function(e){return this.blocks[e-1]},e.prototype.block=function(e){var t=this.blocks.length +return this.blocks.push(e),t+1},e.prototype.getFunction=function(e){return this.functions[e-1]},e.prototype.function=function(e){var t=this.functions.length +return this.functions.push(e),t+1},e.prototype.getOther=function(e){return this.others[e-1]},e.prototype.other=function(e){var t=this.others.length +return this.others.push(e),t+1},e}(),Ne=function(){function e(){this.evaluateOpcode=t.fillNulls(52)}return e.prototype.add=function(e,t){this.evaluateOpcode[e]=t},e.prototype.construct=function(e,t,n,r,i){return[0|e,0|(n||0),0|(r||0),0|(i||0)]},e.prototype.evaluate=function(e,n){t.LOGGER.debug("[VM] OPCODE: "+n.type) +var r=this.evaluateOpcode[n.type] +r(e,n)},e}(),Pe=new Ne,De=function(){function e(){t.initializeGuid(this)}return e.prototype.toJSON=function(){return{guid:this._guid,type:this.type}},e}(),Ie=function(e){function t(){e.apply(this,arguments),this.next=null,this.prev=null}return babelHelpers.inherits(t,e),t}(De) +Pe.add(20,function(e,t){var n=t.op1,r=t.op2,i=e.constants.getOther(n),o=e.constants.getExpression(r),s=null,a=i.evaluate(e) +a&&(s=o.evaluate(e)),e.pushCallerScope(),a&&e.invokeBlock(a,s||null)}),Pe.add(21,function(e){return e.popScope()}),Pe.add(0,function(e){return e.pushChildScope()}),Pe.add(1,function(e){return e.popScope()}),Pe.add(2,function(e){return e.pushDynamicScope()}),Pe.add(3,function(e){return e.popDynamicScope()}),Pe.add(4,function(e,t){var n=t.op1 +e.frame.setOperand(e.constants.getReference(n))}),Pe.add(5,function(e,t){var n=t.op1,r=e.constants.getExpression(n) +e.evaluateOperand(r)}),Pe.add(6,function(e,t){var n=t.op1 +e.evaluateArgs(e.constants.getExpression(n))}),Pe.add(7,function(e,t){var n=t.op1,r=e.constants.getArray(n) +e.bindPositionalArgs(r)}),Pe.add(8,function(e,t){var n=t.op1,r=t.op2,i=e.constants.getArray(n),o=e.constants.getArray(r) +e.bindNamedArgs(i,o)}),Pe.add(9,function(e,t){var n=t.op1,r=t.op2,i=e.constants.getArray(n),o=e.constants.getArray(r) +e.bindBlocks(i,o)}),Pe.add(10,function(e,t){var n=t.op1 +e.bindPartialArgs(n)}),Pe.add(11,function(e){return e.bindCallerScope()}),Pe.add(12,function(e,t){var n=t.op1,r=e.constants.getArray(n) +e.bindDynamicScope(r)}),Pe.add(13,function(e,t){var n=t.op1 +return e.enter(n)}),Pe.add(14,function(e){return e.exit()}),Pe.add(15,function(e,t){var n=t.op1,r=e.constants.getBlock(n),i=e.frame.getArgs() +e.invokeBlock(r,i)}),Pe.add(16,function(e,t){var n=t.op1 +return e.goto(n)}),Pe.add(17,function(e,t){var r=t.op1,i=e.frame.getCondition() +if(n.isConst(i))i.value()&&e.goto(r) +else{var o=new n.ReferenceCache(i) +o.peek()&&e.goto(r),e.updateWith(new Fe(o))}}),Pe.add(18,function(e,t){var r=t.op1,i=e.frame.getCondition() +if(n.isConst(i))i.value()||e.goto(r) +else{var o=new n.ReferenceCache(i) +o.peek()||e.goto(r),e.updateWith(new Fe(o))}}) +var Le=function(e,t){return new n.ConstReference(!!e.value())},je=function(e,t){return e},Me=function(e,t){return t.toConditionalReference(e)} +Pe.add(19,function(e,t){var n=t.op1,r=e.frame.getOperand(),i=e.constants.getFunction(n) +e.frame.setCondition(i(r,e.env))}) +var Fe=function(e){function t(t){e.call(this),this.type="assert",this.tag=t.tag,this.cache=t}return babelHelpers.inherits(t,e),t.prototype.evaluate=function(e){var t=this.cache +n.isModified(t.revalidate())&&e.throw()},t.prototype.toJSON=function(){var e=this.type,t=this._guid,n=this.cache,r=void 0 +try{r=JSON.stringify(n.peek())}catch(e){r=String(n.peek())}return{guid:t,type:e,args:[],details:{expected:r}}},t}(Ie),Ue=function(e){function t(t,n){e.call(this),this.target=n,this.type="jump-if-not-modified",this.tag=t,this.lastRevision=t.value()}return babelHelpers.inherits(t,e),t.prototype.evaluate=function(e){var t=this.tag,n=this.target,r=this.lastRevision +!e.alwaysRevalidate&&t.validate(r)&&e.goto(n)},t.prototype.didModify=function(){this.lastRevision=this.tag.value()},t.prototype.toJSON=function(){return{guid:this._guid,type:this.type,args:[JSON.stringify(this.target.inspect())]}},t}(Ie),He=function(e){function t(t){e.call(this),this.target=t,this.type="did-modify",this.tag=n.CONSTANT_TAG}return babelHelpers.inherits(t,e),t.prototype.evaluate=function(){this.target.didModify()},t}(Ie),ze=function(){function e(e){this.tag=n.CONSTANT_TAG,this.type="label",this.label=null,this.prev=null,this.next=null,t.initializeGuid(this),e&&(this.label=e)}return e.prototype.evaluate=function(){},e.prototype.inspect=function(){return this.label+" ["+this._guid+"]"},e.prototype.toJSON=function(){return{guid:this._guid,type:this.type,args:[JSON.stringify(this.inspect())]}},e}(),Be=t.HAS_NATIVE_WEAKMAP?Object.freeze([]):[],qe=t.HAS_NATIVE_WEAKMAP?Object.freeze(t.dict()):t.dict(),Ve=function(){function e(e){this.values=e,this.length=e.length}return e.create=function(e){return e.length?new this(e):We},e.empty=function(){return We},e.prototype.evaluate=function(e){for(var t=this.values,n=this.length,r=new Array(n),i=0;i"},t}(Ve)),Ke=function(){function e(e){this.values=e,this.tag=n.combineTagged(e),this.length=e.length}return e.create=function(e){return new this(e)},e.empty=function(){return Ge},e.prototype.at=function(e){var t=this.values,n=this.length +return e0){for(var r=[],i=0;i"},t}(Qe)),Je=function(){function e(e,r){var i=arguments.length<=2||void 0===arguments[2]?null:arguments[2] +this.keys=e,this.values=r,this._map=i,this.tag=n.combineTagged(r),this.length=e.length,t.assert(e.length===r.length,"Keys and values do not have the same length")}return e.create=function(e){var t=Object.keys(e),n=t.length +if(n>0){for(var r=new Array(n),i=0;i element stack "+this.elementStack.toArray().map(function(e){return e.tagName}).join(", ")),this.element=t.expect(e.current,"can't pop past the last element"),this.nextSibling=n.current,r},e.prototype.pushSimpleBlock=function(){var e=new kt(this.element) +return this.pushBlockTracker(e),e},e.prototype.pushUpdatableBlock=function(){var e=new Tt(this.element) +return this.pushBlockTracker(e),e},e.prototype.pushBlockTracker=function(e){var t=!(arguments.length<=1||void 0===arguments[1])&&arguments[1],n=this.blockStack.current +return null!==n&&(n.newDestroyable(e),t||n.newBounds(e)),this.blockStack.push(e),e},e.prototype.pushBlockList=function(e){var t=new Nt(this.element,e),n=this.blockStack.current +return null!==n&&(n.newDestroyable(t),n.newBounds(t)),this.blockStack.push(t),t},e.prototype.popBlock=function(){return this.block().finalize(this),t.expect(this.blockStack.pop(),"Expected popBlock to return a block")},e.prototype.openElement=function(e){var t=arguments.length<=1||void 0===arguments[1]?this.defaultOperations:arguments[1],n=this.dom.createElement(e,this.element) +return this.constructing=n,this.operations=t,n},e.prototype.flushElement=function(){var e=this.element,n=t.expect(this.constructing,"flushElement should only be called when constructing an element") +this.dom.insertBefore(e,n,this.nextSibling),this.constructing=null,this.operations=null,this.pushElement(n),this.block().openElement(n)},e.prototype.pushRemoteElement=function(e){this.pushElement(e) +var t=new Rt(e) +this.pushBlockTracker(t,!0)},e.prototype.popRemoteElement=function(){this.popBlock(),this.popElement()},e.prototype.pushElement=function(e){this.element=e,this.elementStack.push(e),t.LOGGER.debug("-> element stack "+this.elementStack.toArray().map(function(e){return e.tagName}).join(", ")),this.nextSibling=null,this.nextSiblingStack.push(null)},e.prototype.newDestroyable=function(e){this.block().newDestroyable(e)},e.prototype.newBounds=function(e){this.block().newBounds(e)},e.prototype.appendText=function(e){var t=this.dom,n=t.createTextNode(e) +return t.insertBefore(this.element,n,this.nextSibling),this.block().newNode(n),n},e.prototype.appendComment=function(e){var t=this.dom,n=t.createComment(e) +return t.insertBefore(this.element,n,this.nextSibling),this.block().newNode(n),n},e.prototype.setStaticAttribute=function(e,t){this.expectOperations("setStaticAttribute").addStaticAttribute(this.expectConstructing("setStaticAttribute"),e,t)},e.prototype.setStaticAttributeNS=function(e,t,n){this.expectOperations("setStaticAttributeNS").addStaticAttributeNS(this.expectConstructing("setStaticAttributeNS"),e,t,n)},e.prototype.setDynamicAttribute=function(e,t,n){this.expectOperations("setDynamicAttribute").addDynamicAttribute(this.expectConstructing("setDynamicAttribute"),e,t,n)},e.prototype.setDynamicAttributeNS=function(e,t,n,r){this.expectOperations("setDynamicAttributeNS").addDynamicAttributeNS(this.expectConstructing("setDynamicAttributeNS"),e,t,n,r)},e.prototype.closeElement=function(){this.block().closeElement(),this.popElement()},e}(),kt=function(){function e(e){this.parent=e,this.first=null,this.last=null,this.destroyables=null,this.nesting=0}return e.prototype.destroy=function(){var e=this.destroyables +if(e&&e.length)for(var t=0;t0?e.join(""):null},t}(n.CachedReference),Vt=function(e){function t(t,n){e.call(this),this.func=t,this.symbolTable=n,this.type="function",this.func=t}return babelHelpers.inherits(t,e),t.prototype.evaluate=function(e){var t=this.func,n=this.symbolTable +return t(e,n)},t.prototype.toJSON=function(){var e=this.func +return e.name?"`"+e.name+"(...)`":"`func(...)`"},t}(mt),Wt=v,Kt=function(){function e(){this.names=t.dict(),this.funcs=[]}return e.prototype.add=function(e,t){this.funcs.push(t),this.names[e]=this.funcs.length-1},e.prototype.compile=function(e,n){var r=e[0],i=this.names[r],o=this.funcs[i] +return t.assert(!!o,"expected an implementation for "+e[0]),o(e,n)},e}(),Gt=new Kt +Gt.add("text",function(e,t){t.text(e[1])}),Gt.add("comment",function(e,t){t.comment(e[1])}),Gt.add("close-element",function(e,n){t.LOGGER.trace("close-element statement"),n.closeElement()}),Gt.add("flush-element",function(e,t){t.flushElement()}),Gt.add("modifier",function(e,t){var n=e[1],r=e[2],i=e[3],o=w(r,i,t) +if(!t.env.hasModifier(n,t.symbolTable))throw new Error("Compile Error "+n.join(".")+" is not a modifier: Helpers may not be used in the element form.") +t.modifier(n[0],o)}),Gt.add("static-attr",function(e,t){var n=e[1],r=e[2],i=e[3] +t.staticAttr(n,i,r)}),Gt.add("any-dynamic-attr",function(e,t){var n=e[1],r=e[2],i=e[3],o=e[4] +t.putValue(r),i?t.dynamicAttrNS(n,i,o):t.dynamicAttr(n,o)}),Gt.add("open-element",function(e,n){t.LOGGER.trace("open-element statement"),n.openPrimitiveElement(e[1])}),Gt.add("optimized-append",function(e,t){var n=e[1],r=e[2],i=t.env.macros(),o=i.inlines,s=o.compile(e,t)||n +s!==!0&&(t.putValue(s[1]),r?t.trustingAppend():t.cautiousAppend())}),Gt.add("unoptimized-append",function(e,t){var n=e[1],r=e[2],i=t.env.macros(),o=i.inlines,s=o.compile(e,t)||n +s!==!0&&(r?t.guardedTrustingAppend(s[1]):t.guardedCautiousAppend(s[1]))}),Gt.add("nested-block",function(e,t){var n=t.env.macros(),r=n.blocks +r.compile(e,t)}),Gt.add("scanned-block",function(e,t){var n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],a=o&&o.scan(),u=s&&s.scan(),l=t.env.macros(),c=l.blocks +c.compile(["nested-block",n,r,i,a,u],t)}),Gt.add("scanned-component",function(e,t){var n=e[1],r=e[2],i=e[3],o=e[4],s=o&&o.scan(),a=E(null,i,{default:s,inverse:null},t),u=t.env.getComponentDefinition([n],t.symbolTable) +t.putComponentDefinition(u),t.openComponent(a,r.scan()),t.closeComponent()}),Gt.add("static-partial",function(e,t){var n=e[1] +if(!t.env.hasPartial(n,t.symbolTable))throw new Error('Compile Error: Could not find a partial named "'+n+'"') +var r=t.env.lookupPartial(n,t.symbolTable) +t.putPartialDefinition(r),t.evaluatePartial()}),Gt.add("dynamic-partial",function(e,t){var n=e[1] +t.startLabels(),t.putValue(n),t.test("simple"),t.enter("BEGIN","END"),t.label("BEGIN"),t.jumpUnless("END"),t.putDynamicPartialDefinition(),t.evaluatePartial(),t.label("END"),t.exit(),t.stopLabels()}),Gt.add("yield",function(e,t){var n=e[1],r=e[2],i=w(r,null,t) +t.yield(i,n)}),Gt.add("debugger",function(e,t){return t.putValue(["function",function(e){var n=e.getSelf().value(),r=function(n){return g(e,t)(n).value()} +Wt(n,r)}]),e}) +var Qt=new Kt +Qt.add("unknown",function(e,t){var n=e[1] +return t.env.hasHelper(n,t.symbolTable)?new zt(n,t.env.lookupHelper(n,t.symbolTable),Ze.empty(),t.symbolTable):A(n,t)}),Qt.add("concat",function(e,t){var n=e[1].map(function(e){return _(e,t)}) +return new Bt(n)}),Qt.add("function",function(e,t){return new Vt(e[1],t.symbolTable)}),Qt.add("helper",function(e,t){var n=t.env,r=t.symbolTable,i=e[1],o=e[2],s=e[3] +if(n.hasHelper(i,r)){var a=w(o,s,t) +return new zt(i,n.lookupHelper(i,r),a,r)}throw new Error("Compile Error: "+i.join(".")+" is not a helper")}),Qt.add("get",function(e,t){return A(e[1],t)}),Qt.add("undefined",function(e,t){return new Pt(void 0)}),Qt.add("arg",function(e,t){var n=e[1],r=n[0],i=void 0,o=void 0 +if(i=t.symbolTable.getSymbol("named",r)){var s=n.slice(1),a=new Ut(i,r) +return Mt.create(a,s)}if(o=t.symbolTable.getPartialArgs()){var s=n.slice(1),a=new Ht(o,r) +return Mt.create(a,s)}throw new Error("[BUG] @"+n.join(".")+" is not a valid lookup path.")}),Qt.add("has-block",function(e,t){var n=e[1],r=void 0,i=void 0 +if(r=t.symbolTable.getSymbol("yields",n)){var o=new Lt(r,n) +return new Dt(o)}if(i=t.symbolTable.getPartialArgs()){var o=new jt(i,n) +return new Dt(o)}throw new Error("[BUG] ${blockName} is not a valid block name.")}),Qt.add("has-block-params",function(e,t){var n=e[1],r=void 0,i=void 0 +if(r=t.symbolTable.getSymbol("yields",n)){var o=new Lt(r,n) +return new It(o)}if(i=t.symbolTable.getPartialArgs()){var o=new jt(i,n) +return new It(o)}throw new Error("[BUG] ${blockName} is not a valid block name.")}) +var Yt=function(){function e(){this.names=t.dict(),this.funcs=[]}return e.prototype.add=function(e,t){this.funcs.push(t),this.names[e]=this.funcs.length-1},e.prototype.addMissing=function(e){this.missing=e},e.prototype.compile=function(e,n){var r=e[1][0],i=this.names[r] +if(void 0===i){t.assert(!!this.missing,r+" not found, and no catch-all block handler was registered") +var o=this.missing,s=o(e,n) +t.assert(!!s,r+" not found, and the catch-all block handler didn't handle it")}else{var o=this.funcs[i] +o(e,n)}},e}(),Jt=new Yt,$t=function(){function e(){this.names=t.dict(),this.funcs=[]}return e.prototype.add=function(e,t){this.funcs.push(t),this.names[e]=this.funcs.length-1},e.prototype.addMissing=function(e){this.missing=e},e.prototype.compile=function(e,t){var n=e[1] +if(!Array.isArray(n))return["expr",n] +var r=void 0,i=void 0,o=void 0 +if("helper"===n[0])r=n[1],i=n[2],o=n[3] +else{if("unknown"!==n[0])return["expr",n] +r=n[1],i=o=null}if(r.length>1&&!i&&!o)return["expr",n] +var s=r[0],a=this.names[s] +if(void 0===a&&this.missing){var u=this.missing,l=u(r,i,o,t) +return l===!1?["expr",n]:l}if(void 0!==a){var u=this.funcs[a],l=u(r,i,o,t) +return l===!1?["expr",n]:l}return["expr",n]},e}(),Xt=new $t +S(Jt,Xt) +var Zt=["javascript:","vbscript:"],en=["A","BODY","LINK","IMG","IFRAME","BASE","FORM"],tn=["EMBED"],nn=["href","src","background","action"],rn=["src"],on={BUTTON:{type:!0,form:!0},INPUT:{type:!0,form:!0,autocorrect:!0,list:!0},SELECT:{form:!0},OPTION:{form:!0},TEXTAREA:{form:!0},LABEL:{form:!0},FIELDSET:{form:!0},LEGEND:{form:!0},OBJECT:{form:!0}},sn={colgroup:{depth:2,before:"",after:"
    "},table:{depth:1,before:"",after:"
    "},tbody:{depth:2,before:"",after:"
    "},tfoot:{depth:2,before:"",after:"
    "},thead:{depth:2,before:"",after:"
    "},tr:{depth:3,before:"",after:"
    "}},an="http://www.w3.org/2000/svg",un="http://www.w3.org/2000/svg",ln={foreignObject:1,desc:1,title:1},cn=Object.create(null);["b","big","blockquote","body","br","center","code","dd","div","dl","dt","em","embed","h1","h2","h3","h4","h5","h6","head","hr","i","img","li","listing","main","meta","nobr","ol","p","pre","ruby","s","small","span","strong","strike","sub","sup","table","tt","u","ul","var"].forEach(function(e){return cn[e]=1}) +var pn,hn=/[\t-\r \xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/,fn="undefined"==typeof document?null:document;(function(e){var t=function(){function e(e){this.document=e,this.setupUselessElement()}return e.prototype.setupUselessElement=function(){this.uselessElement=this.document.createElement("div")},e.prototype.createElement=function(e,t){var n=void 0,r=void 0 +if(t?(n=t.namespaceURI===un||"svg"===e,r=ln[t.tagName]):(n="svg"===e,r=!1),n&&!r){if(cn[e])throw new Error("Cannot create a "+e+" inside an SVG context") +return this.document.createElementNS(un,e)}return this.document.createElement(e)},e.prototype.createElementNS=function(e,t){return this.document.createElementNS(e,t)},e.prototype.setAttribute=function(e,t,n,r){r?e.setAttributeNS(r,t,n):e.setAttribute(t,n)},e.prototype.createTextNode=function(e){return this.document.createTextNode(e)},e.prototype.createComment=function(e){return this.document.createComment(e)},e.prototype.insertBefore=function(e,t,n){e.insertBefore(t,n)},e.prototype.insertHTMLBefore=function(e,t,n){return Q(this.uselessElement,e,n,t)},e}() +e.TreeConstruction=t +var n=t +n=V(fn,n),n=j(fn,n),n=H(fn,n,un),e.DOMTreeConstruction=n})(pn||(pn={})) +var dn=function(){function e(e){this.document=e,this.namespace=null,this.uselessElement=this.document.createElement("div")}return e.prototype.setAttribute=function(e,t,n){e.setAttribute(t,n)},e.prototype.setAttributeNS=function(e,t,n,r){e.setAttributeNS(t,n,r)},e.prototype.removeAttribute=function(e,t){e.removeAttribute(t)},e.prototype.removeAttributeNS=function(e,t,n){e.removeAttributeNS(t,n)},e.prototype.createTextNode=function(e){return this.document.createTextNode(e)},e.prototype.createComment=function(e){return this.document.createComment(e)},e.prototype.createElement=function(e,t){var n=void 0,r=void 0 +if(t?(n=t.namespaceURI===un||"svg"===e,r=ln[t.tagName]):(n="svg"===e,r=!1),n&&!r){if(cn[e])throw new Error("Cannot create a "+e+" inside an SVG context") +return this.document.createElementNS(un,e)}return this.document.createElement(e)},e.prototype.insertHTMLBefore=function(e,t,n){return Q(this.uselessElement,e,t,n)},e.prototype.insertNodeBefore=function(e,t,n){if(Y(t)){var r=t.firstChild,i=t.lastChild +return this.insertBefore(e,t,n),new st(e,r,i)}return this.insertBefore(e,t,n),new at(e,t)},e.prototype.insertTextBefore=function(e,t,n){var r=this.createTextNode(n) +return this.insertBefore(e,r,t),r},e.prototype.insertBefore=function(e,t,n){e.insertBefore(t,n)},e.prototype.insertAfter=function(e,t,n){this.insertBefore(e,t,n.nextSibling)},e}(),mn=dn +mn=q(fn,mn),mn=L(fn,mn),mn=U(fn,mn,un) +var vn=mn,gn=pn.DOMTreeConstruction,yn=function(){function e(e){this.attr=e}return e.prototype.setAttribute=function(e,t,n,r){var i=e.getAppendOperations(),o=ee(n) +te(o)||i.setAttribute(t,this.attr,o,r)},e.prototype.updateAttribute=function(e,t,n,r){null===n||void 0===n||n===!1?r?e.getDOM().removeAttributeNS(t,r,this.attr):e.getDOM().removeAttribute(t,this.attr):this.setAttribute(e,t,n)},e}(),bn=function(e){function t(){e.apply(this,arguments)}return babelHelpers.inherits(t,e),t.prototype.setAttribute=function(e,t,n,r){te(n)||(t[this.attr]=n)},t.prototype.removeAttribute=function(e,t,n){var r=this.attr +n?e.getDOM().removeAttributeNS(t,n,r):e.getDOM().removeAttribute(t,r)},t.prototype.updateAttribute=function(e,t,n,r){t[this.attr]=n,te(n)&&this.removeAttribute(e,t,r)},t}(yn),_n=function(e){function t(){e.apply(this,arguments)}return babelHelpers.inherits(t,e),t.prototype.setAttribute=function(t,n,r){e.prototype.setAttribute.call(this,t,n,P(t,n,this.attr,r))},t.prototype.updateAttribute=function(t,n,r){e.prototype.updateAttribute.call(this,t,n,P(t,n,this.attr,r))},t}(bn),wn=function(e){function t(){e.apply(this,arguments)}return babelHelpers.inherits(t,e),t.prototype.setAttribute=function(e,t,n){var r=t +r.value=ve(n)},t.prototype.updateAttribute=function(e,t,n){var r=t,i=r.value,o=ve(n) +i!==o&&(r.value=o)},t}(yn),En=new wn("value"),xn=function(e){function t(){e.apply(this,arguments)}return babelHelpers.inherits(t,e),t.prototype.setAttribute=function(e,t,n){if(null!==n&&void 0!==n&&n!==!1){var r=t +r.selected=!0}},t.prototype.updateAttribute=function(e,t,n){var r=t +n?r.selected=!0:r.selected=!1},t}(bn),Cn=new xn("selected"),On=function(e){function t(){e.apply(this,arguments)}return babelHelpers.inherits(t,e),t.prototype.setAttribute=function(t,n,r){e.prototype.setAttribute.call(this,t,n,P(t,n,this.attr,r))},t.prototype.updateAttribute=function(t,n,r,i){e.prototype.updateAttribute.call(this,t,n,P(t,n,this.attr,r))},t}(yn),An=function(){function e(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1] +this.callerScope=null,this.slots=e,this.callerScope=t}return e.root=function(t){for(var n=arguments.length<=1||void 0===arguments[1]?0:arguments[1],r=new Array(n+1),i=0;i<=n;i++)r[i]=Oe +return new e(r).init({self:t})},e.prototype.init=function(e){var t=e.self +return this.slots[0]=t,this},e.prototype.getSelf=function(){return this.slots[0]},e.prototype.getSymbol=function(e){return this.slots[e]},e.prototype.getBlock=function(e){return this.slots[e]},e.prototype.getPartialArgs=function(e){return this.slots[e]},e.prototype.bindSymbol=function(e,t){this.slots[e]=t},e.prototype.bindBlock=function(e,t){this.slots[e]=t},e.prototype.bindPartialArgs=function(e,t){this.slots[e]=t},e.prototype.bindCallerScope=function(e){this.callerScope=e},e.prototype.getCallerScope=function(){return this.callerScope},e.prototype.child=function(){return new e(this.slots.slice(),this.callerScope)},e}(),Sn=function(){function e(){this.scheduledInstallManagers=[],this.scheduledInstallModifiers=[],this.scheduledUpdateModifierManagers=[],this.scheduledUpdateModifiers=[],this.createdComponents=[],this.createdManagers=[],this.updatedComponents=[],this.updatedManagers=[],this.destructors=[]}return e.prototype.didCreate=function(e,t){this.createdComponents.push(e),this.createdManagers.push(t)},e.prototype.didUpdate=function(e,t){this.updatedComponents.push(e),this.updatedManagers.push(t)},e.prototype.scheduleInstallModifier=function(e,t){this.scheduledInstallManagers.push(t),this.scheduledInstallModifiers.push(e)},e.prototype.scheduleUpdateModifier=function(e,t){this.scheduledUpdateModifierManagers.push(t),this.scheduledUpdateModifiers.push(e)},e.prototype.didDestroy=function(e){this.destructors.push(e)},e.prototype.commit=function(){for(var e=this.createdComponents,t=this.createdManagers,n=0;n=t[n]?i=n+2:o=n return e>=t[i]?i+2:i}function a(e,t,n){this.name=e,this.globalOptions=n||{},this.options=t,this._queue=[],this.targetQueues={},this._queueBeingFlushed=void 0}function u(e,n){var r=this.queues={} this.queueNames=e=e||[],this.options=n,t(e,function(e){r[e]=new a(e,n[e],n)})}function l(e){throw new Error("You attempted to schedule an action in a queue ("+e+") that doesn't exist")}function c(e){throw new Error("You attempted to schedule an action in a queue ("+e+") for a method that doesn't exist")}function p(e,t){this.queueNames=e,this.options=t||{},this.options.defaultQueue||(this.options.defaultQueue=e[0]),this.instanceStack=[],this._debouncees=[],this._throttlers=[],this._eventCallbacks={end:[],begin:[]} var n=this -this._boundClearItems=function(){v()},this._timerTimeoutId=void 0,this._timers=[],this._platform=this.options._platform||{setTimeout:function(e,t){return setTimeout(e,t)},clearTimeout:function(e){clearTimeout(e)}},this._boundRunExpiredTimers=function(){n._runExpiredTimers()}}function h(e){return e.onError||e.onErrorTarget&&e.onErrorTarget[e.onErrorMethod]}function f(e){var t=e._platform.setTimeout -e.begin(),e._autorun=t(function(){e._autorun=null,e.end()},0)}function m(e,t,n){return g(e,t,n)}function d(e,t,n){return g(e,t,n)}function g(e,t,n){for(var r,i=-1,o=0,s=n.length;o0?t.apply(e,n):t.call(e)},invokeWithOnError:function(e,t,n,r,i){try{n&&n.length>0?t.apply(e,n):t.call(e)}catch(e){r(e,i)}},flush:function(e){var t=this._queue,r=t.length if(0!==r){var i,o,s,a,u=this.globalOptions,l=this.options,c=l&&l.before,p=l&&l.after,h=u.onError||u.onErrorTarget&&u.onErrorTarget[u.onErrorMethod],f=h?this.invokeWithOnError:this.invoke this.targetQueues=Object.create(null) -var m=this._queueBeingFlushed=this._queue.slice() +var d=this._queueBeingFlushed=this._queue.slice() this._queue=[],c&&c() -for(var d=0;d0&&this.flush(!0)}},cancel:function(e){var t,n,r,i,o=this._queue,s=e.target,a=e.method,u=this.globalOptions.GUID_KEY if(u&&this.targetQueues&&s){var l=this.targetQueues[s[u]] if(l)for(r=0,i=l.length;r3){i=new Array(o-3) for(var a=3;a-1?this._throttlers[l]:(c=this._platform.setTimeout(function(){p||r.run.apply(r,o) -var n=d(e,t,r._throttlers) +return i(p)||n(p)?(a=p,p=!0):a=o.pop(),a=parseInt(a,10),l=m(e,t,this._throttlers),l>-1?this._throttlers[l]:(c=this._platform.setTimeout(function(){p||r.run.apply(r,o) +var n=m(e,t,r._throttlers) n>-1&&r._throttlers.splice(n,1)},a),p&&this.run.apply(this,o),u=[e,t,c],this._throttlers.push(u),u)},debounce:function(e,t){for(var r=this,o=new Array(arguments.length),s=0;s-1&&(l=this._debouncees[u],this._debouncees.splice(u,1),this._platform.clearTimeout(l[2])),c=this._platform.setTimeout(function(){p||r.run.apply(r,o) -var n=m(e,t,r._debouncees) +return i(p)||n(p)?(a=p,p=!1):a=o.pop(),a=parseInt(a,10),u=d(e,t,this._debouncees),u>-1&&(l=this._debouncees[u],this._debouncees.splice(u,1),this._platform.clearTimeout(l[2])),c=this._platform.setTimeout(function(){p||r.run.apply(r,o) +var n=d(e,t,r._debouncees) n>-1&&r._debouncees.splice(n,1)},a),p&&u===-1&&r.run.apply(r,o),l=[e,t,c],r._debouncees.push(l),l},cancelTimers:function(){t(this._throttlers,this._boundClearItems),this._throttlers=[],t(this._debouncees,this._boundClearItems),this._debouncees=[],this._clearTimerTimeout(),this._timers=[],this._autorun&&(this._platform.clearTimeout(this._autorun),this._autorun=null)},hasTimers:function(){return!!this._timers.length||!!this._debouncees.length||!!this._throttlers.length||this._autorun},cancel:function(e){var t=typeof e if(e&&"object"===t&&e.queue&&e.method)return e.queue.cancel(e) -if("function"!==t)return"[object Array]"===Object.prototype.toString.call(e)?this._cancelItem(d,this._throttlers,e)||this._cancelItem(m,this._debouncees,e):void 0 +if("function"!==t)return"[object Array]"===Object.prototype.toString.call(e)?this._cancelItem(m,this._throttlers,e)||this._cancelItem(d,this._debouncees,e):void 0 for(var n=0,r=this._timers.length;n-1&&(r=t[i],r[2]===n[2])&&(t.splice(i,1),this._platform.clearTimeout(n[2]),!0))},_runExpiredTimers:function(){this._timerTimeoutId=void 0,this.run(this,this._scheduleExpiredTimers)},_scheduleExpiredTimers:function(){for(var e=Date.now(),t=this._timers,n=0,r=t.length;n1){for(var t=arguments[0],n=[],r=void 0,i=1;i0?v(this,this.registry.normalize(e)):g(this)},ownerInjection:function(){var e -return e={},e[t.OWNER]=this.owner,e}}}),s("container/index",["exports","container/registry","container/container"],function(e,t,n){"use strict" -e.Registry=t.default,e.privatize=t.privatize,e.Container=n.default,e.buildFakeContainerWithDeprecations=n.buildFakeContainerWithDeprecations}),s("container/registry",["exports","ember-utils","ember-metal","container/container"],function(e,t,n,r){"use strict" +for(var i=0;i0?x(this,this.registry.normalize(e)):E(this)},A.ownerInjection=function(){var e +return e={},e[t.OWNER]=this.owner,e},A),i.prototype.factoryFor=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=this.registry.normalize(e) +if(!t.source||(n=this.registry.expandLocalLookup(e,t))){var r=this.registry.resolve(n) +if(void 0!==r){var i=new N(this,r,e,n) +return i}}} +var T=function(){function e(e,t,n){this.container=e,this.class=t,this.fullName=n}return e.prototype.create=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0] +return y(this.class,e,this.container,this.fullName)},e}(),N=function(){function e(e,t,n,r){this.container=e,this.class=t,this.fullName=n,this.normalizedName=r}return e.prototype.create=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=g(this.container,this.normalizedName),r=t.assign({},n,e) +if(r[t.NAME_KEY]=this.container.registry.makeToString(this.class,this.fullName),!this.class.create)throw new Error("Failed to create an instance of '"+this.normalizedName+"'. Most likely an improperly defined class or an invalid module export.") +return this.class.prototype&&_(this.class.prototype,this.container),this.class.create(r)},e}()}),s("container/index",["exports","container/registry","container/container"],function(e,t,n){"use strict" +e.Registry=t.default,e.privatize=t.privatize,e.Container=n.default,e.buildFakeContainerWithDeprecations=n.buildFakeContainerWithDeprecations,e.FACTORY_FOR=n.FACTORY_FOR,e.LOOKUP_FACTORY=n.LOOKUP_FACTORY}),s("container/registry",["exports","ember-utils","ember-metal","container/container"],function(e,t,n,r){"use strict" function i(e){this.fallback=e&&e.fallback?e.fallback:null,e&&e.resolver&&(this.resolver=e.resolver,"function"==typeof this.resolver&&o(this)),this.registrations=t.dictionary(e&&e.registrations?e.registrations:null),this._typeInjections=t.dictionary(null),this._injections=t.dictionary(null),this._factoryTypeInjections=t.dictionary(null),this._factoryInjections=t.dictionary(null),this._localLookupCache=new t.EmptyObject,this._normalizeCache=t.dictionary(null),this._resolveCache=t.dictionary(null),this._failCache=t.dictionary(null),this._options=t.dictionary(null),this._typeOptions=t.dictionary(null)}function o(e){e.resolver={resolve:e.resolver}}function s(e,n,r){var i=e._localLookupCache,o=i[n] o||(o=i[n]=new t.EmptyObject) var s=o[r] @@ -168,7 +771,7 @@ if(this.validateFullName(n),e.indexOf(":")===-1)return this.factoryTypeInjection var o=this._factoryInjections[r]||(this._factoryInjections[r]=[]) o.push({property:t,fullName:i})},knownForType:function(e){for(var n=void 0,r=void 0,i=t.dictionary(null),o=Object.keys(this.registrations),s=0;s0){var i="cycle detected: "+t -throw this.each(this.path,function(e){i+=" <- "+e}),new Error(i)}}},e.prototype.reset=function(){this.stack.length=0,this.path.length=0,this.result.length=0 -for(var e=0,t=this.length;e=0){var a=this[s] -if(a.flag)continue -if(a.flag=!0,i.push(s),t===a.key)break -r.push(~s),this.pushIncoming(a)}else i.pop(),o.push(~s)}},e.prototype.pushIncoming=function(e){for(var t=this.stack,n=e.length-1;n>=0;n--){var r=e[n] -this[r].flag||t.push(r)}},e.prototype.each=function(e,t){for(var n=0,r=e.length;n0){var s="cycle detected: "+t +throw this.each(function(e){s+=" <- "+e}),new Error(s)}}},e.prototype.each=function(e){for(var t=this,n=t.result,r=t.vertices,i=0;i-1&&(i=i.replace(/\.(.)/g,function(e){return e.charAt(1).toUpperCase()})),r.indexOf("_")>-1&&(i=i.replace(/_(.)/g,function(e){return e.charAt(1).toUpperCase()})),r.indexOf("-")>-1&&(i=i.replace(/-(.)/g,function(e){return e.charAt(1).toUpperCase()})),n+":"+i}return e},resolve:function(e){var t,n=this.parseName(e),r=n.resolveMethodName -return this[r]&&(t=this[r](n)),t=t||this.resolveOther(n),n.root&&n.root.LOG_RESOLVER&&this._logLookup(t,n),t&&i.default(t,n),t},parseName:function(e){return this._parseNameCache[e]||(this._parseNameCache[e]=this._parseName(e))},_parseName:function(e){var t=e.split(":"),i=t[0],o=t[1],s=o,a=n.get(this,"namespace"),u=a,l=s.lastIndexOf("/"),c=l!==-1?s.slice(0,l):null +return i.indexOf(".")>-1&&(i=i.replace(/\.(.)/g,function(e){return e.charAt(1).toUpperCase()})),r.indexOf("_")>-1&&(i=i.replace(/_(.)/g,function(e){return e.charAt(1).toUpperCase()})),r.indexOf("-")>-1&&(i=i.replace(/-(.)/g,function(e){return e.charAt(1).toUpperCase()})),n+":"+i}return e},resolve:function(e){var t=this.parseName(e),n=t.resolveMethodName,r=void 0 +return this[n]&&(r=this[n](t)),r=r||this.resolveOther(t),r&&i.default(r,t),r},parseName:function(e){return this._parseNameCache[e]||(this._parseNameCache[e]=this._parseName(e))},_parseName:function(e){var t=e.split(":"),i=t[0],o=t[1],s=o,a=n.get(this,"namespace"),u=a,l=s.lastIndexOf("/"),c=l!==-1?s.slice(0,l):null if("template"!==i&&l!==-1){var p=s.split("/") s=p[p.length-1] var h=r.String.capitalize(p.slice(0,-1).join(".")) @@ -306,12 +910,13 @@ e.environment=a}),s("ember-environment/utils",["exports"],function(e){"use stric function t(e){return e!==!1}function n(e){return e===!0}function r(e){return e===!1?{String:!1,Array:!1,Function:!1}:e&&e!==!0?{String:t(e.String),Array:t(e.Array),Function:t(e.Function)}:{String:!0,Array:!0,Function:!0}}e.defaultTrue=t,e.defaultFalse=n,e.normalizeExtendPrototypes=r}),s("ember-extension-support/container_debug_adapter",["exports","ember-metal","ember-runtime"],function(e,t,n){"use strict" e.default=n.Object.extend({resolver:null,canCatalogEntriesByType:function(e){return"model"!==e&&"template"!==e},catalogEntriesByType:function(e){var r=n.A(n.Namespace.NAMESPACES),i=n.A(),o=new RegExp(n.String.classify(e)+"$") return r.forEach(function(e){if(e!==t.default)for(var r in e)if(e.hasOwnProperty(r)&&o.test(r)){var s=e[r] -"class"===n.typeOf(s)&&i.push(n.String.dasherize(r.replace(o,"")))}}),i}})}),s("ember-extension-support/data_adapter",["exports","ember-utils","ember-metal","ember-runtime","ember-application"],function(e,t,n,r,i){"use strict" +"class"===n.typeOf(s)&&i.push(n.String.dasherize(r.replace(o,"")))}}),i}})}),s("ember-extension-support/data_adapter",["exports","ember-utils","ember-metal","ember-runtime","container","ember-application"],function(e,t,n,r,i,o){"use strict" e.default=r.Object.extend({init:function(){this._super.apply(this,arguments),this.releaseMethods=r.A()},containerDebugAdapter:void 0,attributeLimit:3,acceptsModelName:!0,releaseMethods:r.A(),getFilters:function(){return r.A()},watchModelTypes:function(e,t){var n=this,i=this.getModelTypes(),o=r.A(),s=void 0 s=i.map(function(e){var r=e.klass,i=n.wrapModelType(r,e.name) return o.push(n.observeModelType(e.name,t)),i}),e(s) var a=function(){o.forEach(function(e){return e()}),n.releaseMethods.removeObject(a)} -return this.releaseMethods.pushObject(a),a},_nameToClass:function(e){return"string"==typeof e&&(e=t.getOwner(this)._lookupFactory("model:"+e)),e},watchRecords:function(e,t,n,i){function o(e){n([e])}var s=this,a=r.A(),u=this._nameToClass(e),l=this.getRecords(u,e),c=void 0,p=l.map(function(e){return a.push(s.observeRecord(e,o)),s.wrapRecord(e)}),h=function(e,n,u,l){for(var c=n;c1?this.set("models",this._getModels(t)):this.set("models",[])}}) -a.toString=function(){return"LinkComponent"},a.reopenClass({positionalParams:"params"}),e.default=a}),s("ember-glimmer/components/text_area",["exports","ember-glimmer/component","ember-views","ember-glimmer/templates/empty"],function(e,t,n,r){"use strict" +a.toString=function(){return"LinkComponent"},a.reopenClass({positionalParams:"params"}),e.default=a}) +s("ember-glimmer/components/text_area",["exports","ember-glimmer/component","ember-views","ember-glimmer/templates/empty"],function(e,t,n,r){"use strict" e.default=t.default.extend(n.TextSupport,{classNames:["ember-text-area"],layout:r.default,tagName:"textarea",attributeBindings:["rows","cols","name","selectionEnd","selectionStart","wrap","lang","dir","value"],rows:null,cols:null})}),s("ember-glimmer/components/text_field",["exports","ember-utils","ember-metal","ember-environment","ember-glimmer/component","ember-glimmer/templates/empty","ember-views"],function(e,t,n,r,i,o,s){"use strict" function a(e){if(e in l)return l[e] if(!r.environment.hasDOM)return l[e]=e,e u||(u=document.createElement("input")) try{u.type=e}catch(e){}return l[e]=u.type===e}var u=void 0,l=new t.EmptyObject e.default=i.default.extend(s.TextSupport,{layout:o.default,classNames:["ember-text-field"],tagName:"input",attributeBindings:["accept","autocomplete","autosave","dir","formaction","formenctype","formmethod","formnovalidate","formtarget","height","inputmode","lang","list","max","min","multiple","name","pattern","size","step","type","value","width"],value:"",type:n.computed({get:function(){return"text"},set:function(e,t){var n="text" -return a(t)&&(n=t),n}}),size:null,pattern:null,min:null,max:null})}),s("ember-glimmer/dom",["exports","glimmer-runtime","glimmer-node"],function(e,t,n){"use strict" -e.DOMChanges=t.DOMChanges,e.DOMTreeConstruction=t.DOMTreeConstruction,e.NodeDOMTreeConstruction=n.NodeDOMTreeConstruction}),s("ember-glimmer/environment",["exports","ember-utils","ember-metal","ember-views","glimmer-runtime","ember-glimmer/syntax/curly-component","ember-glimmer/syntax","ember-glimmer/syntax/dynamic-component","ember-glimmer/utils/iterable","ember-glimmer/utils/references","ember-glimmer/helpers/if-unless","ember-glimmer/utils/bindings","ember-glimmer/helpers/action","ember-glimmer/helpers/component","ember-glimmer/helpers/concat","ember-glimmer/helpers/debugger","ember-glimmer/helpers/get","ember-glimmer/helpers/hash","ember-glimmer/helpers/loc","ember-glimmer/helpers/log","ember-glimmer/helpers/mut","ember-glimmer/helpers/readonly","ember-glimmer/helpers/unbound","ember-glimmer/helpers/-class","ember-glimmer/helpers/-input-type","ember-glimmer/helpers/query-param","ember-glimmer/helpers/each-in","ember-glimmer/helpers/-normalize-class","ember-glimmer/helpers/-html-safe","ember-glimmer/protocol-for-url","ember-glimmer/modifiers/action"],function(e,t,n,r,i,o,s,a,u,l,p,h,f,m,d,g,v,y,b,_,w,E,O,S,x,C,A,k,T,N,R){"use strict" -var P={textarea:"-text-area"},D=function(e){function D(s){var a=this,u=s[t.OWNER] -e.apply(this,arguments),this.owner=u,this.isInteractive=u.lookup("-environment:main").isInteractive,this.destroyedComponents=void 0,N.default(this),this._definitionCache=new n.Cache(2e3,function(e){var t=e.name,n=e.source,i=e.owner,s=r.lookupComponent(i,t,{source:n}),a=s.component,u=s.layout +return a(t)&&(n=t),n}}),size:null,pattern:null,min:null,max:null})}),s("ember-glimmer/dom",["exports","@glimmer/runtime","@glimmer/node"],function(e,t,n){"use strict" +e.DOMChanges=t.DOMChanges,e.DOMTreeConstruction=t.DOMTreeConstruction,e.NodeDOMTreeConstruction=n.NodeDOMTreeConstruction}),s("ember-glimmer/environment",["exports","ember-utils","ember-metal","ember-views","@glimmer/runtime","ember-glimmer/syntax/curly-component","ember-glimmer/syntax","ember-glimmer/utils/iterable","ember-glimmer/utils/references","ember-glimmer/utils/debug-stack","ember-glimmer/helpers/if-unless","ember-glimmer/helpers/action","ember-glimmer/helpers/component","ember-glimmer/helpers/concat","ember-glimmer/helpers/get","ember-glimmer/helpers/hash","ember-glimmer/helpers/loc","ember-glimmer/helpers/log","ember-glimmer/helpers/mut","ember-glimmer/helpers/readonly","ember-glimmer/helpers/unbound","ember-glimmer/helpers/-class","ember-glimmer/helpers/-input-type","ember-glimmer/helpers/query-param","ember-glimmer/helpers/each-in","ember-glimmer/helpers/-normalize-class","ember-glimmer/helpers/-html-safe","ember-glimmer/protocol-for-url","container","ember-glimmer/modifiers/action"],function(e,t,n,r,i,o,s,a,u,l,c,p,h,f,d,m,v,g,y,b,_,w,E,x,C,O,A,S,k,R){"use strict" +var T=function(e){function l(s){var a=this,u=s[t.OWNER] +e.apply(this,arguments),this.owner=u,this.isInteractive=u.lookup("-environment:main").isInteractive,this.destroyedComponents=void 0,S.default(this),this._definitionCache=new n.Cache(2e3,function(e){var t=e.name,n=e.source,i=e.owner,s=r.lookupComponent(i,t,{source:n}),a=s.component,u=s.layout if(a||u)return new o.CurlyComponentDefinition(t,a,u)},function(e){var n=e.name,r=e.source,i=e.owner,o=r&&i._resolveLocalLookupName(n,r)||n,s=t.guidFor(i) return s+"|"+o}),this._templateCache=new n.Cache(1e3,function(e){var n=e.Template,r=e.owner if(n.create){var i return n.create((i={env:a},i[t.OWNER]=r,i))}return n},function(e){var n=e.Template,r=e.owner return t.guidFor(r)+"|"+n.id}),this._compilerCache=new n.Cache(10,function(e){return new n.Cache(2e3,function(t){var n=new e(t) return i.compileLayout(n,a)},function(e){var n=e.meta.owner -return t.guidFor(n)+"|"+e.id})},function(e){return e.id}),this.builtInModifiers={action:new R.default},this.builtInHelpers={if:p.inlineIf,action:f.default,component:m.default,concat:d.default,debugger:g.default,get:v.default,hash:y.default,loc:b.default,log:_.default,mut:w.default,"query-params":C.default,readonly:E.default,unbound:O.default,unless:p.inlineUnless,"-class":S.default,"-each-in":A.default,"-input-type":x.default,"-normalize-class":k.default,"-html-safe":T.default,"-get-dynamic-var":i.getDynamicVar}}return c.inherits(D,e),D.create=function(e){return new D(e)},D.prototype.refineStatement=function(t,n){var r=e.prototype.refineStatement.call(this,t,n) -if(r)return r -var i=t.appendType,u=t.isSimple,l=t.isInline,c=t.isBlock,p=(t.isModifier,t.key),f=t.path,m=t.args -if(u&&(l||c)&&"get"!==i){var d=s.findSyntaxBuilder(p) -if(d)return d.create(this,m,n) -var g=P[p],v=null -if(g?v=this.getComponentDefinition([g],n):p.indexOf("-")>=0&&(v=this.getComponentDefinition(f,n)),v)return h.wrapComponentClassAttribute(m),new o.CurlyComponentSyntax(m,v,n)}return l&&!u&&"helper"!==i?t.original.deopt():!u&&f?a.DynamicComponentSyntax.fromPath(this,f,m,n):void 0},D.prototype.hasComponentDefinition=function(){return!1},D.prototype.getComponentDefinition=function(e,t){var n=e[0],r=t.getMeta(),i=r.owner,o=r.moduleName&&"template:"+r.moduleName -return this._definitionCache.get({name:n,source:o,owner:i})},D.prototype.getTemplate=function(e,t){return this._templateCache.get({Template:e,owner:t})},D.prototype.getCompiledBlock=function(e,t){var n=this._compilerCache.get(e) -return n.get(t)},D.prototype.hasPartial=function(e,t){var n=t.getMeta(),i=n.owner -return r.hasPartial(e,i)},D.prototype.lookupPartial=function(e,t){var n=t.getMeta(),i=n.owner,o={template:r.lookupPartial(e,i)} +return t.guidFor(n)+"|"+e.id})},function(e){return e.id}),this.builtInModifiers={action:new R.default},this.builtInHelpers={if:c.inlineIf,action:p.default,component:h.default,concat:f.default,get:d.default,hash:m.default,loc:v.default,log:g.default,mut:y.default,"query-params":x.default,readonly:b.default,unbound:_.default,unless:c.inlineUnless,"-class":w.default,"-each-in":C.default,"-input-type":E.default,"-normalize-class":O.default,"-html-safe":A.default,"-get-dynamic-var":i.getDynamicVar}}return babelHelpers.inherits(l,e),l.create=function(e){return new l(e)},l.prototype.macros=function t(){var t=e.prototype.macros.call(this) +return s.populateMacros(t.blocks,t.inlines),t},l.prototype.hasComponentDefinition=function(){return!1},l.prototype.getComponentDefinition=function(e,t){var n=e[0],r=t.getMeta(),i=r.owner,o=r.moduleName&&"template:"+r.moduleName +return this._definitionCache.get({name:n,source:o,owner:i})},l.prototype.getTemplate=function(e,t){return this._templateCache.get({Template:e,owner:t})},l.prototype.getCompiledBlock=function(e,t){var n=this._compilerCache.get(e) +return n.get(t)},l.prototype.hasPartial=function(e,t){var n=t.getMeta(),i=n.owner +return r.hasPartial(e,i)},l.prototype.lookupPartial=function(e,t){var n=t.getMeta(),i=n.owner,o={template:r.lookupPartial(e,i)} if(o.template)return o -throw new Error(e+" is not a partial")},D.prototype.hasHelper=function(e,t){if(e.length>1)return!1 +throw new Error(e+" is not a partial")},l.prototype.hasHelper=function(e,t){if(e.length>1)return!1 var n=e[0] if(this.builtInHelpers[n])return!0 var r=t.getMeta(),i=r.owner,o={source:"template:"+r.moduleName} -return i.hasRegistration("helper:"+n,o)||i.hasRegistration("helper:"+n)},D.prototype.lookupHelper=function(e,t){var n=e[0],r=this.builtInHelpers[n] -if(r)return r -var i=t.getMeta(),o=i.owner,s=i.moduleName&&{source:"template:"+i.moduleName}||{} -if(r=o.lookup("helper:"+n,s)||o.lookup("helper:"+n),r.isHelperInstance)return function(e,t){return l.SimpleHelperReference.create(r.compute,t)} -if(r.isHelperFactory)return function(e,t){return l.ClassBasedHelperReference.create(r,e,t)} -throw new Error(e+" is not a helper")},D.prototype.hasModifier=function(e){return!(e.length>1)&&!!this.builtInModifiers[e[0]]},D.prototype.lookupModifier=function(e){var t=this.builtInModifiers[e[0]] +return i.hasRegistration("helper:"+n,o)||i.hasRegistration("helper:"+n)},l.prototype.lookupHelper=function(e,t){var r=e[0],i=this.builtInHelpers[r] +if(i)return i +var o=t.getMeta(),s=o.owner,a=o.moduleName&&{source:"template:"+o.moduleName}||{},l=function(){var t=s[k.FACTORY_FOR]("helper:"+r,a)||s[k.FACTORY_FOR]("helper:"+r) +if(t.class.isHelperInstance)return{v:function(e,n){return u.SimpleHelperReference.create(t.class.compute,n)}} +if(t.class.isHelperFactory)return n.isFeatureEnabled("ember-no-double-extend")||(t=t.create()),{v:function(e,n){return u.ClassBasedHelperReference.create(t,e,n)}} +throw new Error(e+" is not a helper")}() +return"object"==typeof l?l.v:void 0},l.prototype.hasModifier=function(e){return!(e.length>1)&&!!this.builtInModifiers[e[0]]},l.prototype.lookupModifier=function(e){var t=this.builtInModifiers[e[0]] if(t)return t -throw new Error(e+" is not a modifier")},D.prototype.toConditionalReference=function(e){return l.ConditionalReference.create(e)},D.prototype.iterableFor=function(e,t){var n=t.named.get("key").value() -return u.default(e,n)},D.prototype.scheduleInstallModifier=function(){if(this.isInteractive){var t;(t=e.prototype.scheduleInstallModifier).call.apply(t,[this].concat(c.slice.call(arguments)))}},D.prototype.scheduleUpdateModifier=function(){if(this.isInteractive){var t;(t=e.prototype.scheduleUpdateModifier).call.apply(t,[this].concat(c.slice.call(arguments)))}},D.prototype.didDestroy=function(e){e.destroy()},D.prototype.begin=function(){this.inTransaction=!0,e.prototype.begin.call(this),this.destroyedComponents=[]},D.prototype.commit=function(){for(var t=0;t1?n.String.dasherize(t.at(1).value()):null:o===!1?i>2?n.String.dasherize(t.at(2).value()):null:o}e.default=function(e,n){return new t.InternalHelperReference(r,n)}}) -s("ember-glimmer/helpers/-html-safe",["exports","ember-glimmer/utils/references","ember-glimmer/utils/string"],function(e,t,n){"use strict" +return o===!0?i>1?n.String.dasherize(t.at(1).value()):null:o===!1?i>2?n.String.dasherize(t.at(2).value()):null:o}e.default=function(e,n){return new t.InternalHelperReference(r,n)}}),s("ember-glimmer/helpers/-html-safe",["exports","ember-glimmer/utils/references","ember-glimmer/utils/string"],function(e,t,n){"use strict" function r(e){var t=e.positional,r=t.at(0) return new n.SafeString(r.value())}e.default=function(e,n){return new t.InternalHelperReference(r,n)}}),s("ember-glimmer/helpers/-input-type",["exports","ember-glimmer/utils/references"],function(e,t){"use strict" function n(e){var t=e.positional,n=(e.named,t.at(0).value()) return"checkbox"===n?"-checkbox":"-text-field"}e.default=function(e,r){return new t.InternalHelperReference(n,r)}}),s("ember-glimmer/helpers/-normalize-class",["exports","ember-glimmer/utils/references","ember-runtime"],function(e,t,n){"use strict" function r(e){var t=e.positional,r=(e.named,t.at(0).value().split(".")),i=r[r.length-1],o=t.at(1).value() -return o===!0?n.String.dasherize(i):o||0===o?String(o):""}e.default=function(e,n){return new t.InternalHelperReference(r,n)}}),s("ember-glimmer/helpers/action",["exports","ember-utils","ember-metal","ember-glimmer/utils/references","glimmer-runtime","glimmer-reference"],function(e,t,n,r,i,o){"use strict" +return o===!0?n.String.dasherize(i):o||0===o?String(o):""}e.default=function(e,n){return new t.InternalHelperReference(r,n)}}),s("ember-glimmer/helpers/action",["exports","ember-utils","ember-metal","ember-glimmer/utils/references","@glimmer/runtime","@glimmer/reference"],function(e,t,n,r,i,o){"use strict" function s(e){return e}function a(e,t){var r=null t.length>0&&(r=function(e){return t.value().concat(e)}) var i=null @@ -441,53 +1042,52 @@ return r&&t.length>0&&(t[0]=n.get(t[0],r)),t}),r&&i?function(e){return i(r(e))}: if("function"==typeof r[c])s=r,a=r[c] else{var u=typeof r "string"===u?(s=t,a=t.actions&&t.actions[r]):"function"===u&&(s=e,a=r)}return function(){for(var e=arguments.length,t=Array(e),r=0;r0){for(var h=Math.min(a.length,l.length),f=0;f0){for(var f=Math.min(a.length,c.length),d=0;d=0)return!0 for(var n=0;n1)if(u=a.at(0),p=a.at(1),p[i.INVOKE])c=p else{p._propertyKey c=p.value()}for(var h=[],f=2;f10)throw b=0,y[n].destroy(),new Error("infinite rendering invalidation detected") -return b++,d.join(null,h)}b=0}var m=void 0 -m=n.runInTransaction -var d=n.run.backburner,g=function(){function e(e,t,n,r){this.view=e,this.outletState=t,this.rootOutletState=n}return e.prototype.child=function(){return new e(this.view,this.outletState,this.rootOutletState)},e.prototype.get=function(e){return this.outletState},e.prototype.set=function(e,t){return this.outletState=t,t},e}(),v=function(){function e(e,t,n,r,o,s){var a=this +var o=void 0,s=void 0}),s("ember-glimmer/renderer",["exports","ember-glimmer/utils/references","ember-metal","@glimmer/reference","ember-views","ember-glimmer/component","ember-glimmer/syntax/curly-component","ember-glimmer/syntax/outlet"],function(e,t,n,r,i,o,s,a){"use strict" +function u(e){v.push(e)}function l(e){var t=v.indexOf(e) +v.splice(t,1)}function c(){for(var e=0;e10)throw g=0,v[n].destroy(),new Error("infinite rendering invalidation detected") +return g++,f.join(null,p)}g=0}var f=n.run.backburner,d=function(){function e(e,t,n,r){this.view=e,this.outletState=t,this.rootOutletState=n}return e.prototype.child=function(){return new e(this.view,this.outletState,this.rootOutletState)},e.prototype.get=function(e){return this.outletState},e.prototype.set=function(e,t){return this.outletState=t,t},e}(),m=function(){function e(e,t,n,r,o,s){var a=this this.id=i.getViewId(e),this.env=t,this.root=e,this.result=void 0,this.shouldReflush=!1,this.destroyed=!1,this._removing=!1 var u=this.options={alwaysRevalidate:!1} this.render=function(){var e=a.result=n.render(r,o,s) a.render=function(){e.rerender(u)}}}return e.prototype.isFor=function(e){return this.root===e},e.prototype.destroy=function(){var e=this.result,t=this.env if(this.destroyed=!0,this.env=null,this.root=null,this.result=null,this.render=null,e){var n=!t.inTransaction -n&&t.begin(),e.destroy(),n&&t.commit()}},e}(),y=[] -n.setHasViews(function(){return y.length>0}) -var b=0 -d.on("begin",p),d.on("end",f) -var _=function(){function e(e,t){var n=arguments.length<=2||void 0===arguments[2]?i.fallbackViewRegistry:arguments[2],r=!(arguments.length<=3||void 0===arguments[3])&&arguments[3] +n&&t.begin(),e.destroy(),n&&t.commit()}},e}(),v=[] +n.setHasViews(function(){return v.length>0}) +var g=0 +f.on("begin",c),f.on("end",h) +var y=function(){function e(e,t){var n=arguments.length<=2||void 0===arguments[2]?i.fallbackViewRegistry:arguments[2],r=!(arguments.length<=3||void 0===arguments[3])&&arguments[3] this._env=e,this._rootTemplate=t,this._viewRegistry=n,this._destinedForDOM=r,this._destroyed=!1,this._roots=[],this._lastRevision=null,this._isRenderingRoots=!1,this._removedRoots=[]}return e.prototype.appendOutletView=function(e,t){var n=new a.TopLevelOutletComponentDefinition(e),r=e.toReference(),i=e.outletState.render.controller this._appendDefinition(e,n,t,r,i)},e.prototype.appendTo=function(e,t){var n=new s.RootComponentDefinition(e) -this._appendDefinition(e,n,t)},e.prototype._appendDefinition=function(e,n,i){var o=arguments.length<=3||void 0===arguments[3]?r.UNDEFINED_REFERENCE:arguments[3],s=arguments.length<=4||void 0===arguments[4]?null:arguments[4],a=new t.RootReference(n),u=new g(null,o,o,!0,s),l=new v(e,this._env,this._rootTemplate,a,i,u) +this._appendDefinition(e,n,t)},e.prototype._appendDefinition=function(e,n,i){var o=arguments.length<=3||void 0===arguments[3]?r.UNDEFINED_REFERENCE:arguments[3],s=arguments.length<=4||void 0===arguments[4]?null:arguments[4],a=new t.RootReference(n),u=new d(null,o,o,!0,s),l=new m(e,this._env,this._rootTemplate,a,i,u) this._renderRoot(l)},e.prototype.rerender=function(e){this._scheduleRevalidate()},e.prototype.register=function(e){var t=i.getViewId(e) this._viewRegistry[t]=e},e.prototype.unregister=function(e){delete this._viewRegistry[i.getViewId(e)]},e.prototype.remove=function(e){e._transitionTo("destroying"),this.cleanupRootFor(e),i.setViewElement(e,null),this._destinedForDOM&&e.trigger("didDestroyElement"),e.isDestroying||e.destroy()},e.prototype.cleanupRootFor=function(e){if(!this._destroyed)for(var t=this._roots,n=this._roots.length;n--;){var r=t[n] r.isFor(e)&&r.destroy()}},e.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this._clearAllRoots())},e.prototype.getElement=function(e){},e.prototype.getBounds=function(e){var t=e[o.BOUNDS],n=t.parentElement(),r=t.firstNode(),i=t.lastNode() return{parentElement:n,firstNode:r,lastNode:i}},e.prototype.createElement=function(e){return this._env.getAppendOperations().createElement(e)},e.prototype._renderRoot=function(e){var t=this._roots -t.push(e),1===t.length&&u(this),this._renderRootsTransaction()},e.prototype._renderRoots=function(){var e=this._roots,t=this._env,n=this._removedRoots,i=void 0,o=void 0 -do{t.begin(),o=e.length,i=!1 -for(var s=0;s=o&&!u||(a.options.alwaysRevalidate=u,u=a.shouldReflush=m(a,"render"),i=i||u)}}this._lastRevision=r.CURRENT_TAG.value(),t.commit()}while(i||e.length>o) -for(;n.length;){var a=n.pop(),c=e.indexOf(a) -e.splice(c,1)}0===this._roots.length&&l(this)},e.prototype._renderRootsTransaction=function(){if(!this._isRenderingRoots){this._isRenderingRoots=!0 +t.push(e),1===t.length&&u(this),this._renderRootsTransaction()},e.prototype._renderRoots=function(){var e=this._roots,t=this._env,i=this._removedRoots,o=void 0,s=void 0 +do{t.begin(),s=e.length,o=!1 +for(var a=0;a=s&&!c||(u.options.alwaysRevalidate=c,c=u.shouldReflush=n.runInTransaction(u,"render"),o=o||c)}}this._lastRevision=r.CURRENT_TAG.value(),t.commit()}while(o||e.length>s) +for(;i.length;){var u=i.pop(),p=e.indexOf(u) +e.splice(p,1)}0===this._roots.length&&l(this)},e.prototype._renderRootsTransaction=function(){if(!this._isRenderingRoots){this._isRenderingRoots=!0 var e=!1 try{this._renderRoots(),e=!0}finally{e||(this._lastRevision=r.CURRENT_TAG.value()),this._isRenderingRoots=!1}}},e.prototype._clearAllRoots=function(){for(var e=this._roots,t=0;t-1)return c[t]}e.registerSyntax=a,e.findSyntaxBuilder=u -var l=[],c=[] -a("render",t.RenderSyntax),a("outlet",n.OutletSyntax),a("mount",r.MountSyntax),a("component",i.DynamicComponentSyntax),a("input",o.InputSyntax),a("-with-dynamic-vars",function(){function e(){}return e.create=function(e,t,n){return new s.WithDynamicVarsSyntax(t)},e}()),a("-in-element",function(){function e(){}return e.create=function(e,t,n){return new s.InElementSyntax(t)},e}())}),s("ember-glimmer/syntax/curly-component",["exports","ember-utils","glimmer-runtime","ember-glimmer/utils/bindings","ember-glimmer/component","ember-metal","ember-views","ember-glimmer/utils/process-args","container"],function(e,t,n,r,i,o,s,a,u){"use strict" -function l(e,t){}function p(e,t,n){}function h(e,t){e.named.has("id")&&(t.elementId=t.id)}function f(e,t,n,i){for(var o=[],s=t.length-1;s!==-1;){var a=t[s],u=r.AttributeBinding.parse(a),l=u[1] -o.indexOf(l)===-1&&(o.push(l),r.AttributeBinding.install(e,n,u,i)),s--}o.indexOf("id")===-1&&i.addStaticAttribute(e,"id",n.elementId),o.indexOf("style")===-1&&r.IsVisibleBinding.install(e,n,i)}function m(){}function d(e){return e.instrumentDetails({initialRender:!0})}function g(e){return e.instrumentDetails({initialRender:!1})}function v(e){var t=e.dynamicScope().view.tagName +return new r(n)}})}function v(e){e.register("view:-outlet",o.default),e.register("template:-outlet",f.default),e.injection("view:-outlet","template","template:-outlet"),e.injection("service:-dom-changes","document","service:-document"),e.injection("service:-dom-tree-construction","document","service:-document"),e.register(n.privatize(y),p.default),e.register("service:-glimmer-environment",d.default),e.injection("template","env","service:-glimmer-environment"),e.optionsForType("helper",{instantiate:!1}),e.register("component:-text-field",s.default),e.register("component:-text-area",a.default),e.register("component:-checkbox",u.default),e.register("component:link-to",l.default),e.register(n.privatize(b),c.default)}e.setupApplicationRegistry=m,e.setupEngineRegistry=v +var g=babelHelpers.taggedTemplateLiteralLoose(["template:-root"],["template:-root"]),y=babelHelpers.taggedTemplateLiteralLoose(["template:components/-default"],["template:components/-default"]),b=babelHelpers.taggedTemplateLiteralLoose(["component:-default"],["component:-default"])}),s("ember-glimmer/syntax",["exports","ember-glimmer/syntax/render","ember-glimmer/syntax/outlet","ember-glimmer/syntax/mount","ember-glimmer/syntax/dynamic-component","ember-glimmer/utils/bindings","ember-glimmer/syntax/-with-dynamic-vars","ember-glimmer/syntax/-in-element","ember-glimmer/syntax/input","ember-glimmer/syntax/-text-area","ember-metal"],function(e,t,n,r,i,o,s,a,u,l,c){"use strict" +function p(e,t,n,r){var s=e[0] +if(e.length>1)return i.closureComponentMacro(e,t,n,null,null,r) +var a=r.symbolTable,u=void 0 +return s.indexOf("-")>-1&&(u=r.env.getComponentDefinition(e,a)),!!u&&(o.wrapComponentClassAttribute(n),r.component.static(u,[t,n,null,null],a),!0)}function h(e,t){var n=e[1],r=e[2],s=e[3],a=e[4],u=e[5],l=n[0] +if(n.length>1)return i.closureComponentMacro(n,r,s,a,u,t) +if(l.indexOf("-")===-1)return!1 +var c=t.symbolTable,p=void 0 +return l.indexOf("-")>-1&&(p=t.env.getComponentDefinition(n,c)),!!p&&(o.wrapComponentClassAttribute(s),t.component.static(p,[r,s,a,u],c),!0)}function f(e){m.push(e)}function d(e,o){o.add("outlet",n.outletMacro),o.add("component",i.inlineComponentMacro),o.add("render",t.renderMacro),o.add("mount",r.mountMacro),o.add("input",u.inputMacro),o.add("textarea",l.textAreaMacro),o.addMissing(p),e.add("component",i.blockComponentMacro),e.add("-with-dynamic-vars",s._withDynamicVarsMacro),e.add("-in-element",a._inElementMacro),e.addMissing(h) +for(var c=0;c-1))return i(t,o,s) +var p=u[l] +if(!Array.isArray(p)){if("checkbox"===p){n.wrapComponentClassAttribute(o) +var h=s.env.getComponentDefinition(["-checkbox"],s.symbolTable) +return s.component.static(h,[t,o,null,null],s.symbolTable),!0}return i(t,o,s)}return r.dynamicComponentMacro(t,o,null,null,s)}e.inputMacro=o}),s("ember-glimmer/syntax/mount",["exports","@glimmer/runtime","@glimmer/reference","ember-metal","ember-glimmer/utils/references","ember-routing","ember-glimmer/syntax/outlet","container","ember-glimmer/syntax/abstract-manager"],function(e,t,n,r,i,o,s,a,u){"use strict" +function l(e,t,n,r){var i=t[0] +return r.component.static(new h(i,r.env),[t,n,null,null],r.symbolTable),!0}e.mountMacro=l +var c=function(e){function t(){e.apply(this,arguments)}return babelHelpers.inherits(t,e),t.prototype.prepareArgs=function(e,t){return t},t.prototype.create=function(e,t,r,i){var o=t.name,s=t.env i.outletState=n.UNDEFINED_REFERENCE var a=s.owner.buildChildEngineInstance(o) -return a.boot(),{engine:a}},e.prototype.layoutFor=function(e,t,n){var r=t.engine,i=r.lookup("template:application") -return n.getCompiledBlock(s.OutletLayoutCompiler,i)},e.prototype.getSelf=function(e){var t=e.engine,n=t._lookupFactory("controller:application")||o.generateControllerFactory(t,"application") -return new i.RootReference(n.create())},e.prototype.getTag=function(){return null},e.prototype.getDestructor=function(e){var t=e.engine -return t},e.prototype.didCreateElement=function(){},e.prototype.didRenderLayout=function(){},e.prototype.didCreate=function(e){},e.prototype.update=function(e,t,n){},e.prototype.didUpdateLayout=function(){},e.prototype.didUpdate=function(e){},e}(),l=new u,p=function(e){function t(t,n){e.call(this,t,l,null),this.env=n}return c.inherits(t,e),t}(t.ComponentDefinition)}),s("ember-glimmer/syntax/outlet",["exports","ember-utils","glimmer-runtime","ember-metal","ember-glimmer/utils/references","glimmer-reference"],function(e,t,n,r,i,o){"use strict" -function s(e){var t=e.dynamicScope(),n=t.outletState,r=e.getArgs(),i=void 0 -return i=0===r.positional.length?new o.ConstReference("main"):r.positional.at(0),new h(i,n)}function a(e,t,n){return t||n?!t&&n||t&&!n?null:n.render.template===t.render.template&&n.render.controller===t.render.controller?e:null:e}function u(e){var t=e.render,n=t.name,r=t.outlet -return{object:n+":"+r}}function l(){}var p=function(e){function t(t,r,i){e.call(this),this.definitionArgs=r,this.definition=s,this.args=n.ArgsSyntax.empty(),this.symbolTable=i,this.shadow=null}return c.inherits(t,e),t.create=function(e,t,r){var i=n.ArgsSyntax.fromPositionalArgs(t.positional.slice(0,1)) -return new this(e,i,r)},t.prototype.compile=function(e){e.component.dynamic(this.definitionArgs,this.definition,this.args,this.symbolTable,this.shadow)},t}(n.StatementSyntax) -e.OutletSyntax=p +return a.boot(),{engine:a}},t.prototype.layoutFor=function(e,t,n){var r=t.engine,i=r.lookup("template:application") +return n.getCompiledBlock(s.OutletLayoutCompiler,i)},t.prototype.getSelf=function(e){var t=e.engine,n=t[a.FACTORY_FOR]("controller:application"),r=n||o.generateControllerFactory(t,"application") +return new i.RootReference(r.create())},t.prototype.getTag=function(){return null},t.prototype.getDestructor=function(e){var t=e.engine +return t},t.prototype.didCreateElement=function(){},t.prototype.didRenderLayout=function(){},t.prototype.didCreate=function(e){},t.prototype.update=function(e,t,n){},t.prototype.didUpdateLayout=function(){},t.prototype.didUpdate=function(e){},t}(u.default),p=new c,h=function(e){function t(t,n){e.call(this,t,p,null),this.env=n}return babelHelpers.inherits(t,e),t}(t.ComponentDefinition)}),s("ember-glimmer/syntax/outlet",["exports","ember-utils","@glimmer/runtime","ember-metal","ember-glimmer/utils/references","ember-glimmer/syntax/abstract-manager","@glimmer/reference"],function(e,t,n,r,i,o,s){"use strict" +function a(e){var t=e.dynamicScope(),n=t.outletState,r=e.getArgs(),i=void 0 +return i=0===r.positional.length?new s.ConstReference("main"):r.positional.at(0),new h(i,n)}function u(e,t,r,i){t||(t=[]) +var o=[t.slice(0,1),null,null,null] +return i.component.dynamic(o,a,n.CompiledArgs.empty(),i.symbolTable,null),!0}function l(e,t,n){return t||n?!t&&n||t&&!n?null:n.render.template===t.render.template&&n.render.controller===t.render.controller?e:null:e}function c(e){var t=e.render,n=t.name,r=t.outlet +return{object:n+":"+r}}function p(){}e.outletMacro=u var h=function(){function e(e,t){this.outletNameRef=e,this.parentOutletStateRef=t,this.definition=null,this.lastState=null -var n=this.outletStateTag=new o.UpdatableTag(t.tag) -this.tag=o.combine([n.tag,e.tag])}return e.prototype.value=function(){var e=this.outletNameRef,t=this.parentOutletStateRef,n=this.definition,r=this.lastState,i=e.value(),o=t.get("outlets").get(i),s=this.lastState=o.value() -this.outletStateTag.update(o.tag),n=a(n,r,s) -var u=s&&s.render.template -return n?n:u?this.definition=new _(i,s.render.template):this.definition=null},e}(),f=function(){function e(e){this.outletState=e,this.instrument()}return e.prototype.instrument=function(){this.finalizer=r._instrumentStart("render.outlet",u,this.outletState)},e.prototype.finalize=function(){var e=this.finalizer -e(),this.finalizer=l},e}(),m=function(){function e(){}return e.prototype.prepareArgs=function(e,t){return t},e.prototype.create=function(e,t,n,r){var i=r.outletState=r.outletState.get("outlets").get(t.outletName),o=i.value() -return new f(o)},e.prototype.layoutFor=function(e,t,n){return n.getCompiledBlock(w,e.template)},e.prototype.getSelf=function(e){var t=e.outletState -return new i.RootReference(t.render.controller)},e.prototype.getTag=function(){return null},e.prototype.getDestructor=function(){return null},e.prototype.didRenderLayout=function(e){e.finalize()},e.prototype.didCreateElement=function(){},e.prototype.didCreate=function(e){},e.prototype.update=function(e){},e.prototype.didUpdateLayout=function(e){},e.prototype.didUpdate=function(e){},e}(),d=new m,g=function(e){function t(){e.apply(this,arguments)}return c.inherits(t,e),t.prototype.create=function(e,t,n,r){return new f(r.outletState.value())},t.prototype.layoutFor=function(e,t,n){return n.getCompiledBlock(b,e.template)},t}(m),v=new g,y=function(e){function n(n){e.call(this,"outlet",v,n),this.template=n.template,t.generateGuid(this)}return c.inherits(n,e),n}(n.ComponentDefinition) +var n=this.outletStateTag=new s.UpdatableTag(t.tag) +this.tag=s.combine([n.tag,e.tag])}return e.prototype.value=function(){var e=this.outletNameRef,t=this.parentOutletStateRef,n=this.definition,r=this.lastState,i=e.value(),o=t.get("outlets").get(i),s=this.lastState=o.value() +this.outletStateTag.update(o.tag),n=l(n,r,s) +var a=s&&s.render.template +return n?n:a?this.definition=new _(i,s.render.template):this.definition=null},e}(),f=function(){function e(e){this.outletState=e,this.instrument()}return e.prototype.instrument=function(){this.finalizer=r._instrumentStart("render.outlet",c,this.outletState)},e.prototype.finalize=function(){var e=this.finalizer +e(),this.finalizer=p},e}(),d=function(e){function t(){e.apply(this,arguments)}return babelHelpers.inherits(t,e),t.prototype.prepareArgs=function(e,t){return t},t.prototype.create=function(e,t,n,r){var i=r.outletState=r.outletState.get("outlets").get(t.outletName),o=i.value() +return new f(o)},t.prototype.layoutFor=function(e,t,n){return n.getCompiledBlock(w,e.template)},t.prototype.getSelf=function(e){var t=e.outletState +return new i.RootReference(t.render.controller)},t.prototype.getTag=function(){return null},t.prototype.getDestructor=function(){return null},t.prototype.didRenderLayout=function(e){e.finalize()},t.prototype.didCreateElement=function(){},t.prototype.didCreate=function(e){},t.prototype.update=function(e){},t.prototype.didUpdateLayout=function(e){},t.prototype.didUpdate=function(e){},t}(o.default),m=new d,v=function(e){function t(){e.apply(this,arguments)}return babelHelpers.inherits(t,e),t.prototype.create=function(e,t,n,r){return new f(r.outletState.value())},t.prototype.layoutFor=function(e,t,n){return n.getCompiledBlock(b,e.template)},t}(d),g=new v,y=function(e){function n(n){e.call(this,"outlet",g,n),this.template=n.template,t.generateGuid(this)}return babelHelpers.inherits(n,e),n}(n.ComponentDefinition) e.TopLevelOutletComponentDefinition=y var b=function(){function e(e){this.template=e}return e.prototype.compile=function(e){e.wrapLayout(this.template.asLayout()),e.tag.static("div"),e.attrs.static("id",t.guidFor(this)),e.attrs.static("class","ember-view")},e}() b.id="top-level-outlet" -var _=function(e){function n(n,r){e.call(this,"outlet",d,null),this.outletName=n,this.template=r,t.generateGuid(this)}return c.inherits(n,e),n}(n.ComponentDefinition),w=function(){function e(e){this.template=e}return e.prototype.compile=function(e){e.wrapLayout(this.template.asLayout())},e}() -e.OutletLayoutCompiler=w,w.id="outlet"}),s("ember-glimmer/syntax/render",["exports","glimmer-runtime","glimmer-reference","ember-metal","ember-glimmer/utils/references","ember-routing","ember-glimmer/syntax/outlet"],function(e,t,n,r,i,o,s){"use strict" -function a(e){var t=e.env,r=e.getArgs(),i=r.positional.at(0),o=i.value(),s=t.owner.lookup("template:"+o),a=void 0 +var _=function(e){function n(n,r){e.call(this,"outlet",m,null),this.outletName=n,this.template=r,t.generateGuid(this)}return babelHelpers.inherits(n,e),n}(n.ComponentDefinition),w=function(){function e(e){this.template=e}return e.prototype.compile=function(e){e.wrapLayout(this.template.asLayout())},e}() +e.OutletLayoutCompiler=w,w.id="outlet"}),s("ember-glimmer/syntax/render",["exports","@glimmer/runtime","@glimmer/reference","ember-metal","ember-glimmer/utils/references","ember-routing","ember-glimmer/syntax/outlet","container","ember-glimmer/syntax/abstract-manager"],function(e,t,n,r,i,o,s,a,u){"use strict" +function l(e){var t=e.env,r=e.getArgs(),i=r.positional.at(0),o=i.value(),s=t.owner.lookup("template:"+o),a=void 0 if(r.named.has("controller")){var u=r.named.get("controller") a=u.value()}else a=o -return 1===r.positional.length?new n.ConstReference(new d(a,s,t,h)):new n.ConstReference(new d(a,s,t,m))}var u=function(e){function n(n,r,i){e.call(this),this.definitionArgs=r,this.definition=a,this.args=t.ArgsSyntax.fromPositionalArgs(r.positional.slice(1,2)),this.symbolTable=i,this.shadow=null}return c.inherits(n,e),n.create=function(e,t,n){return new this(e,t,n)},n.prototype.compile=function(e){e.component.dynamic(this.definitionArgs,this.definition,this.args,this.symbolTable,this.shadow)},n}(t.StatementSyntax) -e.RenderSyntax=u -var l=function(){function e(){}return e.prototype.prepareArgs=function(e,t){return t},e.prototype.layoutFor=function(e,t,n){return n.getCompiledBlock(s.OutletLayoutCompiler,e.template)},e.prototype.getSelf=function(e){var t=e.controller -return new i.RootReference(t)},e.prototype.getTag=function(){return null},e.prototype.getDestructor=function(){return null},e.prototype.didCreateElement=function(){},e.prototype.didRenderLayout=function(){},e.prototype.didCreate=function(){},e.prototype.update=function(){},e.prototype.didUpdateLayout=function(){},e.prototype.didUpdate=function(){},e}(),p=function(e){function t(){e.apply(this,arguments)}return c.inherits(t,e),t.prototype.create=function(e,t,n,r){var i=t.name,s=t.env,a=s.owner.lookup("controller:"+i)||o.generateController(s.owner,i) -return r.rootOutletState&&(r.outletState=r.rootOutletState.getOrphan(i)),{controller:a}},t}(l),h=new p,f=function(e){function t(){e.apply(this,arguments)}return c.inherits(t,e),t.prototype.create=function(e,t,n,r){var i=t.name,s=t.env,a=n.positional.at(0),u=s.owner._lookupFactory("controller:"+i)||o.generateControllerFactory(s.owner,i),l=u.create({model:a.value()}) -return r.rootOutletState&&(r.outletState=r.rootOutletState.getOrphan(i)),{controller:l}},t.prototype.update=function(e,t,n){var r=e.controller +return 1===r.positional.length?new n.ConstReference(new v(a,s,t,f)):new n.ConstReference(new v(a,s,t,m))}function c(e,t,n,r){t||(t=[]) +var i=[t.slice(0),n,null,null],o=[t.slice(1),n,null,null] +return r.component.dynamic(i,l,o,r.symbolTable),!0}e.renderMacro=c +var p=function(e){function t(){e.apply(this,arguments)}return babelHelpers.inherits(t,e),t.prototype.prepareArgs=function(e,t){return t},t.prototype.layoutFor=function(e,t,n){return n.getCompiledBlock(s.OutletLayoutCompiler,e.template)},t.prototype.getSelf=function(e){var t=e.controller +return new i.RootReference(t)},t.prototype.getTag=function(){return null},t.prototype.getDestructor=function(){return null},t.prototype.didCreateElement=function(){},t.prototype.didRenderLayout=function(){},t.prototype.didCreate=function(){},t.prototype.update=function(){},t.prototype.didUpdateLayout=function(){},t.prototype.didUpdate=function(){},t}(u.default),h=function(e){function t(){e.apply(this,arguments)}return babelHelpers.inherits(t,e),t.prototype.create=function(e,t,n,r){var i=t.name,s=t.env,a=s.owner.lookup("controller:"+i)||o.generateController(s.owner,i) +return r.rootOutletState&&(r.outletState=r.rootOutletState.getOrphan(i)),{controller:a}},t}(p),f=new h,d=function(e){function t(){e.apply(this,arguments)}return babelHelpers.inherits(t,e),t.prototype.create=function(e,t,n,r){var i=t.name,s=t.env,u=n.positional.at(0),l=s.owner[a.FACTORY_FOR]("controller:"+i),c=l||o.generateControllerFactory(s.owner,i),p=c.create({model:u.value()}) +return r.rootOutletState&&(r.outletState=r.rootOutletState.getOrphan(i)),{controller:p}},t.prototype.update=function(e,t,n){var r=e.controller r.set("model",t.positional.at(0).value())},t.prototype.getDestructor=function(e){var t=e.controller -return t},t}(l),m=new f,d=function(e){function t(t,n,r,i){e.call(this,"render",i,null),this.name=t,this.template=n,this.env=r}return c.inherits(t,e),t}(t.ComponentDefinition)}) -s("ember-glimmer/template",["exports","ember-utils","glimmer-runtime"],function(e,t,n){"use strict" +return t},t}(p),m=new d,v=function(e){function t(t,n,r,i){e.call(this,"render",i,null),this.name=t,this.template=n,this.env=r}return babelHelpers.inherits(t,e),t}(t.ComponentDefinition)}),s("ember-glimmer/template",["exports","ember-utils","@glimmer/runtime"],function(e,t,n){"use strict" function r(e){var r=n.templateFactory(e) -return{id:r.id,meta:r.meta,create:function(e){return r.create(e.env,{owner:e[t.OWNER]})}}}e.default=r}) -s("ember-glimmer/template_registry",["exports"],function(e){"use strict" +return{id:r.id,meta:r.meta,create:function(e){return r.create(e.env,{owner:e[t.OWNER]})}}}e.default=r}),s("ember-glimmer/template_registry",["exports"],function(e){"use strict" function t(e){s=e}function n(){return s}function r(e){if(s.hasOwnProperty(e))return s[e]}function i(e){return s.hasOwnProperty(e)}function o(e,t){return s[e]=t}e.setTemplates=t,e.getTemplates=n,e.getTemplate=r,e.hasTemplate=i,e.setTemplate=o var s={}}),s("ember-glimmer/templates/component",["exports","ember-glimmer/template"],function(e,t){"use strict" -e.default=t.default({id:"ZoGfVsSJ",block:'{"statements":[["yield","default"]],"locals":[],"named":[],"yields":["default"],"blocks":[],"hasPartials":false}',meta:{moduleName:"ember-glimmer/templates/component.hbs"}})}),s("ember-glimmer/templates/empty",["exports","ember-glimmer/template"],function(e,t){"use strict" -e.default=t.default({id:"qEHL4OLi",block:'{"statements":[],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":false}',meta:{moduleName:"ember-glimmer/templates/empty.hbs"}})}),s("ember-glimmer/templates/link-to",["exports","ember-glimmer/template"],function(e,t){"use strict" -e.default=t.default({id:"Ca7iQMR7",block:'{"statements":[["block",["if"],[["get",["linkTitle"]]],null,1,0]],"locals":[],"named":[],"yields":["default"],"blocks":[{"statements":[["yield","default"]],"locals":[]},{"statements":[["append",["unknown",["linkTitle"]],false]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"ember-glimmer/templates/link-to.hbs"}})}),s("ember-glimmer/templates/outlet",["exports","ember-glimmer/template"],function(e,t){"use strict" -e.default=t.default({id:"sYQo9vi/",block:'{"statements":[["append",["unknown",["outlet"]],false]],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":false}',meta:{moduleName:"ember-glimmer/templates/outlet.hbs"}})}),s("ember-glimmer/templates/root",["exports","ember-glimmer/template"],function(e,t){"use strict" -e.default=t.default({id:"Eaf3RPY3",block:'{"statements":[["append",["helper",["component"],[["get",[null]]],null],false]],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":false}',meta:{moduleName:"ember-glimmer/templates/root.hbs"}})}),s("ember-glimmer/utils/bindings",["exports","glimmer-reference","glimmer-runtime","ember-metal","ember-runtime","ember-glimmer/component","ember-glimmer/utils/string"],function(e,t,n,r,i,o,s){"use strict" -function a(e,t){return e[o.ROOT_REF].get(t)}function u(e,n){var r="attrs"===n[0] -return r&&(n.shift(),1===n.length)?a(e,n[0]):t.referenceFromParts(e[o.ROOT_REF],n)}function l(e){var t=e.named,r=t.keys.indexOf("class") -if(r!==-1){var i=t.values[r],o=i.ref,s=i.type -if("get"===s){var a=o.parts[o.parts.length-1] -t.values[r]=n.HelperSyntax.fromSpec(["helper",["-class"],[["get",o.parts],a],null])}}return e}e.wrapComponentClassAttribute=l -var p={parse:function(e){var t=e.indexOf(":") +e.default=t.default({id:"2aYM5QYc",block:'{"statements":[["yield","default"]],"locals":[],"named":[],"yields":["default"],"hasPartials":false}',meta:{moduleName:"ember-glimmer/templates/component.hbs"}})}),s("ember-glimmer/templates/empty",["exports","ember-glimmer/template"],function(e,t){"use strict" +e.default=t.default({id:"5QJJjniM",block:'{"statements":[],"locals":[],"named":[],"yields":[],"hasPartials":false}',meta:{moduleName:"ember-glimmer/templates/empty.hbs"}})}),s("ember-glimmer/templates/link-to",["exports","ember-glimmer/template"],function(e,t){"use strict" +e.default=t.default({id:"Y2DX6qHQ",block:'{"statements":[["block",["if"],[["get",["linkTitle"]]],null,{"statements":[["append",["unknown",["linkTitle"]],false]],"locals":[]},{"statements":[["yield","default"]],"locals":[]}]],"locals":[],"named":[],"yields":["default"],"hasPartials":false}',meta:{moduleName:"ember-glimmer/templates/link-to.hbs"}})}),s("ember-glimmer/templates/outlet",["exports","ember-glimmer/template"],function(e,t){"use strict" +e.default=t.default({id:"xyZMyWzn",block:'{"statements":[["append",["unknown",["outlet"]],false]],"locals":[],"named":[],"yields":[],"hasPartials":false}',meta:{moduleName:"ember-glimmer/templates/outlet.hbs"}})}),s("ember-glimmer/templates/root",["exports","ember-glimmer/template"],function(e,t){"use strict" +e.default=t.default({id:"/KBRNPqv",block:'{"statements":[["append",["helper",["component"],[["get",[null]]],null],false]],"locals":[],"named":[],"yields":[],"hasPartials":false}',meta:{moduleName:"ember-glimmer/templates/root.hbs"}})}),s("ember-glimmer/utils/bindings",["exports","@glimmer/reference","ember-metal","ember-runtime","ember-glimmer/component","ember-glimmer/utils/string"],function(e,t,n,r,i,o){"use strict" +function s(e,t){return e[i.ROOT_REF].get(t)}function a(e,n){var r="attrs"===n[0] +return r&&(n.shift(),1===n.length)?s(e,n[0]):t.referenceFromParts(e[i.ROOT_REF],n)}function u(e){if(!e)return e +var t=e[0],n=e[1],r=t.indexOf("class") +if(r!==-1){var i=n[r],o=i[0] +if("get"===o){var s=n[r],a=s[1],u=a[a.length-1] +e[1][r]=["helper",["-class"],[s,u]]}}return e}e.wrapComponentClassAttribute=u +var l={parse:function(e){var t=e.indexOf(":") if(t===-1)return[e,e,!0] var n=e.substring(0,t),r=e.substring(t+1) -return[n,r,!1]},install:function(e,t,n,i){var o=n[0],s=n[1] -n[2] -if("id"===s){var l=r.get(t,o) -return void 0!==l&&null!==l||(l=t.elementId),void i.addStaticAttribute(e,"id",l)}var c=o.indexOf(".")>-1,p=c?u(t,o.split(".")):a(t,o) -"style"===s&&(p=new m(p,a(t,"isVisible"))),i.addDynamicAttribute(e,s,p)}} -e.AttributeBinding=p -var h="display: none;",f=s.htmlSafe(h),m=function(e){function n(n,r){e.call(this),this.tag=t.combine([n.tag,r.tag]),this.inner=n,this.isVisible=r}return c.inherits(n,e),n.prototype.compute=function(){var e=this.inner.value(),t=this.isVisible.value() +return[n,r,!1]},install:function(e,t,r,i){var o=r[0],u=r[1] +r[2] +if("id"===u){var l=n.get(t,o) +return void 0!==l&&null!==l||(l=t.elementId),void i.addStaticAttribute(e,"id",l)}var c=o.indexOf(".")>-1,p=c?a(t,o.split(".")):s(t,o) +"style"===u&&(p=new h(p,s(t,"isVisible"))),i.addDynamicAttribute(e,u,p)}} +e.AttributeBinding=l +var c="display: none;",p=o.htmlSafe(c),h=function(e){function n(n,r){e.call(this),this.tag=t.combine([n.tag,r.tag]),this.inner=n,this.isVisible=r}return babelHelpers.inherits(n,e),n.prototype.compute=function(){var e=this.inner.value(),t=this.isVisible.value() if(t!==!1)return e -if(e||0===e){var n=e+" "+h -return s.isHTMLSafe(e)?s.htmlSafe(n):n}return f},n}(t.CachedReference),d={install:function(e,n,r){r.addDynamicAttribute(e,"style",t.map(a(n,"isVisible"),this.mapStyleValue))},mapStyleValue:function(e){return e===!1?f:null}} -e.IsVisibleBinding=d -var g={install:function(e,t,n,r){var i=n.split(":"),o=i[0],s=i[1],l=i[2],c=""===o -if(c)r.addStaticAttribute(e,"class",s) -else{var p=o.indexOf(".")>-1,h=p&&o.split("."),f=p?u(t,h):a(t,o),m=void 0 -m=void 0===s?new v(f,p?h[h.length-1]:o):new y(f,s,l),r.addDynamicAttribute(e,"class",m)}}} -e.ClassNameBinding=g -var v=function(e){function t(t,n){e.call(this),this.tag=t.tag,this.inner=t,this.path=n,this.dasherizedPath=null}return c.inherits(t,e),t.prototype.compute=function(){var e=this.inner.value() +if(e||0===e){var n=e+" "+c +return o.isHTMLSafe(e)?o.htmlSafe(n):n}return p},n}(t.CachedReference),f={install:function(e,n,r){r.addDynamicAttribute(e,"style",t.map(s(n,"isVisible"),this.mapStyleValue))},mapStyleValue:function(e){return e===!1?p:null}} +e.IsVisibleBinding=f +var d={install:function(e,t,n,r){var i=n.split(":"),o=i[0],u=i[1],l=i[2],c=""===o +if(c)r.addStaticAttribute(e,"class",u) +else{var p=o.indexOf(".")>-1,h=p&&o.split("."),f=p?a(t,h):s(t,o),d=void 0 +d=void 0===u?new m(f,p?h[h.length-1]:o):new v(f,u,l),r.addDynamicAttribute(e,"class",d)}}} +e.ClassNameBinding=d +var m=function(e){function t(t,n){e.call(this),this.tag=t.tag,this.inner=t,this.path=n,this.dasherizedPath=null}return babelHelpers.inherits(t,e),t.prototype.compute=function(){var e=this.inner.value() if(e===!0){var t=this.path,n=this.dasherizedPath -return n||(this.dasherizedPath=i.String.dasherize(t))}return e||0===e?e:null},t}(t.CachedReference),y=function(e){function t(t,n,r){e.call(this),this.tag=t.tag,this.inner=t,this.truthy=n||null,this.falsy=r||null}return c.inherits(t,e),t.prototype.compute=function(){var e=this.inner,t=this.truthy,n=this.falsy -return e.value()?t:n},t}(t.CachedReference)}),s("ember-glimmer/utils/iterable",["exports","ember-utils","ember-metal","ember-runtime","ember-glimmer/utils/references","ember-glimmer/helpers/each-in","glimmer-reference"],function(e,t,n,r,i,o,s){"use strict" +return n||(this.dasherizedPath=r.String.dasherize(t))}return e||0===e?e:null},t}(t.CachedReference),v=function(e){function t(t,n,r){e.call(this),this.tag=t.tag,this.inner=t,this.truthy=n||null,this.falsy=r||null}return babelHelpers.inherits(t,e),t.prototype.compute=function(){var e=this.inner,t=this.truthy,n=this.falsy +return e.value()?t:n},t}(t.CachedReference)}),s("ember-glimmer/utils/debug-stack",["exports","ember-metal"],function(e,t){"use strict" +var n=void 0 +e.default=n}),s("ember-glimmer/utils/iterable",["exports","ember-utils","ember-metal","ember-runtime","ember-glimmer/utils/references","ember-glimmer/helpers/each-in","@glimmer/reference"],function(e,t,n,r,i,o,s){"use strict" function a(e,t){return o.isEachIn(e)?new b(e,u(t)):new _(e,l(t))}function u(e){switch(e){case"@index":case void 0:case null:return c case"@identity":return p default:return function(t){return n.get(t,e)}}}function l(e){switch(e){case"@index":return c @@ -723,92 +1337,92 @@ case"@identity":case void 0:case null:return p default:return function(t){return n.get(t,e)}}}function c(e,t){return String(t)}function p(e){switch(typeof e){case"string":case"number":return String(e) default:return t.guidFor(e)}}function h(e,t){var n=e[t] return n?(e[t]++,""+t+f+n):(e[t]=1,t)}e.default=a -var f="be277757-bbbe-4620-9fcb-213ef433cca2",m=function(){function e(e,n){this.array=e,this.length=e.length,this.keyFor=n,this.position=0,this.seen=new t.EmptyObject}return e.prototype.isEmpty=function(){return!1},e.prototype.next=function(){var e=this.array,t=this.length,n=this.keyFor,r=this.position,i=this.seen +var f="be277757-bbbe-4620-9fcb-213ef433cca2",d=function(){function e(e,n){this.array=e,this.length=e.length,this.keyFor=n,this.position=0,this.seen=new t.EmptyObject}return e.prototype.isEmpty=function(){return!1},e.prototype.next=function(){var e=this.array,t=this.length,n=this.keyFor,r=this.position,i=this.seen if(r>=t)return null var o=e[r],s=r,a=h(i,n(o,s)) -return this.position++,{key:a,value:o,memo:s}},e}(),d=function(){function e(e,r){this.array=e,this.length=n.get(e,"length"),this.keyFor=r,this.position=0,this.seen=new t.EmptyObject}return e.prototype.isEmpty=function(){return 0===this.length},e.prototype.next=function(){var e=this.array,t=this.length,n=this.keyFor,i=this.position,o=this.seen +return this.position++,{key:a,value:o,memo:s}},e}(),m=function(){function e(e,r){this.array=e,this.length=n.get(e,"length"),this.keyFor=r,this.position=0,this.seen=new t.EmptyObject}return e.prototype.isEmpty=function(){return 0===this.length},e.prototype.next=function(){var e=this.array,t=this.length,n=this.keyFor,i=this.position,o=this.seen if(i>=t)return null var s=r.objectAt(e,i),a=i,u=h(o,n(s,a)) -return this.position++,{key:u,value:s,memo:a}},e}(),g=function(){function e(e,n,r){this.keys=e,this.values=n,this.keyFor=r,this.position=0,this.seen=new t.EmptyObject}return e.prototype.isEmpty=function(){return 0===this.keys.length},e.prototype.next=function(){var e=this.keys,t=this.values,n=this.keyFor,r=this.position,i=this.seen +return this.position++,{key:u,value:s,memo:a}},e}(),v=function(){function e(e,n,r){this.keys=e,this.values=n,this.keyFor=r,this.position=0,this.seen=new t.EmptyObject}return e.prototype.isEmpty=function(){return 0===this.keys.length},e.prototype.next=function(){var e=this.keys,t=this.values,n=this.keyFor,r=this.position,i=this.seen if(r>=e.length)return null var o=t[r],s=e[r],a=h(i,n(o,s)) -return this.position++,{key:a,value:o,memo:s}},e}(),v=function(){function e(){}return e.prototype.isEmpty=function(){return!0},e.prototype.next=function(){throw new Error("Cannot call next() on an empty iterator")},e}(),y=new v,b=function(){function e(e,t){this.ref=e,this.keyFor=t +return this.position++,{key:a,value:o,memo:s}},e}(),g=function(){function e(){}return e.prototype.isEmpty=function(){return!0},e.prototype.next=function(){throw new Error("Cannot call next() on an empty iterator")},e}(),y=new g,b=function(){function e(e,t){this.ref=e,this.keyFor=t var n=this.valueTag=new s.UpdatableTag(s.CONSTANT_TAG) this.tag=s.combine([e.tag,n])}return e.prototype.iterate=function(){var e=this.ref,t=this.keyFor,r=this.valueTag,i=e.value() r.update(n.tagFor(i)),n.isProxy(i)&&(i=n.get(i,"content")) var o=typeof i if(!i||"object"!==o&&"function"!==o)return y var s=Object.keys(i),a=s.map(function(e){return i[e]}) -return s.length>0?new g(s,a,t):y},e.prototype.valueReferenceFor=function(e){return new i.UpdatablePrimitiveReference(e.memo)},e.prototype.updateValueReference=function(e,t){e.update(t.memo)},e.prototype.memoReferenceFor=function(e){return new i.UpdatableReference(e.value)},e.prototype.updateMemoReference=function(e,t){e.update(t.value)},e}(),_=function(){function e(e,t){this.ref=e,this.keyFor=t +return s.length>0?new v(s,a,t):y},e.prototype.valueReferenceFor=function(e){return new i.UpdatablePrimitiveReference(e.memo)},e.prototype.updateValueReference=function(e,t){e.update(t.memo)},e.prototype.memoReferenceFor=function(e){return new i.UpdatableReference(e.value)},e.prototype.updateMemoReference=function(e,t){e.update(t.value)},e}(),_=function(){function e(e,t){this.ref=e,this.keyFor=t var n=this.valueTag=new s.UpdatableTag(s.CONSTANT_TAG) this.tag=s.combine([e.tag,n])}return e.prototype.iterate=function(){var e=this.ref,t=this.keyFor,i=this.valueTag,o=e.value() if(i.update(n.tagForProperty(o,"[]")),!o||"object"!=typeof o)return y -if(Array.isArray(o))return o.length>0?new m(o,t):y -if(r.isEmberArray(o))return n.get(o,"length")>0?new d(o,t):y +if(Array.isArray(o))return o.length>0?new d(o,t):y +if(r.isEmberArray(o))return n.get(o,"length")>0?new m(o,t):y if("function"!=typeof o.forEach)return y var s=function(){var e=[] -return o.forEach(function(t){e.push(t)}),{v:e.length>0?new m(e,t):y}}() -return"object"==typeof s?s.v:void 0},e.prototype.valueReferenceFor=function(e){return new i.UpdatableReference(e.value)},e.prototype.updateValueReference=function(e,t){e.update(t.value)},e.prototype.memoReferenceFor=function(e){return new i.UpdatablePrimitiveReference(e.memo)},e.prototype.updateMemoReference=function(e,t){e.update(t.memo)},e}()}),s("ember-glimmer/utils/process-args",["exports","ember-utils","glimmer-reference","ember-glimmer/component","ember-glimmer/utils/references","ember-views","ember-glimmer/helpers/action","glimmer-runtime"],function(e,t,n,r,i,o,s,a){"use strict" +return o.forEach(function(t){e.push(t)}),{v:e.length>0?new d(e,t):y}}() +return"object"==typeof s?s.v:void 0},e.prototype.valueReferenceFor=function(e){return new i.UpdatableReference(e.value)},e.prototype.updateValueReference=function(e,t){e.update(t.value)},e.prototype.memoReferenceFor=function(e){return new i.UpdatablePrimitiveReference(e.memo)},e.prototype.updateMemoReference=function(e,t){e.update(t.memo)},e}()}),s("ember-glimmer/utils/process-args",["exports","ember-utils","@glimmer/reference","ember-glimmer/component","ember-glimmer/utils/references","ember-views","ember-glimmer/helpers/action","@glimmer/runtime"],function(e,t,n,r,i,o,s,a){"use strict" function u(e,t){var n=l(e,t),r=c(e,t) -return p(n,r,e.blocks,t.ComponentClass)}function l(e,n){var r=e.named.map +return p(n,r,e.blocks,t.ComponentClass.class)}function l(e,n){var r=e.named.map return n.args?t.assign({},n.args.named.map,r):r}function c(e,t){var n=e.positional.values if(t.args){var r=t.args.positional.values,i=[] return i.push.apply(i,r),i.splice.apply(i,[0,n.length].concat(n)),i}return n}function p(e,t,n,r){var i=r.positionalParams return i&&i.length>0&&t.length>0&&(e="string"==typeof i?h(e,t,i):f(e,t,i)),a.EvaluatedArgs.named(e,n)}function h(e,n,r){var i=t.assign({},e) return i[r]=a.EvaluatedPositionalArgs.create(n),i}function f(e,n,r){for(var i=t.assign({},e),o=Math.min(n.length,r.length),s=0;s":">",'"':""","'":"'","`":"`","=":"="},l=/[&<>"'`=]/,c=/[&<>"'`=]/g}),s("ember-glimmer/utils/to-bool",["exports","ember-runtime","ember-metal"],function(e,t,n){"use strict" -function r(e){return!!e&&(e===!0||(!t.isArray(e)||0!==n.get(e,"length")))}e.default=r}),s("ember-glimmer/views/outlet",["exports","ember-utils","glimmer-reference","ember-environment","ember-metal"],function(e,t,n,r,i){"use strict" -var o=function(){function e(e){this.outletView=e,this.tag=e._tag}return e.prototype.get=function(e){return new a(this,e)},e.prototype.value=function(){return this.outletView.outletState},e.prototype.getOrphan=function(e){return new s(this,e)},e.prototype.update=function(e){this.outletView.setOutletState(e)},e}(),s=function(e){function n(t,n){e.call(this,t.outletView),this.root=t,this.name=n}return c.inherits(n,e),n.prototype.value=function(){var e=this.root.value(),n=e.outlets.main.outlets.__ember_orphans__ +function r(e){return!!e&&(e===!0||(!t.isArray(e)||0!==n.get(e,"length")))}e.default=r}),s("ember-glimmer/views/outlet",["exports","ember-utils","@glimmer/reference","ember-environment","ember-metal"],function(e,t,n,r,i){"use strict" +var o=function(){function e(e){this.outletView=e,this.tag=e._tag}return e.prototype.get=function(e){return new a(this,e)},e.prototype.value=function(){return this.outletView.outletState},e.prototype.getOrphan=function(e){return new s(this,e)},e.prototype.update=function(e){this.outletView.setOutletState(e)},e}(),s=function(e){function n(t,n){e.call(this,t.outletView),this.root=t,this.name=n}return babelHelpers.inherits(n,e),n.prototype.value=function(){var e=this.root.value(),n=e.outlets.main.outlets.__ember_orphans__ if(!n)return null var r=n.outlets[this.name] if(!r)return null var i=new t.EmptyObject -return i[r.render.outlet]=r,r.wasUsed=!0,{outlets:i}},n}(o),a=function(){function e(e,t){this.parent=e,this.key=t,this.tag=e.tag}return e.prototype.get=function(t){return new e(this,t)},e.prototype.value=function(){return this.parent.value()[this.key]},e}(),u=function(){function e(e,t,r,i){this._environment=e,this.renderer=t,this.owner=r,this.template=i,this.outletState=null,this._tag=new n.DirtyableTag}return e.extend=function(n){return function(e){function r(){e.apply(this,arguments)}return c.inherits(r,e),r.create=function(r){return r?e.create.call(this,t.assign({},n,r)):e.create.call(this,n)},r}(e)},e.reopenClass=function(e){t.assign(this,e)},e.create=function(n){var r=n._environment,i=n.renderer,o=n.template,s=n[t.OWNER] +return i[r.render.outlet]=r,r.wasUsed=!0,{outlets:i}},n}(o),a=function(){function e(e,t){this.parent=e,this.key=t,this.tag=e.tag}return e.prototype.get=function(t){return new e(this,t)},e.prototype.value=function(){return this.parent.value()[this.key]},e}(),u=function(){function e(e,t,r,i){this._environment=e,this.renderer=t,this.owner=r,this.template=i,this.outletState=null,this._tag=new n.DirtyableTag}return e.extend=function(n){return function(e){function r(){e.apply(this,arguments)}return babelHelpers.inherits(r,e),r.create=function(r){return r?e.create.call(this,t.assign({},n,r)):e.create.call(this,n)},r}(e)},e.reopenClass=function(e){t.assign(this,e)},e.create=function(n){var r=n._environment,i=n.renderer,o=n.template,s=n[t.OWNER] return new e(r,i,s,o)},e.prototype.appendTo=function(e){var t=this._environment||r.environment,n=void 0 n=t.hasDOM&&"string"==typeof e?document.querySelector(e):e,i.run.schedule("render",this.renderer,"appendOutletView",this,n)},e.prototype.rerender=function(){},e.prototype.setOutletState=function(e){this.outletState={outlets:{main:e},render:{owner:void 0,into:void 0,outlet:"main",name:"-top-level",controller:void 0,ViewClass:void 0,template:void 0}},this._tag.dirty()},e.prototype.toReference=function(){return new o(this)},e.prototype.destroy=function(){},e}() e.default=u}),s("ember-metal/alias",["exports","ember-utils","ember-metal/debug","ember-metal/property_get","ember-metal/property_set","ember-metal/error","ember-metal/properties","ember-metal/computed","ember-metal/meta","ember-metal/dependent_keys"],function(e,t,n,r,i,o,s,a,u,l){"use strict" -function c(e){return new p(e)}function p(e){this.isDescriptor=!0,this.altKey=e,this._dependentKeys=[e]}function h(e,n,r){throw new o.default("Cannot set read-only property '"+n+"' on object: "+t.inspect(e))}function f(e,t,n){return s.defineProperty(e,t,null),i.set(e,t,n)}e.default=c,e.AliasedProperty=p -var m={} -p.prototype=Object.create(s.Descriptor.prototype),p.prototype.setup=function(e,t){var n=u.meta(e) -n.peekWatching(t)&&l.addDependentKeys(this,e,t,n)},p.prototype.teardown=function(e,t){var n=u.meta(e) -n.peekWatching(t)&&l.removeDependentKeys(this,e,t,n)},p.prototype.willWatch=function(e,t){l.addDependentKeys(this,e,t,u.meta(e))},p.prototype.didUnwatch=function(e,t){l.removeDependentKeys(this,e,t,u.meta(e))},p.prototype.get=function(e,t){var n=r.get(e,this.altKey),i=u.meta(e),o=i.writableCache() -return o[t]!==m&&(o[t]=m,l.addDependentKeys(this,e,t,i)),n},p.prototype.set=function(e,t,n){return i.set(e,this.altKey,n)},p.prototype.readOnly=function(){return this.set=h,this},p.prototype.oneWay=function(){return this.set=f,this},p.prototype._meta=void 0,p.prototype.meta=a.ComputedProperty.prototype.meta}),s("ember-metal/binding",["exports","ember-utils","ember-console","ember-environment","ember-metal/run_loop","ember-metal/debug","ember-metal/property_get","ember-metal/property_set","ember-metal/events","ember-metal/observer","ember-metal/path_cache"],function(e,t,n,r,i,o,s,a,u,l,c){"use strict" -function p(e,t){this._from=t,this._to=e,this._oneWay=void 0,this._direction=void 0,this._readyToSync=void 0,this._fromObj=void 0,this._fromPath=void 0,this._toObj=void 0}function h(e,t,n,r,i,o){}function f(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}function m(e,t,n){return new p(t,n).connect(e)}e.bind=m,p.prototype={copy:function(){var e=new p(this._to,this._from) -return this._oneWay&&(e._oneWay=!0),e},from:function(e){return this._from=e,this},to:function(e){return this._to=e,this},oneWay:function(){return this._oneWay=!0,this},toString:function(){var e=this._oneWay?"[oneWay]":"" -return"Ember.Binding<"+t.guidFor(this)+">("+this._from+" -> "+this._to+")"+e},connect:function(e){var t=void 0,n=void 0,i=void 0 +function c(e){return new d(e)}function p(e,n,r){throw new o.default("Cannot set read-only property '"+n+"' on object: "+t.inspect(e))}function h(e,t,n){return s.defineProperty(e,t,null),i.set(e,t,n)}e.default=c +var f={},d=function(e){function t(t){e.call(this),this.isDescriptor=!0,this.altKey=t,this._dependentKeys=[t]}return babelHelpers.inherits(t,e),t.prototype.setup=function(e,t){var n=u.meta(e) +n.peekWatching(t)&&l.addDependentKeys(this,e,t,n)},t.prototype.teardown=function(e,t){var n=u.meta(e) +n.peekWatching(t)&&l.removeDependentKeys(this,e,t,n)},t.prototype.willWatch=function(e,t){l.addDependentKeys(this,e,t,u.meta(e))},t.prototype.didUnwatch=function(e,t){l.removeDependentKeys(this,e,t,u.meta(e))},t.prototype.get=function(e,t){var n=r.get(e,this.altKey),i=u.meta(e),o=i.writableCache() +return o[t]!==f&&(o[t]=f,l.addDependentKeys(this,e,t,i)),n},t.prototype.set=function(e,t,n){return i.set(e,this.altKey,n)},t.prototype.readOnly=function(){return this.set=p,this},t.prototype.oneWay=function(){return this.set=h,this},t}(s.Descriptor) +e.AliasedProperty=d,d.prototype._meta=void 0,d.prototype.meta=a.ComputedProperty.prototype.meta}),s("ember-metal/binding",["exports","ember-utils","ember-console","ember-environment","ember-metal/run_loop","ember-metal/debug","ember-metal/property_get","ember-metal/property_set","ember-metal/events","ember-metal/observer","ember-metal/path_cache"],function(e,t,n,r,i,o,s,a,u,l,c){"use strict" +function p(e,t,n,r,i,o){}function h(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}function f(e,t,n){return new d(t,n).connect(e)}e.bind=f +var d=function(){function e(e,t){this._from=t,this._to=e,this._oneWay=void 0,this._direction=void 0,this._readyToSync=void 0,this._fromObj=void 0,this._fromPath=void 0,this._toObj=void 0}return e.prototype.copy=function t(){var t=new e(this._to,this._from) +return this._oneWay&&(t._oneWay=!0),t},e.prototype.from=function(e){return this._from=e,this},e.prototype.to=function(e){return this._to=e,this},e.prototype.oneWay=function(){return this._oneWay=!0,this},e.prototype.toString=function(){var e=this._oneWay?"[oneWay]":"" +return"Ember.Binding<"+t.guidFor(this)+">("+this._from+" -> "+this._to+")"+e},e.prototype.connect=function(e){var t=void 0,n=void 0,i=void 0 if(c.isGlobalPath(this._from)){var o=c.getFirstKey(this._from) -i=r.context.lookup[o],i&&(t=i,n=c.getTailPath(this._from))}return void 0===t&&(t=e,n=this._from),a.trySet(e,this._to,s.get(t,n)),l.addObserver(t,n,this,"fromDidChange"),this._oneWay||l.addObserver(e,this._to,this,"toDidChange"),u.addListener(e,"willDestroy",this,"disconnect"),h(e,this._to,this._from,i,this._oneWay,!i&&!this._oneWay),this._readyToSync=!0,this._fromObj=t,this._fromPath=n,this._toObj=e,this},disconnect:function(){return l.removeObserver(this._fromObj,this._fromPath,this,"fromDidChange"),this._oneWay||l.removeObserver(this._toObj,this._to,this,"toDidChange"),this._readyToSync=!1,this},fromDidChange:function(e){this._scheduleSync("fwd")},toDidChange:function(e){this._scheduleSync("back")},_scheduleSync:function(e){var t=this._direction -void 0===t&&(i.default.schedule("sync",this,"_sync"),this._direction=e),"back"===t&&"fwd"===e&&(this._direction="fwd")},_sync:function(){var e=r.ENV.LOG_BINDINGS,t=this._toObj -if(!t.isDestroyed&&this._readyToSync){var i=this._direction,o=this._fromObj,u=this._fromPath -if(this._direction=void 0,"fwd"===i){var c=s.get(o,u) -e&&n.default.log(" ",this.toString(),"->",c,o),this._oneWay?a.trySet(t,this._to,c):l._suspendObserver(t,this._to,this,"toDidChange",function(){a.trySet(t,this._to,c)})}else if("back"===i){var p=s.get(t,this._to) -e&&n.default.log(" ",this.toString(),"<-",p,t),l._suspendObserver(o,u,this,"fromDidChange",function(){a.trySet(o,u,p)})}}}},f(p,{from:function(e){var t=this +i=r.context.lookup[o],i&&(t=i,n=c.getTailPath(this._from))}return void 0===t&&(t=e,n=this._from),a.trySet(e,this._to,s.get(t,n)),l.addObserver(t,n,this,"fromDidChange"),this._oneWay||l.addObserver(e,this._to,this,"toDidChange"),u.addListener(e,"willDestroy",this,"disconnect"),p(e,this._to,this._from,i,this._oneWay,!i&&!this._oneWay),this._readyToSync=!0,this._fromObj=t,this._fromPath=n,this._toObj=e,this},e.prototype.disconnect=function(){return l.removeObserver(this._fromObj,this._fromPath,this,"fromDidChange"),this._oneWay||l.removeObserver(this._toObj,this._to,this,"toDidChange"),this._readyToSync=!1,this},e.prototype.fromDidChange=function(e){this._scheduleSync("fwd")},e.prototype.toDidChange=function(e){this._scheduleSync("back")},e.prototype._scheduleSync=function(e){var t=this._direction +void 0===t&&(i.default.schedule("sync",this,"_sync"),this._direction=e),"back"===t&&"fwd"===e&&(this._direction="fwd")},e.prototype._sync=function(){var e=this,t=r.ENV.LOG_BINDINGS,i=this._toObj +if(!i.isDestroyed&&this._readyToSync){var o=this._direction,u=this._fromObj,c=this._fromPath +this._direction=void 0,"fwd"===o?function(){var r=s.get(u,c) +t&&n.default.log(" ",e.toString(),"->",r,u),e._oneWay?a.trySet(i,e._to,r):l._suspendObserver(i,e._to,e,"toDidChange",function(){a.trySet(i,this._to,r)})}():"back"===o&&function(){var r=s.get(i,e._to) +t&&n.default.log(" ",e.toString(),"<-",r,i),l._suspendObserver(u,c,e,"fromDidChange",function(){a.trySet(u,c,r)})}()}},e}() +h(d,{from:function(e){var t=this return new t(void 0,e)},to:function(e){var t=this -return new t(e,void 0)}}),e.Binding=p}),s("ember-metal/cache",["exports","ember-utils","ember-metal/meta"],function(e,t,n){"use strict" +return new t(e,void 0)}}),e.Binding=d}),s("ember-metal/cache",["exports","ember-utils","ember-metal/meta"],function(e,t,n){"use strict" var r=function(){function e(e,t,n,r){this.size=0,this.misses=0,this.hits=0,this.limit=e,this.func=t,this.key=n,this.store=r||new i}return e.prototype.get=function(e){var t=void 0===this.key?e:this.key(e),r=this.store.get(t) return void 0===r?(this.misses++,r=this._set(t,this.func(e))):r===n.UNDEFINED?(this.hits++,r=void 0):this.hits++,r},e.prototype.set=function(e,t){var n=void 0===this.key?e:this.key(e) return this._set(n,t)},e.prototype._set=function(e,t){return this.limit>this.size&&(this.size++,void 0===t?this.store.set(e,n.UNDEFINED):this.store.set(e,t)),t},e.prototype.purge=function(){this.store.clear(),this.size=0,this.hits=0,this.misses=0},e}() e.default=r -var i=function(){function e(){this.data=new t.EmptyObject}return e.prototype.get=function(e){return this.data[e]},e.prototype.set=function(e,t){this.data[e]=t},e.prototype.clear=function(){this.data=new t.EmptyObject},e}()}),s("ember-metal/chains",["exports","ember-utils","ember-metal/property_get","ember-metal/meta","ember-metal/watch_key","ember-metal/watch_path"],function(e,t,n,r,i,o){"use strict" -function s(e){return e.match(g)[0]}function a(e){return"object"==typeof e&&e}function u(e){return!(a(e)&&e.isDescriptor&&e._volatile===!1)}function l(){this.chains=new t.EmptyObject}function c(){return new l}function p(e,t,n){var o=r.meta(e) -o.writableChainWatchers(c).add(t,n),i.watchKey(e,t,o)}function h(e,t,n,o){if(a(e)){var s=o||r.peekMeta(e) -s&&s.readableChainWatchers()&&(s=r.meta(e),s.readableChainWatchers().remove(t,n),i.unwatchKey(e,t,s))}}function f(e,t,n){if(this._parent=e,this._key=t,this._watching=void 0===n,this._chains=void 0,this._object=void 0,this.count=0,this._value=n,this._paths={},this._watching){var r=e.value() -if(!a(r))return -this._object=r,p(this._object,this._key,this)}}function m(e,t){if(a(e)){var i=r.peekMeta(e) -if(!i||i.proto!==e){if(u(e[t]))return n.get(e,t) -var o=i.readableCache() -return o&&t in o?o[t]:void 0}}}function d(e){var t=r.peekMeta(e) +var i=function(){function e(){this.data=new t.EmptyObject}return e.prototype.get=function(e){return this.data[e]},e.prototype.set=function(e,t){this.data[e]=t},e.prototype.clear=function(){this.data=new t.EmptyObject},e}()}),s("ember-metal/chains",["exports","ember-utils","ember-metal/property_get","ember-metal/meta","ember-metal/watch_key","ember-metal/computed","ember-metal/watch_path"],function(e,t,n,r,i,o,s){"use strict" +function a(e){return e.match(m)[0]}function u(e){return"object"==typeof e&&e}function l(e){return!(u(e)&&e.isDescriptor&&e._volatile===!1)}function c(){return new v}function p(e,t,n){var o=r.meta(e) +o.writableChainWatchers(c).add(t,n),i.watchKey(e,t,o)}function h(e,t,n,o){if(u(e)){var s=o||r.peekMeta(e) +s&&s.readableChainWatchers()&&(s=r.meta(e),s.readableChainWatchers().remove(t,n),i.unwatchKey(e,t,s))}}function f(e,t){if(u(e)){var i=r.peekMeta(e) +if(!i||i.proto!==e){if(l(e[t]))return n.get(e,t) +var s=i.readableCache() +return s?o.cacheFor.get(s,t):void 0}}}function d(e){var t=r.peekMeta(e) if(t){t=r.meta(e) var n=t.readableChainWatchers() -n&&n.revalidateAll(),t.readableChains()&&t.writableChains(o.makeChainNode)}}e.finishChains=d -var g=/^([^\.]+)/ -l.prototype={add:function(e,t){var n=this.chains[e] -void 0===n?this.chains[e]=[t]:n.push(t)},remove:function(e,t){var n=this.chains[e] +n&&n.revalidateAll(),t.readableChains()&&t.writableChains(s.makeChainNode)}}e.finishChains=d +var m=/^([^\.]+)/,v=function(){function e(){this.chains=new t.EmptyObject}return e.prototype.add=function(e,t){var n=this.chains[e] +void 0===n?this.chains[e]=[t]:n.push(t)},e.prototype.remove=function(e,t){var n=this.chains[e] if(n)for(var r=0;r0&&t[e]-- -var n=s(e),r=e.slice(n.length+1) -this.unchain(n,r)},chain:function(e,n){var r=this._chains,i=void 0 -void 0===r?r=this._chains=new t.EmptyObject:i=r[e],void 0===i&&(i=r[e]=new f(this,e,void 0)),i.count++,n&&(e=s(n),n=n.slice(e.length+1),i.chain(e,n))},unchain:function(e,t){var n=this._chains,r=n[e] -if(t&&t.length>1){var i=s(t),o=t.slice(i.length+1) -r.unchain(i,o)}r.count--,r.count<=0&&(n[r._key]=void 0,r.destroy())},notify:function(e,t){if(e&&this._watching){var n=this._parent.value() -n!==this._object&&(this._object&&h(this._object,this._key,this),a(n)?(this._object=n,p(n,this._key,this)):this._object=void 0),this._value=void 0}var r=this._chains,i=void 0 +var n=a(e),r=e.slice(n.length+1) +this.unchain(n,r)},e.prototype.chain=function(n,r){var i=this._chains,o=void 0 +void 0===i?i=this._chains=new t.EmptyObject:o=i[n],void 0===o&&(o=i[n]=new e(this,n,void 0)),o.count++,r&&(n=a(r),r=r.slice(n.length+1),o.chain(n,r))},e.prototype.unchain=function(e,t){var n=this._chains,r=n[e] +if(t&&t.length>1){var i=a(t),o=t.slice(i.length+1) +r.unchain(i,o)}r.count--,r.count<=0&&(n[r._key]=void 0,r.destroy())},e.prototype.notify=function(e,t){if(e&&this._watching){var n=this._parent.value() +n!==this._object&&(this._object&&h(this._object,this._key,this),u(n)?(this._object=n,p(n,this._key,this)):this._object=void 0),this._value=void 0}var r=this._chains,i=void 0 if(r)for(var o in r)i=r[o],void 0!==i&&i.notify(e,t) -t&&this._parent&&this._parent.populateAffected(this._key,1,t)},populateAffected:function(e,t,n){this._key&&(e=this._key+"."+e),this._parent?this._parent.populateAffected(e,t+1,n):t>1&&n.push(this.value(),e)}},e.removeChainWatcher=h,e.ChainNode=f}),s("ember-metal/computed",["exports","ember-utils","ember-metal/debug","ember-metal/property_set","ember-metal/meta","ember-metal/expand_properties","ember-metal/error","ember-metal/properties","ember-metal/property_events","ember-metal/dependent_keys"],function(e,t,n,r,i,o,s,a,u,l){"use strict" +t&&this._parent&&this._parent.populateAffected(this._key,1,t)},e.prototype.populateAffected=function(e,t,n){this._key&&(e=this._key+"."+e),this._parent?this._parent.populateAffected(e,t+1,n):t>1&&n.push(this.value(),e)},e}() +e.removeChainWatcher=h,e.ChainNode=g}),s("ember-metal/computed",["exports","ember-utils","ember-metal/debug","ember-metal/property_set","ember-metal/meta","ember-metal/expand_properties","ember-metal/error","ember-metal/properties","ember-metal/property_events","ember-metal/dependent_keys"],function(e,t,n,r,i,o,s,a,u,l){"use strict" function c(e,t){this.isDescriptor=!0,"function"==typeof e?this._getter=e:(this._getter=e.get,this._setter=e.set),this._dependentKeys=void 0,this._suspended=void 0,this._meta=void 0,this._volatile=!1,this._dependentKeys=t&&t.dependentKeys,this._readOnly=!1}function p(e){var t=void 0 arguments.length>1&&(t=[].slice.call(arguments),e=t.pop()) var n=new c(e) @@ -918,21 +1534,24 @@ n.isNamespace=!0,n.toString=function(){return"Ember"},e.default=n}),s("ember-met function t(e){return h[e]}function n(e,t){h[e]=t}function r(){return h.assert.apply(void 0,arguments)}function i(){return h.info.apply(void 0,arguments)}function o(){return h.warn.apply(void 0,arguments)}function s(){return h.debug.apply(void 0,arguments)}function a(){return h.deprecate.apply(void 0,arguments)}function u(){return h.deprecateFunc.apply(void 0,arguments)}function l(){return h.runInDebug.apply(void 0,arguments)}function c(){return h.debugSeal.apply(void 0,arguments)}function p(){return h.debugFreeze.apply(void 0,arguments)}e.getDebugFunction=t,e.setDebugFunction=n,e.assert=r,e.info=i,e.warn=o,e.debug=s,e.deprecate=a,e.deprecateFunc=u,e.runInDebug=l,e.debugSeal=c,e.debugFreeze=p var h={assert:function(){},info:function(){},warn:function(){},debug:function(){},deprecate:function(){},deprecateFunc:function(){for(var e=arguments.length,t=Array(e),n=0;n=0;i-=3)if(t===e[i]&&n===e[i+1]){r=i break}return r}function s(e,t,n){var i=r.peekMeta(e) if(i){for(var s=i.matchingListeners(t),a=[],u=s.length-3;u>=0;u-=3){var l=s[u],c=s[u+1],p=s[u+2],h=o(n,l,c) @@ -941,12 +1560,12 @@ var a=0 s&&(a|=i.ONCE),r.meta(e).addToListeners(t,n,o,a),"function"==typeof e.didAddListener&&e.didAddListener(t,n,o)}function u(e,t,n,i){i||"function"!=typeof n||(i=n,n=null),r.meta(e).removeFromListeners(t,n,i,function(){"function"==typeof e.didRemoveListener&&e.didRemoveListener.apply(e,arguments)})}function l(e,t,n,r,i){return c(e,[t],n,r,i)}function c(e,t,n,i,o){return i||"function"!=typeof n||(i=n,n=null),r.meta(e).suspendListeners(t,n,i,o)}function p(e){return r.meta(e).watchedEvents()}function h(e,n,o,s){if(!s){var a=r.peekMeta(e) s=a&&a.matchingListeners(n)}if(s&&0!==s.length){for(var l=s.length-3;l>=0;l-=3){var c=s[l],p=s[l+1],h=s[l+2] p&&(h&i.SUSPENDED||(h&i.ONCE&&u(e,n,c,p),c||(c=e),"string"==typeof p?o?t.applyStr(c,p,o):c[p]():o?p.apply(c,o):p.call(c)))}return!0}}function f(e,t){var n=r.peekMeta(e) -return!!n&&n.matchingListeners(t).length>0}function m(e,t){var n=[],i=r.peekMeta(e),o=i&&i.matchingListeners(t) +return!!n&&n.matchingListeners(t).length>0}function d(e,t){var n=[],i=r.peekMeta(e),o=i&&i.matchingListeners(t) if(!o)return n for(var s=0;s=0&&(s=r(s,u.split(","),a))}for(var a=0;a0;){if(e=O.pop(),t=e._chains)for(n in t)void 0!==t[n]&&O.push(t[n]) -if(e._watching&&(r=e._object)){var i=N(r) -i&&!i.isSourceDestroying()&&o.removeChainWatcher(r,e._key,e,i)}}this.setMetaDestroyed()}} -for(var S in r.protoMethods)s.prototype[S]=r.protoMethods[S] -w.forEach(function(e){return g[e](e,s)}),s.prototype.isSourceDestroying=function(){return 0!==(this._flags&v)},s.prototype.setSourceDestroying=function(){this._flags|=v},s.prototype.isSourceDestroyed=function(){return 0!==(this._flags&y)},s.prototype.setSourceDestroyed=function(){this._flags|=y},s.prototype.isMetaDestroyed=function(){return 0!==(this._flags&b)},s.prototype.setMetaDestroyed=function(){this._flags|=b},s.prototype.isProxy=function(){return 0!==(this._flags&_)},s.prototype.setProxy=function(){this._flags|=_},s.prototype._getOrCreateOwnMap=function(e){var n=this[e] -return n||(n=this[e]=new t.EmptyObject),n},s.prototype._getInherited=function(e){for(var t=this;void 0!==t;){if(t[e])return t[e] -t=t.parent}},s.prototype._findInherited=function(e,t){for(var n=this;void 0!==n;){var r=n[e] +n=t}var r=new x(e,n) +return R(e,r),r}e.deleteMeta=f,e.meta=d +var m={peekCalls:0,peekParentCalls:0,peekPrototypeWalks:0,setCalls:0,deleteCalls:0,metaCalls:0,metaInstantiated:0},v={cache:a,weak:a,watching:u,mixins:u,bindings:u,values:u,chainWatchers:l,chains:c,tag:l,tags:a},g=2,y=4,b=8,_=16 +v.lastRendered=a,s.has("ember-debug")&&(v.lastRenderedReferenceMap=a,v.lastRenderedTemplateMap=a) +var w=Object.keys(v),E="__ember_meta__",x=function(){function e(e,t){this._cache=void 0,this._weak=void 0,this._watching=void 0,this._mixins=void 0,this._bindings=void 0,this._values=void 0,this._deps=void 0,this._chainWatchers=void 0,this._chains=void 0,this._tag=void 0,this._tags=void 0,this._flags=0,this.source=e,this.proto=void 0,this.parent=t,this._lastRendered=void 0,this._initializeListeners()}return e.prototype.isInitialized=function(e){return this.proto!==e},e.prototype.destroy=function(){if(!this.isMetaDestroyed()){var e=void 0,t=void 0,n=void 0,r=this.readableChains() +if(r)for(C.push(r);C.length>0;){if(r=C.pop(),e=r._chains)for(t in e)void 0!==e[t]&&C.push(e[t]) +if(r._watching&&(n=r._object)){var i=T(n) +i&&!i.isSourceDestroying()&&o.removeChainWatcher(n,r._key,r,i)}}this.setMetaDestroyed()}},e.prototype.isSourceDestroying=function(){return 0!==(this._flags&g)},e.prototype.setSourceDestroying=function(){this._flags|=g},e.prototype.isSourceDestroyed=function(){return 0!==(this._flags&y)},e.prototype.setSourceDestroyed=function(){this._flags|=y},e.prototype.isMetaDestroyed=function(){return 0!==(this._flags&b)},e.prototype.setMetaDestroyed=function(){this._flags|=b},e.prototype.isProxy=function(){return 0!==(this._flags&_)},e.prototype.setProxy=function(){this._flags|=_},e.prototype._getOrCreateOwnMap=function(e){return this[e]||(this[e]=new t.EmptyObject)},e.prototype._getInherited=function(e){for(var t=this;void 0!==t;){if(t[e])return t[e] +t=t.parent}},e.prototype._findInherited=function(e,t){for(var n=this;void 0!==n;){var r=n[e] if(r){var i=r[t] -if(void 0!==i)return i}n=n.parent}} -var x=t.symbol("undefined") -e.UNDEFINED=x,s.prototype.writeDeps=function(e,n,r){var i=this._getOrCreateOwnMap("_deps"),o=i[e] -o||(o=i[e]=new t.EmptyObject),o[n]=r},s.prototype.peekDeps=function(e,t){for(var n=this;void 0!==n;){var r=n._deps +if(void 0!==i)return i}n=n.parent}},e.prototype.writeDeps=function(e,n,r){var i=this._getOrCreateOwnMap("_deps"),o=i[e] +o||(o=i[e]=new t.EmptyObject),o[n]=r},e.prototype.peekDeps=function(e,t){for(var n=this;void 0!==n;){var r=n._deps if(r){var i=r[e] -if(i&&void 0!==i[t])return i[t]}n=n.parent}},s.prototype.hasDeps=function(e){for(var t=this;void 0!==t;){if(t._deps&&t._deps[e])return!0 -t=t.parent}return!1},s.prototype.forEachInDeps=function(e,t){return this._forEachIn("_deps",e,t)},s.prototype._forEachIn=function(e,n,r){for(var i=this,o=new t.EmptyObject,s=[];void 0!==i;){var a=i[e] +if(i&&void 0!==i[t])return i[t]}n=n.parent}},e.prototype.hasDeps=function(e){for(var t=this;void 0!==t;){if(t._deps&&t._deps[e])return!0 +t=t.parent}return!1},e.prototype.forEachInDeps=function(e,t){return this._forEachIn("_deps",e,t)},e.prototype._forEachIn=function(e,n,r){for(var i=this,o=new t.EmptyObject,s=[];void 0!==i;){var a=i[e] if(a){var u=a[n] if(u)for(var l in u)o[l]||(o[l]=!0,s.push([l,u[l]]))}i=i.parent}for(var c=0;c=0||"concatenatedProperties"===t||"mergedProperties"===t?n=v(e,t,n,o):u&&u.indexOf(t)>=0?n=y(e,t,n,o):h(n)&&(n=g(e,t,n,o,i)),i[t]=void 0,o[t]=n}function _(e,t,n,r,i,o){function s(e){delete n[e],delete r[e]}for(var a=void 0,u=void 0,l=void 0,c=void 0,p=void 0,h=0;h=0||"concatenatedProperties"===t||"mergedProperties"===t?n=g(e,t,n,o):u&&u.indexOf(t)>=0?n=y(e,t,n,o):h(n)&&(n=v(e,t,n,o,i)),i[t]=void 0,o[t]=n}function _(e,t,n,r,i,o){function s(e){delete n[e],delete r[e]}for(var a=void 0,u=void 0,l=void 0,c=void 0,p=void 0,h=0;h7&&66===e.charCodeAt(t-7)&&e.indexOf("inding",t-6)!==-1}function E(e,t){t.forEachBindings(function(t,n){if(n){var r=t.slice(0,-7) -n instanceof u.Binding?(n=n.copy(),n.to(r)):n=new u.Binding(r,n),n.connect(e),e[t]=n}}),t.clearBindings()}function O(e,t){return E(e,t||i.meta(e)),e}function S(e,t,n,r,i){var o=t.methodName,s=void 0,a=void 0 -return r[o]||i[o]?(s=i[o],t=r[o]):(a=e[o])&&null!==a&&"object"==typeof a&&a.isDescriptor?(t=a,s=void 0):(t=void 0,s=e[o]),{desc:t,value:s}}function x(e,t,n,r,i){var o=n[r] -if(o)for(var s=0;s1?t-1:0),r=1;r0){for(var i=new Array(r),o=0;o1?t-1:0),r=1;r=0;)if(P(o[s],n,r))return!0 -return!1}function D(e,n,r){if(!r[t.guidFor(n)])if(r[t.guidFor(n)]=!0,n.properties)for(var i=Object.keys(n.properties),o=0;o=0;)if(N(o[s],n,r))return!0 +return!1}function P(e,n,r){if(!r[t.guidFor(n)])if(r[t.guidFor(n)]=!0,n.properties)for(var i=Object.keys(n.properties),o=0;o0){for(var o=new Array(i),s=0;s0,s=e[t],a=null!==s&&"object"==typeof s&&s.isDescriptor?s:void 0 a&&a.willChange&&a.willChange(e,t),o&&(c(e,t,i),f(e,t,i),b(e,t,i))}}function l(e,t,r){var o=r||n.peekMeta(e) if(!o||o.isInitialized(e)){var s=o&&o.peekWatching(t)>0,u=e[t],l=null!==u&&"object"==typeof u&&u.isDescriptor?u:void 0 -l&&l.didChange&&l.didChange(e,t),s&&(o.hasDeps(t)&&p(e,t,o),m(e,t,o,!1),_(e,t,o)),e[w]&&e[w](t),o&&o.isSourceDestroying()||(i.markObjectAsDirty(o,t),a.assertNotRendered(e,t,o))}}function c(e,t,n){if((!n||!n.isSourceDestroying())&&n&&n.hasDeps(t)){var r=x,i=!r -i&&(r=x={}),h(u,e,t,r,n),i&&(x=null)}}function p(e,t,n){if((!n||!n.isSourceDestroying())&&n&&n.hasDeps(t)){var r=C,i=!r -i&&(r=C={}),h(l,e,t,r,n),i&&(C=null)}}function h(e,n,r,i,o){var s=void 0,a=void 0,u=t.guidFor(n),l=i[u] +l&&l.didChange&&l.didChange(e,t),s&&(o.hasDeps(t)&&p(e,t,o),d(e,t,o,!1),_(e,t,o)),e[w]&&e[w](t),o&&o.isSourceDestroying()||(i.markObjectAsDirty(o,t),a.assertNotRendered(e,t,o))}}function c(e,t,n){if((!n||!n.isSourceDestroying())&&n&&n.hasDeps(t)){var r=O,i=!r +i&&(r=O={}),h(u,e,t,r,n),i&&(O=null)}}function p(e,t,n){if((!n||!n.isSourceDestroying())&&n&&n.hasDeps(t)){var r=A,i=!r +i&&(r=A={}),h(l,e,t,r,n),i&&(A=null)}}function h(e,n,r,i,o){var s=void 0,a=void 0,u=t.guidFor(n),l=i[u] l||(l=i[u]={}),l[r]||(l[r]=!0,o.forEachInDeps(r,function(t,r){r&&(s=n[t],a=null!==s&&"object"==typeof s&&s.isDescriptor?s:void 0,a&&a._suspended===n||e(n,t,o))}))}function f(e,t,n){var r=n.readableChainWatchers() -r&&r.notify(t,!1,u)}function m(e,t,n){var r=n.readableChainWatchers() -r&&r.notify(t,!0,l)}function d(e,t,n){var r=n.readableChainWatchers() -r&&r.revalidate(t)}function g(){S++}function v(){S--,S<=0&&(E.clear(),O.flush())}function y(e,t){g() -try{e.call(t)}finally{v.call(t)}}function b(e,t,n){if(!n||!n.isSourceDestroying()){var i=t+":before",o=void 0,s=void 0 -S?(o=E.add(e,t,i),s=r.accumulateListeners(e,i,o),r.sendEvent(e,i,[e,t],s)):r.sendEvent(e,i,[e,t])}}function _(e,t,n){if(!n||!n.isSourceDestroying()){var i=t+":change",o=void 0 -S?(o=O.add(e,t,i),r.accumulateListeners(e,i,o)):r.sendEvent(e,i,[e,t])}}var w=t.symbol("PROPERTY_DID_CHANGE") +r&&r.notify(t,!1,u)}function d(e,t,n){var r=n.readableChainWatchers() +r&&r.notify(t,!0,l)}function m(e,t,n){var r=n.readableChainWatchers() +r&&r.revalidate(t)}function v(){C++}function g(){C--,C<=0&&(E.clear(),x.flush())}function y(e,t){v() +try{e.call(t)}finally{g.call(t)}}function b(e,t,n){if(!n||!n.isSourceDestroying()){var i=t+":before",o=void 0,s=void 0 +C?(o=E.add(e,t,i),s=r.accumulateListeners(e,i,o),r.sendEvent(e,i,[e,t],s)):r.sendEvent(e,i,[e,t])}}function _(e,t,n){if(!n||!n.isSourceDestroying()){var i=t+":change",o=void 0 +C?(o=x.add(e,t,i),r.accumulateListeners(e,i,o)):r.sendEvent(e,i,[e,t])}}var w=t.symbol("PROPERTY_DID_CHANGE") e.PROPERTY_DID_CHANGE=w -var E=new o.default,O=new o.default,S=0,x=void 0,C=void 0 -e.propertyWillChange=u,e.propertyDidChange=l,e.overrideChains=d,e.beginPropertyChanges=g,e.endPropertyChanges=v,e.changeProperties=y}),s("ember-metal/property_get",["exports","ember-metal/debug","ember-metal/path_cache"],function(e,t,n){"use strict" +var E=new o.default,x=new o.default,C=0,O=void 0,A=void 0 +e.propertyWillChange=u,e.propertyDidChange=l,e.overrideChains=m,e.beginPropertyChanges=v,e.endPropertyChanges=g,e.changeProperties=y}),s("ember-metal/property_get",["exports","ember-metal/debug","ember-metal/path_cache"],function(e,t,n){"use strict" function r(e,t){var r=e[t],o=null!==r&&"object"==typeof r&&r.isDescriptor?r:void 0,s=void 0 return void 0===o&&n.isPath(t)?i(e,t):o?o.get(e,t):(s=r,void 0!==s||"object"!=typeof e||t in e||"function"!=typeof e.unknownProperty?s:e.unknownProperty(t))}function i(e,t){for(var n=e,i=t.split("."),s=0;sa?a:l,c<=0&&(c=0),p=o.splice(0,a),p=[u,c].concat(p),u+=a,l-=c,s=s.concat(n.apply(e,p)) return s}e.default=t -var n=Array.prototype.splice}),s("ember-metal/run_loop",["exports","ember-utils","ember-metal/debug","ember-metal/testing","ember-metal/error_handler","ember-metal/property_events","backburner"],function(e,t,n,r,i,o,s){"use strict" +var n=Array.prototype.splice}) +s("ember-metal/run_loop",["exports","ember-utils","ember-metal/debug","ember-metal/testing","ember-metal/error_handler","ember-metal/property_events","backburner"],function(e,t,n,r,i,o,s){"use strict" function a(e){l.currentRunLoop=e}function u(e,t){l.currentRunLoop=t}function l(){return p.run.apply(p,arguments)}e.default=l var c={get onerror(){return i.getOnerror()},set onerror(e){return i.setOnerror(e)}},p=new s.default(["sync","actions","destroy"],{GUID_KEY:t.GUID_KEY,sync:{before:o.beginPropertyChanges,after:o.endPropertyChanges},defaultQueue:"actions",onBegin:a,onEnd:u,onErrorTarget:c,onErrorMethod:"onerror"}) l.join=function(){return p.join.apply(p,arguments)},l.bind=function(){for(var e=arguments.length,t=Array(e),n=0;n7)}function a(e,t){return(e.indexOf("Android 2.")===-1&&e.indexOf("Android 4.0")===-1||e.indexOf("Mobile Safari")===-1||e.indexOf("Chrome")!==-1||e.indexOf("Windows Phone")!==-1)&&!!(t&&"pushState"in t)}function u(e,t){e.replace(o(e)+t)}e.getPath=t,e.getQuery=n,e.getHash=r,e.getFullPath=i,e.getOrigin=o,e.supportsHashChange=s,e.supportsHistory=a,e.replacePath=u}),s("ember-routing/services/routing",["exports","ember-utils","ember-runtime","ember-metal","ember-routing/utils"],function(e,t,n,r,i){"use strict" +return t||(t=e.protocol+"//"+e.hostname,e.port&&(t+=":"+e.port)),t}function s(e,t){return"onhashchange"in t&&(void 0===e||e>7)}function a(e,t){return(e.indexOf("Android 2.")===-1&&e.indexOf("Android 4.0")===-1||e.indexOf("Mobile Safari")===-1||e.indexOf("Chrome")!==-1||e.indexOf("Windows Phone")!==-1)&&!!(t&&"pushState"in t)}function u(e,t){e.replace(o(e)+t)}e.getPath=t,e.getQuery=n,e.getHash=r,e.getFullPath=i,e.getOrigin=o,e.supportsHashChange=s,e.supportsHistory=a,e.replacePath=u}),s("ember-routing/services/router",["exports","ember-runtime","ember-metal","ember-routing/system/dsl"],function(e,t,n,r){"use strict" +var i=t.Service.extend({currentRouteName:t.readOnly("router.currentRouteName"),currentURL:t.readOnly("router.currentURL"),location:t.readOnly("router.location"),rootURL:t.readOnly("router.rootURL"),transitionTo:function(){var e +return(e=this.router).transitionTo.apply(e,arguments)},replaceWith:function(){var e +return(e=this.router).replaceWith.apply(e,arguments)}}) +e.default=i}),s("ember-routing/services/routing",["exports","ember-utils","ember-runtime","ember-metal","ember-routing/utils"],function(e,t,n,r,i){"use strict" function o(e,t){for(var n=0,r=0;r0&&(this.connections=[],n.run.once(this.router,"_setOutlets"))}}) -r.deprecateUnderscoreActions(_),_.reopenClass({isRouteFactory:!0}),e.default=_}),s("ember-routing/system/router",["exports","ember-utils","ember-console","ember-metal","ember-runtime","ember-routing/system/route","ember-routing/system/dsl","ember-routing/location/api","ember-routing/utils","ember-routing/system/router_state","router"],function(e,t,n,r,i,o,s,a,u,l,c){"use strict" -function p(){return this}function h(e,t,n){for(var r=!1,i=t.length-1;i>=0;--i){var o=t[i],s=o.handler -if(e===s&&(r=!0),r&&n(s)!==!0)return}}function f(e,t){var r=[],i=void 0 +r.deprecateUnderscoreActions(w),w.reopenClass({isRouteFactory:!0}),e.default=w}),s("ember-routing/system/router",["exports","ember-utils","ember-console","ember-metal","ember-runtime","ember-routing/system/route","ember-routing/system/dsl","ember-routing/location/api","ember-routing/utils","ember-routing/system/router_state","container","router"],function(e,t,n,r,i,o,s,a,u,l,c,p){"use strict" +function h(){return this}function f(e,t,n){for(var r=!1,i=t.length-1;i>=0;--i){var o=t[i],s=o.handler +if(e===s&&(r=!0),r&&n(s)!==!0)return}}function d(e,t){var r=[],i=void 0 i=e&&"object"==typeof e&&"object"==typeof e.errorThrown?e.errorThrown:e,t&&r.push(t),i&&(i.message&&r.push(i.message),i.stack&&r.push(i.stack),"string"==typeof i&&r.push(i)),n.default.error.apply(this,r)}function m(e,n){var r=e.router,i=t.getOwner(e),o=e.routeName,s=o+"_"+n,a=e.fullRouteName,u=a+"_"+n -return g(i,r,s,u)?u:""}function d(e,n){var r=e.router,i=t.getOwner(e),o=e.routeName,s="application"===o?n:o+"."+n,a=e.fullRouteName,u="application"===a?n:a+"."+n +return g(i,r,s,u)?u:""}function v(e,n){var r=e.router,i=t.getOwner(e),o=e.routeName,s="application"===o?n:o+"."+n,a=e.fullRouteName,u="application"===a?n:a+"."+n return g(i,r,s,u)?u:""}function g(e,t,n,r){var i=t.hasRoute(r),o=e.hasRegistration("template:"+n)||e.hasRegistration("route:"+n) -return i&&o}function v(e,n,i){var o=i.shift() +return i&&o}function y(e,n,i){var o=i.shift() if(!e){if(n)return throw new r.Error("Can't trigger action '"+o+"' because your app hasn't finished transitioning into its first route. To trigger an action on destination routes during a transition, you can call `.send()` on the `Transition` object passed to the `model/beforeModel/afterModel` hooks.")}for(var s=!1,a=void 0,u=void 0,l=e.length-1;l>=0;l--)if(a=e[l],u=a.handler,u&&u.actions&&u.actions[o]){if(u.actions[o].apply(u,i)!==!0){if("error"===o){var c=t.guidFor(i[0]) u.router._markErrorAsHandled(c)}return}s=!0}if(T[o])return void T[o].apply(null,i) -if(!s&&!n)throw new r.Error("Nothing handled the action '"+o+"'. If you did handle the action, this error can be caused by returning true from an action handler in a controller, causing the action to bubble.")}function y(e,t,n){for(var r=e.router,i=r.applyIntent(t,n),o=i.handlerInfos,s=i.params,a=0;a0;){var r=n.shift() +r(o,s,a)}}function C(e,t){if(e)for(var n=[e];n.length>0;){var r=n.shift() if(r.render.name===t)return r var i=r.outlets -for(var o in i)n.push(i[o])}}function S(e,n,i){var o=void 0,s={render:i,outlets:new t.EmptyObject,wasUsed:!1} -return o=i.into?O(e,i.into):n,o?r.set(o.outlets,i.outlet,s):i.into?x(e,i.into,s):e=s,{liveRoutes:e,ownState:s}}function x(e,n,i){e.outlets.__ember_orphans__||(e.outlets.__ember_orphans__={render:{name:"__ember_orphans__"},outlets:new t.EmptyObject}),e.outlets.__ember_orphans__.outlets[n]=i,r.run.schedule("afterRender",function(){})}function C(e,t,n){var r=O(e,n.routeName) -return r?r:(t.outlets.main={render:{name:n.routeName,outlet:"main"},outlets:{}},t)}e.triggerEvent=v -var A=Array.prototype.slice,k=i.Object.extend(i.Evented,{location:"hash",rootURL:"/",_initRouterJs:function(){var e=this.router=new c.default -e.triggerEvent=v,e._triggerWillChangeContext=p,e._triggerWillLeave=p -var t=this.constructor.dslCallbacks||[p],i=this._buildDSL() -i.route("application",{path:"/",resetNamespace:!0,overrideNameAssertion:!0},function(){for(var e=0;en})}function h(e,n){return t.computed(e,function(){return t.get(this,e)>=n})}function f(e,n){return t.computed(e,function(){return t.get(this,e)n})}function h(e,n){return t.computed(e,function(){return t.get(this,e)>=n})}function f(e,n){return t.computed(e,function(){return t.get(this,e)1?n-1:0),i=1;i=0&&r>=0&&n.get(e,"hasEnumerableObservers")){o=[],s=t+r @@ -1744,7 +2358,7 @@ e.enumerableContentDidChange(r,o),e.__each&&e.__each.arrayDidChange(e,t,r,i),n.s var l=n.peekMeta(e),c=l&&l.readableCache() return c&&(void 0!==c.firstObject&&u(e,0)!==n.cacheFor.get(c,"firstObject")&&(n.propertyWillChange(e,"firstObject"),n.propertyDidChange(e,"firstObject")),void 0!==c.lastObject&&u(e,n.get(e,"length")-1)!==n.cacheFor.get(c,"lastObject")&&(n.propertyWillChange(e,"lastObject"),n.propertyDidChange(e,"lastObject"))),e}function p(e){return e&&!!e[f]}var h e.addArrayObserver=s,e.removeArrayObserver=a,e.objectAt=u,e.arrayContentWillChange=l,e.arrayContentDidChange=c,e.isEmberArray=p -var f=t.symbol("EMBER_ARRAY"),m=n.Mixin.create(r.default,(h={},h[f]=!0,h.length=null,h.objectAt=function(e){if(!(e<0||e>=n.get(this,"length")))return n.get(this,e)},h.objectsAt=function(e){var t=this +var f=t.symbol("EMBER_ARRAY"),d=n.Mixin.create(r.default,(h={},h[f]=!0,h.length=null,h.objectAt=function(e){if(!(e<0||e>=n.get(this,"length")))return n.get(this,e)},h.objectsAt=function(e){var t=this return e.map(function(e){return u(t,e)})},h.nextObject=function(e){return u(this,e)},h["[]"]=n.computed({get:function(e){return this},set:function(e,t){return this.replace(0,n.get(this,"length"),t),this}}),h.firstObject=n.computed(function(){return u(this,0)}).readOnly(),h.lastObject=n.computed(function(){return u(this,n.get(this,"length")-1)}).readOnly(),h.contains=function(e){return this.indexOf(e)>=0},h.slice=function(e,t){var r=n.default.A(),i=n.get(this,"length") for(n.isNone(e)&&(e=0),(n.isNone(t)||t>i)&&(t=i),e<0&&(e=i+e),t<0&&(t=i+t);e=r)&&(t=r-1),t<0&&(t+=r) for(var i=t;i>=0;i--)if(u(this,i)===e)return i -return-1},h.addArrayObserver=function(e,t){return s(this,e,t)},h.removeArrayObserver=function(e,t){return a(this,e,t)},h.hasArrayObservers=n.computed(function(){return n.hasListeners(this,"@array:change")||n.hasListeners(this,"@array:before")}),h.arrayContentWillChange=function(e,t,n){return l(this,e,t,n)},h.arrayContentDidChange=function(e,t,n){return c(this,e,t,n)},h["@each"]=n.computed(function(){return this.__each||(this.__each=new i.default(this)),this.__each}).volatile().readOnly(),h)) -m.reopen({includes:function(e,t){var r=n.get(this,"length") +return-1},h.addArrayObserver=function(e,t){return s(this,e,t)},h.removeArrayObserver=function(e,t){return a(this,e,t)},h.hasArrayObservers=n.computed(function(){return n.hasListeners(this,"@array:change")||n.hasListeners(this,"@array:before")}),h.arrayContentWillChange=function(e,t,n){return l(this,e,t,n)},h.arrayContentDidChange=function(e,t,n){return c(this,e,t,n)},h.includes=function(e,t){var r=n.get(this,"length") void 0===t&&(t=0),t<0&&(t+=r) for(var i=t;i1?n-1:0),i=1;i=0;){var i=n.objectAt(this,r) -i===e&&this.removeAt(r)}return this},addObject:function(e){var t=void 0 -return t=this.includes(e),t||this.pushObject(e),this}})}),s("ember-runtime/mixins/mutable_enumerable",["exports","ember-runtime/mixins/enumerable","ember-metal"],function(e,t,n){"use strict" +i===e&&this.removeAt(r)}return this},addObject:function(e){var t=this.includes(e) +return t||this.pushObject(e),this}})}),s("ember-runtime/mixins/mutable_enumerable",["exports","ember-runtime/mixins/enumerable","ember-metal"],function(e,t,n){"use strict" e.default=n.Mixin.create(t.default,{addObject:null,addObjects:function(e){var t=this return n.beginPropertyChanges(this),e.forEach(function(e){return t.addObject(e)}),n.endPropertyChanges(this),this},removeObject:null,removeObjects:function(e){n.beginPropertyChanges(this) for(var t=e.length-1;t>=0;t--)this.removeObject(e[t]) return n.endPropertyChanges(this),this}})}),s("ember-runtime/mixins/observable",["exports","ember-metal"],function(e,t){"use strict" e.default=t.Mixin.create({get:function(e){return t.get(this,e)},getProperties:function(){for(var e=arguments.length,n=Array(e),r=0;r0&&(e=[arguments[0]]),this.__defineNonEnumerable(t.GUID_KEY_PROPERTY) +function o(){var e=!1,r=void 0,i=function(){function i(){e||i.proto(),arguments.length>0&&(r=[arguments[0]]),this.__defineNonEnumerable(t.GUID_KEY_PROPERTY) var o=n.meta(this),s=o.proto -if(o.proto=this,e){var a=e -e=null -for(var u=this.concatenatedProperties,c=this.mergedProperties,p=0;p0&&u.indexOf(g)>=0){var _=this[g] -v=_?"function"==typeof _.concat?_.concat(v):t.makeArray(_).concat(v):t.makeArray(v)}if(c&&c.length&&c.indexOf(g)>=0){var w=this[g] -v=t.assign({},w,v)}b?b.set(this,g,v):"function"!=typeof this.setUnknownProperty||g in this?this[g]=v:this.setUnknownProperty(g,v)}}}l(this,o),this.init.apply(this,arguments),this[h](),o.proto=s,n.finishChains(this),n.sendEvent(this,"init")} -return i.toString=n.Mixin.prototype.toString,i.willReopen=function(){r&&(i.PrototypeMixin=n.Mixin.create(i.PrototypeMixin)),r=!1},i._initProperties=function(t){e=t},i.proto=function(){var e=i.superclass -return e&&e.proto(),r||(r=!0,i.PrototypeMixin.applyPartial(i.prototype)),this.prototype},i}var s,a=n.run.schedule,u=n.Mixin._apply,l=n.Mixin.finishPartial,c=n.Mixin.prototype.reopen,p=!1,h=t.symbol("POST_INIT") -e.POST_INIT=h -var f=o() -f.toString=function(){return"Ember.CoreObject"},f.PrototypeMixin=n.Mixin.create((s={reopen:function(){for(var e=arguments.length,t=Array(e),n=0;n" -return r},s)),f.PrototypeMixin.ownerConstructor=f,f.__super__=null -var m={ClassMixin:n.REQUIRED,PrototypeMixin:n.REQUIRED,isClass:!0,isMethod:!1,extend:function(){var e,r=o() -return r.ClassMixin=n.Mixin.create(this.ClassMixin),r.PrototypeMixin=n.Mixin.create(this.PrototypeMixin),r.ClassMixin.ownerConstructor=r,r.PrototypeMixin.ownerConstructor=r,c.apply(r.PrototypeMixin,arguments),r.superclass=this,r.__super__=this.prototype,e=r.prototype=Object.create(this.prototype),e.constructor=r,t.generateGuid(e),n.meta(e).proto=e,r.ClassMixin.apply(r),r},create:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r0&&this._initProperties(n),new e},reopen:function(){return this.willReopen(),c.apply(this.PrototypeMixin,arguments),this},reopenClass:function(){return c.apply(this.ClassMixin,arguments),u(this,arguments,!1),this},detect:function(e){if("function"!=typeof e)return!1 +if(o.proto=this,r){var a=r +r=null +for(var u=this.concatenatedProperties,l=this.mergedProperties,p=0;p0&&u.indexOf(v)>=0){var _=this[v] +g=_?"function"==typeof _.concat?_.concat(g):t.makeArray(_).concat(g):t.makeArray(g)}if(l&&l.length&&l.indexOf(v)>=0){var w=this[v] +g=t.assign({},w,g)}b?b.set(this,v,g):"function"!=typeof this.setUnknownProperty||v in this?this[v]=g:this.setUnknownProperty(v,g)}}}c(this,o),this.init.apply(this,arguments),this[f](),o.proto=s,n.finishChains(this),n.sendEvent(this,"init")}return i.willReopen=function(){e&&(i.PrototypeMixin=n.Mixin.create(i.PrototypeMixin)),e=!1},i._initProperties=function(e){r=e},i.proto=function(){var t=i.superclass +return t&&t.proto(),e||(e=!0,i.PrototypeMixin.applyPartial(i.prototype)),this.prototype},i}() +return i.toString=n.Mixin.prototype.toString,i}var s,a,u=n.run.schedule,l=n.Mixin._apply,c=n.Mixin.finishPartial,p=n.Mixin.prototype.reopen,h=!1,f=t.symbol("POST_INIT") +e.POST_INIT=f +var d=o() +d.toString=function(){return"Ember.CoreObject"},d.PrototypeMixin=n.Mixin.create((s={reopen:function(){for(var e=arguments.length,t=Array(e),n=0;n" +return r},s)),d.PrototypeMixin.ownerConstructor=d,d.__super__=null +var m=(a={ClassMixin:n.REQUIRED,PrototypeMixin:n.REQUIRED,isClass:!0,isMethod:!1},a[t.NAME_KEY]=null,a[t.GUID_KEY]=null,a.extend=function(){var e=o(),r=void 0 +return e.ClassMixin=n.Mixin.create(this.ClassMixin),e.PrototypeMixin=n.Mixin.create(this.PrototypeMixin),e.ClassMixin.ownerConstructor=e,e.PrototypeMixin.ownerConstructor=e,p.apply(e.PrototypeMixin,arguments),e.superclass=this,e.__super__=this.prototype,r=e.prototype=Object.create(this.prototype),r.constructor=e,t.generateGuid(r),n.meta(r).proto=r,e.ClassMixin.apply(e),e},a.create=function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r0&&this._initProperties(n),new e},a.reopen=function(){return this.willReopen(),p.apply(this.PrototypeMixin,arguments),this},a.reopenClass=function(){return p.apply(this.ClassMixin,arguments),l(this,arguments,!1),this},a.detect=function(e){if("function"!=typeof e)return!1 for(;e;){if(e===this)return!0 -e=e.superclass}return!1},detectInstance:function(e){return e instanceof this},metaForProperty:function(e){var t=this.proto(),n=t[e],r=null!==n&&"object"==typeof n&&n.isDescriptor?n:void 0 -return r._meta||{}},_computedProperties:n.computed(function(){p=!0 -var e,t=this.proto(),n=[] -for(var r in t)e=t[r],e&&e.isDescriptor&&n.push({name:r,meta:e._meta}) -return n}).readOnly(),eachComputedProperty:function(e,t){for(var r,i={},o=n.get(this,"_computedProperties"),s=0;s=o;){var a=r.objectAt(e,s) a&&(n._addBeforeObserver(a,t,i,"contentKeyWillChange"),n.addObserver(a,t,i,"contentKeyDidChange"))}}function s(e,t,i,o,s){for(;--s>=o;){var a=r.objectAt(e,s) a&&(n._removeBeforeObserver(a,t,i,"contentKeyWillChange"),n.removeObserver(a,t,i,"contentKeyDidChange"))}}e.default=i,i.prototype={__defineNonEnumerable:function(e){this[e.name]=e.descriptor.value},arrayWillChange:function(e,t,r,i){var o=this._keys,a=r>0?t+r:-1 @@ -1931,44 +2548,44 @@ else{r[e]=1 var i=this._content,s=n.get(i,"length") o(i,e,this,0,s)}},stopObservingContentKey:function(e){var t=this._keys if(t&&t[e]>0&&--t[e]<=0){var r=this._content,i=n.get(r,"length") -s(r,e,this,0,i)}},contentKeyWillChange:function(e,t){n.propertyWillChange(this,t)},contentKeyDidChange:function(e,t){n.propertyDidChange(this,t)}}}),s("ember-runtime/system/lazy_load",["exports","ember-environment"],function(e,t){"use strict" +s(r,e,this,0,i)}},contentKeyWillChange:function(e,t){n.propertyWillChange(this,t)},contentKeyDidChange:function(e,t){n.propertyDidChange(this,t)}}}) +s("ember-runtime/system/lazy_load",["exports","ember-environment"],function(e,t){"use strict" function n(e,t){var n=o[e] i[e]=i[e]||[],i[e].push(t),n&&t(n)}function r(e,n){o[e]=n var r=t.environment.window if(r&&"function"==typeof CustomEvent){var s=new CustomEvent(e,{detail:n,name:e}) r.dispatchEvent(s)}i[e]&&i[e].forEach(function(e){return e(n)})}e.onLoad=n,e.runLoadHooks=r var i=t.ENV.EMBER_LOAD_HOOKS||{},o={},s=o -e._loaded=s}),s("ember-runtime/system/namespace",["exports","ember-utils","ember-metal","ember-environment","ember-runtime/system/object"],function(e,t,n,r,i){"use strict" -function o(){return d}function s(e){d=!!e}function a(e,r,i){var o=e.length -v[e.join(".")]=r -for(var s in r)if(y.call(r,s)){var u=r[s] -if(e[o]=s,u&&u.toString===h&&!u[n.NAME_KEY])u[n.NAME_KEY]=e.join(".") -else if(u&&u.isNamespace){if(i[t.guidFor(u)])continue -i[t.guidFor(u)]=!0,a(e,u,i)}}e.length=o}function u(e){return e>=65&&e<=90}function l(e,t){try{var n=e[t] -return n&&n.isNamespace&&n}catch(e){}}function c(){if(!g.PROCESSED)for(var e=r.context.lookup,t=Object.keys(e),i=0;i=65&&e<=90}function l(e,t){try{var n=e[t] +return n&&n.isNamespace&&n}catch(e){}}function c(){if(!v.PROCESSED)for(var e=r.context.lookup,n=Object.keys(e),i=0;i2){i=new Array(arguments.length-1) for(var o=1;o2)&&(t=Array.prototype.slice.call(arguments,1)),e=i.get(e)||e,o(e,t)}function u(e){return e.split(/\s+/)}function l(e){return N.get(e)}function c(e){return g.get(e)}function p(e){return b.get(e)}function h(e){return O.get(e)}function f(e){return C.get(e)}function m(e){return k.get(e)}var d=/[ _]/g,g=new t.Cache(1e3,function(e){return l(e).replace(d,"-")}),v=/(\-|\_|\.|\s)+(.)?/g,y=/(^|\/)([A-Z])/g,b=new t.Cache(1e3,function(e){return e.replace(v,function(e,t,n){return n?n.toUpperCase():""}).replace(y,function(e,t,n){return e.toLowerCase()})}),_=/^(\-|_)+(.)?/,w=/(.)(\-|\_|\.|\s)+(.)?/g,E=/(^|\/|\.)([a-z])/g,O=new t.Cache(1e3,function(e){for(var t=function(e,t,n){return n?"_"+n.toUpperCase():""},n=function(e,t,n,r){return t+(r?r.toUpperCase():"")},r=e.split("/"),i=0;i2)&&(t=Array.prototype.slice.call(arguments,1)),e=i.get(e)||e,o(e,t)}function u(e){return e.split(/\s+/)}function l(e){return T.get(e)}function c(e){return v.get(e)}function p(e){return b.get(e)}function h(e){return x.get(e)}function f(e){return A.get(e)}function d(e){return k.get(e)}var m=/[ _]/g,v=new t.Cache(1e3,function(e){return l(e).replace(m,"-")}),g=/(\-|\_|\.|\s)+(.)?/g,y=/(^|\/)([A-Z])/g,b=new t.Cache(1e3,function(e){return e.replace(g,function(e,t,n){return n?n.toUpperCase():""}).replace(y,function(e,t,n){return e.toLowerCase()})}),_=/^(\-|_)+(.)?/,w=/(.)(\-|\_|\.|\s)+(.)?/g,E=/(^|\/|\.)([a-z])/g,x=new t.Cache(1e3,function(e){for(var t=function(e,t,n){return n?"_"+n.toUpperCase():""},n=function(e,t,n,r){return t+(r?r.toUpperCase():"")},r=e.split("/"),i=0;i1?t-1:0),o=1;o1?t-1:0),i=1;i1?r-1:0),o=1;o"},e.create=n,e.extend=o,e.reopen=o,e.reopenClass=i,e}e.default=n -var r=0}),s("internal-test-helpers/index",["exports","internal-test-helpers/factory","internal-test-helpers/build-owner","internal-test-helpers/confirm-export","internal-test-helpers/equal-inner-html","internal-test-helpers/equal-tokens","internal-test-helpers/module-for","internal-test-helpers/strip","internal-test-helpers/apply-mixins","internal-test-helpers/matchers","internal-test-helpers/run","internal-test-helpers/test-groups","internal-test-helpers/test-cases/abstract","internal-test-helpers/test-cases/abstract-application","internal-test-helpers/test-cases/application","internal-test-helpers/test-cases/query-param","internal-test-helpers/test-cases/abstract-rendering","internal-test-helpers/test-cases/rendering"],function(e,t,n,r,i,o,s,a,u,l,c,p,h,f,m,d,g,v){"use strict" -e.factory=t.default,e.buildOwner=n.default,e.confirmExport=r.default,e.equalInnerHTML=i.default,e.equalTokens=o.default,e.moduleFor=s.default,e.strip=a.default,e.applyMixins=u.default,e.equalsElement=l.equalsElement,e.classes=l.classes,e.styles=l.styles,e.regex=l.regex,e.runAppend=c.runAppend,e.runDestroy=c.runDestroy,e.testBoth=p.testBoth,e.testWithDefault=p.testWithDefault,e.AbstractTestCase=h.default,e.AbstractApplicationTestCase=f.default,e.ApplicationTestCase=m.default,e.QueryParamTestCase=d.default,e.AbstractRenderingTestCase=g.default,e.RenderingTestCase=v.default}),s("internal-test-helpers/matchers",["exports"],function(e){"use strict" +var r=0}),s("internal-test-helpers/index",["exports","internal-test-helpers/factory","internal-test-helpers/build-owner","internal-test-helpers/confirm-export","internal-test-helpers/equal-inner-html","internal-test-helpers/equal-tokens","internal-test-helpers/module-for","internal-test-helpers/strip","internal-test-helpers/apply-mixins","internal-test-helpers/matchers","internal-test-helpers/run","internal-test-helpers/test-groups","internal-test-helpers/test-cases/abstract","internal-test-helpers/test-cases/abstract-application","internal-test-helpers/test-cases/application","internal-test-helpers/test-cases/query-param","internal-test-helpers/test-cases/abstract-rendering","internal-test-helpers/test-cases/rendering","internal-test-helpers/test-cases/router"],function(e,t,n,r,i,o,s,a,u,l,c,p,h,f,d,m,v,g,y){"use strict" +e.factory=t.default,e.buildOwner=n.default,e.confirmExport=r.default,e.equalInnerHTML=i.default,e.equalTokens=o.default,e.moduleFor=s.default,e.strip=a.default,e.applyMixins=u.default,e.equalsElement=l.equalsElement,e.classes=l.classes,e.styles=l.styles,e.regex=l.regex,e.runAppend=c.runAppend,e.runDestroy=c.runDestroy,e.testBoth=p.testBoth,e.testWithDefault=p.testWithDefault,e.AbstractTestCase=h.default,e.AbstractApplicationTestCase=f.default,e.ApplicationTestCase=d.default,e.QueryParamTestCase=m.default,e.AbstractRenderingTestCase=v.default,e.RenderingTestCase=g.default,e.RouterTestCase=y.default}),s("internal-test-helpers/matchers",["exports"],function(e){"use strict" function t(e){return"object"==typeof e&&null!==e&&u in e}function n(e){var t return t={},t[u]=!0,t.match=function(t){return e===t},t.expected=function(){return e},t.message=function(){return"should equal "+this.expected()},t}function r(e){var t return t={},t[u]=!0,t.match=function(t){return e.test(t)},t.expected=function(){return e.toString()},t.message=function(){return"should match "+this.expected()},t}function i(e){var t @@ -2211,26 +2838,28 @@ var s={},u=0 for(var l in i){var c=i[l] null!==c&&u++ var p=t(c)?c:n(c) -s[l]=p,QUnit.push(s[l].match(e.getAttribute(l)),e.getAttribute(l),p.expected(),"Element's "+l+" attribute "+p.message())}for(var h={},f=0,m=e.attributes.length;f2?o-2:0),a=2;a1?t-1:0),r=1;re));)n=n.nextSibling +function a(e){return e instanceof c&&""===e.textContent||e instanceof u&&""===e.textContent}var u=window.Text,l=window.HTMLElement,c=window.Comment,p=function(){function e(){this.element=null,this.snapshot=null,this.assert=QUnit.config.current.assert}return e.prototype.teardown=function(){},e.prototype.runTask=function(e){n.run(e)},e.prototype.runTaskNext=function(e){n.run.next(e)},e.prototype.nthChild=function(e){for(var t=0,n=this.element.firstChild;n&&(a(n)||t++,!(t>e));)n=n.nextSibling return n},e.prototype.$=function(e){return e?r.jQuery(e,this.element):r.jQuery(this.element)},e.prototype.textValue=function(){return this.$().text()},e.prototype.takeSnapshot=function(){for(var e=this.snapshot=[],t=this.element.firstChild;t;)a(t)||e.push(t),t=t.nextSibling return e},e.prototype.assertText=function(e){this.assert.strictEqual(this.textValue(),e,"#qunit-fixture content should be: `"+e+"`")},e.prototype.assertInnerHTML=function(e){i.default(this.element,e)},e.prototype.assertHTML=function(e){o.default(this.element,e,"#qunit-fixture content should be: `"+e+"`")},e.prototype.assertElement=function(e,t){var n=t.ElementType,r=void 0===n?l:n,i=t.tagName,o=t.attrs,a=void 0===o?null:o,u=t.content,c=void 0===u?null:u if(!(e instanceof r))throw new Error("Expecting a "+r.name+", but got "+e) s.equalsElement(e,i,a,c)},e.prototype.assertComponentElement=function(e,n){var r=n.ElementType,i=void 0===r?l:r,o=n.tagName,a=void 0===o?"div":o,u=n.attrs,c=void 0===u?null:u,p=n.content,h=void 0===p?null:p c=t.assign({},{id:s.regex(/^ember\d*$/),class:s.classes("ember-view")},c||{}),this.assertElement(e,{ElementType:i,tagName:a,attrs:c,content:h})},e.prototype.assertSameNode=function(e,t){this.assert.strictEqual(e,t,"DOM node stability")},e.prototype.assertInvariants=function(e,t){e=e||this.snapshot,t=t||this.takeSnapshot(),this.assert.strictEqual(t.length,e.length,"Same number of nodes") for(var n=0;n",after:""},table:{depth:1,before:"",after:"
    "},tbody:{depth:2,before:"",after:"
    "},tfoot:{depth:2,before:"",after:"
    "},thead:{depth:2,before:"",after:"
    "},tr:{depth:3,before:"",after:"
    "}}}),s("glimmer-runtime/lib/compat/svg-inner-html-fix",["exports","glimmer-runtime/lib/bounds","glimmer-runtime/lib/dom/helper"],function(e,t,n){"use strict" -function r(e,t,n){if(!e)return t -if(!s(e,n))return t -var r=e.createElement("div") -return function(e){function t(){e.apply(this,arguments)}return c.inherits(t,e),t.prototype.insertHTMLBefore=function(t,i,s){return null===s||""===s?e.prototype.insertHTMLBefore.call(this,t,i,s):t.namespaceURI!==n?e.prototype.insertHTMLBefore.call(this,t,i,s):o(t,r,s,i)},t}(t)}function i(e,t,n){if(!e)return t -if(!s(e,n))return t -var r=e.createElement("div") -return function(e){function t(){e.apply(this,arguments)}return c.inherits(t,e),t.prototype.insertHTMLBefore=function(t,i,s){return null===i||""===i?e.prototype.insertHTMLBefore.call(this,t,i,s):t.namespaceURI!==n?e.prototype.insertHTMLBefore.call(this,t,i,s):o(t,r,i,s)},t}(t)}function o(e,r,i,o){var s=""+i+"" -r.innerHTML=s -var a=n.moveNodesBefore(r.firstChild,e,o),u=a[0],l=a[1] -return new t.ConcreteBounds(e,u,l)}function s(e,t){var n=e.createElementNS(t,"svg") -try{n.insertAdjacentHTML("beforeEnd","")}catch(e){}finally{return(1!==n.childNodes.length||n.firstChild.namespaceURI!==a)&&(n=null,!0)}}e.domChanges=r,e.treeConstruction=i -var a="http://www.w3.org/2000/svg"}),s("glimmer-runtime/lib/compat/text-node-merging-fix",["exports"],function(e){"use strict" -function t(e,t){return e&&r(e)?function(e){function t(t){e.call(this,t),this.uselessComment=t.createComment("")}return c.inherits(t,e),t.prototype.insertHTMLBefore=function(t,n,r){if(null===r)return e.prototype.insertHTMLBefore.call(this,t,n,r) -var i=!1,o=n?n.previousSibling:t.lastChild -o&&o instanceof Text&&(i=!0,t.insertBefore(this.uselessComment,n)) -var s=e.prototype.insertHTMLBefore.call(this,t,n,r) -return i&&t.removeChild(this.uselessComment),s},t}(t):t}function n(e,t){return e&&r(e)?function(e){function t(t){e.call(this,t),this.uselessComment=this.createComment("")}return c.inherits(t,e),t.prototype.insertHTMLBefore=function(t,n,r){if(null===n)return e.prototype.insertHTMLBefore.call(this,t,n,r) -var i=!1,o=r?r.previousSibling:t.lastChild -o&&o instanceof Text&&(i=!0,t.insertBefore(this.uselessComment,r)) -var s=e.prototype.insertHTMLBefore.call(this,t,n,r) -return i&&t.removeChild(this.uselessComment),s},t}(t):t}function r(e){var t=e.createElement("div") -return t.innerHTML="first",t.insertAdjacentHTML("beforeEnd","second"),2===t.childNodes.length?(t=null,!1):(t=null,!0)}e.domChanges=t,e.treeConstruction=n}),s("glimmer-runtime/lib/compiled/blocks",["exports","glimmer-runtime/lib/utils","glimmer-runtime/lib/compiler"],function(e,t,n){"use strict" -var r=function(e,t){this.ops=e,this.symbols=t} -e.CompiledBlock=r -var i=function(e,t){this.program=e,this.symbolTable=t,this.compiled=null} -e.Block=i -var o=function(e){function i(n,r){var i=arguments.length<=2||void 0===arguments[2]?t.EMPTY_ARRAY:arguments[2] -e.call(this,n,r),this.locals=i}return c.inherits(i,e),i.prototype.hasPositionalParameters=function(){return!!this.locals.length},i.prototype.compile=function(e){var t=this.compiled -if(t)return t -var i=new n.InlineBlockCompiler(this,e).compile() -return this.compiled=new r(i,this.symbolTable.size)},i}(i) -e.InlineBlock=o -var s=function(e){function t(){e.apply(this,arguments)}return c.inherits(t,e),t}(o) -e.PartialBlock=s -var a=function(e){function t(){e.apply(this,arguments)}return c.inherits(t,e),t}(i) -e.TopLevelTemplate=a -var u=function(e){function t(){e.apply(this,arguments)}return c.inherits(t,e),t.prototype.compile=function(e){var t=this.compiled -if(t)return t -var i=new n.EntryPointCompiler(this,e).compile() -return this.compiled=new r(i,this.symbolTable.size)},t}(a) -e.EntryPoint=u -var l=function(e){function t(t,n,r,i,o){e.call(this,t,n),this.named=r,this.yields=i,this.hasPartials=o,this.hasNamedParameters=!!this.named.length,this.hasYields=!!this.yields.length}return c.inherits(t,e),t}(a) -e.Layout=l}),s("glimmer-runtime/lib/compiled/expressions",["exports"],function(e){"use strict" -var t=function(){function e(){}return e.prototype.toJSON=function(){return"UNIMPL: "+this.type.toUpperCase()},e}() -e.CompiledExpression=t}),s("glimmer-runtime/lib/compiled/expressions/args",["exports","glimmer-runtime/lib/compiled/expressions/positional-args","glimmer-runtime/lib/compiled/expressions/named-args","glimmer-runtime/lib/syntax/core","glimmer-reference"],function(e,t,n,r,i){"use strict" -var o=function(){function e(e,t,n){this.positional=e,this.named=t,this.blocks=n}return e.create=function(e,i,o){return e===t.COMPILED_EMPTY_POSITIONAL_ARGS&&i===n.COMPILED_EMPTY_NAMED_ARGS&&o===r.EMPTY_BLOCKS?this.empty():new this(e,i,o)},e.empty=function(){return s},e.prototype.evaluate=function(e){var t=this.positional,n=this.named,r=this.blocks -return a.create(t.evaluate(e),n.evaluate(e),r)},e}() -e.CompiledArgs=o -var s=new(function(e){function i(){e.call(this,t.COMPILED_EMPTY_POSITIONAL_ARGS,n.COMPILED_EMPTY_NAMED_ARGS,r.EMPTY_BLOCKS)}return c.inherits(i,e),i.prototype.evaluate=function(e){return u},i}(o)),a=function(){function e(e,t,n){this.positional=e,this.named=t,this.blocks=n,this.tag=i.combineTagged([e,t])}return e.empty=function(){return u},e.create=function(e,t,n){return new this(e,t,n)},e.positional=function(e){var i=arguments.length<=1||void 0===arguments[1]?r.EMPTY_BLOCKS:arguments[1] -return new this(t.EvaluatedPositionalArgs.create(e),n.EVALUATED_EMPTY_NAMED_ARGS,i)},e.named=function(e){var i=arguments.length<=1||void 0===arguments[1]?r.EMPTY_BLOCKS:arguments[1] -return new this(t.EVALUATED_EMPTY_POSITIONAL_ARGS,n.EvaluatedNamedArgs.create(e),i)},e}() -e.EvaluatedArgs=a -var u=new a(t.EVALUATED_EMPTY_POSITIONAL_ARGS,n.EVALUATED_EMPTY_NAMED_ARGS,r.EMPTY_BLOCKS) -e.CompiledPositionalArgs=t.CompiledPositionalArgs,e.EvaluatedPositionalArgs=t.EvaluatedPositionalArgs,e.CompiledNamedArgs=n.CompiledNamedArgs,e.EvaluatedNamedArgs=n.EvaluatedNamedArgs}),s("glimmer-runtime/lib/compiled/expressions/concat",["exports","glimmer-reference"],function(e,t){"use strict" -function n(e){return"function"!=typeof e.toString?"":String(e)}var r=function(){function e(e){this.parts=e,this.type="concat"}return e.prototype.evaluate=function(e){for(var t=new Array(this.parts.length),n=0;n0?e.join(""):null},r}(t.CachedReference)}),s("glimmer-runtime/lib/compiled/expressions/function",["exports","glimmer-runtime/lib/syntax","glimmer-runtime/lib/compiled/expressions"],function(e,t,n){"use strict" -function r(e){return new i(e)}e.default=r -var i=function(e){function t(t){e.call(this),this.type="function-expression",this.func=t}return c.inherits(t,e),t.prototype.compile=function(e,t,n){return new o(this.func,n)},t}(t.Expression),o=function(e){function t(t,n){e.call(this),this.func=t,this.symbolTable=n,this.type="function",this.func=t}return c.inherits(t,e),t.prototype.evaluate=function(e){var t=this.func,n=this.symbolTable -return t(e,n)},t.prototype.toJSON=function(){var e=this.func -return e.name?"`"+e.name+"(...)`":"`func(...)`"},t}(n.CompiledExpression)}),s("glimmer-runtime/lib/compiled/expressions/has-block",["exports","glimmer-runtime/lib/compiled/expressions","glimmer-runtime/lib/references"],function(e,t,n){"use strict" -var r=function(e){function t(t){e.call(this),this.inner=t,this.type="has-block"}return c.inherits(t,e),t.prototype.evaluate=function(e){var t=this.inner.evaluate(e) -return n.PrimitiveReference.create(!!t)},t.prototype.toJSON=function(){return"has-block("+this.inner.toJSON()+")"},t}(t.CompiledExpression) -e.default=r -var i=function(e){function t(t){e.call(this),this.inner=t,this.type="has-block-params"}return c.inherits(t,e),t.prototype.evaluate=function(e){var t=this.inner.evaluate(e) -return n.PrimitiveReference.create(!!(t&&t.locals.length>0))},t.prototype.toJSON=function(){return"has-block-params("+this.inner.toJSON()+")"},t}(t.CompiledExpression) -e.CompiledHasBlockParams=i -var o=function(){function e(e,t){this.symbol=e,this.debug=t}return e.prototype.evaluate=function(e){return e.scope().getBlock(this.symbol)},e.prototype.toJSON=function(){return"get-block($"+this.symbol+"("+this.debug+"))"},e}() -e.CompiledGetBlockBySymbol=o -var s=function(){function e(e,t){this.symbol=e,this.name=t}return e.prototype.evaluate=function(e){var t=this.symbol,n=this.name,r=e.scope().getPartialArgs(t) -return r.blocks[n]},e.prototype.toJSON=function(){return"get-block($"+this.symbol+"($ARGS)."+this.name+"))"},e}() -e.CompiledInPartialGetBlock=s}),s("glimmer-runtime/lib/compiled/expressions/helper",["exports","glimmer-runtime/lib/compiled/expressions"],function(e,t){"use strict" -var n=function(e){function t(t,n,r,i){e.call(this),this.name=t,this.helper=n,this.args=r,this.symbolTable=i,this.type="helper"}return c.inherits(t,e),t.prototype.evaluate=function(e){var t=this.helper -return t(e,this.args.evaluate(e),this.symbolTable)},t.prototype.toJSON=function(){return"`"+this.name.join(".")+"($ARGS)`"},t}(t.CompiledExpression) -e.default=n}),s("glimmer-runtime/lib/compiled/expressions/lookups",["exports","glimmer-runtime/lib/compiled/expressions","glimmer-reference"],function(e,t,n){"use strict" -var r=function(e){function t(t,n){e.call(this),this.base=t,this.path=n,this.type="lookup"}return c.inherits(t,e),t.create=function(e,t){return 0===t.length?e:new this(e,t)},t.prototype.evaluate=function(e){var t=this.base,r=this.path -return n.referenceFromParts(t.evaluate(e),r)},t.prototype.toJSON=function(){return this.base.toJSON()+"."+this.path.join(".")},t}(t.CompiledExpression) -e.default=r -var i=function(e){function t(){e.apply(this,arguments)}return c.inherits(t,e),t.prototype.evaluate=function(e){return e.getSelf()},t.prototype.toJSON=function(){return"self"},t}(t.CompiledExpression) -e.CompiledSelf=i -var o=function(e){function t(t,n){e.call(this),this.symbol=t,this.debug=n}return c.inherits(t,e),t.prototype.evaluate=function(e){return e.referenceForSymbol(this.symbol)},t.prototype.toJSON=function(){return"$"+this.symbol+"("+this.debug+")"},t}(t.CompiledExpression) -e.CompiledSymbol=o -var s=function(e){function t(t,n){e.call(this),this.symbol=t,this.name=n}return c.inherits(t,e),t.prototype.evaluate=function(e){var t=this.symbol,n=this.name,r=e.scope().getPartialArgs(t) -return r.named.get(n)},t.prototype.toJSON=function(){return"$"+this.symbol+"($ARGS)."+this.name},t}(t.CompiledExpression) -e.CompiledInPartialName=s}),s("glimmer-runtime/lib/compiled/expressions/named-args",["exports","glimmer-runtime/lib/references","glimmer-runtime/lib/utils","glimmer-reference","glimmer-util"],function(e,t,n,r,i){"use strict" -var o=function(){function e(e,t){this.keys=e,this.values=t,this.length=e.length,i.assert(e.length===t.length,"Keys and values do not have the same length")}return e.empty=function(){return s},e.create=function(e){var t=Object.keys(e),n=t.length -if(n>0){for(var r=[],i=0;i"},t}(o)) -e.COMPILED_EMPTY_NAMED_ARGS=s -var a=function(){function e(e,t){var n=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2] -this.keys=e,this.values=t,this._map=n,this.tag=r.combineTagged(t),this.length=e.length,i.assert(e.length===t.length,"Keys and values do not have the same length")}return e.create=function(e){var t=Object.keys(e),n=t.length -if(n>0){for(var r=new Array(n),i=0;i"},t}(i)) -e.COMPILED_EMPTY_POSITIONAL_ARGS=o -var s=function(){function e(e){this.values=e,this.tag=r.combineTagged(e),this.length=e.length}return e.create=function(e){return new this(e)},e.empty=function(){return a},e.prototype.at=function(e){var n=this.values,r=this.length -return e")}var u=function(e){function t(t){e.call(this),this.text=t,this.type="text"}return c.inherits(t,e),t.prototype.evaluate=function(e){e.stack().appendText(this.text)},t.prototype.toJSON=function(){return{guid:this._guid,type:this.type,args:[JSON.stringify(this.text)]}},t}(t.Opcode) -e.TextOpcode=u -var l=function(e){function t(t){e.call(this),this.tag=t,this.type="open-primitive-element"}return c.inherits(t,e),t.prototype.evaluate=function(e){e.stack().openElement(this.tag)},t.prototype.toJSON=function(){return{guid:this._guid,type:this.type,args:[JSON.stringify(this.tag)]}},t}(t.Opcode) -e.OpenPrimitiveElementOpcode=l -var p=function(e){function t(){e.apply(this,arguments),this.type="push-remote-element"}return c.inherits(t,e),t.prototype.evaluate=function(e){var t=e.frame.getOperand(),n=r.isConst(t)?void 0:new r.ReferenceCache(t),i=n?n.peek():t.value() -e.stack().pushRemoteElement(i),n&&e.updateWith(new o.Assert(n))},t.prototype.toJSON=function(){return{guid:this._guid,type:this.type,args:["$OPERAND"]}},t}(t.Opcode) -e.PushRemoteElementOpcode=p -var h=function(e){function t(){e.apply(this,arguments),this.type="pop-remote-element"}return c.inherits(t,e),t.prototype.evaluate=function(e){e.stack().popRemoteElement()},t}(t.Opcode) -e.PopRemoteElementOpcode=h -var f=function(e){function t(t){e.call(this),this.tag=t,this.type="open-component-element"}return c.inherits(t,e),t.prototype.evaluate=function(e){e.stack().openElement(this.tag,new y(e.env))},t.prototype.toJSON=function(){return{guid:this._guid,type:this.type,args:[JSON.stringify(this.tag)]}},t}(t.Opcode) -e.OpenComponentElementOpcode=f -var m=function(e){function t(){e.apply(this,arguments),this.type="open-dynamic-primitive-element"}return c.inherits(t,e),t.prototype.evaluate=function(e){var t=e.frame.getOperand().value() -e.stack().openElement(t)},t.prototype.toJSON=function(){return{guid:this._guid,type:this.type,args:["$OPERAND"]}},t}(t.Opcode) -e.OpenDynamicPrimitiveElementOpcode=m -var d=function(){function e(){this.list=null,this.isConst=!0}return e.prototype.append=function(e){var t=this.list,n=this.isConst -null===t&&(t=this.list=[]),t.push(e),this.isConst=n&&r.isConst(e)},e.prototype.toReference=function(){var e=this.list,t=this.isConst -return e?t?i.PrimitiveReference.create(s(e)):new g(e):i.NULL_REFERENCE},e}(),g=function(e){function t(t){e.call(this),this.list=[],this.tag=r.combineTagged(t),this.list=t}return c.inherits(t,e),t.prototype.compute=function(){return s(this.list)},t}(r.CachedReference),v=function(){function e(e){this.env=e,this.opcodes=null,this.classList=null}return e.prototype.addStaticAttribute=function(e,t,n){"class"===t?this.addClass(i.PrimitiveReference.create(n)):this.env.getAppendOperations().setAttribute(e,t,n)},e.prototype.addStaticAttributeNS=function(e,t,n,r){this.env.getAppendOperations().setAttribute(e,n,r,t)},e.prototype.addDynamicAttribute=function(e,t,n,r){if("class"===t)this.addClass(n) -else{var i=this.env.attributeFor(e,t,r),o=new C(e,i,t,n) -this.addAttribute(o)}},e.prototype.addDynamicAttributeNS=function(e,t,n,r,i){var o=this.env.attributeFor(e,n,i,t),s=new C(e,o,n,r,t) -this.addAttribute(s)},e.prototype.flush=function(e,t){for(var n=t.env,r=this.opcodes,i=this.classList,o=0;r&&o.')},t.prototype.valueSyntax=function(){return B.build(this.value)},t}(t.Argument) -e.StaticArg=S -var x=function(e){function t(t,n){var r=arguments.length<=2||void 0===arguments[2]?null:arguments[2] -e.call(this),this.name=t,this.value=n,this.namespace=r,this.type="dynamic-arg"}return c.inherits(t,e),t.fromSpec=function(e){var n=e[1],r=e[2] -return new t(n,a.default(r))},t.build=function(e,t){return new this(e,t)},t.prototype.compile=function(){throw new Error('Cannot compile DynamicArg for "'+this.name+'" as it is delegate for ExpressionSyntax.')},t.prototype.valueSyntax=function(){return this.value},t}(t.Argument) -e.DynamicArg=x -var C=function(){function e(){}return e.fromSpec=function(e){var t=e[1],n=e[2],r=e[3] -return new k(t,a.default(n),r,!0)},e.build=function(e,t,n){var r=arguments.length<=3||void 0===arguments[3]?null:arguments[3] -return new k(e,t,r,n)},e.prototype.compile=function(){throw new Error("Attempting to compile a TrustingAttr which is just a delegate for DynamicAttr.")},e}() -e.TrustingAttr=C -var A=function(e){function t(t,n,r){e.call(this),this.name=t,this.value=n,this.namespace=r,this["e1185d30-7cac-4b12-b26a-35327d905d92"]=!0,this.type="static-attr",this.isTrusting=!1}return c.inherits(t,e),t.fromSpec=function(e){var n=e[1],r=e[2],i=e[3] -return new t(n,r,i)},t.build=function(e,t){var n=arguments.length<=2||void 0===arguments[2]?null:arguments[2] -return new this(e,t,n)},t.prototype.compile=function(e){e.append(new s.StaticAttrOpcode(this.namespace,this.name,this.value))},t.prototype.valueSyntax=function(){return B.build(this.value)},t}(t.Attribute) -e.StaticAttr=A -var k=function(e){function t(t,n,r,i){void 0===r&&(r=void 0),e.call(this),this.name=t,this.value=n,this.namespace=r,this.isTrusting=i,this["e1185d30-7cac-4b12-b26a-35327d905d92"]=!0,this.type="dynamic-attr"}return c.inherits(t,e),t.fromSpec=function(e){var n=e[1],r=e[2],i=e[3] -return new t(n,a.default(r),i)},t.build=function(e,t){var n=!(arguments.length<=2||void 0===arguments[2])&&arguments[2],r=arguments.length<=3||void 0===arguments[3]?null:arguments[3] -return new this(e,t,r,n)},t.prototype.compile=function(e,t,n){var r=this.namespace,o=this.value -e.append(new i.PutValueOpcode(o.compile(e,t,n))),r?e.append(new s.DynamicAttrNSOpcode(this.name,this.namespace,this.isTrusting)):e.append(new s.DynamicAttrOpcode(this.name,this.isTrusting))},t.prototype.valueSyntax=function(){return this.value},t}(t.Attribute) -e.DynamicAttr=k -var T=function(e){function t(){e.apply(this,arguments),this.type="flush-element"}return c.inherits(t,e),t.fromSpec=function(){return new t},t.build=function(){return new this},t.prototype.compile=function(e){e.append(new s.FlushElementOpcode)},t}(t.Statement) -e.FlushElement=T -var N=function(e){function t(){e.apply(this,arguments),this.type="close-element"}return c.inherits(t,e),t.fromSpec=function(){return new t},t.build=function(){return new this},t.prototype.compile=function(e){e.append(new s.CloseElementOpcode)},t}(t.Statement) -e.CloseElement=N -var R=function(e){function t(t){e.call(this),this.content=t,this.type="text"}return c.inherits(t,e),t.fromSpec=function(e){var n=e[1] -return new t(n)},t.build=function(e){return new this(e)},t.prototype.compile=function(e){e.text(this.content)},t}(t.Statement) -e.Text=R -var P=function(e){function t(t){e.call(this),this.comment=t,this.type="comment"}return c.inherits(t,e),t.fromSpec=function(e){var n=e[1] -return new t(n)},t.build=function(e){return new this(e)},t.prototype.compile=function(e){e.comment(this.comment)},t}(t.Statement) -e.Comment=P -var D=function(e){function n(t,n,r){e.call(this),this.tag=t,this.blockParams=n,this.symbolTable=r,this.type="open-element"}return c.inherits(n,e),n.fromSpec=function(e,t){var r=e[1],i=e[2] -return new n(r,i,t)},n.build=function(e,t,n){return new this(e,t,n)},n.prototype.scan=function(e){var t=this.tag -if(e.env.hasComponentDefinition([t],this.symbolTable)){var n=this.parameters(e),r=n.args,i=n.attrs -e.startBlock(this.blockParams),this.tagContents(e) -var o=e.endBlock(this.blockParams) -return r.blocks=Q.fromSpec(o),new I(t,i,r)}return new L(t)},n.prototype.compile=function(e,t){e.append(new s.OpenPrimitiveElementOpcode(this.tag))},n.prototype.toIdentity=function(){var e=this.tag -return new L(e)},n.prototype.parameters=function(e){for(var n=e.next(),r=[],i=[],o=[];!(n instanceof T);){if(n[E])throw new Error("Compile Error: Element modifiers are not allowed in components") -var s=n -if(n[t.ATTRIBUTE])r.push(s.name),i.push(s.name),o.push(s.valueSyntax()) -else{if(!n[t.ARGUMENT])throw new Error("Expected FlushElement, but got ${current}") -i.push(s.name),o.push(s.valueSyntax())}n=e.next()}return{args:$.fromNamedArgs(ee.build(i,o)),attrs:r}},n.prototype.tagContents=function(e){for(var t=1;;){var r=e.next() -if(r instanceof N&&0===--t)break -e.addStatement(r),(r instanceof n||r instanceof L)&&t++}},n}(t.Statement) -e.OpenElement=D -var I=function(e){function t(t,n,r){e.call(this),this.tag=t,this.attrs=n,this.args=r,this.type="component"}return c.inherits(t,e),t.prototype.compile=function(e,t,n){var r=t.getComponentDefinition([this.tag],n),i=this.args.compile(e,t,n),s=this.attrs -e.append(new o.PutComponentDefinitionOpcode(r)),e.append(new o.OpenComponentOpcode(i,s)),e.append(new o.CloseComponentOpcode)},t}(t.Statement) -e.Component=I -var L=function(e){function t(t){e.call(this),this.tag=t,this.type="open-primitive-element"}return c.inherits(t,e),t.build=function(e){return new this(e)},t.prototype.compile=function(e){e.append(new s.OpenPrimitiveElementOpcode(this.tag))},t}(t.Statement) -e.OpenPrimitiveElement=L -var M=function(e){function t(t,n){e.call(this),this.to=t,this.args=n,this.type="yield"}return c.inherits(t,e),t.fromSpec=function(e){var n=e[1],r=e[2],i=$.fromSpec(r,null,J) -return new t(n,i)},t.build=function(e,t){var n=$.fromPositionalArgs(Z.build(e)) -return new this(t,n)},t.prototype.compile=function(e,t,n){var r=this.to,i=this.args.compile(e,t,n) -if(e.hasBlockSymbol(r)){var o=e.getBlockSymbol(r),s=new h.CompiledGetBlockBySymbol(o,r) -e.append(new F(s,i)),e.append(new U)}else{if(!e.hasPartialArgsSymbol())throw new Error("[BUG] ${to} is not a valid block name.") -var o=e.getPartialArgsSymbol(),s=new h.CompiledInPartialGetBlock(o,r) -e.append(new F(s,i)),e.append(new U)}},t}(t.Statement) -e.Yield=M -var j=function(e){function t(){e.apply(this,arguments)}return c.inherits(t,e),t.fromSpec=function(e){var t=e[1],r=a.default(t) -return v(r)?new n.StaticPartialSyntax(r):new n.DynamicPartialSyntax(r)},t}(t.Statement) -e.Partial=j -var F=function(e){function t(t,n){e.call(this),this.inner=t,this.args=n,this.type="open-block"}return c.inherits(t,e),t.prototype.evaluate=function(e){var t=this.inner.evaluate(e),n=void 0 -t&&(n=this.args.evaluate(e)),e.pushCallerScope(),t&&e.invokeBlock(t,n)},t.prototype.toJSON=function(){return{guid:this._guid,type:this.type,details:{block:this.inner.toJSON(),positional:this.args.positional.toJSON(),named:this.args.named.toJSON()}}},t}(r.Opcode),U=function(e){function t(){e.apply(this,arguments),this.type="close-block"}return c.inherits(t,e),t.prototype.evaluate=function(e){e.popScope()},t}(r.Opcode) -e.CloseBlockOpcode=U -var B=function(e){function t(t){e.call(this),this.value=t,this.type="value"}return c.inherits(t,e),t.fromSpec=function(e){return new t(e)},t.build=function(e){return new this(e)},t.prototype.inner=function(){return this.value},t.prototype.compile=function(e){return new l.default(this.value)},t}(t.Expression) -e.Value=B -var z=function(e){function t(t){e.call(this),this.parts=t,this.type="get-argument"}return c.inherits(t,e),t.fromSpec=function(e){var n=e[1] -return new t(n)},t.build=function(e){return new this(e.split("."))},t.prototype.compile=function(e){var t=this.parts,n=t[0] -if(e.hasNamedSymbol(n)){var r=e.getNamedSymbol(n),i=t.slice(1),o=new p.CompiledSymbol(r,n) -return p.default.create(o,i)}if(e.hasPartialArgsSymbol()){var r=e.getPartialArgsSymbol(),i=t.slice(1),o=new p.CompiledInPartialName(r,n) -return p.default.create(o,i)}throw new Error("[BUG] @"+this.parts.join(".")+" is not a valid lookup path.")},t}(t.Expression) -e.GetArgument=z -var V=function(e){function t(t){e.call(this),this.parts=t,this.type="ref"}return c.inherits(t,e),t.build=function(e){var t=e.split(".") -return"this"===t[0]&&(t[0]=null),new this(t)},t.prototype.compile=function(e){var t=this.parts,n=t[0] -if(null===n){var r=new p.CompiledSelf,i=t.slice(1) -return p.default.create(r,i)}if(e.hasLocalSymbol(n)){var o=e.getLocalSymbol(n),i=t.slice(1),r=new p.CompiledSymbol(o,n) -return p.default.create(r,i)}var r=new p.CompiledSelf -return p.default.create(r,t)},t}(t.Expression) -e.Ref=V -var q=function(e){function t(t){e.call(this),this.ref=t,this.type="get"}return c.inherits(t,e),t.fromSpec=function(e){var t=e[1] -return new this(new V(t))},t.build=function(e){return new this(V.build(e))},t.prototype.compile=function(e){return this.ref.compile(e)},t}(t.Expression) -e.Get=q -var H=function(e){function t(t){e.call(this),this.ref=t,this.type="unknown"}return c.inherits(t,e),t.fromSpec=function(e){var t=e[1] -return new this(new V(t))},t.build=function(e){return new this(V.build(e))},t.prototype.compile=function(e,t,n){var r=this.ref -return t.hasHelper(r.parts,n)?new f.default(r.parts,t.lookupHelper(r.parts,n),u.CompiledArgs.empty(),n):this.ref.compile(e)},t}(t.Expression) -e.Unknown=H -var G=function(e){function t(t,n){e.call(this),this.ref=t,this.args=n,this.type="helper"}return c.inherits(t,e),t.fromSpec=function(e){var n=e[1],r=e[2],i=e[3] -return new t(new V(n),$.fromSpec(r,i,J))},t.build=function(e,t,n){return new this(V.build(e),$.build(t,n,J))},t.prototype.compile=function(e,t,n){if(t.hasHelper(this.ref.parts,n)){var r=this.args,i=this.ref -return new f.default(i.parts,t.lookupHelper(i.parts,n),r.compile(e,t,n),n)}throw new Error("Compile Error: "+this.ref.parts.join(".")+" is not a helper")},t}(t.Expression) -e.Helper=G -var W=function(e){function t(t){e.call(this),this.blockName=t,this.type="has-block"}return c.inherits(t,e),t.fromSpec=function(e){var n=e[1] -return new t(n)},t.build=function(e){return new this(e)},t.prototype.compile=function(e,t){var n=this.blockName -if(e.hasBlockSymbol(n)){var r=e.getBlockSymbol(n),i=new h.CompiledGetBlockBySymbol(r,n) -return new h.default(i)}if(e.hasPartialArgsSymbol()){var r=e.getPartialArgsSymbol(),i=new h.CompiledInPartialGetBlock(r,n) -return new h.default(i)}throw new Error("[BUG] ${blockName} is not a valid block name.")},t}(t.Expression) -e.HasBlock=W -var K=function(e){function t(t){e.call(this),this.blockName=t,this.type="has-block-params"}return c.inherits(t,e),t.fromSpec=function(e){var n=e[1] -return new t(n)},t.build=function(e){return new this(e)},t.prototype.compile=function(e,t){var n=this.blockName -if(e.hasBlockSymbol(n)){var r=e.getBlockSymbol(n),i=new h.CompiledGetBlockBySymbol(r,n) -return new h.CompiledHasBlockParams(i)}if(e.hasPartialArgsSymbol()){var r=e.getPartialArgsSymbol(),i=new h.CompiledInPartialGetBlock(r,n) -return new h.CompiledHasBlockParams(i)}throw new Error("[BUG] ${blockName} is not a valid block name.")},t}(t.Expression) -e.HasBlockParams=K -var Y=function(){function e(e){this.parts=e,this.type="concat"}return e.fromSpec=function(t){var n=t[1] -return new e(n.map(a.default))},e.build=function(e){return new this(e)},e.prototype.compile=function(e,t,n){return new m.default(this.parts.map(function(r){return r.compile(e,t,n)}))},e}() -e.Concat=Y -var Q=function(){function e(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1] -this.type="blocks",this.default=e,this.inverse=t}return e.fromSpec=function(t){var n=arguments.length<=1||void 0===arguments[1]?null:arguments[1] -return new e(t,n)},e.empty=function(){return J},e}() -e.Blocks=Q -var J=new(function(e){function t(){e.call(this,null,null)}return c.inherits(t,e),t}(Q)) -e.EMPTY_BLOCKS=J -var $=function(){function e(e,t,n){this.positional=e,this.named=t,this.blocks=n,this.type="args"}return e.empty=function(){return ne},e.fromSpec=function(t,n,r){return new e(Z.fromSpec(t),ee.fromSpec(n),r)},e.fromPositionalArgs=function(t){var n=arguments.length<=1||void 0===arguments[1]?J:arguments[1] -return new e(t,te,n)},e.fromNamedArgs=function(t){var n=arguments.length<=1||void 0===arguments[1]?J:arguments[1] -return new e(X,t,n)},e.build=function(e,t,n){return e===X&&t===te&&n===J?ne:new this(e,t,n)},e.prototype.compile=function(e,t,n){var r=this.positional,i=this.named,o=this.blocks -return u.CompiledArgs.create(r.compile(e,t,n),i.compile(e,t,n),o)},e}() -e.Args=$ -var Z=function(){function e(e){this.values=e,this.type="positional",this.length=e.length}return e.empty=function(){return X},e.fromSpec=function(t){return t&&0!==t.length?new e(t.map(a.default)):X},e.build=function(e){return 0===e.length?X:new this(e)},e.prototype.slice=function(t,n){return e.build(this.values.slice(t,n))},e.prototype.at=function(e){return this.values[e]},e.prototype.compile=function(e,t,n){return u.CompiledPositionalArgs.create(this.values.map(function(r){return r.compile(e,t,n)}))},e}() -e.PositionalArgs=Z -var X=new(function(e){function t(){e.call(this,d.EMPTY_ARRAY)}return c.inherits(t,e),t.prototype.slice=function(e,t){return this},t.prototype.at=function(e){},t.prototype.compile=function(e,t){return u.CompiledPositionalArgs.empty()},t}(Z)),ee=function(){function e(e,t){this.keys=e,this.values=t,this.type="named",this.length=e.length}return e.empty=function(){return te},e.fromSpec=function(e){if(null===e||void 0===e)return te -var t=e[0],n=e[1] -return 0===t.length?te:new this(t,n.map(function(e){return a.default(e)}))},e.build=function(e,t){return 0===e.length?te:new this(e,t)},e.prototype.at=function(e){var t=this.keys,n=this.values,r=t.indexOf(e) -return n[r]},e.prototype.has=function(e){return this.keys.indexOf(e)!==-1},e.prototype.compile=function(e,t,n){for(var r=this.keys,i=this.values,o=new Array(i.length),s=0;s=this.list.length?null:this.list[e]},e.prototype.min=function(){return this.start},e.prototype.max=function(){return this.end},e}() -e.ListRange=o}),s("glimmer-runtime/lib/vm",["exports","glimmer-runtime/lib/vm/append","glimmer-runtime/lib/vm/update","glimmer-runtime/lib/vm/render-result"],function(e,t,n,r){"use strict" -e.VM=t.default,e.PublicVM=t.PublicVM,e.UpdatingVM=n.default,e.RenderResult=r.default}),s("glimmer-runtime/lib/vm/append",["exports","glimmer-runtime/lib/environment","glimmer-util","glimmer-reference","glimmer-runtime/lib/compiled/opcodes/vm","glimmer-runtime/lib/vm/update","glimmer-runtime/lib/vm/render-result","glimmer-runtime/lib/vm/frame"],function(e,t,n,r,i,o,s,a){"use strict" -var u=function(){function e(e,t,r,i){this.env=e,this.elementStack=i,this.dynamicScopeStack=new n.Stack,this.scopeStack=new n.Stack,this.updatingOpcodeStack=new n.Stack,this.cacheGroups=new n.Stack,this.listBlockStack=new n.Stack,this.frame=new a.FrameStack,this.env=e,this.elementStack=i,this.scopeStack.push(t),this.dynamicScopeStack.push(r)}return e.initial=function(n,r,i,o,s){var a=t.Scope.root(r,s) -return new e(n,a,i,o)},e.prototype.capture=function(){return{env:this.env,scope:this.scope(),dynamicScope:this.dynamicScope(),frame:this.frame.capture()}},e.prototype.goto=function(e){this.frame.goto(e)},e.prototype.beginCacheGroup=function(){this.cacheGroups.push(this.updatingOpcodeStack.current.tail())},e.prototype.commitCacheGroup=function(){var e=new i.LabelOpcode("END"),t=this.updatingOpcodeStack.current,o=this.cacheGroups.pop(),s=o?t.nextNode(o):t.head(),a=t.tail(),u=r.combineSlice(new n.ListSlice(s,a)),l=new i.JumpIfNotModifiedOpcode(u,e) -t.insertBefore(l,s),t.append(new i.DidModifyOpcode(l)),t.append(e)},e.prototype.enter=function(e){var t=new n.LinkedList,r=this.stack().pushUpdatableBlock(),i=this.capture(),s=new o.TryOpcode(e,i,r,t) -this.didEnter(s,t)},e.prototype.enterWithKey=function(e,t){var r=new n.LinkedList,i=this.stack().pushUpdatableBlock(),s=this.capture(),a=new o.TryOpcode(t,s,i,r) -this.listBlockStack.current.map[e]=a,this.didEnter(a,r)},e.prototype.enterList=function(e){var t=new n.LinkedList,r=this.stack().pushBlockList(t),i=this.capture(),s=this.frame.getIterator().artifacts,a=new o.ListBlockOpcode(e,i,r,t,s) -this.listBlockStack.push(a),this.didEnter(a,t)},e.prototype.didEnter=function(e,t){this.updateWith(e),this.updatingOpcodeStack.push(t)},e.prototype.exit=function(){this.stack().popBlock(),this.updatingOpcodeStack.pop() -var e=this.updatingOpcodeStack.current.tail() -e.didInitializeChildren()},e.prototype.exitList=function(){this.exit(),this.listBlockStack.pop()},e.prototype.updateWith=function(e){this.updatingOpcodeStack.current.append(e)},e.prototype.stack=function(){return this.elementStack},e.prototype.scope=function(){return this.scopeStack.current},e.prototype.dynamicScope=function(){return this.dynamicScopeStack.current},e.prototype.pushFrame=function(e,t,n){this.frame.push(e.ops),t&&this.frame.setArgs(t),t&&t.blocks&&this.frame.setBlocks(t.blocks),n&&this.frame.setCallerScope(n)},e.prototype.pushComponentFrame=function(e,t,n,r,i,o){this.frame.push(e.ops,r,i,o),t&&this.frame.setArgs(t),t&&t.blocks&&this.frame.setBlocks(t.blocks),n&&this.frame.setCallerScope(n)},e.prototype.pushEvalFrame=function(e){this.frame.push(e)},e.prototype.pushChildScope=function(){this.scopeStack.push(this.scopeStack.current.child())},e.prototype.pushCallerScope=function(){this.scopeStack.push(this.scope().getCallerScope())},e.prototype.pushDynamicScope=function(){var e=this.dynamicScopeStack.current.child() -return this.dynamicScopeStack.push(e),e},e.prototype.pushRootScope=function(e,n){var r=t.Scope.root(e,n) -return this.scopeStack.push(r),r},e.prototype.popScope=function(){this.scopeStack.pop()},e.prototype.popDynamicScope=function(){this.dynamicScopeStack.pop()},e.prototype.newDestroyable=function(e){this.stack().newDestroyable(e)},e.prototype.getSelf=function(){return this.scope().getSelf()},e.prototype.referenceForSymbol=function(e){return this.scope().getSymbol(e)},e.prototype.getArgs=function(){return this.frame.getArgs()},e.prototype.resume=function(e,t){return this.execute(e,function(e){return e.frame.restore(t)})},e.prototype.execute=function(e,t){n.LOGGER.debug("[VM] Begin program execution") -var r=this.elementStack,i=this.frame,o=this.updatingOpcodeStack,a=this.env -r.pushSimpleBlock(),o.push(new n.LinkedList),i.push(e),t&&t(this) -for(var u=void 0;i.hasOpcodes();)(u=i.nextStatement())&&(n.LOGGER.debug("[VM] OP "+u.type),n.LOGGER.trace(u),u.evaluate(this)) -return n.LOGGER.debug("[VM] Completed program execution"),new s.default(a,o.pop(),r.popBlock())},e.prototype.evaluateOpcode=function(e){e.evaluate(this)},e.prototype.invokeBlock=function(e,t){var n=e.compile(this.env) -this.pushFrame(n,t)},e.prototype.invokePartial=function(e){var t=e.compile(this.env) -this.pushFrame(t)},e.prototype.invokeLayout=function(e,t,n,r,i,o){this.pushComponentFrame(t,e,n,r,i,o)},e.prototype.evaluateOperand=function(e){this.frame.setOperand(e.evaluate(this))},e.prototype.evaluateArgs=function(e){var t=this.frame.setArgs(e.evaluate(this)) -this.frame.setOperand(t.positional.at(0))},e.prototype.bindPositionalArgs=function(e){var t=this.frame.getArgs() -n.assert(t,"Cannot bind positional args") -for(var r=t.positional,i=this.scope(),o=0;o0&&47===t.charCodeAt(0)&&(t=t.substr(1)) +for(var o=t.split("/"),s=0;s2&&"[]"===s.slice(a-2)&&(u=!0,s=s.slice(0,a-2),n[s]||(n[s]=[])),i=o[1]?O(o[1]):""),u?n[s].push(i):n[s]=i}return n},recognize:function(e){var t,n,r,i,o=[this.rootState],s={},u=!1 -if(i=e.indexOf("#"),i!==-1&&(e=e.substr(0,i)),r=e.indexOf("?"),r!==-1){var l=e.substr(r+1,e.length) -e=e.substr(0,r),s=this.parseQueryString(l)}"/"!==e.charAt(0)&&(e="/"+e) -var c=e -for(T.ENCODE_AND_DECODE_PATH_SEGMENTS?e=a(e):(e=decodeURI(e),c=decodeURI(c)),t=e.length,t>1&&"/"===e.charAt(t-1)&&(e=e.substr(0,t-1),c=c.substr(0,c.length-1),u=!0),n=0;n2&&"[]"===o.slice(s-2)&&(a=!0,o=o.slice(0,s-2),n[o]||(n[o]=[])),u=i[1]?v(i[1]):""),a?n[o].push(u):n[o]=u}return n},T.prototype.recognize=function(e){var t,n=[this.rootState],r={},i=!1,o=e.indexOf("#") +o!==-1&&(e=e.substr(0,o)) +var a=e.indexOf("?") +if(a!==-1){var u=e.substr(a+1,e.length) +e=e.substr(0,a),r=this.parseQueryString(u)}"/"!==e.charAt(0)&&(e="/"+e) +var l=e +T.ENCODE_AND_DECODE_PATH_SEGMENTS?e=s(e):(e=decodeURI(e),l=decodeURI(l)) +var c=e.length +c>1&&"/"===e.charAt(c-1)&&(e=e.substr(0,c-1),l=l.substr(0,l.length-1),i=!0) +for(var p=0;p0&&e[r-1]&&e[r-1].hasOwnProperty("queryParams")?(n=e[r-1].queryParams,t=z.call(e,0,r-1),[t,n]):[e,null]}function s(e){for(var t in e)if("number"==typeof e[t])e[t]=""+e[t] -else if(V(e[t]))for(var n=0,r=e[t].length;n=r.length?r.length-1:t.resolveIndex return n.Promise.reject({error:e,handlerWithError:u.handlerInfos[i].handler,wasAborted:l,state:u})}function o(e){var n=u.handlerInfos[t.resolveIndex].isResolved if(u.handlerInfos[t.resolveIndex++]=e,!n){var i=e.handler -g(i,"redirect",e.context,t)}return r().then(s,null,u.promiseLabel("Resolve handler"))}function s(){if(t.resolveIndex===u.handlerInfos.length)return{error:null,state:u} +v(i,"redirect",e.context,t)}return r().then(s,null,u.promiseLabel("Resolve handler"))}function s(){if(t.resolveIndex===u.handlerInfos.length)return{error:null,state:u} var e=u.handlerInfos[t.resolveIndex] return e.resolve(r,t).then(o,null,u.promiseLabel("Proceed"))}var a=this.params c(this.handlerInfos,function(e){a[e.name]=e.params||{}}),t=t||{},t.resolveIndex=0 var u=this,l=!1 -return n.Promise.resolve(null,this.promiseLabel("Start transition")).then(s,null,this.promiseLabel("Resolve handler")).catch(i,this.promiseLabel("Handle error"))}},b.prototype={targetName:null,urlMethod:"update",intent:null,pivotHandler:null,resolveIndex:0,resolvedModels:null,state:null,queryParamsOnly:!1,isTransition:!0,isExiting:function(e){for(var t=this.handlerInfos,n=0,r=t.length;n=0;--u){var f=t[u],m=f.handler,d=e.handlerInfos[u],g=null -if(f.names.length>0)if(u>=h)g=this.createParamHandlerInfo(m,n,f.names,p,d) -else{var v=a(m) -g=this.getHandlerInfoForDynamicSegment(m,n,f.names,p,d,r,u,v)}else g=this.createParamHandlerInfo(m,n,f.names,p,d) -if(s){g=g.becomeResolved(null,g.context) -var b=d&&d.context -f.names.length>0&&g.context===b&&(g.params=d&&d.params),g.context=b}var _=d;(u>=h||g.shouldSupercede(d))&&(h=Math.min(u,h),_=g),o&&!s&&(_=_.becomeResolved(null,_.context)),c.handlerInfos.unshift(_)}if(p.length>0)throw new Error("More context objects were passed than there are dynamic segments for the route: "+r) +break}for(u=t.length-1;u>=0;--u){var f=t[u],d=f.handler,m=e.handlerInfos[u],v=null +if(f.names.length>0)if(u>=h)v=this.createParamHandlerInfo(d,n,f.names,p,m) +else{var g=a(d) +v=this.getHandlerInfoForDynamicSegment(d,n,f.names,p,m,r,u,g)}else v=this.createParamHandlerInfo(d,n,f.names,p,m) +if(s){v=v.becomeResolved(null,v.context) +var b=m&&m.context +f.names.length>0&&v.context===b&&(v.params=m&&m.params),v.context=b}var _=m;(u>=h||v.shouldSupercede(m))&&(h=Math.min(u,h),_=v),o&&!s&&(_=_.becomeResolved(null,_.context)),c.handlerInfos.unshift(_)}if(p.length>0)throw new Error("More context objects were passed than there are dynamic segments for the route: "+r) return o||this.invalidateChildren(c.handlerInfos,h),i(c.queryParams,this.queryParams||{}),c},invalidateChildren:function(e,t){for(var n=t,r=e.length;n0){if(u=r[r.length-1],l(u))return this.createParamHandlerInfo(e,t,n,r,i) r.pop()}else{if(i&&i.name===e)return i if(!this.preTransitionState)return i var c=this.preTransitionState.handlerInfos[s] -u=c&&c.context}return C("object",{name:e,getHandler:t,serializer:a,context:u,names:n})},createParamHandlerInfo:function(e,t,n,r,i){for(var o={},s=n.length;s--;){var a=i&&e===i.name&&i.params||{},u=r[r.length-1],c=n[s] +u=c&&c.context}return A("object",{name:e,getHandler:t,serializer:a,context:u,names:n})},createParamHandlerInfo:function(e,t,n,r,i){for(var o={},s=n.length;s--;){var a=i&&e===i.name&&i.params||{},u=r[r.length-1],c=n[s] if(l(u))o[c]=""+r.pop() else{if(!a.hasOwnProperty(c))throw new Error("You didn't provide enough string/numeric parameters to satisfy all of the dynamic segments for route "+e) -o[c]=a[c]}}return C("param",{name:e,getHandler:t,params:o})}}) -A.prototype=q(Error.prototype) -var Q=m(O,{url:null,initialize:function(e){this.url=e.url},applyToState:function(e,t,n){function r(e){if(e&&e.inaccessibleByURL)throw new A(c) +o[c]=a[c]}}return A("param",{name:e,getHandler:t,params:o})}}) +S.prototype=q(Error.prototype) +var Y=d(x,{url:null,initialize:function(e){this.url=e.url},applyToState:function(e,t,n){function r(e){if(e&&e.inaccessibleByURL)throw new S(c) return e}var o,s,a=new y,u=t.recognize(this.url) -if(!u)throw new A(this.url) +if(!u)throw new S(this.url) var l=!1,c=this.url -for(o=0,s=u.length;o=0&&r;--n){var i=t[n] e.add(t,{as:i.handler}),r="/"===i.path||""===i.path||".index"===i.handler.slice(-6)}})},hasRoute:function(e){return this.recognizer.hasRoute(e)},getHandler:function(){},getSerializer:function(){},queryParamsTransition:function(e,t,n,r){var i=this -if(N(this,r,e),!t&&this.activeTransition)return this.activeTransition -var o=new b(this) -return o.queryParamsOnly=!0,n.queryParams=F(this,r.handlerInfos,r.queryParams,o),o.promise=o.promise.then(function(e){return I(o,n,!0),i.didTransition&&i.didTransition(i.currentHandlerInfos),e},null,f("Transition complete")),o},transitionByIntent:function(e){try{return T.apply(this,arguments)}catch(t){return new b(this,e,null,t)}},reset:function(){this.state&&c(this.state.handlerInfos.slice().reverse(),function(e){var t=e.handler -g(t,"exit")}),this.oldState=void 0,this.state=new y,this.currentHandlerInfos=null},activeTransition:null,handleURL:function(e){var t=z.call(arguments) -return"/"!==e.charAt(0)&&(t[0]="/"+e),M(this,t).method(null)},updateURL:function(){throw new Error("updateURL is not implemented")},replaceURL:function(e){this.updateURL(e)},transitionTo:function(){return M(this,arguments)},intermediateTransitionTo:function(){return M(this,arguments,!0)},refresh:function(e){for(var t=this.activeTransition?this.activeTransition.state:this.state,n=t.handlerInfos,r={},i=0,o=n.length;i1)throw new Error("Second argument not supported") +return se(i,n).then(function(t){for(var n=new Array(r),i=0,o=0;o1)throw new Error("Second argument not supported") if("object"!=typeof e)throw new TypeError("Argument must be an object") -return a.prototype=e,new a},Se=[],xe=void 0,Ce=1,Ae=2,ke=new S,Te=new S -N.prototype._validateInput=function(e){return we(e)},N.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},N.prototype._init=function(){this._result=new Array(this.length)},N.prototype._enumerate=function(){for(var e=this.length,t=this.promise,n=this._input,r=0;t._state===xe&&r= timers[middle]) { - start = middle + 2; - } else { - end = middle; - } - } + NodeDOMTreeConstruction.prototype.setAttribute = function setAttribute(element, name, value) { + element.setAttribute(name, value); + }; - return (time >= timers[start]) ? start + 2 : start; -} + return NodeDOMTreeConstruction; + })(_glimmerRuntime.DOMTreeConstruction); -function Queue(name, options, globalOptions) { - this.name = name; - this.globalOptions = globalOptions || {}; - this.options = options; - this._queue = []; - this.targetQueues = {}; - this._queueBeingFlushed = undefined; -} + exports.NodeDOMTreeConstruction = NodeDOMTreeConstruction; +}); +enifed("@glimmer/reference", ["exports", "@glimmer/util"], function (exports, _glimmerUtil) { + "use strict"; -Queue.prototype = { - push: function(target, method, args, stack) { - var queue = this._queue; - queue.push(target, method, args, stack); + var CONSTANT = 0; + var INITIAL = 1; + var VOLATILE = NaN; - return { - queue: this, - target: target, - method: method - }; - }, + var RevisionTag = (function () { + function RevisionTag() {} - pushUniqueWithoutGuid: function(target, method, args, stack) { - var queue = this._queue; + RevisionTag.prototype.validate = function validate(snapshot) { + return this.value() === snapshot; + }; - for (var i = 0, l = queue.length; i < l; i += 4) { - var currentTarget = queue[i]; - var currentMethod = queue[i+1]; + return RevisionTag; + })(); - if (currentTarget === target && currentMethod === method) { - queue[i+2] = args; // replace args - queue[i+3] = stack; // replace stack - return; - } - } + var $REVISION = INITIAL; - queue.push(target, method, args, stack); - }, + var DirtyableTag = (function (_RevisionTag) { + babelHelpers.inherits(DirtyableTag, _RevisionTag); - targetQueue: function(targetQueue, target, method, args, stack) { - var queue = this._queue; + function DirtyableTag() { + var revision = arguments.length <= 0 || arguments[0] === undefined ? $REVISION : arguments[0]; - for (var i = 0, l = targetQueue.length; i < l; i += 2) { - var currentMethod = targetQueue[i]; - var currentIndex = targetQueue[i + 1]; + _RevisionTag.call(this); + this.revision = revision; + } - if (currentMethod === method) { - queue[currentIndex + 2] = args; // replace args - queue[currentIndex + 3] = stack; // replace stack - return; - } - } + DirtyableTag.prototype.value = function value() { + return this.revision; + }; - targetQueue.push( - method, - queue.push(target, method, args, stack) - 4 - ); - }, + DirtyableTag.prototype.dirty = function dirty() { + this.revision = ++$REVISION; + }; - pushUniqueWithGuid: function(guid, target, method, args, stack) { - var hasLocalQueue = this.targetQueues[guid]; + return DirtyableTag; + })(RevisionTag); - if (hasLocalQueue) { - this.targetQueue(hasLocalQueue, target, method, args, stack); - } else { - this.targetQueues[guid] = [ - method, - this._queue.push(target, method, args, stack) - 4 - ]; + function combineTagged(tagged) { + var optimized = []; + for (var i = 0, l = tagged.length; i < l; i++) { + var tag = tagged[i].tag; + if (tag === VOLATILE_TAG) return VOLATILE_TAG; + if (tag === CONSTANT_TAG) continue; + optimized.push(tag); + } + return _combine(optimized); + } + function combineSlice(slice) { + var optimized = []; + var node = slice.head(); + while (node !== null) { + var tag = node.tag; + if (tag === VOLATILE_TAG) return VOLATILE_TAG; + if (tag !== CONSTANT_TAG) optimized.push(tag); + node = slice.nextNode(node); + } + return _combine(optimized); + } + function combine(tags) { + var optimized = []; + for (var i = 0, l = tags.length; i < l; i++) { + var tag = tags[i]; + if (tag === VOLATILE_TAG) return VOLATILE_TAG; + if (tag === CONSTANT_TAG) continue; + optimized.push(tag); + } + return _combine(optimized); + } + function _combine(tags) { + switch (tags.length) { + case 0: + return CONSTANT_TAG; + case 1: + return tags[0]; + case 2: + return new TagsPair(tags[0], tags[1]); + default: + return new TagsCombinator(tags); + } + ; } - return { - queue: this, - target: target, - method: method - }; - }, + var CachedTag = (function (_RevisionTag2) { + babelHelpers.inherits(CachedTag, _RevisionTag2); - pushUnique: function(target, method, args, stack) { - var KEY = this.globalOptions.GUID_KEY; + function CachedTag() { + _RevisionTag2.apply(this, arguments); + this.lastChecked = null; + this.lastValue = null; + } - if (target && KEY) { - var guid = target[KEY]; - if (guid) { - return this.pushUniqueWithGuid(guid, target, method, args, stack); - } - } + CachedTag.prototype.value = function value() { + var lastChecked = this.lastChecked; + var lastValue = this.lastValue; - this.pushUniqueWithoutGuid(target, method, args, stack); + if (lastChecked !== $REVISION) { + this.lastChecked = $REVISION; + this.lastValue = lastValue = this.compute(); + } + return this.lastValue; + }; - return { - queue: this, - target: target, - method: method - }; - }, + CachedTag.prototype.invalidate = function invalidate() { + this.lastChecked = null; + }; - invoke: function(target, method, args /*, onError, errorRecordedForStack */) { - if (args && args.length > 0) { - method.apply(target, args); - } else { - method.call(target); - } - }, + return CachedTag; + })(RevisionTag); - invokeWithOnError: function(target, method, args, onError, errorRecordedForStack) { - try { - if (args && args.length > 0) { - method.apply(target, args); - } else { - method.call(target); - } - } catch(error) { - onError(error, errorRecordedForStack); - } - }, + var TagsPair = (function (_CachedTag) { + babelHelpers.inherits(TagsPair, _CachedTag); - flush: function(sync) { - var queue = this._queue; - var length = queue.length; + function TagsPair(first, second) { + _CachedTag.call(this); + this.first = first; + this.second = second; + } - if (length === 0) { - return; - } + TagsPair.prototype.compute = function compute() { + return Math.max(this.first.value(), this.second.value()); + }; - var globalOptions = this.globalOptions; - var options = this.options; - var before = options && options.before; - var after = options && options.after; - var onError = globalOptions.onError || (globalOptions.onErrorTarget && - globalOptions.onErrorTarget[globalOptions.onErrorMethod]); - var target, method, args, errorRecordedForStack; - var invoke = onError ? this.invokeWithOnError : this.invoke; + return TagsPair; + })(CachedTag); - this.targetQueues = Object.create(null); - var queueItems = this._queueBeingFlushed = this._queue.slice(); - this._queue = []; + var TagsCombinator = (function (_CachedTag2) { + babelHelpers.inherits(TagsCombinator, _CachedTag2); - if (before) { - before(); - } + function TagsCombinator(tags) { + _CachedTag2.call(this); + this.tags = tags; + } - for (var i = 0; i < length; i += 4) { - target = queueItems[i]; - method = queueItems[i+1]; - args = queueItems[i+2]; - errorRecordedForStack = queueItems[i+3]; // Debugging assistance + TagsCombinator.prototype.compute = function compute() { + var tags = this.tags; - if (isString(method)) { - method = target[method]; - } + var max = -1; + for (var i = 0; i < tags.length; i++) { + var value = tags[i].value(); + max = Math.max(value, max); + } + return max; + }; - // method could have been nullified / canceled during flush - if (method) { - // - // ** Attention intrepid developer ** - // - // To find out the stack of this task when it was scheduled onto - // the run loop, add the following to your app.js: - // - // Ember.run.backburner.DEBUG = true; // NOTE: This slows your app, don't leave it on in production. - // - // Once that is in place, when you are at a breakpoint and navigate - // here in the stack explorer, you can look at `errorRecordedForStack.stack`, - // which will be the captured stack when this job was scheduled. - // - // One possible long-term solution is the following Chrome issue: - // https://bugs.chromium.org/p/chromium/issues/detail?id=332624 - // - invoke(target, method, args, onError, errorRecordedForStack); - } - } + return TagsCombinator; + })(CachedTag); - if (after) { - after(); - } + var UpdatableTag = (function (_CachedTag3) { + babelHelpers.inherits(UpdatableTag, _CachedTag3); - this._queueBeingFlushed = undefined; + function UpdatableTag(tag) { + _CachedTag3.call(this); + this.tag = tag; + this.lastUpdated = INITIAL; + } - if (sync !== false && - this._queue.length > 0) { - // check if new items have been added - this.flush(true); - } - }, + ////////// - cancel: function(actionToCancel) { - var queue = this._queue, currentTarget, currentMethod, i, l; - var target = actionToCancel.target; - var method = actionToCancel.method; - var GUID_KEY = this.globalOptions.GUID_KEY; + UpdatableTag.prototype.compute = function compute() { + return Math.max(this.lastUpdated, this.tag.value()); + }; - if (GUID_KEY && this.targetQueues && target) { - var targetQueue = this.targetQueues[target[GUID_KEY]]; + UpdatableTag.prototype.update = function update(tag) { + if (tag !== this.tag) { + this.tag = tag; + this.lastUpdated = $REVISION; + this.invalidate(); + } + }; - if (targetQueue) { - for (i = 0, l = targetQueue.length; i < l; i++) { - if (targetQueue[i] === method) { - targetQueue.splice(i, 1); - } + return UpdatableTag; + })(CachedTag); + + var CONSTANT_TAG = new ((function (_RevisionTag3) { + babelHelpers.inherits(ConstantTag, _RevisionTag3); + + function ConstantTag() { + _RevisionTag3.apply(this, arguments); } - } - } - for (i = 0, l = queue.length; i < l; i += 4) { - currentTarget = queue[i]; - currentMethod = queue[i+1]; + ConstantTag.prototype.value = function value() { + return CONSTANT; + }; - if (currentTarget === target && - currentMethod === method) { - queue.splice(i, 4); - return true; - } - } + return ConstantTag; + })(RevisionTag))(); + var VOLATILE_TAG = new ((function (_RevisionTag4) { + babelHelpers.inherits(VolatileTag, _RevisionTag4); - // if not found in current queue - // could be in the queue that is being flushed - queue = this._queueBeingFlushed; + function VolatileTag() { + _RevisionTag4.apply(this, arguments); + } - if (!queue) { - return; - } + VolatileTag.prototype.value = function value() { + return VOLATILE; + }; - for (i = 0, l = queue.length; i < l; i += 4) { - currentTarget = queue[i]; - currentMethod = queue[i+1]; + return VolatileTag; + })(RevisionTag))(); + var CURRENT_TAG = new ((function (_DirtyableTag) { + babelHelpers.inherits(CurrentTag, _DirtyableTag); - if (currentTarget === target && - currentMethod === method) { - // don't mess with array during flush - // just nullify the method - queue[i+1] = null; - return true; - } - } - } -}; + function CurrentTag() { + _DirtyableTag.apply(this, arguments); + } -function DeferredActionQueues(queueNames, options) { - var queues = this.queues = {}; - this.queueNames = queueNames = queueNames || []; + CurrentTag.prototype.value = function value() { + return $REVISION; + }; - this.options = options; + return CurrentTag; + })(DirtyableTag))(); - each(queueNames, function(queueName) { - queues[queueName] = new Queue(queueName, options[queueName], options); - }); -} + var CachedReference = (function () { + function CachedReference() { + this.lastRevision = null; + this.lastValue = null; + } -function noSuchQueue(name) { - throw new Error('You attempted to schedule an action in a queue (' + name + ') that doesn\'t exist'); -} + CachedReference.prototype.value = function value() { + var tag = this.tag; + var lastRevision = this.lastRevision; + var lastValue = this.lastValue; -function noSuchMethod(name) { - throw new Error('You attempted to schedule an action in a queue (' + name + ') for a method that doesn\'t exist'); -} + if (!lastRevision || !tag.validate(lastRevision)) { + lastValue = this.lastValue = this.compute(); + this.lastRevision = tag.value(); + } + return lastValue; + }; -DeferredActionQueues.prototype = { - schedule: function(name, target, method, args, onceFlag, stack) { - var queues = this.queues; - var queue = queues[name]; + CachedReference.prototype.invalidate = function invalidate() { + this.lastRevision = null; + }; - if (!queue) { - noSuchQueue(name); - } + return CachedReference; + })(); - if (!method) { - noSuchMethod(name); - } + var MapperReference = (function (_CachedReference) { + babelHelpers.inherits(MapperReference, _CachedReference); - if (onceFlag) { - return queue.pushUnique(target, method, args, stack); - } else { - return queue.push(target, method, args, stack); - } - }, + function MapperReference(reference, mapper) { + _CachedReference.call(this); + this.tag = reference.tag; + this.reference = reference; + this.mapper = mapper; + } - flush: function() { - var queues = this.queues; - var queueNames = this.queueNames; - var queueName, queue; - var queueNameIndex = 0; - var numberOfQueues = queueNames.length; + MapperReference.prototype.compute = function compute() { + var reference = this.reference; + var mapper = this.mapper; - while (queueNameIndex < numberOfQueues) { - queueName = queueNames[queueNameIndex]; - queue = queues[queueName]; + return mapper(reference.value()); + }; - var numberOfQueueItems = queue._queue.length; + return MapperReference; + })(CachedReference); - if (numberOfQueueItems === 0) { - queueNameIndex++; - } else { - queue.flush(false /* async */); - queueNameIndex = 0; - } + function map(reference, mapper) { + return new MapperReference(reference, mapper); } - } -}; - -function Backburner(queueNames, options) { - this.queueNames = queueNames; - this.options = options || {}; - if (!this.options.defaultQueue) { - this.options.defaultQueue = queueNames[0]; - } - this.instanceStack = []; - this._debouncees = []; - this._throttlers = []; - this._eventCallbacks = { - end: [], - begin: [] - }; - - var _this = this; - this._boundClearItems = function() { - clearItems(); - }; - - this._timerTimeoutId = undefined; - this._timers = []; + ////////// - this._platform = this.options._platform || { - setTimeout: function (fn, ms) { - return setTimeout(fn, ms); - }, - clearTimeout: function (id) { - clearTimeout(id); - } - }; + var ReferenceCache = (function () { + function ReferenceCache(reference) { + this.lastValue = null; + this.lastRevision = null; + this.initialized = false; + this.tag = reference.tag; + this.reference = reference; + } - this._boundRunExpiredTimers = function () { - _this._runExpiredTimers(); - }; -} + ReferenceCache.prototype.peek = function peek() { + if (!this.initialized) { + return this.initialize(); + } + return this.lastValue; + }; -Backburner.prototype = { - begin: function() { - var options = this.options; - var onBegin = options && options.onBegin; - var previousInstance = this.currentInstance; + ReferenceCache.prototype.revalidate = function revalidate() { + if (!this.initialized) { + return this.initialize(); + } + var reference = this.reference; + var lastRevision = this.lastRevision; - if (previousInstance) { - this.instanceStack.push(previousInstance); - } + var tag = reference.tag; + if (tag.validate(lastRevision)) return NOT_MODIFIED; + this.lastRevision = tag.value(); + var lastValue = this.lastValue; - this.currentInstance = new DeferredActionQueues(this.queueNames, options); - this._trigger('begin', this.currentInstance, previousInstance); - if (onBegin) { - onBegin(this.currentInstance, previousInstance); - } - }, + var value = reference.value(); + if (value === lastValue) return NOT_MODIFIED; + this.lastValue = value; + return value; + }; - end: function() { - var options = this.options; - var onEnd = options && options.onEnd; - var currentInstance = this.currentInstance; - var nextInstance = null; + ReferenceCache.prototype.initialize = function initialize() { + var reference = this.reference; - // Prevent double-finally bug in Safari 6.0.2 and iOS 6 - // This bug appears to be resolved in Safari 6.0.5 and iOS 7 - var finallyAlreadyCalled = false; - try { - currentInstance.flush(); - } finally { - if (!finallyAlreadyCalled) { - finallyAlreadyCalled = true; + var value = this.lastValue = reference.value(); + this.lastRevision = reference.tag.value(); + this.initialized = true; + return value; + }; - this.currentInstance = null; + return ReferenceCache; + })(); - if (this.instanceStack.length) { - nextInstance = this.instanceStack.pop(); - this.currentInstance = nextInstance; - } - this._trigger('end', currentInstance, nextInstance); - if (onEnd) { - onEnd(currentInstance, nextInstance); - } - } + var NOT_MODIFIED = "adb3b78e-3d22-4e4b-877a-6317c2c5c145"; + function isModified(value) { + return value !== NOT_MODIFIED; } - }, - /** - 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. + var ConstReference = (function () { + function ConstReference(inner) { + this.inner = inner; + this.tag = CONSTANT_TAG; + } - @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); - } - } - }, + ConstReference.prototype.value = function value() { + return this.inner; + }; - 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'); - } - }, + return ConstReference; + })(); - 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'); + function isConst(reference) { + return reference.tag === CONSTANT_TAG; } - }, - - run: function(/* target, method, args */) { - var length = arguments.length; - var method, target, args; - if (length === 1) { - method = arguments[0]; - target = null; - } else { - target = arguments[0]; - method = arguments[1]; - } + var ListItem = (function (_ListNode) { + babelHelpers.inherits(ListItem, _ListNode); - if (isString(method)) { - method = target[method]; - } + function ListItem(iterable, result) { + _ListNode.call(this, iterable.valueReferenceFor(result)); + this.retained = false; + this.seen = false; + this.key = result.key; + this.iterable = iterable; + this.memo = iterable.memoReferenceFor(result); + } - if (length > 2) { - args = new Array(length - 2); - for (var i = 0, l = length - 2; i < l; i++) { - args[i] = arguments[i + 2]; - } - } else { - args = []; - } + ListItem.prototype.update = function update(item) { + this.retained = true; + this.iterable.updateValueReference(this.value, item); + this.iterable.updateMemoReference(this.memo, item); + }; - var onError = getOnError(this.options); + ListItem.prototype.shouldRemove = function shouldRemove() { + return !this.retained; + }; - this.begin(); + ListItem.prototype.reset = function reset() { + this.retained = false; + this.seen = false; + }; - // guard against Safari 6's double-finally bug - var didFinally = false; + return ListItem; + })(_glimmerUtil.ListNode); - if (onError) { - try { - return method.apply(target, args); - } catch(error) { - onError(error); - } finally { - if (!didFinally) { - didFinally = true; - this.end(); - } - } - } else { - try { - return method.apply(target, args); - } finally { - if (!didFinally) { - didFinally = true; - this.end(); + var IterationArtifacts = (function () { + function IterationArtifacts(iterable) { + this.map = _glimmerUtil.dict(); + this.list = new _glimmerUtil.LinkedList(); + this.tag = iterable.tag; + this.iterable = iterable; } - } - } - }, - /* - Join the passed method with an existing queue and execute immediately, - if there isn't one use `Backburner#run`. + IterationArtifacts.prototype.isEmpty = function isEmpty() { + var iterator = this.iterator = this.iterable.iterate(); + return iterator.isEmpty(); + }; - The join method is like the run method except that it will schedule into - an existing queue if one already exists. In either case, the join method will - immediately execute the passed in function and return its result. + IterationArtifacts.prototype.iterate = function iterate() { + var iterator = this.iterator || this.iterable.iterate(); + this.iterator = null; + return iterator; + }; - @method join - @param {Object} target - @param {Function} method The method to be executed - @param {any} args The method arguments - @return method result - */ - join: function(/* target, method, args */) { - if (!this.currentInstance) { - return this.run.apply(this, arguments); - } + IterationArtifacts.prototype.has = function has(key) { + return !!this.map[key]; + }; - var length = arguments.length; - var method, target; + IterationArtifacts.prototype.get = function get(key) { + return this.map[key]; + }; - if (length === 1) { - method = arguments[0]; - target = null; - } else { - target = arguments[0]; - method = arguments[1]; - } + IterationArtifacts.prototype.wasSeen = function wasSeen(key) { + var node = this.map[key]; + return node && node.seen; + }; - if (isString(method)) { - method = target[method]; - } + IterationArtifacts.prototype.append = function append(item) { + var map = this.map; + var list = this.list; + var iterable = this.iterable; - if (length === 1) { - return method(); - } else if (length === 2) { - return method.call(target); - } else { - var args = new Array(length - 2); - for (var i = 0, l = length - 2; i < l; i++) { - args[i] = arguments[i + 2]; - } - return method.apply(target, args); - } - }, + var node = map[item.key] = new ListItem(iterable, item); + list.append(node); + return node; + }; + IterationArtifacts.prototype.insertBefore = function insertBefore(item, reference) { + var map = this.map; + var list = this.list; + var iterable = this.iterable; - /* - Defer the passed function to run inside the specified queue. + var node = map[item.key] = new ListItem(iterable, item); + node.retained = true; + list.insertBefore(node, reference); + return node; + }; - @method defer - @param {String} queueName - @param {Object} target - @param {Function|String} method The method or method name to be executed - @param {any} args The method arguments - @return method result - */ - defer: function(queueName /* , target, method, args */) { - var length = arguments.length; - var method, target, args; + IterationArtifacts.prototype.move = function move(item, reference) { + var list = this.list; - if (length === 2) { - method = arguments[1]; - target = null; - } else { - target = arguments[1]; - method = arguments[2]; - } + item.retained = true; + list.remove(item); + list.insertBefore(item, reference); + }; - if (isString(method)) { - method = target[method]; - } + IterationArtifacts.prototype.remove = function remove(item) { + var list = this.list; - var stack = this.DEBUG ? new Error() : undefined; + list.remove(item); + delete this.map[item.key]; + }; - if (length > 3) { - args = new Array(length - 3); - for (var i = 3; i < length; i++) { - args[i-3] = arguments[i]; - } - } else { - args = undefined; - } + IterationArtifacts.prototype.nextNode = function nextNode(item) { + return this.list.nextNode(item); + }; - if (!this.currentInstance) { createAutorun(this); } - return this.currentInstance.schedule(queueName, target, method, args, false, stack); - }, + IterationArtifacts.prototype.head = function head() { + return this.list.head(); + }; - deferOnce: function(queueName /* , target, method, args */) { - var length = arguments.length; - var method, target, args; + return IterationArtifacts; + })(); - if (length === 2) { - method = arguments[1]; - target = null; - } else { - target = arguments[1]; - method = arguments[2]; - } + var ReferenceIterator = (function () { + // if anyone needs to construct this object with something other than + // an iterable, let @wycats know. - if (isString(method)) { - method = target[method]; - } + function ReferenceIterator(iterable) { + this.iterator = null; + var artifacts = new IterationArtifacts(iterable); + this.artifacts = artifacts; + } - var stack = this.DEBUG ? new Error() : undefined; + ReferenceIterator.prototype.next = function next() { + var artifacts = this.artifacts; - if (length > 3) { - args = new Array(length - 3); - for (var i = 3; i < length; i++) { - args[i-3] = arguments[i]; - } - } else { - args = undefined; - } + var iterator = this.iterator = this.iterator || artifacts.iterate(); + var item = iterator.next(); + if (!item) return null; + return artifacts.append(item); + }; - if (!this.currentInstance) { - createAutorun(this); - } - return this.currentInstance.schedule(queueName, target, method, args, true, stack); - }, + return ReferenceIterator; + })(); - setTimeout: function() { - var l = arguments.length; - var args = new Array(l); + var Phase; + (function (Phase) { + Phase[Phase["Append"] = 0] = "Append"; + Phase[Phase["Prune"] = 1] = "Prune"; + Phase[Phase["Done"] = 2] = "Done"; + })(Phase || (Phase = {})); - for (var x = 0; x < l; x++) { - args[x] = arguments[x]; - } + var IteratorSynchronizer = (function () { + function IteratorSynchronizer(_ref) { + var target = _ref.target; + var artifacts = _ref.artifacts; - var length = args.length, - method, wait, target, - methodOrTarget, methodOrWait, methodOrArgs; + this.target = target; + this.artifacts = artifacts; + this.iterator = artifacts.iterate(); + this.current = artifacts.head(); + } - if (length === 0) { - return; - } else if (length === 1) { - method = args.shift(); - wait = 0; - } else if (length === 2) { - methodOrTarget = args[0]; - methodOrWait = args[1]; + IteratorSynchronizer.prototype.sync = function sync() { + var phase = Phase.Append; + while (true) { + switch (phase) { + case Phase.Append: + phase = this.nextAppend(); + break; + case Phase.Prune: + phase = this.nextPrune(); + break; + case Phase.Done: + this.nextDone(); + return; + } + } + }; - if (isFunction(methodOrWait) || isFunction(methodOrTarget[methodOrWait])) { - target = args.shift(); - method = args.shift(); - wait = 0; - } else if (isCoercableNumber(methodOrWait)) { - method = args.shift(); - wait = args.shift(); - } else { - method = args.shift(); - wait = 0; - } - } else { - var last = args[args.length - 1]; + IteratorSynchronizer.prototype.advanceToKey = function advanceToKey(key) { + var current = this.current; + var artifacts = this.artifacts; - if (isCoercableNumber(last)) { - wait = args.pop(); - } else { - wait = 0; - } + var seek = current; + while (seek && seek.key !== key) { + seek.seen = true; + seek = artifacts.nextNode(seek); + } + this.current = seek && artifacts.nextNode(seek); + }; - methodOrTarget = args[0]; - methodOrArgs = args[1]; + IteratorSynchronizer.prototype.nextAppend = function nextAppend() { + var iterator = this.iterator; + var current = this.current; + var artifacts = this.artifacts; - if (isFunction(methodOrArgs) || (isString(methodOrArgs) && - methodOrTarget !== null && - methodOrArgs in methodOrTarget)) { - target = args.shift(); - method = args.shift(); - } else { - method = args.shift(); - } - } - - var executeAt = Date.now() + parseInt(wait !== wait ? 0 : wait, 10); - - if (isString(method)) { - method = target[method]; - } - - var onError = getOnError(this.options); + var item = iterator.next(); + if (item === null) { + return this.startPrune(); + } + var key = item.key; - function fn() { - if (onError) { - try { - method.apply(target, args); - } catch (e) { - onError(e); - } - } else { - method.apply(target, args); - } - } + if (current && current.key === key) { + this.nextRetain(item); + } else if (artifacts.has(key)) { + this.nextMove(item); + } else { + this.nextInsert(item); + } + return Phase.Append; + }; - return this._setTimeout(fn, executeAt); - }, + IteratorSynchronizer.prototype.nextRetain = function nextRetain(item) { + var artifacts = this.artifacts; + var current = this.current; - _setTimeout: function (fn, executeAt) { - if (this._timers.length === 0) { - this._timers.push(executeAt, fn); - this._installTimerTimeout(); - return fn; - } + current = _glimmerUtil.expect(current, 'BUG: current is empty'); + current.update(item); + this.current = artifacts.nextNode(current); + this.target.retain(item.key, current.value, current.memo); + }; - // find position to insert - var i = binarySearch(executeAt, this._timers); + IteratorSynchronizer.prototype.nextMove = function nextMove(item) { + var current = this.current; + var artifacts = this.artifacts; + var target = this.target; + var key = item.key; - this._timers.splice(i, 0, executeAt, fn); + var found = artifacts.get(item.key); + found.update(item); + if (artifacts.wasSeen(item.key)) { + artifacts.move(found, current); + target.move(found.key, found.value, found.memo, current ? current.key : null); + } else { + this.advanceToKey(key); + } + }; - // we should be the new earliest timer if i == 0 - if (i === 0) { - this._reinstallTimerTimeout(); - } + IteratorSynchronizer.prototype.nextInsert = function nextInsert(item) { + var artifacts = this.artifacts; + var target = this.target; + var current = this.current; - return fn; - }, + var node = artifacts.insertBefore(item, current); + target.insert(node.key, node.value, node.memo, current ? current.key : null); + }; - throttle: function(target, method /* , args, wait, [immediate] */) { - var backburner = this; - var args = new Array(arguments.length); - for (var i = 0; i < arguments.length; i++) { - args[i] = arguments[i]; - } - var immediate = args.pop(); - var wait, throttler, index, timer; + IteratorSynchronizer.prototype.startPrune = function startPrune() { + this.current = this.artifacts.head(); + return Phase.Prune; + }; - if (isNumber(immediate) || isString(immediate)) { - wait = immediate; - immediate = true; - } else { - wait = args.pop(); - } + IteratorSynchronizer.prototype.nextPrune = function nextPrune() { + var artifacts = this.artifacts; + var target = this.target; + var current = this.current; - wait = parseInt(wait, 10); + if (current === null) { + return Phase.Done; + } + var node = current; + this.current = artifacts.nextNode(node); + if (node.shouldRemove()) { + artifacts.remove(node); + target.delete(node.key); + } else { + node.reset(); + } + return Phase.Prune; + }; - index = findThrottler(target, method, this._throttlers); - if (index > -1) { return this._throttlers[index]; } // throttled + IteratorSynchronizer.prototype.nextDone = function nextDone() { + this.target.done(); + }; - timer = this._platform.setTimeout(function() { - if (!immediate) { - backburner.run.apply(backburner, args); - } - var index = findThrottler(target, method, backburner._throttlers); - if (index > -1) { - backburner._throttlers.splice(index, 1); - } - }, wait); + return IteratorSynchronizer; + })(); - if (immediate) { - this.run.apply(this, args); + function referenceFromParts(root, parts) { + var reference = root; + for (var i = 0; i < parts.length; i++) { + reference = reference.get(parts[i]); + } + return reference; } - throttler = [target, method, timer]; + exports.ConstReference = ConstReference; + exports.isConst = isConst; + exports.ListItem = ListItem; + exports.referenceFromParts = referenceFromParts; + exports.IterationArtifacts = IterationArtifacts; + exports.ReferenceIterator = ReferenceIterator; + exports.IteratorSynchronizer = IteratorSynchronizer; + exports.CONSTANT = CONSTANT; + exports.INITIAL = INITIAL; + exports.VOLATILE = VOLATILE; + exports.RevisionTag = RevisionTag; + exports.DirtyableTag = DirtyableTag; + exports.combineTagged = combineTagged; + exports.combineSlice = combineSlice; + exports.combine = combine; + exports.CachedTag = CachedTag; + exports.UpdatableTag = UpdatableTag; + exports.CONSTANT_TAG = CONSTANT_TAG; + exports.VOLATILE_TAG = VOLATILE_TAG; + exports.CURRENT_TAG = CURRENT_TAG; + exports.CachedReference = CachedReference; + exports.map = map; + exports.ReferenceCache = ReferenceCache; + exports.isModified = isModified; +}); +enifed('@glimmer/runtime',['exports','@glimmer/util','@glimmer/reference','@glimmer/wire-format'],function(exports,_glimmerUtil,_glimmerReference,_glimmerWireFormat){'use strict';var PrimitiveReference=(function(_ConstReference){babelHelpers.inherits(PrimitiveReference,_ConstReference);function PrimitiveReference(value){_ConstReference.call(this,value);}PrimitiveReference.create = function create(value){if(value === undefined){return UNDEFINED_REFERENCE;}else if(value === null){return NULL_REFERENCE;}else if(value === true){return TRUE_REFERENCE;}else if(value === false){return FALSE_REFERENCE;}else if(typeof value === 'number'){return new ValueReference(value);}else {return new StringReference(value);}};PrimitiveReference.prototype.get = function get(_key){return UNDEFINED_REFERENCE;};return PrimitiveReference;})(_glimmerReference.ConstReference);var StringReference=(function(_PrimitiveReference){babelHelpers.inherits(StringReference,_PrimitiveReference);function StringReference(){_PrimitiveReference.apply(this,arguments);this.lengthReference = null;}StringReference.prototype.get = function get(key){if(key === 'length'){var lengthReference=this.lengthReference;if(lengthReference === null){lengthReference = this.lengthReference = new ValueReference(this.inner.length);}return lengthReference;}else {return _PrimitiveReference.prototype.get.call(this,key);}};return StringReference;})(PrimitiveReference);var ValueReference=(function(_PrimitiveReference2){babelHelpers.inherits(ValueReference,_PrimitiveReference2);function ValueReference(value){_PrimitiveReference2.call(this,value);}return ValueReference;})(PrimitiveReference);var UNDEFINED_REFERENCE=new ValueReference(undefined);var NULL_REFERENCE=new ValueReference(null);var TRUE_REFERENCE=new ValueReference(true);var FALSE_REFERENCE=new ValueReference(false);var ConditionalReference=(function(){function ConditionalReference(inner){this.inner = inner;this.tag = inner.tag;}ConditionalReference.prototype.value = function value(){return this.toBool(this.inner.value());};ConditionalReference.prototype.toBool = function toBool(value){return !!value;};return ConditionalReference;})();var Constants=(function(){function Constants(){ // `0` means NULL +this.references = [];this.strings = [];this.expressions = [];this.arrays = [];this.slices = [];this.blocks = [];this.functions = [];this.others = [];this.NULL_REFERENCE = this.reference(NULL_REFERENCE);this.UNDEFINED_REFERENCE = this.reference(UNDEFINED_REFERENCE);}Constants.prototype.getReference = function getReference(value){return this.references[value - 1];};Constants.prototype.reference = function reference(value){var index=this.references.length;this.references.push(value);return index + 1;};Constants.prototype.getString = function getString(value){return this.strings[value - 1];};Constants.prototype.string = function string(value){var index=this.strings.length;this.strings.push(value);return index + 1;};Constants.prototype.getExpression = function getExpression(value){return this.expressions[value - 1];};Constants.prototype.expression = function expression(value){var index=this.expressions.length;this.expressions.push(value);return index + 1;};Constants.prototype.getArray = function getArray(value){return this.arrays[value - 1];};Constants.prototype.array = function array(values){var index=this.arrays.length;this.arrays.push(values);return index + 1;};Constants.prototype.getSlice = function getSlice(value){return this.slices[value - 1];};Constants.prototype.slice = function slice(_slice2){ // TODO: Put the entire program in one big array +var index=this.slices.length;this.slices.push(_slice2);return index + 1;};Constants.prototype.getBlock = function getBlock(value){return this.blocks[value - 1];};Constants.prototype.block = function block(_block2){var index=this.blocks.length;this.blocks.push(_block2);return index + 1;};Constants.prototype.getFunction = function getFunction(value){return this.functions[value - 1];};Constants.prototype.function = function _function(f){var index=this.functions.length;this.functions.push(f);return index + 1;};Constants.prototype.getOther = function getOther(value){return this.others[value - 1];};Constants.prototype.other = function other(_other){var index=this.others.length;this.others.push(_other);return index + 1;};return Constants;})();var AppendOpcodes=(function(){function AppendOpcodes(){this.evaluateOpcode = _glimmerUtil.fillNulls(51 /* EvaluatePartial */ + 1);}AppendOpcodes.prototype.add = function add(name,evaluate){this.evaluateOpcode[name] = evaluate;};AppendOpcodes.prototype.construct = function construct(name,_debug,op1,op2,op3){return [name | 0,(op1 || 0) | 0,(op2 || 0) | 0,(op3 || 0) | 0];};AppendOpcodes.prototype.evaluate = function evaluate(vm,opcode){_glimmerUtil.LOGGER.debug('[VM] OPCODE: ' + opcode.type);var func=this.evaluateOpcode[opcode.type];func(vm,opcode);};return AppendOpcodes;})();var APPEND_OPCODES=new AppendOpcodes();var AbstractOpcode=(function(){function AbstractOpcode(){_glimmerUtil.initializeGuid(this);}AbstractOpcode.prototype.toJSON = function toJSON(){return {guid:this._guid,type:this.type};};return AbstractOpcode;})();var UpdatingOpcode=(function(_AbstractOpcode){babelHelpers.inherits(UpdatingOpcode,_AbstractOpcode);function UpdatingOpcode(){_AbstractOpcode.apply(this,arguments);this.next = null;this.prev = null;}return UpdatingOpcode;})(AbstractOpcode);APPEND_OPCODES.add(20, /* OpenBlock */function(vm,_ref){var _getBlock=_ref.op1;var _args=_ref.op2;var inner=vm.constants.getOther(_getBlock);var rawArgs=vm.constants.getExpression(_args);var args=null;var block=inner.evaluate(vm);if(block){args = rawArgs.evaluate(vm);} // FIXME: can we avoid doing this when we don't have a block? +vm.pushCallerScope();if(block){vm.invokeBlock(block,args || null);}});APPEND_OPCODES.add(21, /* CloseBlock */function(vm){return vm.popScope();});APPEND_OPCODES.add(0, /* PushChildScope */function(vm){return vm.pushChildScope();});APPEND_OPCODES.add(1, /* PopScope */function(vm){return vm.popScope();});APPEND_OPCODES.add(2, /* PushDynamicScope */function(vm){return vm.pushDynamicScope();});APPEND_OPCODES.add(3, /* PopDynamicScope */function(vm){return vm.popDynamicScope();});APPEND_OPCODES.add(4, /* Put */function(vm,_ref2){var reference=_ref2.op1;vm.frame.setOperand(vm.constants.getReference(reference));});APPEND_OPCODES.add(5, /* EvaluatePut */function(vm,_ref3){var expression=_ref3.op1;var expr=vm.constants.getExpression(expression);vm.evaluateOperand(expr);});APPEND_OPCODES.add(6, /* PutArgs */function(vm,_ref4){var args=_ref4.op1;vm.evaluateArgs(vm.constants.getExpression(args));});APPEND_OPCODES.add(7, /* BindPositionalArgs */function(vm,_ref5){var _symbols=_ref5.op1;var symbols=vm.constants.getArray(_symbols);vm.bindPositionalArgs(symbols);});APPEND_OPCODES.add(8, /* BindNamedArgs */function(vm,_ref6){var _names=_ref6.op1;var _symbols=_ref6.op2;var names=vm.constants.getArray(_names);var symbols=vm.constants.getArray(_symbols);vm.bindNamedArgs(names,symbols);});APPEND_OPCODES.add(9, /* BindBlocks */function(vm,_ref7){var _names=_ref7.op1;var _symbols=_ref7.op2;var names=vm.constants.getArray(_names);var symbols=vm.constants.getArray(_symbols);vm.bindBlocks(names,symbols);});APPEND_OPCODES.add(10, /* BindPartialArgs */function(vm,_ref8){var symbol=_ref8.op1;vm.bindPartialArgs(symbol);});APPEND_OPCODES.add(11, /* BindCallerScope */function(vm){return vm.bindCallerScope();});APPEND_OPCODES.add(12, /* BindDynamicScope */function(vm,_ref9){var _names=_ref9.op1;var names=vm.constants.getArray(_names);vm.bindDynamicScope(names);});APPEND_OPCODES.add(13, /* Enter */function(vm,_ref10){var slice=_ref10.op1;return vm.enter(slice);});APPEND_OPCODES.add(14, /* Exit */function(vm){return vm.exit();});APPEND_OPCODES.add(15, /* Evaluate */function(vm,_ref11){var _block=_ref11.op1;var block=vm.constants.getBlock(_block);var args=vm.frame.getArgs();vm.invokeBlock(block,args);});APPEND_OPCODES.add(16, /* Jump */function(vm,_ref12){var target=_ref12.op1;return vm.goto(target);});APPEND_OPCODES.add(17, /* JumpIf */function(vm,_ref13){var target=_ref13.op1;var reference=vm.frame.getCondition();if(_glimmerReference.isConst(reference)){if(reference.value()){vm.goto(target);}}else {var cache=new _glimmerReference.ReferenceCache(reference);if(cache.peek()){vm.goto(target);}vm.updateWith(new Assert(cache));}});APPEND_OPCODES.add(18, /* JumpUnless */function(vm,_ref14){var target=_ref14.op1;var reference=vm.frame.getCondition();if(_glimmerReference.isConst(reference)){if(!reference.value()){vm.goto(target);}}else {var cache=new _glimmerReference.ReferenceCache(reference);if(!cache.peek()){vm.goto(target);}vm.updateWith(new Assert(cache));}});var ConstTest=function(ref,_env){return new _glimmerReference.ConstReference(!!ref.value());};var SimpleTest=function(ref,_env){return ref;};var EnvironmentTest=function(ref,env){return env.toConditionalReference(ref);};APPEND_OPCODES.add(19, /* Test */function(vm,_ref15){var _func=_ref15.op1;var operand=vm.frame.getOperand();var func=vm.constants.getFunction(_func);vm.frame.setCondition(func(operand,vm.env));});var Assert=(function(_UpdatingOpcode){babelHelpers.inherits(Assert,_UpdatingOpcode);function Assert(cache){_UpdatingOpcode.call(this);this.type = "assert";this.tag = cache.tag;this.cache = cache;}Assert.prototype.evaluate = function evaluate(vm){var cache=this.cache;if(_glimmerReference.isModified(cache.revalidate())){vm.throw();}};Assert.prototype.toJSON = function toJSON(){var type=this.type;var _guid=this._guid;var cache=this.cache;var expected=undefined;try{expected = JSON.stringify(cache.peek());}catch(e) {expected = String(cache.peek());}return {guid:_guid,type:type,args:[],details:{expected:expected}};};return Assert;})(UpdatingOpcode);var JumpIfNotModifiedOpcode=(function(_UpdatingOpcode2){babelHelpers.inherits(JumpIfNotModifiedOpcode,_UpdatingOpcode2);function JumpIfNotModifiedOpcode(tag,target){_UpdatingOpcode2.call(this);this.target = target;this.type = "jump-if-not-modified";this.tag = tag;this.lastRevision = tag.value();}JumpIfNotModifiedOpcode.prototype.evaluate = function evaluate(vm){var tag=this.tag;var target=this.target;var lastRevision=this.lastRevision;if(!vm.alwaysRevalidate && tag.validate(lastRevision)){vm.goto(target);}};JumpIfNotModifiedOpcode.prototype.didModify = function didModify(){this.lastRevision = this.tag.value();};JumpIfNotModifiedOpcode.prototype.toJSON = function toJSON(){return {guid:this._guid,type:this.type,args:[JSON.stringify(this.target.inspect())]};};return JumpIfNotModifiedOpcode;})(UpdatingOpcode);var DidModifyOpcode=(function(_UpdatingOpcode3){babelHelpers.inherits(DidModifyOpcode,_UpdatingOpcode3);function DidModifyOpcode(target){_UpdatingOpcode3.call(this);this.target = target;this.type = "did-modify";this.tag = _glimmerReference.CONSTANT_TAG;}DidModifyOpcode.prototype.evaluate = function evaluate(){this.target.didModify();};return DidModifyOpcode;})(UpdatingOpcode);var LabelOpcode=(function(){function LabelOpcode(label){this.tag = _glimmerReference.CONSTANT_TAG;this.type = "label";this.label = null;this.prev = null;this.next = null;_glimmerUtil.initializeGuid(this);if(label)this.label = label;}LabelOpcode.prototype.evaluate = function evaluate(){};LabelOpcode.prototype.inspect = function inspect(){return this.label + ' [' + this._guid + ']';};LabelOpcode.prototype.toJSON = function toJSON(){return {guid:this._guid,type:this.type,args:[JSON.stringify(this.inspect())]};};return LabelOpcode;})();var EMPTY_ARRAY=_glimmerUtil.HAS_NATIVE_WEAKMAP?Object.freeze([]):[];var EMPTY_DICT=_glimmerUtil.HAS_NATIVE_WEAKMAP?Object.freeze(_glimmerUtil.dict()):_glimmerUtil.dict();var CompiledPositionalArgs=(function(){function CompiledPositionalArgs(values){this.values = values;this.length = values.length;}CompiledPositionalArgs.create = function create(values){if(values.length){return new this(values);}else {return COMPILED_EMPTY_POSITIONAL_ARGS;}};CompiledPositionalArgs.empty = function empty(){return COMPILED_EMPTY_POSITIONAL_ARGS;};CompiledPositionalArgs.prototype.evaluate = function evaluate(vm){var values=this.values;var length=this.length;var references=new Array(length);for(var i=0;i < length;i++) {references[i] = values[i].evaluate(vm);}return EvaluatedPositionalArgs.create(references);};CompiledPositionalArgs.prototype.toJSON = function toJSON(){return '[' + this.values.map(function(value){return value.toJSON();}).join(", ") + ']';};return CompiledPositionalArgs;})();var COMPILED_EMPTY_POSITIONAL_ARGS=new ((function(_CompiledPositionalArgs){babelHelpers.inherits(_class,_CompiledPositionalArgs);function _class(){_CompiledPositionalArgs.call(this,EMPTY_ARRAY);}_class.prototype.evaluate = function evaluate(_vm){return EVALUATED_EMPTY_POSITIONAL_ARGS;};_class.prototype.toJSON = function toJSON(){return '';};return _class;})(CompiledPositionalArgs))();var EvaluatedPositionalArgs=(function(){function EvaluatedPositionalArgs(values){this.values = values;this.tag = _glimmerReference.combineTagged(values);this.length = values.length;}EvaluatedPositionalArgs.create = function create(values){return new this(values);};EvaluatedPositionalArgs.empty = function empty(){return EVALUATED_EMPTY_POSITIONAL_ARGS;};EvaluatedPositionalArgs.prototype.at = function at(index){var values=this.values;var length=this.length;return index < length?values[index]:UNDEFINED_REFERENCE;};EvaluatedPositionalArgs.prototype.value = function value(){var values=this.values;var length=this.length;var ret=new Array(length);for(var i=0;i < length;i++) {ret[i] = values[i].value();}return ret;};return EvaluatedPositionalArgs;})();var EVALUATED_EMPTY_POSITIONAL_ARGS=new ((function(_EvaluatedPositionalArgs){babelHelpers.inherits(_class2,_EvaluatedPositionalArgs);function _class2(){_EvaluatedPositionalArgs.call(this,EMPTY_ARRAY);}_class2.prototype.at = function at(){return UNDEFINED_REFERENCE;};_class2.prototype.value = function value(){return this.values;};return _class2;})(EvaluatedPositionalArgs))();var CompiledNamedArgs=(function(){function CompiledNamedArgs(keys,values){this.keys = keys;this.values = values;this.length = keys.length;_glimmerUtil.assert(keys.length === values.length,'Keys and values do not have the same length');}CompiledNamedArgs.empty = function empty(){return COMPILED_EMPTY_NAMED_ARGS;};CompiledNamedArgs.create = function create(map){var keys=Object.keys(map);var length=keys.length;if(length > 0){var values=[];for(var i=0;i < length;i++) {values[i] = map[keys[i]];}return new this(keys,values);}else {return COMPILED_EMPTY_NAMED_ARGS;}};CompiledNamedArgs.prototype.evaluate = function evaluate(vm){var keys=this.keys;var values=this.values;var length=this.length;var evaluated=new Array(length);for(var i=0;i < length;i++) {evaluated[i] = values[i].evaluate(vm);}return new EvaluatedNamedArgs(keys,evaluated);};CompiledNamedArgs.prototype.toJSON = function toJSON(){var keys=this.keys;var values=this.values;var inner=keys.map(function(key,i){return key + ': ' + values[i].toJSON();}).join(", ");return '{' + inner + '}';};return CompiledNamedArgs;})();var COMPILED_EMPTY_NAMED_ARGS=new ((function(_CompiledNamedArgs){babelHelpers.inherits(_class3,_CompiledNamedArgs);function _class3(){_CompiledNamedArgs.call(this,EMPTY_ARRAY,EMPTY_ARRAY);}_class3.prototype.evaluate = function evaluate(_vm){return EVALUATED_EMPTY_NAMED_ARGS;};_class3.prototype.toJSON = function toJSON(){return '';};return _class3;})(CompiledNamedArgs))();var EvaluatedNamedArgs=(function(){function EvaluatedNamedArgs(keys,values){var _map=arguments.length <= 2 || arguments[2] === undefined?null:arguments[2];this.keys = keys;this.values = values;this._map = _map;this.tag = _glimmerReference.combineTagged(values);this.length = keys.length;_glimmerUtil.assert(keys.length === values.length,'Keys and values do not have the same length');}EvaluatedNamedArgs.create = function create(map){var keys=Object.keys(map);var length=keys.length;if(length > 0){var values=new Array(length);for(var i=0;i < length;i++) {values[i] = map[keys[i]];}return new this(keys,values,map);}else {return EVALUATED_EMPTY_NAMED_ARGS;}};EvaluatedNamedArgs.empty = function empty(){return EVALUATED_EMPTY_NAMED_ARGS;};EvaluatedNamedArgs.prototype.get = function get(key){var keys=this.keys;var values=this.values;var index=keys.indexOf(key);return index === -1?UNDEFINED_REFERENCE:values[index];};EvaluatedNamedArgs.prototype.has = function has(key){return this.keys.indexOf(key) !== -1;};EvaluatedNamedArgs.prototype.value = function value(){var keys=this.keys;var values=this.values;var out=_glimmerUtil.dict();for(var i=0;i < keys.length;i++) {var key=keys[i];var ref=values[i];out[key] = ref.value();}return out;};babelHelpers.createClass(EvaluatedNamedArgs,[{key:'map',get:function(){var map=this._map;if(map){return map;}map = this._map = _glimmerUtil.dict();var keys=this.keys;var values=this.values;var length=this.length;for(var i=0;i < length;i++) {map[keys[i]] = values[i];}return map;}}]);return EvaluatedNamedArgs;})();var EVALUATED_EMPTY_NAMED_ARGS=new ((function(_EvaluatedNamedArgs){babelHelpers.inherits(_class4,_EvaluatedNamedArgs);function _class4(){_EvaluatedNamedArgs.call(this,EMPTY_ARRAY,EMPTY_ARRAY,EMPTY_DICT);}_class4.prototype.get = function get(){return UNDEFINED_REFERENCE;};_class4.prototype.has = function has(_key){return false;};_class4.prototype.value = function value(){return EMPTY_DICT;};return _class4;})(EvaluatedNamedArgs))();var EMPTY_BLOCKS={default:null,inverse:null};var CompiledArgs=(function(){function CompiledArgs(positional,named,blocks){this.positional = positional;this.named = named;this.blocks = blocks;this.type = "compiled-args";}CompiledArgs.create = function create(positional,named,blocks){if(positional === COMPILED_EMPTY_POSITIONAL_ARGS && named === COMPILED_EMPTY_NAMED_ARGS && blocks === EMPTY_BLOCKS){return this.empty();}else {return new this(positional,named,blocks);}};CompiledArgs.empty = function empty(){return COMPILED_EMPTY_ARGS;};CompiledArgs.prototype.evaluate = function evaluate(vm){var positional=this.positional;var named=this.named;var blocks=this.blocks;return EvaluatedArgs.create(positional.evaluate(vm),named.evaluate(vm),blocks);};return CompiledArgs;})();var COMPILED_EMPTY_ARGS=new ((function(_CompiledArgs){babelHelpers.inherits(_class5,_CompiledArgs);function _class5(){_CompiledArgs.call(this,COMPILED_EMPTY_POSITIONAL_ARGS,COMPILED_EMPTY_NAMED_ARGS,EMPTY_BLOCKS);}_class5.prototype.evaluate = function evaluate(_vm){return EMPTY_EVALUATED_ARGS;};return _class5;})(CompiledArgs))();var EvaluatedArgs=(function(){function EvaluatedArgs(positional,named,blocks){this.positional = positional;this.named = named;this.blocks = blocks;this.tag = _glimmerReference.combineTagged([positional,named]);}EvaluatedArgs.empty = function empty(){return EMPTY_EVALUATED_ARGS;};EvaluatedArgs.create = function create(positional,named,blocks){return new this(positional,named,blocks);};EvaluatedArgs.positional = function positional(values){var blocks=arguments.length <= 1 || arguments[1] === undefined?EMPTY_BLOCKS:arguments[1];return new this(EvaluatedPositionalArgs.create(values),EVALUATED_EMPTY_NAMED_ARGS,blocks);};EvaluatedArgs.named = function named(map){var blocks=arguments.length <= 1 || arguments[1] === undefined?EMPTY_BLOCKS:arguments[1];return new this(EVALUATED_EMPTY_POSITIONAL_ARGS,EvaluatedNamedArgs.create(map),blocks);};return EvaluatedArgs;})();var EMPTY_EVALUATED_ARGS=new EvaluatedArgs(EVALUATED_EMPTY_POSITIONAL_ARGS,EVALUATED_EMPTY_NAMED_ARGS,EMPTY_BLOCKS);APPEND_OPCODES.add(22, /* PutDynamicComponent */function(vm){var reference=vm.frame.getOperand();var cache=_glimmerReference.isConst(reference)?undefined:new _glimmerReference.ReferenceCache(reference);var definition=cache?cache.peek():reference.value();vm.frame.setImmediate(definition);if(cache){vm.updateWith(new Assert(cache));}});APPEND_OPCODES.add(23, /* PutComponent */function(vm,_ref16){var _component=_ref16.op1;var definition=vm.constants.getOther(_component);vm.frame.setImmediate(definition);});APPEND_OPCODES.add(24, /* OpenComponent */function(vm,_ref17){var _args=_ref17.op1;var _shadow=_ref17.op2;var rawArgs=vm.constants.getExpression(_args);var shadow=vm.constants.getBlock(_shadow);var definition=vm.frame.getImmediate();var dynamicScope=vm.pushDynamicScope();var callerScope=vm.scope();var manager=definition.manager;var args=manager.prepareArgs(definition,rawArgs.evaluate(vm),dynamicScope);var hasDefaultBlock=!!args.blocks.default; // TODO Cleanup? +var component=manager.create(vm.env,definition,args,dynamicScope,vm.getSelf(),hasDefaultBlock);var destructor=manager.getDestructor(component);if(destructor)vm.newDestroyable(destructor);var layout=manager.layoutFor(definition,component,vm.env);var selfRef=manager.getSelf(component);vm.beginCacheGroup();vm.stack().pushSimpleBlock();vm.pushRootScope(selfRef,layout.symbols);vm.invokeLayout(args,layout,callerScope,component,manager,shadow);vm.updateWith(new UpdateComponentOpcode(definition.name,component,manager,args,dynamicScope));}); // export class DidCreateElementOpcode extends Opcode { +// public type = "did-create-element"; +// evaluate(vm: VM) { +// let manager = vm.frame.getManager(); +// let component = vm.frame.getComponent(); +// let action = 'DidCreateElementOpcode#evaluate'; +// manager.didCreateElement(component, vm.stack().expectConstructing(action), vm.stack().expectOperations(action)); +// } +// toJSON(): OpcodeJSON { +// return { +// guid: this._guid, +// type: this.type, +// args: ["$ARGS"] +// }; +// } +// } +APPEND_OPCODES.add(25, /* DidCreateElement */function(vm){var manager=vm.frame.getManager();var component=vm.frame.getComponent();var action='DidCreateElementOpcode#evaluate';manager.didCreateElement(component,vm.stack().expectConstructing(action),vm.stack().expectOperations(action));}); // export class ShadowAttributesOpcode extends Opcode { +// public type = "shadow-attributes"; +// evaluate(vm: VM) { +// let shadow = vm.frame.getShadow(); +// vm.pushCallerScope(); +// if (!shadow) return; +// vm.invokeBlock(shadow, EvaluatedArgs.empty()); +// } +// toJSON(): OpcodeJSON { +// return { +// guid: this._guid, +// type: this.type, +// args: ["$ARGS"] +// }; +// } +// } +// Slow path for non-specialized component invocations. Uses an internal +// named lookup on the args. +APPEND_OPCODES.add(26, /* ShadowAttributes */function(vm){var shadow=vm.frame.getShadow();vm.pushCallerScope();if(!shadow)return;vm.invokeBlock(shadow,EvaluatedArgs.empty());}); // export class DidRenderLayoutOpcode extends Opcode { +// public type = "did-render-layout"; +// evaluate(vm: VM) { +// let manager = vm.frame.getManager(); +// let component = vm.frame.getComponent(); +// let bounds = vm.stack().popBlock(); +// manager.didRenderLayout(component, bounds); +// vm.env.didCreate(component, manager); +// vm.updateWith(new DidUpdateLayoutOpcode(manager, component, bounds)); +// } +// } +APPEND_OPCODES.add(27, /* DidRenderLayout */function(vm){var manager=vm.frame.getManager();var component=vm.frame.getComponent();var bounds=vm.stack().popBlock();manager.didRenderLayout(component,bounds);vm.env.didCreate(component,manager);vm.updateWith(new DidUpdateLayoutOpcode(manager,component,bounds));}); // export class CloseComponentOpcode extends Opcode { +// public type = "close-component"; +// evaluate(vm: VM) { +// vm.popScope(); +// vm.popDynamicScope(); +// vm.commitCacheGroup(); +// } +// } +APPEND_OPCODES.add(28, /* CloseComponent */function(vm){vm.popScope();vm.popDynamicScope();vm.commitCacheGroup();});var UpdateComponentOpcode=(function(_UpdatingOpcode4){babelHelpers.inherits(UpdateComponentOpcode,_UpdatingOpcode4);function UpdateComponentOpcode(name,component,manager,args,dynamicScope){_UpdatingOpcode4.call(this);this.name = name;this.component = component;this.manager = manager;this.args = args;this.dynamicScope = dynamicScope;this.type = "update-component";var componentTag=manager.getTag(component);if(componentTag){this.tag = _glimmerReference.combine([args.tag,componentTag]);}else {this.tag = args.tag;}}UpdateComponentOpcode.prototype.evaluate = function evaluate(_vm){var component=this.component;var manager=this.manager;var args=this.args;var dynamicScope=this.dynamicScope;manager.update(component,args,dynamicScope);};UpdateComponentOpcode.prototype.toJSON = function toJSON(){return {guid:this._guid,type:this.type,args:[JSON.stringify(this.name)]};};return UpdateComponentOpcode;})(UpdatingOpcode);var DidUpdateLayoutOpcode=(function(_UpdatingOpcode5){babelHelpers.inherits(DidUpdateLayoutOpcode,_UpdatingOpcode5);function DidUpdateLayoutOpcode(manager,component,bounds){_UpdatingOpcode5.call(this);this.manager = manager;this.component = component;this.bounds = bounds;this.type = "did-update-layout";this.tag = _glimmerReference.CONSTANT_TAG;}DidUpdateLayoutOpcode.prototype.evaluate = function evaluate(vm){var manager=this.manager;var component=this.component;var bounds=this.bounds;manager.didUpdateLayout(component,bounds);vm.env.didUpdate(component,manager);};return DidUpdateLayoutOpcode;})(UpdatingOpcode);var Cursor=function Cursor(element,nextSibling){this.element = element;this.nextSibling = nextSibling;};var ConcreteBounds=(function(){function ConcreteBounds(parentNode,first,last){this.parentNode = parentNode;this.first = first;this.last = last;}ConcreteBounds.prototype.parentElement = function parentElement(){return this.parentNode;};ConcreteBounds.prototype.firstNode = function firstNode(){return this.first;};ConcreteBounds.prototype.lastNode = function lastNode(){return this.last;};return ConcreteBounds;})();var SingleNodeBounds=(function(){function SingleNodeBounds(parentNode,node){this.parentNode = parentNode;this.node = node;}SingleNodeBounds.prototype.parentElement = function parentElement(){return this.parentNode;};SingleNodeBounds.prototype.firstNode = function firstNode(){return this.node;};SingleNodeBounds.prototype.lastNode = function lastNode(){return this.node;};return SingleNodeBounds;})();function single(parent,node){return new SingleNodeBounds(parent,node);}function moveBounds(bounds,reference){var parent=bounds.parentElement();var first=bounds.firstNode();var last=bounds.lastNode();var node=first;while(node) {var next=node.nextSibling;parent.insertBefore(node,reference);if(node === last)return next;node = next;}return null;}function clear(bounds){var parent=bounds.parentElement();var first=bounds.firstNode();var last=bounds.lastNode();var node=first;while(node) {var next=node.nextSibling;parent.removeChild(node);if(node === last)return next;node = next;}return null;}function isSafeString(value){return !!value && typeof value['toHTML'] === 'function';}function isNode(value){return value !== null && typeof value === 'object' && typeof value['nodeType'] === 'number';}function isString(value){return typeof value === 'string';}var Upsert=function Upsert(bounds){this.bounds = bounds;};function cautiousInsert(dom,cursor,value){if(isString(value)){return TextUpsert.insert(dom,cursor,value);}if(isSafeString(value)){return SafeStringUpsert.insert(dom,cursor,value);}if(isNode(value)){return NodeUpsert.insert(dom,cursor,value);}throw _glimmerUtil.unreachable();}function trustingInsert(dom,cursor,value){if(isString(value)){return HTMLUpsert.insert(dom,cursor,value);}if(isNode(value)){return NodeUpsert.insert(dom,cursor,value);}throw _glimmerUtil.unreachable();}var TextUpsert=(function(_Upsert){babelHelpers.inherits(TextUpsert,_Upsert);TextUpsert.insert = function insert(dom,cursor,value){var textNode=dom.createTextNode(value);dom.insertBefore(cursor.element,textNode,cursor.nextSibling);var bounds=new SingleNodeBounds(cursor.element,textNode);return new TextUpsert(bounds,textNode);};function TextUpsert(bounds,textNode){_Upsert.call(this,bounds);this.textNode = textNode;}TextUpsert.prototype.update = function update(_dom,value){if(isString(value)){var textNode=this.textNode;textNode.nodeValue = value;return true;}else {return false;}};return TextUpsert;})(Upsert);var HTMLUpsert=(function(_Upsert2){babelHelpers.inherits(HTMLUpsert,_Upsert2);function HTMLUpsert(){_Upsert2.apply(this,arguments);}HTMLUpsert.insert = function insert(dom,cursor,value){var bounds=dom.insertHTMLBefore(cursor.element,value,cursor.nextSibling);return new HTMLUpsert(bounds);};HTMLUpsert.prototype.update = function update(dom,value){if(isString(value)){var bounds=this.bounds;var parentElement=bounds.parentElement();var nextSibling=clear(bounds);this.bounds = dom.insertHTMLBefore(parentElement,nextSibling,value);return true;}else {return false;}};return HTMLUpsert;})(Upsert);var SafeStringUpsert=(function(_Upsert3){babelHelpers.inherits(SafeStringUpsert,_Upsert3);function SafeStringUpsert(bounds,lastStringValue){_Upsert3.call(this,bounds);this.lastStringValue = lastStringValue;}SafeStringUpsert.insert = function insert(dom,cursor,value){var stringValue=value.toHTML();var bounds=dom.insertHTMLBefore(cursor.element,stringValue,cursor.nextSibling);return new SafeStringUpsert(bounds,stringValue);};SafeStringUpsert.prototype.update = function update(dom,value){if(isSafeString(value)){var stringValue=value.toHTML();if(stringValue !== this.lastStringValue){var bounds=this.bounds;var parentElement=bounds.parentElement();var nextSibling=clear(bounds);this.bounds = dom.insertHTMLBefore(parentElement,nextSibling,stringValue);this.lastStringValue = stringValue;}return true;}else {return false;}};return SafeStringUpsert;})(Upsert);var NodeUpsert=(function(_Upsert4){babelHelpers.inherits(NodeUpsert,_Upsert4);function NodeUpsert(){_Upsert4.apply(this,arguments);}NodeUpsert.insert = function insert(dom,cursor,node){dom.insertBefore(cursor.element,node,cursor.nextSibling);return new NodeUpsert(single(cursor.element,node));};NodeUpsert.prototype.update = function update(dom,value){if(isNode(value)){var bounds=this.bounds;var parentElement=bounds.parentElement();var nextSibling=clear(bounds);this.bounds = dom.insertNodeBefore(parentElement,value,nextSibling);return true;}else {return false;}};return NodeUpsert;})(Upsert);var COMPONENT_DEFINITION_BRAND='COMPONENT DEFINITION [id=e59c754e-61eb-4392-8c4a-2c0ac72bfcd4]';function isComponentDefinition(obj){return typeof obj === 'object' && obj && obj[COMPONENT_DEFINITION_BRAND];}var ComponentDefinition=function ComponentDefinition(name,manager,ComponentClass){this[COMPONENT_DEFINITION_BRAND] = true;this.name = name;this.manager = manager;this.ComponentClass = ComponentClass;};var CompiledExpression=(function(){function CompiledExpression(){}CompiledExpression.prototype.toJSON = function toJSON(){return 'UNIMPL: ' + this.type.toUpperCase();};return CompiledExpression;})();APPEND_OPCODES.add(29, /* Text */function(vm,_ref18){var text=_ref18.op1;vm.stack().appendText(vm.constants.getString(text));});APPEND_OPCODES.add(30, /* Comment */function(vm,_ref19){var text=_ref19.op1;vm.stack().appendComment(vm.constants.getString(text));});APPEND_OPCODES.add(32, /* OpenElement */function(vm,_ref20){var tag=_ref20.op1;vm.stack().openElement(vm.constants.getString(tag));});APPEND_OPCODES.add(33, /* PushRemoteElement */function(vm){var reference=vm.frame.getOperand();var cache=_glimmerReference.isConst(reference)?undefined:new _glimmerReference.ReferenceCache(reference);var element=cache?cache.peek():reference.value();vm.stack().pushRemoteElement(element);if(cache){vm.updateWith(new Assert(cache));}});APPEND_OPCODES.add(34, /* PopRemoteElement */function(vm){return vm.stack().popRemoteElement();});APPEND_OPCODES.add(35, /* OpenComponentElement */function(vm,_ref21){var _tag=_ref21.op1;var tag=vm.constants.getString(_tag);vm.stack().openElement(tag,new ComponentElementOperations(vm.env));});APPEND_OPCODES.add(36, /* OpenDynamicElement */function(vm){var tagName=vm.frame.getOperand().value();vm.stack().openElement(tagName);});var ClassList=(function(){function ClassList(){this.list = null;this.isConst = true;}ClassList.prototype.append = function append(reference){var list=this.list;var isConst$$=this.isConst;if(list === null)list = this.list = [];list.push(reference);this.isConst = isConst$$ && _glimmerReference.isConst(reference);};ClassList.prototype.toReference = function toReference(){var list=this.list;var isConst$$=this.isConst;if(!list)return NULL_REFERENCE;if(isConst$$)return PrimitiveReference.create(toClassName(list));return new ClassListReference(list);};return ClassList;})();var ClassListReference=(function(_CachedReference){babelHelpers.inherits(ClassListReference,_CachedReference);function ClassListReference(list){_CachedReference.call(this);this.list = [];this.tag = _glimmerReference.combineTagged(list);this.list = list;}ClassListReference.prototype.compute = function compute(){return toClassName(this.list);};return ClassListReference;})(_glimmerReference.CachedReference);function toClassName(list){var ret=[];for(var i=0;i < list.length;i++) {var value=list[i].value();if(value !== false && value !== null && value !== undefined)ret.push(value);}return ret.length === 0?null:ret.join(' ');}var SimpleElementOperations=(function(){function SimpleElementOperations(env){this.env = env;this.opcodes = null;this.classList = null;}SimpleElementOperations.prototype.addStaticAttribute = function addStaticAttribute(element,name,value){if(name === 'class'){this.addClass(PrimitiveReference.create(value));}else {this.env.getAppendOperations().setAttribute(element,name,value);}};SimpleElementOperations.prototype.addStaticAttributeNS = function addStaticAttributeNS(element,namespace,name,value){this.env.getAppendOperations().setAttribute(element,name,value,namespace);};SimpleElementOperations.prototype.addDynamicAttribute = function addDynamicAttribute(element,name,reference,isTrusting){if(name === 'class'){this.addClass(reference);}else {var attributeManager=this.env.attributeFor(element,name,isTrusting);var attribute=new DynamicAttribute(element,attributeManager,name,reference);this.addAttribute(attribute);}};SimpleElementOperations.prototype.addDynamicAttributeNS = function addDynamicAttributeNS(element,namespace,name,reference,isTrusting){var attributeManager=this.env.attributeFor(element,name,isTrusting,namespace);var nsAttribute=new DynamicAttribute(element,attributeManager,name,reference,namespace);this.addAttribute(nsAttribute);};SimpleElementOperations.prototype.flush = function flush(element,vm){var env=vm.env;var opcodes=this.opcodes;var classList=this.classList;for(var i=0;opcodes && i < opcodes.length;i++) {vm.updateWith(opcodes[i]);}if(classList){var attributeManager=env.attributeFor(element,'class',false);var attribute=new DynamicAttribute(element,attributeManager,'class',classList.toReference());var opcode=attribute.flush(env);if(opcode){vm.updateWith(opcode);}}this.opcodes = null;this.classList = null;};SimpleElementOperations.prototype.addClass = function addClass(reference){var classList=this.classList;if(!classList){classList = this.classList = new ClassList();}classList.append(reference);};SimpleElementOperations.prototype.addAttribute = function addAttribute(attribute){var opcode=attribute.flush(this.env);if(opcode){var opcodes=this.opcodes;if(!opcodes){opcodes = this.opcodes = [];}opcodes.push(opcode);}};return SimpleElementOperations;})();var ComponentElementOperations=(function(){function ComponentElementOperations(env){this.env = env;this.attributeNames = null;this.attributes = null;this.classList = null;}ComponentElementOperations.prototype.addStaticAttribute = function addStaticAttribute(element,name,value){if(name === 'class'){this.addClass(PrimitiveReference.create(value));}else if(this.shouldAddAttribute(name)){this.addAttribute(name,new StaticAttribute(element,name,value));}};ComponentElementOperations.prototype.addStaticAttributeNS = function addStaticAttributeNS(element,namespace,name,value){if(this.shouldAddAttribute(name)){this.addAttribute(name,new StaticAttribute(element,name,value,namespace));}};ComponentElementOperations.prototype.addDynamicAttribute = function addDynamicAttribute(element,name,reference,isTrusting){if(name === 'class'){this.addClass(reference);}else if(this.shouldAddAttribute(name)){var attributeManager=this.env.attributeFor(element,name,isTrusting);var attribute=new DynamicAttribute(element,attributeManager,name,reference);this.addAttribute(name,attribute);}};ComponentElementOperations.prototype.addDynamicAttributeNS = function addDynamicAttributeNS(element,namespace,name,reference,isTrusting){if(this.shouldAddAttribute(name)){var attributeManager=this.env.attributeFor(element,name,isTrusting,namespace);var nsAttribute=new DynamicAttribute(element,attributeManager,name,reference,namespace);this.addAttribute(name,nsAttribute);}};ComponentElementOperations.prototype.flush = function flush(element,vm){var env=this.env;var attributes=this.attributes;var classList=this.classList;for(var i=0;attributes && i < attributes.length;i++) {var opcode=attributes[i].flush(env);if(opcode){vm.updateWith(opcode);}}if(classList){var attributeManager=env.attributeFor(element,'class',false);var attribute=new DynamicAttribute(element,attributeManager,'class',classList.toReference());var opcode=attribute.flush(env);if(opcode){vm.updateWith(opcode);}}};ComponentElementOperations.prototype.shouldAddAttribute = function shouldAddAttribute(name){return !this.attributeNames || this.attributeNames.indexOf(name) === -1;};ComponentElementOperations.prototype.addClass = function addClass(reference){var classList=this.classList;if(!classList){classList = this.classList = new ClassList();}classList.append(reference);};ComponentElementOperations.prototype.addAttribute = function addAttribute(name,attribute){var attributeNames=this.attributeNames;var attributes=this.attributes;if(!attributeNames){attributeNames = this.attributeNames = [];attributes = this.attributes = [];}attributeNames.push(name);_glimmerUtil.unwrap(attributes).push(attribute);};return ComponentElementOperations;})();APPEND_OPCODES.add(37, /* FlushElement */function(vm){var stack=vm.stack();var action='FlushElementOpcode#evaluate';stack.expectOperations(action).flush(stack.expectConstructing(action),vm);stack.flushElement();});APPEND_OPCODES.add(38, /* CloseElement */function(vm){return vm.stack().closeElement();});APPEND_OPCODES.add(39, /* PopElement */function(vm){return vm.stack().popElement();});APPEND_OPCODES.add(40, /* StaticAttr */function(vm,_ref22){var _name=_ref22.op1;var _value=_ref22.op2;var _namespace=_ref22.op3;var name=vm.constants.getString(_name);var value=vm.constants.getString(_value);if(_namespace){var namespace=vm.constants.getString(_namespace);vm.stack().setStaticAttributeNS(namespace,name,value);}else {vm.stack().setStaticAttribute(name,value);}});APPEND_OPCODES.add(41, /* Modifier */function(vm,_ref23){var _name=_ref23.op1;var _manager=_ref23.op2;var _args=_ref23.op3;var manager=vm.constants.getOther(_manager);var rawArgs=vm.constants.getExpression(_args);var stack=vm.stack();var element=stack.constructing;var updateOperations=stack.updateOperations;var args=rawArgs.evaluate(vm);var dynamicScope=vm.dynamicScope();var modifier=manager.create(element,args,dynamicScope,updateOperations);vm.env.scheduleInstallModifier(modifier,manager);var destructor=manager.getDestructor(modifier);if(destructor){vm.newDestroyable(destructor);}vm.updateWith(new UpdateModifierOpcode(manager,modifier,args));});var UpdateModifierOpcode=(function(_UpdatingOpcode6){babelHelpers.inherits(UpdateModifierOpcode,_UpdatingOpcode6);function UpdateModifierOpcode(manager,modifier,args){_UpdatingOpcode6.call(this);this.manager = manager;this.modifier = modifier;this.args = args;this.type = "update-modifier";this.tag = args.tag;this.lastUpdated = args.tag.value();}UpdateModifierOpcode.prototype.evaluate = function evaluate(vm){var manager=this.manager;var modifier=this.modifier;var tag=this.tag;var lastUpdated=this.lastUpdated;if(!tag.validate(lastUpdated)){vm.env.scheduleUpdateModifier(modifier,manager);this.lastUpdated = tag.value();}};UpdateModifierOpcode.prototype.toJSON = function toJSON(){return {guid:this._guid,type:this.type,args:[JSON.stringify(this.args)]};};return UpdateModifierOpcode;})(UpdatingOpcode);var StaticAttribute=(function(){function StaticAttribute(element,name,value,namespace){this.element = element;this.name = name;this.value = value;this.namespace = namespace;}StaticAttribute.prototype.flush = function flush(env){env.getAppendOperations().setAttribute(this.element,this.name,this.value,this.namespace);return null;};return StaticAttribute;})();var DynamicAttribute=(function(){function DynamicAttribute(element,attributeManager,name,reference,namespace){this.element = element;this.attributeManager = attributeManager;this.name = name;this.reference = reference;this.namespace = namespace;this.cache = null;this.tag = reference.tag;}DynamicAttribute.prototype.patch = function patch(env){var element=this.element;var cache=this.cache;var value=_glimmerUtil.expect(cache,'must patch after flush').revalidate();if(_glimmerReference.isModified(value)){this.attributeManager.updateAttribute(env,element,value,this.namespace);}};DynamicAttribute.prototype.flush = function flush(env){var reference=this.reference;var element=this.element;if(_glimmerReference.isConst(reference)){var value=reference.value();this.attributeManager.setAttribute(env,element,value,this.namespace);return null;}else {var cache=this.cache = new _glimmerReference.ReferenceCache(reference);var value=cache.peek();this.attributeManager.setAttribute(env,element,value,this.namespace);return new PatchElementOpcode(this);}};DynamicAttribute.prototype.toJSON = function toJSON(){var element=this.element;var namespace=this.namespace;var name=this.name;var cache=this.cache;var formattedElement=formatElement(element);var lastValue=_glimmerUtil.expect(cache,'must serialize after flush').peek();if(namespace){return {element:formattedElement,type:'attribute',namespace:namespace,name:name,lastValue:lastValue};}return {element:formattedElement,type:'attribute',namespace:namespace === undefined?null:namespace,name:name,lastValue:lastValue};};return DynamicAttribute;})();function formatElement(element){return JSON.stringify('<' + element.tagName.toLowerCase() + ' />');}APPEND_OPCODES.add(42, /* DynamicAttrNS */function(vm,_ref24){var _name=_ref24.op1;var _namespace=_ref24.op2;var trusting=_ref24.op3;var name=vm.constants.getString(_name);var namespace=vm.constants.getString(_namespace);var reference=vm.frame.getOperand();vm.stack().setDynamicAttributeNS(namespace,name,reference,!!trusting);});APPEND_OPCODES.add(43, /* DynamicAttr */function(vm,_ref25){var _name=_ref25.op1;var trusting=_ref25.op2;var name=vm.constants.getString(_name);var reference=vm.frame.getOperand();vm.stack().setDynamicAttribute(name,reference,!!trusting);});var PatchElementOpcode=(function(_UpdatingOpcode7){babelHelpers.inherits(PatchElementOpcode,_UpdatingOpcode7);function PatchElementOpcode(operation){_UpdatingOpcode7.call(this);this.type = "patch-element";this.tag = operation.tag;this.operation = operation;}PatchElementOpcode.prototype.evaluate = function evaluate(vm){this.operation.patch(vm.env);};PatchElementOpcode.prototype.toJSON = function toJSON(){var _guid=this._guid;var type=this.type;var operation=this.operation;return {guid:_guid,type:type,details:operation.toJSON()};};return PatchElementOpcode;})(UpdatingOpcode);var First=(function(){function First(node){this.node = node;}First.prototype.firstNode = function firstNode(){return this.node;};return First;})();var Last=(function(){function Last(node){this.node = node;}Last.prototype.lastNode = function lastNode(){return this.node;};return Last;})();var Fragment=(function(){function Fragment(bounds){this.bounds = bounds;}Fragment.prototype.parentElement = function parentElement(){return this.bounds.parentElement();};Fragment.prototype.firstNode = function firstNode(){return this.bounds.firstNode();};Fragment.prototype.lastNode = function lastNode(){return this.bounds.lastNode();};Fragment.prototype.update = function update(bounds){this.bounds = bounds;};return Fragment;})();var ElementStack=(function(){function ElementStack(env,parentNode,nextSibling){this.constructing = null;this.operations = null;this.elementStack = new _glimmerUtil.Stack();this.nextSiblingStack = new _glimmerUtil.Stack();this.blockStack = new _glimmerUtil.Stack();this.env = env;this.dom = env.getAppendOperations();this.updateOperations = env.getDOM();this.element = parentNode;this.nextSibling = nextSibling;this.defaultOperations = new SimpleElementOperations(env);this.elementStack.push(this.element);this.nextSiblingStack.push(this.nextSibling);}ElementStack.forInitialRender = function forInitialRender(env,parentNode,nextSibling){return new ElementStack(env,parentNode,nextSibling);};ElementStack.resume = function resume(env,tracker,nextSibling){var parentNode=tracker.parentElement();var stack=new ElementStack(env,parentNode,nextSibling);stack.pushBlockTracker(tracker);return stack;};ElementStack.prototype.expectConstructing = function expectConstructing(method){return _glimmerUtil.expect(this.constructing,method + ' should only be called while constructing an element');};ElementStack.prototype.expectOperations = function expectOperations(method){return _glimmerUtil.expect(this.operations,method + ' should only be called while constructing an element');};ElementStack.prototype.block = function block(){return _glimmerUtil.expect(this.blockStack.current,"Expected a current block tracker");};ElementStack.prototype.popElement = function popElement(){var elementStack=this.elementStack;var nextSiblingStack=this.nextSiblingStack;var topElement=elementStack.pop();nextSiblingStack.pop();_glimmerUtil.LOGGER.debug('-> element stack ' + this.elementStack.toArray().map(function(e){return e.tagName;}).join(', '));this.element = _glimmerUtil.expect(elementStack.current,"can't pop past the last element");this.nextSibling = nextSiblingStack.current;return topElement;};ElementStack.prototype.pushSimpleBlock = function pushSimpleBlock(){var tracker=new SimpleBlockTracker(this.element);this.pushBlockTracker(tracker);return tracker;};ElementStack.prototype.pushUpdatableBlock = function pushUpdatableBlock(){var tracker=new UpdatableBlockTracker(this.element);this.pushBlockTracker(tracker);return tracker;};ElementStack.prototype.pushBlockTracker = function pushBlockTracker(tracker){var isRemote=arguments.length <= 1 || arguments[1] === undefined?false:arguments[1];var current=this.blockStack.current;if(current !== null){current.newDestroyable(tracker);if(!isRemote){current.newBounds(tracker);}}this.blockStack.push(tracker);return tracker;};ElementStack.prototype.pushBlockList = function pushBlockList(list){var tracker=new BlockListTracker(this.element,list);var current=this.blockStack.current;if(current !== null){current.newDestroyable(tracker);current.newBounds(tracker);}this.blockStack.push(tracker);return tracker;};ElementStack.prototype.popBlock = function popBlock(){this.block().finalize(this);return _glimmerUtil.expect(this.blockStack.pop(),"Expected popBlock to return a block");};ElementStack.prototype.openElement = function openElement(tag){var operations=arguments.length <= 1 || arguments[1] === undefined?this.defaultOperations:arguments[1];var element=this.dom.createElement(tag,this.element);this.constructing = element;this.operations = operations;return element;};ElementStack.prototype.flushElement = function flushElement(){var parent=this.element;var element=_glimmerUtil.expect(this.constructing,'flushElement should only be called when constructing an element');this.dom.insertBefore(parent,element,this.nextSibling);this.constructing = null;this.operations = null;this.pushElement(element);this.block().openElement(element);};ElementStack.prototype.pushRemoteElement = function pushRemoteElement(element){this.pushElement(element);var tracker=new RemoteBlockTracker(element);this.pushBlockTracker(tracker,true);};ElementStack.prototype.popRemoteElement = function popRemoteElement(){this.popBlock();this.popElement();};ElementStack.prototype.pushElement = function pushElement(element){this.element = element;this.elementStack.push(element);_glimmerUtil.LOGGER.debug('-> element stack ' + this.elementStack.toArray().map(function(e){return e.tagName;}).join(', '));this.nextSibling = null;this.nextSiblingStack.push(null);};ElementStack.prototype.newDestroyable = function newDestroyable(d){this.block().newDestroyable(d);};ElementStack.prototype.newBounds = function newBounds(bounds){this.block().newBounds(bounds);};ElementStack.prototype.appendText = function appendText(string){var dom=this.dom;var text=dom.createTextNode(string);dom.insertBefore(this.element,text,this.nextSibling);this.block().newNode(text);return text;};ElementStack.prototype.appendComment = function appendComment(string){var dom=this.dom;var comment=dom.createComment(string);dom.insertBefore(this.element,comment,this.nextSibling);this.block().newNode(comment);return comment;};ElementStack.prototype.setStaticAttribute = function setStaticAttribute(name,value){this.expectOperations('setStaticAttribute').addStaticAttribute(this.expectConstructing('setStaticAttribute'),name,value);};ElementStack.prototype.setStaticAttributeNS = function setStaticAttributeNS(namespace,name,value){this.expectOperations('setStaticAttributeNS').addStaticAttributeNS(this.expectConstructing('setStaticAttributeNS'),namespace,name,value);};ElementStack.prototype.setDynamicAttribute = function setDynamicAttribute(name,reference,isTrusting){this.expectOperations('setDynamicAttribute').addDynamicAttribute(this.expectConstructing('setDynamicAttribute'),name,reference,isTrusting);};ElementStack.prototype.setDynamicAttributeNS = function setDynamicAttributeNS(namespace,name,reference,isTrusting){this.expectOperations('setDynamicAttributeNS').addDynamicAttributeNS(this.expectConstructing('setDynamicAttributeNS'),namespace,name,reference,isTrusting);};ElementStack.prototype.closeElement = function closeElement(){this.block().closeElement();this.popElement();};return ElementStack;})();var SimpleBlockTracker=(function(){function SimpleBlockTracker(parent){this.parent = parent;this.first = null;this.last = null;this.destroyables = null;this.nesting = 0;}SimpleBlockTracker.prototype.destroy = function destroy(){var destroyables=this.destroyables;if(destroyables && destroyables.length){for(var i=0;i < destroyables.length;i++) {destroyables[i].destroy();}}};SimpleBlockTracker.prototype.parentElement = function parentElement(){return this.parent;};SimpleBlockTracker.prototype.firstNode = function firstNode(){return this.first && this.first.firstNode();};SimpleBlockTracker.prototype.lastNode = function lastNode(){return this.last && this.last.lastNode();};SimpleBlockTracker.prototype.openElement = function openElement(element){this.newNode(element);this.nesting++;};SimpleBlockTracker.prototype.closeElement = function closeElement(){this.nesting--;};SimpleBlockTracker.prototype.newNode = function newNode(node){if(this.nesting !== 0)return;if(!this.first){this.first = new First(node);}this.last = new Last(node);};SimpleBlockTracker.prototype.newBounds = function newBounds(bounds){if(this.nesting !== 0)return;if(!this.first){this.first = bounds;}this.last = bounds;};SimpleBlockTracker.prototype.newDestroyable = function newDestroyable(d){this.destroyables = this.destroyables || [];this.destroyables.push(d);};SimpleBlockTracker.prototype.finalize = function finalize(stack){if(!this.first){stack.appendComment('');}};return SimpleBlockTracker;})();var RemoteBlockTracker=(function(_SimpleBlockTracker){babelHelpers.inherits(RemoteBlockTracker,_SimpleBlockTracker);function RemoteBlockTracker(){_SimpleBlockTracker.apply(this,arguments);}RemoteBlockTracker.prototype.destroy = function destroy(){_SimpleBlockTracker.prototype.destroy.call(this);clear(this);};return RemoteBlockTracker;})(SimpleBlockTracker);var UpdatableBlockTracker=(function(_SimpleBlockTracker2){babelHelpers.inherits(UpdatableBlockTracker,_SimpleBlockTracker2);function UpdatableBlockTracker(){_SimpleBlockTracker2.apply(this,arguments);}UpdatableBlockTracker.prototype.reset = function reset(env){var destroyables=this.destroyables;if(destroyables && destroyables.length){for(var i=0;i < destroyables.length;i++) {env.didDestroy(destroyables[i]);}}var nextSibling=clear(this);this.destroyables = null;this.first = null;this.last = null;return nextSibling;};return UpdatableBlockTracker;})(SimpleBlockTracker);var BlockListTracker=(function(){function BlockListTracker(parent,boundList){this.parent = parent;this.boundList = boundList;this.parent = parent;this.boundList = boundList;}BlockListTracker.prototype.destroy = function destroy(){this.boundList.forEachNode(function(node){return node.destroy();});};BlockListTracker.prototype.parentElement = function parentElement(){return this.parent;};BlockListTracker.prototype.firstNode = function firstNode(){var head=this.boundList.head();return head && head.firstNode();};BlockListTracker.prototype.lastNode = function lastNode(){var tail=this.boundList.tail();return tail && tail.lastNode();};BlockListTracker.prototype.openElement = function openElement(_element){_glimmerUtil.assert(false,'Cannot openElement directly inside a block list');};BlockListTracker.prototype.closeElement = function closeElement(){_glimmerUtil.assert(false,'Cannot closeElement directly inside a block list');};BlockListTracker.prototype.newNode = function newNode(_node){_glimmerUtil.assert(false,'Cannot create a new node directly inside a block list');};BlockListTracker.prototype.newBounds = function newBounds(_bounds){};BlockListTracker.prototype.newDestroyable = function newDestroyable(_d){};BlockListTracker.prototype.finalize = function finalize(_stack){};return BlockListTracker;})();var CompiledValue=(function(_CompiledExpression){babelHelpers.inherits(CompiledValue,_CompiledExpression);function CompiledValue(value){_CompiledExpression.call(this);this.type = "value";this.reference = PrimitiveReference.create(value);}CompiledValue.prototype.evaluate = function evaluate(_vm){return this.reference;};CompiledValue.prototype.toJSON = function toJSON(){return JSON.stringify(this.reference.value());};return CompiledValue;})(CompiledExpression);var CompiledHasBlock=(function(_CompiledExpression2){babelHelpers.inherits(CompiledHasBlock,_CompiledExpression2);function CompiledHasBlock(inner){_CompiledExpression2.call(this);this.inner = inner;this.type = "has-block";}CompiledHasBlock.prototype.evaluate = function evaluate(vm){var block=this.inner.evaluate(vm);return PrimitiveReference.create(!!block);};CompiledHasBlock.prototype.toJSON = function toJSON(){return 'has-block(' + this.inner.toJSON() + ')';};return CompiledHasBlock;})(CompiledExpression);var CompiledHasBlockParams=(function(_CompiledExpression3){babelHelpers.inherits(CompiledHasBlockParams,_CompiledExpression3);function CompiledHasBlockParams(inner){_CompiledExpression3.call(this);this.inner = inner;this.type = "has-block-params";}CompiledHasBlockParams.prototype.evaluate = function evaluate(vm){var block=this.inner.evaluate(vm);var hasLocals=block && block.symbolTable.getSymbols().locals;return PrimitiveReference.create(!!hasLocals);};CompiledHasBlockParams.prototype.toJSON = function toJSON(){return 'has-block-params(' + this.inner.toJSON() + ')';};return CompiledHasBlockParams;})(CompiledExpression);var CompiledGetBlockBySymbol=(function(){function CompiledGetBlockBySymbol(symbol,debug){this.symbol = symbol;this.debug = debug;}CompiledGetBlockBySymbol.prototype.evaluate = function evaluate(vm){return vm.scope().getBlock(this.symbol);};CompiledGetBlockBySymbol.prototype.toJSON = function toJSON(){return 'get-block($' + this.symbol + '(' + this.debug + '))';};return CompiledGetBlockBySymbol;})();var CompiledInPartialGetBlock=(function(){function CompiledInPartialGetBlock(symbol,name){this.symbol = symbol;this.name = name;}CompiledInPartialGetBlock.prototype.evaluate = function evaluate(vm){var symbol=this.symbol;var name=this.name;var args=vm.scope().getPartialArgs(symbol);return args.blocks[name];};CompiledInPartialGetBlock.prototype.toJSON = function toJSON(){return 'get-block($' + this.symbol + '($ARGS).' + this.name + '))';};return CompiledInPartialGetBlock;})();var CompiledLookup=(function(_CompiledExpression4){babelHelpers.inherits(CompiledLookup,_CompiledExpression4);function CompiledLookup(base,path){_CompiledExpression4.call(this);this.base = base;this.path = path;this.type = "lookup";}CompiledLookup.create = function create(base,path){if(path.length === 0){return base;}else {return new this(base,path);}};CompiledLookup.prototype.evaluate = function evaluate(vm){var base=this.base;var path=this.path;return _glimmerReference.referenceFromParts(base.evaluate(vm),path);};CompiledLookup.prototype.toJSON = function toJSON(){return this.base.toJSON() + '.' + this.path.join('.');};return CompiledLookup;})(CompiledExpression);var CompiledSelf=(function(_CompiledExpression5){babelHelpers.inherits(CompiledSelf,_CompiledExpression5);function CompiledSelf(){_CompiledExpression5.apply(this,arguments);}CompiledSelf.prototype.evaluate = function evaluate(vm){return vm.getSelf();};CompiledSelf.prototype.toJSON = function toJSON(){return 'self';};return CompiledSelf;})(CompiledExpression);var CompiledSymbol=(function(_CompiledExpression6){babelHelpers.inherits(CompiledSymbol,_CompiledExpression6);function CompiledSymbol(symbol,debug){_CompiledExpression6.call(this);this.symbol = symbol;this.debug = debug;}CompiledSymbol.prototype.evaluate = function evaluate(vm){return vm.referenceForSymbol(this.symbol);};CompiledSymbol.prototype.toJSON = function toJSON(){return '$' + this.symbol + '(' + this.debug + ')';};return CompiledSymbol;})(CompiledExpression);var CompiledInPartialName=(function(_CompiledExpression7){babelHelpers.inherits(CompiledInPartialName,_CompiledExpression7);function CompiledInPartialName(symbol,name){_CompiledExpression7.call(this);this.symbol = symbol;this.name = name;}CompiledInPartialName.prototype.evaluate = function evaluate(vm){var symbol=this.symbol;var name=this.name;var args=vm.scope().getPartialArgs(symbol);return args.named.get(name);};CompiledInPartialName.prototype.toJSON = function toJSON(){return '$' + this.symbol + '($ARGS).' + this.name;};return CompiledInPartialName;})(CompiledExpression);var CompiledHelper=(function(_CompiledExpression8){babelHelpers.inherits(CompiledHelper,_CompiledExpression8);function CompiledHelper(name,helper,args,symbolTable){_CompiledExpression8.call(this);this.name = name;this.helper = helper;this.args = args;this.symbolTable = symbolTable;this.type = "helper";}CompiledHelper.prototype.evaluate = function evaluate(vm){var helper=this.helper;return helper(vm,this.args.evaluate(vm),this.symbolTable);};CompiledHelper.prototype.toJSON = function toJSON(){return '`' + this.name.join('.') + '($ARGS)`';};return CompiledHelper;})(CompiledExpression);var CompiledConcat=(function(){function CompiledConcat(parts){this.parts = parts;this.type = "concat";}CompiledConcat.prototype.evaluate = function evaluate(vm){var parts=new Array(this.parts.length);for(var i=0;i < this.parts.length;i++) {parts[i] = this.parts[i].evaluate(vm);}return new ConcatReference(parts);};CompiledConcat.prototype.toJSON = function toJSON(){return 'concat(' + this.parts.map(function(expr){return expr.toJSON();}).join(", ") + ')';};return CompiledConcat;})();var ConcatReference=(function(_CachedReference2){babelHelpers.inherits(ConcatReference,_CachedReference2);function ConcatReference(parts){_CachedReference2.call(this);this.parts = parts;this.tag = _glimmerReference.combineTagged(parts);}ConcatReference.prototype.compute = function compute(){var parts=new Array();for(var i=0;i < this.parts.length;i++) {var value=this.parts[i].value();if(value !== null && value !== undefined){parts[i] = castToString(value);}}if(parts.length > 0){return parts.join('');}return null;};return ConcatReference;})(_glimmerReference.CachedReference);function castToString(value){if(typeof value['toString'] !== 'function'){return '';}return String(value);}var CompiledFunctionExpression=(function(_CompiledExpression9){babelHelpers.inherits(CompiledFunctionExpression,_CompiledExpression9);function CompiledFunctionExpression(func,symbolTable){_CompiledExpression9.call(this);this.func = func;this.symbolTable = symbolTable;this.type = "function";this.func = func;}CompiledFunctionExpression.prototype.evaluate = function evaluate(vm){var func=this.func;var symbolTable=this.symbolTable;return func(vm,symbolTable);};CompiledFunctionExpression.prototype.toJSON = function toJSON(){var func=this.func;if(func.name){return '`' + func.name + '(...)`';}else {return "`func(...)`";}};return CompiledFunctionExpression;})(CompiledExpression);function debugCallback(context,get){console.info('Use `context`, and `get()` to debug this template.'); /* tslint:disable */debugger; /* tslint:enable */return {context:context,get:get};}function getter(vm,builder){return function(path){var parts=path.split('.');if(parts[0] === 'this'){parts[0] = null;}return compileRef(parts,builder).evaluate(vm);};}var callback=debugCallback; // For testing purposes +function setDebuggerCallback(cb){callback = cb;}function resetDebuggerCallback(){callback = debugCallback;}var Compilers=(function(){function Compilers(){this.names = _glimmerUtil.dict();this.funcs = [];}Compilers.prototype.add = function add(name,func){this.funcs.push(func);this.names[name] = this.funcs.length - 1;};Compilers.prototype.compile = function compile(sexp,builder){var name=sexp[0];var index=this.names[name];var func=this.funcs[index];_glimmerUtil.assert(!!func,'expected an implementation for ' + sexp[0]);return func(sexp,builder);};return Compilers;})();var STATEMENTS=new Compilers();STATEMENTS.add('text',function(sexp,builder){builder.text(sexp[1]);});STATEMENTS.add('comment',function(sexp,builder){builder.comment(sexp[1]);});STATEMENTS.add('close-element',function(_sexp,builder){_glimmerUtil.LOGGER.trace('close-element statement');builder.closeElement();});STATEMENTS.add('flush-element',function(_sexp,builder){builder.flushElement();});STATEMENTS.add('modifier',function(sexp,builder){var path=sexp[1];var params=sexp[2];var hash=sexp[3];var args=compileArgs(params,hash,builder);if(builder.env.hasModifier(path,builder.symbolTable)){builder.modifier(path[0],args);}else {throw new Error('Compile Error ' + path.join('.') + ' is not a modifier: Helpers may not be used in the element form.');}});STATEMENTS.add('static-attr',function(sexp,builder){var name=sexp[1];var value=sexp[2];var namespace=sexp[3];builder.staticAttr(name,namespace,value);});STATEMENTS.add('any-dynamic-attr',function(sexp,builder){var name=sexp[1];var value=sexp[2];var namespace=sexp[3];var trusting=sexp[4];builder.putValue(value);if(namespace){builder.dynamicAttrNS(name,namespace,trusting);}else {builder.dynamicAttr(name,trusting);}});STATEMENTS.add('open-element',function(sexp,builder){_glimmerUtil.LOGGER.trace('open-element statement');builder.openPrimitiveElement(sexp[1]);});STATEMENTS.add('optimized-append',function(sexp,builder){var value=sexp[1];var trustingMorph=sexp[2];var _builder$env$macros=builder.env.macros();var inlines=_builder$env$macros.inlines;var returned=inlines.compile(sexp,builder) || value;if(returned === true)return;builder.putValue(returned[1]);if(trustingMorph){builder.trustingAppend();}else {builder.cautiousAppend();}});STATEMENTS.add('unoptimized-append',function(sexp,builder){var value=sexp[1];var trustingMorph=sexp[2];var _builder$env$macros2=builder.env.macros();var inlines=_builder$env$macros2.inlines;var returned=inlines.compile(sexp,builder) || value;if(returned === true)return;if(trustingMorph){builder.guardedTrustingAppend(returned[1]);}else {builder.guardedCautiousAppend(returned[1]);}});STATEMENTS.add('nested-block',function(sexp,builder){var _builder$env$macros3=builder.env.macros();var blocks=_builder$env$macros3.blocks;blocks.compile(sexp,builder);});STATEMENTS.add('scanned-block',function(sexp,builder){var path=sexp[1];var params=sexp[2];var hash=sexp[3];var template=sexp[4];var inverse=sexp[5];var templateBlock=template && template.scan();var inverseBlock=inverse && inverse.scan();var _builder$env$macros4=builder.env.macros();var blocks=_builder$env$macros4.blocks;blocks.compile(['nested-block',path,params,hash,templateBlock,inverseBlock],builder);});STATEMENTS.add('scanned-component',function(sexp,builder){var tag=sexp[1];var attrs=sexp[2];var rawArgs=sexp[3];var rawBlock=sexp[4];var block=rawBlock && rawBlock.scan();var args=compileBlockArgs(null,rawArgs,{default:block,inverse:null},builder);var definition=builder.env.getComponentDefinition([tag],builder.symbolTable);builder.putComponentDefinition(definition);builder.openComponent(args,attrs.scan());builder.closeComponent();});STATEMENTS.add('static-partial',function(sexp,builder){var name=sexp[1];if(!builder.env.hasPartial(name,builder.symbolTable)){throw new Error('Compile Error: Could not find a partial named "' + name + '"');}var definition=builder.env.lookupPartial(name,builder.symbolTable);builder.putPartialDefinition(definition);builder.evaluatePartial();});STATEMENTS.add('dynamic-partial',function(sexp,builder){var name=sexp[1];builder.startLabels();builder.putValue(name);builder.test('simple');builder.enter('BEGIN','END');builder.label('BEGIN');builder.jumpUnless('END');builder.putDynamicPartialDefinition();builder.evaluatePartial();builder.label('END');builder.exit();builder.stopLabels();});STATEMENTS.add('yield',function(sexp,builder){var to=sexp[1];var params=sexp[2];var args=compileArgs(params,null,builder);builder.yield(args,to);});STATEMENTS.add('debugger',function(sexp,builder){builder.putValue(['function',function(vm){var context=vm.getSelf().value();var get=function(path){return getter(vm,builder)(path).value();};callback(context,get);}]);return sexp;});var EXPRESSIONS=new Compilers();function expr(expression,builder){if(Array.isArray(expression)){return EXPRESSIONS.compile(expression,builder);}else {return new CompiledValue(expression);}}EXPRESSIONS.add('unknown',function(sexp,builder){var path=sexp[1];if(builder.env.hasHelper(path,builder.symbolTable)){return new CompiledHelper(path,builder.env.lookupHelper(path,builder.symbolTable),CompiledArgs.empty(),builder.symbolTable);}else {return compileRef(path,builder);}});EXPRESSIONS.add('concat',function(sexp,builder){var params=sexp[1].map(function(p){return expr(p,builder);});return new CompiledConcat(params);});EXPRESSIONS.add('function',function(sexp,builder){return new CompiledFunctionExpression(sexp[1],builder.symbolTable);});EXPRESSIONS.add('helper',function(sexp,builder){var env=builder.env;var symbolTable=builder.symbolTable;var path=sexp[1];var params=sexp[2];var hash=sexp[3];if(env.hasHelper(path,symbolTable)){var args=compileArgs(params,hash,builder);return new CompiledHelper(path,env.lookupHelper(path,symbolTable),args,symbolTable);}else {throw new Error('Compile Error: ' + path.join('.') + ' is not a helper');}});EXPRESSIONS.add('get',function(sexp,builder){return compileRef(sexp[1],builder);});EXPRESSIONS.add('undefined',function(_sexp,_builder){return new CompiledValue(undefined);});EXPRESSIONS.add('arg',function(sexp,builder){var parts=sexp[1];var head=parts[0];var named=undefined,partial=undefined;if(named = builder.symbolTable.getSymbol('named',head)){var path=parts.slice(1);var inner=new CompiledSymbol(named,head);return CompiledLookup.create(inner,path);}else if(partial = builder.symbolTable.getPartialArgs()){var path=parts.slice(1);var inner=new CompiledInPartialName(partial,head);return CompiledLookup.create(inner,path);}else {throw new Error('[BUG] @' + parts.join('.') + ' is not a valid lookup path.');}});EXPRESSIONS.add('has-block',function(sexp,builder){var blockName=sexp[1];var yields=undefined,partial=undefined;if(yields = builder.symbolTable.getSymbol('yields',blockName)){var inner=new CompiledGetBlockBySymbol(yields,blockName);return new CompiledHasBlock(inner);}else if(partial = builder.symbolTable.getPartialArgs()){var inner=new CompiledInPartialGetBlock(partial,blockName);return new CompiledHasBlock(inner);}else {throw new Error('[BUG] ${blockName} is not a valid block name.');}});EXPRESSIONS.add('has-block-params',function(sexp,builder){var blockName=sexp[1];var yields=undefined,partial=undefined;if(yields = builder.symbolTable.getSymbol('yields',blockName)){var inner=new CompiledGetBlockBySymbol(yields,blockName);return new CompiledHasBlockParams(inner);}else if(partial = builder.symbolTable.getPartialArgs()){var inner=new CompiledInPartialGetBlock(partial,blockName);return new CompiledHasBlockParams(inner);}else {throw new Error('[BUG] ${blockName} is not a valid block name.');}});function compileArgs(params,hash,builder){var compiledParams=compileParams(params,builder);var compiledHash=compileHash(hash,builder);return CompiledArgs.create(compiledParams,compiledHash,EMPTY_BLOCKS);}function compileBlockArgs(params,hash,blocks,builder){var compiledParams=compileParams(params,builder);var compiledHash=compileHash(hash,builder);return CompiledArgs.create(compiledParams,compiledHash,blocks);}function compileBaselineArgs(args,builder){var params=args[0];var hash=args[1];var _default=args[2];var inverse=args[3];return CompiledArgs.create(compileParams(params,builder),compileHash(hash,builder),{default:_default,inverse:inverse});}function compileParams(params,builder){if(!params || params.length === 0)return COMPILED_EMPTY_POSITIONAL_ARGS;var compiled=params.map(function(p){return expr(p,builder);});return CompiledPositionalArgs.create(compiled);}function compileHash(hash,builder){if(!hash)return COMPILED_EMPTY_NAMED_ARGS;var keys=hash[0];var values=hash[1];if(keys.length === 0)return COMPILED_EMPTY_NAMED_ARGS;var compiled=values.map(function(p){return expr(p,builder);});return new CompiledNamedArgs(keys,compiled);}function compileRef(parts,builder){var head=parts[0];var local=undefined;if(head === null){var inner=new CompiledSelf();var path=parts.slice(1);return CompiledLookup.create(inner,path);}else if(local = builder.symbolTable.getSymbol('local',head)){var path=parts.slice(1);var inner=new CompiledSymbol(local,head);return CompiledLookup.create(inner,path);}else {var inner=new CompiledSelf();return CompiledLookup.create(inner,parts);}}var Blocks=(function(){function Blocks(){this.names = _glimmerUtil.dict();this.funcs = [];}Blocks.prototype.add = function add(name,func){this.funcs.push(func);this.names[name] = this.funcs.length - 1;};Blocks.prototype.addMissing = function addMissing(func){this.missing = func;};Blocks.prototype.compile = function compile(sexp,builder){ // assert(sexp[1].length === 1, 'paths in blocks are not supported'); +var name=sexp[1][0];var index=this.names[name];if(index === undefined){_glimmerUtil.assert(!!this.missing,name + ' not found, and no catch-all block handler was registered');var func=this.missing;var handled=func(sexp,builder);_glimmerUtil.assert(!!handled,name + ' not found, and the catch-all block handler didn\'t handle it');}else {var func=this.funcs[index];func(sexp,builder);}};return Blocks;})();var BLOCKS=new Blocks();var Inlines=(function(){function Inlines(){this.names = _glimmerUtil.dict();this.funcs = [];}Inlines.prototype.add = function add(name,func){this.funcs.push(func);this.names[name] = this.funcs.length - 1;};Inlines.prototype.addMissing = function addMissing(func){this.missing = func;};Inlines.prototype.compile = function compile(sexp,builder){var value=sexp[1]; // TODO: Fix this so that expression macros can return +// things like components, so that {{component foo}} +// is the same as {{(component foo)}} +if(!Array.isArray(value))return ['expr',value];var path=undefined;var params=undefined;var hash=undefined;if(value[0] === 'helper'){path = value[1];params = value[2];hash = value[3];}else if(value[0] === 'unknown'){path = value[1];params = hash = null;}else {return ['expr',value];}if(path.length > 1 && !params && !hash){return ['expr',value];}var name=path[0];var index=this.names[name];if(index === undefined && this.missing){var func=this.missing;var returned=func(path,params,hash,builder);return returned === false?['expr',value]:returned;}else if(index !== undefined){var func=this.funcs[index];var returned=func(path,params,hash,builder);return returned === false?['expr',value]:returned;}else {return ['expr',value];}};return Inlines;})();var INLINES=new Inlines();populateBuiltins(BLOCKS,INLINES);function populateBuiltins(){var blocks=arguments.length <= 0 || arguments[0] === undefined?new Blocks():arguments[0];var inlines=arguments.length <= 1 || arguments[1] === undefined?new Inlines():arguments[1];blocks.add('if',function(sexp,builder){ // PutArgs +// Test(Environment) +// Enter(BEGIN, END) +// BEGIN: Noop +// JumpUnless(ELSE) +// Evaluate(default) +// Jump(END) +// ELSE: Noop +// Evalulate(inverse) +// END: Noop +// Exit +var params=sexp[2];var hash=sexp[3];var _default=sexp[4];var inverse=sexp[5];var args=compileArgs(params,hash,builder);builder.putArgs(args);builder.test('environment');builder.labelled(null,function(b){if(_default && inverse){b.jumpUnless('ELSE');b.evaluate(_default);b.jump('END');b.label('ELSE');b.evaluate(inverse);}else if(_default){b.jumpUnless('END');b.evaluate(_default);}else {throw _glimmerUtil.unreachable();}});});blocks.add('unless',function(sexp,builder){ // PutArgs +// Test(Environment) +// Enter(BEGIN, END) +// BEGIN: Noop +// JumpUnless(ELSE) +// Evaluate(default) +// Jump(END) +// ELSE: Noop +// Evalulate(inverse) +// END: Noop +// Exit +var params=sexp[2];var hash=sexp[3];var _default=sexp[4];var inverse=sexp[5];var args=compileArgs(params,hash,builder);builder.putArgs(args);builder.test('environment');builder.labelled(null,function(b){if(_default && inverse){b.jumpIf('ELSE');b.evaluate(_default);b.jump('END');b.label('ELSE');b.evaluate(inverse);}else if(_default){b.jumpIf('END');b.evaluate(_default);}else {throw _glimmerUtil.unreachable();}});});blocks.add('with',function(sexp,builder){ // PutArgs +// Test(Environment) +// Enter(BEGIN, END) +// BEGIN: Noop +// JumpUnless(ELSE) +// Evaluate(default) +// Jump(END) +// ELSE: Noop +// Evalulate(inverse) +// END: Noop +// Exit +var params=sexp[2];var hash=sexp[3];var _default=sexp[4];var inverse=sexp[5];var args=compileArgs(params,hash,builder);builder.putArgs(args);builder.test('environment');builder.labelled(null,function(b){if(_default && inverse){b.jumpUnless('ELSE');b.evaluate(_default);b.jump('END');b.label('ELSE');b.evaluate(inverse);}else if(_default){b.jumpUnless('END');b.evaluate(_default);}else {throw _glimmerUtil.unreachable();}});});blocks.add('each',function(sexp,builder){ // Enter(BEGIN, END) +// BEGIN: Noop +// PutArgs +// PutIterable +// JumpUnless(ELSE) +// EnterList(BEGIN2, END2) +// ITER: Noop +// NextIter(BREAK) +// EnterWithKey(BEGIN2, END2) +// BEGIN2: Noop +// PushChildScope +// Evaluate(default) +// PopScope +// END2: Noop +// Exit +// Jump(ITER) +// BREAK: Noop +// ExitList +// Jump(END) +// ELSE: Noop +// Evalulate(inverse) +// END: Noop +// Exit +var params=sexp[2];var hash=sexp[3];var _default=sexp[4];var inverse=sexp[5];var args=compileArgs(params,hash,builder);builder.labelled(args,function(b){b.putIterator();if(inverse){b.jumpUnless('ELSE');}else {b.jumpUnless('END');}b.iter(function(b){b.evaluate(_glimmerUtil.unwrap(_default));});if(inverse){b.jump('END');b.label('ELSE');b.evaluate(inverse);}});});return {blocks:blocks,inlines:inlines};}var badProtocols=['javascript:','vbscript:'];var badTags=['A','BODY','LINK','IMG','IFRAME','BASE','FORM'];var badTagsForDataURI=['EMBED'];var badAttributes=['href','src','background','action'];var badAttributesForDataURI=['src'];function has(array,item){return array.indexOf(item) !== -1;}function checkURI(tagName,attribute){return (tagName === null || has(badTags,tagName)) && has(badAttributes,attribute);}function checkDataURI(tagName,attribute){if(tagName === null)return false;return has(badTagsForDataURI,tagName) && has(badAttributesForDataURI,attribute);}function requiresSanitization(tagName,attribute){return checkURI(tagName,attribute) || checkDataURI(tagName,attribute);}function sanitizeAttributeValue(env,element,attribute,value){var tagName=null;if(value === null || value === undefined){return value;}if(isSafeString(value)){return value.toHTML();}if(!element){tagName = null;}else {tagName = element.tagName.toUpperCase();}var str=normalizeTextValue(value);if(checkURI(tagName,attribute)){var protocol=env.protocolForURL(str);if(has(badProtocols,protocol)){return 'unsafe:' + str;}}if(checkDataURI(tagName,attribute)){return 'unsafe:' + str;}return str;} /* + * @method normalizeProperty + * @param element {HTMLElement} + * @param slotName {String} + * @returns {Object} { name, type } + */function normalizeProperty(element,slotName){var type=undefined,normalized=undefined;if(slotName in element){normalized = slotName;type = 'prop';}else {var lower=slotName.toLowerCase();if(lower in element){type = 'prop';normalized = lower;}else {type = 'attr';normalized = slotName;}}if(type === 'prop' && (normalized.toLowerCase() === 'style' || preferAttr(element.tagName,normalized))){type = 'attr';}return {normalized:normalized,type:type};} // properties that MUST be set as attributes, due to: +// * browser bug +// * strange spec outlier +var ATTR_OVERRIDES={ // phantomjs < 2.0 lets you set it as a prop but won't reflect it +// back to the attribute. button.getAttribute('type') === null +BUTTON:{type:true,form:true},INPUT:{ // Some version of IE (like IE9) actually throw an exception +// if you set input.type = 'something-unknown' +type:true,form:true, // Chrome 46.0.2464.0: 'autocorrect' in document.createElement('input') === false +// Safari 8.0.7: 'autocorrect' in document.createElement('input') === false +// Mobile Safari (iOS 8.4 simulator): 'autocorrect' in document.createElement('input') === true +autocorrect:true, // Chrome 54.0.2840.98: 'list' in document.createElement('input') === true +// Safari 9.1.3: 'list' in document.createElement('input') === false +list:true}, // element.form is actually a legitimate readOnly property, that is to be +// mutated, but must be mutated by setAttribute... +SELECT:{form:true},OPTION:{form:true},TEXTAREA:{form:true},LABEL:{form:true},FIELDSET:{form:true},LEGEND:{form:true},OBJECT:{form:true}};function preferAttr(tagName,propName){var tag=ATTR_OVERRIDES[tagName.toUpperCase()];return tag && tag[propName.toLowerCase()] || false;}var innerHTMLWrapper={colgroup:{depth:2,before:'',after:'
    '},table:{depth:1,before:'',after:'
    '},tbody:{depth:2,before:'',after:'
    '},tfoot:{depth:2,before:'',after:'
    '},thead:{depth:2,before:'',after:'
    '},tr:{depth:3,before:'',after:'
    '}}; // Patch: innerHTML Fix +// Browsers: IE9 +// Reason: IE9 don't allow us to set innerHTML on col, colgroup, frameset, +// html, style, table, tbody, tfoot, thead, title, tr. +// Fix: Wrap the innerHTML we are about to set in its parents, apply the +// wrapped innerHTML on a div, then move the unwrapped nodes into the +// target position. +function domChanges(document,DOMChangesClass){if(!document)return DOMChangesClass;if(!shouldApplyFix(document)){return DOMChangesClass;}var div=document.createElement('div');return (function(_DOMChangesClass){babelHelpers.inherits(DOMChangesWithInnerHTMLFix,_DOMChangesClass);function DOMChangesWithInnerHTMLFix(){_DOMChangesClass.apply(this,arguments);}DOMChangesWithInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent,nextSibling,html){if(html === null || html === ''){return _DOMChangesClass.prototype.insertHTMLBefore.call(this,parent,nextSibling,html);}var parentTag=parent.tagName.toLowerCase();var wrapper=innerHTMLWrapper[parentTag];if(wrapper === undefined){return _DOMChangesClass.prototype.insertHTMLBefore.call(this,parent,nextSibling,html);}return fixInnerHTML(parent,wrapper,div,html,nextSibling);};return DOMChangesWithInnerHTMLFix;})(DOMChangesClass);}function treeConstruction(document,DOMTreeConstructionClass){if(!document)return DOMTreeConstructionClass;if(!shouldApplyFix(document)){return DOMTreeConstructionClass;}var div=document.createElement('div');return (function(_DOMTreeConstructionClass){babelHelpers.inherits(DOMTreeConstructionWithInnerHTMLFix,_DOMTreeConstructionClass);function DOMTreeConstructionWithInnerHTMLFix(){_DOMTreeConstructionClass.apply(this,arguments);}DOMTreeConstructionWithInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent,html,reference){if(html === null || html === ''){return _DOMTreeConstructionClass.prototype.insertHTMLBefore.call(this,parent,html,reference);}var parentTag=parent.tagName.toLowerCase();var wrapper=innerHTMLWrapper[parentTag];if(wrapper === undefined){return _DOMTreeConstructionClass.prototype.insertHTMLBefore.call(this,parent,html,reference);}return fixInnerHTML(parent,wrapper,div,html,reference);};return DOMTreeConstructionWithInnerHTMLFix;})(DOMTreeConstructionClass);}function fixInnerHTML(parent,wrapper,div,html,reference){var wrappedHtml=wrapper.before + html + wrapper.after;div.innerHTML = wrappedHtml;var parentNode=div;for(var i=0;i < wrapper.depth;i++) {parentNode = parentNode.childNodes[0];}var _moveNodesBefore=moveNodesBefore(parentNode,parent,reference);var first=_moveNodesBefore[0];var last=_moveNodesBefore[1];return new ConcreteBounds(parent,first,last);}function shouldApplyFix(document){var table=document.createElement('table');try{table.innerHTML = '';}catch(e) {}finally {if(table.childNodes.length !== 0){ // It worked as expected, no fix required +return false;}}return true;}var SVG_NAMESPACE$1='http://www.w3.org/2000/svg'; // Patch: insertAdjacentHTML on SVG Fix +// Browsers: Safari, IE, Edge, Firefox ~33-34 +// Reason: insertAdjacentHTML does not exist on SVG elements in Safari. It is +// present but throws an exception on IE and Edge. Old versions of +// Firefox create nodes in the incorrect namespace. +// Fix: Since IE and Edge silently fail to create SVG nodes using +// innerHTML, and because Firefox may create nodes in the incorrect +// namespace using innerHTML on SVG elements, an HTML-string wrapping +// approach is used. A pre/post SVG tag is added to the string, then +// that whole string is added to a div. The created nodes are plucked +// out and applied to the target location on DOM. +function domChanges$1(document,DOMChangesClass,svgNamespace){if(!document)return DOMChangesClass;if(!shouldApplyFix$1(document,svgNamespace)){return DOMChangesClass;}var div=document.createElement('div');return (function(_DOMChangesClass2){babelHelpers.inherits(DOMChangesWithSVGInnerHTMLFix,_DOMChangesClass2);function DOMChangesWithSVGInnerHTMLFix(){_DOMChangesClass2.apply(this,arguments);}DOMChangesWithSVGInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent,nextSibling,html){if(html === null || html === ''){return _DOMChangesClass2.prototype.insertHTMLBefore.call(this,parent,nextSibling,html);}if(parent.namespaceURI !== svgNamespace){return _DOMChangesClass2.prototype.insertHTMLBefore.call(this,parent,nextSibling,html);}return fixSVG(parent,div,html,nextSibling);};return DOMChangesWithSVGInnerHTMLFix;})(DOMChangesClass);}function treeConstruction$1(document,TreeConstructionClass,svgNamespace){if(!document)return TreeConstructionClass;if(!shouldApplyFix$1(document,svgNamespace)){return TreeConstructionClass;}var div=document.createElement('div');return (function(_TreeConstructionClass){babelHelpers.inherits(TreeConstructionWithSVGInnerHTMLFix,_TreeConstructionClass);function TreeConstructionWithSVGInnerHTMLFix(){_TreeConstructionClass.apply(this,arguments);}TreeConstructionWithSVGInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent,html,reference){if(html === null || html === ''){return _TreeConstructionClass.prototype.insertHTMLBefore.call(this,parent,html,reference);}if(parent.namespaceURI !== svgNamespace){return _TreeConstructionClass.prototype.insertHTMLBefore.call(this,parent,html,reference);}return fixSVG(parent,div,html,reference);};return TreeConstructionWithSVGInnerHTMLFix;})(TreeConstructionClass);}function fixSVG(parent,div,html,reference){ // IE, Edge: also do not correctly support using `innerHTML` on SVG +// namespaced elements. So here a wrapper is used. +var wrappedHtml='' + html + '';div.innerHTML = wrappedHtml;var _moveNodesBefore2=moveNodesBefore(div.firstChild,parent,reference);var first=_moveNodesBefore2[0];var last=_moveNodesBefore2[1];return new ConcreteBounds(parent,first,last);}function shouldApplyFix$1(document,svgNamespace){var svg=document.createElementNS(svgNamespace,'svg');try{svg['insertAdjacentHTML']('beforeEnd','');}catch(e) {}finally { // FF: Old versions will create a node in the wrong namespace +if(svg.childNodes.length === 1 && _glimmerUtil.unwrap(svg.firstChild).namespaceURI === SVG_NAMESPACE$1){ // The test worked as expected, no fix required +return false;}return true;}} // Patch: Adjacent text node merging fix +// Browsers: IE, Edge, Firefox w/o inspector open +// Reason: These browsers will merge adjacent text nodes. For exmaple given +//
    Hello
    with div.insertAdjacentHTML(' world') browsers +// with proper behavior will populate div.childNodes with two items. +// These browsers will populate it with one merged node instead. +// Fix: Add these nodes to a wrapper element, then iterate the childNodes +// of that wrapper and move the nodes to their target location. Note +// that potential SVG bugs will have been handled before this fix. +// Note that this fix must only apply to the previous text node, as +// the base implementation of `insertHTMLBefore` already handles +// following text nodes correctly. +function domChanges$2(document,DOMChangesClass){if(!document)return DOMChangesClass;if(!shouldApplyFix$2(document)){return DOMChangesClass;}return (function(_DOMChangesClass3){babelHelpers.inherits(DOMChangesWithTextNodeMergingFix,_DOMChangesClass3);function DOMChangesWithTextNodeMergingFix(document){_DOMChangesClass3.call(this,document);this.uselessComment = document.createComment('');}DOMChangesWithTextNodeMergingFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent,nextSibling,html){if(html === null){return _DOMChangesClass3.prototype.insertHTMLBefore.call(this,parent,nextSibling,html);}var didSetUselessComment=false;var nextPrevious=nextSibling?nextSibling.previousSibling:parent.lastChild;if(nextPrevious && nextPrevious instanceof Text){didSetUselessComment = true;parent.insertBefore(this.uselessComment,nextSibling);}var bounds=_DOMChangesClass3.prototype.insertHTMLBefore.call(this,parent,nextSibling,html);if(didSetUselessComment){parent.removeChild(this.uselessComment);}return bounds;};return DOMChangesWithTextNodeMergingFix;})(DOMChangesClass);}function treeConstruction$2(document,TreeConstructionClass){if(!document)return TreeConstructionClass;if(!shouldApplyFix$2(document)){return TreeConstructionClass;}return (function(_TreeConstructionClass2){babelHelpers.inherits(TreeConstructionWithTextNodeMergingFix,_TreeConstructionClass2);function TreeConstructionWithTextNodeMergingFix(document){_TreeConstructionClass2.call(this,document);this.uselessComment = this.createComment('');}TreeConstructionWithTextNodeMergingFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent,html,reference){if(html === null){return _TreeConstructionClass2.prototype.insertHTMLBefore.call(this,parent,html,reference);}var didSetUselessComment=false;var nextPrevious=reference?reference.previousSibling:parent.lastChild;if(nextPrevious && nextPrevious instanceof Text){didSetUselessComment = true;parent.insertBefore(this.uselessComment,reference);}var bounds=_TreeConstructionClass2.prototype.insertHTMLBefore.call(this,parent,html,reference);if(didSetUselessComment){parent.removeChild(this.uselessComment);}return bounds;};return TreeConstructionWithTextNodeMergingFix;})(TreeConstructionClass);}function shouldApplyFix$2(document){var mergingTextDiv=document.createElement('div');mergingTextDiv.innerHTML = 'first';mergingTextDiv.insertAdjacentHTML('beforeEnd','second');if(mergingTextDiv.childNodes.length === 2){ // It worked as expected, no fix required +return false;}return true;}var SVG_NAMESPACE='http://www.w3.org/2000/svg'; // http://www.w3.org/TR/html/syntax.html#html-integration-point +var SVG_INTEGRATION_POINTS={foreignObject:1,desc:1,title:1}; // http://www.w3.org/TR/html/syntax.html#adjust-svg-attributes +// TODO: Adjust SVG attributes +// http://www.w3.org/TR/html/syntax.html#parsing-main-inforeign +// TODO: Adjust SVG elements +// http://www.w3.org/TR/html/syntax.html#parsing-main-inforeign +var BLACKLIST_TABLE=Object.create(null);["b","big","blockquote","body","br","center","code","dd","div","dl","dt","em","embed","h1","h2","h3","h4","h5","h6","head","hr","i","img","li","listing","main","meta","nobr","ol","p","pre","ruby","s","small","span","strong","strike","sub","sup","table","tt","u","ul","var"].forEach(function(tag){return BLACKLIST_TABLE[tag] = 1;});var WHITESPACE=/[\t-\r \xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/;var doc=typeof document === 'undefined'?null:document;function isWhitespace(string){return WHITESPACE.test(string);}function moveNodesBefore(source,target,nextSibling){var first=source.firstChild;var last=null;var current=first;while(current) {last = current;current = current.nextSibling;target.insertBefore(last,nextSibling);}return [first,last];}var DOM;(function(DOM){var TreeConstruction=(function(){function TreeConstruction(document){this.document = document;this.setupUselessElement();}TreeConstruction.prototype.setupUselessElement = function setupUselessElement(){this.uselessElement = this.document.createElement('div');};TreeConstruction.prototype.createElement = function createElement(tag,context){var isElementInSVGNamespace=undefined,isHTMLIntegrationPoint=undefined;if(context){isElementInSVGNamespace = context.namespaceURI === SVG_NAMESPACE || tag === 'svg';isHTMLIntegrationPoint = SVG_INTEGRATION_POINTS[context.tagName];}else {isElementInSVGNamespace = tag === 'svg';isHTMLIntegrationPoint = false;}if(isElementInSVGNamespace && !isHTMLIntegrationPoint){ // FIXME: This does not properly handle with color, face, or +// size attributes, which is also disallowed by the spec. We should fix +// this. +if(BLACKLIST_TABLE[tag]){throw new Error('Cannot create a ' + tag + ' inside an SVG context');}return this.document.createElementNS(SVG_NAMESPACE,tag);}else {return this.document.createElement(tag);}};TreeConstruction.prototype.createElementNS = function createElementNS(namespace,tag){return this.document.createElementNS(namespace,tag);};TreeConstruction.prototype.setAttribute = function setAttribute(element,name,value,namespace){if(namespace){element.setAttributeNS(namespace,name,value);}else {element.setAttribute(name,value);}};TreeConstruction.prototype.createTextNode = function createTextNode(text){return this.document.createTextNode(text);};TreeConstruction.prototype.createComment = function createComment(data){return this.document.createComment(data);};TreeConstruction.prototype.insertBefore = function insertBefore(parent,node,reference){parent.insertBefore(node,reference);};TreeConstruction.prototype.insertHTMLBefore = function insertHTMLBefore(parent,html,reference){return _insertHTMLBefore(this.uselessElement,parent,reference,html);};return TreeConstruction;})();DOM.TreeConstruction = TreeConstruction;var appliedTreeContruction=TreeConstruction;appliedTreeContruction = treeConstruction$2(doc,appliedTreeContruction);appliedTreeContruction = treeConstruction(doc,appliedTreeContruction);appliedTreeContruction = treeConstruction$1(doc,appliedTreeContruction,SVG_NAMESPACE);DOM.DOMTreeConstruction = appliedTreeContruction;})(DOM || (DOM = {}));var DOMChanges=(function(){function DOMChanges(document){this.document = document;this.namespace = null;this.uselessElement = this.document.createElement('div');}DOMChanges.prototype.setAttribute = function setAttribute(element,name,value){element.setAttribute(name,value);};DOMChanges.prototype.setAttributeNS = function setAttributeNS(element,namespace,name,value){element.setAttributeNS(namespace,name,value);};DOMChanges.prototype.removeAttribute = function removeAttribute(element,name){element.removeAttribute(name);};DOMChanges.prototype.removeAttributeNS = function removeAttributeNS(element,namespace,name){element.removeAttributeNS(namespace,name);};DOMChanges.prototype.createTextNode = function createTextNode(text){return this.document.createTextNode(text);};DOMChanges.prototype.createComment = function createComment(data){return this.document.createComment(data);};DOMChanges.prototype.createElement = function createElement(tag,context){var isElementInSVGNamespace=undefined,isHTMLIntegrationPoint=undefined;if(context){isElementInSVGNamespace = context.namespaceURI === SVG_NAMESPACE || tag === 'svg';isHTMLIntegrationPoint = SVG_INTEGRATION_POINTS[context.tagName];}else {isElementInSVGNamespace = tag === 'svg';isHTMLIntegrationPoint = false;}if(isElementInSVGNamespace && !isHTMLIntegrationPoint){ // FIXME: This does not properly handle with color, face, or +// size attributes, which is also disallowed by the spec. We should fix +// this. +if(BLACKLIST_TABLE[tag]){throw new Error('Cannot create a ' + tag + ' inside an SVG context');}return this.document.createElementNS(SVG_NAMESPACE,tag);}else {return this.document.createElement(tag);}};DOMChanges.prototype.insertHTMLBefore = function insertHTMLBefore(_parent,nextSibling,html){return _insertHTMLBefore(this.uselessElement,_parent,nextSibling,html);};DOMChanges.prototype.insertNodeBefore = function insertNodeBefore(parent,node,reference){if(isDocumentFragment(node)){var firstChild=node.firstChild;var lastChild=node.lastChild;this.insertBefore(parent,node,reference);return new ConcreteBounds(parent,firstChild,lastChild);}else {this.insertBefore(parent,node,reference);return new SingleNodeBounds(parent,node);}};DOMChanges.prototype.insertTextBefore = function insertTextBefore(parent,nextSibling,text){var textNode=this.createTextNode(text);this.insertBefore(parent,textNode,nextSibling);return textNode;};DOMChanges.prototype.insertBefore = function insertBefore(element,node,reference){element.insertBefore(node,reference);};DOMChanges.prototype.insertAfter = function insertAfter(element,node,reference){this.insertBefore(element,node,reference.nextSibling);};return DOMChanges;})();function _insertHTMLBefore(_useless,_parent,_nextSibling,html){ // TypeScript vendored an old version of the DOM spec where `insertAdjacentHTML` +// only exists on `HTMLElement` but not on `Element`. We actually work with the +// newer version of the DOM API here (and monkey-patch this method in `./compat` +// when we detect older browsers). This is a hack to work around this limitation. +var parent=_parent;var useless=_useless;var nextSibling=_nextSibling;var prev=nextSibling?nextSibling.previousSibling:parent.lastChild;var last=undefined;if(html === null || html === ''){return new ConcreteBounds(parent,null,null);}if(nextSibling === null){parent.insertAdjacentHTML('beforeEnd',html);last = parent.lastChild;}else if(nextSibling instanceof HTMLElement){nextSibling.insertAdjacentHTML('beforeBegin',html);last = nextSibling.previousSibling;}else { // Non-element nodes do not support insertAdjacentHTML, so add an +// element and call it on that element. Then remove the element. +// +// This also protects Edge, IE and Firefox w/o the inspector open +// from merging adjacent text nodes. See ./compat/text-node-merging-fix.ts +parent.insertBefore(useless,nextSibling);useless.insertAdjacentHTML('beforeBegin',html);last = useless.previousSibling;parent.removeChild(useless);}var first=prev?prev.nextSibling:parent.firstChild;return new ConcreteBounds(parent,first,last);}function isDocumentFragment(node){return node.nodeType === Node.DOCUMENT_FRAGMENT_NODE;}var helper=DOMChanges;helper = domChanges$2(doc,helper);helper = domChanges(doc,helper);helper = domChanges$1(doc,helper,SVG_NAMESPACE);var helper$1=helper;var DOMTreeConstruction=DOM.DOMTreeConstruction;function defaultManagers(element,attr,_isTrusting,_namespace){var tagName=element.tagName;var isSVG=element.namespaceURI === SVG_NAMESPACE;if(isSVG){return defaultAttributeManagers(tagName,attr);}var _normalizeProperty=normalizeProperty(element,attr);var type=_normalizeProperty.type;var normalized=_normalizeProperty.normalized;if(type === 'attr'){return defaultAttributeManagers(tagName,normalized);}else {return defaultPropertyManagers(tagName,normalized);}}function defaultPropertyManagers(tagName,attr){if(requiresSanitization(tagName,attr)){return new SafePropertyManager(attr);}if(isUserInputValue(tagName,attr)){return INPUT_VALUE_PROPERTY_MANAGER;}if(isOptionSelected(tagName,attr)){return OPTION_SELECTED_MANAGER;}return new PropertyManager(attr);}function defaultAttributeManagers(tagName,attr){if(requiresSanitization(tagName,attr)){return new SafeAttributeManager(attr);}return new AttributeManager(attr);}function readDOMAttr(element,attr){var isSVG=element.namespaceURI === SVG_NAMESPACE;var _normalizeProperty2=normalizeProperty(element,attr);var type=_normalizeProperty2.type;var normalized=_normalizeProperty2.normalized;if(isSVG){return element.getAttribute(normalized);}if(type === 'attr'){return element.getAttribute(normalized);}{return element[normalized];}};var AttributeManager=(function(){function AttributeManager(attr){this.attr = attr;}AttributeManager.prototype.setAttribute = function setAttribute(env,element,value,namespace){var dom=env.getAppendOperations();var normalizedValue=normalizeAttributeValue(value);if(!isAttrRemovalValue(normalizedValue)){dom.setAttribute(element,this.attr,normalizedValue,namespace);}};AttributeManager.prototype.updateAttribute = function updateAttribute(env,element,value,namespace){if(value === null || value === undefined || value === false){if(namespace){env.getDOM().removeAttributeNS(element,namespace,this.attr);}else {env.getDOM().removeAttribute(element,this.attr);}}else {this.setAttribute(env,element,value);}};return AttributeManager;})();;var PropertyManager=(function(_AttributeManager){babelHelpers.inherits(PropertyManager,_AttributeManager);function PropertyManager(){_AttributeManager.apply(this,arguments);}PropertyManager.prototype.setAttribute = function setAttribute(_env,element,value,_namespace){if(!isAttrRemovalValue(value)){element[this.attr] = value;}};PropertyManager.prototype.removeAttribute = function removeAttribute(env,element,namespace){ // TODO this sucks but to preserve properties first and to meet current +// semantics we must do this. +var attr=this.attr;if(namespace){env.getDOM().removeAttributeNS(element,namespace,attr);}else {env.getDOM().removeAttribute(element,attr);}};PropertyManager.prototype.updateAttribute = function updateAttribute(env,element,value,namespace){ // ensure the property is always updated +element[this.attr] = value;if(isAttrRemovalValue(value)){this.removeAttribute(env,element,namespace);}};return PropertyManager;})(AttributeManager);;function normalizeAttributeValue(value){if(value === false || value === undefined || value === null){return null;}if(value === true){return '';} // onclick function etc in SSR +if(typeof value === 'function'){return null;}return String(value);}function isAttrRemovalValue(value){return value === null || value === undefined;}var SafePropertyManager=(function(_PropertyManager){babelHelpers.inherits(SafePropertyManager,_PropertyManager);function SafePropertyManager(){_PropertyManager.apply(this,arguments);}SafePropertyManager.prototype.setAttribute = function setAttribute(env,element,value){_PropertyManager.prototype.setAttribute.call(this,env,element,sanitizeAttributeValue(env,element,this.attr,value));};SafePropertyManager.prototype.updateAttribute = function updateAttribute(env,element,value){_PropertyManager.prototype.updateAttribute.call(this,env,element,sanitizeAttributeValue(env,element,this.attr,value));};return SafePropertyManager;})(PropertyManager);function isUserInputValue(tagName,attribute){return (tagName === 'INPUT' || tagName === 'TEXTAREA') && attribute === 'value';}var InputValuePropertyManager=(function(_AttributeManager2){babelHelpers.inherits(InputValuePropertyManager,_AttributeManager2);function InputValuePropertyManager(){_AttributeManager2.apply(this,arguments);}InputValuePropertyManager.prototype.setAttribute = function setAttribute(_env,element,value){var input=element;input.value = normalizeTextValue(value);};InputValuePropertyManager.prototype.updateAttribute = function updateAttribute(_env,element,value){var input=element;var currentValue=input.value;var normalizedValue=normalizeTextValue(value);if(currentValue !== normalizedValue){input.value = normalizedValue;}};return InputValuePropertyManager;})(AttributeManager);var INPUT_VALUE_PROPERTY_MANAGER=new InputValuePropertyManager('value');function isOptionSelected(tagName,attribute){return tagName === 'OPTION' && attribute === 'selected';}var OptionSelectedManager=(function(_PropertyManager2){babelHelpers.inherits(OptionSelectedManager,_PropertyManager2);function OptionSelectedManager(){_PropertyManager2.apply(this,arguments);}OptionSelectedManager.prototype.setAttribute = function setAttribute(_env,element,value){if(value !== null && value !== undefined && value !== false){var option=element;option.selected = true;}};OptionSelectedManager.prototype.updateAttribute = function updateAttribute(_env,element,value){var option=element;if(value){option.selected = true;}else {option.selected = false;}};return OptionSelectedManager;})(PropertyManager);var OPTION_SELECTED_MANAGER=new OptionSelectedManager('selected');var SafeAttributeManager=(function(_AttributeManager3){babelHelpers.inherits(SafeAttributeManager,_AttributeManager3);function SafeAttributeManager(){_AttributeManager3.apply(this,arguments);}SafeAttributeManager.prototype.setAttribute = function setAttribute(env,element,value){_AttributeManager3.prototype.setAttribute.call(this,env,element,sanitizeAttributeValue(env,element,this.attr,value));};SafeAttributeManager.prototype.updateAttribute = function updateAttribute(env,element,value,_namespace){_AttributeManager3.prototype.updateAttribute.call(this,env,element,sanitizeAttributeValue(env,element,this.attr,value));};return SafeAttributeManager;})(AttributeManager);var Scope=(function(){function Scope(references){var callerScope=arguments.length <= 1 || arguments[1] === undefined?null:arguments[1];this.callerScope = null;this.slots = references;this.callerScope = callerScope;}Scope.root = function root(self){var size=arguments.length <= 1 || arguments[1] === undefined?0:arguments[1];var refs=new Array(size + 1);for(var i=0;i <= size;i++) {refs[i] = UNDEFINED_REFERENCE;}return new Scope(refs).init({self:self});};Scope.prototype.init = function init(_ref26){var self=_ref26.self;this.slots[0] = self;return this;};Scope.prototype.getSelf = function getSelf(){return this.slots[0];};Scope.prototype.getSymbol = function getSymbol(symbol){return this.slots[symbol];};Scope.prototype.getBlock = function getBlock(symbol){return this.slots[symbol];};Scope.prototype.getPartialArgs = function getPartialArgs(symbol){return this.slots[symbol];};Scope.prototype.bindSymbol = function bindSymbol(symbol,value){this.slots[symbol] = value;};Scope.prototype.bindBlock = function bindBlock(symbol,value){this.slots[symbol] = value;};Scope.prototype.bindPartialArgs = function bindPartialArgs(symbol,value){this.slots[symbol] = value;};Scope.prototype.bindCallerScope = function bindCallerScope(scope){this.callerScope = scope;};Scope.prototype.getCallerScope = function getCallerScope(){return this.callerScope;};Scope.prototype.child = function child(){return new Scope(this.slots.slice(),this.callerScope);};return Scope;})();var Transaction=(function(){function Transaction(){this.scheduledInstallManagers = [];this.scheduledInstallModifiers = [];this.scheduledUpdateModifierManagers = [];this.scheduledUpdateModifiers = [];this.createdComponents = [];this.createdManagers = [];this.updatedComponents = [];this.updatedManagers = [];this.destructors = [];}Transaction.prototype.didCreate = function didCreate(component,manager){this.createdComponents.push(component);this.createdManagers.push(manager);};Transaction.prototype.didUpdate = function didUpdate(component,manager){this.updatedComponents.push(component);this.updatedManagers.push(manager);};Transaction.prototype.scheduleInstallModifier = function scheduleInstallModifier(modifier,manager){this.scheduledInstallManagers.push(manager);this.scheduledInstallModifiers.push(modifier);};Transaction.prototype.scheduleUpdateModifier = function scheduleUpdateModifier(modifier,manager){this.scheduledUpdateModifierManagers.push(manager);this.scheduledUpdateModifiers.push(modifier);};Transaction.prototype.didDestroy = function didDestroy(d){this.destructors.push(d);};Transaction.prototype.commit = function commit(){var createdComponents=this.createdComponents;var createdManagers=this.createdManagers;for(var i=0;i < createdComponents.length;i++) {var component=createdComponents[i];var manager=createdManagers[i];manager.didCreate(component);}var updatedComponents=this.updatedComponents;var updatedManagers=this.updatedManagers;for(var i=0;i < updatedComponents.length;i++) {var component=updatedComponents[i];var manager=updatedManagers[i];manager.didUpdate(component);}var destructors=this.destructors;for(var i=0;i < destructors.length;i++) {destructors[i].destroy();}var scheduledInstallManagers=this.scheduledInstallManagers;var scheduledInstallModifiers=this.scheduledInstallModifiers;for(var i=0;i < scheduledInstallManagers.length;i++) {var manager=scheduledInstallManagers[i];var modifier=scheduledInstallModifiers[i];manager.install(modifier);}var scheduledUpdateModifierManagers=this.scheduledUpdateModifierManagers;var scheduledUpdateModifiers=this.scheduledUpdateModifiers;for(var i=0;i < scheduledUpdateModifierManagers.length;i++) {var manager=scheduledUpdateModifierManagers[i];var modifier=scheduledUpdateModifiers[i];manager.update(modifier);}};return Transaction;})();var Opcode=(function(){function Opcode(array){this.array = array;this.offset = 0;}babelHelpers.createClass(Opcode,[{key:'type',get:function(){return this.array[this.offset];}},{key:'op1',get:function(){return this.array[this.offset + 1];}},{key:'op2',get:function(){return this.array[this.offset + 2];}},{key:'op3',get:function(){return this.array[this.offset + 3];}}]);return Opcode;})();var Program=(function(){function Program(){this.opcodes = new _glimmerUtil.A(0x100000);this._offset = 0;this._opcode = new Opcode(this.opcodes);}Program.prototype.opcode = function opcode(offset){this._opcode.offset = offset;return this._opcode;};Program.prototype.set = function set(pos,opcode){var type=opcode[0];var op1=opcode[1];var op2=opcode[2];var op3=opcode[3];this.opcodes[pos] = type;this.opcodes[pos + 1] = op1;this.opcodes[pos + 2] = op2;this.opcodes[pos + 3] = op3;};Program.prototype.push = function push(opcode){var offset=this._offset;var type=opcode[0];var op1=opcode[1];var op2=opcode[2];var op3=opcode[3];this.opcodes[this._offset++] = type;this.opcodes[this._offset++] = op1;this.opcodes[this._offset++] = op2;this.opcodes[this._offset++] = op3;return offset;};babelHelpers.createClass(Program,[{key:'next',get:function(){return this._offset;}},{key:'current',get:function(){return this._offset - 4;}}]);return Program;})();var Environment=(function(){function Environment(_ref27){var appendOperations=_ref27.appendOperations;var updateOperations=_ref27.updateOperations;this._macros = null;this._transaction = null;this.constants = new Constants();this.program = new Program();this.appendOperations = appendOperations;this.updateOperations = updateOperations;}Environment.prototype.toConditionalReference = function toConditionalReference(reference){return new ConditionalReference(reference);};Environment.prototype.getAppendOperations = function getAppendOperations(){return this.appendOperations;};Environment.prototype.getDOM = function getDOM(){return this.updateOperations;};Environment.prototype.getIdentity = function getIdentity(object){return _glimmerUtil.ensureGuid(object) + '';};Environment.prototype.begin = function begin(){_glimmerUtil.assert(!this._transaction,'Cannot start a nested transaction');this._transaction = new Transaction();};Environment.prototype.didCreate = function didCreate(component,manager){this.transaction.didCreate(component,manager);};Environment.prototype.didUpdate = function didUpdate(component,manager){this.transaction.didUpdate(component,manager);};Environment.prototype.scheduleInstallModifier = function scheduleInstallModifier(modifier,manager){this.transaction.scheduleInstallModifier(modifier,manager);};Environment.prototype.scheduleUpdateModifier = function scheduleUpdateModifier(modifier,manager){this.transaction.scheduleUpdateModifier(modifier,manager);};Environment.prototype.didDestroy = function didDestroy(d){this.transaction.didDestroy(d);};Environment.prototype.commit = function commit(){this.transaction.commit();this._transaction = null;};Environment.prototype.attributeFor = function attributeFor(element,attr,isTrusting,namespace){return defaultManagers(element,attr,isTrusting,namespace === undefined?null:namespace);};Environment.prototype.macros = function macros(){var macros=this._macros;if(!macros){this._macros = macros = populateBuiltins();}return macros;};babelHelpers.createClass(Environment,[{key:'transaction',get:function(){return _glimmerUtil.expect(this._transaction,'must be in a transaction');}}]);return Environment;})();var RenderResult=(function(){function RenderResult(env,updating,bounds){this.env = env;this.updating = updating;this.bounds = bounds;}RenderResult.prototype.rerender = function rerender(){var _ref28=arguments.length <= 0 || arguments[0] === undefined?{alwaysRevalidate:false}:arguments[0];var _ref28$alwaysRevalidate=_ref28.alwaysRevalidate;var alwaysRevalidate=_ref28$alwaysRevalidate === undefined?false:_ref28$alwaysRevalidate;var env=this.env;var updating=this.updating;var vm=new UpdatingVM(env,{alwaysRevalidate:alwaysRevalidate});vm.execute(updating,this);};RenderResult.prototype.parentElement = function parentElement(){return this.bounds.parentElement();};RenderResult.prototype.firstNode = function firstNode(){return this.bounds.firstNode();};RenderResult.prototype.lastNode = function lastNode(){return this.bounds.lastNode();};RenderResult.prototype.opcodes = function opcodes(){return this.updating;};RenderResult.prototype.handleException = function handleException(){throw "this should never happen";};RenderResult.prototype.destroy = function destroy(){this.bounds.destroy();clear(this.bounds);};return RenderResult;})();var CapturedFrame=function CapturedFrame(operand,args,condition){this.operand = operand;this.args = args;this.condition = condition;};var Frame=(function(){function Frame(ops){var component=arguments.length <= 1 || arguments[1] === undefined?null:arguments[1];var manager=arguments.length <= 2 || arguments[2] === undefined?null:arguments[2];var shadow=arguments.length <= 3 || arguments[3] === undefined?null:arguments[3];this.ops = ops;this.component = component;this.manager = manager;this.shadow = shadow;this.operand = null;this.immediate = null;this.args = null;this.callerScope = null;this.blocks = null;this.condition = null;this.iterator = null;this.key = null;this.ip = ops[0];}Frame.prototype.capture = function capture(){return new CapturedFrame(this.operand,this.args,this.condition);};Frame.prototype.restore = function restore(frame){this.operand = frame['operand'];this.args = frame['args'];this.condition = frame['condition'];};return Frame;})();var FrameStack=(function(){function FrameStack(){this.frames = [];this.frame = null;}FrameStack.prototype.push = function push(ops){var component=arguments.length <= 1 || arguments[1] === undefined?null:arguments[1];var manager=arguments.length <= 2 || arguments[2] === undefined?null:arguments[2];var shadow=arguments.length <= 3 || arguments[3] === undefined?null:arguments[3];var frame=this.frame === null?this.frame = 0:++this.frame;if(this.frames.length <= frame){this.frames.push(null);}this.frames[frame] = new Frame(ops,component,manager,shadow);};FrameStack.prototype.pop = function pop(){var frames=this.frames;var frame=this.frame;frames[_glimmerUtil.expect(frame,'only pop after pushing')] = null;this.frame = frame === 0?null:frame - 1;};FrameStack.prototype.capture = function capture(){return this.currentFrame.capture();};FrameStack.prototype.restore = function restore(frame){this.currentFrame.restore(frame);};FrameStack.prototype.getOps = function getOps(){return this.currentFrame.ops;};FrameStack.prototype.getCurrent = function getCurrent(){return this.currentFrame.ip;};FrameStack.prototype.setCurrent = function setCurrent(ip){return this.currentFrame.ip = ip;};FrameStack.prototype.getOperand = function getOperand(){return _glimmerUtil.unwrap(this.currentFrame.operand);};FrameStack.prototype.setOperand = function setOperand(operand){return this.currentFrame.operand = operand;};FrameStack.prototype.getImmediate = function getImmediate(){return this.currentFrame.immediate;};FrameStack.prototype.setImmediate = function setImmediate(value){return this.currentFrame.immediate = value;}; // FIXME: These options are required in practice by the existing code, but +// figure out why. +FrameStack.prototype.getArgs = function getArgs(){return this.currentFrame.args;};FrameStack.prototype.setArgs = function setArgs(args){return this.currentFrame.args = args;};FrameStack.prototype.getCondition = function getCondition(){return _glimmerUtil.unwrap(this.currentFrame.condition);};FrameStack.prototype.setCondition = function setCondition(condition){return this.currentFrame.condition = condition;};FrameStack.prototype.getIterator = function getIterator(){return _glimmerUtil.unwrap(this.currentFrame.iterator);};FrameStack.prototype.setIterator = function setIterator(iterator){return this.currentFrame.iterator = iterator;};FrameStack.prototype.getKey = function getKey(){return this.currentFrame.key;};FrameStack.prototype.setKey = function setKey(key){return this.currentFrame.key = key;};FrameStack.prototype.getBlocks = function getBlocks(){return _glimmerUtil.unwrap(this.currentFrame.blocks);};FrameStack.prototype.setBlocks = function setBlocks(blocks){return this.currentFrame.blocks = blocks;};FrameStack.prototype.getCallerScope = function getCallerScope(){return _glimmerUtil.unwrap(this.currentFrame.callerScope);};FrameStack.prototype.setCallerScope = function setCallerScope(callerScope){return this.currentFrame.callerScope = callerScope;};FrameStack.prototype.getComponent = function getComponent(){return _glimmerUtil.unwrap(this.currentFrame.component);};FrameStack.prototype.getManager = function getManager(){return _glimmerUtil.unwrap(this.currentFrame.manager);};FrameStack.prototype.getShadow = function getShadow(){return this.currentFrame.shadow;};FrameStack.prototype.goto = function goto(ip){this.setCurrent(ip);};FrameStack.prototype.hasOpcodes = function hasOpcodes(){return this.frame !== null;};FrameStack.prototype.nextStatement = function nextStatement(env){var ip=this.frames[_glimmerUtil.unwrap(this.frame)].ip;var ops=this.getOps();if(ip <= ops[1]){var program=env.program;this.setCurrent(ip + 4);return program.opcode(ip);}else {this.pop();return null;}};babelHelpers.createClass(FrameStack,[{key:'currentFrame',get:function(){return this.frames[_glimmerUtil.unwrap(this.frame)];}}]);return FrameStack;})();var VM=(function(){function VM(env,scope,dynamicScope,elementStack){this.env = env;this.elementStack = elementStack;this.dynamicScopeStack = new _glimmerUtil.Stack();this.scopeStack = new _glimmerUtil.Stack();this.updatingOpcodeStack = new _glimmerUtil.Stack();this.cacheGroups = new _glimmerUtil.Stack();this.listBlockStack = new _glimmerUtil.Stack();this.frame = new FrameStack();this.env = env;this.constants = env.constants;this.elementStack = elementStack;this.scopeStack.push(scope);this.dynamicScopeStack.push(dynamicScope);}VM.initial = function initial(env,self,dynamicScope,elementStack,size){var scope=Scope.root(self,size);return new VM(env,scope,dynamicScope,elementStack);};VM.prototype.capture = function capture(){return {env:this.env,scope:this.scope(),dynamicScope:this.dynamicScope(),frame:this.frame.capture()};};VM.prototype.goto = function goto(ip){ // assert(this.frame.getOps().contains(op), `Illegal jump to ${op.label}`); +this.frame.goto(ip);};VM.prototype.beginCacheGroup = function beginCacheGroup(){this.cacheGroups.push(this.updating().tail());};VM.prototype.commitCacheGroup = function commitCacheGroup(){ // JumpIfNotModified(END) +// (head) +// (....) +// (tail) +// DidModify +// END: Noop +var END=new LabelOpcode("END");var opcodes=this.updating();var marker=this.cacheGroups.pop();var head=marker?opcodes.nextNode(marker):opcodes.head();var tail=opcodes.tail();var tag=_glimmerReference.combineSlice(new _glimmerUtil.ListSlice(head,tail));var guard=new JumpIfNotModifiedOpcode(tag,END);opcodes.insertBefore(guard,head);opcodes.append(new DidModifyOpcode(guard));opcodes.append(END);};VM.prototype.enter = function enter(sliceId){var updating=new _glimmerUtil.LinkedList();var tracker=this.stack().pushUpdatableBlock();var state=this.capture();var slice=this.constants.getSlice(sliceId);var tryOpcode=new TryOpcode(slice,state,tracker,updating);this.didEnter(tryOpcode,updating);};VM.prototype.enterWithKey = function enterWithKey(key,ops){var updating=new _glimmerUtil.LinkedList();var tracker=this.stack().pushUpdatableBlock();var state=this.capture();var tryOpcode=new TryOpcode(ops,state,tracker,updating);this.listBlock().map[key] = tryOpcode;this.didEnter(tryOpcode,updating);};VM.prototype.enterList = function enterList(ops){var updating=new _glimmerUtil.LinkedList();var tracker=this.stack().pushBlockList(updating);var state=this.capture();var artifacts=this.frame.getIterator().artifacts;var opcode=new ListBlockOpcode(ops,state,tracker,updating,artifacts);this.listBlockStack.push(opcode);this.didEnter(opcode,updating);};VM.prototype.didEnter = function didEnter(opcode,updating){this.updateWith(opcode);this.updatingOpcodeStack.push(updating);};VM.prototype.exit = function exit(){this.stack().popBlock();this.updatingOpcodeStack.pop();var parent=this.updating().tail();parent.didInitializeChildren();};VM.prototype.exitList = function exitList(){this.exit();this.listBlockStack.pop();};VM.prototype.updateWith = function updateWith(opcode){this.updating().append(opcode);};VM.prototype.listBlock = function listBlock(){return _glimmerUtil.expect(this.listBlockStack.current,'expected a list block');};VM.prototype.updating = function updating(){return _glimmerUtil.expect(this.updatingOpcodeStack.current,'expected updating opcode on the updating opcode stack');};VM.prototype.stack = function stack(){return this.elementStack;};VM.prototype.scope = function scope(){return _glimmerUtil.expect(this.scopeStack.current,'expected scope on the scope stack');};VM.prototype.dynamicScope = function dynamicScope(){return _glimmerUtil.expect(this.dynamicScopeStack.current,'expected dynamic scope on the dynamic scope stack');};VM.prototype.pushFrame = function pushFrame(block,args,callerScope){this.frame.push(block.slice);if(args)this.frame.setArgs(args);if(args && args.blocks)this.frame.setBlocks(args.blocks);if(callerScope)this.frame.setCallerScope(callerScope);};VM.prototype.pushComponentFrame = function pushComponentFrame(layout,args,callerScope,component,manager,shadow){this.frame.push(layout.slice,component,manager,shadow);if(args)this.frame.setArgs(args);if(args && args.blocks)this.frame.setBlocks(args.blocks);if(callerScope)this.frame.setCallerScope(callerScope);};VM.prototype.pushEvalFrame = function pushEvalFrame(slice){this.frame.push(slice);};VM.prototype.pushChildScope = function pushChildScope(){this.scopeStack.push(this.scope().child());};VM.prototype.pushCallerScope = function pushCallerScope(){this.scopeStack.push(_glimmerUtil.expect(this.scope().getCallerScope(),'pushCallerScope is called when a caller scope is present'));};VM.prototype.pushDynamicScope = function pushDynamicScope(){var child=this.dynamicScope().child();this.dynamicScopeStack.push(child);return child;};VM.prototype.pushRootScope = function pushRootScope(self,size){var scope=Scope.root(self,size);this.scopeStack.push(scope);return scope;};VM.prototype.popScope = function popScope(){this.scopeStack.pop();};VM.prototype.popDynamicScope = function popDynamicScope(){this.dynamicScopeStack.pop();};VM.prototype.newDestroyable = function newDestroyable(d){this.stack().newDestroyable(d);}; /// SCOPE HELPERS +VM.prototype.getSelf = function getSelf(){return this.scope().getSelf();};VM.prototype.referenceForSymbol = function referenceForSymbol(symbol){return this.scope().getSymbol(symbol);};VM.prototype.getArgs = function getArgs(){return this.frame.getArgs();}; /// EXECUTION +VM.prototype.resume = function resume(opcodes,frame){return this.execute(opcodes,function(vm){return vm.frame.restore(frame);});};VM.prototype.execute = function execute(opcodes,initialize){_glimmerUtil.LOGGER.debug("[VM] Begin program execution");var elementStack=this.elementStack;var frame=this.frame;var updatingOpcodeStack=this.updatingOpcodeStack;var env=this.env;elementStack.pushSimpleBlock();updatingOpcodeStack.push(new _glimmerUtil.LinkedList());frame.push(opcodes);if(initialize)initialize(this);var opcode=undefined;while(frame.hasOpcodes()) {if(opcode = frame.nextStatement(this.env)){_glimmerUtil.LOGGER.trace(opcode);APPEND_OPCODES.evaluate(this,opcode);}}_glimmerUtil.LOGGER.debug("[VM] Completed program execution");return new RenderResult(env,_glimmerUtil.expect(updatingOpcodeStack.pop(),'there should be a final updating opcode stack'),elementStack.popBlock());};VM.prototype.evaluateOpcode = function evaluateOpcode(opcode){APPEND_OPCODES.evaluate(this,opcode);}; // Make sure you have opcodes that push and pop a scope around this opcode +// if you need to change the scope. +VM.prototype.invokeBlock = function invokeBlock(block,args){var compiled=block.compile(this.env);this.pushFrame(compiled,args);};VM.prototype.invokePartial = function invokePartial(block){var compiled=block.compile(this.env);this.pushFrame(compiled);};VM.prototype.invokeLayout = function invokeLayout(args,layout,callerScope,component,manager,shadow){this.pushComponentFrame(layout,args,callerScope,component,manager,shadow);};VM.prototype.evaluateOperand = function evaluateOperand(expr){this.frame.setOperand(expr.evaluate(this));};VM.prototype.evaluateArgs = function evaluateArgs(args){var evaledArgs=this.frame.setArgs(args.evaluate(this));this.frame.setOperand(evaledArgs.positional.at(0));};VM.prototype.bindPositionalArgs = function bindPositionalArgs(symbols){var args=_glimmerUtil.expect(this.frame.getArgs(),'bindPositionalArgs assumes a previous setArgs');var positional=args.positional;var scope=this.scope();for(var i=0;i < symbols.length;i++) {scope.bindSymbol(symbols[i],positional.at(i));}};VM.prototype.bindNamedArgs = function bindNamedArgs(names,symbols){var args=_glimmerUtil.expect(this.frame.getArgs(),'bindNamedArgs assumes a previous setArgs');var scope=this.scope();var named=args.named;for(var i=0;i < names.length;i++) {var _name2=this.constants.getString(names[i]);scope.bindSymbol(symbols[i],named.get(_name2));}};VM.prototype.bindBlocks = function bindBlocks(names,symbols){var blocks=this.frame.getBlocks();var scope=this.scope();for(var i=0;i < names.length;i++) {var _name3=this.constants.getString(names[i]);scope.bindBlock(symbols[i],blocks && blocks[_name3] || null);}};VM.prototype.bindPartialArgs = function bindPartialArgs(symbol){var args=_glimmerUtil.expect(this.frame.getArgs(),'bindPartialArgs assumes a previous setArgs');var scope=this.scope();_glimmerUtil.assert(args,"Cannot bind named args");scope.bindPartialArgs(symbol,args);};VM.prototype.bindCallerScope = function bindCallerScope(){var callerScope=this.frame.getCallerScope();var scope=this.scope();_glimmerUtil.assert(callerScope,"Cannot bind caller scope");scope.bindCallerScope(callerScope);};VM.prototype.bindDynamicScope = function bindDynamicScope(names){var args=_glimmerUtil.expect(this.frame.getArgs(),'bindDynamicScope assumes a previous setArgs');var scope=this.dynamicScope();_glimmerUtil.assert(args,"Cannot bind dynamic scope");for(var i=0;i < names.length;i++) {var _name4=this.constants.getString(names[i]);scope.set(_name4,args.named.get(_name4));}};return VM;})();var UpdatingVM=(function(){function UpdatingVM(env,_ref29){var _ref29$alwaysRevalidate=_ref29.alwaysRevalidate;var alwaysRevalidate=_ref29$alwaysRevalidate === undefined?false:_ref29$alwaysRevalidate;this.frameStack = new _glimmerUtil.Stack();this.env = env;this.constants = env.constants;this.dom = env.getDOM();this.alwaysRevalidate = alwaysRevalidate;}UpdatingVM.prototype.execute = function execute(opcodes,handler){var frameStack=this.frameStack;this.try(opcodes,handler);while(true) {if(frameStack.isEmpty())break;var opcode=this.frame.nextStatement();if(opcode === null){this.frameStack.pop();continue;}_glimmerUtil.LOGGER.debug('[VM] OP ' + opcode.type);_glimmerUtil.LOGGER.trace(opcode);opcode.evaluate(this);}};UpdatingVM.prototype.goto = function goto(op){this.frame.goto(op);};UpdatingVM.prototype.try = function _try(ops,handler){this.frameStack.push(new UpdatingVMFrame(this,ops,handler));};UpdatingVM.prototype.throw = function _throw(){this.frame.handleException();this.frameStack.pop();};UpdatingVM.prototype.evaluateOpcode = function evaluateOpcode(opcode){opcode.evaluate(this);};babelHelpers.createClass(UpdatingVM,[{key:'frame',get:function(){return _glimmerUtil.expect(this.frameStack.current,'bug: expected a frame');}}]);return UpdatingVM;})();var BlockOpcode=(function(_UpdatingOpcode8){babelHelpers.inherits(BlockOpcode,_UpdatingOpcode8);function BlockOpcode(ops,state,bounds,children){_UpdatingOpcode8.call(this);this.ops = ops;this.type = "block";this.next = null;this.prev = null;var env=state.env;var scope=state.scope;var dynamicScope=state.dynamicScope;var frame=state.frame;this.children = children;this.env = env;this.scope = scope;this.dynamicScope = dynamicScope;this.frame = frame;this.bounds = bounds;}BlockOpcode.prototype.parentElement = function parentElement(){return this.bounds.parentElement();};BlockOpcode.prototype.firstNode = function firstNode(){return this.bounds.firstNode();};BlockOpcode.prototype.lastNode = function lastNode(){return this.bounds.lastNode();};BlockOpcode.prototype.evaluate = function evaluate(vm){vm.try(this.children,null);};BlockOpcode.prototype.destroy = function destroy(){this.bounds.destroy();};BlockOpcode.prototype.didDestroy = function didDestroy(){this.env.didDestroy(this.bounds);};BlockOpcode.prototype.toJSON = function toJSON(){var details=_glimmerUtil.dict();details["guid"] = '' + this._guid;return {guid:this._guid,type:this.type,details:details,children:this.children.toArray().map(function(op){return op.toJSON();})};};return BlockOpcode;})(UpdatingOpcode);var TryOpcode=(function(_BlockOpcode){babelHelpers.inherits(TryOpcode,_BlockOpcode);function TryOpcode(ops,state,bounds,children){_BlockOpcode.call(this,ops,state,bounds,children);this.type = "try";this.tag = this._tag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG);}TryOpcode.prototype.didInitializeChildren = function didInitializeChildren(){this._tag.update(_glimmerReference.combineSlice(this.children));};TryOpcode.prototype.evaluate = function evaluate(vm){vm.try(this.children,this);};TryOpcode.prototype.handleException = function handleException(){var env=this.env;var scope=this.scope;var ops=this.ops;var dynamicScope=this.dynamicScope;var frame=this.frame;var elementStack=ElementStack.resume(this.env,this.bounds,this.bounds.reset(env));var vm=new VM(env,scope,dynamicScope,elementStack);var result=vm.resume(ops,frame);this.children = result.opcodes();this.didInitializeChildren();};TryOpcode.prototype.toJSON = function toJSON(){var json=_BlockOpcode.prototype.toJSON.call(this);var details=json["details"];if(!details){details = json["details"] = {};}return _BlockOpcode.prototype.toJSON.call(this);};return TryOpcode;})(BlockOpcode);var ListRevalidationDelegate=(function(){function ListRevalidationDelegate(opcode,marker){this.opcode = opcode;this.marker = marker;this.didInsert = false;this.didDelete = false;this.map = opcode.map;this.updating = opcode['children'];}ListRevalidationDelegate.prototype.insert = function insert(key,item,memo,before){var map=this.map;var opcode=this.opcode;var updating=this.updating;var nextSibling=null;var reference=null;if(before){reference = map[before];nextSibling = reference['bounds'].firstNode();}else {nextSibling = this.marker;}var vm=opcode.vmForInsertion(nextSibling);var tryOpcode=null;vm.execute(opcode.ops,function(vm){vm.frame.setArgs(EvaluatedArgs.positional([item,memo]));vm.frame.setOperand(item);vm.frame.setCondition(new _glimmerReference.ConstReference(true));vm.frame.setKey(key);var state=vm.capture();var tracker=vm.stack().pushUpdatableBlock();tryOpcode = new TryOpcode(opcode.ops,state,tracker,vm.updating());});tryOpcode.didInitializeChildren();updating.insertBefore(tryOpcode,reference);map[key] = tryOpcode;this.didInsert = true;};ListRevalidationDelegate.prototype.retain = function retain(_key,_item,_memo){};ListRevalidationDelegate.prototype.move = function move(key,_item,_memo,before){var map=this.map;var updating=this.updating;var entry=map[key];var reference=map[before] || null;if(before){moveBounds(entry,reference.firstNode());}else {moveBounds(entry,this.marker);}updating.remove(entry);updating.insertBefore(entry,reference);};ListRevalidationDelegate.prototype.delete = function _delete(key){var map=this.map;var opcode=map[key];opcode.didDestroy();clear(opcode);this.updating.remove(opcode);delete map[key];this.didDelete = true;};ListRevalidationDelegate.prototype.done = function done(){this.opcode.didInitializeChildren(this.didInsert || this.didDelete);};return ListRevalidationDelegate;})();var ListBlockOpcode=(function(_BlockOpcode2){babelHelpers.inherits(ListBlockOpcode,_BlockOpcode2);function ListBlockOpcode(ops,state,bounds,children,artifacts){_BlockOpcode2.call(this,ops,state,bounds,children);this.type = "list-block";this.map = _glimmerUtil.dict();this.lastIterated = _glimmerReference.INITIAL;this.artifacts = artifacts;var _tag=this._tag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG);this.tag = _glimmerReference.combine([artifacts.tag,_tag]);}ListBlockOpcode.prototype.didInitializeChildren = function didInitializeChildren(){var listDidChange=arguments.length <= 0 || arguments[0] === undefined?true:arguments[0];this.lastIterated = this.artifacts.tag.value();if(listDidChange){this._tag.update(_glimmerReference.combineSlice(this.children));}};ListBlockOpcode.prototype.evaluate = function evaluate(vm){var artifacts=this.artifacts;var lastIterated=this.lastIterated;if(!artifacts.tag.validate(lastIterated)){var bounds=this.bounds;var dom=vm.dom;var marker=dom.createComment('');dom.insertAfter(bounds.parentElement(),marker,_glimmerUtil.expect(bounds.lastNode(),"can't insert after an empty bounds"));var target=new ListRevalidationDelegate(this,marker);var synchronizer=new _glimmerReference.IteratorSynchronizer({target:target,artifacts:artifacts});synchronizer.sync();this.parentElement().removeChild(marker);} // Run now-updated updating opcodes +_BlockOpcode2.prototype.evaluate.call(this,vm);};ListBlockOpcode.prototype.vmForInsertion = function vmForInsertion(nextSibling){var env=this.env;var scope=this.scope;var dynamicScope=this.dynamicScope;var elementStack=ElementStack.forInitialRender(this.env,this.bounds.parentElement(),nextSibling);return new VM(env,scope,dynamicScope,elementStack);};ListBlockOpcode.prototype.toJSON = function toJSON(){var json=_BlockOpcode2.prototype.toJSON.call(this);var map=this.map;var inner=Object.keys(map).map(function(key){return JSON.stringify(key) + ': ' + map[key]._guid;}).join(", ");var details=json["details"];if(!details){details = json["details"] = {};}details["map"] = '{' + inner + '}';return json;};return ListBlockOpcode;})(BlockOpcode);var UpdatingVMFrame=(function(){function UpdatingVMFrame(vm,ops,exceptionHandler){this.vm = vm;this.ops = ops;this.exceptionHandler = exceptionHandler;this.vm = vm;this.ops = ops;this.current = ops.head();}UpdatingVMFrame.prototype.goto = function goto(op){this.current = op;};UpdatingVMFrame.prototype.nextStatement = function nextStatement(){var current=this.current;var ops=this.ops;if(current)this.current = ops.nextNode(current);return current;};UpdatingVMFrame.prototype.handleException = function handleException(){if(this.exceptionHandler){this.exceptionHandler.handleException();}};return UpdatingVMFrame;})();var CompiledBlock=function CompiledBlock(slice){this.start = slice[0];this.end = slice[1];this.slice = slice;};var CompiledProgram=(function(_CompiledBlock){babelHelpers.inherits(CompiledProgram,_CompiledBlock);function CompiledProgram(slice,symbols){_CompiledBlock.call(this,slice);this.symbols = symbols;}return CompiledProgram;})(CompiledBlock);function entryPoint(meta){return new ProgramSymbolTable(meta);}function layout(meta,wireNamed,wireYields,hasPartials){var _symbols3=symbols(wireNamed,wireYields,hasPartials);var named=_symbols3.named;var yields=_symbols3.yields;var partialSymbol=_symbols3.partialSymbol;var size=_symbols3.size;return new ProgramSymbolTable(meta,named,yields,partialSymbol,size);}function block(parent,locals){var localsMap=null;var program=parent['program'];if(locals.length !== 0){(function(){var map=localsMap = _glimmerUtil.dict();locals.forEach(function(l){return map[l] = program.size++;});})();}return new BlockSymbolTable(parent,program,localsMap);}function symbols(named,yields,hasPartials){var yieldsMap=null;var namedMap=null;var size=1;if(yields.length !== 0){(function(){var map=yieldsMap = _glimmerUtil.dict();yields.forEach(function(y){return map[y] = size++;});})();}if(named.length !== 0){(function(){var map=namedMap = _glimmerUtil.dict();named.forEach(function(y){return map[y] = size++;});})();}var partialSymbol=hasPartials?size++:null;return {named:namedMap,yields:yieldsMap,partialSymbol:partialSymbol,size:size};}var ProgramSymbolTable=(function(){function ProgramSymbolTable(meta){var named=arguments.length <= 1 || arguments[1] === undefined?null:arguments[1];var yields=arguments.length <= 2 || arguments[2] === undefined?null:arguments[2];var partialArgs=arguments.length <= 3 || arguments[3] === undefined?null:arguments[3];var size=arguments.length <= 4 || arguments[4] === undefined?1:arguments[4];this.meta = meta;this.named = named;this.yields = yields;this.partialArgs = partialArgs;this.size = size;this.program = this;}ProgramSymbolTable.prototype.getMeta = function getMeta(){return this.meta;};ProgramSymbolTable.prototype.getSymbols = function getSymbols(){return {named:this.named,yields:this.yields,locals:null,partialArgs:this.partialArgs};};ProgramSymbolTable.prototype.getSymbol = function getSymbol(kind,name){if(kind === 'local')return null;return this[kind] && this[kind][name];};ProgramSymbolTable.prototype.getPartialArgs = function getPartialArgs(){return this.partialArgs || 0;};return ProgramSymbolTable;})();var BlockSymbolTable=(function(){function BlockSymbolTable(parent,program,locals){this.parent = parent;this.program = program;this.locals = locals;}BlockSymbolTable.prototype.getMeta = function getMeta(){return this.program.getMeta();};BlockSymbolTable.prototype.getSymbols = function getSymbols(){return {named:null,yields:null,locals:this.locals,partialArgs:null};};BlockSymbolTable.prototype.getSymbol = function getSymbol(kind,name){if(kind === 'local'){return this.getLocal(name);}else {return this.program.getSymbol(kind,name);}};BlockSymbolTable.prototype.getLocal = function getLocal(name){var locals=this.locals;var parent=this.parent;var symbol=locals && locals[name];if(!symbol && parent){symbol = parent.getSymbol('local',name);}return symbol;};BlockSymbolTable.prototype.getPartialArgs = function getPartialArgs(){return this.program.getPartialArgs();};return BlockSymbolTable;})();var Specialize=(function(){function Specialize(){this.names = _glimmerUtil.dict();this.funcs = [];}Specialize.prototype.add = function add(name,func){this.funcs.push(func);this.names[name] = this.funcs.length - 1;};Specialize.prototype.specialize = function specialize(sexp,table){var name=sexp[0];var index=this.names[name];if(index === undefined)return sexp;var func=this.funcs[index];_glimmerUtil.assert(!!func,'expected a specialization for ' + sexp[0]);return func(sexp,table);};return Specialize;})();var SPECIALIZE=new Specialize();var E=_glimmerWireFormat.Expressions;SPECIALIZE.add('append',function(sexp,_symbolTable){var path=sexp[1];if(Array.isArray(path) && (E.isUnknown(path) || E.isGet(path))){if(path[1].length !== 1){return ['unoptimized-append',sexp[1],sexp[2]];}}return ['optimized-append',sexp[1],sexp[2]];});SPECIALIZE.add('dynamic-attr',function(sexp,_symbolTable){return ['any-dynamic-attr',sexp[1],sexp[2],sexp[3],false];});SPECIALIZE.add('trusting-attr',function(sexp,_symbolTable){return ['any-dynamic-attr',sexp[1],sexp[2],sexp[3],true];});SPECIALIZE.add('partial',function(sexp,_table){var expression=sexp[1];if(typeof expression === 'string'){return ['static-partial',expression];}else {return ['dynamic-partial',expression];}});function compileStatement(statement,builder){var refined=SPECIALIZE.specialize(statement,builder.symbolTable);STATEMENTS.compile(refined,builder);}var Template=function Template(statements,symbolTable){this.statements = statements;this.symbolTable = symbolTable;};var Layout=(function(_Template){babelHelpers.inherits(Layout,_Template);function Layout(){_Template.apply(this,arguments);}return Layout;})(Template);var EntryPoint=(function(_Template2){babelHelpers.inherits(EntryPoint,_Template2);function EntryPoint(){_Template2.apply(this,arguments);}EntryPoint.prototype.compile = function compile(env){var table=this.symbolTable;var b=builder(env,table);for(var i=0;i < this.statements.length;i++) {var statement=this.statements[i];var refined=SPECIALIZE.specialize(statement,table);STATEMENTS.compile(refined,b);}return new CompiledProgram(b.toSlice(),this.symbolTable.size);};return EntryPoint;})(Template);var InlineBlock=(function(_Template3){babelHelpers.inherits(InlineBlock,_Template3);function InlineBlock(){_Template3.apply(this,arguments);}InlineBlock.prototype.splat = function splat(builder){var table=builder.symbolTable;var locals=table.getSymbols().locals;if(locals){builder.pushChildScope();builder.bindPositionalArgsForLocals(locals);}for(var i=0;i < this.statements.length;i++) {var statement=this.statements[i];var refined=SPECIALIZE.specialize(statement,table);STATEMENTS.compile(refined,builder);}if(locals){builder.popScope();}};InlineBlock.prototype.compile = function compile(env){var table=this.symbolTable;var b=builder(env,table);this.splat(b);return new CompiledBlock(b.toSlice());};return InlineBlock;})(Template);var PartialBlock=(function(_Template4){babelHelpers.inherits(PartialBlock,_Template4);function PartialBlock(){_Template4.apply(this,arguments);}PartialBlock.prototype.compile = function compile(env){var table=this.symbolTable;var b=builder(env,table);for(var i=0;i < this.statements.length;i++) {var statement=this.statements[i];var refined=SPECIALIZE.specialize(statement,table);STATEMENTS.compile(refined,b);}return new CompiledProgram(b.toSlice(),table.size);};return PartialBlock;})(Template);var Scanner=(function(){function Scanner(block,meta,env){this.block = block;this.meta = meta;this.env = env;}Scanner.prototype.scanEntryPoint = function scanEntryPoint(){var block=this.block;var meta=this.meta;var symbolTable=entryPoint(meta);var child=scanBlock(block,symbolTable,this.env);return new EntryPoint(child.statements,symbolTable);};Scanner.prototype.scanLayout = function scanLayout(){var block=this.block;var meta=this.meta;var named=block.named;var yields=block.yields;var hasPartials=block.hasPartials;var symbolTable=layout(meta,named,yields,hasPartials);var child=scanBlock(block,symbolTable,this.env);return new Layout(child.statements,symbolTable);};Scanner.prototype.scanPartial = function scanPartial(symbolTable){var block=this.block;var child=scanBlock(block,symbolTable,this.env);return new PartialBlock(child.statements,symbolTable);};return Scanner;})();function scanBlock(_ref30,symbolTable,env){var statements=_ref30.statements;return new RawInlineBlock(env,symbolTable,statements).scan();}var BaselineSyntax;(function(BaselineSyntax){BaselineSyntax.isScannedComponent = _glimmerWireFormat.is('scanned-component');BaselineSyntax.isPrimitiveElement = _glimmerWireFormat.is('open-primitive-element');BaselineSyntax.isOptimizedAppend = _glimmerWireFormat.is('optimized-append');BaselineSyntax.isUnoptimizedAppend = _glimmerWireFormat.is('unoptimized-append');BaselineSyntax.isAnyAttr = _glimmerWireFormat.is('any-dynamic-attr');BaselineSyntax.isStaticPartial = _glimmerWireFormat.is('static-partial');BaselineSyntax.isDynamicPartial = _glimmerWireFormat.is('dynamic-partial');BaselineSyntax.isFunctionExpression = _glimmerWireFormat.is('function');BaselineSyntax.isNestedBlock = _glimmerWireFormat.is('nested-block');BaselineSyntax.isScannedBlock = _glimmerWireFormat.is('scanned-block');BaselineSyntax.isDebugger = _glimmerWireFormat.is('debugger');var NestedBlock;(function(NestedBlock){function defaultBlock(sexp){return sexp[4];}NestedBlock.defaultBlock = defaultBlock;function inverseBlock(sexp){return sexp[5];}NestedBlock.inverseBlock = inverseBlock;function params(sexp){return sexp[2];}NestedBlock.params = params;function hash(sexp){return sexp[3];}NestedBlock.hash = hash;})(NestedBlock = BaselineSyntax.NestedBlock || (BaselineSyntax.NestedBlock = {}));})(BaselineSyntax || (exports.BaselineSyntax = BaselineSyntax = {}));var RawInlineBlock=(function(){function RawInlineBlock(env,table,statements){this.env = env;this.table = table;this.statements = statements;}RawInlineBlock.prototype.scan = function scan(){var buffer=[];for(var i=0;i < this.statements.length;i++) {var statement=this.statements[i];if(_glimmerWireFormat.Statements.isBlock(statement)){buffer.push(this.specializeBlock(statement));}else if(_glimmerWireFormat.Statements.isComponent(statement)){buffer.push.apply(buffer,this.specializeComponent(statement));}else {buffer.push(statement);}}return new InlineBlock(buffer,this.table);};RawInlineBlock.prototype.specializeBlock = function specializeBlock(block$$){var path=block$$[1];var params=block$$[2];var hash=block$$[3];var template=block$$[4];var inverse=block$$[5];return ['scanned-block',path,params,hash,this.child(template),this.child(inverse)];};RawInlineBlock.prototype.specializeComponent = function specializeComponent(sexp){var tag=sexp[1];var component=sexp[2];if(this.env.hasComponentDefinition([tag],this.table)){var child=this.child(component);var attrs=new RawInlineBlock(this.env,this.table,component.attrs);return [['scanned-component',tag,attrs,component.args,child]];}else {var buf=[];buf.push(['open-element',tag,[]]);buf.push.apply(buf,component.attrs);buf.push(['flush-element']);buf.push.apply(buf,component.statements);buf.push(['close-element']);return buf;}};RawInlineBlock.prototype.child = function child(block$$){if(!block$$)return null;var table=block(this.table,block$$.locals);return new RawInlineBlock(this.env,table,block$$.statements);};return RawInlineBlock;})();function compileLayout(compilable,env){var builder=new ComponentLayoutBuilder(env);compilable.compile(builder);return builder.compile();}var ComponentLayoutBuilder=(function(){function ComponentLayoutBuilder(env){this.env = env;}ComponentLayoutBuilder.prototype.wrapLayout = function wrapLayout(layout){this.inner = new WrappedBuilder(this.env,layout);};ComponentLayoutBuilder.prototype.fromLayout = function fromLayout(layout){this.inner = new UnwrappedBuilder(this.env,layout);};ComponentLayoutBuilder.prototype.compile = function compile(){return this.inner.compile();};babelHelpers.createClass(ComponentLayoutBuilder,[{key:'tag',get:function(){return this.inner.tag;}},{key:'attrs',get:function(){return this.inner.attrs;}}]);return ComponentLayoutBuilder;})();var WrappedBuilder=(function(){function WrappedBuilder(env,layout){this.env = env;this.layout = layout;this.tag = new ComponentTagBuilder();this.attrs = new ComponentAttrsBuilder();}WrappedBuilder.prototype.compile = function compile(){ //========DYNAMIC +// PutValue(TagExpr) +// Test +// JumpUnless(BODY) +// OpenDynamicPrimitiveElement +// DidCreateElement +// ...attr statements... +// FlushElement +// BODY: Noop +// ...body statements... +// PutValue(TagExpr) +// Test +// JumpUnless(END) +// CloseElement +// END: Noop +// DidRenderLayout +// Exit +// +//========STATIC +// OpenPrimitiveElementOpcode +// DidCreateElement +// ...attr statements... +// FlushElement +// ...body statements... +// CloseElement +// DidRenderLayout +// Exit +var env=this.env;var layout=this.layout;var symbolTable=layout.symbolTable;var b=builder(env,layout.symbolTable);b.startLabels();var dynamicTag=this.tag.getDynamic();var staticTag=undefined;if(dynamicTag){b.putValue(dynamicTag);b.test('simple');b.jumpUnless('BODY');b.openDynamicPrimitiveElement();b.didCreateElement();this.attrs['buffer'].forEach(function(statement){return compileStatement(statement,b);});b.flushElement();b.label('BODY');}else if(staticTag = this.tag.getStatic()){b.openPrimitiveElement(staticTag);b.didCreateElement();this.attrs['buffer'].forEach(function(statement){return compileStatement(statement,b);});b.flushElement();}b.preludeForLayout(layout);layout.statements.forEach(function(statement){return compileStatement(statement,b);});if(dynamicTag){b.putValue(dynamicTag);b.test('simple');b.jumpUnless('END');b.closeElement();b.label('END');}else if(staticTag){b.closeElement();}b.didRenderLayout();b.stopLabels();return new CompiledProgram(b.toSlice(),symbolTable.size);};return WrappedBuilder;})();function isOpenElement(value){var type=value[0];return type === 'open-element' || type === 'open-primitive-element';}var UnwrappedBuilder=(function(){function UnwrappedBuilder(env,layout){this.env = env;this.layout = layout;this.attrs = new ComponentAttrsBuilder();}UnwrappedBuilder.prototype.compile = function compile(){var env=this.env;var layout=this.layout;var b=builder(env,layout.symbolTable);b.startLabels();b.preludeForLayout(layout);var attrs=this.attrs['buffer'];var attrsInserted=false;for(var i=0;i < layout.statements.length;i++) {var statement=layout.statements[i];if(!attrsInserted && isOpenElement(statement)){b.openComponentElement(statement[1]);b.didCreateElement();b.shadowAttributes();attrs.forEach(function(statement){return compileStatement(statement,b);});attrsInserted = true;}else {compileStatement(statement,b);}}b.didRenderLayout();b.stopLabels();return new CompiledProgram(b.toSlice(),layout.symbolTable.size);};babelHelpers.createClass(UnwrappedBuilder,[{key:'tag',get:function(){throw new Error('BUG: Cannot call `tag` on an UnwrappedBuilder');}}]);return UnwrappedBuilder;})();var ComponentTagBuilder=(function(){function ComponentTagBuilder(){this.isDynamic = null;this.isStatic = null;this.staticTagName = null;this.dynamicTagName = null;}ComponentTagBuilder.prototype.getDynamic = function getDynamic(){if(this.isDynamic){return this.dynamicTagName;}};ComponentTagBuilder.prototype.getStatic = function getStatic(){if(this.isStatic){return this.staticTagName;}};ComponentTagBuilder.prototype.static = function _static(tagName){this.isStatic = true;this.staticTagName = tagName;};ComponentTagBuilder.prototype.dynamic = function dynamic(tagName){this.isDynamic = true;this.dynamicTagName = ['function',tagName];};return ComponentTagBuilder;})();var ComponentAttrsBuilder=(function(){function ComponentAttrsBuilder(){this.buffer = [];}ComponentAttrsBuilder.prototype.static = function _static(name,value){this.buffer.push(['static-attr',name,value,null]);};ComponentAttrsBuilder.prototype.dynamic = function dynamic(name,value){this.buffer.push(['dynamic-attr',name,['function',value],null]);};return ComponentAttrsBuilder;})();var ComponentBuilder=(function(){function ComponentBuilder(builder){this.builder = builder;this.env = builder.env;}ComponentBuilder.prototype.static = function _static(definition,args,_symbolTable,shadow){this.builder.unit(function(b){b.putComponentDefinition(definition);b.openComponent(compileBaselineArgs(args,b),shadow);b.closeComponent();});};ComponentBuilder.prototype.dynamic = function dynamic(definitionArgs,definition,args,_symbolTable,shadow){this.builder.unit(function(b){b.putArgs(compileArgs(definitionArgs[0],definitionArgs[1],b));b.putValue(['function',definition]);b.test('simple');b.enter('BEGIN','END');b.label('BEGIN');b.jumpUnless('END');b.putDynamicComponentDefinition();b.openComponent(compileBaselineArgs(args,b),shadow);b.closeComponent();b.label('END');b.exit();});};return ComponentBuilder;})();function builder(env,symbolTable){return new OpcodeBuilder(symbolTable,env);}function appendOpcode(name,op1,op2,op3){return APPEND_OPCODES.construct(name,null,op1,op2,op3);}var Labels=(function(){function Labels(){this.labels = _glimmerUtil.dict();this.jumps = [];this.ranges = [];}Labels.prototype.label = function label(name,index){this.labels[name] = index;};Labels.prototype.jump = function jump(at,Target,target){this.jumps.push({at:at,target:target,Target:Target});};Labels.prototype.range = function range(at,Range,start,end){this.ranges.push({at:at,start:start,end:end,Range:Range});};Labels.prototype.patch = function patch(constants,opcodes){for(var i=0;i < this.jumps.length;i++) {var _jumps$i=this.jumps[i];var at=_jumps$i.at;var target=_jumps$i.target;var Target=_jumps$i.Target;opcodes.set(at,APPEND_OPCODES.construct(Target,null,this.labels[target]));}for(var i=0;i < this.ranges.length;i++) {var _ranges$i=this.ranges[i];var at=_ranges$i.at;var start=_ranges$i.start;var end=_ranges$i.end;var _Range=_ranges$i.Range;var slice=constants.slice([this.labels[start],this.labels[end] - 1]);opcodes.set(at,APPEND_OPCODES.construct(_Range,null,slice));}};return Labels;})();var BasicOpcodeBuilder=(function(){function BasicOpcodeBuilder(symbolTable,env,program){this.symbolTable = symbolTable;this.env = env;this.program = program;this.labelsStack = new _glimmerUtil.Stack();this.constants = env.constants;this.start = program.next;}BasicOpcodeBuilder.prototype.opcode = function opcode(name,op1,op2,op3){this.push(appendOpcode(name,op1,op2,op3));};BasicOpcodeBuilder.prototype.push = function push(op){ // console.log(`pushing ${op && op.type}`); +if(op === null){this.program.push([0,0,0,0]);}else {this.program.push(op);}};BasicOpcodeBuilder.prototype.toSlice = function toSlice(){return [this.start,this.program.current];}; // helpers +BasicOpcodeBuilder.prototype.startLabels = function startLabels(){this.labelsStack.push(new Labels());};BasicOpcodeBuilder.prototype.stopLabels = function stopLabels(){var label=_glimmerUtil.expect(this.labelsStack.pop(),'unbalanced push and pop labels');label.patch(this.constants,this.program);}; // partials +BasicOpcodeBuilder.prototype.putPartialDefinition = function putPartialDefinition(_definition){var definition=this.constants.other(_definition);this.opcode(50, /* PutPartial */definition);};BasicOpcodeBuilder.prototype.putDynamicPartialDefinition = function putDynamicPartialDefinition(){this.opcode(49, /* PutDynamicPartial */this.constants.other(this.symbolTable));};BasicOpcodeBuilder.prototype.evaluatePartial = function evaluatePartial(){this.opcode(51, /* EvaluatePartial */this.constants.other(this.symbolTable),this.constants.other(_glimmerUtil.dict()));}; // components +BasicOpcodeBuilder.prototype.putComponentDefinition = function putComponentDefinition(definition){this.opcode(23, /* PutComponent */this.other(definition));};BasicOpcodeBuilder.prototype.putDynamicComponentDefinition = function putDynamicComponentDefinition(){this.opcode(22 /* PutDynamicComponent */);};BasicOpcodeBuilder.prototype.openComponent = function openComponent(args,shadow){this.opcode(24, /* OpenComponent */this.args(args),shadow?this.block(shadow):0);};BasicOpcodeBuilder.prototype.didCreateElement = function didCreateElement(){this.opcode(25 /* DidCreateElement */);};BasicOpcodeBuilder.prototype.shadowAttributes = function shadowAttributes(){this.opcode(26 /* ShadowAttributes */);this.opcode(21 /* CloseBlock */);};BasicOpcodeBuilder.prototype.didRenderLayout = function didRenderLayout(){this.opcode(27 /* DidRenderLayout */);};BasicOpcodeBuilder.prototype.closeComponent = function closeComponent(){this.opcode(28 /* CloseComponent */);}; // content +BasicOpcodeBuilder.prototype.dynamicContent = function dynamicContent(Opcode){this.opcode(31, /* DynamicContent */this.other(Opcode));};BasicOpcodeBuilder.prototype.cautiousAppend = function cautiousAppend(){this.dynamicContent(new OptimizedCautiousAppendOpcode());};BasicOpcodeBuilder.prototype.trustingAppend = function trustingAppend(){this.dynamicContent(new OptimizedTrustingAppendOpcode());};BasicOpcodeBuilder.prototype.guardedCautiousAppend = function guardedCautiousAppend(expression){this.dynamicContent(new GuardedCautiousAppendOpcode(this.compileExpression(expression),this.symbolTable));};BasicOpcodeBuilder.prototype.guardedTrustingAppend = function guardedTrustingAppend(expression){this.dynamicContent(new GuardedTrustingAppendOpcode(this.compileExpression(expression),this.symbolTable));}; // dom +BasicOpcodeBuilder.prototype.text = function text(_text){this.opcode(29, /* Text */this.constants.string(_text));};BasicOpcodeBuilder.prototype.openPrimitiveElement = function openPrimitiveElement(tag){this.opcode(32, /* OpenElement */this.constants.string(tag));};BasicOpcodeBuilder.prototype.openComponentElement = function openComponentElement(tag){this.opcode(35, /* OpenComponentElement */this.constants.string(tag));};BasicOpcodeBuilder.prototype.openDynamicPrimitiveElement = function openDynamicPrimitiveElement(){this.opcode(36 /* OpenDynamicElement */);};BasicOpcodeBuilder.prototype.flushElement = function flushElement(){this.opcode(37 /* FlushElement */);};BasicOpcodeBuilder.prototype.closeElement = function closeElement(){this.opcode(38 /* CloseElement */);};BasicOpcodeBuilder.prototype.staticAttr = function staticAttr(_name,_namespace,_value){var name=this.constants.string(_name);var namespace=_namespace?this.constants.string(_namespace):0;var value=this.constants.string(_value);this.opcode(40, /* StaticAttr */name,value,namespace);};BasicOpcodeBuilder.prototype.dynamicAttrNS = function dynamicAttrNS(_name,_namespace,trusting){var name=this.constants.string(_name);var namespace=this.constants.string(_namespace);this.opcode(42, /* DynamicAttrNS */name,namespace,trusting | 0);};BasicOpcodeBuilder.prototype.dynamicAttr = function dynamicAttr(_name,trusting){var name=this.constants.string(_name);this.opcode(43, /* DynamicAttr */name,trusting | 0);};BasicOpcodeBuilder.prototype.comment = function comment(_comment){var comment=this.constants.string(_comment);this.opcode(30, /* Comment */comment);};BasicOpcodeBuilder.prototype.modifier = function modifier(_name,_args){var args=this.constants.expression(this.compile(_args));var _modifierManager=this.env.lookupModifier([_name],this.symbolTable);var modifierManager=this.constants.other(_modifierManager);var name=this.constants.string(_name);this.opcode(41, /* Modifier */name,modifierManager,args);}; // lists +BasicOpcodeBuilder.prototype.putIterator = function putIterator(){this.opcode(44 /* PutIterator */);};BasicOpcodeBuilder.prototype.enterList = function enterList(start,end){this.push(null);this.labels.range(this.pos,45, /* EnterList */start,end);};BasicOpcodeBuilder.prototype.exitList = function exitList(){this.opcode(46 /* ExitList */);};BasicOpcodeBuilder.prototype.enterWithKey = function enterWithKey(start,end){this.push(null);this.labels.range(this.pos,47, /* EnterWithKey */start,end);};BasicOpcodeBuilder.prototype.nextIter = function nextIter(end){this.push(null);this.labels.jump(this.pos,48, /* NextIter */end);}; // vm +BasicOpcodeBuilder.prototype.openBlock = function openBlock(_args,_inner){var args=this.constants.expression(this.compile(_args));var inner=this.constants.other(_inner);this.opcode(20, /* OpenBlock */inner,args);};BasicOpcodeBuilder.prototype.closeBlock = function closeBlock(){this.opcode(21 /* CloseBlock */);};BasicOpcodeBuilder.prototype.pushRemoteElement = function pushRemoteElement(){this.opcode(33 /* PushRemoteElement */);};BasicOpcodeBuilder.prototype.popRemoteElement = function popRemoteElement(){this.opcode(34 /* PopRemoteElement */);};BasicOpcodeBuilder.prototype.popElement = function popElement(){this.opcode(39 /* PopElement */);};BasicOpcodeBuilder.prototype.label = function label(name){this.labels.label(name,this.nextPos);};BasicOpcodeBuilder.prototype.pushChildScope = function pushChildScope(){this.opcode(0 /* PushChildScope */);};BasicOpcodeBuilder.prototype.popScope = function popScope(){this.opcode(1 /* PopScope */);};BasicOpcodeBuilder.prototype.pushDynamicScope = function pushDynamicScope(){this.opcode(2 /* PushDynamicScope */);};BasicOpcodeBuilder.prototype.popDynamicScope = function popDynamicScope(){this.opcode(3 /* PopDynamicScope */);};BasicOpcodeBuilder.prototype.putNull = function putNull(){this.opcode(4, /* Put */this.constants.NULL_REFERENCE);};BasicOpcodeBuilder.prototype.putValue = function putValue(_expression){var expr=this.constants.expression(this.compileExpression(_expression));this.opcode(5, /* EvaluatePut */expr);};BasicOpcodeBuilder.prototype.putArgs = function putArgs(_args){var args=this.constants.expression(this.compile(_args));this.opcode(6, /* PutArgs */args);};BasicOpcodeBuilder.prototype.bindDynamicScope = function bindDynamicScope(_names){this.opcode(12, /* BindDynamicScope */this.names(_names));};BasicOpcodeBuilder.prototype.bindPositionalArgs = function bindPositionalArgs(_names,_symbols){this.opcode(7, /* BindPositionalArgs */this.names(_names),this.symbols(_symbols));};BasicOpcodeBuilder.prototype.bindNamedArgs = function bindNamedArgs(_names,_symbols){this.opcode(8, /* BindNamedArgs */this.names(_names),this.symbols(_symbols));};BasicOpcodeBuilder.prototype.bindBlocks = function bindBlocks(_names,_symbols){this.opcode(9, /* BindBlocks */this.names(_names),this.symbols(_symbols));};BasicOpcodeBuilder.prototype.enter = function enter(_enter,exit){this.push(null);this.labels.range(this.pos,13, /* Enter */_enter,exit);};BasicOpcodeBuilder.prototype.exit = function exit(){this.opcode(14 /* Exit */);};BasicOpcodeBuilder.prototype.evaluate = function evaluate(_block){var block=this.constants.block(_block);this.opcode(15, /* Evaluate */block);};BasicOpcodeBuilder.prototype.test = function test(testFunc){var _func=undefined;if(testFunc === 'const'){_func = ConstTest;}else if(testFunc === 'simple'){_func = SimpleTest;}else if(testFunc === 'environment'){_func = EnvironmentTest;}else if(typeof testFunc === 'function'){_func = testFunc;}else {throw new Error('unreachable');}var func=this.constants.function(_func);this.opcode(19, /* Test */func);};BasicOpcodeBuilder.prototype.jump = function jump(target){this.push(null);this.labels.jump(this.pos,16, /* Jump */target);};BasicOpcodeBuilder.prototype.jumpIf = function jumpIf(target){this.push(null);this.labels.jump(this.pos,17, /* JumpIf */target);};BasicOpcodeBuilder.prototype.jumpUnless = function jumpUnless(target){this.push(null);this.labels.jump(this.pos,18, /* JumpUnless */target);};BasicOpcodeBuilder.prototype.names = function names(_names){var _this=this;var names=_names.map(function(n){return _this.constants.string(n);});return this.constants.array(names);};BasicOpcodeBuilder.prototype.symbols = function symbols(_symbols2){return this.constants.array(_symbols2);};BasicOpcodeBuilder.prototype.other = function other(value){return this.constants.other(value);};BasicOpcodeBuilder.prototype.args = function args(_args2){return this.constants.expression(this.compile(_args2));};BasicOpcodeBuilder.prototype.block = function block(_block3){return this.constants.block(_block3);};babelHelpers.createClass(BasicOpcodeBuilder,[{key:'pos',get:function(){return this.program.current;}},{key:'nextPos',get:function(){return this.program.next;}},{key:'labels',get:function(){return _glimmerUtil.expect(this.labelsStack.current,'bug: not in a label stack');}}]);return BasicOpcodeBuilder;})();function isCompilableExpression(expr){return expr && typeof expr['compile'] === 'function';}var OpcodeBuilder=(function(_BasicOpcodeBuilder){babelHelpers.inherits(OpcodeBuilder,_BasicOpcodeBuilder);function OpcodeBuilder(symbolTable,env){var program=arguments.length <= 2 || arguments[2] === undefined?env.program:arguments[2];return (function(){_BasicOpcodeBuilder.call(this,symbolTable,env,program);this.component = new ComponentBuilder(this);}).apply(this,arguments);}OpcodeBuilder.prototype.compile = function compile(expr){if(isCompilableExpression(expr)){return expr.compile(this);}else {return expr;}};OpcodeBuilder.prototype.compileExpression = function compileExpression(expression){if(expression instanceof CompiledExpression){return expression;}else {return expr(expression,this);}};OpcodeBuilder.prototype.bindPositionalArgsForLocals = function bindPositionalArgsForLocals(locals){var symbols=Object.keys(locals).map(function(name){return locals[name];});this.opcode(7, /* BindPositionalArgs */this.symbols(symbols));};OpcodeBuilder.prototype.preludeForLayout = function preludeForLayout(layout){var _this2=this;var symbols=layout.symbolTable.getSymbols();if(symbols.named){(function(){var named=symbols.named;var namedNames=Object.keys(named);var namedSymbols=namedNames.map(function(n){return named[n];});_this2.opcode(8, /* BindNamedArgs */_this2.names(namedNames),_this2.symbols(namedSymbols));})();}this.opcode(11 /* BindCallerScope */);if(symbols.yields){(function(){var yields=symbols.yields;var yieldNames=Object.keys(yields);var yieldSymbols=yieldNames.map(function(n){return yields[n];});_this2.opcode(9, /* BindBlocks */_this2.names(yieldNames),_this2.symbols(yieldSymbols));})();}if(symbols.partialArgs){this.opcode(10, /* BindPartialArgs */symbols.partialArgs);}};OpcodeBuilder.prototype.yield = function _yield(args,to){var yields=undefined,partial=undefined;var inner=undefined;if(yields = this.symbolTable.getSymbol('yields',to)){inner = new CompiledGetBlockBySymbol(yields,to);}else if(partial = this.symbolTable.getPartialArgs()){inner = new CompiledInPartialGetBlock(partial,to);}else {throw new Error('[BUG] ${to} is not a valid block name.');}this.openBlock(args,inner);this.closeBlock();}; // TODO +// come back to this +OpcodeBuilder.prototype.labelled = function labelled(args,callback){if(args)this.putArgs(args);this.startLabels();this.enter('BEGIN','END');this.label('BEGIN');callback(this,'BEGIN','END');this.label('END');this.exit();this.stopLabels();}; // TODO +// come back to this +OpcodeBuilder.prototype.iter = function iter(callback){this.startLabels();this.enterList('BEGIN','END');this.label('ITER');this.nextIter('BREAK');this.enterWithKey('BEGIN','END');this.label('BEGIN');callback(this,'BEGIN','END');this.label('END');this.exit();this.jump('ITER');this.label('BREAK');this.exitList();this.stopLabels();}; // TODO +// come back to this +OpcodeBuilder.prototype.unit = function unit(callback){this.startLabels();callback(this);this.stopLabels();};return OpcodeBuilder;})(BasicOpcodeBuilder);APPEND_OPCODES.add(31, /* DynamicContent */function(vm,_ref31){var append=_ref31.op1;var opcode=vm.constants.getOther(append);opcode.evaluate(vm);});function isEmpty(value){return value === null || value === undefined || typeof value['toString'] !== 'function';}function normalizeTextValue(value){if(isEmpty(value)){return '';}return String(value);}function normalizeTrustedValue(value){if(isEmpty(value)){return '';}if(isString(value)){return value;}if(isSafeString(value)){return value.toHTML();}if(isNode(value)){return value;}return String(value);}function normalizeValue(value){if(isEmpty(value)){return '';}if(isString(value)){return value;}if(isSafeString(value) || isNode(value)){return value;}return String(value);}var AppendDynamicOpcode=(function(){function AppendDynamicOpcode(){}AppendDynamicOpcode.prototype.evaluate = function evaluate(vm){var reference=vm.frame.getOperand();var normalized=this.normalize(reference);var value=undefined,cache=undefined;if(_glimmerReference.isConst(reference)){value = normalized.value();}else {cache = new _glimmerReference.ReferenceCache(normalized);value = cache.peek();}var stack=vm.stack();var upsert=this.insert(vm.env.getAppendOperations(),stack,value);var bounds=new Fragment(upsert.bounds);stack.newBounds(bounds);if(cache /* i.e. !isConst(reference) */){vm.updateWith(this.updateWith(vm,reference,cache,bounds,upsert));}};return AppendDynamicOpcode;})();var GuardedAppendOpcode=(function(_AppendDynamicOpcode){babelHelpers.inherits(GuardedAppendOpcode,_AppendDynamicOpcode);function GuardedAppendOpcode(expression,symbolTable){_AppendDynamicOpcode.call(this);this.expression = expression;this.symbolTable = symbolTable;this.deopted = null;}GuardedAppendOpcode.prototype.evaluate = function evaluate(vm){if(this.deopted){vm.pushEvalFrame(this.deopted);}else {vm.evaluateOperand(this.expression);var value=vm.frame.getOperand().value();if(isComponentDefinition(value)){vm.pushEvalFrame(this.deopt(vm.env));}else {_AppendDynamicOpcode.prototype.evaluate.call(this,vm);}}};GuardedAppendOpcode.prototype.deopt = function deopt(env){var _this3=this; // At compile time, we determined that this append callsite might refer +// to a local variable/property lookup that resolves to a component +// definition at runtime. +// +// We could have eagerly compiled this callsite into something like this: +// +// {{#if (is-component-definition foo)}} +// {{component foo}} +// {{else}} +// {{foo}} +// {{/if}} +// +// However, in practice, there might be a large amout of these callsites +// and most of them would resolve to a simple value lookup. Therefore, we +// tried to be optimistic and assumed that the callsite will resolve to +// appending a simple value. +// +// However, we have reached here because at runtime, the guard conditional +// have detected that this callsite is indeed referring to a component +// definition object. Since this is likely going to be true for other +// instances of the same callsite, it is now appropiate to deopt into the +// expanded version that handles both cases. The compilation would look +// like this: +// +// PutValue(expression) +// Test(is-component-definition) +// Enter(BEGIN, END) +// BEGIN: Noop +// JumpUnless(VALUE) +// PutDynamicComponentDefinitionOpcode +// OpenComponent +// CloseComponent +// Jump(END) +// VALUE: Noop +// OptimizedAppend +// END: Noop +// Exit +// +// Keep in mind that even if we *don't* reach here at initial render time, +// it is still possible (although quite rare) that the simple value we +// encounter during initial render could later change into a component +// definition object at update time. That is handled by the "lazy deopt" +// code on the update side (scroll down for the next big block of comment). +var dsl=new OpcodeBuilder(this.symbolTable,env);dsl.putValue(this.expression);dsl.test(IsComponentDefinitionReference.create);dsl.labelled(null,function(dsl,_BEGIN,END){dsl.jumpUnless('VALUE');dsl.putDynamicComponentDefinition();dsl.openComponent(CompiledArgs.empty());dsl.closeComponent();dsl.jump(END);dsl.label('VALUE');dsl.dynamicContent(new _this3.AppendOpcode());});var deopted=this.deopted = dsl.toSlice(); // From this point on, we have essentially replaced ourselves with a new set +// of opcodes. Since we will always be executing the new/deopted code, it's +// a good idea (as a pattern) to null out any unneeded fields here to avoid +// holding on to unneeded/stale objects: +// QUESTION: Shouldn't this whole object be GCed? If not, why not? +this.expression = null;return deopted;};return GuardedAppendOpcode;})(AppendDynamicOpcode);var IsComponentDefinitionReference=(function(_ConditionalReference){babelHelpers.inherits(IsComponentDefinitionReference,_ConditionalReference);function IsComponentDefinitionReference(){_ConditionalReference.apply(this,arguments);}IsComponentDefinitionReference.create = function create(inner){return new IsComponentDefinitionReference(inner);};IsComponentDefinitionReference.prototype.toBool = function toBool(value){return isComponentDefinition(value);};return IsComponentDefinitionReference;})(ConditionalReference);var UpdateOpcode=(function(_UpdatingOpcode9){babelHelpers.inherits(UpdateOpcode,_UpdatingOpcode9);function UpdateOpcode(cache,bounds,upsert){_UpdatingOpcode9.call(this);this.cache = cache;this.bounds = bounds;this.upsert = upsert;this.tag = cache.tag;}UpdateOpcode.prototype.evaluate = function evaluate(vm){var value=this.cache.revalidate();if(_glimmerReference.isModified(value)){var bounds=this.bounds;var upsert=this.upsert;var dom=vm.dom;if(!this.upsert.update(dom,value)){var cursor=new Cursor(bounds.parentElement(),clear(bounds));upsert = this.upsert = this.insert(vm.env.getAppendOperations(),cursor,value);}bounds.update(upsert.bounds);}};UpdateOpcode.prototype.toJSON = function toJSON(){var guid=this._guid;var type=this.type;var cache=this.cache;return {guid:guid,type:type,details:{lastValue:JSON.stringify(cache.peek())}};};return UpdateOpcode;})(UpdatingOpcode);var GuardedUpdateOpcode=(function(_UpdateOpcode){babelHelpers.inherits(GuardedUpdateOpcode,_UpdateOpcode);function GuardedUpdateOpcode(reference,cache,bounds,upsert,appendOpcode,state){_UpdateOpcode.call(this,cache,bounds,upsert);this.reference = reference;this.appendOpcode = appendOpcode;this.state = state;this.deopted = null;this.tag = this._tag = new _glimmerReference.UpdatableTag(this.tag);}GuardedUpdateOpcode.prototype.evaluate = function evaluate(vm){if(this.deopted){vm.evaluateOpcode(this.deopted);}else {if(isComponentDefinition(this.reference.value())){this.lazyDeopt(vm);}else {_UpdateOpcode.prototype.evaluate.call(this,vm);}}};GuardedUpdateOpcode.prototype.lazyDeopt = function lazyDeopt(vm){ // Durign initial render, we know that the reference does not contain a +// component definition, so we optimistically assumed that this append +// is just a normal append. However, at update time, we discovered that +// the reference has switched into containing a component definition, so +// we need to do a "lazy deopt", simulating what would have happened if +// we had decided to perform the deopt in the first place during initial +// render. +// +// More concretely, we would have expanded the curly into a if/else, and +// based on whether the value is a component definition or not, we would +// have entered either the dynamic component branch or the simple value +// branch. +// +// Since we rendered a simple value during initial render (and all the +// updates up until this point), we need to pretend that the result is +// produced by the "VALUE" branch of the deopted append opcode: +// +// Try(BEGIN, END) +// Assert(IsComponentDefinition, expected=false) +// OptimizedUpdate +// +// In this case, because the reference has switched from being a simple +// value into a component definition, what would have happened is that +// the assert would throw, causing the Try opcode to teardown the bounds +// and rerun the original append opcode. +// +// Since the Try opcode would have nuked the updating opcodes anyway, we +// wouldn't have to worry about simulating those. All we have to do is to +// execute the Try opcode and immediately throw. +var bounds=this.bounds;var appendOpcode=this.appendOpcode;var state=this.state;var env=vm.env;var slice=appendOpcode.deopt(env);var enter=_glimmerUtil.expect(env.program.opcode(slice[0] + 8),'hardcoded deopt location');var ops=vm.constants.getSlice(enter.op1);var tracker=new UpdatableBlockTracker(bounds.parentElement());tracker.newBounds(this.bounds);var children=new _glimmerUtil.LinkedList();state.frame['condition'] = IsComponentDefinitionReference.create(_glimmerUtil.expect(state.frame['operand'],'operand should be populated'));var deopted=this.deopted = new TryOpcode(ops,state,tracker,children);this._tag.update(deopted.tag);vm.evaluateOpcode(deopted);vm.throw(); // From this point on, we have essentially replaced ourselve with a new +// opcode. Since we will always be executing the new/deopted code, it's a +// good idea (as a pattern) to null out any unneeded fields here to avoid +// holding on to unneeded/stale objects: +// QUESTION: Shouldn't this whole object be GCed? If not, why not? +this._tag = null;this.reference = null;this.cache = null;this.bounds = null;this.upsert = null;this.appendOpcode = null;this.state = null;};GuardedUpdateOpcode.prototype.toJSON = function toJSON(){var guid=this._guid;var type=this.type;var deopted=this.deopted;if(deopted){return {guid:guid,type:type,deopted:true,children:[deopted.toJSON()]};}else {return _UpdateOpcode.prototype.toJSON.call(this);}};return GuardedUpdateOpcode;})(UpdateOpcode);var OptimizedCautiousAppendOpcode=(function(_AppendDynamicOpcode2){babelHelpers.inherits(OptimizedCautiousAppendOpcode,_AppendDynamicOpcode2);function OptimizedCautiousAppendOpcode(){_AppendDynamicOpcode2.apply(this,arguments);this.type = 'optimized-cautious-append';}OptimizedCautiousAppendOpcode.prototype.normalize = function normalize(reference){return _glimmerReference.map(reference,normalizeValue);};OptimizedCautiousAppendOpcode.prototype.insert = function insert(dom,cursor,value){return cautiousInsert(dom,cursor,value);};OptimizedCautiousAppendOpcode.prototype.updateWith = function updateWith(_vm,_reference,cache,bounds,upsert){return new OptimizedCautiousUpdateOpcode(cache,bounds,upsert);};return OptimizedCautiousAppendOpcode;})(AppendDynamicOpcode);var OptimizedCautiousUpdateOpcode=(function(_UpdateOpcode2){babelHelpers.inherits(OptimizedCautiousUpdateOpcode,_UpdateOpcode2);function OptimizedCautiousUpdateOpcode(){_UpdateOpcode2.apply(this,arguments);this.type = 'optimized-cautious-update';}OptimizedCautiousUpdateOpcode.prototype.insert = function insert(dom,cursor,value){return cautiousInsert(dom,cursor,value);};return OptimizedCautiousUpdateOpcode;})(UpdateOpcode);var GuardedCautiousAppendOpcode=(function(_GuardedAppendOpcode){babelHelpers.inherits(GuardedCautiousAppendOpcode,_GuardedAppendOpcode);function GuardedCautiousAppendOpcode(){_GuardedAppendOpcode.apply(this,arguments);this.type = 'guarded-cautious-append';this.AppendOpcode = OptimizedCautiousAppendOpcode;}GuardedCautiousAppendOpcode.prototype.normalize = function normalize(reference){return _glimmerReference.map(reference,normalizeValue);};GuardedCautiousAppendOpcode.prototype.insert = function insert(dom,cursor,value){return cautiousInsert(dom,cursor,value);};GuardedCautiousAppendOpcode.prototype.updateWith = function updateWith(vm,reference,cache,bounds,upsert){return new GuardedCautiousUpdateOpcode(reference,cache,bounds,upsert,this,vm.capture());};return GuardedCautiousAppendOpcode;})(GuardedAppendOpcode);var GuardedCautiousUpdateOpcode=(function(_GuardedUpdateOpcode){babelHelpers.inherits(GuardedCautiousUpdateOpcode,_GuardedUpdateOpcode);function GuardedCautiousUpdateOpcode(){_GuardedUpdateOpcode.apply(this,arguments);this.type = 'guarded-cautious-update';}GuardedCautiousUpdateOpcode.prototype.insert = function insert(dom,cursor,value){return cautiousInsert(dom,cursor,value);};return GuardedCautiousUpdateOpcode;})(GuardedUpdateOpcode);var OptimizedTrustingAppendOpcode=(function(_AppendDynamicOpcode3){babelHelpers.inherits(OptimizedTrustingAppendOpcode,_AppendDynamicOpcode3);function OptimizedTrustingAppendOpcode(){_AppendDynamicOpcode3.apply(this,arguments);this.type = 'optimized-trusting-append';}OptimizedTrustingAppendOpcode.prototype.normalize = function normalize(reference){return _glimmerReference.map(reference,normalizeTrustedValue);};OptimizedTrustingAppendOpcode.prototype.insert = function insert(dom,cursor,value){return trustingInsert(dom,cursor,value);};OptimizedTrustingAppendOpcode.prototype.updateWith = function updateWith(_vm,_reference,cache,bounds,upsert){return new OptimizedTrustingUpdateOpcode(cache,bounds,upsert);};return OptimizedTrustingAppendOpcode;})(AppendDynamicOpcode);var OptimizedTrustingUpdateOpcode=(function(_UpdateOpcode3){babelHelpers.inherits(OptimizedTrustingUpdateOpcode,_UpdateOpcode3);function OptimizedTrustingUpdateOpcode(){_UpdateOpcode3.apply(this,arguments);this.type = 'optimized-trusting-update';}OptimizedTrustingUpdateOpcode.prototype.insert = function insert(dom,cursor,value){return trustingInsert(dom,cursor,value);};return OptimizedTrustingUpdateOpcode;})(UpdateOpcode);var GuardedTrustingAppendOpcode=(function(_GuardedAppendOpcode2){babelHelpers.inherits(GuardedTrustingAppendOpcode,_GuardedAppendOpcode2);function GuardedTrustingAppendOpcode(){_GuardedAppendOpcode2.apply(this,arguments);this.type = 'guarded-trusting-append';this.AppendOpcode = OptimizedTrustingAppendOpcode;}GuardedTrustingAppendOpcode.prototype.normalize = function normalize(reference){return _glimmerReference.map(reference,normalizeTrustedValue);};GuardedTrustingAppendOpcode.prototype.insert = function insert(dom,cursor,value){return trustingInsert(dom,cursor,value);};GuardedTrustingAppendOpcode.prototype.updateWith = function updateWith(vm,reference,cache,bounds,upsert){return new GuardedTrustingUpdateOpcode(reference,cache,bounds,upsert,this,vm.capture());};return GuardedTrustingAppendOpcode;})(GuardedAppendOpcode);var GuardedTrustingUpdateOpcode=(function(_GuardedUpdateOpcode2){babelHelpers.inherits(GuardedTrustingUpdateOpcode,_GuardedUpdateOpcode2);function GuardedTrustingUpdateOpcode(){_GuardedUpdateOpcode2.apply(this,arguments);this.type = 'trusting-update';}GuardedTrustingUpdateOpcode.prototype.insert = function insert(dom,cursor,value){return trustingInsert(dom,cursor,value);};return GuardedTrustingUpdateOpcode;})(GuardedUpdateOpcode);APPEND_OPCODES.add(49, /* PutDynamicPartial */function(vm,_ref32){var _symbolTable=_ref32.op1;var env=vm.env;var symbolTable=vm.constants.getOther(_symbolTable);function lookupPartial(name){var normalized=String(name);if(!env.hasPartial(normalized,symbolTable)){throw new Error('Could not find a partial named "' + normalized + '"');}return env.lookupPartial(normalized,symbolTable);}var reference=_glimmerReference.map(vm.frame.getOperand(),lookupPartial);var cache=_glimmerReference.isConst(reference)?undefined:new _glimmerReference.ReferenceCache(reference);var definition=cache?cache.peek():reference.value();vm.frame.setImmediate(definition);if(cache){vm.updateWith(new Assert(cache));}});APPEND_OPCODES.add(50, /* PutPartial */function(vm,_ref33){var _definition=_ref33.op1;var definition=vm.constants.getOther(_definition);vm.frame.setImmediate(definition);});APPEND_OPCODES.add(51, /* EvaluatePartial */function(vm,_ref34){var _symbolTable=_ref34.op1;var _cache=_ref34.op2;var symbolTable=vm.constants.getOther(_symbolTable);var cache=vm.constants.getOther(_cache);var _vm$frame$getImmediate=vm.frame.getImmediate();var template=_vm$frame$getImmediate.template;var block=cache[template.id];if(!block){block = template.asPartial(symbolTable);}vm.invokePartial(block);});var IterablePresenceReference=(function(){function IterablePresenceReference(artifacts){this.tag = artifacts.tag;this.artifacts = artifacts;}IterablePresenceReference.prototype.value = function value(){return !this.artifacts.isEmpty();};return IterablePresenceReference;})();APPEND_OPCODES.add(44, /* PutIterator */function(vm){var listRef=vm.frame.getOperand();var args=_glimmerUtil.expect(vm.frame.getArgs(),'PutIteratorOpcode expects a populated args register');var iterable=vm.env.iterableFor(listRef,args);var iterator=new _glimmerReference.ReferenceIterator(iterable);vm.frame.setIterator(iterator);vm.frame.setCondition(new IterablePresenceReference(iterator.artifacts));});APPEND_OPCODES.add(45, /* EnterList */function(vm,_ref35){var _slice=_ref35.op1;vm.enterList(vm.constants.getSlice(_slice));});APPEND_OPCODES.add(46, /* ExitList */function(vm){return vm.exitList();});APPEND_OPCODES.add(47, /* EnterWithKey */function(vm,_ref36){var _slice=_ref36.op2;var key=_glimmerUtil.expect(vm.frame.getKey(),'EnterWithKeyOpcode expects a populated key register');var slice=vm.constants.getSlice(_slice);vm.enterWithKey(key,slice);});var TRUE_REF=new _glimmerReference.ConstReference(true);var FALSE_REF=new _glimmerReference.ConstReference(false);APPEND_OPCODES.add(48, /* NextIter */function(vm,_ref37){var end=_ref37.op1;var item=vm.frame.getIterator().next();if(item){vm.frame.setCondition(TRUE_REF);vm.frame.setKey(item.key);vm.frame.setOperand(item.value);vm.frame.setArgs(EvaluatedArgs.positional([item.value,item.memo]));}else {vm.frame.setCondition(FALSE_REF);vm.goto(end);}});var clientId=0;function templateFactory(_ref38){var templateId=_ref38.id;var meta=_ref38.meta;var block=_ref38.block;var parsedBlock=undefined;var id=templateId || 'client-' + clientId++;var create=function(env,envMeta){var newMeta=envMeta?_glimmerUtil.assign({},envMeta,meta):meta;if(!parsedBlock){parsedBlock = JSON.parse(block);}return template(parsedBlock,id,newMeta,env);};return {id:id,meta:meta,create:create};}function template(block,id,meta,env){var scanner=new Scanner(block,meta,env);var entryPoint=undefined;var asEntryPoint=function(){if(!entryPoint)entryPoint = scanner.scanEntryPoint();return entryPoint;};var layout=undefined;var asLayout=function(){if(!layout)layout = scanner.scanLayout();return layout;};var asPartial=function(symbols){return scanner.scanPartial(symbols);};var render=function(self,appendTo,dynamicScope){var elementStack=ElementStack.forInitialRender(env,appendTo,null);var compiled=asEntryPoint().compile(env);var vm=VM.initial(env,self,dynamicScope,elementStack,compiled.symbols);return vm.execute(compiled.slice);};return {id:id,meta:meta,_block:block,asEntryPoint:asEntryPoint,asLayout:asLayout,asPartial:asPartial,render:render};}var DynamicVarReference=(function(){function DynamicVarReference(scope,nameRef){this.scope = scope;this.nameRef = nameRef;var varTag=this.varTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG);this.tag = _glimmerReference.combine([nameRef.tag,varTag]);}DynamicVarReference.prototype.value = function value(){return this.getVar().value();};DynamicVarReference.prototype.get = function get(key){return this.getVar().get(key);};DynamicVarReference.prototype.getVar = function getVar(){var name=String(this.nameRef.value());var ref=this.scope.get(name);this.varTag.update(ref.tag);return ref;};return DynamicVarReference;})();function getDynamicVar(vm,args,_symbolTable){var scope=vm.dynamicScope();var nameRef=args.positional.at(0);return new DynamicVarReference(scope,nameRef);}var PartialDefinition=function PartialDefinition(name,template){this.name = name;this.template = template;};var NodeType;(function(NodeType){NodeType[NodeType["Element"] = 0] = "Element";NodeType[NodeType["Attribute"] = 1] = "Attribute";NodeType[NodeType["Text"] = 2] = "Text";NodeType[NodeType["CdataSection"] = 3] = "CdataSection";NodeType[NodeType["EntityReference"] = 4] = "EntityReference";NodeType[NodeType["Entity"] = 5] = "Entity";NodeType[NodeType["ProcessingInstruction"] = 6] = "ProcessingInstruction";NodeType[NodeType["Comment"] = 7] = "Comment";NodeType[NodeType["Document"] = 8] = "Document";NodeType[NodeType["DocumentType"] = 9] = "DocumentType";NodeType[NodeType["DocumentFragment"] = 10] = "DocumentFragment";NodeType[NodeType["Notation"] = 11] = "Notation";})(NodeType || (NodeType = {}));var Simple=Object.freeze({get NodeType(){return NodeType;}});exports.Simple = Simple;exports.templateFactory = templateFactory;exports.NULL_REFERENCE = NULL_REFERENCE;exports.UNDEFINED_REFERENCE = UNDEFINED_REFERENCE;exports.PrimitiveReference = PrimitiveReference;exports.ConditionalReference = ConditionalReference;exports.OpcodeBuilderDSL = OpcodeBuilder;exports.compileLayout = compileLayout;exports.CompiledBlock = CompiledBlock;exports.CompiledProgram = CompiledProgram;exports.IAttributeManager = AttributeManager;exports.AttributeManager = AttributeManager;exports.PropertyManager = PropertyManager;exports.INPUT_VALUE_PROPERTY_MANAGER = INPUT_VALUE_PROPERTY_MANAGER;exports.defaultManagers = defaultManagers;exports.defaultAttributeManagers = defaultAttributeManagers;exports.defaultPropertyManagers = defaultPropertyManagers;exports.readDOMAttr = readDOMAttr;exports.normalizeTextValue = normalizeTextValue;exports.CompiledExpression = CompiledExpression;exports.CompiledArgs = CompiledArgs;exports.CompiledNamedArgs = CompiledNamedArgs;exports.CompiledPositionalArgs = CompiledPositionalArgs;exports.EvaluatedArgs = EvaluatedArgs;exports.EvaluatedNamedArgs = EvaluatedNamedArgs;exports.EvaluatedPositionalArgs = EvaluatedPositionalArgs;exports.getDynamicVar = getDynamicVar;exports.BlockMacros = Blocks;exports.InlineMacros = Inlines;exports.compileArgs = compileArgs;exports.setDebuggerCallback = setDebuggerCallback;exports.resetDebuggerCallback = resetDebuggerCallback;exports.BaselineSyntax = BaselineSyntax;exports.Layout = Layout;exports.UpdatingVM = UpdatingVM;exports.RenderResult = RenderResult;exports.isSafeString = isSafeString;exports.Scope = Scope;exports.Environment = Environment;exports.PartialDefinition = PartialDefinition;exports.ComponentDefinition = ComponentDefinition;exports.isComponentDefinition = isComponentDefinition;exports.DOMChanges = helper$1;exports.IDOMChanges = DOMChanges;exports.DOMTreeConstruction = DOMTreeConstruction;exports.isWhitespace = isWhitespace;exports.insertHTMLBefore = _insertHTMLBefore;exports.ElementStack = ElementStack;exports.ConcreteBounds = ConcreteBounds;}); +enifed('@glimmer/util', ['exports'], function (exports) { + // There is a small whitelist of namespaced attributes specially + // enumerated in + // https://www.w3.org/TR/html/syntax.html#attributes-0 + // + // > When a foreign element has one of the namespaced attributes given by + // > the local name and namespace of the first and second cells of a row + // > from the following table, it must be written using the name given by + // > the third cell from the same row. + // + // In all other cases, colons are interpreted as a regular character + // with no special meaning: + // + // > No other namespaced attribute can be expressed in the HTML syntax. + 'use strict'; - this._throttlers.push(throttler); + var XLINK = 'http://www.w3.org/1999/xlink'; + var XML = 'http://www.w3.org/XML/1998/namespace'; + var XMLNS = 'http://www.w3.org/2000/xmlns/'; + var WHITELIST = { + 'xlink:actuate': XLINK, + 'xlink:arcrole': XLINK, + 'xlink:href': XLINK, + 'xlink:role': XLINK, + 'xlink:show': XLINK, + 'xlink:title': XLINK, + 'xlink:type': XLINK, + 'xml:base': XML, + 'xml:lang': XML, + 'xml:space': XML, + 'xmlns': XMLNS, + 'xmlns:xlink': XMLNS + }; + function getAttrNamespace(attrName) { + return WHITELIST[attrName] || null; + } - return throttler; - }, + // tslint:disable-line + function unwrap(val) { + if (val === null || val === undefined) throw new Error('Expected value to be present'); + return val; + } + function expect(val, message) { + if (val === null || val === undefined) throw new Error(message); + return val; + } + function unreachable() { + return new Error('unreachable'); + } - debounce: function(target, method /* , args, wait, [immediate] */) { - var backburner = this; - var args = new Array(arguments.length); - for (var i = 0; i < arguments.length; i++) { - args[i] = arguments[i]; + // import Logger from './logger'; + // let alreadyWarned = false; + // import Logger from './logger'; + function debugAssert(test, msg) { + // if (!alreadyWarned) { + // alreadyWarned = true; + // Logger.warn("Don't leave debug assertions on in public builds"); + // } + if (!test) { + throw new Error(msg || "assertion failure"); + } } - var immediate = args.pop(); - var wait, index, debouncee, timer; + var LogLevel; + (function (LogLevel) { + LogLevel[LogLevel["Trace"] = 0] = "Trace"; + LogLevel[LogLevel["Debug"] = 1] = "Debug"; + LogLevel[LogLevel["Warn"] = 2] = "Warn"; + LogLevel[LogLevel["Error"] = 3] = "Error"; + })(LogLevel || (exports.LogLevel = LogLevel = {})); - if (isNumber(immediate) || isString(immediate)) { - wait = immediate; - immediate = false; - } else { - wait = args.pop(); - } + var NullConsole = (function () { + function NullConsole() {} - wait = parseInt(wait, 10); - // Remove debouncee - index = findDebouncee(target, method, this._debouncees); + NullConsole.prototype.log = function log(_message) {}; - if (index > -1) { - debouncee = this._debouncees[index]; - this._debouncees.splice(index, 1); - this._platform.clearTimeout(debouncee[2]); - } + NullConsole.prototype.warn = function warn(_message) {}; - timer = this._platform.setTimeout(function() { - if (!immediate) { - backburner.run.apply(backburner, args); - } - var index = findDebouncee(target, method, backburner._debouncees); - if (index > -1) { - backburner._debouncees.splice(index, 1); - } - }, wait); + NullConsole.prototype.error = function error(_message) {}; - if (immediate && index === -1) { - backburner.run.apply(backburner, args); - } + NullConsole.prototype.trace = function trace() {}; - debouncee = [ - target, - method, - timer - ]; + return NullConsole; + })(); - backburner._debouncees.push(debouncee); + var ALWAYS = undefined; - return debouncee; - }, + var Logger = (function () { + function Logger(_ref) { + var console = _ref.console; + var level = _ref.level; - cancelTimers: function() { - each(this._throttlers, this._boundClearItems); - this._throttlers = []; + this.f = ALWAYS; + this.force = ALWAYS; + this.console = console; + this.level = level; + } - each(this._debouncees, this._boundClearItems); - this._debouncees = []; + Logger.prototype.skipped = function skipped(level) { + return level < this.level; + }; - this._clearTimerTimeout(); - this._timers = []; + Logger.prototype.trace = function trace(message) { + var _ref2 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - if (this._autorun) { - this._platform.clearTimeout(this._autorun); - this._autorun = null; - } - }, + var _ref2$stackTrace = _ref2.stackTrace; + var stackTrace = _ref2$stackTrace === undefined ? false : _ref2$stackTrace; - hasTimers: function() { - return !!this._timers.length || !!this._debouncees.length || !!this._throttlers.length || this._autorun; - }, + if (this.skipped(LogLevel.Trace)) return; + this.console.log(message); + if (stackTrace) this.console.trace(); + }; - cancel: function (timer) { - var timerType = typeof timer; + Logger.prototype.debug = function debug(message) { + var _ref3 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - if (timer && timerType === 'object' && timer.queue && timer.method) { // we're cancelling a deferOnce - return timer.queue.cancel(timer); - } else if (timerType === 'function') { // we're cancelling a setTimeout - for (var i = 0, l = this._timers.length; i < l; i += 2) { - if (this._timers[i + 1] === timer) { - this._timers.splice(i, 2); // remove the two elements - if (i === 0) { - this._reinstallTimerTimeout(); - } - return true; - } - } - } else if (Object.prototype.toString.call(timer) === '[object Array]'){ // we're cancelling a throttle or debounce - return this._cancelItem(findThrottler, this._throttlers, timer) || - this._cancelItem(findDebouncee, this._debouncees, timer); - } else { - return; // timer was null or not a timer - } - }, + var _ref3$stackTrace = _ref3.stackTrace; + var stackTrace = _ref3$stackTrace === undefined ? false : _ref3$stackTrace; - _cancelItem: function(findMethod, array, timer){ - var item, index; + if (this.skipped(LogLevel.Debug)) return; + this.console.log(message); + if (stackTrace) this.console.trace(); + }; - if (timer.length < 3) { return false; } + Logger.prototype.warn = function warn(message) { + var _ref4 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - index = findMethod(timer[0], timer[1], array); + var _ref4$stackTrace = _ref4.stackTrace; + var stackTrace = _ref4$stackTrace === undefined ? false : _ref4$stackTrace; - if (index > -1) { + if (this.skipped(LogLevel.Warn)) return; + this.console.warn(message); + if (stackTrace) this.console.trace(); + }; - item = array[index]; + Logger.prototype.error = function error(message) { + if (this.skipped(LogLevel.Error)) return; + this.console.error(message); + }; - if (item[2] === timer[2]) { - array.splice(index, 1); - this._platform.clearTimeout(timer[2]); - return true; - } - } + return Logger; + })(); - return false; - }, + var _console = typeof console === 'undefined' ? new NullConsole() : console; + ALWAYS = new Logger({ console: _console, level: LogLevel.Trace }); + var LOG_LEVEL = LogLevel.Warn; + var logger = new Logger({ console: _console, level: LOG_LEVEL }); - _runExpiredTimers: function () { - this._timerTimeoutId = undefined; - this.run(this, this._scheduleExpiredTimers); - }, + var objKeys = Object.keys; - _scheduleExpiredTimers: function () { - var n = Date.now(); - var timers = this._timers; - var i = 0; - var l = timers.length; - for (; i < l; i += 2) { - var executeAt = timers[i]; - var fn = timers[i+1]; - if (executeAt <= n) { - this.schedule(this.options.defaultQueue, null, fn); - } else { - break; - } + function assign(obj) { + for (var i = 1; i < arguments.length; i++) { + var assignment = arguments[i]; + if (assignment === null || typeof assignment !== 'object') continue; + var keys = objKeys(assignment); + for (var j = 0; j < keys.length; j++) { + var key = keys[j]; + obj[key] = assignment[key]; + } + } + return obj; + } + function fillNulls(count) { + var arr = new Array(count); + for (var i = 0; i < count; i++) { + arr[i] = null; + } + return arr; } - timers.splice(0, i); - this._installTimerTimeout(); - }, - - _reinstallTimerTimeout: function () { - this._clearTimerTimeout(); - this._installTimerTimeout(); - }, - _clearTimerTimeout: function () { - if (!this._timerTimeoutId) { - return; + var GUID = 0; + function initializeGuid(object) { + return object._guid = ++GUID; + } + function ensureGuid(object) { + return object._guid || initializeGuid(object); } - this._platform.clearTimeout(this._timerTimeoutId); - this._timerTimeoutId = undefined; - }, - _installTimerTimeout: function () { - if (!this._timers.length) { - return; + var proto = Object.create(null, { + // without this, we will always still end up with (new + // EmptyObject()).constructor === Object + constructor: { + value: undefined, + enumerable: false, + writable: true + } + }); + function EmptyObject() {} + EmptyObject.prototype = proto; + function dict() { + // let d = Object.create(null); + // d.x = 1; + // delete d.x; + // return d; + return new EmptyObject(); } - var minExpiresAt = this._timers[0]; - var n = Date.now(); - var wait = Math.max(0, minExpiresAt - n); - this._timerTimeoutId = this._platform.setTimeout(this._boundRunExpiredTimers, wait); - } -}; -Backburner.prototype.schedule = Backburner.prototype.defer; -Backburner.prototype.scheduleOnce = Backburner.prototype.deferOnce; -Backburner.prototype.later = Backburner.prototype.setTimeout; + var DictSet = (function () { + function DictSet() { + this.dict = dict(); + } -function getOnError(options) { - return options.onError || (options.onErrorTarget && options.onErrorTarget[options.onErrorMethod]); -} + DictSet.prototype.add = function add(obj) { + if (typeof obj === 'string') this.dict[obj] = obj;else this.dict[ensureGuid(obj)] = obj; + return this; + }; -function createAutorun(backburner) { - var setTimeout = backburner._platform.setTimeout; - backburner.begin(); - backburner._autorun = setTimeout(function() { - backburner._autorun = null; - backburner.end(); - }, 0); -} + DictSet.prototype.delete = function _delete(obj) { + if (typeof obj === 'string') delete this.dict[obj];else if (obj._guid) delete this.dict[obj._guid]; + }; -function findDebouncee(target, method, debouncees) { - return findItem(target, method, debouncees); -} + DictSet.prototype.forEach = function forEach(callback) { + var dict = this.dict; -function findThrottler(target, method, throttlers) { - return findItem(target, method, throttlers); -} + Object.keys(dict).forEach(function (key) { + return callback(dict[key]); + }); + }; -function findItem(target, method, collection) { - var item; - var index = -1; + DictSet.prototype.toArray = function toArray() { + return Object.keys(this.dict); + }; - for (var i = 0, l = collection.length; i < l; i++) { - item = collection[i]; - if (item[0] === target && item[1] === method) { - index = i; - break; - } - } + return DictSet; + })(); - return index; -} + var Stack = (function () { + function Stack() { + this.stack = []; + this.current = null; + } -function clearItems(item) { - this._platform.clearTimeout(item[2]); -} + Stack.prototype.toArray = function toArray() { + return this.stack; + }; -exports['default'] = Backburner; + Stack.prototype.push = function push(item) { + this.current = item; + this.stack.push(item); + }; -Object.defineProperty(exports, '__esModule', { value: true }); + Stack.prototype.pop = function pop() { + var item = this.stack.pop(); + var len = this.stack.length; + this.current = len === 0 ? null : this.stack[len - 1]; + return item === undefined ? null : item; + }; -}); -enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'ember-metal'], function (exports, _emberUtils, _emberEnvironment, _emberMetal) { - 'use strict'; + Stack.prototype.isEmpty = function isEmpty() { + return this.stack.length === 0; + }; - exports.default = Container; - exports.buildFakeContainerWithDeprecations = buildFakeContainerWithDeprecations; + return Stack; + })(); - var CONTAINER_OVERRIDE = _emberUtils.symbol('CONTAINER_OVERRIDE'); + var ListNode = function ListNode(value) { + this.next = null; + this.prev = null; + this.value = value; + }; - /** - 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 - objects. - - The public API for `Container` is still in flux and should not be considered - stable. - - @private - @class Container - */ + var LinkedList = (function () { + function LinkedList() { + this.clear(); + } - function Container(registry, options) { - this.registry = registry; - this.owner = options && options.owner ? options.owner : null; - this.cache = _emberUtils.dictionary(options && options.cache ? options.cache : null); - this.factoryCache = _emberUtils.dictionary(options && options.factoryCache ? options.factoryCache : null); - this.validationCache = _emberUtils.dictionary(options && options.validationCache ? options.validationCache : null); - this._fakeContainerToInject = buildFakeContainerWithDeprecations(this); - this[CONTAINER_OVERRIDE] = undefined; - this.isDestroyed = false; - } + LinkedList.fromSlice = function fromSlice(slice) { + var list = new LinkedList(); + slice.forEachNode(function (n) { + return list.append(n.clone()); + }); + return list; + }; - Container.prototype = { - /** - @private - @property owner - @type Object - */ - owner: null, + LinkedList.prototype.head = function head() { + return this._head; + }; - /** - @private - @property registry - @type Registry - @since 1.11.0 - */ - registry: null, + LinkedList.prototype.tail = function tail() { + return this._tail; + }; - /** - @private - @property cache - @type InheritingDict - */ - cache: null, + LinkedList.prototype.clear = function clear() { + this._head = this._tail = null; + }; - /** - @private - @property factoryCache - @type InheritingDict - */ - factoryCache: null, + LinkedList.prototype.isEmpty = function isEmpty() { + return this._head === null; + }; - /** - @private - @property validationCache - @type InheritingDict - */ - validationCache: null, + LinkedList.prototype.toArray = function toArray() { + var out = []; + this.forEachNode(function (n) { + return out.push(n); + }); + return out; + }; - /** - Given a fullName return a corresponding instance. - The default behaviour is for lookup to return a singleton instance. - The singleton is scoped to the container, allowing multiple containers - to all have their own locally scoped singletons. - ```javascript - let registry = new Registry(); - let container = registry.container(); - registry.register('api:twitter', Twitter); - let twitter = container.lookup('api:twitter'); - twitter instanceof Twitter; // => true - // by default the container will return singletons - let twitter2 = container.lookup('api:twitter'); - twitter2 instanceof Twitter; // => true - twitter === twitter2; //=> true - ``` - If singletons are not wanted, an optional flag can be provided at lookup. - ```javascript - let registry = new Registry(); - let container = registry.container(); - registry.register('api:twitter', Twitter); - let twitter = container.lookup('api:twitter', { singleton: false }); - let twitter2 = container.lookup('api:twitter', { singleton: false }); - twitter === twitter2; //=> false - ``` - @private - @method lookup - @param {String} fullName - @param {Object} [options] - @param {String} [options.source] The fullname of the request source (used for local lookup) - @return {any} - */ - lookup: function (fullName, options) { - return lookup(this, this.registry.normalize(fullName), options); - }, + LinkedList.prototype.splice = function splice(start, end, reference) { + var before = undefined; + if (reference === null) { + before = this._tail; + this._tail = end; + } else { + before = reference.prev; + end.next = reference; + reference.prev = end; + } + if (before) { + before.next = start; + start.prev = before; + } + }; - /** - Given a fullName, return the corresponding factory. - @private - @method lookupFactory - @param {String} fullName - @param {Object} [options] - @param {String} [options.source] The fullname of the request source (used for local lookup) - @return {any} - */ - lookupFactory: function (fullName, options) { - return factoryFor(this, this.registry.normalize(fullName), options); - }, + LinkedList.prototype.nextNode = function nextNode(node) { + return node.next; + }; - /** - A depth first traversal, destroying the container, its descendant containers and all - their managed objects. - @private - @method destroy - */ - destroy: function () { - eachDestroyable(this, function (item) { - if (item.destroy) { - item.destroy(); - } - }); + LinkedList.prototype.prevNode = function prevNode(node) { + return node.prev; + }; - this.isDestroyed = true; - }, + LinkedList.prototype.forEachNode = function forEachNode(callback) { + var node = this._head; + while (node !== null) { + callback(node); + node = node.next; + } + }; - /** - Clear either the entire cache or just the cache for a particular key. - @private - @method reset - @param {String} fullName optional key to reset; if missing, resets everything - */ - reset: function (fullName) { - if (arguments.length > 0) { - resetMember(this, this.registry.normalize(fullName)); - } else { - resetCache(this); - } - }, + LinkedList.prototype.contains = function contains(needle) { + var node = this._head; + while (node !== null) { + if (node === needle) return true; + node = node.next; + } + return false; + }; - /** - Returns an object that can be used to provide an owner to a - manually created instance. - @private - @method ownerInjection - @returns { Object } - */ - ownerInjection: function () { - var _ref; + LinkedList.prototype.insertBefore = function insertBefore(node) { + var reference = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; - return _ref = {}, _ref[_emberUtils.OWNER] = this.owner, _ref; - } - }; + if (reference === null) return this.append(node); + if (reference.prev) reference.prev.next = node;else this._head = node; + node.prev = reference.prev; + node.next = reference; + reference.prev = node; + return node; + }; - function isSingleton(container, fullName) { - return container.registry.getOption(fullName, 'singleton') !== false; - } + LinkedList.prototype.append = function append(node) { + var tail = this._tail; + if (tail) { + tail.next = node; + node.prev = tail; + node.next = null; + } else { + this._head = node; + } + return this._tail = node; + }; - function lookup(container, fullName) { - var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + LinkedList.prototype.pop = function pop() { + if (this._tail) return this.remove(this._tail); + return null; + }; - if (options.source) { - fullName = container.registry.expandLocalLookup(fullName, options); + LinkedList.prototype.prepend = function prepend(node) { + if (this._head) return this.insertBefore(node, this._head); + return this._head = this._tail = node; + }; - // if expandLocalLookup returns falsey, we do not support local lookup - if (!fullName) { - return; - } - } + LinkedList.prototype.remove = function remove(node) { + if (node.prev) node.prev.next = node.next;else this._head = node.next; + if (node.next) node.next.prev = node.prev;else this._tail = node.prev; + return node; + }; - if (container.cache[fullName] !== undefined && options.singleton !== false) { - return container.cache[fullName]; - } + return LinkedList; + })(); - var value = instantiate(container, fullName); + var ListSlice = (function () { + function ListSlice(head, tail) { + this._head = head; + this._tail = tail; + } - if (value === undefined) { - return; - } + ListSlice.toList = function toList(slice) { + var list = new LinkedList(); + slice.forEachNode(function (n) { + return list.append(n.clone()); + }); + return list; + }; - if (isSingleton(container, fullName) && options.singleton !== false) { - container.cache[fullName] = value; - } + ListSlice.prototype.forEachNode = function forEachNode(callback) { + var node = this._head; + while (node !== null) { + callback(node); + node = this.nextNode(node); + } + }; - return value; - } + ListSlice.prototype.contains = function contains(needle) { + var node = this._head; + while (node !== null) { + if (node === needle) return true; + node = node.next; + } + return false; + }; - function markInjectionsAsDynamic(injections) { - injections._dynamic = true; - } + ListSlice.prototype.head = function head() { + return this._head; + }; - function areInjectionsDynamic(injections) { - return !!injections._dynamic; - } + ListSlice.prototype.tail = function tail() { + return this._tail; + }; - function buildInjections() /* container, ...injections */{ - var hash = {}; + ListSlice.prototype.toArray = function toArray() { + var out = []; + this.forEachNode(function (n) { + return out.push(n); + }); + return out; + }; - if (arguments.length > 1) { - var container = arguments[0]; - var injections = []; - var injection = undefined; + ListSlice.prototype.nextNode = function nextNode(node) { + if (node === this._tail) return null; + return node.next; + }; - for (var i = 1; i < arguments.length; i++) { - if (arguments[i]) { - injections = injections.concat(arguments[i]); - } - } + ListSlice.prototype.prevNode = function prevNode(node) { + if (node === this._head) return null; + return node.prev; + }; - container.registry.validateInjections(injections); + ListSlice.prototype.isEmpty = function isEmpty() { + return false; + }; - for (var i = 0; i < injections.length; i++) { - injection = injections[i]; - hash[injection.property] = lookup(container, injection.fullName); - if (!isSingleton(container, injection.fullName)) { - markInjectionsAsDynamic(hash); - } - } - } + return ListSlice; + })(); - return hash; - } + var EMPTY_SLICE = new ListSlice(null, null); - function factoryFor(container, fullName) { - var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + var HAS_TYPED_ARRAYS = typeof Uint32Array !== 'undefined'; + var A = undefined; + if (HAS_TYPED_ARRAYS) { + A = Uint32Array; + } else { + A = Array; + } + var A$1 = A; - var registry = container.registry; + var HAS_NATIVE_WEAKMAP = (function () { + // detect if `WeakMap` is even present + var hasWeakMap = typeof WeakMap === 'function'; + if (!hasWeakMap) { + return false; + } + var instance = new WeakMap(); + // use `Object`'s `.toString` directly to prevent us from detecting + // polyfills as native weakmaps + return Object.prototype.toString.call(instance) === '[object WeakMap]'; + })(); - if (options.source) { - fullName = registry.expandLocalLookup(fullName, options); + exports.getAttrNamespace = getAttrNamespace; + exports.assert = debugAssert; + exports.LOGGER = logger; + exports.Logger = Logger; + exports.LogLevel = LogLevel; + exports.assign = assign; + exports.fillNulls = fillNulls; + exports.ensureGuid = ensureGuid; + exports.initializeGuid = initializeGuid; + exports.Stack = Stack; + exports.DictSet = DictSet; + exports.dict = dict; + exports.EMPTY_SLICE = EMPTY_SLICE; + exports.LinkedList = LinkedList; + exports.ListNode = ListNode; + exports.ListSlice = ListSlice; + exports.A = A$1; + exports.HAS_NATIVE_WEAKMAP = HAS_NATIVE_WEAKMAP; + exports.unwrap = unwrap; + exports.expect = expect; + exports.unreachable = unreachable; +}); +enifed('@glimmer/wire-format', ['exports'], function (exports) { + 'use strict'; - // if expandLocalLookup returns falsey, we do not support local lookup - if (!fullName) { - return; - } + function is(variant) { + return function (value) { + return value[0] === variant; + }; } + var Expressions; + (function (Expressions) { + Expressions.isUnknown = is('unknown'); + Expressions.isArg = is('arg'); + Expressions.isGet = is('get'); + Expressions.isConcat = is('concat'); + Expressions.isHelper = is('helper'); + Expressions.isHasBlock = is('has-block'); + Expressions.isHasBlockParams = is('has-block-params'); + Expressions.isUndefined = is('undefined'); + function isPrimitiveValue(value) { + if (value === null) { + return true; + } + return typeof value !== 'object'; + } + Expressions.isPrimitiveValue = isPrimitiveValue; + })(Expressions || (exports.Expressions = Expressions = {})); + var Statements; + (function (Statements) { + Statements.isText = is('text'); + Statements.isAppend = is('append'); + Statements.isComment = is('comment'); + Statements.isModifier = is('modifier'); + Statements.isBlock = is('block'); + Statements.isComponent = is('component'); + Statements.isOpenElement = is('open-element'); + Statements.isFlushElement = is('flush-element'); + Statements.isCloseElement = is('close-element'); + Statements.isStaticAttr = is('static-attr'); + Statements.isDynamicAttr = is('dynamic-attr'); + Statements.isYield = is('yield'); + Statements.isPartial = is('partial'); + Statements.isDynamicArg = is('dynamic-arg'); + Statements.isStaticArg = is('static-arg'); + Statements.isTrustingAttr = is('trusting-attr'); + Statements.isDebugger = is('debugger'); + function isAttribute(val) { + return val[0] === 'static-attr' || val[0] === 'dynamic-attr'; + } + Statements.isAttribute = isAttribute; + function isArgument(val) { + return val[0] === 'static-arg' || val[0] === 'dynamic-arg'; + } + Statements.isArgument = isArgument; + function isParameter(val) { + return isAttribute(val) || isArgument(val); + } + Statements.isParameter = isParameter; + function getParameterName(s) { + return s[1]; + } + Statements.getParameterName = getParameterName; + })(Statements || (exports.Statements = Statements = {})); - var cache = container.factoryCache; - if (cache[fullName]) { - return cache[fullName]; - } - var factory = registry.resolve(fullName); - if (factory === undefined) { - return; - } + exports.is = is; + exports.Expressions = Expressions; + exports.Statements = Statements; +}); +enifed('backburner', ['exports'], function (exports) { 'use strict'; - var type = fullName.split(':')[0]; - if (!factory || typeof factory.extend !== 'function' || !_emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS && type === 'model') { - if (factory && typeof factory._onLookup === 'function') { - factory._onLookup(fullName); - } +var NUMBER = /\d+/; - // TODO: think about a 'safe' merge style extension - // for now just fallback to create time injection - cache[fullName] = factory; - return factory; - } else { - var injections = injectionsFor(container, fullName); - var factoryInjections = factoryInjectionsFor(container, fullName); - var cacheable = !areInjectionsDynamic(injections) && !areInjectionsDynamic(factoryInjections); +function each(collection, callback) { + for (var i = 0; i < collection.length; i++) { + callback(collection[i]); + } +} - factoryInjections._toString = registry.makeToString(factory, fullName); +function isString(suspect) { + return typeof suspect === 'string'; +} - var injectedFactory = factory.extend(injections); +function isFunction(suspect) { + return typeof suspect === 'function'; +} - // TODO - remove all `container` injections when Ember reaches v3.0.0 - injectDeprecatedContainer(injectedFactory.prototype, container); - injectedFactory.reopenClass(factoryInjections); +function isNumber(suspect) { + return typeof suspect === 'number'; +} - if (factory && typeof factory._onLookup === 'function') { - factory._onLookup(fullName); - } +function isCoercableNumber(number) { + return isNumber(number) || NUMBER.test(number); +} - if (cacheable) { - cache[fullName] = injectedFactory; - } +function binarySearch(time, timers) { + var start = 0; + var end = timers.length - 2; + var middle, l; - return injectedFactory; - } - } + while (start < end) { + // since timers is an array of pairs 'l' will always + // be an integer + l = (end - start) / 2; - function injectionsFor(container, fullName) { - var registry = container.registry; - var splitName = fullName.split(':'); - var type = splitName[0]; + // compensate for the index in case even number + // of pairs inside timers + middle = start + l - (l % 2); - var injections = buildInjections(container, registry.getTypeInjections(type), registry.getInjections(fullName)); - injections._debugContainerKey = fullName; + if (time >= timers[middle]) { + start = middle + 2; + } else { + end = middle; + } + } - _emberUtils.setOwner(injections, container.owner); + return (time >= timers[start]) ? start + 2 : start; +} - return injections; - } +function Queue(name, options, globalOptions) { + this.name = name; + this.globalOptions = globalOptions || {}; + this.options = options; + this._queue = []; + this.targetQueues = {}; + this._queueBeingFlushed = undefined; +} - function factoryInjectionsFor(container, fullName) { - var registry = container.registry; - var splitName = fullName.split(':'); - var type = splitName[0]; +Queue.prototype = { + push: function(target, method, args, stack) { + var queue = this._queue; + queue.push(target, method, args, stack); - var factoryInjections = buildInjections(container, registry.getFactoryTypeInjections(type), registry.getFactoryInjections(fullName)); - factoryInjections._debugContainerKey = fullName; + return { + queue: this, + target: target, + method: method + }; + }, - return factoryInjections; - } + pushUniqueWithoutGuid: function(target, method, args, stack) { + var queue = this._queue; - function instantiate(container, fullName) { - var factory = factoryFor(container, fullName); - var lazyInjections = undefined, - validationCache = undefined; + for (var i = 0, l = queue.length; i < l; i += 4) { + var currentTarget = queue[i]; + var currentMethod = queue[i+1]; - if (container.registry.getOption(fullName, 'instantiate') === false) { - return factory; + if (currentTarget === target && currentMethod === method) { + queue[i+2] = args; // replace args + queue[i+3] = stack; // replace stack + return; + } } - if (factory) { - if (typeof factory.create !== 'function') { - throw new Error('Failed to create an instance of \'' + fullName + '\'. Most likely an improperly defined class or' + ' an invalid module export.'); + queue.push(target, method, args, stack); + }, + + targetQueue: function(targetQueue, target, method, args, stack) { + var queue = this._queue; + + for (var i = 0, l = targetQueue.length; i < l; i += 2) { + var currentMethod = targetQueue[i]; + var currentIndex = targetQueue[i + 1]; + + if (currentMethod === method) { + queue[currentIndex + 2] = args; // replace args + queue[currentIndex + 3] = stack; // replace stack + return; } + } - validationCache = container.validationCache; + targetQueue.push( + method, + queue.push(target, method, args, stack) - 4 + ); + }, - validationCache[fullName] = true; + pushUniqueWithGuid: function(guid, target, method, args, stack) { + var hasLocalQueue = this.targetQueues[guid]; - var obj = undefined; + if (hasLocalQueue) { + this.targetQueue(hasLocalQueue, target, method, args, stack); + } else { + this.targetQueues[guid] = [ + method, + this._queue.push(target, method, args, stack) - 4 + ]; + } - if (typeof factory.extend === 'function') { - // assume the factory was extendable and is already injected - obj = factory.create(); - } else { - // assume the factory was extendable - // to create time injections - // TODO: support new'ing for instantiation and merge injections for pure JS Functions - var injections = injectionsFor(container, fullName); + return { + queue: this, + target: target, + method: method + }; + }, - // Ensure that a container is available to an object during instantiation. - // TODO - remove when Ember reaches v3.0.0 - // This "fake" container will be replaced after instantiation with a - // property that raises deprecations every time it is accessed. - injections.container = container._fakeContainerToInject; - obj = factory.create(injections); + pushUnique: function(target, method, args, stack) { + var KEY = this.globalOptions.GUID_KEY; - // TODO - remove when Ember reaches v3.0.0 - if (!Object.isFrozen(obj) && 'container' in obj) { - injectDeprecatedContainer(obj, container); - } + if (target && KEY) { + var guid = target[KEY]; + if (guid) { + return this.pushUniqueWithGuid(guid, target, method, args, stack); } - - return obj; } - } - // TODO - remove when Ember reaches v3.0.0 - function injectDeprecatedContainer(object, container) { - Object.defineProperty(object, 'container', { - configurable: true, - enumerable: false, - get: function () { - return this[CONTAINER_OVERRIDE] || container; - }, + this.pushUniqueWithoutGuid(target, method, args, stack); - set: function (value) { + return { + queue: this, + target: target, + method: method + }; + }, - this[CONTAINER_OVERRIDE] = value; + invoke: function(target, method, args /*, onError, errorRecordedForStack */) { + if (args && args.length > 0) { + method.apply(target, args); + } else { + method.call(target); + } + }, - return value; + invokeWithOnError: function(target, method, args, onError, errorRecordedForStack) { + try { + if (args && args.length > 0) { + method.apply(target, args); + } else { + method.call(target); } - }); - } - - function eachDestroyable(container, callback) { - var cache = container.cache; - var keys = Object.keys(cache); + } catch(error) { + onError(error, errorRecordedForStack); + } + }, - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var value = cache[key]; + flush: function(sync) { + var queue = this._queue; + var length = queue.length; - if (container.registry.getOption(key, 'instantiate') !== false) { - callback(value); - } + if (length === 0) { + return; } - } - function resetCache(container) { - eachDestroyable(container, function (value) { - if (value.destroy) { - value.destroy(); - } - }); + var globalOptions = this.globalOptions; + var options = this.options; + var before = options && options.before; + var after = options && options.after; + var onError = globalOptions.onError || (globalOptions.onErrorTarget && + globalOptions.onErrorTarget[globalOptions.onErrorMethod]); + var target, method, args, errorRecordedForStack; + var invoke = onError ? this.invokeWithOnError : this.invoke; - container.cache.dict = _emberUtils.dictionary(null); - } + this.targetQueues = Object.create(null); + var queueItems = this._queueBeingFlushed = this._queue.slice(); + this._queue = []; - function resetMember(container, fullName) { - var member = container.cache[fullName]; + if (before) { + before(); + } - delete container.factoryCache[fullName]; + for (var i = 0; i < length; i += 4) { + target = queueItems[i]; + method = queueItems[i+1]; + args = queueItems[i+2]; + errorRecordedForStack = queueItems[i+3]; // Debugging assistance - if (member) { - delete container.cache[fullName]; + if (isString(method)) { + method = target[method]; + } - if (member.destroy) { - member.destroy(); + // method could have been nullified / canceled during flush + if (method) { + // + // ** Attention intrepid developer ** + // + // To find out the stack of this task when it was scheduled onto + // the run loop, add the following to your app.js: + // + // Ember.run.backburner.DEBUG = true; // NOTE: This slows your app, don't leave it on in production. + // + // Once that is in place, when you are at a breakpoint and navigate + // here in the stack explorer, you can look at `errorRecordedForStack.stack`, + // which will be the captured stack when this job was scheduled. + // + // One possible long-term solution is the following Chrome issue: + // https://bugs.chromium.org/p/chromium/issues/detail?id=332624 + // + invoke(target, method, args, onError, errorRecordedForStack); } } - } - - function buildFakeContainerWithDeprecations(container) { - var fakeContainer = {}; - var propertyMappings = { - lookup: 'lookup', - lookupFactory: '_lookupFactory' - }; - for (var containerProperty in propertyMappings) { - fakeContainer[containerProperty] = buildFakeContainerFunction(container, containerProperty, propertyMappings[containerProperty]); + if (after) { + after(); } - return fakeContainer; - } + this._queueBeingFlushed = undefined; - function buildFakeContainerFunction(container, containerProperty, ownerProperty) { - return function () { - return container[containerProperty].apply(container, arguments); - }; - } -}); + if (sync !== false && + this._queue.length > 0) { + // check if new items have been added + this.flush(true); + } + }, -// Ensure that all lazy injections are valid at instantiation time -enifed('container/index', ['exports', 'container/registry', 'container/container'], function (exports, _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 - */ + cancel: function(actionToCancel) { + var queue = this._queue, currentTarget, currentMethod, i, l; + var target = actionToCancel.target; + var method = actionToCancel.method; + var GUID_KEY = this.globalOptions.GUID_KEY; - 'use strict'; + if (GUID_KEY && this.targetQueues && target) { + var targetQueue = this.targetQueues[target[GUID_KEY]]; - exports.Registry = _containerRegistry.default; - exports.privatize = _containerRegistry.privatize; - exports.Container = _containerContainer.default; - exports.buildFakeContainerWithDeprecations = _containerContainer.buildFakeContainerWithDeprecations; -}); -enifed('container/registry', ['exports', 'ember-utils', 'ember-metal', 'container/container'], function (exports, _emberUtils, _emberMetal, _containerContainer) { - 'use strict'; + if (targetQueue) { + for (i = 0, l = targetQueue.length; i < l; i++) { + if (targetQueue[i] === method) { + targetQueue.splice(i, 1); + } + } + } + } - exports.default = Registry; - exports.privatize = privatize; + for (i = 0, l = queue.length; i < l; i += 4) { + currentTarget = queue[i]; + currentMethod = queue[i+1]; - var VALID_FULL_NAME_REGEXP = /^[^:]+:[^:]+$/; + if (currentTarget === target && + currentMethod === method) { + queue.splice(i, 4); + return true; + } + } - /** - A registry used to store factory and option information keyed - by type. - - A `Registry` stores the factory and option information needed by a - `Container` to instantiate and cache objects. - - The API for `Registry` is still in flux and should not be considered stable. - - @private - @class Registry - @since 1.11.0 - */ + // if not found in current queue + // could be in the queue that is being flushed + queue = this._queueBeingFlushed; - function Registry(options) { - this.fallback = options && options.fallback ? options.fallback : null; + if (!queue) { + return; + } - if (options && options.resolver) { - this.resolver = options.resolver; + for (i = 0, l = queue.length; i < l; i += 4) { + currentTarget = queue[i]; + currentMethod = queue[i+1]; - if (typeof this.resolver === 'function') { - deprecateResolverFunction(this); + if (currentTarget === target && + currentMethod === method) { + // don't mess with array during flush + // just nullify the method + queue[i+1] = null; + return true; } } + } +}; - this.registrations = _emberUtils.dictionary(options && options.registrations ? options.registrations : null); +function DeferredActionQueues(queueNames, options) { + var queues = this.queues = {}; + this.queueNames = queueNames = queueNames || []; - this._typeInjections = _emberUtils.dictionary(null); - this._injections = _emberUtils.dictionary(null); - this._factoryTypeInjections = _emberUtils.dictionary(null); - this._factoryInjections = _emberUtils.dictionary(null); + this.options = options; - this._localLookupCache = new _emberUtils.EmptyObject(); - this._normalizeCache = _emberUtils.dictionary(null); - this._resolveCache = _emberUtils.dictionary(null); - this._failCache = _emberUtils.dictionary(null); + each(queueNames, function(queueName) { + queues[queueName] = new Queue(queueName, options[queueName], options); + }); +} - this._options = _emberUtils.dictionary(null); - this._typeOptions = _emberUtils.dictionary(null); - } +function noSuchQueue(name) { + throw new Error('You attempted to schedule an action in a queue (' + name + ') that doesn\'t exist'); +} - Registry.prototype = { - /** - A backup registry for resolving registrations when no matches can be found. - @private - @property fallback - @type Registry - */ - fallback: null, +function noSuchMethod(name) { + throw new Error('You attempted to schedule an action in a queue (' + name + ') for a method that doesn\'t exist'); +} - /** - An object that has a `resolve` method that resolves a name. - @private - @property resolver - @type Resolver - */ - resolver: null, +DeferredActionQueues.prototype = { + schedule: function(name, target, method, args, onceFlag, stack) { + var queues = this.queues; + var queue = queues[name]; - /** - @private - @property registrations - @type InheritingDict - */ - registrations: null, + if (!queue) { + noSuchQueue(name); + } - /** - @private - @property _typeInjections - @type InheritingDict - */ - _typeInjections: null, + if (!method) { + noSuchMethod(name); + } - /** - @private - @property _injections - @type InheritingDict - */ - _injections: null, + if (onceFlag) { + return queue.pushUnique(target, method, args, stack); + } else { + return queue.push(target, method, args, stack); + } + }, - /** - @private - @property _factoryTypeInjections - @type InheritingDict - */ - _factoryTypeInjections: null, + flush: function() { + var queues = this.queues; + var queueNames = this.queueNames; + var queueName, queue; + var queueNameIndex = 0; + var numberOfQueues = queueNames.length; - /** - @private - @property _factoryInjections - @type InheritingDict - */ - _factoryInjections: null, + while (queueNameIndex < numberOfQueues) { + queueName = queueNames[queueNameIndex]; + queue = queues[queueName]; - /** - @private - @property _normalizeCache - @type InheritingDict - */ - _normalizeCache: null, + var numberOfQueueItems = queue._queue.length; - /** - @private - @property _resolveCache - @type InheritingDict - */ - _resolveCache: null, + if (numberOfQueueItems === 0) { + queueNameIndex++; + } else { + queue.flush(false /* async */); + queueNameIndex = 0; + } + } + } +}; - /** - @private - @property _options - @type InheritingDict - */ - _options: null, +function Backburner(queueNames, options) { + this.queueNames = queueNames; + this.options = options || {}; + if (!this.options.defaultQueue) { + this.options.defaultQueue = queueNames[0]; + } + this.instanceStack = []; + this._debouncees = []; + this._throttlers = []; + this._eventCallbacks = { + end: [], + begin: [] + }; - /** - @private - @property _typeOptions - @type InheritingDict - */ - _typeOptions: null, + var _this = this; + this._boundClearItems = function() { + clearItems(); + }; - /** - Creates a container based on this registry. - @private - @method container - @param {Object} options - @return {Container} created container - */ - container: function (options) { - return new _containerContainer.default(this, options); + this._timerTimeoutId = undefined; + this._timers = []; + + this._platform = this.options._platform || { + setTimeout: function (fn, ms) { + return setTimeout(fn, ms); }, + clearTimeout: function (id) { + clearTimeout(id); + } + }; - /** - Registers a factory for later injection. - Example: - ```javascript - let registry = new Registry(); - registry.register('model:user', Person, {singleton: false }); - registry.register('fruit:favorite', Orange); - registry.register('communication:main', Email, {singleton: false}); - ``` - @private - @method register - @param {String} fullName - @param {Function} factory - @param {Object} options - */ - register: function (fullName, factory) { - var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; - - if (factory === undefined) { - throw new TypeError('Attempting to register an unknown factory: \'' + fullName + '\''); - } - - var normalizedName = this.normalize(fullName); - - if (this._resolveCache[normalizedName]) { - throw new Error('Cannot re-register: \'' + fullName + '\', as it has already been resolved.'); - } + this._boundRunExpiredTimers = function () { + _this._runExpiredTimers(); + }; +} - delete this._failCache[normalizedName]; - this.registrations[normalizedName] = factory; - this._options[normalizedName] = options; - }, +Backburner.prototype = { + begin: function() { + var options = this.options; + var onBegin = options && options.onBegin; + var previousInstance = this.currentInstance; - /** - Unregister a fullName - ```javascript - let registry = new Registry(); - registry.register('model:user', User); - registry.resolve('model:user').create() instanceof User //=> true - registry.unregister('model:user') - registry.resolve('model:user') === undefined //=> true - ``` - @private - @method unregister - @param {String} fullName - */ - unregister: function (fullName) { + if (previousInstance) { + this.instanceStack.push(previousInstance); + } - var normalizedName = this.normalize(fullName); + this.currentInstance = new DeferredActionQueues(this.queueNames, options); + this._trigger('begin', this.currentInstance, previousInstance); + if (onBegin) { + onBegin(this.currentInstance, previousInstance); + } + }, - this._localLookupCache = new _emberUtils.EmptyObject(); + end: function() { + var options = this.options; + var onEnd = options && options.onEnd; + var currentInstance = this.currentInstance; + var nextInstance = null; - delete this.registrations[normalizedName]; - delete this._resolveCache[normalizedName]; - delete this._failCache[normalizedName]; - delete this._options[normalizedName]; - }, + // Prevent double-finally bug in Safari 6.0.2 and iOS 6 + // This bug appears to be resolved in Safari 6.0.5 and iOS 7 + var finallyAlreadyCalled = false; + try { + currentInstance.flush(); + } finally { + if (!finallyAlreadyCalled) { + finallyAlreadyCalled = true; - /** - Given a fullName return the corresponding factory. - By default `resolve` will retrieve the factory from - the registry. - ```javascript - let registry = new Registry(); - registry.register('api:twitter', Twitter); - registry.resolve('api:twitter') // => Twitter - ``` - Optionally the registry can be provided with a custom resolver. - If provided, `resolve` will first provide the custom resolver - the opportunity to resolve the fullName, otherwise it will fallback - to the registry. - ```javascript - let registry = new Registry(); - registry.resolver = function(fullName) { - // lookup via the module system of choice - }; - // the twitter factory is added to the module system - registry.resolve('api:twitter') // => Twitter - ``` - @private - @method resolve - @param {String} fullName - @param {Object} [options] - @param {String} [options.source] the fullname of the request source (used for local lookups) - @return {Function} fullName's factory - */ - resolve: function (fullName, options) { - var factory = resolve(this, this.normalize(fullName), options); - if (factory === undefined && this.fallback) { - var _fallback; + this.currentInstance = null; - factory = (_fallback = this.fallback).resolve.apply(_fallback, arguments); + if (this.instanceStack.length) { + nextInstance = this.instanceStack.pop(); + this.currentInstance = nextInstance; + } + this._trigger('end', currentInstance, nextInstance); + if (onEnd) { + onEnd(currentInstance, nextInstance); + } } - return factory; - }, + } + }, - /** - A hook that can be used to describe how the resolver will - attempt to find the factory. - For example, the default Ember `.describe` returns the full - class name (including namespace) where Ember's resolver expects - to find the `fullName`. - @private - @method describe - @param {String} fullName - @return {string} described fullName - */ - describe: function (fullName) { - if (this.resolver && this.resolver.lookupDescription) { - return this.resolver.lookupDescription(fullName); - } else if (this.fallback) { - return this.fallback.describe(fullName); - } else { - return fullName; - } - }, + /** + 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. - /** - A hook to enable custom fullName normalization behaviour - @private - @method normalizeFullName - @param {String} fullName - @return {string} normalized fullName - */ - normalizeFullName: function (fullName) { - if (this.resolver && this.resolver.normalize) { - return this.resolver.normalize(fullName); - } else if (this.fallback) { - return this.fallback.normalizeFullName(fullName); - } else { - return fullName; + @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); } - }, + } + }, - /** - Normalize a fullName based on the application's conventions - @private - @method normalize - @param {String} fullName - @return {string} normalized fullName - */ - normalize: function (fullName) { - return this._normalizeCache[fullName] || (this._normalizeCache[fullName] = this.normalizeFullName(fullName)); - }, + 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'); + } + }, - /** - @method makeToString - @private - @param {any} factory - @param {string} fullName - @return {function} toString function - */ - makeToString: function (factory, fullName) { - if (this.resolver && this.resolver.makeToString) { - return this.resolver.makeToString(factory, fullName); - } else if (this.fallback) { - return this.fallback.makeToString(factory, fullName); - } else { - return factory.toString(); + 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--; + } + } } - }, - - /** - Given a fullName check if the container is aware of its factory - or singleton instance. - @private - @method has - @param {String} fullName - @param {Object} [options] - @param {String} [options.source] the fullname of the request source (used for local lookups) - @return {Boolean} - */ - has: function (fullName, options) { - if (!this.isValidFullName(fullName)) { - return false; + 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'); + } + }, - var source = options && options.source && this.normalize(options.source); + run: function(/* target, method, args */) { + var length = arguments.length; + var method, target, args; - return has(this, this.normalize(fullName), source); - }, + if (length === 1) { + method = arguments[0]; + target = null; + } else { + target = arguments[0]; + method = arguments[1]; + } - /** - Allow registering options for all factories of a type. - ```javascript - let registry = new Registry(); - let container = registry.container(); - // if all of type `connection` must not be singletons - registry.optionsForType('connection', { singleton: false }); - registry.register('connection:twitter', TwitterConnection); - registry.register('connection:facebook', FacebookConnection); - let twitter = container.lookup('connection:twitter'); - let twitter2 = container.lookup('connection:twitter'); - twitter === twitter2; // => false - let facebook = container.lookup('connection:facebook'); - let facebook2 = container.lookup('connection:facebook'); - facebook === facebook2; // => false - ``` - @private - @method optionsForType - @param {String} type - @param {Object} options - */ - optionsForType: function (type, options) { - this._typeOptions[type] = options; - }, + if (isString(method)) { + method = target[method]; + } - getOptionsForType: function (type) { - var optionsForType = this._typeOptions[type]; - if (optionsForType === undefined && this.fallback) { - optionsForType = this.fallback.getOptionsForType(type); + if (length > 2) { + args = new Array(length - 2); + for (var i = 0, l = length - 2; i < l; i++) { + args[i] = arguments[i + 2]; } - return optionsForType; - }, + } else { + args = []; + } - /** - @private - @method options - @param {String} fullName - @param {Object} options - */ - options: function (fullName) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + var onError = getOnError(this.options); - var normalizedName = this.normalize(fullName); - this._options[normalizedName] = options; - }, + this.begin(); - getOptions: function (fullName) { - var normalizedName = this.normalize(fullName); - var options = this._options[normalizedName]; + // guard against Safari 6's double-finally bug + var didFinally = false; - if (options === undefined && this.fallback) { - options = this.fallback.getOptions(fullName); + if (onError) { + try { + return method.apply(target, args); + } catch(error) { + onError(error); + } finally { + if (!didFinally) { + didFinally = true; + this.end(); + } } - return options; - }, + } else { + try { + return method.apply(target, args); + } finally { + if (!didFinally) { + didFinally = true; + this.end(); + } + } + } + }, - getOption: function (fullName, optionName) { - var options = this._options[fullName]; + /* + Join the passed method with an existing queue and execute immediately, + if there isn't one use `Backburner#run`. - if (options && options[optionName] !== undefined) { - return options[optionName]; - } + The join method is like the run method except that it will schedule into + an existing queue if one already exists. In either case, the join method will + immediately execute the passed in function and return its result. - var type = fullName.split(':')[0]; - options = this._typeOptions[type]; + @method join + @param {Object} target + @param {Function} method The method to be executed + @param {any} args The method arguments + @return method result + */ + join: function(/* target, method, args */) { + if (!this.currentInstance) { + return this.run.apply(this, arguments); + } - if (options && options[optionName] !== undefined) { - return options[optionName]; - } else if (this.fallback) { - return this.fallback.getOption(fullName, optionName); - } - }, + var length = arguments.length; + var method, target; - /** - 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. - For example, provided each object of type `controller` needed a `router`. - one would do the following: - ```javascript - let registry = new Registry(); - let container = registry.container(); - registry.register('router:main', Router); - registry.register('controller:user', UserController); - registry.register('controller:post', PostController); - registry.typeInjection('controller', 'router', 'router:main'); - let user = container.lookup('controller:user'); - let post = container.lookup('controller:post'); - user.router instanceof Router; //=> true - post.router instanceof Router; //=> true - // both controllers share the same router - user.router === post.router; //=> true - ``` - @private - @method typeInjection - @param {String} type - @param {String} property - @param {String} fullName - */ - typeInjection: function (type, property, fullName) { + if (length === 1) { + method = arguments[0]; + target = null; + } else { + target = arguments[0]; + method = arguments[1]; + } - var fullNameType = fullName.split(':')[0]; - if (fullNameType === type) { - throw new Error('Cannot inject a \'' + fullName + '\' on other ' + type + '(s).'); + if (isString(method)) { + method = target[method]; + } + + if (length === 1) { + return method(); + } else if (length === 2) { + return method.call(target); + } else { + var args = new Array(length - 2); + for (var i = 0, l = length - 2; i < l; i++) { + args[i] = arguments[i + 2]; } + return method.apply(target, args); + } + }, - var injections = this._typeInjections[type] || (this._typeInjections[type] = []); - injections.push({ - property: property, - fullName: fullName - }); - }, + /* + Defer the passed function to run inside the specified queue. - /** - Defines injection rules. - These rules are used to inject dependencies onto objects when they - are instantiated. - Two forms of injections are possible: - * Injecting one fullName on another fullName - * Injecting one fullName on a type - Example: - ```javascript - let registry = new Registry(); - let container = registry.container(); - registry.register('source:main', Source); - registry.register('model:user', User); - registry.register('model:post', Post); - // injecting one fullName on another fullName - // eg. each user model gets a post model - registry.injection('model:user', 'post', 'model:post'); - // injecting one fullName on another type - registry.injection('model', 'source', 'source:main'); - let user = container.lookup('model:user'); - let post = container.lookup('model:post'); - user.source instanceof Source; //=> true - post.source instanceof Source; //=> true - user.post instanceof Post; //=> true - // and both models share the same source - user.source === post.source; //=> true - ``` - @private - @method injection - @param {String} factoryName - @param {String} property - @param {String} injectionName - */ - injection: function (fullName, property, injectionName) { - this.validateFullName(injectionName); - var normalizedInjectionName = this.normalize(injectionName); + @method defer + @param {String} queueName + @param {Object} target + @param {Function|String} method The method or method name to be executed + @param {any} args The method arguments + @return method result + */ + defer: function(queueName /* , target, method, args */) { + var length = arguments.length; + var method, target, args; - if (fullName.indexOf(':') === -1) { - return this.typeInjection(fullName, property, normalizedInjectionName); - } + if (length === 2) { + method = arguments[1]; + target = null; + } else { + target = arguments[1]; + method = arguments[2]; + } - var normalizedName = this.normalize(fullName); + if (isString(method)) { + method = target[method]; + } - var injections = this._injections[normalizedName] || (this._injections[normalizedName] = []); + var stack = this.DEBUG ? new Error() : undefined; - injections.push({ - property: property, - fullName: normalizedInjectionName - }); - }, + if (length > 3) { + args = new Array(length - 3); + for (var i = 3; i < length; i++) { + args[i-3] = arguments[i]; + } + } else { + args = undefined; + } - /** - Used only via `factoryInjection`. - Provides a specialized form of injection, specifically enabling - all factory of one type to be injected with a reference to another - object. - For example, provided each factory of type `model` needed a `store`. - one would do the following: - ```javascript - let registry = new Registry(); - registry.register('store:main', SomeStore); - registry.factoryTypeInjection('model', 'store', 'store:main'); - let store = registry.lookup('store:main'); - let UserFactory = registry.lookupFactory('model:user'); - UserFactory.store instanceof SomeStore; //=> true - ``` - @private - @method factoryTypeInjection - @param {String} type - @param {String} property - @param {String} fullName - */ - factoryTypeInjection: function (type, property, fullName) { - var injections = this._factoryTypeInjections[type] || (this._factoryTypeInjections[type] = []); + if (!this.currentInstance) { createAutorun(this); } + return this.currentInstance.schedule(queueName, target, method, args, false, stack); + }, - injections.push({ - property: property, - fullName: this.normalize(fullName) - }); - }, + deferOnce: function(queueName /* , target, method, args */) { + var length = arguments.length; + var method, target, args; - /** - Defines factory injection rules. - Similar to regular injection rules, but are run against factories, via - `Registry#lookupFactory`. - These rules are used to inject objects onto factories when they - are looked up. - Two forms of injections are possible: - * Injecting one fullName on another fullName - * Injecting one fullName on a type - Example: - ```javascript - let registry = new Registry(); - let container = registry.container(); - registry.register('store:main', Store); - registry.register('store:secondary', OtherStore); - registry.register('model:user', User); - registry.register('model:post', Post); - // injecting one fullName on another type - registry.factoryInjection('model', 'store', 'store:main'); - // injecting one fullName on another fullName - registry.factoryInjection('model:post', 'secondaryStore', 'store:secondary'); - let UserFactory = container.lookupFactory('model:user'); - let PostFactory = container.lookupFactory('model:post'); - let store = container.lookup('store:main'); - UserFactory.store instanceof Store; //=> true - UserFactory.secondaryStore instanceof OtherStore; //=> false - PostFactory.store instanceof Store; //=> true - PostFactory.secondaryStore instanceof OtherStore; //=> true - // and both models share the same source instance - UserFactory.store === PostFactory.store; //=> true - ``` - @private - @method factoryInjection - @param {String} factoryName - @param {String} property - @param {String} injectionName - */ - factoryInjection: function (fullName, property, injectionName) { - var normalizedName = this.normalize(fullName); - var normalizedInjectionName = this.normalize(injectionName); + if (length === 2) { + method = arguments[1]; + target = null; + } else { + target = arguments[1]; + method = arguments[2]; + } - this.validateFullName(injectionName); + if (isString(method)) { + method = target[method]; + } - if (fullName.indexOf(':') === -1) { - return this.factoryTypeInjection(normalizedName, property, normalizedInjectionName); + var stack = this.DEBUG ? new Error() : undefined; + + if (length > 3) { + args = new Array(length - 3); + for (var i = 3; i < length; i++) { + args[i-3] = arguments[i]; } + } else { + args = undefined; + } - var injections = this._factoryInjections[normalizedName] || (this._factoryInjections[normalizedName] = []); + if (!this.currentInstance) { + createAutorun(this); + } + return this.currentInstance.schedule(queueName, target, method, args, true, stack); + }, - injections.push({ - property: property, - fullName: normalizedInjectionName - }); - }, + setTimeout: function() { + var l = arguments.length; + var args = new Array(l); - /** - @private - @method knownForType - @param {String} type the type to iterate over - */ - knownForType: function (type) { - var fallbackKnown = undefined, - resolverKnown = undefined; + for (var x = 0; x < l; x++) { + args[x] = arguments[x]; + } - var localKnown = _emberUtils.dictionary(null); - var registeredNames = Object.keys(this.registrations); - for (var index = 0; index < registeredNames.length; index++) { - var fullName = registeredNames[index]; - var itemType = fullName.split(':')[0]; + var length = args.length, + method, wait, target, + methodOrTarget, methodOrWait, methodOrArgs; - if (itemType === type) { - localKnown[fullName] = true; - } - } + if (length === 0) { + return; + } else if (length === 1) { + method = args.shift(); + wait = 0; + } else if (length === 2) { + methodOrTarget = args[0]; + methodOrWait = args[1]; - if (this.fallback) { - fallbackKnown = this.fallback.knownForType(type); + if (isFunction(methodOrWait) || isFunction(methodOrTarget[methodOrWait])) { + target = args.shift(); + method = args.shift(); + wait = 0; + } else if (isCoercableNumber(methodOrWait)) { + method = args.shift(); + wait = args.shift(); + } else { + method = args.shift(); + wait = 0; } + } else { + var last = args[args.length - 1]; - if (this.resolver && this.resolver.knownForType) { - resolverKnown = this.resolver.knownForType(type); + if (isCoercableNumber(last)) { + wait = args.pop(); + } else { + wait = 0; } - return _emberUtils.assign({}, fallbackKnown, localKnown, resolverKnown); - }, + methodOrTarget = args[0]; + methodOrArgs = args[1]; - validateFullName: function (fullName) { - if (!this.isValidFullName(fullName)) { - throw new TypeError('Invalid Fullname, expected: \'type:name\' got: ' + fullName); + if (isFunction(methodOrArgs) || (isString(methodOrArgs) && + methodOrTarget !== null && + methodOrArgs in methodOrTarget)) { + target = args.shift(); + method = args.shift(); + } else { + method = args.shift(); } + } - return true; - }, + var executeAt = Date.now() + parseInt(wait !== wait ? 0 : wait, 10); - isValidFullName: function (fullName) { - return !!VALID_FULL_NAME_REGEXP.test(fullName); - }, + if (isString(method)) { + method = target[method]; + } - validateInjections: function (injections) { - if (!injections) { - return; + var onError = getOnError(this.options); + + function fn() { + if (onError) { + try { + method.apply(target, args); + } catch (e) { + onError(e); + } + } else { + method.apply(target, args); } + } - var fullName = undefined; + return this._setTimeout(fn, executeAt); + }, - for (var i = 0; i < injections.length; i++) { - fullName = injections[i].fullName; + _setTimeout: function (fn, executeAt) { + if (this._timers.length === 0) { + this._timers.push(executeAt, fn); + this._installTimerTimeout(); + return fn; + } - if (!this.has(fullName)) { - throw new Error('Attempting to inject an unknown injection: \'' + fullName + '\''); - } - } - }, + // find position to insert + var i = binarySearch(executeAt, this._timers); - normalizeInjectionsHash: function (hash) { - var injections = []; + this._timers.splice(i, 0, executeAt, fn); - for (var key in hash) { - if (hash.hasOwnProperty(key)) { + // we should be the new earliest timer if i == 0 + if (i === 0) { + this._reinstallTimerTimeout(); + } - injections.push({ - property: key, - fullName: hash[key] - }); - } - } + return fn; + }, - return injections; - }, + throttle: function(target, method /* , args, wait, [immediate] */) { + var backburner = this; + var args = new Array(arguments.length); + for (var i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + var immediate = args.pop(); + var wait, throttler, index, timer; - getInjections: function (fullName) { - var injections = this._injections[fullName] || []; - if (this.fallback) { - injections = injections.concat(this.fallback.getInjections(fullName)); - } - return injections; - }, + if (isNumber(immediate) || isString(immediate)) { + wait = immediate; + immediate = true; + } else { + wait = args.pop(); + } - getTypeInjections: function (type) { - var injections = this._typeInjections[type] || []; - if (this.fallback) { - injections = injections.concat(this.fallback.getTypeInjections(type)); - } - return injections; - }, + wait = parseInt(wait, 10); - getFactoryInjections: function (fullName) { - var injections = this._factoryInjections[fullName] || []; - if (this.fallback) { - injections = injections.concat(this.fallback.getFactoryInjections(fullName)); - } - return injections; - }, + index = findThrottler(target, method, this._throttlers); + if (index > -1) { return this._throttlers[index]; } // throttled - getFactoryTypeInjections: function (type) { - var injections = this._factoryTypeInjections[type] || []; - if (this.fallback) { - injections = injections.concat(this.fallback.getFactoryTypeInjections(type)); + timer = this._platform.setTimeout(function() { + if (!immediate) { + backburner.run.apply(backburner, args); } - return injections; + var index = findThrottler(target, method, backburner._throttlers); + if (index > -1) { + backburner._throttlers.splice(index, 1); + } + }, wait); + + if (immediate) { + this.run.apply(this, args); } - }; - function deprecateResolverFunction(registry) { - registry.resolver = { - resolve: registry.resolver - }; - } + throttler = [target, method, timer]; - /** - Given a fullName and a source fullName returns the fully resolved - fullName. Used to allow for local lookup. - - ```javascript - let registry = new Registry(); - - // the twitter factory is added to the module system - registry.expandLocalLookup('component:post-title', { source: 'template:post' }) // => component:post/post-title - ``` - - @private - @method expandLocalLookup - @param {String} fullName - @param {Object} [options] - @param {String} [options.source] the fullname of the request source (used for local lookups) - @return {String} fullName - */ - Registry.prototype.expandLocalLookup = function Registry_expandLocalLookup(fullName, options) { - if (this.resolver && this.resolver.expandLocalLookup) { + this._throttlers.push(throttler); - var normalizedFullName = this.normalize(fullName); - var normalizedSource = this.normalize(options.source); + return throttler; + }, - return expandLocalLookup(this, normalizedFullName, normalizedSource); - } else if (this.fallback) { - return this.fallback.expandLocalLookup(fullName, options); + debounce: function(target, method /* , args, wait, [immediate] */) { + var backburner = this; + var args = new Array(arguments.length); + for (var i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + + var immediate = args.pop(); + var wait, index, debouncee, timer; + + if (isNumber(immediate) || isString(immediate)) { + wait = immediate; + immediate = false; } else { - return null; + wait = args.pop(); } - }; - function expandLocalLookup(registry, normalizedName, normalizedSource) { - var cache = registry._localLookupCache; - var normalizedNameCache = cache[normalizedName]; + wait = parseInt(wait, 10); + // Remove debouncee + index = findDebouncee(target, method, this._debouncees); - if (!normalizedNameCache) { - normalizedNameCache = cache[normalizedName] = new _emberUtils.EmptyObject(); + if (index > -1) { + debouncee = this._debouncees[index]; + this._debouncees.splice(index, 1); + this._platform.clearTimeout(debouncee[2]); } - var cached = normalizedNameCache[normalizedSource]; + timer = this._platform.setTimeout(function() { + if (!immediate) { + backburner.run.apply(backburner, args); + } + var index = findDebouncee(target, method, backburner._debouncees); + if (index > -1) { + backburner._debouncees.splice(index, 1); + } + }, wait); - if (cached !== undefined) { - return cached; + if (immediate && index === -1) { + backburner.run.apply(backburner, args); } - var expanded = registry.resolver.expandLocalLookup(normalizedName, normalizedSource); + debouncee = [ + target, + method, + timer + ]; - return normalizedNameCache[normalizedSource] = expanded; - } + backburner._debouncees.push(debouncee); - function resolve(registry, normalizedName, options) { - if (options && options.source) { - // when `source` is provided expand normalizedName - // and source into the full normalizedName - normalizedName = registry.expandLocalLookup(normalizedName, options); + return debouncee; + }, - // if expandLocalLookup returns falsey, we do not support local lookup - if (!normalizedName) { - return; - } - } + cancelTimers: function() { + each(this._throttlers, this._boundClearItems); + this._throttlers = []; - var cached = registry._resolveCache[normalizedName]; - if (cached !== undefined) { - return cached; - } - if (registry._failCache[normalizedName]) { - return; - } + each(this._debouncees, this._boundClearItems); + this._debouncees = []; - var resolved = undefined; + this._clearTimerTimeout(); + this._timers = []; - if (registry.resolver) { - resolved = registry.resolver.resolve(normalizedName); + if (this._autorun) { + this._platform.clearTimeout(this._autorun); + this._autorun = null; } + }, - if (resolved === undefined) { - resolved = registry.registrations[normalizedName]; - } + hasTimers: function() { + return !!this._timers.length || !!this._debouncees.length || !!this._throttlers.length || this._autorun; + }, - if (resolved === undefined) { - registry._failCache[normalizedName] = true; + cancel: function (timer) { + var timerType = typeof timer; + + if (timer && timerType === 'object' && timer.queue && timer.method) { // we're cancelling a deferOnce + return timer.queue.cancel(timer); + } else if (timerType === 'function') { // we're cancelling a setTimeout + for (var i = 0, l = this._timers.length; i < l; i += 2) { + if (this._timers[i + 1] === timer) { + this._timers.splice(i, 2); // remove the two elements + if (i === 0) { + this._reinstallTimerTimeout(); + } + return true; + } + } + } else if (Object.prototype.toString.call(timer) === '[object Array]'){ // we're cancelling a throttle or debounce + return this._cancelItem(findThrottler, this._throttlers, timer) || + this._cancelItem(findDebouncee, this._debouncees, timer); } else { - registry._resolveCache[normalizedName] = resolved; + return; // timer was null or not a timer } + }, - return resolved; - } + _cancelItem: function(findMethod, array, timer){ + var item, index; - function has(registry, fullName, source) { - return registry.resolve(fullName, { source: source }) !== undefined; - } + if (timer.length < 3) { return false; } - var privateNames = _emberUtils.dictionary(null); - var privateSuffix = '' + Math.random() + Date.now(); + index = findMethod(timer[0], timer[1], array); - function privatize(_ref) { - var fullName = _ref[0]; + if (index > -1) { - var name = privateNames[fullName]; - if (name) { - return name; + item = array[index]; + + if (item[2] === timer[2]) { + array.splice(index, 1); + this._platform.clearTimeout(timer[2]); + return true; + } } - var _fullName$split = fullName.split(':'); + return false; + }, - var type = _fullName$split[0]; - var rawName = _fullName$split[1]; + _runExpiredTimers: function () { + this._timerTimeoutId = undefined; + this.run(this, this._scheduleExpiredTimers); + }, - return privateNames[fullName] = _emberUtils.intern(type + ':' + rawName + '-' + privateSuffix); - } -}); -enifed('dag-map', ['exports'], function (exports) { 'use strict'; + _scheduleExpiredTimers: function () { + var n = Date.now(); + var timers = this._timers; + var i = 0; + var l = timers.length; + for (; i < l; i += 2) { + var executeAt = timers[i]; + var fn = timers[i+1]; + if (executeAt <= n) { + this.schedule(this.options.defaultQueue, null, fn); + } else { + break; + } + } + timers.splice(0, i); + this._installTimerTimeout(); + }, -/** - * A topologically ordered map of key/value pairs with a simple API for adding constraints. - * - * Edges can forward reference keys that have not been added yet (the forward reference will - * map the key to undefined). - */ -var DAG = (function () { - function DAG() { - this._vertices = new Vertices(); + _reinstallTimerTimeout: function () { + this._clearTimerTimeout(); + this._installTimerTimeout(); + }, + + _clearTimerTimeout: function () { + if (!this._timerTimeoutId) { + return; } - /** - * Adds a key/value pair with dependencies on other key/value pairs. - * - * @public - * @param key The key of the vertex to be added. - * @param value The value of that vertex. - * @param before A key or array of keys of the vertices that must - * be visited before this vertex. - * @param after An string or array of strings with the keys of the - * vertices that must be after this vertex is visited. - */ - DAG.prototype.add = function (key, value, before, after) { - if (!key) - throw new Error('argument `key` is required'); - var vertices = this._vertices; - var v = vertices.add(key); - v.val = value; - if (before) { - if (typeof before === "string") { - vertices.addEdge(v, vertices.add(before)); - } - else { - for (var i = 0; i < before.length; i++) { - vertices.addEdge(v, vertices.add(before[i])); - } - } - } - if (after) { - if (typeof after === "string") { - vertices.addEdge(vertices.add(after), v); - } - else { - for (var i = 0; i < after.length; i++) { - vertices.addEdge(vertices.add(after[i]), v); - } - } - } - }; - /** - * @deprecated please use add. - */ - DAG.prototype.addEdges = function (key, value, before, after) { - this.add(key, value, before, after); - }; - /** - * Visits key/value pairs in topological order. - * - * @public - * @param callback The function to be invoked with each key/value. - */ - DAG.prototype.each = function (callback) { - this._vertices.walk(callback); - }; - /** - * @deprecated please use each. - */ - DAG.prototype.topsort = function (callback) { - this.each(callback); - }; - return DAG; -}()); -/** @private */ -var Vertices = (function () { - function Vertices() { - this.length = 0; - this.stack = new IntStack(); - this.path = new IntStack(); - this.result = new IntStack(); - } - Vertices.prototype.add = function (key) { - if (!key) - throw new Error("missing key"); - var l = this.length | 0; - var vertex; - for (var i = 0; i < l; i++) { - vertex = this[i]; - if (vertex.key === key) - return vertex; - } - this.length = l + 1; - return this[l] = { - idx: l, - key: key, - val: undefined, - out: false, - flag: false, - length: 0 - }; - }; - Vertices.prototype.addEdge = function (v, w) { - this.check(v, w.key); - var l = w.length | 0; - for (var i = 0; i < l; i++) { - if (w[i] === v.idx) - return; - } - w.length = l + 1; - w[l] = v.idx; - v.out = true; - }; - Vertices.prototype.walk = function (cb) { - this.reset(); - for (var i = 0; i < this.length; i++) { - var vertex = this[i]; - if (vertex.out) - continue; - this.visit(vertex, ""); - } - this.each(this.result, cb); - }; - Vertices.prototype.check = function (v, w) { - if (v.key === w) { - throw new Error("cycle detected: " + w + " <- " + w); - } - // quick check - if (v.length === 0) - return; - // shallow check - for (var i = 0; i < v.length; i++) { - var key = this[v[i]].key; - if (key === w) { - throw new Error("cycle detected: " + w + " <- " + v.key + " <- " + w); - } - } - // deep check - this.reset(); - this.visit(v, w); - if (this.path.length > 0) { - var msg_1 = "cycle detected: " + w; - this.each(this.path, function (key) { - msg_1 += " <- " + key; - }); - throw new Error(msg_1); - } - }; - Vertices.prototype.reset = function () { - this.stack.length = 0; - this.path.length = 0; - this.result.length = 0; - for (var i = 0, l = this.length; i < l; i++) { - this[i].flag = false; - } - }; - Vertices.prototype.visit = function (start, search) { - var _a = this, stack = _a.stack, path = _a.path, result = _a.result; - stack.push(start.idx); - while (stack.length) { - var index = stack.pop() | 0; - if (index >= 0) { - // enter - var vertex = this[index]; - if (vertex.flag) - continue; - vertex.flag = true; - path.push(index); - if (search === vertex.key) - break; - // push exit - stack.push(~index); - this.pushIncoming(vertex); - } - else { - // exit - path.pop(); - result.push(~index); - } - } - }; - Vertices.prototype.pushIncoming = function (incomming) { - var stack = this.stack; - for (var i = incomming.length - 1; i >= 0; i--) { - var index = incomming[i]; - if (!this[index].flag) { - stack.push(index); - } - } - }; - Vertices.prototype.each = function (indices, cb) { - for (var i = 0, l = indices.length; i < l; i++) { - var vertex = this[indices[i]]; - cb(vertex.key, vertex.val); - } - }; - return Vertices; -}()); -/** @private */ -var IntStack = (function () { - function IntStack() { - this.length = 0; + this._platform.clearTimeout(this._timerTimeoutId); + this._timerTimeoutId = undefined; + }, + + _installTimerTimeout: function () { + if (!this._timers.length) { + return; } - IntStack.prototype.push = function (n) { - this[this.length++] = n | 0; - }; - IntStack.prototype.pop = function () { - return this[--this.length] | 0; - }; - return IntStack; -}()); + var minExpiresAt = this._timers[0]; + var n = Date.now(); + var wait = Math.max(0, minExpiresAt - n); + this._timerTimeoutId = this._platform.setTimeout(this._boundRunExpiredTimers, wait); + } +}; -exports['default'] = DAG; +Backburner.prototype.schedule = Backburner.prototype.defer; +Backburner.prototype.scheduleOnce = Backburner.prototype.deferOnce; +Backburner.prototype.later = Backburner.prototype.setTimeout; -Object.defineProperty(exports, '__esModule', { value: true }); +function getOnError(options) { + return options.onError || (options.onErrorTarget && options.onErrorTarget[options.onErrorMethod]); +} -}); -enifed('ember-application/index', ['exports', 'ember-application/initializers/dom-templates', 'ember-application/system/application', 'ember-application/system/application-instance', 'ember-application/system/resolver', 'ember-application/system/engine', 'ember-application/system/engine-instance', 'ember-application/system/engine-parent'], function (exports, _emberApplicationInitializersDomTemplates, _emberApplicationSystemApplication, _emberApplicationSystemApplicationInstance, _emberApplicationSystemResolver, _emberApplicationSystemEngine, _emberApplicationSystemEngineInstance, _emberApplicationSystemEngineParent) { - /** - @module ember - @submodule ember-application - */ +function createAutorun(backburner) { + var setTimeout = backburner._platform.setTimeout; + backburner.begin(); + backburner._autorun = setTimeout(function() { + backburner._autorun = null; + backburner.end(); + }, 0); +} - 'use strict'; +function findDebouncee(target, method, debouncees) { + return findItem(target, method, debouncees); +} - exports.Application = _emberApplicationSystemApplication.default; - exports.ApplicationInstance = _emberApplicationSystemApplicationInstance.default; - exports.Resolver = _emberApplicationSystemResolver.default; - exports.Engine = _emberApplicationSystemEngine.default; - exports.EngineInstance = _emberApplicationSystemEngineInstance.default; - exports.getEngineParent = _emberApplicationSystemEngineParent.getEngineParent; - exports.setEngineParent = _emberApplicationSystemEngineParent.setEngineParent; +function findThrottler(target, method, throttlers) { + return findItem(target, method, throttlers); +} - // add domTemplates initializer (only does something if `ember-template-compiler` - // is loaded already) -}); -enifed('ember-application/initializers/dom-templates', ['exports', 'require', 'ember-glimmer', 'ember-environment', 'ember-application/system/application'], function (exports, _require, _emberGlimmer, _emberEnvironment, _emberApplicationSystemApplication) { - 'use strict'; +function findItem(target, method, collection) { + var item; + var index = -1; - var bootstrap = function () {}; + for (var i = 0, l = collection.length; i < l; i++) { + item = collection[i]; + if (item[0] === target && item[1] === method) { + index = i; + break; + } + } - _emberApplicationSystemApplication.default.initializer({ - name: 'domTemplates', - initialize: function () { - var bootstrapModuleId = 'ember-template-compiler/system/bootstrap'; - var context = undefined; - if (_emberEnvironment.environment.hasDOM && _require.has(bootstrapModuleId)) { - bootstrap = _require.default(bootstrapModuleId).default; - context = document; - } + return index; +} - bootstrap({ context: context, hasTemplate: _emberGlimmer.hasTemplate, setTemplate: _emberGlimmer.setTemplate }); - } - }); -}); -enifed('ember-application/system/application-instance', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-environment', 'ember-views', 'ember-application/system/engine-instance'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberEnvironment, _emberViews, _emberApplicationSystemEngineInstance) { - /** - @module ember - @submodule ember-application - */ +function clearItems(item) { + this._platform.clearTimeout(item[2]); +} + +exports['default'] = Backburner; +Object.defineProperty(exports, '__esModule', { value: true }); + +}); +enifed('container/container', ['exports', 'ember-utils', 'ember-environment', 'ember-metal'], function (exports, _emberUtils, _emberEnvironment, _emberMetal) { + /* globals Proxy */ 'use strict'; - var BootOptions = undefined; + var _Container$prototype; + + exports.default = Container; + exports.buildFakeContainerWithDeprecations = buildFakeContainerWithDeprecations; + var CONTAINER_OVERRIDE = _emberUtils.symbol('CONTAINER_OVERRIDE'); + var FACTORY_FOR = _emberUtils.symbol('FACTORY_FOR'); + exports.FACTORY_FOR = FACTORY_FOR; + var LOOKUP_FACTORY = _emberUtils.symbol('LOOKUP_FACTORY'); + + exports.LOOKUP_FACTORY = LOOKUP_FACTORY; /** - The `ApplicationInstance` encapsulates all of the stateful aspects of a - running `Application`. - - At a high-level, we break application boot into two distinct phases: - - * Definition time, where all of the classes, templates, and other - dependencies are loaded (typically in the browser). - * Run time, where we begin executing the application once everything - has loaded. + A container used to instantiate and cache objects. - Definition time can be expensive and only needs to happen once since it is - an idempotent operation. For example, between test runs and FastBoot - requests, the application stays the same. It is only the state that we want - to reset. + Every `Container` must be associated with a `Registry`, which is referenced + to determine the factory and options that should be used to instantiate + objects. - That state is what the `ApplicationInstance` manages: it is responsible for - creating the container that contains all application state, and disposing of - it once the particular test run or FastBoot request has finished. + The public API for `Container` is still in flux and should not be considered + stable. - @public - @class Ember.ApplicationInstance - @extends Ember.EngineInstance - */ + @private + @class Container + */ - var ApplicationInstance = _emberApplicationSystemEngineInstance.default.extend({ + function Container(registry, options) { + this.registry = registry; + this.owner = options && options.owner ? options.owner : null; + this.cache = _emberUtils.dictionary(options && options.cache ? options.cache : null); + this.factoryCache = _emberUtils.dictionary(options && options.factoryCache ? options.factoryCache : null); + this.validationCache = _emberUtils.dictionary(options && options.validationCache ? options.validationCache : null); + this._fakeContainerToInject = buildFakeContainerWithDeprecations(this); + this[CONTAINER_OVERRIDE] = undefined; + this.isDestroyed = false; + } + + Container.prototype = (_Container$prototype = { /** - The `Application` for which this is an instance. - @property {Ember.Application} application - @private - */ - application: null, + @private + @property owner + @type Object + */ + owner: null, /** - The DOM events for which the event dispatcher should listen. - By default, the application's `Ember.EventDispatcher` listens - for a set of standard DOM events, such as `mousedown` and - `keyup`, and delegates them to your application's `Ember.View` - instances. - @private - @property {Object} customEvents - */ - customEvents: null, + @private + @property registry + @type Registry + @since 1.11.0 + */ + registry: null, /** - The root DOM element of the Application as an element or a - [jQuery-compatible selector - string](http://api.jquery.com/category/selectors/). - @private - @property {String|DOMElement} rootElement - */ - rootElement: null, + @private + @property cache + @type InheritingDict + */ + cache: null, - init: function () { - this._super.apply(this, arguments); + /** + @private + @property factoryCache + @type InheritingDict + */ + factoryCache: null, - // Register this instance in the per-instance registry. - // - // Why do we need to register the instance in the first place? - // Because we need a good way for the root route (a.k.a ApplicationRoute) - // to notify us when it has created the root-most view. That view is then - // appended to the rootElement, in the case of apps, to the fixture harness - // in tests, or rendered to a string in the case of FastBoot. - this.register('-application-instance:main', this, { instantiate: false }); + /** + @private + @property validationCache + @type InheritingDict + */ + validationCache: null, + + /** + Given a fullName return a corresponding instance. + The default behaviour is for lookup to return a singleton instance. + The singleton is scoped to the container, allowing multiple containers + to all have their own locally scoped singletons. + ```javascript + let registry = new Registry(); + let container = registry.container(); + registry.register('api:twitter', Twitter); + let twitter = container.lookup('api:twitter'); + twitter instanceof Twitter; // => true + // by default the container will return singletons + let twitter2 = container.lookup('api:twitter'); + twitter2 instanceof Twitter; // => true + twitter === twitter2; //=> true + ``` + If singletons are not wanted, an optional flag can be provided at lookup. + ```javascript + let registry = new Registry(); + let container = registry.container(); + registry.register('api:twitter', Twitter); + let twitter = container.lookup('api:twitter', { singleton: false }); + let twitter2 = container.lookup('api:twitter', { singleton: false }); + twitter === twitter2; //=> false + ``` + @private + @method lookup + @param {String} fullName + @param {Object} [options] + @param {String} [options.source] The fullname of the request source (used for local lookup) + @return {any} + */ + lookup: function (fullName, options) { + return lookup(this, this.registry.normalize(fullName), options); }, /** - Overrides the base `EngineInstance._bootSync` method with concerns relevant - to booting application (instead of engine) instances. - This method should only contain synchronous boot concerns. Asynchronous - boot concerns should eventually be moved to the `boot` method, which - returns a promise. - Until all boot code has been made asynchronous, we need to continue to - expose this method for use *internally* in places where we need to boot an - instance synchronously. - @private - */ - _bootSync: function (options) { - if (this._booted) { - return this; - } + Given a fullName, return the corresponding factory. + @private + @method lookupFactory + @param {String} fullName + @param {Object} [options] + @param {String} [options.source] The fullname of the request source (used for local lookup) + @return {any} + */ + lookupFactory: function (fullName, options) { - options = new BootOptions(options); + return deprecatedFactoryFor(this, this.registry.normalize(fullName), options); + } - this.setupRegistry(options); + }, _Container$prototype[LOOKUP_FACTORY] = function (fullName, options) { + return deprecatedFactoryFor(this, this.registry.normalize(fullName), options); + }, _Container$prototype[FACTORY_FOR] = function (fullName) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - if (options.rootElement) { - this.rootElement = options.rootElement; + if (_emberMetal.isFeatureEnabled('ember-no-double-extend')) { + if (true) { + return this.factoryFor(fullName, options); } else { - this.rootElement = this.application.rootElement; + /* This throws in case of a poorly designed build */ + throw new Error('If ember-no-double-extend is enabled, ember-factory-for must also be enabled'); } + } + var factory = this[LOOKUP_FACTORY](fullName, options); + if (factory === undefined) { + return; + } + var manager = new DeprecatedFactoryManager(this, factory, fullName); - if (options.location) { - var router = _emberMetal.get(this, 'router'); - _emberMetal.set(router, 'location', options.location); + return manager; + }, _Container$prototype.destroy = function () { + eachDestroyable(this, function (item) { + if (item.destroy) { + item.destroy(); } + }); - this.application.runInstanceInitializers(this); + this.isDestroyed = true; + }, _Container$prototype.reset = function (fullName) { + if (arguments.length > 0) { + resetMember(this, this.registry.normalize(fullName)); + } else { + resetCache(this); + } + }, _Container$prototype.ownerInjection = function () { + var _ref; - if (options.isInteractive) { - this.setupEventDispatcher(); - } + return _ref = {}, _ref[_emberUtils.OWNER] = this.owner, _ref; + }, _Container$prototype); - this._booted = true; + /* + * Wrap a factory manager in a proxy which will not permit properties to be + * set on the manager. + */ + function wrapManagerInDeprecationProxy(manager) { + if (_emberUtils.HAS_NATIVE_PROXY) { + var _ret = (function () { + var validator = { + get: function (obj, prop) { + if (prop !== 'class' && prop !== 'create') { + throw new Error('You attempted to access "' + prop + '" on a factory manager created by container#factoryFor. "' + prop + '" is not a member of a factory manager."'); + } - return this; - }, + return obj[prop]; + }, + set: function (obj, prop, value) { + throw new Error('You attempted to set "' + prop + '" on a factory manager created by container#factoryFor. A factory manager is a read-only construct.'); + } + }; - setupRegistry: function (options) { - this.constructor.setupRegistry(this.__registry__, options); - }, + // Note: + // We have to proxy access to the manager here so that private property + // access doesn't cause the above errors to occur. + var m = manager; + var proxiedManager = { + class: m.class, + create: function (props) { + return m.create(props); + } + }; - router: _emberMetal.computed(function () { - return this.lookup('router:main'); - }).readOnly(), + return { + v: new Proxy(proxiedManager, validator) + }; + })(); - /** - This hook is called by the root-most Route (a.k.a. the ApplicationRoute) - when it has finished creating the root View. By default, we simply take the - view and append it to the `rootElement` specified on the Application. - In cases like FastBoot and testing, we can override this hook and implement - custom behavior, such as serializing to a string and sending over an HTTP - socket rather than appending to DOM. - @param view {Ember.View} the root-most view - @private - */ - didCreateRootView: function (view) { - view.appendTo(this.rootElement); - }, + if (typeof _ret === 'object') return _ret.v; + } - /** - Tells the router to start routing. The router will ask the location for the - current URL of the page to determine the initial URL to start routing to. - To start the app at a specific URL, call `handleURL` instead. - @private - */ - startRouting: function () { - var router = _emberMetal.get(this, 'router'); - router.startRouting(); - this._didSetupRouter = true; - }, + return manager; + } + if (true) { /** - @private - Sets up the router, initializing the child router and configuring the - location before routing begins. - Because setup should only occur once, multiple calls to `setupRouter` - beyond the first call have no effect. - */ - setupRouter: function () { - if (this._didSetupRouter) { - return; + Given a fullName, return the corresponding factory. The consumer of the factory + is responsible for the destruction of any factory instances, as there is no + way for the container to ensure instances are destroyed when it itself is + destroyed. + @public + @method factoryFor + @param {String} fullName + @param {Object} [options] + @param {String} [options.source] The fullname of the request source (used for local lookup) + @return {any} + */ + Container.prototype.factoryFor = function _factoryFor(fullName) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + var normalizedName = this.registry.normalize(fullName); + + if (options.source) { + normalizedName = this.registry.expandLocalLookup(fullName, options); + // if expandLocalLookup returns falsey, we do not support local lookup + if (!normalizedName) { + return; + } } - this._didSetupRouter = true; - var router = _emberMetal.get(this, 'router'); - router.setupRouter(); - }, + var factory = this.registry.resolve(normalizedName); - /** - Directs the router to route to a particular URL. This is useful in tests, - for example, to tell the app to start at a particular URL. - @param url {String} the URL the router should route to - @private - */ - handleURL: function (url) { - var router = _emberMetal.get(this, 'router'); + if (factory === undefined) { + return; + } - this.setupRouter(); - return router.handleURL(url); - }, + var manager = new FactoryManager(this, factory, fullName, normalizedName); - /** - @private - */ - setupEventDispatcher: function () { - var dispatcher = this.lookup('event_dispatcher:main'); - var applicationCustomEvents = _emberMetal.get(this.application, 'customEvents'); - var instanceCustomEvents = _emberMetal.get(this, 'customEvents'); + return manager; + }; + } - var customEvents = _emberUtils.assign({}, applicationCustomEvents, instanceCustomEvents); - dispatcher.setup(customEvents, this.rootElement); + function isSingleton(container, fullName) { + return container.registry.getOption(fullName, 'singleton') !== false; + } - return dispatcher; - }, + function shouldInstantiate(container, fullName) { + return container.registry.getOption(fullName, 'instantiate') !== false; + } - /** - Returns the current URL of the app instance. This is useful when your - app does not update the browsers URL bar (i.e. it uses the `'none'` - location adapter). - @public - @return {String} the current URL - */ - getURL: function () { - var router = _emberMetal.get(this, 'router'); - return _emberMetal.get(router, 'url'); - }, + function lookup(container, fullName) { + var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; - // `instance.visit(url)` should eventually replace `instance.handleURL()`; - // the test helpers can probably be switched to use this implementation too + if (options.source) { + fullName = container.registry.expandLocalLookup(fullName, options); - /** - Navigate the instance to a particular URL. This is useful in tests, for - example, or to tell the app to start at a particular URL. This method - returns a promise that resolves with the app instance when the transition - is complete, or rejects if the transion was aborted due to an error. - @public - @param url {String} the destination URL - @return {Promise} - */ - visit: function (url) { - var _this = this; + // if expandLocalLookup returns falsey, we do not support local lookup + if (!fullName) { + return; + } + } - this.setupRouter(); + if (container.cache[fullName] !== undefined && options.singleton !== false) { + return container.cache[fullName]; + } - var bootOptions = this.__container__.lookup('-environment:main'); + if (true) { + return instantiateFactory(container, fullName, options); + } else { + var factory = deprecatedFactoryFor(container, fullName); + var value = instantiate(factory, {}, container, fullName); - var router = _emberMetal.get(this, 'router'); + if (value === undefined) { + return; + } - var handleTransitionResolve = function () { - if (!bootOptions.options.shouldRender) { - // No rendering is needed, and routing has completed, simply return. - return _this; - } else { - return new _emberRuntime.RSVP.Promise(function (resolve) { - // Resolve once rendering is completed. `router.handleURL` returns the transition (as a thennable) - // which resolves once the transition is completed, but the transition completion only queues up - // a scheduled revalidation (into the `render` queue) in the Renderer. - // - // This uses `run.schedule('afterRender', ....)` to resolve after that rendering has completed. - _emberMetal.run.schedule('afterRender', null, resolve, _this); - }); - } - }; + if (isSingleton(container, fullName) && options.singleton !== false) { + container.cache[fullName] = value; + } - var handleTransitionReject = function (error) { - if (error.error) { - throw error.error; - } else if (error.name === 'TransitionAborted' && router.router.activeTransition) { - return router.router.activeTransition.then(handleTransitionResolve, handleTransitionReject); - } else if (error.name === 'TransitionAborted') { - throw new Error(error.message); - } else { - throw error; - } - }; + return value; + } + } - var location = _emberMetal.get(router, 'location'); + function isSingletonClass(container, fullName, _ref2) { + var instantiate = _ref2.instantiate; + var singleton = _ref2.singleton; - // Keeps the location adapter's internal URL in-sync - location.setURL(url); + return singleton !== false && isSingleton(container, fullName) && !instantiate && !shouldInstantiate(container, fullName); + } - // getURL returns the set url with the rootURL stripped off - return router.handleURL(location.getURL()).then(handleTransitionResolve, handleTransitionReject); - } - }); + function isSingletonInstance(container, fullName, _ref3) { + var instantiate = _ref3.instantiate; + var singleton = _ref3.singleton; - ApplicationInstance.reopenClass({ - /** - @private - @method setupRegistry - @param {Registry} registry - @param {BootOptions} options - */ - setupRegistry: function (registry) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + return singleton !== false && isSingleton(container, fullName) && instantiate !== false && shouldInstantiate(container, fullName); + } - if (!options.toEnvironment) { - options = new BootOptions(options); - } + function isFactoryClass(container, fullname, _ref4) { + var instantiate = _ref4.instantiate; + var singleton = _ref4.singleton; - registry.register('-environment:main', options.toEnvironment(), { instantiate: false }); - registry.register('service:-document', options.document, { instantiate: false }); + return (singleton === false || !isSingleton(container, fullname)) && instantiate === false && !shouldInstantiate(container, fullname); + } - this._super(registry, options); - } - }); + function isFactoryInstance(container, fullName, _ref5) { + var instantiate = _ref5.instantiate; + var singleton = _ref5.singleton; - /** - A list of boot-time configuration options for customizing the behavior of - an `Ember.ApplicationInstance`. - - This is an interface class that exists purely to document the available - options; you do not need to construct it manually. Simply pass a regular - JavaScript object containing the desired options into methods that require - one of these options object: - - ```javascript - MyApp.visit("/", { location: "none", rootElement: "#container" }); - ``` - - Not all combinations of the supported options are valid. See the documentation - on `Ember.Application#visit` for the supported configurations. - - Internal, experimental or otherwise unstable flags are marked as private. - - @class BootOptions - @namespace Ember.ApplicationInstance - @public - */ - BootOptions = function BootOptions() { - var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + return (singleton !== false || isSingleton(container, fullName)) && instantiate !== false && shouldInstantiate(container, fullName); + } - /** - Provide a specific instance of jQuery. This is useful in conjunction with - the `document` option, as it allows you to use a copy of `jQuery` that is - appropriately bound to the foreign `document` (e.g. a jsdom). - This is highly experimental and support very incomplete at the moment. - @property jQuery - @type Object - @default auto-detected - @private - */ - this.jQuery = _emberViews.jQuery; // This default is overridable below + function instantiateFactory(container, fullName, options) { + var factoryManager = container[FACTORY_FOR](fullName); - /** - Interactive mode: whether we need to set up event delegation and invoke - lifecycle callbacks on Components. - @property isInteractive - @type boolean - @default auto-detected - @private - */ - this.isInteractive = _emberEnvironment.environment.hasDOM; // This default is overridable below + if (factoryManager === undefined) { + return; + } - /** - Run in a full browser environment. - When this flag is set to `false`, it will disable most browser-specific - and interactive features. Specifically: - * It does not use `jQuery` to append the root view; the `rootElement` - (either specified as a subsequent option or on the application itself) - must already be an `Element` in the given `document` (as opposed to a - string selector). - * It does not set up an `EventDispatcher`. - * It does not run any `Component` lifecycle hooks (such as `didInsertElement`). - * It sets the `location` option to `"none"`. (If you would like to use - the location adapter specified in the app's router instead, you can also - specify `{ location: null }` to specifically opt-out.) - @property isBrowser - @type boolean - @default auto-detected - @public - */ - if (options.isBrowser !== undefined) { - this.isBrowser = !!options.isBrowser; - } else { - this.isBrowser = _emberEnvironment.environment.hasDOM; + // SomeClass { singleton: true, instantiate: true } | { singleton: true } | { instantiate: true } | {} + // By default majority of objects fall into this case + if (isSingletonInstance(container, fullName, options)) { + return container.cache[fullName] = factoryManager.create(); } - if (!this.isBrowser) { - this.jQuery = null; - this.isInteractive = false; - this.location = 'none'; + // SomeClass { singleton: false, instantiate: true } + if (isFactoryInstance(container, fullName, options)) { + return factoryManager.create(); } - /** - Disable rendering completely. - When this flag is set to `true`, it will disable the entire rendering - pipeline. Essentially, this puts the app into "routing-only" mode. No - templates will be rendered, and no Components will be created. - @property shouldRender - @type boolean - @default true - @public - */ - if (options.shouldRender !== undefined) { - this.shouldRender = !!options.shouldRender; - } else { - this.shouldRender = true; + // SomeClass { singleton: true, instantiate: false } | { instantiate: false } | { singleton: false, instantiation: false } + if (isSingletonClass(container, fullName, options) || isFactoryClass(container, fullName, options)) { + return factoryManager.class; } - if (!this.shouldRender) { - this.jQuery = null; - this.isInteractive = false; + throw new Error('Could not create factory'); + } + + function markInjectionsAsDynamic(injections) { + injections._dynamic = true; + } + + function areInjectionsDynamic(injections) { + return !!injections._dynamic; + } + + function buildInjections() /* container, ...injections */{ + var hash = {}; + + if (arguments.length > 1) { + var container = arguments[0]; + var injections = []; + var injection = undefined; + + for (var i = 1; i < arguments.length; i++) { + if (arguments[i]) { + injections = injections.concat(arguments[i]); + } + } + + for (var i = 0; i < injections.length; i++) { + injection = injections[i]; + hash[injection.property] = lookup(container, injection.fullName); + if (!isSingleton(container, injection.fullName)) { + markInjectionsAsDynamic(hash); + } + } } - /** - If present, render into the given `Document` object instead of the - global `window.document` object. - In practice, this is only useful in non-browser environment or in - non-interactive mode, because Ember's `jQuery` dependency is - implicitly bound to the current document, causing event delegation - to not work properly when the app is rendered into a foreign - document object (such as an iframe's `contentDocument`). - In non-browser mode, this could be a "`Document`-like" object as - Ember only interact with a small subset of the DOM API in non- - interactive mode. While the exact requirements have not yet been - formalized, the `SimpleDOM` library's implementation is known to - work. - @property document - @type Document - @default the global `document` object - @public - */ - if (options.document) { - this.document = options.document; - } else { - this.document = typeof document !== 'undefined' ? document : null; + return hash; + } + + function deprecatedFactoryFor(container, fullName) { + var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + + var registry = container.registry; + + if (options.source) { + fullName = registry.expandLocalLookup(fullName, options); + // if expandLocalLookup returns falsey, we do not support local lookup + if (!fullName) { + return; + } } - /** - If present, overrides the application's `rootElement` property on - the instance. This is useful for testing environment, where you - might want to append the root view to a fixture area. - In non-browser mode, because Ember does not have access to jQuery, - this options must be specified as a DOM `Element` object instead of - a selector string. - See the documentation on `Ember.Applications`'s `rootElement` for - details. - @property rootElement - @type String|Element - @default null - @public - */ - if (options.rootElement) { - this.rootElement = options.rootElement; + var cache = container.factoryCache; + if (cache[fullName]) { + return cache[fullName]; + } + var factory = registry.resolve(fullName); + if (factory === undefined) { + return; } - // Set these options last to give the user a chance to override the - // defaults from the "combo" options like `isBrowser` (although in - // practice, the resulting combination is probably invalid) + var type = fullName.split(':')[0]; + if (!factory || typeof factory.extend !== 'function' || !_emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS && type === 'model') { + if (factory && typeof factory._onLookup === 'function') { + factory._onLookup(fullName); + } - /** - If present, overrides the router's `location` property with this - value. This is useful for environments where trying to modify the - URL would be inappropriate. - @property location - @type string - @default null - @public - */ - if (options.location !== undefined) { - this.location = options.location; - } + // TODO: think about a 'safe' merge style extension + // for now just fallback to create time injection + cache[fullName] = factory; + return factory; + } else { + var injections = injectionsFor(container, fullName); + var factoryInjections = factoryInjectionsFor(container, fullName); + var cacheable = !areInjectionsDynamic(injections) && !areInjectionsDynamic(factoryInjections); - if (options.jQuery !== undefined) { - this.jQuery = options.jQuery; + factoryInjections[_emberUtils.NAME_KEY] = registry.makeToString(factory, fullName); + + var injectedFactory = factory.extend(injections); + + // TODO - remove all `container` injections when Ember reaches v3.0.0 + injectDeprecatedContainer(injectedFactory.prototype, container); + injectedFactory.reopenClass(factoryInjections); + + if (factory && typeof factory._onLookup === 'function') { + factory._onLookup(fullName); + } + + if (cacheable) { + cache[fullName] = injectedFactory; + } + + return injectedFactory; } + } - if (options.isInteractive !== undefined) { - this.isInteractive = !!options.isInteractive; + function injectionsFor(container, fullName) { + var registry = container.registry; + var splitName = fullName.split(':'); + var type = splitName[0]; + + var injections = buildInjections(container, registry.getTypeInjections(type), registry.getInjections(fullName)); + injections._debugContainerKey = fullName; + + _emberUtils.setOwner(injections, container.owner); + + return injections; + } + + function instantiate(factory, props, container, fullName) { + var lazyInjections = undefined, + validationCache = undefined; + + props = props || {}; + + if (container.registry.getOption(fullName, 'instantiate') === false) { + return factory; } - }; - BootOptions.prototype.toEnvironment = function () { - var env = _emberUtils.assign({}, _emberEnvironment.environment); - // For compatibility with existing code - env.hasDOM = this.isBrowser; - env.isInteractive = this.isInteractive; - env.options = this; - return env; - }; + if (factory) { + if (typeof factory.create !== 'function') { + throw new Error('Failed to create an instance of \'' + fullName + '\'. Most likely an improperly defined class or' + ' an invalid module export.'); + } - Object.defineProperty(ApplicationInstance.prototype, 'container', { - configurable: true, - enumerable: false, - get: function () { - var instance = this; - return { - lookup: function () { - return instance.lookup.apply(instance, arguments); + validationCache = container.validationCache; + + validationCache[fullName] = true; + + var obj = undefined; + + if (typeof factory.extend === 'function') { + // assume the factory was extendable and is already injected + obj = factory.create(props); + } else { + // assume the factory was extendable + // to create time injections + // TODO: support new'ing for instantiation and merge injections for pure JS Functions + var injections = injectionsFor(container, fullName); + + // Ensure that a container is available to an object during instantiation. + // TODO - remove when Ember reaches v3.0.0 + // This "fake" container will be replaced after instantiation with a + // property that raises deprecations every time it is accessed. + injections.container = container._fakeContainerToInject; + obj = factory.create(_emberUtils.assign({}, injections, props)); + + // TODO - remove when Ember reaches v3.0.0 + if (!Object.isFrozen(obj) && 'container' in obj) { + injectDeprecatedContainer(obj, container); } - }; - } - }); + } - Object.defineProperty(ApplicationInstance.prototype, 'registry', { - configurable: true, - enumerable: false, - get: function () { - return _emberRuntime.buildFakeRegistryWithDeprecations(this, 'ApplicationInstance'); + return obj; } - }); + } - exports.default = ApplicationInstance; -}); -enifed('ember-application/system/application', ['exports', 'ember-utils', 'ember-environment', 'ember-metal', 'ember-runtime', 'ember-views', 'ember-routing', 'ember-application/system/application-instance', 'container', 'ember-application/system/engine', 'ember-glimmer'], function (exports, _emberUtils, _emberEnvironment, _emberMetal, _emberRuntime, _emberViews, _emberRouting, _emberApplicationSystemApplicationInstance, _container, _emberApplicationSystemEngine, _emberGlimmer) { - /** - @module ember - @submodule ember-application - */ - 'use strict'; + function factoryInjectionsFor(container, fullName) { + var registry = container.registry; + var splitName = fullName.split(':'); + var type = splitName[0]; - exports._resetLegacyAddonWarnings = _resetLegacyAddonWarnings; + var factoryInjections = buildInjections(container, registry.getFactoryTypeInjections(type), registry.getFactoryInjections(fullName)); + factoryInjections._debugContainerKey = fullName; - var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); + return factoryInjections; + } - var librariesRegistered = false; + // TODO - remove when Ember reaches v3.0.0 + function injectDeprecatedContainer(object, container) { + Object.defineProperty(object, 'container', { + configurable: true, + enumerable: false, + get: function () { + return this[CONTAINER_OVERRIDE] || container; + }, - var warnedAboutLegacyViewAddon = false; - var warnedAboutLegacyControllerAddon = false; + set: function (value) { - // For testing + this[CONTAINER_OVERRIDE] = value; - function _resetLegacyAddonWarnings() { - warnedAboutLegacyViewAddon = false; - warnedAboutLegacyControllerAddon = false; + return value; + } + }); } - /** - An instance of `Ember.Application` is the starting point for every Ember - application. It helps to instantiate, initialize and coordinate the many - objects that make up your app. - - Each Ember app has one and only one `Ember.Application` object. In fact, the - very first thing you should do in your application is create the instance: - - ```javascript - window.App = Ember.Application.create(); - ``` - - Typically, the application object is the only global variable. All other - classes in your app should be properties on the `Ember.Application` instance, - which highlights its first role: a global namespace. - - For example, if you define a view class, it might look like this: - - ```javascript - App.MyView = Ember.View.extend(); - ``` - - By default, calling `Ember.Application.create()` will automatically initialize - your application by calling the `Ember.Application.initialize()` method. If - you need to delay initialization, you can call your app's `deferReadiness()` - method. When you are ready for your app to be initialized, call its - `advanceReadiness()` method. - - You can define a `ready` method on the `Ember.Application` instance, which - will be run by Ember when the application is initialized. - - Because `Ember.Application` inherits from `Ember.Namespace`, any classes - you create will have useful string representations when calling `toString()`. - See the `Ember.Namespace` documentation for more information. - - While you can think of your `Ember.Application` as a container that holds the - other classes in your application, there are several other responsibilities - going on under-the-hood that you may want to understand. - - ### Event Delegation - - Ember uses a technique called _event delegation_. This allows the framework - to set up a global, shared event listener instead of requiring each view to - do it manually. For example, instead of each view registering its own - `mousedown` listener on its associated element, Ember sets up a `mousedown` - listener on the `body`. - - If a `mousedown` event occurs, Ember will look at the target of the event and - start walking up the DOM node tree, finding corresponding views and invoking - their `mouseDown` method as it goes. - - `Ember.Application` has a number of default events that it listens for, as - well as a mapping from lowercase events to camel-cased view method names. For - example, the `keypress` event causes the `keyPress` method on the view to be - called, the `dblclick` event causes `doubleClick` to be called, and so on. - - If there is a bubbling browser event that Ember does not listen for by - default, you can specify custom events and their corresponding view method - names by setting the application's `customEvents` property: - - ```javascript - let App = Ember.Application.create({ - customEvents: { - // add support for the paste event - paste: 'paste' + function eachDestroyable(container, callback) { + var cache = container.cache; + var keys = Object.keys(cache); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = cache[key]; + + if (container.registry.getOption(key, 'instantiate') !== false) { + callback(value); } - }); - ``` - - To prevent Ember from setting up a listener for a default event, - specify the event name with a `null` value in the `customEvents` - property: - - ```javascript - let App = Ember.Application.create({ - customEvents: { - // prevent listeners for mouseenter/mouseleave events - mouseenter: null, - mouseleave: null + } + } + + function resetCache(container) { + eachDestroyable(container, function (value) { + if (value.destroy) { + value.destroy(); } }); - ``` - - By default, the application sets up these event listeners on the document - body. However, in cases where you are embedding an Ember application inside - an existing page, you may want it to set up the listeners on an element - inside the body. - - For example, if only events inside a DOM element with the ID of `ember-app` - should be delegated, set your application's `rootElement` property: - - ```javascript - let App = Ember.Application.create({ - rootElement: '#ember-app' - }); - ``` - - 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 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: - - ```javascript - Ember.Application.initializer({ - name: 'api-adapter', - - initialize: function(application) { - application.register('api-adapter:main', ApiAdapter); + + container.cache.dict = _emberUtils.dictionary(null); + } + + function resetMember(container, fullName) { + var member = container.cache[fullName]; + + delete container.factoryCache[fullName]; + + if (member) { + delete container.cache[fullName]; + + if (member.destroy) { + member.destroy(); } - }); - ``` - - Initializers provide an opportunity to access the internal registry, which - organizes the different components of an Ember application. Additionally - they provide a chance to access the instantiated application. Beyond - being used for libraries, initializers are also a great way to organize - dependency injection or setup in your own application. - - ### Routing - - In addition to creating your application's router, `Ember.Application` is - also responsible for telling the router when to start routing. Transitions - between routes can be logged with the `LOG_TRANSITIONS` flag, and more - detailed intra-transition logging can be logged with - the `LOG_TRANSITIONS_INTERNAL` flag: - - ```javascript - let App = Ember.Application.create({ - LOG_TRANSITIONS: true, // basic logging of successful transitions - LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps - }); - ``` - - By default, the router will begin trying to translate the current URL into - application state once the browser emits the `DOMContentReady` event. If you - need to defer routing, you can call the application's `deferReadiness()` - method. Once routing can begin, call the `advanceReadiness()` method. - - If there is any setup required before routing begins, you can implement a - `ready()` method on your app that will be invoked immediately before routing - begins. - - @class Application - @namespace Ember - @extends Ember.Engine - @uses RegistryProxyMixin - @public - */ + } + } - var Application = _emberApplicationSystemEngine.default.extend({ - _suppressDeferredDeprecation: true, + function buildFakeContainerWithDeprecations(container) { + var fakeContainer = {}; + var propertyMappings = { + lookup: 'lookup', + lookupFactory: '_lookupFactory' + }; - /** - The root DOM element of the Application. This can be specified as an - element or a - [jQuery-compatible selector string](http://api.jquery.com/category/selectors/). - This is the element that will be passed to the Application's, - `eventDispatcher`, which sets up the listeners for event delegation. Every - view in your application should be a child of the element you specify here. - @property rootElement - @type DOMElement - @default 'body' - @public - */ - rootElement: 'body', + for (var containerProperty in propertyMappings) { + fakeContainer[containerProperty] = buildFakeContainerFunction(container, containerProperty, propertyMappings[containerProperty]); + } - /** - The `Ember.EventDispatcher` responsible for delegating events to this - application's views. - The event dispatcher is created by the application at initialization time - and sets up event listeners on the DOM element described by the - application's `rootElement` property. - See the documentation for `Ember.EventDispatcher` for more information. - @property eventDispatcher - @type Ember.EventDispatcher - @default null - @public - */ - eventDispatcher: null, + return fakeContainer; + } - /** - The DOM events for which the event dispatcher should listen. - By default, the application's `Ember.EventDispatcher` listens - for a set of standard DOM events, such as `mousedown` and - `keyup`, and delegates them to your application's `Ember.View` - instances. - If you would like additional bubbling events to be delegated to your - views, set your `Ember.Application`'s `customEvents` property - to a hash containing the DOM event name as the key and the - corresponding view method name as the value. Setting an event to - a value of `null` will prevent a default event listener from being - added for that event. - To add new events to be listened to: - ```javascript - let App = Ember.Application.create({ - customEvents: { - // add support for the paste event - paste: 'paste' - } - }); - ``` - To prevent default events from being listened to: - ```javascript - let App = Ember.Application.create({ - customEvents: { - // remove support for mouseenter / mouseleave events - mouseenter: null, - mouseleave: null - } - }); - ``` - @property customEvents - @type Object - @default null - @public - */ - customEvents: null, + function buildFakeContainerFunction(container, containerProperty, ownerProperty) { + return function () { + return container[containerProperty].apply(container, arguments); + }; + } - /** - Whether the application should automatically start routing and render - templates to the `rootElement` on DOM ready. While default by true, - other environments such as FastBoot or a testing harness can set this - property to `false` and control the precise timing and behavior of the boot - process. - @property autoboot - @type Boolean - @default true - @private - */ - autoboot: true, + var DeprecatedFactoryManager = (function () { + function DeprecatedFactoryManager(container, factory, fullName) { + this.container = container; + this.class = factory; + this.fullName = fullName; + } - /** - Whether the application should be configured for the legacy "globals mode". - Under this mode, the Application object serves as a global namespace for all - classes. - ```javascript - let App = Ember.Application.create({ - ... - }); - App.Router.reopen({ - location: 'none' - }); - App.Router.map({ - ... - }); - App.MyComponent = Ember.Component.extend({ - ... - }); - ``` - This flag also exposes other internal APIs that assumes the existence of - a special "default instance", like `App.__container__.lookup(...)`. - This option is currently not configurable, its value is derived from - the `autoboot` flag – disabling `autoboot` also implies opting-out of - globals mode support, although they are ultimately orthogonal concerns. - Some of the global modes features are already deprecated in 1.x. The - existence of this flag is to untangle the globals mode code paths from - the autoboot code paths, so that these legacy features can be reviewed - for deprecation/removal separately. - Forcing the (autoboot=true, _globalsMode=false) here and running the tests - would reveal all the places where we are still relying on these legacy - behavior internally (mostly just tests). - @property _globalsMode - @type Boolean - @default true - @private - */ - _globalsMode: true, + DeprecatedFactoryManager.prototype.create = function create() { + var props = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - init: function (options) { - this._super.apply(this, arguments); + return instantiate(this.class, props, this.container, this.fullName); + }; - if (!this.$) { - this.$ = _emberViews.jQuery; - } + return DeprecatedFactoryManager; + })(); - registerLibraries(); - logLibraryVersions(); + var FactoryManager = (function () { + function FactoryManager(container, factory, fullName, normalizedName) { + this.container = container; + this.class = factory; + this.fullName = fullName; + this.normalizedName = normalizedName; + } - // Start off the number of deferrals at 1. This will be decremented by - // the Application's own `boot` method. - this._readinessDeferrals = 1; - this._booted = false; + FactoryManager.prototype.create = function create() { + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - this.autoboot = this._globalsMode = !!this.autoboot; + var injections = injectionsFor(this.container, this.normalizedName); + var props = _emberUtils.assign({}, injections, options); - if (this._globalsMode) { - this._prepareForGlobalsMode(); + props[_emberUtils.NAME_KEY] = this.container.registry.makeToString(this.class, this.fullName); + + if (!this.class.create) { + throw new Error('Failed to create an instance of \'' + this.normalizedName + '\'. Most likely an improperly defined class or' + ' an invalid module export.'); } - if (this.autoboot) { - this.waitForDOMReady(); + if (this.class.prototype) { + injectDeprecatedContainer(this.class.prototype, this.container); } - }, - /** - Create an ApplicationInstance for this application. - @private - @method buildInstance - @return {Ember.ApplicationInstance} the application instance - */ - buildInstance: function () { - var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + return this.class.create(props); + }; - options.base = this; - options.application = this; - return _emberApplicationSystemApplicationInstance.default.create(options); - }, + return FactoryManager; + })(); +}); - /** - Enable the legacy globals mode by allowing this application to act - as a global namespace. See the docs on the `_globalsMode` property - for details. - Most of these features are already deprecated in 1.x, so we can - stop using them internally and try to remove them. - @private - @method _prepareForGlobalsMode - */ - _prepareForGlobalsMode: function () { - // 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`. - this.Router = (this.Router || _emberRouting.Router).extend(); +/* + * This internal version of factoryFor swaps between the public API for + * factoryFor (class is the registered class) and a transition implementation + * (class is the double-extended class). It is *not* the public API version + * of factoryFor, which always returns the registered class. + */ - this._buildDeprecatedInstance(); - }, +/** + A depth first traversal, destroying the container, its descendant containers and all + their managed objects. + @private + @method destroy + */ - /* - Build the deprecated instance for legacy globals mode support. - Called when creating and resetting the application. - This is orthogonal to autoboot: the deprecated instance needs to - be created at Application construction (not boot) time to expose - App.__container__. If autoboot sees that this instance exists, - it will continue booting it to avoid doing unncessary work (as - opposed to building a new instance at boot time), but they are - otherwise unrelated. - @private - @method _buildDeprecatedInstance - */ - _buildDeprecatedInstance: function () { - // Build a default instance - var instance = this.buildInstance(); +/** + Clear either the entire cache or just the cache for a particular key. + @private + @method reset + @param {String} fullName optional key to reset; if missing, resets everything + */ - // Legacy support for App.__container__ and other global methods - // on App that rely on a single, default instance. - this.__deprecatedInstance__ = instance; - this.__container__ = instance.__container__; - }, +/** + Returns an object that can be used to provide an owner to a + manually created instance. + @private + @method ownerInjection + @returns { Object } +*/ - /** - Automatically kick-off the boot process for the application once the - DOM has become ready. - The initialization itself is scheduled on the actions queue which - ensures that code-loading finishes before booting. - If you are asynchronously loading code, you should call `deferReadiness()` - to defer booting, and then call `advanceReadiness()` once all of your code - has finished loading. - @private - @method waitForDOMReady - */ - waitForDOMReady: function () { - if (!this.$ || this.$.isReady) { - _emberMetal.run.schedule('actions', this, 'domReady'); - } else { - this.$().ready(_emberMetal.run.bind(this, 'domReady')); - } - }, +// Ensure that all lazy injections are valid at instantiation time - /** - This is the autoboot flow: - 1. Boot the app by calling `this.boot()` - 2. Create an instance (or use the `__deprecatedInstance__` in globals mode) - 3. Boot the instance by calling `instance.boot()` - 4. Invoke the `App.ready()` callback - 5. Kick-off routing on the instance - Ideally, this is all we would need to do: - ```javascript - _autoBoot() { - this.boot().then(() => { - let instance = (this._globalsMode) ? this.__deprecatedInstance__ : this.buildInstance(); - return instance.boot(); - }).then((instance) => { - App.ready(); - instance.startRouting(); - }); - } - ``` - Unfortunately, we cannot actually write this because we need to participate - in the "synchronous" boot process. While the code above would work fine on - the initial boot (i.e. DOM ready), when `App.reset()` is called, we need to - boot a new instance synchronously (see the documentation on `_bootSync()` - for details). - Because of this restriction, the actual logic of this method is located - inside `didBecomeReady()`. - @private - @method domReady - */ - domReady: function () { - if (this.isDestroyed) { - return; - } +// Ensure that all lazy injections are valid at instantiation time +enifed('container/index', ['exports', 'container/registry', 'container/container'], function (exports, _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 + */ - this._bootSync(); + 'use strict'; - // Continues to `didBecomeReady` - }, + exports.Registry = _containerRegistry.default; + exports.privatize = _containerRegistry.privatize; + exports.Container = _containerContainer.default; + exports.buildFakeContainerWithDeprecations = _containerContainer.buildFakeContainerWithDeprecations; + exports.FACTORY_FOR = _containerContainer.FACTORY_FOR; + exports.LOOKUP_FACTORY = _containerContainer.LOOKUP_FACTORY; +}); +enifed('container/registry', ['exports', 'ember-utils', 'ember-metal', 'container/container'], function (exports, _emberUtils, _emberMetal, _containerContainer) { + 'use strict'; - /** - Use this to defer readiness until some condition is true. - Example: - ```javascript - let App = Ember.Application.create(); - App.deferReadiness(); - // Ember.$ is a reference to the jQuery object/function - Ember.$.getJSON('/auth-token', function(token) { - App.token = token; - App.advanceReadiness(); - }); - ``` - This allows you to perform asynchronous setup logic and defer - booting your application until the setup has finished. - However, if the setup requires a loading UI, it might be better - to use the router for this purpose. - @method deferReadiness - @public - */ - deferReadiness: function () { - this._readinessDeferrals++; - }, + exports.default = Registry; + exports.privatize = privatize; - /** - Call `advanceReadiness` after any asynchronous setup logic has completed. - Each call to `deferReadiness` must be matched by a call to `advanceReadiness` - or the application will never become ready and routing will not begin. - @method advanceReadiness - @see {Ember.Application#deferReadiness} - @public - */ - advanceReadiness: function () { - this._readinessDeferrals--; + var VALID_FULL_NAME_REGEXP = /^[^:]+:[^:]+$/; - if (this._readinessDeferrals === 0) { - _emberMetal.run.once(this, this.didBecomeReady); - } - }, + /** + A registry used to store factory and option information keyed + by type. + + A `Registry` stores the factory and option information needed by a + `Container` to instantiate and cache objects. + + The API for `Registry` is still in flux and should not be considered stable. + + @private + @class Registry + @since 1.11.0 + */ - /** - Initialize the application and return a promise that resolves with the `Ember.Application` - object when the boot process is complete. - Run any application 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. - By default, this method is called automatically on "DOM ready"; however, if autoboot - is disabled, this is automatically called when the first application instance is - created via `visit`. - @private - @method boot - @return {Promise} - */ - boot: function () { - if (this._bootPromise) { - return this._bootPromise; - } + function Registry(options) { + this.fallback = options && options.fallback ? options.fallback : null; - try { - this._bootSync(); - } catch (_) { - // Ignore th error: in the asynchronous boot path, the error is already reflected - // in the promise rejection + if (options && options.resolver) { + this.resolver = options.resolver; + + if (typeof this.resolver === 'function') { + deprecateResolverFunction(this); } + } - return this._bootPromise; - }, + this.registrations = _emberUtils.dictionary(options && options.registrations ? options.registrations : null); - /** - Unfortunately, a lot of existing code assumes the booting process is - "synchronous". Specifically, a lot of tests assumes the last call to - `app.advanceReadiness()` or `app.reset()` will result in the app being - fully-booted when the current runloop completes. - We would like new code (like the `visit` API) to stop making this assumption, - so we created the asynchronous version above that returns a promise. But until - we have migrated all the code, we would have to expose this method for use - *internally* in places where we need to boot an app "synchronously". - @private - */ - _bootSync: function () { - if (this._booted) { - return; - } + this._typeInjections = _emberUtils.dictionary(null); + this._injections = _emberUtils.dictionary(null); + this._factoryTypeInjections = _emberUtils.dictionary(null); + this._factoryInjections = _emberUtils.dictionary(null); - // Even though this returns synchronously, we still need to make sure the - // boot promise exists for book-keeping purposes: if anything went wrong in - // the boot process, we need to store the error as a rejection on the boot - // promise so that a future caller of `boot()` can tell what failed. - var defer = this._bootResolver = new _emberRuntime.RSVP.defer(); - this._bootPromise = defer.promise; + this._localLookupCache = new _emberUtils.EmptyObject(); + this._normalizeCache = _emberUtils.dictionary(null); + this._resolveCache = _emberUtils.dictionary(null); + this._failCache = _emberUtils.dictionary(null); - try { - this.runInitializers(); - _emberRuntime.runLoadHooks('application', this); - this.advanceReadiness(); - // Continues to `didBecomeReady` - } catch (error) { - // For the asynchronous boot path - defer.reject(error); + this._options = _emberUtils.dictionary(null); + this._typeOptions = _emberUtils.dictionary(null); + } - // For the synchronous boot path - throw error; - } - }, + Registry.prototype = { + /** + A backup registry for resolving registrations when no matches can be found. + @private + @property fallback + @type Registry + */ + fallback: null, /** - Reset the application. This is typically used only in tests. It cleans up - the application in the following order: - 1. Deactivate existing routes - 2. Destroy all objects in the container - 3. Create a new application container - 4. Re-route to the existing url - Typical Example: - ```javascript - let App; - run(function() { - App = Ember.Application.create(); - }); - module('acceptance test', { - setup: function() { - App.reset(); - } - }); - test('first test', function() { - // App is freshly reset - }); - test('second test', function() { - // App is again freshly reset - }); - ``` - Advanced Example: - Occasionally you may want to prevent the app from initializing during - setup. This could enable extra configuration, or enable asserting prior - to the app becoming ready. - ```javascript - let App; - run(function() { - App = Ember.Application.create(); - }); - module('acceptance test', { - setup: function() { - run(function() { - App.reset(); - App.deferReadiness(); - }); - } - }); - test('first test', function() { - ok(true, 'something before app is initialized'); - run(function() { - App.advanceReadiness(); - }); - ok(true, 'something after app is initialized'); - }); - ``` - @method reset - @public - */ - reset: function () { + An object that has a `resolve` method that resolves a name. + @private + @property resolver + @type Resolver + */ + resolver: null, - var instance = this.__deprecatedInstance__; + /** + @private + @property registrations + @type InheritingDict + */ + registrations: null, - this._readinessDeferrals = 1; - this._bootPromise = null; - this._bootResolver = null; - this._booted = false; + /** + @private + @property _typeInjections + @type InheritingDict + */ + _typeInjections: null, - function handleReset() { - _emberMetal.run(instance, 'destroy'); - this._buildDeprecatedInstance(); - _emberMetal.run.schedule('actions', this, '_bootSync'); - } + /** + @private + @property _injections + @type InheritingDict + */ + _injections: null, - _emberMetal.run.join(this, handleReset); - }, + /** + @private + @property _factoryTypeInjections + @type InheritingDict + */ + _factoryTypeInjections: null, /** - @private - @method didBecomeReady - */ - didBecomeReady: function () { - try { - // TODO: Is this still needed for _globalsMode = false? - if (!_emberMetal.isTesting()) { - // Eagerly name all classes that are already loaded - _emberRuntime.Namespace.processAll(); - _emberRuntime.setNamespaceSearchDisabled(true); - } + @private + @property _factoryInjections + @type InheritingDict + */ + _factoryInjections: null, - // See documentation on `_autoboot()` for details - if (this.autoboot) { - var instance = undefined; + /** + @private + @property _normalizeCache + @type InheritingDict + */ + _normalizeCache: null, - if (this._globalsMode) { - // If we already have the __deprecatedInstance__ lying around, boot it to - // avoid unnecessary work - instance = this.__deprecatedInstance__; - } else { - // Otherwise, build an instance and boot it. This is currently unreachable, - // because we forced _globalsMode to === autoboot; but having this branch - // allows us to locally toggle that flag for weeding out legacy globals mode - // dependencies independently - instance = this.buildInstance(); - } + /** + @private + @property _resolveCache + @type InheritingDict + */ + _resolveCache: null, - instance._bootSync(); + /** + @private + @property _options + @type InheritingDict + */ + _options: null, - // TODO: App.ready() is not called when autoboot is disabled, is this correct? - this.ready(); + /** + @private + @property _typeOptions + @type InheritingDict + */ + _typeOptions: null, - instance.startRouting(); - } + /** + Creates a container based on this registry. + @private + @method container + @param {Object} options + @return {Container} created container + */ + container: function (options) { + return new _containerContainer.default(this, options); + }, - // For the asynchronous boot path - this._bootResolver.resolve(this); + /** + Registers a factory for later injection. + Example: + ```javascript + let registry = new Registry(); + registry.register('model:user', Person, {singleton: false }); + registry.register('fruit:favorite', Orange); + registry.register('communication:main', Email, {singleton: false}); + ``` + @private + @method register + @param {String} fullName + @param {Function} factory + @param {Object} options + */ + register: function (fullName, factory) { + var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; - // For the synchronous boot path - this._booted = true; - } catch (error) { - // For the asynchronous boot path - this._bootResolver.reject(error); + if (factory === undefined) { + throw new TypeError('Attempting to register an unknown factory: \'' + fullName + '\''); + } - // For the synchronous boot path - throw error; + var normalizedName = this.normalize(fullName); + + if (this._resolveCache[normalizedName]) { + throw new Error('Cannot re-register: \'' + fullName + '\', as it has already been resolved.'); } + + delete this._failCache[normalizedName]; + this.registrations[normalizedName] = factory; + this._options[normalizedName] = options; }, /** - Called when the Application has become ready, immediately before routing - begins. The call will be delayed until the DOM has become ready. - @event ready - @public - */ - ready: function () { - return this; - }, + Unregister a fullName + ```javascript + let registry = new Registry(); + registry.register('model:user', User); + registry.resolve('model:user').create() instanceof User //=> true + registry.unregister('model:user') + registry.resolve('model:user') === undefined //=> true + ``` + @private + @method unregister + @param {String} fullName + */ + unregister: function (fullName) { - // This method must be moved to the application instance object - willDestroy: function () { - this._super.apply(this, arguments); - _emberRuntime.setNamespaceSearchDisabled(false); - this._booted = false; - this._bootPromise = null; - this._bootResolver = null; + var normalizedName = this.normalize(fullName); - if (_emberRuntime._loaded.application === this) { - _emberRuntime._loaded.application = undefined; - } + this._localLookupCache = new _emberUtils.EmptyObject(); - if (this._globalsMode && this.__deprecatedInstance__) { - this.__deprecatedInstance__.destroy(); - } + delete this.registrations[normalizedName]; + delete this._resolveCache[normalizedName]; + delete this._failCache[normalizedName]; + delete this._options[normalizedName]; }, /** - Boot a new instance of `Ember.ApplicationInstance` for the current - application and navigate it to the given `url`. Returns a `Promise` that - resolves with the instance when the initial routing and rendering is - complete, or rejects with any error that occured during the boot process. - When `autoboot` is disabled, calling `visit` would first cause the - application to boot, which runs the application initializers. - This method also takes a hash of boot-time configuration options for - customizing the instance's behavior. See the documentation on - `Ember.ApplicationInstance.BootOptions` for details. - `Ember.ApplicationInstance.BootOptions` is an interface class that exists - purely to document the available options; you do not need to construct it - manually. Simply pass a regular JavaScript object containing of the - desired options: - ```javascript - MyApp.visit("/", { location: "none", rootElement: "#container" }); - ``` - ### Supported Scenarios - While the `BootOptions` class exposes a large number of knobs, not all - combinations of them are valid; certain incompatible combinations might - result in unexpected behavior. - For example, booting the instance in the full browser environment - while specifying a foriegn `document` object (e.g. `{ isBrowser: true, - document: iframe.contentDocument }`) does not work correctly today, - largely due to Ember's jQuery dependency. - Currently, there are three officially supported scenarios/configurations. - Usages outside of these scenarios are not guaranteed to work, but please - feel free to file bug reports documenting your experience and any issues - you encountered to help expand support. - #### Browser Applications (Manual Boot) - The setup is largely similar to how Ember works out-of-the-box. Normally, - Ember will boot a default instance for your Application on "DOM ready". - However, you can customize this behavior by disabling `autoboot`. - For example, this allows you to render a miniture demo of your application - into a specific area on your marketing website: - ```javascript - import MyApp from 'my-app'; - $(function() { - let App = MyApp.create({ autoboot: false }); - let options = { - // Override the router's location adapter to prevent it from updating - // the URL in the address bar - location: 'none', - // Override the default `rootElement` on the app to render into a - // specific `div` on the page - rootElement: '#demo' - }; - // Start the app at the special demo URL - App.visit('/demo', options); - }); - ```` - Or perhaps you might want to boot two instances of your app on the same - page for a split-screen multiplayer experience: - ```javascript - import MyApp from 'my-app'; - $(function() { - let App = MyApp.create({ autoboot: false }); - let sessionId = MyApp.generateSessionID(); - let player1 = App.visit(`/matches/join?name=Player+1&session=${sessionId}`, { rootElement: '#left', location: 'none' }); - let player2 = App.visit(`/matches/join?name=Player+2&session=${sessionId}`, { rootElement: '#right', location: 'none' }); - Promise.all([player1, player2]).then(() => { - // Both apps have completed the initial render - $('#loading').fadeOut(); - }); - }); - ``` - Do note that each app instance maintains their own registry/container, so - they will run in complete isolation by default. - #### Server-Side Rendering (also known as FastBoot) - This setup allows you to run your Ember app in a server environment using - Node.js and render its content into static HTML for SEO purposes. - ```javascript - const HTMLSerializer = new SimpleDOM.HTMLSerializer(SimpleDOM.voidMap); - function renderURL(url) { - let dom = new SimpleDOM.Document(); - let rootElement = dom.body; - let options = { isBrowser: false, document: dom, rootElement: rootElement }; - return MyApp.visit(options).then(instance => { - try { - return HTMLSerializer.serialize(rootElement.firstChild); - } finally { - instance.destroy(); - } - }); - } - ``` - In this scenario, because Ember does not have access to a global `document` - object in the Node.js environment, you must provide one explicitly. In practice, - in the non-browser environment, the stand-in `document` object only need to - implement a limited subset of the full DOM API. The `SimpleDOM` library is known - to work. - Since there is no access to jQuery in the non-browser environment, you must also - specify a DOM `Element` object in the same `document` for the `rootElement` option - (as opposed to a selector string like `"body"`). - See the documentation on the `isBrowser`, `document` and `rootElement` properties - on `Ember.ApplicationInstance.BootOptions` for details. - #### Server-Side Resource Discovery - This setup allows you to run the routing layer of your Ember app in a server - environment using Node.js and completely disable rendering. This allows you - to simulate and discover the resources (i.e. AJAX requests) needed to fufill - a given request and eagerly "push" these resources to the client. - ```app/initializers/network-service.js - import BrowserNetworkService from 'app/services/network/browser'; - import NodeNetworkService from 'app/services/network/node'; - // Inject a (hypothetical) service for abstracting all AJAX calls and use - // the appropiate implementaion on the client/server. This also allows the - // server to log all the AJAX calls made during a particular request and use - // that for resource-discovery purpose. - export function initialize(application) { - if (window) { // browser - application.register('service:network', BrowserNetworkService); - } else { // node - application.register('service:network', NodeNetworkService); - } - application.inject('route', 'network', 'service:network'); - }; - export default { - name: 'network-service', - initialize: initialize + Given a fullName return the corresponding factory. + By default `resolve` will retrieve the factory from + the registry. + ```javascript + let registry = new Registry(); + registry.register('api:twitter', Twitter); + registry.resolve('api:twitter') // => Twitter + ``` + Optionally the registry can be provided with a custom resolver. + If provided, `resolve` will first provide the custom resolver + the opportunity to resolve the fullName, otherwise it will fallback + to the registry. + ```javascript + let registry = new Registry(); + registry.resolver = function(fullName) { + // lookup via the module system of choice }; - ``` - ```app/routes/post.js - import Ember from 'ember'; - // An example of how the (hypothetical) service is used in routes. - export default Ember.Route.extend({ - model(params) { - return this.network.fetch(`/api/posts/${params.post_id}.json`); - }, - afterModel(post) { - if (post.isExternalContent) { - return this.network.fetch(`/api/external/?url=${post.externalURL}`); - } else { - return post; - } - } - }); - ``` - ```javascript - // Finally, put all the pieces together - function discoverResourcesFor(url) { - return MyApp.visit(url, { isBrowser: false, shouldRender: false }).then(instance => { - let networkService = instance.lookup('service:network'); - return networkService.requests; // => { "/api/posts/123.json": "..." } - }); - } - ``` - @public - @method visit - @param url {String} The initial URL to navigate to - @param options {Ember.ApplicationInstance.BootOptions} - @return {Promise} - */ - visit: function (url, options) { - var _this = this; - - return this.boot().then(function () { - var instance = _this.buildInstance(); - - return instance.boot(options).then(function () { - return instance.visit(url); - }).catch(function (error) { - _emberMetal.run(instance, 'destroy'); - throw error; - }); - }); - } - }); + // the twitter factory is added to the module system + registry.resolve('api:twitter') // => Twitter + ``` + @private + @method resolve + @param {String} fullName + @param {Object} [options] + @param {String} [options.source] the fullname of the request source (used for local lookups) + @return {Function} fullName's factory + */ + resolve: function (fullName, options) { + var factory = resolve(this, this.normalize(fullName), options); + if (factory === undefined && this.fallback) { + var _fallback; - Object.defineProperty(Application.prototype, 'registry', { - configurable: true, - enumerable: false, - get: function () { - return _emberRuntime.buildFakeRegistryWithDeprecations(this, 'Application'); - } - }); + factory = (_fallback = this.fallback).resolve.apply(_fallback, arguments); + } + return factory; + }, - Application.reopenClass({ /** - This creates a registry with the default Ember naming conventions. - It also configures the registry: - * registered views are created every time they are looked up (they are - not singletons) - * registered templates are not factories; the registered value is - returned directly. - * the router receives the application as its `namespace` property - * all controllers receive the router as their `target` and `controllers` - properties - * 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 - @method buildRegistry - @static - @param {Ember.Application} namespace the application for which to - build the registry - @return {Ember.Registry} the built registry + A hook that can be used to describe how the resolver will + attempt to find the factory. + For example, the default Ember `.describe` returns the full + class name (including namespace) where Ember's resolver expects + to find the `fullName`. @private - */ - buildRegistry: function (application) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - - var registry = this._super.apply(this, arguments); + @method describe + @param {String} fullName + @return {string} described fullName + */ + describe: function (fullName) { + if (this.resolver && this.resolver.lookupDescription) { + return this.resolver.lookupDescription(fullName); + } else if (this.fallback) { + return this.fallback.describe(fullName); + } else { + return fullName; + } + }, - commonSetupRegistry(registry); + /** + A hook to enable custom fullName normalization behaviour + @private + @method normalizeFullName + @param {String} fullName + @return {string} normalized fullName + */ + normalizeFullName: function (fullName) { + if (this.resolver && this.resolver.normalize) { + return this.resolver.normalize(fullName); + } else if (this.fallback) { + return this.fallback.normalizeFullName(fullName); + } else { + return fullName; + } + }, - _emberGlimmer.setupApplicationRegistry(registry); + /** + Normalize a fullName based on the application's conventions + @private + @method normalize + @param {String} fullName + @return {string} normalized fullName + */ + normalize: function (fullName) { + return this._normalizeCache[fullName] || (this._normalizeCache[fullName] = this.normalizeFullName(fullName)); + }, - return registry; - } - }); - - function commonSetupRegistry(registry) { - registry.register('-view-registry:main', { create: function () { - return _emberUtils.dictionary(null); - } }); - - registry.register('route:basic', _emberRouting.Route); - registry.register('event_dispatcher:main', _emberViews.EventDispatcher); - - registry.injection('router:main', 'namespace', 'application:main'); - - registry.register('location:auto', _emberRouting.AutoLocation); - registry.register('location:hash', _emberRouting.HashLocation); - registry.register('location:history', _emberRouting.HistoryLocation); - registry.register('location:none', _emberRouting.NoneLocation); - - registry.register(_container.privatize(_templateObject), _emberRouting.BucketCache); - } - - function registerLibraries() { - if (!librariesRegistered) { - librariesRegistered = true; - - if (_emberEnvironment.environment.hasDOM && typeof _emberViews.jQuery === 'function') { - _emberMetal.libraries.registerCoreLibrary('jQuery', _emberViews.jQuery().jquery); + /** + @method makeToString + @private + @param {any} factory + @param {string} fullName + @return {function} toString function + */ + makeToString: function (factory, fullName) { + if (this.resolver && this.resolver.makeToString) { + return this.resolver.makeToString(factory, fullName); + } else if (this.fallback) { + return this.fallback.makeToString(factory, fullName); + } else { + return factory.toString(); } - } - } - - function logLibraryVersions() { - if (_emberEnvironment.ENV.LOG_VERSION) { - // we only need to see this once per Application#init - _emberEnvironment.ENV.LOG_VERSION = false; - var libs = _emberMetal.libraries._registry; - - var nameLengths = libs.map(function (item) { - return _emberMetal.get(item, 'name.length'); - }); - - var maxNameLength = Math.max.apply(this, nameLengths); + }, - for (var i = 0; i < libs.length; i++) { - var lib = libs[i]; - var spaces = new Array(maxNameLength - lib.name.length + 1).join(' '); + /** + Given a fullName check if the container is aware of its factory + or singleton instance. + @private + @method has + @param {String} fullName + @param {Object} [options] + @param {String} [options.source] the fullname of the request source (used for local lookups) + @return {Boolean} + */ + has: function (fullName, options) { + if (!this.isValidFullName(fullName)) { + return false; } - } - } - exports.default = Application; -}); -enifed('ember-application/system/engine-instance', ['exports', 'ember-utils', 'ember-runtime', 'ember-metal', 'container', 'ember-application/system/engine-parent'], function (exports, _emberUtils, _emberRuntime, _emberMetal, _container, _emberApplicationSystemEngineParent) { - /** - @module ember - @submodule ember-application - */ - - 'use strict'; - - var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); + var source = options && options.source && this.normalize(options.source); - /** - The `EngineInstance` encapsulates all of the stateful aspects of a - running `Engine`. - - @public - @class Ember.EngineInstance - @extends Ember.Object - @uses RegistryProxyMixin - @uses ContainerProxyMixin - */ + return has(this, this.normalize(fullName), source); + }, - var EngineInstance = _emberRuntime.Object.extend(_emberRuntime.RegistryProxyMixin, _emberRuntime.ContainerProxyMixin, { /** - The base `Engine` for which this is an instance. - @property {Ember.Engine} engine + Allow registering options for all factories of a type. + ```javascript + let registry = new Registry(); + let container = registry.container(); + // if all of type `connection` must not be singletons + registry.optionsForType('connection', { singleton: false }); + registry.register('connection:twitter', TwitterConnection); + registry.register('connection:facebook', FacebookConnection); + let twitter = container.lookup('connection:twitter'); + let twitter2 = container.lookup('connection:twitter'); + twitter === twitter2; // => false + let facebook = container.lookup('connection:facebook'); + let facebook2 = container.lookup('connection:facebook'); + facebook === facebook2; // => false + ``` @private - */ - base: null, - - init: function () { - this._super.apply(this, arguments); - - _emberUtils.guidFor(this); - - var base = this.base; + @method optionsForType + @param {String} type + @param {Object} options + */ + optionsForType: function (type, options) { + this._typeOptions[type] = options; + }, - if (!base) { - base = this.application; - this.base = base; + getOptionsForType: function (type) { + var optionsForType = this._typeOptions[type]; + if (optionsForType === undefined && this.fallback) { + optionsForType = this.fallback.getOptionsForType(type); } + return optionsForType; + }, - // Create a per-instance registry that will use the application's registry - // as a fallback for resolving registrations. - var registry = this.__registry__ = new _container.Registry({ - fallback: base.__registry__ - }); + /** + @private + @method options + @param {String} fullName + @param {Object} options + */ + options: function (fullName) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - // Create a per-instance container from the instance's registry - this.__container__ = registry.container({ owner: this }); + var normalizedName = this.normalize(fullName); + this._options[normalizedName] = options; + }, - this._booted = false; + getOptions: function (fullName) { + var normalizedName = this.normalize(fullName); + var options = this._options[normalizedName]; + + if (options === undefined && this.fallback) { + options = this.fallback.getOptions(fullName); + } + return options; }, - /** - Initialize the `Ember.EngineInstance` and return a promise that resolves - with the instance itself when the boot process is complete. - The primary task here is to run any registered instance initializers. - See the documentation on `BootOptions` for the options it takes. - @private - @method boot - @param options {Object} - @return {Promise} - */ - boot: function (options) { - var _this = this; + getOption: function (fullName, optionName) { + var options = this._options[fullName]; - if (this._bootPromise) { - return this._bootPromise; + if (options && options[optionName] !== undefined) { + return options[optionName]; } - this._bootPromise = new _emberRuntime.RSVP.Promise(function (resolve) { - return resolve(_this._bootSync(options)); - }); + var type = fullName.split(':')[0]; + options = this._typeOptions[type]; - return this._bootPromise; + if (options && options[optionName] !== undefined) { + return options[optionName]; + } else if (this.fallback) { + return this.fallback.getOption(fullName, optionName); + } }, /** - Unfortunately, a lot of existing code assumes booting an instance is - synchronous – specifically, a lot of tests assume the last call to - `app.advanceReadiness()` or `app.reset()` will result in a new instance - being fully-booted when the current runloop completes. - We would like new code (like the `visit` API) to stop making this - assumption, so we created the asynchronous version above that returns a - promise. But until we have migrated all the code, we would have to expose - this method for use *internally* in places where we need to boot an instance - synchronously. - @private - */ - _bootSync: function (options) { - if (this._booted) { - return this; + 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. + For example, provided each object of type `controller` needed a `router`. + one would do the following: + ```javascript + let registry = new Registry(); + let container = registry.container(); + registry.register('router:main', Router); + registry.register('controller:user', UserController); + registry.register('controller:post', PostController); + registry.typeInjection('controller', 'router', 'router:main'); + let user = container.lookup('controller:user'); + let post = container.lookup('controller:post'); + user.router instanceof Router; //=> true + post.router instanceof Router; //=> true + // both controllers share the same router + user.router === post.router; //=> true + ``` + @private + @method typeInjection + @param {String} type + @param {String} property + @param {String} fullName + */ + typeInjection: function (type, property, fullName) { + + var fullNameType = fullName.split(':')[0]; + if (fullNameType === type) { + throw new Error('Cannot inject a \'' + fullName + '\' on other ' + type + '(s).'); } - this.cloneParentDependencies(); + var injections = this._typeInjections[type] || (this._typeInjections[type] = []); - this.setupRegistry(options); + injections.push({ + property: property, + fullName: fullName + }); + }, - this.base.runInstanceInitializers(this); + /** + Defines injection rules. + These rules are used to inject dependencies onto objects when they + are instantiated. + Two forms of injections are possible: + * Injecting one fullName on another fullName + * Injecting one fullName on a type + Example: + ```javascript + let registry = new Registry(); + let container = registry.container(); + registry.register('source:main', Source); + registry.register('model:user', User); + registry.register('model:post', Post); + // injecting one fullName on another fullName + // eg. each user model gets a post model + registry.injection('model:user', 'post', 'model:post'); + // injecting one fullName on another type + registry.injection('model', 'source', 'source:main'); + let user = container.lookup('model:user'); + let post = container.lookup('model:post'); + user.source instanceof Source; //=> true + post.source instanceof Source; //=> true + user.post instanceof Post; //=> true + // and both models share the same source + user.source === post.source; //=> true + ``` + @private + @method injection + @param {String} factoryName + @param {String} property + @param {String} injectionName + */ + injection: function (fullName, property, injectionName) { + this.validateFullName(injectionName); + var normalizedInjectionName = this.normalize(injectionName); - this._booted = true; + if (fullName.indexOf(':') === -1) { + return this.typeInjection(fullName, property, normalizedInjectionName); + } - return this; - }, + var normalizedName = this.normalize(fullName); - setupRegistry: function () { - var options = arguments.length <= 0 || arguments[0] === undefined ? this.__container__.lookup('-environment:main') : arguments[0]; + var injections = this._injections[normalizedName] || (this._injections[normalizedName] = []); - this.constructor.setupRegistry(this.__registry__, options); + injections.push({ + property: property, + fullName: normalizedInjectionName + }); }, /** - Unregister a factory. - Overrides `RegistryProxy#unregister` in order to clear any cached instances - of the unregistered factory. - @public - @method unregister + Used only via `factoryInjection`. + Provides a specialized form of injection, specifically enabling + all factory of one type to be injected with a reference to another + object. + For example, provided each factory of type `model` needed a `store`. + one would do the following: + ```javascript + let registry = new Registry(); + registry.register('store:main', SomeStore); + registry.factoryTypeInjection('model', 'store', 'store:main'); + let store = registry.lookup('store:main'); + let UserFactory = registry.lookupFactory('model:user'); + UserFactory.store instanceof SomeStore; //=> true + ``` + @private + @method factoryTypeInjection + @param {String} type + @param {String} property @param {String} fullName */ - unregister: function (fullName) { - this.__container__.reset(fullName); - this._super.apply(this, arguments); - }, + factoryTypeInjection: function (type, property, fullName) { + var injections = this._factoryTypeInjections[type] || (this._factoryTypeInjections[type] = []); - /** - @private - */ - willDestroy: function () { - this._super.apply(this, arguments); - _emberMetal.run(this.__container__, 'destroy'); + injections.push({ + property: property, + fullName: this.normalize(fullName) + }); }, /** - 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]; + Defines factory injection rules. + Similar to regular injection rules, but are run against factories, via + `Registry#lookupFactory`. + These rules are used to inject objects onto factories when they + are looked up. + Two forms of injections are possible: + * Injecting one fullName on another fullName + * Injecting one fullName on a type + Example: + ```javascript + let registry = new Registry(); + let container = registry.container(); + registry.register('store:main', Store); + registry.register('store:secondary', OtherStore); + registry.register('model:user', User); + registry.register('model:post', Post); + // injecting one fullName on another type + registry.factoryInjection('model', 'store', 'store:main'); + // injecting one fullName on another fullName + registry.factoryInjection('model:post', 'secondaryStore', 'store:secondary'); + let UserFactory = container.lookupFactory('model:user'); + let PostFactory = container.lookupFactory('model:post'); + let store = container.lookup('store:main'); + UserFactory.store instanceof Store; //=> true + UserFactory.secondaryStore instanceof OtherStore; //=> false + PostFactory.store instanceof Store; //=> true + PostFactory.secondaryStore instanceof OtherStore; //=> true + // and both models share the same source instance + UserFactory.store === PostFactory.store; //=> true + ``` + @private + @method factoryInjection + @param {String} factoryName + @param {String} property + @param {String} injectionName + */ + factoryInjection: function (fullName, property, injectionName) { + var normalizedName = this.normalize(fullName); + var normalizedInjectionName = this.normalize(injectionName); - var Engine = this.lookup('engine:' + name); + this.validateFullName(injectionName); - if (!Engine) { - throw new _emberMetal.Error('You attempted to mount the engine \'' + name + '\', but it is not registered with its parent.'); + if (fullName.indexOf(':') === -1) { + return this.factoryTypeInjection(normalizedName, property, normalizedInjectionName); } - var engineInstance = Engine.buildInstance(options); - - _emberApplicationSystemEngineParent.setEngineParent(engineInstance, this); + var injections = this._factoryInjections[normalizedName] || (this._factoryInjections[normalizedName] = []); - return engineInstance; + injections.push({ + property: property, + fullName: normalizedInjectionName + }); }, /** - Clone dependencies shared between an engine instance and its parent. - @private - @method cloneParentDependencies + @private + @method knownForType + @param {String} type the type to iterate over */ - cloneParentDependencies: function () { - var _this2 = this; + knownForType: function (type) { + var fallbackKnown = undefined, + resolverKnown = undefined; - var parent = _emberApplicationSystemEngineParent.getEngineParent(this); + var localKnown = _emberUtils.dictionary(null); + var registeredNames = Object.keys(this.registrations); + for (var index = 0; index < registeredNames.length; index++) { + var fullName = registeredNames[index]; + var itemType = fullName.split(':')[0]; - var registrations = ['route:basic', 'event_dispatcher:main', 'service:-routing', 'service:-glimmer-environment']; + if (itemType === type) { + localKnown[fullName] = true; + } + } - registrations.forEach(function (key) { - return _this2.register(key, parent.resolveRegistration(key)); - }); + if (this.fallback) { + fallbackKnown = this.fallback.knownForType(type); + } - var env = parent.lookup('-environment:main'); - this.register('-environment:main', env, { instantiate: false }); + if (this.resolver && this.resolver.knownForType) { + resolverKnown = this.resolver.knownForType(type); + } - var singletons = ['router:main', _container.privatize(_templateObject), '-view-registry:main', 'renderer:-' + (env.isInteractive ? 'dom' : 'inert')]; + return _emberUtils.assign({}, fallbackKnown, localKnown, resolverKnown); + }, - singletons.forEach(function (key) { - return _this2.register(key, parent.lookup(key), { instantiate: false }); - }); + validateFullName: function (fullName) { + if (!this.isValidFullName(fullName)) { + throw new TypeError('Invalid Fullname, expected: \'type:name\' got: ' + fullName); + } - this.inject('view', '_environment', '-environment:main'); - this.inject('route', '_environment', '-environment:main'); - } - }); + return true; + }, - EngineInstance.reopenClass({ - /** - @private - @method setupRegistry - @param {Registry} registry - @param {BootOptions} options - */ - setupRegistry: function (registry, options) { - // when no options/environment is present, do nothing - if (!options) { + isValidFullName: function (fullName) { + return !!VALID_FULL_NAME_REGEXP.test(fullName); + }, + + validateInjections: function (injections) { + if (!injections) { return; } - registry.injection('view', '_environment', '-environment:main'); - registry.injection('route', '_environment', '-environment:main'); + var fullName = undefined; - if (options.isInteractive) { - registry.injection('view', 'renderer', 'renderer:-dom'); - registry.injection('component', 'renderer', 'renderer:-dom'); - } else { - registry.injection('view', 'renderer', 'renderer:-inert'); - registry.injection('component', 'renderer', 'renderer:-inert'); + for (var i = 0; i < injections.length; i++) { + fullName = injections[i].fullName; } - } - }); + }, - exports.default = EngineInstance; -}); -enifed('ember-application/system/engine-parent', ['exports', 'ember-utils'], function (exports, _emberUtils) { - 'use strict'; + normalizeInjectionsHash: function (hash) { + var injections = []; - exports.getEngineParent = getEngineParent; - exports.setEngineParent = setEngineParent; - var ENGINE_PARENT = _emberUtils.symbol('ENGINE_PARENT'); + for (var key in hash) { + if (hash.hasOwnProperty(key)) { - exports.ENGINE_PARENT = ENGINE_PARENT; - /** - `getEngineParent` retrieves an engine instance's parent instance. - - @method getEngineParent - @param {EngineInstance} engine An engine instance. - @return {EngineInstance} The parent engine instance. - @for Ember - @public - */ + injections.push({ + property: key, + fullName: hash[key] + }); + } + } - function getEngineParent(engine) { - return engine[ENGINE_PARENT]; - } + return injections; + }, - /** - `setEngineParent` sets an engine instance's parent instance. - - @method setEngineParent - @param {EngineInstance} engine An engine instance. - @param {EngineInstance} parent The parent engine instance. - @private - */ + getInjections: function (fullName) { + var injections = this._injections[fullName] || []; + if (this.fallback) { + injections = injections.concat(this.fallback.getInjections(fullName)); + } + return injections; + }, - function setEngineParent(engine, parent) { - engine[ENGINE_PARENT] = parent; + getTypeInjections: function (type) { + var injections = this._typeInjections[type] || []; + if (this.fallback) { + injections = injections.concat(this.fallback.getTypeInjections(type)); + } + return injections; + }, + + getFactoryInjections: function (fullName) { + var injections = this._factoryInjections[fullName] || []; + if (this.fallback) { + injections = injections.concat(this.fallback.getFactoryInjections(fullName)); + } + return injections; + }, + + getFactoryTypeInjections: function (type) { + var injections = this._factoryTypeInjections[type] || []; + if (this.fallback) { + injections = injections.concat(this.fallback.getFactoryTypeInjections(type)); + } + return injections; + } + }; + + function deprecateResolverFunction(registry) { + registry.resolver = { + resolve: registry.resolver + }; + } + + /** + Given a fullName and a source fullName returns the fully resolved + fullName. Used to allow for local lookup. + + ```javascript + let registry = new Registry(); + + // the twitter factory is added to the module system + registry.expandLocalLookup('component:post-title', { source: 'template:post' }) // => component:post/post-title + ``` + + @private + @method expandLocalLookup + @param {String} fullName + @param {Object} [options] + @param {String} [options.source] the fullname of the request source (used for local lookups) + @return {String} fullName + */ + Registry.prototype.expandLocalLookup = function Registry_expandLocalLookup(fullName, options) { + if (this.resolver && this.resolver.expandLocalLookup) { + + var normalizedFullName = this.normalize(fullName); + var normalizedSource = this.normalize(options.source); + + return expandLocalLookup(this, normalizedFullName, normalizedSource); + } else if (this.fallback) { + return this.fallback.expandLocalLookup(fullName, options); + } else { + return null; + } + }; + + function expandLocalLookup(registry, normalizedName, normalizedSource) { + var cache = registry._localLookupCache; + var normalizedNameCache = cache[normalizedName]; + + if (!normalizedNameCache) { + normalizedNameCache = cache[normalizedName] = new _emberUtils.EmptyObject(); + } + + var cached = normalizedNameCache[normalizedSource]; + + if (cached !== undefined) { + return cached; + } + + var expanded = registry.resolver.expandLocalLookup(normalizedName, normalizedSource); + + return normalizedNameCache[normalizedSource] = expanded; + } + + function resolve(registry, normalizedName, options) { + if (options && options.source) { + // when `source` is provided expand normalizedName + // and source into the full normalizedName + normalizedName = registry.expandLocalLookup(normalizedName, options); + + // if expandLocalLookup returns falsey, we do not support local lookup + if (!normalizedName) { + return; + } + } + + var cached = registry._resolveCache[normalizedName]; + if (cached !== undefined) { + return cached; + } + if (registry._failCache[normalizedName]) { + return; + } + + var resolved = undefined; + + if (registry.resolver) { + resolved = registry.resolver.resolve(normalizedName); + } + + if (resolved === undefined) { + resolved = registry.registrations[normalizedName]; + } + + if (resolved === undefined) { + registry._failCache[normalizedName] = true; + } else { + registry._resolveCache[normalizedName] = resolved; + } + + return resolved; + } + + function has(registry, fullName, source) { + return registry.resolve(fullName, { source: source }) !== undefined; + } + + var privateNames = _emberUtils.dictionary(null); + var privateSuffix = '' + Math.random() + Date.now(); + + function privatize(_ref) { + var fullName = _ref[0]; + + var name = privateNames[fullName]; + if (name) { + return name; + } + + var _fullName$split = fullName.split(':'); + + var type = _fullName$split[0]; + var rawName = _fullName$split[1]; + + return privateNames[fullName] = _emberUtils.intern(type + ':' + rawName + '-' + privateSuffix); } }); -enifed('ember-application/system/engine', ['exports', 'ember-utils', 'ember-runtime', 'container', 'dag-map', 'ember-metal', 'ember-application/system/resolver', 'ember-application/system/engine-instance', 'ember-routing', 'ember-extension-support', 'ember-views', 'ember-glimmer'], function (exports, _emberUtils, _emberRuntime, _container, _dagMap, _emberMetal, _emberApplicationSystemResolver, _emberApplicationSystemEngineInstance, _emberRouting, _emberExtensionSupport, _emberViews, _emberGlimmer) { +enifed('dag-map', ['exports'], function (exports) { 'use strict'; + +/** + * A map of key/value pairs with dependencies contraints that can be traversed + * in topological order and is checked for cycles. + * + * @class DAG + * @constructor + */ +var DAG = (function () { + function DAG() { + this._vertices = new Vertices(); + } + /** + * Adds a key/value pair with dependencies on other key/value pairs. + * + * @public + * @method addEdges + * @param {string[]} key The key of the vertex to be added. + * @param {any} value The value of that vertex. + * @param {string[]|string|undefined} before A key or array of keys of the vertices that must + * be visited before this vertex. + * @param {string[]|string|undefined} after An string or array of strings with the keys of the + * vertices that must be after this vertex is visited. + */ + DAG.prototype.add = function (key, value, before, after) { + var vertices = this._vertices; + var v = vertices.add(key); + v.val = value; + if (before) { + if (typeof before === "string") { + vertices.addEdge(v, vertices.add(before)); + } + else { + for (var i = 0; i < before.length; i++) { + vertices.addEdge(v, vertices.add(before[i])); + } + } + } + if (after) { + if (typeof after === "string") { + vertices.addEdge(vertices.add(after), v); + } + else { + for (var i = 0; i < after.length; i++) { + vertices.addEdge(vertices.add(after[i]), v); + } + } + } + }; + /** + * Visits key/value pairs in topological order. + * + * @public + * @method topsort + * @param {Function} fn The function to be invoked with each key/value. + */ + DAG.prototype.topsort = function (callback) { + this._vertices.topsort(callback); + }; + return DAG; +}()); +var Vertices = (function () { + function Vertices() { + this.stack = new IntStack(); + this.result = new IntStack(); + this.vertices = []; + } + Vertices.prototype.add = function (key) { + if (!key) + throw new Error("missing key"); + var vertices = this.vertices; + var i = 0; + var vertex; + for (; i < vertices.length; i++) { + vertex = vertices[i]; + if (vertex.key === key) + return vertex; + } + return vertices[i] = { + id: i, + key: key, + val: null, + inc: null, + out: false, + mark: false + }; + }; + Vertices.prototype.addEdge = function (v, w) { + this.check(v, w.key); + var inc = w.inc; + if (!inc) { + w.inc = [v.id]; + } + else { + var i = 0; + for (; i < inc.length; i++) { + if (inc[i] === v.id) + return; + } + inc[i] = v.id; + } + v.out = true; + }; + Vertices.prototype.topsort = function (cb) { + this.reset(); + var vertices = this.vertices; + for (var i = 0; i < vertices.length; i++) { + var vertex = vertices[i]; + if (vertex.out) + continue; + this.visit(vertex, undefined); + } + this.each(cb); + }; + Vertices.prototype.check = function (v, w) { + if (v.key === w) { + throw new Error("cycle detected: " + w + " <- " + w); + } + var inc = v.inc; + // quick check + if (!inc || inc.length === 0) + return; + var vertices = this.vertices; + // shallow check + for (var i = 0; i < inc.length; i++) { + var key = vertices[inc[i]].key; + if (key === w) { + throw new Error("cycle detected: " + w + " <- " + v.key + " <- " + w); + } + } + // deep check + this.reset(); + this.visit(v, w); + if (this.result.len > 0) { + var msg_1 = "cycle detected: " + w; + this.each(function (key) { + msg_1 += " <- " + key; + }); + throw new Error(msg_1); + } + }; + Vertices.prototype.each = function (cb) { + var _a = this, result = _a.result, vertices = _a.vertices; + for (var i = 0; i < result.len; i++) { + var vertex = vertices[result.stack[i]]; + cb(vertex.key, vertex.val); + } + }; + // reuse between cycle check and topsort + Vertices.prototype.reset = function () { + this.stack.len = 0; + this.result.len = 0; + var vertices = this.vertices; + for (var i = 0; i < vertices.length; i++) { + vertices[i].mark = false; + } + }; + Vertices.prototype.visit = function (start, search) { + var _a = this, stack = _a.stack, result = _a.result, vertices = _a.vertices; + stack.push(start.id); + while (stack.len) { + var index = stack.pop(); + if (index < 0) { + index = ~index; + if (search) { + result.pop(); + } + else { + result.push(index); + } + } + else { + var vertex = vertices[index]; + if (vertex.mark) { + continue; + } + if (search) { + result.push(index); + if (search === vertex.key) { + return; + } + } + vertex.mark = true; + stack.push(~index); + var incoming = vertex.inc; + if (incoming) { + var i = incoming.length; + while (i--) { + index = incoming[i]; + if (!vertices[index].mark) { + stack.push(index); + } + } + } + } + } + }; + return Vertices; +}()); +var IntStack = (function () { + function IntStack() { + this.stack = [0, 0, 0, 0, 0, 0]; + this.len = 0; + } + IntStack.prototype.push = function (n) { + this.stack[this.len++] = n; + }; + IntStack.prototype.pop = function () { + return this.stack[--this.len]; + }; + return IntStack; +}()); + +exports['default'] = DAG; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}); +enifed('ember-application/index', ['exports', 'ember-application/initializers/dom-templates', 'ember-application/system/application', 'ember-application/system/application-instance', 'ember-application/system/resolver', 'ember-application/system/engine', 'ember-application/system/engine-instance', 'ember-application/system/engine-parent'], function (exports, _emberApplicationInitializersDomTemplates, _emberApplicationSystemApplication, _emberApplicationSystemApplicationInstance, _emberApplicationSystemResolver, _emberApplicationSystemEngine, _emberApplicationSystemEngineInstance, _emberApplicationSystemEngineParent) { /** @module ember @submodule ember-application */ + 'use strict'; - var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); + exports.Application = _emberApplicationSystemApplication.default; + exports.ApplicationInstance = _emberApplicationSystemApplicationInstance.default; + exports.Resolver = _emberApplicationSystemResolver.default; + exports.Engine = _emberApplicationSystemEngine.default; + exports.EngineInstance = _emberApplicationSystemEngineInstance.default; + exports.getEngineParent = _emberApplicationSystemEngineParent.getEngineParent; + exports.setEngineParent = _emberApplicationSystemEngineParent.setEngineParent; - function props(obj) { - var properties = []; + // add domTemplates initializer (only does something if `ember-template-compiler` + // is loaded already) +}); +enifed('ember-application/initializers/dom-templates', ['exports', 'require', 'ember-glimmer', 'ember-environment', 'ember-application/system/application'], function (exports, _require, _emberGlimmer, _emberEnvironment, _emberApplicationSystemApplication) { + 'use strict'; - for (var key in obj) { - properties.push(key); + var bootstrap = function () {}; + + _emberApplicationSystemApplication.default.initializer({ + name: 'domTemplates', + initialize: function () { + var bootstrapModuleId = 'ember-template-compiler/system/bootstrap'; + var context = undefined; + if (_emberEnvironment.environment.hasDOM && _require.has(bootstrapModuleId)) { + bootstrap = _require.default(bootstrapModuleId).default; + context = document; + } + + bootstrap({ context: context, hasTemplate: _emberGlimmer.hasTemplate, setTemplate: _emberGlimmer.setTemplate }); } + }); +}); +enifed('ember-application/system/application-instance', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-environment', 'ember-views', 'ember-application/system/engine-instance'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberEnvironment, _emberViews, _emberApplicationSystemEngineInstance) { + /** + @module ember + @submodule ember-application + */ - return properties; - } + 'use strict'; + + var BootOptions = undefined; /** - The `Engine` class contains core functionality for both applications and - engines. + The `ApplicationInstance` encapsulates all of the stateful aspects of a + running `Application`. - Each engine manages a registry that's used for dependency injection and - exposed through `RegistryProxy`. + At a high-level, we break application boot into two distinct phases: - Engines also manage initializers and instance initializers. + * Definition time, where all of the classes, templates, and other + dependencies are loaded (typically in the browser). + * Run time, where we begin executing the application once everything + has loaded. - Engines can spawn `EngineInstance` instances via `buildInstance()`. + Definition time can be expensive and only needs to happen once since it is + an idempotent operation. For example, between test runs and FastBoot + requests, the application stays the same. It is only the state that we want + to reset. + + That state is what the `ApplicationInstance` manages: it is responsible for + creating the container that contains all application state, and disposing of + it once the particular test run or FastBoot request has finished. - @class Engine - @namespace Ember - @extends Ember.Namespace - @uses RegistryProxy @public + @class Ember.ApplicationInstance + @extends Ember.EngineInstance */ - var Engine = _emberRuntime.Namespace.extend(_emberRuntime.RegistryProxyMixin, { - init: function () { - this._super.apply(this, arguments); - - this.buildRegistry(); - }, + var ApplicationInstance = _emberApplicationSystemEngineInstance.default.extend({ /** - A private flag indicating whether an engine's initializers have run yet. - @private - @property _initializersRan + The `Application` for which this is an instance. + @property {Ember.Application} application + @private */ - _initializersRan: false, + application: null, /** - Ensure that initializers are run once, and only once, per engine. + The DOM events for which the event dispatcher should listen. + By default, the application's `Ember.EventDispatcher` listens + for a set of standard DOM events, such as `mousedown` and + `keyup`, and delegates them to your application's `Ember.View` + instances. @private - @method ensureInitializers + @property {Object} customEvents */ - ensureInitializers: function () { - if (!this._initializersRan) { - this.runInitializers(); - this._initializersRan = true; - } - }, + customEvents: null, /** - Create an EngineInstance for this engine. + The root DOM element of the Application as an element or a + [jQuery-compatible selector + string](http://api.jquery.com/category/selectors/). @private - @method buildInstance - @return {Ember.EngineInstance} the engine instance + @property {String|DOMElement} rootElement */ - buildInstance: function () { - var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + rootElement: null, - this.ensureInitializers(); - options.base = this; - return _emberApplicationSystemEngineInstance.default.create(options); + init: function () { + this._super.apply(this, arguments); + + // Register this instance in the per-instance registry. + // + // Why do we need to register the instance in the first place? + // Because we need a good way for the root route (a.k.a ApplicationRoute) + // to notify us when it has created the root-most view. That view is then + // appended to the rootElement, in the case of apps, to the fixture harness + // in tests, or rendered to a string in the case of FastBoot. + this.register('-application-instance:main', this, { instantiate: false }); }, /** - Build and configure the registry for the current engine. + Overrides the base `EngineInstance._bootSync` method with concerns relevant + to booting application (instead of engine) instances. + This method should only contain synchronous boot concerns. Asynchronous + boot concerns should eventually be moved to the `boot` method, which + returns a promise. + Until all boot code has been made asynchronous, we need to continue to + expose this method for use *internally* in places where we need to boot an + instance synchronously. @private - @method buildRegistry - @return {Ember.Registry} the configured registry */ - buildRegistry: function () { - var registry = this.__registry__ = this.constructor.buildRegistry(this); + _bootSync: function (options) { + if (this._booted) { + return this; + } - return registry; + options = new BootOptions(options); + + this.setupRegistry(options); + + if (options.rootElement) { + this.rootElement = options.rootElement; + } else { + this.rootElement = this.application.rootElement; + } + + if (options.location) { + var router = _emberMetal.get(this, 'router'); + _emberMetal.set(router, 'location', options.location); + } + + this.application.runInstanceInitializers(this); + + if (options.isInteractive) { + this.setupEventDispatcher(); + } + + this._booted = true; + + return this; + }, + + setupRegistry: function (options) { + this.constructor.setupRegistry(this.__registry__, options); }, + router: _emberMetal.computed(function () { + return this.lookup('router:main'); + }).readOnly(), + /** + This hook is called by the root-most Route (a.k.a. the ApplicationRoute) + when it has finished creating the root View. By default, we simply take the + view and append it to the `rootElement` specified on the Application. + In cases like FastBoot and testing, we can override this hook and implement + custom behavior, such as serializing to a string and sending over an HTTP + socket rather than appending to DOM. + @param view {Ember.View} the root-most view @private - @method initializer */ - initializer: function (options) { - this.constructor.initializer(options); + didCreateRootView: function (view) { + view.appendTo(this.rootElement); }, /** - @private - @method instanceInitializer + Tells the router to start routing. The router will ask the location for the + current URL of the page to determine the initial URL to start routing to. + To start the app at a specific URL, call `handleURL` instead. + @private */ - instanceInitializer: function (options) { - this.constructor.instanceInitializer(options); + startRouting: function () { + var router = _emberMetal.get(this, 'router'); + router.startRouting(); + this._didSetupRouter = true; }, /** @private - @method runInitializers + Sets up the router, initializing the child router and configuring the + location before routing begins. + Because setup should only occur once, multiple calls to `setupRouter` + beyond the first call have no effect. */ - runInitializers: function () { - var _this = this; - - this._runInitializer('initializers', function (name, initializer) { - if (initializer.initialize.length === 2) { + setupRouter: function () { + if (this._didSetupRouter) { + return; + } + this._didSetupRouter = true; - initializer.initialize(_this.__registry__, _this); - } else { - initializer.initialize(_this); - } - }); + var router = _emberMetal.get(this, 'router'); + router.setupRouter(); }, /** + Directs the router to route to a particular URL. This is useful in tests, + for example, to tell the app to start at a particular URL. + @param url {String} the URL the router should route to @private - @since 1.12.0 - @method runInstanceInitializers - */ - runInstanceInitializers: function (instance) { - this._runInitializer('instanceInitializers', function (name, initializer) { - initializer.initialize(instance); - }); - }, - - _runInitializer: function (bucketName, cb) { - var initializersByName = _emberMetal.get(this.constructor, bucketName); - var initializers = props(initializersByName); - var graph = new _dagMap.default(); - var initializer = undefined; - - for (var i = 0; i < initializers.length; i++) { - initializer = initializersByName[initializers[i]]; - graph.add(initializer.name, initializer, initializer.before, initializer.after); - } - - graph.topsort(cb); - } - }); - - Engine.reopenClass({ - initializers: new _emberUtils.EmptyObject(), - instanceInitializers: new _emberUtils.EmptyObject(), - - /** - The goal of initializers should be to register dependencies and injections. - This phase runs once. Because these initializers may load code, they are - allowed to defer application readiness and advance it. If you need to access - the container or store you should use an InstanceInitializer that will be run - after all initializers and therefore after all code is loaded and the app is - ready. - Initializer receives an object which has the following attributes: - `name`, `before`, `after`, `initialize`. The only required attribute is - `initialize`, all others are optional. - * `name` allows you to specify under which name the initializer is registered. - This must be a unique name, as trying to register two initializers with the - same name will result in an error. - ```javascript - Ember.Application.initializer({ - name: 'namedInitializer', - initialize: function(application) { - Ember.debug('Running namedInitializer!'); - } - }); - ``` - * `before` and `after` are used to ensure that this initializer is ran prior - or after the one identified by the value. This value can be a single string - or an array of strings, referencing the `name` of other initializers. - An example of ordering initializers, we create an initializer named `first`: - ```javascript - Ember.Application.initializer({ - name: 'first', - initialize: function(application) { - Ember.debug('First initializer!'); - } - }); - // DEBUG: First initializer! - ``` - We add another initializer named `second`, specifying that it should run - after the initializer named `first`: - ```javascript - Ember.Application.initializer({ - name: 'second', - after: 'first', - initialize: function(application) { - Ember.debug('Second initializer!'); - } - }); - // DEBUG: First initializer! - // DEBUG: Second initializer! - ``` - Afterwards we add a further initializer named `pre`, this time specifying - that it should run before the initializer named `first`: - ```javascript - Ember.Application.initializer({ - name: 'pre', - before: 'first', - initialize: function(application) { - Ember.debug('Pre initializer!'); - } - }); - // DEBUG: Pre initializer! - // DEBUG: First initializer! - // DEBUG: Second initializer! - ``` - Finally we add an initializer named `post`, specifying it should run after - both the `first` and the `second` initializers: - ```javascript - Ember.Application.initializer({ - name: 'post', - after: ['first', 'second'], - initialize: function(application) { - Ember.debug('Post initializer!'); - } - }); - // DEBUG: Pre initializer! - // DEBUG: First initializer! - // DEBUG: Second initializer! - // DEBUG: Post initializer! - ``` - * `initialize` is a callback function that receives one argument, - `application`, on which you can operate. - Example of using `application` to register an adapter: - ```javascript - Ember.Application.initializer({ - name: 'api-adapter', - initialize: function(application) { - application.register('api-adapter:main', ApiAdapter); - } - }); - ``` - @method initializer - @param initializer {Object} - @public */ + handleURL: function (url) { + var router = _emberMetal.get(this, 'router'); - initializer: buildInitializerMethod('initializers', 'initializer'), - - /** - Instance initializers run after all initializers have run. Because - instance initializers run after the app is fully set up. We have access - to the store, container, and other items. However, these initializers run - after code has loaded and are not allowed to defer readiness. - Instance initializer receives an object which has the following attributes: - `name`, `before`, `after`, `initialize`. The only required attribute is - `initialize`, all others are optional. - * `name` allows you to specify under which name the instanceInitializer is - registered. This must be a unique name, as trying to register two - instanceInitializer with the same name will result in an error. - ```javascript - Ember.Application.instanceInitializer({ - name: 'namedinstanceInitializer', - initialize: function(application) { - Ember.debug('Running namedInitializer!'); - } - }); - ``` - * `before` and `after` are used to ensure that this initializer is ran prior - or after the one identified by the value. This value can be a single string - or an array of strings, referencing the `name` of other initializers. - * See Ember.Application.initializer for discussion on the usage of before - and after. - Example instanceInitializer to preload data into the store. - ```javascript - Ember.Application.initializer({ - name: 'preload-data', - initialize: function(application) { - var userConfig, userConfigEncoded, store; - // We have a HTML escaped JSON representation of the user's basic - // configuration generated server side and stored in the DOM of the main - // index.html file. This allows the app to have access to a set of data - // without making any additional remote calls. Good for basic data that is - // needed for immediate rendering of the page. Keep in mind, this data, - // like all local models and data can be manipulated by the user, so it - // should not be relied upon for security or authorization. - // - // Grab the encoded data from the meta tag - userConfigEncoded = Ember.$('head meta[name=app-user-config]').attr('content'); - // Unescape the text, then parse the resulting JSON into a real object - userConfig = JSON.parse(unescape(userConfigEncoded)); - // Lookup the store - store = application.lookup('service:store'); - // Push the encoded JSON into the store - store.pushPayload(userConfig); - } - }); - ``` - @method instanceInitializer - @param instanceInitializer - @public - */ - instanceInitializer: buildInitializerMethod('instanceInitializers', 'instance initializer'), + this.setupRouter(); + return router.handleURL(url); + }, /** - This creates a registry with the default Ember naming conventions. - It also configures the registry: - * registered views are created every time they are looked up (they are - not singletons) - * registered templates are not factories; the registered value is - returned directly. - * the router receives the application as its `namespace` property - * all controllers receive the router as their `target` and `controllers` - properties - * 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 - @method buildRegistry - @static - @param {Ember.Application} namespace the application for which to - build the registry - @return {Ember.Registry} the built registry @private */ - buildRegistry: function (namespace) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - - var registry = new _container.Registry({ - resolver: resolverFor(namespace) - }); - - registry.set = _emberMetal.set; - - registry.register('application:main', namespace, { instantiate: false }); + setupEventDispatcher: function () { + var dispatcher = this.lookup('event_dispatcher:main'); + var applicationCustomEvents = _emberMetal.get(this.application, 'customEvents'); + var instanceCustomEvents = _emberMetal.get(this, 'customEvents'); - commonSetupRegistry(registry); - _emberGlimmer.setupEngineRegistry(registry); + var customEvents = _emberUtils.assign({}, applicationCustomEvents, instanceCustomEvents); + dispatcher.setup(customEvents, this.rootElement); - return registry; + return dispatcher; }, /** - Set this to provide an alternate class to `Ember.DefaultResolver` - @deprecated Use 'Resolver' instead - @property resolver - @public + Returns the current URL of the app instance. This is useful when your + app does not update the browsers URL bar (i.e. it uses the `'none'` + location adapter). + @public + @return {String} the current URL */ - resolver: null, + getURL: function () { + var router = _emberMetal.get(this, 'router'); + return _emberMetal.get(router, 'url'); + }, + + // `instance.visit(url)` should eventually replace `instance.handleURL()`; + // the test helpers can probably be switched to use this implementation too /** - Set this to provide an alternate class to `Ember.DefaultResolver` - @property resolver - @public + Navigate the instance to a particular URL. This is useful in tests, for + example, or to tell the app to start at a particular URL. This method + returns a promise that resolves with the app instance when the transition + is complete, or rejects if the transion was aborted due to an error. + @public + @param url {String} the destination URL + @return {Promise} */ - Resolver: null - }); - - /** - This function defines the default lookup rules for container lookups: - - * templates are looked up on `Ember.TEMPLATES` - * other names are looked up on the application after classifying the name. - For example, `controller:post` looks up `App.PostController` by default. - * if the default lookup fails, look for registered classes on the container - - This allows the application to register default injections in the container - that could be overridden by the normal naming convention. - - @private - @method resolverFor - @param {Ember.Namespace} namespace the namespace to look for classes - @return {*} the resolved value for a given lookup - */ - function resolverFor(namespace) { - var ResolverClass = namespace.get('Resolver') || _emberApplicationSystemResolver.default; - - return ResolverClass.create({ - namespace: namespace - }); - } - - function buildInitializerMethod(bucketName, humanName) { - return function (initializer) { - // If this is the first initializer being added to a subclass, we are going to reopen the class - // to make sure we have a new `initializers` object, which extends from the parent class' using - // prototypal inheritance. Without this, attempting to add initializers to the subclass would - // pollute the parent class as well as other subclasses. - if (this.superclass[bucketName] !== undefined && this.superclass[bucketName] === this[bucketName]) { - var attrs = {}; - attrs[bucketName] = Object.create(this[bucketName]); - this.reopenClass(attrs); - } - - this[bucketName][initializer.name] = initializer; - }; - } - - function commonSetupRegistry(registry) { - registry.optionsForType('component', { singleton: false }); - registry.optionsForType('view', { singleton: false }); - - registry.register('controller:basic', _emberRuntime.Controller, { instantiate: false }); - - registry.injection('view', '_viewRegistry', '-view-registry:main'); - registry.injection('renderer', '_viewRegistry', '-view-registry:main'); - registry.injection('event_dispatcher:main', '_viewRegistry', '-view-registry:main'); + visit: function (url) { + var _this = this; - registry.injection('route', '_topLevelViewTemplate', 'template:-outlet'); + this.setupRouter(); - registry.injection('view:-outlet', 'namespace', 'application:main'); + var bootOptions = this.__container__.lookup('-environment:main'); - registry.injection('controller', 'target', 'router:main'); - registry.injection('controller', 'namespace', 'application:main'); + var router = _emberMetal.get(this, 'router'); - registry.injection('router', '_bucketCache', _container.privatize(_templateObject)); - registry.injection('route', '_bucketCache', _container.privatize(_templateObject)); + var handleTransitionResolve = function () { + if (!bootOptions.options.shouldRender) { + // No rendering is needed, and routing has completed, simply return. + return _this; + } else { + return new _emberRuntime.RSVP.Promise(function (resolve) { + // Resolve once rendering is completed. `router.handleURL` returns the transition (as a thennable) + // which resolves once the transition is completed, but the transition completion only queues up + // a scheduled revalidation (into the `render` queue) in the Renderer. + // + // This uses `run.schedule('afterRender', ....)` to resolve after that rendering has completed. + _emberMetal.run.schedule('afterRender', null, resolve, _this); + }); + } + }; - registry.injection('route', 'router', 'router:main'); + var handleTransitionReject = function (error) { + if (error.error) { + throw error.error; + } else if (error.name === 'TransitionAborted' && router.router.activeTransition) { + return router.router.activeTransition.then(handleTransitionResolve, handleTransitionReject); + } else if (error.name === 'TransitionAborted') { + throw new Error(error.message); + } else { + throw error; + } + }; - // Register the routing service... - registry.register('service:-routing', _emberRouting.RoutingService); - // Then inject the app router into it - registry.injection('service:-routing', 'router', 'router:main'); + var location = _emberMetal.get(router, 'location'); - // DEBUGGING - registry.register('resolver-for-debugging:main', registry.resolver, { instantiate: false }); - registry.injection('container-debug-adapter:main', 'resolver', 'resolver-for-debugging:main'); - registry.injection('data-adapter:main', 'containerDebugAdapter', 'container-debug-adapter:main'); - // Custom resolver authors may want to register their own ContainerDebugAdapter with this key + // Keeps the location adapter's internal URL in-sync + location.setURL(url); - registry.register('container-debug-adapter:main', _emberExtensionSupport.ContainerDebugAdapter); + // getURL returns the set url with the rootURL stripped off + return router.handleURL(location.getURL()).then(handleTransitionResolve, handleTransitionReject); + } + }); - registry.register('component-lookup:main', _emberViews.ComponentLookup); - } + ApplicationInstance.reopenClass({ + /** + @private + @method setupRegistry + @param {Registry} registry + @param {BootOptions} options + */ + setupRegistry: function (registry) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - exports.default = Engine; -}); -enifed('ember-application/system/resolver', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-application/utils/validate-type', 'ember-glimmer'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberApplicationUtilsValidateType, _emberGlimmer) { - /** - @module ember - @submodule ember-application - */ + if (!options.toEnvironment) { + options = new BootOptions(options); + } - 'use strict'; + registry.register('-environment:main', options.toEnvironment(), { instantiate: false }); + registry.register('service:-document', options.document, { instantiate: false }); - var Resolver = _emberRuntime.Object.extend({ - /* - This will be set to the Application instance when it is - created. - @property namespace - */ - namespace: null, - normalize: null, // required - resolve: null, // required - parseName: null, // required - lookupDescription: null, // required - makeToString: null, // required - resolveOther: null, // required - _logLookup: null // required + this._super(registry, options); + } }); - exports.Resolver = Resolver; /** - The DefaultResolver defines the default lookup rules to resolve - container lookups before consulting the container for registered - items: - - * templates are looked up on `Ember.TEMPLATES` - * other names are looked up on the application after converting - the name. For example, `controller:post` looks up - `App.PostController` by default. - * there are some nuances (see examples below) - - ### How Resolving Works - - The container calls this object's `resolve` method with the - `fullName` argument. - - It first parses the fullName into an object using `parseName`. - - Then it checks for the presence of a type-specific instance - method of the form `resolve[Type]` and calls it if it exists. - For example if it was resolving 'template:post', it would call - the `resolveTemplate` method. - - Its last resort is to call the `resolveOther` method. + A list of boot-time configuration options for customizing the behavior of + an `Ember.ApplicationInstance`. - The methods of this object are designed to be easy to override - in a subclass. For example, you could enhance how a template - is resolved like so: + This is an interface class that exists purely to document the available + options; you do not need to construct it manually. Simply pass a regular + JavaScript object containing the desired options into methods that require + one of these options object: ```javascript - App = Ember.Application.create({ - Resolver: Ember.DefaultResolver.extend({ - resolveTemplate: function(parsedName) { - let resolvedTemplate = this._super(parsedName); - if (resolvedTemplate) { return resolvedTemplate; } - return Ember.TEMPLATES['not_found']; - } - }) - }); + MyApp.visit("/", { location: "none", rootElement: "#container" }); ``` - Some examples of how names are resolved: + Not all combinations of the supported options are valid. See the documentation + on `Ember.Application#visit` for the supported configurations. - ``` - 'template:post' //=> Ember.TEMPLATES['post'] - 'template:posts/byline' //=> Ember.TEMPLATES['posts/byline'] - 'template:posts.byline' //=> Ember.TEMPLATES['posts/byline'] - 'template:blogPost' //=> Ember.TEMPLATES['blogPost'] - // OR - // Ember.TEMPLATES['blog_post'] - 'controller:post' //=> App.PostController - 'controller:posts.index' //=> App.PostsIndexController - 'controller:blog/post' //=> Blog.PostController - 'controller:basic' //=> Ember.Controller - 'route:post' //=> App.PostRoute - 'route:posts.index' //=> App.PostsIndexRoute - 'route:blog/post' //=> Blog.PostRoute - 'route:basic' //=> Ember.Route - 'view:post' //=> App.PostView - 'view:posts.index' //=> App.PostsIndexView - 'view:blog/post' //=> Blog.PostView - 'view:basic' //=> Ember.View - 'foo:post' //=> App.PostFoo - 'model:post' //=> App.Post - ``` + Internal, experimental or otherwise unstable flags are marked as private. - @class DefaultResolver - @namespace Ember - @extends Ember.Object + @class BootOptions + @namespace Ember.ApplicationInstance @public */ + BootOptions = function BootOptions() { + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - exports.default = _emberRuntime.Object.extend({ /** - This will be set to the Application instance when it is - created. - @property namespace - @public + Provide a specific instance of jQuery. This is useful in conjunction with + the `document` option, as it allows you to use a copy of `jQuery` that is + appropriately bound to the foreign `document` (e.g. a jsdom). + This is highly experimental and support very incomplete at the moment. + @property jQuery + @type Object + @default auto-detected + @private */ - namespace: null, - - init: function () { - this._parseNameCache = _emberUtils.dictionary(null); - }, - normalize: function (fullName) { - var _fullName$split = fullName.split(':', 2); - - var type = _fullName$split[0]; - var name = _fullName$split[1]; - - if (type !== 'template') { - var result = name; + this.jQuery = _emberViews.jQuery; // This default is overridable below - if (result.indexOf('.') > -1) { - 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(); - }); - } - - if (name.indexOf('-') > -1) { - result = result.replace(/-(.)/g, function (m) { - return m.charAt(1).toUpperCase(); - }); - } - - return type + ':' + result; - } else { - return fullName; - } - }, + /** + Interactive mode: whether we need to set up event delegation and invoke + lifecycle callbacks on Components. + @property isInteractive + @type boolean + @default auto-detected + @private + */ + this.isInteractive = _emberEnvironment.environment.hasDOM; // This default is overridable below /** - This method is called via the container's resolver method. - It parses the provided `fullName` and then looks up and - returns the appropriate template or class. - @method resolve - @param {String} fullName the lookup string - @return {Object} the resolved factory + Run in a full browser environment. + When this flag is set to `false`, it will disable most browser-specific + and interactive features. Specifically: + * It does not use `jQuery` to append the root view; the `rootElement` + (either specified as a subsequent option or on the application itself) + must already be an `Element` in the given `document` (as opposed to a + string selector). + * It does not set up an `EventDispatcher`. + * It does not run any `Component` lifecycle hooks (such as `didInsertElement`). + * It sets the `location` option to `"none"`. (If you would like to use + the location adapter specified in the app's router instead, you can also + specify `{ location: null }` to specifically opt-out.) + @property isBrowser + @type boolean + @default auto-detected @public */ - resolve: function (fullName) { - var parsedName = this.parseName(fullName); - var resolveMethodName = parsedName.resolveMethodName; - var resolved; - - if (this[resolveMethodName]) { - resolved = this[resolveMethodName](parsedName); - } - - resolved = resolved || this.resolveOther(parsedName); - - if (parsedName.root && parsedName.root.LOG_RESOLVER) { - this._logLookup(resolved, parsedName); - } - - if (resolved) { - _emberApplicationUtilsValidateType.default(resolved, parsedName); - } - - return resolved; - }, - - /** - Convert the string name of the form 'type:name' to - a Javascript object with the parsed aspects of the name - broken out. - @param {String} fullName the lookup string - @method parseName - @protected - */ - - parseName: function (fullName) { - return this._parseNameCache[fullName] || (this._parseNameCache[fullName] = this._parseName(fullName)); - }, - - _parseName: function (fullName) { - var _fullName$split2 = fullName.split(':'); - - var type = _fullName$split2[0]; - var fullNameWithoutType = _fullName$split2[1]; - - var name = fullNameWithoutType; - var namespace = _emberMetal.get(this, 'namespace'); - var root = namespace; - var lastSlashIndex = name.lastIndexOf('/'); - var dirname = lastSlashIndex !== -1 ? name.slice(0, lastSlashIndex) : null; - - if (type !== 'template' && lastSlashIndex !== -1) { - var parts = name.split('/'); - name = parts[parts.length - 1]; - var namespaceName = _emberRuntime.String.capitalize(parts.slice(0, -1).join('.')); - root = _emberRuntime.Namespace.byName(namespaceName); - } - - var resolveMethodName = fullNameWithoutType === 'main' ? 'Main' : _emberRuntime.String.classify(type); - - if (!(name && type)) { - throw new TypeError('Invalid fullName: `' + fullName + '`, must be of the form `type:name` '); - } - - return { - fullName: fullName, - type: type, - fullNameWithoutType: fullNameWithoutType, - dirname: dirname, - name: name, - root: root, - resolveMethodName: 'resolve' + resolveMethodName - }; - }, - - /** - 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. - @param {String} fullName the lookup string - @method lookupDescription - @protected - */ - lookupDescription: function (fullName) { - var parsedName = this.parseName(fullName); - var description = undefined; - - if (parsedName.type === 'template') { - return 'template at ' + parsedName.fullNameWithoutType.replace(/\./g, '/'); - } - - description = parsedName.root + '.' + _emberRuntime.String.classify(parsedName.name).replace(/\./g, ''); - - if (parsedName.type !== 'model') { - description += _emberRuntime.String.classify(parsedName.type); - } - - return description; - }, - - makeToString: function (factory, fullName) { - return factory.toString(); - }, - - /** - Given a parseName object (output from `parseName`), apply - the conventions expected by `Ember.Router` - @param {Object} parsedName a parseName object with the parsed - fullName lookup string - @method useRouterNaming - @protected - */ - useRouterNaming: function (parsedName) { - parsedName.name = parsedName.name.replace(/\./g, '_'); - if (parsedName.name === 'basic') { - parsedName.name = ''; - } - }, - /** - Look up the template in Ember.TEMPLATES - @param {Object} parsedName a parseName object with the parsed - fullName lookup string - @method resolveTemplate - @protected - */ - resolveTemplate: function (parsedName) { - var templateName = parsedName.fullNameWithoutType.replace(/\./g, '/'); + if (options.isBrowser !== undefined) { + this.isBrowser = !!options.isBrowser; + } else { + this.isBrowser = _emberEnvironment.environment.hasDOM; + } - return _emberGlimmer.getTemplate(templateName) || _emberGlimmer.getTemplate(_emberRuntime.String.decamelize(templateName)); - }, + if (!this.isBrowser) { + this.jQuery = null; + this.isInteractive = false; + this.location = 'none'; + } /** - Lookup the view using `resolveOther` - @param {Object} parsedName a parseName object with the parsed - fullName lookup string - @method resolveView - @protected + Disable rendering completely. + When this flag is set to `true`, it will disable the entire rendering + pipeline. Essentially, this puts the app into "routing-only" mode. No + templates will be rendered, and no Components will be created. + @property shouldRender + @type boolean + @default true + @public */ - resolveView: function (parsedName) { - this.useRouterNaming(parsedName); - return this.resolveOther(parsedName); - }, + if (options.shouldRender !== undefined) { + this.shouldRender = !!options.shouldRender; + } else { + this.shouldRender = true; + } - /** - Lookup the controller using `resolveOther` - @param {Object} parsedName a parseName object with the parsed - fullName lookup string - @method resolveController - @protected - */ - resolveController: function (parsedName) { - this.useRouterNaming(parsedName); - return this.resolveOther(parsedName); - }, - /** - Lookup the route using `resolveOther` - @param {Object} parsedName a parseName object with the parsed - fullName lookup string - @method resolveRoute - @protected - */ - resolveRoute: function (parsedName) { - this.useRouterNaming(parsedName); - return this.resolveOther(parsedName); - }, + if (!this.shouldRender) { + this.jQuery = null; + this.isInteractive = false; + } /** - Lookup the model on the Application namespace - @param {Object} parsedName a parseName object with the parsed - fullName lookup string - @method resolveModel - @protected + If present, render into the given `Document` object instead of the + global `window.document` object. + In practice, this is only useful in non-browser environment or in + non-interactive mode, because Ember's `jQuery` dependency is + implicitly bound to the current document, causing event delegation + to not work properly when the app is rendered into a foreign + document object (such as an iframe's `contentDocument`). + In non-browser mode, this could be a "`Document`-like" object as + Ember only interact with a small subset of the DOM API in non- + interactive mode. While the exact requirements have not yet been + formalized, the `SimpleDOM` library's implementation is known to + work. + @property document + @type Document + @default the global `document` object + @public */ - resolveModel: function (parsedName) { - var className = _emberRuntime.String.classify(parsedName.name); - var factory = _emberMetal.get(parsedName.root, className); + if (options.document) { + this.document = options.document; + } else { + this.document = typeof document !== 'undefined' ? document : null; + } - return factory; - }, - /** - Look up the specified object (from parsedName) on the appropriate - namespace (usually on the Application) - @param {Object} parsedName a parseName object with the parsed - fullName lookup string - @method resolveHelper - @protected - */ - resolveHelper: function (parsedName) { - return this.resolveOther(parsedName); - }, /** - Look up the specified object (from parsedName) on the appropriate - namespace (usually on the Application) - @param {Object} parsedName a parseName object with the parsed - fullName lookup string - @method resolveOther - @protected - */ - resolveOther: function (parsedName) { - var className = _emberRuntime.String.classify(parsedName.name) + _emberRuntime.String.classify(parsedName.type); - var factory = _emberMetal.get(parsedName.root, className); - return factory; - }, + If present, overrides the application's `rootElement` property on + the instance. This is useful for testing environment, where you + might want to append the root view to a fixture area. + In non-browser mode, because Ember does not have access to jQuery, + this options must be specified as a DOM `Element` object instead of + a selector string. + See the documentation on `Ember.Applications`'s `rootElement` for + details. + @property rootElement + @type String|Element + @default null + @public + */ + if (options.rootElement) { + this.rootElement = options.rootElement; + } - resolveMain: function (parsedName) { - var className = _emberRuntime.String.classify(parsedName.type); - return _emberMetal.get(parsedName.root, className); - }, + // Set these options last to give the user a chance to override the + // defaults from the "combo" options like `isBrowser` (although in + // practice, the resulting combination is probably invalid) /** - @method _logLookup - @param {Boolean} found - @param {Object} parsedName - @private + If present, overrides the router's `location` property with this + value. This is useful for environments where trying to modify the + URL would be inappropriate. + @property location + @type string + @default null + @public */ - _logLookup: function (found, parsedName) { - var symbol = undefined, - padding = undefined; - - if (found) { - symbol = '[✓]'; - } else { - symbol = '[ ]'; - } - - if (parsedName.fullName.length > 60) { - padding = '.'; - } else { - padding = new Array(60 - parsedName.fullName.length).join('.'); - } - }, + if (options.location !== undefined) { + this.location = options.location; + } - /** - Used to iterate all items of a given type. - @method knownForType - @param {String} type the type to search for - @private - */ - knownForType: function (type) { - var namespace = _emberMetal.get(this, 'namespace'); - var suffix = _emberRuntime.String.classify(type); - var typeRegexp = new RegExp(suffix + '$'); + if (options.jQuery !== undefined) { + this.jQuery = options.jQuery; + } - var known = _emberUtils.dictionary(null); - var knownKeys = Object.keys(namespace); - for (var index = 0; index < knownKeys.length; index++) { - var _name = knownKeys[index]; + if (options.isInteractive !== undefined) { + this.isInteractive = !!options.isInteractive; + } + }; - if (typeRegexp.test(_name)) { - var containerName = this.translateToContainerFullname(type, _name); + BootOptions.prototype.toEnvironment = function () { + var env = _emberUtils.assign({}, _emberEnvironment.environment); + // For compatibility with existing code + env.hasDOM = this.isBrowser; + env.isInteractive = this.isInteractive; + env.options = this; + return env; + }; - known[containerName] = true; + Object.defineProperty(ApplicationInstance.prototype, 'container', { + configurable: true, + enumerable: false, + get: function () { + var instance = this; + return { + lookup: function () { + return instance.lookup.apply(instance, arguments); } - } - - return known; - }, - - /** - Converts provided name from the backing namespace into a container lookup name. - Examples: - App.FooBarHelper -> helper:foo-bar - App.THelper -> helper:t - @method translateToContainerFullname - @param {String} type - @param {String} name - @private - */ - - translateToContainerFullname: function (type, name) { - var suffix = _emberRuntime.String.classify(type); - var namePrefix = name.slice(0, suffix.length * -1); - var dasherizedName = _emberRuntime.String.dasherize(namePrefix); + }; + } + }); - return type + ':' + dasherizedName; + Object.defineProperty(ApplicationInstance.prototype, 'registry', { + configurable: true, + enumerable: false, + get: function () { + return _emberRuntime.buildFakeRegistryWithDeprecations(this, 'ApplicationInstance'); } }); + + exports.default = ApplicationInstance; }); -enifed('ember-application/utils/validate-type', ['exports', 'ember-metal'], function (exports, _emberMetal) { +enifed('ember-application/system/application', ['exports', 'ember-utils', 'ember-environment', 'ember-metal', 'ember-runtime', 'ember-views', 'ember-routing', 'ember-application/system/application-instance', 'container', 'ember-application/system/engine', 'ember-glimmer'], function (exports, _emberUtils, _emberEnvironment, _emberMetal, _emberRuntime, _emberViews, _emberRouting, _emberApplicationSystemApplicationInstance, _container, _emberApplicationSystemEngine, _emberGlimmer) { /** @module ember @submodule ember-application */ - - 'use strict'; - - exports.default = validateType; - - var VALIDATED_TYPES = { - route: ['assert', 'isRouteFactory', 'Ember.Route'], - component: ['deprecate', 'isComponentFactory', 'Ember.Component'], - view: ['deprecate', 'isViewFactory', 'Ember.View'], - service: ['deprecate', 'isServiceFactory', 'Ember.Service'] - }; - - function validateType(resolvedType, parsedName) { - var validationAttributes = VALIDATED_TYPES[parsedName.type]; - - if (!validationAttributes) { - return; - } - - var action = validationAttributes[0]; - var factoryFlag = validationAttributes[1]; - var expectedType = validationAttributes[2]; - - if (action === 'deprecate') {} else {} - } -}); -enifed('ember-console/index', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { 'use strict'; - function K() {} - - function consoleMethod(name) { - var consoleObj = undefined; - if (_emberEnvironment.context.imports.console) { - consoleObj = _emberEnvironment.context.imports.console; - } else if (typeof console !== 'undefined') { - consoleObj = console; - } - - var method = typeof consoleObj === 'object' ? consoleObj[name] : null; - - if (typeof method !== 'function') { - return; - } - - if (typeof method.bind === 'function') { - return method.bind(consoleObj); - } - - return function () { - method.apply(consoleObj, arguments); - }; - } + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); - function assertPolyfill(test, message) { - if (!test) { - try { - // attempt to preserve the stack - throw new Error('assertion failed: ' + message); - } catch (error) { - setTimeout(function () { - throw error; - }, 0); - } - } - } + var librariesRegistered = false; /** - Inside Ember-Metal, simply uses the methods from `imports.console`. - Override this to provide more robust logging functionality. + An instance of `Ember.Application` is the starting point for every Ember + application. It helps to instantiate, initialize and coordinate the many + objects that make up your app. - @class Logger - @namespace Ember - @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. - ```javascript - var foo = 1; - Ember.Logger.log('log value of foo:', foo); - // "log value of foo: 1" will be printed to the console - ``` - @method log - @for Ember.Logger - @param {*} arguments - @public - */ - log: consoleMethod('log') || K, - - /** - Prints the arguments to the console with a warning icon. - You can pass as many arguments as you want and they will be joined together with a space. - ```javascript - Ember.Logger.warn('Something happened!'); - // "Something happened!" will be printed to the console with a warning icon. - ``` - @method warn - @for Ember.Logger - @param {*} arguments - @public - */ - warn: consoleMethod('warn') || K, - - /** - Prints the arguments to the console with an error icon, red text and a stack trace. - You can pass as many arguments as you want and they will be joined together with a space. - ```javascript - Ember.Logger.error('Danger! Danger!'); - // "Danger! Danger!" will be printed to the console in red text. - ``` - @method error - @for Ember.Logger - @param {*} arguments - @public - */ - error: consoleMethod('error') || K, - - /** - Logs the arguments to the console. - You can pass as many arguments as you want and they will be joined together with a space. - ```javascript - var foo = 1; - Ember.Logger.info('log value of foo:', foo); - // "log value of foo: 1" will be printed to the console - ``` - @method info - @for Ember.Logger - @param {*} arguments - @public - */ - info: consoleMethod('info') || K, - - /** - Logs the arguments to the console in blue text. - You can pass as many arguments as you want and they will be joined together with a space. - ```javascript - var foo = 1; - Ember.Logger.debug('log value of foo:', foo); - // "log value of foo: 1" will be printed to the console - ``` - @method debug - @for Ember.Logger - @param {*} arguments - @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. - ```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 - }; -}); -enifed('ember-environment/global', ['exports'], function (exports) { - /* globals global, window, self, mainContext */ - - // from lodash to catch fake globals - 'use strict'; - - function checkGlobal(value) { - return value && value.Object === Object ? value : undefined; - } - - // element ids can ruin global miss checks - function checkElementIdShadowing(value) { - return value && value.nodeType === undefined ? value : undefined; - } - - // export real global - exports.default = checkGlobal(checkElementIdShadowing(typeof global === 'object' && global)) || checkGlobal(typeof self === 'object' && self) || checkGlobal(typeof window === 'object' && window) || mainContext || // set before strict mode in Ember loader/wrapper - new Function('return this')(); - // eval outside of strict mode -}); -enifed('ember-environment/index', ['exports', 'ember-environment/global', 'ember-environment/utils'], function (exports, _emberEnvironmentGlobal, _emberEnvironmentUtils) { - /* globals module */ - 'use strict'; - - /** - 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 - backwards compatibility with earlier versions of Ember). The `EmberENV` - hash must be created before loading Ember. + Each Ember app has one and only one `Ember.Application` object. In fact, the + very first thing you should do in your application is create the instance: - @class EmberENV - @type Object - @public - */ - var ENV = typeof _emberEnvironmentGlobal.default.EmberENV === 'object' && _emberEnvironmentGlobal.default.EmberENV || typeof _emberEnvironmentGlobal.default.ENV === 'object' && _emberEnvironmentGlobal.default.ENV || {}; - - exports.ENV = ENV; - // ENABLE_ALL_FEATURES was documented, but you can't actually enable non optional features. - if (ENV.ENABLE_ALL_FEATURES) { - ENV.ENABLE_OPTIONAL_FEATURES = true; - } - - /** - Determines whether Ember should add to `Array`, `Function`, and `String` - native object prototypes, a few extra methods in order to provide a more - friendly API. + ```javascript + window.App = Ember.Application.create(); + ``` - We generally recommend leaving this option set to true however, if you need - to turn it off, you can add the configuration property - `EXTEND_PROTOTYPES` to `EmberENV` and set it to `false`. + Typically, the application object is the only global variable. All other + classes in your app should be properties on the `Ember.Application` instance, + which highlights its first role: a global namespace. - Note, when disabled (the default configuration for Ember Addons), you will - instead have to access all methods and functions from the Ember - namespace. + For example, if you define a view class, it might look like this: - @property EXTEND_PROTOTYPES - @type Boolean - @default true - @for EmberENV - @public - */ - ENV.EXTEND_PROTOTYPES = _emberEnvironmentUtils.normalizeExtendPrototypes(ENV.EXTEND_PROTOTYPES); - - /** - The `LOG_STACKTRACE_ON_DEPRECATION` property, when true, tells Ember to log - a full stack trace during deprecation warnings. + ```javascript + App.MyView = Ember.View.extend(); + ``` - @property LOG_STACKTRACE_ON_DEPRECATION - @type Boolean - @default true - @for EmberENV - @public - */ - ENV.LOG_STACKTRACE_ON_DEPRECATION = _emberEnvironmentUtils.defaultTrue(ENV.LOG_STACKTRACE_ON_DEPRECATION); - - /** - The `LOG_VERSION` property, when true, tells Ember to log versions of all - dependent libraries in use. + By default, calling `Ember.Application.create()` will automatically initialize + your application by calling the `Ember.Application.initialize()` method. If + you need to delay initialization, you can call your app's `deferReadiness()` + method. When you are ready for your app to be initialized, call its + `advanceReadiness()` method. - @property LOG_VERSION - @type Boolean - @default true - @for EmberENV - @public - */ - ENV.LOG_VERSION = _emberEnvironmentUtils.defaultTrue(ENV.LOG_VERSION); - - // default false - ENV.MODEL_FACTORY_INJECTIONS = _emberEnvironmentUtils.defaultFalse(ENV.MODEL_FACTORY_INJECTIONS); - - /** - Debug parameter you can turn on. This will log all bindings that fire to - the console. This should be disabled in production code. Note that you - can also enable this from the console or temporarily. + You can define a `ready` method on the `Ember.Application` instance, which + will be run by Ember when the application is initialized. - @property LOG_BINDINGS - @for EmberENV - @type Boolean - @default false - @public - */ - ENV.LOG_BINDINGS = _emberEnvironmentUtils.defaultFalse(ENV.LOG_BINDINGS); - - ENV.RAISE_ON_DEPRECATION = _emberEnvironmentUtils.defaultFalse(ENV.RAISE_ON_DEPRECATION); - - // check if window exists and actually is the global - var hasDOM = typeof window !== 'undefined' && window === _emberEnvironmentGlobal.default && window.document && window.document.createElement && !ENV.disableBrowserEnvironment; // is this a public thing? - - // legacy imports/exports/lookup stuff (should we keep this??) - var originalContext = _emberEnvironmentGlobal.default.Ember || {}; - - var context = { - // import jQuery - imports: originalContext.imports || _emberEnvironmentGlobal.default, - // export Ember - exports: originalContext.exports || _emberEnvironmentGlobal.default, - // search for Namespaces - lookup: originalContext.lookup || _emberEnvironmentGlobal.default - }; - - exports.context = context; - // TODO: cleanup single source of truth issues with this stuff - var environment = hasDOM ? { - hasDOM: true, - isChrome: !!window.chrome && !window.opera, - isFirefox: typeof InstallTrigger !== 'undefined', - isPhantom: !!window.callPhantom, - location: window.location, - history: window.history, - userAgent: window.navigator.userAgent, - window: window - } : { - hasDOM: false, - isChrome: false, - isFirefox: false, - isPhantom: false, - location: null, - history: null, - userAgent: 'Lynx (textmode)', - window: null - }; - exports.environment = environment; -}); -enifed("ember-environment/utils", ["exports"], function (exports) { - "use strict"; - - exports.defaultTrue = defaultTrue; - exports.defaultFalse = defaultFalse; - exports.normalizeExtendPrototypes = normalizeExtendPrototypes; - - function defaultTrue(v) { - return v === false ? false : true; - } - - function defaultFalse(v) { - return v === true ? true : false; - } - - function normalizeExtendPrototypes(obj) { - if (obj === false) { - return { String: false, Array: false, Function: false }; - } else if (!obj || obj === true) { - return { String: true, Array: true, Function: true }; - } else { - return { - String: defaultTrue(obj.String), - Array: defaultTrue(obj.Array), - Function: defaultTrue(obj.Function) - }; - } - } -}); -enifed('ember-extension-support/container_debug_adapter', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { - 'use strict'; - - /** - @module ember - @submodule ember-extension-support - */ - - /** - The `ContainerDebugAdapter` helps the container and resolver interface - with tools that debug Ember such as the - [Ember Extension](https://github.com/tildeio/ember-extension) - for Chrome and Firefox. + Because `Ember.Application` inherits from `Ember.Namespace`, any classes + you create will have useful string representations when calling `toString()`. + See the `Ember.Namespace` documentation for more information. - This class can be extended by a custom resolver implementer - to override some of the methods with library-specific code. + While you can think of your `Ember.Application` as a container that holds the + other classes in your application, there are several other responsibilities + going on under-the-hood that you may want to understand. - The methods likely to be overridden are: + ### Event Delegation - * `canCatalogEntriesByType` - * `catalogEntriesByType` + Ember uses a technique called _event delegation_. This allows the framework + to set up a global, shared event listener instead of requiring each view to + do it manually. For example, instead of each view registering its own + `mousedown` listener on its associated element, Ember sets up a `mousedown` + listener on the `body`. - The adapter will need to be registered - in the application's container as `container-debug-adapter:main`. + If a `mousedown` event occurs, Ember will look at the target of the event and + start walking up the DOM node tree, finding corresponding views and invoking + their `mouseDown` method as it goes. - Example: + `Ember.Application` has a number of default events that it listens for, as + well as a mapping from lowercase events to camel-cased view method names. For + example, the `keypress` event causes the `keyPress` method on the view to be + called, the `dblclick` event causes `doubleClick` to be called, and so on. - ```javascript - Application.initializer({ - name: "containerDebugAdapter", + If there is a bubbling browser event that Ember does not listen for by + default, you can specify custom events and their corresponding view method + names by setting the application's `customEvents` property: - initialize(application) { - application.register('container-debug-adapter:main', require('app/container-debug-adapter')); + ```javascript + let App = Ember.Application.create({ + customEvents: { + // add support for the paste event + paste: 'paste' } }); ``` - @class ContainerDebugAdapter - @namespace Ember - @extends Ember.Object - @since 1.5.0 - @public - */ - exports.default = _emberRuntime.Object.extend({ - /** - The resolver instance of the application - being debugged. This property will be injected - on creation. - @property resolver - @default null - @public - */ - resolver: null, - - /** - Returns true if it is possible to catalog a list of available - classes in the resolver for a given type. - @method canCatalogEntriesByType - @param {String} type The type. e.g. "model", "controller", "route". - @return {boolean} whether a list is available for this type. - @public - */ - canCatalogEntriesByType: function (type) { - if (type === 'model' || type === 'template') { - return false; + To prevent Ember from setting up a listener for a default event, + specify the event name with a `null` value in the `customEvents` + property: + + ```javascript + let App = Ember.Application.create({ + customEvents: { + // prevent listeners for mouseenter/mouseleave events + mouseenter: null, + mouseleave: null } - - return true; - }, - - /** - Returns the available classes a given type. - @method catalogEntriesByType - @param {String} type The type. e.g. "model", "controller", "route". - @return {Array} An array of strings. - @public - */ - catalogEntriesByType: function (type) { - var namespaces = _emberRuntime.A(_emberRuntime.Namespace.NAMESPACES); - var types = _emberRuntime.A(); - var typeSuffixRegex = new RegExp(_emberRuntime.String.classify(type) + '$'); - - namespaces.forEach(function (namespace) { - if (namespace !== _emberMetal.default) { - for (var key in namespace) { - if (!namespace.hasOwnProperty(key)) { - continue; - } - if (typeSuffixRegex.test(key)) { - var klass = namespace[key]; - if (_emberRuntime.typeOf(klass) === 'class') { - types.push(_emberRuntime.String.dasherize(key.replace(typeSuffixRegex, ''))); - } - } - } - } - }); - return types; - } - }); -}); -// Ember as namespace -enifed('ember-extension-support/data_adapter', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-application'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberApplication) { - 'use strict'; - - /** - @module ember - @submodule ember-extension-support - */ - - /** - The `DataAdapter` helps a data persistence library - interface with tools that debug Ember such - as the [Ember Extension](https://github.com/tildeio/ember-extension) - for Chrome and Firefox. + }); + ``` - This class will be extended by a persistence library - which will override some of the methods with - library-specific code. + By default, the application sets up these event listeners on the document + body. However, in cases where you are embedding an Ember application inside + an existing page, you may want it to set up the listeners on an element + inside the body. - The methods likely to be overridden are: + For example, if only events inside a DOM element with the ID of `ember-app` + should be delegated, set your application's `rootElement` property: - * `getFilters` - * `detect` - * `columnsForType` - * `getRecords` - * `getRecordColumnValues` - * `getRecordKeywords` - * `getRecordFilterValues` - * `getRecordColor` - * `observeRecord` + ```javascript + let App = Ember.Application.create({ + rootElement: '#ember-app' + }); + ``` - The adapter will need to be registered - in the application's container as `dataAdapter:main`. + 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! - Example: + 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: ```javascript - Application.initializer({ - name: "data-adapter", + Ember.Application.initializer({ + name: 'api-adapter', initialize: function(application) { - application.register('data-adapter:main', DS.DataAdapter); + application.register('api-adapter:main', ApiAdapter); } }); ``` - @class DataAdapter + Initializers provide an opportunity to access the internal registry, which + organizes the different components of an Ember application. Additionally + they provide a chance to access the instantiated application. Beyond + being used for libraries, initializers are also a great way to organize + dependency injection or setup in your own application. + + ### Routing + + In addition to creating your application's router, `Ember.Application` is + also responsible for telling the router when to start routing. Transitions + between routes can be logged with the `LOG_TRANSITIONS` flag, and more + detailed intra-transition logging can be logged with + the `LOG_TRANSITIONS_INTERNAL` flag: + + ```javascript + let App = Ember.Application.create({ + LOG_TRANSITIONS: true, // basic logging of successful transitions + LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps + }); + ``` + + By default, the router will begin trying to translate the current URL into + application state once the browser emits the `DOMContentReady` event. If you + need to defer routing, you can call the application's `deferReadiness()` + method. Once routing can begin, call the `advanceReadiness()` method. + + If there is any setup required before routing begins, you can implement a + `ready()` method on your app that will be invoked immediately before routing + begins. + + @class Application @namespace Ember - @extends EmberObject + @extends Ember.Engine + @uses RegistryProxyMixin @public */ - exports.default = _emberRuntime.Object.extend({ - init: function () { - this._super.apply(this, arguments); - this.releaseMethods = _emberRuntime.A(); - }, + var Application = _emberApplicationSystemEngine.default.extend({ /** - The container-debug-adapter which is used - to list all models. - @property containerDebugAdapter - @default undefined - @since 1.5.0 + The root DOM element of the Application. This can be specified as an + element or a + [jQuery-compatible selector string](http://api.jquery.com/category/selectors/). + This is the element that will be passed to the Application's, + `eventDispatcher`, which sets up the listeners for event delegation. Every + view in your application should be a child of the element you specify here. + @property rootElement + @type DOMElement + @default 'body' @public - **/ - containerDebugAdapter: undefined, - - /** - The number of attributes to send - as columns. (Enough to make the record - identifiable). - @private - @property attributeLimit - @default 3 - @since 1.3.0 */ - attributeLimit: 3, + rootElement: 'body', /** - Ember Data > v1.0.0-beta.18 - requires string model names to be passed - around instead of the actual factories. - This is a stamp for the Ember Inspector - to differentiate between the versions - to be able to support older versions too. - @public - @property acceptsModelName - */ - acceptsModelName: true, + The `Ember.EventDispatcher` responsible for delegating events to this + application's views. + The event dispatcher is created by the application at initialization time + and sets up event listeners on the DOM element described by the + application's `rootElement` property. + See the documentation for `Ember.EventDispatcher` for more information. + @property eventDispatcher + @type Ember.EventDispatcher + @default null + @public + */ + eventDispatcher: null, /** - Stores all methods that clear observers. - These methods will be called on destruction. - @private - @property releaseMethods - @since 1.3.0 + The DOM events for which the event dispatcher should listen. + By default, the application's `Ember.EventDispatcher` listens + for a set of standard DOM events, such as `mousedown` and + `keyup`, and delegates them to your application's `Ember.View` + instances. + If you would like additional bubbling events to be delegated to your + views, set your `Ember.Application`'s `customEvents` property + to a hash containing the DOM event name as the key and the + corresponding view method name as the value. Setting an event to + a value of `null` will prevent a default event listener from being + added for that event. + To add new events to be listened to: + ```javascript + let App = Ember.Application.create({ + customEvents: { + // add support for the paste event + paste: 'paste' + } + }); + ``` + To prevent default events from being listened to: + ```javascript + let App = Ember.Application.create({ + customEvents: { + // remove support for mouseenter / mouseleave events + mouseenter: null, + mouseleave: null + } + }); + ``` + @property customEvents + @type Object + @default null + @public */ - releaseMethods: _emberRuntime.A(), + customEvents: null, /** - Specifies how records can be filtered. - Records returned will need to have a `filterValues` - property with a key for every name in the returned array. - @public - @method getFilters - @return {Array} List of objects defining filters. - The object should have a `name` and `desc` property. + Whether the application should automatically start routing and render + templates to the `rootElement` on DOM ready. While default by true, + other environments such as FastBoot or a testing harness can set this + property to `false` and control the precise timing and behavior of the boot + process. + @property autoboot + @type Boolean + @default true + @private */ - getFilters: function () { - return _emberRuntime.A(); - }, + autoboot: true, /** - Fetch the model types and observe them for changes. - @public - @method watchModelTypes - @param {Function} typesAdded Callback to call to add types. - Takes an array of objects containing wrapped types (returned from `wrapModelType`). - @param {Function} typesUpdated Callback to call when a type has changed. - Takes an array of objects containing wrapped types. - @return {Function} Method to call to remove all observers - */ - watchModelTypes: function (typesAdded, typesUpdated) { - var _this = this; - - var modelTypes = this.getModelTypes(); - var releaseMethods = _emberRuntime.A(); - var typesToSend = undefined; - - typesToSend = modelTypes.map(function (type) { - var klass = type.klass; - var wrapped = _this.wrapModelType(klass, type.name); - releaseMethods.push(_this.observeModelType(type.name, typesUpdated)); - return wrapped; + Whether the application should be configured for the legacy "globals mode". + Under this mode, the Application object serves as a global namespace for all + classes. + ```javascript + let App = Ember.Application.create({ + ... }); - - typesAdded(typesToSend); - - var release = function () { - releaseMethods.forEach(function (fn) { - return fn(); - }); - _this.releaseMethods.removeObject(release); - }; - this.releaseMethods.pushObject(release); - return release; - }, - - _nameToClass: function (type) { - if (typeof type === 'string') { - type = _emberUtils.getOwner(this)._lookupFactory('model:' + type); - } - return type; - }, - - /** - Fetch the records of a given type and observe them for changes. - @public - @method watchRecords - @param {String} modelName The model name. - @param {Function} recordsAdded Callback to call to add records. - Takes an array of objects containing wrapped records. - The object should have the following properties: - columnValues: {Object} The key and value of a table cell. - object: {Object} The actual record object. - @param {Function} recordsUpdated Callback to call when a record has changed. - Takes an array of objects containing wrapped records. - @param {Function} recordsRemoved Callback to call when a record has removed. - Takes the following parameters: - index: The array index where the records were removed. - count: The number of records removed. - @return {Function} Method to call to remove all observers. + App.Router.reopen({ + location: 'none' + }); + App.Router.map({ + ... + }); + App.MyComponent = Ember.Component.extend({ + ... + }); + ``` + This flag also exposes other internal APIs that assumes the existence of + a special "default instance", like `App.__container__.lookup(...)`. + This option is currently not configurable, its value is derived from + the `autoboot` flag – disabling `autoboot` also implies opting-out of + globals mode support, although they are ultimately orthogonal concerns. + Some of the global modes features are already deprecated in 1.x. The + existence of this flag is to untangle the globals mode code paths from + the autoboot code paths, so that these legacy features can be reviewed + for deprecation/removal separately. + Forcing the (autoboot=true, _globalsMode=false) here and running the tests + would reveal all the places where we are still relying on these legacy + behavior internally (mostly just tests). + @property _globalsMode + @type Boolean + @default true + @private */ - watchRecords: function (modelName, recordsAdded, recordsUpdated, recordsRemoved) { - var _this2 = this; + _globalsMode: true, - var releaseMethods = _emberRuntime.A(); - var klass = this._nameToClass(modelName); - var records = this.getRecords(klass, modelName); - var release = undefined; + init: function (options) { + this._super.apply(this, arguments); - function recordUpdated(updatedRecord) { - recordsUpdated([updatedRecord]); + if (!this.$) { + this.$ = _emberViews.jQuery; } - var recordsToSend = records.map(function (record) { - releaseMethods.push(_this2.observeRecord(record, recordUpdated)); - return _this2.wrapRecord(record); - }); - - var contentDidChange = function (array, idx, removedCount, addedCount) { - for (var i = idx; i < idx + addedCount; i++) { - var record = _emberRuntime.objectAt(array, i); - var wrapped = _this2.wrapRecord(record); - releaseMethods.push(_this2.observeRecord(record, recordUpdated)); - recordsAdded([wrapped]); - } - - if (removedCount) { - recordsRemoved(idx, removedCount); - } - }; - - var observer = { didChange: contentDidChange, willChange: function () { - return this; - } }; - _emberRuntime.addArrayObserver(records, this, observer); + registerLibraries(); - release = function () { - releaseMethods.forEach(function (fn) { - return fn(); - }); - _emberRuntime.removeArrayObserver(records, _this2, observer); - _this2.releaseMethods.removeObject(release); - }; + // Start off the number of deferrals at 1. This will be decremented by + // the Application's own `boot` method. + this._readinessDeferrals = 1; + this._booted = false; - recordsAdded(recordsToSend); + this.autoboot = this._globalsMode = !!this.autoboot; - this.releaseMethods.pushObject(release); - return release; - }, + if (this._globalsMode) { + this._prepareForGlobalsMode(); + } - /** - Clear all observers before destruction - @private - @method willDestroy - */ - willDestroy: function () { - this._super.apply(this, arguments); - this.releaseMethods.forEach(function (fn) { - return fn(); - }); + if (this.autoboot) { + this.waitForDOMReady(); + } }, /** - Detect whether a class is a model. - Test that against the model class - of your persistence library. + Create an ApplicationInstance for this application. @private - @method detect - @param {Class} klass The class to test. - @return boolean Whether the class is a model class or not. + @method buildInstance + @return {Ember.ApplicationInstance} the application instance */ - detect: function (klass) { - return false; - }, + buildInstance: function () { + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - /** - Get the columns for a given model type. - @private - @method columnsForType - @param {Class} type The model type. - @return {Array} An array of columns of the following format: - name: {String} The name of the column. - desc: {String} Humanized description (what would show in a table column name). - */ - columnsForType: function (type) { - return _emberRuntime.A(); + options.base = this; + options.application = this; + return _emberApplicationSystemApplicationInstance.default.create(options); }, /** - Adds observers to a model type class. + Enable the legacy globals mode by allowing this application to act + as a global namespace. See the docs on the `_globalsMode` property + for details. + Most of these features are already deprecated in 1.x, so we can + stop using them internally and try to remove them. @private - @method observeModelType - @param {String} modelName The model type name. - @param {Function} typesUpdated Called when a type is modified. - @return {Function} The function to call to remove observers. + @method _prepareForGlobalsMode */ + _prepareForGlobalsMode: function () { + // 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`. + this.Router = (this.Router || _emberRouting.Router).extend(); - observeModelType: function (modelName, typesUpdated) { - var _this3 = this; - - var klass = this._nameToClass(modelName); - var records = this.getRecords(klass, modelName); - - function onChange() { - typesUpdated([this.wrapModelType(klass, modelName)]); - } - - var observer = { - didChange: function () { - _emberMetal.run.scheduleOnce('actions', this, onChange); - }, - willChange: function () { - return this; - } - }; - - _emberRuntime.addArrayObserver(records, this, observer); - - var release = function () { - return _emberRuntime.removeArrayObserver(records, _this3, observer); - }; - - return release; + this._buildDeprecatedInstance(); }, - /** - Wraps a given model type and observes changes to it. + /* + Build the deprecated instance for legacy globals mode support. + Called when creating and resetting the application. + This is orthogonal to autoboot: the deprecated instance needs to + be created at Application construction (not boot) time to expose + App.__container__. If autoboot sees that this instance exists, + it will continue booting it to avoid doing unncessary work (as + opposed to building a new instance at boot time), but they are + otherwise unrelated. @private - @method wrapModelType - @param {Class} klass A model class. - @param {String} modelName Name of the class. - @return {Object} Contains the wrapped type and the function to remove observers - Format: - type: {Object} The wrapped type. - The wrapped type has the following format: - name: {String} The name of the type. - count: {Integer} The number of records available. - columns: {Columns} An array of columns to describe the record. - object: {Class} The actual Model type class. - release: {Function} The function to remove observers. + @method _buildDeprecatedInstance */ - wrapModelType: function (klass, name) { - var records = this.getRecords(klass, name); - var typeToSend = undefined; - - typeToSend = { - name: name, - count: _emberMetal.get(records, 'length'), - columns: this.columnsForType(klass), - object: klass - }; + _buildDeprecatedInstance: function () { + // Build a default instance + var instance = this.buildInstance(); - return typeToSend; + // Legacy support for App.__container__ and other global methods + // on App that rely on a single, default instance. + this.__deprecatedInstance__ = instance; + this.__container__ = instance.__container__; }, /** - Fetches all models defined in the application. + Automatically kick-off the boot process for the application once the + DOM has become ready. + The initialization itself is scheduled on the actions queue which + ensures that code-loading finishes before booting. + If you are asynchronously loading code, you should call `deferReadiness()` + to defer booting, and then call `advanceReadiness()` once all of your code + has finished loading. @private - @method getModelTypes - @return {Array} Array of model types. + @method waitForDOMReady */ - getModelTypes: function () { - var _this4 = this; - - var containerDebugAdapter = this.get('containerDebugAdapter'); - var types = undefined; - - if (containerDebugAdapter.canCatalogEntriesByType('model')) { - types = containerDebugAdapter.catalogEntriesByType('model'); + waitForDOMReady: function () { + if (!this.$ || this.$.isReady) { + _emberMetal.run.schedule('actions', this, 'domReady'); } else { - types = this._getObjectsOnNamespaces(); + this.$().ready(_emberMetal.run.bind(this, 'domReady')); } - - // New adapters return strings instead of classes. - types = _emberRuntime.A(types).map(function (name) { - return { - klass: _this4._nameToClass(name), - name: name - }; - }); - types = _emberRuntime.A(types).filter(function (type) { - return _this4.detect(type.klass); - }); - - return _emberRuntime.A(types); }, /** - Loops over all namespaces and all objects - attached to them. + This is the autoboot flow: + 1. Boot the app by calling `this.boot()` + 2. Create an instance (or use the `__deprecatedInstance__` in globals mode) + 3. Boot the instance by calling `instance.boot()` + 4. Invoke the `App.ready()` callback + 5. Kick-off routing on the instance + Ideally, this is all we would need to do: + ```javascript + _autoBoot() { + this.boot().then(() => { + let instance = (this._globalsMode) ? this.__deprecatedInstance__ : this.buildInstance(); + return instance.boot(); + }).then((instance) => { + App.ready(); + instance.startRouting(); + }); + } + ``` + Unfortunately, we cannot actually write this because we need to participate + in the "synchronous" boot process. While the code above would work fine on + the initial boot (i.e. DOM ready), when `App.reset()` is called, we need to + boot a new instance synchronously (see the documentation on `_bootSync()` + for details). + Because of this restriction, the actual logic of this method is located + inside `didBecomeReady()`. @private - @method _getObjectsOnNamespaces - @return {Array} Array of model type strings. + @method domReady */ - _getObjectsOnNamespaces: function () { - var _this5 = this; + domReady: function () { + if (this.isDestroyed) { + return; + } - var namespaces = _emberRuntime.A(_emberRuntime.Namespace.NAMESPACES); - var types = _emberRuntime.A(); + this._bootSync(); - namespaces.forEach(function (namespace) { - for (var key in namespace) { - if (!namespace.hasOwnProperty(key)) { - continue; - } - // Even though we will filter again in `getModelTypes`, - // we should not call `lookupFactory` on non-models - // (especially when `EmberENV.MODEL_FACTORY_INJECTIONS` is `true`) - if (!_this5.detect(namespace[key])) { - continue; - } - var _name = _emberRuntime.String.dasherize(key); - if (!(namespace instanceof _emberApplication.Application) && namespace.toString()) { - _name = namespace + '/' + _name; - } - types.push(_name); - } - }); - return types; + // Continues to `didBecomeReady` }, /** - Fetches all loaded records for a given type. - @private - @method getRecords - @return {Array} An array of records. - This array will be observed for changes, - so it should update when new records are added/removed. + Use this to defer readiness until some condition is true. + Example: + ```javascript + let App = Ember.Application.create(); + App.deferReadiness(); + // Ember.$ is a reference to the jQuery object/function + Ember.$.getJSON('/auth-token', function(token) { + App.token = token; + App.advanceReadiness(); + }); + ``` + This allows you to perform asynchronous setup logic and defer + booting your application until the setup has finished. + However, if the setup requires a loading UI, it might be better + to use the router for this purpose. + @method deferReadiness + @public */ - getRecords: function (type) { - return _emberRuntime.A(); + deferReadiness: function () { + this._readinessDeferrals++; }, /** - Wraps a record and observers changes to it. - @private - @method wrapRecord - @param {Object} record The record instance. - @return {Object} The wrapped record. Format: - columnValues: {Array} - searchKeywords: {Array} + Call `advanceReadiness` after any asynchronous setup logic has completed. + Each call to `deferReadiness` must be matched by a call to `advanceReadiness` + or the application will never become ready and routing will not begin. + @method advanceReadiness + @see {Ember.Application#deferReadiness} + @public */ - wrapRecord: function (record) { - var recordToSend = { object: record }; - - recordToSend.columnValues = this.getRecordColumnValues(record); - recordToSend.searchKeywords = this.getRecordKeywords(record); - recordToSend.filterValues = this.getRecordFilterValues(record); - recordToSend.color = this.getRecordColor(record); + advanceReadiness: function () { + this._readinessDeferrals--; - return recordToSend; + if (this._readinessDeferrals === 0) { + _emberMetal.run.once(this, this.didBecomeReady); + } }, /** - Gets the values for each column. + Initialize the application and return a promise that resolves with the `Ember.Application` + object when the boot process is complete. + Run any application 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. + By default, this method is called automatically on "DOM ready"; however, if autoboot + is disabled, this is automatically called when the first application instance is + created via `visit`. @private - @method getRecordColumnValues - @return {Object} Keys should match column names defined - by the model type. + @method boot + @return {Promise} */ - getRecordColumnValues: function (record) { - return {}; + boot: function () { + if (this._bootPromise) { + return this._bootPromise; + } + + try { + this._bootSync(); + } catch (_) { + // Ignore th error: in the asynchronous boot path, the error is already reflected + // in the promise rejection + } + + return this._bootPromise; }, /** - Returns keywords to match when searching records. - @private - @method getRecordKeywords - @return {Array} Relevant keywords for search. - */ - getRecordKeywords: function (record) { - return _emberRuntime.A(); - }, - - /** - Returns the values of filters defined by `getFilters`. + Unfortunately, a lot of existing code assumes the booting process is + "synchronous". Specifically, a lot of tests assumes the last call to + `app.advanceReadiness()` or `app.reset()` will result in the app being + fully-booted when the current runloop completes. + We would like new code (like the `visit` API) to stop making this assumption, + so we created the asynchronous version above that returns a promise. But until + we have migrated all the code, we would have to expose this method for use + *internally* in places where we need to boot an app "synchronously". @private - @method getRecordFilterValues - @param {Object} record The record instance. - @return {Object} The filter values. */ - getRecordFilterValues: function (record) { - return {}; + _bootSync: function () { + if (this._booted) { + return; + } + + // Even though this returns synchronously, we still need to make sure the + // boot promise exists for book-keeping purposes: if anything went wrong in + // the boot process, we need to store the error as a rejection on the boot + // promise so that a future caller of `boot()` can tell what failed. + var defer = this._bootResolver = new _emberRuntime.RSVP.defer(); + this._bootPromise = defer.promise; + + try { + this.runInitializers(); + _emberRuntime.runLoadHooks('application', this); + this.advanceReadiness(); + // Continues to `didBecomeReady` + } catch (error) { + // For the asynchronous boot path + defer.reject(error); + + // For the synchronous boot path + throw error; + } }, /** - Each record can have a color that represents its state. - @private - @method getRecordColor - @param {Object} record The record instance - @return {String} The records color. - Possible options: black, red, blue, green. + Reset the application. This is typically used only in tests. It cleans up + the application in the following order: + 1. Deactivate existing routes + 2. Destroy all objects in the container + 3. Create a new application container + 4. Re-route to the existing url + Typical Example: + ```javascript + let App; + run(function() { + App = Ember.Application.create(); + }); + module('acceptance test', { + setup: function() { + App.reset(); + } + }); + test('first test', function() { + // App is freshly reset + }); + test('second test', function() { + // App is again freshly reset + }); + ``` + Advanced Example: + Occasionally you may want to prevent the app from initializing during + setup. This could enable extra configuration, or enable asserting prior + to the app becoming ready. + ```javascript + let App; + run(function() { + App = Ember.Application.create(); + }); + module('acceptance test', { + setup: function() { + run(function() { + App.reset(); + App.deferReadiness(); + }); + } + }); + test('first test', function() { + ok(true, 'something before app is initialized'); + run(function() { + App.advanceReadiness(); + }); + ok(true, 'something after app is initialized'); + }); + ``` + @method reset + @public */ - getRecordColor: function (record) { - return null; + reset: function () { + + var instance = this.__deprecatedInstance__; + + this._readinessDeferrals = 1; + this._bootPromise = null; + this._bootResolver = null; + this._booted = false; + + function handleReset() { + _emberMetal.run(instance, 'destroy'); + this._buildDeprecatedInstance(); + _emberMetal.run.schedule('actions', this, '_bootSync'); + } + + _emberMetal.run.join(this, handleReset); }, /** - Observes all relevant properties and re-sends the wrapped record - when a change occurs. - @private - @method observerRecord - @param {Object} record The record instance. - @param {Function} recordUpdated The callback to call when a record is updated. - @return {Function} The function to call to remove all observers. + @private + @method didBecomeReady */ - observeRecord: function (record, recordUpdated) { - return function () {}; - } - }); -}); -enifed('ember-extension-support/index', ['exports', 'ember-extension-support/data_adapter', 'ember-extension-support/container_debug_adapter'], function (exports, _emberExtensionSupportData_adapter, _emberExtensionSupportContainer_debug_adapter) { - /** - @module ember - @submodule ember-extension-support - */ - - 'use strict'; + didBecomeReady: function () { + try { + // TODO: Is this still needed for _globalsMode = false? + if (!_emberMetal.isTesting()) { + // Eagerly name all classes that are already loaded + _emberRuntime.Namespace.processAll(); + _emberRuntime.setNamespaceSearchDisabled(true); + } - exports.DataAdapter = _emberExtensionSupportData_adapter.default; - exports.ContainerDebugAdapter = _emberExtensionSupportContainer_debug_adapter.default; -}); -enifed('ember-glimmer/component', ['exports', 'ember-utils', 'ember-views', 'ember-runtime', 'ember-metal', 'ember-glimmer/utils/references', 'glimmer-reference', 'glimmer-runtime'], function (exports, _emberUtils, _emberViews, _emberRuntime, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference, _glimmerRuntime) { - 'use strict'; + // See documentation on `_autoboot()` for details + if (this.autoboot) { + var instance = undefined; - var _CoreView$extend; + if (this._globalsMode) { + // If we already have the __deprecatedInstance__ lying around, boot it to + // avoid unnecessary work + instance = this.__deprecatedInstance__; + } else { + // Otherwise, build an instance and boot it. This is currently unreachable, + // because we forced _globalsMode to === autoboot; but having this branch + // allows us to locally toggle that flag for weeding out legacy globals mode + // dependencies independently + instance = this.buildInstance(); + } - var DIRTY_TAG = _emberUtils.symbol('DIRTY_TAG'); - exports.DIRTY_TAG = DIRTY_TAG; - var ARGS = _emberUtils.symbol('ARGS'); - exports.ARGS = ARGS; - var ROOT_REF = _emberUtils.symbol('ROOT_REF'); - exports.ROOT_REF = ROOT_REF; - var IS_DISPATCHING_ATTRS = _emberUtils.symbol('IS_DISPATCHING_ATTRS'); - exports.IS_DISPATCHING_ATTRS = IS_DISPATCHING_ATTRS; - var HAS_BLOCK = _emberUtils.symbol('HAS_BLOCK'); - exports.HAS_BLOCK = HAS_BLOCK; - var BOUNDS = _emberUtils.symbol('BOUNDS'); + instance._bootSync(); - exports.BOUNDS = BOUNDS; - /** - @module ember - @submodule ember-glimmer - */ + // TODO: App.ready() is not called when autoboot is disabled, is this correct? + this.ready(); - /** - An `Ember.Component` is a view that is completely - isolated. Properties accessed in its templates go - to the view object and actions are targeted at - the view object. There is no access to the - surrounding context or outer controller; all - contextual information must be passed in. - - The easiest way to create an `Ember.Component` is via - a template. If you name a template - `components/my-foo`, you will be able to use - `{{my-foo}}` in other templates, which will make - an instance of the isolated component. - - ```handlebars - {{app-profile person=currentUser}} - ``` - - ```handlebars - -

    {{person.title}}

    - -

    {{person.signature}}

    - ``` - - You can use `yield` inside a template to - include the **contents** of any block attached to - the component. The block will be executed in the - context of the surrounding context or outer controller: - - ```handlebars - {{#app-profile person=currentUser}} -

    Admin mode

    - {{! Executed in the controller's context. }} - {{/app-profile}} - ``` - - ```handlebars - -

    {{person.title}}

    - {{! Executed in the component's context. }} - {{yield}} {{! block contents }} - ``` - - If you want to customize the component, in order to - handle events or actions, you implement a subclass - of `Ember.Component` named after the name of the - component. Note that `Component` needs to be appended to the name of - your subclass like `AppProfileComponent`. - - For example, you could implement the action - `hello` for the `app-profile` component: - - ```javascript - App.AppProfileComponent = Ember.Component.extend({ - actions: { - hello: function(name) { - console.log("Hello", name); + instance.startRouting(); } - } - }); - ``` - - And then use it in the component's template: - - ```handlebars - -

    {{person.title}}

    - {{yield}} - - ``` - Components must have a `-` in their name to avoid - conflicts with built-in controls that wrap HTML - elements. This is consistent with the same - requirement in web components. - - @class Component - @namespace Ember - @extends Ember.CoreView - @uses Ember.TargetActionSupport - @uses Ember.ClassNamesSupport - @uses Ember.ActionSupport - @uses Ember.ViewMixin - @public - */ - var Component = _emberViews.CoreView.extend(_emberViews.ChildViewsSupport, _emberViews.ViewStateSupport, _emberViews.ClassNamesSupport, _emberRuntime.TargetActionSupport, _emberViews.ActionSupport, _emberViews.ViewMixin, (_CoreView$extend = { - isComponent: true, - init: function () { - this._super.apply(this, arguments); - this[IS_DISPATCHING_ATTRS] = false; - this[DIRTY_TAG] = new _glimmerReference.DirtyableTag(); - this[ROOT_REF] = new _emberGlimmerUtilsReferences.RootReference(this); - this[BOUNDS] = null; + // For the asynchronous boot path + this._bootResolver.resolve(this); - // If a `defaultLayout` was specified move it to the `layout` prop. - // `layout` is no longer a CP, so this just ensures that the `defaultLayout` - // logic is supported with a deprecation - if (this.defaultLayout && !this.layout) { + // For the synchronous boot path + this._booted = true; + } catch (error) { + // For the asynchronous boot path + this._bootResolver.reject(error); - this.layout = this.defaultLayout; + // For the synchronous boot path + throw error; } - - // If in a tagless component, assert that no event handlers are defined }, - // indicate that the assertion should be triggered - rerender: function () { - this[DIRTY_TAG].dirty(); - this._super(); + /** + Called when the Application has become ready, immediately before routing + begins. The call will be delayed until the DOM has become ready. + @event ready + @public + */ + ready: function () { + return this; }, - __defineNonEnumerable: function (property) { - this[property.name] = property.descriptor.value; - } + // This method must be moved to the application instance object + willDestroy: function () { + this._super.apply(this, arguments); + _emberRuntime.setNamespaceSearchDisabled(false); + this._booted = false; + this._bootPromise = null; + this._bootResolver = null; - }, _CoreView$extend[_emberMetal.PROPERTY_DID_CHANGE] = function (key) { - if (this[IS_DISPATCHING_ATTRS]) { - return; - } + if (_emberRuntime._loaded.application === this) { + _emberRuntime._loaded.application = undefined; + } - var args = undefined, - reference = undefined; + if (this._globalsMode && this.__deprecatedInstance__) { + this.__deprecatedInstance__.destroy(); + } + }, - if ((args = this[ARGS]) && (reference = args[key])) { - if (reference[_emberGlimmerUtilsReferences.UPDATE]) { - reference[_emberGlimmerUtilsReferences.UPDATE](_emberMetal.get(this, key)); + /** + Boot a new instance of `Ember.ApplicationInstance` for the current + application and navigate it to the given `url`. Returns a `Promise` that + resolves with the instance when the initial routing and rendering is + complete, or rejects with any error that occured during the boot process. + When `autoboot` is disabled, calling `visit` would first cause the + application to boot, which runs the application initializers. + This method also takes a hash of boot-time configuration options for + customizing the instance's behavior. See the documentation on + `Ember.ApplicationInstance.BootOptions` for details. + `Ember.ApplicationInstance.BootOptions` is an interface class that exists + purely to document the available options; you do not need to construct it + manually. Simply pass a regular JavaScript object containing of the + desired options: + ```javascript + MyApp.visit("/", { location: "none", rootElement: "#container" }); + ``` + ### Supported Scenarios + While the `BootOptions` class exposes a large number of knobs, not all + combinations of them are valid; certain incompatible combinations might + result in unexpected behavior. + For example, booting the instance in the full browser environment + while specifying a foriegn `document` object (e.g. `{ isBrowser: true, + document: iframe.contentDocument }`) does not work correctly today, + largely due to Ember's jQuery dependency. + Currently, there are three officially supported scenarios/configurations. + Usages outside of these scenarios are not guaranteed to work, but please + feel free to file bug reports documenting your experience and any issues + you encountered to help expand support. + #### Browser Applications (Manual Boot) + The setup is largely similar to how Ember works out-of-the-box. Normally, + Ember will boot a default instance for your Application on "DOM ready". + However, you can customize this behavior by disabling `autoboot`. + For example, this allows you to render a miniture demo of your application + into a specific area on your marketing website: + ```javascript + import MyApp from 'my-app'; + $(function() { + let App = MyApp.create({ autoboot: false }); + let options = { + // Override the router's location adapter to prevent it from updating + // the URL in the address bar + location: 'none', + // Override the default `rootElement` on the app to render into a + // specific `div` on the page + rootElement: '#demo' + }; + // Start the app at the special demo URL + App.visit('/demo', options); + }); + ```` + Or perhaps you might want to boot two instances of your app on the same + page for a split-screen multiplayer experience: + ```javascript + import MyApp from 'my-app'; + $(function() { + let App = MyApp.create({ autoboot: false }); + let sessionId = MyApp.generateSessionID(); + let player1 = App.visit(`/matches/join?name=Player+1&session=${sessionId}`, { rootElement: '#left', location: 'none' }); + let player2 = App.visit(`/matches/join?name=Player+2&session=${sessionId}`, { rootElement: '#right', location: 'none' }); + Promise.all([player1, player2]).then(() => { + // Both apps have completed the initial render + $('#loading').fadeOut(); + }); + }); + ``` + Do note that each app instance maintains their own registry/container, so + they will run in complete isolation by default. + #### Server-Side Rendering (also known as FastBoot) + This setup allows you to run your Ember app in a server environment using + Node.js and render its content into static HTML for SEO purposes. + ```javascript + const HTMLSerializer = new SimpleDOM.HTMLSerializer(SimpleDOM.voidMap); + function renderURL(url) { + let dom = new SimpleDOM.Document(); + let rootElement = dom.body; + let options = { isBrowser: false, document: dom, rootElement: rootElement }; + return MyApp.visit(options).then(instance => { + try { + return HTMLSerializer.serialize(rootElement.firstChild); + } finally { + instance.destroy(); + } + }); + } + ``` + In this scenario, because Ember does not have access to a global `document` + object in the Node.js environment, you must provide one explicitly. In practice, + in the non-browser environment, the stand-in `document` object only need to + implement a limited subset of the full DOM API. The `SimpleDOM` library is known + to work. + Since there is no access to jQuery in the non-browser environment, you must also + specify a DOM `Element` object in the same `document` for the `rootElement` option + (as opposed to a selector string like `"body"`). + See the documentation on the `isBrowser`, `document` and `rootElement` properties + on `Ember.ApplicationInstance.BootOptions` for details. + #### Server-Side Resource Discovery + This setup allows you to run the routing layer of your Ember app in a server + environment using Node.js and completely disable rendering. This allows you + to simulate and discover the resources (i.e. AJAX requests) needed to fufill + a given request and eagerly "push" these resources to the client. + ```app/initializers/network-service.js + import BrowserNetworkService from 'app/services/network/browser'; + import NodeNetworkService from 'app/services/network/node'; + // Inject a (hypothetical) service for abstracting all AJAX calls and use + // the appropiate implementaion on the client/server. This also allows the + // server to log all the AJAX calls made during a particular request and use + // that for resource-discovery purpose. + export function initialize(application) { + if (window) { // browser + application.register('service:network', BrowserNetworkService); + } else { // node + application.register('service:network', NodeNetworkService); + } + application.inject('route', 'network', 'service:network'); + }; + export default { + name: 'network-service', + initialize: initialize + }; + ``` + ```app/routes/post.js + import Ember from 'ember'; + // An example of how the (hypothetical) service is used in routes. + export default Ember.Route.extend({ + model(params) { + return this.network.fetch(`/api/posts/${params.post_id}.json`); + }, + afterModel(post) { + if (post.isExternalContent) { + return this.network.fetch(`/api/external/?url=${post.externalURL}`); + } else { + return post; + } + } + }); + ``` + ```javascript + // Finally, put all the pieces together + function discoverResourcesFor(url) { + return MyApp.visit(url, { isBrowser: false, shouldRender: false }).then(instance => { + let networkService = instance.lookup('service:network'); + return networkService.requests; // => { "/api/posts/123.json": "..." } + }); } + ``` + @public + @method visit + @param url {String} The initial URL to navigate to + @param options {Ember.ApplicationInstance.BootOptions} + @return {Promise} + */ + visit: function (url, options) { + var _this = this; + + return this.boot().then(function () { + var instance = _this.buildInstance(); + + return instance.boot(options).then(function () { + return instance.visit(url); + }).catch(function (error) { + _emberMetal.run(instance, 'destroy'); + throw error; + }); + }); } - }, _CoreView$extend.getAttr = function (key) { - // TODO Intimate API should be deprecated - return this.get(key); - }, _CoreView$extend.readDOMAttr = function (name) { - var element = _emberViews.getViewElement(this); - return _glimmerRuntime.readDOMAttr(element, name); - }, _CoreView$extend)); + }); - /** - The WAI-ARIA role of the control represented by this view. For example, a - button may have a role of type 'button', or a pane may have a role of - type 'alertdialog'. This property is used by assistive software to help - visually challenged users navigate rich web applications. - The full list of valid WAI-ARIA roles is available at: - [http://www.w3.org/TR/wai-aria/roles#roles_categorization](http://www.w3.org/TR/wai-aria/roles#roles_categorization) - @property ariaRole - @type String - @default null - @public - */ + Object.defineProperty(Application.prototype, 'registry', { + configurable: true, + enumerable: false, + get: function () { + return _emberRuntime.buildFakeRegistryWithDeprecations(this, 'Application'); + } + }); - /** - Enables components to take a list of parameters as arguments. - For example, a component that takes two parameters with the names - `name` and `age`: - ```javascript - let MyComponent = Ember.Component.extend; - MyComponent.reopenClass({ - positionalParams: ['name', 'age'] - }); - ``` - It can then be invoked like this: - ```hbs - {{my-component "John" 38}} - ``` - The parameters can be referred to just like named parameters: - ```hbs - Name: {{attrs.name}}, Age: {{attrs.age}}. - ``` - Using a string instead of an array allows for an arbitrary number of - parameters: - ```javascript - let MyComponent = Ember.Component.extend; - MyComponent.reopenClass({ - positionalParams: 'names' - }); - ``` - It can then be invoked like this: - ```hbs - {{my-component "John" "Michael" "Scott"}} - ``` - The parameters can then be referred to by enumerating over the list: - ```hbs - {{#each attrs.names as |name|}}{{name}}{{/each}} - ``` - @static - @public - @property positionalParams - @since 1.13.0 - */ - - /** - Called when the attributes passed into the component have been updated. - Called both during the initial render of a container and during a rerender. - Can be used in place of an observer; code placed here will be executed - every time any attribute updates. - @method didReceiveAttrs - @public - @since 1.13.0 - */ + Application.reopenClass({ + /** + This creates a registry with the default Ember naming conventions. + It also configures the registry: + * registered views are created every time they are looked up (they are + not singletons) + * registered templates are not factories; the registered value is + returned directly. + * the router receives the application as its `namespace` property + * all controllers receive the router as their `target` and `controllers` + properties + * 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 + @method buildRegistry + @static + @param {Ember.Application} namespace the application for which to + build the registry + @return {Ember.Registry} the built registry + @private + */ + buildRegistry: function (application) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - /** - Called when the attributes passed into the component have been updated. - Called both during the initial render of a container and during a rerender. - Can be used in place of an observer; code placed here will be executed - every time any attribute updates. - @event didReceiveAttrs - @public - @since 1.13.0 - */ + var registry = this._super.apply(this, arguments); - /** - Called after a component has been rendered, both on initial render and - in subsequent rerenders. - @method didRender - @public - @since 1.13.0 - */ + commonSetupRegistry(registry); - /** - Called after a component has been rendered, both on initial render and - in subsequent rerenders. - @event didRender - @public - @since 1.13.0 - */ + _emberGlimmer.setupApplicationRegistry(registry); - /** - Called before a component has been rendered, both on initial render and - in subsequent rerenders. - @method willRender - @public - @since 1.13.0 - */ + return registry; + } + }); - /** - Called before a component has been rendered, both on initial render and - in subsequent rerenders. - @event willRender - @public - @since 1.13.0 - */ + function commonSetupRegistry(registry) { + registry.register('-view-registry:main', { create: function () { + return _emberUtils.dictionary(null); + } }); - /** - Called when the attributes passed into the component have been changed. - Called only during a rerender, not during an initial render. - @method didUpdateAttrs - @public - @since 1.13.0 - */ + registry.register('route:basic', _emberRouting.Route); + registry.register('event_dispatcher:main', _emberViews.EventDispatcher); - /** - Called when the attributes passed into the component have been changed. - Called only during a rerender, not during an initial render. - @event didUpdateAttrs - @public - @since 1.13.0 - */ + registry.injection('router:main', 'namespace', 'application:main'); - /** - Called when the component is about to update and rerender itself. - Called only during a rerender, not during an initial render. - @method willUpdate - @public - @since 1.13.0 - */ + registry.register('location:auto', _emberRouting.AutoLocation); + registry.register('location:hash', _emberRouting.HashLocation); + registry.register('location:history', _emberRouting.HistoryLocation); + registry.register('location:none', _emberRouting.NoneLocation); - /** - Called when the component is about to update and rerender itself. - Called only during a rerender, not during an initial render. - @event willUpdate - @public - @since 1.13.0 - */ + registry.register(_container.privatize(_templateObject), _emberRouting.BucketCache); - /** - Called when the component has updated and rerendered itself. - Called only during a rerender, not during an initial render. - @method didUpdate - @public - @since 1.13.0 - */ + if (_emberMetal.isFeatureEnabled('ember-routing-router-service')) { + registry.register('service:router', _emberRouting.RouterService); + registry.injection('service:router', 'router', 'router:main'); + } + } - /** - Called when the component has updated and rerendered itself. - Called only during a rerender, not during an initial render. - @event didUpdate - @public - @since 1.13.0 - */ + function registerLibraries() { + if (!librariesRegistered) { + librariesRegistered = true; - /** - If `false`, the view will appear hidden in DOM. - @property isVisible - @type Boolean - @default null - @public - */ - Component[_emberMetal.NAME_KEY] = 'Ember.Component'; + if (_emberEnvironment.environment.hasDOM && typeof _emberViews.jQuery === 'function') { + _emberMetal.libraries.registerCoreLibrary('jQuery', _emberViews.jQuery().jquery); + } + } + } - Component.reopenClass({ - isComponentFactory: true, - positionalParams: [] - }); + function logLibraryVersions() {} - exports.default = Component; + exports.default = Application; }); -/** - Normally, Ember's component model is "write-only". The component takes a - bunch of attributes that it got passed in, and uses them to render its - template. - One nice thing about this model is that if you try to set a value to the - same thing as last time, Ember (through HTMLBars) will avoid doing any - work on the DOM. - This is not just a performance optimization. If an attribute has not - changed, it is important not to clobber the element's "hidden state". - For example, if you set an input's `value` to the same value as before, - it will clobber selection state and cursor position. In other words, - setting an attribute is not **always** idempotent. - This method provides a way to read an element's attribute and also - update the last value Ember knows about at the same time. This makes - setting an attribute idempotent. - In particular, what this means is that if you get an `` element's - `value` attribute and then re-render the template with the same value, - it will avoid clobbering the cursor and selection position. - Since most attribute sets are idempotent in the browser, you typically - can get away with reading attributes using jQuery, but the most reliable - way to do so is through this method. - @method readDOMAttr - @param {String} name the name of the attribute - @return String - @public - */ -enifed('ember-glimmer/components/checkbox', ['exports', 'ember-metal', 'ember-glimmer/component', 'ember-glimmer/templates/empty'], function (exports, _emberMetal, _emberGlimmerComponent, _emberGlimmerTemplatesEmpty) { - 'use strict'; - +// we only need to see this once per Application#init +enifed('ember-application/system/engine-instance', ['exports', 'ember-utils', 'ember-runtime', 'ember-metal', 'container', 'ember-application/system/engine-parent'], function (exports, _emberUtils, _emberRuntime, _emberMetal, _container, _emberApplicationSystemEngineParent) { /** @module ember - @submodule ember-views + @submodule ember-application */ + 'use strict'; + + var _EmberObject$extend; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); + /** - The internal class used to create text inputs when the `{{input}}` - helper is used with `type` of `checkbox`. - - See [Ember.Templates.helpers.input](/api/classes/Ember.Templates.helpers.html#method_input) for usage details. - - ## Direct manipulation of `checked` - - The `checked` attribute of an `Ember.Checkbox` object should always be set - through the Ember object or by interacting with its rendered element - representation via the mouse, keyboard, or touch. Updating the value of the - checkbox via jQuery will result in the checked value of the object and its - element losing synchronization. - - ## Layout and LayoutName properties - - Because HTML `input` elements are self closing `layout` and `layoutName` - properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s - layout section for more information. + The `EngineInstance` encapsulates all of the stateful aspects of a + running `Engine`. - @class Checkbox - @namespace Ember - @extends Ember.Component @public + @class Ember.EngineInstance + @extends Ember.Object + @uses RegistryProxyMixin + @uses ContainerProxyMixin */ - exports.default = _emberGlimmerComponent.default.extend({ - layout: _emberGlimmerTemplatesEmpty.default, - classNames: ['ember-checkbox'], - tagName: 'input', + var EngineInstance = _emberRuntime.Object.extend(_emberRuntime.RegistryProxyMixin, _emberRuntime.ContainerProxyMixin, (_EmberObject$extend = { + /** + The base `Engine` for which this is an instance. + @property {Ember.Engine} engine + @private + */ + base: null, - attributeBindings: ['type', 'checked', 'indeterminate', 'disabled', 'tabindex', 'name', 'autofocus', 'required', 'form'], + init: function () { + this._super.apply(this, arguments); - type: 'checkbox', - checked: false, - disabled: false, - indeterminate: false, + _emberUtils.guidFor(this); - didInsertElement: function () { + var base = this.base; + + if (!base) { + base = this.application; + this.base = base; + } + + // Create a per-instance registry that will use the application's registry + // as a fallback for resolving registrations. + var registry = this.__registry__ = new _container.Registry({ + fallback: base.__registry__ + }); + + // Create a per-instance container from the instance's registry + this.__container__ = registry.container({ owner: this }); + + this._booted = false; + }, + + /** + Initialize the `Ember.EngineInstance` and return a promise that resolves + with the instance itself when the boot process is complete. + The primary task here is to run any registered instance initializers. + See the documentation on `BootOptions` for the options it takes. + @private + @method boot + @param options {Object} + @return {Promise} + */ + boot: function (options) { + var _this = this; + + if (this._bootPromise) { + return this._bootPromise; + } + + this._bootPromise = new _emberRuntime.RSVP.Promise(function (resolve) { + return resolve(_this._bootSync(options)); + }); + + return this._bootPromise; + }, + + /** + Unfortunately, a lot of existing code assumes booting an instance is + synchronous – specifically, a lot of tests assume the last call to + `app.advanceReadiness()` or `app.reset()` will result in a new instance + being fully-booted when the current runloop completes. + We would like new code (like the `visit` API) to stop making this + assumption, so we created the asynchronous version above that returns a + promise. But until we have migrated all the code, we would have to expose + this method for use *internally* in places where we need to boot an instance + synchronously. + @private + */ + _bootSync: function (options) { + if (this._booted) { + return this; + } + + this.cloneParentDependencies(); + + this.setupRegistry(options); + + this.base.runInstanceInitializers(this); + + this._booted = true; + + return this; + }, + + setupRegistry: function () { + var options = arguments.length <= 0 || arguments[0] === undefined ? this.__container__.lookup('-environment:main') : arguments[0]; + + this.constructor.setupRegistry(this.__registry__, options); + }, + + /** + Unregister a factory. + Overrides `RegistryProxy#unregister` in order to clear any cached instances + of the unregistered factory. + @public + @method unregister + @param {String} fullName + */ + unregister: function (fullName) { + this.__container__.reset(fullName); this._super.apply(this, arguments); - _emberMetal.get(this, 'element').indeterminate = !!_emberMetal.get(this, 'indeterminate'); }, - change: function () { - _emberMetal.set(this, 'checked', this.$().prop('checked')); + /** + @private + */ + willDestroy: function () { + this._super.apply(this, arguments); + _emberMetal.run(this.__container__, 'destroy'); + }, + + /** + 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]; + + var Engine = this.lookup('engine:' + name); + + if (!Engine) { + throw new _emberMetal.Error('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); + + var registrations = ['route:basic', 'event_dispatcher:main', 'service:-routing', 'service:-glimmer-environment']; + + registrations.forEach(function (key) { + return _this2.register(key, parent.resolveRegistration(key)); + }); + + var env = parent.lookup('-environment:main'); + this.register('-environment:main', env, { instantiate: false }); + + var singletons = ['router:main', _container.privatize(_templateObject), '-view-registry:main', 'renderer:-' + (env.isInteractive ? 'dom' : 'inert')]; + + singletons.forEach(function (key) { + return _this2.register(key, parent.lookup(key), { instantiate: false }); + }); + + this.inject('view', '_environment', '-environment:main'); + this.inject('route', '_environment', '-environment:main'); + } + + }, _EmberObject$extend[_container.FACTORY_FOR] = function (fullName, options) { + return this.__container__[_container.FACTORY_FOR](fullName, options); + }, _EmberObject$extend[_container.LOOKUP_FACTORY] = function (fullName, options) { + return this.__container__[_container.LOOKUP_FACTORY](fullName, options); + }, _EmberObject$extend)); + + EngineInstance.reopenClass({ + /** + @private + @method setupRegistry + @param {Registry} registry + @param {BootOptions} options + */ + setupRegistry: function (registry, options) { + // when no options/environment is present, do nothing + if (!options) { + return; + } + + registry.injection('view', '_environment', '-environment:main'); + registry.injection('route', '_environment', '-environment:main'); + + if (options.isInteractive) { + registry.injection('view', 'renderer', 'renderer:-dom'); + registry.injection('component', 'renderer', 'renderer:-dom'); + } else { + registry.injection('view', 'renderer', 'renderer:-inert'); + registry.injection('component', 'renderer', 'renderer:-inert'); + } } }); + + exports.default = EngineInstance; }); -enifed('ember-glimmer/components/link-to', ['exports', 'ember-console', 'ember-metal', 'ember-runtime', 'ember-views', 'ember-glimmer/templates/link-to', 'ember-glimmer/component'], function (exports, _emberConsole, _emberMetal, _emberRuntime, _emberViews, _emberGlimmerTemplatesLinkTo, _emberGlimmerComponent) { +enifed('ember-application/system/engine-parent', ['exports', 'ember-utils'], function (exports, _emberUtils) { + 'use strict'; + + exports.getEngineParent = getEngineParent; + exports.setEngineParent = setEngineParent; + var ENGINE_PARENT = _emberUtils.symbol('ENGINE_PARENT'); + + exports.ENGINE_PARENT = ENGINE_PARENT; + /** + `getEngineParent` retrieves an engine instance's parent instance. + + @method getEngineParent + @param {EngineInstance} engine An engine instance. + @return {EngineInstance} The parent engine instance. + @for Ember + @public + */ + + function getEngineParent(engine) { + return engine[ENGINE_PARENT]; + } + + /** + `setEngineParent` sets an engine instance's parent instance. + + @method setEngineParent + @param {EngineInstance} engine An engine instance. + @param {EngineInstance} parent The parent engine instance. + @private + */ + + function setEngineParent(engine, parent) { + engine[ENGINE_PARENT] = parent; + } +}); +enifed('ember-application/system/engine', ['exports', 'ember-utils', 'ember-runtime', 'container', 'dag-map', 'ember-metal', 'ember-application/system/resolver', 'ember-application/system/engine-instance', 'ember-routing', 'ember-extension-support', 'ember-views', 'ember-glimmer'], function (exports, _emberUtils, _emberRuntime, _container, _dagMap, _emberMetal, _emberApplicationSystemResolver, _emberApplicationSystemEngineInstance, _emberRouting, _emberExtensionSupport, _emberViews, _emberGlimmer) { /** @module ember - @submodule ember-glimmer + @submodule ember-application */ + 'use strict'; + + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); + + function props(obj) { + var properties = []; + + for (var key in obj) { + properties.push(key); + } + + return properties; + } /** - The `{{link-to}}` component 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 - element: + The `Engine` class contains core functionality for both applications and + engines. - ```handlebars - {{#link-to 'photoGallery'}} - Great Hamster Photos - {{/link-to}} - ``` - - You can also use an inline form of `{{link-to}}` component by - passing the link text as the first argument - to the component: - - ```handlebars - {{link-to 'Great Hamster Photos' 'photoGallery'}} - ``` - - Both will result in: - - ```html - - Great Hamster Photos - - ``` - - ### Supplying a tagName - By default `{{link-to}}` renders an `` element. This can - be overridden for a single use of `{{link-to}}` by supplying - a `tagName` option: - - ```handlebars - {{#link-to 'photoGallery' tagName="li"}} - Great Hamster Photos - {{/link-to}} - ``` - - ```html -
  • - Great Hamster Photos -
  • - ``` - - To override this option for your entire application, see - "Overriding Application-wide Defaults". - - ### Disabling the `link-to` component - By default `{{link-to}}` is enabled. - any passed value to the `disabled` component property will disable - the `link-to` component. - - static use: the `disabled` option: - - ```handlebars - {{#link-to 'photoGallery' disabled=true}} - Great Hamster Photos - {{/link-to}} - ``` - - dynamic use: the `disabledWhen` option: - - ```handlebars - {{#link-to 'photoGallery' disabledWhen=controller.someProperty}} - Great Hamster Photos - {{/link-to}} - ``` - - any passed value to `disabled` will disable it except `undefined`. - to ensure that only `true` disable the `link-to` component you can - override the global behaviour of `Ember.LinkComponent`. - - ```javascript - Ember.LinkComponent.reopen({ - disabled: Ember.computed(function(key, value) { - if (value !== undefined) { - this.set('_isDisabled', value === true); - } - return value === true ? get(this, 'disabledClass') : false; - }) - }); - ``` - - see "Overriding Application-wide Defaults" for more. - - ### Handling `href` - `{{link-to}}` will use your application's Router to - fill the element's `href` property with a url that - matches the path to the supplied `routeName` for your - router's configured `Location` scheme, which defaults - to Ember.HashLocation. - - ### Handling current route - `{{link-to}}` will apply a CSS class name of 'active' - when the application's current route matches - the supplied routeName. For example, if the application's - current route is 'photoGallery.recent' the following - use of `{{link-to}}`: - - ```handlebars - {{#link-to 'photoGallery.recent'}} - Great Hamster Photos - {{/link-to}} - ``` - - will result in - - ```html -
    - Great Hamster Photos - - ``` - - The CSS class name used for active classes can be customized - for a single use of `{{link-to}}` by passing an `activeClass` - option: - - ```handlebars - {{#link-to 'photoGallery.recent' activeClass="current-url"}} - Great Hamster Photos - {{/link-to}} - ``` - - ```html - - Great Hamster Photos - - ``` - - To override this option for your entire application, see - "Overriding Application-wide Defaults". - - ### Keeping a link active for other routes - - If you need a link to be 'active' even when it doesn't match - the current route, you can use the `current-when` argument. - - ```handlebars - {{#link-to 'photoGallery' current-when='photos'}} - Photo Gallery - {{/link-to}} - ``` - - This may be helpful for keeping links active for: - - * non-nested routes that are logically related - * some secondary menu approaches - * 'top navigation' with 'sub navigation' scenarios - - A link will be active if `current-when` is `true` or the current - route is the route this link would transition to. - - To match multiple routes 'space-separate' the routes: - - ```handlebars - {{#link-to 'gallery' current-when='photos drawings paintings'}} - Art Gallery - {{/link-to}} - ``` - - ### Supplying a model - An optional model argument can be used for routes whose - paths contain dynamic segments. This argument will become - the model context of the linked route: - - ```javascript - Router.map(function() { - this.route("photoGallery", {path: "hamster-photos/:photo_id"}); - }); - ``` - - ```handlebars - {{#link-to 'photoGallery' aPhoto}} - {{aPhoto.title}} - {{/link-to}} - ``` - - ```html - - Tomster - - ``` - - ### Supplying multiple models - For deep-linking to route paths that contain multiple - dynamic segments, multiple model arguments can be used. - As the router transitions through the route path, each - supplied model argument will become the context for the - route with the dynamic segments: - - ```javascript - Router.map(function() { - this.route("photoGallery", { path: "hamster-photos/:photo_id" }, function() { - this.route("comment", {path: "comments/:comment_id"}); - }); - }); - ``` - This argument will become the model context of the linked route: - - ```handlebars - {{#link-to 'photoGallery.comment' aPhoto comment}} - {{comment.body}} - {{/link-to}} - ``` - - ```html - - A+++ would snuggle again. - - ``` - - ### Supplying an explicit dynamic segment value - If you don't have a model object available to pass to `{{link-to}}`, - an optional string or integer argument can be passed for routes whose - paths contain dynamic segments. This argument will become the value - of the dynamic segment: - - ```javascript - Router.map(function() { - this.route("photoGallery", { path: "hamster-photos/:photo_id" }); - }); - ``` - - ```handlebars - {{#link-to 'photoGallery' aPhotoId}} - {{aPhoto.title}} - {{/link-to}} - ``` - - ```html - - Tomster - - ``` - - When transitioning into the linked route, the `model` hook will - be triggered with parameters including this passed identifier. - - ### Allowing Default Action - - By default the `{{link-to}}` component prevents the default browser action - by calling `preventDefault()` as this sort of action bubbling is normally - handled internally and we do not want to take the browser to a new URL (for - example). - - If you need to override this behavior specify `preventDefault=false` in - your template: - - ```handlebars - {{#link-to 'photoGallery' aPhotoId preventDefault=false}} - {{aPhotoId.title}} - {{/link-to}} - ``` - - ### Overriding attributes - You can override any given property of the `Ember.LinkComponent` - that is generated by the `{{link-to}}` component by passing - key/value pairs, like so: - - ```handlebars - {{#link-to aPhoto tagName='li' title='Following this link will change your life' classNames='pic sweet'}} - Uh-mazing! - {{/link-to}} - ``` - - See [Ember.LinkComponent](/api/classes/Ember.LinkComponent.html) for a - complete list of overrideable properties. Be sure to also - check out inherited properties of `LinkComponent`. - - ### Overriding Application-wide Defaults - ``{{link-to}}`` creates an instance of `Ember.LinkComponent` - for rendering. To override options for your entire - application, reopen `Ember.LinkComponent` and supply the - desired values: - - ``` javascript - Ember.LinkComponent.reopen({ - activeClass: "is-active", - tagName: 'li' - }) - ``` + Each engine manages a registry that's used for dependency injection and + exposed through `RegistryProxy`. - It is also possible to override the default event in - this manner: + Engines also manage initializers and instance initializers. - ``` javascript - Ember.LinkComponent.reopen({ - eventName: 'customEventName' - }); - ``` + Engines can spawn `EngineInstance` instances via `buildInstance()`. - @method link-to - @for Ember.Templates.helpers - @param {String} routeName - @param {Object} [context]* - @param [options] {Object} Handlebars key/value pairs of options, you can override any property of Ember.LinkComponent - @return {String} HTML string - @see {Ember.LinkComponent} + @class Engine + @namespace Ember + @extends Ember.Namespace + @uses RegistryProxy @public */ + var Engine = _emberRuntime.Namespace.extend(_emberRuntime.RegistryProxyMixin, { + init: function () { + this._super.apply(this, arguments); - 'use strict'; - - /** - `Ember.LinkComponent` renders an element whose `click` event triggers a - transition of the application's instance of `Ember.Router` to - a supplied route by name. - - `Ember.LinkComponent` components are invoked with {{#link-to}}. Properties - of this class can be overridden with `reopen` to customize application-wide - behavior. - - @class LinkComponent - @namespace Ember - @extends Ember.Component - @see {Ember.Templates.helpers.link-to} - @private - **/ - var LinkComponent = _emberGlimmerComponent.default.extend({ - layout: _emberGlimmerTemplatesLinkTo.default, - - tagName: 'a', + this.buildRegistry(); + }, /** - @deprecated Use current-when instead. - @property currentWhen - @private + A private flag indicating whether an engine's initializers have run yet. + @private + @property _initializersRan */ - currentWhen: _emberRuntime.deprecatingAlias('current-when', { id: 'ember-routing-view.deprecated-current-when', until: '3.0.0' }), + _initializersRan: false, /** - Used to determine when this `LinkComponent` is active. - @property currentWhen - @public + Ensure that initializers are run once, and only once, per engine. + @private + @method ensureInitializers */ - 'current-when': null, - - /** - Sets the `title` attribute of the `LinkComponent`'s HTML element. - @property title - @default null - @public - **/ - title: null, - - /** - Sets the `rel` attribute of the `LinkComponent`'s HTML element. - @property rel - @default null - @public - **/ - rel: null, + ensureInitializers: function () { + if (!this._initializersRan) { + this.runInitializers(); + this._initializersRan = true; + } + }, /** - Sets the `tabindex` attribute of the `LinkComponent`'s HTML element. - @property tabindex - @default null - @public - **/ - tabindex: null, + Create an EngineInstance for this engine. + @private + @method buildInstance + @return {Ember.EngineInstance} the engine instance + */ + buildInstance: function () { + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - /** - Sets the `target` attribute of the `LinkComponent`'s HTML element. - @since 1.8.0 - @property target - @default null - @public - **/ - target: null, + this.ensureInitializers(); + options.base = this; + return _emberApplicationSystemEngineInstance.default.create(options); + }, /** - The CSS class to apply to `LinkComponent`'s element when its `active` - property is `true`. - @property activeClass - @type String - @default active - @public - **/ - activeClass: 'active', + Build and configure the registry for the current engine. + @private + @method buildRegistry + @return {Ember.Registry} the configured registry + */ + buildRegistry: function () { + var registry = this.__registry__ = this.constructor.buildRegistry(this); - /** - The CSS class to apply to `LinkComponent`'s element when its `loading` - property is `true`. - @property loadingClass - @type String - @default loading - @private - **/ - loadingClass: 'loading', + return registry; + }, /** - The CSS class to apply to a `LinkComponent`'s element when its `disabled` - property is `true`. - @property disabledClass - @type String - @default disabled @private - **/ - disabledClass: 'disabled', - _isDisabled: false, - - /** - Determines whether the `LinkComponent` will trigger routing via - the `replaceWith` routing strategy. - @property replace - @type Boolean - @default false - @public - **/ - replace: false, - - /** - By default the `{{link-to}}` component 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'] - @public - */ - attributeBindings: ['href', 'title', 'rel', 'tabindex', 'target'], - - /** - By default the `{{link-to}}` component will bind to the `active`, `loading`, - and `disabled` classes. It is discouraged to override these directly. - @property classNameBindings - @type Array - @default ['active', 'loading', 'disabled', 'ember-transitioning-in', 'ember-transitioning-out'] - @public + @method initializer */ - classNameBindings: ['active', 'loading', 'disabled', 'transitioningIn', 'transitioningOut'], + initializer: function (options) { + this.constructor.initializer(options); + }, /** - By default the `{{link-to}}` component responds to the `click` event. You - can override this globally by setting this property to your custom - event name. - This is particularly useful on mobile when one wants to avoid the 300ms - click delay using some sort of custom `tap` event. - @property eventName - @type String - @default click @private + @method instanceInitializer */ - eventName: 'click', + instanceInitializer: function (options) { + this.constructor.instanceInitializer(options); + }, - // this is doc'ed here so it shows up in the events - // section of the API documentation, which is where - // people will likely go looking for it. /** - Triggers the `LinkComponent`'s routing behavior. If - `eventName` is changed to a value other than `click` - the routing behavior will trigger on that custom event - instead. - @event click @private + @method runInitializers */ + runInitializers: function () { + var _this = this; - /** - An overridable method called when `LinkComponent` objects are instantiated. - Example: - ```javascript - App.MyLinkComponent = Ember.LinkComponent.extend({ - init: function() { - this._super(...arguments); - Ember.Logger.log('Event is ' + this.get('eventName')); + this._runInitializer('initializers', function (name, initializer) { + if (initializer.initialize.length === 2) { + + initializer.initialize(_this.__registry__, _this); + } else { + initializer.initialize(_this); } }); - ``` - NOTE: If you do override `init` for a framework class like `Ember.View`, - be sure to call `this._super(...arguments)` in your - `init` declaration! If you don't, Ember may not have an opportunity to - do important setup work, and you'll see strange behavior in your - application. - @method init - @private - */ - init: function () { - this._super.apply(this, arguments); - - // Map desired event name to invoke function - var eventName = _emberMetal.get(this, 'eventName'); - this.on(eventName, this, this._invoke); }, - _routing: _emberRuntime.inject.service('-routing'), - /** - Accessed as a classname binding to apply the `LinkComponent`'s `disabledClass` - CSS `class` to the element when the link is disabled. - When `true` interactions with the element will not trigger route changes. - @property disabled @private + @since 1.12.0 + @method runInstanceInitializers */ - disabled: _emberMetal.computed({ - get: function (key, value) { - return false; - }, - set: function (key, value) { - if (value !== undefined) { - this.set('_isDisabled', value); - } + runInstanceInitializers: function (instance) { + this._runInitializer('instanceInitializers', function (name, initializer) { + initializer.initialize(instance); + }); + }, - return value ? _emberMetal.get(this, 'disabledClass') : false; - } - }), + _runInitializer: function (bucketName, cb) { + var initializersByName = _emberMetal.get(this.constructor, bucketName); + var initializers = props(initializersByName); + var graph = new _dagMap.default(); + var initializer = undefined; - _computeActive: function (routerState) { - if (_emberMetal.get(this, 'loading')) { - return false; + for (var i = 0; i < initializers.length; i++) { + initializer = initializersByName[initializers[i]]; + graph.add(initializer.name, initializer, initializer.before, initializer.after); } - var routing = _emberMetal.get(this, '_routing'); - var models = _emberMetal.get(this, 'models'); - var resolvedQueryParams = _emberMetal.get(this, 'resolvedQueryParams'); + graph.topsort(cb); + } + }); - var currentWhen = _emberMetal.get(this, 'current-when'); - var isCurrentWhenSpecified = !!currentWhen; - currentWhen = currentWhen || _emberMetal.get(this, 'qualifiedRouteName'); - currentWhen = currentWhen.split(' '); + Engine.reopenClass({ + initializers: new _emberUtils.EmptyObject(), + instanceInitializers: new _emberUtils.EmptyObject(), - for (var i = 0; i < currentWhen.length; i++) { - if (routing.isActiveForRoute(models, resolvedQueryParams, currentWhen[i], routerState, isCurrentWhenSpecified)) { - return _emberMetal.get(this, 'activeClass'); + /** + The goal of initializers should be to register dependencies and injections. + This phase runs once. Because these initializers may load code, they are + allowed to defer application readiness and advance it. If you need to access + the container or store you should use an InstanceInitializer that will be run + after all initializers and therefore after all code is loaded and the app is + ready. + Initializer receives an object which has the following attributes: + `name`, `before`, `after`, `initialize`. The only required attribute is + `initialize`, all others are optional. + * `name` allows you to specify under which name the initializer is registered. + This must be a unique name, as trying to register two initializers with the + same name will result in an error. + ```javascript + Ember.Application.initializer({ + name: 'namedInitializer', + initialize: function(application) { + Ember.debug('Running namedInitializer!'); } - } + }); + ``` + * `before` and `after` are used to ensure that this initializer is ran prior + or after the one identified by the value. This value can be a single string + or an array of strings, referencing the `name` of other initializers. + An example of ordering initializers, we create an initializer named `first`: + ```javascript + Ember.Application.initializer({ + name: 'first', + initialize: function(application) { + Ember.debug('First initializer!'); + } + }); + // DEBUG: First initializer! + ``` + We add another initializer named `second`, specifying that it should run + after the initializer named `first`: + ```javascript + Ember.Application.initializer({ + name: 'second', + after: 'first', + initialize: function(application) { + Ember.debug('Second initializer!'); + } + }); + // DEBUG: First initializer! + // DEBUG: Second initializer! + ``` + Afterwards we add a further initializer named `pre`, this time specifying + that it should run before the initializer named `first`: + ```javascript + Ember.Application.initializer({ + name: 'pre', + before: 'first', + initialize: function(application) { + Ember.debug('Pre initializer!'); + } + }); + // DEBUG: Pre initializer! + // DEBUG: First initializer! + // DEBUG: Second initializer! + ``` + Finally we add an initializer named `post`, specifying it should run after + both the `first` and the `second` initializers: + ```javascript + Ember.Application.initializer({ + name: 'post', + after: ['first', 'second'], + initialize: function(application) { + Ember.debug('Post initializer!'); + } + }); + // DEBUG: Pre initializer! + // DEBUG: First initializer! + // DEBUG: Second initializer! + // DEBUG: Post initializer! + ``` + * `initialize` is a callback function that receives one argument, + `application`, on which you can operate. + Example of using `application` to register an adapter: + ```javascript + Ember.Application.initializer({ + name: 'api-adapter', + initialize: function(application) { + application.register('api-adapter:main', ApiAdapter); + } + }); + ``` + @method initializer + @param initializer {Object} + @public + */ - return false; - }, + initializer: buildInitializerMethod('initializers', 'initializer'), /** - Accessed as a classname binding to apply the `LinkComponent`'s `activeClass` - CSS `class` to the element when the link is active. - A `LinkComponent` is considered active when its `currentWhen` property is `true` - or the application's current route is the route the `LinkComponent` would trigger - transitions into. - The `currentWhen` property can match against multiple routes by separating - route names using the ` ` (space) character. - @property active - @private + Instance initializers run after all initializers have run. Because + instance initializers run after the app is fully set up. We have access + to the store, container, and other items. However, these initializers run + after code has loaded and are not allowed to defer readiness. + Instance initializer receives an object which has the following attributes: + `name`, `before`, `after`, `initialize`. The only required attribute is + `initialize`, all others are optional. + * `name` allows you to specify under which name the instanceInitializer is + registered. This must be a unique name, as trying to register two + instanceInitializer with the same name will result in an error. + ```javascript + Ember.Application.instanceInitializer({ + name: 'namedinstanceInitializer', + initialize: function(application) { + Ember.debug('Running namedInitializer!'); + } + }); + ``` + * `before` and `after` are used to ensure that this initializer is ran prior + or after the one identified by the value. This value can be a single string + or an array of strings, referencing the `name` of other initializers. + * See Ember.Application.initializer for discussion on the usage of before + and after. + Example instanceInitializer to preload data into the store. + ```javascript + Ember.Application.initializer({ + name: 'preload-data', + initialize: function(application) { + var userConfig, userConfigEncoded, store; + // We have a HTML escaped JSON representation of the user's basic + // configuration generated server side and stored in the DOM of the main + // index.html file. This allows the app to have access to a set of data + // without making any additional remote calls. Good for basic data that is + // needed for immediate rendering of the page. Keep in mind, this data, + // like all local models and data can be manipulated by the user, so it + // should not be relied upon for security or authorization. + // + // Grab the encoded data from the meta tag + userConfigEncoded = Ember.$('head meta[name=app-user-config]').attr('content'); + // Unescape the text, then parse the resulting JSON into a real object + userConfig = JSON.parse(unescape(userConfigEncoded)); + // Lookup the store + store = application.lookup('service:store'); + // Push the encoded JSON into the store + store.pushPayload(userConfig); + } + }); + ``` + @method instanceInitializer + @param instanceInitializer + @public */ - active: _emberMetal.computed('attrs.params', '_routing.currentState', function computeLinkToComponentActive() { - var currentState = _emberMetal.get(this, '_routing.currentState'); - if (!currentState) { - return false; - } - - return this._computeActive(currentState); - }), - - willBeActive: _emberMetal.computed('_routing.targetState', function computeLinkToComponentWillBeActive() { - var routing = _emberMetal.get(this, '_routing'); - var targetState = _emberMetal.get(routing, 'targetState'); - if (_emberMetal.get(routing, 'currentState') === targetState) { - return; - } - - return !!this._computeActive(targetState); - }), - - transitioningIn: _emberMetal.computed('active', 'willBeActive', function computeLinkToComponentTransitioningIn() { - var willBeActive = _emberMetal.get(this, 'willBeActive'); - if (typeof willBeActive === 'undefined') { - return false; - } - - return !_emberMetal.get(this, 'active') && willBeActive && 'ember-transitioning-in'; - }), - - transitioningOut: _emberMetal.computed('active', 'willBeActive', function computeLinkToComponentTransitioningOut() { - var willBeActive = _emberMetal.get(this, 'willBeActive'); - if (typeof willBeActive === 'undefined') { - return false; - } - - return _emberMetal.get(this, 'active') && !willBeActive && 'ember-transitioning-out'; - }), + instanceInitializer: buildInitializerMethod('instanceInitializers', 'instance initializer'), /** - Event handler that invokes the link, activating the associated route. - @method _invoke - @param {Event} event + This creates a registry with the default Ember naming conventions. + It also configures the registry: + * registered views are created every time they are looked up (they are + not singletons) + * registered templates are not factories; the registered value is + returned directly. + * the router receives the application as its `namespace` property + * all controllers receive the router as their `target` and `controllers` + properties + * 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 + @method buildRegistry + @static + @param {Ember.Application} namespace the application for which to + build the registry + @return {Ember.Registry} the built registry @private */ - _invoke: function (event) { - if (!_emberViews.isSimpleClick(event)) { - return true; - } - - var preventDefault = _emberMetal.get(this, 'preventDefault'); - var targetAttribute = _emberMetal.get(this, 'target'); - - if (preventDefault !== false) { - if (!targetAttribute || targetAttribute === '_self') { - event.preventDefault(); - } - } - - if (_emberMetal.get(this, 'bubbles') === false) { - event.stopPropagation(); - } - - if (_emberMetal.get(this, '_isDisabled')) { - return false; - } - - if (_emberMetal.get(this, 'loading')) { - _emberConsole.default.warn('This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid.'); - return false; - } + buildRegistry: function (namespace) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - if (targetAttribute && targetAttribute !== '_self') { - return false; - } + var registry = new _container.Registry({ + resolver: resolverFor(namespace) + }); - var qualifiedRouteName = _emberMetal.get(this, 'qualifiedRouteName'); - var models = _emberMetal.get(this, 'models'); - var queryParams = _emberMetal.get(this, 'queryParams.values'); - var shouldReplace = _emberMetal.get(this, 'replace'); + registry.set = _emberMetal.set; - var payload = { - queryParams: queryParams, - routeName: qualifiedRouteName - }; + registry.register('application:main', namespace, { instantiate: false }); - _emberMetal.flaggedInstrument('interaction.link-to', payload, this._generateTransition(payload, qualifiedRouteName, models, queryParams, shouldReplace)); - }, + commonSetupRegistry(registry); + _emberGlimmer.setupEngineRegistry(registry); - _generateTransition: function (payload, qualifiedRouteName, models, queryParams, shouldReplace) { - var routing = _emberMetal.get(this, '_routing'); - return function () { - payload.transition = routing.transitionTo(qualifiedRouteName, models, queryParams, shouldReplace); - }; + return registry; }, - queryParams: null, - - qualifiedRouteName: _emberMetal.computed('targetRouteName', '_routing.currentState', function computeLinkToComponentQualifiedRouteName() { - var params = _emberMetal.get(this, 'params').slice(); - var lastParam = params[params.length - 1]; - if (lastParam && lastParam.isQueryParams) { - params.pop(); - } - var onlyQueryParamsSupplied = this[_emberGlimmerComponent.HAS_BLOCK] ? params.length === 0 : params.length === 1; - if (onlyQueryParamsSupplied) { - return _emberMetal.get(this, '_routing.currentRouteName'); - } - return _emberMetal.get(this, 'targetRouteName'); - }), - - resolvedQueryParams: _emberMetal.computed('queryParams', function computeLinkToComponentResolvedQueryParams() { - var resolvedQueryParams = {}; - var queryParams = _emberMetal.get(this, 'queryParams'); - - if (!queryParams) { - return resolvedQueryParams; - } - - var values = queryParams.values; - for (var key in values) { - if (!values.hasOwnProperty(key)) { - continue; - } - resolvedQueryParams[key] = values[key]; - } - - return resolvedQueryParams; - }), - /** - Sets the element's `href` attribute to the url for - the `LinkComponent`'s targeted route. - If the `LinkComponent`'s `tagName` is changed to a value other - than `a`, this property will be ignored. - @property href - @private + Set this to provide an alternate class to `Ember.DefaultResolver` + @deprecated Use 'Resolver' instead + @property resolver + @public */ - href: _emberMetal.computed('models', 'qualifiedRouteName', function computeLinkToComponentHref() { - if (_emberMetal.get(this, 'tagName') !== 'a') { - return; - } - - var qualifiedRouteName = _emberMetal.get(this, 'qualifiedRouteName'); - var models = _emberMetal.get(this, 'models'); - - if (_emberMetal.get(this, 'loading')) { - return _emberMetal.get(this, 'loadingHref'); - } - - var routing = _emberMetal.get(this, '_routing'); - var queryParams = _emberMetal.get(this, 'queryParams.values'); + resolver: null, - return routing.generateURL(qualifiedRouteName, models, queryParams); - }), + /** + Set this to provide an alternate class to `Ember.DefaultResolver` + @property resolver + @public + */ + Resolver: null + }); - loading: _emberMetal.computed('_modelsAreLoaded', 'qualifiedRouteName', function computeLinkToComponentLoading() { - var qualifiedRouteName = _emberMetal.get(this, 'qualifiedRouteName'); - var modelsAreLoaded = _emberMetal.get(this, '_modelsAreLoaded'); + /** + This function defines the default lookup rules for container lookups: + + * templates are looked up on `Ember.TEMPLATES` + * other names are looked up on the application after classifying the name. + For example, `controller:post` looks up `App.PostController` by default. + * if the default lookup fails, look for registered classes on the container + + This allows the application to register default injections in the container + that could be overridden by the normal naming convention. + + @private + @method resolverFor + @param {Ember.Namespace} namespace the namespace to look for classes + @return {*} the resolved value for a given lookup + */ + function resolverFor(namespace) { + var ResolverClass = namespace.get('Resolver') || _emberApplicationSystemResolver.default; - if (!modelsAreLoaded || qualifiedRouteName == null) { - return _emberMetal.get(this, 'loadingClass'); - } - }), + return ResolverClass.create({ + namespace: namespace + }); + } - _modelsAreLoaded: _emberMetal.computed('models', function computeLinkToComponentModelsAreLoaded() { - var models = _emberMetal.get(this, 'models'); - for (var i = 0; i < models.length; i++) { - if (models[i] == null) { - return false; - } + function buildInitializerMethod(bucketName, humanName) { + return function (initializer) { + // If this is the first initializer being added to a subclass, we are going to reopen the class + // to make sure we have a new `initializers` object, which extends from the parent class' using + // prototypal inheritance. Without this, attempting to add initializers to the subclass would + // pollute the parent class as well as other subclasses. + if (this.superclass[bucketName] !== undefined && this.superclass[bucketName] === this[bucketName]) { + var attrs = {}; + attrs[bucketName] = Object.create(this[bucketName]); + this.reopenClass(attrs); } - return true; - }), + this[bucketName][initializer.name] = initializer; + }; + } - _getModels: function (params) { - var modelCount = params.length - 1; - var models = new Array(modelCount); + function commonSetupRegistry(registry) { + registry.optionsForType('component', { singleton: false }); + registry.optionsForType('view', { singleton: false }); - for (var i = 0; i < modelCount; i++) { - var value = params[i + 1]; + registry.register('controller:basic', _emberRuntime.Controller, { instantiate: false }); - while (_emberRuntime.ControllerMixin.detect(value)) { - value = value.get('model'); - } + registry.injection('view', '_viewRegistry', '-view-registry:main'); + registry.injection('renderer', '_viewRegistry', '-view-registry:main'); + registry.injection('event_dispatcher:main', '_viewRegistry', '-view-registry:main'); - models[i] = value; - } + registry.injection('route', '_topLevelViewTemplate', 'template:-outlet'); - return models; - }, + registry.injection('view:-outlet', 'namespace', 'application:main'); - /** - The default href value to use while a link-to is loading. - Only applies when tagName is 'a' - @property loadingHref - @type String - @default # - @private - */ - loadingHref: '#', + registry.injection('controller', 'target', 'router:main'); + registry.injection('controller', 'namespace', 'application:main'); - didReceiveAttrs: function () { - var queryParams = undefined; + registry.injection('router', '_bucketCache', _container.privatize(_templateObject)); + registry.injection('route', '_bucketCache', _container.privatize(_templateObject)); - var params = _emberMetal.get(this, 'params'); + registry.injection('route', 'router', 'router:main'); - if (params) { - // Do not mutate params in place - params = params.slice(); - } + // Register the routing service... + registry.register('service:-routing', _emberRouting.RoutingService); + // Then inject the app router into it + registry.injection('service:-routing', 'router', 'router:main'); - var disabledWhen = _emberMetal.get(this, 'disabledWhen'); - if (disabledWhen !== undefined) { - this.set('disabled', disabledWhen); - } + // DEBUGGING + registry.register('resolver-for-debugging:main', registry.resolver, { instantiate: false }); + registry.injection('container-debug-adapter:main', 'resolver', 'resolver-for-debugging:main'); + registry.injection('data-adapter:main', 'containerDebugAdapter', 'container-debug-adapter:main'); + // Custom resolver authors may want to register their own ContainerDebugAdapter with this key - // Process the positional arguments, in order. - // 1. Inline link title comes first, if present. - if (!this[_emberGlimmerComponent.HAS_BLOCK]) { - this.set('linkTitle', params.shift()); - } + registry.register('container-debug-adapter:main', _emberExtensionSupport.ContainerDebugAdapter); - // 2. `targetRouteName` is now always at index 0. - this.set('targetRouteName', params[0]); + registry.register('component-lookup:main', _emberViews.ComponentLookup); + } - // 3. The last argument (if still remaining) is the `queryParams` object. - var lastParam = params[params.length - 1]; + exports.default = Engine; +}); +enifed('ember-application/system/resolver', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-application/utils/validate-type', 'ember-glimmer'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberApplicationUtilsValidateType, _emberGlimmer) { + /** + @module ember + @submodule ember-application + */ - if (lastParam && lastParam.isQueryParams) { - queryParams = params.pop(); - } else { - queryParams = { values: {} }; - } - this.set('queryParams', queryParams); + 'use strict'; - // 4. Any remaining indices (excepting `targetRouteName` at 0) are `models`. - if (params.length > 1) { - this.set('models', this._getModels(params)); - } else { - this.set('models', []); - } - } - }); - - LinkComponent.toString = function () { - return 'LinkComponent'; - }; - - LinkComponent.reopenClass({ - positionalParams: 'params' + var Resolver = _emberRuntime.Object.extend({ + /* + This will be set to the Application instance when it is + created. + @property namespace + */ + namespace: null, + normalize: null, // required + resolve: null, // required + parseName: null, // required + lookupDescription: null, // required + makeToString: null, // required + resolveOther: null, // required + _logLookup: null // required }); - exports.default = LinkComponent; -}); - -/* - * Unfortunately, to get decent error messages, we need to do this. - * In some future state we should be able to use a "feature flag" - * which allows us to strip this without needing to call it twice. - * - * if (isDebugBuild()) { - * // Do the useful debug thing, probably including try/catch. - * } else { - * // Do the performant thing. - * } - */ -enifed('ember-glimmer/components/text_area', ['exports', 'ember-glimmer/component', 'ember-views', 'ember-glimmer/templates/empty'], function (exports, _emberGlimmerComponent, _emberViews, _emberGlimmerTemplatesEmpty) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; - + exports.Resolver = Resolver; /** - `{{textarea}}` inserts a new instance of ` - ``` - - Bound: - - In the following example, the `writtenWords` property on `App.ApplicationController` - will be updated live as the user types 'Lots of text that IS bound' into - the text area of their browser's window. - - ```javascript - App.ApplicationController = Ember.Controller.extend({ - writtenWords: "Lots of text that IS bound" - }); - ``` - - ```handlebars - {{textarea value=writtenWords}} - ``` - - Would result in the following HTML: + The DefaultResolver defines the default lookup rules to resolve + container lookups before consulting the container for registered + items: - ```html - - ``` + * templates are looked up on `Ember.TEMPLATES` + * other names are looked up on the application after converting + the name. For example, `controller:post` looks up + `App.PostController` by default. + * there are some nuances (see examples below) - If you wanted a one way binding between the text area and a div tag - somewhere else on your screen, you could use `Ember.computed.oneWay`: + ### How Resolving Works - ```javascript - App.ApplicationController = Ember.Controller.extend({ - writtenWords: "Lots of text that IS bound", - outputWrittenWords: Ember.computed.oneWay("writtenWords") - }); - ``` + The container calls this object's `resolve` method with the + `fullName` argument. - ```handlebars - {{textarea value=writtenWords}} -
    - {{outputWrittenWords}} -
    - ``` + It first parses the fullName into an object using `parseName`. - Would result in the following HTML: + Then it checks for the presence of a type-specific instance + method of the form `resolve[Type]` and calls it if it exists. + For example if it was resolving 'template:post', it would call + the `resolveTemplate` method. - ```html - - <-- the following div will be updated in real time as you type --> -
    - Lots of text that IS bound -
    - ``` + Its last resort is to call the `resolveOther` method. - Finally, this example really shows the power and ease of Ember when two - properties are bound to eachother via `Ember.computed.alias`. Type into - either text area box and they'll both stay in sync. Note that - `Ember.computed.alias` costs more in terms of performance, so only use it when - your really binding in both directions: + The methods of this object are designed to be easy to override + in a subclass. For example, you could enhance how a template + is resolved like so: ```javascript - App.ApplicationController = Ember.Controller.extend({ - writtenWords: "Lots of text that IS bound", - twoWayWrittenWords: Ember.computed.alias("writtenWords") + App = Ember.Application.create({ + Resolver: Ember.DefaultResolver.extend({ + resolveTemplate: function(parsedName) { + let resolvedTemplate = this._super(parsedName); + if (resolvedTemplate) { return resolvedTemplate; } + return Ember.TEMPLATES['not_found']; + } + }) }); ``` - ```handlebars - {{textarea value=writtenWords}} - {{textarea value=twoWayWrittenWords}} - ``` - - ```html - - <-- both updated in real time --> - - ``` - - ### Actions - - The helper can send multiple actions based on user events. - The action property defines the action which is send when - the user presses the return key. - - ```handlebars - {{input action="submit"}} - ``` - - The helper allows some user events to send actions. - - * `enter` - * `insert-newline` - * `escape-press` - * `focus-in` - * `focus-out` - * `key-press` - - For example, if you desire an action to be sent when the input is blurred, - you only need to setup the action name to the event name property. + Some examples of how names are resolved: - ```handlebars - {{textarea focus-in="alertMessage"}} ``` - - See more about [Text Support Actions](/api/classes/Ember.TextArea.html) - - ### Extension - - Internally, `{{textarea}}` creates an instance of `Ember.TextArea`, passing - arguments from the helper to `Ember.TextArea`'s `create` method. You can - extend the capabilities of text areas in your application by reopening this - class. For example, if you are building a Bootstrap project where `data-*` - attributes are used, you can globally add support for a `data-*` attribute - on all `{{textarea}}`s' in your app by reopening `Ember.TextArea` or - `Ember.TextSupport` and adding it to the `attributeBindings` concatenated - property: - - ```javascript - Ember.TextArea.reopen({ - attributeBindings: ['data-error'] - }); + 'template:post' //=> Ember.TEMPLATES['post'] + 'template:posts/byline' //=> Ember.TEMPLATES['posts/byline'] + 'template:posts.byline' //=> Ember.TEMPLATES['posts/byline'] + 'template:blogPost' //=> Ember.TEMPLATES['blogPost'] + // OR + // Ember.TEMPLATES['blog_post'] + 'controller:post' //=> App.PostController + 'controller:posts.index' //=> App.PostsIndexController + 'controller:blog/post' //=> Blog.PostController + 'controller:basic' //=> Ember.Controller + 'route:post' //=> App.PostRoute + 'route:posts.index' //=> App.PostsIndexRoute + 'route:blog/post' //=> Blog.PostRoute + 'route:basic' //=> Ember.Route + 'view:post' //=> App.PostView + 'view:posts.index' //=> App.PostsIndexView + 'view:blog/post' //=> Blog.PostView + 'view:basic' //=> Ember.View + 'foo:post' //=> App.PostFoo + 'model:post' //=> App.Post ``` - Keep in mind when writing `Ember.TextArea` subclasses that `Ember.TextArea` - itself extends `Ember.Component`. Expect isolated component semantics, not - legacy 1.x view semantics (like `controller` being present). - - See more about [Ember components](/api/classes/Ember.Component.html) - - @method textarea - @for Ember.Templates.helpers - @param {Hash} options - @public - */ - - /** - The internal class used to create textarea element when the `{{textarea}}` - helper is used. - - See [Ember.Templates.helpers.textarea](/api/classes/Ember.Templates.helpers.html#method_textarea) for usage details. - - ## Layout and LayoutName properties - - Because HTML `textarea` elements do not contain inner HTML the `layout` and - `layoutName` properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s - layout section for more information. - - @class TextArea + @class DefaultResolver @namespace Ember - @extends Ember.Component - @uses Ember.TextSupport + @extends Ember.Object @public */ - exports.default = _emberGlimmerComponent.default.extend(_emberViews.TextSupport, { - classNames: ['ember-text-area'], - - layout: _emberGlimmerTemplatesEmpty.default, - - tagName: 'textarea', - attributeBindings: ['rows', 'cols', 'name', 'selectionEnd', 'selectionStart', 'wrap', 'lang', 'dir', 'value'], - rows: null, - cols: null - }); -}); -enifed('ember-glimmer/components/text_field', ['exports', 'ember-utils', 'ember-metal', 'ember-environment', 'ember-glimmer/component', 'ember-glimmer/templates/empty', 'ember-views'], function (exports, _emberUtils, _emberMetal, _emberEnvironment, _emberGlimmerComponent, _emberGlimmerTemplatesEmpty, _emberViews) { - /** - @module ember - @submodule ember-views - */ - 'use strict'; - var inputTypeTestElement = undefined; - var inputTypes = new _emberUtils.EmptyObject(); - function canSetTypeOfInput(type) { - if (type in inputTypes) { - return inputTypes[type]; - } + exports.default = _emberRuntime.Object.extend({ + /** + This will be set to the Application instance when it is + created. + @property namespace + @public + */ + namespace: null, - // if running in outside of a browser always return the - // original type - if (!_emberEnvironment.environment.hasDOM) { - inputTypes[type] = type; + init: function () { + this._parseNameCache = _emberUtils.dictionary(null); + }, + normalize: function (fullName) { + var _fullName$split = fullName.split(':', 2); - return type; - } + var type = _fullName$split[0]; + var name = _fullName$split[1]; - if (!inputTypeTestElement) { - inputTypeTestElement = document.createElement('input'); - } + if (type !== 'template') { + var result = name; - try { - inputTypeTestElement.type = type; - } catch (e) {} + if (result.indexOf('.') > -1) { + result = result.replace(/\.(.)/g, function (m) { + return m.charAt(1).toUpperCase(); + }); + } - return inputTypes[type] = inputTypeTestElement.type === type; - } + if (name.indexOf('_') > -1) { + result = result.replace(/_(.)/g, function (m) { + return m.charAt(1).toUpperCase(); + }); + } - /** - - The internal class used to create text inputs when the `{{input}}` - helper is used with `type` of `text`. - - See [Ember.Templates.helpers.input](/api/classes/Ember.Templates.helpers.html#method_input) for usage details. - - ## Layout and LayoutName properties - - Because HTML `input` elements are self closing `layout` and `layoutName` - properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s - layout section for more information. - - @class TextField - @namespace Ember - @extends Ember.Component - @uses Ember.TextSupport - @public - */ - exports.default = _emberGlimmerComponent.default.extend(_emberViews.TextSupport, { - layout: _emberGlimmerTemplatesEmpty.default, - classNames: ['ember-text-field'], - tagName: 'input', - attributeBindings: ['accept', 'autocomplete', 'autosave', 'dir', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget', 'height', 'inputmode', 'lang', 'list', 'max', 'min', 'multiple', 'name', 'pattern', 'size', 'step', 'type', 'value', 'width'], + if (name.indexOf('-') > -1) { + result = result.replace(/-(.)/g, function (m) { + return m.charAt(1).toUpperCase(); + }); + } - /** - The `value` attribute of the input element. As the user inputs text, this - property is updated live. - @property value - @type String - @default "" - @public - */ - value: '', + return type + ':' + result; + } else { + return fullName; + } + }, /** - The `type` attribute of the input element. - @property type - @type String - @default "text" + This method is called via the container's resolver method. + It parses the provided `fullName` and then looks up and + returns the appropriate template or class. + @method resolve + @param {String} fullName the lookup string + @return {Object} the resolved factory @public */ - type: _emberMetal.computed({ - get: function () { - return 'text'; - }, - - set: function (key, value) { - var type = 'text'; - - if (canSetTypeOfInput(value)) { - type = value; - } + resolve: function (fullName) { + var parsedName = this.parseName(fullName); + var resolveMethodName = parsedName.resolveMethodName; + var resolved = undefined; - return type; + if (this[resolveMethodName]) { + resolved = this[resolveMethodName](parsedName); } - }), - /** - The `size` of the text field in characters. - @property size - @type String - @default null - @public - */ - size: null, + resolved = resolved || this.resolveOther(parsedName); - /** - The `pattern` attribute of input element. - @property pattern - @type String - @default null - @public - */ - pattern: null, + if (resolved) { + _emberApplicationUtilsValidateType.default(resolved, parsedName); + } - /** - The `min` attribute of input element used with `type="number"` or `type="range"`. - @property min - @type String - @default null - @since 1.4.0 - @public - */ - min: null, + return resolved; + }, /** - The `max` attribute of input element used with `type="number"` or `type="range"`. - @property max - @type String - @default null - @since 1.4.0 - @public + Convert the string name of the form 'type:name' to + a Javascript object with the parsed aspects of the name + broken out. + @param {String} fullName the lookup string + @method parseName + @protected */ - max: null - }); -}); -enifed('ember-glimmer/dom', ['exports', 'glimmer-runtime', 'glimmer-node'], function (exports, _glimmerRuntime, _glimmerNode) { - 'use strict'; - - exports.DOMChanges = _glimmerRuntime.DOMChanges; - exports.DOMTreeConstruction = _glimmerRuntime.DOMTreeConstruction; - exports.NodeDOMTreeConstruction = _glimmerNode.NodeDOMTreeConstruction; -}); -enifed('ember-glimmer/environment', ['exports', 'ember-utils', 'ember-metal', 'ember-views', 'glimmer-runtime', 'ember-glimmer/syntax/curly-component', 'ember-glimmer/syntax', 'ember-glimmer/syntax/dynamic-component', 'ember-glimmer/utils/iterable', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/if-unless', 'ember-glimmer/utils/bindings', 'ember-glimmer/helpers/action', 'ember-glimmer/helpers/component', 'ember-glimmer/helpers/concat', 'ember-glimmer/helpers/debugger', 'ember-glimmer/helpers/get', 'ember-glimmer/helpers/hash', 'ember-glimmer/helpers/loc', 'ember-glimmer/helpers/log', 'ember-glimmer/helpers/mut', 'ember-glimmer/helpers/readonly', 'ember-glimmer/helpers/unbound', 'ember-glimmer/helpers/-class', 'ember-glimmer/helpers/-input-type', 'ember-glimmer/helpers/query-param', 'ember-glimmer/helpers/each-in', 'ember-glimmer/helpers/-normalize-class', 'ember-glimmer/helpers/-html-safe', 'ember-glimmer/protocol-for-url', 'ember-glimmer/modifiers/action'], function (exports, _emberUtils, _emberMetal, _emberViews, _glimmerRuntime, _emberGlimmerSyntaxCurlyComponent, _emberGlimmerSyntax, _emberGlimmerSyntaxDynamicComponent, _emberGlimmerUtilsIterable, _emberGlimmerUtilsReferences, _emberGlimmerHelpersIfUnless, _emberGlimmerUtilsBindings, _emberGlimmerHelpersAction, _emberGlimmerHelpersComponent, _emberGlimmerHelpersConcat, _emberGlimmerHelpersDebugger, _emberGlimmerHelpersGet, _emberGlimmerHelpersHash, _emberGlimmerHelpersLoc, _emberGlimmerHelpersLog, _emberGlimmerHelpersMut, _emberGlimmerHelpersReadonly, _emberGlimmerHelpersUnbound, _emberGlimmerHelpersClass, _emberGlimmerHelpersInputType, _emberGlimmerHelpersQueryParam, _emberGlimmerHelpersEachIn, _emberGlimmerHelpersNormalizeClass, _emberGlimmerHelpersHtmlSafe, _emberGlimmerProtocolForUrl, _emberGlimmerModifiersAction) { - 'use strict'; - var builtInComponents = { - textarea: '-text-area' - }; + parseName: function (fullName) { + return this._parseNameCache[fullName] || (this._parseNameCache[fullName] = this._parseName(fullName)); + }, - var Environment = (function (_GlimmerEnvironment) { - babelHelpers.inherits(Environment, _GlimmerEnvironment); + _parseName: function (fullName) { + var _fullName$split2 = fullName.split(':'); - Environment.create = function create(options) { - return new Environment(options); - }; + var type = _fullName$split2[0]; + var fullNameWithoutType = _fullName$split2[1]; - function Environment(_ref) { - var _this = this; + var name = fullNameWithoutType; + var namespace = _emberMetal.get(this, 'namespace'); + var root = namespace; + var lastSlashIndex = name.lastIndexOf('/'); + var dirname = lastSlashIndex !== -1 ? name.slice(0, lastSlashIndex) : null; - var owner = _ref[_emberUtils.OWNER]; + if (type !== 'template' && lastSlashIndex !== -1) { + var parts = name.split('/'); + name = parts[parts.length - 1]; + var namespaceName = _emberRuntime.String.capitalize(parts.slice(0, -1).join('.')); + root = _emberRuntime.Namespace.byName(namespaceName); + } - _GlimmerEnvironment.apply(this, arguments); - this.owner = owner; - this.isInteractive = owner.lookup('-environment:main').isInteractive; + var resolveMethodName = fullNameWithoutType === 'main' ? 'Main' : _emberRuntime.String.classify(type); - // can be removed once https://github.com/tildeio/glimmer/pull/305 lands - this.destroyedComponents = undefined; + if (!(name && type)) { + throw new TypeError('Invalid fullName: `' + fullName + '`, must be of the form `type:name` '); + } - _emberGlimmerProtocolForUrl.default(this); + return { + fullName: fullName, + type: type, + fullNameWithoutType: fullNameWithoutType, + dirname: dirname, + name: name, + root: root, + resolveMethodName: 'resolve' + resolveMethodName + }; + }, - this._definitionCache = new _emberMetal.Cache(2000, function (_ref2) { - var name = _ref2.name; - var source = _ref2.source; - var owner = _ref2.owner; + /** + 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. + @param {String} fullName the lookup string + @method lookupDescription + @protected + */ + lookupDescription: function (fullName) { + var parsedName = this.parseName(fullName); + var description = undefined; - var _lookupComponent = _emberViews.lookupComponent(owner, name, { source: source }); + if (parsedName.type === 'template') { + return 'template at ' + parsedName.fullNameWithoutType.replace(/\./g, '/'); + } - var ComponentClass = _lookupComponent.component; - var layout = _lookupComponent.layout; + description = parsedName.root + '.' + _emberRuntime.String.classify(parsedName.name).replace(/\./g, ''); - if (ComponentClass || layout) { - return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentDefinition(name, ComponentClass, layout); - } - }, function (_ref3) { - var name = _ref3.name; - var source = _ref3.source; - var owner = _ref3.owner; + if (parsedName.type !== 'model') { + description += _emberRuntime.String.classify(parsedName.type); + } - var expandedName = source && owner._resolveLocalLookupName(name, source) || name; - var ownerGuid = _emberUtils.guidFor(owner); + return description; + }, - return ownerGuid + '|' + expandedName; - }); + makeToString: function (factory, fullName) { + return factory.toString(); + }, - this._templateCache = new _emberMetal.Cache(1000, function (_ref4) { - var Template = _ref4.Template; - var owner = _ref4.owner; + /** + Given a parseName object (output from `parseName`), apply + the conventions expected by `Ember.Router` + @param {Object} parsedName a parseName object with the parsed + fullName lookup string + @method useRouterNaming + @protected + */ + useRouterNaming: function (parsedName) { + parsedName.name = parsedName.name.replace(/\./g, '_'); + if (parsedName.name === 'basic') { + parsedName.name = ''; + } + }, + /** + Look up the template in Ember.TEMPLATES + @param {Object} parsedName a parseName object with the parsed + fullName lookup string + @method resolveTemplate + @protected + */ + resolveTemplate: function (parsedName) { + var templateName = parsedName.fullNameWithoutType.replace(/\./g, '/'); - if (Template.create) { - var _Template$create; + return _emberGlimmer.getTemplate(templateName) || _emberGlimmer.getTemplate(_emberRuntime.String.decamelize(templateName)); + }, - // we received a factory - return Template.create((_Template$create = { env: _this }, _Template$create[_emberUtils.OWNER] = owner, _Template$create)); - } else { - // we were provided an instance already - return Template; - } - }, function (_ref5) { - var Template = _ref5.Template; - var owner = _ref5.owner; - return _emberUtils.guidFor(owner) + '|' + Template.id; - }); + /** + Lookup the view using `resolveOther` + @param {Object} parsedName a parseName object with the parsed + fullName lookup string + @method resolveView + @protected + */ + resolveView: function (parsedName) { + this.useRouterNaming(parsedName); + return this.resolveOther(parsedName); + }, - this._compilerCache = new _emberMetal.Cache(10, function (Compiler) { - return new _emberMetal.Cache(2000, function (template) { - var compilable = new Compiler(template); - return _glimmerRuntime.compileLayout(compilable, _this); - }, function (template) { - var owner = template.meta.owner; - return _emberUtils.guidFor(owner) + '|' + template.id; - }); - }, function (Compiler) { - return Compiler.id; - }); + /** + Lookup the controller using `resolveOther` + @param {Object} parsedName a parseName object with the parsed + fullName lookup string + @method resolveController + @protected + */ + resolveController: function (parsedName) { + this.useRouterNaming(parsedName); + return this.resolveOther(parsedName); + }, + /** + Lookup the route using `resolveOther` + @param {Object} parsedName a parseName object with the parsed + fullName lookup string + @method resolveRoute + @protected + */ + resolveRoute: function (parsedName) { + this.useRouterNaming(parsedName); + return this.resolveOther(parsedName); + }, - this.builtInModifiers = { - action: new _emberGlimmerModifiersAction.default() - }; + /** + Lookup the model on the Application namespace + @param {Object} parsedName a parseName object with the parsed + fullName lookup string + @method resolveModel + @protected + */ + resolveModel: function (parsedName) { + var className = _emberRuntime.String.classify(parsedName.name); + var factory = _emberMetal.get(parsedName.root, className); - this.builtInHelpers = { - if: _emberGlimmerHelpersIfUnless.inlineIf, - action: _emberGlimmerHelpersAction.default, - component: _emberGlimmerHelpersComponent.default, - concat: _emberGlimmerHelpersConcat.default, - debugger: _emberGlimmerHelpersDebugger.default, - get: _emberGlimmerHelpersGet.default, - hash: _emberGlimmerHelpersHash.default, - loc: _emberGlimmerHelpersLoc.default, - log: _emberGlimmerHelpersLog.default, - mut: _emberGlimmerHelpersMut.default, - 'query-params': _emberGlimmerHelpersQueryParam.default, - readonly: _emberGlimmerHelpersReadonly.default, - unbound: _emberGlimmerHelpersUnbound.default, - unless: _emberGlimmerHelpersIfUnless.inlineUnless, - '-class': _emberGlimmerHelpersClass.default, - '-each-in': _emberGlimmerHelpersEachIn.default, - '-input-type': _emberGlimmerHelpersInputType.default, - '-normalize-class': _emberGlimmerHelpersNormalizeClass.default, - '-html-safe': _emberGlimmerHelpersHtmlSafe.default, - '-get-dynamic-var': _glimmerRuntime.getDynamicVar - }; - } + return factory; + }, + /** + Look up the specified object (from parsedName) on the appropriate + namespace (usually on the Application) + @param {Object} parsedName a parseName object with the parsed + fullName lookup string + @method resolveHelper + @protected + */ + resolveHelper: function (parsedName) { + return this.resolveOther(parsedName); + }, + /** + Look up the specified object (from parsedName) on the appropriate + namespace (usually on the Application) + @param {Object} parsedName a parseName object with the parsed + fullName lookup string + @method resolveOther + @protected + */ + resolveOther: function (parsedName) { + var className = _emberRuntime.String.classify(parsedName.name) + _emberRuntime.String.classify(parsedName.type); + var factory = _emberMetal.get(parsedName.root, className); + return factory; + }, - // Hello future traveler, welcome to the world of syntax refinement. - // The method below is called by Glimmer's runtime compiler to allow - // us to take generic statement syntax and refine it to more meaniful - // syntax for Ember's use case. This on the fly switch-a-roo sounds fine - // and dandy, however Ember has precedence on statement refinement that you - // need to be aware of. The presendence for language constructs is as follows: - // - // ------------------------ - // Native & Built-in Syntax - // ------------------------ - // User-land components - // ------------------------ - // User-land helpers - // ------------------------ - // - // The one caveat here is that Ember also allows for dashed references that are - // not a component or helper: - // - // export default Component.extend({ - // 'foo-bar': 'LAME' - // }); - // - // {{foo-bar}} - // - // The heuristic for the above situation is a dashed "key" in inline form - // that does not resolve to a defintion. In this case refine statement simply - // isn't going to return any syntax and the Glimmer engine knows how to handle - // this case. + resolveMain: function (parsedName) { + var className = _emberRuntime.String.classify(parsedName.type); + return _emberMetal.get(parsedName.root, className); + }, - Environment.prototype.refineStatement = function refineStatement(statement, symbolTable) { - // 1. resolve any native syntax – if, unless, with, each, and partial - var nativeSyntax = _GlimmerEnvironment.prototype.refineStatement.call(this, statement, symbolTable); + /** + @method _logLookup + @param {Boolean} found + @param {Object} parsedName + @private + */ + _logLookup: function (found, parsedName) { + var symbol = undefined, + padding = undefined; - if (nativeSyntax) { - return nativeSyntax; + if (found) { + symbol = '[✓]'; + } else { + symbol = '[ ]'; } - var appendType = statement.appendType; - var isSimple = statement.isSimple; - var isInline = statement.isInline; - var isBlock = statement.isBlock; - var isModifier = statement.isModifier; - var key = statement.key; - var path = statement.path; - var args = statement.args; - - if (isSimple && (isInline || isBlock) && appendType !== 'get') { - // 2. built-in syntax - - var RefinedSyntax = _emberGlimmerSyntax.findSyntaxBuilder(key); - if (RefinedSyntax) { - return RefinedSyntax.create(this, args, symbolTable); - } + if (parsedName.fullName.length > 60) { + padding = '.'; + } else { + padding = new Array(60 - parsedName.fullName.length).join('.'); + } + }, - var internalKey = builtInComponents[key]; - var definition = null; + /** + Used to iterate all items of a given type. + @method knownForType + @param {String} type the type to search for + @private + */ + knownForType: function (type) { + var namespace = _emberMetal.get(this, 'namespace'); + var suffix = _emberRuntime.String.classify(type); + var typeRegexp = new RegExp(suffix + '$'); - if (internalKey) { - definition = this.getComponentDefinition([internalKey], symbolTable); - } else if (key.indexOf('-') >= 0) { - definition = this.getComponentDefinition(path, symbolTable); - } + var known = _emberUtils.dictionary(null); + var knownKeys = Object.keys(namespace); + for (var index = 0; index < knownKeys.length; index++) { + var _name = knownKeys[index]; - if (definition) { - _emberGlimmerUtilsBindings.wrapComponentClassAttribute(args); + if (typeRegexp.test(_name)) { + var containerName = this.translateToContainerFullname(type, _name); - return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentSyntax(args, definition, symbolTable); + known[containerName] = true; } } - if (isInline && !isSimple && appendType !== 'helper') { - return statement.original.deopt(); - } + return known; + }, - if (!isSimple && path) { - return _emberGlimmerSyntaxDynamicComponent.DynamicComponentSyntax.fromPath(this, path, args, symbolTable); - } - }; + /** + Converts provided name from the backing namespace into a container lookup name. + Examples: + App.FooBarHelper -> helper:foo-bar + App.THelper -> helper:t + @method translateToContainerFullname + @param {String} type + @param {String} name + @private + */ - Environment.prototype.hasComponentDefinition = function hasComponentDefinition() { - return false; - }; + translateToContainerFullname: function (type, name) { + var suffix = _emberRuntime.String.classify(type); + var namePrefix = name.slice(0, suffix.length * -1); + var dasherizedName = _emberRuntime.String.dasherize(namePrefix); - Environment.prototype.getComponentDefinition = function getComponentDefinition(path, symbolTable) { - var name = path[0]; - var blockMeta = symbolTable.getMeta(); - var owner = blockMeta.owner; - var source = blockMeta.moduleName && 'template:' + blockMeta.moduleName; + return type + ':' + dasherizedName; + } + }); +}); +enifed('ember-application/utils/validate-type', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-application + */ - return this._definitionCache.get({ name: name, source: source, owner: owner }); - }; + 'use strict'; - // normally templates should be exported at the proper module name - // and cached in the container, but this cache supports templates - // that have been set directly on the component's layout property + exports.default = validateType; - Environment.prototype.getTemplate = function getTemplate(Template, owner) { - return this._templateCache.get({ Template: Template, owner: owner }); - }; + var VALIDATED_TYPES = { + route: ['assert', 'isRouteFactory', 'Ember.Route'], + component: ['deprecate', 'isComponentFactory', 'Ember.Component'], + view: ['deprecate', 'isViewFactory', 'Ember.View'], + service: ['deprecate', 'isServiceFactory', 'Ember.Service'] + }; - // a Compiler can wrap the template so it needs its own cache + function validateType(resolvedType, parsedName) { + var validationAttributes = VALIDATED_TYPES[parsedName.type]; - Environment.prototype.getCompiledBlock = function getCompiledBlock(Compiler, template) { - var compilerCache = this._compilerCache.get(Compiler); - return compilerCache.get(template); - }; + if (!validationAttributes) { + return; + } - Environment.prototype.hasPartial = function hasPartial(name, symbolTable) { - var _symbolTable$getMeta = symbolTable.getMeta(); + var action = validationAttributes[0]; + var factoryFlag = validationAttributes[1]; + var expectedType = validationAttributes[2]; - var owner = _symbolTable$getMeta.owner; + if (action === 'deprecate') {} else {} + } +}); +enifed('ember-console/index', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { + 'use strict'; - return _emberViews.hasPartial(name, owner); - }; + function K() {} - Environment.prototype.lookupPartial = function lookupPartial(name, symbolTable) { - var _symbolTable$getMeta2 = symbolTable.getMeta(); + function consoleMethod(name) { + var consoleObj = undefined; + if (_emberEnvironment.context.imports.console) { + consoleObj = _emberEnvironment.context.imports.console; + } else if (typeof console !== 'undefined') { + consoleObj = console; + } - var owner = _symbolTable$getMeta2.owner; + var method = typeof consoleObj === 'object' ? consoleObj[name] : null; - var partial = { - template: _emberViews.lookupPartial(name, owner) - }; + if (typeof method !== 'function') { + return; + } - if (partial.template) { - return partial; - } else { - throw new Error(name + ' is not a partial'); - } - }; + if (typeof method.bind === 'function') { + return method.bind(consoleObj); + } - Environment.prototype.hasHelper = function hasHelper(nameParts, symbolTable) { + return function () { + method.apply(consoleObj, arguments); + }; + } - // helpers are not allowed to include a dot in their invocation - if (nameParts.length > 1) { - return false; + function assertPolyfill(test, message) { + if (!test) { + try { + // attempt to preserve the stack + throw new Error('assertion failed: ' + message); + } catch (error) { + setTimeout(function () { + throw error; + }, 0); } + } + } - var name = nameParts[0]; + /** + Inside Ember-Metal, simply uses the methods from `imports.console`. + Override this to provide more robust logging functionality. + + @class Logger + @namespace Ember + @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. + ```javascript + var foo = 1; + Ember.Logger.log('log value of foo:', foo); + // "log value of foo: 1" will be printed to the console + ``` + @method log + @for Ember.Logger + @param {*} arguments + @public + */ + log: consoleMethod('log') || K, - if (this.builtInHelpers[name]) { - return true; - } + /** + Prints the arguments to the console with a warning icon. + You can pass as many arguments as you want and they will be joined together with a space. + ```javascript + Ember.Logger.warn('Something happened!'); + // "Something happened!" will be printed to the console with a warning icon. + ``` + @method warn + @for Ember.Logger + @param {*} arguments + @public + */ + warn: consoleMethod('warn') || K, - var blockMeta = symbolTable.getMeta(); - var owner = blockMeta.owner; - var options = { source: 'template:' + blockMeta.moduleName }; + /** + Prints the arguments to the console with an error icon, red text and a stack trace. + You can pass as many arguments as you want and they will be joined together with a space. + ```javascript + Ember.Logger.error('Danger! Danger!'); + // "Danger! Danger!" will be printed to the console in red text. + ``` + @method error + @for Ember.Logger + @param {*} arguments + @public + */ + error: consoleMethod('error') || K, - return owner.hasRegistration('helper:' + name, options) || owner.hasRegistration('helper:' + name); - }; + /** + Logs the arguments to the console. + You can pass as many arguments as you want and they will be joined together with a space. + ```javascript + var foo = 1; + Ember.Logger.info('log value of foo:', foo); + // "log value of foo: 1" will be printed to the console + ``` + @method info + @for Ember.Logger + @param {*} arguments + @public + */ + info: consoleMethod('info') || K, - Environment.prototype.lookupHelper = function lookupHelper(nameParts, symbolTable) { + /** + Logs the arguments to the console in blue text. + You can pass as many arguments as you want and they will be joined together with a space. + ```javascript + var foo = 1; + Ember.Logger.debug('log value of foo:', foo); + // "log value of foo: 1" will be printed to the console + ``` + @method debug + @for Ember.Logger + @param {*} arguments + @public + */ + debug: consoleMethod('debug') || consoleMethod('info') || K, - var name = nameParts[0]; - var helper = this.builtInHelpers[name]; + /** + 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 + }; +}); +enifed('ember-environment/global', ['exports'], function (exports) { + /* globals global, window, self, mainContext */ - if (helper) { - return helper; - } + // from lodash to catch fake globals + 'use strict'; - var blockMeta = symbolTable.getMeta(); - var owner = blockMeta.owner; - var options = blockMeta.moduleName && { source: 'template:' + blockMeta.moduleName } || {}; + function checkGlobal(value) { + return value && value.Object === Object ? value : undefined; + } - helper = owner.lookup('helper:' + name, options) || owner.lookup('helper:' + name); + // element ids can ruin global miss checks + function checkElementIdShadowing(value) { + return value && value.nodeType === undefined ? value : undefined; + } - // TODO: try to unify this into a consistent protocol to avoid wasteful closure allocations - if (helper.isHelperInstance) { - return function (vm, args) { - return _emberGlimmerUtilsReferences.SimpleHelperReference.create(helper.compute, args); - }; - } else if (helper.isHelperFactory) { - return function (vm, args) { - return _emberGlimmerUtilsReferences.ClassBasedHelperReference.create(helper, vm, args); - }; - } else { - throw new Error(nameParts + ' is not a helper'); - } - }; + // export real global + exports.default = checkGlobal(checkElementIdShadowing(typeof global === 'object' && global)) || checkGlobal(typeof self === 'object' && self) || checkGlobal(typeof window === 'object' && window) || mainContext || // set before strict mode in Ember loader/wrapper + new Function('return this')(); + // eval outside of strict mode +}); +enifed('ember-environment/index', ['exports', 'ember-environment/global', 'ember-environment/utils'], function (exports, _emberEnvironmentGlobal, _emberEnvironmentUtils) { + /* globals module */ + 'use strict'; - Environment.prototype.hasModifier = function hasModifier(nameParts) { + /** + 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 + backwards compatibility with earlier versions of Ember). The `EmberENV` + hash must be created before loading Ember. + + @class EmberENV + @type Object + @public + */ + var ENV = typeof _emberEnvironmentGlobal.default.EmberENV === 'object' && _emberEnvironmentGlobal.default.EmberENV || typeof _emberEnvironmentGlobal.default.ENV === 'object' && _emberEnvironmentGlobal.default.ENV || {}; - // modifiers are not allowed to include a dot in their invocation - if (nameParts.length > 1) { - return false; - } + exports.ENV = ENV; + // ENABLE_ALL_FEATURES was documented, but you can't actually enable non optional features. + if (ENV.ENABLE_ALL_FEATURES) { + ENV.ENABLE_OPTIONAL_FEATURES = true; + } - return !!this.builtInModifiers[nameParts[0]]; - }; - - Environment.prototype.lookupModifier = function lookupModifier(nameParts) { - - var modifier = this.builtInModifiers[nameParts[0]]; - - if (modifier) { - return modifier; - } else { - throw new Error(nameParts + ' is not a modifier'); - } - }; - - Environment.prototype.toConditionalReference = function toConditionalReference(reference) { - return _emberGlimmerUtilsReferences.ConditionalReference.create(reference); - }; - - Environment.prototype.iterableFor = function iterableFor(ref, args) { - var keyPath = args.named.get('key').value(); - return _emberGlimmerUtilsIterable.default(ref, keyPath); - }; + /** + Determines whether Ember should add to `Array`, `Function`, and `String` + native object prototypes, a few extra methods in order to provide a more + friendly API. + + We generally recommend leaving this option set to true however, if you need + to turn it off, you can add the configuration property + `EXTEND_PROTOTYPES` to `EmberENV` and set it to `false`. + + Note, when disabled (the default configuration for Ember Addons), you will + instead have to access all methods and functions from the Ember + namespace. + + @property EXTEND_PROTOTYPES + @type Boolean + @default true + @for EmberENV + @public + */ + ENV.EXTEND_PROTOTYPES = _emberEnvironmentUtils.normalizeExtendPrototypes(ENV.EXTEND_PROTOTYPES); - Environment.prototype.scheduleInstallModifier = function scheduleInstallModifier() { - if (this.isInteractive) { - var _GlimmerEnvironment$prototype$scheduleInstallModifier; + /** + The `LOG_STACKTRACE_ON_DEPRECATION` property, when true, tells Ember to log + a full stack trace during deprecation warnings. + + @property LOG_STACKTRACE_ON_DEPRECATION + @type Boolean + @default true + @for EmberENV + @public + */ + ENV.LOG_STACKTRACE_ON_DEPRECATION = _emberEnvironmentUtils.defaultTrue(ENV.LOG_STACKTRACE_ON_DEPRECATION); - (_GlimmerEnvironment$prototype$scheduleInstallModifier = _GlimmerEnvironment.prototype.scheduleInstallModifier).call.apply(_GlimmerEnvironment$prototype$scheduleInstallModifier, [this].concat(babelHelpers.slice.call(arguments))); - } - }; + /** + The `LOG_VERSION` property, when true, tells Ember to log versions of all + dependent libraries in use. + + @property LOG_VERSION + @type Boolean + @default true + @for EmberENV + @public + */ + ENV.LOG_VERSION = _emberEnvironmentUtils.defaultTrue(ENV.LOG_VERSION); - Environment.prototype.scheduleUpdateModifier = function scheduleUpdateModifier() { - if (this.isInteractive) { - var _GlimmerEnvironment$prototype$scheduleUpdateModifier; + // default false + ENV.MODEL_FACTORY_INJECTIONS = _emberEnvironmentUtils.defaultFalse(ENV.MODEL_FACTORY_INJECTIONS); - (_GlimmerEnvironment$prototype$scheduleUpdateModifier = _GlimmerEnvironment.prototype.scheduleUpdateModifier).call.apply(_GlimmerEnvironment$prototype$scheduleUpdateModifier, [this].concat(babelHelpers.slice.call(arguments))); - } - }; + /** + Debug parameter you can turn on. This will log all bindings that fire to + the console. This should be disabled in production code. Note that you + can also enable this from the console or temporarily. + + @property LOG_BINDINGS + @for EmberENV + @type Boolean + @default false + @public + */ + ENV.LOG_BINDINGS = _emberEnvironmentUtils.defaultFalse(ENV.LOG_BINDINGS); - Environment.prototype.didDestroy = function didDestroy(destroyable) { - destroyable.destroy(); - }; + ENV.RAISE_ON_DEPRECATION = _emberEnvironmentUtils.defaultFalse(ENV.RAISE_ON_DEPRECATION); - Environment.prototype.begin = function begin() { - this.inTransaction = true; + // check if window exists and actually is the global + var hasDOM = typeof window !== 'undefined' && window === _emberEnvironmentGlobal.default && window.document && window.document.createElement && !ENV.disableBrowserEnvironment; // is this a public thing? - _GlimmerEnvironment.prototype.begin.call(this); + // legacy imports/exports/lookup stuff (should we keep this??) + var originalContext = _emberEnvironmentGlobal.default.Ember || {}; - this.destroyedComponents = []; - }; + var context = { + // import jQuery + imports: originalContext.imports || _emberEnvironmentGlobal.default, + // export Ember + exports: originalContext.exports || _emberEnvironmentGlobal.default, + // search for Namespaces + lookup: originalContext.lookup || _emberEnvironmentGlobal.default + }; - Environment.prototype.commit = function commit() { - // components queued for destruction must be destroyed before firing - // `didCreate` to prevent errors when removing and adding a component - // with the same name (would throw an error when added to view registry) - for (var i = 0; i < this.destroyedComponents.length; i++) { - this.destroyedComponents[i].destroy(); - } + exports.context = context; + // TODO: cleanup single source of truth issues with this stuff + var environment = hasDOM ? { + hasDOM: true, + isChrome: !!window.chrome && !window.opera, + isFirefox: typeof InstallTrigger !== 'undefined', + isPhantom: !!window.callPhantom, + location: window.location, + history: window.history, + userAgent: window.navigator.userAgent, + window: window + } : { + hasDOM: false, + isChrome: false, + isFirefox: false, + isPhantom: false, + location: null, + history: null, + userAgent: 'Lynx (textmode)', + window: null + }; + exports.environment = environment; +}); +enifed("ember-environment/utils", ["exports"], function (exports) { + "use strict"; - _GlimmerEnvironment.prototype.commit.call(this); + exports.defaultTrue = defaultTrue; + exports.defaultFalse = defaultFalse; + exports.normalizeExtendPrototypes = normalizeExtendPrototypes; - this.inTransaction = false; - }; + function defaultTrue(v) { + return v === false ? false : true; + } - return Environment; - })(_glimmerRuntime.Environment); + function defaultFalse(v) { + return v === true ? true : false; + } - exports.default = Environment; + function normalizeExtendPrototypes(obj) { + if (obj === false) { + return { String: false, Array: false, Function: false }; + } else if (!obj || obj === true) { + return { String: true, Array: true, Function: true }; + } else { + return { + String: defaultTrue(obj.String), + Array: defaultTrue(obj.Array), + Function: defaultTrue(obj.Function) + }; + } + } }); -enifed('ember-glimmer/helper', ['exports', 'ember-utils', 'ember-runtime', 'glimmer-reference'], function (exports, _emberUtils, _emberRuntime, _glimmerReference) { +enifed('ember-extension-support/container_debug_adapter', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { + 'use strict'; + /** @module ember - @submodule ember-glimmer + @submodule ember-extension-support */ - 'use strict'; - - exports.helper = helper; - var RECOMPUTE_TAG = _emberUtils.symbol('RECOMPUTE_TAG'); - - exports.RECOMPUTE_TAG = RECOMPUTE_TAG; /** - Ember Helpers are functions that can compute values, and are used in templates. - For example, this code calls a helper named `format-currency`: + The `ContainerDebugAdapter` helps the container and resolver interface + with tools that debug Ember such as the + [Ember Extension](https://github.com/tildeio/ember-extension) + for Chrome and Firefox. - ```handlebars -
    {{format-currency cents currency="$"}}
    - ``` + This class can be extended by a custom resolver implementer + to override some of the methods with library-specific code. - Additionally a helper can be called as a nested helper (sometimes called a - subexpression). In this example, the computed value of a helper is passed - to a component named `show-money`: + The methods likely to be overridden are: - ```handlebars - {{show-money amount=(format-currency cents currency="$")}} - ``` + * `canCatalogEntriesByType` + * `catalogEntriesByType` - Helpers defined using a class must provide a `compute` function. For example: + The adapter will need to be registered + in the application's container as `container-debug-adapter:main`. - ```js - export default Ember.Helper.extend({ - compute(params, hash) { - let cents = params[0]; - let currency = hash.currency; - return `${currency}${cents * 0.01}`; + Example: + + ```javascript + Application.initializer({ + name: "containerDebugAdapter", + + initialize(application) { + application.register('container-debug-adapter:main', require('app/container-debug-adapter')); } }); ``` - Each time the input to a helper changes, the `compute` function will be - called again. - - As instances, these helpers also have access to the container an will accept - injected dependencies. - - Additionally, class helpers can call `recompute` to force a new computation. - - @class Ember.Helper + @class ContainerDebugAdapter + @namespace Ember + @extends Ember.Object + @since 1.5.0 @public - @since 1.13.0 */ - var Helper = _emberRuntime.FrameworkObject.extend({ - isHelperInstance: true, - - init: function () { - this._super.apply(this, arguments); - this[RECOMPUTE_TAG] = new _glimmerReference.DirtyableTag(); - }, - + exports.default = _emberRuntime.Object.extend({ /** - 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 - session service changes: - ```js - // app/helpers/current-user-email.js - export default Ember.Helper.extend({ - session: Ember.inject.service(), - onNewUser: Ember.observer('session.currentUser', function() { - this.recompute(); - }), - compute() { - return this.get('session.currentUser.email'); - } - }); - ``` - @method recompute + The resolver instance of the application + being debugged. This property will be injected + on creation. + @property resolver + @default null @public - @since 1.13.0 */ - recompute: function () { - this[RECOMPUTE_TAG].dirty(); - } + resolver: null, /** - Override this function when writing a class-based helper. - @method compute - @param {Array} params The positional arguments to the helper - @param {Object} hash The named arguments to the helper + Returns true if it is possible to catalog a list of available + classes in the resolver for a given type. + @method canCatalogEntriesByType + @param {String} type The type. e.g. "model", "controller", "route". + @return {boolean} whether a list is available for this type. @public - @since 1.13.0 */ - }); - - Helper.reopenClass({ - isHelperFactory: true - }); - - /** - In many cases, the ceremony of a full `Ember.Helper` class is not required. - The `helper` method create pure-function helpers without instances. For - example: - - ```js - // app/helpers/format-currency.js - export default Ember.Helper.helper(function(params, hash) { - let cents = params[0]; - let currency = hash.currency; - return `${currency}${cents * 0.01}`; - }); - ``` - - @static - @param {Function} helper The helper function - @method helper - @public - @since 1.13.0 - */ - - function helper(helperFn) { - return { - isHelperInstance: true, - compute: helperFn - }; - } - - exports.default = Helper; -}); -enifed('ember-glimmer/helpers/-class', ['exports', 'ember-glimmer/utils/references', 'ember-runtime'], function (exports, _emberGlimmerUtilsReferences, _emberRuntime) { - 'use strict'; - - function classHelper(_ref) { - var positional = _ref.positional; - - var path = positional.at(0); - var args = positional.length; - var value = path.value(); - - if (value === true) { - if (args > 1) { - return _emberRuntime.String.dasherize(positional.at(1).value()); - } - return null; - } - - if (value === false) { - if (args > 2) { - return _emberRuntime.String.dasherize(positional.at(2).value()); + canCatalogEntriesByType: function (type) { + if (type === 'model' || type === 'template') { + return false; } - return null; - } - - return value; - } - - exports.default = function (vm, args) { - return new _emberGlimmerUtilsReferences.InternalHelperReference(classHelper, args); - }; -}); -enifed('ember-glimmer/helpers/-html-safe', ['exports', 'ember-glimmer/utils/references', 'ember-glimmer/utils/string'], function (exports, _emberGlimmerUtilsReferences, _emberGlimmerUtilsString) { - 'use strict'; - - function htmlSafe(_ref) { - var positional = _ref.positional; - - var path = positional.at(0); - return new _emberGlimmerUtilsString.SafeString(path.value()); - } - exports.default = function (vm, args) { - return new _emberGlimmerUtilsReferences.InternalHelperReference(htmlSafe, args); - }; -}); -enifed('ember-glimmer/helpers/-input-type', ['exports', 'ember-glimmer/utils/references'], function (exports, _emberGlimmerUtilsReferences) { - 'use strict'; + return true; + }, - function inputTypeHelper(_ref) { - var positional = _ref.positional; - var named = _ref.named; + /** + Returns the available classes a given type. + @method catalogEntriesByType + @param {String} type The type. e.g. "model", "controller", "route". + @return {Array} An array of strings. + @public + */ + catalogEntriesByType: function (type) { + var namespaces = _emberRuntime.A(_emberRuntime.Namespace.NAMESPACES); + var types = _emberRuntime.A(); + var typeSuffixRegex = new RegExp(_emberRuntime.String.classify(type) + '$'); - var type = positional.at(0).value(); - if (type === 'checkbox') { - return '-checkbox'; + namespaces.forEach(function (namespace) { + if (namespace !== _emberMetal.default) { + for (var key in namespace) { + if (!namespace.hasOwnProperty(key)) { + continue; + } + if (typeSuffixRegex.test(key)) { + var klass = namespace[key]; + if (_emberRuntime.typeOf(klass) === 'class') { + types.push(_emberRuntime.String.dasherize(key.replace(typeSuffixRegex, ''))); + } + } + } + } + }); + return types; } - return '-text-field'; - } - - exports.default = function (vm, args) { - return new _emberGlimmerUtilsReferences.InternalHelperReference(inputTypeHelper, args); - }; + }); }); -enifed('ember-glimmer/helpers/-normalize-class', ['exports', 'ember-glimmer/utils/references', 'ember-runtime'], function (exports, _emberGlimmerUtilsReferences, _emberRuntime) { +// Ember as namespace +enifed('ember-extension-support/data_adapter', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'container', 'ember-application'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _container, _emberApplication) { 'use strict'; - function normalizeClass(_ref) { - var positional = _ref.positional; - var named = _ref.named; - - var classNameParts = positional.at(0).value().split('.'); - var className = classNameParts[classNameParts.length - 1]; - var value = positional.at(1).value(); - - if (value === true) { - return _emberRuntime.String.dasherize(className); - } else if (!value && value !== 0) { - return ''; - } else { - return String(value); - } - } - - exports.default = function (vm, args) { - return new _emberGlimmerUtilsReferences.InternalHelperReference(normalizeClass, args); - }; -}); -enifed('ember-glimmer/helpers/action', ['exports', 'ember-utils', 'ember-metal', 'ember-glimmer/utils/references', 'glimmer-runtime', 'glimmer-reference'], function (exports, _emberUtils, _emberMetal, _emberGlimmerUtilsReferences, _glimmerRuntime, _glimmerReference) { /** @module ember - @submodule ember-glimmer + @submodule ember-extension-support */ - 'use strict'; - - var INVOKE = _emberUtils.symbol('INVOKE'); - exports.INVOKE = INVOKE; - var ACTION = _emberUtils.symbol('ACTION'); - exports.ACTION = ACTION; /** - 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 - - There are three contexts an action helper can be used in. The first two - contexts to discuss are attribute context, and Handlebars value context. - - ```handlebars - {{! An example of attribute context }} -
    - {{! Examples of Handlebars value context }} - {{input on-input=(action "save")}} - {{yield (action "refreshData") andAnotherParam}} - ``` - - In these contexts, - the helper is called a "closure action" helper. Its behavior is simple: - If passed a function name, read that function off the `actions` property - of the current context. Once that function is read (or if a function was - passed), create a closure over that function and any arguments. - The resulting value of an action helper used this way is simply a function. + The `DataAdapter` helps a data persistence library + interface with tools that debug Ember such + as the [Ember Extension](https://github.com/tildeio/ember-extension) + for Chrome and Firefox. - For example, in the attribute context: + This class will be extended by a persistence library + which will override some of the methods with + library-specific code. - ```handlebars - {{! An example of attribute context }} -
    - ``` + The methods likely to be overridden are: - The resulting template render logic would be: + * `getFilters` + * `detect` + * `columnsForType` + * `getRecords` + * `getRecordColumnValues` + * `getRecordKeywords` + * `getRecordFilterValues` + * `getRecordColor` + * `observeRecord` - ```js - var div = document.createElement('div'); - var actionFunction = (function(context){ - return function() { - return context.actions.save.apply(context, arguments); - }; - })(context); - div.onclick = actionFunction; - ``` + The adapter will need to be registered + in the application's container as `dataAdapter:main`. - Thus when the div is clicked, the action on that context is called. - Because the `actionFunction` is just a function, closure actions can be - passed between components and still execute in the correct context. + Example: - Here is an example action handler on a component: + ```javascript + Application.initializer({ + name: "data-adapter", - ```js - export default Ember.Component.extend({ - actions: { - save() { - this.get('model').save(); - } + initialize: function(application) { + application.register('data-adapter:main', DS.DataAdapter); } }); ``` - Actions are always looked up on the `actions` property of the current context. - This avoids collisions in the naming of common actions, such as `destroy`. - Two options can be passed to the `action` helper when it is used in this way. - - * `target=someProperty` will look to `someProperty` instead of the current - context for the `actions` hash. This can be useful when targetting a - service for actions. - * `value="target.value"` will read the path `target.value` off the first - argument to the action when it is called and rewrite the first argument - to be that value. This is useful when attaching actions to event listeners. - - ### Invoking an action - - Closure actions curry both their scope and any arguments. When invoked, any - additional arguments are added to the already curried list. - Actions should be invoked using the [sendAction](/api/classes/Ember.Component.html#method_sendAction) - method. The first argument to `sendAction` is the action to be called, and - additional arguments are passed to the action function. This has interesting - properties combined with currying of arguments. For example: - - ```js - export default Ember.Component.extend({ - actions: { - // Usage {{input on-input=(action (action 'setName' model) value="target.value")}} - setName(model, name) { - model.set('name', name); - } - } - }); - ``` - - The first argument (`model`) was curried over, and the run-time argument (`event`) - becomes a second argument. Action calls can be nested this way because each simply - returns a function. Any function can be passed to the `{{action}}` helper, including - other actions. - - Actions invoked with `sendAction` have the same currying behavior as demonstrated - with `on-input` above. For example: - - ```js - export default Ember.Component.extend({ - actions: { - setName(model, name) { - model.set('name', name); - } - } - }); - ``` - - ```handlebars - {{my-input submit=(action 'setName' model)}} - ``` - - ```js - // app/components/my-component.js - export default Ember.Component.extend({ - click() { - // Note that model is not passed, it was curried in the template - this.sendAction('submit', 'bob'); - } - }); - ``` - - ### Attaching actions to DOM elements - - The third context of the `{{action}}` helper can be called "element space". - For example: - - ```handlebars - {{! An example of element space }} -
    - ``` - - Used this way, the `{{action}}` helper provides a useful shortcut for - registering an HTML element in a template for a single DOM event and - forwarding that interaction to the template's context (controller or component). - If the context of a template is a controller, actions used this way will - bubble to routes when the controller does not implement the specified action. - Once an action hits a route, it will bubble through the route hierarchy. - - ### Event Propagation - - `{{action}}` helpers called in element space can control event bubbling. Note - that the closure style actions cannot. - - Events triggered through the action helper will automatically have - `.preventDefault()` called on them. You do not need to do so in your event - handlers. If you need to allow event propagation (to handle file inputs for - example) you can supply the `preventDefault=false` option to the `{{action}}` helper: - - ```handlebars -
    - - -
    - ``` - - To disable bubbling, pass `bubbles=false` to the helper: - - ```handlebars - - ``` - - To disable bubbling with closure style actions you must create your own - wrapper helper that makes use of `event.stopPropagation()`: - - ```handlebars -
    Hello
    - ``` - - ```js - // app/helpers/disable-bubbling.js - import Ember from 'ember'; - export function disableBubbling([action]) { - return function(event) { - event.stopPropagation(); - return action(event); - }; - } - export default Ember.Helper.helper(disableBubbling); - ``` - - If you need the default handler to trigger you should either register your - own event handler, or use event methods on your view class. See - ["Responding to Browser Events"](/api/classes/Ember.View.html#toc_responding-to-browser-events) - in the documentation for Ember.View for more information. - - ### Specifying DOM event type - - `{{action}}` helpers called in element space can specify an event type. - By default the `{{action}}` helper registers for DOM `click` events. You can - supply an `on` option to the helper to specify a different DOM event name: - - ```handlebars -
    - click me -
    - ``` - - See ["Event Names"](/api/classes/Ember.View.html#toc_event-names) for a list of - acceptable DOM event names. - - ### Specifying whitelisted modifier keys - - `{{action}}` helpers called in element space can specify modifier keys. - By default the `{{action}}` helper will ignore click events with pressed modifier - keys. You can supply an `allowedKeys` option to specify which keys should not be ignored. - - ```handlebars -
    - click me -
    - ``` - - This way the action will fire when clicking with the alt key pressed down. - Alternatively, supply "any" to the `allowedKeys` option to accept any combination of modifier keys. - - ```handlebars -
    - click me with any key pressed -
    - ``` - - ### Specifying a Target - - A `target` option can be provided to the helper to change - which object will receive the method call. This option must be a path - to an object, accessible in the current context: - - ```handlebars - {{! app/templates/application.hbs }} -
    - click me -
    - ``` - - ```javascript - // app/controllers/application.js - export default Ember.Controller.extend({ - someService: Ember.inject.service() - }); - ``` - - @method action - @for Ember.Templates.helpers + @class DataAdapter + @namespace Ember + @extends EmberObject @public */ + exports.default = _emberRuntime.Object.extend({ + init: function () { + this._super.apply(this, arguments); + this.releaseMethods = _emberRuntime.A(); + }, - exports.default = function (vm, args) { - var named = args.named; - var positional = args.positional; + /** + The container-debug-adapter which is used + to list all models. + @property containerDebugAdapter + @default undefined + @since 1.5.0 + @public + **/ + containerDebugAdapter: undefined, - // The first two argument slots are reserved. - // pos[0] is the context (or `this`) - // pos[1] is the action name or function - // Anything else is an action argument. - var context = positional.at(0); - var action = positional.at(1); + /** + The number of attributes to send + as columns. (Enough to make the record + identifiable). + @private + @property attributeLimit + @default 3 + @since 1.3.0 + */ + attributeLimit: 3, - // TODO: Is there a better way of doing this? - var debugKey = action._propertyKey; + /** + Ember Data > v1.0.0-beta.18 + requires string model names to be passed + around instead of the actual factories. + This is a stamp for the Ember Inspector + to differentiate between the versions + to be able to support older versions too. + @public + @property acceptsModelName + */ + acceptsModelName: true, - var restArgs = undefined; + /** + Stores all methods that clear observers. + These methods will be called on destruction. + @private + @property releaseMethods + @since 1.3.0 + */ + releaseMethods: _emberRuntime.A(), - if (positional.length === 2) { - restArgs = _glimmerRuntime.EvaluatedPositionalArgs.empty(); - } else { - restArgs = _glimmerRuntime.EvaluatedPositionalArgs.create(positional.values.slice(2)); - } + /** + Specifies how records can be filtered. + Records returned will need to have a `filterValues` + property with a key for every name in the returned array. + @public + @method getFilters + @return {Array} List of objects defining filters. + The object should have a `name` and `desc` property. + */ + getFilters: function () { + return _emberRuntime.A(); + }, - var target = named.has('target') ? named.get('target') : context; - var processArgs = makeArgsProcessor(named.has('value') && named.get('value'), restArgs); + /** + Fetch the model types and observe them for changes. + @public + @method watchModelTypes + @param {Function} typesAdded Callback to call to add types. + Takes an array of objects containing wrapped types (returned from `wrapModelType`). + @param {Function} typesUpdated Callback to call when a type has changed. + Takes an array of objects containing wrapped types. + @return {Function} Method to call to remove all observers + */ + watchModelTypes: function (typesAdded, typesUpdated) { + var _this = this; - var fn = undefined; + var modelTypes = this.getModelTypes(); + var releaseMethods = _emberRuntime.A(); + var typesToSend = undefined; - if (typeof action[INVOKE] === 'function') { - fn = makeClosureAction(action, action, action[INVOKE], processArgs, debugKey); - } else if (_glimmerReference.isConst(target) && _glimmerReference.isConst(action)) { - fn = makeClosureAction(context.value(), target.value(), action.value(), processArgs, debugKey); - } else { - fn = makeDynamicClosureAction(context.value(), target, action, processArgs, debugKey); - } + typesToSend = modelTypes.map(function (type) { + var klass = type.klass; + var wrapped = _this.wrapModelType(klass, type.name); + releaseMethods.push(_this.observeModelType(type.name, typesUpdated)); + return wrapped; + }); - fn[ACTION] = true; + typesAdded(typesToSend); - return new _emberGlimmerUtilsReferences.UnboundReference(fn); - }; + var release = function () { + releaseMethods.forEach(function (fn) { + return fn(); + }); + _this.releaseMethods.removeObject(release); + }; + this.releaseMethods.pushObject(release); + return release; + }, - function NOOP(args) { - return args; - } + _nameToClass: function (type) { + if (typeof type === 'string') { + var owner = _emberUtils.getOwner(this); + type = owner[_container.FACTORY_FOR]('model:' + type).class; + } + return type; + }, - function makeArgsProcessor(valuePathRef, actionArgsRef) { - var mergeArgs = null; + /** + Fetch the records of a given type and observe them for changes. + @public + @method watchRecords + @param {String} modelName The model name. + @param {Function} recordsAdded Callback to call to add records. + Takes an array of objects containing wrapped records. + The object should have the following properties: + columnValues: {Object} The key and value of a table cell. + object: {Object} The actual record object. + @param {Function} recordsUpdated Callback to call when a record has changed. + Takes an array of objects containing wrapped records. + @param {Function} recordsRemoved Callback to call when a record has removed. + Takes the following parameters: + index: The array index where the records were removed. + count: The number of records removed. + @return {Function} Method to call to remove all observers. + */ + watchRecords: function (modelName, recordsAdded, recordsUpdated, recordsRemoved) { + var _this2 = this; - if (actionArgsRef.length > 0) { - mergeArgs = function (args) { - return actionArgsRef.value().concat(args); - }; - } + var releaseMethods = _emberRuntime.A(); + var klass = this._nameToClass(modelName); + var records = this.getRecords(klass, modelName); + var release = undefined; - var readValue = null; + function recordUpdated(updatedRecord) { + recordsUpdated([updatedRecord]); + } - if (valuePathRef) { - readValue = function (args) { - var valuePath = valuePathRef.value(); + var recordsToSend = records.map(function (record) { + releaseMethods.push(_this2.observeRecord(record, recordUpdated)); + return _this2.wrapRecord(record); + }); - if (valuePath && args.length > 0) { - args[0] = _emberMetal.get(args[0], valuePath); + var contentDidChange = function (array, idx, removedCount, addedCount) { + for (var i = idx; i < idx + addedCount; i++) { + var record = _emberRuntime.objectAt(array, i); + var wrapped = _this2.wrapRecord(record); + releaseMethods.push(_this2.observeRecord(record, recordUpdated)); + recordsAdded([wrapped]); } - return args; + if (removedCount) { + recordsRemoved(idx, removedCount); + } }; - } - if (mergeArgs && readValue) { - return function (args) { - return readValue(mergeArgs(args)); + var observer = { didChange: contentDidChange, willChange: function () { + return this; + } }; + _emberRuntime.addArrayObserver(records, this, observer); + + release = function () { + releaseMethods.forEach(function (fn) { + return fn(); + }); + _emberRuntime.removeArrayObserver(records, _this2, observer); + _this2.releaseMethods.removeObject(release); }; - } else { - return mergeArgs || readValue || NOOP; - } - } - function makeDynamicClosureAction(context, targetRef, actionRef, processArgs, debugKey) { + recordsAdded(recordsToSend); - return function () { - return makeClosureAction(context, targetRef.value(), actionRef.value(), processArgs, debugKey).apply(undefined, arguments); - }; + this.releaseMethods.pushObject(release); + return release; + }, - // We don't allow undefined/null values, so this creates a throw-away action to trigger the assertions - } + /** + Clear all observers before destruction + @private + @method willDestroy + */ + willDestroy: function () { + this._super.apply(this, arguments); + this.releaseMethods.forEach(function (fn) { + return fn(); + }); + }, - function makeClosureAction(context, target, action, processArgs, debugKey) { - var self = undefined, - fn = undefined; + /** + Detect whether a class is a model. + Test that against the model class + of your persistence library. + @private + @method detect + @param {Class} klass The class to test. + @return boolean Whether the class is a model class or not. + */ + detect: function (klass) { + return false; + }, - if (typeof action[INVOKE] === 'function') { - self = action; - fn = action[INVOKE]; - } else { - var typeofAction = typeof action; + /** + Get the columns for a given model type. + @private + @method columnsForType + @param {Class} type The model type. + @return {Array} An array of columns of the following format: + name: {String} The name of the column. + desc: {String} Humanized description (what would show in a table column name). + */ + columnsForType: function (type) { + return _emberRuntime.A(); + }, - if (typeofAction === 'string') { - self = target; - fn = target.actions && target.actions[action]; - } else if (typeofAction === 'function') { - self = context; - fn = action; - } else {} - } + /** + Adds observers to a model type class. + @private + @method observeModelType + @param {String} modelName The model type name. + @param {Function} typesUpdated Called when a type is modified. + @return {Function} The function to call to remove observers. + */ - return function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } + observeModelType: function (modelName, typesUpdated) { + var _this3 = this; - var payload = { target: self, args: args, label: 'glimmer-closure-action' }; - return _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { - return _emberMetal.run.join.apply(_emberMetal.run, [self, fn].concat(processArgs(args))); - }); - }; - } -}); -enifed('ember-glimmer/helpers/component', ['exports', 'ember-utils', 'ember-glimmer/utils/references', 'ember-glimmer/syntax/curly-component', 'glimmer-runtime', 'ember-metal'], function (exports, _emberUtils, _emberGlimmerUtilsReferences, _emberGlimmerSyntaxCurlyComponent, _glimmerRuntime, _emberMetal) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; + var klass = this._nameToClass(modelName); + var records = this.getRecords(klass, modelName); - /** - 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. - `{{component}}`'s primary use is for cases where you want to dynamically - change which type of component is rendered as the state of your application - changes. The provided block will be applied as the template for the component. - Given an empty `` the following template: - - ```handlebars - {{! application.hbs }} - {{component infographicComponentName}} - ``` - - And the following application code: - - ```javascript - export default Ember.Controller.extend({ - infographicComponentName: computed('isMarketOpen', { - get() { - if (this.get('isMarketOpen')) { - return 'live-updating-chart'; - } else { - return 'market-close-summary'; - } + function onChange() { + typesUpdated([this.wrapModelType(klass, modelName)]); + } + + var observer = { + didChange: function () { + _emberMetal.run.scheduleOnce('actions', this, onChange); + }, + willChange: function () { + return this; } - }) - }); - ``` - - The `live-updating-chart` component will be appended when `isMarketOpen` is - `true`, and the `market-close-summary` component will be appended when - `isMarketOpen` is `false`. If the value changes while the app is running, - the component will be automatically swapped out accordingly. - Note: You should not use this helper when you are consistently rendering the same - component. In that case, use standard component syntax, for example: - - ```handlebars - {{! application.hbs }} - {{live-updating-chart}} - ``` - - ## Nested Usage - - The `component` helper can be used to package a component path with initial attrs. - The included attrs can then be merged during the final invocation. - For example, given a `person-form` component with the following template: - - ```handlebars - {{yield (hash - nameInput=(component "my-input-component" value=model.name placeholder="First Name"))}} - ``` - - The following snippet: - - ``` - {{#person-form as |form|}} - {{component form.nameInput placeholder="Username"}} - {{/person-form}} - ``` - - would output an input whose value is already bound to `model.name` and `placeholder` - is "Username". - - @method component - @since 1.11.0 - @for Ember.Templates.helpers - @public - */ + }; - var ClosureComponentReference = (function (_CachedReference) { - babelHelpers.inherits(ClosureComponentReference, _CachedReference); + _emberRuntime.addArrayObserver(records, this, observer); - ClosureComponentReference.create = function create(args, symbolTable, env) { - return new ClosureComponentReference(args, symbolTable, env); - }; + var release = function () { + return _emberRuntime.removeArrayObserver(records, _this3, observer); + }; - function ClosureComponentReference(args, symbolTable, env) { - _CachedReference.call(this); - this.defRef = args.positional.at(0); - this.env = env; - this.tag = args.positional.at(0).tag; - this.symbolTable = symbolTable; - this.args = args; - this.lastDefinition = undefined; - this.lastName = undefined; - } + return release; + }, - ClosureComponentReference.prototype.compute = function compute() { - // TODO: Figure out how to extract this because it's nearly identical to - // DynamicComponentReference::compute(). The only differences besides - // currying are in the assertion messages. - var args = this.args; - var defRef = this.defRef; - var env = this.env; - var symbolTable = this.symbolTable; - var lastDefinition = this.lastDefinition; - var lastName = this.lastName; + /** + Wraps a given model type and observes changes to it. + @private + @method wrapModelType + @param {Class} klass A model class. + @param {String} modelName Name of the class. + @return {Object} Contains the wrapped type and the function to remove observers + Format: + type: {Object} The wrapped type. + The wrapped type has the following format: + name: {String} The name of the type. + count: {Integer} The number of records available. + columns: {Columns} An array of columns to describe the record. + object: {Class} The actual Model type class. + release: {Function} The function to remove observers. + */ + wrapModelType: function (klass, name) { + var records = this.getRecords(klass, name); + var typeToSend = undefined; - var nameOrDef = defRef.value(); - var definition = null; + typeToSend = { + name: name, + count: _emberMetal.get(records, 'length'), + columns: this.columnsForType(klass), + object: klass + }; - if (nameOrDef && nameOrDef === lastName) { - return lastDefinition; - } + return typeToSend; + }, - this.lastName = nameOrDef; + /** + Fetches all models defined in the application. + @private + @method getModelTypes + @return {Array} Array of model types. + */ + getModelTypes: function () { + var _this4 = this; - if (typeof nameOrDef === 'string') { - definition = env.getComponentDefinition([nameOrDef], symbolTable); - } else if (_glimmerRuntime.isComponentDefinition(nameOrDef)) { - definition = nameOrDef; + var containerDebugAdapter = this.get('containerDebugAdapter'); + var types = undefined; + + if (containerDebugAdapter.canCatalogEntriesByType('model')) { + types = containerDebugAdapter.catalogEntriesByType('model'); } else { - return null; + types = this._getObjectsOnNamespaces(); } - var newDef = createCurriedDefinition(definition, args); - - this.lastDefinition = newDef; - - return newDef; - }; - - return ClosureComponentReference; - })(_emberGlimmerUtilsReferences.CachedReference); - - exports.ClosureComponentReference = ClosureComponentReference; + // New adapters return strings instead of classes. + types = _emberRuntime.A(types).map(function (name) { + return { + klass: _this4._nameToClass(name), + name: name + }; + }); + types = _emberRuntime.A(types).filter(function (type) { + return _this4.detect(type.klass); + }); - function createCurriedDefinition(definition, args) { - var curriedArgs = curryArgs(definition, args); + return _emberRuntime.A(types); + }, - return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentDefinition(definition.name, definition.ComponentClass, definition.template, curriedArgs); - } + /** + Loops over all namespaces and all objects + attached to them. + @private + @method _getObjectsOnNamespaces + @return {Array} Array of model type strings. + */ + _getObjectsOnNamespaces: function () { + var _this5 = this; - function curryArgs(definition, newArgs) { - var args = definition.args; - var ComponentClass = definition.ComponentClass; - var positionalParams = ComponentClass.positionalParams; + var namespaces = _emberRuntime.A(_emberRuntime.Namespace.NAMESPACES); + var types = _emberRuntime.A(); - // The args being passed in are from the (component ...) invocation, - // so the first positional argument is actually the name or component - // definition. It needs to be dropped in order for any actual positional - // args to coincide with the ComponentClass's positionParams. + namespaces.forEach(function (namespace) { + for (var key in namespace) { + if (!namespace.hasOwnProperty(key)) { + continue; + } + // Even though we will filter again in `getModelTypes`, + // we should not call `lookupFactory` on non-models + // (especially when `EmberENV.MODEL_FACTORY_INJECTIONS` is `true`) + if (!_this5.detect(namespace[key])) { + continue; + } + var _name = _emberRuntime.String.dasherize(key); + if (!(namespace instanceof _emberApplication.Application) && namespace.toString()) { + _name = namespace + '/' + _name; + } + types.push(_name); + } + }); + return types; + }, - // For "normal" curly components this slicing is done at the syntax layer, - // but we don't have that luxury here. + /** + Fetches all loaded records for a given type. + @private + @method getRecords + @return {Array} An array of records. + This array will be observed for changes, + so it should update when new records are added/removed. + */ + getRecords: function (type) { + return _emberRuntime.A(); + }, - var _newArgs$positional$values = newArgs.positional.values; + /** + Wraps a record and observers changes to it. + @private + @method wrapRecord + @param {Object} record The record instance. + @return {Object} The wrapped record. Format: + columnValues: {Array} + searchKeywords: {Array} + */ + wrapRecord: function (record) { + var recordToSend = { object: record }; - var slicedPositionalArgs = _newArgs$positional$values.slice(1); + recordToSend.columnValues = this.getRecordColumnValues(record); + recordToSend.searchKeywords = this.getRecordKeywords(record); + recordToSend.filterValues = this.getRecordFilterValues(record); + recordToSend.color = this.getRecordColor(record); - if (positionalParams && slicedPositionalArgs.length) { - _emberGlimmerSyntaxCurlyComponent.validatePositionalParameters(newArgs.named, slicedPositionalArgs, positionalParams); - } + return recordToSend; + }, - var isRest = typeof positionalParams === 'string'; + /** + Gets the values for each column. + @private + @method getRecordColumnValues + @return {Object} Keys should match column names defined + by the model type. + */ + getRecordColumnValues: function (record) { + return {}; + }, - // For non-rest position params, we need to perform the position -> name mapping - // at each layer to avoid a collision later when the args are used to construct - // the component instance (inside of processArgs(), inside of create()). - var positionalToNamedParams = {}; + /** + Returns keywords to match when searching records. + @private + @method getRecordKeywords + @return {Array} Relevant keywords for search. + */ + getRecordKeywords: function (record) { + return _emberRuntime.A(); + }, - if (!isRest && positionalParams && positionalParams.length > 0) { - var limit = Math.min(positionalParams.length, slicedPositionalArgs.length); + /** + Returns the values of filters defined by `getFilters`. + @private + @method getRecordFilterValues + @param {Object} record The record instance. + @return {Object} The filter values. + */ + getRecordFilterValues: function (record) { + return {}; + }, - for (var i = 0; i < limit; i++) { - var _name = positionalParams[i]; - positionalToNamedParams[_name] = slicedPositionalArgs[i]; - } + /** + Each record can have a color that represents its state. + @private + @method getRecordColor + @param {Object} record The record instance + @return {String} The records color. + Possible options: black, red, blue, green. + */ + getRecordColor: function (record) { + return null; + }, - slicedPositionalArgs.length = 0; // Throw them away since you're merged in. + /** + Observes all relevant properties and re-sends the wrapped record + when a change occurs. + @private + @method observerRecord + @param {Object} record The record instance. + @param {Function} recordUpdated The callback to call when a record is updated. + @return {Function} The function to call to remove all observers. + */ + observeRecord: function (record, recordUpdated) { + return function () {}; } + }); +}); +enifed('ember-extension-support/index', ['exports', 'ember-extension-support/data_adapter', 'ember-extension-support/container_debug_adapter'], function (exports, _emberExtensionSupportData_adapter, _emberExtensionSupportContainer_debug_adapter) { + /** + @module ember + @submodule ember-extension-support + */ - // args (aka 'oldArgs') may be undefined or simply be empty args, so - // we need to fall back to an empty array or object. - var oldNamed = args && args.named && args.named.map || {}; - var oldPositional = args && args.positional && args.positional.values || []; - - // Merge positional arrays - var mergedPositional = new Array(Math.max(oldPositional.length, slicedPositionalArgs.length)); - mergedPositional.splice.apply(mergedPositional, [0, oldPositional.length].concat(oldPositional)); - mergedPositional.splice.apply(mergedPositional, [0, slicedPositionalArgs.length].concat(slicedPositionalArgs)); - - // Merge named maps - var mergedNamed = _emberUtils.assign({}, oldNamed, positionalToNamedParams, newArgs.named.map); - - var mergedArgs = _glimmerRuntime.EvaluatedArgs.create(_glimmerRuntime.EvaluatedPositionalArgs.create(mergedPositional), _glimmerRuntime.EvaluatedNamedArgs.create(mergedNamed), _glimmerRuntime.Blocks.empty()); - - return mergedArgs; - } + 'use strict'; - exports.default = function (vm, args, symbolTable) { - return ClosureComponentReference.create(args, symbolTable, vm.env); - }; + exports.DataAdapter = _emberExtensionSupportData_adapter.default; + exports.ContainerDebugAdapter = _emberExtensionSupportContainer_debug_adapter.default; }); -enifed('ember-glimmer/helpers/concat', ['exports', 'ember-glimmer/utils/references', 'glimmer-runtime'], function (exports, _emberGlimmerUtilsReferences, _glimmerRuntime) { +enifed('ember-glimmer/component', ['exports', 'ember-utils', 'ember-views', 'ember-runtime', 'ember-metal', 'ember-glimmer/utils/references', '@glimmer/reference', '@glimmer/runtime'], function (exports, _emberUtils, _emberViews, _emberRuntime, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference, _glimmerRuntime) { 'use strict'; + var _CoreView$extend; + + var DIRTY_TAG = _emberUtils.symbol('DIRTY_TAG'); + exports.DIRTY_TAG = DIRTY_TAG; + var ARGS = _emberUtils.symbol('ARGS'); + exports.ARGS = ARGS; + var ROOT_REF = _emberUtils.symbol('ROOT_REF'); + exports.ROOT_REF = ROOT_REF; + var IS_DISPATCHING_ATTRS = _emberUtils.symbol('IS_DISPATCHING_ATTRS'); + exports.IS_DISPATCHING_ATTRS = IS_DISPATCHING_ATTRS; + var HAS_BLOCK = _emberUtils.symbol('HAS_BLOCK'); + exports.HAS_BLOCK = HAS_BLOCK; + var BOUNDS = _emberUtils.symbol('BOUNDS'); + + exports.BOUNDS = BOUNDS; /** @module ember @submodule ember-glimmer */ /** - Concatenates the given arguments into a string. + An `Ember.Component` is a view that is completely + isolated. Properties accessed in its templates go + to the view object and actions are targeted at + the view object. There is no access to the + surrounding context or outer controller; all + contextual information must be passed in. - Example: + The easiest way to create an `Ember.Component` is via + a template. If you name a template + `app/components/my-foo.hbs`, you will be able to use + `{{my-foo}}` in other templates, which will make + an instance of the isolated component. - ```handlebars - {{some-component name=(concat firstName " " lastName)}} + ```app/components/my-foo.hbs + {{person-profile person=currentUser}} + ``` - {{! would pass name=" " to the component}} + ```app/components/person-profile.hbs +

    {{person.title}}

    + +

    {{person.signature}}

    ``` - @public - @method concat - @for Ember.Templates.helpers - @since 1.13.0 - */ - function concat(_ref) { - var positional = _ref.positional; - - return positional.value().map(_glimmerRuntime.normalizeTextValue).join(''); - } - - exports.default = function (vm, args) { - return new _emberGlimmerUtilsReferences.InternalHelperReference(concat, args); - }; -}); -enifed('ember-glimmer/helpers/debugger', ['exports', 'ember-metal/debug', 'glimmer-runtime'], function (exports, _emberMetalDebug, _glimmerRuntime) { - /*jshint debug:true*/ - - /** - @module ember - @submodule ember-htmlbars - */ - - 'use strict'; - - exports.default = debuggerHelper; - exports.setDebuggerCallback = setDebuggerCallback; - exports.resetDebuggerCallback = resetDebuggerCallback; - - /** - Execute the `debugger` statement in the current template's context. + You can use `yield` inside a template to + include the **contents** of any block attached to + the component. The block will be executed in the + context of the surrounding context or outer controller: ```handlebars - {{debugger}} + {{#person-profile person=currentUser}} +

    Admin mode

    + {{! Executed in the controller's context. }} + {{/person-profile}} ``` - When using the debugger helper you will have access to a `get` function. This - function retrieves values available in the context of the template. - For example, if you're wondering why a value `{{foo}}` isn't rendering as - expected within a template, you could place a `{{debugger}}` statement and, - when the `debugger;` breakpoint is hit, you can attempt to retrieve this value: - - ``` - > get('foo') + ```app/components/person-profile.hbs +

    {{person.title}}

    + {{! Executed in the component's context. }} + {{yield}} {{! block contents }} ``` - `get` is also aware of block variables. So in this situation + If you want to customize the component, in order to + handle events or actions, you implement a subclass + of `Ember.Component` named after the name of the + component. - ```handlebars - {{#each items as |item|}} - {{debugger}} - {{/each}} - ``` + For example, you could implement the action + `hello` for the `person-profile` component: - You'll be able to get values from the current item: + ```app/components/person-profile.js + import Ember from 'ember'; - ``` - > get('item.name') + export default Ember.Component.extend({ + actions: { + hello(name) { + console.log("Hello", name); + } + } + }); ``` - You can also access the context of the view to make sure it is the object that - you expect: + And then use it in the component's template: - ``` - > context + ```app/templates/components/person-profile.hbs +

    {{person.title}}

    + {{yield}} + ``` - @method debugger - @for Ember.Templates.helpers - @public - */ - function defaultCallback(context, get) { - - debugger; - - /* jshint debug: true */ - } - - var callback = defaultCallback; - - function debuggerHelper(vm, args, symbolTable) { - var context = vm.getSelf().value(); - - // Note: this is totally an overkill since we are only compiling - // expressions, but this is the only kind of SymbolLookup we can - // construct. The symbol table itself should really be sufficient - // here – we should refactor the Glimmer code to make that possible. - var symbolLookup = new _glimmerRuntime.CompileIntoList(vm.env, symbolTable); - - function get(path) { - // Problem: technically, we are getting a `PublicVM` here, but to - // evaluate an expression it requires the full VM. We happen to know - // that they are the same thing, so this would work for now. However - // this might break in the future. - return _glimmerRuntime.GetSyntax.build(path).compile(symbolLookup).evaluate(vm).value(); - } - - callback(context, get); - - return _glimmerRuntime.UNDEFINED_REFERENCE; - } - - // These are exported for testing - - function setDebuggerCallback(newCallback) { - callback = newCallback; - } - - function resetDebuggerCallback() { - callback = defaultCallback; - } -}); -enifed('ember-glimmer/helpers/each-in', ['exports', 'ember-utils'], function (exports, _emberUtils) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; - - exports.isEachIn = isEachIn; - - /** - The `{{#each}}` helper loops over elements in a collection. It is an extension - of the base Handlebars `{{#each}}` helper. - The default behavior of `{{#each}}` is to yield its inner block once for every - item in an array passing the item as the first block parameter. + Components must have a `-` in their name to avoid + conflicts with built-in controls that wrap HTML + elements. This is consistent with the same + requirement in web components. - ```javascript - var developers = [{ name: 'Yehuda' },{ name: 'Tom' }, { name: 'Paul' }]; + + ## HTML Tag + + The default HTML tag name used for a component's DOM representation is `div`. + This can be customized by setting the `tagName` property. + The following component class: + + ```app/components/emphasized-paragraph.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + tagName: 'em' + }); ``` - ```handlebars - {{#each developers key="name" as |person|}} - {{person.name}} - {{! `this` is whatever it was outside the #each }} - {{/each}} + Would result in instances with the following HTML: + + ```html + ``` - The same rules apply to arrays of primitives. - ```javascript - var developerNames = ['Yehuda', 'Tom', 'Paul'] + ## HTML `class` Attribute + + The HTML `class` attribute of a component's tag can be set by providing a + `classNames` property that is set to an array of strings: + + ```app/components/my-widget.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + classNames: ['my-class', 'my-other-class'] + }); ``` - ```handlebars - {{#each developerNames key="@index" as |name|}} - {{name}} - {{/each}} + Will result in component instances with an HTML representation of: + + ```html +
    ``` - During iteration, the index of each item in the array is provided as a second block parameter. + `class` attribute values can also be set by providing a `classNameBindings` + property set to an array of properties names for the component. The return value + of these properties will be added as part of the value for the components's `class` + attribute. These properties can be computed properties: - ```handlebars -
      - {{#each people as |person index|}} -
    • Hello, {{person.name}}! You're number {{index}} in line
    • - {{/each}} -
    + ```app/components/my-widget.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + classNameBindings: ['propertyA', 'propertyB'], + propertyA: 'from-a', + propertyB: Ember.computed(function() { + if (someLogic) { return 'from-b'; } + }) + }); ``` - ### Specifying Keys + Will result in component instances with an HTML representation of: - The `key` option is used to tell Ember how to determine if the array being - iterated over with `{{#each}}` has changed between renders. By helping Ember - detect that some elements in the array are the same, DOM elements can be - re-used, significantly improving rendering speed. + ```html +
    + ``` - For example, here's the `{{#each}}` helper with its `key` set to `id`: + If the value of a class name binding returns a boolean the property name + itself will be used as the class name if the property is true. + The class name will not be added if the value is `false` or `undefined`. - ```handlebars - {{#each model key="id" as |item|}} - {{/each}} + ```app/components/my-widget.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + classNameBindings: ['hovered'], + hovered: true + }); ``` - When this `{{#each}}` re-renders, Ember will match up the previously rendered - items (and reorder the generated DOM elements) based on each item's `id` - property. - By default the item's own reference is used. + Will result in component instances with an HTML representation of: - ### {{else}} condition + ```html +
    + ``` - `{{#each}}` can have a matching `{{else}}`. The contents of this block will render - if the collection is empty. + When using boolean class name bindings you can supply a string value other + than the property name for use as the `class` HTML attribute by appending the + preferred value after a ":" character when defining the binding: - ```handlebars - {{#each developers as |person|}} - {{person.name}} - {{else}} -

    Sorry, nobody is available for this task.

    - {{/each}} + ```app/components/my-widget.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + classNameBindings: ['awesome:so-very-cool'], + awesome: true + }); ``` - @method each - @for Ember.Templates.helpers - @public - */ - - /** - The `{{each-in}}` helper loops over properties on an object. + Will result in component instances with an HTML representation of: - For example, given a `user` object that looks like: + ```html +
    + ``` - ```javascript - { - "name": "Shelly Sails", - "age": 42 - } + Boolean value class name bindings whose property names are in a + camelCase-style format will be converted to a dasherized format: + + ```app/components/my-widget.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + classNameBindings: ['isUrgent'], + isUrgent: true + }); ``` - This template would display all properties on the `user` - object in a list: + Will result in component instances with an HTML representation of: - ```handlebars -
      - {{#each-in user as |key value|}} -
    • {{key}}: {{value}}
    • - {{/each-in}} -
    + ```html +
    ``` - Outputting their name and age. + Class name bindings can also refer to object values that are found by + traversing a path relative to the component itself: - @method each-in - @for Ember.Templates.helpers - @public - @since 2.1.0 - */ - var EACH_IN_REFERENCE = _emberUtils.symbol('EACH_IN'); - - function isEachIn(ref) { - return ref && ref[EACH_IN_REFERENCE]; - } - - exports.default = function (vm, args) { - var ref = Object.create(args.positional.at(0)); - ref[EACH_IN_REFERENCE] = true; - return ref; - }; -}); -enifed('ember-glimmer/helpers/get', ['exports', 'ember-metal', 'ember-glimmer/utils/references', 'glimmer-reference'], function (exports, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference) { - 'use strict'; - - /** - @module ember - @submodule ember-glimmer - */ - - /** - Dynamically look up a property on an object. The second argument to `{{get}}` - should have a string value, although it can be bound. + ```app/components/my-widget.js + import Ember from 'ember'; - For example, these two usages are equivilent: + export default Ember.Component.extend({ + classNameBindings: ['messages.empty'], + messages: Ember.Object.create({ + empty: true + }) + }); + ``` - ```handlebars - {{person.height}} - {{get person "height"}} + Will result in component instances with an HTML representation of: + + ```html +
    ``` - If there were several facts about a person, the `{{get}}` helper can dynamically - pick one: + If you want to add a class name for a property which evaluates to true and + and a different class name if it evaluates to false, you can pass a binding + like this: - ```handlebars - {{get person factName}} + ```app/components/my-widget.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + classNameBindings: ['isEnabled:enabled:disabled'], + isEnabled: true + }); ``` - For a more complex example, this template would allow the user to switch - between showing the user's height and weight with a click: + Will result in component instances with an HTML representation of: - ```handlebars - {{get person factName}} - - + ```html +
    ``` - The `{{get}}` helper can also respect mutable values itself. For example: + When isEnabled is `false`, the resulting HTML representation looks like + this: - ```handlebars - {{input value=(mut (get person factName)) type="text"}} - - + ```html +
    ``` - Would allow the user to swap what fact is being displayed, and also edit - that fact via a two-way mutable binding. + This syntax offers the convenience to add a class if a property is `false`: - @public - @method get - @for Ember.Templates.helpers - @since 2.1.0 - */ - - exports.default = function (vm, args) { - return GetHelperReference.create(args.positional.at(0), args.positional.at(1)); - }; - - var GetHelperReference = (function (_CachedReference) { - babelHelpers.inherits(GetHelperReference, _CachedReference); - - GetHelperReference.create = function create(sourceReference, pathReference) { - if (_glimmerReference.isConst(pathReference)) { - var parts = pathReference.value().split('.'); - return _glimmerReference.referenceFromParts(sourceReference, parts); - } else { - return new GetHelperReference(sourceReference, pathReference); - } - }; - - function GetHelperReference(sourceReference, pathReference) { - _CachedReference.call(this); - this.sourceReference = sourceReference; - this.pathReference = pathReference; - - this.lastPath = null; - this.innerReference = null; - - var innerTag = this.innerTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - - this.tag = _glimmerReference.combine([sourceReference.tag, pathReference.tag, innerTag]); - } - - GetHelperReference.prototype.compute = function compute() { - var lastPath = this.lastPath; - var innerReference = this.innerReference; - var innerTag = this.innerTag; - - var path = this.lastPath = this.pathReference.value(); - - if (path !== lastPath) { - if (path) { - var pathType = typeof path; - - if (pathType === 'string') { - innerReference = this.innerReference = _glimmerReference.referenceFromParts(this.sourceReference, path.split('.')); - } else if (pathType === 'number') { - innerReference = this.innerReference = this.sourceReference.get(path); - } - - innerTag.update(innerReference.tag); - } else { - innerReference = this.innerReference = null; - innerTag.update(_glimmerReference.CONSTANT_TAG); - } - } - - return innerReference ? innerReference.value() : null; - }; - - GetHelperReference.prototype[_emberGlimmerUtilsReferences.UPDATE] = function (value) { - _emberMetal.set(this.sourceReference.value(), this.pathReference.value(), value); - }; - - return GetHelperReference; - })(_emberGlimmerUtilsReferences.CachedReference); -}); -enifed("ember-glimmer/helpers/hash", ["exports"], function (exports) { - /** - @module ember - @submodule ember-glimmer - */ - - /** - Use the `{{hash}}` helper to create a hash to pass as an option to your - components. This is specially useful for contextual components where you can - just yield a hash: - - ```handlebars - {{yield (hash - name='Sarah' - title=office - )}} - ``` - - Would result in an object such as: - - ```js - { name: 'Sarah', title: this.get('office') } - ``` - - Where the `title` is bound to updates of the `office` property. - - @method hash - @for Ember.Templates.helpers - @param {Object} options - @return {Object} Hash - @public - */ - - "use strict"; - - exports.default = function (vm, args) { - return args.named; - }; -}); -enifed('ember-glimmer/helpers/if-unless', ['exports', 'ember-metal', 'ember-glimmer/utils/references', 'glimmer-reference'], function (exports, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference) { - /** - @module ember - @submodule ember-glimmer - */ - - 'use strict'; - - exports.inlineIf = inlineIf; - exports.inlineUnless = inlineUnless; - - /** - 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`, `NaN` or an empty array, the block will not be rendered. + ```app/components/my-widget.js + import Ember from 'ember'; - ```handlebars - {{! will not render if foo is falsey}} - {{#if foo}} - Welcome to the {{foo.bar}} - {{/if}} + // Applies no class when isEnabled is true and class 'disabled' when isEnabled is false + export default Ember.Component.extend({ + classNameBindings: ['isEnabled::disabled'], + isEnabled: true + }); ``` - You can also specify a template to show if the property is falsey by using - the `else` helper. + Will result in component instances with an HTML representation of: - ```handlebars - {{! is it raining outside?}} - {{#if isRaining}} - Yes, grab an umbrella! - {{else}} - No, it's lovely outside! - {{/if}} + ```html +
    ``` - You are also able to combine `else` and `if` helpers to create more complex - conditional logic. + When the `isEnabled` property on the component is set to `false`, it will result + in component instances with an HTML representation of: - ```handlebars - {{#if isMorning}} - Good morning - {{else if isAfternoon}} - Good afternoon - {{else}} - Good night - {{/if}} + ```html +
    ``` - You can use `if` inline to conditionally render a single property or string. - This helper acts like a ternary operator. If the first property is truthy, - the second argument will be displayed, if not, the third argument will be - displayed + Updates to the value of a class name binding will result in automatic + update of the HTML `class` attribute in the component's rendered HTML + representation. If the value becomes `false` or `undefined` the class name + will be removed. + Both `classNames` and `classNameBindings` are concatenated properties. See + [Ember.Object](/api/classes/Ember.Object.html) documentation for more + information about concatenated properties. - ```handlebars - {{if useLongGreeting "Hello" "Hi"}} Dave - ``` - Finally, you can use the `if` helper inside another helper as a subexpression. + ## HTML Attributes - ```handlebars - {{some-component height=(if isBig "100" "10")}} - ``` + The HTML attribute section of a component's tag can be set by providing an + `attributeBindings` property set to an array of property names on the component. + The return value of these properties will be used as the value of the component's + HTML associated attribute: - @method if - @for Ember.Templates.helpers - @public - */ - - var ConditionalHelperReference = (function (_CachedReference) { - babelHelpers.inherits(ConditionalHelperReference, _CachedReference); - - ConditionalHelperReference.create = function create(_condRef, _truthyRef, _falsyRef) { - var condRef = _emberGlimmerUtilsReferences.ConditionalReference.create(_condRef); - var truthyRef = _truthyRef || _emberGlimmerUtilsReferences.UNDEFINED_REFERENCE; - var falsyRef = _falsyRef || _emberGlimmerUtilsReferences.UNDEFINED_REFERENCE; - - if (_glimmerReference.isConst(condRef)) { - return condRef.value() ? truthyRef : falsyRef; - } else { - return new ConditionalHelperReference(condRef, truthyRef, falsyRef); - } - }; - - function ConditionalHelperReference(cond, truthy, falsy) { - _CachedReference.call(this); - - this.branchTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - this.tag = _glimmerReference.combine([cond.tag, this.branchTag]); - - this.cond = cond; - this.truthy = truthy; - this.falsy = falsy; - } - - /** - The inline `if` helper conditionally renders a single property or string. - This helper acts like a ternary operator. If the first property is truthy, - the second argument will be displayed, otherwise, the third argument will be - displayed - - ```handlebars - {{if useLongGreeting "Hello" "Hi"}} Alex - ``` - - You can use the `if` helper inside another helper as a subexpression. - - ```handlebars - {{some-component height=(if isBig "100" "10")}} - ``` - - @method if - @for Ember.Templates.helpers - @public - */ - - ConditionalHelperReference.prototype.compute = function compute() { - var cond = this.cond; - var truthy = this.truthy; - var falsy = this.falsy; - - var branch = cond.value() ? truthy : falsy; - - this.branchTag.update(branch.tag); - - return branch.value(); - }; - - return ConditionalHelperReference; - })(_emberGlimmerUtilsReferences.CachedReference); - - function inlineIf(vm, _ref) { - var positional = _ref.positional; - - switch (positional.length) { - case 2: - return ConditionalHelperReference.create(positional.at(0), positional.at(1), null); - case 3: - return ConditionalHelperReference.create(positional.at(0), positional.at(1), positional.at(2)); - default: - } - } - - /** - The inline `unless` helper conditionally renders a single property or string. - This helper acts like a ternary operator. If the first property is falsy, - the second argument will be displayed, otherwise, the third argument will be - displayed + ```app/components/my-anchor.js + import Ember from 'ember'; - ```handlebars - {{unless useLongGreeting "Hi" "Hello"}} Ben + export default Ember.Component.extend({ + tagName: 'a', + attributeBindings: ['href'], + href: 'http://google.com' + }); ``` - You can use the `unless` helper inside another helper as a subexpression. + Will result in component instances with an HTML representation of: - ```handlebars - {{some-component height=(unless isBig "10" "100")}} + ```html + ``` - @method unless - @for Ember.Templates.helpers - @public - */ - - function inlineUnless(vm, _ref2) { - var positional = _ref2.positional; - - switch (positional.length) { - case 2: - return ConditionalHelperReference.create(positional.at(0), null, positional.at(1)); - case 3: - return ConditionalHelperReference.create(positional.at(0), positional.at(2), positional.at(1)); - default: - } - } -}); -enifed('ember-glimmer/helpers/loc', ['exports', 'ember-glimmer/utils/references', 'ember-runtime'], function (exports, _emberGlimmerUtilsReferences, _emberRuntime) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; - - /** - Calls [Ember.String.loc](/api/classes/Ember.String.html#method_loc) with the - provided string. This is a convenient way to localize text within a template. - For example: + One property can be mapped on to another by placing a ":" between + the source property and the destination property: - ```javascript - Ember.STRINGS = { - '_welcome_': 'Bonjour' - }; - ``` + ```app/components/my-anchor.js + import Ember from 'ember'; - ```handlebars -
    - {{loc '_welcome_'}} -
    + export default Ember.Component.extend({ + tagName: 'a', + attributeBindings: ['url:href'], + url: 'http://google.com' + }); ``` + Will result in component instances with an HTML representation of: + ```html -
    - Bonjour -
    + ``` - See [Ember.String.loc](/api/classes/Ember.String.html#method_loc) for how to - set up localized string references. + Namespaced attributes (e.g. `xlink:href`) are supported, but have to be + mapped, since `:` is not a valid character for properties in Javascript: - @method loc - @for Ember.Templates.helpers - @param {String} str The string to format. - @see {Ember.String#loc} - @public - */ - function locHelper(_ref) { - var positional = _ref.positional; - - return _emberRuntime.String.loc.apply(null, positional.value()); - } - - exports.default = function (vm, args) { - return new _emberGlimmerUtilsReferences.InternalHelperReference(locHelper, args); - }; -}); -enifed('ember-glimmer/helpers/log', ['exports', 'ember-glimmer/utils/references', 'ember-console'], function (exports, _emberGlimmerUtilsReferences, _emberConsole) { - 'use strict'; - - /** - `log` allows you to output the value of variables in the current rendering - context. `log` also accepts primitive types such as strings or numbers. + ```app/components/my-use.js + import Ember from 'ember'; - ```handlebars - {{log "myVariable:" myVariable }} + export default Ember.Component.extend({ + tagName: 'use', + attributeBindings: ['xlinkHref:xlink:href'], + xlinkHref: '#triangle' + }); ``` - @method log - @for Ember.Templates.helpers - @param {Array} params - @public - */ - function log(_ref) { - var positional = _ref.positional; - - _emberConsole.default.log.apply(null, positional.value()); - } - - exports.default = function (vm, args) { - return new _emberGlimmerUtilsReferences.InternalHelperReference(log, args); - }; -}); - -/** -@module ember -@submodule ember-glimmer -*/ -enifed('ember-glimmer/helpers/mut', ['exports', 'ember-utils', 'ember-metal', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/action'], function (exports, _emberUtils, _emberMetal, _emberGlimmerUtilsReferences, _emberGlimmerHelpersAction) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; - - exports.isMut = isMut; - exports.unMut = unMut; - - /** - 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 component__. - - To specify that a parameter is mutable, when invoking the child `Component`: + Will result in component instances with an HTML representation of: - ```handlebars - {{my-child childClickCount=(mut totalClicks)}} + ```html + ``` - The child `Component` can then modify the parent's value just by modifying its own - property: + If the return value of an `attributeBindings` monitored property is a boolean + the attribute will be present or absent depending on the value: - ```javascript - // my-child.js - export default Component.extend({ - click() { - this.incrementProperty('childClickCount'); - } + ```app/components/my-text-input.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + tagName: 'input', + attributeBindings: ['disabled'], + disabled: false }); ``` - Additionally, the `mut` helper can be combined with the `action` helper to - mutate a value. For example: + Will result in a component instance with an HTML representation of: - ```handlebars - {{my-child childClickCount=totalClicks click-count-change=(action (mut totalClicks))}} + ```html + ``` - The child `Component` would invoke the action with the new click value: + `attributeBindings` can refer to computed properties: - ```javascript - // my-child.js - export default Component.extend({ - click() { - this.get('clickCountChange')(this.get('childClickCount') + 1); - } + ```app/components/my-text-input.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + tagName: 'input', + attributeBindings: ['disabled'], + disabled: Ember.computed(function() { + if (someLogic) { + return true; + } else { + return false; + } + }) }); ``` - The `mut` helper changes the `totalClicks` value to what was provided as the action argument. + To prevent setting an attribute altogether, use `null` or `undefined` as the + return value of the `attributeBindings` monitored property: - The `mut` helper, when used with `action`, will return a function that - sets the value passed to `mut` to its first argument. This works like any other - closure action and interacts with the other features `action` provides. - As an example, we can create a button that increments a value passing the value - directly to the `action`: + ```app/components/my-text-input.js + import Ember from 'ember'; - ```handlebars - {{! inc helper is not provided by Ember }} - + export default Ember.Component.extend({ + tagName: 'form', + attributeBindings: ['novalidate'], + novalidate: null + }); ``` - You can also use the `value` option: + Updates to the property of an attribute binding will result in automatic + update of the HTML attribute in the component's rendered HTML representation. + `attributeBindings` is a concatenated property. See [Ember.Object](/api/classes/Ember.Object.html) + documentation for more information about concatenated properties. - ```handlebars - + + ## Layouts + + See [Ember.Templates.helpers.yield](/api/classes/Ember.Templates.helpers.html#method_yield) + for more information. + + + ## Responding to Browser Events + + Components can respond to user-initiated events in one of three ways: method + implementation, through an event manager, and through `{{action}}` helper use + in their template or layout. + + + ### Method Implementation + + Components can respond to user-initiated events by implementing a method that + matches the event name. A `jQuery.Event` object will be passed as the + argument to this method. + + ```app/components/my-widget.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + click(event) { + // will be called when an instance's + // rendered element is clicked + } + }); ``` - @method mut - @param {Object} [attr] the "two-way" attribute that can be modified. - @for Ember.Templates.helpers + + ### `{{action}}` Helper + + See [Ember.Templates.helpers.action](/api/classes/Ember.Templates.helpers.html#method_action). + + + ### Event Names + + All of the event handling approaches described above respond to the same set + of events. The names of the built-in events are listed below. (The hash of + built-in events exists in `Ember.EventDispatcher`.) Additional, custom events + can be registered by using `Ember.Application.customEvents`. + + Touch events: + + * `touchStart` + * `touchMove` + * `touchEnd` + * `touchCancel` + + Keyboard events: + + * `keyDown` + * `keyUp` + * `keyPress` + + Mouse events: + + * `mouseDown` + * `mouseUp` + * `contextMenu` + * `click` + * `doubleClick` + * `mouseMove` + * `focusIn` + * `focusOut` + * `mouseEnter` + * `mouseLeave` + + Form events: + + * `submit` + * `change` + * `focusIn` + * `focusOut` + * `input` + + HTML5 drag and drop events: + + * `dragStart` + * `drag` + * `dragEnter` + * `dragLeave` + * `dragOver` + * `dragEnd` + * `drop` + + @class Component + @namespace Ember + @extends Ember.CoreView + @uses Ember.TargetActionSupport + @uses Ember.ClassNamesSupport + @uses Ember.ActionSupport + @uses Ember.ViewMixin + @uses Ember.ViewStateSupport @public */ - var MUT_REFERENCE = _emberUtils.symbol('MUT'); - var SOURCE = _emberUtils.symbol('SOURCE'); + var Component = _emberViews.CoreView.extend(_emberViews.ChildViewsSupport, _emberViews.ViewStateSupport, _emberViews.ClassNamesSupport, _emberRuntime.TargetActionSupport, _emberViews.ActionSupport, _emberViews.ViewMixin, (_CoreView$extend = { + isComponent: true, - function isMut(ref) { - return ref && ref[MUT_REFERENCE]; - } + init: function () { + this._super.apply(this, arguments); + this[IS_DISPATCHING_ATTRS] = false; + this[DIRTY_TAG] = new _glimmerReference.DirtyableTag(); + this[ROOT_REF] = new _emberGlimmerUtilsReferences.RootReference(this); + this[BOUNDS] = null; - function unMut(ref) { - return ref[SOURCE] || ref; - } + // If a `defaultLayout` was specified move it to the `layout` prop. + // `layout` is no longer a CP, so this just ensures that the `defaultLayout` + // logic is supported with a deprecation + if (this.defaultLayout && !this.layout) { - exports.default = function (vm, args) { - var rawRef = args.positional.at(0); + this.layout = this.defaultLayout; + } - if (isMut(rawRef)) { - return rawRef; + // If in a tagless component, assert that no event handlers are defined + // indicate that the assertion should be triggered + }, + + rerender: function () { + this[DIRTY_TAG].dirty(); + this._super(); + }, + + __defineNonEnumerable: function (property) { + this[property.name] = property.descriptor.value; } - // TODO: Improve this error message. This covers at least two distinct - // cases: - // - // 1. (mut "not a path") – passing a literal, result from a helper - // invocation, etc - // - // 2. (mut receivedValue) – passing a value received from the caller - // that was originally derived from a literal, result from a helper - // invocation, etc - // - // This message is alright for the first case, but could be quite - // confusing for the second case. + }, _CoreView$extend[_emberMetal.PROPERTY_DID_CHANGE] = function (key) { + if (this[IS_DISPATCHING_ATTRS]) { + return; + } - var wrappedRef = Object.create(rawRef); + var args = undefined, + reference = undefined; - wrappedRef[SOURCE] = rawRef; - wrappedRef[_emberGlimmerHelpersAction.INVOKE] = rawRef[_emberGlimmerUtilsReferences.UPDATE]; - wrappedRef[MUT_REFERENCE] = true; + if ((args = this[ARGS]) && (reference = args[key])) { + if (reference[_emberGlimmerUtilsReferences.UPDATE]) { + reference[_emberGlimmerUtilsReferences.UPDATE](_emberMetal.get(this, key)); + } + } + }, _CoreView$extend.getAttr = function (key) { + // TODO Intimate API should be deprecated + return this.get(key); + }, _CoreView$extend.readDOMAttr = function (name) { + var element = _emberViews.getViewElement(this); + return _glimmerRuntime.readDOMAttr(element, name); + }, _CoreView$extend)); - return wrappedRef; - }; -}); -enifed('ember-glimmer/helpers/query-param', ['exports', 'ember-utils', 'ember-glimmer/utils/references', 'ember-metal', 'ember-routing'], function (exports, _emberUtils, _emberGlimmerUtilsReferences, _emberMetal, _emberRouting) { /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; + The WAI-ARIA role of the control represented by this view. For example, a + button may have a role of type 'button', or a pane may have a role of + type 'alertdialog'. This property is used by assistive software to help + visually challenged users navigate rich web applications. + The full list of valid WAI-ARIA roles is available at: + [http://www.w3.org/TR/wai-aria/roles#roles_categorization](http://www.w3.org/TR/wai-aria/roles#roles_categorization) + @property ariaRole + @type String + @default null + @public + */ /** - This is a helper to be used in conjunction with the link-to helper. - It will supply url query parameters to the target route. - - Example - - ```handlebars - {{#link-to 'posts' (query-params direction="asc")}}Sort{{/link-to}} - ``` - - @method query-params - @for Ember.Templates.helpers - @param {Object} hash takes a hash of query parameters - @return {Object} A `QueryParams` object for `{{link-to}}` + Enables components to take a list of parameters as arguments. + For example, a component that takes two parameters with the names + `name` and `age`: + ```javascript + let MyComponent = Ember.Component.extend; + MyComponent.reopenClass({ + positionalParams: ['name', 'age'] + }); + ``` + It can then be invoked like this: + ```hbs + {{my-component "John" 38}} + ``` + The parameters can be referred to just like named parameters: + ```hbs + Name: {{name}}, Age: {{age}}. + ``` + Using a string instead of an array allows for an arbitrary number of + parameters: + ```javascript + let MyComponent = Ember.Component.extend; + MyComponent.reopenClass({ + positionalParams: 'names' + }); + ``` + It can then be invoked like this: + ```hbs + {{my-component "John" "Michael" "Scott"}} + ``` + The parameters can then be referred to by enumerating over the list: + ```hbs + {{#each names as |name|}}{{name}}{{/each}} + ``` + @static + @public + @property positionalParams + @since 1.13.0 + */ + + /** + Called when the attributes passed into the component have been updated. + Called both during the initial render of a container and during a rerender. + Can be used in place of an observer; code placed here will be executed + every time any attribute updates. + @method didReceiveAttrs + @public + @since 1.13.0 + */ + + /** + Called when the attributes passed into the component have been updated. + Called both during the initial render of a container and during a rerender. + Can be used in place of an observer; code placed here will be executed + every time any attribute updates. + @event didReceiveAttrs + @public + @since 1.13.0 + */ + + /** + Called after a component has been rendered, both on initial render and + in subsequent rerenders. + @method didRender + @public + @since 1.13.0 + */ + + /** + Called after a component has been rendered, both on initial render and + in subsequent rerenders. + @event didRender + @public + @since 1.13.0 + */ + + /** + Called before a component has been rendered, both on initial render and + in subsequent rerenders. + @method willRender + @public + @since 1.13.0 + */ + + /** + Called before a component has been rendered, both on initial render and + in subsequent rerenders. + @event willRender + @public + @since 1.13.0 + */ + + /** + Called when the attributes passed into the component have been changed. + Called only during a rerender, not during an initial render. + @method didUpdateAttrs + @public + @since 1.13.0 + */ + + /** + Called when the attributes passed into the component have been changed. + Called only during a rerender, not during an initial render. + @event didUpdateAttrs + @public + @since 1.13.0 + */ + + /** + Called when the component is about to update and rerender itself. + Called only during a rerender, not during an initial render. + @method willUpdate + @public + @since 1.13.0 + */ + + /** + Called when the component is about to update and rerender itself. + Called only during a rerender, not during an initial render. + @event willUpdate + @public + @since 1.13.0 + */ + + /** + Called when the component has updated and rerendered itself. + Called only during a rerender, not during an initial render. + @method didUpdate + @public + @since 1.13.0 + */ + + /** + Called when the component has updated and rerendered itself. + Called only during a rerender, not during an initial render. + @event didUpdate + @public + @since 1.13.0 + */ + + /** + A component may contain a layout. A layout is a regular template but + supersedes the `template` property during rendering. It is the + responsibility of the layout template to retrieve the `template` + property from the component (or alternatively, call `Handlebars.helpers.yield`, + `{{yield}}`) to render it in the correct location. + This is useful for a component 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 @public */ - function queryParams(_ref) { - var positional = _ref.positional; - var named = _ref.named; - return _emberRouting.QueryParams.create({ - values: _emberUtils.assign({}, named.value()) - }); - } + /** + The name of the layout to lookup if no layout is provided. + By default `Ember.Component` will lookup a template with this name in + `Ember.TEMPLATES` (a shared global object). + @property layoutName + @type String + @default null + @private + */ - exports.default = function (vm, args) { - return new _emberGlimmerUtilsReferences.InternalHelperReference(queryParams, args); - }; -}); -enifed('ember-glimmer/helpers/readonly', ['exports', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/mut'], function (exports, _emberGlimmerUtilsReferences, _emberGlimmerHelpersMut) { /** - @module ember - @submodule ember-glimmer + Returns a jQuery object for this component's element. If you pass in a selector + string, this method will return a jQuery object, using the current element + as its buffer. + For example, calling `component.$('li')` will return a jQuery object containing + all of the `li` elements inside the DOM element of this component. + @method $ + @param {String} [selector] a jQuery-compatible selector string + @return {jQuery} the jQuery object for the DOM node + @public */ - 'use strict'; /** - The `readonly` helper let's you specify that a binding is one-way only, - instead of two-way. - When you pass a `readonly` binding from an outer context (e.g. parent component), - to to an inner context (e.g. child component), you are saying that changing that - property in the inner context does not change the value in the outer context. - - To specify that a binding is read-only, when invoking the child `Component`: - - ```app/components/my-parent.js - export default Component.extend({ - totalClicks: 3 - }); - ``` - - ```app/templates/components/my-parent.hbs - {{log totalClicks}} // -> 3 - {{my-child childClickCount=(readonly totalClicks)}} - ``` - - Now, when you update `childClickCount`: - - ```app/components/my-child.js - export default Component.extend({ - click() { - this.incrementProperty('childClickCount'); - } - }); - ``` - - The value updates in the child component, but not the parent component: - - ```app/templates/components/my-child.hbs - {{log childClickCount}} //-> 4 - ``` - - ```app/templates/components/my-parent.hbs - {{log totalClicks}} //-> 3 - {{my-child childClickCount=(readonly totalClicks)}} + The HTML `id` of the component's element in the DOM. You can provide this + value yourself but it must be unique (just as in HTML): + ```handlebars + {{my-component elementId="a-really-cool-id"}} ``` - - ### Objects and Arrays - - When passing a property that is a complex object (e.g. object, array) instead of a primitive object (e.g. number, string), - only the reference to the object is protected using the readonly helper. - This means that you can change properties of the object both on the parent component, as well as the child component. - The `readonly` binding behaves similar to the `const` keyword in JavaScript. - - Let's look at an example: - - First let's set up the parent component: - - ```app/components/my-parent.js + If not manually set a default value will be provided by the framework. + Once rendered an element's `elementId` is considered immutable and you + should never change it. If you need to compute a dynamic value for the + `elementId`, you should do this when the component or element is being + instantiated: + ```javascript export default Ember.Component.extend({ - clicks: null, - init() { this._super(...arguments); - this.set('clicks', { total: 3 }); + var index = this.get('index'); + this.set('elementId', `component-id${index}`); } }); ``` + @property elementId + @type String + @public + */ + + /** + If `false`, the view will appear hidden in DOM. + @property isVisible + @type Boolean + @default null + @public + */ + Component[_emberUtils.NAME_KEY] = 'Ember.Component'; + + Component.reopenClass({ + isComponentFactory: true, + positionalParams: [] + }); + + exports.default = Component; +}); + +/** + Normally, Ember's component model is "write-only". The component takes a + bunch of attributes that it got passed in, and uses them to render its + template. + One nice thing about this model is that if you try to set a value to the + same thing as last time, Ember (through HTMLBars) will avoid doing any + work on the DOM. + This is not just a performance optimization. If an attribute has not + changed, it is important not to clobber the element's "hidden state". + For example, if you set an input's `value` to the same value as before, + it will clobber selection state and cursor position. In other words, + setting an attribute is not **always** idempotent. + This method provides a way to read an element's attribute and also + update the last value Ember knows about at the same time. This makes + setting an attribute idempotent. + In particular, what this means is that if you get an `` element's + `value` attribute and then re-render the template with the same value, + it will avoid clobbering the cursor and selection position. + Since most attribute sets are idempotent in the browser, you typically + can get away with reading attributes using jQuery, but the most reliable + way to do so is through this method. + @method readDOMAttr + @param {String} name the name of the attribute + @return String + @public + */ +enifed('ember-glimmer/components/checkbox', ['exports', 'ember-metal', 'ember-glimmer/component', 'ember-glimmer/templates/empty'], function (exports, _emberMetal, _emberGlimmerComponent, _emberGlimmerTemplatesEmpty) { + 'use strict'; + + /** + @module ember + @submodule ember-views + */ + + /** + The internal class used to create text inputs when the `{{input}}` + helper is used with `type` of `checkbox`. - ```app/templates/components/my-parent.hbs - {{log clicks.total}} //-> 3 - {{my-child childClicks=(readonly clicks)}} - ``` - - Now, if you update the `total` property of `childClicks`: + See [Ember.Templates.helpers.input](/api/classes/Ember.Templates.helpers.html#method_input) for usage details. - ```app/components/my-child.js - export default Ember.Component.extend({ - click() { - this.get('clicks').incrementProperty('total'); - } - }); - ``` + ## Direct manipulation of `checked` - You will see the following happen: + The `checked` attribute of an `Ember.Checkbox` object should always be set + through the Ember object or by interacting with its rendered element + representation via the mouse, keyboard, or touch. Updating the value of the + checkbox via jQuery will result in the checked value of the object and its + element losing synchronization. - ```app/templates/components/my-parent.hbs - {{log clicks.total}} //-> 4 - {{my-child childClicks=(readonly clicks)}} - ``` + ## Layout and LayoutName properties - ```app/templates/components/my-child.hbs - {{log childClicks.total}} //-> 4 - ``` + Because HTML `input` elements are self closing `layout` and `layoutName` + properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s + layout section for more information. - @method readonly - @param {Object} [attr] the read-only attribute. - @for Ember.Templates.helpers - @private + @class Checkbox + @namespace Ember + @extends Ember.Component + @public */ + exports.default = _emberGlimmerComponent.default.extend({ + layout: _emberGlimmerTemplatesEmpty.default, + classNames: ['ember-checkbox'], - exports.default = function (vm, args) { - var ref = _emberGlimmerHelpersMut.unMut(args.positional.at(0)); + tagName: 'input', - var wrapped = Object.create(ref); + attributeBindings: ['type', 'checked', 'indeterminate', 'disabled', 'tabindex', 'name', 'autofocus', 'required', 'form'], - wrapped[_emberGlimmerUtilsReferences.UPDATE] = undefined; + type: 'checkbox', + checked: false, + disabled: false, + indeterminate: false, - return wrapped; - }; + didInsertElement: function () { + this._super.apply(this, arguments); + _emberMetal.get(this, 'element').indeterminate = !!_emberMetal.get(this, 'indeterminate'); + }, + + change: function () { + _emberMetal.set(this, 'checked', this.$().prop('checked')); + } + }); }); -enifed('ember-glimmer/helpers/unbound', ['exports', 'ember-metal', 'ember-glimmer/utils/references'], function (exports, _emberMetal, _emberGlimmerUtilsReferences) { +enifed('ember-glimmer/components/link-to', ['exports', 'ember-console', 'ember-metal', 'ember-runtime', 'ember-views', 'ember-glimmer/templates/link-to', 'ember-glimmer/component'], function (exports, _emberConsole, _emberMetal, _emberRuntime, _emberViews, _emberGlimmerTemplatesLinkTo, _emberGlimmerComponent) { /** @module ember @submodule ember-glimmer */ - 'use strict'; - /** - 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: + The `{{link-to}}` component 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 + element: ```handlebars - {{unbound name}} + {{#link-to 'photoGallery'}} + Great Hamster Photos + {{/link-to}} ``` - Like any helper, the `unbound` helper can accept a nested helper expression. - This allows for custom helpers to be rendered unbound: + You can also use an inline form of `{{link-to}}` component by + passing the link text as the first argument + to the component: ```handlebars - {{unbound (some-custom-helper)}} - {{unbound (capitalize name)}} - {{! You can use any helper, including unbound, in a nested expression }} - {{capitalize (unbound name)}} + {{link-to 'Great Hamster Photos' 'photoGallery'}} ``` - The `unbound` helper only accepts a single argument, and it return an - unbound value. + Both will result in: - @method unbound - @for Ember.Templates.helpers - @public - */ - - exports.default = function (vm, args) { - - return _emberGlimmerUtilsReferences.UnboundReference.create(args.positional.at(0).value()); - }; -}); -enifed('ember-glimmer/index', ['exports', 'ember-glimmer/helpers/action', 'ember-glimmer/templates/root', 'ember-glimmer/syntax', 'ember-glimmer/template', 'ember-glimmer/components/checkbox', 'ember-glimmer/components/text_field', 'ember-glimmer/components/text_area', 'ember-glimmer/components/link-to', 'ember-glimmer/component', 'ember-glimmer/helper', 'ember-glimmer/environment', 'ember-glimmer/make-bound-helper', 'ember-glimmer/utils/string', 'ember-glimmer/renderer', 'ember-glimmer/template_registry', 'ember-glimmer/setup-registry', 'ember-glimmer/dom'], function (exports, _emberGlimmerHelpersAction, _emberGlimmerTemplatesRoot, _emberGlimmerSyntax, _emberGlimmerTemplate, _emberGlimmerComponentsCheckbox, _emberGlimmerComponentsText_field, _emberGlimmerComponentsText_area, _emberGlimmerComponentsLinkTo, _emberGlimmerComponent, _emberGlimmerHelper, _emberGlimmerEnvironment, _emberGlimmerMakeBoundHelper, _emberGlimmerUtilsString, _emberGlimmerRenderer, _emberGlimmerTemplate_registry, _emberGlimmerSetupRegistry, _emberGlimmerDom) { - /** - [Glimmer](https://github.com/tildeio/glimmer) is a [Handlebars](http://handlebarsjs.com/) - compatible templating engine used by Ember.js. - Any valid Handlebars syntax is valid in an Ember template. + ```html + + Great Hamster Photos + + ``` - ### Showing a property + ### Supplying a tagName + By default `{{link-to}}` renders an `` element. This can + be overridden for a single use of `{{link-to}}` by supplying + a `tagName` option: - 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: + ```handlebars + {{#link-to 'photoGallery' tagName="li"}} + Great Hamster Photos + {{/link-to}} + ``` - ```javascript - // app/components/person.js - export default Ember.Component.extend({ - name: 'Jill' - }); + ```html +
  • + Great Hamster Photos +
  • ``` + To override this option for your entire application, see + "Overriding Application-wide Defaults". + + ### Disabling the `link-to` component + By default `{{link-to}}` is enabled. + any passed value to the `disabled` component property will disable + the `link-to` component. + + static use: the `disabled` option: + ```handlebars - {{! app/components/person.hbs }} - {{name}} -
    {{name}}
    - + {{#link-to 'photoGallery' disabled=true}} + Great Hamster Photos + {{/link-to}} ``` - Any time the "name" property on the component changes, the DOM will be - updated. - - Properties can be chained as well: + dynamic use: the `disabledWhen` option: ```handlebars - {{aUserModel.name}} -
    {{listOfUsers.firstObject.name}}
    + {{#link-to 'photoGallery' disabledWhen=controller.someProperty}} + Great Hamster Photos + {{/link-to}} ``` - ### Using Ember helpers + any passed value to `disabled` will disable it except `undefined`. + to ensure that only `true` disable the `link-to` component you can + override the global behaviour of `Ember.LinkComponent`. - When content is passed in mustaches `{{}}`, Ember will first try to find a helper - or component with that name. For example, the `if` helper: + ```javascript + Ember.LinkComponent.reopen({ + disabled: Ember.computed(function(key, value) { + if (value !== undefined) { + this.set('_isDisabled', value === true); + } + return value === true ? get(this, 'disabledClass') : false; + }) + }); + ``` + + see "Overriding Application-wide Defaults" for more. + + ### Handling `href` + `{{link-to}}` will use your application's Router to + fill the element's `href` property with a url that + matches the path to the supplied `routeName` for your + router's configured `Location` scheme, which defaults + to Ember.HashLocation. + + ### Handling current route + `{{link-to}}` will apply a CSS class name of 'active' + when the application's current route matches + the supplied routeName. For example, if the application's + current route is 'photoGallery.recent' the following + use of `{{link-to}}`: ```handlebars - {{if name "I have a name" "I have no name"}} - + {{#link-to 'photoGallery.recent'}} + Great Hamster Photos + {{/link-to}} ``` - 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: + will result in - ```handlebars - {{#if name}} - I have a name - {{else}} - I have no name - {{/if}} + ```html +
    + Great Hamster Photos + ``` - 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: + The CSS class name used for active classes can be customized + for a single use of `{{link-to}}` by passing an `activeClass` + option: ```handlebars - + {{#link-to 'photoGallery.recent' activeClass="current-url"}} + Great Hamster Photos + {{/link-to}} ``` - 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 + ```html + + Great Hamster Photos + + ``` - 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). + To override this option for your entire application, see + "Overriding Application-wide Defaults". - @module ember - @submodule ember-glimmer - @main ember-glimmer - @public - */ - - /** - 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 - `{{with}}` block. + ### Keeping a link active for other routes - If the aliased property is "falsey", for example: `false`, `undefined` `null`, `""`, `0`, NaN or - an empty array, the block will not be rendered. + If you need a link to be 'active' even when it doesn't match + the current route, you can use the `current-when` argument. ```handlebars - {{! Will only render if user.posts contains items}} - {{#with user.posts as |blogPosts|}} -
    - There are {{blogPosts.length}} blog posts written by {{user.name}}. -
    - {{#each blogPosts as |post|}} -
  • {{post.title}}
  • - {{/each}} - {{/with}} + {{#link-to 'photoGallery' current-when='photos'}} + Photo Gallery + {{/link-to}} ``` - Without the `as` operator, it would be impossible to reference `user.name` in the example above. + This may be helpful for keeping links active for: - NOTE: The alias should not reuse a name from the bound property path. + * non-nested routes that are logically related + * some secondary menu approaches + * 'top navigation' with 'sub navigation' scenarios - For example: `{{#with foo.bar as |foo|}}` is not supported because it attempts to alias using - the first part of the property path, `foo`. Instead, use `{{#with foo.bar as |baz|}}`. + A link will be active if `current-when` is `true` or the current + route is the route this link would transition to. - @method with - @for Ember.Templates.helpers - @param {Object} options - @return {String} HTML string - @public - */ - - /** - Execute the `debugger` statement in the current template's context. + To match multiple routes 'space-separate' the routes: ```handlebars - {{debugger}} + {{#link-to 'gallery' current-when='photos drawings paintings'}} + Art Gallery + {{/link-to}} ``` - When using the debugger helper you will have access to a `get` function. This - function retrieves values available in the context of the template. - For example, if you're wondering why a value `{{foo}}` isn't rendering as - expected within a template, you could place a `{{debugger}}` statement and, - when the `debugger;` breakpoint is hit, you can attempt to retrieve this value: + ### Supplying a model + An optional model argument can be used for routes whose + paths contain dynamic segments. This argument will become + the model context of the linked route: + ```javascript + Router.map(function() { + this.route("photoGallery", {path: "hamster-photos/:photo_id"}); + }); ``` - > get('foo') - ``` - - `get` is also aware of keywords. So in this situation ```handlebars - {{#each items as |item|}} - {{debugger}} - {{/each}} + {{#link-to 'photoGallery' aPhoto}} + {{aPhoto.title}} + {{/link-to}} ``` - You'll be able to get values from the current item: - - ``` - > get('item.name') + ```html + + Tomster + ``` - You can also access the context of the view to make sure it is the object that - you expect: + ### Supplying multiple models + For deep-linking to route paths that contain multiple + dynamic segments, multiple model arguments can be used. + As the router transitions through the route path, each + supplied model argument will become the context for the + route with the dynamic segments: + ```javascript + Router.map(function() { + this.route("photoGallery", { path: "hamster-photos/:photo_id" }, function() { + this.route("comment", {path: "comments/:comment_id"}); + }); + }); ``` - > context - ``` - - @method debugger - @for Ember.Templates.helpers - @public - */ - - /** - The `partial` helper renders another template without - changing the template context: + This argument will become the model context of the linked route: ```handlebars - {{foo}} - {{partial "nav"}} + {{#link-to 'photoGallery.comment' aPhoto comment}} + {{comment.body}} + {{/link-to}} ``` - The above example template will render a template named - "-nav", which has the same context as the parent template - it's rendered into, so if the "-nav" template also referenced - `{{foo}}`, it would print the same thing as the `{{foo}}` - in the above example. - - If a "-nav" template isn't found, the `partial` helper will - fall back to a template named "nav". + ```html + + A+++ would snuggle again. + + ``` - ### Bound template names + ### Supplying an explicit dynamic segment value + If you don't have a model object available to pass to `{{link-to}}`, + an optional string or integer argument can be passed for routes whose + paths contain dynamic segments. This argument will become the value + of the dynamic segment: - The parameter supplied to `partial` can also be a path - to a property containing a template name, e.g.: + ```javascript + Router.map(function() { + this.route("photoGallery", { path: "hamster-photos/:photo_id" }); + }); + ``` ```handlebars - {{partial someTemplateName}} + {{#link-to 'photoGallery' aPhotoId}} + {{aPhoto.title}} + {{/link-to}} ``` - The above example will look up the value of `someTemplateName` - on the template context (e.g. a controller) and use that - value as the name of the template to render. If the resolved - value is falsy, nothing will be rendered. If `someTemplateName` - changes, the partial will be re-rendered using the new template - name. + ```html + + Tomster + + ``` - @method partial - @for Ember.Templates.helpers - @param {String} partialName The name of the template to render minus the leading underscore. - @public - */ - - 'use strict'; - - exports.INVOKE = _emberGlimmerHelpersAction.INVOKE; - exports.RootTemplate = _emberGlimmerTemplatesRoot.default; - exports.registerSyntax = _emberGlimmerSyntax.registerSyntax; - exports.template = _emberGlimmerTemplate.default; - exports.Checkbox = _emberGlimmerComponentsCheckbox.default; - exports.TextField = _emberGlimmerComponentsText_field.default; - exports.TextArea = _emberGlimmerComponentsText_area.default; - exports.LinkComponent = _emberGlimmerComponentsLinkTo.default; - exports.Component = _emberGlimmerComponent.default; - exports.Helper = _emberGlimmerHelper.default; - exports.helper = _emberGlimmerHelper.helper; - exports.Environment = _emberGlimmerEnvironment.default; - exports.makeBoundHelper = _emberGlimmerMakeBoundHelper.default; - exports.SafeString = _emberGlimmerUtilsString.SafeString; - exports.escapeExpression = _emberGlimmerUtilsString.escapeExpression; - exports.htmlSafe = _emberGlimmerUtilsString.htmlSafe; - exports.isHTMLSafe = _emberGlimmerUtilsString.isHTMLSafe; - exports._getSafeString = _emberGlimmerUtilsString.getSafeString; - exports.Renderer = _emberGlimmerRenderer.Renderer; - exports.InertRenderer = _emberGlimmerRenderer.InertRenderer; - exports.InteractiveRenderer = _emberGlimmerRenderer.InteractiveRenderer; - exports.getTemplate = _emberGlimmerTemplate_registry.getTemplate; - exports.setTemplate = _emberGlimmerTemplate_registry.setTemplate; - exports.hasTemplate = _emberGlimmerTemplate_registry.hasTemplate; - exports.getTemplates = _emberGlimmerTemplate_registry.getTemplates; - exports.setTemplates = _emberGlimmerTemplate_registry.setTemplates; - exports.setupEngineRegistry = _emberGlimmerSetupRegistry.setupEngineRegistry; - exports.setupApplicationRegistry = _emberGlimmerSetupRegistry.setupApplicationRegistry; - exports.DOMChanges = _emberGlimmerDom.DOMChanges; - exports.NodeDOMTreeConstruction = _emberGlimmerDom.NodeDOMTreeConstruction; - exports.DOMTreeConstruction = _emberGlimmerDom.DOMTreeConstruction; -}); -enifed('ember-glimmer/make-bound-helper', ['exports', 'ember-metal', 'ember-glimmer/helper'], function (exports, _emberMetal, _emberGlimmerHelper) { - /** - @module ember - @submodule ember-glimmer - */ - 'use strict'; - - 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 - value and any changes to the bound property cause the helper function to be re-run with the updated - values. + When transitioning into the linked route, the `model` hook will + be triggered with parameters including this passed identifier. - * `params` - An array of resolved ordered parameters. - * `hash` - An object containing the hash parameters. + ### Allowing Default Action - For example: + By default the `{{link-to}}` component prevents the default browser action + by calling `preventDefault()` as this sort of action bubbling is normally + handled internally and we do not want to take the browser to a new URL (for + example). - * With an unquoted ordered parameter: + If you need to override this behavior specify `preventDefault=false` in + your template: - ```javascript - {{x-capitalize foo}} - ``` + ```handlebars + {{#link-to 'photoGallery' aPhotoId preventDefault=false}} + {{aPhotoId.title}} + {{/link-to}} + ``` - Assuming `foo` was set to `"bar"`, the bound helper would receive `["bar"]` as its first argument, and - an empty hash as its second. + ### Overriding attributes + You can override any given property of the `Ember.LinkComponent` + that is generated by the `{{link-to}}` component by passing + key/value pairs, like so: - * With a quoted ordered parameter: + ```handlebars + {{#link-to aPhoto tagName='li' title='Following this link will change your life' classNames='pic sweet'}} + Uh-mazing! + {{/link-to}} + ``` - ```javascript - {{x-capitalize "foo"}} - ``` + See [Ember.LinkComponent](/api/classes/Ember.LinkComponent.html) for a + complete list of overrideable properties. Be sure to also + check out inherited properties of `LinkComponent`. - The bound helper would receive `["foo"]` as its first argument, and an empty hash as its second. + ### Overriding Application-wide Defaults + ``{{link-to}}`` creates an instance of `Ember.LinkComponent` + for rendering. To override options for your entire + application, reopen `Ember.LinkComponent` and supply the + desired values: - * With an unquoted hash parameter: + ``` javascript + Ember.LinkComponent.reopen({ + activeClass: "is-active", + tagName: 'li' + }) + ``` - ```javascript - {{x-repeat "foo" count=repeatCount}} - ``` + It is also possible to override the default event in + this manner: - Assuming that `repeatCount` resolved to 2, the bound helper would receive `["foo"]` as its first argument, - and { count: 2 } as its second. + ``` javascript + Ember.LinkComponent.reopen({ + eventName: 'customEventName' + }); + ``` - @private - @method makeBoundHelper - @for Ember.HTMLBars - @param {Function} fn - @since 1.10.0 + @method link-to + @for Ember.Templates.helpers + @param {String} routeName + @param {Object} [context]* + @param [options] {Object} Handlebars key/value pairs of options, you can override any property of Ember.LinkComponent + @return {String} HTML string + @see {Ember.LinkComponent} + @public */ - function makeBoundHelper(fn) { - return _emberGlimmerHelper.helper(fn); - } -}); -enifed('ember-glimmer/modifiers/action', ['exports', 'ember-utils', 'ember-metal', 'ember-views', 'ember-glimmer/helpers/action'], function (exports, _emberUtils, _emberMetal, _emberViews, _emberGlimmerHelpersAction) { 'use strict'; - var MODIFIERS = ['alt', 'shift', 'meta', 'ctrl']; - var POINTER_EVENT_TYPE_REGEX = /^click|mouse|touch/; - - function isAllowedEvent(event, allowedKeys) { - if (allowedKeys === null || typeof allowedKeys === 'undefined') { - if (POINTER_EVENT_TYPE_REGEX.test(event.type)) { - return _emberViews.isSimpleClick(event); - } else { - allowedKeys = ''; - } - } - - if (allowedKeys.indexOf('any') >= 0) { - return true; - } - - for (var i = 0; i < MODIFIERS.length; i++) { - if (event[MODIFIERS[i] + 'Key'] && allowedKeys.indexOf(MODIFIERS[i]) === -1) { - return false; - } - } - - return true; - } + /** + `Ember.LinkComponent` renders an element whose `click` event triggers a + transition of the application's instance of `Ember.Router` to + a supplied route by name. + + `Ember.LinkComponent` components are invoked with {{#link-to}}. Properties + of this class can be overridden with `reopen` to customize application-wide + behavior. + + @class LinkComponent + @namespace Ember + @extends Ember.Component + @see {Ember.Templates.helpers.link-to} + @public + **/ + var LinkComponent = _emberGlimmerComponent.default.extend({ + layout: _emberGlimmerTemplatesLinkTo.default, - var ActionHelper = { - // registeredActions is re-exported for compatibility with older plugins - // that were using this undocumented API. - registeredActions: _emberViews.ActionManager.registeredActions, + tagName: 'a', - registerAction: function (actionState) { - var actionId = actionState.actionId; + /** + @deprecated Use current-when instead. + @property currentWhen + @private + */ + currentWhen: _emberRuntime.deprecatingAlias('current-when', { id: 'ember-routing-view.deprecated-current-when', until: '3.0.0' }), - var actions = _emberViews.ActionManager.registeredActions[actionId]; + /** + Used to determine when this `LinkComponent` is active. + @property currentWhen + @public + */ + 'current-when': null, - if (!actions) { - actions = _emberViews.ActionManager.registeredActions[actionId] = []; - } + /** + Sets the `title` attribute of the `LinkComponent`'s HTML element. + @property title + @default null + @public + **/ + title: null, - actions.push(actionState); + /** + Sets the `rel` attribute of the `LinkComponent`'s HTML element. + @property rel + @default null + @public + **/ + rel: null, - return actionId; - }, + /** + Sets the `tabindex` attribute of the `LinkComponent`'s HTML element. + @property tabindex + @default null + @public + **/ + tabindex: null, - unregisterAction: function (actionState) { - var actionId = actionState.actionId; - - var actions = _emberViews.ActionManager.registeredActions[actionId]; + /** + Sets the `target` attribute of the `LinkComponent`'s HTML element. + @since 1.8.0 + @property target + @default null + @public + **/ + target: null, - if (!actions) { - return; - } + /** + The CSS class to apply to `LinkComponent`'s element when its `active` + property is `true`. + @property activeClass + @type String + @default active + @public + **/ + activeClass: 'active', - var index = actions.indexOf(actionState); + /** + The CSS class to apply to `LinkComponent`'s element when its `loading` + property is `true`. + @property loadingClass + @type String + @default loading + @private + **/ + loadingClass: 'loading', - if (index !== -1) { - actions.splice(index, 1); - } + /** + The CSS class to apply to a `LinkComponent`'s element when its `disabled` + property is `true`. + @property disabledClass + @type String + @default disabled + @private + **/ + disabledClass: 'disabled', + _isDisabled: false, - if (actions.length === 0) { - delete _emberViews.ActionManager.registeredActions[actionId]; - } - } - }; + /** + Determines whether the `LinkComponent` will trigger routing via + the `replaceWith` routing strategy. + @property replace + @type Boolean + @default false + @public + **/ + replace: false, - exports.ActionHelper = ActionHelper; + /** + By default the `{{link-to}}` component 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'] + @public + */ + attributeBindings: ['href', 'title', 'rel', 'tabindex', 'target'], - var ActionState = (function () { - function ActionState(element, actionId, actionName, actionArgs, namedArgs, positionalArgs, implicitTarget, dom) { - this.element = element; - this.actionId = actionId; - this.actionName = actionName; - this.actionArgs = actionArgs; - this.namedArgs = namedArgs; - this.positional = positionalArgs; - this.implicitTarget = implicitTarget; - this.dom = dom; - this.eventName = this.getEventName(); - } + /** + By default the `{{link-to}}` component will bind to the `active`, `loading`, + and `disabled` classes. It is discouraged to override these directly. + @property classNameBindings + @type Array + @default ['active', 'loading', 'disabled', 'ember-transitioning-in', 'ember-transitioning-out'] + @public + */ + classNameBindings: ['active', 'loading', 'disabled', 'transitioningIn', 'transitioningOut'], - // implements ModifierManager + /** + By default the `{{link-to}}` component responds to the `click` event. You + can override this globally by setting this property to your custom + event name. + This is particularly useful on mobile when one wants to avoid the 300ms + click delay using some sort of custom `tap` event. + @property eventName + @type String + @default click + @private + */ + eventName: 'click', - ActionState.prototype.getEventName = function getEventName() { - return this.namedArgs.get('on').value() || 'click'; - }; + // this is doc'ed here so it shows up in the events + // section of the API documentation, which is where + // people will likely go looking for it. + /** + Triggers the `LinkComponent`'s routing behavior. If + `eventName` is changed to a value other than `click` + the routing behavior will trigger on that custom event + instead. + @event click + @private + */ - ActionState.prototype.getActionArgs = function getActionArgs() { - var result = new Array(this.actionArgs.length); + /** + An overridable method called when `LinkComponent` objects are instantiated. + Example: + ```javascript + App.MyLinkComponent = Ember.LinkComponent.extend({ + init: function() { + this._super(...arguments); + Ember.Logger.log('Event is ' + this.get('eventName')); + } + }); + ``` + NOTE: If you do override `init` for a framework class like `Ember.View`, + be sure to call `this._super(...arguments)` in your + `init` declaration! If you don't, Ember may not have an opportunity to + do important setup work, and you'll see strange behavior in your + application. + @method init + @private + */ + init: function () { + this._super.apply(this, arguments); - for (var i = 0; i < this.actionArgs.length; i++) { - result[i] = this.actionArgs[i].value(); - } + // Map desired event name to invoke function + var eventName = _emberMetal.get(this, 'eventName'); + this.on(eventName, this, this._invoke); + }, - return result; - }; + _routing: _emberRuntime.inject.service('-routing'), - ActionState.prototype.getTarget = function getTarget() { - var implicitTarget = this.implicitTarget; - var namedArgs = this.namedArgs; + /** + Accessed as a classname binding to apply the `LinkComponent`'s `disabledClass` + CSS `class` to the element when the link is disabled. + When `true` interactions with the element will not trigger route changes. + @property disabled + @private + */ + disabled: _emberMetal.computed({ + get: function (key, value) { + return false; + }, + set: function (key, value) { + if (value !== undefined) { + this.set('_isDisabled', value); + } - var target = undefined; + return value ? _emberMetal.get(this, 'disabledClass') : false; + } + }), - if (namedArgs.has('target')) { - target = namedArgs.get('target').value(); - } else { - target = implicitTarget.value(); + _computeActive: function (routerState) { + if (_emberMetal.get(this, 'loading')) { + return false; } - return target; - }; + var routing = _emberMetal.get(this, '_routing'); + var models = _emberMetal.get(this, 'models'); + var resolvedQueryParams = _emberMetal.get(this, 'resolvedQueryParams'); - ActionState.prototype.handler = function handler(event) { - var _this = this; + var currentWhen = _emberMetal.get(this, 'current-when'); + var isCurrentWhenSpecified = !!currentWhen; + currentWhen = currentWhen || _emberMetal.get(this, 'qualifiedRouteName'); + currentWhen = currentWhen.split(' '); - var actionName = this.actionName; - var namedArgs = this.namedArgs; + for (var i = 0; i < currentWhen.length; i++) { + if (routing.isActiveForRoute(models, resolvedQueryParams, currentWhen[i], routerState, isCurrentWhenSpecified)) { + return _emberMetal.get(this, 'activeClass'); + } + } - var bubbles = namedArgs.get('bubbles'); - var preventDefault = namedArgs.get('preventDefault'); - var allowedKeys = namedArgs.get('allowedKeys'); - var target = this.getTarget(); + return false; + }, - if (!isAllowedEvent(event, allowedKeys.value())) { - return true; + /** + Accessed as a classname binding to apply the `LinkComponent`'s `activeClass` + CSS `class` to the element when the link is active. + A `LinkComponent` is considered active when its `currentWhen` property is `true` + or the application's current route is the route the `LinkComponent` would trigger + transitions into. + The `currentWhen` property can match against multiple routes by separating + route names using the ` ` (space) character. + @property active + @private + */ + active: _emberMetal.computed('attrs.params', '_routing.currentState', function computeLinkToComponentActive() { + var currentState = _emberMetal.get(this, '_routing.currentState'); + if (!currentState) { + return false; } - if (preventDefault.value() !== false) { - event.preventDefault(); - } + return this._computeActive(currentState); + }), - if (bubbles.value() === false) { - event.stopPropagation(); + willBeActive: _emberMetal.computed('_routing.targetState', function computeLinkToComponentWillBeActive() { + var routing = _emberMetal.get(this, '_routing'); + var targetState = _emberMetal.get(routing, 'targetState'); + if (_emberMetal.get(routing, 'currentState') === targetState) { + return; } - _emberMetal.run(function () { - var args = _this.getActionArgs(); - var payload = { - args: args, - target: target - }; - if (typeof actionName[_emberGlimmerHelpersAction.INVOKE] === 'function') { - _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { - actionName[_emberGlimmerHelpersAction.INVOKE].apply(actionName, args); - }); - return; - } - if (typeof actionName === 'function') { - _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { - actionName.apply(target, args); - }); - return; - } - payload.name = actionName; - if (target.send) { - _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { - target.send.apply(target, [actionName].concat(args)); - }); - } else { - _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { - target[actionName].apply(target, args); - }); - } - }); - }; + return !!this._computeActive(targetState); + }), - ActionState.prototype.destroy = function destroy() { - ActionHelper.unregisterAction(this); - }; + transitioningIn: _emberMetal.computed('active', 'willBeActive', function computeLinkToComponentTransitioningIn() { + var willBeActive = _emberMetal.get(this, 'willBeActive'); + if (typeof willBeActive === 'undefined') { + return false; + } - return ActionState; - })(); + return !_emberMetal.get(this, 'active') && willBeActive && 'ember-transitioning-in'; + }), - exports.ActionState = ActionState; + transitioningOut: _emberMetal.computed('active', 'willBeActive', function computeLinkToComponentTransitioningOut() { + var willBeActive = _emberMetal.get(this, 'willBeActive'); + if (typeof willBeActive === 'undefined') { + return false; + } - var ActionModifierManager = (function () { - function ActionModifierManager() {} + return _emberMetal.get(this, 'active') && !willBeActive && 'ember-transitioning-out'; + }), - ActionModifierManager.prototype.create = function create(element, args, dynamicScope, dom) { - var named = args.named; - var positional = args.positional; + /** + Event handler that invokes the link, activating the associated route. + @method _invoke + @param {Event} event + @private + */ + _invoke: function (event) { + if (!_emberViews.isSimpleClick(event)) { + return true; + } - var implicitTarget = undefined; - var actionName = undefined; - var actionNameRef = undefined; - if (positional.length > 1) { - implicitTarget = positional.at(0); - actionNameRef = positional.at(1); + var preventDefault = _emberMetal.get(this, 'preventDefault'); + var targetAttribute = _emberMetal.get(this, 'target'); - if (actionNameRef[_emberGlimmerHelpersAction.INVOKE]) { - actionName = actionNameRef; - } else { - var actionLabel = actionNameRef._propertyKey; - actionName = actionNameRef.value(); + if (preventDefault !== false) { + if (!targetAttribute || targetAttribute === '_self') { + event.preventDefault(); } } - var actionArgs = []; - // The first two arguments are (1) `this` and (2) the action name. - // Everything else is a param. - for (var i = 2; i < positional.length; i++) { - actionArgs.push(positional.at(i)); + if (_emberMetal.get(this, 'bubbles') === false) { + event.stopPropagation(); } - var actionId = _emberUtils.uuid(); - return new ActionState(element, actionId, actionName, actionArgs, named, positional, implicitTarget, dom); - }; + if (_emberMetal.get(this, '_isDisabled')) { + return false; + } - ActionModifierManager.prototype.install = function install(actionState) { - var dom = actionState.dom; - var element = actionState.element; - var actionId = actionState.actionId; + if (_emberMetal.get(this, 'loading')) { + _emberConsole.default.warn('This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid.'); + return false; + } - ActionHelper.registerAction(actionState); + if (targetAttribute && targetAttribute !== '_self') { + return false; + } - dom.setAttribute(element, 'data-ember-action', ''); - dom.setAttribute(element, 'data-ember-action-' + actionId, actionId); - }; + var qualifiedRouteName = _emberMetal.get(this, 'qualifiedRouteName'); + var models = _emberMetal.get(this, 'models'); + var queryParams = _emberMetal.get(this, 'queryParams.values'); + var shouldReplace = _emberMetal.get(this, 'replace'); - ActionModifierManager.prototype.update = function update(actionState) { - var positional = actionState.positional; + var payload = { + queryParams: queryParams, + routeName: qualifiedRouteName + }; - var actionNameRef = positional.at(1); + _emberMetal.flaggedInstrument('interaction.link-to', payload, this._generateTransition(payload, qualifiedRouteName, models, queryParams, shouldReplace)); + }, - if (!actionNameRef[_emberGlimmerHelpersAction.INVOKE]) { - actionState.actionName = actionNameRef.value(); - } - actionState.eventName = actionState.getEventName(); + _generateTransition: function (payload, qualifiedRouteName, models, queryParams, shouldReplace) { + var routing = _emberMetal.get(this, '_routing'); + return function () { + payload.transition = routing.transitionTo(qualifiedRouteName, models, queryParams, shouldReplace); + }; + }, - // Not sure if this is needed? If we mutate the actionState is that good enough? - ActionHelper.unregisterAction(actionState); - ActionHelper.registerAction(actionState); - }; + queryParams: null, - ActionModifierManager.prototype.getDestructor = function getDestructor(modifier) { - return modifier; - }; + qualifiedRouteName: _emberMetal.computed('targetRouteName', '_routing.currentState', function computeLinkToComponentQualifiedRouteName() { + var params = _emberMetal.get(this, 'params').slice(); + var lastParam = params[params.length - 1]; + if (lastParam && lastParam.isQueryParams) { + params.pop(); + } + var onlyQueryParamsSupplied = this[_emberGlimmerComponent.HAS_BLOCK] ? params.length === 0 : params.length === 1; + if (onlyQueryParamsSupplied) { + return _emberMetal.get(this, '_routing.currentRouteName'); + } + return _emberMetal.get(this, 'targetRouteName'); + }), - return ActionModifierManager; - })(); + resolvedQueryParams: _emberMetal.computed('queryParams', function computeLinkToComponentResolvedQueryParams() { + var resolvedQueryParams = {}; + var queryParams = _emberMetal.get(this, 'queryParams'); - exports.default = ActionModifierManager; -}); -enifed('ember-glimmer/protocol-for-url', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { - /* globals module, URL */ + if (!queryParams) { + return resolvedQueryParams; + } - 'use strict'; + var values = queryParams.values; + for (var key in values) { + if (!values.hasOwnProperty(key)) { + continue; + } + resolvedQueryParams[key] = values[key]; + } - exports.default = installProtocolForURL; + return resolvedQueryParams; + }), - var nodeURL = undefined; - var parsingNode = undefined; + /** + Sets the element's `href` attribute to the url for + the `LinkComponent`'s targeted route. + If the `LinkComponent`'s `tagName` is changed to a value other + than `a`, this property will be ignored. + @property href + @private + */ + href: _emberMetal.computed('models', 'qualifiedRouteName', function computeLinkToComponentHref() { + if (_emberMetal.get(this, 'tagName') !== 'a') { + return; + } - function installProtocolForURL(environment) { - var protocol = undefined; + var qualifiedRouteName = _emberMetal.get(this, 'qualifiedRouteName'); + var models = _emberMetal.get(this, 'models'); - if (_emberEnvironment.environment.hasDOM) { - protocol = browserProtocolForURL.call(environment, 'foobar:baz'); - } + if (_emberMetal.get(this, 'loading')) { + return _emberMetal.get(this, 'loadingHref'); + } - // Test to see if our DOM implementation parses - // and normalizes URLs. - if (protocol === 'foobar:') { - // Swap in the method that doesn't do this test now that - // we know it works. - environment.protocolForURL = browserProtocolForURL; - } else if (typeof URL === 'object') { - // URL globally provided, likely from FastBoot's sandbox - nodeURL = URL; - environment.protocolForURL = nodeProtocolForURL; - } else if (typeof module === 'object' && typeof module.require === 'function') { - // Otherwise, we need to fall back to our own URL parsing. - // Global `require` is shadowed by Ember's loader so we have to use the fully - // qualified `module.require`. - nodeURL = module.require('url'); - environment.protocolForURL = nodeProtocolForURL; - } else { - throw new Error('Could not find valid URL parsing mechanism for URL Sanitization'); - } - } + var routing = _emberMetal.get(this, '_routing'); + var queryParams = _emberMetal.get(this, 'queryParams.values'); - function browserProtocolForURL(url) { - if (!parsingNode) { - parsingNode = document.createElement('a'); - } + return routing.generateURL(qualifiedRouteName, models, queryParams); + }), - parsingNode.href = url; - return parsingNode.protocol; - } + loading: _emberMetal.computed('_modelsAreLoaded', 'qualifiedRouteName', function computeLinkToComponentLoading() { + var qualifiedRouteName = _emberMetal.get(this, 'qualifiedRouteName'); + var modelsAreLoaded = _emberMetal.get(this, '_modelsAreLoaded'); - function nodeProtocolForURL(url) { - var protocol = null; - if (typeof url === 'string') { - protocol = nodeURL.parse(url).protocol; - } - return protocol === null ? ':' : protocol; - } -}); -enifed('ember-glimmer/renderer', ['exports', 'ember-glimmer/utils/references', 'ember-metal', 'glimmer-reference', 'ember-views', 'ember-glimmer/component', 'ember-glimmer/syntax/curly-component', 'ember-glimmer/syntax/outlet'], function (exports, _emberGlimmerUtilsReferences, _emberMetal, _glimmerReference, _emberViews, _emberGlimmerComponent, _emberGlimmerSyntaxCurlyComponent, _emberGlimmerSyntaxOutlet) { - 'use strict'; + if (!modelsAreLoaded || qualifiedRouteName == null) { + return _emberMetal.get(this, 'loadingClass'); + } + }), - var runInTransaction = undefined; + _modelsAreLoaded: _emberMetal.computed('models', function computeLinkToComponentModelsAreLoaded() { + var models = _emberMetal.get(this, 'models'); + for (var i = 0; i < models.length; i++) { + if (models[i] == null) { + return false; + } + } - if (false || true) { - runInTransaction = _emberMetal.runInTransaction; - } else { - runInTransaction = function (context, methodName) { - context[methodName](); - return false; - }; - } + return true; + }), - var backburner = _emberMetal.run.backburner; + _getModels: function (params) { + var modelCount = params.length - 1; + var models = new Array(modelCount); - var DynamicScope = (function () { - function DynamicScope(view, outletState, rootOutletState, targetObject) { - this.view = view; - this.outletState = outletState; - this.rootOutletState = rootOutletState; - } + for (var i = 0; i < modelCount; i++) { + var value = params[i + 1]; - DynamicScope.prototype.child = function child() { - return new DynamicScope(this.view, this.outletState, this.rootOutletState); - }; + while (_emberRuntime.ControllerMixin.detect(value)) { + value = value.get('model'); + } - DynamicScope.prototype.get = function get(key) { - return this.outletState; - }; - - DynamicScope.prototype.set = function set(key, value) { - this.outletState = value; - return value; - }; - - return DynamicScope; - })(); - - var RootState = (function () { - function RootState(root, env, template, self, parentElement, dynamicScope) { - var _this = this; - - this.id = _emberViews.getViewId(root); - this.env = env; - this.root = root; - this.result = undefined; - this.shouldReflush = false; - this.destroyed = false; - this._removing = false; - - var options = this.options = { - alwaysRevalidate: false - }; + models[i] = value; + } - this.render = function () { - var result = _this.result = template.render(self, parentElement, dynamicScope); + return models; + }, - // override .render function after initial render - _this.render = function () { - result.rerender(options); - }; - }; - } + /** + The default href value to use while a link-to is loading. + Only applies when tagName is 'a' + @property loadingHref + @type String + @default # + @private + */ + loadingHref: '#', - RootState.prototype.isFor = function isFor(possibleRoot) { - return this.root === possibleRoot; - }; + didReceiveAttrs: function () { + var queryParams = undefined; - RootState.prototype.destroy = function destroy() { - var result = this.result; - var env = this.env; + var params = _emberMetal.get(this, 'params'); - this.destroyed = true; + if (params) { + // Do not mutate params in place + params = params.slice(); + } - this.env = null; - this.root = null; - this.result = null; - this.render = null; + var disabledWhen = _emberMetal.get(this, 'disabledWhen'); + if (disabledWhen !== undefined) { + this.set('disabled', disabledWhen); + } - if (result) { - /* - Handles these scenarios: - * When roots are removed during standard rendering process, a transaction exists already - `.begin()` / `.commit()` are not needed. - * When roots are being destroyed manually (`component.append(); component.destroy() case), no - transaction exists already. - * When roots are being destroyed during `Renderer#destroy`, no transaction exists - */ - var needsTransaction = !env.inTransaction; + // Process the positional arguments, in order. + // 1. Inline link title comes first, if present. + if (!this[_emberGlimmerComponent.HAS_BLOCK]) { + this.set('linkTitle', params.shift()); + } - if (needsTransaction) { - env.begin(); - } + // 2. `targetRouteName` is now always at index 0. + this.set('targetRouteName', params[0]); - result.destroy(); + // 3. The last argument (if still remaining) is the `queryParams` object. + var lastParam = params[params.length - 1]; - if (needsTransaction) { - env.commit(); - } + if (lastParam && lastParam.isQueryParams) { + queryParams = params.pop(); + } else { + queryParams = { values: {} }; } - }; + this.set('queryParams', queryParams); - return RootState; - })(); + // 4. Any remaining indices (excepting `targetRouteName` at 0) are `models`. + if (params.length > 1) { + this.set('models', this._getModels(params)); + } else { + this.set('models', []); + } + } + }); - var renderers = []; + LinkComponent.toString = function () { + return 'LinkComponent'; + }; - _emberMetal.setHasViews(function () { - return renderers.length > 0; + LinkComponent.reopenClass({ + positionalParams: 'params' }); - function register(renderer) { - renderers.push(renderer); - } - - function deregister(renderer) { - var index = renderers.indexOf(renderer); + exports.default = LinkComponent; +}); - renderers.splice(index, 1); - } +/* + * Unfortunately, to get decent error messages, we need to do this. + * In some future state we should be able to use a "feature flag" + * which allows us to strip this without needing to call it twice. + * + * if (isDebugBuild()) { + * // Do the useful debug thing, probably including try/catch. + * } else { + * // Do the performant thing. + * } + */ +enifed('ember-glimmer/components/text_area', ['exports', 'ember-glimmer/component', 'ember-views', 'ember-glimmer/templates/empty'], function (exports, _emberGlimmerComponent, _emberViews, _emberGlimmerTemplatesEmpty) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; - function loopBegin() { - for (var i = 0; i < renderers.length; i++) { - renderers[i]._scheduleRevalidate(); - } - } + /** + `{{textarea}}` inserts a new instance of ` + ``` + + Bound: + + In the following example, the `writtenWords` property on `App.ApplicationController` + will be updated live as the user types 'Lots of text that IS bound' into + the text area of their browser's window. + + ```javascript + App.ApplicationController = Ember.Controller.extend({ + writtenWords: "Lots of text that IS bound" + }); + ``` + + ```handlebars + {{textarea value=writtenWords}} + ``` + + Would result in the following HTML: + + ```html + + ``` + + If you wanted a one way binding between the text area and a div tag + somewhere else on your screen, you could use `Ember.computed.oneWay`: + + ```javascript + App.ApplicationController = Ember.Controller.extend({ + writtenWords: "Lots of text that IS bound", + outputWrittenWords: Ember.computed.oneWay("writtenWords") + }); + ``` + + ```handlebars + {{textarea value=writtenWords}} +
    + {{outputWrittenWords}} +
    + ``` + + Would result in the following HTML: + + ```html + + <-- the following div will be updated in real time as you type --> +
    + Lots of text that IS bound +
    + ``` + + Finally, this example really shows the power and ease of Ember when two + properties are bound to eachother via `Ember.computed.alias`. Type into + either text area box and they'll both stay in sync. Note that + `Ember.computed.alias` costs more in terms of performance, so only use it when + your really binding in both directions: + + ```javascript + App.ApplicationController = Ember.Controller.extend({ + writtenWords: "Lots of text that IS bound", + twoWayWrittenWords: Ember.computed.alias("writtenWords") + }); + ``` + + ```handlebars + {{textarea value=writtenWords}} + {{textarea value=twoWayWrittenWords}} + ``` + + ```html + + <-- both updated in real time --> + + ``` + + ### Actions + + The helper can send multiple actions based on user events. + The action property defines the action which is send when + the user presses the return key. + + ```handlebars + {{input action="submit"}} + ``` + + The helper allows some user events to send actions. + + * `enter` + * `insert-newline` + * `escape-press` + * `focus-in` + * `focus-out` + * `key-press` + + For example, if you desire an action to be sent when the input is blurred, + you only need to setup the action name to the event name property. + + ```handlebars + {{textarea focus-in="alertMessage"}} + ``` + + See more about [Text Support Actions](/api/classes/Ember.TextArea.html) + + ### Extension + + Internally, `{{textarea}}` creates an instance of `Ember.TextArea`, passing + arguments from the helper to `Ember.TextArea`'s `create` method. You can + extend the capabilities of text areas in your application by reopening this + class. For example, if you are building a Bootstrap project where `data-*` + attributes are used, you can globally add support for a `data-*` attribute + on all `{{textarea}}`s' in your app by reopening `Ember.TextArea` or + `Ember.TextSupport` and adding it to the `attributeBindings` concatenated + property: + + ```javascript + Ember.TextArea.reopen({ + attributeBindings: ['data-error'] + }); + ``` + + Keep in mind when writing `Ember.TextArea` subclasses that `Ember.TextArea` + itself extends `Ember.Component`. Expect isolated component semantics, not + legacy 1.x view semantics (like `controller` being present). + + See more about [Ember components](/api/classes/Ember.Component.html) + + @method textarea + @for Ember.Templates.helpers + @param {Hash} options + @public + */ - function K() {} + /** + The internal class used to create textarea element when the `{{textarea}}` + helper is used. + + See [Ember.Templates.helpers.textarea](/api/classes/Ember.Templates.helpers.html#method_textarea) for usage details. + + ## Layout and LayoutName properties + + Because HTML `textarea` elements do not contain inner HTML the `layout` and + `layoutName` properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s + layout section for more information. + + @class TextArea + @namespace Ember + @extends Ember.Component + @uses Ember.TextSupport + @public + */ + exports.default = _emberGlimmerComponent.default.extend(_emberViews.TextSupport, { + classNames: ['ember-text-area'], - var loops = 0; - function loopEnd(current, next) { - for (var i = 0; i < renderers.length; i++) { - if (!renderers[i]._isValid()) { - if (loops > 10) { - loops = 0; - // TODO: do something better - renderers[i].destroy(); - throw new Error('infinite rendering invalidation detected'); - } - loops++; - return backburner.join(null, K); - } - } - loops = 0; - } + layout: _emberGlimmerTemplatesEmpty.default, - backburner.on('begin', loopBegin); - backburner.on('end', loopEnd); + tagName: 'textarea', + attributeBindings: ['rows', 'cols', 'name', 'selectionEnd', 'selectionStart', 'wrap', 'lang', 'dir', 'value'], + rows: null, + cols: null + }); +}); +enifed('ember-glimmer/components/text_field', ['exports', 'ember-utils', 'ember-metal', 'ember-environment', 'ember-glimmer/component', 'ember-glimmer/templates/empty', 'ember-views'], function (exports, _emberUtils, _emberMetal, _emberEnvironment, _emberGlimmerComponent, _emberGlimmerTemplatesEmpty, _emberViews) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; - var Renderer = (function () { - function Renderer(env, rootTemplate) { - var _viewRegistry = arguments.length <= 2 || arguments[2] === undefined ? _emberViews.fallbackViewRegistry : arguments[2]; + var inputTypeTestElement = undefined; + var inputTypes = new _emberUtils.EmptyObject(); + function canSetTypeOfInput(type) { + if (type in inputTypes) { + return inputTypes[type]; + } - var destinedForDOM = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3]; + // if running in outside of a browser always return the + // original type + if (!_emberEnvironment.environment.hasDOM) { + inputTypes[type] = type; - this._env = env; - this._rootTemplate = rootTemplate; - this._viewRegistry = _viewRegistry; - this._destinedForDOM = destinedForDOM; - this._destroyed = false; - this._roots = []; - this._lastRevision = null; - this._isRenderingRoots = false; - this._removedRoots = []; + return type; } - // renderer HOOKS + if (!inputTypeTestElement) { + inputTypeTestElement = document.createElement('input'); + } - Renderer.prototype.appendOutletView = function appendOutletView(view, target) { - var definition = new _emberGlimmerSyntaxOutlet.TopLevelOutletComponentDefinition(view); - var outletStateReference = view.toReference(); - var targetObject = view.outletState.render.controller; + try { + inputTypeTestElement.type = type; + } catch (e) { + // ignored + } - this._appendDefinition(view, definition, target, outletStateReference, targetObject); - }; + return inputTypes[type] = inputTypeTestElement.type === type; + } - Renderer.prototype.appendTo = function appendTo(view, target) { - var rootDef = new _emberGlimmerSyntaxCurlyComponent.RootComponentDefinition(view); + /** + + The internal class used to create text inputs when the `{{input}}` + helper is used with `type` of `text`. + + See [Ember.Templates.helpers.input](/api/classes/Ember.Templates.helpers.html#method_input) for usage details. + + ## Layout and LayoutName properties + + Because HTML `input` elements are self closing `layout` and `layoutName` + properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s + layout section for more information. + + @class TextField + @namespace Ember + @extends Ember.Component + @uses Ember.TextSupport + @public + */ + exports.default = _emberGlimmerComponent.default.extend(_emberViews.TextSupport, { + layout: _emberGlimmerTemplatesEmpty.default, + classNames: ['ember-text-field'], + tagName: 'input', + attributeBindings: ['accept', 'autocomplete', 'autosave', 'dir', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget', 'height', 'inputmode', 'lang', 'list', 'max', 'min', 'multiple', 'name', 'pattern', 'size', 'step', 'type', 'value', 'width'], - this._appendDefinition(view, rootDef, target); - }; + /** + The `value` attribute of the input element. As the user inputs text, this + property is updated live. + @property value + @type String + @default "" + @public + */ + value: '', - Renderer.prototype._appendDefinition = function _appendDefinition(root, definition, target) { - var outletStateReference = arguments.length <= 3 || arguments[3] === undefined ? _glimmerReference.UNDEFINED_REFERENCE : arguments[3]; - var targetObject = arguments.length <= 4 || arguments[4] === undefined ? null : arguments[4]; + /** + The `type` attribute of the input element. + @property type + @type String + @default "text" + @public + */ + type: _emberMetal.computed({ + get: function () { + return 'text'; + }, - var self = new _emberGlimmerUtilsReferences.RootReference(definition); - var dynamicScope = new DynamicScope(null, outletStateReference, outletStateReference, true, targetObject); - var rootState = new RootState(root, this._env, this._rootTemplate, self, target, dynamicScope); + set: function (key, value) { + var type = 'text'; - this._renderRoot(rootState); - }; + if (canSetTypeOfInput(value)) { + type = value; + } - Renderer.prototype.rerender = function rerender(view) { - this._scheduleRevalidate(); - }; + return type; + } + }), - Renderer.prototype.register = function register(view) { - var id = _emberViews.getViewId(view); + /** + The `size` of the text field in characters. + @property size + @type String + @default null + @public + */ + size: null, - this._viewRegistry[id] = view; - }; + /** + The `pattern` attribute of input element. + @property pattern + @type String + @default null + @public + */ + pattern: null, - Renderer.prototype.unregister = function unregister(view) { - delete this._viewRegistry[_emberViews.getViewId(view)]; - }; - - Renderer.prototype.remove = function remove(view) { - view._transitionTo('destroying'); - - this.cleanupRootFor(view); - - _emberViews.setViewElement(view, null); - - if (this._destinedForDOM) { - view.trigger('didDestroyElement'); - } - - if (!view.isDestroying) { - view.destroy(); - } - }; - - Renderer.prototype.cleanupRootFor = function cleanupRootFor(view) { - // no need to cleanup roots if we have already been destroyed - if (this._destroyed) { - return; - } - - var roots = this._roots; - - // traverse in reverse so we can remove items - // without mucking up the index - var i = this._roots.length; - while (i--) { - var root = roots[i]; - if (root.isFor(view)) { - root.destroy(); - } - } - }; - - Renderer.prototype.destroy = function destroy() { - if (this._destroyed) { - return; - } - this._destroyed = true; - this._clearAllRoots(); - }; - - Renderer.prototype.getElement = function getElement(view) { - // overriden in the subclasses - }; + /** + The `min` attribute of input element used with `type="number"` or `type="range"`. + @property min + @type String + @default null + @since 1.4.0 + @public + */ + min: null, - Renderer.prototype.getBounds = function getBounds(view) { - var bounds = view[_emberGlimmerComponent.BOUNDS]; + /** + The `max` attribute of input element used with `type="number"` or `type="range"`. + @property max + @type String + @default null + @since 1.4.0 + @public + */ + max: null + }); +}); +enifed('ember-glimmer/dom', ['exports', '@glimmer/runtime', '@glimmer/node'], function (exports, _glimmerRuntime, _glimmerNode) { + 'use strict'; - var parentElement = bounds.parentElement(); - var firstNode = bounds.firstNode(); - var lastNode = bounds.lastNode(); + exports.DOMChanges = _glimmerRuntime.DOMChanges; + exports.DOMTreeConstruction = _glimmerRuntime.DOMTreeConstruction; + exports.NodeDOMTreeConstruction = _glimmerNode.NodeDOMTreeConstruction; +}); +enifed('ember-glimmer/environment', ['exports', 'ember-utils', 'ember-metal', 'ember-views', '@glimmer/runtime', 'ember-glimmer/syntax/curly-component', 'ember-glimmer/syntax', 'ember-glimmer/utils/iterable', 'ember-glimmer/utils/references', 'ember-glimmer/utils/debug-stack', 'ember-glimmer/helpers/if-unless', 'ember-glimmer/helpers/action', 'ember-glimmer/helpers/component', 'ember-glimmer/helpers/concat', 'ember-glimmer/helpers/get', 'ember-glimmer/helpers/hash', 'ember-glimmer/helpers/loc', 'ember-glimmer/helpers/log', 'ember-glimmer/helpers/mut', 'ember-glimmer/helpers/readonly', 'ember-glimmer/helpers/unbound', 'ember-glimmer/helpers/-class', 'ember-glimmer/helpers/-input-type', 'ember-glimmer/helpers/query-param', 'ember-glimmer/helpers/each-in', 'ember-glimmer/helpers/-normalize-class', 'ember-glimmer/helpers/-html-safe', 'ember-glimmer/protocol-for-url', 'container', 'ember-glimmer/modifiers/action'], function (exports, _emberUtils, _emberMetal, _emberViews, _glimmerRuntime, _emberGlimmerSyntaxCurlyComponent, _emberGlimmerSyntax, _emberGlimmerUtilsIterable, _emberGlimmerUtilsReferences, _emberGlimmerUtilsDebugStack, _emberGlimmerHelpersIfUnless, _emberGlimmerHelpersAction, _emberGlimmerHelpersComponent, _emberGlimmerHelpersConcat, _emberGlimmerHelpersGet, _emberGlimmerHelpersHash, _emberGlimmerHelpersLoc, _emberGlimmerHelpersLog, _emberGlimmerHelpersMut, _emberGlimmerHelpersReadonly, _emberGlimmerHelpersUnbound, _emberGlimmerHelpersClass, _emberGlimmerHelpersInputType, _emberGlimmerHelpersQueryParam, _emberGlimmerHelpersEachIn, _emberGlimmerHelpersNormalizeClass, _emberGlimmerHelpersHtmlSafe, _emberGlimmerProtocolForUrl, _container, _emberGlimmerModifiersAction) { + 'use strict'; - return { parentElement: parentElement, firstNode: firstNode, lastNode: lastNode }; - }; + var Environment = (function (_GlimmerEnvironment) { + babelHelpers.inherits(Environment, _GlimmerEnvironment); - Renderer.prototype.createElement = function createElement(tagName) { - return this._env.getAppendOperations().createElement(tagName); + Environment.create = function create(options) { + return new Environment(options); }; - Renderer.prototype._renderRoot = function _renderRoot(root) { - var roots = this._roots; - - roots.push(root); + function Environment(_ref) { + var _this = this; - if (roots.length === 1) { - register(this); - } + var owner = _ref[_emberUtils.OWNER]; - this._renderRootsTransaction(); - }; + _GlimmerEnvironment.apply(this, arguments); + this.owner = owner; + this.isInteractive = owner.lookup('-environment:main').isInteractive; - Renderer.prototype._renderRoots = function _renderRoots() { - var roots = this._roots; - var env = this._env; - var removedRoots = this._removedRoots; + // can be removed once https://github.com/tildeio/glimmer/pull/305 lands + this.destroyedComponents = undefined; - var globalShouldReflush = undefined, - initialRootsLength = undefined; + _emberGlimmerProtocolForUrl.default(this); - do { - env.begin(); + this._definitionCache = new _emberMetal.Cache(2000, function (_ref2) { + var name = _ref2.name; + var source = _ref2.source; + var owner = _ref2.owner; - // ensure that for the first iteration of the loop - // each root is processed - initialRootsLength = roots.length; - globalShouldReflush = false; + var _lookupComponent = _emberViews.lookupComponent(owner, name, { source: source }); - for (var i = 0; i < roots.length; i++) { - var root = roots[i]; + var componentFactory = _lookupComponent.component; + var layout = _lookupComponent.layout; - if (root.destroyed) { - // add to the list of roots to be removed - // they will be removed from `this._roots` later - removedRoots.push(root); + if (componentFactory || layout) { + return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentDefinition(name, componentFactory, layout); + } + }, function (_ref3) { + var name = _ref3.name; + var source = _ref3.source; + var owner = _ref3.owner; - // skip over roots that have been marked as destroyed - continue; - } + var expandedName = source && owner._resolveLocalLookupName(name, source) || name; + var ownerGuid = _emberUtils.guidFor(owner); - var shouldReflush = root.shouldReflush; + return ownerGuid + '|' + expandedName; + }); - // when processing non-initial reflush loops, - // do not process more roots than needed - if (i >= initialRootsLength && !shouldReflush) { - continue; - } + this._templateCache = new _emberMetal.Cache(1000, function (_ref4) { + var Template = _ref4.Template; + var owner = _ref4.owner; - root.options.alwaysRevalidate = shouldReflush; - // track shouldReflush based on this roots render result - shouldReflush = root.shouldReflush = runInTransaction(root, 'render'); + if (Template.create) { + var _Template$create; - // globalShouldReflush should be `true` if *any* of - // the roots need to reflush - globalShouldReflush = globalShouldReflush || shouldReflush; + // we received a factory + return Template.create((_Template$create = { env: _this }, _Template$create[_emberUtils.OWNER] = owner, _Template$create)); + } else { + // we were provided an instance already + return Template; } + }, function (_ref5) { + var Template = _ref5.Template; + var owner = _ref5.owner; + return _emberUtils.guidFor(owner) + '|' + Template.id; + }); - this._lastRevision = _glimmerReference.CURRENT_TAG.value(); - - env.commit(); - } while (globalShouldReflush || roots.length > initialRootsLength); + this._compilerCache = new _emberMetal.Cache(10, function (Compiler) { + return new _emberMetal.Cache(2000, function (template) { + var compilable = new Compiler(template); + return _glimmerRuntime.compileLayout(compilable, _this); + }, function (template) { + var owner = template.meta.owner; + return _emberUtils.guidFor(owner) + '|' + template.id; + }); + }, function (Compiler) { + return Compiler.id; + }); - // remove any roots that were destroyed during this transaction - while (removedRoots.length) { - var root = removedRoots.pop(); + this.builtInModifiers = { + action: new _emberGlimmerModifiersAction.default() + }; - var rootIndex = roots.indexOf(root); - roots.splice(rootIndex, 1); - } + this.builtInHelpers = { + if: _emberGlimmerHelpersIfUnless.inlineIf, + action: _emberGlimmerHelpersAction.default, + component: _emberGlimmerHelpersComponent.default, + concat: _emberGlimmerHelpersConcat.default, + get: _emberGlimmerHelpersGet.default, + hash: _emberGlimmerHelpersHash.default, + loc: _emberGlimmerHelpersLoc.default, + log: _emberGlimmerHelpersLog.default, + mut: _emberGlimmerHelpersMut.default, + 'query-params': _emberGlimmerHelpersQueryParam.default, + readonly: _emberGlimmerHelpersReadonly.default, + unbound: _emberGlimmerHelpersUnbound.default, + unless: _emberGlimmerHelpersIfUnless.inlineUnless, + '-class': _emberGlimmerHelpersClass.default, + '-each-in': _emberGlimmerHelpersEachIn.default, + '-input-type': _emberGlimmerHelpersInputType.default, + '-normalize-class': _emberGlimmerHelpersNormalizeClass.default, + '-html-safe': _emberGlimmerHelpersHtmlSafe.default, + '-get-dynamic-var': _glimmerRuntime.getDynamicVar + }; + } - if (this._roots.length === 0) { - deregister(this); - } + Environment.prototype.macros = function macros() { + var macros = _GlimmerEnvironment.prototype.macros.call(this); + _emberGlimmerSyntax.populateMacros(macros.blocks, macros.inlines); + return macros; }; - Renderer.prototype._renderRootsTransaction = function _renderRootsTransaction() { - if (this._isRenderingRoots) { - // currently rendering roots, a new root was added and will - // be processed by the existing _renderRoots invocation - return; - } + Environment.prototype.hasComponentDefinition = function hasComponentDefinition() { + return false; + }; - // used to prevent calling _renderRoots again (see above) - // while we are actively rendering roots - this._isRenderingRoots = true; + Environment.prototype.getComponentDefinition = function getComponentDefinition(path, symbolTable) { + var name = path[0]; + var blockMeta = symbolTable.getMeta(); + var owner = blockMeta.owner; + var source = blockMeta.moduleName && 'template:' + blockMeta.moduleName; - var completedWithoutError = false; - try { - this._renderRoots(); - completedWithoutError = true; - } finally { - if (!completedWithoutError) { - this._lastRevision = _glimmerReference.CURRENT_TAG.value(); - } - this._isRenderingRoots = false; - } + return this._definitionCache.get({ name: name, source: source, owner: owner }); }; - Renderer.prototype._clearAllRoots = function _clearAllRoots() { - var roots = this._roots; - for (var i = 0; i < roots.length; i++) { - var root = roots[i]; - root.destroy(); - } - - this._removedRoots.length = 0; - this._roots = null; + // normally templates should be exported at the proper module name + // and cached in the container, but this cache supports templates + // that have been set directly on the component's layout property - // if roots were present before destroying - // deregister this renderer instance - if (roots.length) { - deregister(this); - } + Environment.prototype.getTemplate = function getTemplate(Template, owner) { + return this._templateCache.get({ Template: Template, owner: owner }); }; - Renderer.prototype._scheduleRevalidate = function _scheduleRevalidate() { - backburner.scheduleOnce('render', this, this._revalidate); - }; + // a Compiler can wrap the template so it needs its own cache - Renderer.prototype._isValid = function _isValid() { - return this._destroyed || this._roots.length === 0 || _glimmerReference.CURRENT_TAG.validate(this._lastRevision); + Environment.prototype.getCompiledBlock = function getCompiledBlock(Compiler, template) { + var compilerCache = this._compilerCache.get(Compiler); + return compilerCache.get(template); }; - Renderer.prototype._revalidate = function _revalidate() { - if (this._isValid()) { - return; - } - this._renderRootsTransaction(); - }; + Environment.prototype.hasPartial = function hasPartial(name, symbolTable) { + var _symbolTable$getMeta = symbolTable.getMeta(); - return Renderer; - })(); + var owner = _symbolTable$getMeta.owner; - var InertRenderer = (function (_Renderer) { - babelHelpers.inherits(InertRenderer, _Renderer); + return _emberViews.hasPartial(name, owner); + }; - function InertRenderer() { - _Renderer.apply(this, arguments); - } + Environment.prototype.lookupPartial = function lookupPartial(name, symbolTable) { + var _symbolTable$getMeta2 = symbolTable.getMeta(); - InertRenderer.create = function create(_ref) { - var env = _ref.env; - var rootTemplate = _ref.rootTemplate; - var _viewRegistry = _ref._viewRegistry; + var owner = _symbolTable$getMeta2.owner; - return new this(env, rootTemplate, _viewRegistry, false); - }; + var partial = { + template: _emberViews.lookupPartial(name, owner) + }; - InertRenderer.prototype.getElement = function getElement(view) { - throw new Error('Accessing `this.element` is not allowed in non-interactive environments (such as FastBoot).'); + if (partial.template) { + return partial; + } else { + throw new Error(name + ' is not a partial'); + } }; - return InertRenderer; - })(Renderer); - - exports.InertRenderer = InertRenderer; + Environment.prototype.hasHelper = function hasHelper(nameParts, symbolTable) { - var InteractiveRenderer = (function (_Renderer2) { - babelHelpers.inherits(InteractiveRenderer, _Renderer2); + // helpers are not allowed to include a dot in their invocation + if (nameParts.length > 1) { + return false; + } - function InteractiveRenderer() { - _Renderer2.apply(this, arguments); - } + var name = nameParts[0]; - InteractiveRenderer.create = function create(_ref2) { - var env = _ref2.env; - var rootTemplate = _ref2.rootTemplate; - var _viewRegistry = _ref2._viewRegistry; + if (this.builtInHelpers[name]) { + return true; + } - return new this(env, rootTemplate, _viewRegistry, true); - }; + var blockMeta = symbolTable.getMeta(); + var owner = blockMeta.owner; + var options = { source: 'template:' + blockMeta.moduleName }; - InteractiveRenderer.prototype.getElement = function getElement(view) { - return _emberViews.getViewElement(view); + return owner.hasRegistration('helper:' + name, options) || owner.hasRegistration('helper:' + name); }; - return InteractiveRenderer; - })(Renderer); + Environment.prototype.lookupHelper = function lookupHelper(nameParts, symbolTable) { - exports.InteractiveRenderer = InteractiveRenderer; -}); -enifed('ember-glimmer/setup-registry', ['exports', 'ember-environment', 'container', 'ember-glimmer/renderer', 'ember-glimmer/dom', 'ember-glimmer/views/outlet', 'ember-glimmer/components/text_field', 'ember-glimmer/components/text_area', 'ember-glimmer/components/checkbox', 'ember-glimmer/components/link-to', 'ember-glimmer/component', 'ember-glimmer/templates/component', 'ember-glimmer/templates/root', 'ember-glimmer/templates/outlet', 'ember-glimmer/environment'], function (exports, _emberEnvironment, _container, _emberGlimmerRenderer, _emberGlimmerDom, _emberGlimmerViewsOutlet, _emberGlimmerComponentsText_field, _emberGlimmerComponentsText_area, _emberGlimmerComponentsCheckbox, _emberGlimmerComponentsLinkTo, _emberGlimmerComponent, _emberGlimmerTemplatesComponent, _emberGlimmerTemplatesRoot, _emberGlimmerTemplatesOutlet, _emberGlimmerEnvironment) { - 'use strict'; + var name = nameParts[0]; + var helper = this.builtInHelpers[name]; - exports.setupApplicationRegistry = setupApplicationRegistry; - exports.setupEngineRegistry = setupEngineRegistry; + if (helper) { + return helper; + } - var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['template:-root'], ['template:-root']), - _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['template:components/-default'], ['template:components/-default']), - _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['component:-default'], ['component:-default']); + var blockMeta = symbolTable.getMeta(); + var owner = blockMeta.owner; + var options = blockMeta.moduleName && { source: 'template:' + blockMeta.moduleName } || {}; - function setupApplicationRegistry(registry) { - registry.injection('service:-glimmer-environment', 'appendOperations', 'service:-dom-tree-construction'); - registry.injection('renderer', 'env', 'service:-glimmer-environment'); + if (true) { + var _ret = (function () { + var helperFactory = owner[_container.FACTORY_FOR]('helper:' + name, options) || owner[_container.FACTORY_FOR]('helper:' + name); - registry.register(_container.privatize(_templateObject), _emberGlimmerTemplatesRoot.default); - registry.injection('renderer', 'rootTemplate', _container.privatize(_templateObject)); + // TODO: try to unify this into a consistent protocol to avoid wasteful closure allocations + if (helperFactory.class.isHelperInstance) { + return { + v: function (vm, args) { + return _emberGlimmerUtilsReferences.SimpleHelperReference.create(helperFactory.class.compute, args); + } + }; + } else if (helperFactory.class.isHelperFactory) { + if (!_emberMetal.isFeatureEnabled('ember-no-double-extend')) { + helperFactory = helperFactory.create(); + } + return { + v: function (vm, args) { + return _emberGlimmerUtilsReferences.ClassBasedHelperReference.create(helperFactory, vm, args); + } + }; + } else { + throw new Error(nameParts + ' is not a helper'); + } + })(); - registry.register('renderer:-dom', _emberGlimmerRenderer.InteractiveRenderer); - registry.register('renderer:-inert', _emberGlimmerRenderer.InertRenderer); + if (typeof _ret === 'object') return _ret.v; + } else { + var _ret2 = (function () { + var helperFactory = owner.lookup('helper:' + name, options) || owner.lookup('helper:' + name); - if (_emberEnvironment.environment.hasDOM) { - registry.injection('service:-glimmer-environment', 'updateOperations', 'service:-dom-changes'); - } + // TODO: try to unify this into a consistent protocol to avoid wasteful closure allocations + if (helperFactory.isHelperInstance) { + return { + v: function (vm, args) { + return _emberGlimmerUtilsReferences.SimpleHelperReference.create(helperFactory.compute, args); + } + }; + } else if (helperFactory.isHelperFactory) { + return { + v: function (vm, args) { + return _emberGlimmerUtilsReferences.ClassBasedHelperReference.create(helperFactory, vm, args); + } + }; + } else { + throw new Error(nameParts + ' is not a helper'); + } + })(); - registry.register('service:-dom-changes', { - create: function (_ref) { - var document = _ref.document; - return new _emberGlimmerDom.DOMChanges(document); + if (typeof _ret2 === 'object') return _ret2.v; } - }); + }; - registry.register('service:-dom-tree-construction', { - create: function (_ref2) { - var document = _ref2.document; + Environment.prototype.hasModifier = function hasModifier(nameParts) { - var Implementation = _emberEnvironment.environment.hasDOM ? _emberGlimmerDom.DOMTreeConstruction : _emberGlimmerDom.NodeDOMTreeConstruction; - return new Implementation(document); + // modifiers are not allowed to include a dot in their invocation + if (nameParts.length > 1) { + return false; } - }); - } - - function setupEngineRegistry(registry) { - registry.register('view:-outlet', _emberGlimmerViewsOutlet.default); - registry.register('template:-outlet', _emberGlimmerTemplatesOutlet.default); - registry.injection('view:-outlet', 'template', 'template:-outlet'); - - registry.injection('service:-dom-changes', 'document', 'service:-document'); - registry.injection('service:-dom-tree-construction', 'document', 'service:-document'); - registry.register(_container.privatize(_templateObject2), _emberGlimmerTemplatesComponent.default); - - registry.register('service:-glimmer-environment', _emberGlimmerEnvironment.default); - registry.injection('template', 'env', 'service:-glimmer-environment'); + return !!this.builtInModifiers[nameParts[0]]; + }; - registry.optionsForType('helper', { instantiate: false }); + Environment.prototype.lookupModifier = function lookupModifier(nameParts) { - registry.register('component:-text-field', _emberGlimmerComponentsText_field.default); - registry.register('component:-text-area', _emberGlimmerComponentsText_area.default); - registry.register('component:-checkbox', _emberGlimmerComponentsCheckbox.default); - registry.register('component:link-to', _emberGlimmerComponentsLinkTo.default); - registry.register(_container.privatize(_templateObject3), _emberGlimmerComponent.default); - } -}); -enifed('ember-glimmer/syntax', ['exports', 'ember-glimmer/syntax/render', 'ember-glimmer/syntax/outlet', 'ember-glimmer/syntax/mount', 'ember-glimmer/syntax/dynamic-component', 'ember-glimmer/syntax/input', 'glimmer-runtime'], function (exports, _emberGlimmerSyntaxRender, _emberGlimmerSyntaxOutlet, _emberGlimmerSyntaxMount, _emberGlimmerSyntaxDynamicComponent, _emberGlimmerSyntaxInput, _glimmerRuntime) { - 'use strict'; + var modifier = this.builtInModifiers[nameParts[0]]; - exports.registerSyntax = registerSyntax; - exports.findSyntaxBuilder = findSyntaxBuilder; + if (modifier) { + return modifier; + } else { + throw new Error(nameParts + ' is not a modifier'); + } + }; - var syntaxKeys = []; - var syntaxes = []; + Environment.prototype.toConditionalReference = function toConditionalReference(reference) { + return _emberGlimmerUtilsReferences.ConditionalReference.create(reference); + }; - function registerSyntax(key, syntax) { - syntaxKeys.push(key); - syntaxes.push(syntax); - } + Environment.prototype.iterableFor = function iterableFor(ref, args) { + var keyPath = args.named.get('key').value(); + return _emberGlimmerUtilsIterable.default(ref, keyPath); + }; - function findSyntaxBuilder(key) { - var index = syntaxKeys.indexOf(key); + Environment.prototype.scheduleInstallModifier = function scheduleInstallModifier() { + if (this.isInteractive) { + var _GlimmerEnvironment$prototype$scheduleInstallModifier; - if (index > -1) { - return syntaxes[index]; - } - } + (_GlimmerEnvironment$prototype$scheduleInstallModifier = _GlimmerEnvironment.prototype.scheduleInstallModifier).call.apply(_GlimmerEnvironment$prototype$scheduleInstallModifier, [this].concat(babelHelpers.slice.call(arguments))); + } + }; - registerSyntax('render', _emberGlimmerSyntaxRender.RenderSyntax); - registerSyntax('outlet', _emberGlimmerSyntaxOutlet.OutletSyntax); - registerSyntax('mount', _emberGlimmerSyntaxMount.MountSyntax); - registerSyntax('component', _emberGlimmerSyntaxDynamicComponent.DynamicComponentSyntax); - registerSyntax('input', _emberGlimmerSyntaxInput.InputSyntax); + Environment.prototype.scheduleUpdateModifier = function scheduleUpdateModifier() { + if (this.isInteractive) { + var _GlimmerEnvironment$prototype$scheduleUpdateModifier; - registerSyntax('-with-dynamic-vars', (function () { - function _class() {} + (_GlimmerEnvironment$prototype$scheduleUpdateModifier = _GlimmerEnvironment.prototype.scheduleUpdateModifier).call.apply(_GlimmerEnvironment$prototype$scheduleUpdateModifier, [this].concat(babelHelpers.slice.call(arguments))); + } + }; - _class.create = function create(environment, args, symbolTable) { - return new _glimmerRuntime.WithDynamicVarsSyntax(args); + Environment.prototype.didDestroy = function didDestroy(destroyable) { + destroyable.destroy(); }; - return _class; - })()); + Environment.prototype.begin = function begin() { + this.inTransaction = true; - registerSyntax('-in-element', (function () { - function _class2() {} + _GlimmerEnvironment.prototype.begin.call(this); - _class2.create = function create(environment, args, symbolTable) { - return new _glimmerRuntime.InElementSyntax(args); + this.destroyedComponents = []; }; - return _class2; - })()); -}); -enifed('ember-glimmer/syntax/curly-component', ['exports', 'ember-utils', 'glimmer-runtime', 'ember-glimmer/utils/bindings', 'ember-glimmer/component', 'ember-metal', 'ember-views', 'ember-glimmer/utils/process-args', 'container'], function (exports, _emberUtils, _glimmerRuntime, _emberGlimmerUtilsBindings, _emberGlimmerComponent, _emberMetal, _emberViews, _emberGlimmerUtilsProcessArgs, _container) { - 'use strict'; - - exports.validatePositionalParameters = validatePositionalParameters; + Environment.prototype.commit = function commit() { + // components queued for destruction must be destroyed before firing + // `didCreate` to prevent errors when removing and adding a component + // with the same name (would throw an error when added to view registry) + for (var i = 0; i < this.destroyedComponents.length; i++) { + this.destroyedComponents[i].destroy(); + } - var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['template:components/-default'], ['template:components/-default']); + _GlimmerEnvironment.prototype.commit.call(this); - var DEFAULT_LAYOUT = _container.privatize(_templateObject); + this.inTransaction = false; + }; - function processComponentInitializationAssertions(component, props) {} + return Environment; + })(_glimmerRuntime.Environment); - function validatePositionalParameters(named, positional, positionalParamsDefinition) {} + exports.default = Environment; +}); +enifed('ember-glimmer/helper', ['exports', 'ember-utils', 'ember-runtime', '@glimmer/reference'], function (exports, _emberUtils, _emberRuntime, _glimmerReference) { + /** + @module ember + @submodule ember-glimmer + */ - function aliasIdToElementId(args, props) { - if (args.named.has('id')) { - props.elementId = props.id; - } - } + 'use strict'; - // We must traverse the attributeBindings in reverse keeping track of - // what has already been applied. This is essentially refining the concated - // properties applying right to left. - function applyAttributeBindings(element, attributeBindings, component, operations) { - var seen = []; - var i = attributeBindings.length - 1; + exports.helper = helper; + var RECOMPUTE_TAG = _emberUtils.symbol('RECOMPUTE_TAG'); - while (i !== -1) { - var binding = attributeBindings[i]; - var parsed = _emberGlimmerUtilsBindings.AttributeBinding.parse(binding); - var attribute = parsed[1]; - - if (seen.indexOf(attribute) === -1) { - seen.push(attribute); - _emberGlimmerUtilsBindings.AttributeBinding.install(element, component, parsed, operations); + exports.RECOMPUTE_TAG = RECOMPUTE_TAG; + /** + Ember Helpers are functions that can compute values, and are used in templates. + For example, this code calls a helper named `format-currency`: + + ```handlebars +
    {{format-currency cents currency="$"}}
    + ``` + + Additionally a helper can be called as a nested helper (sometimes called a + subexpression). In this example, the computed value of a helper is passed + to a component named `show-money`: + + ```handlebars + {{show-money amount=(format-currency cents currency="$")}} + ``` + + Helpers defined using a class must provide a `compute` function. For example: + + ```js + export default Ember.Helper.extend({ + compute(params, hash) { + let cents = params[0]; + let currency = hash.currency; + return `${currency}${cents * 0.01}`; } + }); + ``` + + Each time the input to a helper changes, the `compute` function will be + called again. + + As instances, these helpers also have access to the container an will accept + injected dependencies. + + Additionally, class helpers can call `recompute` to force a new computation. + + @class Ember.Helper + @public + @since 1.13.0 + */ + var Helper = _emberRuntime.FrameworkObject.extend({ + isHelperInstance: true, - i--; - } + init: function () { + this._super.apply(this, arguments); + this[RECOMPUTE_TAG] = new _glimmerReference.DirtyableTag(); + }, - if (seen.indexOf('id') === -1) { - operations.addStaticAttribute(element, 'id', component.elementId); + /** + 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 + session service changes: + ```js + // app/helpers/current-user-email.js + export default Ember.Helper.extend({ + session: Ember.inject.service(), + onNewUser: Ember.observer('session.currentUser', function() { + this.recompute(); + }), + compute() { + return this.get('session.currentUser.email'); + } + }); + ``` + @method recompute + @public + @since 1.13.0 + */ + recompute: function () { + this[RECOMPUTE_TAG].dirty(); } - if (seen.indexOf('style') === -1) { - _emberGlimmerUtilsBindings.IsVisibleBinding.install(element, component, operations); - } - } + /** + Override this function when writing a class-based helper. + @method compute + @param {Array} params The positional arguments to the helper + @param {Object} hash The named arguments to the helper + @public + @since 1.13.0 + */ + }); - var CurlyComponentSyntax = (function (_StatementSyntax) { -babelHelpers.inherits(CurlyComponentSyntax, _StatementSyntax); + Helper.reopenClass({ + isHelperFactory: true + }); - function CurlyComponentSyntax(args, definition, symbolTable) { - _StatementSyntax.call(this); - this.args = args; - this.definition = definition; - this.symbolTable = symbolTable; - this.shadow = null; - } + /** + In many cases, the ceremony of a full `Ember.Helper` class is not required. + The `helper` method create pure-function helpers without instances. For + example: + + ```js + // app/helpers/format-currency.js + export default Ember.Helper.helper(function(params, hash) { + let cents = params[0]; + let currency = hash.currency; + return `${currency}${cents * 0.01}`; + }); + ``` + + @static + @param {Function} helper The helper function + @method helper + @public + @since 1.13.0 + */ - CurlyComponentSyntax.prototype.compile = function compile(builder) { - builder.component.static(this.definition, this.args, this.symbolTable, this.shadow); + function helper(helperFn) { + return { + isHelperInstance: true, + compute: helperFn }; + } - return CurlyComponentSyntax; - })(_glimmerRuntime.StatementSyntax); + exports.default = Helper; +}); +enifed('ember-glimmer/helpers/-class', ['exports', 'ember-glimmer/utils/references', 'ember-runtime'], function (exports, _emberGlimmerUtilsReferences, _emberRuntime) { + 'use strict'; - exports.CurlyComponentSyntax = CurlyComponentSyntax; + function classHelper(_ref) { + var positional = _ref.positional; - function NOOP() {} + var path = positional.at(0); + var args = positional.length; + var value = path.value(); - var ComponentStateBucket = (function () { - function ComponentStateBucket(environment, component, args, finalizer) { - this.environment = environment; - this.component = component; - this.classRef = null; - this.args = args; - this.argsRevision = args.tag.value(); - this.finalizer = finalizer; + if (value === true) { + if (args > 1) { + return _emberRuntime.String.dasherize(positional.at(1).value()); + } + return null; } - ComponentStateBucket.prototype.destroy = function destroy() { - var component = this.component; - var environment = this.environment; - - if (environment.isInteractive) { - component.trigger('willDestroyElement'); - component.trigger('willClearRender'); + if (value === false) { + if (args > 2) { + return _emberRuntime.String.dasherize(positional.at(2).value()); } + return null; + } - environment.destroyedComponents.push(component); - }; - - ComponentStateBucket.prototype.finalize = function finalize() { - var finalizer = this.finalizer; - - finalizer(); - this.finalizer = NOOP; - }; - - return ComponentStateBucket; - })(); - - function initialRenderInstrumentDetails(component) { - return component.instrumentDetails({ initialRender: true }); - } - - function rerenderInstrumentDetails(component) { - return component.instrumentDetails({ initialRender: false }); + return value; } - var CurlyComponentManager = (function () { - function CurlyComponentManager() {} - - CurlyComponentManager.prototype.prepareArgs = function prepareArgs(definition, args) { - validatePositionalParameters(args.named, args.positional.values, definition.ComponentClass.positionalParams); + exports.default = function (vm, args) { + return new _emberGlimmerUtilsReferences.InternalHelperReference(classHelper, args); + }; +}); +enifed('ember-glimmer/helpers/-html-safe', ['exports', 'ember-glimmer/utils/references', 'ember-glimmer/utils/string'], function (exports, _emberGlimmerUtilsReferences, _emberGlimmerUtilsString) { + 'use strict'; - return _emberGlimmerUtilsProcessArgs.gatherArgs(args, definition); - }; + function htmlSafe(_ref) { + var positional = _ref.positional; - CurlyComponentManager.prototype.create = function create(environment, definition, args, dynamicScope, callerSelfRef, hasBlock) { - var parentView = dynamicScope.view; + var path = positional.at(0); + return new _emberGlimmerUtilsString.SafeString(path.value()); + } - var klass = definition.ComponentClass; - var processedArgs = _emberGlimmerUtilsProcessArgs.ComponentArgs.create(args); + exports.default = function (vm, args) { + return new _emberGlimmerUtilsReferences.InternalHelperReference(htmlSafe, args); + }; +}); +enifed('ember-glimmer/helpers/-input-type', ['exports', 'ember-glimmer/utils/references'], function (exports, _emberGlimmerUtilsReferences) { + 'use strict'; - var _processedArgs$value = processedArgs.value(); + function inputTypeHelper(_ref) { + var positional = _ref.positional; + var named = _ref.named; - var props = _processedArgs$value.props; + var type = positional.at(0).value(); + if (type === 'checkbox') { + return '-checkbox'; + } + return '-text-field'; + } - aliasIdToElementId(args, props); + exports.default = function (vm, args) { + return new _emberGlimmerUtilsReferences.InternalHelperReference(inputTypeHelper, args); + }; +}); +enifed('ember-glimmer/helpers/-normalize-class', ['exports', 'ember-glimmer/utils/references', 'ember-runtime'], function (exports, _emberGlimmerUtilsReferences, _emberRuntime) { + 'use strict'; - props.parentView = parentView; - props[_emberGlimmerComponent.HAS_BLOCK] = hasBlock; + function normalizeClass(_ref) { + var positional = _ref.positional; + var named = _ref.named; - props._targetObject = callerSelfRef.value(); + var classNameParts = positional.at(0).value().split('.'); + var className = classNameParts[classNameParts.length - 1]; + var value = positional.at(1).value(); - var component = klass.create(props); + if (value === true) { + return _emberRuntime.String.dasherize(className); + } else if (!value && value !== 0) { + return ''; + } else { + return String(value); + } + } - var finalizer = _emberMetal._instrumentStart('render.component', initialRenderInstrumentDetails, component); + exports.default = function (vm, args) { + return new _emberGlimmerUtilsReferences.InternalHelperReference(normalizeClass, args); + }; +}); +enifed('ember-glimmer/helpers/action', ['exports', 'ember-utils', 'ember-metal', 'ember-glimmer/utils/references', '@glimmer/runtime', '@glimmer/reference'], function (exports, _emberUtils, _emberMetal, _emberGlimmerUtilsReferences, _glimmerRuntime, _glimmerReference) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; - dynamicScope.view = component; + var INVOKE = _emberUtils.symbol('INVOKE'); + exports.INVOKE = INVOKE; + var ACTION = _emberUtils.symbol('ACTION'); - if (parentView !== null) { - parentView.appendChild(component); + exports.ACTION = ACTION; + /** + 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 + + There are three contexts an action helper can be used in. The first two + contexts to discuss are attribute context, and Handlebars value context. + + ```handlebars + {{! An example of attribute context }} +
    + {{! Examples of Handlebars value context }} + {{input on-input=(action "save")}} + {{yield (action "refreshData") andAnotherParam}} + ``` + + In these contexts, + the helper is called a "closure action" helper. Its behavior is simple: + If passed a function name, read that function off the `actions` property + of the current context. Once that function is read (or if a function was + passed), create a closure over that function and any arguments. + The resulting value of an action helper used this way is simply a function. + + For example, in the attribute context: + + ```handlebars + {{! An example of attribute context }} +
    + ``` + + The resulting template render logic would be: + + ```js + var div = document.createElement('div'); + var actionFunction = (function(context){ + return function() { + return context.actions.save.apply(context, arguments); + }; + })(context); + div.onclick = actionFunction; + ``` + + Thus when the div is clicked, the action on that context is called. + Because the `actionFunction` is just a function, closure actions can be + passed between components and still execute in the correct context. + + Here is an example action handler on a component: + + ```js + import Ember from 'ember'; + + export default Ember.Component.extend({ + actions: { + save() { + this.get('model').save(); + } } - - // We usually do this in the `didCreateElement`, but that hook doesn't fire for tagless components - if (component.tagName === '') { - if (environment.isInteractive) { - component.trigger('willRender'); + }); + ``` + + Actions are always looked up on the `actions` property of the current context. + This avoids collisions in the naming of common actions, such as `destroy`. + Two options can be passed to the `action` helper when it is used in this way. + + * `target=someProperty` will look to `someProperty` instead of the current + context for the `actions` hash. This can be useful when targetting a + service for actions. + * `value="target.value"` will read the path `target.value` off the first + argument to the action when it is called and rewrite the first argument + to be that value. This is useful when attaching actions to event listeners. + + ### Invoking an action + + Closure actions curry both their scope and any arguments. When invoked, any + additional arguments are added to the already curried list. + Actions should be invoked using the [sendAction](/api/classes/Ember.Component.html#method_sendAction) + method. The first argument to `sendAction` is the action to be called, and + additional arguments are passed to the action function. This has interesting + properties combined with currying of arguments. For example: + + ```js + export default Ember.Component.extend({ + actions: { + // Usage {{input on-input=(action (action 'setName' model) value="target.value")}} + setName(model, name) { + model.set('name', name); } - - component._transitionTo('hasElement'); - - if (environment.isInteractive) { - component.trigger('willInsertElement'); + } + }); + ``` + + The first argument (`model`) was curried over, and the run-time argument (`event`) + becomes a second argument. Action calls can be nested this way because each simply + returns a function. Any function can be passed to the `{{action}}` helper, including + other actions. + + Actions invoked with `sendAction` have the same currying behavior as demonstrated + with `on-input` above. For example: + + ```app/components/my-input.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + actions: { + setName(model, name) { + model.set('name', name); } } - - var bucket = new ComponentStateBucket(environment, component, processedArgs, finalizer); - - if (args.named.has('class')) { - bucket.classRef = args.named.get('class'); + }); + ``` + + ```handlebars + {{my-input submit=(action 'setName' model)}} + ``` + + ```app/components/my-component.js + import Ember from 'ember'; + + export default Ember.Component.extend({ + click() { + // Note that model is not passed, it was curried in the template + this.sendAction('submit', 'bob'); } + }); + ``` + + ### Attaching actions to DOM elements + + The third context of the `{{action}}` helper can be called "element space". + For example: + + ```handlebars + {{! An example of element space }} +
    + ``` + + Used this way, the `{{action}}` helper provides a useful shortcut for + registering an HTML element in a template for a single DOM event and + forwarding that interaction to the template's context (controller or component). + If the context of a template is a controller, actions used this way will + bubble to routes when the controller does not implement the specified action. + Once an action hits a route, it will bubble through the route hierarchy. + + ### Event Propagation + + `{{action}}` helpers called in element space can control event bubbling. Note + that the closure style actions cannot. + + Events triggered through the action helper will automatically have + `.preventDefault()` called on them. You do not need to do so in your event + handlers. If you need to allow event propagation (to handle file inputs for + example) you can supply the `preventDefault=false` option to the `{{action}}` helper: + + ```handlebars +
    + + +
    + ``` + + To disable bubbling, pass `bubbles=false` to the helper: + + ```handlebars + + ``` + + To disable bubbling with closure style actions you must create your own + wrapper helper that makes use of `event.stopPropagation()`: + + ```handlebars +
    Hello
    + ``` + + ```app/helpers/disable-bubbling.js + import Ember from 'ember'; + + export function disableBubbling([action]) { + return function(event) { + event.stopPropagation(); + return action(event); + }; + } + export default Ember.Helper.helper(disableBubbling); + ``` + + If you need the default handler to trigger you should either register your + own event handler, or use event methods on your view class. See + ["Responding to Browser Events"](/api/classes/Ember.View.html#toc_responding-to-browser-events) + in the documentation for Ember.View for more information. + + ### Specifying DOM event type + + `{{action}}` helpers called in element space can specify an event type. + By default the `{{action}}` helper registers for DOM `click` events. You can + supply an `on` option to the helper to specify a different DOM event name: + + ```handlebars +
    + click me +
    + ``` + + See ["Event Names"](/api/classes/Ember.View.html#toc_event-names) for a list of + acceptable DOM event names. + + ### Specifying whitelisted modifier keys + + `{{action}}` helpers called in element space can specify modifier keys. + By default the `{{action}}` helper will ignore click events with pressed modifier + keys. You can supply an `allowedKeys` option to specify which keys should not be ignored. + + ```handlebars +
    + click me +
    + ``` + + This way the action will fire when clicking with the alt key pressed down. + Alternatively, supply "any" to the `allowedKeys` option to accept any combination of modifier keys. + + ```handlebars +
    + click me with any key pressed +
    + ``` + + ### Specifying a Target + + A `target` option can be provided to the helper to change + which object will receive the method call. This option must be a path + to an object, accessible in the current context: + + ```app/templates/application.hbs +
    + click me +
    + ``` + + ```app/controllers/application.js + import Ember from 'ember'; + + export default Ember.Controller.extend({ + someService: Ember.inject.service() + }); + ``` + + @method action + @for Ember.Templates.helpers + @public + */ - processComponentInitializationAssertions(component, props); + exports.default = function (vm, args) { + var named = args.named; + var positional = args.positional; - if (environment.isInteractive && component.tagName !== '') { - component.trigger('willRender'); - } - - return bucket; - }; - - CurlyComponentManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { - var template = definition.template; - if (!template) { - var component = bucket.component; + // The first two argument slots are reserved. + // pos[0] is the context (or `this`) + // pos[1] is the action name or function + // Anything else is an action argument. + var context = positional.at(0); + var action = positional.at(1); - template = this.templateFor(component, env); - } - return env.getCompiledBlock(CurlyComponentLayoutCompiler, template); - }; + // TODO: Is there a better way of doing this? + var debugKey = action._propertyKey; - CurlyComponentManager.prototype.templateFor = function templateFor(component, env) { - var Template = _emberMetal.get(component, 'layout'); - var owner = component[_emberUtils.OWNER]; - if (Template) { - return env.getTemplate(Template, owner); - } - var layoutName = _emberMetal.get(component, 'layoutName'); - if (layoutName) { - var template = owner.lookup('template:' + layoutName); - if (template) { - return template; - } - } - return owner.lookup(DEFAULT_LAYOUT); - }; + var restArgs = undefined; - CurlyComponentManager.prototype.getSelf = function getSelf(_ref) { - var component = _ref.component; + if (positional.length === 2) { + restArgs = _glimmerRuntime.EvaluatedPositionalArgs.empty(); + } else { + restArgs = _glimmerRuntime.EvaluatedPositionalArgs.create(positional.values.slice(2)); + } - return component[_emberGlimmerComponent.ROOT_REF]; - }; + var target = named.has('target') ? named.get('target') : context; + var processArgs = makeArgsProcessor(named.has('value') && named.get('value'), restArgs); - CurlyComponentManager.prototype.didCreateElement = function didCreateElement(_ref2, element, operations) { - var component = _ref2.component; - var classRef = _ref2.classRef; - var environment = _ref2.environment; + var fn = undefined; - _emberViews.setViewElement(component, element); + if (typeof action[INVOKE] === 'function') { + fn = makeClosureAction(action, action, action[INVOKE], processArgs, debugKey); + } else if (_glimmerReference.isConst(target) && _glimmerReference.isConst(action)) { + fn = makeClosureAction(context.value(), target.value(), action.value(), processArgs, debugKey); + } else { + fn = makeDynamicClosureAction(context.value(), target, action, processArgs, debugKey); + } - var attributeBindings = component.attributeBindings; - var classNames = component.classNames; - var classNameBindings = component.classNameBindings; + fn[ACTION] = true; - if (attributeBindings && attributeBindings.length) { - applyAttributeBindings(element, attributeBindings, component, operations); - } else { - operations.addStaticAttribute(element, 'id', component.elementId); - _emberGlimmerUtilsBindings.IsVisibleBinding.install(element, component, operations); - } + return new _emberGlimmerUtilsReferences.UnboundReference(fn); + }; - if (classRef) { - operations.addDynamicAttribute(element, 'class', classRef); - } + function NOOP(args) { + return args; + } - if (classNames && classNames.length) { - classNames.forEach(function (name) { - operations.addStaticAttribute(element, 'class', name); - }); - } + function makeArgsProcessor(valuePathRef, actionArgsRef) { + var mergeArgs = null; - if (classNameBindings && classNameBindings.length) { - classNameBindings.forEach(function (binding) { - _emberGlimmerUtilsBindings.ClassNameBinding.install(element, component, binding, operations); - }); - } + if (actionArgsRef.length > 0) { + mergeArgs = function (args) { + return actionArgsRef.value().concat(args); + }; + } - component._transitionTo('hasElement'); + var readValue = null; - if (environment.isInteractive) { - component.trigger('willInsertElement'); - } - }; + if (valuePathRef) { + readValue = function (args) { + var valuePath = valuePathRef.value(); - CurlyComponentManager.prototype.didRenderLayout = function didRenderLayout(bucket, bounds) { - bucket.component[_emberGlimmerComponent.BOUNDS] = bounds; - bucket.finalize(); - }; + if (valuePath && args.length > 0) { + args[0] = _emberMetal.get(args[0], valuePath); + } - CurlyComponentManager.prototype.getTag = function getTag(_ref3) { - var component = _ref3.component; + return args; + }; + } - return component[_emberGlimmerComponent.DIRTY_TAG]; - }; + if (mergeArgs && readValue) { + return function (args) { + return readValue(mergeArgs(args)); + }; + } else { + return mergeArgs || readValue || NOOP; + } + } - CurlyComponentManager.prototype.didCreate = function didCreate(_ref4) { - var component = _ref4.component; - var environment = _ref4.environment; + function makeDynamicClosureAction(context, targetRef, actionRef, processArgs, debugKey) { - if (environment.isInteractive) { - component._transitionTo('inDOM'); - component.trigger('didInsertElement'); - component.trigger('didRender'); - } + return function () { + return makeClosureAction(context, targetRef.value(), actionRef.value(), processArgs, debugKey).apply(undefined, arguments); }; - CurlyComponentManager.prototype.update = function update(bucket, _, dynamicScope) { - var component = bucket.component; - var args = bucket.args; - var argsRevision = bucket.argsRevision; - var environment = bucket.environment; - - bucket.finalizer = _emberMetal._instrumentStart('render.component', rerenderInstrumentDetails, component); - - if (!args.tag.validate(argsRevision)) { - var _args$value = args.value(); - - var attrs = _args$value.attrs; - var props = _args$value.props; - - bucket.argsRevision = args.tag.value(); - - var oldAttrs = component.attrs; - var newAttrs = attrs; - - component[_emberGlimmerComponent.IS_DISPATCHING_ATTRS] = true; - component.setProperties(props); - component[_emberGlimmerComponent.IS_DISPATCHING_ATTRS] = false; - - component.trigger('didUpdateAttrs', { oldAttrs: oldAttrs, newAttrs: newAttrs }); - component.trigger('didReceiveAttrs', { oldAttrs: oldAttrs, newAttrs: newAttrs }); - } + // We don't allow undefined/null values, so this creates a throw-away action to trigger the assertions + } - if (environment.isInteractive) { - component.trigger('willUpdate'); - component.trigger('willRender'); - } - }; + function makeClosureAction(context, target, action, processArgs, debugKey) { + var self = undefined, + fn = undefined; - CurlyComponentManager.prototype.didUpdateLayout = function didUpdateLayout(bucket) { - bucket.finalize(); - }; + if (typeof action[INVOKE] === 'function') { + self = action; + fn = action[INVOKE]; + } else { + var typeofAction = typeof action; - CurlyComponentManager.prototype.didUpdate = function didUpdate(_ref5) { - var component = _ref5.component; - var environment = _ref5.environment; + if (typeofAction === 'string') { + self = target; + fn = target.actions && target.actions[action]; + } else if (typeofAction === 'function') { + self = context; + fn = action; + } else {} + } - if (environment.isInteractive) { - component.trigger('didUpdate'); - component.trigger('didRender'); + return function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } - }; - CurlyComponentManager.prototype.getDestructor = function getDestructor(stateBucket) { - return stateBucket; + var payload = { target: self, args: args, label: '@glimmer/closure-action' }; + return _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { + return _emberMetal.run.join.apply(_emberMetal.run, [self, fn].concat(processArgs(args))); + }); }; + } +}); +enifed('ember-glimmer/helpers/component', ['exports', 'ember-utils', 'ember-glimmer/utils/references', 'ember-glimmer/syntax/curly-component', '@glimmer/runtime', 'ember-metal'], function (exports, _emberUtils, _emberGlimmerUtilsReferences, _emberGlimmerSyntaxCurlyComponent, _glimmerRuntime, _emberMetal) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; - return CurlyComponentManager; - })(); - - var MANAGER = new CurlyComponentManager(); - - var TopComponentManager = (function (_CurlyComponentManager) { -babelHelpers.inherits(TopComponentManager, _CurlyComponentManager); - - function TopComponentManager() { - _CurlyComponentManager.apply(this, arguments); - } - - TopComponentManager.prototype.create = function create(environment, definition, args, dynamicScope, currentScope, hasBlock) { - var component = definition.ComponentClass; - - var finalizer = _emberMetal._instrumentStart('render.component', initialRenderInstrumentDetails, component); - - dynamicScope.view = component; - - // We usually do this in the `didCreateElement`, but that hook doesn't fire for tagless components - if (component.tagName === '') { - if (environment.isInteractive) { - component.trigger('willRender'); + /** + 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. + `{{component}}`'s primary use is for cases where you want to dynamically + change which type of component is rendered as the state of your application + changes. This helper has three modes: inline, block, and nested. + + ### Inline Form + + Given the following template: + + ```app/application.hbs + {{component infographicComponentName}} + ``` + + And the following application code: + + ```app/controllers/application.js + export default Ember.Controller.extend({ + infographicComponentName: computed('isMarketOpen', { + get() { + if (this.get('isMarketOpen')) { + return 'live-updating-chart'; + } else { + return 'market-close-summary'; + } } - - component._transitionTo('hasElement'); - - if (environment.isInteractive) { - component.trigger('willInsertElement'); + }) + }); + ``` + + The `live-updating-chart` component will be appended when `isMarketOpen` is + `true`, and the `market-close-summary` component will be appended when + `isMarketOpen` is `false`. If the value changes while the app is running, + the component will be automatically swapped out accordingly. + Note: You should not use this helper when you are consistently rendering the same + component. In that case, use standard component syntax, for example: + + ```app/templates/application.hbs + {{live-updating-chart}} + ``` + + ### Block Form + + Using the block form of this helper is similar to using the block form + of a component. Given the following application template: + + ```app/templates/application.hbs + {{#component infographicComponentName}} + Last update: {{lastUpdateTimestamp}} + {{/component}} + ``` + + The following controller code: + + ```app/controllers/application.js + export default Ember.Controller.extend({ + lastUpdateTimestamp: computed(function() { + return new Date(); + }), + + infographicComponentName: computed('isMarketOpen', { + get() { + if (this.get('isMarketOpen')) { + return 'live-updating-chart'; + } else { + return 'market-close-summary'; + } } - } + }) + }); + ``` + + And the following component template: + + ```app/templates/components/live-updating-chart.hbs + {{! chart }} + {{yield}} + ``` + + The `Last Update: {{lastUpdateTimestamp}}` will be rendered in place of the `{{yield}}`. + + ### Nested Usage + + The `component` helper can be used to package a component path with initial attrs. + The included attrs can then be merged during the final invocation. + For example, given a `person-form` component with the following template: + + ```app/templates/components/person-form.hbs + {{yield (hash + nameInput=(component "my-input-component" value=model.name placeholder="First Name") + )}} + ``` + + When yielding the component via the `hash` helper, the component is invocked directly. + See the following snippet: + + ``` + {{#person-form as |form|}} + {{form.nameInput placeholder="Username"}} + {{/person-form}} + ``` + + Which outputs an input whose value is already bound to `model.name` and `placeholder` + is "Username". + + When yielding the component without the hash helper use the `component` helper. + For example, below is a `full-name` component template: + + ```handlebars + {{yield (component "my-input-component" value=model.name placeholder="Name")}} + ``` + + ``` + {{#full-name as |field|}} + {{component field placeholder="Full name"}} + {{/full-name}} + ``` + + @method component + @since 1.11.0 + @for Ember.Templates.helpers + @public + */ - processComponentInitializationAssertions(component, {}); + var ClosureComponentReference = (function (_CachedReference) { + babelHelpers.inherits(ClosureComponentReference, _CachedReference); - return new ComponentStateBucket(environment, component, args, finalizer); + ClosureComponentReference.create = function create(args, symbolTable, env) { + return new ClosureComponentReference(args, symbolTable, env); }; - return TopComponentManager; - })(CurlyComponentManager); - - var ROOT_MANAGER = new TopComponentManager(); - - function tagName(vm) { - var tagName = vm.dynamicScope().view.tagName; - - return _glimmerRuntime.PrimitiveReference.create(tagName === '' ? null : tagName || 'div'); - } - - function ariaRole(vm) { - return vm.getSelf().get('ariaRole'); - } - - var CurlyComponentDefinition = (function (_ComponentDefinition) { -babelHelpers.inherits(CurlyComponentDefinition, _ComponentDefinition); - - function CurlyComponentDefinition(name, ComponentClass, template, args) { - _ComponentDefinition.call(this, name, MANAGER, ComponentClass); - this.template = template; + function ClosureComponentReference(args, symbolTable, env) { + _CachedReference.call(this); + this.defRef = args.positional.at(0); + this.env = env; + this.tag = args.positional.at(0).tag; + this.symbolTable = symbolTable; this.args = args; + this.lastDefinition = undefined; + this.lastName = undefined; } - return CurlyComponentDefinition; - })(_glimmerRuntime.ComponentDefinition); + ClosureComponentReference.prototype.compute = function compute() { + // TODO: Figure out how to extract this because it's nearly identical to + // DynamicComponentReference::compute(). The only differences besides + // currying are in the assertion messages. + var args = this.args; + var defRef = this.defRef; + var env = this.env; + var symbolTable = this.symbolTable; + var lastDefinition = this.lastDefinition; + var lastName = this.lastName; - exports.CurlyComponentDefinition = CurlyComponentDefinition; + var nameOrDef = defRef.value(); + var definition = null; - var RootComponentDefinition = (function (_ComponentDefinition2) { -babelHelpers.inherits(RootComponentDefinition, _ComponentDefinition2); + if (nameOrDef && nameOrDef === lastName) { + return lastDefinition; + } - function RootComponentDefinition(instance) { - _ComponentDefinition2.call(this, '-root', ROOT_MANAGER, instance); - this.template = undefined; - this.args = undefined; - } + this.lastName = nameOrDef; - return RootComponentDefinition; - })(_glimmerRuntime.ComponentDefinition); + if (typeof nameOrDef === 'string') { + definition = env.getComponentDefinition([nameOrDef], symbolTable); + } else if (_glimmerRuntime.isComponentDefinition(nameOrDef)) { + definition = nameOrDef; + } else { + return null; + } - exports.RootComponentDefinition = RootComponentDefinition; + var newDef = createCurriedDefinition(definition, args); - var CurlyComponentLayoutCompiler = (function () { - function CurlyComponentLayoutCompiler(template) { - this.template = template; - } + this.lastDefinition = newDef; - CurlyComponentLayoutCompiler.prototype.compile = function compile(builder) { - builder.wrapLayout(this.template.asLayout()); - builder.tag.dynamic(tagName); - builder.attrs.dynamic('role', ariaRole); - builder.attrs.static('class', 'ember-view'); + return newDef; }; - return CurlyComponentLayoutCompiler; - })(); + return ClosureComponentReference; + })(_emberGlimmerUtilsReferences.CachedReference); - CurlyComponentLayoutCompiler.id = 'curly'; -}); -enifed('ember-glimmer/syntax/dynamic-component', ['exports', 'glimmer-runtime', 'glimmer-reference', 'ember-metal'], function (exports, _glimmerRuntime, _glimmerReference, _emberMetal) { - 'use strict'; + exports.ClosureComponentReference = ClosureComponentReference; - function dynamicComponentFor(vm, symbolTable) { - var env = vm.env; - var args = vm.getArgs(); - var nameRef = args.positional.at(0); + function createCurriedDefinition(definition, args) { + var curriedArgs = curryArgs(definition, args); - return new DynamicComponentReference({ nameRef: nameRef, env: env, symbolTable: symbolTable }); + return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentDefinition(definition.name, definition.ComponentClass, definition.template, curriedArgs); } - var DynamicComponentSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(DynamicComponentSyntax, _StatementSyntax); + var EMPTY_BLOCKS = { + default: null, + inverse: null + }; - // for {{component componentName}} + function curryArgs(definition, newArgs) { + var args = definition.args; + var ComponentClass = definition.ComponentClass; - DynamicComponentSyntax.create = function create(environment, args, symbolTable) { - var definitionArgs = _glimmerRuntime.ArgsSyntax.fromPositionalArgs(args.positional.slice(0, 1)); - var invocationArgs = _glimmerRuntime.ArgsSyntax.build(args.positional.slice(1), args.named, args.blocks); + var positionalParams = ComponentClass.class.positionalParams; - return new this(definitionArgs, invocationArgs, symbolTable); - }; + // The args being passed in are from the (component ...) invocation, + // so the first positional argument is actually the name or component + // definition. It needs to be dropped in order for any actual positional + // args to coincide with the ComponentClass's positionParams. - // Transforms {{foo.bar with=args}} or {{#foo.bar with=args}}{{/foo.bar}} - // into {{component foo.bar with=args}} or - // {{#component foo.bar with=args}}{{/component}} - // with all of it's arguments + // For "normal" curly components this slicing is done at the syntax layer, + // but we don't have that luxury here. - DynamicComponentSyntax.fromPath = function fromPath(environment, path, args, symbolTable) { - var positional = _glimmerRuntime.ArgsSyntax.fromPositionalArgs(_glimmerRuntime.PositionalArgsSyntax.build([_glimmerRuntime.GetSyntax.build(path.join('.'))])); + var _newArgs$positional$values = newArgs.positional.values; - return new this(positional, args, symbolTable); - }; + var slicedPositionalArgs = _newArgs$positional$values.slice(1); - function DynamicComponentSyntax(definitionArgs, args, symbolTable) { - _StatementSyntax.call(this); - this.definition = dynamicComponentFor; - this.definitionArgs = definitionArgs; - this.args = args; - this.symbolTable = symbolTable; - this.shadow = null; + if (positionalParams && slicedPositionalArgs.length) { + _emberGlimmerSyntaxCurlyComponent.validatePositionalParameters(newArgs.named, slicedPositionalArgs, positionalParams); } - DynamicComponentSyntax.prototype.compile = function compile(builder) { - builder.component.dynamic(this.definitionArgs, this.definition, this.args, this.symbolTable, this.shadow); - }; + var isRest = typeof positionalParams === 'string'; - return DynamicComponentSyntax; - })(_glimmerRuntime.StatementSyntax); + // For non-rest position params, we need to perform the position -> name mapping + // at each layer to avoid a collision later when the args are used to construct + // the component instance (inside of processArgs(), inside of create()). + var positionalToNamedParams = {}; - exports.DynamicComponentSyntax = DynamicComponentSyntax; + if (!isRest && positionalParams && positionalParams.length > 0) { + var limit = Math.min(positionalParams.length, slicedPositionalArgs.length); - var DynamicComponentReference = (function () { - function DynamicComponentReference(_ref) { - var nameRef = _ref.nameRef; - var env = _ref.env; - var symbolTable = _ref.symbolTable; - var args = _ref.args; + for (var i = 0; i < limit; i++) { + var _name = positionalParams[i]; + positionalToNamedParams[_name] = slicedPositionalArgs[i]; + } - this.tag = nameRef.tag; - this.nameRef = nameRef; - this.env = env; - this.symbolTable = symbolTable; - this.args = args; + slicedPositionalArgs.length = 0; // Throw them away since you're merged in. } - DynamicComponentReference.prototype.value = function value() { - var env = this.env; - var nameRef = this.nameRef; - var symbolTable = this.symbolTable; + // args (aka 'oldArgs') may be undefined or simply be empty args, so + // we need to fall back to an empty array or object. + var oldNamed = args && args.named && args.named.map || {}; + var oldPositional = args && args.positional && args.positional.values || []; - var nameOrDef = nameRef.value(); + // Merge positional arrays + var mergedPositional = new Array(Math.max(oldPositional.length, slicedPositionalArgs.length)); + mergedPositional.splice.apply(mergedPositional, [0, oldPositional.length].concat(oldPositional)); + mergedPositional.splice.apply(mergedPositional, [0, slicedPositionalArgs.length].concat(slicedPositionalArgs)); - if (typeof nameOrDef === 'string') { - var definition = env.getComponentDefinition([nameOrDef], symbolTable); + // Merge named maps + var mergedNamed = _emberUtils.assign({}, oldNamed, positionalToNamedParams, newArgs.named.map); - return definition; - } else if (_glimmerRuntime.isComponentDefinition(nameOrDef)) { - return nameOrDef; - } else { - return null; - } - }; + var mergedArgs = _glimmerRuntime.EvaluatedArgs.create(_glimmerRuntime.EvaluatedPositionalArgs.create(mergedPositional), _glimmerRuntime.EvaluatedNamedArgs.create(mergedNamed), EMPTY_BLOCKS); - DynamicComponentReference.prototype.get = function get() { - return _glimmerReference.UNDEFINED_REFERENCE; - }; + return mergedArgs; + } - return DynamicComponentReference; - })(); + exports.default = function (vm, args, symbolTable) { + return ClosureComponentReference.create(args, symbolTable, vm.env); + }; }); -enifed('ember-glimmer/syntax/input', ['exports', 'ember-metal', 'ember-glimmer/syntax/curly-component', 'ember-glimmer/syntax/dynamic-component', 'ember-glimmer/utils/bindings'], function (exports, _emberMetal, _emberGlimmerSyntaxCurlyComponent, _emberGlimmerSyntaxDynamicComponent, _emberGlimmerUtilsBindings) { +enifed('ember-glimmer/helpers/concat', ['exports', 'ember-glimmer/utils/references', '@glimmer/runtime'], function (exports, _emberGlimmerUtilsReferences, _glimmerRuntime) { + 'use strict'; + /** @module ember @submodule ember-glimmer */ - 'use strict'; - - function buildTextFieldSyntax(args, getDefinition, symbolTable) { - var definition = getDefinition('-text-field'); - _emberGlimmerUtilsBindings.wrapComponentClassAttribute(args); - return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentSyntax(args, definition, symbolTable); - } /** - The `{{input}}` helper lets you create an HTML `` component. - It causes an `Ember.TextField` component to be rendered. For more info, - see the [Ember.TextField](/api/classes/Ember.TextField.html) docs and - the [templates guide](http://emberjs.com/guides/templates/input-helpers/). + Concatenates the given arguments into a string. - ```handlebars - {{input value="987"}} - ``` + Example: - renders as: + ```handlebars + {{some-component name=(concat firstName " " lastName)}} - ```HTML - + {{! would pass name=" " to the component}} ``` - ### Text field + @public + @method concat + @for Ember.Templates.helpers + @since 1.13.0 + */ + function concat(_ref) { + var positional = _ref.positional; + + return positional.value().map(_glimmerRuntime.normalizeTextValue).join(''); + } + + exports.default = function (vm, args) { + return new _emberGlimmerUtilsReferences.InternalHelperReference(concat, args); + }; +}); +enifed('ember-glimmer/helpers/each-in', ['exports', 'ember-utils'], function (exports, _emberUtils) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; + + exports.isEachIn = isEachIn; + + /** + The `{{#each}}` helper loops over elements in a collection. It is an extension + of the base Handlebars `{{#each}}` helper. + The default behavior of `{{#each}}` is to yield its inner block once for every + item in an array passing the item as the first block parameter. - If no `type` option is specified, a default of type 'text' is used. - Many of the standard HTML attributes may be passed to this helper. - - - - - - - - - - - -
    `readonly``required``autofocus`
    `value``placeholder``disabled`
    `size``tabindex``maxlength`
    `name``min``max`
    `pattern``accept``autocomplete`
    `autosave``formaction``formenctype`
    `formmethod``formnovalidate``formtarget`
    `height``inputmode``multiple`
    `step``width``form`
    `selectionDirection``spellcheck` 
    - When set to a quoted string, these values will be directly applied to the HTML - element. When left unquoted, these values will be bound to a property on the - template's current rendering context (most typically a controller instance). - A very common use of this helper is to bind the `value` of an input to an Object's attribute: + ```javascript + var developers = [{ name: 'Yehuda' },{ name: 'Tom' }, { name: 'Paul' }]; + ``` ```handlebars - Search: - {{input value=searchWord}} + {{#each developers key="name" as |person|}} + {{person.name}} + {{! `this` is whatever it was outside the #each }} + {{/each}} ``` - In this example, the inital value in the `` will be set to the value of `searchWord`. - If the user changes the text, the value of `searchWord` will also be updated. - - ### Actions + The same rules apply to arrays of primitives. - The helper can send multiple actions based on user events. - The action property defines the action which is sent when - the user presses the return key. + ```javascript + var developerNames = ['Yehuda', 'Tom', 'Paul'] + ``` ```handlebars - {{input action="submit"}} + {{#each developerNames key="@index" as |name|}} + {{name}} + {{/each}} ``` - The helper allows some user events to send actions. - - * `enter` - * `insert-newline` - * `escape-press` - * `focus-in` - * `focus-out` - * `key-press` - * `key-up` - - For example, if you desire an action to be sent when the input is blurred, - you only need to setup the action name to the event name property. + During iteration, the index of each item in the array is provided as a second block parameter. ```handlebars - {{input focus-out="alertMessage"}} +
      + {{#each people as |person index|}} +
    • Hello, {{person.name}}! You're number {{index}} in line
    • + {{/each}} +
    ``` - See more about [Text Support Actions](/api/classes/Ember.TextField.html) - ### Extending `Ember.TextField` + ### Specifying Keys - Internally, `{{input type="text"}}` creates an instance of `Ember.TextField`, passing - arguments from the helper to `Ember.TextField`'s `create` method. You can extend the - capabilities of text inputs in your applications by reopening this class. For example, - if you are building a Bootstrap project where `data-*` attributes are used, you - can add one to the `TextField`'s `attributeBindings` property: + The `key` option is used to tell Ember how to determine if the array being + iterated over with `{{#each}}` has changed between renders. By helping Ember + detect that some elements in the array are the same, DOM elements can be + re-used, significantly improving rendering speed. - ```javascript - Ember.TextField.reopen({ - attributeBindings: ['data-error'] - }); + For example, here's the `{{#each}}` helper with its `key` set to `id`: + + ```handlebars + {{#each model key="id" as |item|}} + {{/each}} ``` - Keep in mind when writing `Ember.TextField` subclasses that `Ember.TextField` - itself extends `Ember.Component`. Expect isolated component semantics, not - legacy 1.x view semantics (like `controller` being present). - See more about [Ember components](/api/classes/Ember.Component.html) + When this `{{#each}}` re-renders, Ember will match up the previously rendered + items (and reorder the generated DOM elements) based on each item's `id` + property. + By default the item's own reference is used. - ### Checkbox + ### {{else}} condition - Checkboxes are special forms of the `{{input}}` helper. To create a ``: + `{{#each}}` can have a matching `{{else}}`. The contents of this block will render + if the collection is empty. ```handlebars - Emberize Everything: - {{input type="checkbox" name="isEmberized" checked=isEmberized}} + {{#each developers as |person|}} + {{person.name}} + {{else}} +

    Sorry, nobody is available for this task.

    + {{/each}} ``` - This will bind checked state of this checkbox to the value of `isEmberized` -- if either one changes, - it will be reflected in the other. - - The following HTML attributes can be set via the helper: + @method each + @for Ember.Templates.helpers + @public + */ + + /** + The `{{each-in}}` helper loops over properties on an object. - * `checked` - * `disabled` - * `tabindex` - * `indeterminate` - * `name` - * `autofocus` - * `form` + For example, given a `user` object that looks like: - ### Extending `Ember.Checkbox` + ```javascript + { + "name": "Shelly Sails", + "age": 42 + } + ``` - Internally, `{{input type="checkbox"}}` creates an instance of `Ember.Checkbox`, passing - arguments from the helper to `Ember.Checkbox`'s `create` method. You can extend the - capablilties of checkbox inputs in your applications by reopening this class. For example, - if you wanted to add a css class to all checkboxes in your application: + This template would display all properties on the `user` + object in a list: - ```javascript - Ember.Checkbox.reopen({ - classNames: ['my-app-checkbox'] - }); + ```handlebars +
      + {{#each-in user as |key value|}} +
    • {{key}}: {{value}}
    • + {{/each-in}} +
    ``` - @method input + Outputting their name and age. + + @method each-in @for Ember.Templates.helpers - @param {Hash} options @public + @since 2.1.0 */ - var InputSyntax = { - create: function (environment, args, symbolTable) { - var getDefinition = function (path) { - return environment.getComponentDefinition([path], symbolTable); - }; - - if (args.named.has('type')) { - var typeArg = args.named.at('type'); - if (typeArg.type === 'value') { - if (typeArg.value === 'checkbox') { + var EACH_IN_REFERENCE = _emberUtils.symbol('EACH_IN'); - _emberGlimmerUtilsBindings.wrapComponentClassAttribute(args); - var definition = getDefinition('-checkbox'); - return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentSyntax(args, definition, symbolTable); - } else { - return buildTextFieldSyntax(args, getDefinition, symbolTable); - } - } - } else { - return buildTextFieldSyntax(args, getDefinition, symbolTable); - } + function isEachIn(ref) { + return ref && ref[EACH_IN_REFERENCE]; + } - return _emberGlimmerSyntaxDynamicComponent.DynamicComponentSyntax.create(environment, args, symbolTable); - } + exports.default = function (vm, args) { + var ref = Object.create(args.positional.at(0)); + ref[EACH_IN_REFERENCE] = true; + return ref; }; - exports.InputSyntax = InputSyntax; }); -enifed('ember-glimmer/syntax/mount', ['exports', 'glimmer-runtime', 'glimmer-reference', 'ember-metal', 'ember-glimmer/utils/references', 'ember-routing', 'ember-glimmer/syntax/outlet'], function (exports, _glimmerRuntime, _glimmerReference, _emberMetal, _emberGlimmerUtilsReferences, _emberRouting, _emberGlimmerSyntaxOutlet) { +enifed('ember-glimmer/helpers/get', ['exports', 'ember-metal', 'ember-glimmer/utils/references', '@glimmer/reference'], function (exports, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference) { + 'use strict'; + /** @module ember @submodule ember-glimmer */ - 'use strict'; /** - The `{{mount}}` helper lets you embed a routeless engine in a template. - Mounting an engine will cause an instance to be booted and its `application` - template to be rendered. + 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, the following template mounts the `ember-chat` engine: + For example, these two usages are equivilent: ```handlebars - {{! application.hbs }} - {{mount "ember-chat"}} + {{person.height}} + {{get person "height"}} ``` - Currently, the engine name is the only argument that can be passed to - `{{mount}}`. + 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}} + + + ``` + + The `{{get}}` helper can also respect mutable values itself. For example: + + ```handlebars + {{input value=(mut (get person factName)) type="text"}} + + + ``` + + Would allow the user to swap what fact is being displayed, and also edit + that fact via a two-way mutable binding. - @method mount - @for Ember.Templates.helpers - @category ember-application-engines @public - */ - - var MountSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(MountSyntax, _StatementSyntax); - - MountSyntax.create = function create(env, args, symbolTable) { - - var name = args.positional.at(0).inner(); - - var definition = new MountDefinition(name, env); - - return new MountSyntax(definition, symbolTable); - }; - - function MountSyntax(definition, symbolTable) { - _StatementSyntax.call(this); - this.definition = definition; - this.symbolTable = symbolTable; - } - - MountSyntax.prototype.compile = function compile(builder) { - builder.component.static(this.definition, _glimmerRuntime.ArgsSyntax.empty(), null, this.symbolTable, null); - }; - - return MountSyntax; - })(_glimmerRuntime.StatementSyntax); + @method get + @for Ember.Templates.helpers + @since 2.1.0 + */ - exports.MountSyntax = MountSyntax; + exports.default = function (vm, args) { + return GetHelperReference.create(args.positional.at(0), args.positional.at(1)); + }; - var MountManager = (function () { - function MountManager() {} + var GetHelperReference = (function (_CachedReference) { + babelHelpers.inherits(GetHelperReference, _CachedReference); - MountManager.prototype.prepareArgs = function prepareArgs(definition, args) { - return args; + GetHelperReference.create = function create(sourceReference, pathReference) { + if (_glimmerReference.isConst(pathReference)) { + var parts = pathReference.value().split('.'); + return _glimmerReference.referenceFromParts(sourceReference, parts); + } else { + return new GetHelperReference(sourceReference, pathReference); + } }; - MountManager.prototype.create = function create(environment, _ref, args, dynamicScope) { - var name = _ref.name; - var env = _ref.env; + function GetHelperReference(sourceReference, pathReference) { + _CachedReference.call(this); + this.sourceReference = sourceReference; + this.pathReference = pathReference; - dynamicScope.outletState = _glimmerReference.UNDEFINED_REFERENCE; + this.lastPath = null; + this.innerReference = null; - var engine = env.owner.buildChildEngineInstance(name); + var innerTag = this.innerTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - engine.boot(); + this.tag = _glimmerReference.combine([sourceReference.tag, pathReference.tag, innerTag]); + } - return { engine: engine }; - }; + GetHelperReference.prototype.compute = function compute() { + var lastPath = this.lastPath; + var innerReference = this.innerReference; + var innerTag = this.innerTag; - MountManager.prototype.layoutFor = function layoutFor(definition, _ref2, env) { - var engine = _ref2.engine; + var path = this.lastPath = this.pathReference.value(); - var template = engine.lookup('template:application'); - return env.getCompiledBlock(_emberGlimmerSyntaxOutlet.OutletLayoutCompiler, template); - }; + if (path !== lastPath) { + if (path) { + var pathType = typeof path; - MountManager.prototype.getSelf = function getSelf(_ref3) { - var engine = _ref3.engine; + if (pathType === 'string') { + innerReference = this.innerReference = _glimmerReference.referenceFromParts(this.sourceReference, path.split('.')); + } else if (pathType === 'number') { + innerReference = this.innerReference = this.sourceReference.get(path); + } - var factory = engine._lookupFactory('controller:application') || _emberRouting.generateControllerFactory(engine, 'application'); - return new _emberGlimmerUtilsReferences.RootReference(factory.create()); - }; + innerTag.update(innerReference.tag); + } else { + innerReference = this.innerReference = null; + innerTag.update(_glimmerReference.CONSTANT_TAG); + } + } - MountManager.prototype.getTag = function getTag() { - return null; + return innerReference ? innerReference.value() : null; }; - MountManager.prototype.getDestructor = function getDestructor(_ref4) { - var engine = _ref4.engine; - - return engine; + GetHelperReference.prototype[_emberGlimmerUtilsReferences.UPDATE] = function (value) { + _emberMetal.set(this.sourceReference.value(), this.pathReference.value(), value); }; - MountManager.prototype.didCreateElement = function didCreateElement() {}; - - MountManager.prototype.didRenderLayout = function didRenderLayout() {}; - - MountManager.prototype.didCreate = function didCreate(state) {}; - - MountManager.prototype.update = function update(state, args, dynamicScope) {}; - - MountManager.prototype.didUpdateLayout = function didUpdateLayout() {}; - - MountManager.prototype.didUpdate = function didUpdate(state) {}; - - return MountManager; - })(); - - var MOUNT_MANAGER = new MountManager(); + return GetHelperReference; + })(_emberGlimmerUtilsReferences.CachedReference); +}); +enifed("ember-glimmer/helpers/hash", ["exports"], function (exports) { + /** + @module ember + @submodule ember-glimmer + */ - var MountDefinition = (function (_ComponentDefinition) { - babelHelpers.inherits(MountDefinition, _ComponentDefinition); + /** + Use the `{{hash}}` helper to create a hash to pass as an option to your + components. This is specially useful for contextual components where you can + just yield a hash: + + ```handlebars + {{yield (hash + name='Sarah' + title=office + )}} + ``` + + Would result in an object such as: + + ```js + { name: 'Sarah', title: this.get('office') } + ``` + + Where the `title` is bound to updates of the `office` property. + + @method hash + @for Ember.Templates.helpers + @param {Object} options + @return {Object} Hash + @since 2.3.0 + @public + */ - function MountDefinition(name, env) { - _ComponentDefinition.call(this, name, MOUNT_MANAGER, null); - this.env = env; - } + "use strict"; - return MountDefinition; - })(_glimmerRuntime.ComponentDefinition); + exports.default = function (vm, args) { + return args.named; + }; }); -enifed('ember-glimmer/syntax/outlet', ['exports', 'ember-utils', 'glimmer-runtime', 'ember-metal', 'ember-glimmer/utils/references', 'glimmer-reference'], function (exports, _emberUtils, _glimmerRuntime, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference) { +enifed('ember-glimmer/helpers/if-unless', ['exports', 'ember-metal', 'ember-glimmer/utils/references', '@glimmer/reference'], function (exports, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference) { /** @module ember @submodule ember-glimmer */ - 'use strict'; - - function outletComponentFor(vm) { - var _vm$dynamicScope = vm.dynamicScope(); - - var outletState = _vm$dynamicScope.outletState; - var args = vm.getArgs(); - var outletNameRef = undefined; - if (args.positional.length === 0) { - outletNameRef = new _glimmerReference.ConstReference('main'); - } else { - outletNameRef = args.positional.at(0); - } + 'use strict'; - return new OutletComponentReference(outletNameRef, outletState); - } + exports.inlineIf = inlineIf; + exports.inlineUnless = inlineUnless; /** - 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: + 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`, `NaN` or an empty array, the block will not be rendered. ```handlebars - {{! app/templates/application.hbs }} - - {{my-header}} -
    - - {{outlet}} -
    - - {{my-footer}} + {{! will not render if foo is falsey}} + {{#if foo}} + Welcome to the {{foo.bar}} + {{/if}} ``` - 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: + You can also specify a template to show if the property is falsey by using + the `else` helper. ```handlebars - {{outlet "menu"}} - {{outlet "sidebar"}} - {{outlet "main"}} + {{! is it raining outside?}} + {{#if isRaining}} + Yes, grab an umbrella! + {{else}} + No, it's lovely outside! + {{/if}} ``` - Your routes can then render into a specific one of these `outlet`s by specifying the `outlet` - attribute in your `renderTemplate` function: + You are also able to combine `else` and `if` helpers to create more complex + conditional logic. - ```javascript - // app/routes/menu.js - export default Ember.Route.extend({ - renderTemplate() { - this.render({ outlet: 'menu' }); - } - }); + ```handlebars + {{#if isMorning}} + Good morning + {{else if isAfternoon}} + Good afternoon + {{else}} + Good night + {{/if}} ``` - 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. + You can use `if` inline to conditionally render a single property or string. + This helper acts like a ternary operator. If the first property is truthy, + the second argument will be displayed, if not, the third argument will be + displayed - @method outlet - @param {String} [name] + ```handlebars + {{if useLongGreeting "Hello" "Hi"}} Dave + ``` + + Finally, you can use the `if` helper inside another helper as a subexpression. + + ```handlebars + {{some-component height=(if isBig "100" "10")}} + ``` + + @method if @for Ember.Templates.helpers @public */ - var OutletSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(OutletSyntax, _StatementSyntax); - - OutletSyntax.create = function create(environment, args, symbolTable) { - var definitionArgs = _glimmerRuntime.ArgsSyntax.fromPositionalArgs(args.positional.slice(0, 1)); - return new this(environment, definitionArgs, symbolTable); - }; + var ConditionalHelperReference = (function (_CachedReference) { + babelHelpers.inherits(ConditionalHelperReference, _CachedReference); - function OutletSyntax(environment, args, symbolTable) { - _StatementSyntax.call(this); - this.definitionArgs = args; - this.definition = outletComponentFor; - this.args = _glimmerRuntime.ArgsSyntax.empty(); - this.symbolTable = symbolTable; - this.shadow = null; - } + ConditionalHelperReference.create = function create(_condRef, _truthyRef, _falsyRef) { + var condRef = _emberGlimmerUtilsReferences.ConditionalReference.create(_condRef); + var truthyRef = _truthyRef || _emberGlimmerUtilsReferences.UNDEFINED_REFERENCE; + var falsyRef = _falsyRef || _emberGlimmerUtilsReferences.UNDEFINED_REFERENCE; - OutletSyntax.prototype.compile = function compile(builder) { - builder.component.dynamic(this.definitionArgs, this.definition, this.args, this.symbolTable, this.shadow); + if (_glimmerReference.isConst(condRef)) { + return condRef.value() ? truthyRef : falsyRef; + } else { + return new ConditionalHelperReference(condRef, truthyRef, falsyRef); + } }; - return OutletSyntax; - })(_glimmerRuntime.StatementSyntax); + function ConditionalHelperReference(cond, truthy, falsy) { + _CachedReference.call(this); - exports.OutletSyntax = OutletSyntax; + this.branchTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); + this.tag = _glimmerReference.combine([cond.tag, this.branchTag]); - var OutletComponentReference = (function () { - function OutletComponentReference(outletNameRef, parentOutletStateRef) { - this.outletNameRef = outletNameRef; - this.parentOutletStateRef = parentOutletStateRef; - this.definition = null; - this.lastState = null; - var outletStateTag = this.outletStateTag = new _glimmerReference.UpdatableTag(parentOutletStateRef.tag); - this.tag = _glimmerReference.combine([outletStateTag.tag, outletNameRef.tag]); + this.cond = cond; + this.truthy = truthy; + this.falsy = falsy; } - OutletComponentReference.prototype.value = function value() { - var outletNameRef = this.outletNameRef; - var parentOutletStateRef = this.parentOutletStateRef; - var definition = this.definition; - var lastState = this.lastState; - - var outletName = outletNameRef.value(); - var outletStateRef = parentOutletStateRef.get('outlets').get(outletName); - var newState = this.lastState = outletStateRef.value(); + /** + The inline `if` helper conditionally renders a single property or string. + This helper acts like a ternary operator. If the first property is truthy, + the second argument will be displayed, otherwise, the third argument will be + displayed + + ```handlebars + {{if useLongGreeting "Hello" "Hi"}} Alex + ``` + + You can use the `if` helper inside another helper as a subexpression. + + ```handlebars + {{some-component height=(if isBig "100" "10")}} + ``` + + @method if + @for Ember.Templates.helpers + @public + */ - this.outletStateTag.update(outletStateRef.tag); + ConditionalHelperReference.prototype.compute = function compute() { + var cond = this.cond; + var truthy = this.truthy; + var falsy = this.falsy; - definition = revalidate(definition, lastState, newState); + var branch = cond.value() ? truthy : falsy; - var hasTemplate = newState && newState.render.template; + this.branchTag.update(branch.tag); - if (definition) { - return definition; - } else if (hasTemplate) { - return this.definition = new OutletComponentDefinition(outletName, newState.render.template); - } else { - return this.definition = null; - } + return branch.value(); }; - return OutletComponentReference; - })(); - - function revalidate(definition, lastState, newState) { - if (!lastState && !newState) { - return definition; - } + return ConditionalHelperReference; + })(_emberGlimmerUtilsReferences.CachedReference); - if (!lastState && newState || lastState && !newState) { - return null; - } + function inlineIf(vm, _ref) { + var positional = _ref.positional; - if (newState.render.template === lastState.render.template && newState.render.controller === lastState.render.controller) { - return definition; + switch (positional.length) { + case 2: + return ConditionalHelperReference.create(positional.at(0), positional.at(1), null); + case 3: + return ConditionalHelperReference.create(positional.at(0), positional.at(1), positional.at(2)); + default: } - - return null; - } - - function instrumentationPayload(_ref) { - var _ref$render = _ref.render; - var name = _ref$render.name; - var outlet = _ref$render.outlet; - - return { object: name + ':' + outlet }; } - function NOOP() {} - - var StateBucket = (function () { - function StateBucket(outletState) { - this.outletState = outletState; - this.instrument(); - } - - StateBucket.prototype.instrument = function instrument() { - this.finalizer = _emberMetal._instrumentStart('render.outlet', instrumentationPayload, this.outletState); - }; - - StateBucket.prototype.finalize = function finalize() { - var finalizer = this.finalizer; - - finalizer(); - this.finalizer = NOOP; - }; - - return StateBucket; - })(); - - var OutletComponentManager = (function () { - function OutletComponentManager() {} - - OutletComponentManager.prototype.prepareArgs = function prepareArgs(definition, args) { - return args; - }; - - OutletComponentManager.prototype.create = function create(environment, definition, args, dynamicScope) { - var outletStateReference = dynamicScope.outletState = dynamicScope.outletState.get('outlets').get(definition.outletName); - var outletState = outletStateReference.value(); - return new StateBucket(outletState); - }; - - OutletComponentManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { - return env.getCompiledBlock(OutletLayoutCompiler, definition.template); - }; - - OutletComponentManager.prototype.getSelf = function getSelf(_ref2) { - var outletState = _ref2.outletState; - - return new _emberGlimmerUtilsReferences.RootReference(outletState.render.controller); - }; - - OutletComponentManager.prototype.getTag = function getTag() { - return null; - }; - - OutletComponentManager.prototype.getDestructor = function getDestructor() { - return null; - }; - - OutletComponentManager.prototype.didRenderLayout = function didRenderLayout(bucket) { - bucket.finalize(); - }; - - OutletComponentManager.prototype.didCreateElement = function didCreateElement() {}; - - OutletComponentManager.prototype.didCreate = function didCreate(state) {}; - - OutletComponentManager.prototype.update = function update(bucket) {}; - - OutletComponentManager.prototype.didUpdateLayout = function didUpdateLayout(bucket) {}; - - OutletComponentManager.prototype.didUpdate = function didUpdate(state) {}; - - return OutletComponentManager; - })(); - - var MANAGER = new OutletComponentManager(); - - var TopLevelOutletComponentManager = (function (_OutletComponentManager) { - babelHelpers.inherits(TopLevelOutletComponentManager, _OutletComponentManager); - - function TopLevelOutletComponentManager() { - _OutletComponentManager.apply(this, arguments); - } - - TopLevelOutletComponentManager.prototype.create = function create(environment, definition, args, dynamicScope) { - return new StateBucket(dynamicScope.outletState.value()); - }; - - TopLevelOutletComponentManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { - return env.getCompiledBlock(TopLevelOutletLayoutCompiler, definition.template); - }; - - return TopLevelOutletComponentManager; - })(OutletComponentManager); - - var TOP_LEVEL_MANAGER = new TopLevelOutletComponentManager(); - - var TopLevelOutletComponentDefinition = (function (_ComponentDefinition) { - babelHelpers.inherits(TopLevelOutletComponentDefinition, _ComponentDefinition); - - function TopLevelOutletComponentDefinition(instance) { - _ComponentDefinition.call(this, 'outlet', TOP_LEVEL_MANAGER, instance); - this.template = instance.template; - _emberUtils.generateGuid(this); - } - - return TopLevelOutletComponentDefinition; - })(_glimmerRuntime.ComponentDefinition); + /** + The inline `unless` helper conditionally renders a single property or string. + This helper acts like a ternary operator. If the first property is falsy, + the second argument will be displayed, otherwise, the third argument will be + displayed + + ```handlebars + {{unless useLongGreeting "Hi" "Hello"}} Ben + ``` + + You can use the `unless` helper inside another helper as a subexpression. + + ```handlebars + {{some-component height=(unless isBig "10" "100")}} + ``` + + @method unless + @for Ember.Templates.helpers + @public + */ - exports.TopLevelOutletComponentDefinition = TopLevelOutletComponentDefinition; + function inlineUnless(vm, _ref2) { + var positional = _ref2.positional; - var TopLevelOutletLayoutCompiler = (function () { - function TopLevelOutletLayoutCompiler(template) { - this.template = template; + switch (positional.length) { + case 2: + return ConditionalHelperReference.create(positional.at(0), null, positional.at(1)); + case 3: + return ConditionalHelperReference.create(positional.at(0), positional.at(2), positional.at(1)); + default: } + } +}); +enifed('ember-glimmer/helpers/loc', ['exports', 'ember-glimmer/utils/references', 'ember-runtime'], function (exports, _emberGlimmerUtilsReferences, _emberRuntime) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; - TopLevelOutletLayoutCompiler.prototype.compile = function compile(builder) { - builder.wrapLayout(this.template.asLayout()); - builder.tag.static('div'); - builder.attrs.static('id', _emberUtils.guidFor(this)); - builder.attrs.static('class', 'ember-view'); + /** + Calls [Ember.String.loc](/api/classes/Ember.String.html#method_loc) with the + provided string. This is a convenient way to localize text within a template. + For example: + + ```javascript + Ember.STRINGS = { + '_welcome_': 'Bonjour' }; + ``` + + ```handlebars +
    + {{loc '_welcome_'}} +
    + ``` + + ```html +
    + Bonjour +
    + ``` + + See [Ember.String.loc](/api/classes/Ember.String.html#method_loc) for how to + set up localized string references. + + @method loc + @for Ember.Templates.helpers + @param {String} str The string to format. + @see {Ember.String#loc} + @public + */ + function locHelper(_ref) { + var positional = _ref.positional; - return TopLevelOutletLayoutCompiler; - })(); - - TopLevelOutletLayoutCompiler.id = 'top-level-outlet'; - - var OutletComponentDefinition = (function (_ComponentDefinition2) { - babelHelpers.inherits(OutletComponentDefinition, _ComponentDefinition2); - - function OutletComponentDefinition(outletName, template) { - _ComponentDefinition2.call(this, 'outlet', MANAGER, null); - this.outletName = outletName; - this.template = template; - _emberUtils.generateGuid(this); - } - - return OutletComponentDefinition; - })(_glimmerRuntime.ComponentDefinition); - - var OutletLayoutCompiler = (function () { - function OutletLayoutCompiler(template) { - this.template = template; - } + return _emberRuntime.String.loc.apply(null, positional.value()); + } - OutletLayoutCompiler.prototype.compile = function compile(builder) { - builder.wrapLayout(this.template.asLayout()); - }; + exports.default = function (vm, args) { + return new _emberGlimmerUtilsReferences.InternalHelperReference(locHelper, args); + }; +}); +enifed('ember-glimmer/helpers/log', ['exports', 'ember-glimmer/utils/references', 'ember-console'], function (exports, _emberGlimmerUtilsReferences, _emberConsole) { + 'use strict'; - return OutletLayoutCompiler; - })(); + /** + `log` allows you to output the value of variables in the current rendering + context. `log` also accepts primitive types such as strings or numbers. + + ```handlebars + {{log "myVariable:" myVariable }} + ``` + + @method log + @for Ember.Templates.helpers + @param {Array} params + @public + */ + function log(_ref) { + var positional = _ref.positional; - exports.OutletLayoutCompiler = OutletLayoutCompiler; + _emberConsole.default.log.apply(null, positional.value()); + } - OutletLayoutCompiler.id = 'outlet'; + exports.default = function (vm, args) { + return new _emberGlimmerUtilsReferences.InternalHelperReference(log, args); + }; }); -enifed('ember-glimmer/syntax/render', ['exports', 'glimmer-runtime', 'glimmer-reference', 'ember-metal', 'ember-glimmer/utils/references', 'ember-routing', 'ember-glimmer/syntax/outlet'], function (exports, _glimmerRuntime, _glimmerReference, _emberMetal, _emberGlimmerUtilsReferences, _emberRouting, _emberGlimmerSyntaxOutlet) { + +/** +@module ember +@submodule ember-glimmer +*/ +enifed('ember-glimmer/helpers/mut', ['exports', 'ember-utils', 'ember-metal', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/action'], function (exports, _emberUtils, _emberMetal, _emberGlimmerUtilsReferences, _emberGlimmerHelpersAction) { /** @module ember @submodule ember-glimmer */ 'use strict'; - function makeComponentDefinition(vm) { - var env = vm.env; - var args = vm.getArgs(); - var nameRef = args.positional.at(0); - - var templateName = nameRef.value(); - - var template = env.owner.lookup('template:' + templateName); - - var controllerName = undefined; - - if (args.named.has('controller')) { - var controllerNameRef = args.named.get('controller'); - - controllerName = controllerNameRef.value(); - } else { - controllerName = templateName; - } - - if (args.positional.length === 1) { - return new _glimmerReference.ConstReference(new RenderDefinition(controllerName, template, env, SINGLETON_RENDER_MANAGER)); - } else { - return new _glimmerReference.ConstReference(new RenderDefinition(controllerName, template, env, NON_SINGLETON_RENDER_MANAGER)); - } - } + exports.isMut = isMut; + exports.unMut = unMut; /** - Calling ``{{render}}`` from within a template will insert another - template that matches the provided name. The inserted template will - access its properties on its own controller (rather than the controller - of the parent template). + 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 component__. - If a view class with the same name exists, the view class also will be used. - Note: A given controller may only be used *once* in your app in this manner. - A singleton instance of the controller will be created for you. + To specify that a parameter is mutable, when invoking the child `Component`: - Example: + ```handlebars + {{my-child childClickCount=(mut totalClicks)}} + ``` + + The child `Component` can then modify the parent's value just by modifying its own + property: ```javascript - App.NavigationController = Ember.Controller.extend({ - who: "world" + // my-child.js + export default Component.extend({ + click() { + this.incrementProperty('childClickCount'); + } }); ``` - ```handlebars - - Hello, {{who}}. - ``` + Note that for curly components (`{{my-component}}`) the bindings are already mutable, + making the `mut` unnecessary. + + Additionally, the `mut` helper can be combined with the `action` helper to + mutate a value. For example: ```handlebars - -

    My great app

    - {{render "navigation"}} + {{my-child childClickCount=totalClicks click-count-change=(action (mut totalClicks))}} ``` - ```html -

    My great app

    -
    - Hello, world. -
    + The child `Component` would invoke the action with the new click value: + + ```javascript + // my-child.js + export default Component.extend({ + click() { + this.get('click-count-change')(this.get('childClickCount') + 1); + } + }); ``` - Optionally you may provide a second argument: a property path - that will be bound to the `model` property of the controller. - If a `model` property path is specified, then a new instance of the - controller will be created and `{{render}}` can be used multiple times - with the same name. + The `mut` helper changes the `totalClicks` value to what was provided as the action argument. - For example if you had this `author` template. + The `mut` helper, when used with `action`, will return a function that + sets the value passed to `mut` to its first argument. This works like any other + closure action and interacts with the other features `action` provides. + As an example, we can create a button that increments a value passing the value + directly to the `action`: ```handlebars -
    - Written by {{firstName}} {{lastName}}. - Total Posts: {{postCount}} -
    + {{! inc helper is not provided by Ember }} + ``` - You could render it inside the `post` template using the `render` helper. + You can also use the `value` option: ```handlebars -
    -

    {{title}}

    -
    {{body}}
    - {{render "author" author}} -
    + ``` - @method render + @method mut + @param {Object} [attr] the "two-way" attribute that can be modified. @for Ember.Templates.helpers - @param {String} name - @param {Object?} context - @param {Hash} options - @return {String} HTML string @public */ + var MUT_REFERENCE = _emberUtils.symbol('MUT'); + var SOURCE = _emberUtils.symbol('SOURCE'); - var RenderSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(RenderSyntax, _StatementSyntax); - - RenderSyntax.create = function create(environment, args, symbolTable) { - return new this(environment, args, symbolTable); - }; + function isMut(ref) { + return ref && ref[MUT_REFERENCE]; + } - function RenderSyntax(environment, args, symbolTable) { - _StatementSyntax.call(this); - this.definitionArgs = args; - this.definition = makeComponentDefinition; - this.args = _glimmerRuntime.ArgsSyntax.fromPositionalArgs(args.positional.slice(1, 2)); - this.symbolTable = symbolTable; - this.shadow = null; - } + function unMut(ref) { + return ref[SOURCE] || ref; + } - RenderSyntax.prototype.compile = function compile(builder) { - builder.component.dynamic(this.definitionArgs, this.definition, this.args, this.symbolTable, this.shadow); - }; + exports.default = function (vm, args) { + var rawRef = args.positional.at(0); - return RenderSyntax; - })(_glimmerRuntime.StatementSyntax); + if (isMut(rawRef)) { + return rawRef; + } - exports.RenderSyntax = RenderSyntax; + // TODO: Improve this error message. This covers at least two distinct + // cases: + // + // 1. (mut "not a path") – passing a literal, result from a helper + // invocation, etc + // + // 2. (mut receivedValue) – passing a value received from the caller + // that was originally derived from a literal, result from a helper + // invocation, etc + // + // This message is alright for the first case, but could be quite + // confusing for the second case. - var AbstractRenderManager = (function () { - function AbstractRenderManager() {} + var wrappedRef = Object.create(rawRef); - AbstractRenderManager.prototype.prepareArgs = function prepareArgs(definition, args) { - return args; - }; + wrappedRef[SOURCE] = rawRef; + wrappedRef[_emberGlimmerHelpersAction.INVOKE] = rawRef[_emberGlimmerUtilsReferences.UPDATE]; + wrappedRef[MUT_REFERENCE] = true; - /* abstract create(environment, definition, args, dynamicScope); */ + return wrappedRef; + }; +}); +enifed('ember-glimmer/helpers/query-param', ['exports', 'ember-utils', 'ember-glimmer/utils/references', 'ember-metal', 'ember-routing'], function (exports, _emberUtils, _emberGlimmerUtilsReferences, _emberMetal, _emberRouting) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; - AbstractRenderManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { - return env.getCompiledBlock(_emberGlimmerSyntaxOutlet.OutletLayoutCompiler, definition.template); - }; + /** + This is a helper to be used in conjunction with the link-to helper. + It will supply url query parameters to the target route. + + Example + + ```handlebars + {{#link-to 'posts' (query-params direction="asc")}}Sort{{/link-to}} + ``` + + @method query-params + @for Ember.Templates.helpers + @param {Object} hash takes a hash of query parameters + @return {Object} A `QueryParams` object for `{{link-to}}` + @public + */ + function queryParams(_ref) { + var positional = _ref.positional; + var named = _ref.named; - AbstractRenderManager.prototype.getSelf = function getSelf(_ref) { - var controller = _ref.controller; + return _emberRouting.QueryParams.create({ + values: _emberUtils.assign({}, named.value()) + }); + } - return new _emberGlimmerUtilsReferences.RootReference(controller); - }; + exports.default = function (vm, args) { + return new _emberGlimmerUtilsReferences.InternalHelperReference(queryParams, args); + }; +}); +enifed('ember-glimmer/helpers/readonly', ['exports', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/mut'], function (exports, _emberGlimmerUtilsReferences, _emberGlimmerHelpersMut) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; - AbstractRenderManager.prototype.getTag = function getTag() { - return null; - }; + /** + The `readonly` helper let's you specify that a binding is one-way only, + instead of two-way. + When you pass a `readonly` binding from an outer context (e.g. parent component), + to to an inner context (e.g. child component), you are saying that changing that + property in the inner context does not change the value in the outer context. + + To specify that a binding is read-only, when invoking the child `Component`: + + ```app/components/my-parent.js + export default Component.extend({ + totalClicks: 3 + }); + ``` + + ```app/templates/components/my-parent.hbs + {{log totalClicks}} // -> 3 + {{my-child childClickCount=(readonly totalClicks)}} + ``` + + Now, when you update `childClickCount`: + + ```app/components/my-child.js + export default Component.extend({ + click() { + this.incrementProperty('childClickCount'); + } + }); + ``` + + The value updates in the child component, but not the parent component: + + ```app/templates/components/my-child.hbs + {{log childClickCount}} //-> 4 + ``` + + ```app/templates/components/my-parent.hbs + {{log totalClicks}} //-> 3 + {{my-child childClickCount=(readonly totalClicks)}} + ``` + + ### Objects and Arrays + + When passing a property that is a complex object (e.g. object, array) instead of a primitive object (e.g. number, string), + only the reference to the object is protected using the readonly helper. + This means that you can change properties of the object both on the parent component, as well as the child component. + The `readonly` binding behaves similar to the `const` keyword in JavaScript. + + Let's look at an example: + + First let's set up the parent component: + + ```app/components/my-parent.js + export default Ember.Component.extend({ + clicks: null, + + init() { + this._super(...arguments); + this.set('clicks', { total: 3 }); + } + }); + ``` + + ```app/templates/components/my-parent.hbs + {{log clicks.total}} //-> 3 + {{my-child childClicks=(readonly clicks)}} + ``` + + Now, if you update the `total` property of `childClicks`: + + ```app/components/my-child.js + export default Ember.Component.extend({ + click() { + this.get('clicks').incrementProperty('total'); + } + }); + ``` + + You will see the following happen: + + ```app/templates/components/my-parent.hbs + {{log clicks.total}} //-> 4 + {{my-child childClicks=(readonly clicks)}} + ``` + + ```app/templates/components/my-child.hbs + {{log childClicks.total}} //-> 4 + ``` + + @method readonly + @param {Object} [attr] the read-only attribute. + @for Ember.Templates.helpers + @private + */ - AbstractRenderManager.prototype.getDestructor = function getDestructor() { - return null; - }; + exports.default = function (vm, args) { + var ref = _emberGlimmerHelpersMut.unMut(args.positional.at(0)); - AbstractRenderManager.prototype.didCreateElement = function didCreateElement() {}; + var wrapped = Object.create(ref); - AbstractRenderManager.prototype.didRenderLayout = function didRenderLayout() {}; + wrapped[_emberGlimmerUtilsReferences.UPDATE] = undefined; - AbstractRenderManager.prototype.didCreate = function didCreate() {}; + return wrapped; + }; +}); +enifed('ember-glimmer/helpers/unbound', ['exports', 'ember-metal', 'ember-glimmer/utils/references'], function (exports, _emberMetal, _emberGlimmerUtilsReferences) { + /** + @module ember + @submodule ember-glimmer + */ - AbstractRenderManager.prototype.update = function update() {}; + 'use strict'; - AbstractRenderManager.prototype.didUpdateLayout = function didUpdateLayout() {}; + /** + 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 + */ - AbstractRenderManager.prototype.didUpdate = function didUpdate() {}; + exports.default = function (vm, args) { - return AbstractRenderManager; - })(); + return _emberGlimmerUtilsReferences.UnboundReference.create(args.positional.at(0).value()); + }; +}); +enifed('ember-glimmer/index', ['exports', 'ember-glimmer/helpers/action', 'ember-glimmer/templates/root', 'ember-glimmer/template', 'ember-glimmer/components/checkbox', 'ember-glimmer/components/text_field', 'ember-glimmer/components/text_area', 'ember-glimmer/components/link-to', 'ember-glimmer/component', 'ember-glimmer/helper', 'ember-glimmer/environment', 'ember-glimmer/make-bound-helper', 'ember-glimmer/utils/string', 'ember-glimmer/renderer', 'ember-glimmer/template_registry', 'ember-glimmer/setup-registry', 'ember-glimmer/dom'], function (exports, _emberGlimmerHelpersAction, _emberGlimmerTemplatesRoot, _emberGlimmerTemplate, _emberGlimmerComponentsCheckbox, _emberGlimmerComponentsText_field, _emberGlimmerComponentsText_area, _emberGlimmerComponentsLinkTo, _emberGlimmerComponent, _emberGlimmerHelper, _emberGlimmerEnvironment, _emberGlimmerMakeBoundHelper, _emberGlimmerUtilsString, _emberGlimmerRenderer, _emberGlimmerTemplate_registry, _emberGlimmerSetupRegistry, _emberGlimmerDom) { + /** + [Glimmer](https://github.com/tildeio/glimmer) is a [Handlebars](http://handlebarsjs.com/) + compatible templating engine used by Ember.js. + 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}} +
    {{name}}
    + + ``` + + Any time the "name" property on the component changes, the DOM will be + updated. + + Properties can be chained as well: + + ```handlebars + {{aUserModel.name}} +
    {{listOfUsers.firstObject.name}}
    + ``` + + ### 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"}} + + ``` + + 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 + + ``` + + 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-glimmer + @main ember-glimmer + @public + */ - var SingletonRenderManager = (function (_AbstractRenderManager) { - babelHelpers.inherits(SingletonRenderManager, _AbstractRenderManager); + /** + 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 + `{{with}}` block. + + If the aliased property is "falsey", for example: `false`, `undefined` `null`, `""`, `0`, NaN or + an empty array, the block will not be rendered. + + ```handlebars + {{! Will only render if user.posts contains items}} + {{#with user.posts as |blogPosts|}} +
    + There are {{blogPosts.length}} blog posts written by {{user.name}}. +
    + {{#each blogPosts as |post|}} +
  • {{post.title}}
  • + {{/each}} + {{/with}} + ``` + + Without the `as` operator, it would be impossible to reference `user.name` in the example above. + + NOTE: The alias should not reuse a name from the bound property path. + + For example: `{{#with foo.bar as |foo|}}` is not supported because it attempts to alias using + the first part of the property path, `foo`. Instead, use `{{#with foo.bar as |baz|}}`. + + @method with + @for Ember.Templates.helpers + @param {Object} options + @return {String} HTML string + @public + */ - function SingletonRenderManager() { - _AbstractRenderManager.apply(this, arguments); - } + /** + Execute the `debugger` statement in the current template's context. + + ```handlebars + {{debugger}} + ``` + + When using the debugger helper you will have access to a `get` function. This + function retrieves values available in the context of the template. + For example, if you're wondering why a value `{{foo}}` isn't rendering as + expected within a template, you could place a `{{debugger}}` statement and, + when the `debugger;` breakpoint is hit, you can attempt to retrieve this value: + + ``` + > get('foo') + ``` + + `get` is also aware of keywords. So in this situation + + ```handlebars + {{#each items as |item|}} + {{debugger}} + {{/each}} + ``` + + You'll be able to get values from the current item: + + ``` + > get('item.name') + ``` + + You can also access the context of the view to make sure it is the object that + you expect: + + ``` + > context + ``` + + @method debugger + @for Ember.Templates.helpers + @public + */ - SingletonRenderManager.prototype.create = function create(environment, definition, args, dynamicScope) { - var name = definition.name; - var env = definition.env; + /** + The `partial` helper renders another template without + changing the template context: + + ```handlebars + {{foo}} + {{partial "nav"}} + ``` + + The above example template will render a template named + "-nav", which has the same context as the parent template + it's rendered into, so if the "-nav" template also referenced + `{{foo}}`, it would print the same thing as the `{{foo}}` + in the above example. + + If a "-nav" template isn't found, the `partial` helper will + fall back to a template named "nav". + + ### Bound template names + + The parameter supplied to `partial` can also be a path + to a property containing a template name, e.g.: + + ```handlebars + {{partial someTemplateName}} + ``` + + The above example will look up the value of `someTemplateName` + on the template context (e.g. a controller) and use that + value as the name of the template to render. If the resolved + value is falsy, nothing will be rendered. If `someTemplateName` + changes, the partial will be re-rendered using the new template + name. + + @method partial + @for Ember.Templates.helpers + @param {String} partialName The name of the template to render minus the leading underscore. + @public + */ - var controller = env.owner.lookup('controller:' + name) || _emberRouting.generateController(env.owner, name); + 'use strict'; - if (dynamicScope.rootOutletState) { - dynamicScope.outletState = dynamicScope.rootOutletState.getOrphan(name); - } + exports.INVOKE = _emberGlimmerHelpersAction.INVOKE; + exports.RootTemplate = _emberGlimmerTemplatesRoot.default; + exports.template = _emberGlimmerTemplate.default; + exports.Checkbox = _emberGlimmerComponentsCheckbox.default; + exports.TextField = _emberGlimmerComponentsText_field.default; + exports.TextArea = _emberGlimmerComponentsText_area.default; + exports.LinkComponent = _emberGlimmerComponentsLinkTo.default; + exports.Component = _emberGlimmerComponent.default; + exports.Helper = _emberGlimmerHelper.default; + exports.helper = _emberGlimmerHelper.helper; + exports.Environment = _emberGlimmerEnvironment.default; + exports.makeBoundHelper = _emberGlimmerMakeBoundHelper.default; + exports.SafeString = _emberGlimmerUtilsString.SafeString; + exports.escapeExpression = _emberGlimmerUtilsString.escapeExpression; + exports.htmlSafe = _emberGlimmerUtilsString.htmlSafe; + exports.isHTMLSafe = _emberGlimmerUtilsString.isHTMLSafe; + exports._getSafeString = _emberGlimmerUtilsString.getSafeString; + exports.Renderer = _emberGlimmerRenderer.Renderer; + exports.InertRenderer = _emberGlimmerRenderer.InertRenderer; + exports.InteractiveRenderer = _emberGlimmerRenderer.InteractiveRenderer; + exports.getTemplate = _emberGlimmerTemplate_registry.getTemplate; + exports.setTemplate = _emberGlimmerTemplate_registry.setTemplate; + exports.hasTemplate = _emberGlimmerTemplate_registry.hasTemplate; + exports.getTemplates = _emberGlimmerTemplate_registry.getTemplates; + exports.setTemplates = _emberGlimmerTemplate_registry.setTemplates; + exports.setupEngineRegistry = _emberGlimmerSetupRegistry.setupEngineRegistry; + exports.setupApplicationRegistry = _emberGlimmerSetupRegistry.setupApplicationRegistry; + exports.DOMChanges = _emberGlimmerDom.DOMChanges; + exports.NodeDOMTreeConstruction = _emberGlimmerDom.NodeDOMTreeConstruction; + exports.DOMTreeConstruction = _emberGlimmerDom.DOMTreeConstruction; +}); +enifed('ember-glimmer/make-bound-helper', ['exports', 'ember-metal', 'ember-glimmer/helper'], function (exports, _emberMetal, _emberGlimmerHelper) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; - return { controller: controller }; - }; + exports.default = makeBoundHelper; - return SingletonRenderManager; - })(AbstractRenderManager); + /** + 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 + value and any changes to the bound property cause the helper function to be re-run with the updated + values. + + * `params` - An array of resolved ordered parameters. + * `hash` - An object containing the hash parameters. + + For example: + + * With an unquoted ordered parameter: + + ```javascript + {{x-capitalize foo}} + ``` + + Assuming `foo` was set to `"bar"`, the bound helper would receive `["bar"]` as its first argument, and + an empty hash as its second. + + * With a quoted ordered parameter: + + ```javascript + {{x-capitalize "foo"}} + ``` + + The bound helper would receive `["foo"]` as its first argument, and an empty hash as its second. + + * With an unquoted hash parameter: + + ```javascript + {{x-repeat "foo" count=repeatCount}} + ``` + + Assuming that `repeatCount` resolved to 2, the bound helper would receive `["foo"]` as its first argument, + and { count: 2 } as its second. + + @private + @method makeBoundHelper + @for Ember.HTMLBars + @param {Function} fn + @since 1.10.0 + */ - var SINGLETON_RENDER_MANAGER = new SingletonRenderManager(); + function makeBoundHelper(fn) { + return _emberGlimmerHelper.helper(fn); + } +}); +enifed('ember-glimmer/modifiers/action', ['exports', 'ember-utils', 'ember-metal', 'ember-views', 'ember-glimmer/helpers/action'], function (exports, _emberUtils, _emberMetal, _emberViews, _emberGlimmerHelpersAction) { + 'use strict'; - var NonSingletonRenderManager = (function (_AbstractRenderManager2) { - babelHelpers.inherits(NonSingletonRenderManager, _AbstractRenderManager2); + var MODIFIERS = ['alt', 'shift', 'meta', 'ctrl']; + var POINTER_EVENT_TYPE_REGEX = /^click|mouse|touch/; - function NonSingletonRenderManager() { - _AbstractRenderManager2.apply(this, arguments); + function isAllowedEvent(event, allowedKeys) { + if (allowedKeys === null || typeof allowedKeys === 'undefined') { + if (POINTER_EVENT_TYPE_REGEX.test(event.type)) { + return _emberViews.isSimpleClick(event); + } else { + allowedKeys = ''; + } } - NonSingletonRenderManager.prototype.create = function create(environment, definition, args, dynamicScope) { - var name = definition.name; - var env = definition.env; - - var modelRef = args.positional.at(0); - - var factory = env.owner._lookupFactory('controller:' + name) || _emberRouting.generateControllerFactory(env.owner, name); - var controller = factory.create({ model: modelRef.value() }); + if (allowedKeys.indexOf('any') >= 0) { + return true; + } - if (dynamicScope.rootOutletState) { - dynamicScope.outletState = dynamicScope.rootOutletState.getOrphan(name); + for (var i = 0; i < MODIFIERS.length; i++) { + if (event[MODIFIERS[i] + 'Key'] && allowedKeys.indexOf(MODIFIERS[i]) === -1) { + return false; } + } - return { controller: controller }; - }; + return true; + } - NonSingletonRenderManager.prototype.update = function update(_ref2, args, dynamicScope) { - var controller = _ref2.controller; + var ActionHelper = { + // registeredActions is re-exported for compatibility with older plugins + // that were using this undocumented API. + registeredActions: _emberViews.ActionManager.registeredActions, - controller.set('model', args.positional.at(0).value()); - }; + registerAction: function (actionState) { + var actionId = actionState.actionId; - NonSingletonRenderManager.prototype.getDestructor = function getDestructor(_ref3) { - var controller = _ref3.controller; + _emberViews.ActionManager.registeredActions[actionId] = actionState; - return controller; - }; + return actionId; + }, - return NonSingletonRenderManager; - })(AbstractRenderManager); - - var NON_SINGLETON_RENDER_MANAGER = new NonSingletonRenderManager(); + unregisterAction: function (actionState) { + var actionId = actionState.actionId; - var RenderDefinition = (function (_ComponentDefinition) { - babelHelpers.inherits(RenderDefinition, _ComponentDefinition); + delete _emberViews.ActionManager.registeredActions[actionId]; + } + }; - function RenderDefinition(name, template, env, manager) { - _ComponentDefinition.call(this, 'render', manager, null); + exports.ActionHelper = ActionHelper; - this.name = name; - this.template = template; - this.env = env; + var ActionState = (function () { + function ActionState(element, actionId, actionName, actionArgs, namedArgs, positionalArgs, implicitTarget, dom) { + this.element = element; + this.actionId = actionId; + this.actionName = actionName; + this.actionArgs = actionArgs; + this.namedArgs = namedArgs; + this.positional = positionalArgs; + this.implicitTarget = implicitTarget; + this.dom = dom; + this.eventName = this.getEventName(); } - return RenderDefinition; - })(_glimmerRuntime.ComponentDefinition); -}); -enifed('ember-glimmer/template', ['exports', 'ember-utils', 'glimmer-runtime'], function (exports, _emberUtils, _glimmerRuntime) { - 'use strict'; + // implements ModifierManager - exports.default = template; + ActionState.prototype.getEventName = function getEventName() { + return this.namedArgs.get('on').value() || 'click'; + }; - function template(json) { - var factory = _glimmerRuntime.templateFactory(json); + ActionState.prototype.getActionArgs = function getActionArgs() { + var result = new Array(this.actionArgs.length); - return { - id: factory.id, - meta: factory.meta, - create: function (props) { - return factory.create(props.env, { owner: props[_emberUtils.OWNER] }); + for (var i = 0; i < this.actionArgs.length; i++) { + result[i] = this.actionArgs[i].value(); } + + return result; }; - } -}); -enifed("ember-glimmer/template_registry", ["exports"], function (exports) { - // STATE within a module is frowned apon, this exists - // to support Ember.TEMPLATES but shield ember internals from this legacy - // global API. - "use strict"; - exports.setTemplates = setTemplates; - exports.getTemplates = getTemplates; - exports.getTemplate = getTemplate; - exports.hasTemplate = hasTemplate; - exports.setTemplate = setTemplate; - var TEMPLATES = {}; + ActionState.prototype.getTarget = function getTarget() { + var implicitTarget = this.implicitTarget; + var namedArgs = this.namedArgs; - function setTemplates(templates) { - TEMPLATES = templates; - } + var target = undefined; - function getTemplates() { - return TEMPLATES; - } + if (namedArgs.has('target')) { + target = namedArgs.get('target').value(); + } else { + target = implicitTarget.value(); + } - function getTemplate(name) { - if (TEMPLATES.hasOwnProperty(name)) { - return TEMPLATES[name]; - } - } + return target; + }; - function hasTemplate(name) { - return TEMPLATES.hasOwnProperty(name); - } + ActionState.prototype.handler = function handler(event) { + var _this = this; - function setTemplate(name, template) { - return TEMPLATES[name] = template; - } -}); -enifed("ember-glimmer/templates/component", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { - "use strict"; + var actionName = this.actionName; + var namedArgs = this.namedArgs; - exports.default = _emberGlimmerTemplate.default({ "id": "ZoGfVsSJ", "block": "{\"statements\":[[\"yield\",\"default\"]],\"locals\":[],\"named\":[],\"yields\":[\"default\"],\"blocks\":[],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/component.hbs" } }); -}); -enifed("ember-glimmer/templates/empty", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { - "use strict"; + var bubbles = namedArgs.get('bubbles'); + var preventDefault = namedArgs.get('preventDefault'); + var allowedKeys = namedArgs.get('allowedKeys'); + var target = this.getTarget(); - exports.default = _emberGlimmerTemplate.default({ "id": "qEHL4OLi", "block": "{\"statements\":[],\"locals\":[],\"named\":[],\"yields\":[],\"blocks\":[],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/empty.hbs" } }); -}); -enifed("ember-glimmer/templates/link-to", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { - "use strict"; + if (!isAllowedEvent(event, allowedKeys.value())) { + return true; + } - exports.default = _emberGlimmerTemplate.default({ "id": "Ca7iQMR7", "block": "{\"statements\":[[\"block\",[\"if\"],[[\"get\",[\"linkTitle\"]]],null,1,0]],\"locals\":[],\"named\":[],\"yields\":[\"default\"],\"blocks\":[{\"statements\":[[\"yield\",\"default\"]],\"locals\":[]},{\"statements\":[[\"append\",[\"unknown\",[\"linkTitle\"]],false]],\"locals\":[]}],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/link-to.hbs" } }); -}); -enifed("ember-glimmer/templates/outlet", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { - "use strict"; + if (preventDefault.value() !== false) { + event.preventDefault(); + } - exports.default = _emberGlimmerTemplate.default({ "id": "sYQo9vi/", "block": "{\"statements\":[[\"append\",[\"unknown\",[\"outlet\"]],false]],\"locals\":[],\"named\":[],\"yields\":[],\"blocks\":[],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/outlet.hbs" } }); -}); -enifed("ember-glimmer/templates/root", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { - "use strict"; + if (bubbles.value() === false) { + event.stopPropagation(); + } - exports.default = _emberGlimmerTemplate.default({ "id": "Eaf3RPY3", "block": "{\"statements\":[[\"append\",[\"helper\",[\"component\"],[[\"get\",[null]]],null],false]],\"locals\":[],\"named\":[],\"yields\":[],\"blocks\":[],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/root.hbs" } }); -}); -enifed('ember-glimmer/utils/bindings', ['exports', 'glimmer-reference', 'glimmer-runtime', 'ember-metal', 'ember-runtime', 'ember-glimmer/component', 'ember-glimmer/utils/string'], function (exports, _glimmerReference, _glimmerRuntime, _emberMetal, _emberRuntime, _emberGlimmerComponent, _emberGlimmerUtilsString) { - 'use strict'; + _emberMetal.run(function () { + var args = _this.getActionArgs(); + var payload = { + args: args, + target: target + }; + if (typeof actionName[_emberGlimmerHelpersAction.INVOKE] === 'function') { + _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { + actionName[_emberGlimmerHelpersAction.INVOKE].apply(actionName, args); + }); + return; + } + if (typeof actionName === 'function') { + _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { + actionName.apply(target, args); + }); + return; + } + payload.name = actionName; + if (target.send) { + _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { + target.send.apply(target, [actionName].concat(args)); + }); + } else { + _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { + target[actionName].apply(target, args); + }); + } + }); + }; - exports.wrapComponentClassAttribute = wrapComponentClassAttribute; + ActionState.prototype.destroy = function destroy() { + ActionHelper.unregisterAction(this); + }; - function referenceForKey(component, key) { - return component[_emberGlimmerComponent.ROOT_REF].get(key); - } + return ActionState; + })(); - function referenceForParts(component, parts) { - var isAttrs = parts[0] === 'attrs'; + exports.ActionState = ActionState; - // TODO deprecate this - if (isAttrs) { - parts.shift(); + var ActionModifierManager = (function () { + function ActionModifierManager() {} - if (parts.length === 1) { - return referenceForKey(component, parts[0]); - } - } + ActionModifierManager.prototype.create = function create(element, args, dynamicScope, dom) { + var named = args.named; + var positional = args.positional; - return _glimmerReference.referenceFromParts(component[_emberGlimmerComponent.ROOT_REF], parts); - } + var implicitTarget = undefined; + var actionName = undefined; + var actionNameRef = undefined; + if (positional.length > 1) { + implicitTarget = positional.at(0); + actionNameRef = positional.at(1); - // TODO we should probably do this transform at build time + if (actionNameRef[_emberGlimmerHelpersAction.INVOKE]) { + actionName = actionNameRef; + } else { + var actionLabel = actionNameRef._propertyKey; + actionName = actionNameRef.value(); + } + } - function wrapComponentClassAttribute(args) { - var named = args.named; + var actionArgs = []; + // The first two arguments are (1) `this` and (2) the action name. + // Everything else is a param. + for (var i = 2; i < positional.length; i++) { + actionArgs.push(positional.at(i)); + } - var index = named.keys.indexOf('class'); + var actionId = _emberUtils.uuid(); + return new ActionState(element, actionId, actionName, actionArgs, named, positional, implicitTarget, dom); + }; - if (index !== -1) { - var _named$values$index = named.values[index]; - var ref = _named$values$index.ref; - var type = _named$values$index.type; + ActionModifierManager.prototype.install = function install(actionState) { + var dom = actionState.dom; + var element = actionState.element; + var actionId = actionState.actionId; - if (type === 'get') { - var propName = ref.parts[ref.parts.length - 1]; - named.values[index] = _glimmerRuntime.HelperSyntax.fromSpec(['helper', ['-class'], [['get', ref.parts], propName], null]); - } - } + ActionHelper.registerAction(actionState); - return args; - } + dom.setAttribute(element, 'data-ember-action', ''); + dom.setAttribute(element, 'data-ember-action-' + actionId, actionId); + }; - var AttributeBinding = { - parse: function (microsyntax) { - var colonIndex = microsyntax.indexOf(':'); + ActionModifierManager.prototype.update = function update(actionState) { + var positional = actionState.positional; - if (colonIndex === -1) { - return [microsyntax, microsyntax, true]; - } else { - var prop = microsyntax.substring(0, colonIndex); - var attribute = microsyntax.substring(colonIndex + 1); + var actionNameRef = positional.at(1); - return [prop, attribute, false]; + if (!actionNameRef[_emberGlimmerHelpersAction.INVOKE]) { + actionState.actionName = actionNameRef.value(); } - }, + actionState.eventName = actionState.getEventName(); - install: function (element, component, parsed, operations) { - var prop = parsed[0]; - var attribute = parsed[1]; - var isSimple = parsed[2]; + // Not sure if this is needed? If we mutate the actionState is that good enough? + ActionHelper.unregisterAction(actionState); + ActionHelper.registerAction(actionState); + }; - if (attribute === 'id') { - var elementId = _emberMetal.get(component, prop); - if (elementId === undefined || elementId === null) { - elementId = component.elementId; - } - operations.addStaticAttribute(element, 'id', elementId); - return; - } + ActionModifierManager.prototype.getDestructor = function getDestructor(modifier) { + return modifier; + }; - var isPath = prop.indexOf('.') > -1; - var reference = isPath ? referenceForParts(component, prop.split('.')) : referenceForKey(component, prop); + return ActionModifierManager; + })(); - if (attribute === 'style') { - reference = new StyleBindingReference(reference, referenceForKey(component, 'isVisible')); - } + exports.default = ActionModifierManager; +}); +enifed('ember-glimmer/protocol-for-url', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { + /* globals module, URL */ - operations.addDynamicAttribute(element, attribute, reference); - } - }; + 'use strict'; - exports.AttributeBinding = AttributeBinding; - var DISPLAY_NONE = 'display: none;'; - var SAFE_DISPLAY_NONE = _emberGlimmerUtilsString.htmlSafe(DISPLAY_NONE); + exports.default = installProtocolForURL; - var StyleBindingReference = (function (_CachedReference) { - babelHelpers.inherits(StyleBindingReference, _CachedReference); + var nodeURL = undefined; + var parsingNode = undefined; - function StyleBindingReference(inner, isVisible) { - _CachedReference.call(this); + function installProtocolForURL(environment) { + var protocol = undefined; - this.tag = _glimmerReference.combine([inner.tag, isVisible.tag]); - this.inner = inner; - this.isVisible = isVisible; + if (_emberEnvironment.environment.hasDOM) { + protocol = browserProtocolForURL.call(environment, 'foobar:baz'); } - StyleBindingReference.prototype.compute = function compute() { - var value = this.inner.value(); - var isVisible = this.isVisible.value(); - - if (isVisible !== false) { - return value; - } else if (!value && value !== 0) { - return SAFE_DISPLAY_NONE; - } else { - var style = value + ' ' + DISPLAY_NONE; - return _emberGlimmerUtilsString.isHTMLSafe(value) ? _emberGlimmerUtilsString.htmlSafe(style) : style; - } - }; + // Test to see if our DOM implementation parses + // and normalizes URLs. + if (protocol === 'foobar:') { + // Swap in the method that doesn't do this test now that + // we know it works. + environment.protocolForURL = browserProtocolForURL; + } else if (typeof URL === 'object') { + // URL globally provided, likely from FastBoot's sandbox + nodeURL = URL; + environment.protocolForURL = nodeProtocolForURL; + } else if (typeof module === 'object' && typeof module.require === 'function') { + // Otherwise, we need to fall back to our own URL parsing. + // Global `require` is shadowed by Ember's loader so we have to use the fully + // qualified `module.require`. + nodeURL = module.require('url'); + environment.protocolForURL = nodeProtocolForURL; + } else { + throw new Error('Could not find valid URL parsing mechanism for URL Sanitization'); + } + } - return StyleBindingReference; - })(_glimmerReference.CachedReference); + function browserProtocolForURL(url) { + if (!parsingNode) { + parsingNode = document.createElement('a'); + } - var IsVisibleBinding = { - install: function (element, component, operations) { - operations.addDynamicAttribute(element, 'style', _glimmerReference.map(referenceForKey(component, 'isVisible'), this.mapStyleValue)); - }, + parsingNode.href = url; + return parsingNode.protocol; + } - mapStyleValue: function (isVisible) { - return isVisible === false ? SAFE_DISPLAY_NONE : null; + function nodeProtocolForURL(url) { + var protocol = null; + if (typeof url === 'string') { + protocol = nodeURL.parse(url).protocol; } - }; - - exports.IsVisibleBinding = IsVisibleBinding; - var ClassNameBinding = { - install: function (element, component, microsyntax, operations) { - var _microsyntax$split = microsyntax.split(':'); + return protocol === null ? ':' : protocol; + } +}); +enifed('ember-glimmer/renderer', ['exports', 'ember-glimmer/utils/references', 'ember-metal', '@glimmer/reference', 'ember-views', 'ember-glimmer/component', 'ember-glimmer/syntax/curly-component', 'ember-glimmer/syntax/outlet'], function (exports, _emberGlimmerUtilsReferences, _emberMetal, _glimmerReference, _emberViews, _emberGlimmerComponent, _emberGlimmerSyntaxCurlyComponent, _emberGlimmerSyntaxOutlet) { + 'use strict'; - var prop = _microsyntax$split[0]; - var truthy = _microsyntax$split[1]; - var falsy = _microsyntax$split[2]; + var backburner = _emberMetal.run.backburner; - var isStatic = prop === ''; + var DynamicScope = (function () { + function DynamicScope(view, outletState, rootOutletState, targetObject) { + this.view = view; + this.outletState = outletState; + this.rootOutletState = rootOutletState; + } - if (isStatic) { - operations.addStaticAttribute(element, 'class', truthy); - } else { - var isPath = prop.indexOf('.') > -1; - var parts = isPath && prop.split('.'); - var value = isPath ? referenceForParts(component, parts) : referenceForKey(component, prop); - var ref = undefined; + DynamicScope.prototype.child = function child() { + return new DynamicScope(this.view, this.outletState, this.rootOutletState); + }; - if (truthy === undefined) { - ref = new SimpleClassNameBindingReference(value, isPath ? parts[parts.length - 1] : prop); - } else { - ref = new ColonClassNameBindingReference(value, truthy, falsy); - } + DynamicScope.prototype.get = function get(key) { + return this.outletState; + }; - operations.addDynamicAttribute(element, 'class', ref); - } - } - }; + DynamicScope.prototype.set = function set(key, value) { + this.outletState = value; + return value; + }; - exports.ClassNameBinding = ClassNameBinding; + return DynamicScope; + })(); - var SimpleClassNameBindingReference = (function (_CachedReference2) { - babelHelpers.inherits(SimpleClassNameBindingReference, _CachedReference2); + var RootState = (function () { + function RootState(root, env, template, self, parentElement, dynamicScope) { + var _this = this; - function SimpleClassNameBindingReference(inner, path) { - _CachedReference2.call(this); + this.id = _emberViews.getViewId(root); + this.env = env; + this.root = root; + this.result = undefined; + this.shouldReflush = false; + this.destroyed = false; + this._removing = false; - this.tag = inner.tag; - this.inner = inner; - this.path = path; - this.dasherizedPath = null; - } + var options = this.options = { + alwaysRevalidate: false + }; - SimpleClassNameBindingReference.prototype.compute = function compute() { - var value = this.inner.value(); + this.render = function () { + var result = _this.result = template.render(self, parentElement, dynamicScope); - if (value === true) { - var path = this.path; - var dasherizedPath = this.dasherizedPath; + // override .render function after initial render + _this.render = function () { + result.rerender(options); + }; + }; + } - return dasherizedPath || (this.dasherizedPath = _emberRuntime.String.dasherize(path)); - } else if (value || value === 0) { - return value; - } else { - return null; - } + RootState.prototype.isFor = function isFor(possibleRoot) { + return this.root === possibleRoot; }; - return SimpleClassNameBindingReference; - })(_glimmerReference.CachedReference); + RootState.prototype.destroy = function destroy() { + var result = this.result; + var env = this.env; - var ColonClassNameBindingReference = (function (_CachedReference3) { - babelHelpers.inherits(ColonClassNameBindingReference, _CachedReference3); + this.destroyed = true; - function ColonClassNameBindingReference(inner, truthy, falsy) { - _CachedReference3.call(this); + this.env = null; + this.root = null; + this.result = null; + this.render = null; - this.tag = inner.tag; - this.inner = inner; - this.truthy = truthy || null; - this.falsy = falsy || null; - } + if (result) { + /* + Handles these scenarios: + * When roots are removed during standard rendering process, a transaction exists already + `.begin()` / `.commit()` are not needed. + * When roots are being destroyed manually (`component.append(); component.destroy() case), no + transaction exists already. + * When roots are being destroyed during `Renderer#destroy`, no transaction exists + */ + var needsTransaction = !env.inTransaction; - ColonClassNameBindingReference.prototype.compute = function compute() { - var inner = this.inner; - var truthy = this.truthy; - var falsy = this.falsy; + if (needsTransaction) { + env.begin(); + } - return inner.value() ? truthy : falsy; + result.destroy(); + + if (needsTransaction) { + env.commit(); + } + } }; - return ColonClassNameBindingReference; - })(_glimmerReference.CachedReference); -}); -enifed('ember-glimmer/utils/iterable', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/each-in', 'glimmer-reference'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberGlimmerUtilsReferences, _emberGlimmerHelpersEachIn, _glimmerReference) { - 'use strict'; + return RootState; + })(); - exports.default = iterableFor; + var renderers = []; - var ITERATOR_KEY_GUID = 'be277757-bbbe-4620-9fcb-213ef433cca2'; + _emberMetal.setHasViews(function () { + return renderers.length > 0; + }); - function iterableFor(ref, keyPath) { - if (_emberGlimmerHelpersEachIn.isEachIn(ref)) { - return new EachInIterable(ref, keyForEachIn(keyPath)); - } else { - return new ArrayIterable(ref, keyForArray(keyPath)); - } + function register(renderer) { + renderers.push(renderer); } - function keyForEachIn(keyPath) { - switch (keyPath) { - case '@index': - case undefined: - case null: - return index; - case '@identity': - return identity; - default: - return function (item) { - return _emberMetal.get(item, keyPath); - }; - } + function deregister(renderer) { + var index = renderers.indexOf(renderer); + + renderers.splice(index, 1); } - function keyForArray(keyPath) { - switch (keyPath) { - case '@index': - return index; - case '@identity': - case undefined: - case null: - return identity; - default: - return function (item) { - return _emberMetal.get(item, keyPath); - }; + function loopBegin() { + for (var i = 0; i < renderers.length; i++) { + renderers[i]._scheduleRevalidate(); } } - function index(item, index) { - return String(index); - } + function K() {} - function identity(item) { - switch (typeof item) { - case 'string': - case 'number': - return String(item); - default: - return _emberUtils.guidFor(item); + var loops = 0; + function loopEnd(current, next) { + for (var i = 0; i < renderers.length; i++) { + if (!renderers[i]._isValid()) { + if (loops > 10) { + loops = 0; + // TODO: do something better + renderers[i].destroy(); + throw new Error('infinite rendering invalidation detected'); + } + loops++; + return backburner.join(null, K); + } } + loops = 0; } - function ensureUniqueKey(seen, key) { - var seenCount = seen[key]; + backburner.on('begin', loopBegin); + backburner.on('end', loopEnd); - if (seenCount) { - seen[key]++; - return '' + key + ITERATOR_KEY_GUID + seenCount; - } else { - seen[key] = 1; - } + var Renderer = (function () { + function Renderer(env, rootTemplate) { + var _viewRegistry = arguments.length <= 2 || arguments[2] === undefined ? _emberViews.fallbackViewRegistry : arguments[2]; - return key; - } + var destinedForDOM = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3]; - var ArrayIterator = (function () { - function ArrayIterator(array, keyFor) { - this.array = array; - this.length = array.length; - this.keyFor = keyFor; - this.position = 0; - this.seen = new _emberUtils.EmptyObject(); + this._env = env; + this._rootTemplate = rootTemplate; + this._viewRegistry = _viewRegistry; + this._destinedForDOM = destinedForDOM; + this._destroyed = false; + this._roots = []; + this._lastRevision = null; + this._isRenderingRoots = false; + this._removedRoots = []; } - ArrayIterator.prototype.isEmpty = function isEmpty() { - return false; + // renderer HOOKS + + Renderer.prototype.appendOutletView = function appendOutletView(view, target) { + var definition = new _emberGlimmerSyntaxOutlet.TopLevelOutletComponentDefinition(view); + var outletStateReference = view.toReference(); + var targetObject = view.outletState.render.controller; + + this._appendDefinition(view, definition, target, outletStateReference, targetObject); }; - ArrayIterator.prototype.next = function next() { - var array = this.array; - var length = this.length; - var keyFor = this.keyFor; - var position = this.position; - var seen = this.seen; + Renderer.prototype.appendTo = function appendTo(view, target) { + var rootDef = new _emberGlimmerSyntaxCurlyComponent.RootComponentDefinition(view); - if (position >= length) { - return null; - } + this._appendDefinition(view, rootDef, target); + }; - var value = array[position]; - var memo = position; - var key = ensureUniqueKey(seen, keyFor(value, memo)); + Renderer.prototype._appendDefinition = function _appendDefinition(root, definition, target) { + var outletStateReference = arguments.length <= 3 || arguments[3] === undefined ? _glimmerReference.UNDEFINED_REFERENCE : arguments[3]; + var targetObject = arguments.length <= 4 || arguments[4] === undefined ? null : arguments[4]; - this.position++; + var self = new _emberGlimmerUtilsReferences.RootReference(definition); + var dynamicScope = new DynamicScope(null, outletStateReference, outletStateReference, true, targetObject); + var rootState = new RootState(root, this._env, this._rootTemplate, self, target, dynamicScope); - return { key: key, value: value, memo: memo }; + this._renderRoot(rootState); }; - return ArrayIterator; - })(); + Renderer.prototype.rerender = function rerender(view) { + this._scheduleRevalidate(); + }; - var EmberArrayIterator = (function () { - function EmberArrayIterator(array, keyFor) { - this.array = array; - this.length = _emberMetal.get(array, 'length'); - this.keyFor = keyFor; - this.position = 0; - this.seen = new _emberUtils.EmptyObject(); - } + Renderer.prototype.register = function register(view) { + var id = _emberViews.getViewId(view); - EmberArrayIterator.prototype.isEmpty = function isEmpty() { - return this.length === 0; + this._viewRegistry[id] = view; }; - EmberArrayIterator.prototype.next = function next() { - var array = this.array; - var length = this.length; - var keyFor = this.keyFor; - var position = this.position; - var seen = this.seen; + Renderer.prototype.unregister = function unregister(view) { + delete this._viewRegistry[_emberViews.getViewId(view)]; + }; - if (position >= length) { - return null; - } + Renderer.prototype.remove = function remove(view) { + view._transitionTo('destroying'); - var value = _emberRuntime.objectAt(array, position); - var memo = position; - var key = ensureUniqueKey(seen, keyFor(value, memo)); + this.cleanupRootFor(view); - this.position++; + _emberViews.setViewElement(view, null); - return { key: key, value: value, memo: memo }; + if (this._destinedForDOM) { + view.trigger('didDestroyElement'); + } + + if (!view.isDestroying) { + view.destroy(); + } }; - return EmberArrayIterator; - })(); + Renderer.prototype.cleanupRootFor = function cleanupRootFor(view) { + // no need to cleanup roots if we have already been destroyed + if (this._destroyed) { + return; + } - var ObjectKeysIterator = (function () { - function ObjectKeysIterator(keys, values, keyFor) { - this.keys = keys; - this.values = values; - this.keyFor = keyFor; - this.position = 0; - this.seen = new _emberUtils.EmptyObject(); - } + var roots = this._roots; - ObjectKeysIterator.prototype.isEmpty = function isEmpty() { - return this.keys.length === 0; + // traverse in reverse so we can remove items + // without mucking up the index + var i = this._roots.length; + while (i--) { + var root = roots[i]; + if (root.isFor(view)) { + root.destroy(); + } + } }; - ObjectKeysIterator.prototype.next = function next() { - var keys = this.keys; - var values = this.values; - var keyFor = this.keyFor; - var position = this.position; - var seen = this.seen; - - if (position >= keys.length) { - return null; + Renderer.prototype.destroy = function destroy() { + if (this._destroyed) { + return; } + this._destroyed = true; + this._clearAllRoots(); + }; - var value = values[position]; - var memo = keys[position]; - var key = ensureUniqueKey(seen, keyFor(value, memo)); - - this.position++; - - return { key: key, value: value, memo: memo }; + Renderer.prototype.getElement = function getElement(view) { + // overriden in the subclasses }; - return ObjectKeysIterator; - })(); + Renderer.prototype.getBounds = function getBounds(view) { + var bounds = view[_emberGlimmerComponent.BOUNDS]; - var EmptyIterator = (function () { - function EmptyIterator() {} + var parentElement = bounds.parentElement(); + var firstNode = bounds.firstNode(); + var lastNode = bounds.lastNode(); - EmptyIterator.prototype.isEmpty = function isEmpty() { - return true; + return { parentElement: parentElement, firstNode: firstNode, lastNode: lastNode }; }; - EmptyIterator.prototype.next = function next() { - throw new Error('Cannot call next() on an empty iterator'); + Renderer.prototype.createElement = function createElement(tagName) { + return this._env.getAppendOperations().createElement(tagName); }; - return EmptyIterator; - })(); + Renderer.prototype._renderRoot = function _renderRoot(root) { + var roots = this._roots; - var EMPTY_ITERATOR = new EmptyIterator(); + roots.push(root); - var EachInIterable = (function () { - function EachInIterable(ref, keyFor) { - this.ref = ref; - this.keyFor = keyFor; + if (roots.length === 1) { + register(this); + } - var valueTag = this.valueTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); + this._renderRootsTransaction(); + }; - this.tag = _glimmerReference.combine([ref.tag, valueTag]); - } + Renderer.prototype._renderRoots = function _renderRoots() { + var roots = this._roots; + var env = this._env; + var removedRoots = this._removedRoots; - EachInIterable.prototype.iterate = function iterate() { - var ref = this.ref; - var keyFor = this.keyFor; - var valueTag = this.valueTag; + var globalShouldReflush = undefined, + initialRootsLength = undefined; - var iterable = ref.value(); + do { + env.begin(); - valueTag.update(_emberMetal.tagFor(iterable)); + // ensure that for the first iteration of the loop + // each root is processed + initialRootsLength = roots.length; + globalShouldReflush = false; - if (_emberMetal.isProxy(iterable)) { - iterable = _emberMetal.get(iterable, 'content'); - } + for (var i = 0; i < roots.length; i++) { + var root = roots[i]; - var typeofIterable = typeof iterable; + if (root.destroyed) { + // add to the list of roots to be removed + // they will be removed from `this._roots` later + removedRoots.push(root); - if (iterable && (typeofIterable === 'object' || typeofIterable === 'function')) { - var keys = Object.keys(iterable); - var values = keys.map(function (key) { - return iterable[key]; - }); - return keys.length > 0 ? new ObjectKeysIterator(keys, values, keyFor) : EMPTY_ITERATOR; - } else { - return EMPTY_ITERATOR; - } - }; + // skip over roots that have been marked as destroyed + continue; + } - // {{each-in}} yields |key value| instead of |value key|, so the memo and - // value are flipped + var shouldReflush = root.shouldReflush; - EachInIterable.prototype.valueReferenceFor = function valueReferenceFor(item) { - return new _emberGlimmerUtilsReferences.UpdatablePrimitiveReference(item.memo); - }; + // when processing non-initial reflush loops, + // do not process more roots than needed + if (i >= initialRootsLength && !shouldReflush) { + continue; + } - EachInIterable.prototype.updateValueReference = function updateValueReference(reference, item) { - reference.update(item.memo); - }; + root.options.alwaysRevalidate = shouldReflush; + // track shouldReflush based on this roots render result + shouldReflush = root.shouldReflush = _emberMetal.runInTransaction(root, 'render'); - EachInIterable.prototype.memoReferenceFor = function memoReferenceFor(item) { - return new _emberGlimmerUtilsReferences.UpdatableReference(item.value); - }; + // globalShouldReflush should be `true` if *any* of + // the roots need to reflush + globalShouldReflush = globalShouldReflush || shouldReflush; + } - EachInIterable.prototype.updateMemoReference = function updateMemoReference(reference, item) { - reference.update(item.value); - }; + this._lastRevision = _glimmerReference.CURRENT_TAG.value(); - return EachInIterable; - })(); + env.commit(); + } while (globalShouldReflush || roots.length > initialRootsLength); - var ArrayIterable = (function () { - function ArrayIterable(ref, keyFor) { - this.ref = ref; - this.keyFor = keyFor; + // remove any roots that were destroyed during this transaction + while (removedRoots.length) { + var root = removedRoots.pop(); - var valueTag = this.valueTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); + var rootIndex = roots.indexOf(root); + roots.splice(rootIndex, 1); + } - this.tag = _glimmerReference.combine([ref.tag, valueTag]); - } + if (this._roots.length === 0) { + deregister(this); + } + }; - ArrayIterable.prototype.iterate = function iterate() { - var ref = this.ref; - var keyFor = this.keyFor; - var valueTag = this.valueTag; + Renderer.prototype._renderRootsTransaction = function _renderRootsTransaction() { + if (this._isRenderingRoots) { + // currently rendering roots, a new root was added and will + // be processed by the existing _renderRoots invocation + return; + } - var iterable = ref.value(); + // used to prevent calling _renderRoots again (see above) + // while we are actively rendering roots + this._isRenderingRoots = true; - valueTag.update(_emberMetal.tagForProperty(iterable, '[]')); + var completedWithoutError = false; + try { + this._renderRoots(); + completedWithoutError = true; + } finally { + if (!completedWithoutError) { + this._lastRevision = _glimmerReference.CURRENT_TAG.value(); + } + this._isRenderingRoots = false; + } + }; - if (!iterable || typeof iterable !== 'object') { - return EMPTY_ITERATOR; + Renderer.prototype._clearAllRoots = function _clearAllRoots() { + var roots = this._roots; + for (var i = 0; i < roots.length; i++) { + var root = roots[i]; + root.destroy(); } - if (Array.isArray(iterable)) { - return iterable.length > 0 ? new ArrayIterator(iterable, keyFor) : EMPTY_ITERATOR; - } else if (_emberRuntime.isEmberArray(iterable)) { - return _emberMetal.get(iterable, 'length') > 0 ? new EmberArrayIterator(iterable, keyFor) : EMPTY_ITERATOR; - } else if (typeof iterable.forEach === 'function') { - var _ret = (function () { - var array = []; - iterable.forEach(function (item) { - array.push(item); - }); - return { - v: array.length > 0 ? new ArrayIterator(array, keyFor) : EMPTY_ITERATOR - }; - })(); + this._removedRoots.length = 0; + this._roots = null; - if (typeof _ret === 'object') return _ret.v; - } else { - return EMPTY_ITERATOR; + // if roots were present before destroying + // deregister this renderer instance + if (roots.length) { + deregister(this); } }; - ArrayIterable.prototype.valueReferenceFor = function valueReferenceFor(item) { - return new _emberGlimmerUtilsReferences.UpdatableReference(item.value); - }; - - ArrayIterable.prototype.updateValueReference = function updateValueReference(reference, item) { - reference.update(item.value); + Renderer.prototype._scheduleRevalidate = function _scheduleRevalidate() { + backburner.scheduleOnce('render', this, this._revalidate); }; - ArrayIterable.prototype.memoReferenceFor = function memoReferenceFor(item) { - return new _emberGlimmerUtilsReferences.UpdatablePrimitiveReference(item.memo); + Renderer.prototype._isValid = function _isValid() { + return this._destroyed || this._roots.length === 0 || _glimmerReference.CURRENT_TAG.validate(this._lastRevision); }; - ArrayIterable.prototype.updateMemoReference = function updateMemoReference(reference, item) { - reference.update(item.memo); + Renderer.prototype._revalidate = function _revalidate() { + if (this._isValid()) { + return; + } + this._renderRootsTransaction(); }; - return ArrayIterable; + return Renderer; })(); -}); -enifed('ember-glimmer/utils/process-args', ['exports', 'ember-utils', 'glimmer-reference', 'ember-glimmer/component', 'ember-glimmer/utils/references', 'ember-views', 'ember-glimmer/helpers/action', 'glimmer-runtime'], function (exports, _emberUtils, _glimmerReference, _emberGlimmerComponent, _emberGlimmerUtilsReferences, _emberViews, _emberGlimmerHelpersAction, _glimmerRuntime) { - 'use strict'; - exports.gatherArgs = gatherArgs; + var InertRenderer = (function (_Renderer) { + babelHelpers.inherits(InertRenderer, _Renderer); - // Maps all variants of positional and dynamically scoped arguments - // into the named arguments. Input `args` and return value are both - // `EvaluatedArgs`. + function InertRenderer() { + _Renderer.apply(this, arguments); + } - function gatherArgs(args, definition) { - var namedMap = gatherNamedMap(args, definition); - var positionalValues = gatherPositionalValues(args, definition); - return mergeArgs(namedMap, positionalValues, args.blocks, definition.ComponentClass); - } + InertRenderer.create = function create(_ref) { + var env = _ref.env; + var rootTemplate = _ref.rootTemplate; + var _viewRegistry = _ref._viewRegistry; - function gatherNamedMap(args, definition) { - var namedMap = args.named.map; - if (definition.args) { - return _emberUtils.assign({}, definition.args.named.map, namedMap); - } else { - return namedMap; - } - } + return new this(env, rootTemplate, _viewRegistry, false); + }; - function gatherPositionalValues(args, definition) { - var positionalValues = args.positional.values; - if (definition.args) { - var oldPositional = definition.args.positional.values; - var newPositional = []; - newPositional.push.apply(newPositional, oldPositional); - newPositional.splice.apply(newPositional, [0, positionalValues.length].concat(positionalValues)); - return newPositional; - } else { - return positionalValues; - } - } + InertRenderer.prototype.getElement = function getElement(view) { + throw new Error('Accessing `this.element` is not allowed in non-interactive environments (such as FastBoot).'); + }; - function mergeArgs(namedMap, positionalValues, blocks, componentClass) { - var positionalParamsDefinition = componentClass.positionalParams; + return InertRenderer; + })(Renderer); - if (positionalParamsDefinition && positionalParamsDefinition.length > 0 && positionalValues.length > 0) { - if (typeof positionalParamsDefinition === 'string') { - namedMap = mergeRestArg(namedMap, positionalValues, positionalParamsDefinition); - } else { - namedMap = mergePositionalParams(namedMap, positionalValues, positionalParamsDefinition); - } - } - return _glimmerRuntime.EvaluatedArgs.named(namedMap, blocks); - } + exports.InertRenderer = InertRenderer; - var EMPTY_ARGS = { - tag: _glimmerReference.CONSTANT_TAG, - value: function () { - var _props; + var InteractiveRenderer = (function (_Renderer2) { + babelHelpers.inherits(InteractiveRenderer, _Renderer2); - return { attrs: {}, props: (_props = { attrs: {} }, _props[_emberGlimmerComponent.ARGS] = {}, _props) }; + function InteractiveRenderer() { + _Renderer2.apply(this, arguments); } - }; - // ComponentArgs takes EvaluatedNamedArgs and converts them into the - // inputs needed by CurlyComponents (attrs and props, with mutable - // cells, etc). + InteractiveRenderer.create = function create(_ref2) { + var env = _ref2.env; + var rootTemplate = _ref2.rootTemplate; + var _viewRegistry = _ref2._viewRegistry; - var ComponentArgs = (function () { - ComponentArgs.create = function create(args) { - if (args.named.keys.length === 0) { - return EMPTY_ARGS; - } else { - return new ComponentArgs(args.named); - } + return new this(env, rootTemplate, _viewRegistry, true); }; - function ComponentArgs(namedArgs) { - this.tag = namedArgs.tag; - this.namedArgs = namedArgs; - } - - ComponentArgs.prototype.value = function value() { - var namedArgs = this.namedArgs; + InteractiveRenderer.prototype.getElement = function getElement(view) { + return _emberViews.getViewElement(view); + }; - var keys = namedArgs.keys; - var attrs = namedArgs.value(); - var props = new _emberUtils.EmptyObject(); - var args = new _emberUtils.EmptyObject(); + return InteractiveRenderer; + })(Renderer); - props[_emberGlimmerComponent.ARGS] = args; + exports.InteractiveRenderer = InteractiveRenderer; +}); +enifed('ember-glimmer/setup-registry', ['exports', 'ember-environment', 'container', 'ember-glimmer/renderer', 'ember-glimmer/dom', 'ember-glimmer/views/outlet', 'ember-glimmer/components/text_field', 'ember-glimmer/components/text_area', 'ember-glimmer/components/checkbox', 'ember-glimmer/components/link-to', 'ember-glimmer/component', 'ember-glimmer/templates/component', 'ember-glimmer/templates/root', 'ember-glimmer/templates/outlet', 'ember-glimmer/environment'], function (exports, _emberEnvironment, _container, _emberGlimmerRenderer, _emberGlimmerDom, _emberGlimmerViewsOutlet, _emberGlimmerComponentsText_field, _emberGlimmerComponentsText_area, _emberGlimmerComponentsCheckbox, _emberGlimmerComponentsLinkTo, _emberGlimmerComponent, _emberGlimmerTemplatesComponent, _emberGlimmerTemplatesRoot, _emberGlimmerTemplatesOutlet, _emberGlimmerEnvironment) { + 'use strict'; - for (var i = 0, l = keys.length; i < l; i++) { - var _name = keys[i]; - var ref = namedArgs.get(_name); - var value = attrs[_name]; + exports.setupApplicationRegistry = setupApplicationRegistry; + exports.setupEngineRegistry = setupEngineRegistry; - if (typeof value === 'function' && value[_emberGlimmerHelpersAction.ACTION]) { - attrs[_name] = value; - } else if (ref[_emberGlimmerUtilsReferences.UPDATE]) { - attrs[_name] = new MutableCell(ref, value); - } + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['template:-root'], ['template:-root']), + _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['template:components/-default'], ['template:components/-default']), + _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['component:-default'], ['component:-default']); - args[_name] = ref; - props[_name] = value; - } + function setupApplicationRegistry(registry) { + registry.injection('service:-glimmer-environment', 'appendOperations', 'service:-dom-tree-construction'); + registry.injection('renderer', 'env', 'service:-glimmer-environment'); - props.attrs = attrs; + registry.register(_container.privatize(_templateObject), _emberGlimmerTemplatesRoot.default); + registry.injection('renderer', 'rootTemplate', _container.privatize(_templateObject)); - return { attrs: attrs, props: props }; - }; + registry.register('renderer:-dom', _emberGlimmerRenderer.InteractiveRenderer); + registry.register('renderer:-inert', _emberGlimmerRenderer.InertRenderer); - return ComponentArgs; - })(); + if (_emberEnvironment.environment.hasDOM) { + registry.injection('service:-glimmer-environment', 'updateOperations', 'service:-dom-changes'); + } - exports.ComponentArgs = ComponentArgs; + registry.register('service:-dom-changes', { + create: function (_ref) { + var document = _ref.document; - function mergeRestArg(namedMap, positionalValues, restArgName) { - var mergedNamed = _emberUtils.assign({}, namedMap); - mergedNamed[restArgName] = _glimmerRuntime.EvaluatedPositionalArgs.create(positionalValues); - return mergedNamed; - } + return new _emberGlimmerDom.DOMChanges(document); + } + }); - function mergePositionalParams(namedMap, values, positionalParamNames) { - var mergedNamed = _emberUtils.assign({}, namedMap); - var length = Math.min(values.length, positionalParamNames.length); - for (var i = 0; i < length; i++) { - var _name2 = positionalParamNames[i]; - mergedNamed[_name2] = values[i]; - } - return mergedNamed; + registry.register('service:-dom-tree-construction', { + create: function (_ref2) { + var document = _ref2.document; + + var Implementation = _emberEnvironment.environment.hasDOM ? _emberGlimmerDom.DOMTreeConstruction : _emberGlimmerDom.NodeDOMTreeConstruction; + return new Implementation(document); + } + }); } - var REF = _emberUtils.symbol('REF'); + function setupEngineRegistry(registry) { + registry.register('view:-outlet', _emberGlimmerViewsOutlet.default); + registry.register('template:-outlet', _emberGlimmerTemplatesOutlet.default); + registry.injection('view:-outlet', 'template', 'template:-outlet'); - var MutableCell = (function () { - function MutableCell(ref, value) { - this[_emberViews.MUTABLE_CELL] = true; - this[REF] = ref; - this.value = value; - } + registry.injection('service:-dom-changes', 'document', 'service:-document'); + registry.injection('service:-dom-tree-construction', 'document', 'service:-document'); - MutableCell.prototype.update = function update(val) { - this[REF][_emberGlimmerUtilsReferences.UPDATE](val); - }; + registry.register(_container.privatize(_templateObject2), _emberGlimmerTemplatesComponent.default); - return MutableCell; - })(); + registry.register('service:-glimmer-environment', _emberGlimmerEnvironment.default); + registry.injection('template', 'env', 'service:-glimmer-environment'); + + registry.optionsForType('helper', { instantiate: false }); + + registry.register('component:-text-field', _emberGlimmerComponentsText_field.default); + registry.register('component:-text-area', _emberGlimmerComponentsText_area.default); + registry.register('component:-checkbox', _emberGlimmerComponentsCheckbox.default); + registry.register('component:link-to', _emberGlimmerComponentsLinkTo.default); + registry.register(_container.privatize(_templateObject3), _emberGlimmerComponent.default); + } }); -enifed('ember-glimmer/utils/references', ['exports', 'ember-utils', 'ember-metal', 'glimmer-reference', 'glimmer-runtime', 'ember-glimmer/utils/to-bool', 'ember-glimmer/helper'], function (exports, _emberUtils, _emberMetal, _glimmerReference, _glimmerRuntime, _emberGlimmerUtilsToBool, _emberGlimmerHelper) { +enifed('ember-glimmer/syntax', ['exports', 'ember-glimmer/syntax/render', 'ember-glimmer/syntax/outlet', 'ember-glimmer/syntax/mount', 'ember-glimmer/syntax/dynamic-component', 'ember-glimmer/utils/bindings', 'ember-glimmer/syntax/-with-dynamic-vars', 'ember-glimmer/syntax/-in-element', 'ember-glimmer/syntax/input', 'ember-glimmer/syntax/-text-area', 'ember-metal'], function (exports, _emberGlimmerSyntaxRender, _emberGlimmerSyntaxOutlet, _emberGlimmerSyntaxMount, _emberGlimmerSyntaxDynamicComponent, _emberGlimmerUtilsBindings, _emberGlimmerSyntaxWithDynamicVars, _emberGlimmerSyntaxInElement, _emberGlimmerSyntaxInput, _emberGlimmerSyntaxTextArea, _emberMetal) { 'use strict'; - var UPDATE = _emberUtils.symbol('UPDATE'); + exports.registerMacros = registerMacros; + exports.populateMacros = populateMacros; - exports.UPDATE = UPDATE; - exports.NULL_REFERENCE = _glimmerRuntime.NULL_REFERENCE; - exports.UNDEFINED_REFERENCE = _glimmerRuntime.UNDEFINED_REFERENCE; + function refineInlineSyntax(path, params, hash, builder) { + var name = path[0]; - // @abstract - // @implements PathReference + if (path.length > 1) { + return _emberGlimmerSyntaxDynamicComponent.closureComponentMacro(path, params, hash, null, null, builder); + } - var EmberPathReference = (function () { - function EmberPathReference() {} + var symbolTable = builder.symbolTable; - // @abstract + var definition = undefined; + if (name.indexOf('-') > -1) { + definition = builder.env.getComponentDefinition(path, symbolTable); + } - // @abstract get tag() - // @abstract value() + if (definition) { + _emberGlimmerUtilsBindings.wrapComponentClassAttribute(hash); + builder.component.static(definition, [params, hash, null, null], symbolTable); + return true; + } - EmberPathReference.prototype.get = function get(key) { - return PropertyReference.create(this, key); - }; + return false; + } - return EmberPathReference; - })(); + function refineBlockSyntax(sexp, builder) { + var path = sexp[1]; + var params = sexp[2]; + var hash = sexp[3]; + var _default = sexp[4]; + var inverse = sexp[5]; + var name = path[0]; - var CachedReference = (function (_EmberPathReference) { - babelHelpers.inherits(CachedReference, _EmberPathReference); + if (path.length > 1) { + return _emberGlimmerSyntaxDynamicComponent.closureComponentMacro(path, params, hash, _default, inverse, builder); + } - function CachedReference() { - _EmberPathReference.call(this); - this._lastRevision = null; - this._lastValue = null; + if (name.indexOf('-') === -1) { + return false; } - // @implements PathReference + var symbolTable = builder.symbolTable; - CachedReference.prototype.value = function value() { - var tag = this.tag; - var _lastRevision = this._lastRevision; - var _lastValue = this._lastValue; + var definition = undefined; + if (name.indexOf('-') > -1) { + definition = builder.env.getComponentDefinition(path, symbolTable); + } - if (!_lastRevision || !tag.validate(_lastRevision)) { - _lastValue = this._lastValue = this.compute(); - this._lastRevision = tag.value(); - } + if (definition) { + _emberGlimmerUtilsBindings.wrapComponentClassAttribute(hash); + builder.component.static(definition, [params, hash, _default, inverse], symbolTable); + return true; + } - return _lastValue; - }; + return false; + } - // @abstract compute() - return CachedReference; - })(EmberPathReference); + var experimentalMacros = []; - exports.CachedReference = CachedReference; + // This is a private API to allow for expiremental macros + // to be created in user space. Registering a macro should + // should be done in an initializer. - var RootReference = (function (_ConstReference) { - babelHelpers.inherits(RootReference, _ConstReference); + function registerMacros(macro) { + experimentalMacros.push(macro); + } - function RootReference(value) { - _ConstReference.call(this, value); - this.children = new _emberUtils.EmptyObject(); + function populateMacros(blocks, inlines) { + inlines.add('outlet', _emberGlimmerSyntaxOutlet.outletMacro); + inlines.add('component', _emberGlimmerSyntaxDynamicComponent.inlineComponentMacro); + inlines.add('render', _emberGlimmerSyntaxRender.renderMacro); + inlines.add('mount', _emberGlimmerSyntaxMount.mountMacro); + inlines.add('input', _emberGlimmerSyntaxInput.inputMacro); + inlines.add('textarea', _emberGlimmerSyntaxTextArea.textAreaMacro); + inlines.addMissing(refineInlineSyntax); + blocks.add('component', _emberGlimmerSyntaxDynamicComponent.blockComponentMacro); + blocks.add('-with-dynamic-vars', _emberGlimmerSyntaxWithDynamicVars._withDynamicVarsMacro); + blocks.add('-in-element', _emberGlimmerSyntaxInElement._inElementMacro); + blocks.addMissing(refineBlockSyntax); + + for (var i = 0; i < experimentalMacros.length; i++) { + var macro = experimentalMacros[i]; + macro(blocks, inlines); } - RootReference.prototype.get = function get(propertyKey) { - var ref = this.children[propertyKey]; + experimentalMacros = []; - if (!ref) { - ref = this.children[propertyKey] = new RootPropertyReference(this.inner, propertyKey); - } + return { blocks: blocks, inlines: inlines }; + } +}); +enifed('ember-glimmer/syntax/-in-element', ['exports', '@glimmer/runtime', '@glimmer/util'], function (exports, _glimmerRuntime, _glimmerUtil) { + 'use strict'; - return ref; - }; + exports._inElementMacro = _inElementMacro; + var _BaselineSyntax$NestedBlock = _glimmerRuntime.BaselineSyntax.NestedBlock; + var defaultBlock = _BaselineSyntax$NestedBlock.defaultBlock; + var params = _BaselineSyntax$NestedBlock.params; + var hash = _BaselineSyntax$NestedBlock.hash; - return RootReference; - })(_glimmerReference.ConstReference); + function _inElementMacro(sexp, builder) { + var block = defaultBlock(sexp); + var args = _glimmerRuntime.compileArgs(params(sexp), hash(sexp), builder); - exports.RootReference = RootReference; + builder.putArgs(args); + builder.test('simple'); - var TwoWayFlushDetectionTag = undefined; + builder.labelled(null, function (b) { + b.jumpUnless('END'); + b.pushRemoteElement(); + b.evaluate(_glimmerUtil.unwrap(block)); + b.popRemoteElement(); + }); + } +}); +enifed('ember-glimmer/syntax/-text-area', ['exports', 'ember-glimmer/utils/bindings'], function (exports, _emberGlimmerUtilsBindings) { + 'use strict'; - if (false || true) { - TwoWayFlushDetectionTag = (function () { - function _class(tag, key, ref) { - this.tag = tag; - this.parent = null; - this.key = key; - this.ref = ref; - } + exports.textAreaMacro = textAreaMacro; - _class.prototype.value = function value() { - return this.tag.value(); - }; + function textAreaMacro(path, params, hash, builder) { + var definition = builder.env.getComponentDefinition(['-text-area'], builder.symbolTable); + _emberGlimmerUtilsBindings.wrapComponentClassAttribute(hash); + builder.component.static(definition, [params, hash, null, null], builder.symbolTable); + return true; + } +}); +enifed('ember-glimmer/syntax/-with-dynamic-vars', ['exports', '@glimmer/runtime', '@glimmer/util'], function (exports, _glimmerRuntime, _glimmerUtil) { + 'use strict'; - _class.prototype.validate = function validate(ticket) { - var parent = this.parent; - var key = this.key; + exports._withDynamicVarsMacro = _withDynamicVarsMacro; + var _BaselineSyntax$NestedBlock = _glimmerRuntime.BaselineSyntax.NestedBlock; + var defaultBlock = _BaselineSyntax$NestedBlock.defaultBlock; + var params = _BaselineSyntax$NestedBlock.params; + var hash = _BaselineSyntax$NestedBlock.hash; + + function _withDynamicVarsMacro(sexp, builder) { + var block = defaultBlock(sexp); + var args = _glimmerRuntime.compileArgs(params(sexp), hash(sexp), builder); + + builder.unit(function (b) { + b.putArgs(args); + b.pushDynamicScope(); + b.bindDynamicScope(args.named.keys); + b.evaluate(_glimmerUtil.unwrap(block)); + b.popDynamicScope(); + }); + } +}); +enifed('ember-glimmer/syntax/abstract-manager', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - var isValid = this.tag.validate(ticket); + var AbstractManager = function AbstractManager() {}; - if (isValid && parent) { - _emberMetal.didRender(parent, key, this.ref); - } + exports.default = AbstractManager; +}); +enifed('ember-glimmer/syntax/curly-component', ['exports', 'ember-utils', '@glimmer/runtime', 'ember-glimmer/utils/bindings', 'ember-glimmer/component', 'ember-metal', 'ember-views', 'ember-glimmer/utils/process-args', 'container', 'ember-glimmer/syntax/abstract-manager'], function (exports, _emberUtils, _glimmerRuntime, _emberGlimmerUtilsBindings, _emberGlimmerComponent, _emberMetal, _emberViews, _emberGlimmerUtilsProcessArgs, _container, _emberGlimmerSyntaxAbstractManager) { + 'use strict'; - return isValid; - }; + exports.validatePositionalParameters = validatePositionalParameters; - _class.prototype.didCompute = function didCompute(parent) { - this.parent = parent; - _emberMetal.didRender(parent, this.key, this.ref); - }; + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['template:components/-default'], ['template:components/-default']); - return _class; - })(); + var DEFAULT_LAYOUT = _container.privatize(_templateObject); + + function processComponentInitializationAssertions(component, props) {} + + function validatePositionalParameters(named, positional, positionalParamsDefinition) {} + + function aliasIdToElementId(args, props) { + if (args.named.has('id')) { + props.elementId = props.id; + } } - var PropertyReference = (function (_CachedReference) { - babelHelpers.inherits(PropertyReference, _CachedReference); + // We must traverse the attributeBindings in reverse keeping track of + // what has already been applied. This is essentially refining the concated + // properties applying right to left. + function applyAttributeBindings(element, attributeBindings, component, operations) { + var seen = []; + var i = attributeBindings.length - 1; - function PropertyReference() { - _CachedReference.apply(this, arguments); + while (i !== -1) { + var binding = attributeBindings[i]; + var parsed = _emberGlimmerUtilsBindings.AttributeBinding.parse(binding); + var attribute = parsed[1]; + + if (seen.indexOf(attribute) === -1) { + seen.push(attribute); + _emberGlimmerUtilsBindings.AttributeBinding.install(element, component, parsed, operations); + } + + i--; } - PropertyReference.create = function create(parentReference, propertyKey) { - if (_glimmerReference.isConst(parentReference)) { - return new RootPropertyReference(parentReference.value(), propertyKey); - } else { - return new NestedPropertyReference(parentReference, propertyKey); + if (seen.indexOf('id') === -1) { + operations.addStaticAttribute(element, 'id', component.elementId); + } + + if (seen.indexOf('style') === -1) { + _emberGlimmerUtilsBindings.IsVisibleBinding.install(element, component, operations); + } + } + + function NOOP() {} + + var ComponentStateBucket = (function () { + function ComponentStateBucket(environment, component, args, finalizer) { + this.environment = environment; + this.component = component; + this.classRef = null; + this.args = args; + this.argsRevision = args.tag.value(); + this.finalizer = finalizer; + } + + ComponentStateBucket.prototype.destroy = function destroy() { + var component = this.component; + var environment = this.environment; + + if (environment.isInteractive) { + component.trigger('willDestroyElement'); + component.trigger('willClearRender'); } - }; - PropertyReference.prototype.get = function get(key) { - return new NestedPropertyReference(this, key); + environment.destroyedComponents.push(component); }; - return PropertyReference; - })(CachedReference); + ComponentStateBucket.prototype.finalize = function finalize() { + var finalizer = this.finalizer; - exports.PropertyReference = PropertyReference; + finalizer(); + this.finalizer = NOOP; + }; - var RootPropertyReference = (function (_PropertyReference) { - babelHelpers.inherits(RootPropertyReference, _PropertyReference); + return ComponentStateBucket; + })(); - function RootPropertyReference(parentValue, propertyKey) { - _PropertyReference.call(this); + function initialRenderInstrumentDetails(component) { + return component.instrumentDetails({ initialRender: true }); + } - this._parentValue = parentValue; - this._propertyKey = propertyKey; + function rerenderInstrumentDetails(component) { + return component.instrumentDetails({ initialRender: false }); + } - if (false || true) { - this.tag = new TwoWayFlushDetectionTag(_emberMetal.tagForProperty(parentValue, propertyKey), propertyKey, this); - } else { - this.tag = _emberMetal.tagForProperty(parentValue, propertyKey); - } + var CurlyComponentManager = (function (_AbstractManager) { +babelHelpers.inherits(CurlyComponentManager, _AbstractManager); - if (false) { - _emberMetal.watchKey(parentValue, propertyKey); - } + function CurlyComponentManager() { + _AbstractManager.apply(this, arguments); } - RootPropertyReference.prototype.compute = function compute() { - var _parentValue = this._parentValue; - var _propertyKey = this._propertyKey; - - if (false || true) { - this.tag.didCompute(_parentValue); + CurlyComponentManager.prototype.prepareArgs = function prepareArgs(definition, args) { + if (definition.ComponentClass) { + validatePositionalParameters(args.named, args.positional.values, definition.ComponentClass.class.positionalParams); } - return _emberMetal.get(_parentValue, _propertyKey); + return _emberGlimmerUtilsProcessArgs.gatherArgs(args, definition); }; - RootPropertyReference.prototype[UPDATE] = function (value) { - _emberMetal.set(this._parentValue, this._propertyKey, value); - }; + CurlyComponentManager.prototype.create = function create(environment, definition, args, dynamicScope, callerSelfRef, hasBlock) { - return RootPropertyReference; - })(PropertyReference); + var parentView = dynamicScope.view; - exports.RootPropertyReference = RootPropertyReference; + var factory = definition.ComponentClass; - var NestedPropertyReference = (function (_PropertyReference2) { - babelHelpers.inherits(NestedPropertyReference, _PropertyReference2); + var processedArgs = _emberGlimmerUtilsProcessArgs.ComponentArgs.create(args); - function NestedPropertyReference(parentReference, propertyKey) { - _PropertyReference2.call(this); + var _processedArgs$value = processedArgs.value(); - var parentReferenceTag = parentReference.tag; - var parentObjectTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); + var props = _processedArgs$value.props; - this._parentReference = parentReference; - this._parentObjectTag = parentObjectTag; - this._propertyKey = propertyKey; + aliasIdToElementId(args, props); - if (false || true) { - var tag = _glimmerReference.combine([parentReferenceTag, parentObjectTag]); - this.tag = new TwoWayFlushDetectionTag(tag, propertyKey, this); - } else { - this.tag = _glimmerReference.combine([parentReferenceTag, parentObjectTag]); - } - } + props.parentView = parentView; + props[_emberGlimmerComponent.HAS_BLOCK] = hasBlock; - NestedPropertyReference.prototype.compute = function compute() { - var _parentReference = this._parentReference; - var _parentObjectTag = this._parentObjectTag; - var _propertyKey = this._propertyKey; + props._targetObject = callerSelfRef.value(); - var parentValue = _parentReference.value(); + var component = factory.create(props); - _parentObjectTag.update(_emberMetal.tagForProperty(parentValue, _propertyKey)); + var finalizer = _emberMetal._instrumentStart('render.component', initialRenderInstrumentDetails, component); - if (typeof parentValue === 'string' && _propertyKey === 'length') { - return parentValue.length; + dynamicScope.view = component; + + if (parentView !== null) { + parentView.appendChild(component); } - if (typeof parentValue === 'object' && parentValue) { - if (false) { - _emberMetal.watchKey(parentValue, _propertyKey); + // We usually do this in the `didCreateElement`, but that hook doesn't fire for tagless components + if (component.tagName === '') { + if (environment.isInteractive) { + component.trigger('willRender'); } - if (false || true) { - this.tag.didCompute(parentValue); - } + component._transitionTo('hasElement'); - return _emberMetal.get(parentValue, _propertyKey); - } else { - return undefined; + if (environment.isInteractive) { + component.trigger('willInsertElement'); + } } - }; - - NestedPropertyReference.prototype[UPDATE] = function (value) { - var parent = this._parentReference.value(); - _emberMetal.set(parent, this._propertyKey, value); - }; - - return NestedPropertyReference; - })(PropertyReference); - exports.NestedPropertyReference = NestedPropertyReference; + var bucket = new ComponentStateBucket(environment, component, processedArgs, finalizer); - var UpdatableReference = (function (_EmberPathReference2) { - babelHelpers.inherits(UpdatableReference, _EmberPathReference2); + if (args.named.has('class')) { + bucket.classRef = args.named.get('class'); + } - function UpdatableReference(value) { - _EmberPathReference2.call(this); + processComponentInitializationAssertions(component, props); - this.tag = new _glimmerReference.DirtyableTag(); - this._value = value; - } + if (environment.isInteractive && component.tagName !== '') { + component.trigger('willRender'); + } - UpdatableReference.prototype.value = function value() { - return this._value; + return bucket; }; - UpdatableReference.prototype.update = function update(value) { - var _value = this._value; + CurlyComponentManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { + var template = definition.template; + if (!template) { + var component = bucket.component; - if (value !== _value) { - this.tag.dirty(); - this._value = value; + template = this.templateFor(component, env); } + return env.getCompiledBlock(CurlyComponentLayoutCompiler, template); }; - return UpdatableReference; - })(EmberPathReference); - - exports.UpdatableReference = UpdatableReference; - - var UpdatablePrimitiveReference = (function (_UpdatableReference) { - babelHelpers.inherits(UpdatablePrimitiveReference, _UpdatableReference); + CurlyComponentManager.prototype.templateFor = function templateFor(component, env) { + var Template = _emberMetal.get(component, 'layout'); + var owner = component[_emberUtils.OWNER]; + if (Template) { + return env.getTemplate(Template, owner); + } + var layoutName = _emberMetal.get(component, 'layoutName'); + if (layoutName) { + var template = owner.lookup('template:' + layoutName); + if (template) { + return template; + } + } + return owner.lookup(DEFAULT_LAYOUT); + }; - function UpdatablePrimitiveReference() { - _UpdatableReference.apply(this, arguments); - } + CurlyComponentManager.prototype.getSelf = function getSelf(_ref) { + var component = _ref.component; - UpdatablePrimitiveReference.prototype.get = function get() { - return _glimmerRuntime.UNDEFINED_REFERENCE; + return component[_emberGlimmerComponent.ROOT_REF]; }; - return UpdatablePrimitiveReference; - })(UpdatableReference); + CurlyComponentManager.prototype.didCreateElement = function didCreateElement(_ref2, element, operations) { + var component = _ref2.component; + var classRef = _ref2.classRef; + var environment = _ref2.environment; - exports.UpdatablePrimitiveReference = UpdatablePrimitiveReference; + _emberViews.setViewElement(component, element); - var ConditionalReference = (function (_GlimmerConditionalReference) { - babelHelpers.inherits(ConditionalReference, _GlimmerConditionalReference); + var attributeBindings = component.attributeBindings; + var classNames = component.classNames; + var classNameBindings = component.classNameBindings; - ConditionalReference.create = function create(reference) { - if (_glimmerReference.isConst(reference)) { - var value = reference.value(); + if (attributeBindings && attributeBindings.length) { + applyAttributeBindings(element, attributeBindings, component, operations); + } else { + operations.addStaticAttribute(element, 'id', component.elementId); + _emberGlimmerUtilsBindings.IsVisibleBinding.install(element, component, operations); + } - if (_emberMetal.isProxy(value)) { - return new RootPropertyReference(value, 'isTruthy'); - } else { - return _glimmerRuntime.PrimitiveReference.create(_emberGlimmerUtilsToBool.default(value)); - } + if (classRef) { + operations.addDynamicAttribute(element, 'class', classRef); } - return new ConditionalReference(reference); - }; + if (classNames && classNames.length) { + classNames.forEach(function (name) { + operations.addStaticAttribute(element, 'class', name); + }); + } - function ConditionalReference(reference) { - _GlimmerConditionalReference.call(this, reference); + if (classNameBindings && classNameBindings.length) { + classNameBindings.forEach(function (binding) { + _emberGlimmerUtilsBindings.ClassNameBinding.install(element, component, binding, operations); + }); + } - this.objectTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - this.tag = _glimmerReference.combine([reference.tag, this.objectTag]); - } + component._transitionTo('hasElement'); - ConditionalReference.prototype.toBool = function toBool(predicate) { - if (_emberMetal.isProxy(predicate)) { - this.objectTag.update(_emberMetal.tagForProperty(predicate, 'isTruthy')); - return _emberMetal.get(predicate, 'isTruthy'); - } else { - this.objectTag.update(_emberMetal.tagFor(predicate)); - return _emberGlimmerUtilsToBool.default(predicate); + if (environment.isInteractive) { + component.trigger('willInsertElement'); } }; - return ConditionalReference; - })(_glimmerRuntime.ConditionalReference); + CurlyComponentManager.prototype.didRenderLayout = function didRenderLayout(bucket, bounds) { + bucket.component[_emberGlimmerComponent.BOUNDS] = bounds; + bucket.finalize(); + }; - exports.ConditionalReference = ConditionalReference; + CurlyComponentManager.prototype.getTag = function getTag(_ref3) { + var component = _ref3.component; - var SimpleHelperReference = (function (_CachedReference2) { - babelHelpers.inherits(SimpleHelperReference, _CachedReference2); + return component[_emberGlimmerComponent.DIRTY_TAG]; + }; - SimpleHelperReference.create = function create(helper, args) { - if (_glimmerReference.isConst(args)) { - var positional = args.positional; - var named = args.named; + CurlyComponentManager.prototype.didCreate = function didCreate(_ref4) { + var component = _ref4.component; + var environment = _ref4.environment; - var positionalValue = positional.value(); - var namedValue = named.value(); - - var result = helper(positionalValue, namedValue); - - if (result === null) { - return _glimmerRuntime.NULL_REFERENCE; - } else if (result === undefined) { - return _glimmerRuntime.UNDEFINED_REFERENCE; - } else if (typeof result === 'object') { - return new RootReference(result); - } else { - return _glimmerRuntime.PrimitiveReference.create(result); - } - } else { - return new SimpleHelperReference(helper, args); + if (environment.isInteractive) { + component._transitionTo('inDOM'); + component.trigger('didInsertElement'); + component.trigger('didRender'); } }; - function SimpleHelperReference(helper, args) { - _CachedReference2.call(this); + CurlyComponentManager.prototype.update = function update(bucket, _, dynamicScope) { + var component = bucket.component; + var args = bucket.args; + var argsRevision = bucket.argsRevision; + var environment = bucket.environment; - this.tag = args.tag; - this.helper = helper; - this.args = args; - } + bucket.finalizer = _emberMetal._instrumentStart('render.component', rerenderInstrumentDetails, component); - SimpleHelperReference.prototype.compute = function compute() { - var helper = this.helper; - var _args = this.args; - var positional = _args.positional; - var named = _args.named; + if (!args.tag.validate(argsRevision)) { + var _args$value = args.value(); - var positionalValue = positional.value(); - var namedValue = named.value(); + var attrs = _args$value.attrs; + var props = _args$value.props; - return helper(positionalValue, namedValue); + bucket.argsRevision = args.tag.value(); + + var oldAttrs = component.attrs; + var newAttrs = attrs; + + component[_emberGlimmerComponent.IS_DISPATCHING_ATTRS] = true; + component.setProperties(props); + component[_emberGlimmerComponent.IS_DISPATCHING_ATTRS] = false; + + _emberViews.dispatchLifeCycleHook(component, 'didUpdateAttrs', oldAttrs, newAttrs); + _emberViews.dispatchLifeCycleHook(component, 'didReceiveAttrs', oldAttrs, newAttrs); + } + + if (environment.isInteractive) { + component.trigger('willUpdate'); + component.trigger('willRender'); + } }; - return SimpleHelperReference; - })(CachedReference); + CurlyComponentManager.prototype.didUpdateLayout = function didUpdateLayout(bucket) { + bucket.finalize(); + }; - exports.SimpleHelperReference = SimpleHelperReference; + CurlyComponentManager.prototype.didUpdate = function didUpdate(_ref5) { + var component = _ref5.component; + var environment = _ref5.environment; - var ClassBasedHelperReference = (function (_CachedReference3) { - babelHelpers.inherits(ClassBasedHelperReference, _CachedReference3); + if (environment.isInteractive) { + component.trigger('didUpdate'); + component.trigger('didRender'); + } + }; - ClassBasedHelperReference.create = function create(helperClass, vm, args) { - var instance = helperClass.create(); - vm.newDestroyable(instance); - return new ClassBasedHelperReference(instance, args); + CurlyComponentManager.prototype.getDestructor = function getDestructor(stateBucket) { + return stateBucket; }; - function ClassBasedHelperReference(instance, args) { - _CachedReference3.call(this); + return CurlyComponentManager; + })(_emberGlimmerSyntaxAbstractManager.default); - this.tag = _glimmerReference.combine([instance[_emberGlimmerHelper.RECOMPUTE_TAG], args.tag]); - this.instance = instance; - this.args = args; + var MANAGER = new CurlyComponentManager(); + + var TopComponentManager = (function (_CurlyComponentManager) { +babelHelpers.inherits(TopComponentManager, _CurlyComponentManager); + + function TopComponentManager() { + _CurlyComponentManager.apply(this, arguments); } - ClassBasedHelperReference.prototype.compute = function compute() { - var instance = this.instance; - var _args2 = this.args; - var positional = _args2.positional; - var named = _args2.named; + TopComponentManager.prototype.create = function create(environment, definition, args, dynamicScope, currentScope, hasBlock) { + var component = definition.ComponentClass.create(); - var positionalValue = positional.value(); - var namedValue = named.value(); + var finalizer = _emberMetal._instrumentStart('render.component', initialRenderInstrumentDetails, component); - return instance.compute(positionalValue, namedValue); - }; + dynamicScope.view = component; - return ClassBasedHelperReference; - })(CachedReference); + // We usually do this in the `didCreateElement`, but that hook doesn't fire for tagless components + if (component.tagName === '') { + if (environment.isInteractive) { + component.trigger('willRender'); + } - exports.ClassBasedHelperReference = ClassBasedHelperReference; + component._transitionTo('hasElement'); - var InternalHelperReference = (function (_CachedReference4) { - babelHelpers.inherits(InternalHelperReference, _CachedReference4); + if (environment.isInteractive) { + component.trigger('willInsertElement'); + } + } - function InternalHelperReference(helper, args) { - _CachedReference4.call(this); + processComponentInitializationAssertions(component, {}); - this.tag = args.tag; - this.helper = helper; - this.args = args; - } + return new ComponentStateBucket(environment, component, args, finalizer); + }; - // @implements PathReference + return TopComponentManager; + })(CurlyComponentManager); - InternalHelperReference.prototype.compute = function compute() { - var helper = this.helper; - var args = this.args; + var ROOT_MANAGER = new TopComponentManager(); - return helper(args); - }; + function tagName(vm) { + var tagName = vm.dynamicScope().view.tagName; - return InternalHelperReference; - })(CachedReference); + return _glimmerRuntime.PrimitiveReference.create(tagName === '' ? null : tagName || 'div'); + } - exports.InternalHelperReference = InternalHelperReference; + function ariaRole(vm) { + return vm.getSelf().get('ariaRole'); + } - var UnboundReference = (function (_ConstReference2) { - babelHelpers.inherits(UnboundReference, _ConstReference2); + var CurlyComponentDefinition = (function (_ComponentDefinition) { +babelHelpers.inherits(CurlyComponentDefinition, _ComponentDefinition); - function UnboundReference() { - _ConstReference2.apply(this, arguments); + function CurlyComponentDefinition(name, ComponentClass, template, args) { + _ComponentDefinition.call(this, name, MANAGER, ComponentClass); + this.template = template; + this.args = args; } - UnboundReference.create = function create(value) { - if (value === null) { - return _glimmerRuntime.NULL_REFERENCE; - } else if (value === undefined) { - return _glimmerRuntime.UNDEFINED_REFERENCE; - } else if (typeof value === 'object') { - return new UnboundReference(value); - } else { - return _glimmerRuntime.PrimitiveReference.create(value); - } - }; + return CurlyComponentDefinition; + })(_glimmerRuntime.ComponentDefinition); - UnboundReference.prototype.get = function get(key) { - return new UnboundReference(_emberMetal.get(this.inner, key)); - }; + exports.CurlyComponentDefinition = CurlyComponentDefinition; - return UnboundReference; - })(_glimmerReference.ConstReference); + var RootComponentDefinition = (function (_ComponentDefinition2) { +babelHelpers.inherits(RootComponentDefinition, _ComponentDefinition2); - exports.UnboundReference = UnboundReference; -}); -enifed('ember-glimmer/utils/string', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-glimmer - */ + function RootComponentDefinition(instance) { + _ComponentDefinition2.call(this, '-root', ROOT_MANAGER, { + class: instance.constructor, + create: function () { + return instance; + } + }); + this.template = undefined; + this.args = undefined; + } - 'use strict'; + return RootComponentDefinition; + })(_glimmerRuntime.ComponentDefinition); - exports.getSafeString = getSafeString; - exports.escapeExpression = escapeExpression; - exports.htmlSafe = htmlSafe; - exports.isHTMLSafe = isHTMLSafe; + exports.RootComponentDefinition = RootComponentDefinition; - var SafeString = (function () { - function SafeString(string) { - this.string = string; + var CurlyComponentLayoutCompiler = (function () { + function CurlyComponentLayoutCompiler(template) { + this.template = template; } - SafeString.prototype.toString = function toString() { - return '' + this.string; - }; - - SafeString.prototype.toHTML = function toHTML() { - return this.toString(); + CurlyComponentLayoutCompiler.prototype.compile = function compile(builder) { + builder.wrapLayout(this.template.asLayout()); + builder.tag.dynamic(tagName); + builder.attrs.dynamic('role', ariaRole); + builder.attrs.static('class', 'ember-view'); }; - return SafeString; + return CurlyComponentLayoutCompiler; })(); - exports.SafeString = SafeString; + CurlyComponentLayoutCompiler.id = 'curly'; +}); +enifed('ember-glimmer/syntax/dynamic-component', ['exports', '@glimmer/runtime', '@glimmer/reference', 'ember-metal'], function (exports, _glimmerRuntime, _glimmerReference, _emberMetal) { + 'use strict'; - function getSafeString() { + exports.closureComponentMacro = closureComponentMacro; + exports.dynamicComponentMacro = dynamicComponentMacro; + exports.blockComponentMacro = blockComponentMacro; + exports.inlineComponentMacro = inlineComponentMacro; - return SafeString; + function dynamicComponentFor(vm, symbolTable) { + var env = vm.env; + var args = vm.getArgs(); + var nameRef = args.positional.at(0); + + return new DynamicComponentReference({ nameRef: nameRef, env: env, symbolTable: symbolTable }); } - var escape = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - // jscs:disable - "'": ''', - // jscs:enable - '`': '`', - '=': '=' - }; + function closureComponentMacro(path, params, hash, _default, inverse, builder) { + var definitionArgs = [[['get', path]], hash, _default, inverse]; + var args = [params, hash, _default, inverse]; + builder.component.dynamic(definitionArgs, dynamicComponentFor, args, builder.symbolTable); + return true; + } - var possible = /[&<>"'`=]/; - var badChars = /[&<>"'`=]/g; + function dynamicComponentMacro(params, hash, _default, inverse, builder) { + var definitionArgs = [params.slice(0, 1), null, null, null]; + var args = [params.slice(1), hash, null, null]; + builder.component.dynamic(definitionArgs, dynamicComponentFor, args, builder.symbolTable); + return true; + } - function escapeChar(chr) { - return escape[chr]; + function blockComponentMacro(sexp, builder) { + var params = sexp[2]; + var hash = sexp[3]; + var _default = sexp[4]; + var inverse = sexp[5]; + + var definitionArgs = [params.slice(0, 1), null, null, null]; + var args = [params.slice(1), hash, _default, inverse]; + builder.component.dynamic(definitionArgs, dynamicComponentFor, args, builder.symbolTable); + return true; } - function escapeExpression(string) { - if (typeof string !== 'string') { - // don't escape SafeStrings, since they're already safe - if (string && string.toHTML) { - return string.toHTML(); - } else if (string == null) { - return ''; - } else if (!string) { - return string + ''; - } + function inlineComponentMacro(path, params, hash, builder) { + var definitionArgs = [params.slice(0, 1), null, null, null]; + var args = [params.slice(1), hash, null, null]; + builder.component.dynamic(definitionArgs, dynamicComponentFor, args, builder.symbolTable); + return true; + } - // Force a string conversion as this will be done by the append regardless and - // the regex test will do this transparently behind the scenes, causing issues if - // an object's to string has escaped characters in it. - string = '' + string; - } + var DynamicComponentReference = (function () { + function DynamicComponentReference(_ref) { + var nameRef = _ref.nameRef; + var env = _ref.env; + var symbolTable = _ref.symbolTable; + var args = _ref.args; - if (!possible.test(string)) { - return string; + this.tag = nameRef.tag; + this.nameRef = nameRef; + this.env = env; + this.symbolTable = symbolTable; + this.args = args; } - return string.replace(badChars, escapeChar); - } + DynamicComponentReference.prototype.value = function value() { + var env = this.env; + var nameRef = this.nameRef; + var symbolTable = this.symbolTable; + + var nameOrDef = nameRef.value(); + + if (typeof nameOrDef === 'string') { + var definition = env.getComponentDefinition([nameOrDef], symbolTable); + + return definition; + } else if (_glimmerRuntime.isComponentDefinition(nameOrDef)) { + return nameOrDef; + } else { + return null; + } + }; + + DynamicComponentReference.prototype.get = function get() { + return _glimmerReference.UNDEFINED_REFERENCE; + }; + + return DynamicComponentReference; + })(); +}); +enifed('ember-glimmer/syntax/input', ['exports', 'ember-metal', 'ember-glimmer/utils/bindings', 'ember-glimmer/syntax/dynamic-component'], function (exports, _emberMetal, _emberGlimmerUtilsBindings, _emberGlimmerSyntaxDynamicComponent) { /** - 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. - - ```javascript - Ember.String.htmlSafe('
    someString
    ') - ``` - - @method htmlSafe - @for Ember.String - @static - @return {Handlebars.SafeString} A string that will not be HTML escaped by Handlebars. - @public + @module ember + @submodule ember-glimmer */ + 'use strict'; - function htmlSafe(str) { - if (str === null || str === undefined) { - str = ''; - } else if (typeof str !== 'string') { - str = '' + str; - } - return new SafeString(str); + exports.inputMacro = inputMacro; + + function buildTextFieldSyntax(params, hash, builder) { + var definition = builder.env.getComponentDefinition(['-text-field'], builder.symbolTable); + builder.component.static(definition, [params, hash, null, null], builder.symbolTable); + return true; } /** - Detects if a string was decorated using `Ember.String.htmlSafe`. + The `{{input}}` helper lets you create an HTML `` component. + It causes an `Ember.TextField` component to be rendered. For more info, + see the [Ember.TextField](/api/classes/Ember.TextField.html) docs and + the [templates guide](http://emberjs.com/guides/templates/input-helpers/). + + ```handlebars + {{input value="987"}} + ``` + + renders as: + + ```HTML + + ``` + + ### Text field + + If no `type` option is specified, a default of type 'text' is used. + Many of the standard HTML attributes may be passed to this helper. + + + + + + + + + + + +
    `readonly``required``autofocus`
    `value``placeholder``disabled`
    `size``tabindex``maxlength`
    `name``min``max`
    `pattern``accept``autocomplete`
    `autosave``formaction``formenctype`
    `formmethod``formnovalidate``formtarget`
    `height``inputmode``multiple`
    `step``width``form`
    `selectionDirection``spellcheck` 
    + When set to a quoted string, these values will be directly applied to the HTML + element. When left unquoted, these values will be bound to a property on the + template's current rendering context (most typically a controller instance). + A very common use of this helper is to bind the `value` of an input to an Object's attribute: + + ```handlebars + Search: + {{input value=searchWord}} + ``` + + In this example, the inital value in the `` will be set to the value of `searchWord`. + If the user changes the text, the value of `searchWord` will also be updated. + + ### Actions + + The helper can send multiple actions based on user events. + The action property defines the action which is sent when + the user presses the return key. + + ```handlebars + {{input action="submit"}} + ``` + + The helper allows some user events to send actions. + + * `enter` + * `insert-newline` + * `escape-press` + * `focus-in` + * `focus-out` + * `key-press` + * `key-up` + + For example, if you desire an action to be sent when the input is blurred, + you only need to setup the action name to the event name property. + + ```handlebars + {{input focus-out="alertMessage"}} + ``` + See more about [Text Support Actions](/api/classes/Ember.TextField.html) + + ### Extending `Ember.TextField` + + Internally, `{{input type="text"}}` creates an instance of `Ember.TextField`, passing + arguments from the helper to `Ember.TextField`'s `create` method. You can extend the + capabilities of text inputs in your applications by reopening this class. For example, + if you are building a Bootstrap project where `data-*` attributes are used, you + can add one to the `TextField`'s `attributeBindings` property: ```javascript - var plainString = 'plain string', - safeString = Ember.String.htmlSafe('
    someValue
    '); + Ember.TextField.reopen({ + attributeBindings: ['data-error'] + }); + ``` - Ember.String.isHTMLSafe(plainString); // false - Ember.String.isHTMLSafe(safeString); // true + Keep in mind when writing `Ember.TextField` subclasses that `Ember.TextField` + itself extends `Ember.Component`. Expect isolated component semantics, not + legacy 1.x view semantics (like `controller` being present). + See more about [Ember components](/api/classes/Ember.Component.html) + + ### Checkbox + + Checkboxes are special forms of the `{{input}}` helper. To create a ``: + + ```handlebars + Emberize Everything: + {{input type="checkbox" name="isEmberized" checked=isEmberized}} ``` - @method isHTMLSafe - @for Ember.String - @static - @return {Boolean} `true` if the string was decorated with `htmlSafe`, `false` otherwise. + This will bind checked state of this checkbox to the value of `isEmberized` -- if either one changes, + it will be reflected in the other. + + The following HTML attributes can be set via the helper: + + * `checked` + * `disabled` + * `tabindex` + * `indeterminate` + * `name` + * `autofocus` + * `form` + + ### Extending `Ember.Checkbox` + + Internally, `{{input type="checkbox"}}` creates an instance of `Ember.Checkbox`, passing + arguments from the helper to `Ember.Checkbox`'s `create` method. You can extend the + capablilties of checkbox inputs in your applications by reopening this class. For example, + if you wanted to add a css class to all checkboxes in your application: + + ```javascript + Ember.Checkbox.reopen({ + classNames: ['my-app-checkbox'] + }); + ``` + + @method input + @for Ember.Templates.helpers + @param {Hash} options @public */ - function isHTMLSafe(str) { - return str && typeof str.toHTML === 'function'; - } -}); -enifed('ember-glimmer/utils/to-bool', ['exports', 'ember-runtime', 'ember-metal'], function (exports, _emberRuntime, _emberMetal) { - 'use strict'; - - exports.default = toBool; + function inputMacro(path, params, hash, builder) { + var keys = undefined; + var values = undefined; + var typeIndex = -1; + var valueIndex = -1; - function toBool(predicate) { - if (!predicate) { - return false; + if (hash) { + keys = hash[0]; + values = hash[1]; + typeIndex = keys.indexOf('type'); + valueIndex = keys.indexOf('value'); } - if (predicate === true) { - return true; + if (!params) { + params = []; } - if (_emberRuntime.isArray(predicate)) { - return _emberMetal.get(predicate, 'length') !== 0; + if (typeIndex > -1) { + var typeArg = values[typeIndex]; + if (!Array.isArray(typeArg)) { + if (typeArg === 'checkbox') { + + _emberGlimmerUtilsBindings.wrapComponentClassAttribute(hash); + + var definition = builder.env.getComponentDefinition(['-checkbox'], builder.symbolTable); + builder.component.static(definition, [params, hash, null, null], builder.symbolTable); + return true; + } else { + return buildTextFieldSyntax(params, hash, builder); + } + } + } else { + return buildTextFieldSyntax(params, hash, builder); } - return true; + return _emberGlimmerSyntaxDynamicComponent.dynamicComponentMacro(params, hash, null, null, builder); } }); -enifed('ember-glimmer/views/outlet', ['exports', 'ember-utils', 'glimmer-reference', 'ember-environment', 'ember-metal'], function (exports, _emberUtils, _glimmerReference, _emberEnvironment, _emberMetal) { +enifed('ember-glimmer/syntax/mount', ['exports', '@glimmer/runtime', '@glimmer/reference', 'ember-metal', 'ember-glimmer/utils/references', 'ember-routing', 'ember-glimmer/syntax/outlet', 'container', 'ember-glimmer/syntax/abstract-manager'], function (exports, _glimmerRuntime, _glimmerReference, _emberMetal, _emberGlimmerUtilsReferences, _emberRouting, _emberGlimmerSyntaxOutlet, _container, _emberGlimmerSyntaxAbstractManager) { /** @module ember @submodule ember-glimmer */ 'use strict'; - var OutletStateReference = (function () { - function OutletStateReference(outletView) { - this.outletView = outletView; - this.tag = outletView._tag; - } - - // So this is a relic of the past that SHOULD go away - // in 3.0. Preferably it is deprecated in the release that - // follows the Glimmer release. - - OutletStateReference.prototype.get = function get(key) { - return new ChildOutletStateReference(this, key); - }; - - OutletStateReference.prototype.value = function value() { - return this.outletView.outletState; - }; - - OutletStateReference.prototype.getOrphan = function getOrphan(name) { - return new OrphanedOutletStateReference(this, name); - }; + exports.mountMacro = mountMacro; - OutletStateReference.prototype.update = function update(state) { - this.outletView.setOutletState(state); - }; - - return OutletStateReference; - })(); - - var OrphanedOutletStateReference = (function (_OutletStateReference) { - babelHelpers.inherits(OrphanedOutletStateReference, _OutletStateReference); - - function OrphanedOutletStateReference(root, name) { - _OutletStateReference.call(this, root.outletView); - this.root = root; - this.name = name; - } + /** + The `{{mount}}` helper lets you embed a routeless engine in a template. + Mounting an engine will cause an instance to be booted and its `application` + template to be rendered. + + For example, the following template mounts the `ember-chat` engine: + + ```handlebars + {{! application.hbs }} + {{mount "ember-chat"}} + ``` + + Currently, the engine name is the only argument that can be passed to + `{{mount}}`. + + @method mount + @for Ember.Templates.helpers + @category ember-application-engines + @public + */ - OrphanedOutletStateReference.prototype.value = function value() { - var rootState = this.root.value(); + function mountMacro(path, params, hash, builder) { - var orphans = rootState.outlets.main.outlets.__ember_orphans__; + var name = params[0]; - if (!orphans) { - return null; - } + builder.component.static(new MountDefinition(name, builder.env), [params, hash, null, null], builder.symbolTable); + return true; + } - var matched = orphans.outlets[this.name]; + var MountManager = (function (_AbstractManager) { + babelHelpers.inherits(MountManager, _AbstractManager); - if (!matched) { - return null; - } + function MountManager() { + _AbstractManager.apply(this, arguments); + } - var state = new _emberUtils.EmptyObject(); - state[matched.render.outlet] = matched; - matched.wasUsed = true; - return { outlets: state }; + MountManager.prototype.prepareArgs = function prepareArgs(definition, args) { + return args; }; - return OrphanedOutletStateReference; - })(OutletStateReference); + MountManager.prototype.create = function create(environment, _ref, args, dynamicScope) { + var name = _ref.name; + var env = _ref.env; - var ChildOutletStateReference = (function () { - function ChildOutletStateReference(parent, key) { - this.parent = parent; - this.key = key; - this.tag = parent.tag; - } + dynamicScope.outletState = _glimmerReference.UNDEFINED_REFERENCE; - ChildOutletStateReference.prototype.get = function get(key) { - return new ChildOutletStateReference(this, key); - }; + var engine = env.owner.buildChildEngineInstance(name); - ChildOutletStateReference.prototype.value = function value() { - return this.parent.value()[this.key]; - }; + engine.boot(); - return ChildOutletStateReference; - })(); + return { engine: engine }; + }; - var OutletView = (function () { - OutletView.extend = function extend(injections) { - return (function (_OutletView) { - babelHelpers.inherits(_class, _OutletView); + MountManager.prototype.layoutFor = function layoutFor(definition, _ref2, env) { + var engine = _ref2.engine; - function _class() { - _OutletView.apply(this, arguments); - } + var template = engine.lookup('template:application'); + return env.getCompiledBlock(_emberGlimmerSyntaxOutlet.OutletLayoutCompiler, template); + }; - _class.create = function create(options) { - if (options) { - return _OutletView.create.call(this, _emberUtils.assign({}, injections, options)); - } else { - return _OutletView.create.call(this, injections); - } - }; + MountManager.prototype.getSelf = function getSelf(_ref3) { + var engine = _ref3.engine; - return _class; - })(OutletView); + var applicationFactory = engine[_container.FACTORY_FOR]('controller:application'); + var factory = applicationFactory || _emberRouting.generateControllerFactory(engine, 'application'); + return new _emberGlimmerUtilsReferences.RootReference(factory.create()); }; - OutletView.reopenClass = function reopenClass(injections) { - _emberUtils.assign(this, injections); + MountManager.prototype.getTag = function getTag() { + return null; }; - OutletView.create = function create(options) { - var _environment = options._environment; - var renderer = options.renderer; - var template = options.template; + MountManager.prototype.getDestructor = function getDestructor(_ref4) { + var engine = _ref4.engine; - var owner = options[_emberUtils.OWNER]; - return new OutletView(_environment, renderer, owner, template); + return engine; }; - function OutletView(_environment, renderer, owner, template) { - this._environment = _environment; - this.renderer = renderer; - this.owner = owner; - this.template = template; - this.outletState = null; - this._tag = new _glimmerReference.DirtyableTag(); - } + MountManager.prototype.didCreateElement = function didCreateElement() {}; - OutletView.prototype.appendTo = function appendTo(selector) { - var env = this._environment || _emberEnvironment.environment; - var target = undefined; + MountManager.prototype.didRenderLayout = function didRenderLayout() {}; - if (env.hasDOM) { - target = typeof selector === 'string' ? document.querySelector(selector) : selector; - } else { - target = selector; - } + MountManager.prototype.didCreate = function didCreate(state) {}; - _emberMetal.run.schedule('render', this.renderer, 'appendOutletView', this, target); - }; + MountManager.prototype.update = function update(state, args, dynamicScope) {}; - OutletView.prototype.rerender = function rerender() {}; + MountManager.prototype.didUpdateLayout = function didUpdateLayout() {}; - OutletView.prototype.setOutletState = function setOutletState(state) { - this.outletState = { - outlets: { - main: state - }, - render: { - owner: undefined, - into: undefined, - outlet: 'main', - name: '-top-level', - controller: undefined, - ViewClass: undefined, - template: undefined - } - }; - this._tag.dirty(); - }; + MountManager.prototype.didUpdate = function didUpdate(state) {}; - OutletView.prototype.toReference = function toReference() { - return new OutletStateReference(this); - }; + return MountManager; + })(_emberGlimmerSyntaxAbstractManager.default); - OutletView.prototype.destroy = function destroy() {}; + var MOUNT_MANAGER = new MountManager(); - return OutletView; - })(); + var MountDefinition = (function (_ComponentDefinition) { + babelHelpers.inherits(MountDefinition, _ComponentDefinition); - exports.default = OutletView; + function MountDefinition(name, env) { + _ComponentDefinition.call(this, name, MOUNT_MANAGER, null); + this.env = env; + } + + return MountDefinition; + })(_glimmerRuntime.ComponentDefinition); }); -enifed('ember-metal/alias', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/error', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/meta', 'ember-metal/dependent_keys'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalError, _emberMetalProperties, _emberMetalComputed, _emberMetalMeta, _emberMetalDependent_keys) { +enifed('ember-glimmer/syntax/outlet', ['exports', 'ember-utils', '@glimmer/runtime', 'ember-metal', 'ember-glimmer/utils/references', 'ember-glimmer/syntax/abstract-manager', '@glimmer/reference'], function (exports, _emberUtils, _glimmerRuntime, _emberMetal, _emberGlimmerUtilsReferences, _emberGlimmerSyntaxAbstractManager, _glimmerReference) { + /** + @module ember + @submodule ember-glimmer + */ 'use strict'; - exports.default = alias; - exports.AliasedProperty = AliasedProperty; + exports.outletMacro = outletMacro; - var CONSUMED = {}; + function outletComponentFor(vm) { + var _vm$dynamicScope = vm.dynamicScope(); - function alias(altKey) { - return new AliasedProperty(altKey); - } + var outletState = _vm$dynamicScope.outletState; - function AliasedProperty(altKey) { - this.isDescriptor = true; - this.altKey = altKey; - this._dependentKeys = [altKey]; + var args = vm.getArgs(); + var outletNameRef = undefined; + if (args.positional.length === 0) { + outletNameRef = new _glimmerReference.ConstReference('main'); + } else { + outletNameRef = args.positional.at(0); + } + + return new OutletComponentReference(outletNameRef, outletState); } - AliasedProperty.prototype = Object.create(_emberMetalProperties.Descriptor.prototype); + /** + The `{{outlet}}` helper lets you specify where a child route will render in + your template. An important use of the `{{outlet}}` helper is in your + application's `application.hbs` file: + + ```handlebars + {{! app/templates/application.hbs }} + + {{my-header}} +
    + + {{outlet}} +
    + + {{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' }); + } + }); + ``` + + 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. + + @method outlet + @param {String} [name] + @for Ember.Templates.helpers + @public + */ - AliasedProperty.prototype.setup = function (obj, keyName) { - var meta = _emberMetalMeta.meta(obj); - if (meta.peekWatching(keyName)) { - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); + function outletMacro(path, params, hash, builder) { + if (!params) { + params = []; } - }; + var definitionArgs = [params.slice(0, 1), null, null, null]; + builder.component.dynamic(definitionArgs, outletComponentFor, _glimmerRuntime.CompiledArgs.empty(), builder.symbolTable, null); + return true; + } - AliasedProperty.prototype.teardown = function (obj, keyName) { - var meta = _emberMetalMeta.meta(obj); - if (meta.peekWatching(keyName)) { - _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); + var OutletComponentReference = (function () { + function OutletComponentReference(outletNameRef, parentOutletStateRef) { + this.outletNameRef = outletNameRef; + this.parentOutletStateRef = parentOutletStateRef; + this.definition = null; + this.lastState = null; + var outletStateTag = this.outletStateTag = new _glimmerReference.UpdatableTag(parentOutletStateRef.tag); + this.tag = _glimmerReference.combine([outletStateTag.tag, outletNameRef.tag]); } - }; - AliasedProperty.prototype.willWatch = function (obj, keyName) { - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); - }; + OutletComponentReference.prototype.value = function value() { + var outletNameRef = this.outletNameRef; + var parentOutletStateRef = this.parentOutletStateRef; + var definition = this.definition; + var lastState = this.lastState; - AliasedProperty.prototype.didUnwatch = function (obj, keyName) { - _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); - }; + var outletName = outletNameRef.value(); + var outletStateRef = parentOutletStateRef.get('outlets').get(outletName); + var newState = this.lastState = outletStateRef.value(); - AliasedProperty.prototype.get = function AliasedProperty_get(obj, keyName) { - var ret = _emberMetalProperty_get.get(obj, this.altKey); - var meta = _emberMetalMeta.meta(obj); - var cache = meta.writableCache(); - if (cache[keyName] !== CONSUMED) { - cache[keyName] = CONSUMED; - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); + this.outletStateTag.update(outletStateRef.tag); + + definition = revalidate(definition, lastState, newState); + + var hasTemplate = newState && newState.render.template; + + if (definition) { + return definition; + } else if (hasTemplate) { + return this.definition = new OutletComponentDefinition(outletName, newState.render.template); + } else { + return this.definition = null; + } + }; + + return OutletComponentReference; + })(); + + function revalidate(definition, lastState, newState) { + if (!lastState && !newState) { + return definition; } - return ret; - }; - AliasedProperty.prototype.set = function AliasedProperty_set(obj, keyName, value) { - return _emberMetalProperty_set.set(obj, this.altKey, value); - }; + if (!lastState && newState || lastState && !newState) { + return null; + } - AliasedProperty.prototype.readOnly = function () { - this.set = AliasedProperty_readOnlySet; - return this; - }; + if (newState.render.template === lastState.render.template && newState.render.controller === lastState.render.controller) { + return definition; + } - function AliasedProperty_readOnlySet(obj, keyName, value) { - throw new _emberMetalError.default('Cannot set read-only property \'' + keyName + '\' on object: ' + _emberUtils.inspect(obj)); + return null; } - AliasedProperty.prototype.oneWay = function () { - this.set = AliasedProperty_oneWaySet; - return this; - }; + function instrumentationPayload(_ref) { + var _ref$render = _ref.render; + var name = _ref$render.name; + var outlet = _ref$render.outlet; - function AliasedProperty_oneWaySet(obj, keyName, value) { - _emberMetalProperties.defineProperty(obj, keyName, null); - return _emberMetalProperty_set.set(obj, keyName, value); + return { object: name + ':' + outlet }; } - // Backwards compatibility with Ember Data. - AliasedProperty.prototype._meta = undefined; - AliasedProperty.prototype.meta = _emberMetalComputed.ComputedProperty.prototype.meta; -}); -enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember-environment', 'ember-metal/run_loop', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/events', 'ember-metal/observer', 'ember-metal/path_cache'], function (exports, _emberUtils, _emberConsole, _emberEnvironment, _emberMetalRun_loop, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalEvents, _emberMetalObserver, _emberMetalPath_cache) { - 'use strict'; + function NOOP() {} - exports.bind = bind; + var StateBucket = (function () { + function StateBucket(outletState) { + this.outletState = outletState; + this.instrument(); + } - /** - @module ember - @submodule ember-metal - */ + StateBucket.prototype.instrument = function instrument() { + this.finalizer = _emberMetal._instrumentStart('render.outlet', instrumentationPayload, this.outletState); + }; - // .......................................................... - // BINDING - // + StateBucket.prototype.finalize = function finalize() { + var finalizer = this.finalizer; - function Binding(toPath, fromPath) { - // Configuration - this._from = fromPath; - this._to = toPath; - this._oneWay = undefined; + finalizer(); + this.finalizer = NOOP; + }; - // State - this._direction = undefined; - this._readyToSync = undefined; - this._fromObj = undefined; - this._fromPath = undefined; - this._toObj = undefined; - } + return StateBucket; + })(); - /** - @class Binding - @namespace Ember - @deprecated See http://emberjs.com/deprecations/v2.x#toc_ember-binding - @public - */ + var OutletComponentManager = (function (_AbstractManager) { + babelHelpers.inherits(OutletComponentManager, _AbstractManager); - Binding.prototype = { - /** - This copies the Binding so it can be connected to another object. - @method copy - @return {Ember.Binding} `this` - @public - */ - copy: function () { - var copy = new Binding(this._to, this._from); - if (this._oneWay) { - copy._oneWay = true; - } - return copy; - }, + function OutletComponentManager() { + _AbstractManager.apply(this, arguments); + } - // .......................................................... - // CONFIG - // + OutletComponentManager.prototype.prepareArgs = function prepareArgs(definition, args) { + return args; + }; - /** - This will set `from` property path to the specified value. It will not - attempt to resolve this property path to an actual object until you - connect the binding. - The binding will search for the property path starting at the root object - you pass when you `connect()` the binding. It follows the same rules as - `get()` - see that method for more information. - @method from - @param {String} path The property path to connect to. - @return {Ember.Binding} `this` - @public - */ - from: function (path) { - this._from = path; - return this; - }, + OutletComponentManager.prototype.create = function create(environment, definition, args, dynamicScope) { - /** - This will set the `to` property path to the specified value. It will not - attempt to resolve this property path to an actual object until you - connect the binding. - The binding will search for the property path starting at the root object - you pass when you `connect()` the binding. It follows the same rules as - `get()` - see that method for more information. - @method to - @param {String|Tuple} path A property path or tuple. - @return {Ember.Binding} `this` - @public - */ - to: function (path) { - this._to = path; - return this; - }, + var outletStateReference = dynamicScope.outletState = dynamicScope.outletState.get('outlets').get(definition.outletName); + var outletState = outletStateReference.value(); + return new StateBucket(outletState); + }; - /** - Configures the binding as one way. A one-way binding will relay changes - on the `from` side to the `to` side, but not the other way around. This - means that if you change the `to` side directly, the `from` side may have - a different value. - @method oneWay - @return {Ember.Binding} `this` - @public - */ - oneWay: function () { - this._oneWay = true; - return this; - }, + OutletComponentManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { + return env.getCompiledBlock(OutletLayoutCompiler, definition.template); + }; - /** - @method toString - @return {String} string representation of binding - @public - */ - toString: function () { - var oneWay = this._oneWay ? '[oneWay]' : ''; - return 'Ember.Binding<' + _emberUtils.guidFor(this) + '>(' + this._from + ' -> ' + this._to + ')' + oneWay; - }, + OutletComponentManager.prototype.getSelf = function getSelf(_ref2) { + var outletState = _ref2.outletState; - // .......................................................... - // CONNECT AND SYNC - // + return new _emberGlimmerUtilsReferences.RootReference(outletState.render.controller); + }; - /** - Attempts to connect this binding instance so that it can receive and relay - changes. This method will raise an exception if you have not set the - from/to properties yet. - @method connect - @param {Object} obj The root object for this binding. - @return {Ember.Binding} `this` - @public - */ - connect: function (obj) { + OutletComponentManager.prototype.getTag = function getTag() { + return null; + }; - var fromObj = undefined, - fromPath = undefined, - possibleGlobal = undefined; + OutletComponentManager.prototype.getDestructor = function getDestructor() { + return null; + }; - // If the binding's "from" path could be interpreted as a global, verify - // whether the path refers to a global or not by consulting `Ember.lookup`. - if (_emberMetalPath_cache.isGlobalPath(this._from)) { - var _name = _emberMetalPath_cache.getFirstKey(this._from); - possibleGlobal = _emberEnvironment.context.lookup[_name]; + OutletComponentManager.prototype.didRenderLayout = function didRenderLayout(bucket) { + bucket.finalize(); + }; - if (possibleGlobal) { - fromObj = possibleGlobal; - fromPath = _emberMetalPath_cache.getTailPath(this._from); - } - } + OutletComponentManager.prototype.didCreateElement = function didCreateElement() {}; - if (fromObj === undefined) { - fromObj = obj; - fromPath = this._from; - } + OutletComponentManager.prototype.didCreate = function didCreate(state) {}; - _emberMetalProperty_set.trySet(obj, this._to, _emberMetalProperty_get.get(fromObj, fromPath)); + OutletComponentManager.prototype.update = function update(bucket) {}; - // Add an observer on the object to be notified when the binding should be updated. - _emberMetalObserver.addObserver(fromObj, fromPath, this, 'fromDidChange'); + OutletComponentManager.prototype.didUpdateLayout = function didUpdateLayout(bucket) {}; - // If the binding is a two-way binding, also set up an observer on the target. - if (!this._oneWay) { - _emberMetalObserver.addObserver(obj, this._to, this, 'toDidChange'); - } + OutletComponentManager.prototype.didUpdate = function didUpdate(state) {}; - _emberMetalEvents.addListener(obj, 'willDestroy', this, 'disconnect'); + return OutletComponentManager; + })(_emberGlimmerSyntaxAbstractManager.default); - fireDeprecations(obj, this._to, this._from, possibleGlobal, this._oneWay, !possibleGlobal && !this._oneWay); + var MANAGER = new OutletComponentManager(); - this._readyToSync = true; - this._fromObj = fromObj; - this._fromPath = fromPath; - this._toObj = obj; + var TopLevelOutletComponentManager = (function (_OutletComponentManager) { + babelHelpers.inherits(TopLevelOutletComponentManager, _OutletComponentManager); - return this; - }, + function TopLevelOutletComponentManager() { + _OutletComponentManager.apply(this, arguments); + } - /** - Disconnects the binding instance. Changes will no longer be relayed. You - will not usually need to call this method. - @method disconnect - @return {Ember.Binding} `this` - @public - */ - disconnect: function () { + TopLevelOutletComponentManager.prototype.create = function create(environment, definition, args, dynamicScope) { - // Remove an observer on the object so we're no longer notified of - // changes that should update bindings. - _emberMetalObserver.removeObserver(this._fromObj, this._fromPath, this, 'fromDidChange'); + return new StateBucket(dynamicScope.outletState.value()); + }; - // If the binding is two-way, remove the observer from the target as well. - if (!this._oneWay) { - _emberMetalObserver.removeObserver(this._toObj, this._to, this, 'toDidChange'); - } + TopLevelOutletComponentManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { + return env.getCompiledBlock(TopLevelOutletLayoutCompiler, definition.template); + }; - this._readyToSync = false; // Disable scheduled syncs... - return this; - }, + return TopLevelOutletComponentManager; + })(OutletComponentManager); - // .......................................................... - // PRIVATE - // + var TOP_LEVEL_MANAGER = new TopLevelOutletComponentManager(); - /* Called when the from side changes. */ - fromDidChange: function (target) { - this._scheduleSync('fwd'); - }, + var TopLevelOutletComponentDefinition = (function (_ComponentDefinition) { + babelHelpers.inherits(TopLevelOutletComponentDefinition, _ComponentDefinition); - /* Called when the to side changes. */ - toDidChange: function (target) { - this._scheduleSync('back'); - }, + function TopLevelOutletComponentDefinition(instance) { + _ComponentDefinition.call(this, 'outlet', TOP_LEVEL_MANAGER, instance); + this.template = instance.template; + _emberUtils.generateGuid(this); + } - _scheduleSync: function (dir) { - var existingDir = this._direction; + return TopLevelOutletComponentDefinition; + })(_glimmerRuntime.ComponentDefinition); - // If we haven't scheduled the binding yet, schedule it. - if (existingDir === undefined) { - _emberMetalRun_loop.default.schedule('sync', this, '_sync'); - this._direction = dir; - } + exports.TopLevelOutletComponentDefinition = TopLevelOutletComponentDefinition; - // If both a 'back' and 'fwd' sync have been scheduled on the same object, - // default to a 'fwd' sync so that it remains deterministic. - if (existingDir === 'back' && dir === 'fwd') { - this._direction = 'fwd'; - } - }, + var TopLevelOutletLayoutCompiler = (function () { + function TopLevelOutletLayoutCompiler(template) { + this.template = template; + } - _sync: function () { - var log = _emberEnvironment.ENV.LOG_BINDINGS; + TopLevelOutletLayoutCompiler.prototype.compile = function compile(builder) { + builder.wrapLayout(this.template.asLayout()); + builder.tag.static('div'); + builder.attrs.static('id', _emberUtils.guidFor(this)); + builder.attrs.static('class', 'ember-view'); + }; - var toObj = this._toObj; + return TopLevelOutletLayoutCompiler; + })(); - // Don't synchronize destroyed objects or disconnected bindings. - if (toObj.isDestroyed || !this._readyToSync) { - return; - } + TopLevelOutletLayoutCompiler.id = 'top-level-outlet'; - // Get the direction of the binding for the object we are - // synchronizing from. - var direction = this._direction; + var OutletComponentDefinition = (function (_ComponentDefinition2) { + babelHelpers.inherits(OutletComponentDefinition, _ComponentDefinition2); - var fromObj = this._fromObj; - var fromPath = this._fromPath; + function OutletComponentDefinition(outletName, template) { + _ComponentDefinition2.call(this, 'outlet', MANAGER, null); + this.outletName = outletName; + this.template = template; + _emberUtils.generateGuid(this); + } - this._direction = undefined; + return OutletComponentDefinition; + })(_glimmerRuntime.ComponentDefinition); - // If we're synchronizing from the remote object... - if (direction === 'fwd') { - var fromValue = _emberMetalProperty_get.get(fromObj, fromPath); - if (log) { - _emberConsole.default.log(' ', this.toString(), '->', fromValue, fromObj); - } - if (this._oneWay) { - _emberMetalProperty_set.trySet(toObj, this._to, fromValue); - } else { - _emberMetalObserver._suspendObserver(toObj, this._to, this, 'toDidChange', function () { - _emberMetalProperty_set.trySet(toObj, this._to, fromValue); - }); - } - // If we're synchronizing *to* the remote object. - } else if (direction === 'back') { - var toValue = _emberMetalProperty_get.get(toObj, this._to); - if (log) { - _emberConsole.default.log(' ', this.toString(), '<-', toValue, toObj); - } - _emberMetalObserver._suspendObserver(fromObj, fromPath, this, 'fromDidChange', function () { - _emberMetalProperty_set.trySet(fromObj, fromPath, toValue); - }); - } + var OutletLayoutCompiler = (function () { + function OutletLayoutCompiler(template) { + this.template = template; } - }; + OutletLayoutCompiler.prototype.compile = function compile(builder) { + builder.wrapLayout(this.template.asLayout()); + }; - function fireDeprecations(obj, toPath, fromPath, deprecateGlobal, deprecateOneWay, deprecateAlias) { - var deprecateGlobalMessage = '`Ember.Binding` is deprecated. Since you' + ' are binding to a global consider using a service instead.'; - var deprecateOneWayMessage = '`Ember.Binding` is deprecated. Since you' + ' are using a `oneWay` binding consider using a `readOnly` computed' + ' property instead.'; - var deprecateAliasMessage = '`Ember.Binding` is deprecated. Consider' + ' using an `alias` computed property instead.'; + return OutletLayoutCompiler; + })(); - var objectInfo = 'The `' + toPath + '` property of `' + obj + '` is an `Ember.Binding` connected to `' + fromPath + '`, but '; - } + exports.OutletLayoutCompiler = OutletLayoutCompiler; - function mixinProperties(to, from) { - for (var key in from) { - if (from.hasOwnProperty(key)) { - to[key] = from[key]; - } - } - } + OutletLayoutCompiler.id = 'outlet'; +}); +enifed('ember-glimmer/syntax/render', ['exports', '@glimmer/runtime', '@glimmer/reference', 'ember-metal', 'ember-glimmer/utils/references', 'ember-routing', 'ember-glimmer/syntax/outlet', 'container', 'ember-glimmer/syntax/abstract-manager'], function (exports, _glimmerRuntime, _glimmerReference, _emberMetal, _emberGlimmerUtilsReferences, _emberRouting, _emberGlimmerSyntaxOutlet, _container, _emberGlimmerSyntaxAbstractManager) { + /** + @module ember + @submodule ember-glimmer + */ + 'use strict'; - mixinProperties(Binding, { + exports.renderMacro = renderMacro; - /* - See `Ember.Binding.from`. - @method from - @static - */ - from: function (from) { - var C = this; - return new C(undefined, from); - }, + function makeComponentDefinition(vm) { + var env = vm.env; + var args = vm.getArgs(); + var nameRef = args.positional.at(0); - /* - See `Ember.Binding.to`. - @method to - @static - */ - to: function (to) { - var C = this; - return new C(to, undefined); + var templateName = nameRef.value(); + + var template = env.owner.lookup('template:' + templateName); + + var controllerName = undefined; + + if (args.named.has('controller')) { + var controllerNameRef = args.named.get('controller'); + + controllerName = controllerNameRef.value(); + } else { + controllerName = templateName; } - }); + + if (args.positional.length === 1) { + return new _glimmerReference.ConstReference(new RenderDefinition(controllerName, template, env, SINGLETON_RENDER_MANAGER)); + } else { + return new _glimmerReference.ConstReference(new RenderDefinition(controllerName, template, env, NON_SINGLETON_RENDER_MANAGER)); + } + } + /** - An `Ember.Binding` connects the properties of two objects so that whenever - the value of one property changes, the other property will be changed also. - - ## Automatic Creation of Bindings with `/^*Binding/`-named Properties. - - You do not usually create Binding objects directly but instead describe - bindings in your class or object definition using automatic binding - detection. - - Properties ending in a `Binding` suffix will be converted to `Ember.Binding` - instances. The value of this property should be a string representing a path - to another object or a custom binding instance created using Binding helpers - (see "One Way Bindings"): - - ``` - valueBinding: "MyApp.someController.title" - ``` - - This will create a binding from `MyApp.someController.title` to the `value` - property of your object instance automatically. Now the two values will be - kept in sync. - - ## One Way Bindings - - One especially useful binding customization you can use is the `oneWay()` - helper. This helper tells Ember that you are only interested in - receiving changes on the object you are binding from. For example, if you - are binding to a preference and you want to be notified if the preference - has changed, but your object will not be changing the preference itself, you - could do: - - ``` - bigTitlesBinding: Ember.Binding.oneWay("MyApp.preferencesController.bigTitles") - ``` - - This way if the value of `MyApp.preferencesController.bigTitles` changes the - `bigTitles` property of your object will change also. However, if you - change the value of your `bigTitles` property, it will not update the - `preferencesController`. - - One way bindings are almost twice as fast to setup and twice as fast to - execute because the binding only has to worry about changes to one side. - - You should consider using one way bindings anytime you have an object that - may be created frequently and you do not intend to change a property; only - to monitor it for changes (such as in the example above). - - ## Adding Bindings Manually - - All of the examples above show you how to configure a custom binding, but the - result of these customizations will be a binding template, not a fully active - Binding instance. The binding will actually become active only when you - instantiate the object the binding belongs to. It is useful, however, to - understand what actually happens when the binding is activated. + Calling ``{{render}}`` from within a template will insert another + template that matches the provided name. The inserted template will + access its properties on its own controller (rather than the controller + of the parent template). - For a binding to function it must have at least a `from` property and a `to` - property. The `from` property path points to the object/key that you want to - bind from while the `to` path points to the object/key you want to bind to. + If a view class with the same name exists, the view class also will be used. + Note: A given controller may only be used *once* in your app in this manner. + A singleton instance of the controller will be created for you. - When you define a custom binding, you are usually describing the property - you want to bind from (such as `MyApp.someController.value` in the examples - above). When your object is created, it will automatically assign the value - you want to bind `to` based on the name of your binding key. In the - examples above, during init, Ember objects will effectively call - something like this on your binding: + Example: ```javascript - binding = Ember.Binding.from("valueBinding").to("value"); + App.NavigationController = Ember.Controller.extend({ + who: "world" + }); ``` - This creates a new binding instance based on the template you provide, and - sets the to path to the `value` property of the new object. Now that the - binding is fully configured with a `from` and a `to`, it simply needs to be - connected to become active. This is done through the `connect()` method: - - ```javascript - binding.connect(this); + ```handlebars + + Hello, {{who}}. ``` - Note that when you connect a binding you pass the object you want it to be - connected to. This object will be used as the root for both the from and - to side of the binding when inspecting relative paths. This allows the - binding to be automatically inherited by subclassed objects as well. - - This also allows you to bind between objects using the paths you declare in - `from` and `to`: - - ```javascript - // Example 1 - binding = Ember.Binding.from("App.someObject.value").to("value"); - binding.connect(this); - - // Example 2 - binding = Ember.Binding.from("parentView.value").to("App.someObject.value"); - binding.connect(this); + ```handlebars + +

    My great app

    + {{render "navigation"}} ``` - Now that the binding is connected, it will observe both the from and to side - and relay changes. - - If you ever needed to do so (you almost never will, but it is useful to - understand this anyway), you could manually create an active binding by - using the `Ember.bind()` helper method. (This is the same method used by - to setup your bindings on objects): - - ```javascript - Ember.bind(MyApp.anotherObject, "value", "MyApp.someController.value"); + ```html +

    My great app

    +
    + Hello, world. +
    ``` - Both of these code fragments have the same effect as doing the most friendly - form of binding creation like so: + Optionally you may provide a second argument: a property path + that will be bound to the `model` property of the controller. + If a `model` property path is specified, then a new instance of the + controller will be created and `{{render}}` can be used multiple times + with the same name. - ```javascript - MyApp.anotherObject = Ember.Object.create({ - valueBinding: "MyApp.someController.value", + For example if you had this `author` template. - // OTHER CODE FOR THIS OBJECT... - }); + ```handlebars +
    + Written by {{firstName}} {{lastName}}. + Total Posts: {{postCount}} +
    ``` - Ember's built in binding creation method makes it easy to automatically - create bindings for you. You should always use the highest-level APIs - available, even if you understand how it works underneath. + You could render it inside the `post` template using the `render` helper. - @class Binding - @namespace Ember - @since Ember 0.9 - @public - */ - // Ember.Binding = Binding; ES6TODO: where to put this? - - /** - Global helper method to create a new binding. Just pass the root object - along with a `to` and `from` path to create and connect the binding. + ```handlebars +
    +

    {{title}}

    +
    {{body}}
    + {{render "author" author}} +
    + ``` - @method bind - @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 + @method render + @for Ember.Templates.helpers + @param {String} name + @param {Object?} context + @param {Hash} options + @return {String} HTML string @public */ - function bind(obj, to, from) { - return new Binding(to, from).connect(obj); + function renderMacro(path, params, hash, builder) { + if (!params) { + params = []; + } + var definitionArgs = [params.slice(0), hash, null, null]; + var args = [params.slice(1), hash, null, null]; + builder.component.dynamic(definitionArgs, makeComponentDefinition, args, builder.symbolTable); + return true; } - exports.Binding = Binding; -}); -enifed('ember-metal/cache', ['exports', 'ember-utils', 'ember-metal/meta'], function (exports, _emberUtils, _emberMetalMeta) { - 'use strict'; + var AbstractRenderManager = (function (_AbstractManager) { + babelHelpers.inherits(AbstractRenderManager, _AbstractManager); - var Cache = (function () { - function Cache(limit, func, key, store) { - this.size = 0; - this.misses = 0; - this.hits = 0; - this.limit = limit; - this.func = func; - this.key = key; - this.store = store || new DefaultStore(); + function AbstractRenderManager() { + _AbstractManager.apply(this, arguments); } - Cache.prototype.get = function get(obj) { - var key = this.key === undefined ? obj : this.key(obj); - var value = this.store.get(key); - if (value === undefined) { - this.misses++; - value = this._set(key, this.func(obj)); - } else if (value === _emberMetalMeta.UNDEFINED) { - this.hits++; - value = undefined; - } else { - this.hits++; - // nothing to translate - } - - return value; + AbstractRenderManager.prototype.prepareArgs = function prepareArgs(definition, args) { + return args; }; - Cache.prototype.set = function set(obj, value) { - var key = this.key === undefined ? obj : this.key(obj); - return this._set(key, value); + /* abstract create(environment, definition, args, dynamicScope); */ + + AbstractRenderManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { + return env.getCompiledBlock(_emberGlimmerSyntaxOutlet.OutletLayoutCompiler, definition.template); }; - Cache.prototype._set = function _set(key, value) { - if (this.limit > this.size) { - this.size++; - if (value === undefined) { - this.store.set(key, _emberMetalMeta.UNDEFINED); - } else { - this.store.set(key, value); - } - } + AbstractRenderManager.prototype.getSelf = function getSelf(_ref) { + var controller = _ref.controller; - return value; + return new _emberGlimmerUtilsReferences.RootReference(controller); }; - Cache.prototype.purge = function purge() { - this.store.clear(); - this.size = 0; - this.hits = 0; - this.misses = 0; + AbstractRenderManager.prototype.getTag = function getTag() { + return null; }; - return Cache; - })(); - - exports.default = Cache; - - var DefaultStore = (function () { - function DefaultStore() { - this.data = new _emberUtils.EmptyObject(); - } - - DefaultStore.prototype.get = function get(key) { - return this.data[key]; + AbstractRenderManager.prototype.getDestructor = function getDestructor() { + return null; }; - DefaultStore.prototype.set = function set(key, value) { - this.data[key] = value; - }; + AbstractRenderManager.prototype.didCreateElement = function didCreateElement() {}; - DefaultStore.prototype.clear = function clear() { - this.data = new _emberUtils.EmptyObject(); - }; + AbstractRenderManager.prototype.didRenderLayout = function didRenderLayout() {}; - return DefaultStore; - })(); -}); -enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_get', 'ember-metal/meta', 'ember-metal/watch_key', 'ember-metal/watch_path'], function (exports, _emberUtils, _emberMetalProperty_get, _emberMetalMeta, _emberMetalWatch_key, _emberMetalWatch_path) { - 'use strict'; + AbstractRenderManager.prototype.didCreate = function didCreate() {}; - exports.finishChains = finishChains; + AbstractRenderManager.prototype.update = function update() {}; - var FIRST_KEY = /^([^\.]+)/; + AbstractRenderManager.prototype.didUpdateLayout = function didUpdateLayout() {}; - function firstKey(path) { - return path.match(FIRST_KEY)[0]; - } + AbstractRenderManager.prototype.didUpdate = function didUpdate() {}; - function isObject(obj) { - return typeof obj === 'object' && obj; - } + return AbstractRenderManager; + })(_emberGlimmerSyntaxAbstractManager.default); - function isVolatile(obj) { - return !(isObject(obj) && obj.isDescriptor && obj._volatile === false); - } + var SingletonRenderManager = (function (_AbstractRenderManager) { + babelHelpers.inherits(SingletonRenderManager, _AbstractRenderManager); - function ChainWatchers() { - // chain nodes that reference a key in this obj by key - // we only create ChainWatchers when we are going to add them - // so create this upfront - this.chains = new _emberUtils.EmptyObject(); - } + function SingletonRenderManager() { + _AbstractRenderManager.apply(this, arguments); + } - ChainWatchers.prototype = { - add: function (key, node) { - var nodes = this.chains[key]; - if (nodes === undefined) { - this.chains[key] = [node]; - } else { - nodes.push(node); - } - }, + SingletonRenderManager.prototype.create = function create(environment, definition, args, dynamicScope) { + var name = definition.name; + var env = definition.env; - remove: function (key, node) { - var nodes = this.chains[key]; - if (nodes) { - for (var i = 0; i < nodes.length; i++) { - if (nodes[i] === node) { - nodes.splice(i, 1); - break; - } - } - } - }, + var controller = env.owner.lookup('controller:' + name) || _emberRouting.generateController(env.owner, name); - has: function (key, node) { - var nodes = this.chains[key]; - if (nodes) { - for (var i = 0; i < nodes.length; i++) { - if (nodes[i] === node) { - return true; - } - } + if (dynamicScope.rootOutletState) { + dynamicScope.outletState = dynamicScope.rootOutletState.getOrphan(name); } - return false; - }, - revalidateAll: function () { - for (var key in this.chains) { - this.notify(key, true, undefined); - } - }, + return { controller: controller }; + }; - revalidate: function (key) { - this.notify(key, true, undefined); - }, + return SingletonRenderManager; + })(AbstractRenderManager); - // 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 object and path that - // will be/are invalidated by this key change, depending on - // whether the revalidate flag is passed - notify: function (key, revalidate, callback) { - var nodes = this.chains[key]; - if (nodes === undefined || nodes.length === 0) { - return; - } + var SINGLETON_RENDER_MANAGER = new SingletonRenderManager(); - var affected = undefined; + var NonSingletonRenderManager = (function (_AbstractRenderManager2) { + babelHelpers.inherits(NonSingletonRenderManager, _AbstractRenderManager2); - if (callback) { - affected = []; - } + function NonSingletonRenderManager() { + _AbstractRenderManager2.apply(this, arguments); + } - for (var i = 0; i < nodes.length; i++) { - nodes[i].notify(revalidate, affected); - } + NonSingletonRenderManager.prototype.create = function create(environment, definition, args, dynamicScope) { + var name = definition.name; + var env = definition.env; - if (callback === undefined) { - return; - } + var modelRef = args.positional.at(0); + var controllerFactory = env.owner[_container.FACTORY_FOR]('controller:' + name); - // we gather callbacks so we don't notify them during revalidation - for (var i = 0; i < affected.length; i += 2) { - var obj = affected[i]; - var path = affected[i + 1]; - callback(obj, path); + var factory = controllerFactory || _emberRouting.generateControllerFactory(env.owner, name); + var controller = factory.create({ model: modelRef.value() }); + + if (dynamicScope.rootOutletState) { + dynamicScope.outletState = dynamicScope.rootOutletState.getOrphan(name); } + + return { controller: controller }; + }; + + NonSingletonRenderManager.prototype.update = function update(_ref2, args, dynamicScope) { + var controller = _ref2.controller; + + controller.set('model', args.positional.at(0).value()); + }; + + NonSingletonRenderManager.prototype.getDestructor = function getDestructor(_ref3) { + var controller = _ref3.controller; + + return controller; + }; + + return NonSingletonRenderManager; + })(AbstractRenderManager); + + var NON_SINGLETON_RENDER_MANAGER = new NonSingletonRenderManager(); + + var RenderDefinition = (function (_ComponentDefinition) { + babelHelpers.inherits(RenderDefinition, _ComponentDefinition); + + function RenderDefinition(name, template, env, manager) { + _ComponentDefinition.call(this, 'render', manager, null); + + this.name = name; + this.template = template; + this.env = env; } - }; - function makeChainWatcher() { - return new ChainWatchers(); + return RenderDefinition; + })(_glimmerRuntime.ComponentDefinition); +}); +enifed('ember-glimmer/template', ['exports', 'ember-utils', '@glimmer/runtime'], function (exports, _emberUtils, _glimmerRuntime) { + 'use strict'; + + exports.default = template; + + function template(json) { + var factory = _glimmerRuntime.templateFactory(json); + + return { + id: factory.id, + meta: factory.meta, + create: function (props) { + return factory.create(props.env, { owner: props[_emberUtils.OWNER] }); + } + }; } +}); +enifed("ember-glimmer/template_registry", ["exports"], function (exports) { + // STATE within a module is frowned apon, this exists + // to support Ember.TEMPLATES but shield ember internals from this legacy + // global API. + "use strict"; - function addChainWatcher(obj, keyName, node) { - var m = _emberMetalMeta.meta(obj); - m.writableChainWatchers(makeChainWatcher).add(keyName, node); - _emberMetalWatch_key.watchKey(obj, keyName, m); + exports.setTemplates = setTemplates; + exports.getTemplates = getTemplates; + exports.getTemplate = getTemplate; + exports.hasTemplate = hasTemplate; + exports.setTemplate = setTemplate; + var TEMPLATES = {}; + + function setTemplates(templates) { + TEMPLATES = templates; } - function removeChainWatcher(obj, keyName, node, _meta) { - if (!isObject(obj)) { - return; + function getTemplates() { + return TEMPLATES; + } + + function getTemplate(name) { + if (TEMPLATES.hasOwnProperty(name)) { + return TEMPLATES[name]; } + } - var meta = _meta || _emberMetalMeta.peekMeta(obj); + function hasTemplate(name) { + return TEMPLATES.hasOwnProperty(name); + } - if (!meta || !meta.readableChainWatchers()) { - return; - } + function setTemplate(name, template) { + return TEMPLATES[name] = template; + } +}); +enifed("ember-glimmer/templates/component", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { + "use strict"; - // make meta writable - meta = _emberMetalMeta.meta(obj); + exports.default = _emberGlimmerTemplate.default({ "id": "2aYM5QYc", "block": "{\"statements\":[[\"yield\",\"default\"]],\"locals\":[],\"named\":[],\"yields\":[\"default\"],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/component.hbs" } }); +}); +enifed("ember-glimmer/templates/empty", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { + "use strict"; - meta.readableChainWatchers().remove(keyName, node); + exports.default = _emberGlimmerTemplate.default({ "id": "5QJJjniM", "block": "{\"statements\":[],\"locals\":[],\"named\":[],\"yields\":[],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/empty.hbs" } }); +}); +enifed("ember-glimmer/templates/link-to", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { + "use strict"; - _emberMetalWatch_key.unwatchKey(obj, keyName, meta); - } + exports.default = _emberGlimmerTemplate.default({ "id": "Y2DX6qHQ", "block": "{\"statements\":[[\"block\",[\"if\"],[[\"get\",[\"linkTitle\"]]],null,{\"statements\":[[\"append\",[\"unknown\",[\"linkTitle\"]],false]],\"locals\":[]},{\"statements\":[[\"yield\",\"default\"]],\"locals\":[]}]],\"locals\":[],\"named\":[],\"yields\":[\"default\"],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/link-to.hbs" } }); +}); +enifed("ember-glimmer/templates/outlet", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { + "use strict"; - // 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 - // pass null for parent and key and object for value. - function ChainNode(parent, key, value) { - this._parent = parent; - this._key = key; + exports.default = _emberGlimmerTemplate.default({ "id": "xyZMyWzn", "block": "{\"statements\":[[\"append\",[\"unknown\",[\"outlet\"]],false]],\"locals\":[],\"named\":[],\"yields\":[],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/outlet.hbs" } }); +}); +enifed("ember-glimmer/templates/root", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { + "use strict"; - // _watching is true when calling get(this._parent, this._key) will - // return the value of this node. - // - // It is false for the root of a chain (because we have no parent) - // and for global paths (because the parent node is the object with - // the observer on it) - this._watching = value === undefined; + exports.default = _emberGlimmerTemplate.default({ "id": "/KBRNPqv", "block": "{\"statements\":[[\"append\",[\"helper\",[\"component\"],[[\"get\",[null]]],null],false]],\"locals\":[],\"named\":[],\"yields\":[],\"hasPartials\":false}", "meta": { "moduleName": "ember-glimmer/templates/root.hbs" } }); +}); +enifed('ember-glimmer/utils/bindings', ['exports', '@glimmer/reference', 'ember-metal', 'ember-runtime', 'ember-glimmer/component', 'ember-glimmer/utils/string'], function (exports, _glimmerReference, _emberMetal, _emberRuntime, _emberGlimmerComponent, _emberGlimmerUtilsString) { + 'use strict'; - this._chains = undefined; - this._object = undefined; - this.count = 0; + exports.wrapComponentClassAttribute = wrapComponentClassAttribute; - this._value = value; - this._paths = {}; - if (this._watching) { - var obj = parent.value(); + function referenceForKey(component, key) { + return component[_emberGlimmerComponent.ROOT_REF].get(key); + } - if (!isObject(obj)) { - return; - } + function referenceForParts(component, parts) { + var isAttrs = parts[0] === 'attrs'; - this._object = obj; + // TODO deprecate this + if (isAttrs) { + parts.shift(); - addChainWatcher(this._object, this._key, this); + if (parts.length === 1) { + return referenceForKey(component, parts[0]); + } } + + return _glimmerReference.referenceFromParts(component[_emberGlimmerComponent.ROOT_REF], parts); } - function lazyGet(obj, key) { - if (!isObject(obj)) { - return; + // TODO we should probably do this transform at build time + + function wrapComponentClassAttribute(hash) { + if (!hash) { + return hash; } - var meta = _emberMetalMeta.peekMeta(obj); + var keys = hash[0]; + var values = hash[1]; - // check if object meant only to be a prototype - if (meta && meta.proto === obj) { - return; - } + var index = keys.indexOf('class'); - // Use `get` if the return value is an EachProxy or an uncacheable value. - if (isVolatile(obj[key])) { - return _emberMetalProperty_get.get(obj, key); - // Otherwise attempt to get the cached value of the computed property - } else { - var cache = meta.readableCache(); - if (cache && key in cache) { - return cache[key]; - } + if (index !== -1) { + var _values$index = values[index]; + var type = _values$index[0]; + + if (type === 'get') { + var getExp = values[index]; + var path = getExp[1]; + var propName = path[path.length - 1]; + hash[1][index] = ['helper', ['-class'], [getExp, propName]]; } + } + + return hash; } - ChainNode.prototype = { - value: function () { - if (this._value === undefined && this._watching) { - var obj = this._parent.value(); - this._value = lazyGet(obj, this._key); + var AttributeBinding = { + parse: function (microsyntax) { + var colonIndex = microsyntax.indexOf(':'); + + if (colonIndex === -1) { + return [microsyntax, microsyntax, true]; + } else { + var prop = microsyntax.substring(0, colonIndex); + var attribute = microsyntax.substring(colonIndex + 1); + + return [prop, attribute, false]; } - return this._value; }, - destroy: function () { - if (this._watching) { - var obj = this._object; - if (obj) { - removeChainWatcher(obj, this._key, this); + install: function (element, component, parsed, operations) { + var prop = parsed[0]; + var attribute = parsed[1]; + var isSimple = parsed[2]; + + if (attribute === 'id') { + var elementId = _emberMetal.get(component, prop); + if (elementId === undefined || elementId === null) { + elementId = component.elementId; } - this._watching = false; // so future calls do nothing + operations.addStaticAttribute(element, 'id', elementId); + return; } - }, - // copies a top level object only - copy: function (obj) { - var ret = new ChainNode(null, null, obj); - var paths = this._paths; - var path = undefined; + var isPath = prop.indexOf('.') > -1; + var reference = isPath ? referenceForParts(component, prop.split('.')) : referenceForKey(component, prop); - for (path in paths) { - // this check will also catch non-number vals. - if (paths[path] <= 0) { - continue; - } - ret.add(path); + if (attribute === 'style') { + reference = new StyleBindingReference(reference, referenceForKey(component, 'isVisible')); } - return ret; - }, - // called on the root node of a chain to setup watchers on the specified - // path. - add: function (path) { - var paths = this._paths; - paths[path] = (paths[path] || 0) + 1; + operations.addDynamicAttribute(element, attribute, reference); + } + }; - var key = firstKey(path); - var tail = path.slice(key.length + 1); + exports.AttributeBinding = AttributeBinding; + var DISPLAY_NONE = 'display: none;'; + var SAFE_DISPLAY_NONE = _emberGlimmerUtilsString.htmlSafe(DISPLAY_NONE); - this.chain(key, tail); - }, + var StyleBindingReference = (function (_CachedReference) { + babelHelpers.inherits(StyleBindingReference, _CachedReference); - // called on the root node of a chain to teardown watcher on the specified - // path - remove: function (path) { - var paths = this._paths; - if (paths[path] > 0) { - paths[path]--; - } + function StyleBindingReference(inner, isVisible) { + _CachedReference.call(this); - var key = firstKey(path); - var tail = path.slice(key.length + 1); + this.tag = _glimmerReference.combine([inner.tag, isVisible.tag]); + this.inner = inner; + this.isVisible = isVisible; + } - this.unchain(key, tail); - }, + StyleBindingReference.prototype.compute = function compute() { + var value = this.inner.value(); + var isVisible = this.isVisible.value(); - chain: function (key, path) { - var chains = this._chains; - var node = undefined; - if (chains === undefined) { - chains = this._chains = new _emberUtils.EmptyObject(); + if (isVisible !== false) { + return value; + } else if (!value && value !== 0) { + return SAFE_DISPLAY_NONE; } else { - node = chains[key]; - } - - if (node === undefined) { - node = chains[key] = new ChainNode(this, key, undefined); + var style = value + ' ' + DISPLAY_NONE; + return _emberGlimmerUtilsString.isHTMLSafe(value) ? _emberGlimmerUtilsString.htmlSafe(style) : style; } + }; - node.count++; // count chains... + return StyleBindingReference; + })(_glimmerReference.CachedReference); - // chain rest of path if there is one - if (path) { - key = firstKey(path); - path = path.slice(key.length + 1); - node.chain(key, path); - } + var IsVisibleBinding = { + install: function (element, component, operations) { + operations.addDynamicAttribute(element, 'style', _glimmerReference.map(referenceForKey(component, 'isVisible'), this.mapStyleValue)); }, - unchain: function (key, path) { - var chains = this._chains; - var node = chains[key]; + mapStyleValue: function (isVisible) { + return isVisible === false ? SAFE_DISPLAY_NONE : null; + } + }; - // unchain rest of path first... - if (path && path.length > 1) { - var nextKey = firstKey(path); - var nextPath = path.slice(nextKey.length + 1); - node.unchain(nextKey, nextPath); - } + exports.IsVisibleBinding = IsVisibleBinding; + var ClassNameBinding = { + install: function (element, component, microsyntax, operations) { + var _microsyntax$split = microsyntax.split(':'); - // delete node if needed. - node.count--; - if (node.count <= 0) { - chains[node._key] = undefined; - node.destroy(); - } - }, + var prop = _microsyntax$split[0]; + var truthy = _microsyntax$split[1]; + var falsy = _microsyntax$split[2]; - notify: function (revalidate, affected) { - if (revalidate && this._watching) { - var parentValue = this._parent.value(); + var isStatic = prop === ''; - if (parentValue !== this._object) { - if (this._object) { - removeChainWatcher(this._object, this._key, this); - } + if (isStatic) { + operations.addStaticAttribute(element, 'class', truthy); + } else { + var isPath = prop.indexOf('.') > -1; + var parts = isPath && prop.split('.'); + var value = isPath ? referenceForParts(component, parts) : referenceForKey(component, prop); + var ref = undefined; - if (isObject(parentValue)) { - this._object = parentValue; - addChainWatcher(parentValue, this._key, this); - } else { - this._object = undefined; - } + if (truthy === undefined) { + ref = new SimpleClassNameBindingReference(value, isPath ? parts[parts.length - 1] : prop); + } else { + ref = new ColonClassNameBindingReference(value, truthy, falsy); } - this._value = undefined; - } - // then notify chains... - var chains = this._chains; - var node = undefined; - if (chains) { - for (var key in chains) { - node = chains[key]; - if (node !== undefined) { - node.notify(revalidate, affected); - } - } + operations.addDynamicAttribute(element, 'class', ref); } + } + }; - if (affected && this._parent) { - this._parent.populateAffected(this._key, 1, affected); - } - }, + exports.ClassNameBinding = ClassNameBinding; - populateAffected: function (path, depth, affected) { - if (this._key) { - path = this._key + '.' + path; - } + var SimpleClassNameBindingReference = (function (_CachedReference2) { + babelHelpers.inherits(SimpleClassNameBindingReference, _CachedReference2); - if (this._parent) { - this._parent.populateAffected(path, depth + 1, affected); - } else { - if (depth > 1) { - affected.push(this.value(), path); - } - } + function SimpleClassNameBindingReference(inner, path) { + _CachedReference2.call(this); + + this.tag = inner.tag; + this.inner = inner; + this.path = path; + this.dasherizedPath = null; } - }; - function finishChains(obj) { - // We only create meta if we really have to - var m = _emberMetalMeta.peekMeta(obj); - if (m) { - m = _emberMetalMeta.meta(obj); + SimpleClassNameBindingReference.prototype.compute = function compute() { + var value = this.inner.value(); - // finish any current chains node watchers that reference obj - var chainWatchers = m.readableChainWatchers(); - if (chainWatchers) { - chainWatchers.revalidateAll(); - } - // ensure that if we have inherited any chains they have been - // copied onto our own meta. - if (m.readableChains()) { - m.writableChains(_emberMetalWatch_path.makeChainNode); + if (value === true) { + var path = this.path; + var dasherizedPath = this.dasherizedPath; + + return dasherizedPath || (this.dasherizedPath = _emberRuntime.String.dasherize(path)); + } else if (value || value === 0) { + return value; + } else { + return null; } + }; + + return SimpleClassNameBindingReference; + })(_glimmerReference.CachedReference); + + var ColonClassNameBindingReference = (function (_CachedReference3) { + babelHelpers.inherits(ColonClassNameBindingReference, _CachedReference3); + + function ColonClassNameBindingReference(inner, truthy, falsy) { + _CachedReference3.call(this); + + this.tag = inner.tag; + this.inner = inner; + this.truthy = truthy || null; + this.falsy = falsy || null; } - } - exports.removeChainWatcher = removeChainWatcher; - exports.ChainNode = ChainNode; + ColonClassNameBindingReference.prototype.compute = function compute() { + var inner = this.inner; + var truthy = this.truthy; + var falsy = this.falsy; + + return inner.value() ? truthy : falsy; + }; + + return ColonClassNameBindingReference; + })(_glimmerReference.CachedReference); }); -enifed('ember-metal/computed', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/property_set', 'ember-metal/meta', 'ember-metal/expand_properties', 'ember-metal/error', 'ember-metal/properties', 'ember-metal/property_events', 'ember-metal/dependent_keys'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalProperty_set, _emberMetalMeta, _emberMetalExpand_properties, _emberMetalError, _emberMetalProperties, _emberMetalProperty_events, _emberMetalDependent_keys) { +enifed('ember-glimmer/utils/debug-stack', ['exports', 'ember-metal'], function (exports, _emberMetal) { 'use strict'; - exports.default = computed; + var DebugStack = undefined; - /** - @module ember - @submodule ember-metal - */ + exports.default = DebugStack; +}); +enifed('ember-glimmer/utils/iterable', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/each-in', '@glimmer/reference'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberGlimmerUtilsReferences, _emberGlimmerHelpersEachIn, _glimmerReference) { + 'use strict'; - var DEEP_EACH_REGEX = /\.@each\.[^.]+\./; + exports.default = iterableFor; - /** - A computed property transforms an object literal with object's accessor function(s) into a property. - - By default the function backing the computed property will only be called - once and the result will be cached. You can specify various properties - that your computed property depends on. This will force the cached - result to be recomputed if the dependencies are modified. - - In the following example we declare a computed property - `fullName` - by calling - `.Ember.computed()` with property dependencies (`firstName` and `lastName`) as leading arguments and getter accessor function. The `fullName` getter function - will be called once (regardless of how many times it is accessed) as long - as its dependencies have not changed. Once `firstName` or `lastName` are updated - any future calls (or anything bound) to `fullName` will incorporate the new - values. - - ```javascript - let Person = Ember.Object.extend({ - // these will be supplied by `create` - firstName: null, - lastName: null, - - fullName: Ember.computed('firstName', 'lastName', function() { - let firstName = this.get('firstName'), - lastName = this.get('lastName'); - - return firstName + ' ' + lastName; - }) - }); - - let tom = Person.create({ - firstName: 'Tom', - lastName: 'Dale' - }); - - tom.get('fullName') // 'Tom Dale' - ``` - - You can also define what Ember should do when setting a computed property by providing additional function (`set`) in hash argument. - If you try to set a computed property, it will try to invoke setter accessor function with the key and - value you want to set it to as arguments. - - ```javascript - let Person = Ember.Object.extend({ - // these will be supplied by `create` - firstName: null, - lastName: null, - - fullName: Ember.computed('firstName', 'lastName', { - get(key) { - let firstName = this.get('firstName'), - lastName = this.get('lastName'); - - return firstName + ' ' + lastName; - }, - set(key, value) { - let [firstName, lastName] = value.split(' '); - - this.set('firstName', firstName); - this.set('lastName', lastName); - - return value; - } - }) - }); - - let person = Person.create(); - - person.set('fullName', 'Peter Wagenet'); - person.get('firstName'); // 'Peter' - person.get('lastName'); // 'Wagenet' - ``` - - You can overwrite computed property with normal property (no longer computed), that won't change if dependencies change, if you set computed property and it won't have setter accessor function defined. - - You can also mark computed property as `.readOnly()` and block all attempts to set it. - - ```javascript - let Person = Ember.Object.extend({ - // these will be supplied by `create` - firstName: null, - lastName: null, - - fullName: Ember.computed('firstName', 'lastName', { - get(key) { - let firstName = this.get('firstName'); - let lastName = this.get('lastName'); - - return firstName + ' ' + lastName; - } - }).readOnly() - }); - - let person = Person.create(); - person.set('fullName', 'Peter Wagenet'); // Uncaught Error: Cannot set read-only property "fullName" on object: <(...):emberXXX> - ``` - - Additional resources: - - [New CP syntax RFC](https://github.com/emberjs/rfcs/blob/master/text/0011-improved-cp-syntax.md) - - [New computed syntax explained in "Ember 1.12 released" ](http://emberjs.com/blog/2015/05/13/ember-1-12-released.html#toc_new-computed-syntax) - - @class ComputedProperty - @namespace Ember - @public - */ - function ComputedProperty(config, opts) { - this.isDescriptor = true; - if (typeof config === 'function') { - this._getter = config; + var ITERATOR_KEY_GUID = 'be277757-bbbe-4620-9fcb-213ef433cca2'; + + function iterableFor(ref, keyPath) { + if (_emberGlimmerHelpersEachIn.isEachIn(ref)) { + return new EachInIterable(ref, keyForEachIn(keyPath)); } else { - this._getter = config.get; - this._setter = config.set; + return new ArrayIterable(ref, keyForArray(keyPath)); } + } - this._dependentKeys = undefined; - this._suspended = undefined; - this._meta = undefined; - this._volatile = false; - this._dependentKeys = opts && opts.dependentKeys; - this._readOnly = false; + function keyForEachIn(keyPath) { + switch (keyPath) { + case '@index': + case undefined: + case null: + return index; + case '@identity': + return identity; + default: + return function (item) { + return _emberMetal.get(item, keyPath); + }; + } } - ComputedProperty.prototype = new _emberMetalProperties.Descriptor(); - ComputedProperty.prototype.constructor = ComputedProperty; + function keyForArray(keyPath) { + switch (keyPath) { + case '@index': + return index; + case '@identity': + case undefined: + case null: + return identity; + default: + return function (item) { + return _emberMetal.get(item, keyPath); + }; + } + } - var ComputedPropertyPrototype = ComputedProperty.prototype; + function index(item, index) { + return String(index); + } - /** - Call on a computed property to set it into non-cached mode. When in this - mode the computed property will not automatically cache the return value. - - It also does not automatically fire any change events. You must manually notify - any changes if you want to observe this property. - - Dependency keys have no effect on volatile properties as they are for cache - invalidation and notification when cached value is invalidated. - - ```javascript - let outsideService = Ember.Object.extend({ - value: Ember.computed(function() { - return OutsideService.getValue(); - }).volatile() - }).create(); - ``` - - @method volatile - @return {Ember.ComputedProperty} this - @chainable - @public - */ - ComputedPropertyPrototype.volatile = function () { - this._volatile = true; - return this; - }; + function identity(item) { + switch (typeof item) { + case 'string': + case 'number': + return String(item); + default: + return _emberUtils.guidFor(item); + } + } - /** - Call on a computed property to set it into read-only mode. When in this - mode the computed property will throw an error when set. - - ```javascript - let Person = Ember.Object.extend({ - guid: Ember.computed(function() { - return 'guid-guid-guid'; - }).readOnly() - }); - - let person = Person.create(); - - person.set('guid', 'new-guid'); // will throw an exception - ``` - - @method readOnly - @return {Ember.ComputedProperty} this - @chainable - @public - */ - ComputedPropertyPrototype.readOnly = function () { - this._readOnly = true; + function ensureUniqueKey(seen, key) { + var seenCount = seen[key]; - return this; - }; + if (seenCount) { + seen[key]++; + return '' + key + ITERATOR_KEY_GUID + seenCount; + } else { + seen[key] = 1; + } - /** - Sets the dependent keys on this computed property. Pass any number of - arguments containing key paths that this computed property depends on. - - ```javascript - let President = Ember.Object.extend({ - fullName: Ember.computed(function() { - return this.get('firstName') + ' ' + this.get('lastName'); - - // Tell Ember that this computed property depends on firstName - // and lastName - }).property('firstName', 'lastName') - }); - - let president = President.create({ - firstName: 'Barack', - lastName: 'Obama' - }); - - president.get('fullName'); // 'Barack Obama' - ``` - - @method property - @param {String} path* zero or more property paths - @return {Ember.ComputedProperty} this - @chainable - @public - */ - ComputedPropertyPrototype.property = function () { - var args = []; + return key; + } - function addArg(property) { - args.push(property); + var ArrayIterator = (function () { + function ArrayIterator(array, keyFor) { + this.array = array; + this.length = array.length; + this.keyFor = keyFor; + this.position = 0; + this.seen = new _emberUtils.EmptyObject(); } - for (var i = 0; i < arguments.length; i++) { - _emberMetalExpand_properties.default(arguments[i], addArg); - } + ArrayIterator.prototype.isEmpty = function isEmpty() { + return false; + }; - this._dependentKeys = args; - return this; - }; + ArrayIterator.prototype.next = function next() { + var array = this.array; + var length = this.length; + var keyFor = this.keyFor; + var position = this.position; + var seen = this.seen; - /** - In some cases, you may want to annotate computed properties with additional - metadata about how they function or what values they operate on. For example, - computed property functions may close over variables that are then no longer - available for introspection. - - You can pass a hash of these values to a computed property like this: - - ``` - person: Ember.computed(function() { - let personId = this.get('personId'); - return App.Person.create({ id: personId }); - }).meta({ type: App.Person }) - ``` - - The hash that you pass to the `meta()` function will be saved on the - computed property descriptor under the `_meta` key. Ember runtime - exposes a public API for retrieving these values from classes, - via the `metaForProperty()` function. - - @method meta - @param {Object} meta - @chainable - @public - */ - ComputedPropertyPrototype.meta = function (meta) { - if (arguments.length === 0) { - return this._meta || {}; - } else { - this._meta = meta; - return this; - } - }; + if (position >= length) { + return null; + } - // invalidate cache when CP key changes - ComputedPropertyPrototype.didChange = function (obj, keyName) { - // _suspended is set via a CP.set to ensure we don't clear - // the cached value set by the setter - if (this._volatile || this._suspended === obj) { - return; - } + var value = array[position]; + var memo = position; + var key = ensureUniqueKey(seen, keyFor(value, memo)); - // don't create objects just to invalidate - var meta = _emberMetalMeta.peekMeta(obj); - if (!meta || meta.source !== obj) { - return; - } + this.position++; - var cache = meta.readableCache(); - if (cache && cache[keyName] !== undefined) { - cache[keyName] = undefined; - _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); - } - }; + return { key: key, value: value, memo: memo }; + }; - ComputedPropertyPrototype.get = function (obj, keyName) { - if (this._volatile) { - return this._getter.call(obj, keyName); + return ArrayIterator; + })(); + + var EmberArrayIterator = (function () { + function EmberArrayIterator(array, keyFor) { + this.array = array; + this.length = _emberMetal.get(array, 'length'); + this.keyFor = keyFor; + this.position = 0; + this.seen = new _emberUtils.EmptyObject(); } - var meta = _emberMetalMeta.meta(obj); - var cache = meta.writableCache(); + EmberArrayIterator.prototype.isEmpty = function isEmpty() { + return this.length === 0; + }; - var result = cache[keyName]; - if (result === _emberMetalMeta.UNDEFINED) { - return undefined; - } else if (result !== undefined) { - return result; - } + EmberArrayIterator.prototype.next = function next() { + var array = this.array; + var length = this.length; + var keyFor = this.keyFor; + var position = this.position; + var seen = this.seen; - var ret = this._getter.call(obj, keyName); - if (ret === undefined) { - cache[keyName] = _emberMetalMeta.UNDEFINED; - } else { - cache[keyName] = ret; - } + if (position >= length) { + return null; + } - var chainWatchers = meta.readableChainWatchers(); - if (chainWatchers) { - chainWatchers.revalidate(keyName); - } - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); + var value = _emberRuntime.objectAt(array, position); + var memo = position; + var key = ensureUniqueKey(seen, keyFor(value, memo)); - return ret; - }; + this.position++; - ComputedPropertyPrototype.set = function computedPropertySetEntry(obj, keyName, value) { - if (this._readOnly) { - this._throwReadOnlyError(obj, keyName); - } + return { key: key, value: value, memo: memo }; + }; - if (!this._setter) { - return this.clobberSet(obj, keyName, value); - } + return EmberArrayIterator; + })(); - if (this._volatile) { - return this.volatileSet(obj, keyName, value); + var ObjectKeysIterator = (function () { + function ObjectKeysIterator(keys, values, keyFor) { + this.keys = keys; + this.values = values; + this.keyFor = keyFor; + this.position = 0; + this.seen = new _emberUtils.EmptyObject(); } - return this.setWithSuspend(obj, keyName, value); - }; + ObjectKeysIterator.prototype.isEmpty = function isEmpty() { + return this.keys.length === 0; + }; - ComputedPropertyPrototype._throwReadOnlyError = function computedPropertyThrowReadOnlyError(obj, keyName) { - throw new _emberMetalError.default('Cannot set read-only property "' + keyName + '" on object: ' + _emberUtils.inspect(obj)); - }; + ObjectKeysIterator.prototype.next = function next() { + var keys = this.keys; + var values = this.values; + var keyFor = this.keyFor; + var position = this.position; + var seen = this.seen; - ComputedPropertyPrototype.clobberSet = function computedPropertyClobberSet(obj, keyName, value) { - var cachedValue = cacheFor(obj, keyName); - _emberMetalProperties.defineProperty(obj, keyName, null, cachedValue); - _emberMetalProperty_set.set(obj, keyName, value); - return value; - }; + if (position >= keys.length) { + return null; + } - ComputedPropertyPrototype.volatileSet = function computedPropertyVolatileSet(obj, keyName, value) { - return this._setter.call(obj, keyName, value); - }; + var value = values[position]; + var memo = keys[position]; + var key = ensureUniqueKey(seen, keyFor(value, memo)); - ComputedPropertyPrototype.setWithSuspend = function computedPropertySetWithSuspend(obj, keyName, value) { - var oldSuspended = this._suspended; - this._suspended = obj; - try { - return this._set(obj, keyName, value); - } finally { - this._suspended = oldSuspended; + this.position++; + + return { key: key, value: value, memo: memo }; + }; + + return ObjectKeysIterator; + })(); + + var EmptyIterator = (function () { + function EmptyIterator() {} + + EmptyIterator.prototype.isEmpty = function isEmpty() { + return true; + }; + + EmptyIterator.prototype.next = function next() { + throw new Error('Cannot call next() on an empty iterator'); + }; + + return EmptyIterator; + })(); + + var EMPTY_ITERATOR = new EmptyIterator(); + + var EachInIterable = (function () { + function EachInIterable(ref, keyFor) { + this.ref = ref; + this.keyFor = keyFor; + + var valueTag = this.valueTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); + + this.tag = _glimmerReference.combine([ref.tag, valueTag]); } - }; - ComputedPropertyPrototype._set = function computedPropertySet(obj, keyName, value) { - // cache requires own meta - var meta = _emberMetalMeta.meta(obj); - // either there is a writable cache or we need one to update - var cache = meta.writableCache(); - var hadCachedValue = false; - var cachedValue = undefined; - if (cache[keyName] !== undefined) { - if (cache[keyName] !== _emberMetalMeta.UNDEFINED) { - cachedValue = cache[keyName]; + EachInIterable.prototype.iterate = function iterate() { + var ref = this.ref; + var keyFor = this.keyFor; + var valueTag = this.valueTag; + + var iterable = ref.value(); + + valueTag.update(_emberMetal.tagFor(iterable)); + + if (_emberMetal.isProxy(iterable)) { + iterable = _emberMetal.get(iterable, 'content'); } - hadCachedValue = true; - } - var ret = this._setter.call(obj, keyName, value, cachedValue); + var typeofIterable = typeof iterable; - // allows setter to return the same value that is cached already - if (hadCachedValue && cachedValue === ret) { - return ret; - } + if (iterable && (typeofIterable === 'object' || typeofIterable === 'function')) { + var keys = Object.keys(iterable); + var values = keys.map(function (key) { + return iterable[key]; + }); + return keys.length > 0 ? new ObjectKeysIterator(keys, values, keyFor) : EMPTY_ITERATOR; + } else { + return EMPTY_ITERATOR; + } + }; - _emberMetalProperty_events.propertyWillChange(obj, keyName); + // {{each-in}} yields |key value| instead of |value key|, so the memo and + // value are flipped - if (hadCachedValue) { - cache[keyName] = undefined; - } + EachInIterable.prototype.valueReferenceFor = function valueReferenceFor(item) { + return new _emberGlimmerUtilsReferences.UpdatablePrimitiveReference(item.memo); + }; - if (!hadCachedValue) { - _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); - } + EachInIterable.prototype.updateValueReference = function updateValueReference(reference, item) { + reference.update(item.memo); + }; - if (ret === undefined) { - cache[keyName] = _emberMetalMeta.UNDEFINED; - } else { - cache[keyName] = ret; - } + EachInIterable.prototype.memoReferenceFor = function memoReferenceFor(item) { + return new _emberGlimmerUtilsReferences.UpdatableReference(item.value); + }; - _emberMetalProperty_events.propertyDidChange(obj, keyName); + EachInIterable.prototype.updateMemoReference = function updateMemoReference(reference, item) { + reference.update(item.value); + }; - return ret; - }; + return EachInIterable; + })(); - /* called before property is overridden */ - ComputedPropertyPrototype.teardown = function (obj, keyName) { - if (this._volatile) { - return; - } - var meta = _emberMetalMeta.meta(obj); - var cache = meta.readableCache(); - if (cache && cache[keyName] !== undefined) { - _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); - cache[keyName] = undefined; + var ArrayIterable = (function () { + function ArrayIterable(ref, keyFor) { + this.ref = ref; + this.keyFor = keyFor; + + var valueTag = this.valueTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); + + this.tag = _glimmerReference.combine([ref.tag, valueTag]); } - }; - /** - This helper returns a new property descriptor that wraps the passed - computed property function. You can use this helper to define properties - with mixins or via `Ember.defineProperty()`. - - If you pass a function as an argument, it will be used as a getter. A computed - property defined in this way might look like this: - - ```js - let Person = Ember.Object.extend({ - init() { - this._super(...arguments); - - this.firstName = 'Betty'; - this.lastName = 'Jones'; - }, - - fullName: Ember.computed('firstName', 'lastName', function() { - return `${this.get('firstName')} ${this.get('lastName')}`; - }) - }); - - let client = Person.create(); - - client.get('fullName'); // 'Betty Jones' - - client.set('lastName', 'Fuller'); - client.get('fullName'); // 'Betty Fuller' - ``` - - You can pass a hash with two functions, `get` and `set`, as an - argument to provide both a getter and setter: - - ```js - let Person = Ember.Object.extend({ - init() { - this._super(...arguments); - - this.firstName = 'Betty'; - this.lastName = 'Jones'; - }, - - fullName: Ember.computed('firstName', 'lastName', { - get(key) { - return `${this.get('firstName')} ${this.get('lastName')}`; - }, - set(key, value) { - let [firstName, lastName] = value.split(/\s+/); - this.setProperties({ firstName, lastName }); - return value; - } - }); - }) - - let client = Person.create(); - client.get('firstName'); // 'Betty' - - client.set('fullName', 'Carroll Fuller'); - client.get('firstName'); // 'Carroll' - ``` - - The `set` function should accept two parameters, `key` and `value`. The value - returned from `set` will be the new value of the property. - - _Note: This is the preferred way to define computed properties when writing third-party - libraries that depend on or use Ember, since there is no guarantee that the user - will have [prototype Extensions](http://emberjs.com/guides/configuring-ember/disabling-prototype-extensions/) enabled._ - - The alternative syntax, with prototype extensions, might look like: - - ```js - fullName: function() { - return this.get('firstName') + ' ' + this.get('lastName'); - }.property('firstName', 'lastName') - ``` - - @class computed - @namespace Ember - @constructor - @static - @param {String} [dependentKeys*] Optional dependent keys that trigger this computed property. - @param {Function} func The computed property function. - @return {Ember.ComputedProperty} property descriptor instance - @public - */ - - function computed(func) { - var args = undefined; + ArrayIterable.prototype.iterate = function iterate() { + var ref = this.ref; + var keyFor = this.keyFor; + var valueTag = this.valueTag; - if (arguments.length > 1) { - args = [].slice.call(arguments); - func = args.pop(); - } + var iterable = ref.value(); - var cp = new ComputedProperty(func); + valueTag.update(_emberMetal.tagForProperty(iterable, '[]')); - if (args) { - cp.property.apply(cp, args); - } + if (!iterable || typeof iterable !== 'object') { + return EMPTY_ITERATOR; + } - return cp; - } + if (Array.isArray(iterable)) { + return iterable.length > 0 ? new ArrayIterator(iterable, keyFor) : EMPTY_ITERATOR; + } else if (_emberRuntime.isEmberArray(iterable)) { + return _emberMetal.get(iterable, 'length') > 0 ? new EmberArrayIterator(iterable, keyFor) : EMPTY_ITERATOR; + } else if (typeof iterable.forEach === 'function') { + var _ret = (function () { + var array = []; + iterable.forEach(function (item) { + array.push(item); + }); + return { + v: array.length > 0 ? new ArrayIterator(array, keyFor) : EMPTY_ITERATOR + }; + })(); - /** - Returns the cached value for a property, if one exists. - This can be useful for peeking at the value of a computed - property that is generated lazily, without accidentally causing - it to be created. - - @method cacheFor - @for Ember - @param {Object} obj the object whose property you want to check - @param {String} key the name of the property whose cached value you want - to return - @return {Object} the cached value - @public - */ - function cacheFor(obj, key) { - var meta = _emberMetalMeta.peekMeta(obj); - var cache = meta && meta.source === obj && meta.readableCache(); - var ret = cache && cache[key]; + if (typeof _ret === 'object') return _ret.v; + } else { + return EMPTY_ITERATOR; + } + }; - if (ret === _emberMetalMeta.UNDEFINED) { - return undefined; - } - return ret; - } + ArrayIterable.prototype.valueReferenceFor = function valueReferenceFor(item) { + return new _emberGlimmerUtilsReferences.UpdatableReference(item.value); + }; - cacheFor.set = function (cache, key, value) { - if (value === undefined) { - cache[key] = _emberMetalMeta.UNDEFINED; - } else { - cache[key] = value; - } - }; + ArrayIterable.prototype.updateValueReference = function updateValueReference(reference, item) { + reference.update(item.value); + }; - cacheFor.get = function (cache, key) { - var ret = cache[key]; - if (ret === _emberMetalMeta.UNDEFINED) { - return undefined; - } - return ret; - }; + ArrayIterable.prototype.memoReferenceFor = function memoReferenceFor(item) { + return new _emberGlimmerUtilsReferences.UpdatablePrimitiveReference(item.memo); + }; - cacheFor.remove = function (cache, key) { - cache[key] = undefined; - }; + ArrayIterable.prototype.updateMemoReference = function updateMemoReference(reference, item) { + reference.update(item.memo); + }; - exports.ComputedProperty = ComputedProperty; - exports.computed = computed; - exports.cacheFor = cacheFor; + return ArrayIterable; + })(); }); -enifed('ember-metal/core', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { +enifed('ember-glimmer/utils/process-args', ['exports', 'ember-utils', '@glimmer/reference', 'ember-glimmer/component', 'ember-glimmer/utils/references', 'ember-views', 'ember-glimmer/helpers/action', '@glimmer/runtime'], function (exports, _emberUtils, _glimmerReference, _emberGlimmerComponent, _emberGlimmerUtilsReferences, _emberViews, _emberGlimmerHelpersAction, _glimmerRuntime) { 'use strict'; - /** - @module ember - @submodule ember-metal - */ - - /** - This namespace contains all Ember methods and functions. Future versions of - Ember may overwrite this namespace and therefore, you should avoid adding any - new properties. - - At the heart of Ember is Ember-Runtime, a set of core functions that provide - cross-platform compatibility and object property observing. Ember-Runtime is - small and performance-focused so you can use it alongside other - cross-platform libraries such as jQuery. For more details, see - [Ember-Runtime](http://emberjs.com/api/modules/ember-runtime.html). - - @class Ember - @static - @public - */ - var Ember = typeof _emberEnvironment.context.imports.Ember === 'object' && _emberEnvironment.context.imports.Ember || {}; - - // Make sure these are set whether Ember was already defined or not - Ember.isNamespace = true; - Ember.toString = function () { - return 'Ember'; - }; - - // .......................................................... - // BOOTSTRAP - // - - exports.default = Ember; -}); -enifed("ember-metal/debug", ["exports"], function (exports) { - "use strict"; - - exports.getDebugFunction = getDebugFunction; - exports.setDebugFunction = setDebugFunction; - exports.assert = assert; - exports.info = info; - exports.warn = warn; - exports.debug = debug; - exports.deprecate = deprecate; - exports.deprecateFunc = deprecateFunc; - exports.runInDebug = runInDebug; - exports.debugSeal = debugSeal; - exports.debugFreeze = debugFreeze; - var debugFunctions = { - assert: function () {}, - info: function () {}, - warn: function () {}, - debug: function () {}, - deprecate: function () {}, - deprecateFunc: function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return args[args.length - 1]; - }, - runInDebug: function () {}, - debugSeal: function () {}, - debugFreeze: function () {} - }; - - exports.debugFunctions = debugFunctions; - - function getDebugFunction(name) { - return debugFunctions[name]; - } + exports.gatherArgs = gatherArgs; - function setDebugFunction(name, fn) { - debugFunctions[name] = fn; - } + // Maps all variants of positional and dynamically scoped arguments + // into the named arguments. Input `args` and return value are both + // `EvaluatedArgs`. - function assert() { - return debugFunctions.assert.apply(undefined, arguments); + function gatherArgs(args, definition) { + var namedMap = gatherNamedMap(args, definition); + var positionalValues = gatherPositionalValues(args, definition); + return mergeArgs(namedMap, positionalValues, args.blocks, definition.ComponentClass.class); } - function info() { - return debugFunctions.info.apply(undefined, arguments); + function gatherNamedMap(args, definition) { + var namedMap = args.named.map; + if (definition.args) { + return _emberUtils.assign({}, definition.args.named.map, namedMap); + } else { + return namedMap; + } } - function warn() { - return debugFunctions.warn.apply(undefined, arguments); + function gatherPositionalValues(args, definition) { + var positionalValues = args.positional.values; + if (definition.args) { + var oldPositional = definition.args.positional.values; + var newPositional = []; + newPositional.push.apply(newPositional, oldPositional); + newPositional.splice.apply(newPositional, [0, positionalValues.length].concat(positionalValues)); + return newPositional; + } else { + return positionalValues; + } } - function debug() { - return debugFunctions.debug.apply(undefined, arguments); - } + function mergeArgs(namedMap, positionalValues, blocks, componentClass) { + var positionalParamsDefinition = componentClass.positionalParams; - function deprecate() { - return debugFunctions.deprecate.apply(undefined, arguments); + if (positionalParamsDefinition && positionalParamsDefinition.length > 0 && positionalValues.length > 0) { + if (typeof positionalParamsDefinition === 'string') { + namedMap = mergeRestArg(namedMap, positionalValues, positionalParamsDefinition); + } else { + namedMap = mergePositionalParams(namedMap, positionalValues, positionalParamsDefinition); + } + } + return _glimmerRuntime.EvaluatedArgs.named(namedMap, blocks); } - function deprecateFunc() { - return debugFunctions.deprecateFunc.apply(undefined, arguments); - } + var EMPTY_ARGS = { + tag: _glimmerReference.CONSTANT_TAG, + value: function () { + var _props; - function runInDebug() { - return debugFunctions.runInDebug.apply(undefined, arguments); - } + return { attrs: {}, props: (_props = { attrs: {} }, _props[_emberGlimmerComponent.ARGS] = {}, _props) }; + } + }; - function debugSeal() { - return debugFunctions.debugSeal.apply(undefined, arguments); - } + // ComponentArgs takes EvaluatedNamedArgs and converts them into the + // inputs needed by CurlyComponents (attrs and props, with mutable + // cells, etc). - function debugFreeze() { - return debugFunctions.debugFreeze.apply(undefined, arguments); - } -}); -enifed('ember-metal/dependent_keys', ['exports', 'ember-metal/watching'], function (exports, _emberMetalWatching) { - 'no use strict'; - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed + var ComponentArgs = (function () { + ComponentArgs.create = function create(args) { + if (args.named.keys.length === 0) { + return EMPTY_ARGS; + } else { + return new ComponentArgs(args.named); + } + }; - exports.addDependentKeys = addDependentKeys; - exports.removeDependentKeys = removeDependentKeys; + function ComponentArgs(namedArgs) { + this.tag = namedArgs.tag; + this.namedArgs = namedArgs; + } - /** - @module ember - @submodule ember-metal - */ + ComponentArgs.prototype.value = function value() { + var namedArgs = this.namedArgs; - // .......................................................... - // DEPENDENT KEYS - // + var keys = namedArgs.keys; + var attrs = namedArgs.value(); + var props = new _emberUtils.EmptyObject(); + var args = new _emberUtils.EmptyObject(); - function addDependentKeys(desc, obj, keyName, meta) { - // the descriptor has a list of dependent keys, so - // add all of its dependent keys. - var idx = undefined, - depKey = undefined; - var depKeys = desc._dependentKeys; - if (!depKeys) { - return; - } + props[_emberGlimmerComponent.ARGS] = args; - for (idx = 0; idx < depKeys.length; idx++) { - depKey = depKeys[idx]; - // Increment the number of times depKey depends on keyName. - meta.writeDeps(depKey, keyName, (meta.peekDeps(depKey, keyName) || 0) + 1); - // Watch the depKey - _emberMetalWatching.watch(obj, depKey, meta); - } - } + for (var i = 0, l = keys.length; i < l; i++) { + var _name = keys[i]; + var ref = namedArgs.get(_name); + var value = attrs[_name]; - function removeDependentKeys(desc, obj, keyName, meta) { - // the descriptor has a list of dependent keys, so - // remove all of its dependent keys. - var depKeys = desc._dependentKeys; - if (!depKeys) { - return; - } + if (typeof value === 'function' && value[_emberGlimmerHelpersAction.ACTION]) { + attrs[_name] = value; + } else if (ref[_emberGlimmerUtilsReferences.UPDATE]) { + attrs[_name] = new MutableCell(ref, value); + } - for (var idx = 0; idx < depKeys.length; idx++) { - var depKey = depKeys[idx]; - // Decrement the number of times depKey depends on keyName. - meta.writeDeps(depKey, keyName, (meta.peekDeps(depKey, keyName) || 0) - 1); - // Unwatch the depKey - _emberMetalWatching.unwatch(obj, depKey, meta); - } - } -}); -enifed('ember-metal/deprecate_property', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set) { - /** - @module ember - @submodule ember-metal - */ + args[_name] = ref; + props[_name] = value; + } - 'use strict'; + props.attrs = attrs; - exports.deprecateProperty = deprecateProperty; + return { attrs: attrs, props: props }; + }; - /** - Used internally to allow changing properties in a backwards compatible way, and print a helpful - deprecation warning. - - @method deprecateProperty - @param {Object} object The object to add the deprecated property to. - @param {String} deprecatedKey The property to add (and print deprecation warnings upon accessing). - @param {String} newKey The property that will be aliased. - @private - @since 1.7.0 - */ + return ComponentArgs; + })(); - function deprecateProperty(object, deprecatedKey, newKey, options) { - function _deprecate() {} + exports.ComponentArgs = ComponentArgs; - Object.defineProperty(object, deprecatedKey, { - configurable: true, - enumerable: false, - set: function (value) { - _deprecate(); - _emberMetalProperty_set.set(this, newKey, value); - }, - get: function () { - _deprecate(); - return _emberMetalProperty_get.get(this, newKey); - } - }); + function mergeRestArg(namedMap, positionalValues, restArgName) { + var mergedNamed = _emberUtils.assign({}, namedMap); + mergedNamed[restArgName] = _glimmerRuntime.EvaluatedPositionalArgs.create(positionalValues); + return mergedNamed; } -}); -enifed('ember-metal/descriptor', ['exports', 'ember-metal/properties'], function (exports, _emberMetalProperties) { - 'use strict'; - - exports.default = descriptor; - function descriptor(desc) { - return new Descriptor(desc); + function mergePositionalParams(namedMap, values, positionalParamNames) { + var mergedNamed = _emberUtils.assign({}, namedMap); + var length = Math.min(values.length, positionalParamNames.length); + for (var i = 0; i < length; i++) { + var _name2 = positionalParamNames[i]; + mergedNamed[_name2] = values[i]; + } + return mergedNamed; } - /** - A wrapper for a native ES5 descriptor. In an ideal world, we wouldn't need - this at all, however, the way we currently flatten/merge our mixins require - a special value to denote a descriptor. - - @class Descriptor - @private - */ - - var Descriptor = (function (_EmberDescriptor) { - babelHelpers.inherits(Descriptor, _EmberDescriptor); + var REF = _emberUtils.symbol('REF'); - function Descriptor(desc) { - _EmberDescriptor.call(this); - this.desc = desc; + var MutableCell = (function () { + function MutableCell(ref, value) { + this[_emberViews.MUTABLE_CELL] = true; + this[REF] = ref; + this.value = value; } - Descriptor.prototype.setup = function setup(obj, key) { - Object.defineProperty(obj, key, this.desc); + MutableCell.prototype.update = function update(val) { + this[REF][_emberGlimmerUtilsReferences.UPDATE](val); }; - Descriptor.prototype.teardown = function teardown(obj, key) {}; - - return Descriptor; - })(_emberMetalProperties.Descriptor); + return MutableCell; + })(); }); -enifed("ember-metal/error", ["exports"], function (exports) { +enifed('ember-glimmer/utils/references', ['exports', 'ember-utils', 'ember-metal', '@glimmer/reference', '@glimmer/runtime', 'ember-glimmer/utils/to-bool', 'ember-glimmer/helper'], function (exports, _emberUtils, _emberMetal, _glimmerReference, _glimmerRuntime, _emberGlimmerUtilsToBool, _emberGlimmerHelper) { + 'use strict'; - /** - A subclass of the JavaScript Error object for use in Ember. - - @class Error - @namespace Ember - @extends Error - @constructor - @public - */ - "use strict"; + var UPDATE = _emberUtils.symbol('UPDATE'); - exports.default = EmberError; + exports.UPDATE = UPDATE; + exports.NULL_REFERENCE = _glimmerRuntime.NULL_REFERENCE; + exports.UNDEFINED_REFERENCE = _glimmerRuntime.UNDEFINED_REFERENCE; - function EmberError(message) { - if (!(this instanceof EmberError)) { - return new EmberError(message); - } + // @abstract + // @implements PathReference - var error = Error.call(this, message); + var EmberPathReference = (function () { + function EmberPathReference() {} - if (Error.captureStackTrace) { - Error.captureStackTrace(this, EmberError); - } else { - this.stack = error.stack; - } + // @abstract - this.description = error.description; - this.fileName = error.fileName; - this.lineNumber = error.lineNumber; - this.message = error.message; - this.name = error.name; - this.number = error.number; - this.code = error.code; - } + // @abstract get tag() + // @abstract value() - EmberError.prototype = Object.create(Error.prototype); -}); -enifed('ember-metal/error_handler', ['exports', 'ember-console', 'ember-metal/testing'], function (exports, _emberConsole, _emberMetalTesting) { - 'use strict'; + EmberPathReference.prototype.get = function get(key) { + return PropertyReference.create(this, key); + }; - exports.getOnerror = getOnerror; - exports.setOnerror = setOnerror; - exports.dispatchError = dispatchError; - exports.setDispatchOverride = setDispatchOverride; + return EmberPathReference; + })(); - // To maintain stacktrace consistency across browsers - var getStack = function (error) { - var stack = error.stack; - var message = error.message; + var CachedReference = (function (_EmberPathReference) { + babelHelpers.inherits(CachedReference, _EmberPathReference); - if (stack && stack.indexOf(message) === -1) { - stack = message + '\n' + stack; + function CachedReference() { + _EmberPathReference.call(this); + this._lastRevision = null; + this._lastValue = null; } - return stack; - }; + // @implements PathReference - var onerror = undefined; - // Ember.onerror getter + CachedReference.prototype.value = function value() { + var tag = this.tag; + var _lastRevision = this._lastRevision; + var _lastValue = this._lastValue; - function getOnerror() { - return onerror; - } + if (!_lastRevision || !tag.validate(_lastRevision)) { + _lastValue = this._lastValue = this.compute(); + this._lastRevision = tag.value(); + } - // Ember.onerror setter + return _lastValue; + }; - function setOnerror(handler) { - onerror = handler; - } + // @abstract compute() + return CachedReference; + })(EmberPathReference); - var dispatchOverride = undefined; - // dispatch error + exports.CachedReference = CachedReference; - function dispatchError(error) { - if (dispatchOverride) { - dispatchOverride(error); - } else { - defaultDispatch(error); + var RootReference = (function (_ConstReference) { + babelHelpers.inherits(RootReference, _ConstReference); + + function RootReference(value) { + _ConstReference.call(this, value); + this.children = new _emberUtils.EmptyObject(); } - } - // allows testing adapter to override dispatch + RootReference.prototype.get = function get(propertyKey) { + var ref = this.children[propertyKey]; - function setDispatchOverride(handler) { - dispatchOverride = handler; - } + if (!ref) { + ref = this.children[propertyKey] = new RootPropertyReference(this.inner, propertyKey); + } - function defaultDispatch(error) { - if (_emberMetalTesting.isTesting()) { - throw error; - } - if (onerror) { - onerror(error); - } else { - _emberConsole.default.error(getStack(error)); - } - } -}); -enifed('ember-metal/events', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/meta', 'ember-metal/meta_listeners'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalMeta, _emberMetalMeta_listeners) { - 'no use strict'; - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed + return ref; + }; - /** - @module ember - @submodule ember-metal - */ - exports.accumulateListeners = accumulateListeners; - exports.addListener = addListener; - exports.removeListener = removeListener; - exports.suspendListener = suspendListener; - exports.suspendListeners = suspendListeners; - exports.watchedEvents = watchedEvents; - exports.sendEvent = sendEvent; - exports.hasListeners = hasListeners; - exports.listenersFor = listenersFor; - exports.on = on; + return RootReference; + })(_glimmerReference.ConstReference); - /* - The event system uses a series of nested hashes to store listeners on an - object. When a listener is registered, or when an event arrives, these - hashes are consulted to determine which target and action pair to invoke. - - The hashes are stored in the object's meta hash, and look like this: - - // Object's meta hash - { - listeners: { // variable name: `listenerSet` - "foo:changed": [ // variable name: `actions` - target, method, flags - ] - } - } - - */ + exports.RootReference = RootReference; - function indexOf(array, target, method) { - var index = -1; - // hashes are added to the end of the event array - // so it makes sense to start searching at the end - // of the array and search in reverse - for (var i = array.length - 3; i >= 0; i -= 3) { - if (target === array[i] && method === array[i + 1]) { - index = i; - break; + var TwoWayFlushDetectionTag = undefined; + + if (false || true) { + TwoWayFlushDetectionTag = (function () { + function _class(tag, key, ref) { + this.tag = tag; + this.parent = null; + this.key = key; + this.ref = ref; } - } - return index; - } - function accumulateListeners(obj, eventName, otherActions) { - var meta = _emberMetalMeta.peekMeta(obj); - if (!meta) { - return; - } - var actions = meta.matchingListeners(eventName); - var newActions = []; + _class.prototype.value = function value() { + return this.tag.value(); + }; - for (var i = actions.length - 3; i >= 0; i -= 3) { - var target = actions[i]; - var method = actions[i + 1]; - var flags = actions[i + 2]; - var actionIndex = indexOf(otherActions, target, method); + _class.prototype.validate = function validate(ticket) { + var parent = this.parent; + var key = this.key; - if (actionIndex === -1) { - otherActions.push(target, method, flags); - newActions.push(target, method, flags); - } - } + var isValid = this.tag.validate(ticket); - return newActions; - } + if (isValid && parent) { + _emberMetal.didRender(parent, key, this.ref); + } - /** - Add an event listener - - @method addListener - @for Ember - @param obj - @param {String} eventName - @param {Object|Function} target A target object or a function - @param {Function|String} method A function or the name of a function to be called on `target` - @param {Boolean} once A flag whether a function should only be called once - @public - */ + return isValid; + }; - function addListener(obj, eventName, target, method, once) { + _class.prototype.didCompute = function didCompute(parent) { + this.parent = parent; + _emberMetal.didRender(parent, this.key, this.ref); + }; - if (!method && 'function' === typeof target) { - method = target; - target = null; - } + return _class; + })(); + } - var flags = 0; - if (once) { - flags |= _emberMetalMeta_listeners.ONCE; + var PropertyReference = (function (_CachedReference) { + babelHelpers.inherits(PropertyReference, _CachedReference); + + function PropertyReference() { + _CachedReference.apply(this, arguments); } - _emberMetalMeta.meta(obj).addToListeners(eventName, target, method, flags); + PropertyReference.create = function create(parentReference, propertyKey) { + if (_glimmerReference.isConst(parentReference)) { + return new RootPropertyReference(parentReference.value(), propertyKey); + } else { + return new NestedPropertyReference(parentReference, propertyKey); + } + }; - if ('function' === typeof obj.didAddListener) { - obj.didAddListener(eventName, target, method); - } - } + PropertyReference.prototype.get = function get(key) { + return new NestedPropertyReference(this, key); + }; - /** - Remove an event listener - - Arguments should match those passed to `Ember.addListener`. - - @method removeListener - @for Ember - @param obj - @param {String} eventName - @param {Object|Function} target A target object or a function - @param {Function|String} method A function or the name of a function to be called on `target` - @public - */ + return PropertyReference; + })(CachedReference); - function removeListener(obj, eventName, target, method) { + exports.PropertyReference = PropertyReference; - if (!method && 'function' === typeof target) { - method = target; - target = null; + var RootPropertyReference = (function (_PropertyReference) { + babelHelpers.inherits(RootPropertyReference, _PropertyReference); + + function RootPropertyReference(parentValue, propertyKey) { + _PropertyReference.call(this); + + this._parentValue = parentValue; + this._propertyKey = propertyKey; + + if (false || true) { + this.tag = new TwoWayFlushDetectionTag(_emberMetal.tagForProperty(parentValue, propertyKey), propertyKey, this); + } else { + this.tag = _emberMetal.tagForProperty(parentValue, propertyKey); + } + + if (false) { + _emberMetal.watchKey(parentValue, propertyKey); + } } - _emberMetalMeta.meta(obj).removeFromListeners(eventName, target, method, function () { - if ('function' === typeof obj.didRemoveListener) { - obj.didRemoveListener.apply(obj, arguments); + RootPropertyReference.prototype.compute = function compute() { + var _parentValue = this._parentValue; + var _propertyKey = this._propertyKey; + + if (false || true) { + this.tag.didCompute(_parentValue); } - }); - } - /** - Suspend listener during callback. - - This should only be used by the target of the event listener - when it is taking an action that would cause the event, e.g. - an object might suspend its property change listener while it is - setting that property. - - @method suspendListener - @for Ember - - @private - @param obj - @param {String} eventName - @param {Object|Function} target A target object or a function - @param {Function|String} method A function or the name of a function to be called on `target` - @param {Function} callback - */ + return _emberMetal.get(_parentValue, _propertyKey); + }; - function suspendListener(obj, eventName, target, method, callback) { - return suspendListeners(obj, [eventName], target, method, callback); - } + RootPropertyReference.prototype[UPDATE] = function (value) { + _emberMetal.set(this._parentValue, this._propertyKey, value); + }; - /** - Suspends multiple listeners during a callback. - - @method suspendListeners - @for Ember - - @private - @param obj - @param {Array} eventNames Array of event names - @param {Object|Function} target A target object or a function - @param {Function|String} method A function or the name of a function to be called on `target` - @param {Function} callback - */ + return RootPropertyReference; + })(PropertyReference); - function suspendListeners(obj, eventNames, target, method, callback) { - if (!method && 'function' === typeof target) { - method = target; - target = null; - } - return _emberMetalMeta.meta(obj).suspendListeners(eventNames, target, method, callback); - } + exports.RootPropertyReference = RootPropertyReference; - /** - Return a list of currently watched events - - @private - @method watchedEvents - @for Ember - @param obj - */ + var NestedPropertyReference = (function (_PropertyReference2) { + babelHelpers.inherits(NestedPropertyReference, _PropertyReference2); - function watchedEvents(obj) { - return _emberMetalMeta.meta(obj).watchedEvents(); - } + function NestedPropertyReference(parentReference, propertyKey) { + _PropertyReference2.call(this); - /** - Send an event. The execution of suspended listeners - is skipped, and once listeners are removed. A listener without - a target is executed on the passed object. If an array of actions - is not passed, the actions stored on the passed object are invoked. - - @method sendEvent - @for Ember - @param obj - @param {String} eventName - @param {Array} params Optional parameters for each listener. - @param {Array} actions Optional array of actions (listeners). - @return true - @public - */ + var parentReferenceTag = parentReference.tag; + var parentObjectTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - function sendEvent(obj, eventName, params, actions) { - if (!actions) { - var meta = _emberMetalMeta.peekMeta(obj); - actions = meta && meta.matchingListeners(eventName); - } + this._parentReference = parentReference; + this._parentObjectTag = parentObjectTag; + this._propertyKey = propertyKey; - if (!actions || actions.length === 0) { - return; + if (false || true) { + var tag = _glimmerReference.combine([parentReferenceTag, parentObjectTag]); + this.tag = new TwoWayFlushDetectionTag(tag, propertyKey, this); + } else { + this.tag = _glimmerReference.combine([parentReferenceTag, parentObjectTag]); + } } - for (var i = actions.length - 3; i >= 0; i -= 3) { - // looping in reverse for once listeners - var target = actions[i]; - var method = actions[i + 1]; - var flags = actions[i + 2]; + NestedPropertyReference.prototype.compute = function compute() { + var _parentReference = this._parentReference; + var _parentObjectTag = this._parentObjectTag; + var _propertyKey = this._propertyKey; - if (!method) { - continue; - } - if (flags & _emberMetalMeta_listeners.SUSPENDED) { - continue; - } - if (flags & _emberMetalMeta_listeners.ONCE) { - removeListener(obj, eventName, target, method); - } - if (!target) { - target = obj; + var parentValue = _parentReference.value(); + + _parentObjectTag.update(_emberMetal.tagForProperty(parentValue, _propertyKey)); + + if (typeof parentValue === 'string' && _propertyKey === 'length') { + return parentValue.length; } - if ('string' === typeof method) { - if (params) { - _emberUtils.applyStr(target, method, params); - } else { - target[method](); + + if (typeof parentValue === 'object' && parentValue) { + if (false) { + _emberMetal.watchKey(parentValue, _propertyKey); } - } else { - if (params) { - method.apply(target, params); - } else { - method.call(target); + + if (false || true) { + this.tag.didCompute(parentValue); } + + return _emberMetal.get(parentValue, _propertyKey); + } else { + return undefined; } - } - return true; - } + }; - /** - @private - @method hasListeners - @for Ember - @param obj - @param {String} eventName - */ + NestedPropertyReference.prototype[UPDATE] = function (value) { + var parent = this._parentReference.value(); + _emberMetal.set(parent, this._propertyKey, value); + }; - function hasListeners(obj, eventName) { - var meta = _emberMetalMeta.peekMeta(obj); - if (!meta) { - return false; - } - return meta.matchingListeners(eventName).length > 0; - } + return NestedPropertyReference; + })(PropertyReference); - /** - @private - @method listenersFor - @for Ember - @param obj - @param {String} eventName - */ + exports.NestedPropertyReference = NestedPropertyReference; - function listenersFor(obj, eventName) { - var ret = []; - var meta = _emberMetalMeta.peekMeta(obj); - var actions = meta && meta.matchingListeners(eventName); + var UpdatableReference = (function (_EmberPathReference2) { + babelHelpers.inherits(UpdatableReference, _EmberPathReference2); - if (!actions) { - return ret; - } + function UpdatableReference(value) { + _EmberPathReference2.call(this); - for (var i = 0; i < actions.length; i += 3) { - var target = actions[i]; - var method = actions[i + 1]; - ret.push([target, method]); + this.tag = new _glimmerReference.DirtyableTag(); + this._value = value; } - return ret; - } + UpdatableReference.prototype.value = function value() { + return this._value; + }; - /** - Define a property as a function that should be executed when - a specified event or events are triggered. - - - ``` javascript - let Job = Ember.Object.extend({ - logCompleted: Ember.on('completed', function() { - console.log('Job completed!'); - }) - }); - - let job = Job.create(); - - Ember.sendEvent(job, 'completed'); // Logs 'Job completed!' - ``` - - @method on - @for Ember - @param {String} eventNames* - @param {Function} func - @return func - @public - */ + UpdatableReference.prototype.update = function update(value) { + var _value = this._value; - function on() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } + if (value !== _value) { + this.tag.dirty(); + this._value = value; + } + }; - var func = args.pop(); - var events = args; - func.__ember_listens__ = events; - return func; - } -}); -enifed('ember-metal/expand_properties', ['exports', 'ember-metal/debug'], function (exports, _emberMetalDebug) { - 'use strict'; + return UpdatableReference; + })(EmberPathReference); - exports.default = expandProperties; + exports.UpdatableReference = UpdatableReference; - /** - @module ember - @submodule ember-metal - */ + var UpdatablePrimitiveReference = (function (_UpdatableReference) { + babelHelpers.inherits(UpdatablePrimitiveReference, _UpdatableReference); - var SPLIT_REGEX = /\{|\}/; - var END_WITH_EACH_REGEX = /\.@each$/; + function UpdatablePrimitiveReference() { + _UpdatableReference.apply(this, arguments); + } - /** - Expands `pattern`, invoking `callback` for each expansion. - - The only pattern supported is brace-expansion, anything else will be passed - once to `callback` directly. - - Example - - ```js - function echo(arg){ console.log(arg); } - - 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}.[]', 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 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. - */ + UpdatablePrimitiveReference.prototype.get = function get() { + return _glimmerRuntime.UNDEFINED_REFERENCE; + }; - function expandProperties(pattern, callback) { + return UpdatablePrimitiveReference; + })(UpdatableReference); - var parts = pattern.split(SPLIT_REGEX); - var properties = [parts]; + exports.UpdatablePrimitiveReference = UpdatablePrimitiveReference; - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; - if (part.indexOf(',') >= 0) { - properties = duplicateAndReplace(properties, part.split(','), i); + var ConditionalReference = (function (_GlimmerConditionalReference) { + babelHelpers.inherits(ConditionalReference, _GlimmerConditionalReference); + + ConditionalReference.create = function create(reference) { + if (_glimmerReference.isConst(reference)) { + var value = reference.value(); + + if (_emberMetal.isProxy(value)) { + return new RootPropertyReference(value, 'isTruthy'); + } else { + return _glimmerRuntime.PrimitiveReference.create(_emberGlimmerUtilsToBool.default(value)); + } } + + return new ConditionalReference(reference); + }; + + function ConditionalReference(reference) { + _GlimmerConditionalReference.call(this, reference); + + this.objectTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); + this.tag = _glimmerReference.combine([reference.tag, this.objectTag]); } - for (var i = 0; i < properties.length; i++) { - callback(properties[i].join('').replace(END_WITH_EACH_REGEX, '.[]')); + ConditionalReference.prototype.toBool = function toBool(predicate) { + if (_emberMetal.isProxy(predicate)) { + this.objectTag.update(_emberMetal.tagForProperty(predicate, 'isTruthy')); + return _emberMetal.get(predicate, 'isTruthy'); + } else { + this.objectTag.update(_emberMetal.tagFor(predicate)); + return _emberGlimmerUtilsToBool.default(predicate); + } + }; + + return ConditionalReference; + })(_glimmerRuntime.ConditionalReference); + + exports.ConditionalReference = ConditionalReference; + + var SimpleHelperReference = (function (_CachedReference2) { + babelHelpers.inherits(SimpleHelperReference, _CachedReference2); + + SimpleHelperReference.create = function create(helper, args) { + if (_glimmerReference.isConst(args)) { + var positional = args.positional; + var named = args.named; + + var positionalValue = positional.value(); + var namedValue = named.value(); + + var result = helper(positionalValue, namedValue); + + if (result === null) { + return _glimmerRuntime.NULL_REFERENCE; + } else if (result === undefined) { + return _glimmerRuntime.UNDEFINED_REFERENCE; + } else if (typeof result === 'object') { + return new RootReference(result); + } else { + return _glimmerRuntime.PrimitiveReference.create(result); + } + } else { + return new SimpleHelperReference(helper, args); + } + }; + + function SimpleHelperReference(helper, args) { + _CachedReference2.call(this); + + this.tag = args.tag; + this.helper = helper; + this.args = args; } - } - function duplicateAndReplace(properties, currentParts, index) { - var all = []; + SimpleHelperReference.prototype.compute = function compute() { + var helper = this.helper; + var _args = this.args; + var positional = _args.positional; + var named = _args.named; - properties.forEach(function (property) { - currentParts.forEach(function (part) { - var current = property.slice(0); - current[index] = part; - all.push(current); - }); - }); + var positionalValue = positional.value(); + var namedValue = named.value(); - return all; - } -}); -enifed('ember-metal/features', ['exports', 'ember-utils', 'ember-environment', 'ember/features'], function (exports, _emberUtils, _emberEnvironment, _emberFeatures) { - 'use strict'; + return helper(positionalValue, namedValue); + }; - exports.default = isEnabled; + return SimpleHelperReference; + })(CachedReference); - /** - The hash of enabled Canary features. Add to this, any canary features - before creating your application. - - Alternatively (and recommended), you can also define `EmberENV.FEATURES` - if you need to enable features flagged at runtime. - - @class FEATURES - @namespace Ember - @static - @since 1.1.0 - @public - */ - var FEATURES = _emberUtils.assign(_emberFeatures.default, _emberEnvironment.ENV.FEATURES); + exports.SimpleHelperReference = SimpleHelperReference; - exports.FEATURES = FEATURES; + var ClassBasedHelperReference = (function (_CachedReference3) { + babelHelpers.inherits(ClassBasedHelperReference, _CachedReference3); + + ClassBasedHelperReference.create = function create(helperClass, vm, args) { + var instance = helperClass.create(); + vm.newDestroyable(instance); + return new ClassBasedHelperReference(instance, args); + }; + + function ClassBasedHelperReference(instance, args) { + _CachedReference3.call(this); + + this.tag = _glimmerReference.combine([instance[_emberGlimmerHelper.RECOMPUTE_TAG], args.tag]); + this.instance = instance; + this.args = args; + } + + ClassBasedHelperReference.prototype.compute = function compute() { + var instance = this.instance; + var _args2 = this.args; + var positional = _args2.positional; + var named = _args2.named; + + var positionalValue = positional.value(); + var namedValue = named.value(); + + return instance.compute(positionalValue, namedValue); + }; + + return ClassBasedHelperReference; + })(CachedReference); + + exports.ClassBasedHelperReference = ClassBasedHelperReference; + + var InternalHelperReference = (function (_CachedReference4) { + babelHelpers.inherits(InternalHelperReference, _CachedReference4); + + function InternalHelperReference(helper, args) { + _CachedReference4.call(this); + + this.tag = args.tag; + this.helper = helper; + this.args = args; + } + + // @implements PathReference + + InternalHelperReference.prototype.compute = function compute() { + var helper = this.helper; + var args = this.args; + + return helper(args); + }; + + return InternalHelperReference; + })(CachedReference); + + exports.InternalHelperReference = InternalHelperReference; + + var UnboundReference = (function (_ConstReference2) { + babelHelpers.inherits(UnboundReference, _ConstReference2); + + function UnboundReference() { + _ConstReference2.apply(this, arguments); + } + + UnboundReference.create = function create(value) { + if (value === null) { + return _glimmerRuntime.NULL_REFERENCE; + } else if (value === undefined) { + return _glimmerRuntime.UNDEFINED_REFERENCE; + } else if (typeof value === 'object') { + return new UnboundReference(value); + } else { + return _glimmerRuntime.PrimitiveReference.create(value); + } + }; + + UnboundReference.prototype.get = function get(key) { + return new UnboundReference(_emberMetal.get(this.inner, key)); + }; + + return UnboundReference; + })(_glimmerReference.ConstReference); + + exports.UnboundReference = UnboundReference; +}); +enifed('ember-glimmer/utils/string', ['exports', 'ember-metal'], function (exports, _emberMetal) { /** - Determine whether the specified `feature` is enabled. Used by Ember's - build tools to exclude experimental features from beta/stable builds. - - You can define the following configuration options: - - * `EmberENV.ENABLE_OPTIONAL_FEATURES` - enable any features that have not been explicitly - enabled/disabled. - - @method isEnabled - @param {String} feature The feature to check - @return {Boolean} - @for Ember.FEATURES - @since 1.1.0 - @public + @module ember + @submodule ember-glimmer */ - function isEnabled(feature) { - var featureValue = FEATURES[feature]; + 'use strict'; - if (featureValue === true || featureValue === false || featureValue === undefined) { - return featureValue; - } else if (_emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES) { - return true; - } else { - return false; + exports.getSafeString = getSafeString; + exports.escapeExpression = escapeExpression; + exports.htmlSafe = htmlSafe; + exports.isHTMLSafe = isHTMLSafe; + + var SafeString = (function () { + function SafeString(string) { + this.string = string; } + + SafeString.prototype.toString = function toString() { + return '' + this.string; + }; + + SafeString.prototype.toHTML = function toHTML() { + return this.toString(); + }; + + return SafeString; + })(); + + exports.SafeString = SafeString; + + function getSafeString() { + + return SafeString; } - exports.DEFAULT_FEATURES = _emberFeatures.default; -}); -enifed('ember-metal/get_properties', ['exports', 'ember-metal/property_get'], function (exports, _emberMetalProperty_get) { - 'use strict'; + var escape = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + // jscs:disable + "'": ''', + // jscs:enable + '`': '`', + '=': '=' + }; - exports.default = getProperties; + var possible = /[&<>"'`=]/; + var badChars = /[&<>"'`=]/g; + + function escapeChar(chr) { + return escape[chr]; + } + + function escapeExpression(string) { + if (typeof string !== 'string') { + // don't escape SafeStrings, since they're already safe + if (string && string.toHTML) { + return string.toHTML(); + } else if (string == null) { + return ''; + } else if (!string) { + return string + ''; + } + + // Force a string conversion as this will be done by the append regardless and + // the regex test will do this transparently behind the scenes, causing issues if + // an object's to string has escaped characters in it. + string = '' + string; + } + + if (!possible.test(string)) { + return string; + } + return string.replace(badChars, escapeChar); + } /** - To get multiple properties at once, call `Ember.getProperties` - with an object followed by a list of strings or an array: + 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. ```javascript - Ember.getProperties(record, 'firstName', 'lastName', 'zipCode'); - // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } + Ember.String.htmlSafe('
    someString
    ') ``` - is equivalent to: + @method htmlSafe + @for Ember.String + @static + @return {Handlebars.SafeString} A string that will not be HTML escaped by Handlebars. + @public + */ + + function htmlSafe(str) { + if (str === null || str === undefined) { + str = ''; + } else if (typeof str !== 'string') { + str = '' + str; + } + return new SafeString(str); + } + + /** + Detects if a string was decorated using `Ember.String.htmlSafe`. ```javascript - Ember.getProperties(record, ['firstName', 'lastName', 'zipCode']); - // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } + var plainString = 'plain string', + safeString = Ember.String.htmlSafe('
    someValue
    '); + + Ember.String.isHTMLSafe(plainString); // false + Ember.String.isHTMLSafe(safeString); // true ``` - @method getProperties - @for Ember - @param {Object} obj - @param {String...|Array} list of keys to get - @return {Object} + @method isHTMLSafe + @for Ember.String + @static + @return {Boolean} `true` if the string was decorated with `htmlSafe`, `false` otherwise. @public */ - function getProperties(obj) { - var ret = {}; - var propertyNames = arguments; - var i = 1; + function isHTMLSafe(str) { + return str && typeof str.toHTML === 'function'; + } +}); +enifed('ember-glimmer/utils/to-bool', ['exports', 'ember-runtime', 'ember-metal'], function (exports, _emberRuntime, _emberMetal) { + 'use strict'; - if (arguments.length === 2 && Array.isArray(arguments[1])) { - i = 0; - propertyNames = arguments[1]; + exports.default = toBool; + + function toBool(predicate) { + if (!predicate) { + return false; } - for (; i < propertyNames.length; i++) { - ret[propertyNames[i]] = _emberMetalProperty_get.get(obj, propertyNames[i]); + + if (predicate === true) { + return true; } - return ret; + + if (_emberRuntime.isArray(predicate)) { + return _emberMetal.get(predicate, 'length') !== 0; + } + + return true; } }); -enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/merge', 'ember-metal/debug', 'ember-metal/instrumentation', 'ember-metal/testing', 'ember-metal/error_handler', 'ember-metal/meta', 'ember-metal/error', 'ember-metal/cache', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/weak_map', 'ember-metal/events', 'ember-metal/is_none', 'ember-metal/is_empty', 'ember-metal/is_blank', 'ember-metal/is_present', 'ember-metal/run_loop', 'ember-metal/observer_set', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/watch_key', 'ember-metal/chains', 'ember-metal/watch_path', 'ember-metal/watching', 'ember-metal/libraries', 'ember-metal/map', 'ember-metal/get_properties', 'ember-metal/set_properties', 'ember-metal/expand_properties', 'ember-metal/observer', 'ember-metal/mixin', 'ember-metal/binding', 'ember-metal/path_cache', 'ember-metal/injected_property', 'ember-metal/tags', 'ember-metal/replace', 'ember-metal/transaction', 'ember-metal/is_proxy', 'ember-metal/descriptor'], function (exports, _require, _emberMetalCore, _emberMetalComputed, _emberMetalAlias, _emberMetalMerge, _emberMetalDebug, _emberMetalInstrumentation, _emberMetalTesting, _emberMetalError_handler, _emberMetalMeta, _emberMetalError, _emberMetalCache, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalWeak_map, _emberMetalEvents, _emberMetalIs_none, _emberMetalIs_empty, _emberMetalIs_blank, _emberMetalIs_present, _emberMetalRun_loop, _emberMetalObserver_set, _emberMetalProperty_events, _emberMetalProperties, _emberMetalWatch_key, _emberMetalChains, _emberMetalWatch_path, _emberMetalWatching, _emberMetalLibraries, _emberMetalMap, _emberMetalGet_properties, _emberMetalSet_properties, _emberMetalExpand_properties, _emberMetalObserver, _emberMetalMixin, _emberMetalBinding, _emberMetalPath_cache, _emberMetalInjected_property, _emberMetalTags, _emberMetalReplace, _emberMetalTransaction, _emberMetalIs_proxy, _emberMetalDescriptor) { +enifed('ember-glimmer/views/outlet', ['exports', 'ember-utils', '@glimmer/reference', 'ember-environment', 'ember-metal'], function (exports, _emberUtils, _glimmerReference, _emberEnvironment, _emberMetal) { /** @module ember - @submodule ember-metal + @submodule ember-glimmer */ - 'use strict'; - exports.default = _emberMetalCore.default; - // reexports - exports.computed = _emberMetalComputed.default; - exports.cacheFor = _emberMetalComputed.cacheFor; - exports.ComputedProperty = _emberMetalComputed.ComputedProperty; - exports.alias = _emberMetalAlias.default; - exports.merge = _emberMetalMerge.default; - exports.assert = _emberMetalDebug.assert; - exports.info = _emberMetalDebug.info; - exports.warn = _emberMetalDebug.warn; - exports.debug = _emberMetalDebug.debug; - exports.deprecate = _emberMetalDebug.deprecate; - exports.deprecateFunc = _emberMetalDebug.deprecateFunc; - exports.runInDebug = _emberMetalDebug.runInDebug; - exports.setDebugFunction = _emberMetalDebug.setDebugFunction; - exports.getDebugFunction = _emberMetalDebug.getDebugFunction; - exports.debugSeal = _emberMetalDebug.debugSeal; - exports.debugFreeze = _emberMetalDebug.debugFreeze; - exports.instrument = _emberMetalInstrumentation.instrument; - exports.flaggedInstrument = _emberMetalInstrumentation.flaggedInstrument; - exports._instrumentStart = _emberMetalInstrumentation._instrumentStart; - exports.instrumentationReset = _emberMetalInstrumentation.reset; - exports.instrumentationSubscribe = _emberMetalInstrumentation.subscribe; - exports.instrumentationUnsubscribe = _emberMetalInstrumentation.unsubscribe; - exports.isTesting = _emberMetalTesting.isTesting; - exports.setTesting = _emberMetalTesting.setTesting; - exports.getOnerror = _emberMetalError_handler.getOnerror; - exports.setOnerror = _emberMetalError_handler.setOnerror; - exports.dispatchError = _emberMetalError_handler.dispatchError; - exports.setDispatchOverride = _emberMetalError_handler.setDispatchOverride; - exports.META_DESC = _emberMetalMeta.META_DESC; - exports.meta = _emberMetalMeta.meta; - exports.peekMeta = _emberMetalMeta.peekMeta; - exports.Error = _emberMetalError.default; - exports.Cache = _emberMetalCache.default; - exports.isFeatureEnabled = _emberMetalFeatures.default; - exports.FEATURES = _emberMetalFeatures.FEATURES; - exports.DEFAULT_FEATURES = _emberMetalFeatures.DEFAULT_FEATURES; - exports._getPath = _emberMetalProperty_get._getPath; - exports.get = _emberMetalProperty_get.get; - exports.getWithDefault = _emberMetalProperty_get.getWithDefault; - exports.set = _emberMetalProperty_set.set; - exports.trySet = _emberMetalProperty_set.trySet; - exports.WeakMap = _emberMetalWeak_map.default; - exports.accumulateListeners = _emberMetalEvents.accumulateListeners; - exports.addListener = _emberMetalEvents.addListener; - exports.hasListeners = _emberMetalEvents.hasListeners; - exports.listenersFor = _emberMetalEvents.listenersFor; - exports.on = _emberMetalEvents.on; - exports.removeListener = _emberMetalEvents.removeListener; - exports.sendEvent = _emberMetalEvents.sendEvent; - exports.suspendListener = _emberMetalEvents.suspendListener; - exports.suspendListeners = _emberMetalEvents.suspendListeners; - exports.watchedEvents = _emberMetalEvents.watchedEvents; - exports.isNone = _emberMetalIs_none.default; - exports.isEmpty = _emberMetalIs_empty.default; - exports.isBlank = _emberMetalIs_blank.default; - exports.isPresent = _emberMetalIs_present.default; - exports.run = _emberMetalRun_loop.default; - exports.ObserverSet = _emberMetalObserver_set.default; - exports.beginPropertyChanges = _emberMetalProperty_events.beginPropertyChanges; - exports.changeProperties = _emberMetalProperty_events.changeProperties; - exports.endPropertyChanges = _emberMetalProperty_events.endPropertyChanges; - exports.overrideChains = _emberMetalProperty_events.overrideChains; - exports.propertyDidChange = _emberMetalProperty_events.propertyDidChange; - exports.propertyWillChange = _emberMetalProperty_events.propertyWillChange; - exports.PROPERTY_DID_CHANGE = _emberMetalProperty_events.PROPERTY_DID_CHANGE; - exports.defineProperty = _emberMetalProperties.defineProperty; - exports.Descriptor = _emberMetalProperties.Descriptor; - exports.watchKey = _emberMetalWatch_key.watchKey; - exports.unwatchKey = _emberMetalWatch_key.unwatchKey; - exports.ChainNode = _emberMetalChains.ChainNode; - exports.finishChains = _emberMetalChains.finishChains; - exports.removeChainWatcher = _emberMetalChains.removeChainWatcher; - exports.watchPath = _emberMetalWatch_path.watchPath; - exports.unwatchPath = _emberMetalWatch_path.unwatchPath; - exports.destroy = _emberMetalWatching.destroy; - exports.isWatching = _emberMetalWatching.isWatching; - exports.unwatch = _emberMetalWatching.unwatch; - exports.watch = _emberMetalWatching.watch; - exports.watcherCount = _emberMetalWatching.watcherCount; - exports.libraries = _emberMetalLibraries.default; - exports.Map = _emberMetalMap.Map; - exports.MapWithDefault = _emberMetalMap.MapWithDefault; - exports.OrderedSet = _emberMetalMap.OrderedSet; - exports.getProperties = _emberMetalGet_properties.default; - exports.setProperties = _emberMetalSet_properties.default; - exports.expandProperties = _emberMetalExpand_properties.default; - exports._suspendObserver = _emberMetalObserver._suspendObserver; - exports._suspendObservers = _emberMetalObserver._suspendObservers; - exports.addObserver = _emberMetalObserver.addObserver; - exports.observersFor = _emberMetalObserver.observersFor; - exports.removeObserver = _emberMetalObserver.removeObserver; - exports._addBeforeObserver = _emberMetalObserver._addBeforeObserver; - exports._removeBeforeObserver = _emberMetalObserver._removeBeforeObserver; - exports.NAME_KEY = _emberMetalMixin.NAME_KEY; - exports.Mixin = _emberMetalMixin.Mixin; - exports.aliasMethod = _emberMetalMixin.aliasMethod; - exports._immediateObserver = _emberMetalMixin._immediateObserver; - exports._beforeObserver = _emberMetalMixin._beforeObserver; - exports.mixin = _emberMetalMixin.mixin; - exports.observer = _emberMetalMixin.observer; - exports.required = _emberMetalMixin.required; - exports.REQUIRED = _emberMetalMixin.REQUIRED; - exports.hasUnprocessedMixins = _emberMetalMixin.hasUnprocessedMixins; - exports.clearUnprocessedMixins = _emberMetalMixin.clearUnprocessedMixins; - exports.detectBinding = _emberMetalMixin.detectBinding; - exports.Binding = _emberMetalBinding.Binding; - exports.bind = _emberMetalBinding.bind; - exports.isGlobalPath = _emberMetalPath_cache.isGlobalPath; - exports.InjectedProperty = _emberMetalInjected_property.default; - exports.setHasViews = _emberMetalTags.setHasViews; - exports.tagForProperty = _emberMetalTags.tagForProperty; - exports.tagFor = _emberMetalTags.tagFor; - exports.markObjectAsDirty = _emberMetalTags.markObjectAsDirty; - exports.replace = _emberMetalReplace.default; - exports.runInTransaction = _emberMetalTransaction.default; - exports.didRender = _emberMetalTransaction.didRender; - exports.assertNotRendered = _emberMetalTransaction.assertNotRendered; - exports.isProxy = _emberMetalIs_proxy.isProxy; - exports.descriptor = _emberMetalDescriptor.default; - - // TODO: this needs to be deleted once we refactor the build tooling - // do this for side-effects of updating Ember.assert, warn, etc when - // ember-debug is present - // This needs to be called before any deprecateFunc + var OutletStateReference = (function () { + function OutletStateReference(outletView) { + this.outletView = outletView; + this.tag = outletView._tag; + } - if (_require.has('ember-debug')) { - _require.default('ember-debug'); - } -}); -enifed('ember-metal/injected_property', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/properties'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalComputed, _emberMetalAlias, _emberMetalProperties) { - 'use strict'; + // So this is a relic of the past that SHOULD go away + // in 3.0. Preferably it is deprecated in the release that + // follows the Glimmer release. - exports.default = InjectedProperty; + OutletStateReference.prototype.get = function get(key) { + return new ChildOutletStateReference(this, key); + }; - /** - Read-only property that returns the result of a container lookup. - - @class InjectedProperty - @namespace Ember - @constructor - @param {String} type The container type the property will lookup - @param {String} name (optional) The name the property will lookup, defaults - to the property's name - @private - */ + OutletStateReference.prototype.value = function value() { + return this.outletView.outletState; + }; - function InjectedProperty(type, name) { - this.type = type; - this.name = name; + OutletStateReference.prototype.getOrphan = function getOrphan(name) { + return new OrphanedOutletStateReference(this, name); + }; - this._super$Constructor(injectedPropertyGet); - AliasedPropertyPrototype.oneWay.call(this); - } + OutletStateReference.prototype.update = function update(state) { + this.outletView.setOutletState(state); + }; - function injectedPropertyGet(keyName) { - var desc = this[keyName]; - var owner = _emberUtils.getOwner(this) || this.container; // fallback to `container` for backwards compat + return OutletStateReference; + })(); - return owner.lookup(desc.type + ':' + (desc.name || keyName)); - } + var OrphanedOutletStateReference = (function (_OutletStateReference) { + babelHelpers.inherits(OrphanedOutletStateReference, _OutletStateReference); - InjectedProperty.prototype = Object.create(_emberMetalProperties.Descriptor.prototype); + function OrphanedOutletStateReference(root, name) { + _OutletStateReference.call(this, root.outletView); + this.root = root; + this.name = name; + } - var InjectedPropertyPrototype = InjectedProperty.prototype; - var ComputedPropertyPrototype = _emberMetalComputed.ComputedProperty.prototype; - var AliasedPropertyPrototype = _emberMetalAlias.AliasedProperty.prototype; + OrphanedOutletStateReference.prototype.value = function value() { + var rootState = this.root.value(); - InjectedPropertyPrototype._super$Constructor = _emberMetalComputed.ComputedProperty; + var orphans = rootState.outlets.main.outlets.__ember_orphans__; - InjectedPropertyPrototype.get = ComputedPropertyPrototype.get; - InjectedPropertyPrototype.readOnly = ComputedPropertyPrototype.readOnly; - InjectedPropertyPrototype.teardown = ComputedPropertyPrototype.teardown; -}); -enifed('ember-metal/instrumentation', ['exports', 'ember-environment', 'ember-metal/features'], function (exports, _emberEnvironment, _emberMetalFeatures) { - 'use strict'; + if (!orphans) { + return null; + } - exports.instrument = instrument; - exports._instrumentStart = _instrumentStart; - exports.subscribe = subscribe; - exports.unsubscribe = unsubscribe; - exports.reset = reset; + var matched = orphans.outlets[this.name]; - /** - The purpose of the Ember Instrumentation module is - to provide efficient, general-purpose instrumentation - for Ember. - - Subscribe to a listener by using `Ember.subscribe`: - - ```javascript - Ember.subscribe("render", { - before(name, timestamp, payload) { - - }, - - after(name, timestamp, payload) { - + if (!matched) { + return null; } - }); - ``` - - If you return a value from the `before` callback, that same - value will be passed as a fourth parameter to the `after` - callback. - - Instrument a block of code by using `Ember.instrument`: - - ```javascript - Ember.instrument("render.handlebars", payload, function() { - // rendering logic - }, binding); - ``` - - Event names passed to `Ember.instrument` are namespaced - by periods, from more general to more specific. Subscribers - can listen for events by whatever level of granularity they - are interested in. - - In the above example, the event is `render.handlebars`, - and the subscriber listened for all events beginning with - `render`. It would receive callbacks for events named - `render`, `render.handlebars`, `render.container`, or - even `render.handlebars.layout`. - - @class Instrumentation - @namespace Ember - @static - @private - */ - var subscribers = []; - exports.subscribers = subscribers; - var cache = {}; - function populateListeners(name) { - var listeners = []; - var subscriber = undefined; + var state = new _emberUtils.EmptyObject(); + state[matched.render.outlet] = matched; + matched.wasUsed = true; + return { outlets: state }; + }; - for (var i = 0; i < subscribers.length; i++) { - subscriber = subscribers[i]; - if (subscriber.regex.test(name)) { - listeners.push(subscriber.object); - } + return OrphanedOutletStateReference; + })(OutletStateReference); + + var ChildOutletStateReference = (function () { + function ChildOutletStateReference(parent, key) { + this.parent = parent; + this.key = key; + this.tag = parent.tag; } - cache[name] = listeners; - return listeners; - } + ChildOutletStateReference.prototype.get = function get(key) { + return new ChildOutletStateReference(this, key); + }; - var time = (function () { - var perf = 'undefined' !== typeof window ? window.performance || {} : {}; - var fn = perf.now || perf.mozNow || perf.webkitNow || perf.msNow || perf.oNow; - // fn.bind will be available in all the browsers that support the advanced window.performance... ;-) - return fn ? fn.bind(perf) : function () { - return +new Date(); + ChildOutletStateReference.prototype.value = function value() { + return this.parent.value()[this.key]; }; + + return ChildOutletStateReference; })(); - /** - Notifies event's subscribers, calls `before` and `after` hooks. - - @method instrument - @namespace Ember.Instrumentation - - @param {String} [name] Namespaced event name. - @param {Object} _payload - @param {Function} callback Function that you're instrumenting. - @param {Object} binding Context that instrument function is called with. - @private - */ + var OutletView = (function () { + OutletView.extend = function extend(injections) { + return (function (_OutletView) { + babelHelpers.inherits(_class, _OutletView); - function instrument(name, _payload, callback, binding) { - if (arguments.length <= 3 && typeof _payload === 'function') { - binding = callback; - callback = _payload; - _payload = undefined; - } - if (subscribers.length === 0) { - return callback.call(binding); - } - var payload = _payload || {}; - var finalizer = _instrumentStart(name, function () { - return payload; - }); + function _class() { + _OutletView.apply(this, arguments); + } - if (finalizer) { - return withFinalizer(callback, finalizer, payload, binding); - } else { - return callback.call(binding); - } - } + _class.create = function create(options) { + if (options) { + return _OutletView.create.call(this, _emberUtils.assign({}, injections, options)); + } else { + return _OutletView.create.call(this, injections); + } + }; - var flaggedInstrument = undefined; - if (false) { - exports.flaggedInstrument = flaggedInstrument = instrument; - } else { - exports.flaggedInstrument = flaggedInstrument = function (name, payload, callback) { - return callback(); + return _class; + })(OutletView); }; - } - exports.flaggedInstrument = flaggedInstrument; - function withFinalizer(callback, finalizer, payload, binding) { - var result = undefined; - try { - result = callback.call(binding); - } catch (e) { - payload.exception = e; - result = payload; - } finally { - finalizer(); - return result; - } - } + OutletView.reopenClass = function reopenClass(injections) { + _emberUtils.assign(this, injections); + }; - function NOOP() {} + OutletView.create = function create(options) { + var _environment = options._environment; + var renderer = options.renderer; + var template = options.template; - // private for now + var owner = options[_emberUtils.OWNER]; + return new OutletView(_environment, renderer, owner, template); + }; - function _instrumentStart(name, _payload, _payloadParam) { - if (subscribers.length === 0) { - return NOOP; + function OutletView(_environment, renderer, owner, template) { + this._environment = _environment; + this.renderer = renderer; + this.owner = owner; + this.template = template; + this.outletState = null; + this._tag = new _glimmerReference.DirtyableTag(); } - var listeners = cache[name]; + OutletView.prototype.appendTo = function appendTo(selector) { + var env = this._environment || _emberEnvironment.environment; + var target = undefined; - if (!listeners) { - listeners = populateListeners(name); - } + if (env.hasDOM) { + target = typeof selector === 'string' ? document.querySelector(selector) : selector; + } else { + target = selector; + } - if (listeners.length === 0) { - return NOOP; - } + _emberMetal.run.schedule('render', this.renderer, 'appendOutletView', this, target); + }; - var payload = _payload(_payloadParam); + OutletView.prototype.rerender = function rerender() {}; - var STRUCTURED_PROFILE = _emberEnvironment.ENV.STRUCTURED_PROFILE; - var timeName = undefined; - if (STRUCTURED_PROFILE) { - timeName = name + ': ' + payload.object; - console.time(timeName); - } + OutletView.prototype.setOutletState = function setOutletState(state) { + this.outletState = { + outlets: { + main: state + }, + render: { + owner: undefined, + into: undefined, + outlet: 'main', + name: '-top-level', + controller: undefined, + ViewClass: undefined, + template: undefined + } + }; + this._tag.dirty(); + }; - var beforeValues = new Array(listeners.length); - var i = undefined, - listener = undefined; - var timestamp = time(); - for (i = 0; i < listeners.length; i++) { - listener = listeners[i]; - beforeValues[i] = listener.before(name, timestamp, payload); + OutletView.prototype.toReference = function toReference() { + return new OutletStateReference(this); + }; + + OutletView.prototype.destroy = function destroy() {}; + + return OutletView; + })(); + + exports.default = OutletView; +}); +enifed('ember-metal/alias', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/error', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/meta', 'ember-metal/dependent_keys'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalError, _emberMetalProperties, _emberMetalComputed, _emberMetalMeta, _emberMetalDependent_keys) { + 'use strict'; + + exports.default = alias; + + var CONSUMED = {}; + + function alias(altKey) { + return new AliasedProperty(altKey); + } + + var AliasedProperty = (function (_Descriptor) { + babelHelpers.inherits(AliasedProperty, _Descriptor); + + function AliasedProperty(altKey) { + _Descriptor.call(this); + this.isDescriptor = true; + this.altKey = altKey; + this._dependentKeys = [altKey]; } - return function _instrumentEnd() { - var i = undefined, - listener = undefined; - var timestamp = time(); - for (i = 0; i < listeners.length; i++) { - listener = listeners[i]; - if (typeof listener.after === 'function') { - listener.after(name, timestamp, payload, beforeValues[i]); - } + AliasedProperty.prototype.setup = function setup(obj, keyName) { + var meta = _emberMetalMeta.meta(obj); + if (meta.peekWatching(keyName)) { + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); } + }; - if (STRUCTURED_PROFILE) { - console.timeEnd(timeName); + AliasedProperty.prototype.teardown = function teardown(obj, keyName) { + var meta = _emberMetalMeta.meta(obj); + if (meta.peekWatching(keyName)) { + _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); } }; - } - /** - Subscribes to a particular event or instrumented block of code. - - @method subscribe - @namespace Ember.Instrumentation - - @param {String} [pattern] Namespaced event name. - @param {Object} [object] Before and After hooks. - - @return {Subscriber} - @private - */ + AliasedProperty.prototype.willWatch = function willWatch(obj, keyName) { + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); + }; - function subscribe(pattern, object) { - var paths = pattern.split('.'); - var path = undefined; - var regex = []; + AliasedProperty.prototype.didUnwatch = function didUnwatch(obj, keyName) { + _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); + }; - for (var i = 0; i < paths.length; i++) { - path = paths[i]; - if (path === '*') { - regex.push('[^\\.]*'); - } else { - regex.push(path); + AliasedProperty.prototype.get = function get(obj, keyName) { + var ret = _emberMetalProperty_get.get(obj, this.altKey); + var meta = _emberMetalMeta.meta(obj); + var cache = meta.writableCache(); + if (cache[keyName] !== CONSUMED) { + cache[keyName] = CONSUMED; + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); } - } - - regex = regex.join('\\.'); - regex = regex + '(\\..*)?'; - - var subscriber = { - pattern: pattern, - regex: new RegExp('^' + regex + '$'), - object: object + return ret; }; - subscribers.push(subscriber); - cache = {}; + AliasedProperty.prototype.set = function set(obj, keyName, value) { + return _emberMetalProperty_set.set(obj, this.altKey, value); + }; - return subscriber; - } + AliasedProperty.prototype.readOnly = function readOnly() { + this.set = AliasedProperty_readOnlySet; + return this; + }; - /** - Unsubscribes from a particular event or instrumented block of code. - - @method unsubscribe - @namespace Ember.Instrumentation - - @param {Object} [subscriber] - @private - */ + AliasedProperty.prototype.oneWay = function oneWay() { + this.set = AliasedProperty_oneWaySet; + return this; + }; - function unsubscribe(subscriber) { - var index = undefined; + return AliasedProperty; + })(_emberMetalProperties.Descriptor); - for (var i = 0; i < subscribers.length; i++) { - if (subscribers[i] === subscriber) { - index = i; - } - } + exports.AliasedProperty = AliasedProperty; - subscribers.splice(index, 1); - cache = {}; + function AliasedProperty_readOnlySet(obj, keyName, value) { + throw new _emberMetalError.default('Cannot set read-only property \'' + keyName + '\' on object: ' + _emberUtils.inspect(obj)); } - /** - Resets `Ember.Instrumentation` by flushing list of subscribers. - - @method reset - @namespace Ember.Instrumentation - @private - */ - - function reset() { - subscribers.length = 0; - cache = {}; + function AliasedProperty_oneWaySet(obj, keyName, value) { + _emberMetalProperties.defineProperty(obj, keyName, null); + return _emberMetalProperty_set.set(obj, keyName, value); } + + // Backwards compatibility with Ember Data. + AliasedProperty.prototype._meta = undefined; + AliasedProperty.prototype.meta = _emberMetalComputed.ComputedProperty.prototype.meta; }); -enifed('ember-metal/is_blank', ['exports', 'ember-metal/is_empty'], function (exports, _emberMetalIs_empty) { +enifed('ember-metal/binding', ['exports', 'ember-utils', 'ember-console', 'ember-environment', 'ember-metal/run_loop', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/events', 'ember-metal/observer', 'ember-metal/path_cache'], function (exports, _emberUtils, _emberConsole, _emberEnvironment, _emberMetalRun_loop, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalEvents, _emberMetalObserver, _emberMetalPath_cache) { 'use strict'; - exports.default = isBlank; + exports.bind = bind; /** - A value is blank if it is empty or a whitespace string. - - ```javascript - Ember.isBlank(); // true - Ember.isBlank(null); // true - Ember.isBlank(undefined); // true - Ember.isBlank(''); // true - Ember.isBlank([]); // true - Ember.isBlank('\n\t'); // true - Ember.isBlank(' '); // true - Ember.isBlank({}); // false - Ember.isBlank('\n\t Hello'); // false - Ember.isBlank('Hello world'); // false - Ember.isBlank([1,2,3]); // false - ``` - - @method isBlank - @for Ember - @param {Object} obj Value to test - @return {Boolean} - @since 1.5.0 - @public + @module ember + @submodule ember-metal */ - 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'; + // .......................................................... + // BINDING + // - exports.default = isEmpty; + var Binding = (function () { + function Binding(toPath, fromPath) { + // Configuration + this._from = fromPath; + this._to = toPath; + this._oneWay = undefined; - /** - Verifies that a value is `null` or an empty string, empty array, - or empty function. - - Constrains the rules on `Ember.isNone` by returning true for empty - string and empty arrays. - - ```javascript - Ember.isEmpty(); // true - Ember.isEmpty(null); // true - Ember.isEmpty(undefined); // true - Ember.isEmpty(''); // true - Ember.isEmpty([]); // true - Ember.isEmpty({}); // false - Ember.isEmpty('Adam Hawkins'); // false - Ember.isEmpty([0,1,2]); // false - Ember.isEmpty('\n\t'); // false - Ember.isEmpty(' '); // false - ``` - - @method isEmpty - @for Ember - @param {Object} obj Value to test - @return {Boolean} - @public - */ - - function isEmpty(obj) { - var none = _emberMetalIs_none.default(obj); - if (none) { - return none; - } - - if (typeof obj.size === 'number') { - return !obj.size; + // State + this._direction = undefined; + this._readyToSync = undefined; + this._fromObj = undefined; + this._fromPath = undefined; + this._toObj = undefined; } - var objectType = typeof obj; - - if (objectType === 'object') { - var size = _emberMetalProperty_get.get(obj, 'size'); - if (typeof size === 'number') { - return !size; - } - } + /** + @class Binding + @namespace Ember + @deprecated See http://emberjs.com/deprecations/v2.x#toc_ember-binding + @public + */ - if (typeof obj.length === 'number' && objectType !== 'function') { - return !obj.length; - } + /** + This copies the Binding so it can be connected to another object. + @method copy + @return {Ember.Binding} `this` + @public + */ - if (objectType === 'object') { - var _length = _emberMetalProperty_get.get(obj, 'length'); - if (typeof _length === 'number') { - return !_length; + Binding.prototype.copy = function copy() { + var copy = new Binding(this._to, this._from); + if (this._oneWay) { + copy._oneWay = true; } - } + return copy; + }; - return false; - } -}); -enifed("ember-metal/is_none", ["exports"], function (exports) { - /** - Returns true if the passed value is null or undefined. This avoids errors - from JSLint complaining about use of ==, which can be technically - confusing. - - ```javascript - Ember.isNone(); // true - Ember.isNone(null); // true - Ember.isNone(undefined); // true - Ember.isNone(''); // false - Ember.isNone([]); // false - Ember.isNone(function() {}); // false - ``` - - @method isNone - @for Ember - @param {Object} obj Value to test - @return {Boolean} - @public - */ - "use strict"; + // .......................................................... + // CONFIG + // - exports.default = isNone; + /** + This will set `from` property path to the specified value. It will not + attempt to resolve this property path to an actual object until you + connect the binding. + The binding will search for the property path starting at the root object + you pass when you `connect()` the binding. It follows the same rules as + `get()` - see that method for more information. + @method from + @param {String} path The property path to connect to. + @return {Ember.Binding} `this` + @public + */ - function isNone(obj) { - return obj === null || obj === undefined; - } -}); -enifed('ember-metal/is_present', ['exports', 'ember-metal/is_blank'], function (exports, _emberMetalIs_blank) { - 'use strict'; + Binding.prototype.from = function from(path) { + this._from = path; + return this; + }; - exports.default = isPresent; + /** + This will set the `to` property path to the specified value. It will not + attempt to resolve this property path to an actual object until you + connect the binding. + The binding will search for the property path starting at the root object + you pass when you `connect()` the binding. It follows the same rules as + `get()` - see that method for more information. + @method to + @param {String|Tuple} path A property path or tuple. + @return {Ember.Binding} `this` + @public + */ - /** - A value is present if it not `isBlank`. - - ```javascript - Ember.isPresent(); // false - Ember.isPresent(null); // false - Ember.isPresent(undefined); // false - Ember.isPresent(''); // false - Ember.isPresent(' '); // false - Ember.isPresent('\n\t'); // false - Ember.isPresent([]); // false - Ember.isPresent({ length: 0 }) // false - Ember.isPresent(false); // true - Ember.isPresent(true); // true - Ember.isPresent('string'); // true - Ember.isPresent(0); // true - Ember.isPresent(function() {}) // true - Ember.isPresent({}); // true - Ember.isPresent(false); // true - Ember.isPresent('\n\t Hello'); // true - Ember.isPresent([1,2,3]); // true - ``` - - @method isPresent - @for Ember - @param {Object} obj Value to test - @return {Boolean} - @since 1.8.0 - @public - */ + Binding.prototype.to = function to(path) { + this._to = path; + return this; + }; - function isPresent(obj) { - return !_emberMetalIs_blank.default(obj); - } -}); -enifed('ember-metal/is_proxy', ['exports', 'ember-metal/meta'], function (exports, _emberMetalMeta) { - 'use strict'; + /** + Configures the binding as one way. A one-way binding will relay changes + on the `from` side to the `to` side, but not the other way around. This + means that if you change the `to` side directly, the `from` side may have + a different value. + @method oneWay + @return {Ember.Binding} `this` + @public + */ - exports.isProxy = isProxy; + Binding.prototype.oneWay = function oneWay() { + this._oneWay = true; + return this; + }; - function isProxy(value) { - if (typeof value === 'object' && value) { - var meta = _emberMetalMeta.peekMeta(value); - return meta && meta.isProxy(); - } + /** + @method toString + @return {String} string representation of binding + @public + */ - return false; - } -}); -enifed('ember-metal/libraries', ['exports', 'ember-metal/debug', 'ember-metal/features'], function (exports, _emberMetalDebug, _emberMetalFeatures) { - 'use strict'; + Binding.prototype.toString = function toString() { + var oneWay = this._oneWay ? '[oneWay]' : ''; + return 'Ember.Binding<' + _emberUtils.guidFor(this) + '>(' + this._from + ' -> ' + this._to + ')' + oneWay; + }; - exports.Libraries = Libraries; + // .......................................................... + // CONNECT AND SYNC + // - /** - Helper class that allows you to register your library with Ember. - - Singleton created at `Ember.libraries`. - - @class Libraries - @constructor - @private - */ + /** + Attempts to connect this binding instance so that it can receive and relay + changes. This method will raise an exception if you have not set the + from/to properties yet. + @method connect + @param {Object} obj The root object for this binding. + @return {Ember.Binding} `this` + @public + */ - function Libraries() { - this._registry = []; - this._coreLibIndex = 0; - } + Binding.prototype.connect = function connect(obj) { - Libraries.prototype = { - constructor: Libraries, + var fromObj = undefined, + fromPath = undefined, + possibleGlobal = undefined; - _getLibraryByName: function (name) { - var libs = this._registry; - var count = libs.length; + // If the binding's "from" path could be interpreted as a global, verify + // whether the path refers to a global or not by consulting `Ember.lookup`. + if (_emberMetalPath_cache.isGlobalPath(this._from)) { + var _name = _emberMetalPath_cache.getFirstKey(this._from); + possibleGlobal = _emberEnvironment.context.lookup[_name]; - for (var i = 0; i < count; i++) { - if (libs[i].name === name) { - return libs[i]; + if (possibleGlobal) { + fromObj = possibleGlobal; + fromPath = _emberMetalPath_cache.getTailPath(this._from); } } - }, - - register: function (name, version, isCoreLibrary) { - var index = this._registry.length; - if (!this._getLibraryByName(name)) { - if (isCoreLibrary) { - index = this._coreLibIndex++; - } - this._registry.splice(index, 0, { name: name, version: version }); - } else {} - }, + if (fromObj === undefined) { + fromObj = obj; + fromPath = this._from; + } - registerCoreLibrary: function (name, version) { - this.register(name, version, true); - }, + _emberMetalProperty_set.trySet(obj, this._to, _emberMetalProperty_get.get(fromObj, fromPath)); - deRegister: function (name) { - var lib = this._getLibraryByName(name); - var index = undefined; + // Add an observer on the object to be notified when the binding should be updated. + _emberMetalObserver.addObserver(fromObj, fromPath, this, 'fromDidChange'); - if (lib) { - index = this._registry.indexOf(lib); - this._registry.splice(index, 1); + // If the binding is a two-way binding, also set up an observer on the target. + if (!this._oneWay) { + _emberMetalObserver.addObserver(obj, this._to, this, 'toDidChange'); } - } - }; - if (false) { - Libraries.prototype.isRegistered = function (name) { - return !!this._getLibraryByName(name); - }; - } + _emberMetalEvents.addListener(obj, 'willDestroy', this, 'disconnect'); - exports.default = new Libraries(); -}); -enifed('ember-metal/map', ['exports', 'ember-utils'], function (exports, _emberUtils) { - /** - @module ember - @submodule ember-metal - */ + fireDeprecations(obj, this._to, this._from, possibleGlobal, this._oneWay, !possibleGlobal && !this._oneWay); - /* - 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'; + this._readyToSync = true; + this._fromObj = fromObj; + this._fromPath = fromPath; + this._toObj = obj; - function missingFunction(fn) { - throw new TypeError(Object.prototype.toString.call(fn) + ' is not a function'); - } + return this; + }; - function missingNew(name) { - throw new TypeError('Constructor ' + name + ' requires \'new\''); - } + /** + Disconnects the binding instance. Changes will no longer be relayed. You + will not usually need to call this method. + @method disconnect + @return {Ember.Binding} `this` + @public + */ - function copyNull(obj) { - var output = new _emberUtils.EmptyObject(); + Binding.prototype.disconnect = function disconnect() { - for (var prop in obj) { - // hasOwnPropery is not needed because obj is new EmptyObject(); - output[prop] = obj[prop]; - } + // Remove an observer on the object so we're no longer notified of + // changes that should update bindings. + _emberMetalObserver.removeObserver(this._fromObj, this._fromPath, this, 'fromDidChange'); - return output; - } + // If the binding is two-way, remove the observer from the target as well. + if (!this._oneWay) { + _emberMetalObserver.removeObserver(this._toObj, this._to, this, 'toDidChange'); + } - function copyMap(original, newObject) { - var keys = original._keys.copy(); - var values = copyNull(original._values); + this._readyToSync = false; // Disable scheduled syncs... + return this; + }; - newObject._keys = keys; - newObject._values = values; - newObject.size = original.size; + // .......................................................... + // PRIVATE + // - return newObject; - } + /* Called when the from side changes. */ - /** - This class is used internally by Ember and Ember Data. - Please do not use it at this time. We plan to clean it up - and add many tests soon. - - @class OrderedSet - @namespace Ember - @constructor - @private - */ - function OrderedSet() { - if (this instanceof OrderedSet) { - this.clear(); - this._silenceRemoveDeprecation = false; - } else { - missingNew('OrderedSet'); - } - } + Binding.prototype.fromDidChange = function fromDidChange(target) { + this._scheduleSync('fwd'); + }; - /** - @method create - @static - @return {Ember.OrderedSet} - @private - */ - OrderedSet.create = function () { - var Constructor = this; + /* Called when the to side changes. */ - return new Constructor(); - }; + Binding.prototype.toDidChange = function toDidChange(target) { + this._scheduleSync('back'); + }; - OrderedSet.prototype = { - constructor: OrderedSet, - /** - @method clear - @private - */ - clear: function () { - this.presenceSet = new _emberUtils.EmptyObject(); - this.list = []; - this.size = 0; - }, + Binding.prototype._scheduleSync = function _scheduleSync(dir) { + var existingDir = this._direction; - /** - @method add - @param obj - @param guid (optional, and for internal use) - @return {Ember.OrderedSet} - @private - */ - add: function (obj, _guid) { - var guid = _guid || _emberUtils.guidFor(obj); - var presenceSet = this.presenceSet; - var list = this.list; + // If we haven't scheduled the binding yet, schedule it. + if (existingDir === undefined) { + _emberMetalRun_loop.default.schedule('sync', this, '_sync'); + this._direction = dir; + } - if (presenceSet[guid] !== true) { - presenceSet[guid] = true; - this.size = list.push(obj); + // If both a 'back' and 'fwd' sync have been scheduled on the same object, + // default to a 'fwd' sync so that it remains deterministic. + if (existingDir === 'back' && dir === 'fwd') { + this._direction = 'fwd'; } + }; - return this; - }, + Binding.prototype._sync = function _sync() { + var _this = this; - /** - @since 1.8.0 - @method delete - @param obj - @param _guid (optional and for internal use only) - @return {Boolean} - @private - */ - delete: function (obj, _guid) { - var guid = _guid || _emberUtils.guidFor(obj); - var presenceSet = this.presenceSet; - var list = this.list; + var log = _emberEnvironment.ENV.LOG_BINDINGS; - if (presenceSet[guid] === true) { - delete presenceSet[guid]; - var index = list.indexOf(obj); - if (index > -1) { - list.splice(index, 1); - } - this.size = list.length; - return true; - } else { - return false; + var toObj = this._toObj; + + // Don't synchronize destroyed objects or disconnected bindings. + if (toObj.isDestroyed || !this._readyToSync) { + return; } - }, - /** - @method isEmpty - @return {Boolean} - @private - */ - isEmpty: function () { - return this.size === 0; - }, + // Get the direction of the binding for the object we are + // synchronizing from. + var direction = this._direction; - /** - @method has - @param obj - @return {Boolean} - @private - */ - has: function (obj) { - if (this.size === 0) { - return false; - } + var fromObj = this._fromObj; + var fromPath = this._fromPath; - var guid = _emberUtils.guidFor(obj); - var presenceSet = this.presenceSet; + this._direction = undefined; - return presenceSet[guid] === true; - }, + // If we're synchronizing from the remote object... + if (direction === 'fwd') { + (function () { + var fromValue = _emberMetalProperty_get.get(fromObj, fromPath); + if (log) { + _emberConsole.default.log(' ', _this.toString(), '->', fromValue, fromObj); + } + if (_this._oneWay) { + _emberMetalProperty_set.trySet(toObj, _this._to, fromValue); + } else { + _emberMetalObserver._suspendObserver(toObj, _this._to, _this, 'toDidChange', function () { + _emberMetalProperty_set.trySet(toObj, this._to, fromValue); + }); + } + // If we're synchronizing *to* the remote object. + })(); + } else if (direction === 'back') { + (function () { + var toValue = _emberMetalProperty_get.get(toObj, _this._to); + if (log) { + _emberConsole.default.log(' ', _this.toString(), '<-', toValue, toObj); + } + _emberMetalObserver._suspendObserver(fromObj, fromPath, _this, 'fromDidChange', function () { + _emberMetalProperty_set.trySet(fromObj, fromPath, toValue); + }); + })(); + } + }; - /** - @method forEach - @param {Function} fn - @param self - @private - */ - forEach: function (fn /*, ...thisArg*/) { - if (typeof fn !== 'function') { - missingFunction(fn); - } + return Binding; + })(); - if (this.size === 0) { - return; - } + function fireDeprecations(obj, toPath, fromPath, deprecateGlobal, deprecateOneWay, deprecateAlias) { + var deprecateGlobalMessage = '`Ember.Binding` is deprecated. Since you' + ' are binding to a global consider using a service instead.'; + var deprecateOneWayMessage = '`Ember.Binding` is deprecated. Since you' + ' are using a `oneWay` binding consider using a `readOnly` computed' + ' property instead.'; + var deprecateAliasMessage = '`Ember.Binding` is deprecated. Consider' + ' using an `alias` computed property instead.'; - var list = this.list; + var objectInfo = 'The `' + toPath + '` property of `' + obj + '` is an `Ember.Binding` connected to `' + fromPath + '`, but '; + } - if (arguments.length === 2) { - for (var i = 0; i < list.length; i++) { - fn.call(arguments[1], list[i]); - } - } else { - for (var i = 0; i < list.length; i++) { - fn(list[i]); - } + function mixinProperties(to, from) { + for (var key in from) { + if (from.hasOwnProperty(key)) { + to[key] = from[key]; } - }, + } + } - /** - @method toArray - @return {Array} - @private + mixinProperties(Binding, { + + /* + See `Ember.Binding.from`. + @method from + @static */ - toArray: function () { - return this.list.slice(); + from: function (from) { + var C = this; + return new C(undefined, from); }, - /** - @method copy - @return {Ember.OrderedSet} - @private + /* + See `Ember.Binding.to`. + @method to + @static */ - copy: function () { - var Constructor = this.constructor; - var set = new Constructor(); - - set._silenceRemoveDeprecation = this._silenceRemoveDeprecation; - set.presenceSet = copyNull(this.presenceSet); - set.list = this.toArray(); - set.size = this.size; - - return set; + to: function (to) { + var C = this; + return new C(to, undefined); } - }; - + }); /** - A Map stores values indexed by keys. Unlike JavaScript's - default Objects, the keys of a Map can be any JavaScript - object. + An `Ember.Binding` connects the properties of two objects so that whenever + the value of one property changes, the other property will be changed also. - Internally, a Map has two data structures: + ## Automatic Creation of Bindings with `/^*Binding/`-named Properties. - 1. `keys`: an OrderedSet of all of the existing keys - 2. `values`: a JavaScript Object indexed by the `Ember.guidFor(key)` + You do not usually create Binding objects directly but instead describe + bindings in your class or object definition using automatic binding + detection. - When a key/value pair is added for the first time, we - add the key to the `keys` OrderedSet, and create or - replace an entry in `values`. When an entry is deleted, - we delete its entry in `keys` and `values`. + Properties ending in a `Binding` suffix will be converted to `Ember.Binding` + instances. The value of this property should be a string representing a path + to another object or a custom binding instance created using Binding helpers + (see "One Way Bindings"): - @class Map + ``` + valueBinding: "MyApp.someController.title" + ``` + + This will create a binding from `MyApp.someController.title` to the `value` + property of your object instance automatically. Now the two values will be + kept in sync. + + ## One Way Bindings + + One especially useful binding customization you can use is the `oneWay()` + helper. This helper tells Ember that you are only interested in + receiving changes on the object you are binding from. For example, if you + are binding to a preference and you want to be notified if the preference + has changed, but your object will not be changing the preference itself, you + could do: + + ``` + bigTitlesBinding: Ember.Binding.oneWay("MyApp.preferencesController.bigTitles") + ``` + + This way if the value of `MyApp.preferencesController.bigTitles` changes the + `bigTitles` property of your object will change also. However, if you + change the value of your `bigTitles` property, it will not update the + `preferencesController`. + + One way bindings are almost twice as fast to setup and twice as fast to + execute because the binding only has to worry about changes to one side. + + You should consider using one way bindings anytime you have an object that + may be created frequently and you do not intend to change a property; only + to monitor it for changes (such as in the example above). + + ## Adding Bindings Manually + + All of the examples above show you how to configure a custom binding, but the + result of these customizations will be a binding template, not a fully active + Binding instance. The binding will actually become active only when you + instantiate the object the binding belongs to. It is useful, however, to + understand what actually happens when the binding is activated. + + For a binding to function it must have at least a `from` property and a `to` + property. The `from` property path points to the object/key that you want to + bind from while the `to` path points to the object/key you want to bind to. + + When you define a custom binding, you are usually describing the property + you want to bind from (such as `MyApp.someController.value` in the examples + above). When your object is created, it will automatically assign the value + you want to bind `to` based on the name of your binding key. In the + examples above, during init, Ember objects will effectively call + something like this on your binding: + + ```javascript + binding = Ember.Binding.from("valueBinding").to("value"); + ``` + + This creates a new binding instance based on the template you provide, and + sets the to path to the `value` property of the new object. Now that the + binding is fully configured with a `from` and a `to`, it simply needs to be + connected to become active. This is done through the `connect()` method: + + ```javascript + binding.connect(this); + ``` + + Note that when you connect a binding you pass the object you want it to be + connected to. This object will be used as the root for both the from and + to side of the binding when inspecting relative paths. This allows the + binding to be automatically inherited by subclassed objects as well. + + This also allows you to bind between objects using the paths you declare in + `from` and `to`: + + ```javascript + // Example 1 + binding = Ember.Binding.from("App.someObject.value").to("value"); + binding.connect(this); + + // Example 2 + binding = Ember.Binding.from("parentView.value").to("App.someObject.value"); + binding.connect(this); + ``` + + Now that the binding is connected, it will observe both the from and to side + and relay changes. + + If you ever needed to do so (you almost never will, but it is useful to + understand this anyway), you could manually create an active binding by + using the `Ember.bind()` helper method. (This is the same method used by + to setup your bindings on objects): + + ```javascript + Ember.bind(MyApp.anotherObject, "value", "MyApp.someController.value"); + ``` + + Both of these code fragments have the same effect as doing the most friendly + form of binding creation like so: + + ```javascript + MyApp.anotherObject = Ember.Object.create({ + valueBinding: "MyApp.someController.value", + + // OTHER CODE FOR THIS OBJECT... + }); + ``` + + Ember's built in binding creation method makes it easy to automatically + create bindings for you. You should always use the highest-level APIs + available, even if you understand how it works underneath. + + @class Binding @namespace Ember - @private - @constructor + @since Ember 0.9 + @public */ - function Map() { - if (this instanceof Map) { - this._keys = OrderedSet.create(); - this._keys._silenceRemoveDeprecation = true; - this._values = new _emberUtils.EmptyObject(); - this.size = 0; - } else { - missingNew('Map'); - } - } + // Ember.Binding = Binding; ES6TODO: where to put this? /** - @method create - @static - @private + Global helper method to create a new binding. Just pass the root object + along with a `to` and `from` path to create and connect the binding. + + @method bind + @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 */ - Map.create = function () { - var Constructor = this; - return new Constructor(); - }; - Map.prototype = { - constructor: Map, + function bind(obj, to, from) { + return new Binding(to, from).connect(obj); + } - /** - This property will change as the number of objects in the map changes. - @since 1.8.0 - @property size - @type number - @default 0 - @private - */ - size: 0, + exports.Binding = Binding; +}); +enifed('ember-metal/cache', ['exports', 'ember-utils', 'ember-metal/meta'], function (exports, _emberUtils, _emberMetalMeta) { + 'use strict'; - /** - Retrieve the value associated with a given key. - @method get - @param {*} key - @return {*} the value associated with the key, or `undefined` - @private - */ - get: function (key) { - if (this.size === 0) { - return; + var Cache = (function () { + function Cache(limit, func, key, store) { + this.size = 0; + this.misses = 0; + this.hits = 0; + this.limit = limit; + this.func = func; + this.key = key; + this.store = store || new DefaultStore(); + } + + Cache.prototype.get = function get(obj) { + var key = this.key === undefined ? obj : this.key(obj); + var value = this.store.get(key); + if (value === undefined) { + this.misses++; + value = this._set(key, this.func(obj)); + } else if (value === _emberMetalMeta.UNDEFINED) { + this.hits++; + value = undefined; + } else { + this.hits++; + // nothing to translate } - var values = this._values; - var guid = _emberUtils.guidFor(key); + return value; + }; - return values[guid]; - }, + Cache.prototype.set = function set(obj, value) { + var key = this.key === undefined ? obj : this.key(obj); + return this._set(key, value); + }; - /** - Adds a value to the map. If a value for the given key has already been - provided, the new value will replace the old value. - @method set - @param {*} key - @param {*} value - @return {Ember.Map} - @private - */ - set: function (key, value) { - var keys = this._keys; - var values = this._values; - var guid = _emberUtils.guidFor(key); + Cache.prototype._set = function _set(key, value) { + if (this.limit > this.size) { + this.size++; + if (value === undefined) { + this.store.set(key, _emberMetalMeta.UNDEFINED); + } else { + this.store.set(key, value); + } + } - // ensure we don't store -0 - var k = key === -0 ? 0 : key; + return value; + }; - keys.add(k, guid); + Cache.prototype.purge = function purge() { + this.store.clear(); + this.size = 0; + this.hits = 0; + this.misses = 0; + }; - values[guid] = value; + return Cache; + })(); - this.size = keys.size; + exports.default = Cache; - return this; - }, + var DefaultStore = (function () { + function DefaultStore() { + this.data = new _emberUtils.EmptyObject(); + } - /** - Removes a value from the map for an associated key. - @since 1.8.0 - @method delete - @param {*} key - @return {Boolean} true if an item was removed, false otherwise - @private - */ - delete: function (key) { - if (this.size === 0) { - return false; - } - // don't use ES6 "delete" because it will be annoying - // to use in browsers that are not ES6 friendly; - var keys = this._keys; - var values = this._values; - var guid = _emberUtils.guidFor(key); + DefaultStore.prototype.get = function get(key) { + return this.data[key]; + }; - if (keys.delete(key, guid)) { - delete values[guid]; - this.size = keys.size; - return true; + DefaultStore.prototype.set = function set(key, value) { + this.data[key] = value; + }; + + DefaultStore.prototype.clear = function clear() { + this.data = new _emberUtils.EmptyObject(); + }; + + return DefaultStore; + })(); +}); +enifed('ember-metal/chains', ['exports', 'ember-utils', 'ember-metal/property_get', 'ember-metal/meta', 'ember-metal/watch_key', 'ember-metal/computed', 'ember-metal/watch_path'], function (exports, _emberUtils, _emberMetalProperty_get, _emberMetalMeta, _emberMetalWatch_key, _emberMetalComputed, _emberMetalWatch_path) { + 'use strict'; + + exports.finishChains = finishChains; + + var FIRST_KEY = /^([^\.]+)/; + + function firstKey(path) { + return path.match(FIRST_KEY)[0]; + } + + function isObject(obj) { + return typeof obj === 'object' && obj; + } + + function isVolatile(obj) { + return !(isObject(obj) && obj.isDescriptor && obj._volatile === false); + } + + var ChainWatchers = (function () { + function ChainWatchers() { + // chain nodes that reference a key in this obj by key + // we only create ChainWatchers when we are going to add them + // so create this upfront + this.chains = new _emberUtils.EmptyObject(); + } + + ChainWatchers.prototype.add = function add(key, node) { + var nodes = this.chains[key]; + if (nodes === undefined) { + this.chains[key] = [node]; } else { - return false; + nodes.push(node); } - }, + }; - /** - Check whether a key is present. - @method has - @param {*} key - @return {Boolean} true if the item was present, false otherwise - @private - */ - has: function (key) { - return this._keys.has(key); - }, + ChainWatchers.prototype.remove = function remove(key, node) { + var nodes = this.chains[key]; + if (nodes) { + for (var i = 0; i < nodes.length; i++) { + if (nodes[i] === node) { + nodes.splice(i, 1); + break; + } + } + } + }; - /** - Iterate over all the keys and values. Calls the function once - for each key, passing in value, key, and the map being iterated over, - in that order. - The keys are guaranteed to be iterated over in insertion order. - @method forEach - @param {Function} callback - @param {*} self if passed, the `this` value inside the - callback. By default, `this` is the map. - @private - */ - forEach: function (callback /*, ...thisArg*/) { - if (typeof callback !== 'function') { - missingFunction(callback); + ChainWatchers.prototype.has = function has(key, node) { + var nodes = this.chains[key]; + if (nodes) { + for (var i = 0; i < nodes.length; i++) { + if (nodes[i] === node) { + return true; + } + } + } + return false; + }; + + ChainWatchers.prototype.revalidateAll = function revalidateAll() { + for (var key in this.chains) { + this.notify(key, true, undefined); } + }; - if (this.size === 0) { + ChainWatchers.prototype.revalidate = function revalidate(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 object and path that + // will be/are invalidated by this key change, depending on + // whether the revalidate flag is passed + + ChainWatchers.prototype.notify = function notify(key, revalidate, callback) { + var nodes = this.chains[key]; + if (nodes === undefined || nodes.length === 0) { return; } - var map = this; - var cb = undefined, - thisArg = undefined; + var affected = undefined; - if (arguments.length === 2) { - thisArg = arguments[1]; - cb = function (key) { - return callback.call(thisArg, map.get(key), key, map); - }; - } else { - cb = function (key) { - return callback(map.get(key), key, map); - }; + if (callback) { + affected = []; } - this._keys.forEach(cb); - }, + for (var i = 0; i < nodes.length; i++) { + nodes[i].notify(revalidate, affected); + } - /** - @method clear - @private - */ - clear: function () { - this._keys.clear(); - this._values = new _emberUtils.EmptyObject(); - this.size = 0; - }, + if (callback === undefined) { + return; + } - /** - @method copy - @return {Ember.Map} - @private - */ - copy: function () { - return copyMap(this, new Map()); - } - }; + // we gather callbacks so we don't notify them during revalidation + for (var i = 0; i < affected.length; i += 2) { + var obj = affected[i]; + var path = affected[i + 1]; + callback(obj, path); + } + }; - /** - @class MapWithDefault - @namespace Ember - @extends Ember.Map - @private - @constructor - @param [options] - @param {*} [options.defaultValue] - */ - function MapWithDefault(options) { - this._super$constructor(); - this.defaultValue = options.defaultValue; + return ChainWatchers; + })(); + + function makeChainWatcher() { + return new ChainWatchers(); } - /** - @method create - @static - @param [options] - @param {*} [options.defaultValue] - @return {Ember.MapWithDefault|Ember.Map} If options are passed, returns - `Ember.MapWithDefault` otherwise returns `Ember.Map` - @private - */ - MapWithDefault.create = function (options) { - if (options) { - return new MapWithDefault(options); - } else { - return new Map(); - } - }; - - MapWithDefault.prototype = Object.create(Map.prototype); - MapWithDefault.prototype.constructor = MapWithDefault; - MapWithDefault.prototype._super$constructor = Map; - MapWithDefault.prototype._super$get = Map.prototype.get; - - /** - Retrieve the value associated with a given key. - - @method get - @param {*} key - @return {*} the value associated with the key, or the default value - @private - */ - MapWithDefault.prototype.get = function (key) { - var hasValue = this.has(key); + function addChainWatcher(obj, keyName, node) { + var m = _emberMetalMeta.meta(obj); + m.writableChainWatchers(makeChainWatcher).add(keyName, node); + _emberMetalWatch_key.watchKey(obj, keyName, m); + } - if (hasValue) { - return this._super$get(key); - } else { - var defaultValue = this.defaultValue(key); - this.set(key, defaultValue); - return defaultValue; + function removeChainWatcher(obj, keyName, node, _meta) { + if (!isObject(obj)) { + return; } - }; - - /** - @method copy - @return {Ember.MapWithDefault} - @private - */ - MapWithDefault.prototype.copy = function () { - var Constructor = this.constructor; - return copyMap(this, new Constructor({ - defaultValue: this.defaultValue - })); - }; - - exports.default = Map; - exports.OrderedSet = OrderedSet; - exports.Map = Map; - exports.MapWithDefault = MapWithDefault; -}); -enifed('ember-metal/merge', ['exports'], function (exports) { - /** - Merge the contents of two objects together into the first object. - - ```javascript - Ember.merge({ first: 'Tom' }, { last: 'Dale' }); // { first: 'Tom', last: 'Dale' } - var a = { first: 'Yehuda' }; - var b = { last: 'Katz' }; - Ember.merge(a, b); // a == { first: 'Yehuda', last: 'Katz' }, b == { last: 'Katz' } - ``` - - @method merge - @for Ember - @param {Object} original The object to merge into - @param {Object} updates The object to copy properties from - @return {Object} - @public - */ - 'use strict'; - exports.default = merge; + var meta = _meta || _emberMetalMeta.peekMeta(obj); - function merge(original, updates) { - if (!updates || typeof updates !== 'object') { - return original; + if (!meta || !meta.readableChainWatchers()) { + return; } - var props = Object.keys(updates); - var prop = undefined; + // make meta writable + meta = _emberMetalMeta.meta(obj); - for (var i = 0; i < props.length; i++) { - prop = props[i]; - original[prop] = updates[prop]; - } + meta.readableChainWatchers().remove(keyName, node); - return original; + _emberMetalWatch_key.unwatchKey(obj, keyName, meta); } -}); -enifed('ember-metal/meta', ['exports', 'ember-utils', 'ember-metal/features', 'ember-metal/meta_listeners', 'ember-metal/debug', 'ember-metal/chains'], function (exports, _emberUtils, _emberMetalFeatures, _emberMetalMeta_listeners, _emberMetalDebug, _emberMetalChains) { - 'no use strict'; - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - - exports.Meta = Meta; - exports.deleteMeta = deleteMeta; - exports.meta = meta; - - var counters = { - peekCalls: 0, - peekParentCalls: 0, - peekPrototypeWalks: 0, - setCalls: 0, - deleteCalls: 0, - metaCalls: 0, - metaInstantiated: 0 - }; - - /** - @module ember-metal - */ - - /* - This declares several meta-programmed members on the Meta class. Such - meta! - - In general, the `readable` variants will give you an object (if it - already exists) that you can read but should not modify. The - `writable` variants will give you a mutable object, and they will - create it if it didn't already exist. - - The following methods will get generated metaprogrammatically, and - I'm including them here for greppability: - - writableCache, readableCache, writeWatching, - peekWatching, clearWatching, writeMixins, - peekMixins, clearMixins, writeBindings, - peekBindings, clearBindings, writeValues, - peekValues, clearValues, writeDeps, forEachInDeps - writableChainWatchers, readableChainWatchers, writableChains, - readableChains, writableTag, readableTag, writableTags, - readableTags - */ - var members = { - cache: ownMap, - weak: ownMap, - watching: inheritedMap, - mixins: inheritedMap, - bindings: inheritedMap, - values: inheritedMap, - chainWatchers: ownCustomObject, - chains: inheritedCustomObject, - tag: ownCustomObject, - tags: ownMap - }; - - // FLAGS - var SOURCE_DESTROYING = 1 << 1; - var SOURCE_DESTROYED = 1 << 2; - var META_DESTROYED = 1 << 3; - var IS_PROXY = 1 << 4; - if (false || true) { - members.lastRendered = ownMap; - members.lastRenderedFrom = ownMap; // FIXME: not used in production, remove me from prod builds - } + // 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 + // pass null for parent and key and object for value. - var memberNames = Object.keys(members); - var META_FIELD = '__ember_meta__'; + var ChainNode = (function () { + function ChainNode(parent, key, value) { + this._parent = parent; + this._key = key; - function Meta(obj, parentMeta) { - - this._cache = undefined; - this._weak = undefined; - this._watching = undefined; - this._mixins = undefined; - this._bindings = undefined; - this._values = undefined; - this._deps = undefined; - this._chainWatchers = undefined; - this._chains = undefined; - this._tag = undefined; - this._tags = undefined; - - // initial value for all flags right now is false - // see FLAGS const for detailed list of flags used - this._flags = 0; - - // used only internally - this.source = obj; - - // when meta(obj).proto === obj, the object is intended to be only a - // prototype and doesn't need to actually be observable itself - this.proto = undefined; - - // The next meta in our inheritance chain. We (will) track this - // explicitly instead of using prototypical inheritance because we - // have detailed knowledge of how each property should really be - // inherited, and we can optimize it much better than JS runtimes. - this.parent = parentMeta; + // _watching is true when calling get(this._parent, this._key) will + // return the value of this node. + // + // It is false for the root of a chain (because we have no parent) + // and for global paths (because the parent node is the object with + // the observer on it) + this._watching = value === undefined; - if (false || true) { - this._lastRendered = undefined; - this._lastRenderedFrom = undefined; // FIXME: not used in production, remove me from prod builds - } + this._chains = undefined; + this._object = undefined; + this.count = 0; - this._initializeListeners(); - } + this._value = value; + this._paths = {}; + if (this._watching) { + var obj = parent.value(); - Meta.prototype.isInitialized = function (obj) { - return this.proto !== obj; - }; + if (!isObject(obj)) { + return; + } - var NODE_STACK = []; + this._object = obj; - Meta.prototype.destroy = function () { - if (this.isMetaDestroyed()) { - return; + addChainWatcher(this._object, this._key, this); + } } - // remove chainWatchers to remove circular references that would prevent GC - var node = undefined, - nodes = undefined, - key = undefined, - nodeObject = undefined; - node = this.readableChains(); - if (node) { - NODE_STACK.push(node); - // process tree - while (NODE_STACK.length > 0) { - node = NODE_STACK.pop(); - // push children - nodes = node._chains; - if (nodes) { - for (key in nodes) { - if (nodes[key] !== undefined) { - NODE_STACK.push(nodes[key]); - } - } - } + ChainNode.prototype.value = function value() { + if (this._value === undefined && this._watching) { + var obj = this._parent.value(); + this._value = lazyGet(obj, this._key); + } + return this._value; + }; - // remove chainWatcher in node object - if (node._watching) { - nodeObject = node._object; - if (nodeObject) { - var foreignMeta = peekMeta(nodeObject); - // avoid cleaning up chain watchers when both current and - // foreign objects are being destroyed - // if both are being destroyed manual cleanup is not needed - // as they will be GC'ed and no non-destroyed references will - // be remaining - if (foreignMeta && !foreignMeta.isSourceDestroying()) { - _emberMetalChains.removeChainWatcher(nodeObject, node._key, node, foreignMeta); - } - } + ChainNode.prototype.destroy = function destroy() { + if (this._watching) { + var obj = this._object; + if (obj) { + removeChainWatcher(obj, this._key, this); } + this._watching = false; // so future calls do nothing } - } - - this.setMetaDestroyed(); - }; - - for (var _name in _emberMetalMeta_listeners.protoMethods) { - Meta.prototype[_name] = _emberMetalMeta_listeners.protoMethods[_name]; - } - memberNames.forEach(function (name) { - return members[name](name, Meta); - }); - - Meta.prototype.isSourceDestroying = function isSourceDestroying() { - return (this._flags & SOURCE_DESTROYING) !== 0; - }; - - Meta.prototype.setSourceDestroying = function setSourceDestroying() { - this._flags |= SOURCE_DESTROYING; - }; + }; - Meta.prototype.isSourceDestroyed = function isSourceDestroyed() { - return (this._flags & SOURCE_DESTROYED) !== 0; - }; + // copies a top level object only - Meta.prototype.setSourceDestroyed = function setSourceDestroyed() { - this._flags |= SOURCE_DESTROYED; - }; + ChainNode.prototype.copy = function copy(obj) { + var ret = new ChainNode(null, null, obj); + var paths = this._paths; + var path = undefined; - Meta.prototype.isMetaDestroyed = function isMetaDestroyed() { - return (this._flags & META_DESTROYED) !== 0; - }; + for (path in paths) { + // this check will also catch non-number vals. + if (paths[path] <= 0) { + continue; + } + ret.add(path); + } + return ret; + }; - Meta.prototype.setMetaDestroyed = function setMetaDestroyed() { - this._flags |= META_DESTROYED; - }; + // called on the root node of a chain to setup watchers on the specified + // path. - Meta.prototype.isProxy = function isProxy() { - return (this._flags & IS_PROXY) !== 0; - }; + ChainNode.prototype.add = function add(path) { + var paths = this._paths; + paths[path] = (paths[path] || 0) + 1; - Meta.prototype.setProxy = function setProxy() { - this._flags |= IS_PROXY; - }; + var key = firstKey(path); + var tail = path.slice(key.length + 1); - // Implements a member that is a lazily created, non-inheritable - // POJO. - function ownMap(name, Meta) { - var key = memberProperty(name); - var capitalized = capitalize(name); - Meta.prototype['writable' + capitalized] = function () { - return this._getOrCreateOwnMap(key); - }; - Meta.prototype['readable' + capitalized] = function () { - return this[key]; + this.chain(key, tail); }; - } - - Meta.prototype._getOrCreateOwnMap = function (key) { - var ret = this[key]; - if (!ret) { - ret = this[key] = new _emberUtils.EmptyObject(); - } - return ret; - }; - // Implements a member that is a lazily created POJO with inheritable - // values. - function inheritedMap(name, Meta) { - var key = memberProperty(name); - var capitalized = capitalize(name); + // called on the root node of a chain to teardown watcher on the specified + // path - Meta.prototype['write' + capitalized] = function (subkey, value) { + ChainNode.prototype.remove = function remove(path) { + var paths = this._paths; + if (paths[path] > 0) { + paths[path]--; + } - var map = this._getOrCreateOwnMap(key); - map[subkey] = value; - }; + var key = firstKey(path); + var tail = path.slice(key.length + 1); - Meta.prototype['peek' + capitalized] = function (subkey) { - return this._findInherited(key, subkey); + this.unchain(key, tail); }; - Meta.prototype['forEach' + capitalized] = function (fn) { - var pointer = this; - var seen = new _emberUtils.EmptyObject(); - while (pointer !== undefined) { - var map = pointer[key]; - if (map) { - for (var _key in map) { - if (!seen[_key]) { - seen[_key] = true; - fn(_key, map[_key]); - } - } - } - pointer = pointer.parent; + ChainNode.prototype.chain = function chain(key, path) { + var chains = this._chains; + var node = undefined; + if (chains === undefined) { + chains = this._chains = new _emberUtils.EmptyObject(); + } else { + node = chains[key]; } - }; - Meta.prototype['clear' + capitalized] = function () { + if (node === undefined) { + node = chains[key] = new ChainNode(this, key, undefined); + } - this[key] = undefined; - }; + node.count++; // count chains... - Meta.prototype['deleteFrom' + capitalized] = function (subkey) { - delete this._getOrCreateOwnMap(key)[subkey]; + // chain rest of path if there is one + if (path) { + key = firstKey(path); + path = path.slice(key.length + 1); + node.chain(key, path); + } }; - Meta.prototype['hasIn' + capitalized] = function (subkey) { - return this._findInherited(key, subkey) !== undefined; - }; - } + ChainNode.prototype.unchain = function unchain(key, path) { + var chains = this._chains; + var node = chains[key]; - Meta.prototype._getInherited = function (key) { - var pointer = this; - while (pointer !== undefined) { - if (pointer[key]) { - return pointer[key]; + // unchain rest of path first... + if (path && path.length > 1) { + var nextKey = firstKey(path); + var nextPath = path.slice(nextKey.length + 1); + node.unchain(nextKey, nextPath); } - pointer = pointer.parent; - } - }; - Meta.prototype._findInherited = function (key, subkey) { - var pointer = this; - while (pointer !== undefined) { - var map = pointer[key]; - if (map) { - var value = map[subkey]; - if (value !== undefined) { - return value; - } + // delete node if needed. + node.count--; + if (node.count <= 0) { + chains[node._key] = undefined; + node.destroy(); } - pointer = pointer.parent; - } - }; - - var UNDEFINED = _emberUtils.symbol('undefined'); + }; - exports.UNDEFINED = UNDEFINED; - // Implements a member that provides a lazily created map of maps, - // with inheritance at both levels. - Meta.prototype.writeDeps = function writeDeps(subkey, itemkey, value) { + ChainNode.prototype.notify = function notify(revalidate, affected) { + if (revalidate && this._watching) { + var parentValue = this._parent.value(); - var outerMap = this._getOrCreateOwnMap('_deps'); - var innerMap = outerMap[subkey]; - if (!innerMap) { - innerMap = outerMap[subkey] = new _emberUtils.EmptyObject(); - } - innerMap[itemkey] = value; - }; + if (parentValue !== this._object) { + if (this._object) { + removeChainWatcher(this._object, this._key, this); + } - Meta.prototype.peekDeps = function peekDeps(subkey, itemkey) { - var pointer = this; - while (pointer !== undefined) { - var map = pointer._deps; - if (map) { - var value = map[subkey]; - if (value) { - if (value[itemkey] !== undefined) { - return value[itemkey]; + if (isObject(parentValue)) { + this._object = parentValue; + addChainWatcher(parentValue, this._key, this); + } else { + this._object = undefined; } } + this._value = undefined; } - pointer = pointer.parent; - } - }; - - Meta.prototype.hasDeps = function hasDeps(subkey) { - var pointer = this; - while (pointer !== undefined) { - if (pointer._deps && pointer._deps[subkey]) { - return true; - } - pointer = pointer.parent; - } - return false; - }; - - Meta.prototype.forEachInDeps = function forEachInDeps(subkey, fn) { - return this._forEachIn('_deps', subkey, fn); - }; - Meta.prototype._forEachIn = function (key, subkey, fn) { - var pointer = this; - var seen = new _emberUtils.EmptyObject(); - var calls = []; - while (pointer !== undefined) { - var map = pointer[key]; - if (map) { - var innerMap = map[subkey]; - if (innerMap) { - for (var innerKey in innerMap) { - if (!seen[innerKey]) { - seen[innerKey] = true; - calls.push([innerKey, innerMap[innerKey]]); - } + // then notify chains... + var chains = this._chains; + var node = undefined; + if (chains) { + for (var key in chains) { + node = chains[key]; + if (node !== undefined) { + node.notify(revalidate, affected); } } } - pointer = pointer.parent; - } - for (var i = 0; i < calls.length; i++) { - var _calls$i = calls[i]; - var innerKey = _calls$i[0]; - var value = _calls$i[1]; - - fn(innerKey, value); - } - }; - - // Implements a member that provides a non-heritable, lazily-created - // object using the method you provide. - function ownCustomObject(name, Meta) { - var key = memberProperty(name); - var capitalized = capitalize(name); - Meta.prototype['writable' + capitalized] = function (create) { - var ret = this[key]; - if (!ret) { - ret = this[key] = create(this.source); + if (affected && this._parent) { + this._parent.populateAffected(this._key, 1, affected); } - return ret; - }; - Meta.prototype['readable' + capitalized] = function () { - return this[key]; }; - } - // Implements a member that provides an inheritable, lazily-created - // object using the method you provide. We will derived children from - // their parents by calling your object's `copy()` method. - function inheritedCustomObject(name, Meta) { - var key = memberProperty(name); - var capitalized = capitalize(name); - Meta.prototype['writable' + capitalized] = function (create) { + ChainNode.prototype.populateAffected = function populateAffected(path, depth, affected) { + if (this._key) { + path = this._key + '.' + path; + } - var ret = this[key]; - if (!ret) { - if (this.parent) { - ret = this[key] = this.parent['writable' + capitalized](create).copy(this.source); - } else { - ret = this[key] = create(this.source); + if (this._parent) { + this._parent.populateAffected(path, depth + 1, affected); + } else { + if (depth > 1) { + affected.push(this.value(), path); } } - return ret; }; - Meta.prototype['readable' + capitalized] = function () { - return this._getInherited(key); - }; - } - function memberProperty(name) { - return '_' + name; - } - - // there's a more general-purpose capitalize in ember-runtime, but we - // don't want to make ember-metal depend on ember-runtime. - function capitalize(name) { - return name.replace(/^\w/, function (m) { - return m.toUpperCase(); - }); - } - - var META_DESC = { - writable: true, - configurable: true, - enumerable: false, - value: null - }; + return ChainNode; + })(); - exports.META_DESC = META_DESC; - var EMBER_META_PROPERTY = { - name: META_FIELD, - descriptor: META_DESC - }; + function lazyGet(obj, key) { + if (!isObject(obj)) { + return; + } - if (false) { - Meta.prototype.readInheritedValue = function (key, subkey) { - var internalKey = '_' + key; + var meta = _emberMetalMeta.peekMeta(obj); - var pointer = this; + // check if object meant only to be a prototype + if (meta && meta.proto === obj) { + return; + } - while (pointer !== undefined) { - var map = pointer[internalKey]; - if (map) { - var value = map[subkey]; - if (value !== undefined || subkey in map) { - return map[subkey]; - } + // Use `get` if the return value is an EachProxy or an uncacheable value. + if (isVolatile(obj[key])) { + return _emberMetalProperty_get.get(obj, key); + // Otherwise attempt to get the cached value of the computed property + } else { + var cache = meta.readableCache(); + if (cache) { + return _emberMetalComputed.cacheFor.get(cache, key); } - pointer = pointer.parent; } + } - return UNDEFINED; - }; - - Meta.prototype.writeValue = function (obj, key, value) { - var descriptor = _emberUtils.lookupDescriptor(obj, key); - var isMandatorySetter = descriptor && descriptor.set && descriptor.set.isMandatorySetter; + function finishChains(obj) { + // We only create meta if we really have to + var m = _emberMetalMeta.peekMeta(obj); + if (m) { + m = _emberMetalMeta.meta(obj); - if (isMandatorySetter) { - this.writeValues(key, value); - } else { - obj[key] = value; + // finish any current chains node watchers that reference obj + var chainWatchers = m.readableChainWatchers(); + if (chainWatchers) { + chainWatchers.revalidateAll(); } - }; + // ensure that if we have inherited any chains they have been + // copied onto our own meta. + if (m.readableChains()) { + m.writableChains(_emberMetalWatch_path.makeChainNode); + } + } } - var HAS_NATIVE_WEAKMAP = (function () { - // detect if `WeakMap` is even present - var hasWeakMap = typeof WeakMap === 'function'; - if (!hasWeakMap) { - return false; - } + exports.removeChainWatcher = removeChainWatcher; + exports.ChainNode = ChainNode; +}); +enifed('ember-metal/computed', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/property_set', 'ember-metal/meta', 'ember-metal/expand_properties', 'ember-metal/error', 'ember-metal/properties', 'ember-metal/property_events', 'ember-metal/dependent_keys'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalProperty_set, _emberMetalMeta, _emberMetalExpand_properties, _emberMetalError, _emberMetalProperties, _emberMetalProperty_events, _emberMetalDependent_keys) { + 'use strict'; - var instance = new WeakMap(); - // use `Object`'s `.toString` directly to prevent us from detecting - // polyfills as native weakmaps - return Object.prototype.toString.call(instance) === '[object WeakMap]'; - })(); + exports.default = computed; - var setMeta = undefined, - peekMeta = undefined; + /** + @module ember + @submodule ember-metal + */ - // choose the one appropriate for given platform - if (HAS_NATIVE_WEAKMAP) { - (function () { - var getPrototypeOf = Object.getPrototypeOf; - var metaStore = new WeakMap(); + var DEEP_EACH_REGEX = /\.@each\.[^.]+\./; - exports.setMeta = setMeta = function WeakMap_setMeta(obj, meta) { - metaStore.set(obj, meta); - }; + /** + A computed property transforms an object literal with object's accessor function(s) into a property. + + By default the function backing the computed property will only be called + once and the result will be cached. You can specify various properties + that your computed property depends on. This will force the cached + result to be recomputed if the dependencies are modified. + + In the following example we declare a computed property - `fullName` - by calling + `.Ember.computed()` with property dependencies (`firstName` and `lastName`) as leading arguments and getter accessor function. The `fullName` getter function + will be called once (regardless of how many times it is accessed) as long + as its dependencies have not changed. Once `firstName` or `lastName` are updated + any future calls (or anything bound) to `fullName` will incorporate the new + values. + + ```javascript + let Person = Ember.Object.extend({ + // these will be supplied by `create` + firstName: null, + lastName: null, + + fullName: Ember.computed('firstName', 'lastName', function() { + let firstName = this.get('firstName'), + lastName = this.get('lastName'); + + return firstName + ' ' + lastName; + }) + }); + + let tom = Person.create({ + firstName: 'Tom', + lastName: 'Dale' + }); + + tom.get('fullName') // 'Tom Dale' + ``` + + You can also define what Ember should do when setting a computed property by providing additional function (`set`) in hash argument. + If you try to set a computed property, it will try to invoke setter accessor function with the key and + value you want to set it to as arguments. + + ```javascript + let Person = Ember.Object.extend({ + // these will be supplied by `create` + firstName: null, + lastName: null, + + fullName: Ember.computed('firstName', 'lastName', { + get(key) { + let firstName = this.get('firstName'), + lastName = this.get('lastName'); + + return firstName + ' ' + lastName; + }, + set(key, value) { + let [firstName, lastName] = value.split(' '); + + this.set('firstName', firstName); + this.set('lastName', lastName); + + return value; + } + }) + }); + + let person = Person.create(); + + person.set('fullName', 'Peter Wagenet'); + person.get('firstName'); // 'Peter' + person.get('lastName'); // 'Wagenet' + ``` + + You can overwrite computed property with normal property (no longer computed), that won't change if dependencies change, if you set computed property and it won't have setter accessor function defined. + + You can also mark computed property as `.readOnly()` and block all attempts to set it. + + ```javascript + let Person = Ember.Object.extend({ + // these will be supplied by `create` + firstName: null, + lastName: null, + + fullName: Ember.computed('firstName', 'lastName', { + get(key) { + let firstName = this.get('firstName'); + let lastName = this.get('lastName'); + + return firstName + ' ' + lastName; + } + }).readOnly() + }); + + let person = Person.create(); + person.set('fullName', 'Peter Wagenet'); // Uncaught Error: Cannot set read-only property "fullName" on object: <(...):emberXXX> + ``` + + Additional resources: + - [New CP syntax RFC](https://github.com/emberjs/rfcs/blob/master/text/0011-improved-cp-syntax.md) + - [New computed syntax explained in "Ember 1.12 released" ](http://emberjs.com/blog/2015/05/13/ember-1-12-released.html#toc_new-computed-syntax) + + @class ComputedProperty + @namespace Ember + @public + */ + function ComputedProperty(config, opts) { + this.isDescriptor = true; + if (typeof config === 'function') { + this._getter = config; + } else { + this._getter = config.get; + this._setter = config.set; + } - exports.peekMeta = peekMeta = function WeakMap_peekMeta(obj) { + this._dependentKeys = undefined; + this._suspended = undefined; + this._meta = undefined; + this._volatile = false; + this._dependentKeys = opts && opts.dependentKeys; + this._readOnly = false; + } - return metaStore.get(obj); - }; + ComputedProperty.prototype = new _emberMetalProperties.Descriptor(); + ComputedProperty.prototype.constructor = ComputedProperty; - exports.peekMeta = peekMeta = function WeakMap_peekParentMeta(obj) { - var pointer = obj; - var meta = undefined; - while (pointer) { - meta = metaStore.get(pointer); - // jshint loopfunc:true + var ComputedPropertyPrototype = ComputedProperty.prototype; - // stop if we find a `null` value, since - // that means the meta was deleted - // any other truthy value is a "real" meta - if (meta === null || meta) { - return meta; - } + /** + Call on a computed property to set it into non-cached mode. When in this + mode the computed property will not automatically cache the return value. + + It also does not automatically fire any change events. You must manually notify + any changes if you want to observe this property. + + Dependency keys have no effect on volatile properties as they are for cache + invalidation and notification when cached value is invalidated. + + ```javascript + let outsideService = Ember.Object.extend({ + value: Ember.computed(function() { + return OutsideService.getValue(); + }).volatile() + }).create(); + ``` + + @method volatile + @return {Ember.ComputedProperty} this + @chainable + @public + */ + ComputedPropertyPrototype.volatile = function () { + this._volatile = true; + return this; + }; - pointer = getPrototypeOf(pointer); - } - }; - })(); - } else { - exports.setMeta = setMeta = function Fallback_setMeta(obj, meta) { - // if `null` already, just set it to the new value - // otherwise define property first - if (obj[META_FIELD] !== null) { - if (obj.__defineNonEnumerable) { - obj.__defineNonEnumerable(EMBER_META_PROPERTY); - } else { - Object.defineProperty(obj, META_FIELD, META_DESC); - } - } + /** + Call on a computed property to set it into read-only mode. When in this + mode the computed property will throw an error when set. + + ```javascript + let Person = Ember.Object.extend({ + guid: Ember.computed(function() { + return 'guid-guid-guid'; + }).readOnly() + }); + + let person = Person.create(); + + person.set('guid', 'new-guid'); // will throw an exception + ``` + + @method readOnly + @return {Ember.ComputedProperty} this + @chainable + @public + */ + ComputedPropertyPrototype.readOnly = function () { + this._readOnly = true; - obj[META_FIELD] = meta; - }; + return this; + }; - exports.peekMeta = peekMeta = function Fallback_peekMeta(obj) { - return obj[META_FIELD]; - }; - } + /** + Sets the dependent keys on this computed property. Pass any number of + arguments containing key paths that this computed property depends on. + + ```javascript + let President = Ember.Object.extend({ + fullName: Ember.computed(function() { + return this.get('firstName') + ' ' + this.get('lastName'); + + // Tell Ember that this computed property depends on firstName + // and lastName + }).property('firstName', 'lastName') + }); + + let president = President.create({ + firstName: 'Barack', + lastName: 'Obama' + }); + + president.get('fullName'); // 'Barack Obama' + ``` + + @method property + @param {String} path* zero or more property paths + @return {Ember.ComputedProperty} this + @chainable + @public + */ + ComputedPropertyPrototype.property = function () { + var args = []; - function deleteMeta(obj) { + function addArg(property) { + args.push(property); + } - var meta = peekMeta(obj); - if (meta) { - meta.destroy(); + for (var i = 0; i < arguments.length; i++) { + _emberMetalExpand_properties.default(arguments[i], addArg); } - } + + this._dependentKeys = args; + return this; + }; /** - Retrieves the meta hash for an object. If `writable` is true ensures the - hash is writable for this object as well. + In some cases, you may want to annotate computed properties with additional + metadata about how they function or what values they operate on. For example, + computed property functions may close over variables that are then no longer + available for introspection. - The meta object contains information about computed property descriptors as - well as any watched properties and other information. You generally will - not access this information directly but instead work with higher level - methods that manipulate this hash indirectly. + You can pass a hash of these values to a computed property like this: - @method meta - @for Ember - @private + ``` + person: Ember.computed(function() { + let personId = this.get('personId'); + return App.Person.create({ id: personId }); + }).meta({ type: App.Person }) + ``` - @param {Object} obj The object to retrieve meta for - @param {Boolean} [writable=true] Pass `false` if you do not intend to modify - the meta hash, allowing the method to avoid making an unnecessary copy. - @return {Object} the meta hash for an object + The hash that you pass to the `meta()` function will be saved on the + computed property descriptor under the `_meta` key. Ember runtime + exposes a public API for retrieving these values from classes, + via the `metaForProperty()` function. + + @method meta + @param {Object} meta + @chainable + @public */ + ComputedPropertyPrototype.meta = function (meta) { + if (arguments.length === 0) { + return this._meta || {}; + } else { + this._meta = meta; + return this; + } + }; - function meta(obj) { + // invalidate cache when CP key changes + ComputedPropertyPrototype.didChange = function (obj, keyName) { + // _suspended is set via a CP.set to ensure we don't clear + // the cached value set by the setter + if (this._volatile || this._suspended === obj) { + return; + } - var maybeMeta = peekMeta(obj); - var parent = undefined; + // don't create objects just to invalidate + var meta = _emberMetalMeta.peekMeta(obj); + if (!meta || meta.source !== obj) { + return; + } - // remove this code, in-favor of explicit parent - if (maybeMeta) { - if (maybeMeta.source === obj) { - return maybeMeta; - } - parent = maybeMeta; + var cache = meta.readableCache(); + if (cache && cache[keyName] !== undefined) { + cache[keyName] = undefined; + _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); } + }; - var newMeta = new Meta(obj, parent); - setMeta(obj, newMeta); - return newMeta; - } + ComputedPropertyPrototype.get = function (obj, keyName) { + if (this._volatile) { + return this._getter.call(obj, keyName); + } - exports.peekMeta = peekMeta; - exports.setMeta = setMeta; - exports.counters = counters; -}); -enifed('ember-metal/meta_listeners', ['exports'], function (exports) { - /* - When we render a rich template hierarchy, the set of events that - *might* happen tends to be much larger than the set of events that - actually happen. This implies that we should make listener creation & - destruction cheap, even at the cost of making event dispatch more - expensive. - - Thus we store a new listener with a single push and no new - allocations, without even bothering to do deduplication -- we can - save that for dispatch time, if an event actually happens. - */ + var meta = _emberMetalMeta.meta(obj); + var cache = meta.writableCache(); - /* listener flags */ - 'use strict'; + var result = cache[keyName]; + if (result === _emberMetalMeta.UNDEFINED) { + return undefined; + } else if (result !== undefined) { + return result; + } - var ONCE = 1; - exports.ONCE = ONCE; - var SUSPENDED = 2; + var ret = this._getter.call(obj, keyName); + if (ret === undefined) { + cache[keyName] = _emberMetalMeta.UNDEFINED; + } else { + cache[keyName] = ret; + } - exports.SUSPENDED = SUSPENDED; - var protoMethods = { + var chainWatchers = meta.readableChainWatchers(); + if (chainWatchers) { + chainWatchers.revalidate(keyName); + } + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); - addToListeners: function (eventName, target, method, flags) { - if (!this._listeners) { - this._listeners = []; - } - this._listeners.push(eventName, target, method, flags); - }, + return ret; + }; - _finalizeListeners: function () { - if (this._listenersFinalized) { - return; - } - if (!this._listeners) { - this._listeners = []; - } - var pointer = this.parent; - while (pointer) { - var listeners = pointer._listeners; - if (listeners) { - this._listeners = this._listeners.concat(listeners); - } - if (pointer._listenersFinalized) { - break; - } - pointer = pointer.parent; - } - this._listenersFinalized = true; - }, + ComputedPropertyPrototype.set = function computedPropertySetEntry(obj, keyName, value) { + if (this._readOnly) { + this._throwReadOnlyError(obj, keyName); + } - removeFromListeners: function (eventName, target, method, didRemove) { - var pointer = this; - while (pointer) { - var listeners = pointer._listeners; - if (listeners) { - for (var index = listeners.length - 4; index >= 0; index -= 4) { - if (listeners[index] === eventName && (!method || listeners[index + 1] === target && listeners[index + 2] === method)) { - if (pointer === this) { - // we are modifying our own list, so we edit directly - if (typeof didRemove === 'function') { - didRemove(eventName, target, listeners[index + 2]); - } - listeners.splice(index, 4); - } else { - // we are trying to remove an inherited listener, so we do - // just-in-time copying to detach our own listeners from - // our inheritance chain. - this._finalizeListeners(); - return this.removeFromListeners(eventName, target, method); - } - } - } - } - if (pointer._listenersFinalized) { - break; - } - pointer = pointer.parent; - } - }, + if (!this._setter) { + return this.clobberSet(obj, keyName, value); + } - matchingListeners: function (eventName) { - var pointer = this; - var result = []; - while (pointer) { - var listeners = pointer._listeners; - if (listeners) { - for (var index = 0; index < listeners.length - 3; index += 4) { - if (listeners[index] === eventName) { - pushUniqueListener(result, listeners, index); - } - } - } - if (pointer._listenersFinalized) { - break; - } - pointer = pointer.parent; - } - var sus = this._suspendedListeners; - if (sus) { - for (var susIndex = 0; susIndex < sus.length - 2; susIndex += 3) { - if (eventName === sus[susIndex]) { - for (var resultIndex = 0; resultIndex < result.length - 2; resultIndex += 3) { - if (result[resultIndex] === sus[susIndex + 1] && result[resultIndex + 1] === sus[susIndex + 2]) { - result[resultIndex + 2] |= SUSPENDED; - } - } - } - } - } - return result; - }, + if (this._volatile) { + return this.volatileSet(obj, keyName, value); + } - suspendListeners: function (eventNames, target, method, callback) { - var sus = this._suspendedListeners; - if (!sus) { - sus = this._suspendedListeners = []; - } - for (var i = 0; i < eventNames.length; i++) { - sus.push(eventNames[i], target, method); - } - try { - return callback.call(target); - } finally { - if (sus.length === eventNames.length) { - this._suspendedListeners = undefined; - } else { - for (var i = sus.length - 3; i >= 0; i -= 3) { - if (sus[i + 1] === target && sus[i + 2] === method && eventNames.indexOf(sus[i]) !== -1) { - sus.splice(i, 3); - } - } - } - } - }, + return this.setWithSuspend(obj, keyName, value); + }; - watchedEvents: function () { - var pointer = this; - var names = {}; - while (pointer) { - var listeners = pointer._listeners; - if (listeners) { - for (var index = 0; index < listeners.length - 3; index += 4) { - names[listeners[index]] = true; - } - } - if (pointer._listenersFinalized) { - break; - } - pointer = pointer.parent; - } - return Object.keys(names); - }, + ComputedPropertyPrototype._throwReadOnlyError = function computedPropertyThrowReadOnlyError(obj, keyName) { + throw new _emberMetalError.default('Cannot set read-only property "' + keyName + '" on object: ' + _emberUtils.inspect(obj)); + }; - _initializeListeners: function () { - this._listeners = undefined; - this._listenersFinalized = undefined; - this._suspendedListeners = undefined; + ComputedPropertyPrototype.clobberSet = function computedPropertyClobberSet(obj, keyName, value) { + var cachedValue = cacheFor(obj, keyName); + _emberMetalProperties.defineProperty(obj, keyName, null, cachedValue); + _emberMetalProperty_set.set(obj, keyName, value); + return value; + }; + + ComputedPropertyPrototype.volatileSet = function computedPropertyVolatileSet(obj, keyName, value) { + return this._setter.call(obj, keyName, value); + }; + + ComputedPropertyPrototype.setWithSuspend = function computedPropertySetWithSuspend(obj, keyName, value) { + var oldSuspended = this._suspended; + this._suspended = obj; + try { + return this._set(obj, keyName, value); + } finally { + this._suspended = oldSuspended; } }; - exports.protoMethods = protoMethods; - function pushUniqueListener(destination, source, index) { - var target = source[index + 1]; - var method = source[index + 2]; - for (var destinationIndex = 0; destinationIndex < destination.length - 2; destinationIndex += 3) { - if (destination[destinationIndex] === target && destination[destinationIndex + 1] === method) { - return; + ComputedPropertyPrototype._set = function computedPropertySet(obj, keyName, value) { + // cache requires own meta + var meta = _emberMetalMeta.meta(obj); + // either there is a writable cache or we need one to update + var cache = meta.writableCache(); + var hadCachedValue = false; + var cachedValue = undefined; + if (cache[keyName] !== undefined) { + if (cache[keyName] !== _emberMetalMeta.UNDEFINED) { + cachedValue = cache[keyName]; } + hadCachedValue = true; } - destination.push(target, method, source[index + 3]); - } -}); -enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'ember-metal/debug', 'ember-metal/meta', 'ember-metal/expand_properties', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/binding', 'ember-metal/observer', 'ember-metal/events'], function (exports, _emberUtils, _emberMetalError, _emberMetalDebug, _emberMetalMeta, _emberMetalExpand_properties, _emberMetalProperties, _emberMetalComputed, _emberMetalBinding, _emberMetalObserver, _emberMetalEvents) { - 'no use strict'; - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - - /** - @module ember - @submodule ember-metal - */ - exports.detectBinding = detectBinding; - exports.mixin = mixin; - exports.default = Mixin; - exports.hasUnprocessedMixins = hasUnprocessedMixins; - exports.clearUnprocessedMixins = clearUnprocessedMixins; - exports.required = required; - exports.aliasMethod = aliasMethod; - exports.observer = observer; - exports._immediateObserver = _immediateObserver; - exports._beforeObserver = _beforeObserver; - - function ROOT() {} - ROOT.__hasSuper = false; - - var a_slice = [].slice; - function isMethod(obj) { - return 'function' === typeof obj && obj.isMethod !== false && obj !== Boolean && obj !== Object && obj !== Number && obj !== Array && obj !== Date && obj !== String; - } - - var CONTINUE = {}; - - function mixinProperties(mixinsMeta, mixin) { - var guid = undefined; + var ret = this._setter.call(obj, keyName, value, cachedValue); - if (mixin instanceof Mixin) { - guid = _emberUtils.guidFor(mixin); - if (mixinsMeta.peekMixins(guid)) { - return CONTINUE; - } - mixinsMeta.writeMixins(guid, mixin); - return mixin.properties; - } else { - return mixin; // apply anonymous mixin properties + // allows setter to return the same value that is cached already + if (hadCachedValue && cachedValue === ret) { + return ret; } - } - function concatenatedMixinProperties(concatProp, props, values, base) { - var concats = undefined; + _emberMetalProperty_events.propertyWillChange(obj, keyName); - // reset before adding each new mixin to pickup concats from previous - concats = values[concatProp] || base[concatProp]; - if (props[concatProp]) { - concats = concats ? concats.concat(props[concatProp]) : props[concatProp]; + if (hadCachedValue) { + cache[keyName] = undefined; } - return concats; - } - - function giveDescriptorSuper(meta, key, property, values, descs, base) { - var superProperty = undefined; + if (!hadCachedValue) { + _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); + } - // Computed properties override methods, and do not call super to them - if (values[key] === undefined) { - // Find the original descriptor in a parent mixin - superProperty = descs[key]; + if (ret === undefined) { + cache[keyName] = _emberMetalMeta.UNDEFINED; + } else { + cache[keyName] = ret; } - // If we didn't find the original descriptor in a parent mixin, find - // it on the original object. - if (!superProperty) { - var possibleDesc = base[key]; - var superDesc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; + _emberMetalProperty_events.propertyDidChange(obj, keyName); - superProperty = superDesc; - } + return ret; + }; - if (superProperty === undefined || !(superProperty instanceof _emberMetalComputed.ComputedProperty)) { - return property; + /* called before property is overridden */ + ComputedPropertyPrototype.teardown = function (obj, keyName) { + if (this._volatile) { + return; } - - // Since multiple mixins may inherit from the same parent, we need - // to clone the computed property so that other mixins do not receive - // the wrapped version. - property = Object.create(property); - property._getter = _emberUtils.wrap(property._getter, superProperty._getter); - if (superProperty._setter) { - if (property._setter) { - property._setter = _emberUtils.wrap(property._setter, superProperty._setter); - } else { - property._setter = superProperty._setter; - } + var meta = _emberMetalMeta.meta(obj); + var cache = meta.readableCache(); + if (cache && cache[keyName] !== undefined) { + _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); + cache[keyName] = undefined; } + }; - return property; - } + /** + This helper returns a new property descriptor that wraps the passed + computed property function. You can use this helper to define properties + with mixins or via `Ember.defineProperty()`. + + If you pass a function as an argument, it will be used as a getter. A computed + property defined in this way might look like this: + + ```js + let Person = Ember.Object.extend({ + init() { + this._super(...arguments); + + this.firstName = 'Betty'; + this.lastName = 'Jones'; + }, + + fullName: Ember.computed('firstName', 'lastName', function() { + return `${this.get('firstName')} ${this.get('lastName')}`; + }) + }); + + let client = Person.create(); + + client.get('fullName'); // 'Betty Jones' + + client.set('lastName', 'Fuller'); + client.get('fullName'); // 'Betty Fuller' + ``` + + You can pass a hash with two functions, `get` and `set`, as an + argument to provide both a getter and setter: + + ```js + let Person = Ember.Object.extend({ + init() { + this._super(...arguments); + + this.firstName = 'Betty'; + this.lastName = 'Jones'; + }, + + fullName: Ember.computed('firstName', 'lastName', { + get(key) { + return `${this.get('firstName')} ${this.get('lastName')}`; + }, + set(key, value) { + let [firstName, lastName] = value.split(/\s+/); + this.setProperties({ firstName, lastName }); + return value; + } + }) + }); + + let client = Person.create(); + client.get('firstName'); // 'Betty' + + client.set('fullName', 'Carroll Fuller'); + client.get('firstName'); // 'Carroll' + ``` + + The `set` function should accept two parameters, `key` and `value`. The value + returned from `set` will be the new value of the property. + + _Note: This is the preferred way to define computed properties when writing third-party + libraries that depend on or use Ember, since there is no guarantee that the user + will have [prototype Extensions](http://emberjs.com/guides/configuring-ember/disabling-prototype-extensions/) enabled._ + + The alternative syntax, with prototype extensions, might look like: + + ```js + fullName: function() { + return this.get('firstName') + ' ' + this.get('lastName'); + }.property('firstName', 'lastName') + ``` + + @class computed + @namespace Ember + @constructor + @static + @param {String} [dependentKeys*] Optional dependent keys that trigger this computed property. + @param {Function} func The computed property function. + @return {Ember.ComputedProperty} property descriptor instance + @public + */ - function giveMethodSuper(obj, key, method, values, descs) { - var superMethod = undefined; + function computed(func) { + var args = undefined; - // Methods overwrite computed properties, and do not call super to them. - if (descs[key] === undefined) { - // Find the original method in a parent mixin - superMethod = values[key]; + if (arguments.length > 1) { + args = [].slice.call(arguments); + func = args.pop(); } - // If we didn't find the original value in a parent mixin, find it in - // the original object - superMethod = superMethod || obj[key]; + var cp = new ComputedProperty(func); - // Only wrap the new method if the original method was a function - if (superMethod === undefined || 'function' !== typeof superMethod) { - return method; + if (args) { + cp.property.apply(cp, args); } - return _emberUtils.wrap(method, superMethod); + return cp; } - function applyConcatenatedProperties(obj, key, value, values) { - var baseValue = values[key] || obj[key]; + /** + Returns the cached value for a property, if one exists. + This can be useful for peeking at the value of a computed + property that is generated lazily, without accidentally causing + it to be created. + + @method cacheFor + @for Ember + @param {Object} obj the object whose property you want to check + @param {String} key the name of the property whose cached value you want + to return + @return {Object} the cached value + @public + */ + function cacheFor(obj, key) { + var meta = _emberMetalMeta.peekMeta(obj); + var cache = meta && meta.source === obj && meta.readableCache(); + var ret = cache && cache[key]; - if (baseValue) { - if ('function' === typeof baseValue.concat) { - if (value === null || value === undefined) { - return baseValue; - } else { - return baseValue.concat(value); - } - } else { - return _emberUtils.makeArray(baseValue).concat(value); - } - } else { - return _emberUtils.makeArray(value); + if (ret === _emberMetalMeta.UNDEFINED) { + return undefined; } + return ret; } - function applyMergedProperties(obj, key, value, values) { - var baseValue = values[key] || obj[key]; + cacheFor.set = function (cache, key, value) { + if (value === undefined) { + cache[key] = _emberMetalMeta.UNDEFINED; + } else { + cache[key] = value; + } + }; - if (!baseValue) { - return value; + cacheFor.get = function (cache, key) { + var ret = cache[key]; + if (ret === _emberMetalMeta.UNDEFINED) { + return undefined; } + return ret; + }; - var newBase = _emberUtils.assign({}, baseValue); - var hasFunction = false; + cacheFor.remove = function (cache, key) { + cache[key] = undefined; + }; - for (var prop in value) { - if (!value.hasOwnProperty(prop)) { - continue; - } + exports.ComputedProperty = ComputedProperty; + exports.computed = computed; + exports.cacheFor = cacheFor; +}); +enifed('ember-metal/core', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { + 'use strict'; - var propValue = value[prop]; - if (isMethod(propValue)) { - // TODO: support for Computed Properties, etc? - hasFunction = true; - newBase[prop] = giveMethodSuper(obj, prop, propValue, baseValue, {}); - } else { - newBase[prop] = propValue; - } - } + /** + @module ember + @submodule ember-metal + */ - if (hasFunction) { - newBase._super = ROOT; - } + /** + This namespace contains all Ember methods and functions. Future versions of + Ember may overwrite this namespace and therefore, you should avoid adding any + new properties. + + At the heart of Ember is Ember-Runtime, a set of core functions that provide + cross-platform compatibility and object property observing. Ember-Runtime is + small and performance-focused so you can use it alongside other + cross-platform libraries such as jQuery. For more details, see + [Ember-Runtime](http://emberjs.com/api/modules/ember-runtime.html). + + @class Ember + @static + @public + */ + var Ember = typeof _emberEnvironment.context.imports.Ember === 'object' && _emberEnvironment.context.imports.Ember || {}; - return newBase; - } + // Make sure these are set whether Ember was already defined or not + Ember.isNamespace = true; + Ember.toString = function () { + return 'Ember'; + }; - function addNormalizedProperty(base, key, value, meta, descs, values, concats, mergings) { - if (value instanceof _emberMetalProperties.Descriptor) { - if (value === REQUIRED && descs[key]) { - return CONTINUE; - } + // .......................................................... + // BOOTSTRAP + // - // Wrap descriptor function to implement - // _super() if needed - if (value._getter) { - value = giveDescriptorSuper(meta, key, value, values, descs, base); - } + exports.default = Ember; +}); +enifed("ember-metal/debug", ["exports"], function (exports) { + "use strict"; - descs[key] = value; - values[key] = undefined; - } else { - if (concats && concats.indexOf(key) >= 0 || key === 'concatenatedProperties' || key === 'mergedProperties') { - value = applyConcatenatedProperties(base, key, value, values); - } else if (mergings && mergings.indexOf(key) >= 0) { - value = applyMergedProperties(base, key, value, values); - } else if (isMethod(value)) { - value = giveMethodSuper(base, key, value, values, descs); + exports.getDebugFunction = getDebugFunction; + exports.setDebugFunction = setDebugFunction; + exports.assert = assert; + exports.info = info; + exports.warn = warn; + exports.debug = debug; + exports.deprecate = deprecate; + exports.deprecateFunc = deprecateFunc; + exports.runInDebug = runInDebug; + exports.debugSeal = debugSeal; + exports.debugFreeze = debugFreeze; + var debugFunctions = { + assert: function () {}, + info: function () {}, + warn: function () {}, + debug: function () {}, + deprecate: function () {}, + deprecateFunc: function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } - descs[key] = undefined; - values[key] = value; - } + return args[args.length - 1]; + }, + runInDebug: function () {}, + debugSeal: function () {}, + debugFreeze: function () {} + }; + + exports.debugFunctions = debugFunctions; + + function getDebugFunction(name) { + return debugFunctions[name]; } - function mergeMixins(mixins, m, descs, values, base, keys) { - var currentMixin = undefined, - props = undefined, - key = undefined, - concats = undefined, - mergings = undefined; + function setDebugFunction(name, fn) { + debugFunctions[name] = fn; + } - function removeKeys(keyName) { - delete descs[keyName]; - delete values[keyName]; - } + function assert() { + return debugFunctions.assert.apply(undefined, arguments); + } - for (var i = 0; i < mixins.length; i++) { - currentMixin = mixins[i]; + function info() { + return debugFunctions.info.apply(undefined, arguments); + } - props = mixinProperties(m, currentMixin); - if (props === CONTINUE) { - continue; - } + function warn() { + return debugFunctions.warn.apply(undefined, arguments); + } - if (props) { - if (base.willMergeMixin) { - base.willMergeMixin(props); - } - concats = concatenatedMixinProperties('concatenatedProperties', props, values, base); - mergings = concatenatedMixinProperties('mergedProperties', props, values, base); + function debug() { + return debugFunctions.debug.apply(undefined, arguments); + } - for (key in props) { - if (!props.hasOwnProperty(key)) { - continue; - } - keys.push(key); - addNormalizedProperty(base, key, props[key], m, descs, values, concats, mergings); - } + function deprecate() { + return debugFunctions.deprecate.apply(undefined, arguments); + } - // manually copy toString() because some JS engines do not enumerate it - if (props.hasOwnProperty('toString')) { - base.toString = props.toString; - } - } else if (currentMixin.mixins) { - mergeMixins(currentMixin.mixins, m, descs, values, base, keys); - if (currentMixin._without) { - currentMixin._without.forEach(removeKeys); - } - } - } + function deprecateFunc() { + return debugFunctions.deprecateFunc.apply(undefined, arguments); } - function detectBinding(key) { - var length = key.length; + function runInDebug() { + return debugFunctions.runInDebug.apply(undefined, arguments); + } - return length > 7 && key.charCodeAt(length - 7) === 66 && key.indexOf('inding', length - 6) !== -1; + function debugSeal() { + return debugFunctions.debugSeal.apply(undefined, arguments); } - // warm both paths of above function - detectBinding('notbound'); - detectBinding('fooBinding'); + function debugFreeze() { + return debugFunctions.debugFreeze.apply(undefined, arguments); + } +}); +enifed('ember-metal/dependent_keys', ['exports', 'ember-metal/watching'], function (exports, _emberMetalWatching) { + 'no use strict'; + // Remove "use strict"; from transpiled module until + // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - function connectBindings(obj, m) { - // TODO Mixin.apply(instance) should disconnect binding if exists - m.forEachBindings(function (key, binding) { - if (binding) { - var to = key.slice(0, -7); // strip Binding off end - if (binding instanceof _emberMetalBinding.Binding) { - binding = binding.copy(); // copy prototypes' instance - binding.to(to); - } else { - // binding is string path - binding = new _emberMetalBinding.Binding(to, binding); - } - binding.connect(obj); - obj[key] = binding; - } - }); - // mark as applied - m.clearBindings(); - } - - function finishPartial(obj, m) { - connectBindings(obj, m || _emberMetalMeta.meta(obj)); - return obj; - } + exports.addDependentKeys = addDependentKeys; + exports.removeDependentKeys = removeDependentKeys; - function followAlias(obj, desc, m, descs, values) { - var altKey = desc.methodName; - var value = undefined; - var possibleDesc = undefined; - if (descs[altKey] || values[altKey]) { - value = values[altKey]; - desc = descs[altKey]; - } else if ((possibleDesc = obj[altKey]) && possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor) { - desc = possibleDesc; - value = undefined; - } else { - desc = undefined; - value = obj[altKey]; - } + /** + @module ember + @submodule ember-metal + */ - return { desc: desc, value: value }; - } + // .......................................................... + // DEPENDENT KEYS + // - function updateObserversAndListeners(obj, key, observerOrListener, pathsKey, updateMethod) { - var paths = observerOrListener[pathsKey]; + function addDependentKeys(desc, obj, keyName, meta) { + // the descriptor has a list of dependent keys, so + // add all of its dependent keys. + var idx = undefined, + depKey = undefined; + var depKeys = desc._dependentKeys; + if (!depKeys) { + return; + } - if (paths) { - for (var i = 0; i < paths.length; i++) { - updateMethod(obj, paths[i], null, key); - } + for (idx = 0; idx < depKeys.length; idx++) { + depKey = depKeys[idx]; + // Increment the number of times depKey depends on keyName. + meta.writeDeps(depKey, keyName, (meta.peekDeps(depKey, keyName) || 0) + 1); + // Watch the depKey + _emberMetalWatching.watch(obj, depKey, meta); } } - function replaceObserversAndListeners(obj, key, observerOrListener) { - var prev = obj[key]; - - if ('function' === typeof prev) { - updateObserversAndListeners(obj, key, prev, '__ember_observesBefore__', _emberMetalObserver._removeBeforeObserver); - updateObserversAndListeners(obj, key, prev, '__ember_observes__', _emberMetalObserver.removeObserver); - updateObserversAndListeners(obj, key, prev, '__ember_listens__', _emberMetalEvents.removeListener); + function removeDependentKeys(desc, obj, keyName, meta) { + // the descriptor has a list of dependent keys, so + // remove all of its dependent keys. + var depKeys = desc._dependentKeys; + if (!depKeys) { + return; } - if ('function' === typeof observerOrListener) { - updateObserversAndListeners(obj, key, observerOrListener, '__ember_observesBefore__', _emberMetalObserver._addBeforeObserver); - updateObserversAndListeners(obj, key, observerOrListener, '__ember_observes__', _emberMetalObserver.addObserver); - updateObserversAndListeners(obj, key, observerOrListener, '__ember_listens__', _emberMetalEvents.addListener); + for (var idx = 0; idx < depKeys.length; idx++) { + var depKey = depKeys[idx]; + // Decrement the number of times depKey depends on keyName. + meta.writeDeps(depKey, keyName, (meta.peekDeps(depKey, keyName) || 0) - 1); + // Unwatch the depKey + _emberMetalWatching.unwatch(obj, depKey, meta); } } +}); +enifed('ember-metal/deprecate_property', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set) { + /** + @module ember + @submodule ember-metal + */ - function applyMixin(obj, mixins, partial) { - var descs = {}; - var values = {}; - var m = _emberMetalMeta.meta(obj); - var keys = []; - var key = undefined, - value = undefined, - desc = undefined; - - obj._super = ROOT; - - // Go through all mixins and hashes passed in, and: - // - // * Handle concatenated properties - // * Handle merged properties - // * Set up _super wrapping if necessary - // * Set up computed property descriptors - // * Copying `toString` in broken browsers - mergeMixins(mixins, m, descs, values, obj, keys); - - for (var i = 0; i < keys.length; i++) { - key = keys[i]; - if (key === 'constructor' || !values.hasOwnProperty(key)) { - continue; - } - - desc = descs[key]; - value = values[key]; - - if (desc === REQUIRED) { - continue; - } + 'use strict'; - while (desc && desc instanceof Alias) { - var followed = followAlias(obj, desc, m, descs, values); - desc = followed.desc; - value = followed.value; - } + exports.deprecateProperty = deprecateProperty; - if (desc === undefined && value === undefined) { - continue; - } + /** + Used internally to allow changing properties in a backwards compatible way, and print a helpful + deprecation warning. + + @method deprecateProperty + @param {Object} object The object to add the deprecated property to. + @param {String} deprecatedKey The property to add (and print deprecation warnings upon accessing). + @param {String} newKey The property that will be aliased. + @private + @since 1.7.0 + */ - replaceObserversAndListeners(obj, key, value); + function deprecateProperty(object, deprecatedKey, newKey, options) { + function _deprecate() {} - if (detectBinding(key)) { - m.writeBindings(key, value); + Object.defineProperty(object, deprecatedKey, { + configurable: true, + enumerable: false, + set: function (value) { + _deprecate(); + _emberMetalProperty_set.set(this, newKey, value); + }, + get: function () { + _deprecate(); + return _emberMetalProperty_get.get(this, newKey); } + }); + } +}); +enifed('ember-metal/descriptor', ['exports', 'ember-metal/properties'], function (exports, _emberMetalProperties) { + 'use strict'; - _emberMetalProperties.defineProperty(obj, key, desc, value, m); - } - - if (!partial) { - // don't apply to prototype - finishPartial(obj, m); - } + exports.default = descriptor; - return obj; + function descriptor(desc) { + return new Descriptor(desc); } /** - @method mixin - @for Ember - @param obj - @param mixins* - @return obj + A wrapper for a native ES5 descriptor. In an ideal world, we wouldn't need + this at all, however, the way we currently flatten/merge our mixins require + a special value to denote a descriptor. + + @class Descriptor @private */ - function mixin(obj) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; + var Descriptor = (function (_EmberDescriptor) { + babelHelpers.inherits(Descriptor, _EmberDescriptor); + + function Descriptor(desc) { + _EmberDescriptor.call(this); + this.desc = desc; } - applyMixin(obj, args, false); - return obj; - } + Descriptor.prototype.setup = function setup(obj, key) { + Object.defineProperty(obj, key, this.desc); + }; + + Descriptor.prototype.teardown = function teardown(obj, key) {}; - var NAME_KEY = _emberUtils.GUID_KEY + '_name'; + return Descriptor; + })(_emberMetalProperties.Descriptor); +}); +enifed("ember-metal/error", ["exports"], function (exports) { - exports.NAME_KEY = NAME_KEY; /** - The `Ember.Mixin` class allows you to create mixins, whose properties can be - added to other classes. For instance, - - ```javascript - const EditableMixin = Ember.Mixin.create({ - edit() { - console.log('starting to edit'); - this.set('isEditing', true); - }, - isEditing: false - }); - - // Mix mixins into classes by passing them as the first arguments to - // `.extend.` - const Comment = Ember.Object.extend(EditableMixin, { - post: null - }); - - let comment = Comment.create(post: somePost); - comment.edit(); // outputs 'starting to edit' - ``` - - Note that Mixins are created with `Ember.Mixin.create`, not - `Ember.Mixin.extend`. - - Note that mixins extend a constructor's prototype so arrays and object literals - defined as properties will be shared amongst objects that implement the mixin. - If you want to define a property in a mixin that is not shared, you can define - it either as a computed property or have it be created on initialization of the object. - - ```javascript - // filters array will be shared amongst any object implementing mixin - const FilterableMixin = Ember.Mixin.create({ - filters: Ember.A() - }); - - // filters will be a separate array for every object implementing the mixin - const FilterableMixin = Ember.Mixin.create({ - filters: Ember.computed(function() { - return Ember.A(); - }) - }); - - // filters will be created as a separate array during the object's initialization - const Filterable = Ember.Mixin.create({ - init() { - this._super(...arguments); - this.set("filters", Ember.A()); - } - }); - ``` + A subclass of the JavaScript Error object for use in Ember. - @class Mixin + @class Error @namespace Ember + @extends Error + @constructor @public */ + "use strict"; - function Mixin(args, properties) { - this.properties = properties; + var EmberError = (function (_Error) { + babelHelpers.inherits(EmberError, _Error); - var length = args && args.length; + function EmberError(message) { + _Error.call(this); - if (length > 0) { - var m = new Array(length); + if (!(this instanceof EmberError)) { + return new EmberError(message); + } - for (var i = 0; i < length; i++) { - var x = args[i]; - if (x instanceof Mixin) { - m[i] = x; - } else { - m[i] = new Mixin(undefined, x); - } + var error = Error.call(this, message); + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, EmberError); + } else { + this.stack = error.stack; } - this.mixins = m; - } else { - this.mixins = undefined; + this.description = error.description; + this.fileName = error.fileName; + this.lineNumber = error.lineNumber; + this.message = error.message; + this.name = error.name; + this.number = error.number; + this.code = error.code; } - this.ownerConstructor = undefined; - this._without = undefined; - this[_emberUtils.GUID_KEY] = null; - this[NAME_KEY] = null; - } - Mixin._apply = applyMixin; + return EmberError; + })(Error); - Mixin.applyPartial = function (obj) { - var args = a_slice.call(arguments, 1); - return applyMixin(obj, args, true); - }; + exports.default = EmberError; +}); +enifed('ember-metal/error_handler', ['exports', 'ember-console', 'ember-metal/testing'], function (exports, _emberConsole, _emberMetalTesting) { + 'use strict'; - Mixin.finishPartial = finishPartial; + exports.getOnerror = getOnerror; + exports.setOnerror = setOnerror; + exports.dispatchError = dispatchError; + exports.setDispatchOverride = setDispatchOverride; - var unprocessedFlag = false; + // To maintain stacktrace consistency across browsers + var getStack = function (error) { + var stack = error.stack; + var message = error.message; - function hasUnprocessedMixins() { - return unprocessedFlag; + if (stack && !stack.includes(message)) { + stack = message + '\n' + stack; + } + + return stack; + }; + + var onerror = undefined; + // Ember.onerror getter + + function getOnerror() { + return onerror; } - function clearUnprocessedMixins() { - unprocessedFlag = false; + // Ember.onerror setter + + function setOnerror(handler) { + onerror = handler; } - /** - @method create - @static - @param arguments* - @public - */ - Mixin.create = function () { - // ES6TODO: this relies on a global state? - unprocessedFlag = true; - var M = this; + var dispatchOverride = undefined; + // dispatch error - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; + function dispatchError(error) { + if (dispatchOverride) { + dispatchOverride(error); + } else { + defaultDispatch(error); } + } - return new M(args, undefined); - }; + // allows testing adapter to override dispatch - var MixinPrototype = Mixin.prototype; + function setDispatchOverride(handler) { + dispatchOverride = handler; + } + + function defaultDispatch(error) { + if (_emberMetalTesting.isTesting()) { + throw error; + } + if (onerror) { + onerror(error); + } else { + _emberConsole.default.error(getStack(error)); + } + } +}); +enifed('ember-metal/events', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/meta', 'ember-metal/meta_listeners'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalMeta, _emberMetalMeta_listeners) { + 'no use strict'; + // Remove "use strict"; from transpiled module until + // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed /** - @method reopen - @param arguments* - @private + @module ember + @submodule ember-metal */ - MixinPrototype.reopen = function () { - var currentMixin = undefined; + exports.accumulateListeners = accumulateListeners; + exports.addListener = addListener; + exports.removeListener = removeListener; + exports.suspendListener = suspendListener; + exports.suspendListeners = suspendListeners; + exports.watchedEvents = watchedEvents; + exports.sendEvent = sendEvent; + exports.hasListeners = hasListeners; + exports.listenersFor = listenersFor; + exports.on = on; - if (this.properties) { - currentMixin = new Mixin(undefined, this.properties); - this.properties = undefined; - this.mixins = [currentMixin]; - } else if (!this.mixins) { - this.mixins = []; + /* + The event system uses a series of nested hashes to store listeners on an + object. When a listener is registered, or when an event arrives, these + hashes are consulted to determine which target and action pair to invoke. + + The hashes are stored in the object's meta hash, and look like this: + + // Object's meta hash + { + listeners: { // variable name: `listenerSet` + "foo:changed": [ // variable name: `actions` + target, method, flags + ] + } + } + + */ + + function indexOf(array, target, method) { + var index = -1; + // hashes are added to the end of the event array + // so it makes sense to start searching at the end + // of the array and search in reverse + for (var i = array.length - 3; i >= 0; i -= 3) { + if (target === array[i] && method === array[i + 1]) { + index = i; + break; + } } + return index; + } - var mixins = this.mixins; - var idx = undefined; + function accumulateListeners(obj, eventName, otherActions) { + var meta = _emberMetalMeta.peekMeta(obj); + if (!meta) { + return; + } + var actions = meta.matchingListeners(eventName); + var newActions = []; - for (idx = 0; idx < arguments.length; idx++) { - currentMixin = arguments[idx]; + for (var i = actions.length - 3; i >= 0; i -= 3) { + var target = actions[i]; + var method = actions[i + 1]; + var flags = actions[i + 2]; + var actionIndex = indexOf(otherActions, target, method); - if (currentMixin instanceof Mixin) { - mixins.push(currentMixin); - } else { - mixins.push(new Mixin(undefined, currentMixin)); + if (actionIndex === -1) { + otherActions.push(target, method, flags); + newActions.push(target, method, flags); } } - return this; - }; + return newActions; + } /** - @method apply + Add an event listener + + @method addListener + @for Ember @param obj - @return applied object - @private + @param {String} eventName + @param {Object|Function} target A target object or a function + @param {Function|String} method A function or the name of a function to be called on `target` + @param {Boolean} once A flag whether a function should only be called once + @public */ - MixinPrototype.apply = function (obj) { - return applyMixin(obj, [this], false); - }; - - MixinPrototype.applyPartial = function (obj) { - return applyMixin(obj, [this], true); - }; - - MixinPrototype.toString = Object.toString; - function _detect(curMixin, targetMixin, seen) { - var guid = _emberUtils.guidFor(curMixin); + function addListener(obj, eventName, target, method, once) { - if (seen[guid]) { - return false; + if (!method && 'function' === typeof target) { + method = target; + target = null; } - seen[guid] = true; - if (curMixin === targetMixin) { - return true; + var flags = 0; + if (once) { + flags |= _emberMetalMeta_listeners.ONCE; } - var mixins = curMixin.mixins; - var loc = mixins ? mixins.length : 0; - while (--loc >= 0) { - if (_detect(mixins[loc], targetMixin, seen)) { - return true; - } + + _emberMetalMeta.meta(obj).addToListeners(eventName, target, method, flags); + + if ('function' === typeof obj.didAddListener) { + obj.didAddListener(eventName, target, method); } - return false; } /** - @method detect + Remove an event listener + + Arguments should match those passed to `Ember.addListener`. + + @method removeListener + @for Ember @param obj - @return {Boolean} - @private + @param {String} eventName + @param {Object|Function} target A target object or a function + @param {Function|String} method A function or the name of a function to be called on `target` + @public */ - MixinPrototype.detect = function (obj) { - if (typeof obj !== 'object' || obj === null) { - return false; - } - if (obj instanceof Mixin) { - return _detect(obj, this, {}); - } - var m = _emberMetalMeta.peekMeta(obj); - if (!m) { - return false; - } - return !!m.peekMixins(_emberUtils.guidFor(this)); - }; - MixinPrototype.without = function () { - var ret = new Mixin([this]); + function removeListener(obj, eventName, target, method) { - for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; + if (!method && 'function' === typeof target) { + method = target; + target = null; } - ret._without = args; - return ret; - }; - - function _keys(ret, mixin, seen) { - if (seen[_emberUtils.guidFor(mixin)]) { - return; - } - seen[_emberUtils.guidFor(mixin)] = true; - - if (mixin.properties) { - var props = Object.keys(mixin.properties); - for (var i = 0; i < props.length; i++) { - var key = props[i]; - ret[key] = true; - } - } else if (mixin.mixins) { - mixin.mixins.forEach(function (x) { - return _keys(ret, x, seen); - }); - } - } - - MixinPrototype.keys = function () { - var keys = {}; - var seen = {}; - - _keys(keys, this, seen); - var ret = Object.keys(keys); - return ret; - }; - - // returns the mixins currently applied to the specified object - // TODO: Make Ember.mixin - Mixin.mixins = function (obj) { - var m = _emberMetalMeta.peekMeta(obj); - var ret = []; - if (!m) { - return ret; - } - - m.forEachMixins(function (key, currentMixin) { - // skip primitive mixins since these are always anonymous - if (!currentMixin.properties) { - ret.push(currentMixin); + _emberMetalMeta.meta(obj).removeFromListeners(eventName, target, method, function () { + if ('function' === typeof obj.didRemoveListener) { + obj.didRemoveListener.apply(obj, arguments); } }); - - return ret; - }; - - var REQUIRED = new _emberMetalProperties.Descriptor(); - REQUIRED.toString = function () { - return '(Required Property)'; - }; + } /** - Denotes a required property for a mixin + Suspend listener during callback. - @method required + This should only be used by the target of the event listener + when it is taking an action that would cause the event, e.g. + an object might suspend its property change listener while it is + setting that property. + + @method suspendListener @for Ember + @private + @param obj + @param {String} eventName + @param {Object|Function} target A target object or a function + @param {Function|String} method A function or the name of a function to be called on `target` + @param {Function} callback */ - function required() { - return REQUIRED; - } - - function Alias(methodName) { - this.isDescriptor = true; - this.methodName = methodName; + function suspendListener(obj, eventName, target, method, callback) { + return suspendListeners(obj, [eventName], target, method, callback); } - Alias.prototype = new _emberMetalProperties.Descriptor(); - /** - Makes a method available via an additional name. - - ```javascript - App.Person = Ember.Object.extend({ - name: function() { - return 'Tomhuda Katzdale'; - }, - moniker: Ember.aliasMethod('name') - }); + Suspends multiple listeners during a callback. - let goodGuy = App.Person.create(); + @method suspendListeners + @for Ember - goodGuy.name(); // 'Tomhuda Katzdale' - goodGuy.moniker(); // 'Tomhuda Katzdale' - ``` + @private + @param obj + @param {Array} eventNames Array of event names + @param {Object|Function} target A target object or a function + @param {Function|String} method A function or the name of a function to be called on `target` + @param {Function} callback + */ + + function suspendListeners(obj, eventNames, target, method, callback) { + if (!method && 'function' === typeof target) { + method = target; + target = null; + } + return _emberMetalMeta.meta(obj).suspendListeners(eventNames, target, method, callback); + } + + /** + Return a list of currently watched events - @method aliasMethod + @private + @method watchedEvents @for Ember - @param {String} methodName name of the method to alias - @public + @param obj */ - function aliasMethod(methodName) { - return new Alias(methodName); + function watchedEvents(obj) { + return _emberMetalMeta.meta(obj).watchedEvents(); } - // .......................................................... - // OBSERVER HELPER - // - /** - Specify a method that observes property changes. - - ```javascript - Ember.Object.extend({ - valueObserver: Ember.observer('value', function() { - // Executes whenever the "value" property changes - }) - }); - ``` - - Also available as `Function.prototype.observes` if prototype extensions are - enabled. + Send an event. The execution of suspended listeners + is skipped, and once listeners are removed. A listener without + a target is executed on the passed object. If an array of actions + is not passed, the actions stored on the passed object are invoked. - @method observer + @method sendEvent @for Ember - @param {String} propertyNames* - @param {Function} func - @return func + @param obj + @param {String} eventName + @param {Array} params Optional parameters for each listener. + @param {Array} actions Optional array of actions (listeners). + @return true @public */ - function observer() { - for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { - args[_key4] = arguments[_key4]; + function sendEvent(obj, eventName, params, actions) { + if (!actions) { + var meta = _emberMetalMeta.peekMeta(obj); + actions = meta && meta.matchingListeners(eventName); } - var func = args.slice(-1)[0]; - var paths = undefined; + if (!actions || actions.length === 0) { + return; + } - var addWatchedProperty = function (path) { - paths.push(path); - }; - var _paths = args.slice(0, -1); + for (var i = actions.length - 3; i >= 0; i -= 3) { + // looping in reverse for once listeners + var target = actions[i]; + var method = actions[i + 1]; + var flags = actions[i + 2]; - if (typeof func !== 'function') { + if (!method) { + continue; + } + if (flags & _emberMetalMeta_listeners.SUSPENDED) { + continue; + } + if (flags & _emberMetalMeta_listeners.ONCE) { + removeListener(obj, eventName, target, method); + } + if (!target) { + target = obj; + } + if ('string' === typeof method) { + if (params) { + _emberUtils.applyStr(target, method, params); + } else { + target[method](); + } + } else { + if (params) { + method.apply(target, params); + } else { + method.call(target); + } + } + } + return true; + } - func = args[0]; + /** + @private + @method hasListeners + @for Ember + @param obj + @param {String} eventName + */ - // revert to old, soft-deprecated argument ordering - _paths = args.slice(1); + function hasListeners(obj, eventName) { + var meta = _emberMetalMeta.peekMeta(obj); + if (!meta) { + return false; } + return meta.matchingListeners(eventName).length > 0; + } - paths = []; + /** + @private + @method listenersFor + @for Ember + @param obj + @param {String} eventName + */ - for (var i = 0; i < _paths.length; ++i) { - _emberMetalExpand_properties.default(_paths[i], addWatchedProperty); + function listenersFor(obj, eventName) { + var ret = []; + var meta = _emberMetalMeta.peekMeta(obj); + var actions = meta && meta.matchingListeners(eventName); + + if (!actions) { + return ret; } - if (typeof func !== 'function') { - throw new _emberMetalError.default('Ember.observer called without a function'); + for (var i = 0; i < actions.length; i += 3) { + var target = actions[i]; + var method = actions[i + 1]; + ret.push([target, method]); } - func.__ember_observes__ = paths; - return func; + return ret; } /** - Specify a method that observes property changes. + Define a property as a function that should be executed when + a specified event or events are triggered. - ```javascript - Ember.Object.extend({ - valueObserver: Ember.immediateObserver('value', function() { - // Executes whenever the "value" property changes + + ``` javascript + let Job = Ember.Object.extend({ + logCompleted: Ember.on('completed', function() { + console.log('Job completed!'); }) }); - ``` - In the future, `Ember.observer` may become asynchronous. In this event, - `Ember.immediateObserver` will maintain the synchronous behavior. + let job = Job.create(); - Also available as `Function.prototype.observesImmediately` if prototype extensions are - enabled. + Ember.sendEvent(job, 'completed'); // Logs 'Job completed!' + ``` - @method _immediateObserver + @method on @for Ember - @param {String} propertyNames* + @param {String} eventNames* @param {Function} func - @deprecated Use `Ember.observer` instead. @return func - @private + @public */ - function _immediateObserver() { - - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; + function on() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } - return observer.apply(this, arguments); + var func = args.pop(); + var events = args; + func.__ember_listens__ = events; + return func; } +}); +enifed('ember-metal/expand_properties', ['exports', 'ember-metal/debug'], function (exports, _emberMetalDebug) { + 'use strict'; + + exports.default = expandProperties; /** - When observers fire, they are called with the arguments `obj`, `keyName`. + @module ember + @submodule ember-metal + */ + + var SPLIT_REGEX = /\{|\}/; + var END_WITH_EACH_REGEX = /\.@each$/; + + /** + Expands `pattern`, invoking `callback` for each expansion. - Note, `@each.property` observer is called per each add or replace of an element - and it's not called with a specific enumeration item. + The only pattern supported is brace-expansion, anything else will be passed + once to `callback` directly. - A `_beforeObserver` fires before a property changes. + Example - @method beforeObserver + ```js + function echo(arg){ console.log(arg); } + + 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}.[]', 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 expandProperties @for Ember - @param {String} propertyNames* - @param {Function} func - @return func - @deprecated @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. */ - function _beforeObserver() { - for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { - args[_key5] = arguments[_key5]; - } - - var func = args.slice(-1)[0]; - var paths = undefined; - - var addWatchedProperty = function (path) { - paths.push(path); - }; - - var _paths = args.slice(0, -1); + function expandProperties(pattern, callback) { - if (typeof func !== 'function') { - // revert to old, soft-deprecated argument ordering + var parts = pattern.split(SPLIT_REGEX); + var properties = [parts]; - func = args[0]; - _paths = args.slice(1); + for (var i = 0; i < parts.length; i++) { + var part = parts[i]; + if (part.indexOf(',') >= 0) { + properties = duplicateAndReplace(properties, part.split(','), i); + } } - paths = []; - - for (var i = 0; i < _paths.length; ++i) { - _emberMetalExpand_properties.default(_paths[i], addWatchedProperty); + for (var i = 0; i < properties.length; i++) { + callback(properties[i].join('').replace(END_WITH_EACH_REGEX, '.[]')); } + } - if (typeof func !== 'function') { - throw new _emberMetalError.default('_beforeObserver called without a function'); - } + function duplicateAndReplace(properties, currentParts, index) { + var all = []; - func.__ember_observesBefore__ = paths; - return func; - } + properties.forEach(function (property) { + currentParts.forEach(function (part) { + var current = property.slice(0); + current[index] = part; + all.push(current); + }); + }); - exports.Mixin = Mixin; - exports.required = required; - exports.REQUIRED = REQUIRED; + return all; + } }); -// use conditional to avoid stringifying every time -enifed('ember-metal/observer', ['exports', 'ember-metal/watching', 'ember-metal/events'], function (exports, _emberMetalWatching, _emberMetalEvents) { +enifed('ember-metal/features', ['exports', 'ember-utils', 'ember-environment', 'ember/features'], function (exports, _emberUtils, _emberEnvironment, _emberFeatures) { 'use strict'; - exports.addObserver = addObserver; - exports.observersFor = observersFor; - exports.removeObserver = removeObserver; - exports._addBeforeObserver = _addBeforeObserver; - exports._suspendObserver = _suspendObserver; - exports._suspendObservers = _suspendObservers; - exports._removeBeforeObserver = _removeBeforeObserver; + exports.default = isEnabled; /** - @module ember-metal + The hash of enabled Canary features. Add to this, any canary features + before creating your application. + + Alternatively (and recommended), you can also define `EmberENV.FEATURES` + if you need to enable features flagged at runtime. + + @class FEATURES + @namespace Ember + @static + @since 1.1.0 + @public */ + var FEATURES = _emberUtils.assign(_emberFeatures.default, _emberEnvironment.ENV.FEATURES); - var AFTER_OBSERVERS = ':change'; - var BEFORE_OBSERVERS = ':before'; - - function changeEvent(keyName) { - return keyName + AFTER_OBSERVERS; - } - - function beforeEvent(keyName) { - return keyName + BEFORE_OBSERVERS; - } - + exports.FEATURES = FEATURES; /** - @method addObserver - @for Ember - @param obj - @param {String} _path - @param {Object|Function} target - @param {Function|String} [method] + Determine whether the specified `feature` is enabled. Used by Ember's + build tools to exclude experimental features from beta/stable builds. + + You can define the following configuration options: + + * `EmberENV.ENABLE_OPTIONAL_FEATURES` - enable any features that have not been explicitly + enabled/disabled. + + @method isEnabled + @param {String} feature The feature to check + @return {Boolean} + @for Ember.FEATURES + @since 1.1.0 @public */ - function addObserver(obj, _path, target, method) { - _emberMetalEvents.addListener(obj, changeEvent(_path), target, method); - _emberMetalWatching.watch(obj, _path); + function isEnabled(feature) { + var featureValue = FEATURES[feature]; - return this; + if (featureValue === true || featureValue === false || featureValue === undefined) { + return featureValue; + } else if (_emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES) { + return true; + } else { + return false; + } } - function observersFor(obj, path) { - return _emberMetalEvents.listenersFor(obj, changeEvent(path)); - } + exports.DEFAULT_FEATURES = _emberFeatures.default; +}); +enifed('ember-metal/get_properties', ['exports', 'ember-metal/property_get'], function (exports, _emberMetalProperty_get) { + 'use strict'; + + exports.default = getProperties; /** - @method removeObserver + To get multiple properties at once, call `Ember.getProperties` + with an object followed by a list of strings or an array: + + ```javascript + Ember.getProperties(record, 'firstName', 'lastName', 'zipCode'); + // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } + ``` + + is equivalent to: + + ```javascript + Ember.getProperties(record, ['firstName', 'lastName', 'zipCode']); + // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } + ``` + + @method getProperties @for Ember - @param obj - @param {String} path - @param {Object|Function} target - @param {Function|String} [method] + @param {Object} obj + @param {String...|Array} list of keys to get + @return {Object} @public */ - function removeObserver(obj, path, target, method) { - _emberMetalWatching.unwatch(obj, path); - _emberMetalEvents.removeListener(obj, changeEvent(path), target, method); + function getProperties(obj) { + var ret = {}; + var propertyNames = arguments; + var i = 1; - return this; + if (arguments.length === 2 && Array.isArray(arguments[1])) { + i = 0; + propertyNames = arguments[1]; + } + for (; i < propertyNames.length; i++) { + ret[propertyNames[i]] = _emberMetalProperty_get.get(obj, propertyNames[i]); + } + return ret; } - +}); +enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/merge', 'ember-metal/debug', 'ember-metal/instrumentation', 'ember-metal/testing', 'ember-metal/error_handler', 'ember-metal/meta', 'ember-metal/error', 'ember-metal/cache', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/weak_map', 'ember-metal/events', 'ember-metal/is_none', 'ember-metal/is_empty', 'ember-metal/is_blank', 'ember-metal/is_present', 'ember-metal/run_loop', 'ember-metal/observer_set', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/watch_key', 'ember-metal/chains', 'ember-metal/watch_path', 'ember-metal/watching', 'ember-metal/libraries', 'ember-metal/map', 'ember-metal/get_properties', 'ember-metal/set_properties', 'ember-metal/expand_properties', 'ember-metal/observer', 'ember-metal/mixin', 'ember-metal/binding', 'ember-metal/path_cache', 'ember-metal/injected_property', 'ember-metal/tags', 'ember-metal/replace', 'ember-metal/transaction', 'ember-metal/is_proxy', 'ember-metal/descriptor'], function (exports, _require, _emberMetalCore, _emberMetalComputed, _emberMetalAlias, _emberMetalMerge, _emberMetalDebug, _emberMetalInstrumentation, _emberMetalTesting, _emberMetalError_handler, _emberMetalMeta, _emberMetalError, _emberMetalCache, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalWeak_map, _emberMetalEvents, _emberMetalIs_none, _emberMetalIs_empty, _emberMetalIs_blank, _emberMetalIs_present, _emberMetalRun_loop, _emberMetalObserver_set, _emberMetalProperty_events, _emberMetalProperties, _emberMetalWatch_key, _emberMetalChains, _emberMetalWatch_path, _emberMetalWatching, _emberMetalLibraries, _emberMetalMap, _emberMetalGet_properties, _emberMetalSet_properties, _emberMetalExpand_properties, _emberMetalObserver, _emberMetalMixin, _emberMetalBinding, _emberMetalPath_cache, _emberMetalInjected_property, _emberMetalTags, _emberMetalReplace, _emberMetalTransaction, _emberMetalIs_proxy, _emberMetalDescriptor) { /** - @method _addBeforeObserver - @for Ember - @param obj - @param {String} path - @param {Object|Function} target - @param {Function|String} [method] - @deprecated - @private + @module ember + @submodule ember-metal */ - function _addBeforeObserver(obj, path, target, method) { - _emberMetalEvents.addListener(obj, beforeEvent(path), target, method); - _emberMetalWatching.watch(obj, path); - - return this; - } - - // Suspend observer during callback. - // - // This should only be used by the target of the observer - // while it is setting the observed path. + 'use strict'; - function _suspendObserver(obj, path, target, method, callback) { - return _emberMetalEvents.suspendListener(obj, changeEvent(path), target, method, callback); - } + exports.default = _emberMetalCore.default; + // reexports + exports.computed = _emberMetalComputed.default; + exports.cacheFor = _emberMetalComputed.cacheFor; + exports.ComputedProperty = _emberMetalComputed.ComputedProperty; + exports.alias = _emberMetalAlias.default; + exports.merge = _emberMetalMerge.default; + exports.assert = _emberMetalDebug.assert; + exports.info = _emberMetalDebug.info; + exports.warn = _emberMetalDebug.warn; + exports.debug = _emberMetalDebug.debug; + exports.deprecate = _emberMetalDebug.deprecate; + exports.deprecateFunc = _emberMetalDebug.deprecateFunc; + exports.runInDebug = _emberMetalDebug.runInDebug; + exports.setDebugFunction = _emberMetalDebug.setDebugFunction; + exports.getDebugFunction = _emberMetalDebug.getDebugFunction; + exports.debugSeal = _emberMetalDebug.debugSeal; + exports.debugFreeze = _emberMetalDebug.debugFreeze; + exports.instrument = _emberMetalInstrumentation.instrument; + exports.flaggedInstrument = _emberMetalInstrumentation.flaggedInstrument; + exports._instrumentStart = _emberMetalInstrumentation._instrumentStart; + exports.instrumentationReset = _emberMetalInstrumentation.reset; + exports.instrumentationSubscribe = _emberMetalInstrumentation.subscribe; + exports.instrumentationUnsubscribe = _emberMetalInstrumentation.unsubscribe; + exports.isTesting = _emberMetalTesting.isTesting; + exports.setTesting = _emberMetalTesting.setTesting; + exports.getOnerror = _emberMetalError_handler.getOnerror; + exports.setOnerror = _emberMetalError_handler.setOnerror; + exports.dispatchError = _emberMetalError_handler.dispatchError; + exports.setDispatchOverride = _emberMetalError_handler.setDispatchOverride; + exports.META_DESC = _emberMetalMeta.META_DESC; + exports.meta = _emberMetalMeta.meta; + exports.peekMeta = _emberMetalMeta.peekMeta; + exports.Error = _emberMetalError.default; + exports.Cache = _emberMetalCache.default; + exports.isFeatureEnabled = _emberMetalFeatures.default; + exports.FEATURES = _emberMetalFeatures.FEATURES; + exports.DEFAULT_FEATURES = _emberMetalFeatures.DEFAULT_FEATURES; + exports._getPath = _emberMetalProperty_get._getPath; + exports.get = _emberMetalProperty_get.get; + exports.getWithDefault = _emberMetalProperty_get.getWithDefault; + exports.set = _emberMetalProperty_set.set; + exports.trySet = _emberMetalProperty_set.trySet; + exports.WeakMap = _emberMetalWeak_map.default; + exports.accumulateListeners = _emberMetalEvents.accumulateListeners; + exports.addListener = _emberMetalEvents.addListener; + exports.hasListeners = _emberMetalEvents.hasListeners; + exports.listenersFor = _emberMetalEvents.listenersFor; + exports.on = _emberMetalEvents.on; + exports.removeListener = _emberMetalEvents.removeListener; + exports.sendEvent = _emberMetalEvents.sendEvent; + exports.suspendListener = _emberMetalEvents.suspendListener; + exports.suspendListeners = _emberMetalEvents.suspendListeners; + exports.watchedEvents = _emberMetalEvents.watchedEvents; + exports.isNone = _emberMetalIs_none.default; + exports.isEmpty = _emberMetalIs_empty.default; + exports.isBlank = _emberMetalIs_blank.default; + exports.isPresent = _emberMetalIs_present.default; + exports.run = _emberMetalRun_loop.default; + exports.ObserverSet = _emberMetalObserver_set.default; + exports.beginPropertyChanges = _emberMetalProperty_events.beginPropertyChanges; + exports.changeProperties = _emberMetalProperty_events.changeProperties; + exports.endPropertyChanges = _emberMetalProperty_events.endPropertyChanges; + exports.overrideChains = _emberMetalProperty_events.overrideChains; + exports.propertyDidChange = _emberMetalProperty_events.propertyDidChange; + exports.propertyWillChange = _emberMetalProperty_events.propertyWillChange; + exports.PROPERTY_DID_CHANGE = _emberMetalProperty_events.PROPERTY_DID_CHANGE; + exports.defineProperty = _emberMetalProperties.defineProperty; + exports.Descriptor = _emberMetalProperties.Descriptor; + exports.watchKey = _emberMetalWatch_key.watchKey; + exports.unwatchKey = _emberMetalWatch_key.unwatchKey; + exports.ChainNode = _emberMetalChains.ChainNode; + exports.finishChains = _emberMetalChains.finishChains; + exports.removeChainWatcher = _emberMetalChains.removeChainWatcher; + exports.watchPath = _emberMetalWatch_path.watchPath; + exports.unwatchPath = _emberMetalWatch_path.unwatchPath; + exports.destroy = _emberMetalWatching.destroy; + exports.isWatching = _emberMetalWatching.isWatching; + exports.unwatch = _emberMetalWatching.unwatch; + exports.watch = _emberMetalWatching.watch; + exports.watcherCount = _emberMetalWatching.watcherCount; + exports.libraries = _emberMetalLibraries.default; + exports.Map = _emberMetalMap.Map; + exports.MapWithDefault = _emberMetalMap.MapWithDefault; + exports.OrderedSet = _emberMetalMap.OrderedSet; + exports.getProperties = _emberMetalGet_properties.default; + exports.setProperties = _emberMetalSet_properties.default; + exports.expandProperties = _emberMetalExpand_properties.default; + exports._suspendObserver = _emberMetalObserver._suspendObserver; + exports._suspendObservers = _emberMetalObserver._suspendObservers; + exports.addObserver = _emberMetalObserver.addObserver; + exports.observersFor = _emberMetalObserver.observersFor; + exports.removeObserver = _emberMetalObserver.removeObserver; + exports._addBeforeObserver = _emberMetalObserver._addBeforeObserver; + exports._removeBeforeObserver = _emberMetalObserver._removeBeforeObserver; + exports.Mixin = _emberMetalMixin.Mixin; + exports.aliasMethod = _emberMetalMixin.aliasMethod; + exports._immediateObserver = _emberMetalMixin._immediateObserver; + exports._beforeObserver = _emberMetalMixin._beforeObserver; + exports.mixin = _emberMetalMixin.mixin; + exports.observer = _emberMetalMixin.observer; + exports.required = _emberMetalMixin.required; + exports.REQUIRED = _emberMetalMixin.REQUIRED; + exports.hasUnprocessedMixins = _emberMetalMixin.hasUnprocessedMixins; + exports.clearUnprocessedMixins = _emberMetalMixin.clearUnprocessedMixins; + exports.detectBinding = _emberMetalMixin.detectBinding; + exports.Binding = _emberMetalBinding.Binding; + exports.bind = _emberMetalBinding.bind; + exports.isGlobalPath = _emberMetalPath_cache.isGlobalPath; + exports.InjectedProperty = _emberMetalInjected_property.default; + exports.setHasViews = _emberMetalTags.setHasViews; + exports.tagForProperty = _emberMetalTags.tagForProperty; + exports.tagFor = _emberMetalTags.tagFor; + exports.markObjectAsDirty = _emberMetalTags.markObjectAsDirty; + exports.replace = _emberMetalReplace.default; + exports.runInTransaction = _emberMetalTransaction.default; + exports.didRender = _emberMetalTransaction.didRender; + exports.assertNotRendered = _emberMetalTransaction.assertNotRendered; + exports.isProxy = _emberMetalIs_proxy.isProxy; + exports.descriptor = _emberMetalDescriptor.default; - function _suspendObservers(obj, paths, target, method, callback) { - var events = paths.map(changeEvent); - return _emberMetalEvents.suspendListeners(obj, events, target, method, callback); + // TODO: this needs to be deleted once we refactor the build tooling + // do this for side-effects of updating Ember.assert, warn, etc when + // ember-debug is present + // This needs to be called before any deprecateFunc + + if (_require.has('ember-debug')) { + _require.default('ember-debug'); } +}); +enifed('ember-metal/injected_property', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/properties'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalComputed, _emberMetalAlias, _emberMetalProperties) { + 'use strict'; + + exports.default = InjectedProperty; /** - @method removeBeforeObserver - @for Ember - @param obj - @param {String} path - @param {Object|Function} target - @param {Function|String} [method] - @deprecated + Read-only property that returns the result of a container lookup. + + @class InjectedProperty + @namespace Ember + @constructor + @param {String} type The container type the property will lookup + @param {String} name (optional) The name the property will lookup, defaults + to the property's name @private */ - function _removeBeforeObserver(obj, path, target, method) { - _emberMetalWatching.unwatch(obj, path); - _emberMetalEvents.removeListener(obj, beforeEvent(path), target, method); + function InjectedProperty(type, name) { + this.type = type; + this.name = name; - return this; + this._super$Constructor(injectedPropertyGet); + AliasedPropertyPrototype.oneWay.call(this); + } + + function injectedPropertyGet(keyName) { + var desc = this[keyName]; + var owner = _emberUtils.getOwner(this) || this.container; // fallback to `container` for backwards compat + + return owner.lookup(desc.type + ':' + (desc.name || keyName)); } + + InjectedProperty.prototype = Object.create(_emberMetalProperties.Descriptor.prototype); + + var InjectedPropertyPrototype = InjectedProperty.prototype; + var ComputedPropertyPrototype = _emberMetalComputed.ComputedProperty.prototype; + var AliasedPropertyPrototype = _emberMetalAlias.AliasedProperty.prototype; + + InjectedPropertyPrototype._super$Constructor = _emberMetalComputed.ComputedProperty; + + InjectedPropertyPrototype.get = ComputedPropertyPrototype.get; + InjectedPropertyPrototype.readOnly = ComputedPropertyPrototype.readOnly; + InjectedPropertyPrototype.teardown = ComputedPropertyPrototype.teardown; }); -enifed('ember-metal/observer_set', ['exports', 'ember-utils', 'ember-metal/events'], function (exports, _emberUtils, _emberMetalEvents) { +enifed('ember-metal/instrumentation', ['exports', 'ember-environment', 'ember-metal/features'], function (exports, _emberEnvironment, _emberMetalFeatures) { + /* eslint no-console:off */ + /* global console */ + 'use strict'; - exports.default = ObserverSet; + exports.instrument = instrument; + exports._instrumentStart = _instrumentStart; + exports.subscribe = subscribe; + exports.unsubscribe = unsubscribe; + exports.reset = reset; - /* - this.observerSet = { - [senderGuid]: { // variable name: `keySet` - [keyName]: listIndex - } - }, - this.observers = [ - { - sender: obj, - keyName: keyName, - eventName: eventName, - listeners: [ - [target, method, flags] - ] + /** + The purpose of the Ember Instrumentation module is + to provide efficient, general-purpose instrumentation + for Ember. + + Subscribe to a listener by using `Ember.subscribe`: + + ```javascript + Ember.subscribe("render", { + before(name, timestamp, payload) { + }, - ... - ] + + after(name, timestamp, payload) { + + } + }); + ``` + + If you return a value from the `before` callback, that same + value will be passed as a fourth parameter to the `after` + callback. + + Instrument a block of code by using `Ember.instrument`: + + ```javascript + Ember.instrument("render.handlebars", payload, function() { + // rendering logic + }, binding); + ``` + + Event names passed to `Ember.instrument` are namespaced + by periods, from more general to more specific. Subscribers + can listen for events by whatever level of granularity they + are interested in. + + In the above example, the event is `render.handlebars`, + and the subscriber listened for all events beginning with + `render`. It would receive callbacks for events named + `render`, `render.handlebars`, `render.container`, or + even `render.handlebars.layout`. + + @class Instrumentation + @namespace Ember + @static + @private */ + var subscribers = []; + exports.subscribers = subscribers; + var cache = {}; + + function populateListeners(name) { + var listeners = []; + var subscriber = undefined; + + for (var i = 0; i < subscribers.length; i++) { + subscriber = subscribers[i]; + if (subscriber.regex.test(name)) { + listeners.push(subscriber.object); + } + } - function ObserverSet() { - this.clear(); + cache[name] = listeners; + return listeners; } - ObserverSet.prototype.add = function (sender, keyName, eventName) { - var observerSet = this.observerSet; - var observers = this.observers; - var senderGuid = _emberUtils.guidFor(sender); - var keySet = observerSet[senderGuid]; - var index = undefined; + var time = (function () { + var perf = 'undefined' !== typeof window ? window.performance || {} : {}; + var fn = perf.now || perf.mozNow || perf.webkitNow || perf.msNow || perf.oNow; + // fn.bind will be available in all the browsers that support the advanced window.performance... ;-) + return fn ? fn.bind(perf) : function () { + return +new Date(); + }; + })(); + + /** + Notifies event's subscribers, calls `before` and `after` hooks. + + @method instrument + @namespace Ember.Instrumentation + + @param {String} [name] Namespaced event name. + @param {Object} _payload + @param {Function} callback Function that you're instrumenting. + @param {Object} binding Context that instrument function is called with. + @private + */ - if (!keySet) { - observerSet[senderGuid] = keySet = {}; + function instrument(name, _payload, callback, binding) { + if (arguments.length <= 3 && typeof _payload === 'function') { + binding = callback; + callback = _payload; + _payload = undefined; } - index = keySet[keyName]; - if (index === undefined) { - index = observers.push({ - sender: sender, - keyName: keyName, - eventName: eventName, - listeners: [] - }) - 1; - keySet[keyName] = index; + if (subscribers.length === 0) { + return callback.call(binding); } - return observers[index].listeners; - }; + var payload = _payload || {}; + var finalizer = _instrumentStart(name, function () { + return payload; + }); - ObserverSet.prototype.flush = function () { - var observers = this.observers; - var i = undefined, - observer = undefined, - sender = undefined; - this.clear(); - for (i = 0; i < observers.length; ++i) { - observer = observers[i]; - sender = observer.sender; - if (sender.isDestroying || sender.isDestroyed) { - continue; - } - _emberMetalEvents.sendEvent(sender, observer.eventName, [sender, observer.keyName], observer.listeners); + if (finalizer) { + return withFinalizer(callback, finalizer, payload, binding); + } else { + return callback.call(binding); } - }; + } - ObserverSet.prototype.clear = function () { - this.observerSet = {}; - this.observers = []; - }; -}); -enifed('ember-metal/path_cache', ['exports', 'ember-metal/cache'], function (exports, _emberMetalCache) { - 'use strict'; + var flaggedInstrument = undefined; + if (_emberMetalFeatures.default('ember-improved-instrumentation')) { + exports.flaggedInstrument = flaggedInstrument = instrument; + } else { + exports.flaggedInstrument = flaggedInstrument = function (name, payload, callback) { + return callback(); + }; + } + exports.flaggedInstrument = flaggedInstrument; - exports.isGlobal = isGlobal; - exports.isGlobalPath = isGlobalPath; - exports.hasThis = hasThis; - exports.isPath = isPath; - exports.getFirstKey = getFirstKey; - exports.getTailPath = getTailPath; + function withFinalizer(callback, finalizer, payload, binding) { + var result = undefined; + try { + result = callback.call(binding); + } catch (e) { + payload.exception = e; + result = payload; + } finally { + finalizer(); + } + return result; + } - var IS_GLOBAL = /^[A-Z$]/; - var IS_GLOBAL_PATH = /^[A-Z$].*[\.]/; - var HAS_THIS = 'this.'; + function NOOP() {} - var isGlobalCache = new _emberMetalCache.default(1000, function (key) { - return IS_GLOBAL.test(key); - }); - var isGlobalPathCache = new _emberMetalCache.default(1000, function (key) { - return IS_GLOBAL_PATH.test(key); - }); - var hasThisCache = new _emberMetalCache.default(1000, function (key) { - return key.lastIndexOf(HAS_THIS, 0) === 0; - }); - var firstDotIndexCache = new _emberMetalCache.default(1000, function (key) { - return key.indexOf('.'); - }); + // private for now - var firstKeyCache = new _emberMetalCache.default(1000, function (path) { - var index = firstDotIndexCache.get(path); - if (index === -1) { - return path; - } else { - return path.slice(0, index); + function _instrumentStart(name, _payload, _payloadParam) { + if (subscribers.length === 0) { + return NOOP; } - }); - var tailPathCache = new _emberMetalCache.default(1000, function (path) { - var index = firstDotIndexCache.get(path); - if (index !== -1) { - return path.slice(index + 1); - } - }); + var listeners = cache[name]; - var caches = { - isGlobalCache: isGlobalCache, - isGlobalPathCache: isGlobalPathCache, - hasThisCache: hasThisCache, - firstDotIndexCache: firstDotIndexCache, - firstKeyCache: firstKeyCache, - tailPathCache: tailPathCache - }; + if (!listeners) { + listeners = populateListeners(name); + } - exports.caches = caches; + if (listeners.length === 0) { + return NOOP; + } - function isGlobal(path) { - return isGlobalCache.get(path); - } + var payload = _payload(_payloadParam); - function isGlobalPath(path) { - return isGlobalPathCache.get(path); - } + var STRUCTURED_PROFILE = _emberEnvironment.ENV.STRUCTURED_PROFILE; + var timeName = undefined; + if (STRUCTURED_PROFILE) { + timeName = name + ': ' + payload.object; + console.time(timeName); + } - function hasThis(path) { - return hasThisCache.get(path); - } + var beforeValues = new Array(listeners.length); + var i = undefined, + listener = undefined; + var timestamp = time(); + for (i = 0; i < listeners.length; i++) { + listener = listeners[i]; + beforeValues[i] = listener.before(name, timestamp, payload); + } - function isPath(path) { - return firstDotIndexCache.get(path) !== -1; - } + return function _instrumentEnd() { + var i = undefined, + listener = undefined; + var timestamp = time(); + for (i = 0; i < listeners.length; i++) { + listener = listeners[i]; + if (typeof listener.after === 'function') { + listener.after(name, timestamp, payload, beforeValues[i]); + } + } - function getFirstKey(path) { - return firstKeyCache.get(path); + if (STRUCTURED_PROFILE) { + console.timeEnd(timeName); + } + }; } - function getTailPath(path) { - return tailPathCache.get(path); - } -}); -enifed('ember-metal/properties', ['exports', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/meta', 'ember-metal/property_events'], function (exports, _emberMetalDebug, _emberMetalFeatures, _emberMetalMeta, _emberMetalProperty_events) { /** - @module ember-metal + Subscribes to a particular event or instrumented block of code. + + @method subscribe + @namespace Ember.Instrumentation + + @param {String} [pattern] Namespaced event name. + @param {Object} [object] Before and After hooks. + + @return {Subscriber} + @private */ - 'use strict'; + function subscribe(pattern, object) { + var paths = pattern.split('.'); + var path = undefined; + var regex = []; - exports.Descriptor = Descriptor; - exports.MANDATORY_SETTER_FUNCTION = MANDATORY_SETTER_FUNCTION; - exports.DEFAULT_GETTER_FUNCTION = DEFAULT_GETTER_FUNCTION; - exports.INHERITING_GETTER_FUNCTION = INHERITING_GETTER_FUNCTION; - exports.defineProperty = defineProperty; + for (var i = 0; i < paths.length; i++) { + path = paths[i]; + if (path === '*') { + regex.push('[^\\.]*'); + } else { + regex.push(path); + } + } - // .......................................................... - // DESCRIPTOR - // + regex = regex.join('\\.'); + regex = regex + '(\\..*)?'; + + var subscriber = { + pattern: pattern, + regex: new RegExp('^' + regex + '$'), + object: object + }; + + subscribers.push(subscriber); + cache = {}; + + return subscriber; + } /** - Objects of this type can implement an interface to respond to requests to - get and set. The default implementation handles simple properties. + Unsubscribes from a particular event or instrumented block of code. - @class Descriptor + @method unsubscribe + @namespace Ember.Instrumentation + + @param {Object} [subscriber] @private */ - function Descriptor() { - this.isDescriptor = true; - } + function unsubscribe(subscriber) { + var index = undefined; - var REDEFINE_SUPPORTED = (function () { - // https://github.com/spalger/kibana/commit/b7e35e6737df585585332857a4c397dc206e7ff9 - var a = Object.create(Object.prototype, { - prop: { - configurable: true, - value: 1 + for (var i = 0; i < subscribers.length; i++) { + if (subscribers[i] === subscriber) { + index = i; } - }); + } - Object.defineProperty(a, 'prop', { - configurable: true, - value: 2 - }); - - return a.prop === 2; - })(); - // .......................................................... - // DEFINING PROPERTIES API - // - - function MANDATORY_SETTER_FUNCTION(name) { - function SETTER_FUNCTION(value) { - var m = _emberMetalMeta.peekMeta(this); - if (!m.isInitialized(this)) { - m.writeValues(name, value); - } else {} - } - - SETTER_FUNCTION.isMandatorySetter = true; - return SETTER_FUNCTION; + subscribers.splice(index, 1); + cache = {}; } - function DEFAULT_GETTER_FUNCTION(name) { - return function GETTER_FUNCTION() { - var meta = _emberMetalMeta.peekMeta(this); - return meta && meta.peekValues(name); - }; + /** + Resets `Ember.Instrumentation` by flushing list of subscribers. + + @method reset + @namespace Ember.Instrumentation + @private + */ + + function reset() { + subscribers.length = 0; + cache = {}; } +}); +enifed('ember-metal/is_blank', ['exports', 'ember-metal/is_empty'], function (exports, _emberMetalIs_empty) { + 'use strict'; - function INHERITING_GETTER_FUNCTION(name) { - function IGETTER_FUNCTION() { - var meta = _emberMetalMeta.peekMeta(this); - var val = meta && meta.readInheritedValue('values', name); + exports.default = isBlank; - if (val === _emberMetalMeta.UNDEFINED) { - var proto = Object.getPrototypeOf(this); - return proto && proto[name]; - } else { - return val; - } - } + /** + A value is blank if it is empty or a whitespace string. + + ```javascript + Ember.isBlank(); // true + Ember.isBlank(null); // true + Ember.isBlank(undefined); // true + Ember.isBlank(''); // true + Ember.isBlank([]); // true + Ember.isBlank('\n\t'); // true + Ember.isBlank(' '); // true + Ember.isBlank({}); // false + Ember.isBlank('\n\t Hello'); // false + Ember.isBlank('Hello world'); // false + Ember.isBlank([1,2,3]); // false + ``` + + @method isBlank + @for Ember + @param {Object} obj Value to test + @return {Boolean} + @since 1.5.0 + @public + */ - IGETTER_FUNCTION.isInheritingGetter = true; - return IGETTER_FUNCTION; + 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'; + + exports.default = isEmpty; /** - NOTE: This is a low-level method used by other parts of the API. You almost - never want to call this method directly. Instead you should use - `Ember.mixin()` to define new properties. - - Defines a property on an object. This method works much like the ES5 - `Object.defineProperty()` method except that it can also accept computed - properties and other special descriptors. - - Normally this method takes only three parameters. However if you pass an - instance of `Descriptor` as the third param then you can pass an - optional value as the fourth parameter. This is often more efficient than - creating new descriptor hashes for each property. + Verifies that a value is `null` or an empty string, empty array, + or empty function. - ## Examples + Constrains the rules on `Ember.isNone` by returning true for empty + string and empty arrays. ```javascript - // ES5 compatible mode - Ember.defineProperty(contact, 'firstName', { - writable: true, - configurable: false, - enumerable: true, - value: 'Charles' - }); - - // define a simple property - Ember.defineProperty(contact, 'lastName', undefined, 'Jolley'); - - // define a computed property - Ember.defineProperty(contact, 'fullName', Ember.computed('firstName', 'lastName', function() { - return this.firstName+' '+this.lastName; - })); + Ember.isEmpty(); // true + Ember.isEmpty(null); // true + Ember.isEmpty(undefined); // true + Ember.isEmpty(''); // true + Ember.isEmpty([]); // true + Ember.isEmpty({}); // false + Ember.isEmpty('Adam Hawkins'); // false + Ember.isEmpty([0,1,2]); // false + Ember.isEmpty('\n\t'); // false + Ember.isEmpty(' '); // false ``` - @private - @method defineProperty + @method isEmpty @for Ember - @param {Object} obj the object to define this property on. This may be a prototype. - @param {String} keyName the name of the property - @param {Descriptor} [desc] an instance of `Descriptor` (typically a - computed property) or an ES5 descriptor. - You must provide this or `data` but not both. - @param {*} [data] something other than a descriptor, that will - become the explicit value of this property. + @param {Object} obj Value to test + @return {Boolean} + @public */ - function defineProperty(obj, keyName, desc, data, meta) { - var possibleDesc = undefined, - existingDesc = undefined, - watching = undefined, - value = undefined; - - if (!meta) { - meta = _emberMetalMeta.meta(obj); + function isEmpty(obj) { + var none = _emberMetalIs_none.default(obj); + if (none) { + return none; } - var watchEntry = meta.peekWatching(keyName); - possibleDesc = obj[keyName]; - existingDesc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - watching = watchEntry !== undefined && watchEntry > 0; - if (existingDesc) { - existingDesc.teardown(obj, keyName); + if (typeof obj.size === 'number') { + return !obj.size; } - if (desc instanceof Descriptor) { - value = desc; - 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; - - 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; + var objectType = typeof obj; - // fallback to ES5 - Object.defineProperty(obj, keyName, desc); + if (objectType === 'object') { + var size = _emberMetalProperty_get.get(obj, 'size'); + if (typeof size === 'number') { + return !size; } } - // if key is being watched, override chains that - // were initialized with the prototype - if (watching) { - _emberMetalProperty_events.overrideChains(obj, keyName, meta); + if (typeof obj.length === 'number' && objectType !== 'function') { + return !obj.length; } - // The `value` passed to the `didDefineProperty` hook is - // either the descriptor or data, whichever was passed. - if (obj.didDefineProperty) { - obj.didDefineProperty(obj, keyName, value); + if (objectType === 'object') { + var _length = _emberMetalProperty_get.get(obj, 'length'); + if (typeof _length === 'number') { + return !_length; + } } - return this; + return false; } +}); +enifed("ember-metal/is_none", ["exports"], function (exports) { + /** + Returns true if the passed value is null or undefined. This avoids errors + from JSLint complaining about use of ==, which can be technically + confusing. + + ```javascript + Ember.isNone(); // true + Ember.isNone(null); // true + Ember.isNone(undefined); // true + Ember.isNone(''); // false + Ember.isNone([]); // false + Ember.isNone(function() {}); // false + ``` + + @method isNone + @for Ember + @param {Object} obj Value to test + @return {Boolean} + @public + */ + "use strict"; - function handleBrokenPhantomDefineProperty(obj, keyName, desc) { - // https://github.com/ariya/phantomjs/issues/11856 - Object.defineProperty(obj, keyName, { configurable: true, writable: true, value: 'iCry' }); - Object.defineProperty(obj, keyName, desc); + exports.default = isNone; + + function isNone(obj) { + return obj === null || obj === undefined; } }); -enifed('ember-metal/property_events', ['exports', 'ember-utils', 'ember-metal/meta', 'ember-metal/events', 'ember-metal/tags', 'ember-metal/observer_set', 'ember-metal/features', 'ember-metal/transaction'], function (exports, _emberUtils, _emberMetalMeta, _emberMetalEvents, _emberMetalTags, _emberMetalObserver_set, _emberMetalFeatures, _emberMetalTransaction) { +enifed('ember-metal/is_present', ['exports', 'ember-metal/is_blank'], function (exports, _emberMetalIs_blank) { 'use strict'; - var PROPERTY_DID_CHANGE = _emberUtils.symbol('PROPERTY_DID_CHANGE'); - - exports.PROPERTY_DID_CHANGE = PROPERTY_DID_CHANGE; - var beforeObserverSet = new _emberMetalObserver_set.default(); - var observerSet = new _emberMetalObserver_set.default(); - var deferred = 0; - - // .......................................................... - // PROPERTY CHANGES - // + exports.default = isPresent; /** - This function is called just before an object property is about to change. - It will notify any before observers and prepare caches among other things. + A value is present if it not `isBlank`. - Normally you will not need to call this method directly but if for some - reason you can't directly watch a property you can invoke this method - manually along with `Ember.propertyDidChange()` which you should call just - after the property value changes. + ```javascript + Ember.isPresent(); // false + Ember.isPresent(null); // false + Ember.isPresent(undefined); // false + Ember.isPresent(''); // false + Ember.isPresent(' '); // false + Ember.isPresent('\n\t'); // false + Ember.isPresent([]); // false + Ember.isPresent({ length: 0 }) // false + Ember.isPresent(false); // true + Ember.isPresent(true); // true + Ember.isPresent('string'); // true + Ember.isPresent(0); // true + Ember.isPresent(function() {}) // true + Ember.isPresent({}); // true + Ember.isPresent(false); // true + Ember.isPresent('\n\t Hello'); // true + Ember.isPresent([1,2,3]); // true + ``` - @method propertyWillChange + @method isPresent @for Ember - @param {Object} obj The object with the property that will change - @param {String} keyName The property key (or path) that will change. - @return {void} - @private + @param {Object} obj Value to test + @return {Boolean} + @since 1.8.0 + @public */ - function propertyWillChange(obj, keyName, _meta) { - var meta = _meta || _emberMetalMeta.peekMeta(obj); - if (meta && !meta.isInitialized(obj)) { - return; - } + function isPresent(obj) { + return !_emberMetalIs_blank.default(obj); + } +}); +enifed('ember-metal/is_proxy', ['exports', 'ember-metal/meta'], function (exports, _emberMetalMeta) { + 'use strict'; - var watching = meta && meta.peekWatching(keyName) > 0; - var possibleDesc = obj[keyName]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; + exports.isProxy = isProxy; - if (desc && desc.willChange) { - desc.willChange(obj, keyName); + function isProxy(value) { + if (typeof value === 'object' && value) { + var meta = _emberMetalMeta.peekMeta(value); + return meta && meta.isProxy(); } - if (watching) { - dependentKeysWillChange(obj, keyName, meta); - chainsWillChange(obj, keyName, meta); - notifyBeforeObservers(obj, keyName, meta); - } + return false; } +}); +enifed('ember-metal/libraries', ['exports', 'ember-metal/debug', 'ember-metal/features'], function (exports, _emberMetalDebug, _emberMetalFeatures) { + 'use strict'; /** - This function is called just after an object property has changed. - It will notify any observers and clear caches among other things. + Helper class that allows you to register your library with Ember. - Normally you will not need to call this method directly but if for some - reason you can't directly watch a property you can invoke this method - manually along with `Ember.propertyWillChange()` which you should call just - before the property value changes. + Singleton created at `Ember.libraries`. - @method propertyDidChange - @for Ember - @param {Object} obj The object with the property that will change - @param {String} keyName The property key (or path) that will change. - @param {Meta} meta The objects meta. - @return {void} + @class Libraries + @constructor @private */ - function propertyDidChange(obj, keyName, _meta) { - var meta = _meta || _emberMetalMeta.peekMeta(obj); - - if (meta && !meta.isInitialized(obj)) { - return; - } - - var watching = meta && meta.peekWatching(keyName) > 0; - var possibleDesc = obj[keyName]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - // shouldn't this mean that we're watching this key? - if (desc && desc.didChange) { - desc.didChange(obj, keyName); + var Libraries = (function () { + function Libraries() { + this._registry = []; + this._coreLibIndex = 0; } - if (watching) { - if (meta.hasDeps(keyName)) { - dependentKeysDidChange(obj, keyName, meta); - } + Libraries.prototype.isRegistered = function isRegistered(name) { + return !!this._getLibraryByName(name); + }; - chainsDidChange(obj, keyName, meta, false); - notifyObservers(obj, keyName, meta); - } + return Libraries; + })(); - if (obj[PROPERTY_DID_CHANGE]) { - obj[PROPERTY_DID_CHANGE](keyName); - } + exports.Libraries = Libraries; - if (meta && meta.isSourceDestroying()) { - return; - } + Libraries.prototype = { + constructor: Libraries, - _emberMetalTags.markObjectAsDirty(meta, keyName); + _getLibraryByName: function (name) { + var libs = this._registry; + var count = libs.length; - if (false || true) { - _emberMetalTransaction.assertNotRendered(obj, keyName, meta); - } - } + for (var i = 0; i < count; i++) { + if (libs[i].name === name) { + return libs[i]; + } + } + }, - var WILL_SEEN = undefined, - DID_SEEN = undefined; - // called whenever a property is about to change to clear the cache of any dependent keys (and notify those properties of changes, etc...) - function dependentKeysWillChange(obj, depKey, meta) { - if (meta && meta.isSourceDestroying()) { - return; - } + register: function (name, version, isCoreLibrary) { + var index = this._registry.length; - if (meta && meta.hasDeps(depKey)) { - var seen = WILL_SEEN; - var _top = !seen; + if (!this._getLibraryByName(name)) { + if (isCoreLibrary) { + index = this._coreLibIndex++; + } + this._registry.splice(index, 0, { name: name, version: version }); + } else {} + }, - if (_top) { - seen = WILL_SEEN = {}; - } + registerCoreLibrary: function (name, version) { + this.register(name, version, true); + }, - iterDeps(propertyWillChange, obj, depKey, seen, meta); + deRegister: function (name) { + var lib = this._getLibraryByName(name); + var index = undefined; - if (_top) { - WILL_SEEN = null; + if (lib) { + index = this._registry.indexOf(lib); + this._registry.splice(index, 1); } } - } + }; - // called whenever a property has just changed to update dependent keys - function dependentKeysDidChange(obj, depKey, meta) { - if (meta && meta.isSourceDestroying()) { - return; - } + if (_emberMetalFeatures.default('ember-libraries-isregistered')) { + Libraries.prototype.isRegistered = function (name) { + return !!this._getLibraryByName(name); + }; + } - if (meta && meta.hasDeps(depKey)) { - var seen = DID_SEEN; - var _top2 = !seen; + exports.default = new Libraries(); +}); +enifed('ember-metal/map', ['exports', 'ember-utils'], function (exports, _emberUtils) { + /** + @module ember + @submodule ember-metal + */ - if (_top2) { - seen = DID_SEEN = {}; - } + /* + 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'; - iterDeps(propertyDidChange, obj, depKey, seen, meta); + function missingFunction(fn) { + throw new TypeError(Object.prototype.toString.call(fn) + ' is not a function'); + } - if (_top2) { - DID_SEEN = null; - } - } + function missingNew(name) { + throw new TypeError('Constructor ' + name + ' requires \'new\''); } - function iterDeps(method, obj, depKey, seen, meta) { - var possibleDesc = undefined, - desc = undefined; - var guid = _emberUtils.guidFor(obj); - var current = seen[guid]; + function copyNull(obj) { + var output = new _emberUtils.EmptyObject(); - if (!current) { - current = seen[guid] = {}; + for (var prop in obj) { + // hasOwnPropery is not needed because obj is new EmptyObject(); + output[prop] = obj[prop]; } - if (current[depKey]) { - return; - } + return output; + } - current[depKey] = true; + function copyMap(original, newObject) { + var keys = original._keys.copy(); + var values = copyNull(original._values); - meta.forEachInDeps(depKey, function (key, value) { - if (!value) { - return; - } - - possibleDesc = obj[key]; - desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - if (desc && desc._suspended === obj) { - return; - } - - method(obj, key, meta); - }); - } - - function chainsWillChange(obj, keyName, meta) { - var chainWatchers = meta.readableChainWatchers(); - if (chainWatchers) { - chainWatchers.notify(keyName, false, propertyWillChange); - } - } - - function chainsDidChange(obj, keyName, meta) { - var chainWatchers = meta.readableChainWatchers(); - if (chainWatchers) { - chainWatchers.notify(keyName, true, propertyDidChange); - } - } - - function overrideChains(obj, keyName, meta) { - var chainWatchers = meta.readableChainWatchers(); - if (chainWatchers) { - chainWatchers.revalidate(keyName); - } - } + newObject._keys = keys; + newObject._values = values; + newObject.size = original.size; - /** - @method beginPropertyChanges - @chainable - @private - */ - function beginPropertyChanges() { - deferred++; + return newObject; } /** - @method endPropertyChanges + This class is used internally by Ember and Ember Data. + Please do not use it at this time. We plan to clean it up + and add many tests soon. + + @class OrderedSet + @namespace Ember + @constructor @private */ - function endPropertyChanges() { - deferred--; - if (deferred <= 0) { - beforeObserverSet.clear(); - observerSet.flush(); + function OrderedSet() { + if (this instanceof OrderedSet) { + this.clear(); + this._silenceRemoveDeprecation = false; + } else { + missingNew('OrderedSet'); } } /** - Make a series of property changes together in an - exception-safe way. - - ```javascript - Ember.changeProperties(function() { - obj1.set('foo', mayBlowUpWhenSet); - obj2.set('bar', baz); - }); - ``` - - @method changeProperties - @param {Function} callback - @param [binding] + @method create + @static + @return {Ember.OrderedSet} @private */ - function changeProperties(callback, binding) { - beginPropertyChanges(); - try { - callback.call(binding); - } finally { - endPropertyChanges.call(binding); - } - } - - function notifyBeforeObservers(obj, keyName, meta) { - if (meta && meta.isSourceDestroying()) { - return; - } - - var eventName = keyName + ':before'; - var listeners = undefined, - added = undefined; - if (deferred) { - listeners = beforeObserverSet.add(obj, keyName, eventName); - added = _emberMetalEvents.accumulateListeners(obj, eventName, listeners); - _emberMetalEvents.sendEvent(obj, eventName, [obj, keyName], added); - } else { - _emberMetalEvents.sendEvent(obj, eventName, [obj, keyName]); - } - } - - function notifyObservers(obj, keyName, meta) { - if (meta && meta.isSourceDestroying()) { - return; - } + OrderedSet.create = function () { + var Constructor = this; - var eventName = keyName + ':change'; - var listeners = undefined; - if (deferred) { - listeners = observerSet.add(obj, keyName, eventName); - _emberMetalEvents.accumulateListeners(obj, eventName, listeners); - } else { - _emberMetalEvents.sendEvent(obj, eventName, [obj, keyName]); - } - } + return new Constructor(); + }; - exports.propertyWillChange = propertyWillChange; - exports.propertyDidChange = propertyDidChange; - exports.overrideChains = overrideChains; - exports.beginPropertyChanges = beginPropertyChanges; - exports.endPropertyChanges = endPropertyChanges; - exports.changeProperties = changeProperties; -}); -enifed('ember-metal/property_get', ['exports', 'ember-metal/debug', 'ember-metal/path_cache'], function (exports, _emberMetalDebug, _emberMetalPath_cache) { - /** - @module ember-metal - */ + OrderedSet.prototype = { + constructor: OrderedSet, + /** + @method clear + @private + */ + clear: function () { + this.presenceSet = new _emberUtils.EmptyObject(); + this.list = []; + this.size = 0; + }, - 'use strict'; + /** + @method add + @param obj + @param guid (optional, and for internal use) + @return {Ember.OrderedSet} + @private + */ + add: function (obj, _guid) { + var guid = _guid || _emberUtils.guidFor(obj); + var presenceSet = this.presenceSet; + var list = this.list; - exports.get = get; - exports._getPath = _getPath; - exports.getWithDefault = getWithDefault; + if (presenceSet[guid] !== true) { + presenceSet[guid] = true; + this.size = list.push(obj); + } - var ALLOWABLE_TYPES = { - object: true, - function: true, - string: true - }; + return this; + }, - // .......................................................... - // 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 - // object. + /** + @since 1.8.0 + @method delete + @param obj + @param _guid (optional and for internal use only) + @return {Boolean} + @private + */ + delete: function (obj, _guid) { + var guid = _guid || _emberUtils.guidFor(obj); + var presenceSet = this.presenceSet; + var list = this.list; - /** - Gets the value of a property on an object. If the property is computed, - the function will be invoked. If the property is not defined but the - object implements the `unknownProperty` method then that will be invoked. - - ```javascript - Ember.get(obj, "name"); - ``` - - If you plan to run on IE8 and older browsers then you should use this - method anytime you want to retrieve a property on an object that you don't - know for sure is private. (Properties beginning with an underscore '_' - are considered private.) - - On all newer browsers, you only need to use this method to retrieve - properties if the property might not be defined on the object and you want - to respect the `unknownProperty` handler. Otherwise you can ignore this - method. - - Note that if the object itself is `undefined`, this method will throw - an error. - - @method get - @for Ember - @param {Object} obj The object to retrieve from. - @param {String} keyName The property key to retrieve - @return {Object} the property value or `null`. - @public - */ + if (presenceSet[guid] === true) { + delete presenceSet[guid]; + var index = list.indexOf(obj); + if (index > -1) { + list.splice(index, 1); + } + this.size = list.length; + return true; + } else { + return false; + } + }, - function get(obj, keyName) { + /** + @method isEmpty + @return {Boolean} + @private + */ + isEmpty: function () { + return this.size === 0; + }, - var value = obj[keyName]; - var desc = value !== null && typeof value === 'object' && value.isDescriptor ? value : undefined; - var ret = undefined; + /** + @method has + @param obj + @return {Boolean} + @private + */ + has: function (obj) { + if (this.size === 0) { + return false; + } - if (desc === undefined && _emberMetalPath_cache.isPath(keyName)) { - return _getPath(obj, keyName); - } + var guid = _emberUtils.guidFor(obj); + var presenceSet = this.presenceSet; - if (desc) { - return desc.get(obj, keyName); - } else { - ret = value; + return presenceSet[guid] === true; + }, - if (ret === undefined && 'object' === typeof obj && !(keyName in obj) && 'function' === typeof obj.unknownProperty) { - return obj.unknownProperty(keyName); + /** + @method forEach + @param {Function} fn + @param self + @private + */ + forEach: function (fn /*, ...thisArg*/) { + if (typeof fn !== 'function') { + missingFunction(fn); } - return ret; - } - } + if (this.size === 0) { + return; + } - function _getPath(root, path) { - var obj = root; - var parts = path.split('.'); + var list = this.list; - for (var i = 0; i < parts.length; i++) { - if (!isGettable(obj)) { - return undefined; + if (arguments.length === 2) { + for (var i = 0; i < list.length; i++) { + fn.call(arguments[1], list[i]); + } + } else { + for (var i = 0; i < list.length; i++) { + fn(list[i]); + } } + }, - obj = get(obj, parts[i]); + /** + @method toArray + @return {Array} + @private + */ + toArray: function () { + return this.list.slice(); + }, - if (obj && obj.isDestroyed) { - return undefined; - } - } + /** + @method copy + @return {Ember.OrderedSet} + @private + */ + copy: function () { + var Constructor = this.constructor; + var set = new Constructor(); - return obj; - } + set._silenceRemoveDeprecation = this._silenceRemoveDeprecation; + set.presenceSet = copyNull(this.presenceSet); + set.list = this.toArray(); + set.size = this.size; - function isGettable(obj) { - if (obj == null) { - return false; + return set; } - - return ALLOWABLE_TYPES[typeof obj]; - } + }; /** - Retrieves the value of a property from an Object, or a default value in the - case that the property returns `undefined`. + A Map stores values indexed by keys. Unlike JavaScript's + default Objects, the keys of a Map can be any JavaScript + object. - ```javascript - Ember.getWithDefault(person, 'lastName', 'Doe'); - ``` + Internally, a Map has two data structures: - @method getWithDefault - @for Ember - @param {Object} obj The object to retrieve from. - @param {String} keyName The name of the property to retrieve - @param {Object} defaultValue The value to return if the property value is undefined - @return {Object} The property value or the defaultValue. - @public + 1. `keys`: an OrderedSet of all of the existing keys + 2. `values`: a JavaScript Object indexed by the `Ember.guidFor(key)` + + When a key/value pair is added for the first time, we + add the key to the `keys` OrderedSet, and create or + replace an entry in `values`. When an entry is deleted, + we delete its entry in `keys` and `values`. + + @class Map + @namespace Ember + @private + @constructor */ - - function getWithDefault(root, key, defaultValue) { - var value = get(root, key); - - if (value === undefined) { - return defaultValue; + function Map() { + if (this instanceof Map) { + this._keys = OrderedSet.create(); + this._keys._silenceRemoveDeprecation = true; + this._values = new _emberUtils.EmptyObject(); + this.size = 0; + } else { + missingNew('Map'); } - return value; } - exports.default = get; -}); -enifed('ember-metal/property_set', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_events', 'ember-metal/error', 'ember-metal/path_cache', 'ember-metal/meta'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_events, _emberMetalError, _emberMetalPath_cache, _emberMetalMeta) { - 'use strict'; - - exports.set = set; - exports.trySet = trySet; - /** - 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. - - ```javascript - Ember.set(obj, "name", value); - ``` - - @method set - @for Ember - @param {Object} obj The object to modify. - @param {String} keyName The property key to set - @param {Object} value The value to set - @return {Object} the passed value. - @public + @method create + @static + @private */ + Map.create = function () { + var Constructor = this; + return new Constructor(); + }; - function set(obj, keyName, value, tolerant) { - - if (_emberMetalPath_cache.isPath(keyName)) { - return setPath(obj, keyName, value, tolerant); - } - - var meta = _emberMetalMeta.peekMeta(obj); - var possibleDesc = obj[keyName]; - - var desc = undefined, - currentValue = undefined; - if (possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor) { - desc = possibleDesc; - } else { - currentValue = possibleDesc; - } + Map.prototype = { + constructor: Map, - if (desc) { - /* computed property */ - desc.set(obj, keyName, value); - } else if (obj.setUnknownProperty && currentValue === undefined && !(keyName in obj)) { - obj.setUnknownProperty(keyName, value); - /* unknown property */ - } else if (currentValue === value) { - /* no change */ - return value; - } else { - _emberMetalProperty_events.propertyWillChange(obj, keyName); + /** + This property will change as the number of objects in the map changes. + @since 1.8.0 + @property size + @type number + @default 0 + @private + */ + size: 0, - if (false) { - setWithMandatorySetter(meta, obj, keyName, value); - } else { - obj[keyName] = value; + /** + Retrieve the value associated with a given key. + @method get + @param {*} key + @return {*} the value associated with the key, or `undefined` + @private + */ + get: function (key) { + if (this.size === 0) { + return; } - _emberMetalProperty_events.propertyDidChange(obj, keyName); - } + var values = this._values; + var guid = _emberUtils.guidFor(key); - return value; - } + return values[guid]; + }, - 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; - } - }; + /** + Adds a value to the map. If a value for the given key has already been + provided, the new value will replace the old value. + @method set + @param {*} key + @param {*} value + @return {Ember.Map} + @private + */ + set: function (key, value) { + var keys = this._keys; + var values = this._values; + var guid = _emberUtils.guidFor(key); - var makeEnumerable = function (obj, key) { - var desc = Object.getOwnPropertyDescriptor(obj, key); + // ensure we don't store -0 + var k = key === -0 ? 0 : key; - if (desc && desc.set && desc.set.isMandatorySetter) { - desc.enumerable = true; - Object.defineProperty(obj, key, desc); - } - }; - } + keys.add(k, guid); - function setPath(root, path, value, tolerant) { - // get the last part of the path - var keyName = path.slice(path.lastIndexOf('.') + 1); + values[guid] = value; - // get the first part of the part - path = path === keyName ? keyName : path.slice(0, path.length - (keyName.length + 1)); + this.size = keys.size; - // unless the path is this, look up the first part to - // get the root - if (path !== 'this') { - root = _emberMetalProperty_get._getPath(root, path); - } + return this; + }, - if (!keyName || keyName.length === 0) { - throw new _emberMetalError.default('Property set failed: You passed an empty path'); - } + /** + Removes a value from the map for an associated key. + @since 1.8.0 + @method delete + @param {*} key + @return {Boolean} true if an item was removed, false otherwise + @private + */ + delete: function (key) { + if (this.size === 0) { + return false; + } + // don't use ES6 "delete" because it will be annoying + // to use in browsers that are not ES6 friendly; + var keys = this._keys; + var values = this._values; + var guid = _emberUtils.guidFor(key); - if (!root) { - if (tolerant) { - return; + if (keys.delete(key, guid)) { + delete values[guid]; + this.size = keys.size; + return true; } else { - throw new _emberMetalError.default('Property set failed: object in path "' + path + '" could not be found or was destroyed.'); + return false; } - } - - return set(root, keyName, value); - } - - /** - Error-tolerant form of `Ember.set`. Will not blow up if any part of the - chain is `undefined`, `null`, or destroyed. - - This is primarily used when syncing bindings, which may try to update after - an object has been destroyed. - - @method trySet - @for Ember - @param {Object} root The object to modify. - @param {String} path The property path to set - @param {Object} value The value to set - @public - */ - - function trySet(root, path, value) { - return set(root, path, value, true); - } -}); -enifed("ember-metal/replace", ["exports"], function (exports) { - "use strict"; - - exports.default = replace; - var splice = Array.prototype.splice; + }, - 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; - var ends = amt; - var count = undefined, - chunk = undefined; + /** + Check whether a key is present. + @method has + @param {*} key + @return {Boolean} true if the item was present, false otherwise + @private + */ + has: function (key) { + return this._keys.has(key); + }, - while (args.length) { - count = ends > size ? size : ends; - if (count <= 0) { - count = 0; + /** + Iterate over all the keys and values. Calls the function once + for each key, passing in value, key, and the map being iterated over, + in that order. + The keys are guaranteed to be iterated over in insertion order. + @method forEach + @param {Function} callback + @param {*} self if passed, the `this` value inside the + callback. By default, `this` is the map. + @private + */ + forEach: function (callback /*, ...thisArg*/) { + if (typeof callback !== 'function') { + missingFunction(callback); } - chunk = args.splice(0, size); - chunk = [start, count].concat(chunk); - - start += size; - ends -= count; - - ret = ret.concat(splice.apply(array, chunk)); - } - return ret; - } -}); -enifed('ember-metal/run_loop', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/testing', 'ember-metal/error_handler', 'ember-metal/property_events', 'backburner'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalTesting, _emberMetalError_handler, _emberMetalProperty_events, _backburner) { - 'use strict'; - - exports.default = run; + if (this.size === 0) { + return; + } - function onBegin(current) { - run.currentRunLoop = current; - } + var map = this; + var cb = undefined, + thisArg = undefined; - function onEnd(current, next) { - run.currentRunLoop = next; - } + if (arguments.length === 2) { + thisArg = arguments[1]; + cb = function (key) { + return callback.call(thisArg, map.get(key), key, map); + }; + } else { + cb = function (key) { + return callback(map.get(key), key, map); + }; + } - var onErrorTarget = { - get onerror() { - return _emberMetalError_handler.getOnerror(); + this._keys.forEach(cb); }, - set onerror(handler) { - return _emberMetalError_handler.setOnerror(handler); - } - }; - var backburner = new _backburner.default(['sync', 'actions', 'destroy'], { - GUID_KEY: _emberUtils.GUID_KEY, - sync: { - before: _emberMetalProperty_events.beginPropertyChanges, - after: _emberMetalProperty_events.endPropertyChanges + /** + @method clear + @private + */ + clear: function () { + this._keys.clear(); + this._values = new _emberUtils.EmptyObject(); + this.size = 0; }, - defaultQueue: 'actions', - onBegin: onBegin, - onEnd: onEnd, - onErrorTarget: onErrorTarget, - onErrorMethod: 'onerror' - }); - // .......................................................... - // run - this is ideally the only public API the dev sees - // + /** + @method copy + @return {Ember.Map} + @private + */ + copy: function () { + return copyMap(this, new Map()); + } + }; /** - Runs the passed target and method inside of a RunLoop, ensuring any - deferred actions including bindings and views updates are flushed at the - end. - - Normally you should not need to invoke this method yourself. However if - you are implementing raw event handlers when interfacing with other - libraries or plugins, you should probably wrap all of your code inside this - call. - - ```javascript - run(function() { - // code to be executed within a RunLoop - }); - ``` - - @class run + @class MapWithDefault @namespace Ember - @static + @extends Ember.Map + @private @constructor - @param {Object} [target] target of method to call - @param {Function|String} method Method to invoke. - May be a function or a string. If you pass a string - then it will be looked up on the passed target. - @param {Object} [args*] Any additional arguments you wish to pass to the method. - @return {Object} return value from invoking the passed function. - @public + @param [options] + @param {*} [options.defaultValue] */ - - function run() { - return backburner.run.apply(backburner, arguments); + function MapWithDefault(options) { + this._super$constructor(); + this.defaultValue = options.defaultValue; } /** - If no run-loop is present, it creates a new one. If a run loop is - present it will queue itself to run on the existing run-loops action - queue. - - Please note: This is not for normal usage, and should be used sparingly. - - If invoked when not within a run loop: - - ```javascript - run.join(function() { - // creates a new run-loop - }); - ``` - - Alternatively, if called within an existing run loop: - - ```javascript - run(function() { - // creates a new run-loop - run.join(function() { - // joins with the existing run-loop, and queues for invocation on - // the existing run-loops action queue. - }); - }); - ``` - - @method join - @namespace Ember - @param {Object} [target] target of method to call - @param {Function|String} method Method to invoke. - May be a function or a string. If you pass a string - then it will be looked up on the passed target. - @param {Object} [args*] Any additional arguments you wish to pass to the method. - @return {Object} Return value from invoking the passed function. Please note, - when called within an existing loop, no return value is possible. - @public - */ - run.join = function () { - return backburner.join.apply(backburner, arguments); - }; - - /** - Allows you to specify which context to call the specified function in while - adding the execution of that function to the Ember run loop. This ability - makes this method a great way to asynchronously integrate third-party libraries - into your Ember application. - - `run.bind` takes two main arguments, the desired context and the function to - invoke in that context. Any additional arguments will be supplied as arguments - to the function that is passed in. - - Let's use the creation of a TinyMCE component as an example. Currently, - TinyMCE provides a setup configuration option we can use to do some processing - after the TinyMCE instance is initialized but before it is actually rendered. - We can use that setup option to do some additional setup for our component. - The component itself could look something like the following: - - ```javascript - App.RichTextEditorComponent = Ember.Component.extend({ - initializeTinyMCE: Ember.on('didInsertElement', function() { - tinymce.init({ - selector: '#' + this.$().prop('id'), - setup: Ember.run.bind(this, this.setupEditor) - }); - }), - - setupEditor: function(editor) { - this.set('editor', editor); - - editor.on('change', function() { - console.log('content changed!'); - }); - } - }); - ``` - - In this example, we use Ember.run.bind to bind the setupEditor method to the - context of the App.RichTextEditorComponent and to have the invocation of that - method be safely handled and executed by the Ember run loop. - - @method bind - @namespace Ember - @param {Object} [target] target of method to call - @param {Function|String} method Method to invoke. - May be a function or a string. If you pass a string - then it will be looked up on the passed target. - @param {Object} [args*] Any additional arguments you wish to pass to the method. - @return {Function} returns a new function that will always have a particular context - @since 1.4.0 - @public + @method create + @static + @param [options] + @param {*} [options.defaultValue] + @return {Ember.MapWithDefault|Ember.Map} If options are passed, returns + `Ember.MapWithDefault` otherwise returns `Ember.Map` + @private */ - run.bind = function () { - for (var _len = arguments.length, curried = Array(_len), _key = 0; _key < _len; _key++) { - curried[_key] = arguments[_key]; + MapWithDefault.create = function (options) { + if (options) { + return new MapWithDefault(options); + } else { + return new Map(); } - - return function () { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - return run.join.apply(run, curried.concat(args)); - }; }; - run.backburner = backburner; - run.currentRunLoop = null; - run.queues = backburner.queueNames; + MapWithDefault.prototype = Object.create(Map.prototype); + MapWithDefault.prototype.constructor = MapWithDefault; + MapWithDefault.prototype._super$constructor = Map; + MapWithDefault.prototype._super$get = Map.prototype.get; /** - Begins a new RunLoop. Any deferred actions invoked after the begin will - be buffered until you invoke a matching call to `run.end()`. This is - a lower-level way to use a RunLoop instead of using `run()`. - - ```javascript - run.begin(); - // code to be executed within a RunLoop - run.end(); - ``` + Retrieve the value associated with a given key. - @method begin - @return {void} - @public + @method get + @param {*} key + @return {*} the value associated with the key, or the default value + @private */ - run.begin = function () { - backburner.begin(); - }; + MapWithDefault.prototype.get = function (key) { + var hasValue = this.has(key); - /** - Ends a RunLoop. This must be called sometime after you call - `run.begin()` to flush any deferred actions. This is a lower-level way - to use a RunLoop instead of using `run()`. - - ```javascript - run.begin(); - // code to be executed within a RunLoop - run.end(); - ``` - - @method end - @return {void} - @public - */ - run.end = function () { - backburner.end(); + if (hasValue) { + return this._super$get(key); + } else { + var defaultValue = this.defaultValue(key); + this.set(key, defaultValue); + return defaultValue; + } }; /** - Array of named queues. This array determines the order in which queues - are flushed at the end of the RunLoop. You can define your own queues by - simply adding the queue name to this array. Normally you should not need - to inspect or modify this property. - - @property queues - @type Array - @default ['sync', 'actions', 'destroy'] + @method copy + @return {Ember.MapWithDefault} @private */ + MapWithDefault.prototype.copy = function () { + var Constructor = this.constructor; + return copyMap(this, new Constructor({ + defaultValue: this.defaultValue + })); + }; + exports.default = Map; + exports.OrderedSet = OrderedSet; + exports.Map = Map; + exports.MapWithDefault = MapWithDefault; +}); +enifed('ember-metal/merge', ['exports'], function (exports) { /** - Adds the passed target/method and any optional arguments to the named - queue to be executed at the end of the RunLoop. If you have not already - started a RunLoop when calling this method one will be started for you - automatically. - - At the end of a RunLoop, any methods scheduled in this way will be invoked. - Methods will be invoked in an order matching the named queues defined in - the `run.queues` property. + Merge the contents of two objects together into the first object. ```javascript - run.schedule('sync', this, function() { - // this will be executed in the first RunLoop queue, when bindings are synced - console.log('scheduled on sync queue'); - }); - - run.schedule('actions', this, function() { - // this will be executed in the 'actions' queue, after bindings have synced. - console.log('scheduled on actions queue'); - }); - - // Note the functions will be run in order based on the run queues order. - // Output would be: - // scheduled on sync queue - // scheduled on actions queue + Ember.merge({ first: 'Tom' }, { last: 'Dale' }); // { first: 'Tom', last: 'Dale' } + var a = { first: 'Yehuda' }; + var b = { last: 'Katz' }; + Ember.merge(a, b); // a == { first: 'Yehuda', last: 'Katz' }, b == { last: 'Katz' } ``` - @method schedule - @param {String} queue The name of the queue to schedule against. - Default queues are 'sync' and 'actions' - @param {Object} [target] target object to use as the context when invoking a method. - @param {String|Function} method The method to invoke. If you pass a string it - will be resolved on the target object at the time the scheduled item is - invoked allowing you to change the target function. - @param {Object} [arguments*] Optional arguments to be passed to the queued method. - @return {*} Timer information for use in cancelling, see `run.cancel`. + @method merge + @for Ember + @param {Object} original The object to merge into + @param {Object} updates The object to copy properties from + @return {Object} @public */ - run.schedule = function () /* queue, target, method */{ + 'use strict'; - return backburner.schedule.apply(backburner, arguments); - }; + exports.default = merge; - // Used by global test teardown - run.hasScheduledTimers = function () { - return backburner.hasTimers(); - }; + function merge(original, updates) { + if (!updates || typeof updates !== 'object') { + return original; + } - // Used by global test teardown - run.cancelTimers = function () { - backburner.cancelTimers(); + var props = Object.keys(updates); + var prop = undefined; + + for (var i = 0; i < props.length; i++) { + prop = props[i]; + original[prop] = updates[prop]; + } + + return original; + } +}); +enifed('ember-metal/meta', ['exports', 'ember-utils', 'ember-metal/features', 'ember-metal/meta_listeners', 'ember-metal/debug', 'ember-metal/chains', 'require'], function (exports, _emberUtils, _emberMetalFeatures, _emberMetalMeta_listeners, _emberMetalDebug, _emberMetalChains, _require) { + 'no use strict'; + // Remove "use strict"; from transpiled module until + // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed + + exports.deleteMeta = deleteMeta; + exports.meta = meta; + + var counters = { + peekCalls: 0, + peekParentCalls: 0, + peekPrototypeWalks: 0, + setCalls: 0, + deleteCalls: 0, + metaCalls: 0, + metaInstantiated: 0 }; /** - Immediately flushes any events scheduled in the 'sync' queue. Bindings - use this queue so this method is a useful way to immediately force all - bindings in the application to sync. + @module ember-metal + */ + + /* + This declares several meta-programmed members on the Meta class. Such + meta! - You should call this method anytime you need any changed state to propagate - throughout the app immediately without repainting the UI (which happens - in the later 'render' queue added by the `ember-views` package). + In general, the `readable` variants will give you an object (if it + already exists) that you can read but should not modify. The + `writable` variants will give you a mutable object, and they will + create it if it didn't already exist. - ```javascript - run.sync(); - ``` + The following methods will get generated metaprogrammatically, and + I'm including them here for greppability: - @method sync - @return {void} - @private + writableCache, readableCache, writeWatching, + peekWatching, clearWatching, writeMixins, + peekMixins, clearMixins, writeBindings, + peekBindings, clearBindings, writeValues, + peekValues, clearValues, writeDeps, forEachInDeps + writableChainWatchers, readableChainWatchers, writableChains, + readableChains, writableTag, readableTag, writableTags, + readableTags */ - run.sync = function () { - if (backburner.currentInstance) { - backburner.currentInstance.queues.sync.flush(); - } + var members = { + cache: ownMap, + weak: ownMap, + watching: inheritedMap, + mixins: inheritedMap, + bindings: inheritedMap, + values: inheritedMap, + chainWatchers: ownCustomObject, + chains: inheritedCustomObject, + tag: ownCustomObject, + tags: ownMap }; - /** - Invokes the passed target/method and optional arguments after a specified - period of time. The last parameter of this method must always be a number - of milliseconds. - - You should use this method whenever you need to run some action after a - period of time instead of using `setTimeout()`. This method will ensure that - items that expire during the same script execution cycle all execute - together, which is often more efficient than using a real setTimeout. - - ```javascript - run.later(myContext, function() { - // code here will execute within a RunLoop in about 500ms with this == myContext - }, 500); - ``` - - @method later - @param {Object} [target] target of method to invoke - @param {Function|String} method The method to invoke. - If you pass a string it will be resolved on the - target at the time the method is invoked. - @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 () /*target, method*/{ - return backburner.later.apply(backburner, arguments); - }; + // FLAGS + var SOURCE_DESTROYING = 1 << 1; + var SOURCE_DESTROYED = 1 << 2; + var META_DESTROYED = 1 << 3; + var IS_PROXY = 1 << 4; - /** - Schedule a function to run one time during the current RunLoop. This is equivalent - to calling `scheduleOnce` with the "actions" queue. - - @method once - @param {Object} [target] The target of the method to invoke. - @param {Function|String} method The method to invoke. - If you pass a string it will be resolved on the - 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.once = function () { - for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; + if (false || true) { + members.lastRendered = ownMap; + if (_require.has('ember-debug')) { + //https://github.com/emberjs/ember.js/issues/14732 + members.lastRenderedReferenceMap = ownMap; + members.lastRenderedTemplateMap = ownMap; } + } - args.unshift('actions'); - return backburner.scheduleOnce.apply(backburner, args); - }; + var memberNames = Object.keys(members); + var META_FIELD = '__ember_meta__'; - /** - Schedules a function to run one time in a given queue of the current RunLoop. - Calling this method with the same queue/target/method combination will have - no effect (past the initial call). - - Note that although you can pass optional arguments these will not be - considered when looking for duplicates. New arguments will replace previous - calls. - - ```javascript - function sayHi() { - console.log('hi'); - } - - run(function() { - run.scheduleOnce('afterRender', myContext, sayHi); - run.scheduleOnce('afterRender', myContext, sayHi); - // sayHi will only be executed once, in the afterRender queue of the RunLoop - }); - ``` - - Also note that passing an anonymous function to `run.scheduleOnce` will - not prevent additional calls with an identical anonymous function from - scheduling the items multiple times, e.g.: - - ```javascript - function scheduleIt() { - run.scheduleOnce('actions', myContext, function() { - console.log('Closure'); - }); - } - - scheduleIt(); - scheduleIt(); - - // "Closure" will print twice, even though we're using `run.scheduleOnce`, - // because the function we pass to it is anonymous and won't match the - // previously scheduled operation. - ``` - - Available queues, and their order, can be found at `run.queues` - - @method scheduleOnce - @param {String} [queue] The name of the queue to schedule against. Default queues are 'sync' and 'actions'. - @param {Object} [target] The target of the method to invoke. - @param {Function|String} method The method to invoke. - If you pass a string it will be resolved on the - 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 () /*queue, target, method*/{ - return backburner.scheduleOnce.apply(backburner, arguments); - }; + var Meta = (function () { + function Meta(obj, parentMeta) { + + this._cache = undefined; + this._weak = undefined; + this._watching = undefined; + this._mixins = undefined; + this._bindings = undefined; + this._values = undefined; + this._deps = undefined; + this._chainWatchers = undefined; + this._chains = undefined; + this._tag = undefined; + this._tags = undefined; + + // initial value for all flags right now is false + // see FLAGS const for detailed list of flags used + this._flags = 0; + + // used only internally + this.source = obj; + + // when meta(obj).proto === obj, the object is intended to be only a + // prototype and doesn't need to actually be observable itself + this.proto = undefined; + + // The next meta in our inheritance chain. We (will) track this + // explicitly instead of using prototypical inheritance because we + // have detailed knowledge of how each property should really be + // inherited, and we can optimize it much better than JS runtimes. + this.parent = parentMeta; - /** - Schedules an item to run from within a separate run loop, after - control has been returned to the system. This is equivalent to calling - `run.later` with a wait time of 1ms. - - ```javascript - run.next(myContext, function() { - // code to be executed in the next run loop, - // which will be scheduled after the current one - }); - ``` - - Multiple operations scheduled with `run.next` will coalesce - into the same later run loop, along with any other operations - scheduled by `run.later` that expire right around the same - time that `run.next` operations will fire. - - Note that there are often alternatives to using `run.next`. - For instance, if you'd like to schedule an operation to happen - after all DOM element operations have completed within the current - run loop, you can make use of the `afterRender` run loop queue (added - by the `ember-views` package, along with the preceding `render` queue - where all the DOM element operations happen). - - Example: - - ```javascript - export default Ember.Component.extend({ - didInsertElement() { - this._super(...arguments); - run.scheduleOnce('afterRender', this, 'processChildElements'); - }, - - processChildElements() { - // ... do something with component's child component - // elements after they've finished rendering, which - // can't be done within this component's - // `didInsertElement` hook because that gets run - // before the child elements have been added to the DOM. + if (false || true) { + this._lastRendered = undefined; } - }); - ``` - - One benefit of the above approach compared to using `run.next` is - that you will be able to perform DOM/CSS operations before unprocessed - elements are rendered to the screen, which may prevent flickering or - other artifacts caused by delaying processing until after rendering. - - The other major benefit to the above approach is that `run.next` - introduces an element of non-determinism, which can make things much - harder to test, due to its reliance on `setTimeout`; it's much harder - to guarantee the order of scheduled operations when they are scheduled - outside of the current run loop, i.e. with `run.next`. - - @method next - @param {Object} [target] target of method to invoke - @param {Function|String} method The method to invoke. - If you pass a string it will be resolved on the - 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.next = function () { - for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { - args[_key4] = arguments[_key4]; - } - - args.push(1); - return backburner.later.apply(backburner, args); - }; - - /** - Cancels a scheduled item. Must be a value returned by `run.later()`, - `run.once()`, `run.scheduleOnce()`, `run.next()`, `run.debounce()`, or - `run.throttle()`. - - ```javascript - let runNext = run.next(myContext, function() { - // will not be executed - }); - - run.cancel(runNext); - - let runLater = run.later(myContext, function() { - // will not be executed - }, 500); - - run.cancel(runLater); - - let runScheduleOnce = run.scheduleOnce('afterRender', myContext, function() { - // will not be executed - }); - - run.cancel(runScheduleOnce); - - let runOnce = run.once(myContext, function() { - // will not be executed - }); - - run.cancel(runOnce); - - let throttle = run.throttle(myContext, function() { - // will not be executed - }, 1, false); - - run.cancel(throttle); - - let debounce = run.debounce(myContext, function() { - // will not be executed - }, 1); - - run.cancel(debounce); - - let debounceImmediate = run.debounce(myContext, function() { - // will be executed since we passed in true (immediate) - }, 100, true); - - // the 100ms delay until this method can be called again will be cancelled - run.cancel(debounceImmediate); - ``` - - @method cancel - @param {Object} timer Timer object to cancel - @return {Boolean} true if cancelled or false/undefined if it wasn't found - @public - */ - run.cancel = function (timer) { - return backburner.cancel(timer); - }; - /** - Delay calling the target method until the debounce period has elapsed - with no additional debounce calls. If `debounce` is called again before - the specified time has elapsed, the timer is reset and the entire period - must pass again before the target method is called. - - This method should be used when an event may be called multiple times - but the action should only be called once when the event is done firing. - A common example is for scroll events where you only want updates to - happen once scrolling has ceased. - - ```javascript - function whoRan() { - console.log(this.name + ' ran.'); - } - - let myContext = { name: 'debounce' }; - - run.debounce(myContext, whoRan, 150); - - // less than 150ms passes - run.debounce(myContext, whoRan, 150); - - // 150ms passes - // whoRan is invoked with context myContext - // console logs 'debounce ran.' one time. - ``` - - Immediate allows you to run the function immediately, but debounce - other calls for this function until the wait time has elapsed. If - `debounce` is called again before the specified time has elapsed, - the timer is reset and the entire period must pass again before - the method can be called again. - - ```javascript - function whoRan() { - console.log(this.name + ' ran.'); + this._initializeListeners(); } - - let myContext = { name: 'debounce' }; - - run.debounce(myContext, whoRan, 150, true); - - // console logs 'debounce ran.' one time immediately. - // 100ms passes - run.debounce(myContext, whoRan, 150, true); - - // 150ms passes and nothing else is logged to the console and - // the debouncee is no longer being watched - run.debounce(myContext, whoRan, 150, true); - - // console logs 'debounce ran.' one time immediately. - // 150ms passes and nothing else is logged to the console and - // the debouncee is no longer being watched - - ``` - - @method debounce - @param {Object} [target] target of method to invoke - @param {Function|String} method The method to invoke. - May be a function or a string. If you pass a string - then it will be looked up on the passed target. - @param {Object} [args*] Optional arguments to pass to the timeout. - @param {Number} wait Number of milliseconds to wait. - @param {Boolean} immediate Trigger the function on the leading instead - of the trailing edge of the wait interval. Defaults to false. - @return {Array} Timer information for use in cancelling, see `run.cancel`. - @public - */ - run.debounce = function () { - return backburner.debounce.apply(backburner, arguments); - }; - /** - Ensure that the target method is never called more frequently than - the specified spacing period. The target method is called immediately. - - ```javascript - function whoRan() { - console.log(this.name + ' ran.'); - } - - let myContext = { name: 'throttle' }; - - run.throttle(myContext, whoRan, 150); - // whoRan is invoked with context myContext - // console logs 'throttle ran.' - - // 50ms passes - run.throttle(myContext, whoRan, 150); - - // 50ms passes - run.throttle(myContext, whoRan, 150); - - // 150ms passes - run.throttle(myContext, whoRan, 150); - // whoRan is invoked with context myContext - // console logs 'throttle ran.' - ``` - - @method throttle - @param {Object} [target] target of method to invoke - @param {Function|String} method The method to invoke. - May be a function or a string. If you pass a string - then it will be looked up on the passed target. - @param {Object} [args*] Optional arguments to pass to the timeout. - @param {Number} spacing Number of milliseconds to space out requests. - @param {Boolean} immediate Trigger the function on the leading instead - of the trailing edge of the wait interval. Defaults to true. - @return {Array} Timer information for use in cancelling, see `run.cancel`. - @public - */ - run.throttle = function () { - return backburner.throttle.apply(backburner, arguments); - }; + Meta.prototype.isInitialized = function isInitialized(obj) { + return this.proto !== obj; + }; - /** - Add a new named queue after the specified queue. - - The queue to add will only be added once. - - @method _addQueue - @param {String} name the name of the queue to add. - @param {String} after the name of the queue to add after. - @private - */ - run._addQueue = function (name, after) { - if (run.queues.indexOf(name) === -1) { - run.queues.splice(run.queues.indexOf(after) + 1, 0, name); - } - }; -}); -enifed('ember-metal/set_properties', ['exports', 'ember-metal/property_events', 'ember-metal/property_set'], function (exports, _emberMetalProperty_events, _emberMetalProperty_set) { - 'use strict'; + Meta.prototype.destroy = function destroy() { + if (this.isMetaDestroyed()) { + return; + } - exports.default = setProperties; + // remove chainWatchers to remove circular references that would prevent GC + var nodes = undefined, + key = undefined, + nodeObject = undefined; + var node = this.readableChains(); + if (node) { + NODE_STACK.push(node); + // process tree + while (NODE_STACK.length > 0) { + node = NODE_STACK.pop(); + // push children + nodes = node._chains; + if (nodes) { + for (key in nodes) { + if (nodes[key] !== undefined) { + NODE_STACK.push(nodes[key]); + } + } + } - /** - Set a list of properties on an object. These properties are set inside - a single `beginPropertyChanges` and `endPropertyChanges` batch, so - observers will be buffered. - - ```javascript - let anObject = Ember.Object.create(); - - anObject.setProperties({ - firstName: 'Stanley', - lastName: 'Stuart', - age: 21 - }); - ``` - - @method setProperties - @param obj - @param {Object} properties - @return properties - @public - */ + // remove chainWatcher in node object + if (node._watching) { + nodeObject = node._object; + if (nodeObject) { + var foreignMeta = peekMeta(nodeObject); + // avoid cleaning up chain watchers when both current and + // foreign objects are being destroyed + // if both are being destroyed manual cleanup is not needed + // as they will be GC'ed and no non-destroyed references will + // be remaining + if (foreignMeta && !foreignMeta.isSourceDestroying()) { + _emberMetalChains.removeChainWatcher(nodeObject, node._key, node, foreignMeta); + } + } + } + } + } - function setProperties(obj, properties) { - if (!properties || typeof properties !== 'object') { - return properties; - } - _emberMetalProperty_events.changeProperties(function () { - var props = Object.keys(properties); - var propertyName = undefined; + this.setMetaDestroyed(); + }; - for (var i = 0; i < props.length; i++) { - propertyName = props[i]; + Meta.prototype.isSourceDestroying = function isSourceDestroying() { + return (this._flags & SOURCE_DESTROYING) !== 0; + }; - _emberMetalProperty_set.set(obj, propertyName, properties[propertyName]); - } - }); - return properties; - } -}); -enifed('ember-metal/tags', ['exports', 'glimmer-reference', 'ember-metal/meta', 'require', 'ember-metal/is_proxy'], function (exports, _glimmerReference, _emberMetalMeta, _require, _emberMetalIs_proxy) { - 'use strict'; + Meta.prototype.setSourceDestroying = function setSourceDestroying() { + this._flags |= SOURCE_DESTROYING; + }; - exports.setHasViews = setHasViews; - exports.tagForProperty = tagForProperty; - exports.tagFor = tagFor; - exports.markObjectAsDirty = markObjectAsDirty; + Meta.prototype.isSourceDestroyed = function isSourceDestroyed() { + return (this._flags & SOURCE_DESTROYED) !== 0; + }; - var hasViews = function () { - return false; - }; + Meta.prototype.setSourceDestroyed = function setSourceDestroyed() { + this._flags |= SOURCE_DESTROYED; + }; - function setHasViews(fn) { - hasViews = fn; - } + Meta.prototype.isMetaDestroyed = function isMetaDestroyed() { + return (this._flags & META_DESTROYED) !== 0; + }; - function makeTag() { - return new _glimmerReference.DirtyableTag(); - } + Meta.prototype.setMetaDestroyed = function setMetaDestroyed() { + this._flags |= META_DESTROYED; + }; - function tagForProperty(object, propertyKey, _meta) { - if (_emberMetalIs_proxy.isProxy(object)) { - return tagFor(object, _meta); - } + Meta.prototype.isProxy = function isProxy() { + return (this._flags & IS_PROXY) !== 0; + }; - if (typeof object === 'object' && object) { - var meta = _meta || _emberMetalMeta.meta(object); - var tags = meta.writableTags(); - var tag = tags[propertyKey]; - if (tag) { - return tag; - } + Meta.prototype.setProxy = function setProxy() { + this._flags |= IS_PROXY; + }; - return tags[propertyKey] = makeTag(); - } else { - return _glimmerReference.CONSTANT_TAG; - } - } + Meta.prototype._getOrCreateOwnMap = function _getOrCreateOwnMap(key) { + return this[key] || (this[key] = new _emberUtils.EmptyObject()); + }; - function tagFor(object, _meta) { - if (typeof object === 'object' && object) { - var meta = _meta || _emberMetalMeta.meta(object); - return meta.writableTag(makeTag); - } else { - return _glimmerReference.CONSTANT_TAG; - } - } + Meta.prototype._getInherited = function _getInherited(key) { + var pointer = this; + while (pointer !== undefined) { + if (pointer[key]) { + return pointer[key]; + } + pointer = pointer.parent; + } + }; - function markObjectAsDirty(meta, propertyKey) { - var objectTag = meta && meta.readableTag(); + Meta.prototype._findInherited = function _findInherited(key, subkey) { + var pointer = this; + while (pointer !== undefined) { + var map = pointer[key]; + if (map) { + var value = map[subkey]; + if (value !== undefined) { + return value; + } + } + pointer = pointer.parent; + } + }; - if (objectTag) { - objectTag.dirty(); - } + // Implements a member that provides a lazily created map of maps, + // with inheritance at both levels. - var tags = meta && meta.readableTags(); - var propertyTag = tags && tags[propertyKey]; + Meta.prototype.writeDeps = function writeDeps(subkey, itemkey, value) { - if (propertyTag) { - propertyTag.dirty(); - } + var outerMap = this._getOrCreateOwnMap('_deps'); + var innerMap = outerMap[subkey]; + if (!innerMap) { + innerMap = outerMap[subkey] = new _emberUtils.EmptyObject(); + } + innerMap[itemkey] = value; + }; - if (objectTag || propertyTag) { - ensureRunloop(); - } - } + Meta.prototype.peekDeps = function peekDeps(subkey, itemkey) { + var pointer = this; + while (pointer !== undefined) { + var map = pointer._deps; + if (map) { + var value = map[subkey]; + if (value) { + if (value[itemkey] !== undefined) { + return value[itemkey]; + } + } + } + pointer = pointer.parent; + } + }; - var run = undefined; + Meta.prototype.hasDeps = function hasDeps(subkey) { + var pointer = this; + while (pointer !== undefined) { + if (pointer._deps && pointer._deps[subkey]) { + return true; + } + pointer = pointer.parent; + } + return false; + }; - function K() {} + Meta.prototype.forEachInDeps = function forEachInDeps(subkey, fn) { + return this._forEachIn('_deps', subkey, fn); + }; - function ensureRunloop() { - if (!run) { - run = _require.default('ember-metal/run_loop').default; - } + Meta.prototype._forEachIn = function _forEachIn(key, subkey, fn) { + var pointer = this; + var seen = new _emberUtils.EmptyObject(); + var calls = []; + while (pointer !== undefined) { + var map = pointer[key]; + if (map) { + var innerMap = map[subkey]; + if (innerMap) { + for (var innerKey in innerMap) { + if (!seen[innerKey]) { + seen[innerKey] = true; + calls.push([innerKey, innerMap[innerKey]]); + } + } + } + } + pointer = pointer.parent; + } + for (var i = 0; i < calls.length; i++) { + var _calls$i = calls[i]; + var innerKey = _calls$i[0]; + var value = _calls$i[1]; - if (hasViews() && !run.backburner.currentInstance) { - run.schedule('actions', K); - } - } -}); -enifed("ember-metal/testing", ["exports"], function (exports) { - "use strict"; + fn(innerKey, value); + } + }; - exports.isTesting = isTesting; - exports.setTesting = setTesting; - var testing = false; + Meta.prototype.readInheritedValue = function readInheritedValue(key, subkey) { + var internalKey = '_' + key; - function isTesting() { - return testing; - } + var pointer = this; - function setTesting(value) { - testing = !!value; - } -}); -enifed('ember-metal/transaction', ['exports', 'ember-metal/meta', 'ember-metal/debug', 'ember-metal/features'], function (exports, _emberMetalMeta, _emberMetalDebug, _emberMetalFeatures) { - 'use strict'; + 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; + } - var runInTransaction = undefined, - didRender = undefined, - assertNotRendered = undefined; + return UNDEFINED; + }; - var raise = _emberMetalDebug.assert; - if (true) { - raise = function (message, test) {}; + Meta.prototype.writeValue = function writeValue(obj, key, value) { + var descriptor = _emberUtils.lookupDescriptor(obj, key); + var isMandatorySetter = descriptor && descriptor.set && descriptor.set.isMandatorySetter; + + if (isMandatorySetter) { + this.writeValues(key, value); + } else { + obj[key] = value; + } + }; + + return Meta; + })(); + + exports.Meta = Meta; + + var NODE_STACK = []; + + for (var _name in _emberMetalMeta_listeners.protoMethods) { + Meta.prototype[_name] = _emberMetalMeta_listeners.protoMethods[_name]; } + memberNames.forEach(function (name) { + return members[name](name, Meta); + }); - var implication = undefined; - if (true) { - implication = 'will be removed in Ember 3.0.'; - } else if (false) { - implication = 'is no longer supported. See https://github.com/emberjs/ember.js/issues/13948 for more details.'; + // Implements a member that is a lazily created, non-inheritable + // POJO. + function ownMap(name, Meta) { + var key = memberProperty(name); + var capitalized = capitalize(name); + Meta.prototype['writable' + capitalized] = function () { + return this._getOrCreateOwnMap(key); + }; + Meta.prototype['readable' + capitalized] = function () { + return this[key]; + }; } - if (false || true) { - (function () { - var counter = 0; - var inTransaction = false; - var shouldReflush = undefined; + // Implements a member that is a lazily created POJO with inheritable + // values. + function inheritedMap(name, Meta) { + var key = memberProperty(name); + var capitalized = capitalize(name); - exports.default = runInTransaction = function (context, methodName) { - shouldReflush = false; - inTransaction = true; - context[methodName](); - inTransaction = false; - counter++; - return shouldReflush; - }; + Meta.prototype['write' + capitalized] = function (subkey, value) { - exports.didRender = didRender = function (object, key, reference) { - if (!inTransaction) { - return; + var map = this._getOrCreateOwnMap(key); + map[subkey] = value; + }; + + Meta.prototype['peek' + capitalized] = function (subkey) { + return this._findInherited(key, subkey); + }; + + Meta.prototype['forEach' + capitalized] = function (fn) { + var pointer = this; + var seen = new _emberUtils.EmptyObject(); + while (pointer !== undefined) { + var map = pointer[key]; + if (map) { + for (var _key in map) { + if (!seen[_key]) { + seen[_key] = true; + fn(_key, map[_key]); + } + } } - var meta = _emberMetalMeta.meta(object); - var lastRendered = meta.writableLastRendered(); - lastRendered[key] = counter; - }; + pointer = pointer.parent; + } + }; - exports.assertNotRendered = assertNotRendered = function (object, key, _meta) { - var meta = _meta || _emberMetalMeta.meta(object); - var lastRendered = meta.readableLastRendered(); + Meta.prototype['clear' + capitalized] = function () { - if (lastRendered && lastRendered[key] === counter) { - raise((function () { - var ref = meta.readableLastRenderedFrom(); - var parts = []; - var lastRef = ref[key]; + this[key] = undefined; + }; - var label = undefined; + Meta.prototype['deleteFrom' + capitalized] = function (subkey) { + delete this._getOrCreateOwnMap(key)[subkey]; + }; - if (lastRef) { - while (lastRef && lastRef._propertyKey) { - parts.unshift(lastRef._propertyKey); - lastRef = lastRef._parentReference; - } + Meta.prototype['hasIn' + capitalized] = function (subkey) { + return this._findInherited(key, subkey) !== undefined; + }; + } - label = parts.join(); - } else { - label = 'the same value'; - } + var UNDEFINED = _emberUtils.symbol('undefined'); - return 'You modified ' + parts.join('.') + ' twice on ' + object + ' in a single render. This was unreliable and slow in Ember 1.x and ' + implication; - })(), false); + exports.UNDEFINED = UNDEFINED; + // Implements a member that provides a non-heritable, lazily-created + // object using the method you provide. + function ownCustomObject(name, Meta) { + var key = memberProperty(name); + var capitalized = capitalize(name); + Meta.prototype['writable' + capitalized] = function (create) { - shouldReflush = true; - } - }; - })(); - } else { - exports.default = runInTransaction = function () { - throw new Error('Cannot call runInTransaction without Glimmer'); + var ret = this[key]; + if (!ret) { + ret = this[key] = create(this.source); + } + return ret; }; - - exports.didRender = didRender = function () { - throw new Error('Cannot call didRender without Glimmer'); + Meta.prototype['readable' + capitalized] = function () { + return this[key]; }; + } + + // Implements a member that provides an inheritable, lazily-created + // object using the method you provide. We will derived children from + // their parents by calling your object's `copy()` method. + function inheritedCustomObject(name, Meta) { + var key = memberProperty(name); + var capitalized = capitalize(name); + Meta.prototype['writable' + capitalized] = function (create) { - exports.assertNotRendered = assertNotRendered = function () { - throw new Error('Cannot call assertNotRendered without Glimmer'); + var ret = this[key]; + if (!ret) { + if (this.parent) { + ret = this[key] = this.parent['writable' + capitalized](create).copy(this.source); + } else { + ret = this[key] = create(this.source); + } + } + return ret; + }; + Meta.prototype['readable' + capitalized] = function () { + return this._getInherited(key); }; } - exports.default = runInTransaction; - exports.didRender = didRender; - exports.assertNotRendered = assertNotRendered; -}); -enifed('ember-metal/watch_key', ['exports', 'ember-utils', 'ember-metal/features', 'ember-metal/meta', 'ember-metal/properties'], function (exports, _emberUtils, _emberMetalFeatures, _emberMetalMeta, _emberMetalProperties) { - 'use strict'; + function memberProperty(name) { + return '_' + name; + } - exports.watchKey = watchKey; - exports.unwatchKey = unwatchKey; + // there's a more general-purpose capitalize in ember-runtime, but we + // don't want to make ember-metal depend on ember-runtime. + function capitalize(name) { + return name.replace(/^\w/, function (m) { + return m.toUpperCase(); + }); + } - var handleMandatorySetter = undefined; + var META_DESC = { + writable: true, + configurable: true, + enumerable: false, + value: null + }; - function watchKey(obj, keyName, meta) { - if (typeof obj !== 'object' || obj === null) { - return; - } - var m = meta || _emberMetalMeta.meta(obj); + exports.META_DESC = META_DESC; + var EMBER_META_PROPERTY = { + name: META_FIELD, + descriptor: META_DESC + }; - // activate watching first time - if (!m.peekWatching(keyName)) { - m.writeWatching(keyName, 1); + if (false) { + Meta.prototype.readInheritedValue = function (key, subkey) { + var internalKey = '_' + key; - var possibleDesc = obj[keyName]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - if (desc && desc.willWatch) { - desc.willWatch(obj, keyName); - } + var pointer = this; - if ('function' === typeof obj.willWatchProperty) { - obj.willWatchProperty(keyName); + 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; } - if (false) { - // NOTE: this is dropped for prod + minified builds - handleMandatorySetter(m, obj, keyName); + return UNDEFINED; + }; + + Meta.prototype.writeValue = function (obj, key, value) { + var descriptor = _emberUtils.lookupDescriptor(obj, key); + var isMandatorySetter = descriptor && descriptor.set && descriptor.set.isMandatorySetter; + + if (isMandatorySetter) { + this.writeValues(key, value); + } else { + obj[key] = value; } - } else { - m.writeWatching(keyName, (m.peekWatching(keyName) || 0) + 1); - } + }; } - if (false) { + var setMeta = undefined, + peekMeta = undefined; + + // choose the one appropriate for given platform + if (_emberUtils.HAS_NATIVE_WEAKMAP) { (function () { - var hasOwnProperty = function (obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); - }; + var getPrototypeOf = Object.getPrototypeOf; + var metaStore = new WeakMap(); - var propertyIsEnumerable = function (obj, key) { - return Object.prototype.propertyIsEnumerable.call(obj, key); + exports.setMeta = setMeta = function WeakMap_setMeta(obj, meta) { + metaStore.set(obj, meta); }; - // 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 = _emberUtils.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; + exports.peekMeta = peekMeta = function WeakMap_peekMeta(obj) { - if (isDescriptor) { - return; - } + return metaStore.get(obj); + }; - // 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 - }; + exports.peekMeta = peekMeta = function WeakMap_peekParentMeta(obj) { + var pointer = obj; + var meta = undefined; + while (pointer) { + meta = metaStore.get(pointer); + // jshint loopfunc:true - if (hasOwnProperty(obj, keyName)) { - m.writeValues(keyName, obj[keyName]); - desc.get = _emberMetalProperties.DEFAULT_GETTER_FUNCTION(keyName); - } else { - desc.get = _emberMetalProperties.INHERITING_GETTER_FUNCTION(keyName); + // stop if we find a `null` value, since + // that means the meta was deleted + // any other truthy value is a "real" meta + if (meta === null || meta) { + return meta; } - Object.defineProperty(obj, keyName, desc); + pointer = getPrototypeOf(pointer); } }; })(); - } - - function unwatchKey(obj, keyName, _meta) { - if (typeof obj !== 'object' || obj === null) { - return; - } - var meta = _meta || _emberMetalMeta.meta(obj); + } else { + exports.setMeta = setMeta = function Fallback_setMeta(obj, meta) { + // if `null` already, just set it to the new value + // otherwise define property first + if (obj[META_FIELD] !== null) { + if (obj.__defineNonEnumerable) { + obj.__defineNonEnumerable(EMBER_META_PROPERTY); + } else { + Object.defineProperty(obj, META_FIELD, META_DESC); + } + } - // do nothing of this object has already been destroyed - if (meta.isSourceDestroyed()) { - return; - } + obj[META_FIELD] = meta; + }; - var count = meta.peekWatching(keyName); - if (count === 1) { - meta.writeWatching(keyName, 0); + exports.peekMeta = peekMeta = function Fallback_peekMeta(obj) { + return obj[META_FIELD]; + }; + } - var possibleDesc = obj[keyName]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; + function deleteMeta(obj) { - if (desc && desc.didUnwatch) { - desc.didUnwatch(obj, keyName); - } + var meta = peekMeta(obj); + if (meta) { + meta.destroy(); + } + } - if ('function' === typeof obj.didUnwatchProperty) { - obj.didUnwatchProperty(keyName); - } + /** + Retrieves the meta hash for an object. If `writable` is true ensures the + hash is writable for this object as well. + + The meta object contains information about computed property descriptors as + well as any watched properties and other information. You generally will + not access this information directly but instead work with higher level + methods that manipulate this hash indirectly. + + @method meta + @for Ember + @private + + @param {Object} obj The object to retrieve meta for + @param {Boolean} [writable=true] Pass `false` if you do not intend to modify + the meta hash, allowing the method to avoid making an unnecessary copy. + @return {Object} the meta hash for an object + */ - 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 = _emberUtils.lookupDescriptor(obj, keyName); + function meta(obj) { - if (maybeMandatoryDescriptor.set && maybeMandatoryDescriptor.set.isMandatorySetter) { - if (maybeMandatoryDescriptor.get && maybeMandatoryDescriptor.get.isInheritingGetter) { - var possibleValue = meta.readInheritedValue('values', keyName); - if (possibleValue === _emberMetalMeta.UNDEFINED) { - delete obj[keyName]; - return; - } - } + var maybeMeta = peekMeta(obj); + var parent = undefined; - Object.defineProperty(obj, keyName, { - configurable: true, - enumerable: Object.prototype.propertyIsEnumerable.call(obj, keyName), - writable: true, - value: meta.peekValues(keyName) - }); - meta.deleteFromValues(keyName); - } - } + // remove this code, in-favor of explicit parent + if (maybeMeta) { + if (maybeMeta.source === obj) { + return maybeMeta; } - } else if (count > 1) { - meta.writeWatching(keyName, count - 1); + parent = maybeMeta; } + + var newMeta = new Meta(obj, parent); + setMeta(obj, newMeta); + return newMeta; } + + exports.peekMeta = peekMeta; + exports.setMeta = setMeta; + exports.counters = counters; }); -enifed('ember-metal/watch_path', ['exports', 'ember-metal/meta', 'ember-metal/chains'], function (exports, _emberMetalMeta, _emberMetalChains) { +enifed('ember-metal/meta_listeners', ['exports'], function (exports) { + /* + When we render a rich template hierarchy, the set of events that + *might* happen tends to be much larger than the set of events that + actually happen. This implies that we should make listener creation & + destruction cheap, even at the cost of making event dispatch more + expensive. + + Thus we store a new listener with a single push and no new + allocations, without even bothering to do deduplication -- we can + save that for dispatch time, if an event actually happens. + */ + + /* listener flags */ 'use strict'; - exports.makeChainNode = makeChainNode; - exports.watchPath = watchPath; - exports.unwatchPath = unwatchPath; + var ONCE = 1; + exports.ONCE = ONCE; + var SUSPENDED = 2; - // get the chains for the current object. If the current object has - // chains inherited from the proto they will be cloned and reconfigured for - // the current object. - function chainsFor(obj, meta) { - return (meta || _emberMetalMeta.meta(obj)).writableChains(makeChainNode); - } + exports.SUSPENDED = SUSPENDED; + var protoMethods = { - function makeChainNode(obj) { - return new _emberMetalChains.ChainNode(null, null, obj); - } + addToListeners: function (eventName, target, method, flags) { + if (!this._listeners) { + this._listeners = []; + } + this._listeners.push(eventName, target, method, flags); + }, - function watchPath(obj, keyPath, meta) { - if (typeof obj !== 'object' || obj === null) { - return; - } - var m = meta || _emberMetalMeta.meta(obj); - var counter = m.peekWatching(keyPath) || 0; - if (!counter) { - // activate watching first time - m.writeWatching(keyPath, 1); - chainsFor(obj, m).add(keyPath); - } else { - m.writeWatching(keyPath, counter + 1); - } - } + _finalizeListeners: function () { + if (this._listenersFinalized) { + return; + } + if (!this._listeners) { + this._listeners = []; + } + var pointer = this.parent; + while (pointer) { + var listeners = pointer._listeners; + if (listeners) { + this._listeners = this._listeners.concat(listeners); + } + if (pointer._listenersFinalized) { + break; + } + pointer = pointer.parent; + } + this._listenersFinalized = true; + }, - function unwatchPath(obj, keyPath, meta) { - if (typeof obj !== 'object' || obj === null) { - return; + removeFromListeners: function (eventName, target, method, didRemove) { + var pointer = this; + while (pointer) { + var listeners = pointer._listeners; + if (listeners) { + for (var index = listeners.length - 4; index >= 0; index -= 4) { + if (listeners[index] === eventName && (!method || listeners[index + 1] === target && listeners[index + 2] === method)) { + if (pointer === this) { + // we are modifying our own list, so we edit directly + if (typeof didRemove === 'function') { + didRemove(eventName, target, listeners[index + 2]); + } + listeners.splice(index, 4); + } else { + // we are trying to remove an inherited listener, so we do + // just-in-time copying to detach our own listeners from + // our inheritance chain. + this._finalizeListeners(); + return this.removeFromListeners(eventName, target, method); + } + } + } + } + if (pointer._listenersFinalized) { + break; + } + pointer = pointer.parent; + } + }, + + matchingListeners: function (eventName) { + var pointer = this; + var result = []; + while (pointer) { + var listeners = pointer._listeners; + if (listeners) { + for (var index = 0; index < listeners.length - 3; index += 4) { + if (listeners[index] === eventName) { + pushUniqueListener(result, listeners, index); + } + } + } + if (pointer._listenersFinalized) { + break; + } + pointer = pointer.parent; + } + var sus = this._suspendedListeners; + if (sus) { + for (var susIndex = 0; susIndex < sus.length - 2; susIndex += 3) { + if (eventName === sus[susIndex]) { + for (var resultIndex = 0; resultIndex < result.length - 2; resultIndex += 3) { + if (result[resultIndex] === sus[susIndex + 1] && result[resultIndex + 1] === sus[susIndex + 2]) { + result[resultIndex + 2] |= SUSPENDED; + } + } + } + } + } + return result; + }, + + suspendListeners: function (eventNames, target, method, callback) { + var sus = this._suspendedListeners; + if (!sus) { + sus = this._suspendedListeners = []; + } + for (var i = 0; i < eventNames.length; i++) { + sus.push(eventNames[i], target, method); + } + try { + return callback.call(target); + } finally { + if (sus.length === eventNames.length) { + this._suspendedListeners = undefined; + } else { + for (var i = sus.length - 3; i >= 0; i -= 3) { + if (sus[i + 1] === target && sus[i + 2] === method && eventNames.indexOf(sus[i]) !== -1) { + sus.splice(i, 3); + } + } + } + } + }, + + watchedEvents: function () { + var pointer = this; + var names = {}; + while (pointer) { + var listeners = pointer._listeners; + if (listeners) { + for (var index = 0; index < listeners.length - 3; index += 4) { + names[listeners[index]] = true; + } + } + if (pointer._listenersFinalized) { + break; + } + pointer = pointer.parent; + } + return Object.keys(names); + }, + + _initializeListeners: function () { + this._listeners = undefined; + this._listenersFinalized = undefined; + this._suspendedListeners = undefined; } - var m = meta || _emberMetalMeta.meta(obj); - var counter = m.peekWatching(keyPath) || 0; + }; - if (counter === 1) { - m.writeWatching(keyPath, 0); - chainsFor(obj, m).remove(keyPath); - } else if (counter > 1) { - m.writeWatching(keyPath, counter - 1); + exports.protoMethods = protoMethods; + function pushUniqueListener(destination, source, index) { + var target = source[index + 1]; + var method = source[index + 2]; + for (var destinationIndex = 0; destinationIndex < destination.length - 2; destinationIndex += 3) { + if (destination[destinationIndex] === target && destination[destinationIndex + 1] === method) { + return; + } } + destination.push(target, method, source[index + 3]); } }); -enifed('ember-metal/watching', ['exports', 'ember-metal/watch_key', 'ember-metal/watch_path', 'ember-metal/path_cache', 'ember-metal/meta'], function (exports, _emberMetalWatch_key, _emberMetalWatch_path, _emberMetalPath_cache, _emberMetalMeta) { +enifed('ember-metal/mixin', ['exports', 'ember-utils', 'ember-metal/error', 'ember-metal/debug', 'ember-metal/meta', 'ember-metal/expand_properties', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/binding', 'ember-metal/observer', 'ember-metal/events'], function (exports, _emberUtils, _emberMetalError, _emberMetalDebug, _emberMetalMeta, _emberMetalExpand_properties, _emberMetalProperties, _emberMetalComputed, _emberMetalBinding, _emberMetalObserver, _emberMetalEvents) { + 'no use strict'; + // Remove "use strict"; from transpiled module until + // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed + /** - @module ember-metal + @module ember + @submodule ember-metal */ + exports.detectBinding = detectBinding; + exports.mixin = mixin; + exports.hasUnprocessedMixins = hasUnprocessedMixins; + exports.clearUnprocessedMixins = clearUnprocessedMixins; + exports.required = required; + exports.aliasMethod = aliasMethod; + exports.observer = observer; + exports._immediateObserver = _immediateObserver; + exports._beforeObserver = _beforeObserver; - 'use strict'; + function ROOT() {} + ROOT.__hasSuper = false; - exports.isWatching = isWatching; - exports.watcherCount = watcherCount; - exports.unwatch = unwatch; - exports.destroy = destroy; + var a_slice = Array.prototype.slice; + var a_concat = Array.prototype.concat; + var isArray = Array.isArray; - /** - Starts watching a property on an object. Whenever the property changes, - invokes `Ember.propertyWillChange` and `Ember.propertyDidChange`. This is the - primitive used by observers and dependent keys; usually you will never call - this method directly but instead use higher level methods like - `Ember.addObserver()` - - @private - @method watch - @for Ember - @param obj - @param {String} _keyPath - */ - function watch(obj, _keyPath, m) { - if (!_emberMetalPath_cache.isPath(_keyPath)) { - _emberMetalWatch_key.watchKey(obj, _keyPath, m); - } else { - _emberMetalWatch_path.watchPath(obj, _keyPath, m); - } + function isMethod(obj) { + return 'function' === typeof obj && obj.isMethod !== false && obj !== Boolean && obj !== Object && obj !== Number && obj !== Array && obj !== Date && obj !== String; } - exports.watch = watch; + var CONTINUE = {}; - function isWatching(obj, key) { - if (typeof obj !== 'object' || obj === null) { - return false; + function mixinProperties(mixinsMeta, mixin) { + var guid = undefined; + + if (mixin instanceof Mixin) { + guid = _emberUtils.guidFor(mixin); + if (mixinsMeta.peekMixins(guid)) { + return CONTINUE; + } + mixinsMeta.writeMixins(guid, mixin); + return mixin.properties; + } else { + return mixin; // apply anonymous mixin properties } - var meta = _emberMetalMeta.peekMeta(obj); - return (meta && meta.peekWatching(key)) > 0; } - function watcherCount(obj, key) { - var meta = _emberMetalMeta.peekMeta(obj); - return meta && meta.peekWatching(key) || 0; + function concatenatedMixinProperties(concatProp, props, values, base) { + // reset before adding each new mixin to pickup concats from previous + var concats = values[concatProp] || base[concatProp]; + if (props[concatProp]) { + concats = concats ? a_concat.call(concats, props[concatProp]) : props[concatProp]; + } + return concats; } - function unwatch(obj, _keyPath, m) { - if (!_emberMetalPath_cache.isPath(_keyPath)) { - _emberMetalWatch_key.unwatchKey(obj, _keyPath, m); - } else { - _emberMetalWatch_path.unwatchPath(obj, _keyPath, m); + function giveDescriptorSuper(meta, key, property, values, descs, base) { + var superProperty = undefined; + + // Computed properties override methods, and do not call super to them + if (values[key] === undefined) { + // Find the original descriptor in a parent mixin + superProperty = descs[key]; } - } - /** - Tears down the meta on an object so that it can be garbage collected. - Multiple calls will have no effect. - - @method destroy - @for Ember - @param {Object} obj the object to destroy - @return {void} - @private - */ + // If we didn't find the original descriptor in a parent mixin, find + // it on the original object. + if (!superProperty) { + var possibleDesc = base[key]; + var superDesc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - function destroy(obj) { - _emberMetalMeta.deleteMeta(obj); - } -}); -enifed('ember-metal/weak_map', ['exports', 'ember-utils', 'ember-metal/meta'], function (exports, _emberUtils, _emberMetalMeta) { - 'use strict'; + superProperty = superDesc; + } - exports.default = WeakMap; + if (superProperty === undefined || !(superProperty instanceof _emberMetalComputed.ComputedProperty)) { + return property; + } - var id = 0; + // Since multiple mixins may inherit from the same parent, we need + // to clone the computed property so that other mixins do not receive + // the wrapped version. + property = Object.create(property); + property._getter = _emberUtils.wrap(property._getter, superProperty._getter); + if (superProperty._setter) { + if (property._setter) { + property._setter = _emberUtils.wrap(property._setter, superProperty._setter); + } else { + property._setter = superProperty._setter; + } + } - // Returns whether Type(value) is Object according to the terminology in the spec - function isObject(value) { - return typeof value === 'object' && value !== null || typeof value === 'function'; + return property; } - /* - * @class Ember.WeakMap - * @public - * @category ember-metal-weakmap - * - * A partial polyfill for [WeakMap](http://www.ecma-international.org/ecma-262/6.0/#sec-weakmap-objects). - * - * There is a small but important caveat. This implementation assumes that the - * weak map will live longer (in the sense of garbage collection) than all of its - * keys, otherwise it is possible to leak the values stored in the weak map. In - * practice, most use cases satisfy this limitation which is why it is included - * in ember-metal. - */ + function giveMethodSuper(obj, key, method, values, descs) { + var superMethod = undefined; - function WeakMap(iterable) { - if (!(this instanceof WeakMap)) { - throw new TypeError('Constructor WeakMap requires \'new\''); + // Methods overwrite computed properties, and do not call super to them. + if (descs[key] === undefined) { + // Find the original method in a parent mixin + superMethod = values[key]; } - this._id = _emberUtils.GUID_KEY + id++; + // If we didn't find the original value in a parent mixin, find it in + // the original object + superMethod = superMethod || obj[key]; - if (iterable === null || iterable === undefined) { - return; - } else if (Array.isArray(iterable)) { - for (var i = 0; i < iterable.length; i++) { - var _iterable$i = iterable[i]; - var key = _iterable$i[0]; - var value = _iterable$i[1]; + // Only wrap the new method if the original method was a function + if (superMethod === undefined || 'function' !== typeof superMethod) { + return method; + } - this.set(key, value); - } + return _emberUtils.wrap(method, superMethod); + } + + function applyConcatenatedProperties(obj, key, value, values) { + var baseValue = values[key] || obj[key]; + var ret = undefined; + + if (baseValue === null || baseValue === undefined) { + ret = _emberUtils.makeArray(value); } else { - throw new TypeError('The weak map constructor polyfill only supports an array argument'); + if (isArray(baseValue)) { + if (value === null || value === undefined) { + ret = baseValue; + } else { + ret = a_concat.call(baseValue, value); + } + } else { + ret = a_concat.call(_emberUtils.makeArray(baseValue), value); + } } + + return ret; } - /* - * @method get - * @param key {Object | Function} - * @return {Any} stored value - */ - WeakMap.prototype.get = function (obj) { - if (!isObject(obj)) { - return undefined; + function applyMergedProperties(obj, key, value, values) { + var baseValue = values[key] || obj[key]; + + if (!baseValue) { + return value; } - var meta = _emberMetalMeta.peekMeta(obj); - if (meta) { - var map = meta.readableWeak(); - if (map) { - if (map[this._id] === _emberMetalMeta.UNDEFINED) { - return undefined; - } + var newBase = _emberUtils.assign({}, baseValue); + var hasFunction = false; - return map[this._id]; + for (var prop in value) { + if (!value.hasOwnProperty(prop)) { + continue; } - } - }; - /* - * @method set - * @param key {Object | Function} - * @param value {Any} - * @return {WeakMap} the weak map - */ - WeakMap.prototype.set = function (obj, value) { - if (!isObject(obj)) { - throw new TypeError('Invalid value used as weak map key'); + var propValue = value[prop]; + if (isMethod(propValue)) { + // TODO: support for Computed Properties, etc? + hasFunction = true; + newBase[prop] = giveMethodSuper(obj, prop, propValue, baseValue, {}); + } else { + newBase[prop] = propValue; + } } - if (value === undefined) { - value = _emberMetalMeta.UNDEFINED; + if (hasFunction) { + newBase._super = ROOT; } - _emberMetalMeta.meta(obj).writableWeak()[this._id] = value; + return newBase; + } - return this; - }; + function addNormalizedProperty(base, key, value, meta, descs, values, concats, mergings) { + if (value instanceof _emberMetalProperties.Descriptor) { + if (value === REQUIRED && descs[key]) { + return CONTINUE; + } - /* - * @method has - * @param key {Object | Function} - * @return {boolean} if the key exists - */ - WeakMap.prototype.has = function (obj) { - if (!isObject(obj)) { - return false; - } + // Wrap descriptor function to implement + // _super() if needed + if (value._getter) { + value = giveDescriptorSuper(meta, key, value, values, descs, base); + } - var meta = _emberMetalMeta.peekMeta(obj); - if (meta) { - var map = meta.readableWeak(); - if (map) { - return map[this._id] !== undefined; + descs[key] = value; + values[key] = undefined; + } else { + if (concats && concats.indexOf(key) >= 0 || key === 'concatenatedProperties' || key === 'mergedProperties') { + value = applyConcatenatedProperties(base, key, value, values); + } else if (mergings && mergings.indexOf(key) >= 0) { + value = applyMergedProperties(base, key, value, values); + } else if (isMethod(value)) { + value = giveMethodSuper(base, key, value, values, descs); } + + descs[key] = undefined; + values[key] = value; } + } - return false; - }; + function mergeMixins(mixins, m, descs, values, base, keys) { + var currentMixin = undefined, + props = undefined, + key = undefined, + concats = undefined, + mergings = undefined; - /* - * @method delete - * @param key {Object | Function} - * @return {boolean} if the key was deleted - */ - WeakMap.prototype.delete = function (obj) { - if (this.has(obj)) { - delete _emberMetalMeta.meta(obj).writableWeak()[this._id]; - return true; - } else { - return false; + function removeKeys(keyName) { + delete descs[keyName]; + delete values[keyName]; } - }; - - /* - * @method toString - * @return {String} - */ - WeakMap.prototype.toString = function () { - return '[object WeakMap]'; - }; -}); -enifed('ember-routing/ext/controller', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/utils'], function (exports, _emberMetal, _emberRuntime, _emberRoutingUtils) { - 'use strict'; - /** - @module ember - @submodule ember-routing - */ + for (var i = 0; i < mixins.length; i++) { + currentMixin = mixins[i]; - _emberRuntime.ControllerMixin.reopen({ - concatenatedProperties: ['queryParams'], + props = mixinProperties(m, currentMixin); + if (props === CONTINUE) { + continue; + } - /** - Defines which query parameters the controller accepts. - If you give the names `['category','page']` it will bind - the values of these query parameters to the variables - `this.category` and `this.page` - @property queryParams - @public - */ - queryParams: null, + if (props) { + if (base.willMergeMixin) { + base.willMergeMixin(props); + } + concats = concatenatedMixinProperties('concatenatedProperties', props, values, base); + mergings = concatenatedMixinProperties('mergedProperties', props, values, base); - /** - This property is updated to various different callback functions depending on - the current "state" of the backing route. It is used by - `Ember.Controller.prototype._qpChanged`. - The methods backing each state can be found in the `Ember.Route.prototype._qp` computed - property return value (the `.states` property). The current values are listed here for - the sanity of future travelers: - * `inactive` - This state is used when this controller instance is not part of the active - route heirarchy. Set in `Ember.Route.prototype._reset` (a `router.js` microlib hook) and - `Ember.Route.prototype.actions.finalizeQueryParamChange`. - * `active` - This state is used when this controller instance is part of the active - route heirarchy. Set in `Ember.Route.prototype.actions.finalizeQueryParamChange`. - * `allowOverrides` - This state is used in `Ember.Route.prototype.setup` (`route.js` microlib hook). - @method _qpDelegate - @private - */ - _qpDelegate: null, // set by route + for (key in props) { + if (!props.hasOwnProperty(key)) { + continue; + } + keys.push(key); + addNormalizedProperty(base, key, props[key], m, descs, values, concats, mergings); + } - /** - During `Ember.Route#setup` observers are created to invoke this method - when any of the query params declared in `Ember.Controller#queryParams` property - are changed. - When invoked this method uses the currently active query param update delegate - (see `Ember.Controller.prototype._qpDelegate` for details) and invokes it with - the QP key/value being changed. - @method _qpChanged - @private - */ - _qpChanged: function (controller, _prop) { - var prop = _prop.substr(0, _prop.length - 3); + // manually copy toString() because some JS engines do not enumerate it + if (props.hasOwnProperty('toString')) { + base.toString = props.toString; + } + } else if (currentMixin.mixins) { + mergeMixins(currentMixin.mixins, m, descs, values, base, keys); + if (currentMixin._without) { + currentMixin._without.forEach(removeKeys); + } + } + } + } - var delegate = controller._qpDelegate; - var value = _emberMetal.get(controller, prop); - delegate(prop, value); - }, + function detectBinding(key) { + var length = key.length; - /** - Transition the application into another route. The route may - be either a single route or route path: - ```javascript - aController.transitionToRoute('blogPosts'); - aController.transitionToRoute('blogPosts.recentEntries'); - ``` - Optionally supply a model for the route in question. The model - will be serialized into the URL using the `serialize` hook of - the route: - ```javascript - aController.transitionToRoute('blogPost', aPost); - ``` - If a literal is passed (such as a number or a string), it will - be treated as an identifier instead. In this case, the `model` - hook of the route will be triggered: - ```javascript - aController.transitionToRoute('blogPost', 1); - ``` - Multiple models will be applied last to first recursively up the - route tree. - ```javascript - App.Router.map(function() { - this.route('blogPost', { path: ':blogPostId' }, function() { - this.route('blogComment', { path: ':blogCommentId', resetNamespace: true }); - }); - }); - aController.transitionToRoute('blogComment', aPost, aComment); - aController.transitionToRoute('blogComment', 1, 13); - ``` - It is also possible to pass a URL (a string that starts with a - `/`). This is intended for testing and debugging purposes and - should rarely be used in production code. - ```javascript - aController.transitionToRoute('/'); - aController.transitionToRoute('/blog/post/1/comment/13'); - aController.transitionToRoute('/blog/posts?sort=title'); - ``` - An options hash with a `queryParams` property may be provided as - the final argument to add query parameters to the destination URL. - ```javascript - aController.transitionToRoute('blogPost', 1, { - queryParams: { showComments: 'true' } - }); - // if you just want to transition the query parameters without changing the route - aController.transitionToRoute({ queryParams: { sort: 'date' } }); - ``` - See also [replaceRoute](/api/classes/Ember.ControllerMixin.html#method_replaceRoute). - @param {String} name the name of the route or a URL - @param {...Object} models the model(s) or identifier(s) to be used - while transitioning to the route. - @param {Object} [options] optional hash with a queryParams property - containing a mapping of query parameters - @for Ember.ControllerMixin - @method transitionToRoute - @public - */ - transitionToRoute: function () { - // target may be either another controller or a router - var target = _emberMetal.get(this, 'target'); - var method = target.transitionToRoute || target.transitionTo; + return length > 7 && key.charCodeAt(length - 7) === 66 && key.indexOf('inding', length - 6) !== -1; + } - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; + // warm both paths of above function + detectBinding('notbound'); + detectBinding('fooBinding'); + + function connectBindings(obj, m) { + // TODO Mixin.apply(instance) should disconnect binding if exists + m.forEachBindings(function (key, binding) { + if (binding) { + var to = key.slice(0, -7); // strip Binding off end + if (binding instanceof _emberMetalBinding.Binding) { + binding = binding.copy(); // copy prototypes' instance + binding.to(to); + } else { + // binding is string path + binding = new _emberMetalBinding.Binding(to, binding); + } + binding.connect(obj); + obj[key] = binding; } + }); + // mark as applied + m.clearBindings(); + } - return method.apply(target, _emberRoutingUtils.prefixRouteNameArg(this, args)); - }, + function finishPartial(obj, m) { + connectBindings(obj, m || _emberMetalMeta.meta(obj)); + return obj; + } - /** - Transition into another route while replacing the current URL, if possible. - This will replace the current history entry instead of adding a new one. - Beside that, it is identical to `transitionToRoute` in all other respects. - ```javascript - aController.replaceRoute('blogPosts'); - aController.replaceRoute('blogPosts.recentEntries'); - ``` - Optionally supply a model for the route in question. The model - will be serialized into the URL using the `serialize` hook of - the route: - ```javascript - aController.replaceRoute('blogPost', aPost); - ``` - If a literal is passed (such as a number or a string), it will - be treated as an identifier instead. In this case, the `model` - hook of the route will be triggered: - ```javascript - aController.replaceRoute('blogPost', 1); - ``` - Multiple models will be applied last to first recursively up the - route tree. - ```javascript - App.Router.map(function() { - this.route('blogPost', { path: ':blogPostId' }, function() { - this.route('blogComment', { path: ':blogCommentId', resetNamespace: true }); - }); - }); - aController.replaceRoute('blogComment', aPost, aComment); - aController.replaceRoute('blogComment', 1, 13); - ``` - It is also possible to pass a URL (a string that starts with a - `/`). This is intended for testing and debugging purposes and - should rarely be used in production code. - ```javascript - aController.replaceRoute('/'); - aController.replaceRoute('/blog/post/1/comment/13'); - ``` - @param {String} name the name of the route or a URL - @param {...Object} models the model(s) or identifier(s) to be used - while transitioning to the route. - @for Ember.ControllerMixin - @method replaceRoute - @public - */ - replaceRoute: function () { - // target may be either another controller or a router - var target = _emberMetal.get(this, 'target'); - var method = target.replaceRoute || target.replaceWith; + function followAlias(obj, desc, m, descs, values) { + var altKey = desc.methodName; + var value = undefined; + var possibleDesc = undefined; + if (descs[altKey] || values[altKey]) { + value = values[altKey]; + desc = descs[altKey]; + } else if ((possibleDesc = obj[altKey]) && possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor) { + desc = possibleDesc; + value = undefined; + } else { + desc = undefined; + value = obj[altKey]; + } - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; + return { desc: desc, value: value }; + } + + function updateObserversAndListeners(obj, key, observerOrListener, pathsKey, updateMethod) { + var paths = observerOrListener[pathsKey]; + + if (paths) { + for (var i = 0; i < paths.length; i++) { + updateMethod(obj, paths[i], null, key); } + } + } - return method.apply(target, _emberRoutingUtils.prefixRouteNameArg(target, args)); + function replaceObserversAndListeners(obj, key, observerOrListener) { + var prev = obj[key]; + + if ('function' === typeof prev) { + updateObserversAndListeners(obj, key, prev, '__ember_observesBefore__', _emberMetalObserver._removeBeforeObserver); + updateObserversAndListeners(obj, key, prev, '__ember_observes__', _emberMetalObserver.removeObserver); + updateObserversAndListeners(obj, key, prev, '__ember_listens__', _emberMetalEvents.removeListener); } - }); - exports.default = _emberRuntime.ControllerMixin; -}); -enifed('ember-routing/ext/run_loop', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; + if ('function' === typeof observerOrListener) { + updateObserversAndListeners(obj, key, observerOrListener, '__ember_observesBefore__', _emberMetalObserver._addBeforeObserver); + updateObserversAndListeners(obj, key, observerOrListener, '__ember_observes__', _emberMetalObserver.addObserver); + updateObserversAndListeners(obj, key, observerOrListener, '__ember_listens__', _emberMetalEvents.addListener); + } + } - /** - @module ember - @submodule ember-views - */ + function applyMixin(obj, mixins, partial) { + var descs = {}; + var values = {}; + var m = _emberMetalMeta.meta(obj); + var keys = []; + var key = undefined, + value = undefined, + desc = undefined; - // Add a new named queue after the 'actions' queue (where RSVP promises - // resolve), which is used in router transitions to prevent unnecessary - // loading state entry if all context promises resolve on the - // 'actions' queue first. - _emberMetal.run._addQueue('routerTransitions', 'actions'); -}); -enifed('ember-routing/index', ['exports', '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/system/query_params', 'ember-routing/services/routing', 'ember-routing/system/cache'], function (exports, _emberRoutingExtRun_loop, _emberRoutingExtController, _emberRoutingLocationApi, _emberRoutingLocationNone_location, _emberRoutingLocationHash_location, _emberRoutingLocationHistory_location, _emberRoutingLocationAuto_location, _emberRoutingSystemGenerate_controller, _emberRoutingSystemController_for, _emberRoutingSystemDsl, _emberRoutingSystemRouter, _emberRoutingSystemRoute, _emberRoutingSystemQuery_params, _emberRoutingServicesRouting, _emberRoutingSystemCache) { - /** - @module ember - @submodule ember-routing - */ + obj._super = ROOT; - // ES6TODO: Cleanup modules with side-effects below - 'use strict'; + // Go through all mixins and hashes passed in, and: + // + // * Handle concatenated properties + // * Handle merged properties + // * Set up _super wrapping if necessary + // * Set up computed property descriptors + // * Copying `toString` in broken browsers + mergeMixins(mixins, m, descs, values, obj, keys); - exports.Location = _emberRoutingLocationApi.default; - exports.NoneLocation = _emberRoutingLocationNone_location.default; - exports.HashLocation = _emberRoutingLocationHash_location.default; - exports.HistoryLocation = _emberRoutingLocationHistory_location.default; - exports.AutoLocation = _emberRoutingLocationAuto_location.default; - exports.generateController = _emberRoutingSystemGenerate_controller.default; - exports.generateControllerFactory = _emberRoutingSystemGenerate_controller.generateControllerFactory; - exports.controllerFor = _emberRoutingSystemController_for.default; - exports.RouterDSL = _emberRoutingSystemDsl.default; - exports.Router = _emberRoutingSystemRouter.default; - exports.Route = _emberRoutingSystemRoute.default; - exports.QueryParams = _emberRoutingSystemQuery_params.default; - exports.RoutingService = _emberRoutingServicesRouting.default; - exports.BucketCache = _emberRoutingSystemCache.default; -}); -enifed('ember-routing/location/api', ['exports', 'ember-metal', 'ember-environment', 'ember-routing/location/util'], function (exports, _emberMetal, _emberEnvironment, _emberRoutingLocationUtil) { - 'use strict'; + for (var i = 0; i < keys.length; i++) { + key = keys[i]; + if (key === 'constructor' || !values.hasOwnProperty(key)) { + continue; + } + + desc = descs[key]; + value = values[key]; + + if (desc === REQUIRED) { + continue; + } + + while (desc && desc instanceof Alias) { + var followed = followAlias(obj, desc, m, descs, values); + desc = followed.desc; + value = followed.value; + } + + if (desc === undefined && value === undefined) { + continue; + } + + replaceObserversAndListeners(obj, key, value); + + if (detectBinding(key)) { + m.writeBindings(key, value); + } + + _emberMetalProperties.defineProperty(obj, key, desc, value, m); + } + + if (!partial) { + // don't apply to prototype + finishPartial(obj, m); + } + + return obj; + } /** - @module ember - @submodule ember-routing + @method mixin + @for Ember + @param obj + @param mixins* + @return obj + @private */ + function mixin(obj) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + applyMixin(obj, args, false); + return obj; + } + /** - Ember.Location returns an instance of the correct implementation of - the `location` API. - - ## Implementations - - You can pass an implementation name (`hash`, `history`, `none`) to force a - particular implementation to be used in your application. - - ### HashLocation - - Using `HashLocation` results in URLs with a `#` (hash sign) separating the - server side URL portion of the URL from the portion that is used by Ember. - This relies upon the `hashchange` event existing in the browser. - - Example: + The `Ember.Mixin` class allows you to create mixins, whose properties can be + added to other classes. For instance, ```javascript - App.Router.map(function() { - this.route('posts', function() { - this.route('new'); - }); - }); - - App.Router.reopen({ - location: 'hash' + const EditableMixin = Ember.Mixin.create({ + edit() { + console.log('starting to edit'); + this.set('isEditing', true); + }, + isEditing: false }); - ``` - - This will result in a posts.new url of `/#/posts/new`. - - ### HistoryLocation - - Using `HistoryLocation` results in URLs that are indistinguishable from a - standard URL. This relies upon the browser's `history` API. - Example: - - ```javascript - App.Router.map(function() { - this.route('posts', function() { - this.route('new'); - }); + // Mix mixins into classes by passing them as the first arguments to + // `.extend.` + const Comment = Ember.Object.extend(EditableMixin, { + post: null }); - App.Router.reopen({ - location: 'history' - }); + let comment = Comment.create(post: somePost); + comment.edit(); // outputs 'starting to edit' ``` - This will result in a posts.new url of `/posts/new`. - - Keep in mind that your server must serve the Ember app at all the routes you - define. - - ### AutoLocation - - Using `AutoLocation`, the router will use the best Location class supported by - the browser it is running in. - - Browsers that support the `history` API will use `HistoryLocation`, those that - do not, but still support the `hashchange` event will use `HashLocation`, and - in the rare case neither is supported will use `NoneLocation`. + Note that Mixins are created with `Ember.Mixin.create`, not + `Ember.Mixin.extend`. - Example: + Note that mixins extend a constructor's prototype so arrays and object literals + defined as properties will be shared amongst objects that implement the mixin. + If you want to define a property in a mixin that is not shared, you can define + it either as a computed property or have it be created on initialization of the object. ```javascript - App.Router.map(function() { - this.route('posts', function() { - this.route('new'); - }); + // filters array will be shared amongst any object implementing mixin + const FilterableMixin = Ember.Mixin.create({ + filters: Ember.A() }); - App.Router.reopen({ - location: 'auto' + // filters will be a separate array for every object implementing the mixin + const FilterableMixin = Ember.Mixin.create({ + filters: Ember.computed(function() { + return Ember.A(); + }) }); - ``` - - This will result in a posts.new url of `/posts/new` for modern browsers that - support the `history` api or `/#/posts/new` for older ones, like Internet - Explorer 9 and below. - - When a user visits a link to your application, they will be automatically - upgraded or downgraded to the appropriate `Location` class, with the URL - transformed accordingly, if needed. - - Keep in mind that since some of your users will use `HistoryLocation`, your - server must serve the Ember app at all the routes you define. - - ### NoneLocation - - Using `NoneLocation` causes Ember to not store the applications URL state - in the actual URL. This is generally used for testing purposes, and is one - of the changes made when calling `App.setupForTesting()`. - - ## Location API - - Each location implementation must provide the following methods: - - * implementation: returns the string name used to reference the implementation. - * getURL: returns the current URL. - * setURL(path): sets the current URL. - * replaceURL(path): replace the current URL (optional). - * onUpdateURL(callback): triggers the callback when the URL changes. - * formatURL(url): formats `url` to be placed into `href` attribute. - * detect() (optional): instructs the location to do any feature detection - necessary. If the location needs to redirect to a different URL, it - can cancel routing by setting the `cancelRouterSetup` property on itself - to `false`. - - Calling setURL or replaceURL will not trigger onUpdateURL callbacks. - - ## Custom implementation - - Ember scans `app/locations/*` for extending the Location API. - - Example: - - ```javascript - import Ember from 'ember'; - - export default Ember.HistoryLocation.extend({ - implementation: 'history-url-logging', - pushState: function (path) { - console.log(path); - this._super.apply(this, arguments); + // filters will be created as a separate array during the object's initialization + const Filterable = Ember.Mixin.create({ + init() { + this._super(...arguments); + this.set("filters", Ember.A()); } }); ``` - @class Location + @class Mixin @namespace Ember - @static - @private + @public */ - exports.default = { - /** - This is deprecated in favor of using the container to lookup the location - implementation as desired. - For example: - ```javascript - // Given a location registered as follows: - container.register('location:history-test', HistoryTestLocation); - // You could create a new instance via: - container.lookup('location:history-test'); - ``` - @method create - @param {Object} options - @return {Object} an instance of an implementation of the `location` API - @deprecated Use the container to lookup the location implementation that you - need. - @private - */ - create: function (options) { - var implementation = options && options.implementation; - var implementationClass = this.implementations[implementation]; + var Mixin = (function () { + function Mixin(args, properties) { + this.properties = properties; - return implementationClass.create.apply(implementationClass, arguments); - }, + var length = args && args.length; - implementations: {}, - _location: _emberEnvironment.environment.location, + if (length > 0) { + var m = new Array(length); - /** - Returns the current `location.hash` by parsing location.href since browsers - inconsistently URL-decode `location.hash`. - https://bugzilla.mozilla.org/show_bug.cgi?id=483304 - @private - @method getHash - @since 1.4.0 - */ - _getHash: function () { - return _emberRoutingLocationUtil.getHash(this.location); + for (var i = 0; i < length; i++) { + var x = args[i]; + if (x instanceof Mixin) { + m[i] = x; + } else { + m[i] = new Mixin(undefined, x); + } + } + + this.mixins = m; + } else { + this.mixins = undefined; + } + this.ownerConstructor = undefined; + this._without = undefined; + this[_emberUtils.GUID_KEY] = null; + this[_emberUtils.NAME_KEY] = null; } - }; -}); -enifed('ember-routing/location/auto_location', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-environment', 'ember-routing/location/util'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberEnvironment, _emberRoutingLocationUtil) { - 'use strict'; - - exports.getHistoryPath = getHistoryPath; - exports.getHashPath = getHashPath; - - /** - @module ember - @submodule ember-routing - */ - /** - Ember.AutoLocation will select the best location option based off browser - support with the priority order: history, hash, none. - - Clean pushState paths accessed by hashchange-only browsers will be redirected - to the hash-equivalent and vice versa so future transitions are consistent. - - Keep in mind that since some of your users will use `HistoryLocation`, your - server must serve the Ember app at all the routes you define. - - @class AutoLocation - @namespace Ember - @static - @private - */ - exports.default = _emberRuntime.Object.extend({ - /** - @private - The browser's `location` object. This is typically equivalent to - `window.location`, but may be overridden for testing. - @property location - @default environment.location - */ - location: _emberEnvironment.environment.location, + Mixin.applyPartial = function applyPartial(obj) { + var args = a_slice.call(arguments, 1); + return applyMixin(obj, args, true); + }; /** - @private - The browser's `history` object. This is typically equivalent to - `window.history`, but may be overridden for testing. - @since 1.5.1 - @property history - @default environment.history + @method create + @static + @param arguments* + @public */ - history: _emberEnvironment.environment.history, - /** - @private - The user agent's global variable. In browsers, this will be `window`. - @since 1.11 - @property global - @default window - */ - global: _emberEnvironment.environment.window, + Mixin.create = function create() { + // ES6TODO: this relies on a global state? + unprocessedFlag = true; + var M = this; - /** - @private - The browser's `userAgent`. This is typically equivalent to - `navigator.userAgent`, but may be overridden for testing. - @since 1.5.1 - @property userAgent - @default environment.history - */ - userAgent: _emberEnvironment.environment.userAgent, + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - /** - @private - This property is used by the router to know whether to cancel the routing - setup process, which is needed while we redirect the browser. - @since 1.5.1 - @property cancelRouterSetup - @default false - */ - cancelRouterSetup: false, + return new M(args, undefined); + }; - /** - @private - Will be pre-pended to path upon state change. - @since 1.5.1 - @property rootURL - @default '/' - */ - rootURL: '/', + // returns the mixins currently applied to the specified object + // TODO: Make Ember.mixin - /** - Called by the router to instruct the location to do any feature detection - necessary. In the case of AutoLocation, we detect whether to use history - or hash concrete implementations. - @private - */ - detect: function () { - var rootURL = this.rootURL; + Mixin.mixins = function mixins(obj) { + var m = _emberMetalMeta.peekMeta(obj); + var ret = []; + if (!m) { + return ret; + } - var implementation = detectImplementation({ - location: this.location, - history: this.history, - userAgent: this.userAgent, - rootURL: rootURL, - documentMode: this.documentMode, - global: this.global + m.forEachMixins(function (key, currentMixin) { + // skip primitive mixins since these are always anonymous + if (!currentMixin.properties) { + ret.push(currentMixin); + } }); - if (implementation === false) { - _emberMetal.set(this, 'cancelRouterSetup', true); - implementation = 'none'; - } - - var concrete = _emberUtils.getOwner(this).lookup('location:' + implementation); - _emberMetal.set(concrete, 'rootURL', rootURL); + return ret; + }; - _emberMetal.set(this, 'concreteImplementation', concrete); - }, + return Mixin; + })(); - initState: delegateToConcreteImplementation('initState'), - getURL: delegateToConcreteImplementation('getURL'), - setURL: delegateToConcreteImplementation('setURL'), - replaceURL: delegateToConcreteImplementation('replaceURL'), - onUpdateURL: delegateToConcreteImplementation('onUpdateURL'), - formatURL: delegateToConcreteImplementation('formatURL'), + exports.default = Mixin; - willDestroy: function () { - var concreteImplementation = _emberMetal.get(this, 'concreteImplementation'); + Mixin._apply = applyMixin; - if (concreteImplementation) { - concreteImplementation.destroy(); - } - } - }); + Mixin.finishPartial = finishPartial; - function delegateToConcreteImplementation(methodName) { - return function () { - var concreteImplementation = _emberMetal.get(this, 'concreteImplementation'); + var unprocessedFlag = false; - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } + function hasUnprocessedMixins() { + return unprocessedFlag; + } - return _emberUtils.tryInvoke(concreteImplementation, methodName, args); - }; + function clearUnprocessedMixins() { + unprocessedFlag = false; } - /* - Given the browser's `location`, `history` and `userAgent`, and a configured - root URL, this function detects whether the browser supports the [History - API](https://developer.mozilla.org/en-US/docs/Web/API/History) and returns a - string representing the Location object to use based on its determination. - - For example, if the page loads in an evergreen browser, this function would - return the string "history", meaning the history API and thus HistoryLocation - should be used. If the page is loaded in IE8, it will return the string - "hash," indicating that the History API should be simulated by manipulating the - hash portion of the location. - - */ + var MixinPrototype = Mixin.prototype; - function detectImplementation(options) { - var location = options.location; - var userAgent = options.userAgent; - var history = options.history; - var documentMode = options.documentMode; - var global = options.global; - var rootURL = options.rootURL; + /** + @method reopen + @param arguments* + @private + */ + MixinPrototype.reopen = function () { + var currentMixin = undefined; - var implementation = 'none'; - var cancelRouterSetup = false; - var currentPath = _emberRoutingLocationUtil.getFullPath(location); + if (this.properties) { + currentMixin = new Mixin(undefined, this.properties); + this.properties = undefined; + this.mixins = [currentMixin]; + } else if (!this.mixins) { + this.mixins = []; + } - if (_emberRoutingLocationUtil.supportsHistory(userAgent, history)) { - var historyPath = getHistoryPath(rootURL, location); + var mixins = this.mixins; + var idx = undefined; - // If the browser supports history and we have a history path, we can use - // the history location with no redirects. - if (currentPath === historyPath) { - return 'history'; - } else { - if (currentPath.substr(0, 2) === '/#') { - history.replaceState({ path: historyPath }, null, historyPath); - implementation = 'history'; - } else { - cancelRouterSetup = true; - _emberRoutingLocationUtil.replacePath(location, historyPath); - } - } - } else if (_emberRoutingLocationUtil.supportsHashChange(documentMode, global)) { - var hashPath = getHashPath(rootURL, location); + for (idx = 0; idx < arguments.length; idx++) { + currentMixin = arguments[idx]; - // Be sure we're using a hashed path, otherwise let's switch over it to so - // we start off clean and consistent. We'll count an index path with no - // hash as "good enough" as well. - if (currentPath === hashPath || currentPath === '/' && hashPath === '/#/') { - implementation = 'hash'; + if (currentMixin instanceof Mixin) { + mixins.push(currentMixin); } else { - // Our URL isn't in the expected hash-supported format, so we want to - // cancel the router setup and replace the URL to start off clean - cancelRouterSetup = true; - _emberRoutingLocationUtil.replacePath(location, hashPath); + mixins.push(new Mixin(undefined, currentMixin)); } } - if (cancelRouterSetup) { - return false; - } - - return implementation; - } + return this; + }; /** + @method apply + @param obj + @return applied object @private - - Returns the current path as it should appear for HistoryLocation supported - browsers. This may very well differ from the real current path (e.g. if it - starts off as a hashed URL) */ + MixinPrototype.apply = function (obj) { + return applyMixin(obj, [this], false); + }; - function getHistoryPath(rootURL, location) { - var path = _emberRoutingLocationUtil.getPath(location); - var hash = _emberRoutingLocationUtil.getHash(location); - var query = _emberRoutingLocationUtil.getQuery(location); - var rootURLIndex = path.indexOf(rootURL); - var routeHash = undefined, - hashParts = undefined; + MixinPrototype.applyPartial = function (obj) { + return applyMixin(obj, [this], true); + }; - // By convention, Ember.js routes using HashLocation are required to start - // with `#/`. Anything else should NOT be considered a route and should - // be passed straight through, without transformation. - if (hash.substr(0, 2) === '#/') { - // There could be extra hash segments after the route - hashParts = hash.substr(1).split('#'); - // The first one is always the route url - routeHash = hashParts.shift(); + MixinPrototype.toString = Object.toString; - // If the path already has a trailing slash, remove the one - // from the hashed route so we don't double up. - if (path.slice(-1) === '/') { - routeHash = routeHash.substr(1); - } + function _detect(curMixin, targetMixin, seen) { + var guid = _emberUtils.guidFor(curMixin); - // This is the "expected" final order - path = path + routeHash + query; + if (seen[guid]) { + return false; + } + seen[guid] = true; - if (hashParts.length) { - path += '#' + hashParts.join('#'); + if (curMixin === targetMixin) { + return true; + } + var mixins = curMixin.mixins; + var loc = mixins ? mixins.length : 0; + while (--loc >= 0) { + if (_detect(mixins[loc], targetMixin, seen)) { + return true; } - } else { - path = path + query + hash; } - - return path; + return false; } /** + @method detect + @param obj + @return {Boolean} @private - - Returns the current path as it should appear for HashLocation supported - browsers. This may very well differ from the real current path. - - @method _getHashPath */ + MixinPrototype.detect = function (obj) { + if (typeof obj !== 'object' || obj === null) { + return false; + } + if (obj instanceof Mixin) { + return _detect(obj, this, {}); + } + var m = _emberMetalMeta.peekMeta(obj); + if (!m) { + return false; + } + return !!m.peekMixins(_emberUtils.guidFor(this)); + }; - function getHashPath(rootURL, location) { - var path = rootURL; - var historyPath = getHistoryPath(rootURL, location); - var routePath = historyPath.substr(rootURL.length); + MixinPrototype.without = function () { + var ret = new Mixin([this]); - if (routePath !== '') { - if (routePath.charAt(0) !== '/') { - routePath = '/' + routePath; - } + for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } - path += '#' + routePath; + ret._without = args; + return ret; + }; + + function _keys(ret, mixin, seen) { + if (seen[_emberUtils.guidFor(mixin)]) { + return; } + seen[_emberUtils.guidFor(mixin)] = true; - return path; + if (mixin.properties) { + var props = Object.keys(mixin.properties); + for (var i = 0; i < props.length; i++) { + var key = props[i]; + ret[key] = true; + } + } else if (mixin.mixins) { + mixin.mixins.forEach(function (x) { + return _keys(ret, x, seen); + }); + } } -}); -enifed('ember-routing/location/hash_location', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/location/api'], function (exports, _emberMetal, _emberRuntime, _emberRoutingLocationApi) { - 'use strict'; - /** - @module ember - @submodule ember-routing - */ + MixinPrototype.keys = function () { + var keys = {}; + var seen = {}; + + _keys(keys, this, seen); + var ret = Object.keys(keys); + return ret; + }; + + var REQUIRED = new _emberMetalProperties.Descriptor(); + REQUIRED.toString = function () { + return '(Required Property)'; + }; /** - `Ember.HashLocation` implements the location API using the browser's - hash. At present, it relies on a `hashchange` event existing in the - browser. + Denotes a required property for a mixin - @class HashLocation - @namespace Ember - @extends Ember.Object + @method required + @for Ember @private */ - exports.default = _emberRuntime.Object.extend({ - implementation: 'hash', - init: function () { - _emberMetal.set(this, 'location', _emberMetal.get(this, '_location') || window.location); + function required() { + return REQUIRED; + } - this._hashchangeHandler = undefined; - }, + function Alias(methodName) { + this.isDescriptor = true; + this.methodName = methodName; + } - /** - @private - Returns normalized location.hash - @since 1.5.1 - @method getHash - */ - getHash: _emberRoutingLocationApi.default._getHash, + Alias.prototype = new _emberMetalProperties.Descriptor(); - /** - Returns the normalized URL, constructed from `location.hash`. - e.g. `#/foo` => `/foo` as well as `#/foo#bar` => `/foo#bar`. - By convention, hashed paths must begin with a forward slash, otherwise they - are not treated as a path so we can distinguish intent. - @private - @method getURL - */ - getURL: function () { - var originalPath = this.getHash().substr(1); - var outPath = originalPath; + /** + Makes a method available via an additional name. + + ```javascript + App.Person = Ember.Object.extend({ + name: function() { + return 'Tomhuda Katzdale'; + }, + moniker: Ember.aliasMethod('name') + }); + + let goodGuy = App.Person.create(); + + goodGuy.name(); // 'Tomhuda Katzdale' + goodGuy.moniker(); // 'Tomhuda Katzdale' + ``` + + @method aliasMethod + @for Ember + @param {String} methodName name of the method to alias + @public + */ - if (outPath.charAt(0) !== '/') { - outPath = '/'; + function aliasMethod(methodName) { + return new Alias(methodName); + } - // Only add the # if the path isn't empty. - // We do NOT want `/#` since the ampersand - // is only included (conventionally) when - // the location.hash has a value - if (originalPath) { - outPath += '#' + originalPath; - } - } + // .......................................................... + // OBSERVER HELPER + // - return outPath; - }, + /** + Specify a method that observes property changes. + + ```javascript + Ember.Object.extend({ + valueObserver: Ember.observer('value', function() { + // Executes whenever the "value" property changes + }) + }); + ``` + + Also available as `Function.prototype.observes` if prototype extensions are + enabled. + + @method observer + @for Ember + @param {String} propertyNames* + @param {Function} func + @return func + @public + */ - /** - Set the `location.hash` and remembers what was set. This prevents - `onUpdateURL` callbacks from triggering when the hash was set by - `HashLocation`. - @private - @method setURL - @param path {String} - */ - setURL: function (path) { - _emberMetal.get(this, 'location').hash = path; - _emberMetal.set(this, 'lastSetURL', path); - }, + function observer() { + for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; + } - /** - Uses location.replace to update the url without a page reload - or history modification. - @private - @method replaceURL - @param path {String} - */ - replaceURL: function (path) { - _emberMetal.get(this, 'location').replace('#' + path); - _emberMetal.set(this, 'lastSetURL', path); - }, + var func = args.slice(-1)[0]; + var paths = undefined; - /** - Register a callback to be invoked when the hash changes. These - callbacks will execute when the user presses the back or forward - button, but not after `setURL` is invoked. - @private - @method onUpdateURL - @param callback {Function} - */ - onUpdateURL: function (callback) { - var _this = this; + var addWatchedProperty = function (path) { + paths.push(path); + }; + var _paths = args.slice(0, -1); - this._removeEventListener(); + if (typeof func !== 'function') { - this._hashchangeHandler = function () { - _emberMetal.run(function () { - var path = _this.getURL(); - if (_emberMetal.get(_this, 'lastSetURL') === path) { - return; - } + func = args[0]; - _emberMetal.set(_this, 'lastSetURL', null); + // revert to old, soft-deprecated argument ordering + _paths = args.slice(1); + } - callback(path); - }); - }; + paths = []; - window.addEventListener('hashchange', this._hashchangeHandler); - }, - - /** - Given a URL, formats it to be placed into the page as part - of an element's `href` attribute. - This is used, for example, when using the {{action}} helper - to generate a URL based on an event. - @private - @method formatURL - @param url {String} - */ - formatURL: function (url) { - return '#' + url; - }, - - /** - Cleans up the HashLocation event listener. - @private - @method willDestroy - */ - willDestroy: function () { - this._removeEventListener(); - }, - - _removeEventListener: function () { - if (this._hashchangeHandler) { - window.removeEventListener('hashchange', this._hashchangeHandler); - } + for (var i = 0; i < _paths.length; ++i) { + _emberMetalExpand_properties.default(_paths[i], addWatchedProperty); } - }); -}); -enifed('ember-routing/location/history_location', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/location/api'], function (exports, _emberMetal, _emberRuntime, _emberRoutingLocationApi) { - 'use strict'; - /** - @module ember - @submodule ember-routing - */ + if (typeof func !== 'function') { + throw new _emberMetalError.default('Ember.observer called without a function'); + } - var popstateFired = false; + func.__ember_observes__ = paths; + return func; + } /** - Ember.HistoryLocation implements the location API using the browser's - history.pushState API. + Specify a method that observes property changes. - @class HistoryLocation - @namespace Ember - @extends Ember.Object + ```javascript + Ember.Object.extend({ + valueObserver: Ember.immediateObserver('value', function() { + // Executes whenever the "value" property changes + }) + }); + ``` + + In the future, `Ember.observer` may become asynchronous. In this event, + `Ember.immediateObserver` will maintain the synchronous behavior. + + Also available as `Function.prototype.observesImmediately` if prototype extensions are + enabled. + + @method _immediateObserver + @for Ember + @param {String} propertyNames* + @param {Function} func + @deprecated Use `Ember.observer` instead. + @return func @private */ - exports.default = _emberRuntime.Object.extend({ - implementation: 'history', - init: function () { - this._super.apply(this, arguments); + function _immediateObserver() { - var base = document.querySelector('base'); - var baseURL = base ? base.getAttribute('href') : ''; + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + } - _emberMetal.set(this, 'baseURL', baseURL); - _emberMetal.set(this, 'location', _emberMetal.get(this, 'location') || window.location); + return observer.apply(this, arguments); + } - this._popstateHandler = undefined; - }, + /** + When observers fire, they are called with the arguments `obj`, `keyName`. + + Note, `@each.property` observer is called per each add or replace of an element + and it's not called with a specific enumeration item. + + A `_beforeObserver` fires before a property changes. + + @method beforeObserver + @for Ember + @param {String} propertyNames* + @param {Function} func + @return func + @deprecated + @private + */ - /** - Used to set state on first call to setURL - @private - @method initState - */ - initState: function () { - var history = _emberMetal.get(this, 'history') || window.history; - _emberMetal.set(this, 'history', history); + function _beforeObserver() { + for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { + args[_key5] = arguments[_key5]; + } - if (history && 'state' in history) { - this.supportsHistory = true; - } + var func = args.slice(-1)[0]; + var paths = undefined; - this.replaceState(this.formatURL(this.getURL())); - }, + var addWatchedProperty = function (path) { + paths.push(path); + }; - /** - Will be pre-pended to path upon state change - @property rootURL - @default '/' - @private - */ - rootURL: '/', + var _paths = args.slice(0, -1); - /** - Returns the current `location.pathname` without `rootURL` or `baseURL` - @private - @method getURL - @return url {String} - */ - getURL: function () { - var location = _emberMetal.get(this, 'location'); - var path = location.pathname; + if (typeof func !== 'function') { + // revert to old, soft-deprecated argument ordering - var rootURL = _emberMetal.get(this, 'rootURL'); - var baseURL = _emberMetal.get(this, 'baseURL'); + func = args[0]; + _paths = args.slice(1); + } - // remove trailing slashes if they exists - rootURL = rootURL.replace(/\/$/, ''); - baseURL = baseURL.replace(/\/$/, ''); + paths = []; - // remove baseURL and rootURL from start of path - var url = path.replace(new RegExp('^' + baseURL + '(?=/|$)'), '').replace(new RegExp('^' + rootURL + '(?=/|$)'), ''); + for (var i = 0; i < _paths.length; ++i) { + _emberMetalExpand_properties.default(_paths[i], addWatchedProperty); + } - var search = location.search || ''; - url += search; - url += this.getHash(); + if (typeof func !== 'function') { + throw new _emberMetalError.default('_beforeObserver called without a function'); + } - return url; - }, + func.__ember_observesBefore__ = paths; + return func; + } - /** - Uses `history.pushState` to update the url without a page reload. - @private - @method setURL - @param path {String} - */ - setURL: function (path) { - var state = this.getState(); - path = this.formatURL(path); + exports.Mixin = Mixin; + exports.REQUIRED = REQUIRED; +}); - if (!state || state.path !== path) { - this.pushState(path); - } - }, +// it is possible to use concatenatedProperties with strings (which cannot be frozen) +// only freeze objects... - /** - Uses `history.replaceState` to update the url without a page reload - or history modification. - @private - @method replaceURL - @param path {String} - */ - replaceURL: function (path) { - var state = this.getState(); - path = this.formatURL(path); +// prevent mutating `concatenatedProperties` array after it is applied +// use conditional to avoid stringifying every time +enifed('ember-metal/observer', ['exports', 'ember-metal/watching', 'ember-metal/events'], function (exports, _emberMetalWatching, _emberMetalEvents) { + 'use strict'; - if (!state || state.path !== path) { - this.replaceState(path); - } - }, + exports.addObserver = addObserver; + exports.observersFor = observersFor; + exports.removeObserver = removeObserver; + exports._addBeforeObserver = _addBeforeObserver; + exports._suspendObserver = _suspendObserver; + exports._suspendObservers = _suspendObservers; + exports._removeBeforeObserver = _removeBeforeObserver; - /** - Get the current `history.state`. Checks for if a polyfill is - required and if so fetches this._historyState. The state returned - from getState may be null if an iframe has changed a window's - history. - @private - @method getState - @return state {Object} - */ - getState: function () { - if (this.supportsHistory) { - return _emberMetal.get(this, 'history').state; - } + /** + @module ember-metal + */ - return this._historyState; - }, + var AFTER_OBSERVERS = ':change'; + var BEFORE_OBSERVERS = ':before'; - /** - Pushes a new state. - @private - @method pushState - @param path {String} - */ - pushState: function (path) { - var state = { path: path }; + function changeEvent(keyName) { + return keyName + AFTER_OBSERVERS; + } - _emberMetal.get(this, 'history').pushState(state, null, path); + function beforeEvent(keyName) { + return keyName + BEFORE_OBSERVERS; + } - this._historyState = state; + /** + @method addObserver + @for Ember + @param obj + @param {String} _path + @param {Object|Function} target + @param {Function|String} [method] + @public + */ - // used for webkit workaround - this._previousURL = this.getURL(); - }, + function addObserver(obj, _path, target, method) { + _emberMetalEvents.addListener(obj, changeEvent(_path), target, method); + _emberMetalWatching.watch(obj, _path); - /** - Replaces the current state. - @private - @method replaceState - @param path {String} - */ - replaceState: function (path) { - var state = { path: path }; - _emberMetal.get(this, 'history').replaceState(state, null, path); + return this; + } - this._historyState = state; + function observersFor(obj, path) { + return _emberMetalEvents.listenersFor(obj, changeEvent(path)); + } - // used for webkit workaround - this._previousURL = this.getURL(); - }, + /** + @method removeObserver + @for Ember + @param obj + @param {String} path + @param {Object|Function} target + @param {Function|String} [method] + @public + */ - /** - Register a callback to be invoked whenever the browser - history changes, including using forward and back buttons. - @private - @method onUpdateURL - @param callback {Function} - */ - onUpdateURL: function (callback) { - var _this = this; + function removeObserver(obj, path, target, method) { + _emberMetalWatching.unwatch(obj, path); + _emberMetalEvents.removeListener(obj, changeEvent(path), target, method); - this._removeEventListener(); + return this; + } - this._popstateHandler = function () { - // Ignore initial page load popstate event in Chrome - if (!popstateFired) { - popstateFired = true; - if (_this.getURL() === _this._previousURL) { - return; - } - } - callback(_this.getURL()); - }; + /** + @method _addBeforeObserver + @for Ember + @param obj + @param {String} path + @param {Object|Function} target + @param {Function|String} [method] + @deprecated + @private + */ - window.addEventListener('popstate', this._popstateHandler); - }, + function _addBeforeObserver(obj, path, target, method) { + _emberMetalEvents.addListener(obj, beforeEvent(path), target, method); + _emberMetalWatching.watch(obj, path); - /** - Used when using `{{action}}` helper. The url is always appended to the rootURL. - @private - @method formatURL - @param url {String} - @return formatted url {String} - */ - formatURL: function (url) { - var rootURL = _emberMetal.get(this, 'rootURL'); - var baseURL = _emberMetal.get(this, 'baseURL'); + return this; + } - if (url !== '') { - // remove trailing slashes if they exists - rootURL = rootURL.replace(/\/$/, ''); - baseURL = baseURL.replace(/\/$/, ''); - } else if (baseURL.match(/^\//) && rootURL.match(/^\//)) { - // if baseURL and rootURL both start with a slash - // ... remove trailing slash from baseURL if it exists - baseURL = baseURL.replace(/\/$/, ''); - } + // Suspend observer during callback. + // + // This should only be used by the target of the observer + // while it is setting the observed path. - return baseURL + rootURL + url; - }, + function _suspendObserver(obj, path, target, method, callback) { + return _emberMetalEvents.suspendListener(obj, changeEvent(path), target, method, callback); + } - /** - Cleans up the HistoryLocation event listener. - @private - @method willDestroy - */ - willDestroy: function () { - this._removeEventListener(); - }, + function _suspendObservers(obj, paths, target, method, callback) { + var events = paths.map(changeEvent); + return _emberMetalEvents.suspendListeners(obj, events, target, method, callback); + } - /** - @private - Returns normalized location.hash - @method getHash - */ - getHash: _emberRoutingLocationApi.default._getHash, + /** + @method removeBeforeObserver + @for Ember + @param obj + @param {String} path + @param {Object|Function} target + @param {Function|String} [method] + @deprecated + @private + */ - _removeEventListener: function () { - if (this._popstateHandler) { - window.removeEventListener('popstate', this._popstateHandler); - } - } - }); + function _removeBeforeObserver(obj, path, target, method) { + _emberMetalWatching.unwatch(obj, path); + _emberMetalEvents.removeListener(obj, beforeEvent(path), target, method); + + return this; + } }); -enifed('ember-routing/location/none_location', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { +enifed('ember-metal/observer_set', ['exports', 'ember-utils', 'ember-metal/events'], function (exports, _emberUtils, _emberMetalEvents) { 'use strict'; - /** - @module ember - @submodule ember-routing + /* + this.observerSet = { + [senderGuid]: { // variable name: `keySet` + [keyName]: listIndex + } + }, + this.observers = [ + { + sender: obj, + keyName: keyName, + eventName: eventName, + listeners: [ + [target, method, flags] + ] + }, + ... + ] */ - /** - Ember.NoneLocation does not interact with the browser. It is useful for - testing, or when you need to manage state with your Router, but temporarily - don't want it to muck with the URL (for example when you embed your - application in a larger page). - - @class NoneLocation - @namespace Ember - @extends Ember.Object - @private - */ - exports.default = _emberRuntime.Object.extend({ - implementation: 'none', - path: '', + var ObserverSet = (function () { + function ObserverSet() { + this.clear(); + } - detect: function () { - var rootURL = this.rootURL; - }, + ObserverSet.prototype.add = function add(sender, keyName, eventName) { + var observerSet = this.observerSet; + var observers = this.observers; + var senderGuid = _emberUtils.guidFor(sender); + var keySet = observerSet[senderGuid]; + var index = undefined; - /** - Will be pre-pended to path. - @private - @property rootURL - @default '/' - */ - rootURL: '/', + if (!keySet) { + observerSet[senderGuid] = keySet = {}; + } + index = keySet[keyName]; + if (index === undefined) { + index = observers.push({ + sender: sender, + keyName: keyName, + eventName: eventName, + listeners: [] + }) - 1; + keySet[keyName] = index; + } + return observers[index].listeners; + }; - /** - Returns the current path without `rootURL`. - @private - @method getURL - @return {String} path - */ - getURL: function () { - var path = _emberMetal.get(this, 'path'); - var rootURL = _emberMetal.get(this, 'rootURL'); + ObserverSet.prototype.flush = function flush() { + var observers = this.observers; + var i = undefined, + observer = undefined, + sender = undefined; + this.clear(); + for (i = 0; i < observers.length; ++i) { + observer = observers[i]; + sender = observer.sender; + if (sender.isDestroying || sender.isDestroyed) { + continue; + } + _emberMetalEvents.sendEvent(sender, observer.eventName, [sender, observer.keyName], observer.listeners); + } + }; - // remove trailing slashes if they exists - rootURL = rootURL.replace(/\/$/, ''); + ObserverSet.prototype.clear = function clear() { + this.observerSet = {}; + this.observers = []; + }; - // remove rootURL from url - return path.replace(new RegExp('^' + rootURL + '(?=/|$)'), ''); - }, + return ObserverSet; + })(); - /** - Set the path and remembers what was set. Using this method - to change the path will not invoke the `updateURL` callback. - @private - @method setURL - @param path {String} - */ - setURL: function (path) { - _emberMetal.set(this, 'path', path); - }, + exports.default = ObserverSet; +}); +enifed('ember-metal/path_cache', ['exports', 'ember-metal/cache'], function (exports, _emberMetalCache) { + 'use strict'; - /** - Register a callback to be invoked when the path changes. These - callbacks will execute when the user presses the back or forward - button, but not after `setURL` is invoked. - @private - @method onUpdateURL - @param callback {Function} - */ - onUpdateURL: function (callback) { - this.updateCallback = callback; - }, + exports.isGlobal = isGlobal; + exports.isGlobalPath = isGlobalPath; + exports.hasThis = hasThis; + exports.isPath = isPath; + exports.getFirstKey = getFirstKey; + exports.getTailPath = getTailPath; - /** - Sets the path and calls the `updateURL` callback. - @private - @method handleURL - @param callback {Function} - */ - handleURL: function (url) { - _emberMetal.set(this, 'path', url); - this.updateCallback(url); - }, + var IS_GLOBAL = /^[A-Z$]/; + var IS_GLOBAL_PATH = /^[A-Z$].*[\.]/; + var HAS_THIS = 'this.'; - /** - Given a URL, formats it to be placed into the page as part - of an element's `href` attribute. - This is used, for example, when using the {{action}} helper - to generate a URL based on an event. - @private - @method formatURL - @param url {String} - @return {String} url - */ - formatURL: function (url) { - var rootURL = _emberMetal.get(this, 'rootURL'); - - if (url !== '') { - // remove trailing slashes if they exists - rootURL = rootURL.replace(/\/$/, ''); - } + var isGlobalCache = new _emberMetalCache.default(1000, function (key) { + return IS_GLOBAL.test(key); + }); + var isGlobalPathCache = new _emberMetalCache.default(1000, function (key) { + return IS_GLOBAL_PATH.test(key); + }); + var hasThisCache = new _emberMetalCache.default(1000, function (key) { + return key.lastIndexOf(HAS_THIS, 0) === 0; + }); + var firstDotIndexCache = new _emberMetalCache.default(1000, function (key) { + return key.indexOf('.'); + }); - return rootURL + url; + var firstKeyCache = new _emberMetalCache.default(1000, function (path) { + var index = firstDotIndexCache.get(path); + if (index === -1) { + return path; + } else { + return path.slice(0, index); } }); -}); -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; - function getPath(location) { - var pathname = location.pathname; - // Various versions of IE/Opera don't always return a leading slash - if (pathname.charAt(0) !== '/') { - pathname = '/' + pathname; + var tailPathCache = new _emberMetalCache.default(1000, function (path) { + var index = firstDotIndexCache.get(path); + if (index !== -1) { + return path.slice(index + 1); } + }); - return pathname; - } + var caches = { + isGlobalCache: isGlobalCache, + isGlobalPathCache: isGlobalPathCache, + hasThisCache: hasThisCache, + firstDotIndexCache: firstDotIndexCache, + firstKeyCache: firstKeyCache, + tailPathCache: tailPathCache + }; - /** - @private - - Returns the current `location.search`. - */ + exports.caches = caches; - function getQuery(location) { - return location.search; + function isGlobal(path) { + return isGlobalCache.get(path); } - /** - @private - - Returns the current `location.hash` by parsing location.href since browsers - inconsistently URL-decode `location.hash`. - - Should be passed the browser's `location` object as the first argument. - - https://bugzilla.mozilla.org/show_bug.cgi?id=483304 - */ + function isGlobalPath(path) { + return isGlobalPathCache.get(path); + } - function getHash(location) { - var href = location.href; - var hashIndex = href.indexOf('#'); + function hasThis(path) { + return hasThisCache.get(path); + } - if (hashIndex === -1) { - return ''; - } else { - return href.substr(hashIndex); - } + function isPath(path) { + return firstDotIndexCache.get(path) !== -1; } - function getFullPath(location) { - return getPath(location) + getQuery(location) + getHash(location); + function getFirstKey(path) { + return firstKeyCache.get(path); } - function getOrigin(location) { - var origin = location.origin; + function getTailPath(path) { + return tailPathCache.get(path); + } +}); +enifed('ember-metal/properties', ['exports', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/meta', 'ember-metal/property_events'], function (exports, _emberMetalDebug, _emberMetalFeatures, _emberMetalMeta, _emberMetalProperty_events) { + /** + @module ember-metal + */ - // Older browsers, especially IE, don't have origin - if (!origin) { - origin = location.protocol + '//' + location.hostname; + 'use strict'; - if (location.port) { - origin += ':' + location.port; - } - } + exports.Descriptor = Descriptor; + exports.MANDATORY_SETTER_FUNCTION = MANDATORY_SETTER_FUNCTION; + exports.DEFAULT_GETTER_FUNCTION = DEFAULT_GETTER_FUNCTION; + exports.INHERITING_GETTER_FUNCTION = INHERITING_GETTER_FUNCTION; + exports.defineProperty = defineProperty; - return origin; - } + // .......................................................... + // DESCRIPTOR + // - /* - `documentMode` only exist in Internet Explorer, and it's tested because IE8 running in - IE7 compatibility mode claims to support `onhashchange` but actually does not. - - `global` is an object that may have an `onhashchange` property. + /** + Objects of this type can implement an interface to respond to requests to + get and set. The default implementation handles simple properties. + @class Descriptor @private - @function supportsHashChange */ - function supportsHashChange(documentMode, global) { - return 'onhashchange' in global && (documentMode === undefined || documentMode > 7); + function Descriptor() { + this.isDescriptor = true; } - /* - `userAgent` is a user agent string. We use user agent testing here, because - the stock Android browser is known to have buggy versions of the History API, - in some Android versions. - - @private - @function supportsHistory - */ + var REDEFINE_SUPPORTED = (function () { + // https://github.com/spalger/kibana/commit/b7e35e6737df585585332857a4c397dc206e7ff9 + var a = Object.create(Object.prototype, { + prop: { + configurable: true, + value: 1 + } + }); - function supportsHistory(userAgent, history) { - // Boosted from Modernizr: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js - // The stock browser on Android 2.2 & 2.3, and 4.0.x returns positive on history support - // Unfortunately support is really buggy and there is no clean way to detect - // these bugs, so we fall back to a user agent sniff :( + Object.defineProperty(a, 'prop', { + configurable: true, + value: 2 + }); - // We only want Android 2 and 4.0, stock browser, and not Chrome which identifies - // itself as 'Mobile Safari' as well, nor Windows Phone. - if ((userAgent.indexOf('Android 2.') !== -1 || userAgent.indexOf('Android 4.0') !== -1) && userAgent.indexOf('Mobile Safari') !== -1 && userAgent.indexOf('Chrome') === -1 && userAgent.indexOf('Windows Phone') === -1) { - return false; + return a.prop === 2; + })(); + // .......................................................... + // DEFINING PROPERTIES API + // + + function MANDATORY_SETTER_FUNCTION(name) { + function SETTER_FUNCTION(value) { + var m = _emberMetalMeta.peekMeta(this); + if (!m.isInitialized(this)) { + m.writeValues(name, value); + } else {} } - return !!(history && 'pushState' in history); + SETTER_FUNCTION.isMandatorySetter = true; + return SETTER_FUNCTION; } - /** - Replaces the current location, making sure we explicitly include the origin - to prevent redirecting to a different origin. - - @private - */ - - function replacePath(location, path) { - location.replace(getOrigin(location) + path); + function DEFAULT_GETTER_FUNCTION(name) { + return function GETTER_FUNCTION() { + var meta = _emberMetalMeta.peekMeta(this); + return meta && meta.peekValues(name); + }; } -}); -enifed('ember-routing/services/routing', ['exports', 'ember-utils', 'ember-runtime', 'ember-metal', 'ember-routing/utils'], function (exports, _emberUtils, _emberRuntime, _emberMetal, _emberRoutingUtils) { - /** - @module ember - @submodule ember-routing - */ - 'use strict'; + function INHERITING_GETTER_FUNCTION(name) { + function IGETTER_FUNCTION() { + var meta = _emberMetalMeta.peekMeta(this); + var val = meta && meta.readInheritedValue('values', name); + + if (val === _emberMetalMeta.UNDEFINED) { + var proto = Object.getPrototypeOf(this); + return proto && proto[name]; + } else { + return val; + } + } + + IGETTER_FUNCTION.isInheritingGetter = true; + return IGETTER_FUNCTION; + } /** - The Routing service is used by LinkComponent, and provides facilities for - the component/view layer to interact with the router. + NOTE: This is a low-level method used by other parts of the API. You almost + never want to call this method directly. Instead you should use + `Ember.mixin()` to define new properties. - While still private, this service can eventually be opened up, and provides - the set of API needed for components to control routing without interacting - with router internals. + Defines a property on an object. This method works much like the ES5 + `Object.defineProperty()` method except that it can also accept computed + properties and other special descriptors. + + Normally this method takes only three parameters. However if you pass an + instance of `Descriptor` as the third param then you can pass an + optional value as the fourth parameter. This is often more efficient than + creating new descriptor hashes for each property. + + ## Examples + + ```javascript + // ES5 compatible mode + Ember.defineProperty(contact, 'firstName', { + writable: true, + configurable: false, + enumerable: true, + value: 'Charles' + }); + + // define a simple property + Ember.defineProperty(contact, 'lastName', undefined, 'Jolley'); + + // define a computed property + Ember.defineProperty(contact, 'fullName', Ember.computed('firstName', 'lastName', function() { + return this.firstName+' '+this.lastName; + })); + ``` @private - @class RoutingService + @method defineProperty + @for Ember + @param {Object} obj the object to define this property on. This may be a prototype. + @param {String} keyName the name of the property + @param {Descriptor} [desc] an instance of `Descriptor` (typically a + computed property) or an ES5 descriptor. + You must provide this or `data` but not both. + @param {*} [data] something other than a descriptor, that will + become the explicit value of this property. */ - exports.default = _emberRuntime.Service.extend({ - router: null, - - targetState: _emberRuntime.readOnly('router.targetState'), - currentState: _emberRuntime.readOnly('router.currentState'), - currentRouteName: _emberRuntime.readOnly('router.currentRouteName'), - currentPath: _emberRuntime.readOnly('router.currentPath'), - availableRoutes: function () { - return Object.keys(_emberMetal.get(this, 'router').router.recognizer.names); - }, + function defineProperty(obj, keyName, desc, data, meta) { + var possibleDesc = undefined, + existingDesc = undefined, + watching = undefined, + value = undefined; - hasRoute: function (routeName) { - return _emberMetal.get(this, 'router').hasRoute(routeName); - }, + if (!meta) { + meta = _emberMetalMeta.meta(obj); + } + var watchEntry = meta.peekWatching(keyName); + possibleDesc = obj[keyName]; + existingDesc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - transitionTo: function (routeName, models, queryParams, shouldReplace) { - var router = _emberMetal.get(this, 'router'); + watching = watchEntry !== undefined && watchEntry > 0; - var transition = router._doTransition(routeName, models, queryParams); + if (existingDesc) { + existingDesc.teardown(obj, keyName); + } - if (shouldReplace) { - transition.method('replace'); + if (desc instanceof Descriptor) { + value = desc; + if (false) { + if (watching) { + Object.defineProperty(obj, keyName, { + configurable: true, + enumerable: true, + writable: true, + value: value + }); + } else { + obj[keyName] = value; + } + } else { + obj[keyName] = value; } - - return transition; - }, - - normalizeQueryParams: function (routeName, models, queryParams) { - var router = _emberMetal.get(this, 'router'); - router._prepareQueryParams(routeName, models, queryParams); - }, - - generateURL: function (routeName, models, queryParams) { - var router = _emberMetal.get(this, 'router'); - if (!router.router) { - return; + if (desc.setup) { + desc.setup(obj, keyName); } + } else { + if (desc == null) { + value = data; - var visibleQueryParams = {}; - _emberUtils.assign(visibleQueryParams, queryParams); - - this.normalizeQueryParams(routeName, models, visibleQueryParams); - - var args = _emberRoutingUtils.routeArgs(routeName, models, visibleQueryParams); - return router.generate.apply(router, args); - }, - - isActiveForRoute: function (contexts, queryParams, routeName, routerState, isCurrentWhenSpecified) { - var router = _emberMetal.get(this, 'router'); + if (false) { + if (watching) { + meta.writeValues(keyName, data); - var handlers = router.router.recognizer.handlersFor(routeName); - var leafName = handlers[handlers.length - 1].handler; - var maximumContexts = numberOfContextsAcceptedByHandler(routeName, handlers); + var defaultDescriptor = { + configurable: true, + enumerable: true, + set: MANDATORY_SETTER_FUNCTION(keyName), + get: DEFAULT_GETTER_FUNCTION(keyName) + }; - // NOTE: any ugliness in the calculation of activeness is largely - // due to the fact that we support automatic normalizing of - // `resource` -> `resource.index`, even though there might be - // dynamic segments / query params defined on `resource.index` - // which complicates (and makes somewhat ambiguous) the calculation - // of activeness for links that link to `resource` instead of - // directly to `resource.index`. + if (REDEFINE_SUPPORTED) { + Object.defineProperty(obj, keyName, defaultDescriptor); + } else { + handleBrokenPhantomDefineProperty(obj, keyName, defaultDescriptor); + } + } else { + obj[keyName] = data; + } + } else { + obj[keyName] = data; + } + } else { + value = desc; - // if we don't have enough contexts revert back to full route name - // this is because the leaf route will use one of the contexts - if (contexts.length > maximumContexts) { - routeName = leafName; + // fallback to ES5 + Object.defineProperty(obj, keyName, desc); } + } - return routerState.isActiveIntent(routeName, contexts, queryParams, !isCurrentWhenSpecified); + // if key is being watched, override chains that + // were initialized with the prototype + if (watching) { + _emberMetalProperty_events.overrideChains(obj, keyName, meta); } - }); - function numberOfContextsAcceptedByHandler(handler, handlerInfos) { - var req = 0; - for (var i = 0; i < handlerInfos.length; i++) { - req = req + handlerInfos[i].names.length; - if (handlerInfos[i].handler === handler) { - break; - } + // The `value` passed to the `didDefineProperty` hook is + // either the descriptor or data, whichever was passed. + if (obj.didDefineProperty) { + obj.didDefineProperty(obj, keyName, value); } - return req; + return this; + } + + function handleBrokenPhantomDefineProperty(obj, keyName, desc) { + // https://github.com/ariya/phantomjs/issues/11856 + Object.defineProperty(obj, keyName, { configurable: true, writable: true, value: 'iCry' }); + Object.defineProperty(obj, keyName, desc); } }); -enifed('ember-routing/system/cache', ['exports', 'ember-utils', 'ember-runtime'], function (exports, _emberUtils, _emberRuntime) { +enifed('ember-metal/property_events', ['exports', 'ember-utils', 'ember-metal/meta', 'ember-metal/events', 'ember-metal/tags', 'ember-metal/observer_set', 'ember-metal/features', 'ember-metal/transaction'], function (exports, _emberUtils, _emberMetalMeta, _emberMetalEvents, _emberMetalTags, _emberMetalObserver_set, _emberMetalFeatures, _emberMetalTransaction) { 'use strict'; + var PROPERTY_DID_CHANGE = _emberUtils.symbol('PROPERTY_DID_CHANGE'); + + exports.PROPERTY_DID_CHANGE = PROPERTY_DID_CHANGE; + var beforeObserverSet = new _emberMetalObserver_set.default(); + var observerSet = new _emberMetalObserver_set.default(); + var deferred = 0; + + // .......................................................... + // PROPERTY CHANGES + // + /** - A two-tiered cache with support for fallback values when doing lookups. - Uses "buckets" and then "keys" to cache values. + This function is called just before an object property is about to change. + It will notify any before observers and prepare caches among other things. + + Normally you will not need to call this method directly but if for some + reason you can't directly watch a property you can invoke this method + manually along with `Ember.propertyDidChange()` which you should call just + after the property value changes. + @method propertyWillChange + @for Ember + @param {Object} obj The object with the property that will change + @param {String} keyName The property key (or path) that will change. + @return {void} @private - @class BucketCache */ - exports.default = _emberRuntime.Object.extend({ - init: function () { - this.cache = new _emberUtils.EmptyObject(); - }, - - has: function (bucketKey) { - return !!this.cache[bucketKey]; - }, - - stash: function (bucketKey, key, value) { - var bucket = this.cache[bucketKey]; + function propertyWillChange(obj, keyName, _meta) { + var meta = _meta || _emberMetalMeta.peekMeta(obj); - if (!bucket) { - bucket = this.cache[bucketKey] = new _emberUtils.EmptyObject(); - } + if (meta && !meta.isInitialized(obj)) { + return; + } - bucket[key] = value; - }, + var watching = meta && meta.peekWatching(keyName) > 0; + var possibleDesc = obj[keyName]; + var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - lookup: function (bucketKey, prop, defaultValue) { - var cache = this.cache; - if (!this.has(bucketKey)) { - return defaultValue; - } + if (desc && desc.willChange) { + desc.willChange(obj, keyName); + } - var bucket = cache[bucketKey]; - if (prop in bucket && bucket[prop] !== undefined) { - return bucket[prop]; - } else { - return defaultValue; - } + if (watching) { + dependentKeysWillChange(obj, keyName, meta); + chainsWillChange(obj, keyName, meta); + notifyBeforeObservers(obj, keyName, meta); } - }); -}); -enifed("ember-routing/system/controller_for", ["exports"], function (exports) { - /** - @module ember - @submodule ember-routing - */ + } /** - Finds a controller instance. + This function is called just after an object property has changed. + It will notify any observers and clear caches among other things. + + Normally you will not need to call this method directly but if for some + reason you can't directly watch a property you can invoke this method + manually along with `Ember.propertyWillChange()` which you should call just + before the property value changes. + @method propertyDidChange @for Ember - @method controllerFor + @param {Object} obj The object with the property that will change + @param {String} keyName The property key (or path) that will change. + @param {Meta} meta The objects meta. + @return {void} @private */ - "use strict"; + function propertyDidChange(obj, keyName, _meta) { + var meta = _meta || _emberMetalMeta.peekMeta(obj); - exports.default = controllerFor; + if (meta && !meta.isInitialized(obj)) { + return; + } - function controllerFor(container, controllerName, lookupOptions) { - return container.lookup("controller:" + controllerName, lookupOptions); - } -}); -enifed('ember-routing/system/dsl', ['exports', 'ember-utils', 'ember-metal'], function (exports, _emberUtils, _emberMetal) { - 'use strict'; + var watching = meta && meta.peekWatching(keyName) > 0; + var possibleDesc = obj[keyName]; + var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - /** - @module ember - @submodule ember-routing - */ + // shouldn't this mean that we're watching this key? + if (desc && desc.didChange) { + desc.didChange(obj, keyName); + } - function DSL(name, options) { - this.parent = name; - this.enableLoadingSubstates = options && options.enableLoadingSubstates; - this.matches = []; - this.explicitIndex = undefined; - this.options = options; - } + if (watching) { + if (meta.hasDeps(keyName)) { + dependentKeysDidChange(obj, keyName, meta); + } - exports.default = DSL; + chainsDidChange(obj, keyName, meta, false); + notifyObservers(obj, keyName, meta); + } - DSL.prototype = { - route: function (name, options, callback) { - var dummyErrorRoute = '/_unused_dummy_error_path_route_' + name + '/:error'; - if (arguments.length === 2 && typeof options === 'function') { - callback = options; - options = {}; - } + if (obj[PROPERTY_DID_CHANGE]) { + obj[PROPERTY_DID_CHANGE](keyName); + } - if (arguments.length === 1) { - options = {}; - } + if (meta && meta.isSourceDestroying()) { + return; + } - if (this.enableLoadingSubstates) { - createRoute(this, name + '_loading', { resetNamespace: options.resetNamespace }); - createRoute(this, name + '_error', { resetNamespace: options.resetNamespace, path: dummyErrorRoute }); - } + _emberMetalTags.markObjectAsDirty(meta, keyName); - if (callback) { - var fullName = getFullName(this, name, options.resetNamespace); - var dsl = new DSL(fullName, this.options); + if (false || true) { + _emberMetalTransaction.assertNotRendered(obj, keyName, meta); + } + } - createRoute(dsl, 'loading'); - createRoute(dsl, 'error', { path: dummyErrorRoute }); + var WILL_SEEN = undefined, + DID_SEEN = undefined; + // called whenever a property is about to change to clear the cache of any dependent keys (and notify those properties of changes, etc...) + function dependentKeysWillChange(obj, depKey, meta) { + if (meta && meta.isSourceDestroying()) { + return; + } - callback.call(dsl); + if (meta && meta.hasDeps(depKey)) { + var seen = WILL_SEEN; + var _top = !seen; - createRoute(this, name, options, dsl.generate()); - } else { - createRoute(this, name, options); + if (_top) { + seen = WILL_SEEN = {}; } - }, - push: function (url, name, callback, serialize) { - var parts = name.split('.'); + iterDeps(propertyWillChange, obj, depKey, seen, meta); - if (this.options.engineInfo) { - var localFullName = name.slice(this.options.engineInfo.fullName.length + 1); - var routeInfo = _emberUtils.assign({ localFullName: localFullName }, this.options.engineInfo); + if (_top) { + WILL_SEEN = null; + } + } + } - if (serialize) { - routeInfo.serializeMethod = serialize; - } + // called whenever a property has just changed to update dependent keys + function dependentKeysDidChange(obj, depKey, meta) { + if (meta && meta.isSourceDestroying()) { + return; + } - this.options.addRouteForEngine(name, routeInfo); - } else if (serialize) { - throw new Error('Defining a route serializer on route \'' + name + '\' outside an Engine is not allowed.'); - } + if (meta && meta.hasDeps(depKey)) { + var seen = DID_SEEN; + var _top2 = !seen; - if (url === '' || url === '/' || parts[parts.length - 1] === 'index') { - this.explicitIndex = true; + if (_top2) { + seen = DID_SEEN = {}; } - this.matches.push([url, name, callback]); - }, + iterDeps(propertyDidChange, obj, depKey, seen, meta); - resource: function (name, options, callback) { - if (arguments.length === 2 && typeof options === 'function') { - callback = options; - options = {}; + if (_top2) { + DID_SEEN = null; } + } + } - if (arguments.length === 1) { - options = {}; - } + function iterDeps(method, obj, depKey, seen, meta) { + var possibleDesc = undefined, + desc = undefined; + var guid = _emberUtils.guidFor(obj); + var current = seen[guid]; - options.resetNamespace = true; + if (!current) { + current = seen[guid] = {}; + } - this.route(name, options, callback); - }, + if (current[depKey]) { + return; + } - generate: function () { - var dslMatches = this.matches; + current[depKey] = true; - if (!this.explicitIndex) { - this.route('index', { path: '/' }); + meta.forEachInDeps(depKey, function (key, value) { + if (!value) { + return; } - return function (match) { - for (var i = 0; i < dslMatches.length; i++) { - var dslMatch = dslMatches[i]; - match(dslMatch[0]).to(dslMatch[1], dslMatch[2]); - } - }; - } - }; + possibleDesc = obj[key]; + desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - function canNest(dsl) { - return dsl.parent && dsl.parent !== 'application'; + if (desc && desc._suspended === obj) { + return; + } + + method(obj, key, meta); + }); } - function getFullName(dsl, name, resetNamespace) { - if (canNest(dsl) && resetNamespace !== true) { - return dsl.parent + '.' + name; - } else { - return name; + function chainsWillChange(obj, keyName, meta) { + var chainWatchers = meta.readableChainWatchers(); + if (chainWatchers) { + chainWatchers.notify(keyName, false, propertyWillChange); } } - function createRoute(dsl, name, options, callback) { - options = options || {}; - - var fullName = getFullName(dsl, name, options.resetNamespace); - - if (typeof options.path !== 'string') { - options.path = '/' + name; + function chainsDidChange(obj, keyName, meta) { + var chainWatchers = meta.readableChainWatchers(); + if (chainWatchers) { + chainWatchers.notify(keyName, true, propertyDidChange); } - - dsl.push(options.path, fullName, callback, options.serialize); } - DSL.map = function (callback) { - var dsl = new DSL(); - callback.call(dsl); - return dsl; - }; + function overrideChains(obj, keyName, meta) { + var chainWatchers = meta.readableChainWatchers(); + if (chainWatchers) { + chainWatchers.revalidate(keyName); + } + } - var uuid = 0; + /** + @method beginPropertyChanges + @chainable + @private + */ + function beginPropertyChanges() { + deferred++; + } - DSL.prototype.mount = function (_name, _options) { - var options = _options || {}; - var engineRouteMap = this.options.resolveRouteMap(_name); - var name = _name; + /** + @method endPropertyChanges + @private + */ + function endPropertyChanges() { + deferred--; + if (deferred <= 0) { + beforeObserverSet.clear(); + observerSet.flush(); + } + } - if (options.as) { - name = options.as; + /** + Make a series of property changes together in an + exception-safe way. + + ```javascript + Ember.changeProperties(function() { + obj1.set('foo', mayBlowUpWhenSet); + obj2.set('bar', baz); + }); + ``` + + @method changeProperties + @param {Function} callback + @param [binding] + @private + */ + function changeProperties(callback, binding) { + beginPropertyChanges(); + try { + callback.call(binding); + } finally { + endPropertyChanges.call(binding); } + } - var fullName = getFullName(this, name, options.resetNamespace); + function notifyBeforeObservers(obj, keyName, meta) { + if (meta && meta.isSourceDestroying()) { + return; + } - var engineInfo = { - name: _name, - instanceId: uuid++, - mountPoint: fullName, - fullName: fullName - }; + var eventName = keyName + ':before'; + var listeners = undefined, + added = undefined; + if (deferred) { + listeners = beforeObserverSet.add(obj, keyName, eventName); + added = _emberMetalEvents.accumulateListeners(obj, eventName, listeners); + _emberMetalEvents.sendEvent(obj, eventName, [obj, keyName], added); + } else { + _emberMetalEvents.sendEvent(obj, eventName, [obj, keyName]); + } + } - var path = options.path; + function notifyObservers(obj, keyName, meta) { + if (meta && meta.isSourceDestroying()) { + return; + } - if (typeof path !== 'string') { - path = '/' + name; + var eventName = keyName + ':change'; + var listeners = undefined; + if (deferred) { + listeners = observerSet.add(obj, keyName, eventName); + _emberMetalEvents.accumulateListeners(obj, eventName, listeners); + } else { + _emberMetalEvents.sendEvent(obj, eventName, [obj, keyName]); } + } - var callback = undefined; - var dummyErrorRoute = '/_unused_dummy_error_path_route_' + name + '/:error'; - if (engineRouteMap) { - var shouldResetEngineInfo = false; - var oldEngineInfo = this.options.engineInfo; - if (oldEngineInfo) { - shouldResetEngineInfo = true; - this.options.engineInfo = engineInfo; - } + exports.propertyWillChange = propertyWillChange; + exports.propertyDidChange = propertyDidChange; + exports.overrideChains = overrideChains; + exports.beginPropertyChanges = beginPropertyChanges; + exports.endPropertyChanges = endPropertyChanges; + exports.changeProperties = changeProperties; +}); +enifed('ember-metal/property_get', ['exports', 'ember-metal/debug', 'ember-metal/path_cache'], function (exports, _emberMetalDebug, _emberMetalPath_cache) { + /** + @module ember-metal + */ - var optionsForChild = _emberUtils.assign({ engineInfo: engineInfo }, this.options); - var childDSL = new DSL(fullName, optionsForChild); + 'use strict'; - createRoute(childDSL, 'loading'); - createRoute(childDSL, 'error', { path: dummyErrorRoute }); + exports.get = get; + exports._getPath = _getPath; + exports.getWithDefault = getWithDefault; - engineRouteMap.call(childDSL); + var ALLOWABLE_TYPES = { + object: true, + function: true, + string: true + }; - callback = childDSL.generate(); + // .......................................................... + // 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 + // object. - if (shouldResetEngineInfo) { - this.options.engineInfo = oldEngineInfo; - } - } + /** + Gets the value of a property on an object. If the property is computed, + the function will be invoked. If the property is not defined but the + object implements the `unknownProperty` method then that will be invoked. + + ```javascript + Ember.get(obj, "name"); + ``` + + If you plan to run on IE8 and older browsers then you should use this + method anytime you want to retrieve a property on an object that you don't + know for sure is private. (Properties beginning with an underscore '_' + are considered private.) + + On all newer browsers, you only need to use this method to retrieve + properties if the property might not be defined on the object and you want + to respect the `unknownProperty` handler. Otherwise you can ignore this + method. + + Note that if the object itself is `undefined`, this method will throw + an error. + + @method get + @for Ember + @param {Object} obj The object to retrieve from. + @param {String} keyName The property key to retrieve + @return {Object} the property value or `null`. + @public + */ - var localFullName = 'application'; - var routeInfo = _emberUtils.assign({ localFullName: localFullName }, engineInfo); + function get(obj, keyName) { - if (this.enableLoadingSubstates) { - // These values are important to register the loading routes under their - // proper names for the Router and within the Engine's registry. - var substateName = name + '_loading'; - var _localFullName = 'application_loading'; - var _routeInfo = _emberUtils.assign({ localFullName: _localFullName }, engineInfo); - createRoute(this, substateName, { resetNamespace: options.resetNamespace }); - this.options.addRouteForEngine(substateName, _routeInfo); + var value = obj[keyName]; + var desc = value !== null && typeof value === 'object' && value.isDescriptor ? value : undefined; + var ret = undefined; - substateName = name + '_error'; - _localFullName = 'application_error'; - _routeInfo = _emberUtils.assign({ localFullName: _localFullName }, engineInfo); - createRoute(this, substateName, { resetNamespace: options.resetNamespace, path: dummyErrorRoute }); - this.options.addRouteForEngine(substateName, _routeInfo); + if (desc === undefined && _emberMetalPath_cache.isPath(keyName)) { + return _getPath(obj, keyName); } - this.options.addRouteForEngine(fullName, routeInfo); + if (desc) { + return desc.get(obj, keyName); + } else { + ret = value; - this.push(path, fullName, callback); - }; -}); -enifed('ember-routing/system/generate_controller', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; + if (ret === undefined && 'object' === typeof obj && !(keyName in obj) && 'function' === typeof obj.unknownProperty) { + return obj.unknownProperty(keyName); + } - exports.generateControllerFactory = generateControllerFactory; - exports.default = generateController; + return ret; + } + } - /** - @module ember - @submodule ember-routing - */ + function _getPath(root, path) { + var obj = root; + var parts = path.split('.'); - /** - Generates a controller factory - - @for Ember - @method generateControllerFactory - @private - */ + for (var i = 0; i < parts.length; i++) { + if (!isGettable(obj)) { + return undefined; + } - function generateControllerFactory(owner, controllerName) { - var Factory = owner._lookupFactory('controller:basic').extend({ - isGenerated: true, - toString: function () { - return '(generated ' + controllerName + ' controller)'; + obj = get(obj, parts[i]); + + if (obj && obj.isDestroyed) { + return undefined; } - }); + } - var fullName = 'controller:' + controllerName; + return obj; + } - owner.register(fullName, Factory); + function isGettable(obj) { + if (obj == null) { + return false; + } - return Factory; + return ALLOWABLE_TYPES[typeof obj]; } /** - Generates and instantiates a controller extending from `controller:basic` - if present, or `Ember.Controller` if not. + Retrieves the value of a property from an Object, or a default value in the + case that the property returns `undefined`. + + ```javascript + Ember.getWithDefault(person, 'lastName', 'Doe'); + ``` + @method getWithDefault @for Ember - @method generateController - @private - @since 1.3.0 + @param {Object} obj The object to retrieve from. + @param {String} keyName The name of the property to retrieve + @param {Object} defaultValue The value to return if the property value is undefined + @return {Object} The property value or the defaultValue. + @public */ - function generateController(owner, controllerName) { - generateControllerFactory(owner, controllerName); - - var fullName = 'controller:' + controllerName; - var instance = owner.lookup(fullName); - - if (_emberMetal.get(instance, 'namespace.LOG_ACTIVE_GENERATION')) {} + function getWithDefault(root, key, defaultValue) { + var value = get(root, key); - return instance; + if (value === undefined) { + return defaultValue; + } + return value; } -}); -enifed('ember-routing/system/query_params', ['exports', 'ember-runtime'], function (exports, _emberRuntime) { - 'use strict'; - exports.default = _emberRuntime.Object.extend({ - isQueryParams: true, - values: null - }); + exports.default = get; }); -enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-routing/system/generate_controller', 'ember-routing/utils'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberRoutingSystemGenerate_controller, _emberRoutingUtils) { +enifed('ember-metal/property_set', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_events', 'ember-metal/error', 'ember-metal/path_cache', 'ember-metal/meta'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_events, _emberMetalError, _emberMetalPath_cache, _emberMetalMeta) { 'use strict'; - exports.defaultSerialize = defaultSerialize; - exports.hasDefaultSerialize = hasDefaultSerialize; - var slice = Array.prototype.slice; + exports.set = set; + exports.trySet = trySet; - function K() { - return this; - } + /** + 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. + + ```javascript + Ember.set(obj, "name", value); + ``` + + @method set + @for Ember + @param {Object} obj The object to modify. + @param {String} keyName The property key to set + @param {Object} value The value to set + @return {Object} the passed value. + @public + */ - function defaultSerialize(model, params) { - if (params.length < 1) { - return; + function set(obj, keyName, value, tolerant) { + + if (_emberMetalPath_cache.isPath(keyName)) { + return setPath(obj, keyName, value, tolerant); } - if (!model) { - return; + + var meta = _emberMetalMeta.peekMeta(obj); + var possibleDesc = obj[keyName]; + + var desc = undefined, + currentValue = undefined; + if (possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor) { + desc = possibleDesc; + } else { + currentValue = possibleDesc; } - var name = params[0]; - var object = {}; + if (desc) { + /* computed property */ + desc.set(obj, keyName, value); + } else if (obj.setUnknownProperty && currentValue === undefined && !(keyName in obj)) { + obj.setUnknownProperty(keyName, value); + /* unknown property */ + } else if (currentValue === value) { + /* no change */ + return value; + } else { + _emberMetalProperty_events.propertyWillChange(obj, keyName); - if (params.length === 1) { - if (name in model) { - object[name] = _emberMetal.get(model, name); - } else if (/_id$/.test(name)) { - object[name] = _emberMetal.get(model, 'id'); + if (false) { + setWithMandatorySetter(meta, obj, keyName, value); + } else { + obj[keyName] = value; } - } else { - object = _emberMetal.getProperties(model, params); + + _emberMetalProperty_events.propertyDidChange(obj, keyName); } - return object; + return value; } - var DEFAULT_SERIALIZE = _emberUtils.symbol('DEFAULT_SERIALIZE'); + 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; + } + }; - defaultSerialize[DEFAULT_SERIALIZE] = true; + var makeEnumerable = function (obj, key) { + var desc = Object.getOwnPropertyDescriptor(obj, key); - function hasDefaultSerialize(route) { - return !!route.serialize[DEFAULT_SERIALIZE]; + if (desc && desc.set && desc.set.isMandatorySetter) { + desc.enumerable = true; + Object.defineProperty(obj, key, desc); + } + }; } - /** - @module ember - @submodule ember-routing - */ - - /** - The `Ember.Route` class is used to define individual routes. Refer to - the [routing guide](http://emberjs.com/guides/routing/) for documentation. - - @class Route - @namespace Ember - @extends Ember.Object - @uses Ember.ActionHandler - @uses Ember.Evented - @since 1.0.0 - @public - */ - var Route = _emberRuntime.Object.extend(_emberRuntime.ActionHandler, _emberRuntime.Evented, { - /** - Configuration hash for this route's queryParams. The possible - configuration options and their defaults are as follows - (assuming a query param whose controller property is `page`): - ```javascript - queryParams: { - page: { - // By default, controller query param properties don't - // cause a full transition when they are changed, but - // rather only cause the URL to update. Setting - // `refreshModel` to true will cause an "in-place" - // transition to occur, whereby the model hooks for - // this route (and any child routes) will re-fire, allowing - // you to reload models (e.g., from the server) using the - // updated query param values. - refreshModel: false, - // By default, changes to controller query param properties - // cause the URL to update via `pushState`, which means an - // item will be added to the browser's history, allowing - // you to use the back button to restore the app to the - // previous state before the query param property was changed. - // Setting `replace` to true will use `replaceState` (or its - // hash location equivalent), which causes no browser history - // item to be added. This options name and default value are - // the same as the `link-to` helper's `replace` option. - replace: false, - // By default, the query param URL key is the same name as - // the controller property name. Use `as` to specify a - // different URL key. - as: 'page' - } - } - ``` - @property queryParams - @for Ember.Route - @type Object - @since 1.6.0 - @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 - @since 1.0.0 - @public - */ - - /** - Sets the name for this route, including a fully resolved name for routes - inside engines. - @private - @method _setRouteName - @param {String} name - */ - _setRouteName: function (name) { - this.routeName = name; - this.fullRouteName = getEngineRouteName(_emberUtils.getOwner(this), name); - }, - - /** - Populates the QP meta information in the BucketCache. - @private - @method _populateQPMeta - */ - _populateQPMeta: function () { - this._bucketCache.stash('route-meta', this.fullRouteName, this.get('_qp')); - }, - - /** - @private - @property _qp - */ - _qp: _emberMetal.computed(function () { - var _this = this; + function setPath(root, path, value, tolerant) { + // get the last part of the path + var keyName = path.slice(path.lastIndexOf('.') + 1); - var controllerProto = undefined, - combinedQueryParameterConfiguration = undefined; + // get the first part of the part + path = path === keyName ? keyName : path.slice(0, path.length - (keyName.length + 1)); - var controllerName = this.controllerName || this.routeName; - var definedControllerClass = _emberUtils.getOwner(this)._lookupFactory('controller:' + controllerName); - var queryParameterConfiguraton = _emberMetal.get(this, 'queryParams'); - var hasRouterDefinedQueryParams = !!Object.keys(queryParameterConfiguraton).length; + // unless the path is this, look up the first part to + // get the root + if (path !== 'this') { + root = _emberMetalProperty_get._getPath(root, path); + } - if (definedControllerClass) { - // the developer has authored a controller class in their application for this route - // access the prototype, find its query params and normalize their object shape - // them merge in the query params for the route. As a mergedProperty, Route#queryParams is always - // at least `{}` - controllerProto = definedControllerClass.proto(); + if (!keyName || keyName.length === 0) { + throw new _emberMetalError.default('Property set failed: You passed an empty path'); + } - var controllerDefinedQueryParameterConfiguration = _emberMetal.get(controllerProto, 'queryParams'); - var normalizedControllerQueryParameterConfiguration = _emberRoutingUtils.normalizeControllerQueryParams(controllerDefinedQueryParameterConfiguration); - combinedQueryParameterConfiguration = mergeEachQueryParams(normalizedControllerQueryParameterConfiguration, queryParameterConfiguraton); - } 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(_emberUtils.getOwner(this), controllerName); - controllerProto = generatedControllerClass.proto(); - combinedQueryParameterConfiguration = queryParameterConfiguraton; + if (!root) { + if (tolerant) { + return; + } else { + throw new _emberMetalError.default('Property set failed: object in path "' + path + '" could not be found or was destroyed.'); } + } - var qps = []; - var map = {}; - var propertyNames = []; - - for (var propName in combinedQueryParameterConfiguration) { - if (!combinedQueryParameterConfiguration.hasOwnProperty(propName)) { - continue; - } - - // to support the dubious feature of using unknownProperty - // on queryParams configuration - if (propName === 'unknownProperty' || propName === '_super') { - // possible todo: issue deprecation warning? - continue; - } - - var desc = combinedQueryParameterConfiguration[propName]; - var scope = desc.scope || 'model'; - var parts = undefined; - - if (scope === 'controller') { - parts = []; - } - - var urlKey = desc.as || this.serializeQueryParamKey(propName); - var defaultValue = _emberMetal.get(controllerProto, propName); + return set(root, keyName, value); + } - if (Array.isArray(defaultValue)) { - defaultValue = _emberRuntime.A(defaultValue.slice()); - } + /** + Error-tolerant form of `Ember.set`. Will not blow up if any part of the + chain is `undefined`, `null`, or destroyed. + + This is primarily used when syncing bindings, which may try to update after + an object has been destroyed. + + @method trySet + @for Ember + @param {Object} root The object to modify. + @param {String} path The property path to set + @param {Object} value The value to set + @public + */ - var type = desc.type || _emberRuntime.typeOf(defaultValue); + function trySet(root, path, value) { + return set(root, path, value, true); + } +}); +enifed("ember-metal/replace", ["exports"], function (exports) { + "use strict"; - var defaultValueSerialized = this.serializeQueryParam(defaultValue, urlKey, type); - var scopedPropertyName = controllerName + ':' + propName; - var qp = { - undecoratedDefaultValue: _emberMetal.get(controllerProto, propName), - defaultValue: defaultValue, - serializedDefaultValue: defaultValueSerialized, - serializedValue: defaultValueSerialized, + exports.default = replace; + var splice = Array.prototype.splice; - type: type, - urlKey: urlKey, - prop: propName, - scopedPropertyName: scopedPropertyName, - controllerName: controllerName, - route: this, - parts: parts, // provided later when stashNames is called if 'model' scope - values: null, // provided later when setup is called. no idea why. - scope: scope - }; + 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; + var ends = amt; + var count = undefined, + chunk = undefined; - map[propName] = map[urlKey] = map[scopedPropertyName] = qp; - qps.push(qp); - propertyNames.push(propName); + while (args.length) { + count = ends > size ? size : ends; + if (count <= 0) { + count = 0; } - return { - qps: qps, - map: map, - propertyNames: propertyNames, - states: { - /* - Called when a query parameter changes in the URL, this route cares - about that query parameter, but the route is not currently - in the active route hierarchy. - */ - inactive: function (prop, value) { - var qp = map[prop]; - _this._qpChanged(prop, value, qp); - }, - /* - Called when a query parameter changes in the URL, this route cares - about that query parameter, and the route is currently - in the active route hierarchy. - */ - active: function (prop, value) { - var qp = map[prop]; - _this._qpChanged(prop, value, qp); - return _this._activeQPChanged(map[prop], value); - }, - /* - Called when a value of a query parameter this route handles changes in a controller - and the route is currently in the active route hierarchy. - */ - allowOverrides: function (prop, value) { - var qp = map[prop]; - _this._qpChanged(prop, value, qp); - return _this._updatingQPChanged(map[prop]); - } - } - }; - }), + chunk = args.splice(0, size); + chunk = [start, count].concat(chunk); - /** - @private - @property _names - */ - _names: null, + start += size; + ends -= count; - /** - @private - @method _stashNames - */ - _stashNames: function (_handlerInfo, dynamicParent) { - var handlerInfo = _handlerInfo; - if (this._names) { - return; - } - var names = this._names = handlerInfo._names; + ret = ret.concat(splice.apply(array, chunk)); + } + return ret; + } +}); +enifed('ember-metal/run_loop', ['exports', 'ember-utils', 'ember-metal/debug', 'ember-metal/testing', 'ember-metal/error_handler', 'ember-metal/property_events', 'backburner'], function (exports, _emberUtils, _emberMetalDebug, _emberMetalTesting, _emberMetalError_handler, _emberMetalProperty_events, _backburner) { + 'use strict'; - if (!names.length) { - handlerInfo = dynamicParent; - names = handlerInfo && handlerInfo._names || []; - } + exports.default = run; - var qps = _emberMetal.get(this, '_qp.qps'); + function onBegin(current) { + run.currentRunLoop = current; + } - var namePaths = new Array(names.length); - for (var a = 0; a < names.length; ++a) { - namePaths[a] = handlerInfo.name + '.' + names[a]; - } + function onEnd(current, next) { + run.currentRunLoop = next; + } - for (var i = 0; i < qps.length; ++i) { - var qp = qps[i]; - if (qp.scope === 'model') { - qp.parts = namePaths; - } - } + var onErrorTarget = { + get onerror() { + return _emberMetalError_handler.getOnerror(); }, + set onerror(handler) { + return _emberMetalError_handler.setOnerror(handler); + } + }; - /** - @private - @property _activeQPChanged - */ - _activeQPChanged: function (qp, value) { - var router = this.router; - router._activeQPChanged(qp.scopedPropertyName, value); + var backburner = new _backburner.default(['sync', 'actions', 'destroy'], { + GUID_KEY: _emberUtils.GUID_KEY, + sync: { + before: _emberMetalProperty_events.beginPropertyChanges, + after: _emberMetalProperty_events.endPropertyChanges }, + defaultQueue: 'actions', + onBegin: onBegin, + onEnd: onEnd, + onErrorTarget: onErrorTarget, + onErrorMethod: 'onerror' + }); - /** - @private - @method _updatingQPChanged - */ - _updatingQPChanged: function (qp) { - var router = this.router; - router._updatingQPChanged(qp.urlKey); - }, + // .......................................................... + // run - this is ideally the only public API the dev sees + // - mergedProperties: ['queryParams'], + /** + Runs the passed target and method inside of a RunLoop, ensuring any + deferred actions including bindings and views updates are flushed at the + end. + + Normally you should not need to invoke this method yourself. However if + you are implementing raw event handlers when interfacing with other + libraries or plugins, you should probably wrap all of your code inside this + call. + + ```javascript + run(function() { + // code to be executed within a RunLoop + }); + ``` + + @class run + @namespace Ember + @static + @constructor + @param {Object} [target] target of method to call + @param {Function|String} method Method to invoke. + May be a function or a string. If you pass a string + then it will be looked up on the passed target. + @param {Object} [args*] Any additional arguments you wish to pass to the method. + @return {Object} return value from invoking the passed function. + @public + */ - /** - Returns a hash containing the parameters of an ancestor route. - Example - ```javascript - App.Router.map(function() { - this.route('member', { path: ':name' }, function() { - this.route('interest', { path: ':interest' }); - }); - }); - App.MemberRoute = Ember.Route.extend({ - queryParams: { - memberQp: { refreshModel: true } - } - }); - App.MemberInterestRoute = Ember.Route.extend({ - queryParams: { - interestQp: { refreshModel: true } - }, - model() { - return this.paramsFor('member'); - } + function run() { + return backburner.run.apply(backburner, arguments); + } + + /** + If no run-loop is present, it creates a new one. If a run loop is + present it will queue itself to run on the existing run-loops action + queue. + + Please note: This is not for normal usage, and should be used sparingly. + + If invoked when not within a run loop: + + ```javascript + run.join(function() { + // creates a new run-loop + }); + ``` + + Alternatively, if called within an existing run loop: + + ```javascript + run(function() { + // creates a new run-loop + run.join(function() { + // joins with the existing run-loop, and queues for invocation on + // the existing run-loops action queue. }); - ``` - If we visit `/turing/maths?memberQp=member&interestQp=interest` the model for - the `member.interest` route is hash with: - * `name`: `turing` - * `memberQp`: `member` - @method paramsFor - @param {String} name - @return {Object} hash containing the parameters of the route `name` - @since 1.4.0 - @public - */ - paramsFor: function (name) { - var route = _emberUtils.getOwner(this).lookup('route:' + name); + }); + ``` + + @method join + @namespace Ember + @param {Object} [target] target of method to call + @param {Function|String} method Method to invoke. + May be a function or a string. If you pass a string + then it will be looked up on the passed target. + @param {Object} [args*] Any additional arguments you wish to pass to the method. + @return {Object} Return value from invoking the passed function. Please note, + when called within an existing loop, no return value is possible. + @public + */ + run.join = function () { + return backburner.join.apply(backburner, arguments); + }; - if (!route) { - return {}; + /** + Allows you to specify which context to call the specified function in while + adding the execution of that function to the Ember run loop. This ability + makes this method a great way to asynchronously integrate third-party libraries + into your Ember application. + + `run.bind` takes two main arguments, the desired context and the function to + invoke in that context. Any additional arguments will be supplied as arguments + to the function that is passed in. + + Let's use the creation of a TinyMCE component as an example. Currently, + TinyMCE provides a setup configuration option we can use to do some processing + after the TinyMCE instance is initialized but before it is actually rendered. + We can use that setup option to do some additional setup for our component. + The component itself could look something like the following: + + ```javascript + App.RichTextEditorComponent = Ember.Component.extend({ + initializeTinyMCE: Ember.on('didInsertElement', function() { + tinymce.init({ + selector: '#' + this.$().prop('id'), + setup: Ember.run.bind(this, this.setupEditor) + }); + }), + + setupEditor: function(editor) { + this.set('editor', editor); + + editor.on('change', function() { + console.log('content changed!'); + }); } + }); + ``` + + In this example, we use Ember.run.bind to bind the setupEditor method to the + context of the App.RichTextEditorComponent and to have the invocation of that + method be safely handled and executed by the Ember run loop. + + @method bind + @namespace Ember + @param {Object} [target] target of method to call + @param {Function|String} method Method to invoke. + May be a function or a string. If you pass a string + then it will be looked up on the passed target. + @param {Object} [args*] Any additional arguments you wish to pass to the method. + @return {Function} returns a new function that will always have a particular context + @since 1.4.0 + @public + */ + run.bind = function () { + for (var _len = arguments.length, curried = Array(_len), _key = 0; _key < _len; _key++) { + curried[_key] = arguments[_key]; + } - var transition = this.router.router.activeTransition; - var state = transition ? transition.state : this.router.router.state; - - var fullName = route.fullRouteName; - var params = _emberUtils.assign({}, state.params[fullName]); - var queryParams = getQueryParamsFor(route, state); + return function () { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - return Object.keys(queryParams).reduce(function (params, key) { - params[key] = queryParams[key]; - return params; - }, params); - }, + return run.join.apply(run, curried.concat(args)); + }; + }; - /** - Serializes the query parameter key - @method serializeQueryParamKey - @param {String} controllerPropertyName - @private - */ - serializeQueryParamKey: function (controllerPropertyName) { - return controllerPropertyName; - }, - - /** - Serializes value of the query parameter based on defaultValueType - @method serializeQueryParam - @param {Object} value - @param {String} urlKey - @param {String} defaultValueType - @private - */ - serializeQueryParam: function (value, urlKey, defaultValueType) { - // urlKey isn't used here, but anyone overriding - // can use it to provide serialization specific - // to a certain query param. - return this.router._serializeQueryParam(value, defaultValueType); - }, - - /** - Deserializes value of the query parameter based on defaultValueType - @method deserializeQueryParam - @param {Object} value - @param {String} urlKey - @param {String} defaultValueType - @private - */ - deserializeQueryParam: function (value, urlKey, defaultValueType) { - // urlKey isn't used here, but anyone overriding - // can use it to provide deserialization specific - // to a certain query param. - return this.router._deserializeQueryParam(value, defaultValueType); - }, - - /** - @private - @property _optionsForQueryParam - */ - _optionsForQueryParam: function (qp) { - return _emberMetal.get(this, 'queryParams.' + qp.urlKey) || _emberMetal.get(this, 'queryParams.' + qp.prop) || {}; - }, - - /** - A hook you can use to reset controller values either when the model - changes or the route is exiting. - ```javascript - App.ArticlesRoute = Ember.Route.extend({ - // ... - resetController: function(controller, isExiting, transition) { - if (isExiting) { - controller.set('page', 1); - } - } - }); - ``` - @method resetController - @param {Controller} controller instance - @param {Boolean} isExiting - @param {Object} transition - @since 1.7.0 - @public - */ - resetController: K, - - /** - @private - @method exit - */ - exit: function () { - this.deactivate(); - this.trigger('deactivate'); - this.teardownViews(); - }, - - /** - @private - @method _reset - @since 1.7.0 - */ - _reset: function (isExiting, transition) { - var controller = this.controller; - controller._qpDelegate = _emberMetal.get(this, '_qp.states.inactive'); - - this.resetController(controller, isExiting, transition); - }, - - /** - @private - @method enter - */ - enter: function () { - this.connections = []; - this.activate(); - this.trigger('activate'); - }, - - /** - The name of the template to use by default when rendering this routes - template. - ```javascript - let PostsList = Ember.Route.extend({ - templateName: 'posts/list' - }); - App.PostsIndexRoute = PostsList.extend(); - App.PostsArchivedRoute = PostsList.extend(); - ``` - @property templateName - @type String - @default null - @since 1.4.0 - @public - */ - templateName: null, - - /** - The name of the controller to associate with this route. - By default, Ember will lookup a route's controller that matches the name - of the route (i.e. `App.PostController` for `App.PostRoute`). However, - if you would like to define a specific controller to use, you can do so - using this property. - This is useful in many ways, as the controller specified will be: - * passed to the `setupController` method. - * used as the controller for the template being rendered by the route. - * returned from a call to `controllerFor` for the route. - @property controllerName - @type String - @default null - @since 1.4.0 - @public - */ - controllerName: null, - - /** - The `willTransition` action is fired at the beginning of any - attempted transition with a `Transition` object as the sole - argument. This action can be used for aborting, redirecting, - or decorating the transition from the currently active routes. - A good example is preventing navigation when a form is - half-filled out: - ```javascript - App.ContactFormRoute = Ember.Route.extend({ - actions: { - willTransition: function(transition) { - if (this.controller.get('userHasEnteredData')) { - this.controller.displayNavigationConfirm(); - transition.abort(); - } - } - } - }); - ``` - You can also redirect elsewhere by calling - `this.transitionTo('elsewhere')` from within `willTransition`. - Note that `willTransition` will not be fired for the - redirecting `transitionTo`, since `willTransition` doesn't - fire when there is already a transition underway. If you want - subsequent `willTransition` actions to fire for the redirecting - transition, you must first explicitly call - `transition.abort()`. - To allow the `willTransition` event to continue bubbling to the parent - route, use `return true;`. When the `willTransition` method has a - return value of `true` then the parent route's `willTransition` method - will be fired, enabling "bubbling" behavior for the event. - @event willTransition - @param {Transition} transition - @since 1.0.0 - @public - */ - - /** - The `didTransition` action is fired after a transition has - successfully been completed. This occurs after the normal model - hooks (`beforeModel`, `model`, `afterModel`, `setupController`) - have resolved. The `didTransition` action has no arguments, - however, it can be useful for tracking page views or resetting - state on the controller. - ```javascript - App.LoginRoute = Ember.Route.extend({ - actions: { - didTransition: function() { - this.controller.get('errors.base').clear(); - return true; // Bubble the didTransition event - } - } - }); - ``` - @event didTransition - @since 1.2.0 - @public - */ - - /** - The `loading` action is fired on the route when a route's `model` - hook returns a promise that is not already resolved. The current - `Transition` object is the first parameter and the route that - triggered the loading event is the second parameter. - ```javascript - App.ApplicationRoute = Ember.Route.extend({ - actions: { - loading: function(transition, route) { - let controller = this.controllerFor('foo'); - controller.set('currentlyLoading', true); - transition.finally(function() { - controller.set('currentlyLoading', false); - }); - } - } - }); - ``` - @event loading - @param {Transition} transition - @param {Ember.Route} route The route that triggered the loading event - @since 1.2.0 - @public - */ - - /** - When attempting to transition into a route, any of the hooks - may return a promise that rejects, at which point an `error` - action will be fired on the partially-entered routes, allowing - for per-route error handling logic, or shared error handling - logic defined on a parent route. - Here is an example of an error handler that will be invoked - for rejected promises from the various hooks on the route, - as well as any unhandled errors from child routes: - ```javascript - App.AdminRoute = Ember.Route.extend({ - beforeModel: function() { - return Ember.RSVP.reject('bad things!'); - }, - actions: { - error: function(error, transition) { - // Assuming we got here due to the error in `beforeModel`, - // we can expect that error === "bad things!", - // but a promise model rejecting would also - // call this hook, as would any errors encountered - // in `afterModel`. - // The `error` hook is also provided the failed - // `transition`, which can be stored and later - // `.retry()`d if desired. - this.transitionTo('login'); - } - } - }); - ``` - `error` actions that bubble up all the way to `ApplicationRoute` - will fire a default error handler that logs the error. You can - specify your own global default error handler by overriding the - `error` handler on `ApplicationRoute`: - ```javascript - App.ApplicationRoute = Ember.Route.extend({ - actions: { - error: function(error, transition) { - this.controllerFor('banner').displayError(error.message); - } - } - }); - ``` - @event error - @param {Error} error - @param {Transition} transition - @since 1.0.0 - @public - */ - - /** - This event is triggered when the router enters the route. It is - not executed when the model for the route changes. - ```javascript - App.ApplicationRoute = Ember.Route.extend({ - collectAnalytics: function(){ - collectAnalytics(); - }.on('activate') - }); - ``` - @event activate - @since 1.9.0 - @public - */ - - /** - This event is triggered when the router completely exits this - route. It is not executed when the model for the route changes. - ```javascript - App.IndexRoute = Ember.Route.extend({ - trackPageLeaveAnalytics: function(){ - trackPageLeaveAnalytics(); - }.on('deactivate') - }); - ``` - @event deactivate - @since 1.9.0 - @public - */ - - /** - The controller associated with this route. - Example - ```javascript - App.FormRoute = Ember.Route.extend({ - actions: { - willTransition: function(transition) { - if (this.controller.get('userHasEnteredData') && - !confirm('Are you sure you want to abandon progress?')) { - transition.abort(); - } else { - // Bubble the `willTransition` action so that - // parent routes can decide whether or not to abort. - return true; - } - } - } - }); - ``` - @property controller - @type Ember.Controller - @since 1.6.0 - @public - */ - - actions: { - - /** - This action is called when one or more query params have changed. Bubbles. - @method queryParamsDidChange - @param changed {Object} Keys are names of query params that have changed. - @param totalPresent {Object} Keys are names of query params that are currently set. - @param removed {Object} Keys are names of query params that have been removed. - @returns {boolean} - @private - */ - queryParamsDidChange: function (changed, totalPresent, removed) { - var qpMap = _emberMetal.get(this, '_qp').map; - - var totalChanged = Object.keys(changed).concat(Object.keys(removed)); - for (var i = 0; i < totalChanged.length; ++i) { - var qp = qpMap[totalChanged[i]]; - if (qp && _emberMetal.get(this._optionsForQueryParam(qp), 'refreshModel') && this.router.currentState) { - this.refresh(); - } - } - - return true; - }, - - finalizeQueryParamChange: function (params, finalParams, transition) { - if (this.fullRouteName !== 'application') { - return true; - } - - // Transition object is absent for intermediate transitions. - if (!transition) { - return; - } - - var handlerInfos = transition.state.handlerInfos; - var router = this.router; - var qpMeta = router._queryParamsFor(handlerInfos); - var changes = router._qpUpdates; - var replaceUrl = undefined; - - _emberRoutingUtils.stashParamNames(router, handlerInfos); - - for (var i = 0; i < qpMeta.qps.length; ++i) { - var qp = qpMeta.qps[i]; - var route = qp.route; - var controller = route.controller; - var presentKey = qp.urlKey in params && qp.urlKey; - - // Do a reverse lookup to see if the changed query - // param URL key corresponds to a QP property on - // this controller. - var value = undefined, - svalue = undefined; - if (changes && qp.urlKey in changes) { - // Value updated in/before setupController - value = _emberMetal.get(controller, qp.prop); - svalue = route.serializeQueryParam(value, qp.urlKey, qp.type); - } else { - if (presentKey) { - svalue = params[presentKey]; - value = route.deserializeQueryParam(svalue, qp.urlKey, qp.type); - } else { - // No QP provided; use default value. - svalue = qp.serializedDefaultValue; - value = copyDefaultValue(qp.defaultValue); - } - } - - controller._qpDelegate = _emberMetal.get(route, '_qp.states.inactive'); - - var thisQueryParamChanged = svalue !== qp.serializedValue; - if (thisQueryParamChanged) { - if (transition.queryParamsOnly && replaceUrl !== false) { - var options = route._optionsForQueryParam(qp); - var replaceConfigValue = _emberMetal.get(options, 'replace'); - if (replaceConfigValue) { - replaceUrl = true; - } else if (replaceConfigValue === false) { - // Explicit pushState wins over any other replaceStates. - replaceUrl = false; - } - } - - _emberMetal.set(controller, qp.prop, value); - } - - // Stash current serialized value of controller. - qp.serializedValue = svalue; - - var thisQueryParamHasDefaultValue = qp.serializedDefaultValue === svalue; - if (!thisQueryParamHasDefaultValue) { - finalParams.push({ - value: svalue, - visible: true, - key: presentKey || qp.urlKey - }); - } - } - - if (replaceUrl) { - transition.method('replace'); - } - - qpMeta.qps.forEach(function (qp) { - var routeQpMeta = _emberMetal.get(qp.route, '_qp'); - var finalizedController = qp.route.controller; - finalizedController._qpDelegate = _emberMetal.get(routeQpMeta, 'states.active'); - }); - - router._qpUpdates = 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 - @since 1.0.0 - @public - */ - deactivate: K, - - /** - This hook is executed when the router enters the route. It is not executed - when the model for the route changes. - @method activate - @since 1.0.0 - @public - */ - activate: K, - - /** - Transition the application into another route. The route may - be either a single route or route path: - ```javascript - this.transitionTo('blogPosts'); - this.transitionTo('blogPosts.recentEntries'); - ``` - Optionally supply a model for the route in question. The model - will be serialized into the URL using the `serialize` hook of - the route: - ```javascript - this.transitionTo('blogPost', aPost); - ``` - If a literal is passed (such as a number or a string), it will - be treated as an identifier instead. In this case, the `model` - hook of the route will be triggered: - ```javascript - this.transitionTo('blogPost', 1); - ``` - Multiple models will be applied last to first recursively up the - route tree. - ```javascript - App.Router.map(function() { - this.route('blogPost', { path:':blogPostId' }, function() { - this.route('blogComment', { path: ':blogCommentId', resetNamespace: true }); - }); - }); - this.transitionTo('blogComment', aPost, aComment); - this.transitionTo('blogComment', 1, 13); - ``` - It is also possible to pass a URL (a string that starts with a - `/`). This is intended for testing and debugging purposes and - should rarely be used in production code. - ```javascript - this.transitionTo('/'); - this.transitionTo('/blog/post/1/comment/13'); - this.transitionTo('/blog/posts?sort=title'); - ``` - An options hash with a `queryParams` property may be provided as - the final argument to add query parameters to the destination URL. - ```javascript - this.transitionTo('blogPost', 1, { - queryParams: { showComments: 'true' } - }); - // if you just want to transition the query parameters without changing the route - this.transitionTo({ queryParams: { sort: 'date' } }); - ``` - See also [replaceWith](#method_replaceWith). - Simple Transition Example - ```javascript - App.Router.map(function() { - this.route('index'); - this.route('secret'); - this.route('fourOhFour', { path: '*:' }); - }); - App.IndexRoute = Ember.Route.extend({ - actions: { - moveToSecret: function(context) { - if (authorized()) { - this.transitionTo('secret', context); - } else { - this.transitionTo('fourOhFour'); - } - } - } - }); - ``` - Transition to a nested route - ```javascript - App.Router.map(function() { - this.route('articles', { path: '/articles' }, function() { - this.route('new'); - }); - }); - App.IndexRoute = Ember.Route.extend({ - actions: { - transitionToNewArticle: function() { - this.transitionTo('articles.new'); - } - } - }); - ``` - Multiple Models Example - ```javascript - App.Router.map(function() { - this.route('index'); - this.route('breakfast', { path: ':breakfastId' }, function() { - this.route('cereal', { path: ':cerealId', resetNamespace: true }); - }); - }); - App.IndexRoute = Ember.Route.extend({ - actions: { - moveToChocolateCereal: function() { - let cereal = { cerealId: 'ChocolateYumminess' }; - let breakfast = { breakfastId: 'CerealAndMilk' }; - this.transitionTo('cereal', breakfast, cereal); - } - } - }); - ``` - Nested Route with Query String Example - ```javascript - App.Router.map(function() { - this.route('fruits', function() { - this.route('apples'); - }); - }); - App.IndexRoute = Ember.Route.extend({ - actions: { - transitionToApples: function() { - this.transitionTo('fruits.apples', { queryParams: { color: 'red' } }); - } - } - }); - ``` - @method transitionTo - @param {String} name the name of the route or a URL - @param {...Object} models the model(s) or identifier(s) to be used while - transitioning to the route. - @param {Object} [options] optional hash with a queryParams property - containing a mapping of query parameters - @return {Transition} the transition object associated with this - attempted transition - @since 1.0.0 - @public - */ - transitionTo: function (name, context) { - var router = this.router; - return router.transitionTo.apply(router, _emberRoutingUtils.prefixRouteNameArg(this, arguments)); - }, - - /** - Perform a synchronous transition into another route without attempting - to resolve promises, update the URL, or abort any currently active - asynchronous transitions (i.e. regular transitions caused by - `transitionTo` or URL changes). - This method is handy for performing intermediate transitions on the - way to a final destination route, and is called internally by the - default implementations of the `error` and `loading` handlers. - @method intermediateTransitionTo - @param {String} name the name of the route - @param {...Object} models the model(s) to be used while transitioning - to the route. - @since 1.2.0 - @public - */ - intermediateTransitionTo: function () { - var router = this.router; - router.intermediateTransitionTo.apply(router, _emberRoutingUtils.prefixRouteNameArg(this, arguments)); - }, - - /** - Refresh the model on this route and any child routes, firing the - `beforeModel`, `model`, and `afterModel` hooks in a similar fashion - to how routes are entered when transitioning in from other route. - The current route params (e.g. `article_id`) will be passed in - to the respective model hooks, and if a different model is returned, - `setupController` and associated route hooks will re-fire as well. - An example usage of this method is re-querying the server for the - latest information using the same parameters as when the route - was first entered. - Note that this will cause `model` hooks to fire even on routes - that were provided a model object when the route was initially - entered. - @method refresh - @return {Transition} the transition object associated with this - attempted transition - @since 1.4.0 - @public - */ - refresh: function () { - return this.router.router.refresh(this); - }, - - /** - Transition into another route while replacing the current URL, if possible. - This will replace the current history entry instead of adding a new one. - Beside that, it is identical to `transitionTo` in all other respects. See - 'transitionTo' for additional information regarding multiple models. - Example - ```javascript - App.Router.map(function() { - this.route('index'); - this.route('secret'); - }); - App.SecretRoute = Ember.Route.extend({ - afterModel: function() { - if (!authorized()){ - this.replaceWith('index'); - } - } - }); - ``` - @method replaceWith - @param {String} name the name of the route or a URL - @param {...Object} models the model(s) or identifier(s) to be used while - transitioning to the route. - @return {Transition} the transition object associated with this - attempted transition - @since 1.0.0 - @public - */ - replaceWith: function () { - var router = this.router; - return router.replaceWith.apply(router, _emberRoutingUtils.prefixRouteNameArg(this, arguments)); - }, - - /** - Sends an action to the router, which will delegate it to the currently - active route hierarchy per the bubbling rules explained under `actions`. - Example - ```javascript - App.Router.map(function() { - this.route('index'); - }); - App.ApplicationRoute = Ember.Route.extend({ - actions: { - track: function(arg) { - console.log(arg, 'was clicked'); - } - } - }); - App.IndexRoute = Ember.Route.extend({ - actions: { - trackIfDebug: function(arg) { - if (debug) { - this.send('track', arg); - } - } - } - }); - ``` - @method send - @param {String} name the name of the action to trigger - @param {...*} args - @since 1.0.0 - @public - */ - send: function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - if (this.router && this.router.router || !_emberMetal.isTesting()) { - var _router; - - (_router = this.router).send.apply(_router, args); - } else { - var _name2 = args[0]; - args = slice.call(args, 1); - var action = this.actions[_name2]; - if (action) { - return this.actions[_name2].apply(this, args); - } - } - }, - - /** - This hook is the entry point for router.js - @private - @method setup - */ - setup: function (context, transition) { - var _this2 = this; - - var controller = undefined; - - var controllerName = this.controllerName || this.routeName; - var definedController = this.controllerFor(controllerName, true); - - if (!definedController) { - controller = this.generateController(controllerName); - } else { - controller = definedController; - } - - // Assign the route's controller so that it can more easily be - // referenced in action handlers. Side effects. Side effects everywhere. - if (!this.controller) { - var propNames = _emberMetal.get(this, '_qp.propertyNames'); - addQueryParamsObservers(controller, propNames); - this.controller = controller; - } - - var queryParams = _emberMetal.get(this, '_qp'); - - var states = queryParams.states; - - controller._qpDelegate = states.allowOverrides; - - if (transition) { - (function () { - // Update the model dep values used to calculate cache keys. - _emberRoutingUtils.stashParamNames(_this2.router, transition.state.handlerInfos); - - var params = transition.params; - var allParams = queryParams.propertyNames; - var cache = _this2._bucketCache; - - allParams.forEach(function (prop) { - var aQp = queryParams.map[prop]; - - aQp.values = params; - var cacheKey = _emberRoutingUtils.calculateCacheKey(aQp.controllerName, aQp.parts, aQp.values); - - if (cache) { - var value = cache.lookup(cacheKey, prop, aQp.undecoratedDefaultValue); - _emberMetal.set(controller, prop, value); - } - }); - })(); - } - - if (transition) { - var qpValues = getQueryParamsFor(this, transition.state); - controller.setProperties(qpValues); - } - - this.setupController(controller, context, transition); - - if (this._environment.options.shouldRender) { - 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 - value in the cache so if this route becomes active, the cache value has been updated. - */ - _qpChanged: function (prop, value, qp) { - if (!qp) { - return; - } - - var cacheKey = _emberRoutingUtils.calculateCacheKey(qp.controllerName, qp.parts, qp.values); - - // Update model-dep cache - var cache = this._bucketCache; - if (cache) { - cache.stash(cacheKey, prop, value); - } - }, - /** - This hook is the first of the route entry validation hooks - called when an attempt is made to transition into a route - or one of its children. It is called before `model` and - `afterModel`, and is appropriate for cases when: - 1) A decision can be made to redirect elsewhere without - needing to resolve the model first. - 2) Any async operations need to occur first before the - model is attempted to be resolved. - This hook is provided the current `transition` attempt - as a parameter, which can be used to `.abort()` the transition, - save it for a later `.retry()`, or retrieve values set - on it from a previous hook. You can also just call - `this.transitionTo` to another route to implicitly - abort the `transition`. - You can return a promise from this hook to pause the - transition until the promise resolves (or rejects). This could - be useful, for instance, for retrieving async code from - the server that is required to enter a route. - ```javascript - App.PostRoute = Ember.Route.extend({ - beforeModel: function(transition) { - if (!App.Post) { - return Ember.$.getScript('/models/post.js'); - } - } - }); - ``` - If `App.Post` doesn't exist in the above example, - `beforeModel` will use jQuery's `getScript`, which - returns a promise that resolves after the server has - successfully retrieved and executed the code from the - server. Note that if an error were to occur, it would - be passed to the `error` hook on `Ember.Route`, but - it's also possible to handle errors specific to - `beforeModel` right from within the hook (to distinguish - from the shared error handling behavior of the `error` - hook): - ```javascript - App.PostRoute = Ember.Route.extend({ - beforeModel: function(transition) { - if (!App.Post) { - let self = this; - return Ember.$.getScript('post.js').then(null, function(e) { - self.transitionTo('help'); - // Note that the above transitionTo will implicitly - // halt the transition. If you were to return - // nothing from this promise reject handler, - // according to promise semantics, that would - // convert the reject into a resolve and the - // transition would continue. To propagate the - // error so that it'd be handled by the `error` - // hook, you would have to - return Ember.RSVP.reject(e); - }); - } - } - }); - ``` - @method beforeModel - @param {Transition} transition - @return {Promise} if the value returned from this hook is - a promise, the transition will pause until the transition - resolves. Otherwise, non-promise return values are not - utilized in any way. - @since 1.0.0 - @public - */ - beforeModel: K, - - /** - This hook is called after this route's model has resolved. - It follows identical async/promise semantics to `beforeModel` - but is provided the route's resolved model in addition to - the `transition`, and is therefore suited to performing - logic that can only take place after the model has already - resolved. - ```javascript - App.PostsRoute = Ember.Route.extend({ - afterModel: function(posts, transition) { - if (posts.get('length') === 1) { - this.transitionTo('post.show', posts.get('firstObject')); - } - } - }); - ``` - Refer to documentation for `beforeModel` for a description - of transition-pausing semantics when a promise is returned - from this hook. - @method afterModel - @param {Object} resolvedModel the value returned from `model`, - or its resolved value if it was a promise - @param {Transition} transition - @return {Promise} if the value returned from this hook is - a promise, the transition will pause until the transition - resolves. Otherwise, non-promise return values are not - utilized in any way. - @since 1.0.0 - @public - */ - afterModel: K, - - /** - A hook you can implement to optionally redirect to another route. - If you call `this.transitionTo` from inside of this hook, this route - will not be entered in favor of the other hook. - `redirect` and `afterModel` behave very similarly and are - called almost at the same time, but they have an important - distinction in the case that, from one of these hooks, a - redirect into a child route of this route occurs: redirects - from `afterModel` essentially invalidate the current attempt - to enter this route, and will result in this route's `beforeModel`, - `model`, and `afterModel` hooks being fired again within - the new, redirecting transition. Redirects that occur within - the `redirect` hook, on the other hand, will _not_ cause - these hooks to be fired again the second time around; in - other words, by the time the `redirect` hook has been called, - both the resolved model and attempted entry into this route - are considered to be fully validated. - @method redirect - @param {Object} model the model for this route - @param {Transition} transition the transition object associated with the current transition - @since 1.0.0 - @public - */ - redirect: K, - - /** - Called when the context is changed by router.js. - @private - @method contextDidChange - */ - contextDidChange: function () { - this.currentModel = this.context; - }, - - /** - A hook you can implement to convert the URL into the model for - this route. - ```javascript - App.Router.map(function() { - this.route('post', { path: '/posts/:post_id' }); - }); - ``` - The model for the `post` route is `store.findRecord('post', params.post_id)`. - By default, if your route has a dynamic segment ending in `_id`: - * The model class is determined from the segment (`post_id`'s - class is `App.Post`) - * The find method is called on the model class with the value of - the dynamic segment. - Note that for routes with dynamic segments, this hook is not always - executed. If the route is entered through a transition (e.g. when - using the `link-to` Handlebars helper or the `transitionTo` method - of routes), and a model context is already provided this hook - is not called. - A model context does not include a primitive string or number, - which does cause the model hook to be called. - Routes without dynamic segments will always execute the model hook. - ```javascript - // no dynamic segment, model hook always called - this.transitionTo('posts'); - // model passed in, so model hook not called - thePost = store.findRecord('post', 1); - this.transitionTo('post', thePost); - // integer passed in, model hook is called - this.transitionTo('post', 1); - // model id passed in, model hook is called - // useful for forcing the hook to execute - thePost = store.findRecord('post', 1); - this.transitionTo('post', thePost.id); - ``` - This hook follows the asynchronous/promise semantics - described in the documentation for `beforeModel`. In particular, - if a promise returned from `model` fails, the error will be - handled by the `error` hook on `Ember.Route`. - Example - ```javascript - App.PostRoute = Ember.Route.extend({ - model: function(params) { - return this.store.findRecord('post', params.post_id); - } - }); - ``` - @method model - @param {Object} params the parameters extracted from the URL - @param {Transition} transition - @return {Object|Promise} the model for this route. If - a promise is returned, the transition will pause until - the promise resolves, and the resolved value of the promise - will be used as the model for this route. - @since 1.0.0 - @public - */ - model: function (params, transition) { - var match = undefined, - name = undefined, - sawParams = undefined, - value = undefined; - var queryParams = _emberMetal.get(this, '_qp.map'); - - for (var prop in params) { - if (prop === 'queryParams' || queryParams && prop in queryParams) { - continue; - } - - if (match = prop.match(/^(.*)_id$/)) { - name = match[1]; - value = params[prop]; - } - sawParams = true; - } - - if (!name && sawParams) { - return _emberRuntime.copy(params); - } else if (!name) { - if (transition.resolveIndex < 1) { - return; - } - - var parentModel = transition.state.handlerInfos[transition.resolveIndex - 1].context; - - return parentModel; - } - - return this.findModel(name, value); - }, - - /** - @private - @method deserialize - @param {Object} params the parameters extracted from the URL - @param {Transition} transition - @return {Object|Promise} the model for this route. - Router.js hook. - */ - deserialize: function (params, transition) { - return this.model(this.paramsFor(this.routeName), transition); - }, - - /** - @method findModel - @param {String} type the model type - @param {Object} value the value passed to find - @private - */ - findModel: function () { - var store = _emberMetal.get(this, 'store'); - return store.find.apply(store, arguments); - }, - - /** - Store property provides a hook for data persistence libraries to inject themselves. - By default, this store property provides the exact same functionality previously - in the model hook. - Currently, the required interface is: - `store.find(modelName, findArguments)` - @method store - @param {Object} store - @private - */ - store: _emberMetal.computed(function () { - var owner = _emberUtils.getOwner(this); - var routeName = this.routeName; - var namespace = _emberMetal.get(this, 'router.namespace'); - - return { - find: function (name, value) { - var modelClass = owner._lookupFactory('model:' + name); - - if (!modelClass) { - return; - } - - return modelClass.find(value); - } - }; - }), - - /** - A hook you can implement to convert the route's model into parameters - for the URL. - ```javascript - App.Router.map(function() { - this.route('post', { path: '/posts/:post_id' }); - }); - App.PostRoute = Ember.Route.extend({ - model: function(params) { - // the server returns `{ id: 12 }` - return Ember.$.getJSON('/posts/' + params.post_id); - }, - serialize: function(model) { - // this will make the URL `/posts/12` - return { post_id: model.id }; - } - }); - ``` - The default `serialize` method will insert the model's `id` into the - route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'. - If the route has multiple dynamic segments or does not contain '_id', `serialize` - will return `Ember.getProperties(model, params)` - This method is called when `transitionTo` is called with a context - in order to populate the URL. - @method serialize - @param {Object} model the routes model - @param {Array} params an Array of parameter names for the current - route (in the example, `['post_id']`. - @return {Object} the serialized parameters - @since 1.0.0 - @public - */ - serialize: defaultSerialize, - - /** - A hook you can use to setup the controller for the current route. - This method is called with the controller for the current route and the - model supplied by the `model` hook. - By default, the `setupController` hook sets the `model` property of - the controller to the `model`. - If you implement the `setupController` hook in your Route, it will - prevent this default behavior. If you want to preserve that behavior - when implementing your `setupController` function, make sure to call - `_super`: - ```javascript - App.PhotosRoute = Ember.Route.extend({ - model: function() { - return this.store.findAll('photo'); - }, - setupController: function(controller, model) { - // Call _super for default behavior - this._super(controller, model); - // Implement your custom setup after - this.controllerFor('application').set('showingPhotos', true); - } - }); - ``` - The provided controller will be one resolved based on the name - of this route. - If no explicit controller is defined, Ember will automatically create one. - As an example, consider the router: - ```javascript - App.Router.map(function() { - this.route('post', { path: '/posts/:post_id' }); - }); - ``` - For the `post` route, a controller named `App.PostController` would - be used if it is defined. If it is not defined, a basic `Ember.Controller` - instance would be used. - Example - ```javascript - App.PostRoute = Ember.Route.extend({ - setupController: function(controller, model) { - controller.set('model', model); - } - }); - ``` - @method setupController - @param {Controller} controller instance - @param {Object} model - @since 1.0.0 - @public - */ - setupController: function (controller, context, transition) { - if (controller && context !== undefined) { - _emberMetal.set(controller, 'model', context); - } - }, - - /** - Returns the controller for a particular route or name. - The controller instance must already have been created, either through entering the - associated route or using `generateController`. - ```javascript - App.PostRoute = Ember.Route.extend({ - setupController: function(controller, post) { - this._super(controller, post); - this.controllerFor('posts').set('currentPost', post); - } - }); - ``` - @method controllerFor - @param {String} name the name of the route or controller - @return {Ember.Controller} - @since 1.0.0 - @public - */ - controllerFor: function (name, _skipAssert) { - var owner = _emberUtils.getOwner(this); - var route = owner.lookup('route:' + name); - var controller = undefined; - - if (route && route.controllerName) { - name = route.controllerName; - } - - controller = owner.lookup('controller:' + name); - - // NOTE: We're specifically checking that skipAssert is true, because according - // to the old API the second parameter was model. We do not want people who - // passed a model to skip the assertion. - - return controller; - }, - - /** - Generates a controller for a route. - Example - ```javascript - App.PostRoute = Ember.Route.extend({ - setupController: function(controller, post) { - this._super(controller, post); - this.generateController('posts'); - } - }); - ``` - @method generateController - @param {String} name the name of the controller - @private - */ - generateController: function (name) { - var owner = _emberUtils.getOwner(this); - - return _emberRoutingSystemGenerate_controller.default(owner, name); - }, - - /** - Returns the resolved model of a parent (or any ancestor) route - in a route hierarchy. During a transition, all routes - must resolve a model object, and if a route - needs access to a parent route's model in order to - resolve a model (or just reuse the model from a parent), - it can call `this.modelFor(theNameOfParentRoute)` to - retrieve it. If the ancestor route's model was a promise, - its resolved result is returned. - Example - ```javascript - App.Router.map(function() { - this.route('post', { path: '/post/:post_id' }, function() { - this.route('comments', { resetNamespace: true }); - }); - }); - App.CommentsRoute = Ember.Route.extend({ - afterModel: function() { - this.set('post', this.modelFor('post')); - } - }); - ``` - @method modelFor - @param {String} name the name of the route - @return {Object} the model object - @since 1.0.0 - @public - */ - modelFor: function (_name) { - var name = undefined; - var owner = _emberUtils.getOwner(this); - - // Only change the route name when there is an active transition. - // Otherwise, use the passed in route name. - if (owner.routable && this.router && this.router.router.activeTransition) { - name = getEngineRouteName(owner, _name); - } else { - name = _name; - } - - var route = _emberUtils.getOwner(this).lookup('route:' + name); - var transition = this.router ? this.router.router.activeTransition : null; - - // If we are mid-transition, we want to try and look up - // resolved parent contexts on the current transitionEvent. - if (transition) { - var modelLookupName = route && route.routeName || name; - if (transition.resolvedModels.hasOwnProperty(modelLookupName)) { - return transition.resolvedModels[modelLookupName]; - } - } - - return route && route.currentModel; - }, - - /** - A hook you can use to render the template for the current route. - This method is called with the controller for the current route and the - model supplied by the `model` hook. By default, it renders the route's - template, configured with the controller for the route. - This method can be overridden to set up and render additional or - alternative templates. - ```javascript - App.PostsRoute = Ember.Route.extend({ - renderTemplate: function(controller, model) { - let favController = this.controllerFor('favoritePost'); - // Render the `favoritePost` template into - // the outlet `posts`, and display the `favoritePost` - // controller. - this.render('favoritePost', { - outlet: 'posts', - controller: favController - }); - } - }); - ``` - @method renderTemplate - @param {Object} controller the route's controller - @param {Object} model the route's model - @since 1.0.0 - @public - */ - renderTemplate: function (controller, model) { - this.render(); - }, - - /** - `render` is used to render a template into a region of another template - (indicated by an `{{outlet}}`). `render` is used both during the entry - phase of routing (via the `renderTemplate` hook) and later in response to - user interaction. - For example, given the following minimal router and templates: - ```javascript - Router.map(function() { - this.route('photos'); - }); - ``` - ```handlebars - -
    - {{outlet "anOutletName"}} -
    - ``` - ```handlebars - -

    Photos

    - ``` - You can render `photos.hbs` into the `"anOutletName"` outlet of - `application.hbs` by calling `render`: - ```javascript - // posts route - Ember.Route.extend({ - renderTemplate: function() { - this.render('photos', { - into: 'application', - outlet: 'anOutletName' - }) - } - }); - ``` - `render` additionally allows you to supply which `controller` and - `model` objects should be loaded and associated with the rendered template. - ```javascript - // posts route - Ember.Route.extend({ - renderTemplate: function(controller, model){ - this.render('posts', { // the template to render, referenced by name - into: 'application', // the template to render into, referenced by name - outlet: 'anOutletName', // the outlet inside `options.template` to render into. - controller: 'someControllerName', // the controller to use for this template, referenced by name - model: model // the model to set on `options.controller`. - }) - } - }); - ``` - The string values provided for the template name, and controller - will eventually pass through to the resolver for lookup. See - Ember.Resolver for how these are mapped to JavaScript objects in your - application. The template to render into needs to be related to either the - current route or one of its ancestors. - Not all options need to be passed to `render`. Default values will be used - based on the name of the route specified in the router or the Route's - `controllerName` and `templateName` properties. - For example: - ```javascript - // router - Router.map(function() { - this.route('index'); - this.route('post', { path: '/posts/:post_id' }); - }); - ``` - ```javascript - // post route - PostRoute = App.Route.extend({ - renderTemplate: function() { - this.render(); // all defaults apply - } - }); - ``` - The name of the `PostRoute`, defined by the router, is `post`. - The following equivalent default options will be applied when - the Route calls `render`: - ```javascript - // - this.render('post', { // the template name associated with 'post' Route - into: 'application', // the parent route to 'post' Route - outlet: 'main', // {{outlet}} and {{outlet 'main'}} are synonymous, - controller: 'post', // the controller associated with the 'post' Route - }) - ``` - By default the controller's `model` will be the route's model, so it does not - need to be passed unless you wish to change which model is being used. - @method render - @param {String} name the name of the template to render - @param {Object} [options] the options - @param {String} [options.into] the template to render into, - referenced by name. Defaults to the parent template - @param {String} [options.outlet] the outlet inside `options.template` to render into. - Defaults to 'main' - @param {String|Object} [options.controller] the controller to use for this template, - referenced by name or as a controller instance. Defaults to the Route's paired controller - @param {Object} [options.model] the model object to set on `options.controller`. - Defaults to the return value of the Route's model hook - @since 1.0.0 - @public - */ - render: function (_name, options) { - - var namePassed = typeof _name === 'string' && !!_name; - var isDefaultRender = arguments.length === 0 || _emberMetal.isEmpty(arguments[0]); - var name = undefined; - - if (typeof _name === 'object' && !options) { - name = this.templateName || this.routeName; - options = _name; - } else { - name = _name; - } - - var renderOptions = buildRenderOptions(this, namePassed, isDefaultRender, name, options); - this.connections.push(renderOptions); - _emberMetal.run.once(this.router, '_setOutlets'); - }, - - /** - Disconnects a view that has been rendered into an outlet. - You may pass any or all of the following options to `disconnectOutlet`: - * `outlet`: the name of the outlet to clear (default: 'main') - * `parentView`: the name of the view containing the outlet to clear - (default: the view rendered by the parent route) - Example: - ```javascript - App.ApplicationRoute = App.Route.extend({ - actions: { - showModal: function(evt) { - this.render(evt.modalName, { - outlet: 'modal', - into: 'application' - }); - }, - hideModal: function(evt) { - this.disconnectOutlet({ - outlet: 'modal', - parentView: 'application' - }); - } - } - }); - ``` - Alternatively, you can pass the `outlet` name directly as a string. - Example: - ```javascript - hideModal: function(evt) { - this.disconnectOutlet('modal'); - } - ``` - @method disconnectOutlet - @param {Object|String} options the options hash or outlet name - @since 1.0.0 - @public - */ - disconnectOutlet: function (options) { - var outletName = undefined; - var parentView = undefined; - 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 _emberMetal.Error('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++) { - // This non-local state munging is sadly necessary to maintain - // backward compatibility with our existing semantics, which allow - // any route to disconnectOutlet things originally rendered by any - // other route. This should all get cut in 2.0. - this.router.router.currentHandlerInfos[i].handler._disconnectOutlet(outletName, parentView); - } - }, - - _disconnectOutlet: function (outletName, parentView) { - var parent = parentRoute(this); - if (parent && parentView === parent.routeName) { - parentView = undefined; - } - for (var i = 0; i < this.connections.length; i++) { - var connection = this.connections[i]; - if (connection.outlet === outletName && connection.into === parentView) { - // This neuters the disconnected outlet such that it doesn't - // render anything, but it leaves an entry in the outlet - // 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, - controller: undefined, - template: undefined, - ViewClass: undefined - }; - _emberMetal.run.once(this.router, '_setOutlets'); - } - } - }, - - willDestroy: function () { - this.teardownViews(); - }, - - /** - @private - @method teardownViews - */ - teardownViews: function () { - if (this.connections && this.connections.length > 0) { - this.connections = []; - _emberMetal.run.once(this.router, '_setOutlets'); - } - } - }); - - _emberRuntime.deprecateUnderscoreActions(Route); - - Route.reopenClass({ - isRouteFactory: true - }); - - function parentRoute(route) { - var handlerInfo = handlerInfoFor(route, route.router.router.state.handlerInfos, -1); - return handlerInfo && handlerInfo.handler; - } - - function handlerInfoFor(route, handlerInfos, _offset) { - if (!handlerInfos) { - return; - } - - var offset = _offset || 0; - var current = undefined; - for (var i = 0; i < handlerInfos.length; i++) { - current = handlerInfos[i].handler; - if (current === route) { - return handlerInfos[i + offset]; - } - } - } - - function buildRenderOptions(route, namePassed, isDefaultRender, _name, options) { - var into = options && options.into && options.into.replace(/\//g, '.'); - var outlet = options && options.outlet || 'main'; - - var name = undefined, - templateName = undefined; - if (_name) { - name = _name.replace(/\//g, '.'); - templateName = name; - } else { - name = route.routeName; - templateName = route.templateName || name; - } - - var owner = _emberUtils.getOwner(route); - var controller = options && options.controller; - if (!controller) { - if (namePassed) { - controller = owner.lookup('controller:' + name) || route.controllerName || route.routeName; - } else { - controller = route.controllerName || owner.lookup('controller:' + name); - } - } - - if (typeof controller === 'string') { - var controllerName = controller; - controller = owner.lookup('controller:' + controllerName); - if (!controller) { - throw new _emberMetal.Error('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 _emberMetal.Error('You passed undefined as the outlet name.'); - } - - if (options && options.model) { - controller.set('model', options.model); - } - - var template = owner.lookup('template:' + templateName); - - var parent = undefined; - if (into && (parent = parentRoute(route)) && into === parentRoute(route).routeName) { - into = undefined; - } - - var renderOptions = { - owner: owner, - into: into, - outlet: outlet, - name: name, - controller: controller, - template: template || route._topLevelViewTemplate, - ViewClass: undefined - }; - - var LOG_VIEW_LOOKUPS = _emberMetal.get(route.router, 'namespace.LOG_VIEW_LOOKUPS'); - if (LOG_VIEW_LOOKUPS && !template) {} - - return renderOptions; - } - - function getFullQueryParams(router, state) { - if (state.fullQueryParams) { - return state.fullQueryParams; - } - - state.fullQueryParams = {}; - _emberUtils.assign(state.fullQueryParams, state.queryParams); - - router._deserializeQueryParams(state.handlerInfos, state.fullQueryParams); - return state.fullQueryParams; - } - - function getQueryParamsFor(route, state) { - state.queryParamsFor = state.queryParamsFor || {}; - var name = route.fullRouteName; - - if (state.queryParamsFor[name]) { - return state.queryParamsFor[name]; - } - - var fullQueryParams = getFullQueryParams(route.router, state); - - var params = state.queryParamsFor[name] = {}; - - // Copy over all the query params for this route/controller into params hash. - var qpMeta = _emberMetal.get(route, '_qp'); - var qps = qpMeta.qps; - for (var i = 0; i < qps.length; ++i) { - // Put deserialized qp on params hash. - var qp = qps[i]; - - var qpValueWasPassedIn = (qp.prop in fullQueryParams); - params[qp.prop] = qpValueWasPassedIn ? fullQueryParams[qp.prop] : copyDefaultValue(qp.defaultValue); - } - - return params; - } - - function copyDefaultValue(value) { - if (Array.isArray(value)) { - return _emberRuntime.A(value.slice()); - } - return value; - } - - /* - Merges all query parameters from a controller with those from - a route, returning a new object and avoiding any mutations to - the existing objects. - */ - function mergeEachQueryParams(controllerQP, routeQP) { - var keysAlreadyMergedOrSkippable = undefined; - var qps = {}; - - 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)) { - continue; - } - - var newControllerParameterConfiguration = {}; - _emberUtils.assign(newControllerParameterConfiguration, controllerQP[cqpName]); - _emberUtils.assign(newControllerParameterConfiguration, routeQP[cqpName]); - - qps[cqpName] = newControllerParameterConfiguration; - - // allows us to skip this QP when we check route QPs. - keysAlreadyMergedOrSkippable[cqpName] = true; - } - - // loop over all route qps, skipping those that were merged in the first pass - // because they also appear in controller qps - for (var rqpName in routeQP) { - if (!routeQP.hasOwnProperty(rqpName) || keysAlreadyMergedOrSkippable[rqpName]) { - continue; - } - - var newRouteParameterConfiguration = {}; - _emberUtils.assign(newRouteParameterConfiguration, routeQP[rqpName], controllerQP[rqpName]); - qps[rqpName] = newRouteParameterConfiguration; - } - - return qps; - } - - function addQueryParamsObservers(controller, propNames) { - propNames.forEach(function (prop) { - controller.addObserver(prop + '.[]', controller, controller._qpChanged); - }); - } - - function getEngineRouteName(engine, routeName) { - if (engine.routable) { - var prefix = engine.mountPoint; - - if (routeName === 'application') { - return prefix; - } else { - return prefix + '.' + routeName; - } - } - - return routeName; - } - - exports.default = Route; -}); -enifed('ember-routing/system/router', ['exports', 'ember-utils', 'ember-console', 'ember-metal', 'ember-runtime', 'ember-routing/system/route', 'ember-routing/system/dsl', 'ember-routing/location/api', 'ember-routing/utils', 'ember-routing/system/router_state', 'router'], function (exports, _emberUtils, _emberConsole, _emberMetal, _emberRuntime, _emberRoutingSystemRoute, _emberRoutingSystemDsl, _emberRoutingLocationApi, _emberRoutingUtils, _emberRoutingSystemRouter_state, _router4) { - 'use strict'; - - exports.triggerEvent = triggerEvent; - - function K() { - return this; - } - - var slice = Array.prototype.slice; - - /** - The `Ember.Router` class manages the application state and URLs. Refer to - the [routing guide](http://emberjs.com/guides/routing/) for documentation. - - @class Router - @namespace Ember - @extends Ember.Object - @uses Ember.Evented - @public - */ - var EmberRouter = _emberRuntime.Object.extend(_emberRuntime.Evented, { - /** - The `location` property determines the type of URL's that your - application will use. - The following location types are currently available: - * `history` - use the browser's history API to make the URLs look just like any standard URL - * `hash` - use `#` to separate the server part of the URL from the Ember part: `/blog/#/posts/new` - * `none` - do not store the Ember URL in the actual browser URL (mainly used for testing) - * `auto` - use the best option based on browser capabilites: `history` if possible, then `hash` if possible, otherwise `none` - Note: If using ember-cli, this value is defaulted to `auto` by the `locationType` setting of `/config/environment.js` - @property location - @default 'hash' - @see {Ember.Location} - @public - */ - location: 'hash', - - /** - Represents the URL of the root of the application, often '/'. This prefix is - assumed on all routes defined on this router. - @property rootURL - @default '/' - @public - */ - rootURL: '/', - - _initRouterJs: function () { - var router = this.router = new _router4.default(); - router.triggerEvent = triggerEvent; - - router._triggerWillChangeContext = K; - router._triggerWillLeave = K; - - var dslCallbacks = this.constructor.dslCallbacks || [K]; - var dsl = this._buildDSL(); - - dsl.route('application', { path: '/', resetNamespace: true, overrideNameAssertion: true }, function () { - for (var i = 0; i < dslCallbacks.length; i++) { - dslCallbacks[i].call(this); - } - }); - - if (_emberMetal.get(this, 'namespace.LOG_TRANSITIONS_INTERNAL')) { - router.log = _emberConsole.default.debug; - } - - router.map(dsl.generate()); - }, - - _buildDSL: function () { - var moduleBasedResolver = this._hasModuleBasedResolver(); - var options = { - enableLoadingSubstates: !!moduleBasedResolver - }; - - var owner = _emberUtils.getOwner(this); - var router = this; - - options.resolveRouteMap = function (name) { - return owner._lookupFactory('route-map:' + name); - }; - - options.addRouteForEngine = function (name, engineInfo) { - if (!router._engineInfoByRoute[name]) { - router._engineInfoByRoute[name] = engineInfo; - } - }; - - return new _emberRoutingSystemDsl.default(null, options); - }, - - init: function () { - this._super.apply(this, arguments); - - this._qpCache = new _emberUtils.EmptyObject(); - this._resetQueuedQueryParameterChanges(); - this._handledErrors = _emberUtils.dictionary(null); - this._engineInstances = new _emberUtils.EmptyObject(); - this._engineInfoByRoute = new _emberUtils.EmptyObject(); - }, - - /* - Resets all pending query paramter changes. - Called after transitioning to a new route - based on query parameter changes. - */ - _resetQueuedQueryParameterChanges: function () { - this._queuedQPChanges = {}; - }, - - /** - Represents the current URL. - @method url - @return {String} The current URL. - @private - */ - url: _emberMetal.computed(function () { - return _emberMetal.get(this, 'location').getURL(); - }), - - _hasModuleBasedResolver: function () { - var owner = _emberUtils.getOwner(this); - - if (!owner) { - return false; - } - - var resolver = owner.application && owner.application.__registry__ && owner.application.__registry__.resolver; - - if (!resolver) { - return false; - } - - return !!resolver.moduleBasedResolver; - }, - - /** - Initializes the current router instance and sets up the change handling - event listeners used by the instances `location` implementation. - A property named `initialURL` will be used to determine the initial URL. - If no value is found `/` will be used. - @method startRouting - @private - */ - startRouting: function () { - var initialURL = _emberMetal.get(this, 'initialURL'); - - if (this.setupRouter()) { - if (typeof initialURL === 'undefined') { - initialURL = _emberMetal.get(this, 'location').getURL(); - } - var initialTransition = this.handleURL(initialURL); - if (initialTransition && initialTransition.error) { - throw initialTransition.error; - } - } - }, - - setupRouter: function () { - var _this = this; - - this._initRouterJs(); - this._setupLocation(); - - var router = this.router; - var location = _emberMetal.get(this, 'location'); - - // Allow the Location class to cancel the router setup while it refreshes - // the page - if (_emberMetal.get(location, 'cancelRouterSetup')) { - return false; - } - - this._setupRouter(router, location); - - location.onUpdateURL(function (url) { - _this.handleURL(url); - }); - - return true; - }, - - /** - Handles updating the paths and notifying any listeners of the URL - change. - Triggers the router level `didTransition` hook. - For example, to notify google analytics when the route changes, - you could use this hook. (Note: requires also including GA scripts, etc.) - ```javascript - let Router = Ember.Router.extend({ - location: config.locationType, - didTransition: function() { - this._super(...arguments); - return ga('send', 'pageview', { - 'page': this.get('url'), - 'title': this.get('url') - }); - } - }); - ``` - @method didTransition - @public - @since 1.2.0 - */ - didTransition: function (infos) { - updatePaths(this); - - this._cancelSlowTransitionTimer(); - - this.notifyPropertyChange('url'); - this.set('currentState', this.targetState); - - // Put this in the runloop so url will be accurate. Seems - // less surprising than didTransition being out of sync. - _emberMetal.run.once(this, this.trigger, 'didTransition'); - - if (_emberMetal.get(this, 'namespace').LOG_TRANSITIONS) { - _emberConsole.default.log('Transitioned into \'' + EmberRouter._routePath(infos) + '\''); - } - }, - - _setOutlets: function () { - // This is triggered async during Ember.Route#willDestroy. - // If the router is also being destroyed we do not want to - // to create another this._toplevelView (and leak the renderer) - if (this.isDestroying || this.isDestroyed) { - return; - } - - var handlerInfos = this.router.currentHandlerInfos; - var route = undefined; - var defaultParentState = undefined; - var liveRoutes = null; - - if (!handlerInfos) { - return; - } - - for (var i = 0; i < handlerInfos.length; i++) { - route = handlerInfos[i].handler; - var connections = route.connections; - var ownState = undefined; - for (var j = 0; j < connections.length; j++) { - var appended = appendLiveRoute(liveRoutes, defaultParentState, connections[j]); - liveRoutes = appended.liveRoutes; - if (appended.ownState.render.name === route.routeName || appended.ownState.render.outlet === 'main') { - ownState = appended.ownState; - } - } - if (connections.length === 0) { - ownState = representEmptyRoute(liveRoutes, defaultParentState, route); - } - defaultParentState = ownState; - } - - // when a transitionTo happens after the validation phase - // during the initial transition _setOutlets is called - // when no routes are active. However, it will get called - // again with the correct values during the next turn of - // the runloop - if (!liveRoutes) { - return; - } - - if (!this._toplevelView) { - var owner = _emberUtils.getOwner(this); - var OutletView = owner._lookupFactory('view:-outlet'); - this._toplevelView = OutletView.create(); - this._toplevelView.setOutletState(liveRoutes); - var instance = owner.lookup('-application-instance:main'); - instance.didCreateRootView(this._toplevelView); - } else { - this._toplevelView.setOutletState(liveRoutes); - } - }, - - /** - Handles notifying any listeners of an impending URL - change. - Triggers the router level `willTransition` hook. - @method willTransition - @public - @since 1.11.0 - */ - willTransition: function (oldInfos, newInfos, transition) { - _emberMetal.run.once(this, this.trigger, 'willTransition', transition); - - if (_emberMetal.get(this, 'namespace').LOG_TRANSITIONS) { - _emberConsole.default.log('Preparing to transition from \'' + EmberRouter._routePath(oldInfos) + '\' to \'' + EmberRouter._routePath(newInfos) + '\''); - } - }, - - handleURL: function (url) { - // Until we have an ember-idiomatic way of accessing #hashes, we need to - // remove it because router.js doesn't know how to handle it. - url = url.split(/#(.+)?/)[0]; - return this._doURLTransition('handleURL', url); - }, - - _doURLTransition: function (routerJsMethod, url) { - var transition = this.router[routerJsMethod](url || '/'); - didBeginTransition(transition, this); - return transition; - }, - - /** - Transition the application into another route. The route may - be either a single route or route path: - See [Route.transitionTo](http://emberjs.com/api/classes/Ember.Route.html#method_transitionTo) for more info. - @method transitionTo - @param {String} name the name of the route or a URL - @param {...Object} models the model(s) or identifier(s) to be used while - transitioning to the route. - @param {Object} [options] optional hash with a queryParams property - containing a mapping of query parameters - @return {Transition} the transition object associated with this - attempted transition - @public - */ - transitionTo: function () { - var queryParams = undefined; - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - if (resemblesURL(args[0])) { - return this._doURLTransition('transitionTo', args[0]); - } - - var possibleQueryParams = args[args.length - 1]; - if (possibleQueryParams && possibleQueryParams.hasOwnProperty('queryParams')) { - queryParams = args.pop().queryParams; - } else { - queryParams = {}; - } - - var targetRouteName = args.shift(); - return this._doTransition(targetRouteName, args, queryParams); - }, - - intermediateTransitionTo: function () { - var _router; - - (_router = this.router).intermediateTransitionTo.apply(_router, arguments); - - updatePaths(this); - - var infos = this.router.currentHandlerInfos; - if (_emberMetal.get(this, 'namespace').LOG_TRANSITIONS) { - _emberConsole.default.log('Intermediate-transitioned into \'' + EmberRouter._routePath(infos) + '\''); - } - }, - - replaceWith: function () { - return this.transitionTo.apply(this, arguments).method('replace'); - }, - - generate: function () { - var _router2; - - var url = (_router2 = this.router).generate.apply(_router2, arguments); - return this.location.formatURL(url); - }, - - /** - Determines if the supplied route is currently active. - @method isActive - @param routeName - @return {Boolean} - @private - */ - isActive: function (routeName) { - var router = this.router; - return router.isActive.apply(router, arguments); - }, - - /** - An alternative form of `isActive` that doesn't require - manual concatenation of the arguments into a single - array. - @method isActiveIntent - @param routeName - @param models - @param queryParams - @return {Boolean} - @private - @since 1.7.0 - */ - isActiveIntent: function (routeName, models, queryParams) { - return this.currentState.isActiveIntent(routeName, models, queryParams); - }, - - send: function (name, context) { - var _router3; - - (_router3 = this.router).trigger.apply(_router3, arguments); - }, - - /** - Does this router instance have the given route. - @method hasRoute - @return {Boolean} - @private - */ - hasRoute: function (route) { - return this.router.hasRoute(route); - }, - - /** - Resets the state of the router by clearing the current route - handlers and deactivating them. - @private - @method reset - */ - reset: function () { - if (this.router) { - this.router.reset(); - } - }, - - willDestroy: function () { - if (this._toplevelView) { - this._toplevelView.destroy(); - this._toplevelView = null; - } - - this._super.apply(this, arguments); - - this.reset(); - - var instances = this._engineInstances; - for (var _name in instances) { - for (var id in instances[_name]) { - _emberMetal.run(instances[_name][id], 'destroy'); - } - } - }, - - /* - Called when an active route's query parameter has changed. - These changes are batched into a runloop run and trigger - a single transition. - */ - _activeQPChanged: function (queryParameterName, newValue) { - this._queuedQPChanges[queryParameterName] = newValue; - _emberMetal.run.once(this, this._fireQueryParamTransition); - }, - - _updatingQPChanged: function (queryParameterName) { - if (!this._qpUpdates) { - this._qpUpdates = {}; - } - this._qpUpdates[queryParameterName] = true; - }, - - /* - Triggers a transition to a route based on query parameter changes. - This is called once per runloop, to batch changes. - e.g. - if these methods are called in succession: - this._activeQPChanged('foo', '10'); - // results in _queuedQPChanges = { foo: '10' } - this._activeQPChanged('bar', false); - // results in _queuedQPChanges = { foo: '10', bar: false } - _queuedQPChanges will represent both of these changes - and the transition using `transitionTo` will be triggered - once. - */ - _fireQueryParamTransition: function () { - this.transitionTo({ queryParams: this._queuedQPChanges }); - this._resetQueuedQueryParameterChanges(); - }, - - _setupLocation: function () { - var location = _emberMetal.get(this, 'location'); - var rootURL = _emberMetal.get(this, 'rootURL'); - var owner = _emberUtils.getOwner(this); - - if ('string' === typeof location && owner) { - var resolvedLocation = owner.lookup('location:' + location); - - if ('undefined' !== typeof resolvedLocation) { - location = _emberMetal.set(this, 'location', resolvedLocation); - } else { - // Allow for deprecated registration of custom location API's - var options = { - implementation: location - }; - - location = _emberMetal.set(this, 'location', _emberRoutingLocationApi.default.create(options)); - } - } - - if (location !== null && typeof location === 'object') { - if (rootURL) { - _emberMetal.set(location, 'rootURL', rootURL); - } - - // Allow the location to do any feature detection, such as AutoLocation - // detecting history support. This gives it a chance to set its - // `cancelRouterSetup` property which aborts routing. - if (typeof location.detect === 'function') { - location.detect(); - } - - // ensure that initState is called AFTER the rootURL is set on - // the location instance - if (typeof location.initState === 'function') { - location.initState(); - } - } - }, - - _getHandlerFunction: function () { - var _this2 = this; - - var seen = new _emberUtils.EmptyObject(); - var owner = _emberUtils.getOwner(this); - - return function (name) { - var routeName = name; - var routeOwner = owner; - var engineInfo = _this2._engineInfoByRoute[routeName]; - - if (engineInfo) { - var engineInstance = _this2._getEngineInstance(engineInfo); - - routeOwner = engineInstance; - routeName = engineInfo.localFullName; - } - - var fullRouteName = 'route:' + routeName; - - var handler = routeOwner.lookup(fullRouteName); - - if (seen[name]) { - return handler; - } - - seen[name] = true; - - if (!handler) { - var DefaultRoute = routeOwner._lookupFactory('route:basic'); - - routeOwner.register(fullRouteName, DefaultRoute.extend()); - handler = routeOwner.lookup(fullRouteName); - - if (_emberMetal.get(_this2, 'namespace.LOG_ACTIVE_GENERATION')) {} - } - - handler._setRouteName(routeName); - handler._populateQPMeta(); - - if (engineInfo && !_emberRoutingSystemRoute.hasDefaultSerialize(handler)) { - throw new Error('Defining a custom serialize method on an Engine route is not supported.'); - } - - return handler; - }; - }, - - _getSerializerFunction: function () { - var _this3 = this; - - return function (name) { - var engineInfo = _this3._engineInfoByRoute[name]; - - // If this is not an Engine route, we fall back to the handler for serialization - if (!engineInfo) { - return; - } - - return engineInfo.serializeMethod || _emberRoutingSystemRoute.defaultSerialize; - }; - }, - - _setupRouter: function (router, location) { - var lastURL = undefined; - var emberRouter = this; - - router.getHandler = this._getHandlerFunction(); - router.getSerializer = this._getSerializerFunction(); - - var doUpdateURL = function () { - location.setURL(lastURL); - }; - - router.updateURL = function (path) { - lastURL = path; - _emberMetal.run.once(doUpdateURL); - }; - - if (location.replaceURL) { - (function () { - var doReplaceURL = function () { - location.replaceURL(lastURL); - }; - - router.replaceURL = function (path) { - lastURL = path; - _emberMetal.run.once(doReplaceURL); - }; - })(); - } - - router.didTransition = function (infos) { - emberRouter.didTransition(infos); - }; - - router.willTransition = function (oldInfos, newInfos, transition) { - emberRouter.willTransition(oldInfos, newInfos, transition); - }; - }, - - /** - Serializes the given query params according to their QP meta information. - @private - @method _serializeQueryParams - @param {Arrray} handlerInfos - @param {Object} queryParams - @return {Void} - */ - _serializeQueryParams: function (handlerInfos, queryParams) { - var _this4 = this; - - forEachQueryParam(this, handlerInfos, queryParams, function (key, value, qp) { - if (qp) { - delete queryParams[key]; - queryParams[qp.urlKey] = qp.route.serializeQueryParam(value, qp.urlKey, qp.type); - } else if (value === undefined) { - return; // We don't serialize undefined values - } else { - queryParams[key] = _this4._serializeQueryParam(value, _emberRuntime.typeOf(value)); - } - }); - }, - - /** - Serializes the value of a query parameter based on a type - @private - @method _serializeQueryParam - @param {Object} value - @param {String} type - */ - _serializeQueryParam: function (value, type) { - if (type === 'array') { - return JSON.stringify(value); - } - - return '' + value; - }, - - /** - Deserializes the given query params according to their QP meta information. - @private - @method _deserializeQueryParams - @param {Array} handlerInfos - @param {Object} queryParams - @return {Void} - */ - _deserializeQueryParams: function (handlerInfos, queryParams) { - forEachQueryParam(this, handlerInfos, queryParams, function (key, value, qp) { - // If we don't have QP meta info for a given key, then we do nothing - // because all values will be treated as strings - if (qp) { - delete queryParams[key]; - queryParams[qp.prop] = qp.route.deserializeQueryParam(value, qp.urlKey, qp.type); - } - }); - }, - - /** - Deserializes the value of a query parameter based on a default type - @private - @method _deserializeQueryParam - @param {Object} value - @param {String} defaultType - */ - _deserializeQueryParam: function (value, defaultType) { - if (defaultType === 'boolean') { - return value === 'true' ? true : false; - } else if (defaultType === 'number') { - return Number(value).valueOf(); - } else if (defaultType === 'array') { - return _emberRuntime.A(JSON.parse(value)); - } - - return value; - }, - - /** - Removes (prunes) any query params with default values from the given QP - object. Default values are determined from the QP meta information per key. - @private - @method _pruneDefaultQueryParamValues - @param {Array} handlerInfos - @param {Object} queryParams - @return {Void} - */ - _pruneDefaultQueryParamValues: function (handlerInfos, queryParams) { - var qps = this._queryParamsFor(handlerInfos); - for (var key in queryParams) { - var qp = qps.map[key]; - if (qp && qp.serializedDefaultValue === queryParams[key]) { - delete queryParams[key]; - } - } - }, - - _doTransition: function (_targetRouteName, models, _queryParams) { - var targetRouteName = _targetRouteName || _emberRoutingUtils.getActiveTargetName(this.router); - - var queryParams = {}; - - this._processActiveTransitionQueryParams(targetRouteName, models, queryParams, _queryParams); - - _emberUtils.assign(queryParams, _queryParams); - this._prepareQueryParams(targetRouteName, models, queryParams); - - var transitionArgs = _emberRoutingUtils.routeArgs(targetRouteName, models, queryParams); - var transition = this.router.transitionTo.apply(this.router, transitionArgs); - - 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); - _emberUtils.assign(queryParams, unchangedQPs); - }, - - /** - Prepares the query params for a URL or Transition. Restores any undefined QP - keys/values, serializes all values, and then prunes any default values. - @private - @method _prepareQueryParams - @param {String} targetRouteName - @param {Array} models - @param {Object} queryParams - @return {Void} - */ - _prepareQueryParams: function (targetRouteName, models, queryParams) { - var state = calculatePostTransitionState(this, targetRouteName, models); - this._hydrateUnsuppliedQueryParams(state, queryParams); - this._serializeQueryParams(state.handlerInfos, queryParams); - this._pruneDefaultQueryParamValues(state.handlerInfos, queryParams); - }, - - /** - Returns the meta information for the query params of a given route. This - will be overriden to allow support for lazy routes. - @private - @method _getQPMeta - @param {HandlerInfo} handlerInfo - @return {Object} - */ - _getQPMeta: function (handlerInfo) { - var route = handlerInfo.handler; - return route && _emberMetal.get(route, '_qp'); - }, - - /** - Returns a merged query params meta object for a given set of handlerInfos. - Useful for knowing what query params are available for a given route hierarchy. - @private - @method _queryParamsFor - @param {Array} handlerInfos - @return {Object} - */ - _queryParamsFor: function (handlerInfos) { - var leafRouteName = handlerInfos[handlerInfos.length - 1].name; - if (this._qpCache[leafRouteName]) { - return this._qpCache[leafRouteName]; - } - - var shouldCache = true; - var qpsByUrlKey = {}; - var map = {}; - var qps = []; - - for (var i = 0; i < handlerInfos.length; ++i) { - var qpMeta = this._getQPMeta(handlerInfos[i]); - - if (!qpMeta) { - shouldCache = false; - continue; - } - - // Loop over each QP to make sure we don't have any collisions by urlKey - for (var _i = 0; _i < qpMeta.qps.length; _i++) { - var qp = qpMeta.qps[_i]; - var urlKey = qp.urlKey; - - if (qpsByUrlKey[urlKey]) { - var otherQP = qpsByUrlKey[urlKey]; - } - - qpsByUrlKey[urlKey] = qp; - qps.push(qp); - } - - _emberUtils.assign(map, qpMeta.map); - } - - var finalQPMeta = { - qps: qps, - map: map - }; - - if (shouldCache) { - this._qpCache[leafRouteName] = finalQPMeta; - } - - return finalQPMeta; - }, - - /** - Maps all query param keys to their fully scoped property name of the form - `controllerName:propName`. - @private - @method _fullyScopeQueryParams - @param {String} leafRouteName - @param {Array} contexts - @param {Object} queryParams - @return {Void} - */ - _fullyScopeQueryParams: function (leafRouteName, contexts, queryParams) { - var state = calculatePostTransitionState(this, leafRouteName, contexts); - var handlerInfos = state.handlerInfos; - - for (var i = 0, len = handlerInfos.length; i < len; ++i) { - var qpMeta = this._getQPMeta(handlerInfos[i]); - - if (!qpMeta) { - continue; - } - - 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]; - } - } - } - } - }, - - /** - Hydrates (adds/restores) any query params that have pre-existing values into - the given queryParams hash. This is what allows query params to be "sticky" - and restore their last known values for their scope. - @private - @method _hydrateUnsuppliedQueryParams - @param {TransitionState} state - @param {Object} queryParams - @return {Void} - */ - _hydrateUnsuppliedQueryParams: function (state, queryParams) { - var handlerInfos = state.handlerInfos; - var appCache = this._bucketCache; - - for (var i = 0; i < handlerInfos.length; ++i) { - var qpMeta = this._getQPMeta(handlerInfos[i]); - - if (!qpMeta) { - continue; - } - - 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]; - } - } else { - var cacheKey = _emberRoutingUtils.calculateCacheKey(qp.controllerName, qp.parts, state.params); - queryParams[qp.scopedPropertyName] = appCache.lookup(cacheKey, qp.prop, qp.defaultValue); - } - } - } - }, - - _scheduleLoadingEvent: function (transition, originRoute) { - this._cancelSlowTransitionTimer(); - this._slowTransitionTimer = _emberMetal.run.scheduleOnce('routerTransitions', this, '_handleSlowTransition', transition, originRoute); - }, - - currentState: null, - targetState: null, - - _handleSlowTransition: function (transition, originRoute) { - if (!this.router.activeTransition) { - // Don't fire an event if we've since moved on from - // the transition that put us in a loading state. - return; - } - - this.set('targetState', _emberRoutingSystemRouter_state.default.create({ - emberRouter: this, - routerJs: this.router, - routerJsState: this.router.activeTransition.state - })); - - transition.trigger(true, 'loading', transition, originRoute); - }, - - _cancelSlowTransitionTimer: function () { - if (this._slowTransitionTimer) { - _emberMetal.run.cancel(this._slowTransitionTimer); - } - this._slowTransitionTimer = null; - }, - - // These three helper functions are used to ensure errors aren't - // re-raised if they're handled in a route's error action. - _markErrorAsHandled: function (errorGuid) { - this._handledErrors[errorGuid] = true; - }, - - _isErrorHandled: function (errorGuid) { - return this._handledErrors[errorGuid]; - }, - - _clearHandledError: function (errorGuid) { - delete this._handledErrors[errorGuid]; - }, - - _getEngineInstance: function (_ref) { - var name = _ref.name; - var instanceId = _ref.instanceId; - var mountPoint = _ref.mountPoint; - - var engineInstances = this._engineInstances; - - if (!engineInstances[name]) { - engineInstances[name] = new _emberUtils.EmptyObject(); - } - - var engineInstance = engineInstances[name][instanceId]; - - if (!engineInstance) { - var owner = _emberUtils.getOwner(this); - - engineInstance = owner.buildChildEngineInstance(name, { - routable: true, - mountPoint: mountPoint - }); - - engineInstance.boot(); - - engineInstances[name][instanceId] = engineInstance; - } - - return engineInstance; - } - }); - - /* - Helper function for iterating over routes in a set of handlerInfos that are - at or above the given origin route. Example: if `originRoute` === 'foo.bar' - and the handlerInfos given were for 'foo.bar.baz', then the given callback - will be invoked with the routes for 'foo.bar', 'foo', and 'application' - individually. - - If the callback returns anything other than `true`, then iteration will stop. - - @private - @param {Route} originRoute - @param {Array} handlerInfos - @param {Function} callback - @return {Void} - */ - function forEachRouteAbove(originRoute, handlerInfos, callback) { - var originRouteFound = false; - - for (var i = handlerInfos.length - 1; i >= 0; --i) { - var handlerInfo = handlerInfos[i]; - var route = handlerInfo.handler; - - if (originRoute === route) { - originRouteFound = true; - } - - if (!originRouteFound) { - continue; - } - - if (callback(route) !== true) { - return; - } - } - } - - // These get invoked when an action bubbles above ApplicationRoute - // and are not meant to be overridable. - var defaultActionHandlers = { - - willResolveModel: function (transition, originRoute) { - originRoute.router._scheduleLoadingEvent(transition, originRoute); - }, - - // Attempt to find an appropriate error route or substate to enter. - error: function (error, transition, originRoute) { - var handlerInfos = transition.state.handlerInfos; - var router = originRoute.router; - - forEachRouteAbove(originRoute, handlerInfos, function (route) { - // Check for the existence of an 'error' route. - // We don't check for an 'error' route on the originRoute, since that would - // technically be below where we're at in the route hierarchy. - if (originRoute !== route) { - var errorRouteName = findRouteStateName(route, 'error'); - if (errorRouteName) { - router.intermediateTransitionTo(errorRouteName, error); - return false; - } - } - - // Check for an 'error' substate route - var errorSubstateName = findRouteSubstateName(route, 'error'); - if (errorSubstateName) { - router.intermediateTransitionTo(errorSubstateName, error); - return false; - } - - return true; - }); - - logError(error, 'Error while processing route: ' + transition.targetName); - }, - - // Attempt to find an appropriate loading route or substate to enter. - loading: function (transition, originRoute) { - var handlerInfos = transition.state.handlerInfos; - var router = originRoute.router; - - forEachRouteAbove(originRoute, handlerInfos, function (route) { - // Check for the existence of a 'loading' route. - // We don't check for a 'loading' route on the originRoute, since that would - // technically be below where we're at in the route hierarchy. - if (originRoute !== route) { - var loadingRouteName = findRouteStateName(route, 'loading'); - if (loadingRouteName) { - router.intermediateTransitionTo(loadingRouteName); - return false; - } - } - - // Check for loading substate - var loadingSubstateName = findRouteSubstateName(route, 'loading'); - if (loadingSubstateName) { - router.intermediateTransitionTo(loadingSubstateName); - return false; - } - - // Don't bubble above pivot route. - return transition.pivotHandler !== route; - }); - } - }; - - function logError(_error, initialMessage) { - var errorArgs = []; - var error = undefined; - if (_error && typeof _error === 'object' && typeof _error.errorThrown === 'object') { - error = _error.errorThrown; - } else { - error = _error; - } - - if (initialMessage) { - errorArgs.push(initialMessage); - } - - if (error) { - if (error.message) { - errorArgs.push(error.message); - } - if (error.stack) { - errorArgs.push(error.stack); - } - - if (typeof error === 'string') { - errorArgs.push(error); - } - } - - _emberConsole.default.error.apply(this, errorArgs); - } - - /** - Finds the name of the substate route if it exists for the given route. A - substate route is of the form `route_state`, such as `foo_loading`. - - @private - @param {Route} route - @param {String} state - @return {String} - */ - function findRouteSubstateName(route, state) { - var router = route.router; - var owner = _emberUtils.getOwner(route); - - var routeName = route.routeName; - var substateName = routeName + '_' + state; - - var routeNameFull = route.fullRouteName; - var substateNameFull = routeNameFull + '_' + state; - - return routeHasBeenDefined(owner, router, substateName, substateNameFull) ? substateNameFull : ''; - } - - /** - Finds the name of the state route if it exists for the given route. A state - route is of the form `route.state`, such as `foo.loading`. Properly Handles - `application` named routes. - - @private - @param {Route} route - @param {String} state - @return {String} - */ - function findRouteStateName(route, state) { - var router = route.router; - var owner = _emberUtils.getOwner(route); - - var routeName = route.routeName; - var stateName = routeName === 'application' ? state : routeName + '.' + state; - - var routeNameFull = route.fullRouteName; - var stateNameFull = routeNameFull === 'application' ? state : routeNameFull + '.' + state; - - return routeHasBeenDefined(owner, router, stateName, stateNameFull) ? stateNameFull : ''; - } - - /** - Determines whether or not a route has been defined by checking that the route - is in the Router's map and the owner has a registration for that route. - - @private - @param {Owner} owner - @param {Ember.Router} router - @param {String} localName - @param {String} fullName - @return {Boolean} - */ - function routeHasBeenDefined(owner, router, localName, fullName) { - var routerHasRoute = router.hasRoute(fullName); - var ownerHasRoute = owner.hasRegistration('template:' + localName) || owner.hasRegistration('route:' + localName); - return routerHasRoute && ownerHasRoute; - } - - function triggerEvent(handlerInfos, ignoreFailure, args) { - var name = args.shift(); - - if (!handlerInfos) { - if (ignoreFailure) { - return; - } - throw new _emberMetal.Error('Can\'t trigger action \'' + name + '\' because your app hasn\'t finished transitioning into its first route. To trigger an action on destination routes during a transition, you can call `.send()` on the `Transition` object passed to the `model/beforeModel/afterModel` hooks.'); - } - - var eventWasHandled = false; - var handlerInfo = undefined, - handler = undefined; - - for (var i = handlerInfos.length - 1; i >= 0; i--) { - handlerInfo = handlerInfos[i]; - handler = handlerInfo.handler; - - if (handler && handler.actions && handler.actions[name]) { - if (handler.actions[name].apply(handler, args) === true) { - eventWasHandled = true; - } else { - // Should only hit here if a non-bubbling error action is triggered on a route. - if (name === 'error') { - var errorId = _emberUtils.guidFor(args[0]); - handler.router._markErrorAsHandled(errorId); - } - return; - } - } - } - - if (defaultActionHandlers[name]) { - defaultActionHandlers[name].apply(null, args); - return; - } - - if (!eventWasHandled && !ignoreFailure) { - throw new _emberMetal.Error('Nothing handled the action \'' + name + '\'. If you did handle the action, this error can be caused by returning true from an action handler in a controller, causing the action to bubble.'); - } - } - - function calculatePostTransitionState(emberRouter, leafRouteName, contexts) { - var routerjs = emberRouter.router; - var state = routerjs.applyIntent(leafRouteName, contexts); - var handlerInfos = state.handlerInfos; - var params = state.params; - - for (var i = 0; i < handlerInfos.length; ++i) { - var handlerInfo = handlerInfos[i]; - - // If the handlerInfo is not resolved, we serialize the context into params - if (!handlerInfo.isResolved) { - params[handlerInfo.name] = handlerInfo.serialize(handlerInfo.context); - } else { - params[handlerInfo.name] = handlerInfo.params; - } - } - 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; - - _emberMetal.set(router, 'currentPath', path); - _emberMetal.set(router, 'currentRouteName', currentRouteName); - - var appController = _emberUtils.getOwner(router).lookup('controller:application'); - - if (!appController) { - // appController might not exist when top-level loading/error - // substates have been entered since ApplicationRoute hasn't - // actually been entered at that point. - return; - } - - if (!('currentPath' in appController)) { - _emberMetal.defineProperty(appController, 'currentPath'); - } - - _emberMetal.set(appController, 'currentPath', path); - - if (!('currentRouteName' in appController)) { - _emberMetal.defineProperty(appController, 'currentRouteName'); - } - - _emberMetal.set(appController, 'currentRouteName', currentRouteName); - } - - EmberRouter.reopenClass({ - router: null, - - /** - The `Router.map` function allows you to define mappings from URLs to routes - in your application. These mappings are defined within the - supplied callback function using `this.route`. - The first parameter is the name of the route which is used by default as the - path name as well. - The second parameter is the optional options hash. Available options are: - * `path`: allows you to provide your own path as well as mark dynamic - segments. - * `resetNamespace`: false by default; when nesting routes, ember will - combine the route names to form the fully-qualified route name, which is - used with `{{link-to}}` or manually transitioning to routes. Setting - `resetNamespace: true` will cause the route not to inherit from its - parent route's names. This is handy for preventing extremely long route names. - Keep in mind that the actual URL path behavior is still retained. - The third parameter is a function, which can be used to nest routes. - Nested routes, by default, will have the parent route tree's route name and - path prepended to it's own. - ```javascript - App.Router.map(function(){ - this.route('post', { path: '/post/:post_id' }, function() { - this.route('edit'); - this.route('comments', { resetNamespace: true }, function() { - this.route('new'); - }); - }); - }); - ``` - For more detailed documentation and examples please see - [the guides](http://emberjs.com/guides/routing/defining-your-routes/). - @method map - @param callback - @public - */ - map: function (callback) { - if (!this.dslCallbacks) { - this.dslCallbacks = []; - this.reopenClass({ dslCallbacks: this.dslCallbacks }); - } - - this.dslCallbacks.push(callback); - - return this; - }, - - _routePath: function (handlerInfos) { - var path = []; - - // We have to handle coalescing resource names that - // are prefixed with their parent's names, e.g. - // ['foo', 'foo.bar.baz'] => 'foo.bar.baz', not 'foo.foo.bar.baz' - - function intersectionMatches(a1, a2) { - for (var i = 0; i < a1.length; ++i) { - if (a1[i] !== a2[i]) { - return false; - } - } - return true; - } - - var name = undefined, - nameParts = undefined, - oldNameParts = undefined; - for (var i = 1; i < handlerInfos.length; i++) { - name = handlerInfos[i].name; - nameParts = name.split('.'); - oldNameParts = slice.call(path); - - while (oldNameParts.length) { - if (intersectionMatches(oldNameParts, nameParts)) { - break; - } - oldNameParts.shift(); - } - - path.push.apply(path, nameParts.slice(oldNameParts.length)); - } - - return path.join('.'); - } - }); - - function didBeginTransition(transition, router) { - var routerState = _emberRoutingSystemRouter_state.default.create({ - emberRouter: router, - routerJs: router.router, - routerJsState: transition.state - }); - - if (!router.currentState) { - router.set('currentState', routerState); - } - router.set('targetState', routerState); - - transition.promise = transition.catch(function (error) { - var errorId = _emberUtils.guidFor(error); - - if (router._isErrorHandled(errorId)) { - router._clearHandledError(errorId); - } else { - throw error; - } - }); - } - - function resemblesURL(str) { - return typeof str === 'string' && (str === '' || str.charAt(0) === '/'); - } - - function forEachQueryParam(router, handlerInfos, queryParams, callback) { - var qpCache = router._queryParamsFor(handlerInfos); - - for (var key in queryParams) { - if (!queryParams.hasOwnProperty(key)) { - continue; - } - var value = queryParams[key]; - var qp = qpCache.map[key]; - - callback(key, value, qp); - } - } - - function findLiveRoute(liveRoutes, name) { - if (!liveRoutes) { - return; - } - var stack = [liveRoutes]; - while (stack.length > 0) { - var test = stack.shift(); - if (test.render.name === name) { - return test; - } - var outlets = test.outlets; - for (var outletName in outlets) { - stack.push(outlets[outletName]); - } - } - } - - function appendLiveRoute(liveRoutes, defaultParentState, renderOptions) { - var target = undefined; - var myState = { - render: renderOptions, - outlets: new _emberUtils.EmptyObject(), - wasUsed: false - }; - if (renderOptions.into) { - target = findLiveRoute(liveRoutes, renderOptions.into); - } else { - target = defaultParentState; - } - if (target) { - _emberMetal.set(target.outlets, renderOptions.outlet, myState); - } else { - if (renderOptions.into) { - // Megahax time. Post-3.0-breaking-changes, we will just assert - // right here that the user tried to target a nonexistent - // thing. But for now we still need to support the `render` - // helper, and people are allowed to target templates rendered - // by the render helper. So instead we defer doing anyting with - // these orphan renders until afterRender. - appendOrphan(liveRoutes, renderOptions.into, myState); - } else { - liveRoutes = myState; - } - } - return { - liveRoutes: liveRoutes, - ownState: myState - }; - } - - function appendOrphan(liveRoutes, into, myState) { - if (!liveRoutes.outlets.__ember_orphans__) { - liveRoutes.outlets.__ember_orphans__ = { - render: { - name: '__ember_orphans__' - }, - outlets: new _emberUtils.EmptyObject() - }; - } - liveRoutes.outlets.__ember_orphans__.outlets[into] = myState; - _emberMetal.run.schedule('afterRender', function () {}); - } - - function representEmptyRoute(liveRoutes, defaultParentState, route) { - // the route didn't render anything - var alreadyAppended = findLiveRoute(liveRoutes, route.routeName); - if (alreadyAppended) { - // But some other route has already rendered our default - // template, so that becomes the default target for any - // children we may have. - return alreadyAppended; - } else { - // Create an entry to represent our default template name, - // just so other routes can target it and inherit its place - // in the outlet hierarchy. - defaultParentState.outlets.main = { - render: { - name: route.routeName, - outlet: 'main' - }, - outlets: {} - }; - return defaultParentState; - } - } - - exports.default = EmberRouter; -}); - -/** -@module ember -@submodule ember-routing -*/ - -// `wasUsed` gets set by the render helper. -enifed('ember-routing/system/router_state', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime'], function (exports, _emberUtils, _emberMetal, _emberRuntime) { - 'use strict'; - - exports.default = _emberRuntime.Object.extend({ - emberRouter: null, - routerJs: null, - routerJsState: null, - - isActiveIntent: function (routeName, models, queryParams, queryParamsMustMatch) { - var state = this.routerJsState; - if (!this.routerJs.isActiveIntent(routeName, models, null, state)) { - return false; - } - - var emptyQueryParams = _emberMetal.isEmpty(Object.keys(queryParams)); - - if (queryParamsMustMatch && !emptyQueryParams) { - var visibleQueryParams = {}; - _emberUtils.assign(visibleQueryParams, queryParams); - - this.emberRouter._prepareQueryParams(routeName, models, visibleQueryParams); - return shallowEqual(visibleQueryParams, state.queryParams); - } - - return true; - } - }); - - function shallowEqual(a, b) { - var k = undefined; - for (k in a) { - if (a.hasOwnProperty(k) && a[k] !== b[k]) { - return false; - } - } - for (k in b) { - if (b.hasOwnProperty(k) && a[k] !== b[k]) { - return false; - } - } - return true; - } -}); -enifed('ember-routing/utils', ['exports', 'ember-utils', 'ember-metal'], function (exports, _emberUtils, _emberMetal) { - 'use strict'; - - exports.routeArgs = routeArgs; - exports.getActiveTargetName = getActiveTargetName; - exports.stashParamNames = stashParamNames; - exports.calculateCacheKey = calculateCacheKey; - exports.normalizeControllerQueryParams = normalizeControllerQueryParams; - exports.prefixRouteNameArg = prefixRouteNameArg; - - var ALL_PERIODS_REGEX = /\./g; - - function routeArgs(targetRouteName, models, queryParams) { - var args = []; - if (typeof targetRouteName === 'string') { - args.push('' + targetRouteName); - } - args.push.apply(args, models); - args.push({ queryParams: queryParams }); - return args; - } - - function getActiveTargetName(router) { - var handlerInfos = router.activeTransition ? router.activeTransition.state.handlerInfos : router.state.handlerInfos; - return handlerInfos[handlerInfos.length - 1].name; - } - - function stashParamNames(router, handlerInfos) { - if (handlerInfos._namesStashed) { - return; - } - - // This helper exists because router.js/route-recognizer.js awkwardly - // keeps separate a handlerInfo's list of parameter names depending - // on whether a URL transition or named transition is happening. - // Hopefully we can remove this in the future. - var targetRouteName = handlerInfos[handlerInfos.length - 1].name; - var recogHandlers = router.router.recognizer.handlersFor(targetRouteName); - var dynamicParent = null; - - for (var i = 0; i < handlerInfos.length; ++i) { - var handlerInfo = handlerInfos[i]; - var names = recogHandlers[i].names; - - if (names.length) { - dynamicParent = handlerInfo; - } - - handlerInfo._names = names; - - var route = handlerInfo.handler; - route._stashNames(handlerInfo, dynamicParent); - } - - handlerInfos._namesStashed = true; - } - - function _calculateCacheValuePrefix(prefix, part) { - // calculates the dot seperated sections from prefix that are also - // at the start of part - which gives us the route name - - // given : prefix = site.article.comments, part = site.article.id - // - returns: site.article (use get(values[site.article], 'id') to get the dynamic part - used below) - - // given : prefix = site.article, part = site.article.id - // - returns: site.article. (use get(values[site.article], 'id') to get the dynamic part - used below) - - var prefixParts = prefix.split('.'); - var currPrefix = ''; - - for (var i = 0; i < prefixParts.length; i++) { - var currPart = prefixParts.slice(0, i + 1).join('.'); - if (part.indexOf(currPart) !== 0) { - break; - } - currPrefix = currPart; - } - - return currPrefix; - } - - /* - Stolen from Controller - */ - - function calculateCacheKey(prefix, _parts, values) { - var parts = _parts || []; - var suffixes = ''; - for (var i = 0; i < parts.length; ++i) { - var part = parts[i]; - var cacheValuePrefix = _calculateCacheValuePrefix(prefix, part); - var value = undefined; - if (values) { - if (cacheValuePrefix && cacheValuePrefix in values) { - var partRemovedPrefix = part.indexOf(cacheValuePrefix) === 0 ? part.substr(cacheValuePrefix.length + 1) : part; - value = _emberMetal.get(values[cacheValuePrefix], partRemovedPrefix); - } else { - value = _emberMetal.get(values, part); - } - } - suffixes += '::' + part + ':' + value; - } - return prefix + suffixes.replace(ALL_PERIODS_REGEX, '-'); - } - - /* - Controller-defined query parameters can come in three shapes: - - Array - queryParams: ['foo', 'bar'] - Array of simple objects where value is an alias - queryParams: [ - { - 'foo': 'rename_foo_to_this' - }, - { - 'bar': 'call_bar_this_instead' - } - ] - Array of fully defined objects - queryParams: [ - { - 'foo': { - as: 'rename_foo_to_this' - }, - } - { - 'bar': { - as: 'call_bar_this_instead', - scope: 'controller' - } - } - ] - - This helper normalizes all three possible styles into the - 'Array of fully defined objects' style. - */ - - function normalizeControllerQueryParams(queryParams) { - if (queryParams._qpMap) { - return queryParams._qpMap; - } - - var qpMap = queryParams._qpMap = {}; - - for (var i = 0; i < queryParams.length; ++i) { - accumulateQueryParamDescriptors(queryParams[i], qpMap); - } - - return qpMap; - } - - function accumulateQueryParamDescriptors(_desc, accum) { - var desc = _desc; - var tmp = undefined; - if (typeof desc === 'string') { - tmp = {}; - tmp[desc] = { as: null }; - desc = tmp; - } - - for (var key in desc) { - if (!desc.hasOwnProperty(key)) { - return; - } - - var singleDesc = desc[key]; - if (typeof singleDesc === 'string') { - singleDesc = { as: singleDesc }; - } - - tmp = accum[key] || { as: null, scope: 'model' }; - _emberUtils.assign(tmp, singleDesc); - - accum[key] = tmp; - } - } - - /* - Check if a routeName resembles a url instead - - @private - */ - function resemblesURL(str) { - return typeof str === 'string' && (str === '' || str.charAt(0) === '/'); - } - - /* - Returns an arguments array where the route name arg is prefixed based on the mount point - - @private - */ - - function prefixRouteNameArg(route, args) { - var routeName = args[0]; - var owner = _emberUtils.getOwner(route); - var prefix = owner.mountPoint; - - // only alter the routeName if it's actually referencing a route. - if (owner.routable && typeof routeName === 'string') { - if (resemblesURL(routeName)) { - throw new _emberMetal.Error('Programmatic transitions by URL cannot be used within an Engine. Please use the route name instead.'); - } else { - routeName = prefix + '.' + routeName; - args[0] = routeName; - } - } - - return args; - } -}); -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, - 'boolean': 2, - 'number': 3, - 'string': 4, - 'array': 5, - 'object': 6, - 'instance': 7, - 'function': 8, - 'class': 9, - 'date': 10 - }; - - // - // the spaceship operator - // - // `. ___ - // __,' __`. _..----....____ - // __...--.'``;. ,. ;``--..__ .' ,-._ _.-' - // _..-''-------' `' `' `' O ``-''._ (,;') _,' - // ,'________________ \`-._`-',' - // `._ ```````````------...___ '-.._'-: - // ```--.._ ,. ````--...__\-. - // `.--. `-` "INFINITY IS LESS ____ | |` - // `. `. THAN BEYOND" ,'`````. ; ;` - // `._`. __________ `. \'__/` - // `-:._____/______/___/____`. \ ` - // | `._ `. \ - // `._________`-. `. `.___ - // SSt `------'` - function spaceship(a, b) { - var diff = a - b; - return (diff > 0) - (diff < 0); - } - - /** - Compares two javascript values and returns: - - - -1 if the first is smaller than the second, - - 0 if both are equal, - - 1 if the first is greater than the second. - - ```javascript - Ember.compare('hello', 'hello'); // 0 - Ember.compare('abc', 'dfg'); // -1 - Ember.compare(2, 1); // 1 - ``` - - If the types of the two objects are different precedence occurs in the - following order, with types earlier in the list considered `<` types - later in the list: - - - undefined - - null - - boolean - - number - - string - - array - - object - - instance - - function - - class - - date - - ```javascript - Ember.compare('hello', 50); // 1 - Ember.compare(50, 'hello'); // -1 - ``` - - @method compare - @for Ember - @param {Object} v First value to compare - @param {Object} w Second value to compare - @return {Number} -1 if v < w, 0 if v = w and 1 if v > w. - @public - */ - - function compare(v, w) { - if (v === w) { - return 0; - } - - var type1 = _emberRuntimeUtils.typeOf(v); - var type2 = _emberRuntimeUtils.typeOf(w); - - if (_emberRuntimeMixinsComparable.default) { - if (type1 === 'instance' && _emberRuntimeMixinsComparable.default.detect(v) && v.constructor.compare) { - return v.constructor.compare(v, w); - } - - if (type2 === 'instance' && _emberRuntimeMixinsComparable.default.detect(w) && w.constructor.compare) { - return w.constructor.compare(w, v) * -1; - } - } - - var res = spaceship(TYPE_ORDER[type1], TYPE_ORDER[type2]); - - if (res !== 0) { - return res; - } - - // types are equal - so we have to check values now - switch (type1) { - case 'boolean': - case 'number': - return spaceship(v, w); - - case 'string': - return spaceship(v.localeCompare(w), 0); - - case 'array': - var vLen = v.length; - var wLen = w.length; - var len = Math.min(vLen, wLen); - - for (var i = 0; i < len; i++) { - var r = compare(v[i], w[i]); - if (r !== 0) { - return r; - } - } - - // all elements are equal now - // shorter array should be ordered first - return spaceship(vLen, wLen); - - case 'instance': - if (_emberRuntimeMixinsComparable.default && _emberRuntimeMixinsComparable.default.detect(v)) { - return v.compare(v, w); - } - return 0; - - case 'date': - return spaceship(v.getTime(), w.getTime()); - - default: - return 0; - } - } -}); -enifed('ember-runtime/computed/computed_macros', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; - - exports.empty = empty; - exports.notEmpty = notEmpty; - exports.none = none; - exports.not = not; - exports.bool = bool; - exports.match = match; - exports.equal = equal; - exports.gt = gt; - exports.gte = gte; - exports.lt = lt; - exports.lte = lte; - exports.oneWay = oneWay; - exports.readOnly = readOnly; - exports.deprecatingAlias = deprecatingAlias; - - /** - @module ember - @submodule ember-metal - */ - - function expandPropertiesToArray(predicateName, properties) { - var expandedProperties = []; - - function extractProperty(entry) { - expandedProperties.push(entry); - } - - for (var i = 0; i < properties.length; i++) { - var property = properties[i]; - - _emberMetal.expandProperties(property, extractProperty); - } - - return expandedProperties; - } - - function generateComputedWithPredicate(name, predicate) { - return function () { - for (var _len = arguments.length, properties = Array(_len), _key = 0; _key < _len; _key++) { - properties[_key] = arguments[_key]; - } - - var expandedProperties = expandPropertiesToArray(name, properties); - - var computedFunc = _emberMetal.computed(function () { - var lastIdx = expandedProperties.length - 1; - - for (var i = 0; i < lastIdx; i++) { - var value = _emberMetal.get(this, expandedProperties[i]); - if (!predicate(value)) { - return value; - } - } - - return _emberMetal.get(this, expandedProperties[lastIdx]); - }); - - return computedFunc.property.apply(computedFunc, expandedProperties); - }; - } - - /** - A computed property that returns true if the value of the dependent - property is null, an empty string, empty array, or empty function. - - Example - - ```javascript - let ToDoList = Ember.Object.extend({ - isDone: Ember.computed.empty('todos') - }); - - let todoList = ToDoList.create({ - todos: ['Unit Test', 'Documentation', 'Release'] - }); - - todoList.get('isDone'); // false - todoList.get('todos').clear(); - todoList.get('isDone'); // true - ``` - - @since 1.6.0 - @method empty - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which negate - the original value for property - @public - */ - - function empty(dependentKey) { - return _emberMetal.computed(dependentKey + '.length', function () { - return _emberMetal.isEmpty(_emberMetal.get(this, dependentKey)); - }); - } - - /** - A computed property that returns true if the value of the dependent - property is NOT null, an empty string, empty array, or empty function. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - hasStuff: Ember.computed.notEmpty('backpack') - }); - - let hamster = Hamster.create({ backpack: ['Food', 'Sleeping Bag', 'Tent'] }); - - hamster.get('hasStuff'); // true - hamster.get('backpack').clear(); // [] - hamster.get('hasStuff'); // false - ``` - - @method notEmpty - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which returns true if - original value for property is not empty. - @public - */ - - function notEmpty(dependentKey) { - return _emberMetal.computed(dependentKey + '.length', function () { - return !_emberMetal.isEmpty(_emberMetal.get(this, dependentKey)); - }); - } - - /** - A computed property that returns true if the value of the dependent - property is null or undefined. This avoids errors from JSLint complaining - about use of ==, which can be technically confusing. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - isHungry: Ember.computed.none('food') - }); - - let hamster = Hamster.create(); - - hamster.get('isHungry'); // true - hamster.set('food', 'Banana'); - hamster.get('isHungry'); // false - hamster.set('food', null); - hamster.get('isHungry'); // true - ``` - - @method none - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which - returns true if original value for property is null or undefined. - @public - */ - - function none(dependentKey) { - return _emberMetal.computed(dependentKey, function () { - return _emberMetal.isNone(_emberMetal.get(this, dependentKey)); - }); - } - - /** - A computed property that returns the inverse boolean value - of the original value for the dependent property. - - Example - - ```javascript - let User = Ember.Object.extend({ - isAnonymous: Ember.computed.not('loggedIn') - }); - - let user = User.create({loggedIn: false}); - - user.get('isAnonymous'); // true - user.set('loggedIn', true); - user.get('isAnonymous'); // false - ``` - - @method not - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which returns - inverse of the original value for property - @public - */ - - function not(dependentKey) { - return _emberMetal.computed(dependentKey, function () { - return !_emberMetal.get(this, dependentKey); - }); - } - - /** - A computed property that converts the provided dependent property - into a boolean value. - - ```javascript - let Hamster = Ember.Object.extend({ - hasBananas: Ember.computed.bool('numBananas') - }); - - let hamster = Hamster.create(); - - hamster.get('hasBananas'); // false - hamster.set('numBananas', 0); - hamster.get('hasBananas'); // false - hamster.set('numBananas', 1); - hamster.get('hasBananas'); // true - hamster.set('numBananas', null); - hamster.get('hasBananas'); // false - ``` - - @method bool - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which converts - to boolean the original value for property - @public - */ - - function bool(dependentKey) { - return _emberMetal.computed(dependentKey, function () { - return !!_emberMetal.get(this, dependentKey); - }); - } - - /** - A computed property which matches the original value for the - dependent property against a given RegExp, returning `true` - if the value matches the RegExp and `false` if it does not. - - Example - - ```javascript - let User = Ember.Object.extend({ - hasValidEmail: Ember.computed.match('email', /^.+@.+\..+$/) - }); - - let user = User.create({loggedIn: false}); - - user.get('hasValidEmail'); // false - user.set('email', ''); - user.get('hasValidEmail'); // false - user.set('email', 'ember_hamster@example.com'); - user.get('hasValidEmail'); // true - ``` - - @method match - @for Ember.computed - @param {String} dependentKey - @param {RegExp} regexp - @return {Ember.ComputedProperty} computed property which match - the original value for property against a given RegExp - @public - */ - - function match(dependentKey, regexp) { - return _emberMetal.computed(dependentKey, function () { - var value = _emberMetal.get(this, dependentKey); - - return typeof value === 'string' ? regexp.test(value) : false; - }); - } - - /** - A computed property that returns true if the provided dependent property - is equal to the given value. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - napTime: Ember.computed.equal('state', 'sleepy') - }); - - let hamster = Hamster.create(); - - hamster.get('napTime'); // false - hamster.set('state', 'sleepy'); - hamster.get('napTime'); // true - hamster.set('state', 'hungry'); - hamster.get('napTime'); // false - ``` - - @method equal - @for Ember.computed - @param {String} dependentKey - @param {String|Number|Object} value - @return {Ember.ComputedProperty} computed property which returns true if - the original value for property is equal to the given value. - @public - */ - - function equal(dependentKey, value) { - return _emberMetal.computed(dependentKey, function () { - return _emberMetal.get(this, dependentKey) === value; - }); - } - - /** - A computed property that returns true if the provided dependent property - is greater than the provided value. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - hasTooManyBananas: Ember.computed.gt('numBananas', 10) - }); - - let hamster = Hamster.create(); - - hamster.get('hasTooManyBananas'); // false - hamster.set('numBananas', 3); - hamster.get('hasTooManyBananas'); // false - hamster.set('numBananas', 11); - hamster.get('hasTooManyBananas'); // true - ``` - - @method gt - @for Ember.computed - @param {String} dependentKey - @param {Number} value - @return {Ember.ComputedProperty} computed property which returns true if - the original value for property is greater than given value. - @public - */ - - function gt(dependentKey, value) { - return _emberMetal.computed(dependentKey, function () { - return _emberMetal.get(this, dependentKey) > value; - }); - } - - /** - A computed property that returns true if the provided dependent property - is greater than or equal to the provided value. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - hasTooManyBananas: Ember.computed.gte('numBananas', 10) - }); - - let hamster = Hamster.create(); - - hamster.get('hasTooManyBananas'); // false - hamster.set('numBananas', 3); - hamster.get('hasTooManyBananas'); // false - hamster.set('numBananas', 10); - hamster.get('hasTooManyBananas'); // true - ``` - - @method gte - @for Ember.computed - @param {String} dependentKey - @param {Number} value - @return {Ember.ComputedProperty} computed property which returns true if - the original value for property is greater or equal then given value. - @public - */ - - function gte(dependentKey, value) { - return _emberMetal.computed(dependentKey, function () { - return _emberMetal.get(this, dependentKey) >= value; - }); - } - - /** - A computed property that returns true if the provided dependent property - is less than the provided value. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - needsMoreBananas: Ember.computed.lt('numBananas', 3) - }); - - let hamster = Hamster.create(); - - hamster.get('needsMoreBananas'); // true - hamster.set('numBananas', 3); - hamster.get('needsMoreBananas'); // false - hamster.set('numBananas', 2); - hamster.get('needsMoreBananas'); // true - ``` - - @method lt - @for Ember.computed - @param {String} dependentKey - @param {Number} value - @return {Ember.ComputedProperty} computed property which returns true if - the original value for property is less then given value. - @public - */ - - function lt(dependentKey, value) { - return _emberMetal.computed(dependentKey, function () { - return _emberMetal.get(this, dependentKey) < value; - }); - } - - /** - A computed property that returns true if the provided dependent property - is less than or equal to the provided value. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - needsMoreBananas: Ember.computed.lte('numBananas', 3) - }); - - let hamster = Hamster.create(); - - hamster.get('needsMoreBananas'); // true - hamster.set('numBananas', 5); - hamster.get('needsMoreBananas'); // false - hamster.set('numBananas', 3); - hamster.get('needsMoreBananas'); // true - ``` - - @method lte - @for Ember.computed - @param {String} dependentKey - @param {Number} value - @return {Ember.ComputedProperty} computed property which returns true if - the original value for property is less or equal than given value. - @public - */ - - function lte(dependentKey, value) { - return _emberMetal.computed(dependentKey, function () { - return _emberMetal.get(this, dependentKey) <= value; - }); - } - - /** - A computed property that performs a logical `and` on the - original values for the provided dependent properties. - - You may pass in more than two properties and even use - property brace expansion. The computed property will - return the first falsy value or last truthy value - just like JavaScript's `&&` operator. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - readyForCamp: Ember.computed.and('hasTent', 'hasBackpack'), - readyForHike: Ember.computed.and('hasWalkingStick', 'hasBackpack') - }); - - let tomster = Hamster.create(); - - tomster.get('readyForCamp'); // false - tomster.set('hasTent', true); - tomster.get('readyForCamp'); // false - tomster.set('hasBackpack', true); - tomster.get('readyForCamp'); // true - tomster.set('hasBackpack', 'Yes'); - tomster.get('readyForCamp'); // 'Yes' - tomster.set('hasWalkingStick', null); - tomster.get('readyForHike'); // null - ``` - - @method and - @for Ember.computed - @param {String} dependentKey* - @return {Ember.ComputedProperty} computed property which performs - a logical `and` on the values of all the original values for properties. - @public - */ - var and = generateComputedWithPredicate('and', function (value) { - return value; - }); - - exports.and = and; - /** - A computed property which performs a logical `or` on the - original values for the provided dependent properties. - - You may pass in more than two properties and even use - property brace expansion. The computed property will - return the first truthy value or last falsy value just - like JavaScript's `||` operator. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - readyForRain: Ember.computed.or('hasJacket', 'hasUmbrella'), - readyForBeach: Ember.computed.or('{hasSunscreen,hasUmbrella}') - }); - - let tomster = Hamster.create(); - - tomster.get('readyForRain'); // undefined - tomster.set('hasUmbrella', true); - tomster.get('readyForRain'); // true - tomster.set('hasJacket', 'Yes'); - tomster.get('readyForRain'); // 'Yes' - tomster.set('hasSunscreen', 'Check'); - tomster.get('readyForBeach'); // 'Check' - ``` - - @method or - @for Ember.computed - @param {String} dependentKey* - @return {Ember.ComputedProperty} computed property which performs - a logical `or` on the values of all the original values for properties. - @public - */ - var or = generateComputedWithPredicate('or', function (value) { - return !value; - }); - - exports.or = or; - /** - Creates a new property that is an alias for another property - on an object. Calls to `get` or `set` this property behave as - though they were called on the original property. - - ```javascript - let Person = Ember.Object.extend({ - name: 'Alex Matchneer', - nomen: Ember.computed.alias('name') - }); - - let alex = Person.create(); - - alex.get('nomen'); // 'Alex Matchneer' - alex.get('name'); // 'Alex Matchneer' - - alex.set('nomen', '@machty'); - alex.get('name'); // '@machty' - ``` - - @method alias - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which creates an - alias to the original value for property. - @public - */ - - /** - Where `computed.alias` aliases `get` and `set`, and allows for bidirectional - data flow, `computed.oneWay` only provides an aliased `get`. The `set` will - not mutate the upstream property, rather causes the current property to - become the value set. This causes the downstream property to permanently - diverge from the upstream property. - - Example - - ```javascript - let User = Ember.Object.extend({ - firstName: null, - lastName: null, - nickName: Ember.computed.oneWay('firstName') - }); - - let teddy = User.create({ - firstName: 'Teddy', - lastName: 'Zeenny' - }); - - teddy.get('nickName'); // 'Teddy' - teddy.set('nickName', 'TeddyBear'); // 'TeddyBear' - teddy.get('firstName'); // 'Teddy' - ``` - - @method oneWay - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which creates a - one way computed property to the original value for property. - @public - */ - - function oneWay(dependentKey) { - return _emberMetal.alias(dependentKey).oneWay(); - } - - /** - This is a more semantically meaningful alias of `computed.oneWay`, - whose name is somewhat ambiguous as to which direction the data flows. - - @method reads - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which creates a - one way computed property to the original value for property. - @public - */ - - /** - Where `computed.oneWay` provides oneWay bindings, `computed.readOnly` provides - a readOnly one way binding. Very often when using `computed.oneWay` one does - not also want changes to propagate back up, as they will replace the value. - - This prevents the reverse flow, and also throws an exception when it occurs. - - Example - - ```javascript - let User = Ember.Object.extend({ - firstName: null, - lastName: null, - nickName: Ember.computed.readOnly('firstName') - }); - - let teddy = User.create({ - firstName: 'Teddy', - lastName: 'Zeenny' - }); - - teddy.get('nickName'); // 'Teddy' - teddy.set('nickName', 'TeddyBear'); // throws Exception - // throw new Ember.Error('Cannot Set: nickName on: ' );` - teddy.get('firstName'); // 'Teddy' - ``` - - @method readOnly - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computed property which creates a - one way computed property to the original value for property. - @since 1.5.0 - @public - */ - - function readOnly(dependentKey) { - return _emberMetal.alias(dependentKey).readOnly(); - } - - /** - Creates a new property that is an alias for another property - on an object. Calls to `get` or `set` this property behave as - though they were called on the original property, but also - print a deprecation warning. - - ```javascript - let Hamster = Ember.Object.extend({ - bananaCount: Ember.computed.deprecatingAlias('cavendishCount', { - id: 'hamster.deprecate-banana', - until: '3.0.0' - }) - }); - - let hamster = Hamster.create(); - - hamster.set('bananaCount', 5); // Prints a deprecation warning. - hamster.get('cavendishCount'); // 5 - ``` - - @method deprecatingAlias - @for Ember.computed - @param {String} dependentKey - @param {Object} options Options for `Ember.deprecate`. - @return {Ember.ComputedProperty} computed property which creates an - alias with a deprecation to the original value for property. - @since 1.7.0 - @public - */ - - function deprecatingAlias(dependentKey, options) { - return _emberMetal.computed(dependentKey, { - get: function (key) { - return _emberMetal.get(this, dependentKey); - }, - set: function (key, value) { - _emberMetal.set(this, dependentKey, value); - return value; - } - }); - } -}); -enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/compare', 'ember-runtime/utils', 'ember-runtime/system/native_array'], function (exports, _emberUtils, _emberMetal, _emberRuntimeCompare, _emberRuntimeUtils, _emberRuntimeSystemNative_array) { - /** - @module ember - @submodule ember-runtime - */ - - 'use strict'; - - exports.sum = sum; - exports.max = max; - exports.min = min; - exports.map = map; - exports.mapBy = mapBy; - exports.filter = filter; - exports.filterBy = filterBy; - exports.uniq = uniq; - exports.uniqBy = uniqBy; - exports.intersect = intersect; - exports.setDiff = setDiff; - exports.collect = collect; - exports.sort = sort; - - function reduceMacro(dependentKey, callback, initialValue) { - return _emberMetal.computed(dependentKey + '.[]', function () { - var _this = this; - - var arr = _emberMetal.get(this, dependentKey); - - if (arr === null || typeof arr !== 'object') { - return initialValue; - } - - return arr.reduce(function (previousValue, currentValue, index, array) { - return callback.call(_this, previousValue, currentValue, index, array); - }, initialValue); - }).readOnly(); - } - - function arrayMacro(dependentKey, callback) { - // This is a bit ugly - var propertyName = undefined; - if (/@each/.test(dependentKey)) { - propertyName = dependentKey.replace(/\.@each.*$/, ''); - } else { - propertyName = dependentKey; - dependentKey += '.[]'; - } - - return _emberMetal.computed(dependentKey, function () { - var value = _emberMetal.get(this, propertyName); - if (_emberRuntimeUtils.isArray(value)) { - return _emberRuntimeSystemNative_array.A(callback.call(this, value)); - } else { - return _emberRuntimeSystemNative_array.A(); - } - }).readOnly(); - } - - function multiArrayMacro(dependentKeys, callback) { - var args = dependentKeys.map(function (key) { - return key + '.[]'; - }); - - args.push(function () { - return _emberRuntimeSystemNative_array.A(callback.call(this, dependentKeys)); - }); - - return _emberMetal.computed.apply(this, args).readOnly(); - } - - /** - A computed property that returns the sum of the values - in the dependent array. - - @method sum - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computes the sum of all values in the dependentKey's array - @since 1.4.0 - @public - */ - - function sum(dependentKey) { - return reduceMacro(dependentKey, function (sum, item) { - return sum + item; - }, 0); - } - - /** - A computed property that calculates the maximum value in the - dependent array. This will return `-Infinity` when the dependent - array is empty. - - ```javascript - let Person = Ember.Object.extend({ - childAges: Ember.computed.mapBy('children', 'age'), - maxChildAge: Ember.computed.max('childAges') - }); - - let lordByron = Person.create({ children: [] }); - - lordByron.get('maxChildAge'); // -Infinity - lordByron.get('children').pushObject({ - name: 'Augusta Ada Byron', age: 7 - }); - lordByron.get('maxChildAge'); // 7 - lordByron.get('children').pushObjects([{ - name: 'Allegra Byron', - age: 5 - }, { - name: 'Elizabeth Medora Leigh', - age: 8 - }]); - lordByron.get('maxChildAge'); // 8 - ``` - - If the types of the arguments are not numbers, - they will be converted to numbers and the type - of the return value will always be `Number`. - For example, the max of a list of Date objects will be - the highest timestamp as a `Number`. - This behavior is consistent with `Math.max`. - - @method max - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computes the largest value in the dependentKey's array - @public - */ - - function max(dependentKey) { - return reduceMacro(dependentKey, function (max, item) { - return Math.max(max, item); - }, -Infinity); - } - - /** - A computed property that calculates the minimum value in the - dependent array. This will return `Infinity` when the dependent - array is empty. - - ```javascript - let Person = Ember.Object.extend({ - childAges: Ember.computed.mapBy('children', 'age'), - minChildAge: Ember.computed.min('childAges') - }); - - let lordByron = Person.create({ children: [] }); - - lordByron.get('minChildAge'); // Infinity - lordByron.get('children').pushObject({ - name: 'Augusta Ada Byron', age: 7 - }); - lordByron.get('minChildAge'); // 7 - lordByron.get('children').pushObjects([{ - name: 'Allegra Byron', - age: 5 - }, { - name: 'Elizabeth Medora Leigh', - age: 8 - }]); - lordByron.get('minChildAge'); // 5 - ``` - - If the types of the arguments are not numbers, - they will be converted to numbers and the type - of the return value will always be `Number`. - For example, the min of a list of Date objects will be - the lowest timestamp as a `Number`. - This behavior is consistent with `Math.min`. - - @method min - @for Ember.computed - @param {String} dependentKey - @return {Ember.ComputedProperty} computes the smallest value in the dependentKey's array - @public - */ - - function min(dependentKey) { - return reduceMacro(dependentKey, function (min, item) { - return Math.min(min, item); - }, Infinity); - } - - /** - Returns an array mapped via the callback - - The callback method you provide should have the following signature. - `item` is the current item in the iteration. - `index` is the integer index of the current item in the iteration. - - ```javascript - function(item, index); - ``` - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - excitingChores: Ember.computed.map('chores', function(chore, index) { - return chore.toUpperCase() + '!'; - }) - }); - - let hamster = Hamster.create({ - chores: ['clean', 'write more unit tests'] - }); - - hamster.get('excitingChores'); // ['CLEAN!', 'WRITE MORE UNIT TESTS!'] - ``` - - @method map - @for Ember.computed - @param {String} dependentKey - @param {Function} callback - @return {Ember.ComputedProperty} an array mapped via the callback - @public - */ - - function map(dependentKey, callback) { - return arrayMacro(dependentKey, function (value) { - return value.map(callback, this); - }); - } - - /** - Returns an array mapped to the specified key. - - ```javascript - let Person = Ember.Object.extend({ - childAges: Ember.computed.mapBy('children', 'age') - }); - - let lordByron = Person.create({ children: [] }); - - lordByron.get('childAges'); // [] - lordByron.get('children').pushObject({ name: 'Augusta Ada Byron', age: 7 }); - lordByron.get('childAges'); // [7] - lordByron.get('children').pushObjects([{ - name: 'Allegra Byron', - age: 5 - }, { - name: 'Elizabeth Medora Leigh', - age: 8 - }]); - lordByron.get('childAges'); // [7, 5, 8] - ``` - - @method mapBy - @for Ember.computed - @param {String} dependentKey - @param {String} propertyKey - @return {Ember.ComputedProperty} an array mapped to the specified key - @public - */ - - function mapBy(dependentKey, propertyKey) { - - return map(dependentKey + '.@each.' + propertyKey, function (item) { - return _emberMetal.get(item, propertyKey); - }); - } - - /** - Filters the array by the callback. - - The callback method you provide should have the following signature. - `item` is the current item in the iteration. - `index` is the integer index of the current item in the iteration. - `array` is the dependant array itself. - - ```javascript - function(item, index, array); - ``` - - ```javascript - let Hamster = Ember.Object.extend({ - remainingChores: Ember.computed.filter('chores', function(chore, index, array) { - return !chore.done; - }) - }); - - let hamster = Hamster.create({ - chores: [ - { name: 'cook', done: true }, - { name: 'clean', done: true }, - { name: 'write more unit tests', done: false } - ] - }); - - hamster.get('remainingChores'); // [{name: 'write more unit tests', done: false}] - ``` - - @method filter - @for Ember.computed - @param {String} dependentKey - @param {Function} callback - @return {Ember.ComputedProperty} the filtered array - @public - */ - - function filter(dependentKey, callback) { - return arrayMacro(dependentKey, function (value) { - return value.filter(callback, this); - }); - } - - /** - Filters the array by the property and value - - ```javascript - let Hamster = Ember.Object.extend({ - remainingChores: Ember.computed.filterBy('chores', 'done', false) - }); - - let hamster = Hamster.create({ - chores: [ - { name: 'cook', done: true }, - { name: 'clean', done: true }, - { name: 'write more unit tests', done: false } - ] - }); - - hamster.get('remainingChores'); // [{ name: 'write more unit tests', done: false }] - ``` - - @method filterBy - @for Ember.computed - @param {String} dependentKey - @param {String} propertyKey - @param {*} value - @return {Ember.ComputedProperty} the filtered array - @public - */ - - function filterBy(dependentKey, propertyKey, value) { - var callback = undefined; - - if (arguments.length === 2) { - callback = function (item) { - return _emberMetal.get(item, propertyKey); - }; - } else { - callback = function (item) { - return _emberMetal.get(item, propertyKey) === value; - }; - } - - return filter(dependentKey + '.@each.' + propertyKey, callback); - } - - /** - A computed property which returns a new array with all the unique - elements from one or more dependent arrays. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - uniqueFruits: Ember.computed.uniq('fruits') - }); - - let hamster = Hamster.create({ - fruits: [ - 'banana', - 'grape', - 'kale', - 'banana' - ] - }); - - hamster.get('uniqueFruits'); // ['banana', 'grape', 'kale'] - ``` - - @method uniq - @for Ember.computed - @param {String} propertyKey* - @return {Ember.ComputedProperty} computes a new array with all the - unique elements from the dependent array - @public - */ - - function uniq() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return multiArrayMacro(args, function (dependentKeys) { - var _this2 = this; - - var uniq = _emberRuntimeSystemNative_array.A(); - - dependentKeys.forEach(function (dependentKey) { - var value = _emberMetal.get(_this2, dependentKey); - if (_emberRuntimeUtils.isArray(value)) { - value.forEach(function (item) { - if (uniq.indexOf(item) === -1) { - uniq.push(item); - } - }); - } - }); - - return uniq; - }); - } - - /** - A computed property which returns a new array with all the unique - elements from an array, with uniqueness determined by specific key. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - uniqueFruits: Ember.computed.uniqBy('fruits', 'id') - }); - let hamster = Hamster.create({ - fruits: [ - { id: 1, 'banana' }, - { id: 2, 'grape' }, - { id: 3, 'peach' }, - { id: 1, 'banana' } - ] - }); - hamster.get('uniqueFruits'); // [ { id: 1, 'banana' }, { id: 2, 'grape' }, { id: 3, 'peach' }] - ``` - - @method uniqBy - @for Ember.computed - @param {String} dependentKey - @param {String} propertyKey - @return {Ember.ComputedProperty} computes a new array with all the - unique elements from the dependent array - @public - */ - - function uniqBy(dependentKey, propertyKey) { - return _emberMetal.computed(dependentKey + '.[]', function () { - var uniq = _emberRuntimeSystemNative_array.A(); - var seen = new _emberUtils.EmptyObject(); - var list = _emberMetal.get(this, dependentKey); - if (_emberRuntimeUtils.isArray(list)) { - list.forEach(function (item) { - var guid = _emberUtils.guidFor(_emberMetal.get(item, propertyKey)); - if (!(guid in seen)) { - seen[guid] = true; - uniq.push(item); - } - }); - } - return uniq; - }).readOnly(); - } - - /** - Alias for [Ember.computed.uniq](/api/#method_computed_uniq). - - @method union - @for Ember.computed - @param {String} propertyKey* - @return {Ember.ComputedProperty} computes a new array with all the - unique elements from the dependent array - @public - */ - var union = uniq; - - exports.union = union; - /** - A computed property which returns a new array with all the duplicated - elements from two or more dependent arrays. - - Example - - ```javascript - let obj = Ember.Object.extend({ - friendsInCommon: Ember.computed.intersect('adaFriends', 'charlesFriends') - }).create({ - adaFriends: ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'], - charlesFriends: ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock'] - }); - - obj.get('friendsInCommon'); // ['William King', 'Mary Somerville'] - ``` - - @method intersect - @for Ember.computed - @param {String} propertyKey* - @return {Ember.ComputedProperty} computes a new array with all the - duplicated elements from the dependent arrays - @public - */ - - function intersect() { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - return multiArrayMacro(args, function (dependentKeys) { - var _this3 = this; - - var arrays = dependentKeys.map(function (dependentKey) { - var array = _emberMetal.get(_this3, dependentKey); - - return _emberRuntimeUtils.isArray(array) ? array : []; - }); - - var results = arrays.pop().filter(function (candidate) { - for (var i = 0; i < arrays.length; i++) { - var found = false; - var array = arrays[i]; - for (var j = 0; j < array.length; j++) { - if (array[j] === candidate) { - found = true; - break; - } - } - - if (found === false) { - return false; - } - } - - return true; - }); - - return _emberRuntimeSystemNative_array.A(results); - }); - } - - /** - A computed property which returns a new array with all the - properties from the first dependent array that are not in the second - dependent array. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - likes: ['banana', 'grape', 'kale'], - wants: Ember.computed.setDiff('likes', 'fruits') - }); - - let hamster = Hamster.create({ - fruits: [ - 'grape', - 'kale', - ] - }); - - hamster.get('wants'); // ['banana'] - ``` - - @method setDiff - @for Ember.computed - @param {String} setAProperty - @param {String} setBProperty - @return {Ember.ComputedProperty} computes a new array with all the - items from the first dependent array that are not in the second - dependent array - @public - */ - - function setDiff(setAProperty, setBProperty) { - if (arguments.length !== 2) { - throw new _emberMetal.Error('setDiff requires exactly two dependent arrays.'); - } - - return _emberMetal.computed(setAProperty + '.[]', setBProperty + '.[]', function () { - var setA = this.get(setAProperty); - var setB = this.get(setBProperty); - - if (!_emberRuntimeUtils.isArray(setA)) { - return _emberRuntimeSystemNative_array.A(); - } - if (!_emberRuntimeUtils.isArray(setB)) { - return _emberRuntimeSystemNative_array.A(setA); - } - - return setA.filter(function (x) { - return setB.indexOf(x) === -1; - }); - }).readOnly(); - } - - /** - A computed property that returns the array of values - for the provided dependent properties. - - Example - - ```javascript - let Hamster = Ember.Object.extend({ - clothes: Ember.computed.collect('hat', 'shirt') - }); - - let hamster = Hamster.create(); - - hamster.get('clothes'); // [null, null] - hamster.set('hat', 'Camp Hat'); - hamster.set('shirt', 'Camp Shirt'); - hamster.get('clothes'); // ['Camp Hat', 'Camp Shirt'] - ``` - - @method collect - @for Ember.computed - @param {String} dependentKey* - @return {Ember.ComputedProperty} computed property which maps - values of all passed in properties to an array. - @public - */ - - function collect() { - for (var _len3 = arguments.length, dependentKeys = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - dependentKeys[_key3] = arguments[_key3]; - } - - return multiArrayMacro(dependentKeys, function () { - var properties = _emberMetal.getProperties(this, dependentKeys); - var res = _emberRuntimeSystemNative_array.A(); - for (var key in properties) { - if (properties.hasOwnProperty(key)) { - if (_emberMetal.isNone(properties[key])) { - res.push(null); - } else { - res.push(properties[key]); - } - } - } - return res; - }); - } - - /** - A computed property which returns a new array with all the - properties from the first dependent array sorted based on a property - or sort function. - - The callback method you provide should have the following signature: - - ```javascript - function(itemA, itemB); - ``` - - - `itemA` the first item to compare. - - `itemB` the second item to compare. - - This function should return negative number (e.g. `-1`) when `itemA` should come before - `itemB`. It should return positive number (e.g. `1`) when `itemA` should come after - `itemB`. If the `itemA` and `itemB` are equal this function should return `0`. - - Therefore, if this function is comparing some numeric values, simple `itemA - itemB` or - `itemA.get( 'foo' ) - itemB.get( 'foo' )` can be used instead of series of `if`. - - Example - - ```javascript - let ToDoList = Ember.Object.extend({ - // using standard ascending sort - todosSorting: ['name'], - sortedTodos: Ember.computed.sort('todos', 'todosSorting'), - - // using descending sort - todosSortingDesc: ['name:desc'], - sortedTodosDesc: Ember.computed.sort('todos', 'todosSortingDesc'), - - // using a custom sort function - priorityTodos: Ember.computed.sort('todos', function(a, b){ - if (a.priority > b.priority) { - return 1; - } else if (a.priority < b.priority) { - return -1; - } - - return 0; - }) - }); - - let todoList = ToDoList.create({todos: [ - { name: 'Unit Test', priority: 2 }, - { name: 'Documentation', priority: 3 }, - { name: 'Release', priority: 1 } - ]}); - - todoList.get('sortedTodos'); // [{ name:'Documentation', priority:3 }, { name:'Release', priority:1 }, { name:'Unit Test', priority:2 }] - todoList.get('sortedTodosDesc'); // [{ name:'Unit Test', priority:2 }, { name:'Release', priority:1 }, { name:'Documentation', priority:3 }] - todoList.get('priorityTodos'); // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }] - ``` - - @method sort - @for Ember.computed - @param {String} itemsKey - @param {String or Function} sortDefinition a dependent key to an - array of sort properties (add `:desc` to the arrays sort properties to sort descending) or a function to use when sorting - @return {Ember.ComputedProperty} computes a new sorted array based - on the sort property array or callback function - @public - */ - - function sort(itemsKey, sortDefinition) { - - if (typeof sortDefinition === 'function') { - return customSort(itemsKey, sortDefinition); - } else { - return propertySort(itemsKey, sortDefinition); - } - } - - function customSort(itemsKey, comparator) { - return arrayMacro(itemsKey, function (value) { - var _this4 = this; - - return value.slice().sort(function (x, y) { - return comparator.call(_this4, x, y); - }); - }); - } - - // This one needs to dynamically set up and tear down observers on the itemsKey - // depending on the sortProperties - function propertySort(itemsKey, sortPropertiesKey) { - var cp = new _emberMetal.ComputedProperty(function (key) { - var _this5 = this; - - var itemsKeyIsAtThis = itemsKey === '@this'; - var sortProperties = _emberMetal.get(this, sortPropertiesKey); - - var normalizedSortProperties = normalizeSortProperties(sortProperties); - - // Add/remove property observers as required. - var activeObserversMap = cp._activeObserverMap || (cp._activeObserverMap = new _emberMetal.WeakMap()); - var activeObservers = activeObserversMap.get(this); - - if (activeObservers) { - activeObservers.forEach(function (args) { - return _emberMetal.removeObserver.apply(null, args); - }); - } - - function sortPropertyDidChange() { - this.notifyPropertyChange(key); - } - - activeObservers = normalizedSortProperties.map(function (_ref) { - var prop = _ref[0]; - - var path = itemsKeyIsAtThis ? '@each.' + prop : itemsKey + '.@each.' + prop; - var args = [_this5, path, sortPropertyDidChange]; - _emberMetal.addObserver.apply(null, args); - return args; - }); - - activeObserversMap.set(this, activeObservers); - - // Sort and return the array. - var items = itemsKeyIsAtThis ? this : _emberMetal.get(this, itemsKey); - - if (_emberRuntimeUtils.isArray(items)) { - return sortByNormalizedSortProperties(items, normalizedSortProperties); - } else { - return _emberRuntimeSystemNative_array.A(); - } - }); - - cp._activeObserverMap = undefined; - - return cp.property(sortPropertiesKey + '.[]').readOnly(); - } - - function normalizeSortProperties(sortProperties) { - return sortProperties.map(function (p) { - var _p$split = p.split(':'); - - var prop = _p$split[0]; - var direction = _p$split[1]; - - direction = direction || 'asc'; - - return [prop, direction]; - }); - } - - function sortByNormalizedSortProperties(items, normalizedSortProperties) { - return _emberRuntimeSystemNative_array.A(items.slice().sort(function (itemA, itemB) { - for (var i = 0; i < normalizedSortProperties.length; i++) { - var _normalizedSortProperties$i = normalizedSortProperties[i]; - var prop = _normalizedSortProperties$i[0]; - var direction = _normalizedSortProperties$i[1]; - - var result = _emberRuntimeCompare.default(_emberMetal.get(itemA, prop), _emberMetal.get(itemB, prop)); - if (result !== 0) { - return direction === 'desc' ? -1 * result : result; - } - } - - return 0; - })); - } -}); -enifed('ember-runtime/controllers/controller', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/mixins/controller', 'ember-runtime/inject', 'ember-runtime/mixins/action_handler'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeMixinsController, _emberRuntimeInject, _emberRuntimeMixinsAction_handler) { - 'use strict'; - - /** - @module ember - @submodule ember-runtime - */ - - /** - @class Controller - @namespace Ember - @extends Ember.Object - @uses Ember.ControllerMixin - @public - */ - var Controller = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsController.default); - - _emberRuntimeMixinsAction_handler.deprecateUnderscoreActions(Controller); - - function controllerInjectionHelper(factory) {} - - /** - Creates a property that lazily looks up another controller in the container. - Can only be used when defining another controller. - - Example: - - ```javascript - App.PostController = Ember.Controller.extend({ - posts: Ember.inject.controller() - }); - ``` - - This example will create a `posts` property on the `post` controller that - looks up the `posts` controller in the container, making it easy to - reference other controllers. This is functionally equivalent to: - - ```javascript - App.PostController = Ember.Controller.extend({ - needs: 'posts', - posts: Ember.computed.alias('controllers.posts') - }); - ``` - - @method controller - @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 - @public - */ - _emberRuntimeInject.createInjectionHelper('controller', controllerInjectionHelper); - - exports.default = Controller; -}); -enifed('ember-runtime/copy', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/mixins/copyable'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeMixinsCopyable) { - 'use strict'; - - exports.default = copy; - - function _copy(obj, deep, seen, copies) { - var ret = undefined, - loc = undefined, - key = undefined; - - // primitive data types are immutable, just return them. - if (typeof obj !== 'object' || obj === null) { - return obj; - } - - // avoid cyclical loops - if (deep && (loc = seen.indexOf(obj)) >= 0) { - return copies[loc]; - } - - // IMPORTANT: this specific test will detect a native array only. Any other - // object will need to implement Copyable. - if (Array.isArray(obj)) { - ret = obj.slice(); - - if (deep) { - loc = ret.length; - - while (--loc >= 0) { - ret[loc] = _copy(ret[loc], deep, seen, copies); - } - } - } else if (_emberRuntimeMixinsCopyable.default && _emberRuntimeMixinsCopyable.default.detect(obj)) { - ret = obj.copy(deep, seen, copies); - } else if (obj instanceof Date) { - ret = new Date(obj.getTime()); - } else { - ret = {}; - - for (key in obj) { - // support Null prototype - if (!Object.prototype.hasOwnProperty.call(obj, key)) { - continue; - } - - // Prevents browsers that don't respect non-enumerability from - // copying internal Ember properties - if (key.substring(0, 2) === '__') { - continue; - } - - ret[key] = deep ? _copy(obj[key], deep, seen, copies) : obj[key]; - } - } - - if (deep) { - seen.push(obj); - copies.push(ret); - } - - return ret; - } - - /** - Creates a shallow copy of the passed object. A deep copy of the object is - returned if the optional `deep` argument is `true`. - - If the passed object implements the `Ember.Copyable` interface, then this - function will delegate to the object's `copy()` method and return the - result. See `Ember.Copyable` for further details. - - For primitive values (which are immutable in JavaScript), the passed object - is simply returned. - - @method copy - @for Ember - @param {Object} obj The object to clone - @param {Boolean} [deep=false] If true, a deep copy of the object is made. - @return {Object} The copied object - @public - */ - - function copy(obj, deep) { - // fast paths - if ('object' !== typeof obj || obj === null) { - return obj; // can't copy primitives - } - - if (_emberRuntimeMixinsCopyable.default && _emberRuntimeMixinsCopyable.default.detect(obj)) { - return obj.copy(deep); - } - - return _copy(obj, deep, deep ? [] : null, deep ? [] : null); - } -}); -enifed('ember-runtime/ext/function', ['exports', 'ember-environment', 'ember-metal'], function (exports, _emberEnvironment, _emberMetal) { - /** - @module ember - @submodule ember-runtime - */ - - 'use strict'; - - var a_slice = Array.prototype.slice; - var FunctionPrototype = Function.prototype; - - if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.Function) { - /** - The `property` extension of Javascript's Function prototype is available - when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is - `true`, which is the default. - Computed properties allow you to treat a function like a property: - ```javascript - MyApp.President = Ember.Object.extend({ - firstName: '', - lastName: '', - fullName: function() { - return this.get('firstName') + ' ' + this.get('lastName'); - }.property() // Call this flag to mark the function as a property - }); - let president = MyApp.President.create({ - firstName: 'Barack', - lastName: 'Obama' - }); - president.get('fullName'); // 'Barack Obama' - ``` - Treating a function like a property is useful because they can work with - bindings, just like any other property. - Many computed properties have dependencies on other properties. For - example, in the above example, the `fullName` property depends on - `firstName` and `lastName` to determine its value. You can tell Ember - about these dependencies like this: - ```javascript - MyApp.President = Ember.Object.extend({ - firstName: '', - lastName: '', - fullName: function() { - return this.get('firstName') + ' ' + this.get('lastName'); - // Tell Ember.js that this computed property depends on firstName - // and lastName - }.property('firstName', 'lastName') - }); - ``` - 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/classes/Ember.computed.html). - @method property - @for Function - @public - */ - FunctionPrototype.property = function () { - var ret = _emberMetal.computed(this); - // ComputedProperty.prototype.property expands properties; no need for us to - // do so here. - return ret.property.apply(ret, arguments); - }; - - /** - The `observes` extension of Javascript's Function prototype is available - when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is - true, which is the default. - You can observe property changes simply by adding the `observes` - call to the end of your method declarations in classes that you write. - For example: - ```javascript - Ember.Object.extend({ - valueObserver: function() { - // Executes whenever the "value" property changes - }.observes('value') - }); - ``` - In the future this method may become asynchronous. - See `Ember.observer`. - @method observes - @for Function - @public - */ - FunctionPrototype.observes = function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - args.push(this); - return _emberMetal.observer.apply(this, args); - }; - - FunctionPrototype._observesImmediately = function () { - - // observes handles property expansion - return this.observes.apply(this, arguments); - }; - /** - The `observesImmediately` extension of Javascript's Function prototype is - available when `EmberENV.EXTEND_PROTOTYPES` or - `EmberENV.EXTEND_PROTOTYPES.Function` is true, which is the default. - You can observe property changes simply by adding the `observesImmediately` - call to the end of your method declarations in classes that you write. - For example: - ```javascript - Ember.Object.extend({ - valueObserver: function() { - // Executes immediately after the "value" property changes - }.observesImmediately('value') - }); - ``` - In the future, `observes` may become asynchronous. In this event, - `observesImmediately` will maintain the synchronous behavior. - See `Ember.immediateObserver`. - @method observesImmediately - @for Function - @deprecated - @private - */ - FunctionPrototype.observesImmediately = _emberMetal.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 `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is - true, which is the default. - You can listen for events simply by adding the `on` call to the end of - your method declarations in classes or mixins that you write. For example: - ```javascript - Ember.Mixin.create({ - doSomethingWithElement: function() { - // Executes whenever the "didInsertElement" event fires - }.on('didInsertElement') - }); - ``` - See `Ember.on`. - @method on - @for Function - @public - */ - FunctionPrototype.on = function () { - var events = a_slice.call(arguments); - this.__ember_listens__ = events; - - return this; - }; - } -}); -enifed('ember-runtime/ext/rsvp', ['exports', 'rsvp', 'ember-metal'], function (exports, _rsvp, _emberMetal) { - 'use strict'; - - exports.onerrorDefault = onerrorDefault; - - var backburner = _emberMetal.run.backburner; - _emberMetal.run._addQueue('rsvpAfter', 'destroy'); - - _rsvp.configure('async', function (callback, promise) { - backburner.schedule('actions', null, callback, promise); - }); - - _rsvp.configure('after', function (cb) { - backburner.schedule('rsvpAfter', null, cb); - }); - - _rsvp.on('error', onerrorDefault); - - function onerrorDefault(reason) { - var error = errorFor(reason); - if (error) { - _emberMetal.dispatchError(error); - } - } - - function errorFor(reason) { - if (!reason) return; - - if (reason.errorThrown) { - return unwrapErrorThrown(reason); - } - - if (reason.name === 'UnrecognizedURLError') { - return; - } - - if (reason.name === 'TransitionAborted') { - return; - } - - return reason; - } - - function unwrapErrorThrown(reason) { - var error = reason.errorThrown; - if (typeof error === 'string') { - error = new Error(error); - } - Object.defineProperty(error, '__reason_with_error_thrown__', { - value: reason, - enumerable: false - }); - return error; - } - - exports.default = _rsvp; -}); -enifed('ember-runtime/ext/string', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { - /** - @module ember - @submodule ember-runtime - */ - - 'use strict'; - - var StringPrototype = String.prototype; - - if (_emberEnvironment.ENV.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]; - } - - return _emberRuntimeSystemString.fmt(this, args); - }; - - /** - See [Ember.String.w](/api/classes/Ember.String.html#method_w). - @method w - @for String - @private - */ - StringPrototype.w = function () { - return _emberRuntimeSystemString.w(this); - }; - - /** - See [Ember.String.loc](/api/classes/Ember.String.html#method_loc). - @method loc - @for String - @private - */ - StringPrototype.loc = function () { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - return _emberRuntimeSystemString.loc(this, args); - }; - - /** - See [Ember.String.camelize](/api/classes/Ember.String.html#method_camelize). - @method camelize - @for String - @private - */ - StringPrototype.camelize = function () { - return _emberRuntimeSystemString.camelize(this); - }; - - /** - See [Ember.String.decamelize](/api/classes/Ember.String.html#method_decamelize). - @method decamelize - @for String - @private - */ - StringPrototype.decamelize = function () { - return _emberRuntimeSystemString.decamelize(this); - }; - - /** - See [Ember.String.dasherize](/api/classes/Ember.String.html#method_dasherize). - @method dasherize - @for String - @private - */ - StringPrototype.dasherize = function () { - return _emberRuntimeSystemString.dasherize(this); - }; - - /** - See [Ember.String.underscore](/api/classes/Ember.String.html#method_underscore). - @method underscore - @for String - @private - */ - StringPrototype.underscore = function () { - return _emberRuntimeSystemString.underscore(this); - }; - - /** - See [Ember.String.classify](/api/classes/Ember.String.html#method_classify). - @method classify - @for String - @private - */ - StringPrototype.classify = function () { - return _emberRuntimeSystemString.classify(this); - }; - - /** - See [Ember.String.capitalize](/api/classes/Ember.String.html#method_capitalize). - @method capitalize - @for String - @private - */ - StringPrototype.capitalize = function () { - return _emberRuntimeSystemString.capitalize(this); - }; - } -}); -enifed('ember-runtime/index', ['exports', 'ember-runtime/ext/string', 'ember-runtime/ext/function', 'ember-runtime/system/object', 'ember-runtime/system/string', 'ember-runtime/mixins/registry_proxy', 'ember-runtime/mixins/container_proxy', 'ember-runtime/copy', 'ember-runtime/inject', 'ember-runtime/compare', 'ember-runtime/is-equal', 'ember-runtime/mixins/array', 'ember-runtime/mixins/comparable', 'ember-runtime/system/namespace', 'ember-runtime/system/array_proxy', 'ember-runtime/system/object_proxy', 'ember-runtime/system/core_object', 'ember-runtime/system/native_array', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/copyable', 'ember-runtime/mixins/enumerable', 'ember-runtime/mixins/freezable', 'ember-runtime/mixins/-proxy', 'ember-runtime/system/lazy_load', 'ember-runtime/mixins/observable', '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/computed_macros', 'ember-runtime/computed/reduce_computed_macros', 'ember-runtime/controllers/controller', 'ember-runtime/mixins/controller', 'ember-runtime/system/service', 'ember-runtime/ext/rsvp', 'ember-runtime/utils', 'ember-runtime/string_registry'], function (exports, _emberRuntimeExtString, _emberRuntimeExtFunction, _emberRuntimeSystemObject, _emberRuntimeSystemString, _emberRuntimeMixinsRegistry_proxy, _emberRuntimeMixinsContainer_proxy, _emberRuntimeCopy, _emberRuntimeInject, _emberRuntimeCompare, _emberRuntimeIsEqual, _emberRuntimeMixinsArray, _emberRuntimeMixinsComparable, _emberRuntimeSystemNamespace, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemObject_proxy, _emberRuntimeSystemCore_object, _emberRuntimeSystemNative_array, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsFreezable, _emberRuntimeMixinsProxy, _emberRuntimeSystemLazy_load, _emberRuntimeMixinsObservable, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsTarget_action_support, _emberRuntimeMixinsEvented, _emberRuntimeMixinsPromise_proxy, _emberRuntimeComputedComputed_macros, _emberRuntimeComputedReduce_computed_macros, _emberRuntimeControllersController, _emberRuntimeMixinsController, _emberRuntimeSystemService, _emberRuntimeExtRsvp, _emberRuntimeUtils, _emberRuntimeString_registry) { - /** - @module ember - @submodule ember-runtime - */ - - 'use strict'; - - exports.Object = _emberRuntimeSystemObject.default; - exports.FrameworkObject = _emberRuntimeSystemObject.FrameworkObject; - exports.String = _emberRuntimeSystemString.default; - exports.RegistryProxyMixin = _emberRuntimeMixinsRegistry_proxy.default; - exports.buildFakeRegistryWithDeprecations = _emberRuntimeMixinsRegistry_proxy.buildFakeRegistryWithDeprecations; - exports.ContainerProxyMixin = _emberRuntimeMixinsContainer_proxy.default; - exports.copy = _emberRuntimeCopy.default; - exports.inject = _emberRuntimeInject.default; - exports.compare = _emberRuntimeCompare.default; - exports.isEqual = _emberRuntimeIsEqual.default; - exports.Array = _emberRuntimeMixinsArray.default; - exports.objectAt = _emberRuntimeMixinsArray.objectAt; - exports.isEmberArray = _emberRuntimeMixinsArray.isEmberArray; - exports.addArrayObserver = _emberRuntimeMixinsArray.addArrayObserver; - exports.removeArrayObserver = _emberRuntimeMixinsArray.removeArrayObserver; - exports.Comparable = _emberRuntimeMixinsComparable.default; - exports.Namespace = _emberRuntimeSystemNamespace.default; - exports.isNamespaceSearchDisabled = _emberRuntimeSystemNamespace.isSearchDisabled; - exports.setNamespaceSearchDisabled = _emberRuntimeSystemNamespace.setSearchDisabled; - exports.ArrayProxy = _emberRuntimeSystemArray_proxy.default; - exports.ObjectProxy = _emberRuntimeSystemObject_proxy.default; - exports.CoreObject = _emberRuntimeSystemCore_object.default; - exports.NativeArray = _emberRuntimeSystemNative_array.default; - exports.A = _emberRuntimeSystemNative_array.A; - exports.ActionHandler = _emberRuntimeMixinsAction_handler.default; - exports.deprecateUnderscoreActions = _emberRuntimeMixinsAction_handler.deprecateUnderscoreActions; - exports.Copyable = _emberRuntimeMixinsCopyable.default; - exports.Enumerable = _emberRuntimeMixinsEnumerable.default; - exports.Freezable = _emberRuntimeMixinsFreezable.Freezable; - exports.FROZEN_ERROR = _emberRuntimeMixinsFreezable.FROZEN_ERROR; - exports._ProxyMixin = _emberRuntimeMixinsProxy.default; - exports.onLoad = _emberRuntimeSystemLazy_load.onLoad; - exports.runLoadHooks = _emberRuntimeSystemLazy_load.runLoadHooks; - exports._loaded = _emberRuntimeSystemLazy_load._loaded; - exports.Observable = _emberRuntimeMixinsObservable.default; - exports.MutableEnumerable = _emberRuntimeMixinsMutable_enumerable.default; - exports.MutableArray = _emberRuntimeMixinsMutable_array.default; - exports.removeAt = _emberRuntimeMixinsMutable_array.removeAt; - exports.TargetActionSupport = _emberRuntimeMixinsTarget_action_support.default; - exports.Evented = _emberRuntimeMixinsEvented.default; - exports.PromiseProxyMixin = _emberRuntimeMixinsPromise_proxy.default; - exports.empty = _emberRuntimeComputedComputed_macros.empty; - exports.notEmpty = _emberRuntimeComputedComputed_macros.notEmpty; - exports.none = _emberRuntimeComputedComputed_macros.none; - exports.not = _emberRuntimeComputedComputed_macros.not; - exports.bool = _emberRuntimeComputedComputed_macros.bool; - exports.match = _emberRuntimeComputedComputed_macros.match; - exports.equal = _emberRuntimeComputedComputed_macros.equal; - exports.gt = _emberRuntimeComputedComputed_macros.gt; - exports.gte = _emberRuntimeComputedComputed_macros.gte; - exports.lt = _emberRuntimeComputedComputed_macros.lt; - exports.lte = _emberRuntimeComputedComputed_macros.lte; - exports.oneWay = _emberRuntimeComputedComputed_macros.oneWay; - exports.readOnly = _emberRuntimeComputedComputed_macros.readOnly; - exports.deprecatingAlias = _emberRuntimeComputedComputed_macros.deprecatingAlias; - exports.and = _emberRuntimeComputedComputed_macros.and; - exports.or = _emberRuntimeComputedComputed_macros.or; - exports.sum = _emberRuntimeComputedReduce_computed_macros.sum; - exports.min = _emberRuntimeComputedReduce_computed_macros.min; - exports.max = _emberRuntimeComputedReduce_computed_macros.max; - exports.map = _emberRuntimeComputedReduce_computed_macros.map; - exports.sort = _emberRuntimeComputedReduce_computed_macros.sort; - exports.setDiff = _emberRuntimeComputedReduce_computed_macros.setDiff; - exports.mapBy = _emberRuntimeComputedReduce_computed_macros.mapBy; - exports.filter = _emberRuntimeComputedReduce_computed_macros.filter; - exports.filterBy = _emberRuntimeComputedReduce_computed_macros.filterBy; - exports.uniq = _emberRuntimeComputedReduce_computed_macros.uniq; - exports.uniqBy = _emberRuntimeComputedReduce_computed_macros.uniqBy; - exports.union = _emberRuntimeComputedReduce_computed_macros.union; - exports.intersect = _emberRuntimeComputedReduce_computed_macros.intersect; - exports.collect = _emberRuntimeComputedReduce_computed_macros.collect; - exports.Controller = _emberRuntimeControllersController.default; - exports.ControllerMixin = _emberRuntimeMixinsController.default; - exports.Service = _emberRuntimeSystemService.default; - exports.RSVP = _emberRuntimeExtRsvp.default; - exports.onerrorDefault = _emberRuntimeExtRsvp.onerrorDefault; - // just for side effect of extending Ember.RSVP - exports.isArray = _emberRuntimeUtils.isArray; - exports.typeOf = _emberRuntimeUtils.typeOf; - exports.getStrings = _emberRuntimeString_registry.getStrings; - exports.setStrings = _emberRuntimeString_registry.setStrings; -}); -// just for side effect of extending String.prototype -// just for side effect of extending Function.prototype -enifed('ember-runtime/inject', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; - - exports.default = inject; - exports.createInjectionHelper = createInjectionHelper; - exports.validatePropertyInjections = validatePropertyInjections; - - /** - Namespace for injection helper methods. - - @class inject - @namespace Ember - @static - @public - */ - - function inject() {} - - // Dictionary of injection validations by type, added to by `createInjectionHelper` - var typeValidators = {}; - - /** - This method allows other Ember modules to register injection helpers for a - given container type. Helpers are exported to the `inject` namespace as the - container type itself. - - @private - @method createInjectionHelper - @since 1.10.0 - @for Ember - @param {String} type The container type the helper will inject - @param {Function} validator A validation callback that is executed at mixin-time - */ - - function createInjectionHelper(type, validator) { - typeValidators[type] = validator; - - inject[type] = function (name) { - return new _emberMetal.InjectedProperty(type, name); - }; - } - - /** - Validation function that runs per-type validation functions once for each - injected type encountered. - - @private - @method validatePropertyInjections - @since 1.10.0 - @for Ember - @param {Object} factory The factory object - */ - - function validatePropertyInjections(factory) { - var proto = factory.proto(); - var types = []; - - for (var key in proto) { - var desc = proto[key]; - if (desc instanceof _emberMetal.InjectedProperty && types.indexOf(desc.type) === -1) { - types.push(desc.type); - } - } - - if (types.length) { - for (var i = 0; i < types.length; i++) { - var validator = typeValidators[types[i]]; - - if (typeof validator === 'function') { - validator(factory); - } - } - } - - return true; - } -}); -enifed('ember-runtime/is-equal', ['exports'], function (exports) { - /** - Compares two objects, returning true if they are equal. - - ```javascript - Ember.isEqual('hello', 'hello'); // true - Ember.isEqual(1, 2); // false - ``` - - `isEqual` is a more specific comparison than a triple equal comparison. - It will call the `isEqual` instance method on the objects being - compared, allowing finer control over when objects should be considered - equal to each other. - - ```javascript - let Person = Ember.Object.extend({ - isEqual(other) { return this.ssn == other.ssn; } - }); - - let personA = Person.create({name: 'Muhammad Ali', ssn: '123-45-6789'}); - let personB = Person.create({name: 'Cassius Clay', ssn: '123-45-6789'}); - - Ember.isEqual(personA, personB); // true - ``` - - Due to the expense of array comparisons, collections will never be equal to - each other even if each of their items are equal to each other. - - ```javascript - Ember.isEqual([4, 2], [4, 2]); // false - ``` - - @method isEqual - @for Ember - @param {Object} a first object to compare - @param {Object} b second object to compare - @return {Boolean} - @public - */ - 'use strict'; - - exports.default = isEqual; - - function isEqual(a, b) { - if (a && typeof a.isEqual === 'function') { - return a.isEqual(b); - } - - if (a instanceof Date && b instanceof Date) { - return a.getTime() === b.getTime(); - } - - return a === b; - } -}); -enifed('ember-runtime/mixins/-proxy', ['exports', 'glimmer-reference', 'ember-metal', 'ember-runtime/computed/computed_macros'], function (exports, _glimmerReference, _emberMetal, _emberRuntimeComputedComputed_macros) { - /** - @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 - _emberMetal.propertyWillChange(this, key); - } - - function contentPropertyDidChange(content, contentKey) { - var key = contentKey.slice(8); // remove "content." - if (key in this) { - return; - } // if shadowed in proxy - _emberMetal.propertyDidChange(this, key); - } - - var ProxyTag = (function (_CachedTag) { - babelHelpers.inherits(ProxyTag, _CachedTag); - - function ProxyTag(proxy) { - _CachedTag.call(this); - - var content = _emberMetal.get(proxy, 'content'); - - this.proxy = proxy; - this.proxyWrapperTag = new _glimmerReference.DirtyableTag(); - this.proxyContentTag = new _glimmerReference.UpdatableTag(_emberMetal.tagFor(content)); - } - - /** - `Ember.ProxyMixin` forwards all properties not defined by the proxy itself - to a proxied `content` object. See Ember.ObjectProxy for more details. - - @class ProxyMixin - @namespace Ember - @private - */ - - ProxyTag.prototype.compute = function compute() { - return Math.max(this.proxyWrapperTag.value(), this.proxyContentTag.value()); - }; - - ProxyTag.prototype.dirty = function dirty() { - this.proxyWrapperTag.dirty(); - }; - - ProxyTag.prototype.contentDidChange = function contentDidChange() { - var content = _emberMetal.get(this.proxy, 'content'); - this.proxyContentTag.update(_emberMetal.tagFor(content)); - }; - - return ProxyTag; - })(_glimmerReference.CachedTag); - - exports.default = _emberMetal.Mixin.create({ - /** - The object whose properties will be forwarded. - @property content - @type Ember.Object - @default null - @private - */ - content: null, - - init: function () { - this._super.apply(this, arguments); - _emberMetal.meta(this).setProxy(); - }, - - _initializeTag: _emberMetal.on('init', function () { - _emberMetal.meta(this)._tag = new ProxyTag(this); - }), - - _contentDidChange: _emberMetal.observer('content', function () { - _emberMetal.tagFor(this).contentDidChange(); - }), - - isTruthy: _emberRuntimeComputedComputed_macros.bool('content'), - - _debugContainerKey: null, - - willWatchProperty: function (key) { - var contentKey = 'content.' + key; - _emberMetal._addBeforeObserver(this, contentKey, null, contentPropertyWillChange); - _emberMetal.addObserver(this, contentKey, null, contentPropertyDidChange); - }, - - didUnwatchProperty: function (key) { - var contentKey = 'content.' + key; - _emberMetal._removeBeforeObserver(this, contentKey, null, contentPropertyWillChange); - _emberMetal.removeObserver(this, contentKey, null, contentPropertyDidChange); - }, - - unknownProperty: function (key) { - var content = _emberMetal.get(this, 'content'); - if (content) { - return _emberMetal.get(content, key); - } - }, - - setUnknownProperty: function (key, value) { - var m = _emberMetal.meta(this); - if (m.proto === this) { - // if marked as prototype then just defineProperty - // rather than delegate - _emberMetal.defineProperty(this, key, null, value); - return value; - } - - var content = _emberMetal.get(this, 'content'); - - return _emberMetal.set(content, key, value); - } - }); -}); -enifed('ember-runtime/mixins/action_handler', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-runtime - */ - - 'use strict'; - - exports.deprecateUnderscoreActions = deprecateUnderscoreActions; - - /** - `Ember.ActionHandler` is available on some familiar classes including - `Ember.Route`, `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.) - - @class ActionHandler - @namespace Ember - @private - */ - var ActionHandler = _emberMetal.Mixin.create({ - 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 - from within a template and the application's current route is this route. - Actions can also be invoked from other parts of your application - via `ActionHandler#send`. - The `actions` hash will inherit action handlers from - the `actions` hash defined on extended parent classes - or mixins rather than just replace the entire hash, e.g.: - ```js - App.CanDisplayBanner = Ember.Mixin.create({ - actions: { - displayBanner(msg) { - // ... - } - } - }); - App.WelcomeRoute = Ember.Route.extend(App.CanDisplayBanner, { - actions: { - playMusic() { - // ... - } - } - }); - // `WelcomeRoute`, when active, will be able to respond - // to both actions, since the actions hash is merged rather - // then replaced when extending mixins / parent classes. - this.send('displayBanner'); - this.send('playMusic'); - ``` - Within a Controller, Route or Component's action handler, - the value of the `this` context is the Controller, Route or - Component object: - ```js - App.SongRoute = Ember.Route.extend({ - actions: { - myAction() { - this.controllerFor("song"); - this.transitionTo("other.route"); - ... - } - } - }); - ``` - It is also possible to call `this._super(...arguments)` from within an - action handler if it overrides a handler defined on a parent - class or mixin: - Take for example the following routes: - ```js - App.DebugRoute = Ember.Mixin.create({ - actions: { - debugRouteInformation() { - console.debug("trololo"); - } - } - }); - App.AnnoyingDebugRoute = Ember.Route.extend(App.DebugRoute, { - actions: { - debugRouteInformation() { - // also call the debugRouteInformation of mixed in App.DebugRoute - this._super(...arguments); - // show additional annoyance - window.alert(...); - } - } - }); - ``` - ## Bubbling - By default, an action will stop bubbling once a handler defined - on the `actions` hash handles it. To continue bubbling the action, - you must return `true` from the handler: - ```js - App.Router.map(function() { - this.route("album", function() { - this.route("song"); - }); - }); - App.AlbumRoute = Ember.Route.extend({ - actions: { - startPlaying: function() { - } - } - }); - App.AlbumSongRoute = Ember.Route.extend({ - actions: { - startPlaying() { - // ... - if (actionShouldAlsoBeTriggeredOnParentRoute) { - return true; - } - } - } - }); - ``` - @property actions - @type Object - @default null - @public - */ - - /** - 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 - not be found in the `ActionHandler`'s `actions` hash or if the - action target function returns `true`. - Example - ```js - App.WelcomeRoute = Ember.Route.extend({ - actions: { - playTheme() { - this.send('playMusic', 'theme.mp3'); - }, - playMusic(track) { - // ... - } - } - }); - ``` - @method send - @param {String} actionName The action to trigger - @param {*} context a context to send with the action - @public - */ - send: function (actionName) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var target = undefined; - - if (this.actions && this.actions[actionName]) { - var shouldBubble = this.actions[actionName].apply(this, args) === true; - if (!shouldBubble) { - return; - } - } - - if (target = _emberMetal.get(this, 'target')) { - var _target; - - (_target = target).send.apply(_target, arguments); - } - }, - - willMergeMixin: function (props) { - - if (props._actions) { - - props.actions = props._actions; - delete props._actions; - } - } - }); - - exports.default = ActionHandler; - - function deprecateUnderscoreActions(factory) { - Object.defineProperty(factory.prototype, '_actions', { - configurable: true, - enumerable: false, - set: function (value) {}, - get: function () { - return _emberMetal.get(this, 'actions'); - } - }); - } -}); -enifed('ember-runtime/mixins/array', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/mixins/enumerable', 'ember-runtime/system/each_proxy'], function (exports, _emberUtils, _emberMetal, _emberRuntimeMixinsEnumerable, _emberRuntimeSystemEach_proxy) { - /** - @module ember - @submodule ember-runtime - */ - - // .......................................................... - // HELPERS - // - 'use strict'; - - var _Mixin$create; - - exports.addArrayObserver = addArrayObserver; - exports.removeArrayObserver = removeArrayObserver; - exports.objectAt = objectAt; - exports.arrayContentWillChange = arrayContentWillChange; - exports.arrayContentDidChange = arrayContentDidChange; - exports.isEmberArray = isEmberArray; - - function arrayObserversHelper(obj, target, opts, operation, notify) { - var willChange = opts && opts.willChange || 'arrayWillChange'; - var didChange = opts && opts.didChange || 'arrayDidChange'; - var hasObservers = _emberMetal.get(obj, 'hasArrayObservers'); - - if (hasObservers === notify) { - _emberMetal.propertyWillChange(obj, 'hasArrayObservers'); - } - - operation(obj, '@array:before', target, willChange); - operation(obj, '@array:change', target, didChange); - - if (hasObservers === notify) { - _emberMetal.propertyDidChange(obj, 'hasArrayObservers'); - } - - return obj; - } - - function addArrayObserver(array, target, opts) { - return arrayObserversHelper(array, target, opts, _emberMetal.addListener, false); - } - - function removeArrayObserver(array, target, opts) { - return arrayObserversHelper(array, target, opts, _emberMetal.removeListener, true); - } - - function objectAt(content, idx) { - if (content.objectAt) { - return content.objectAt(idx); - } - - return content[idx]; - } - - function arrayContentWillChange(array, startIdx, removeAmt, addAmt) { - var removing = undefined, - lim = undefined; - - // if no args are passed assume everything changes - if (startIdx === undefined) { - startIdx = 0; - removeAmt = addAmt = -1; - } else { - if (removeAmt === undefined) { - removeAmt = -1; - } - - if (addAmt === undefined) { - addAmt = -1; - } - } - - if (array.__each) { - array.__each.arrayWillChange(array, startIdx, removeAmt, addAmt); - } - - _emberMetal.sendEvent(array, '@array:before', [array, startIdx, removeAmt, addAmt]); - - if (startIdx >= 0 && removeAmt >= 0 && _emberMetal.get(array, 'hasEnumerableObservers')) { - removing = []; - lim = startIdx + removeAmt; - - for (var idx = startIdx; idx < lim; idx++) { - removing.push(objectAt(array, idx)); - } - } else { - removing = removeAmt; - } - - array.enumerableContentWillChange(removing, addAmt); - - return array; - } - - function arrayContentDidChange(array, startIdx, removeAmt, addAmt) { - // if no args are passed assume everything changes - if (startIdx === undefined) { - startIdx = 0; - removeAmt = addAmt = -1; - } else { - if (removeAmt === undefined) { - removeAmt = -1; - } - - if (addAmt === undefined) { - addAmt = -1; - } - } - - var adding = undefined; - if (startIdx >= 0 && addAmt >= 0 && _emberMetal.get(array, 'hasEnumerableObservers')) { - adding = []; - var lim = startIdx + addAmt; - - for (var idx = startIdx; idx < lim; idx++) { - adding.push(objectAt(array, idx)); - } - } else { - adding = addAmt; - } - - array.enumerableContentDidChange(removeAmt, adding); - - if (array.__each) { - array.__each.arrayDidChange(array, startIdx, removeAmt, addAmt); - } - - _emberMetal.sendEvent(array, '@array:change', [array, startIdx, removeAmt, addAmt]); - - var meta = _emberMetal.peekMeta(array); - var cache = meta && meta.readableCache(); - - if (cache) { - if (cache.firstObject !== undefined && objectAt(array, 0) !== _emberMetal.cacheFor.get(cache, 'firstObject')) { - _emberMetal.propertyWillChange(array, 'firstObject'); - _emberMetal.propertyDidChange(array, 'firstObject'); - } - if (cache.lastObject !== undefined && objectAt(array, _emberMetal.get(array, 'length') - 1) !== _emberMetal.cacheFor.get(cache, 'lastObject')) { - _emberMetal.propertyWillChange(array, 'lastObject'); - _emberMetal.propertyDidChange(array, 'lastObject'); - } - } - return array; - } - - var EMBER_ARRAY = _emberUtils.symbol('EMBER_ARRAY'); - - function isEmberArray(obj) { - return obj && !!obj[EMBER_ARRAY]; - } - - // .......................................................... - // ARRAY - // - /** - This mixin implements Observer-friendly Array-like behavior. It is not a - concrete implementation, but it can be used up by other classes that want - to appear like arrays. - - For example, ArrayProxy is a concrete classes that can - be instantiated to implement array-like behavior. Both of these classes use - the Array Mixin by way of the MutableArray mixin, which allows observable - changes to be made to the underlying array. - - Unlike `Ember.Enumerable,` this mixin defines methods specifically for - collections that provide index-ordered access to their contents. When you - are designing code that needs to accept any kind of Array-like object, you - should use these methods instead of Array primitives because these will - properly notify observers of changes to the array. - - Although these methods are efficient, they do add a layer of indirection to - your application so it is a good idea to use them only when you need the - flexibility of using both true JavaScript arrays and "virtual" arrays such - as controllers and collections. - - You can use the methods defined in this module to access and modify array - contents in a KVO-friendly way. You can also be notified whenever the - membership of an array changes by using `.observes('myArray.[]')`. - - To support `Ember.Array` in your own class, you must override two - primitives to use it: `length()` and `objectAt()`. - - Note that the Ember.Array mixin also incorporates the `Ember.Enumerable` - mixin. All `Ember.Array`-like objects are also enumerable. - - @class Array - @namespace Ember - @uses Ember.Enumerable - @since Ember 0.9.0 - @public - */ - var ArrayMixin = _emberMetal.Mixin.create(_emberRuntimeMixinsEnumerable.default, (_Mixin$create = {}, _Mixin$create[EMBER_ARRAY] = true, _Mixin$create.length = null, _Mixin$create.objectAt = function (idx) { - if (idx < 0 || idx >= _emberMetal.get(this, 'length')) { - return undefined; - } - - return _emberMetal.get(this, idx); - }, _Mixin$create.objectsAt = function (indexes) { - var _this = this; - - return indexes.map(function (idx) { - return objectAt(_this, idx); - }); - }, _Mixin$create.nextObject = function (idx) { - return objectAt(this, idx); - }, _Mixin$create['[]'] = _emberMetal.computed({ - get: function (key) { - return this; - }, - set: function (key, value) { - this.replace(0, _emberMetal.get(this, 'length'), value); - return this; - } - }), _Mixin$create.firstObject = _emberMetal.computed(function () { - return objectAt(this, 0); - }).readOnly(), _Mixin$create.lastObject = _emberMetal.computed(function () { - return objectAt(this, _emberMetal.get(this, 'length') - 1); - }).readOnly(), _Mixin$create.contains = function (obj) { - if (true) {} - - return this.indexOf(obj) >= 0; - }, _Mixin$create.slice = function (beginIndex, endIndex) { - var ret = _emberMetal.default.A(); - var length = _emberMetal.get(this, 'length'); - - if (_emberMetal.isNone(beginIndex)) { - beginIndex = 0; - } - - if (_emberMetal.isNone(endIndex) || endIndex > length) { - endIndex = length; - } - - if (beginIndex < 0) { - beginIndex = length + beginIndex; - } - - if (endIndex < 0) { - endIndex = length + endIndex; - } - - while (beginIndex < endIndex) { - ret[ret.length] = objectAt(this, beginIndex++); - } - - return ret; - }, _Mixin$create.indexOf = function (object, startAt) { - var len = _emberMetal.get(this, 'length'); - - if (startAt === undefined) { - startAt = 0; - } - - if (startAt < 0) { - startAt += len; - } - - for (var idx = startAt; idx < len; idx++) { - if (objectAt(this, idx) === object) { - return idx; - } - } - - return -1; - }, _Mixin$create.lastIndexOf = function (object, startAt) { - var len = _emberMetal.get(this, 'length'); - - if (startAt === undefined || startAt >= len) { - startAt = len - 1; - } - - if (startAt < 0) { - startAt += len; - } - - for (var idx = startAt; idx >= 0; idx--) { - if (objectAt(this, idx) === object) { - return idx; - } - } - - return -1; - }, _Mixin$create.addArrayObserver = function (target, opts) { - return addArrayObserver(this, target, opts); - }, _Mixin$create.removeArrayObserver = function (target, opts) { - return removeArrayObserver(this, target, opts); - }, _Mixin$create.hasArrayObservers = _emberMetal.computed(function () { - return _emberMetal.hasListeners(this, '@array:change') || _emberMetal.hasListeners(this, '@array:before'); - }), _Mixin$create.arrayContentWillChange = function (startIdx, removeAmt, addAmt) { - return arrayContentWillChange(this, startIdx, removeAmt, addAmt); - }, _Mixin$create.arrayContentDidChange = function (startIdx, removeAmt, addAmt) { - return arrayContentDidChange(this, startIdx, removeAmt, addAmt); - }, _Mixin$create['@each'] = _emberMetal.computed(function () { - // TODO use Symbol or add to meta - if (!this.__each) { - this.__each = new _emberRuntimeSystemEach_proxy.default(this); - } - - return this.__each; - }).volatile().readOnly(), _Mixin$create)); - - if (true) { - 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 = _emberMetal.get(this, 'length'); - - if (startAt === undefined) { - startAt = 0; - } - - if (startAt < 0) { - startAt += len; - } - - for (var idx = startAt; idx < len; idx++) { - var 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 - -/** - __Required.__ You must implement this method to apply this mixin. - Your array must support the `length` property. Your replace methods should - set this property whenever it changes. - @property {Number} length - @public -*/ - -/** - Returns the object at the given `index`. If the given `index` is negative - or is greater or equal than the array length, returns `undefined`. - This is one of the primitives you must implement to support `Ember.Array`. - If your object supports retrieving the value of an array item using `get()` - (i.e. `myArray.get(0)`), then you do not need to implement this method - yourself. - ```javascript - let arr = ['a', 'b', 'c', 'd']; - arr.objectAt(0); // 'a' - arr.objectAt(3); // 'd' - arr.objectAt(-1); // undefined - arr.objectAt(4); // undefined - arr.objectAt(5); // undefined - ``` - @method objectAt - @param {Number} idx The index of the item to return. - @return {*} item at index or undefined - @public -*/ - -/** - This returns the objects at the specified indexes, using `objectAt`. - ```javascript - let arr = ['a', 'b', 'c', 'd']; - arr.objectsAt([0, 1, 2]); // ['a', 'b', 'c'] - arr.objectsAt([2, 3, 4]); // ['c', 'd', undefined] - ``` - @method objectsAt - @param {Array} indexes An array of indexes of items to return. - @return {Array} - @public - */ - -// overrides Ember.Enumerable version - -/** - This is the handler for the special array content property. If you get - this property, it will return this. If you set this property to a new - array, it will replace the current content. - This property overrides the default property defined in `Ember.Enumerable`. - @property [] - @return this - @public -*/ - -// optimized version from Enumerable - -// Add any extra methods to Ember.Array that are native to the built-in Array. -/** - Returns a new array that is a slice of the receiver. This implementation - uses the observable array methods to retrieve the objects for the new - slice. - ```javascript - let arr = ['red', 'green', 'blue']; - arr.slice(0); // ['red', 'green', 'blue'] - arr.slice(0, 2); // ['red', 'green'] - arr.slice(1, 100); // ['green', 'blue'] - ``` - @method slice - @param {Number} beginIndex (Optional) index to begin slicing from. - @param {Number} endIndex (Optional) index to end the slice at (but not included). - @return {Array} New array with specified slice - @public -*/ - -/** - Returns the index of the given object's first occurrence. - If no `startAt` argument is given, the starting location to - search is 0. If it's negative, will count backward from - the end of the array. Returns -1 if no match is found. - ```javascript - let arr = ['a', 'b', 'c', 'd', 'a']; - arr.indexOf('a'); // 0 - arr.indexOf('z'); // -1 - arr.indexOf('a', 2); // 4 - arr.indexOf('a', -1); // 4 - arr.indexOf('b', 3); // -1 - arr.indexOf('a', 100); // -1 - ``` - @method indexOf - @param {Object} object the item to search for - @param {Number} startAt optional starting location to search, default 0 - @return {Number} index or -1 if not found - @public -*/ - -/** - Returns the index of the given object's last occurrence. - If no `startAt` argument is given, the search starts from - the last position. If it's negative, will count backward - from the end of the array. Returns -1 if no match is found. - ```javascript - let arr = ['a', 'b', 'c', 'd', 'a']; - arr.lastIndexOf('a'); // 4 - arr.lastIndexOf('z'); // -1 - arr.lastIndexOf('a', 2); // 0 - arr.lastIndexOf('a', -1); // 4 - arr.lastIndexOf('b', 3); // 1 - arr.lastIndexOf('a', 100); // 4 - ``` - @method lastIndexOf - @param {Object} object the item to search for - @param {Number} startAt optional starting location to search, default 0 - @return {Number} index or -1 if not found - @public -*/ - -// .......................................................... -// ARRAY OBSERVERS -// - -/** - Adds an array observer to the receiving array. The array observer object - normally must implement two methods: - * `arrayWillChange(observedObj, start, removeCount, addCount)` - This method will be - called just before the array is modified. - * `arrayDidChange(observedObj, start, removeCount, addCount)` - This method will be - called just after the array is modified. - Both callbacks will be passed the observed object, starting index of the - change as well as a count of the items to be removed and added. You can use - these callbacks to optionally inspect the array during the change, clear - caches, or do any other bookkeeping necessary. - In addition to passing a target, you can also include an options hash - which you can use to override the method names that will be invoked on the - target. - @method addArrayObserver - @param {Object} target The observer object. - @param {Object} opts Optional hash of configuration options including - `willChange` and `didChange` option. - @return {Ember.Array} receiver - @public -*/ - -/** - Removes an array observer from the object if the observer is current - registered. Calling this method multiple times with the same object will - have no effect. - @method removeArrayObserver - @param {Object} target The object observing the array. - @param {Object} opts Optional hash of configuration options including - `willChange` and `didChange` option. - @return {Ember.Array} receiver - @public -*/ - -/** - Becomes true whenever the array currently has observers watching changes - on the array. - @property {Boolean} hasArrayObservers - @public -*/ - -/** - If you are implementing an object that supports `Ember.Array`, call this - method just before the array content changes to notify any observers and - invalidate any related properties. Pass the starting index of the change - as well as a delta of the amounts to change. - @method arrayContentWillChange - @param {Number} startIdx The starting index in the array that will change. - @param {Number} removeAmt The number of items that will be removed. If you - pass `null` assumes 0 - @param {Number} addAmt The number of items that will be added. If you - pass `null` assumes 0. - @return {Ember.Array} receiver - @public -*/ - -/** - If you are implementing an object that supports `Ember.Array`, call this - method just after the array content changes to notify any observers and - invalidate any related properties. Pass the starting index of the change - as well as a delta of the amounts to change. - @method arrayContentDidChange - @param {Number} startIdx The starting index in the array that did change. - @param {Number} removeAmt The number of items that were removed. If you - pass `null` assumes 0 - @param {Number} addAmt The number of items that were added. If you - pass `null` assumes 0. - @return {Ember.Array} receiver - @public -*/ - -/** - Returns a special object that can be used to observe individual properties - on the array. Just get an equivalent property on this object and it will - return an enumerable that maps automatically to the named key on the - member objects. - `@each` should only be used in a non-terminal context. Example: - ```javascript - myMethod: computed('posts.@each.author', function(){ - ... - }); - ``` - If you merely want to watch for the array being changed, like an object being - replaced, added or removed, use `[]` instead of `@each`. - ```javascript - myMethod: computed('posts.[]', function(){ - ... - }); - ``` - @property @each - @public -*/ -enifed('ember-runtime/mixins/comparable', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; - - /** - @module ember - @submodule ember-runtime - */ - - /** - Implements some standard methods for comparing objects. Add this mixin to - any class you create that can compare its instances. - - You should implement the `compare()` method. - - @class Comparable - @namespace Ember - @since Ember 0.9 - @private - */ - exports.default = _emberMetal.Mixin.create({ - - /** - __Required.__ You must implement this method to apply this mixin. - Override to return the result of the comparison of the two parameters. The - compare method should return: - - `-1` if `a < b` - - `0` if `a == b` - - `1` if `a > b` - Default implementation raises an exception. - @method compare - @param a {Object} the first object to compare - @param b {Object} the second object to compare - @return {Number} the result of the comparison - @private - */ - compare: null - }); -}); -enifed('ember-runtime/mixins/container_proxy', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-runtime - */ - 'use strict'; - - /** - ContainerProxyMixin is used to provide public access to specific - container functionality. - - @class ContainerProxyMixin - @private - */ - exports.default = _emberMetal.Mixin.create({ - /** - The container stores state. - @private - @property {Ember.Container} __container__ - */ - __container__: null, - - /** - Returns an object that can be used to provide an owner to a - manually created instance. - Example: - ``` - let owner = Ember.getOwner(this); - User.create( - owner.ownerInjection(), - { username: 'rwjblue' } - ) - ``` - @public - @method ownerInjection - @return {Object} - */ - ownerInjection: function () { - return this.__container__.ownerInjection(); - }, - - /** - Given a fullName return a corresponding instance. - The default behaviour is for lookup to return a singleton instance. - The singleton is scoped to the container, allowing multiple containers - to all have their own locally scoped singletons. - ```javascript - let registry = new Registry(); - let container = registry.container(); - registry.register('api:twitter', Twitter); - let twitter = container.lookup('api:twitter'); - twitter instanceof Twitter; // => true - // by default the container will return singletons - let twitter2 = container.lookup('api:twitter'); - twitter2 instanceof Twitter; // => true - twitter === twitter2; //=> true - ``` - If singletons are not wanted an optional flag can be provided at lookup. - ```javascript - let registry = new Registry(); - let container = registry.container(); - registry.register('api:twitter', Twitter); - let twitter = container.lookup('api:twitter', { singleton: false }); - let twitter2 = container.lookup('api:twitter', { singleton: false }); - twitter === twitter2; //=> false - ``` - @public - @method lookup - @param {String} fullName - @param {Object} options - @return {any} - */ - lookup: function (fullName, options) { - return this.__container__.lookup(fullName, options); - }, - - /** - Given a fullName return the corresponding factory. - @private - @method _lookupFactory - @param {String} fullName - @return {any} - */ - _lookupFactory: function (fullName, options) { - return this.__container__.lookupFactory(fullName, options); - }, - - /** - Given a name and a source path, resolve the fullName - @private - @method _resolveLocalLookupName - @param {String} fullName - @param {String} source - @return {String} - */ - _resolveLocalLookupName: function (name, source) { - return this.__container__.registry.expandLocalLookup('component:' + name, { - source: source - }); - }, - - /** - @private - */ - willDestroy: function () { - this._super.apply(this, arguments); - - if (this.__container__) { - _emberMetal.run(this.__container__, 'destroy'); - } - } - }); -}); -enifed('ember-runtime/mixins/controller', ['exports', 'ember-metal', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/controller_content_model_alias_deprecation'], function (exports, _emberMetal, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsController_content_model_alias_deprecation) { - 'use strict'; - - /** - @class ControllerMixin - @namespace Ember - @uses Ember.ActionHandler - @private - */ - exports.default = _emberMetal.Mixin.create(_emberRuntimeMixinsAction_handler.default, _emberRuntimeMixinsController_content_model_alias_deprecation.default, { - /* ducktype as a controller */ - isController: true, - - /** - The object to which actions from the view should be sent. - For example, when a Handlebars template uses the `{{action}}` helper, - it will attempt to send the action to the view's controller's `target`. - By default, the value of the target property is set to the router, and - is injected when a controller is instantiated. This injection is applied - as part of the application's initialization process. In most cases the - `target` property will automatically be set to the logical consumer of - actions for the controller. - @property target - @default null - @public - */ - target: null, - - store: null, - - /** - The controller's current model. When retrieving or modifying a controller's - model, this property should be used instead of the `content` property. - @property model - @public - */ - model: null, - - /** - @private - */ - content: _emberMetal.alias('model') - - }); -}); -enifed('ember-runtime/mixins/controller_content_model_alias_deprecation', ['exports', 'ember-metal'], function (exports, _emberMetal) { - '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`). - - Ember versions prior to 1.7 used `model` as an alias of `content`, but due to - much confusion this alias was reversed (so `content` is now an alias of `model). - - This change reduces many caveats with model/content, and also sets a - simple ground rule: Never set a controllers content, rather always set - its model and ember will do the right thing. - - Used internally by Ember in `Ember.Controller`. - */ - exports.default = _emberMetal.Mixin.create({ - /** - @private - Moves `content` to `model` at extend time if a `model` 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) { - // Calling super is only OK here since we KNOW that - // there is another Mixin loaded first. - this._super.apply(this, arguments); - - var modelSpecified = !!props.model; - - if (props.content && !modelSpecified) { - props.model = props.content; - delete props['content']; - } - } - }); -}); -enifed('ember-runtime/mixins/copyable', ['exports', 'ember-metal', 'ember-runtime/mixins/freezable'], function (exports, _emberMetal, _emberRuntimeMixinsFreezable) { - /** - @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. - - You should generally implement the `copy()` method to return a copy of the - receiver. - - Note that `frozenCopy()` will only work if you also implement - `Ember.Freezable`. - - @class Copyable - @namespace Ember - @since Ember 0.9 - @private - */ - exports.default = _emberMetal.Mixin.create({ - /** - __Required.__ You must implement this method to apply this mixin. - Override to return a copy of the receiver. Default implementation raises - an exception. - @method copy - @param {Boolean} deep if `true`, a deep copy of the object should be made - @return {Object} copy of receiver - @private - */ - copy: null, - - /** - If the object implements `Ember.Freezable`, then this will return a new - copy if the object is not frozen and the receiver if the object is frozen. - Raises an exception if you try to call this method on a object that does - not support freezing. - You should use this method whenever you want a copy of a freezable object - since a freezable object can simply return itself without actually - consuming more memory. - @method frozenCopy - @return {Object} copy of receiver or receiver - @deprecated Use `Object.freeze` instead. - @private - */ - frozenCopy: function () { - if (_emberRuntimeMixinsFreezable.Freezable && _emberRuntimeMixinsFreezable.Freezable.detect(this)) { - return _emberMetal.get(this, 'isFrozen') ? this : this.copy().freeze(); - } else { - throw new _emberMetal.Error(this + ' does not support freezing'); - } - } - }); -}); -enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/compare', 'require'], function (exports, _emberUtils, _emberMetal, _emberRuntimeCompare, _require) { - /** - @module ember - @submodule ember-runtime - */ - - // .......................................................... - // HELPERS - // - - 'use strict'; - - var _emberA = undefined; - - function emberA() { - return (_emberA || (_emberA = _require.default('ember-runtime/system/native_array').A))(); - } - - var contexts = []; - - function popCtx() { - return contexts.length === 0 ? {} : contexts.pop(); - } - - function pushCtx(ctx) { - contexts.push(ctx); - return null; - } - - function iter(key, value) { - var valueProvided = arguments.length === 2; - - function i(item) { - var cur = _emberMetal.get(item, key); - return valueProvided ? value === cur : !!cur; - } - - return i; - } - - /** - This mixin defines the common interface implemented by enumerable objects - in Ember. Most of these methods follow the standard Array iteration - API defined up to JavaScript 1.8 (excluding language-specific features that - cannot be emulated in older versions of JavaScript). - - This mixin is applied automatically to the Array class on page load, so you - can use any of these methods on simple arrays. If Array already implements - one of these methods, the mixin will not override them. - - ## Writing Your Own Enumerable - - To make your own custom class enumerable, you need two items: - - 1. You must have a length property. This property should change whenever - the number of items in your enumerable object changes. If you use this - with an `Ember.Object` subclass, you should be sure to change the length - property using `set().` - - 2. You must implement `nextObject().` See documentation. - - Once you have these two methods implemented, apply the `Ember.Enumerable` mixin - to your class and you will be able to enumerate the contents of your object - like any other collection. - - ## Using Ember Enumeration with Other Libraries - - Many other libraries provide some kind of iterator or enumeration like - facility. This is often where the most common API conflicts occur. - Ember's API is designed to be as friendly as possible with other - libraries by implementing only methods that mostly correspond to the - JavaScript 1.8 API. - - @class Enumerable - @namespace Ember - @since Ember 0.9 - @private - */ - var Enumerable = _emberMetal.Mixin.create({ - - /** - __Required.__ You must implement this method to apply this mixin. - Implement this method to make your class enumerable. - This method will be called repeatedly during enumeration. The index value - will always begin with 0 and increment monotonically. You don't have to - rely on the index value to determine what object to return, but you should - always check the value and start from the beginning when you see the - requested index is 0. - The `previousObject` is the object that was returned from the last call - to `nextObject` for the current iteration. This is a useful way to - manage iteration if you are tracing a linked list, for example. - Finally the context parameter will always contain a hash you can use as - a "scratchpad" to maintain any other state you need in order to iterate - properly. The context object is reused and is not reset between - iterations so make sure you setup the context with a fresh state whenever - the index parameter is 0. - Generally iterators will continue to call `nextObject` until the index - reaches the current length-1. If you run out of data before this - time for some reason, you should simply return undefined. - The default implementation of this method simply looks up the index. - This works great on any Array-like objects. - @method nextObject - @param {Number} index the current index of the iteration - @param {Object} previousObject the value returned by the last call to - `nextObject`. - @param {Object} context a context object you can use to maintain state. - @return {Object} the next object in the iteration or undefined - @private - */ - nextObject: null, - - /** - Helper method returns the first object from a collection. This is usually - used by bindings and other parts of the framework to extract a single - object if the enumerable contains only one item. - If you override this method, you should implement it so that it will - always return the same value each time it is called. If your enumerable - contains only one object, this method should always return that object. - If your enumerable is empty, this method should return `undefined`. - ```javascript - let arr = ['a', 'b', 'c']; - arr.get('firstObject'); // 'a' - let arr = []; - arr.get('firstObject'); // undefined - ``` - @property firstObject - @return {Object} the object or undefined - @readOnly - @public - */ - firstObject: _emberMetal.computed('[]', function () { - if (_emberMetal.get(this, 'length') === 0) { - return undefined; - } - - // handle generic enumerables - var context = popCtx(); - var ret = this.nextObject(0, null, context); - - pushCtx(context); - - return ret; - }).readOnly(), - - /** - Helper method returns the last object from a collection. If your enumerable - contains only one object, this method should always return that object. - If your enumerable is empty, this method should return `undefined`. - ```javascript - let arr = ['a', 'b', 'c']; - arr.get('lastObject'); // 'c' - let arr = []; - arr.get('lastObject'); // undefined - ``` - @property lastObject - @return {Object} the last object or undefined - @readOnly - @public - */ - lastObject: _emberMetal.computed('[]', function () { - var len = _emberMetal.get(this, 'length'); - - if (len === 0) { - return undefined; - } - - var context = popCtx(); - var idx = 0; - var last = null; - var cur = undefined; - - do { - last = cur; - cur = this.nextObject(idx++, last, context); - } while (cur !== undefined); - - pushCtx(context); - - return last; - }).readOnly(), - - /** - Returns `true` if the passed object can be found in the receiver. The - default version will iterate through the enumerable until the object - is found. You may want to override this with a more efficient version. - ```javascript - let arr = ['a', 'b', 'c']; - arr.contains('a'); // true - arr.contains('z'); // false - ``` - @method contains - @deprecated Use `Enumerable#includes` instead. See http://emberjs.com/deprecations/v2.x#toc_enumerable-contains - @param {Object} obj The object to search for. - @return {Boolean} `true` if object is found in enumerable. - @public - */ - contains: function (obj) { - if (true) {} - - var found = this.find(function (item) { - return item === obj; - }); - - return found !== undefined; - }, - - /** - Iterates through the enumerable, calling the passed function on each - item. This method corresponds to the `forEach()` method defined in - JavaScript 1.6. - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(item, index, enumerable); - ``` - - `item` is the current item in the iteration. - - `index` is the current index in the iteration. - - `enumerable` is the enumerable object itself. - Note that in addition to a callback, you can also pass an optional target - object that will be set as `this` on the context. This is a good way - 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 - @public - */ - forEach: function (callback, target) { - if (typeof callback !== 'function') { - throw new TypeError(); - } - - var context = popCtx(); - var len = _emberMetal.get(this, 'length'); - var last = null; - - if (target === undefined) { - target = null; - } - - for (var idx = 0; idx < len; idx++) { - var next = this.nextObject(idx, last, context); - callback.call(target, next, idx, this); - last = next; - } - - last = null; - context = pushCtx(context); - - return this; - }, - - /** - Alias for `mapBy` - @method getEach - @param {String} key name of the property - @return {Array} The mapped array. - @public - */ - getEach: _emberMetal.aliasMethod('mapBy'), - - /** - Sets the value on the named property for each member. This is more - ergonomic than using other methods defined on this helper. If the object - implements Ember.Observable, the value will be changed to `set(),` otherwise - it will be set directly. `null` objects are skipped. - @method setEach - @param {String} key The key to set - @param {Object} value The object to set - @return {Object} receiver - @public - */ - setEach: function (key, value) { - return this.forEach(function (item) { - return _emberMetal.set(item, key, value); - }); - }, - - /** - Maps all of the items in the enumeration to another value, returning - a new array. This method corresponds to `map()` defined in JavaScript 1.6. - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(item, index, enumerable); - ``` - - `item` is the current item in the iteration. - - `index` is the current index in the iteration. - - `enumerable` is the enumerable object itself. - It should return the mapped value. - Note that in addition to a callback, you can also pass an optional target - object that will be set as `this` on the context. This is a good way - to give your iterator function access to the current object. - @method map - @param {Function} callback The callback to execute - @param {Object} [target] The target object to use - @return {Array} The mapped array. - @public - */ - map: function (callback, target) { - var ret = emberA(); - - this.forEach(function (x, idx, i) { - return ret[idx] = callback.call(target, x, idx, i); - }); - - return ret; - }, - - /** - Similar to map, this specialized function returns the value of the named - property on all items in the enumeration. - @method mapBy - @param {String} key name of the property - @return {Array} The mapped array. - @public - */ - mapBy: function (key) { - return this.map(function (next) { - return _emberMetal.get(next, key); - }); - }, - - /** - Returns an array with all of the items in the enumeration that the passed - function returns true for. This method corresponds to `filter()` defined in - JavaScript 1.6. - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(item, index, enumerable); - ``` - - `item` is the current item in the iteration. - - `index` is the current index in the iteration. - - `enumerable` is the enumerable object itself. - It should return `true` to include the item in the results, `false` - otherwise. - Note that in addition to a callback, you can also pass an optional target - object that will be set as `this` on the context. This is a good way - to give your iterator function access to the current object. - @method filter - @param {Function} callback The callback to execute - @param {Object} [target] The target object to use - @return {Array} A filtered array. - @public - */ - filter: function (callback, target) { - var ret = emberA(); - - this.forEach(function (x, idx, i) { - if (callback.call(target, x, idx, i)) { - ret.push(x); - } - }); - - return ret; - }, - - /** - Returns an array with all of the items in the enumeration where the passed - function returns false. This method is the inverse of filter(). - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(item, index, enumerable); - ``` - - *item* is the current item in the iteration. - - *index* is the current index in the iteration - - *enumerable* is the enumerable object itself. - It should return a falsey value to include the item in the results. - Note that in addition to a callback, you can also pass an optional target - object that will be set as "this" on the context. This is a good way - to give your iterator function access to the current object. - @method reject - @param {Function} callback The callback to execute - @param {Object} [target] The target object to use - @return {Array} A rejected array. - @public - */ - reject: function (callback, target) { - return this.filter(function () { - return !callback.apply(target, arguments); - }); - }, - - /** - Returns an array with just the items with the matched property. You - can pass an optional second argument with the target value. Otherwise - this will match any property that evaluates to `true`. - @method filterBy - @param {String} key the property to test - @param {*} [value] optional value to test against. - @return {Array} filtered array - @public - */ - filterBy: function (key, value) { - return this.filter(iter.apply(this, arguments)); - }, - - /** - Returns an array with the items that do not have truthy values for - key. You can pass an optional second argument with the target value. Otherwise - this will match any property that evaluates to false. - @method rejectBy - @param {String} key the property to test - @param {String} [value] optional value to test against. - @return {Array} rejected array - @public - */ - rejectBy: function (key, value) { - var exactValue = function (item) { - return _emberMetal.get(item, key) === value; - }; - var hasValue = function (item) { - return !!_emberMetal.get(item, key); - }; - var use = arguments.length === 2 ? exactValue : hasValue; - - return this.reject(use); - }, - - /** - Returns the first item in the array for which the callback returns true. - This method works similar to the `filter()` method defined in JavaScript 1.6 - except that it will stop working on the array once a match is found. - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(item, index, enumerable); - ``` - - `item` is the current item in the iteration. - - `index` is the current index in the iteration. - - `enumerable` is the enumerable object itself. - It should return the `true` to include the item in the results, `false` - otherwise. - Note that in addition to a callback, you can also pass an optional target - object that will be set as `this` on the context. This is a good way - to give your iterator function access to the current object. - @method find - @param {Function} callback The callback to execute - @param {Object} [target] The target object to use - @return {Object} Found item or `undefined`. - @public - */ - find: function (callback, target) { - var len = _emberMetal.get(this, 'length'); - - if (target === undefined) { - target = null; - } - - var context = popCtx(); - var found = false; - var last = null; - var next = undefined, - ret = undefined; - - for (var idx = 0; idx < len && !found; idx++) { - next = this.nextObject(idx, last, context); - - if (found = callback.call(target, next, idx, this)) { - ret = next; - } - - last = next; - } - - next = last = null; - context = pushCtx(context); - - return ret; - }, - - /** - Returns the first item with a property matching the passed value. You - can pass an optional second argument with the target value. Otherwise - this will match any property that evaluates to `true`. - This method works much like the more generic `find()` method. - @method findBy - @param {String} key the property to test - @param {String} [value] optional value to test against. - @return {Object} found item or `undefined` - @public - */ - findBy: function (key, value) { - return this.find(iter.apply(this, arguments)); - }, - - /** - Returns `true` if the passed function returns true for every item in the - enumeration. This corresponds with the `every()` method in JavaScript 1.6. - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(item, index, enumerable); - ``` - - `item` is the current item in the iteration. - - `index` is the current index in the iteration. - - `enumerable` is the enumerable object itself. - It should return the `true` or `false`. - Note that in addition to a callback, you can also pass an optional target - object that will be set as `this` on the context. This is a good way - to give your iterator function access to the current object. - Example Usage: - ```javascript - if (people.every(isEngineer)) { - Paychecks.addBigBonus(); - } - ``` - @method every - @param {Function} callback The callback to execute - @param {Object} [target] The target object to use - @return {Boolean} - @public - */ - every: function (callback, target) { - return !this.find(function (x, idx, i) { - return !callback.call(target, x, idx, i); - }); - }, - - /** - Returns `true` if the passed property resolves to the value of the second - argument for all items in the enumerable. This method is often simpler/faster - than using a callback. - @method isEvery - @param {String} key the property to test - @param {String} [value] optional value to test against. Defaults to `true` - @return {Boolean} - @since 1.3.0 - @public - */ - isEvery: function (key, value) { - return this.every(iter.apply(this, arguments)); - }, - - /** - Returns `true` if the passed function returns true for any item in the - enumeration. This corresponds with the `some()` method in JavaScript 1.6. - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(item, index, enumerable); - ``` - - `item` is the current item in the iteration. - - `index` is the current index in the iteration. - - `enumerable` is the enumerable object itself. - It should return the `true` to include the item in the results, `false` - otherwise. - Note that in addition to a callback, you can also pass an optional target - object that will be set as `this` on the context. This is a good way - to give your iterator function access to the current object. - Usage Example: - ```javascript - if (people.any(isManager)) { - Paychecks.addBiggerBonus(); - } - ``` - @method any - @param {Function} callback The callback to execute - @param {Object} [target] The target object to use - @return {Boolean} `true` if the passed function returns `true` for any item - @public - */ - any: function (callback, target) { - var len = _emberMetal.get(this, 'length'); - var context = popCtx(); - var found = false; - var last = null; - var next = undefined; - - if (target === undefined) { - target = null; - } - - for (var idx = 0; idx < len && !found; idx++) { - next = this.nextObject(idx, last, context); - found = callback.call(target, next, idx, this); - last = next; - } - - next = last = null; - context = pushCtx(context); - return found; - }, - - /** - Returns `true` if the passed property resolves to the value of the second - argument for any item in the enumerable. This method is often simpler/faster - than using a callback. - @method isAny - @param {String} key the property to test - @param {String} [value] optional value to test against. Defaults to `true` - @return {Boolean} - @since 1.3.0 - @public - */ - isAny: function (key, value) { - return this.any(iter.apply(this, arguments)); - }, - - /** - This will combine the values of the enumerator into a single value. It - is a useful way to collect a summary value from an enumeration. This - corresponds to the `reduce()` method defined in JavaScript 1.8. - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(previousValue, item, index, enumerable); - ``` - - `previousValue` is the value returned by the last call to the iterator. - - `item` is the current item in the iteration. - - `index` is the current index in the iteration. - - `enumerable` is the enumerable object itself. - Return the new cumulative value. - In addition to the callback you can also pass an `initialValue`. An error - will be raised if you do not pass an initial value and the enumerator is - empty. - Note that unlike the other methods, this method does not allow you to - pass a target object to set as this for the callback. It's part of the - spec. Sorry. - @method reduce - @param {Function} callback The callback to execute - @param {Object} initialValue Initial value for the reduce - @param {String} reducerProperty internal use only. - @return {Object} The reduced value. - @public - */ - reduce: function (callback, initialValue, reducerProperty) { - if (typeof callback !== 'function') { - throw new TypeError(); - } - - var ret = initialValue; - - this.forEach(function (item, i) { - ret = callback(ret, item, i, this, reducerProperty); - }, this); - - return ret; - }, - - /** - Invokes the named method on every object in the receiver that - implements it. This method corresponds to the implementation in - Prototype 1.6. - @method invoke - @param {String} methodName the name of the method - @param {Object...} args optional arguments to pass as well. - @return {Array} return values from calling invoke. - @public - */ - invoke: function (methodName) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var ret = emberA(); - - this.forEach(function (x, idx) { - var method = x && x[methodName]; - - if ('function' === typeof method) { - ret[idx] = args ? method.apply(x, args) : x[methodName](); - } - }, this); - - return ret; - }, - - /** - Simply converts the enumerable into a genuine array. The order is not - guaranteed. Corresponds to the method implemented by Prototype. - @method toArray - @return {Array} the enumerable as an array. - @public - */ - toArray: function () { - var ret = emberA(); - - this.forEach(function (o, idx) { - return ret[idx] = o; - }); - - return ret; - }, - - /** - Returns a copy of the array with all `null` and `undefined` elements removed. - ```javascript - let arr = ['a', null, 'c', undefined]; - arr.compact(); // ['a', 'c'] - ``` - @method compact - @return {Array} the array without null and undefined elements. - @public - */ - compact: function () { - return this.filter(function (value) { - return value != null; - }); - }, - - /** - Returns a new enumerable that excludes the passed value. The default - implementation returns an array regardless of the receiver type. - If the receiver does not contain the value it returns the original enumerable. - ```javascript - let arr = ['a', 'b', 'a', 'c']; - arr.without('a'); // ['b', 'c'] - ``` - @method without - @param {Object} value - @return {Ember.Enumerable} - @public - */ - without: function (value) { - if (!this.contains(value)) { - return this; // nothing to do - } - - var ret = emberA(); - - this.forEach(function (k) { - if (k !== value) { - ret[ret.length] = k; - } - }); - - return ret; - }, - - /** - Returns a new enumerable that contains only unique values. The default - implementation returns an array regardless of the receiver type. - ```javascript - let arr = ['a', 'a', 'b', 'b']; - arr.uniq(); // ['a', 'b'] - ``` - This only works on primitive data types, e.g. Strings, Numbers, etc. - @method uniq - @return {Ember.Enumerable} - @public - */ - uniq: function () { - var ret = emberA(); - - this.forEach(function (k) { - if (ret.indexOf(k) < 0) { - ret.push(k); - } - }); - - return ret; - }, - - /** - This property will trigger anytime the enumerable's content changes. - You can observe this property to be notified of changes to the enumerable's - content. - For plain enumerables, this property is read only. `Array` overrides - this method. - @property [] - @type Array - @return this - @private - */ - '[]': _emberMetal.computed({ - get: function (key) { - return this; - } - }), - - // .......................................................... - // ENUMERABLE OBSERVERS - // - - /** - Registers an enumerable observer. Must implement `Ember.EnumerableObserver` - mixin. - @method addEnumerableObserver - @param {Object} target - @param {Object} [opts] - @return this - @private - */ - addEnumerableObserver: function (target, opts) { - var willChange = opts && opts.willChange || 'enumerableWillChange'; - var didChange = opts && opts.didChange || 'enumerableDidChange'; - var hasObservers = _emberMetal.get(this, 'hasEnumerableObservers'); - - if (!hasObservers) { - _emberMetal.propertyWillChange(this, 'hasEnumerableObservers'); - } - - _emberMetal.addListener(this, '@enumerable:before', target, willChange); - _emberMetal.addListener(this, '@enumerable:change', target, didChange); - - if (!hasObservers) { - _emberMetal.propertyDidChange(this, 'hasEnumerableObservers'); - } - - return this; - }, - - /** - Removes a registered enumerable observer. - @method removeEnumerableObserver - @param {Object} target - @param {Object} [opts] - @return this - @private - */ - removeEnumerableObserver: function (target, opts) { - var willChange = opts && opts.willChange || 'enumerableWillChange'; - var didChange = opts && opts.didChange || 'enumerableDidChange'; - var hasObservers = _emberMetal.get(this, 'hasEnumerableObservers'); - - if (hasObservers) { - _emberMetal.propertyWillChange(this, 'hasEnumerableObservers'); - } - - _emberMetal.removeListener(this, '@enumerable:before', target, willChange); - _emberMetal.removeListener(this, '@enumerable:change', target, didChange); - - if (hasObservers) { - _emberMetal.propertyDidChange(this, 'hasEnumerableObservers'); - } - - return this; - }, - - /** - Becomes true whenever the array currently has observers watching changes - on the array. - @property hasEnumerableObservers - @type Boolean - @private - */ - hasEnumerableObservers: _emberMetal.computed(function () { - return _emberMetal.hasListeners(this, '@enumerable:change') || _emberMetal.hasListeners(this, '@enumerable:before'); - }), - - /** - Invoke this method just before the contents of your enumerable will - change. You can either omit the parameters completely or pass the objects - to be removed or added if available or just a count. - @method enumerableContentWillChange - @param {Ember.Enumerable|Number} removing An enumerable of the objects to - be removed or the number of items to be removed. - @param {Ember.Enumerable|Number} adding An enumerable of the objects to be - added or the number of items to be added. - @chainable - @private - */ - enumerableContentWillChange: function (removing, adding) { - var removeCnt = undefined, - addCnt = undefined, - hasDelta = undefined; - - if ('number' === typeof removing) { - removeCnt = removing; - } else if (removing) { - removeCnt = _emberMetal.get(removing, 'length'); - } else { - removeCnt = removing = -1; - } - - if ('number' === typeof adding) { - addCnt = adding; - } else if (adding) { - addCnt = _emberMetal.get(adding, 'length'); - } else { - addCnt = adding = -1; - } - - hasDelta = addCnt < 0 || removeCnt < 0 || addCnt - removeCnt !== 0; - - if (removing === -1) { - removing = null; - } - - if (adding === -1) { - adding = null; - } - - _emberMetal.propertyWillChange(this, '[]'); - - if (hasDelta) { - _emberMetal.propertyWillChange(this, 'length'); - } - - _emberMetal.sendEvent(this, '@enumerable:before', [this, removing, adding]); - - return this; - }, - - /** - Invoke this method when the contents of your enumerable has changed. - This will notify any observers watching for content changes. If you are - implementing an ordered enumerable (such as an array), also pass the - start and end values where the content changed so that it can be used to - notify range observers. - @method enumerableContentDidChange - @param {Ember.Enumerable|Number} removing An enumerable of the objects to - be removed or the number of items to be removed. - @param {Ember.Enumerable|Number} adding An enumerable of the objects to - be added or the number of items to be added. - @chainable - @private - */ - enumerableContentDidChange: function (removing, adding) { - var removeCnt = undefined, - addCnt = undefined, - hasDelta = undefined; - - if ('number' === typeof removing) { - removeCnt = removing; - } else if (removing) { - removeCnt = _emberMetal.get(removing, 'length'); - } else { - removeCnt = removing = -1; - } - - if ('number' === typeof adding) { - addCnt = adding; - } else if (adding) { - addCnt = _emberMetal.get(adding, 'length'); - } else { - addCnt = adding = -1; - } - - hasDelta = addCnt < 0 || removeCnt < 0 || addCnt - removeCnt !== 0; - - if (removing === -1) { - removing = null; - } - - if (adding === -1) { - adding = null; - } - - _emberMetal.sendEvent(this, '@enumerable:change', [this, removing, adding]); - - if (hasDelta) { - _emberMetal.propertyDidChange(this, 'length'); - } - - _emberMetal.propertyDidChange(this, '[]'); - - return this; - }, - - /** - Converts the enumerable into an array and sorts by the keys - specified in the argument. - 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 - @public - */ - sortBy: function () { - var sortKeys = arguments; - - return this.toArray().sort(function (a, b) { - for (var i = 0; i < sortKeys.length; i++) { - var key = sortKeys[i]; - var propA = _emberMetal.get(a, key); - var propB = _emberMetal.get(b, key); - // return 1 or -1 else continue to the next sortKey - var compareValue = _emberRuntimeCompare.default(propA, propB); - - if (compareValue) { - return compareValue; - } - } - return 0; - }); - } - }); - - 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 - let 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 _emberUtils.EmptyObject(); - - this.forEach(function (item) { - var guid = _emberUtils.guidFor(_emberMetal.get(item, key)); - if (!(guid in seen)) { - seen[guid] = true; - ret.push(item); - } - }); - - return ret; - } - }); - } - - if (true) { - 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 = _emberMetal.get(this, 'length'); - var idx = undefined, - next = undefined; - 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; - } - - next = last = null; - context = pushCtx(context); - - return found; - }, - - 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'], function (exports, _emberMetal) { - 'use strict'; - - /** - @module ember - @submodule ember-runtime - */ - - /** - This mixin allows for Ember objects to subscribe to and emit events. - - ```javascript - App.Person = Ember.Object.extend(Ember.Evented, { - greet: function() { - // ... - this.trigger('greet'); - } - }); - - var person = App.Person.create(); - - person.on('greet', function() { - console.log('Our person has greeted'); - }); - - person.greet(); - - // outputs: 'Our person has greeted' - ``` - - You can also chain multiple event subscriptions: - - ```javascript - person.on('greet', function() { - console.log('Our person has greeted'); - }).one('greet', function() { - console.log('Offer one-time special'); - }).off('event', this, forgetThis); - ``` - - @class Evented - @namespace Ember - @public - */ - exports.default = _emberMetal.Mixin.create({ - - /** - Subscribes to a named event with given function. - ```javascript - person.on('didLoad', function() { - // fired once the person has loaded - }); - ``` - An optional target can be passed in as the 2nd argument that will - be set as the "this" for the callback. This is a good way to give your - function access to the object triggering the event. When the target - parameter is used the callback becomes the third argument. - @method on - @param {String} name The name of the event - @param {Object} [target] The "this" binding for the callback - @param {Function} method The callback to execute - @return this - @public - */ - on: function (name, target, method) { - _emberMetal.addListener(this, name, target, method); - return this; - }, - - /** - Subscribes a function to a named event and then cancels the subscription - after the first time the event is triggered. It is good to use ``one`` when - you only care about the first time an event has taken place. - This function takes an optional 2nd argument that will become the "this" - value for the callback. If this argument is passed then the 3rd argument - becomes the function. - @method one - @param {String} name The name of the event - @param {Object} [target] The "this" binding for the callback - @param {Function} method The callback to execute - @return this - @public - */ - one: function (name, target, method) { - if (!method) { - method = target; - target = null; - } - - _emberMetal.addListener(this, name, target, method, true); - return this; - }, - - /** - Triggers a named event for the object. Any additional arguments - will be passed as parameters to the functions that are subscribed to the - event. - ```javascript - person.on('didEat', function(food) { - console.log('person ate some ' + food); - }); - person.trigger('didEat', 'broccoli'); - // outputs: person ate some broccoli - ``` - @method trigger - @param {String} name The name of the event - @param {Object...} args Optional arguments to pass on - @public - */ - trigger: function (name) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - _emberMetal.sendEvent(this, name, args); - }, - - /** - Cancels subscription for given name, target, and method. - @method off - @param {String} name The name of the event - @param {Object} target The target of the subscription - @param {Function} method The function of the subscription - @return this - @public - */ - off: function (name, target, method) { - _emberMetal.removeListener(this, name, target, method); - return this; - }, - - /** - Checks to see if object has any subscriptions for named event. - @method has - @param {String} name The name of the event - @return {Boolean} does the object have a subscription for event - @public - */ - has: function (name) { - return _emberMetal.hasListeners(this, name); - } - }); -}); -enifed('ember-runtime/mixins/freezable', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @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. - - ## Enforcement - - To fully support freezing in your subclass, you must include this mixin and - override any method that might alter any property on the object to instead - raise an exception. You can check the state of an object by checking the - `isFrozen` property. - - Although future versions of JavaScript may support language-level freezing - object objects, that is not the case today. Even if an object is freezable, - it is still technically possible to modify the object, even though it could - break other parts of your application that do not expect a frozen object to - change. It is, therefore, very important that you always respect the - `isFrozen` property on all freezable objects. - - ## Example Usage - - The example below shows a simple object that implement the `Ember.Freezable` - protocol. - - ```javascript - Contact = Ember.Object.extend(Ember.Freezable, { - firstName: null, - lastName: null, - - // swaps the names - swapNames: function() { - if (this.get('isFrozen')) throw Ember.FROZEN_ERROR; - var tmp = this.get('firstName'); - this.set('firstName', this.get('lastName')); - this.set('lastName', tmp); - return this; - } - - }); - - c = Contact.create({ firstName: "John", lastName: "Doe" }); - c.swapNames(); // returns c - c.freeze(); - c.swapNames(); // EXCEPTION - ``` - - ## Copying - - Usually the `Ember.Freezable` protocol is implemented in cooperation with the - `Ember.Copyable` protocol, which defines a `frozenCopy()` method that will - return a frozen object, if the object implements this method as well. - - @class Freezable - @namespace Ember - @since Ember 0.9 - @deprecated Use `Object.freeze` instead. - @private - */ - var Freezable = _emberMetal.Mixin.create({ - - init: function () { - this._super.apply(this, arguments); - }, - - /** - Set to `true` when the object is frozen. Use this property to detect - whether your object is frozen or not. - @property isFrozen - @type Boolean - @private - */ - isFrozen: false, - - /** - Freezes the object. Once this method has been called the object should - no longer allow any properties to be edited. - @method freeze - @return {Object} receiver - @private - */ - freeze: function () { - if (_emberMetal.get(this, 'isFrozen')) { - return this; - } - - _emberMetal.set(this, 'isFrozen', true); - return this; - } - - }); - - exports.Freezable = Freezable; - var FROZEN_ERROR = 'Frozen object cannot be modified.'; - exports.FROZEN_ERROR = FROZEN_ERROR; -}); -enifed('ember-runtime/mixins/mutable_array', ['exports', 'ember-metal', 'ember-runtime/mixins/array', 'ember-runtime/mixins/mutable_enumerable', 'ember-runtime/mixins/enumerable'], function (exports, _emberMetal, _emberRuntimeMixinsArray, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeMixinsEnumerable) { - /** - @module ember - @submodule ember-runtime - */ - - 'use strict'; - - exports.removeAt = removeAt; - var OUT_OF_RANGE_EXCEPTION = 'Index out of range'; - var EMPTY = []; - - // .......................................................... - // HELPERS - // - - function removeAt(array, start, len) { - if ('number' === typeof start) { - if (start < 0 || start >= _emberMetal.get(array, 'length')) { - throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); - } - - // fast case - if (len === undefined) { - len = 1; - } - - array.replace(start, len, EMPTY); - } - - return array; - } - - /** - 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. - - It is important to use the methods in this class to modify arrays so that - changes are observable. This allows the binding system in Ember to function - correctly. - - - Note that an Array can change even if it does not implement this mixin. - For example, one might implement a SparseArray that cannot be directly - modified, but if its underlying enumerable changes, it will change also. - - @class MutableArray - @namespace Ember - @uses Ember.Array - @uses Ember.MutableEnumerable - @public - */ - exports.default = _emberMetal.Mixin.create(_emberRuntimeMixinsArray.default, _emberRuntimeMixinsMutable_enumerable.default, { - - /** - __Required.__ You must implement this method to apply this mixin. - This is one of the primitives you must implement to support `Ember.Array`. - You should replace amt objects started at idx with the objects in the - passed array. You should also call `this.enumerableContentDidChange()` - @method replace - @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* - @public - */ - replace: null, - - /** - Remove all elements from the array. This is useful if you - want to reuse an existing array without having to recreate it. - ```javascript - let colors = ['red', 'green', 'blue']; - color.length(); // 3 - colors.clear(); // [] - colors.length(); // 0 - ``` - @method clear - @return {Ember.Array} An empty Array. - @public - */ - clear: function () { - var len = _emberMetal.get(this, 'length'); - if (len === 0) { - return this; - } - - this.replace(0, len, EMPTY); - return this; - }, - - /** - This will use the primitive `replace()` method to insert an object at the - specified index. - ```javascript - let colors = ['red', 'green', 'blue']; - colors.insertAt(2, 'yellow'); // ['red', 'green', 'yellow', 'blue'] - colors.insertAt(5, 'orange'); // Error: Index out of range - ``` - @method insertAt - @param {Number} idx index of insert the object at. - @param {Object} object object to insert - @return {Ember.Array} receiver - @public - */ - insertAt: function (idx, object) { - if (idx > _emberMetal.get(this, 'length')) { - throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); - } - - this.replace(idx, 0, [object]); - return this; - }, - - /** - Remove an object at the specified index using the `replace()` primitive - method. You can pass either a single index, or a start and a length. - If you pass a start and length that is beyond the - length this method will throw an `OUT_OF_RANGE_EXCEPTION`. - ```javascript - let colors = ['red', 'green', 'blue', 'yellow', 'orange']; - colors.removeAt(0); // ['green', 'blue', 'yellow', 'orange'] - colors.removeAt(2, 2); // ['green', 'blue'] - colors.removeAt(4, 2); // Error: Index out of range - ``` - @method removeAt - @param {Number} start index, start of range - @param {Number} len length of passing range - @return {Ember.Array} receiver - @public - */ - removeAt: function (start, len) { - return removeAt(this, start, len); - }, - - /** - Push the object onto the end of the array. Works just like `push()` but it - is KVO-compliant. - ```javascript - let colors = ['red', 'green']; - colors.pushObject('black'); // ['red', 'green', 'black'] - colors.pushObject(['yellow']); // ['red', 'green', ['yellow']] - ``` - @method pushObject - @param {*} obj object to push - @return object same object passed as a param - @public - */ - pushObject: function (obj) { - this.insertAt(_emberMetal.get(this, 'length'), obj); - return obj; - }, - - /** - Add the objects in the passed numerable to the end of the array. Defers - notifying observers of the change until all objects are added. - ```javascript - let colors = ['red']; - colors.pushObjects(['yellow', 'orange']); // ['red', 'yellow', 'orange'] - ``` - @method pushObjects - @param {Ember.Enumerable} objects the objects to add - @return {Ember.Array} receiver - @public - */ - pushObjects: function (objects) { - if (!(_emberRuntimeMixinsEnumerable.default.detect(objects) || Array.isArray(objects))) { - throw new TypeError('Must pass Ember.Enumerable to Ember.MutableArray#pushObjects'); - } - this.replace(_emberMetal.get(this, 'length'), 0, objects); - return this; - }, - - /** - Pop object from array or nil if none are left. Works just like `pop()` but - it is KVO-compliant. - ```javascript - let colors = ['red', 'green', 'blue']; - colors.popObject(); // 'blue' - console.log(colors); // ['red', 'green'] - ``` - @method popObject - @return object - @public - */ - popObject: function () { - var len = _emberMetal.get(this, 'length'); - if (len === 0) { - return null; - } - - var ret = _emberRuntimeMixinsArray.objectAt(this, len - 1); - this.removeAt(len - 1, 1); - return ret; - }, - - /** - Shift an object from start of array or nil if none are left. Works just - like `shift()` but it is KVO-compliant. - ```javascript - let colors = ['red', 'green', 'blue']; - colors.shiftObject(); // 'red' - console.log(colors); // ['green', 'blue'] - ``` - @method shiftObject - @return object - @public - */ - shiftObject: function () { - if (_emberMetal.get(this, 'length') === 0) { - return null; - } - - var ret = _emberRuntimeMixinsArray.objectAt(this, 0); - this.removeAt(0); - return ret; - }, - - /** - Unshift an object to start of array. Works just like `unshift()` but it is - KVO-compliant. - ```javascript - let colors = ['red']; - colors.unshiftObject('yellow'); // ['yellow', 'red'] - colors.unshiftObject(['black']); // [['black'], 'yellow', 'red'] - ``` - @method unshiftObject - @param {*} obj object to unshift - @return object same object passed as a param - @public - */ - unshiftObject: function (obj) { - this.insertAt(0, obj); - return obj; - }, - - /** - Adds the named objects to the beginning of the array. Defers notifying - observers until all objects have been added. - ```javascript - let colors = ['red']; - colors.unshiftObjects(['black', 'white']); // ['black', 'white', 'red'] - colors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function - ``` - @method unshiftObjects - @param {Ember.Enumerable} objects the objects to add - @return {Ember.Array} receiver - @public - */ - unshiftObjects: function (objects) { - this.replace(0, 0, objects); - return this; - }, - - /** - Reverse objects in the array. Works just like `reverse()` but it is - KVO-compliant. - @method reverseObjects - @return {Ember.Array} receiver - @public - */ - reverseObjects: function () { - var len = _emberMetal.get(this, 'length'); - if (len === 0) { - return this; - } - - var objects = this.toArray().reverse(); - this.replace(0, len, objects); - return this; - }, - - /** - Replace all the receiver's content with content of the argument. - If argument is an empty array receiver will be cleared. - ```javascript - let colors = ['red', 'green', 'blue']; - colors.setObjects(['black', 'white']); // ['black', 'white'] - colors.setObjects([]); // [] - ``` - @method setObjects - @param {Ember.Array} objects array whose content will be used for replacing - the content of the receiver - @return {Ember.Array} receiver with the new content - @public - */ - setObjects: function (objects) { - if (objects.length === 0) { - return this.clear(); - } - - var len = _emberMetal.get(this, 'length'); - this.replace(0, len, objects); - return this; - }, - - // .......................................................... - // IMPLEMENT Ember.MutableEnumerable - // - - /** - Remove all occurrences of an object in the array. - ```javascript - let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago']; - cities.removeObject('Chicago'); // ['Berlin', 'Lima'] - cities.removeObject('Lima'); // ['Berlin'] - cities.removeObject('Tokyo') // ['Berlin'] - ``` - @method removeObject - @param {*} obj object to remove - @return {Ember.Array} receiver - @public - */ - removeObject: function (obj) { - var loc = _emberMetal.get(this, 'length') || 0; - while (--loc >= 0) { - var curObject = _emberRuntimeMixinsArray.objectAt(this, loc); - - if (curObject === obj) { - this.removeAt(loc); - } - } - return this; - }, - - /** - Push the object onto the end of the array if it is not already - present in the array. - ```javascript - let cities = ['Chicago', 'Berlin']; - cities.addObject('Lima'); // ['Chicago', 'Berlin', 'Lima'] - cities.addObject('Berlin'); // ['Chicago', 'Berlin', 'Lima'] - ``` - @method addObject - @param {*} obj object to add, if not already present - @return {Ember.Array} receiver - @public - */ - addObject: function (obj) { - var included = undefined; - - if (true) { - included = this.includes(obj); - } else { - included = this.contains(obj); - } - - if (!included) { - this.pushObject(obj); - } - - return this; - } - }); -}); -enifed('ember-runtime/mixins/mutable_enumerable', ['exports', 'ember-runtime/mixins/enumerable', 'ember-metal'], function (exports, _emberRuntimeMixinsEnumerable, _emberMetal) { - 'use strict'; - - /** - @module ember - @submodule ember-runtime - */ - - /** - This mixin defines the API for modifying generic enumerables. These methods - can be applied to an object regardless of whether it is ordered or - unordered. - - Note that an Enumerable can change even if it does not implement this mixin. - For example, a MappedEnumerable cannot be directly modified but if its - underlying enumerable changes, it will change also. - - ## Adding Objects - - To add an object to an enumerable, use the `addObject()` method. This - method will only add the object to the enumerable if the object is not - already present and is of a type supported by the enumerable. - - ```javascript - set.addObject(contact); - ``` - - ## Removing Objects - - To remove an object from an enumerable, use the `removeObject()` method. This - will only remove the object if it is present in the enumerable, otherwise - this method has no effect. - - ```javascript - set.removeObject(contact); - ``` - - ## Implementing In Your Own Code - - If you are implementing an object and want to support this API, just include - this mixin in your class and implement the required methods. In your unit - tests, be sure to apply the Ember.MutableEnumerableTests to your object. - - @class MutableEnumerable - @namespace Ember - @uses Ember.Enumerable - @public - */ - exports.default = _emberMetal.Mixin.create(_emberRuntimeMixinsEnumerable.default, { - - /** - __Required.__ You must implement this method to apply this mixin. - Attempts to add the passed object to the receiver if the object is not - already present in the collection. If the object is present, this method - has no effect. - If the passed object is of a type not supported by the receiver, - then this method should raise an exception. - @method addObject - @param {Object} object The object to add to the enumerable. - @return {Object} the passed object - @public - */ - addObject: null, - - /** - Adds each object in the passed enumerable to the receiver. - @method addObjects - @param {Ember.Enumerable} objects the objects to add. - @return {Object} receiver - @public - */ - addObjects: function (objects) { - var _this = this; - - _emberMetal.beginPropertyChanges(this); - objects.forEach(function (obj) { - return _this.addObject(obj); - }); - _emberMetal.endPropertyChanges(this); - return this; - }, - - /** - __Required.__ You must implement this method to apply this mixin. - Attempts to remove the passed object from the receiver collection if the - object is present in the collection. If the object is not present, - this method has no effect. - If the passed object is of a type not supported by the receiver, - then this method should raise an exception. - @method removeObject - @param {Object} object The object to remove from the enumerable. - @return {Object} the passed object - @public - */ - removeObject: null, - - /** - Removes each object in the passed enumerable from the receiver. - @method removeObjects - @param {Ember.Enumerable} objects the objects to remove - @return {Object} receiver - @public - */ - removeObjects: function (objects) { - _emberMetal.beginPropertyChanges(this); - for (var i = objects.length - 1; i >= 0; i--) { - this.removeObject(objects[i]); - } - _emberMetal.endPropertyChanges(this); - return this; - } - }); -}); -enifed('ember-runtime/mixins/observable', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-runtime - */ - - 'use strict'; - - /** - ## Overview - - This mixin provides properties and property observing functionality, core - features of the Ember object model. - - Properties and observers allow one object to observe changes to a - property on another object. This is one of the fundamental ways that - models, controllers and views communicate with each other in an Ember - application. - - Any object that has this mixin applied can be used in observer - operations. That includes `Ember.Object` and most objects you will - interact with as you write your Ember application. - - Note that you will not generally apply this mixin to classes yourself, - but you will use the features provided by this module frequently, so it - is important to understand how to use it. - - ## Using `get()` and `set()` - - Because of Ember's support for bindings and observers, you will always - access properties using the get method, and set properties using the - set method. This allows the observing objects to be notified and - computed properties to be handled properly. - - More documentation about `get` and `set` are below. - - ## Observing Property Changes - - You typically observe property changes simply by using the `Ember.observer` - function in classes that you write. - - For example: - - ```javascript - Ember.Object.extend({ - valueObserver: Ember.observer('value', function(sender, key, value, rev) { - // Executes whenever the "value" property changes - // See the addObserver method for more information about the callback arguments - }) - }); - ``` - - Although this is the most common way to add an observer, this capability - is actually built into the `Ember.Object` class on top of two methods - defined in this mixin: `addObserver` and `removeObserver`. You can use - these two methods to add and remove observers yourself if you need to - do so at runtime. - - To add an observer for a property, call: - - ```javascript - object.addObserver('propertyKey', targetObject, targetAction) - ``` - - This will call the `targetAction` method on the `targetObject` whenever - the value of the `propertyKey` changes. - - Note that if `propertyKey` is a computed property, the observer will be - called when any of the property dependencies are changed, even if the - resulting value of the computed property is unchanged. This is necessary - because computed properties are not computed until `get` is called. - - @class Observable - @namespace Ember - @public - */ - exports.default = _emberMetal.Mixin.create({ - - /** - Retrieves the value of a property from the object. - This method is usually similar to using `object[keyName]` or `object.keyName`, - however it supports both computed properties and the unknownProperty - handler. - Because `get` unifies the syntax for accessing all these kinds - of properties, it can make many refactorings easier, such as replacing a - simple property with a computed property, or vice versa. - ### Computed Properties - Computed properties are methods defined with the `property` modifier - declared at the end, such as: - ```javascript - fullName: Ember.computed('firstName', 'lastName', function() { - return this.get('firstName') + ' ' + this.get('lastName'); - }) - ``` - When you call `get` on a computed property, the function will be - called and the return value will be returned instead of the function - itself. - ### Unknown Properties - Likewise, if you try to call `get` on a property whose value is - `undefined`, the `unknownProperty()` method will be called on the object. - If this method returns any value other than `undefined`, it will be returned - instead. This allows you to implement "virtual" properties that are - not defined upfront. - @method get - @param {String} keyName The property to retrieve - @return {Object} The property value or undefined. - @public - */ - get: function (keyName) { - return _emberMetal.get(this, keyName); - }, - - /** - To get the values of multiple properties at once, call `getProperties` - with a list of strings or an array: - ```javascript - record.getProperties('firstName', 'lastName', 'zipCode'); - // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } - ``` - is equivalent to: - ```javascript - record.getProperties(['firstName', 'lastName', 'zipCode']); - // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } - ``` - @method getProperties - @param {String...|Array} list of keys to get - @return {Object} - @public - */ - getProperties: function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _emberMetal.getProperties.apply(null, [this].concat(args)); - }, - - /** - Sets the provided key or path to the value. - ```javascript - record.set("key", value); - ``` - This method is generally very similar to calling `object["key"] = value` or - `object.key = value`, except that it provides support for computed - properties, the `setUnknownProperty()` method and property observers. - ### Computed Properties - If you try to set a value on a key that has a computed property handler - defined (see the `get()` method for an example), then `set()` will call - that method, passing both the value and key instead of simply changing - the value itself. This is useful for those times when you need to - implement a property that is composed of one or more member - properties. - ### Unknown Properties - If you try to set a value on a key that is undefined in the target - object, then the `setUnknownProperty()` handler will be called instead. This - gives you an opportunity to implement complex "virtual" properties that - are not predefined on the object. If `setUnknownProperty()` returns - undefined, then `set()` will simply set the value on the object. - ### Property Observers - In addition to changing the property, `set()` will also register a property - change with the object. Unless you have placed this call inside of a - `beginPropertyChanges()` and `endPropertyChanges(),` any "local" observers - (i.e. observer methods declared on the same object), will be called - immediately. Any "remote" observers (i.e. observer methods declared on - another object) will be placed in a queue and called at a later time in a - coalesced manner. - @method set - @param {String} keyName The property to set - @param {Object} value The value to set or `null`. - @return {Object} The passed value - @public - */ - set: function (keyName, value) { - return _emberMetal.set(this, keyName, value); - }, - - /** - Sets a list of properties at once. These properties are set inside - a single `beginPropertyChanges` and `endPropertyChanges` batch, so - observers will be buffered. - ```javascript - record.setProperties({ firstName: 'Charles', lastName: 'Jolley' }); - ``` - @method setProperties - @param {Object} hash the hash of keys and values to set - @return {Object} The passed in hash - @public - */ - setProperties: function (hash) { - return _emberMetal.setProperties(this, hash); - }, - - /** - Begins a grouping of property changes. - You can use this method to group property changes so that notifications - will not be sent until the changes are finished. If you plan to make a - large number of changes to an object at one time, you should call this - method at the beginning of the changes to begin deferring change - notifications. When you are done making changes, call - `endPropertyChanges()` to deliver the deferred change notifications and end - deferring. - @method beginPropertyChanges - @return {Ember.Observable} - @private - */ - beginPropertyChanges: function () { - _emberMetal.beginPropertyChanges(); - return this; - }, - - /** - Ends a grouping of property changes. - You can use this method to group property changes so that notifications - will not be sent until the changes are finished. If you plan to make a - large number of changes to an object at one time, you should call - `beginPropertyChanges()` at the beginning of the changes to defer change - notifications. When you are done making changes, call this method to - deliver the deferred change notifications and end deferring. - @method endPropertyChanges - @return {Ember.Observable} - @private - */ - endPropertyChanges: function () { - _emberMetal.endPropertyChanges(); - return this; - }, - - /** - Notify the observer system that a property is about to change. - Sometimes you need to change a value directly or indirectly without - actually calling `get()` or `set()` on it. In this case, you can use this - method and `propertyDidChange()` instead. Calling these two methods - together will notify all observers that the property has potentially - changed value. - Note that you must always call `propertyWillChange` and `propertyDidChange` - as a pair. If you do not, it may get the property change groups out of - order and cause notifications to be delivered more often than you would - like. - @method propertyWillChange - @param {String} keyName The property key that is about to change. - @return {Ember.Observable} - @private - */ - propertyWillChange: function (keyName) { - _emberMetal.propertyWillChange(this, keyName); - return this; - }, - - /** - Notify the observer system that a property has just changed. - Sometimes you need to change a value directly or indirectly without - actually calling `get()` or `set()` on it. In this case, you can use this - method and `propertyWillChange()` instead. Calling these two methods - together will notify all observers that the property has potentially - changed value. - Note that you must always call `propertyWillChange` and `propertyDidChange` - as a pair. If you do not, it may get the property change groups out of - order and cause notifications to be delivered more often than you would - like. - @method propertyDidChange - @param {String} keyName The property key that has just changed. - @return {Ember.Observable} - @private - */ - propertyDidChange: function (keyName) { - _emberMetal.propertyDidChange(this, keyName); - return this; - }, - - /** - Convenience method to call `propertyWillChange` and `propertyDidChange` in - succession. - @method notifyPropertyChange - @param {String} keyName The property key to be notified about. - @return {Ember.Observable} - @public - */ - notifyPropertyChange: function (keyName) { - this.propertyWillChange(keyName); - this.propertyDidChange(keyName); - return this; - }, - - /** - Adds an observer on a property. - This is the core method used to register an observer for a property. - Once you call this method, any time the key's value is set, your observer - will be notified. Note that the observers are triggered any time the - value is set, regardless of whether it has actually changed. Your - observer should be prepared to handle that. - You can also pass an optional context parameter to this method. The - context will be passed to your observer method whenever it is triggered. - Note that if you add the same target/method pair on a key multiple times - with different context parameters, your observer will only be called once - with the last context you passed. - ### Observer Methods - Observer methods you pass should generally have the following signature if - you do not pass a `context` parameter: - ```javascript - fooDidChange: function(sender, key, value, rev) { }; - ``` - The sender is the object that changed. The key is the property that - changes. The value property is currently reserved and unused. The rev - is the last property revision of the object when it changed, which you can - use to detect if the key value has really changed or not. - If you pass a `context` parameter, the context will be passed before the - revision like so: - ```javascript - fooDidChange: function(sender, key, value, context, rev) { }; - ``` - Usually you will not need the value, context or revision parameters at - the end. In this case, it is common to write observer methods that take - only a sender and key value as parameters or, if you aren't interested in - any of these values, to write an observer that has no parameters at all. - @method addObserver - @param {String} key The key to observer - @param {Object} target The target object to invoke - @param {String|Function} method The method to invoke. - @public - */ - addObserver: function (key, target, method) { - _emberMetal.addObserver(this, key, target, method); - }, - - /** - Remove an observer you have previously registered on this object. Pass - the same key, target, and method you passed to `addObserver()` and your - target will no longer receive notifications. - @method removeObserver - @param {String} key The key to observer - @param {Object} target The target object to invoke - @param {String|Function} method The method to invoke. - @public - */ - removeObserver: function (key, target, method) { - _emberMetal.removeObserver(this, key, target, method); - }, - - /** - Returns `true` if the object currently has observers registered for a - particular key. You can use this method to potentially defer performing - an expensive action until someone begins observing a particular property - on the object. - @method hasObserverFor - @param {String} key Key to check - @return {Boolean} - @private - */ - hasObserverFor: function (key) { - return _emberMetal.hasListeners(this, key + ':change'); - }, - - /** - Retrieves the value of a property, or a default value in the case that the - property returns `undefined`. - ```javascript - person.getWithDefault('lastName', 'Doe'); - ``` - @method getWithDefault - @param {String} keyName The name of the property to retrieve - @param {Object} defaultValue The value to return if the property value is undefined - @return {Object} The property value or the defaultValue. - @public - */ - getWithDefault: function (keyName, defaultValue) { - return _emberMetal.getWithDefault(this, keyName, defaultValue); - }, - - /** - Set the value of a property to the current value plus some amount. - ```javascript - person.incrementProperty('age'); - team.incrementProperty('score', 2); - ``` - @method incrementProperty - @param {String} keyName The name of the property to increment - @param {Number} increment The amount to increment by. Defaults to 1 - @return {Number} The new property value - @public - */ - incrementProperty: function (keyName, increment) { - if (_emberMetal.isNone(increment)) { - increment = 1; - } - - return _emberMetal.set(this, keyName, (parseFloat(_emberMetal.get(this, keyName)) || 0) + increment); - }, - - /** - Set the value of a property to the current value minus some amount. - ```javascript - player.decrementProperty('lives'); - orc.decrementProperty('health', 5); - ``` - @method decrementProperty - @param {String} keyName The name of the property to decrement - @param {Number} decrement The amount to decrement by. Defaults to 1 - @return {Number} The new property value - @public - */ - decrementProperty: function (keyName, decrement) { - if (_emberMetal.isNone(decrement)) { - decrement = 1; - } - - return _emberMetal.set(this, keyName, (_emberMetal.get(this, keyName) || 0) - decrement); - }, - - /** - Set the value of a boolean property to the opposite of its - current value. - ```javascript - starship.toggleProperty('warpDriveEngaged'); - ``` - @method toggleProperty - @param {String} keyName The name of the property to toggle - @return {Boolean} The new property value - @public - */ - toggleProperty: function (keyName) { - return _emberMetal.set(this, keyName, !_emberMetal.get(this, keyName)); - }, - - /** - Returns the cached value of a computed property, if it exists. - This allows you to inspect the value of a computed property - without accidentally invoking it if it is intended to be - generated lazily. - @method cacheFor - @param {String} keyName - @return {Object} The cached value of the computed property, if any - @public - */ - cacheFor: function (keyName) { - return _emberMetal.cacheFor(this, keyName); - }, - - // intended for debugging purposes - observersForKey: function (keyName) { - return _emberMetal.observersFor(this, keyName); - } - }); -}); -enifed('ember-runtime/mixins/promise_proxy', ['exports', 'ember-metal', 'ember-runtime/computed/computed_macros'], function (exports, _emberMetal, _emberRuntimeComputedComputed_macros) { - 'use strict'; - - /** - @module ember - @submodule ember-runtime - */ - - function tap(proxy, promise) { - _emberMetal.setProperties(proxy, { - isFulfilled: false, - isRejected: false - }); - - return promise.then(function (value) { - if (!proxy.isDestroyed && !proxy.isDestroying) { - _emberMetal.setProperties(proxy, { - content: value, - isFulfilled: true - }); - } - return value; - }, function (reason) { - if (!proxy.isDestroyed && !proxy.isDestroying) { - _emberMetal.setProperties(proxy, { - reason: reason, - isRejected: true - }); - } - throw reason; - }, 'Ember: PromiseProxy'); - } - - /** - A low level mixin making ObjectProxy promise-aware. - - ```javascript - let ObjectPromiseProxy = Ember.ObjectProxy.extend(Ember.PromiseProxyMixin); - - let proxy = ObjectPromiseProxy.create({ - promise: Ember.RSVP.cast($.getJSON('/some/remote/data.json')) - }); - - proxy.then(function(json){ - // the json - }, function(reason) { - // the reason why you have no json - }); - ``` - - the proxy has bindable attributes which - track the promises life cycle - - ```javascript - proxy.get('isPending') //=> true - proxy.get('isSettled') //=> false - proxy.get('isRejected') //=> false - proxy.get('isFulfilled') //=> false - ``` - - When the $.getJSON completes, and the promise is fulfilled - with json, the life cycle attributes will update accordingly. - Note that $.getJSON doesn't return an ECMA specified promise, - it is useful to wrap this with an `RSVP.cast` so that it behaves - as a spec compliant promise. - - ```javascript - proxy.get('isPending') //=> false - proxy.get('isSettled') //=> true - proxy.get('isRejected') //=> false - proxy.get('isFulfilled') //=> true - ``` - - As the proxy is an ObjectProxy, and the json now its content, - all the json properties will be available directly from the proxy. - - ```javascript - // Assuming the following json: - { - firstName: 'Stefan', - lastName: 'Penner' - } - - // both properties will accessible on the proxy - proxy.get('firstName') //=> 'Stefan' - proxy.get('lastName') //=> 'Penner' - ``` - - @class Ember.PromiseProxyMixin - @public - */ - exports.default = _emberMetal.Mixin.create({ - /** - If the proxied promise is rejected this will contain the reason - provided. - @property reason - @default null - @public - */ - reason: null, - - /** - Once the proxied promise has settled this will become `false`. - @property isPending - @default true - @public - */ - isPending: _emberRuntimeComputedComputed_macros.not('isSettled').readOnly(), - - /** - Once the proxied promise has settled this will become `true`. - @property isSettled - @default false - @public - */ - isSettled: _emberRuntimeComputedComputed_macros.or('isRejected', 'isFulfilled').readOnly(), - - /** - Will become `true` if the proxied promise is rejected. - @property isRejected - @default false - @public - */ - isRejected: false, - - /** - Will become `true` if the proxied promise is fulfilled. - @property isFulfilled - @default false - @public - */ - isFulfilled: false, - - /** - The promise whose fulfillment value is being proxied by this object. - This property must be specified upon creation, and should not be - changed once created. - Example: - ```javascript - Ember.ObjectProxy.extend(Ember.PromiseProxyMixin).create({ - promise: - }); - ``` - @property promise - @public - */ - promise: _emberMetal.computed({ - get: function () { - throw new _emberMetal.Error('PromiseProxy\'s promise must be set'); - }, - set: function (key, promise) { - return tap(this, promise); - } - }), - - /** - An alias to the proxied promise's `then`. - See RSVP.Promise.then. - @method then - @param {Function} callback - @return {RSVP.Promise} - @public - */ - then: promiseAlias('then'), - - /** - An alias to the proxied promise's `catch`. - See RSVP.Promise.catch. - @method catch - @param {Function} callback - @return {RSVP.Promise} - @since 1.3.0 - @public - */ - 'catch': promiseAlias('catch'), - - /** - An alias to the proxied promise's `finally`. - See RSVP.Promise.finally. - @method finally - @param {Function} callback - @return {RSVP.Promise} - @since 1.3.0 - @public - */ - 'finally': promiseAlias('finally') - - }); - - function promiseAlias(name) { - return function () { - var promise = _emberMetal.get(this, 'promise'); - return promise[name].apply(promise, arguments); - }; - } -}); -enifed('ember-runtime/mixins/registry_proxy', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-runtime - */ - - 'use strict'; - - exports.buildFakeRegistryWithDeprecations = buildFakeRegistryWithDeprecations; - - /** - RegistryProxyMixin is used to provide public access to specific - registry functionality. - - @class RegistryProxyMixin - @private - */ - exports.default = _emberMetal.Mixin.create({ - __registry__: null, - - /** - Given a fullName return the corresponding factory. - @public - @method resolveRegistration - @param {String} fullName - @return {Function} fullName's factory - */ - resolveRegistration: registryAlias('resolve'), - - /** - Registers a factory that can be used for dependency injection (with - `inject`) or for service lookup. Each factory is registered with - a full name including two parts: `type:name`. - A simple example: - ```javascript - let App = Ember.Application.create(); - App.Orange = Ember.Object.extend(); - App.register('fruit:favorite', App.Orange); - ``` - Ember will resolve factories from the `App` namespace automatically. - For example `App.CarsController` will be discovered and returned if - an application requests `controller:cars`. - An example of registering a controller with a non-standard name: - ```javascript - let App = Ember.Application.create(); - let Session = Ember.Controller.extend(); - App.register('controller:session', Session); - // The Session controller can now be treated like a normal controller, - // despite its non-standard name. - App.ApplicationController = Ember.Controller.extend({ - needs: ['session'] - }); - ``` - Registered factories are **instantiated** by having `create` - called on them. Additionally they are **singletons**, each time - they are looked up they return the same instance. - Some examples modifying that default behavior: - ```javascript - let App = Ember.Application.create(); - App.Person = Ember.Object.extend(); - App.Orange = Ember.Object.extend(); - App.Email = Ember.Object.extend(); - App.session = Ember.Object.create(); - App.register('model:user', App.Person, { singleton: false }); - App.register('fruit:favorite', App.Orange); - App.register('communication:main', App.Email, { singleton: false }); - App.register('session', App.session, { instantiate: false }); - ``` - @method register - @param fullName {String} type:name (e.g., 'model:user') - @param factory {Function} (e.g., App.Person) - @param options {Object} (optional) disable instantiation or singleton usage - @public - */ - register: registryAlias('register'), - - /** - Unregister a factory. - ```javascript - let App = Ember.Application.create(); - let User = Ember.Object.extend(); - App.register('model:user', User); - App.resolveRegistration('model:user').create() instanceof User //=> true - App.unregister('model:user') - App.resolveRegistration('model:user') === undefined //=> true - ``` - @public - @method unregister - @param {String} fullName - */ - unregister: registryAlias('unregister'), - - /** - Check if a factory is registered. - @public - @method hasRegistration - @param {String} fullName - @return {Boolean} - */ - hasRegistration: registryAlias('has'), - - /** - Register an option for a particular factory. - @public - @method registerOption - @param {String} fullName - @param {String} optionName - @param {Object} options - */ - registerOption: registryAlias('option'), - - /** - Return a specific registered option for a particular factory. - @public - @method registeredOption - @param {String} fullName - @param {String} optionName - @return {Object} options - */ - registeredOption: registryAlias('getOption'), - - /** - Register options for a particular factory. - @public - @method registerOptions - @param {String} fullName - @param {Object} options - */ - registerOptions: registryAlias('options'), - - /** - Return registered options for a particular factory. - @public - @method registeredOptions - @param {String} fullName - @return {Object} options - */ - registeredOptions: registryAlias('getOptions'), - - /** - Allow registering options for all factories of a type. - ```javascript - let App = Ember.Application.create(); - let appInstance = App.buildInstance(); - // if all of type `connection` must not be singletons - appInstance.optionsForType('connection', { singleton: false }); - appInstance.register('connection:twitter', TwitterConnection); - appInstance.register('connection:facebook', FacebookConnection); - let twitter = appInstance.lookup('connection:twitter'); - let twitter2 = appInstance.lookup('connection:twitter'); - twitter === twitter2; // => false - let facebook = appInstance.lookup('connection:facebook'); - let facebook2 = appInstance.lookup('connection:facebook'); - facebook === facebook2; // => false - ``` - @public - @method registerOptionsForType - @param {String} type - @param {Object} options - */ - registerOptionsForType: registryAlias('optionsForType'), - - /** - Return the registered options for all factories of a type. - @public - @method registeredOptionsForType - @param {String} type - @return {Object} options - */ - registeredOptionsForType: registryAlias('getOptionsForType'), - - /** - Define a dependency injection onto a specific factory or all factories - of a type. - When Ember instantiates a controller, view, or other framework component - it can attach a dependency to that component. This is often used to - provide services to a set of framework components. - An example of providing a session object to all controllers: - ```javascript - let App = Ember.Application.create(); - let Session = Ember.Object.extend({ isAuthenticated: false }); - // A factory must be registered before it can be injected - App.register('session:main', Session); - // Inject 'session:main' onto all factories of the type 'controller' - // with the name 'session' - App.inject('controller', 'session', 'session:main'); - App.IndexController = Ember.Controller.extend({ - isLoggedIn: Ember.computed.alias('session.isAuthenticated') - }); - ``` - Injections can also be performed on specific factories. - ```javascript - App.inject(, , ) - App.inject('route', 'source', 'source:main') - App.inject('route:application', 'email', 'model:email') - ``` - It is important to note that injections can only be performed on - classes that are instantiated by Ember itself. Instantiating a class - directly (via `create` or `new`) bypasses the dependency injection - system. - **Note:** Ember-Data instantiates its models in a unique manner, and consequently - injections onto models (or all models) will not work as expected. Injections - on models can be enabled by setting `EmberENV.MODEL_FACTORY_INJECTIONS` - to `true`. - @public - @method inject - @param factoryNameOrType {String} - @param property {String} - @param injectionName {String} - **/ - inject: registryAlias('injection') - }); - - function registryAlias(name) { - return function () { - var _registry__; - - return (_registry__ = this.__registry__)[name].apply(_registry__, arguments); - }; - } - - function buildFakeRegistryWithDeprecations(instance, typeForMessage) { - var fakeRegistry = {}; - var registryProps = { - resolve: 'resolveRegistration', - register: 'register', - unregister: 'unregister', - has: 'hasRegistration', - option: 'registerOption', - options: 'registerOptions', - getOptions: 'registeredOptions', - optionsForType: 'registerOptionsForType', - getOptionsForType: 'registeredOptionsForType', - injection: 'inject' - }; - - for (var deprecatedProperty in registryProps) { - fakeRegistry[deprecatedProperty] = buildFakeRegistryFunction(instance, typeForMessage, deprecatedProperty, registryProps[deprecatedProperty]); - } - - return fakeRegistry; - } - - function buildFakeRegistryFunction(instance, typeForMessage, deprecatedProperty, nonDeprecatedProperty) { - return function () { - return instance[nonDeprecatedProperty].apply(instance, arguments); - }; - } -}); -enifed('ember-runtime/mixins/target_action_support', ['exports', 'ember-environment', 'ember-metal'], function (exports, _emberEnvironment, _emberMetal) { - /** - @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 - usually the best choice. This mixin is most often useful when you are - doing more complex event handling in Components. - - @class TargetActionSupport - @namespace Ember - @extends Ember.Mixin - @private - */ - exports.default = _emberMetal.Mixin.create({ - target: null, - action: null, - actionContext: null, - - actionContextObject: _emberMetal.computed('actionContext', function () { - var actionContext = _emberMetal.get(this, 'actionContext'); - - if (typeof actionContext === 'string') { - var value = _emberMetal.get(this, actionContext); - if (value === undefined) { - value = _emberMetal.get(_emberEnvironment.context.lookup, actionContext); - } - return value; - } else { - return actionContext; - } - }), - - /** - Send an `action` with an `actionContext` to a `target`. The action, actionContext - and target will be retrieved from properties of the object. For example: - ```javascript - App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, { - target: Ember.computed.alias('controller'), - action: 'save', - actionContext: Ember.computed.alias('context'), - click() { - this.triggerAction(); // Sends the `save` action, along with the current context - // to the current controller - } - }); - ``` - The `target`, `action`, and `actionContext` can be provided as properties of - an optional object argument to `triggerAction` as well. - ```javascript - App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, { - click() { - this.triggerAction({ - action: 'save', - target: this.get('controller'), - actionContext: this.get('context') - }); // Sends the `save` action, along with the current context - // to the current controller - } - }); - ``` - The `actionContext` defaults to the object you are mixing `TargetActionSupport` into. - But `target` and `action` must be specified either as properties or with the argument - to `triggerAction`, or a combination: - ```javascript - App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, { - target: Ember.computed.alias('controller'), - click() { - this.triggerAction({ - action: 'save' - }); // Sends the `save` action, along with a reference to `this`, - // to the current controller - } - }); - ``` - @method triggerAction - @param opts {Object} (optional, with the optional keys action, target and/or actionContext) - @return {Boolean} true if the action was sent successfully and did not return false - @private - */ - triggerAction: function () { - var opts = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - - var action = opts.action || _emberMetal.get(this, 'action'); - var target = opts.target; - - if (!target) { - target = getTarget(this); - } - - var actionContext = opts.actionContext; - - function args(options, actionName) { - var ret = []; - if (actionName) { - ret.push(actionName); - } - - return ret.concat(options); - } - - if (typeof actionContext === 'undefined') { - actionContext = _emberMetal.get(this, 'actionContextObject') || this; - } - - if (target && action) { - var ret = undefined; - - if (target.send) { - ret = target.send.apply(target, args(actionContext, action)); - } else { - ret = target[action].apply(target, args(actionContext)); - } - - if (ret !== false) { - ret = true; - } - - return ret; - } else { - return false; - } - } - }); - - function getTarget(instance) { - // TODO: Deprecate specifying `targetObject` - var target = _emberMetal.get(instance, 'targetObject'); - - // if a `targetObject` CP was provided, use it - if (target) { - return target; - } - - // if _targetObject use it - if (instance._targetObject) { - return instance._targetObject; - } - - target = _emberMetal.get(instance, 'target'); - if (target) { - if (typeof target === 'string') { - var value = _emberMetal.get(instance, target); - if (value === undefined) { - value = _emberMetal.get(_emberEnvironment.context.lookup, target); - } - - return value; - } else { - return target; - } - } - - return null; - } -}); -enifed("ember-runtime/string_registry", ["exports"], function (exports) { - // STATE within a module is frowned apon, this exists - // to support Ember.STRINGS but shield ember internals from this legacy global - // API. - "use strict"; - - exports.setStrings = setStrings; - exports.getStrings = getStrings; - exports.get = get; - var STRINGS = {}; - - function setStrings(strings) { - STRINGS = strings; - } - - function getStrings() { - return STRINGS; - } - - function get(name) { - return STRINGS[name]; - } -}); -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', 'ember-runtime/utils', 'ember-runtime/system/object', 'ember-runtime/mixins/mutable_array', 'ember-runtime/mixins/enumerable', 'ember-runtime/mixins/array'], function (exports, _emberMetal, _emberRuntimeUtils, _emberRuntimeSystemObject, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsArray) { - 'use strict'; - - /** - @module ember - @submodule ember-runtime - */ - - var OUT_OF_RANGE_EXCEPTION = 'Index out of range'; - var EMPTY = []; - - function K() { - return this; - } - - /** - An ArrayProxy wraps any other object that implements `Ember.Array` and/or - `Ember.MutableArray,` forwarding all requests. This makes it very useful for - a number of binding use cases or other cases where being able to swap - out the underlying array is useful. - - A simple example of usage: - - ```javascript - let pets = ['dog', 'cat', 'fish']; - let ap = Ember.ArrayProxy.create({ content: Ember.A(pets) }); - - ap.get('firstObject'); // 'dog' - ap.set('content', ['amoeba', 'paramecium']); - ap.get('firstObject'); // 'amoeba' - ``` - - This class can also be useful as a layer to transform the contents of - an array, as they are accessed. This can be done by overriding - `objectAtContent`: - - ```javascript - let pets = ['dog', 'cat', 'fish']; - let ap = Ember.ArrayProxy.create({ - content: Ember.A(pets), - objectAtContent: function(idx) { - return this.get('content').objectAt(idx).toUpperCase(); - } - }); - - ap.get('firstObject'); // . 'DOG' - ``` - - @class ArrayProxy - @namespace Ember - @extends Ember.Object - @uses Ember.MutableArray - @public - */ - exports.default = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsMutable_array.default, { - - /** - The content array. Must be an object that implements `Ember.Array` and/or - `Ember.MutableArray.` - @property content - @type Ember.Array - @private - */ - content: null, - - /** - The array that the proxy pretends to be. In the default `ArrayProxy` - implementation, this and `content` are the same. Subclasses of `ArrayProxy` - can override this property to provide things like sorting and filtering. - @property arrangedContent - @private - */ - arrangedContent: _emberMetal.alias('content'), - - /** - Should actually retrieve the object at the specified index from the - content. You can override this method in subclasses to transform the - content item to something new. - This method will only be called if content is non-`null`. - @method objectAtContent - @param {Number} idx The index to retrieve. - @return {Object} the value or undefined if none found - @public - */ - objectAtContent: function (idx) { - return _emberRuntimeMixinsArray.objectAt(_emberMetal.get(this, 'arrangedContent'), idx); - }, - - /** - Should actually replace the specified objects on the content array. - You can override this method in subclasses to transform the content item - into something new. - This method will only be called if content is non-`null`. - @method replaceContent - @param {Number} idx The starting index - @param {Number} amt The number of items to remove from the content. - @param {Array} objects Optional array of objects to insert or null if no - objects. - @return {void} - @private - */ - replaceContent: function (idx, amt, objects) { - _emberMetal.get(this, 'content').replace(idx, amt, objects); - }, - - /** - Invoked when the content property is about to change. Notifies observers that the - entire array content will change. - @private - @method _contentWillChange - */ - _contentWillChange: _emberMetal._beforeObserver('content', function () { - this._teardownContent(); - }), - - _teardownContent: function () { - var content = _emberMetal.get(this, 'content'); - - if (content) { - _emberRuntimeMixinsArray.removeArrayObserver(content, this, { - willChange: 'contentArrayWillChange', - didChange: 'contentArrayDidChange' - }); - } - }, - - /** - Override to implement content array `willChange` observer. - @method contentArrayWillChange - @param {Ember.Array} contentArray the content array - @param {Number} start starting index of the change - @param {Number} removeCount count of items removed - @param {Number} addCount count of items added - @private - */ - contentArrayWillChange: K, - /** - Override to implement content array `didChange` observer. - @method contentArrayDidChange - @param {Ember.Array} contentArray the content array - @param {Number} start starting index of the change - @param {Number} removeCount count of items removed - @param {Number} addCount count of items added - @private - */ - contentArrayDidChange: K, - - /** - Invoked when the content property changes. Notifies observers that the - entire array content has changed. - @private - @method _contentDidChange - */ - _contentDidChange: _emberMetal.observer('content', function () { - var content = _emberMetal.get(this, 'content'); - - this._setupContent(); - }), - - _setupContent: function () { - var content = _emberMetal.get(this, 'content'); - - if (content) { - - _emberRuntimeMixinsArray.addArrayObserver(content, this, { - willChange: 'contentArrayWillChange', - didChange: 'contentArrayDidChange' - }); - } - }, - - _arrangedContentWillChange: _emberMetal._beforeObserver('arrangedContent', function () { - var arrangedContent = _emberMetal.get(this, 'arrangedContent'); - var len = arrangedContent ? _emberMetal.get(arrangedContent, 'length') : 0; - - this.arrangedContentArrayWillChange(this, 0, len, undefined); - this.arrangedContentWillChange(this); - - this._teardownArrangedContent(arrangedContent); - }), - - _arrangedContentDidChange: _emberMetal.observer('arrangedContent', function () { - var arrangedContent = _emberMetal.get(this, 'arrangedContent'); - var len = arrangedContent ? _emberMetal.get(arrangedContent, 'length') : 0; - - this._setupArrangedContent(); - - this.arrangedContentDidChange(this); - this.arrangedContentArrayDidChange(this, 0, undefined, len); - }), - - _setupArrangedContent: function () { - var arrangedContent = _emberMetal.get(this, 'arrangedContent'); - - if (arrangedContent) { - - _emberRuntimeMixinsArray.addArrayObserver(arrangedContent, this, { - willChange: 'arrangedContentArrayWillChange', - didChange: 'arrangedContentArrayDidChange' - }); - } - }, - - _teardownArrangedContent: function () { - var arrangedContent = _emberMetal.get(this, 'arrangedContent'); - - if (arrangedContent) { - _emberRuntimeMixinsArray.removeArrayObserver(arrangedContent, this, { - willChange: 'arrangedContentArrayWillChange', - didChange: 'arrangedContentArrayDidChange' - }); - } - }, - - arrangedContentWillChange: K, - arrangedContentDidChange: K, - - objectAt: function (idx) { - return _emberMetal.get(this, 'content') && this.objectAtContent(idx); - }, - - length: _emberMetal.computed(function () { - var arrangedContent = _emberMetal.get(this, 'arrangedContent'); - return arrangedContent ? _emberMetal.get(arrangedContent, 'length') : 0; - // No dependencies since Enumerable notifies length of change - }), - - _replace: function (idx, amt, objects) { - var content = _emberMetal.get(this, 'content'); - - if (content) { - this.replaceContent(idx, amt, objects); - } - - return this; - }, - - replace: function () { - if (_emberMetal.get(this, 'arrangedContent') === _emberMetal.get(this, 'content')) { - this._replace.apply(this, arguments); - } else { - throw new _emberMetal.Error('Using replace on an arranged ArrayProxy is not allowed.'); - } - }, - - _insertAt: function (idx, object) { - if (idx > _emberMetal.get(this, 'content.length')) { - throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); - } - - this._replace(idx, 0, [object]); - return this; - }, - - insertAt: function (idx, object) { - if (_emberMetal.get(this, 'arrangedContent') === _emberMetal.get(this, 'content')) { - return this._insertAt(idx, object); - } else { - throw new _emberMetal.Error('Using insertAt on an arranged ArrayProxy is not allowed.'); - } - }, - - removeAt: function (start, len) { - if ('number' === typeof start) { - var content = _emberMetal.get(this, 'content'); - var arrangedContent = _emberMetal.get(this, 'arrangedContent'); - var indices = []; - - if (start < 0 || start >= _emberMetal.get(this, 'length')) { - throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); - } - - if (len === undefined) { - len = 1; - } - - // Get a list of indices in original content to remove - for (var i = start; i < start + len; i++) { - // Use arrangedContent here so we avoid confusion with objects transformed by objectAtContent - indices.push(content.indexOf(_emberRuntimeMixinsArray.objectAt(arrangedContent, i))); - } - - // Replace in reverse order since indices will change - indices.sort(function (a, b) { - return b - a; - }); - - _emberMetal.beginPropertyChanges(); - for (var i = 0; i < indices.length; i++) { - this._replace(indices[i], 1, EMPTY); - } - _emberMetal.endPropertyChanges(); - } - - return this; - }, - - pushObject: function (obj) { - this._insertAt(_emberMetal.get(this, 'content.length'), obj); - return obj; - }, - - pushObjects: function (objects) { - if (!(_emberRuntimeMixinsEnumerable.default.detect(objects) || _emberRuntimeUtils.isArray(objects))) { - throw new TypeError('Must pass Ember.Enumerable to Ember.MutableArray#pushObjects'); - } - this._replace(_emberMetal.get(this, 'length'), 0, objects); - return this; - }, - - setObjects: function (objects) { - if (objects.length === 0) { - return this.clear(); - } - - var len = _emberMetal.get(this, 'length'); - this._replace(0, len, objects); - return this; - }, - - unshiftObject: function (obj) { - this._insertAt(0, obj); - return obj; - }, - - unshiftObjects: function (objects) { - this._replace(0, 0, objects); - return this; - }, - - slice: function () { - var arr = this.toArray(); - return arr.slice.apply(arr, arguments); - }, - - arrangedContentArrayWillChange: function (item, idx, removedCnt, addedCnt) { - this.arrayContentWillChange(idx, removedCnt, addedCnt); - }, - - arrangedContentArrayDidChange: function (item, idx, removedCnt, addedCnt) { - this.arrayContentDidChange(idx, removedCnt, addedCnt); - }, - - init: function () { - this._super.apply(this, arguments); - this._setupContent(); - this._setupArrangedContent(); - }, - - willDestroy: function () { - this._teardownArrangedContent(); - this._teardownContent(); - } - }); -}); -enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/mixins/action_handler', 'ember-runtime/inject'], function (exports, _emberUtils, _emberMetal, _emberRuntimeMixinsAction_handler, _emberRuntimeInject) { - 'no use strict'; - // Remove "use strict"; from transpiled module until - // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - - /** - @module ember - @submodule ember-runtime - */ - - // using ember-metal/lib/main here to ensure that ember-debug is setup - // if present - - var _Mixin$create; - - var schedule = _emberMetal.run.schedule; - var applyMixin = _emberMetal.Mixin._apply; - var finishPartial = _emberMetal.Mixin.finishPartial; - var reopen = _emberMetal.Mixin.prototype.reopen; - var hasCachedComputedProperties = false; - - var POST_INIT = _emberUtils.symbol('POST_INIT'); - - exports.POST_INIT = POST_INIT; - function makeCtor() { - // Note: avoid accessing any properties on the object since it makes the - // method a lot faster. This is glue code so we want it to be as fast as - // possible. - - var wasApplied = false; - var initProperties; - - var Class = function () { - if (!wasApplied) { - Class.proto(); // prepare prototype... - } - - if (arguments.length > 0) { - initProperties = [arguments[0]]; - } - - this.__defineNonEnumerable(_emberUtils.GUID_KEY_PROPERTY); - var m = _emberMetal.meta(this); - var proto = m.proto; - m.proto = this; - if (initProperties) { - // capture locally so we can clear the closed over variable - var props = initProperties; - initProperties = null; - - var concatenatedProperties = this.concatenatedProperties; - var mergedProperties = this.mergedProperties; - - for (var i = 0; i < props.length; i++) { - var properties = props[i]; - - if (typeof properties !== 'object' && properties !== undefined) { - throw new _emberMetal.Error('Ember.Object.create only accepts objects.'); - } - - if (!properties) { - continue; - } - - var keyNames = Object.keys(properties); - - for (var j = 0; j < keyNames.length; j++) { - var keyName = keyNames[j]; - var value = properties[keyName]; - - if (_emberMetal.detectBinding(keyName)) { - m.writeBindings(keyName, value); - } - - var possibleDesc = this[keyName]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - if (concatenatedProperties && concatenatedProperties.length > 0 && concatenatedProperties.indexOf(keyName) >= 0) { - var baseValue = this[keyName]; - - if (baseValue) { - if ('function' === typeof baseValue.concat) { - value = baseValue.concat(value); - } else { - value = _emberUtils.makeArray(baseValue).concat(value); - } - } else { - value = _emberUtils.makeArray(value); - } - } - - if (mergedProperties && mergedProperties.length && mergedProperties.indexOf(keyName) >= 0) { - var originalValue = this[keyName]; - - value = _emberUtils.assign({}, originalValue, value); - } - - if (desc) { - desc.set(this, keyName, value); - } else { - if (typeof this.setUnknownProperty === 'function' && !(keyName in this)) { - this.setUnknownProperty(keyName, value); - } else { - if (false) { - _emberMetal.defineProperty(this, keyName, null, value); // setup mandatory setter - } else { - this[keyName] = value; - } - } - } - } - } - } - - finishPartial(this, m); - - this.init.apply(this, arguments); - - this[POST_INIT](); - - m.proto = proto; - _emberMetal.finishChains(this); - _emberMetal.sendEvent(this, 'init'); - }; - - Class.toString = _emberMetal.Mixin.prototype.toString; - Class.willReopen = function () { - if (wasApplied) { - Class.PrototypeMixin = _emberMetal.Mixin.create(Class.PrototypeMixin); - } - - wasApplied = false; - }; - - Class._initProperties = function (args) { - initProperties = args; - }; - - Class.proto = function () { - var superclass = Class.superclass; - if (superclass) { - superclass.proto(); - } - - if (!wasApplied) { - wasApplied = true; - Class.PrototypeMixin.applyPartial(Class.prototype); - } - - return this.prototype; - }; - - return Class; - } - - /** - @class CoreObject - @namespace Ember - @public - */ - var CoreObject = makeCtor(); - CoreObject.toString = function () { - return 'Ember.CoreObject'; - }; - CoreObject.PrototypeMixin = _emberMetal.Mixin.create((_Mixin$create = { - reopen: function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - applyMixin(this, args, true); - return this; - }, - - /** - An overridable method called when objects are instantiated. By default, - does nothing unless it is overridden during class definition. - Example: - ```javascript - const Person = Ember.Object.extend({ - init() { - alert(`Name is ${this.get('name')}`); - } - }); - let steve = Person.create({ - name: "Steve" - }); - // alerts 'Name is Steve'. - ``` - NOTE: If you do override `init` for a framework class like `Ember.View`, - be sure to call `this._super(...arguments)` in your - `init` declaration! If you don't, Ember may not have an opportunity to - do important setup work, and you'll see strange behavior in your - application. - @method init - @public - */ - init: function () {} - - }, _Mixin$create[POST_INIT] = function () {}, _Mixin$create.__defineNonEnumerable = function (property) { - Object.defineProperty(this, property.name, property.descriptor); - //this[property.name] = property.descriptor.value; - }, _Mixin$create.concatenatedProperties = null, _Mixin$create.mergedProperties = null, _Mixin$create.isDestroyed = _emberMetal.descriptor({ - get: function () { - return _emberMetal.meta(this).isSourceDestroyed(); - }, - - set: function (value) { - // prevent setting while applying mixins - if (typeof value === 'object' && value !== null && value.isDescriptor) { - return; - } - } - }), _Mixin$create.isDestroying = _emberMetal.descriptor({ - get: function () { - return _emberMetal.meta(this).isSourceDestroying(); - }, - - set: function (value) { - // prevent setting while applying mixins - if (typeof value === 'object' && value !== null && value.isDescriptor) { - return; - } - } - }), _Mixin$create.destroy = function () { - var m = _emberMetal.meta(this); - if (m.isSourceDestroying()) { - return; - } - - m.setSourceDestroying(); - - schedule('actions', this, this.willDestroy); - schedule('destroy', this, this._scheduledDestroy, m); - - return this; - }, _Mixin$create.willDestroy = function () {}, _Mixin$create._scheduledDestroy = function (m) { - if (m.isSourceDestroyed()) { - return; - } - _emberMetal.destroy(this); - m.setSourceDestroyed(); - }, _Mixin$create.bind = function (to, from) { - if (!(from instanceof _emberMetal.Binding)) { - from = _emberMetal.Binding.from(from); - } - from.to(to).connect(this); - return from; - }, _Mixin$create.toString = function () { - var hasToStringExtension = typeof this.toStringExtension === 'function'; - var extension = hasToStringExtension ? ':' + this.toStringExtension() : ''; - var ret = '<' + this.constructor.toString() + ':' + _emberUtils.guidFor(this) + extension + '>'; - - return ret; - }, _Mixin$create)); - - CoreObject.PrototypeMixin.ownerConstructor = CoreObject; - - CoreObject.__super__ = null; - - var ClassMixinProps = { - - ClassMixin: _emberMetal.REQUIRED, - - PrototypeMixin: _emberMetal.REQUIRED, - - isClass: true, - - isMethod: false, - /** - Creates a new subclass. - ```javascript - const Person = Ember.Object.extend({ - say(thing) { - alert(thing); - } - }); - ``` - This defines a new subclass of Ember.Object: `Person`. It contains one method: `say()`. - You can also create a subclass from any existing class by calling its `extend()` method. - For example, you might want to create a subclass of Ember's built-in `Ember.Component` class: - ```javascript - const PersonComponent = Ember.Component.extend({ - tagName: 'li', - classNameBindings: ['isAdministrator'] - }); - ``` - When defining a subclass, you can override methods but still access the - implementation of your parent class by calling the special `_super()` method: - ```javascript - const Person = Ember.Object.extend({ - say(thing) { - var name = this.get('name'); - alert(`${name} says: ${thing}`); - } - }); - const Soldier = Person.extend({ - say(thing) { - this._super(`${thing}, sir!`); - }, - march(numberOfHours) { - alert(`${this.get('name')} marches for ${numberOfHours} hours.`); - } - }); - let yehuda = Soldier.create({ - name: "Yehuda Katz" - }); - yehuda.say("Yes"); // alerts "Yehuda Katz says: Yes, sir!" - ``` - The `create()` on line #17 creates an *instance* of the `Soldier` class. - The `extend()` on line #8 creates a *subclass* of `Person`. Any instance - of the `Person` class will *not* have the `march()` method. - You can also pass `Mixin` classes to add additional properties to the subclass. - ```javascript - const Person = Ember.Object.extend({ - say(thing) { - alert(`${this.get('name')} says: ${thing}`); - } - }); - const SingingMixin = Mixin.create({ - sing(thing){ - alert(`${this.get('name')} sings: la la la ${thing}`); - } - }); - const BroadwayStar = Person.extend(SingingMixin, { - dance() { - alert(`${this.get('name')} dances: tap tap tap tap `); - } - }); - ``` - The `BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`. - @method extend - @static - @param {Mixin} [mixins]* One or more Mixin classes - @param {Object} [arguments]* Object containing values to use within the new class - @public - */ - extend: function () { - var Class = makeCtor(); - var proto; - Class.ClassMixin = _emberMetal.Mixin.create(this.ClassMixin); - Class.PrototypeMixin = _emberMetal.Mixin.create(this.PrototypeMixin); - - Class.ClassMixin.ownerConstructor = Class; - Class.PrototypeMixin.ownerConstructor = Class; - - reopen.apply(Class.PrototypeMixin, arguments); - - Class.superclass = this; - Class.__super__ = this.prototype; - - proto = Class.prototype = Object.create(this.prototype); - proto.constructor = Class; - _emberUtils.generateGuid(proto); - _emberMetal.meta(proto).proto = proto; // this will disable observers on prototype - - Class.ClassMixin.apply(Class); - return Class; - }, - - /** - Creates an instance of a class. Accepts either no arguments, or an object - containing values to initialize the newly instantiated object with. - ```javascript - const Person = Ember.Object.extend({ - helloWorld() { - alert(`Hi, my name is ${this.get('name')}`); - } - }); - let tom = Person.create({ - name: 'Tom Dale' - }); - tom.helloWorld(); // alerts "Hi, my name is Tom Dale". - ``` - `create` will call the `init` function if defined during - `Ember.AnyObject.extend` - If no arguments are passed to `create`, it will not set values to the new - instance during initialization: - ```javascript - let noName = Person.create(); - noName.helloWorld(); // alerts undefined - ``` - NOTE: For performance reasons, you cannot declare methods or computed - properties during `create`. You should instead declare methods and computed - properties when using `extend`. - @method create - @static - @param [arguments]* - @public - */ - create: function () { - var C = this; - - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - if (args.length > 0) { - this._initProperties(args); - } - return new C(); - }, - - /** - Augments a constructor's prototype with additional - properties and functions: - ```javascript - const MyObject = Ember.Object.extend({ - name: 'an object' - }); - o = MyObject.create(); - o.get('name'); // 'an object' - MyObject.reopen({ - say(msg){ - console.log(msg); - } - }) - o2 = MyObject.create(); - o2.say("hello"); // logs "hello" - o.say("goodbye"); // logs "goodbye" - ``` - To add functions and properties to the constructor itself, - see `reopenClass` - @method reopen - @public - */ - reopen: function () { - this.willReopen(); - reopen.apply(this.PrototypeMixin, arguments); - return this; - }, - - /** - Augments a constructor's own properties and functions: - ```javascript - const MyObject = Ember.Object.extend({ - name: 'an object' - }); - MyObject.reopenClass({ - canBuild: false - }); - MyObject.canBuild; // false - o = MyObject.create(); - ``` - In other words, this creates static properties and functions for the class. - These are only available on the class and not on any instance of that class. - ```javascript - const Person = Ember.Object.extend({ - name: "", - sayHello() { - alert("Hello. My name is " + this.get('name')); - } - }); - Person.reopenClass({ - species: "Homo sapiens", - createPerson(newPersonsName){ - return Person.create({ - name:newPersonsName - }); - } - }); - let tom = Person.create({ - name: "Tom Dale" - }); - let yehuda = Person.createPerson("Yehuda Katz"); - tom.sayHello(); // "Hello. My name is Tom Dale" - yehuda.sayHello(); // "Hello. My name is Yehuda Katz" - alert(Person.species); // "Homo sapiens" - ``` - Note that `species` and `createPerson` are *not* valid on the `tom` and `yehuda` - variables. They are only valid on `Person`. - To add functions and properties to instances of - a constructor by extending the constructor's prototype - see `reopen` - @method reopenClass - @public - */ - reopenClass: function () { - reopen.apply(this.ClassMixin, arguments); - applyMixin(this, arguments, false); - return this; - }, - - detect: function (obj) { - if ('function' !== typeof obj) { - return false; - } - while (obj) { - if (obj === this) { - return true; - } - obj = obj.superclass; - } - return false; - }, - - detectInstance: function (obj) { - return obj instanceof this; - }, - - /** - In some cases, you may want to annotate computed properties with additional - metadata about how they function or what values they operate on. For - example, computed property functions may close over variables that are then - no longer available for introspection. - You can pass a hash of these values to a computed property like this: - ```javascript - person: Ember.computed(function() { - var personId = this.get('personId'); - return Person.create({ id: personId }); - }).meta({ type: Person }) - ``` - Once you've done this, you can retrieve the values saved to the computed - property from your class like this: - ```javascript - MyClass.metaForProperty('person'); - ``` - This will return the original hash that was passed to `meta()`. - @static - @method metaForProperty - @param key {String} property name - @private - */ - metaForProperty: function (key) { - var proto = this.proto(); - var possibleDesc = proto[key]; - var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - - return desc._meta || {}; - }, - - _computedProperties: _emberMetal.computed(function () { - hasCachedComputedProperties = true; - var proto = this.proto(); - var property; - var properties = []; - - for (var name in proto) { - property = proto[name]; - - if (property && property.isDescriptor) { - properties.push({ - name: name, - meta: property._meta - }); - } - } - return properties; - }).readOnly(), - - /** - Iterate over each computed property for the class, passing its name - and any associated metadata (see `metaForProperty`) to the callback. - @static - @method eachComputedProperty - @param {Function} callback - @param {Object} binding - @private - */ - eachComputedProperty: function (callback, binding) { - var property; - var empty = {}; - - var properties = _emberMetal.get(this, '_computedProperties'); - - for (var i = 0; i < properties.length; i++) { - property = properties[i]; - callback.call(binding || this, property.name, property.meta || empty); - } - } - }; - - function injectedPropertyAssertion() {} - - /** - Returns a hash of property names and container names that injected - properties will lookup on the container lazily. - - @method _lazyInjections - @return {Object} Hash of all lazy injected property keys to container names - @private - */ - ClassMixinProps._lazyInjections = function () { - var injections = {}; - var proto = this.proto(); - var key, desc; - - for (key in proto) { - desc = proto[key]; - if (desc instanceof _emberMetal.InjectedProperty) { - injections[key] = desc.type + ':' + (desc.name || key); - } - } - - return injections; - }; - - var ClassMixin = _emberMetal.Mixin.create(ClassMixinProps); - - ClassMixin.ownerConstructor = CoreObject; - - CoreObject.ClassMixin = ClassMixin; - - ClassMixin.apply(CoreObject); - - CoreObject.reopen({ - didDefineProperty: function (proto, key, value) { - if (hasCachedComputedProperties === false) { - return; - } - if (value instanceof _emberMetal.ComputedProperty) { - var cache = _emberMetal.meta(this.constructor).readableCache(); - - if (cache && cache._computedProperties !== undefined) { - cache._computedProperties = undefined; - } - } - } - }); - - exports.default = CoreObject; -}); -// Private, and only for didInitAttrs willRecieveAttrs - -/** - 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 - the subclass overrides a property with the same name that is defined - in the superclass. However, there are some cases where it is preferable - to build up a property's value by combining the superclass' property - value with the subclass' value. An example of this in use within Ember - is the `classNames` property of `Ember.View`. - Here is some sample code showing the difference between a concatenated - property and a normal one: - ```javascript - const Bar = Ember.Object.extend({ - // Configure which properties to concatenate - concatenatedProperties: ['concatenatedProperty'], - someNonConcatenatedProperty: ['bar'], - concatenatedProperty: ['bar'] - }); - const FooBar = Bar.extend({ - someNonConcatenatedProperty: ['foo'], - concatenatedProperty: ['foo'] - }); - let fooBar = FooBar.create(); - fooBar.get('someNonConcatenatedProperty'); // ['foo'] - fooBar.get('concatenatedProperty'); // ['bar', 'foo'] - ``` - This behavior extends to object creation as well. Continuing the - above example: - ```javascript - let fooBar = FooBar.create({ - someNonConcatenatedProperty: ['baz'], - concatenatedProperty: ['baz'] - }) - fooBar.get('someNonConcatenatedProperty'); // ['baz'] - fooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz'] - ``` - Adding a single property that is not an array will just add it in the array: - ```javascript - let fooBar = FooBar.create({ - concatenatedProperty: 'baz' - }) - view.get('concatenatedProperty'); // ['bar', 'foo', 'baz'] - ``` - Using the `concatenatedProperties` property, we can tell Ember to mix the - content of the properties. - In `Ember.Component` the `classNames`, `classNameBindings` and - `attributeBindings` properties are concatenated. - This feature is available for you to use throughout the Ember object model, - although typical app developers are likely to use it infrequently. Since - it changes expectations about behavior of properties, you should properly - document its usage in each individual concatenated property (to not - mislead your users to think they can override the property in a subclass). - @property concatenatedProperties - @type Array - @default null - @public -*/ - -/** - Defines the properties that will be merged from the superclass - (instead of overridden). - By default, when you extend an Ember class a property defined in - the subclass overrides a property with the same name that is defined - in the superclass. However, there are some cases where it is preferable - to build up a property's value by merging the superclass property value - with the subclass property's value. An example of this in use within Ember - is the `queryParams` property of routes. - Here is some sample code showing the difference between a merged - property and a normal one: - ```javascript - const Bar = Ember.Object.extend({ - // Configure which properties are to be merged - mergedProperties: ['mergedProperty'], - someNonMergedProperty: { - nonMerged: 'superclass value of nonMerged' - }, - mergedProperty: { - page: {replace: false}, - limit: {replace: true} - } - }); - const FooBar = Bar.extend({ - someNonMergedProperty: { - completelyNonMerged: 'subclass value of nonMerged' - }, - mergedProperty: { - limit: {replace: false} - } - }); - let fooBar = FooBar.create(); - fooBar.get('someNonMergedProperty'); - // => { completelyNonMerged: 'subclass value of nonMerged' } - // - // Note the entire object, including the nonMerged property of - // the superclass object, has been replaced - fooBar.get('mergedProperty'); - // => { - // page: {replace: false}, - // limit: {replace: false} - // } - // - // Note the page remains from the superclass, and the - // `limit` property's value of `false` has been merged from - // the subclass. - ``` - This behavior is not available during object `create` calls. It is only - available at `extend` time. - In `Ember.Route` the `queryParams` property is merged. - This feature is available for you to use throughout the Ember object model, - although typical app developers are likely to use it infrequently. Since - it changes expectations about behavior of properties, you should properly - document its usage in each individual merged property (to not - mislead your users to think they can override the property in a subclass). - @property mergedProperties - @type Array - @default null - @public -*/ - -/** - Destroyed object property flag. - if this property is `true` the observers and bindings were already - removed by the effect of calling the `destroy()` method. - @property isDestroyed - @default false - @public -*/ - -/** - Destruction scheduled flag. The `destroy()` method has been called. - The object stays intact until the end of the run loop at which point - the `isDestroyed` flag is set. - @property isDestroying - @default false - @public -*/ - -/** - Destroys an object by setting the `isDestroyed` flag and removing its - metadata, which effectively destroys observers and bindings. - If you try to set a property on a destroyed object, an exception will be - raised. - Note that destruction is scheduled for the end of the run loop and does not - happen immediately. It will set an isDestroying flag immediately. - @method destroy - @return {Ember.Object} receiver - @public -*/ - -/** - Override to implement teardown. - @method willDestroy - @public -*/ - -/** - Invoked by the run loop to actually destroy the object. This is - scheduled for execution by the `destroy` method. - @private - @method _scheduledDestroy -*/ - -/** - Returns a string representation which attempts to provide more information - than Javascript's `toString` typically does, in a generic way for all Ember - objects. - ```javascript - const Person = Ember.Object.extend() - person = Person.create() - person.toString() //=> "" - ``` - If the object's class is not defined on an Ember namespace, it will - indicate it is a subclass of the registered superclass: - ```javascript - const Student = Person.extend() - let student = Student.create() - student.toString() //=> "<(subclass of Person):ember1025>" - ``` - If the method `toStringExtension` is defined, its return value will be - included in the output. - ```javascript - const Teacher = Person.extend({ - toStringExtension() { - return this.get('fullName'); - } - }); - teacher = Teacher.create() - teacher.toString(); //=> "" - ``` - @method toString - @return {String} string representation - @public -*/ - -/** - Provides lookup-time type validation for injected properties. - @private - @method _onLookup -*/ -enifed('ember-runtime/system/each_proxy', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/mixins/array'], function (exports, _emberUtils, _emberMetal, _emberRuntimeMixinsArray) { - 'use strict'; - - exports.default = EachProxy; - - /** - 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 - */ - - function EachProxy(content) { - this._content = content; - this._keys = undefined; - this.__ember_meta__ = null; - } - - EachProxy.prototype = { - __defineNonEnumerable: function (property) { - this[property.name] = property.descriptor.value; - }, - - // .......................................................... - // ARRAY CHANGES - // Invokes whenever the content array itself changes. - - arrayWillChange: function (content, idx, removedCnt, addedCnt) { - var keys = this._keys; - var lim = removedCnt > 0 ? idx + removedCnt : -1; - for (var key in keys) { - if (lim > 0) { - removeObserverForContentKey(content, key, this, idx, lim); - } - _emberMetal.propertyWillChange(this, key); - } - }, - - arrayDidChange: function (content, idx, removedCnt, addedCnt) { - var keys = this._keys; - var lim = addedCnt > 0 ? idx + addedCnt : -1; - for (var key in keys) { - if (lim > 0) { - addObserverForContentKey(content, key, this, idx, lim); - } - _emberMetal.propertyDidChange(this, key); - } - }, - - // .......................................................... - // LISTEN FOR NEW OBSERVERS AND OTHER EVENT LISTENERS - // Start monitoring keys based on who is listening... - - willWatchProperty: function (property) { - this.beginObservingContentKey(property); - }, - - didUnwatchProperty: function (property) { - this.stopObservingContentKey(property); - }, - - // .......................................................... - // CONTENT KEY OBSERVING - // Actual watch keys on the source content. - - beginObservingContentKey: function (keyName) { - var keys = this._keys; - if (!keys) { - keys = this._keys = new _emberUtils.EmptyObject(); - } - - if (!keys[keyName]) { - keys[keyName] = 1; - var content = this._content; - var len = _emberMetal.get(content, 'length'); - - addObserverForContentKey(content, keyName, this, 0, len); - } else { - keys[keyName]++; - } - }, - - stopObservingContentKey: function (keyName) { - var keys = this._keys; - if (keys && keys[keyName] > 0 && --keys[keyName] <= 0) { - var content = this._content; - var len = _emberMetal.get(content, 'length'); - - removeObserverForContentKey(content, keyName, this, 0, len); - } - }, - - contentKeyWillChange: function (obj, keyName) { - _emberMetal.propertyWillChange(this, keyName); - }, - - contentKeyDidChange: function (obj, keyName) { - _emberMetal.propertyDidChange(this, keyName); - } - }; - - function addObserverForContentKey(content, keyName, proxy, idx, loc) { - while (--loc >= idx) { - var item = _emberRuntimeMixinsArray.objectAt(content, loc); - if (item) { - _emberMetal._addBeforeObserver(item, keyName, proxy, 'contentKeyWillChange'); - _emberMetal.addObserver(item, keyName, proxy, 'contentKeyDidChange'); - } - } - } - - function removeObserverForContentKey(content, keyName, proxy, idx, loc) { - while (--loc >= idx) { - var item = _emberRuntimeMixinsArray.objectAt(content, loc); - if (item) { - _emberMetal._removeBeforeObserver(item, keyName, proxy, 'contentKeyWillChange'); - _emberMetal.removeObserver(item, keyName, proxy, 'contentKeyDidChange'); - } - } - } -}); -enifed('ember-runtime/system/lazy_load', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { - /*globals CustomEvent */ - - 'use strict'; - - exports.onLoad = onLoad; - exports.runLoadHooks = runLoadHooks; - - /** - @module ember - @submodule ember-runtime - */ - - var loadHooks = _emberEnvironment.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 - resolved from a string into the object: - - ``` javascript - Ember.onLoad('Ember.Application' function(hbars) { - hbars.registerHelper(...); - }); - ``` - - @method onLoad - @for Ember - @param name {String} name of hook - @param callback {Function} callback to be called - @private - */ - - function onLoad(name, callback) { - var object = loaded[name]; - - loadHooks[name] = loadHooks[name] || []; - loadHooks[name].push(callback); - - if (object) { - callback(object); - } - } - - /** - Called when an Ember.js package (e.g Ember.Application) has finished - loading. Triggers any callbacks registered for this event. - - @method runLoadHooks - @for Ember - @param name {String} name of hook - @param object {Object} object to pass to callbacks - @private - */ - - function runLoadHooks(name, object) { - loaded[name] = object; - var window = _emberEnvironment.environment.window; - - if (window && typeof CustomEvent === 'function') { - var _event = new CustomEvent(name, { detail: object, name: name }); - window.dispatchEvent(_event); - } - - if (loadHooks[name]) { - loadHooks[name].forEach(function (callback) { - return callback(object); - }); - } - } -}); -enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal', 'ember-environment', 'ember-runtime/system/object'], function (exports, _emberUtils, _emberMetal, _emberEnvironment, _emberRuntimeSystemObject) { - /** - @module ember - @submodule ember-runtime - */ - 'use strict'; - - exports.isSearchDisabled = isSearchDisabled; - exports.setSearchDisabled = setSearchDisabled; - - var searchDisabled = false; - - function isSearchDisabled() { - return searchDisabled; - } - - function setSearchDisabled(flag) { - searchDisabled = !!flag; - } - - /** - 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. - - # Example Usage - - ```javascript - MyFramework = Ember.Namespace.create({ - VERSION: '1.0.0' - }); - ``` - - @class Namespace - @namespace Ember - @extends Ember.Object - @public - */ - var Namespace = _emberRuntimeSystemObject.default.extend({ - isNamespace: true, - - init: function () { - Namespace.NAMESPACES.push(this); - Namespace.PROCESSED = false; - }, - - toString: function () { - var name = _emberMetal.get(this, 'name') || _emberMetal.get(this, 'modulePrefix'); - if (name) { - return name; - } - - findNamespaces(); - return this[_emberMetal.NAME_KEY]; - }, - - nameClasses: function () { - processNamespace([this.toString()], this, {}); - }, - - destroy: function () { - var namespaces = Namespace.NAMESPACES; - var toString = this.toString(); - - if (toString) { - _emberEnvironment.context.lookup[toString] = undefined; - delete Namespace.NAMESPACES_BY_ID[toString]; - } - namespaces.splice(namespaces.indexOf(this), 1); - this._super.apply(this, arguments); - } - }); - - Namespace.reopenClass({ - NAMESPACES: [_emberMetal.default], - NAMESPACES_BY_ID: { - Ember: _emberMetal.default - }, - PROCESSED: false, - processAll: processAllNamespaces, - byName: function (name) { - if (!searchDisabled) { - processAllNamespaces(); - } - - return NAMESPACES_BY_ID[name]; - } - }); - - var NAMESPACES_BY_ID = Namespace.NAMESPACES_BY_ID; - - var hasOwnProp = ({}).hasOwnProperty; - - function processNamespace(paths, root, seen) { - var idx = paths.length; - - NAMESPACES_BY_ID[paths.join('.')] = root; - - // Loop over all of the keys in the namespace, looking for classes - for (var key in root) { - if (!hasOwnProp.call(root, key)) { - continue; - } - var obj = root[key]; - - // If we are processing the `Ember` namespace, for example, the - // `paths` will start with `["Ember"]`. Every iteration through - // the loop will update the **second** element of this list with - // the key, so processing `Ember.View` will make the Array - // `['Ember', 'View']`. - paths[idx] = key; - - // If we have found an unprocessed class - if (obj && obj.toString === classToString && !obj[_emberMetal.NAME_KEY]) { - // Replace the class' `toString` with the dot-separated path - // and set its `NAME_KEY` - obj[_emberMetal.NAME_KEY] = paths.join('.'); - - // Support nested namespaces - } else if (obj && obj.isNamespace) { - // Skip aliased namespaces - if (seen[_emberUtils.guidFor(obj)]) { - continue; - } - seen[_emberUtils.guidFor(obj)] = true; - - // Process the child namespace - processNamespace(paths, obj, seen); - } - } - - paths.length = idx; // cut out last item - } - - function isUppercase(code) { - return code >= 65 && // A - code <= 90; // Z - } - - function tryIsNamespace(lookup, prop) { - try { - var obj = lookup[prop]; - return obj && obj.isNamespace && obj; - } catch (e) { - // continue - } - } - - function findNamespaces() { - if (Namespace.PROCESSED) { - return; - } - var lookup = _emberEnvironment.context.lookup; - var keys = Object.keys(lookup); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - // Only process entities that start with uppercase A-Z - if (!isUppercase(key.charCodeAt(0))) { - continue; - } - var obj = tryIsNamespace(lookup, key); - if (obj) { - obj[_emberMetal.NAME_KEY] = key; - } - } - } - - function superClassString(mixin) { - var superclass = mixin.superclass; - if (superclass) { - if (superclass[_emberMetal.NAME_KEY]) { - return superclass[_emberMetal.NAME_KEY]; - } - return superClassString(superclass); - } - } - - function classToString() { - if (!searchDisabled && !this[_emberMetal.NAME_KEY]) { - processAllNamespaces(); - } - - var ret = undefined; - - if (this[_emberMetal.NAME_KEY]) { - ret = this[_emberMetal.NAME_KEY]; - } else if (this._toString) { - ret = this._toString; - } else { - var str = superClassString(this); - if (str) { - ret = '(subclass of ' + str + ')'; - } else { - ret = '(unknown mixin)'; - } - this.toString = makeToString(ret); - } - - return ret; - } - - function processAllNamespaces() { - var unprocessedNamespaces = !Namespace.PROCESSED; - var unprocessedMixins = _emberMetal.hasUnprocessedMixins(); - - if (unprocessedNamespaces) { - findNamespaces(); - Namespace.PROCESSED = true; - } - - if (unprocessedNamespaces || unprocessedMixins) { - var namespaces = Namespace.NAMESPACES; - var namespace = undefined; - - for (var i = 0; i < namespaces.length; i++) { - namespace = namespaces[i]; - processNamespace([namespace.toString()], namespace, {}); - } - - _emberMetal.clearUnprocessedMixins(); - } - } - - function makeToString(ret) { - return function () { - return ret; - }; - } - - _emberMetal.Mixin.prototype.toString = classToString; // ES6TODO: altering imported objects. SBB. - - exports.default = Namespace; -}); -// Preloaded into namespaces -enifed('ember-runtime/system/native_array', ['exports', 'ember-metal', 'ember-environment', '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, _emberMetal, _emberEnvironment, _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. - - /** - The NativeArray mixin contains the properties needed to make the native - Array support Ember.MutableArray and all of its dependent APIs. Unless you - have `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Array` set to - false, this will be applied automatically. Otherwise you can apply the mixin - at anytime by calling `Ember.NativeArray.apply(Array.prototype)`. - - @class NativeArray - @namespace Ember - @uses Ember.MutableArray - @uses Ember.Observable - @uses Ember.Copyable - @public - */ - var NativeArray = _emberMetal.Mixin.create(_emberRuntimeMixinsMutable_array.default, _emberRuntimeMixinsObservable.default, _emberRuntimeMixinsCopyable.default, { - - // because length is a built-in property we need to know to just get the - // original property. - get: function (key) { - if ('number' === typeof key) { - return this[key]; - } else { - return this._super(key); - } - }, - - objectAt: function (idx) { - return this[idx]; - }, - - // primitive for array support. - replace: function (idx, amt, objects) { - if (this.isFrozen) { - throw _emberRuntimeMixinsFreezable.FROZEN_ERROR; - } - - // if we replaced exactly the same number of items, then pass only the - // replaced range. Otherwise, pass the full remaining array length - // since everything has shifted - var len = objects ? _emberMetal.get(objects, 'length') : 0; - _emberRuntimeMixinsArray.arrayContentWillChange(this, idx, amt, len); - - if (len === 0) { - this.splice(idx, amt); - } else { - _emberMetal.replace(this, idx, amt, objects); - } - - _emberRuntimeMixinsArray.arrayContentDidChange(this, idx, amt, len); - return this; - }, - - // If you ask for an unknown property, then try to collect the value - // from member items. - unknownProperty: function (key, value) { - var ret = undefined; // = this.reducedProperty(key, value); - if (value !== undefined && ret === undefined) { - ret = this[key] = value; - } - return ret; - }, - - indexOf: Array.prototype.indexOf, - lastIndexOf: Array.prototype.lastIndexOf, - - copy: function (deep) { - if (deep) { - return this.map(function (item) { - return _emberRuntimeCopy.default(item, true); - }); - } - - return this.slice(); - } - }); - - // Remove any methods implemented natively so we don't override them - var ignore = ['length']; - NativeArray.keys().forEach(function (methodName) { - if (Array.prototype[methodName]) { - ignore.push(methodName); - } - }); - - 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 - `EmberENV.EXTEND_PROTOTYPES` is `true` (the default value). However, - it is recommended that you use Ember.A when creating addons for - ember or when you can not guarantee that `EmberENV.EXTEND_PROTOTYPES` - will be `true`. - - Example - - ```js - export default Ember.Component.extend({ - tagName: 'ul', - classNames: ['pagination'], - - init() { - this._super(...arguments); - - if (!this.get('content')) { - this.set('content', Ember.A()); - } - } - }); - ``` - - @method A - @for Ember - @return {Ember.NativeArray} - @public - */ - var A = undefined; - - if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.Array) { - NativeArray.apply(Array.prototype); - exports.A = A = function (arr) { - return arr || []; - }; - } else { - exports.A = A = function (arr) { - if (!arr) { - arr = []; - } - return _emberRuntimeMixinsArray.default.detect(arr) ? arr : NativeArray.apply(arr); - }; - } - - _emberMetal.default.A = A; - exports.A = A; - exports.NativeArray = NativeArray; - exports.default = NativeArray; -}); -// Ember.A circular -enifed('ember-runtime/system/object', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/system/core_object', 'ember-runtime/mixins/observable'], function (exports, _emberUtils, _emberMetal, _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. - - @class Object - @namespace Ember - @extends Ember.CoreObject - @uses Ember.Observable - @public - */ - var EmberObject = _emberRuntimeSystemCore_object.default.extend(_emberRuntimeMixinsObservable.default); - EmberObject.toString = function () { - return 'Ember.Object'; - }; - - var FrameworkObject = EmberObject; - - exports.FrameworkObject = FrameworkObject; - exports.default = EmberObject; -}); -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. - - ```javascript - object = Ember.Object.create({ - name: 'Foo' - }); - - proxy = Ember.ObjectProxy.create({ - content: object - }); - - // Access and change existing properties - proxy.get('name') // 'Foo' - proxy.set('name', 'Bar'); - object.get('name') // 'Bar' - - // Create new 'description' property on `object` - proxy.set('description', 'Foo is a whizboo baz'); - object.get('description') // 'Foo is a whizboo baz' - ``` - - While `content` is unset, setting a property to be delegated will throw an - Error. - - ```javascript - proxy = Ember.ObjectProxy.create({ - content: null, - flag: null - }); - proxy.set('flag', true); - proxy.get('flag'); // true - proxy.get('foo'); // undefined - proxy.set('foo', 'data'); // throws Error - ``` - - Delegated properties can be bound to and will change when content is updated. - - Computed properties on the proxy itself can depend on delegated properties. - - ```javascript - ProxyWithComputedProperty = Ember.ObjectProxy.extend({ - fullName: Ember.computed('firstName', 'lastName', function() { - var firstName = this.get('firstName'), - lastName = this.get('lastName'); - if (firstName && lastName) { - return firstName + ' ' + lastName; - } - return firstName || lastName; - }) - }); - - proxy = ProxyWithComputedProperty.create(); - - proxy.get('fullName'); // undefined - proxy.set('content', { - firstName: 'Tom', lastName: 'Dale' - }); // triggers property change for fullName on proxy - - proxy.get('fullName'); // 'Tom Dale' - ``` - - @class ObjectProxy - @namespace Ember - @extends Ember.Object - @extends Ember._ProxyMixin - @public - */ - - 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. - - Example: - - ```javascript - App.ApplicationRoute = Ember.Route.extend({ - authManager: Ember.inject.service('auth'), - - model: function() { - return this.get('authManager').findCurrentUser(); - } - }); - ``` - - This example will create an `authManager` property on the application route - that looks up the `auth` service in the container, making it easily - accessible in the `model` hook. - - @method service - @since 1.10.0 - @for Ember.inject - @param {String} name (optional) name of the service to inject, defaults to - the property's name - @return {Ember.InjectedProperty} injection descriptor instance - @public - */ - _emberRuntimeInject.createInjectionHelper('service'); - - /** - @class Service - @namespace Ember - @extends Ember.Object - @since 1.10.0 - @public - */ - var Service = _emberRuntimeSystemObject.default.extend(); - - Service.reopenClass({ - isServiceFactory: true - }); - - exports.default = Service; -}); -enifed('ember-runtime/system/string', ['exports', 'ember-metal', 'ember-utils', 'ember-runtime/utils', 'ember-runtime/string_registry'], function (exports, _emberMetal, _emberUtils, _emberRuntimeUtils, _emberRuntimeString_registry) { - /** - @module ember - @submodule ember-runtime - */ - 'use strict'; - - var STRING_DASHERIZE_REGEXP = /[ _]/g; - - var STRING_DASHERIZE_CACHE = new _emberMetal.Cache(1000, function (key) { - return decamelize(key).replace(STRING_DASHERIZE_REGEXP, '-'); - }); - - var STRING_CAMELIZE_REGEXP_1 = /(\-|\_|\.|\s)+(.)?/g; - var STRING_CAMELIZE_REGEXP_2 = /(^|\/)([A-Z])/g; - - var CAMELIZE_CACHE = new _emberMetal.Cache(1000, function (key) { - return key.replace(STRING_CAMELIZE_REGEXP_1, function (match, separator, chr) { - return chr ? chr.toUpperCase() : ''; - }).replace(STRING_CAMELIZE_REGEXP_2, function (match, separator, chr) { - return match.toLowerCase(); - }); - }); - - var STRING_CLASSIFY_REGEXP_1 = /^(\-|_)+(.)?/; - var STRING_CLASSIFY_REGEXP_2 = /(.)(\-|\_|\.|\s)+(.)?/g; - var STRING_CLASSIFY_REGEXP_3 = /(^|\/|\.)([a-z])/g; - - var CLASSIFY_CACHE = new _emberMetal.Cache(1000, function (str) { - var replace1 = function (match, separator, chr) { - return chr ? '_' + chr.toUpperCase() : ''; - }; - var replace2 = function (match, initialChar, separator, chr) { - return initialChar + (chr ? chr.toUpperCase() : ''); - }; - var parts = str.split('/'); - for (var i = 0; i < parts.length; i++) { - parts[i] = parts[i].replace(STRING_CLASSIFY_REGEXP_1, replace1).replace(STRING_CLASSIFY_REGEXP_2, replace2); - } - return parts.join('/').replace(STRING_CLASSIFY_REGEXP_3, function (match, separator, chr) { - return match.toUpperCase(); - }); - }); - - var STRING_UNDERSCORE_REGEXP_1 = /([a-z\d])([A-Z]+)/g; - var STRING_UNDERSCORE_REGEXP_2 = /\-|\s+/g; - - var UNDERSCORE_CACHE = new _emberMetal.Cache(1000, function (str) { - return str.replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2').replace(STRING_UNDERSCORE_REGEXP_2, '_').toLowerCase(); - }); - - var STRING_CAPITALIZE_REGEXP = /(^|\/)([a-z])/g; - - var CAPITALIZE_CACHE = new _emberMetal.Cache(1000, function (str) { - return str.replace(STRING_CAPITALIZE_REGEXP, function (match, separator, chr) { - return match.toUpperCase(); - }); - }); - - var STRING_DECAMELIZE_REGEXP = /([a-z\d])([A-Z])/g; - - var DECAMELIZE_CACHE = new _emberMetal.Cache(1000, function (str) { - return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase(); - }); - - function _fmt(str, formats) { - var cachedFormats = formats; - - if (!_emberRuntimeUtils.isArray(cachedFormats) || arguments.length > 2) { - cachedFormats = new Array(arguments.length - 1); - - for (var i = 1; i < arguments.length; i++) { - cachedFormats[i - 1] = arguments[i]; - } - } - - // first, replace any ORDERED replacements. - var idx = 0; // the current index for non-numerical replacements - return str.replace(/%@([0-9]+)?/g, function (s, argIndex) { - argIndex = argIndex ? parseInt(argIndex, 10) - 1 : idx++; - s = cachedFormats[argIndex]; - return s === null ? '(null)' : s === undefined ? '' : _emberUtils.inspect(s); - }); - } - - function fmt(str, formats) { - return _fmt.apply(undefined, arguments); - } - - function loc(str, formats) { - if (!_emberRuntimeUtils.isArray(formats) || arguments.length > 2) { - formats = Array.prototype.slice.call(arguments, 1); - } - - str = _emberRuntimeString_registry.get(str) || str; - return _fmt(str, formats); - } - - function w(str) { - return str.split(/\s+/); - } - - function decamelize(str) { - return DECAMELIZE_CACHE.get(str); - } - - function dasherize(str) { - return STRING_DASHERIZE_CACHE.get(str); - } - - function camelize(str) { - return CAMELIZE_CACHE.get(str); - } - - function classify(str) { - return CLASSIFY_CACHE.get(str); - } - - function underscore(str) { - return UNDERSCORE_CACHE.get(str); - } - - function capitalize(str) { - return CAPITALIZE_CACHE.get(str); - } - - /** - Defines string helper methods including string formatting and localization. - Unless `EmberENV.EXTEND_PROTOTYPES.String` is `false` these methods will also be - added to the `String.prototype` as well. - - @class String - @namespace Ember - @static - @public - */ - exports.default = { - /** - Apply formatting options to the string. This will look for occurrences - of "%@" in your string and substitute them with the arguments you pass into - this method. If you want to control the specific order of replacement, - you can add a number after the key as well to indicate which argument - you want to insert. - Ordered insertions are most useful when building loc strings where values - you need to insert may appear in different orders. - ```javascript - "Hello %@ %@".fmt('John', 'Doe'); // "Hello John Doe" - "Hello %@2, %@1".fmt('John', 'Doe'); // "Hello Doe, John" - ``` - @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: http://babeljs.io/docs/learn-es2015/#template-strings - */ - fmt: fmt, - - /** - Formats the passed string, but first looks up the string in the localized - strings hash. This is a convenient way to localize text. See - `Ember.String.fmt()` for more information on formatting. - Note that it is traditional but not required to prefix localized string - keys with an underscore or other character so you can easily identify - localized strings. - ```javascript - Ember.STRINGS = { - '_Hello World': 'Bonjour le monde', - '_Hello %@ %@': 'Bonjour %@ %@' - }; - Ember.String.loc("_Hello World"); // 'Bonjour le monde'; - Ember.String.loc("_Hello %@ %@", ["John", "Smith"]); // "Bonjour John Smith"; - ``` - @method loc - @param {String} str The string to format - @param {Array} formats Optional array of parameters to interpolate into string. - @return {String} formatted string - @public - */ - loc: loc, - - /** - Splits a string into separate units separated by spaces, eliminating any - empty strings in the process. This is a convenience method for split that - is mostly useful when applied to the `String.prototype`. - ```javascript - Ember.String.w("alpha beta gamma").forEach(function(key) { - console.log(key); - }); - // > alpha - // > beta - // > gamma - ``` - @method w - @param {String} str The string to split - @return {Array} array containing the split strings - @public - */ - w: w, - - /** - Converts a camelized string into all lower case separated by underscores. - ```javascript - 'innerHTML'.decamelize(); // 'inner_html' - 'action_name'.decamelize(); // 'action_name' - 'css-class-name'.decamelize(); // 'css-class-name' - 'my favorite items'.decamelize(); // 'my favorite items' - ``` - @method decamelize - @param {String} str The string to decamelize. - @return {String} the decamelized string. - @public - */ - decamelize: decamelize, - - /** - Replaces underscores, spaces, or camelCase with dashes. - ```javascript - 'innerHTML'.dasherize(); // 'inner-html' - 'action_name'.dasherize(); // 'action-name' - 'css-class-name'.dasherize(); // 'css-class-name' - 'my favorite items'.dasherize(); // 'my-favorite-items' - 'privateDocs/ownerInvoice'.dasherize(); // 'private-docs/owner-invoice' - ``` - @method dasherize - @param {String} str The string to dasherize. - @return {String} the dasherized string. - @public - */ - dasherize: dasherize, - - /** - Returns the lowerCamelCase form of a string. - ```javascript - 'innerHTML'.camelize(); // 'innerHTML' - 'action_name'.camelize(); // 'actionName' - 'css-class-name'.camelize(); // 'cssClassName' - 'my favorite items'.camelize(); // 'myFavoriteItems' - 'My Favorite Items'.camelize(); // 'myFavoriteItems' - 'private-docs/owner-invoice'.camelize(); // 'privateDocs/ownerInvoice' - ``` - @method camelize - @param {String} str The string to camelize. - @return {String} the camelized string. - @public - */ - camelize: camelize, - - /** - Returns the UpperCamelCase form of a string. - ```javascript - 'innerHTML'.classify(); // 'InnerHTML' - 'action_name'.classify(); // 'ActionName' - 'css-class-name'.classify(); // 'CssClassName' - 'my favorite items'.classify(); // 'MyFavoriteItems' - 'private-docs/owner-invoice'.classify(); // 'PrivateDocs/OwnerInvoice' - ``` - @method classify - @param {String} str the string to classify - @return {String} the classified string - @public - */ - classify: classify, - - /** - More general than decamelize. Returns the lower\_case\_and\_underscored - form of a string. - ```javascript - 'innerHTML'.underscore(); // 'inner_html' - 'action_name'.underscore(); // 'action_name' - 'css-class-name'.underscore(); // 'css_class_name' - 'my favorite items'.underscore(); // 'my_favorite_items' - 'privateDocs/ownerInvoice'.underscore(); // 'private_docs/owner_invoice' - ``` - @method underscore - @param {String} str The string to underscore. - @return {String} the underscored string. - @public - */ - underscore: underscore, - - /** - Returns the Capitalized form of a string - ```javascript - 'innerHTML'.capitalize() // 'InnerHTML' - 'action_name'.capitalize() // 'Action_name' - 'css-class-name'.capitalize() // 'Css-class-name' - 'my favorite items'.capitalize() // 'My favorite items' - 'privateDocs/ownerInvoice'.capitalize(); // 'PrivateDocs/ownerInvoice' - ``` - @method capitalize - @param {String} str The string to capitalize. - @return {String} The capitalized string. - @public - */ - capitalize: capitalize - }; - exports.fmt = fmt; - exports.loc = loc; - exports.w = w; - exports.decamelize = decamelize; - exports.dasherize = dasherize; - exports.camelize = camelize; - exports.classify = classify; - exports.underscore = underscore; - exports.capitalize = capitalize; -}); -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 - // - var TYPE_MAP = { - '[object Boolean]': 'boolean', - '[object Number]': 'number', - '[object String]': 'string', - '[object Function]': 'function', - '[object Array]': 'array', - '[object Date]': 'date', - '[object RegExp]': 'regexp', - '[object Object]': 'object', - '[object FileList]': 'filelist' - }; - - var toString = Object.prototype.toString; - - /** - Returns true if the passed object is an array or Array-like. - - Objects are considered Array-like if any of the following are true: - - - the object is a native Array - - the object has an objectAt property - - the object is an Object, and has a length property - - Unlike `Ember.typeOf` this method returns true even if the passed object is - not formally an array but appears to be array-like (i.e. implements `Ember.Array`) - - ```javascript - Ember.isArray(); // false - Ember.isArray([]); // true - Ember.isArray(Ember.ArrayProxy.create({ content: [] })); // true - ``` - - @method isArray - @for Ember - @param {Object} obj The object to test - @return {Boolean} true if the passed object is an array or Array-like - @public - */ - - function isArray(obj) { - if (!obj || obj.setInterval) { - return false; - } - if (Array.isArray(obj)) { - return true; - } - if (_emberRuntimeMixinsArray.default.detect(obj)) { - return true; - } - - var type = typeOf(obj); - if ('array' === type) { - return true; - } - if (obj.length !== undefined && 'object' === type) { - return true; - } - return false; - } - - /** - Returns a consistent type for the passed object. - - Use this instead of the built-in `typeof` to get the type of an item. - It will return the same result across all browsers and includes a bit - more detail. Here is what will be returned: - - | Return Value | Meaning | - |---------------|------------------------------------------------------| - | 'string' | String primitive or String object. | - | 'number' | Number primitive or Number object. | - | 'boolean' | Boolean primitive or Boolean object. | - | 'null' | Null value | - | 'undefined' | Undefined value | - | 'function' | A function | - | 'array' | An instance of Array | - | 'regexp' | An instance of RegExp | - | 'date' | An instance of Date | - | 'filelist' | An instance of FileList | - | 'class' | An Ember class (created using Ember.Object.extend()) | - | 'instance' | An Ember object instance | - | 'error' | An instance of the Error object | - | 'object' | A JavaScript object not inheriting from Ember.Object | - - Examples: - - ```javascript - Ember.typeOf(); // 'undefined' - Ember.typeOf(null); // 'null' - Ember.typeOf(undefined); // 'undefined' - Ember.typeOf('michael'); // 'string' - Ember.typeOf(new String('michael')); // 'string' - Ember.typeOf(101); // 'number' - Ember.typeOf(new Number(101)); // 'number' - Ember.typeOf(true); // 'boolean' - Ember.typeOf(new Boolean(true)); // 'boolean' - Ember.typeOf(Ember.makeArray); // 'function' - Ember.typeOf([1, 2, 90]); // 'array' - Ember.typeOf(/abc/); // 'regexp' - Ember.typeOf(new Date()); // 'date' - Ember.typeOf(event.target.files); // 'filelist' - Ember.typeOf(Ember.Object.extend()); // 'class' - Ember.typeOf(Ember.Object.create()); // 'instance' - Ember.typeOf(new Error('teamocil')); // 'error' - - // 'normal' JavaScript object - Ember.typeOf({ a: 'b' }); // 'object' - ``` - - @method typeOf - @for Ember - @param {Object} item the item to check - @return {String} the type - @public - */ - - function typeOf(item) { - if (item === null) { - return 'null'; - } - if (item === undefined) { - return 'undefined'; - } - var ret = TYPE_MAP[toString.call(item)] || 'object'; - - if (ret === 'function') { - if (_emberRuntimeSystemObject.default.detect(item)) { - ret = 'class'; - } - } else if (ret === 'object') { - if (item instanceof Error) { - ret = 'error'; - } else if (item instanceof _emberRuntimeSystemObject.default) { - ret = 'instance'; - } else if (item instanceof Date) { - ret = 'date'; - } - } - - return ret; - } -}); -enifed("ember-utils/apply-str", ["exports"], function (exports) { - /** - @param {Object} t target - @param {String} m method - @param {Array} a args - @private - */ - "use strict"; - - exports.default = applyStr; - - function applyStr(t, m, a) { - var l = a && a.length; - if (!a || !l) { - return t[m](); - } - switch (l) { - case 1: - return t[m](a[0]); - case 2: - return t[m](a[0], a[1]); - case 3: - return t[m](a[0], a[1], a[2]); - case 4: - return t[m](a[0], a[1], a[2], a[3]); - case 5: - return t[m](a[0], a[1], a[2], a[3], a[4]); - default: - return t[m].apply(t, a); - } - } -}); -enifed("ember-utils/assign", ["exports"], function (exports) { - /** - Copy properties from a source object to a target object. - - ```javascript - var a = { first: 'Yehuda' }; - var b = { last: 'Katz' }; - var c = { company: 'Tilde Inc.' }; - Ember.assign(a, b, c); // a === { first: 'Yehuda', last: 'Katz', company: 'Tilde Inc.' }, b === { last: 'Katz' }, c === { company: 'Tilde Inc.' } - ``` - - @method assign - @for Ember - @param {Object} original The object to assign into - @param {Object} ...args The objects to copy properties from - @return {Object} - @public - */ - "use strict"; - - exports.default = assign; - - function assign(original) { - for (var i = 1; i < arguments.length; i++) { - var arg = arguments[i]; - if (!arg) { - continue; - } - - var updates = Object.keys(arg); - - for (var _i = 0; _i < updates.length; _i++) { - var prop = updates[_i]; - original[prop] = arg[prop]; - } - } - - return original; - } -}); -enifed('ember-utils/dictionary', ['exports', 'ember-utils/empty-object'], function (exports, _emberUtilsEmptyObject) { - 'use strict'; - - 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. - - function makeDictionary(parent) { - var dict = undefined; - if (parent === null) { - dict = new _emberUtilsEmptyObject.default(); - } else { - dict = Object.create(parent); - } - dict['_dict'] = null; - delete dict['_dict']; - return dict; - } -}); -enifed("ember-utils/empty-object", ["exports"], function (exports) { - // This exists because `Object.create(null)` is absurdly slow compared - // to `new EmptyObject()`. In either case, you want a null prototype - // when you're treating the object instances as arbitrary dictionaries - // and don't want your keys colliding with build-in methods on the - // default object prototype. - - "use strict"; - - var proto = Object.create(null, { - // without this, we will always still end up with (new - // EmptyObject()).constructor === Object - constructor: { - value: undefined, - enumerable: false, - writable: true - } - }); - - function EmptyObject() {} - EmptyObject.prototype = proto; - exports.default = EmptyObject; -}); -enifed('ember-utils/guid', ['exports', 'ember-utils/intern'], function (exports, _emberUtilsIntern) { - 'use strict'; - - exports.uuid = uuid; - exports.generateGuid = generateGuid; - exports.guidFor = guidFor; - - /** - Previously we used `Ember.$.uuid`, however `$.uuid` has been removed from - jQuery master. We'll just bootstrap our own uuid now. - - @private - @return {Number} the uuid - */ - var _uuid = 0; - - /** - Generates a universally unique identifier. This method - is used internally by Ember for assisting with - the generation of GUID's and other unique identifiers. - - @public - @return {Number} [description] - */ - - function uuid() { - return ++_uuid; - } - - /** - Prefix used for guids through out Ember. - @private - @property GUID_PREFIX - @for Ember - @type String - @final - */ - var GUID_PREFIX = 'ember'; - - // Used for guid generation... - var numberCache = []; - var stringCache = {}; - - /** - A unique key used to assign guids and other private metadata to objects. - If you inspect an object in your browser debugger you will often see these. - They can be safely ignored. - - On browsers that support it, these properties are added with enumeration - disabled so they won't show up when you iterate over your properties. - - @private - @property GUID_KEY - @for Ember - @type String - @final - */ - var GUID_KEY = _emberUtilsIntern.default('__ember' + +new Date()); - - exports.GUID_KEY = GUID_KEY; - var GUID_DESC = { - writable: true, - configurable: true, - enumerable: false, - value: null - }; - - exports.GUID_DESC = GUID_DESC; - var nullDescriptor = { - configurable: true, - writable: true, - enumerable: false, - value: null - }; - - var GUID_KEY_PROPERTY = { - name: GUID_KEY, - descriptor: nullDescriptor - }; - - exports.GUID_KEY_PROPERTY = GUID_KEY_PROPERTY; - /** - Generates a new guid, optionally saving the guid to the object that you - pass in. You will rarely need to use this method. Instead you should - call `Ember.guidFor(obj)`, which return an existing guid if available. - - @private - @method generateGuid - @for Ember - @param {Object} [obj] Object the guid will be used for. If passed in, the guid will - be saved on the object and reused whenever you pass the same object - again. - - If no object is passed, just generate a new guid. - @param {String} [prefix] Prefix to place in front of the guid. Useful when you want to - separate the guid into separate namespaces. - @return {String} the guid - */ - - function generateGuid(obj, prefix) { - if (!prefix) { - prefix = GUID_PREFIX; - } - - var ret = prefix + uuid(); - if (obj) { - if (obj[GUID_KEY] === null) { - obj[GUID_KEY] = ret; - } else { - GUID_DESC.value = ret; - if (obj.__defineNonEnumerable) { - obj.__defineNonEnumerable(GUID_KEY_PROPERTY); - } else { - Object.defineProperty(obj, GUID_KEY, GUID_DESC); - } - } - } - return ret; - } - - /** - Returns a unique id for the object. If the object does not yet have a guid, - one will be assigned to it. You can call this on any object, - `Ember.Object`-based or not, but be aware that it will add a `_guid` - property. - - You can also use this method on DOM Element objects. - - @public - @method guidFor - @for Ember - @param {Object} obj any object, string, number, Element, or primitive - @return {String} the unique guid for this instance. - */ - - function guidFor(obj) { - var type = typeof obj; - var isObject = type === 'object' && obj !== null; - var isFunction = type === 'function'; - - if ((isObject || isFunction) && obj[GUID_KEY]) { - return obj[GUID_KEY]; - } - - // special cases where we don't want to add a key to object - if (obj === undefined) { - return '(undefined)'; - } - - if (obj === null) { - return '(null)'; - } - - var ret = undefined; - - // Don't allow prototype changes to String etc. to change the guidFor - switch (type) { - case 'number': - ret = numberCache[obj]; - - if (!ret) { - ret = numberCache[obj] = 'nu' + obj; - } - - return ret; - - case 'string': - ret = stringCache[obj]; - - if (!ret) { - ret = stringCache[obj] = 'st' + uuid(); - } - - return ret; - - case 'boolean': - return obj ? '(true)' : '(false)'; - - default: - if (obj === Object) { - return '(Object)'; - } - - if (obj === Array) { - return '(Array)'; - } - - ret = GUID_PREFIX + uuid(); - - if (obj[GUID_KEY] === null) { - obj[GUID_KEY] = ret; - } else { - GUID_DESC.value = ret; - - if (obj.__defineNonEnumerable) { - obj.__defineNonEnumerable(GUID_KEY_PROPERTY); - } else { - Object.defineProperty(obj, GUID_KEY, GUID_DESC); - } - } - return ret; - } - } -}); -enifed('ember-utils/index', ['exports', 'ember-utils/symbol', 'ember-utils/owner', 'ember-utils/assign', 'ember-utils/empty-object', 'ember-utils/dictionary', 'ember-utils/guid', 'ember-utils/intern', 'ember-utils/super', 'ember-utils/inspect', 'ember-utils/lookup-descriptor', 'ember-utils/invoke', 'ember-utils/make-array', 'ember-utils/apply-str', 'ember-utils/to-string'], function (exports, _emberUtilsSymbol, _emberUtilsOwner, _emberUtilsAssign, _emberUtilsEmptyObject, _emberUtilsDictionary, _emberUtilsGuid, _emberUtilsIntern, _emberUtilsSuper, _emberUtilsInspect, _emberUtilsLookupDescriptor, _emberUtilsInvoke, _emberUtilsMakeArray, _emberUtilsApplyStr, _emberUtilsToString) { - /* - This package will be eagerly parsed and should have no dependencies on external - packages. - - It is intended to be used to share utility methods that will be needed - by every Ember application (and is **not** a dumping ground of useful utilities). - - Utility methods that are needed in < 80% of cases should be placed - elsewhere (so they can be lazily evaluated / parsed). - */ - 'use strict'; - - exports.symbol = _emberUtilsSymbol.default; - exports.getOwner = _emberUtilsOwner.getOwner; - exports.setOwner = _emberUtilsOwner.setOwner; - exports.OWNER = _emberUtilsOwner.OWNER; - exports.assign = _emberUtilsAssign.default; - exports.EmptyObject = _emberUtilsEmptyObject.default; - exports.dictionary = _emberUtilsDictionary.default; - exports.uuid = _emberUtilsGuid.uuid; - exports.GUID_KEY = _emberUtilsGuid.GUID_KEY; - exports.GUID_DESC = _emberUtilsGuid.GUID_DESC; - exports.GUID_KEY_PROPERTY = _emberUtilsGuid.GUID_KEY_PROPERTY; - exports.generateGuid = _emberUtilsGuid.generateGuid; - exports.guidFor = _emberUtilsGuid.guidFor; - exports.intern = _emberUtilsIntern.default; - exports.checkHasSuper = _emberUtilsSuper.checkHasSuper; - exports.ROOT = _emberUtilsSuper.ROOT; - exports.wrap = _emberUtilsSuper.wrap; - exports.inspect = _emberUtilsInspect.default; - exports.lookupDescriptor = _emberUtilsLookupDescriptor.default; - exports.canInvoke = _emberUtilsInvoke.canInvoke; - exports.tryInvoke = _emberUtilsInvoke.tryInvoke; - exports.makeArray = _emberUtilsMakeArray.default; - exports.applyStr = _emberUtilsApplyStr.default; - exports.toString = _emberUtilsToString.default; -}); -enifed('ember-utils/inspect', ['exports'], function (exports) { - 'use strict'; - - exports.default = inspect; - var objectToString = Object.prototype.toString; - - /** - Convenience method to inspect an object. This method will attempt to - convert the object into a useful string description. - - It is a pretty simple implementation. If you want something more robust, - use something like JSDump: https://github.com/NV/jsDump - - @method inspect - @for Ember - @param {Object} obj The object you want to inspect. - @return {String} A description of the object - @since 1.4.0 - @private - */ - - function inspect(obj) { - if (obj === null) { - return 'null'; - } - if (obj === undefined) { - return 'undefined'; - } - if (Array.isArray(obj)) { - return '[' + obj + ']'; - } - // for non objects - var type = typeof obj; - if (type !== 'object' && type !== 'symbol') { - return '' + obj; - } - // overridden toString - if (typeof obj.toString === 'function' && obj.toString !== objectToString) { - return obj.toString(); - } - - // Object.prototype.toString === {}.toString - var v = undefined; - var ret = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - v = obj[key]; - if (v === 'toString') { - continue; - } // ignore useless items - if (typeof v === 'function') { - v = 'function() { ... }'; - } - - if (v && typeof v.toString !== 'function') { - ret.push(key + ': ' + objectToString.call(v)); - } else { - ret.push(key + ': ' + v); - } - } - } - return '{' + ret.join(', ') + '}'; - } -}); -enifed("ember-utils/intern", ["exports"], function (exports) { - /** - Strongly hint runtimes to intern the provided string. - - When do I need to use this function? - - For the most part, never. Pre-mature optimization is bad, and often the - runtime does exactly what you need it to, and more often the trade-off isn't - worth it. - - Why? - - Runtimes store strings in at least 2 different representations: - Ropes and Symbols (interned strings). The Rope provides a memory efficient - data-structure for strings created from concatenation or some other string - manipulation like splitting. - - Unfortunately checking equality of different ropes can be quite costly as - runtimes must resort to clever string comparison algorithms. These - algorithms typically cost in proportion to the length of the string. - Luckily, this is where the Symbols (interned strings) shine. As Symbols are - unique by their string content, equality checks can be done by pointer - comparison. - - How do I know if my string is a rope or symbol? - - Typically (warning general sweeping statement, but truthy in runtimes at - present) static strings created as part of the JS source are interned. - Strings often used for comparisons can be interned at runtime if some - criteria are met. One of these criteria can be the size of the entire rope. - For example, in chrome 38 a rope longer then 12 characters will not - intern, nor will segments of that rope. - - Some numbers: http://jsperf.com/eval-vs-keys/8 - - Known Trick™ - - @private - @return {String} interned version of the provided string - */ - "use strict"; - - exports.default = intern; - - function intern(str) { - var obj = {}; - obj[str] = 1; - for (var key in obj) { - if (key === str) { - return key; - } - } - return str; - } -}); -enifed('ember-utils/invoke', ['exports', 'ember-utils/apply-str'], function (exports, _emberUtilsApplyStr) { - 'use strict'; - - exports.canInvoke = canInvoke; - exports.tryInvoke = tryInvoke; - - /** - Checks to see if the `methodName` exists on the `obj`. - - ```javascript - let foo = { bar: function() { return 'bar'; }, baz: null }; - - Ember.canInvoke(foo, 'bar'); // true - Ember.canInvoke(foo, 'baz'); // false - Ember.canInvoke(foo, 'bat'); // false - ``` - - @method canInvoke - @for Ember - @param {Object} obj The object to check for the method - @param {String} methodName The method name to check for - @return {Boolean} - @private - */ - - function canInvoke(obj, methodName) { - return !!(obj && typeof obj[methodName] === 'function'); - } - - /** - Checks to see if the `methodName` exists on the `obj`, - and if it does, invokes it with the arguments passed. - - ```javascript - let d = new Date('03/15/2013'); - - Ember.tryInvoke(d, 'getTime'); // 1363320000000 - Ember.tryInvoke(d, 'setFullYear', [2014]); // 1394856000000 - Ember.tryInvoke(d, 'noSuchMethod', [2014]); // undefined - ``` - - @method tryInvoke - @for Ember - @param {Object} obj The object to check for the method - @param {String} methodName The method name to check for - @param {Array} [args] The arguments to pass to the method - @return {*} the return value of the invoked method or undefined if it cannot be invoked - @public - */ - - function tryInvoke(obj, methodName, args) { - if (canInvoke(obj, methodName)) { - return args ? _emberUtilsApplyStr.default(obj, methodName, args) : _emberUtilsApplyStr.default(obj, methodName); - } - } -}); -enifed("ember-utils/lookup-descriptor", ["exports"], function (exports) { - "use strict"; - - exports.default = lookupDescriptor; - - function lookupDescriptor(obj, keyName) { - var current = obj; - while (current) { - var descriptor = Object.getOwnPropertyDescriptor(current, keyName); - - if (descriptor) { - return descriptor; - } - - current = Object.getPrototypeOf(current); - } - - return null; - } -}); -enifed("ember-utils/make-array", ["exports"], function (exports) { - /** - Forces the passed object to be part of an array. If the object is already - an array, it will return the object. Otherwise, it will add the object to - an array. If obj is `null` or `undefined`, it will return an empty array. - - ```javascript - Ember.makeArray(); // [] - Ember.makeArray(null); // [] - Ember.makeArray(undefined); // [] - Ember.makeArray('lindsay'); // ['lindsay'] - Ember.makeArray([1, 2, 42]); // [1, 2, 42] - - let controller = Ember.ArrayProxy.create({ content: [] }); - - Ember.makeArray(controller) === controller; // true - ``` - - @method makeArray - @for Ember - @param {Object} obj the object - @return {Array} - @private - */ - "use strict"; - - exports.default = makeArray; - - function makeArray(obj) { - if (obj === null || obj === undefined) { - return []; - } - return Array.isArray(obj) ? obj : [obj]; - } -}); -enifed('ember-utils/owner', ['exports', 'ember-utils/symbol'], function (exports, _emberUtilsSymbol) { - /** - @module ember - @submodule ember-runtime - */ - - 'use strict'; - - exports.getOwner = getOwner; - exports.setOwner = setOwner; - var OWNER = _emberUtilsSymbol.default('OWNER'); - - exports.OWNER = OWNER; - /** - Framework objects in an Ember application (components, services, routes, etc.) - are created via a factory and dependency injection system. Each of these - objects is the responsibility of an "owner", which handled its - instantiation and manages its lifetime. - - `getOwner` fetches the owner object responsible for an instance. This can - be used to lookup or resolve other class instances, or register new factories - into the owner. - - For example, this component dynamically looks up a service based on the - `audioType` passed as an attribute: - - ``` - // app/components/play-audio.js - import Ember from 'ember'; - - // Usage: - // - // {{play-audio audioType=model.audioType audioFile=model.file}} - // - export default Ember.Component.extend({ - audioService: Ember.computed('audioType', function() { - let owner = Ember.getOwner(this); - return owner.lookup(`service:${this.get('audioType')}`); - }), - click() { - let player = this.get('audioService'); - player.play(this.get('audioFile')); - } - }); - ``` - - @method getOwner - @for Ember - @param {Object} object An object with an owner. - @return {Object} An owner object. - @since 2.3.0 - @public - */ - - function getOwner(object) { - return object[OWNER]; - } - - /** - `setOwner` forces a new owner on a given object instance. This is primarily - useful in some testing cases. - - @method setOwner - @for Ember - @param {Object} object An object with an owner. - @return {Object} An owner object. - @since 2.3.0 - @public - */ - - function setOwner(object, owner) { - object[OWNER] = owner; - } -}); -enifed('ember-utils/super', ['exports'], function (exports) { - 'use strict'; - - exports.wrap = wrap; - var HAS_SUPER_PATTERN = /\.(_super|call\(this|apply\(this)/; - var fnToString = Function.prototype.toString; - - var checkHasSuper = (function () { - var sourceAvailable = fnToString.call(function () { - return this; - }).indexOf('return this') > -1; - - if (sourceAvailable) { - return function checkHasSuper(func) { - return HAS_SUPER_PATTERN.test(fnToString.call(func)); - }; - } - - return function checkHasSuper() { - return true; - }; - })(); - - exports.checkHasSuper = checkHasSuper; - function ROOT() {} - ROOT.__hasSuper = false; - - function hasSuper(func) { - if (func.__hasSuper === undefined) { - func.__hasSuper = checkHasSuper(func); - } - return func.__hasSuper; - } - - /** - 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 - @method wrap - @for Ember - @param {Function} func The function to call - @param {Function} superFunc The super function. - @return {Function} wrapped function. - */ - - function wrap(func, superFunc) { - if (!hasSuper(func)) { - return func; - } - // ensure an unwrapped super that calls _super is wrapped with a terminal _super - if (!superFunc.wrappedFunction && hasSuper(superFunc)) { - return _wrap(func, _wrap(superFunc, ROOT)); - } - return _wrap(func, superFunc); - } - - function _wrap(func, superFunc) { - function superWrapper() { - var orig = this._super; - this._super = superFunc; - var ret = func.apply(this, arguments); - this._super = orig; - return ret; - } - - superWrapper.wrappedFunction = func; - superWrapper.__ember_observes__ = func.__ember_observes__; - superWrapper.__ember_observesBefore__ = func.__ember_observesBefore__; - superWrapper.__ember_listens__ = func.__ember_listens__; - - return superWrapper; - } -}); -enifed('ember-utils/symbol', ['exports', 'ember-utils/guid', 'ember-utils/intern'], function (exports, _emberUtilsGuid, _emberUtilsIntern) { - 'use strict'; - - exports.default = symbol; - - function symbol(debugName) { - // TODO: Investigate using platform symbols, but we do not - // want to require non-enumerability for this API, which - // would introduce a large cost. - var id = _emberUtilsGuid.GUID_KEY + Math.floor(Math.random() * new Date()); - return _emberUtilsIntern.default('__' + debugName + '__ [id=' + id + ']'); - } -}); -enifed("ember-utils/to-string", ["exports"], function (exports) { - "use strict"; - - exports.default = toString; - var objectToString = Object.prototype.toString; - - /* - A `toString` util function that supports objects without a `toString` - method, e.g. an object created with `Object.create(null)`. - */ - - function toString(obj) { - if (obj && obj.toString) { - return obj.toString(); - } else { - return objectToString.call(obj); - } - } -}); -enifed('ember-views/compat/attrs', ['exports', 'ember-utils'], function (exports, _emberUtils) { - 'use strict'; - - var MUTABLE_CELL = _emberUtils.symbol('MUTABLE_CELL'); - exports.MUTABLE_CELL = MUTABLE_CELL; -}); -enifed('ember-views/compat/fallback-view-registry', ['exports', 'ember-utils'], function (exports, _emberUtils) { - 'use strict'; - - exports.default = _emberUtils.dictionary(null); -}); -enifed('ember-views/component_lookup', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { - 'use strict'; - - exports.default = _emberRuntime.Object.extend({ - componentFor: function (name, owner, options) { - - var fullName = 'component:' + name; - return owner._lookupFactory(fullName, options); - }, - - layoutFor: function (name, owner, options) { - - var templateFullName = 'template:components/' + name; - return owner.lookup(templateFullName, options); - } - }); -}); -enifed('ember-views/index', ['exports', 'ember-views/system/ext', 'ember-views/system/jquery', 'ember-views/system/utils', 'ember-views/system/event_dispatcher', 'ember-views/component_lookup', 'ember-views/mixins/text_support', 'ember-views/views/core_view', 'ember-views/mixins/class_names_support', 'ember-views/mixins/child_views_support', 'ember-views/mixins/view_state_support', 'ember-views/mixins/view_support', 'ember-views/mixins/action_support', 'ember-views/compat/attrs', 'ember-views/system/lookup_partial', 'ember-views/utils/lookup-component', 'ember-views/system/action_manager', 'ember-views/compat/fallback-view-registry'], function (exports, _emberViewsSystemExt, _emberViewsSystemJquery, _emberViewsSystemUtils, _emberViewsSystemEvent_dispatcher, _emberViewsComponent_lookup, _emberViewsMixinsText_support, _emberViewsViewsCore_view, _emberViewsMixinsClass_names_support, _emberViewsMixinsChild_views_support, _emberViewsMixinsView_state_support, _emberViewsMixinsView_support, _emberViewsMixinsAction_support, _emberViewsCompatAttrs, _emberViewsSystemLookup_partial, _emberViewsUtilsLookupComponent, _emberViewsSystemAction_manager, _emberViewsCompatFallbackViewRegistry) { - /** - @module ember - @submodule ember-views - */ - - 'use strict'; - - exports.jQuery = _emberViewsSystemJquery.default; - exports.isSimpleClick = _emberViewsSystemUtils.isSimpleClick; - exports.getViewBounds = _emberViewsSystemUtils.getViewBounds; - exports.getViewClientRects = _emberViewsSystemUtils.getViewClientRects; - exports.getViewBoundingClientRect = _emberViewsSystemUtils.getViewBoundingClientRect; - exports.getRootViews = _emberViewsSystemUtils.getRootViews; - exports.getChildViews = _emberViewsSystemUtils.getChildViews; - exports.getViewId = _emberViewsSystemUtils.getViewId; - exports.getViewElement = _emberViewsSystemUtils.getViewElement; - exports.setViewElement = _emberViewsSystemUtils.setViewElement; - exports.STYLE_WARNING = _emberViewsSystemUtils.STYLE_WARNING; - exports.EventDispatcher = _emberViewsSystemEvent_dispatcher.default; - exports.ComponentLookup = _emberViewsComponent_lookup.default; - exports.TextSupport = _emberViewsMixinsText_support.default; - exports.CoreView = _emberViewsViewsCore_view.default; - exports.ClassNamesSupport = _emberViewsMixinsClass_names_support.default; - exports.ChildViewsSupport = _emberViewsMixinsChild_views_support.default; - exports.ViewStateSupport = _emberViewsMixinsView_state_support.default; - exports.ViewMixin = _emberViewsMixinsView_support.default; - exports.ActionSupport = _emberViewsMixinsAction_support.default; - exports.MUTABLE_CELL = _emberViewsCompatAttrs.MUTABLE_CELL; - exports.lookupPartial = _emberViewsSystemLookup_partial.default; - exports.hasPartial = _emberViewsSystemLookup_partial.hasPartial; - exports.lookupComponent = _emberViewsUtilsLookupComponent.default; - exports.ActionManager = _emberViewsSystemAction_manager.default; - exports.fallbackViewRegistry = _emberViewsCompatFallbackViewRegistry.default; -}); -// for the side effect of extending Ember.run.queues -enifed('ember-views/mixins/action_support', ['exports', 'ember-utils', 'ember-metal', 'ember-views/compat/attrs'], function (exports, _emberUtils, _emberMetal, _emberViewsCompatAttrs) { - /** - @module ember - @submodule ember-views - */ - 'use strict'; - - function validateAction(component, actionName) { - if (actionName && actionName[_emberViewsCompatAttrs.MUTABLE_CELL]) { - actionName = actionName.value; - } - - return actionName; - } - - /** - @class ActionSupport - @namespace Ember - @private - */ - exports.default = _emberMetal.Mixin.create({ - /** - 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 - export default Ember.Component.extend({ - click() { - if (this.get('isPlaying')) { - this.sendAction('play'); - } else { - this.sendAction('stop'); - } - } - }); - ``` - The actions "play" and "stop" must be passed to this `play-button` component: - ```handlebars - {{! app/templates/application.hbs }} - {{play-button play=(action "musicStarted") stop=(action "musicStopped")}} - ``` - When the component receives a browser `click` event it translate this - interaction into application-specific semantics ("play" or "stop") and - calls the specified action. - ```javascript - // app/controller/application.js - export default Ember.Controller.extend({ - actions: { - musicStarted() { - // called when the play button is clicked - // and the music started playing - }, - musicStopped() { - // called when the play button is clicked - // and the music stopped playing - } - } - }); - ``` - If no action is passed to `sendAction` a default name of "action" - is assumed. - ```javascript - // app/components/next-button.js - export default Ember.Component.extend({ - click() { - this.sendAction(); - } - }); - ``` - ```handlebars - {{! app/templates/application.hbs }} - {{next-button action=(action "playNextSongInAlbum")}} - ``` - ```javascript - // app/controllers/application.js - App.ApplicationController = Ember.Controller.extend({ - actions: { - playNextSongInAlbum() { - ... - } - } - }); - ``` - @method sendAction - @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 = undefined; - - // Send the default action - if (action === undefined) { - action = 'action'; - } - actionName = _emberMetal.get(this, 'attrs.' + action) || _emberMetal.get(this, action); - actionName = validateAction(this, actionName); - - // If no action name for that action could be found, just abort. - if (actionName === undefined) { - return; - } - - if (typeof actionName === 'function') { - actionName.apply(undefined, contexts); - } else { - this.triggerAction({ - action: actionName, - actionContext: contexts - }); - } - }, - - send: function (actionName) { - for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - - var target = undefined; - var action = this.actions && this.actions[actionName]; - - if (action) { - var shouldBubble = action.apply(this, args) === true; - if (!shouldBubble) { - return; - } - } - - target = _emberMetal.get(this, 'target'); - - if (target) { - var _target; - - (_target = target).send.apply(_target, arguments); - } else {} - } - }); -}); -enifed('ember-views/mixins/child_views_support', ['exports', 'ember-utils', 'ember-metal', 'ember-views/system/utils'], function (exports, _emberUtils, _emberMetal, _emberViewsSystemUtils) { - /** - @module ember - @submodule ember-views - */ - 'use strict'; - - exports.default = _emberMetal.Mixin.create({ - init: function () { - this._super.apply(this, arguments); - _emberViewsSystemUtils.initChildViews(this); - }, - - /** - Array of child views. You should never edit this array directly. - @property childViews - @type Array - @default [] - @private - */ - childViews: _emberMetal.descriptor({ - configurable: false, - enumerable: false, - get: function () { - return _emberViewsSystemUtils.getChildViews(this); - } - }), - - appendChild: function (view) { - this.linkChild(view); - _emberViewsSystemUtils.addChildView(this, view); - }, - - linkChild: function (instance) { - if (!_emberUtils.getOwner(instance)) { - _emberUtils.setOwner(instance, _emberUtils.getOwner(this)); - } - } - }); -}); -enifed('ember-views/mixins/class_names_support', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-views - */ - - 'use strict'; - - var EMPTY_ARRAY = Object.freeze([]); - - /** - @class ClassNamesSupport - @namespace Ember - @private - */ - exports.default = _emberMetal.Mixin.create({ - concatenatedProperties: ['classNames', 'classNameBindings'], - - init: function () { - this._super.apply(this, arguments); - - this.classNameBindings = this.classNameBindings.slice(); - - this.classNames = this.classNames.slice(); - }, - - /** - Standard CSS class names to apply to the view's outer element. This - property automatically inherits any class names defined by the view's - superclasses as well. - @property classNames - @type Array - @default ['ember-view'] - @public - */ - classNames: EMPTY_ARRAY, - - /** - A list of properties of the view to apply as class names. If the property - is a string value, the value of that string will be applied as a class - name. - ```javascript - // Applies the 'high' class to the view element - Ember.Component.extend({ - classNameBindings: ['priority'], - priority: 'high' - }); - ``` - If the value of the property is a Boolean, the name of that property is - added as a dasherized class name. - ```javascript - // Applies the 'is-urgent' class to the view element - Ember.Component.extend({ - classNameBindings: ['isUrgent'], - isUrgent: true - }); - ``` - If you would prefer to use a custom value instead of the dasherized - property name, you can pass a binding like this: - ```javascript - // Applies the 'urgent' class to the view element - Ember.Component.extend({ - classNameBindings: ['isUrgent:urgent'], - isUrgent: true - }); - ``` - This list of properties is inherited from the component's superclasses as well. - @property classNameBindings - @type Array - @default [] - @public - */ - classNameBindings: EMPTY_ARRAY - }); -}); -enifed('ember-views/mixins/text_support', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { - /** - @module ember - @submodule ember-views - */ - - 'use strict'; - - var KEY_EVENTS = { - 13: 'insertNewline', - 27: 'cancel' - }; - - /** - `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 - value of the field passed in as the only argument unless the value of - the field is empty. In that case, the instance of the field itself is passed - in as the only argument. - - Let's use the pressing of the escape key as an example. If you wanted to - invoke a controller action when a user presses the escape key while on your - field, you would use the `escape-press` attribute on your field like so: - - ```handlebars - {{! application.hbs}} - - {{input escape-press='alertUser'}} - ``` - - ```javascript - App = Ember.Application.create(); - - App.ApplicationController = Ember.Controller.extend({ - actions: { - alertUser: function ( currentValue ) { - alert( 'escape pressed, current value: ' + currentValue ); - } - } - }); - ``` - - The following chart is a visual representation of what takes place when the - escape key is pressed in this scenario: - - ``` - The Template - +---------------------------+ - | | - | escape-press='alertUser' | - | | TextSupport Mixin - +----+----------------------+ +-------------------------------+ - | | cancel method | - | escape button pressed | | - +-------------------------------> | checks for the `escape-press` | - | attribute and pulls out the | - +-------------------------------+ | `alertUser` value | - | action name 'alertUser' +-------------------------------+ - | sent to controller - v - Controller - +------------------------------------------ + - | | - | actions: { | - | alertUser: function( currentValue ){ | - | alert( 'the esc key was pressed!' ) | - | } | - | } | - | | - +-------------------------------------------+ - ``` - - Here are the events that we currently support along with the name of the - attribute you would need to use on your field. To reiterate, you would use the - attribute name like so: - - ```handlebars - {{input attribute-name='controllerAction'}} - ``` - - ``` - +--------------------+----------------+ - | | | - | event | attribute name | - +--------------------+----------------+ - | new line inserted | insert-newline | - | | | - | enter key pressed | insert-newline | - | | | - | cancel key pressed | escape-press | - | | | - | focusin | focus-in | - | | | - | focusout | focus-out | - | | | - | keypress | key-press | - | | | - | keyup | key-up | - | | | - | keydown | key-down | - +--------------------+----------------+ - ``` - - @class TextSupport - @namespace Ember - @uses Ember.TargetActionSupport - @extends Ember.Mixin - @private - */ - exports.default = _emberMetal.Mixin.create(_emberRuntime.TargetActionSupport, { - value: '', - - attributeBindings: ['autocapitalize', 'autocorrect', 'autofocus', 'disabled', 'form', 'maxlength', 'placeholder', 'readonly', 'required', 'selectionDirection', 'spellcheck', 'tabindex', 'title'], - placeholder: null, - disabled: false, - maxlength: null, - - init: function () { - this._super.apply(this, arguments); - this.on('paste', this, this._elementValueDidChange); - this.on('cut', this, this._elementValueDidChange); - this.on('input', this, this._elementValueDidChange); - }, - - /** - The action to be sent when the user presses the return key. - This is similar to the `{{action}}` helper, but is fired when - the user presses the return key when editing a text field, and sends - the value of the field as the context. - @property action - @type String - @default null - @private - */ - action: null, - - /** - The event that should send the action. - Options are: - * `enter`: the user pressed enter - * `keyPress`: the user pressed a key - @property onEvent - @type String - @default enter - @private - */ - onEvent: 'enter', - - /** - Whether the `keyUp` event that triggers an `action` to be sent continues - propagating to other views. - By default, when the user presses the return key on their keyboard and - the text field has an `action` set, the action will be sent to the view's - controller and the key event will stop propagating. - If you would like parent views to receive the `keyUp` event even after an - action has been dispatched, set `bubbles` to true. - @property bubbles - @type Boolean - @default false - @private - */ - bubbles: false, - - interpretKeyEvents: function (event) { - var map = KEY_EVENTS; - var method = map[event.keyCode]; - - this._elementValueDidChange(); - if (method) { - return this[method](event); - } - }, - - _elementValueDidChange: function () { - _emberMetal.set(this, 'value', this.element.value); - }, - - change: function (event) { - this._elementValueDidChange(event); - }, - - /** - Allows you to specify a controller action to invoke when either the `enter` - key is pressed or, in the case of the field being a textarea, when a newline - is inserted. To use this method, give your field an `insert-newline` - attribute. The value of that attribute should be the name of the action - in your controller that you wish to invoke. - For an example on how to use the `insert-newline` attribute, please - reference the example near the top of this file. - @method insertNewline - @param {Event} event - @private - */ - insertNewline: function (event) { - sendAction('enter', this, event); - sendAction('insert-newline', this, event); - }, - - /** - Allows you to specify a controller action to invoke when the escape button - is pressed. To use this method, give your field an `escape-press` - attribute. The value of that attribute should be the name of the action - in your controller that you wish to invoke. - For an example on how to use the `escape-press` attribute, please reference - the example near the top of this file. - @method cancel - @param {Event} event - @private - */ - cancel: function (event) { - sendAction('escape-press', this, event); - }, - - /** - Allows you to specify a controller action to invoke when a field receives - focus. To use this method, give your field a `focus-in` attribute. The value - of that attribute should be the name of the action in your controller - that you wish to invoke. - For an example on how to use the `focus-in` attribute, please reference the - example near the top of this file. - @method focusIn - @param {Event} event - @private - */ - focusIn: function (event) { - sendAction('focus-in', this, event); - }, - - /** - Allows you to specify a controller action to invoke when a field loses - focus. To use this method, give your field a `focus-out` attribute. The value - of that attribute should be the name of the action in your controller - that you wish to invoke. - For an example on how to use the `focus-out` attribute, please reference the - example near the top of this file. - @method focusOut - @param {Event} event - @private - */ - focusOut: function (event) { - this._elementValueDidChange(event); - sendAction('focus-out', this, event); - }, - - /** - Allows you to specify a controller action to invoke when a key is pressed. - To use this method, give your field a `key-press` attribute. The value of - that attribute should be the name of the action in your controller you - that wish to invoke. - For an example on how to use the `key-press` attribute, please reference the - example near the top of this file. - @method keyPress - @param {Event} event - @private - */ - keyPress: function (event) { - sendAction('key-press', this, event); - }, - - /** - Allows you to specify a controller action to invoke when a key-up event is - fired. To use this method, give your field a `key-up` attribute. The value - of that attribute should be the name of the action in your controller - that you wish to invoke. - For an example on how to use the `key-up` attribute, please reference the - example near the top of this file. - @method keyUp - @param {Event} event - @private - */ - keyUp: function (event) { - this.interpretKeyEvents(event); - - this.sendAction('key-up', _emberMetal.get(this, 'value'), event); - }, - - /** - Allows you to specify a controller action to invoke when a key-down event is - fired. To use this method, give your field a `key-down` attribute. The value - of that attribute should be the name of the action in your controller that - you wish to invoke. - For an example on how to use the `key-down` attribute, please reference the - example near the top of this file. - @method keyDown - @param {Event} event - @private - */ - keyDown: function (event) { - this.sendAction('key-down', _emberMetal.get(this, 'value'), event); - } - }); - - // In principle, this shouldn't be necessary, but the legacy - // sendAction semantics for TextField are different from - // the component semantics so this method normalizes them. - function sendAction(eventName, view, event) { - var action = _emberMetal.get(view, 'attrs.' + eventName) || _emberMetal.get(view, eventName); - var on = _emberMetal.get(view, 'onEvent'); - var value = _emberMetal.get(view, 'value'); - - // back-compat support for keyPress as an event name even though - // it's also a method name that consumes the event (and therefore - // incompatible with sendAction semantics). - if (on === eventName || on === 'keyPress' && eventName === 'key-press') { - view.sendAction('action', value); - } - - view.sendAction(eventName, value); - - if (action || on === eventName) { - if (!_emberMetal.get(view, 'bubbles')) { - event.stopPropagation(); - } - } - } -}); -enifed('ember-views/mixins/view_state_support', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @module ember - @submodule ember-views - */ - 'use strict'; - - exports.default = _emberMetal.Mixin.create({ - _transitionTo: function (state) { - var priorState = this._currentState; - var currentState = this._currentState = this._states[state]; - this._state = state; - - if (priorState && priorState.exit) { - priorState.exit(this); - } - if (currentState.enter) { - currentState.enter(this); - } - } - }); -}); -enifed('ember-views/mixins/view_support', ['exports', 'ember-utils', 'ember-metal', 'ember-environment', 'ember-views/system/utils', 'ember-runtime/system/core_object', 'ember-views/system/jquery'], function (exports, _emberUtils, _emberMetal, _emberEnvironment, _emberViewsSystemUtils, _emberRuntimeSystemCore_object, _emberViewsSystemJquery) { - 'use strict'; - - var _Mixin$create; - - function K() { - return this; - } - - /** - @class ViewMixin - @namespace Ember - @private - */ - exports.default = _emberMetal.Mixin.create((_Mixin$create = { - concatenatedProperties: ['attributeBindings'] - }, _Mixin$create[_emberRuntimeSystemCore_object.POST_INIT] = function () { - this.trigger('didInitAttrs', { attrs: this.attrs }); - this.trigger('didReceiveAttrs', { newAttrs: this.attrs }); - }, _Mixin$create.nearestOfType = function (klass) { - var view = this.parentView; - var isOfType = klass instanceof _emberMetal.Mixin ? function (view) { - return klass.detect(view); - } : function (view) { - return klass.detect(view.constructor); - }; - - while (view) { - if (isOfType(view)) { - return view; - } - view = view.parentView; - } - }, _Mixin$create.nearestWithProperty = function (property) { - var view = this.parentView; - - while (view) { - if (property in view) { - return view; - } - view = view.parentView; - } - }, _Mixin$create.rerender = function () { - return this._currentState.rerender(this); - }, _Mixin$create.element = _emberMetal.descriptor({ - configurable: false, - enumerable: false, - get: function () { - return this.renderer.getElement(this); - } - }), _Mixin$create.$ = function (sel) { - if (this.element) { - return sel ? _emberViewsSystemJquery.default(sel, this.element) : _emberViewsSystemJquery.default(this.element); - } - }, _Mixin$create.appendTo = function (selector) { - var env = this._environment || _emberEnvironment.environment; - var target = undefined; - - if (env.hasDOM) { - target = typeof selector === 'string' ? document.querySelector(selector) : selector; - } else { - target = selector; - } - - this.renderer.appendTo(this, target); - - return this; - }, _Mixin$create.renderToElement = function (tagName) { - tagName = tagName || 'body'; - - var element = this.renderer.createElement(tagName); - - this.renderer.appendTo(this, element); - return element; - }, _Mixin$create.replaceIn = function (selector) { - var target = _emberViewsSystemJquery.default(selector); - - this.renderer.replaceIn(this, target[0]); - - return this; - }, _Mixin$create.append = function () { - return this.appendTo(document.body); - }, _Mixin$create.elementId = null, _Mixin$create.findElementInParentElement = function (parentElem) { - var id = '#' + this.elementId; - return _emberViewsSystemJquery.default(id)[0] || _emberViewsSystemJquery.default(id, parentElem)[0]; - }, _Mixin$create.willInsertElement = K, _Mixin$create.didInsertElement = K, _Mixin$create.willClearRender = K, _Mixin$create.destroy = function () { - this._super.apply(this, arguments); - this._currentState.destroy(this); - }, _Mixin$create.willDestroyElement = K, _Mixin$create.parentViewDidChange = K, _Mixin$create.tagName = null, _Mixin$create.init = function () { - this._super.apply(this, arguments); - - if (!this.elementId && this.tagName !== '') { - this.elementId = _emberUtils.guidFor(this); - } - }, _Mixin$create.__defineNonEnumerable = function (property) { - this[property.name] = property.descriptor.value; - }, _Mixin$create.handleEvent = function (eventName, evt) { - return this._currentState.handleEvent(this, eventName, evt); - }, _Mixin$create)); -}); - -// .......................................................... -// TEMPLATE SUPPORT -// - -/** - Return the nearest ancestor that is an instance of the provided - class or mixin. - @method nearestOfType - @param {Class,Mixin} klass Subclass of Ember.View (or Ember.View itself), - or an instance of Ember.Mixin. - @return Ember.View - @deprecated use `yield` and contextual components for composition instead. - @private -*/ - -/** - Return the nearest ancestor that has a given property. - @method nearestWithProperty - @param {String} property A property name - @return Ember.View - @deprecated use `yield` and contextual components for composition instead. - @private -*/ - -/** - Renders the view again. This will work regardless of whether the - view is already in the DOM or not. If the view is in the DOM, the - rendering process will be deferred to give bindings a chance - to synchronize. - If children were added during the rendering process using `appendChild`, - `rerender` will remove them, because they will be added again - if needed by the next `render`. - In general, if the display of your view changes, you should modify - the DOM element directly instead of manually calling `rerender`, which can - be slow. - @method rerender - @public -*/ - -// .......................................................... -// ELEMENT SUPPORT -// - -/** - Returns the current DOM element for the view. - @property element - @type DOMElement - @public -*/ - -/** - Returns a jQuery object for this view's element. If you pass in a selector - string, this method will return a jQuery object, using the current element - as its buffer. - For example, calling `view.$('li')` will return a jQuery object containing - all of the `li` elements inside the DOM element of this view. - @method $ - @param {String} [selector] a jQuery-compatible selector string - @return {jQuery} the jQuery object for the DOM node - @public -*/ - -/** - Appends the view's element to the specified parent element. - Note that this method just schedules the view to be appended; the DOM - element will not be appended to the given element until all bindings have - finished synchronizing. - This is not typically a function that you will need to call directly when - building your application. If you do need to use `appendTo`, be sure that - the target element you are providing is associated with an `Ember.Application` - and does not have an ancestor element that is associated with an Ember view. - @method appendTo - @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object - @return {Ember.View} receiver - @private -*/ - -/** - 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 - let element = view.renderToElement(); - element.tagName; // => "BODY" - ``` - You can override the kind of element rendered into and returned by - specifying an optional tag name as the first argument. - ```js - let element = view.renderToElement('table'); - element.tagName; // => "TABLE" - ``` - This method is useful if you want to render the view into an element that - is not in the document's body. Instead, a new `body` element, detached from - the DOM is returned. FastBoot uses this to serialize the rendered view into - a string for transmission over the network. - ```js - app.visit('/').then(function(instance) { - let element; - Ember.run(function() { - element = renderToElement(instance); - }); - res.send(serialize(element)); - }); - ``` - @method renderToElement - @param {String} tagName The tag of the element to create and render into. Defaults to "body". - @return {HTMLBodyElement} element - @private -*/ - -/** - Replaces the content of the specified parent element with this view's - element. If the view does not have an HTML representation yet, - the element will be generated automatically. - Note that this method just schedules the view to be appended; the DOM - element will not be appended to the given element until all bindings have - finished synchronizing - @method replaceIn - @param {String|DOMElement|jQuery} target A selector, element, HTML string, or jQuery object - @return {Ember.View} received - @private -*/ - -/** - Appends the view's element to the document body. If the view does - not have an HTML representation yet - the element will be generated automatically. - If your application uses the `rootElement` property, you must append - the view within that element. Rendering views outside of the `rootElement` - is not supported. - Note that this method just schedules the view to be appended; the DOM - element will not be appended to the document body until all bindings have - finished synchronizing. - @method append - @return {Ember.View} receiver - @private -*/ - -/** - The HTML `id` of the view's element in the DOM. You can provide this - value yourself but it must be unique (just as in HTML): - ```handlebars - {{my-component elementId="a-really-cool-id"}} - ``` - If not manually set a default value will be provided by the framework. - Once rendered an element's `elementId` is considered immutable and you - should never change it. If you need to compute a dynamic value for the - `elementId`, you should do this when the component or element is being - instantiated: - ```javascript - export default Ember.Component.extend({ - init() { - this._super(...arguments); - let index = this.get('index'); - this.set('elementId', 'component-id' + index); - } - }); - ``` - @property elementId - @type String - @public -*/ - -/** - Attempts to discover the element in the parent element. The default - implementation looks for an element with an ID of `elementId` (or the - view's guid if `elementId` is null). You can override this method to - provide your own form of lookup. For example, if you want to discover your - element using a CSS class name instead of an ID. - @method findElementInParentElement - @param {DOMElement} parentElement The parent's DOM element - @return {DOMElement} The discovered element - @private -*/ - -/** - Called when a view is going to insert an element into the DOM. - @event willInsertElement - @public -*/ - -/** - Called when the element of the view has been inserted into the DOM. - Override this function to do any set up that requires an element - in the document body. - When a view has children, didInsertElement will be called on the - child view(s) first and on itself afterwards. - @event didInsertElement - @public -*/ - -/** - Called when the view is about to rerender, but before anything has - been torn down. This is a good opportunity to tear down any manual - observers you have installed based on the DOM state - @event willClearRender - @public -*/ - -/** - You must call `destroy` on a view to destroy the view (and all of its - child views). This will remove the view from any parent node, then make - sure that the DOM element managed by the view can be released by the - memory manager. - @method destroy - @private -*/ - -/** - Called when the element of the view is going to be destroyed. Override - this function to do any teardown that requires an element, like removing - event listeners. - Please note: any property changes made during this event will have no - effect on object observers. - @event willDestroyElement - @public -*/ - -/** - Called when the parentView property has changed. - @event parentViewDidChange - @private -*/ - -// .......................................................... -// STANDARD RENDER PROPERTIES -// - -/** - Tag name for the view's outer element. The tag name is only used when an - element is first created. If you change the `tagName` for an element, you - must destroy and recreate the view element. - By default, the render buffer will use a `
    ` tag for views. - @property tagName - @type String - @default null - @public -*/ - -// We leave this null by default so we can tell the difference between -// the default case and a user-specified tag. - -// ....................................................... -// CORE DISPLAY METHODS -// - -/** - Setup a view, but do not finish waking it up. - * configure `childViews` - * register the view with the global views hash, which is used for event - dispatch - @method init - @private -*/ - -// ....................................................... -// EVENT HANDLING -// - -/** - Handle events from `Ember.EventDispatcher` - @method handleEvent - @param eventName {String} - @param evt {Event} - @private -*/ -enifed("ember-views/system/action_manager", ["exports"], function (exports) { - /** - @module ember - @submodule ember-views - */ - - "use strict"; - - exports.default = ActionManager; - - function ActionManager() {} - - /** - Global action id hash. - - @private - @property registeredActions - @type Object - */ - ActionManager.registeredActions = {}; -}); -enifed('ember-views/system/event_dispatcher', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-views/system/jquery', 'ember-views/system/action_manager', 'ember-environment', 'ember-views/compat/fallback-view-registry'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberViewsSystemJquery, _emberViewsSystemAction_manager, _emberEnvironment, _emberViewsCompatFallbackViewRegistry) { - /** - @module ember - @submodule ember-views - */ - - 'use strict'; - - var ROOT_ELEMENT_CLASS = 'ember-application'; - var ROOT_ELEMENT_SELECTOR = '.' + ROOT_ELEMENT_CLASS; - - /** - `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 - called. - - @class EventDispatcher - @namespace Ember - @private - @extends Ember.Object - */ - exports.default = _emberRuntime.Object.extend({ - - /** - The set of events names (and associated handler function names) to be setup - and dispatched by the `EventDispatcher`. Modifications to this list can be done - at setup time, generally via the `Ember.Application.customEvents` hash. - To add new events to be listened to: - ```javascript - let App = Ember.Application.create({ - customEvents: { - paste: 'paste' - } - }); - ``` - To prevent default events from being listened to: - ```javascript - let App = Ember.Application.create({ - customEvents: { - mouseenter: null, - mouseleave: null - } - }); - ``` - @property events - @type Object - @private - */ - events: { - touchstart: 'touchStart', - touchmove: 'touchMove', - touchend: 'touchEnd', - touchcancel: 'touchCancel', - keydown: 'keyDown', - keyup: 'keyUp', - keypress: 'keyPress', - mousedown: 'mouseDown', - mouseup: 'mouseUp', - contextmenu: 'contextMenu', - click: 'click', - dblclick: 'doubleClick', - mousemove: 'mouseMove', - focusin: 'focusIn', - focusout: 'focusOut', - mouseenter: 'mouseEnter', - mouseleave: 'mouseLeave', - submit: 'submit', - input: 'input', - change: 'change', - dragstart: 'dragStart', - drag: 'drag', - dragenter: 'dragEnter', - dragleave: 'dragLeave', - dragover: 'dragOver', - drop: 'drop', - dragend: 'dragEnd' - }, - - /** - The root DOM element to which event listeners should be attached. Event - listeners will be attached to the document unless this is overridden. - Can be specified as a DOMElement or a selector string. - The default body is a string since this may be evaluated before document.body - exists in the DOM. - @private - @property rootElement - @type DOMElement - @default 'body' - */ - rootElement: 'body', - - /** - It enables events to be dispatched to the view's `eventManager.` When present, - this object takes precedence over handling of events on the view itself. - Note that most Ember applications do not use this feature. If your app also - does not use it, consider setting this property to false to gain some performance - improvement by allowing the EventDispatcher to skip the search for the - `eventManager` on the view tree. - ```javascript - let EventDispatcher = Em.EventDispatcher.extend({ - events: { - click : 'click', - focusin : 'focusIn', - focusout : 'focusOut', - change : 'change' - }, - canDispatchToEventManager: false - }); - container.register('event_dispatcher:main', EventDispatcher); - ``` - @property canDispatchToEventManager - @type boolean - @default 'true' - @since 1.7.0 - @private - */ - canDispatchToEventManager: true, - - init: function () { - this._super(); - }, - - /** - Sets up event listeners for standard browser events. - This will be called after the browser sends a `DOMContentReady` event. By - default, it will set up all of the listeners on the document body. If you - would like to register the listeners on a different element, set the event - dispatcher's `root` property. - @private - @method setup - @param addedEvents {Object} - */ - setup: function (addedEvents, rootElement) { - var event = undefined; - var events = this._finalEvents = _emberUtils.assign({}, _emberMetal.get(this, 'events'), addedEvents); - - if (!_emberMetal.isNone(rootElement)) { - _emberMetal.set(this, 'rootElement', rootElement); - } - - rootElement = _emberViewsSystemJquery.default(_emberMetal.get(this, 'rootElement')); - - rootElement.addClass(ROOT_ELEMENT_CLASS); - - if (!rootElement.is(ROOT_ELEMENT_SELECTOR)) { - throw new TypeError('Unable to add \'' + ROOT_ELEMENT_CLASS + '\' class to root element (' + (rootElement.selector || rootElement[0].tagName) + '). Make sure you set rootElement to the body or an element in the body.'); - } - - for (event in events) { - if (events.hasOwnProperty(event)) { - this.setupHandler(rootElement, event, events[event]); - } - } - }, - - /** - Registers an event listener on the rootElement. If the given event is - triggered, the provided event handler will be triggered on the target view. - If the target view does not implement the event handler, or if the handler - returns `false`, the parent view will be called. The event will continue to - bubble to each successive parent view until it reaches the top. - @private - @method setupHandler - @param {Element} rootElement - @param {String} event the browser-originated event to listen to - @param {String} eventName the name of the method to call on the view - */ - setupHandler: function (rootElement, event, eventName) { - var self = this; - - var owner = _emberUtils.getOwner(this); - var viewRegistry = owner && owner.lookup('-view-registry:main') || _emberViewsCompatFallbackViewRegistry.default; - - if (eventName === null) { - return; - } - - rootElement.on(event + '.ember', '.ember-view', function (evt, triggeringManager) { - var view = viewRegistry[this.id]; - var result = true; - - var manager = self.canDispatchToEventManager ? self._findNearestEventManager(view, eventName) : null; - - if (manager && manager !== triggeringManager) { - result = self._dispatchEvent(manager, evt, eventName, view); - } else if (view) { - result = self._bubbleEvent(view, evt, eventName); - } - - return result; - }); - - rootElement.on(event + '.ember', '[data-ember-action]', function (evt) { - var actionId = _emberViewsSystemJquery.default(evt.currentTarget).attr('data-ember-action'); - var actions = _emberViewsSystemAction_manager.default.registeredActions[actionId]; - - // In Glimmer2 this attribute is set to an empty string and an additional - // attribute it set for each action on a given element. In this case, the - // attributes need to be read so that a proper set of action handlers can - // be coalesced. - if (actionId === '') { - var attributes = evt.currentTarget.attributes; - var attributeCount = attributes.length; - - actions = []; - - for (var i = 0; i < attributeCount; i++) { - var attr = attributes.item(i); - var attrName = attr.name; - - if (attrName.indexOf('data-ember-action-') === 0) { - actions = actions.concat(_emberViewsSystemAction_manager.default.registeredActions[attr.value]); - } - } - } - - // We have to check for actions here since in some cases, jQuery will trigger - // an event on `removeChild` (i.e. focusout) after we've already torn down the - // action handlers for the view. - if (!actions) { - return; - } - - for (var index = 0; index < actions.length; index++) { - var action = actions[index]; - - if (action && action.eventName === eventName) { - return action.handler(evt); - } - } - }); - }, - - _findNearestEventManager: function (view, eventName) { - var manager = null; - - while (view) { - manager = _emberMetal.get(view, 'eventManager'); - if (manager && manager[eventName]) { - break; - } - - view = _emberMetal.get(view, 'parentView'); - } - - return manager; - }, - - _dispatchEvent: function (object, evt, eventName, view) { - var result = true; - - var handler = object[eventName]; - if (typeof handler === 'function') { - result = _emberMetal.run(object, handler, evt, view); - // Do not preventDefault in eventManagers. - evt.stopPropagation(); - } else { - result = this._bubbleEvent(view, evt, eventName); - } - - return result; - }, - - _bubbleEvent: function (view, evt, eventName) { - return view.handleEvent(eventName, evt); - }, - - destroy: function () { - var rootElement = _emberMetal.get(this, 'rootElement'); - _emberViewsSystemJquery.default(rootElement).off('.ember', '**').removeClass(ROOT_ELEMENT_CLASS); - return this._super.apply(this, arguments); - }, - - toString: function () { - return '(EventDispatcher)'; - } - }); -}); -enifed('ember-views/system/ext', ['exports', 'ember-metal'], function (exports, _emberMetal) { - /** - @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 should occur after view rendering. - _emberMetal.run._addQueue('render', 'actions'); - _emberMetal.run._addQueue('afterRender', 'render'); -}); -enifed('ember-views/system/jquery', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { - 'use strict'; - - var jQuery = undefined; - - if (_emberEnvironment.environment.hasDOM) { - jQuery = _emberEnvironment.context.imports.jQuery; - - if (jQuery) { - if (jQuery.event.addProp) { - jQuery.event.addProp('dataTransfer'); - } else { - // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dndevents - ['dragstart', 'drag', 'dragenter', 'dragleave', 'dragover', 'drop', 'dragend'].forEach(function (eventName) { - jQuery.event.fixHooks[eventName] = { - props: ['dataTransfer'] - }; - }); - } - } - } - - exports.default = jQuery; -}); -enifed('ember-views/system/lookup_partial', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; - - exports.default = lookupPartial; - exports.hasPartial = hasPartial; - - function parseUnderscoredName(templateName) { - var nameParts = templateName.split('/'); - var lastPart = nameParts[nameParts.length - 1]; - - nameParts[nameParts.length - 1] = '_' + lastPart; - - return nameParts.join('/'); - } - - function lookupPartial(templateName, owner) { - if (templateName == null) { - return; - } - - var template = templateFor(owner, parseUnderscoredName(templateName), templateName); - - return template; - } - - function hasPartial(name, owner) { - if (!owner) { - throw new _emberMetal.Error('Container was not found when looking up a views template. ' + 'This is most likely due to manually instantiating an Ember.View. ' + 'See: http://git.io/EKPpnA'); - } - - return owner.hasRegistration('template:' + parseUnderscoredName(name)) || owner.hasRegistration('template:' + name); - } - - function templateFor(owner, underscored, name) { - if (!name) { - return; - } - - if (!owner) { - throw new _emberMetal.Error('Container was not found when looking up a views template. ' + 'This is most likely due to manually instantiating an Ember.View. ' + 'See: http://git.io/EKPpnA'); - } - - return owner.lookup('template:' + underscored) || owner.lookup('template:' + name); - } -}); -enifed('ember-views/system/utils', ['exports', 'ember-utils'], function (exports, _emberUtils) { - /* globals Element */ - 'use strict'; - - exports.isSimpleClick = isSimpleClick; - exports.getRootViews = getRootViews; - exports.getViewId = getViewId; - exports.getViewElement = getViewElement; - exports.initViewElement = initViewElement; - exports.setViewElement = setViewElement; - exports.getChildViews = getChildViews; - exports.initChildViews = initChildViews; - exports.addChildView = addChildView; - exports.collectChildViews = collectChildViews; - exports.getViewBounds = getViewBounds; - exports.getViewRange = getViewRange; - exports.getViewClientRects = getViewClientRects; - exports.getViewBoundingClientRect = getViewBoundingClientRect; - exports.matches = matches; - - /** - @module ember - @submodule ember-views - */ - - 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; - } - - var STYLE_WARNING = '' + '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.'; - - exports.STYLE_WARNING = STYLE_WARNING; - /** - @private - @method getRootViews - @param {Object} owner - */ - - function getRootViews(owner) { - var registry = owner.lookup('-view-registry:main'); - - var rootViews = []; - - Object.keys(registry).forEach(function (id) { - var view = registry[id]; - - if (view.parentView === null) { - rootViews.push(view); - } - }); - - return rootViews; - } - - /** - @private - @method getViewId - @param {Ember.View} view - */ - - function getViewId(view) { - if (view.tagName === '') { - return _emberUtils.guidFor(view); - } else { - return view.elementId || _emberUtils.guidFor(view); - } - } - - var VIEW_ELEMENT = _emberUtils.symbol('VIEW_ELEMENT'); - - /** - @private - @method getViewElement - @param {Ember.View} view - */ - - function getViewElement(view) { - return view[VIEW_ELEMENT]; - } - - function initViewElement(view) { - view[VIEW_ELEMENT] = null; - } - - function setViewElement(view, element) { - return view[VIEW_ELEMENT] = element; - } - - var CHILD_VIEW_IDS = _emberUtils.symbol('CHILD_VIEW_IDS'); - - /** - @private - @method getChildViews - @param {Ember.View} view - */ - - function getChildViews(view) { - var owner = _emberUtils.getOwner(view); - var registry = owner.lookup('-view-registry:main'); - return collectChildViews(view, registry); - } - - function initChildViews(view) { - view[CHILD_VIEW_IDS] = []; - } - - function addChildView(parent, child) { - parent[CHILD_VIEW_IDS].push(getViewId(child)); - } - - function collectChildViews(view, registry) { - var ids = []; - var views = []; - - view[CHILD_VIEW_IDS].forEach(function (id) { - var view = registry[id]; - - if (view && !view.isDestroying && !view.isDestroyed && ids.indexOf(id) === -1) { - ids.push(id); - views.push(view); - } - }); - - view[CHILD_VIEW_IDS] = ids; - - return views; - } - - /** - @private - @method getViewBounds - @param {Ember.View} view - */ - - function getViewBounds(view) { - return view.renderer.getBounds(view); - } - - /** - @private - @method getViewRange - @param {Ember.View} view - */ - - function getViewRange(view) { - var bounds = getViewBounds(view); - - var range = document.createRange(); - range.setStartBefore(bounds.firstNode); - range.setEndAfter(bounds.lastNode); - - return range; - } - - /** - `getViewClientRects` provides information about the position of the border - box edges of a view relative to the viewport. - - It is only intended to be used by development tools like the Ember Inspector - and may not work on older browsers. - - @private - @method getViewClientRects - @param {Ember.View} view - */ - - function getViewClientRects(view) { - var range = getViewRange(view); - return range.getClientRects(); - } - - /** - `getViewBoundingClientRect` provides information about the position of the - bounding border box edges of a view relative to the viewport. - - It is only intended to be used by development tools like the Ember Inpsector - and may not work on older browsers. - - @private - @method getViewBoundingClientRect - @param {Ember.View} view - */ - - function getViewBoundingClientRect(view) { - var range = getViewRange(view); - return range.getBoundingClientRect(); - } - - /** - Determines if the element matches the specified selector. - - @private - @method matches - @param {DOMElement} el - @param {String} selector - */ - var elMatches = typeof Element !== 'undefined' && (Element.prototype.matches || Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector); - - exports.elMatches = elMatches; - - function matches(el, selector) { - return elMatches.call(el, selector); - } -}); -enifed('ember-views/utils/lookup-component', ['exports', 'container'], function (exports, _container) { - 'use strict'; - - exports.default = lookupComponent; - - var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['component:-default'], ['component:-default']); - - function lookupComponentPair(componentLookup, owner, name, options) { - var component = componentLookup.componentFor(name, owner, options); - var layout = componentLookup.layoutFor(name, owner, options); - - var result = { layout: layout, component: component }; - - if (layout && !component) { - result.component = owner._lookupFactory(_container.privatize(_templateObject)); - } - - return result; - } - - function lookupComponent(owner, name, options) { - var componentLookup = owner.lookup('component-lookup:main'); - - var source = options && options.source; - - if (source) { - var localResult = lookupComponentPair(componentLookup, owner, name, options); - - if (localResult.component || localResult.layout) { - return localResult; - } - } - - return lookupComponentPair(componentLookup, owner, name); - } -}); -enifed('ember-views/views/core_view', ['exports', 'ember-runtime', 'ember-views/system/utils', 'ember-views/views/states'], function (exports, _emberRuntime, _emberViewsSystemUtils, _emberViewsViewsStates) { - 'use strict'; - - /** - `Ember.CoreView` is an abstract class that exists to give view-like behavior - to both Ember's main view class `Ember.Component` and other classes that don't need - the full functionality of `Ember.Component`. - - Unless you have specific needs for `CoreView`, you will use `Ember.Component` - in your applications. - - @class CoreView - @namespace Ember - @extends Ember.Object - @deprecated Use `Ember.Component` instead. - @uses Ember.Evented - @uses Ember.ActionHandler - @private - */ - var CoreView = _emberRuntime.FrameworkObject.extend(_emberRuntime.Evented, _emberRuntime.ActionHandler, { - isView: true, - - _states: _emberViewsViewsStates.cloneStates(_emberViewsViewsStates.states), - - init: function () { - this._super.apply(this, arguments); - this._state = 'preRender'; - this._currentState = this._states.preRender; - - _emberViewsSystemUtils.initViewElement(this); - - if (!this.renderer) { - throw new Error('Cannot instantiate a component without a renderer. Please ensure that you are creating ' + this + ' with a proper container/registry.'); - } - }, - - /** - If the view is currently inserted into the DOM of a parent view, this - property will point to the parent of the view. - @property parentView - @type Ember.View - @default null - @private - */ - parentView: null, - - instrumentDetails: function (hash) { - hash.object = this.toString(); - hash.containerKey = this._debugContainerKey; - hash.view = this; - return hash; - }, - - /** - Override the default event firing from `Ember.Evented` to - also call methods with the given name. - @method trigger - @param name {String} - @private - */ - trigger: function () { - this._super.apply(this, arguments); - var name = arguments[0]; - var method = this[name]; - if (method) { - var args = new Array(arguments.length - 1); - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - return method.apply(this, args); - } - }, - - has: function (name) { - return _emberRuntime.typeOf(this[name]) === 'function' || this._super(name); - } - }); - - _emberRuntime.deprecateUnderscoreActions(CoreView); - - CoreView.reopenClass({ - isViewFactory: true - }); - - exports.default = CoreView; -}); -enifed('ember-views/views/states', ['exports', 'ember-utils', '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, _emberUtils, _emberViewsViewsStatesDefault, _emberViewsViewsStatesPre_render, _emberViewsViewsStatesHas_element, _emberViewsViewsStatesIn_dom, _emberViewsViewsStatesDestroying) { - 'use strict'; - - exports.cloneStates = cloneStates; - - function cloneStates(from) { - var into = {}; - - into._default = {}; - into.preRender = Object.create(into._default); - into.destroying = Object.create(into._default); - into.hasElement = Object.create(into._default); - into.inDOM = Object.create(into.hasElement); - - for (var stateName in from) { - if (!from.hasOwnProperty(stateName)) { - continue; - } - _emberUtils.assign(into[stateName], from[stateName]); - } - - return into; - } + run.backburner = backburner; + run.currentRunLoop = null; + run.queues = backburner.queueNames; - /* - Describe how the specified actions should behave in the various - states that a view can exist in. Possible states: + /** + Begins a new RunLoop. Any deferred actions invoked after the begin will + be buffered until you invoke a matching call to `run.end()`. This is + a lower-level way to use a RunLoop instead of using `run()`. - * preRender: when a view is first instantiated, and after its - element was destroyed, it is in the preRender state - * hasElement: the DOM representation of the view is created, - and is ready to be inserted - * inDOM: once a view has been inserted into the DOM it is in - the inDOM state. A view spends the vast majority of its - existence in this state. - * destroyed: once a view has been destroyed (using the destroy - method), it is in this state. No further actions can be invoked - on a destroyed view. + ```javascript + run.begin(); + // code to be executed within a RunLoop + run.end(); + ``` + + @method begin + @return {void} + @public */ - var states = { - _default: _emberViewsViewsStatesDefault.default, - preRender: _emberViewsViewsStatesPre_render.default, - inDOM: _emberViewsViewsStatesIn_dom.default, - hasElement: _emberViewsViewsStatesHas_element.default, - destroying: _emberViewsViewsStatesDestroying.default + run.begin = function () { + backburner.begin(); }; - exports.states = states; -}); -enifed('ember-views/views/states/default', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; /** - @module ember - @submodule ember-views + Ends a RunLoop. This must be called sometime after you call + `run.begin()` to flush any deferred actions. This is a lower-level way + to use a RunLoop instead of using `run()`. + + ```javascript + run.begin(); + // code to be executed within a RunLoop + run.end(); + ``` + + @method end + @return {void} + @public */ - exports.default = { - // appendChild is only legal while rendering the buffer. - appendChild: function () { - throw new _emberMetal.Error('You can\'t use appendChild outside of the rendering process'); - }, - - // Handle events from `Ember.EventDispatcher` - handleEvent: function () { - return true; // continue event propagation - }, - - rerender: function () {}, - - destroy: function () {} + run.end = function () { + backburner.end(); }; -}); -enifed('ember-views/views/states/destroying', ['exports', 'ember-utils', 'ember-metal', 'ember-views/views/states/default'], function (exports, _emberUtils, _emberMetal, _emberViewsViewsStatesDefault) { - 'use strict'; - - /** - @module ember - @submodule ember-views - */ - - var destroying = Object.create(_emberViewsViewsStatesDefault.default); - - _emberUtils.assign(destroying, { - appendChild: function () { - throw new _emberMetal.Error('You can\'t call appendChild on a view being destroyed'); - }, - rerender: function () { - throw new _emberMetal.Error('You can\'t call rerender on a view being destroyed'); - } - }); - - exports.default = destroying; -}); -enifed('ember-views/views/states/has_element', ['exports', 'ember-utils', 'ember-views/views/states/default', 'ember-metal'], function (exports, _emberUtils, _emberViewsViewsStatesDefault, _emberMetal) { - 'use strict'; - - var hasElement = Object.create(_emberViewsViewsStatesDefault.default); - - _emberUtils.assign(hasElement, { - - rerender: function (view) { - view.renderer.rerender(view); - }, - - destroy: function (view) { - view.renderer.remove(view); - }, - - // Handle events from `Ember.EventDispatcher` - handleEvent: function (view, eventName, event) { - if (view.has(eventName)) { - // Handler should be able to re-dispatch events, so we don't - // preventDefault or stopPropagation. - return _emberMetal.flaggedInstrument('interaction.' + eventName, { event: event, view: view }, function () { - return _emberMetal.run.join(view, view.trigger, eventName, event); - }); - } else { - return true; // continue event propagation - } - } - }); - - exports.default = hasElement; -}); -enifed('ember-views/views/states/in_dom', ['exports', 'ember-utils', 'ember-metal', 'ember-views/views/states/has_element'], function (exports, _emberUtils, _emberMetal, _emberViewsViewsStatesHas_element) { - 'use strict'; /** - @module ember - @submodule ember-views + Array of named queues. This array determines the order in which queues + are flushed at the end of the RunLoop. You can define your own queues by + simply adding the queue name to this array. Normally you should not need + to inspect or modify this property. + + @property queues + @type Array + @default ['sync', 'actions', 'destroy'] + @private */ - var inDOM = Object.create(_emberViewsViewsStatesHas_element.default); - - _emberUtils.assign(inDOM, { - enter: function (view) { - // Register the view for event handling. This hash is used by - // Ember.EventDispatcher to dispatch incoming events. - view.renderer.register(view); - }, - - exit: function (view) { - view.renderer.unregister(view); - } - }); - - exports.default = inDOM; -}); -enifed('ember-views/views/states/pre_render', ['exports', 'ember-views/views/states/default'], function (exports, _emberViewsViewsStatesDefault) { - 'use strict'; - /** - @module ember - @submodule ember-views - */ - - exports.default = Object.create(_emberViewsViewsStatesDefault.default); -}); -enifed("ember-views/views/view", ["exports"], function (exports) { - "use strict"; -}); -/** -@module ember -@submodule ember-views -*/ - -/** - `Ember.View` is the class in Ember responsible for encapsulating templates of - HTML content, combining templates with data to render as sections of a page's - DOM, and registering and responding to user-initiated events. - - ## HTML Tag - - The default HTML tag name used for a view's DOM representation is `div`. This - can be customized by setting the `tagName` property. The following view - class: - - ```javascript - ParagraphView = Ember.View.extend({ - tagName: 'em' - }); - ``` - - Would result in instances with the following HTML: - - ```html - - ``` - - ## HTML `class` Attribute - - The HTML `class` attribute of a view's tag can be set by providing a - `classNames` property that is set to an array of strings: - - ```javascript - MyView = Ember.View.extend({ - classNames: ['my-class', 'my-other-class'] - }); - ``` - - Will result in view instances with an HTML representation of: - - ```html -
    - ``` - - `class` attribute values can also be set by providing a `classNameBindings` - property set to an array of properties names for the view. The return value - of these properties will be added as part of the value for the view's `class` - attribute. These properties can be computed properties: - - ```javascript - MyView = Ember.View.extend({ - classNameBindings: ['propertyA', 'propertyB'], - propertyA: 'from-a', - propertyB: Ember.computed(function() { - if (someLogic) { return 'from-b'; } - }) - }); - ``` - - Will result in view instances with an HTML representation of: - - ```html -
    - ``` - - If the value of a class name binding returns a boolean the property name - itself will be used as the class name if the property is true. The class name - will not be added if the value is `false` or `undefined`. - - ```javascript - MyView = Ember.View.extend({ - classNameBindings: ['hovered'], - hovered: true - }); - ``` - - Will result in view instances with an HTML representation of: - - ```html -
    - ``` - - When using boolean class name bindings you can supply a string value other - than the property name for use as the `class` HTML attribute by appending the - preferred value after a ":" character when defining the binding: - - ```javascript - MyView = Ember.View.extend({ - classNameBindings: ['awesome:so-very-cool'], - awesome: true - }); - ``` - - Will result in view instances with an HTML representation of: - - ```html -
    - ``` - - Boolean value class name bindings whose property names are in a - camelCase-style format will be converted to a dasherized format: - - ```javascript - MyView = Ember.View.extend({ - classNameBindings: ['isUrgent'], - isUrgent: true - }); - ``` - - Will result in view instances with an HTML representation of: - - ```html -
    - ``` - - Class name bindings can also refer to object values that are found by - traversing a path relative to the view itself: - - ```javascript - MyView = Ember.View.extend({ - classNameBindings: ['messages.empty'] - messages: Ember.Object.create({ - empty: true - }) - }); - ``` - - Will result in view instances with an HTML representation of: - - ```html -
    - ``` - - If you want to add a class name for a property which evaluates to true and - and a different class name if it evaluates to false, you can pass a binding - like this: - - ```javascript - // Applies 'enabled' class when isEnabled is true and 'disabled' when isEnabled is false - Ember.View.extend({ - classNameBindings: ['isEnabled:enabled:disabled'] - isEnabled: true - }); - ``` - - Will result in view instances with an HTML representation of: - - ```html -
    - ``` - - When isEnabled is `false`, the resulting HTML representation looks like - this: - - ```html -
    - ``` - - This syntax offers the convenience to add a class if a property is `false`: - - ```javascript - // Applies no class when isEnabled is true and class 'disabled' when isEnabled is false - Ember.View.extend({ - classNameBindings: ['isEnabled::disabled'] - isEnabled: true - }); - ``` - - Will result in view instances with an HTML representation of: - - ```html -
    - ``` - - When the `isEnabled` property on the view is set to `false`, it will result - in view instances with an HTML representation of: - - ```html -
    - ``` - - Updates to the value of a class name binding will result in automatic - update of the HTML `class` attribute in the view's rendered HTML - representation. If the value becomes `false` or `undefined` the class name - will be removed. - - Both `classNames` and `classNameBindings` are concatenated properties. See - [Ember.Object](/api/classes/Ember.Object.html) documentation for more - information about concatenated properties. - - ## HTML Attributes - - The HTML attribute section of a view's tag can be set by providing an - `attributeBindings` property set to an array of property names on the view. - The return value of these properties will be used as the value of the view's - HTML associated attribute: - - ```javascript - AnchorView = Ember.View.extend({ - tagName: 'a', - attributeBindings: ['href'], - href: 'http://google.com' - }); - ``` - - Will result in view instances with an HTML representation of: - - ```html - - ``` - - One property can be mapped on to another by placing a ":" between - the source property and the destination property: - - ```javascript - AnchorView = Ember.View.extend({ - tagName: 'a', - attributeBindings: ['url:href'], - url: 'http://google.com' - }); - ``` - - Will result in view instances with an HTML representation of: - - ```html - - ``` - - Namespaced attributes (e.g. `xlink:href`) are supported, but have to be - mapped, since `:` is not a valid character for properties in Javascript: - - ```javascript - UseView = Ember.View.extend({ - tagName: 'use', - attributeBindings: ['xlinkHref:xlink:href'], - xlinkHref: '#triangle' - }); - ``` - Will result in view instances with an HTML representation of: - - ```html - - ``` - - If the return value of an `attributeBindings` monitored property is a boolean - the attribute will be present or absent depending on the value: - - ```javascript - MyTextInput = Ember.View.extend({ - tagName: 'input', - attributeBindings: ['disabled'], - disabled: false - }); - ``` - - Will result in a view instance with an HTML representation of: - - ```html - - ``` - - `attributeBindings` can refer to computed properties: - - ```javascript - MyTextInput = Ember.View.extend({ - tagName: 'input', - attributeBindings: ['disabled'], - disabled: Ember.computed(function() { - if (someLogic) { - return true; - } else { - return false; - } - }) - }); - ``` - - To prevent setting an attribute altogether, use `null` or `undefined` as the - return value of the `attributeBindings` monitored property: - - ```javascript - MyTextInput = Ember.View.extend({ - tagName: 'form', - attributeBindings: ['novalidate'], - novalidate: null - }); - ``` - - Updates to the property of an attribute binding will result in automatic - update of the HTML attribute in the view's rendered HTML representation. - - `attributeBindings` is a concatenated property. See [Ember.Object](/api/classes/Ember.Object.html) - documentation for more information about concatenated properties. - - ## Layouts - - Views can have a secondary template that wraps their main template. Like - primary templates, layouts can be any function that accepts an optional - context parameter and returns a string of HTML that will be inserted inside - view's tag. Views whose HTML element is self closing (e.g. ``) - cannot have a layout and this property will be ignored. - - Most typically in Ember a layout will be a compiled template. - - A view's layout can be set directly with the `layout` property or reference - an existing template by name with the `layoutName` property. - - A template used as a layout must contain a single use of the - `{{yield}}` helper. The HTML contents of a view's rendered `template` will be - inserted at this location: - - ```javascript - AViewWithLayout = Ember.View.extend({ - layout: Ember.HTMLBars.compile("
    {{yield}}
    "), - template: Ember.HTMLBars.compile("I got wrapped") - }); - ``` - - Will result in view instances with an HTML representation of: - - ```html -
    -
    - I got wrapped -
    -
    - ``` - - See [Ember.Templates.helpers.yield](/api/classes/Ember.Templates.helpers.html#method_yield) - for more information. - - ## Responding to Browser Events - - Views can respond to user-initiated events in one of three ways: method - implementation, through an event manager, and through `{{action}}` helper use - in their template or layout. - - ### Method Implementation - - Views can respond to user-initiated events by implementing a method that - matches the event name. A `jQuery.Event` object will be passed as the - argument to this method. - - ```javascript - AView = Ember.View.extend({ - click: function(event) { - // will be called when an instance's - // rendered element is clicked - } - }); - ``` - - ### Event Managers - - Views can define an object as their `eventManager` property. This object can - then implement methods that match the desired event names. Matching events - that occur on the view's rendered HTML or the rendered HTML of any of its DOM - descendants will trigger this method. A `jQuery.Event` object will be passed - as the first argument to the method and an `Ember.View` object as the - second. The `Ember.View` will be the view whose rendered HTML was interacted - with. This may be the view with the `eventManager` property or one of its - descendant views. - - ```javascript - AView = Ember.View.extend({ - eventManager: Ember.Object.create({ - doubleClick: function(event, view) { - // will be called when an instance's - // rendered element or any rendering - // of this view's descendant - // elements is clicked - } - }) - }); - ``` - - An event defined for an event manager takes precedence over events of the - same name handled through methods on the view. - - ```javascript - AView = Ember.View.extend({ - mouseEnter: function(event) { - // will never trigger. - }, - eventManager: Ember.Object.create({ - mouseEnter: function(event, view) { - // takes precedence over AView#mouseEnter - } - }) - }); - ``` - - Similarly a view's event manager will take precedence for events of any views - rendered as a descendant. A method name that matches an event name will not - be called if the view instance was rendered inside the HTML representation of - a view that has an `eventManager` property defined that handles events of the - name. Events not handled by the event manager will still trigger method calls - on the descendant. - - ```javascript - var App = Ember.Application.create(); - App.OuterView = Ember.View.extend({ - template: Ember.HTMLBars.compile("outer {{#view 'inner'}}inner{{/view}} outer"), - eventManager: Ember.Object.create({ - mouseEnter: function(event, view) { - // view might be instance of either - // OuterView or InnerView depending on - // where on the page the user interaction occurred - } - }) - }); - - App.InnerView = Ember.View.extend({ - click: function(event) { - // will be called if rendered inside - // an OuterView because OuterView's - // eventManager doesn't handle click events - }, - mouseEnter: function(event) { - // will never be called if rendered inside - // an OuterView. - } - }); - ``` - - ### `{{action}}` Helper - - See [Ember.Templates.helpers.action](/api/classes/Ember.Templates.helpers.html#method_action). - - ### Event Names - - All of the event handling approaches described above respond to the same set - of events. The names of the built-in events are listed below. (The hash of - built-in events exists in `Ember.EventDispatcher`.) Additional, custom events - can be registered by using `Ember.Application.customEvents`. - - Touch events: - - * `touchStart` - * `touchMove` - * `touchEnd` - * `touchCancel` - - Keyboard events - - * `keyDown` - * `keyUp` - * `keyPress` - - Mouse events - - * `mouseDown` - * `mouseUp` - * `contextMenu` - * `click` - * `doubleClick` - * `mouseMove` - * `focusIn` - * `focusOut` - * `mouseEnter` - * `mouseLeave` - - Form events: - - * `submit` - * `change` - * `focusIn` - * `focusOut` - * `input` - - HTML5 drag and drop events: - - * `dragStart` - * `drag` - * `dragEnter` - * `dragLeave` - * `dragOver` - * `dragEnd` - * `drop` - - @class View - @namespace Ember - @extends Ember.CoreView - @deprecated See http://emberjs.com/deprecations/v1.x/#toc_ember-view - @uses Ember.ViewSupport - @uses Ember.ChildViewsSupport - @uses Ember.ClassNamesSupport - @uses Ember.AttributeBindingsSupport - @private -*/ -enifed("ember/features", ["exports"], function (exports) { - "use strict"; - - exports.default = { "features-stripped-test": false, "ember-libraries-isregistered": false, "ember-runtime-computed-uniq-by": true, "ember-improved-instrumentation": false, "ember-runtime-enumerable-includes": true, "ember-string-ishtmlsafe": true, "ember-testing-check-waiters": true, "ember-metal-weakmap": false, "ember-glimmer-allow-backtracking-rerender": true, "ember-testing-resume-test": false, "ember-glimmer-detect-backtracking-rerender": false, "mandatory-setter": false }; -}); -enifed('ember/index', ['exports', 'require', 'ember-environment', 'ember-utils', 'container', 'ember-metal', 'backburner', 'ember-console', 'ember-runtime', 'ember-glimmer', 'ember/version', 'ember-views', 'ember-routing', 'ember-application', 'ember-extension-support'], function (exports, _require, _emberEnvironment, _emberUtils, _container, _emberMetal, _backburner, _emberConsole, _emberRuntime, _emberGlimmer, _emberVersion, _emberViews, _emberRouting, _emberApplication, _emberExtensionSupport) { - 'use strict'; - - // ember-utils exports - _emberMetal.default.getOwner = _emberUtils.getOwner; - _emberMetal.default.setOwner = _emberUtils.setOwner; - _emberMetal.default.generateGuid = _emberUtils.generateGuid; - _emberMetal.default.GUID_KEY = _emberUtils.GUID_KEY; - _emberMetal.default.guidFor = _emberUtils.guidFor; - _emberMetal.default.inspect = _emberUtils.inspect; - _emberMetal.default.makeArray = _emberUtils.makeArray; - _emberMetal.default.canInvoke = _emberUtils.canInvoke; - _emberMetal.default.tryInvoke = _emberUtils.tryInvoke; - _emberMetal.default.wrap = _emberUtils.wrap; - _emberMetal.default.applyStr = _emberUtils.applyStr; - _emberMetal.default.uuid = _emberUtils.uuid; - _emberMetal.default.assign = Object.assign || _emberUtils.assign; - - // container exports - _emberMetal.default.Container = _container.Container; - _emberMetal.default.Registry = _container.Registry; + Adds the passed target/method and any optional arguments to the named + queue to be executed at the end of the RunLoop. If you have not already + started a RunLoop when calling this method one will be started for you + automatically. + + At the end of a RunLoop, any methods scheduled in this way will be invoked. + Methods will be invoked in an order matching the named queues defined in + the `run.queues` property. + + ```javascript + run.schedule('sync', this, function() { + // this will be executed in the first RunLoop queue, when bindings are synced + console.log('scheduled on sync queue'); + }); + + run.schedule('actions', this, function() { + // this will be executed in the 'actions' queue, after bindings have synced. + console.log('scheduled on actions queue'); + }); + + // Note the functions will be run in order based on the run queues order. + // Output would be: + // scheduled on sync queue + // scheduled on actions queue + ``` + + @method schedule + @param {String} queue The name of the queue to schedule against. + Default queues are 'sync' and 'actions' + @param {Object} [target] target object to use as the context when invoking a method. + @param {String|Function} method The method to invoke. If you pass a string it + will be resolved on the target object at the time the scheduled item is + invoked allowing you to change the target function. + @param {Object} [arguments*] Optional arguments to be passed to the queued method. + @return {*} Timer information for use in cancelling, see `run.cancel`. + @public + */ + run.schedule = function () /* queue, target, method */{ - // need to import this directly, to ensure the babel feature - // flag plugin works properly + return backburner.schedule.apply(backburner, arguments); + }; - var computed = _emberMetal.computed; - computed.alias = _emberMetal.alias; - _emberMetal.default.computed = computed; - _emberMetal.default.ComputedProperty = _emberMetal.ComputedProperty; - _emberMetal.default.cacheFor = _emberMetal.cacheFor; + // Used by global test teardown + run.hasScheduledTimers = function () { + return backburner.hasTimers(); + }; - _emberMetal.default.assert = _emberMetal.assert; - _emberMetal.default.warn = _emberMetal.warn; - _emberMetal.default.debug = _emberMetal.debug; - _emberMetal.default.deprecate = _emberMetal.deprecate; - _emberMetal.default.deprecateFunc = _emberMetal.deprecateFunc; - _emberMetal.default.runInDebug = _emberMetal.runInDebug; - _emberMetal.default.merge = _emberMetal.merge; + // Used by global test teardown + run.cancelTimers = function () { + backburner.cancelTimers(); + }; - _emberMetal.default.instrument = _emberMetal.instrument; - _emberMetal.default.subscribe = _emberMetal.instrumentationSubscribe; - _emberMetal.default.Instrumentation = { - instrument: _emberMetal.instrument, - subscribe: _emberMetal.instrumentationSubscribe, - unsubscribe: _emberMetal.instrumentationUnsubscribe, - reset: _emberMetal.instrumentationReset + /** + Immediately flushes any events scheduled in the 'sync' queue. Bindings + use this queue so this method is a useful way to immediately force all + bindings in the application to sync. + + You should call this method anytime you need any changed state to propagate + throughout the app immediately without repainting the UI (which happens + in the later 'render' queue added by the `ember-views` package). + + ```javascript + run.sync(); + ``` + + @method sync + @return {void} + @private + */ + run.sync = function () { + if (backburner.currentInstance) { + backburner.currentInstance.queues.sync.flush(); + } }; - _emberMetal.default.Error = _emberMetal.Error; - _emberMetal.default.META_DESC = _emberMetal.META_DESC; - _emberMetal.default.meta = _emberMetal.meta; - _emberMetal.default.get = _emberMetal.get; - _emberMetal.default.getWithDefault = _emberMetal.getWithDefault; - _emberMetal.default._getPath = _emberMetal._getPath; - _emberMetal.default.set = _emberMetal.set; - _emberMetal.default.trySet = _emberMetal.trySet; - _emberMetal.default.FEATURES = _emberMetal.FEATURES; - _emberMetal.default.FEATURES.isEnabled = _emberMetal.isFeatureEnabled; - _emberMetal.default._Cache = _emberMetal.Cache; - _emberMetal.default.on = _emberMetal.on; - _emberMetal.default.addListener = _emberMetal.addListener; - _emberMetal.default.removeListener = _emberMetal.removeListener; - _emberMetal.default._suspendListener = _emberMetal.suspendListener; - _emberMetal.default._suspendListeners = _emberMetal.suspendListeners; - _emberMetal.default.sendEvent = _emberMetal.sendEvent; - _emberMetal.default.hasListeners = _emberMetal.hasListeners; - _emberMetal.default.watchedEvents = _emberMetal.watchedEvents; - _emberMetal.default.listenersFor = _emberMetal.listenersFor; - _emberMetal.default.accumulateListeners = _emberMetal.accumulateListeners; - _emberMetal.default.isNone = _emberMetal.isNone; - _emberMetal.default.isEmpty = _emberMetal.isEmpty; - _emberMetal.default.isBlank = _emberMetal.isBlank; - _emberMetal.default.isPresent = _emberMetal.isPresent; - _emberMetal.default.run = _emberMetal.run; - _emberMetal.default._ObserverSet = _emberMetal.ObserverSet; - _emberMetal.default.propertyWillChange = _emberMetal.propertyWillChange; - _emberMetal.default.propertyDidChange = _emberMetal.propertyDidChange; - _emberMetal.default.overrideChains = _emberMetal.overrideChains; - _emberMetal.default.beginPropertyChanges = _emberMetal.beginPropertyChanges; - _emberMetal.default.endPropertyChanges = _emberMetal.endPropertyChanges; - _emberMetal.default.changeProperties = _emberMetal.changeProperties; - _emberMetal.default.platform = { - defineProperty: true, - hasPropertyAccessors: true + /** + Invokes the passed target/method and optional arguments after a specified + period of time. The last parameter of this method must always be a number + of milliseconds. + + You should use this method whenever you need to run some action after a + period of time instead of using `setTimeout()`. This method will ensure that + items that expire during the same script execution cycle all execute + together, which is often more efficient than using a real setTimeout. + + ```javascript + run.later(myContext, function() { + // code here will execute within a RunLoop in about 500ms with this == myContext + }, 500); + ``` + + @method later + @param {Object} [target] target of method to invoke + @param {Function|String} method The method to invoke. + If you pass a string it will be resolved on the + target at the time the method is invoked. + @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 () /*target, method*/{ + return backburner.later.apply(backburner, arguments); }; - _emberMetal.default.defineProperty = _emberMetal.defineProperty; - _emberMetal.default.watchKey = _emberMetal.watchKey; - _emberMetal.default.unwatchKey = _emberMetal.unwatchKey; - _emberMetal.default.removeChainWatcher = _emberMetal.removeChainWatcher; - _emberMetal.default._ChainNode = _emberMetal.ChainNode; - _emberMetal.default.finishChains = _emberMetal.finishChains; - _emberMetal.default.watchPath = _emberMetal.watchPath; - _emberMetal.default.unwatchPath = _emberMetal.unwatchPath; - _emberMetal.default.watch = _emberMetal.watch; - _emberMetal.default.isWatching = _emberMetal.isWatching; - _emberMetal.default.unwatch = _emberMetal.unwatch; - _emberMetal.default.destroy = _emberMetal.destroy; - _emberMetal.default.libraries = _emberMetal.libraries; - _emberMetal.default.OrderedSet = _emberMetal.OrderedSet; - _emberMetal.default.Map = _emberMetal.Map; - _emberMetal.default.MapWithDefault = _emberMetal.MapWithDefault; - _emberMetal.default.getProperties = _emberMetal.getProperties; - _emberMetal.default.setProperties = _emberMetal.setProperties; - _emberMetal.default.expandProperties = _emberMetal.expandProperties; - _emberMetal.default.NAME_KEY = _emberMetal.NAME_KEY; - _emberMetal.default.addObserver = _emberMetal.addObserver; - _emberMetal.default.observersFor = _emberMetal.observersFor; - _emberMetal.default.removeObserver = _emberMetal.removeObserver; - _emberMetal.default._suspendObserver = _emberMetal._suspendObserver; - _emberMetal.default._suspendObservers = _emberMetal._suspendObservers; - _emberMetal.default.required = _emberMetal.required; - _emberMetal.default.aliasMethod = _emberMetal.aliasMethod; - _emberMetal.default.observer = _emberMetal.observer; - _emberMetal.default.immediateObserver = _emberMetal._immediateObserver; - _emberMetal.default.mixin = _emberMetal.mixin; - _emberMetal.default.Mixin = _emberMetal.Mixin; - _emberMetal.default.bind = _emberMetal.bind; - _emberMetal.default.Binding = _emberMetal.Binding; - _emberMetal.default.isGlobalPath = _emberMetal.isGlobalPath; - if (false) { - _emberMetal.default.WeakMap = _emberMetal.WeakMap; - } + /** + Schedule a function to run one time during the current RunLoop. This is equivalent + to calling `scheduleOnce` with the "actions" queue. + + @method once + @param {Object} [target] The target of the method to invoke. + @param {Function|String} method The method to invoke. + If you pass a string it will be resolved on the + 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.once = function () { + for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } - Object.defineProperty(_emberMetal.default, 'ENV', { - get: function () { - return _emberEnvironment.ENV; - }, - enumerable: false - }); + args.unshift('actions'); + return backburner.scheduleOnce.apply(backburner, args); + }; /** - The context that Ember searches for namespace instances on. + Schedules a function to run one time in a given queue of the current RunLoop. + Calling this method with the same queue/target/method combination will have + no effect (past the initial call). - @private - */ - Object.defineProperty(_emberMetal.default, 'lookup', { - get: function () { - return _emberEnvironment.context.lookup; - }, - set: function (value) { - _emberEnvironment.context.lookup = value; - }, - enumerable: false - }); + Note that although you can pass optional arguments these will not be + considered when looking for duplicates. New arguments will replace previous + calls. + + ```javascript + function sayHi() { + console.log('hi'); + } + + run(function() { + run.scheduleOnce('afterRender', myContext, sayHi); + run.scheduleOnce('afterRender', myContext, sayHi); + // sayHi will only be executed once, in the afterRender queue of the RunLoop + }); + ``` + + Also note that passing an anonymous function to `run.scheduleOnce` will + not prevent additional calls with an identical anonymous function from + scheduling the items multiple times, e.g.: + + ```javascript + function scheduleIt() { + run.scheduleOnce('actions', myContext, function() { + console.log('Closure'); + }); + } + + scheduleIt(); + scheduleIt(); + + // "Closure" will print twice, even though we're using `run.scheduleOnce`, + // because the function we pass to it is anonymous and won't match the + // previously scheduled operation. + ``` + + Available queues, and their order, can be found at `run.queues` + + @method scheduleOnce + @param {String} [queue] The name of the queue to schedule against. Default queues are 'sync' and 'actions'. + @param {Object} [target] The target of the method to invoke. + @param {Function|String} method The method to invoke. + If you pass a string it will be resolved on the + 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 () /*queue, target, method*/{ + return backburner.scheduleOnce.apply(backburner, arguments); + }; - _emberMetal.default.EXTEND_PROTOTYPES = _emberEnvironment.ENV.EXTEND_PROTOTYPES; + /** + Schedules an item to run from within a separate run loop, after + control has been returned to the system. This is equivalent to calling + `run.later` with a wait time of 1ms. + + ```javascript + run.next(myContext, function() { + // code to be executed in the next run loop, + // which will be scheduled after the current one + }); + ``` + + Multiple operations scheduled with `run.next` will coalesce + into the same later run loop, along with any other operations + scheduled by `run.later` that expire right around the same + time that `run.next` operations will fire. + + Note that there are often alternatives to using `run.next`. + For instance, if you'd like to schedule an operation to happen + after all DOM element operations have completed within the current + run loop, you can make use of the `afterRender` run loop queue (added + by the `ember-views` package, along with the preceding `render` queue + where all the DOM element operations happen). + + Example: + + ```javascript + export default Ember.Component.extend({ + didInsertElement() { + this._super(...arguments); + run.scheduleOnce('afterRender', this, 'processChildElements'); + }, + + processChildElements() { + // ... do something with component's child component + // elements after they've finished rendering, which + // can't be done within this component's + // `didInsertElement` hook because that gets run + // before the child elements have been added to the DOM. + } + }); + ``` + + One benefit of the above approach compared to using `run.next` is + that you will be able to perform DOM/CSS operations before unprocessed + elements are rendered to the screen, which may prevent flickering or + other artifacts caused by delaying processing until after rendering. + + The other major benefit to the above approach is that `run.next` + introduces an element of non-determinism, which can make things much + harder to test, due to its reliance on `setTimeout`; it's much harder + to guarantee the order of scheduled operations when they are scheduled + outside of the current run loop, i.e. with `run.next`. + + @method next + @param {Object} [target] target of method to invoke + @param {Function|String} method The method to invoke. + If you pass a string it will be resolved on the + 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.next = function () { + for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; + } - // BACKWARDS COMPAT ACCESSORS FOR ENV FLAGS - Object.defineProperty(_emberMetal.default, 'LOG_STACKTRACE_ON_DEPRECATION', { - get: function () { - return _emberEnvironment.ENV.LOG_STACKTRACE_ON_DEPRECATION; - }, - set: function (value) { - _emberEnvironment.ENV.LOG_STACKTRACE_ON_DEPRECATION = !!value; - }, - enumerable: false - }); + args.push(1); + return backburner.later.apply(backburner, args); + }; - Object.defineProperty(_emberMetal.default, 'LOG_VERSION', { - get: function () { - return _emberEnvironment.ENV.LOG_VERSION; - }, - set: function (value) { - _emberEnvironment.ENV.LOG_VERSION = !!value; - }, - enumerable: false - }); + /** + Cancels a scheduled item. Must be a value returned by `run.later()`, + `run.once()`, `run.scheduleOnce()`, `run.next()`, `run.debounce()`, or + `run.throttle()`. + + ```javascript + let runNext = run.next(myContext, function() { + // will not be executed + }); + + run.cancel(runNext); + + let runLater = run.later(myContext, function() { + // will not be executed + }, 500); + + run.cancel(runLater); + + let runScheduleOnce = run.scheduleOnce('afterRender', myContext, function() { + // will not be executed + }); + + run.cancel(runScheduleOnce); + + let runOnce = run.once(myContext, function() { + // will not be executed + }); + + run.cancel(runOnce); + + let throttle = run.throttle(myContext, function() { + // will not be executed + }, 1, false); + + run.cancel(throttle); + + let debounce = run.debounce(myContext, function() { + // will not be executed + }, 1); + + run.cancel(debounce); + + let debounceImmediate = run.debounce(myContext, function() { + // will be executed since we passed in true (immediate) + }, 100, true); + + // the 100ms delay until this method can be called again will be cancelled + run.cancel(debounceImmediate); + ``` + + @method cancel + @param {Object} timer Timer object to cancel + @return {Boolean} true if cancelled or false/undefined if it wasn't found + @public + */ + run.cancel = function (timer) { + return backburner.cancel(timer); + }; - Object.defineProperty(_emberMetal.default, 'MODEL_FACTORY_INJECTIONS', { - get: function () { - return _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS; - }, - set: function (value) { - _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS = !!value; - }, - enumerable: false - }); + /** + Delay calling the target method until the debounce period has elapsed + with no additional debounce calls. If `debounce` is called again before + the specified time has elapsed, the timer is reset and the entire period + must pass again before the target method is called. + + This method should be used when an event may be called multiple times + but the action should only be called once when the event is done firing. + A common example is for scroll events where you only want updates to + happen once scrolling has ceased. + + ```javascript + function whoRan() { + console.log(this.name + ' ran.'); + } + + let myContext = { name: 'debounce' }; + + run.debounce(myContext, whoRan, 150); + + // less than 150ms passes + run.debounce(myContext, whoRan, 150); + + // 150ms passes + // whoRan is invoked with context myContext + // console logs 'debounce ran.' one time. + ``` + + Immediate allows you to run the function immediately, but debounce + other calls for this function until the wait time has elapsed. If + `debounce` is called again before the specified time has elapsed, + the timer is reset and the entire period must pass again before + the method can be called again. + + ```javascript + function whoRan() { + console.log(this.name + ' ran.'); + } + + let myContext = { name: 'debounce' }; + + run.debounce(myContext, whoRan, 150, true); + + // console logs 'debounce ran.' one time immediately. + // 100ms passes + run.debounce(myContext, whoRan, 150, true); + + // 150ms passes and nothing else is logged to the console and + // the debouncee is no longer being watched + run.debounce(myContext, whoRan, 150, true); + + // console logs 'debounce ran.' one time immediately. + // 150ms passes and nothing else is logged to the console and + // the debouncee is no longer being watched + + ``` + + @method debounce + @param {Object} [target] target of method to invoke + @param {Function|String} method The method to invoke. + May be a function or a string. If you pass a string + then it will be looked up on the passed target. + @param {Object} [args*] Optional arguments to pass to the timeout. + @param {Number} wait Number of milliseconds to wait. + @param {Boolean} immediate Trigger the function on the leading instead + of the trailing edge of the wait interval. Defaults to false. + @return {Array} Timer information for use in cancelling, see `run.cancel`. + @public + */ + run.debounce = function () { + return backburner.debounce.apply(backburner, arguments); + }; - Object.defineProperty(_emberMetal.default, 'LOG_BINDINGS', { - get: function () { - return _emberEnvironment.ENV.LOG_BINDINGS; - }, - set: function (value) { - _emberEnvironment.ENV.LOG_BINDINGS = !!value; - }, - enumerable: false - }); + /** + Ensure that the target method is never called more frequently than + the specified spacing period. The target method is called immediately. + + ```javascript + function whoRan() { + console.log(this.name + ' ran.'); + } + + let myContext = { name: 'throttle' }; + + run.throttle(myContext, whoRan, 150); + // whoRan is invoked with context myContext + // console logs 'throttle ran.' + + // 50ms passes + run.throttle(myContext, whoRan, 150); + + // 50ms passes + run.throttle(myContext, whoRan, 150); + + // 150ms passes + run.throttle(myContext, whoRan, 150); + // whoRan is invoked with context myContext + // console logs 'throttle ran.' + ``` + + @method throttle + @param {Object} [target] target of method to invoke + @param {Function|String} method The method to invoke. + May be a function or a string. If you pass a string + then it will be looked up on the passed target. + @param {Object} [args*] Optional arguments to pass to the timeout. + @param {Number} spacing Number of milliseconds to space out requests. + @param {Boolean} immediate Trigger the function on the leading instead + of the trailing edge of the wait interval. Defaults to true. + @return {Array} Timer information for use in cancelling, see `run.cancel`. + @public + */ + run.throttle = function () { + return backburner.throttle.apply(backburner, arguments); + }; /** - A function may be assigned to `Ember.onerror` to be called when Ember - internals encounter an error. This is useful for specialized error handling - and reporting code. - - ```javascript - Ember.onerror = function(error) { - Em.$.ajax('/report-error', 'POST', { - stack: error.stack, - otherInformation: 'whatever app state you want to provide' - }); - }; - ``` + Add a new named queue after the specified queue. - Internally, `Ember.onerror` is used as Backburner's error handler. + The queue to add will only be added once. - @event onerror - @for Ember - @param {Exception} error the error object - @public + @method _addQueue + @param {String} name the name of the queue to add. + @param {String} after the name of the queue to add after. + @private */ - Object.defineProperty(_emberMetal.default, 'onerror', { - get: _emberMetal.getOnerror, - set: _emberMetal.setOnerror, - enumerable: false - }); + run._addQueue = function (name, after) { + if (run.queues.indexOf(name) === -1) { + run.queues.splice(run.queues.indexOf(after) + 1, 0, name); + } + }; +}); +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; /** - An empty function useful for some operations. Always returns `this`. + Set a list of properties on an object. These properties are set inside + a single `beginPropertyChanges` and `endPropertyChanges` batch, so + observers will be buffered. - @method K - @return {Object} + ```javascript + let anObject = Ember.Object.create(); + + anObject.setProperties({ + firstName: 'Stanley', + lastName: 'Stuart', + age: 21 + }); + ``` + + @method setProperties + @param obj + @param {Object} properties + @return properties @public */ - _emberMetal.default.K = function K() { - return this; + + function setProperties(obj, properties) { + if (!properties || typeof properties !== 'object') { + return properties; + } + _emberMetalProperty_events.changeProperties(function () { + var props = Object.keys(properties); + var propertyName = undefined; + + for (var i = 0; i < props.length; i++) { + propertyName = props[i]; + + _emberMetalProperty_set.set(obj, propertyName, properties[propertyName]); + } + }); + return properties; + } +}); +enifed('ember-metal/tags', ['exports', '@glimmer/reference', 'ember-metal/meta', 'require', 'ember-metal/is_proxy'], function (exports, _glimmerReference, _emberMetalMeta, _require, _emberMetalIs_proxy) { + 'use strict'; + + exports.setHasViews = setHasViews; + exports.tagForProperty = tagForProperty; + exports.tagFor = tagFor; + exports.markObjectAsDirty = markObjectAsDirty; + + var hasViews = function () { + return false; }; - Object.defineProperty(_emberMetal.default, 'testing', { - get: _emberMetal.isTesting, - set: _emberMetal.setTesting, - enumerable: false - }); + function setHasViews(fn) { + hasViews = fn; + } - if (!_require.has('ember-debug')) { - _emberMetal.default.Debug = { - registerDeprecationHandler: function () {}, - registerWarnHandler: function () {} - }; + function makeTag() { + return new _glimmerReference.DirtyableTag(); } - /** - @class Backburner - @for Ember - @private - */ - _emberMetal.default.Backburner = function () { + function tagForProperty(object, propertyKey, _meta) { + if (_emberMetalIs_proxy.isProxy(object)) { + return tagFor(object, _meta); + } - function BackburnerAlias(args) { - return _backburner.default.apply(this, args); + if (typeof object === 'object' && object) { + var meta = _meta || _emberMetalMeta.meta(object); + var tags = meta.writableTags(); + var tag = tags[propertyKey]; + if (tag) { + return tag; + } + + return tags[propertyKey] = makeTag(); + } else { + return _glimmerReference.CONSTANT_TAG; } + } - BackburnerAlias.prototype = _backburner.default.prototype; + function tagFor(object, _meta) { + if (typeof object === 'object' && object) { + var meta = _meta || _emberMetalMeta.meta(object); + return meta.writableTag(makeTag); + } else { + return _glimmerReference.CONSTANT_TAG; + } + } - return new BackburnerAlias(arguments); - }; + function markObjectAsDirty(meta, propertyKey) { + var objectTag = meta && meta.readableTag(); - _emberMetal.default._Backburner = _backburner.default; + if (objectTag) { + objectTag.dirty(); + } - _emberMetal.default.Logger = _emberConsole.default; + var tags = meta && meta.readableTags(); + var propertyTag = tags && tags[propertyKey]; - // ****ember-runtime**** + if (propertyTag) { + propertyTag.dirty(); + } - _emberMetal.default.String = _emberRuntime.String; - _emberMetal.default.Object = _emberRuntime.Object; - _emberMetal.default._RegistryProxyMixin = _emberRuntime.RegistryProxyMixin; - _emberMetal.default._ContainerProxyMixin = _emberRuntime.ContainerProxyMixin; - _emberMetal.default.compare = _emberRuntime.compare; - _emberMetal.default.copy = _emberRuntime.copy; - _emberMetal.default.isEqual = _emberRuntime.isEqual; - _emberMetal.default.inject = _emberRuntime.inject; - _emberMetal.default.Array = _emberRuntime.Array; - _emberMetal.default.Comparable = _emberRuntime.Comparable; - _emberMetal.default.Enumerable = _emberRuntime.Enumerable; - _emberMetal.default.ArrayProxy = _emberRuntime.ArrayProxy; - _emberMetal.default.ObjectProxy = _emberRuntime.ObjectProxy; - _emberMetal.default.ActionHandler = _emberRuntime.ActionHandler; - _emberMetal.default.CoreObject = _emberRuntime.CoreObject; - _emberMetal.default.NativeArray = _emberRuntime.NativeArray; - _emberMetal.default.Copyable = _emberRuntime.Copyable; - _emberMetal.default.Freezable = _emberRuntime.Freezable; - _emberMetal.default.FROZEN_ERROR = _emberRuntime.FROZEN_ERROR; - _emberMetal.default.MutableEnumerable = _emberRuntime.MutableEnumerable; - _emberMetal.default.MutableArray = _emberRuntime.MutableArray; - _emberMetal.default.TargetActionSupport = _emberRuntime.TargetActionSupport; - _emberMetal.default.Evented = _emberRuntime.Evented; - _emberMetal.default.PromiseProxyMixin = _emberRuntime.PromiseProxyMixin; - _emberMetal.default.Observable = _emberRuntime.Observable; - _emberMetal.default.typeOf = _emberRuntime.typeOf; - _emberMetal.default.isArray = _emberRuntime.isArray; - _emberMetal.default.Object = _emberRuntime.Object; - _emberMetal.default.onLoad = _emberRuntime.onLoad; - _emberMetal.default.runLoadHooks = _emberRuntime.runLoadHooks; - _emberMetal.default.Controller = _emberRuntime.Controller; - _emberMetal.default.ControllerMixin = _emberRuntime.ControllerMixin; - _emberMetal.default.Service = _emberRuntime.Service; - _emberMetal.default._ProxyMixin = _emberRuntime._ProxyMixin; - _emberMetal.default.RSVP = _emberRuntime.RSVP; - _emberMetal.default.Namespace = _emberRuntime.Namespace; + if (objectTag || propertyTag) { + ensureRunloop(); + } + } - // ES6TODO: this seems a less than ideal way/place to add properties to Ember.computed - computed.empty = _emberRuntime.empty; - computed.notEmpty = _emberRuntime.notEmpty; - computed.none = _emberRuntime.none; - computed.not = _emberRuntime.not; - computed.bool = _emberRuntime.bool; - computed.match = _emberRuntime.match; - computed.equal = _emberRuntime.equal; - computed.gt = _emberRuntime.gt; - computed.gte = _emberRuntime.gte; - computed.lt = _emberRuntime.lt; - computed.lte = _emberRuntime.lte; - computed.oneWay = _emberRuntime.oneWay; - computed.reads = _emberRuntime.oneWay; - computed.readOnly = _emberRuntime.readOnly; - computed.deprecatingAlias = _emberRuntime.deprecatingAlias; - computed.and = _emberRuntime.and; - computed.or = _emberRuntime.or; - computed.any = _emberRuntime.any; + var run = undefined; - computed.sum = _emberRuntime.sum; - computed.min = _emberRuntime.min; - computed.max = _emberRuntime.max; - computed.map = _emberRuntime.map; - computed.sort = _emberRuntime.sort; - computed.setDiff = _emberRuntime.setDiff; - computed.mapBy = _emberRuntime.mapBy; - computed.filter = _emberRuntime.filter; - computed.filterBy = _emberRuntime.filterBy; - computed.uniq = _emberRuntime.uniq; + function K() {} - if (true) { - computed.uniqBy = _emberRuntime.uniqBy; + function ensureRunloop() { + if (!run) { + run = _require.default('ember-metal/run_loop').default; + } + + if (hasViews() && !run.backburner.currentInstance) { + run.schedule('actions', K); + } } - computed.union = _emberRuntime.union; - computed.intersect = _emberRuntime.intersect; - computed.collect = _emberRuntime.collect; +}); +enifed("ember-metal/testing", ["exports"], function (exports) { + "use strict"; - /** - Defines the hash of localized strings for the current language. Used by - the `Ember.String.loc()` helper. To localize, add string values to this - hash. - - @property STRINGS - @for Ember - @type Object - @private - */ - Object.defineProperty(_emberMetal.default, 'STRINGS', { - configurable: false, - get: _emberRuntime.getStrings, - set: _emberRuntime.setStrings - }); + exports.isTesting = isTesting; + exports.setTesting = setTesting; + var testing = false; - /** - Whether searching on the global for new Namespace instances is enabled. - - This is only exported here as to not break any addons. Given the new - visit API, you will have issues if you treat this as a indicator of - booted. - - Internally this is only exposing a flag in Namespace. - - @property BOOTED - @for Ember - @type Boolean - @private - */ - Object.defineProperty(_emberMetal.default, 'BOOTED', { - configurable: false, - enumerable: false, - get: _emberRuntime.isNamespaceSearchDisabled, - set: _emberRuntime.setNamespaceSearchDisabled - }); + function isTesting() { + return testing; + } - _emberMetal.default.Component = _emberGlimmer.Component; - _emberGlimmer.Helper.helper = _emberGlimmer.helper; - _emberMetal.default.Helper = _emberGlimmer.Helper; - _emberMetal.default.Checkbox = _emberGlimmer.Checkbox; - _emberMetal.default.TextField = _emberGlimmer.TextField; - _emberMetal.default.TextArea = _emberGlimmer.TextArea; - _emberMetal.default.LinkComponent = _emberGlimmer.LinkComponent; + function setTesting(value) { + testing = !!value; + } +}); +enifed('ember-metal/transaction', ['exports', 'ember-metal/meta', 'ember-metal/debug', 'ember-metal/features'], function (exports, _emberMetalMeta, _emberMetalDebug, _emberMetalFeatures) { + 'use strict'; - if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { - String.prototype.htmlSafe = function () { - return _emberGlimmer.htmlSafe(this); + var runInTransaction = undefined, + didRender = undefined, + assertNotRendered = undefined; + + // detect-backtracking-rerender by default is debug build only + // detect-glimmer-allow-backtracking-rerender can be enabled in custom builds + if (false || true) { + (function () { + var counter = 0; + var inTransaction = false; + var shouldReflush = undefined; + var debugStack = undefined; + + exports.default = runInTransaction = function (context, methodName) { + shouldReflush = false; + inTransaction = true; + + context[methodName](); + inTransaction = false; + counter++; + return shouldReflush; + }; + + exports.didRender = didRender = function (object, key, reference) { + if (!inTransaction) { + return; + } + var meta = _emberMetalMeta.meta(object); + var lastRendered = meta.writableLastRendered(); + lastRendered[key] = counter; + }; + + exports.assertNotRendered = assertNotRendered = function (object, key, _meta) { + var meta = _meta || _emberMetalMeta.meta(object); + var lastRendered = meta.readableLastRendered(); + + if (lastRendered && lastRendered[key] === counter) { + + shouldReflush = true; + } + }; + })(); + } else { + // in production do nothing to detect reflushes + exports.default = runInTransaction = function (context, methodName) { + context[methodName](); + return false; }; } - var EmberHandlebars = _emberMetal.default.Handlebars = _emberMetal.default.Handlebars || {}; - var EmberHTMLBars = _emberMetal.default.HTMLBars = _emberMetal.default.HTMLBars || {}; - var EmberHandleBarsUtils = EmberHandlebars.Utils = EmberHandlebars.Utils || {}; + exports.default = runInTransaction; + exports.didRender = didRender; + exports.assertNotRendered = assertNotRendered; +}); +enifed('ember-metal/watch_key', ['exports', 'ember-utils', 'ember-metal/features', 'ember-metal/meta', 'ember-metal/properties'], function (exports, _emberUtils, _emberMetalFeatures, _emberMetalMeta, _emberMetalProperties) { + 'use strict'; - Object.defineProperty(EmberHandlebars, 'SafeString', { - get: _emberGlimmer._getSafeString - }); + exports.watchKey = watchKey; + exports.unwatchKey = unwatchKey; - EmberHTMLBars.template = EmberHandlebars.template = _emberGlimmer.template; - EmberHandleBarsUtils.escapeExpression = _emberGlimmer.escapeExpression; - _emberRuntime.String.htmlSafe = _emberGlimmer.htmlSafe; + var handleMandatorySetter = undefined; + + function watchKey(obj, keyName, meta) { + if (typeof obj !== 'object' || obj === null) { + return; + } + var m = meta || _emberMetalMeta.meta(obj); + + // activate watching first time + if (!m.peekWatching(keyName)) { + m.writeWatching(keyName, 1); + + var possibleDesc = obj[keyName]; + var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; + if (desc && desc.willWatch) { + desc.willWatch(obj, keyName); + } + + 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 = _emberUtils.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) { + if (typeof obj !== 'object' || obj === null) { + return; + } + var meta = _meta || _emberMetalMeta.meta(obj); + + // do nothing of this object has already been destroyed + if (meta.isSourceDestroyed()) { + return; + } + + var count = meta.peekWatching(keyName); + if (count === 1) { + meta.writeWatching(keyName, 0); + + var possibleDesc = obj[keyName]; + var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; + + if (desc && desc.didUnwatch) { + desc.didUnwatch(obj, keyName); + } + + 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 = _emberUtils.lookupDescriptor(obj, keyName); + + if (maybeMandatoryDescriptor.set && maybeMandatoryDescriptor.set.isMandatorySetter) { + if (maybeMandatoryDescriptor.get && maybeMandatoryDescriptor.get.isInheritingGetter) { + var possibleValue = meta.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: meta.peekValues(keyName) + }); + meta.deleteFromValues(keyName); + } + } + } + } else if (count > 1) { + meta.writeWatching(keyName, count - 1); + } + } +}); +enifed('ember-metal/watch_path', ['exports', 'ember-metal/meta', 'ember-metal/chains'], function (exports, _emberMetalMeta, _emberMetalChains) { + 'use strict'; + + exports.makeChainNode = makeChainNode; + exports.watchPath = watchPath; + exports.unwatchPath = unwatchPath; - if (true) { - _emberRuntime.String.isHTMLSafe = _emberGlimmer.isHTMLSafe; + // get the chains for the current object. If the current object has + // chains inherited from the proto they will be cloned and reconfigured for + // the current object. + function chainsFor(obj, meta) { + return (meta || _emberMetalMeta.meta(obj)).writableChains(makeChainNode); } - EmberHTMLBars.makeBoundHelper = _emberGlimmer.makeBoundHelper; - /** - 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. - - @property TEMPLATES - @for Ember - @type Object - @private - */ - Object.defineProperty(_emberMetal.default, 'TEMPLATES', { - get: _emberGlimmer.getTemplates, - set: _emberGlimmer.setTemplates, - configurable: false, - enumerable: false - }); + function makeChainNode(obj) { + return new _emberMetalChains.ChainNode(null, null, obj); + } - exports.VERSION = _emberVersion.default; + function watchPath(obj, keyPath, meta) { + if (typeof obj !== 'object' || obj === null) { + return; + } + var m = meta || _emberMetalMeta.meta(obj); + var counter = m.peekWatching(keyPath) || 0; + if (!counter) { + // activate watching first time + m.writeWatching(keyPath, 1); + chainsFor(obj, m).add(keyPath); + } else { + m.writeWatching(keyPath, counter + 1); + } + } - /** - The semantic version - @property VERSION - @type String - @public - */ - _emberMetal.default.VERSION = _emberVersion.default; + function unwatchPath(obj, keyPath, meta) { + if (typeof obj !== 'object' || obj === null) { + return; + } + var m = meta || _emberMetalMeta.meta(obj); + var counter = m.peekWatching(keyPath) || 0; - _emberMetal.libraries.registerCoreLibrary('Ember', _emberVersion.default); + if (counter === 1) { + m.writeWatching(keyPath, 0); + chainsFor(obj, m).remove(keyPath); + } else if (counter > 1) { + m.writeWatching(keyPath, counter - 1); + } + } +}); +enifed('ember-metal/watching', ['exports', 'ember-metal/watch_key', 'ember-metal/watch_path', 'ember-metal/path_cache', 'ember-metal/meta'], function (exports, _emberMetalWatch_key, _emberMetalWatch_path, _emberMetalPath_cache, _emberMetalMeta) { + /** + @module ember-metal + */ - _emberMetal.default.create = _emberMetal.deprecateFunc('Ember.create is deprecated in favor of Object.create', { id: 'ember-metal.ember-create', until: '3.0.0' }, Object.create); - _emberMetal.default.keys = _emberMetal.deprecateFunc('Ember.keys is deprecated in favor of Object.keys', { id: 'ember-metal.ember.keys', until: '3.0.0' }, Object.keys); + 'use strict'; - // require the main entry points for each of these packages - // this is so that the global exports occur properly + exports.isWatching = isWatching; + exports.watcherCount = watcherCount; + exports.unwatch = unwatch; + exports.destroy = destroy; /** - Alias for jQuery + Starts watching a property on an object. Whenever the property changes, + invokes `Ember.propertyWillChange` and `Ember.propertyDidChange`. This is the + primitive used by observers and dependent keys; usually you will never call + this method directly but instead use higher level methods like + `Ember.addObserver()` - @method $ - @for Ember - @public - */ - _emberMetal.default.$ = _emberViews.jQuery; - - _emberMetal.default.ViewTargetActionSupport = _emberViews.ViewTargetActionSupport; - - _emberMetal.default.ViewUtils = { - isSimpleClick: _emberViews.isSimpleClick, - getViewElement: _emberViews.getViewElement, - getViewBounds: _emberViews.getViewBounds, - getViewClientRects: _emberViews.getViewClientRects, - getViewBoundingClientRect: _emberViews.getViewBoundingClientRect, - getRootViews: _emberViews.getRootViews, - getChildViews: _emberViews.getChildViews - }; - - _emberMetal.default.TextSupport = _emberViews.TextSupport; - _emberMetal.default.ComponentLookup = _emberViews.ComponentLookup; - _emberMetal.default.EventDispatcher = _emberViews.EventDispatcher; - - _emberMetal.default.Location = _emberRouting.Location; - _emberMetal.default.AutoLocation = _emberRouting.AutoLocation; - _emberMetal.default.HashLocation = _emberRouting.HashLocation; - _emberMetal.default.HistoryLocation = _emberRouting.HistoryLocation; - _emberMetal.default.NoneLocation = _emberRouting.NoneLocation; - _emberMetal.default.controllerFor = _emberRouting.controllerFor; - _emberMetal.default.generateControllerFactory = _emberRouting.generateControllerFactory; - _emberMetal.default.generateController = _emberRouting.generateController; - _emberMetal.default.RouterDSL = _emberRouting.RouterDSL; - _emberMetal.default.Router = _emberRouting.Router; - _emberMetal.default.Route = _emberRouting.Route; - - _emberMetal.default.Application = _emberApplication.Application; - _emberMetal.default.ApplicationInstance = _emberApplication.ApplicationInstance; - _emberMetal.default.Engine = _emberApplication.Engine; - _emberMetal.default.EngineInstance = _emberApplication.EngineInstance; - _emberMetal.default.DefaultResolver = _emberMetal.default.Resolver = _emberApplication.Resolver; - - _emberRuntime.runLoadHooks('Ember.Application', _emberApplication.Application); + @private + @method watch + @for Ember + @param obj + @param {String} _keyPath + */ + function watch(obj, _keyPath, m) { + if (!_emberMetalPath_cache.isPath(_keyPath)) { + _emberMetalWatch_key.watchKey(obj, _keyPath, m); + } else { + _emberMetalWatch_path.watchPath(obj, _keyPath, m); + } + } - _emberMetal.default.DataAdapter = _emberExtensionSupport.DataAdapter; - _emberMetal.default.ContainerDebugAdapter = _emberExtensionSupport.ContainerDebugAdapter; + exports.watch = watch; - if (_require.has('ember-template-compiler')) { - _require.default('ember-template-compiler'); + function isWatching(obj, key) { + if (typeof obj !== 'object' || obj === null) { + return false; + } + var meta = _emberMetalMeta.peekMeta(obj); + return (meta && meta.peekWatching(key)) > 0; } - // do this to ensure that Ember.Test is defined properly on the global - // if it is present. - if (_require.has('ember-testing')) { - var testing = _require.default('ember-testing'); - - _emberMetal.default.Test = testing.Test; - _emberMetal.default.Test.Adapter = testing.Adapter; - _emberMetal.default.Test.QUnitAdapter = testing.QUnitAdapter; - _emberMetal.default.setupForTesting = testing.setupForTesting; + function watcherCount(obj, key) { + var meta = _emberMetalMeta.peekMeta(obj); + return meta && meta.peekWatching(key) || 0; } - _emberRuntime.runLoadHooks('Ember'); + function unwatch(obj, _keyPath, m) { + if (!_emberMetalPath_cache.isPath(_keyPath)) { + _emberMetalWatch_key.unwatchKey(obj, _keyPath, m); + } else { + _emberMetalWatch_path.unwatchPath(obj, _keyPath, m); + } + } /** - @module ember + Tears down the meta on an object so that it can be garbage collected. + Multiple calls will have no effect. + + @method destroy + @for Ember + @param {Object} obj the object to destroy + @return {void} + @private */ - exports.default = _emberMetal.default; - /* globals module */ - if (typeof module === 'object' && module.exports) { - module.exports = _emberMetal.default; - } else { - _emberEnvironment.context.exports.Ember = _emberEnvironment.context.exports.Em = _emberMetal.default; + function destroy(obj) { + _emberMetalMeta.deleteMeta(obj); } }); +enifed('ember-metal/weak_map', ['exports', 'ember-utils', 'ember-metal/meta'], function (exports, _emberUtils, _emberMetalMeta) { + 'use strict'; -// ****ember-environment**** + exports.default = WeakMap; -// ****ember-metal**** + var id = 0; -// computed macros + // Returns whether Type(value) is Object according to the terminology in the spec + function isObject(value) { + return typeof value === 'object' && value !== null || typeof value === 'function'; + } -// reduced computed macros -enifed("ember/version", ["exports"], function (exports) { - "use strict"; + /* + * @class Ember.WeakMap + * @public + * @category ember-metal-weakmap + * + * A partial polyfill for [WeakMap](http://www.ecma-international.org/ecma-262/6.0/#sec-weakmap-objects). + * + * There is a small but important caveat. This implementation assumes that the + * weak map will live longer (in the sense of garbage collection) than all of its + * keys, otherwise it is possible to leak the values stored in the weak map. In + * practice, most use cases satisfy this limitation which is why it is included + * in ember-metal. + */ - exports.default = "2.10.2-with-backtracking"; -}); -enifed('internal-test-helpers/apply-mixins', ['exports', 'ember-utils'], function (exports, _emberUtils) { - 'use strict'; + function WeakMap(iterable) { + if (!(this instanceof WeakMap)) { + throw new TypeError('Constructor WeakMap requires \'new\''); + } - exports.default = applyMixins; + this._id = _emberUtils.GUID_KEY + id++; - function isGenerator(mixin) { - return Array.isArray(mixin.cases) && typeof mixin.generate === 'function'; + if (iterable === null || iterable === undefined) { + return; + } else if (Array.isArray(iterable)) { + for (var i = 0; i < iterable.length; i++) { + var _iterable$i = iterable[i]; + var key = _iterable$i[0]; + var value = _iterable$i[1]; + + this.set(key, value); + } + } else { + throw new TypeError('The weak map constructor polyfill only supports an array argument'); + } } - function applyMixins(TestClass) { - for (var _len = arguments.length, mixins = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - mixins[_key - 1] = arguments[_key]; + /* + * @method get + * @param key {Object | Function} + * @return {Any} stored value + */ + WeakMap.prototype.get = function (obj) { + if (!isObject(obj)) { + return undefined; } - mixins.forEach(function (mixinOrGenerator) { - var mixin = undefined; + var meta = _emberMetalMeta.peekMeta(obj); + if (meta) { + var map = meta.readableWeak(); + if (map) { + if (map[this._id] === _emberMetalMeta.UNDEFINED) { + return undefined; + } - if (isGenerator(mixinOrGenerator)) { - (function () { - var generator = mixinOrGenerator; - mixin = {}; + return map[this._id]; + } + } + }; - generator.cases.forEach(function (value, idx) { - _emberUtils.assign(mixin, generator.generate(value, idx)); - }); - })(); - } else { - mixin = mixinOrGenerator; + /* + * @method set + * @param key {Object | Function} + * @param value {Any} + * @return {WeakMap} the weak map + */ + WeakMap.prototype.set = function (obj, value) { + if (!isObject(obj)) { + throw new TypeError('Invalid value used as weak map key'); + } + + if (value === undefined) { + value = _emberMetalMeta.UNDEFINED; + } + + _emberMetalMeta.meta(obj).writableWeak()[this._id] = value; + + return this; + }; + + /* + * @method has + * @param key {Object | Function} + * @return {boolean} if the key exists + */ + WeakMap.prototype.has = function (obj) { + if (!isObject(obj)) { + return false; + } + + var meta = _emberMetalMeta.peekMeta(obj); + if (meta) { + var map = meta.readableWeak(); + if (map) { + return map[this._id] !== undefined; } + } - _emberUtils.assign(TestClass.prototype, mixin); - }); + return false; + }; - return TestClass; - } + /* + * @method delete + * @param key {Object | Function} + * @return {boolean} if the key was deleted + */ + WeakMap.prototype.delete = function (obj) { + if (this.has(obj)) { + delete _emberMetalMeta.meta(obj).writableWeak()[this._id]; + return true; + } else { + return false; + } + }; + + /* + * @method toString + * @return {String} + */ + WeakMap.prototype.toString = function () { + return '[object WeakMap]'; + }; }); -enifed('internal-test-helpers/build-owner', ['exports', 'container', 'ember-routing', 'ember-application', 'ember-runtime'], function (exports, _container, _emberRouting, _emberApplication, _emberRuntime) { +enifed('ember-routing/ext/controller', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/utils'], function (exports, _emberMetal, _emberRuntime, _emberRoutingUtils) { 'use strict'; - exports.default = buildOwner; - - function buildOwner() { - var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - - var ownerOptions = options.ownerOptions || {}; - var resolver = options.resolver; - var bootOptions = options.bootOptions || {}; + /** + @module ember + @submodule ember-routing + */ - var Owner = _emberRuntime.Object.extend(_emberRuntime.RegistryProxyMixin, _emberRuntime.ContainerProxyMixin); + _emberRuntime.ControllerMixin.reopen({ + concatenatedProperties: ['queryParams'], - var namespace = _emberRuntime.Object.create({ - Resolver: { create: function () { - return resolver; - } } - }); + /** + Defines which query parameters the controller accepts. + If you give the names `['category','page']` it will bind + the values of these query parameters to the variables + `this.category` and `this.page` + @property queryParams + @public + */ + queryParams: null, - var fallbackRegistry = _emberApplication.Application.buildRegistry(namespace); - fallbackRegistry.register('router:main', _emberRouting.Router); + /** + This property is updated to various different callback functions depending on + the current "state" of the backing route. It is used by + `Ember.Controller.prototype._qpChanged`. + The methods backing each state can be found in the `Ember.Route.prototype._qp` computed + property return value (the `.states` property). The current values are listed here for + the sanity of future travelers: + * `inactive` - This state is used when this controller instance is not part of the active + route heirarchy. Set in `Ember.Route.prototype._reset` (a `router.js` microlib hook) and + `Ember.Route.prototype.actions.finalizeQueryParamChange`. + * `active` - This state is used when this controller instance is part of the active + route heirarchy. Set in `Ember.Route.prototype.actions.finalizeQueryParamChange`. + * `allowOverrides` - This state is used in `Ember.Route.prototype.setup` (`route.js` microlib hook). + @method _qpDelegate + @private + */ + _qpDelegate: null, // set by route - var registry = new _container.Registry({ - fallback: fallbackRegistry - }); + /** + During `Ember.Route#setup` observers are created to invoke this method + when any of the query params declared in `Ember.Controller#queryParams` property + are changed. + When invoked this method uses the currently active query param update delegate + (see `Ember.Controller.prototype._qpDelegate` for details) and invokes it with + the QP key/value being changed. + @method _qpChanged + @private + */ + _qpChanged: function (controller, _prop) { + var prop = _prop.substr(0, _prop.length - 3); - _emberApplication.ApplicationInstance.setupRegistry(registry, bootOptions); + var delegate = controller._qpDelegate; + var value = _emberMetal.get(controller, prop); + delegate(prop, value); + }, - var owner = Owner.create({ - __registry__: registry, - __container__: null - }, ownerOptions); + /** + Transition the application into another route. The route may + be either a single route or route path: + ```javascript + aController.transitionToRoute('blogPosts'); + aController.transitionToRoute('blogPosts.recentEntries'); + ``` + Optionally supply a model for the route in question. The model + will be serialized into the URL using the `serialize` hook of + the route: + ```javascript + aController.transitionToRoute('blogPost', aPost); + ``` + If a literal is passed (such as a number or a string), it will + be treated as an identifier instead. In this case, the `model` + hook of the route will be triggered: + ```javascript + aController.transitionToRoute('blogPost', 1); + ``` + Multiple models will be applied last to first recursively up the + route tree. + ```javascript + App.Router.map(function() { + this.route('blogPost', { path: ':blogPostId' }, function() { + this.route('blogComment', { path: ':blogCommentId', resetNamespace: true }); + }); + }); + aController.transitionToRoute('blogComment', aPost, aComment); + aController.transitionToRoute('blogComment', 1, 13); + ``` + It is also possible to pass a URL (a string that starts with a + `/`). This is intended for testing and debugging purposes and + should rarely be used in production code. + ```javascript + aController.transitionToRoute('/'); + aController.transitionToRoute('/blog/post/1/comment/13'); + aController.transitionToRoute('/blog/posts?sort=title'); + ``` + An options hash with a `queryParams` property may be provided as + the final argument to add query parameters to the destination URL. + ```javascript + aController.transitionToRoute('blogPost', 1, { + queryParams: { showComments: 'true' } + }); + // if you just want to transition the query parameters without changing the route + aController.transitionToRoute({ queryParams: { sort: 'date' } }); + ``` + See also [replaceRoute](/api/classes/Ember.ControllerMixin.html#method_replaceRoute). + @param {String} name the name of the route or a URL + @param {...Object} models the model(s) or identifier(s) to be used + while transitioning to the route. + @param {Object} [options] optional hash with a queryParams property + containing a mapping of query parameters + @for Ember.ControllerMixin + @method transitionToRoute + @public + */ + transitionToRoute: function () { + // target may be either another controller or a router + var target = _emberMetal.get(this, 'target'); + var method = target.transitionToRoute || target.transitionTo; - var container = registry.container({ owner: owner }); - owner.__container__ = container; + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - return owner; - } -}); -enifed('internal-test-helpers/confirm-export', ['exports', 'require'], function (exports, _require) { - 'use strict'; + return method.apply(target, _emberRoutingUtils.prefixRouteNameArg(this, args)); + }, - exports.default = confirmExport; + /** + Transition into another route while replacing the current URL, if possible. + This will replace the current history entry instead of adding a new one. + Beside that, it is identical to `transitionToRoute` in all other respects. + ```javascript + aController.replaceRoute('blogPosts'); + aController.replaceRoute('blogPosts.recentEntries'); + ``` + Optionally supply a model for the route in question. The model + will be serialized into the URL using the `serialize` hook of + the route: + ```javascript + aController.replaceRoute('blogPost', aPost); + ``` + If a literal is passed (such as a number or a string), it will + be treated as an identifier instead. In this case, the `model` + hook of the route will be triggered: + ```javascript + aController.replaceRoute('blogPost', 1); + ``` + Multiple models will be applied last to first recursively up the + route tree. + ```javascript + App.Router.map(function() { + this.route('blogPost', { path: ':blogPostId' }, function() { + this.route('blogComment', { path: ':blogCommentId', resetNamespace: true }); + }); + }); + aController.replaceRoute('blogComment', aPost, aComment); + aController.replaceRoute('blogComment', 1, 13); + ``` + It is also possible to pass a URL (a string that starts with a + `/`). This is intended for testing and debugging purposes and + should rarely be used in production code. + ```javascript + aController.replaceRoute('/'); + aController.replaceRoute('/blog/post/1/comment/13'); + ``` + @param {String} name the name of the route or a URL + @param {...Object} models the model(s) or identifier(s) to be used + while transitioning to the route. + @for Ember.ControllerMixin + @method replaceRoute + @public + */ + replaceRoute: function () { + // target may be either another controller or a router + var target = _emberMetal.get(this, 'target'); + var method = target.replaceRoute || target.replaceWith; - function getDescriptor(obj, path) { - var parts = path.split('.'); - var value = obj; - for (var i = 0; i < parts.length - 1; i++) { - var part = parts[i]; - value = value[part]; - if (!value) { - return undefined; + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; } - } - var last = parts[parts.length - 1]; - return Object.getOwnPropertyDescriptor(value, last); - } - - function confirmExport(Ember, assert, path, moduleId, exportName) { - var desc = getDescriptor(Ember, path); - assert.ok(desc, 'the property exists on the global'); - - var mod = _require.default(moduleId); - if (typeof exportName === 'string') { - assert.equal(desc.value, mod[exportName], 'Ember.' + path + ' is exported correctly'); - assert.notEqual(mod[exportName], undefined, 'Ember.' + path + ' is not `undefined`'); - } else { - assert.equal(desc.get, mod[exportName.get], 'Ember.' + path + ' getter is exported correctly'); - assert.notEqual(desc.get, undefined, 'Ember.' + path + ' getter is not undefined'); - if (exportName.set) { - assert.equal(desc.set, mod[exportName.set], 'Ember.' + path + ' setter is exported correctly'); - assert.notEqual(desc.set, undefined, 'Ember.' + path + ' setter is not undefined'); - } + return method.apply(target, _emberRoutingUtils.prefixRouteNameArg(target, args)); } - } + }); + + exports.default = _emberRuntime.ControllerMixin; }); -enifed('internal-test-helpers/equal-inner-html', ['exports'], function (exports) { - // detect side-effects of cloning svg elements in IE9-11 +enifed('ember-routing/ext/run_loop', ['exports', 'ember-metal'], function (exports, _emberMetal) { 'use strict'; - exports.default = equalInnerHTML; - var ieSVGInnerHTML = (function () { - if (!document.createElementNS) { - return false; - } - var div = document.createElement('div'); - var node = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); - div.appendChild(node); - var clone = div.cloneNode(true); - return clone.innerHTML === ''; - })(); + /** + @module ember + @submodule ember-views + */ - function normalizeInnerHTML(actualHTML) { - if (ieSVGInnerHTML) { - // Replace `` with ``, etc. - // drop namespace attribute - actualHTML = actualHTML.replace(/ xmlns="[^"]+"/, ''); - // replace self-closing elements - actualHTML = actualHTML.replace(/<([^ >]+) [^\/>]*\/>/gi, function (tag, tagName) { - return tag.slice(0, tag.length - 3) + '>'; - }); - } + // Add a new named queue after the 'actions' queue (where RSVP promises + // resolve), which is used in router transitions to prevent unnecessary + // loading state entry if all context promises resolve on the + // 'actions' queue first. + _emberMetal.run._addQueue('routerTransitions', 'actions'); +}); +enifed('ember-routing/index', ['exports', '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/system/query_params', 'ember-routing/services/routing', 'ember-routing/services/router', 'ember-routing/system/cache'], function (exports, _emberRoutingExtRun_loop, _emberRoutingExtController, _emberRoutingLocationApi, _emberRoutingLocationNone_location, _emberRoutingLocationHash_location, _emberRoutingLocationHistory_location, _emberRoutingLocationAuto_location, _emberRoutingSystemGenerate_controller, _emberRoutingSystemController_for, _emberRoutingSystemDsl, _emberRoutingSystemRouter, _emberRoutingSystemRoute, _emberRoutingSystemQuery_params, _emberRoutingServicesRouting, _emberRoutingServicesRouter, _emberRoutingSystemCache) { + /** + @module ember + @submodule ember-routing + */ - return actualHTML; - } + // ES6TODO: Cleanup modules with side-effects below + 'use strict'; - function equalInnerHTML(fragment, html) { - var actualHTML = normalizeInnerHTML(fragment.innerHTML); - QUnit.push(actualHTML === html, actualHTML, html); - } + exports.Location = _emberRoutingLocationApi.default; + exports.NoneLocation = _emberRoutingLocationNone_location.default; + exports.HashLocation = _emberRoutingLocationHash_location.default; + exports.HistoryLocation = _emberRoutingLocationHistory_location.default; + exports.AutoLocation = _emberRoutingLocationAuto_location.default; + exports.generateController = _emberRoutingSystemGenerate_controller.default; + exports.generateControllerFactory = _emberRoutingSystemGenerate_controller.generateControllerFactory; + exports.controllerFor = _emberRoutingSystemController_for.default; + exports.RouterDSL = _emberRoutingSystemDsl.default; + exports.Router = _emberRoutingSystemRouter.default; + exports.Route = _emberRoutingSystemRoute.default; + exports.QueryParams = _emberRoutingSystemQuery_params.default; + exports.RoutingService = _emberRoutingServicesRouting.default; + exports.RouterService = _emberRoutingServicesRouter.default; + exports.BucketCache = _emberRoutingSystemCache.default; }); -enifed('internal-test-helpers/equal-tokens', ['exports', 'simple-html-tokenizer'], function (exports, _simpleHtmlTokenizer) { +enifed('ember-routing/location/api', ['exports', 'ember-metal', 'ember-environment', 'ember-routing/location/util'], function (exports, _emberMetal, _emberEnvironment, _emberRoutingLocationUtil) { 'use strict'; - exports.default = equalTokens; - - function generateTokens(containerOrHTML) { - if (typeof containerOrHTML === 'string') { - return { - tokens: _simpleHtmlTokenizer.tokenize(containerOrHTML), - html: containerOrHTML - }; - } else { - return { - tokens: _simpleHtmlTokenizer.tokenize(containerOrHTML.innerHTML), - html: containerOrHTML.innerHTML - }; - } - } + /** + @module ember + @submodule ember-routing + */ - function normalizeTokens(tokens) { - tokens.forEach(function (token) { - if (token.type === 'StartTag') { - token.attributes = token.attributes.sort(function (a, b) { - if (a[0] > b[0]) { - return 1; - } - if (a[0] < b[0]) { - return -1; - } - return 0; - }); + /** + Ember.Location returns an instance of the correct implementation of + the `location` API. + + ## Implementations + + You can pass an implementation name (`hash`, `history`, `none`) to force a + particular implementation to be used in your application. + + ### HashLocation + + Using `HashLocation` results in URLs with a `#` (hash sign) separating the + server side URL portion of the URL from the portion that is used by Ember. + This relies upon the `hashchange` event existing in the browser. + + Example: + + ```javascript + App.Router.map(function() { + this.route('posts', function() { + this.route('new'); + }); + }); + + App.Router.reopen({ + location: 'hash' + }); + ``` + + This will result in a posts.new url of `/#/posts/new`. + + ### HistoryLocation + + Using `HistoryLocation` results in URLs that are indistinguishable from a + standard URL. This relies upon the browser's `history` API. + + Example: + + ```javascript + App.Router.map(function() { + this.route('posts', function() { + this.route('new'); + }); + }); + + App.Router.reopen({ + location: 'history' + }); + ``` + + This will result in a posts.new url of `/posts/new`. + + Keep in mind that your server must serve the Ember app at all the routes you + define. + + ### AutoLocation + + Using `AutoLocation`, the router will use the best Location class supported by + the browser it is running in. + + Browsers that support the `history` API will use `HistoryLocation`, those that + do not, but still support the `hashchange` event will use `HashLocation`, and + in the rare case neither is supported will use `NoneLocation`. + + Example: + + ```javascript + App.Router.map(function() { + this.route('posts', function() { + this.route('new'); + }); + }); + + App.Router.reopen({ + location: 'auto' + }); + ``` + + This will result in a posts.new url of `/posts/new` for modern browsers that + support the `history` api or `/#/posts/new` for older ones, like Internet + Explorer 9 and below. + + When a user visits a link to your application, they will be automatically + upgraded or downgraded to the appropriate `Location` class, with the URL + transformed accordingly, if needed. + + Keep in mind that since some of your users will use `HistoryLocation`, your + server must serve the Ember app at all the routes you define. + + ### NoneLocation + + Using `NoneLocation` causes Ember to not store the applications URL state + in the actual URL. This is generally used for testing purposes, and is one + of the changes made when calling `App.setupForTesting()`. + + ## Location API + + Each location implementation must provide the following methods: + + * implementation: returns the string name used to reference the implementation. + * getURL: returns the current URL. + * setURL(path): sets the current URL. + * replaceURL(path): replace the current URL (optional). + * onUpdateURL(callback): triggers the callback when the URL changes. + * formatURL(url): formats `url` to be placed into `href` attribute. + * detect() (optional): instructs the location to do any feature detection + necessary. If the location needs to redirect to a different URL, it + can cancel routing by setting the `cancelRouterSetup` property on itself + to `false`. + + Calling setURL or replaceURL will not trigger onUpdateURL callbacks. + + ## Custom implementation + + Ember scans `app/locations/*` for extending the Location API. + + Example: + + ```javascript + import Ember from 'ember'; + + export default Ember.HistoryLocation.extend({ + implementation: 'history-url-logging', + + pushState: function (path) { + console.log(path); + this._super.apply(this, arguments); } }); - } - - function equalTokens(actualContainer, expectedHTML) { - var message = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; + ``` + + @class Location + @namespace Ember + @static + @private + */ + exports.default = { + /** + This is deprecated in favor of using the container to lookup the location + implementation as desired. + For example: + ```javascript + // Given a location registered as follows: + container.register('location:history-test', HistoryTestLocation); + // You could create a new instance via: + container.lookup('location:history-test'); + ``` + @method create + @param {Object} options + @return {Object} an instance of an implementation of the `location` API + @deprecated Use the container to lookup the location implementation that you + need. + @private + */ + create: function (options) { + var implementation = options && options.implementation; - var actual = generateTokens(actualContainer); - var expected = generateTokens(expectedHTML); + var implementationClass = this.implementations[implementation]; - normalizeTokens(actual.tokens); - normalizeTokens(expected.tokens); + return implementationClass.create.apply(implementationClass, arguments); + }, - var equiv = QUnit.equiv(actual.tokens, expected.tokens); + implementations: {}, + _location: _emberEnvironment.environment.location, - if (equiv && expected.html !== actual.html) { - deepEqual(actual.tokens, expected.tokens, message); - } else { - QUnit.push(QUnit.equiv(actual.tokens, expected.tokens), actual.html, expected.html, message); + /** + Returns the current `location.hash` by parsing location.href since browsers + inconsistently URL-decode `location.hash`. + https://bugzilla.mozilla.org/show_bug.cgi?id=483304 + @private + @method getHash + @since 1.4.0 + */ + _getHash: function () { + return _emberRoutingLocationUtil.getHash(this.location); } - } + }; }); -enifed('internal-test-helpers/factory', ['exports'], function (exports) { +enifed('ember-routing/location/auto_location', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-environment', 'ember-routing/location/util'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberEnvironment, _emberRoutingLocationUtil) { 'use strict'; - exports.default = factory; - function setProperties(object, properties) { - for (var key in properties) { - if (properties.hasOwnProperty(key)) { - object[key] = properties[key]; - } - } - } - - var guids = 0; - - function factory() { - /*jshint validthis: true */ - - function Klass(options) { - setProperties(this, options); - this._guid = guids++; - this.isDestroyed = false; - } - - Klass.prototype.constructor = Klass; - Klass.prototype.destroy = function () { - this.isDestroyed = true; - }; - - Klass.prototype.toString = function () { - return ''; - }; - - Klass.create = create; - Klass.extend = extend; - Klass.reopen = extend; - Klass.reopenClass = reopenClass; - - return Klass; - - function create(options) { - return new this.prototype.constructor(options); - } - - function reopenClass(options) { - setProperties(this, options); - } - - function extend(options) { - function Child(options) { - Klass.call(this, options); - } + exports.getHistoryPath = getHistoryPath; + exports.getHashPath = getHashPath; - var Parent = this; + /** + @module ember + @submodule ember-routing + */ - Child.prototype = new Parent(); - Child.prototype.constructor = Child; + /** + Ember.AutoLocation will select the best location option based off browser + support with the priority order: history, hash, none. + + Clean pushState paths accessed by hashchange-only browsers will be redirected + to the hash-equivalent and vice versa so future transitions are consistent. + + Keep in mind that since some of your users will use `HistoryLocation`, your + server must serve the Ember app at all the routes you define. + + @class AutoLocation + @namespace Ember + @static + @private + */ + exports.default = _emberRuntime.Object.extend({ + /** + @private + The browser's `location` object. This is typically equivalent to + `window.location`, but may be overridden for testing. + @property location + @default environment.location + */ + location: _emberEnvironment.environment.location, - setProperties(Child, Klass); - setProperties(Child.prototype, options); + /** + @private + The browser's `history` object. This is typically equivalent to + `window.history`, but may be overridden for testing. + @since 1.5.1 + @property history + @default environment.history + */ + history: _emberEnvironment.environment.history, - Child.create = create; - Child.extend = extend; - Child.reopen = extend; + /** + @private + The user agent's global variable. In browsers, this will be `window`. + @since 1.11 + @property global + @default window + */ + global: _emberEnvironment.environment.window, - Child.reopenClass = reopenClass; + /** + @private + The browser's `userAgent`. This is typically equivalent to + `navigator.userAgent`, but may be overridden for testing. + @since 1.5.1 + @property userAgent + @default environment.history + */ + userAgent: _emberEnvironment.environment.userAgent, - return Child; - } - } -}); -enifed('internal-test-helpers/index', ['exports', 'internal-test-helpers/factory', 'internal-test-helpers/build-owner', 'internal-test-helpers/confirm-export', 'internal-test-helpers/equal-inner-html', 'internal-test-helpers/equal-tokens', 'internal-test-helpers/module-for', 'internal-test-helpers/strip', 'internal-test-helpers/apply-mixins', 'internal-test-helpers/matchers', 'internal-test-helpers/run', 'internal-test-helpers/test-groups', 'internal-test-helpers/test-cases/abstract', 'internal-test-helpers/test-cases/abstract-application', 'internal-test-helpers/test-cases/application', 'internal-test-helpers/test-cases/query-param', 'internal-test-helpers/test-cases/abstract-rendering', 'internal-test-helpers/test-cases/rendering'], function (exports, _internalTestHelpersFactory, _internalTestHelpersBuildOwner, _internalTestHelpersConfirmExport, _internalTestHelpersEqualInnerHtml, _internalTestHelpersEqualTokens, _internalTestHelpersModuleFor, _internalTestHelpersStrip, _internalTestHelpersApplyMixins, _internalTestHelpersMatchers, _internalTestHelpersRun, _internalTestHelpersTestGroups, _internalTestHelpersTestCasesAbstract, _internalTestHelpersTestCasesAbstractApplication, _internalTestHelpersTestCasesApplication, _internalTestHelpersTestCasesQueryParam, _internalTestHelpersTestCasesAbstractRendering, _internalTestHelpersTestCasesRendering) { - 'use strict'; + /** + @private + This property is used by the router to know whether to cancel the routing + setup process, which is needed while we redirect the browser. + @since 1.5.1 + @property cancelRouterSetup + @default false + */ + cancelRouterSetup: false, - exports.factory = _internalTestHelpersFactory.default; - exports.buildOwner = _internalTestHelpersBuildOwner.default; - exports.confirmExport = _internalTestHelpersConfirmExport.default; - exports.equalInnerHTML = _internalTestHelpersEqualInnerHtml.default; - exports.equalTokens = _internalTestHelpersEqualTokens.default; - exports.moduleFor = _internalTestHelpersModuleFor.default; - exports.strip = _internalTestHelpersStrip.default; - exports.applyMixins = _internalTestHelpersApplyMixins.default; - exports.equalsElement = _internalTestHelpersMatchers.equalsElement; - exports.classes = _internalTestHelpersMatchers.classes; - exports.styles = _internalTestHelpersMatchers.styles; - exports.regex = _internalTestHelpersMatchers.regex; - exports.runAppend = _internalTestHelpersRun.runAppend; - exports.runDestroy = _internalTestHelpersRun.runDestroy; - exports.testBoth = _internalTestHelpersTestGroups.testBoth; - exports.testWithDefault = _internalTestHelpersTestGroups.testWithDefault; - exports.AbstractTestCase = _internalTestHelpersTestCasesAbstract.default; - exports.AbstractApplicationTestCase = _internalTestHelpersTestCasesAbstractApplication.default; - exports.ApplicationTestCase = _internalTestHelpersTestCasesApplication.default; - exports.QueryParamTestCase = _internalTestHelpersTestCasesQueryParam.default; - exports.AbstractRenderingTestCase = _internalTestHelpersTestCasesAbstractRendering.default; - exports.RenderingTestCase = _internalTestHelpersTestCasesRendering.default; -}); -enifed('internal-test-helpers/matchers', ['exports'], function (exports) { - 'use strict'; + /** + @private + Will be pre-pended to path upon state change. + @since 1.5.1 + @property rootURL + @default '/' + */ + rootURL: '/', - exports.regex = regex; - exports.classes = classes; - exports.styles = styles; - exports.equalsElement = equalsElement; - var HTMLElement = window.HTMLElement; - var MATCHER_BRAND = '3d4ef194-13be-4ccf-8dc7-862eea02c93e'; + /** + Called by the router to instruct the location to do any feature detection + necessary. In the case of AutoLocation, we detect whether to use history + or hash concrete implementations. + @private + */ + detect: function () { + var rootURL = this.rootURL; - function isMatcher(obj) { - return typeof obj === 'object' && obj !== null && MATCHER_BRAND in obj; - } + var implementation = detectImplementation({ + location: this.location, + history: this.history, + userAgent: this.userAgent, + rootURL: rootURL, + documentMode: this.documentMode, + global: this.global + }); - function equalsAttr(expected) { - var _ref; + if (implementation === false) { + _emberMetal.set(this, 'cancelRouterSetup', true); + implementation = 'none'; + } - return _ref = {}, _ref[MATCHER_BRAND] = true, _ref.match = function (actual) { - return expected === actual; - }, _ref.expected = function () { - return expected; - }, _ref.message = function () { - return 'should equal ' + this.expected(); - }, _ref; - } + var concrete = _emberUtils.getOwner(this).lookup('location:' + implementation); + _emberMetal.set(concrete, 'rootURL', rootURL); - function regex(r) { - var _ref2; + _emberMetal.set(this, 'concreteImplementation', concrete); + }, - return _ref2 = {}, _ref2[MATCHER_BRAND] = true, _ref2.match = function (v) { - return r.test(v); - }, _ref2.expected = function () { - return r.toString(); - }, _ref2.message = function () { - return 'should match ' + this.expected(); - }, _ref2; - } + initState: delegateToConcreteImplementation('initState'), + getURL: delegateToConcreteImplementation('getURL'), + setURL: delegateToConcreteImplementation('setURL'), + replaceURL: delegateToConcreteImplementation('replaceURL'), + onUpdateURL: delegateToConcreteImplementation('onUpdateURL'), + formatURL: delegateToConcreteImplementation('formatURL'), - function classes(expected) { - var _ref3; + willDestroy: function () { + var concreteImplementation = _emberMetal.get(this, 'concreteImplementation'); - return _ref3 = {}, _ref3[MATCHER_BRAND] = true, _ref3.match = function (actual) { - actual = actual.trim(); - return actual && expected.split(/\s+/).sort().join(' ') === actual.trim().split(/\s+/).sort().join(' '); - }, _ref3.expected = function () { - return expected; - }, _ref3.message = function () { - return 'should match ' + this.expected(); - }, _ref3; - } + if (concreteImplementation) { + concreteImplementation.destroy(); + } + } + }); - function styles(expected) { - var _ref4; + function delegateToConcreteImplementation(methodName) { + return function () { + var concreteImplementation = _emberMetal.get(this, 'concreteImplementation'); - return _ref4 = {}, _ref4[MATCHER_BRAND] = true, _ref4.match = function (actual) { - // coerce `null` or `undefined` to an empty string - // needed for matching empty styles on IE9 - IE11 - actual = actual || ''; - actual = actual.trim(); + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - return expected.split(';').map(function (s) { - return s.trim(); - }).filter(function (s) { - return s; - }).sort().join('; ') === actual.split(';').map(function (s) { - return s.trim(); - }).filter(function (s) { - return s; - }).sort().join('; '); - }, _ref4.expected = function () { - return expected; - }, _ref4.message = function () { - return 'should match ' + this.expected(); - }, _ref4; + return _emberUtils.tryInvoke(concreteImplementation, methodName, args); + }; } - function equalsElement(element, tagName, attributes, content) { - QUnit.push(element.tagName === tagName.toUpperCase(), element.tagName.toLowerCase(), tagName, 'expect tagName to be ' + tagName); + /* + Given the browser's `location`, `history` and `userAgent`, and a configured + root URL, this function detects whether the browser supports the [History + API](https://developer.mozilla.org/en-US/docs/Web/API/History) and returns a + string representing the Location object to use based on its determination. + + For example, if the page loads in an evergreen browser, this function would + return the string "history", meaning the history API and thus HistoryLocation + should be used. If the page is loaded in IE8, it will return the string + "hash," indicating that the History API should be simulated by manipulating the + hash portion of the location. + + */ - var expectedAttrs = {}; - var expectedCount = 0; + function detectImplementation(options) { + var location = options.location; + var userAgent = options.userAgent; + var history = options.history; + var documentMode = options.documentMode; + var global = options.global; + var rootURL = options.rootURL; - for (var _name in attributes) { - var expected = attributes[_name]; - if (expected !== null) { - expectedCount++; - } + var implementation = 'none'; + var cancelRouterSetup = false; + var currentPath = _emberRoutingLocationUtil.getFullPath(location); - var matcher = isMatcher(expected) ? expected : equalsAttr(expected); + if (_emberRoutingLocationUtil.supportsHistory(userAgent, history)) { + var historyPath = getHistoryPath(rootURL, location); - expectedAttrs[_name] = matcher; + // If the browser supports history and we have a history path, we can use + // the history location with no redirects. + if (currentPath === historyPath) { + return 'history'; + } else { + if (currentPath.substr(0, 2) === '/#') { + history.replaceState({ path: historyPath }, null, historyPath); + implementation = 'history'; + } else { + cancelRouterSetup = true; + _emberRoutingLocationUtil.replacePath(location, historyPath); + } + } + } else if (_emberRoutingLocationUtil.supportsHashChange(documentMode, global)) { + var hashPath = getHashPath(rootURL, location); - QUnit.push(expectedAttrs[_name].match(element.getAttribute(_name)), element.getAttribute(_name), matcher.expected(), 'Element\'s ' + _name + ' attribute ' + matcher.message()); + // Be sure we're using a hashed path, otherwise let's switch over it to so + // we start off clean and consistent. We'll count an index path with no + // hash as "good enough" as well. + if (currentPath === hashPath || currentPath === '/' && hashPath === '/#/') { + implementation = 'hash'; + } else { + // Our URL isn't in the expected hash-supported format, so we want to + // cancel the router setup and replace the URL to start off clean + cancelRouterSetup = true; + _emberRoutingLocationUtil.replacePath(location, hashPath); + } } - var actualAttributes = {}; - - for (var i = 0, l = element.attributes.length; i < l; i++) { - actualAttributes[element.attributes[i].name] = element.attributes[i].value; + if (cancelRouterSetup) { + return false; } - if (!(element instanceof HTMLElement)) { - QUnit.push(element instanceof HTMLElement, null, null, 'Element must be an HTML Element, not an SVG Element'); - } else { - QUnit.push(element.attributes.length === expectedCount || !attributes, element.attributes.length, expectedCount, 'Expected ' + expectedCount + ' attributes; got ' + element.outerHTML); - - if (content !== null) { - QUnit.push(element.innerHTML === content, element.innerHTML, content, 'The element had \'' + content + '\' as its content'); - } - } + return implementation; } -}); -enifed('internal-test-helpers/module-for', ['exports', 'internal-test-helpers/apply-mixins'], function (exports, _internalTestHelpersApplyMixins) { - 'use strict'; - exports.default = moduleFor; + /** + @private + + Returns the current path as it should appear for HistoryLocation supported + browsers. This may very well differ from the real current path (e.g. if it + starts off as a hashed URL) + */ - function moduleFor(description, TestClass) { - var context = undefined; + function getHistoryPath(rootURL, location) { + var path = _emberRoutingLocationUtil.getPath(location); + var hash = _emberRoutingLocationUtil.getHash(location); + var query = _emberRoutingLocationUtil.getQuery(location); + var rootURLIndex = path.indexOf(rootURL); + var routeHash = undefined, + hashParts = undefined; - QUnit.module(description, { - setup: function () { - context = new TestClass(); - }, + // By convention, Ember.js routes using HashLocation are required to start + // with `#/`. Anything else should NOT be considered a route and should + // be passed straight through, without transformation. + if (hash.substr(0, 2) === '#/') { + // There could be extra hash segments after the route + hashParts = hash.substr(1).split('#'); + // The first one is always the route url + routeHash = hashParts.shift(); - teardown: function () { - context.teardown(); + // If the path already has a trailing slash, remove the one + // from the hashed route so we don't double up. + if (path.charAt(path.length - 1) === '/') { + routeHash = routeHash.substr(1); } - }); - - for (var _len = arguments.length, mixins = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - mixins[_key - 2] = arguments[_key]; - } - - _internalTestHelpersApplyMixins.default(TestClass, mixins); - - var proto = TestClass.prototype; - while (proto !== Object.prototype) { - Object.keys(proto).forEach(generateTest); - proto = Object.getPrototypeOf(proto); - } + // This is the "expected" final order + path += routeHash + query; - function generateTest(name) { - if (name.indexOf('@test ') === 0) { - QUnit.test(name.slice(5), function (assert) { - return context[name](assert); - }); - } else if (name.indexOf('@skip ') === 0) { - QUnit.skip(name.slice(5), function (assert) { - return context[name](assert); - }); + if (hashParts.length) { + path += '#' + hashParts.join('#'); } + } else { + path += query + hash; } - } -}); -enifed('internal-test-helpers/run', ['exports', 'ember-metal'], function (exports, _emberMetal) { - 'use strict'; - - exports.runAppend = runAppend; - exports.runDestroy = runDestroy; - function runAppend(view) { - _emberMetal.run(view, 'appendTo', '#qunit-fixture'); + return path; } - function runDestroy(toDestroy) { - if (toDestroy) { - _emberMetal.run(toDestroy, 'destroy'); - } - } -}); -enifed('internal-test-helpers/strip', ['exports'], function (exports) { - 'use strict'; + /** + @private + + Returns the current path as it should appear for HashLocation supported + browsers. This may very well differ from the real current path. + + @method _getHashPath + */ - exports.default = strip; + function getHashPath(rootURL, location) { + var path = rootURL; + var historyPath = getHistoryPath(rootURL, location); + var routePath = historyPath.substr(rootURL.length); - function strip(_ref) { - for (var _len = arguments.length, values = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - values[_key - 1] = arguments[_key]; - } + if (routePath !== '') { + if (routePath[0] !== '/') { + routePath = '/' + routePath; + } - var strings = _ref; + path += '#' + routePath; + } - var str = strings.map(function (string, index) { - var interpolated = values[index]; - return string + (interpolated !== undefined ? interpolated : ''); - }).join(''); - return str.split('\n').map(function (s) { - return s.trim(); - }).join(''); + return path; } }); -enifed('internal-test-helpers/test-cases/abstract-application', ['exports', 'ember-metal', 'ember-views', 'ember-application', 'ember-routing', 'ember-template-compiler', 'internal-test-helpers/test-cases/abstract', 'internal-test-helpers/run'], function (exports, _emberMetal, _emberViews, _emberApplication, _emberRouting, _emberTemplateCompiler, _internalTestHelpersTestCasesAbstract, _internalTestHelpersRun) { +enifed('ember-routing/location/hash_location', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/location/api'], function (exports, _emberMetal, _emberRuntime, _emberRoutingLocationApi) { 'use strict'; - var AbstractApplicationTestCase = (function (_AbstractTestCase) { - babelHelpers.inherits(AbstractApplicationTestCase, _AbstractTestCase); - - function AbstractApplicationTestCase() { - _AbstractTestCase.call(this); + /** + @module ember + @submodule ember-routing + */ - this.element = _emberViews.jQuery('#qunit-fixture')[0]; + /** + `Ember.HashLocation` implements the location API using the browser's + hash. At present, it relies on a `hashchange` event existing in the + browser. + + @class HashLocation + @namespace Ember + @extends Ember.Object + @private + */ + exports.default = _emberRuntime.Object.extend({ + implementation: 'hash', - this.application = _emberMetal.run(_emberApplication.Application, 'create', this.applicationOptions); + init: function () { + _emberMetal.set(this, 'location', _emberMetal.get(this, '_location') || window.location); - this.router = this.application.Router = _emberRouting.Router.extend(this.routerOptions); + this._hashchangeHandler = undefined; + }, - this.applicationInstance = null; - } + /** + @private + Returns normalized location.hash + @since 1.5.1 + @method getHash + */ + getHash: _emberRoutingLocationApi.default._getHash, - AbstractApplicationTestCase.prototype.teardown = function teardown() { - if (this.applicationInstance) { - _internalTestHelpersRun.runDestroy(this.applicationInstance); - } + /** + Returns the normalized URL, constructed from `location.hash`. + e.g. `#/foo` => `/foo` as well as `#/foo#bar` => `/foo#bar`. + By convention, hashed paths must begin with a forward slash, otherwise they + are not treated as a path so we can distinguish intent. + @private + @method getURL + */ + getURL: function () { + var originalPath = this.getHash().substr(1); + var outPath = originalPath; - _internalTestHelpersRun.runDestroy(this.application); - }; + if (outPath[0] !== '/') { + outPath = '/'; - AbstractApplicationTestCase.prototype.visit = function visit(url, options) { - var _this = this; + // Only add the # if the path isn't empty. + // We do NOT want `/#` since the ampersand + // is only included (conventionally) when + // the location.hash has a value + if (originalPath) { + outPath += '#' + originalPath; + } + } - var applicationInstance = this.applicationInstance; + return outPath; + }, - if (applicationInstance) { - return _emberMetal.run(applicationInstance, 'visit', url, options); - } else { - return _emberMetal.run(this.application, 'visit', url, options).then(function (instance) { - _this.applicationInstance = instance; - }); - } - }; + /** + Set the `location.hash` and remembers what was set. This prevents + `onUpdateURL` callbacks from triggering when the hash was set by + `HashLocation`. + @private + @method setURL + @param path {String} + */ + setURL: function (path) { + _emberMetal.get(this, 'location').hash = path; + _emberMetal.set(this, 'lastSetURL', path); + }, - AbstractApplicationTestCase.prototype.transitionTo = function transitionTo() { - return _emberMetal.run.apply(undefined, [this.appRouter, 'transitionTo'].concat(babelHelpers.slice.call(arguments))); - }; + /** + Uses location.replace to update the url without a page reload + or history modification. + @private + @method replaceURL + @param path {String} + */ + replaceURL: function (path) { + _emberMetal.get(this, 'location').replace('#' + path); + _emberMetal.set(this, 'lastSetURL', path); + }, - AbstractApplicationTestCase.prototype.compile = function compile(string, options) { - return _emberTemplateCompiler.compile.apply(undefined, arguments); - }; + /** + Register a callback to be invoked when the hash changes. These + callbacks will execute when the user presses the back or forward + button, but not after `setURL` is invoked. + @private + @method onUpdateURL + @param callback {Function} + */ + onUpdateURL: function (callback) { + var _this = this; - AbstractApplicationTestCase.prototype.registerRoute = function registerRoute(name, route) { - this.application.register('route:' + name, route); - }; + this._removeEventListener(); - AbstractApplicationTestCase.prototype.registerTemplate = function registerTemplate(name, template) { - this.application.register('template:' + name, this.compile(template, { - moduleName: name - })); - }; + this._hashchangeHandler = function () { + _emberMetal.run(function () { + var path = _this.getURL(); + if (_emberMetal.get(_this, 'lastSetURL') === path) { + return; + } - AbstractApplicationTestCase.prototype.registerComponent = function registerComponent(name, _ref) { - var _ref$ComponentClass = _ref.ComponentClass; - var ComponentClass = _ref$ComponentClass === undefined ? null : _ref$ComponentClass; - var _ref$template = _ref.template; - var template = _ref$template === undefined ? null : _ref$template; + _emberMetal.set(_this, 'lastSetURL', null); - if (ComponentClass) { - this.application.register('component:' + name, ComponentClass); - } + callback(path); + }); + }; - if (typeof template === 'string') { - this.application.register('template:components/' + name, this.compile(template, { - moduleName: 'components/' + name - })); - } - }; + window.addEventListener('hashchange', this._hashchangeHandler); + }, - AbstractApplicationTestCase.prototype.registerController = function registerController(name, controller) { - this.application.register('controller:' + name, controller); - }; + /** + Given a URL, formats it to be placed into the page as part + of an element's `href` attribute. + This is used, for example, when using the {{action}} helper + to generate a URL based on an event. + @private + @method formatURL + @param url {String} + */ + formatURL: function (url) { + return '#' + url; + }, - AbstractApplicationTestCase.prototype.registerEngine = function registerEngine(name, engine) { - this.application.register('engine:' + name, engine); - }; + /** + Cleans up the HashLocation event listener. + @private + @method willDestroy + */ + willDestroy: function () { + this._removeEventListener(); + }, - babelHelpers.createClass(AbstractApplicationTestCase, [{ - key: 'applicationOptions', - get: function () { - return { - rootElement: '#qunit-fixture', - autoboot: false - }; - } - }, { - key: 'routerOptions', - get: function () { - return { - location: 'none' - }; - } - }, { - key: 'appRouter', - get: function () { - return this.applicationInstance.lookup('router:main'); + _removeEventListener: function () { + if (this._hashchangeHandler) { + window.removeEventListener('hashchange', this._hashchangeHandler); } - }]); - return AbstractApplicationTestCase; - })(_internalTestHelpersTestCasesAbstract.default); - - exports.default = AbstractApplicationTestCase; + } + }); }); -enifed('internal-test-helpers/test-cases/abstract-rendering', ['exports', 'ember-utils', 'ember-template-compiler', 'ember-views', 'ember-glimmer', 'internal-test-helpers/test-cases/abstract', 'internal-test-helpers/build-owner', 'internal-test-helpers/run'], function (exports, _emberUtils, _emberTemplateCompiler, _emberViews, _emberGlimmer, _internalTestHelpersTestCasesAbstract, _internalTestHelpersBuildOwner, _internalTestHelpersRun) { +enifed('ember-routing/location/history_location', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/location/api'], function (exports, _emberMetal, _emberRuntime, _emberRoutingLocationApi) { 'use strict'; - var TextNode = window.Text; - - var AbstractRenderingTestCase = (function (_AbstractTestCase) { - babelHelpers.inherits(AbstractRenderingTestCase, _AbstractTestCase); - - function AbstractRenderingTestCase() { - _AbstractTestCase.call(this); - var owner = this.owner = _internalTestHelpersBuildOwner.default({ - ownerOptions: this.getOwnerOptions(), - bootOptions: this.getBootOptions(), - resolver: this.getResolver() - }); - - this.renderer = this.owner.lookup('renderer:-dom'); - this.element = _emberViews.jQuery('#qunit-fixture')[0]; - this.component = null; - - owner.register('event_dispatcher:main', _emberViews.EventDispatcher); - owner.inject('event_dispatcher:main', '_viewRegistry', '-view-registry:main'); - owner.lookup('event_dispatcher:main').setup(this.getCustomDispatcherEvents(), this.element); - } + /** + @module ember + @submodule ember-routing + */ - AbstractRenderingTestCase.prototype.compile = function compile() { - return _emberTemplateCompiler.compile.apply(undefined, arguments); - }; + var popstateFired = false; - AbstractRenderingTestCase.prototype.getCustomDispatcherEvents = function getCustomDispatcherEvents() { - return {}; - }; + var _uuid = undefined; - AbstractRenderingTestCase.prototype.getOwnerOptions = function getOwnerOptions() {}; + if (_emberMetal.isFeatureEnabled('ember-unique-location-history-state')) { + _uuid = function _uuid() { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { + var r, v; + r = Math.random() * 16 | 0; + v = c === 'x' ? r : r & 3 | 8; + return v.toString(16); + }); + }; + } - AbstractRenderingTestCase.prototype.getBootOptions = function getBootOptions() {}; + /** + Ember.HistoryLocation implements the location API using the browser's + history.pushState API. + + @class HistoryLocation + @namespace Ember + @extends Ember.Object + @private + */ + exports.default = _emberRuntime.Object.extend({ + implementation: 'history', - AbstractRenderingTestCase.prototype.getResolver = function getResolver() {}; + init: function () { + this._super.apply(this, arguments); - AbstractRenderingTestCase.prototype.teardown = function teardown() { - if (this.component) { - _internalTestHelpersRun.runDestroy(this.component); + var base = document.querySelector('base'); + var baseURL = ''; + if (base) { + baseURL = base.getAttribute('href'); } - if (this.owner) { - _internalTestHelpersRun.runDestroy(this.owner); + + _emberMetal.set(this, 'baseURL', baseURL); + _emberMetal.set(this, 'location', _emberMetal.get(this, 'location') || window.location); + + this._popstateHandler = undefined; + }, + + /** + Used to set state on first call to setURL + @private + @method initState + */ + initState: function () { + var history = _emberMetal.get(this, 'history') || window.history; + _emberMetal.set(this, 'history', history); + + if (history && 'state' in history) { + this.supportsHistory = true; } - }; - AbstractRenderingTestCase.prototype.render = function render(templateStr) { - var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - var owner = this.owner; + this.replaceState(this.formatURL(this.getURL())); + }, - owner.register('template:-top-level', this.compile(templateStr, { - moduleName: '-top-level' - })); + /** + Will be pre-pended to path upon state change + @property rootURL + @default '/' + @private + */ + rootURL: '/', - var attrs = _emberUtils.assign({}, context, { - tagName: '', - layoutName: '-top-level' - }); + /** + Returns the current `location.pathname` without `rootURL` or `baseURL` + @private + @method getURL + @return url {String} + */ + getURL: function () { + var location = _emberMetal.get(this, 'location'); + var path = location.pathname; - owner.register('component:-top-level', _emberGlimmer.Component.extend(attrs)); + var rootURL = _emberMetal.get(this, 'rootURL'); + var baseURL = _emberMetal.get(this, 'baseURL'); - this.component = owner.lookup('component:-top-level'); + // remove trailing slashes if they exists + rootURL = rootURL.replace(/\/$/, ''); + baseURL = baseURL.replace(/\/$/, ''); - _internalTestHelpersRun.runAppend(this.component); - }; + // remove baseURL and rootURL from start of path + var url = path.replace(new RegExp('^' + baseURL + '(?=/|$)'), '').replace(new RegExp('^' + rootURL + '(?=/|$)'), ''); - AbstractRenderingTestCase.prototype.rerender = function rerender() { - this.component.rerender(); - }; + var search = location.search || ''; + url += search + this.getHash(); - AbstractRenderingTestCase.prototype.registerHelper = function registerHelper(name, funcOrClassBody) { - var type = typeof funcOrClassBody; + return url; + }, - if (type === 'function') { - this.owner.register('helper:' + name, _emberGlimmer.helper(funcOrClassBody)); - } else if (type === 'object' && type !== null) { - this.owner.register('helper:' + name, _emberGlimmer.Helper.extend(funcOrClassBody)); - } else { - throw new Error('Cannot register ' + funcOrClassBody + ' as a helper'); - } - }; + /** + Uses `history.pushState` to update the url without a page reload. + @private + @method setURL + @param path {String} + */ + setURL: function (path) { + var state = this.getState(); + path = this.formatURL(path); - AbstractRenderingTestCase.prototype.registerPartial = function registerPartial(name, template) { - var owner = this.env.owner || this.owner; - if (typeof template === 'string') { - var moduleName = 'template:' + name; - owner.register(moduleName, this.compile(template, { moduleName: moduleName })); + if (!state || state.path !== path) { + this.pushState(path); } - }; + }, - AbstractRenderingTestCase.prototype.registerComponent = function registerComponent(name, _ref) { - var _ref$ComponentClass = _ref.ComponentClass; - var ComponentClass = _ref$ComponentClass === undefined ? null : _ref$ComponentClass; - var _ref$template = _ref.template; - var template = _ref$template === undefined ? null : _ref$template; - var owner = this.owner; + /** + Uses `history.replaceState` to update the url without a page reload + or history modification. + @private + @method replaceURL + @param path {String} + */ + replaceURL: function (path) { + var state = this.getState(); + path = this.formatURL(path); - if (ComponentClass) { - owner.register('component:' + name, ComponentClass); + if (!state || state.path !== path) { + this.replaceState(path); } + }, - if (typeof template === 'string') { - owner.register('template:components/' + name, this.compile(template, { - moduleName: 'components/' + name - })); + /** + Get the current `history.state`. Checks for if a polyfill is + required and if so fetches this._historyState. The state returned + from getState may be null if an iframe has changed a window's + history. + The object returned will contain a `path` for the given state as well + as a unique state `id`. The state index will allow the app to distinguish + between two states with similar paths but should be unique from one another. + @private + @method getState + @return state {Object} + */ + getState: function () { + if (this.supportsHistory) { + return _emberMetal.get(this, 'history').state; } - }; - AbstractRenderingTestCase.prototype.registerTemplate = function registerTemplate(name, template) { - var owner = this.owner; + return this._historyState; + }, - if (typeof template === 'string') { - owner.register('template:' + name, this.compile(template, { - moduleName: name - })); - } else { - throw new Error('Registered template "' + name + '" must be a string'); + /** + Pushes a new state. + @private + @method pushState + @param path {String} + */ + pushState: function (path) { + var state = { path: path }; + if (_emberMetal.isFeatureEnabled('ember-unique-location-history-state')) { + state.uuid = _uuid(); } - }; - AbstractRenderingTestCase.prototype.registerService = function registerService(name, klass) { - this.owner.register('service:' + name, klass); - }; + _emberMetal.get(this, 'history').pushState(state, null, path); - AbstractRenderingTestCase.prototype.assertTextNode = function assertTextNode(node, text) { - if (!(node instanceof TextNode)) { - throw new Error('Expecting a text node, but got ' + node); - } + this._historyState = state; - this.assert.strictEqual(node.textContent, text, 'node.textContent'); - }; + // used for webkit workaround + this._previousURL = this.getURL(); + }, - babelHelpers.createClass(AbstractRenderingTestCase, [{ - key: 'context', - get: function () { - return this.component; + /** + Replaces the current state. + @private + @method replaceState + @param path {String} + */ + replaceState: function (path) { + var state = { path: path }; + if (_emberMetal.isFeatureEnabled('ember-unique-location-history-state')) { + state.uuid = _uuid(); } - }]); - return AbstractRenderingTestCase; - })(_internalTestHelpersTestCasesAbstract.default); - exports.default = AbstractRenderingTestCase; -}); -enifed('internal-test-helpers/test-cases/abstract', ['exports', 'ember-utils', 'ember-metal', 'ember-views', 'internal-test-helpers/equal-inner-html', 'internal-test-helpers/equal-tokens', 'internal-test-helpers/matchers'], function (exports, _emberUtils, _emberMetal, _emberViews, _internalTestHelpersEqualInnerHtml, _internalTestHelpersEqualTokens, _internalTestHelpersMatchers) { - 'use strict'; + _emberMetal.get(this, 'history').replaceState(state, null, path); - var TextNode = window.Text; - var HTMLElement = window.HTMLElement; - var Comment = window.Comment; + this._historyState = state; - function isMarker(node) { - if (node instanceof Comment && node.textContent === '') { - return true; - } + // used for webkit workaround + this._previousURL = this.getURL(); + }, - if (node instanceof TextNode && node.textContent === '') { - return true; - } + /** + Register a callback to be invoked whenever the browser + history changes, including using forward and back buttons. + @private + @method onUpdateURL + @param callback {Function} + */ + onUpdateURL: function (callback) { + var _this = this; - return false; - } + this._removeEventListener(); - var AbstractTestCase = (function () { - function AbstractTestCase() { - this.element = null; - this.snapshot = null; - this.assert = QUnit.config.current.assert; - } + this._popstateHandler = function () { + // Ignore initial page load popstate event in Chrome + if (!popstateFired) { + popstateFired = true; + if (_this.getURL() === _this._previousURL) { + return; + } + } + callback(_this.getURL()); + }; - AbstractTestCase.prototype.teardown = function teardown() {}; + window.addEventListener('popstate', this._popstateHandler); + }, - AbstractTestCase.prototype.runTask = function runTask(callback) { - _emberMetal.run(callback); - }; + /** + Used when using `{{action}}` helper. The url is always appended to the rootURL. + @private + @method formatURL + @param url {String} + @return formatted url {String} + */ + formatURL: function (url) { + var rootURL = _emberMetal.get(this, 'rootURL'); + var baseURL = _emberMetal.get(this, 'baseURL'); - AbstractTestCase.prototype.runTaskNext = function runTaskNext(callback) { - _emberMetal.run.next(callback); - }; + if (url !== '') { + // remove trailing slashes if they exists + rootURL = rootURL.replace(/\/$/, ''); + baseURL = baseURL.replace(/\/$/, ''); + } else if (baseURL[0] === '/' && rootURL[0] === '/') { + // if baseURL and rootURL both start with a slash + // ... remove trailing slash from baseURL if it exists + baseURL = baseURL.replace(/\/$/, ''); + } - // The following methods require `this.element` to work + return baseURL + rootURL + url; + }, - AbstractTestCase.prototype.nthChild = function nthChild(n) { - var i = 0; - var node = this.element.firstChild; + /** + Cleans up the HistoryLocation event listener. + @private + @method willDestroy + */ + willDestroy: function () { + this._removeEventListener(); + }, - while (node) { - if (!isMarker(node)) { - i++; - } + /** + @private + Returns normalized location.hash + @method getHash + */ + getHash: _emberRoutingLocationApi.default._getHash, - if (i > n) { - break; - } else { - node = node.nextSibling; - } + _removeEventListener: function () { + if (this._popstateHandler) { + window.removeEventListener('popstate', this._popstateHandler); } + } + }); +}); +enifed('ember-routing/location/none_location', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { + 'use strict'; - return node; - }; - - AbstractTestCase.prototype.$ = function $(sel) { - return sel ? _emberViews.jQuery(sel, this.element) : _emberViews.jQuery(this.element); - }; + /** + @module ember + @submodule ember-routing + */ - AbstractTestCase.prototype.textValue = function textValue() { - return this.$().text(); - }; + /** + Ember.NoneLocation does not interact with the browser. It is useful for + testing, or when you need to manage state with your Router, but temporarily + don't want it to muck with the URL (for example when you embed your + application in a larger page). + + @class NoneLocation + @namespace Ember + @extends Ember.Object + @private + */ + exports.default = _emberRuntime.Object.extend({ + implementation: 'none', + path: '', - AbstractTestCase.prototype.takeSnapshot = function takeSnapshot() { - var snapshot = this.snapshot = []; + detect: function () { + var rootURL = this.rootURL; + }, - var node = this.element.firstChild; + /** + Will be pre-pended to path. + @private + @property rootURL + @default '/' + */ + rootURL: '/', - while (node) { - if (!isMarker(node)) { - snapshot.push(node); - } + /** + Returns the current path without `rootURL`. + @private + @method getURL + @return {String} path + */ + getURL: function () { + var path = _emberMetal.get(this, 'path'); + var rootURL = _emberMetal.get(this, 'rootURL'); - node = node.nextSibling; - } + // remove trailing slashes if they exists + rootURL = rootURL.replace(/\/$/, ''); - return snapshot; - }; + // remove rootURL from url + return path.replace(new RegExp('^' + rootURL + '(?=/|$)'), ''); + }, - AbstractTestCase.prototype.assertText = function assertText(text) { - this.assert.strictEqual(this.textValue(), text, '#qunit-fixture content should be: `' + text + '`'); - }; + /** + Set the path and remembers what was set. Using this method + to change the path will not invoke the `updateURL` callback. + @private + @method setURL + @param path {String} + */ + setURL: function (path) { + _emberMetal.set(this, 'path', path); + }, - AbstractTestCase.prototype.assertInnerHTML = function assertInnerHTML(html) { - _internalTestHelpersEqualInnerHtml.default(this.element, html); - }; + /** + Register a callback to be invoked when the path changes. These + callbacks will execute when the user presses the back or forward + button, but not after `setURL` is invoked. + @private + @method onUpdateURL + @param callback {Function} + */ + onUpdateURL: function (callback) { + this.updateCallback = callback; + }, - AbstractTestCase.prototype.assertHTML = function assertHTML(html) { - _internalTestHelpersEqualTokens.default(this.element, html, '#qunit-fixture content should be: `' + html + '`'); - }; + /** + Sets the path and calls the `updateURL` callback. + @private + @method handleURL + @param callback {Function} + */ + handleURL: function (url) { + _emberMetal.set(this, 'path', url); + this.updateCallback(url); + }, - AbstractTestCase.prototype.assertElement = function assertElement(node, _ref) { - var _ref$ElementType = _ref.ElementType; - var ElementType = _ref$ElementType === undefined ? HTMLElement : _ref$ElementType; - var tagName = _ref.tagName; - var _ref$attrs = _ref.attrs; - var attrs = _ref$attrs === undefined ? null : _ref$attrs; - var _ref$content = _ref.content; - var content = _ref$content === undefined ? null : _ref$content; + /** + Given a URL, formats it to be placed into the page as part + of an element's `href` attribute. + This is used, for example, when using the {{action}} helper + to generate a URL based on an event. + @private + @method formatURL + @param url {String} + @return {String} url + */ + formatURL: function (url) { + var rootURL = _emberMetal.get(this, 'rootURL'); - if (!(node instanceof ElementType)) { - throw new Error('Expecting a ' + ElementType.name + ', but got ' + node); + if (url !== '') { + // remove trailing slashes if they exists + rootURL = rootURL.replace(/\/$/, ''); } - _internalTestHelpersMatchers.equalsElement(node, tagName, attrs, content); - }; + return rootURL + url; + } + }); +}); +enifed('ember-routing/location/util', ['exports'], function (exports) { + /** + @private + + Returns the current `location.pathname`, normalized for IE inconsistencies. + */ + 'use strict'; - AbstractTestCase.prototype.assertComponentElement = function assertComponentElement(node, _ref2) { - var _ref2$ElementType = _ref2.ElementType; - var ElementType = _ref2$ElementType === undefined ? HTMLElement : _ref2$ElementType; - var _ref2$tagName = _ref2.tagName; - var tagName = _ref2$tagName === undefined ? 'div' : _ref2$tagName; - var _ref2$attrs = _ref2.attrs; - var attrs = _ref2$attrs === undefined ? null : _ref2$attrs; - var _ref2$content = _ref2.content; - var content = _ref2$content === undefined ? null : _ref2$content; + exports.getPath = getPath; + exports.getQuery = getQuery; + exports.getHash = getHash; + exports.getFullPath = getFullPath; + exports.getOrigin = getOrigin; + exports.supportsHashChange = supportsHashChange; + exports.supportsHistory = supportsHistory; + exports.replacePath = replacePath; - attrs = _emberUtils.assign({}, { id: _internalTestHelpersMatchers.regex(/^ember\d*$/), class: _internalTestHelpersMatchers.classes('ember-view') }, attrs || {}); - this.assertElement(node, { ElementType: ElementType, tagName: tagName, attrs: attrs, content: content }); - }; + function getPath(location) { + var pathname = location.pathname; + // Various versions of IE/Opera don't always return a leading slash + if (pathname[0] !== '/') { + pathname = '/' + pathname; + } - AbstractTestCase.prototype.assertSameNode = function assertSameNode(actual, expected) { - this.assert.strictEqual(actual, expected, 'DOM node stability'); - }; + return pathname; + } - AbstractTestCase.prototype.assertInvariants = function assertInvariants(oldSnapshot, newSnapshot) { - oldSnapshot = oldSnapshot || this.snapshot; - newSnapshot = newSnapshot || this.takeSnapshot(); + /** + @private + + Returns the current `location.search`. + */ - this.assert.strictEqual(newSnapshot.length, oldSnapshot.length, 'Same number of nodes'); + function getQuery(location) { + return location.search; + } + + /** + @private + + Returns the current `location.hash` by parsing location.href since browsers + inconsistently URL-decode `location.hash`. + + Should be passed the browser's `location` object as the first argument. + + https://bugzilla.mozilla.org/show_bug.cgi?id=483304 + */ + + function getHash(location) { + var href = location.href; + var hashIndex = href.indexOf('#'); - for (var i = 0; i < oldSnapshot.length; i++) { - this.assertSameNode(newSnapshot[i], oldSnapshot[i]); - } - }; + if (hashIndex === -1) { + return ''; + } else { + return href.substr(hashIndex); + } + } - AbstractTestCase.prototype.assertPartialInvariants = function assertPartialInvariants(start, end) { - this.assertInvariants(this.snapshot, this.takeSnapshot().slice(start, end)); - }; + function getFullPath(location) { + return getPath(location) + getQuery(location) + getHash(location); + } - AbstractTestCase.prototype.assertStableRerender = function assertStableRerender() { - var _this = this; + function getOrigin(location) { + var origin = location.origin; - this.takeSnapshot(); - this.runTask(function () { - return _this.rerender(); - }); - this.assertInvariants(); - }; + // Older browsers, especially IE, don't have origin + if (!origin) { + origin = location.protocol + '//' + location.hostname; - babelHelpers.createClass(AbstractTestCase, [{ - key: 'firstChild', - get: function () { - return this.nthChild(0); + if (location.port) { + origin += ':' + location.port; } - }, { - key: 'nodesCount', - get: function () { - var count = 0; - var node = this.element.firstChild; + } - while (node) { - if (!isMarker(node)) { - count++; - } + return origin; + } - node = node.nextSibling; - } + /* + `documentMode` only exist in Internet Explorer, and it's tested because IE8 running in + IE7 compatibility mode claims to support `onhashchange` but actually does not. + + `global` is an object that may have an `onhashchange` property. + + @private + @function supportsHashChange + */ - return count; - } - }]); - return AbstractTestCase; - })(); + function supportsHashChange(documentMode, global) { + return 'onhashchange' in global && (documentMode === undefined || documentMode > 7); + } - exports.default = AbstractTestCase; -}); -enifed('internal-test-helpers/test-cases/application', ['exports', 'internal-test-helpers/test-cases/abstract-application'], function (exports, _internalTestHelpersTestCasesAbstractApplication) { - 'use strict'; + /* + `userAgent` is a user agent string. We use user agent testing here, because + the stock Android browser is known to have buggy versions of the History API, + in some Android versions. + + @private + @function supportsHistory + */ - var ApplicationTestCase = (function (_AbstractApplicationTestCase) { - babelHelpers.inherits(ApplicationTestCase, _AbstractApplicationTestCase); + function supportsHistory(userAgent, history) { + // Boosted from Modernizr: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js + // The stock browser on Android 2.2 & 2.3, and 4.0.x returns positive on history support + // Unfortunately support is really buggy and there is no clean way to detect + // these bugs, so we fall back to a user agent sniff :( - function ApplicationTestCase() { - _AbstractApplicationTestCase.apply(this, arguments); + // We only want Android 2 and 4.0, stock browser, and not Chrome which identifies + // itself as 'Mobile Safari' as well, nor Windows Phone. + if ((userAgent.indexOf('Android 2.') !== -1 || userAgent.indexOf('Android 4.0') !== -1) && userAgent.indexOf('Mobile Safari') !== -1 && userAgent.indexOf('Chrome') === -1 && userAgent.indexOf('Windows Phone') === -1) { + return false; } - return ApplicationTestCase; - })(_internalTestHelpersTestCasesAbstractApplication.default); + return !!(history && 'pushState' in history); + } - exports.default = ApplicationTestCase; + /** + Replaces the current location, making sure we explicitly include the origin + to prevent redirecting to a different origin. + + @private + */ + + function replacePath(location, path) { + location.replace(getOrigin(location) + path); + } }); -enifed('internal-test-helpers/test-cases/query-param', ['exports', 'ember-runtime', 'ember-routing', 'ember-metal', 'internal-test-helpers/test-cases/application'], function (exports, _emberRuntime, _emberRouting, _emberMetal, _internalTestHelpersTestCasesApplication) { +enifed('ember-routing/services/router', ['exports', 'ember-runtime', 'ember-metal', 'ember-routing/system/dsl'], function (exports, _emberRuntime, _emberMetal, _emberRoutingSystemDsl) { + /** + @module ember + @submodule ember-routing + */ + 'use strict'; - var QueryParamTestCase = (function (_ApplicationTestCase) { - babelHelpers.inherits(QueryParamTestCase, _ApplicationTestCase); + /** + The Router service is the public API that provides component/view layer + access to the router. + + @public + @class RouterService + @category ember-routing-router-service + */ + var RouterService = _emberRuntime.Service.extend({ + currentRouteName: _emberRuntime.readOnly('router.currentRouteName'), + currentURL: _emberRuntime.readOnly('router.currentURL'), + location: _emberRuntime.readOnly('router.location'), + rootURL: _emberRuntime.readOnly('router.rootURL'), - function QueryParamTestCase() { - _ApplicationTestCase.call(this); + /** + Transition the application into another route. The route may + be either a single route or route path: + See [Route.transitionTo](http://emberjs.com/api/classes/Ember.Route.html#method_transitionTo) for more info. + @method transitionTo + @category ember-routing-router-service + @param {String} name the name of the route or a URL + @param {...Object} models the model(s) or identifier(s) to be used while + transitioning to the route. + @param {Object} [options] optional hash with a queryParams property + containing a mapping of query parameters + @return {Transition} the transition object associated with this + attempted transition + @public + */ + transitionTo: function () { + var _router; - var testCase = this; - testCase.expectedPushURL = null; - testCase.expectedReplaceURL = null; - this.application.register('location:test', _emberRouting.NoneLocation.extend({ - setURL: function (path) { - if (testCase.expectedReplaceURL) { - testCase.assert.ok(false, 'pushState occurred but a replaceState was expected'); - } + return (_router = this.router).transitionTo.apply(_router, arguments); + }, - if (testCase.expectedPushURL) { - testCase.assert.equal(path, testCase.expectedPushURL, 'an expected pushState occurred'); - testCase.expectedPushURL = null; - } + /** + Transition into another route while replacing the current URL, if possible. + The route may be either a single route or route path: + See [Route.replaceWith](http://emberjs.com/api/classes/Ember.Route.html#method_replaceWith) for more info. + @method replaceWith + @category ember-routing-router-service + @param {String} name the name of the route or a URL + @param {...Object} models the model(s) or identifier(s) to be used while + transitioning to the route. + @param {Object} [options] optional hash with a queryParams property + containing a mapping of query parameters + @return {Transition} the transition object associated with this + attempted transition + @public + */ + replaceWith: function () { + var _router2; - this.set('path', path); - }, + return (_router2 = this.router).replaceWith.apply(_router2, arguments); + } + }); - replaceURL: function (path) { - if (testCase.expectedPushURL) { - testCase.assert.ok(false, 'replaceState occurred but a pushState was expected'); - } + exports.default = RouterService; +}); +enifed('ember-routing/services/routing', ['exports', 'ember-utils', 'ember-runtime', 'ember-metal', 'ember-routing/utils'], function (exports, _emberUtils, _emberRuntime, _emberMetal, _emberRoutingUtils) { + /** + @module ember + @submodule ember-routing + */ - if (testCase.expectedReplaceURL) { - testCase.assert.equal(path, testCase.expectedReplaceURL, 'an expected replaceState occurred'); - testCase.expectedReplaceURL = null; - } + 'use strict'; - this.set('path', path); - } - })); - } + /** + 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 + the set of API needed for components to control routing without interacting + with router internals. + + @private + @class RoutingService + */ + exports.default = _emberRuntime.Service.extend({ + router: null, - QueryParamTestCase.prototype.visitAndAssert = function visitAndAssert(path) { - var _this = this; + targetState: _emberRuntime.readOnly('router.targetState'), + currentState: _emberRuntime.readOnly('router.currentState'), + currentRouteName: _emberRuntime.readOnly('router.currentRouteName'), + currentPath: _emberRuntime.readOnly('router.currentPath'), - return this.visit.apply(this, arguments).then(function () { - _this.assertCurrentPath(path); - }); - }; + availableRoutes: function () { + return Object.keys(_emberMetal.get(this, 'router').router.recognizer.names); + }, - QueryParamTestCase.prototype.getController = function getController(name) { - return this.applicationInstance.lookup('controller:' + name); - }; + hasRoute: function (routeName) { + return _emberMetal.get(this, 'router').hasRoute(routeName); + }, - QueryParamTestCase.prototype.getRoute = function getRoute(name) { - return this.applicationInstance.lookup('route:' + name); - }; + transitionTo: function (routeName, models, queryParams, shouldReplace) { + var router = _emberMetal.get(this, 'router'); - QueryParamTestCase.prototype.setAndFlush = function setAndFlush(obj, prop, value) { - return _emberMetal.run(obj, 'set', prop, value); - }; + var transition = router._doTransition(routeName, models, queryParams); - QueryParamTestCase.prototype.assertCurrentPath = function assertCurrentPath(path) { - var message = arguments.length <= 1 || arguments[1] === undefined ? 'current path equals \'' + path + '\'' : arguments[1]; - return (function () { - this.assert.equal(this.appRouter.get('location.path'), path, message); - }).apply(this, arguments); - }; + if (shouldReplace) { + transition.method('replace'); + } - /** - Sets up a Controller for a given route with a single query param and default - value. Can optionally extend the controller with an object. - @public - @method setSingleQPController - */ + return transition; + }, - QueryParamTestCase.prototype.setSingleQPController = function setSingleQPController(routeName) { - var param = arguments.length <= 1 || arguments[1] === undefined ? 'foo' : arguments[1]; - var defaultValue = arguments.length <= 2 || arguments[2] === undefined ? 'bar' : arguments[2]; + normalizeQueryParams: function (routeName, models, queryParams) { + var router = _emberMetal.get(this, 'router'); + router._prepareQueryParams(routeName, models, queryParams); + }, - var _Controller$extend; + generateURL: function (routeName, models, queryParams) { + var router = _emberMetal.get(this, 'router'); + if (!router.router) { + return; + } - var options = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3]; + var visibleQueryParams = {}; + _emberUtils.assign(visibleQueryParams, queryParams); - this.registerController(routeName, _emberRuntime.Controller.extend((_Controller$extend = { - queryParams: [param] - }, _Controller$extend[param] = defaultValue, _Controller$extend), options)); - }; + this.normalizeQueryParams(routeName, models, visibleQueryParams); - /** - Sets up a Controller for a given route with a custom property/url key mapping. - @public - @method setMappedQPController - */ + var args = _emberRoutingUtils.routeArgs(routeName, models, visibleQueryParams); + return router.generate.apply(router, args); + }, - QueryParamTestCase.prototype.setMappedQPController = function setMappedQPController(routeName) { - var prop = arguments.length <= 1 || arguments[1] === undefined ? 'page' : arguments[1]; - var urlKey = arguments.length <= 2 || arguments[2] === undefined ? 'parentPage' : arguments[2]; - var defaultValue = arguments.length <= 3 || arguments[3] === undefined ? 1 : arguments[3]; + isActiveForRoute: function (contexts, queryParams, routeName, routerState, isCurrentWhenSpecified) { + var router = _emberMetal.get(this, 'router'); - var _queryParams, _Controller$extend2; + var handlers = router.router.recognizer.handlersFor(routeName); + var leafName = handlers[handlers.length - 1].handler; + var maximumContexts = numberOfContextsAcceptedByHandler(routeName, handlers); - var options = arguments.length <= 4 || arguments[4] === undefined ? {} : arguments[4]; + // NOTE: any ugliness in the calculation of activeness is largely + // due to the fact that we support automatic normalizing of + // `resource` -> `resource.index`, even though there might be + // dynamic segments / query params defined on `resource.index` + // which complicates (and makes somewhat ambiguous) the calculation + // of activeness for links that link to `resource` instead of + // directly to `resource.index`. - this.registerController(routeName, _emberRuntime.Controller.extend((_Controller$extend2 = { - queryParams: (_queryParams = {}, _queryParams[prop] = urlKey, _queryParams) - }, _Controller$extend2[prop] = defaultValue, _Controller$extend2), options)); - }; + // if we don't have enough contexts revert back to full route name + // this is because the leaf route will use one of the contexts + if (contexts.length > maximumContexts) { + routeName = leafName; + } - babelHelpers.createClass(QueryParamTestCase, [{ - key: 'routerOptions', - get: function () { - return { - location: 'test' - }; + return routerState.isActiveIntent(routeName, contexts, queryParams, !isCurrentWhenSpecified); + } + }); + + function numberOfContextsAcceptedByHandler(handler, handlerInfos) { + var req = 0; + for (var i = 0; i < handlerInfos.length; i++) { + req += handlerInfos[i].names.length; + if (handlerInfos[i].handler === handler) { + break; } - }]); - return QueryParamTestCase; - })(_internalTestHelpersTestCasesApplication.default); + } - exports.default = QueryParamTestCase; + return req; + } }); -enifed('internal-test-helpers/test-cases/rendering', ['exports', 'ember-views', 'internal-test-helpers/test-cases/abstract-rendering'], function (exports, _emberViews, _internalTestHelpersTestCasesAbstractRendering) { +enifed('ember-routing/system/cache', ['exports', 'ember-utils', 'ember-runtime'], function (exports, _emberUtils, _emberRuntime) { 'use strict'; - var RenderingTestCase = (function (_AbstractRenderingTestCase) { - babelHelpers.inherits(RenderingTestCase, _AbstractRenderingTestCase); + /** + A two-tiered cache with support for fallback values when doing lookups. + Uses "buckets" and then "keys" to cache values. + + @private + @class BucketCache + */ + exports.default = _emberRuntime.Object.extend({ + init: function () { + this.cache = new _emberUtils.EmptyObject(); + }, - function RenderingTestCase() { - _AbstractRenderingTestCase.call(this); - var owner = this.owner; + has: function (bucketKey) { + return !!this.cache[bucketKey]; + }, - this.env = owner.lookup('service:-glimmer-environment'); - owner.register('component-lookup:main', _emberViews.ComponentLookup); - owner.registerOptionsForType('helper', { instantiate: false }); - owner.registerOptionsForType('component', { singleton: false }); + stash: function (bucketKey, key, value) { + var bucket = this.cache[bucketKey]; + + if (!bucket) { + bucket = this.cache[bucketKey] = new _emberUtils.EmptyObject(); + } + + bucket[key] = value; + }, + + lookup: function (bucketKey, prop, defaultValue) { + var cache = this.cache; + if (!this.has(bucketKey)) { + return defaultValue; + } + + var bucket = cache[bucketKey]; + if (prop in bucket && bucket[prop] !== undefined) { + return bucket[prop]; + } else { + return defaultValue; + } } + }); +}); +enifed("ember-routing/system/controller_for", ["exports"], function (exports) { + /** + @module ember + @submodule ember-routing + */ - return RenderingTestCase; - })(_internalTestHelpersTestCasesAbstractRendering.default); + /** + Finds a controller instance. + + @for Ember + @method controllerFor + @private + */ + "use strict"; - exports.default = RenderingTestCase; + exports.default = controllerFor; + + function controllerFor(container, controllerName, lookupOptions) { + return container.lookup("controller:" + controllerName, lookupOptions); + } }); -enifed('internal-test-helpers/test-groups', ['exports', 'ember-environment', 'ember-metal'], function (exports, _emberEnvironment, _emberMetal) { +enifed('ember-routing/system/dsl', ['exports', 'ember-utils', 'ember-metal'], function (exports, _emberUtils, _emberMetal) { 'use strict'; - exports.testBoth = testBoth; - exports.testWithDefault = testWithDefault; + /** + @module ember + @submodule ember-routing + */ - // used by unit tests to test both accessor mode and non-accessor mode + var uuid = 0; - function testBoth(testname, callback) { - function emberget(x, y) { - return _emberMetal.get(x, y); - } - function emberset(x, y, z) { - return _emberMetal.set(x, y, z); - } - function aget(x, y) { - return x[y]; - } - function aset(x, y, z) { - return x[y] = z; + var DSL = (function () { + function DSL(name, options) { + this.parent = name; + this.enableLoadingSubstates = options && options.enableLoadingSubstates; + this.matches = []; + this.explicitIndex = undefined; + this.options = options; } - QUnit.test(testname + ' using getFromEmberMetal()/Ember.set()', function () { - callback(emberget, emberset); - }); + DSL.prototype.route = function route(name, options, callback) { + if (options === undefined) options = {}; - QUnit.test(testname + ' using accessors', function () { - if (_emberEnvironment.ENV.USES_ACCESSORS) { - callback(aget, aset); - } else { - ok('SKIPPING ACCESSORS'); + var dummyErrorRoute = '/_unused_dummy_error_path_route_' + name + '/:error'; + if (arguments.length === 2 && typeof options === 'function') { + callback = options; + options = {}; } - }); - } - - function testWithDefault(testname, callback) { - function emberget(x, y) { - return _emberMetal.get(x, y); - } - function embergetwithdefault(x, y, z) { - return _emberMetal.getWithDefault(x, y, z); - } - function getwithdefault(x, y, z) { - return x.getWithDefault(y, z); - } - function emberset(x, y, z) { - return _emberMetal.set(x, y, z); - } - function aget(x, y) { - return x[y]; - } - function aset(x, y, z) { - return x[y] = z; - } - QUnit.test(testname + ' using obj.get()', function () { - callback(emberget, emberset); - }); + if (this.enableLoadingSubstates) { + createRoute(this, name + '_loading', { resetNamespace: options.resetNamespace }); + createRoute(this, name + '_error', { resetNamespace: options.resetNamespace, path: dummyErrorRoute }); + } - QUnit.test(testname + ' using obj.getWithDefault()', function () { - callback(getwithdefault, emberset); - }); + if (callback) { + var fullName = getFullName(this, name, options.resetNamespace); + var dsl = new DSL(fullName, this.options); - QUnit.test(testname + ' using getFromEmberMetal()', function () { - callback(emberget, emberset); - }); + createRoute(dsl, 'loading'); + createRoute(dsl, 'error', { path: dummyErrorRoute }); - QUnit.test(testname + ' using Ember.getWithDefault()', function () { - callback(embergetwithdefault, emberset); - }); + callback.call(dsl); - QUnit.test(testname + ' using accessors', function () { - if (_emberEnvironment.ENV.USES_ACCESSORS) { - callback(aget, aset); + createRoute(this, name, options, dsl.generate()); } else { - ok('SKIPPING ACCESSORS'); + createRoute(this, name, options); } - }); - } -}); -enifed('glimmer-node/index', ['exports', 'glimmer-node/lib/node-dom-helper'], function (exports, _glimmerNodeLibNodeDomHelper) { - 'use strict'; - - exports.NodeDOMTreeConstruction = _glimmerNodeLibNodeDomHelper.default; -}); + }; -enifed('glimmer-node/lib/node-dom-helper', ['exports', 'glimmer-runtime'], function (exports, _glimmerRuntime) { - 'use strict'; + DSL.prototype.push = function push(url, name, callback, serialize) { + var parts = name.split('.'); - var NodeDOMTreeConstruction = (function (_DOMTreeConstruction) { - babelHelpers.inherits(NodeDOMTreeConstruction, _DOMTreeConstruction); + if (this.options.engineInfo) { + var localFullName = name.slice(this.options.engineInfo.fullName.length + 1); + var routeInfo = _emberUtils.assign({ localFullName: localFullName }, this.options.engineInfo); - function NodeDOMTreeConstruction(doc) { - _DOMTreeConstruction.call(this, doc); + if (serialize) { + routeInfo.serializeMethod = serialize; } - // override to prevent usage of `this.document` until after the constructor - - NodeDOMTreeConstruction.prototype.setupUselessElement = function setupUselessElement() {}; - - NodeDOMTreeConstruction.prototype.insertHTMLBefore = function insertHTMLBefore(parent, html, reference) { - var prev = reference ? reference.previousSibling : parent.lastChild; - var raw = this.document.createRawHTMLSection(html); - parent.insertBefore(raw, reference); - var first = prev ? prev.nextSibling : parent.firstChild; - var last = reference ? reference.previousSibling : parent.lastChild; - return new _glimmerRuntime.ConcreteBounds(parent, first, last); - }; - - // override to avoid SVG detection/work when in node (this is not needed in SSR) - - NodeDOMTreeConstruction.prototype.createElement = function createElement(tag) { - return this.document.createElement(tag); - }; + this.options.addRouteForEngine(name, routeInfo); + } else if (serialize) { + throw new Error('Defining a route serializer on route \'' + name + '\' outside an Engine is not allowed.'); + } - // override to avoid namespace shenanigans when in node (this is not needed in SSR) + if (url === '' || url === '/' || parts[parts.length - 1] === 'index') { + this.explicitIndex = true; + } - NodeDOMTreeConstruction.prototype.setAttribute = function setAttribute(element, name, value) { - element.setAttribute(name, value); - }; + this.matches.push([url, name, callback]); + }; - return NodeDOMTreeConstruction; - })(_glimmerRuntime.DOMTreeConstruction); + DSL.prototype.resource = function resource(name, options, callback) { + if (options === undefined) options = {}; - exports.default = NodeDOMTreeConstruction; -}); + if (arguments.length === 2 && typeof options === 'function') { + callback = options; + options = {}; + } -enifed('glimmer-reference/index', ['exports', 'glimmer-reference/lib/reference', 'glimmer-reference/lib/const', 'glimmer-reference/lib/validators', 'glimmer-reference/lib/utils', 'glimmer-reference/lib/iterable'], function (exports, _glimmerReferenceLibReference, _glimmerReferenceLibConst, _glimmerReferenceLibValidators, _glimmerReferenceLibUtils, _glimmerReferenceLibIterable) { - 'use strict'; + options.resetNamespace = true; - exports.BasicReference = _glimmerReferenceLibReference.Reference; - exports.BasicPathReference = _glimmerReferenceLibReference.PathReference; - exports.ConstReference = _glimmerReferenceLibConst.ConstReference; - exports.isConst = _glimmerReferenceLibConst.isConst; - babelHelpers.defaults(exports, babelHelpers.interopExportWildcard(_glimmerReferenceLibValidators, babelHelpers.defaults)); - exports.Reference = _glimmerReferenceLibValidators.VersionedReference; - exports.PathReference = _glimmerReferenceLibValidators.VersionedPathReference; - exports.referenceFromParts = _glimmerReferenceLibUtils.referenceFromParts; - exports.IterationItem = _glimmerReferenceLibIterable.IterationItem; - exports.Iterator = _glimmerReferenceLibIterable.Iterator; - exports.Iterable = _glimmerReferenceLibIterable.Iterable; - exports.OpaqueIterator = _glimmerReferenceLibIterable.OpaqueIterator; - exports.OpaqueIterable = _glimmerReferenceLibIterable.OpaqueIterable; - exports.AbstractIterator = _glimmerReferenceLibIterable.AbstractIterator; - exports.AbstractIterable = _glimmerReferenceLibIterable.AbstractIterable; - exports.IterationArtifacts = _glimmerReferenceLibIterable.IterationArtifacts; - exports.ReferenceIterator = _glimmerReferenceLibIterable.ReferenceIterator; - exports.IteratorSynchronizer = _glimmerReferenceLibIterable.IteratorSynchronizer; - exports.IteratorSynchronizerDelegate = _glimmerReferenceLibIterable.IteratorSynchronizerDelegate; -}); - -enifed('glimmer-reference/lib/const', ['exports', 'glimmer-reference/lib/validators'], function (exports, _glimmerReferenceLibValidators) { - 'use strict'; + this.route(name, options, callback); + }; - exports.isConst = isConst; + DSL.prototype.generate = function generate() { + var dslMatches = this.matches; - var ConstReference = (function () { - function ConstReference(inner) { - this.inner = inner; - this.tag = _glimmerReferenceLibValidators.CONSTANT_TAG; + if (!this.explicitIndex) { + this.route('index', { path: '/' }); + } + + return function (match) { + for (var i = 0; i < dslMatches.length; i++) { + var dslMatch = dslMatches[i]; + match(dslMatch[0]).to(dslMatch[1], dslMatch[2]); } + }; + }; - ConstReference.prototype.value = function value() { - return this.inner; - }; + DSL.prototype.mount = function mount(_name) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - return ConstReference; - })(); + var engineRouteMap = this.options.resolveRouteMap(_name); + var name = _name; - exports.ConstReference = ConstReference; + if (options.as) { + name = options.as; + } - function isConst(reference) { - return reference.tag === _glimmerReferenceLibValidators.CONSTANT_TAG; - } -}); + var fullName = getFullName(this, name, options.resetNamespace); -enifed("glimmer-reference/lib/iterable", ["exports", "glimmer-util"], function (exports, _glimmerUtil) { - "use strict"; + var engineInfo = { + name: _name, + instanceId: uuid++, + mountPoint: fullName, + fullName: fullName + }; - var ListItem = (function (_ListNode) { - babelHelpers.inherits(ListItem, _ListNode); + var path = options.path; - function ListItem(iterable, result) { - _ListNode.call(this, iterable.valueReferenceFor(result)); - this.retained = false; - this.seen = false; - this.key = result.key; - this.iterable = iterable; - this.memo = iterable.memoReferenceFor(result); - } + if (typeof path !== 'string') { + path = '/' + name; + } - ListItem.prototype.update = function update(item) { - this.retained = true; - this.iterable.updateValueReference(this.value, item); - this.iterable.updateMemoReference(this.memo, item); - }; + var callback = undefined; + var dummyErrorRoute = '/_unused_dummy_error_path_route_' + name + '/:error'; + if (engineRouteMap) { + var shouldResetEngineInfo = false; + var oldEngineInfo = this.options.engineInfo; + if (oldEngineInfo) { + shouldResetEngineInfo = true; + this.options.engineInfo = engineInfo; + } - ListItem.prototype.shouldRemove = function shouldRemove() { - return !this.retained; - }; + var optionsForChild = _emberUtils.assign({ engineInfo: engineInfo }, this.options); + var childDSL = new DSL(fullName, optionsForChild); - ListItem.prototype.reset = function reset() { - this.retained = false; - this.seen = false; - }; + createRoute(childDSL, 'loading'); + createRoute(childDSL, 'error', { path: dummyErrorRoute }); - return ListItem; - })(_glimmerUtil.ListNode); + engineRouteMap.class.call(childDSL); - exports.ListItem = ListItem; + callback = childDSL.generate(); - var IterationArtifacts = (function () { - function IterationArtifacts(iterable) { - this.map = _glimmerUtil.dict(); - this.list = new _glimmerUtil.LinkedList(); - this.tag = iterable.tag; - this.iterable = iterable; + if (shouldResetEngineInfo) { + this.options.engineInfo = oldEngineInfo; } + } - IterationArtifacts.prototype.isEmpty = function isEmpty() { - var iterator = this.iterator = this.iterable.iterate(); - return iterator.isEmpty(); - }; + var localFullName = 'application'; + var routeInfo = _emberUtils.assign({ localFullName: localFullName }, engineInfo); - IterationArtifacts.prototype.iterate = function iterate() { - var iterator = this.iterator || this.iterable.iterate(); - this.iterator = null; - return iterator; - }; + if (this.enableLoadingSubstates) { + // These values are important to register the loading routes under their + // proper names for the Router and within the Engine's registry. + var substateName = name + '_loading'; + var _localFullName = 'application_loading'; + var _routeInfo = _emberUtils.assign({ localFullName: _localFullName }, engineInfo); + createRoute(this, substateName, { resetNamespace: options.resetNamespace }); + this.options.addRouteForEngine(substateName, _routeInfo); - IterationArtifacts.prototype.has = function has(key) { - return !!this.map[key]; - }; + substateName = name + '_error'; + _localFullName = 'application_error'; + _routeInfo = _emberUtils.assign({ localFullName: _localFullName }, engineInfo); + createRoute(this, substateName, { resetNamespace: options.resetNamespace, path: dummyErrorRoute }); + this.options.addRouteForEngine(substateName, _routeInfo); + } - IterationArtifacts.prototype.get = function get(key) { - return this.map[key]; - }; + this.options.addRouteForEngine(fullName, routeInfo); - IterationArtifacts.prototype.wasSeen = function wasSeen(key) { - var node = this.map[key]; - return node && node.seen; - }; + this.push(path, fullName, callback); + }; - IterationArtifacts.prototype.append = function append(item) { - var map = this.map; - var list = this.list; - var iterable = this.iterable; + return DSL; + })(); - var node = map[item.key] = new ListItem(iterable, item); - list.append(node); - return node; - }; + exports.default = DSL; - IterationArtifacts.prototype.insertBefore = function insertBefore(item, reference) { - var map = this.map; - var list = this.list; - var iterable = this.iterable; + function canNest(dsl) { + return dsl.parent && dsl.parent !== 'application'; + } - var node = map[item.key] = new ListItem(iterable, item); - node.retained = true; - list.insertBefore(node, reference); - return node; - }; + function getFullName(dsl, name, resetNamespace) { + if (canNest(dsl) && resetNamespace !== true) { + return dsl.parent + '.' + name; + } else { + return name; + } + } - IterationArtifacts.prototype.move = function move(item, reference) { - var list = this.list; + function createRoute(dsl, name, options, callback) { + if (options === undefined) options = {}; - item.retained = true; - list.remove(item); - list.insertBefore(item, reference); - }; + var fullName = getFullName(dsl, name, options.resetNamespace); - IterationArtifacts.prototype.remove = function remove(item) { - var list = this.list; + if (typeof options.path !== 'string') { + options.path = '/' + name; + } - list.remove(item); - delete this.map[item.key]; - }; + dsl.push(options.path, fullName, callback, options.serialize); + } - IterationArtifacts.prototype.nextNode = function nextNode(item) { - return this.list.nextNode(item); - }; + DSL.map = function (callback) { + var dsl = new DSL(); + callback.call(dsl); + return dsl; + }; +}); +enifed('ember-routing/system/generate_controller', ['exports', 'ember-metal', 'container'], function (exports, _emberMetal, _container) { + 'use strict'; - IterationArtifacts.prototype.head = function head() { - return this.list.head(); - }; + exports.generateControllerFactory = generateControllerFactory; + exports.default = generateController; - return IterationArtifacts; - })(); + /** + @module ember + @submodule ember-routing + */ - exports.IterationArtifacts = IterationArtifacts; + /** + Generates a controller factory + + @for Ember + @method generateControllerFactory + @private + */ - var ReferenceIterator = (function () { - // if anyone needs to construct this object with something other than - // an iterable, let @wycats know. + function generateControllerFactory(owner, controllerName, context) { + var Factory = owner[_container.FACTORY_FOR]('controller:basic').class; - function ReferenceIterator(iterable) { - this.iterator = null; - var artifacts = new IterationArtifacts(iterable); - this.artifacts = artifacts; - } + Factory = Factory.extend({ + toString: function () { + return '(generated ' + controllerName + ' controller)'; + } + }); - ReferenceIterator.prototype.next = function next() { - var artifacts = this.artifacts; + var fullName = 'controller:' + controllerName; - var iterator = this.iterator = this.iterator || artifacts.iterate(); - var item = iterator.next(); - if (!item) return null; - return artifacts.append(item); - }; + owner.register(fullName, Factory); - return ReferenceIterator; - })(); + return Factory; + } - exports.ReferenceIterator = ReferenceIterator; + /** + Generates and instantiates a controller extending from `controller:basic` + if present, or `Ember.Controller` if not. + + @for Ember + @method generateController + @private + @since 1.3.0 + */ - var Phase; - (function (Phase) { - Phase[Phase["Append"] = 0] = "Append"; - Phase[Phase["Prune"] = 1] = "Prune"; - Phase[Phase["Done"] = 2] = "Done"; - })(Phase || (Phase = {})); + function generateController(owner, controllerName) { + generateControllerFactory(owner, controllerName); - var IteratorSynchronizer = (function () { - function IteratorSynchronizer(_ref) { - var target = _ref.target; - var artifacts = _ref.artifacts; + var fullName = 'controller:' + controllerName; + var instance = owner.lookup(fullName); - this.target = target; - this.artifacts = artifacts; - this.iterator = artifacts.iterate(); - this.current = artifacts.head(); - } + return instance; + } +}); +enifed('ember-routing/system/query_params', ['exports', 'ember-runtime'], function (exports, _emberRuntime) { + 'use strict'; - IteratorSynchronizer.prototype.sync = function sync() { - var phase = Phase.Append; - while (true) { - switch (phase) { - case Phase.Append: - phase = this.nextAppend(); - break; - case Phase.Prune: - phase = this.nextPrune(); - break; - case Phase.Done: - this.nextDone(); - return; - } - } - }; + exports.default = _emberRuntime.Object.extend({ + isQueryParams: true, + values: null + }); +}); +enifed('ember-routing/system/route', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-routing/system/generate_controller', 'ember-routing/utils', 'container'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberRoutingSystemGenerate_controller, _emberRoutingUtils, _container) { + 'use strict'; - IteratorSynchronizer.prototype.advanceToKey = function advanceToKey(key) { - var current = this.current; - var artifacts = this.artifacts; + exports.defaultSerialize = defaultSerialize; + exports.hasDefaultSerialize = hasDefaultSerialize; + var slice = Array.prototype.slice; - var seek = current; - while (seek && seek.key !== key) { - seek.seen = true; - seek = artifacts.nextNode(seek); - } - this.current = seek && artifacts.nextNode(seek); - }; + function K() { + return this; + } - IteratorSynchronizer.prototype.nextAppend = function nextAppend() { - var iterator = this.iterator; - var current = this.current; - var artifacts = this.artifacts; + function defaultSerialize(model, params) { + if (params.length < 1 || !model) { + return; + } - var item = iterator.next(); - if (item === null) { - return this.startPrune(); - } - var key = item.key; + var name = params[0]; + var object = {}; - if (current && current.key === key) { - this.nextRetain(item); - } else if (artifacts.has(key)) { - this.nextMove(item); - } else { - this.nextInsert(item); - } - return Phase.Append; - }; + if (params.length === 1) { + if (name in model) { + object[name] = _emberMetal.get(model, name); + } else if (/_id$/.test(name)) { + object[name] = _emberMetal.get(model, 'id'); + } + } else { + object = _emberMetal.getProperties(model, params); + } - IteratorSynchronizer.prototype.nextRetain = function nextRetain(item) { - var artifacts = this.artifacts; - var current = this.current; + return object; + } - current.update(item); - this.current = artifacts.nextNode(current); - this.target.retain(item.key, current.value, current.memo); - }; + var DEFAULT_SERIALIZE = _emberUtils.symbol('DEFAULT_SERIALIZE'); - IteratorSynchronizer.prototype.nextMove = function nextMove(item) { - var current = this.current; - var artifacts = this.artifacts; - var target = this.target; - var key = item.key; + defaultSerialize[DEFAULT_SERIALIZE] = true; - var found = artifacts.get(item.key); - found.update(item); - if (artifacts.wasSeen(item.key)) { - artifacts.move(found, current); - target.move(found.key, found.value, found.memo, current ? current.key : null); - } else { - this.advanceToKey(key); - } - }; + function hasDefaultSerialize(route) { + return !!route.serialize[DEFAULT_SERIALIZE]; + } - IteratorSynchronizer.prototype.nextInsert = function nextInsert(item) { - var artifacts = this.artifacts; - var target = this.target; - var current = this.current; + /** + @module ember + @submodule ember-routing + */ - var node = artifacts.insertBefore(item, current); - target.insert(node.key, node.value, node.memo, current ? current.key : null); - }; + /** + The `Ember.Route` class is used to define individual routes. Refer to + the [routing guide](http://emberjs.com/guides/routing/) for documentation. + + @class Route + @namespace Ember + @extends Ember.Object + @uses Ember.ActionHandler + @uses Ember.Evented + @since 1.0.0 + @public + */ + var Route = _emberRuntime.Object.extend(_emberRuntime.ActionHandler, _emberRuntime.Evented, { + /** + Configuration hash for this route's queryParams. The possible + configuration options and their defaults are as follows + (assuming a query param whose controller property is `page`): + ```javascript + queryParams: { + page: { + // By default, controller query param properties don't + // cause a full transition when they are changed, but + // rather only cause the URL to update. Setting + // `refreshModel` to true will cause an "in-place" + // transition to occur, whereby the model hooks for + // this route (and any child routes) will re-fire, allowing + // you to reload models (e.g., from the server) using the + // updated query param values. + refreshModel: false, + // By default, changes to controller query param properties + // cause the URL to update via `pushState`, which means an + // item will be added to the browser's history, allowing + // you to use the back button to restore the app to the + // previous state before the query param property was changed. + // Setting `replace` to true will use `replaceState` (or its + // hash location equivalent), which causes no browser history + // item to be added. This options name and default value are + // the same as the `link-to` helper's `replace` option. + replace: false, + // By default, the query param URL key is the same name as + // the controller property name. Use `as` to specify a + // different URL key. + as: 'page' + } + } + ``` + @property queryParams + @for Ember.Route + @type Object + @since 1.6.0 + @public + */ + queryParams: {}, - IteratorSynchronizer.prototype.startPrune = function startPrune() { - this.current = this.artifacts.head(); - return Phase.Prune; - }; + /** + The name of the route, dot-delimited. + For example, a route found at `app/routes/posts/post.js` will have + a `routeName` of `posts.post`. + @property routeName + @for Ember.Route + @type String + @since 1.0.0 + @public + */ - IteratorSynchronizer.prototype.nextPrune = function nextPrune() { - var artifacts = this.artifacts; - var target = this.target; - var current = this.current; + /** + Sets the name for this route, including a fully resolved name for routes + inside engines. + @private + @method _setRouteName + @param {String} name + */ + _setRouteName: function (name) { + this.routeName = name; + this.fullRouteName = getEngineRouteName(_emberUtils.getOwner(this), name); + }, - if (current === null) { - return Phase.Done; - } - var node = current; - this.current = artifacts.nextNode(node); - if (node.shouldRemove()) { - artifacts.remove(node); - target.delete(node.key); - } else { - node.reset(); - } - return Phase.Prune; - }; + /** + Populates the QP meta information in the BucketCache. + @private + @method _populateQPMeta + */ + _populateQPMeta: function () { + this._bucketCache.stash('route-meta', this.fullRouteName, this.get('_qp')); + }, - IteratorSynchronizer.prototype.nextDone = function nextDone() { - this.target.done(); - }; + /** + @private + @property _qp + */ + _qp: _emberMetal.computed(function () { + var _this = this; - return IteratorSynchronizer; - })(); + var controllerProto = undefined, + combinedQueryParameterConfiguration = undefined; - exports.IteratorSynchronizer = IteratorSynchronizer; -}); + var controllerName = this.controllerName || this.routeName; + var owner = _emberUtils.getOwner(this); + var definedControllerClass = owner[_container.LOOKUP_FACTORY]('controller:' + controllerName); + var queryParameterConfiguraton = _emberMetal.get(this, 'queryParams'); + var hasRouterDefinedQueryParams = !!Object.keys(queryParameterConfiguraton).length; -enifed("glimmer-reference/lib/reference", ["exports"], function (exports) { - "use strict"; -}); + if (definedControllerClass) { + // the developer has authored a controller class in their application for this route + // access the prototype, find its query params and normalize their object shape + // them merge in the query params for the route. As a mergedProperty, Route#queryParams is always + // at least `{}` + controllerProto = definedControllerClass.proto(); -enifed("glimmer-reference/lib/utils", ["exports"], function (exports) { - "use strict"; + var controllerDefinedQueryParameterConfiguration = _emberMetal.get(controllerProto, 'queryParams'); + var normalizedControllerQueryParameterConfiguration = _emberRoutingUtils.normalizeControllerQueryParams(controllerDefinedQueryParameterConfiguration); + combinedQueryParameterConfiguration = mergeEachQueryParams(normalizedControllerQueryParameterConfiguration, queryParameterConfiguraton); + } 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(_emberUtils.getOwner(this), controllerName); + controllerProto = generatedControllerClass.proto(); + combinedQueryParameterConfiguration = queryParameterConfiguraton; + } - exports.referenceFromParts = referenceFromParts; + var qps = []; + var map = {}; + var propertyNames = []; - function referenceFromParts(root, parts) { - var reference = root; - for (var i = 0; i < parts.length; i++) { - reference = reference.get(parts[i]); + for (var propName in combinedQueryParameterConfiguration) { + if (!combinedQueryParameterConfiguration.hasOwnProperty(propName)) { + continue; } - return reference; - } -}); -enifed("glimmer-reference/lib/validators", ["exports"], function (exports) { - "use strict"; + // to support the dubious feature of using unknownProperty + // on queryParams configuration + if (propName === 'unknownProperty' || propName === '_super') { + // possible todo: issue deprecation warning? + continue; + } - exports.combineTagged = combineTagged; - exports.combineSlice = combineSlice; - exports.combine = combine; - exports.map = map; - exports.isModified = isModified; - var CONSTANT = 0; - exports.CONSTANT = CONSTANT; - var INITIAL = 1; - exports.INITIAL = INITIAL; - var VOLATILE = NaN; - exports.VOLATILE = VOLATILE; + var desc = combinedQueryParameterConfiguration[propName]; + var scope = desc.scope || 'model'; + var parts = undefined; - var RevisionTag = (function () { - function RevisionTag() {} + if (scope === 'controller') { + parts = []; + } - RevisionTag.prototype.validate = function validate(snapshot) { - return this.value() === snapshot; - }; + var urlKey = desc.as || this.serializeQueryParamKey(propName); + var defaultValue = _emberMetal.get(controllerProto, propName); - return RevisionTag; - })(); + if (Array.isArray(defaultValue)) { + defaultValue = _emberRuntime.A(defaultValue.slice()); + } - exports.RevisionTag = RevisionTag; + var type = desc.type || _emberRuntime.typeOf(defaultValue); - var $REVISION = INITIAL; + var defaultValueSerialized = this.serializeQueryParam(defaultValue, urlKey, type); + var scopedPropertyName = controllerName + ':' + propName; + var qp = { + undecoratedDefaultValue: _emberMetal.get(controllerProto, propName), + defaultValue: defaultValue, + serializedDefaultValue: defaultValueSerialized, + serializedValue: defaultValueSerialized, - var DirtyableTag = (function (_RevisionTag) { - babelHelpers.inherits(DirtyableTag, _RevisionTag); + type: type, + urlKey: urlKey, + prop: propName, + scopedPropertyName: scopedPropertyName, + controllerName: controllerName, + route: this, + parts: parts, // provided later when stashNames is called if 'model' scope + values: null, // provided later when setup is called. no idea why. + scope: scope + }; - function DirtyableTag() { - var revision = arguments.length <= 0 || arguments[0] === undefined ? $REVISION : arguments[0]; + map[propName] = map[urlKey] = map[scopedPropertyName] = qp; + qps.push(qp); + propertyNames.push(propName); + } - _RevisionTag.call(this); - this.revision = revision; + return { + qps: qps, + map: map, + propertyNames: propertyNames, + states: { + /* + Called when a query parameter changes in the URL, this route cares + about that query parameter, but the route is not currently + in the active route hierarchy. + */ + inactive: function (prop, value) { + var qp = map[prop]; + _this._qpChanged(prop, value, qp); + }, + /* + Called when a query parameter changes in the URL, this route cares + about that query parameter, and the route is currently + in the active route hierarchy. + */ + active: function (prop, value) { + var qp = map[prop]; + _this._qpChanged(prop, value, qp); + return _this._activeQPChanged(map[prop], value); + }, + /* + Called when a value of a query parameter this route handles changes in a controller + and the route is currently in the active route hierarchy. + */ + allowOverrides: function (prop, value) { + var qp = map[prop]; + _this._qpChanged(prop, value, qp); + return _this._updatingQPChanged(map[prop]); + } } + }; + }), - DirtyableTag.prototype.value = function value() { - return this.revision; - }; + /** + @private + @property _names + */ + _names: null, - DirtyableTag.prototype.dirty = function dirty() { - this.revision = ++$REVISION; - }; + /** + @private + @method _stashNames + */ + _stashNames: function (handlerInfo, dynamicParent) { + if (this._names) { + return; + } + var names = this._names = handlerInfo._names; - return DirtyableTag; - })(RevisionTag); + if (!names.length) { + handlerInfo = dynamicParent; + names = handlerInfo && handlerInfo._names || []; + } - exports.DirtyableTag = DirtyableTag; + var qps = _emberMetal.get(this, '_qp.qps'); - function combineTagged(tagged) { - var optimized = []; - for (var i = 0, l = tagged.length; i < l; i++) { - var tag = tagged[i].tag; - if (tag === VOLATILE_TAG) return VOLATILE_TAG; - if (tag === CONSTANT_TAG) continue; - optimized.push(tag); - } - return _combine(optimized); - } + var namePaths = new Array(names.length); + for (var a = 0; a < names.length; ++a) { + namePaths[a] = handlerInfo.name + '.' + names[a]; + } - function combineSlice(slice) { - var optimized = []; - var node = slice.head(); - while (node !== null) { - var tag = node.tag; - if (tag === VOLATILE_TAG) return VOLATILE_TAG; - if (tag !== CONSTANT_TAG) optimized.push(tag); - node = slice.nextNode(node); + for (var i = 0; i < qps.length; ++i) { + var qp = qps[i]; + if (qp.scope === 'model') { + qp.parts = namePaths; } - return _combine(optimized); - } + } + }, - function combine(tags) { - var optimized = []; - for (var i = 0, l = tags.length; i < l; i++) { - var tag = tags[i]; - if (tag === VOLATILE_TAG) return VOLATILE_TAG; - if (tag === CONSTANT_TAG) continue; - optimized.push(tag); - } - return _combine(optimized); - } + /** + @private + @property _activeQPChanged + */ + _activeQPChanged: function (qp, value) { + var router = this.router; + router._activeQPChanged(qp.scopedPropertyName, value); + }, - function _combine(tags) { - switch (tags.length) { - case 0: - return CONSTANT_TAG; - case 1: - return tags[0]; - case 2: - return new TagsPair(tags[0], tags[1]); - default: - return new TagsCombinator(tags); - } - ; - } + /** + @private + @method _updatingQPChanged + */ + _updatingQPChanged: function (qp) { + var router = this.router; + router._updatingQPChanged(qp.urlKey); + }, - var CachedTag = (function (_RevisionTag2) { - babelHelpers.inherits(CachedTag, _RevisionTag2); + mergedProperties: ['queryParams'], - function CachedTag() { - _RevisionTag2.apply(this, arguments); - this.lastChecked = null; - this.lastValue = null; + /** + Returns a hash containing the parameters of an ancestor route. + Example + ```app/router.js + // ... + Router.map(function() { + this.route('member', { path: ':name' }, function() { + this.route('interest', { path: ':interest' }); + }); + }); + ``` + ```app/routes/member.js + export default Ember.Route.extend({ + queryParams: { + memberQp: { refreshModel: true } + } + }); + ``` + ```app/routes/member/interest.js + export default Ember.Route.extend({ + queryParams: { + interestQp: { refreshModel: true } + }, + model() { + return this.paramsFor('member'); } + }); + ``` + If we visit `/turing/maths?memberQp=member&interestQp=interest` the model for + the `member.interest` route is hash with: + * `name`: `turing` + * `memberQp`: `member` + @method paramsFor + @param {String} name + @return {Object} hash containing the parameters of the route `name` + @since 1.4.0 + @public + */ + paramsFor: function (name) { + var route = _emberUtils.getOwner(this).lookup('route:' + name); - CachedTag.prototype.value = function value() { - var lastChecked = this.lastChecked; - var lastValue = this.lastValue; + if (!route) { + return {}; + } - if (lastChecked !== $REVISION) { - this.lastChecked = $REVISION; - this.lastValue = lastValue = this.compute(); - } - return this.lastValue; - }; + var transition = this.router.router.activeTransition; + var state = transition ? transition.state : this.router.router.state; - CachedTag.prototype.invalidate = function invalidate() { - this.lastChecked = null; - }; + var fullName = route.fullRouteName; + var params = _emberUtils.assign({}, state.params[fullName]); + var queryParams = getQueryParamsFor(route, state); - return CachedTag; - })(RevisionTag); + return Object.keys(queryParams).reduce(function (params, key) { + params[key] = queryParams[key]; + return params; + }, params); + }, - exports.CachedTag = CachedTag; + /** + Serializes the query parameter key + @method serializeQueryParamKey + @param {String} controllerPropertyName + @private + */ + serializeQueryParamKey: function (controllerPropertyName) { + return controllerPropertyName; + }, - var TagsPair = (function (_CachedTag) { - babelHelpers.inherits(TagsPair, _CachedTag); + /** + Serializes value of the query parameter based on defaultValueType + @method serializeQueryParam + @param {Object} value + @param {String} urlKey + @param {String} defaultValueType + @private + */ + serializeQueryParam: function (value, urlKey, defaultValueType) { + // urlKey isn't used here, but anyone overriding + // can use it to provide serialization specific + // to a certain query param. + return this.router._serializeQueryParam(value, defaultValueType); + }, - function TagsPair(first, second) { - _CachedTag.call(this); - this.first = first; - this.second = second; + /** + Deserializes value of the query parameter based on defaultValueType + @method deserializeQueryParam + @param {Object} value + @param {String} urlKey + @param {String} defaultValueType + @private + */ + deserializeQueryParam: function (value, urlKey, defaultValueType) { + // urlKey isn't used here, but anyone overriding + // can use it to provide deserialization specific + // to a certain query param. + return this.router._deserializeQueryParam(value, defaultValueType); + }, + + /** + @private + @property _optionsForQueryParam + */ + _optionsForQueryParam: function (qp) { + return _emberMetal.get(this, 'queryParams.' + qp.urlKey) || _emberMetal.get(this, 'queryParams.' + qp.prop) || {}; + }, + + /** + A hook you can use to reset controller values either when the model + changes or the route is exiting. + ```app/routes/articles.js + import Ember from 'ember'; + export default Ember.Route.extend({ + resetController(controller, isExiting, transition) { + if (isExiting) { + controller.set('page', 1); + } } + }); + ``` + @method resetController + @param {Controller} controller instance + @param {Boolean} isExiting + @param {Object} transition + @since 1.7.0 + @public + */ + resetController: K, - TagsPair.prototype.compute = function compute() { - return Math.max(this.first.value(), this.second.value()); - }; + /** + @private + @method exit + */ + exit: function () { + this.deactivate(); + this.trigger('deactivate'); + this.teardownViews(); + }, - return TagsPair; - })(CachedTag); + /** + @private + @method _reset + @since 1.7.0 + */ + _reset: function (isExiting, transition) { + var controller = this.controller; + controller._qpDelegate = _emberMetal.get(this, '_qp.states.inactive'); - var TagsCombinator = (function (_CachedTag2) { - babelHelpers.inherits(TagsCombinator, _CachedTag2); + this.resetController(controller, isExiting, transition); + }, - function TagsCombinator(tags) { - _CachedTag2.call(this); - this.tags = tags; - } + /** + @private + @method enter + */ + enter: function () { + this.connections = []; + this.activate(); + this.trigger('activate'); + }, - TagsCombinator.prototype.compute = function compute() { - var tags = this.tags; + /** + The name of the template to use by default when rendering this routes + template. + ```app/routes/posts/list.js + import Ember from 'ember'; + export default Ember.Route.extend({ + templateName: 'posts/list' + }); + ``` + ```app/routes/posts/index.js + import PostsList from '../posts/list'; + export default PostsList.extend(); + ``` + ```app/routes/posts/archived.js + import PostsList from '../posts/list'; + export default PostsList.extend(); + ``` + @property templateName + @type String + @default null + @since 1.4.0 + @public + */ + templateName: null, - var max = -1; - for (var i = 0; i < tags.length; i++) { - var value = tags[i].value(); - max = Math.max(value, max); + /** + The name of the controller to associate with this route. + By default, Ember will lookup a route's controller that matches the name + of the route (i.e. `App.PostController` for `App.PostRoute`). However, + if you would like to define a specific controller to use, you can do so + using this property. + This is useful in many ways, as the controller specified will be: + * passed to the `setupController` method. + * used as the controller for the template being rendered by the route. + * returned from a call to `controllerFor` for the route. + @property controllerName + @type String + @default null + @since 1.4.0 + @public + */ + controllerName: null, + + /** + The `willTransition` action is fired at the beginning of any + attempted transition with a `Transition` object as the sole + argument. This action can be used for aborting, redirecting, + or decorating the transition from the currently active routes. + A good example is preventing navigation when a form is + half-filled out: + ```app/routes/contact-form.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + willTransition(transition) { + if (this.controller.get('userHasEnteredData')) { + this.controller.displayNavigationConfirm(); + transition.abort(); } - return max; - }; + } + } + }); + ``` + You can also redirect elsewhere by calling + `this.transitionTo('elsewhere')` from within `willTransition`. + Note that `willTransition` will not be fired for the + redirecting `transitionTo`, since `willTransition` doesn't + fire when there is already a transition underway. If you want + subsequent `willTransition` actions to fire for the redirecting + transition, you must first explicitly call + `transition.abort()`. + To allow the `willTransition` event to continue bubbling to the parent + route, use `return true;`. When the `willTransition` method has a + return value of `true` then the parent route's `willTransition` method + will be fired, enabling "bubbling" behavior for the event. + @event willTransition + @param {Transition} transition + @since 1.0.0 + @public + */ - return TagsCombinator; - })(CachedTag); + /** + The `didTransition` action is fired after a transition has + successfully been completed. This occurs after the normal model + hooks (`beforeModel`, `model`, `afterModel`, `setupController`) + have resolved. The `didTransition` action has no arguments, + however, it can be useful for tracking page views or resetting + state on the controller. + ```app/routes/login.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + didTransition() { + this.controller.get('errors.base').clear(); + return true; // Bubble the didTransition event + } + } + }); + ``` + @event didTransition + @since 1.2.0 + @public + */ - var UpdatableTag = (function (_CachedTag3) { - babelHelpers.inherits(UpdatableTag, _CachedTag3); + /** + The `loading` action is fired on the route when a route's `model` + hook returns a promise that is not already resolved. The current + `Transition` object is the first parameter and the route that + triggered the loading event is the second parameter. + ```app/routes/application.js + export default Ember.Route.extend({ + actions: { + loading(transition, route) { + let controller = this.controllerFor('foo'); + controller.set('currentlyLoading', true); + transition.finally(function() { + controller.set('currentlyLoading', false); + }); + } + } + }); + ``` + @event loading + @param {Transition} transition + @param {Ember.Route} route The route that triggered the loading event + @since 1.2.0 + @public + */ - function UpdatableTag(tag) { - _CachedTag3.call(this); - this.tag = tag; - this.lastUpdated = INITIAL; + /** + When attempting to transition into a route, any of the hooks + may return a promise that rejects, at which point an `error` + action will be fired on the partially-entered routes, allowing + for per-route error handling logic, or shared error handling + logic defined on a parent route. + Here is an example of an error handler that will be invoked + for rejected promises from the various hooks on the route, + as well as any unhandled errors from child routes: + ```app/routes/admin.js + import Ember from 'ember'; + export default Ember.Route.extend({ + beforeModel() { + return Ember.RSVP.reject('bad things!'); + }, + actions: { + error(error, transition) { + // Assuming we got here due to the error in `beforeModel`, + // we can expect that error === "bad things!", + // but a promise model rejecting would also + // call this hook, as would any errors encountered + // in `afterModel`. + // The `error` hook is also provided the failed + // `transition`, which can be stored and later + // `.retry()`d if desired. + this.transitionTo('login'); + } + } + }); + ``` + `error` actions that bubble up all the way to `ApplicationRoute` + will fire a default error handler that logs the error. You can + specify your own global default error handler by overriding the + `error` handler on `ApplicationRoute`: + ```app/routes/application.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + error(error, transition) { + this.controllerFor('banner').displayError(error.message); + } } + }); + ``` + @event error + @param {Error} error + @param {Transition} transition + @since 1.0.0 + @public + */ - ////////// + /** + This event is triggered when the router enters the route. It is + not executed when the model for the route changes. + ```app/routes/application.js + import Ember from 'ember'; + export default Ember.Route.extend({ + collectAnalytics: Ember.on('activate', function(){ + collectAnalytics(); + }) + }); + ``` + @event activate + @since 1.9.0 + @public + */ - UpdatableTag.prototype.compute = function compute() { - return Math.max(this.lastUpdated, this.tag.value()); - }; + /** + This event is triggered when the router completely exits this + route. It is not executed when the model for the route changes. + ```app/routes/index.js + import Ember from 'ember'; + export default Ember.Route.extend({ + trackPageLeaveAnalytics: Ember.on('deactivate', function(){ + trackPageLeaveAnalytics(); + }) + }); + ``` + @event deactivate + @since 1.9.0 + @public + */ - UpdatableTag.prototype.update = function update(tag) { - if (tag !== this.tag) { - this.tag = tag; - this.lastUpdated = $REVISION; - this.invalidate(); + /** + The controller associated with this route. + Example + ```app/routes/form.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + willTransition(transition) { + if (this.controller.get('userHasEnteredData') && + !confirm('Are you sure you want to abandon progress?')) { + transition.abort(); + } else { + // Bubble the `willTransition` action so that + // parent routes can decide whether or not to abort. + return true; } - }; - - return UpdatableTag; - })(CachedTag); - - exports.UpdatableTag = UpdatableTag; - var CONSTANT_TAG = new ((function (_RevisionTag3) { - babelHelpers.inherits(ConstantTag, _RevisionTag3); - - function ConstantTag() { - _RevisionTag3.apply(this, arguments); + } } + }); + ``` + @property controller + @type Ember.Controller + @since 1.6.0 + @public + */ - ConstantTag.prototype.value = function value() { - return CONSTANT; - }; + actions: { - return ConstantTag; - })(RevisionTag))(); - exports.CONSTANT_TAG = CONSTANT_TAG; - var VOLATILE_TAG = new ((function (_RevisionTag4) { - babelHelpers.inherits(VolatileTag, _RevisionTag4); + /** + This action is called when one or more query params have changed. Bubbles. + @method queryParamsDidChange + @param changed {Object} Keys are names of query params that have changed. + @param totalPresent {Object} Keys are names of query params that are currently set. + @param removed {Object} Keys are names of query params that have been removed. + @returns {boolean} + @private + */ + queryParamsDidChange: function (changed, totalPresent, removed) { + var qpMap = _emberMetal.get(this, '_qp').map; - function VolatileTag() { - _RevisionTag4.apply(this, arguments); + var totalChanged = Object.keys(changed).concat(Object.keys(removed)); + for (var i = 0; i < totalChanged.length; ++i) { + var qp = qpMap[totalChanged[i]]; + if (qp && _emberMetal.get(this._optionsForQueryParam(qp), 'refreshModel') && this.router.currentState) { + this.refresh(); + break; + } } - VolatileTag.prototype.value = function value() { - return VOLATILE; - }; - - return VolatileTag; - })(RevisionTag))(); - exports.VOLATILE_TAG = VOLATILE_TAG; - var CURRENT_TAG = new ((function (_DirtyableTag) { - babelHelpers.inherits(CurrentTag, _DirtyableTag); + return true; + }, - function CurrentTag() { - _DirtyableTag.apply(this, arguments); + finalizeQueryParamChange: function (params, finalParams, transition) { + if (this.fullRouteName !== 'application') { + return true; } - CurrentTag.prototype.value = function value() { - return $REVISION; - }; + // Transition object is absent for intermediate transitions. + if (!transition) { + return; + } - return CurrentTag; - })(DirtyableTag))(); - exports.CURRENT_TAG = CURRENT_TAG; + var handlerInfos = transition.state.handlerInfos; + var router = this.router; + var qpMeta = router._queryParamsFor(handlerInfos); + var changes = router._qpUpdates; + var replaceUrl = undefined; - var CachedReference = (function () { - function CachedReference() { - this.lastRevision = null; - this.lastValue = null; - } + _emberRoutingUtils.stashParamNames(router, handlerInfos); - CachedReference.prototype.value = function value() { - var tag = this.tag; - var lastRevision = this.lastRevision; - var lastValue = this.lastValue; + for (var i = 0; i < qpMeta.qps.length; ++i) { + var qp = qpMeta.qps[i]; + var route = qp.route; + var controller = route.controller; + var presentKey = qp.urlKey in params && qp.urlKey; - if (!lastRevision || !tag.validate(lastRevision)) { - lastValue = this.lastValue = this.compute(); - this.lastRevision = tag.value(); + // Do a reverse lookup to see if the changed query + // param URL key corresponds to a QP property on + // this controller. + var value = undefined, + svalue = undefined; + if (changes && qp.urlKey in changes) { + // Value updated in/before setupController + value = _emberMetal.get(controller, qp.prop); + svalue = route.serializeQueryParam(value, qp.urlKey, qp.type); + } else { + if (presentKey) { + svalue = params[presentKey]; + value = route.deserializeQueryParam(svalue, qp.urlKey, qp.type); + } else { + // No QP provided; use default value. + svalue = qp.serializedDefaultValue; + value = copyDefaultValue(qp.defaultValue); } - return lastValue; - }; + } - CachedReference.prototype.invalidate = function invalidate() { - this.lastRevision = null; - }; + controller._qpDelegate = _emberMetal.get(route, '_qp.states.inactive'); - return CachedReference; - })(); + var thisQueryParamChanged = svalue !== qp.serializedValue; + if (thisQueryParamChanged) { + if (transition.queryParamsOnly && replaceUrl !== false) { + var options = route._optionsForQueryParam(qp); + var replaceConfigValue = _emberMetal.get(options, 'replace'); + if (replaceConfigValue) { + replaceUrl = true; + } else if (replaceConfigValue === false) { + // Explicit pushState wins over any other replaceStates. + replaceUrl = false; + } + } - exports.CachedReference = CachedReference; + _emberMetal.set(controller, qp.prop, value); + } - var MapperReference = (function (_CachedReference) { - babelHelpers.inherits(MapperReference, _CachedReference); + // Stash current serialized value of controller. + qp.serializedValue = svalue; - function MapperReference(reference, mapper) { - _CachedReference.call(this); - this.tag = reference.tag; - this.reference = reference; - this.mapper = mapper; + var thisQueryParamHasDefaultValue = qp.serializedDefaultValue === svalue; + if (!thisQueryParamHasDefaultValue) { + finalParams.push({ + value: svalue, + visible: true, + key: presentKey || qp.urlKey + }); + } } - MapperReference.prototype.compute = function compute() { - var reference = this.reference; - var mapper = this.mapper; - - return mapper(reference.value()); - }; - - return MapperReference; - })(CachedReference); - - function map(reference, mapper) { - return new MapperReference(reference, mapper); - } - - ////////// - - var ReferenceCache = (function () { - function ReferenceCache(reference) { - this.lastValue = null; - this.lastRevision = null; - this.initialized = false; - this.tag = reference.tag; - this.reference = reference; + if (replaceUrl) { + transition.method('replace'); } - ReferenceCache.prototype.peek = function peek() { - if (!this.initialized) { - return this.initialize(); - } - return this.lastValue; - }; - - ReferenceCache.prototype.revalidate = function revalidate() { - if (!this.initialized) { - return this.initialize(); - } - var reference = this.reference; - var lastRevision = this.lastRevision; - - var tag = reference.tag; - if (tag.validate(lastRevision)) return NOT_MODIFIED; - this.lastRevision = tag.value(); - var lastValue = this.lastValue; - - var value = reference.value(); - if (value === lastValue) return NOT_MODIFIED; - this.lastValue = value; - return value; - }; - - ReferenceCache.prototype.initialize = function initialize() { - var reference = this.reference; - - var value = this.lastValue = reference.value(); - this.lastRevision = reference.tag.value(); - this.initialized = true; - return value; - }; - - return ReferenceCache; - })(); - - exports.ReferenceCache = ReferenceCache; - - var NOT_MODIFIED = "adb3b78e-3d22-4e4b-877a-6317c2c5c145"; - - function isModified(value) { - return value !== NOT_MODIFIED; - } -}); - -enifed('glimmer-runtime/index', ['exports', 'glimmer-runtime/lib/dom/interfaces', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/template', 'glimmer-runtime/lib/symbol-table', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/syntax/core', 'glimmer-runtime/lib/compiled/opcodes/builder', 'glimmer-runtime/lib/compiler', 'glimmer-runtime/lib/opcode-builder', 'glimmer-runtime/lib/compiled/blocks', 'glimmer-runtime/lib/dom/attribute-managers', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/compiled/expressions/function', 'glimmer-runtime/lib/helpers/get-dynamic-var', 'glimmer-runtime/lib/syntax/builtins/with-dynamic-vars', 'glimmer-runtime/lib/syntax/builtins/in-element', 'glimmer-runtime/lib/vm', 'glimmer-runtime/lib/upsert', 'glimmer-runtime/lib/environment', 'glimmer-runtime/lib/partial', 'glimmer-runtime/lib/component/interfaces', 'glimmer-runtime/lib/modifier/interfaces', 'glimmer-runtime/lib/dom/helper', 'glimmer-runtime/lib/builder', 'glimmer-runtime/lib/bounds'], function (exports, _glimmerRuntimeLibDomInterfaces, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibTemplate, _glimmerRuntimeLibSymbolTable, _glimmerRuntimeLibReferences, _glimmerRuntimeLibSyntaxCore, _glimmerRuntimeLibCompiledOpcodesBuilder, _glimmerRuntimeLibCompiler, _glimmerRuntimeLibOpcodeBuilder, _glimmerRuntimeLibCompiledBlocks, _glimmerRuntimeLibDomAttributeManagers, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerRuntimeLibCompiledExpressions, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibCompiledExpressionsFunction, _glimmerRuntimeLibHelpersGetDynamicVar, _glimmerRuntimeLibSyntaxBuiltinsWithDynamicVars, _glimmerRuntimeLibSyntaxBuiltinsInElement, _glimmerRuntimeLibVm, _glimmerRuntimeLibUpsert, _glimmerRuntimeLibEnvironment, _glimmerRuntimeLibPartial, _glimmerRuntimeLibComponentInterfaces, _glimmerRuntimeLibModifierInterfaces, _glimmerRuntimeLibDomHelper, _glimmerRuntimeLibBuilder, _glimmerRuntimeLibBounds) { - 'use strict'; - - exports.ATTRIBUTE_SYNTAX = _glimmerRuntimeLibSyntax.ATTRIBUTE; - exports.StatementSyntax = _glimmerRuntimeLibSyntax.Statement; - exports.ExpressionSyntax = _glimmerRuntimeLibSyntax.Expression; - exports.AttributeSyntax = _glimmerRuntimeLibSyntax.Attribute; - exports.StatementCompilationBuffer = _glimmerRuntimeLibSyntax.StatementCompilationBuffer; - exports.SymbolLookup = _glimmerRuntimeLibSyntax.SymbolLookup; - exports.CompileInto = _glimmerRuntimeLibSyntax.CompileInto; - exports.isAttribute = _glimmerRuntimeLibSyntax.isAttribute; - exports.templateFactory = _glimmerRuntimeLibTemplate.default; - exports.TemplateFactory = _glimmerRuntimeLibTemplate.TemplateFactory; - exports.Template = _glimmerRuntimeLibTemplate.Template; - exports.SymbolTable = _glimmerRuntimeLibSymbolTable.default; - exports.NULL_REFERENCE = _glimmerRuntimeLibReferences.NULL_REFERENCE; - exports.UNDEFINED_REFERENCE = _glimmerRuntimeLibReferences.UNDEFINED_REFERENCE; - exports.PrimitiveReference = _glimmerRuntimeLibReferences.PrimitiveReference; - exports.ConditionalReference = _glimmerRuntimeLibReferences.ConditionalReference; - exports.Blocks = _glimmerRuntimeLibSyntaxCore.Blocks; - exports.OptimizedAppend = _glimmerRuntimeLibSyntaxCore.OptimizedAppend; - exports.UnoptimizedAppend = _glimmerRuntimeLibSyntaxCore.UnoptimizedAppend; - exports.Unknown = _glimmerRuntimeLibSyntaxCore.Unknown; - exports.StaticAttr = _glimmerRuntimeLibSyntaxCore.StaticAttr; - exports.DynamicAttr = _glimmerRuntimeLibSyntaxCore.DynamicAttr; - exports.ArgsSyntax = _glimmerRuntimeLibSyntaxCore.Args; - exports.NamedArgsSyntax = _glimmerRuntimeLibSyntaxCore.NamedArgs; - exports.PositionalArgsSyntax = _glimmerRuntimeLibSyntaxCore.PositionalArgs; - exports.RefSyntax = _glimmerRuntimeLibSyntaxCore.Ref; - exports.GetNamedParameterSyntax = _glimmerRuntimeLibSyntaxCore.GetArgument; - exports.GetSyntax = _glimmerRuntimeLibSyntaxCore.Get; - exports.ValueSyntax = _glimmerRuntimeLibSyntaxCore.Value; - exports.OpenElement = _glimmerRuntimeLibSyntaxCore.OpenElement; - exports.HelperSyntax = _glimmerRuntimeLibSyntaxCore.Helper; - exports.BlockSyntax = _glimmerRuntimeLibSyntaxCore.Block; - exports.OpenPrimitiveElementSyntax = _glimmerRuntimeLibSyntaxCore.OpenPrimitiveElement; - exports.CloseElementSyntax = _glimmerRuntimeLibSyntaxCore.CloseElement; - exports.OpcodeBuilderDSL = _glimmerRuntimeLibCompiledOpcodesBuilder.default; - exports.Compiler = _glimmerRuntimeLibCompiler.default; - exports.Compilable = _glimmerRuntimeLibCompiler.Compilable; - exports.CompileIntoList = _glimmerRuntimeLibCompiler.CompileIntoList; - exports.compileLayout = _glimmerRuntimeLibCompiler.compileLayout; - exports.ComponentBuilder = _glimmerRuntimeLibOpcodeBuilder.ComponentBuilder; - exports.StaticDefinition = _glimmerRuntimeLibOpcodeBuilder.StaticDefinition; - exports.DynamicDefinition = _glimmerRuntimeLibOpcodeBuilder.DynamicDefinition; - exports.Block = _glimmerRuntimeLibCompiledBlocks.Block; - exports.CompiledBlock = _glimmerRuntimeLibCompiledBlocks.CompiledBlock; - exports.Layout = _glimmerRuntimeLibCompiledBlocks.Layout; - exports.InlineBlock = _glimmerRuntimeLibCompiledBlocks.InlineBlock; - exports.EntryPoint = _glimmerRuntimeLibCompiledBlocks.EntryPoint; - exports.IAttributeManager = _glimmerRuntimeLibDomAttributeManagers.AttributeManager; - exports.AttributeManager = _glimmerRuntimeLibDomAttributeManagers.AttributeManager; - exports.PropertyManager = _glimmerRuntimeLibDomAttributeManagers.PropertyManager; - exports.INPUT_VALUE_PROPERTY_MANAGER = _glimmerRuntimeLibDomAttributeManagers.INPUT_VALUE_PROPERTY_MANAGER; - exports.defaultManagers = _glimmerRuntimeLibDomAttributeManagers.defaultManagers; - exports.defaultAttributeManagers = _glimmerRuntimeLibDomAttributeManagers.defaultAttributeManagers; - exports.defaultPropertyManagers = _glimmerRuntimeLibDomAttributeManagers.defaultPropertyManagers; - exports.readDOMAttr = _glimmerRuntimeLibDomAttributeManagers.readDOMAttr; - exports.normalizeTextValue = _glimmerRuntimeLibCompiledOpcodesContent.normalizeTextValue; - exports.CompiledExpression = _glimmerRuntimeLibCompiledExpressions.CompiledExpression; - exports.CompiledArgs = _glimmerRuntimeLibCompiledExpressionsArgs.CompiledArgs; - exports.CompiledNamedArgs = _glimmerRuntimeLibCompiledExpressionsArgs.CompiledNamedArgs; - exports.CompiledPositionalArgs = _glimmerRuntimeLibCompiledExpressionsArgs.CompiledPositionalArgs; - exports.EvaluatedArgs = _glimmerRuntimeLibCompiledExpressionsArgs.EvaluatedArgs; - exports.EvaluatedNamedArgs = _glimmerRuntimeLibCompiledExpressionsArgs.EvaluatedNamedArgs; - exports.EvaluatedPositionalArgs = _glimmerRuntimeLibCompiledExpressionsArgs.EvaluatedPositionalArgs; - exports.FunctionExpression = _glimmerRuntimeLibCompiledExpressionsFunction.FunctionExpression; - exports.getDynamicVar = _glimmerRuntimeLibHelpersGetDynamicVar.default; - exports.WithDynamicVarsSyntax = _glimmerRuntimeLibSyntaxBuiltinsWithDynamicVars.default; - exports.InElementSyntax = _glimmerRuntimeLibSyntaxBuiltinsInElement.default; - exports.VM = _glimmerRuntimeLibVm.PublicVM; - exports.UpdatingVM = _glimmerRuntimeLibVm.UpdatingVM; - exports.RenderResult = _glimmerRuntimeLibVm.RenderResult; - exports.SafeString = _glimmerRuntimeLibUpsert.SafeString; - exports.isSafeString = _glimmerRuntimeLibUpsert.isSafeString; - exports.Scope = _glimmerRuntimeLibEnvironment.Scope; - exports.Environment = _glimmerRuntimeLibEnvironment.default; - exports.Helper = _glimmerRuntimeLibEnvironment.Helper; - exports.ParsedStatement = _glimmerRuntimeLibEnvironment.ParsedStatement; - exports.DynamicScope = _glimmerRuntimeLibEnvironment.DynamicScope; - exports.PartialDefinition = _glimmerRuntimeLibPartial.PartialDefinition; - exports.Component = _glimmerRuntimeLibComponentInterfaces.Component; - exports.ComponentClass = _glimmerRuntimeLibComponentInterfaces.ComponentClass; - exports.ComponentManager = _glimmerRuntimeLibComponentInterfaces.ComponentManager; - exports.ComponentDefinition = _glimmerRuntimeLibComponentInterfaces.ComponentDefinition; - exports.ComponentLayoutBuilder = _glimmerRuntimeLibComponentInterfaces.ComponentLayoutBuilder; - exports.ComponentAttrsBuilder = _glimmerRuntimeLibComponentInterfaces.ComponentAttrsBuilder; - exports.isComponentDefinition = _glimmerRuntimeLibComponentInterfaces.isComponentDefinition; - exports.ModifierManager = _glimmerRuntimeLibModifierInterfaces.ModifierManager; - exports.DOMChanges = _glimmerRuntimeLibDomHelper.default; - exports.IDOMChanges = _glimmerRuntimeLibDomHelper.DOMChanges; - exports.DOMTreeConstruction = _glimmerRuntimeLibDomHelper.DOMTreeConstruction; - exports.isWhitespace = _glimmerRuntimeLibDomHelper.isWhitespace; - exports.insertHTMLBefore = _glimmerRuntimeLibDomHelper.insertHTMLBefore; - exports.Simple = _glimmerRuntimeLibDomInterfaces; - exports.ElementStack = _glimmerRuntimeLibBuilder.ElementStack; - exports.ElementOperations = _glimmerRuntimeLibBuilder.ElementOperations; - exports.Bounds = _glimmerRuntimeLibBounds.default; - exports.ConcreteBounds = _glimmerRuntimeLibBounds.ConcreteBounds; -}); - -enifed("glimmer-runtime/lib/bounds", ["exports"], function (exports) { - "use strict"; + qpMeta.qps.forEach(function (qp) { + var routeQpMeta = _emberMetal.get(qp.route, '_qp'); + var finalizedController = qp.route.controller; + finalizedController._qpDelegate = _emberMetal.get(routeQpMeta, 'states.active'); + }); - exports.bounds = bounds; - exports.single = single; - exports.move = move; - exports.clear = clear; + router._qpUpdates = null; + } + }, - var Cursor = function Cursor(element, nextSibling) { - this.element = element; - this.nextSibling = nextSibling; - }; + /** + This hook is executed when the router completely exits this route. It is + not executed when the model for the route changes. + @method deactivate + @since 1.0.0 + @public + */ + deactivate: K, - exports.Cursor = Cursor; + /** + This hook is executed when the router enters the route. It is not executed + when the model for the route changes. + @method activate + @since 1.0.0 + @public + */ + activate: K, - var RealDOMBounds = (function () { - function RealDOMBounds(bounds) { - this.bounds = bounds; + /** + Transition the application into another route. The route may + be either a single route or route path: + ```javascript + this.transitionTo('blogPosts'); + this.transitionTo('blogPosts.recentEntries'); + ``` + Optionally supply a model for the route in question. The model + will be serialized into the URL using the `serialize` hook of + the route: + ```javascript + this.transitionTo('blogPost', aPost); + ``` + If a literal is passed (such as a number or a string), it will + be treated as an identifier instead. In this case, the `model` + hook of the route will be triggered: + ```javascript + this.transitionTo('blogPost', 1); + ``` + Multiple models will be applied last to first recursively up the + route tree. + ```app/routes.js + // ... + Router.map(function() { + this.route('blogPost', { path:':blogPostId' }, function() { + this.route('blogComment', { path: ':blogCommentId' }); + }); + }); + export default Router; + ``` + ```javascript + this.transitionTo('blogComment', aPost, aComment); + this.transitionTo('blogComment', 1, 13); + ``` + It is also possible to pass a URL (a string that starts with a + `/`). This is intended for testing and debugging purposes and + should rarely be used in production code. + ```javascript + this.transitionTo('/'); + this.transitionTo('/blog/post/1/comment/13'); + this.transitionTo('/blog/posts?sort=title'); + ``` + An options hash with a `queryParams` property may be provided as + the final argument to add query parameters to the destination URL. + ```javascript + this.transitionTo('blogPost', 1, { + queryParams: { showComments: 'true' } + }); + // if you just want to transition the query parameters without changing the route + this.transitionTo({ queryParams: { sort: 'date' } }); + ``` + See also [replaceWith](#method_replaceWith). + Simple Transition Example + ```app/routes.js + // ... + Router.map(function() { + this.route('index'); + this.route('secret'); + this.route('fourOhFour', { path: '*:' }); + }); + export default Router; + ``` + ```app/routes/index.js + import Ember from 'ember': + export Ember.Route.extend({ + actions: { + moveToSecret(context) { + if (authorized()) { + this.transitionTo('secret', context); + } else { + this.transitionTo('fourOhFour'); + } + } } - - RealDOMBounds.prototype.parentElement = function parentElement() { - return this.bounds.parentElement(); - }; - - RealDOMBounds.prototype.firstNode = function firstNode() { - return this.bounds.firstNode(); - }; - - RealDOMBounds.prototype.lastNode = function lastNode() { - return this.bounds.lastNode(); - }; - - return RealDOMBounds; - })(); - - exports.RealDOMBounds = RealDOMBounds; - - var ConcreteBounds = (function () { - function ConcreteBounds(parentNode, first, last) { - this.parentNode = parentNode; - this.first = first; - this.last = last; + }); + ``` + Transition to a nested route + ```app/router.js + // ... + Router.map(function() { + this.route('articles', { path: '/articles' }, function() { + this.route('new'); + }); + }); + export default Router; + ``` + ```app/routes/index.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + transitionToNewArticle() { + this.transitionTo('articles.new'); + } } - - ConcreteBounds.prototype.parentElement = function parentElement() { - return this.parentNode; - }; - - ConcreteBounds.prototype.firstNode = function firstNode() { - return this.first; - }; - - ConcreteBounds.prototype.lastNode = function lastNode() { - return this.last; - }; - - return ConcreteBounds; - })(); - - exports.ConcreteBounds = ConcreteBounds; - - var SingleNodeBounds = (function () { - function SingleNodeBounds(parentNode, node) { - this.parentNode = parentNode; - this.node = node; + }); + ``` + Multiple Models Example + ```app/router.js + // ... + Router.map(function() { + this.route('index'); + this.route('breakfast', { path: ':breakfastId' }, function() { + this.route('cereal', { path: ':cerealId' }); + }); + }); + export default Router; + ``` + ```app/routes/index.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + moveToChocolateCereal() { + let cereal = { cerealId: 'ChocolateYumminess' }; + let breakfast = { breakfastId: 'CerealAndMilk' }; + this.transitionTo('breakfast.cereal', breakfast, cereal); + } } - - SingleNodeBounds.prototype.parentElement = function parentElement() { - return this.parentNode; - }; - - SingleNodeBounds.prototype.firstNode = function firstNode() { - return this.node; - }; - - SingleNodeBounds.prototype.lastNode = function lastNode() { - return this.node; - }; - - return SingleNodeBounds; - })(); - - exports.SingleNodeBounds = SingleNodeBounds; - - function bounds(parent, first, last) { - return new ConcreteBounds(parent, first, last); - } - - function single(parent, node) { - return new SingleNodeBounds(parent, node); - } - - function move(bounds, reference) { - var parent = bounds.parentElement(); - var first = bounds.firstNode(); - var last = bounds.lastNode(); - var node = first; - while (node) { - var next = node.nextSibling; - parent.insertBefore(node, reference); - if (node === last) return next; - node = next; + }); + ``` + Nested Route with Query String Example + ```app/routes.js + // ... + Router.map(function() { + this.route('fruits', function() { + this.route('apples'); + }); + }); + export default Router; + ``` + ```app/routes/index.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + transitionToApples() { + this.transitionTo('fruits.apples', { queryParams: { color: 'red' } }); + } } - return null; - } + }); + ``` + @method transitionTo + @param {String} name the name of the route or a URL + @param {...Object} models the model(s) or identifier(s) to be used while + transitioning to the route. + @param {Object} [options] optional hash with a queryParams property + containing a mapping of query parameters + @return {Transition} the transition object associated with this + attempted transition + @since 1.0.0 + @public + */ + transitionTo: function (name, context) { + var router = this.router; + return router.transitionTo.apply(router, _emberRoutingUtils.prefixRouteNameArg(this, arguments)); + }, - function clear(bounds) { - var parent = bounds.parentElement(); - var first = bounds.firstNode(); - var last = bounds.lastNode(); - var node = first; - while (node) { - var next = node.nextSibling; - parent.removeChild(node); - if (node === last) return next; - node = next; - } - return null; - } -}); + /** + Perform a synchronous transition into another route without attempting + to resolve promises, update the URL, or abort any currently active + asynchronous transitions (i.e. regular transitions caused by + `transitionTo` or URL changes). + This method is handy for performing intermediate transitions on the + way to a final destination route, and is called internally by the + default implementations of the `error` and `loading` handlers. + @method intermediateTransitionTo + @param {String} name the name of the route + @param {...Object} models the model(s) to be used while transitioning + to the route. + @since 1.2.0 + @public + */ + intermediateTransitionTo: function () { + var router = this.router; + router.intermediateTransitionTo.apply(router, _emberRoutingUtils.prefixRouteNameArg(this, arguments)); + }, -enifed('glimmer-runtime/lib/builder', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-util', 'glimmer-runtime/lib/compiled/opcodes/dom'], function (exports, _glimmerRuntimeLibBounds, _glimmerUtil, _glimmerRuntimeLibCompiledOpcodesDom) { - 'use strict'; + /** + Refresh the model on this route and any child routes, firing the + `beforeModel`, `model`, and `afterModel` hooks in a similar fashion + to how routes are entered when transitioning in from other route. + The current route params (e.g. `article_id`) will be passed in + to the respective model hooks, and if a different model is returned, + `setupController` and associated route hooks will re-fire as well. + An example usage of this method is re-querying the server for the + latest information using the same parameters as when the route + was first entered. + Note that this will cause `model` hooks to fire even on routes + that were provided a model object when the route was initially + entered. + @method refresh + @return {Transition} the transition object associated with this + attempted transition + @since 1.4.0 + @public + */ + refresh: function () { + return this.router.router.refresh(this); + }, - var First = (function () { - function First(node) { - this.node = node; + /** + Transition into another route while replacing the current URL, if possible. + This will replace the current history entry instead of adding a new one. + Beside that, it is identical to `transitionTo` in all other respects. See + 'transitionTo' for additional information regarding multiple models. + Example + ```app/router.js + // ... + Router.map(function() { + this.route('index'); + this.route('secret'); + }); + export default Router; + ``` + ```app/routes/secret.js + import Ember from 'ember'; + export default Ember.Route.extend({ + afterModel() { + if (!authorized()){ + this.replaceWith('index'); + } } + }); + ``` + @method replaceWith + @param {String} name the name of the route or a URL + @param {...Object} models the model(s) or identifier(s) to be used while + transitioning to the route. + @return {Transition} the transition object associated with this + attempted transition + @since 1.0.0 + @public + */ + replaceWith: function () { + var router = this.router; + return router.replaceWith.apply(router, _emberRoutingUtils.prefixRouteNameArg(this, arguments)); + }, - First.prototype.firstNode = function firstNode() { - return this.node; - }; - - return First; - })(); - - var Last = (function () { - function Last(node) { - this.node = node; + /** + Sends an action to the router, which will delegate it to the currently + active route hierarchy per the bubbling rules explained under `actions`. + Example + ```app/router.js + // ... + Router.map(function() { + this.route('index'); + }); + export default Router; + ``` + ```app/routes/application.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + track(arg) { + console.log(arg, 'was clicked'); + } } - - Last.prototype.lastNode = function lastNode() { - return this.node; - }; - - return Last; - })(); - - var Fragment = (function () { - function Fragment(bounds) { - this.bounds = bounds; + }); + ``` + ```app/routes/index.js + import Ember from 'ember'; + export default Ember.Route.extend({ + actions: { + trackIfDebug(arg) { + if (debug) { + this.send('track', arg); + } + } } + }); + ``` + @method send + @param {String} name the name of the action to trigger + @param {...*} args + @since 1.0.0 + @public + */ + send: function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - Fragment.prototype.parentElement = function parentElement() { - return this.bounds.parentElement(); - }; + if (this.router && this.router.router || !_emberMetal.isTesting()) { + var _router; - Fragment.prototype.firstNode = function firstNode() { - return this.bounds.firstNode(); - }; + (_router = this.router).send.apply(_router, args); + } else { + var _name2 = args[0]; + args = slice.call(args, 1); + var action = this.actions[_name2]; + if (action) { + return this.actions[_name2].apply(this, args); + } + } + }, - Fragment.prototype.lastNode = function lastNode() { - return this.bounds.lastNode(); - }; + /** + This hook is the entry point for router.js + @private + @method setup + */ + setup: function (context, transition) { + var _this2 = this; - Fragment.prototype.update = function update(bounds) { - this.bounds = bounds; - }; + var controller = undefined; - return Fragment; - })(); + var controllerName = this.controllerName || this.routeName; + var definedController = this.controllerFor(controllerName, true); - exports.Fragment = Fragment; - - var ElementStack = (function () { - function ElementStack(env, parentNode, nextSibling) { - this.constructing = null; - this.operations = null; - this.elementStack = new _glimmerUtil.Stack(); - this.nextSiblingStack = new _glimmerUtil.Stack(); - this.blockStack = new _glimmerUtil.Stack(); - this.env = env; - this.dom = env.getAppendOperations(); - this.updateOperations = env.getDOM(); - this.element = parentNode; - this.nextSibling = nextSibling; - this.defaultOperations = new _glimmerRuntimeLibCompiledOpcodesDom.SimpleElementOperations(env); - this.elementStack.push(this.element); - this.nextSiblingStack.push(this.nextSibling); - } - - ElementStack.forInitialRender = function forInitialRender(env, parentNode, nextSibling) { - return new ElementStack(env, parentNode, nextSibling); - }; + if (!definedController) { + controller = this.generateController(controllerName); + } else { + controller = definedController; + } - ElementStack.resume = function resume(env, tracker, nextSibling) { - var parentNode = tracker.parentElement(); - var stack = new ElementStack(env, parentNode, nextSibling); - stack.pushBlockTracker(tracker); - return stack; - }; + // Assign the route's controller so that it can more easily be + // referenced in action handlers. Side effects. Side effects everywhere. + if (!this.controller) { + var propNames = _emberMetal.get(this, '_qp.propertyNames'); + addQueryParamsObservers(controller, propNames); + this.controller = controller; + } - ElementStack.prototype.block = function block() { - return this.blockStack.current; - }; + var queryParams = _emberMetal.get(this, '_qp'); - ElementStack.prototype.popElement = function popElement() { - var elementStack = this.elementStack; - var nextSiblingStack = this.nextSiblingStack; + var states = queryParams.states; - var topElement = elementStack.pop(); - nextSiblingStack.pop(); - this.element = elementStack.current; - this.nextSibling = nextSiblingStack.current; - return topElement; - }; + controller._qpDelegate = states.allowOverrides; - ElementStack.prototype.pushSimpleBlock = function pushSimpleBlock() { - var tracker = new SimpleBlockTracker(this.element); - this.pushBlockTracker(tracker); - return tracker; - }; + if (transition) { + (function () { + // Update the model dep values used to calculate cache keys. + _emberRoutingUtils.stashParamNames(_this2.router, transition.state.handlerInfos); - ElementStack.prototype.pushUpdatableBlock = function pushUpdatableBlock() { - var tracker = new UpdatableBlockTracker(this.element); - this.pushBlockTracker(tracker); - return tracker; - }; + var params = transition.params; + var allParams = queryParams.propertyNames; + var cache = _this2._bucketCache; - ElementStack.prototype.pushBlockTracker = function pushBlockTracker(tracker) { - var isRemote = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; + allParams.forEach(function (prop) { + var aQp = queryParams.map[prop]; - var current = this.blockStack.current; - if (current !== null) { - current.newDestroyable(tracker); - if (!isRemote) { - current.newBounds(tracker); - } - } - this.blockStack.push(tracker); - return tracker; - }; + aQp.values = params; + var cacheKey = _emberRoutingUtils.calculateCacheKey(aQp.route.fullRouteName, aQp.parts, aQp.values); - ElementStack.prototype.pushBlockList = function pushBlockList(list) { - var tracker = new BlockListTracker(this.element, list); - var current = this.blockStack.current; - if (current !== null) { - current.newDestroyable(tracker); - current.newBounds(tracker); + if (cache) { + var value = cache.lookup(cacheKey, prop, aQp.undecoratedDefaultValue); + _emberMetal.set(controller, prop, value); } - this.blockStack.push(tracker); - return tracker; - }; - - ElementStack.prototype.popBlock = function popBlock() { - this.blockStack.current.finalize(this); - return this.blockStack.pop(); - }; - - ElementStack.prototype.openElement = function openElement(tag) { - var operations = arguments.length <= 1 || arguments[1] === undefined ? this.defaultOperations : arguments[1]; - - var element = this.dom.createElement(tag, this.element); - this.constructing = element; - this.operations = operations; - return element; - }; - - ElementStack.prototype.flushElement = function flushElement() { - var parent = this.element; - var element = this.constructing; - this.dom.insertBefore(parent, element, this.nextSibling); - this.constructing = null; - this.operations = null; - this.pushElement(element); - this.blockStack.current.openElement(element); - }; - - ElementStack.prototype.pushRemoteElement = function pushRemoteElement(element) { - this.pushElement(element); - var tracker = new RemoteBlockTracker(element); - this.pushBlockTracker(tracker, true); - }; + }); + })(); + } - ElementStack.prototype.popRemoteElement = function popRemoteElement() { - this.popBlock(); - this.popElement(); - }; + if (transition) { + var qpValues = getQueryParamsFor(this, transition.state); + controller.setProperties(qpValues); + } - ElementStack.prototype.pushElement = function pushElement(element) { - this.element = element; - this.elementStack.push(element); - this.nextSibling = null; - this.nextSiblingStack.push(null); - }; + this.setupController(controller, context, transition); - ElementStack.prototype.newDestroyable = function newDestroyable(d) { - this.blockStack.current.newDestroyable(d); - }; + if (this._environment.options.shouldRender) { + this.renderTemplate(controller, context); + } + }, - ElementStack.prototype.newBounds = function newBounds(bounds) { - this.blockStack.current.newBounds(bounds); - }; + /* + 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 + value in the cache so if this route becomes active, the cache value has been updated. + */ + _qpChanged: function (prop, value, qp) { + if (!qp) { + return; + } - ElementStack.prototype.appendText = function appendText(string) { - var dom = this.dom; + var cacheKey = _emberRoutingUtils.calculateCacheKey(qp.route.fullRouteName, qp.parts, qp.values); - var text = dom.createTextNode(string); - dom.insertBefore(this.element, text, this.nextSibling); - this.blockStack.current.newNode(text); - return text; - }; + // Update model-dep cache + var cache = this._bucketCache; + if (cache) { + cache.stash(cacheKey, prop, value); + } + }, - ElementStack.prototype.appendComment = function appendComment(string) { - var dom = this.dom; + /** + This hook is the first of the route entry validation hooks + called when an attempt is made to transition into a route + or one of its children. It is called before `model` and + `afterModel`, and is appropriate for cases when: + 1) A decision can be made to redirect elsewhere without + needing to resolve the model first. + 2) Any async operations need to occur first before the + model is attempted to be resolved. + This hook is provided the current `transition` attempt + as a parameter, which can be used to `.abort()` the transition, + save it for a later `.retry()`, or retrieve values set + on it from a previous hook. You can also just call + `this.transitionTo` to another route to implicitly + abort the `transition`. + You can return a promise from this hook to pause the + transition until the promise resolves (or rejects). This could + be useful, for instance, for retrieving async code from + the server that is required to enter a route. + @method beforeModel + @param {Transition} transition + @return {Promise} if the value returned from this hook is + a promise, the transition will pause until the transition + resolves. Otherwise, non-promise return values are not + utilized in any way. + @since 1.0.0 + @public + */ + beforeModel: K, - var comment = dom.createComment(string); - dom.insertBefore(this.element, comment, this.nextSibling); - this.blockStack.current.newNode(comment); - return comment; - }; + /** + This hook is called after this route's model has resolved. + It follows identical async/promise semantics to `beforeModel` + but is provided the route's resolved model in addition to + the `transition`, and is therefore suited to performing + logic that can only take place after the model has already + resolved. + ```app/routes/posts.js + import Ember from 'ember'; + export default Ember.Route.extend({ + afterModel(posts, transition) { + if (posts.get('length') === 1) { + this.transitionTo('post.show', posts.get('firstObject')); + } + } + }); + ``` + Refer to documentation for `beforeModel` for a description + of transition-pausing semantics when a promise is returned + from this hook. + @method afterModel + @param {Object} resolvedModel the value returned from `model`, + or its resolved value if it was a promise + @param {Transition} transition + @return {Promise} if the value returned from this hook is + a promise, the transition will pause until the transition + resolves. Otherwise, non-promise return values are not + utilized in any way. + @since 1.0.0 + @public + */ + afterModel: K, - ElementStack.prototype.setStaticAttribute = function setStaticAttribute(name, value) { - this.operations.addStaticAttribute(this.constructing, name, value); - }; + /** + A hook you can implement to optionally redirect to another route. + If you call `this.transitionTo` from inside of this hook, this route + will not be entered in favor of the other hook. + `redirect` and `afterModel` behave very similarly and are + called almost at the same time, but they have an important + distinction in the case that, from one of these hooks, a + redirect into a child route of this route occurs: redirects + from `afterModel` essentially invalidate the current attempt + to enter this route, and will result in this route's `beforeModel`, + `model`, and `afterModel` hooks being fired again within + the new, redirecting transition. Redirects that occur within + the `redirect` hook, on the other hand, will _not_ cause + these hooks to be fired again the second time around; in + other words, by the time the `redirect` hook has been called, + both the resolved model and attempted entry into this route + are considered to be fully validated. + @method redirect + @param {Object} model the model for this route + @param {Transition} transition the transition object associated with the current transition + @since 1.0.0 + @public + */ + redirect: K, - ElementStack.prototype.setStaticAttributeNS = function setStaticAttributeNS(namespace, name, value) { - this.operations.addStaticAttributeNS(this.constructing, namespace, name, value); - }; + /** + Called when the context is changed by router.js. + @private + @method contextDidChange + */ + contextDidChange: function () { + this.currentModel = this.context; + }, - ElementStack.prototype.setDynamicAttribute = function setDynamicAttribute(name, reference, isTrusting) { - this.operations.addDynamicAttribute(this.constructing, name, reference, isTrusting); - }; + /** + A hook you can implement to convert the URL into the model for + this route. + ```app/router.js + // ... + Router.map(function() { + this.route('post', { path: '/posts/:post_id' }); + }); + export default Router; + ``` + The model for the `post` route is `store.findRecord('post', params.post_id)`. + By default, if your route has a dynamic segment ending in `_id`: + * The model class is determined from the segment (`post_id`'s + class is `App.Post`) + * The find method is called on the model class with the value of + the dynamic segment. + Note that for routes with dynamic segments, this hook is not always + executed. If the route is entered through a transition (e.g. when + using the `link-to` Handlebars helper or the `transitionTo` method + of routes), and a model context is already provided this hook + is not called. + A model context does not include a primitive string or number, + which does cause the model hook to be called. + Routes without dynamic segments will always execute the model hook. + ```javascript + // no dynamic segment, model hook always called + this.transitionTo('posts'); + // model passed in, so model hook not called + thePost = store.findRecord('post', 1); + this.transitionTo('post', thePost); + // integer passed in, model hook is called + this.transitionTo('post', 1); + // model id passed in, model hook is called + // useful for forcing the hook to execute + thePost = store.findRecord('post', 1); + this.transitionTo('post', thePost.id); + ``` + This hook follows the asynchronous/promise semantics + described in the documentation for `beforeModel`. In particular, + if a promise returned from `model` fails, the error will be + handled by the `error` hook on `Ember.Route`. + Example + ```app/routes/post.js + import Ember from 'ember'; + export default Ember.Route.extend({ + model(params) { + return this.store.findRecord('post', params.post_id); + } + }); + ``` + @method model + @param {Object} params the parameters extracted from the URL + @param {Transition} transition + @return {Object|Promise} the model for this route. If + a promise is returned, the transition will pause until + the promise resolves, and the resolved value of the promise + will be used as the model for this route. + @since 1.0.0 + @public + */ + model: function (params, transition) { + var name = undefined, + sawParams = undefined, + value = undefined; + var queryParams = _emberMetal.get(this, '_qp.map'); - ElementStack.prototype.setDynamicAttributeNS = function setDynamicAttributeNS(namespace, name, reference, isTrusting) { - this.operations.addDynamicAttributeNS(this.constructing, namespace, name, reference, isTrusting); - }; + for (var prop in params) { + if (prop === 'queryParams' || queryParams && prop in queryParams) { + continue; + } - ElementStack.prototype.closeElement = function closeElement() { - this.blockStack.current.closeElement(); - this.popElement(); - }; + var match = prop.match(/^(.*)_id$/); + if (match) { + name = match[1]; + value = params[prop]; + } + sawParams = true; + } - return ElementStack; - })(); + if (!name && sawParams) { + return _emberRuntime.copy(params); + } else if (!name) { + if (transition.resolveIndex < 1) { + return; + } - exports.ElementStack = ElementStack; + return transition.state.handlerInfos[transition.resolveIndex - 1].context; + } - var SimpleBlockTracker = (function () { - function SimpleBlockTracker(parent) { - this.parent = parent; - this.first = null; - this.last = null; - this.destroyables = null; - this.nesting = 0; - } + return this.findModel(name, value); + }, - SimpleBlockTracker.prototype.destroy = function destroy() { - var destroyables = this.destroyables; + /** + @private + @method deserialize + @param {Object} params the parameters extracted from the URL + @param {Transition} transition + @return {Object|Promise} the model for this route. + Router.js hook. + */ + deserialize: function (params, transition) { + return this.model(this.paramsFor(this.routeName), transition); + }, - if (destroyables && destroyables.length) { - for (var i = 0; i < destroyables.length; i++) { - destroyables[i].destroy(); - } - } - }; + /** + @method findModel + @param {String} type the model type + @param {Object} value the value passed to find + @private + */ + findModel: function () { + var store = _emberMetal.get(this, 'store'); + return store.find.apply(store, arguments); + }, - SimpleBlockTracker.prototype.parentElement = function parentElement() { - return this.parent; - }; + /** + Store property provides a hook for data persistence libraries to inject themselves. + By default, this store property provides the exact same functionality previously + in the model hook. + Currently, the required interface is: + `store.find(modelName, findArguments)` + @method store + @param {Object} store + @private + */ + store: _emberMetal.computed(function () { + var owner = _emberUtils.getOwner(this); + var routeName = this.routeName; + var namespace = _emberMetal.get(this, 'router.namespace'); - SimpleBlockTracker.prototype.firstNode = function firstNode() { - return this.first && this.first.firstNode(); - }; + return { + find: function (name, value) { + var modelClass = owner[_container.FACTORY_FOR]('model:' + name); - SimpleBlockTracker.prototype.lastNode = function lastNode() { - return this.last && this.last.lastNode(); - }; + if (!modelClass) { + return; + } - SimpleBlockTracker.prototype.openElement = function openElement(element) { - this.newNode(element); - this.nesting++; - }; + modelClass = modelClass.class; - SimpleBlockTracker.prototype.closeElement = function closeElement() { - this.nesting--; - }; + return modelClass.find(value); + } + }; + }), - SimpleBlockTracker.prototype.newNode = function newNode(node) { - if (this.nesting !== 0) return; - if (!this.first) { - this.first = new First(node); - } - this.last = new Last(node); - }; + /** + A hook you can implement to convert the route's model into parameters + for the URL. + ```app/router.js + // ... + Router.map(function() { + this.route('post', { path: '/posts/:post_id' }); + }); + ``` + ```app/routes/post.js + import Ember from 'ember'; + export default Ember.Route.extend({ + model(params) { + // the server returns `{ id: 12 }` + return Ember.$.getJSON('/posts/' + params.post_id); + }, + serialize(model) { + // this will make the URL `/posts/12` + return { post_id: model.id }; + } + }); + ``` + The default `serialize` method will insert the model's `id` into the + route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'. + If the route has multiple dynamic segments or does not contain '_id', `serialize` + will return `Ember.getProperties(model, params)` + This method is called when `transitionTo` is called with a context + in order to populate the URL. + @method serialize + @param {Object} model the routes model + @param {Array} params an Array of parameter names for the current + route (in the example, `['post_id']`. + @return {Object} the serialized parameters + @since 1.0.0 + @public + */ + serialize: defaultSerialize, - SimpleBlockTracker.prototype.newBounds = function newBounds(bounds) { - if (this.nesting !== 0) return; - if (!this.first) { - this.first = bounds; - } - this.last = bounds; - }; + /** + A hook you can use to setup the controller for the current route. + This method is called with the controller for the current route and the + model supplied by the `model` hook. + By default, the `setupController` hook sets the `model` property of + the controller to the `model`. + If you implement the `setupController` hook in your Route, it will + prevent this default behavior. If you want to preserve that behavior + when implementing your `setupController` function, make sure to call + `_super`: + ```app/routes/photos.js + import Ember from 'ebmer'; + export default Ember.Route.extend({ + model() { + return this.store.findAll('photo'); + }, + setupController(controller, model) { + // Call _super for default behavior + this._super(controller, model); + // Implement your custom setup after + this.controllerFor('application').set('showingPhotos', true); + } + }); + ``` + The provided controller will be one resolved based on the name + of this route. + If no explicit controller is defined, Ember will automatically create one. + As an example, consider the router: + ```app/router.js + // ... + Router.map(function() { + this.route('post', { path: '/posts/:post_id' }); + }); + export default Router; + ``` + For the `post` route, a controller named `App.PostController` would + be used if it is defined. If it is not defined, a basic `Ember.Controller` + instance would be used. + Example + ```app/routes/post.js + import Ember from 'ember'; + export default Ember.Route.extend({ + setupController(controller, model) { + controller.set('model', model); + } + }); + ``` + @method setupController + @param {Controller} controller instance + @param {Object} model + @since 1.0.0 + @public + */ + setupController: function (controller, context, transition) { + if (controller && context !== undefined) { + _emberMetal.set(controller, 'model', context); + } + }, - SimpleBlockTracker.prototype.newDestroyable = function newDestroyable(d) { - this.destroyables = this.destroyables || []; - this.destroyables.push(d); - }; + /** + Returns the resolved model of the current route, or a parent (or any ancestor) + route in a route hierarchy. + The controller instance must already have been created, either through entering the + associated route or using `generateController`. + ```app/routes/post.js + import Ember from 'ember'; + export default Ember.Route.extend({ + setupController(controller, post) { + this._super(controller, post); + this.controllerFor('posts').set('currentPost', post); + } + }); + ``` + @method controllerFor + @param {String} name the name of the route or controller + @return {Ember.Controller} + @since 1.0.0 + @public + */ + controllerFor: function (name, _skipAssert) { + var owner = _emberUtils.getOwner(this); + var route = owner.lookup('route:' + name); + var controller = undefined; - SimpleBlockTracker.prototype.finalize = function finalize(stack) { - if (!this.first) { - stack.appendComment(''); - } - }; + if (route && route.controllerName) { + name = route.controllerName; + } - return SimpleBlockTracker; - })(); + controller = owner.lookup('controller:' + name); - exports.SimpleBlockTracker = SimpleBlockTracker; + // NOTE: We're specifically checking that skipAssert is true, because according + // to the old API the second parameter was model. We do not want people who + // passed a model to skip the assertion. - var RemoteBlockTracker = (function (_SimpleBlockTracker) { - babelHelpers.inherits(RemoteBlockTracker, _SimpleBlockTracker); + return controller; + }, - function RemoteBlockTracker() { - _SimpleBlockTracker.apply(this, arguments); + /** + Generates a controller for a route. + Example + ```app/routes/post.js + import Ember from 'ember'; + export default Ember.Route.extend({ + setupController(controller, post) { + this._super(controller, post); + this.generateController('posts'); } + }); + ``` + @method generateController + @param {String} name the name of the controller + @private + */ + generateController: function (name) { + var owner = _emberUtils.getOwner(this); - RemoteBlockTracker.prototype.destroy = function destroy() { - _SimpleBlockTracker.prototype.destroy.call(this); - _glimmerRuntimeLibBounds.clear(this); - }; - - return RemoteBlockTracker; - })(SimpleBlockTracker); - - var UpdatableBlockTracker = (function (_SimpleBlockTracker2) { - babelHelpers.inherits(UpdatableBlockTracker, _SimpleBlockTracker2); + return _emberRoutingSystemGenerate_controller.default(owner, name); + }, - function UpdatableBlockTracker() { - _SimpleBlockTracker2.apply(this, arguments); + /** + Returns the resolved model of a parent (or any ancestor) route + in a route hierarchy. During a transition, all routes + must resolve a model object, and if a route + needs access to a parent route's model in order to + resolve a model (or just reuse the model from a parent), + it can call `this.modelFor(theNameOfParentRoute)` to + retrieve it. If the ancestor route's model was a promise, + its resolved result is returned. + Example + ```app/router.js + // ... + Router.map(function() { + this.route('post', { path: '/posts/:post_id' }, function() { + this.route('comments'); + }); + }); + export default Router; + ``` + ```app/routes/comments.js + import Ember from 'ember'; + export default Ember.Route.extend({ + model() { + let post = this.modelFor('post'); + return post.get('comments'); } + }); + ``` + @method modelFor + @param {String} name the name of the route + @return {Object} the model object + @since 1.0.0 + @public + */ + modelFor: function (_name) { + var name = undefined; + var owner = _emberUtils.getOwner(this); - UpdatableBlockTracker.prototype.reset = function reset(env) { - var destroyables = this.destroyables; - - if (destroyables && destroyables.length) { - for (var i = 0; i < destroyables.length; i++) { - env.didDestroy(destroyables[i]); - } - } - var nextSibling = _glimmerRuntimeLibBounds.clear(this); - this.destroyables = null; - this.first = null; - this.last = null; - return nextSibling; - }; - - return UpdatableBlockTracker; - })(SimpleBlockTracker); + // Only change the route name when there is an active transition. + // Otherwise, use the passed in route name. + if (owner.routable && this.router && this.router.router.activeTransition) { + name = getEngineRouteName(owner, _name); + } else { + name = _name; + } - exports.UpdatableBlockTracker = UpdatableBlockTracker; + var route = _emberUtils.getOwner(this).lookup('route:' + name); + var transition = this.router ? this.router.router.activeTransition : null; - var BlockListTracker = (function () { - function BlockListTracker(parent, boundList) { - this.parent = parent; - this.boundList = boundList; - this.parent = parent; - this.boundList = boundList; + // If we are mid-transition, we want to try and look up + // resolved parent contexts on the current transitionEvent. + if (transition) { + var modelLookupName = route && route.routeName || name; + if (transition.resolvedModels.hasOwnProperty(modelLookupName)) { + return transition.resolvedModels[modelLookupName]; } + } - BlockListTracker.prototype.destroy = function destroy() { - this.boundList.forEachNode(function (node) { - return node.destroy(); - }); - }; - - BlockListTracker.prototype.parentElement = function parentElement() { - return this.parent; - }; - - BlockListTracker.prototype.firstNode = function firstNode() { - return this.boundList.head().firstNode(); - }; - - BlockListTracker.prototype.lastNode = function lastNode() { - return this.boundList.tail().lastNode(); - }; - - BlockListTracker.prototype.openElement = function openElement(element) { - _glimmerUtil.assert(false, 'Cannot openElement directly inside a block list'); - }; - - BlockListTracker.prototype.closeElement = function closeElement() { - _glimmerUtil.assert(false, 'Cannot closeElement directly inside a block list'); - }; - - BlockListTracker.prototype.newNode = function newNode(node) { - _glimmerUtil.assert(false, 'Cannot create a new node directly inside a block list'); - }; - - BlockListTracker.prototype.newBounds = function newBounds(bounds) {}; - - BlockListTracker.prototype.newDestroyable = function newDestroyable(d) {}; - - BlockListTracker.prototype.finalize = function finalize(stack) {}; - - return BlockListTracker; - })(); -}); - -enifed('glimmer-runtime/lib/compat/inner-html-fix', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/dom/helper'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibDomHelper) { - 'use strict'; - - exports.domChanges = domChanges; - exports.treeConstruction = treeConstruction; - - var innerHTMLWrapper = { - colgroup: { depth: 2, before: '', after: '
    ' }, - table: { depth: 1, before: '', after: '
    ' }, - tbody: { depth: 2, before: '', after: '
    ' }, - tfoot: { depth: 2, before: '', after: '
    ' }, - thead: { depth: 2, before: '', after: '
    ' }, - tr: { depth: 3, before: '', after: '
    ' } - }; - // Patch: innerHTML Fix - // Browsers: IE9 - // Reason: IE9 don't allow us to set innerHTML on col, colgroup, frameset, - // html, style, table, tbody, tfoot, thead, title, tr. - // Fix: Wrap the innerHTML we are about to set in its parents, apply the - // wrapped innerHTML on a div, then move the unwrapped nodes into the - // target position. - - function domChanges(document, DOMChangesClass) { - if (!document) return DOMChangesClass; - if (!shouldApplyFix(document)) { - return DOMChangesClass; - } - var div = document.createElement('div'); - return (function (_DOMChangesClass) { - babelHelpers.inherits(DOMChangesWithInnerHTMLFix, _DOMChangesClass); - - function DOMChangesWithInnerHTMLFix() { - _DOMChangesClass.apply(this, arguments); - } - - DOMChangesWithInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent, nextSibling, html) { - if (html === null || html === '') { - return _DOMChangesClass.prototype.insertHTMLBefore.call(this, parent, nextSibling, html); - } - var parentTag = parent.tagName.toLowerCase(); - var wrapper = innerHTMLWrapper[parentTag]; - if (wrapper === undefined) { - return _DOMChangesClass.prototype.insertHTMLBefore.call(this, parent, nextSibling, html); - } - return fixInnerHTML(parent, wrapper, div, html, nextSibling); - }; - - return DOMChangesWithInnerHTMLFix; - })(DOMChangesClass); - } + return route && route.currentModel; + }, - function treeConstruction(document, DOMTreeConstructionClass) { - if (!document) return DOMTreeConstructionClass; - if (!shouldApplyFix(document)) { - return DOMTreeConstructionClass; + /** + A hook you can use to render the template for the current route. + This method is called with the controller for the current route and the + model supplied by the `model` hook. By default, it renders the route's + template, configured with the controller for the route. + This method can be overridden to set up and render additional or + alternative templates. + ```app/routes/posts.js + import Ember from 'ember'; + export default Ember.Route.extend({ + renderTemplate(controller, model) { + let favController = this.controllerFor('favoritePost'); + // Render the `favoritePost` template into + // the outlet `posts`, and display the `favoritePost` + // controller. + this.render('favoritePost', { + outlet: 'posts', + controller: favController + }); } - var div = document.createElement('div'); - return (function (_DOMTreeConstructionClass) { - babelHelpers.inherits(DOMTreeConstructionWithInnerHTMLFix, _DOMTreeConstructionClass); - - function DOMTreeConstructionWithInnerHTMLFix() { - _DOMTreeConstructionClass.apply(this, arguments); - } - - DOMTreeConstructionWithInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent, html, reference) { - if (html === null || html === '') { - return _DOMTreeConstructionClass.prototype.insertHTMLBefore.call(this, parent, html, reference); - } - var parentTag = parent.tagName.toLowerCase(); - var wrapper = innerHTMLWrapper[parentTag]; - if (wrapper === undefined) { - return _DOMTreeConstructionClass.prototype.insertHTMLBefore.call(this, parent, html, reference); - } - return fixInnerHTML(parent, wrapper, div, html, reference); - }; - - return DOMTreeConstructionWithInnerHTMLFix; - })(DOMTreeConstructionClass); - } + }); + ``` + @method renderTemplate + @param {Object} controller the route's controller + @param {Object} model the route's model + @since 1.0.0 + @public + */ + renderTemplate: function (controller, model) { + this.render(); + }, - function fixInnerHTML(parent, wrapper, div, html, reference) { - var wrappedHtml = wrapper.before + html + wrapper.after; - div.innerHTML = wrappedHtml; - var parentNode = div; - for (var i = 0; i < wrapper.depth; i++) { - parentNode = parentNode.childNodes[0]; + /** + `render` is used to render a template into a region of another template + (indicated by an `{{outlet}}`). `render` is used both during the entry + phase of routing (via the `renderTemplate` hook) and later in response to + user interaction. + For example, given the following minimal router and templates: + ```app/router.js + // ... + Router.map(function() { + this.route('photos'); + }); + export default Router; + ``` + ```handlebars + +
    + {{outlet "anOutletName"}} +
    + ``` + ```handlebars + +

    Photos

    + ``` + You can render `photos.hbs` into the `"anOutletName"` outlet of + `application.hbs` by calling `render`: + ```app/routes/post.js + import Ember from 'ember'; + export default Ember.Route.extend({ + renderTemplate() { + this.render('photos', { + into: 'application', + outlet: 'anOutletName' + }) } - - var _moveNodesBefore = _glimmerRuntimeLibDomHelper.moveNodesBefore(parentNode, parent, reference); - - var first = _moveNodesBefore[0]; - var last = _moveNodesBefore[1]; - - return new _glimmerRuntimeLibBounds.ConcreteBounds(parent, first, last); - } - function shouldApplyFix(document) { - var table = document.createElement('table'); - try { - table.innerHTML = ''; - } catch (e) {} finally { - if (table.childNodes.length !== 0) { - // It worked as expected, no fix required - return false; - } + }); + ``` + `render` additionally allows you to supply which `controller` and + `model` objects should be loaded and associated with the rendered template. + ```app/routes/posts.js + import Ember from 'ember'; + export default Ember.Route.extend({ + renderTemplate(controller, model){ + this.render('posts', { // the template to render, referenced by name + into: 'application', // the template to render into, referenced by name + outlet: 'anOutletName', // the outlet inside `options.template` to render into. + controller: 'someControllerName', // the controller to use for this template, referenced by name + model: model // the model to set on `options.controller`. + }) } - return true; - } -}); - -enifed('glimmer-runtime/lib/compat/svg-inner-html-fix', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/dom/helper'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibDomHelper) { - 'use strict'; + }); + ``` + The string values provided for the template name, and controller + will eventually pass through to the resolver for lookup. See + Ember.Resolver for how these are mapped to JavaScript objects in your + application. The template to render into needs to be related to either the + current route or one of its ancestors. + Not all options need to be passed to `render`. Default values will be used + based on the name of the route specified in the router or the Route's + `controllerName` and `templateName` properties. + For example: + ```app/router.js + // ... + Router.map(function() { + this.route('index'); + this.route('post', { path: '/posts/:post_id' }); + }); + export default Router; + ``` + ```app/routes/post.js + import Ember from 'ember'; + export default Ember.Route.extend({ + renderTemplate() { + this.render(); // all defaults apply + } + }); + ``` + The name of the route, defined by the router, is `post`. + The following equivalent default options will be applied when + the Route calls `render`: + ```javascript + this.render('post', { // the template name associated with 'post' Route + into: 'application', // the parent route to 'post' Route + outlet: 'main', // {{outlet}} and {{outlet 'main'}} are synonymous, + controller: 'post', // the controller associated with the 'post' Route + }) + ``` + By default the controller's `model` will be the route's model, so it does not + need to be passed unless you wish to change which model is being used. + @method render + @param {String} name the name of the template to render + @param {Object} [options] the options + @param {String} [options.into] the template to render into, + referenced by name. Defaults to the parent template + @param {String} [options.outlet] the outlet inside `options.template` to render into. + Defaults to 'main' + @param {String|Object} [options.controller] the controller to use for this template, + referenced by name or as a controller instance. Defaults to the Route's paired controller + @param {Object} [options.model] the model object to set on `options.controller`. + Defaults to the return value of the Route's model hook + @since 1.0.0 + @public + */ + render: function (_name, options) { - exports.domChanges = domChanges; - exports.treeConstruction = treeConstruction; - - var SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; - // Patch: insertAdjacentHTML on SVG Fix - // Browsers: Safari, IE, Edge, Firefox ~33-34 - // Reason: insertAdjacentHTML does not exist on SVG elements in Safari. It is - // present but throws an exception on IE and Edge. Old versions of - // Firefox create nodes in the incorrect namespace. - // Fix: Since IE and Edge silently fail to create SVG nodes using - // innerHTML, and because Firefox may create nodes in the incorrect - // namespace using innerHTML on SVG elements, an HTML-string wrapping - // approach is used. A pre/post SVG tag is added to the string, then - // that whole string is added to a div. The created nodes are plucked - // out and applied to the target location on DOM. - - function domChanges(document, DOMChangesClass, svgNamespace) { - if (!document) return DOMChangesClass; - if (!shouldApplyFix(document, svgNamespace)) { - return DOMChangesClass; - } - var div = document.createElement('div'); - return (function (_DOMChangesClass) { - babelHelpers.inherits(DOMChangesWithSVGInnerHTMLFix, _DOMChangesClass); - - function DOMChangesWithSVGInnerHTMLFix() { - _DOMChangesClass.apply(this, arguments); - } + var namePassed = typeof _name === 'string' && !!_name; + var isDefaultRender = arguments.length === 0 || _emberMetal.isEmpty(arguments[0]); + var name = undefined; - DOMChangesWithSVGInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent, nextSibling, html) { - if (html === null || html === '') { - return _DOMChangesClass.prototype.insertHTMLBefore.call(this, parent, nextSibling, html); - } - if (parent.namespaceURI !== svgNamespace) { - return _DOMChangesClass.prototype.insertHTMLBefore.call(this, parent, nextSibling, html); - } - return fixSVG(parent, div, html, nextSibling); - }; + if (typeof _name === 'object' && !options) { + name = this.templateName || this.routeName; + options = _name; + } else { + name = _name; + } - return DOMChangesWithSVGInnerHTMLFix; - })(DOMChangesClass); - } + var renderOptions = buildRenderOptions(this, namePassed, isDefaultRender, name, options); + this.connections.push(renderOptions); + _emberMetal.run.once(this.router, '_setOutlets'); + }, - function treeConstruction(document, TreeConstructionClass, svgNamespace) { - if (!document) return TreeConstructionClass; - if (!shouldApplyFix(document, svgNamespace)) { - return TreeConstructionClass; + /** + Disconnects a view that has been rendered into an outlet. + You may pass any or all of the following options to `disconnectOutlet`: + * `outlet`: the name of the outlet to clear (default: 'main') + * `parentView`: the name of the view containing the outlet to clear + (default: the view rendered by the parent route) + Example: + ```app/routes/application.js + import Ember from 'ember'; + export default App.Route.extend({ + actions: { + showModal(evt) { + this.render(evt.modalName, { + outlet: 'modal', + into: 'application' + }); + }, + hideModal(evt) { + this.disconnectOutlet({ + outlet: 'modal', + parentView: 'application' + }); + } } - var div = document.createElement('div'); - return (function (_TreeConstructionClass) { - babelHelpers.inherits(TreeConstructionWithSVGInnerHTMLFix, _TreeConstructionClass); - - function TreeConstructionWithSVGInnerHTMLFix() { - _TreeConstructionClass.apply(this, arguments); - } - - TreeConstructionWithSVGInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent, html, reference) { - if (html === null || html === '') { - return _TreeConstructionClass.prototype.insertHTMLBefore.call(this, parent, html, reference); - } - if (parent.namespaceURI !== svgNamespace) { - return _TreeConstructionClass.prototype.insertHTMLBefore.call(this, parent, html, reference); - } - return fixSVG(parent, div, html, reference); - }; - - return TreeConstructionWithSVGInnerHTMLFix; - })(TreeConstructionClass); - } + }); + ``` + Alternatively, you can pass the `outlet` name directly as a string. + Example: + ```app/routes/application.js + import Ember from 'ember'; + export default App.Route.extend({ + actions: { + showModal(evt) { + // ... + }, + hideModal(evt) { + this.disconnectOutlet('modal'); + } + } + }); + @method disconnectOutlet + @param {Object|String} options the options hash or outlet name + @since 1.0.0 + @public + */ + disconnectOutlet: function (options) { + var outletName = undefined; + var parentView = undefined; + if (!options || typeof options === 'string') { + outletName = options; + } else { + outletName = options.outlet; + parentView = options.parentView; - function fixSVG(parent, div, html, reference) { - // IE, Edge: also do not correctly support using `innerHTML` on SVG - // namespaced elements. So here a wrapper is used. - var wrappedHtml = '' + html + ''; - div.innerHTML = wrappedHtml; + if (options && Object.keys(options).indexOf('outlet') !== -1 && typeof options.outlet === 'undefined') { + throw new _emberMetal.Error('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++) { + // This non-local state munging is sadly necessary to maintain + // backward compatibility with our existing semantics, which allow + // any route to disconnectOutlet things originally rendered by any + // other route. This should all get cut in 2.0. + this.router.router.currentHandlerInfos[i].handler._disconnectOutlet(outletName, parentView); + } + }, - var _moveNodesBefore = _glimmerRuntimeLibDomHelper.moveNodesBefore(div.firstChild, parent, reference); + _disconnectOutlet: function (outletName, parentView) { + var parent = parentRoute(this); + if (parent && parentView === parent.routeName) { + parentView = undefined; + } + for (var i = 0; i < this.connections.length; i++) { + var connection = this.connections[i]; + if (connection.outlet === outletName && connection.into === parentView) { + // This neuters the disconnected outlet such that it doesn't + // render anything, but it leaves an entry in the outlet + // 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, + controller: undefined, + template: undefined, + ViewClass: undefined + }; + _emberMetal.run.once(this.router, '_setOutlets'); + } + } + }, - var first = _moveNodesBefore[0]; - var last = _moveNodesBefore[1]; + willDestroy: function () { + this.teardownViews(); + }, - return new _glimmerRuntimeLibBounds.ConcreteBounds(parent, first, last); - } - function shouldApplyFix(document, svgNamespace) { - var svg = document.createElementNS(svgNamespace, 'svg'); - try { - svg['insertAdjacentHTML']('beforeEnd', ''); - } catch (e) {} finally { - // FF: Old versions will create a node in the wrong namespace - if (svg.childNodes.length === 1 && svg.firstChild.namespaceURI === SVG_NAMESPACE) { - // The test worked as expected, no fix required - return false; - } - svg = null; - return true; - } + /** + @private + @method teardownViews + */ + teardownViews: function () { + if (this.connections && this.connections.length > 0) { + this.connections = []; + _emberMetal.run.once(this.router, '_setOutlets'); + } } -}); + }); -enifed('glimmer-runtime/lib/compat/text-node-merging-fix', ['exports'], function (exports) { - // Patch: Adjacent text node merging fix - // Browsers: IE, Edge, Firefox w/o inspector open - // Reason: These browsers will merge adjacent text nodes. For exmaple given - //
    Hello
    with div.insertAdjacentHTML(' world') browsers - // with proper behavior will populate div.childNodes with two items. - // These browsers will populate it with one merged node instead. - // Fix: Add these nodes to a wrapper element, then iterate the childNodes - // of that wrapper and move the nodes to their target location. Note - // that potential SVG bugs will have been handled before this fix. - // Note that this fix must only apply to the previous text node, as - // the base implementation of `insertHTMLBefore` already handles - // following text nodes correctly. - 'use strict'; + _emberRuntime.deprecateUnderscoreActions(Route); - exports.domChanges = domChanges; - exports.treeConstruction = treeConstruction; + Route.reopenClass({ + isRouteFactory: true + }); - function domChanges(document, DOMChangesClass) { - if (!document) return DOMChangesClass; - if (!shouldApplyFix(document)) { - return DOMChangesClass; - } - return (function (_DOMChangesClass) { - babelHelpers.inherits(DOMChangesWithTextNodeMergingFix, _DOMChangesClass); + function parentRoute(route) { + var handlerInfo = handlerInfoFor(route, route.router.router.state.handlerInfos, -1); + return handlerInfo && handlerInfo.handler; + } - function DOMChangesWithTextNodeMergingFix(document) { - _DOMChangesClass.call(this, document); - this.uselessComment = document.createComment(''); - } + function handlerInfoFor(route, handlerInfos) { + var offset = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2]; - DOMChangesWithTextNodeMergingFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent, nextSibling, html) { - if (html === null) { - return _DOMChangesClass.prototype.insertHTMLBefore.call(this, parent, nextSibling, html); - } - var didSetUselessComment = false; - var nextPrevious = nextSibling ? nextSibling.previousSibling : parent.lastChild; - if (nextPrevious && nextPrevious instanceof Text) { - didSetUselessComment = true; - parent.insertBefore(this.uselessComment, nextSibling); - } - var bounds = _DOMChangesClass.prototype.insertHTMLBefore.call(this, parent, nextSibling, html); - if (didSetUselessComment) { - parent.removeChild(this.uselessComment); - } - return bounds; - }; + if (!handlerInfos) { + return; + } - return DOMChangesWithTextNodeMergingFix; - })(DOMChangesClass); + var current = undefined; + for (var i = 0; i < handlerInfos.length; i++) { + current = handlerInfos[i].handler; + if (current === route) { + return handlerInfos[i + offset]; + } } + } - function treeConstruction(document, TreeConstructionClass) { - if (!document) return TreeConstructionClass; - if (!shouldApplyFix(document)) { - return TreeConstructionClass; - } - return (function (_TreeConstructionClass) { - babelHelpers.inherits(TreeConstructionWithTextNodeMergingFix, _TreeConstructionClass); + function buildRenderOptions(route, namePassed, isDefaultRender, _name, options) { + var into = options && options.into && options.into.replace(/\//g, '.'); + var outlet = options && options.outlet || 'main'; - function TreeConstructionWithTextNodeMergingFix(document) { - _TreeConstructionClass.call(this, document); - this.uselessComment = this.createComment(''); - } + var name = undefined, + templateName = undefined; + if (_name) { + name = _name.replace(/\//g, '.'); + templateName = name; + } else { + name = route.routeName; + templateName = route.templateName || name; + } - TreeConstructionWithTextNodeMergingFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent, html, reference) { - if (html === null) { - return _TreeConstructionClass.prototype.insertHTMLBefore.call(this, parent, html, reference); - } - var didSetUselessComment = false; - var nextPrevious = reference ? reference.previousSibling : parent.lastChild; - if (nextPrevious && nextPrevious instanceof Text) { - didSetUselessComment = true; - parent.insertBefore(this.uselessComment, reference); - } - var bounds = _TreeConstructionClass.prototype.insertHTMLBefore.call(this, parent, html, reference); - if (didSetUselessComment) { - parent.removeChild(this.uselessComment); - } - return bounds; - }; + var owner = _emberUtils.getOwner(route); + var controller = options && options.controller; + if (!controller) { + if (namePassed) { + controller = owner.lookup('controller:' + name) || route.controllerName || route.routeName; + } else { + controller = route.controllerName || owner.lookup('controller:' + name); + } + } - return TreeConstructionWithTextNodeMergingFix; - })(TreeConstructionClass); + if (typeof controller === 'string') { + var controllerName = controller; + controller = owner.lookup('controller:' + controllerName); + if (!controller) { + throw new _emberMetal.Error('You passed `controller: \'' + controllerName + '\'` into the `render` method, but no such controller could be found.'); + } } - function shouldApplyFix(document) { - var mergingTextDiv = document.createElement('div'); - mergingTextDiv.innerHTML = 'first'; - mergingTextDiv.insertAdjacentHTML('beforeEnd', 'second'); - if (mergingTextDiv.childNodes.length === 2) { - mergingTextDiv = null; - // It worked as expected, no fix required - return false; - } - mergingTextDiv = null; - return true; + if (options && Object.keys(options).indexOf('outlet') !== -1 && typeof options.outlet === 'undefined') { + throw new _emberMetal.Error('You passed undefined as the outlet name.'); } -}); -enifed('glimmer-runtime/lib/compiled/blocks', ['exports', 'glimmer-runtime/lib/utils', 'glimmer-runtime/lib/compiler'], function (exports, _glimmerRuntimeLibUtils, _glimmerRuntimeLibCompiler) { - 'use strict'; + if (options && options.model) { + controller.set('model', options.model); + } - var CompiledBlock = function CompiledBlock(ops, symbols) { - this.ops = ops; - this.symbols = symbols; - }; + var template = owner.lookup('template:' + templateName); - exports.CompiledBlock = CompiledBlock; + var parent = undefined; + if (into && (parent = parentRoute(route)) && into === parent.routeName) { + into = undefined; + } - var Block = function Block(program, symbolTable) { - this.program = program; - this.symbolTable = symbolTable; - this.compiled = null; + var renderOptions = { + owner: owner, + into: into, + outlet: outlet, + name: name, + controller: controller, + template: template || route._topLevelViewTemplate, + ViewClass: undefined }; - exports.Block = Block; - - var InlineBlock = (function (_Block) { - babelHelpers.inherits(InlineBlock, _Block); - - function InlineBlock(program, symbolTable) { - var locals = arguments.length <= 2 || arguments[2] === undefined ? _glimmerRuntimeLibUtils.EMPTY_ARRAY : arguments[2]; - - _Block.call(this, program, symbolTable); - this.locals = locals; - } - - InlineBlock.prototype.hasPositionalParameters = function hasPositionalParameters() { - return !!this.locals.length; - }; + return renderOptions; + } - InlineBlock.prototype.compile = function compile(env) { - var compiled = this.compiled; - if (compiled) return compiled; - var ops = new _glimmerRuntimeLibCompiler.InlineBlockCompiler(this, env).compile(); - return this.compiled = new CompiledBlock(ops, this.symbolTable.size); - }; + function getFullQueryParams(router, state) { + if (state.fullQueryParams) { + return state.fullQueryParams; + } - return InlineBlock; - })(Block); + state.fullQueryParams = {}; + _emberUtils.assign(state.fullQueryParams, state.queryParams); - exports.InlineBlock = InlineBlock; + router._deserializeQueryParams(state.handlerInfos, state.fullQueryParams); + return state.fullQueryParams; + } - var PartialBlock = (function (_InlineBlock) { - babelHelpers.inherits(PartialBlock, _InlineBlock); + function getQueryParamsFor(route, state) { + state.queryParamsFor = state.queryParamsFor || {}; + var name = route.fullRouteName; - function PartialBlock() { - _InlineBlock.apply(this, arguments); - } + if (state.queryParamsFor[name]) { + return state.queryParamsFor[name]; + } - return PartialBlock; - })(InlineBlock); + var fullQueryParams = getFullQueryParams(route.router, state); - exports.PartialBlock = PartialBlock; + var params = state.queryParamsFor[name] = {}; - var TopLevelTemplate = (function (_Block2) { - babelHelpers.inherits(TopLevelTemplate, _Block2); + // Copy over all the query params for this route/controller into params hash. + var qpMeta = _emberMetal.get(route, '_qp'); + var qps = qpMeta.qps; + for (var i = 0; i < qps.length; ++i) { + // Put deserialized qp on params hash. + var qp = qps[i]; - function TopLevelTemplate() { - _Block2.apply(this, arguments); - } + var qpValueWasPassedIn = (qp.prop in fullQueryParams); + params[qp.prop] = qpValueWasPassedIn ? fullQueryParams[qp.prop] : copyDefaultValue(qp.defaultValue); + } - return TopLevelTemplate; - })(Block); + return params; + } - exports.TopLevelTemplate = TopLevelTemplate; + function copyDefaultValue(value) { + if (Array.isArray(value)) { + return _emberRuntime.A(value.slice()); + } + return value; + } - var EntryPoint = (function (_TopLevelTemplate) { - babelHelpers.inherits(EntryPoint, _TopLevelTemplate); + /* + Merges all query parameters from a controller with those from + a route, returning a new object and avoiding any mutations to + the existing objects. + */ + function mergeEachQueryParams(controllerQP, routeQP) { + var keysAlreadyMergedOrSkippable = undefined; + var qps = {}; - function EntryPoint() { - _TopLevelTemplate.apply(this, arguments); - } + keysAlreadyMergedOrSkippable = { + defaultValue: true, + type: true, + scope: true, + as: true + }; - EntryPoint.prototype.compile = function compile(env) { - var compiled = this.compiled; - if (compiled) return compiled; - var ops = new _glimmerRuntimeLibCompiler.EntryPointCompiler(this, env).compile(); - return this.compiled = new CompiledBlock(ops, this.symbolTable.size); - }; + // 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)) { + continue; + } - return EntryPoint; - })(TopLevelTemplate); + var newControllerParameterConfiguration = {}; + _emberUtils.assign(newControllerParameterConfiguration, controllerQP[cqpName]); + _emberUtils.assign(newControllerParameterConfiguration, routeQP[cqpName]); - exports.EntryPoint = EntryPoint; + qps[cqpName] = newControllerParameterConfiguration; - var Layout = (function (_TopLevelTemplate2) { - babelHelpers.inherits(Layout, _TopLevelTemplate2); + // allows us to skip this QP when we check route QPs. + keysAlreadyMergedOrSkippable[cqpName] = true; + } - function Layout(program, symbolTable, named, yields, hasPartials) { - _TopLevelTemplate2.call(this, program, symbolTable); - this.named = named; - this.yields = yields; - this.hasPartials = hasPartials; - this.hasNamedParameters = !!this.named.length; - this.hasYields = !!this.yields.length; - ; - } + // loop over all route qps, skipping those that were merged in the first pass + // because they also appear in controller qps + for (var rqpName in routeQP) { + if (!routeQP.hasOwnProperty(rqpName) || keysAlreadyMergedOrSkippable[rqpName]) { + continue; + } - return Layout; - })(TopLevelTemplate); + var newRouteParameterConfiguration = {}; + _emberUtils.assign(newRouteParameterConfiguration, routeQP[rqpName], controllerQP[rqpName]); + qps[rqpName] = newRouteParameterConfiguration; + } - exports.Layout = Layout; -}); + return qps; + } -enifed("glimmer-runtime/lib/compiled/expressions", ["exports"], function (exports) { - "use strict"; + function addQueryParamsObservers(controller, propNames) { + propNames.forEach(function (prop) { + controller.addObserver(prop + '.[]', controller, controller._qpChanged); + }); + } - var CompiledExpression = (function () { - function CompiledExpression() {} + function getEngineRouteName(engine, routeName) { + if (engine.routable) { + var prefix = engine.mountPoint; - CompiledExpression.prototype.toJSON = function toJSON() { - return "UNIMPL: " + this.type.toUpperCase(); - }; + if (routeName === 'application') { + return prefix; + } else { + return prefix + '.' + routeName; + } + } - return CompiledExpression; - })(); + return routeName; + } - exports.CompiledExpression = CompiledExpression; + exports.default = Route; }); +enifed('ember-routing/system/router', ['exports', 'ember-utils', 'ember-console', 'ember-metal', 'ember-runtime', 'ember-routing/system/route', 'ember-routing/system/dsl', 'ember-routing/location/api', 'ember-routing/utils', 'ember-routing/system/router_state', 'container', 'router'], function (exports, _emberUtils, _emberConsole, _emberMetal, _emberRuntime, _emberRoutingSystemRoute, _emberRoutingSystemDsl, _emberRoutingLocationApi, _emberRoutingUtils, _emberRoutingSystemRouter_state, _container, _router5) { + 'use strict'; -enifed('glimmer-runtime/lib/compiled/expressions/args', ['exports', 'glimmer-runtime/lib/compiled/expressions/positional-args', 'glimmer-runtime/lib/compiled/expressions/named-args', 'glimmer-runtime/lib/syntax/core', 'glimmer-reference'], function (exports, _glimmerRuntimeLibCompiledExpressionsPositionalArgs, _glimmerRuntimeLibCompiledExpressionsNamedArgs, _glimmerRuntimeLibSyntaxCore, _glimmerReference) { - 'use strict'; - - var CompiledArgs = (function () { - function CompiledArgs(positional, named, blocks) { - this.positional = positional; - this.named = named; - this.blocks = blocks; - } + exports.triggerEvent = triggerEvent; - CompiledArgs.create = function create(positional, named, blocks) { - if (positional === _glimmerRuntimeLibCompiledExpressionsPositionalArgs.COMPILED_EMPTY_POSITIONAL_ARGS && named === _glimmerRuntimeLibCompiledExpressionsNamedArgs.COMPILED_EMPTY_NAMED_ARGS && blocks === _glimmerRuntimeLibSyntaxCore.EMPTY_BLOCKS) { - return this.empty(); - } else { - return new this(positional, named, blocks); - } - }; + function K() { + return this; + } - CompiledArgs.empty = function empty() { - return COMPILED_EMPTY_ARGS; - }; + var slice = Array.prototype.slice; - CompiledArgs.prototype.evaluate = function evaluate(vm) { - var positional = this.positional; - var named = this.named; - var blocks = this.blocks; + /** + The `Ember.Router` class manages the application state and URLs. Refer to + the [routing guide](http://emberjs.com/guides/routing/) for documentation. + + @class Router + @namespace Ember + @extends Ember.Object + @uses Ember.Evented + @public + */ + var EmberRouter = _emberRuntime.Object.extend(_emberRuntime.Evented, { + /** + The `location` property determines the type of URL's that your + application will use. + The following location types are currently available: + * `history` - use the browser's history API to make the URLs look just like any standard URL + * `hash` - use `#` to separate the server part of the URL from the Ember part: `/blog/#/posts/new` + * `none` - do not store the Ember URL in the actual browser URL (mainly used for testing) + * `auto` - use the best option based on browser capabilites: `history` if possible, then `hash` if possible, otherwise `none` + Note: If using ember-cli, this value is defaulted to `auto` by the `locationType` setting of `/config/environment.js` + @property location + @default 'hash' + @see {Ember.Location} + @public + */ + location: 'hash', - return EvaluatedArgs.create(positional.evaluate(vm), named.evaluate(vm), blocks); - }; + /** + Represents the URL of the root of the application, often '/'. This prefix is + assumed on all routes defined on this router. + @property rootURL + @default '/' + @public + */ + rootURL: '/', - return CompiledArgs; - })(); + _initRouterJs: function () { + var router = this.router = new _router5.default(); + router.triggerEvent = triggerEvent; - exports.CompiledArgs = CompiledArgs; + router._triggerWillChangeContext = K; + router._triggerWillLeave = K; - var COMPILED_EMPTY_ARGS = new ((function (_CompiledArgs) { - babelHelpers.inherits(_class, _CompiledArgs); + var dslCallbacks = this.constructor.dslCallbacks || [K]; + var dsl = this._buildDSL(); - function _class() { - _CompiledArgs.call(this, _glimmerRuntimeLibCompiledExpressionsPositionalArgs.COMPILED_EMPTY_POSITIONAL_ARGS, _glimmerRuntimeLibCompiledExpressionsNamedArgs.COMPILED_EMPTY_NAMED_ARGS, _glimmerRuntimeLibSyntaxCore.EMPTY_BLOCKS); + dsl.route('application', { path: '/', resetNamespace: true, overrideNameAssertion: true }, function () { + for (var i = 0; i < dslCallbacks.length; i++) { + dslCallbacks[i].call(this); } + }); - _class.prototype.evaluate = function evaluate(vm) { - return EMPTY_EVALUATED_ARGS; - }; - - return _class; - })(CompiledArgs))(); - - var EvaluatedArgs = (function () { - function EvaluatedArgs(positional, named, blocks) { - this.positional = positional; - this.named = named; - this.blocks = blocks; - this.tag = _glimmerReference.combineTagged([positional, named]); - } + router.map(dsl.generate()); + }, - EvaluatedArgs.empty = function empty() { - return EMPTY_EVALUATED_ARGS; - }; + _buildDSL: function () { + var moduleBasedResolver = this._hasModuleBasedResolver(); + var options = { + enableLoadingSubstates: !!moduleBasedResolver + }; - EvaluatedArgs.create = function create(positional, named, blocks) { - return new this(positional, named, blocks); - }; + var owner = _emberUtils.getOwner(this); + var router = this; - EvaluatedArgs.positional = function positional(values) { - var blocks = arguments.length <= 1 || arguments[1] === undefined ? _glimmerRuntimeLibSyntaxCore.EMPTY_BLOCKS : arguments[1]; + options.resolveRouteMap = function (name) { + return owner[_container.FACTORY_FOR]('route-map:' + name); + }; - return new this(_glimmerRuntimeLibCompiledExpressionsPositionalArgs.EvaluatedPositionalArgs.create(values), _glimmerRuntimeLibCompiledExpressionsNamedArgs.EVALUATED_EMPTY_NAMED_ARGS, blocks); - }; + options.addRouteForEngine = function (name, engineInfo) { + if (!router._engineInfoByRoute[name]) { + router._engineInfoByRoute[name] = engineInfo; + } + }; - EvaluatedArgs.named = function named(map) { - var blocks = arguments.length <= 1 || arguments[1] === undefined ? _glimmerRuntimeLibSyntaxCore.EMPTY_BLOCKS : arguments[1]; + return new _emberRoutingSystemDsl.default(null, options); + }, - return new this(_glimmerRuntimeLibCompiledExpressionsPositionalArgs.EVALUATED_EMPTY_POSITIONAL_ARGS, _glimmerRuntimeLibCompiledExpressionsNamedArgs.EvaluatedNamedArgs.create(map), blocks); - }; + init: function () { + this._super.apply(this, arguments); - return EvaluatedArgs; - })(); + this.currentURL = null; + this.currentRouteName = null; + this.currentPath = null; - exports.EvaluatedArgs = EvaluatedArgs; + this._qpCache = new _emberUtils.EmptyObject(); + this._resetQueuedQueryParameterChanges(); + this._handledErrors = _emberUtils.dictionary(null); + this._engineInstances = new _emberUtils.EmptyObject(); + this._engineInfoByRoute = new _emberUtils.EmptyObject(); + }, - var EMPTY_EVALUATED_ARGS = new EvaluatedArgs(_glimmerRuntimeLibCompiledExpressionsPositionalArgs.EVALUATED_EMPTY_POSITIONAL_ARGS, _glimmerRuntimeLibCompiledExpressionsNamedArgs.EVALUATED_EMPTY_NAMED_ARGS, _glimmerRuntimeLibSyntaxCore.EMPTY_BLOCKS); - exports.CompiledPositionalArgs = _glimmerRuntimeLibCompiledExpressionsPositionalArgs.CompiledPositionalArgs; - exports.EvaluatedPositionalArgs = _glimmerRuntimeLibCompiledExpressionsPositionalArgs.EvaluatedPositionalArgs; - exports.CompiledNamedArgs = _glimmerRuntimeLibCompiledExpressionsNamedArgs.CompiledNamedArgs; - exports.EvaluatedNamedArgs = _glimmerRuntimeLibCompiledExpressionsNamedArgs.EvaluatedNamedArgs; -}); + /* + Resets all pending query paramter changes. + Called after transitioning to a new route + based on query parameter changes. + */ + _resetQueuedQueryParameterChanges: function () { + this._queuedQPChanges = {}; + }, -enifed("glimmer-runtime/lib/compiled/expressions/concat", ["exports", "glimmer-reference"], function (exports, _glimmerReference) { - "use strict"; + /** + Represents the current URL. + @method url + @return {String} The current URL. + @private + */ + url: _emberMetal.computed(function () { + return _emberMetal.get(this, 'location').getURL(); + }), - var CompiledConcat = (function () { - function CompiledConcat(parts) { - this.parts = parts; - this.type = "concat"; - } + _hasModuleBasedResolver: function () { + var owner = _emberUtils.getOwner(this); - CompiledConcat.prototype.evaluate = function evaluate(vm) { - var parts = new Array(this.parts.length); - for (var i = 0; i < this.parts.length; i++) { - parts[i] = this.parts[i].evaluate(vm); - } - return new ConcatReference(parts); - }; + if (!owner) { + return false; + } - CompiledConcat.prototype.toJSON = function toJSON() { - return "concat(" + this.parts.map(function (expr) { - return expr.toJSON(); - }).join(", ") + ")"; - }; + var resolver = owner.application && owner.application.__registry__ && owner.application.__registry__.resolver; - return CompiledConcat; - })(); + if (!resolver) { + return false; + } - exports.default = CompiledConcat; + return !!resolver.moduleBasedResolver; + }, - var ConcatReference = (function (_CachedReference) { - babelHelpers.inherits(ConcatReference, _CachedReference); + /** + Initializes the current router instance and sets up the change handling + event listeners used by the instances `location` implementation. + A property named `initialURL` will be used to determine the initial URL. + If no value is found `/` will be used. + @method startRouting + @private + */ + startRouting: function () { + var initialURL = _emberMetal.get(this, 'initialURL'); - function ConcatReference(parts) { - _CachedReference.call(this); - this.parts = parts; - this.tag = _glimmerReference.combineTagged(parts); + if (this.setupRouter()) { + if (typeof initialURL === 'undefined') { + initialURL = _emberMetal.get(this, 'location').getURL(); } - - ConcatReference.prototype.compute = function compute() { - var parts = new Array(); - for (var i = 0; i < this.parts.length; i++) { - var value = this.parts[i].value(); - if (value !== null && value !== undefined) { - parts[i] = castToString(this.parts[i].value()); - } - } - if (parts.length > 0) { - return parts.join(''); - } - return null; - }; - - return ConcatReference; - })(_glimmerReference.CachedReference); - - function castToString(value) { - if (typeof value['toString'] !== 'function') { - return ''; + var initialTransition = this.handleURL(initialURL); + if (initialTransition && initialTransition.error) { + throw initialTransition.error; } - return String(value); - } -}); - -enifed('glimmer-runtime/lib/compiled/expressions/function', ['exports', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/compiled/expressions'], function (exports, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibCompiledExpressions) { - 'use strict'; + } + }, - exports.default = make; + setupRouter: function () { + var _this = this; - function make(func) { - return new FunctionExpressionSyntax(func); - } + this._initRouterJs(); + this._setupLocation(); - var FunctionExpressionSyntax = (function (_ExpressionSyntax) { - babelHelpers.inherits(FunctionExpressionSyntax, _ExpressionSyntax); + var router = this.router; + var location = _emberMetal.get(this, 'location'); - function FunctionExpressionSyntax(func) { - _ExpressionSyntax.call(this); - this.type = "function-expression"; - this.func = func; - } + // Allow the Location class to cancel the router setup while it refreshes + // the page + if (_emberMetal.get(location, 'cancelRouterSetup')) { + return false; + } - FunctionExpressionSyntax.prototype.compile = function compile(lookup, env, symbolTable) { - return new CompiledFunctionExpression(this.func, symbolTable); - }; + this._setupRouter(router, location); - return FunctionExpressionSyntax; - })(_glimmerRuntimeLibSyntax.Expression); + location.onUpdateURL(function (url) { + _this.handleURL(url); + }); - var CompiledFunctionExpression = (function (_CompiledExpression) { - babelHelpers.inherits(CompiledFunctionExpression, _CompiledExpression); + return true; + }, - function CompiledFunctionExpression(func, symbolTable) { - _CompiledExpression.call(this); - this.func = func; - this.symbolTable = symbolTable; - this.type = "function"; - this.func = func; + /** + Handles updating the paths and notifying any listeners of the URL + change. + Triggers the router level `didTransition` hook. + For example, to notify google analytics when the route changes, + you could use this hook. (Note: requires also including GA scripts, etc.) + ```javascript + let Router = Ember.Router.extend({ + location: config.locationType, + didTransition: function() { + this._super(...arguments); + return ga('send', 'pageview', { + 'page': this.get('url'), + 'title': this.get('url') + }); } + }); + ``` + @method didTransition + @public + @since 1.2.0 + */ + didTransition: function (infos) { + updatePaths(this); - CompiledFunctionExpression.prototype.evaluate = function evaluate(vm) { - var func = this.func; - var symbolTable = this.symbolTable; - - return func(vm, symbolTable); - }; + this._cancelSlowTransitionTimer(); - CompiledFunctionExpression.prototype.toJSON = function toJSON() { - var func = this.func; + this.notifyPropertyChange('url'); + this.set('currentState', this.targetState); - if (func.name) { - return '`' + func.name + '(...)`'; - } else { - return "`func(...)`"; - } - }; + // Put this in the runloop so url will be accurate. Seems + // less surprising than didTransition being out of sync. + _emberMetal.run.once(this, this.trigger, 'didTransition'); + }, - return CompiledFunctionExpression; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); -}); + _setOutlets: function () { + // This is triggered async during Ember.Route#willDestroy. + // If the router is also being destroyed we do not want to + // to create another this._toplevelView (and leak the renderer) + if (this.isDestroying || this.isDestroyed) { + return; + } -enifed('glimmer-runtime/lib/compiled/expressions/has-block', ['exports', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-runtime/lib/references'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerRuntimeLibReferences) { - 'use strict'; + var handlerInfos = this.router.currentHandlerInfos; + var route = undefined; + var defaultParentState = undefined; + var liveRoutes = null; - var CompiledHasBlock = (function (_CompiledExpression) { - babelHelpers.inherits(CompiledHasBlock, _CompiledExpression); + if (!handlerInfos) { + return; + } - function CompiledHasBlock(inner) { - _CompiledExpression.call(this); - this.inner = inner; - this.type = "has-block"; + for (var i = 0; i < handlerInfos.length; i++) { + route = handlerInfos[i].handler; + var connections = route.connections; + var ownState = undefined; + for (var j = 0; j < connections.length; j++) { + var appended = appendLiveRoute(liveRoutes, defaultParentState, connections[j]); + liveRoutes = appended.liveRoutes; + if (appended.ownState.render.name === route.routeName || appended.ownState.render.outlet === 'main') { + ownState = appended.ownState; + } } - - CompiledHasBlock.prototype.evaluate = function evaluate(vm) { - var block = this.inner.evaluate(vm); - return _glimmerRuntimeLibReferences.PrimitiveReference.create(!!block); - }; - - CompiledHasBlock.prototype.toJSON = function toJSON() { - return 'has-block(' + this.inner.toJSON() + ')'; - }; - - return CompiledHasBlock; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); - - exports.default = CompiledHasBlock; - - var CompiledHasBlockParams = (function (_CompiledExpression2) { - babelHelpers.inherits(CompiledHasBlockParams, _CompiledExpression2); - - function CompiledHasBlockParams(inner) { - _CompiledExpression2.call(this); - this.inner = inner; - this.type = "has-block-params"; + if (connections.length === 0) { + ownState = representEmptyRoute(liveRoutes, defaultParentState, route); } + defaultParentState = ownState; + } - CompiledHasBlockParams.prototype.evaluate = function evaluate(vm) { - var block = this.inner.evaluate(vm); - return _glimmerRuntimeLibReferences.PrimitiveReference.create(!!(block && block.locals.length > 0)); - }; + // when a transitionTo happens after the validation phase + // during the initial transition _setOutlets is called + // when no routes are active. However, it will get called + // again with the correct values during the next turn of + // the runloop + if (!liveRoutes) { + return; + } - CompiledHasBlockParams.prototype.toJSON = function toJSON() { - return 'has-block-params(' + this.inner.toJSON() + ')'; - }; + if (!this._toplevelView) { + var owner = _emberUtils.getOwner(this); + var OutletView = owner[_container.FACTORY_FOR]('view:-outlet'); + this._toplevelView = OutletView.create(); + this._toplevelView.setOutletState(liveRoutes); + var instance = owner.lookup('-application-instance:main'); + instance.didCreateRootView(this._toplevelView); + } else { + this._toplevelView.setOutletState(liveRoutes); + } + }, - return CompiledHasBlockParams; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); + /** + Handles notifying any listeners of an impending URL + change. + Triggers the router level `willTransition` hook. + @method willTransition + @public + @since 1.11.0 + */ + willTransition: function (oldInfos, newInfos, transition) { + _emberMetal.run.once(this, this.trigger, 'willTransition', transition); + }, - exports.CompiledHasBlockParams = CompiledHasBlockParams; + handleURL: function (url) { + // Until we have an ember-idiomatic way of accessing #hashes, we need to + // remove it because router.js doesn't know how to handle it. + url = url.split(/#(.+)?/)[0]; + return this._doURLTransition('handleURL', url); + }, - var CompiledGetBlockBySymbol = (function () { - function CompiledGetBlockBySymbol(symbol, debug) { - this.symbol = symbol; - this.debug = debug; - } + _doURLTransition: function (routerJsMethod, url) { + var transition = this.router[routerJsMethod](url || '/'); + didBeginTransition(transition, this); + return transition; + }, - CompiledGetBlockBySymbol.prototype.evaluate = function evaluate(vm) { - return vm.scope().getBlock(this.symbol); - }; + /** + Transition the application into another route. The route may + be either a single route or route path: + See [Route.transitionTo](http://emberjs.com/api/classes/Ember.Route.html#method_transitionTo) for more info. + @method transitionTo + @param {String} name the name of the route or a URL + @param {...Object} models the model(s) or identifier(s) to be used while + transitioning to the route. + @param {Object} [options] optional hash with a queryParams property + containing a mapping of query parameters + @return {Transition} the transition object associated with this + attempted transition + @public + */ + transitionTo: function () { + var queryParams = undefined; - CompiledGetBlockBySymbol.prototype.toJSON = function toJSON() { - return 'get-block($' + this.symbol + '(' + this.debug + '))'; - }; + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - return CompiledGetBlockBySymbol; - })(); + if (resemblesURL(args[0])) { + return this._doURLTransition('transitionTo', args[0]); + } - exports.CompiledGetBlockBySymbol = CompiledGetBlockBySymbol; + var possibleQueryParams = args[args.length - 1]; + if (possibleQueryParams && possibleQueryParams.hasOwnProperty('queryParams')) { + queryParams = args.pop().queryParams; + } else { + queryParams = {}; + } - var CompiledInPartialGetBlock = (function () { - function CompiledInPartialGetBlock(symbol, name) { - this.symbol = symbol; - this.name = name; - } + var targetRouteName = args.shift(); + return this._doTransition(targetRouteName, args, queryParams); + }, - CompiledInPartialGetBlock.prototype.evaluate = function evaluate(vm) { - var symbol = this.symbol; - var name = this.name; + intermediateTransitionTo: function () { + var _router; - var args = vm.scope().getPartialArgs(symbol); - return args.blocks[name]; - }; + (_router = this.router).intermediateTransitionTo.apply(_router, arguments); - CompiledInPartialGetBlock.prototype.toJSON = function toJSON() { - return 'get-block($' + this.symbol + '($ARGS).' + this.name + '))'; - }; + updatePaths(this); + }, - return CompiledInPartialGetBlock; - })(); + replaceWith: function () { + return this.transitionTo.apply(this, arguments).method('replace'); + }, - exports.CompiledInPartialGetBlock = CompiledInPartialGetBlock; -}); + generate: function () { + var _router2; -enifed('glimmer-runtime/lib/compiled/expressions/helper', ['exports', 'glimmer-runtime/lib/compiled/expressions'], function (exports, _glimmerRuntimeLibCompiledExpressions) { - 'use strict'; + var url = (_router2 = this.router).generate.apply(_router2, arguments); + return this.location.formatURL(url); + }, - var CompiledHelper = (function (_CompiledExpression) { - babelHelpers.inherits(CompiledHelper, _CompiledExpression); + /** + Determines if the supplied route is currently active. + @method isActive + @param routeName + @return {Boolean} + @private + */ + isActive: function (routeName) { + var router = this.router; + return router.isActive.apply(router, arguments); + }, - function CompiledHelper(name, helper, args, symbolTable) { - _CompiledExpression.call(this); - this.name = name; - this.helper = helper; - this.args = args; - this.symbolTable = symbolTable; - this.type = "helper"; - } + /** + An alternative form of `isActive` that doesn't require + manual concatenation of the arguments into a single + array. + @method isActiveIntent + @param routeName + @param models + @param queryParams + @return {Boolean} + @private + @since 1.7.0 + */ + isActiveIntent: function (routeName, models, queryParams) { + return this.currentState.isActiveIntent(routeName, models, queryParams); + }, - CompiledHelper.prototype.evaluate = function evaluate(vm) { - var helper = this.helper; + send: function (name, context) { + var _router3; - return helper(vm, this.args.evaluate(vm), this.symbolTable); - }; + (_router3 = this.router).trigger.apply(_router3, arguments); + }, - CompiledHelper.prototype.toJSON = function toJSON() { - return '`' + this.name.join('.') + '($ARGS)`'; - }; + /** + Does this router instance have the given route. + @method hasRoute + @return {Boolean} + @private + */ + hasRoute: function (route) { + return this.router.hasRoute(route); + }, - return CompiledHelper; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); + /** + Resets the state of the router by clearing the current route + handlers and deactivating them. + @private + @method reset + */ + reset: function () { + if (this.router) { + this.router.reset(); + } + }, - exports.default = CompiledHelper; -}); + willDestroy: function () { + if (this._toplevelView) { + this._toplevelView.destroy(); + this._toplevelView = null; + } -enifed('glimmer-runtime/lib/compiled/expressions/lookups', ['exports', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-reference'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerReference) { - 'use strict'; + this._super.apply(this, arguments); - var CompiledLookup = (function (_CompiledExpression) { - babelHelpers.inherits(CompiledLookup, _CompiledExpression); + this.reset(); - function CompiledLookup(base, path) { - _CompiledExpression.call(this); - this.base = base; - this.path = path; - this.type = "lookup"; + var instances = this._engineInstances; + for (var _name in instances) { + for (var id in instances[_name]) { + _emberMetal.run(instances[_name][id], 'destroy'); } + } + }, - CompiledLookup.create = function create(base, path) { - if (path.length === 0) { - return base; - } else { - return new this(base, path); - } - }; - - CompiledLookup.prototype.evaluate = function evaluate(vm) { - var base = this.base; - var path = this.path; + /* + Called when an active route's query parameter has changed. + These changes are batched into a runloop run and trigger + a single transition. + */ + _activeQPChanged: function (queryParameterName, newValue) { + this._queuedQPChanges[queryParameterName] = newValue; + _emberMetal.run.once(this, this._fireQueryParamTransition); + }, - return _glimmerReference.referenceFromParts(base.evaluate(vm), path); - }; + _updatingQPChanged: function (queryParameterName) { + if (!this._qpUpdates) { + this._qpUpdates = {}; + } + this._qpUpdates[queryParameterName] = true; + }, - CompiledLookup.prototype.toJSON = function toJSON() { - return this.base.toJSON() + '.' + this.path.join('.'); - }; + /* + Triggers a transition to a route based on query parameter changes. + This is called once per runloop, to batch changes. + e.g. + if these methods are called in succession: + this._activeQPChanged('foo', '10'); + // results in _queuedQPChanges = { foo: '10' } + this._activeQPChanged('bar', false); + // results in _queuedQPChanges = { foo: '10', bar: false } + _queuedQPChanges will represent both of these changes + and the transition using `transitionTo` will be triggered + once. + */ + _fireQueryParamTransition: function () { + this.transitionTo({ queryParams: this._queuedQPChanges }); + this._resetQueuedQueryParameterChanges(); + }, - return CompiledLookup; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); + _setupLocation: function () { + var location = _emberMetal.get(this, 'location'); + var rootURL = _emberMetal.get(this, 'rootURL'); + var owner = _emberUtils.getOwner(this); - exports.default = CompiledLookup; + if ('string' === typeof location && owner) { + var resolvedLocation = owner.lookup('location:' + location); - var CompiledSelf = (function (_CompiledExpression2) { - babelHelpers.inherits(CompiledSelf, _CompiledExpression2); + if ('undefined' !== typeof resolvedLocation) { + location = _emberMetal.set(this, 'location', resolvedLocation); + } else { + // Allow for deprecated registration of custom location API's + var options = { + implementation: location + }; - function CompiledSelf() { - _CompiledExpression2.apply(this, arguments); + location = _emberMetal.set(this, 'location', _emberRoutingLocationApi.default.create(options)); } + } - CompiledSelf.prototype.evaluate = function evaluate(vm) { - return vm.getSelf(); - }; - - CompiledSelf.prototype.toJSON = function toJSON() { - return 'self'; - }; - - return CompiledSelf; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); - - exports.CompiledSelf = CompiledSelf; - - var CompiledSymbol = (function (_CompiledExpression3) { - babelHelpers.inherits(CompiledSymbol, _CompiledExpression3); + if (location !== null && typeof location === 'object') { + if (rootURL) { + _emberMetal.set(location, 'rootURL', rootURL); + } - function CompiledSymbol(symbol, debug) { - _CompiledExpression3.call(this); - this.symbol = symbol; - this.debug = debug; + // Allow the location to do any feature detection, such as AutoLocation + // detecting history support. This gives it a chance to set its + // `cancelRouterSetup` property which aborts routing. + if (typeof location.detect === 'function') { + location.detect(); } - CompiledSymbol.prototype.evaluate = function evaluate(vm) { - return vm.referenceForSymbol(this.symbol); - }; + // ensure that initState is called AFTER the rootURL is set on + // the location instance + if (typeof location.initState === 'function') { + location.initState(); + } + } + }, - CompiledSymbol.prototype.toJSON = function toJSON() { - return '$' + this.symbol + '(' + this.debug + ')'; - }; + _getHandlerFunction: function () { + var _this2 = this; - return CompiledSymbol; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); + var seen = new _emberUtils.EmptyObject(); + var owner = _emberUtils.getOwner(this); - exports.CompiledSymbol = CompiledSymbol; + return function (name) { + var routeName = name; + var routeOwner = owner; + var engineInfo = _this2._engineInfoByRoute[routeName]; - var CompiledInPartialName = (function (_CompiledExpression4) { - babelHelpers.inherits(CompiledInPartialName, _CompiledExpression4); + if (engineInfo) { + var engineInstance = _this2._getEngineInstance(engineInfo); - function CompiledInPartialName(symbol, name) { - _CompiledExpression4.call(this); - this.symbol = symbol; - this.name = name; + routeOwner = engineInstance; + routeName = engineInfo.localFullName; } - CompiledInPartialName.prototype.evaluate = function evaluate(vm) { - var symbol = this.symbol; - var name = this.name; - - var args = vm.scope().getPartialArgs(symbol); - return args.named.get(name); - }; - - CompiledInPartialName.prototype.toJSON = function toJSON() { - return '$' + this.symbol + '($ARGS).' + this.name; - }; - - return CompiledInPartialName; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); - - exports.CompiledInPartialName = CompiledInPartialName; -}); + var fullRouteName = 'route:' + routeName; -enifed('glimmer-runtime/lib/compiled/expressions/named-args', ['exports', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/utils', 'glimmer-reference', 'glimmer-util'], function (exports, _glimmerRuntimeLibReferences, _glimmerRuntimeLibUtils, _glimmerReference, _glimmerUtil) { - 'use strict'; + var handler = routeOwner.lookup(fullRouteName); - var CompiledNamedArgs = (function () { - function CompiledNamedArgs(keys, values) { - this.keys = keys; - this.values = values; - this.length = keys.length; - _glimmerUtil.assert(keys.length === values.length, 'Keys and values do not have the same length'); + if (seen[name]) { + return handler; } - CompiledNamedArgs.empty = function empty() { - return COMPILED_EMPTY_NAMED_ARGS; - }; - - CompiledNamedArgs.create = function create(map) { - var keys = Object.keys(map); - var length = keys.length; - if (length > 0) { - var values = []; - for (var i = 0; i < length; i++) { - values[i] = map[keys[i]]; - } - return new this(keys, values); - } else { - return COMPILED_EMPTY_NAMED_ARGS; - } - }; + seen[name] = true; - CompiledNamedArgs.prototype.evaluate = function evaluate(vm) { - var keys = this.keys; - var values = this.values; - var length = this.length; + if (!handler) { + var DefaultRoute = routeOwner[_container.FACTORY_FOR]('route:basic').class; + routeOwner.register(fullRouteName, DefaultRoute.extend()); + handler = routeOwner.lookup(fullRouteName); + } - var evaluated = new Array(length); - for (var i = 0; i < length; i++) { - evaluated[i] = values[i].evaluate(vm); - } - return new EvaluatedNamedArgs(keys, evaluated); - }; + handler._setRouteName(routeName); + handler._populateQPMeta(); - CompiledNamedArgs.prototype.toJSON = function toJSON() { - var keys = this.keys; - var values = this.values; + if (engineInfo && !_emberRoutingSystemRoute.hasDefaultSerialize(handler)) { + throw new Error('Defining a custom serialize method on an Engine route is not supported.'); + } - var inner = keys.map(function (key, i) { - return key + ': ' + values[i].toJSON(); - }).join(", "); - return '{' + inner + '}'; - }; + return handler; + }; + }, - return CompiledNamedArgs; - })(); + _getSerializerFunction: function () { + var _this3 = this; - exports.CompiledNamedArgs = CompiledNamedArgs; - var COMPILED_EMPTY_NAMED_ARGS = new ((function (_CompiledNamedArgs) { - babelHelpers.inherits(_class, _CompiledNamedArgs); + return function (name) { + var engineInfo = _this3._engineInfoByRoute[name]; - function _class() { - _CompiledNamedArgs.call(this, _glimmerRuntimeLibUtils.EMPTY_ARRAY, _glimmerRuntimeLibUtils.EMPTY_ARRAY); + // If this is not an Engine route, we fall back to the handler for serialization + if (!engineInfo) { + return; } - _class.prototype.evaluate = function evaluate(vm) { - return EVALUATED_EMPTY_NAMED_ARGS; - }; + return engineInfo.serializeMethod || _emberRoutingSystemRoute.defaultSerialize; + }; + }, - _class.prototype.toJSON = function toJSON() { - return ''; - }; + _setupRouter: function (router, location) { + var lastURL = undefined; + var emberRouter = this; - return _class; - })(CompiledNamedArgs))(); - exports.COMPILED_EMPTY_NAMED_ARGS = COMPILED_EMPTY_NAMED_ARGS; - - var EvaluatedNamedArgs = (function () { - function EvaluatedNamedArgs(keys, values) { - var _map = arguments.length <= 2 || arguments[2] === undefined ? undefined : arguments[2]; - - this.keys = keys; - this.values = values; - this._map = _map; - this.tag = _glimmerReference.combineTagged(values); - this.length = keys.length; - _glimmerUtil.assert(keys.length === values.length, 'Keys and values do not have the same length'); - } - - EvaluatedNamedArgs.create = function create(map) { - var keys = Object.keys(map); - var length = keys.length; - if (length > 0) { - var values = new Array(length); - for (var i = 0; i < length; i++) { - values[i] = map[keys[i]]; - } - return new this(keys, values, map); - } else { - return EVALUATED_EMPTY_NAMED_ARGS; - } - }; + router.getHandler = this._getHandlerFunction(); + router.getSerializer = this._getSerializerFunction(); - EvaluatedNamedArgs.empty = function empty() { - return EVALUATED_EMPTY_NAMED_ARGS; - }; + var doUpdateURL = function () { + location.setURL(lastURL); + _emberMetal.set(emberRouter, 'currentURL', lastURL); + }; - EvaluatedNamedArgs.prototype.get = function get(key) { - var keys = this.keys; - var values = this.values; + router.updateURL = function (path) { + lastURL = path; + _emberMetal.run.once(doUpdateURL); + }; - var index = keys.indexOf(key); - return index === -1 ? _glimmerRuntimeLibReferences.UNDEFINED_REFERENCE : values[index]; - }; + if (location.replaceURL) { + (function () { + var doReplaceURL = function () { + location.replaceURL(lastURL); + _emberMetal.set(emberRouter, 'currentURL', lastURL); + }; - EvaluatedNamedArgs.prototype.has = function has(key) { - return this.keys.indexOf(key) !== -1; - }; + router.replaceURL = function (path) { + lastURL = path; + _emberMetal.run.once(doReplaceURL); + }; + })(); + } - EvaluatedNamedArgs.prototype.value = function value() { - var keys = this.keys; - var values = this.values; + router.didTransition = function (infos) { + emberRouter.didTransition(infos); + }; - var out = _glimmerUtil.dict(); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var ref = values[i]; - out[key] = ref.value(); - } - return out; - }; + router.willTransition = function (oldInfos, newInfos, transition) { + emberRouter.willTransition(oldInfos, newInfos, transition); + }; + }, - babelHelpers.createClass(EvaluatedNamedArgs, [{ - key: 'map', - get: function () { - var map = this._map; + /** + Serializes the given query params according to their QP meta information. + @private + @method _serializeQueryParams + @param {Arrray} handlerInfos + @param {Object} queryParams + @return {Void} + */ + _serializeQueryParams: function (handlerInfos, queryParams) { + var _this4 = this; - if (map) { - return map; - } - map = this._map = _glimmerUtil.dict(); - var keys = this.keys; - var values = this.values; - var length = this.length; + forEachQueryParam(this, handlerInfos, queryParams, function (key, value, qp) { + if (qp) { + delete queryParams[key]; + queryParams[qp.urlKey] = qp.route.serializeQueryParam(value, qp.urlKey, qp.type); + } else if (value === undefined) { + return; // We don't serialize undefined values + } else { + queryParams[key] = _this4._serializeQueryParam(value, _emberRuntime.typeOf(value)); + } + }); + }, - for (var i = 0; i < length; i++) { - map[keys[i]] = values[i]; - } - return map; - } - }]); - return EvaluatedNamedArgs; - })(); + /** + Serializes the value of a query parameter based on a type + @private + @method _serializeQueryParam + @param {Object} value + @param {String} type + */ + _serializeQueryParam: function (value, type) { + if (type === 'array') { + return JSON.stringify(value); + } - exports.EvaluatedNamedArgs = EvaluatedNamedArgs; - var EVALUATED_EMPTY_NAMED_ARGS = new ((function (_EvaluatedNamedArgs) { - babelHelpers.inherits(_class2, _EvaluatedNamedArgs); + return '' + value; + }, - function _class2() { - _EvaluatedNamedArgs.call(this, _glimmerRuntimeLibUtils.EMPTY_ARRAY, _glimmerRuntimeLibUtils.EMPTY_ARRAY, _glimmerRuntimeLibUtils.EMPTY_DICT); + /** + Deserializes the given query params according to their QP meta information. + @private + @method _deserializeQueryParams + @param {Array} handlerInfos + @param {Object} queryParams + @return {Void} + */ + _deserializeQueryParams: function (handlerInfos, queryParams) { + forEachQueryParam(this, handlerInfos, queryParams, function (key, value, qp) { + // If we don't have QP meta info for a given key, then we do nothing + // because all values will be treated as strings + if (qp) { + delete queryParams[key]; + queryParams[qp.prop] = qp.route.deserializeQueryParam(value, qp.urlKey, qp.type); } + }); + }, - _class2.prototype.get = function get() { - return _glimmerRuntimeLibReferences.UNDEFINED_REFERENCE; - }; - - _class2.prototype.has = function has(key) { - return false; - }; - - _class2.prototype.value = function value() { - return _glimmerRuntimeLibUtils.EMPTY_DICT; - }; - - return _class2; - })(EvaluatedNamedArgs))(); - exports.EVALUATED_EMPTY_NAMED_ARGS = EVALUATED_EMPTY_NAMED_ARGS; -}); + /** + Deserializes the value of a query parameter based on a default type + @private + @method _deserializeQueryParam + @param {Object} value + @param {String} defaultType + */ + _deserializeQueryParam: function (value, defaultType) { + if (defaultType === 'boolean') { + return value === 'true' ? true : false; + } else if (defaultType === 'number') { + return Number(value).valueOf(); + } else if (defaultType === 'array') { + return _emberRuntime.A(JSON.parse(value)); + } -enifed('glimmer-runtime/lib/compiled/expressions/positional-args', ['exports', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/utils', 'glimmer-reference'], function (exports, _glimmerRuntimeLibReferences, _glimmerRuntimeLibUtils, _glimmerReference) { - 'use strict'; + return value; + }, - var CompiledPositionalArgs = (function () { - function CompiledPositionalArgs(values) { - this.values = values; - this.length = values.length; + /** + Removes (prunes) any query params with default values from the given QP + object. Default values are determined from the QP meta information per key. + @private + @method _pruneDefaultQueryParamValues + @param {Array} handlerInfos + @param {Object} queryParams + @return {Void} + */ + _pruneDefaultQueryParamValues: function (handlerInfos, queryParams) { + var qps = this._queryParamsFor(handlerInfos); + for (var key in queryParams) { + var qp = qps.map[key]; + if (qp && qp.serializedDefaultValue === queryParams[key]) { + delete queryParams[key]; } + } + }, - CompiledPositionalArgs.create = function create(values) { - if (values.length) { - return new this(values); - } else { - return COMPILED_EMPTY_POSITIONAL_ARGS; - } - }; - - CompiledPositionalArgs.empty = function empty() { - return COMPILED_EMPTY_POSITIONAL_ARGS; - }; - - CompiledPositionalArgs.prototype.evaluate = function evaluate(vm) { - var values = this.values; - var length = this.length; + _doTransition: function (_targetRouteName, models, _queryParams) { + var _router4; - var references = new Array(length); - for (var i = 0; i < length; i++) { - references[i] = values[i].evaluate(vm); - } - return EvaluatedPositionalArgs.create(references); - }; + var targetRouteName = _targetRouteName || _emberRoutingUtils.getActiveTargetName(this.router); - CompiledPositionalArgs.prototype.toJSON = function toJSON() { - return '[' + this.values.map(function (value) { - return value.toJSON(); - }).join(", ") + ']'; - }; + var queryParams = {}; - return CompiledPositionalArgs; - })(); + this._processActiveTransitionQueryParams(targetRouteName, models, queryParams, _queryParams); - exports.CompiledPositionalArgs = CompiledPositionalArgs; - var COMPILED_EMPTY_POSITIONAL_ARGS = new ((function (_CompiledPositionalArgs) { - babelHelpers.inherits(_class, _CompiledPositionalArgs); + _emberUtils.assign(queryParams, _queryParams); + this._prepareQueryParams(targetRouteName, models, queryParams); - function _class() { - _CompiledPositionalArgs.call(this, _glimmerRuntimeLibUtils.EMPTY_ARRAY); - } + var transitionArgs = _emberRoutingUtils.routeArgs(targetRouteName, models, queryParams); + var transition = (_router4 = this.router).transitionTo.apply(_router4, transitionArgs); - _class.prototype.evaluate = function evaluate(vm) { - return EVALUATED_EMPTY_POSITIONAL_ARGS; - }; + didBeginTransition(transition, this); - _class.prototype.toJSON = function toJSON() { - return ''; - }; + return transition; + }, - return _class; - })(CompiledPositionalArgs))(); - exports.COMPILED_EMPTY_POSITIONAL_ARGS = COMPILED_EMPTY_POSITIONAL_ARGS; + _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 EvaluatedPositionalArgs = (function () { - function EvaluatedPositionalArgs(values) { - this.values = values; - this.tag = _glimmerReference.combineTagged(values); - this.length = values.length; + var unchangedQPs = {}; + var qpUpdates = this._qpUpdates || {}; + for (var key in this.router.activeTransition.queryParams) { + if (!qpUpdates[key]) { + unchangedQPs[key] = this.router.activeTransition.queryParams[key]; } + } - EvaluatedPositionalArgs.create = function create(values) { - return new this(values); - }; - - EvaluatedPositionalArgs.empty = function empty() { - return EVALUATED_EMPTY_POSITIONAL_ARGS; - }; - - EvaluatedPositionalArgs.prototype.at = function at(index) { - var values = this.values; - var length = this.length; - - return index < length ? values[index] : _glimmerRuntimeLibReferences.UNDEFINED_REFERENCE; - }; - - EvaluatedPositionalArgs.prototype.value = function value() { - var values = this.values; - var length = this.length; - - var ret = new Array(length); - for (var i = 0; i < length; i++) { - ret[i] = values[i].value(); - } - return ret; - }; - - return EvaluatedPositionalArgs; - })(); - - exports.EvaluatedPositionalArgs = EvaluatedPositionalArgs; - var EVALUATED_EMPTY_POSITIONAL_ARGS = new ((function (_EvaluatedPositionalArgs) { - babelHelpers.inherits(_class2, _EvaluatedPositionalArgs); - - function _class2() { - _EvaluatedPositionalArgs.call(this, _glimmerRuntimeLibUtils.EMPTY_ARRAY); - } + // 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); + _emberUtils.assign(queryParams, unchangedQPs); + }, - _class2.prototype.at = function at() { - return _glimmerRuntimeLibReferences.UNDEFINED_REFERENCE; - }; + /** + Prepares the query params for a URL or Transition. Restores any undefined QP + keys/values, serializes all values, and then prunes any default values. + @private + @method _prepareQueryParams + @param {String} targetRouteName + @param {Array} models + @param {Object} queryParams + @return {Void} + */ + _prepareQueryParams: function (targetRouteName, models, queryParams) { + var state = calculatePostTransitionState(this, targetRouteName, models); + this._hydrateUnsuppliedQueryParams(state, queryParams); + this._serializeQueryParams(state.handlerInfos, queryParams); + this._pruneDefaultQueryParamValues(state.handlerInfos, queryParams); + }, - _class2.prototype.value = function value() { - return this.values; - }; + /** + Returns the meta information for the query params of a given route. This + will be overriden to allow support for lazy routes. + @private + @method _getQPMeta + @param {HandlerInfo} handlerInfo + @return {Object} + */ + _getQPMeta: function (handlerInfo) { + var route = handlerInfo.handler; + return route && _emberMetal.get(route, '_qp'); + }, - return _class2; - })(EvaluatedPositionalArgs))(); - exports.EVALUATED_EMPTY_POSITIONAL_ARGS = EVALUATED_EMPTY_POSITIONAL_ARGS; -}); + /** + Returns a merged query params meta object for a given set of handlerInfos. + Useful for knowing what query params are available for a given route hierarchy. + @private + @method _queryParamsFor + @param {Array} handlerInfos + @return {Object} + */ + _queryParamsFor: function (handlerInfos) { + var leafRouteName = handlerInfos[handlerInfos.length - 1].name; + if (this._qpCache[leafRouteName]) { + return this._qpCache[leafRouteName]; + } -enifed('glimmer-runtime/lib/compiled/expressions/value', ['exports', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-runtime/lib/references'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerRuntimeLibReferences) { - 'use strict'; + var shouldCache = true; + var qpsByUrlKey = {}; + var map = {}; + var qps = []; - var CompiledValue = (function (_CompiledExpression) { - babelHelpers.inherits(CompiledValue, _CompiledExpression); + for (var i = 0; i < handlerInfos.length; ++i) { + var qpMeta = this._getQPMeta(handlerInfos[i]); - function CompiledValue(value) { - _CompiledExpression.call(this); - this.type = "value"; - this.reference = _glimmerRuntimeLibReferences.PrimitiveReference.create(value); + if (!qpMeta) { + shouldCache = false; + continue; } - CompiledValue.prototype.evaluate = function evaluate(vm) { - return this.reference; - }; - - CompiledValue.prototype.toJSON = function toJSON() { - return JSON.stringify(this.reference.value()); - }; - - return CompiledValue; - })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); - - exports.default = CompiledValue; -}); + // Loop over each QP to make sure we don't have any collisions by urlKey + for (var _i = 0; _i < qpMeta.qps.length; _i++) { + var qp = qpMeta.qps[_i]; + var urlKey = qp.urlKey; + var qpOther = qpsByUrlKey[urlKey]; -enifed('glimmer-runtime/lib/compiled/opcodes/builder', ['exports', 'glimmer-runtime/lib/compiled/opcodes/component', 'glimmer-runtime/lib/compiled/opcodes/partial', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-runtime/lib/compiled/opcodes/dom', 'glimmer-runtime/lib/compiled/opcodes/lists', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-util', 'glimmer-runtime/lib/utils'], function (exports, _glimmerRuntimeLibCompiledOpcodesComponent, _glimmerRuntimeLibCompiledOpcodesPartial, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerRuntimeLibCompiledOpcodesDom, _glimmerRuntimeLibCompiledOpcodesLists, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerUtil, _glimmerRuntimeLibUtils) { - 'use strict'; + if (qpOther && qpOther.controllerName !== qp.controllerName) { + var otherQP = qpsByUrlKey[urlKey]; + } - var StatementCompilationBufferProxy = (function () { - function StatementCompilationBufferProxy(inner) { - this.inner = inner; + qpsByUrlKey[urlKey] = qp; + qps.push(qp); } - StatementCompilationBufferProxy.prototype.toOpSeq = function toOpSeq() { - return this.inner.toOpSeq(); - }; - - StatementCompilationBufferProxy.prototype.append = function append(opcode) { - this.inner.append(opcode); - }; + _emberUtils.assign(map, qpMeta.map); + } - StatementCompilationBufferProxy.prototype.getLocalSymbol = function getLocalSymbol(name) { - return this.inner.getLocalSymbol(name); - }; + var finalQPMeta = { + qps: qps, + map: map + }; - StatementCompilationBufferProxy.prototype.hasLocalSymbol = function hasLocalSymbol(name) { - return this.inner.hasLocalSymbol(name); - }; + if (shouldCache) { + this._qpCache[leafRouteName] = finalQPMeta; + } - StatementCompilationBufferProxy.prototype.getNamedSymbol = function getNamedSymbol(name) { - return this.inner.getNamedSymbol(name); - }; + return finalQPMeta; + }, - StatementCompilationBufferProxy.prototype.hasNamedSymbol = function hasNamedSymbol(name) { - return this.inner.hasNamedSymbol(name); - }; + /** + Maps all query param keys to their fully scoped property name of the form + `controllerName:propName`. + @private + @method _fullyScopeQueryParams + @param {String} leafRouteName + @param {Array} contexts + @param {Object} queryParams + @return {Void} + */ + _fullyScopeQueryParams: function (leafRouteName, contexts, queryParams) { + var state = calculatePostTransitionState(this, leafRouteName, contexts); + var handlerInfos = state.handlerInfos; - StatementCompilationBufferProxy.prototype.getBlockSymbol = function getBlockSymbol(name) { - return this.inner.getBlockSymbol(name); - }; + for (var i = 0, len = handlerInfos.length; i < len; ++i) { + var qpMeta = this._getQPMeta(handlerInfos[i]); - StatementCompilationBufferProxy.prototype.hasBlockSymbol = function hasBlockSymbol(name) { - return this.inner.hasBlockSymbol(name); - }; + if (!qpMeta) { + continue; + } - StatementCompilationBufferProxy.prototype.getPartialArgsSymbol = function getPartialArgsSymbol() { - return this.inner.getPartialArgsSymbol(); - }; + for (var j = 0, qpLen = qpMeta.qps.length; j < qpLen; ++j) { + var qp = qpMeta.qps[j]; - StatementCompilationBufferProxy.prototype.hasPartialArgsSymbol = function hasPartialArgsSymbol() { - return this.inner.hasPartialArgsSymbol(); - }; + var presentProp = qp.prop in queryParams && qp.prop || qp.scopedPropertyName in queryParams && qp.scopedPropertyName || qp.urlKey in queryParams && qp.urlKey; - babelHelpers.createClass(StatementCompilationBufferProxy, [{ - key: 'component', - get: function () { - return this.inner.component; + if (presentProp) { + if (presentProp !== qp.scopedPropertyName) { + queryParams[qp.scopedPropertyName] = queryParams[presentProp]; + delete queryParams[presentProp]; } - }]); - return StatementCompilationBufferProxy; - })(); + } + } + } + }, - exports.StatementCompilationBufferProxy = StatementCompilationBufferProxy; + /** + Hydrates (adds/restores) any query params that have pre-existing values into + the given queryParams hash. This is what allows query params to be "sticky" + and restore their last known values for their scope. + @private + @method _hydrateUnsuppliedQueryParams + @param {TransitionState} state + @param {Object} queryParams + @return {Void} + */ + _hydrateUnsuppliedQueryParams: function (state, queryParams) { + var handlerInfos = state.handlerInfos; + var appCache = this._bucketCache; - var BasicOpcodeBuilder = (function (_StatementCompilationBufferProxy) { - babelHelpers.inherits(BasicOpcodeBuilder, _StatementCompilationBufferProxy); + for (var i = 0; i < handlerInfos.length; ++i) { + var qpMeta = this._getQPMeta(handlerInfos[i]); - function BasicOpcodeBuilder(inner, symbolTable, env) { - _StatementCompilationBufferProxy.call(this, inner); - this.symbolTable = symbolTable; - this.env = env; - this.labelsStack = new _glimmerUtil.Stack(); + if (!qpMeta) { + continue; } - // helpers - - BasicOpcodeBuilder.prototype.startLabels = function startLabels() { - this.labelsStack.push(_glimmerUtil.dict()); - }; + for (var j = 0, qpLen = qpMeta.qps.length; j < qpLen; ++j) { + var qp = qpMeta.qps[j]; - BasicOpcodeBuilder.prototype.stopLabels = function stopLabels() { - this.labelsStack.pop(); - }; + var presentProp = qp.prop in queryParams && qp.prop || qp.scopedPropertyName in queryParams && qp.scopedPropertyName || qp.urlKey in queryParams && qp.urlKey; - BasicOpcodeBuilder.prototype.labelFor = function labelFor(name) { - var labels = this.labels; - var label = labels[name]; - if (!label) { - label = labels[name] = new _glimmerRuntimeLibCompiledOpcodesVm.LabelOpcode(name); + if (presentProp) { + if (presentProp !== qp.scopedPropertyName) { + queryParams[qp.scopedPropertyName] = queryParams[presentProp]; + delete queryParams[presentProp]; } - return label; - }; - - // partials - - BasicOpcodeBuilder.prototype.putPartialDefinition = function putPartialDefinition(definition) { - this.append(new _glimmerRuntimeLibCompiledOpcodesPartial.PutPartialDefinitionOpcode(definition)); - }; - - BasicOpcodeBuilder.prototype.putDynamicPartialDefinition = function putDynamicPartialDefinition() { - this.append(new _glimmerRuntimeLibCompiledOpcodesPartial.PutDynamicPartialDefinitionOpcode(this.symbolTable)); - }; - - BasicOpcodeBuilder.prototype.evaluatePartial = function evaluatePartial() { - this.append(new _glimmerRuntimeLibCompiledOpcodesPartial.EvaluatePartialOpcode(this.symbolTable)); - }; - - // components + } else { + var cacheKey = _emberRoutingUtils.calculateCacheKey(qp.route.fullRouteName, qp.parts, state.params); + queryParams[qp.scopedPropertyName] = appCache.lookup(cacheKey, qp.prop, qp.defaultValue); + } + } + } + }, - BasicOpcodeBuilder.prototype.putComponentDefinition = function putComponentDefinition(definition) { - this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.PutComponentDefinitionOpcode(definition)); - }; + _scheduleLoadingEvent: function (transition, originRoute) { + this._cancelSlowTransitionTimer(); + this._slowTransitionTimer = _emberMetal.run.scheduleOnce('routerTransitions', this, '_handleSlowTransition', transition, originRoute); + }, - BasicOpcodeBuilder.prototype.putDynamicComponentDefinition = function putDynamicComponentDefinition() { - this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.PutDynamicComponentDefinitionOpcode()); - }; + currentState: null, + targetState: null, - BasicOpcodeBuilder.prototype.openComponent = function openComponent(args) { - var shadow = arguments.length <= 1 || arguments[1] === undefined ? _glimmerRuntimeLibUtils.EMPTY_ARRAY : arguments[1]; + _handleSlowTransition: function (transition, originRoute) { + if (!this.router.activeTransition) { + // Don't fire an event if we've since moved on from + // the transition that put us in a loading state. + return; + } - this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.OpenComponentOpcode(this.compile(args), shadow)); - }; + this.set('targetState', _emberRoutingSystemRouter_state.default.create({ + emberRouter: this, + routerJs: this.router, + routerJsState: this.router.activeTransition.state + })); - BasicOpcodeBuilder.prototype.didCreateElement = function didCreateElement() { - this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.DidCreateElementOpcode()); - }; + transition.trigger(true, 'loading', transition, originRoute); + }, - BasicOpcodeBuilder.prototype.shadowAttributes = function shadowAttributes() { - this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.ShadowAttributesOpcode()); - }; + _cancelSlowTransitionTimer: function () { + if (this._slowTransitionTimer) { + _emberMetal.run.cancel(this._slowTransitionTimer); + } + this._slowTransitionTimer = null; + }, - BasicOpcodeBuilder.prototype.didRenderLayout = function didRenderLayout() { - this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.DidRenderLayoutOpcode()); - }; + // These three helper functions are used to ensure errors aren't + // re-raised if they're handled in a route's error action. + _markErrorAsHandled: function (errorGuid) { + this._handledErrors[errorGuid] = true; + }, - BasicOpcodeBuilder.prototype.closeComponent = function closeComponent() { - this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.CloseComponentOpcode()); - }; + _isErrorHandled: function (errorGuid) { + return this._handledErrors[errorGuid]; + }, - // content + _clearHandledError: function (errorGuid) { + delete this._handledErrors[errorGuid]; + }, - BasicOpcodeBuilder.prototype.cautiousAppend = function cautiousAppend() { - this.append(new _glimmerRuntimeLibCompiledOpcodesContent.OptimizedCautiousAppendOpcode()); - }; + _getEngineInstance: function (_ref) { + var name = _ref.name; + var instanceId = _ref.instanceId; + var mountPoint = _ref.mountPoint; - BasicOpcodeBuilder.prototype.trustingAppend = function trustingAppend() { - this.append(new _glimmerRuntimeLibCompiledOpcodesContent.OptimizedTrustingAppendOpcode()); - }; + var engineInstances = this._engineInstances; - // dom + if (!engineInstances[name]) { + engineInstances[name] = new _emberUtils.EmptyObject(); + } - BasicOpcodeBuilder.prototype.text = function text(_text) { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.TextOpcode(_text)); - }; + var engineInstance = engineInstances[name][instanceId]; - BasicOpcodeBuilder.prototype.openPrimitiveElement = function openPrimitiveElement(tag) { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.OpenPrimitiveElementOpcode(tag)); - }; + if (!engineInstance) { + var owner = _emberUtils.getOwner(this); - BasicOpcodeBuilder.prototype.openComponentElement = function openComponentElement(tag) { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.OpenComponentElementOpcode(tag)); - }; + engineInstance = owner.buildChildEngineInstance(name, { + routable: true, + mountPoint: mountPoint + }); - BasicOpcodeBuilder.prototype.openDynamicPrimitiveElement = function openDynamicPrimitiveElement() { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.OpenDynamicPrimitiveElementOpcode()); - }; + engineInstance.boot(); - BasicOpcodeBuilder.prototype.flushElement = function flushElement() { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.FlushElementOpcode()); - }; + engineInstances[name][instanceId] = engineInstance; + } - BasicOpcodeBuilder.prototype.closeElement = function closeElement() { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.CloseElementOpcode()); - }; + return engineInstance; + } + }); - BasicOpcodeBuilder.prototype.staticAttr = function staticAttr(name, namespace, value) { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.StaticAttrOpcode(name, namespace, value)); - }; + /* + Helper function for iterating over routes in a set of handlerInfos that are + at or above the given origin route. Example: if `originRoute` === 'foo.bar' + and the handlerInfos given were for 'foo.bar.baz', then the given callback + will be invoked with the routes for 'foo.bar', 'foo', and 'application' + individually. + + If the callback returns anything other than `true`, then iteration will stop. + + @private + @param {Route} originRoute + @param {Array} handlerInfos + @param {Function} callback + @return {Void} + */ + function forEachRouteAbove(originRoute, handlerInfos, callback) { + var originRouteFound = false; - BasicOpcodeBuilder.prototype.dynamicAttrNS = function dynamicAttrNS(name, namespace, isTrusting) { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.DynamicAttrNSOpcode(name, namespace, isTrusting)); - }; + for (var i = handlerInfos.length - 1; i >= 0; --i) { + var handlerInfo = handlerInfos[i]; + var route = handlerInfo.handler; - BasicOpcodeBuilder.prototype.dynamicAttr = function dynamicAttr(name, isTrusting) { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.DynamicAttrOpcode(name, isTrusting)); - }; + if (originRoute === route) { + originRouteFound = true; + } - BasicOpcodeBuilder.prototype.comment = function comment(_comment) { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.CommentOpcode(_comment)); - }; + if (!originRouteFound) { + continue; + } - // lists + if (callback(route) !== true) { + return; + } + } + } - BasicOpcodeBuilder.prototype.putIterator = function putIterator() { - this.append(new _glimmerRuntimeLibCompiledOpcodesLists.PutIteratorOpcode()); - }; + // These get invoked when an action bubbles above ApplicationRoute + // and are not meant to be overridable. + var defaultActionHandlers = { - BasicOpcodeBuilder.prototype.enterList = function enterList(start, end) { - this.append(new _glimmerRuntimeLibCompiledOpcodesLists.EnterListOpcode(this.labelFor(start), this.labelFor(end))); - }; + willResolveModel: function (transition, originRoute) { + originRoute.router._scheduleLoadingEvent(transition, originRoute); + }, - BasicOpcodeBuilder.prototype.exitList = function exitList() { - this.append(new _glimmerRuntimeLibCompiledOpcodesLists.ExitListOpcode()); - }; + // Attempt to find an appropriate error route or substate to enter. + error: function (error, transition, originRoute) { + var handlerInfos = transition.state.handlerInfos; + var router = originRoute.router; - BasicOpcodeBuilder.prototype.enterWithKey = function enterWithKey(start, end) { - this.append(new _glimmerRuntimeLibCompiledOpcodesLists.EnterWithKeyOpcode(this.labelFor(start), this.labelFor(end))); - }; + forEachRouteAbove(originRoute, handlerInfos, function (route) { + // Check for the existence of an 'error' route. + // We don't check for an 'error' route on the originRoute, since that would + // technically be below where we're at in the route hierarchy. + if (originRoute !== route) { + var errorRouteName = findRouteStateName(route, 'error'); + if (errorRouteName) { + router.intermediateTransitionTo(errorRouteName, error); + return false; + } + } - BasicOpcodeBuilder.prototype.nextIter = function nextIter(end) { - this.append(new _glimmerRuntimeLibCompiledOpcodesLists.NextIterOpcode(this.labelFor(end))); - }; + // Check for an 'error' substate route + var errorSubstateName = findRouteSubstateName(route, 'error'); + if (errorSubstateName) { + router.intermediateTransitionTo(errorSubstateName, error); + return false; + } - // vm + return true; + }); - BasicOpcodeBuilder.prototype.pushRemoteElement = function pushRemoteElement() { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.PushRemoteElementOpcode()); - }; + logError(error, 'Error while processing route: ' + transition.targetName); + }, - BasicOpcodeBuilder.prototype.popRemoteElement = function popRemoteElement() { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.PopRemoteElementOpcode()); - }; + // Attempt to find an appropriate loading route or substate to enter. + loading: function (transition, originRoute) { + var handlerInfos = transition.state.handlerInfos; + var router = originRoute.router; - BasicOpcodeBuilder.prototype.popElement = function popElement() { - this.append(new _glimmerRuntimeLibCompiledOpcodesDom.PopElementOpcode()); - }; + forEachRouteAbove(originRoute, handlerInfos, function (route) { + // Check for the existence of a 'loading' route. + // We don't check for a 'loading' route on the originRoute, since that would + // technically be below where we're at in the route hierarchy. + if (originRoute !== route) { + var loadingRouteName = findRouteStateName(route, 'loading'); + if (loadingRouteName) { + router.intermediateTransitionTo(loadingRouteName); + return false; + } + } - BasicOpcodeBuilder.prototype.label = function label(name) { - this.append(this.labelFor(name)); - }; + // Check for loading substate + var loadingSubstateName = findRouteSubstateName(route, 'loading'); + if (loadingSubstateName) { + router.intermediateTransitionTo(loadingSubstateName); + return false; + } - BasicOpcodeBuilder.prototype.pushChildScope = function pushChildScope() { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PushChildScopeOpcode()); - }; + // Don't bubble above pivot route. + return transition.pivotHandler !== route; + }); + } + }; - BasicOpcodeBuilder.prototype.popScope = function popScope() { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PopScopeOpcode()); - }; + function logError(_error, initialMessage) { + var errorArgs = []; + var error = undefined; + if (_error && typeof _error === 'object' && typeof _error.errorThrown === 'object') { + error = _error.errorThrown; + } else { + error = _error; + } - BasicOpcodeBuilder.prototype.pushDynamicScope = function pushDynamicScope() { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PushDynamicScopeOpcode()); - }; + if (initialMessage) { + errorArgs.push(initialMessage); + } - BasicOpcodeBuilder.prototype.popDynamicScope = function popDynamicScope() { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PopDynamicScopeOpcode()); - }; + if (error) { + if (error.message) { + errorArgs.push(error.message); + } + if (error.stack) { + errorArgs.push(error.stack); + } - BasicOpcodeBuilder.prototype.putNull = function putNull() { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PutNullOpcode()); - }; + if (typeof error === 'string') { + errorArgs.push(error); + } + } - BasicOpcodeBuilder.prototype.putValue = function putValue(expression) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PutValueOpcode(this.compile(expression))); - }; + _emberConsole.default.error.apply(this, errorArgs); + } - BasicOpcodeBuilder.prototype.putArgs = function putArgs(args) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PutArgsOpcode(this.compile(args))); - }; + /** + Finds the name of the substate route if it exists for the given route. A + substate route is of the form `route_state`, such as `foo_loading`. + + @private + @param {Route} route + @param {String} state + @return {String} + */ + function findRouteSubstateName(route, state) { + var router = route.router; + var owner = _emberUtils.getOwner(route); - BasicOpcodeBuilder.prototype.bindDynamicScope = function bindDynamicScope(names) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.BindDynamicScopeOpcode(names)); - }; + var routeName = route.routeName; + var substateName = routeName + '_' + state; - BasicOpcodeBuilder.prototype.bindPositionalArgs = function bindPositionalArgs(names, symbols) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.BindPositionalArgsOpcode(names, symbols)); - }; + var routeNameFull = route.fullRouteName; + var substateNameFull = routeNameFull + '_' + state; - BasicOpcodeBuilder.prototype.bindNamedArgs = function bindNamedArgs(names, symbols) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.BindNamedArgsOpcode(names, symbols)); - }; + return routeHasBeenDefined(owner, router, substateName, substateNameFull) ? substateNameFull : ''; + } - BasicOpcodeBuilder.prototype.bindBlocks = function bindBlocks(names, symbols) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.BindBlocksOpcode(names, symbols)); - }; + /** + Finds the name of the state route if it exists for the given route. A state + route is of the form `route.state`, such as `foo.loading`. Properly Handles + `application` named routes. + + @private + @param {Route} route + @param {String} state + @return {String} + */ + function findRouteStateName(route, state) { + var router = route.router; + var owner = _emberUtils.getOwner(route); - BasicOpcodeBuilder.prototype.enter = function enter(_enter, exit) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.EnterOpcode(this.labelFor(_enter), this.labelFor(exit))); - }; + var routeName = route.routeName; + var stateName = routeName === 'application' ? state : routeName + '.' + state; - BasicOpcodeBuilder.prototype.exit = function exit() { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.ExitOpcode()); - }; + var routeNameFull = route.fullRouteName; + var stateNameFull = routeNameFull === 'application' ? state : routeNameFull + '.' + state; - BasicOpcodeBuilder.prototype.evaluate = function evaluate(name, block) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.EvaluateOpcode(name, block)); - }; + return routeHasBeenDefined(owner, router, stateName, stateNameFull) ? stateNameFull : ''; + } - BasicOpcodeBuilder.prototype.test = function test(testFunc) { - if (testFunc === 'const') { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.TestOpcode(_glimmerRuntimeLibCompiledOpcodesVm.ConstTest)); - } else if (testFunc === 'simple') { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.TestOpcode(_glimmerRuntimeLibCompiledOpcodesVm.SimpleTest)); - } else if (testFunc === 'environment') { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.TestOpcode(_glimmerRuntimeLibCompiledOpcodesVm.EnvironmentTest)); - } else if (typeof testFunc === 'function') { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.TestOpcode(testFunc)); - } else { - throw new Error('unreachable'); - } - }; + /** + Determines whether or not a route has been defined by checking that the route + is in the Router's map and the owner has a registration for that route. + + @private + @param {Owner} owner + @param {Ember.Router} router + @param {String} localName + @param {String} fullName + @return {Boolean} + */ + function routeHasBeenDefined(owner, router, localName, fullName) { + var routerHasRoute = router.hasRoute(fullName); + var ownerHasRoute = owner.hasRegistration('template:' + localName) || owner.hasRegistration('route:' + localName); + return routerHasRoute && ownerHasRoute; + } - BasicOpcodeBuilder.prototype.jump = function jump(target) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.JumpOpcode(this.labelFor(target))); - }; + function triggerEvent(handlerInfos, ignoreFailure, args) { + var name = args.shift(); - BasicOpcodeBuilder.prototype.jumpIf = function jumpIf(target) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.JumpIfOpcode(this.labelFor(target))); - }; + if (!handlerInfos) { + if (ignoreFailure) { + return; + } + throw new _emberMetal.Error('Can\'t trigger action \'' + name + '\' because your app hasn\'t finished transitioning into its first route. To trigger an action on destination routes during a transition, you can call `.send()` on the `Transition` object passed to the `model/beforeModel/afterModel` hooks.'); + } - BasicOpcodeBuilder.prototype.jumpUnless = function jumpUnless(target) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.JumpUnlessOpcode(this.labelFor(target))); - }; + var eventWasHandled = false; + var handlerInfo = undefined, + handler = undefined; - babelHelpers.createClass(BasicOpcodeBuilder, [{ - key: 'labels', - get: function () { - return this.labelsStack.current; - } - }]); - return BasicOpcodeBuilder; - })(StatementCompilationBufferProxy); + for (var i = handlerInfos.length - 1; i >= 0; i--) { + handlerInfo = handlerInfos[i]; + handler = handlerInfo.handler; - exports.BasicOpcodeBuilder = BasicOpcodeBuilder; + if (handler && handler.actions && handler.actions[name]) { + if (handler.actions[name].apply(handler, args) === true) { + eventWasHandled = true; + } else { + // Should only hit here if a non-bubbling error action is triggered on a route. + if (name === 'error') { + var errorId = _emberUtils.guidFor(args[0]); + handler.router._markErrorAsHandled(errorId); + } + return; + } + } + } - function isCompilableExpression(expr) { - return expr && typeof expr['compile'] === 'function'; + if (defaultActionHandlers[name]) { + defaultActionHandlers[name].apply(null, args); + return; } - var OpcodeBuilder = (function (_BasicOpcodeBuilder) { - babelHelpers.inherits(OpcodeBuilder, _BasicOpcodeBuilder); + if (!eventWasHandled && !ignoreFailure) { + throw new _emberMetal.Error('Nothing handled the action \'' + name + '\'. If you did handle the action, this error can be caused by returning true from an action handler in a controller, causing the action to bubble.'); + } + } - function OpcodeBuilder() { - _BasicOpcodeBuilder.apply(this, arguments); - } + function calculatePostTransitionState(emberRouter, leafRouteName, contexts) { + var routerjs = emberRouter.router; + var state = routerjs.applyIntent(leafRouteName, contexts); + var handlerInfos = state.handlerInfos; + var params = state.params; - OpcodeBuilder.prototype.compile = function compile(expr) { - if (isCompilableExpression(expr)) { - return expr.compile(this, this.env, this.symbolTable); - } else { - return expr; - } - }; + for (var i = 0; i < handlerInfos.length; ++i) { + var handlerInfo = handlerInfos[i]; - OpcodeBuilder.prototype.bindPositionalArgsForBlock = function bindPositionalArgsForBlock(block) { - this.append(_glimmerRuntimeLibCompiledOpcodesVm.BindPositionalArgsOpcode.create(block)); - }; + // If the handlerInfo is not resolved, we serialize the context into params + if (!handlerInfo.isResolved) { + params[handlerInfo.name] = handlerInfo.serialize(handlerInfo.context); + } else { + params[handlerInfo.name] = handlerInfo.params; + } + } + return state; + } - OpcodeBuilder.prototype.preludeForLayout = function preludeForLayout(layout) { - if (layout.hasNamedParameters) { - this.append(_glimmerRuntimeLibCompiledOpcodesVm.BindNamedArgsOpcode.create(layout)); - } - if (layout.hasYields || layout.hasPartials) { - this.append(new _glimmerRuntimeLibCompiledOpcodesVm.BindCallerScopeOpcode()); - } - if (layout.hasYields) { - this.append(_glimmerRuntimeLibCompiledOpcodesVm.BindBlocksOpcode.create(layout)); - } - if (layout.hasPartials) { - this.append(_glimmerRuntimeLibCompiledOpcodesVm.BindPartialArgsOpcode.create(layout)); - } - }; + function updatePaths(router) { + var infos = router.router.currentHandlerInfos; + if (infos.length === 0) { + return; + } - // TODO - // come back to this - - OpcodeBuilder.prototype.block = function block(args, callback) { - if (args) this.putArgs(args); - this.startLabels(); - this.enter('BEGIN', 'END'); - this.label('BEGIN'); - callback(this, 'BEGIN', 'END'); - this.label('END'); - this.exit(); - this.stopLabels(); - }; + var path = EmberRouter._routePath(infos); + var currentRouteName = infos[infos.length - 1].name; + var currentURL = router.get('location').getURL(); - // TODO - // come back to this - - OpcodeBuilder.prototype.iter = function iter(callback) { - this.startLabels(); - this.enterList('BEGIN', 'END'); - this.label('ITER'); - this.nextIter('BREAK'); - this.enterWithKey('BEGIN', 'END'); - this.label('BEGIN'); - callback(this, 'BEGIN', 'END'); - this.label('END'); - this.exit(); - this.jump('ITER'); - this.label('BREAK'); - this.exitList(); - this.stopLabels(); - }; + _emberMetal.set(router, 'currentPath', path); + _emberMetal.set(router, 'currentRouteName', currentRouteName); + _emberMetal.set(router, 'currentURL', currentURL); - // TODO - // come back to this + var appController = _emberUtils.getOwner(router).lookup('controller:application'); - OpcodeBuilder.prototype.unit = function unit(callback) { - this.startLabels(); - callback(this); - this.stopLabels(); - }; + if (!appController) { + // appController might not exist when top-level loading/error + // substates have been entered since ApplicationRoute hasn't + // actually been entered at that point. + return; + } - return OpcodeBuilder; - })(BasicOpcodeBuilder); + if (!('currentPath' in appController)) { + _emberMetal.defineProperty(appController, 'currentPath'); + } - exports.default = OpcodeBuilder; -}); + _emberMetal.set(appController, 'currentPath', path); -enifed('glimmer-runtime/lib/compiled/opcodes/component', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-reference'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerReference) { - 'use strict'; + if (!('currentRouteName' in appController)) { + _emberMetal.defineProperty(appController, 'currentRouteName'); + } - var PutDynamicComponentDefinitionOpcode = (function (_Opcode) { - babelHelpers.inherits(PutDynamicComponentDefinitionOpcode, _Opcode); + _emberMetal.set(appController, 'currentRouteName', currentRouteName); + } - function PutDynamicComponentDefinitionOpcode() { - _Opcode.apply(this, arguments); - this.type = "put-dynamic-component-definition"; - } + EmberRouter.reopenClass({ + router: null, - PutDynamicComponentDefinitionOpcode.prototype.evaluate = function evaluate(vm) { - var reference = vm.frame.getOperand(); - var cache = _glimmerReference.isConst(reference) ? undefined : new _glimmerReference.ReferenceCache(reference); - var definition = cache ? cache.peek() : reference.value(); - vm.frame.setImmediate(definition); - if (cache) { - vm.updateWith(new _glimmerRuntimeLibCompiledOpcodesVm.Assert(cache)); - } - }; + /** + The `Router.map` function allows you to define mappings from URLs to routes + in your application. These mappings are defined within the + supplied callback function using `this.route`. + The first parameter is the name of the route which is used by default as the + path name as well. + The second parameter is the optional options hash. Available options are: + * `path`: allows you to provide your own path as well as mark dynamic + segments. + * `resetNamespace`: false by default; when nesting routes, ember will + combine the route names to form the fully-qualified route name, which is + used with `{{link-to}}` or manually transitioning to routes. Setting + `resetNamespace: true` will cause the route not to inherit from its + parent route's names. This is handy for preventing extremely long route names. + Keep in mind that the actual URL path behavior is still retained. + The third parameter is a function, which can be used to nest routes. + Nested routes, by default, will have the parent route tree's route name and + path prepended to it's own. + ```javascript + App.Router.map(function(){ + this.route('post', { path: '/post/:post_id' }, function() { + this.route('edit'); + this.route('comments', { resetNamespace: true }, function() { + this.route('new'); + }); + }); + }); + ``` + For more detailed documentation and examples please see + [the guides](http://emberjs.com/guides/routing/defining-your-routes/). + @method map + @param callback + @public + */ + map: function (callback) { + if (!this.dslCallbacks) { + this.dslCallbacks = []; + this.reopenClass({ dslCallbacks: this.dslCallbacks }); + } - PutDynamicComponentDefinitionOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$OPERAND"] - }; - }; + this.dslCallbacks.push(callback); - return PutDynamicComponentDefinitionOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return this; + }, - exports.PutDynamicComponentDefinitionOpcode = PutDynamicComponentDefinitionOpcode; + _routePath: function (handlerInfos) { + var path = []; - var PutComponentDefinitionOpcode = (function (_Opcode2) { - babelHelpers.inherits(PutComponentDefinitionOpcode, _Opcode2); + // We have to handle coalescing resource names that + // are prefixed with their parent's names, e.g. + // ['foo', 'foo.bar.baz'] => 'foo.bar.baz', not 'foo.foo.bar.baz' - function PutComponentDefinitionOpcode(definition) { - _Opcode2.call(this); - this.definition = definition; - this.type = "put-component-definition"; + function intersectionMatches(a1, a2) { + for (var i = 0; i < a1.length; ++i) { + if (a1[i] !== a2[i]) { + return false; + } } + return true; + } - PutComponentDefinitionOpcode.prototype.evaluate = function evaluate(vm) { - vm.frame.setImmediate(this.definition); - }; + var name = undefined, + nameParts = undefined, + oldNameParts = undefined; + for (var i = 1; i < handlerInfos.length; i++) { + name = handlerInfos[i].name; + nameParts = name.split('.'); + oldNameParts = slice.call(path); - PutComponentDefinitionOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.definition.name)] - }; - }; + while (oldNameParts.length) { + if (intersectionMatches(oldNameParts, nameParts)) { + break; + } + oldNameParts.shift(); + } - return PutComponentDefinitionOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); - - exports.PutComponentDefinitionOpcode = PutComponentDefinitionOpcode; - - var OpenComponentOpcode = (function (_Opcode3) { - babelHelpers.inherits(OpenComponentOpcode, _Opcode3); - - function OpenComponentOpcode(args, shadow) { - _Opcode3.call(this); - this.args = args; - this.shadow = shadow; - this.type = "open-component"; - } - - OpenComponentOpcode.prototype.evaluate = function evaluate(vm) { - var rawArgs = this.args; - var shadow = this.shadow; - - var definition = vm.frame.getImmediate(); - var dynamicScope = vm.pushDynamicScope(); - var callerScope = vm.scope(); - var manager = definition.manager; - var args = manager.prepareArgs(definition, rawArgs.evaluate(vm), dynamicScope); - var hasDefaultBlock = !!args.blocks.default; // TODO Cleanup? - var component = manager.create(vm.env, definition, args, dynamicScope, vm.getSelf(), hasDefaultBlock); - var destructor = manager.getDestructor(component); - if (destructor) vm.newDestroyable(destructor); - var layout = manager.layoutFor(definition, component, vm.env); - var selfRef = manager.getSelf(component); - vm.beginCacheGroup(); - vm.stack().pushSimpleBlock(); - vm.pushRootScope(selfRef, layout.symbols); - vm.invokeLayout(args, layout, callerScope, component, manager, shadow); - vm.updateWith(new UpdateComponentOpcode(definition.name, component, manager, args, dynamicScope)); - }; + path.push.apply(path, nameParts.slice(oldNameParts.length)); + } - OpenComponentOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$OPERAND"] - }; - }; + return path.join('.'); + } + }); - return OpenComponentOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); - - exports.OpenComponentOpcode = OpenComponentOpcode; - - var UpdateComponentOpcode = (function (_UpdatingOpcode) { - babelHelpers.inherits(UpdateComponentOpcode, _UpdatingOpcode); - - function UpdateComponentOpcode(name, component, manager, args, dynamicScope) { - _UpdatingOpcode.call(this); - this.name = name; - this.component = component; - this.manager = manager; - this.args = args; - this.dynamicScope = dynamicScope; - this.type = "update-component"; - var componentTag = manager.getTag(component); - if (componentTag) { - this.tag = _glimmerReference.combine([args.tag, componentTag]); - } else { - this.tag = args.tag; - } - } + function didBeginTransition(transition, router) { + var routerState = _emberRoutingSystemRouter_state.default.create({ + emberRouter: router, + routerJs: router.router, + routerJsState: transition.state + }); + + if (!router.currentState) { + router.set('currentState', routerState); + } + router.set('targetState', routerState); - UpdateComponentOpcode.prototype.evaluate = function evaluate(vm) { - var component = this.component; - var manager = this.manager; - var args = this.args; - var dynamicScope = this.dynamicScope; + transition.promise = transition.catch(function (error) { + var errorId = _emberUtils.guidFor(error); - manager.update(component, args, dynamicScope); - }; + if (router._isErrorHandled(errorId)) { + router._clearHandledError(errorId); + } else { + throw error; + } + }); + } - UpdateComponentOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.name)] - }; - }; + function resemblesURL(str) { + return typeof str === 'string' && (str === '' || str[0] === '/'); + } - return UpdateComponentOpcode; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + function forEachQueryParam(router, handlerInfos, queryParams, callback) { + var qpCache = router._queryParamsFor(handlerInfos); - exports.UpdateComponentOpcode = UpdateComponentOpcode; + for (var key in queryParams) { + if (!queryParams.hasOwnProperty(key)) { + continue; + } + var value = queryParams[key]; + var qp = qpCache.map[key]; - var DidCreateElementOpcode = (function (_Opcode4) { - babelHelpers.inherits(DidCreateElementOpcode, _Opcode4); + callback(key, value, qp); + } + } - function DidCreateElementOpcode() { - _Opcode4.apply(this, arguments); - this.type = "did-create-element"; - } + function findLiveRoute(liveRoutes, name) { + if (!liveRoutes) { + return; + } + var stack = [liveRoutes]; + while (stack.length > 0) { + var test = stack.shift(); + if (test.render.name === name) { + return test; + } + var outlets = test.outlets; + for (var outletName in outlets) { + stack.push(outlets[outletName]); + } + } + } - // Slow path for non-specialized component invocations. Uses an internal - // named lookup on the args. + function appendLiveRoute(liveRoutes, defaultParentState, renderOptions) { + var target = undefined; + var myState = { + render: renderOptions, + outlets: new _emberUtils.EmptyObject(), + wasUsed: false + }; + if (renderOptions.into) { + target = findLiveRoute(liveRoutes, renderOptions.into); + } else { + target = defaultParentState; + } + if (target) { + _emberMetal.set(target.outlets, renderOptions.outlet, myState); + } else { + if (renderOptions.into) { - DidCreateElementOpcode.prototype.evaluate = function evaluate(vm) { - var manager = vm.frame.getManager(); - var component = vm.frame.getComponent(); - manager.didCreateElement(component, vm.stack().constructing, vm.stack().operations); - }; + // Megahax time. Post-3.0-breaking-changes, we will just assert + // right here that the user tried to target a nonexistent + // thing. But for now we still need to support the `render` + // helper, and people are allowed to target templates rendered + // by the render helper. So instead we defer doing anyting with + // these orphan renders until afterRender. + appendOrphan(liveRoutes, renderOptions.into, myState); + } else { + liveRoutes = myState; + } + } + return { + liveRoutes: liveRoutes, + ownState: myState + }; + } - DidCreateElementOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$ARGS"] - }; - }; + function appendOrphan(liveRoutes, into, myState) { + if (!liveRoutes.outlets.__ember_orphans__) { + liveRoutes.outlets.__ember_orphans__ = { + render: { + name: '__ember_orphans__' + }, + outlets: new _emberUtils.EmptyObject() + }; + } + liveRoutes.outlets.__ember_orphans__.outlets[into] = myState; + _emberMetal.run.schedule('afterRender', function () {}); + } - return DidCreateElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + function representEmptyRoute(liveRoutes, defaultParentState, route) { + // the route didn't render anything + var alreadyAppended = findLiveRoute(liveRoutes, route.routeName); + if (alreadyAppended) { + // But some other route has already rendered our default + // template, so that becomes the default target for any + // children we may have. + return alreadyAppended; + } else { + // Create an entry to represent our default template name, + // just so other routes can target it and inherit its place + // in the outlet hierarchy. + defaultParentState.outlets.main = { + render: { + name: route.routeName, + outlet: 'main' + }, + outlets: {} + }; + return defaultParentState; + } + } - exports.DidCreateElementOpcode = DidCreateElementOpcode; + exports.default = EmberRouter; +}); - var ShadowAttributesOpcode = (function (_Opcode5) { - babelHelpers.inherits(ShadowAttributesOpcode, _Opcode5); +/** +@module ember +@submodule ember-routing +*/ - function ShadowAttributesOpcode() { - _Opcode5.apply(this, arguments); - this.type = "shadow-attributes"; - } +// `wasUsed` gets set by the render helper. +enifed('ember-routing/system/router_state', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime'], function (exports, _emberUtils, _emberMetal, _emberRuntime) { + 'use strict'; - ShadowAttributesOpcode.prototype.evaluate = function evaluate(vm) { - var shadow = vm.frame.getShadow(); - if (!shadow) return; + exports.default = _emberRuntime.Object.extend({ + emberRouter: null, + routerJs: null, + routerJsState: null, - var _vm$frame$getArgs = vm.frame.getArgs(); + isActiveIntent: function (routeName, models, queryParams, queryParamsMustMatch) { + var state = this.routerJsState; + if (!this.routerJs.isActiveIntent(routeName, models, null, state)) { + return false; + } - var named = _vm$frame$getArgs.named; + var emptyQueryParams = _emberMetal.isEmpty(Object.keys(queryParams)); - shadow.forEach(function (name) { - vm.stack().setDynamicAttribute(name, named.get(name), false); - }); - }; + if (queryParamsMustMatch && !emptyQueryParams) { + var visibleQueryParams = {}; + _emberUtils.assign(visibleQueryParams, queryParams); - ShadowAttributesOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$ARGS"] - }; - }; + this.emberRouter._prepareQueryParams(routeName, models, visibleQueryParams); + return shallowEqual(visibleQueryParams, state.queryParams); + } - return ShadowAttributesOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return true; + } + }); - exports.ShadowAttributesOpcode = ShadowAttributesOpcode; + function shallowEqual(a, b) { + var k = undefined; + for (k in a) { + if (a.hasOwnProperty(k) && a[k] !== b[k]) { + return false; + } + } + for (k in b) { + if (b.hasOwnProperty(k) && a[k] !== b[k]) { + return false; + } + } + return true; + } +}); +enifed('ember-routing/utils', ['exports', 'ember-utils', 'ember-metal'], function (exports, _emberUtils, _emberMetal) { + 'use strict'; - var DidRenderLayoutOpcode = (function (_Opcode6) { - babelHelpers.inherits(DidRenderLayoutOpcode, _Opcode6); + exports.routeArgs = routeArgs; + exports.getActiveTargetName = getActiveTargetName; + exports.stashParamNames = stashParamNames; + exports.calculateCacheKey = calculateCacheKey; + exports.normalizeControllerQueryParams = normalizeControllerQueryParams; + exports.prefixRouteNameArg = prefixRouteNameArg; - function DidRenderLayoutOpcode() { - _Opcode6.apply(this, arguments); - this.type = "did-render-layout"; - } + var ALL_PERIODS_REGEX = /\./g; - DidRenderLayoutOpcode.prototype.evaluate = function evaluate(vm) { - var manager = vm.frame.getManager(); - var component = vm.frame.getComponent(); - var bounds = vm.stack().popBlock(); - manager.didRenderLayout(component, bounds); - vm.env.didCreate(component, manager); - vm.updateWith(new DidUpdateLayoutOpcode(manager, component, bounds)); - }; + function routeArgs(targetRouteName, models, queryParams) { + var args = []; + if (typeof targetRouteName === 'string') { + args.push('' + targetRouteName); + } + args.push.apply(args, models); + args.push({ queryParams: queryParams }); + return args; + } - return DidRenderLayoutOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + function getActiveTargetName(router) { + var handlerInfos = router.activeTransition ? router.activeTransition.state.handlerInfos : router.state.handlerInfos; + return handlerInfos[handlerInfos.length - 1].name; + } - exports.DidRenderLayoutOpcode = DidRenderLayoutOpcode; + function stashParamNames(router, handlerInfos) { + if (handlerInfos._namesStashed) { + return; + } - var DidUpdateLayoutOpcode = (function (_UpdatingOpcode2) { - babelHelpers.inherits(DidUpdateLayoutOpcode, _UpdatingOpcode2); + // This helper exists because router.js/route-recognizer.js awkwardly + // keeps separate a handlerInfo's list of parameter names depending + // on whether a URL transition or named transition is happening. + // Hopefully we can remove this in the future. + var targetRouteName = handlerInfos[handlerInfos.length - 1].name; + var recogHandlers = router.router.recognizer.handlersFor(targetRouteName); + var dynamicParent = null; - function DidUpdateLayoutOpcode(manager, component, bounds) { - _UpdatingOpcode2.call(this); - this.manager = manager; - this.component = component; - this.bounds = bounds; - this.type = "did-update-layout"; - this.tag = _glimmerReference.CONSTANT_TAG; - } + for (var i = 0; i < handlerInfos.length; ++i) { + var handlerInfo = handlerInfos[i]; + var names = recogHandlers[i].names; - DidUpdateLayoutOpcode.prototype.evaluate = function evaluate(vm) { - var manager = this.manager; - var component = this.component; - var bounds = this.bounds; + if (names.length) { + dynamicParent = handlerInfo; + } - manager.didUpdateLayout(component, bounds); - vm.env.didUpdate(component, manager); - }; + handlerInfo._names = names; - return DidUpdateLayoutOpcode; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + var route = handlerInfo.handler; + route._stashNames(handlerInfo, dynamicParent); + } - exports.DidUpdateLayoutOpcode = DidUpdateLayoutOpcode; + handlerInfos._namesStashed = true; + } - var CloseComponentOpcode = (function (_Opcode7) { - babelHelpers.inherits(CloseComponentOpcode, _Opcode7); + function _calculateCacheValuePrefix(prefix, part) { + // calculates the dot seperated sections from prefix that are also + // at the start of part - which gives us the route name - function CloseComponentOpcode() { - _Opcode7.apply(this, arguments); - this.type = "close-component"; - } + // given : prefix = site.article.comments, part = site.article.id + // - returns: site.article (use get(values[site.article], 'id') to get the dynamic part - used below) - CloseComponentOpcode.prototype.evaluate = function evaluate(vm) { - vm.popScope(); - vm.popDynamicScope(); - vm.commitCacheGroup(); - }; + // given : prefix = site.article, part = site.article.id + // - returns: site.article. (use get(values[site.article], 'id') to get the dynamic part - used below) - return CloseComponentOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + var prefixParts = prefix.split('.'); + var currPrefix = ''; - exports.CloseComponentOpcode = CloseComponentOpcode; -}); + for (var i = 0; i < prefixParts.length; i++) { + var currPart = prefixParts.slice(0, i + 1).join('.'); + if (part.indexOf(currPart) !== 0) { + break; + } + currPrefix = currPart; + } -enifed('glimmer-runtime/lib/compiled/opcodes/content', ['exports', 'glimmer-runtime/lib/upsert', 'glimmer-runtime/lib/component/interfaces', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/vm/update', 'glimmer-reference', 'glimmer-util', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/builder', 'glimmer-runtime/lib/compiler', 'glimmer-runtime/lib/compiled/opcodes/builder', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/syntax/core'], function (exports, _glimmerRuntimeLibUpsert, _glimmerRuntimeLibComponentInterfaces, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibVmUpdate, _glimmerReference, _glimmerUtil, _glimmerRuntimeLibBounds, _glimmerRuntimeLibBuilder, _glimmerRuntimeLibCompiler, _glimmerRuntimeLibCompiledOpcodesBuilder, _glimmerRuntimeLibReferences, _glimmerRuntimeLibSyntaxCore) { - 'use strict'; + return currPrefix; + } - exports.normalizeTextValue = normalizeTextValue; + /* + Stolen from Controller + */ - function isEmpty(value) { - return value === null || value === undefined || typeof value['toString'] !== 'function'; - } + function calculateCacheKey(prefix, parts, values) { + if (parts === undefined) parts = []; - function normalizeTextValue(value) { - if (isEmpty(value)) { - return ''; + var suffixes = ''; + for (var i = 0; i < parts.length; ++i) { + var part = parts[i]; + var cacheValuePrefix = _calculateCacheValuePrefix(prefix, part); + var value = undefined; + if (values) { + if (cacheValuePrefix && cacheValuePrefix in values) { + var partRemovedPrefix = part.indexOf(cacheValuePrefix) === 0 ? part.substr(cacheValuePrefix.length + 1) : part; + value = _emberMetal.get(values[cacheValuePrefix], partRemovedPrefix); + } else { + value = _emberMetal.get(values, part); } - return String(value); + } + suffixes += '::' + part + ':' + value; } + return prefix + suffixes.replace(ALL_PERIODS_REGEX, '-'); + } - function normalizeTrustedValue(value) { - if (isEmpty(value)) { - return ''; - } - if (_glimmerRuntimeLibUpsert.isString(value)) { - return value; - } - if (_glimmerRuntimeLibUpsert.isSafeString(value)) { - return value.toHTML(); - } - if (_glimmerRuntimeLibUpsert.isNode(value)) { - return value; - } - return String(value); - } - function normalizeValue(value) { - if (isEmpty(value)) { - return ''; - } - if (_glimmerRuntimeLibUpsert.isString(value)) { - return value; + /* + Controller-defined query parameters can come in three shapes: + + Array + queryParams: ['foo', 'bar'] + Array of simple objects where value is an alias + queryParams: [ + { + 'foo': 'rename_foo_to_this' + }, + { + 'bar': 'call_bar_this_instead' } - if (_glimmerRuntimeLibUpsert.isSafeString(value) || _glimmerRuntimeLibUpsert.isNode(value)) { - return value; + ] + Array of fully defined objects + queryParams: [ + { + 'foo': { + as: 'rename_foo_to_this' + }, } - return String(value); - } - - var AppendOpcode = (function (_Opcode) { - babelHelpers.inherits(AppendOpcode, _Opcode); - - function AppendOpcode() { - _Opcode.apply(this, arguments); + { + 'bar': { + as: 'call_bar_this_instead', + scope: 'controller' + } } + ] + + This helper normalizes all three possible styles into the + 'Array of fully defined objects' style. + */ - AppendOpcode.prototype.evaluate = function evaluate(vm) { - var reference = vm.frame.getOperand(); - var normalized = this.normalize(reference); - var value = undefined, - cache = undefined; - if (_glimmerReference.isConst(reference)) { - value = normalized.value(); - } else { - cache = new _glimmerReference.ReferenceCache(normalized); - value = cache.peek(); - } - var stack = vm.stack(); - var upsert = this.insert(vm.env.getAppendOperations(), stack, value); - var bounds = new _glimmerRuntimeLibBuilder.Fragment(upsert.bounds); - stack.newBounds(bounds); - if (cache /* i.e. !isConst(reference) */) { - vm.updateWith(this.updateWith(vm, reference, cache, bounds, upsert)); - } - }; - - AppendOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$OPERAND"] - }; - }; - - return AppendOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); - - exports.AppendOpcode = AppendOpcode; + function normalizeControllerQueryParams(queryParams) { + var qpMap = {}; - var GuardedAppendOpcode = (function (_AppendOpcode) { - babelHelpers.inherits(GuardedAppendOpcode, _AppendOpcode); + for (var i = 0; i < queryParams.length; ++i) { + accumulateQueryParamDescriptors(queryParams[i], qpMap); + } - function GuardedAppendOpcode(expression, symbolTable) { - _AppendOpcode.call(this); - this.expression = expression; - this.symbolTable = symbolTable; - this.deopted = null; - } + return qpMap; + } - GuardedAppendOpcode.prototype.evaluate = function evaluate(vm) { - if (this.deopted) { - vm.pushEvalFrame(this.deopted); - } else { - vm.evaluateOperand(this.expression); - var value = vm.frame.getOperand().value(); - if (_glimmerRuntimeLibComponentInterfaces.isComponentDefinition(value)) { - vm.pushEvalFrame(this.deopt(vm.env)); - } else { - _AppendOpcode.prototype.evaluate.call(this, vm); - } - } - }; + function accumulateQueryParamDescriptors(_desc, accum) { + var desc = _desc; + var tmp = undefined; + if (typeof desc === 'string') { + tmp = {}; + tmp[desc] = { as: null }; + desc = tmp; + } - GuardedAppendOpcode.prototype.deopt = function deopt(env) { - var _this = this; + for (var key in desc) { + if (!desc.hasOwnProperty(key)) { + return; + } - // At compile time, we determined that this append callsite might refer - // to a local variable/property lookup that resolves to a component - // definition at runtime. - // - // We could have eagerly compiled this callsite into something like this: - // - // {{#if (is-component-definition foo)}} - // {{component foo}} - // {{else}} - // {{foo}} - // {{/if}} - // - // However, in practice, there might be a large amout of these callsites - // and most of them would resolve to a simple value lookup. Therefore, we - // tried to be optimistic and assumed that the callsite will resolve to - // appending a simple value. - // - // However, we have reached here because at runtime, the guard conditional - // have detected that this callsite is indeed referring to a component - // definition object. Since this is likely going to be true for other - // instances of the same callsite, it is now appropiate to deopt into the - // expanded version that handles both cases. The compilation would look - // like this: - // - // PutValue(expression) - // Test(is-component-definition) - // Enter(BEGIN, END) - // BEGIN: Noop - // JumpUnless(VALUE) - // PutDynamicComponentDefinitionOpcode - // OpenComponent - // CloseComponent - // Jump(END) - // VALUE: Noop - // OptimizedAppend - // END: Noop - // Exit - // - // Keep in mind that even if we *don't* reach here at initial render time, - // it is still possible (although quite rare) that the simple value we - // encounter during initial render could later change into a component - // definition object at update time. That is handled by the "lazy deopt" - // code on the update side (scroll down for the next big block of comment). - var buffer = new _glimmerRuntimeLibCompiler.CompileIntoList(env, null); - var dsl = new _glimmerRuntimeLibCompiledOpcodesBuilder.default(buffer, this.symbolTable, env); - dsl.putValue(this.expression); - dsl.test(IsComponentDefinitionReference.create); - dsl.block(null, function (dsl, BEGIN, END) { - dsl.jumpUnless('VALUE'); - dsl.putDynamicComponentDefinition(); - dsl.openComponent(_glimmerRuntimeLibSyntaxCore.Args.empty()); - dsl.closeComponent(); - dsl.jump(END); - dsl.label('VALUE'); - dsl.append(new _this.AppendOpcode()); - }); - var deopted = this.deopted = dsl.toOpSeq(); - // From this point on, we have essentially replaced ourselve with a new set - // of opcodes. Since we will always be executing the new/deopted code, it's - // a good idea (as a pattern) to null out any unneeded fields here to avoid - // holding on to unneeded/stale objects: - this.expression = null; - return deopted; - }; + var singleDesc = desc[key]; + if (typeof singleDesc === 'string') { + singleDesc = { as: singleDesc }; + } - GuardedAppendOpcode.prototype.toJSON = function toJSON() { - var guid = this._guid; - var type = this.type; - var deopted = this.deopted; - - if (deopted) { - return { - guid: guid, - type: type, - deopted: true, - children: deopted.toArray().map(function (op) { - return op.toJSON(); - }) - }; - } else { - return { - guid: guid, - type: type, - args: [this.expression.toJSON()] - }; - } - }; + tmp = accum[key] || { as: null, scope: 'model' }; + _emberUtils.assign(tmp, singleDesc); - return GuardedAppendOpcode; - })(AppendOpcode); + accum[key] = tmp; + } + } - exports.GuardedAppendOpcode = GuardedAppendOpcode; + /* + Check if a routeName resembles a url instead + + @private + */ + function resemblesURL(str) { + return typeof str === 'string' && (str === '' || str.charAt(0) === '/'); + } - var IsComponentDefinitionReference = (function (_ConditionalReference) { - babelHelpers.inherits(IsComponentDefinitionReference, _ConditionalReference); + /* + Returns an arguments array where the route name arg is prefixed based on the mount point + + @private + */ - function IsComponentDefinitionReference() { - _ConditionalReference.apply(this, arguments); - } + function prefixRouteNameArg(route, args) { + var routeName = args[0]; + var owner = _emberUtils.getOwner(route); + var prefix = owner.mountPoint; - IsComponentDefinitionReference.create = function create(inner) { - return new IsComponentDefinitionReference(inner); - }; + // only alter the routeName if it's actually referencing a route. + if (owner.routable && typeof routeName === 'string') { + if (resemblesURL(routeName)) { + throw new _emberMetal.Error('Programmatic transitions by URL cannot be used within an Engine. Please use the route name instead.'); + } else { + routeName = prefix + '.' + routeName; + args[0] = routeName; + } + } - IsComponentDefinitionReference.prototype.toBool = function toBool(value) { - return _glimmerRuntimeLibComponentInterfaces.isComponentDefinition(value); - }; + return args; + } +}); +enifed('ember-runtime/compare', ['exports', 'ember-runtime/utils', 'ember-runtime/mixins/comparable'], function (exports, _emberRuntimeUtils, _emberRuntimeMixinsComparable) { + 'use strict'; - return IsComponentDefinitionReference; - })(_glimmerRuntimeLibReferences.ConditionalReference); + exports.default = compare; - var UpdateOpcode = (function (_UpdatingOpcode) { - babelHelpers.inherits(UpdateOpcode, _UpdatingOpcode); + var TYPE_ORDER = { + 'undefined': 0, + 'null': 1, + 'boolean': 2, + 'number': 3, + 'string': 4, + 'array': 5, + 'object': 6, + 'instance': 7, + 'function': 8, + 'class': 9, + 'date': 10 + }; - function UpdateOpcode(cache, bounds, upsert) { - _UpdatingOpcode.call(this); - this.cache = cache; - this.bounds = bounds; - this.upsert = upsert; - this.tag = cache.tag; - } + // + // the spaceship operator + // + // `. ___ + // __,' __`. _..----....____ + // __...--.'``;. ,. ;``--..__ .' ,-._ _.-' + // _..-''-------' `' `' `' O ``-''._ (,;') _,' + // ,'________________ \`-._`-',' + // `._ ```````````------...___ '-.._'-: + // ```--.._ ,. ````--...__\-. + // `.--. `-` "INFINITY IS LESS ____ | |` + // `. `. THAN BEYOND" ,'`````. ; ;` + // `._`. __________ `. \'__/` + // `-:._____/______/___/____`. \ ` + // | `._ `. \ + // `._________`-. `. `.___ + // SSt `------'` + function spaceship(a, b) { + var diff = a - b; + return (diff > 0) - (diff < 0); + } - UpdateOpcode.prototype.evaluate = function evaluate(vm) { - var value = this.cache.revalidate(); - if (_glimmerReference.isModified(value)) { - var bounds = this.bounds; - var upsert = this.upsert; - var dom = vm.dom; + /** + Compares two javascript values and returns: + + - -1 if the first is smaller than the second, + - 0 if both are equal, + - 1 if the first is greater than the second. + + ```javascript + Ember.compare('hello', 'hello'); // 0 + Ember.compare('abc', 'dfg'); // -1 + Ember.compare(2, 1); // 1 + ``` + + If the types of the two objects are different precedence occurs in the + following order, with types earlier in the list considered `<` types + later in the list: + + - undefined + - null + - boolean + - number + - string + - array + - object + - instance + - function + - class + - date + + ```javascript + Ember.compare('hello', 50); // 1 + Ember.compare(50, 'hello'); // -1 + ``` + + @method compare + @for Ember + @param {Object} v First value to compare + @param {Object} w Second value to compare + @return {Number} -1 if v < w, 0 if v = w and 1 if v > w. + @public + */ - if (!this.upsert.update(dom, value)) { - var cursor = new _glimmerRuntimeLibBounds.Cursor(bounds.parentElement(), _glimmerRuntimeLibBounds.clear(bounds)); - upsert = this.upsert = this.insert(vm.env.getAppendOperations(), cursor, value); - } - bounds.update(upsert.bounds); - } - }; + function compare(v, w) { + if (v === w) { + return 0; + } - UpdateOpcode.prototype.toJSON = function toJSON() { - var guid = this._guid; - var type = this.type; - var cache = this.cache; + var type1 = _emberRuntimeUtils.typeOf(v); + var type2 = _emberRuntimeUtils.typeOf(w); - return { - guid: guid, - type: type, - details: { lastValue: JSON.stringify(cache.peek()) } - }; - }; + if (_emberRuntimeMixinsComparable.default) { + if (type1 === 'instance' && _emberRuntimeMixinsComparable.default.detect(v) && v.constructor.compare) { + return v.constructor.compare(v, w); + } - return UpdateOpcode; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + if (type2 === 'instance' && _emberRuntimeMixinsComparable.default.detect(w) && w.constructor.compare) { + return w.constructor.compare(w, v) * -1; + } + } - var GuardedUpdateOpcode = (function (_UpdateOpcode) { - babelHelpers.inherits(GuardedUpdateOpcode, _UpdateOpcode); + var res = spaceship(TYPE_ORDER[type1], TYPE_ORDER[type2]); - function GuardedUpdateOpcode(reference, cache, bounds, upsert, appendOpcode, state) { - _UpdateOpcode.call(this, cache, bounds, upsert); - this.reference = reference; - this.appendOpcode = appendOpcode; - this.state = state; - this.deopted = null; - this.tag = this._tag = new _glimmerReference.UpdatableTag(this.tag); - } + if (res !== 0) { + return res; + } - GuardedUpdateOpcode.prototype.evaluate = function evaluate(vm) { - if (this.deopted) { - vm.evaluateOpcode(this.deopted); - } else { - if (_glimmerRuntimeLibComponentInterfaces.isComponentDefinition(this.reference.value())) { - this.lazyDeopt(vm); - } else { - _UpdateOpcode.prototype.evaluate.call(this, vm); - } - } - }; + // types are equal - so we have to check values now + switch (type1) { + case 'boolean': + case 'number': + return spaceship(v, w); - GuardedUpdateOpcode.prototype.lazyDeopt = function lazyDeopt(vm) { - // Durign initial render, we know that the reference does not contain a - // component definition, so we optimistically assumed that this append - // is just a normal append. However, at update time, we discovered that - // the reference has switched into containing a component definition, so - // we need to do a "lazy deopt", simulating what would have happened if - // we had decided to perform the deopt in the first place during initial - // render. - // - // More concretely, we would have expanded the curly into a if/else, and - // based on whether the value is a component definition or not, we would - // have entered either the dynamic component branch or the simple value - // branch. - // - // Since we rendered a simple value during initial render (and all the - // updates up until this point), we need to pretend that the result is - // produced by the "VALUE" branch of the deopted append opcode: - // - // Try(BEGIN, END) - // Assert(IsComponentDefinition, expected=false) - // OptimizedUpdate - // - // In this case, because the reference has switched from being a simple - // value into a component definition, what would have happened is that - // the assert would throw, causing the Try opcode to teardown the bounds - // and rerun the original append opcode. - // - // Since the Try opcode would have nuked the updating opcodes anyway, we - // wouldn't have to worry about simulating those. All we have to do is to - // execute the Try opcode and immediately throw. - var bounds = this.bounds; - var appendOpcode = this.appendOpcode; - var state = this.state; - - var appendOps = appendOpcode.deopt(vm.env); - var enter = appendOps.head().next.next; - var ops = enter.slice; - var tracker = new _glimmerRuntimeLibBuilder.UpdatableBlockTracker(bounds.parentElement()); - tracker.newBounds(this.bounds); - var children = new _glimmerUtil.LinkedList(); - state.frame['condition'] = IsComponentDefinitionReference.create(state.frame['operand']); - var deopted = this.deopted = new _glimmerRuntimeLibVmUpdate.TryOpcode(ops, state, tracker, children); - this._tag.update(deopted.tag); - vm.evaluateOpcode(deopted); - vm.throw(); - // From this point on, we have essentially replaced ourselve with a new - // opcode. Since we will always be executing the new/deopted code, it's a - // good idea (as a pattern) to null out any unneeded fields here to avoid - // holding on to unneeded/stale objects: - this._tag = null; - this.reference = null; - this.cache = null; - this.bounds = null; - this.upsert = null; - this.appendOpcode = null; - this.state = null; - }; + case 'string': + return spaceship(v.localeCompare(w), 0); - GuardedUpdateOpcode.prototype.toJSON = function toJSON() { - var guid = this._guid; - var type = this.type; - var deopted = this.deopted; - - if (deopted) { - return { - guid: guid, - type: type, - deopted: true, - children: [deopted.toJSON()] - }; - } else { - return _UpdateOpcode.prototype.toJSON.call(this); + case 'array': + { + var vLen = v.length; + var wLen = w.length; + var len = Math.min(vLen, wLen); + + for (var i = 0; i < len; i++) { + var r = compare(v[i], w[i]); + if (r !== 0) { + return r; } - }; - - return GuardedUpdateOpcode; - })(UpdateOpcode); - - var OptimizedCautiousAppendOpcode = (function (_AppendOpcode2) { - babelHelpers.inherits(OptimizedCautiousAppendOpcode, _AppendOpcode2); + } - function OptimizedCautiousAppendOpcode() { - _AppendOpcode2.apply(this, arguments); - this.type = 'optimized-cautious-append'; + // all elements are equal now + // shorter array should be ordered first + return spaceship(vLen, wLen); } - - OptimizedCautiousAppendOpcode.prototype.normalize = function normalize(reference) { - return _glimmerReference.map(reference, normalizeValue); - }; - - OptimizedCautiousAppendOpcode.prototype.insert = function insert(dom, cursor, value) { - return _glimmerRuntimeLibUpsert.cautiousInsert(dom, cursor, value); - }; - - OptimizedCautiousAppendOpcode.prototype.updateWith = function updateWith(vm, reference, cache, bounds, upsert) { - return new OptimizedCautiousUpdateOpcode(cache, bounds, upsert); - }; - - return OptimizedCautiousAppendOpcode; - })(AppendOpcode); - - exports.OptimizedCautiousAppendOpcode = OptimizedCautiousAppendOpcode; - - var OptimizedCautiousUpdateOpcode = (function (_UpdateOpcode2) { - babelHelpers.inherits(OptimizedCautiousUpdateOpcode, _UpdateOpcode2); - - function OptimizedCautiousUpdateOpcode() { - _UpdateOpcode2.apply(this, arguments); - this.type = 'optimized-cautious-update'; + case 'instance': + if (_emberRuntimeMixinsComparable.default && _emberRuntimeMixinsComparable.default.detect(v)) { + return v.compare(v, w); } + return 0; - OptimizedCautiousUpdateOpcode.prototype.insert = function insert(dom, cursor, value) { - return _glimmerRuntimeLibUpsert.cautiousInsert(dom, cursor, value); - }; - - return OptimizedCautiousUpdateOpcode; - })(UpdateOpcode); - - var GuardedCautiousAppendOpcode = (function (_GuardedAppendOpcode) { - babelHelpers.inherits(GuardedCautiousAppendOpcode, _GuardedAppendOpcode); + case 'date': + return spaceship(v.getTime(), w.getTime()); - function GuardedCautiousAppendOpcode() { - _GuardedAppendOpcode.apply(this, arguments); - this.type = 'guarded-cautious-append'; - this.AppendOpcode = OptimizedCautiousAppendOpcode; - } + default: + return 0; + } + } +}); +enifed('ember-runtime/computed/computed_macros', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - GuardedCautiousAppendOpcode.prototype.normalize = function normalize(reference) { - return _glimmerReference.map(reference, normalizeValue); - }; + exports.empty = empty; + exports.notEmpty = notEmpty; + exports.none = none; + exports.not = not; + exports.bool = bool; + exports.match = match; + exports.equal = equal; + exports.gt = gt; + exports.gte = gte; + exports.lt = lt; + exports.lte = lte; + exports.oneWay = oneWay; + exports.readOnly = readOnly; + exports.deprecatingAlias = deprecatingAlias; - GuardedCautiousAppendOpcode.prototype.insert = function insert(dom, cursor, value) { - return _glimmerRuntimeLibUpsert.cautiousInsert(dom, cursor, value); - }; + /** + @module ember + @submodule ember-metal + */ - GuardedCautiousAppendOpcode.prototype.updateWith = function updateWith(vm, reference, cache, bounds, upsert) { - return new GuardedCautiousUpdateOpcode(reference, cache, bounds, upsert, this, vm.capture()); - }; + function expandPropertiesToArray(predicateName, properties) { + var expandedProperties = []; - return GuardedCautiousAppendOpcode; - })(GuardedAppendOpcode); + function extractProperty(entry) { + expandedProperties.push(entry); + } - exports.GuardedCautiousAppendOpcode = GuardedCautiousAppendOpcode; + for (var i = 0; i < properties.length; i++) { + var property = properties[i]; - var GuardedCautiousUpdateOpcode = (function (_GuardedUpdateOpcode) { - babelHelpers.inherits(GuardedCautiousUpdateOpcode, _GuardedUpdateOpcode); + _emberMetal.expandProperties(property, extractProperty); + } - function GuardedCautiousUpdateOpcode() { - _GuardedUpdateOpcode.apply(this, arguments); - this.type = 'guarded-cautious-update'; - } + return expandedProperties; + } - GuardedCautiousUpdateOpcode.prototype.insert = function insert(dom, cursor, value) { - return _glimmerRuntimeLibUpsert.cautiousInsert(dom, cursor, value); - }; + function generateComputedWithPredicate(name, predicate) { + return function () { + for (var _len = arguments.length, properties = Array(_len), _key = 0; _key < _len; _key++) { + properties[_key] = arguments[_key]; + } - return GuardedCautiousUpdateOpcode; - })(GuardedUpdateOpcode); + var expandedProperties = expandPropertiesToArray(name, properties); - var OptimizedTrustingAppendOpcode = (function (_AppendOpcode3) { - babelHelpers.inherits(OptimizedTrustingAppendOpcode, _AppendOpcode3); + var computedFunc = _emberMetal.computed(function () { + var lastIdx = expandedProperties.length - 1; - function OptimizedTrustingAppendOpcode() { - _AppendOpcode3.apply(this, arguments); - this.type = 'optimized-trusting-append'; + for (var i = 0; i < lastIdx; i++) { + var value = _emberMetal.get(this, expandedProperties[i]); + if (!predicate(value)) { + return value; + } } - OptimizedTrustingAppendOpcode.prototype.normalize = function normalize(reference) { - return _glimmerReference.map(reference, normalizeTrustedValue); - }; + return _emberMetal.get(this, expandedProperties[lastIdx]); + }); - OptimizedTrustingAppendOpcode.prototype.insert = function insert(dom, cursor, value) { - return _glimmerRuntimeLibUpsert.trustingInsert(dom, cursor, value); - }; + return computedFunc.property.apply(computedFunc, expandedProperties); + }; + } - OptimizedTrustingAppendOpcode.prototype.updateWith = function updateWith(vm, reference, cache, bounds, upsert) { - return new OptimizedTrustingUpdateOpcode(cache, bounds, upsert); - }; + /** + A computed property that returns true if the value of the dependent + property is null, an empty string, empty array, or empty function. + + Example + + ```javascript + let ToDoList = Ember.Object.extend({ + isDone: Ember.computed.empty('todos') + }); + + let todoList = ToDoList.create({ + todos: ['Unit Test', 'Documentation', 'Release'] + }); + + todoList.get('isDone'); // false + todoList.get('todos').clear(); + todoList.get('isDone'); // true + ``` + + @since 1.6.0 + @method empty + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which negate + the original value for property + @public + */ - return OptimizedTrustingAppendOpcode; - })(AppendOpcode); + function empty(dependentKey) { + return _emberMetal.computed(dependentKey + '.length', function () { + return _emberMetal.isEmpty(_emberMetal.get(this, dependentKey)); + }); + } - exports.OptimizedTrustingAppendOpcode = OptimizedTrustingAppendOpcode; + /** + A computed property that returns true if the value of the dependent + property is NOT null, an empty string, empty array, or empty function. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + hasStuff: Ember.computed.notEmpty('backpack') + }); + + let hamster = Hamster.create({ backpack: ['Food', 'Sleeping Bag', 'Tent'] }); + + hamster.get('hasStuff'); // true + hamster.get('backpack').clear(); // [] + hamster.get('hasStuff'); // false + ``` + + @method notEmpty + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which returns true if + original value for property is not empty. + @public + */ - var OptimizedTrustingUpdateOpcode = (function (_UpdateOpcode3) { - babelHelpers.inherits(OptimizedTrustingUpdateOpcode, _UpdateOpcode3); + function notEmpty(dependentKey) { + return _emberMetal.computed(dependentKey + '.length', function () { + return !_emberMetal.isEmpty(_emberMetal.get(this, dependentKey)); + }); + } - function OptimizedTrustingUpdateOpcode() { - _UpdateOpcode3.apply(this, arguments); - this.type = 'optimized-trusting-update'; - } + /** + A computed property that returns true if the value of the dependent + property is null or undefined. This avoids errors from JSLint complaining + about use of ==, which can be technically confusing. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + isHungry: Ember.computed.none('food') + }); + + let hamster = Hamster.create(); + + hamster.get('isHungry'); // true + hamster.set('food', 'Banana'); + hamster.get('isHungry'); // false + hamster.set('food', null); + hamster.get('isHungry'); // true + ``` + + @method none + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which + returns true if original value for property is null or undefined. + @public + */ - OptimizedTrustingUpdateOpcode.prototype.insert = function insert(dom, cursor, value) { - return _glimmerRuntimeLibUpsert.trustingInsert(dom, cursor, value); - }; + function none(dependentKey) { + return _emberMetal.computed(dependentKey, function () { + return _emberMetal.isNone(_emberMetal.get(this, dependentKey)); + }); + } - return OptimizedTrustingUpdateOpcode; - })(UpdateOpcode); + /** + A computed property that returns the inverse boolean value + of the original value for the dependent property. + + Example + + ```javascript + let User = Ember.Object.extend({ + isAnonymous: Ember.computed.not('loggedIn') + }); + + let user = User.create({loggedIn: false}); + + user.get('isAnonymous'); // true + user.set('loggedIn', true); + user.get('isAnonymous'); // false + ``` + + @method not + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which returns + inverse of the original value for property + @public + */ - var GuardedTrustingAppendOpcode = (function (_GuardedAppendOpcode2) { - babelHelpers.inherits(GuardedTrustingAppendOpcode, _GuardedAppendOpcode2); + function not(dependentKey) { + return _emberMetal.computed(dependentKey, function () { + return !_emberMetal.get(this, dependentKey); + }); + } - function GuardedTrustingAppendOpcode() { - _GuardedAppendOpcode2.apply(this, arguments); - this.type = 'guarded-trusting-append'; - this.AppendOpcode = OptimizedTrustingAppendOpcode; - } + /** + A computed property that converts the provided dependent property + into a boolean value. + + ```javascript + let Hamster = Ember.Object.extend({ + hasBananas: Ember.computed.bool('numBananas') + }); + + let hamster = Hamster.create(); + + hamster.get('hasBananas'); // false + hamster.set('numBananas', 0); + hamster.get('hasBananas'); // false + hamster.set('numBananas', 1); + hamster.get('hasBananas'); // true + hamster.set('numBananas', null); + hamster.get('hasBananas'); // false + ``` + + @method bool + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which converts + to boolean the original value for property + @public + */ - GuardedTrustingAppendOpcode.prototype.normalize = function normalize(reference) { - return _glimmerReference.map(reference, normalizeTrustedValue); - }; + function bool(dependentKey) { + return _emberMetal.computed(dependentKey, function () { + return !!_emberMetal.get(this, dependentKey); + }); + } - GuardedTrustingAppendOpcode.prototype.insert = function insert(dom, cursor, value) { - return _glimmerRuntimeLibUpsert.trustingInsert(dom, cursor, value); - }; + /** + A computed property which matches the original value for the + dependent property against a given RegExp, returning `true` + if the value matches the RegExp and `false` if it does not. + + Example + + ```javascript + let User = Ember.Object.extend({ + hasValidEmail: Ember.computed.match('email', /^.+@.+\..+$/) + }); + + let user = User.create({loggedIn: false}); + + user.get('hasValidEmail'); // false + user.set('email', ''); + user.get('hasValidEmail'); // false + user.set('email', 'ember_hamster@example.com'); + user.get('hasValidEmail'); // true + ``` + + @method match + @for Ember.computed + @param {String} dependentKey + @param {RegExp} regexp + @return {Ember.ComputedProperty} computed property which match + the original value for property against a given RegExp + @public + */ - GuardedTrustingAppendOpcode.prototype.updateWith = function updateWith(vm, reference, cache, bounds, upsert) { - return new GuardedTrustingUpdateOpcode(reference, cache, bounds, upsert, this, vm.capture()); - }; + function match(dependentKey, regexp) { + return _emberMetal.computed(dependentKey, function () { + var value = _emberMetal.get(this, dependentKey); - return GuardedTrustingAppendOpcode; - })(GuardedAppendOpcode); + return typeof value === 'string' ? regexp.test(value) : false; + }); + } - exports.GuardedTrustingAppendOpcode = GuardedTrustingAppendOpcode; + /** + A computed property that returns true if the provided dependent property + is equal to the given value. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + satisfied: Ember.computed.equal('percentCarrotsEaten', 100) + }); + + let hamster = Hamster.create(); + + hamster.get('satisfied'); // false + hamster.set('percentCarrotsEaten', 100); + hamster.get('satisfied'); // true + hamster.set('percentCarrotsEaten', 50); + hamster.get('satisfied'); // false + ``` + + @method equal + @for Ember.computed + @param {String} dependentKey + @param {String|Number|Object} value + @return {Ember.ComputedProperty} computed property which returns true if + the original value for property is equal to the given value. + @public + */ - var GuardedTrustingUpdateOpcode = (function (_GuardedUpdateOpcode2) { - babelHelpers.inherits(GuardedTrustingUpdateOpcode, _GuardedUpdateOpcode2); + function equal(dependentKey, value) { + return _emberMetal.computed(dependentKey, function () { + return _emberMetal.get(this, dependentKey) === value; + }); + } - function GuardedTrustingUpdateOpcode() { - _GuardedUpdateOpcode2.apply(this, arguments); - this.type = 'trusting-update'; - } + /** + A computed property that returns true if the provided dependent property + is greater than the provided value. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + hasTooManyBananas: Ember.computed.gt('numBananas', 10) + }); + + let hamster = Hamster.create(); + + hamster.get('hasTooManyBananas'); // false + hamster.set('numBananas', 3); + hamster.get('hasTooManyBananas'); // false + hamster.set('numBananas', 11); + hamster.get('hasTooManyBananas'); // true + ``` + + @method gt + @for Ember.computed + @param {String} dependentKey + @param {Number} value + @return {Ember.ComputedProperty} computed property which returns true if + the original value for property is greater than given value. + @public + */ - GuardedTrustingUpdateOpcode.prototype.insert = function insert(dom, cursor, value) { - return _glimmerRuntimeLibUpsert.trustingInsert(dom, cursor, value); - }; + function gt(dependentKey, value) { + return _emberMetal.computed(dependentKey, function () { + return _emberMetal.get(this, dependentKey) > value; + }); + } - return GuardedTrustingUpdateOpcode; - })(GuardedUpdateOpcode); -}); + /** + A computed property that returns true if the provided dependent property + is greater than or equal to the provided value. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + hasTooManyBananas: Ember.computed.gte('numBananas', 10) + }); + + let hamster = Hamster.create(); + + hamster.get('hasTooManyBananas'); // false + hamster.set('numBananas', 3); + hamster.get('hasTooManyBananas'); // false + hamster.set('numBananas', 10); + hamster.get('hasTooManyBananas'); // true + ``` + + @method gte + @for Ember.computed + @param {String} dependentKey + @param {Number} value + @return {Ember.ComputedProperty} computed property which returns true if + the original value for property is greater or equal then given value. + @public + */ -enifed('glimmer-runtime/lib/compiled/opcodes/dom', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/compiled/opcodes/vm'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibReferences, _glimmerRuntimeLibCompiledOpcodesVm) { - 'use strict'; + function gte(dependentKey, value) { + return _emberMetal.computed(dependentKey, function () { + return _emberMetal.get(this, dependentKey) >= value; + }); + } - var TextOpcode = (function (_Opcode) { - babelHelpers.inherits(TextOpcode, _Opcode); + /** + A computed property that returns true if the provided dependent property + is less than the provided value. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + needsMoreBananas: Ember.computed.lt('numBananas', 3) + }); + + let hamster = Hamster.create(); + + hamster.get('needsMoreBananas'); // true + hamster.set('numBananas', 3); + hamster.get('needsMoreBananas'); // false + hamster.set('numBananas', 2); + hamster.get('needsMoreBananas'); // true + ``` + + @method lt + @for Ember.computed + @param {String} dependentKey + @param {Number} value + @return {Ember.ComputedProperty} computed property which returns true if + the original value for property is less then given value. + @public + */ - function TextOpcode(text) { - _Opcode.call(this); - this.text = text; - this.type = "text"; - } + function lt(dependentKey, value) { + return _emberMetal.computed(dependentKey, function () { + return _emberMetal.get(this, dependentKey) < value; + }); + } - TextOpcode.prototype.evaluate = function evaluate(vm) { - vm.stack().appendText(this.text); - }; + /** + A computed property that returns true if the provided dependent property + is less than or equal to the provided value. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + needsMoreBananas: Ember.computed.lte('numBananas', 3) + }); + + let hamster = Hamster.create(); + + hamster.get('needsMoreBananas'); // true + hamster.set('numBananas', 5); + hamster.get('needsMoreBananas'); // false + hamster.set('numBananas', 3); + hamster.get('needsMoreBananas'); // true + ``` + + @method lte + @for Ember.computed + @param {String} dependentKey + @param {Number} value + @return {Ember.ComputedProperty} computed property which returns true if + the original value for property is less or equal than given value. + @public + */ - TextOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.text)] - }; - }; + function lte(dependentKey, value) { + return _emberMetal.computed(dependentKey, function () { + return _emberMetal.get(this, dependentKey) <= value; + }); + } - return TextOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + A computed property that performs a logical `and` on the + original values for the provided dependent properties. + + You may pass in more than two properties and even use + property brace expansion. The computed property will + return the first falsy value or last truthy value + just like JavaScript's `&&` operator. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + readyForCamp: Ember.computed.and('hasTent', 'hasBackpack'), + readyForHike: Ember.computed.and('hasWalkingStick', 'hasBackpack') + }); + + let tomster = Hamster.create(); + + tomster.get('readyForCamp'); // false + tomster.set('hasTent', true); + tomster.get('readyForCamp'); // false + tomster.set('hasBackpack', true); + tomster.get('readyForCamp'); // true + tomster.set('hasBackpack', 'Yes'); + tomster.get('readyForCamp'); // 'Yes' + tomster.set('hasWalkingStick', null); + tomster.get('readyForHike'); // null + ``` + + @method and + @for Ember.computed + @param {String} dependentKey* + @return {Ember.ComputedProperty} computed property which performs + a logical `and` on the values of all the original values for properties. + @public + */ + var and = generateComputedWithPredicate('and', function (value) { + return value; + }); - exports.TextOpcode = TextOpcode; + exports.and = and; + /** + A computed property which performs a logical `or` on the + original values for the provided dependent properties. + + You may pass in more than two properties and even use + property brace expansion. The computed property will + return the first truthy value or last falsy value just + like JavaScript's `||` operator. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + readyForRain: Ember.computed.or('hasJacket', 'hasUmbrella'), + readyForBeach: Ember.computed.or('{hasSunscreen,hasUmbrella}') + }); + + let tomster = Hamster.create(); + + tomster.get('readyForRain'); // undefined + tomster.set('hasUmbrella', true); + tomster.get('readyForRain'); // true + tomster.set('hasJacket', 'Yes'); + tomster.get('readyForRain'); // 'Yes' + tomster.set('hasSunscreen', 'Check'); + tomster.get('readyForBeach'); // 'Check' + ``` + + @method or + @for Ember.computed + @param {String} dependentKey* + @return {Ember.ComputedProperty} computed property which performs + a logical `or` on the values of all the original values for properties. + @public + */ + var or = generateComputedWithPredicate('or', function (value) { + return !value; + }); - var OpenPrimitiveElementOpcode = (function (_Opcode2) { - babelHelpers.inherits(OpenPrimitiveElementOpcode, _Opcode2); + exports.or = or; + /** + Creates a new property that is an alias for another property + on an object. Calls to `get` or `set` this property behave as + though they were called on the original property. + + ```javascript + let Person = Ember.Object.extend({ + name: 'Alex Matchneer', + nomen: Ember.computed.alias('name') + }); + + let alex = Person.create(); + + alex.get('nomen'); // 'Alex Matchneer' + alex.get('name'); // 'Alex Matchneer' + + alex.set('nomen', '@machty'); + alex.get('name'); // '@machty' + ``` + + @method alias + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which creates an + alias to the original value for property. + @public + */ - function OpenPrimitiveElementOpcode(tag) { - _Opcode2.call(this); - this.tag = tag; - this.type = "open-primitive-element"; - } + /** + Where `computed.alias` aliases `get` and `set`, and allows for bidirectional + data flow, `computed.oneWay` only provides an aliased `get`. The `set` will + not mutate the upstream property, rather causes the current property to + become the value set. This causes the downstream property to permanently + diverge from the upstream property. + + Example + + ```javascript + let User = Ember.Object.extend({ + firstName: null, + lastName: null, + nickName: Ember.computed.oneWay('firstName') + }); + + let teddy = User.create({ + firstName: 'Teddy', + lastName: 'Zeenny' + }); + + teddy.get('nickName'); // 'Teddy' + teddy.set('nickName', 'TeddyBear'); // 'TeddyBear' + teddy.get('firstName'); // 'Teddy' + ``` + + @method oneWay + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which creates a + one way computed property to the original value for property. + @public + */ - OpenPrimitiveElementOpcode.prototype.evaluate = function evaluate(vm) { - vm.stack().openElement(this.tag); - }; + function oneWay(dependentKey) { + return _emberMetal.alias(dependentKey).oneWay(); + } - OpenPrimitiveElementOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.tag)] - }; - }; + /** + This is a more semantically meaningful alias of `computed.oneWay`, + whose name is somewhat ambiguous as to which direction the data flows. + + @method reads + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which creates a + one way computed property to the original value for property. + @public + */ - return OpenPrimitiveElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + Where `computed.oneWay` provides oneWay bindings, `computed.readOnly` provides + a readOnly one way binding. Very often when using `computed.oneWay` one does + not also want changes to propagate back up, as they will replace the value. + + This prevents the reverse flow, and also throws an exception when it occurs. + + Example + + ```javascript + let User = Ember.Object.extend({ + firstName: null, + lastName: null, + nickName: Ember.computed.readOnly('firstName') + }); + + let teddy = User.create({ + firstName: 'Teddy', + lastName: 'Zeenny' + }); + + teddy.get('nickName'); // 'Teddy' + teddy.set('nickName', 'TeddyBear'); // throws Exception + // throw new Ember.Error('Cannot Set: nickName on: ' );` + teddy.get('firstName'); // 'Teddy' + ``` + + @method readOnly + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computed property which creates a + one way computed property to the original value for property. + @since 1.5.0 + @public + */ - exports.OpenPrimitiveElementOpcode = OpenPrimitiveElementOpcode; + function readOnly(dependentKey) { + return _emberMetal.alias(dependentKey).readOnly(); + } - var PushRemoteElementOpcode = (function (_Opcode3) { - babelHelpers.inherits(PushRemoteElementOpcode, _Opcode3); + /** + Creates a new property that is an alias for another property + on an object. Calls to `get` or `set` this property behave as + though they were called on the original property, but also + print a deprecation warning. + + ```javascript + let Hamster = Ember.Object.extend({ + bananaCount: Ember.computed.deprecatingAlias('cavendishCount', { + id: 'hamster.deprecate-banana', + until: '3.0.0' + }) + }); + + let hamster = Hamster.create(); + + hamster.set('bananaCount', 5); // Prints a deprecation warning. + hamster.get('cavendishCount'); // 5 + ``` + + @method deprecatingAlias + @for Ember.computed + @param {String} dependentKey + @param {Object} options Options for `Ember.deprecate`. + @return {Ember.ComputedProperty} computed property which creates an + alias with a deprecation to the original value for property. + @since 1.7.0 + @public + */ - function PushRemoteElementOpcode() { - _Opcode3.apply(this, arguments); - this.type = "push-remote-element"; - } + function deprecatingAlias(dependentKey, options) { + return _emberMetal.computed(dependentKey, { + get: function (key) { + return _emberMetal.get(this, dependentKey); + }, + set: function (key, value) { + _emberMetal.set(this, dependentKey, value); + return value; + } + }); + } +}); +enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/compare', 'ember-runtime/utils', 'ember-runtime/system/native_array'], function (exports, _emberUtils, _emberMetal, _emberRuntimeCompare, _emberRuntimeUtils, _emberRuntimeSystemNative_array) { + /** + @module ember + @submodule ember-runtime + */ - PushRemoteElementOpcode.prototype.evaluate = function evaluate(vm) { - var reference = vm.frame.getOperand(); - var cache = _glimmerReference.isConst(reference) ? undefined : new _glimmerReference.ReferenceCache(reference); - var element = cache ? cache.peek() : reference.value(); - vm.stack().pushRemoteElement(element); - if (cache) { - vm.updateWith(new _glimmerRuntimeLibCompiledOpcodesVm.Assert(cache)); - } - }; + 'use strict'; - PushRemoteElementOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ['$OPERAND'] - }; - }; + exports.sum = sum; + exports.max = max; + exports.min = min; + exports.map = map; + exports.mapBy = mapBy; + exports.filter = filter; + exports.filterBy = filterBy; + exports.uniq = uniq; + exports.uniqBy = uniqBy; + exports.intersect = intersect; + exports.setDiff = setDiff; + exports.collect = collect; + exports.sort = sort; - return PushRemoteElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + function reduceMacro(dependentKey, callback, initialValue) { + return _emberMetal.computed(dependentKey + '.[]', function () { + var _this = this; - exports.PushRemoteElementOpcode = PushRemoteElementOpcode; + var arr = _emberMetal.get(this, dependentKey); - var PopRemoteElementOpcode = (function (_Opcode4) { - babelHelpers.inherits(PopRemoteElementOpcode, _Opcode4); + if (arr === null || typeof arr !== 'object') { + return initialValue; + } - function PopRemoteElementOpcode() { - _Opcode4.apply(this, arguments); - this.type = "pop-remote-element"; - } + return arr.reduce(function (previousValue, currentValue, index, array) { + return callback.call(_this, previousValue, currentValue, index, array); + }, initialValue); + }).readOnly(); + } - PopRemoteElementOpcode.prototype.evaluate = function evaluate(vm) { - vm.stack().popRemoteElement(); - }; + function arrayMacro(dependentKey, callback) { + // This is a bit ugly + var propertyName = undefined; + if (/@each/.test(dependentKey)) { + propertyName = dependentKey.replace(/\.@each.*$/, ''); + } else { + propertyName = dependentKey; + dependentKey += '.[]'; + } - return PopRemoteElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return _emberMetal.computed(dependentKey, function () { + var value = _emberMetal.get(this, propertyName); + if (_emberRuntimeUtils.isArray(value)) { + return _emberRuntimeSystemNative_array.A(callback.call(this, value)); + } else { + return _emberRuntimeSystemNative_array.A(); + } + }).readOnly(); + } - exports.PopRemoteElementOpcode = PopRemoteElementOpcode; + function multiArrayMacro(dependentKeys, callback) { + var args = dependentKeys.map(function (key) { + return key + '.[]'; + }); - var OpenComponentElementOpcode = (function (_Opcode5) { - babelHelpers.inherits(OpenComponentElementOpcode, _Opcode5); + args.push(function () { + return _emberRuntimeSystemNative_array.A(callback.call(this, dependentKeys)); + }); - function OpenComponentElementOpcode(tag) { - _Opcode5.call(this); - this.tag = tag; - this.type = "open-component-element"; - } + return _emberMetal.computed.apply(this, args).readOnly(); + } - OpenComponentElementOpcode.prototype.evaluate = function evaluate(vm) { - vm.stack().openElement(this.tag, new ComponentElementOperations(vm.env)); - }; + /** + A computed property that returns the sum of the values + in the dependent array. + + @method sum + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computes the sum of all values in the dependentKey's array + @since 1.4.0 + @public + */ - OpenComponentElementOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.tag)] - }; - }; + function sum(dependentKey) { + return reduceMacro(dependentKey, function (sum, item) { + return sum + item; + }, 0); + } - return OpenComponentElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + A computed property that calculates the maximum value in the + dependent array. This will return `-Infinity` when the dependent + array is empty. + + ```javascript + let Person = Ember.Object.extend({ + childAges: Ember.computed.mapBy('children', 'age'), + maxChildAge: Ember.computed.max('childAges') + }); + + let lordByron = Person.create({ children: [] }); + + lordByron.get('maxChildAge'); // -Infinity + lordByron.get('children').pushObject({ + name: 'Augusta Ada Byron', age: 7 + }); + lordByron.get('maxChildAge'); // 7 + lordByron.get('children').pushObjects([{ + name: 'Allegra Byron', + age: 5 + }, { + name: 'Elizabeth Medora Leigh', + age: 8 + }]); + lordByron.get('maxChildAge'); // 8 + ``` + + If the types of the arguments are not numbers, + they will be converted to numbers and the type + of the return value will always be `Number`. + For example, the max of a list of Date objects will be + the highest timestamp as a `Number`. + This behavior is consistent with `Math.max`. + + @method max + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computes the largest value in the dependentKey's array + @public + */ - exports.OpenComponentElementOpcode = OpenComponentElementOpcode; + function max(dependentKey) { + return reduceMacro(dependentKey, function (max, item) { + return Math.max(max, item); + }, -Infinity); + } - var OpenDynamicPrimitiveElementOpcode = (function (_Opcode6) { - babelHelpers.inherits(OpenDynamicPrimitiveElementOpcode, _Opcode6); + /** + A computed property that calculates the minimum value in the + dependent array. This will return `Infinity` when the dependent + array is empty. + + ```javascript + let Person = Ember.Object.extend({ + childAges: Ember.computed.mapBy('children', 'age'), + minChildAge: Ember.computed.min('childAges') + }); + + let lordByron = Person.create({ children: [] }); + + lordByron.get('minChildAge'); // Infinity + lordByron.get('children').pushObject({ + name: 'Augusta Ada Byron', age: 7 + }); + lordByron.get('minChildAge'); // 7 + lordByron.get('children').pushObjects([{ + name: 'Allegra Byron', + age: 5 + }, { + name: 'Elizabeth Medora Leigh', + age: 8 + }]); + lordByron.get('minChildAge'); // 5 + ``` + + If the types of the arguments are not numbers, + they will be converted to numbers and the type + of the return value will always be `Number`. + For example, the min of a list of Date objects will be + the lowest timestamp as a `Number`. + This behavior is consistent with `Math.min`. + + @method min + @for Ember.computed + @param {String} dependentKey + @return {Ember.ComputedProperty} computes the smallest value in the dependentKey's array + @public + */ - function OpenDynamicPrimitiveElementOpcode() { - _Opcode6.apply(this, arguments); - this.type = "open-dynamic-primitive-element"; - } + function min(dependentKey) { + return reduceMacro(dependentKey, function (min, item) { + return Math.min(min, item); + }, Infinity); + } - OpenDynamicPrimitiveElementOpcode.prototype.evaluate = function evaluate(vm) { - var tagName = vm.frame.getOperand().value(); - vm.stack().openElement(tagName); - }; + /** + Returns an array mapped via the callback + + The callback method you provide should have the following signature. + `item` is the current item in the iteration. + `index` is the integer index of the current item in the iteration. + + ```javascript + function(item, index); + ``` + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + excitingChores: Ember.computed.map('chores', function(chore, index) { + return chore.toUpperCase() + '!'; + }) + }); + + let hamster = Hamster.create({ + chores: ['clean', 'write more unit tests'] + }); + + hamster.get('excitingChores'); // ['CLEAN!', 'WRITE MORE UNIT TESTS!'] + ``` + + @method map + @for Ember.computed + @param {String} dependentKey + @param {Function} callback + @return {Ember.ComputedProperty} an array mapped via the callback + @public + */ - OpenDynamicPrimitiveElementOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$OPERAND"] - }; - }; + function map(dependentKey, callback) { + return arrayMacro(dependentKey, function (value) { + return value.map(callback, this); + }); + } - return OpenDynamicPrimitiveElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + Returns an array mapped to the specified key. + + ```javascript + let Person = Ember.Object.extend({ + childAges: Ember.computed.mapBy('children', 'age') + }); + + let lordByron = Person.create({ children: [] }); + + lordByron.get('childAges'); // [] + lordByron.get('children').pushObject({ name: 'Augusta Ada Byron', age: 7 }); + lordByron.get('childAges'); // [7] + lordByron.get('children').pushObjects([{ + name: 'Allegra Byron', + age: 5 + }, { + name: 'Elizabeth Medora Leigh', + age: 8 + }]); + lordByron.get('childAges'); // [7, 5, 8] + ``` + + @method mapBy + @for Ember.computed + @param {String} dependentKey + @param {String} propertyKey + @return {Ember.ComputedProperty} an array mapped to the specified key + @public + */ - exports.OpenDynamicPrimitiveElementOpcode = OpenDynamicPrimitiveElementOpcode; + function mapBy(dependentKey, propertyKey) { - var ClassList = (function () { - function ClassList() { - this.list = null; - this.isConst = true; - } + return map(dependentKey + '.@each.' + propertyKey, function (item) { + return _emberMetal.get(item, propertyKey); + }); + } - ClassList.prototype.append = function append(reference) { - var list = this.list; - var isConst = this.isConst; + /** + Filters the array by the callback. + + The callback method you provide should have the following signature. + `item` is the current item in the iteration. + `index` is the integer index of the current item in the iteration. + `array` is the dependant array itself. + + ```javascript + function(item, index, array); + ``` + + ```javascript + let Hamster = Ember.Object.extend({ + remainingChores: Ember.computed.filter('chores', function(chore, index, array) { + return !chore.done; + }) + }); + + let hamster = Hamster.create({ + chores: [ + { name: 'cook', done: true }, + { name: 'clean', done: true }, + { name: 'write more unit tests', done: false } + ] + }); + + hamster.get('remainingChores'); // [{name: 'write more unit tests', done: false}] + ``` + + @method filter + @for Ember.computed + @param {String} dependentKey + @param {Function} callback + @return {Ember.ComputedProperty} the filtered array + @public + */ - if (list === null) list = this.list = []; - list.push(reference); - this.isConst = isConst && _glimmerReference.isConst(reference); - }; + function filter(dependentKey, callback) { + return arrayMacro(dependentKey, function (value) { + return value.filter(callback, this); + }); + } - ClassList.prototype.toReference = function toReference() { - var list = this.list; - var isConst = this.isConst; + /** + Filters the array by the property and value + + ```javascript + let Hamster = Ember.Object.extend({ + remainingChores: Ember.computed.filterBy('chores', 'done', false) + }); + + let hamster = Hamster.create({ + chores: [ + { name: 'cook', done: true }, + { name: 'clean', done: true }, + { name: 'write more unit tests', done: false } + ] + }); + + hamster.get('remainingChores'); // [{ name: 'write more unit tests', done: false }] + ``` + + @method filterBy + @for Ember.computed + @param {String} dependentKey + @param {String} propertyKey + @param {*} value + @return {Ember.ComputedProperty} the filtered array + @public + */ - if (!list) return _glimmerRuntimeLibReferences.NULL_REFERENCE; - if (isConst) return _glimmerRuntimeLibReferences.PrimitiveReference.create(toClassName(list)); - return new ClassListReference(list); - }; + function filterBy(dependentKey, propertyKey, value) { + var callback = undefined; - return ClassList; - })(); + if (arguments.length === 2) { + callback = function (item) { + return _emberMetal.get(item, propertyKey); + }; + } else { + callback = function (item) { + return _emberMetal.get(item, propertyKey) === value; + }; + } - var ClassListReference = (function (_CachedReference) { - babelHelpers.inherits(ClassListReference, _CachedReference); + return filter(dependentKey + '.@each.' + propertyKey, callback); + } - function ClassListReference(list) { - _CachedReference.call(this); - this.list = []; - this.tag = _glimmerReference.combineTagged(list); - this.list = list; - } + /** + A computed property which returns a new array with all the unique + elements from one or more dependent arrays. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + uniqueFruits: Ember.computed.uniq('fruits') + }); + + let hamster = Hamster.create({ + fruits: [ + 'banana', + 'grape', + 'kale', + 'banana' + ] + }); + + hamster.get('uniqueFruits'); // ['banana', 'grape', 'kale'] + ``` + + @method uniq + @for Ember.computed + @param {String} propertyKey* + @return {Ember.ComputedProperty} computes a new array with all the + unique elements from the dependent array + @public + */ - ClassListReference.prototype.compute = function compute() { - return toClassName(this.list); - }; + function uniq() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - return ClassListReference; - })(_glimmerReference.CachedReference); + return multiArrayMacro(args, function (dependentKeys) { + var _this2 = this; - function toClassName(list) { - var ret = []; - for (var i = 0; i < list.length; i++) { - var value = list[i].value(); - if (value !== false && value !== null && value !== undefined) ret.push(value); - } - return ret.length === 0 ? null : ret.join(' '); - } + var uniq = _emberRuntimeSystemNative_array.A(); - var SimpleElementOperations = (function () { - function SimpleElementOperations(env) { - this.env = env; - this.opcodes = null; - this.classList = null; + dependentKeys.forEach(function (dependentKey) { + var value = _emberMetal.get(_this2, dependentKey); + if (_emberRuntimeUtils.isArray(value)) { + value.forEach(function (item) { + if (uniq.indexOf(item) === -1) { + uniq.push(item); + } + }); } + }); - SimpleElementOperations.prototype.addStaticAttribute = function addStaticAttribute(element, name, value) { - if (name === 'class') { - this.addClass(_glimmerRuntimeLibReferences.PrimitiveReference.create(value)); - } else { - this.env.getAppendOperations().setAttribute(element, name, value); - } - }; + return uniq; + }); + } - SimpleElementOperations.prototype.addStaticAttributeNS = function addStaticAttributeNS(element, namespace, name, value) { - this.env.getAppendOperations().setAttribute(element, name, value, namespace); - }; + /** + A computed property which returns a new array with all the unique + elements from an array, with uniqueness determined by specific key. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + uniqueFruits: Ember.computed.uniqBy('fruits', 'id') + }); + let hamster = Hamster.create({ + fruits: [ + { id: 1, 'banana' }, + { id: 2, 'grape' }, + { id: 3, 'peach' }, + { id: 1, 'banana' } + ] + }); + hamster.get('uniqueFruits'); // [ { id: 1, 'banana' }, { id: 2, 'grape' }, { id: 3, 'peach' }] + ``` + + @method uniqBy + @for Ember.computed + @param {String} dependentKey + @param {String} propertyKey + @return {Ember.ComputedProperty} computes a new array with all the + unique elements from the dependent array + @public + */ - SimpleElementOperations.prototype.addDynamicAttribute = function addDynamicAttribute(element, name, reference, isTrusting) { - if (name === 'class') { - this.addClass(reference); - } else { - var attributeManager = this.env.attributeFor(element, name, isTrusting); - var attribute = new DynamicAttribute(element, attributeManager, name, reference); - this.addAttribute(attribute); - } - }; + function uniqBy(dependentKey, propertyKey) { + return _emberMetal.computed(dependentKey + '.[]', function () { + var uniq = _emberRuntimeSystemNative_array.A(); + var seen = new _emberUtils.EmptyObject(); + var list = _emberMetal.get(this, dependentKey); + if (_emberRuntimeUtils.isArray(list)) { + list.forEach(function (item) { + var guid = _emberUtils.guidFor(_emberMetal.get(item, propertyKey)); + if (!(guid in seen)) { + seen[guid] = true; + uniq.push(item); + } + }); + } + return uniq; + }).readOnly(); + } - SimpleElementOperations.prototype.addDynamicAttributeNS = function addDynamicAttributeNS(element, namespace, name, reference, isTrusting) { - var attributeManager = this.env.attributeFor(element, name, isTrusting, namespace); - var nsAttribute = new DynamicAttribute(element, attributeManager, name, reference, namespace); - this.addAttribute(nsAttribute); - }; + /** + Alias for [Ember.computed.uniq](/api/#method_computed_uniq). + + @method union + @for Ember.computed + @param {String} propertyKey* + @return {Ember.ComputedProperty} computes a new array with all the + unique elements from the dependent array + @public + */ + var union = uniq; - SimpleElementOperations.prototype.flush = function flush(element, vm) { - var env = vm.env; - var opcodes = this.opcodes; - var classList = this.classList; + exports.union = union; + /** + A computed property which returns a new array with all the duplicated + elements from two or more dependent arrays. + + Example + + ```javascript + let obj = Ember.Object.extend({ + friendsInCommon: Ember.computed.intersect('adaFriends', 'charlesFriends') + }).create({ + adaFriends: ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'], + charlesFriends: ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock'] + }); + + obj.get('friendsInCommon'); // ['William King', 'Mary Somerville'] + ``` + + @method intersect + @for Ember.computed + @param {String} propertyKey* + @return {Ember.ComputedProperty} computes a new array with all the + duplicated elements from the dependent arrays + @public + */ - for (var i = 0; opcodes && i < opcodes.length; i++) { - vm.updateWith(opcodes[i]); - } - if (classList) { - var attributeManager = env.attributeFor(element, 'class', false); - var attribute = new DynamicAttribute(element, attributeManager, 'class', classList.toReference()); - var opcode = attribute.flush(env); - if (opcode) { - vm.updateWith(opcode); - } - } - this.opcodes = null; - this.classList = null; - }; + function intersect() { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - SimpleElementOperations.prototype.addClass = function addClass(reference) { - var classList = this.classList; + return multiArrayMacro(args, function (dependentKeys) { + var _this3 = this; - if (!classList) { - classList = this.classList = new ClassList(); - } - classList.append(reference); - }; + var arrays = dependentKeys.map(function (dependentKey) { + var array = _emberMetal.get(_this3, dependentKey); - SimpleElementOperations.prototype.addAttribute = function addAttribute(attribute) { - var opcode = attribute.flush(this.env); - if (opcode) { - var opcodes = this.opcodes; + return _emberRuntimeUtils.isArray(array) ? array : []; + }); - if (!opcodes) { - opcodes = this.opcodes = []; - } - opcodes.push(opcode); + var results = arrays.pop().filter(function (candidate) { + for (var i = 0; i < arrays.length; i++) { + var found = false; + var array = arrays[i]; + for (var j = 0; j < array.length; j++) { + if (array[j] === candidate) { + found = true; + break; } - }; - - return SimpleElementOperations; - })(); - - exports.SimpleElementOperations = SimpleElementOperations; + } - var ComponentElementOperations = (function () { - function ComponentElementOperations(env) { - this.env = env; - this.attributeNames = null; - this.attributes = null; - this.classList = null; + if (found === false) { + return false; + } } - ComponentElementOperations.prototype.addStaticAttribute = function addStaticAttribute(element, name, value) { - if (name === 'class') { - this.addClass(_glimmerRuntimeLibReferences.PrimitiveReference.create(value)); - } else if (this.shouldAddAttribute(name)) { - this.addAttribute(name, new StaticAttribute(element, name, value)); - } - }; - - ComponentElementOperations.prototype.addStaticAttributeNS = function addStaticAttributeNS(element, namespace, name, value) { - if (this.shouldAddAttribute(name)) { - this.addAttribute(name, new StaticAttribute(element, name, value, namespace)); - } - }; - - ComponentElementOperations.prototype.addDynamicAttribute = function addDynamicAttribute(element, name, reference, isTrusting) { - if (name === 'class') { - this.addClass(reference); - } else if (this.shouldAddAttribute(name)) { - var attributeManager = this.env.attributeFor(element, name, isTrusting); - var attribute = new DynamicAttribute(element, attributeManager, name, reference); - this.addAttribute(name, attribute); - } - }; - - ComponentElementOperations.prototype.addDynamicAttributeNS = function addDynamicAttributeNS(element, namespace, name, reference, isTrusting) { - if (this.shouldAddAttribute(name)) { - var attributeManager = this.env.attributeFor(element, name, isTrusting, namespace); - var nsAttribute = new DynamicAttribute(element, attributeManager, name, reference, namespace); - this.addAttribute(name, nsAttribute); - } - }; - - ComponentElementOperations.prototype.flush = function flush(element, vm) { - var env = this.env; - var attributes = this.attributes; - var classList = this.classList; + return true; + }); - for (var i = 0; attributes && i < attributes.length; i++) { - var opcode = attributes[i].flush(env); - if (opcode) { - vm.updateWith(opcode); - } - } - if (classList) { - var attributeManager = env.attributeFor(element, 'class', false); - var attribute = new DynamicAttribute(element, attributeManager, 'class', classList.toReference()); - var opcode = attribute.flush(env); - if (opcode) { - vm.updateWith(opcode); - } - } - }; + return _emberRuntimeSystemNative_array.A(results); + }); + } - ComponentElementOperations.prototype.shouldAddAttribute = function shouldAddAttribute(name) { - return !this.attributeNames || this.attributeNames.indexOf(name) === -1; - }; + /** + A computed property which returns a new array with all the + properties from the first dependent array that are not in the second + dependent array. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + likes: ['banana', 'grape', 'kale'], + wants: Ember.computed.setDiff('likes', 'fruits') + }); + + let hamster = Hamster.create({ + fruits: [ + 'grape', + 'kale', + ] + }); + + hamster.get('wants'); // ['banana'] + ``` + + @method setDiff + @for Ember.computed + @param {String} setAProperty + @param {String} setBProperty + @return {Ember.ComputedProperty} computes a new array with all the + items from the first dependent array that are not in the second + dependent array + @public + */ - ComponentElementOperations.prototype.addClass = function addClass(reference) { - var classList = this.classList; + function setDiff(setAProperty, setBProperty) { + if (arguments.length !== 2) { + throw new _emberMetal.Error('setDiff requires exactly two dependent arrays.'); + } - if (!classList) { - classList = this.classList = new ClassList(); - } - classList.append(reference); - }; + return _emberMetal.computed(setAProperty + '.[]', setBProperty + '.[]', function () { + var setA = this.get(setAProperty); + var setB = this.get(setBProperty); - ComponentElementOperations.prototype.addAttribute = function addAttribute(name, attribute) { - var attributeNames = this.attributeNames; - var attributes = this.attributes; + if (!_emberRuntimeUtils.isArray(setA)) { + return _emberRuntimeSystemNative_array.A(); + } + if (!_emberRuntimeUtils.isArray(setB)) { + return _emberRuntimeSystemNative_array.A(setA); + } - if (!attributeNames) { - attributeNames = this.attributeNames = []; - attributes = this.attributes = []; - } - attributeNames.push(name); - attributes.push(attribute); - }; + return setA.filter(function (x) { + return setB.indexOf(x) === -1; + }); + }).readOnly(); + } - return ComponentElementOperations; - })(); + /** + A computed property that returns the array of values + for the provided dependent properties. + + Example + + ```javascript + let Hamster = Ember.Object.extend({ + clothes: Ember.computed.collect('hat', 'shirt') + }); + + let hamster = Hamster.create(); + + hamster.get('clothes'); // [null, null] + hamster.set('hat', 'Camp Hat'); + hamster.set('shirt', 'Camp Shirt'); + hamster.get('clothes'); // ['Camp Hat', 'Camp Shirt'] + ``` + + @method collect + @for Ember.computed + @param {String} dependentKey* + @return {Ember.ComputedProperty} computed property which maps + values of all passed in properties to an array. + @public + */ - exports.ComponentElementOperations = ComponentElementOperations; + function collect() { + for (var _len3 = arguments.length, dependentKeys = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + dependentKeys[_key3] = arguments[_key3]; + } - var FlushElementOpcode = (function (_Opcode7) { - babelHelpers.inherits(FlushElementOpcode, _Opcode7); + return multiArrayMacro(dependentKeys, function () { + var properties = _emberMetal.getProperties(this, dependentKeys); + var res = _emberRuntimeSystemNative_array.A(); + for (var key in properties) { + if (properties.hasOwnProperty(key)) { + if (_emberMetal.isNone(properties[key])) { + res.push(null); + } else { + res.push(properties[key]); + } + } + } + return res; + }); + } - function FlushElementOpcode() { - _Opcode7.apply(this, arguments); - this.type = "flush-element"; + /** + A computed property which returns a new array with all the + properties from the first dependent array sorted based on a property + or sort function. + + The callback method you provide should have the following signature: + + ```javascript + function(itemA, itemB); + ``` + + - `itemA` the first item to compare. + - `itemB` the second item to compare. + + This function should return negative number (e.g. `-1`) when `itemA` should come before + `itemB`. It should return positive number (e.g. `1`) when `itemA` should come after + `itemB`. If the `itemA` and `itemB` are equal this function should return `0`. + + Therefore, if this function is comparing some numeric values, simple `itemA - itemB` or + `itemA.get( 'foo' ) - itemB.get( 'foo' )` can be used instead of series of `if`. + + Example + + ```javascript + let ToDoList = Ember.Object.extend({ + // using standard ascending sort + todosSorting: ['name'], + sortedTodos: Ember.computed.sort('todos', 'todosSorting'), + + // using descending sort + todosSortingDesc: ['name:desc'], + sortedTodosDesc: Ember.computed.sort('todos', 'todosSortingDesc'), + + // using a custom sort function + priorityTodos: Ember.computed.sort('todos', function(a, b){ + if (a.priority > b.priority) { + return 1; + } else if (a.priority < b.priority) { + return -1; } + + return 0; + }) + }); + + let todoList = ToDoList.create({todos: [ + { name: 'Unit Test', priority: 2 }, + { name: 'Documentation', priority: 3 }, + { name: 'Release', priority: 1 } + ]}); + + todoList.get('sortedTodos'); // [{ name:'Documentation', priority:3 }, { name:'Release', priority:1 }, { name:'Unit Test', priority:2 }] + todoList.get('sortedTodosDesc'); // [{ name:'Unit Test', priority:2 }, { name:'Release', priority:1 }, { name:'Documentation', priority:3 }] + todoList.get('priorityTodos'); // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }] + ``` + + @method sort + @for Ember.computed + @param {String} itemsKey + @param {String or Function} sortDefinition a dependent key to an + array of sort properties (add `:desc` to the arrays sort properties to sort descending) or a function to use when sorting + @return {Ember.ComputedProperty} computes a new sorted array based + on the sort property array or callback function + @public + */ - FlushElementOpcode.prototype.evaluate = function evaluate(vm) { - var stack = vm.stack(); - stack.operations.flush(stack.constructing, vm); - stack.flushElement(); - }; + function sort(itemsKey, sortDefinition) { - return FlushElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + if (typeof sortDefinition === 'function') { + return customSort(itemsKey, sortDefinition); + } else { + return propertySort(itemsKey, sortDefinition); + } + } - exports.FlushElementOpcode = FlushElementOpcode; + function customSort(itemsKey, comparator) { + return arrayMacro(itemsKey, function (value) { + var _this4 = this; - var CloseElementOpcode = (function (_Opcode8) { - babelHelpers.inherits(CloseElementOpcode, _Opcode8); + return value.slice().sort(function (x, y) { + return comparator.call(_this4, x, y); + }); + }); + } - function CloseElementOpcode() { - _Opcode8.apply(this, arguments); - this.type = "close-element"; - } + // This one needs to dynamically set up and tear down observers on the itemsKey + // depending on the sortProperties + function propertySort(itemsKey, sortPropertiesKey) { + var cp = new _emberMetal.ComputedProperty(function (key) { + var _this5 = this; - CloseElementOpcode.prototype.evaluate = function evaluate(vm) { - vm.stack().closeElement(); - }; + var itemsKeyIsAtThis = itemsKey === '@this'; + var sortProperties = _emberMetal.get(this, sortPropertiesKey); - return CloseElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + var normalizedSortProperties = normalizeSortProperties(sortProperties); - exports.CloseElementOpcode = CloseElementOpcode; + // Add/remove property observers as required. + var activeObserversMap = cp._activeObserverMap || (cp._activeObserverMap = new _emberMetal.WeakMap()); + var activeObservers = activeObserversMap.get(this); - var PopElementOpcode = (function (_Opcode9) { - babelHelpers.inherits(PopElementOpcode, _Opcode9); + if (activeObservers) { + activeObservers.forEach(function (args) { + return _emberMetal.removeObserver.apply(undefined, args); + }); + } - function PopElementOpcode() { - _Opcode9.apply(this, arguments); - this.type = "pop-element"; - } + function sortPropertyDidChange() { + this.notifyPropertyChange(key); + } - PopElementOpcode.prototype.evaluate = function evaluate(vm) { - vm.stack().popElement(); - }; + activeObservers = normalizedSortProperties.map(function (_ref) { + var prop = _ref[0]; - return PopElementOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + var path = itemsKeyIsAtThis ? '@each.' + prop : itemsKey + '.@each.' + prop; + var args = [_this5, path, sortPropertyDidChange]; + _emberMetal.addObserver.apply(undefined, args); + return args; + }); - exports.PopElementOpcode = PopElementOpcode; + activeObserversMap.set(this, activeObservers); - var StaticAttrOpcode = (function (_Opcode10) { - babelHelpers.inherits(StaticAttrOpcode, _Opcode10); + // Sort and return the array. + var items = itemsKeyIsAtThis ? this : _emberMetal.get(this, itemsKey); - function StaticAttrOpcode(namespace, name, value) { - _Opcode10.call(this); - this.namespace = namespace; - this.name = name; - this.value = value; - this.type = "static-attr"; - } + if (_emberRuntimeUtils.isArray(items)) { + return sortByNormalizedSortProperties(items, normalizedSortProperties); + } else { + return _emberRuntimeSystemNative_array.A(); + } + }); - StaticAttrOpcode.prototype.evaluate = function evaluate(vm) { - var name = this.name; - var value = this.value; - var namespace = this.namespace; + cp._activeObserverMap = undefined; - if (namespace) { - vm.stack().setStaticAttributeNS(namespace, name, value); - } else { - vm.stack().setStaticAttribute(name, value); - } - }; + return cp.property(sortPropertiesKey + '.[]').readOnly(); + } - StaticAttrOpcode.prototype.toJSON = function toJSON() { - var guid = this._guid; - var type = this.type; - var namespace = this.namespace; - var name = this.name; - var value = this.value; + function normalizeSortProperties(sortProperties) { + return sortProperties.map(function (p) { + var _p$split = p.split(':'); - var details = _glimmerUtil.dict(); - if (namespace) { - details["namespace"] = JSON.stringify(namespace); - } - details["name"] = JSON.stringify(name); - details["value"] = JSON.stringify(value); - return { guid: guid, type: type, details: details }; - }; + var prop = _p$split[0]; + var direction = _p$split[1]; - return StaticAttrOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + direction = direction || 'asc'; - exports.StaticAttrOpcode = StaticAttrOpcode; + return [prop, direction]; + }); + } - var ModifierOpcode = (function (_Opcode11) { - babelHelpers.inherits(ModifierOpcode, _Opcode11); + function sortByNormalizedSortProperties(items, normalizedSortProperties) { + return _emberRuntimeSystemNative_array.A(items.slice().sort(function (itemA, itemB) { + for (var i = 0; i < normalizedSortProperties.length; i++) { + var _normalizedSortProperties$i = normalizedSortProperties[i]; + var prop = _normalizedSortProperties$i[0]; + var direction = _normalizedSortProperties$i[1]; - function ModifierOpcode(name, manager, args) { - _Opcode11.call(this); - this.name = name; - this.manager = manager; - this.args = args; - this.type = "modifier"; + var result = _emberRuntimeCompare.default(_emberMetal.get(itemA, prop), _emberMetal.get(itemB, prop)); + if (result !== 0) { + return direction === 'desc' ? -1 * result : result; } + } - ModifierOpcode.prototype.evaluate = function evaluate(vm) { - var manager = this.manager; + return 0; + })); + } +}); +enifed('ember-runtime/controllers/controller', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/mixins/controller', 'ember-runtime/inject', 'ember-runtime/mixins/action_handler'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeMixinsController, _emberRuntimeInject, _emberRuntimeMixinsAction_handler) { + 'use strict'; - var stack = vm.stack(); - var element = stack.constructing; - var updateOperations = stack.updateOperations; + /** + @module ember + @submodule ember-runtime + */ - var args = this.args.evaluate(vm); - var dynamicScope = vm.dynamicScope(); - var modifier = manager.create(element, args, dynamicScope, updateOperations); - vm.env.scheduleInstallModifier(modifier, manager); - var destructor = manager.getDestructor(modifier); - if (destructor) { - vm.newDestroyable(destructor); - } - vm.updateWith(new UpdateModifierOpcode(manager, modifier, args)); - }; + /** + @class Controller + @namespace Ember + @extends Ember.Object + @uses Ember.ControllerMixin + @public + */ + var Controller = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsController.default); - ModifierOpcode.prototype.toJSON = function toJSON() { - var guid = this._guid; - var type = this.type; - var name = this.name; - var args = this.args; - - var details = _glimmerUtil.dict(); - details["type"] = JSON.stringify(type); - details["name"] = JSON.stringify(name); - details["args"] = JSON.stringify(args); - return { guid: guid, type: type, details: details }; - }; + _emberRuntimeMixinsAction_handler.deprecateUnderscoreActions(Controller); - return ModifierOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + function controllerInjectionHelper(factory) {} - exports.ModifierOpcode = ModifierOpcode; + /** + Creates a property that lazily looks up another controller in the container. + Can only be used when defining another controller. + + Example: + + ```javascript + App.PostController = Ember.Controller.extend({ + posts: Ember.inject.controller() + }); + ``` + + This example will create a `posts` property on the `post` controller that + looks up the `posts` controller in the container, making it easy to + reference other controllers. This is functionally equivalent to: + + ```javascript + App.PostController = Ember.Controller.extend({ + needs: 'posts', + posts: Ember.computed.alias('controllers.posts') + }); + ``` + + @method controller + @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 + @public + */ + _emberRuntimeInject.createInjectionHelper('controller', controllerInjectionHelper); - var UpdateModifierOpcode = (function (_UpdatingOpcode) { - babelHelpers.inherits(UpdateModifierOpcode, _UpdatingOpcode); + exports.default = Controller; +}); +enifed('ember-runtime/copy', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/mixins/copyable'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeMixinsCopyable) { + 'use strict'; - function UpdateModifierOpcode(manager, modifier, args) { - _UpdatingOpcode.call(this); - this.manager = manager; - this.modifier = modifier; - this.args = args; - this.type = "update-modifier"; - this.tag = args.tag; - this.lastUpdated = args.tag.value(); - } + exports.default = copy; - UpdateModifierOpcode.prototype.evaluate = function evaluate(vm) { - var manager = this.manager; - var modifier = this.modifier; - var tag = this.tag; - var lastUpdated = this.lastUpdated; + function _copy(obj, deep, seen, copies) { + var ret = undefined, + loc = undefined, + key = undefined; - if (!tag.validate(lastUpdated)) { - vm.env.scheduleUpdateModifier(modifier, manager); - this.lastUpdated = tag.value(); - } - }; + // primitive data types are immutable, just return them. + if (typeof obj !== 'object' || obj === null) { + return obj; + } - UpdateModifierOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.args)] - }; - }; + // avoid cyclical loops + if (deep && (loc = seen.indexOf(obj)) >= 0) { + return copies[loc]; + } - return UpdateModifierOpcode; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + // IMPORTANT: this specific test will detect a native array only. Any other + // object will need to implement Copyable. + if (Array.isArray(obj)) { + ret = obj.slice(); - exports.UpdateModifierOpcode = UpdateModifierOpcode; + if (deep) { + loc = ret.length; - var StaticAttribute = (function () { - function StaticAttribute(element, name, value, namespace) { - this.element = element; - this.name = name; - this.value = value; - this.namespace = namespace; + while (--loc >= 0) { + ret[loc] = _copy(ret[loc], deep, seen, copies); } + } + } else if (_emberRuntimeMixinsCopyable.default && _emberRuntimeMixinsCopyable.default.detect(obj)) { + ret = obj.copy(deep, seen, copies); + } else if (obj instanceof Date) { + ret = new Date(obj.getTime()); + } else { + ret = {}; - StaticAttribute.prototype.flush = function flush(env) { - env.getAppendOperations().setAttribute(this.element, this.name, this.value, this.namespace); - return null; - }; + for (key in obj) { + // support Null prototype + if (!Object.prototype.hasOwnProperty.call(obj, key)) { + continue; + } - return StaticAttribute; - })(); + // Prevents browsers that don't respect non-enumerability from + // copying internal Ember properties + if (key.substring(0, 2) === '__') { + continue; + } - exports.StaticAttribute = StaticAttribute; + ret[key] = deep ? _copy(obj[key], deep, seen, copies) : obj[key]; + } + } - var DynamicAttribute = (function () { - function DynamicAttribute(element, attributeManager, name, reference, namespace) { - this.element = element; - this.attributeManager = attributeManager; - this.name = name; - this.reference = reference; - this.namespace = namespace; - this.tag = reference.tag; - this.cache = null; - } + if (deep) { + seen.push(obj); + copies.push(ret); + } - DynamicAttribute.prototype.patch = function patch(env) { - var element = this.element; - var cache = this.cache; + return ret; + } - var value = cache.revalidate(); - if (_glimmerReference.isModified(value)) { - this.attributeManager.updateAttribute(env, element, value, this.namespace); - } - }; + /** + Creates a shallow copy of the passed object. A deep copy of the object is + returned if the optional `deep` argument is `true`. + + If the passed object implements the `Ember.Copyable` interface, then this + function will delegate to the object's `copy()` method and return the + result. See `Ember.Copyable` for further details. + + For primitive values (which are immutable in JavaScript), the passed object + is simply returned. + + @method copy + @for Ember + @param {Object} obj The object to clone + @param {Boolean} [deep=false] If true, a deep copy of the object is made. + @return {Object} The copied object + @public + */ - DynamicAttribute.prototype.flush = function flush(env) { - var reference = this.reference; - var element = this.element; + function copy(obj, deep) { + // fast paths + if ('object' !== typeof obj || obj === null) { + return obj; // can't copy primitives + } - if (_glimmerReference.isConst(reference)) { - var value = reference.value(); - this.attributeManager.setAttribute(env, element, value, this.namespace); - return null; - } else { - var cache = this.cache = new _glimmerReference.ReferenceCache(reference); - var value = cache.peek(); - this.attributeManager.setAttribute(env, element, value, this.namespace); - return new PatchElementOpcode(this); - } - }; + if (_emberRuntimeMixinsCopyable.default && _emberRuntimeMixinsCopyable.default.detect(obj)) { + return obj.copy(deep); + } - DynamicAttribute.prototype.toJSON = function toJSON() { - var element = this.element; - var namespace = this.namespace; - var name = this.name; - var cache = this.cache; - - var formattedElement = formatElement(element); - var lastValue = cache.peek(); - if (namespace) { - return { - element: formattedElement, - type: 'attribute', - namespace: namespace, - name: name, - lastValue: lastValue - }; - } - return { - element: formattedElement, - type: 'attribute', - namespace: namespace, - name: name, - lastValue: lastValue - }; - }; + return _copy(obj, deep, deep ? [] : null, deep ? [] : null); + } +}); +enifed('ember-runtime/ext/function', ['exports', 'ember-environment', 'ember-metal'], function (exports, _emberEnvironment, _emberMetal) { + /** + @module ember + @submodule ember-runtime + */ - return DynamicAttribute; - })(); + 'use strict'; - exports.DynamicAttribute = DynamicAttribute; + var a_slice = Array.prototype.slice; + var FunctionPrototype = Function.prototype; - function formatElement(element) { - return JSON.stringify('<' + element.tagName.toLowerCase() + ' />'); - } + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.Function) { + /** + The `property` extension of Javascript's Function prototype is available + when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is + `true`, which is the default. + Computed properties allow you to treat a function like a property: + ```javascript + MyApp.President = Ember.Object.extend({ + firstName: '', + lastName: '', + fullName: function() { + return this.get('firstName') + ' ' + this.get('lastName'); + }.property() // Call this flag to mark the function as a property + }); + let president = MyApp.President.create({ + firstName: 'Barack', + lastName: 'Obama' + }); + president.get('fullName'); // 'Barack Obama' + ``` + Treating a function like a property is useful because they can work with + bindings, just like any other property. + Many computed properties have dependencies on other properties. For + example, in the above example, the `fullName` property depends on + `firstName` and `lastName` to determine its value. You can tell Ember + about these dependencies like this: + ```javascript + MyApp.President = Ember.Object.extend({ + firstName: '', + lastName: '', + fullName: function() { + return this.get('firstName') + ' ' + this.get('lastName'); + // Tell Ember.js that this computed property depends on firstName + // and lastName + }.property('firstName', 'lastName') + }); + ``` + 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/classes/Ember.computed.html). + @method property + @for Function + @public + */ + FunctionPrototype.property = function () { + var ret = _emberMetal.computed(this); + // ComputedProperty.prototype.property expands properties; no need for us to + // do so here. + return ret.property.apply(ret, arguments); + }; - var DynamicAttrNSOpcode = (function (_Opcode12) { - babelHelpers.inherits(DynamicAttrNSOpcode, _Opcode12); + /** + The `observes` extension of Javascript's Function prototype is available + when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is + true, which is the default. + You can observe property changes simply by adding the `observes` + call to the end of your method declarations in classes that you write. + For example: + ```javascript + Ember.Object.extend({ + valueObserver: function() { + // Executes whenever the "value" property changes + }.observes('value') + }); + ``` + In the future this method may become asynchronous. + See `Ember.observer`. + @method observes + @for Function + @public + */ + FunctionPrototype.observes = function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - function DynamicAttrNSOpcode(name, namespace, isTrusting) { - _Opcode12.call(this); - this.name = name; - this.namespace = namespace; - this.isTrusting = isTrusting; - this.type = "dynamic-attr"; - } + args.push(this); + return _emberMetal.observer.apply(this, args); + }; - DynamicAttrNSOpcode.prototype.evaluate = function evaluate(vm) { - var name = this.name; - var namespace = this.namespace; - var isTrusting = this.isTrusting; + FunctionPrototype._observesImmediately = function () { - var reference = vm.frame.getOperand(); - vm.stack().setDynamicAttributeNS(namespace, name, reference, isTrusting); - }; + // observes handles property expansion + return this.observes.apply(this, arguments); + }; + /** + The `observesImmediately` extension of Javascript's Function prototype is + available when `EmberENV.EXTEND_PROTOTYPES` or + `EmberENV.EXTEND_PROTOTYPES.Function` is true, which is the default. + You can observe property changes simply by adding the `observesImmediately` + call to the end of your method declarations in classes that you write. + For example: + ```javascript + Ember.Object.extend({ + valueObserver: function() { + // Executes immediately after the "value" property changes + }.observesImmediately('value') + }); + ``` + In the future, `observes` may become asynchronous. In this event, + `observesImmediately` will maintain the synchronous behavior. + See `Ember.immediateObserver`. + @method observesImmediately + @for Function + @deprecated + @private + */ + FunctionPrototype.observesImmediately = _emberMetal.deprecateFunc('Function#observesImmediately is deprecated. Use Function#observes instead', { id: 'ember-runtime.ext-function', until: '3.0.0' }, FunctionPrototype._observesImmediately); - DynamicAttrNSOpcode.prototype.toJSON = function toJSON() { - var guid = this._guid; - var type = this.type; - var name = this.name; - var namespace = this.namespace; - - var details = _glimmerUtil.dict(); - details["name"] = JSON.stringify(name); - details["value"] = "$OPERAND"; - if (namespace) { - details["namespace"] = JSON.stringify(namespace); - } - return { guid: guid, type: type, details: details }; - }; + /** + The `on` extension of Javascript's Function prototype is available + when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is + true, which is the default. + You can listen for events simply by adding the `on` call to the end of + your method declarations in classes or mixins that you write. For example: + ```javascript + Ember.Mixin.create({ + doSomethingWithElement: function() { + // Executes whenever the "didInsertElement" event fires + }.on('didInsertElement') + }); + ``` + See `Ember.on`. + @method on + @for Function + @public + */ + FunctionPrototype.on = function () { + var events = a_slice.call(arguments); + this.__ember_listens__ = events; - return DynamicAttrNSOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return this; + }; + } +}); +enifed('ember-runtime/ext/rsvp', ['exports', 'rsvp', 'ember-metal'], function (exports, _rsvp, _emberMetal) { + 'use strict'; - exports.DynamicAttrNSOpcode = DynamicAttrNSOpcode; + exports.onerrorDefault = onerrorDefault; - var DynamicAttrOpcode = (function (_Opcode13) { - babelHelpers.inherits(DynamicAttrOpcode, _Opcode13); + var backburner = _emberMetal.run.backburner; + _emberMetal.run._addQueue('rsvpAfter', 'destroy'); - function DynamicAttrOpcode(name, isTrusting) { - _Opcode13.call(this); - this.name = name; - this.isTrusting = isTrusting; - this.type = "dynamic-attr"; - } + _rsvp.configure('async', function (callback, promise) { + backburner.schedule('actions', null, callback, promise); + }); - DynamicAttrOpcode.prototype.evaluate = function evaluate(vm) { - var name = this.name; - var isTrusting = this.isTrusting; + _rsvp.configure('after', function (cb) { + backburner.schedule('rsvpAfter', null, cb); + }); - var reference = vm.frame.getOperand(); - vm.stack().setDynamicAttribute(name, reference, isTrusting); - }; + _rsvp.on('error', onerrorDefault); - DynamicAttrOpcode.prototype.toJSON = function toJSON() { - var guid = this._guid; - var type = this.type; - var name = this.name; + function onerrorDefault(reason) { + var error = errorFor(reason); + if (error) { + _emberMetal.dispatchError(error); + } + } - var details = _glimmerUtil.dict(); - details["name"] = JSON.stringify(name); - details["value"] = "$OPERAND"; - return { guid: guid, type: type, details: details }; - }; + function errorFor(reason) { + if (!reason) return; - return DynamicAttrOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + if (reason.errorThrown) { + return unwrapErrorThrown(reason); + } - exports.DynamicAttrOpcode = DynamicAttrOpcode; + if (reason.name === 'UnrecognizedURLError') { + return; + } - var PatchElementOpcode = (function (_UpdatingOpcode2) { - babelHelpers.inherits(PatchElementOpcode, _UpdatingOpcode2); + if (reason.name === 'TransitionAborted') { + return; + } - function PatchElementOpcode(operation) { - _UpdatingOpcode2.call(this); - this.type = "patch-element"; - this.tag = operation.tag; - this.operation = operation; - } + return reason; + } - PatchElementOpcode.prototype.evaluate = function evaluate(vm) { - this.operation.patch(vm.env); - }; + function unwrapErrorThrown(reason) { + var error = reason.errorThrown; + if (typeof error === 'string') { + error = new Error(error); + } + Object.defineProperty(error, '__reason_with_error_thrown__', { + value: reason, + enumerable: false + }); + return error; + } - PatchElementOpcode.prototype.toJSON = function toJSON() { - var _guid = this._guid; - var type = this.type; - var operation = this.operation; + exports.default = _rsvp; +}); +enifed('ember-runtime/ext/string', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { + /** + @module ember + @submodule ember-runtime + */ - return { - guid: _guid, - type: type, - details: operation.toJSON() - }; - }; + 'use strict'; - return PatchElementOpcode; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + var StringPrototype = String.prototype; - exports.PatchElementOpcode = PatchElementOpcode; + if (_emberEnvironment.ENV.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]; + } - var CommentOpcode = (function (_Opcode14) { - babelHelpers.inherits(CommentOpcode, _Opcode14); + return _emberRuntimeSystemString.fmt(this, args); + }; - function CommentOpcode(comment) { - _Opcode14.call(this); - this.comment = comment; - this.type = "comment"; - } + /** + See [Ember.String.w](/api/classes/Ember.String.html#method_w). + @method w + @for String + @private + */ + StringPrototype.w = function () { + return _emberRuntimeSystemString.w(this); + }; - CommentOpcode.prototype.evaluate = function evaluate(vm) { - vm.stack().appendComment(this.comment); - }; + /** + See [Ember.String.loc](/api/classes/Ember.String.html#method_loc). + @method loc + @for String + @private + */ + StringPrototype.loc = function () { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - CommentOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.comment)] - }; - }; + return _emberRuntimeSystemString.loc(this, args); + }; - return CommentOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + See [Ember.String.camelize](/api/classes/Ember.String.html#method_camelize). + @method camelize + @for String + @private + */ + StringPrototype.camelize = function () { + return _emberRuntimeSystemString.camelize(this); + }; - exports.CommentOpcode = CommentOpcode; -}); + /** + See [Ember.String.decamelize](/api/classes/Ember.String.html#method_decamelize). + @method decamelize + @for String + @private + */ + StringPrototype.decamelize = function () { + return _emberRuntimeSystemString.decamelize(this); + }; -enifed('glimmer-runtime/lib/compiled/opcodes/lists', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-util', 'glimmer-reference'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerUtil, _glimmerReference) { - 'use strict'; + /** + See [Ember.String.dasherize](/api/classes/Ember.String.html#method_dasherize). + @method dasherize + @for String + @private + */ + StringPrototype.dasherize = function () { + return _emberRuntimeSystemString.dasherize(this); + }; - var IterablePresenceReference = (function () { - function IterablePresenceReference(artifacts) { - this.tag = artifacts.tag; - this.artifacts = artifacts; - } + /** + See [Ember.String.underscore](/api/classes/Ember.String.html#method_underscore). + @method underscore + @for String + @private + */ + StringPrototype.underscore = function () { + return _emberRuntimeSystemString.underscore(this); + }; - IterablePresenceReference.prototype.value = function value() { - return !this.artifacts.isEmpty(); - }; + /** + See [Ember.String.classify](/api/classes/Ember.String.html#method_classify). + @method classify + @for String + @private + */ + StringPrototype.classify = function () { + return _emberRuntimeSystemString.classify(this); + }; - return IterablePresenceReference; - })(); + /** + See [Ember.String.capitalize](/api/classes/Ember.String.html#method_capitalize). + @method capitalize + @for String + @private + */ + StringPrototype.capitalize = function () { + return _emberRuntimeSystemString.capitalize(this); + }; + } +}); +enifed('ember-runtime/index', ['exports', 'ember-runtime/ext/string', 'ember-runtime/ext/function', 'ember-runtime/system/object', 'ember-runtime/system/string', 'ember-runtime/mixins/registry_proxy', 'ember-runtime/mixins/container_proxy', 'ember-runtime/copy', 'ember-runtime/inject', 'ember-runtime/compare', 'ember-runtime/is-equal', 'ember-runtime/mixins/array', 'ember-runtime/mixins/comparable', 'ember-runtime/system/namespace', 'ember-runtime/system/array_proxy', 'ember-runtime/system/object_proxy', 'ember-runtime/system/core_object', 'ember-runtime/system/native_array', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/copyable', 'ember-runtime/mixins/enumerable', 'ember-runtime/mixins/freezable', 'ember-runtime/mixins/-proxy', 'ember-runtime/system/lazy_load', 'ember-runtime/mixins/observable', '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/computed_macros', 'ember-runtime/computed/reduce_computed_macros', 'ember-runtime/controllers/controller', 'ember-runtime/mixins/controller', 'ember-runtime/system/service', 'ember-runtime/ext/rsvp', 'ember-runtime/utils', 'ember-runtime/string_registry'], function (exports, _emberRuntimeExtString, _emberRuntimeExtFunction, _emberRuntimeSystemObject, _emberRuntimeSystemString, _emberRuntimeMixinsRegistry_proxy, _emberRuntimeMixinsContainer_proxy, _emberRuntimeCopy, _emberRuntimeInject, _emberRuntimeCompare, _emberRuntimeIsEqual, _emberRuntimeMixinsArray, _emberRuntimeMixinsComparable, _emberRuntimeSystemNamespace, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemObject_proxy, _emberRuntimeSystemCore_object, _emberRuntimeSystemNative_array, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsFreezable, _emberRuntimeMixinsProxy, _emberRuntimeSystemLazy_load, _emberRuntimeMixinsObservable, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsTarget_action_support, _emberRuntimeMixinsEvented, _emberRuntimeMixinsPromise_proxy, _emberRuntimeComputedComputed_macros, _emberRuntimeComputedReduce_computed_macros, _emberRuntimeControllersController, _emberRuntimeMixinsController, _emberRuntimeSystemService, _emberRuntimeExtRsvp, _emberRuntimeUtils, _emberRuntimeString_registry) { + /** + @module ember + @submodule ember-runtime + */ - var PutIteratorOpcode = (function (_Opcode) { - babelHelpers.inherits(PutIteratorOpcode, _Opcode); + 'use strict'; - function PutIteratorOpcode() { - _Opcode.apply(this, arguments); - this.type = "put-iterator"; - } + exports.Object = _emberRuntimeSystemObject.default; + exports.FrameworkObject = _emberRuntimeSystemObject.FrameworkObject; + exports.String = _emberRuntimeSystemString.default; + exports.RegistryProxyMixin = _emberRuntimeMixinsRegistry_proxy.default; + exports.buildFakeRegistryWithDeprecations = _emberRuntimeMixinsRegistry_proxy.buildFakeRegistryWithDeprecations; + exports.ContainerProxyMixin = _emberRuntimeMixinsContainer_proxy.default; + exports.copy = _emberRuntimeCopy.default; + exports.inject = _emberRuntimeInject.default; + exports.compare = _emberRuntimeCompare.default; + exports.isEqual = _emberRuntimeIsEqual.default; + exports.Array = _emberRuntimeMixinsArray.default; + exports.objectAt = _emberRuntimeMixinsArray.objectAt; + exports.isEmberArray = _emberRuntimeMixinsArray.isEmberArray; + exports.addArrayObserver = _emberRuntimeMixinsArray.addArrayObserver; + exports.removeArrayObserver = _emberRuntimeMixinsArray.removeArrayObserver; + exports.Comparable = _emberRuntimeMixinsComparable.default; + exports.Namespace = _emberRuntimeSystemNamespace.default; + exports.isNamespaceSearchDisabled = _emberRuntimeSystemNamespace.isSearchDisabled; + exports.setNamespaceSearchDisabled = _emberRuntimeSystemNamespace.setSearchDisabled; + exports.ArrayProxy = _emberRuntimeSystemArray_proxy.default; + exports.ObjectProxy = _emberRuntimeSystemObject_proxy.default; + exports.CoreObject = _emberRuntimeSystemCore_object.default; + exports.NativeArray = _emberRuntimeSystemNative_array.default; + exports.A = _emberRuntimeSystemNative_array.A; + exports.ActionHandler = _emberRuntimeMixinsAction_handler.default; + exports.deprecateUnderscoreActions = _emberRuntimeMixinsAction_handler.deprecateUnderscoreActions; + exports.Copyable = _emberRuntimeMixinsCopyable.default; + exports.Enumerable = _emberRuntimeMixinsEnumerable.default; + exports.Freezable = _emberRuntimeMixinsFreezable.Freezable; + exports.FROZEN_ERROR = _emberRuntimeMixinsFreezable.FROZEN_ERROR; + exports._ProxyMixin = _emberRuntimeMixinsProxy.default; + exports.onLoad = _emberRuntimeSystemLazy_load.onLoad; + exports.runLoadHooks = _emberRuntimeSystemLazy_load.runLoadHooks; + exports._loaded = _emberRuntimeSystemLazy_load._loaded; + exports.Observable = _emberRuntimeMixinsObservable.default; + exports.MutableEnumerable = _emberRuntimeMixinsMutable_enumerable.default; + exports.MutableArray = _emberRuntimeMixinsMutable_array.default; + exports.removeAt = _emberRuntimeMixinsMutable_array.removeAt; + exports.TargetActionSupport = _emberRuntimeMixinsTarget_action_support.default; + exports.Evented = _emberRuntimeMixinsEvented.default; + exports.PromiseProxyMixin = _emberRuntimeMixinsPromise_proxy.default; + exports.empty = _emberRuntimeComputedComputed_macros.empty; + exports.notEmpty = _emberRuntimeComputedComputed_macros.notEmpty; + exports.none = _emberRuntimeComputedComputed_macros.none; + exports.not = _emberRuntimeComputedComputed_macros.not; + exports.bool = _emberRuntimeComputedComputed_macros.bool; + exports.match = _emberRuntimeComputedComputed_macros.match; + exports.equal = _emberRuntimeComputedComputed_macros.equal; + exports.gt = _emberRuntimeComputedComputed_macros.gt; + exports.gte = _emberRuntimeComputedComputed_macros.gte; + exports.lt = _emberRuntimeComputedComputed_macros.lt; + exports.lte = _emberRuntimeComputedComputed_macros.lte; + exports.oneWay = _emberRuntimeComputedComputed_macros.oneWay; + exports.readOnly = _emberRuntimeComputedComputed_macros.readOnly; + exports.deprecatingAlias = _emberRuntimeComputedComputed_macros.deprecatingAlias; + exports.and = _emberRuntimeComputedComputed_macros.and; + exports.or = _emberRuntimeComputedComputed_macros.or; + exports.sum = _emberRuntimeComputedReduce_computed_macros.sum; + exports.min = _emberRuntimeComputedReduce_computed_macros.min; + exports.max = _emberRuntimeComputedReduce_computed_macros.max; + exports.map = _emberRuntimeComputedReduce_computed_macros.map; + exports.sort = _emberRuntimeComputedReduce_computed_macros.sort; + exports.setDiff = _emberRuntimeComputedReduce_computed_macros.setDiff; + exports.mapBy = _emberRuntimeComputedReduce_computed_macros.mapBy; + exports.filter = _emberRuntimeComputedReduce_computed_macros.filter; + exports.filterBy = _emberRuntimeComputedReduce_computed_macros.filterBy; + exports.uniq = _emberRuntimeComputedReduce_computed_macros.uniq; + exports.uniqBy = _emberRuntimeComputedReduce_computed_macros.uniqBy; + exports.union = _emberRuntimeComputedReduce_computed_macros.union; + exports.intersect = _emberRuntimeComputedReduce_computed_macros.intersect; + exports.collect = _emberRuntimeComputedReduce_computed_macros.collect; + exports.Controller = _emberRuntimeControllersController.default; + exports.ControllerMixin = _emberRuntimeMixinsController.default; + exports.Service = _emberRuntimeSystemService.default; + exports.RSVP = _emberRuntimeExtRsvp.default; + exports.onerrorDefault = _emberRuntimeExtRsvp.onerrorDefault; + // just for side effect of extending Ember.RSVP + exports.isArray = _emberRuntimeUtils.isArray; + exports.typeOf = _emberRuntimeUtils.typeOf; + exports.getStrings = _emberRuntimeString_registry.getStrings; + exports.setStrings = _emberRuntimeString_registry.setStrings; +}); +// just for side effect of extending String.prototype +// just for side effect of extending Function.prototype +enifed('ember-runtime/inject', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - PutIteratorOpcode.prototype.evaluate = function evaluate(vm) { - var listRef = vm.frame.getOperand(); - var args = vm.frame.getArgs(); - var iterable = vm.env.iterableFor(listRef, args); - var iterator = new _glimmerReference.ReferenceIterator(iterable); - vm.frame.setIterator(iterator); - vm.frame.setCondition(new IterablePresenceReference(iterator.artifacts)); - }; + exports.default = inject; + exports.createInjectionHelper = createInjectionHelper; + exports.validatePropertyInjections = validatePropertyInjections; - return PutIteratorOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + Namespace for injection helper methods. + + @class inject + @namespace Ember + @static + @public + */ - exports.PutIteratorOpcode = PutIteratorOpcode; + function inject() {} - var EnterListOpcode = (function (_Opcode2) { - babelHelpers.inherits(EnterListOpcode, _Opcode2); + // Dictionary of injection validations by type, added to by `createInjectionHelper` + var typeValidators = {}; - function EnterListOpcode(start, end) { - _Opcode2.call(this); - this.type = "enter-list"; - this.slice = new _glimmerUtil.ListSlice(start, end); - } + /** + This method allows other Ember modules to register injection helpers for a + given container type. Helpers are exported to the `inject` namespace as the + container type itself. + + @private + @method createInjectionHelper + @since 1.10.0 + @for Ember + @param {String} type The container type the helper will inject + @param {Function} validator A validation callback that is executed at mixin-time + */ - EnterListOpcode.prototype.evaluate = function evaluate(vm) { - vm.enterList(this.slice); - }; + function createInjectionHelper(type, validator) { + typeValidators[type] = validator; - EnterListOpcode.prototype.toJSON = function toJSON() { - var slice = this.slice; - var type = this.type; - var _guid = this._guid; + inject[type] = function (name) { + return new _emberMetal.InjectedProperty(type, name); + }; + } - var begin = slice.head(); - var end = slice.tail(); - return { - guid: _guid, - type: type, - args: [JSON.stringify(begin.inspect()), JSON.stringify(end.inspect())] - }; - }; + /** + Validation function that runs per-type validation functions once for each + injected type encountered. + + @private + @method validatePropertyInjections + @since 1.10.0 + @for Ember + @param {Object} factory The factory object + */ - return EnterListOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + function validatePropertyInjections(factory) { + var proto = factory.proto(); + var types = []; - exports.EnterListOpcode = EnterListOpcode; + for (var key in proto) { + var desc = proto[key]; + if (desc instanceof _emberMetal.InjectedProperty && types.indexOf(desc.type) === -1) { + types.push(desc.type); + } + } - var ExitListOpcode = (function (_Opcode3) { - babelHelpers.inherits(ExitListOpcode, _Opcode3); + if (types.length) { + for (var i = 0; i < types.length; i++) { + var validator = typeValidators[types[i]]; - function ExitListOpcode() { - _Opcode3.apply(this, arguments); - this.type = "exit-list"; + if (typeof validator === 'function') { + validator(factory); } + } + } + + return true; + } +}); +enifed('ember-runtime/is-equal', ['exports'], function (exports) { + /** + Compares two objects, returning true if they are equal. + + ```javascript + Ember.isEqual('hello', 'hello'); // true + Ember.isEqual(1, 2); // false + ``` + + `isEqual` is a more specific comparison than a triple equal comparison. + It will call the `isEqual` instance method on the objects being + compared, allowing finer control over when objects should be considered + equal to each other. + + ```javascript + let Person = Ember.Object.extend({ + isEqual(other) { return this.ssn == other.ssn; } + }); + + let personA = Person.create({name: 'Muhammad Ali', ssn: '123-45-6789'}); + let personB = Person.create({name: 'Cassius Clay', ssn: '123-45-6789'}); + + Ember.isEqual(personA, personB); // true + ``` + + Due to the expense of array comparisons, collections will never be equal to + each other even if each of their items are equal to each other. + + ```javascript + Ember.isEqual([4, 2], [4, 2]); // false + ``` + + @method isEqual + @for Ember + @param {Object} a first object to compare + @param {Object} b second object to compare + @return {Boolean} + @public + */ + 'use strict'; - ExitListOpcode.prototype.evaluate = function evaluate(vm) { - vm.exitList(); - }; + exports.default = isEqual; - return ExitListOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + function isEqual(a, b) { + if (a && typeof a.isEqual === 'function') { + return a.isEqual(b); + } - exports.ExitListOpcode = ExitListOpcode; + if (a instanceof Date && b instanceof Date) { + return a.getTime() === b.getTime(); + } - var EnterWithKeyOpcode = (function (_Opcode4) { - babelHelpers.inherits(EnterWithKeyOpcode, _Opcode4); + return a === b; + } +}); +enifed('ember-runtime/mixins/-proxy', ['exports', '@glimmer/reference', 'ember-metal', 'ember-runtime/computed/computed_macros'], function (exports, _glimmerReference, _emberMetal, _emberRuntimeComputedComputed_macros) { + /** + @module ember + @submodule ember-runtime + */ - function EnterWithKeyOpcode(start, end) { - _Opcode4.call(this); - this.type = "enter-with-key"; - this.slice = new _glimmerUtil.ListSlice(start, end); - } + 'use strict'; - EnterWithKeyOpcode.prototype.evaluate = function evaluate(vm) { - vm.enterWithKey(vm.frame.getKey(), this.slice); - }; + function contentPropertyWillChange(content, contentKey) { + var key = contentKey.slice(8); // remove "content." + if (key in this) { + return; + } // if shadowed in proxy + _emberMetal.propertyWillChange(this, key); + } - EnterWithKeyOpcode.prototype.toJSON = function toJSON() { - var slice = this.slice; - var _guid = this._guid; - var type = this.type; + function contentPropertyDidChange(content, contentKey) { + var key = contentKey.slice(8); // remove "content." + if (key in this) { + return; + } // if shadowed in proxy + _emberMetal.propertyDidChange(this, key); + } - var begin = slice.head(); - var end = slice.tail(); - return { - guid: _guid, - type: type, - args: [JSON.stringify(begin.inspect()), JSON.stringify(end.inspect())] - }; - }; + var ProxyTag = (function (_CachedTag) { + babelHelpers.inherits(ProxyTag, _CachedTag); - return EnterWithKeyOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + function ProxyTag(proxy) { + _CachedTag.call(this); - exports.EnterWithKeyOpcode = EnterWithKeyOpcode; + var content = _emberMetal.get(proxy, 'content'); - var TRUE_REF = new _glimmerReference.ConstReference(true); - var FALSE_REF = new _glimmerReference.ConstReference(false); + this.proxy = proxy; + this.proxyWrapperTag = new _glimmerReference.DirtyableTag(); + this.proxyContentTag = new _glimmerReference.UpdatableTag(_emberMetal.tagFor(content)); + } - var NextIterOpcode = (function (_Opcode5) { - babelHelpers.inherits(NextIterOpcode, _Opcode5); + /** + `Ember.ProxyMixin` forwards all properties not defined by the proxy itself + to a proxied `content` object. See Ember.ObjectProxy for more details. + + @class ProxyMixin + @namespace Ember + @private + */ - function NextIterOpcode(end) { - _Opcode5.call(this); - this.type = "next-iter"; - this.end = end; - } + ProxyTag.prototype.compute = function compute() { + return Math.max(this.proxyWrapperTag.value(), this.proxyContentTag.value()); + }; - NextIterOpcode.prototype.evaluate = function evaluate(vm) { - var item = vm.frame.getIterator().next(); - if (item) { - vm.frame.setCondition(TRUE_REF); - vm.frame.setKey(item.key); - vm.frame.setOperand(item.value); - vm.frame.setArgs(_glimmerRuntimeLibCompiledExpressionsArgs.EvaluatedArgs.positional([item.value, item.memo])); - } else { - vm.frame.setCondition(FALSE_REF); - vm.goto(this.end); - } - }; + ProxyTag.prototype.dirty = function dirty() { + this.proxyWrapperTag.dirty(); + }; - return NextIterOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + ProxyTag.prototype.contentDidChange = function contentDidChange() { + var content = _emberMetal.get(this.proxy, 'content'); + this.proxyContentTag.update(_emberMetal.tagFor(content)); + }; - exports.NextIterOpcode = NextIterOpcode; -}); + return ProxyTag; + })(_glimmerReference.CachedTag); -enifed('glimmer-runtime/lib/compiled/opcodes/partial', ['exports', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/opcodes/vm'], function (exports, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledOpcodesVm) { - 'use strict'; + exports.default = _emberMetal.Mixin.create({ + /** + The object whose properties will be forwarded. + @property content + @type Ember.Object + @default null + @private + */ + content: null, - var PutDynamicPartialDefinitionOpcode = (function (_Opcode) { - babelHelpers.inherits(PutDynamicPartialDefinitionOpcode, _Opcode); + init: function () { + this._super.apply(this, arguments); + _emberMetal.meta(this).setProxy(); + }, - function PutDynamicPartialDefinitionOpcode(symbolTable) { - _Opcode.call(this); - this.symbolTable = symbolTable; - this.type = "put-dynamic-partial-definition"; - } + _initializeTag: _emberMetal.on('init', function () { + _emberMetal.meta(this)._tag = new ProxyTag(this); + }), - PutDynamicPartialDefinitionOpcode.prototype.evaluate = function evaluate(vm) { - var env = vm.env; - var symbolTable = this.symbolTable; + _contentDidChange: _emberMetal.observer('content', function () { + _emberMetal.tagFor(this).contentDidChange(); + }), - function lookupPartial(name) { - var normalized = String(name); - if (!env.hasPartial(normalized, symbolTable)) { - throw new Error('Could not find a partial named "' + normalized + '"'); - } - return env.lookupPartial(normalized, symbolTable); - } - var reference = _glimmerReference.map(vm.frame.getOperand(), lookupPartial); - var cache = _glimmerReference.isConst(reference) ? undefined : new _glimmerReference.ReferenceCache(reference); - var definition = cache ? cache.peek() : reference.value(); - vm.frame.setImmediate(definition); - if (cache) { - vm.updateWith(new _glimmerRuntimeLibCompiledOpcodesVm.Assert(cache)); - } - }; + isTruthy: _emberRuntimeComputedComputed_macros.bool('content'), - PutDynamicPartialDefinitionOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$OPERAND"] - }; - }; + _debugContainerKey: null, - return PutDynamicPartialDefinitionOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + willWatchProperty: function (key) { + var contentKey = 'content.' + key; + _emberMetal._addBeforeObserver(this, contentKey, null, contentPropertyWillChange); + _emberMetal.addObserver(this, contentKey, null, contentPropertyDidChange); + }, - exports.PutDynamicPartialDefinitionOpcode = PutDynamicPartialDefinitionOpcode; + didUnwatchProperty: function (key) { + var contentKey = 'content.' + key; + _emberMetal._removeBeforeObserver(this, contentKey, null, contentPropertyWillChange); + _emberMetal.removeObserver(this, contentKey, null, contentPropertyDidChange); + }, - var PutPartialDefinitionOpcode = (function (_Opcode2) { - babelHelpers.inherits(PutPartialDefinitionOpcode, _Opcode2); + unknownProperty: function (key) { + var content = _emberMetal.get(this, 'content'); + if (content) { + return _emberMetal.get(content, key); + } + }, - function PutPartialDefinitionOpcode(definition) { - _Opcode2.call(this); - this.definition = definition; - this.type = "put-partial-definition"; - } + setUnknownProperty: function (key, value) { + var m = _emberMetal.meta(this); + if (m.proto === this) { + // if marked as prototype then just defineProperty + // rather than delegate + _emberMetal.defineProperty(this, key, null, value); + return value; + } - PutPartialDefinitionOpcode.prototype.evaluate = function evaluate(vm) { - vm.frame.setImmediate(this.definition); - }; + var content = _emberMetal.get(this, 'content'); - PutPartialDefinitionOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.definition.name)] - }; - }; + return _emberMetal.set(content, key, value); + } + }); +}); +enifed('ember-runtime/mixins/action_handler', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-runtime + */ - return PutPartialDefinitionOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + 'use strict'; - exports.PutPartialDefinitionOpcode = PutPartialDefinitionOpcode; + exports.deprecateUnderscoreActions = deprecateUnderscoreActions; - var EvaluatePartialOpcode = (function (_Opcode3) { - babelHelpers.inherits(EvaluatePartialOpcode, _Opcode3); + /** + `Ember.ActionHandler` is available on some familiar classes including + `Ember.Route`, `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.) + + @class ActionHandler + @namespace Ember + @private + */ + var ActionHandler = _emberMetal.Mixin.create({ + mergedProperties: ['actions'], - function EvaluatePartialOpcode(symbolTable) { - _Opcode3.call(this); - this.symbolTable = symbolTable; - this.type = "evaluate-partial"; - this.cache = _glimmerUtil.dict(); + /** + 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 + from within a template and the application's current route is this route. + Actions can also be invoked from other parts of your application + via `ActionHandler#send`. + The `actions` hash will inherit action handlers from + the `actions` hash defined on extended parent classes + or mixins rather than just replace the entire hash, e.g.: + ```js + App.CanDisplayBanner = Ember.Mixin.create({ + actions: { + displayBanner(msg) { + // ... + } } - - EvaluatePartialOpcode.prototype.evaluate = function evaluate(vm) { - var _vm$frame$getImmediate = vm.frame.getImmediate(); - - var template = _vm$frame$getImmediate.template; - - var block = this.cache[template.id]; - if (!block) { - block = template.asPartial(this.symbolTable); + }); + App.WelcomeRoute = Ember.Route.extend(App.CanDisplayBanner, { + actions: { + playMusic() { + // ... + } + } + }); + // `WelcomeRoute`, when active, will be able to respond + // to both actions, since the actions hash is merged rather + // then replaced when extending mixins / parent classes. + this.send('displayBanner'); + this.send('playMusic'); + ``` + Within a Controller, Route or Component's action handler, + the value of the `this` context is the Controller, Route or + Component object: + ```js + App.SongRoute = Ember.Route.extend({ + actions: { + myAction() { + this.controllerFor("song"); + this.transitionTo("other.route"); + ... + } + } + }); + ``` + It is also possible to call `this._super(...arguments)` from within an + action handler if it overrides a handler defined on a parent + class or mixin: + Take for example the following routes: + ```js + App.DebugRoute = Ember.Mixin.create({ + actions: { + debugRouteInformation() { + console.debug("trololo"); + } + } + }); + App.AnnoyingDebugRoute = Ember.Route.extend(App.DebugRoute, { + actions: { + debugRouteInformation() { + // also call the debugRouteInformation of mixed in App.DebugRoute + this._super(...arguments); + // show additional annoyance + window.alert(...); + } + } + }); + ``` + ## Bubbling + By default, an action will stop bubbling once a handler defined + on the `actions` hash handles it. To continue bubbling the action, + you must return `true` from the handler: + ```js + App.Router.map(function() { + this.route("album", function() { + this.route("song"); + }); + }); + App.AlbumRoute = Ember.Route.extend({ + actions: { + startPlaying: function() { + } + } + }); + App.AlbumSongRoute = Ember.Route.extend({ + actions: { + startPlaying() { + // ... + if (actionShouldAlsoBeTriggeredOnParentRoute) { + return true; } - vm.invokePartial(block); - }; - - EvaluatePartialOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$OPERAND"] - }; - }; - - return EvaluatePartialOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); - - exports.EvaluatePartialOpcode = EvaluatePartialOpcode; -}); - -enifed('glimmer-runtime/lib/compiled/opcodes/vm', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/references', 'glimmer-reference', 'glimmer-util'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibReferences, _glimmerReference, _glimmerUtil) { - 'use strict'; - - var PushChildScopeOpcode = (function (_Opcode) { - babelHelpers.inherits(PushChildScopeOpcode, _Opcode); - - function PushChildScopeOpcode() { - _Opcode.apply(this, arguments); - this.type = "push-child-scope"; + } } + }); + ``` + @property actions + @type Object + @default null + @public + */ - PushChildScopeOpcode.prototype.evaluate = function evaluate(vm) { - vm.pushChildScope(); - }; + /** + 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 + not be found in the `ActionHandler`'s `actions` hash or if the + action target function returns `true`. + Example + ```js + App.WelcomeRoute = Ember.Route.extend({ + actions: { + playTheme() { + this.send('playMusic', 'theme.mp3'); + }, + playMusic(track) { + // ... + } + } + }); + ``` + @method send + @param {String} actionName The action to trigger + @param {*} context a context to send with the action + @public + */ + send: function (actionName) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } - return PushChildScopeOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + if (this.actions && this.actions[actionName]) { + var shouldBubble = this.actions[actionName].apply(this, args) === true; + if (!shouldBubble) { + return; + } + } - exports.PushChildScopeOpcode = PushChildScopeOpcode; + var target = _emberMetal.get(this, 'target'); + if (target) { + target.send.apply(target, arguments); + } + }, - var PopScopeOpcode = (function (_Opcode2) { - babelHelpers.inherits(PopScopeOpcode, _Opcode2); + willMergeMixin: function (props) { - function PopScopeOpcode() { - _Opcode2.apply(this, arguments); - this.type = "pop-scope"; - } + if (props._actions) { - PopScopeOpcode.prototype.evaluate = function evaluate(vm) { - vm.popScope(); - }; + props.actions = props._actions; + delete props._actions; + } + } + }); - return PopScopeOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + exports.default = ActionHandler; - exports.PopScopeOpcode = PopScopeOpcode; + function deprecateUnderscoreActions(factory) { + Object.defineProperty(factory.prototype, '_actions', { + configurable: true, + enumerable: false, + set: function (value) {}, + get: function () { + return _emberMetal.get(this, 'actions'); + } + }); + } +}); +enifed('ember-runtime/mixins/array', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/mixins/enumerable', 'ember-runtime/system/each_proxy'], function (exports, _emberUtils, _emberMetal, _emberRuntimeMixinsEnumerable, _emberRuntimeSystemEach_proxy) { + /** + @module ember + @submodule ember-runtime + */ - var PushDynamicScopeOpcode = (function (_Opcode3) { - babelHelpers.inherits(PushDynamicScopeOpcode, _Opcode3); + // .......................................................... + // HELPERS + // + 'use strict'; - function PushDynamicScopeOpcode() { - _Opcode3.apply(this, arguments); - this.type = "push-dynamic-scope"; - } + var _Mixin$create; - PushDynamicScopeOpcode.prototype.evaluate = function evaluate(vm) { - vm.pushDynamicScope(); - }; + exports.addArrayObserver = addArrayObserver; + exports.removeArrayObserver = removeArrayObserver; + exports.objectAt = objectAt; + exports.arrayContentWillChange = arrayContentWillChange; + exports.arrayContentDidChange = arrayContentDidChange; + exports.isEmberArray = isEmberArray; - return PushDynamicScopeOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + function arrayObserversHelper(obj, target, opts, operation, notify) { + var willChange = opts && opts.willChange || 'arrayWillChange'; + var didChange = opts && opts.didChange || 'arrayDidChange'; + var hasObservers = _emberMetal.get(obj, 'hasArrayObservers'); - exports.PushDynamicScopeOpcode = PushDynamicScopeOpcode; + if (hasObservers === notify) { + _emberMetal.propertyWillChange(obj, 'hasArrayObservers'); + } - var PopDynamicScopeOpcode = (function (_Opcode4) { - babelHelpers.inherits(PopDynamicScopeOpcode, _Opcode4); + operation(obj, '@array:before', target, willChange); + operation(obj, '@array:change', target, didChange); - function PopDynamicScopeOpcode() { - _Opcode4.apply(this, arguments); - this.type = "pop-dynamic-scope"; - } + if (hasObservers === notify) { + _emberMetal.propertyDidChange(obj, 'hasArrayObservers'); + } - PopDynamicScopeOpcode.prototype.evaluate = function evaluate(vm) { - vm.popDynamicScope(); - }; + return obj; + } - return PopDynamicScopeOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + function addArrayObserver(array, target, opts) { + return arrayObserversHelper(array, target, opts, _emberMetal.addListener, false); + } - exports.PopDynamicScopeOpcode = PopDynamicScopeOpcode; + function removeArrayObserver(array, target, opts) { + return arrayObserversHelper(array, target, opts, _emberMetal.removeListener, true); + } - var PutNullOpcode = (function (_Opcode5) { - babelHelpers.inherits(PutNullOpcode, _Opcode5); + function objectAt(content, idx) { + if (content.objectAt) { + return content.objectAt(idx); + } - function PutNullOpcode() { - _Opcode5.apply(this, arguments); - this.type = "put-null"; - } + return content[idx]; + } - PutNullOpcode.prototype.evaluate = function evaluate(vm) { - vm.frame.setOperand(_glimmerRuntimeLibReferences.NULL_REFERENCE); - }; + function arrayContentWillChange(array, startIdx, removeAmt, addAmt) { + var removing = undefined, + lim = undefined; - return PutNullOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + // if no args are passed assume everything changes + if (startIdx === undefined) { + startIdx = 0; + removeAmt = addAmt = -1; + } else { + if (removeAmt === undefined) { + removeAmt = -1; + } - exports.PutNullOpcode = PutNullOpcode; + if (addAmt === undefined) { + addAmt = -1; + } + } - var PutValueOpcode = (function (_Opcode6) { - babelHelpers.inherits(PutValueOpcode, _Opcode6); + if (array.__each) { + array.__each.arrayWillChange(array, startIdx, removeAmt, addAmt); + } - function PutValueOpcode(expression) { - _Opcode6.call(this); - this.expression = expression; - this.type = "put-value"; - } + _emberMetal.sendEvent(array, '@array:before', [array, startIdx, removeAmt, addAmt]); - PutValueOpcode.prototype.evaluate = function evaluate(vm) { - vm.evaluateOperand(this.expression); - }; + if (startIdx >= 0 && removeAmt >= 0 && _emberMetal.get(array, 'hasEnumerableObservers')) { + removing = []; + lim = startIdx + removeAmt; - PutValueOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [this.expression.toJSON()] - }; - }; + for (var idx = startIdx; idx < lim; idx++) { + removing.push(objectAt(array, idx)); + } + } else { + removing = removeAmt; + } - return PutValueOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + array.enumerableContentWillChange(removing, addAmt); - exports.PutValueOpcode = PutValueOpcode; + return array; + } - var PutArgsOpcode = (function (_Opcode7) { - babelHelpers.inherits(PutArgsOpcode, _Opcode7); + function arrayContentDidChange(array, startIdx, removeAmt, addAmt) { + // if no args are passed assume everything changes + if (startIdx === undefined) { + startIdx = 0; + removeAmt = addAmt = -1; + } else { + if (removeAmt === undefined) { + removeAmt = -1; + } - function PutArgsOpcode(args) { - _Opcode7.call(this); - this.args = args; - this.type = "put-args"; - } + if (addAmt === undefined) { + addAmt = -1; + } + } - PutArgsOpcode.prototype.evaluate = function evaluate(vm) { - vm.evaluateArgs(this.args); - }; + var adding = undefined; + if (startIdx >= 0 && addAmt >= 0 && _emberMetal.get(array, 'hasEnumerableObservers')) { + adding = []; + var lim = startIdx + addAmt; - PutArgsOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - details: { - "positional": this.args.positional.toJSON(), - "named": this.args.named.toJSON() - } - }; - }; + for (var idx = startIdx; idx < lim; idx++) { + adding.push(objectAt(array, idx)); + } + } else { + adding = addAmt; + } - return PutArgsOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + array.enumerableContentDidChange(removeAmt, adding); - exports.PutArgsOpcode = PutArgsOpcode; + if (array.__each) { + array.__each.arrayDidChange(array, startIdx, removeAmt, addAmt); + } - var BindPositionalArgsOpcode = (function (_Opcode8) { - babelHelpers.inherits(BindPositionalArgsOpcode, _Opcode8); + _emberMetal.sendEvent(array, '@array:change', [array, startIdx, removeAmt, addAmt]); - function BindPositionalArgsOpcode(names, symbols) { - _Opcode8.call(this); - this.names = names; - this.symbols = symbols; - this.type = "bind-positional-args"; - } + var meta = _emberMetal.peekMeta(array); + var cache = meta && meta.readableCache(); - BindPositionalArgsOpcode.create = function create(block) { - var names = block.locals; - var symbols = names.map(function (name) { - return block.symbolTable.getLocal(name); - }); - return new this(names, symbols); - }; + if (cache) { + if (cache.firstObject !== undefined && objectAt(array, 0) !== _emberMetal.cacheFor.get(cache, 'firstObject')) { + _emberMetal.propertyWillChange(array, 'firstObject'); + _emberMetal.propertyDidChange(array, 'firstObject'); + } + if (cache.lastObject !== undefined && objectAt(array, _emberMetal.get(array, 'length') - 1) !== _emberMetal.cacheFor.get(cache, 'lastObject')) { + _emberMetal.propertyWillChange(array, 'lastObject'); + _emberMetal.propertyDidChange(array, 'lastObject'); + } + } + return array; + } - BindPositionalArgsOpcode.prototype.evaluate = function evaluate(vm) { - vm.bindPositionalArgs(this.symbols); - }; + var EMBER_ARRAY = _emberUtils.symbol('EMBER_ARRAY'); - BindPositionalArgsOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ['[' + this.names.map(function (name) { - return JSON.stringify(name); - }).join(", ") + ']'] - }; - }; + function isEmberArray(obj) { + return obj && !!obj[EMBER_ARRAY]; + } - return BindPositionalArgsOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + // .......................................................... + // ARRAY + // + /** + This mixin implements Observer-friendly Array-like behavior. It is not a + concrete implementation, but it can be used up by other classes that want + to appear like arrays. + + For example, ArrayProxy is a concrete classes that can + be instantiated to implement array-like behavior. Both of these classes use + the Array Mixin by way of the MutableArray mixin, which allows observable + changes to be made to the underlying array. + + Unlike `Ember.Enumerable,` this mixin defines methods specifically for + collections that provide index-ordered access to their contents. When you + are designing code that needs to accept any kind of Array-like object, you + should use these methods instead of Array primitives because these will + properly notify observers of changes to the array. + + Although these methods are efficient, they do add a layer of indirection to + your application so it is a good idea to use them only when you need the + flexibility of using both true JavaScript arrays and "virtual" arrays such + as controllers and collections. + + You can use the methods defined in this module to access and modify array + contents in a KVO-friendly way. You can also be notified whenever the + membership of an array changes by using `.observes('myArray.[]')`. + + To support `Ember.Array` in your own class, you must override two + primitives to use it: `length()` and `objectAt()`. + + Note that the Ember.Array mixin also incorporates the `Ember.Enumerable` + mixin. All `Ember.Array`-like objects are also enumerable. + + @class Array + @namespace Ember + @uses Ember.Enumerable + @since Ember 0.9.0 + @public + */ + var ArrayMixin = _emberMetal.Mixin.create(_emberRuntimeMixinsEnumerable.default, (_Mixin$create = {}, _Mixin$create[EMBER_ARRAY] = true, _Mixin$create.length = null, _Mixin$create.objectAt = function (idx) { + if (idx < 0 || idx >= _emberMetal.get(this, 'length')) { + return undefined; + } - exports.BindPositionalArgsOpcode = BindPositionalArgsOpcode; + return _emberMetal.get(this, idx); + }, _Mixin$create.objectsAt = function (indexes) { + var _this = this; - var BindNamedArgsOpcode = (function (_Opcode9) { - babelHelpers.inherits(BindNamedArgsOpcode, _Opcode9); + return indexes.map(function (idx) { + return objectAt(_this, idx); + }); + }, _Mixin$create.nextObject = function (idx) { + return objectAt(this, idx); + }, _Mixin$create['[]'] = _emberMetal.computed({ + get: function (key) { + return this; + }, + set: function (key, value) { + this.replace(0, _emberMetal.get(this, 'length'), value); + return this; + } + }), _Mixin$create.firstObject = _emberMetal.computed(function () { + return objectAt(this, 0); + }).readOnly(), _Mixin$create.lastObject = _emberMetal.computed(function () { + return objectAt(this, _emberMetal.get(this, 'length') - 1); + }).readOnly(), _Mixin$create.contains = function (obj) { - function BindNamedArgsOpcode(names, symbols) { - _Opcode9.call(this); - this.names = names; - this.symbols = symbols; - this.type = "bind-named-args"; - } + return this.indexOf(obj) >= 0; + }, _Mixin$create.slice = function (beginIndex, endIndex) { + var ret = _emberMetal.default.A(); + var length = _emberMetal.get(this, 'length'); - BindNamedArgsOpcode.create = function create(layout) { - var names = layout.named; - var symbols = names.map(function (name) { - return layout.symbolTable.getNamed(name); - }); - return new this(names, symbols); - }; + if (_emberMetal.isNone(beginIndex)) { + beginIndex = 0; + } - BindNamedArgsOpcode.prototype.evaluate = function evaluate(vm) { - vm.bindNamedArgs(this.names, this.symbols); - }; + if (_emberMetal.isNone(endIndex) || endIndex > length) { + endIndex = length; + } - BindNamedArgsOpcode.prototype.toJSON = function toJSON() { - var names = this.names; - var symbols = this.symbols; + if (beginIndex < 0) { + beginIndex = length + beginIndex; + } - var args = names.map(function (name, i) { - return '$' + symbols[i] + ': $ARGS[' + name + ']'; - }); - return { - guid: this._guid, - type: this.type, - args: args - }; - }; + if (endIndex < 0) { + endIndex = length + endIndex; + } - return BindNamedArgsOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + while (beginIndex < endIndex) { + ret[ret.length] = objectAt(this, beginIndex++); + } - exports.BindNamedArgsOpcode = BindNamedArgsOpcode; + return ret; + }, _Mixin$create.indexOf = function (object, startAt) { + var len = _emberMetal.get(this, 'length'); - var BindBlocksOpcode = (function (_Opcode10) { - babelHelpers.inherits(BindBlocksOpcode, _Opcode10); + if (startAt === undefined) { + startAt = 0; + } - function BindBlocksOpcode(names, symbols) { - _Opcode10.call(this); - this.names = names; - this.symbols = symbols; - this.type = "bind-blocks"; - } + if (startAt < 0) { + startAt += len; + } - BindBlocksOpcode.create = function create(layout) { - var names = layout.yields; - var symbols = names.map(function (name) { - return layout.symbolTable.getYield(name); - }); - return new this(names, symbols); - }; + for (var idx = startAt; idx < len; idx++) { + if (objectAt(this, idx) === object) { + return idx; + } + } - BindBlocksOpcode.prototype.evaluate = function evaluate(vm) { - vm.bindBlocks(this.names, this.symbols); - }; + return -1; + }, _Mixin$create.lastIndexOf = function (object, startAt) { + var len = _emberMetal.get(this, 'length'); - BindBlocksOpcode.prototype.toJSON = function toJSON() { - var names = this.names; - var symbols = this.symbols; + if (startAt === undefined || startAt >= len) { + startAt = len - 1; + } - var args = names.map(function (name, i) { - return '$' + symbols[i] + ': $BLOCKS[' + name + ']'; - }); - return { - guid: this._guid, - type: this.type, - args: args - }; - }; + if (startAt < 0) { + startAt += len; + } - return BindBlocksOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + for (var idx = startAt; idx >= 0; idx--) { + if (objectAt(this, idx) === object) { + return idx; + } + } - exports.BindBlocksOpcode = BindBlocksOpcode; + return -1; + }, _Mixin$create.addArrayObserver = function (target, opts) { + return addArrayObserver(this, target, opts); + }, _Mixin$create.removeArrayObserver = function (target, opts) { + return removeArrayObserver(this, target, opts); + }, _Mixin$create.hasArrayObservers = _emberMetal.computed(function () { + return _emberMetal.hasListeners(this, '@array:change') || _emberMetal.hasListeners(this, '@array:before'); + }), _Mixin$create.arrayContentWillChange = function (startIdx, removeAmt, addAmt) { + return arrayContentWillChange(this, startIdx, removeAmt, addAmt); + }, _Mixin$create.arrayContentDidChange = function (startIdx, removeAmt, addAmt) { + return arrayContentDidChange(this, startIdx, removeAmt, addAmt); + }, _Mixin$create.includes = function (obj, startAt) { + var len = _emberMetal.get(this, 'length'); - var BindPartialArgsOpcode = (function (_Opcode11) { - babelHelpers.inherits(BindPartialArgsOpcode, _Opcode11); + if (startAt === undefined) { + startAt = 0; + } - function BindPartialArgsOpcode(symbol) { - _Opcode11.call(this); - this.symbol = symbol; - this.type = "bind-partial-args"; - } + if (startAt < 0) { + startAt += len; + } - BindPartialArgsOpcode.create = function create(layout) { - return new this(layout.symbolTable.getPartialArgs()); - }; + for (var idx = startAt; idx < len; idx++) { + var currentObj = objectAt(this, idx); - BindPartialArgsOpcode.prototype.evaluate = function evaluate(vm) { - vm.bindPartialArgs(this.symbol); - }; + // SameValueZero comparison (NaN !== NaN) + if (obj === currentObj || obj !== obj && currentObj !== currentObj) { + return true; + } + } - return BindPartialArgsOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return false; + }, _Mixin$create['@each'] = _emberMetal.computed(function () { + // TODO use Symbol or add to meta + if (!this.__each) { + this.__each = new _emberRuntimeSystemEach_proxy.default(this); + } - exports.BindPartialArgsOpcode = BindPartialArgsOpcode; + return this.__each; + }).volatile().readOnly(), _Mixin$create)); - var BindCallerScopeOpcode = (function (_Opcode12) { - babelHelpers.inherits(BindCallerScopeOpcode, _Opcode12); + exports.default = ArrayMixin; +}); +// ES6TODO: Ember.A - function BindCallerScopeOpcode() { - _Opcode12.apply(this, arguments); - this.type = "bind-caller-scope"; - } +/** + __Required.__ You must implement this method to apply this mixin. + Your array must support the `length` property. Your replace methods should + set this property whenever it changes. + @property {Number} length + @public +*/ - BindCallerScopeOpcode.prototype.evaluate = function evaluate(vm) { - vm.bindCallerScope(); - }; +/** + Returns the object at the given `index`. If the given `index` is negative + or is greater or equal than the array length, returns `undefined`. + This is one of the primitives you must implement to support `Ember.Array`. + If your object supports retrieving the value of an array item using `get()` + (i.e. `myArray.get(0)`), then you do not need to implement this method + yourself. + ```javascript + let arr = ['a', 'b', 'c', 'd']; + arr.objectAt(0); // 'a' + arr.objectAt(3); // 'd' + arr.objectAt(-1); // undefined + arr.objectAt(4); // undefined + arr.objectAt(5); // undefined + ``` + @method objectAt + @param {Number} idx The index of the item to return. + @return {*} item at index or undefined + @public +*/ - return BindCallerScopeOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); +/** + This returns the objects at the specified indexes, using `objectAt`. + ```javascript + let arr = ['a', 'b', 'c', 'd']; + arr.objectsAt([0, 1, 2]); // ['a', 'b', 'c'] + arr.objectsAt([2, 3, 4]); // ['c', 'd', undefined] + ``` + @method objectsAt + @param {Array} indexes An array of indexes of items to return. + @return {Array} + @public + */ - exports.BindCallerScopeOpcode = BindCallerScopeOpcode; +// overrides Ember.Enumerable version - var BindDynamicScopeOpcode = (function (_Opcode13) { - babelHelpers.inherits(BindDynamicScopeOpcode, _Opcode13); +/** + This is the handler for the special array content property. If you get + this property, it will return this. If you set this property to a new + array, it will replace the current content. + This property overrides the default property defined in `Ember.Enumerable`. + @property [] + @return this + @public +*/ - function BindDynamicScopeOpcode(names) { - _Opcode13.call(this); - this.names = names; - this.type = "bind-dynamic-scope"; - } +// optimized version from Enumerable - BindDynamicScopeOpcode.prototype.evaluate = function evaluate(vm) { - vm.bindDynamicScope(this.names); - }; +// Add any extra methods to Ember.Array that are native to the built-in Array. +/** + Returns a new array that is a slice of the receiver. This implementation + uses the observable array methods to retrieve the objects for the new + slice. + ```javascript + let arr = ['red', 'green', 'blue']; + arr.slice(0); // ['red', 'green', 'blue'] + arr.slice(0, 2); // ['red', 'green'] + arr.slice(1, 100); // ['green', 'blue'] + ``` + @method slice + @param {Number} beginIndex (Optional) index to begin slicing from. + @param {Number} endIndex (Optional) index to end the slice at (but not included). + @return {Array} New array with specified slice + @public +*/ - return BindDynamicScopeOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); +/** + Returns the index of the given object's first occurrence. + If no `startAt` argument is given, the starting location to + search is 0. If it's negative, will count backward from + the end of the array. Returns -1 if no match is found. + ```javascript + let arr = ['a', 'b', 'c', 'd', 'a']; + arr.indexOf('a'); // 0 + arr.indexOf('z'); // -1 + arr.indexOf('a', 2); // 4 + arr.indexOf('a', -1); // 4 + arr.indexOf('b', 3); // -1 + arr.indexOf('a', 100); // -1 + ``` + @method indexOf + @param {Object} object the item to search for + @param {Number} startAt optional starting location to search, default 0 + @return {Number} index or -1 if not found + @public +*/ - exports.BindDynamicScopeOpcode = BindDynamicScopeOpcode; +/** + Returns the index of the given object's last occurrence. + If no `startAt` argument is given, the search starts from + the last position. If it's negative, will count backward + from the end of the array. Returns -1 if no match is found. + ```javascript + let arr = ['a', 'b', 'c', 'd', 'a']; + arr.lastIndexOf('a'); // 4 + arr.lastIndexOf('z'); // -1 + arr.lastIndexOf('a', 2); // 0 + arr.lastIndexOf('a', -1); // 4 + arr.lastIndexOf('b', 3); // 1 + arr.lastIndexOf('a', 100); // 4 + ``` + @method lastIndexOf + @param {Object} object the item to search for + @param {Number} startAt optional starting location to search, default 0 + @return {Number} index or -1 if not found + @public +*/ - var EnterOpcode = (function (_Opcode14) { - babelHelpers.inherits(EnterOpcode, _Opcode14); +// .......................................................... +// ARRAY OBSERVERS +// - function EnterOpcode(begin, end) { - _Opcode14.call(this); - this.type = "enter"; - this.slice = new _glimmerUtil.ListSlice(begin, end); - } +/** + Adds an array observer to the receiving array. The array observer object + normally must implement two methods: + * `arrayWillChange(observedObj, start, removeCount, addCount)` - This method will be + called just before the array is modified. + * `arrayDidChange(observedObj, start, removeCount, addCount)` - This method will be + called just after the array is modified. + Both callbacks will be passed the observed object, starting index of the + change as well as a count of the items to be removed and added. You can use + these callbacks to optionally inspect the array during the change, clear + caches, or do any other bookkeeping necessary. + In addition to passing a target, you can also include an options hash + which you can use to override the method names that will be invoked on the + target. + @method addArrayObserver + @param {Object} target The observer object. + @param {Object} opts Optional hash of configuration options including + `willChange` and `didChange` option. + @return {Ember.Array} receiver + @public +*/ - EnterOpcode.prototype.evaluate = function evaluate(vm) { - vm.enter(this.slice); - }; +/** + Removes an array observer from the object if the observer is current + registered. Calling this method multiple times with the same object will + have no effect. + @method removeArrayObserver + @param {Object} target The object observing the array. + @param {Object} opts Optional hash of configuration options including + `willChange` and `didChange` option. + @return {Ember.Array} receiver + @public +*/ - EnterOpcode.prototype.toJSON = function toJSON() { - var slice = this.slice; - var type = this.type; - var _guid = this._guid; +/** + Becomes true whenever the array currently has observers watching changes + on the array. + @property {Boolean} hasArrayObservers + @public +*/ - var begin = slice.head(); - var end = slice.tail(); - return { - guid: _guid, - type: type, - args: [JSON.stringify(begin.inspect()), JSON.stringify(end.inspect())] - }; - }; +/** + If you are implementing an object that supports `Ember.Array`, call this + method just before the array content changes to notify any observers and + invalidate any related properties. Pass the starting index of the change + as well as a delta of the amounts to change. + @method arrayContentWillChange + @param {Number} startIdx The starting index in the array that will change. + @param {Number} removeAmt The number of items that will be removed. If you + pass `null` assumes 0 + @param {Number} addAmt The number of items that will be added. If you + pass `null` assumes 0. + @return {Ember.Array} receiver + @public +*/ - return EnterOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); +/** + If you are implementing an object that supports `Ember.Array`, call this + method just after the array content changes to notify any observers and + invalidate any related properties. Pass the starting index of the change + as well as a delta of the amounts to change. + @method arrayContentDidChange + @param {Number} startIdx The starting index in the array that did change. + @param {Number} removeAmt The number of items that were removed. If you + pass `null` assumes 0 + @param {Number} addAmt The number of items that were added. If you + pass `null` assumes 0. + @return {Ember.Array} receiver + @public +*/ - exports.EnterOpcode = EnterOpcode; +/** + 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 +*/ - var ExitOpcode = (function (_Opcode15) { - babelHelpers.inherits(ExitOpcode, _Opcode15); +/** + Returns a special object that can be used to observe individual properties + on the array. Just get an equivalent property on this object and it will + return an enumerable that maps automatically to the named key on the + member objects. + `@each` should only be used in a non-terminal context. Example: + ```javascript + myMethod: computed('posts.@each.author', function(){ + ... + }); + ``` + If you merely want to watch for the array being changed, like an object being + replaced, added or removed, use `[]` instead of `@each`. + ```javascript + myMethod: computed('posts.[]', function(){ + ... + }); + ``` + @property @each + @public +*/ +enifed('ember-runtime/mixins/comparable', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - function ExitOpcode() { - _Opcode15.apply(this, arguments); - this.type = "exit"; - } + /** + @module ember + @submodule ember-runtime + */ - ExitOpcode.prototype.evaluate = function evaluate(vm) { - vm.exit(); - }; + /** + Implements some standard methods for comparing objects. Add this mixin to + any class you create that can compare its instances. + + You should implement the `compare()` method. + + @class Comparable + @namespace Ember + @since Ember 0.9 + @private + */ + exports.default = _emberMetal.Mixin.create({ - return ExitOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + __Required.__ You must implement this method to apply this mixin. + Override to return the result of the comparison of the two parameters. The + compare method should return: + - `-1` if `a < b` + - `0` if `a == b` + - `1` if `a > b` + Default implementation raises an exception. + @method compare + @param a {Object} the first object to compare + @param b {Object} the second object to compare + @return {Number} the result of the comparison + @private + */ + compare: null + }); +}); +enifed('ember-runtime/mixins/container_proxy', ['exports', 'ember-metal', 'container'], function (exports, _emberMetal, _container) { + /** + @module ember + @submodule ember-runtime + */ + 'use strict'; - exports.ExitOpcode = ExitOpcode; + var _containerProxyMixin; - var LabelOpcode = (function (_Opcode16) { - babelHelpers.inherits(LabelOpcode, _Opcode16); + /** + ContainerProxyMixin is used to provide public access to specific + container functionality. + + @class ContainerProxyMixin + @private + */ + var containerProxyMixin = (_containerProxyMixin = { + /** + The container stores state. + @private + @property {Ember.Container} __container__ + */ + __container__: null, - function LabelOpcode(label) { - _Opcode16.call(this); - this.tag = _glimmerReference.CONSTANT_TAG; - this.type = "label"; - this.label = null; - this.prev = null; - this.next = null; - if (label) this.label = label; - } + /** + Returns an object that can be used to provide an owner to a + manually created instance. + Example: + ``` + let owner = Ember.getOwner(this); + User.create( + owner.ownerInjection(), + { username: 'rwjblue' } + ) + ``` + @public + @method ownerInjection + @since 2.3.0 + @return {Object} + */ + ownerInjection: function () { + return this.__container__.ownerInjection(); + }, - LabelOpcode.prototype.evaluate = function evaluate() {}; + /** + Given a fullName return a corresponding instance. + The default behaviour is for lookup to return a singleton instance. + The singleton is scoped to the container, allowing multiple containers + to all have their own locally scoped singletons. + ```javascript + let registry = new Registry(); + let container = registry.container(); + registry.register('api:twitter', Twitter); + let twitter = container.lookup('api:twitter'); + twitter instanceof Twitter; // => true + // by default the container will return singletons + let twitter2 = container.lookup('api:twitter'); + twitter2 instanceof Twitter; // => true + twitter === twitter2; //=> true + ``` + If singletons are not wanted an optional flag can be provided at lookup. + ```javascript + let registry = new Registry(); + let container = registry.container(); + registry.register('api:twitter', Twitter); + let twitter = container.lookup('api:twitter', { singleton: false }); + let twitter2 = container.lookup('api:twitter', { singleton: false }); + twitter === twitter2; //=> false + ``` + @public + @method lookup + @param {String} fullName + @param {Object} options + @return {any} + */ + lookup: function (fullName, options) { + return this.__container__.lookup(fullName, options); + }, - LabelOpcode.prototype.inspect = function inspect() { - return this.label + ' [' + this._guid + ']'; - }; + /** + Given a fullName return the corresponding factory. + @private + @method _lookupFactory + @param {String} fullName + @return {any} + */ + _lookupFactory: function (fullName, options) { + return this.__container__.lookupFactory(fullName, options); + } - LabelOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.inspect())] - }; - }; + }, _containerProxyMixin[_container.FACTORY_FOR] = function () { + var _container__; - return LabelOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + return (_container__ = this.__container__)[_container.FACTORY_FOR].apply(_container__, arguments); + }, _containerProxyMixin[_container.LOOKUP_FACTORY] = function () { + var _container__2; - exports.LabelOpcode = LabelOpcode; + return (_container__2 = this.__container__)[_container.LOOKUP_FACTORY].apply(_container__2, arguments); + }, _containerProxyMixin._resolveLocalLookupName = function (name, source) { + return this.__container__.registry.expandLocalLookup('component:' + name, { + source: source + }); + }, _containerProxyMixin.willDestroy = function () { + this._super.apply(this, arguments); - var EvaluateOpcode = (function (_Opcode17) { - babelHelpers.inherits(EvaluateOpcode, _Opcode17); + if (this.__container__) { + _emberMetal.run(this.__container__, 'destroy'); + } + }, _containerProxyMixin); - function EvaluateOpcode(debug, block) { - _Opcode17.call(this); - this.debug = debug; - this.block = block; - this.type = "evaluate"; - } + if (true) { + containerProxyMixin.factoryFor = function ContainerProxyMixin_factoryFor(fullName) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - EvaluateOpcode.prototype.evaluate = function evaluate(vm) { - vm.invokeBlock(this.block, vm.frame.getArgs()); - }; + return this.__container__.factoryFor(fullName, options); + }; + } - EvaluateOpcode.prototype.toJSON = function toJSON() { - var guid = this._guid; - var type = this.type; - var debug = this.debug; - var block = this.block; - - var compiled = block['compiled']; - var children = undefined; - if (compiled) { - children = compiled.ops.toArray().map(function (op) { - return op.toJSON(); - }); - } else { - children = [{ guid: null, type: '[ UNCOMPILED BLOCK ]' }]; - } - return { - guid: guid, - type: type, - args: [debug], - children: children - }; - }; + exports.default = _emberMetal.Mixin.create(containerProxyMixin); +}); - return EvaluateOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); +/** + Given a name and a source path, resolve the fullName + @private + @method _resolveLocalLookupName + @param {String} fullName + @param {String} source + @return {String} + */ - exports.EvaluateOpcode = EvaluateOpcode; - var ConstTest = function (ref, env) { - return new _glimmerReference.ConstReference(!!ref.value()); - }; - exports.ConstTest = ConstTest; - var SimpleTest = function (ref, env) { - return ref; - }; - exports.SimpleTest = SimpleTest; - var EnvironmentTest = function (ref, env) { - return env.toConditionalReference(ref); - }; - exports.EnvironmentTest = EnvironmentTest; +/** + @private + */ +enifed('ember-runtime/mixins/controller', ['exports', 'ember-metal', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/controller_content_model_alias_deprecation'], function (exports, _emberMetal, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsController_content_model_alias_deprecation) { + 'use strict'; - var TestOpcode = (function (_Opcode18) { - babelHelpers.inherits(TestOpcode, _Opcode18); + /** + @class ControllerMixin + @namespace Ember + @uses Ember.ActionHandler + @private + */ + exports.default = _emberMetal.Mixin.create(_emberRuntimeMixinsAction_handler.default, _emberRuntimeMixinsController_content_model_alias_deprecation.default, { + /* ducktype as a controller */ + isController: true, - function TestOpcode(testFunc) { - _Opcode18.call(this); - this.testFunc = testFunc; - this.type = "test"; - } + /** + The object to which actions from the view should be sent. + For example, when a Handlebars template uses the `{{action}}` helper, + it will attempt to send the action to the view's controller's `target`. + By default, the value of the target property is set to the router, and + is injected when a controller is instantiated. This injection is applied + as part of the application's initialization process. In most cases the + `target` property will automatically be set to the logical consumer of + actions for the controller. + @property target + @default null + @public + */ + target: null, - TestOpcode.prototype.evaluate = function evaluate(vm) { - vm.frame.setCondition(this.testFunc(vm.frame.getOperand(), vm.env)); - }; + store: null, - TestOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: ["$OPERAND", this.testFunc.name] - }; - }; + /** + The controller's current model. When retrieving or modifying a controller's + model, this property should be used instead of the `content` property. + @property model + @public + */ + model: null, - return TestOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + @private + */ + content: _emberMetal.alias('model') - exports.TestOpcode = TestOpcode; + }); +}); +enifed('ember-runtime/mixins/controller_content_model_alias_deprecation', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - var JumpOpcode = (function (_Opcode19) { - babelHelpers.inherits(JumpOpcode, _Opcode19); + /* + The ControllerContentModelAliasDeprecation mixin is used to provide a useful + deprecation warning when specifying `content` directly on a `Ember.Controller` + (without also specifying `model`). + + Ember versions prior to 1.7 used `model` as an alias of `content`, but due to + much confusion this alias was reversed (so `content` is now an alias of `model). + + This change reduces many caveats with model/content, and also sets a + simple ground rule: Never set a controllers content, rather always set + its model and ember will do the right thing. + + Used internally by Ember in `Ember.Controller`. + */ + exports.default = _emberMetal.Mixin.create({ + /** + @private + Moves `content` to `model` at extend time if a `model` 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) { + // Calling super is only OK here since we KNOW that + // there is another Mixin loaded first. + this._super.apply(this, arguments); - function JumpOpcode(target) { - _Opcode19.call(this); - this.target = target; - this.type = "jump"; - } + var modelSpecified = !!props.model; - JumpOpcode.prototype.evaluate = function evaluate(vm) { - vm.goto(this.target); - }; + if (props.content && !modelSpecified) { + props.model = props.content; + delete props['content']; + } + } + }); +}); +enifed('ember-runtime/mixins/copyable', ['exports', 'ember-metal', 'ember-runtime/mixins/freezable'], function (exports, _emberMetal, _emberRuntimeMixinsFreezable) { + /** + @module ember + @submodule ember-runtime + */ - JumpOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.target.inspect())] - }; - }; + 'use strict'; - return JumpOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + /** + 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. + + You should generally implement the `copy()` method to return a copy of the + receiver. + + Note that `frozenCopy()` will only work if you also implement + `Ember.Freezable`. + + @class Copyable + @namespace Ember + @since Ember 0.9 + @private + */ + exports.default = _emberMetal.Mixin.create({ + /** + __Required.__ You must implement this method to apply this mixin. + Override to return a copy of the receiver. Default implementation raises + an exception. + @method copy + @param {Boolean} deep if `true`, a deep copy of the object should be made + @return {Object} copy of receiver + @private + */ + copy: null, - exports.JumpOpcode = JumpOpcode; + /** + If the object implements `Ember.Freezable`, then this will return a new + copy if the object is not frozen and the receiver if the object is frozen. + Raises an exception if you try to call this method on a object that does + not support freezing. + You should use this method whenever you want a copy of a freezable object + since a freezable object can simply return itself without actually + consuming more memory. + @method frozenCopy + @return {Object} copy of receiver or receiver + @deprecated Use `Object.freeze` instead. + @private + */ + frozenCopy: function () { + if (_emberRuntimeMixinsFreezable.Freezable && _emberRuntimeMixinsFreezable.Freezable.detect(this)) { + return _emberMetal.get(this, 'isFrozen') ? this : this.copy().freeze(); + } else { + throw new _emberMetal.Error(this + ' does not support freezing'); + } + } + }); +}); +enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/compare', 'require'], function (exports, _emberUtils, _emberMetal, _emberRuntimeCompare, _require) { + /** + @module ember + @submodule ember-runtime + */ - var JumpIfOpcode = (function (_JumpOpcode) { - babelHelpers.inherits(JumpIfOpcode, _JumpOpcode); + // .......................................................... + // HELPERS + // - function JumpIfOpcode() { - _JumpOpcode.apply(this, arguments); - this.type = "jump-if"; - } + 'use strict'; - JumpIfOpcode.prototype.evaluate = function evaluate(vm) { - var reference = vm.frame.getCondition(); - if (_glimmerReference.isConst(reference)) { - if (reference.value()) { - _JumpOpcode.prototype.evaluate.call(this, vm); - } - } else { - var cache = new _glimmerReference.ReferenceCache(reference); - if (cache.peek()) { - _JumpOpcode.prototype.evaluate.call(this, vm); - } - vm.updateWith(new Assert(cache)); - } - }; + var _emberA = undefined; - return JumpIfOpcode; - })(JumpOpcode); + function emberA() { + return (_emberA || (_emberA = _require.default('ember-runtime/system/native_array').A))(); + } - exports.JumpIfOpcode = JumpIfOpcode; + var contexts = []; - var JumpUnlessOpcode = (function (_JumpOpcode2) { - babelHelpers.inherits(JumpUnlessOpcode, _JumpOpcode2); + function popCtx() { + return contexts.length === 0 ? {} : contexts.pop(); + } - function JumpUnlessOpcode() { - _JumpOpcode2.apply(this, arguments); - this.type = "jump-unless"; - } + function pushCtx(ctx) { + contexts.push(ctx); + return null; + } - JumpUnlessOpcode.prototype.evaluate = function evaluate(vm) { - var reference = vm.frame.getCondition(); - if (_glimmerReference.isConst(reference)) { - if (!reference.value()) { - _JumpOpcode2.prototype.evaluate.call(this, vm); - } - } else { - var cache = new _glimmerReference.ReferenceCache(reference); - if (!cache.peek()) { - _JumpOpcode2.prototype.evaluate.call(this, vm); - } - vm.updateWith(new Assert(cache)); - } - }; + function iter(key, value) { + var valueProvided = arguments.length === 2; - return JumpUnlessOpcode; - })(JumpOpcode); + function i(item) { + var cur = _emberMetal.get(item, key); + return valueProvided ? value === cur : !!cur; + } - exports.JumpUnlessOpcode = JumpUnlessOpcode; + return i; + } - var Assert = (function (_UpdatingOpcode) { - babelHelpers.inherits(Assert, _UpdatingOpcode); + /** + This mixin defines the common interface implemented by enumerable objects + in Ember. Most of these methods follow the standard Array iteration + API defined up to JavaScript 1.8 (excluding language-specific features that + cannot be emulated in older versions of JavaScript). + + This mixin is applied automatically to the Array class on page load, so you + can use any of these methods on simple arrays. If Array already implements + one of these methods, the mixin will not override them. + + ## Writing Your Own Enumerable + + To make your own custom class enumerable, you need two items: + + 1. You must have a length property. This property should change whenever + the number of items in your enumerable object changes. If you use this + with an `Ember.Object` subclass, you should be sure to change the length + property using `set().` + + 2. You must implement `nextObject().` See documentation. + + Once you have these two methods implemented, apply the `Ember.Enumerable` mixin + to your class and you will be able to enumerate the contents of your object + like any other collection. + + ## Using Ember Enumeration with Other Libraries + + Many other libraries provide some kind of iterator or enumeration like + facility. This is often where the most common API conflicts occur. + Ember's API is designed to be as friendly as possible with other + libraries by implementing only methods that mostly correspond to the + JavaScript 1.8 API. + + @class Enumerable + @namespace Ember + @since Ember 0.9 + @private + */ + var Enumerable = _emberMetal.Mixin.create({ - function Assert(cache) { - _UpdatingOpcode.call(this); - this.type = "assert"; - this.tag = cache.tag; - this.cache = cache; - } + /** + __Required.__ You must implement this method to apply this mixin. + Implement this method to make your class enumerable. + This method will be called repeatedly during enumeration. The index value + will always begin with 0 and increment monotonically. You don't have to + rely on the index value to determine what object to return, but you should + always check the value and start from the beginning when you see the + requested index is 0. + The `previousObject` is the object that was returned from the last call + to `nextObject` for the current iteration. This is a useful way to + manage iteration if you are tracing a linked list, for example. + Finally the context parameter will always contain a hash you can use as + a "scratchpad" to maintain any other state you need in order to iterate + properly. The context object is reused and is not reset between + iterations so make sure you setup the context with a fresh state whenever + the index parameter is 0. + Generally iterators will continue to call `nextObject` until the index + reaches the current length-1. If you run out of data before this + time for some reason, you should simply return undefined. + The default implementation of this method simply looks up the index. + This works great on any Array-like objects. + @method nextObject + @param {Number} index the current index of the iteration + @param {Object} previousObject the value returned by the last call to + `nextObject`. + @param {Object} context a context object you can use to maintain state. + @return {Object} the next object in the iteration or undefined + @private + */ + nextObject: null, - Assert.prototype.evaluate = function evaluate(vm) { - var cache = this.cache; + /** + Helper method returns the first object from a collection. This is usually + used by bindings and other parts of the framework to extract a single + object if the enumerable contains only one item. + If you override this method, you should implement it so that it will + always return the same value each time it is called. If your enumerable + contains only one object, this method should always return that object. + If your enumerable is empty, this method should return `undefined`. + ```javascript + let arr = ['a', 'b', 'c']; + arr.get('firstObject'); // 'a' + let arr = []; + arr.get('firstObject'); // undefined + ``` + @property firstObject + @return {Object} the object or undefined + @readOnly + @public + */ + firstObject: _emberMetal.computed('[]', function () { + if (_emberMetal.get(this, 'length') === 0) { + return undefined; + } - if (_glimmerReference.isModified(cache.revalidate())) { - vm.throw(); - } - }; + // handle generic enumerables + var context = popCtx(); + var ret = this.nextObject(0, null, context); - Assert.prototype.toJSON = function toJSON() { - var type = this.type; - var _guid = this._guid; - var cache = this.cache; + pushCtx(context); - var expected = undefined; - try { - expected = JSON.stringify(cache.peek()); - } catch (e) { - expected = String(cache.peek()); - } - return { - guid: _guid, - type: type, - args: [], - details: { expected: expected } - }; - }; + return ret; + }).readOnly(), - return Assert; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + /** + Helper method returns the last object from a collection. If your enumerable + contains only one object, this method should always return that object. + If your enumerable is empty, this method should return `undefined`. + ```javascript + let arr = ['a', 'b', 'c']; + arr.get('lastObject'); // 'c' + let arr = []; + arr.get('lastObject'); // undefined + ``` + @property lastObject + @return {Object} the last object or undefined + @readOnly + @public + */ + lastObject: _emberMetal.computed('[]', function () { + var len = _emberMetal.get(this, 'length'); - exports.Assert = Assert; + if (len === 0) { + return undefined; + } - var JumpIfNotModifiedOpcode = (function (_UpdatingOpcode2) { - babelHelpers.inherits(JumpIfNotModifiedOpcode, _UpdatingOpcode2); + var context = popCtx(); + var idx = 0; + var last = null; + var cur = undefined; - function JumpIfNotModifiedOpcode(tag, target) { - _UpdatingOpcode2.call(this); - this.target = target; - this.type = "jump-if-not-modified"; - this.tag = tag; - this.lastRevision = tag.value(); - } + do { + last = cur; + cur = this.nextObject(idx++, last, context); + } while (cur !== undefined); - JumpIfNotModifiedOpcode.prototype.evaluate = function evaluate(vm) { - var tag = this.tag; - var target = this.target; - var lastRevision = this.lastRevision; + pushCtx(context); - if (!vm.alwaysRevalidate && tag.validate(lastRevision)) { - vm.goto(target); - } - }; + return last; + }).readOnly(), - JumpIfNotModifiedOpcode.prototype.didModify = function didModify() { - this.lastRevision = this.tag.value(); - }; + /** + Returns `true` if the passed object can be found in the receiver. The + default version will iterate through the enumerable until the object + is found. You may want to override this with a more efficient version. + ```javascript + let arr = ['a', 'b', 'c']; + arr.contains('a'); // true + arr.contains('z'); // false + ``` + @method contains + @deprecated Use `Enumerable#includes` instead. See http://emberjs.com/deprecations/v2.x#toc_enumerable-contains + @param {Object} obj The object to search for. + @return {Boolean} `true` if object is found in enumerable. + @public + */ + contains: function (obj) { - JumpIfNotModifiedOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - args: [JSON.stringify(this.target.inspect())] - }; - }; + var found = this.find(function (item) { + return item === obj; + }); - return JumpIfNotModifiedOpcode; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + return found !== undefined; + }, - exports.JumpIfNotModifiedOpcode = JumpIfNotModifiedOpcode; + /** + Iterates through the enumerable, calling the passed function on each + item. This method corresponds to the `forEach()` method defined in + JavaScript 1.6. + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(item, index, enumerable); + ``` + - `item` is the current item in the iteration. + - `index` is the current index in the iteration. + - `enumerable` is the enumerable object itself. + Note that in addition to a callback, you can also pass an optional target + object that will be set as `this` on the context. This is a good way + 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 + @public + */ + forEach: function (callback, target) { + if (typeof callback !== 'function') { + throw new TypeError(); + } - var DidModifyOpcode = (function (_UpdatingOpcode3) { - babelHelpers.inherits(DidModifyOpcode, _UpdatingOpcode3); + var context = popCtx(); + var len = _emberMetal.get(this, 'length'); + var last = null; - function DidModifyOpcode(target) { - _UpdatingOpcode3.call(this); - this.target = target; - this.type = "did-modify"; - this.tag = _glimmerReference.CONSTANT_TAG; - } + if (target === undefined) { + target = null; + } - DidModifyOpcode.prototype.evaluate = function evaluate() { - this.target.didModify(); - }; + for (var idx = 0; idx < len; idx++) { + var next = this.nextObject(idx, last, context); + callback.call(target, next, idx, this); + last = next; + } - return DidModifyOpcode; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + last = null; + context = pushCtx(context); - exports.DidModifyOpcode = DidModifyOpcode; -}); + return this; + }, -enifed('glimmer-runtime/lib/compiler', ['exports', 'glimmer-util', 'glimmer-runtime/lib/utils', 'glimmer-runtime/lib/syntax/core', 'glimmer-runtime/lib/compiled/blocks', 'glimmer-runtime/lib/compiled/expressions/function', 'glimmer-runtime/lib/compiled/opcodes/builder'], function (exports, _glimmerUtil, _glimmerRuntimeLibUtils, _glimmerRuntimeLibSyntaxCore, _glimmerRuntimeLibCompiledBlocks, _glimmerRuntimeLibCompiledExpressionsFunction, _glimmerRuntimeLibCompiledOpcodesBuilder) { - 'use strict'; + /** + Alias for `mapBy` + @method getEach + @param {String} key name of the property + @return {Array} The mapped array. + @public + */ + getEach: _emberMetal.aliasMethod('mapBy'), - exports.compileLayout = compileLayout; + /** + Sets the value on the named property for each member. This is more + ergonomic than using other methods defined on this helper. If the object + implements Ember.Observable, the value will be changed to `set(),` otherwise + it will be set directly. `null` objects are skipped. + @method setEach + @param {String} key The key to set + @param {Object} value The object to set + @return {Object} receiver + @public + */ + setEach: function (key, value) { + return this.forEach(function (item) { + return _emberMetal.set(item, key, value); + }); + }, - var Compiler = (function () { - function Compiler(block, env) { - this.block = block; - this.env = env; - this.current = block.program.head(); - this.symbolTable = block.symbolTable; - } + /** + Maps all of the items in the enumeration to another value, returning + a new array. This method corresponds to `map()` defined in JavaScript 1.6. + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(item, index, enumerable); + ``` + - `item` is the current item in the iteration. + - `index` is the current index in the iteration. + - `enumerable` is the enumerable object itself. + It should return the mapped value. + Note that in addition to a callback, you can also pass an optional target + object that will be set as `this` on the context. This is a good way + to give your iterator function access to the current object. + @method map + @param {Function} callback The callback to execute + @param {Object} [target] The target object to use + @return {Array} The mapped array. + @public + */ + map: function (callback, target) { + var ret = emberA(); - Compiler.prototype.compileStatement = function compileStatement(statement, ops) { - this.env.statement(statement, this.symbolTable).compile(ops, this.env, this.symbolTable); - }; + this.forEach(function (x, idx, i) { + return ret[idx] = callback.call(target, x, idx, i); + }); - return Compiler; - })(); + return ret; + }, - function compileStatement(env, statement, ops, layout) { - env.statement(statement, layout.symbolTable).compile(ops, env, layout.symbolTable); - } - exports.default = Compiler; + /** + Similar to map, this specialized function returns the value of the named + property on all items in the enumeration. + @method mapBy + @param {String} key name of the property + @return {Array} The mapped array. + @public + */ + mapBy: function (key) { + return this.map(function (next) { + return _emberMetal.get(next, key); + }); + }, - var EntryPointCompiler = (function (_Compiler) { - babelHelpers.inherits(EntryPointCompiler, _Compiler); + /** + Returns an array with all of the items in the enumeration that the passed + function returns true for. This method corresponds to `filter()` defined in + JavaScript 1.6. + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(item, index, enumerable); + ``` + - `item` is the current item in the iteration. + - `index` is the current index in the iteration. + - `enumerable` is the enumerable object itself. + It should return `true` to include the item in the results, `false` + otherwise. + Note that in addition to a callback, you can also pass an optional target + object that will be set as `this` on the context. This is a good way + to give your iterator function access to the current object. + @method filter + @param {Function} callback The callback to execute + @param {Object} [target] The target object to use + @return {Array} A filtered array. + @public + */ + filter: function (callback, target) { + var ret = emberA(); - function EntryPointCompiler(template, env) { - _Compiler.call(this, template, env); - var list = new CompileIntoList(env, template.symbolTable); - this.ops = new _glimmerRuntimeLibCompiledOpcodesBuilder.default(list, template.symbolTable, env); + this.forEach(function (x, idx, i) { + if (callback.call(target, x, idx, i)) { + ret.push(x); } + }); - EntryPointCompiler.prototype.compile = function compile() { - var block = this.block; - var ops = this.ops; - var program = block.program; - - var current = program.head(); - while (current) { - var next = program.nextNode(current); - this.compileStatement(current, ops); - current = next; - } - return ops.toOpSeq(); - }; - - EntryPointCompiler.prototype.append = function append(op) { - this.ops.append(op); - }; - - EntryPointCompiler.prototype.getLocalSymbol = function getLocalSymbol(name) { - return this.symbolTable.getLocal(name); - }; - - EntryPointCompiler.prototype.getNamedSymbol = function getNamedSymbol(name) { - return this.symbolTable.getNamed(name); - }; - - EntryPointCompiler.prototype.getYieldSymbol = function getYieldSymbol(name) { - return this.symbolTable.getYield(name); - }; - - return EntryPointCompiler; - })(Compiler); + return ret; + }, - exports.EntryPointCompiler = EntryPointCompiler; + /** + Returns an array with all of the items in the enumeration where the passed + function returns false. This method is the inverse of filter(). + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(item, index, enumerable); + ``` + - *item* is the current item in the iteration. + - *index* is the current index in the iteration + - *enumerable* is the enumerable object itself. + It should return a falsey value to include the item in the results. + Note that in addition to a callback, you can also pass an optional target + object that will be set as "this" on the context. This is a good way + to give your iterator function access to the current object. + @method reject + @param {Function} callback The callback to execute + @param {Object} [target] The target object to use + @return {Array} A rejected array. + @public + */ + reject: function (callback, target) { + return this.filter(function () { + return !callback.apply(target, arguments); + }); + }, - var InlineBlockCompiler = (function (_Compiler2) { - babelHelpers.inherits(InlineBlockCompiler, _Compiler2); + /** + Returns an array with just the items with the matched property. You + can pass an optional second argument with the target value. Otherwise + this will match any property that evaluates to `true`. + @method filterBy + @param {String} key the property to test + @param {*} [value] optional value to test against. + @return {Array} filtered array + @public + */ + filterBy: function (key, value) { + return this.filter(iter.apply(this, arguments)); + }, - function InlineBlockCompiler(block, env) { - _Compiler2.call(this, block, env); - this.block = block; - var list = new CompileIntoList(env, block.symbolTable); - this.ops = new _glimmerRuntimeLibCompiledOpcodesBuilder.default(list, block.symbolTable, env); - } + /** + Returns an array with the items that do not have truthy values for + key. You can pass an optional second argument with the target value. Otherwise + this will match any property that evaluates to false. + @method rejectBy + @param {String} key the property to test + @param {String} [value] optional value to test against. + @return {Array} rejected array + @public + */ + rejectBy: function (key, value) { + var exactValue = function (item) { + return _emberMetal.get(item, key) === value; + }; + var hasValue = function (item) { + return !!_emberMetal.get(item, key); + }; + var use = arguments.length === 2 ? exactValue : hasValue; - InlineBlockCompiler.prototype.compile = function compile() { - var block = this.block; - var ops = this.ops; - var program = block.program; + return this.reject(use); + }, - var hasPositionalParameters = block.hasPositionalParameters(); - if (hasPositionalParameters) { - ops.pushChildScope(); - ops.bindPositionalArgsForBlock(block); - } - var current = program.head(); - while (current) { - var next = program.nextNode(current); - this.compileStatement(current, ops); - current = next; - } - if (hasPositionalParameters) { - ops.popScope(); - } - return ops.toOpSeq(); - }; + /** + Returns the first item in the array for which the callback returns true. + This method works similar to the `filter()` method defined in JavaScript 1.6 + except that it will stop working on the array once a match is found. + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(item, index, enumerable); + ``` + - `item` is the current item in the iteration. + - `index` is the current index in the iteration. + - `enumerable` is the enumerable object itself. + It should return the `true` to include the item in the results, `false` + otherwise. + Note that in addition to a callback, you can also pass an optional target + object that will be set as `this` on the context. This is a good way + to give your iterator function access to the current object. + @method find + @param {Function} callback The callback to execute + @param {Object} [target] The target object to use + @return {Object} Found item or `undefined`. + @public + */ + find: function (callback, target) { + var len = _emberMetal.get(this, 'length'); - return InlineBlockCompiler; - })(Compiler); + if (target === undefined) { + target = null; + } - exports.InlineBlockCompiler = InlineBlockCompiler; + var context = popCtx(); + var found = false; + var last = null; + var next = undefined, + ret = undefined; - function compileLayout(compilable, env) { - var builder = new ComponentLayoutBuilder(env); - compilable.compile(builder); - return builder.compile(); - } + for (var idx = 0; idx < len && !found; idx++) { + next = this.nextObject(idx, last, context); - var ComponentLayoutBuilder = (function () { - function ComponentLayoutBuilder(env) { - this.env = env; + found = callback.call(target, next, idx, this); + if (found) { + ret = next; } - ComponentLayoutBuilder.prototype.empty = function empty() { - this.inner = new EmptyBuilder(this.env); - }; + last = next; + } - ComponentLayoutBuilder.prototype.wrapLayout = function wrapLayout(layout) { - this.inner = new WrappedBuilder(this.env, layout); - }; + next = last = null; + context = pushCtx(context); - ComponentLayoutBuilder.prototype.fromLayout = function fromLayout(layout) { - this.inner = new UnwrappedBuilder(this.env, layout); - }; + return ret; + }, - ComponentLayoutBuilder.prototype.compile = function compile() { - return this.inner.compile(); - }; + /** + Returns the first item with a property matching the passed value. You + can pass an optional second argument with the target value. Otherwise + this will match any property that evaluates to `true`. + This method works much like the more generic `find()` method. + @method findBy + @param {String} key the property to test + @param {String} [value] optional value to test against. + @return {Object} found item or `undefined` + @public + */ + findBy: function (key, value) { + return this.find(iter.apply(this, arguments)); + }, - babelHelpers.createClass(ComponentLayoutBuilder, [{ - key: 'tag', - get: function () { - return this.inner.tag; - } - }, { - key: 'attrs', - get: function () { - return this.inner.attrs; - } - }]); - return ComponentLayoutBuilder; - })(); + /** + Returns `true` if the passed function returns true for every item in the + enumeration. This corresponds with the `every()` method in JavaScript 1.6. + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(item, index, enumerable); + ``` + - `item` is the current item in the iteration. + - `index` is the current index in the iteration. + - `enumerable` is the enumerable object itself. + It should return the `true` or `false`. + Note that in addition to a callback, you can also pass an optional target + object that will be set as `this` on the context. This is a good way + to give your iterator function access to the current object. + Example Usage: + ```javascript + if (people.every(isEngineer)) { + Paychecks.addBigBonus(); + } + ``` + @method every + @param {Function} callback The callback to execute + @param {Object} [target] The target object to use + @return {Boolean} + @public + */ + every: function (callback, target) { + return !this.find(function (x, idx, i) { + return !callback.call(target, x, idx, i); + }); + }, - var EmptyBuilder = (function () { - function EmptyBuilder(env) { - this.env = env; - } + /** + Returns `true` if the passed property resolves to the value of the second + argument for all items in the enumerable. This method is often simpler/faster + than using a callback. + @method isEvery + @param {String} key the property to test + @param {String} [value] optional value to test against. Defaults to `true` + @return {Boolean} + @since 1.3.0 + @public + */ + isEvery: function (key, value) { + return this.every(iter.apply(this, arguments)); + }, - EmptyBuilder.prototype.compile = function compile() { - var env = this.env; + /** + Returns `true` if the passed function returns true for any item in the + enumeration. This corresponds with the `some()` method in JavaScript 1.6. + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(item, index, enumerable); + ``` + - `item` is the current item in the iteration. + - `index` is the current index in the iteration. + - `enumerable` is the enumerable object itself. + It should return the `true` to include the item in the results, `false` + otherwise. + Note that in addition to a callback, you can also pass an optional target + object that will be set as `this` on the context. This is a good way + to give your iterator function access to the current object. + Usage Example: + ```javascript + if (people.any(isManager)) { + Paychecks.addBiggerBonus(); + } + ``` + @method any + @param {Function} callback The callback to execute + @param {Object} [target] The target object to use + @return {Boolean} `true` if the passed function returns `true` for any item + @public + */ + any: function (callback, target) { + var len = _emberMetal.get(this, 'length'); + var context = popCtx(); + var found = false; + var last = null; + var next = undefined; - var list = new CompileIntoList(env, null); - return new _glimmerRuntimeLibCompiledBlocks.CompiledBlock(list, 0); - }; + if (target === undefined) { + target = null; + } - babelHelpers.createClass(EmptyBuilder, [{ - key: 'tag', - get: function () { - throw new Error('Nope'); - } - }, { - key: 'attrs', - get: function () { - throw new Error('Nope'); - } - }]); - return EmptyBuilder; - })(); + for (var idx = 0; idx < len && !found; idx++) { + next = this.nextObject(idx, last, context); + found = callback.call(target, next, idx, this); + last = next; + } - var WrappedBuilder = (function () { - function WrappedBuilder(env, layout) { - this.env = env; - this.layout = layout; - this.tag = new ComponentTagBuilder(); - this.attrs = new ComponentAttrsBuilder(); - } - - WrappedBuilder.prototype.compile = function compile() { - //========DYNAMIC - // PutValue(TagExpr) - // Test - // JumpUnless(BODY) - // OpenDynamicPrimitiveElement - // DidCreateElement - // ...attr statements... - // FlushElement - // BODY: Noop - // ...body statements... - // PutValue(TagExpr) - // Test - // JumpUnless(END) - // CloseElement - // END: Noop - // DidRenderLayout - // Exit - // - //========STATIC - // OpenPrimitiveElementOpcode - // DidCreateElement - // ...attr statements... - // FlushElement - // ...body statements... - // CloseElement - // DidRenderLayout - // Exit - var env = this.env; - var layout = this.layout; - - var symbolTable = layout.symbolTable; - var buffer = new CompileIntoList(env, layout.symbolTable); - var dsl = new _glimmerRuntimeLibCompiledOpcodesBuilder.default(buffer, layout.symbolTable, env); - dsl.startLabels(); - if (this.tag.isDynamic) { - dsl.putValue(this.tag.dynamicTagName); - dsl.test('simple'); - dsl.jumpUnless('BODY'); - dsl.openDynamicPrimitiveElement(); - dsl.didCreateElement(); - this.attrs['buffer'].forEach(function (statement) { - return compileStatement(env, statement, dsl, layout); - }); - dsl.flushElement(); - dsl.label('BODY'); - } else if (this.tag.isStatic) { - var tag = this.tag.staticTagName; - dsl.openPrimitiveElement(tag); - dsl.didCreateElement(); - this.attrs['buffer'].forEach(function (statement) { - return compileStatement(env, statement, dsl, layout); - }); - dsl.flushElement(); - } - dsl.preludeForLayout(layout); - layout.program.forEachNode(function (statement) { - return compileStatement(env, statement, dsl, layout); - }); - if (this.tag.isDynamic) { - dsl.putValue(this.tag.dynamicTagName); - dsl.test('simple'); - dsl.jumpUnless('END'); - dsl.closeElement(); - dsl.label('END'); - } else if (this.tag.isStatic) { - dsl.closeElement(); - } - dsl.didRenderLayout(); - dsl.stopLabels(); - return new _glimmerRuntimeLibCompiledBlocks.CompiledBlock(dsl.toOpSeq(), symbolTable.size); - }; + next = last = null; + context = pushCtx(context); + return found; + }, - return WrappedBuilder; - })(); + /** + Returns `true` if the passed property resolves to the value of the second + argument for any item in the enumerable. This method is often simpler/faster + than using a callback. + @method isAny + @param {String} key the property to test + @param {String} [value] optional value to test against. Defaults to `true` + @return {Boolean} + @since 1.3.0 + @public + */ + isAny: function (key, value) { + return this.any(iter.apply(this, arguments)); + }, - var UnwrappedBuilder = (function () { - function UnwrappedBuilder(env, layout) { - this.env = env; - this.layout = layout; - this.attrs = new ComponentAttrsBuilder(); - } - - UnwrappedBuilder.prototype.compile = function compile() { - var env = this.env; - var layout = this.layout; - - var buffer = new CompileIntoList(env, layout.symbolTable); - var dsl = new _glimmerRuntimeLibCompiledOpcodesBuilder.default(buffer, layout.symbolTable, env); - dsl.startLabels(); - dsl.preludeForLayout(layout); - var attrs = this.attrs['buffer']; - var attrsInserted = false; - this.layout.program.forEachNode(function (statement) { - if (!attrsInserted && isOpenElement(statement)) { - dsl.openComponentElement(statement.tag); - dsl.didCreateElement(); - dsl.shadowAttributes(); - attrs.forEach(function (statement) { - return compileStatement(env, statement, dsl, layout); - }); - attrsInserted = true; - } else { - compileStatement(env, statement, dsl, layout); - } - }); - dsl.didRenderLayout(); - dsl.stopLabels(); - return new _glimmerRuntimeLibCompiledBlocks.CompiledBlock(dsl.toOpSeq(), layout.symbolTable.size); - }; + /** + This will combine the values of the enumerator into a single value. It + is a useful way to collect a summary value from an enumeration. This + corresponds to the `reduce()` method defined in JavaScript 1.8. + The callback method you provide should have the following signature (all + parameters are optional): + ```javascript + function(previousValue, item, index, enumerable); + ``` + - `previousValue` is the value returned by the last call to the iterator. + - `item` is the current item in the iteration. + - `index` is the current index in the iteration. + - `enumerable` is the enumerable object itself. + Return the new cumulative value. + In addition to the callback you can also pass an `initialValue`. An error + will be raised if you do not pass an initial value and the enumerator is + empty. + Note that unlike the other methods, this method does not allow you to + pass a target object to set as this for the callback. It's part of the + spec. Sorry. + @method reduce + @param {Function} callback The callback to execute + @param {Object} initialValue Initial value for the reduce + @param {String} reducerProperty internal use only. + @return {Object} The reduced value. + @public + */ + reduce: function (callback, initialValue, reducerProperty) { + if (typeof callback !== 'function') { + throw new TypeError(); + } - babelHelpers.createClass(UnwrappedBuilder, [{ - key: 'tag', - get: function () { - throw new Error('BUG: Cannot call `tag` on an UnwrappedBuilder'); - } - }]); - return UnwrappedBuilder; - })(); + var ret = initialValue; - function isOpenElement(syntax) { - return syntax instanceof _glimmerRuntimeLibSyntaxCore.OpenElement || syntax instanceof _glimmerRuntimeLibSyntaxCore.OpenPrimitiveElement; - } + this.forEach(function (item, i) { + ret = callback(ret, item, i, this, reducerProperty); + }, this); - var ComponentTagBuilder = (function () { - function ComponentTagBuilder() { - this.isDynamic = null; - this.isStatic = null; - this.staticTagName = null; - this.dynamicTagName = null; - } + return ret; + }, - ComponentTagBuilder.prototype.static = function _static(tagName) { - this.isStatic = true; - this.staticTagName = tagName; - }; + /** + Invokes the named method on every object in the receiver that + implements it. This method corresponds to the implementation in + Prototype 1.6. + @method invoke + @param {String} methodName the name of the method + @param {Object...} args optional arguments to pass as well. + @return {Array} return values from calling invoke. + @public + */ + invoke: function (methodName) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } - ComponentTagBuilder.prototype.dynamic = function dynamic(tagName) { - this.isDynamic = true; - this.dynamicTagName = _glimmerRuntimeLibCompiledExpressionsFunction.default(tagName); - }; + var ret = emberA(); - return ComponentTagBuilder; - })(); + this.forEach(function (x, idx) { + var method = x && x[methodName]; - var ComponentAttrsBuilder = (function () { - function ComponentAttrsBuilder() { - this.buffer = []; + if ('function' === typeof method) { + ret[idx] = args ? method.apply(x, args) : x[methodName](); } + }, this); - ComponentAttrsBuilder.prototype.static = function _static(name, value) { - this.buffer.push(new _glimmerRuntimeLibSyntaxCore.StaticAttr(name, value, null)); - }; - - ComponentAttrsBuilder.prototype.dynamic = function dynamic(name, value) { - this.buffer.push(new _glimmerRuntimeLibSyntaxCore.DynamicAttr(name, _glimmerRuntimeLibCompiledExpressionsFunction.default(value), null, false)); - }; - - return ComponentAttrsBuilder; - })(); + return ret; + }, - var ComponentBuilder = (function () { - function ComponentBuilder(dsl) { - this.dsl = dsl; - this.env = dsl.env; - } + /** + Simply converts the enumerable into a genuine array. The order is not + guaranteed. Corresponds to the method implemented by Prototype. + @method toArray + @return {Array} the enumerable as an array. + @public + */ + toArray: function () { + var ret = emberA(); - ComponentBuilder.prototype.static = function _static(definition, args, symbolTable) { - var shadow = arguments.length <= 3 || arguments[3] === undefined ? _glimmerRuntimeLibUtils.EMPTY_ARRAY : arguments[3]; + this.forEach(function (o, idx) { + return ret[idx] = o; + }); - this.dsl.unit(function (dsl) { - dsl.putComponentDefinition(definition); - dsl.openComponent(args, shadow); - dsl.closeComponent(); - }); - }; + return ret; + }, - ComponentBuilder.prototype.dynamic = function dynamic(definitionArgs, definition, args, symbolTable) { - var shadow = arguments.length <= 4 || arguments[4] === undefined ? _glimmerRuntimeLibUtils.EMPTY_ARRAY : arguments[4]; - - this.dsl.unit(function (dsl) { - dsl.putArgs(definitionArgs); - dsl.putValue(_glimmerRuntimeLibCompiledExpressionsFunction.default(definition)); - dsl.test('simple'); - dsl.enter('BEGIN', 'END'); - dsl.label('BEGIN'); - dsl.jumpUnless('END'); - dsl.putDynamicComponentDefinition(); - dsl.openComponent(args, shadow); - dsl.closeComponent(); - dsl.label('END'); - dsl.exit(); - }); - }; + /** + Returns a copy of the array with all `null` and `undefined` elements removed. + ```javascript + let arr = ['a', null, 'c', undefined]; + arr.compact(); // ['a', 'c'] + ``` + @method compact + @return {Array} the array without null and undefined elements. + @public + */ + compact: function () { + return this.filter(function (value) { + return value != null; + }); + }, - return ComponentBuilder; - })(); + /** + Returns a new enumerable that excludes the passed value. The default + implementation returns an array regardless of the receiver type. + If the receiver does not contain the value it returns the original enumerable. + ```javascript + let arr = ['a', 'b', 'a', 'c']; + arr.without('a'); // ['b', 'c'] + ``` + @method without + @param {Object} value + @return {Ember.Enumerable} + @public + */ + without: function (value) { + if (!this.includes(value)) { + return this; // nothing to do + } - var CompileIntoList = (function (_LinkedList) { - babelHelpers.inherits(CompileIntoList, _LinkedList); + var ret = emberA(); - function CompileIntoList(env, symbolTable) { - _LinkedList.call(this); - this.env = env; - this.symbolTable = symbolTable; - var dsl = new _glimmerRuntimeLibCompiledOpcodesBuilder.default(this, symbolTable, env); - this.component = new ComponentBuilder(dsl); + this.forEach(function (k) { + // SameValueZero comparison (NaN !== NaN) + if (!(k === value || k !== k && value !== value)) { + ret[ret.length] = k; } + }); - CompileIntoList.prototype.getLocalSymbol = function getLocalSymbol(name) { - return this.symbolTable.getLocal(name); - }; - - CompileIntoList.prototype.hasLocalSymbol = function hasLocalSymbol(name) { - return typeof this.symbolTable.getLocal(name) === 'number'; - }; + return ret; + }, - CompileIntoList.prototype.getNamedSymbol = function getNamedSymbol(name) { - return this.symbolTable.getNamed(name); - }; + /** + Returns a new enumerable that contains only unique values. The default + implementation returns an array regardless of the receiver type. + ```javascript + let arr = ['a', 'a', 'b', 'b']; + arr.uniq(); // ['a', 'b'] + ``` + This only works on primitive data types, e.g. Strings, Numbers, etc. + @method uniq + @return {Ember.Enumerable} + @public + */ + uniq: function () { + var ret = emberA(); - CompileIntoList.prototype.hasNamedSymbol = function hasNamedSymbol(name) { - return typeof this.symbolTable.getNamed(name) === 'number'; - }; + this.forEach(function (k) { + if (ret.indexOf(k) < 0) { + ret.push(k); + } + }); - CompileIntoList.prototype.getBlockSymbol = function getBlockSymbol(name) { - return this.symbolTable.getYield(name); - }; + return ret; + }, - CompileIntoList.prototype.hasBlockSymbol = function hasBlockSymbol(name) { - return typeof this.symbolTable.getYield(name) === 'number'; - }; + /** + This property will trigger anytime the enumerable's content changes. + You can observe this property to be notified of changes to the enumerable's + content. + For plain enumerables, this property is read only. `Array` overrides + this method. + @property [] + @type Array + @return this + @private + */ + '[]': _emberMetal.computed({ + get: function (key) { + return this; + } + }), - CompileIntoList.prototype.getPartialArgsSymbol = function getPartialArgsSymbol() { - return this.symbolTable.getPartialArgs(); - }; + // .......................................................... + // ENUMERABLE OBSERVERS + // - CompileIntoList.prototype.hasPartialArgsSymbol = function hasPartialArgsSymbol() { - return typeof this.symbolTable.getPartialArgs() === 'number'; - }; + /** + Registers an enumerable observer. Must implement `Ember.EnumerableObserver` + mixin. + @method addEnumerableObserver + @param {Object} target + @param {Object} [opts] + @return this + @private + */ + addEnumerableObserver: function (target, opts) { + var willChange = opts && opts.willChange || 'enumerableWillChange'; + var didChange = opts && opts.didChange || 'enumerableDidChange'; + var hasObservers = _emberMetal.get(this, 'hasEnumerableObservers'); - CompileIntoList.prototype.toOpSeq = function toOpSeq() { - return this; - }; + if (!hasObservers) { + _emberMetal.propertyWillChange(this, 'hasEnumerableObservers'); + } - return CompileIntoList; - })(_glimmerUtil.LinkedList); + _emberMetal.addListener(this, '@enumerable:before', target, willChange); + _emberMetal.addListener(this, '@enumerable:change', target, didChange); - exports.CompileIntoList = CompileIntoList; -}); + if (!hasObservers) { + _emberMetal.propertyDidChange(this, 'hasEnumerableObservers'); + } -enifed('glimmer-runtime/lib/component/interfaces', ['exports'], function (exports) { - 'use strict'; + return this; + }, - exports.isComponentDefinition = isComponentDefinition; - var COMPONENT_DEFINITION_BRAND = 'COMPONENT DEFINITION [id=e59c754e-61eb-4392-8c4a-2c0ac72bfcd4]'; + /** + Removes a registered enumerable observer. + @method removeEnumerableObserver + @param {Object} target + @param {Object} [opts] + @return this + @private + */ + removeEnumerableObserver: function (target, opts) { + var willChange = opts && opts.willChange || 'enumerableWillChange'; + var didChange = opts && opts.didChange || 'enumerableDidChange'; + var hasObservers = _emberMetal.get(this, 'hasEnumerableObservers'); - function isComponentDefinition(obj) { - return typeof obj === 'object' && obj && obj[COMPONENT_DEFINITION_BRAND]; - } + if (hasObservers) { + _emberMetal.propertyWillChange(this, 'hasEnumerableObservers'); + } - var ComponentDefinition = function ComponentDefinition(name, manager, ComponentClass) { - this['COMPONENT DEFINITION [id=e59c754e-61eb-4392-8c4a-2c0ac72bfcd4]'] = true; - this.name = name; - this.manager = manager; - this.ComponentClass = ComponentClass; - }; + _emberMetal.removeListener(this, '@enumerable:before', target, willChange); + _emberMetal.removeListener(this, '@enumerable:change', target, didChange); - exports.ComponentDefinition = ComponentDefinition; -}); + if (hasObservers) { + _emberMetal.propertyDidChange(this, 'hasEnumerableObservers'); + } -enifed('glimmer-runtime/lib/dom/attribute-managers', ['exports', 'glimmer-runtime/lib/dom/sanitized-values', 'glimmer-runtime/lib/dom/props', 'glimmer-runtime/lib/dom/helper', 'glimmer-runtime/lib/compiled/opcodes/content'], function (exports, _glimmerRuntimeLibDomSanitizedValues, _glimmerRuntimeLibDomProps, _glimmerRuntimeLibDomHelper, _glimmerRuntimeLibCompiledOpcodesContent) { - 'use strict'; + return this; + }, - exports.defaultManagers = defaultManagers; - exports.defaultPropertyManagers = defaultPropertyManagers; - exports.defaultAttributeManagers = defaultAttributeManagers; - exports.readDOMAttr = readDOMAttr; + /** + Becomes true whenever the array currently has observers watching changes + on the array. + @property hasEnumerableObservers + @type Boolean + @private + */ + hasEnumerableObservers: _emberMetal.computed(function () { + return _emberMetal.hasListeners(this, '@enumerable:change') || _emberMetal.hasListeners(this, '@enumerable:before'); + }), - function defaultManagers(element, attr, isTrusting, namespace) { - var tagName = element.tagName; - var isSVG = element.namespaceURI === _glimmerRuntimeLibDomHelper.SVG_NAMESPACE; - if (isSVG) { - return defaultAttributeManagers(tagName, attr); - } + /** + Invoke this method just before the contents of your enumerable will + change. You can either omit the parameters completely or pass the objects + to be removed or added if available or just a count. + @method enumerableContentWillChange + @param {Ember.Enumerable|Number} removing An enumerable of the objects to + be removed or the number of items to be removed. + @param {Ember.Enumerable|Number} adding An enumerable of the objects to be + added or the number of items to be added. + @chainable + @private + */ + enumerableContentWillChange: function (removing, adding) { + var removeCnt = undefined, + addCnt = undefined, + hasDelta = undefined; - var _normalizeProperty = _glimmerRuntimeLibDomProps.normalizeProperty(element, attr); + if ('number' === typeof removing) { + removeCnt = removing; + } else if (removing) { + removeCnt = _emberMetal.get(removing, 'length'); + } else { + removeCnt = removing = -1; + } - var type = _normalizeProperty.type; - var normalized = _normalizeProperty.normalized; + if ('number' === typeof adding) { + addCnt = adding; + } else if (adding) { + addCnt = _emberMetal.get(adding, 'length'); + } else { + addCnt = adding = -1; + } - if (type === 'attr') { - return defaultAttributeManagers(tagName, normalized); - } else { - return defaultPropertyManagers(tagName, normalized); - } - } + hasDelta = addCnt < 0 || removeCnt < 0 || addCnt - removeCnt !== 0; - function defaultPropertyManagers(tagName, attr) { - if (_glimmerRuntimeLibDomSanitizedValues.requiresSanitization(tagName, attr)) { - return new SafePropertyManager(attr); - } - if (isUserInputValue(tagName, attr)) { - return INPUT_VALUE_PROPERTY_MANAGER; - } - if (isOptionSelected(tagName, attr)) { - return OPTION_SELECTED_MANAGER; - } - return new PropertyManager(attr); - } + if (removing === -1) { + removing = null; + } - function defaultAttributeManagers(tagName, attr) { - if (_glimmerRuntimeLibDomSanitizedValues.requiresSanitization(tagName, attr)) { - return new SafeAttributeManager(attr); - } - return new AttributeManager(attr); - } + if (adding === -1) { + adding = null; + } - function readDOMAttr(element, attr) { - var isSVG = element.namespaceURI === _glimmerRuntimeLibDomHelper.SVG_NAMESPACE; + _emberMetal.propertyWillChange(this, '[]'); - var _normalizeProperty2 = _glimmerRuntimeLibDomProps.normalizeProperty(element, attr); + if (hasDelta) { + _emberMetal.propertyWillChange(this, 'length'); + } - var type = _normalizeProperty2.type; - var normalized = _normalizeProperty2.normalized; + _emberMetal.sendEvent(this, '@enumerable:before', [this, removing, adding]); - if (isSVG) { - return element.getAttribute(normalized); - } - if (type === 'attr') { - return element.getAttribute(normalized); - } - { - return element[normalized]; - } - } + return this; + }, - ; + /** + Invoke this method when the contents of your enumerable has changed. + This will notify any observers watching for content changes. If you are + implementing an ordered enumerable (such as an array), also pass the + start and end values where the content changed so that it can be used to + notify range observers. + @method enumerableContentDidChange + @param {Ember.Enumerable|Number} removing An enumerable of the objects to + be removed or the number of items to be removed. + @param {Ember.Enumerable|Number} adding An enumerable of the objects to + be added or the number of items to be added. + @chainable + @private + */ + enumerableContentDidChange: function (removing, adding) { + var removeCnt = undefined, + addCnt = undefined, + hasDelta = undefined; - var AttributeManager = (function () { - function AttributeManager(attr) { - this.attr = attr; - } + if ('number' === typeof removing) { + removeCnt = removing; + } else if (removing) { + removeCnt = _emberMetal.get(removing, 'length'); + } else { + removeCnt = removing = -1; + } - AttributeManager.prototype.setAttribute = function setAttribute(env, element, value, namespace) { - var dom = env.getAppendOperations(); - var normalizedValue = normalizeAttributeValue(value); - if (!isAttrRemovalValue(normalizedValue)) { - dom.setAttribute(element, this.attr, normalizedValue, namespace); - } - }; + if ('number' === typeof adding) { + addCnt = adding; + } else if (adding) { + addCnt = _emberMetal.get(adding, 'length'); + } else { + addCnt = adding = -1; + } - AttributeManager.prototype.updateAttribute = function updateAttribute(env, element, value, namespace) { - if (value === null || value === undefined || value === false) { - if (namespace) { - env.getDOM().removeAttributeNS(element, namespace, this.attr); - } else { - env.getDOM().removeAttribute(element, this.attr); - } - } else { - this.setAttribute(env, element, value); - } - }; + hasDelta = addCnt < 0 || removeCnt < 0 || addCnt - removeCnt !== 0; - return AttributeManager; - })(); + if (removing === -1) { + removing = null; + } - exports.AttributeManager = AttributeManager; + if (adding === -1) { + adding = null; + } - ; + _emberMetal.sendEvent(this, '@enumerable:change', [this, removing, adding]); - var PropertyManager = (function (_AttributeManager) { - babelHelpers.inherits(PropertyManager, _AttributeManager); + if (hasDelta) { + _emberMetal.propertyDidChange(this, 'length'); + } - function PropertyManager() { - _AttributeManager.apply(this, arguments); - } + _emberMetal.propertyDidChange(this, '[]'); - PropertyManager.prototype.setAttribute = function setAttribute(env, element, value, namespace) { - if (!isAttrRemovalValue(value)) { - element[this.attr] = value; - } - }; + return this; + }, - PropertyManager.prototype.removeAttribute = function removeAttribute(env, element, namespace) { - // TODO this sucks but to preserve properties first and to meet current - // semantics we must do this. - var attr = this.attr; + /** + Converts the enumerable into an array and sorts by the keys + specified in the argument. + 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 + @public + */ + sortBy: function () { + var sortKeys = arguments; - if (namespace) { - env.getDOM().removeAttributeNS(element, namespace, attr); - } else { - env.getDOM().removeAttribute(element, attr); - } - }; + return this.toArray().sort(function (a, b) { + for (var i = 0; i < sortKeys.length; i++) { + var key = sortKeys[i]; + var propA = _emberMetal.get(a, key); + var propB = _emberMetal.get(b, key); + // return 1 or -1 else continue to the next sortKey + var compareValue = _emberRuntimeCompare.default(propA, propB); - PropertyManager.prototype.updateAttribute = function updateAttribute(env, element, value, namespace) { - // ensure the property is always updated - element[this.attr] = value; - if (isAttrRemovalValue(value)) { - this.removeAttribute(env, element, namespace); - } - }; + if (compareValue) { + return compareValue; + } + } + return 0; + }); + }, - return PropertyManager; - })(AttributeManager); + /** + 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 + let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }]; + arr.uniqBy('value'); // [{ value: 'a' }, { value: 'b' }] + ``` + @method uniqBy + @return {Ember.Enumerable} + @public + */ - exports.PropertyManager = PropertyManager; + uniqBy: function (key) { + var ret = emberA(); + var seen = new _emberUtils.EmptyObject(); - ; - function normalizeAttributeValue(value) { - if (value === false || value === undefined || value === null) { - return null; - } - if (value === true) { - return ''; - } - // onclick function etc in SSR - if (typeof value === 'function') { - return null; + this.forEach(function (item) { + var guid = _emberUtils.guidFor(_emberMetal.get(item, key)); + if (!(guid in seen)) { + seen[guid] = true; + ret.push(item); } - return String(value); - } - function isAttrRemovalValue(value) { - return value === null || value === undefined; - } - - var SafePropertyManager = (function (_PropertyManager) { - babelHelpers.inherits(SafePropertyManager, _PropertyManager); + }); - function SafePropertyManager() { - _PropertyManager.apply(this, arguments); - } + return ret; + }, - SafePropertyManager.prototype.setAttribute = function setAttribute(env, element, value) { - _PropertyManager.prototype.setAttribute.call(this, env, element, _glimmerRuntimeLibDomSanitizedValues.sanitizeAttributeValue(env, element, this.attr, value)); - }; + /** + 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) { - SafePropertyManager.prototype.updateAttribute = function updateAttribute(env, element, value) { - _PropertyManager.prototype.updateAttribute.call(this, env, element, _glimmerRuntimeLibDomSanitizedValues.sanitizeAttributeValue(env, element, this.attr, value)); - }; + var len = _emberMetal.get(this, 'length'); + var idx = undefined, + next = undefined; + var last = null; + var found = false; - return SafePropertyManager; - })(PropertyManager); + var context = popCtx(); - function isUserInputValue(tagName, attribute) { - return (tagName === 'INPUT' || tagName === 'TEXTAREA') && attribute === 'value'; - } + for (idx = 0; idx < len && !found; idx++) { + next = this.nextObject(idx, last, context); - var InputValuePropertyManager = (function (_AttributeManager2) { - babelHelpers.inherits(InputValuePropertyManager, _AttributeManager2); + found = obj === next || obj !== obj && next !== next; - function InputValuePropertyManager() { - _AttributeManager2.apply(this, arguments); - } + last = next; + } - InputValuePropertyManager.prototype.setAttribute = function setAttribute(env, element, value) { - var input = element; - input.value = _glimmerRuntimeLibCompiledOpcodesContent.normalizeTextValue(value); - }; + next = last = null; + context = pushCtx(context); - InputValuePropertyManager.prototype.updateAttribute = function updateAttribute(env, element, value) { - var input = element; - var currentValue = input.value; - var normalizedValue = _glimmerRuntimeLibCompiledOpcodesContent.normalizeTextValue(value); - if (currentValue !== normalizedValue) { - input.value = normalizedValue; - } - }; + return found; + } + }); - return InputValuePropertyManager; - })(AttributeManager); + exports.default = Enumerable; +}); +enifed('ember-runtime/mixins/evented', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - var INPUT_VALUE_PROPERTY_MANAGER = new InputValuePropertyManager('value'); - exports.INPUT_VALUE_PROPERTY_MANAGER = INPUT_VALUE_PROPERTY_MANAGER; - function isOptionSelected(tagName, attribute) { - return tagName === 'OPTION' && attribute === 'selected'; - } + /** + @module ember + @submodule ember-runtime + */ - var OptionSelectedManager = (function (_PropertyManager2) { - babelHelpers.inherits(OptionSelectedManager, _PropertyManager2); + /** + This mixin allows for Ember objects to subscribe to and emit events. + + ```javascript + App.Person = Ember.Object.extend(Ember.Evented, { + greet: function() { + // ... + this.trigger('greet'); + } + }); + + var person = App.Person.create(); + + person.on('greet', function() { + console.log('Our person has greeted'); + }); + + person.greet(); + + // outputs: 'Our person has greeted' + ``` + + You can also chain multiple event subscriptions: + + ```javascript + person.on('greet', function() { + console.log('Our person has greeted'); + }).one('greet', function() { + console.log('Offer one-time special'); + }).off('event', this, forgetThis); + ``` + + @class Evented + @namespace Ember + @public + */ + exports.default = _emberMetal.Mixin.create({ - function OptionSelectedManager() { - _PropertyManager2.apply(this, arguments); - } + /** + Subscribes to a named event with given function. + ```javascript + person.on('didLoad', function() { + // fired once the person has loaded + }); + ``` + An optional target can be passed in as the 2nd argument that will + be set as the "this" for the callback. This is a good way to give your + function access to the object triggering the event. When the target + parameter is used the callback becomes the third argument. + @method on + @param {String} name The name of the event + @param {Object} [target] The "this" binding for the callback + @param {Function} method The callback to execute + @return this + @public + */ + on: function (name, target, method) { + _emberMetal.addListener(this, name, target, method); + return this; + }, - OptionSelectedManager.prototype.setAttribute = function setAttribute(env, element, value) { - if (value !== null && value !== undefined && value !== false) { - var option = element; - option.selected = true; - } - }; + /** + Subscribes a function to a named event and then cancels the subscription + after the first time the event is triggered. It is good to use ``one`` when + you only care about the first time an event has taken place. + This function takes an optional 2nd argument that will become the "this" + value for the callback. If this argument is passed then the 3rd argument + becomes the function. + @method one + @param {String} name The name of the event + @param {Object} [target] The "this" binding for the callback + @param {Function} method The callback to execute + @return this + @public + */ + one: function (name, target, method) { + if (!method) { + method = target; + target = null; + } - OptionSelectedManager.prototype.updateAttribute = function updateAttribute(env, element, value) { - var option = element; - if (value) { - option.selected = true; - } else { - option.selected = false; - } - }; + _emberMetal.addListener(this, name, target, method, true); + return this; + }, - return OptionSelectedManager; - })(PropertyManager); + /** + Triggers a named event for the object. Any additional arguments + will be passed as parameters to the functions that are subscribed to the + event. + ```javascript + person.on('didEat', function(food) { + console.log('person ate some ' + food); + }); + person.trigger('didEat', 'broccoli'); + // outputs: person ate some broccoli + ``` + @method trigger + @param {String} name The name of the event + @param {Object...} args Optional arguments to pass on + @public + */ + trigger: function (name) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } - var OPTION_SELECTED_MANAGER = new OptionSelectedManager('selected'); - exports.OPTION_SELECTED_MANAGER = OPTION_SELECTED_MANAGER; + _emberMetal.sendEvent(this, name, args); + }, - var SafeAttributeManager = (function (_AttributeManager3) { - babelHelpers.inherits(SafeAttributeManager, _AttributeManager3); + /** + Cancels subscription for given name, target, and method. + @method off + @param {String} name The name of the event + @param {Object} target The target of the subscription + @param {Function} method The function of the subscription + @return this + @public + */ + off: function (name, target, method) { + _emberMetal.removeListener(this, name, target, method); + return this; + }, - function SafeAttributeManager() { - _AttributeManager3.apply(this, arguments); - } + /** + Checks to see if object has any subscriptions for named event. + @method has + @param {String} name The name of the event + @return {Boolean} does the object have a subscription for event + @public + */ + has: function (name) { + return _emberMetal.hasListeners(this, name); + } + }); +}); +enifed('ember-runtime/mixins/freezable', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-runtime + */ - SafeAttributeManager.prototype.setAttribute = function setAttribute(env, element, value) { - _AttributeManager3.prototype.setAttribute.call(this, env, element, _glimmerRuntimeLibDomSanitizedValues.sanitizeAttributeValue(env, element, this.attr, value)); - }; + 'use strict'; - SafeAttributeManager.prototype.updateAttribute = function updateAttribute(env, element, value, namespace) { - _AttributeManager3.prototype.updateAttribute.call(this, env, element, _glimmerRuntimeLibDomSanitizedValues.sanitizeAttributeValue(env, element, this.attr, value)); - }; + /** + 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. + + ## Enforcement + + To fully support freezing in your subclass, you must include this mixin and + override any method that might alter any property on the object to instead + raise an exception. You can check the state of an object by checking the + `isFrozen` property. + + Although future versions of JavaScript may support language-level freezing + object objects, that is not the case today. Even if an object is freezable, + it is still technically possible to modify the object, even though it could + break other parts of your application that do not expect a frozen object to + change. It is, therefore, very important that you always respect the + `isFrozen` property on all freezable objects. + + ## Example Usage + + The example below shows a simple object that implement the `Ember.Freezable` + protocol. + + ```javascript + Contact = Ember.Object.extend(Ember.Freezable, { + firstName: null, + lastName: null, + + // swaps the names + swapNames: function() { + if (this.get('isFrozen')) throw Ember.FROZEN_ERROR; + var tmp = this.get('firstName'); + this.set('firstName', this.get('lastName')); + this.set('lastName', tmp); + return this; + } + + }); + + c = Contact.create({ firstName: "John", lastName: "Doe" }); + c.swapNames(); // returns c + c.freeze(); + c.swapNames(); // EXCEPTION + ``` + + ## Copying + + Usually the `Ember.Freezable` protocol is implemented in cooperation with the + `Ember.Copyable` protocol, which defines a `frozenCopy()` method that will + return a frozen object, if the object implements this method as well. + + @class Freezable + @namespace Ember + @since Ember 0.9 + @deprecated Use `Object.freeze` instead. + @private + */ + var Freezable = _emberMetal.Mixin.create({ - return SafeAttributeManager; - })(AttributeManager); -}); + init: function () { + this._super.apply(this, arguments); + }, -enifed('glimmer-runtime/lib/dom/helper', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/compat/inner-html-fix', 'glimmer-runtime/lib/compat/svg-inner-html-fix', 'glimmer-runtime/lib/compat/text-node-merging-fix', 'glimmer-runtime/lib/dom/interfaces'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibCompatInnerHtmlFix, _glimmerRuntimeLibCompatSvgInnerHtmlFix, _glimmerRuntimeLibCompatTextNodeMergingFix, _glimmerRuntimeLibDomInterfaces) { - 'use strict'; + /** + Set to `true` when the object is frozen. Use this property to detect + whether your object is frozen or not. + @property isFrozen + @type Boolean + @private + */ + isFrozen: false, - exports.isWhitespace = isWhitespace; - exports.moveNodesBefore = moveNodesBefore; - exports.insertHTMLBefore = _insertHTMLBefore; - var SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; - exports.SVG_NAMESPACE = SVG_NAMESPACE; - // http://www.w3.org/TR/html/syntax.html#html-integration-point - var SVG_INTEGRATION_POINTS = { foreignObject: 1, desc: 1, title: 1 }; - // http://www.w3.org/TR/html/syntax.html#adjust-svg-attributes - // TODO: Adjust SVG attributes - // http://www.w3.org/TR/html/syntax.html#parsing-main-inforeign - // TODO: Adjust SVG elements - // http://www.w3.org/TR/html/syntax.html#parsing-main-inforeign - var BLACKLIST_TABLE = Object.create(null); - exports.BLACKLIST_TABLE = BLACKLIST_TABLE; - ["b", "big", "blockquote", "body", "br", "center", "code", "dd", "div", "dl", "dt", "em", "embed", "h1", "h2", "h3", "h4", "h5", "h6", "head", "hr", "i", "img", "li", "listing", "main", "meta", "nobr", "ol", "p", "pre", "ruby", "s", "small", "span", "strong", "strike", "sub", "sup", "table", "tt", "u", "ul", "var"].forEach(function (tag) { - return BLACKLIST_TABLE[tag] = 1; - }); - var WHITESPACE = /[\t-\r \xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/; - var doc = typeof document === 'undefined' ? undefined : document; - - function isWhitespace(string) { - return WHITESPACE.test(string); - } - - function moveNodesBefore(source, target, nextSibling) { - var first = source.firstChild; - var last = null; - var current = first; - while (current) { - last = current; - current = current.nextSibling; - target.insertBefore(last, nextSibling); - } - return [first, last]; - } - - var DOM; - exports.DOM = DOM; - (function (DOM) { - var TreeConstruction = (function () { - function TreeConstruction(document) { - this.document = document; - this.uselessElement = null; - this.setupUselessElement(); - } + /** + Freezes the object. Once this method has been called the object should + no longer allow any properties to be edited. + @method freeze + @return {Object} receiver + @private + */ + freeze: function () { + if (_emberMetal.get(this, 'isFrozen')) { + return this; + } - TreeConstruction.prototype.setupUselessElement = function setupUselessElement() { - this.uselessElement = this.document.createElement('div'); - }; + _emberMetal.set(this, 'isFrozen', true); + return this; + } - TreeConstruction.prototype.createElement = function createElement(tag, context) { - var isElementInSVGNamespace = undefined, - isHTMLIntegrationPoint = undefined; - if (context) { - isElementInSVGNamespace = context.namespaceURI === SVG_NAMESPACE || tag === 'svg'; - isHTMLIntegrationPoint = SVG_INTEGRATION_POINTS[context.tagName]; - } else { - isElementInSVGNamespace = tag === 'svg'; - isHTMLIntegrationPoint = false; - } - if (isElementInSVGNamespace && !isHTMLIntegrationPoint) { - // FIXME: This does not properly handle with color, face, or - // size attributes, which is also disallowed by the spec. We should fix - // this. - if (BLACKLIST_TABLE[tag]) { - throw new Error('Cannot create a ' + tag + ' inside an SVG context'); - } - return this.document.createElementNS(SVG_NAMESPACE, tag); - } else { - return this.document.createElement(tag); - } - }; + }); - TreeConstruction.prototype.createElementNS = function createElementNS(namespace, tag) { - return this.document.createElementNS(namespace, tag); - }; + exports.Freezable = Freezable; + var FROZEN_ERROR = 'Frozen object cannot be modified.'; + exports.FROZEN_ERROR = FROZEN_ERROR; +}); +enifed('ember-runtime/mixins/mutable_array', ['exports', 'ember-metal', 'ember-runtime/mixins/array', 'ember-runtime/mixins/mutable_enumerable', 'ember-runtime/mixins/enumerable'], function (exports, _emberMetal, _emberRuntimeMixinsArray, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeMixinsEnumerable) { + /** + @module ember + @submodule ember-runtime + */ - TreeConstruction.prototype.setAttribute = function setAttribute(element, name, value, namespace) { - if (namespace) { - element.setAttributeNS(namespace, name, value); - } else { - element.setAttribute(name, value); - } - }; + 'use strict'; - TreeConstruction.prototype.createTextNode = function createTextNode(text) { - return this.document.createTextNode(text); - }; + exports.removeAt = removeAt; + var OUT_OF_RANGE_EXCEPTION = 'Index out of range'; + var EMPTY = []; - TreeConstruction.prototype.createComment = function createComment(data) { - return this.document.createComment(data); - }; + // .......................................................... + // HELPERS + // - TreeConstruction.prototype.insertBefore = function insertBefore(parent, node, reference) { - parent.insertBefore(node, reference); - }; + function removeAt(array, start, len) { + if ('number' === typeof start) { + if (start < 0 || start >= _emberMetal.get(array, 'length')) { + throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); + } - TreeConstruction.prototype.insertHTMLBefore = function insertHTMLBefore(parent, html, reference) { - return _insertHTMLBefore(this.uselessElement, parent, reference, html); - }; + // fast case + if (len === undefined) { + len = 1; + } - return TreeConstruction; - })(); + array.replace(start, len, EMPTY); + } - DOM.TreeConstruction = TreeConstruction; - var appliedTreeContruction = TreeConstruction; - appliedTreeContruction = _glimmerRuntimeLibCompatTextNodeMergingFix.treeConstruction(doc, appliedTreeContruction); - appliedTreeContruction = _glimmerRuntimeLibCompatInnerHtmlFix.treeConstruction(doc, appliedTreeContruction); - appliedTreeContruction = _glimmerRuntimeLibCompatSvgInnerHtmlFix.treeConstruction(doc, appliedTreeContruction, SVG_NAMESPACE); - DOM.DOMTreeConstruction = appliedTreeContruction; - })(DOM || (exports.DOM = DOM = {})); + return array; + } - var DOMChanges = (function () { - function DOMChanges(document) { - this.document = document; - this.uselessElement = null; - this.namespace = null; - this.uselessElement = this.document.createElement('div'); - } + /** + 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. + + It is important to use the methods in this class to modify arrays so that + changes are observable. This allows the binding system in Ember to function + correctly. + + + Note that an Array can change even if it does not implement this mixin. + For example, one might implement a SparseArray that cannot be directly + modified, but if its underlying enumerable changes, it will change also. + + @class MutableArray + @namespace Ember + @uses Ember.Array + @uses Ember.MutableEnumerable + @public + */ + exports.default = _emberMetal.Mixin.create(_emberRuntimeMixinsArray.default, _emberRuntimeMixinsMutable_enumerable.default, { - DOMChanges.prototype.setAttribute = function setAttribute(element, name, value) { - element.setAttribute(name, value); - }; + /** + __Required.__ You must implement this method to apply this mixin. + This is one of the primitives you must implement to support `Ember.Array`. + You should replace amt objects started at idx with the objects in the + passed array. You should also call `this.enumerableContentDidChange()` + @method replace + @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* + @public + */ + replace: null, - DOMChanges.prototype.setAttributeNS = function setAttributeNS(element, namespace, name, value) { - element.setAttributeNS(namespace, name, value); - }; + /** + Remove all elements from the array. This is useful if you + want to reuse an existing array without having to recreate it. + ```javascript + let colors = ['red', 'green', 'blue']; + colors.length; // 3 + colors.clear(); // [] + colors.length; // 0 + ``` + @method clear + @return {Ember.Array} An empty Array. + @public + */ + clear: function () { + var len = _emberMetal.get(this, 'length'); + if (len === 0) { + return this; + } - DOMChanges.prototype.removeAttribute = function removeAttribute(element, name) { - element.removeAttribute(name); - }; + this.replace(0, len, EMPTY); + return this; + }, - DOMChanges.prototype.removeAttributeNS = function removeAttributeNS(element, namespace, name) { - element.removeAttributeNS(namespace, name); - }; + /** + This will use the primitive `replace()` method to insert an object at the + specified index. + ```javascript + let colors = ['red', 'green', 'blue']; + colors.insertAt(2, 'yellow'); // ['red', 'green', 'yellow', 'blue'] + colors.insertAt(5, 'orange'); // Error: Index out of range + ``` + @method insertAt + @param {Number} idx index of insert the object at. + @param {Object} object object to insert + @return {Ember.Array} receiver + @public + */ + insertAt: function (idx, object) { + if (idx > _emberMetal.get(this, 'length')) { + throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); + } - DOMChanges.prototype.createTextNode = function createTextNode(text) { - return this.document.createTextNode(text); - }; + this.replace(idx, 0, [object]); + return this; + }, - DOMChanges.prototype.createComment = function createComment(data) { - return this.document.createComment(data); - }; + /** + Remove an object at the specified index using the `replace()` primitive + method. You can pass either a single index, or a start and a length. + If you pass a start and length that is beyond the + length this method will throw an `OUT_OF_RANGE_EXCEPTION`. + ```javascript + let colors = ['red', 'green', 'blue', 'yellow', 'orange']; + colors.removeAt(0); // ['green', 'blue', 'yellow', 'orange'] + colors.removeAt(2, 2); // ['green', 'blue'] + colors.removeAt(4, 2); // Error: Index out of range + ``` + @method removeAt + @param {Number} start index, start of range + @param {Number} len length of passing range + @return {Ember.Array} receiver + @public + */ + removeAt: function (start, len) { + return removeAt(this, start, len); + }, - DOMChanges.prototype.createElement = function createElement(tag, context) { - var isElementInSVGNamespace = undefined, - isHTMLIntegrationPoint = undefined; - if (context) { - isElementInSVGNamespace = context.namespaceURI === SVG_NAMESPACE || tag === 'svg'; - isHTMLIntegrationPoint = SVG_INTEGRATION_POINTS[context.tagName]; - } else { - isElementInSVGNamespace = tag === 'svg'; - isHTMLIntegrationPoint = false; - } - if (isElementInSVGNamespace && !isHTMLIntegrationPoint) { - // FIXME: This does not properly handle with color, face, or - // size attributes, which is also disallowed by the spec. We should fix - // this. - if (BLACKLIST_TABLE[tag]) { - throw new Error('Cannot create a ' + tag + ' inside an SVG context'); - } - return this.document.createElementNS(SVG_NAMESPACE, tag); - } else { - return this.document.createElement(tag); - } - }; + /** + Push the object onto the end of the array. Works just like `push()` but it + is KVO-compliant. + ```javascript + let colors = ['red', 'green']; + colors.pushObject('black'); // ['red', 'green', 'black'] + colors.pushObject(['yellow']); // ['red', 'green', ['yellow']] + ``` + @method pushObject + @param {*} obj object to push + @return object same object passed as a param + @public + */ + pushObject: function (obj) { + this.insertAt(_emberMetal.get(this, 'length'), obj); + return obj; + }, - DOMChanges.prototype.insertHTMLBefore = function insertHTMLBefore(_parent, nextSibling, html) { - return _insertHTMLBefore(this.uselessElement, _parent, nextSibling, html); - }; + /** + Add the objects in the passed numerable to the end of the array. Defers + notifying observers of the change until all objects are added. + ```javascript + let colors = ['red']; + colors.pushObjects(['yellow', 'orange']); // ['red', 'yellow', 'orange'] + ``` + @method pushObjects + @param {Ember.Enumerable} objects the objects to add + @return {Ember.Array} receiver + @public + */ + pushObjects: function (objects) { + if (!(_emberRuntimeMixinsEnumerable.default.detect(objects) || Array.isArray(objects))) { + throw new TypeError('Must pass Ember.Enumerable to Ember.MutableArray#pushObjects'); + } + this.replace(_emberMetal.get(this, 'length'), 0, objects); + return this; + }, - DOMChanges.prototype.insertNodeBefore = function insertNodeBefore(parent, node, reference) { - if (isDocumentFragment(node)) { - var firstChild = node.firstChild; - var lastChild = node.lastChild; + /** + Pop object from array or nil if none are left. Works just like `pop()` but + it is KVO-compliant. + ```javascript + let colors = ['red', 'green', 'blue']; + colors.popObject(); // 'blue' + console.log(colors); // ['red', 'green'] + ``` + @method popObject + @return object + @public + */ + popObject: function () { + var len = _emberMetal.get(this, 'length'); + if (len === 0) { + return null; + } - this.insertBefore(parent, node, reference); - return new _glimmerRuntimeLibBounds.ConcreteBounds(parent, firstChild, lastChild); - } else { - this.insertBefore(parent, node, reference); - return new _glimmerRuntimeLibBounds.SingleNodeBounds(parent, node); - } - }; + var ret = _emberRuntimeMixinsArray.objectAt(this, len - 1); + this.removeAt(len - 1, 1); + return ret; + }, - DOMChanges.prototype.insertTextBefore = function insertTextBefore(parent, nextSibling, text) { - var textNode = this.createTextNode(text); - this.insertBefore(parent, textNode, nextSibling); - return textNode; - }; + /** + Shift an object from start of array or nil if none are left. Works just + like `shift()` but it is KVO-compliant. + ```javascript + let colors = ['red', 'green', 'blue']; + colors.shiftObject(); // 'red' + console.log(colors); // ['green', 'blue'] + ``` + @method shiftObject + @return object + @public + */ + shiftObject: function () { + if (_emberMetal.get(this, 'length') === 0) { + return null; + } - DOMChanges.prototype.insertBefore = function insertBefore(element, node, reference) { - element.insertBefore(node, reference); - }; + var ret = _emberRuntimeMixinsArray.objectAt(this, 0); + this.removeAt(0); + return ret; + }, - DOMChanges.prototype.insertAfter = function insertAfter(element, node, reference) { - this.insertBefore(element, node, reference.nextSibling); - }; + /** + Unshift an object to start of array. Works just like `unshift()` but it is + KVO-compliant. + ```javascript + let colors = ['red']; + colors.unshiftObject('yellow'); // ['yellow', 'red'] + colors.unshiftObject(['black']); // [['black'], 'yellow', 'red'] + ``` + @method unshiftObject + @param {*} obj object to unshift + @return object same object passed as a param + @public + */ + unshiftObject: function (obj) { + this.insertAt(0, obj); + return obj; + }, - return DOMChanges; - })(); + /** + Adds the named objects to the beginning of the array. Defers notifying + observers until all objects have been added. + ```javascript + let colors = ['red']; + colors.unshiftObjects(['black', 'white']); // ['black', 'white', 'red'] + colors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function + ``` + @method unshiftObjects + @param {Ember.Enumerable} objects the objects to add + @return {Ember.Array} receiver + @public + */ + unshiftObjects: function (objects) { + this.replace(0, 0, objects); + return this; + }, - exports.DOMChanges = DOMChanges; - - function _insertHTMLBefore(_useless, _parent, _nextSibling, html) { - // TypeScript vendored an old version of the DOM spec where `insertAdjacentHTML` - // only exists on `HTMLElement` but not on `Element`. We actually work with the - // newer version of the DOM API here (and monkey-patch this method in `./compat` - // when we detect older browsers). This is a hack to work around this limitation. - var parent = _parent; - var useless = _useless; - var nextSibling = _nextSibling; - var prev = nextSibling ? nextSibling.previousSibling : parent.lastChild; - var last = undefined; - if (html === null || html === '') { - return new _glimmerRuntimeLibBounds.ConcreteBounds(parent, null, null); - } - if (nextSibling === null) { - parent.insertAdjacentHTML('beforeEnd', html); - last = parent.lastChild; - } else if (nextSibling instanceof HTMLElement) { - nextSibling.insertAdjacentHTML('beforeBegin', html); - last = nextSibling.previousSibling; - } else { - // Non-element nodes do not support insertAdjacentHTML, so add an - // element and call it on that element. Then remove the element. - // - // This also protects Edge, IE and Firefox w/o the inspector open - // from merging adjacent text nodes. See ./compat/text-node-merging-fix.ts - parent.insertBefore(useless, nextSibling); - useless.insertAdjacentHTML('beforeBegin', html); - last = useless.previousSibling; - parent.removeChild(useless); - } - var first = prev ? prev.nextSibling : parent.firstChild; - return new _glimmerRuntimeLibBounds.ConcreteBounds(parent, first, last); - } + /** + Reverse objects in the array. Works just like `reverse()` but it is + KVO-compliant. + @method reverseObjects + @return {Ember.Array} receiver + @public + */ + reverseObjects: function () { + var len = _emberMetal.get(this, 'length'); + if (len === 0) { + return this; + } - function isDocumentFragment(node) { - return node.nodeType === Node.DOCUMENT_FRAGMENT_NODE; - } - var helper = DOMChanges; - helper = _glimmerRuntimeLibCompatTextNodeMergingFix.domChanges(doc, helper); - helper = _glimmerRuntimeLibCompatInnerHtmlFix.domChanges(doc, helper); - helper = _glimmerRuntimeLibCompatSvgInnerHtmlFix.domChanges(doc, helper, SVG_NAMESPACE); - exports.default = helper; - var DOMTreeConstruction = DOM.DOMTreeConstruction; - exports.DOMTreeConstruction = DOMTreeConstruction; - exports.DOMNamespace = _glimmerRuntimeLibDomInterfaces.Namespace; -}); + var objects = this.toArray().reverse(); + this.replace(0, len, objects); + return this; + }, -enifed("glimmer-runtime/lib/dom/interfaces", ["exports"], function (exports) { - "use strict"; + /** + Replace all the receiver's content with content of the argument. + If argument is an empty array receiver will be cleared. + ```javascript + let colors = ['red', 'green', 'blue']; + colors.setObjects(['black', 'white']); // ['black', 'white'] + colors.setObjects([]); // [] + ``` + @method setObjects + @param {Ember.Array} objects array whose content will be used for replacing + the content of the receiver + @return {Ember.Array} receiver with the new content + @public + */ + setObjects: function (objects) { + if (objects.length === 0) { + return this.clear(); + } - var NodeType; - exports.NodeType = NodeType; - (function (NodeType) { - NodeType[NodeType["Element"] = 0] = "Element"; - NodeType[NodeType["Attribute"] = 1] = "Attribute"; - NodeType[NodeType["Text"] = 2] = "Text"; - NodeType[NodeType["CdataSection"] = 3] = "CdataSection"; - NodeType[NodeType["EntityReference"] = 4] = "EntityReference"; - NodeType[NodeType["Entity"] = 5] = "Entity"; - NodeType[NodeType["ProcessingInstruction"] = 6] = "ProcessingInstruction"; - NodeType[NodeType["Comment"] = 7] = "Comment"; - NodeType[NodeType["Document"] = 8] = "Document"; - NodeType[NodeType["DocumentType"] = 9] = "DocumentType"; - NodeType[NodeType["DocumentFragment"] = 10] = "DocumentFragment"; - NodeType[NodeType["Notation"] = 11] = "Notation"; - })(NodeType || (exports.NodeType = NodeType = {})); -}); - -enifed('glimmer-runtime/lib/dom/props', ['exports'], function (exports) { - /* - * @method normalizeProperty - * @param element {HTMLElement} - * @param slotName {String} - * @returns {Object} { name, type } - */ - 'use strict'; + var len = _emberMetal.get(this, 'length'); + this.replace(0, len, objects); + return this; + }, - exports.normalizeProperty = normalizeProperty; - exports.normalizePropertyValue = normalizePropertyValue; + // .......................................................... + // IMPLEMENT Ember.MutableEnumerable + // - function normalizeProperty(element, slotName) { - var type = undefined, - normalized = undefined; - if (slotName in element) { - normalized = slotName; - type = 'prop'; - } else { - var lower = slotName.toLowerCase(); - if (lower in element) { - type = 'prop'; - normalized = lower; - } else { - type = 'attr'; - normalized = slotName; - } - } - if (type === 'prop' && (normalized.toLowerCase() === 'style' || preferAttr(element.tagName, normalized))) { - type = 'attr'; - } - return { normalized: normalized, type: type }; - } + /** + Remove all occurrences of an object in the array. + ```javascript + let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago']; + cities.removeObject('Chicago'); // ['Berlin', 'Lima'] + cities.removeObject('Lima'); // ['Berlin'] + cities.removeObject('Tokyo') // ['Berlin'] + ``` + @method removeObject + @param {*} obj object to remove + @return {Ember.Array} receiver + @public + */ + removeObject: function (obj) { + var loc = _emberMetal.get(this, 'length') || 0; + while (--loc >= 0) { + var curObject = _emberRuntimeMixinsArray.objectAt(this, loc); - function normalizePropertyValue(value) { - if (value === '') { - return true; + if (curObject === obj) { + this.removeAt(loc); } - return value; - } - - // properties that MUST be set as attributes, due to: - // * browser bug - // * strange spec outlier - var ATTR_OVERRIDES = { - // phantomjs < 2.0 lets you set it as a prop but won't reflect it - // back to the attribute. button.getAttribute('type') === null - BUTTON: { type: true, form: true }, - INPUT: { - // Some version of IE (like IE9) actually throw an exception - // if you set input.type = 'something-unknown' - type: true, - form: true, - // Chrome 46.0.2464.0: 'autocorrect' in document.createElement('input') === false - // Safari 8.0.7: 'autocorrect' in document.createElement('input') === false - // Mobile Safari (iOS 8.4 simulator): 'autocorrect' in document.createElement('input') === true - autocorrect: true, - // Chrome 54.0.2840.98: 'list' in document.createElement('input') === true - // Safari 9.1.3: 'list' in document.createElement('input') === false - list: true - }, - // element.form is actually a legitimate readOnly property, that is to be - // mutated, but must be mutated by setAttribute... - SELECT: { form: true }, - OPTION: { form: true }, - TEXTAREA: { form: true }, - LABEL: { form: true }, - FIELDSET: { form: true }, - LEGEND: { form: true }, - OBJECT: { form: true } - }; - function preferAttr(tagName, propName) { - var tag = ATTR_OVERRIDES[tagName.toUpperCase()]; - return tag && tag[propName.toLowerCase()] || false; - } -}); - -enifed('glimmer-runtime/lib/dom/sanitized-values', ['exports', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-runtime/lib/upsert'], function (exports, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerRuntimeLibUpsert) { - 'use strict'; - - exports.requiresSanitization = requiresSanitization; - exports.sanitizeAttributeValue = sanitizeAttributeValue; + } + return this; + }, - var badProtocols = ['javascript:', 'vbscript:']; - var badTags = ['A', 'BODY', 'LINK', 'IMG', 'IFRAME', 'BASE', 'FORM']; - var badTagsForDataURI = ['EMBED']; - var badAttributes = ['href', 'src', 'background', 'action']; - var badAttributesForDataURI = ['src']; - function has(array, item) { - return array.indexOf(item) !== -1; - } - function checkURI(tagName, attribute) { - return (tagName === null || has(badTags, tagName)) && has(badAttributes, attribute); - } - function checkDataURI(tagName, attribute) { - return has(badTagsForDataURI, tagName) && has(badAttributesForDataURI, attribute); - } + /** + Push the object onto the end of the array if it is not already + present in the array. + ```javascript + let cities = ['Chicago', 'Berlin']; + cities.addObject('Lima'); // ['Chicago', 'Berlin', 'Lima'] + cities.addObject('Berlin'); // ['Chicago', 'Berlin', 'Lima'] + ``` + @method addObject + @param {*} obj object to add, if not already present + @return {Ember.Array} receiver + @public + */ + addObject: function (obj) { + var included = this.includes(obj); - function requiresSanitization(tagName, attribute) { - return checkURI(tagName, attribute) || checkDataURI(tagName, attribute); - } + if (!included) { + this.pushObject(obj); + } - function sanitizeAttributeValue(env, element, attribute, value) { - var tagName = undefined; - if (value === null || value === undefined) { - return value; - } - if (_glimmerRuntimeLibUpsert.isSafeString(value)) { - return value.toHTML(); - } - if (!element) { - tagName = null; - } else { - tagName = element.tagName.toUpperCase(); - } - var str = _glimmerRuntimeLibCompiledOpcodesContent.normalizeTextValue(value); - if (checkURI(tagName, attribute)) { - var protocol = env.protocolForURL(str); - if (has(badProtocols, protocol)) { - return 'unsafe:' + str; - } - } - if (checkDataURI(tagName, attribute)) { - return 'unsafe:' + str; - } - return str; + return this; } + }); }); +enifed('ember-runtime/mixins/mutable_enumerable', ['exports', 'ember-runtime/mixins/enumerable', 'ember-metal'], function (exports, _emberRuntimeMixinsEnumerable, _emberMetal) { + 'use strict'; -enifed('glimmer-runtime/lib/environment', ['exports', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/dom/attribute-managers', 'glimmer-util', 'glimmer-runtime/lib/syntax/core', 'glimmer-runtime/lib/syntax/builtins/if', 'glimmer-runtime/lib/syntax/builtins/unless', 'glimmer-runtime/lib/syntax/builtins/with', 'glimmer-runtime/lib/syntax/builtins/each'], function (exports, _glimmerRuntimeLibReferences, _glimmerRuntimeLibDomAttributeManagers, _glimmerUtil, _glimmerRuntimeLibSyntaxCore, _glimmerRuntimeLibSyntaxBuiltinsIf, _glimmerRuntimeLibSyntaxBuiltinsUnless, _glimmerRuntimeLibSyntaxBuiltinsWith, _glimmerRuntimeLibSyntaxBuiltinsEach) { - 'use strict'; - - var Scope = (function () { - function Scope(references) { - var callerScope = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + /** + @module ember + @submodule ember-runtime + */ - this.callerScope = null; - this.slots = references; - this.callerScope = callerScope; - } + /** + This mixin defines the API for modifying generic enumerables. These methods + can be applied to an object regardless of whether it is ordered or + unordered. + + Note that an Enumerable can change even if it does not implement this mixin. + For example, a MappedEnumerable cannot be directly modified but if its + underlying enumerable changes, it will change also. + + ## Adding Objects + + To add an object to an enumerable, use the `addObject()` method. This + method will only add the object to the enumerable if the object is not + already present and is of a type supported by the enumerable. + + ```javascript + set.addObject(contact); + ``` + + ## Removing Objects + + To remove an object from an enumerable, use the `removeObject()` method. This + will only remove the object if it is present in the enumerable, otherwise + this method has no effect. + + ```javascript + set.removeObject(contact); + ``` + + ## Implementing In Your Own Code + + If you are implementing an object and want to support this API, just include + this mixin in your class and implement the required methods. In your unit + tests, be sure to apply the Ember.MutableEnumerableTests to your object. + + @class MutableEnumerable + @namespace Ember + @uses Ember.Enumerable + @public + */ + exports.default = _emberMetal.Mixin.create(_emberRuntimeMixinsEnumerable.default, { - Scope.root = function root(self) { - var size = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + /** + __Required.__ You must implement this method to apply this mixin. + Attempts to add the passed object to the receiver if the object is not + already present in the collection. If the object is present, this method + has no effect. + If the passed object is of a type not supported by the receiver, + then this method should raise an exception. + @method addObject + @param {Object} object The object to add to the enumerable. + @return {Object} the passed object + @public + */ + addObject: null, - var refs = new Array(size + 1); - for (var i = 0; i <= size; i++) { - refs[i] = _glimmerRuntimeLibReferences.UNDEFINED_REFERENCE; - } - return new Scope(refs).init({ self: self }); - }; + /** + Adds each object in the passed enumerable to the receiver. + @method addObjects + @param {Ember.Enumerable} objects the objects to add. + @return {Object} receiver + @public + */ + addObjects: function (objects) { + var _this = this; - Scope.prototype.init = function init(_ref) { - var self = _ref.self; + _emberMetal.beginPropertyChanges(this); + objects.forEach(function (obj) { + return _this.addObject(obj); + }); + _emberMetal.endPropertyChanges(this); + return this; + }, - this.slots[0] = self; - return this; - }; + /** + __Required.__ You must implement this method to apply this mixin. + Attempts to remove the passed object from the receiver collection if the + object is present in the collection. If the object is not present, + this method has no effect. + If the passed object is of a type not supported by the receiver, + then this method should raise an exception. + @method removeObject + @param {Object} object The object to remove from the enumerable. + @return {Object} the passed object + @public + */ + removeObject: null, - Scope.prototype.getSelf = function getSelf() { - return this.slots[0]; - }; + /** + Removes each object in the passed enumerable from the receiver. + @method removeObjects + @param {Ember.Enumerable} objects the objects to remove + @return {Object} receiver + @public + */ + removeObjects: function (objects) { + _emberMetal.beginPropertyChanges(this); + for (var i = objects.length - 1; i >= 0; i--) { + this.removeObject(objects[i]); + } + _emberMetal.endPropertyChanges(this); + return this; + } + }); +}); +enifed('ember-runtime/mixins/observable', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-runtime + */ - Scope.prototype.getSymbol = function getSymbol(symbol) { - return this.slots[symbol]; - }; + 'use strict'; - Scope.prototype.getBlock = function getBlock(symbol) { - return this.slots[symbol]; - }; + /** + ## Overview + + This mixin provides properties and property observing functionality, core + features of the Ember object model. + + Properties and observers allow one object to observe changes to a + property on another object. This is one of the fundamental ways that + models, controllers and views communicate with each other in an Ember + application. + + Any object that has this mixin applied can be used in observer + operations. That includes `Ember.Object` and most objects you will + interact with as you write your Ember application. + + Note that you will not generally apply this mixin to classes yourself, + but you will use the features provided by this module frequently, so it + is important to understand how to use it. + + ## Using `get()` and `set()` + + Because of Ember's support for bindings and observers, you will always + access properties using the get method, and set properties using the + set method. This allows the observing objects to be notified and + computed properties to be handled properly. + + More documentation about `get` and `set` are below. + + ## Observing Property Changes + + You typically observe property changes simply by using the `Ember.observer` + function in classes that you write. + + For example: + + ```javascript + Ember.Object.extend({ + valueObserver: Ember.observer('value', function(sender, key, value, rev) { + // Executes whenever the "value" property changes + // See the addObserver method for more information about the callback arguments + }) + }); + ``` + + Although this is the most common way to add an observer, this capability + is actually built into the `Ember.Object` class on top of two methods + defined in this mixin: `addObserver` and `removeObserver`. You can use + these two methods to add and remove observers yourself if you need to + do so at runtime. + + To add an observer for a property, call: + + ```javascript + object.addObserver('propertyKey', targetObject, targetAction) + ``` + + This will call the `targetAction` method on the `targetObject` whenever + the value of the `propertyKey` changes. + + Note that if `propertyKey` is a computed property, the observer will be + called when any of the property dependencies are changed, even if the + resulting value of the computed property is unchanged. This is necessary + because computed properties are not computed until `get` is called. + + @class Observable + @namespace Ember + @public + */ + exports.default = _emberMetal.Mixin.create({ - Scope.prototype.getPartialArgs = function getPartialArgs(symbol) { - return this.slots[symbol]; - }; + /** + Retrieves the value of a property from the object. + This method is usually similar to using `object[keyName]` or `object.keyName`, + however it supports both computed properties and the unknownProperty + handler. + Because `get` unifies the syntax for accessing all these kinds + of properties, it can make many refactorings easier, such as replacing a + simple property with a computed property, or vice versa. + ### Computed Properties + Computed properties are methods defined with the `property` modifier + declared at the end, such as: + ```javascript + fullName: Ember.computed('firstName', 'lastName', function() { + return this.get('firstName') + ' ' + this.get('lastName'); + }) + ``` + When you call `get` on a computed property, the function will be + called and the return value will be returned instead of the function + itself. + ### Unknown Properties + Likewise, if you try to call `get` on a property whose value is + `undefined`, the `unknownProperty()` method will be called on the object. + If this method returns any value other than `undefined`, it will be returned + instead. This allows you to implement "virtual" properties that are + not defined upfront. + @method get + @param {String} keyName The property to retrieve + @return {Object} The property value or undefined. + @public + */ + get: function (keyName) { + return _emberMetal.get(this, keyName); + }, - Scope.prototype.bindSymbol = function bindSymbol(symbol, value) { - this.slots[symbol] = value; - }; + /** + To get the values of multiple properties at once, call `getProperties` + with a list of strings or an array: + ```javascript + record.getProperties('firstName', 'lastName', 'zipCode'); + // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } + ``` + is equivalent to: + ```javascript + record.getProperties(['firstName', 'lastName', 'zipCode']); + // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } + ``` + @method getProperties + @param {String...|Array} list of keys to get + @return {Object} + @public + */ + getProperties: function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - Scope.prototype.bindBlock = function bindBlock(symbol, value) { - this.slots[symbol] = value; - }; + return _emberMetal.getProperties.apply(undefined, [this].concat(args)); + }, - Scope.prototype.bindPartialArgs = function bindPartialArgs(symbol, value) { - this.slots[symbol] = value; - }; + /** + Sets the provided key or path to the value. + ```javascript + record.set("key", value); + ``` + This method is generally very similar to calling `object["key"] = value` or + `object.key = value`, except that it provides support for computed + properties, the `setUnknownProperty()` method and property observers. + ### Computed Properties + If you try to set a value on a key that has a computed property handler + defined (see the `get()` method for an example), then `set()` will call + that method, passing both the value and key instead of simply changing + the value itself. This is useful for those times when you need to + implement a property that is composed of one or more member + properties. + ### Unknown Properties + If you try to set a value on a key that is undefined in the target + object, then the `setUnknownProperty()` handler will be called instead. This + gives you an opportunity to implement complex "virtual" properties that + are not predefined on the object. If `setUnknownProperty()` returns + undefined, then `set()` will simply set the value on the object. + ### Property Observers + In addition to changing the property, `set()` will also register a property + change with the object. Unless you have placed this call inside of a + `beginPropertyChanges()` and `endPropertyChanges(),` any "local" observers + (i.e. observer methods declared on the same object), will be called + immediately. Any "remote" observers (i.e. observer methods declared on + another object) will be placed in a queue and called at a later time in a + coalesced manner. + @method set + @param {String} keyName The property to set + @param {Object} value The value to set or `null`. + @return {Object} The passed value + @public + */ + set: function (keyName, value) { + return _emberMetal.set(this, keyName, value); + }, - Scope.prototype.bindCallerScope = function bindCallerScope(scope) { - this.callerScope = scope; - }; + /** + Sets a list of properties at once. These properties are set inside + a single `beginPropertyChanges` and `endPropertyChanges` batch, so + observers will be buffered. + ```javascript + record.setProperties({ firstName: 'Charles', lastName: 'Jolley' }); + ``` + @method setProperties + @param {Object} hash the hash of keys and values to set + @return {Object} The passed in hash + @public + */ + setProperties: function (hash) { + return _emberMetal.setProperties(this, hash); + }, - Scope.prototype.getCallerScope = function getCallerScope() { - return this.callerScope; - }; + /** + Begins a grouping of property changes. + You can use this method to group property changes so that notifications + will not be sent until the changes are finished. If you plan to make a + large number of changes to an object at one time, you should call this + method at the beginning of the changes to begin deferring change + notifications. When you are done making changes, call + `endPropertyChanges()` to deliver the deferred change notifications and end + deferring. + @method beginPropertyChanges + @return {Ember.Observable} + @private + */ + beginPropertyChanges: function () { + _emberMetal.beginPropertyChanges(); + return this; + }, - Scope.prototype.child = function child() { - return new Scope(this.slots.slice(), this.callerScope); - }; + /** + Ends a grouping of property changes. + You can use this method to group property changes so that notifications + will not be sent until the changes are finished. If you plan to make a + large number of changes to an object at one time, you should call + `beginPropertyChanges()` at the beginning of the changes to defer change + notifications. When you are done making changes, call this method to + deliver the deferred change notifications and end deferring. + @method endPropertyChanges + @return {Ember.Observable} + @private + */ + endPropertyChanges: function () { + _emberMetal.endPropertyChanges(); + return this; + }, - return Scope; - })(); + /** + Notify the observer system that a property is about to change. + Sometimes you need to change a value directly or indirectly without + actually calling `get()` or `set()` on it. In this case, you can use this + method and `propertyDidChange()` instead. Calling these two methods + together will notify all observers that the property has potentially + changed value. + Note that you must always call `propertyWillChange` and `propertyDidChange` + as a pair. If you do not, it may get the property change groups out of + order and cause notifications to be delivered more often than you would + like. + @method propertyWillChange + @param {String} keyName The property key that is about to change. + @return {Ember.Observable} + @private + */ + propertyWillChange: function (keyName) { + _emberMetal.propertyWillChange(this, keyName); + return this; + }, - exports.Scope = Scope; + /** + Notify the observer system that a property has just changed. + Sometimes you need to change a value directly or indirectly without + actually calling `get()` or `set()` on it. In this case, you can use this + method and `propertyWillChange()` instead. Calling these two methods + together will notify all observers that the property has potentially + changed value. + Note that you must always call `propertyWillChange` and `propertyDidChange` + as a pair. If you do not, it may get the property change groups out of + order and cause notifications to be delivered more often than you would + like. + @method propertyDidChange + @param {String} keyName The property key that has just changed. + @return {Ember.Observable} + @private + */ + propertyDidChange: function (keyName) { + _emberMetal.propertyDidChange(this, keyName); + return this; + }, - var Environment = (function () { - function Environment(_ref2) { - var appendOperations = _ref2.appendOperations; - var updateOperations = _ref2.updateOperations; + /** + Convenience method to call `propertyWillChange` and `propertyDidChange` in + succession. + @method notifyPropertyChange + @param {String} keyName The property key to be notified about. + @return {Ember.Observable} + @public + */ + notifyPropertyChange: function (keyName) { + this.propertyWillChange(keyName); + this.propertyDidChange(keyName); + return this; + }, - this.scheduledInstallManagers = null; - this.scheduledInstallModifiers = null; - this.scheduledUpdateModifierManagers = null; - this.scheduledUpdateModifiers = null; - this.createdComponents = null; - this.createdManagers = null; - this.updatedComponents = null; - this.updatedManagers = null; - this.destructors = null; - this.appendOperations = appendOperations; - this.updateOperations = updateOperations; + /** + Adds an observer on a property. + This is the core method used to register an observer for a property. + Once you call this method, any time the key's value is set, your observer + will be notified. Note that the observers are triggered any time the + value is set, regardless of whether it has actually changed. Your + observer should be prepared to handle that. + ### Observer Methods + Observer methods have the following signature: + ```javascript + export default Ember.Component.extend({ + init() { + this._super(...arguments); + this.addObserver('foo', this, 'fooDidChange'); + }, + fooDidChange(sender, key, value, rev) { + // your code } + }); + ``` + The `sender` is the object that changed. The `key` is the property that + changes. The `value` property is currently reserved and unused. The `rev` + is the last property revision of the object when it changed, which you can + use to detect if the key value has really changed or not. + Usually you will not need the value or revision parameters at + the end. In this case, it is common to write observer methods that take + only a sender and key value as parameters or, if you aren't interested in + any of these values, to write an observer that has no parameters at all. + @method addObserver + @param {String} key The key to observer + @param {Object} target The target object to invoke + @param {String|Function} method The method to invoke. + @public + */ + addObserver: function (key, target, method) { + _emberMetal.addObserver(this, key, target, method); + }, - Environment.prototype.toConditionalReference = function toConditionalReference(reference) { - return new _glimmerRuntimeLibReferences.ConditionalReference(reference); - }; + /** + Remove an observer you have previously registered on this object. Pass + the same key, target, and method you passed to `addObserver()` and your + target will no longer receive notifications. + @method removeObserver + @param {String} key The key to observer + @param {Object} target The target object to invoke + @param {String|Function} method The method to invoke. + @public + */ + removeObserver: function (key, target, method) { + _emberMetal.removeObserver(this, key, target, method); + }, - Environment.prototype.getAppendOperations = function getAppendOperations() { - return this.appendOperations; - }; + /** + Returns `true` if the object currently has observers registered for a + particular key. You can use this method to potentially defer performing + an expensive action until someone begins observing a particular property + on the object. + @method hasObserverFor + @param {String} key Key to check + @return {Boolean} + @private + */ + hasObserverFor: function (key) { + return _emberMetal.hasListeners(this, key + ':change'); + }, - Environment.prototype.getDOM = function getDOM() { - return this.updateOperations; - }; + /** + Retrieves the value of a property, or a default value in the case that the + property returns `undefined`. + ```javascript + person.getWithDefault('lastName', 'Doe'); + ``` + @method getWithDefault + @param {String} keyName The name of the property to retrieve + @param {Object} defaultValue The value to return if the property value is undefined + @return {Object} The property value or the defaultValue. + @public + */ + getWithDefault: function (keyName, defaultValue) { + return _emberMetal.getWithDefault(this, keyName, defaultValue); + }, - Environment.prototype.getIdentity = function getIdentity(object) { - return _glimmerUtil.ensureGuid(object) + ''; - }; + /** + Set the value of a property to the current value plus some amount. + ```javascript + person.incrementProperty('age'); + team.incrementProperty('score', 2); + ``` + @method incrementProperty + @param {String} keyName The name of the property to increment + @param {Number} increment The amount to increment by. Defaults to 1 + @return {Number} The new property value + @public + */ + incrementProperty: function (keyName, increment) { + if (_emberMetal.isNone(increment)) { + increment = 1; + } - Environment.prototype.statement = function statement(_statement, symbolTable) { - return this.refineStatement(parseStatement(_statement), symbolTable) || _statement; - }; + return _emberMetal.set(this, keyName, (parseFloat(_emberMetal.get(this, keyName)) || 0) + increment); + }, - Environment.prototype.refineStatement = function refineStatement(statement, symbolTable) { - var isSimple = statement.isSimple; - var isBlock = statement.isBlock; - var key = statement.key; - var args = statement.args; - - if (isSimple && isBlock) { - switch (key) { - case 'each': - return new _glimmerRuntimeLibSyntaxBuiltinsEach.default(args); - case 'if': - return new _glimmerRuntimeLibSyntaxBuiltinsIf.default(args); - case 'with': - return new _glimmerRuntimeLibSyntaxBuiltinsWith.default(args); - case 'unless': - return new _glimmerRuntimeLibSyntaxBuiltinsUnless.default(args); - } - } - }; + /** + Set the value of a property to the current value minus some amount. + ```javascript + player.decrementProperty('lives'); + orc.decrementProperty('health', 5); + ``` + @method decrementProperty + @param {String} keyName The name of the property to decrement + @param {Number} decrement The amount to decrement by. Defaults to 1 + @return {Number} The new property value + @public + */ + decrementProperty: function (keyName, decrement) { + if (_emberMetal.isNone(decrement)) { + decrement = 1; + } - Environment.prototype.begin = function begin() { - this.createdComponents = []; - this.createdManagers = []; - this.updatedComponents = []; - this.updatedManagers = []; - this.destructors = []; - this.scheduledInstallManagers = []; - this.scheduledInstallModifiers = []; - this.scheduledUpdateModifierManagers = []; - this.scheduledUpdateModifiers = []; - }; + return _emberMetal.set(this, keyName, (_emberMetal.get(this, keyName) || 0) - decrement); + }, - Environment.prototype.didCreate = function didCreate(component, manager) { - this.createdComponents.push(component); - this.createdManagers.push(manager); - }; + /** + Set the value of a boolean property to the opposite of its + current value. + ```javascript + starship.toggleProperty('warpDriveEngaged'); + ``` + @method toggleProperty + @param {String} keyName The name of the property to toggle + @return {Boolean} The new property value + @public + */ + toggleProperty: function (keyName) { + return _emberMetal.set(this, keyName, !_emberMetal.get(this, keyName)); + }, - Environment.prototype.didUpdate = function didUpdate(component, manager) { - this.updatedComponents.push(component); - this.updatedManagers.push(manager); - }; + /** + Returns the cached value of a computed property, if it exists. + This allows you to inspect the value of a computed property + without accidentally invoking it if it is intended to be + generated lazily. + @method cacheFor + @param {String} keyName + @return {Object} The cached value of the computed property, if any + @public + */ + cacheFor: function (keyName) { + return _emberMetal.cacheFor(this, keyName); + }, - Environment.prototype.scheduleInstallModifier = function scheduleInstallModifier(modifier, manager) { - this.scheduledInstallManagers.push(manager); - this.scheduledInstallModifiers.push(modifier); - }; + // intended for debugging purposes + observersForKey: function (keyName) { + return _emberMetal.observersFor(this, keyName); + } + }); +}); +enifed('ember-runtime/mixins/promise_proxy', ['exports', 'ember-metal', 'ember-runtime/computed/computed_macros'], function (exports, _emberMetal, _emberRuntimeComputedComputed_macros) { + 'use strict'; - Environment.prototype.scheduleUpdateModifier = function scheduleUpdateModifier(modifier, manager) { - this.scheduledUpdateModifierManagers.push(manager); - this.scheduledUpdateModifiers.push(modifier); - }; + /** + @module ember + @submodule ember-runtime + */ - Environment.prototype.didDestroy = function didDestroy(d) { - this.destructors.push(d); - }; + function tap(proxy, promise) { + _emberMetal.setProperties(proxy, { + isFulfilled: false, + isRejected: false + }); - Environment.prototype.commit = function commit() { - for (var i = 0; i < this.createdComponents.length; i++) { - var component = this.createdComponents[i]; - var manager = this.createdManagers[i]; - manager.didCreate(component); - } - for (var i = 0; i < this.updatedComponents.length; i++) { - var component = this.updatedComponents[i]; - var manager = this.updatedManagers[i]; - manager.didUpdate(component); - } - for (var i = 0; i < this.destructors.length; i++) { - this.destructors[i].destroy(); - } - for (var i = 0; i < this.scheduledInstallManagers.length; i++) { - var manager = this.scheduledInstallManagers[i]; - var modifier = this.scheduledInstallModifiers[i]; - manager.install(modifier); - } - for (var i = 0; i < this.scheduledUpdateModifierManagers.length; i++) { - var manager = this.scheduledUpdateModifierManagers[i]; - var modifier = this.scheduledUpdateModifiers[i]; - manager.update(modifier); - } - this.createdComponents = null; - this.createdManagers = null; - this.updatedComponents = null; - this.updatedManagers = null; - this.destructors = null; - this.scheduledInstallManagers = null; - this.scheduledInstallModifiers = null; - this.scheduledUpdateModifierManagers = null; - this.scheduledUpdateModifiers = null; - }; + return promise.then(function (value) { + if (!proxy.isDestroyed && !proxy.isDestroying) { + _emberMetal.setProperties(proxy, { + content: value, + isFulfilled: true + }); + } + return value; + }, function (reason) { + if (!proxy.isDestroyed && !proxy.isDestroying) { + _emberMetal.setProperties(proxy, { + reason: reason, + isRejected: true + }); + } + throw reason; + }, 'Ember: PromiseProxy'); + } - Environment.prototype.attributeFor = function attributeFor(element, attr, isTrusting, namespace) { - return _glimmerRuntimeLibDomAttributeManagers.defaultManagers(element, attr, isTrusting, namespace); - }; + /** + A low level mixin making ObjectProxy promise-aware. + + ```javascript + let ObjectPromiseProxy = Ember.ObjectProxy.extend(Ember.PromiseProxyMixin); + + let proxy = ObjectPromiseProxy.create({ + promise: Ember.RSVP.cast($.getJSON('/some/remote/data.json')) + }); + + proxy.then(function(json){ + // the json + }, function(reason) { + // the reason why you have no json + }); + ``` + + the proxy has bindable attributes which + track the promises life cycle + + ```javascript + proxy.get('isPending') //=> true + proxy.get('isSettled') //=> false + proxy.get('isRejected') //=> false + proxy.get('isFulfilled') //=> false + ``` + + When the $.getJSON completes, and the promise is fulfilled + with json, the life cycle attributes will update accordingly. + Note that $.getJSON doesn't return an ECMA specified promise, + it is useful to wrap this with an `RSVP.cast` so that it behaves + as a spec compliant promise. + + ```javascript + proxy.get('isPending') //=> false + proxy.get('isSettled') //=> true + proxy.get('isRejected') //=> false + proxy.get('isFulfilled') //=> true + ``` + + As the proxy is an ObjectProxy, and the json now its content, + all the json properties will be available directly from the proxy. + + ```javascript + // Assuming the following json: + { + firstName: 'Stefan', + lastName: 'Penner' + } + + // both properties will accessible on the proxy + proxy.get('firstName') //=> 'Stefan' + proxy.get('lastName') //=> 'Penner' + ``` + + @class Ember.PromiseProxyMixin + @public + */ + exports.default = _emberMetal.Mixin.create({ + /** + If the proxied promise is rejected this will contain the reason + provided. + @property reason + @default null + @public + */ + reason: null, - return Environment; - })(); + /** + Once the proxied promise has settled this will become `false`. + @property isPending + @default true + @public + */ + isPending: _emberRuntimeComputedComputed_macros.not('isSettled').readOnly(), - exports.Environment = Environment; - exports.default = Environment; - - function parseStatement(statement) { - var type = statement.type; - var block = type === 'block' ? statement : null; - var append = type === 'optimized-append' ? statement : null; - var modifier = type === 'modifier' ? statement : null; - var appendType = append && append.value.type; - var args = undefined; - var path = undefined; - if (block) { - args = block.args; - path = block.path; - } else if (append && (appendType === 'unknown' || appendType === 'get')) { - var appendValue = append.value; - args = _glimmerRuntimeLibSyntaxCore.Args.empty(); - path = appendValue.ref.parts; - } else if (append && append.value.type === 'helper') { - var helper = append.value; - args = helper.args; - path = helper.ref.parts; - } else if (modifier) { - path = modifier.path; - args = modifier.args; - } - var key = undefined, - isSimple = undefined; - if (path) { - isSimple = path.length === 1; - key = path[0]; - } - return { - isSimple: isSimple, - path: path, - key: key, - args: args, - appendType: appendType, - original: statement, - isInline: !!append, - isBlock: !!block, - isModifier: !!modifier - }; - } -}); + /** + Once the proxied promise has settled this will become `true`. + @property isSettled + @default false + @public + */ + isSettled: _emberRuntimeComputedComputed_macros.or('isRejected', 'isFulfilled').readOnly(), -enifed('glimmer-runtime/lib/helpers/get-dynamic-var', ['exports', 'glimmer-reference'], function (exports, _glimmerReference) { - 'use strict'; + /** + Will become `true` if the proxied promise is rejected. + @property isRejected + @default false + @public + */ + isRejected: false, - var DynamicVarReference = (function () { - function DynamicVarReference(scope, nameRef) { - this.scope = scope; - this.nameRef = nameRef; - var varTag = this.varTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - this.tag = _glimmerReference.combine([nameRef.tag, varTag]); - } + /** + Will become `true` if the proxied promise is fulfilled. + @property isFulfilled + @default false + @public + */ + isFulfilled: false, - DynamicVarReference.prototype.value = function value() { - return this.getVar().value(); - }; + /** + The promise whose fulfillment value is being proxied by this object. + This property must be specified upon creation, and should not be + changed once created. + Example: + ```javascript + Ember.ObjectProxy.extend(Ember.PromiseProxyMixin).create({ + promise: + }); + ``` + @property promise + @public + */ + promise: _emberMetal.computed({ + get: function () { + throw new _emberMetal.Error('PromiseProxy\'s promise must be set'); + }, + set: function (key, promise) { + return tap(this, promise); + } + }), - DynamicVarReference.prototype.get = function get(key) { - return this.getVar().get(key); - }; + /** + An alias to the proxied promise's `then`. + See RSVP.Promise.then. + @method then + @param {Function} callback + @return {RSVP.Promise} + @public + */ + then: promiseAlias('then'), - DynamicVarReference.prototype.getVar = function getVar() { - var name = String(this.nameRef.value()); - var ref = this.scope.get(name); - this.varTag.update(ref.tag); - return ref; - }; + /** + An alias to the proxied promise's `catch`. + See RSVP.Promise.catch. + @method catch + @param {Function} callback + @return {RSVP.Promise} + @since 1.3.0 + @public + */ + 'catch': promiseAlias('catch'), - return DynamicVarReference; - })(); + /** + An alias to the proxied promise's `finally`. + See RSVP.Promise.finally. + @method finally + @param {Function} callback + @return {RSVP.Promise} + @since 1.3.0 + @public + */ + 'finally': promiseAlias('finally') - function getDynamicVar(vm, args, symbolTable) { - var scope = vm.dynamicScope(); - var nameRef = args.positional.at(0); - return new DynamicVarReference(scope, nameRef); - } - exports.default = getDynamicVar; + }); + + function promiseAlias(name) { + return function () { + var promise = _emberMetal.get(this, 'promise'); + return promise[name].apply(promise, arguments); + }; + } }); +enifed('ember-runtime/mixins/registry_proxy', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-runtime + */ -enifed("glimmer-runtime/lib/modifier/interfaces", ["exports"], function (exports) { - "use strict"; -}); + 'use strict'; -enifed("glimmer-runtime/lib/opcode-builder", ["exports"], function (exports) { - "use strict"; -}); + exports.buildFakeRegistryWithDeprecations = buildFakeRegistryWithDeprecations; -enifed('glimmer-runtime/lib/opcodes', ['exports', 'glimmer-util'], function (exports, _glimmerUtil) { - 'use strict'; + /** + RegistryProxyMixin is used to provide public access to specific + registry functionality. + + @class RegistryProxyMixin + @private + */ + exports.default = _emberMetal.Mixin.create({ + __registry__: null, - exports.inspect = inspect; + /** + Given a fullName return the corresponding factory. + @public + @method resolveRegistration + @param {String} fullName + @return {Function} fullName's factory + */ + resolveRegistration: registryAlias('resolve'), - var AbstractOpcode = (function () { - function AbstractOpcode() { - _glimmerUtil.initializeGuid(this); - } + /** + Registers a factory that can be used for dependency injection (with + `inject`) or for service lookup. Each factory is registered with + a full name including two parts: `type:name`. + A simple example: + ```javascript + let App = Ember.Application.create(); + App.Orange = Ember.Object.extend(); + App.register('fruit:favorite', App.Orange); + ``` + Ember will resolve factories from the `App` namespace automatically. + For example `App.CarsController` will be discovered and returned if + an application requests `controller:cars`. + An example of registering a controller with a non-standard name: + ```javascript + let App = Ember.Application.create(); + let Session = Ember.Controller.extend(); + App.register('controller:session', Session); + // The Session controller can now be treated like a normal controller, + // despite its non-standard name. + App.ApplicationController = Ember.Controller.extend({ + needs: ['session'] + }); + ``` + Registered factories are **instantiated** by having `create` + called on them. Additionally they are **singletons**, each time + they are looked up they return the same instance. + Some examples modifying that default behavior: + ```javascript + let App = Ember.Application.create(); + App.Person = Ember.Object.extend(); + App.Orange = Ember.Object.extend(); + App.Email = Ember.Object.extend(); + App.session = Ember.Object.create(); + App.register('model:user', App.Person, { singleton: false }); + App.register('fruit:favorite', App.Orange); + App.register('communication:main', App.Email, { singleton: false }); + App.register('session', App.session, { instantiate: false }); + ``` + @method register + @param fullName {String} type:name (e.g., 'model:user') + @param factory {Function} (e.g., App.Person) + @param options {Object} (optional) disable instantiation or singleton usage + @public + */ + register: registryAlias('register'), - AbstractOpcode.prototype.toJSON = function toJSON() { - return { guid: this._guid, type: this.type }; - }; + /** + Unregister a factory. + ```javascript + let App = Ember.Application.create(); + let User = Ember.Object.extend(); + App.register('model:user', User); + App.resolveRegistration('model:user').create() instanceof User //=> true + App.unregister('model:user') + App.resolveRegistration('model:user') === undefined //=> true + ``` + @public + @method unregister + @param {String} fullName + */ + unregister: registryAlias('unregister'), - return AbstractOpcode; - })(); + /** + Check if a factory is registered. + @public + @method hasRegistration + @param {String} fullName + @return {Boolean} + */ + hasRegistration: registryAlias('has'), - exports.AbstractOpcode = AbstractOpcode; + /** + Register an option for a particular factory. + @public + @method registerOption + @param {String} fullName + @param {String} optionName + @param {Object} options + */ + registerOption: registryAlias('option'), - var Opcode = (function (_AbstractOpcode) { - babelHelpers.inherits(Opcode, _AbstractOpcode); + /** + Return a specific registered option for a particular factory. + @public + @method registeredOption + @param {String} fullName + @param {String} optionName + @return {Object} options + */ + registeredOption: registryAlias('getOption'), - function Opcode() { - _AbstractOpcode.apply(this, arguments); - this.next = null; - this.prev = null; - } + /** + Register options for a particular factory. + @public + @method registerOptions + @param {String} fullName + @param {Object} options + */ + registerOptions: registryAlias('options'), - return Opcode; - })(AbstractOpcode); + /** + Return registered options for a particular factory. + @public + @method registeredOptions + @param {String} fullName + @return {Object} options + */ + registeredOptions: registryAlias('getOptions'), - exports.Opcode = Opcode; + /** + Allow registering options for all factories of a type. + ```javascript + let App = Ember.Application.create(); + let appInstance = App.buildInstance(); + // if all of type `connection` must not be singletons + appInstance.registerOptionsForType('connection', { singleton: false }); + appInstance.register('connection:twitter', TwitterConnection); + appInstance.register('connection:facebook', FacebookConnection); + let twitter = appInstance.lookup('connection:twitter'); + let twitter2 = appInstance.lookup('connection:twitter'); + twitter === twitter2; // => false + let facebook = appInstance.lookup('connection:facebook'); + let facebook2 = appInstance.lookup('connection:facebook'); + facebook === facebook2; // => false + ``` + @public + @method registerOptionsForType + @param {String} type + @param {Object} options + */ + registerOptionsForType: registryAlias('optionsForType'), - var UpdatingOpcode = (function (_AbstractOpcode2) { - babelHelpers.inherits(UpdatingOpcode, _AbstractOpcode2); + /** + Return the registered options for all factories of a type. + @public + @method registeredOptionsForType + @param {String} type + @return {Object} options + */ + registeredOptionsForType: registryAlias('getOptionsForType'), - function UpdatingOpcode() { - _AbstractOpcode2.apply(this, arguments); - this.next = null; - this.prev = null; - } + /** + Define a dependency injection onto a specific factory or all factories + of a type. + When Ember instantiates a controller, view, or other framework component + it can attach a dependency to that component. This is often used to + provide services to a set of framework components. + An example of providing a session object to all controllers: + ```javascript + let App = Ember.Application.create(); + let Session = Ember.Object.extend({ isAuthenticated: false }); + // A factory must be registered before it can be injected + App.register('session:main', Session); + // Inject 'session:main' onto all factories of the type 'controller' + // with the name 'session' + App.inject('controller', 'session', 'session:main'); + App.IndexController = Ember.Controller.extend({ + isLoggedIn: Ember.computed.alias('session.isAuthenticated') + }); + ``` + Injections can also be performed on specific factories. + ```javascript + App.inject(, , ) + App.inject('route', 'source', 'source:main') + App.inject('route:application', 'email', 'model:email') + ``` + It is important to note that injections can only be performed on + classes that are instantiated by Ember itself. Instantiating a class + directly (via `create` or `new`) bypasses the dependency injection + system. + **Note:** Ember-Data instantiates its models in a unique manner, and consequently + injections onto models (or all models) will not work as expected. Injections + on models can be enabled by setting `EmberENV.MODEL_FACTORY_INJECTIONS` + to `true`. + @public + @method inject + @param factoryNameOrType {String} + @param property {String} + @param injectionName {String} + **/ + inject: registryAlias('injection') + }); - return UpdatingOpcode; - })(AbstractOpcode); + function registryAlias(name) { + return function () { + var _registry__; - exports.UpdatingOpcode = UpdatingOpcode; + return (_registry__ = this.__registry__)[name].apply(_registry__, arguments); + }; + } - function inspect(opcodes) { - var buffer = []; - opcodes.toArray().forEach(function (opcode, i) { - _inspect(opcode.toJSON(), buffer, 0, i); - }); - return buffer.join(''); - } + function buildFakeRegistryWithDeprecations(instance, typeForMessage) { + var fakeRegistry = {}; + var registryProps = { + resolve: 'resolveRegistration', + register: 'register', + unregister: 'unregister', + has: 'hasRegistration', + option: 'registerOption', + options: 'registerOptions', + getOptions: 'registeredOptions', + optionsForType: 'registerOptionsForType', + getOptionsForType: 'registeredOptionsForType', + injection: 'inject' + }; - function _inspect(opcode, buffer, level, index) { - var indentation = []; - for (var i = 0; i < level; i++) { - indentation.push(' '); - } - buffer.push.apply(buffer, indentation); - buffer.push(index + 1 + '. ' + opcode.type.toUpperCase()); - if (opcode.args || opcode.details) { - buffer.push('('); - if (opcode.args) { - buffer.push(opcode.args.join(', ')); - } - if (opcode.details) { - var keys = Object.keys(opcode.details); - if (keys.length) { - if (opcode.args && opcode.args.length) { - buffer.push(', '); - } - buffer.push(keys.map(function (key) { - return key + '=' + opcode.details[key]; - }).join(', ')); - } - } - buffer.push(')'); - } - buffer.push('\n'); - if (opcode.children && opcode.children.length) { - for (var i = 0; i < opcode.children.length; i++) { - _inspect(opcode.children[i], buffer, level + 1, i); - } - } + for (var deprecatedProperty in registryProps) { + fakeRegistry[deprecatedProperty] = buildFakeRegistryFunction(instance, typeForMessage, deprecatedProperty, registryProps[deprecatedProperty]); } -}); -enifed("glimmer-runtime/lib/partial", ["exports"], function (exports) { - "use strict"; + return fakeRegistry; + } - var PartialDefinition = function PartialDefinition(name, template) { - this.name = name; - this.template = template; + function buildFakeRegistryFunction(instance, typeForMessage, deprecatedProperty, nonDeprecatedProperty) { + return function () { + return instance[nonDeprecatedProperty].apply(instance, arguments); }; - - exports.PartialDefinition = PartialDefinition; + } }); +enifed('ember-runtime/mixins/target_action_support', ['exports', 'ember-environment', 'ember-metal'], function (exports, _emberEnvironment, _emberMetal) { + /** + @module ember + @submodule ember-runtime + */ -enifed('glimmer-runtime/lib/references', ['exports', 'glimmer-reference'], function (exports, _glimmerReference) { - 'use strict'; - - var PrimitiveReference = (function (_ConstReference) { - babelHelpers.inherits(PrimitiveReference, _ConstReference); - - function PrimitiveReference(value) { - _ConstReference.call(this, value); - } - - PrimitiveReference.create = function create(value) { - if (value === undefined) { - return UNDEFINED_REFERENCE; - } else if (value === null) { - return NULL_REFERENCE; - } else if (value === true) { - return TRUE_REFERENCE; - } else if (value === false) { - return FALSE_REFERENCE; - } else if (typeof value === 'number') { - return new ValueReference(value); - } else { - return new StringReference(value); - } - }; - - PrimitiveReference.prototype.get = function get(key) { - return UNDEFINED_REFERENCE; - }; - - return PrimitiveReference; - })(_glimmerReference.ConstReference); + 'use strict'; - exports.PrimitiveReference = PrimitiveReference; + /** + `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 + usually the best choice. This mixin is most often useful when you are + doing more complex event handling in Components. + + @class TargetActionSupport + @namespace Ember + @extends Ember.Mixin + @private + */ + exports.default = _emberMetal.Mixin.create({ + target: null, + action: null, + actionContext: null, - var StringReference = (function (_PrimitiveReference) { - babelHelpers.inherits(StringReference, _PrimitiveReference); + actionContextObject: _emberMetal.computed('actionContext', function () { + var actionContext = _emberMetal.get(this, 'actionContext'); - function StringReference() { - _PrimitiveReference.apply(this, arguments); - this.lengthReference = null; + if (typeof actionContext === 'string') { + var value = _emberMetal.get(this, actionContext); + if (value === undefined) { + value = _emberMetal.get(_emberEnvironment.context.lookup, actionContext); } + return value; + } else { + return actionContext; + } + }), - StringReference.prototype.get = function get(key) { - if (key === 'length') { - var lengthReference = this.lengthReference; - - if (lengthReference === null) { - lengthReference = this.lengthReference = new ValueReference(this.inner.length); - } - return lengthReference; - } else { - return _PrimitiveReference.prototype.get.call(this, key); - } - }; - - return StringReference; - })(PrimitiveReference); - - var ValueReference = (function (_PrimitiveReference2) { - babelHelpers.inherits(ValueReference, _PrimitiveReference2); + /** + Send an `action` with an `actionContext` to a `target`. The action, actionContext + and target will be retrieved from properties of the object. For example: + ```javascript + App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, { + target: Ember.computed.alias('controller'), + action: 'save', + actionContext: Ember.computed.alias('context'), + click() { + this.triggerAction(); // Sends the `save` action, along with the current context + // to the current controller + } + }); + ``` + The `target`, `action`, and `actionContext` can be provided as properties of + an optional object argument to `triggerAction` as well. + ```javascript + App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, { + click() { + this.triggerAction({ + action: 'save', + target: this.get('controller'), + actionContext: this.get('context') + }); // Sends the `save` action, along with the current context + // to the current controller + } + }); + ``` + The `actionContext` defaults to the object you are mixing `TargetActionSupport` into. + But `target` and `action` must be specified either as properties or with the argument + to `triggerAction`, or a combination: + ```javascript + App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, { + target: Ember.computed.alias('controller'), + click() { + this.triggerAction({ + action: 'save' + }); // Sends the `save` action, along with a reference to `this`, + // to the current controller + } + }); + ``` + @method triggerAction + @param opts {Object} (optional, with the optional keys action, target and/or actionContext) + @return {Boolean} true if the action was sent successfully and did not return false + @private + */ + triggerAction: function () { + var opts = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - function ValueReference(value) { - _PrimitiveReference2.call(this, value); - } + var action = opts.action || _emberMetal.get(this, 'action'); + var target = opts.target; - return ValueReference; - })(PrimitiveReference); + if (!target) { + target = getTarget(this); + } - var UNDEFINED_REFERENCE = new ValueReference(undefined); - exports.UNDEFINED_REFERENCE = UNDEFINED_REFERENCE; - var NULL_REFERENCE = new ValueReference(null); - exports.NULL_REFERENCE = NULL_REFERENCE; - var TRUE_REFERENCE = new ValueReference(true); - var FALSE_REFERENCE = new ValueReference(false); + var actionContext = opts.actionContext; - var ConditionalReference = (function () { - function ConditionalReference(inner) { - this.inner = inner; - this.tag = inner.tag; + function args(options, actionName) { + var ret = []; + if (actionName) { + ret.push(actionName); } - ConditionalReference.prototype.value = function value() { - return this.toBool(this.inner.value()); - }; + return ret.concat(options); + } - ConditionalReference.prototype.toBool = function toBool(value) { - return !!value; - }; + if (typeof actionContext === 'undefined') { + actionContext = _emberMetal.get(this, 'actionContextObject') || this; + } - return ConditionalReference; - })(); + if (target && action) { + var ret = undefined; - exports.ConditionalReference = ConditionalReference; -}); + if (target.send) { + var _target; -enifed('glimmer-runtime/lib/scanner', ['exports', 'glimmer-runtime/lib/syntax/statements', 'glimmer-runtime/lib/compiled/blocks', 'glimmer-util', 'glimmer-runtime/lib/symbol-table'], function (exports, _glimmerRuntimeLibSyntaxStatements, _glimmerRuntimeLibCompiledBlocks, _glimmerUtil, _glimmerRuntimeLibSymbolTable) { - 'use strict'; + ret = (_target = target).send.apply(_target, args(actionContext, action)); + } else { + var _target2; - var Scanner = (function () { - function Scanner(block, meta, env) { - this.block = block; - this.meta = meta; - this.env = env; + ret = (_target2 = target)[action].apply(_target2, args(actionContext)); } - Scanner.prototype.scanEntryPoint = function scanEntryPoint() { - var block = this.block; - var meta = this.meta; - - var symbolTable = _glimmerRuntimeLibSymbolTable.default.forEntryPoint(meta); - var program = buildStatements(block, block.blocks, symbolTable, this.env); - return new _glimmerRuntimeLibCompiledBlocks.EntryPoint(program, symbolTable); - }; - - Scanner.prototype.scanLayout = function scanLayout() { - var block = this.block; - var meta = this.meta; - var blocks = block.blocks; - var named = block.named; - var yields = block.yields; - var hasPartials = block.hasPartials; - - var symbolTable = _glimmerRuntimeLibSymbolTable.default.forLayout(named, yields, hasPartials, meta); - var program = buildStatements(block, blocks, symbolTable, this.env); - return new _glimmerRuntimeLibCompiledBlocks.Layout(program, symbolTable, named, yields, hasPartials); - }; - - Scanner.prototype.scanPartial = function scanPartial(symbolTable) { - var block = this.block; - var blocks = block.blocks; - var locals = block.locals; - - var program = buildStatements(block, blocks, symbolTable, this.env); - return new _glimmerRuntimeLibCompiledBlocks.PartialBlock(program, symbolTable, locals); - }; + if (ret !== false) { + ret = true; + } - return Scanner; - })(); + return ret; + } else { + return false; + } + } + }); - exports.default = Scanner; + function getTarget(instance) { + // TODO: Deprecate specifying `targetObject` + var target = _emberMetal.get(instance, 'targetObject'); - function buildStatements(_ref, blocks, symbolTable, env) { - var statements = _ref.statements; + // if a `targetObject` CP was provided, use it + if (target) { + return target; + } - if (statements.length === 0) return EMPTY_PROGRAM; - return new BlockScanner(statements, blocks, symbolTable, env).scan(); + // if _targetObject use it + if (instance._targetObject) { + return instance._targetObject; } - var EMPTY_PROGRAM = _glimmerUtil.EMPTY_SLICE; - var BlockScanner = (function () { - function BlockScanner(statements, blocks, symbolTable, env) { - this.blocks = blocks; - this.symbolTable = symbolTable; - this.stack = new _glimmerUtil.Stack(); - this.stack.push(new ChildBlockScanner(symbolTable)); - this.reader = new SyntaxReader(statements, symbolTable, this); - this.env = env; + target = _emberMetal.get(instance, 'target'); + if (target) { + if (typeof target === 'string') { + var value = _emberMetal.get(instance, target); + if (value === undefined) { + value = _emberMetal.get(_emberEnvironment.context.lookup, target); } - BlockScanner.prototype.scan = function scan() { - var statement = undefined; - while (statement = this.reader.next()) { - this.addStatement(statement); - } - return this.stack.current.program; - }; - - BlockScanner.prototype.blockFor = function blockFor(symbolTable, id) { - var block = this.blocks[id]; - var childTable = _glimmerRuntimeLibSymbolTable.default.forBlock(this.symbolTable, block.locals); - var program = buildStatements(block, this.blocks, childTable, this.env); - return new _glimmerRuntimeLibCompiledBlocks.InlineBlock(program, childTable, block.locals); - }; - - BlockScanner.prototype.startBlock = function startBlock(locals) { - var childTable = _glimmerRuntimeLibSymbolTable.default.forBlock(this.symbolTable, locals); - this.stack.push(new ChildBlockScanner(childTable)); - }; - - BlockScanner.prototype.endBlock = function endBlock(locals) { - var _stack$pop = this.stack.pop(); - - var program = _stack$pop.program; - var symbolTable = _stack$pop.symbolTable; - - var block = new _glimmerRuntimeLibCompiledBlocks.InlineBlock(program, symbolTable, locals); - this.addChild(block); - return block; - }; - - BlockScanner.prototype.addChild = function addChild(block) { - this.stack.current.addChild(block); - }; - - BlockScanner.prototype.addStatement = function addStatement(statement) { - this.stack.current.addStatement(statement.scan(this)); - }; - - BlockScanner.prototype.next = function next() { - return this.reader.next(); - }; - - return BlockScanner; - })(); - - exports.BlockScanner = BlockScanner; - - var ChildBlockScanner = (function () { - function ChildBlockScanner(symbolTable) { - this.symbolTable = symbolTable; - this.children = []; - this.program = new _glimmerUtil.LinkedList(); - } + return value; + } else { + return target; + } + } - ChildBlockScanner.prototype.addChild = function addChild(block) { - this.children.push(block); - }; + return null; + } +}); +enifed("ember-runtime/string_registry", ["exports"], function (exports) { + // STATE within a module is frowned apon, this exists + // to support Ember.STRINGS but shield ember internals from this legacy global + // API. + "use strict"; - ChildBlockScanner.prototype.addStatement = function addStatement(statement) { - this.program.append(statement); - }; + exports.setStrings = setStrings; + exports.getStrings = getStrings; + exports.get = get; + var STRINGS = {}; - return ChildBlockScanner; - })(); + function setStrings(strings) { + STRINGS = strings; + } - var SyntaxReader = (function () { - function SyntaxReader(statements, symbolTable, scanner) { - this.statements = statements; - this.symbolTable = symbolTable; - this.scanner = scanner; - this.current = 0; - this.last = null; - } - - SyntaxReader.prototype.next = function next() { - var last = this.last; - if (last) { - this.last = null; - return last; - } else if (this.current === this.statements.length) { - return null; - } - var sexp = this.statements[this.current++]; - return _glimmerRuntimeLibSyntaxStatements.default(sexp, this.symbolTable, this.scanner); - }; + function getStrings() { + return STRINGS; + } - return SyntaxReader; - })(); + function get(name) { + return STRINGS[name]; + } }); +enifed('ember-runtime/system/application', ['exports', 'ember-runtime/system/namespace'], function (exports, _emberRuntimeSystemNamespace) { + 'use strict'; -enifed('glimmer-runtime/lib/symbol-table', ['exports', 'glimmer-util'], function (exports, _glimmerUtil) { - 'use strict'; - - var SymbolTable = (function () { - function SymbolTable(parent) { - var meta = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + exports.default = _emberRuntimeSystemNamespace.default.extend(); +}); +enifed('ember-runtime/system/array_proxy', ['exports', 'ember-metal', 'ember-runtime/utils', 'ember-runtime/system/object', 'ember-runtime/mixins/mutable_array', 'ember-runtime/mixins/enumerable', 'ember-runtime/mixins/array'], function (exports, _emberMetal, _emberRuntimeUtils, _emberRuntimeSystemObject, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsArray) { + 'use strict'; - this.parent = parent; - this.meta = meta; - this.locals = _glimmerUtil.dict(); - this.named = _glimmerUtil.dict(); - this.yields = _glimmerUtil.dict(); - this.partialArgs = null; - this.size = 1; - this.top = parent ? parent.top : this; - } + /** + @module ember + @submodule ember-runtime + */ - SymbolTable.forEntryPoint = function forEntryPoint(meta) { - return new SymbolTable(null, meta).initEntryPoint(); - }; + var OUT_OF_RANGE_EXCEPTION = 'Index out of range'; + var EMPTY = []; - SymbolTable.forLayout = function forLayout(named, yields, hasPartials, meta) { - return new SymbolTable(null, meta).initLayout(named, yields, hasPartials); - }; + function K() { + return this; + } - SymbolTable.forBlock = function forBlock(parent, locals) { - return new SymbolTable(parent, null).initBlock(locals); - }; + /** + An ArrayProxy wraps any other object that implements `Ember.Array` and/or + `Ember.MutableArray,` forwarding all requests. This makes it very useful for + a number of binding use cases or other cases where being able to swap + out the underlying array is useful. + + A simple example of usage: + + ```javascript + let pets = ['dog', 'cat', 'fish']; + let ap = Ember.ArrayProxy.create({ content: Ember.A(pets) }); + + ap.get('firstObject'); // 'dog' + ap.set('content', ['amoeba', 'paramecium']); + ap.get('firstObject'); // 'amoeba' + ``` + + This class can also be useful as a layer to transform the contents of + an array, as they are accessed. This can be done by overriding + `objectAtContent`: + + ```javascript + let pets = ['dog', 'cat', 'fish']; + let ap = Ember.ArrayProxy.create({ + content: Ember.A(pets), + objectAtContent: function(idx) { + return this.get('content').objectAt(idx).toUpperCase(); + } + }); + + ap.get('firstObject'); // . 'DOG' + ``` + + @class ArrayProxy + @namespace Ember + @extends Ember.Object + @uses Ember.MutableArray + @public + */ + exports.default = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsMutable_array.default, { - SymbolTable.prototype.initEntryPoint = function initEntryPoint() { - return this; - }; + /** + The content array. Must be an object that implements `Ember.Array` and/or + `Ember.MutableArray.` + @property content + @type Ember.Array + @private + */ + content: null, - SymbolTable.prototype.initBlock = function initBlock(locals) { - this.initPositionals(locals); - return this; - }; + /** + The array that the proxy pretends to be. In the default `ArrayProxy` + implementation, this and `content` are the same. Subclasses of `ArrayProxy` + can override this property to provide things like sorting and filtering. + @property arrangedContent + @private + */ + arrangedContent: _emberMetal.alias('content'), - SymbolTable.prototype.initLayout = function initLayout(named, yields, hasPartials) { - this.initNamed(named); - this.initYields(yields); - this.initPartials(hasPartials); - return this; - }; + /** + Should actually retrieve the object at the specified index from the + content. You can override this method in subclasses to transform the + content item to something new. + This method will only be called if content is non-`null`. + @method objectAtContent + @param {Number} idx The index to retrieve. + @return {Object} the value or undefined if none found + @public + */ + objectAtContent: function (idx) { + return _emberRuntimeMixinsArray.objectAt(_emberMetal.get(this, 'arrangedContent'), idx); + }, - SymbolTable.prototype.initPositionals = function initPositionals(positionals) { - var _this = this; + /** + Should actually replace the specified objects on the content array. + You can override this method in subclasses to transform the content item + into something new. + This method will only be called if content is non-`null`. + @method replaceContent + @param {Number} idx The starting index + @param {Number} amt The number of items to remove from the content. + @param {Array} objects Optional array of objects to insert or null if no + objects. + @return {void} + @private + */ + replaceContent: function (idx, amt, objects) { + _emberMetal.get(this, 'content').replace(idx, amt, objects); + }, - if (positionals) positionals.forEach(function (s) { - return _this.locals[s] = _this.top.size++; - }); - return this; - }; + /** + Invoked when the content property is about to change. Notifies observers that the + entire array content will change. + @private + @method _contentWillChange + */ + _contentWillChange: _emberMetal._beforeObserver('content', function () { + this._teardownContent(); + }), - SymbolTable.prototype.initNamed = function initNamed(named) { - var _this2 = this; + _teardownContent: function () { + var content = _emberMetal.get(this, 'content'); - if (named) named.forEach(function (s) { - return _this2.named[s] = _this2.top.size++; - }); - return this; - }; + if (content) { + _emberRuntimeMixinsArray.removeArrayObserver(content, this, { + willChange: 'contentArrayWillChange', + didChange: 'contentArrayDidChange' + }); + } + }, - SymbolTable.prototype.initYields = function initYields(yields) { - var _this3 = this; + /** + Override to implement content array `willChange` observer. + @method contentArrayWillChange + @param {Ember.Array} contentArray the content array + @param {Number} start starting index of the change + @param {Number} removeCount count of items removed + @param {Number} addCount count of items added + @private + */ + contentArrayWillChange: K, + /** + Override to implement content array `didChange` observer. + @method contentArrayDidChange + @param {Ember.Array} contentArray the content array + @param {Number} start starting index of the change + @param {Number} removeCount count of items removed + @param {Number} addCount count of items added + @private + */ + contentArrayDidChange: K, - if (yields) yields.forEach(function (b) { - return _this3.yields[b] = _this3.top.size++; - }); - return this; - }; + /** + Invoked when the content property changes. Notifies observers that the + entire array content has changed. + @private + @method _contentDidChange + */ + _contentDidChange: _emberMetal.observer('content', function () { + var content = _emberMetal.get(this, 'content'); - SymbolTable.prototype.initPartials = function initPartials(hasPartials) { - if (hasPartials) this.top.partialArgs = this.top.size++; - return this; - }; + this._setupContent(); + }), - SymbolTable.prototype.getMeta = function getMeta() { - var meta = this.meta; - var parent = this.parent; + _setupContent: function () { + var content = _emberMetal.get(this, 'content'); - if (!meta && parent) { - meta = parent.getMeta(); - } - return meta; - }; + if (content) { - SymbolTable.prototype.getYield = function getYield(name) { - var yields = this.yields; - var parent = this.parent; + _emberRuntimeMixinsArray.addArrayObserver(content, this, { + willChange: 'contentArrayWillChange', + didChange: 'contentArrayDidChange' + }); + } + }, - var symbol = yields[name]; - if (!symbol && parent) { - symbol = parent.getYield(name); - } - return symbol; - }; + _arrangedContentWillChange: _emberMetal._beforeObserver('arrangedContent', function () { + var arrangedContent = _emberMetal.get(this, 'arrangedContent'); + var len = arrangedContent ? _emberMetal.get(arrangedContent, 'length') : 0; - SymbolTable.prototype.getNamed = function getNamed(name) { - var named = this.named; - var parent = this.parent; + this.arrangedContentArrayWillChange(this, 0, len, undefined); + this.arrangedContentWillChange(this); - var symbol = named[name]; - if (!symbol && parent) { - symbol = parent.getNamed(name); - } - return symbol; - }; + this._teardownArrangedContent(arrangedContent); + }), - SymbolTable.prototype.getLocal = function getLocal(name) { - var locals = this.locals; - var parent = this.parent; + _arrangedContentDidChange: _emberMetal.observer('arrangedContent', function () { + var arrangedContent = _emberMetal.get(this, 'arrangedContent'); + var len = arrangedContent ? _emberMetal.get(arrangedContent, 'length') : 0; - var symbol = locals[name]; - if (!symbol && parent) { - symbol = parent.getLocal(name); - } - return symbol; - }; + this._setupArrangedContent(); - SymbolTable.prototype.getPartialArgs = function getPartialArgs() { - return this.top.partialArgs; - }; + this.arrangedContentDidChange(this); + this.arrangedContentArrayDidChange(this, 0, undefined, len); + }), - SymbolTable.prototype.isTop = function isTop() { - return this.top === this; - }; + _setupArrangedContent: function () { + var arrangedContent = _emberMetal.get(this, 'arrangedContent'); - return SymbolTable; - })(); + if (arrangedContent) { - exports.default = SymbolTable; -}); + _emberRuntimeMixinsArray.addArrayObserver(arrangedContent, this, { + willChange: 'arrangedContentArrayWillChange', + didChange: 'arrangedContentArrayDidChange' + }); + } + }, -enifed("glimmer-runtime/lib/syntax", ["exports"], function (exports) { - "use strict"; + _teardownArrangedContent: function () { + var arrangedContent = _emberMetal.get(this, 'arrangedContent'); - exports.isAttribute = isAttribute; + if (arrangedContent) { + _emberRuntimeMixinsArray.removeArrayObserver(arrangedContent, this, { + willChange: 'arrangedContentArrayWillChange', + didChange: 'arrangedContentArrayDidChange' + }); + } + }, - var Statement = (function () { - function Statement() { - this.next = null; - this.prev = null; - } + arrangedContentWillChange: K, + arrangedContentDidChange: K, - Statement.fromSpec = function fromSpec(spec, symbolTable, scanner) { - throw new Error("You need to implement fromSpec on " + this); - }; + objectAt: function (idx) { + return _emberMetal.get(this, 'content') && this.objectAtContent(idx); + }, - Statement.prototype.clone = function clone() { - // not type safe but the alternative is extreme boilerplate per - // syntax subclass. - return new this.constructor(this); - }; + length: _emberMetal.computed(function () { + var arrangedContent = _emberMetal.get(this, 'arrangedContent'); + return arrangedContent ? _emberMetal.get(arrangedContent, 'length') : 0; + // No dependencies since Enumerable notifies length of change + }), - Statement.prototype.scan = function scan(scanner) { - return this; - }; + _replace: function (idx, amt, objects) { + var content = _emberMetal.get(this, 'content'); - return Statement; - })(); + if (content) { + this.replaceContent(idx, amt, objects); + } - exports.Statement = Statement; + return this; + }, - var Expression = (function () { - function Expression() {} + replace: function () { + if (_emberMetal.get(this, 'arrangedContent') === _emberMetal.get(this, 'content')) { + this._replace.apply(this, arguments); + } else { + throw new _emberMetal.Error('Using replace on an arranged ArrayProxy is not allowed.'); + } + }, - Expression.fromSpec = function fromSpec(spec, blocks) { - throw new Error("You need to implement fromSpec on " + this); - }; + _insertAt: function (idx, object) { + if (idx > _emberMetal.get(this, 'content.length')) { + throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); + } - return Expression; - })(); + this._replace(idx, 0, [object]); + return this; + }, - exports.Expression = Expression; - var ATTRIBUTE = "e1185d30-7cac-4b12-b26a-35327d905d92"; - exports.ATTRIBUTE = ATTRIBUTE; - var ARGUMENT = "0f3802314-d747-bbc5-0168-97875185c3rt"; - exports.ARGUMENT = ARGUMENT; + insertAt: function (idx, object) { + if (_emberMetal.get(this, 'arrangedContent') === _emberMetal.get(this, 'content')) { + return this._insertAt(idx, object); + } else { + throw new _emberMetal.Error('Using insertAt on an arranged ArrayProxy is not allowed.'); + } + }, - var Attribute = (function (_Statement) { - babelHelpers.inherits(Attribute, _Statement); + removeAt: function (start, len) { + if ('number' === typeof start) { + var content = _emberMetal.get(this, 'content'); + var arrangedContent = _emberMetal.get(this, 'arrangedContent'); + var indices = []; - function Attribute() { - _Statement.apply(this, arguments); - this["e1185d30-7cac-4b12-b26a-35327d905d92"] = true; + if (start < 0 || start >= _emberMetal.get(this, 'length')) { + throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); } - return Attribute; - })(Statement); + if (len === undefined) { + len = 1; + } - exports.Attribute = Attribute; + // Get a list of indices in original content to remove + for (var i = start; i < start + len; i++) { + // Use arrangedContent here so we avoid confusion with objects transformed by objectAtContent + indices.push(content.indexOf(_emberRuntimeMixinsArray.objectAt(arrangedContent, i))); + } - var Argument = (function (_Statement2) { - babelHelpers.inherits(Argument, _Statement2); + // Replace in reverse order since indices will change + indices.sort(function (a, b) { + return b - a; + }); - function Argument() { - _Statement2.apply(this, arguments); - this["0f3802314-d747-bbc5-0168-97875185c3rt"] = true; + _emberMetal.beginPropertyChanges(); + for (var i = 0; i < indices.length; i++) { + this._replace(indices[i], 1, EMPTY); } + _emberMetal.endPropertyChanges(); + } - return Argument; - })(Statement); + return this; + }, - exports.Argument = Argument; + pushObject: function (obj) { + this._insertAt(_emberMetal.get(this, 'content.length'), obj); + return obj; + }, - function isAttribute(value) { - return value && value[ATTRIBUTE] === true; - } -}); + pushObjects: function (objects) { + if (!(_emberRuntimeMixinsEnumerable.default.detect(objects) || _emberRuntimeUtils.isArray(objects))) { + throw new TypeError('Must pass Ember.Enumerable to Ember.MutableArray#pushObjects'); + } + this._replace(_emberMetal.get(this, 'length'), 0, objects); + return this; + }, -enifed('glimmer-runtime/lib/syntax/builtins/each', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { - 'use strict'; + setObjects: function (objects) { + if (objects.length === 0) { + return this.clear(); + } - var EachSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(EachSyntax, _StatementSyntax); - - function EachSyntax(args) { - _StatementSyntax.call(this); - this.args = args; - this.type = "each-statement"; - } - - EachSyntax.prototype.compile = function compile(dsl, env) { - // Enter(BEGIN, END) - // BEGIN: Noop - // PutArgs - // PutIterable - // JumpUnless(ELSE) - // EnterList(BEGIN2, END2) - // ITER: Noop - // NextIter(BREAK) - // EnterWithKey(BEGIN2, END2) - // BEGIN2: Noop - // PushChildScope - // Evaluate(default) - // PopScope - // END2: Noop - // Exit - // Jump(ITER) - // BREAK: Noop - // ExitList - // Jump(END) - // ELSE: Noop - // Evalulate(inverse) - // END: Noop - // Exit - var args = this.args; - var blocks = this.args.blocks; - - dsl.block(args, function (dsl, BEGIN, END) { - dsl.putIterator(); - if (blocks.inverse) { - dsl.jumpUnless('ELSE'); - } else { - dsl.jumpUnless(END); - } - dsl.iter(function (dsl, BEGIN, END) { - dsl.evaluate('default', blocks.default); - }); - if (blocks.inverse) { - dsl.jump(END); - dsl.label('ELSE'); - dsl.evaluate('inverse', blocks.inverse); - } - }); - }; + var len = _emberMetal.get(this, 'length'); + this._replace(0, len, objects); + return this; + }, - return EachSyntax; - })(_glimmerRuntimeLibSyntax.Statement); + unshiftObject: function (obj) { + this._insertAt(0, obj); + return obj; + }, - exports.default = EachSyntax; -}); + unshiftObjects: function (objects) { + this._replace(0, 0, objects); + return this; + }, -enifed('glimmer-runtime/lib/syntax/builtins/if', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { - 'use strict'; + slice: function () { + var arr = this.toArray(); + return arr.slice.apply(arr, arguments); + }, - var IfSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(IfSyntax, _StatementSyntax); - - function IfSyntax(args) { - _StatementSyntax.call(this); - this.args = args; - this.type = "if-statement"; - } - - IfSyntax.prototype.compile = function compile(dsl) { - // PutArgs - // Test(Environment) - // Enter(BEGIN, END) - // BEGIN: Noop - // JumpUnless(ELSE) - // Evaluate(default) - // Jump(END) - // ELSE: Noop - // Evalulate(inverse) - // END: Noop - // Exit - var args = this.args; - var blocks = this.args.blocks; - - dsl.putArgs(args); - dsl.test('environment'); - dsl.block(null, function (dsl, BEGIN, END) { - if (blocks.inverse) { - dsl.jumpUnless('ELSE'); - dsl.evaluate('default', blocks.default); - dsl.jump(END); - dsl.label('ELSE'); - dsl.evaluate('inverse', blocks.inverse); - } else { - dsl.jumpUnless(END); - dsl.evaluate('default', blocks.default); - } - }); - }; + arrangedContentArrayWillChange: function (item, idx, removedCnt, addedCnt) { + this.arrayContentWillChange(idx, removedCnt, addedCnt); + }, - return IfSyntax; - })(_glimmerRuntimeLibSyntax.Statement); + arrangedContentArrayDidChange: function (item, idx, removedCnt, addedCnt) { + this.arrayContentDidChange(idx, removedCnt, addedCnt); + }, - exports.default = IfSyntax; -}); + init: function () { + this._super.apply(this, arguments); + this._setupContent(); + this._setupArrangedContent(); + }, -enifed('glimmer-runtime/lib/syntax/builtins/in-element', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { - 'use strict'; + willDestroy: function () { + this._teardownArrangedContent(); + this._teardownContent(); + } + }); +}); +enifed('ember-runtime/system/core_object', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/mixins/action_handler', 'ember-runtime/inject'], function (exports, _emberUtils, _emberMetal, _emberRuntimeMixinsAction_handler, _emberRuntimeInject) { + 'no use strict'; + // Remove "use strict"; from transpiled module until + // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed - var InElementSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(InElementSyntax, _StatementSyntax); + /** + @module ember + @submodule ember-runtime + */ - function InElementSyntax(args) { - _StatementSyntax.call(this); - this.args = args; - this.type = "in-element-statement"; - } + // using ember-metal/lib/main here to ensure that ember-debug is setup + // if present - InElementSyntax.prototype.compile = function compile(dsl, env) { - var args = this.args; - var blocks = this.args.blocks; + var _Mixin$create, _ClassMixinProps; - dsl.putArgs(args); - dsl.test('simple'); - dsl.block(null, function (dsl, BEGIN, END) { - dsl.jumpUnless(END); - dsl.pushRemoteElement(); - dsl.evaluate('default', blocks.default); - dsl.popRemoteElement(); - }); - }; + var schedule = _emberMetal.run.schedule; + var applyMixin = _emberMetal.Mixin._apply; + var finishPartial = _emberMetal.Mixin.finishPartial; + var reopen = _emberMetal.Mixin.prototype.reopen; + var hasCachedComputedProperties = false; - return InElementSyntax; - })(_glimmerRuntimeLibSyntax.Statement); + var POST_INIT = _emberUtils.symbol('POST_INIT'); - exports.default = InElementSyntax; -}); + exports.POST_INIT = POST_INIT; + function makeCtor() { + // Note: avoid accessing any properties on the object since it makes the + // method a lot faster. This is glue code so we want it to be as fast as + // possible. -enifed("glimmer-runtime/lib/syntax/builtins/partial", ["exports", "glimmer-runtime/lib/syntax"], function (exports, _glimmerRuntimeLibSyntax) { - "use strict"; + var wasApplied = false; + var initProperties = undefined; - var StaticPartialSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(StaticPartialSyntax, _StatementSyntax); + var Class = (function () { + function Class() { + if (!wasApplied) { + Class.proto(); // prepare prototype... + } - function StaticPartialSyntax(name) { - _StatementSyntax.call(this); - this.name = name; - this.type = "static-partial"; + if (arguments.length > 0) { + initProperties = [arguments[0]]; } - StaticPartialSyntax.prototype.compile = function compile(dsl, env, symbolTable) { - var name = String(this.name.inner()); - if (!env.hasPartial(name, symbolTable)) { - throw new Error("Compile Error: " + name + " is not a partial"); - } - var definition = env.lookupPartial(name, symbolTable); - dsl.putPartialDefinition(definition); - dsl.evaluatePartial(); - }; + this.__defineNonEnumerable(_emberUtils.GUID_KEY_PROPERTY); + var m = _emberMetal.meta(this); + var proto = m.proto; + m.proto = this; + if (initProperties) { + // capture locally so we can clear the closed over variable + var props = initProperties; + initProperties = null; - return StaticPartialSyntax; - })(_glimmerRuntimeLibSyntax.Statement); + var concatenatedProperties = this.concatenatedProperties; + var mergedProperties = this.mergedProperties; - exports.StaticPartialSyntax = StaticPartialSyntax; + for (var i = 0; i < props.length; i++) { + var properties = props[i]; - var DynamicPartialSyntax = (function (_StatementSyntax2) { - babelHelpers.inherits(DynamicPartialSyntax, _StatementSyntax2); + if (typeof properties !== 'object' && properties !== undefined) { + throw new _emberMetal.Error('Ember.Object.create only accepts objects.'); + } - function DynamicPartialSyntax(name) { - _StatementSyntax2.call(this); - this.name = name; - this.type = "dynamic-partial"; - } + if (!properties) { + continue; + } - DynamicPartialSyntax.prototype.compile = function compile(dsl) { - var name = this.name; + var keyNames = Object.keys(properties); - dsl.startLabels(); - dsl.putValue(name); - dsl.test('simple'); - dsl.enter('BEGIN', 'END'); - dsl.label('BEGIN'); - dsl.jumpUnless('END'); - dsl.putDynamicPartialDefinition(); - dsl.evaluatePartial(); - dsl.label('END'); - dsl.exit(); - dsl.stopLabels(); - }; + for (var j = 0; j < keyNames.length; j++) { + var keyName = keyNames[j]; + var value = properties[keyName]; - return DynamicPartialSyntax; - })(_glimmerRuntimeLibSyntax.Statement); + if (_emberMetal.detectBinding(keyName)) { + m.writeBindings(keyName, value); + } - exports.DynamicPartialSyntax = DynamicPartialSyntax; -}); + var possibleDesc = this[keyName]; + var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; -enifed('glimmer-runtime/lib/syntax/builtins/unless', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { - 'use strict'; + if (concatenatedProperties && concatenatedProperties.length > 0 && concatenatedProperties.indexOf(keyName) >= 0) { + var baseValue = this[keyName]; - var UnlessSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(UnlessSyntax, _StatementSyntax); - - function UnlessSyntax(args) { - _StatementSyntax.call(this); - this.args = args; - this.type = "unless-statement"; - } - - UnlessSyntax.prototype.compile = function compile(dsl, env) { - // PutArgs - // Enter(BEGIN, END) - // BEGIN: Noop - // Test(Environment) - // JumpIf(ELSE) - // Evaluate(default) - // Jump(END) - // ELSE: Noop - // Evalulate(inverse) - // END: Noop - // Exit - var args = this.args; - var blocks = this.args.blocks; - - dsl.putArgs(args); - dsl.test('environment'); - dsl.block(null, function (dsl) { - if (blocks.inverse) { - dsl.jumpIf('ELSE'); - dsl.evaluate('default', blocks.default); - dsl.jump('END'); - dsl.label('ELSE'); - dsl.evaluate('inverse', blocks.inverse); + if (baseValue) { + if ('function' === typeof baseValue.concat) { + value = baseValue.concat(value); + } else { + value = _emberUtils.makeArray(baseValue).concat(value); + } } else { - dsl.jumpIf('END'); - dsl.evaluate('default', blocks.default); + value = _emberUtils.makeArray(value); } - }); - }; - - return UnlessSyntax; - })(_glimmerRuntimeLibSyntax.Statement); - - exports.default = UnlessSyntax; -}); - -enifed('glimmer-runtime/lib/syntax/builtins/with-dynamic-vars', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { - 'use strict'; - - var WithDynamicVarsSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(WithDynamicVarsSyntax, _StatementSyntax); - - function WithDynamicVarsSyntax(args) { - _StatementSyntax.call(this); - this.args = args; - this.type = "with-dynamic-vars-statement"; - } - - WithDynamicVarsSyntax.prototype.compile = function compile(dsl, env) { - var args = this.args; - var blocks = this.args.blocks; - - dsl.unit(function (dsl) { - dsl.putArgs(args); - dsl.pushDynamicScope(); - dsl.bindDynamicScope(args.named.keys); - dsl.evaluate('default', blocks.default); - dsl.popDynamicScope(); - }); - }; - - return WithDynamicVarsSyntax; - })(_glimmerRuntimeLibSyntax.Statement); + } - exports.default = WithDynamicVarsSyntax; -}); + if (mergedProperties && mergedProperties.length && mergedProperties.indexOf(keyName) >= 0) { + var originalValue = this[keyName]; -enifed('glimmer-runtime/lib/syntax/builtins/with', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { - 'use strict'; + value = _emberUtils.assign({}, originalValue, value); + } - var WithSyntax = (function (_StatementSyntax) { - babelHelpers.inherits(WithSyntax, _StatementSyntax); - - function WithSyntax(args) { - _StatementSyntax.call(this); - this.args = args; - this.type = "with-statement"; - } - - WithSyntax.prototype.compile = function compile(dsl, env) { - // PutArgs - // Test(Environment) - // Enter(BEGIN, END) - // BEGIN: Noop - // JumpUnless(ELSE) - // Evaluate(default) - // Jump(END) - // ELSE: Noop - // Evaluate(inverse) - // END: Noop - // Exit - var args = this.args; - var blocks = this.args.blocks; - - dsl.putArgs(args); - dsl.test('environment'); - dsl.block(null, function (dsl, BEGIN, END) { - if (blocks.inverse) { - dsl.jumpUnless('ELSE'); - dsl.evaluate('default', blocks.default); - dsl.jump(END); - dsl.label('ELSE'); - dsl.evaluate('inverse', blocks.inverse); + if (desc) { + desc.set(this, keyName, value); + } else { + if (typeof this.setUnknownProperty === 'function' && !(keyName in this)) { + this.setUnknownProperty(keyName, value); } else { - dsl.jumpUnless(END); - dsl.evaluate('default', blocks.default); + if (false) { + _emberMetal.defineProperty(this, keyName, null, value); // setup mandatory setter + } else { + this[keyName] = value; + } } - }); - }; - - return WithSyntax; - })(_glimmerRuntimeLibSyntax.Statement); - - exports.default = WithSyntax; -}); - -enifed('glimmer-runtime/lib/syntax/core', ['exports', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/syntax/builtins/partial', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-runtime/lib/compiled/opcodes/component', 'glimmer-runtime/lib/compiled/opcodes/dom', 'glimmer-runtime/lib/syntax/expressions', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/compiled/expressions/value', 'glimmer-runtime/lib/compiled/expressions/lookups', 'glimmer-runtime/lib/compiled/expressions/has-block', 'glimmer-runtime/lib/compiled/expressions/helper', 'glimmer-runtime/lib/compiled/expressions/concat', 'glimmer-runtime/lib/utils', 'glimmer-runtime/lib/compiled/opcodes/content'], function (exports, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibSyntaxBuiltinsPartial, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerRuntimeLibCompiledOpcodesComponent, _glimmerRuntimeLibCompiledOpcodesDom, _glimmerRuntimeLibSyntaxExpressions, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibCompiledExpressionsValue, _glimmerRuntimeLibCompiledExpressionsLookups, _glimmerRuntimeLibCompiledExpressionsHasBlock, _glimmerRuntimeLibCompiledExpressionsHelper, _glimmerRuntimeLibCompiledExpressionsConcat, _glimmerRuntimeLibUtils, _glimmerRuntimeLibCompiledOpcodesContent) { - 'use strict'; - - var Block = (function (_StatementSyntax) { - babelHelpers.inherits(Block, _StatementSyntax); - - function Block(path, args) { - _StatementSyntax.call(this); - this.path = path; - this.args = args; - this.type = "block"; + } + } + } } - Block.fromSpec = function fromSpec(sexp, symbolTable, scanner) { - var path = sexp[1]; - var params = sexp[2]; - var hash = sexp[3]; - var templateId = sexp[4]; - var inverseId = sexp[5]; - - var template = scanner.blockFor(symbolTable, templateId); - var inverse = typeof inverseId === 'number' ? scanner.blockFor(symbolTable, inverseId) : null; - var blocks = Blocks.fromSpec(template, inverse); - return new Block(path, Args.fromSpec(params, hash, blocks)); - }; - - Block.build = function build(path, args) { - return new this(path, args); - }; - - Block.prototype.scan = function scan(scanner) { - var _args$blocks = this.args.blocks; - var _default = _args$blocks.default; - var inverse = _args$blocks.inverse; - - if (_default) scanner.addChild(_default); - if (inverse) scanner.addChild(inverse); - return this; - }; - - Block.prototype.compile = function compile(ops) { - throw new Error("SyntaxError"); - }; - - return Block; - })(_glimmerRuntimeLibSyntax.Statement); + finishPartial(this, m); - exports.Block = Block; + this.init.apply(this, arguments); - var Append = (function (_StatementSyntax2) { - babelHelpers.inherits(Append, _StatementSyntax2); + this[POST_INIT](); - function Append(_ref) { - var value = _ref.value; - var trustingMorph = _ref.trustingMorph; + m.proto = proto; + _emberMetal.finishChains(this); + _emberMetal.sendEvent(this, 'init'); + } - _StatementSyntax2.call(this); - this.value = value; - this.trustingMorph = trustingMorph; + Class.willReopen = function willReopen() { + if (wasApplied) { + Class.PrototypeMixin = _emberMetal.Mixin.create(Class.PrototypeMixin); } - Append.fromSpec = function fromSpec(sexp) { - var value = sexp[1]; - var trustingMorph = sexp[2]; - - return new OptimizedAppend({ value: _glimmerRuntimeLibSyntaxExpressions.default(value), trustingMorph: trustingMorph }); - }; - - return Append; - })(_glimmerRuntimeLibSyntax.Statement); - - exports.Append = Append; + wasApplied = false; + }; - var OptimizedAppend = (function (_Append) { - babelHelpers.inherits(OptimizedAppend, _Append); + Class._initProperties = function _initProperties(args) { + initProperties = args; + }; - function OptimizedAppend() { - _Append.apply(this, arguments); - this.type = "optimized-append"; + Class.proto = function proto() { + var superclass = Class.superclass; + if (superclass) { + superclass.proto(); } - OptimizedAppend.prototype.deopt = function deopt() { - return new UnoptimizedAppend(this); - }; - - OptimizedAppend.prototype.compile = function compile(compiler, env, symbolTable) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesVm.PutValueOpcode(this.value.compile(compiler, env, symbolTable))); - if (this.trustingMorph) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesContent.OptimizedTrustingAppendOpcode()); - } else { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesContent.OptimizedCautiousAppendOpcode()); - } - }; - - return OptimizedAppend; - })(Append); - - exports.OptimizedAppend = OptimizedAppend; - - var UnoptimizedAppend = (function (_Append2) { - babelHelpers.inherits(UnoptimizedAppend, _Append2); - - function UnoptimizedAppend() { - _Append2.apply(this, arguments); - this.type = "unoptimized-append"; + if (!wasApplied) { + wasApplied = true; + Class.PrototypeMixin.applyPartial(Class.prototype); } - UnoptimizedAppend.prototype.compile = function compile(compiler, env, symbolTable) { - var expression = this.value.compile(compiler, env, symbolTable); - if (this.trustingMorph) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesContent.GuardedTrustingAppendOpcode(expression, symbolTable)); - } else { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesContent.GuardedCautiousAppendOpcode(expression, symbolTable)); - } - }; + return this.prototype; + }; + + return Class; + })(); - return UnoptimizedAppend; - })(Append); + Class.toString = _emberMetal.Mixin.prototype.toString; - exports.UnoptimizedAppend = UnoptimizedAppend; + return Class; + } - var MODIFIER_SYNTAX = "c0420397-8ff1-4241-882b-4b7a107c9632"; + /** + @class CoreObject + @namespace Ember + @public + */ + var CoreObject = makeCtor(); + CoreObject.toString = function () { + return 'Ember.CoreObject'; + }; + CoreObject.PrototypeMixin = _emberMetal.Mixin.create((_Mixin$create = { + reopen: function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - var Modifier = (function (_StatementSyntax3) { - babelHelpers.inherits(Modifier, _StatementSyntax3); + applyMixin(this, args, true); + return this; + }, - function Modifier(options) { - _StatementSyntax3.call(this); - this["c0420397-8ff1-4241-882b-4b7a107c9632"] = true; - this.type = "modifier"; - this.path = options.path; - this.args = options.args; + /** + An overridable method called when objects are instantiated. By default, + does nothing unless it is overridden during class definition. + Example: + ```javascript + const Person = Ember.Object.extend({ + init() { + alert(`Name is ${this.get('name')}`); } + }); + let steve = Person.create({ + name: "Steve" + }); + // alerts 'Name is Steve'. + ``` + NOTE: If you do override `init` for a framework class like `Ember.View`, + be sure to call `this._super(...arguments)` in your + `init` declaration! If you don't, Ember may not have an opportunity to + do important setup work, and you'll see strange behavior in your + application. + @method init + @public + */ + init: function () {} - Modifier.fromSpec = function fromSpec(node) { - var path = node[1]; - var params = node[2]; - var hash = node[3]; + }, _Mixin$create[POST_INIT] = function () {}, _Mixin$create.__defineNonEnumerable = function (property) { + Object.defineProperty(this, property.name, property.descriptor); + //this[property.name] = property.descriptor.value; + }, _Mixin$create.concatenatedProperties = null, _Mixin$create.mergedProperties = null, _Mixin$create.isDestroyed = _emberMetal.descriptor({ + get: function () { + return _emberMetal.meta(this).isSourceDestroyed(); + }, - return new Modifier({ - path: path, - args: Args.fromSpec(params, hash, EMPTY_BLOCKS) - }); - }; + set: function (value) { + // prevent setting while applying mixins + if (typeof value === 'object' && value !== null && value.isDescriptor) { + return; + } + } + }), _Mixin$create.isDestroying = _emberMetal.descriptor({ + get: function () { + return _emberMetal.meta(this).isSourceDestroying(); + }, - Modifier.build = function build(path, options) { - return new Modifier({ - path: path, - params: options.params, - hash: options.hash - }); - }; + set: function (value) { + // prevent setting while applying mixins + if (typeof value === 'object' && value !== null && value.isDescriptor) { + return; + } + } + }), _Mixin$create.destroy = function () { + var m = _emberMetal.meta(this); + if (m.isSourceDestroying()) { + return; + } - Modifier.prototype.compile = function compile(compiler, env, symbolTable) { - var args = this.args.compile(compiler, env, symbolTable); - if (env.hasModifier(this.path, symbolTable)) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.ModifierOpcode(this.path[0], env.lookupModifier(this.path, symbolTable), args)); - } else { - throw new Error('Compile Error: ' + this.path.join('.') + ' is not a modifier'); - } - }; + m.setSourceDestroying(); - return Modifier; - })(_glimmerRuntimeLibSyntax.Statement); + schedule('actions', this, this.willDestroy); + schedule('destroy', this, this._scheduledDestroy, m); - exports.Modifier = Modifier; + return this; + }, _Mixin$create.willDestroy = function () {}, _Mixin$create._scheduledDestroy = function (m) { + if (m.isSourceDestroyed()) { + return; + } + _emberMetal.destroy(this); + m.setSourceDestroyed(); + }, _Mixin$create.bind = function (to, from) { + if (!(from instanceof _emberMetal.Binding)) { + from = _emberMetal.Binding.from(from); + } + from.to(to).connect(this); + return from; + }, _Mixin$create.toString = function () { + var hasToStringExtension = typeof this.toStringExtension === 'function'; + var extension = hasToStringExtension ? ':' + this.toStringExtension() : ''; + var ret = '<' + (this[_emberUtils.NAME_KEY] || this.constructor.toString()) + ':' + _emberUtils.guidFor(this) + extension + '>'; - var StaticArg = (function (_ArgumentSyntax) { - babelHelpers.inherits(StaticArg, _ArgumentSyntax); + return ret; + }, _Mixin$create)); - function StaticArg(name, value) { - _ArgumentSyntax.call(this); - this.name = name; - this.value = value; - this.type = "static-arg"; - } + CoreObject.PrototypeMixin.ownerConstructor = CoreObject; - StaticArg.fromSpec = function fromSpec(node) { - var name = node[1]; - var value = node[2]; + CoreObject.__super__ = null; - return new StaticArg(name, value); - }; + var ClassMixinProps = (_ClassMixinProps = { - StaticArg.build = function build(name, value) { - var namespace = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; + ClassMixin: _emberMetal.REQUIRED, - return new this(name, value); - }; + PrototypeMixin: _emberMetal.REQUIRED, - StaticArg.prototype.compile = function compile() { - throw new Error('Cannot compiler StaticArg "' + this.name + '" as it is a delegate for ValueSyntax.'); - }; + isClass: true, - StaticArg.prototype.valueSyntax = function valueSyntax() { - return Value.build(this.value); - }; + isMethod: false + }, _ClassMixinProps[_emberUtils.NAME_KEY] = null, _ClassMixinProps[_emberUtils.GUID_KEY] = null, _ClassMixinProps.extend = function () { + var Class = makeCtor(); + var proto = undefined; + Class.ClassMixin = _emberMetal.Mixin.create(this.ClassMixin); + Class.PrototypeMixin = _emberMetal.Mixin.create(this.PrototypeMixin); - return StaticArg; - })(_glimmerRuntimeLibSyntax.Argument); + Class.ClassMixin.ownerConstructor = Class; + Class.PrototypeMixin.ownerConstructor = Class; - exports.StaticArg = StaticArg; + reopen.apply(Class.PrototypeMixin, arguments); - var DynamicArg = (function (_ArgumentSyntax2) { - babelHelpers.inherits(DynamicArg, _ArgumentSyntax2); + Class.superclass = this; + Class.__super__ = this.prototype; - function DynamicArg(name, value) { - var namespace = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; + proto = Class.prototype = Object.create(this.prototype); + proto.constructor = Class; + _emberUtils.generateGuid(proto); + _emberMetal.meta(proto).proto = proto; // this will disable observers on prototype - _ArgumentSyntax2.call(this); - this.name = name; - this.value = value; - this.namespace = namespace; - this.type = 'dynamic-arg'; - } + Class.ClassMixin.apply(Class); + return Class; + }, _ClassMixinProps.create = function () { + var C = this; - DynamicArg.fromSpec = function fromSpec(sexp) { - var name = sexp[1]; - var value = sexp[2]; + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - return new DynamicArg(name, _glimmerRuntimeLibSyntaxExpressions.default(value)); - }; + if (args.length > 0) { + this._initProperties(args); + } + return new C(); + }, _ClassMixinProps.reopen = function () { + this.willReopen(); + reopen.apply(this.PrototypeMixin, arguments); + return this; + }, _ClassMixinProps.reopenClass = function () { + reopen.apply(this.ClassMixin, arguments); + applyMixin(this, arguments, false); + return this; + }, _ClassMixinProps.detect = function (obj) { + if ('function' !== typeof obj) { + return false; + } + while (obj) { + if (obj === this) { + return true; + } + obj = obj.superclass; + } + return false; + }, _ClassMixinProps.detectInstance = function (obj) { + return obj instanceof this; + }, _ClassMixinProps.metaForProperty = function (key) { + var proto = this.proto(); + var possibleDesc = proto[key]; + var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; - DynamicArg.build = function build(name, value) { - return new this(name, value); - }; + return desc._meta || {}; + }, _ClassMixinProps._computedProperties = _emberMetal.computed(function () { + hasCachedComputedProperties = true; + var proto = this.proto(); + var property = undefined; + var properties = []; - DynamicArg.prototype.compile = function compile() { - throw new Error('Cannot compile DynamicArg for "' + this.name + '" as it is delegate for ExpressionSyntax.'); - }; + for (var _name in proto) { + property = proto[_name]; - DynamicArg.prototype.valueSyntax = function valueSyntax() { - return this.value; - }; + if (property && property.isDescriptor) { + properties.push({ + name: _name, + meta: property._meta + }); + } + } + return properties; + }).readOnly(), _ClassMixinProps.eachComputedProperty = function (callback, binding) { + var property = undefined; + var empty = {}; - return DynamicArg; - })(_glimmerRuntimeLibSyntax.Argument); + var properties = _emberMetal.get(this, '_computedProperties'); - exports.DynamicArg = DynamicArg; + for (var i = 0; i < properties.length; i++) { + property = properties[i]; + callback.call(binding || this, property.name, property.meta || empty); + } + }, _ClassMixinProps); - var TrustingAttr = (function () { - function TrustingAttr() {} + function injectedPropertyAssertion() {} - TrustingAttr.fromSpec = function fromSpec(sexp) { - var name = sexp[1]; - var value = sexp[2]; - var namespace = sexp[3]; + /** + Returns a hash of property names and container names that injected + properties will lookup on the container lazily. + + @method _lazyInjections + @return {Object} Hash of all lazy injected property keys to container names + @private + */ + ClassMixinProps._lazyInjections = function () { + var injections = {}; + var proto = this.proto(); + var key = undefined; + var desc = undefined; - return new DynamicAttr(name, _glimmerRuntimeLibSyntaxExpressions.default(value), namespace, true); - }; + for (key in proto) { + desc = proto[key]; + if (desc instanceof _emberMetal.InjectedProperty) { + injections[key] = desc.type + ':' + (desc.name || key); + } + } - TrustingAttr.build = function build(name, value, isTrusting) { - var namespace = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3]; + return injections; + }; - return new DynamicAttr(name, value, namespace, isTrusting); - }; + var ClassMixin = _emberMetal.Mixin.create(ClassMixinProps); - TrustingAttr.prototype.compile = function compile() { - throw new Error('Attempting to compile a TrustingAttr which is just a delegate for DynamicAttr.'); - }; + ClassMixin.ownerConstructor = CoreObject; - return TrustingAttr; - })(); + CoreObject.ClassMixin = ClassMixin; - exports.TrustingAttr = TrustingAttr; + ClassMixin.apply(CoreObject); - var StaticAttr = (function (_AttributeSyntax) { - babelHelpers.inherits(StaticAttr, _AttributeSyntax); + CoreObject.reopen({ + didDefineProperty: function (proto, key, value) { + if (hasCachedComputedProperties === false) { + return; + } + if (value instanceof _emberMetal.ComputedProperty) { + var cache = _emberMetal.meta(this.constructor).readableCache(); - function StaticAttr(name, value, namespace) { - _AttributeSyntax.call(this); - this.name = name; - this.value = value; - this.namespace = namespace; - this["e1185d30-7cac-4b12-b26a-35327d905d92"] = true; - this.type = "static-attr"; - this.isTrusting = false; + if (cache && cache._computedProperties !== undefined) { + cache._computedProperties = undefined; } + } + } + }); - StaticAttr.fromSpec = function fromSpec(node) { - var name = node[1]; - var value = node[2]; - var namespace = node[3]; + exports.default = CoreObject; +}); +// Private, and only for didInitAttrs willRecieveAttrs - return new StaticAttr(name, value, namespace); - }; +/** + 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 + the subclass overrides a property with the same name that is defined + in the superclass. However, there are some cases where it is preferable + to build up a property's value by combining the superclass' property + value with the subclass' value. An example of this in use within Ember + is the `classNames` property of `Ember.View`. + Here is some sample code showing the difference between a concatenated + property and a normal one: + ```javascript + const Bar = Ember.Object.extend({ + // Configure which properties to concatenate + concatenatedProperties: ['concatenatedProperty'], + someNonConcatenatedProperty: ['bar'], + concatenatedProperty: ['bar'] + }); + const FooBar = Bar.extend({ + someNonConcatenatedProperty: ['foo'], + concatenatedProperty: ['foo'] + }); + let fooBar = FooBar.create(); + fooBar.get('someNonConcatenatedProperty'); // ['foo'] + fooBar.get('concatenatedProperty'); // ['bar', 'foo'] + ``` + This behavior extends to object creation as well. Continuing the + above example: + ```javascript + let fooBar = FooBar.create({ + someNonConcatenatedProperty: ['baz'], + concatenatedProperty: ['baz'] + }) + fooBar.get('someNonConcatenatedProperty'); // ['baz'] + fooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz'] + ``` + Adding a single property that is not an array will just add it in the array: + ```javascript + let fooBar = FooBar.create({ + concatenatedProperty: 'baz' + }) + view.get('concatenatedProperty'); // ['bar', 'foo', 'baz'] + ``` + Using the `concatenatedProperties` property, we can tell Ember to mix the + content of the properties. + In `Ember.Component` the `classNames`, `classNameBindings` and + `attributeBindings` properties are concatenated. + This feature is available for you to use throughout the Ember object model, + although typical app developers are likely to use it infrequently. Since + it changes expectations about behavior of properties, you should properly + document its usage in each individual concatenated property (to not + mislead your users to think they can override the property in a subclass). + @property concatenatedProperties + @type Array + @default null + @public +*/ - StaticAttr.build = function build(name, value) { - var namespace = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; +/** + Defines the properties that will be merged from the superclass + (instead of overridden). + By default, when you extend an Ember class a property defined in + the subclass overrides a property with the same name that is defined + in the superclass. However, there are some cases where it is preferable + to build up a property's value by merging the superclass property value + with the subclass property's value. An example of this in use within Ember + is the `queryParams` property of routes. + Here is some sample code showing the difference between a merged + property and a normal one: + ```javascript + const Bar = Ember.Object.extend({ + // Configure which properties are to be merged + mergedProperties: ['mergedProperty'], + someNonMergedProperty: { + nonMerged: 'superclass value of nonMerged' + }, + mergedProperty: { + page: {replace: false}, + limit: {replace: true} + } + }); + const FooBar = Bar.extend({ + someNonMergedProperty: { + completelyNonMerged: 'subclass value of nonMerged' + }, + mergedProperty: { + limit: {replace: false} + } + }); + let fooBar = FooBar.create(); + fooBar.get('someNonMergedProperty'); + // => { completelyNonMerged: 'subclass value of nonMerged' } + // + // Note the entire object, including the nonMerged property of + // the superclass object, has been replaced + fooBar.get('mergedProperty'); + // => { + // page: {replace: false}, + // limit: {replace: false} + // } + // + // Note the page remains from the superclass, and the + // `limit` property's value of `false` has been merged from + // the subclass. + ``` + This behavior is not available during object `create` calls. It is only + available at `extend` time. + In `Ember.Route` the `queryParams` property is merged. + This feature is available for you to use throughout the Ember object model, + although typical app developers are likely to use it infrequently. Since + it changes expectations about behavior of properties, you should properly + document its usage in each individual merged property (to not + mislead your users to think they can override the property in a subclass). + @property mergedProperties + @type Array + @default null + @public +*/ - return new this(name, value, namespace); - }; +/** + Destroyed object property flag. + if this property is `true` the observers and bindings were already + removed by the effect of calling the `destroy()` method. + @property isDestroyed + @default false + @public +*/ - StaticAttr.prototype.compile = function compile(compiler) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.StaticAttrOpcode(this.namespace, this.name, this.value)); - }; +/** + Destruction scheduled flag. The `destroy()` method has been called. + The object stays intact until the end of the run loop at which point + the `isDestroyed` flag is set. + @property isDestroying + @default false + @public +*/ - StaticAttr.prototype.valueSyntax = function valueSyntax() { - return Value.build(this.value); - }; +/** + Destroys an object by setting the `isDestroyed` flag and removing its + metadata, which effectively destroys observers and bindings. + If you try to set a property on a destroyed object, an exception will be + raised. + Note that destruction is scheduled for the end of the run loop and does not + happen immediately. It will set an isDestroying flag immediately. + @method destroy + @return {Ember.Object} receiver + @public +*/ - return StaticAttr; - })(_glimmerRuntimeLibSyntax.Attribute); +/** + Override to implement teardown. + @method willDestroy + @public +*/ - exports.StaticAttr = StaticAttr; +/** + Invoked by the run loop to actually destroy the object. This is + scheduled for execution by the `destroy` method. + @private + @method _scheduledDestroy +*/ - var DynamicAttr = (function (_AttributeSyntax2) { - babelHelpers.inherits(DynamicAttr, _AttributeSyntax2); +/** + Returns a string representation which attempts to provide more information + than Javascript's `toString` typically does, in a generic way for all Ember + objects. + ```javascript + const Person = Ember.Object.extend() + person = Person.create() + person.toString() //=> "" + ``` + If the object's class is not defined on an Ember namespace, it will + indicate it is a subclass of the registered superclass: + ```javascript + const Student = Person.extend() + let student = Student.create() + student.toString() //=> "<(subclass of Person):ember1025>" + ``` + If the method `toStringExtension` is defined, its return value will be + included in the output. + ```javascript + const Teacher = Person.extend({ + toStringExtension() { + return this.get('fullName'); + } + }); + teacher = Teacher.create() + teacher.toString(); //=> "" + ``` + @method toString + @return {String} string representation + @public +*/ - function DynamicAttr(name, value, namespace, isTrusting) { - if (namespace === undefined) namespace = undefined; +/** + Creates a new subclass. + ```javascript + const Person = Ember.Object.extend({ + say(thing) { + alert(thing); + } + }); + ``` + This defines a new subclass of Ember.Object: `Person`. It contains one method: `say()`. + You can also create a subclass from any existing class by calling its `extend()` method. + For example, you might want to create a subclass of Ember's built-in `Ember.Component` class: + ```javascript + const PersonComponent = Ember.Component.extend({ + tagName: 'li', + classNameBindings: ['isAdministrator'] + }); + ``` + When defining a subclass, you can override methods but still access the + implementation of your parent class by calling the special `_super()` method: + ```javascript + const Person = Ember.Object.extend({ + say(thing) { + let name = this.get('name'); + alert(`${name} says: ${thing}`); + } + }); + const Soldier = Person.extend({ + say(thing) { + this._super(`${thing}, sir!`); + }, + march(numberOfHours) { + alert(`${this.get('name')} marches for ${numberOfHours} hours.`); + } + }); + let yehuda = Soldier.create({ + name: "Yehuda Katz" + }); + yehuda.say("Yes"); // alerts "Yehuda Katz says: Yes, sir!" + ``` + The `create()` on line #17 creates an *instance* of the `Soldier` class. + The `extend()` on line #8 creates a *subclass* of `Person`. Any instance + of the `Person` class will *not* have the `march()` method. + You can also pass `Mixin` classes to add additional properties to the subclass. + ```javascript + const Person = Ember.Object.extend({ + say(thing) { + alert(`${this.get('name')} says: ${thing}`); + } + }); + const SingingMixin = Mixin.create({ + sing(thing){ + alert(`${this.get('name')} sings: la la la ${thing}`); + } + }); + const BroadwayStar = Person.extend(SingingMixin, { + dance() { + alert(`${this.get('name')} dances: tap tap tap tap `); + } + }); + ``` + The `BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`. + @method extend + @static + @param {Mixin} [mixins]* One or more Mixin classes + @param {Object} [arguments]* Object containing values to use within the new class + @public +*/ - _AttributeSyntax2.call(this); - this.name = name; - this.value = value; - this.namespace = namespace; - this.isTrusting = isTrusting; - this["e1185d30-7cac-4b12-b26a-35327d905d92"] = true; - this.type = "dynamic-attr"; - } +/** + Creates an instance of a class. Accepts either no arguments, or an object + containing values to initialize the newly instantiated object with. + ```javascript + const Person = Ember.Object.extend({ + helloWorld() { + alert(`Hi, my name is ${this.get('name')}`); + } + }); + let tom = Person.create({ + name: 'Tom Dale' + }); + tom.helloWorld(); // alerts "Hi, my name is Tom Dale". + ``` + `create` will call the `init` function if defined during + `Ember.AnyObject.extend` + If no arguments are passed to `create`, it will not set values to the new + instance during initialization: + ```javascript + let noName = Person.create(); + noName.helloWorld(); // alerts undefined + ``` + NOTE: For performance reasons, you cannot declare methods or computed + properties during `create`. You should instead declare methods and computed + properties when using `extend`. + @method create + @static + @param [arguments]* + @public +*/ - DynamicAttr.fromSpec = function fromSpec(sexp) { - var name = sexp[1]; - var value = sexp[2]; - var namespace = sexp[3]; +/** + Augments a constructor's prototype with additional + properties and functions: + ```javascript + const MyObject = Ember.Object.extend({ + name: 'an object' + }); + o = MyObject.create(); + o.get('name'); // 'an object' + MyObject.reopen({ + say(msg){ + console.log(msg); + } + }) + o2 = MyObject.create(); + o2.say("hello"); // logs "hello" + o.say("goodbye"); // logs "goodbye" + ``` + To add functions and properties to the constructor itself, + see `reopenClass` + @method reopen + @public +*/ - return new DynamicAttr(name, _glimmerRuntimeLibSyntaxExpressions.default(value), namespace); - }; +/** + Augments a constructor's own properties and functions: + ```javascript + const MyObject = Ember.Object.extend({ + name: 'an object' + }); + MyObject.reopenClass({ + canBuild: false + }); + MyObject.canBuild; // false + o = MyObject.create(); + ``` + In other words, this creates static properties and functions for the class. + These are only available on the class and not on any instance of that class. + ```javascript + const Person = Ember.Object.extend({ + name: "", + sayHello() { + alert("Hello. My name is " + this.get('name')); + } + }); + Person.reopenClass({ + species: "Homo sapiens", + createPerson(newPersonsName){ + return Person.create({ + name:newPersonsName + }); + } + }); + let tom = Person.create({ + name: "Tom Dale" + }); + let yehuda = Person.createPerson("Yehuda Katz"); + tom.sayHello(); // "Hello. My name is Tom Dale" + yehuda.sayHello(); // "Hello. My name is Yehuda Katz" + alert(Person.species); // "Homo sapiens" + ``` + Note that `species` and `createPerson` are *not* valid on the `tom` and `yehuda` + variables. They are only valid on `Person`. + To add functions and properties to instances of + a constructor by extending the constructor's prototype + see `reopen` + @method reopenClass + @public +*/ - DynamicAttr.build = function build(name, value) { - var isTrusting = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2]; - var namespace = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3]; +/** + In some cases, you may want to annotate computed properties with additional + metadata about how they function or what values they operate on. For + example, computed property functions may close over variables that are then + no longer available for introspection. + You can pass a hash of these values to a computed property like this: + ```javascript + person: Ember.computed(function() { + let personId = this.get('personId'); + return Person.create({ id: personId }); + }).meta({ type: Person }) + ``` + Once you've done this, you can retrieve the values saved to the computed + property from your class like this: + ```javascript + MyClass.metaForProperty('person'); + ``` + This will return the original hash that was passed to `meta()`. + @static + @method metaForProperty + @param key {String} property name + @private +*/ - return new this(name, value, namespace, isTrusting); - }; +/** + Iterate over each computed property for the class, passing its name + and any associated metadata (see `metaForProperty`) to the callback. + @static + @method eachComputedProperty + @param {Function} callback + @param {Object} binding + @private +*/ - DynamicAttr.prototype.compile = function compile(compiler, env, symbolTable) { - var namespace = this.namespace; - var value = this.value; +/** + Provides lookup-time type validation for injected properties. + @private + @method _onLookup +*/ +enifed('ember-runtime/system/each_proxy', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/mixins/array'], function (exports, _emberUtils, _emberMetal, _emberRuntimeMixinsArray) { + 'use strict'; - compiler.append(new _glimmerRuntimeLibCompiledOpcodesVm.PutValueOpcode(value.compile(compiler, env, symbolTable))); - if (namespace) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.DynamicAttrNSOpcode(this.name, this.namespace, this.isTrusting)); - } else { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.DynamicAttrOpcode(this.name, this.isTrusting)); - } - }; + exports.default = EachProxy; - DynamicAttr.prototype.valueSyntax = function valueSyntax() { - return this.value; - }; + /** + 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 + */ - return DynamicAttr; - })(_glimmerRuntimeLibSyntax.Attribute); + function EachProxy(content) { + this._content = content; + this._keys = undefined; + this.__ember_meta__ = null; + } - exports.DynamicAttr = DynamicAttr; + EachProxy.prototype = { + __defineNonEnumerable: function (property) { + this[property.name] = property.descriptor.value; + }, - var FlushElement = (function (_StatementSyntax4) { - babelHelpers.inherits(FlushElement, _StatementSyntax4); + // .......................................................... + // ARRAY CHANGES + // Invokes whenever the content array itself changes. - function FlushElement() { - _StatementSyntax4.apply(this, arguments); - this.type = "flush-element"; + arrayWillChange: function (content, idx, removedCnt, addedCnt) { + var keys = this._keys; + var lim = removedCnt > 0 ? idx + removedCnt : -1; + for (var key in keys) { + if (lim > 0) { + removeObserverForContentKey(content, key, this, idx, lim); } + _emberMetal.propertyWillChange(this, key); + } + }, - FlushElement.fromSpec = function fromSpec() { - return new FlushElement(); - }; - - FlushElement.build = function build() { - return new this(); - }; - - FlushElement.prototype.compile = function compile(compiler) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.FlushElementOpcode()); - }; - - return FlushElement; - })(_glimmerRuntimeLibSyntax.Statement); - - exports.FlushElement = FlushElement; - - var CloseElement = (function (_StatementSyntax5) { - babelHelpers.inherits(CloseElement, _StatementSyntax5); - - function CloseElement() { - _StatementSyntax5.apply(this, arguments); - this.type = "close-element"; + arrayDidChange: function (content, idx, removedCnt, addedCnt) { + var keys = this._keys; + var lim = addedCnt > 0 ? idx + addedCnt : -1; + for (var key in keys) { + if (lim > 0) { + addObserverForContentKey(content, key, this, idx, lim); } + _emberMetal.propertyDidChange(this, key); + } + }, - CloseElement.fromSpec = function fromSpec() { - return new CloseElement(); - }; - - CloseElement.build = function build() { - return new this(); - }; - - CloseElement.prototype.compile = function compile(compiler) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.CloseElementOpcode()); - }; + // .......................................................... + // LISTEN FOR NEW OBSERVERS AND OTHER EVENT LISTENERS + // Start monitoring keys based on who is listening... - return CloseElement; - })(_glimmerRuntimeLibSyntax.Statement); + willWatchProperty: function (property) { + this.beginObservingContentKey(property); + }, - exports.CloseElement = CloseElement; + didUnwatchProperty: function (property) { + this.stopObservingContentKey(property); + }, - var Text = (function (_StatementSyntax6) { - babelHelpers.inherits(Text, _StatementSyntax6); + // .......................................................... + // CONTENT KEY OBSERVING + // Actual watch keys on the source content. - function Text(content) { - _StatementSyntax6.call(this); - this.content = content; - this.type = "text"; - } + beginObservingContentKey: function (keyName) { + var keys = this._keys; + if (!keys) { + keys = this._keys = new _emberUtils.EmptyObject(); + } - Text.fromSpec = function fromSpec(node) { - var content = node[1]; + if (!keys[keyName]) { + keys[keyName] = 1; + var content = this._content; + var len = _emberMetal.get(content, 'length'); - return new Text(content); - }; + addObserverForContentKey(content, keyName, this, 0, len); + } else { + keys[keyName]++; + } + }, - Text.build = function build(content) { - return new this(content); - }; + stopObservingContentKey: function (keyName) { + var keys = this._keys; + if (keys && keys[keyName] > 0 && --keys[keyName] <= 0) { + var content = this._content; + var len = _emberMetal.get(content, 'length'); - Text.prototype.compile = function compile(dsl) { - dsl.text(this.content); - }; + removeObserverForContentKey(content, keyName, this, 0, len); + } + }, - return Text; - })(_glimmerRuntimeLibSyntax.Statement); + contentKeyWillChange: function (obj, keyName) { + _emberMetal.propertyWillChange(this, keyName); + }, - exports.Text = Text; + contentKeyDidChange: function (obj, keyName) { + _emberMetal.propertyDidChange(this, keyName); + } + }; - var Comment = (function (_StatementSyntax7) { - babelHelpers.inherits(Comment, _StatementSyntax7); + function addObserverForContentKey(content, keyName, proxy, idx, loc) { + while (--loc >= idx) { + var item = _emberRuntimeMixinsArray.objectAt(content, loc); + if (item) { + _emberMetal._addBeforeObserver(item, keyName, proxy, 'contentKeyWillChange'); + _emberMetal.addObserver(item, keyName, proxy, 'contentKeyDidChange'); + } + } + } - function Comment(comment) { - _StatementSyntax7.call(this); - this.comment = comment; - this.type = "comment"; - } + function removeObserverForContentKey(content, keyName, proxy, idx, loc) { + while (--loc >= idx) { + var item = _emberRuntimeMixinsArray.objectAt(content, loc); + if (item) { + _emberMetal._removeBeforeObserver(item, keyName, proxy, 'contentKeyWillChange'); + _emberMetal.removeObserver(item, keyName, proxy, 'contentKeyDidChange'); + } + } + } +}); +enifed('ember-runtime/system/lazy_load', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { + /*globals CustomEvent */ - Comment.fromSpec = function fromSpec(sexp) { - var value = sexp[1]; + 'use strict'; - return new Comment(value); - }; + exports.onLoad = onLoad; + exports.runLoadHooks = runLoadHooks; - Comment.build = function build(value) { - return new this(value); - }; + /** + @module ember + @submodule ember-runtime + */ - Comment.prototype.compile = function compile(dsl) { - dsl.comment(this.comment); - }; + var loadHooks = _emberEnvironment.ENV.EMBER_LOAD_HOOKS || {}; + var loaded = {}; + var _loaded = loaded; - return Comment; - })(_glimmerRuntimeLibSyntax.Statement); + 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 + resolved from a string into the object: + + ``` javascript + Ember.onLoad('Ember.Application' function(hbars) { + hbars.registerHelper(...); + }); + ``` + + @method onLoad + @for Ember + @param name {String} name of hook + @param callback {Function} callback to be called + @private + */ - exports.Comment = Comment; + function onLoad(name, callback) { + var object = loaded[name]; - var OpenElement = (function (_StatementSyntax8) { - babelHelpers.inherits(OpenElement, _StatementSyntax8); + loadHooks[name] = loadHooks[name] || []; + loadHooks[name].push(callback); - function OpenElement(tag, blockParams, symbolTable) { - _StatementSyntax8.call(this); - this.tag = tag; - this.blockParams = blockParams; - this.symbolTable = symbolTable; - this.type = "open-element"; - } + if (object) { + callback(object); + } + } - OpenElement.fromSpec = function fromSpec(sexp, symbolTable) { - var tag = sexp[1]; - var blockParams = sexp[2]; + /** + Called when an Ember.js package (e.g Ember.Application) has finished + loading. Triggers any callbacks registered for this event. + + @method runLoadHooks + @for Ember + @param name {String} name of hook + @param object {Object} object to pass to callbacks + @private + */ - return new OpenElement(tag, blockParams, symbolTable); - }; + function runLoadHooks(name, object) { + loaded[name] = object; + var window = _emberEnvironment.environment.window; - OpenElement.build = function build(tag, blockParams, symbolTable) { - return new this(tag, blockParams, symbolTable); - }; + if (window && typeof CustomEvent === 'function') { + var _event = new CustomEvent(name, { detail: object, name: name }); + window.dispatchEvent(_event); + } - OpenElement.prototype.scan = function scan(scanner) { - var tag = this.tag; + if (loadHooks[name]) { + loadHooks[name].forEach(function (callback) { + return callback(object); + }); + } + } +}); +enifed('ember-runtime/system/namespace', ['exports', 'ember-utils', 'ember-metal', 'ember-environment', 'ember-runtime/system/object'], function (exports, _emberUtils, _emberMetal, _emberEnvironment, _emberRuntimeSystemObject) { + /** + @module ember + @submodule ember-runtime + */ + 'use strict'; - if (scanner.env.hasComponentDefinition([tag], this.symbolTable)) { - var _parameters = this.parameters(scanner); + exports.isSearchDisabled = isSearchDisabled; + exports.setSearchDisabled = setSearchDisabled; - var args = _parameters.args; - var attrs = _parameters.attrs; + var searchDisabled = false; - scanner.startBlock(this.blockParams); - this.tagContents(scanner); - var template = scanner.endBlock(this.blockParams); - args.blocks = Blocks.fromSpec(template); - return new Component(tag, attrs, args); - } else { - return new OpenPrimitiveElement(tag); - } - }; + function isSearchDisabled() { + return searchDisabled; + } - OpenElement.prototype.compile = function compile(list, env) { - list.append(new _glimmerRuntimeLibCompiledOpcodesDom.OpenPrimitiveElementOpcode(this.tag)); - }; + function setSearchDisabled(flag) { + searchDisabled = !!flag; + } - OpenElement.prototype.toIdentity = function toIdentity() { - var tag = this.tag; + /** + 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. + + # Example Usage + + ```javascript + MyFramework = Ember.Namespace.create({ + VERSION: '1.0.0' + }); + ``` + + @class Namespace + @namespace Ember + @extends Ember.Object + @public + */ + var Namespace = _emberRuntimeSystemObject.default.extend({ + isNamespace: true, - return new OpenPrimitiveElement(tag); - }; + init: function () { + Namespace.NAMESPACES.push(this); + Namespace.PROCESSED = false; + }, - OpenElement.prototype.parameters = function parameters(scanner) { - var current = scanner.next(); - var attrs = []; - var argKeys = []; - var argValues = []; - while (!(current instanceof FlushElement)) { - if (current[MODIFIER_SYNTAX]) { - throw new Error('Compile Error: Element modifiers are not allowed in components'); - } - var param = current; - if (current[_glimmerRuntimeLibSyntax.ATTRIBUTE]) { - attrs.push(param.name); - // REMOVE ME: attributes should not be treated as args - argKeys.push(param.name); - argValues.push(param.valueSyntax()); - } else if (current[_glimmerRuntimeLibSyntax.ARGUMENT]) { - argKeys.push(param.name); - argValues.push(param.valueSyntax()); - } else { - throw new Error("Expected FlushElement, but got ${current}"); - } - current = scanner.next(); - } - return { args: Args.fromNamedArgs(NamedArgs.build(argKeys, argValues)), attrs: attrs }; - }; + toString: function () { + var name = _emberMetal.get(this, 'name') || _emberMetal.get(this, 'modulePrefix'); + if (name) { + return name; + } - OpenElement.prototype.tagContents = function tagContents(scanner) { - var nesting = 1; - while (true) { - var current = scanner.next(); - if (current instanceof CloseElement && --nesting === 0) { - break; - } - scanner.addStatement(current); - if (current instanceof OpenElement || current instanceof OpenPrimitiveElement) { - nesting++; - } - } - }; + findNamespaces(); + return this[_emberUtils.NAME_KEY]; + }, - return OpenElement; - })(_glimmerRuntimeLibSyntax.Statement); + nameClasses: function () { + processNamespace([this.toString()], this, {}); + }, - exports.OpenElement = OpenElement; + destroy: function () { + var namespaces = Namespace.NAMESPACES; + var toString = this.toString(); - var Component = (function (_StatementSyntax9) { - babelHelpers.inherits(Component, _StatementSyntax9); + if (toString) { + _emberEnvironment.context.lookup[toString] = undefined; + delete Namespace.NAMESPACES_BY_ID[toString]; + } + namespaces.splice(namespaces.indexOf(this), 1); + this._super.apply(this, arguments); + } + }); - function Component(tag, attrs, args) { - _StatementSyntax9.call(this); - this.tag = tag; - this.attrs = attrs; - this.args = args; - this.type = 'component'; - } - - Component.prototype.compile = function compile(list, env, symbolTable) { - var definition = env.getComponentDefinition([this.tag], symbolTable); - var args = this.args.compile(list, env, symbolTable); - var shadow = this.attrs; - list.append(new _glimmerRuntimeLibCompiledOpcodesComponent.PutComponentDefinitionOpcode(definition)); - list.append(new _glimmerRuntimeLibCompiledOpcodesComponent.OpenComponentOpcode(args, shadow)); - list.append(new _glimmerRuntimeLibCompiledOpcodesComponent.CloseComponentOpcode()); - }; + Namespace.reopenClass({ + NAMESPACES: [_emberMetal.default], + NAMESPACES_BY_ID: { + Ember: _emberMetal.default + }, + PROCESSED: false, + processAll: processAllNamespaces, + byName: function (name) { + if (!searchDisabled) { + processAllNamespaces(); + } - return Component; - })(_glimmerRuntimeLibSyntax.Statement); + return NAMESPACES_BY_ID[name]; + } + }); - exports.Component = Component; + var NAMESPACES_BY_ID = Namespace.NAMESPACES_BY_ID; - var OpenPrimitiveElement = (function (_StatementSyntax10) { - babelHelpers.inherits(OpenPrimitiveElement, _StatementSyntax10); + var hasOwnProp = ({}).hasOwnProperty; - function OpenPrimitiveElement(tag) { - _StatementSyntax10.call(this); - this.tag = tag; - this.type = "open-primitive-element"; - } + function processNamespace(paths, root, seen) { + var idx = paths.length; - OpenPrimitiveElement.build = function build(tag) { - return new this(tag); - }; + NAMESPACES_BY_ID[paths.join('.')] = root; - OpenPrimitiveElement.prototype.compile = function compile(compiler) { - compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.OpenPrimitiveElementOpcode(this.tag)); - }; + // Loop over all of the keys in the namespace, looking for classes + for (var key in root) { + if (!hasOwnProp.call(root, key)) { + continue; + } + var obj = root[key]; - return OpenPrimitiveElement; - })(_glimmerRuntimeLibSyntax.Statement); + // If we are processing the `Ember` namespace, for example, the + // `paths` will start with `["Ember"]`. Every iteration through + // the loop will update the **second** element of this list with + // the key, so processing `Ember.View` will make the Array + // `['Ember', 'View']`. + paths[idx] = key; - exports.OpenPrimitiveElement = OpenPrimitiveElement; + // If we have found an unprocessed class + if (obj && obj.toString === classToString && !obj[_emberUtils.NAME_KEY]) { + // Replace the class' `toString` with the dot-separated path + // and set its `NAME_KEY` + obj[_emberUtils.NAME_KEY] = paths.join('.'); - var Yield = (function (_StatementSyntax11) { - babelHelpers.inherits(Yield, _StatementSyntax11); + // Support nested namespaces + } else if (obj && obj.isNamespace) { + // Skip aliased namespaces + if (seen[_emberUtils.guidFor(obj)]) { + continue; + } + seen[_emberUtils.guidFor(obj)] = true; - function Yield(to, args) { - _StatementSyntax11.call(this); - this.to = to; - this.args = args; - this.type = "yield"; + // Process the child namespace + processNamespace(paths, obj, seen); } + } - Yield.fromSpec = function fromSpec(sexp) { - var to = sexp[1]; - var params = sexp[2]; + paths.length = idx; // cut out last item + } - var args = Args.fromSpec(params, null, EMPTY_BLOCKS); - return new Yield(to, args); - }; + function isUppercase(code) { + return code >= 65 && // A + code <= 90; // Z + } - Yield.build = function build(params, to) { - var args = Args.fromPositionalArgs(PositionalArgs.build(params)); - return new this(to, args); - }; + function tryIsNamespace(lookup, prop) { + try { + var obj = lookup[prop]; + return obj && obj.isNamespace && obj; + } catch (e) { + // continue + } + } - Yield.prototype.compile = function compile(dsl, env, symbolTable) { - var to = this.to; - - var args = this.args.compile(dsl, env, symbolTable); - if (dsl.hasBlockSymbol(to)) { - var symbol = dsl.getBlockSymbol(to); - var inner = new _glimmerRuntimeLibCompiledExpressionsHasBlock.CompiledGetBlockBySymbol(symbol, to); - dsl.append(new OpenBlockOpcode(inner, args)); - dsl.append(new CloseBlockOpcode()); - } else if (dsl.hasPartialArgsSymbol()) { - var symbol = dsl.getPartialArgsSymbol(); - var inner = new _glimmerRuntimeLibCompiledExpressionsHasBlock.CompiledInPartialGetBlock(symbol, to); - dsl.append(new OpenBlockOpcode(inner, args)); - dsl.append(new CloseBlockOpcode()); - } else { - throw new Error('[BUG] ${to} is not a valid block name.'); - } - }; + function findNamespaces() { + if (Namespace.PROCESSED) { + return; + } + var lookup = _emberEnvironment.context.lookup; + var keys = Object.keys(lookup); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + // Only process entities that start with uppercase A-Z + if (!isUppercase(key.charCodeAt(0))) { + continue; + } + var obj = tryIsNamespace(lookup, key); + if (obj) { + obj[_emberUtils.NAME_KEY] = key; + } + } + } - return Yield; - })(_glimmerRuntimeLibSyntax.Statement); + function superClassString(mixin) { + var superclass = mixin.superclass; + if (superclass) { + if (superclass[_emberUtils.NAME_KEY]) { + return superclass[_emberUtils.NAME_KEY]; + } + return superClassString(superclass); + } + } - exports.Yield = Yield; + function calculateToString(target) { + var str = undefined; - function isStaticPartialName(exp) { - return exp.type === 'value'; + if (!searchDisabled) { + processAllNamespaces(); + // can also be set by processAllNamespaces + str = target[_emberUtils.NAME_KEY]; + if (str) { + return str; + } else { + str = superClassString(target); + str = str ? '(subclass of ' + str + ')' : str; + } } + if (str) { + return str; + } else { + return '(unknown mixin)'; + } + } - var Partial = (function (_StatementSyntax12) { - babelHelpers.inherits(Partial, _StatementSyntax12); - - function Partial() { - _StatementSyntax12.apply(this, arguments); - } + function classToString() { + var name = this[_emberUtils.NAME_KEY]; + if (name) { + return name; + } - Partial.fromSpec = function fromSpec(sexp) { - var exp = sexp[1]; + return this[_emberUtils.NAME_KEY] = calculateToString(this); + } - var name = _glimmerRuntimeLibSyntaxExpressions.default(exp); - if (isStaticPartialName(name)) { - return new _glimmerRuntimeLibSyntaxBuiltinsPartial.StaticPartialSyntax(name); - } else { - return new _glimmerRuntimeLibSyntaxBuiltinsPartial.DynamicPartialSyntax(name); - } - }; + function processAllNamespaces() { + var unprocessedNamespaces = !Namespace.PROCESSED; + var unprocessedMixins = _emberMetal.hasUnprocessedMixins(); - return Partial; - })(_glimmerRuntimeLibSyntax.Statement); + if (unprocessedNamespaces) { + findNamespaces(); + Namespace.PROCESSED = true; + } - exports.Partial = Partial; + if (unprocessedNamespaces || unprocessedMixins) { + var namespaces = Namespace.NAMESPACES; + var namespace = undefined; - var OpenBlockOpcode = (function (_Opcode) { - babelHelpers.inherits(OpenBlockOpcode, _Opcode); + for (var i = 0; i < namespaces.length; i++) { + namespace = namespaces[i]; + processNamespace([namespace.toString()], namespace, {}); + } - function OpenBlockOpcode(inner, args) { - _Opcode.call(this); - this.inner = inner; - this.args = args; - this.type = "open-block"; - } + _emberMetal.clearUnprocessedMixins(); + } + } - OpenBlockOpcode.prototype.evaluate = function evaluate(vm) { - var block = this.inner.evaluate(vm); - var args = undefined; - if (block) { - args = this.args.evaluate(vm); - } - // FIXME: can we avoid doing this when we don't have a block? - vm.pushCallerScope(); - if (block) { - vm.invokeBlock(block, args); - } - }; + _emberMetal.Mixin.prototype.toString = classToString; // ES6TODO: altering imported objects. SBB. - OpenBlockOpcode.prototype.toJSON = function toJSON() { - return { - guid: this._guid, - type: this.type, - details: { - "block": this.inner.toJSON(), - "positional": this.args.positional.toJSON(), - "named": this.args.named.toJSON() - } - }; - }; + exports.default = Namespace; +}); +// Preloaded into namespaces +enifed('ember-runtime/system/native_array', ['exports', 'ember-metal', 'ember-environment', '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, _emberMetal, _emberEnvironment, _emberRuntimeMixinsArray, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsObservable, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsFreezable, _emberRuntimeCopy) { + /** + @module ember + @submodule ember-runtime + */ + 'use strict'; - return OpenBlockOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + var _NativeArray; - var CloseBlockOpcode = (function (_Opcode2) { - babelHelpers.inherits(CloseBlockOpcode, _Opcode2); + // 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. - function CloseBlockOpcode() { - _Opcode2.apply(this, arguments); - this.type = "close-block"; - } + /** + The NativeArray mixin contains the properties needed to make the native + Array support Ember.MutableArray and all of its dependent APIs. Unless you + have `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Array` set to + false, this will be applied automatically. Otherwise you can apply the mixin + at anytime by calling `Ember.NativeArray.apply(Array.prototype)`. + + @class NativeArray + @namespace Ember + @uses Ember.MutableArray + @uses Ember.Observable + @uses Ember.Copyable + @public + */ + var NativeArray = _emberMetal.Mixin.create(_emberRuntimeMixinsMutable_array.default, _emberRuntimeMixinsObservable.default, _emberRuntimeMixinsCopyable.default, { - CloseBlockOpcode.prototype.evaluate = function evaluate(vm) { - vm.popScope(); - }; + // because length is a built-in property we need to know to just get the + // original property. + get: function (key) { + if ('number' === typeof key) { + return this[key]; + } else { + return this._super(key); + } + }, - return CloseBlockOpcode; - })(_glimmerRuntimeLibOpcodes.Opcode); + objectAt: function (idx) { + return this[idx]; + }, - exports.CloseBlockOpcode = CloseBlockOpcode; + // primitive for array support. + replace: function (idx, amt, objects) { + if (this.isFrozen) { + throw _emberRuntimeMixinsFreezable.FROZEN_ERROR; + } - var Value = (function (_ExpressionSyntax) { - babelHelpers.inherits(Value, _ExpressionSyntax); + // if we replaced exactly the same number of items, then pass only the + // replaced range. Otherwise, pass the full remaining array length + // since everything has shifted + var len = objects ? _emberMetal.get(objects, 'length') : 0; + _emberRuntimeMixinsArray.arrayContentWillChange(this, idx, amt, len); - function Value(value) { - _ExpressionSyntax.call(this); - this.value = value; - this.type = "value"; - } + if (len === 0) { + this.splice(idx, amt); + } else { + _emberMetal.replace(this, idx, amt, objects); + } - Value.fromSpec = function fromSpec(value) { - return new Value(value); - }; + _emberRuntimeMixinsArray.arrayContentDidChange(this, idx, amt, len); + return this; + }, - Value.build = function build(value) { - return new this(value); - }; + // If you ask for an unknown property, then try to collect the value + // from member items. + unknownProperty: function (key, value) { + var ret = undefined; // = this.reducedProperty(key, value); + if (value !== undefined && ret === undefined) { + ret = this[key] = value; + } + return ret; + }, - Value.prototype.inner = function inner() { - return this.value; - }; + indexOf: Array.prototype.indexOf, + lastIndexOf: Array.prototype.lastIndexOf, - Value.prototype.compile = function compile(compiler) { - return new _glimmerRuntimeLibCompiledExpressionsValue.default(this.value); - }; + copy: function (deep) { + if (deep) { + return this.map(function (item) { + return _emberRuntimeCopy.default(item, true); + }); + } - return Value; - })(_glimmerRuntimeLibSyntax.Expression); + return this.slice(); + } + }); - exports.Value = Value; + // Remove any methods implemented natively so we don't override them + var ignore = ['length']; + NativeArray.keys().forEach(function (methodName) { + if (Array.prototype[methodName]) { + ignore.push(methodName); + } + }); - var GetArgument = (function (_ExpressionSyntax2) { - babelHelpers.inherits(GetArgument, _ExpressionSyntax2); + exports.NativeArray // TODO: only use default export + = NativeArray = (_NativeArray = NativeArray).without.apply(_NativeArray, ignore); - function GetArgument(parts) { - _ExpressionSyntax2.call(this); - this.parts = parts; - this.type = "get-argument"; + /** + Creates an `Ember.NativeArray` from an Array like object. + Does not modify the original object. Ember.A is not needed if + `EmberENV.EXTEND_PROTOTYPES` is `true` (the default value). However, + it is recommended that you use Ember.A when creating addons for + ember or when you can not guarantee that `EmberENV.EXTEND_PROTOTYPES` + will be `true`. + + Example + + ```js + export default Ember.Component.extend({ + tagName: 'ul', + classNames: ['pagination'], + + init() { + this._super(...arguments); + + if (!this.get('content')) { + this.set('content', Ember.A()); } + } + }); + ``` + + @method A + @for Ember + @return {Ember.NativeArray} + @public + */ + var A = undefined; - // this is separated out from Get because Unknown also has a ref, but it - // may turn out to be a helper - - GetArgument.fromSpec = function fromSpec(sexp) { - var parts = sexp[1]; - - return new GetArgument(parts); - }; + if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.Array) { + NativeArray.apply(Array.prototype); + exports.A = A = function (arr) { + return arr || []; + }; + } else { + exports.A = A = function (arr) { + if (!arr) { + arr = []; + } + return _emberRuntimeMixinsArray.default.detect(arr) ? arr : NativeArray.apply(arr); + }; + } - GetArgument.build = function build(path) { - return new this(path.split('.')); - }; + _emberMetal.default.A = A; + exports.A = A; + exports.NativeArray = NativeArray; + exports.default = NativeArray; +}); +// Ember.A circular +enifed('ember-runtime/system/object', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime/system/core_object', 'ember-runtime/mixins/observable'], function (exports, _emberUtils, _emberMetal, _emberRuntimeSystemCore_object, _emberRuntimeMixinsObservable) { + /** + @module ember + @submodule ember-runtime + */ - GetArgument.prototype.compile = function compile(lookup) { - var parts = this.parts; - - var head = parts[0]; - if (lookup.hasNamedSymbol(head)) { - var symbol = lookup.getNamedSymbol(head); - var path = parts.slice(1); - var inner = new _glimmerRuntimeLibCompiledExpressionsLookups.CompiledSymbol(symbol, head); - return _glimmerRuntimeLibCompiledExpressionsLookups.default.create(inner, path); - } else if (lookup.hasPartialArgsSymbol()) { - var symbol = lookup.getPartialArgsSymbol(); - var path = parts.slice(1); - var inner = new _glimmerRuntimeLibCompiledExpressionsLookups.CompiledInPartialName(symbol, head); - return _glimmerRuntimeLibCompiledExpressionsLookups.default.create(inner, path); - } else { - throw new Error('[BUG] @' + this.parts.join('.') + ' is not a valid lookup path.'); - } - }; + 'use strict'; - return GetArgument; - })(_glimmerRuntimeLibSyntax.Expression); + /** + `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. + + @class Object + @namespace Ember + @extends Ember.CoreObject + @uses Ember.Observable + @public + */ + var EmberObject = _emberRuntimeSystemCore_object.default.extend(_emberRuntimeMixinsObservable.default); + EmberObject.toString = function () { + return 'Ember.Object'; + }; - exports.GetArgument = GetArgument; + var FrameworkObject = EmberObject; - var Ref = (function (_ExpressionSyntax3) { - babelHelpers.inherits(Ref, _ExpressionSyntax3); + exports.FrameworkObject = FrameworkObject; + exports.default = EmberObject; +}); +enifed('ember-runtime/system/object_proxy', ['exports', 'ember-runtime/system/object', 'ember-runtime/mixins/-proxy'], function (exports, _emberRuntimeSystemObject, _emberRuntimeMixinsProxy) { + 'use strict'; - function Ref(parts) { - _ExpressionSyntax3.call(this); - this.parts = parts; - this.type = "ref"; + /** + `Ember.ObjectProxy` forwards all properties not defined by the proxy itself + to a proxied `content` object. + + ```javascript + object = Ember.Object.create({ + name: 'Foo' + }); + + proxy = Ember.ObjectProxy.create({ + content: object + }); + + // Access and change existing properties + proxy.get('name') // 'Foo' + proxy.set('name', 'Bar'); + object.get('name') // 'Bar' + + // Create new 'description' property on `object` + proxy.set('description', 'Foo is a whizboo baz'); + object.get('description') // 'Foo is a whizboo baz' + ``` + + While `content` is unset, setting a property to be delegated will throw an + Error. + + ```javascript + proxy = Ember.ObjectProxy.create({ + content: null, + flag: null + }); + proxy.set('flag', true); + proxy.get('flag'); // true + proxy.get('foo'); // undefined + proxy.set('foo', 'data'); // throws Error + ``` + + Delegated properties can be bound to and will change when content is updated. + + Computed properties on the proxy itself can depend on delegated properties. + + ```javascript + ProxyWithComputedProperty = Ember.ObjectProxy.extend({ + fullName: Ember.computed('firstName', 'lastName', function() { + var firstName = this.get('firstName'), + lastName = this.get('lastName'); + if (firstName && lastName) { + return firstName + ' ' + lastName; } + return firstName || lastName; + }) + }); + + proxy = ProxyWithComputedProperty.create(); + + proxy.get('fullName'); // undefined + proxy.set('content', { + firstName: 'Tom', lastName: 'Dale' + }); // triggers property change for fullName on proxy + + proxy.get('fullName'); // 'Tom Dale' + ``` + + @class ObjectProxy + @namespace Ember + @extends Ember.Object + @extends Ember._ProxyMixin + @public + */ - Ref.build = function build(path) { - var parts = path.split('.'); - if (parts[0] === 'this') { - parts[0] = null; - } - return new this(parts); - }; + 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. + + Example: + + ```javascript + App.ApplicationRoute = Ember.Route.extend({ + authManager: Ember.inject.service('auth'), + + model: function() { + return this.get('authManager').findCurrentUser(); + } + }); + ``` + + This example will create an `authManager` property on the application route + that looks up the `auth` service in the container, making it easily + accessible in the `model` hook. + + @method service + @since 1.10.0 + @for Ember.inject + @param {String} name (optional) name of the service to inject, defaults to + the property's name + @return {Ember.InjectedProperty} injection descriptor instance + @public + */ + _emberRuntimeInject.createInjectionHelper('service'); - Ref.prototype.compile = function compile(lookup) { - var parts = this.parts; - - var head = parts[0]; - if (head === null) { - var inner = new _glimmerRuntimeLibCompiledExpressionsLookups.CompiledSelf(); - var path = parts.slice(1); - return _glimmerRuntimeLibCompiledExpressionsLookups.default.create(inner, path); - } else if (lookup.hasLocalSymbol(head)) { - var symbol = lookup.getLocalSymbol(head); - var path = parts.slice(1); - var inner = new _glimmerRuntimeLibCompiledExpressionsLookups.CompiledSymbol(symbol, head); - return _glimmerRuntimeLibCompiledExpressionsLookups.default.create(inner, path); - } else { - var inner = new _glimmerRuntimeLibCompiledExpressionsLookups.CompiledSelf(); - return _glimmerRuntimeLibCompiledExpressionsLookups.default.create(inner, parts); - } - }; + /** + @class Service + @namespace Ember + @extends Ember.Object + @since 1.10.0 + @public + */ + var Service = _emberRuntimeSystemObject.default.extend(); - return Ref; - })(_glimmerRuntimeLibSyntax.Expression); + Service.reopenClass({ + isServiceFactory: true + }); - exports.Ref = Ref; + exports.default = Service; +}); +enifed('ember-runtime/system/string', ['exports', 'ember-metal', 'ember-utils', 'ember-runtime/utils', 'ember-runtime/string_registry'], function (exports, _emberMetal, _emberUtils, _emberRuntimeUtils, _emberRuntimeString_registry) { + /** + @module ember + @submodule ember-runtime + */ + 'use strict'; - var Get = (function (_ExpressionSyntax4) { - babelHelpers.inherits(Get, _ExpressionSyntax4); + var STRING_DASHERIZE_REGEXP = /[ _]/g; - function Get(ref) { - _ExpressionSyntax4.call(this); - this.ref = ref; - this.type = "get"; - } + var STRING_DASHERIZE_CACHE = new _emberMetal.Cache(1000, function (key) { + return decamelize(key).replace(STRING_DASHERIZE_REGEXP, '-'); + }); - Get.fromSpec = function fromSpec(sexp) { - var parts = sexp[1]; + var STRING_CAMELIZE_REGEXP_1 = /(\-|\_|\.|\s)+(.)?/g; + var STRING_CAMELIZE_REGEXP_2 = /(^|\/)([A-Z])/g; - return new this(new Ref(parts)); - }; + var CAMELIZE_CACHE = new _emberMetal.Cache(1000, function (key) { + return key.replace(STRING_CAMELIZE_REGEXP_1, function (match, separator, chr) { + return chr ? chr.toUpperCase() : ''; + }).replace(STRING_CAMELIZE_REGEXP_2, function (match, separator, chr) { + return match.toLowerCase(); + }); + }); - Get.build = function build(path) { - return new this(Ref.build(path)); - }; + var STRING_CLASSIFY_REGEXP_1 = /^(\-|_)+(.)?/; + var STRING_CLASSIFY_REGEXP_2 = /(.)(\-|\_|\.|\s)+(.)?/g; + var STRING_CLASSIFY_REGEXP_3 = /(^|\/|\.)([a-z])/g; - Get.prototype.compile = function compile(compiler) { - return this.ref.compile(compiler); - }; + var CLASSIFY_CACHE = new _emberMetal.Cache(1000, function (str) { + var replace1 = function (match, separator, chr) { + return chr ? '_' + chr.toUpperCase() : ''; + }; + var replace2 = function (match, initialChar, separator, chr) { + return initialChar + (chr ? chr.toUpperCase() : ''); + }; + var parts = str.split('/'); + for (var i = 0; i < parts.length; i++) { + parts[i] = parts[i].replace(STRING_CLASSIFY_REGEXP_1, replace1).replace(STRING_CLASSIFY_REGEXP_2, replace2); + } + return parts.join('/').replace(STRING_CLASSIFY_REGEXP_3, function (match, separator, chr) { + return match.toUpperCase(); + }); + }); - return Get; - })(_glimmerRuntimeLibSyntax.Expression); + var STRING_UNDERSCORE_REGEXP_1 = /([a-z\d])([A-Z]+)/g; + var STRING_UNDERSCORE_REGEXP_2 = /\-|\s+/g; - exports.Get = Get; + var UNDERSCORE_CACHE = new _emberMetal.Cache(1000, function (str) { + return str.replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2').replace(STRING_UNDERSCORE_REGEXP_2, '_').toLowerCase(); + }); - var Unknown = (function (_ExpressionSyntax5) { - babelHelpers.inherits(Unknown, _ExpressionSyntax5); + var STRING_CAPITALIZE_REGEXP = /(^|\/)([a-z])/g; - function Unknown(ref) { - _ExpressionSyntax5.call(this); - this.ref = ref; - this.type = "unknown"; - } + var CAPITALIZE_CACHE = new _emberMetal.Cache(1000, function (str) { + return str.replace(STRING_CAPITALIZE_REGEXP, function (match, separator, chr) { + return match.toUpperCase(); + }); + }); - Unknown.fromSpec = function fromSpec(sexp) { - var path = sexp[1]; + var STRING_DECAMELIZE_REGEXP = /([a-z\d])([A-Z])/g; - return new this(new Ref(path)); - }; + var DECAMELIZE_CACHE = new _emberMetal.Cache(1000, function (str) { + return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase(); + }); - Unknown.build = function build(path) { - return new this(Ref.build(path)); - }; + function _fmt(str, formats) { + var cachedFormats = formats; - Unknown.prototype.compile = function compile(compiler, env, symbolTable) { - var ref = this.ref; + if (!_emberRuntimeUtils.isArray(cachedFormats) || arguments.length > 2) { + cachedFormats = new Array(arguments.length - 1); - if (env.hasHelper(ref.parts, symbolTable)) { - return new _glimmerRuntimeLibCompiledExpressionsHelper.default(ref.parts, env.lookupHelper(ref.parts, symbolTable), _glimmerRuntimeLibCompiledExpressionsArgs.CompiledArgs.empty(), symbolTable); - } else { - return this.ref.compile(compiler); - } - }; + for (var i = 1; i < arguments.length; i++) { + cachedFormats[i - 1] = arguments[i]; + } + } - return Unknown; - })(_glimmerRuntimeLibSyntax.Expression); + // first, replace any ORDERED replacements. + var idx = 0; // the current index for non-numerical replacements + return str.replace(/%@([0-9]+)?/g, function (s, argIndex) { + argIndex = argIndex ? parseInt(argIndex, 10) - 1 : idx++; + s = cachedFormats[argIndex]; + return s === null ? '(null)' : s === undefined ? '' : _emberUtils.inspect(s); + }); + } - exports.Unknown = Unknown; + function fmt(str, formats) { + return _fmt.apply(undefined, arguments); + } - var Helper = (function (_ExpressionSyntax6) { - babelHelpers.inherits(Helper, _ExpressionSyntax6); + function loc(str, formats) { + if (!_emberRuntimeUtils.isArray(formats) || arguments.length > 2) { + formats = Array.prototype.slice.call(arguments, 1); + } - function Helper(ref, args) { - _ExpressionSyntax6.call(this); - this.ref = ref; - this.args = args; - this.type = "helper"; - } + str = _emberRuntimeString_registry.get(str) || str; + return _fmt(str, formats); + } - Helper.fromSpec = function fromSpec(sexp) { - var path = sexp[1]; - var params = sexp[2]; - var hash = sexp[3]; + function w(str) { + return str.split(/\s+/); + } - return new Helper(new Ref(path), Args.fromSpec(params, hash, EMPTY_BLOCKS)); - }; + function decamelize(str) { + return DECAMELIZE_CACHE.get(str); + } - Helper.build = function build(path, positional, named) { - return new this(Ref.build(path), Args.build(positional, named, EMPTY_BLOCKS)); - }; + function dasherize(str) { + return STRING_DASHERIZE_CACHE.get(str); + } - Helper.prototype.compile = function compile(compiler, env, symbolTable) { - if (env.hasHelper(this.ref.parts, symbolTable)) { - var args = this.args; - var ref = this.ref; + function camelize(str) { + return CAMELIZE_CACHE.get(str); + } - return new _glimmerRuntimeLibCompiledExpressionsHelper.default(ref.parts, env.lookupHelper(ref.parts, symbolTable), args.compile(compiler, env, symbolTable), symbolTable); - } else { - throw new Error('Compile Error: ' + this.ref.parts.join('.') + ' is not a helper'); - } - }; + function classify(str) { + return CLASSIFY_CACHE.get(str); + } - return Helper; - })(_glimmerRuntimeLibSyntax.Expression); + function underscore(str) { + return UNDERSCORE_CACHE.get(str); + } - exports.Helper = Helper; + function capitalize(str) { + return CAPITALIZE_CACHE.get(str); + } - var HasBlock = (function (_ExpressionSyntax7) { - babelHelpers.inherits(HasBlock, _ExpressionSyntax7); + /** + Defines string helper methods including string formatting and localization. + Unless `EmberENV.EXTEND_PROTOTYPES.String` is `false` these methods will also be + added to the `String.prototype` as well. + + @class String + @namespace Ember + @static + @public + */ + exports.default = { + /** + Apply formatting options to the string. This will look for occurrences + of "%@" in your string and substitute them with the arguments you pass into + this method. If you want to control the specific order of replacement, + you can add a number after the key as well to indicate which argument + you want to insert. + Ordered insertions are most useful when building loc strings where values + you need to insert may appear in different orders. + ```javascript + "Hello %@ %@".fmt('John', 'Doe'); // "Hello John Doe" + "Hello %@2, %@1".fmt('John', 'Doe'); // "Hello Doe, John" + ``` + @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: http://babeljs.io/docs/learn-es2015/#template-strings + */ + fmt: fmt, - function HasBlock(blockName) { - _ExpressionSyntax7.call(this); - this.blockName = blockName; - this.type = "has-block"; - } + /** + Formats the passed string, but first looks up the string in the localized + strings hash. This is a convenient way to localize text. See + `Ember.String.fmt()` for more information on formatting. + Note that it is traditional but not required to prefix localized string + keys with an underscore or other character so you can easily identify + localized strings. + ```javascript + Ember.STRINGS = { + '_Hello World': 'Bonjour le monde', + '_Hello %@ %@': 'Bonjour %@ %@' + }; + Ember.String.loc("_Hello World"); // 'Bonjour le monde'; + Ember.String.loc("_Hello %@ %@", ["John", "Smith"]); // "Bonjour John Smith"; + ``` + @method loc + @param {String} str The string to format + @param {Array} formats Optional array of parameters to interpolate into string. + @return {String} formatted string + @public + */ + loc: loc, - HasBlock.fromSpec = function fromSpec(sexp) { - var blockName = sexp[1]; + /** + Splits a string into separate units separated by spaces, eliminating any + empty strings in the process. This is a convenience method for split that + is mostly useful when applied to the `String.prototype`. + ```javascript + Ember.String.w("alpha beta gamma").forEach(function(key) { + console.log(key); + }); + // > alpha + // > beta + // > gamma + ``` + @method w + @param {String} str The string to split + @return {Array} array containing the split strings + @public + */ + w: w, - return new HasBlock(blockName); - }; + /** + Converts a camelized string into all lower case separated by underscores. + ```javascript + 'innerHTML'.decamelize(); // 'inner_html' + 'action_name'.decamelize(); // 'action_name' + 'css-class-name'.decamelize(); // 'css-class-name' + 'my favorite items'.decamelize(); // 'my favorite items' + ``` + @method decamelize + @param {String} str The string to decamelize. + @return {String} the decamelized string. + @public + */ + decamelize: decamelize, - HasBlock.build = function build(blockName) { - return new this(blockName); - }; + /** + Replaces underscores, spaces, or camelCase with dashes. + ```javascript + 'innerHTML'.dasherize(); // 'inner-html' + 'action_name'.dasherize(); // 'action-name' + 'css-class-name'.dasherize(); // 'css-class-name' + 'my favorite items'.dasherize(); // 'my-favorite-items' + 'privateDocs/ownerInvoice'.dasherize(); // 'private-docs/owner-invoice' + ``` + @method dasherize + @param {String} str The string to dasherize. + @return {String} the dasherized string. + @public + */ + dasherize: dasherize, - HasBlock.prototype.compile = function compile(compiler, env) { - var blockName = this.blockName; - - if (compiler.hasBlockSymbol(blockName)) { - var symbol = compiler.getBlockSymbol(blockName); - var inner = new _glimmerRuntimeLibCompiledExpressionsHasBlock.CompiledGetBlockBySymbol(symbol, blockName); - return new _glimmerRuntimeLibCompiledExpressionsHasBlock.default(inner); - } else if (compiler.hasPartialArgsSymbol()) { - var symbol = compiler.getPartialArgsSymbol(); - var inner = new _glimmerRuntimeLibCompiledExpressionsHasBlock.CompiledInPartialGetBlock(symbol, blockName); - return new _glimmerRuntimeLibCompiledExpressionsHasBlock.default(inner); - } else { - throw new Error('[BUG] ${blockName} is not a valid block name.'); - } - }; + /** + Returns the lowerCamelCase form of a string. + ```javascript + 'innerHTML'.camelize(); // 'innerHTML' + 'action_name'.camelize(); // 'actionName' + 'css-class-name'.camelize(); // 'cssClassName' + 'my favorite items'.camelize(); // 'myFavoriteItems' + 'My Favorite Items'.camelize(); // 'myFavoriteItems' + 'private-docs/owner-invoice'.camelize(); // 'privateDocs/ownerInvoice' + ``` + @method camelize + @param {String} str The string to camelize. + @return {String} the camelized string. + @public + */ + camelize: camelize, - return HasBlock; - })(_glimmerRuntimeLibSyntax.Expression); + /** + Returns the UpperCamelCase form of a string. + ```javascript + 'innerHTML'.classify(); // 'InnerHTML' + 'action_name'.classify(); // 'ActionName' + 'css-class-name'.classify(); // 'CssClassName' + 'my favorite items'.classify(); // 'MyFavoriteItems' + 'private-docs/owner-invoice'.classify(); // 'PrivateDocs/OwnerInvoice' + ``` + @method classify + @param {String} str the string to classify + @return {String} the classified string + @public + */ + classify: classify, - exports.HasBlock = HasBlock; + /** + More general than decamelize. Returns the lower\_case\_and\_underscored + form of a string. + ```javascript + 'innerHTML'.underscore(); // 'inner_html' + 'action_name'.underscore(); // 'action_name' + 'css-class-name'.underscore(); // 'css_class_name' + 'my favorite items'.underscore(); // 'my_favorite_items' + 'privateDocs/ownerInvoice'.underscore(); // 'private_docs/owner_invoice' + ``` + @method underscore + @param {String} str The string to underscore. + @return {String} the underscored string. + @public + */ + underscore: underscore, - var HasBlockParams = (function (_ExpressionSyntax8) { - babelHelpers.inherits(HasBlockParams, _ExpressionSyntax8); + /** + Returns the Capitalized form of a string + ```javascript + 'innerHTML'.capitalize() // 'InnerHTML' + 'action_name'.capitalize() // 'Action_name' + 'css-class-name'.capitalize() // 'Css-class-name' + 'my favorite items'.capitalize() // 'My favorite items' + 'privateDocs/ownerInvoice'.capitalize(); // 'PrivateDocs/ownerInvoice' + ``` + @method capitalize + @param {String} str The string to capitalize. + @return {String} The capitalized string. + @public + */ + capitalize: capitalize + }; + exports.fmt = fmt; + exports.loc = loc; + exports.w = w; + exports.decamelize = decamelize; + exports.dasherize = dasherize; + exports.camelize = camelize; + exports.classify = classify; + exports.underscore = underscore; + exports.capitalize = capitalize; +}); +enifed('ember-runtime/utils', ['exports', 'ember-runtime/mixins/array', 'ember-runtime/system/object'], function (exports, _emberRuntimeMixinsArray, _emberRuntimeSystemObject) { + 'use strict'; - function HasBlockParams(blockName) { - _ExpressionSyntax8.call(this); - this.blockName = blockName; - this.type = "has-block-params"; - } + exports.isArray = isArray; + exports.typeOf = typeOf; - HasBlockParams.fromSpec = function fromSpec(sexp) { - var blockName = sexp[1]; + // ........................................ + // TYPING & ARRAY MESSAGING + // + var TYPE_MAP = { + '[object Boolean]': 'boolean', + '[object Number]': 'number', + '[object String]': 'string', + '[object Function]': 'function', + '[object Array]': 'array', + '[object Date]': 'date', + '[object RegExp]': 'regexp', + '[object Object]': 'object', + '[object FileList]': 'filelist' + }; - return new HasBlockParams(blockName); - }; + var toString = Object.prototype.toString; - HasBlockParams.build = function build(blockName) { - return new this(blockName); - }; + /** + Returns true if the passed object is an array or Array-like. + + Objects are considered Array-like if any of the following are true: + + - the object is a native Array + - the object has an objectAt property + - the object is an Object, and has a length property + + Unlike `Ember.typeOf` this method returns true even if the passed object is + not formally an array but appears to be array-like (i.e. implements `Ember.Array`) + + ```javascript + Ember.isArray(); // false + Ember.isArray([]); // true + Ember.isArray(Ember.ArrayProxy.create({ content: [] })); // true + ``` + + @method isArray + @for Ember + @param {Object} obj The object to test + @return {Boolean} true if the passed object is an array or Array-like + @public + */ - HasBlockParams.prototype.compile = function compile(compiler, env) { - var blockName = this.blockName; - - if (compiler.hasBlockSymbol(blockName)) { - var symbol = compiler.getBlockSymbol(blockName); - var inner = new _glimmerRuntimeLibCompiledExpressionsHasBlock.CompiledGetBlockBySymbol(symbol, blockName); - return new _glimmerRuntimeLibCompiledExpressionsHasBlock.CompiledHasBlockParams(inner); - } else if (compiler.hasPartialArgsSymbol()) { - var symbol = compiler.getPartialArgsSymbol(); - var inner = new _glimmerRuntimeLibCompiledExpressionsHasBlock.CompiledInPartialGetBlock(symbol, blockName); - return new _glimmerRuntimeLibCompiledExpressionsHasBlock.CompiledHasBlockParams(inner); - } else { - throw new Error('[BUG] ${blockName} is not a valid block name.'); - } - }; + function isArray(obj) { + if (!obj || obj.setInterval) { + return false; + } + if (Array.isArray(obj)) { + return true; + } + if (_emberRuntimeMixinsArray.default.detect(obj)) { + return true; + } - return HasBlockParams; - })(_glimmerRuntimeLibSyntax.Expression); + var type = typeOf(obj); + if ('array' === type) { + return true; + } + if (obj.length !== undefined && 'object' === type) { + return true; + } + return false; + } - exports.HasBlockParams = HasBlockParams; + /** + Returns a consistent type for the passed object. + + Use this instead of the built-in `typeof` to get the type of an item. + It will return the same result across all browsers and includes a bit + more detail. Here is what will be returned: + + | Return Value | Meaning | + |---------------|------------------------------------------------------| + | 'string' | String primitive or String object. | + | 'number' | Number primitive or Number object. | + | 'boolean' | Boolean primitive or Boolean object. | + | 'null' | Null value | + | 'undefined' | Undefined value | + | 'function' | A function | + | 'array' | An instance of Array | + | 'regexp' | An instance of RegExp | + | 'date' | An instance of Date | + | 'filelist' | An instance of FileList | + | 'class' | An Ember class (created using Ember.Object.extend()) | + | 'instance' | An Ember object instance | + | 'error' | An instance of the Error object | + | 'object' | A JavaScript object not inheriting from Ember.Object | + + Examples: + + ```javascript + Ember.typeOf(); // 'undefined' + Ember.typeOf(null); // 'null' + Ember.typeOf(undefined); // 'undefined' + Ember.typeOf('michael'); // 'string' + Ember.typeOf(new String('michael')); // 'string' + Ember.typeOf(101); // 'number' + Ember.typeOf(new Number(101)); // 'number' + Ember.typeOf(true); // 'boolean' + Ember.typeOf(new Boolean(true)); // 'boolean' + Ember.typeOf(Ember.makeArray); // 'function' + Ember.typeOf([1, 2, 90]); // 'array' + Ember.typeOf(/abc/); // 'regexp' + Ember.typeOf(new Date()); // 'date' + Ember.typeOf(event.target.files); // 'filelist' + Ember.typeOf(Ember.Object.extend()); // 'class' + Ember.typeOf(Ember.Object.create()); // 'instance' + Ember.typeOf(new Error('teamocil')); // 'error' + + // 'normal' JavaScript object + Ember.typeOf({ a: 'b' }); // 'object' + ``` + + @method typeOf + @for Ember + @param {Object} item the item to check + @return {String} the type + @public + */ - var Concat = (function () { - function Concat(parts) { - this.parts = parts; - this.type = "concat"; - } + function typeOf(item) { + if (item === null) { + return 'null'; + } + if (item === undefined) { + return 'undefined'; + } + var ret = TYPE_MAP[toString.call(item)] || 'object'; - Concat.fromSpec = function fromSpec(sexp) { - var params = sexp[1]; + if (ret === 'function') { + if (_emberRuntimeSystemObject.default.detect(item)) { + ret = 'class'; + } + } else if (ret === 'object') { + if (item instanceof Error) { + ret = 'error'; + } else if (item instanceof _emberRuntimeSystemObject.default) { + ret = 'instance'; + } else if (item instanceof Date) { + ret = 'date'; + } + } - return new Concat(params.map(_glimmerRuntimeLibSyntaxExpressions.default)); - }; + return ret; + } +}); +enifed("ember-utils/apply-str", ["exports"], function (exports) { + /** + @param {Object} t target + @param {String} m method + @param {Array} a args + @private + */ + "use strict"; - Concat.build = function build(parts) { - return new this(parts); - }; + exports.default = applyStr; - Concat.prototype.compile = function compile(compiler, env, symbolTable) { - return new _glimmerRuntimeLibCompiledExpressionsConcat.default(this.parts.map(function (p) { - return p.compile(compiler, env, symbolTable); - })); - }; + function applyStr(t, m, a) { + var l = a && a.length; + if (!a || !l) { + return t[m](); + } + switch (l) { + case 1: + return t[m](a[0]); + case 2: + return t[m](a[0], a[1]); + case 3: + return t[m](a[0], a[1], a[2]); + case 4: + return t[m](a[0], a[1], a[2], a[3]); + case 5: + return t[m](a[0], a[1], a[2], a[3], a[4]); + default: + return t[m].apply(t, a); + } + } +}); +enifed("ember-utils/assign", ["exports"], function (exports) { + /** + Copy properties from a source object to a target object. + + ```javascript + var a = { first: 'Yehuda' }; + var b = { last: 'Katz' }; + var c = { company: 'Tilde Inc.' }; + Ember.assign(a, b, c); // a === { first: 'Yehuda', last: 'Katz', company: 'Tilde Inc.' }, b === { last: 'Katz' }, c === { company: 'Tilde Inc.' } + ``` + + @method assign + @for Ember + @param {Object} original The object to assign into + @param {Object} ...args The objects to copy properties from + @return {Object} + @public + */ + "use strict"; - return Concat; - })(); + exports.default = assign; - exports.Concat = Concat; + function assign(original) { + for (var i = 1; i < arguments.length; i++) { + var arg = arguments[i]; + if (!arg) { + continue; + } - var Blocks = (function () { - function Blocks(_default) { - var inverse = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var updates = Object.keys(arg); - this.type = "blocks"; - this.default = _default; - this.inverse = inverse; - } + for (var _i = 0; _i < updates.length; _i++) { + var prop = updates[_i]; + original[prop] = arg[prop]; + } + } - Blocks.fromSpec = function fromSpec(_default) { - var inverse = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + return original; + } +}); +enifed('ember-utils/dictionary', ['exports', 'ember-utils/empty-object'], function (exports, _emberUtilsEmptyObject) { + 'use strict'; - return new Blocks(_default, inverse); - }; + exports.default = makeDictionary; - Blocks.empty = function empty() { - return EMPTY_BLOCKS; - }; + // 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. - return Blocks; - })(); + function makeDictionary(parent) { + var dict = undefined; + if (parent === null) { + dict = new _emberUtilsEmptyObject.default(); + } else { + dict = Object.create(parent); + } + dict['_dict'] = null; + delete dict['_dict']; + return dict; + } +}); +enifed("ember-utils/empty-object", ["exports"], function (exports) { + // This exists because `Object.create(null)` is absurdly slow compared + // to `new EmptyObject()`. In either case, you want a null prototype + // when you're treating the object instances as arbitrary dictionaries + // and don't want your keys colliding with build-in methods on the + // default object prototype. - exports.Blocks = Blocks; - var EMPTY_BLOCKS = new ((function (_Blocks) { - babelHelpers.inherits(_class, _Blocks); + "use strict"; - function _class() { - _Blocks.call(this, null, null); - } + var proto = Object.create(null, { + // without this, we will always still end up with (new + // EmptyObject()).constructor === Object + constructor: { + value: undefined, + enumerable: false, + writable: true + } + }); - return _class; - })(Blocks))(); - exports.EMPTY_BLOCKS = EMPTY_BLOCKS; + function EmptyObject() {} + EmptyObject.prototype = proto; + exports.default = EmptyObject; +}); +enifed('ember-utils/guid', ['exports', 'ember-utils/intern'], function (exports, _emberUtilsIntern) { + 'use strict'; - var Args = (function () { - function Args(positional, named, blocks) { - this.positional = positional; - this.named = named; - this.blocks = blocks; - this.type = "args"; - } + exports.uuid = uuid; + exports.generateGuid = generateGuid; + exports.guidFor = guidFor; - Args.empty = function empty() { - return EMPTY_ARGS; - }; + /** + Previously we used `Ember.$.uuid`, however `$.uuid` has been removed from + jQuery master. We'll just bootstrap our own uuid now. + + @private + @return {Number} the uuid + */ + var _uuid = 0; - Args.fromSpec = function fromSpec(positional, named, blocks) { - return new Args(PositionalArgs.fromSpec(positional), NamedArgs.fromSpec(named), blocks); - }; + /** + Generates a universally unique identifier. This method + is used internally by Ember for assisting with + the generation of GUID's and other unique identifiers. + + @public + @return {Number} [description] + */ - Args.fromPositionalArgs = function fromPositionalArgs(positional) { - var blocks = arguments.length <= 1 || arguments[1] === undefined ? EMPTY_BLOCKS : arguments[1]; + function uuid() { + return ++_uuid; + } - return new Args(positional, EMPTY_NAMED_ARGS, blocks); - }; + /** + Prefix used for guids through out Ember. + @private + @property GUID_PREFIX + @for Ember + @type String + @final + */ + var GUID_PREFIX = 'ember'; - Args.fromNamedArgs = function fromNamedArgs(named) { - var blocks = arguments.length <= 1 || arguments[1] === undefined ? EMPTY_BLOCKS : arguments[1]; + // Used for guid generation... + var numberCache = []; + var stringCache = {}; - return new Args(EMPTY_POSITIONAL_ARGS, named, blocks); - }; + /** + A unique key used to assign guids and other private metadata to objects. + If you inspect an object in your browser debugger you will often see these. + They can be safely ignored. + + On browsers that support it, these properties are added with enumeration + disabled so they won't show up when you iterate over your properties. + + @private + @property GUID_KEY + @for Ember + @type String + @final + */ + var GUID_KEY = _emberUtilsIntern.default('__ember' + +new Date()); - Args.build = function build(positional, named, blocks) { - if (positional === EMPTY_POSITIONAL_ARGS && named === EMPTY_NAMED_ARGS && blocks === EMPTY_BLOCKS) { - return EMPTY_ARGS; - } else { - return new this(positional, named, blocks); - } - }; + exports.GUID_KEY = GUID_KEY; + var GUID_DESC = { + writable: true, + configurable: true, + enumerable: false, + value: null + }; - Args.prototype.compile = function compile(compiler, env, symbolTable) { - var positional = this.positional; - var named = this.named; - var blocks = this.blocks; + exports.GUID_DESC = GUID_DESC; + var nullDescriptor = { + configurable: true, + writable: true, + enumerable: false, + value: null + }; - return _glimmerRuntimeLibCompiledExpressionsArgs.CompiledArgs.create(positional.compile(compiler, env, symbolTable), named.compile(compiler, env, symbolTable), blocks); - }; + var GUID_KEY_PROPERTY = { + name: GUID_KEY, + descriptor: nullDescriptor + }; - return Args; - })(); + exports.GUID_KEY_PROPERTY = GUID_KEY_PROPERTY; + /** + Generates a new guid, optionally saving the guid to the object that you + pass in. You will rarely need to use this method. Instead you should + call `Ember.guidFor(obj)`, which return an existing guid if available. + + @private + @method generateGuid + @for Ember + @param {Object} [obj] Object the guid will be used for. If passed in, the guid will + be saved on the object and reused whenever you pass the same object + again. + + If no object is passed, just generate a new guid. + @param {String} [prefix] Prefix to place in front of the guid. Useful when you want to + separate the guid into separate namespaces. + @return {String} the guid + */ - exports.Args = Args; + function generateGuid(obj, prefix) { + if (!prefix) { + prefix = GUID_PREFIX; + } - var PositionalArgs = (function () { - function PositionalArgs(values) { - this.values = values; - this.type = "positional"; - this.length = values.length; + var ret = prefix + uuid(); + if (obj) { + if (obj[GUID_KEY] === null) { + obj[GUID_KEY] = ret; + } else { + GUID_DESC.value = ret; + if (obj.__defineNonEnumerable) { + obj.__defineNonEnumerable(GUID_KEY_PROPERTY); + } else { + Object.defineProperty(obj, GUID_KEY, GUID_DESC); } + } + } + return ret; + } - PositionalArgs.empty = function empty() { - return EMPTY_POSITIONAL_ARGS; - }; - - PositionalArgs.fromSpec = function fromSpec(sexp) { - if (!sexp || sexp.length === 0) return EMPTY_POSITIONAL_ARGS; - return new PositionalArgs(sexp.map(_glimmerRuntimeLibSyntaxExpressions.default)); - }; - - PositionalArgs.build = function build(exprs) { - if (exprs.length === 0) { - return EMPTY_POSITIONAL_ARGS; - } else { - return new this(exprs); - } - }; + /** + Returns a unique id for the object. If the object does not yet have a guid, + one will be assigned to it. You can call this on any object, + `Ember.Object`-based or not, but be aware that it will add a `_guid` + property. + + You can also use this method on DOM Element objects. + + @public + @method guidFor + @for Ember + @param {Object} obj any object, string, number, Element, or primitive + @return {String} the unique guid for this instance. + */ - PositionalArgs.prototype.slice = function slice(start, end) { - return PositionalArgs.build(this.values.slice(start, end)); - }; + function guidFor(obj) { + var type = typeof obj; + var isObject = type === 'object' && obj !== null; + var isFunction = type === 'function'; - PositionalArgs.prototype.at = function at(index) { - return this.values[index]; - }; + if ((isObject || isFunction) && obj[GUID_KEY]) { + return obj[GUID_KEY]; + } - PositionalArgs.prototype.compile = function compile(compiler, env, symbolTable) { - return _glimmerRuntimeLibCompiledExpressionsArgs.CompiledPositionalArgs.create(this.values.map(function (v) { - return v.compile(compiler, env, symbolTable); - })); - }; + // special cases where we don't want to add a key to object + if (obj === undefined) { + return '(undefined)'; + } - return PositionalArgs; - })(); + if (obj === null) { + return '(null)'; + } - exports.PositionalArgs = PositionalArgs; + var ret = undefined; - var EMPTY_POSITIONAL_ARGS = new ((function (_PositionalArgs) { - babelHelpers.inherits(_class2, _PositionalArgs); + // Don't allow prototype changes to String etc. to change the guidFor + switch (type) { + case 'number': + ret = numberCache[obj]; - function _class2() { - _PositionalArgs.call(this, _glimmerRuntimeLibUtils.EMPTY_ARRAY); + if (!ret) { + ret = numberCache[obj] = 'nu' + obj; } - _class2.prototype.slice = function slice(start, end) { - return this; - }; - - _class2.prototype.at = function at(index) { - return undefined; // ??! - }; - - _class2.prototype.compile = function compile(compiler, env) { - return _glimmerRuntimeLibCompiledExpressionsArgs.CompiledPositionalArgs.empty(); - }; + return ret; - return _class2; - })(PositionalArgs))(); + case 'string': + ret = stringCache[obj]; - var NamedArgs = (function () { - function NamedArgs(keys, values) { - this.keys = keys; - this.values = values; - this.type = "named"; - this.length = keys.length; + if (!ret) { + ret = stringCache[obj] = 'st' + uuid(); } - NamedArgs.empty = function empty() { - return EMPTY_NAMED_ARGS; - }; - - NamedArgs.fromSpec = function fromSpec(sexp) { - if (sexp === null || sexp === undefined) { - return EMPTY_NAMED_ARGS; - } - var keys = sexp[0]; - var exprs = sexp[1]; - - if (keys.length === 0) { - return EMPTY_NAMED_ARGS; - } - return new this(keys, exprs.map(function (expr) { - return _glimmerRuntimeLibSyntaxExpressions.default(expr); - })); - }; - - NamedArgs.build = function build(keys, values) { - if (keys.length === 0) { - return EMPTY_NAMED_ARGS; - } else { - return new this(keys, values); - } - }; - - NamedArgs.prototype.at = function at(key) { - var keys = this.keys; - var values = this.values; - - var index = keys.indexOf(key); - return values[index]; - }; - - NamedArgs.prototype.has = function has(key) { - return this.keys.indexOf(key) !== -1; - }; - - NamedArgs.prototype.compile = function compile(compiler, env, symbolTable) { - var keys = this.keys; - var values = this.values; - - var compiledValues = new Array(values.length); - for (var i = 0; i < compiledValues.length; i++) { - compiledValues[i] = values[i].compile(compiler, env, symbolTable); - } - return new _glimmerRuntimeLibCompiledExpressionsArgs.CompiledNamedArgs(keys, compiledValues); - }; - - return NamedArgs; - })(); - - exports.NamedArgs = NamedArgs; + return ret; - var EMPTY_NAMED_ARGS = new ((function (_NamedArgs) { - babelHelpers.inherits(_class3, _NamedArgs); + case 'boolean': + return obj ? '(true)' : '(false)'; - function _class3() { - _NamedArgs.call(this, _glimmerRuntimeLibUtils.EMPTY_ARRAY, _glimmerRuntimeLibUtils.EMPTY_ARRAY); + default: + if (obj === Object) { + return '(Object)'; } - _class3.prototype.at = function at(key) { - return undefined; // ??! - }; - - _class3.prototype.has = function has(key) { - return false; - }; - - _class3.prototype.compile = function compile(compiler, env) { - return _glimmerRuntimeLibCompiledExpressionsArgs.CompiledNamedArgs.empty(); - }; - - return _class3; - })(NamedArgs))(); - var EMPTY_ARGS = new ((function (_Args) { - babelHelpers.inherits(_class4, _Args); - - function _class4() { - _Args.call(this, EMPTY_POSITIONAL_ARGS, EMPTY_NAMED_ARGS, EMPTY_BLOCKS); + if (obj === Array) { + return '(Array)'; } - _class4.prototype.compile = function compile(compiler, env) { - return _glimmerRuntimeLibCompiledExpressionsArgs.CompiledArgs.empty(); - }; - - return _class4; - })(Args))(); -}); - -enifed('glimmer-runtime/lib/syntax/expressions', ['exports', 'glimmer-runtime/lib/syntax/core', 'glimmer-wire-format'], function (exports, _glimmerRuntimeLibSyntaxCore, _glimmerWireFormat) { - 'use strict'; + ret = GUID_PREFIX + uuid(); - var isArg = _glimmerWireFormat.Expressions.isArg; - var isConcat = _glimmerWireFormat.Expressions.isConcat; - var isGet = _glimmerWireFormat.Expressions.isGet; - var isHasBlock = _glimmerWireFormat.Expressions.isHasBlock; - var isHasBlockParams = _glimmerWireFormat.Expressions.isHasBlockParams; - var isHelper = _glimmerWireFormat.Expressions.isHelper; - var isUnknown = _glimmerWireFormat.Expressions.isUnknown; - var isPrimitiveValue = _glimmerWireFormat.Expressions.isPrimitiveValue; - var isUndefined = _glimmerWireFormat.Expressions.isUndefined; - - exports.default = function (sexp) { - if (isPrimitiveValue(sexp)) return _glimmerRuntimeLibSyntaxCore.Value.fromSpec(sexp); - if (isUndefined(sexp)) return _glimmerRuntimeLibSyntaxCore.Value.build(undefined); - if (isArg(sexp)) return _glimmerRuntimeLibSyntaxCore.GetArgument.fromSpec(sexp); - if (isConcat(sexp)) return _glimmerRuntimeLibSyntaxCore.Concat.fromSpec(sexp); - if (isGet(sexp)) return _glimmerRuntimeLibSyntaxCore.Get.fromSpec(sexp); - if (isHelper(sexp)) return _glimmerRuntimeLibSyntaxCore.Helper.fromSpec(sexp); - if (isUnknown(sexp)) return _glimmerRuntimeLibSyntaxCore.Unknown.fromSpec(sexp); - if (isHasBlock(sexp)) return _glimmerRuntimeLibSyntaxCore.HasBlock.fromSpec(sexp); - if (isHasBlockParams(sexp)) return _glimmerRuntimeLibSyntaxCore.HasBlockParams.fromSpec(sexp); - throw new Error('Unexpected wire format: ' + JSON.stringify(sexp)); - }; + if (obj[GUID_KEY] === null) { + obj[GUID_KEY] = ret; + } else { + GUID_DESC.value = ret; - ; + if (obj.__defineNonEnumerable) { + obj.__defineNonEnumerable(GUID_KEY_PROPERTY); + } else { + Object.defineProperty(obj, GUID_KEY, GUID_DESC); + } + } + return ret; + } + } }); +enifed('ember-utils/index', ['exports', 'ember-utils/symbol', 'ember-utils/owner', 'ember-utils/assign', 'ember-utils/empty-object', 'ember-utils/dictionary', 'ember-utils/guid', 'ember-utils/intern', 'ember-utils/super', 'ember-utils/inspect', 'ember-utils/lookup-descriptor', 'ember-utils/invoke', 'ember-utils/make-array', 'ember-utils/apply-str', 'ember-utils/name', 'ember-utils/to-string', 'ember-utils/weak-map-utils', 'ember-utils/proxy-utils'], function (exports, _emberUtilsSymbol, _emberUtilsOwner, _emberUtilsAssign, _emberUtilsEmptyObject, _emberUtilsDictionary, _emberUtilsGuid, _emberUtilsIntern, _emberUtilsSuper, _emberUtilsInspect, _emberUtilsLookupDescriptor, _emberUtilsInvoke, _emberUtilsMakeArray, _emberUtilsApplyStr, _emberUtilsName, _emberUtilsToString, _emberUtilsWeakMapUtils, _emberUtilsProxyUtils) { + /* + This package will be eagerly parsed and should have no dependencies on external + packages. + + It is intended to be used to share utility methods that will be needed + by every Ember application (and is **not** a dumping ground of useful utilities). + + Utility methods that are needed in < 80% of cases should be placed + elsewhere (so they can be lazily evaluated / parsed). + */ + 'use strict'; -enifed('glimmer-runtime/lib/syntax/statements', ['exports', 'glimmer-runtime/lib/syntax/core', 'glimmer-wire-format'], function (exports, _glimmerRuntimeLibSyntaxCore, _glimmerWireFormat) { - 'use strict'; - - var isYield = _glimmerWireFormat.Statements.isYield; - var isBlock = _glimmerWireFormat.Statements.isBlock; - var isPartial = _glimmerWireFormat.Statements.isPartial; - var isAppend = _glimmerWireFormat.Statements.isAppend; - var isDynamicAttr = _glimmerWireFormat.Statements.isDynamicAttr; - var isText = _glimmerWireFormat.Statements.isText; - var isComment = _glimmerWireFormat.Statements.isComment; - var isOpenElement = _glimmerWireFormat.Statements.isOpenElement; - var isFlushElement = _glimmerWireFormat.Statements.isFlushElement; - var isCloseElement = _glimmerWireFormat.Statements.isCloseElement; - var isStaticAttr = _glimmerWireFormat.Statements.isStaticAttr; - var isModifier = _glimmerWireFormat.Statements.isModifier; - var isDynamicArg = _glimmerWireFormat.Statements.isDynamicArg; - var isStaticArg = _glimmerWireFormat.Statements.isStaticArg; - var isTrustingAttr = _glimmerWireFormat.Statements.isTrustingAttr; - - exports.default = function (sexp, symbolTable, scanner) { - if (isYield(sexp)) return _glimmerRuntimeLibSyntaxCore.Yield.fromSpec(sexp); - if (isPartial(sexp)) return _glimmerRuntimeLibSyntaxCore.Partial.fromSpec(sexp); - if (isBlock(sexp)) return _glimmerRuntimeLibSyntaxCore.Block.fromSpec(sexp, symbolTable, scanner); - if (isAppend(sexp)) return _glimmerRuntimeLibSyntaxCore.OptimizedAppend.fromSpec(sexp); - if (isDynamicAttr(sexp)) return _glimmerRuntimeLibSyntaxCore.DynamicAttr.fromSpec(sexp); - if (isDynamicArg(sexp)) return _glimmerRuntimeLibSyntaxCore.DynamicArg.fromSpec(sexp); - if (isTrustingAttr(sexp)) return _glimmerRuntimeLibSyntaxCore.TrustingAttr.fromSpec(sexp); - if (isText(sexp)) return _glimmerRuntimeLibSyntaxCore.Text.fromSpec(sexp); - if (isComment(sexp)) return _glimmerRuntimeLibSyntaxCore.Comment.fromSpec(sexp); - if (isOpenElement(sexp)) return _glimmerRuntimeLibSyntaxCore.OpenElement.fromSpec(sexp, symbolTable); - if (isFlushElement(sexp)) return _glimmerRuntimeLibSyntaxCore.FlushElement.fromSpec(); - if (isCloseElement(sexp)) return _glimmerRuntimeLibSyntaxCore.CloseElement.fromSpec(); - if (isStaticAttr(sexp)) return _glimmerRuntimeLibSyntaxCore.StaticAttr.fromSpec(sexp); - if (isStaticArg(sexp)) return _glimmerRuntimeLibSyntaxCore.StaticArg.fromSpec(sexp); - if (isModifier(sexp)) return _glimmerRuntimeLibSyntaxCore.Modifier.fromSpec(sexp); - }; - - ; + exports.symbol = _emberUtilsSymbol.default; + exports.getOwner = _emberUtilsOwner.getOwner; + exports.setOwner = _emberUtilsOwner.setOwner; + exports.OWNER = _emberUtilsOwner.OWNER; + exports.assign = _emberUtilsAssign.default; + exports.EmptyObject = _emberUtilsEmptyObject.default; + exports.dictionary = _emberUtilsDictionary.default; + exports.uuid = _emberUtilsGuid.uuid; + exports.GUID_KEY = _emberUtilsGuid.GUID_KEY; + exports.GUID_DESC = _emberUtilsGuid.GUID_DESC; + exports.GUID_KEY_PROPERTY = _emberUtilsGuid.GUID_KEY_PROPERTY; + exports.generateGuid = _emberUtilsGuid.generateGuid; + exports.guidFor = _emberUtilsGuid.guidFor; + exports.intern = _emberUtilsIntern.default; + exports.checkHasSuper = _emberUtilsSuper.checkHasSuper; + exports.ROOT = _emberUtilsSuper.ROOT; + exports.wrap = _emberUtilsSuper.wrap; + exports.inspect = _emberUtilsInspect.default; + exports.lookupDescriptor = _emberUtilsLookupDescriptor.default; + exports.canInvoke = _emberUtilsInvoke.canInvoke; + exports.tryInvoke = _emberUtilsInvoke.tryInvoke; + exports.makeArray = _emberUtilsMakeArray.default; + exports.applyStr = _emberUtilsApplyStr.default; + exports.NAME_KEY = _emberUtilsName.default; + exports.toString = _emberUtilsToString.default; + exports.HAS_NATIVE_WEAKMAP = _emberUtilsWeakMapUtils.HAS_NATIVE_WEAKMAP; + exports.HAS_NATIVE_PROXY = _emberUtilsProxyUtils.HAS_NATIVE_PROXY; }); +enifed('ember-utils/inspect', ['exports'], function (exports) { + 'use strict'; -enifed('glimmer-runtime/lib/template', ['exports', 'glimmer-util', 'glimmer-runtime/lib/builder', 'glimmer-runtime/lib/vm', 'glimmer-runtime/lib/scanner'], function (exports, _glimmerUtil, _glimmerRuntimeLibBuilder, _glimmerRuntimeLibVm, _glimmerRuntimeLibScanner) { - 'use strict'; + exports.default = inspect; + var objectToString = Object.prototype.toString; - exports.default = templateFactory; + /** + Convenience method to inspect an object. This method will attempt to + convert the object into a useful string description. + + It is a pretty simple implementation. If you want something more robust, + use something like JSDump: https://github.com/NV/jsDump + + @method inspect + @for Ember + @param {Object} obj The object you want to inspect. + @return {String} A description of the object + @since 1.4.0 + @private + */ - var clientId = 0; + function inspect(obj) { + if (obj === null) { + return 'null'; + } + if (obj === undefined) { + return 'undefined'; + } + if (Array.isArray(obj)) { + return '[' + obj + ']'; + } + // for non objects + var type = typeof obj; + if (type !== 'object' && type !== 'symbol') { + return '' + obj; + } + // overridden toString + if (typeof obj.toString === 'function' && obj.toString !== objectToString) { + return obj.toString(); + } - function templateFactory(_ref) { - var id = _ref.id; - var meta = _ref.meta; - var block = _ref.block; + // Object.prototype.toString === {}.toString + var v = undefined; + var ret = []; + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + v = obj[key]; + if (v === 'toString') { + continue; + } // ignore useless items + if (typeof v === 'function') { + v = 'function() { ... }'; + } - var parsedBlock = undefined; - if (!id) { - id = 'client-' + clientId++; + if (v && typeof v.toString !== 'function') { + ret.push(key + ': ' + objectToString.call(v)); + } else { + ret.push(key + ': ' + v); } - var create = function (env, envMeta) { - var newMeta = envMeta ? _glimmerUtil.assign({}, envMeta, meta) : meta; - if (!parsedBlock) { - parsedBlock = JSON.parse(block); - } - return template(parsedBlock, id, newMeta, env); - }; - return { id: id, meta: meta, create: create }; + } } + return '{' + ret.join(', ') + '}'; + } +}); +enifed("ember-utils/intern", ["exports"], function (exports) { + /** + Strongly hint runtimes to intern the provided string. + + When do I need to use this function? + + For the most part, never. Pre-mature optimization is bad, and often the + runtime does exactly what you need it to, and more often the trade-off isn't + worth it. + + Why? + + Runtimes store strings in at least 2 different representations: + Ropes and Symbols (interned strings). The Rope provides a memory efficient + data-structure for strings created from concatenation or some other string + manipulation like splitting. + + Unfortunately checking equality of different ropes can be quite costly as + runtimes must resort to clever string comparison algorithms. These + algorithms typically cost in proportion to the length of the string. + Luckily, this is where the Symbols (interned strings) shine. As Symbols are + unique by their string content, equality checks can be done by pointer + comparison. + + How do I know if my string is a rope or symbol? + + Typically (warning general sweeping statement, but truthy in runtimes at + present) static strings created as part of the JS source are interned. + Strings often used for comparisons can be interned at runtime if some + criteria are met. One of these criteria can be the size of the entire rope. + For example, in chrome 38 a rope longer then 12 characters will not + intern, nor will segments of that rope. + + Some numbers: http://jsperf.com/eval-vs-keys/8 + + Known Trick™ + + @private + @return {String} interned version of the provided string + */ + "use strict"; - function template(block, id, meta, env) { - var scanner = new _glimmerRuntimeLibScanner.default(block, meta, env); - var entryPoint = undefined; - var asEntryPoint = function () { - if (!entryPoint) entryPoint = scanner.scanEntryPoint(); - return entryPoint; - }; - var layout = undefined; - var asLayout = function () { - if (!layout) layout = scanner.scanLayout(); - return layout; - }; - var asPartial = function (symbols) { - return scanner.scanPartial(symbols); - }; - var render = function (self, appendTo, dynamicScope) { - var elementStack = _glimmerRuntimeLibBuilder.ElementStack.forInitialRender(env, appendTo, null); - var compiled = asEntryPoint().compile(env); - var vm = _glimmerRuntimeLibVm.VM.initial(env, self, dynamicScope, elementStack, compiled.symbols); - return vm.execute(compiled.ops); - }; - return { id: id, meta: meta, _block: block, asEntryPoint: asEntryPoint, asLayout: asLayout, asPartial: asPartial, render: render }; + exports.default = intern; + + function intern(str) { + var obj = {}; + obj[str] = 1; + for (var key in obj) { + if (key === str) { + return key; + } } + return str; + } }); +enifed('ember-utils/invoke', ['exports', 'ember-utils/apply-str'], function (exports, _emberUtilsApplyStr) { + 'use strict'; -enifed('glimmer-runtime/lib/upsert', ['exports', 'glimmer-runtime/lib/bounds'], function (exports, _glimmerRuntimeLibBounds) { - 'use strict'; + exports.canInvoke = canInvoke; + exports.tryInvoke = tryInvoke; - exports.isSafeString = isSafeString; - exports.isNode = isNode; - exports.isString = isString; - exports.cautiousInsert = cautiousInsert; - exports.trustingInsert = trustingInsert; + /** + Checks to see if the `methodName` exists on the `obj`. + + ```javascript + let foo = { bar: function() { return 'bar'; }, baz: null }; + + Ember.canInvoke(foo, 'bar'); // true + Ember.canInvoke(foo, 'baz'); // false + Ember.canInvoke(foo, 'bat'); // false + ``` + + @method canInvoke + @for Ember + @param {Object} obj The object to check for the method + @param {String} methodName The method name to check for + @return {Boolean} + @private + */ - function isSafeString(value) { - return value && typeof value['toHTML'] === 'function'; - } + function canInvoke(obj, methodName) { + return !!(obj && typeof obj[methodName] === 'function'); + } - function isNode(value) { - return value !== null && typeof value === 'object' && typeof value['nodeType'] === 'number'; - } + /** + Checks to see if the `methodName` exists on the `obj`, + and if it does, invokes it with the arguments passed. + + ```javascript + let d = new Date('03/15/2013'); + + Ember.tryInvoke(d, 'getTime'); // 1363320000000 + Ember.tryInvoke(d, 'setFullYear', [2014]); // 1394856000000 + Ember.tryInvoke(d, 'noSuchMethod', [2014]); // undefined + ``` + + @method tryInvoke + @for Ember + @param {Object} obj The object to check for the method + @param {String} methodName The method name to check for + @param {Array} [args] The arguments to pass to the method + @return {*} the return value of the invoked method or undefined if it cannot be invoked + @public + */ - function isString(value) { - return typeof value === 'string'; + function tryInvoke(obj, methodName, args) { + if (canInvoke(obj, methodName)) { + return args ? _emberUtilsApplyStr.default(obj, methodName, args) : _emberUtilsApplyStr.default(obj, methodName); } + } +}); +enifed("ember-utils/lookup-descriptor", ["exports"], function (exports) { + "use strict"; - var Upsert = function Upsert(bounds) { - this.bounds = bounds; - }; + exports.default = lookupDescriptor; - exports.default = Upsert; + function lookupDescriptor(obj, keyName) { + var current = obj; + while (current) { + var descriptor = Object.getOwnPropertyDescriptor(current, keyName); - function cautiousInsert(dom, cursor, value) { - if (isString(value)) { - return TextUpsert.insert(dom, cursor, value); - } - if (isSafeString(value)) { - return SafeStringUpsert.insert(dom, cursor, value); - } - if (isNode(value)) { - return NodeUpsert.insert(dom, cursor, value); - } - } + if (descriptor) { + return descriptor; + } - function trustingInsert(dom, cursor, value) { - if (isString(value)) { - return HTMLUpsert.insert(dom, cursor, value); - } - if (isNode(value)) { - return NodeUpsert.insert(dom, cursor, value); - } + current = Object.getPrototypeOf(current); } - var TextUpsert = (function (_Upsert) { - babelHelpers.inherits(TextUpsert, _Upsert); - - function TextUpsert(bounds, textNode) { - _Upsert.call(this, bounds); - this.textNode = textNode; - } + return null; + } +}); +enifed("ember-utils/make-array", ["exports"], function (exports) { + "use strict"; - TextUpsert.insert = function insert(dom, cursor, value) { - var textNode = dom.createTextNode(value); - dom.insertBefore(cursor.element, textNode, cursor.nextSibling); - var bounds = new _glimmerRuntimeLibBounds.SingleNodeBounds(cursor.element, textNode); - return new TextUpsert(bounds, textNode); - }; + exports.default = makeArray; + var isArray = Array.isArray; - TextUpsert.prototype.update = function update(dom, value) { - if (isString(value)) { - var textNode = this.textNode; + /** + Forces the passed object to be part of an array. If the object is already + an array, it will return the object. Otherwise, it will add the object to + an array. If obj is `null` or `undefined`, it will return an empty array. + + ```javascript + Ember.makeArray(); // [] + Ember.makeArray(null); // [] + Ember.makeArray(undefined); // [] + Ember.makeArray('lindsay'); // ['lindsay'] + Ember.makeArray([1, 2, 42]); // [1, 2, 42] + + let controller = Ember.ArrayProxy.create({ content: [] }); + + Ember.makeArray(controller) === controller; // true + ``` + + @method makeArray + @for Ember + @param {Object} obj the object + @return {Array} + @private + */ - textNode.nodeValue = value; - return true; - } else { - return false; - } - }; + function makeArray(obj) { + if (obj === null || obj === undefined) { + return []; + } + return isArray(obj) ? obj : [obj]; + } +}); +enifed('ember-utils/name', ['exports', 'ember-utils/symbol'], function (exports, _emberUtilsSymbol) { + 'use strict'; - return TextUpsert; - })(Upsert); + exports.default = _emberUtilsSymbol.default('NAME_KEY'); +}); +enifed('ember-utils/owner', ['exports', 'ember-utils/symbol'], function (exports, _emberUtilsSymbol) { + /** + @module ember + @submodule ember-runtime + */ - var HTMLUpsert = (function (_Upsert2) { - babelHelpers.inherits(HTMLUpsert, _Upsert2); + 'use strict'; - function HTMLUpsert() { - _Upsert2.apply(this, arguments); - } + exports.getOwner = getOwner; + exports.setOwner = setOwner; + var OWNER = _emberUtilsSymbol.default('OWNER'); - HTMLUpsert.insert = function insert(dom, cursor, value) { - var bounds = dom.insertHTMLBefore(cursor.element, value, cursor.nextSibling); - return new HTMLUpsert(bounds); - }; + exports.OWNER = OWNER; + /** + Framework objects in an Ember application (components, services, routes, etc.) + are created via a factory and dependency injection system. Each of these + objects is the responsibility of an "owner", which handled its + instantiation and manages its lifetime. + + `getOwner` fetches the owner object responsible for an instance. This can + be used to lookup or resolve other class instances, or register new factories + into the owner. + + For example, this component dynamically looks up a service based on the + `audioType` passed as an attribute: + + ``` + // app/components/play-audio.js + import Ember from 'ember'; + + // Usage: + // + // {{play-audio audioType=model.audioType audioFile=model.file}} + // + export default Ember.Component.extend({ + audioService: Ember.computed('audioType', function() { + let owner = Ember.getOwner(this); + return owner.lookup(`service:${this.get('audioType')}`); + }), + click() { + let player = this.get('audioService'); + player.play(this.get('audioFile')); + } + }); + ``` + + @method getOwner + @for Ember + @param {Object} object An object with an owner. + @return {Object} An owner object. + @since 2.3.0 + @public + */ - HTMLUpsert.prototype.update = function update(dom, value) { - if (isString(value)) { - var bounds = this.bounds; + function getOwner(object) { + return object[OWNER]; + } - var parentElement = bounds.parentElement(); - var nextSibling = _glimmerRuntimeLibBounds.clear(bounds); - this.bounds = dom.insertHTMLBefore(parentElement, nextSibling, value); - return true; - } else { - return false; - } - }; + /** + `setOwner` forces a new owner on a given object instance. This is primarily + useful in some testing cases. + + @method setOwner + @for Ember + @param {Object} object An object instance. + @param {Object} object The new owner object of the object instance. + @since 2.3.0 + @public + */ - return HTMLUpsert; - })(Upsert); + function setOwner(object, owner) { + object[OWNER] = owner; + } +}); +enifed('ember-utils/proxy-utils', ['exports'], function (exports) { + 'use strict'; - var SafeStringUpsert = (function (_Upsert3) { - babelHelpers.inherits(SafeStringUpsert, _Upsert3); + var HAS_NATIVE_PROXY = typeof Proxy === 'function'; + exports.HAS_NATIVE_PROXY = HAS_NATIVE_PROXY; +}); +enifed('ember-utils/super', ['exports'], function (exports) { + 'use strict'; - function SafeStringUpsert(bounds, lastStringValue) { - _Upsert3.call(this, bounds); - this.lastStringValue = lastStringValue; - } + exports.wrap = wrap; + var HAS_SUPER_PATTERN = /\.(_super|call\(this|apply\(this)/; + var fnToString = Function.prototype.toString; - SafeStringUpsert.insert = function insert(dom, cursor, value) { - var stringValue = value.toHTML(); - var bounds = dom.insertHTMLBefore(cursor.element, stringValue, cursor.nextSibling); - return new SafeStringUpsert(bounds, stringValue); - }; + var checkHasSuper = (function () { + var sourceAvailable = fnToString.call(function () { + return this; + }).indexOf('return this') > -1; - SafeStringUpsert.prototype.update = function update(dom, value) { - if (isSafeString(value)) { - var stringValue = value.toHTML(); - if (stringValue !== this.lastStringValue) { - var bounds = this.bounds; + if (sourceAvailable) { + return function checkHasSuper(func) { + return HAS_SUPER_PATTERN.test(fnToString.call(func)); + }; + } - var parentElement = bounds.parentElement(); - var nextSibling = _glimmerRuntimeLibBounds.clear(bounds); - this.bounds = dom.insertHTMLBefore(parentElement, nextSibling, stringValue); - this.lastStringValue = stringValue; - } - return true; - } else { - return false; - } - }; + return function checkHasSuper() { + return true; + }; + })(); - return SafeStringUpsert; - })(Upsert); + exports.checkHasSuper = checkHasSuper; + function ROOT() {} + ROOT.__hasSuper = false; - var NodeUpsert = (function (_Upsert4) { - babelHelpers.inherits(NodeUpsert, _Upsert4); + function hasSuper(func) { + if (func.__hasSuper === undefined) { + func.__hasSuper = checkHasSuper(func); + } + return func.__hasSuper; + } - function NodeUpsert() { - _Upsert4.apply(this, arguments); - } + /** + 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 + @method wrap + @for Ember + @param {Function} func The function to call + @param {Function} superFunc The super function. + @return {Function} wrapped function. + */ - NodeUpsert.insert = function insert(dom, cursor, node) { - dom.insertBefore(cursor.element, node, cursor.nextSibling); - return new NodeUpsert(_glimmerRuntimeLibBounds.single(cursor.element, node)); - }; + function wrap(func, superFunc) { + if (!hasSuper(func)) { + return func; + } + // ensure an unwrapped super that calls _super is wrapped with a terminal _super + if (!superFunc.wrappedFunction && hasSuper(superFunc)) { + return _wrap(func, _wrap(superFunc, ROOT)); + } + return _wrap(func, superFunc); + } - NodeUpsert.prototype.update = function update(dom, value) { - if (isNode(value)) { - var bounds = this.bounds; + function _wrap(func, superFunc) { + function superWrapper() { + var orig = this._super; + this._super = superFunc; + var ret = func.apply(this, arguments); + this._super = orig; + return ret; + } - var parentElement = bounds.parentElement(); - var nextSibling = _glimmerRuntimeLibBounds.clear(bounds); - this.bounds = dom.insertNodeBefore(parentElement, value, nextSibling); - return true; - } else { - return false; - } - }; + superWrapper.wrappedFunction = func; + superWrapper.__ember_observes__ = func.__ember_observes__; + superWrapper.__ember_observesBefore__ = func.__ember_observesBefore__; + superWrapper.__ember_listens__ = func.__ember_listens__; - return NodeUpsert; - })(Upsert); + return superWrapper; + } }); +enifed('ember-utils/symbol', ['exports', 'ember-utils/guid', 'ember-utils/intern'], function (exports, _emberUtilsGuid, _emberUtilsIntern) { + 'use strict'; -enifed('glimmer-runtime/lib/utils', ['exports', 'glimmer-util'], function (exports, _glimmerUtil) { - 'use strict'; - - var HAS_NATIVE_WEAKMAP = (function () { - // detect if `WeakMap` is even present - var hasWeakMap = typeof WeakMap === 'function'; - if (!hasWeakMap) { - return false; - } - var instance = new WeakMap(); - // use `Object`'s `.toString` directly to prevent us from detecting - // polyfills as native weakmaps - return Object.prototype.toString.call(instance) === '[object WeakMap]'; - })(); - var EMPTY_ARRAY = HAS_NATIVE_WEAKMAP ? Object.freeze([]) : []; - exports.EMPTY_ARRAY = EMPTY_ARRAY; - var EMPTY_DICT = HAS_NATIVE_WEAKMAP ? Object.freeze(_glimmerUtil.dict()) : _glimmerUtil.dict(); - exports.EMPTY_DICT = EMPTY_DICT; + exports.default = symbol; - var ListRange = (function () { - function ListRange(list, start, end) { - this.list = list; - this.start = start; - this.end = end; - } + function symbol(debugName) { + // TODO: Investigate using platform symbols, but we do not + // want to require non-enumerability for this API, which + // would introduce a large cost. + var id = _emberUtilsGuid.GUID_KEY + Math.floor(Math.random() * new Date()); + return _emberUtilsIntern.default('__' + debugName + '__ [id=' + id + ']'); + } +}); +enifed('ember-utils/to-string', ['exports'], function (exports) { + 'use strict'; - ListRange.prototype.at = function at(index) { - if (index >= this.list.length) return null; - return this.list[index]; - }; + exports.default = toString; + var objectToString = Object.prototype.toString; - ListRange.prototype.min = function min() { - return this.start; - }; + /* + A `toString` util function that supports objects without a `toString` + method, e.g. an object created with `Object.create(null)`. + */ - ListRange.prototype.max = function max() { - return this.end; - }; + function toString(obj) { + if (obj && typeof obj.toString === 'function') { + return obj.toString(); + } else { + return objectToString.call(obj); + } + } +}); +enifed('ember-utils/weak-map-utils', ['exports'], function (exports) { + 'use strict'; - return ListRange; - })(); + var HAS_NATIVE_WEAKMAP = (function () { + // detect if `WeakMap` is even present + var hasWeakMap = typeof WeakMap === 'function'; + if (!hasWeakMap) { + return false; + } - exports.ListRange = ListRange; + var instance = new WeakMap(); + // use `Object`'s `.toString` directly to prevent us from detecting + // polyfills as native weakmaps + return Object.prototype.toString.call(instance) === '[object WeakMap]'; + })(); + exports.HAS_NATIVE_WEAKMAP = HAS_NATIVE_WEAKMAP; }); - -enifed('glimmer-runtime/lib/vm', ['exports', 'glimmer-runtime/lib/vm/append', 'glimmer-runtime/lib/vm/update', 'glimmer-runtime/lib/vm/render-result'], function (exports, _glimmerRuntimeLibVmAppend, _glimmerRuntimeLibVmUpdate, _glimmerRuntimeLibVmRenderResult) { +enifed('ember-views/compat/attrs', ['exports', 'ember-utils'], function (exports, _emberUtils) { 'use strict'; - exports.VM = _glimmerRuntimeLibVmAppend.default; - exports.PublicVM = _glimmerRuntimeLibVmAppend.PublicVM; - exports.UpdatingVM = _glimmerRuntimeLibVmUpdate.default; - exports.RenderResult = _glimmerRuntimeLibVmRenderResult.default; + var MUTABLE_CELL = _emberUtils.symbol('MUTABLE_CELL'); + exports.MUTABLE_CELL = MUTABLE_CELL; }); +enifed('ember-views/compat/fallback-view-registry', ['exports', 'ember-utils'], function (exports, _emberUtils) { + 'use strict'; -enifed('glimmer-runtime/lib/vm/append', ['exports', 'glimmer-runtime/lib/environment', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-runtime/lib/vm/update', 'glimmer-runtime/lib/vm/render-result', 'glimmer-runtime/lib/vm/frame'], function (exports, _glimmerRuntimeLibEnvironment, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerRuntimeLibVmUpdate, _glimmerRuntimeLibVmRenderResult, _glimmerRuntimeLibVmFrame) { - 'use strict'; - - var VM = (function () { - function VM(env, scope, dynamicScope, elementStack) { - this.env = env; - this.elementStack = elementStack; - this.dynamicScopeStack = new _glimmerUtil.Stack(); - this.scopeStack = new _glimmerUtil.Stack(); - this.updatingOpcodeStack = new _glimmerUtil.Stack(); - this.cacheGroups = new _glimmerUtil.Stack(); - this.listBlockStack = new _glimmerUtil.Stack(); - this.frame = new _glimmerRuntimeLibVmFrame.FrameStack(); - this.env = env; - this.elementStack = elementStack; - this.scopeStack.push(scope); - this.dynamicScopeStack.push(dynamicScope); - } - - VM.initial = function initial(env, self, dynamicScope, elementStack, size) { - var scope = _glimmerRuntimeLibEnvironment.Scope.root(self, size); - return new VM(env, scope, dynamicScope, elementStack); - }; - - VM.prototype.capture = function capture() { - return { - env: this.env, - scope: this.scope(), - dynamicScope: this.dynamicScope(), - frame: this.frame.capture() - }; - }; - - VM.prototype.goto = function goto(op) { - // assert(this.frame.getOps().contains(op), `Illegal jump to ${op.label}`); - this.frame.goto(op); - }; - - VM.prototype.beginCacheGroup = function beginCacheGroup() { - this.cacheGroups.push(this.updatingOpcodeStack.current.tail()); - }; - - VM.prototype.commitCacheGroup = function commitCacheGroup() { - // JumpIfNotModified(END) - // (head) - // (....) - // (tail) - // DidModify - // END: Noop - var END = new _glimmerRuntimeLibCompiledOpcodesVm.LabelOpcode("END"); - var opcodes = this.updatingOpcodeStack.current; - var marker = this.cacheGroups.pop(); - var head = marker ? opcodes.nextNode(marker) : opcodes.head(); - var tail = opcodes.tail(); - var tag = _glimmerReference.combineSlice(new _glimmerUtil.ListSlice(head, tail)); - var guard = new _glimmerRuntimeLibCompiledOpcodesVm.JumpIfNotModifiedOpcode(tag, END); - opcodes.insertBefore(guard, head); - opcodes.append(new _glimmerRuntimeLibCompiledOpcodesVm.DidModifyOpcode(guard)); - opcodes.append(END); - }; - - VM.prototype.enter = function enter(ops) { - var updating = new _glimmerUtil.LinkedList(); - var tracker = this.stack().pushUpdatableBlock(); - var state = this.capture(); - var tryOpcode = new _glimmerRuntimeLibVmUpdate.TryOpcode(ops, state, tracker, updating); - this.didEnter(tryOpcode, updating); - }; - - VM.prototype.enterWithKey = function enterWithKey(key, ops) { - var updating = new _glimmerUtil.LinkedList(); - var tracker = this.stack().pushUpdatableBlock(); - var state = this.capture(); - var tryOpcode = new _glimmerRuntimeLibVmUpdate.TryOpcode(ops, state, tracker, updating); - this.listBlockStack.current.map[key] = tryOpcode; - this.didEnter(tryOpcode, updating); - }; - - VM.prototype.enterList = function enterList(ops) { - var updating = new _glimmerUtil.LinkedList(); - var tracker = this.stack().pushBlockList(updating); - var state = this.capture(); - var artifacts = this.frame.getIterator().artifacts; - var opcode = new _glimmerRuntimeLibVmUpdate.ListBlockOpcode(ops, state, tracker, updating, artifacts); - this.listBlockStack.push(opcode); - this.didEnter(opcode, updating); - }; - - VM.prototype.didEnter = function didEnter(opcode, updating) { - this.updateWith(opcode); - this.updatingOpcodeStack.push(updating); - }; - - VM.prototype.exit = function exit() { - this.stack().popBlock(); - this.updatingOpcodeStack.pop(); - var parent = this.updatingOpcodeStack.current.tail(); - parent.didInitializeChildren(); - }; - - VM.prototype.exitList = function exitList() { - this.exit(); - this.listBlockStack.pop(); - }; - - VM.prototype.updateWith = function updateWith(opcode) { - this.updatingOpcodeStack.current.append(opcode); - }; - - VM.prototype.stack = function stack() { - return this.elementStack; - }; - - VM.prototype.scope = function scope() { - return this.scopeStack.current; - }; - - VM.prototype.dynamicScope = function dynamicScope() { - return this.dynamicScopeStack.current; - }; - - VM.prototype.pushFrame = function pushFrame(block, args, callerScope) { - this.frame.push(block.ops); - if (args) this.frame.setArgs(args); - if (args && args.blocks) this.frame.setBlocks(args.blocks); - if (callerScope) this.frame.setCallerScope(callerScope); - }; - - VM.prototype.pushComponentFrame = function pushComponentFrame(layout, args, callerScope, component, manager, shadow) { - this.frame.push(layout.ops, component, manager, shadow); - if (args) this.frame.setArgs(args); - if (args && args.blocks) this.frame.setBlocks(args.blocks); - if (callerScope) this.frame.setCallerScope(callerScope); - }; - - VM.prototype.pushEvalFrame = function pushEvalFrame(ops) { - this.frame.push(ops); - }; + exports.default = _emberUtils.dictionary(null); +}); +enifed('ember-views/component_lookup', ['exports', 'ember-metal', 'ember-runtime', 'container'], function (exports, _emberMetal, _emberRuntime, _container) { + 'use strict'; - VM.prototype.pushChildScope = function pushChildScope() { - this.scopeStack.push(this.scopeStack.current.child()); - }; + exports.default = _emberRuntime.Object.extend({ + componentFor: function (name, owner, options) { + var fullName = 'component:' + name; + return owner[_container.FACTORY_FOR](fullName, options); + }, - VM.prototype.pushCallerScope = function pushCallerScope() { - this.scopeStack.push(this.scope().getCallerScope()); - }; + layoutFor: function (name, owner, options) { - VM.prototype.pushDynamicScope = function pushDynamicScope() { - var child = this.dynamicScopeStack.current.child(); - this.dynamicScopeStack.push(child); - return child; - }; + var templateFullName = 'template:components/' + name; + return owner.lookup(templateFullName, options); + } + }); +}); +enifed('ember-views/index', ['exports', 'ember-views/system/ext', 'ember-views/system/jquery', 'ember-views/system/utils', 'ember-views/system/event_dispatcher', 'ember-views/component_lookup', 'ember-views/mixins/text_support', 'ember-views/views/core_view', 'ember-views/mixins/class_names_support', 'ember-views/mixins/child_views_support', 'ember-views/mixins/view_state_support', 'ember-views/mixins/view_support', 'ember-views/mixins/action_support', 'ember-views/compat/attrs', 'ember-views/system/lookup_partial', 'ember-views/utils/lookup-component', 'ember-views/system/action_manager', 'ember-views/compat/fallback-view-registry'], function (exports, _emberViewsSystemExt, _emberViewsSystemJquery, _emberViewsSystemUtils, _emberViewsSystemEvent_dispatcher, _emberViewsComponent_lookup, _emberViewsMixinsText_support, _emberViewsViewsCore_view, _emberViewsMixinsClass_names_support, _emberViewsMixinsChild_views_support, _emberViewsMixinsView_state_support, _emberViewsMixinsView_support, _emberViewsMixinsAction_support, _emberViewsCompatAttrs, _emberViewsSystemLookup_partial, _emberViewsUtilsLookupComponent, _emberViewsSystemAction_manager, _emberViewsCompatFallbackViewRegistry) { + /** + @module ember + @submodule ember-views + */ - VM.prototype.pushRootScope = function pushRootScope(self, size) { - var scope = _glimmerRuntimeLibEnvironment.Scope.root(self, size); - this.scopeStack.push(scope); - return scope; - }; + 'use strict'; - VM.prototype.popScope = function popScope() { - this.scopeStack.pop(); - }; + exports.jQuery = _emberViewsSystemJquery.default; + exports.isSimpleClick = _emberViewsSystemUtils.isSimpleClick; + exports.getViewBounds = _emberViewsSystemUtils.getViewBounds; + exports.getViewClientRects = _emberViewsSystemUtils.getViewClientRects; + exports.getViewBoundingClientRect = _emberViewsSystemUtils.getViewBoundingClientRect; + exports.getRootViews = _emberViewsSystemUtils.getRootViews; + exports.getChildViews = _emberViewsSystemUtils.getChildViews; + exports.getViewId = _emberViewsSystemUtils.getViewId; + exports.getViewElement = _emberViewsSystemUtils.getViewElement; + exports.setViewElement = _emberViewsSystemUtils.setViewElement; + exports.STYLE_WARNING = _emberViewsSystemUtils.STYLE_WARNING; + exports.EventDispatcher = _emberViewsSystemEvent_dispatcher.default; + exports.ComponentLookup = _emberViewsComponent_lookup.default; + exports.TextSupport = _emberViewsMixinsText_support.default; + exports.CoreView = _emberViewsViewsCore_view.default; + exports.ClassNamesSupport = _emberViewsMixinsClass_names_support.default; + exports.ChildViewsSupport = _emberViewsMixinsChild_views_support.default; + exports.ViewStateSupport = _emberViewsMixinsView_state_support.default; + exports.ViewMixin = _emberViewsMixinsView_support.default; + exports.dispatchLifeCycleHook = _emberViewsMixinsView_support.dispatchLifeCycleHook; + exports.ActionSupport = _emberViewsMixinsAction_support.default; + exports.MUTABLE_CELL = _emberViewsCompatAttrs.MUTABLE_CELL; + exports.lookupPartial = _emberViewsSystemLookup_partial.default; + exports.hasPartial = _emberViewsSystemLookup_partial.hasPartial; + exports.lookupComponent = _emberViewsUtilsLookupComponent.default; + exports.ActionManager = _emberViewsSystemAction_manager.default; + exports.fallbackViewRegistry = _emberViewsCompatFallbackViewRegistry.default; +}); +// for the side effect of extending Ember.run.queues +enifed('ember-views/mixins/action_support', ['exports', 'ember-utils', 'ember-metal', 'ember-views/compat/attrs'], function (exports, _emberUtils, _emberMetal, _emberViewsCompatAttrs) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; - VM.prototype.popDynamicScope = function popDynamicScope() { - this.dynamicScopeStack.pop(); - }; + function validateAction(component, actionName) { + if (actionName && actionName[_emberViewsCompatAttrs.MUTABLE_CELL]) { + actionName = actionName.value; + } - VM.prototype.newDestroyable = function newDestroyable(d) { - this.stack().newDestroyable(d); - }; + return actionName; + } - /// SCOPE HELPERS + /** + @class ActionSupport + @namespace Ember + @private + */ + exports.default = _emberMetal.Mixin.create({ + /** + 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 + export default Ember.Component.extend({ + click() { + if (this.get('isPlaying')) { + this.sendAction('play'); + } else { + this.sendAction('stop'); + } + } + }); + ``` + The actions "play" and "stop" must be passed to this `play-button` component: + ```handlebars + {{! app/templates/application.hbs }} + {{play-button play=(action "musicStarted") stop=(action "musicStopped")}} + ``` + When the component receives a browser `click` event it translate this + interaction into application-specific semantics ("play" or "stop") and + calls the specified action. + ```javascript + // app/controller/application.js + export default Ember.Controller.extend({ + actions: { + musicStarted() { + // called when the play button is clicked + // and the music started playing + }, + musicStopped() { + // called when the play button is clicked + // and the music stopped playing + } + } + }); + ``` + If no action is passed to `sendAction` a default name of "action" + is assumed. + ```javascript + // app/components/next-button.js + export default Ember.Component.extend({ + click() { + this.sendAction(); + } + }); + ``` + ```handlebars + {{! app/templates/application.hbs }} + {{next-button action=(action "playNextSongInAlbum")}} + ``` + ```javascript + // app/controllers/application.js + App.ApplicationController = Ember.Controller.extend({ + actions: { + playNextSongInAlbum() { + ... + } + } + }); + ``` + @method sendAction + @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]; + } - VM.prototype.getSelf = function getSelf() { - return this.scope().getSelf(); - }; + var actionName = undefined; - VM.prototype.referenceForSymbol = function referenceForSymbol(symbol) { - return this.scope().getSymbol(symbol); - }; + // Send the default action + if (action === undefined) { + action = 'action'; + } + actionName = _emberMetal.get(this, 'attrs.' + action) || _emberMetal.get(this, action); + actionName = validateAction(this, actionName); - VM.prototype.getArgs = function getArgs() { - return this.frame.getArgs(); - }; + // If no action name for that action could be found, just abort. + if (actionName === undefined) { + return; + } - /// EXECUTION + if (typeof actionName === 'function') { + actionName.apply(undefined, contexts); + } else { + this.triggerAction({ + action: actionName, + actionContext: contexts + }); + } + }, - VM.prototype.resume = function resume(opcodes, frame) { - return this.execute(opcodes, function (vm) { - return vm.frame.restore(frame); - }); - }; + send: function (actionName) { + for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } - VM.prototype.execute = function execute(opcodes, initialize) { - _glimmerUtil.LOGGER.debug("[VM] Begin program execution"); - var elementStack = this.elementStack; - var frame = this.frame; - var updatingOpcodeStack = this.updatingOpcodeStack; - var env = this.env; - - elementStack.pushSimpleBlock(); - updatingOpcodeStack.push(new _glimmerUtil.LinkedList()); - frame.push(opcodes); - if (initialize) initialize(this); - var opcode = undefined; - while (frame.hasOpcodes()) { - if (opcode = frame.nextStatement()) { - _glimmerUtil.LOGGER.debug('[VM] OP ' + opcode.type); - _glimmerUtil.LOGGER.trace(opcode); - opcode.evaluate(this); - } - } - _glimmerUtil.LOGGER.debug("[VM] Completed program execution"); - return new _glimmerRuntimeLibVmRenderResult.default(env, updatingOpcodeStack.pop(), elementStack.popBlock()); - }; + var action = this.actions && this.actions[actionName]; - VM.prototype.evaluateOpcode = function evaluateOpcode(opcode) { - opcode.evaluate(this); - }; + if (action) { + var shouldBubble = action.apply(this, args) === true; + if (!shouldBubble) { + return; + } + } - // Make sure you have opcodes that push and pop a scope around this opcode - // if you need to change the scope. + var target = _emberMetal.get(this, 'target'); + if (target) { + target.send.apply(target, arguments); + } else {} + } + }); +}); +enifed('ember-views/mixins/child_views_support', ['exports', 'ember-utils', 'ember-metal', 'ember-views/system/utils'], function (exports, _emberUtils, _emberMetal, _emberViewsSystemUtils) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; - VM.prototype.invokeBlock = function invokeBlock(block, args) { - var compiled = block.compile(this.env); - this.pushFrame(compiled, args); - }; + exports.default = _emberMetal.Mixin.create({ + init: function () { + this._super.apply(this, arguments); + _emberViewsSystemUtils.initChildViews(this); + }, - VM.prototype.invokePartial = function invokePartial(block) { - var compiled = block.compile(this.env); - this.pushFrame(compiled); - }; + /** + Array of child views. You should never edit this array directly. + @property childViews + @type Array + @default [] + @private + */ + childViews: _emberMetal.descriptor({ + configurable: false, + enumerable: false, + get: function () { + return _emberViewsSystemUtils.getChildViews(this); + } + }), - VM.prototype.invokeLayout = function invokeLayout(args, layout, callerScope, component, manager, shadow) { - this.pushComponentFrame(layout, args, callerScope, component, manager, shadow); - }; + appendChild: function (view) { + this.linkChild(view); + _emberViewsSystemUtils.addChildView(this, view); + }, - VM.prototype.evaluateOperand = function evaluateOperand(expr) { - this.frame.setOperand(expr.evaluate(this)); - }; + linkChild: function (instance) { + if (!_emberUtils.getOwner(instance)) { + _emberUtils.setOwner(instance, _emberUtils.getOwner(this)); + } + } + }); +}); +enifed('ember-views/mixins/class_names_support', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-views + */ - VM.prototype.evaluateArgs = function evaluateArgs(args) { - var evaledArgs = this.frame.setArgs(args.evaluate(this)); - this.frame.setOperand(evaledArgs.positional.at(0)); - }; + 'use strict'; - VM.prototype.bindPositionalArgs = function bindPositionalArgs(symbols) { - var args = this.frame.getArgs(); - _glimmerUtil.assert(args, "Cannot bind positional args"); - var positional = args.positional; + var EMPTY_ARRAY = Object.freeze([]); - var scope = this.scope(); - for (var i = 0; i < symbols.length; i++) { - scope.bindSymbol(symbols[i], positional.at(i)); - } - }; + /** + @class ClassNamesSupport + @namespace Ember + @private + */ + exports.default = _emberMetal.Mixin.create({ + concatenatedProperties: ['classNames', 'classNameBindings'], - VM.prototype.bindNamedArgs = function bindNamedArgs(names, symbols) { - var args = this.frame.getArgs(); - var scope = this.scope(); - _glimmerUtil.assert(args, "Cannot bind named args"); - var named = args.named; + init: function () { + this._super.apply(this, arguments); + }, - for (var i = 0; i < names.length; i++) { - scope.bindSymbol(symbols[i], named.get(names[i])); - } - }; + /** + Standard CSS class names to apply to the view's outer element. This + property automatically inherits any class names defined by the view's + superclasses as well. + @property classNames + @type Array + @default ['ember-view'] + @public + */ + classNames: EMPTY_ARRAY, - VM.prototype.bindBlocks = function bindBlocks(names, symbols) { - var blocks = this.frame.getBlocks(); - var scope = this.scope(); - for (var i = 0; i < names.length; i++) { - scope.bindBlock(symbols[i], blocks && blocks[names[i]] || null); - } - }; + /** + A list of properties of the view to apply as class names. If the property + is a string value, the value of that string will be applied as a class + name. + ```javascript + // Applies the 'high' class to the view element + Ember.Component.extend({ + classNameBindings: ['priority'], + priority: 'high' + }); + ``` + If the value of the property is a Boolean, the name of that property is + added as a dasherized class name. + ```javascript + // Applies the 'is-urgent' class to the view element + Ember.Component.extend({ + classNameBindings: ['isUrgent'], + isUrgent: true + }); + ``` + If you would prefer to use a custom value instead of the dasherized + property name, you can pass a binding like this: + ```javascript + // Applies the 'urgent' class to the view element + Ember.Component.extend({ + classNameBindings: ['isUrgent:urgent'], + isUrgent: true + }); + ``` + This list of properties is inherited from the component's superclasses as well. + @property classNameBindings + @type Array + @default [] + @public + */ + classNameBindings: EMPTY_ARRAY + }); +}); +enifed('ember-views/mixins/text_support', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { + /** + @module ember + @submodule ember-views + */ - VM.prototype.bindPartialArgs = function bindPartialArgs(symbol) { - var args = this.frame.getArgs(); - var scope = this.scope(); - _glimmerUtil.assert(args, "Cannot bind named args"); - scope.bindPartialArgs(symbol, args); - }; + 'use strict'; - VM.prototype.bindCallerScope = function bindCallerScope() { - var callerScope = this.frame.getCallerScope(); - var scope = this.scope(); - _glimmerUtil.assert(callerScope, "Cannot bind caller scope"); - scope.bindCallerScope(callerScope); - }; + var KEY_EVENTS = { + 13: 'insertNewline', + 27: 'cancel' + }; - VM.prototype.bindDynamicScope = function bindDynamicScope(names) { - var args = this.frame.getArgs(); - var scope = this.dynamicScope(); - _glimmerUtil.assert(args, "Cannot bind dynamic scope"); - for (var i = 0; i < names.length; i++) { - scope.set(names[i], args.named.get(names[i])); + /** + `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 + value of the field passed in as the only argument unless the value of + the field is empty. In that case, the instance of the field itself is passed + in as the only argument. + + Let's use the pressing of the escape key as an example. If you wanted to + invoke a controller action when a user presses the escape key while on your + field, you would use the `escape-press` attribute on your field like so: + + ```handlebars + {{! application.hbs}} + + {{input escape-press='alertUser'}} + ``` + + ```javascript + App = Ember.Application.create(); + + App.ApplicationController = Ember.Controller.extend({ + actions: { + alertUser: function ( currentValue ) { + alert( 'escape pressed, current value: ' + currentValue ); } - }; - - return VM; - })(); - - exports.default = VM; -}); - -enifed('glimmer-runtime/lib/vm/frame', ['exports'], function (exports) { - 'use strict'; - - var CapturedFrame = function CapturedFrame(operand, args, condition) { - this.operand = operand; - this.args = args; - this.condition = condition; - }; - - exports.CapturedFrame = CapturedFrame; - - var Frame = (function () { - function Frame(ops) { - var component = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; - var manager = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; - var shadow = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3]; - - this.component = component; - this.manager = manager; - this.shadow = shadow; - this.operand = null; - this.immediate = null; - this.args = null; - this.callerScope = null; - this.blocks = null; - this.condition = null; - this.iterator = null; - this.key = null; - this.ops = ops; - this.op = ops.head(); - } + } + }); + ``` + + The following chart is a visual representation of what takes place when the + escape key is pressed in this scenario: + + ``` + The Template + +---------------------------+ + | | + | escape-press='alertUser' | + | | TextSupport Mixin + +----+----------------------+ +-------------------------------+ + | | cancel method | + | escape button pressed | | + +-------------------------------> | checks for the `escape-press` | + | attribute and pulls out the | + +-------------------------------+ | `alertUser` value | + | action name 'alertUser' +-------------------------------+ + | sent to controller + v + Controller + +------------------------------------------ + + | | + | actions: { | + | alertUser: function( currentValue ){ | + | alert( 'the esc key was pressed!' ) | + | } | + | } | + | | + +-------------------------------------------+ + ``` + + Here are the events that we currently support along with the name of the + attribute you would need to use on your field. To reiterate, you would use the + attribute name like so: + + ```handlebars + {{input attribute-name='controllerAction'}} + ``` + + ``` + +--------------------+----------------+ + | | | + | event | attribute name | + +--------------------+----------------+ + | new line inserted | insert-newline | + | | | + | enter key pressed | insert-newline | + | | | + | cancel key pressed | escape-press | + | | | + | focusin | focus-in | + | | | + | focusout | focus-out | + | | | + | keypress | key-press | + | | | + | keyup | key-up | + | | | + | keydown | key-down | + +--------------------+----------------+ + ``` + + @class TextSupport + @namespace Ember + @uses Ember.TargetActionSupport + @extends Ember.Mixin + @private + */ + exports.default = _emberMetal.Mixin.create(_emberRuntime.TargetActionSupport, { + value: '', - Frame.prototype.capture = function capture() { - return new CapturedFrame(this.operand, this.args, this.condition); - }; + attributeBindings: ['autocapitalize', 'autocorrect', 'autofocus', 'disabled', 'form', 'maxlength', 'placeholder', 'readonly', 'required', 'selectionDirection', 'spellcheck', 'tabindex', 'title'], + placeholder: null, + disabled: false, + maxlength: null, - Frame.prototype.restore = function restore(frame) { - this.operand = frame['operand']; - this.args = frame['args']; - this.condition = frame['condition']; - }; + init: function () { + this._super.apply(this, arguments); + this.on('paste', this, this._elementValueDidChange); + this.on('cut', this, this._elementValueDidChange); + this.on('input', this, this._elementValueDidChange); + }, - return Frame; - })(); + /** + The action to be sent when the user presses the return key. + This is similar to the `{{action}}` helper, but is fired when + the user presses the return key when editing a text field, and sends + the value of the field as the context. + @property action + @type String + @default null + @private + */ + action: null, - var FrameStack = (function () { - function FrameStack() { - this.frames = []; - this.frame = undefined; - } + /** + The event that should send the action. + Options are: + * `enter`: the user pressed enter + * `keyPress`: the user pressed a key + @property onEvent + @type String + @default enter + @private + */ + onEvent: 'enter', - FrameStack.prototype.push = function push(ops) { - var component = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; - var manager = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; - var shadow = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3]; + /** + Whether the `keyUp` event that triggers an `action` to be sent continues + propagating to other views. + By default, when the user presses the return key on their keyboard and + the text field has an `action` set, the action will be sent to the view's + controller and the key event will stop propagating. + If you would like parent views to receive the `keyUp` event even after an + action has been dispatched, set `bubbles` to true. + @property bubbles + @type Boolean + @default false + @private + */ + bubbles: false, - var frame = this.frame === undefined ? this.frame = 0 : ++this.frame; - if (this.frames.length <= frame) { - this.frames.push(null); - } - this.frames[frame] = new Frame(ops, component, manager, shadow); - }; + interpretKeyEvents: function (event) { + var map = KEY_EVENTS; + var method = map[event.keyCode]; - FrameStack.prototype.pop = function pop() { - var frames = this.frames; - var frame = this.frame; + this._elementValueDidChange(); + if (method) { + return this[method](event); + } + }, - frames[frame] = null; - this.frame = frame === 0 ? undefined : frame - 1; - }; + _elementValueDidChange: function () { + _emberMetal.set(this, 'value', this.element.value); + }, - FrameStack.prototype.capture = function capture() { - return this.frames[this.frame].capture(); - }; + change: function (event) { + this._elementValueDidChange(event); + }, - FrameStack.prototype.restore = function restore(frame) { - this.frames[this.frame].restore(frame); - }; + /** + Allows you to specify a controller action to invoke when either the `enter` + key is pressed or, in the case of the field being a textarea, when a newline + is inserted. To use this method, give your field an `insert-newline` + attribute. The value of that attribute should be the name of the action + in your controller that you wish to invoke. + For an example on how to use the `insert-newline` attribute, please + reference the example near the top of this file. + @method insertNewline + @param {Event} event + @private + */ + insertNewline: function (event) { + sendAction('enter', this, event); + sendAction('insert-newline', this, event); + }, - FrameStack.prototype.getOps = function getOps() { - return this.frames[this.frame].ops; - }; + /** + Allows you to specify a controller action to invoke when the escape button + is pressed. To use this method, give your field an `escape-press` + attribute. The value of that attribute should be the name of the action + in your controller that you wish to invoke. + For an example on how to use the `escape-press` attribute, please reference + the example near the top of this file. + @method cancel + @param {Event} event + @private + */ + cancel: function (event) { + sendAction('escape-press', this, event); + }, - FrameStack.prototype.getCurrent = function getCurrent() { - return this.frames[this.frame].op; - }; + /** + Allows you to specify a controller action to invoke when a field receives + focus. To use this method, give your field a `focus-in` attribute. The value + of that attribute should be the name of the action in your controller + that you wish to invoke. + For an example on how to use the `focus-in` attribute, please reference the + example near the top of this file. + @method focusIn + @param {Event} event + @private + */ + focusIn: function (event) { + sendAction('focus-in', this, event); + }, - FrameStack.prototype.setCurrent = function setCurrent(op) { - return this.frames[this.frame].op = op; - }; + /** + Allows you to specify a controller action to invoke when a field loses + focus. To use this method, give your field a `focus-out` attribute. The value + of that attribute should be the name of the action in your controller + that you wish to invoke. + For an example on how to use the `focus-out` attribute, please reference the + example near the top of this file. + @method focusOut + @param {Event} event + @private + */ + focusOut: function (event) { + this._elementValueDidChange(event); + sendAction('focus-out', this, event); + }, - FrameStack.prototype.getOperand = function getOperand() { - return this.frames[this.frame].operand; - }; + /** + Allows you to specify a controller action to invoke when a key is pressed. + To use this method, give your field a `key-press` attribute. The value of + that attribute should be the name of the action in your controller you + that wish to invoke. + For an example on how to use the `key-press` attribute, please reference the + example near the top of this file. + @method keyPress + @param {Event} event + @private + */ + keyPress: function (event) { + sendAction('key-press', this, event); + }, - FrameStack.prototype.setOperand = function setOperand(operand) { - return this.frames[this.frame].operand = operand; - }; + /** + Allows you to specify a controller action to invoke when a key-up event is + fired. To use this method, give your field a `key-up` attribute. The value + of that attribute should be the name of the action in your controller + that you wish to invoke. + For an example on how to use the `key-up` attribute, please reference the + example near the top of this file. + @method keyUp + @param {Event} event + @private + */ + keyUp: function (event) { + this.interpretKeyEvents(event); - FrameStack.prototype.getImmediate = function getImmediate() { - return this.frames[this.frame].immediate; - }; + this.sendAction('key-up', _emberMetal.get(this, 'value'), event); + }, - FrameStack.prototype.setImmediate = function setImmediate(value) { - return this.frames[this.frame].immediate = value; - }; + /** + Allows you to specify a controller action to invoke when a key-down event is + fired. To use this method, give your field a `key-down` attribute. The value + of that attribute should be the name of the action in your controller that + you wish to invoke. + For an example on how to use the `key-down` attribute, please reference the + example near the top of this file. + @method keyDown + @param {Event} event + @private + */ + keyDown: function (event) { + this.sendAction('key-down', _emberMetal.get(this, 'value'), event); + } + }); - FrameStack.prototype.getArgs = function getArgs() { - return this.frames[this.frame].args; - }; + // In principle, this shouldn't be necessary, but the legacy + // sendAction semantics for TextField are different from + // the component semantics so this method normalizes them. + function sendAction(eventName, view, event) { + var action = _emberMetal.get(view, 'attrs.' + eventName) || _emberMetal.get(view, eventName); + var on = _emberMetal.get(view, 'onEvent'); + var value = _emberMetal.get(view, 'value'); - FrameStack.prototype.setArgs = function setArgs(args) { - var frame = this.frames[this.frame]; - return frame.args = args; - }; + // back-compat support for keyPress as an event name even though + // it's also a method name that consumes the event (and therefore + // incompatible with sendAction semantics). + if (on === eventName || on === 'keyPress' && eventName === 'key-press') { + view.sendAction('action', value); + } - FrameStack.prototype.getCondition = function getCondition() { - return this.frames[this.frame].condition; - }; + view.sendAction(eventName, value); - FrameStack.prototype.setCondition = function setCondition(condition) { - return this.frames[this.frame].condition = condition; - }; + if (action || on === eventName) { + if (!_emberMetal.get(view, 'bubbles')) { + event.stopPropagation(); + } + } + } +}); +enifed('ember-views/mixins/view_state_support', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-views + */ + 'use strict'; - FrameStack.prototype.getIterator = function getIterator() { - return this.frames[this.frame].iterator; - }; + exports.default = _emberMetal.Mixin.create({ + _transitionTo: function (state) { + var priorState = this._currentState; + var currentState = this._currentState = this._states[state]; + this._state = state; - FrameStack.prototype.setIterator = function setIterator(iterator) { - return this.frames[this.frame].iterator = iterator; - }; + if (priorState && priorState.exit) { + priorState.exit(this); + } + if (currentState.enter) { + currentState.enter(this); + } + } + }); +}); +enifed('ember-views/mixins/view_support', ['exports', 'ember-utils', 'ember-metal', 'ember-environment', 'ember-views/system/utils', 'ember-runtime/system/core_object', 'ember-views/system/jquery'], function (exports, _emberUtils, _emberMetal, _emberEnvironment, _emberViewsSystemUtils, _emberRuntimeSystemCore_object, _emberViewsSystemJquery) { + 'use strict'; - FrameStack.prototype.getKey = function getKey() { - return this.frames[this.frame].key; - }; + var _Mixin$create; - FrameStack.prototype.setKey = function setKey(key) { - return this.frames[this.frame].key = key; - }; + function K() { + return this; + } - FrameStack.prototype.getBlocks = function getBlocks() { - return this.frames[this.frame].blocks; - }; + var dispatchLifeCycleHook = function (component, hook, oldAttrs, newAttrs) { + component.trigger(hook, { attrs: newAttrs, oldAttrs: oldAttrs, newAttrs: newAttrs }); + }; - FrameStack.prototype.setBlocks = function setBlocks(blocks) { - return this.frames[this.frame].blocks = blocks; - }; + exports.dispatchLifeCycleHook = dispatchLifeCycleHook; - FrameStack.prototype.getCallerScope = function getCallerScope() { - return this.frames[this.frame].callerScope; - }; + /** + @class ViewMixin + @namespace Ember + @private + */ + exports.default = _emberMetal.Mixin.create((_Mixin$create = { + concatenatedProperties: ['attributeBindings'] + }, _Mixin$create[_emberRuntimeSystemCore_object.POST_INIT] = function () { + dispatchLifeCycleHook(this, 'didInitAttrs', undefined, this.attrs); + dispatchLifeCycleHook(this, 'didReceiveAttrs', undefined, this.attrs); + }, _Mixin$create.nearestOfType = function (klass) { + var view = this.parentView; + var isOfType = klass instanceof _emberMetal.Mixin ? function (view) { + return klass.detect(view); + } : function (view) { + return klass.detect(view.constructor); + }; - FrameStack.prototype.setCallerScope = function setCallerScope(callerScope) { - return this.frames[this.frame].callerScope = callerScope; - }; + while (view) { + if (isOfType(view)) { + return view; + } + view = view.parentView; + } + }, _Mixin$create.nearestWithProperty = function (property) { + var view = this.parentView; - FrameStack.prototype.getComponent = function getComponent() { - return this.frames[this.frame].component; - }; + while (view) { + if (property in view) { + return view; + } + view = view.parentView; + } + }, _Mixin$create.rerender = function () { + return this._currentState.rerender(this); + }, _Mixin$create.element = _emberMetal.descriptor({ + configurable: false, + enumerable: false, + get: function () { + return this.renderer.getElement(this); + } + }), _Mixin$create.$ = function (sel) { + if (this.element) { + return sel ? _emberViewsSystemJquery.default(sel, this.element) : _emberViewsSystemJquery.default(this.element); + } + }, _Mixin$create.appendTo = function (selector) { + var env = this._environment || _emberEnvironment.environment; + var target = undefined; - FrameStack.prototype.getManager = function getManager() { - return this.frames[this.frame].manager; - }; + if (env.hasDOM) { + target = typeof selector === 'string' ? document.querySelector(selector) : selector; + } else { + target = selector; + } - FrameStack.prototype.getShadow = function getShadow() { - return this.frames[this.frame].shadow; - }; + this.renderer.appendTo(this, target); - FrameStack.prototype.goto = function goto(op) { - this.setCurrent(op); - }; + return this; + }, _Mixin$create.renderToElement = function () { + var tagName = arguments.length <= 0 || arguments[0] === undefined ? 'body' : arguments[0]; - FrameStack.prototype.hasOpcodes = function hasOpcodes() { - return this.frame !== undefined; - }; + var element = this.renderer.createElement(tagName); - FrameStack.prototype.nextStatement = function nextStatement() { - var op = this.frames[this.frame].op; - var ops = this.getOps(); - if (op) { - this.setCurrent(ops.nextNode(op)); - return op; - } else { - this.pop(); - return null; - } - }; + this.renderer.appendTo(this, element); + return element; + }, _Mixin$create.replaceIn = function (selector) { + var target = _emberViewsSystemJquery.default(selector); - return FrameStack; - })(); + this.renderer.replaceIn(this, target[0]); - exports.FrameStack = FrameStack; -}); + return this; + }, _Mixin$create.append = function () { + return this.appendTo(document.body); + }, _Mixin$create.elementId = null, _Mixin$create.findElementInParentElement = function (parentElem) { + var id = '#' + this.elementId; + return _emberViewsSystemJquery.default(id)[0] || _emberViewsSystemJquery.default(id, parentElem)[0]; + }, _Mixin$create.willInsertElement = K, _Mixin$create.didInsertElement = K, _Mixin$create.willClearRender = K, _Mixin$create.destroy = function () { + this._super.apply(this, arguments); + this._currentState.destroy(this); + }, _Mixin$create.willDestroyElement = K, _Mixin$create.parentViewDidChange = K, _Mixin$create.tagName = null, _Mixin$create.init = function () { + this._super.apply(this, arguments); -enifed('glimmer-runtime/lib/vm/render-result', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/vm/update'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibVmUpdate) { - 'use strict'; + if (!this.elementId && this.tagName !== '') { + this.elementId = _emberUtils.guidFor(this); + } - var RenderResult = (function () { - function RenderResult(env, updating, bounds) { - this.env = env; - this.updating = updating; - this.bounds = bounds; - } + // if we find an `eventManager` property, deopt the + // `EventDispatcher`'s `canDispatchToEventManager` property + // if `null` + if (this.eventManager) { + var owner = _emberUtils.getOwner(this); + var dispatcher = owner && owner.lookup('event_dispatcher:main'); - RenderResult.prototype.rerender = function rerender() { - var _ref = arguments.length <= 0 || arguments[0] === undefined ? { alwaysRevalidate: false } : arguments[0]; + if (dispatcher && dispatcher.canDispatchToEventManager === null) { + dispatcher.canDispatchToEventManager = true; + } + } + }, _Mixin$create.__defineNonEnumerable = function (property) { + this[property.name] = property.descriptor.value; + }, _Mixin$create.handleEvent = function (eventName, evt) { + return this._currentState.handleEvent(this, eventName, evt); + }, _Mixin$create)); +}); - var _ref$alwaysRevalidate = _ref.alwaysRevalidate; - var alwaysRevalidate = _ref$alwaysRevalidate === undefined ? false : _ref$alwaysRevalidate; - var env = this.env; - var updating = this.updating; +// Already warned in init - var vm = new _glimmerRuntimeLibVmUpdate.default(env, { alwaysRevalidate: alwaysRevalidate }); - vm.execute(updating, this); - }; +// .......................................................... +// TEMPLATE SUPPORT +// - RenderResult.prototype.parentElement = function parentElement() { - return this.bounds.parentElement(); - }; +/** + Return the nearest ancestor that is an instance of the provided + class or mixin. + @method nearestOfType + @param {Class,Mixin} klass Subclass of Ember.View (or Ember.View itself), + or an instance of Ember.Mixin. + @return Ember.View + @deprecated use `yield` and contextual components for composition instead. + @private +*/ - RenderResult.prototype.firstNode = function firstNode() { - return this.bounds.firstNode(); - }; +/** + Return the nearest ancestor that has a given property. + @method nearestWithProperty + @param {String} property A property name + @return Ember.View + @deprecated use `yield` and contextual components for composition instead. + @private +*/ - RenderResult.prototype.lastNode = function lastNode() { - return this.bounds.lastNode(); - }; +/** + Renders the view again. This will work regardless of whether the + view is already in the DOM or not. If the view is in the DOM, the + rendering process will be deferred to give bindings a chance + to synchronize. + If children were added during the rendering process using `appendChild`, + `rerender` will remove them, because they will be added again + if needed by the next `render`. + In general, if the display of your view changes, you should modify + the DOM element directly instead of manually calling `rerender`, which can + be slow. + @method rerender + @public +*/ - RenderResult.prototype.opcodes = function opcodes() { - return this.updating; - }; +// .......................................................... +// ELEMENT SUPPORT +// - RenderResult.prototype.handleException = function handleException() { - throw "this should never happen"; - }; +/** + Returns the current DOM element for the view. + @property element + @type DOMElement + @public +*/ - RenderResult.prototype.destroy = function destroy() { - this.bounds.destroy(); - _glimmerRuntimeLibBounds.clear(this.bounds); - }; +/** + Returns a jQuery object for this view's element. If you pass in a selector + string, this method will return a jQuery object, using the current element + as its buffer. + For example, calling `view.$('li')` will return a jQuery object containing + all of the `li` elements inside the DOM element of this view. + @method $ + @param {String} [selector] a jQuery-compatible selector string + @return {jQuery} the jQuery object for the DOM node + @public +*/ - return RenderResult; - })(); +/** + Appends the view's element to the specified parent element. + Note that this method just schedules the view to be appended; the DOM + element will not be appended to the given element until all bindings have + finished synchronizing. + This is not typically a function that you will need to call directly when + building your application. If you do need to use `appendTo`, be sure that + the target element you are providing is associated with an `Ember.Application` + and does not have an ancestor element that is associated with an Ember view. + @method appendTo + @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object + @return {Ember.View} receiver + @private +*/ - exports.default = RenderResult; -}); +/** + 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 + let element = view.renderToElement(); + element.tagName; // => "BODY" + ``` + You can override the kind of element rendered into and returned by + specifying an optional tag name as the first argument. + ```js + let element = view.renderToElement('table'); + element.tagName; // => "TABLE" + ``` + This method is useful if you want to render the view into an element that + is not in the document's body. Instead, a new `body` element, detached from + the DOM is returned. FastBoot uses this to serialize the rendered view into + a string for transmission over the network. + ```js + app.visit('/').then(function(instance) { + let element; + Ember.run(function() { + element = renderToElement(instance); + }); + res.send(serialize(element)); + }); + ``` + @method renderToElement + @param {String} tagName The tag of the element to create and render into. Defaults to "body". + @return {HTMLBodyElement} element + @deprecated Use appendTo instead. + @private +*/ -enifed('glimmer-runtime/lib/vm/update', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/builder', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/vm/append'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibBuilder, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibVmAppend) { - 'use strict'; +/** + Replaces the content of the specified parent element with this view's + element. If the view does not have an HTML representation yet, + the element will be generated automatically. + Note that this method just schedules the view to be appended; the DOM + element will not be appended to the given element until all bindings have + finished synchronizing + @method replaceIn + @param {String|DOMElement|jQuery} target A selector, element, HTML string, or jQuery object + @return {Ember.View} received + @private +*/ - var UpdatingVM = (function () { - function UpdatingVM(env, _ref) { - var _ref$alwaysRevalidate = _ref.alwaysRevalidate; - var alwaysRevalidate = _ref$alwaysRevalidate === undefined ? false : _ref$alwaysRevalidate; +/** + Appends the view's element to the document body. If the view does + not have an HTML representation yet + the element will be generated automatically. + If your application uses the `rootElement` property, you must append + the view within that element. Rendering views outside of the `rootElement` + is not supported. + Note that this method just schedules the view to be appended; the DOM + element will not be appended to the document body until all bindings have + finished synchronizing. + @method append + @return {Ember.View} receiver + @private +*/ - this.frameStack = new _glimmerUtil.Stack(); - this.env = env; - this.dom = env.getDOM(); - this.alwaysRevalidate = alwaysRevalidate; - } +/** + The HTML `id` of the view's element in the DOM. You can provide this + value yourself but it must be unique (just as in HTML): + ```handlebars + {{my-component elementId="a-really-cool-id"}} + ``` + If not manually set a default value will be provided by the framework. + Once rendered an element's `elementId` is considered immutable and you + should never change it. If you need to compute a dynamic value for the + `elementId`, you should do this when the component or element is being + instantiated: + ```javascript + export default Ember.Component.extend({ + init() { + this._super(...arguments); + let index = this.get('index'); + this.set('elementId', 'component-id' + index); + } + }); + ``` + @property elementId + @type String + @public +*/ - UpdatingVM.prototype.execute = function execute(opcodes, handler) { - var frameStack = this.frameStack; +/** + Attempts to discover the element in the parent element. The default + implementation looks for an element with an ID of `elementId` (or the + view's guid if `elementId` is null). You can override this method to + provide your own form of lookup. For example, if you want to discover your + element using a CSS class name instead of an ID. + @method findElementInParentElement + @param {DOMElement} parentElement The parent's DOM element + @return {DOMElement} The discovered element + @private +*/ - this.try(opcodes, handler); - while (true) { - if (frameStack.isEmpty()) break; - var opcode = this.frameStack.current.nextStatement(); - if (opcode === null) { - this.frameStack.pop(); - continue; - } - _glimmerUtil.LOGGER.debug('[VM] OP ' + opcode.type); - _glimmerUtil.LOGGER.trace(opcode); - opcode.evaluate(this); - } - }; +/** + Called when a view is going to insert an element into the DOM. + @event willInsertElement + @public +*/ - UpdatingVM.prototype.goto = function goto(op) { - this.frameStack.current.goto(op); - }; +/** + Called when the element of the view has been inserted into the DOM. + Override this function to do any set up that requires an element + in the document body. + When a view has children, didInsertElement will be called on the + child view(s) first and on itself afterwards. + @event didInsertElement + @public +*/ - UpdatingVM.prototype.try = function _try(ops, handler) { - this.frameStack.push(new UpdatingVMFrame(this, ops, handler)); - }; +/** + Called when the view is about to rerender, but before anything has + been torn down. This is a good opportunity to tear down any manual + observers you have installed based on the DOM state + @event willClearRender + @public +*/ - UpdatingVM.prototype.throw = function _throw() { - this.frameStack.current.handleException(); - this.frameStack.pop(); - }; +/** + You must call `destroy` on a view to destroy the view (and all of its + child views). This will remove the view from any parent node, then make + sure that the DOM element managed by the view can be released by the + memory manager. + @method destroy + @private +*/ - UpdatingVM.prototype.evaluateOpcode = function evaluateOpcode(opcode) { - opcode.evaluate(this); - }; +/** + Called when the element of the view is going to be destroyed. Override + this function to do any teardown that requires an element, like removing + event listeners. + Please note: any property changes made during this event will have no + effect on object observers. + @event willDestroyElement + @public +*/ - return UpdatingVM; - })(); +/** + Called when the parentView property has changed. + @event parentViewDidChange + @private +*/ - exports.default = UpdatingVM; +// .......................................................... +// STANDARD RENDER PROPERTIES +// - var BlockOpcode = (function (_UpdatingOpcode) { - babelHelpers.inherits(BlockOpcode, _UpdatingOpcode); +/** + Tag name for the view's outer element. The tag name is only used when an + element is first created. If you change the `tagName` for an element, you + must destroy and recreate the view element. + By default, the render buffer will use a `
    ` tag for views. + @property tagName + @type String + @default null + @public +*/ - function BlockOpcode(ops, state, bounds, children) { - _UpdatingOpcode.call(this); - this.type = "block"; - this.next = null; - this.prev = null; - var env = state.env; - var scope = state.scope; - var dynamicScope = state.dynamicScope; - var frame = state.frame; +// We leave this null by default so we can tell the difference between +// the default case and a user-specified tag. - this.ops = ops; - this.children = children; - this.env = env; - this.scope = scope; - this.dynamicScope = dynamicScope; - this.frame = frame; - this.bounds = bounds; - } +// ....................................................... +// CORE DISPLAY METHODS +// - BlockOpcode.prototype.parentElement = function parentElement() { - return this.bounds.parentElement(); - }; +/** + Setup a view, but do not finish waking it up. + * configure `childViews` + * register the view with the global views hash, which is used for event + dispatch + @method init + @private +*/ - BlockOpcode.prototype.firstNode = function firstNode() { - return this.bounds.firstNode(); - }; +// ....................................................... +// EVENT HANDLING +// - BlockOpcode.prototype.lastNode = function lastNode() { - return this.bounds.lastNode(); - }; +/** + Handle events from `Ember.EventDispatcher` + @method handleEvent + @param eventName {String} + @param evt {Event} + @private +*/ +enifed("ember-views/system/action_manager", ["exports"], function (exports) { + /** + @module ember + @submodule ember-views + */ - BlockOpcode.prototype.evaluate = function evaluate(vm) { - vm.try(this.children, null); - }; + "use strict"; - BlockOpcode.prototype.destroy = function destroy() { - this.bounds.destroy(); - }; + exports.default = ActionManager; - BlockOpcode.prototype.didDestroy = function didDestroy() { - this.env.didDestroy(this.bounds); - }; + function ActionManager() {} - BlockOpcode.prototype.toJSON = function toJSON() { - var begin = this.ops.head(); - var end = this.ops.tail(); - var details = _glimmerUtil.dict(); - details["guid"] = '' + this._guid; - details["begin"] = begin.inspect(); - details["end"] = end.inspect(); - return { - guid: this._guid, - type: this.type, - details: details, - children: this.children.toArray().map(function (op) { - return op.toJSON(); - }) - }; - }; + /** + Global action id hash. + + @private + @property registeredActions + @type Object + */ + ActionManager.registeredActions = {}; +}); +enifed('ember-views/system/event_dispatcher', ['exports', 'ember-utils', 'ember-metal', 'ember-runtime', 'ember-views/system/jquery', 'ember-views/system/action_manager', 'ember-environment', 'ember-views/compat/fallback-view-registry'], function (exports, _emberUtils, _emberMetal, _emberRuntime, _emberViewsSystemJquery, _emberViewsSystemAction_manager, _emberEnvironment, _emberViewsCompatFallbackViewRegistry) { + /** + @module ember + @submodule ember-views + */ - return BlockOpcode; - })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); + 'use strict'; - exports.BlockOpcode = BlockOpcode; + var ROOT_ELEMENT_CLASS = 'ember-application'; + var ROOT_ELEMENT_SELECTOR = '.' + ROOT_ELEMENT_CLASS; - var TryOpcode = (function (_BlockOpcode) { - babelHelpers.inherits(TryOpcode, _BlockOpcode); + /** + `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 + called. + + @class EventDispatcher + @namespace Ember + @private + @extends Ember.Object + */ + exports.default = _emberRuntime.Object.extend({ - function TryOpcode(ops, state, bounds, children) { - _BlockOpcode.call(this, ops, state, bounds, children); - this.type = "try"; - this.tag = this._tag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); + /** + The set of events names (and associated handler function names) to be setup + and dispatched by the `EventDispatcher`. Modifications to this list can be done + at setup time, generally via the `Ember.Application.customEvents` hash. + To add new events to be listened to: + ```javascript + let App = Ember.Application.create({ + customEvents: { + paste: 'paste' } + }); + ``` + To prevent default events from being listened to: + ```javascript + let App = Ember.Application.create({ + customEvents: { + mouseenter: null, + mouseleave: null + } + }); + ``` + @property events + @type Object + @private + */ + events: { + touchstart: 'touchStart', + touchmove: 'touchMove', + touchend: 'touchEnd', + touchcancel: 'touchCancel', + keydown: 'keyDown', + keyup: 'keyUp', + keypress: 'keyPress', + mousedown: 'mouseDown', + mouseup: 'mouseUp', + contextmenu: 'contextMenu', + click: 'click', + dblclick: 'doubleClick', + mousemove: 'mouseMove', + focusin: 'focusIn', + focusout: 'focusOut', + mouseenter: 'mouseEnter', + mouseleave: 'mouseLeave', + submit: 'submit', + input: 'input', + change: 'change', + dragstart: 'dragStart', + drag: 'drag', + dragenter: 'dragEnter', + dragleave: 'dragLeave', + dragover: 'dragOver', + drop: 'drop', + dragend: 'dragEnd' + }, - TryOpcode.prototype.didInitializeChildren = function didInitializeChildren() { - this._tag.update(_glimmerReference.combineSlice(this.children)); - }; - - TryOpcode.prototype.evaluate = function evaluate(vm) { - vm.try(this.children, this); - }; - - TryOpcode.prototype.handleException = function handleException() { - var env = this.env; - var scope = this.scope; - var ops = this.ops; - var dynamicScope = this.dynamicScope; - var frame = this.frame; - - var elementStack = _glimmerRuntimeLibBuilder.ElementStack.resume(this.env, this.bounds, this.bounds.reset(env)); - var vm = new _glimmerRuntimeLibVmAppend.default(env, scope, dynamicScope, elementStack); - var result = vm.resume(ops, frame); - this.children = result.opcodes(); - this.didInitializeChildren(); - }; - - TryOpcode.prototype.toJSON = function toJSON() { - var json = _BlockOpcode.prototype.toJSON.call(this); - var begin = this.ops.head(); - var end = this.ops.tail(); - json["details"]["begin"] = JSON.stringify(begin.inspect()); - json["details"]["end"] = JSON.stringify(end.inspect()); - return _BlockOpcode.prototype.toJSON.call(this); - }; + /** + The root DOM element to which event listeners should be attached. Event + listeners will be attached to the document unless this is overridden. + Can be specified as a DOMElement or a selector string. + The default body is a string since this may be evaluated before document.body + exists in the DOM. + @private + @property rootElement + @type DOMElement + @default 'body' + */ + rootElement: 'body', - return TryOpcode; - })(BlockOpcode); + /** + It enables events to be dispatched to the view's `eventManager.` When present, + this object takes precedence over handling of events on the view itself. + Note that most Ember applications do not use this feature. If your app also + does not use it, consider setting this property to false to gain some performance + improvement by allowing the EventDispatcher to skip the search for the + `eventManager` on the view tree. + ```javascript + let EventDispatcher = Em.EventDispatcher.extend({ + events: { + click : 'click', + focusin : 'focusIn', + focusout : 'focusOut', + change : 'change' + }, + canDispatchToEventManager: false + }); + container.register('event_dispatcher:main', EventDispatcher); + ``` + @property canDispatchToEventManager + @type boolean + @default false + @since 1.7.0 + @private + */ + canDispatchToEventManager: null, - exports.TryOpcode = TryOpcode; + init: function () { + this._super(); + }, - var ListRevalidationDelegate = (function () { - function ListRevalidationDelegate(opcode, marker) { - this.opcode = opcode; - this.marker = marker; - this.didInsert = false; - this.didDelete = false; - this.map = opcode.map; - this.updating = opcode['children']; - } + /** + Sets up event listeners for standard browser events. + This will be called after the browser sends a `DOMContentReady` event. By + default, it will set up all of the listeners on the document body. If you + would like to register the listeners on a different element, set the event + dispatcher's `root` property. + @private + @method setup + @param addedEvents {Object} + */ + setup: function (addedEvents, rootElement) { + var event = undefined; + var events = this._finalEvents = _emberUtils.assign({}, _emberMetal.get(this, 'events'), addedEvents); - ListRevalidationDelegate.prototype.insert = function insert(key, item, memo, before) { - var map = this.map; - var opcode = this.opcode; - var updating = this.updating; + if (_emberMetal.isNone(rootElement)) { + rootElement = _emberMetal.get(this, 'rootElement'); + } else { + _emberMetal.set(this, 'rootElement', rootElement); + } - var nextSibling = null; - var reference = null; - if (before) { - reference = map[before]; - nextSibling = reference.bounds.firstNode(); - } else { - nextSibling = this.marker; - } - var vm = opcode.vmForInsertion(nextSibling); - var tryOpcode = undefined; - vm.execute(opcode.ops, function (vm) { - vm.frame.setArgs(_glimmerRuntimeLibCompiledExpressionsArgs.EvaluatedArgs.positional([item, memo])); - vm.frame.setOperand(item); - vm.frame.setCondition(new _glimmerReference.ConstReference(true)); - vm.frame.setKey(key); - var state = vm.capture(); - var tracker = vm.stack().pushUpdatableBlock(); - tryOpcode = new TryOpcode(opcode.ops, state, tracker, vm.updatingOpcodeStack.current); - }); - tryOpcode.didInitializeChildren(); - updating.insertBefore(tryOpcode, reference); - map[key] = tryOpcode; - this.didInsert = true; - }; + rootElement = _emberViewsSystemJquery.default(rootElement); - ListRevalidationDelegate.prototype.retain = function retain(key, item, memo) {}; + rootElement.addClass(ROOT_ELEMENT_CLASS); - ListRevalidationDelegate.prototype.move = function move(key, item, memo, before) { - var map = this.map; - var updating = this.updating; + if (!rootElement.is(ROOT_ELEMENT_SELECTOR)) { + throw new TypeError('Unable to add \'' + ROOT_ELEMENT_CLASS + '\' class to root element (' + (rootElement.selector || rootElement[0].tagName) + '). Make sure you set rootElement to the body or an element in the body.'); + } - var entry = map[key]; - var reference = map[before] || null; - if (before) { - _glimmerRuntimeLibBounds.move(entry, reference.firstNode()); - } else { - _glimmerRuntimeLibBounds.move(entry, this.marker); - } - updating.remove(entry); - updating.insertBefore(entry, reference); - }; + for (event in events) { + if (events.hasOwnProperty(event)) { + this.setupHandler(rootElement, event, events[event]); + } + } + }, - ListRevalidationDelegate.prototype.delete = function _delete(key) { - var map = this.map; + /** + Registers an event listener on the rootElement. If the given event is + triggered, the provided event handler will be triggered on the target view. + If the target view does not implement the event handler, or if the handler + returns `false`, the parent view will be called. The event will continue to + bubble to each successive parent view until it reaches the top. + @private + @method setupHandler + @param {Element} rootElement + @param {String} event the browser-originated event to listen to + @param {String} eventName the name of the method to call on the view + */ + setupHandler: function (rootElement, event, eventName) { + var self = this; - var opcode = map[key]; - opcode.didDestroy(); - _glimmerRuntimeLibBounds.clear(opcode); - this.updating.remove(opcode); - delete map[key]; - this.didDelete = true; - }; + var owner = _emberUtils.getOwner(this); + var viewRegistry = owner && owner.lookup('-view-registry:main') || _emberViewsCompatFallbackViewRegistry.default; - ListRevalidationDelegate.prototype.done = function done() { - this.opcode.didInitializeChildren(this.didInsert || this.didDelete); - }; + if (eventName === null) { + return; + } - return ListRevalidationDelegate; - })(); + rootElement.on(event + '.ember', '.ember-view', function (evt, triggeringManager) { + var view = viewRegistry[this.id]; + var result = true; - var ListBlockOpcode = (function (_BlockOpcode2) { - babelHelpers.inherits(ListBlockOpcode, _BlockOpcode2); + var manager = self.canDispatchToEventManager ? self._findNearestEventManager(view, eventName) : null; - function ListBlockOpcode(ops, state, bounds, children, artifacts) { - _BlockOpcode2.call(this, ops, state, bounds, children); - this.type = "list-block"; - this.map = _glimmerUtil.dict(); - this.lastIterated = _glimmerReference.INITIAL; - this.artifacts = artifacts; - var _tag = this._tag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); - this.tag = _glimmerReference.combine([artifacts.tag, _tag]); + if (manager && manager !== triggeringManager) { + result = self._dispatchEvent(manager, evt, eventName, view); + } else if (view) { + result = self._bubbleEvent(view, evt, eventName); } - ListBlockOpcode.prototype.didInitializeChildren = function didInitializeChildren() { - var listDidChange = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0]; - - this.lastIterated = this.artifacts.tag.value(); - if (listDidChange) { - this._tag.update(_glimmerReference.combineSlice(this.children)); - } - }; - - ListBlockOpcode.prototype.evaluate = function evaluate(vm) { - var artifacts = this.artifacts; - var lastIterated = this.lastIterated; - - if (!artifacts.tag.validate(lastIterated)) { - var bounds = this.bounds; - var dom = vm.dom; - - var marker = dom.createComment(''); - dom.insertAfter(bounds.parentElement(), marker, bounds.lastNode()); - var target = new ListRevalidationDelegate(this, marker); - var synchronizer = new _glimmerReference.IteratorSynchronizer({ target: target, artifacts: artifacts }); - synchronizer.sync(); - this.parentElement().removeChild(marker); - } - // Run now-updated updating opcodes - _BlockOpcode2.prototype.evaluate.call(this, vm); - }; + return result; + }); - ListBlockOpcode.prototype.vmForInsertion = function vmForInsertion(nextSibling) { - var env = this.env; - var scope = this.scope; - var dynamicScope = this.dynamicScope; + rootElement.on(event + '.ember', '[data-ember-action]', function (evt) { + var attributes = evt.currentTarget.attributes; - var elementStack = _glimmerRuntimeLibBuilder.ElementStack.forInitialRender(this.env, this.bounds.parentElement(), nextSibling); - return new _glimmerRuntimeLibVmAppend.default(env, scope, dynamicScope, elementStack); - }; + for (var i = 0; i < attributes.length; i++) { + var attr = attributes.item(i); + var attrName = attr.name; - ListBlockOpcode.prototype.toJSON = function toJSON() { - var json = _BlockOpcode2.prototype.toJSON.call(this); - var map = this.map; - var inner = Object.keys(map).map(function (key) { - return JSON.stringify(key) + ': ' + map[key]._guid; - }).join(", "); - json["details"]["map"] = '{' + inner + '}'; - return json; - }; + if (attrName.lastIndexOf('data-ember-action-', 0) !== -1) { + var action = _emberViewsSystemAction_manager.default.registeredActions[attr.value]; - return ListBlockOpcode; - })(BlockOpcode); + if (action.eventName === eventName) { + action.handler(evt); + } + } + } + }); + }, - exports.ListBlockOpcode = ListBlockOpcode; + _findNearestEventManager: function (view, eventName) { + var manager = null; - var UpdatingVMFrame = (function () { - function UpdatingVMFrame(vm, ops, handler) { - this.vm = vm; - this.ops = ops; - this.current = ops.head(); - this.exceptionHandler = handler; + while (view) { + manager = _emberMetal.get(view, 'eventManager'); + if (manager && manager[eventName]) { + break; } - UpdatingVMFrame.prototype.goto = function goto(op) { - this.current = op; - }; - - UpdatingVMFrame.prototype.nextStatement = function nextStatement() { - var current = this.current; - var ops = this.ops; + view = _emberMetal.get(view, 'parentView'); + } - if (current) this.current = ops.nextNode(current); - return current; - }; + return manager; + }, - UpdatingVMFrame.prototype.handleException = function handleException() { - this.exceptionHandler.handleException(); - }; + _dispatchEvent: function (object, evt, eventName, view) { + var result = true; - return UpdatingVMFrame; - })(); -}); + var handler = object[eventName]; + if (typeof handler === 'function') { + result = _emberMetal.run(object, handler, evt, view); + // Do not preventDefault in eventManagers. + evt.stopPropagation(); + } else { + result = this._bubbleEvent(view, evt, eventName); + } -enifed('glimmer-util/index', ['exports', 'glimmer-util/lib/namespaces', 'glimmer-util/lib/platform-utils', 'glimmer-util/lib/assert', 'glimmer-util/lib/logger', 'glimmer-util/lib/object-utils', 'glimmer-util/lib/guid', 'glimmer-util/lib/collections', 'glimmer-util/lib/list-utils'], function (exports, _glimmerUtilLibNamespaces, _glimmerUtilLibPlatformUtils, _glimmerUtilLibAssert, _glimmerUtilLibLogger, _glimmerUtilLibObjectUtils, _glimmerUtilLibGuid, _glimmerUtilLibCollections, _glimmerUtilLibListUtils) { - 'use strict'; + return result; + }, - exports.getAttrNamespace = _glimmerUtilLibNamespaces.getAttrNamespace; - exports.Option = _glimmerUtilLibPlatformUtils.Option; - exports.Maybe = _glimmerUtilLibPlatformUtils.Maybe; - exports.Opaque = _glimmerUtilLibPlatformUtils.Opaque; - exports.assert = _glimmerUtilLibAssert.default; - exports.LOGGER = _glimmerUtilLibLogger.default; - exports.Logger = _glimmerUtilLibLogger.Logger; - exports.LogLevel = _glimmerUtilLibLogger.LogLevel; - exports.assign = _glimmerUtilLibObjectUtils.assign; - exports.ensureGuid = _glimmerUtilLibGuid.ensureGuid; - exports.initializeGuid = _glimmerUtilLibGuid.initializeGuid; - exports.HasGuid = _glimmerUtilLibGuid.HasGuid; - exports.Stack = _glimmerUtilLibCollections.Stack; - exports.Dict = _glimmerUtilLibCollections.Dict; - exports.Set = _glimmerUtilLibCollections.Set; - exports.DictSet = _glimmerUtilLibCollections.DictSet; - exports.dict = _glimmerUtilLibCollections.dict; - exports.EMPTY_SLICE = _glimmerUtilLibListUtils.EMPTY_SLICE; - exports.LinkedList = _glimmerUtilLibListUtils.LinkedList; - exports.LinkedListNode = _glimmerUtilLibListUtils.LinkedListNode; - exports.ListNode = _glimmerUtilLibListUtils.ListNode; - exports.CloneableListNode = _glimmerUtilLibListUtils.CloneableListNode; - exports.ListSlice = _glimmerUtilLibListUtils.ListSlice; - exports.Slice = _glimmerUtilLibListUtils.Slice; -}); - -enifed("glimmer-util/lib/assert", ["exports"], function (exports) { - // import Logger from './logger'; - // let alreadyWarned = false; - "use strict"; + _bubbleEvent: function (view, evt, eventName) { + return view.handleEvent(eventName, evt); + }, - exports.debugAssert = debugAssert; - exports.prodAssert = prodAssert; + destroy: function () { + var rootElement = _emberMetal.get(this, 'rootElement'); + _emberViewsSystemJquery.default(rootElement).off('.ember', '**').removeClass(ROOT_ELEMENT_CLASS); + return this._super.apply(this, arguments); + }, - function debugAssert(test, msg) { - // if (!alreadyWarned) { - // alreadyWarned = true; - // Logger.warn("Don't leave debug assertions on in public builds"); - // } - if (!test) { - throw new Error(msg || "assertion failure"); - } + toString: function () { + return '(EventDispatcher)'; } + }); +}); +enifed('ember-views/system/ext', ['exports', 'ember-metal'], function (exports, _emberMetal) { + /** + @module ember + @submodule ember-views + */ - function prodAssert() {} + 'use strict'; - exports.default = debugAssert; + // Add a new named queue for rendering views that happens + // after bindings have synced, and a queue for scheduling actions + // that should occur after view rendering. + _emberMetal.run._addQueue('render', 'actions'); + _emberMetal.run._addQueue('afterRender', 'render'); }); +enifed('ember-views/system/jquery', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { + 'use strict'; -enifed('glimmer-util/lib/collections', ['exports', 'glimmer-util/lib/guid'], function (exports, _glimmerUtilLibGuid) { - 'use strict'; - - exports.dict = dict; + var jQuery = undefined; - var proto = Object.create(null, { - // without this, we will always still end up with (new - // EmptyObject()).constructor === Object - constructor: { - value: undefined, - enumerable: false, - writable: true - } - }); - function EmptyObject() {} - EmptyObject.prototype = proto; + if (_emberEnvironment.environment.hasDOM) { + jQuery = _emberEnvironment.context.imports.jQuery; - function dict() { - // let d = Object.create(null); - // d.x = 1; - // delete d.x; - // return d; - return new EmptyObject(); + if (jQuery) { + if (jQuery.event.addProp) { + jQuery.event.addProp('dataTransfer'); + } else { + // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dndevents + ['dragstart', 'drag', 'dragenter', 'dragleave', 'dragover', 'drop', 'dragend'].forEach(function (eventName) { + jQuery.event.fixHooks[eventName] = { + props: ['dataTransfer'] + }; + }); + } } + } - var DictSet = (function () { - function DictSet() { - this.dict = dict(); - } - - DictSet.prototype.add = function add(obj) { - if (typeof obj === 'string') this.dict[obj] = obj;else this.dict[_glimmerUtilLibGuid.ensureGuid(obj)] = obj; - return this; - }; - - DictSet.prototype.delete = function _delete(obj) { - if (typeof obj === 'string') delete this.dict[obj];else if (obj._guid) delete this.dict[obj._guid]; - }; - - DictSet.prototype.forEach = function forEach(callback) { - var dict = this.dict; - - Object.keys(dict).forEach(function (key) { - return callback(dict[key]); - }); - }; - - DictSet.prototype.toArray = function toArray() { - return Object.keys(this.dict); - }; - - return DictSet; - })(); + exports.default = jQuery; +}); +enifed('ember-views/system/lookup_partial', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - exports.DictSet = DictSet; + exports.default = lookupPartial; + exports.hasPartial = hasPartial; - var Stack = (function () { - function Stack() { - this.stack = []; - this.current = null; - } + function parseUnderscoredName(templateName) { + var nameParts = templateName.split('/'); + var lastPart = nameParts[nameParts.length - 1]; - Stack.prototype.push = function push(item) { - this.current = item; - this.stack.push(item); - }; + nameParts[nameParts.length - 1] = '_' + lastPart; - Stack.prototype.pop = function pop() { - var item = this.stack.pop(); - var len = this.stack.length; - this.current = len === 0 ? null : this.stack[len - 1]; - return item; - }; + return nameParts.join('/'); + } - Stack.prototype.isEmpty = function isEmpty() { - return this.stack.length === 0; - }; + function lookupPartial(templateName, owner) { + if (templateName == null) { + return; + } - return Stack; - })(); + var template = templateFor(owner, parseUnderscoredName(templateName), templateName); - exports.Stack = Stack; -}); + return template; + } -enifed("glimmer-util/lib/guid", ["exports"], function (exports) { - "use strict"; + function hasPartial(name, owner) { + if (!owner) { + throw new _emberMetal.Error('Container was not found when looking up a views template. ' + 'This is most likely due to manually instantiating an Ember.View. ' + 'See: http://git.io/EKPpnA'); + } - exports.initializeGuid = initializeGuid; - exports.ensureGuid = ensureGuid; - var GUID = 0; + return owner.hasRegistration('template:' + parseUnderscoredName(name)) || owner.hasRegistration('template:' + name); + } - function initializeGuid(object) { - return object._guid = ++GUID; + function templateFor(owner, underscored, name) { + if (!name) { + return; } - function ensureGuid(object) { - return object._guid || initializeGuid(object); + if (!owner) { + throw new _emberMetal.Error('Container was not found when looking up a views template. ' + 'This is most likely due to manually instantiating an Ember.View. ' + 'See: http://git.io/EKPpnA'); } + + return owner.lookup('template:' + underscored) || owner.lookup('template:' + name); + } }); +enifed('ember-views/system/utils', ['exports', 'ember-utils'], function (exports, _emberUtils) { + /* globals Element */ + 'use strict'; -enifed("glimmer-util/lib/list-utils", ["exports"], function (exports) { - "use strict"; + exports.isSimpleClick = isSimpleClick; + exports.getRootViews = getRootViews; + exports.getViewId = getViewId; + exports.getViewElement = getViewElement; + exports.initViewElement = initViewElement; + exports.setViewElement = setViewElement; + exports.getChildViews = getChildViews; + exports.initChildViews = initChildViews; + exports.addChildView = addChildView; + exports.collectChildViews = collectChildViews; + exports.getViewBounds = getViewBounds; + exports.getViewRange = getViewRange; + exports.getViewClientRects = getViewClientRects; + exports.getViewBoundingClientRect = getViewBoundingClientRect; + exports.matches = matches; - var ListNode = function ListNode(value) { - this.next = null; - this.prev = null; - this.value = value; - }; + /** + @module ember + @submodule ember-views + */ - exports.ListNode = ListNode; + function isSimpleClick(event) { + var modifier = event.shiftKey || event.metaKey || event.altKey || event.ctrlKey; + var secondaryClick = event.which > 1; // IE9 may return undefined - var LinkedList = (function () { - function LinkedList() { - this.clear(); - } + return !modifier && !secondaryClick; + } - LinkedList.fromSlice = function fromSlice(slice) { - var list = new LinkedList(); - slice.forEachNode(function (n) { - return list.append(n.clone()); - }); - return list; - }; + var STYLE_WARNING = '' + '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.'; - LinkedList.prototype.head = function head() { - return this._head; - }; + exports.STYLE_WARNING = STYLE_WARNING; + /** + @private + @method getRootViews + @param {Object} owner + */ - LinkedList.prototype.tail = function tail() { - return this._tail; - }; + function getRootViews(owner) { + var registry = owner.lookup('-view-registry:main'); - LinkedList.prototype.clear = function clear() { - this._head = this._tail = null; - }; + var rootViews = []; - LinkedList.prototype.isEmpty = function isEmpty() { - return this._head === null; - }; + Object.keys(registry).forEach(function (id) { + var view = registry[id]; - LinkedList.prototype.toArray = function toArray() { - var out = []; - this.forEachNode(function (n) { - return out.push(n); - }); - return out; - }; + if (view.parentView === null) { + rootViews.push(view); + } + }); - LinkedList.prototype.splice = function splice(start, end, reference) { - var before = undefined; - if (reference === null) { - before = this._tail; - this._tail = end; - } else { - before = reference.prev; - end.next = reference; - reference.prev = end; - } - if (before) { - before.next = start; - start.prev = before; - } - }; + return rootViews; + } - LinkedList.prototype.spliceList = function spliceList(list, reference) { - if (list.isEmpty()) return; - this.splice(list.head(), list.tail(), reference); - }; + /** + @private + @method getViewId + @param {Ember.View} view + */ - LinkedList.prototype.nextNode = function nextNode(node) { - return node.next; - }; + function getViewId(view) { + if (view.tagName === '') { + return _emberUtils.guidFor(view); + } else { + return view.elementId || _emberUtils.guidFor(view); + } + } - LinkedList.prototype.prevNode = function prevNode(node) { - return node.prev; - }; + var VIEW_ELEMENT = _emberUtils.symbol('VIEW_ELEMENT'); - LinkedList.prototype.forEachNode = function forEachNode(callback) { - var node = this._head; - while (node !== null) { - callback(node); - node = node.next; - } - }; + /** + @private + @method getViewElement + @param {Ember.View} view + */ - LinkedList.prototype.contains = function contains(needle) { - var node = this._head; - while (node !== null) { - if (node === needle) return true; - node = node.next; - } - return false; - }; + function getViewElement(view) { + return view[VIEW_ELEMENT]; + } - LinkedList.prototype.insertBefore = function insertBefore(node) { - var reference = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + function initViewElement(view) { + view[VIEW_ELEMENT] = null; + } - if (reference === null) return this.append(node); - if (reference.prev) reference.prev.next = node;else this._head = node; - node.prev = reference.prev; - node.next = reference; - reference.prev = node; - return node; - }; + function setViewElement(view, element) { + return view[VIEW_ELEMENT] = element; + } - LinkedList.prototype.append = function append(node) { - var tail = this._tail; - if (tail) { - tail.next = node; - node.prev = tail; - node.next = null; - } else { - this._head = node; - } - return this._tail = node; - }; + var CHILD_VIEW_IDS = _emberUtils.symbol('CHILD_VIEW_IDS'); - LinkedList.prototype.pop = function pop() { - if (this._tail) return this.remove(this._tail); - return null; - }; + /** + @private + @method getChildViews + @param {Ember.View} view + */ - LinkedList.prototype.prepend = function prepend(node) { - if (this._head) return this.insertBefore(node, this._head); - return this._head = this._tail = node; - }; + function getChildViews(view) { + var owner = _emberUtils.getOwner(view); + var registry = owner.lookup('-view-registry:main'); + return collectChildViews(view, registry); + } - LinkedList.prototype.remove = function remove(node) { - if (node.prev) node.prev.next = node.next;else this._head = node.next; - if (node.next) node.next.prev = node.prev;else this._tail = node.prev; - return node; - }; + function initChildViews(view) { + view[CHILD_VIEW_IDS] = []; + } - return LinkedList; - })(); + function addChildView(parent, child) { + parent[CHILD_VIEW_IDS].push(getViewId(child)); + } - exports.LinkedList = LinkedList; + function collectChildViews(view, registry) { + var ids = []; + var views = []; - var LinkedListRemover = (function () { - function LinkedListRemover(node) { - this.node = node; - } + view[CHILD_VIEW_IDS].forEach(function (id) { + var view = registry[id]; - LinkedListRemover.prototype.destroy = function destroy() { - var _node = this.node; - var prev = _node.prev; - var next = _node.next; + if (view && !view.isDestroying && !view.isDestroyed && ids.indexOf(id) === -1) { + ids.push(id); + views.push(view); + } + }); - prev.next = next; - next.prev = prev; - }; + view[CHILD_VIEW_IDS] = ids; - return LinkedListRemover; - })(); + return views; + } - var ListSlice = (function () { - function ListSlice(head, tail) { - this._head = head; - this._tail = tail; - } + /** + @private + @method getViewBounds + @param {Ember.View} view + */ - ListSlice.toList = function toList(slice) { - var list = new LinkedList(); - slice.forEachNode(function (n) { - return list.append(n.clone()); - }); - return list; - }; + function getViewBounds(view) { + return view.renderer.getBounds(view); + } - ListSlice.prototype.forEachNode = function forEachNode(callback) { - var node = this._head; - while (node !== null) { - callback(node); - node = this.nextNode(node); - } - }; + /** + @private + @method getViewRange + @param {Ember.View} view + */ - ListSlice.prototype.contains = function contains(needle) { - var node = this._head; - while (node !== null) { - if (node === needle) return true; - node = node.next; - } - return false; - }; + function getViewRange(view) { + var bounds = getViewBounds(view); - ListSlice.prototype.head = function head() { - return this._head; - }; + var range = document.createRange(); + range.setStartBefore(bounds.firstNode); + range.setEndAfter(bounds.lastNode); - ListSlice.prototype.tail = function tail() { - return this._tail; - }; + return range; + } - ListSlice.prototype.toArray = function toArray() { - var out = []; - this.forEachNode(function (n) { - return out.push(n); - }); - return out; - }; + /** + `getViewClientRects` provides information about the position of the border + box edges of a view relative to the viewport. + + It is only intended to be used by development tools like the Ember Inspector + and may not work on older browsers. + + @private + @method getViewClientRects + @param {Ember.View} view + */ - ListSlice.prototype.nextNode = function nextNode(node) { - if (node === this._tail) return null; - return node.next; - }; + function getViewClientRects(view) { + var range = getViewRange(view); + return range.getClientRects(); + } - ListSlice.prototype.prevNode = function prevNode(node) { - if (node === this._head) return null; - return node.prev; - }; + /** + `getViewBoundingClientRect` provides information about the position of the + bounding border box edges of a view relative to the viewport. + + It is only intended to be used by development tools like the Ember Inpsector + and may not work on older browsers. + + @private + @method getViewBoundingClientRect + @param {Ember.View} view + */ - ListSlice.prototype.isEmpty = function isEmpty() { - return false; - }; + function getViewBoundingClientRect(view) { + var range = getViewRange(view); + return range.getBoundingClientRect(); + } - return ListSlice; - })(); + /** + Determines if the element matches the specified selector. + + @private + @method matches + @param {DOMElement} el + @param {String} selector + */ + var elMatches = typeof Element !== 'undefined' && (Element.prototype.matches || Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector); - exports.ListSlice = ListSlice; - var EMPTY_SLICE = new ListSlice(null, null); - exports.EMPTY_SLICE = EMPTY_SLICE; -}); + exports.elMatches = elMatches; -enifed("glimmer-util/lib/logger", ["exports"], function (exports) { - "use strict"; + function matches(el, selector) { + return elMatches.call(el, selector); + } +}); +enifed('ember-views/utils/lookup-component', ['exports', 'container'], function (exports, _container) { + 'use strict'; - var LogLevel; - exports.LogLevel = LogLevel; - (function (LogLevel) { - LogLevel[LogLevel["Trace"] = 0] = "Trace"; - LogLevel[LogLevel["Debug"] = 1] = "Debug"; - LogLevel[LogLevel["Warn"] = 2] = "Warn"; - LogLevel[LogLevel["Error"] = 3] = "Error"; - })(LogLevel || (exports.LogLevel = LogLevel = {})); + exports.default = lookupComponent; - var NullConsole = (function () { - function NullConsole() {} + var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['component:-default'], ['component:-default']); - NullConsole.prototype.log = function log(message) {}; + function lookupComponentPair(componentLookup, owner, name, options) { + var component = componentLookup.componentFor(name, owner, options); + var layout = componentLookup.layoutFor(name, owner, options); - NullConsole.prototype.warn = function warn(message) {}; + var result = { layout: layout, component: component }; - NullConsole.prototype.error = function error(message) {}; + if (layout && !component) { + result.component = owner[_container.FACTORY_FOR](_container.privatize(_templateObject)); + } - NullConsole.prototype.trace = function trace() {}; + return result; + } - return NullConsole; - })(); + function lookupComponent(owner, name, options) { + var componentLookup = owner.lookup('component-lookup:main'); - var Logger = (function () { - function Logger(_ref) { - var console = _ref.console; - var level = _ref.level; + var source = options && options.source; - this.f = ALWAYS; - this.force = ALWAYS; - this.console = console; - this.level = level; - } + if (source) { + var localResult = lookupComponentPair(componentLookup, owner, name, options); - Logger.prototype.skipped = function skipped(level) { - return level < this.level; - }; + if (localResult.component || localResult.layout) { + return localResult; + } + } - Logger.prototype.trace = function trace(message) { - var _ref2 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + return lookupComponentPair(componentLookup, owner, name); + } +}); +enifed('ember-views/views/core_view', ['exports', 'ember-runtime', 'ember-views/system/utils', 'ember-views/views/states'], function (exports, _emberRuntime, _emberViewsSystemUtils, _emberViewsViewsStates) { + 'use strict'; - var _ref2$stackTrace = _ref2.stackTrace; - var stackTrace = _ref2$stackTrace === undefined ? false : _ref2$stackTrace; + /** + `Ember.CoreView` is an abstract class that exists to give view-like behavior + to both Ember's main view class `Ember.Component` and other classes that don't need + the full functionality of `Ember.Component`. + + Unless you have specific needs for `CoreView`, you will use `Ember.Component` + in your applications. + + @class CoreView + @namespace Ember + @extends Ember.Object + @deprecated Use `Ember.Component` instead. + @uses Ember.Evented + @uses Ember.ActionHandler + @private + */ + var CoreView = _emberRuntime.FrameworkObject.extend(_emberRuntime.Evented, _emberRuntime.ActionHandler, { + isView: true, - if (this.skipped(LogLevel.Trace)) return; - this.console.log(message); - if (stackTrace) this.console.trace(); - }; + _states: _emberViewsViewsStates.cloneStates(_emberViewsViewsStates.states), - Logger.prototype.debug = function debug(message) { - var _ref3 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + init: function () { + this._super.apply(this, arguments); + this._state = 'preRender'; + this._currentState = this._states.preRender; - var _ref3$stackTrace = _ref3.stackTrace; - var stackTrace = _ref3$stackTrace === undefined ? false : _ref3$stackTrace; + _emberViewsSystemUtils.initViewElement(this); - if (this.skipped(LogLevel.Debug)) return; - this.console.log(message); - if (stackTrace) this.console.trace(); - }; + if (!this.renderer) { + throw new Error('Cannot instantiate a component without a renderer. Please ensure that you are creating ' + this + ' with a proper container/registry.'); + } + }, - Logger.prototype.warn = function warn(message) { - var _ref4 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + /** + If the view is currently inserted into the DOM of a parent view, this + property will point to the parent of the view. + @property parentView + @type Ember.View + @default null + @private + */ + parentView: null, - var _ref4$stackTrace = _ref4.stackTrace; - var stackTrace = _ref4$stackTrace === undefined ? false : _ref4$stackTrace; + instrumentDetails: function (hash) { + hash.object = this.toString(); + hash.containerKey = this._debugContainerKey; + hash.view = this; + return hash; + }, - if (this.skipped(LogLevel.Warn)) return; - this.console.warn(message); - if (stackTrace) this.console.trace(); - }; + /** + Override the default event firing from `Ember.Evented` to + also call methods with the given name. + @method trigger + @param name {String} + @private + */ + trigger: function () { + this._super.apply(this, arguments); + var name = arguments[0]; + var method = this[name]; + if (method) { + var args = new Array(arguments.length - 1); + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + return method.apply(this, args); + } + }, - Logger.prototype.error = function error(message) { - if (this.skipped(LogLevel.Error)) return; - this.console.error(message); - }; + has: function (name) { + return _emberRuntime.typeOf(this[name]) === 'function' || this._super(name); + } + }); - return Logger; - })(); + _emberRuntime.deprecateUnderscoreActions(CoreView); - exports.Logger = Logger; + CoreView.reopenClass({ + isViewFactory: true + }); - var _console = typeof console === 'undefined' ? new NullConsole() : console; - var ALWAYS = new Logger({ console: _console, level: LogLevel.Trace }); - var LOG_LEVEL = LogLevel.Warn; - exports.default = new Logger({ console: _console, level: LOG_LEVEL }); + exports.default = CoreView; }); +enifed('ember-views/views/states', ['exports', 'ember-utils', '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, _emberUtils, _emberViewsViewsStatesDefault, _emberViewsViewsStatesPre_render, _emberViewsViewsStatesHas_element, _emberViewsViewsStatesIn_dom, _emberViewsViewsStatesDestroying) { + 'use strict'; -enifed('glimmer-util/lib/namespaces', ['exports'], function (exports) { - // There is a small whitelist of namespaced attributes specially - // enumerated in - // https://www.w3.org/TR/html/syntax.html#attributes-0 - // - // > When a foreign element has one of the namespaced attributes given by - // > the local name and namespace of the first and second cells of a row - // > from the following table, it must be written using the name given by - // > the third cell from the same row. - // - // In all other cases, colons are interpreted as a regular character - // with no special meaning: - // - // > No other namespaced attribute can be expressed in the HTML syntax. - 'use strict'; + exports.cloneStates = cloneStates; - exports.getAttrNamespace = getAttrNamespace; - var XLINK = 'http://www.w3.org/1999/xlink'; - var XML = 'http://www.w3.org/XML/1998/namespace'; - var XMLNS = 'http://www.w3.org/2000/xmlns/'; - var WHITELIST = { - 'xlink:actuate': XLINK, - 'xlink:arcrole': XLINK, - 'xlink:href': XLINK, - 'xlink:role': XLINK, - 'xlink:show': XLINK, - 'xlink:title': XLINK, - 'xlink:type': XLINK, - 'xml:base': XML, - 'xml:lang': XML, - 'xml:space': XML, - 'xmlns': XMLNS, - 'xmlns:xlink': XMLNS - }; + function cloneStates(from) { + var into = {}; - function getAttrNamespace(attrName) { - return WHITELIST[attrName] || null; - } -}); + into._default = {}; + into.preRender = Object.create(into._default); + into.destroying = Object.create(into._default); + into.hasElement = Object.create(into._default); + into.inDOM = Object.create(into.hasElement); -enifed('glimmer-util/lib/object-utils', ['exports'], function (exports) { - 'use strict'; + for (var stateName in from) { + if (!from.hasOwnProperty(stateName)) { + continue; + } + _emberUtils.assign(into[stateName], from[stateName]); + } - exports.assign = assign; - var objKeys = Object.keys; + return into; + } - function assign(obj) { - for (var i = 1; i < arguments.length; i++) { - var assignment = arguments[i]; - if (assignment === null || typeof assignment !== 'object') continue; - var keys = objKeys(assignment); - for (var j = 0; j < keys.length; j++) { - var key = keys[j]; - obj[key] = assignment[key]; - } - } - return obj; - } + /* + Describe how the specified actions should behave in the various + states that a view can exist in. Possible states: + + * preRender: when a view is first instantiated, and after its + element was destroyed, it is in the preRender state + * hasElement: the DOM representation of the view is created, + and is ready to be inserted + * inDOM: once a view has been inserted into the DOM it is in + the inDOM state. A view spends the vast majority of its + existence in this state. + * destroyed: once a view has been destroyed (using the destroy + method), it is in this state. No further actions can be invoked + on a destroyed view. + */ + var states = { + _default: _emberViewsViewsStatesDefault.default, + preRender: _emberViewsViewsStatesPre_render.default, + inDOM: _emberViewsViewsStatesIn_dom.default, + hasElement: _emberViewsViewsStatesHas_element.default, + destroying: _emberViewsViewsStatesDestroying.default + }; + exports.states = states; }); +enifed('ember-views/views/states/default', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; -enifed("glimmer-util/lib/platform-utils", ["exports"], function (exports) { - "use strict"; + /** + @module ember + @submodule ember-views + */ + exports.default = { + // appendChild is only legal while rendering the buffer. + appendChild: function () { + throw new _emberMetal.Error('You can\'t use appendChild outside of the rendering process'); + }, - exports.unwrap = unwrap; + // Handle events from `Ember.EventDispatcher` + handleEvent: function () { + return true; // continue event propagation + }, - function unwrap(val) { - if (val === null || val === undefined) throw new Error("Expected value to be present"); - return val; - } + rerender: function () {}, + + destroy: function () {} + }; }); +enifed('ember-views/views/states/destroying', ['exports', 'ember-utils', 'ember-metal', 'ember-views/views/states/default'], function (exports, _emberUtils, _emberMetal, _emberViewsViewsStatesDefault) { + 'use strict'; -enifed("glimmer-util/lib/quoting", ["exports"], function (exports) { - "use strict"; + /** + @module ember + @submodule ember-views + */ - exports.hash = hash; - exports.repeat = repeat; - function escapeString(str) { - str = str.replace(/\\/g, "\\\\"); - str = str.replace(/"/g, '\\"'); - str = str.replace(/\n/g, "\\n"); - return str; - } - exports.escapeString = escapeString; + var destroying = Object.create(_emberViewsViewsStatesDefault.default); - function string(str) { - return '"' + escapeString(str) + '"'; + _emberUtils.assign(destroying, { + appendChild: function () { + throw new _emberMetal.Error('You can\'t call appendChild on a view being destroyed'); + }, + rerender: function () { + throw new _emberMetal.Error('You can\'t call rerender on a view being destroyed'); } - exports.string = string; + }); - function array(a) { - return "[" + a + "]"; - } - exports.array = array; + exports.default = destroying; +}); +enifed('ember-views/views/states/has_element', ['exports', 'ember-utils', 'ember-views/views/states/default', 'ember-metal'], function (exports, _emberUtils, _emberViewsViewsStatesDefault, _emberMetal) { + 'use strict'; - function hash(pairs) { - return "{" + pairs.join(", ") + "}"; - } + var hasElement = Object.create(_emberViewsViewsStatesDefault.default); - function repeat(chars, times) { - var str = ""; - while (times--) { - str += chars; - } - return str; - } -}); + _emberUtils.assign(hasElement, { -enifed('glimmer-wire-format/index', ['exports'], function (exports) { - 'use strict'; + rerender: function (view) { + view.renderer.rerender(view); + }, - function is(variant) { - return function (value) { - return value[0] === variant; - }; - } - var Expressions; - exports.Expressions = Expressions; - (function (Expressions) { - Expressions.isUnknown = is('unknown'); - Expressions.isArg = is('arg'); - Expressions.isGet = is('get'); - Expressions.isConcat = is('concat'); - Expressions.isHelper = is('helper'); - Expressions.isHasBlock = is('has-block'); - Expressions.isHasBlockParams = is('has-block-params'); - Expressions.isUndefined = is('undefined'); - function isPrimitiveValue(value) { - if (value === null) { - return true; - } - return typeof value !== 'object'; - } - Expressions.isPrimitiveValue = isPrimitiveValue; - })(Expressions || (exports.Expressions = Expressions = {})); - var Statements; - exports.Statements = Statements; - (function (Statements) { - Statements.isText = is('text'); - Statements.isAppend = is('append'); - Statements.isComment = is('comment'); - Statements.isModifier = is('modifier'); - Statements.isBlock = is('block'); - Statements.isOpenElement = is('open-element'); - Statements.isFlushElement = is('flush-element'); - Statements.isCloseElement = is('close-element'); - Statements.isStaticAttr = is('static-attr'); - Statements.isDynamicAttr = is('dynamic-attr'); - Statements.isYield = is('yield'); - Statements.isPartial = is('partial'); - Statements.isDynamicArg = is('dynamic-arg'); - Statements.isStaticArg = is('static-arg'); - Statements.isTrustingAttr = is('trusting-attr'); - })(Statements || (exports.Statements = Statements = {})); -}); + destroy: function (view) { + view.renderer.remove(view); + }, -enifed('glimmer/index', ['exports', 'glimmer-compiler'], function (exports, _glimmerCompiler) { - /* - * @overview Glimmer - * @copyright Copyright 2011-2015 Tilde Inc. and contributors - * @license Licensed under MIT license - * See https://raw.githubusercontent.com/tildeio/glimmer/master/LICENSE - * @version VERSION_STRING_PLACEHOLDER - */ - 'use strict'; + // Handle events from `Ember.EventDispatcher` + handleEvent: function (view, eventName, event) { + if (view.has(eventName)) { + // Handler should be able to re-dispatch events, so we don't + // preventDefault or stopPropagation. + return _emberMetal.flaggedInstrument('interaction.' + eventName, { event: event, view: view }, function () { + return _emberMetal.run.join(view, view.trigger, eventName, event); + }); + } else { + return true; // continue event propagation + } + } + }); - exports.precompile = _glimmerCompiler.precompile; + exports.default = hasElement; }); +enifed('ember-views/views/states/in_dom', ['exports', 'ember-utils', 'ember-metal', 'ember-views/views/states/has_element'], function (exports, _emberUtils, _emberMetal, _emberViewsViewsStatesHas_element) { + 'use strict'; -enifed('route-recognizer', ['exports'], function (exports) { 'use strict'; + /** + @module ember + @submodule ember-views + */ -function Target(path, matcher, delegate) { - this.path = path; - this.matcher = matcher; - this.delegate = delegate; -} + var inDOM = Object.create(_emberViewsViewsStatesHas_element.default); -Target.prototype = { - to: function(target, callback) { - var delegate = this.delegate; + _emberUtils.assign(inDOM, { + enter: function (view) { + // Register the view for event handling. This hash is used by + // Ember.EventDispatcher to dispatch incoming events. + view.renderer.register(view); + }, - if (delegate && delegate.willAddRoute) { - target = delegate.willAddRoute(this.matcher.target, target); + exit: function (view) { + view.renderer.unregister(view); } + }); - this.matcher.add(this.path, target); + exports.default = inDOM; +}); +enifed('ember-views/views/states/pre_render', ['exports', 'ember-views/views/states/default'], function (exports, _emberViewsViewsStatesDefault) { + 'use strict'; - if (callback) { - if (callback.length === 0) { throw new Error("You must have an argument in the function passed to `to`"); } - this.matcher.addChild(this.path, target, callback, this.delegate); - } - return this; - } -}; + /** + @module ember + @submodule ember-views + */ -function Matcher(target) { - this.routes = {}; - this.children = {}; - this.target = target; -} + exports.default = Object.create(_emberViewsViewsStatesDefault.default); +}); +enifed("ember-views/views/view", ["exports"], function (exports) { + "use strict"; +}); +/** +@module ember +@submodule ember-views +*/ -Matcher.prototype = { - add: function(path, handler) { - this.routes[path] = handler; - }, +/** + @class View + @namespace Ember + @extends Ember.CoreView + @deprecated See http://emberjs.com/deprecations/v1.x/#toc_ember-view + @uses Ember.ViewSupport + @uses Ember.ChildViewsSupport + @uses Ember.ClassNamesSupport + @uses Ember.AttributeBindingsSupport + @private +*/ +enifed("ember/features", ["exports"], function (exports) { + "use strict"; - addChild: function(path, target, callback, delegate) { - var matcher = new Matcher(target); - this.children[path] = matcher; + exports.default = { "features-stripped-test": null, "ember-libraries-isregistered": null, "ember-improved-instrumentation": null, "ember-metal-weakmap": null, "ember-glimmer-allow-backtracking-rerender": true, "ember-testing-resume-test": null, "ember-factory-for": true, "ember-no-double-extend": null, "ember-routing-router-service": null, "ember-unique-location-history-state": null, "ember-glimmer-detect-backtracking-rerender": false, "mandatory-setter": false }; +}); +enifed('ember/index', ['exports', 'require', 'ember-environment', 'ember-utils', 'container', 'ember-metal', 'backburner', 'ember-console', 'ember-runtime', 'ember-glimmer', 'ember/version', 'ember-views', 'ember-routing', 'ember-application', 'ember-extension-support'], function (exports, _require, _emberEnvironment, _emberUtils, _container, _emberMetal, _backburner, _emberConsole, _emberRuntime, _emberGlimmer, _emberVersion, _emberViews, _emberRouting, _emberApplication, _emberExtensionSupport) { + 'use strict'; - var match = generateMatch(path, matcher, delegate); + // ember-utils exports + _emberMetal.default.getOwner = _emberUtils.getOwner; + _emberMetal.default.setOwner = _emberUtils.setOwner; + _emberMetal.default.generateGuid = _emberUtils.generateGuid; + _emberMetal.default.GUID_KEY = _emberUtils.GUID_KEY; + _emberMetal.default.guidFor = _emberUtils.guidFor; + _emberMetal.default.inspect = _emberUtils.inspect; + _emberMetal.default.makeArray = _emberUtils.makeArray; + _emberMetal.default.canInvoke = _emberUtils.canInvoke; + _emberMetal.default.tryInvoke = _emberUtils.tryInvoke; + _emberMetal.default.wrap = _emberUtils.wrap; + _emberMetal.default.applyStr = _emberUtils.applyStr; + _emberMetal.default.uuid = _emberUtils.uuid; + _emberMetal.default.assign = Object.assign || _emberUtils.assign; - if (delegate && delegate.contextEntered) { - delegate.contextEntered(target, match); - } + // container exports + _emberMetal.default.Container = _container.Container; + _emberMetal.default.Registry = _container.Registry; + + // need to import this directly, to ensure the babel feature + // flag plugin works properly + + var computed = _emberMetal.computed; + computed.alias = _emberMetal.alias; + _emberMetal.default.computed = computed; + _emberMetal.default.ComputedProperty = _emberMetal.ComputedProperty; + _emberMetal.default.cacheFor = _emberMetal.cacheFor; - callback(match); - } -}; + _emberMetal.default.assert = _emberMetal.assert; + _emberMetal.default.warn = _emberMetal.warn; + _emberMetal.default.debug = _emberMetal.debug; + _emberMetal.default.deprecate = _emberMetal.deprecate; + _emberMetal.default.deprecateFunc = _emberMetal.deprecateFunc; + _emberMetal.default.runInDebug = _emberMetal.runInDebug; + _emberMetal.default.merge = _emberMetal.merge; -function generateMatch(startingPath, matcher, delegate) { - return function(path, nestedCallback) { - var fullPath = startingPath + path; + _emberMetal.default.instrument = _emberMetal.instrument; + _emberMetal.default.subscribe = _emberMetal.instrumentationSubscribe; + _emberMetal.default.Instrumentation = { + instrument: _emberMetal.instrument, + subscribe: _emberMetal.instrumentationSubscribe, + unsubscribe: _emberMetal.instrumentationUnsubscribe, + reset: _emberMetal.instrumentationReset + }; - if (nestedCallback) { - nestedCallback(generateMatch(fullPath, matcher, delegate)); - } else { - return new Target(startingPath + path, matcher, delegate); - } + _emberMetal.default.Error = _emberMetal.Error; + _emberMetal.default.META_DESC = _emberMetal.META_DESC; + _emberMetal.default.meta = _emberMetal.meta; + _emberMetal.default.get = _emberMetal.get; + _emberMetal.default.getWithDefault = _emberMetal.getWithDefault; + _emberMetal.default._getPath = _emberMetal._getPath; + _emberMetal.default.set = _emberMetal.set; + _emberMetal.default.trySet = _emberMetal.trySet; + _emberMetal.default.FEATURES = _emberMetal.FEATURES; + _emberMetal.default.FEATURES.isEnabled = _emberMetal.isFeatureEnabled; + _emberMetal.default._Cache = _emberMetal.Cache; + _emberMetal.default.on = _emberMetal.on; + _emberMetal.default.addListener = _emberMetal.addListener; + _emberMetal.default.removeListener = _emberMetal.removeListener; + _emberMetal.default._suspendListener = _emberMetal.suspendListener; + _emberMetal.default._suspendListeners = _emberMetal.suspendListeners; + _emberMetal.default.sendEvent = _emberMetal.sendEvent; + _emberMetal.default.hasListeners = _emberMetal.hasListeners; + _emberMetal.default.watchedEvents = _emberMetal.watchedEvents; + _emberMetal.default.listenersFor = _emberMetal.listenersFor; + _emberMetal.default.accumulateListeners = _emberMetal.accumulateListeners; + _emberMetal.default.isNone = _emberMetal.isNone; + _emberMetal.default.isEmpty = _emberMetal.isEmpty; + _emberMetal.default.isBlank = _emberMetal.isBlank; + _emberMetal.default.isPresent = _emberMetal.isPresent; + _emberMetal.default.run = _emberMetal.run; + _emberMetal.default._ObserverSet = _emberMetal.ObserverSet; + _emberMetal.default.propertyWillChange = _emberMetal.propertyWillChange; + _emberMetal.default.propertyDidChange = _emberMetal.propertyDidChange; + _emberMetal.default.overrideChains = _emberMetal.overrideChains; + _emberMetal.default.beginPropertyChanges = _emberMetal.beginPropertyChanges; + _emberMetal.default.endPropertyChanges = _emberMetal.endPropertyChanges; + _emberMetal.default.changeProperties = _emberMetal.changeProperties; + _emberMetal.default.platform = { + defineProperty: true, + hasPropertyAccessors: true }; -} + _emberMetal.default.defineProperty = _emberMetal.defineProperty; + _emberMetal.default.watchKey = _emberMetal.watchKey; + _emberMetal.default.unwatchKey = _emberMetal.unwatchKey; + _emberMetal.default.removeChainWatcher = _emberMetal.removeChainWatcher; + _emberMetal.default._ChainNode = _emberMetal.ChainNode; + _emberMetal.default.finishChains = _emberMetal.finishChains; + _emberMetal.default.watchPath = _emberMetal.watchPath; + _emberMetal.default.unwatchPath = _emberMetal.unwatchPath; + _emberMetal.default.watch = _emberMetal.watch; + _emberMetal.default.isWatching = _emberMetal.isWatching; + _emberMetal.default.unwatch = _emberMetal.unwatch; + _emberMetal.default.destroy = _emberMetal.destroy; + _emberMetal.default.libraries = _emberMetal.libraries; + _emberMetal.default.OrderedSet = _emberMetal.OrderedSet; + _emberMetal.default.Map = _emberMetal.Map; + _emberMetal.default.MapWithDefault = _emberMetal.MapWithDefault; + _emberMetal.default.getProperties = _emberMetal.getProperties; + _emberMetal.default.setProperties = _emberMetal.setProperties; + _emberMetal.default.expandProperties = _emberMetal.expandProperties; + _emberMetal.default.NAME_KEY = _emberUtils.NAME_KEY; + _emberMetal.default.addObserver = _emberMetal.addObserver; + _emberMetal.default.observersFor = _emberMetal.observersFor; + _emberMetal.default.removeObserver = _emberMetal.removeObserver; + _emberMetal.default._suspendObserver = _emberMetal._suspendObserver; + _emberMetal.default._suspendObservers = _emberMetal._suspendObservers; + _emberMetal.default.required = _emberMetal.required; + _emberMetal.default.aliasMethod = _emberMetal.aliasMethod; + _emberMetal.default.observer = _emberMetal.observer; + _emberMetal.default.immediateObserver = _emberMetal._immediateObserver; + _emberMetal.default.mixin = _emberMetal.mixin; + _emberMetal.default.Mixin = _emberMetal.Mixin; + _emberMetal.default.bind = _emberMetal.bind; + _emberMetal.default.Binding = _emberMetal.Binding; + _emberMetal.default.isGlobalPath = _emberMetal.isGlobalPath; -function addRoute(routeArray, path, handler) { - var len = 0; - for (var i=0; i 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + mixins[_key - 1] = arguments[_key]; + } - for (var i=0; i'; + })(); - if (name = options && options.as) { - this.names[name] = { - segments: allSegments, - handlers: handlers - }; + function normalizeInnerHTML(actualHTML) { + if (ieSVGInnerHTML) { + // Replace `` with ``, etc. + // drop namespace attribute + actualHTML = actualHTML.replace(/ xmlns="[^"]+"/, ''); + // replace self-closing elements + actualHTML = actualHTML.replace(/<([^ >]+) [^\/>]*\/>/gi, function (tag, tagName) { + return tag.slice(0, tag.length - 3) + '>'; + }); } - }, - handlersFor: function(name) { - var route = this.names[name]; + return actualHTML; + } - if (!route) { throw new Error("There is no route named " + name); } + function equalInnerHTML(fragment, html) { + var actualHTML = normalizeInnerHTML(fragment.innerHTML); + QUnit.push(actualHTML === html, actualHTML, html); + } +}); +enifed('internal-test-helpers/equal-tokens', ['exports', 'simple-html-tokenizer'], function (exports, _simpleHtmlTokenizer) { + 'use strict'; - var result = new Array(route.handlers.length); + exports.default = equalTokens; - for (var i=0; i b[0]) { + return 1; + } + if (a[0] < b[0]) { + return -1; + } + return 0; + }); + } + }); + } - hasRoute: function(name) { - return !!this.names[name]; - }, + function equalTokens(actualContainer, expectedHTML) { + var message = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; - generate: function(name, params) { - var route = this.names[name], output = ""; - if (!route) { throw new Error("There is no route named " + name); } + var actual = generateTokens(actualContainer); + var expected = generateTokens(expectedHTML); - var segments = route.segments; + normalizeTokens(actual.tokens); + normalizeTokens(expected.tokens); - for (var i=0; i'; + }; + + Klass.create = create; + Klass.extend = extend; + Klass.reopen = extend; + Klass.reopenClass = reopenClass; + + return Klass; + + function create(options) { + return new this.prototype.constructor(options); } - keys.sort(); - for (var i = 0; i < keys.length; i++) { - key = keys[i]; - var value = params[key]; - if (value == null) { - continue; - } - var pair = encodeURIComponent(key); - if (isArray(value)) { - for (var j = 0; j < value.length; j++) { - var arrayPair = key + '[]' + '=' + encodeURIComponent(value[j]); - pairs.push(arrayPair); - } - } else { - pair += "=" + encodeURIComponent(value); - pairs.push(pair); - } + + function reopenClass(options) { + setProperties(this, options); } - if (pairs.length === 0) { return ''; } + function extend(options) { + function Child(options) { + Klass.call(this, options); + } - return "?" + pairs.join("&"); - }, + var Parent = this; - parseQueryString: function(queryString) { - 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, - isArray = false, - value; - if (pair.length === 1) { - value = 'true'; - } else { - //Handle arrays - if (keyLength > 2 && key.slice(keyLength -2) === '[]') { - isArray = true; - key = key.slice(0, keyLength - 2); - if(!queryParams[key]) { - queryParams[key] = []; - } - } - value = pair[1] ? decodeQueryParamPart(pair[1]) : ''; - } - if (isArray) { - queryParams[key].push(value); - } else { - queryParams[key] = value; - } - } - return queryParams; - }, + Child.prototype = new Parent(); + Child.prototype.constructor = Child; - recognize: function(path) { - var states = [ this.rootState ], - pathLen, i, queryStart, queryParams = {}, - hashStart, - isSlashDropped = false; + setProperties(Child, Klass); + setProperties(Child.prototype, options); - hashStart = path.indexOf('#'); - if (hashStart !== -1) { - path = path.substr(0, hashStart); - } + Child.create = create; + Child.extend = extend; + Child.reopen = extend; - queryStart = path.indexOf('?'); - if (queryStart !== -1) { - var queryString = path.substr(queryStart + 1, path.length); - path = path.substr(0, queryStart); - queryParams = this.parseQueryString(queryString); + Child.reopenClass = reopenClass; + + return Child; } + } +}); +enifed('internal-test-helpers/index', ['exports', 'internal-test-helpers/factory', 'internal-test-helpers/build-owner', 'internal-test-helpers/confirm-export', 'internal-test-helpers/equal-inner-html', 'internal-test-helpers/equal-tokens', 'internal-test-helpers/module-for', 'internal-test-helpers/strip', 'internal-test-helpers/apply-mixins', 'internal-test-helpers/matchers', 'internal-test-helpers/run', 'internal-test-helpers/test-groups', 'internal-test-helpers/test-cases/abstract', 'internal-test-helpers/test-cases/abstract-application', 'internal-test-helpers/test-cases/application', 'internal-test-helpers/test-cases/query-param', 'internal-test-helpers/test-cases/abstract-rendering', 'internal-test-helpers/test-cases/rendering', 'internal-test-helpers/test-cases/router'], function (exports, _internalTestHelpersFactory, _internalTestHelpersBuildOwner, _internalTestHelpersConfirmExport, _internalTestHelpersEqualInnerHtml, _internalTestHelpersEqualTokens, _internalTestHelpersModuleFor, _internalTestHelpersStrip, _internalTestHelpersApplyMixins, _internalTestHelpersMatchers, _internalTestHelpersRun, _internalTestHelpersTestGroups, _internalTestHelpersTestCasesAbstract, _internalTestHelpersTestCasesAbstractApplication, _internalTestHelpersTestCasesApplication, _internalTestHelpersTestCasesQueryParam, _internalTestHelpersTestCasesAbstractRendering, _internalTestHelpersTestCasesRendering, _internalTestHelpersTestCasesRouter) { + 'use strict'; - if (path.charAt(0) !== "/") { path = "/" + path; } - var originalPath = path; + exports.factory = _internalTestHelpersFactory.default; + exports.buildOwner = _internalTestHelpersBuildOwner.default; + exports.confirmExport = _internalTestHelpersConfirmExport.default; + exports.equalInnerHTML = _internalTestHelpersEqualInnerHtml.default; + exports.equalTokens = _internalTestHelpersEqualTokens.default; + exports.moduleFor = _internalTestHelpersModuleFor.default; + exports.strip = _internalTestHelpersStrip.default; + exports.applyMixins = _internalTestHelpersApplyMixins.default; + exports.equalsElement = _internalTestHelpersMatchers.equalsElement; + exports.classes = _internalTestHelpersMatchers.classes; + exports.styles = _internalTestHelpersMatchers.styles; + exports.regex = _internalTestHelpersMatchers.regex; + exports.runAppend = _internalTestHelpersRun.runAppend; + exports.runDestroy = _internalTestHelpersRun.runDestroy; + exports.testBoth = _internalTestHelpersTestGroups.testBoth; + exports.testWithDefault = _internalTestHelpersTestGroups.testWithDefault; + exports.AbstractTestCase = _internalTestHelpersTestCasesAbstract.default; + exports.AbstractApplicationTestCase = _internalTestHelpersTestCasesAbstractApplication.default; + exports.ApplicationTestCase = _internalTestHelpersTestCasesApplication.default; + exports.QueryParamTestCase = _internalTestHelpersTestCasesQueryParam.default; + exports.AbstractRenderingTestCase = _internalTestHelpersTestCasesAbstractRendering.default; + exports.RenderingTestCase = _internalTestHelpersTestCasesRendering.default; + exports.RouterTestCase = _internalTestHelpersTestCasesRouter.default; +}); +enifed('internal-test-helpers/matchers', ['exports'], function (exports) { + 'use strict'; - if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS) { - path = normalizePath(path); - } else { - path = decodeURI(path); - originalPath = decodeURI(originalPath); - } + exports.regex = regex; + exports.classes = classes; + exports.styles = styles; + exports.equalsElement = equalsElement; + var HTMLElement = window.HTMLElement; + var MATCHER_BRAND = '3d4ef194-13be-4ccf-8dc7-862eea02c93e'; - pathLen = path.length; - if (pathLen > 1 && path.charAt(pathLen - 1) === "/") { - path = path.substr(0, pathLen - 1); - originalPath = originalPath.substr(0, originalPath.length - 1); - isSlashDropped = true; - } + function isMatcher(obj) { + return typeof obj === 'object' && obj !== null && MATCHER_BRAND in obj; + } - for (i=0; i 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + mixins[_key - 2] = arguments[_key]; + } - Extracts query params from the end of an array -**/ -function extractQueryParams(array) { - var len = (array && array.length), head, queryParams; + _internalTestHelpersApplyMixins.default(TestClass, mixins); - if(len && len > 0 && array[len - 1] && array[len - 1].hasOwnProperty('queryParams')) { - queryParams = array[len - 1].queryParams; - head = slice.call(array, 0, len - 1); - return [head, queryParams]; - } else { - return [array, null]; - } -} + var proto = TestClass.prototype; -/** - @private + while (proto !== Object.prototype) { + Object.keys(proto).forEach(generateTest); + proto = Object.getPrototypeOf(proto); + } - Coerces query param properties and array elements into strings. -**/ -function coerceQueryParamsToString(queryParams) { - for (var key in queryParams) { - if (typeof queryParams[key] === 'number') { - queryParams[key] = '' + queryParams[key]; - } else if (isArray(queryParams[key])) { - for (var i = 0, l = queryParams[key].length; i < l; i++) { - queryParams[key][i] = '' + queryParams[key][i]; + function generateTest(name) { + if (name.indexOf('@test ') === 0) { + QUnit.test(name.slice(5), function (assert) { + return context[name](assert); + }); + } else if (name.indexOf('@skip ') === 0) { + QUnit.skip(name.slice(5), function (assert) { + return context[name](assert); + }); } } } -} -/** - @private - */ -function log(router, sequence, msg) { - if (!router.log) { return; } +}); +enifed('internal-test-helpers/run', ['exports', 'ember-metal'], function (exports, _emberMetal) { + 'use strict'; - if (arguments.length === 3) { - router.log("Transition #" + sequence + ": " + msg); - } else { - msg = sequence; - router.log(msg); + exports.runAppend = runAppend; + exports.runDestroy = runDestroy; + + function runAppend(view) { + _emberMetal.run(view, 'appendTo', '#qunit-fixture'); } -} -function bind(context, fn) { - var boundArgs = arguments; - return function(value) { - var args = slice.call(boundArgs, 2); - args.push(value); - return fn.apply(context, args); - }; -} + function runDestroy(toDestroy) { + if (toDestroy) { + _emberMetal.run(toDestroy, 'destroy'); + } + } +}); +enifed('internal-test-helpers/strip', ['exports'], function (exports) { + 'use strict'; -function isParam(object) { - return (typeof object === "string" || object instanceof String || typeof object === "number" || object instanceof Number); -} + exports.default = strip; + function strip(_ref) { + for (var _len = arguments.length, values = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + values[_key - 1] = arguments[_key]; + } -function forEach(array, callback) { - for (var i=0, l=array.length; i < l && false !== callback(array[i]); i++) { } -} + var strings = _ref; -function trigger(router, handlerInfos, ignoreFailure, args) { - if (router.triggerEvent) { - router.triggerEvent(handlerInfos, ignoreFailure, args); - return; + var str = strings.map(function (string, index) { + var interpolated = values[index]; + return string + (interpolated !== undefined ? interpolated : ''); + }).join(''); + return str.split('\n').map(function (s) { + return s.trim(); + }).join(''); } +}); +enifed('internal-test-helpers/test-cases/abstract-application', ['exports', 'ember-metal', 'ember-views', 'ember-application', 'ember-routing', 'ember-template-compiler', 'internal-test-helpers/test-cases/abstract', 'internal-test-helpers/run'], function (exports, _emberMetal, _emberViews, _emberApplication, _emberRouting, _emberTemplateCompiler, _internalTestHelpersTestCasesAbstract, _internalTestHelpersRun) { + 'use strict'; - var name = args.shift(); + var AbstractApplicationTestCase = (function (_AbstractTestCase) { + babelHelpers.inherits(AbstractApplicationTestCase, _AbstractTestCase); - if (!handlerInfos) { - if (ignoreFailure) { return; } - throw new Error("Could not trigger event '" + name + "'. There are no active handlers"); - } + function AbstractApplicationTestCase() { + _AbstractTestCase.call(this); - var eventWasHandled = false; + this.element = _emberViews.jQuery('#qunit-fixture')[0]; - function delayedEvent(name, args, handler) { - handler.events[name].apply(handler, args); - } + this.application = _emberMetal.run(_emberApplication.Application, 'create', this.applicationOptions); - for (var i=handlerInfos.length-1; i>=0; i--) { - var handlerInfo = handlerInfos[i], - handler = handlerInfo.handler; + this.router = this.application.Router = _emberRouting.Router.extend(this.routerOptions); - // If there is no handler, it means the handler hasn't resolved yet which - // means that we should trigger the event later when the handler is available - if (!handler) { - handlerInfo.handlerPromise.then(bind(null, delayedEvent, name, args)); - continue; + this.applicationInstance = null; } - if (handler.events && handler.events[name]) { - if (handler.events[name].apply(handler, args) === true) { - eventWasHandled = true; + AbstractApplicationTestCase.prototype.teardown = function teardown() { + if (this.applicationInstance) { + _internalTestHelpersRun.runDestroy(this.applicationInstance); + } + + _internalTestHelpersRun.runDestroy(this.application); + }; + + AbstractApplicationTestCase.prototype.visit = function visit(url, options) { + var _this = this; + + var applicationInstance = this.applicationInstance; + + if (applicationInstance) { + return _emberMetal.run(applicationInstance, 'visit', url, options); } else { - return; + return _emberMetal.run(this.application, 'visit', url, options).then(function (instance) { + _this.applicationInstance = instance; + }); } - } - } + }; - // In the case that we got an UnrecognizedURLError as an event with no handler, - // let it bubble up - if (name === 'error' && args[0].name === 'UnrecognizedURLError') { - throw args[0]; - } else if (!eventWasHandled && !ignoreFailure) { - throw new Error("Nothing handled the event '" + name + "'."); - } -} + AbstractApplicationTestCase.prototype.transitionTo = function transitionTo() { + return _emberMetal.run.apply(undefined, [this.appRouter, 'transitionTo'].concat(babelHelpers.slice.call(arguments))); + }; -function getChangelist(oldObject, newObject) { - var key; - var results = { - all: {}, - changed: {}, - removed: {} - }; + AbstractApplicationTestCase.prototype.compile = function compile(string, options) { + return _emberTemplateCompiler.compile.apply(undefined, arguments); + }; - merge(results.all, newObject); + AbstractApplicationTestCase.prototype.registerRoute = function registerRoute(name, route) { + this.application.register('route:' + name, route); + }; - var didChange = false; - coerceQueryParamsToString(oldObject); - coerceQueryParamsToString(newObject); + AbstractApplicationTestCase.prototype.registerTemplate = function registerTemplate(name, template) { + this.application.register('template:' + name, this.compile(template, { + moduleName: name + })); + }; - // Calculate removals - for (key in oldObject) { - if (oldObject.hasOwnProperty(key)) { - if (!newObject.hasOwnProperty(key)) { - didChange = true; - results.removed[key] = oldObject[key]; + AbstractApplicationTestCase.prototype.registerComponent = function registerComponent(name, _ref) { + var _ref$ComponentClass = _ref.ComponentClass; + var ComponentClass = _ref$ComponentClass === undefined ? null : _ref$ComponentClass; + var _ref$template = _ref.template; + var template = _ref$template === undefined ? null : _ref$template; + + if (ComponentClass) { + this.application.register('component:' + name, ComponentClass); } - } - } - // Calculate changes - for (key in newObject) { - if (newObject.hasOwnProperty(key)) { - if (isArray(oldObject[key]) && isArray(newObject[key])) { - if (oldObject[key].length !== newObject[key].length) { - results.changed[key] = newObject[key]; - didChange = true; - } else { - for (var i = 0, l = oldObject[key].length; i < l; i++) { - if (oldObject[key][i] !== newObject[key][i]) { - results.changed[key] = newObject[key]; - didChange = true; - } - } - } + if (typeof template === 'string') { + this.application.register('template:components/' + name, this.compile(template, { + moduleName: 'components/' + name + })); } - else { - if (oldObject[key] !== newObject[key]) { - results.changed[key] = newObject[key]; - didChange = true; - } + }; + + AbstractApplicationTestCase.prototype.registerController = function registerController(name, controller) { + this.application.register('controller:' + name, controller); + }; + + AbstractApplicationTestCase.prototype.registerEngine = function registerEngine(name, engine) { + this.application.register('engine:' + name, engine); + }; + + babelHelpers.createClass(AbstractApplicationTestCase, [{ + key: 'applicationOptions', + get: function () { + return { + rootElement: '#qunit-fixture', + autoboot: false + }; } - } - } + }, { + key: 'routerOptions', + get: function () { + return { + location: 'none' + }; + } + }, { + key: 'appRouter', + get: function () { + return this.applicationInstance.lookup('router:main'); + } + }]); + return AbstractApplicationTestCase; + })(_internalTestHelpersTestCasesAbstract.default); - return didChange && results; -} + exports.default = AbstractApplicationTestCase; +}); +enifed('internal-test-helpers/test-cases/abstract-rendering', ['exports', 'ember-utils', 'ember-template-compiler', 'ember-views', 'ember-glimmer', 'internal-test-helpers/test-cases/abstract', 'internal-test-helpers/build-owner', 'internal-test-helpers/run'], function (exports, _emberUtils, _emberTemplateCompiler, _emberViews, _emberGlimmer, _internalTestHelpersTestCasesAbstract, _internalTestHelpersBuildOwner, _internalTestHelpersRun) { + 'use strict'; -function promiseLabel(label) { - return 'Router: ' + label; -} + var TextNode = window.Text; -function subclass(parentConstructor, proto) { - function C(props) { - parentConstructor.call(this, props || {}); - } - C.prototype = oCreate(parentConstructor.prototype); - merge(C.prototype, proto); - return C; -} + var AbstractRenderingTestCase = (function (_AbstractTestCase) { + babelHelpers.inherits(AbstractRenderingTestCase, _AbstractTestCase); -function resolveHook(obj, hookName) { - if (!obj) { return; } - var underscored = "_" + hookName; - return obj[underscored] && underscored || - obj[hookName] && hookName; -} + function AbstractRenderingTestCase() { + _AbstractTestCase.call(this); + var owner = this.owner = _internalTestHelpersBuildOwner.default({ + ownerOptions: this.getOwnerOptions(), + bootOptions: this.getBootOptions(), + resolver: this.getResolver() + }); -function callHook(obj, _hookName, arg1, arg2) { - var hookName = resolveHook(obj, _hookName); - return hookName && obj[hookName].call(obj, arg1, arg2); -} + this.renderer = this.owner.lookup('renderer:-dom'); + this.element = _emberViews.jQuery('#qunit-fixture')[0]; + this.component = null; -function applyHook(obj, _hookName, args) { - var hookName = resolveHook(obj, _hookName); - if (hookName) { - if (args.length === 0) { - return obj[hookName].call(obj); - } else if (args.length === 1) { - return obj[hookName].call(obj, args[0]); - } else if (args.length === 2) { - return obj[hookName].call(obj, args[0], args[1]); - } else { - return obj[hookName].apply(obj, args); + owner.register('event_dispatcher:main', _emberViews.EventDispatcher); + owner.inject('event_dispatcher:main', '_viewRegistry', '-view-registry:main'); + owner.lookup('event_dispatcher:main').setup(this.getCustomDispatcherEvents(), this.element); } - } -} -function TransitionState() { - this.handlerInfos = []; - this.queryParams = {}; - this.params = {}; -} + AbstractRenderingTestCase.prototype.compile = function compile() { + return _emberTemplateCompiler.compile.apply(undefined, arguments); + }; -TransitionState.prototype = { - promiseLabel: function(label) { - var targetName = ''; - forEach(this.handlerInfos, function(handlerInfo) { - if (targetName !== '') { - targetName += '.'; - } - targetName += handlerInfo.name; - }); - return promiseLabel("'" + targetName + "': " + label); - }, + AbstractRenderingTestCase.prototype.getCustomDispatcherEvents = function getCustomDispatcherEvents() { + return {}; + }; - resolve: function(shouldContinue, payload) { - // First, calculate params for this state. This is useful - // information to provide to the various route hooks. - var params = this.params; - forEach(this.handlerInfos, function(handlerInfo) { - params[handlerInfo.name] = handlerInfo.params || {}; - }); + AbstractRenderingTestCase.prototype.getOwnerOptions = function getOwnerOptions() {}; - payload = payload || {}; - payload.resolveIndex = 0; + AbstractRenderingTestCase.prototype.getBootOptions = function getBootOptions() {}; - var currentState = this; - var wasAborted = false; + AbstractRenderingTestCase.prototype.getResolver = function getResolver() {}; - // The prelude RSVP.resolve() asyncs us into the promise land. - return rsvp.Promise.resolve(null, this.promiseLabel("Start transition")) - .then(resolveOneHandlerInfo, null, this.promiseLabel('Resolve handler'))['catch'](handleError, this.promiseLabel('Handle error')); + AbstractRenderingTestCase.prototype.teardown = function teardown() { + if (this.component) { + _internalTestHelpersRun.runDestroy(this.component); + } + if (this.owner) { + _internalTestHelpersRun.runDestroy(this.owner); + } + }; - function innerShouldContinue() { - return rsvp.Promise.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 rsvp.Promise.reject(reason); - }, currentState.promiseLabel("Handle abort")); - } + AbstractRenderingTestCase.prototype.render = function render(templateStr) { + var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + var owner = this.owner; - function handleError(error) { - // This is the only possible - // reject value of TransitionState#resolve - var handlerInfos = currentState.handlerInfos; - var errorHandlerIndex = payload.resolveIndex >= handlerInfos.length ? - handlerInfos.length - 1 : payload.resolveIndex; - return rsvp.Promise.reject({ - error: error, - handlerWithError: currentState.handlerInfos[errorHandlerIndex].handler, - wasAborted: wasAborted, - state: currentState + owner.register('template:-top-level', this.compile(templateStr, { + moduleName: '-top-level' + })); + + var attrs = _emberUtils.assign({}, context, { + tagName: '', + layoutName: '-top-level' }); - } - function proceed(resolvedHandlerInfo) { - var wasAlreadyResolved = currentState.handlerInfos[payload.resolveIndex].isResolved; + owner.register('component:-top-level', _emberGlimmer.Component.extend(attrs)); - // Swap the previously unresolved handlerInfo with - // the resolved handlerInfo - currentState.handlerInfos[payload.resolveIndex++] = resolvedHandlerInfo; + this.component = owner.lookup('component:-top-level'); - if (!wasAlreadyResolved) { - // Call the redirect hook. The reason we call it here - // vs. afterModel is so that redirects into child - // routes don't re-run the model hooks for this - // already-resolved route. - var handler = resolvedHandlerInfo.handler; - callHook(handler, 'redirect', resolvedHandlerInfo.context, payload); + _internalTestHelpersRun.runAppend(this.component); + }; + + AbstractRenderingTestCase.prototype.rerender = function rerender() { + this.component.rerender(); + }; + + AbstractRenderingTestCase.prototype.registerHelper = function registerHelper(name, funcOrClassBody) { + var type = typeof funcOrClassBody; + + if (type === 'function') { + this.owner.register('helper:' + name, _emberGlimmer.helper(funcOrClassBody)); + } else if (type === 'object' && type !== null) { + this.owner.register('helper:' + name, _emberGlimmer.Helper.extend(funcOrClassBody)); + } else { + throw new Error('Cannot register ' + funcOrClassBody + ' as a helper'); } + }; - // Proceed after ensuring that the redirect hook - // didn't abort this transition by transitioning elsewhere. - return innerShouldContinue().then(resolveOneHandlerInfo, null, currentState.promiseLabel('Resolve handler')); - } + AbstractRenderingTestCase.prototype.registerPartial = function registerPartial(name, template) { + var owner = this.env.owner || this.owner; + if (typeof template === 'string') { + var moduleName = 'template:' + name; + owner.register(moduleName, this.compile(template, { moduleName: moduleName })); + } + }; - function resolveOneHandlerInfo() { - if (payload.resolveIndex === currentState.handlerInfos.length) { - // This is is the only possible - // fulfill value of TransitionState#resolve - return { - error: null, - state: currentState - }; + AbstractRenderingTestCase.prototype.registerComponent = function registerComponent(name, _ref) { + var _ref$ComponentClass = _ref.ComponentClass; + var ComponentClass = _ref$ComponentClass === undefined ? null : _ref$ComponentClass; + var _ref$template = _ref.template; + var template = _ref$template === undefined ? null : _ref$template; + var owner = this.owner; + + if (ComponentClass) { + owner.register('component:' + name, ComponentClass); } - var handlerInfo = currentState.handlerInfos[payload.resolveIndex]; + if (typeof template === 'string') { + owner.register('template:components/' + name, this.compile(template, { + moduleName: 'components/' + name + })); + } + }; - return handlerInfo.resolve(innerShouldContinue, payload) - .then(proceed, null, currentState.promiseLabel('Proceed')); - } - } -}; + AbstractRenderingTestCase.prototype.registerTemplate = function registerTemplate(name, template) { + var owner = this.owner; -/** - A Transition is a thennable (a promise-like object) that represents - an attempt to transition to another route. It can be aborted, either - explicitly via `abort` or by attempting another transition while a - previous one is still underway. An aborted transition can also - be `retry()`d later. + if (typeof template === 'string') { + owner.register('template:' + name, this.compile(template, { + moduleName: name + })); + } else { + throw new Error('Registered template "' + name + '" must be a string'); + } + }; - @class Transition - @constructor - @param {Object} router - @param {Object} intent - @param {Object} state - @param {Object} error - @private - */ -function Transition(router, intent, state, error, previousTransition) { - var transition = this; - this.state = state || router.state; - this.intent = intent; - this.router = router; - this.data = this.intent && this.intent.data || {}; - this.resolvedModels = {}; - this.queryParams = {}; - this.promise = undefined; - this.error = undefined; - this.params = undefined; - this.handlerInfos = undefined; - this.targetName = undefined; - this.pivotHandler = undefined; - this.sequence = undefined; - this.isAborted = false; - this.isActive = true; + AbstractRenderingTestCase.prototype.registerService = function registerService(name, klass) { + this.owner.register('service:' + name, klass); + }; + + AbstractRenderingTestCase.prototype.assertTextNode = function assertTextNode(node, text) { + if (!(node instanceof TextNode)) { + throw new Error('Expecting a text node, but got ' + node); + } - if (error) { - this.promise = rsvp.Promise.reject(error); - this.error = error; - return; - } + this.assert.strictEqual(node.textContent, text, 'node.textContent'); + }; - // if you're doing multiple redirects, need the new transition to know if it - // is actually part of the first transition or not. Any further redirects - // in the initial transition also need to know if they are part of the - // initial transition - this.isCausedByAbortingTransition = !!previousTransition; - this.isCausedByInitialTransition = ( - previousTransition && ( - previousTransition.isCausedByInitialTransition || - previousTransition.sequence === 0 - ) - ); + babelHelpers.createClass(AbstractRenderingTestCase, [{ + key: 'context', + get: function () { + return this.component; + } + }]); + return AbstractRenderingTestCase; + })(_internalTestHelpersTestCasesAbstract.default); - if (state) { - this.params = state.params; - this.queryParams = state.queryParams; - this.handlerInfos = state.handlerInfos; + exports.default = AbstractRenderingTestCase; +}); +enifed('internal-test-helpers/test-cases/abstract', ['exports', 'ember-utils', 'ember-metal', 'ember-views', 'internal-test-helpers/equal-inner-html', 'internal-test-helpers/equal-tokens', 'internal-test-helpers/matchers'], function (exports, _emberUtils, _emberMetal, _emberViews, _internalTestHelpersEqualInnerHtml, _internalTestHelpersEqualTokens, _internalTestHelpersMatchers) { + 'use strict'; - var len = state.handlerInfos.length; - if (len) { - this.targetName = state.handlerInfos[len-1].name; - } + var TextNode = window.Text; + var HTMLElement = window.HTMLElement; + var Comment = window.Comment; - for (var i = 0; i < len; ++i) { - var handlerInfo = state.handlerInfos[i]; + function isMarker(node) { + if (node instanceof Comment && node.textContent === '') { + return true; + } - // TODO: this all seems hacky - if (!handlerInfo.isResolved) { break; } - this.pivotHandler = handlerInfo.handler; + if (node instanceof TextNode && node.textContent === '') { + return true; } - this.sequence = router.currentSequence++; - this.promise = state.resolve(checkForAbort, this)['catch']( - catchHandlerForTransition(transition), promiseLabel('Handle Abort')); - } else { - this.promise = rsvp.Promise.resolve(this.state); - this.params = {}; + return false; } - function checkForAbort() { - if (transition.isAborted) { - return rsvp.Promise.reject(undefined, promiseLabel("Transition aborted - reject")); + var AbstractTestCase = (function () { + function AbstractTestCase() { + this.element = null; + this.snapshot = null; + this.assert = QUnit.config.current.assert; } - } -} -function catchHandlerForTransition(transition) { - return function(result) { - if (result.wasAborted || transition.isAborted) { - return rsvp.Promise.reject(logAbort(transition)); - } else { - transition.trigger('error', result.error, transition, result.handlerWithError); - transition.abort(); - return rsvp.Promise.reject(result.error); - } - }; -} + AbstractTestCase.prototype.teardown = function teardown() {}; + AbstractTestCase.prototype.runTask = function runTask(callback) { + _emberMetal.run(callback); + }; -Transition.prototype = { - targetName: null, - urlMethod: 'update', - intent: null, - pivotHandler: null, - resolveIndex: 0, - resolvedModels: null, - state: null, - queryParamsOnly: false, + AbstractTestCase.prototype.runTaskNext = function runTaskNext(callback) { + _emberMetal.run.next(callback); + }; - isTransition: true, + // The following methods require `this.element` to work - isExiting: function(handler) { - var handlerInfos = this.handlerInfos; - for (var i = 0, len = handlerInfos.length; i < len; ++i) { - var handlerInfo = handlerInfos[i]; - if (handlerInfo.name === handler || handlerInfo.handler === handler) { - return false; + AbstractTestCase.prototype.nthChild = function nthChild(n) { + var i = 0; + var node = this.element.firstChild; + + while (node) { + if (!isMarker(node)) { + i++; + } + + if (i > n) { + break; + } else { + node = node.nextSibling; + } } - } - return true; - }, - /** - The Transition's internal promise. Calling `.then` on this property - is that same as calling `.then` on the Transition object itself, but - this property is exposed for when you want to pass around a - Transition's promise, but not the Transition object itself, since - Transition object can be externally `abort`ed, while the promise - cannot. + return node; + }; - @property promise - @type {Object} - @public - */ - promise: null, + AbstractTestCase.prototype.$ = function $(sel) { + return sel ? _emberViews.jQuery(sel, this.element) : _emberViews.jQuery(this.element); + }; - /** - Custom state can be stored on a Transition's `data` object. - This can be useful for decorating a Transition within an earlier - hook and shared with a later hook. Properties set on `data` will - be copied to new transitions generated by calling `retry` on this - transition. + AbstractTestCase.prototype.textValue = function textValue() { + return this.$().text(); + }; - @property data - @type {Object} - @public - */ - data: null, + AbstractTestCase.prototype.takeSnapshot = function takeSnapshot() { + var snapshot = this.snapshot = []; - /** - A standard promise hook that resolves if the transition - succeeds and rejects if it fails/redirects/aborts. + var node = this.element.firstChild; - Forwards to the internal `promise` property which you can - use in situations where you want to pass around a thennable, - but not the Transition itself. + while (node) { + if (!isMarker(node)) { + snapshot.push(node); + } - @method then - @param {Function} onFulfilled - @param {Function} onRejected - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - @public - */ - then: function(onFulfilled, onRejected, label) { - return this.promise.then(onFulfilled, onRejected, label); - }, + node = node.nextSibling; + } - /** + return snapshot; + }; - Forwards to the internal `promise` property which you can - use in situations where you want to pass around a thennable, - but not the Transition itself. + AbstractTestCase.prototype.assertText = function assertText(text) { + this.assert.strictEqual(this.textValue(), text, '#qunit-fixture content should be: `' + text + '`'); + }; - @method catch - @param {Function} onRejection - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - @public - */ - catch: function(onRejection, label) { - return this.promise.catch(onRejection, label); - }, + AbstractTestCase.prototype.assertInnerHTML = function assertInnerHTML(html) { + _internalTestHelpersEqualInnerHtml.default(this.element, html); + }; - /** + AbstractTestCase.prototype.assertHTML = function assertHTML(html) { + _internalTestHelpersEqualTokens.default(this.element, html, '#qunit-fixture content should be: `' + html + '`'); + }; - Forwards to the internal `promise` property which you can - use in situations where you want to pass around a thennable, - but not the Transition itself. + AbstractTestCase.prototype.assertElement = function assertElement(node, _ref) { + var _ref$ElementType = _ref.ElementType; + var ElementType = _ref$ElementType === undefined ? HTMLElement : _ref$ElementType; + var tagName = _ref.tagName; + var _ref$attrs = _ref.attrs; + var attrs = _ref$attrs === undefined ? null : _ref$attrs; + var _ref$content = _ref.content; + var content = _ref$content === undefined ? null : _ref$content; - @method finally - @param {Function} callback - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - @public - */ - finally: function(callback, label) { - return this.promise.finally(callback, label); - }, + if (!(node instanceof ElementType)) { + throw new Error('Expecting a ' + ElementType.name + ', but got ' + node); + } - /** - Aborts the Transition. Note you can also implicitly abort a transition - by initiating another transition while a previous one is underway. + _internalTestHelpersMatchers.equalsElement(node, tagName, attrs, content); + }; - @method abort - @return {Transition} this transition - @public - */ - abort: function() { - if (this.isAborted) { return this; } - 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; - }, + AbstractTestCase.prototype.assertComponentElement = function assertComponentElement(node, _ref2) { + var _ref2$ElementType = _ref2.ElementType; + var ElementType = _ref2$ElementType === undefined ? HTMLElement : _ref2$ElementType; + var _ref2$tagName = _ref2.tagName; + var tagName = _ref2$tagName === undefined ? 'div' : _ref2$tagName; + var _ref2$attrs = _ref2.attrs; + var attrs = _ref2$attrs === undefined ? null : _ref2$attrs; + var _ref2$content = _ref2.content; + var content = _ref2$content === undefined ? null : _ref2$content; - /** + attrs = _emberUtils.assign({}, { id: _internalTestHelpersMatchers.regex(/^ember\d*$/), class: _internalTestHelpersMatchers.classes('ember-view') }, attrs || {}); + this.assertElement(node, { ElementType: ElementType, tagName: tagName, attrs: attrs, content: content }); + }; - Retries a previously-aborted transition (making sure to abort the - transition if it's still active). Returns a new transition that - represents the new attempt to transition. + AbstractTestCase.prototype.assertSameNode = function assertSameNode(actual, expected) { + this.assert.strictEqual(actual, expected, 'DOM node stability'); + }; - @method retry - @return {Transition} new transition - @public - */ - retry: function() { - // TODO: add tests for merged state retry()s - this.abort(); - return this.router.transitionByIntent(this.intent, false); - }, + AbstractTestCase.prototype.assertInvariants = function assertInvariants(oldSnapshot, newSnapshot) { + oldSnapshot = oldSnapshot || this.snapshot; + newSnapshot = newSnapshot || this.takeSnapshot(); - /** + this.assert.strictEqual(newSnapshot.length, oldSnapshot.length, 'Same number of nodes'); - Sets the URL-changing method to be employed at the end of a - successful transition. By default, a new Transition will just - use `updateURL`, but passing 'replace' to this method will - cause the URL to update using 'replaceWith' instead. Omitting - a parameter will disable the URL change, allowing for transitions - that don't update the URL at completion (this is also used for - handleURL, since the URL has already changed before the - transition took place). + for (var i = 0; i < oldSnapshot.length; i++) { + this.assertSameNode(newSnapshot[i], oldSnapshot[i]); + } + }; - @method method - @param {String} method the type of URL-changing method to use - at the end of a transition. Accepted values are 'replace', - falsy values, or any other non-falsy value (which is - interpreted as an updateURL transition). + AbstractTestCase.prototype.assertPartialInvariants = function assertPartialInvariants(start, end) { + this.assertInvariants(this.snapshot, this.takeSnapshot().slice(start, end)); + }; - @return {Transition} this transition - @public - */ - method: function(method) { - this.urlMethod = method; - return this; - }, + AbstractTestCase.prototype.assertStableRerender = function assertStableRerender() { + var _this = this; - /** + this.takeSnapshot(); + this.runTask(function () { + return _this.rerender(); + }); + this.assertInvariants(); + }; - Fires an event on the current list of resolved/resolving - handlers within this transition. Useful for firing events - on route hierarchies that haven't fully been entered yet. + babelHelpers.createClass(AbstractTestCase, [{ + key: 'firstChild', + get: function () { + return this.nthChild(0); + } + }, { + key: 'nodesCount', + get: function () { + var count = 0; + var node = this.element.firstChild; - Note: This method is also aliased as `send` + while (node) { + if (!isMarker(node)) { + count++; + } - @method trigger - @param {Boolean} [ignoreFailure=false] a boolean specifying whether unhandled events throw an error - @param {String} name the name of the event to fire - @public - */ - trigger: function (ignoreFailure) { - var args = slice.call(arguments); - if (typeof ignoreFailure === 'boolean') { - args.shift(); - } else { - // Throw errors on unhandled trigger events by default - ignoreFailure = false; + node = node.nextSibling; + } + + return count; + } + }]); + return AbstractTestCase; + })(); + + exports.default = AbstractTestCase; +}); +enifed('internal-test-helpers/test-cases/application', ['exports', 'internal-test-helpers/test-cases/abstract-application'], function (exports, _internalTestHelpersTestCasesAbstractApplication) { + 'use strict'; + + var ApplicationTestCase = (function (_AbstractApplicationTestCase) { + babelHelpers.inherits(ApplicationTestCase, _AbstractApplicationTestCase); + + function ApplicationTestCase() { + _AbstractApplicationTestCase.apply(this, arguments); } - trigger(this.router, this.state.handlerInfos.slice(0, this.resolveIndex + 1), ignoreFailure, args); - }, - /** - Transitions are aborted and their promises rejected - when redirects occur; this method returns a promise - that will follow any redirects that occur and fulfill - with the value fulfilled by any redirecting transitions - that occur. + return ApplicationTestCase; + })(_internalTestHelpersTestCasesAbstractApplication.default); - @method followRedirects - @return {Promise} a promise that fulfills with the same - value that the final redirecting transition fulfills with - @public - */ - followRedirects: function() { - var router = this.router; - return this.promise['catch'](function(reason) { - if (router.activeTransition) { - return router.activeTransition.followRedirects(); - } - return rsvp.Promise.reject(reason); - }); - }, + exports.default = ApplicationTestCase; +}); +enifed('internal-test-helpers/test-cases/query-param', ['exports', 'ember-runtime', 'ember-routing', 'ember-metal', 'internal-test-helpers/test-cases/application'], function (exports, _emberRuntime, _emberRouting, _emberMetal, _internalTestHelpersTestCasesApplication) { + 'use strict'; - toString: function() { - return "Transition (sequence " + this.sequence + ")"; - }, + var QueryParamTestCase = (function (_ApplicationTestCase) { + babelHelpers.inherits(QueryParamTestCase, _ApplicationTestCase); - /** - @private - */ - log: function(message) { - log(this.router, this.sequence, message); - } -}; + function QueryParamTestCase() { + _ApplicationTestCase.call(this); -// Alias 'trigger' as 'send' -Transition.prototype.send = Transition.prototype.trigger; + var testCase = this; + testCase.expectedPushURL = null; + testCase.expectedReplaceURL = null; + this.application.register('location:test', _emberRouting.NoneLocation.extend({ + setURL: function (path) { + if (testCase.expectedReplaceURL) { + testCase.assert.ok(false, 'pushState occurred but a replaceState was expected'); + } -/** - @private + if (testCase.expectedPushURL) { + testCase.assert.equal(path, testCase.expectedPushURL, 'an expected pushState occurred'); + testCase.expectedPushURL = null; + } - Logs and returns a TransitionAborted error. - */ -function logAbort(transition) { - log(transition.router, transition.sequence, "detected abort."); - return new TransitionAborted(); -} + this.set('path', path); + }, -function TransitionAborted(message) { - this.message = (message || "TransitionAborted"); - this.name = "TransitionAborted"; -} + replaceURL: function (path) { + if (testCase.expectedPushURL) { + testCase.assert.ok(false, 'replaceState occurred but a pushState was expected'); + } -function TransitionIntent(props) { - this.initialize(props); + if (testCase.expectedReplaceURL) { + testCase.assert.equal(path, testCase.expectedReplaceURL, 'an expected replaceState occurred'); + testCase.expectedReplaceURL = null; + } - // TODO: wat - this.data = this.data || {}; -} + this.set('path', path); + } + })); + } -TransitionIntent.prototype = { - initialize: null, - applyToState: null -}; + QueryParamTestCase.prototype.visitAndAssert = function visitAndAssert(path) { + var _this = this; -var DEFAULT_HANDLER = Object.freeze({}); + return this.visit.apply(this, arguments).then(function () { + _this.assertCurrentPath(path); + }); + }; -function HandlerInfo(_props) { - var props = _props || {}; + QueryParamTestCase.prototype.getController = function getController(name) { + return this.applicationInstance.lookup('controller:' + name); + }; - // Set a default handler to ensure consistent object shape - this._handler = DEFAULT_HANDLER; + QueryParamTestCase.prototype.getRoute = function getRoute(name) { + return this.applicationInstance.lookup('route:' + name); + }; - if (props.handler) { - var name = props.name; + QueryParamTestCase.prototype.setAndFlush = function setAndFlush(obj, prop, value) { + return _emberMetal.run(obj, 'set', prop, value); + }; - // Setup a handlerPromise so that we can wait for asynchronously loaded handlers - this.handlerPromise = rsvp.Promise.resolve(props.handler); + QueryParamTestCase.prototype.assertCurrentPath = function assertCurrentPath(path) { + var message = arguments.length <= 1 || arguments[1] === undefined ? 'current path equals \'' + path + '\'' : arguments[1]; + return (function () { + this.assert.equal(this.appRouter.get('location.path'), path, message); + }).apply(this, arguments); + }; - // Wait until the 'handler' property has been updated when chaining to a handler - // that is a promise - if (isPromise(props.handler)) { - this.handlerPromise = this.handlerPromise.then(bind(this, this.updateHandler)); - props.handler = undefined; - } else if (props.handler) { - // Store the name of the handler on the handler for easy checks later - props.handler._handlerName = name; - } - } + /** + Sets up a Controller for a given route with a single query param and default + value. Can optionally extend the controller with an object. + @public + @method setSingleQPController + */ - merge(this, props); - this.initialize(props); -} + QueryParamTestCase.prototype.setSingleQPController = function setSingleQPController(routeName) { + var param = arguments.length <= 1 || arguments[1] === undefined ? 'foo' : arguments[1]; + var defaultValue = arguments.length <= 2 || arguments[2] === undefined ? 'bar' : arguments[2]; -HandlerInfo.prototype = { - name: null, + var _Controller$extend; - getHandler: function() {}, + var options = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3]; - fetchHandler: function() { - var handler = this.getHandler(this.name); + this.registerController(routeName, _emberRuntime.Controller.extend((_Controller$extend = { + queryParams: [param] + }, _Controller$extend[param] = defaultValue, _Controller$extend), options)); + }; - // Setup a handlerPromise so that we can wait for asynchronously loaded handlers - this.handlerPromise = rsvp.Promise.resolve(handler); + /** + Sets up a Controller for a given route with a custom property/url key mapping. + @public + @method setMappedQPController + */ - // Wait until the 'handler' property has been updated when chaining to a handler - // that is a promise - if (isPromise(handler)) { - this.handlerPromise = this.handlerPromise.then(bind(this, this.updateHandler)); - } else if (handler) { - // Store the name of the handler on the handler for easy checks later - handler._handlerName = this.name; - return this.handler = handler; - } + QueryParamTestCase.prototype.setMappedQPController = function setMappedQPController(routeName) { + var prop = arguments.length <= 1 || arguments[1] === undefined ? 'page' : arguments[1]; + var urlKey = arguments.length <= 2 || arguments[2] === undefined ? 'parentPage' : arguments[2]; + var defaultValue = arguments.length <= 3 || arguments[3] === undefined ? 1 : arguments[3]; - return this.handler = undefined; - }, + var _queryParams, _Controller$extend2; - _handlerPromise: undefined, + var options = arguments.length <= 4 || arguments[4] === undefined ? {} : arguments[4]; - params: null, - context: null, + this.registerController(routeName, _emberRuntime.Controller.extend((_Controller$extend2 = { + queryParams: (_queryParams = {}, _queryParams[prop] = urlKey, _queryParams) + }, _Controller$extend2[prop] = defaultValue, _Controller$extend2), options)); + }; - // Injected by the handler info factory. - factory: null, + babelHelpers.createClass(QueryParamTestCase, [{ + key: 'routerOptions', + get: function () { + return { + location: 'test' + }; + } + }]); + return QueryParamTestCase; + })(_internalTestHelpersTestCasesApplication.default); - initialize: function() {}, + exports.default = QueryParamTestCase; +}); +enifed('internal-test-helpers/test-cases/rendering', ['exports', 'ember-views', 'internal-test-helpers/test-cases/abstract-rendering'], function (exports, _emberViews, _internalTestHelpersTestCasesAbstractRendering) { + 'use strict'; - log: function(payload, message) { - if (payload.log) { - payload.log(this.name + ': ' + message); - } - }, + var RenderingTestCase = (function (_AbstractRenderingTestCase) { + babelHelpers.inherits(RenderingTestCase, _AbstractRenderingTestCase); - promiseLabel: function(label) { - return promiseLabel("'" + this.name + "' " + label); - }, + function RenderingTestCase() { + _AbstractRenderingTestCase.call(this); + var owner = this.owner; - getUnresolved: function() { - return this; - }, + this.env = owner.lookup('service:-glimmer-environment'); + owner.register('component-lookup:main', _emberViews.ComponentLookup); + owner.registerOptionsForType('helper', { instantiate: false }); + owner.registerOptionsForType('component', { singleton: false }); + } - serialize: function() { - return this.params || {}; - }, + return RenderingTestCase; + })(_internalTestHelpersTestCasesAbstractRendering.default); - updateHandler: function(handler) { - // Store the name of the handler on the handler for easy checks later - handler._handlerName = this.name; - return this.handler = handler; - }, + exports.default = RenderingTestCase; +}); +enifed('internal-test-helpers/test-cases/router', ['exports', 'internal-test-helpers/test-cases/application'], function (exports, _internalTestHelpersTestCasesApplication) { + 'use strict'; - resolve: function(shouldContinue, payload) { - var checkForAbort = bind(this, this.checkForAbort, shouldContinue), - beforeModel = bind(this, this.runBeforeModelHook, payload), - model = bind(this, this.getModel, payload), - afterModel = bind(this, this.runAfterModelHook, payload), - becomeResolved = bind(this, this.becomeResolved, payload), - self = this; + var RouterTestCase = (function (_ApplicationTestCase) { + babelHelpers.inherits(RouterTestCase, _ApplicationTestCase); - return rsvp.Promise.resolve(this.handlerPromise, this.promiseLabel("Start handler")) - .then(function(handler) { - // We nest this chain in case the handlerPromise has an error so that - // we don't have to bubble it through every step - return rsvp.Promise.resolve(handler) - .then(checkForAbort, null, self.promiseLabel("Check for abort")) - .then(beforeModel, null, self.promiseLabel("Before model")) - .then(checkForAbort, null, self.promiseLabel("Check if aborted during 'beforeModel' hook")) - .then(model, null, self.promiseLabel("Model")) - .then(checkForAbort, null, self.promiseLabel("Check if aborted in 'model' hook")) - .then(afterModel, null, self.promiseLabel("After model")) - .then(checkForAbort, null, self.promiseLabel("Check if aborted in 'afterModel' hook")) - .then(becomeResolved, null, self.promiseLabel("Become resolved")); - }, function(error) { - throw error; - }); - }, + function RouterTestCase() { + _ApplicationTestCase.call(this); - runBeforeModelHook: function(payload) { - if (payload.trigger) { - payload.trigger(true, 'willResolveModel', payload, this.handler); + this.router.map(function () { + this.route('parent', { path: '/' }, function () { + this.route('child'); + this.route('sister'); + this.route('brother'); + }); + this.route('dynamic', { path: '/dynamic/:post_id' }); + }); } - return this.runSharedModelHook(payload, 'beforeModel', []); - }, - runAfterModelHook: function(payload, resolvedModel) { - // Stash the resolved model on the payload. - // This makes it possible for users to swap out - // the resolved model in afterModel. - var name = this.name; - this.stashResolvedModel(payload, resolvedModel); + babelHelpers.createClass(RouterTestCase, [{ + key: 'routerService', + get: function () { + return this.applicationInstance.lookup('service:router'); + } + }]); + return RouterTestCase; + })(_internalTestHelpersTestCasesApplication.default); - 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")); - }, + exports.default = RouterTestCase; +}); +enifed('internal-test-helpers/test-groups', ['exports', 'ember-environment', 'ember-metal'], function (exports, _emberEnvironment, _emberMetal) { + 'use strict'; - runSharedModelHook: function(payload, hookName, args) { - this.log(payload, "calling " + hookName + " hook"); + exports.testBoth = testBoth; + exports.testWithDefault = testWithDefault; - if (this.queryParams) { - args.push(this.queryParams); + // used by unit tests to test both accessor mode and non-accessor mode + + function testBoth(testname, callback) { + function emberget(x, y) { + return _emberMetal.get(x, y); + } + function emberset(x, y, z) { + return _emberMetal.set(x, y, z); + } + function aget(x, y) { + return x[y]; + } + function aset(x, y, z) { + return x[y] = z; } - args.push(payload); - var result = applyHook(this.handler, hookName, args); + QUnit.test(testname + ' using getFromEmberMetal()/Ember.set()', function () { + callback(emberget, emberset); + }); - if (result && result.isTransition) { - result = null; + QUnit.test(testname + ' using accessors', function () { + if (_emberEnvironment.ENV.USES_ACCESSORS) { + callback(aget, aset); + } else { + ok('SKIPPING ACCESSORS'); + } + }); + } + + function testWithDefault(testname, callback) { + function emberget(x, y) { + return _emberMetal.get(x, y); + } + function embergetwithdefault(x, y, z) { + return _emberMetal.getWithDefault(x, y, z); + } + function getwithdefault(x, y, z) { + return x.getWithDefault(y, z); + } + function emberset(x, y, z) { + return _emberMetal.set(x, y, z); + } + function aget(x, y) { + return x[y]; + } + function aset(x, y, z) { + return x[y] = z; } - return rsvp.Promise.resolve(result, this.promiseLabel("Resolve value returned from one of the model hooks")); - }, + QUnit.test(testname + ' using obj.get()', function () { + callback(emberget, emberset); + }); - // overridden by subclasses - getModel: null, + QUnit.test(testname + ' using obj.getWithDefault()', function () { + callback(getwithdefault, emberset); + }); - checkForAbort: function(shouldContinue, promiseValue) { - return rsvp.Promise.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")); - }, + QUnit.test(testname + ' using getFromEmberMetal()', function () { + callback(emberget, emberset); + }); - stashResolvedModel: function(payload, resolvedModel) { - payload.resolvedModels = payload.resolvedModels || {}; - payload.resolvedModels[this.name] = resolvedModel; - }, + QUnit.test(testname + ' using Ember.getWithDefault()', function () { + callback(embergetwithdefault, emberset); + }); - becomeResolved: function(payload, resolvedContext) { - var params = this.serialize(resolvedContext); + QUnit.test(testname + ' using accessors', function () { + if (_emberEnvironment.ENV.USES_ACCESSORS) { + callback(aget, aset); + } else { + ok('SKIPPING ACCESSORS'); + } + }); + } +}); +enifed('route-recognizer', ['exports'], function (exports) { 'use strict'; - if (payload) { - this.stashResolvedModel(payload, resolvedContext); - payload.params = payload.params || {}; - payload.params[this.name] = params; +var createObject = Object.create; +function createMap() { + var map = createObject(null); + map["__"] = undefined; + delete map["__"]; + return map; +} + +var Target = function Target(path, matcher, delegate) { + this.path = path; + this.matcher = matcher; + this.delegate = delegate; +}; +Target.prototype.to = function to (target, callback) { + var delegate = this.delegate; + if (delegate && delegate.willAddRoute) { + target = delegate.willAddRoute(this.matcher.target, target); + } + this.matcher.add(this.path, target); + if (callback) { + if (callback.length === 0) { + throw new Error("You must have an argument in the function passed to `to`"); + } + this.matcher.addChild(this.path, target, callback, this.delegate); + } +}; +var Matcher = function Matcher(target) { + this.routes = createMap(); + this.children = createMap(); + this.target = target; +}; +Matcher.prototype.add = function add (path, target) { + this.routes[path] = target; +}; +Matcher.prototype.addChild = function addChild (path, target, callback, delegate) { + var matcher = new Matcher(target); + this.children[path] = matcher; + var match = generateMatch(path, matcher, delegate); + if (delegate && delegate.contextEntered) { + delegate.contextEntered(target, match); + } + callback(match); +}; +function generateMatch(startingPath, matcher, delegate) { + function match(path, callback) { + var fullPath = startingPath + path; + if (callback) { + callback(generateMatch(fullPath, matcher, delegate)); + } + else { + return new Target(fullPath, matcher, delegate); + } } + ; + return match; +} +function addRoute(routeArray, path, handler) { + var len = 0; + for (var i = 0; i < routeArray.length; i++) { + len += routeArray[i].path.length; + } + path = path.substr(len); + var route = { path: path, handler: handler }; + routeArray.push(route); +} +function eachRoute(baseRoute, matcher, callback, binding) { + var routes = matcher.routes; + var paths = Object.keys(routes); + for (var i = 0; i < paths.length; i++) { + var path = paths[i]; + var routeArray = baseRoute.slice(); + addRoute(routeArray, path, routes[path]); + var nested = matcher.children[path]; + if (nested) { + eachRoute(routeArray, nested, callback, binding); + } + else { + callback.call(binding, routeArray); + } + } +} +function map (callback, addRouteCallback) { + var matcher = new Matcher(); + callback(generateMatch("", matcher, this.delegate)); + eachRoute([], matcher, function (routes) { + if (addRouteCallback) { + addRouteCallback(this, routes); + } + else { + this.add(routes); + } + }, this); +} - return this.factory('resolved', { - context: resolvedContext, - name: this.name, - handler: this.handler, - params: params - }); - }, +// Normalizes percent-encoded values in `path` to upper-case and decodes percent-encoded +// values that are not reserved (i.e., unicode characters, emoji, etc). The reserved +// chars are "/" and "%". +// Safe to call multiple times on the same path. +// Normalizes percent-encoded values in `path` to upper-case and decodes percent-encoded +function normalizePath(path) { + return path.split("/") + .map(normalizeSegment) + .join("/"); +} +// We want to ensure the characters "%" and "/" remain in percent-encoded +// form when normalizing paths, so replace them with their encoded form after +// decoding the rest of the path +var SEGMENT_RESERVED_CHARS = /%|\//g; +function normalizeSegment(segment) { + if (segment.length < 3 || segment.indexOf("%") === -1) + { return segment; } + return decodeURIComponent(segment).replace(SEGMENT_RESERVED_CHARS, encodeURIComponent); +} +// We do not want to encode these characters when generating dynamic path segments +// See https://tools.ietf.org/html/rfc3986#section-3.3 +// sub-delims: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=" +// others allowed by RFC 3986: ":", "@" +// +// First encode the entire path segment, then decode any of the encoded special chars. +// +// The chars "!", "'", "(", ")", "*" do not get changed by `encodeURIComponent`, +// so the possible encoded chars are: +// ['%24', '%26', '%2B', '%2C', '%3B', '%3D', '%3A', '%40']. +var PATH_SEGMENT_ENCODINGS = /%(?:2(?:4|6|B|C)|3(?:B|D|A)|40)/g; +function encodePathSegment(str) { + return encodeURIComponent(str).replace(PATH_SEGMENT_ENCODINGS, decodeURIComponent); +} - shouldSupercede: function(other) { - // Prefer this newer handlerInfo over `other` if: - // 1) The other one doesn't exist - // 2) The names don't match - // 3) This handler has a context that doesn't match - // the other one (or the other one doesn't have one). - // 4) This handler has parameters that don't match the other. - if (!other) { return true; } +var escapeRegex = /(\/|\.|\*|\+|\?|\||\(|\)|\[|\]|\{|\}|\\)/g; +var isArray = Array.isArray; +var hasOwnProperty = Object.prototype.hasOwnProperty; +function getParam(params, key) { + if (typeof params !== "object" || params === null) { + throw new Error("You must pass an object as the second argument to `generate`."); + } + if (!hasOwnProperty.call(params, key)) { + throw new Error("You must provide param `" + key + "` to `generate`."); + } + var value = params[key]; + var str = typeof value === "string" ? value : "" + value; + if (str.length === 0) { + throw new Error("You must provide a param `" + key + "`."); + } + return str; +} +var eachChar = []; +eachChar[0 /* Static */] = function (segment, currentState) { + var state = currentState; + var value = segment.value; + for (var i = 0; i < value.length; i++) { + var ch = value.charCodeAt(i); + state = state.put(ch, false, false); + } + return state; +}; +eachChar[1 /* Dynamic */] = function (_, currentState) { + return currentState.put(47 /* SLASH */, true, true); +}; +eachChar[2 /* Star */] = function (_, currentState) { + return currentState.put(-1 /* ANY */, false, true); +}; +eachChar[4 /* Epsilon */] = function (_, currentState) { + return currentState; +}; +var regex = []; +regex[0 /* Static */] = function (segment) { + return segment.value.replace(escapeRegex, "\\$1"); +}; +regex[1 /* Dynamic */] = function () { + return "([^/]+)"; +}; +regex[2 /* Star */] = function () { + return "(.+)"; +}; +regex[4 /* Epsilon */] = function () { + return ""; +}; +var generate = []; +generate[0 /* Static */] = function (segment) { + return segment.value; +}; +generate[1 /* Dynamic */] = function (segment, params) { + var value = getParam(params, segment.value); + if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS) { + return encodePathSegment(value); + } + else { + return value; + } +}; +generate[2 /* Star */] = function (segment, params) { + return getParam(params, segment.value); +}; +generate[4 /* Epsilon */] = function () { + return ""; +}; +// The `names` will be populated with the paramter name for each dynamic/star +// segment. `shouldDecodes` will be populated with a boolean for each dyanamic/star +// segment, indicating whether it should be decoded during recognition. +function parse(segments, route, names, types, shouldDecodes) { + // normalize route as not starting with a "/". Recognition will + // also normalize. + if (route.length > 0 && route.charCodeAt(0) === 47 /* SLASH */) { + route = route.substr(1); + } + var parts = route.split("/"); + for (var i = 0; i < parts.length; i++) { + var part = parts[i]; + var flags = 0; + var type = 0; + if (part === "") { + type = 4 /* Epsilon */; + } + else if (part.charCodeAt(0) === 58 /* COLON */) { + type = 1 /* Dynamic */; + } + else if (part.charCodeAt(0) === 42 /* STAR */) { + type = 2 /* Star */; + } + else { + type = 0 /* Static */; + } + flags = 2 << type; + if (flags & 12 /* Named */) { + part = part.slice(1); + names.push(part); + shouldDecodes.push((flags & 4 /* Decoded */) !== 0); + } + if (flags & 14 /* Counted */) { + types[type]++; + } + segments.push({ type: type, value: normalizeSegment(part) }); + } +} +function isEqualCharSpec(spec, char, negate) { + return spec.char === char && spec.negate === negate; +} +// A State has a character specification and (`charSpec`) and a list of possible +// subsequent states (`nextStates`). +// +// If a State is an accepting state, it will also have several additional +// properties: +// +// * `regex`: A regular expression that is used to extract parameters from paths +// that reached this accepting state. +// * `handlers`: Information on how to convert the list of captures into calls +// to registered handlers with the specified parameters +// * `types`: How many static, dynamic or star segments in this route. Used to +// decide which route to use if multiple registered routes match a path. +// +// Currently, State is implemented naively by looping over `nextStates` and +// comparing a character specification against a character. A more efficient +// implementation would use a hash of keys pointing at one or more next states. +var State = function State(states, id, char, negate, repeat) { + this.states = states; + this.id = id; + this.char = char; + this.negate = negate; + this.nextStates = repeat ? id : null; + this.pattern = ""; + this._regex = undefined; + this.handlers = undefined; + this.types = undefined; +}; +State.prototype.regex = function regex$1 () { + if (!this._regex) { + this._regex = new RegExp(this.pattern); + } + return this._regex; +}; +State.prototype.get = function get (char, negate) { + var this$1 = this; - var contextsMatch = (other.context === this.context); - return other.name !== this.name || - (this.hasOwnProperty('context') && !contextsMatch) || - (this.hasOwnProperty('params') && !paramsMatch(this.params, other.params)); - } + var nextStates = this.nextStates; + if (nextStates === null) + { return; } + if (isArray(nextStates)) { + for (var i = 0; i < nextStates.length; i++) { + var child = this$1.states[nextStates[i]]; + if (isEqualCharSpec(child, char, negate)) { + return child; + } + } + } + else { + var child$1 = this.states[nextStates]; + if (isEqualCharSpec(child$1, char, negate)) { + return child$1; + } + } +}; +State.prototype.put = function put (char, negate, repeat) { + var state; + // If the character specification already exists in a child of the current + // state, just return that state. + if (state = this.get(char, negate)) { + return state; + } + // Make a new state for the character spec + var states = this.states; + state = new State(states, states.length, char, negate, repeat); + states[states.length] = state; + // Insert the new state as a child of the current state + if (this.nextStates == null) { + this.nextStates = state.id; + } + else if (isArray(this.nextStates)) { + this.nextStates.push(state.id); + } + else { + this.nextStates = [this.nextStates, state.id]; + } + // Return the new state + return state; }; +// Find a list of child states matching the next character +State.prototype.match = function match (ch) { + var this$1 = this; -Object.defineProperty(HandlerInfo.prototype, 'handler', { - get: function() { - // _handler could be set to either a handler object or undefined, so we - // compare against a default reference to know when it's been set - if (this._handler !== DEFAULT_HANDLER) { - return this._handler; + var nextStates = this.nextStates; + if (!nextStates) + { return []; } + var returned = []; + if (isArray(nextStates)) { + for (var i = 0; i < nextStates.length; i++) { + var child = this$1.states[nextStates[i]]; + if (isMatch(child, ch)) { + returned.push(child); + } + } + } + else { + var child$1 = this.states[nextStates]; + if (isMatch(child$1, ch)) { + returned.push(child$1); + } + } + return returned; +}; +function isMatch(spec, char) { + return spec.negate ? spec.char !== char && spec.char !== -1 /* ANY */ : spec.char === char || spec.char === -1 /* ANY */; +} +// This is a somewhat naive strategy, but should work in a lot of cases +// A better strategy would properly resolve /posts/:id/new and /posts/edit/:id. +// +// This strategy generally prefers more static and less dynamic matching. +// Specifically, it +// +// * prefers fewer stars to more, then +// * prefers using stars for less of the match to more, then +// * prefers fewer dynamic segments to more, then +// * prefers more static segments to more +function sortSolutions(states) { + return states.sort(function (a, b) { + var ref = a.types || [0, 0, 0]; + var astatics = ref[0]; + var adynamics = ref[1]; + var astars = ref[2]; + var ref$1 = b.types || [0, 0, 0]; + var bstatics = ref$1[0]; + var bdynamics = ref$1[1]; + var bstars = ref$1[2]; + if (astars !== bstars) { + return astars - bstars; + } + if (astars) { + if (astatics !== bstatics) { + return bstatics - astatics; + } + if (adynamics !== bdynamics) { + return bdynamics - adynamics; + } + } + if (adynamics !== bdynamics) { + return adynamics - bdynamics; + } + if (astatics !== bstatics) { + return bstatics - astatics; + } + return 0; + }); +} +function recognizeChar(states, ch) { + var nextStates = []; + for (var i = 0, l = states.length; i < l; i++) { + var state = states[i]; + nextStates = nextStates.concat(state.match(ch)); + } + return nextStates; +} +var RecognizeResults = function RecognizeResults(queryParams) { + this.length = 0; + this.queryParams = queryParams || {}; +}; +; +RecognizeResults.prototype.splice = Array.prototype.splice; +RecognizeResults.prototype.slice = Array.prototype.slice; +RecognizeResults.prototype.push = Array.prototype.push; +function findHandler(state, originalPath, queryParams) { + var handlers = state.handlers; + var regex = state.regex(); + if (!regex || !handlers) + { throw new Error("state not initialized"); } + var captures = originalPath.match(regex); + var currentCapture = 1; + var result = new RecognizeResults(queryParams); + result.length = handlers.length; + for (var i = 0; i < handlers.length; i++) { + var handler = handlers[i]; + var names = handler.names; + var shouldDecodes = handler.shouldDecodes; + var params = {}; + for (var j = 0; j < names.length; j++) { + var name = names[j]; + var capture = captures && captures[currentCapture++]; + if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS && shouldDecodes[j]) { + params[name] = capture && decodeURIComponent(capture); + } + else { + params[name] = capture; + } + } + result[i] = { handler: handler.handler, params: params, isDynamic: !!names.length }; + } + return result; +} +function decodeQueryParamPart(part) { + // http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1 + part = part.replace(/\+/gm, "%20"); + var result; + try { + result = decodeURIComponent(part); + } + catch (error) { + result = ""; + } + return result; +} +var RouteRecognizer = function RouteRecognizer() { + this.names = createMap(); + var states = []; + var state = new State(states, 0, -1 /* ANY */, true, false); + states[0] = state; + this.states = states; + this.rootState = state; +}; +RouteRecognizer.prototype.add = function add (routes, options) { + var currentState = this.rootState; + var pattern = "^"; + var types = [0, 0, 0]; + var handlers = new Array(routes.length); + var allSegments = []; + var isEmpty = true; + var j = 0; + for (var i = 0; i < routes.length; i++) { + var route = routes[i]; + var names = []; + var shouldDecodes = []; + parse(allSegments, route.path, names, types, shouldDecodes); + // preserve j so it points to the start of newly added segments + for (; j < allSegments.length; j++) { + var segment = allSegments[j]; + if (segment.type === 4 /* Epsilon */) { + continue; + } + isEmpty = false; + // Add a "/" for the new segment + currentState = currentState.put(47 /* SLASH */, false, false); + pattern += "/"; + // Add a representation of the segment to the NFA and regex + currentState = eachChar[segment.type](segment, currentState); + pattern += regex[segment.type](segment); + } + var handler = { handler: route.handler, names: names, shouldDecodes: shouldDecodes }; + handlers[i] = handler; + } + if (isEmpty) { + currentState = currentState.put(47 /* SLASH */, false, false); + pattern += "/"; + } + currentState.handlers = handlers; + currentState.pattern = pattern + "$"; + currentState.types = types; + var name; + if (typeof options === "object" && options !== null && options.as) { + name = options.as; + } + if (name) { + // if (this.names[name]) { + // throw new Error("You may not add a duplicate route named `" + name + "`."); + // } + this.names[name] = { + segments: allSegments, + handlers: handlers + }; + } +}; +RouteRecognizer.prototype.handlersFor = function handlersFor (name) { + var route = this.names[name]; + if (!route) { + throw new Error("There is no route named " + name); + } + var result = new Array(route.handlers.length); + for (var i = 0; i < route.handlers.length; i++) { + result[i] = route.handlers[i]; + } + return result; +}; +RouteRecognizer.prototype.hasRoute = function hasRoute (name) { + return !!this.names[name]; +}; +RouteRecognizer.prototype.generate = function generate$1 (name, params) { + var route = this.names[name]; + var output = ""; + if (!route) { + throw new Error("There is no route named " + name); + } + var segments = route.segments; + for (var i = 0; i < segments.length; i++) { + var segment = segments[i]; + if (segment.type === 4 /* Epsilon */) { + continue; + } + output += "/"; + output += generate[segment.type](segment, params); + } + if (output.charAt(0) !== "/") { + output = "/" + output; + } + if (params && params.queryParams) { + output += this.generateQueryString(params.queryParams); + } + return output; +}; +RouteRecognizer.prototype.generateQueryString = function generateQueryString (params) { + var pairs = []; + var keys = Object.keys(params); + keys.sort(); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = params[key]; + if (value == null) { + continue; + } + var pair = encodeURIComponent(key); + if (isArray(value)) { + for (var j = 0; j < value.length; j++) { + var arrayPair = key + "[]" + "=" + encodeURIComponent(value[j]); + pairs.push(arrayPair); + } + } + else { + pair += "=" + encodeURIComponent(value); + pairs.push(pair); + } + } + if (pairs.length === 0) { + return ""; + } + return "?" + pairs.join("&"); +}; +RouteRecognizer.prototype.parseQueryString = function parseQueryString (queryString) { + var pairs = queryString.split("&"); + var queryParams = {}; + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i].split("="), key = decodeQueryParamPart(pair[0]), keyLength = key.length, isArray = false, value = (void 0); + if (pair.length === 1) { + value = "true"; + } + else { + // Handle arrays + if (keyLength > 2 && key.slice(keyLength - 2) === "[]") { + isArray = true; + key = key.slice(0, keyLength - 2); + if (!queryParams[key]) { + queryParams[key] = []; + } + } + value = pair[1] ? decodeQueryParamPart(pair[1]) : ""; + } + if (isArray) { + queryParams[key].push(value); + } + else { + queryParams[key] = value; + } + } + return queryParams; +}; +RouteRecognizer.prototype.recognize = function recognize (path) { + var results; + var states = [this.rootState]; + var queryParams = {}; + var isSlashDropped = false; + var hashStart = path.indexOf("#"); + if (hashStart !== -1) { + path = path.substr(0, hashStart); + } + var queryStart = path.indexOf("?"); + if (queryStart !== -1) { + var queryString = path.substr(queryStart + 1, path.length); + path = path.substr(0, queryStart); + queryParams = this.parseQueryString(queryString); + } + if (path.charAt(0) !== "/") { + path = "/" + path; + } + var originalPath = path; + if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS) { + path = normalizePath(path); + } + else { + path = decodeURI(path); + originalPath = decodeURI(originalPath); + } + var pathLen = path.length; + if (pathLen > 1 && path.charAt(pathLen - 1) === "/") { + path = path.substr(0, pathLen - 1); + originalPath = originalPath.substr(0, originalPath.length - 1); + isSlashDropped = true; } - - return this.fetchHandler(); - }, - - set: function(handler) { - return this._handler = handler; - } -}); - -Object.defineProperty(HandlerInfo.prototype, 'handlerPromise', { - get: function() { - if (this._handlerPromise) { - return this._handlerPromise; + for (var i = 0; i < path.length; i++) { + states = recognizeChar(states, path.charCodeAt(i)); + if (!states.length) { + break; + } + } + var solutions = []; + for (var i$1 = 0; i$1 < states.length; i$1++) { + if (states[i$1].handlers) { + solutions.push(states[i$1]); + } + } + states = sortSolutions(solutions); + 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.pattern && state.pattern.slice(-5) === "(.+)$") { + originalPath = originalPath + "/"; + } + results = findHandler(state, originalPath, queryParams); } + return results; +}; +RouteRecognizer.VERSION = "0.3.0"; +// Set to false to opt-out of encoding and decoding path segments. +// See https://github.com/tildeio/route-recognizer/pull/55 +RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS = true; +RouteRecognizer.Normalizer = { + normalizeSegment: normalizeSegment, normalizePath: normalizePath, encodePathSegment: encodePathSegment +}; +RouteRecognizer.prototype.map = map; - this.fetchHandler(); +exports['default'] = RouteRecognizer; - return this._handlerPromise; - }, +Object.defineProperty(exports, '__esModule', { value: true }); - set: function(handlerPromise) { - return this._handlerPromise = handlerPromise; - } }); +enifed('router', ['exports', 'route-recognizer', 'rsvp'], function (exports, RouteRecognizer, rsvp) { 'use strict'; -function paramsMatch(a, b) { - if ((!a) ^ (!b)) { - // Only one is null. - return false; - } +RouteRecognizer = 'default' in RouteRecognizer ? RouteRecognizer['default'] : RouteRecognizer; - if (!a) { - // Both must be null. - return true; - } +var slice = Array.prototype.slice; - // Note: this assumes that both params have the same - // number of keys, but since we're comparing the - // same handlers, they should. - for (var k in a) { - if (a.hasOwnProperty(k) && a[k] !== b[k]) { - return false; - } - } - return true; +var _isArray; +if (!Array.isArray) { + _isArray = function (x) { + return Object.prototype.toString.call(x) === "[object Array]"; + }; +} else { + _isArray = Array.isArray; } -var ResolvedHandlerInfo = subclass(HandlerInfo, { - resolve: function(shouldContinue, payload) { - // A ResolvedHandlerInfo just resolved with itself. - if (payload && payload.resolvedModels) { - payload.resolvedModels[this.name] = this.context; - } - return rsvp.Promise.resolve(this, this.promiseLabel("Resolve")); - }, - - getUnresolved: function() { - return this.factory('param', { - name: this.name, - handler: this.handler, - params: this.params - }); - }, +var isArray = _isArray; - isResolved: true -}); +/** + Determines if an object is Promise by checking if it is "thenable". +**/ +function isPromise(obj) { + return ((typeof obj === 'object' && obj !== null) || typeof obj === 'function') && typeof obj.then === 'function'; +} -var UnresolvedHandlerInfoByObject = subclass(HandlerInfo, { - getModel: function(payload) { - this.log(payload, this.name + ": resolving provided model"); - return rsvp.Promise.resolve(this.context); - }, +function merge(hash, other) { + for (var prop in other) { + if (other.hasOwnProperty(prop)) { hash[prop] = other[prop]; } + } +} - initialize: function(props) { - this.names = props.names || []; - this.context = props.context; - }, +var oCreate = Object.create || function(proto) { + function F() {} + F.prototype = proto; + return new F(); +}; - /** - @private +/** + @private - Serializes a handler using its custom `serialize` method or - by a default that looks up the expected property name from - the dynamic segment. + Extracts query params from the end of an array +**/ +function extractQueryParams(array) { + var len = (array && array.length), head, queryParams; - @param {Object} model the model to be serialized for this handler - */ - serialize: function(_model) { - var model = _model || this.context, - names = this.names, - serializer = this.serializer || (this.handler && this.handler.serialize); + if(len && len > 0 && array[len - 1] && array[len - 1].hasOwnProperty('queryParams')) { + queryParams = array[len - 1].queryParams; + head = slice.call(array, 0, len - 1); + return [head, queryParams]; + } else { + return [array, null]; + } +} - var object = {}; - if (isParam(model)) { - object[names[0]] = model; - return object; - } +/** + @private - // Use custom serialize if it exists. - if (serializer) { - return serializer(model, names); + Coerces query param properties and array elements into strings. +**/ +function coerceQueryParamsToString(queryParams) { + for (var key in queryParams) { + if (typeof queryParams[key] === 'number') { + queryParams[key] = '' + queryParams[key]; + } else if (isArray(queryParams[key])) { + for (var i = 0, l = queryParams[key].length; i < l; i++) { + queryParams[key][i] = '' + queryParams[key][i]; + } } + } +} +/** + @private + */ +function log(router, sequence, msg) { + if (!router.log) { return; } - if (names.length !== 1) { return; } - - var name = names[0]; - - if (/_id$/.test(name)) { - object[name] = model.id; - } else { - object[name] = model; - } - return object; + if (arguments.length === 3) { + router.log("Transition #" + sequence + ": " + msg); + } else { + msg = sequence; + router.log(msg); } -}); +} -// Generated by URL transitions and non-dynamic route segments in named Transitions. -var UnresolvedHandlerInfoByParam = subclass (HandlerInfo, { - initialize: function(props) { - this.params = props.params || {}; - }, +function bind(context, fn) { + var boundArgs = arguments; + return function(value) { + var args = slice.call(boundArgs, 2); + args.push(value); + return fn.apply(context, args); + }; +} - getModel: function(payload) { - var fullParams = this.params; - if (payload && payload.queryParams) { - fullParams = {}; - merge(fullParams, this.params); - fullParams.queryParams = payload.queryParams; - } +function isParam(object) { + return (typeof object === "string" || object instanceof String || typeof object === "number" || object instanceof Number); +} - var handler = this.handler; - var hookName = resolveHook(handler, 'deserialize') || - resolveHook(handler, 'model'); - return this.runSharedModelHook(payload, hookName, [fullParams]); +function forEach(array, callback) { + for (var i=0, l=array.length; i < l && false !== callback(array[i]); i++) { } +} + +function trigger(router, handlerInfos, ignoreFailure, args) { + if (router.triggerEvent) { + router.triggerEvent(handlerInfos, ignoreFailure, args); + return; } -}); -handlerInfoFactory.klasses = { - resolved: ResolvedHandlerInfo, - param: UnresolvedHandlerInfoByParam, - object: UnresolvedHandlerInfoByObject -}; + var name = args.shift(); -function handlerInfoFactory(name, props) { - var Ctor = handlerInfoFactory.klasses[name], - handlerInfo = new Ctor(props || {}); - handlerInfo.factory = handlerInfoFactory; - return handlerInfo; -} + if (!handlerInfos) { + if (ignoreFailure) { return; } + throw new Error("Could not trigger event '" + name + "'. There are no active handlers"); + } -var NamedTransitionIntent = subclass(TransitionIntent, { - name: null, - pivotHandler: null, - contexts: null, - queryParams: null, + var eventWasHandled = false; - initialize: function(props) { - this.name = props.name; - this.pivotHandler = props.pivotHandler; - this.contexts = props.contexts || []; - this.queryParams = props.queryParams; - }, + function delayedEvent(name, args, handler) { + handler.events[name].apply(handler, args); + } - applyToState: function(oldState, recognizer, getHandler, isIntermediate, getSerializer) { + for (var i=handlerInfos.length-1; i>=0; i--) { + var handlerInfo = handlerInfos[i], + handler = handlerInfo.handler; - var partitionedArgs = extractQueryParams([this.name].concat(this.contexts)), - pureArgs = partitionedArgs[0], - handlers = recognizer.handlersFor(pureArgs[0]); + // If there is no handler, it means the handler hasn't resolved yet which + // means that we should trigger the event later when the handler is available + if (!handler) { + handlerInfo.handlerPromise.then(bind(null, delayedEvent, name, args)); + continue; + } - var targetRouteName = handlers[handlers.length-1].handler; + if (handler.events && handler.events[name]) { + if (handler.events[name].apply(handler, args) === true) { + eventWasHandled = true; + } else { + return; + } + } + } - return this.applyToHandlers(oldState, handlers, getHandler, targetRouteName, isIntermediate, null, getSerializer); - }, + // In the case that we got an UnrecognizedURLError as an event with no handler, + // let it bubble up + if (name === 'error' && args[0].name === 'UnrecognizedURLError') { + throw args[0]; + } else if (!eventWasHandled && !ignoreFailure) { + throw new Error("Nothing handled the event '" + name + "'."); + } +} - applyToHandlers: function(oldState, handlers, getHandler, targetRouteName, isIntermediate, checkingIfActive, getSerializer) { +function getChangelist(oldObject, newObject) { + var key; + var results = { + all: {}, + changed: {}, + removed: {} + }; - var i, len; - var newState = new TransitionState(); - var objects = this.contexts.slice(0); + merge(results.all, newObject); - var invalidateIndex = handlers.length; + var didChange = false; + coerceQueryParamsToString(oldObject); + coerceQueryParamsToString(newObject); - // Pivot handlers are provided for refresh transitions - if (this.pivotHandler) { - for (i = 0, len = handlers.length; i < len; ++i) { - if (handlers[i].handler === this.pivotHandler._handlerName) { - invalidateIndex = i; - break; - } + // Calculate removals + for (key in oldObject) { + if (oldObject.hasOwnProperty(key)) { + if (!newObject.hasOwnProperty(key)) { + didChange = true; + results.removed[key] = oldObject[key]; } } + } - for (i = handlers.length - 1; i >= 0; --i) { - var result = handlers[i]; - var name = result.handler; - - var oldHandlerInfo = oldState.handlerInfos[i]; - var newHandlerInfo = null; - - if (result.names.length > 0) { - if (i >= invalidateIndex) { - newHandlerInfo = this.createParamHandlerInfo(name, getHandler, result.names, objects, oldHandlerInfo); + // Calculate changes + for (key in newObject) { + if (newObject.hasOwnProperty(key)) { + if (isArray(oldObject[key]) && isArray(newObject[key])) { + if (oldObject[key].length !== newObject[key].length) { + results.changed[key] = newObject[key]; + didChange = true; } else { - var serializer = getSerializer(name); - newHandlerInfo = this.getHandlerInfoForDynamicSegment(name, getHandler, result.names, objects, oldHandlerInfo, targetRouteName, i, serializer); + for (var i = 0, l = oldObject[key].length; i < l; i++) { + if (oldObject[key][i] !== newObject[key][i]) { + results.changed[key] = newObject[key]; + didChange = true; + } + } } - } else { - // This route has no dynamic segment. - // Therefore treat as a param-based handlerInfo - // with empty params. This will cause the `model` - // hook to be called with empty params, which is desirable. - newHandlerInfo = this.createParamHandlerInfo(name, getHandler, result.names, objects, oldHandlerInfo); } - - if (checkingIfActive) { - // If we're performing an isActive check, we want to - // serialize URL params with the provided context, but - // ignore mismatches between old and new context. - newHandlerInfo = newHandlerInfo.becomeResolved(null, newHandlerInfo.context); - var oldContext = oldHandlerInfo && oldHandlerInfo.context; - if (result.names.length > 0 && newHandlerInfo.context === oldContext) { - // If contexts match in isActive test, assume params also match. - // This allows for flexibility in not requiring that every last - // handler provide a `serialize` method - newHandlerInfo.params = oldHandlerInfo && oldHandlerInfo.params; + else { + if (oldObject[key] !== newObject[key]) { + results.changed[key] = newObject[key]; + didChange = true; } - newHandlerInfo.context = oldContext; - } - - var handlerToUse = oldHandlerInfo; - if (i >= invalidateIndex || newHandlerInfo.shouldSupercede(oldHandlerInfo)) { - invalidateIndex = Math.min(i, invalidateIndex); - handlerToUse = newHandlerInfo; - } - - if (isIntermediate && !checkingIfActive) { - handlerToUse = handlerToUse.becomeResolved(null, handlerToUse.context); } - - 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); } + } - if (!isIntermediate) { - this.invalidateChildren(newState.handlerInfos, invalidateIndex); - } + return didChange && results; +} - merge(newState.queryParams, this.queryParams || {}); +function promiseLabel(label) { + return 'Router: ' + label; +} - return newState; - }, +function subclass(parentConstructor, proto) { + function C(props) { + parentConstructor.call(this, props || {}); + } + C.prototype = oCreate(parentConstructor.prototype); + merge(C.prototype, proto); + return C; +} - invalidateChildren: function(handlerInfos, invalidateIndex) { - for (var i = invalidateIndex, l = handlerInfos.length; i < l; ++i) { - var handlerInfo = handlerInfos[i]; - handlerInfos[i] = handlerInfo.getUnresolved(); - } - }, +function resolveHook(obj, hookName) { + if (!obj) { return; } + var underscored = "_" + hookName; + return obj[underscored] && underscored || + obj[hookName] && hookName; +} - getHandlerInfoForDynamicSegment: function(name, getHandler, names, objects, oldHandlerInfo, targetRouteName, i, serializer) { - var objectToUse; - if (objects.length > 0) { +function callHook(obj, _hookName, arg1, arg2) { + var hookName = resolveHook(obj, _hookName); + return hookName && obj[hookName].call(obj, arg1, arg2); +} - // Use the objects provided for this transition. - objectToUse = objects[objects.length - 1]; - if (isParam(objectToUse)) { - return this.createParamHandlerInfo(name, getHandler, names, objects, oldHandlerInfo); - } else { - objects.pop(); - } - } else if (oldHandlerInfo && oldHandlerInfo.name === name) { - // Reuse the matching oldHandlerInfo - return oldHandlerInfo; +function applyHook(obj, _hookName, args) { + var hookName = resolveHook(obj, _hookName); + if (hookName) { + if (args.length === 0) { + return obj[hookName].call(obj); + } else if (args.length === 1) { + return obj[hookName].call(obj, args[0]); + } else if (args.length === 2) { + return obj[hookName].call(obj, args[0], args[1]); } else { - if (this.preTransitionState) { - var preTransitionHandlerInfo = this.preTransitionState.handlerInfos[i]; - objectToUse = preTransitionHandlerInfo && preTransitionHandlerInfo.context; - } else { - // Ideally we should throw this error to provide maximal - // information to the user that not enough context objects - // were provided, but this proves too cumbersome in Ember - // in cases where inner template helpers are evaluated - // before parent helpers un-render, in which cases this - // error somewhat prematurely fires. - //throw new Error("Not enough context objects were provided to complete a transition to " + targetRouteName + ". Specifically, the " + name + " route needs an object that can be serialized into its dynamic URL segments [" + names.join(', ') + "]"); - return oldHandlerInfo; - } + return obj[hookName].apply(obj, args); } + } +} - return handlerInfoFactory('object', { - name: name, - getHandler: getHandler, - serializer: serializer, - context: objectToUse, - names: names - }); - }, - - createParamHandlerInfo: function(name, getHandler, names, objects, oldHandlerInfo) { - var params = {}; - - // Soak up all the provided string/numbers - var numNames = names.length; - while (numNames--) { - - // Only use old params if the names match with the new handler - var oldParams = (oldHandlerInfo && name === oldHandlerInfo.name && oldHandlerInfo.params) || {}; +function TransitionState() { + this.handlerInfos = []; + this.queryParams = {}; + this.params = {}; +} - var peek = objects[objects.length - 1]; - var paramName = names[numNames]; - if (isParam(peek)) { - 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); - } +TransitionState.prototype = { + promiseLabel: function(label) { + var targetName = ''; + forEach(this.handlerInfos, function(handlerInfo) { + if (targetName !== '') { + targetName += '.'; } - } - - return handlerInfoFactory('param', { - name: name, - getHandler: getHandler, - params: params + targetName += handlerInfo.name; }); - } -}); - -/** - Promise reject reasons passed to promise rejection - handlers for failed transitions. - */ -function UnrecognizedURLError(message) { - this.message = (message || "UnrecognizedURLError"); - this.name = "UnrecognizedURLError"; - Error.call(this); -} + return promiseLabel("'" + targetName + "': " + label); + }, -UnrecognizedURLError.prototype = oCreate(Error.prototype); + resolve: function(shouldContinue, payload) { + // First, calculate params for this state. This is useful + // information to provide to the various route hooks. + var params = this.params; + forEach(this.handlerInfos, function(handlerInfo) { + params[handlerInfo.name] = handlerInfo.params || {}; + }); -var URLTransitionIntent = subclass(TransitionIntent, { - url: null, + payload = payload || {}; + payload.resolveIndex = 0; - initialize: function(props) { - this.url = props.url; - }, + var currentState = this; + var wasAborted = false; - applyToState: function(oldState, recognizer, getHandler) { - var newState = new TransitionState(); + // The prelude RSVP.resolve() asyncs us into the promise land. + return rsvp.Promise.resolve(null, this.promiseLabel("Start transition")) + .then(resolveOneHandlerInfo, null, this.promiseLabel('Resolve handler'))['catch'](handleError, this.promiseLabel('Handle error')); - var results = recognizer.recognize(this.url), - i, len; + function innerShouldContinue() { + return rsvp.Promise.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 rsvp.Promise.reject(reason); + }, currentState.promiseLabel("Handle abort")); + } - if (!results) { - throw new UnrecognizedURLError(this.url); + function handleError(error) { + // This is the only possible + // reject value of TransitionState#resolve + var handlerInfos = currentState.handlerInfos; + var errorHandlerIndex = payload.resolveIndex >= handlerInfos.length ? + handlerInfos.length - 1 : payload.resolveIndex; + return rsvp.Promise.reject({ + error: error, + handlerWithError: currentState.handlerInfos[errorHandlerIndex].handler, + wasAborted: wasAborted, + state: currentState + }); } - var statesDiffer = false; - var url = this.url; + function proceed(resolvedHandlerInfo) { + var wasAlreadyResolved = currentState.handlerInfos[payload.resolveIndex].isResolved; - // Checks if a handler is accessible by URL. If it is not, an error is thrown. - // For the case where the handler is loaded asynchronously, the error will be - // thrown once it is loaded. - function checkHandlerAccessibility(handler) { - if (handler && handler.inaccessibleByURL) { - throw new UnrecognizedURLError(url); + // Swap the previously unresolved handlerInfo with + // the resolved handlerInfo + currentState.handlerInfos[payload.resolveIndex++] = resolvedHandlerInfo; + + if (!wasAlreadyResolved) { + // Call the redirect hook. The reason we call it here + // vs. afterModel is so that redirects into child + // routes don't re-run the model hooks for this + // already-resolved route. + var handler = resolvedHandlerInfo.handler; + callHook(handler, 'redirect', resolvedHandlerInfo.context, payload); } - return handler; + // Proceed after ensuring that the redirect hook + // didn't abort this transition by transitioning elsewhere. + return innerShouldContinue().then(resolveOneHandlerInfo, null, currentState.promiseLabel('Resolve handler')); } - for (i = 0, len = results.length; i < len; ++i) { - var result = results[i]; - var name = result.handler; - var newHandlerInfo = handlerInfoFactory('param', { - name: name, - getHandler: getHandler, - params: result.params - }); - var handler = newHandlerInfo.handler; - - if (handler) { - checkHandlerAccessibility(handler); - } else { - // If the hanlder is being loaded asynchronously, check if we can - // access it after it has resolved - newHandlerInfo.handlerPromise = newHandlerInfo.handlerPromise.then(checkHandlerAccessibility); + function resolveOneHandlerInfo() { + if (payload.resolveIndex === currentState.handlerInfos.length) { + // This is is the only possible + // fulfill value of TransitionState#resolve + return { + error: null, + state: currentState + }; } - var oldHandlerInfo = oldState.handlerInfos[i]; - if (statesDiffer || newHandlerInfo.shouldSupercede(oldHandlerInfo)) { - statesDiffer = true; - newState.handlerInfos[i] = newHandlerInfo; - } else { - newState.handlerInfos[i] = oldHandlerInfo; - } - } + var handlerInfo = currentState.handlerInfos[payload.resolveIndex]; - merge(newState.queryParams, results.queryParams); + return handlerInfo.resolve(innerShouldContinue, payload) + .then(proceed, null, currentState.promiseLabel('Proceed')); + } + } +}; - return newState; +function TransitionAbortedError(message) { + if (!(this instanceof TransitionAbortedError)) { + return new TransitionAbortedError(message); } -}); -var pop = Array.prototype.pop; + var error = Error.call(this, message); -function Router(_options) { - var options = _options || {}; - this.getHandler = options.getHandler || this.getHandler; - this.getSerializer = options.getSerializer || this.getSerializer; - this.updateURL = options.updateURL || this.updateURL; - this.replaceURL = options.replaceURL || this.replaceURL; - this.didTransition = options.didTransition || this.didTransition; - this.willTransition = options.willTransition || this.willTransition; - this.delegate = options.delegate || this.delegate; - this.triggerEvent = options.triggerEvent || this.triggerEvent; - this.log = options.log || this.log; - this.dslCallBacks = []; // NOTE: set by Ember - this.state = undefined; - this.activeTransition = undefined; - this._changedQueryParams = undefined; - this.oldState = undefined; - this.currentHandlerInfos = undefined; - this.state = undefined; - this.currentSequence = 0; + if (Error.captureStackTrace) { + Error.captureStackTrace(this, TransitionAbortedError); + } else { + this.stack = error.stack; + } - this.recognizer = new RouteRecognizer(); - this.reset(); + this.description = error.description; + this.fileName = error.fileName; + this.lineNumber = error.lineNumber; + this.message = error.message || 'TransitionAborted'; + this.name = 'TransitionAborted'; + this.number = error.number; + this.code = error.code; } -function getTransitionByIntent(intent, isIntermediate) { - var wasTransitioning = !!this.activeTransition; - var oldState = wasTransitioning ? this.activeTransition.state : this.state; - var newTransition; +TransitionAbortedError.prototype = oCreate(Error.prototype); - var newState = intent.applyToState(oldState, this.recognizer, this.getHandler, isIntermediate, this.getSerializer); - var queryParamChangelist = getChangelist(oldState.queryParams, newState.queryParams); +/** + A Transition is a thennable (a promise-like object) that represents + an attempt to transition to another route. It can be aborted, either + explicitly via `abort` or by attempting another transition while a + previous one is still underway. An aborted transition can also + be `retry()`d later. - if (handlerInfosEqual(newState.handlerInfos, oldState.handlerInfos)) { + @class Transition + @constructor + @param {Object} router + @param {Object} intent + @param {Object} state + @param {Object} error + @private + */ +function Transition(router, intent, state, error, previousTransition) { + var transition = this; + this.state = state || router.state; + this.intent = intent; + this.router = router; + this.data = this.intent && this.intent.data || {}; + this.resolvedModels = {}; + this.queryParams = {}; + this.promise = undefined; + this.error = undefined; + this.params = undefined; + this.handlerInfos = undefined; + this.targetName = undefined; + this.pivotHandler = undefined; + this.sequence = undefined; + this.isAborted = false; + this.isActive = true; - // This is a no-op transition. See if query params changed. - if (queryParamChangelist) { - newTransition = this.queryParamsTransition(queryParamChangelist, wasTransitioning, oldState, newState); - if (newTransition) { - return newTransition; - } + if (error) { + this.promise = rsvp.Promise.reject(error); + this.error = error; + return; + } + + // if you're doing multiple redirects, need the new transition to know if it + // is actually part of the first transition or not. Any further redirects + // in the initial transition also need to know if they are part of the + // initial transition + this.isCausedByAbortingTransition = !!previousTransition; + this.isCausedByInitialTransition = ( + previousTransition && ( + previousTransition.isCausedByInitialTransition || + previousTransition.sequence === 0 + ) + ); + + if (state) { + this.params = state.params; + this.queryParams = state.queryParams; + this.handlerInfos = state.handlerInfos; + + var len = state.handlerInfos.length; + if (len) { + this.targetName = state.handlerInfos[len-1].name; } - // No-op. No need to create a new transition. - return this.activeTransition || new Transition(this); + for (var i = 0; i < len; ++i) { + var handlerInfo = state.handlerInfos[i]; + + // TODO: this all seems hacky + if (!handlerInfo.isResolved) { break; } + this.pivotHandler = handlerInfo.handler; + } + + this.sequence = router.currentSequence++; + this.promise = state.resolve(checkForAbort, this)['catch']( + catchHandlerForTransition(transition), promiseLabel('Handle Abort')); + } else { + this.promise = rsvp.Promise.resolve(this.state); + this.params = {}; } - if (isIntermediate) { - setupContexts(this, newState); - return; + function checkForAbort() { + if (transition.isAborted) { + return rsvp.Promise.reject(undefined, promiseLabel("Transition aborted - reject")); + } } +} - // Create a new transition to the destination route. - newTransition = new Transition(this, intent, newState, undefined, this.activeTransition); +function catchHandlerForTransition(transition) { + return function(result) { + if (result.wasAborted || transition.isAborted) { + return rsvp.Promise.reject(logAbort(transition)); + } else { + transition.trigger('error', result.error, transition, result.handlerWithError); + transition.abort(); + return rsvp.Promise.reject(result.error); + } + }; +} - // Abort and usurp any previously active transition. - if (this.activeTransition) { - this.activeTransition.abort(); - } - this.activeTransition = newTransition; - // 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, promiseLabel("Settle transition promise when transition is finalized")); +Transition.prototype = { + targetName: null, + urlMethod: 'update', + intent: null, + pivotHandler: null, + resolveIndex: 0, + resolvedModels: null, + state: null, + queryParamsOnly: false, - if (!wasTransitioning) { - notifyExistingHandlers(this, newState, newTransition); - } + isTransition: true, - fireQueryParamDidChange(this, newState, queryParamChangelist); + isExiting: function(handler) { + var handlerInfos = this.handlerInfos; + for (var i = 0, len = handlerInfos.length; i < len; ++i) { + var handlerInfo = handlerInfos[i]; + if (handlerInfo.name === handler || handlerInfo.handler === handler) { + return false; + } + } + return true; + }, - return newTransition; -} + /** + The Transition's internal promise. Calling `.then` on this property + is that same as calling `.then` on the Transition object itself, but + this property is exposed for when you want to pass around a + Transition's promise, but not the Transition object itself, since + Transition object can be externally `abort`ed, while the promise + cannot. -Router.prototype = { + @property promise + @type {Object} + @public + */ + promise: null, /** - The main entry point into the router. The API is essentially - the same as the `map` method in `route-recognizer`. + Custom state can be stored on a Transition's `data` object. + This can be useful for decorating a Transition within an earlier + hook and shared with a later hook. Properties set on `data` will + be copied to new transitions generated by calling `retry` on this + transition. - This method extracts the String handler at the last `.to()` - call and uses it as the name of the whole route. + @property data + @type {Object} + @public + */ + data: null, - @param {Function} callback - */ - map: function(callback) { - this.recognizer.delegate = this.delegate; + /** + A standard promise hook that resolves if the transition + succeeds and rejects if it fails/redirects/aborts. - this.recognizer.map(callback, function(recognizer, routes) { - for (var i = routes.length - 1, proceed = true; i >= 0 && proceed; --i) { - var route = routes[i]; - recognizer.add(routes, { as: route.handler }); - proceed = route.path === '/' || route.path === '' || route.handler.slice(-6) === '.index'; - } - }); - }, + Forwards to the internal `promise` property which you can + use in situations where you want to pass around a thennable, + but not the Transition itself. - hasRoute: function(route) { - return this.recognizer.hasRoute(route); + @method then + @param {Function} onFulfilled + @param {Function} onRejected + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + @public + */ + then: function(onFulfilled, onRejected, label) { + return this.promise.then(onFulfilled, onRejected, label); }, - getHandler: function() {}, + /** - getSerializer: function() {}, + Forwards to the internal `promise` property which you can + use in situations where you want to pass around a thennable, + but not the Transition itself. - queryParamsTransition: function(changelist, wasTransitioning, oldState, newState) { - var router = this; + @method catch + @param {Function} onRejection + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + @public + */ + catch: function(onRejection, label) { + return this.promise.catch(onRejection, label); + }, - fireQueryParamDidChange(this, newState, changelist); + /** - if (!wasTransitioning && this.activeTransition) { - // One of the handlers in queryParamsDidChange - // caused a transition. Just return that transition. - return this.activeTransition; - } else { - // Running queryParamsDidChange didn't change anything. - // Just update query params and be on our way. + Forwards to the internal `promise` property which you can + use in situations where you want to pass around a thennable, + but not the Transition itself. - // We have to return a noop transition that will - // perform a URL update at the end. This gives - // the user the ability to set the url update - // method (default is replaceState). - var newTransition = new Transition(this); - newTransition.queryParamsOnly = true; + @method finally + @param {Function} callback + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + @public + */ + finally: function(callback, label) { + return this.promise.finally(callback, label); + }, - oldState.queryParams = finalizeQueryParamChange(this, newState.handlerInfos, newState.queryParams, newTransition); + /** + Aborts the Transition. Note you can also implicitly abort a transition + by initiating another transition while a previous one is underway. - newTransition.promise = newTransition.promise.then(function(result) { - updateURL(newTransition, oldState, true); - if (router.didTransition) { - router.didTransition(router.currentHandlerInfos); - } - return result; - }, null, promiseLabel("Transition complete")); - return newTransition; - } + @method abort + @return {Transition} this transition + @public + */ + abort: function() { + if (this.isAborted) { return this; } + 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; }, - // NOTE: this doesn't really belong here, but here - // it shall remain until our ES6 transpiler can - // handle cyclical deps. - transitionByIntent: function(intent/*, isIntermediate*/) { - try { - return getTransitionByIntent.apply(this, arguments); - } catch(e) { - return new Transition(this, intent, null, e); - } + /** + + Retries a previously-aborted transition (making sure to abort the + transition if it's still active). Returns a new transition that + represents the new attempt to transition. + + @method retry + @return {Transition} new transition + @public + */ + retry: function() { + // TODO: add tests for merged state retry()s + this.abort(); + return this.router.transitionByIntent(this.intent, false); }, /** - Clears the current and target route handlers and triggers exit - on each of them starting at the leaf and traversing up through - its ancestors. - */ - reset: function() { - if (this.state) { - forEach(this.state.handlerInfos.slice().reverse(), function(handlerInfo) { - var handler = handlerInfo.handler; - callHook(handler, 'exit'); - }); - } - this.oldState = undefined; - this.state = new TransitionState(); - this.currentHandlerInfos = null; - }, + Sets the URL-changing method to be employed at the end of a + successful transition. By default, a new Transition will just + use `updateURL`, but passing 'replace' to this method will + cause the URL to update using 'replaceWith' instead. Omitting + a parameter will disable the URL change, allowing for transitions + that don't update the URL at completion (this is also used for + handleURL, since the URL has already changed before the + transition took place). - activeTransition: null, + @method method + @param {String} method the type of URL-changing method to use + at the end of a transition. Accepted values are 'replace', + falsy values, or any other non-falsy value (which is + interpreted as an updateURL transition). + + @return {Transition} this transition + @public + */ + method: function(method) { + this.urlMethod = method; + return this; + }, /** - var handler = handlerInfo.handler; - The entry point for handling a change to the URL (usually - via the back and forward button). - Returns an Array of handlers and the parameters associated - with those parameters. + Fires an event on the current list of resolved/resolving + handlers within this transition. Useful for firing events + on route hierarchies that haven't fully been entered yet. - @param {String} url a URL to process + Note: This method is also aliased as `send` - @return {Array} an Array of `[handler, parameter]` tuples - */ - handleURL: function(url) { - // Perform a URL-based transition, but don't change - // the URL afterward, since it already happened. + @method trigger + @param {Boolean} [ignoreFailure=false] a boolean specifying whether unhandled events throw an error + @param {String} name the name of the event to fire + @public + */ + trigger: function (ignoreFailure) { var args = slice.call(arguments); - if (url.charAt(0) !== '/') { args[0] = '/' + url; } - - return doTransition(this, args).method(null); + if (typeof ignoreFailure === 'boolean') { + args.shift(); + } else { + // Throw errors on unhandled trigger events by default + ignoreFailure = false; + } + trigger(this.router, this.state.handlerInfos.slice(0, this.resolveIndex + 1), ignoreFailure, args); }, /** - Hook point for updating the URL. + Transitions are aborted and their promises rejected + when redirects occur; this method returns a promise + that will follow any redirects that occur and fulfill + with the value fulfilled by any redirecting transitions + that occur. + + @method followRedirects + @return {Promise} a promise that fulfills with the same + value that the final redirecting transition fulfills with + @public + */ + followRedirects: function() { + var router = this.router; + return this.promise['catch'](function(reason) { + if (router.activeTransition) { + return router.activeTransition.followRedirects(); + } + return rsvp.Promise.reject(reason); + }); + }, - @param {String} url a URL to update to - */ - updateURL: function() { - throw new Error("updateURL is not implemented"); + toString: function() { + return "Transition (sequence " + this.sequence + ")"; }, /** - Hook point for replacing the current URL, i.e. with replaceState + @private + */ + log: function(message) { + log(this.router, this.sequence, message); + } +}; - By default this behaves the same as `updateURL` +// Alias 'trigger' as 'send' +Transition.prototype.send = Transition.prototype.trigger; - @param {String} url a URL to update to - */ - replaceURL: function(url) { - this.updateURL(url); - }, +/** + @private - /** - Transition into the specified named route. + Logs and returns an instance of TransitionAbortedError. + */ +function logAbort(transition) { + log(transition.router, transition.sequence, "detected abort."); + return new TransitionAbortedError(); +} - If necessary, trigger the exit callback on any handlers - that are no longer represented by the target route. +function TransitionIntent(props) { + this.initialize(props); - @param {String} name the name of the route - */ - transitionTo: function(/*name*/) { - return doTransition(this, arguments); - }, + // TODO: wat + this.data = this.data || {}; +} - intermediateTransitionTo: function(/*name*/) { - return doTransition(this, arguments, true); - }, +TransitionIntent.prototype = { + initialize: null, + applyToState: null +}; - refresh: function(pivotHandler) { - var state = this.activeTransition ? this.activeTransition.state : this.state; - var handlerInfos = state.handlerInfos; - var params = {}; - for (var i = 0, len = handlerInfos.length; i < len; ++i) { - var handlerInfo = handlerInfos[i]; - params[handlerInfo.name] = handlerInfo.params || {}; - } +var DEFAULT_HANDLER = Object.freeze({}); - log(this, "Starting a refresh transition"); - var intent = new NamedTransitionIntent({ - name: handlerInfos[handlerInfos.length - 1].name, - pivotHandler: pivotHandler || handlerInfos[0].handler, - contexts: [], // TODO collect contexts...? - queryParams: this._changedQueryParams || state.queryParams || {} - }); +function HandlerInfo(_props) { + var props = _props || {}; - return this.transitionByIntent(intent, false); - }, + // Set a default handler to ensure consistent object shape + this._handler = DEFAULT_HANDLER; - /** - Identical to `transitionTo` except that the current URL will be replaced - if possible. + if (props.handler) { + var name = props.name; - This method is intended primarily for use with `replaceState`. + // Setup a handlerPromise so that we can wait for asynchronously loaded handlers + this.handlerPromise = rsvp.Promise.resolve(props.handler); - @param {String} name the name of the route - */ - replaceWith: function(/*name*/) { - return doTransition(this, arguments).method('replace'); - }, + // Wait until the 'handler' property has been updated when chaining to a handler + // that is a promise + if (isPromise(props.handler)) { + this.handlerPromise = this.handlerPromise.then(bind(this, this.updateHandler)); + props.handler = undefined; + } else if (props.handler) { + // Store the name of the handler on the handler for easy checks later + props.handler._handlerName = name; + } + } - /** - Take a named route and context objects and generate a - URL. + merge(this, props); + this.initialize(props); +} - @param {String} name the name of the route to generate - a URL for - @param {...Object} objects a list of objects to serialize +HandlerInfo.prototype = { + name: null, - @return {String} a URL - */ - generate: function(handlerName) { + getHandler: function() {}, - var partitionedArgs = extractQueryParams(slice.call(arguments, 1)), - suppliedParams = partitionedArgs[0], - queryParams = partitionedArgs[1]; + fetchHandler: function() { + var handler = this.getHandler(this.name); - // Construct a TransitionIntent with the provided params - // and apply it to the present state of the router. - var intent = new NamedTransitionIntent({ name: handlerName, contexts: suppliedParams }); - var state = intent.applyToState(this.state, this.recognizer, this.getHandler, null, this.getSerializer); - var params = {}; + // Setup a handlerPromise so that we can wait for asynchronously loaded handlers + this.handlerPromise = rsvp.Promise.resolve(handler); - for (var i = 0, len = state.handlerInfos.length; i < len; ++i) { - var handlerInfo = state.handlerInfos[i]; - var handlerParams = handlerInfo.serialize(); - merge(params, handlerParams); + // Wait until the 'handler' property has been updated when chaining to a handler + // that is a promise + if (isPromise(handler)) { + this.handlerPromise = this.handlerPromise.then(bind(this, this.updateHandler)); + } else if (handler) { + // Store the name of the handler on the handler for easy checks later + handler._handlerName = this.name; + return this.handler = handler; } - params.queryParams = queryParams; - return this.recognizer.generate(handlerName, params); + return this.handler = undefined; }, - applyIntent: function(handlerName, contexts) { - var intent = new NamedTransitionIntent({ - name: handlerName, - contexts: contexts - }); - - var state = this.activeTransition && this.activeTransition.state || this.state; - return intent.applyToState(state, this.recognizer, this.getHandler, null, this.getSerializer); - }, + _handlerPromise: undefined, - isActiveIntent: function(handlerName, contexts, queryParams, _state) { - var state = _state || this.state, - targetHandlerInfos = state.handlerInfos, - handlerInfo, len; + params: null, + context: null, - if (!targetHandlerInfos.length) { return false; } + // Injected by the handler info factory. + factory: null, - var targetHandler = targetHandlerInfos[targetHandlerInfos.length - 1].name; - var recogHandlers = this.recognizer.handlersFor(targetHandler); + initialize: function() {}, - var index = 0; - for (len = recogHandlers.length; index < len; ++index) { - handlerInfo = targetHandlerInfos[index]; - if (handlerInfo.name === handlerName) { break; } + log: function(payload, message) { + if (payload.log) { + payload.log(this.name + ': ' + message); } + }, - if (index === recogHandlers.length) { - // The provided route name isn't even in the route hierarchy. - return false; - } + promiseLabel: function(label) { + return promiseLabel("'" + this.name + "' " + label); + }, - var testState = new TransitionState(); - testState.handlerInfos = targetHandlerInfos.slice(0, index + 1); - recogHandlers = recogHandlers.slice(0, index + 1); + getUnresolved: function() { + return this; + }, - var intent = new NamedTransitionIntent({ - name: targetHandler, - contexts: contexts - }); + serialize: function() { + return this.params || {}; + }, - var newState = intent.applyToHandlers(testState, recogHandlers, this.getHandler, targetHandler, true, true, this.getSerializer); + updateHandler: function(handler) { + // Store the name of the handler on the handler for easy checks later + handler._handlerName = this.name; + return this.handler = handler; + }, - var handlersEqual = handlerInfosEqual(newState.handlerInfos, testState.handlerInfos); - if (!queryParams || !handlersEqual) { - return handlersEqual; - } + resolve: function(shouldContinue, payload) { + var checkForAbort = bind(this, this.checkForAbort, shouldContinue), + beforeModel = bind(this, this.runBeforeModelHook, payload), + model = bind(this, this.getModel, payload), + afterModel = bind(this, this.runAfterModelHook, payload), + becomeResolved = bind(this, this.becomeResolved, payload), + self = this; - // Get a hash of QPs that will still be active on new route - var activeQPsOnNewHandler = {}; - merge(activeQPsOnNewHandler, queryParams); + return rsvp.Promise.resolve(this.handlerPromise, this.promiseLabel("Start handler")) + .then(function(handler) { + // We nest this chain in case the handlerPromise has an error so that + // we don't have to bubble it through every step + return rsvp.Promise.resolve(handler) + .then(checkForAbort, null, self.promiseLabel("Check for abort")) + .then(beforeModel, null, self.promiseLabel("Before model")) + .then(checkForAbort, null, self.promiseLabel("Check if aborted during 'beforeModel' hook")) + .then(model, null, self.promiseLabel("Model")) + .then(checkForAbort, null, self.promiseLabel("Check if aborted in 'model' hook")) + .then(afterModel, null, self.promiseLabel("After model")) + .then(checkForAbort, null, self.promiseLabel("Check if aborted in 'afterModel' hook")) + .then(becomeResolved, null, self.promiseLabel("Become resolved")); + }, function(error) { + throw error; + }); + }, - var activeQueryParams = state.queryParams; - for (var key in activeQueryParams) { - if (activeQueryParams.hasOwnProperty(key) && - activeQPsOnNewHandler.hasOwnProperty(key)) { - activeQPsOnNewHandler[key] = activeQueryParams[key]; - } + runBeforeModelHook: function(payload) { + if (payload.trigger) { + payload.trigger(true, 'willResolveModel', payload, this.handler); } - - return handlersEqual && !getChangelist(activeQPsOnNewHandler, queryParams); + return this.runSharedModelHook(payload, 'beforeModel', []); }, - isActive: function(handlerName) { - var partitionedArgs = extractQueryParams(slice.call(arguments, 1)); - return this.isActiveIntent(handlerName, partitionedArgs[0], partitionedArgs[1]); - }, + runAfterModelHook: function(payload, resolvedModel) { + // Stash the resolved model on the payload. + // This makes it possible for users to swap out + // the resolved model in afterModel. + var name = this.name; + this.stashResolvedModel(payload, resolvedModel); - trigger: function(/*name*/) { - var args = slice.call(arguments); - trigger(this, this.currentHandlerInfos, false, args); + 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")); }, - /** - Hook point for logging transition status updates. - - @param {String} message The message to log. - */ - log: null -}; + runSharedModelHook: function(payload, hookName, args) { + this.log(payload, "calling " + hookName + " hook"); -/** - @private + if (this.queryParams) { + args.push(this.queryParams); + } + args.push(payload); - Fires queryParamsDidChange event -*/ -function fireQueryParamDidChange(router, newState, queryParamChangelist) { - // If queryParams changed trigger event - if (queryParamChangelist) { + var result = applyHook(this.handler, hookName, args); - // This is a little hacky but we need some way of storing - // changed query params given that no activeTransition - // is guaranteed to have occurred. - router._changedQueryParams = queryParamChangelist.all; - trigger(router, newState.handlerInfos, true, ['queryParamsDidChange', queryParamChangelist.changed, queryParamChangelist.all, queryParamChangelist.removed]); - router._changedQueryParams = null; - } -} + if (result && result.isTransition) { + result = null; + } -/** - @private + return rsvp.Promise.resolve(result, this.promiseLabel("Resolve value returned from one of the model hooks")); + }, - Takes an Array of `HandlerInfo`s, figures out which ones are - exiting, entering, or changing contexts, and calls the - proper handler hooks. + // overridden by subclasses + getModel: null, - For example, consider the following tree of handlers. Each handler is - followed by the URL segment it handles. + checkForAbort: function(shouldContinue, promiseValue) { + return rsvp.Promise.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")); + }, - ``` - |~index ("/") - | |~posts ("/posts") - | | |-showPost ("/:id") - | | |-newPost ("/new") - | | |-editPost ("/edit") - | |~about ("/about/:id") - ``` + stashResolvedModel: function(payload, resolvedModel) { + payload.resolvedModels = payload.resolvedModels || {}; + payload.resolvedModels[this.name] = resolvedModel; + }, - Consider the following transitions: + becomeResolved: function(payload, resolvedContext) { + var params = this.serialize(resolvedContext); - 1. A URL transition to `/posts/1`. - 1. Triggers the `*model` callbacks on the - `index`, `posts`, and `showPost` handlers - 2. Triggers the `enter` callback on the same - 3. Triggers the `setup` callback on the same - 2. A direct transition to `newPost` - 1. Triggers the `exit` callback on `showPost` - 2. Triggers the `enter` callback on `newPost` - 3. Triggers the `setup` callback on `newPost` - 3. A direct transition to `about` with a specified - context object - 1. Triggers the `exit` callback on `newPost` - and `posts` - 2. Triggers the `serialize` callback on `about` - 3. Triggers the `enter` callback on `about` - 4. Triggers the `setup` callback on `about` + if (payload) { + this.stashResolvedModel(payload, resolvedContext); + payload.params = payload.params || {}; + payload.params[this.name] = params; + } - @param {Router} transition - @param {TransitionState} newState -*/ -function setupContexts(router, newState, transition) { - var partition = partitionHandlers(router.state, newState); - var i, l, handler; + return this.factory('resolved', { + context: resolvedContext, + name: this.name, + handler: this.handler, + params: params + }); + }, - for (i=0, l=partition.exited.length; i= 0; --i) { - var handlerInfo = handlerInfos[i]; - merge(params, handlerInfo.params); - if (handlerInfo.handler.inaccessibleByURL) { - urlMethod = null; - } - } +function handlerInfoFactory(name, props) { + var Ctor = handlerInfoFactory.klasses[name], + handlerInfo = new Ctor(props || {}); + handlerInfo.factory = handlerInfoFactory; + return handlerInfo; +} - if (urlMethod) { - params.queryParams = transition._visibleQueryParams || state.queryParams; - var url = router.recognizer.generate(handlerName, params); +var NamedTransitionIntent = subclass(TransitionIntent, { + name: null, + pivotHandler: null, + contexts: null, + queryParams: null, - // transitions during the initial transition must always use replaceURL. - // When the app boots, you are at a url, e.g. /foo. If some handler - // redirects to bar as part of the initial transition, you don't want to - // add a history entry for /foo. If you do, pressing back will immediately - // hit the redirect again and take you back to /bar, thus killing the back - // button - var initial = transition.isCausedByInitialTransition; + initialize: function(props) { + this.name = props.name; + this.pivotHandler = props.pivotHandler; + this.contexts = props.contexts || []; + this.queryParams = props.queryParams; + }, - // say you are at / and you click a link to route /foo. In /foo's - // handler, the transition is aborted using replacewith('/bar'). - // Because the current url is still /, the history entry for / is - // removed from the history. Clicking back will take you to the page - // you were on before /, which is often not even the app, thus killing - // the back button. That's why updateURL is always correct for an - // aborting transition that's not the initial transition - var replaceAndNotAborting = ( - urlMethod === 'replace' && - !transition.isCausedByAbortingTransition - ); + applyToState: function(oldState, recognizer, getHandler, isIntermediate, getSerializer) { - if (initial || replaceAndNotAborting) { - router.replaceURL(url); - } else { - router.updateURL(url); - } - } -} + var partitionedArgs = extractQueryParams([this.name].concat(this.contexts)), + pureArgs = partitionedArgs[0], + handlers = recognizer.handlersFor(pureArgs[0]); -/** - @private + var targetRouteName = handlers[handlers.length-1].handler; - Updates the URL (if necessary) and calls `setupContexts` - to update the router's array of `currentHandlerInfos`. - */ -function finalizeTransition(transition, newState) { + return this.applyToHandlers(oldState, handlers, getHandler, targetRouteName, isIntermediate, null, getSerializer); + }, - try { - log(transition.router, transition.sequence, "Resolved all models on destination route; finalizing transition."); + applyToHandlers: function(oldState, handlers, getHandler, targetRouteName, isIntermediate, checkingIfActive, getSerializer) { - var router = transition.router, - handlerInfos = newState.handlerInfos; + var i, len; + var newState = new TransitionState(); + var objects = this.contexts.slice(0); - // Run all the necessary enter/setup/exit hooks - setupContexts(router, newState, transition); + var invalidateIndex = handlers.length; - // Check if a redirect occurred in enter/setup - if (transition.isAborted) { - // TODO: cleaner way? distinguish b/w targetHandlerInfos? - router.state.handlerInfos = router.currentHandlerInfos; - return rsvp.Promise.reject(logAbort(transition)); + // Pivot handlers are provided for refresh transitions + if (this.pivotHandler) { + for (i = 0, len = handlers.length; i < len; ++i) { + if (handlers[i].handler === this.pivotHandler._handlerName) { + invalidateIndex = i; + break; + } + } } - updateURL(transition, newState, transition.intent.url); + for (i = handlers.length - 1; i >= 0; --i) { + var result = handlers[i]; + var name = result.handler; - transition.isActive = false; - router.activeTransition = null; + var oldHandlerInfo = oldState.handlerInfos[i]; + var newHandlerInfo = null; - trigger(router, router.currentHandlerInfos, true, ['didTransition']); + if (result.names.length > 0) { + if (i >= invalidateIndex) { + newHandlerInfo = this.createParamHandlerInfo(name, getHandler, result.names, objects, oldHandlerInfo); + } else { + var serializer = getSerializer(name); + newHandlerInfo = this.getHandlerInfoForDynamicSegment(name, getHandler, result.names, objects, oldHandlerInfo, targetRouteName, i, serializer); + } + } else { + // This route has no dynamic segment. + // Therefore treat as a param-based handlerInfo + // with empty params. This will cause the `model` + // hook to be called with empty params, which is desirable. + newHandlerInfo = this.createParamHandlerInfo(name, getHandler, result.names, objects, oldHandlerInfo); + } - if (router.didTransition) { - router.didTransition(router.currentHandlerInfos); - } + if (checkingIfActive) { + // If we're performing an isActive check, we want to + // serialize URL params with the provided context, but + // ignore mismatches between old and new context. + newHandlerInfo = newHandlerInfo.becomeResolved(null, newHandlerInfo.context); + var oldContext = oldHandlerInfo && oldHandlerInfo.context; + if (result.names.length > 0 && newHandlerInfo.context === oldContext) { + // If contexts match in isActive test, assume params also match. + // This allows for flexibility in not requiring that every last + // handler provide a `serialize` method + newHandlerInfo.params = oldHandlerInfo && oldHandlerInfo.params; + } + newHandlerInfo.context = oldContext; + } - log(router, transition.sequence, "TRANSITION COMPLETE."); + var handlerToUse = oldHandlerInfo; + if (i >= invalidateIndex || newHandlerInfo.shouldSupercede(oldHandlerInfo)) { + invalidateIndex = Math.min(i, invalidateIndex); + handlerToUse = newHandlerInfo; + } - // Resolve with the final handler. - return handlerInfos[handlerInfos.length - 1].handler; - } catch(e) { - if (!(e instanceof TransitionAborted)) { - //var erroneousHandler = handlerInfos.pop(); - var infos = transition.state.handlerInfos; - transition.trigger(true, 'error', e, transition, infos[infos.length-1].handler); - transition.abort(); + if (isIntermediate && !checkingIfActive) { + handlerToUse = handlerToUse.becomeResolved(null, handlerToUse.context); + } + + newState.handlerInfos.unshift(handlerToUse); } - throw e; - } -} + if (objects.length > 0) { + throw new Error("More context objects were passed than there are dynamic segments for the route: " + targetRouteName); + } -/** - @private + if (!isIntermediate) { + this.invalidateChildren(newState.handlerInfos, invalidateIndex); + } - Begins and returns a Transition based on the provided - arguments. Accepts arguments in the form of both URL - transitions and named transitions. + merge(newState.queryParams, this.queryParams || {}); - @param {Router} router - @param {Array[Object]} args arguments passed to transitionTo, - replaceWith, or handleURL -*/ -function doTransition(router, args, isIntermediate) { - // Normalize blank transitions to root URL transitions. - var name = args[0] || '/'; + return newState; + }, - var lastArg = args[args.length-1]; - var queryParams = {}; - if (lastArg && lastArg.hasOwnProperty('queryParams')) { - queryParams = pop.call(args).queryParams; - } + invalidateChildren: function(handlerInfos, invalidateIndex) { + for (var i = invalidateIndex, l = handlerInfos.length; i < l; ++i) { + var handlerInfo = handlerInfos[i]; + handlerInfos[i] = handlerInfo.getUnresolved(); + } + }, - var intent; - if (args.length === 0) { + getHandlerInfoForDynamicSegment: function(name, getHandler, names, objects, oldHandlerInfo, targetRouteName, i, serializer) { + var objectToUse; + if (objects.length > 0) { - log(router, "Updating query params"); + // Use the objects provided for this transition. + objectToUse = objects[objects.length - 1]; + if (isParam(objectToUse)) { + return this.createParamHandlerInfo(name, getHandler, names, objects, oldHandlerInfo); + } else { + objects.pop(); + } + } else if (oldHandlerInfo && oldHandlerInfo.name === name) { + // Reuse the matching oldHandlerInfo + return oldHandlerInfo; + } else { + if (this.preTransitionState) { + var preTransitionHandlerInfo = this.preTransitionState.handlerInfos[i]; + objectToUse = preTransitionHandlerInfo && preTransitionHandlerInfo.context; + } else { + // Ideally we should throw this error to provide maximal + // information to the user that not enough context objects + // were provided, but this proves too cumbersome in Ember + // in cases where inner template helpers are evaluated + // before parent helpers un-render, in which cases this + // error somewhat prematurely fires. + //throw new Error("Not enough context objects were provided to complete a transition to " + targetRouteName + ". Specifically, the " + name + " route needs an object that can be serialized into its dynamic URL segments [" + names.join(', ') + "]"); + return oldHandlerInfo; + } + } - // A query param update is really just a transition - // into the route you're already on. - var handlerInfos = router.state.handlerInfos; - intent = new NamedTransitionIntent({ - name: handlerInfos[handlerInfos.length - 1].name, - contexts: [], - queryParams: queryParams + return handlerInfoFactory('object', { + name: name, + getHandler: getHandler, + serializer: serializer, + context: objectToUse, + names: names }); + }, - } else if (name.charAt(0) === '/') { + createParamHandlerInfo: function(name, getHandler, names, objects, oldHandlerInfo) { + var params = {}; - log(router, "Attempting URL transition to " + name); - intent = new URLTransitionIntent({ url: name }); + // Soak up all the provided string/numbers + var numNames = names.length; + while (numNames--) { - } else { + // Only use old params if the names match with the new handler + var oldParams = (oldHandlerInfo && name === oldHandlerInfo.name && oldHandlerInfo.params) || {}; - log(router, "Attempting transition to " + name); - intent = new NamedTransitionIntent({ - name: args[0], - contexts: slice.call(args, 1), - queryParams: queryParams + var peek = objects[objects.length - 1]; + var paramName = names[numNames]; + if (isParam(peek)) { + 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); + } + } + } + + return handlerInfoFactory('param', { + name: name, + getHandler: getHandler, + params: params }); } +}); - return router.transitionByIntent(intent, isIntermediate); -} - -function handlerInfosEqual(handlerInfos, otherHandlerInfos) { - if (handlerInfos.length !== otherHandlerInfos.length) { - return false; +function UnrecognizedURLError(message) { + if (!(this instanceof UnrecognizedURLError)) { + return new UnrecognizedURLError(message); } - for (var i = 0, len = handlerInfos.length; i < len; ++i) { - if (handlerInfos[i] !== otherHandlerInfos[i]) { - return false; - } + var error = Error.call(this, message); + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, UnrecognizedURLError); + } else { + this.stack = error.stack; } - return true; + + this.description = error.description; + this.fileName = error.fileName; + this.lineNumber = error.lineNumber; + this.message = error.message || 'UnrecognizedURL'; + this.name = 'UnrecognizedURLError'; + this.number = error.number; + this.code = error.code; } -function finalizeQueryParamChange(router, resolvedHandlers, newQueryParams, transition) { - // We fire a finalizeQueryParamChange event which - // gives the new route hierarchy a chance to tell - // us which query params it's consuming and what - // their final values are. If a query param is - // no longer consumed in the final route hierarchy, - // its serialized segment will be removed - // from the URL. +UnrecognizedURLError.prototype = oCreate(Error.prototype); - for (var k in newQueryParams) { - if (newQueryParams.hasOwnProperty(k) && - newQueryParams[k] === null) { - delete newQueryParams[k]; - } - } +var URLTransitionIntent = subclass(TransitionIntent, { + url: null, - var finalQueryParamsArray = []; - trigger(router, resolvedHandlers, true, ['finalizeQueryParamChange', newQueryParams, finalQueryParamsArray, transition]); + initialize: function(props) { + this.url = props.url; + }, - if (transition) { - transition._visibleQueryParams = {}; - } + applyToState: function(oldState, recognizer, getHandler) { + var newState = new TransitionState(); - var finalQueryParams = {}; - for (var i = 0, len = finalQueryParamsArray.length; i < len; ++i) { - var qp = finalQueryParamsArray[i]; - finalQueryParams[qp.key] = qp.value; - if (transition && qp.visible !== false) { - transition._visibleQueryParams[qp.key] = qp.value; + var results = recognizer.recognize(this.url), + i, len; + + if (!results) { + throw new UnrecognizedURLError(this.url); } - } - return finalQueryParams; -} -function notifyExistingHandlers(router, newState, newTransition) { - var oldHandlers = router.state.handlerInfos, - changing = [], - leavingIndex = null, - leaving, leavingChecker, i, oldHandlerLen, oldHandler, newHandler; + var statesDiffer = false; + var url = this.url; - oldHandlerLen = oldHandlers.length; - for (i = 0; i < oldHandlerLen; i++) { - oldHandler = oldHandlers[i]; - newHandler = newState.handlerInfos[i]; + // Checks if a handler is accessible by URL. If it is not, an error is thrown. + // For the case where the handler is loaded asynchronously, the error will be + // thrown once it is loaded. + function checkHandlerAccessibility(handler) { + if (handler && handler.inaccessibleByURL) { + throw new UnrecognizedURLError(url); + } - if (!newHandler || oldHandler.name !== newHandler.name) { - leavingIndex = i; - break; + return handler; } - if (!newHandler.isResolved) { - changing.push(oldHandler); - } - } + for (i = 0, len = results.length; i < len; ++i) { + var result = results[i]; + var name = result.handler; + var newHandlerInfo = handlerInfoFactory('param', { + name: name, + getHandler: getHandler, + params: result.params + }); + var handler = newHandlerInfo.handler; - if (leavingIndex !== null) { - leaving = oldHandlers.slice(leavingIndex, oldHandlerLen); - leavingChecker = function(name) { - for (var h = 0, len = leaving.length; h < len; h++) { - if (leaving[h].name === name) { - return true; - } + if (handler) { + checkHandlerAccessibility(handler); + } else { + // If the hanlder is being loaded asynchronously, check if we can + // access it after it has resolved + newHandlerInfo.handlerPromise = newHandlerInfo.handlerPromise.then(checkHandlerAccessibility); } - return false; - }; - } - trigger(router, oldHandlers, true, ['willTransition', newTransition]); + var oldHandlerInfo = oldState.handlerInfos[i]; + if (statesDiffer || newHandlerInfo.shouldSupercede(oldHandlerInfo)) { + statesDiffer = true; + newState.handlerInfos[i] = newHandlerInfo; + } else { + newState.handlerInfos[i] = oldHandlerInfo; + } + } - if (router.willTransition) { - router.willTransition(oldHandlers, newState.handlerInfos, newTransition); + merge(newState.queryParams, results.queryParams); + + return newState; } -} +}); -exports['default'] = Router; -exports.Transition = Transition; +var pop = Array.prototype.pop; -Object.defineProperty(exports, '__esModule', { value: true }); +function Router(_options) { + var options = _options || {}; + this.getHandler = options.getHandler || this.getHandler; + this.getSerializer = options.getSerializer || this.getSerializer; + this.updateURL = options.updateURL || this.updateURL; + this.replaceURL = options.replaceURL || this.replaceURL; + this.didTransition = options.didTransition || this.didTransition; + this.willTransition = options.willTransition || this.willTransition; + this.delegate = options.delegate || this.delegate; + this.triggerEvent = options.triggerEvent || this.triggerEvent; + this.log = options.log || this.log; + this.dslCallBacks = []; // NOTE: set by Ember + this.state = undefined; + this.activeTransition = undefined; + this._changedQueryParams = undefined; + this.oldState = undefined; + this.currentHandlerInfos = undefined; + this.state = undefined; + this.currentSequence = 0; -}); -/*! - * @overview RSVP - a tiny implementation of Promises/A+. - * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors - * @license Licensed under MIT license - * See https://raw.githubusercontent.com/tildeio/rsvp.js/master/LICENSE - * @version 3.2.1 - */ + this.recognizer = new RouteRecognizer(); + this.reset(); +} -enifed('rsvp', ['exports'], function (exports) { 'use strict'; +function getTransitionByIntent(intent, isIntermediate) { + var wasTransitioning = !!this.activeTransition; + var oldState = wasTransitioning ? this.activeTransition.state : this.state; + var newTransition; -function indexOf(callbacks, callback) { - for (var i=0, l=callbacks.length; i= 0 && proceed; --i) { + var route = routes[i]; + recognizer.add(routes, { as: route.handler }); + proceed = route.path === '/' || route.path === '' || route.handler.slice(-6) === '.index'; + } }); + }, - yehuda.trigger('poke'); - tom.trigger('poke'); - ``` - - @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']; - object._promiseCallbacks = undefined; - return object; + hasRoute: function(route) { + return this.recognizer.hasRoute(route); }, - /** - Registers a callback to be executed when `eventName` is triggered + getHandler: function() {}, - ```javascript - object.on('event', function(eventInfo){ - // handle the event - }); + getSerializer: function() {}, - object.trigger('event'); - ``` + queryParamsTransition: function(changelist, wasTransitioning, oldState, newState) { + var router = this; - @method on - @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) { - if (typeof callback !== 'function') { - throw new TypeError('Callback must be a function'); - } + fireQueryParamDidChange(this, newState, changelist); + + if (!wasTransitioning && this.activeTransition) { + // One of the handlers in queryParamsDidChange + // caused a transition. Just return that transition. + return this.activeTransition; + } else { + // Running queryParamsDidChange didn't change anything. + // Just update query params and be on our way. - var allCallbacks = callbacksFor(this), callbacks; + // We have to return a noop transition that will + // perform a URL update at the end. This gives + // the user the ability to set the url update + // method (default is replaceState). + var newTransition = new Transition(this); + newTransition.queryParamsOnly = true; - callbacks = allCallbacks[eventName]; + oldState.queryParams = finalizeQueryParamChange(this, newState.handlerInfos, newState.queryParams, newTransition); - if (!callbacks) { - callbacks = allCallbacks[eventName] = []; + newTransition.promise = newTransition.promise.then(function(result) { + updateURL(newTransition, oldState, true); + if (router.didTransition) { + router.didTransition(router.currentHandlerInfos); + } + return result; + }, null, promiseLabel("Transition complete")); + return newTransition; } + }, - if (indexOf(callbacks, callback) === -1) { - callbacks.push(callback); + // NOTE: this doesn't really belong here, but here + // it shall remain until our ES6 transpiler can + // handle cyclical deps. + transitionByIntent: function(intent/*, isIntermediate*/) { + try { + return getTransitionByIntent.apply(this, arguments); + } catch(e) { + return new Transition(this, intent, null, e); } }, /** - You can use `off` to stop firing a particular callback for an event: - - ```javascript - function doStuff() { // do stuff! } - object.on('stuff', doStuff); - - object.trigger('stuff'); // doStuff will be called - - // Unregister ONLY the doStuff callback - object.off('stuff', doStuff); - object.trigger('stuff'); // doStuff will NOT be called - ``` + Clears the current and target route handlers and triggers exit + on each of them starting at the leaf and traversing up through + its ancestors. + */ + reset: function() { + if (this.state) { + forEach(this.state.handlerInfos.slice().reverse(), function(handlerInfo) { + var handler = handlerInfo.handler; + callHook(handler, 'exit'); + }); + } - If you don't pass a `callback` argument to `off`, ALL callbacks for the - event will not be executed when the event fires. For example: + this.oldState = undefined; + this.state = new TransitionState(); + this.currentHandlerInfos = null; + }, - ```javascript - var callback1 = function(){}; - var callback2 = function(){}; + activeTransition: null, - object.on('stuff', callback1); - object.on('stuff', callback2); + /** + var handler = handlerInfo.handler; + The entry point for handling a change to the URL (usually + via the back and forward button). - object.trigger('stuff'); // callback1 and callback2 will be executed. + Returns an Array of handlers and the parameters associated + with those parameters. - object.off('stuff'); - object.trigger('stuff'); // callback1 and callback2 will not be executed! - ``` + @param {String} url a URL to process - @method off - @for RSVP.EventTarget - @private - @param {String} eventName event to stop listening to - @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. + @return {Array} an Array of `[handler, parameter]` tuples */ - 'off': function(eventName, callback) { - var allCallbacks = callbacksFor(this), callbacks, index; - - if (!callback) { - allCallbacks[eventName] = []; - return; - } + handleURL: function(url) { + // Perform a URL-based transition, but don't change + // the URL afterward, since it already happened. + var args = slice.call(arguments); + if (url.charAt(0) !== '/') { args[0] = '/' + url; } - callbacks = allCallbacks[eventName]; + return doTransition(this, args).method(null); + }, - index = indexOf(callbacks, callback); + /** + Hook point for updating the URL. - if (index !== -1) { callbacks.splice(index, 1); } + @param {String} url a URL to update to + */ + updateURL: function() { + throw new Error("updateURL is not implemented"); }, /** - Use `trigger` to fire custom events. For example: + Hook point for replacing the current URL, i.e. with replaceState - ```javascript - object.on('foo', function(){ - console.log('foo event happened!'); - }); - object.trigger('foo'); - // 'foo event happened!' logged to the console - ``` + By default this behaves the same as `updateURL` - You can also pass a value as a second argument to `trigger` that will be - passed as an argument to all event listeners for the event: + @param {String} url a URL to update to + */ + replaceURL: function(url) { + this.updateURL(url); + }, - ```javascript - object.on('foo', function(value){ - console.log(value.name); - }); + /** + Transition into the specified named route. - object.trigger('foo', { name: 'bar' }); - // 'bar' logged to the console - ``` + If necessary, trigger the exit callback on any handlers + that are no longer represented by the target route. - @method trigger - @for RSVP.EventTarget - @private - @param {String} eventName name of the event to be triggered - @param {*} options optional value to be passed to any event handlers for - the given `eventName` + @param {String} name the name of the route */ - 'trigger': function(eventName, options, label) { - var allCallbacks = callbacksFor(this), callbacks, callback; + transitionTo: function(/*name*/) { + return doTransition(this, arguments); + }, - if (callbacks = allCallbacks[eventName]) { - // Don't cache the callbacks.length since it may grow - for (var i=0; i 1) { - throw new Error('Second argument not supported'); - } - if (typeof o !== 'object') { - throw new TypeError('Argument must be an object'); - } - F.prototype = o; - return new F(); -}); + @param {String} name the name of the route + */ + replaceWith: function(/*name*/) { + return doTransition(this, arguments).method('replace'); + }, -var queue = []; + /** + Take a named route and context objects and generate a + URL. -function scheduleFlush() { - setTimeout(function() { - var entry; - for (var i = 0; i < queue.length; i++) { - entry = queue[i]; + @param {String} name the name of the route to generate + a URL for + @param {...Object} objects a list of objects to serialize - var payload = entry.payload; + @return {String} a URL + */ + generate: function(handlerName) { - payload.guid = payload.key + payload.id; - payload.childGuid = payload.key + payload.childId; - if (payload.error) { - payload.stack = payload.error.stack; - } + var partitionedArgs = extractQueryParams(slice.call(arguments, 1)), + suppliedParams = partitionedArgs[0], + queryParams = partitionedArgs[1]; - config['trigger'](entry.name, entry.payload); - } - queue.length = 0; - }, 50); -} + // Construct a TransitionIntent with the provided params + // and apply it to the present state of the router. + var intent = new NamedTransitionIntent({ name: handlerName, contexts: suppliedParams }); + var state = intent.applyToState(this.state, this.recognizer, this.getHandler, null, this.getSerializer); + var params = {}; -function instrument(eventName, promise, child) { - if (1 === queue.push({ - name: eventName, - payload: { - key: promise._guidKey, - id: promise._id, - eventName: eventName, - detail: promise._result, - childId: child && child._id, - label: promise._label, - timeStamp: now(), - error: config["instrument-with-stack"] ? new Error(promise._label) : null - }})) { - scheduleFlush(); + for (var i = 0, len = state.handlerInfos.length; i < len; ++i) { + var handlerInfo = state.handlerInfos[i]; + var handlerParams = handlerInfo.serialize(); + merge(params, handlerParams); } - } - -/** - `RSVP.Promise.resolve` returns a promise that will become resolved with the - passed `value`. It is shorthand for the following: - - ```javascript - var promise = new RSVP.Promise(function(resolve, reject){ - resolve(1); - }); - - promise.then(function(value){ - // value === 1 - }); - ``` - - Instead of writing the above, your code now simply becomes the following: - - ```javascript - var promise = RSVP.Promise.resolve(1); - - promise.then(function(value){ - // value === 1 - }); - ``` - - @method resolve - @static - @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` -*/ -function resolve$1(object, label) { - /*jshint validthis:true */ - var Constructor = this; - - if (object && typeof object === 'object' && object.constructor === Constructor) { - return object; - } - - var promise = new Constructor(noop, label); - resolve(promise, object); - return promise; -} - -function withOwnPromise() { - return new TypeError('A promises callback cannot return that same promise.'); -} - -function noop() {} + params.queryParams = queryParams; -var PENDING = void 0; -var FULFILLED = 1; -var REJECTED = 2; + return this.recognizer.generate(handlerName, params); + }, -var GET_THEN_ERROR = new ErrorObject(); + applyIntent: function(handlerName, contexts) { + var intent = new NamedTransitionIntent({ + name: handlerName, + contexts: contexts + }); -function getThen(promise) { - try { - return promise.then; - } catch(error) { - GET_THEN_ERROR.error = error; - return GET_THEN_ERROR; - } -} + var state = this.activeTransition && this.activeTransition.state || this.state; + return intent.applyToState(state, this.recognizer, this.getHandler, null, this.getSerializer); + }, -function tryThen(then, value, fulfillmentHandler, rejectionHandler) { - try { - then.call(value, fulfillmentHandler, rejectionHandler); - } catch(e) { - return e; - } -} + isActiveIntent: function(handlerName, contexts, queryParams, _state) { + var state = _state || this.state, + targetHandlerInfos = state.handlerInfos, + handlerInfo, len; -function handleForeignThenable(promise, thenable, then) { - config.async(function(promise) { - var sealed = false; - var error = tryThen(then, thenable, function(value) { - if (sealed) { return; } - sealed = true; - if (thenable !== value) { - resolve(promise, value, undefined); - } else { - fulfill(promise, value); - } - }, function(reason) { - if (sealed) { return; } - sealed = true; + if (!targetHandlerInfos.length) { return false; } - reject(promise, reason); - }, 'Settle: ' + (promise._label || ' unknown promise')); + var targetHandler = targetHandlerInfos[targetHandlerInfos.length - 1].name; + var recogHandlers = this.recognizer.handlersFor(targetHandler); - if (!sealed && error) { - sealed = true; - reject(promise, error); + var index = 0; + for (len = recogHandlers.length; index < len; ++index) { + handlerInfo = targetHandlerInfos[index]; + if (handlerInfo.name === handlerName) { break; } } - }, promise); -} - -function handleOwnThenable(promise, thenable) { - if (thenable._state === FULFILLED) { - fulfill(promise, thenable._result); - } else if (thenable._state === REJECTED) { - thenable._onError = null; - reject(promise, thenable._result); - } else { - subscribe(thenable, undefined, function(value) { - if (thenable !== value) { - resolve(promise, value, undefined); - } else { - fulfill(promise, value); - } - }, function(reason) { - reject(promise, reason); - }); - } -} -function handleMaybeThenable(promise, maybeThenable, then$$) { - if (maybeThenable.constructor === promise.constructor && - then$$ === then && - constructor.resolve === resolve$1) { - handleOwnThenable(promise, maybeThenable); - } else { - if (then$$ === GET_THEN_ERROR) { - reject(promise, GET_THEN_ERROR.error); - } else if (then$$ === undefined) { - fulfill(promise, maybeThenable); - } else if (isFunction(then$$)) { - handleForeignThenable(promise, maybeThenable, then$$); - } else { - fulfill(promise, maybeThenable); + if (index === recogHandlers.length) { + // The provided route name isn't even in the route hierarchy. + return false; } - } -} - -function resolve(promise, value) { - if (promise === value) { - fulfill(promise, value); - } else if (objectOrFunction(value)) { - handleMaybeThenable(promise, value, getThen(value)); - } else { - fulfill(promise, value); - } -} - -function publishRejection(promise) { - if (promise._onError) { - promise._onError(promise._result); - } - publish(promise); -} + var testState = new TransitionState(); + testState.handlerInfos = targetHandlerInfos.slice(0, index + 1); + recogHandlers = recogHandlers.slice(0, index + 1); -function fulfill(promise, value) { - if (promise._state !== PENDING) { return; } + var intent = new NamedTransitionIntent({ + name: targetHandler, + contexts: contexts + }); - promise._result = value; - promise._state = FULFILLED; + var newState = intent.applyToHandlers(testState, recogHandlers, this.getHandler, targetHandler, true, true, this.getSerializer); - if (promise._subscribers.length === 0) { - if (config.instrument) { - instrument('fulfilled', promise); + var handlersEqual = handlerInfosEqual(newState.handlerInfos, testState.handlerInfos); + if (!queryParams || !handlersEqual) { + return handlersEqual; } - } else { - config.async(publish, promise); - } -} - -function reject(promise, reason) { - if (promise._state !== PENDING) { return; } - promise._state = REJECTED; - promise._result = reason; - config.async(publishRejection, promise); -} - -function subscribe(parent, child, onFulfillment, onRejection) { - var subscribers = parent._subscribers; - var length = subscribers.length; - - parent._onError = null; - - subscribers[length] = child; - subscribers[length + FULFILLED] = onFulfillment; - subscribers[length + REJECTED] = onRejection; - - if (length === 0 && parent._state) { - config.async(publish, parent); - } -} - -function publish(promise) { - var subscribers = promise._subscribers; - var settled = promise._state; - if (config.instrument) { - instrument(settled === FULFILLED ? 'fulfilled' : 'rejected', promise); - } - - if (subscribers.length === 0) { return; } - - var child, callback, detail = promise._result; - - for (var i = 0; i < subscribers.length; i += 3) { - child = subscribers[i]; - callback = subscribers[i + settled]; + // Get a hash of QPs that will still be active on new route + var activeQPsOnNewHandler = {}; + merge(activeQPsOnNewHandler, queryParams); - if (child) { - invokeCallback(settled, child, callback, detail); - } else { - callback(detail); + var activeQueryParams = state.queryParams; + for (var key in activeQueryParams) { + if (activeQueryParams.hasOwnProperty(key) && + activeQPsOnNewHandler.hasOwnProperty(key)) { + activeQPsOnNewHandler[key] = activeQueryParams[key]; + } } - } - - promise._subscribers.length = 0; -} - -function ErrorObject() { - this.error = null; -} -var TRY_CATCH_ERROR = new ErrorObject(); + return handlersEqual && !getChangelist(activeQPsOnNewHandler, queryParams); + }, -function tryCatch(callback, detail) { - try { - return callback(detail); - } catch(e) { - TRY_CATCH_ERROR.error = e; - return TRY_CATCH_ERROR; - } -} + isActive: function(handlerName) { + var partitionedArgs = extractQueryParams(slice.call(arguments, 1)); + return this.isActiveIntent(handlerName, partitionedArgs[0], partitionedArgs[1]); + }, -function invokeCallback(settled, promise, callback, detail) { - var hasCallback = isFunction(callback), - value, error, succeeded, failed; + trigger: function(/*name*/) { + var args = slice.call(arguments); + trigger(this, this.currentHandlerInfos, false, args); + }, - if (hasCallback) { - value = tryCatch(callback, detail); + /** + Hook point for logging transition status updates. - if (value === TRY_CATCH_ERROR) { - failed = true; - error = value.error; - value = null; - } else { - succeeded = true; - } + @param {String} message The message to log. + */ + log: null +}; - if (promise === value) { - reject(promise, withOwnPromise()); - return; - } +/** + @private - } else { - value = detail; - succeeded = true; - } + Fires queryParamsDidChange event +*/ +function fireQueryParamDidChange(router, newState, queryParamChangelist) { + // If queryParams changed trigger event + if (queryParamChangelist) { - 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); + // This is a little hacky but we need some way of storing + // changed query params given that no activeTransition + // is guaranteed to have occurred. + router._changedQueryParams = queryParamChangelist.all; + trigger(router, newState.handlerInfos, true, ['queryParamsDidChange', queryParamChangelist.changed, queryParamChangelist.all, queryParamChangelist.removed]); + router._changedQueryParams = null; } } -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); - } -} +/** + @private -function then(onFulfillment, onRejection, label) { - var parent = this; - var state = parent._state; + Takes an Array of `HandlerInfo`s, figures out which ones are + exiting, entering, or changing contexts, and calls the + proper handler hooks. - if (state === FULFILLED && !onFulfillment || state === REJECTED && !onRejection) { - config.instrument && instrument('chained', parent, parent); - return parent; - } + For example, consider the following tree of handlers. Each handler is + followed by the URL segment it handles. - parent._onError = null; + ``` + |~index ("/") + | |~posts ("/posts") + | | |-showPost ("/:id") + | | |-newPost ("/new") + | | |-editPost ("/edit") + | |~about ("/about/:id") + ``` - var child = new parent.constructor(noop, label); - var result = parent._result; + Consider the following transitions: - config.instrument && instrument('chained', parent, child); + 1. A URL transition to `/posts/1`. + 1. Triggers the `*model` callbacks on the + `index`, `posts`, and `showPost` handlers + 2. Triggers the `enter` callback on the same + 3. Triggers the `setup` callback on the same + 2. A direct transition to `newPost` + 1. Triggers the `exit` callback on `showPost` + 2. Triggers the `enter` callback on `newPost` + 3. Triggers the `setup` callback on `newPost` + 3. A direct transition to `about` with a specified + context object + 1. Triggers the `exit` callback on `newPost` + and `posts` + 2. Triggers the `serialize` callback on `about` + 3. Triggers the `enter` callback on `about` + 4. Triggers the `setup` callback on `about` - if (state) { - var callback = arguments[state - 1]; - config.async(function(){ - invokeCallback(state, child, callback, result); - }); - } else { - subscribe(parent, child, onFulfillment, onRejection); - } + @param {Router} transition + @param {TransitionState} newState +*/ +function setupContexts(router, newState, transition) { + var partition = partitionHandlers(router.state, newState); + var i, l, handler; - return child; -} + for (i=0, l=partition.exited.length; i= 0; --i) { + var handlerInfo = handlerInfos[i]; + merge(params, handlerInfo.params); + if (handlerInfo.handler.inaccessibleByURL) { + urlMethod = null; + } } - var length = entries.length; + if (urlMethod) { + params.queryParams = transition._visibleQueryParams || state.queryParams; + var url = router.recognizer.generate(handlerName, params); - function onFulfillment(value) { - resolve(promise, value); - } + // transitions during the initial transition must always use replaceURL. + // When the app boots, you are at a url, e.g. /foo. If some handler + // redirects to bar as part of the initial transition, you don't want to + // add a history entry for /foo. If you do, pressing back will immediately + // hit the redirect again and take you back to /bar, thus killing the back + // button + var initial = transition.isCausedByInitialTransition; - function onRejection(reason) { - reject(promise, reason); - } + // say you are at / and you click a link to route /foo. In /foo's + // handler, the transition is aborted using replacewith('/bar'). + // Because the current url is still /, the history entry for / is + // removed from the history. Clicking back will take you to the page + // you were on before /, which is often not even the app, thus killing + // the back button. That's why updateURL is always correct for an + // aborting transition that's not the initial transition + var replaceAndNotAborting = ( + urlMethod === 'replace' && + !transition.isCausedByAbortingTransition + ); - for (var i = 0; promise._state === PENDING && i < length; i++) { - subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection); + if (initial || replaceAndNotAborting) { + router.replaceURL(url); + } else { + router.updateURL(url); + } } - - return promise; } /** - `RSVP.Promise.reject` returns a promise rejected with the passed `reason`. - It is shorthand for the following: - - ```javascript - var promise = new RSVP.Promise(function(resolve, reject){ - reject(new Error('WHOOPS')); - }); - - promise.then(function(value){ - // Code here doesn't run because the promise is rejected! - }, function(reason){ - // reason.message === 'WHOOPS' - }); - ``` + @private - Instead of writing the above, your code now simply becomes the following: + Updates the URL (if necessary) and calls `setupContexts` + to update the router's array of `currentHandlerInfos`. + */ +function finalizeTransition(transition, newState) { - ```javascript - var promise = RSVP.Promise.reject(new Error('WHOOPS')); + try { + log(transition.router, transition.sequence, "Resolved all models on destination route; finalizing transition."); - promise.then(function(value){ - // Code here doesn't run because the promise is rejected! - }, function(reason){ - // reason.message === 'WHOOPS' - }); - ``` + var router = transition.router, + handlerInfos = newState.handlerInfos; - @method reject - @static - @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$1(reason, label) { - /*jshint validthis:true */ - var Constructor = this; - var promise = new Constructor(noop, label); - reject(promise, reason); - return promise; -} + // Run all the necessary enter/setup/exit hooks + setupContexts(router, newState, transition); -var guidKey = 'rsvp_' + now() + '-'; -var counter = 0; + // Check if a redirect occurred in enter/setup + if (transition.isAborted) { + // TODO: cleaner way? distinguish b/w targetHandlerInfos? + router.state.handlerInfos = router.currentHandlerInfos; + return rsvp.Promise.reject(logAbort(transition)); + } -function needsResolver() { - throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); -} + updateURL(transition, newState, transition.intent.url); -function needsNew() { - throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); -} + transition.isActive = false; + router.activeTransition = null; -/** - 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 - why the promise cannot be fulfilled. + trigger(router, router.currentHandlerInfos, true, ['didTransition']); - Terminology - ----------- + if (router.didTransition) { + router.didTransition(router.currentHandlerInfos); + } - - `promise` is an object or function with a `then` method whose behavior conforms to this specification. - - `thenable` is an object or function that defines a `then` method. - - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). - - `exception` is a value that is thrown using the throw statement. - - `reason` is a value that indicates why a promise was rejected. - - `settled` the final resting state of a promise, fulfilled or rejected. + log(router, transition.sequence, "TRANSITION COMPLETE."); - A promise can be in one of three states: pending, fulfilled, or rejected. + // Resolve with the final handler. + return handlerInfos[handlerInfos.length - 1].handler; + } catch(e) { + if (!(e instanceof TransitionAbortedError)) { + //var erroneousHandler = handlerInfos.pop(); + var infos = transition.state.handlerInfos; + transition.trigger(true, 'error', e, transition, infos[infos.length-1].handler); + transition.abort(); + } - Promises that are fulfilled have a fulfillment value and are in the fulfilled - state. Promises that are rejected have a rejection reason and are in the - rejected state. A fulfillment value is never a thenable. + throw e; + } +} - Promises can also be said to *resolve* a value. If this value is also a - promise, then the original promise's settled state will match the value's - settled state. So a promise that *resolves* a promise that rejects will - itself reject, and a promise that *resolves* a promise that fulfills will - itself fulfill. +/** + @private + Begins and returns a Transition based on the provided + arguments. Accepts arguments in the form of both URL + transitions and named transitions. - Basic Usage: - ------------ + @param {Router} router + @param {Array[Object]} args arguments passed to transitionTo, + replaceWith, or handleURL +*/ +function doTransition(router, args, isIntermediate) { + // Normalize blank transitions to root URL transitions. + var name = args[0] || '/'; - ```js - var promise = new Promise(function(resolve, reject) { - // on success - resolve(value); + var lastArg = args[args.length-1]; + var queryParams = {}; + if (lastArg && lastArg.hasOwnProperty('queryParams')) { + queryParams = pop.call(args).queryParams; + } - // on failure - reject(reason); - }); + var intent; + if (args.length === 0) { - promise.then(function(value) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` + log(router, "Updating query params"); - Advanced Usage: - --------------- + // A query param update is really just a transition + // into the route you're already on. + var handlerInfos = router.state.handlerInfos; + intent = new NamedTransitionIntent({ + name: handlerInfos[handlerInfos.length - 1].name, + contexts: [], + queryParams: queryParams + }); - Promises shine when abstracting away asynchronous interactions such as - `XMLHttpRequest`s. + } else if (name.charAt(0) === '/') { - ```js - function getJSON(url) { - return new Promise(function(resolve, reject){ - var xhr = new XMLHttpRequest(); + log(router, "Attempting URL transition to " + name); + intent = new URLTransitionIntent({ url: name }); - xhr.open('GET', url); - xhr.onreadystatechange = handler; - xhr.responseType = 'json'; - xhr.setRequestHeader('Accept', 'application/json'); - xhr.send(); + } else { - function handler() { - if (this.readyState === this.DONE) { - if (this.status === 200) { - resolve(this.response); - } else { - reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); - } - } - }; + log(router, "Attempting transition to " + name); + intent = new NamedTransitionIntent({ + name: args[0], + contexts: slice.call(args, 1), + queryParams: queryParams }); } - getJSON('/posts.json').then(function(json) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` - - Unlike callbacks, promises are great composable primitives. - - ```js - Promise.all([ - getJSON('/posts'), - getJSON('/comments') - ]).then(function(values){ - values[0] // => postsJSON - values[1] // => commentsJSON - - return values; - }); - ``` - - @class RSVP.Promise - @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 = []; + return router.transitionByIntent(intent, isIntermediate); +} - config.instrument && instrument('created', this); +function handlerInfosEqual(handlerInfos, otherHandlerInfos) { + if (handlerInfos.length !== otherHandlerInfos.length) { + return false; + } - if (noop !== resolver) { - typeof resolver !== 'function' && needsResolver(); - this instanceof Promise ? initializePromise(this, resolver) : needsNew(); + for (var i = 0, len = handlerInfos.length; i < len; ++i) { + if (handlerInfos[i] !== otherHandlerInfos[i]) { + return false; + } } + return true; } -Promise.cast = resolve$1; // deprecated -Promise.all = all; -Promise.race = race; -Promise.resolve = resolve$1; -Promise.reject = reject$1; - -Promise.prototype = { - constructor: Promise, +function finalizeQueryParamChange(router, resolvedHandlers, newQueryParams, transition) { + // We fire a finalizeQueryParamChange event which + // gives the new route hierarchy a chance to tell + // us which query params it's consuming and what + // their final values are. If a query param is + // no longer consumed in the final route hierarchy, + // its serialized segment will be removed + // from the URL. - _guidKey: guidKey, + for (var k in newQueryParams) { + if (newQueryParams.hasOwnProperty(k) && + newQueryParams[k] === null) { + delete newQueryParams[k]; + } + } - _onError: function (reason) { - var promise = this; - config.after(function() { - if (promise._onError) { - config['trigger']('error', reason, promise._label); - } - }); - }, + var finalQueryParamsArray = []; + trigger(router, resolvedHandlers, true, ['finalizeQueryParamChange', newQueryParams, finalQueryParamsArray, transition]); -/** - 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 why the promise cannot be fulfilled. - - ```js - findUser().then(function(user){ - // user is available - }, function(reason){ - // user is unavailable, and you are given the reason why - }); - ``` + if (transition) { + transition._visibleQueryParams = {}; + } - Chaining - -------- - - The return value of `then` is itself a promise. This second, 'downstream' - promise is resolved with the return value of the first promise's fulfillment - or rejection handler, or rejected if the handler throws an exception. - - ```js - findUser().then(function (user) { - return user.name; - }, function (reason) { - return 'default name'; - }).then(function (userName) { - // If `findUser` fulfilled, `userName` will be the user's name, otherwise it - // will be `'default name'` - }); + var finalQueryParams = {}; + for (var i = 0, len = finalQueryParamsArray.length; i < len; ++i) { + var qp = finalQueryParamsArray[i]; + finalQueryParams[qp.key] = qp.value; + if (transition && qp.visible !== false) { + transition._visibleQueryParams[qp.key] = qp.value; + } + } + return finalQueryParams; +} - findUser().then(function (user) { - throw new Error('Found user, but still unhappy'); - }, function (reason) { - throw new Error('`findUser` rejected and we're unhappy'); - }).then(function (value) { - // never reached - }, function (reason) { - // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. - // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. - }); - ``` - If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. - - ```js - findUser().then(function (user) { - throw new PedagogicalException('Upstream error'); - }).then(function (value) { - // never reached - }).then(function (value) { - // never reached - }, function (reason) { - // The `PedgagocialException` is propagated all the way down to here - }); - ``` +function notifyExistingHandlers(router, newState, newTransition) { + var oldHandlers = router.state.handlerInfos, + changing = [], + leavingIndex = null, + leaving, leavingChecker, i, oldHandlerLen, oldHandler, newHandler; - Assimilation - ------------ + oldHandlerLen = oldHandlers.length; + for (i = 0; i < oldHandlerLen; i++) { + oldHandler = oldHandlers[i]; + newHandler = newState.handlerInfos[i]; - Sometimes the value you want to propagate to a downstream promise can only be - retrieved asynchronously. This can be achieved by returning a promise in the - fulfillment or rejection handler. The downstream promise will then be pending - until the returned promise is settled. This is called *assimilation*. + if (!newHandler || oldHandler.name !== newHandler.name) { + leavingIndex = i; + break; + } - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // The user's comments are now available - }); - ``` + if (!newHandler.isResolved) { + changing.push(oldHandler); + } + } - If the assimliated promise rejects, then the downstream promise will also reject. + if (leavingIndex !== null) { + leaving = oldHandlers.slice(leavingIndex, oldHandlerLen); + leavingChecker = function(name) { + for (var h = 0, len = leaving.length; h < len; h++) { + if (leaving[h].name === name) { + return true; + } + } + return false; + }; + } - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // If `findCommentsByAuthor` fulfills, we'll have the value here - }, function (reason) { - // If `findCommentsByAuthor` rejects, we'll have the reason here - }); - ``` + trigger(router, oldHandlers, true, ['willTransition', newTransition]); - Simple Example - -------------- + if (router.willTransition) { + router.willTransition(oldHandlers, newState.handlerInfos, newTransition); + } +} - Synchronous Example +exports['default'] = Router; +exports.Transition = Transition; - ```javascript - var result; +Object.defineProperty(exports, '__esModule', { value: true }); - try { - result = findResult(); - // success - } catch(reason) { - // failure - } - ``` +}); +enifed('rsvp', ['exports'], function (exports) { + 'use strict'; - Errback Example + var _rsvp; - ```js - findResult(function(result, err){ - if (err) { - // failure - } else { - // success + function indexOf(callbacks, callback) { + for (var i = 0, l = callbacks.length; i < l; i++) { + if (callbacks[i] === callback) { + return i; + } } - }); - ``` - - Promise Example; - - ```javascript - findResult().then(function(result){ - // success - }, function(reason){ - // failure - }); - ``` - Advanced Example - -------------- + return -1; + } - Synchronous Example + function callbacksFor(object) { + var callbacks = object._promiseCallbacks; - ```javascript - var author, books; + if (!callbacks) { + callbacks = object._promiseCallbacks = {}; + } - try { - author = findAuthor(); - books = findBooksByAuthor(author); - // success - } catch(reason) { - // failure + return callbacks; } - ``` - Errback Example + /** + @class RSVP.EventTarget + */ + var EventTarget = { - ```js + /** + `RSVP.EventTarget.mixin` extends an object with EventTarget methods. For + Example: + ```javascript + let object = {}; + RSVP.EventTarget.mixin(object); + object.on('finished', function(event) { + // handle event + }); + object.trigger('finished', { detail: value }); + ``` + `EventTarget.mixin` also works with prototypes: + ```javascript + let Person = function() {}; + RSVP.EventTarget.mixin(Person.prototype); + let yehuda = new Person(); + let tom = new Person(); + yehuda.on('poke', function(event) { + console.log('Yehuda says OW'); + }); + tom.on('poke', function(event) { + console.log('Tom says OW'); + }); + yehuda.trigger('poke'); + tom.trigger('poke'); + ``` + @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']; + object._promiseCallbacks = undefined; + return object; + }, - function foundBooks(books) { + /** + Registers a callback to be executed when `eventName` is triggered + ```javascript + object.on('event', function(eventInfo){ + // handle the event + }); + object.trigger('event'); + ``` + @method on + @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) { + if (typeof callback !== 'function') { + throw new TypeError('Callback must be a function'); + } - } + var allCallbacks = callbacksFor(this), + callbacks = undefined; - function failure(reason) { + callbacks = allCallbacks[eventName]; - } + if (!callbacks) { + callbacks = allCallbacks[eventName] = []; + } - findAuthor(function(author, err){ - if (err) { - failure(err); - // failure - } else { - try { - findBoooksByAuthor(author, function(books, err) { - if (err) { - failure(err); - } else { - try { - foundBooks(books); - } catch(reason) { - failure(reason); - } - } - }); - } catch(error) { - failure(err); + if (indexOf(callbacks, callback) === -1) { + callbacks.push(callback); } - // success - } - }); - ``` + }, - Promise Example; + /** + You can use `off` to stop firing a particular callback for an event: + ```javascript + function doStuff() { // do stuff! } + object.on('stuff', doStuff); + object.trigger('stuff'); // doStuff will be called + // Unregister ONLY the doStuff callback + object.off('stuff', doStuff); + object.trigger('stuff'); // doStuff will NOT be called + ``` + If you don't pass a `callback` argument to `off`, ALL callbacks for the + event will not be executed when the event fires. For example: + ```javascript + let callback1 = function(){}; + let callback2 = function(){}; + object.on('stuff', callback1); + object.on('stuff', callback2); + object.trigger('stuff'); // callback1 and callback2 will be executed. + object.off('stuff'); + object.trigger('stuff'); // callback1 and callback2 will not be executed! + ``` + @method off + @for RSVP.EventTarget + @private + @param {String} eventName event to stop listening to + @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) { + var allCallbacks = callbacksFor(this), + callbacks = undefined, + index = undefined; - ```javascript - findAuthor(). - then(findBooksByAuthor). - then(function(books){ - // found books - }).catch(function(reason){ - // something went wrong - }); - ``` + if (!callback) { + allCallbacks[eventName] = []; + return; + } - @method then - @param {Function} onFulfillment - @param {Function} onRejection - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} -*/ - then: then, + callbacks = allCallbacks[eventName]; -/** - `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same - as the catch block of a try/catch statement. + index = indexOf(callbacks, callback); - ```js - function findAuthor(){ - throw new Error('couldn't find that author'); - } + if (index !== -1) { + callbacks.splice(index, 1); + } + }, - // synchronous - try { - findAuthor(); - } catch(reason) { - // something went wrong - } + /** + Use `trigger` to fire custom events. For example: + ```javascript + object.on('foo', function(){ + console.log('foo event happened!'); + }); + object.trigger('foo'); + // 'foo event happened!' logged to the console + ``` + You can also pass a value as a second argument to `trigger` that will be + passed as an argument to all event listeners for the event: + ```javascript + object.on('foo', function(value){ + console.log(value.name); + }); + object.trigger('foo', { name: 'bar' }); + // 'bar' logged to the console + ``` + @method trigger + @for RSVP.EventTarget + @private + @param {String} eventName name of the event to be triggered + @param {*} options optional value to be passed to any event handlers for + the given `eventName` + */ + trigger: function (eventName, options, label) { + var allCallbacks = callbacksFor(this), + callbacks = undefined, + callback = undefined; - // async with promises - findAuthor().catch(function(reason){ - // something went wrong - }); - ``` + if (callbacks = allCallbacks[eventName]) { + // Don't cache the callbacks.length since it may grow + for (var i = 0; i < callbacks.length; i++) { + callback = callbacks[i]; - @method catch - @param {Function} onRejection - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} -*/ - 'catch': function(onRejection, label) { - return this.then(undefined, onRejection, label); - }, + callback(options, label); + } + } + } + }; -/** - `finally` will be invoked regardless of the promise's fate just as native - try/catch/finally behaves + var config = { + instrument: false + }; + + EventTarget['mixin'](config); - Synchronous example: + 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); + return; + } - ```js - findAuthor() { - if (Math.random() > 0.5) { - throw new Error(); + if (arguments.length === 2) { + config[name] = value; + } else { + return config[name]; } - return new Author(); } - try { - return findAuthor(); // succeed or fail - } catch(error) { - return findOtherAuther(); - } finally { - // always runs - // doesn't affect the return value + function objectOrFunction(x) { + return typeof x === 'function' || typeof x === 'object' && x !== null; } - ``` - - Asynchronous example: - - ```js - findAuthor().catch(function(reason){ - return findOtherAuther(); - }).finally(function(){ - // author was either found, or not - }); - ``` - - @method finally - @param {Function} callback - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} -*/ - 'finally': function(callback, label) { - var promise = this; - var constructor = promise.constructor; - return promise.then(function(value) { - return constructor.resolve(callback()).then(function() { - return value; - }); - }, function(reason) { - return constructor.resolve(callback()).then(function() { - return constructor.reject(reason); - }); - }, label); + function isFunction(x) { + return typeof x === 'function'; } -}; - -function Result() { - this.value = undefined; -} -var ERROR = new Result(); -var GET_THEN_ERROR$1 = new Result(); + function isMaybeThenable(x) { + return typeof x === 'object' && x !== null; + } -function getThen$1(obj) { - try { - return obj.then; - } catch(error) { - ERROR.value= error; - return ERROR; + var _isArray = undefined; + if (!Array.isArray) { + _isArray = function (x) { + return Object.prototype.toString.call(x) === '[object Array]'; + }; + } else { + _isArray = Array.isArray; } -} + var isArray = _isArray; -function tryApply(f, s, a) { - try { - f.apply(s, a); - } catch(error) { - ERROR.value = error; - return ERROR; - } -} + // Date.now is not available in browsers < IE9 + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now#Compatibility + var now = Date.now || function () { + return new Date().getTime(); + }; -function makeObject(_, argumentNames) { - var obj = {}; - var name; - var i; - var length = _.length; - var args = new Array(length); + function F() {} - for (var x = 0; x < length; x++) { - args[x] = _[x]; - } + var o_create = Object.create || function (o) { + if (arguments.length > 1) { + throw new Error('Second argument not supported'); + } + if (typeof o !== 'object') { + throw new TypeError('Argument must be an object'); + } + F.prototype = o; + return new F(); + }; - for (i = 0; i < argumentNames.length; i++) { - name = argumentNames[i]; - obj[name] = args[i + 1]; - } + var queue = []; - return obj; -} + function scheduleFlush() { + setTimeout(function () { + for (var i = 0; i < queue.length; i++) { + var entry = queue[i]; -function arrayResult(_) { - var length = _.length; - var args = new Array(length - 1); + var payload = entry.payload; - for (var i = 1; i < length; i++) { - args[i - 1] = _[i]; - } + payload.guid = payload.key + payload.id; + payload.childGuid = payload.key + payload.childId; + if (payload.error) { + payload.stack = payload.error.stack; + } - return args; -} + config['trigger'](entry.name, entry.payload); + } + queue.length = 0; + }, 50); + } -function wrapThenable(then, promise) { - return { - then: function(onFulFillment, onRejection) { - return then.call(promise, onFulFillment, onRejection); + function instrument(eventName, promise, child) { + if (1 === queue.push({ + name: eventName, + payload: { + key: promise._guidKey, + id: promise._id, + eventName: eventName, + detail: promise._result, + childId: child && child._id, + label: promise._label, + timeStamp: now(), + error: config["instrument-with-stack"] ? new Error(promise._label) : null + } })) { + scheduleFlush(); } - }; -} + } -/** - `RSVP.denodeify` takes a 'node-style' function and returns a function that - will return an `RSVP.Promise`. You can use `denodeify` in Node.js or the - browser when you'd prefer to use promises over using callbacks. For example, - `denodeify` transforms the following: + /** + `RSVP.Promise.resolve` returns a promise that will become resolved with the + passed `value`. It is shorthand for the following: + + ```javascript + let promise = new RSVP.Promise(function(resolve, reject){ + resolve(1); + }); + + promise.then(function(value){ + // value === 1 + }); + ``` + + Instead of writing the above, your code now simply becomes the following: + + ```javascript + let promise = RSVP.Promise.resolve(1); + + promise.then(function(value){ + // value === 1 + }); + ``` + + @method resolve + @static + @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` + */ + function resolve$1(object, label) { + /*jshint validthis:true */ + var Constructor = this; - ```javascript - var fs = require('fs'); + if (object && typeof object === 'object' && object.constructor === Constructor) { + return object; + } - fs.readFile('myfile.txt', function(err, data){ - if (err) return handleError(err); - handleData(data); - }); - ``` + var promise = new Constructor(noop, label); + resolve(promise, object); + return promise; + } - into: + function withOwnPromise() { + return new TypeError('A promises callback cannot return that same promise.'); + } - ```javascript - var fs = require('fs'); - var readFile = RSVP.denodeify(fs.readFile); + function noop() {} - readFile('myfile.txt').then(handleData, handleError); - ``` + var PENDING = void 0; + var FULFILLED = 1; + var REJECTED = 2; - If the node function has multiple success parameters, then `denodeify` - just returns the first one: + var GET_THEN_ERROR = new ErrorObject(); - ```javascript - var request = RSVP.denodeify(require('request')); + function getThen(promise) { + try { + return promise.then; + } catch (error) { + GET_THEN_ERROR.error = error; + return GET_THEN_ERROR; + } + } - request('http://example.com').then(function(res) { - // ... - }); - ``` + function tryThen(then, value, fulfillmentHandler, rejectionHandler) { + try { + then.call(value, fulfillmentHandler, rejectionHandler); + } catch (e) { + return e; + } + } - However, if you need all success parameters, setting `denodeify`'s - second parameter to `true` causes it to return all success parameters - as an array: + function handleForeignThenable(promise, thenable, then) { + config.async(function (promise) { + var sealed = false; + var error = tryThen(then, thenable, function (value) { + if (sealed) { + return; + } + sealed = true; + if (thenable !== value) { + resolve(promise, value, undefined); + } else { + fulfill(promise, value); + } + }, function (reason) { + if (sealed) { + return; + } + sealed = true; - ```javascript - var request = RSVP.denodeify(require('request'), true); + reject(promise, reason); + }, 'Settle: ' + (promise._label || ' unknown promise')); - request('http://example.com').then(function(result) { - // result[0] -> res - // result[1] -> body - }); - ``` + if (!sealed && error) { + sealed = true; + reject(promise, error); + } + }, promise); + } - Or if you pass it an array with names it returns the parameters as a hash: + function handleOwnThenable(promise, thenable) { + if (thenable._state === FULFILLED) { + fulfill(promise, thenable._result); + } else if (thenable._state === REJECTED) { + thenable._onError = null; + reject(promise, thenable._result); + } else { + subscribe(thenable, undefined, function (value) { + if (thenable !== value) { + resolve(promise, value, undefined); + } else { + fulfill(promise, value); + } + }, function (reason) { + return reject(promise, reason); + }); + } + } - ```javascript - var request = RSVP.denodeify(require('request'), ['res', 'body']); + function handleMaybeThenable(promise, maybeThenable, then$$) { + if (maybeThenable.constructor === promise.constructor && then$$ === then && promise.constructor.resolve === resolve$1) { + handleOwnThenable(promise, maybeThenable); + } else { + if (then$$ === GET_THEN_ERROR) { + reject(promise, GET_THEN_ERROR.error); + } else if (then$$ === undefined) { + fulfill(promise, maybeThenable); + } else if (isFunction(then$$)) { + handleForeignThenable(promise, maybeThenable, then$$); + } else { + fulfill(promise, maybeThenable); + } + } + } - request('http://example.com').then(function(result) { - // result.res - // result.body - }); - ``` + function resolve(promise, value) { + if (promise === value) { + fulfill(promise, value); + } else if (objectOrFunction(value)) { + handleMaybeThenable(promise, value, getThen(value)); + } else { + fulfill(promise, value); + } + } - Sometimes you need to retain the `this`: + function publishRejection(promise) { + if (promise._onError) { + promise._onError(promise._result); + } - ```javascript - var app = require('express')(); - var render = RSVP.denodeify(app.render.bind(app)); - ``` + publish(promise); + } - The denodified function inherits from the original function. It works in all - environments, except IE 10 and below. Consequently all properties of the original - function are available to you. However, any properties you change on the - denodeified function won't be changed on the original function. Example: + function fulfill(promise, value) { + if (promise._state !== PENDING) { + return; + } - ```javascript - var request = RSVP.denodeify(require('request')), - cookieJar = request.jar(); // <- Inheritance is used here + promise._result = value; + promise._state = FULFILLED; - request('http://example.com', {jar: cookieJar}).then(function(res) { - // cookieJar.cookies holds now the cookies returned by example.com - }); - ``` + if (promise._subscribers.length === 0) { + if (config.instrument) { + instrument('fulfilled', promise); + } + } else { + config.async(publish, promise); + } + } - Using `denodeify` makes it easier to compose asynchronous operations instead - of using callbacks. For example, instead of: + function reject(promise, reason) { + if (promise._state !== PENDING) { + return; + } + promise._state = REJECTED; + promise._result = reason; + config.async(publishRejection, promise); + } - ```javascript - var fs = require('fs'); + function subscribe(parent, child, onFulfillment, onRejection) { + var subscribers = parent._subscribers; + var length = subscribers.length; - fs.readFile('myfile.txt', function(err, data){ - if (err) { ... } // Handle error - fs.writeFile('myfile2.txt', data, function(err){ - if (err) { ... } // Handle error - console.log('done') - }); - }); - ``` + parent._onError = null; - you can chain the operations together using `then` from the returned promise: + subscribers[length] = child; + subscribers[length + FULFILLED] = onFulfillment; + subscribers[length + REJECTED] = onRejection; - ```javascript - var fs = require('fs'); - var readFile = RSVP.denodeify(fs.readFile); - var writeFile = RSVP.denodeify(fs.writeFile); - - readFile('myfile.txt').then(function(data){ - return writeFile('myfile2.txt', data); - }).then(function(){ - console.log('done') - }).catch(function(error){ - // Handle error - }); - ``` + if (length === 0 && parent._state) { + config.async(publish, parent); + } + } - @method denodeify - @static - @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} [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. - @return {Function} a function that wraps `nodeFunc` to return an - `RSVP.Promise` - @static -*/ -function denodeify(nodeFunc, options) { - var fn = function() { - var self = this; - var l = arguments.length; - var args = new Array(l + 1); - var arg; - var promiseInput = false; + function publish(promise) { + var subscribers = promise._subscribers; + var settled = promise._state; - for (var i = 0; i < l; ++i) { - arg = arguments[i]; + if (config.instrument) { + instrument(settled === FULFILLED ? 'fulfilled' : 'rejected', promise); + } - if (!promiseInput) { - // TODO: clean this up - promiseInput = needsPromiseInput(arg); - if (promiseInput === GET_THEN_ERROR$1) { - var p = new Promise(noop); - reject(p, GET_THEN_ERROR$1.value); - return p; - } else if (promiseInput && promiseInput !== true) { - arg = wrapThenable(promiseInput, arg); - } - } - args[i] = arg; + if (subscribers.length === 0) { + return; } - var promise = new Promise(noop); + var child = undefined, + callback = undefined, + detail = promise._result; - args[l] = function(err, val) { - if (err) - reject(promise, err); - else if (options === undefined) - resolve(promise, val); - else if (options === true) - resolve(promise, arrayResult(arguments)); - else if (isArray(options)) - resolve(promise, makeObject(arguments, options)); - else - resolve(promise, val); - }; + for (var i = 0; i < subscribers.length; i += 3) { + child = subscribers[i]; + callback = subscribers[i + settled]; - if (promiseInput) { - return handlePromiseInput(promise, args, nodeFunc, self); - } else { - return handleValueInput(promise, args, nodeFunc, self); + if (child) { + invokeCallback(settled, child, callback, detail); + } else { + callback(detail); + } } - }; - - fn.__proto__ = nodeFunc; - return fn; -} + promise._subscribers.length = 0; + } -function handleValueInput(promise, args, nodeFunc, self) { - var result = tryApply(nodeFunc, self, args); - if (result === ERROR) { - reject(promise, result.value); + function ErrorObject() { + this.error = null; } - return promise; -} -function handlePromiseInput(promise, args, nodeFunc, self){ - return Promise.all(args).then(function(args){ - var result = tryApply(nodeFunc, self, args); - if (result === ERROR) { - reject(promise, result.value); - } - return promise; - }); -} + var TRY_CATCH_ERROR = new ErrorObject(); -function needsPromiseInput(arg) { - if (arg && typeof arg === 'object') { - if (arg.constructor === Promise) { - return true; - } else { - return getThen$1(arg); + function tryCatch(callback, detail) { + try { + return callback(detail); + } catch (e) { + TRY_CATCH_ERROR.error = e; + return TRY_CATCH_ERROR; } - } else { - return false; } -} -/** - This is a convenient alias for `RSVP.Promise.all`. + function invokeCallback(settled, promise, callback, detail) { + var hasCallback = isFunction(callback), + value = undefined, + error = undefined, + succeeded = undefined, + failed = undefined; - @method all - @static - @for RSVP - @param {Array} array Array of promises. - @param {String} label An optional label. This is useful - for tooling. -*/ -function all$1(array, label) { - return Promise.all(array, label); -} + if (hasCallback) { + value = tryCatch(callback, detail); -function AllSettled(Constructor, entries, label) { - this._superConstructor(Constructor, entries, false /* don't abort on reject */, label); -} + if (value === TRY_CATCH_ERROR) { + failed = true; + error = value.error; + value = null; + } else { + succeeded = true; + } -AllSettled.prototype = o_create(Enumerator.prototype); -AllSettled.prototype._superConstructor = Enumerator; -AllSettled.prototype._makeResult = makeSettledResult; -AllSettled.prototype._validationError = function() { - return new Error('allSettled must be called with an array'); -}; + if (promise === value) { + reject(promise, withOwnPromise()); + return; + } + } else { + value = detail; + succeeded = true; + } -/** - `RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing - a fail-fast method, it waits until all the promises have returned and - shows you all the results. This is useful if you want to handle multiple - promises' failure states together as a set. + 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); + } + } - Returns a promise that is fulfilled when all the given promises have been - settled. The return promise is fulfilled with an array of the states of - the promises passed into the `promises` array argument. + function initializePromise(promise, resolver) { + var resolved = false; + try { + resolver(function (value) { + if (resolved) { + return; + } + resolved = true; + resolve(promise, value); + }, function (reason) { + if (resolved) { + return; + } + resolved = true; + reject(promise, reason); + }); + } catch (e) { + reject(promise, e); + } + } - Each state object will either indicate fulfillment or rejection, and - provide the corresponding value or reason. The states will take one of - the following formats: + function then(onFulfillment, onRejection, label) { + var _arguments = arguments; - ```javascript - { state: 'fulfilled', value: value } - or - { state: 'rejected', reason: reason } - ``` + var parent = this; + var state = parent._state; - Example: + if (state === FULFILLED && !onFulfillment || state === REJECTED && !onRejection) { + config.instrument && instrument('chained', parent, parent); + return parent; + } - ```javascript - var promise1 = RSVP.Promise.resolve(1); - var promise2 = RSVP.Promise.reject(new Error('2')); - var promise3 = RSVP.Promise.reject(new Error('3')); - var promises = [ promise1, promise2, promise3 ]; - - RSVP.allSettled(promises).then(function(array){ - // array == [ - // { state: 'fulfilled', value: 1 }, - // { state: 'rejected', reason: Error }, - // { state: 'rejected', reason: Error } - // ] - // Note that for the second item, reason.message will be '2', and for the - // third item, reason.message will be '3'. - }, function(error) { - // Not run. (This block would only be called if allSettled had failed, - // for instance if passed an incorrect argument type.) - }); - ``` + parent._onError = null; - @method allSettled - @static - @for RSVP - @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. -*/ + var child = new parent.constructor(noop, label); + var result = parent._result; -function allSettled(entries, label) { - return new AllSettled(Promise, entries, label).promise; -} + config.instrument && instrument('chained', parent, child); -/** - This is a convenient alias for `RSVP.Promise.race`. + if (state) { + (function () { + var callback = _arguments[state - 1]; + config.async(function () { + return invokeCallback(state, child, callback, result); + }); + })(); + } else { + subscribe(parent, child, onFulfillment, onRejection); + } - @method race - @static - @for RSVP - @param {Array} array Array of promises. - @param {String} label An optional label. This is useful - for tooling. - */ -function race$1(array, label) { - return Promise.race(array, label); -} + return child; + } -function PromiseHash(Constructor, object, label) { - this._superConstructor(Constructor, object, true, label); -} + function makeSettledResult(state, position, value) { + if (state === FULFILLED) { + return { + state: 'fulfilled', + value: value + }; + } else { + return { + state: 'rejected', + reason: value + }; + } + } -PromiseHash.prototype = o_create(Enumerator.prototype); -PromiseHash.prototype._superConstructor = Enumerator; -PromiseHash.prototype._init = function() { - this._result = {}; -}; + function Enumerator(Constructor, input, abortOnReject, label) { + this._instanceConstructor = Constructor; + this.promise = new Constructor(noop, label); + this._abortOnReject = abortOnReject; -PromiseHash.prototype._validateInput = function(input) { - return input && typeof input === 'object'; -}; + if (this._validateInput(input)) { + this._input = input; + this.length = input.length; + this._remaining = input.length; -PromiseHash.prototype._validationError = function() { - return new Error('Promise.hash must be called with an object'); -}; + this._init(); -PromiseHash.prototype._enumerate = function() { - var enumerator = this; - var promise = enumerator.promise; - var input = enumerator._input; - var results = []; - - for (var key in input) { - if (promise._state === PENDING && Object.prototype.hasOwnProperty.call(input, key)) { - results.push({ - position: key, - entry: input[key] - }); + if (this.length === 0) { + fulfill(this.promise, this._result); + } else { + this.length = this.length || 0; + this._enumerate(); + if (this._remaining === 0) { + fulfill(this.promise, this._result); + } + } + } else { + reject(this.promise, this._validationError()); } } - var length = results.length; - enumerator._remaining = length; - var result; + Enumerator.prototype._validateInput = function (input) { + return isArray(input); + }; - for (var i = 0; promise._state === PENDING && i < length; i++) { - result = results[i]; - enumerator._eachEntry(result.entry, result.position); - } -}; + Enumerator.prototype._validationError = function () { + return new Error('Array Methods must be provided an Array'); + }; -/** - `RSVP.hash` is similar to `RSVP.all`, but takes an object instead of an array - for its `promises` argument. + Enumerator.prototype._init = function () { + this._result = new Array(this.length); + }; - Returns a promise that is fulfilled when all the given promises have been - fulfilled, or rejected if any of them become rejected. The returned promise - is fulfilled with a hash that has the same key names as the `promises` object - argument. If any of the values in the object are not promises, they will - simply be copied over to the fulfilled object. + Enumerator.prototype._enumerate = function () { + var length = this.length; + var promise = this.promise; + var input = this._input; - Example: + for (var i = 0; promise._state === PENDING && i < length; i++) { + this._eachEntry(input[i], i); + } + }; - ```javascript - var promises = { - myPromise: RSVP.resolve(1), - yourPromise: RSVP.resolve(2), - theirPromise: RSVP.resolve(3), - notAPromise: 4 + Enumerator.prototype._settleMaybeThenable = function (entry, i) { + var c = this._instanceConstructor; + var resolve = c.resolve; + + if (resolve === resolve$1) { + var then$$ = getThen(entry); + + if (then$$ === then && entry._state !== PENDING) { + entry._onError = null; + this._settledAt(entry._state, i, entry._result); + } else if (typeof then$$ !== 'function') { + this._remaining--; + this._result[i] = this._makeResult(FULFILLED, i, entry); + } else if (c === Promise) { + var promise = new c(noop); + handleMaybeThenable(promise, entry, then$$); + this._willSettleAt(promise, i); + } else { + this._willSettleAt(new c(function (resolve) { + return resolve(entry); + }), i); + } + } else { + this._willSettleAt(resolve(entry), i); + } }; - RSVP.hash(promises).then(function(hash){ - // hash here is an object that looks like: - // { - // myPromise: 1, - // yourPromise: 2, - // theirPromise: 3, - // notAPromise: 4 - // } - }); - ```` + Enumerator.prototype._eachEntry = function (entry, i) { + if (isMaybeThenable(entry)) { + this._settleMaybeThenable(entry, i); + } else { + this._remaining--; + this._result[i] = this._makeResult(FULFILLED, i, entry); + } + }; - If any of the `promises` given to `RSVP.hash` are rejected, the first promise - that is rejected will be given as the reason to the rejection handler. + Enumerator.prototype._settledAt = function (state, i, value) { + var promise = this.promise; - Example: + if (promise._state === PENDING) { + this._remaining--; - ```javascript - var promises = { - myPromise: RSVP.resolve(1), - rejectedPromise: RSVP.reject(new Error('rejectedPromise')), - anotherRejectedPromise: RSVP.reject(new Error('anotherRejectedPromise')), + if (this._abortOnReject && state === REJECTED) { + reject(promise, value); + } else { + this._result[i] = this._makeResult(state, i, value); + } + } + + if (this._remaining === 0) { + fulfill(promise, this._result); + } }; - RSVP.hash(promises).then(function(hash){ - // Code here never runs because there are rejected promises! - }, function(reason) { - // reason.message === 'rejectedPromise' - }); - ``` + Enumerator.prototype._makeResult = function (state, i, value) { + return value; + }; - An important note: `RSVP.hash` is intended for plain JavaScript objects that - are just a set of keys and values. `RSVP.hash` will NOT preserve prototype - chains. + Enumerator.prototype._willSettleAt = function (promise, i) { + var enumerator = this; - Example: + subscribe(promise, undefined, function (value) { + return enumerator._settledAt(FULFILLED, i, value); + }, function (reason) { + return enumerator._settledAt(REJECTED, i, reason); + }); + }; - ```javascript - function MyConstructor(){ - this.example = RSVP.resolve('Example'); + /** + `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 + rejected with the reason of the first passed promise to be rejected. It casts all + elements of the passed iterable to promises as it runs this algorithm. + + Example: + + ```javascript + let promise1 = RSVP.resolve(1); + let promise2 = RSVP.resolve(2); + let promise3 = RSVP.resolve(3); + let promises = [ promise1, promise2, promise3 ]; + + RSVP.Promise.all(promises).then(function(array){ + // The array here would be [ 1, 2, 3 ]; + }); + ``` + + If any of the `promises` given to `RSVP.all` are rejected, the first promise + that is rejected will be given as an argument to the returned promises's + rejection handler. For example: + + Example: + + ```javascript + let promise1 = RSVP.resolve(1); + let promise2 = RSVP.reject(new Error("2")); + let promise3 = RSVP.reject(new Error("3")); + let promises = [ promise1, promise2, promise3 ]; + + RSVP.Promise.all(promises).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(error) { + // error.message === "2" + }); + ``` + + @method all + @static + @param {Array} entries array of promises + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} promise that is fulfilled when all `promises` have been + fulfilled, or rejected if any of them become rejected. + @static + */ + function all(entries, label) { + return new Enumerator(this, entries, true, /* abort on reject */label).promise; } - MyConstructor.prototype = { - protoProperty: RSVP.resolve('Proto Property') - }; + /** + `RSVP.Promise.race` returns a new promise which is settled in the same way as the + first passed promise to settle. + + Example: + + ```javascript + let promise1 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 1'); + }, 200); + }); + + let promise2 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 2'); + }, 100); + }); + + RSVP.Promise.race([promise1, promise2]).then(function(result){ + // result === 'promise 2' because it was resolved before promise1 + // was resolved. + }); + ``` + + `RSVP.Promise.race` is deterministic in that only the state of the first + settled promise matters. For example, even if other promises given to the + `promises` array argument are resolved, but the first settled promise has + become rejected before the other promises became fulfilled, the returned + promise will become rejected: + + ```javascript + let promise1 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 1'); + }, 200); + }); + + let promise2 = new RSVP.Promise(function(resolve, reject){ + setTimeout(function(){ + reject(new Error('promise 2')); + }, 100); + }); + + RSVP.Promise.race([promise1, promise2]).then(function(result){ + // Code here never runs + }, function(reason){ + // reason.message === 'promise 2' because promise 2 became rejected before + // promise 1 became fulfilled + }); + ``` + + An example real-world use case is implementing timeouts: + + ```javascript + RSVP.Promise.race([ajax('foo.json'), timeout(5000)]) + ``` + + @method race + @static + @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. + */ + function race(entries, label) { + /*jshint validthis:true */ + var Constructor = this; - var myObject = new MyConstructor(); + var promise = new Constructor(noop, label); - RSVP.hash(myObject).then(function(hash){ - // protoProperty will not be present, instead you will just have an - // object that looks like: - // { - // example: 'Example' - // } - // - // hash.hasOwnProperty('protoProperty'); // false - // 'undefined' === typeof hash.protoProperty - }); - ``` + if (!isArray(entries)) { + reject(promise, new TypeError('You must pass an array to race.')); + return promise; + } - @method hash - @static - @for RSVP - @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. -*/ -function hash(object, label) { - return new PromiseHash(Promise, object, label).promise; -} + for (var i = 0; promise._state === PENDING && i < entries.length; i++) { + subscribe(Constructor.resolve(entries[i]), undefined, function (value) { + return resolve(promise, value); + }, function (reason) { + return reject(promise, reason); + }); + } -function HashSettled(Constructor, object, label) { - this._superConstructor(Constructor, object, false, label); -} + return promise; + } + + /** + `RSVP.Promise.reject` returns a promise rejected with the passed `reason`. + It is shorthand for the following: + + ```javascript + let promise = new RSVP.Promise(function(resolve, reject){ + reject(new Error('WHOOPS')); + }); + + promise.then(function(value){ + // Code here doesn't run because the promise is rejected! + }, function(reason){ + // reason.message === 'WHOOPS' + }); + ``` + + Instead of writing the above, your code now simply becomes the following: + + ```javascript + let promise = RSVP.Promise.reject(new Error('WHOOPS')); + + promise.then(function(value){ + // Code here doesn't run because the promise is rejected! + }, function(reason){ + // reason.message === 'WHOOPS' + }); + ``` + + @method reject + @static + @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$1(reason, label) { + /*jshint validthis:true */ + var Constructor = this; + var promise = new Constructor(noop, label); + reject(promise, reason); + return promise; + } -HashSettled.prototype = o_create(PromiseHash.prototype); -HashSettled.prototype._superConstructor = Enumerator; -HashSettled.prototype._makeResult = makeSettledResult; + var guidKey = 'rsvp_' + now() + '-'; + var counter = 0; -HashSettled.prototype._validationError = function() { - return new Error('hashSettled must be called with an object'); -}; + function needsResolver() { + throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); + } -/** - `RSVP.hashSettled` is similar to `RSVP.allSettled`, but takes an object - instead of an array for its `promises` argument. + function needsNew() { + throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); + } + + /** + 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 + why the promise cannot be fulfilled. + + Terminology + ----------- + + - `promise` is an object or function with a `then` method whose behavior conforms to this specification. + - `thenable` is an object or function that defines a `then` method. + - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). + - `exception` is a value that is thrown using the throw statement. + - `reason` is a value that indicates why a promise was rejected. + - `settled` the final resting state of a promise, fulfilled or rejected. + + A promise can be in one of three states: pending, fulfilled, or rejected. + + Promises that are fulfilled have a fulfillment value and are in the fulfilled + state. Promises that are rejected have a rejection reason and are in the + rejected state. A fulfillment value is never a thenable. + + Promises can also be said to *resolve* a value. If this value is also a + promise, then the original promise's settled state will match the value's + settled state. So a promise that *resolves* a promise that rejects will + itself reject, and a promise that *resolves* a promise that fulfills will + itself fulfill. + + + Basic Usage: + ------------ + + ```js + let promise = new Promise(function(resolve, reject) { + // on success + resolve(value); + + // on failure + reject(reason); + }); + + promise.then(function(value) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Advanced Usage: + --------------- + + Promises shine when abstracting away asynchronous interactions such as + `XMLHttpRequest`s. + + ```js + function getJSON(url) { + return new Promise(function(resolve, reject){ + let xhr = new XMLHttpRequest(); + + xhr.open('GET', url); + xhr.onreadystatechange = handler; + xhr.responseType = 'json'; + xhr.setRequestHeader('Accept', 'application/json'); + xhr.send(); + + function handler() { + if (this.readyState === this.DONE) { + if (this.status === 200) { + resolve(this.response); + } else { + reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); + } + } + }; + }); + } + + getJSON('/posts.json').then(function(json) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Unlike callbacks, promises are great composable primitives. + + ```js + Promise.all([ + getJSON('/posts'), + getJSON('/comments') + ]).then(function(values){ + values[0] // => postsJSON + values[1] // => commentsJSON + + return values; + }); + ``` + + @class RSVP.Promise + @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 = []; - Unlike `RSVP.all` or `RSVP.hash`, which implement a fail-fast method, - but like `RSVP.allSettled`, `hashSettled` waits until all the - constituent promises have returned and then shows you all the results - with their states and values/reasons. This is useful if you want to - handle multiple promises' failure states together as a set. + config.instrument && instrument('created', this); - Returns a promise that is fulfilled when all the given promises have been - settled, or rejected if the passed parameters are invalid. + if (noop !== resolver) { + typeof resolver !== 'function' && needsResolver(); + this instanceof Promise ? initializePromise(this, resolver) : needsNew(); + } + } - The returned promise is fulfilled with a hash that has the same key names as - the `promises` object argument. If any of the values in the object are not - promises, they will be copied over to the fulfilled object and marked with state - 'fulfilled'. + Promise.cast = resolve$1; // deprecated + Promise.all = all; + Promise.race = race; + Promise.resolve = resolve$1; + Promise.reject = reject$1; - Example: + Promise.prototype = { + constructor: Promise, - ```javascript - var promises = { - myPromise: RSVP.Promise.resolve(1), - yourPromise: RSVP.Promise.resolve(2), - theirPromise: RSVP.Promise.resolve(3), - notAPromise: 4 - }; + _guidKey: guidKey, - RSVP.hashSettled(promises).then(function(hash){ - // hash here is an object that looks like: - // { - // myPromise: { state: 'fulfilled', value: 1 }, - // yourPromise: { state: 'fulfilled', value: 2 }, - // theirPromise: { state: 'fulfilled', value: 3 }, - // notAPromise: { state: 'fulfilled', value: 4 } - // } - }); - ``` + _onError: function (reason) { + var promise = this; + config.after(function () { + if (promise._onError) { + config['trigger']('error', reason, promise._label); + } + }); + }, + + /** + 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 why the promise cannot be fulfilled. + + ```js + findUser().then(function(user){ + // user is available + }, function(reason){ + // user is unavailable, and you are given the reason why + }); + ``` + + Chaining + -------- + + The return value of `then` is itself a promise. This second, 'downstream' + promise is resolved with the return value of the first promise's fulfillment + or rejection handler, or rejected if the handler throws an exception. + + ```js + findUser().then(function (user) { + return user.name; + }, function (reason) { + return 'default name'; + }).then(function (userName) { + // If `findUser` fulfilled, `userName` will be the user's name, otherwise it + // will be `'default name'` + }); + + findUser().then(function (user) { + throw new Error('Found user, but still unhappy'); + }, function (reason) { + throw new Error('`findUser` rejected and we\'re unhappy'); + }).then(function (value) { + // never reached + }, function (reason) { + // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. + // If `findUser` rejected, `reason` will be '`findUser` rejected and we\'re unhappy'. + }); + ``` + If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. + + ```js + findUser().then(function (user) { + throw new PedagogicalException('Upstream error'); + }).then(function (value) { + // never reached + }).then(function (value) { + // never reached + }, function (reason) { + // The `PedgagocialException` is propagated all the way down to here + }); + ``` + + Assimilation + ------------ + + Sometimes the value you want to propagate to a downstream promise can only be + retrieved asynchronously. This can be achieved by returning a promise in the + fulfillment or rejection handler. The downstream promise will then be pending + until the returned promise is settled. This is called *assimilation*. + + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // The user's comments are now available + }); + ``` + + If the assimliated promise rejects, then the downstream promise will also reject. + + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // If `findCommentsByAuthor` fulfills, we'll have the value here + }, function (reason) { + // If `findCommentsByAuthor` rejects, we'll have the reason here + }); + ``` + + Simple Example + -------------- + + Synchronous Example + + ```javascript + let result; + + try { + result = findResult(); + // success + } catch(reason) { + // failure + } + ``` + + Errback Example + + ```js + findResult(function(result, err){ + if (err) { + // failure + } else { + // success + } + }); + ``` + + Promise Example; + + ```javascript + findResult().then(function(result){ + // success + }, function(reason){ + // failure + }); + ``` + + Advanced Example + -------------- + + Synchronous Example + + ```javascript + let author, books; + + try { + author = findAuthor(); + books = findBooksByAuthor(author); + // success + } catch(reason) { + // failure + } + ``` + + Errback Example + + ```js + + function foundBooks(books) { + + } + + function failure(reason) { + + } + + findAuthor(function(author, err){ + if (err) { + failure(err); + // failure + } else { + try { + findBoooksByAuthor(author, function(books, err) { + if (err) { + failure(err); + } else { + try { + foundBooks(books); + } catch(reason) { + failure(reason); + } + } + }); + } catch(error) { + failure(err); + } + // success + } + }); + ``` + + Promise Example; + + ```javascript + findAuthor(). + then(findBooksByAuthor). + then(function(books){ + // found books + }).catch(function(reason){ + // something went wrong + }); + ``` + + @method then + @param {Function} onFulfillment + @param {Function} onRejection + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + */ + then: then, - If any of the `promises` given to `RSVP.hash` are rejected, the state will - be set to 'rejected' and the reason for rejection provided. + /** + `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same + as the catch block of a try/catch statement. + + ```js + function findAuthor(){ + throw new Error('couldn\'t find that author'); + } + + // synchronous + try { + findAuthor(); + } catch(reason) { + // something went wrong + } + + // async with promises + findAuthor().catch(function(reason){ + // something went wrong + }); + ``` + + @method catch + @param {Function} onRejection + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + */ + catch: function (onRejection, label) { + return this.then(undefined, onRejection, label); + }, - Example: + /** + `finally` will be invoked regardless of the promise's fate just as native + try/catch/finally behaves + + Synchronous example: + + ```js + findAuthor() { + if (Math.random() > 0.5) { + throw new Error(); + } + return new Author(); + } + + try { + return findAuthor(); // succeed or fail + } catch(error) { + return findOtherAuther(); + } finally { + // always runs + // doesn't affect the return value + } + ``` + + Asynchronous example: + + ```js + findAuthor().catch(function(reason){ + return findOtherAuther(); + }).finally(function(){ + // author was either found, or not + }); + ``` + + @method finally + @param {Function} callback + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} + */ + finally: function (callback, label) { + var promise = this; + var constructor = promise.constructor; - ```javascript - var promises = { - myPromise: RSVP.Promise.resolve(1), - rejectedPromise: RSVP.Promise.reject(new Error('rejection')), - anotherRejectedPromise: RSVP.Promise.reject(new Error('more rejection')), + return promise.then(function (value) { + return constructor.resolve(callback()).then(function () { + return value; + }); + }, function (reason) { + return constructor.resolve(callback()).then(function () { + throw reason; + }); + }, label); + } }; - RSVP.hashSettled(promises).then(function(hash){ - // hash here is an object that looks like: - // { - // myPromise: { state: 'fulfilled', value: 1 }, - // rejectedPromise: { state: 'rejected', reason: Error }, - // anotherRejectedPromise: { state: 'rejected', reason: Error }, - // } - // Note that for rejectedPromise, reason.message == 'rejection', - // and for anotherRejectedPromise, reason.message == 'more rejection'. - }); - ``` + function Result() { + this.value = undefined; + } - An important note: `RSVP.hashSettled` is intended for plain JavaScript objects that - are just a set of keys and values. `RSVP.hashSettled` will NOT preserve prototype - chains. + var ERROR = new Result(); + var GET_THEN_ERROR$1 = new Result(); - Example: + function getThen$1(obj) { + try { + return obj.then; + } catch (error) { + ERROR.value = error; + return ERROR; + } + } - ```javascript - function MyConstructor(){ - this.example = RSVP.Promise.resolve('Example'); + function tryApply(f, s, a) { + try { + f.apply(s, a); + } catch (error) { + ERROR.value = error; + return ERROR; + } } - MyConstructor.prototype = { - protoProperty: RSVP.Promise.resolve('Proto Property') - }; + function makeObject(_, argumentNames) { + var obj = {}; + var length = _.length; + var args = new Array(length); - var myObject = new MyConstructor(); + for (var x = 0; x < length; x++) { + args[x] = _[x]; + } - RSVP.hashSettled(myObject).then(function(hash){ - // protoProperty will not be present, instead you will just have an - // object that looks like: - // { - // example: { state: 'fulfilled', value: 'Example' } - // } - // - // hash.hasOwnProperty('protoProperty'); // false - // 'undefined' === typeof hash.protoProperty - }); - ``` + for (var i = 0; i < argumentNames.length; i++) { + var _name = argumentNames[i]; + obj[_name] = args[i + 1]; + } - @method hashSettled - @for RSVP - @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 -*/ -function hashSettled(object, label) { - return new HashSettled(Promise, object, label).promise; -} + return obj; + } -/** - `RSVP.rethrow` will rethrow an error on the next turn of the JavaScript event - loop in order to aid debugging. + function arrayResult(_) { + var length = _.length; + var args = new Array(length - 1); - Promises A+ specifies that any exceptions that occur with a promise must be - caught by the promises implementation and bubbled to the last handler. For - this reason, it is recommended that you always specify a second rejection - handler function to `then`. However, `RSVP.rethrow` will throw the exception - outside of the promise, so it bubbles up to your console if in the browser, - or domain/cause uncaught exception in Node. `rethrow` will also throw the - error again so the error can be handled by the promise per the spec. + for (var i = 1; i < length; i++) { + args[i - 1] = _[i]; + } - ```javascript - function throws(){ - throw new Error('Whoops!'); + return args; } - var promise = new RSVP.Promise(function(resolve, reject){ - throws(); - }); - - promise.catch(RSVP.rethrow).then(function(){ - // Code here doesn't run because the promise became rejected due to an - // error! - }, function (err){ - // handle the error here - }); - ``` + function wrapThenable(then, promise) { + return { + then: function (onFulFillment, onRejection) { + return then.call(promise, onFulFillment, onRejection); + } + }; + } - The 'Whoops' error will be thrown on the next turn of the event loop - and you can watch for it in your console. You can also handle it using a - rejection handler given to `.then` or `.catch` on the returned promise. + /** + `RSVP.denodeify` takes a 'node-style' function and returns a function that + will return an `RSVP.Promise`. You can use `denodeify` in Node.js or the + browser when you'd prefer to use promises over using callbacks. For example, + `denodeify` transforms the following: + + ```javascript + let fs = require('fs'); + + fs.readFile('myfile.txt', function(err, data){ + if (err) return handleError(err); + handleData(data); + }); + ``` + + into: + + ```javascript + let fs = require('fs'); + let readFile = RSVP.denodeify(fs.readFile); + + readFile('myfile.txt').then(handleData, handleError); + ``` + + If the node function has multiple success parameters, then `denodeify` + just returns the first one: + + ```javascript + let request = RSVP.denodeify(require('request')); + + request('http://example.com').then(function(res) { + // ... + }); + ``` + + However, if you need all success parameters, setting `denodeify`'s + second parameter to `true` causes it to return all success parameters + as an array: + + ```javascript + let request = RSVP.denodeify(require('request'), true); + + request('http://example.com').then(function(result) { + // result[0] -> res + // result[1] -> body + }); + ``` + + Or if you pass it an array with names it returns the parameters as a hash: + + ```javascript + let request = RSVP.denodeify(require('request'), ['res', 'body']); + + request('http://example.com').then(function(result) { + // result.res + // result.body + }); + ``` + + Sometimes you need to retain the `this`: + + ```javascript + let app = require('express')(); + let render = RSVP.denodeify(app.render.bind(app)); + ``` + + The denodified function inherits from the original function. It works in all + environments, except IE 10 and below. Consequently all properties of the original + function are available to you. However, any properties you change on the + denodeified function won't be changed on the original function. Example: + + ```javascript + let request = RSVP.denodeify(require('request')), + cookieJar = request.jar(); // <- Inheritance is used here + + request('http://example.com', {jar: cookieJar}).then(function(res) { + // cookieJar.cookies holds now the cookies returned by example.com + }); + ``` + + Using `denodeify` makes it easier to compose asynchronous operations instead + of using callbacks. For example, instead of: + + ```javascript + let fs = require('fs'); + + fs.readFile('myfile.txt', function(err, data){ + if (err) { ... } // Handle error + fs.writeFile('myfile2.txt', data, function(err){ + if (err) { ... } // Handle error + console.log('done') + }); + }); + ``` + + you can chain the operations together using `then` from the returned promise: + + ```javascript + let fs = require('fs'); + let readFile = RSVP.denodeify(fs.readFile); + let writeFile = RSVP.denodeify(fs.writeFile); + + readFile('myfile.txt').then(function(data){ + return writeFile('myfile2.txt', data); + }).then(function(){ + console.log('done') + }).catch(function(error){ + // Handle error + }); + ``` + + @method denodeify + @static + @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} [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. + @return {Function} a function that wraps `nodeFunc` to return an + `RSVP.Promise` + @static + */ + function denodeify(nodeFunc, options) { + var fn = function () { + var self = this; + var l = arguments.length; + var args = new Array(l + 1); + var promiseInput = false; + + for (var i = 0; i < l; ++i) { + var arg = arguments[i]; + + if (!promiseInput) { + // TODO: clean this up + promiseInput = needsPromiseInput(arg); + if (promiseInput === GET_THEN_ERROR$1) { + var p = new Promise(noop); + reject(p, GET_THEN_ERROR$1.value); + return p; + } else if (promiseInput && promiseInput !== true) { + arg = wrapThenable(promiseInput, arg); + } + } + args[i] = arg; + } - @method rethrow - @static - @for RSVP - @param {Error} reason reason the promise became rejected. - @throws Error - @static -*/ -function rethrow(reason) { - setTimeout(function() { - throw reason; - }); - throw reason; -} + var promise = new Promise(noop); -/** - `RSVP.defer` returns an object similar to jQuery's `$.Deferred`. - `RSVP.defer` should be used when porting over code reliant on `$.Deferred`'s - interface. New code should use the `RSVP.Promise` constructor instead. + args[l] = function (err, val) { + if (err) reject(promise, err);else if (options === undefined) resolve(promise, val);else if (options === true) resolve(promise, arrayResult(arguments));else if (isArray(options)) resolve(promise, makeObject(arguments, options));else resolve(promise, val); + }; - The object returned from `RSVP.defer` is a plain object with three properties: + if (promiseInput) { + return handlePromiseInput(promise, args, nodeFunc, self); + } else { + return handleValueInput(promise, args, nodeFunc, self); + } + }; - * promise - an `RSVP.Promise`. - * reject - a function that causes the `promise` property on this object to - become rejected - * resolve - a function that causes the `promise` property on this object to - become fulfilled. + babelHelpers.defaults(fn, nodeFunc); - Example: + return fn; + } - ```javascript - var deferred = RSVP.defer(); + function handleValueInput(promise, args, nodeFunc, self) { + var result = tryApply(nodeFunc, self, args); + if (result === ERROR) { + reject(promise, result.value); + } + return promise; + } - deferred.resolve("Success!"); + function handlePromiseInput(promise, args, nodeFunc, self) { + return Promise.all(args).then(function (args) { + var result = tryApply(nodeFunc, self, args); + if (result === ERROR) { + reject(promise, result.value); + } + return promise; + }); + } - deferred.promise.then(function(value){ - // value here is "Success!" - }); - ``` + function needsPromiseInput(arg) { + if (arg && typeof arg === 'object') { + if (arg.constructor === Promise) { + return true; + } else { + return getThen$1(arg); + } + } else { + return false; + } + } - @method defer - @static - @for RSVP - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Object} - */ + /** + This is a convenient alias for `RSVP.Promise.all`. + + @method all + @static + @for RSVP + @param {Array} array Array of promises. + @param {String} label An optional label. This is useful + for tooling. + */ + function all$1(array, label) { + return Promise.all(array, label); + } -function defer(label) { - var deferred = {}; + function AllSettled(Constructor, entries, label) { + this._superConstructor(Constructor, entries, false, /* don't abort on reject */label); + } - deferred['promise'] = new Promise(function(resolve, reject) { - deferred['resolve'] = resolve; - deferred['reject'] = reject; - }, label); + AllSettled.prototype = o_create(Enumerator.prototype); + AllSettled.prototype._superConstructor = Enumerator; + AllSettled.prototype._makeResult = makeSettledResult; + AllSettled.prototype._validationError = function () { + return new Error('allSettled must be called with an array'); + }; - return deferred; -} + /** + `RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing + a fail-fast method, it waits until all the promises have returned and + shows you all the results. This is useful if you want to handle multiple + promises' failure states together as a set. + + Returns a promise that is fulfilled when all the given promises have been + settled. The return promise is fulfilled with an array of the states of + the promises passed into the `promises` array argument. + + Each state object will either indicate fulfillment or rejection, and + provide the corresponding value or reason. The states will take one of + the following formats: + + ```javascript + { state: 'fulfilled', value: value } + or + { state: 'rejected', reason: reason } + ``` + + Example: + + ```javascript + let promise1 = RSVP.Promise.resolve(1); + let promise2 = RSVP.Promise.reject(new Error('2')); + let promise3 = RSVP.Promise.reject(new Error('3')); + let promises = [ promise1, promise2, promise3 ]; + + RSVP.allSettled(promises).then(function(array){ + // array == [ + // { state: 'fulfilled', value: 1 }, + // { state: 'rejected', reason: Error }, + // { state: 'rejected', reason: Error } + // ] + // Note that for the second item, reason.message will be '2', and for the + // third item, reason.message will be '3'. + }, function(error) { + // Not run. (This block would only be called if allSettled had failed, + // for instance if passed an incorrect argument type.) + }); + ``` + + @method allSettled + @static + @for RSVP + @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. + */ -/** - `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 - each item in given to `promises`. `RSVP.map` returns a promise that will - become fulfilled with the result of running `mapFn` on the values the promises - become fulfilled with. + function allSettled(entries, label) { + return new AllSettled(Promise, entries, label).promise; + } - For example: + /** + This is a convenient alias for `RSVP.Promise.race`. + + @method race + @static + @for RSVP + @param {Array} array Array of promises. + @param {String} label An optional label. This is useful + for tooling. + */ + function race$1(array, label) { + return Promise.race(array, label); + } - ```javascript + function PromiseHash(Constructor, object, label) { + this._superConstructor(Constructor, object, true, label); + } - var promise1 = RSVP.resolve(1); - var promise2 = RSVP.resolve(2); - var promise3 = RSVP.resolve(3); - var promises = [ promise1, promise2, promise3 ]; + PromiseHash.prototype = o_create(Enumerator.prototype); + PromiseHash.prototype._superConstructor = Enumerator; + PromiseHash.prototype._init = function () { + this._result = {}; + }; - var mapFn = function(item){ - return item + 1; + PromiseHash.prototype._validateInput = function (input) { + return input && typeof input === 'object'; }; - RSVP.map(promises, mapFn).then(function(result){ - // result is [ 2, 3, 4 ] - }); - ``` + PromiseHash.prototype._validationError = function () { + return new Error('Promise.hash must be called with an object'); + }; - If any of the `promises` given to `RSVP.map` are rejected, the first promise - that is rejected will be given as an argument to the returned promise's - rejection handler. For example: + PromiseHash.prototype._enumerate = function () { + var enumerator = this; + var promise = enumerator.promise; + var input = enumerator._input; + var results = []; + + for (var key in input) { + if (promise._state === PENDING && Object.prototype.hasOwnProperty.call(input, key)) { + results.push({ + position: key, + entry: input[key] + }); + } + } - ```javascript - var promise1 = RSVP.resolve(1); - var promise2 = RSVP.reject(new Error('2')); - var promise3 = RSVP.reject(new Error('3')); - var promises = [ promise1, promise2, promise3 ]; + var length = results.length; + enumerator._remaining = length; + var result = undefined; - var mapFn = function(item){ - return item + 1; + for (var i = 0; promise._state === PENDING && i < length; i++) { + result = results[i]; + enumerator._eachEntry(result.entry, result.position); + } }; - RSVP.map(promises, mapFn).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(reason) { - // reason.message === '2' - }); - ``` + /** + `RSVP.hash` is similar to `RSVP.all`, but takes an object instead of an array + for its `promises` argument. + + Returns a promise that is fulfilled when all the given promises have been + fulfilled, or rejected if any of them become rejected. The returned promise + is fulfilled with a hash that has the same key names as the `promises` object + argument. If any of the values in the object are not promises, they will + simply be copied over to the fulfilled object. + + Example: + + ```javascript + let promises = { + myPromise: RSVP.resolve(1), + yourPromise: RSVP.resolve(2), + theirPromise: RSVP.resolve(3), + notAPromise: 4 + }; + + RSVP.hash(promises).then(function(hash){ + // hash here is an object that looks like: + // { + // myPromise: 1, + // yourPromise: 2, + // theirPromise: 3, + // notAPromise: 4 + // } + }); + ```` + + If any of the `promises` given to `RSVP.hash` are rejected, the first promise + that is rejected will be given as the reason to the rejection handler. + + Example: + + ```javascript + let promises = { + myPromise: RSVP.resolve(1), + rejectedPromise: RSVP.reject(new Error('rejectedPromise')), + anotherRejectedPromise: RSVP.reject(new Error('anotherRejectedPromise')), + }; + + RSVP.hash(promises).then(function(hash){ + // Code here never runs because there are rejected promises! + }, function(reason) { + // reason.message === 'rejectedPromise' + }); + ``` + + An important note: `RSVP.hash` is intended for plain JavaScript objects that + are just a set of keys and values. `RSVP.hash` will NOT preserve prototype + chains. + + Example: + + ```javascript + function MyConstructor(){ + this.example = RSVP.resolve('Example'); + } + + MyConstructor.prototype = { + protoProperty: RSVP.resolve('Proto Property') + }; + + let myObject = new MyConstructor(); + + RSVP.hash(myObject).then(function(hash){ + // protoProperty will not be present, instead you will just have an + // object that looks like: + // { + // example: 'Example' + // } + // + // hash.hasOwnProperty('protoProperty'); // false + // 'undefined' === typeof hash.protoProperty + }); + ``` + + @method hash + @static + @for RSVP + @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. + */ + function hash(object, label) { + return new PromiseHash(Promise, object, label).promise; + } - `RSVP.map` will also wait if a promise is returned from `mapFn`. For example, - say you want to get all comments from a set of blog posts, but you need - the blog posts first because they contain a url to those comments. + function HashSettled(Constructor, object, label) { + this._superConstructor(Constructor, object, false, label); + } - ```javscript + HashSettled.prototype = o_create(PromiseHash.prototype); + HashSettled.prototype._superConstructor = Enumerator; + HashSettled.prototype._makeResult = makeSettledResult; - var mapFn = function(blogPost){ - // getComments does some ajax and returns an RSVP.Promise that is fulfilled - // with some comments data - return getComments(blogPost.comments_url); + HashSettled.prototype._validationError = function () { + return new Error('hashSettled must be called with an object'); }; - // getBlogPosts does some ajax and returns an RSVP.Promise that is fulfilled - // with some blog post data - RSVP.map(getBlogPosts(), mapFn).then(function(comments){ - // comments is the result of asking the server for the comments - // of all blog posts returned from getBlogPosts() - }); - ``` - - @method map - @static - @for RSVP - @param {Array} promises - @param {Function} mapFn function to be called on each fulfilled promise. - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} promise that is fulfilled with the result of calling - `mapFn` on each fulfilled promise or value when they become fulfilled. - The promise will be rejected if any of the given `promises` become rejected. - @static -*/ -function map(promises, mapFn, label) { - return Promise.all(promises, label).then(function(values) { - if (!isFunction(mapFn)) { - throw new TypeError("You must pass a function as map's second argument."); + /** + `RSVP.hashSettled` is similar to `RSVP.allSettled`, but takes an object + instead of an array for its `promises` argument. + + Unlike `RSVP.all` or `RSVP.hash`, which implement a fail-fast method, + but like `RSVP.allSettled`, `hashSettled` waits until all the + constituent promises have returned and then shows you all the results + with their states and values/reasons. This is useful if you want to + handle multiple promises' failure states together as a set. + + Returns a promise that is fulfilled when all the given promises have been + settled, or rejected if the passed parameters are invalid. + + The returned promise is fulfilled with a hash that has the same key names as + the `promises` object argument. If any of the values in the object are not + promises, they will be copied over to the fulfilled object and marked with state + 'fulfilled'. + + Example: + + ```javascript + let promises = { + myPromise: RSVP.Promise.resolve(1), + yourPromise: RSVP.Promise.resolve(2), + theirPromise: RSVP.Promise.resolve(3), + notAPromise: 4 + }; + + RSVP.hashSettled(promises).then(function(hash){ + // hash here is an object that looks like: + // { + // myPromise: { state: 'fulfilled', value: 1 }, + // yourPromise: { state: 'fulfilled', value: 2 }, + // theirPromise: { state: 'fulfilled', value: 3 }, + // notAPromise: { state: 'fulfilled', value: 4 } + // } + }); + ``` + + If any of the `promises` given to `RSVP.hash` are rejected, the state will + be set to 'rejected' and the reason for rejection provided. + + Example: + + ```javascript + let promises = { + myPromise: RSVP.Promise.resolve(1), + rejectedPromise: RSVP.Promise.reject(new Error('rejection')), + anotherRejectedPromise: RSVP.Promise.reject(new Error('more rejection')), + }; + + RSVP.hashSettled(promises).then(function(hash){ + // hash here is an object that looks like: + // { + // myPromise: { state: 'fulfilled', value: 1 }, + // rejectedPromise: { state: 'rejected', reason: Error }, + // anotherRejectedPromise: { state: 'rejected', reason: Error }, + // } + // Note that for rejectedPromise, reason.message == 'rejection', + // and for anotherRejectedPromise, reason.message == 'more rejection'. + }); + ``` + + An important note: `RSVP.hashSettled` is intended for plain JavaScript objects that + are just a set of keys and values. `RSVP.hashSettled` will NOT preserve prototype + chains. + + Example: + + ```javascript + function MyConstructor(){ + this.example = RSVP.Promise.resolve('Example'); } + + MyConstructor.prototype = { + protoProperty: RSVP.Promise.resolve('Proto Property') + }; + + let myObject = new MyConstructor(); + + RSVP.hashSettled(myObject).then(function(hash){ + // protoProperty will not be present, instead you will just have an + // object that looks like: + // { + // example: { state: 'fulfilled', value: 'Example' } + // } + // + // hash.hasOwnProperty('protoProperty'); // false + // 'undefined' === typeof hash.protoProperty + }); + ``` + + @method hashSettled + @for RSVP + @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 + */ + function hashSettled(object, label) { + return new HashSettled(Promise, object, label).promise; + } - var length = values.length; - var results = new Array(length); - - for (var i = 0; i < length; i++) { - results[i] = mapFn(values[i]); + /** + `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 + caught by the promises implementation and bubbled to the last handler. For + this reason, it is recommended that you always specify a second rejection + handler function to `then`. However, `RSVP.rethrow` will throw the exception + outside of the promise, so it bubbles up to your console if in the browser, + or domain/cause uncaught exception in Node. `rethrow` will also throw the + error again so the error can be handled by the promise per the spec. + + ```javascript + function throws(){ + throw new Error('Whoops!'); } + + let promise = new RSVP.Promise(function(resolve, reject){ + throws(); + }); + + promise.catch(RSVP.rethrow).then(function(){ + // Code here doesn't run because the promise became rejected due to an + // error! + }, function (err){ + // handle the error here + }); + ``` + + The 'Whoops' error will be thrown on the next turn of the event loop + and you can watch for it in your console. You can also handle it using a + rejection handler given to `.then` or `.catch` on the returned promise. + + @method rethrow + @static + @for RSVP + @param {Error} reason reason the promise became rejected. + @throws Error + @static + */ + function rethrow(reason) { + setTimeout(function () { + throw reason; + }); + throw reason; + } - return Promise.all(results, label); - }); -} - -/** - This is a convenient alias for `RSVP.Promise.resolve`. + /** + `RSVP.defer` returns an object similar to jQuery's `$.Deferred`. + `RSVP.defer` should be used when porting over code reliant on `$.Deferred`'s + interface. New code should use the `RSVP.Promise` constructor instead. + + The object returned from `RSVP.defer` is a plain object with three properties: + + * promise - an `RSVP.Promise`. + * reject - a function that causes the `promise` property on this object to + become rejected + * resolve - a function that causes the `promise` property on this object to + become fulfilled. + + Example: + + ```javascript + let deferred = RSVP.defer(); + + deferred.resolve("Success!"); + + deferred.promise.then(function(value){ + // value here is "Success!" + }); + ``` + + @method defer + @static + @for RSVP + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Object} + */ - @method resolve - @static - @for RSVP - @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` -*/ -function resolve$2(value, label) { - return Promise.resolve(value, label); -} + function defer(label) { + var deferred = { resolve: undefined, reject: undefined }; -/** - This is a convenient alias for `RSVP.Promise.reject`. + deferred.promise = new Promise(function (resolve, reject) { + deferred.resolve = resolve; + deferred.reject = reject; + }, label); - @method reject - @static - @for RSVP - @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$2(reason, label) { - return Promise.reject(reason, label); -} + return deferred; + } -/** - `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 - each item in given to `promises`. `RSVP.filter` returns a promise that will - become fulfilled with the result of running `filterFn` on the values the - promises become fulfilled with. + /** + `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 + each item in given to `promises`. `RSVP.map` returns a promise that will + become fulfilled with the result of running `mapFn` on the values the promises + become fulfilled with. + + For example: + + ```javascript + + let promise1 = RSVP.resolve(1); + let promise2 = RSVP.resolve(2); + let promise3 = RSVP.resolve(3); + let promises = [ promise1, promise2, promise3 ]; + + let mapFn = function(item){ + return item + 1; + }; + + RSVP.map(promises, mapFn).then(function(result){ + // result is [ 2, 3, 4 ] + }); + ``` + + If any of the `promises` given to `RSVP.map` are rejected, the first promise + that is rejected will be given as an argument to the returned promise's + rejection handler. For example: + + ```javascript + let promise1 = RSVP.resolve(1); + let promise2 = RSVP.reject(new Error('2')); + let promise3 = RSVP.reject(new Error('3')); + let promises = [ promise1, promise2, promise3 ]; + + let mapFn = function(item){ + return item + 1; + }; + + RSVP.map(promises, mapFn).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(reason) { + // reason.message === '2' + }); + ``` + + `RSVP.map` will also wait if a promise is returned from `mapFn`. For example, + say you want to get all comments from a set of blog posts, but you need + the blog posts first because they contain a url to those comments. + + ```javscript + + let mapFn = function(blogPost){ + // getComments does some ajax and returns an RSVP.Promise that is fulfilled + // with some comments data + return getComments(blogPost.comments_url); + }; + + // getBlogPosts does some ajax and returns an RSVP.Promise that is fulfilled + // with some blog post data + RSVP.map(getBlogPosts(), mapFn).then(function(comments){ + // comments is the result of asking the server for the comments + // of all blog posts returned from getBlogPosts() + }); + ``` + + @method map + @static + @for RSVP + @param {Array} promises + @param {Function} mapFn function to be called on each fulfilled promise. + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} promise that is fulfilled with the result of calling + `mapFn` on each fulfilled promise or value when they become fulfilled. + The promise will be rejected if any of the given `promises` become rejected. + @static + */ + function map(promises, mapFn, label) { + return Promise.all(promises, label).then(function (values) { + if (!isFunction(mapFn)) { + throw new TypeError("You must pass a function as map's second argument."); + } - For example: + var length = values.length; + var results = new Array(length); - ```javascript + for (var i = 0; i < length; i++) { + results[i] = mapFn(values[i]); + } - var promise1 = RSVP.resolve(1); - var promise2 = RSVP.resolve(2); - var promise3 = RSVP.resolve(3); + return Promise.all(results, label); + }); + } - var promises = [promise1, promise2, promise3]; + /** + This is a convenient alias for `RSVP.Promise.resolve`. + + @method resolve + @static + @for RSVP + @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` + */ + function resolve$2(value, label) { + return Promise.resolve(value, label); + } - var filterFn = function(item){ - return item > 1; - }; + /** + This is a convenient alias for `RSVP.Promise.reject`. + + @method reject + @static + @for RSVP + @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$2(reason, label) { + return Promise.reject(reason, label); + } - RSVP.filter(promises, filterFn).then(function(result){ - // result is [ 2, 3 ] - }); - ``` + /** + `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 + each item in given to `promises`. `RSVP.filter` returns a promise that will + become fulfilled with the result of running `filterFn` on the values the + promises become fulfilled with. + + For example: + + ```javascript + + let promise1 = RSVP.resolve(1); + let promise2 = RSVP.resolve(2); + let promise3 = RSVP.resolve(3); + + let promises = [promise1, promise2, promise3]; + + let filterFn = function(item){ + return item > 1; + }; + + RSVP.filter(promises, filterFn).then(function(result){ + // result is [ 2, 3 ] + }); + ``` + + If any of the `promises` given to `RSVP.filter` are rejected, the first promise + that is rejected will be given as an argument to the returned promise's + rejection handler. For example: + + ```javascript + let promise1 = RSVP.resolve(1); + let promise2 = RSVP.reject(new Error('2')); + let promise3 = RSVP.reject(new Error('3')); + let promises = [ promise1, promise2, promise3 ]; + + let filterFn = function(item){ + return item > 1; + }; + + RSVP.filter(promises, filterFn).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(reason) { + // reason.message === '2' + }); + ``` + + `RSVP.filter` will also wait for any promises returned from `filterFn`. + For instance, you may want to fetch a list of users then return a subset + of those users based on some asynchronous operation: + + ```javascript + + let alice = { name: 'alice' }; + let bob = { name: 'bob' }; + let users = [ alice, bob ]; + + let promises = users.map(function(user){ + return RSVP.resolve(user); + }); + + let filterFn = function(user){ + // Here, Alice has permissions to create a blog post, but Bob does not. + return getPrivilegesForUser(user).then(function(privs){ + return privs.can_create_blog_post === true; + }); + }; + RSVP.filter(promises, filterFn).then(function(users){ + // true, because the server told us only Alice can create a blog post. + users.length === 1; + // false, because Alice is the only user present in `users` + users[0] === bob; + }); + ``` + + @method filter + @static + @for RSVP + @param {Array} promises + @param {Function} filterFn - function to be called on each resolved value to + filter the final results. + @param {String} label optional string describing the promise. Useful for + tooling. + @return {Promise} + */ - If any of the `promises` given to `RSVP.filter` are rejected, the first promise - that is rejected will be given as an argument to the returned promise's - rejection handler. For example: + function resolveAll(promises, label) { + return Promise.all(promises, label); + } - ```javascript - var promise1 = RSVP.resolve(1); - var promise2 = RSVP.reject(new Error('2')); - var promise3 = RSVP.reject(new Error('3')); - var promises = [ promise1, promise2, promise3 ]; + function resolveSingle(promise, label) { + return Promise.resolve(promise, label).then(function (promises) { + return resolveAll(promises, label); + }); + } - var filterFn = function(item){ - return item > 1; - }; + function filter(promises, filterFn, label) { + var promise = isArray(promises) ? resolveAll(promises, label) : resolveSingle(promises, label); + return promise.then(function (values) { + if (!isFunction(filterFn)) { + throw new TypeError("You must pass a function as filter's second argument."); + } - RSVP.filter(promises, filterFn).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(reason) { - // reason.message === '2' - }); - ``` + var length = values.length; + var filtered = new Array(length); - `RSVP.filter` will also wait for any promises returned from `filterFn`. - For instance, you may want to fetch a list of users then return a subset - of those users based on some asynchronous operation: + for (var i = 0; i < length; i++) { + filtered[i] = filterFn(values[i]); + } - ```javascript + return resolveAll(filtered, label).then(function (filtered) { + var results = new Array(length); + var newLength = 0; - var alice = { name: 'alice' }; - var bob = { name: 'bob' }; - var users = [ alice, bob ]; + for (var i = 0; i < length; i++) { + if (filtered[i]) { + results[newLength] = values[i]; + newLength++; + } + } - var promises = users.map(function(user){ - return RSVP.resolve(user); - }); + results.length = newLength; - var filterFn = function(user){ - // Here, Alice has permissions to create a blog post, but Bob does not. - return getPrivilegesForUser(user).then(function(privs){ - return privs.can_create_blog_post === true; + return results; + }); }); - }; - RSVP.filter(promises, filterFn).then(function(users){ - // true, because the server told us only Alice can create a blog post. - users.length === 1; - // false, because Alice is the only user present in `users` - users[0] === bob; - }); - ``` + } - @method filter - @static - @for RSVP - @param {Array} promises - @param {Function} filterFn - function to be called on each resolved value to - filter the final results. - @param {String} label optional string describing the promise. Useful for - tooling. - @return {Promise} -*/ -function filter(promises, filterFn, label) { - return Promise.all(promises, label).then(function(values) { - if (!isFunction(filterFn)) { - throw new TypeError("You must pass a function as filter's second argument."); + var len = 0; + var vertxNext = undefined; + function asap(callback, arg) { + queue$1[len] = callback; + queue$1[len + 1] = arg; + len += 2; + if (len === 2) { + // If len is 1, that means that we need to schedule an async flush. + // If additional callbacks are queued before the queue is flushed, they + // will be processed by this flush that we are scheduling. + scheduleFlush$1(); + } + } + + var browserWindow = typeof window !== 'undefined' ? window : undefined; + var browserGlobal = browserWindow || {}; + var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; + var isNode = typeof self === '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 () { + return nextTick(flush); + }; + } - var length = values.length; - var filtered = new Array(length); - - for (var i = 0; i < length; i++) { - filtered[i] = filterFn(values[i]); + // vertx + function useVertxTimer() { + if (typeof vertxNext !== 'undefined') { + return function () { + vertxNext(flush); + }; } - - return Promise.all(filtered, label).then(function(filtered) { - var results = new Array(length); - var newLength = 0; - - for (var i = 0; i < length; i++) { - if (filtered[i]) { - results[newLength] = values[i]; - newLength++; - } - } - - results.length = newLength; - - return results; - }); - }); -} - -var len = 0; -var vertxNext; -function asap(callback, arg) { - queue$1[len] = callback; - queue$1[len + 1] = arg; - len += 2; - if (len === 2) { - // If len is 1, that means that we need to schedule an async flush. - // If additional callbacks are queued before the queue is flushed, they - // will be processed by this flush that we are scheduling. - scheduleFlush$1(); + return useSetTimeout(); } -} -var browserWindow = (typeof window !== 'undefined') ? window : undefined; -var browserGlobal = browserWindow || {}; -var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; -var isNode = typeof self === '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() { - nextTick(flush); - }; -} + function useMutationObserver() { + var iterations = 0; + var observer = new BrowserMutationObserver(flush); + var node = document.createTextNode(''); + observer.observe(node, { characterData: true }); -// vertx -function useVertxTimer() { - return function() { - vertxNext(flush); - }; -} + return function () { + return node.data = iterations = ++iterations % 2; + }; + } -function useMutationObserver() { - var iterations = 0; - var observer = new BrowserMutationObserver(flush); - var node = document.createTextNode(''); - observer.observe(node, { characterData: true }); + // web worker + function useMessageChannel() { + var channel = new MessageChannel(); + channel.port1.onmessage = flush; + return function () { + return channel.port2.postMessage(0); + }; + } - return function() { - node.data = (iterations = ++iterations % 2); - }; -} + function useSetTimeout() { + return function () { + return setTimeout(flush, 1); + }; + } -// web worker -function useMessageChannel() { - var channel = new MessageChannel(); - channel.port1.onmessage = flush; - return function () { - channel.port2.postMessage(0); - }; -} + var queue$1 = new Array(1000); -function useSetTimeout() { - return function() { - setTimeout(flush, 1); - }; -} + function flush() { + for (var i = 0; i < len; i += 2) { + var callback = queue$1[i]; + var arg = queue$1[i + 1]; -var queue$1 = new Array(1000); -function flush() { - for (var i = 0; i < len; i+=2) { - var callback = queue$1[i]; - var arg = queue$1[i+1]; + callback(arg); - callback(arg); + queue$1[i] = undefined; + queue$1[i + 1] = undefined; + } - queue$1[i] = undefined; - queue$1[i+1] = undefined; + len = 0; } - len = 0; -} - -function attemptVertex() { - try { - var r = require; - var vertx = r('vertx'); - vertxNext = vertx.runOnLoop || vertx.runOnContext; - return useVertxTimer(); - } catch(e) { - return useSetTimeout(); + function attemptVertex() { + try { + var r = require; + var vertx = r('vertx'); + vertxNext = vertx.runOnLoop || vertx.runOnContext; + return useVertxTimer(); + } catch (e) { + return useSetTimeout(); + } } -} - -var scheduleFlush$1; -// Decide what async method to use to triggering processing of queued callbacks: -if (isNode) { - scheduleFlush$1 = useNextTick(); -} else if (BrowserMutationObserver) { - scheduleFlush$1 = useMutationObserver(); -} else if (isWorker) { - scheduleFlush$1 = useMessageChannel(); -} else if (browserWindow === undefined && typeof require === 'function') { - scheduleFlush$1 = attemptVertex(); -} else { - scheduleFlush$1 = useSetTimeout(); -} -// defaults -config.async = asap; -config.after = function(cb) { - setTimeout(cb, 0); -}; -var cast = resolve$2; -function async(callback, arg) { - config.async(callback, arg); -} + var scheduleFlush$1 = undefined; + // Decide what async method to use to triggering processing of queued callbacks: + if (isNode) { + scheduleFlush$1 = useNextTick(); + } else if (BrowserMutationObserver) { + scheduleFlush$1 = useMutationObserver(); + } else if (isWorker) { + scheduleFlush$1 = useMessageChannel(); + } else if (browserWindow === undefined && typeof require === 'function') { + scheduleFlush$1 = attemptVertex(); + } else { + scheduleFlush$1 = useSetTimeout(); + } -function on() { - config['on'].apply(config, arguments); -} + var platform = undefined; -function off() { - config['off'].apply(config, arguments); -} + /* global self */ + if (typeof self === 'object') { + platform = self; -// Set up instrumentation through `window.__PROMISE_INTRUMENTATION__` -if (typeof window !== 'undefined' && typeof window['__PROMISE_INSTRUMENTATION__'] === 'object') { - var callbacks = window['__PROMISE_INSTRUMENTATION__']; - configure('instrument', true); - for (var eventName in callbacks) { - if (callbacks.hasOwnProperty(eventName)) { - on(eventName, callbacks[eventName]); + /* global global */ + } else if (typeof global === 'object') { + platform = global; + } else { + throw new Error('no global: `self` or `global` found'); } - } -} -exports.cast = cast; -exports.Promise = Promise; -exports.EventTarget = EventTarget; -exports.all = all$1; -exports.allSettled = allSettled; -exports.race = race$1; -exports.hash = hash; -exports.hashSettled = hashSettled; -exports.rethrow = rethrow; -exports.defer = defer; -exports.denodeify = denodeify; -exports.configure = configure; -exports.on = on; -exports.off = off; -exports.resolve = resolve$2; -exports.reject = reject$2; -exports.async = async; -exports.map = map; -exports.filter = filter; + // defaults + config.async = asap; + config.after = function (cb) { + return setTimeout(cb, 0); + }; + var cast = resolve$2; -Object.defineProperty(exports, '__esModule', { value: true }); + var async = function (callback, arg) { + return config.async(callback, arg); + }; + function on() { + config['on'].apply(config, arguments); + } + + function off() { + config['off'].apply(config, arguments); + } + + // Set up instrumentation through `window.__PROMISE_INTRUMENTATION__` + if (typeof window !== 'undefined' && typeof window['__PROMISE_INSTRUMENTATION__'] === 'object') { + var callbacks = window['__PROMISE_INSTRUMENTATION__']; + configure('instrument', true); + for (var eventName in callbacks) { + if (callbacks.hasOwnProperty(eventName)) { + on(eventName, callbacks[eventName]); + } + } + } + + // the default export here is for backwards compat: + // https://github.com/tildeio/rsvp.js/issues/434 + var rsvp = (_rsvp = { + cast: cast, + Promise: Promise, + EventTarget: EventTarget, + all: all$1, + allSettled: allSettled, + race: race$1, + hash: hash, + hashSettled: hashSettled, + rethrow: rethrow, + defer: defer, + denodeify: denodeify, + configure: configure, + on: on, + off: off, + resolve: resolve$2, + reject: reject$2, + map: map + }, _rsvp['async'] = async, _rsvp.filter = // babel seems to error if async isn't a computed prop here... + filter, _rsvp); + + exports.cast = cast; + exports.Promise = Promise; + exports.EventTarget = EventTarget; + exports.all = all$1; + exports.allSettled = allSettled; + exports.race = race$1; + exports.hash = hash; + exports.hashSettled = hashSettled; + exports.rethrow = rethrow; + exports.defer = defer; + exports.denodeify = denodeify; + exports.configure = configure; + exports.on = on; + exports.off = off; + exports.resolve = resolve$2; + exports.reject = reject$2; + exports.map = map; + exports.async = async; + exports.filter = filter; + exports.default = rsvp; }); requireModule("ember"); diff --git a/package.json b/package.json index 7a50950f9..b72b13f19 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "components-ember", - "version": "2.10.2-with-backtracking", + "version": "2.12.0-canary-with-backtracking", "description": "Ember Application Framework", "license": "MIT", "homepage": "https://github.com/emberjs/ember.js", From 64985da38e9e5e965fb25f3724c11084c34c0ae1 Mon Sep 17 00:00:00 2001 From: Gavin Joyce Date: Wed, 25 Jan 2017 21:32:27 +0000 Subject: [PATCH 3/3] fixup! --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d52b868d8..42a549289 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ When a new [build is released](http://emberjs.com/blog/2013/09/06/new-ember-rele package managers that don’t perform their own remote storage for distribution files can be instructed to find them here. -Package Managers +Package Managers. ---------------- * [Bower](http://bower.io): `ember`